Built motion from commit 0d7cdd56.|2.5.36
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 8 Oct 2021 13:22:45 +0000 (15:22 +0200)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 8 Oct 2021 13:22:45 +0000 (15:22 +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 839ceb3..6be86bf 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-08T12:53:04.799Z",
+    "time": "2021-10-08T13:09:27.296Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index a43254d..5908ca8 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-10-08T12:53:04.799Z",
+    "time": "2021-10-08T13:09:27.296Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 6ba9d5c..56778f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb73=['urlForward[body]','sequelize','exports','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x3fe05c,_0x325126){var _0x166aac=function(_0x35ef44){while(--_0x35ef44){_0x3fe05c['push'](_0x3fe05c['shift']());}};_0x166aac(++_0x325126);}(_0xeb73,0x131));var _0x3eb7=function(_0x46012c,_0x66bacf){_0x46012c=_0x46012c-0x0;var _0x26d30f=_0xeb73[_0x46012c];return _0x26d30f;};'use strict';var Sequelize=require(_0x3eb7('0x0'));module[_0x3eb7('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x22dc6c){return this[_0x3eb7('0x2')](_0x3eb7('0x3'));}},'action':{'type':Sequelize[_0x3eb7('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3eb7('0x5'),_0x3eb7('0x6'),_0x3eb7('0x7'),_0x3eb7('0x8'),_0x3eb7('0x9'),_0x3eb7('0xa'),'bot',_0x3eb7('0xb')]],'msg':_0x3eb7('0xc')}},'comment':_0x3eb7('0xc')},'data1':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xd')},'data3':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comment':_0x3eb7('0xe')},'data4':{'type':Sequelize[_0x3eb7('0x4')](0x1000),'comments':_0x3eb7('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x3eb7('0x4')],'comments':_0x3eb7('0x10')},'data7':{'type':Sequelize[_0x3eb7('0x11')],'comments':_0x3eb7('0x12')}};
\ No newline at end of file
+var _0xdbcc=['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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','integration'];(function(_0x14eb94,_0x5160d5){var _0x478589=function(_0x53194d){while(--_0x53194d){_0x14eb94['push'](_0x14eb94['shift']());}};_0x478589(++_0x5160d5);}(_0xdbcc,0x13d));var _0xcdbc=function(_0x3c6069,_0x38a996){_0x3c6069=_0x3c6069-0x0;var _0x4f0fba=_0xdbcc[_0x3c6069];return _0x4f0fba;};'use strict';var Sequelize=require(_0xcdbc('0x0'));module[_0xcdbc('0x1')]={'name':{'type':Sequelize[_0xcdbc('0x2')],'get':function(_0x3f0ceb){return this[_0xcdbc('0x3')](_0xcdbc('0x4'));}},'action':{'type':Sequelize[_0xcdbc('0x5')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xcdbc('0x6'),'motionbar',_0xcdbc('0x7'),_0xcdbc('0x8'),_0xcdbc('0x9'),_0xcdbc('0xa'),_0xcdbc('0xb')]],'msg':_0xcdbc('0xc')}},'comment':_0xcdbc('0xc')},'data1':{'type':Sequelize[_0xcdbc('0x5')](0x1000),'comment':_0xcdbc('0xd')},'data2':{'type':Sequelize[_0xcdbc('0x5')](0x1000),'comment':_0xcdbc('0xe')},'data3':{'type':Sequelize[_0xcdbc('0x5')](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':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xcdbc('0x5')](0x1000),'comments':_0xcdbc('0xf')},'data6':{'type':Sequelize[_0xcdbc('0x5')],'comments':_0xcdbc('0x10')},'data7':{'type':Sequelize[_0xcdbc('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
index 786af8e..64f544d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b74=['path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','mustache','util'];(function(_0x1517b6,_0x172069){var _0xb9d140=function(_0x41da44){while(--_0x41da44){_0x1517b6['push'](_0x1517b6['shift']());}};_0xb9d140(++_0x172069);}(_0x0b74,0x1da));var _0x40b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b74[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x40b7('0x0'));var rimraf=require(_0x40b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40b7('0x2'));var rp=require(_0x40b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40b7('0x4'));var util=require(_0x40b7('0x5'));var path=require(_0x40b7('0x6'));var sox=require(_0x40b7('0x7'));var csv=require('to-csv');var ejs=require(_0x40b7('0x8'));var fs=require('fs');var fs_extra=require(_0x40b7('0x9'));var _=require(_0x40b7('0xa'));var squel=require('squel');var crypto=require(_0x40b7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40b7('0xc'));var toCsv=require(_0x40b7('0xd'));var querystring=require(_0x40b7('0xe'));var Papa=require(_0x40b7('0xf'));var Redis=require(_0x40b7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x40b7('0x11'));var as=require(_0x40b7('0x12'));var hardwareService=require(_0x40b7('0x13'));var logger=require(_0x40b7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x40b7('0x15'));var licenseUtil=require(_0x40b7('0x16'));var db=require(_0x40b7('0x17'))['db'];function respondWithStatusCode(_0x562f60,_0x5ab69c){_0x5ab69c=_0x5ab69c||0xcc;return function(_0x8184ca){if(_0x8184ca){return _0x562f60[_0x40b7('0x18')](_0x5ab69c);}return _0x562f60['status'](_0x5ab69c)[_0x40b7('0x19')]();};}function respondWithResult(_0x2a2df9,_0x17c582){_0x17c582=_0x17c582||0xc8;return function(_0x514229){if(_0x514229){return _0x2a2df9[_0x40b7('0x1a')](_0x17c582)[_0x40b7('0x1b')](_0x514229);}};}function respondWithFilteredResult(_0x253199,_0x4c31d0){return function(_0x1fa69e){if(_0x1fa69e){var _0x429c17=typeof _0x4c31d0[_0x40b7('0x1c')]===_0x40b7('0x1d')&&typeof _0x4c31d0[_0x40b7('0x1e')]==='undefined';var _0x40f6cb=_0x1fa69e[_0x40b7('0x1f')];var _0xb9eb8b=_0x429c17?0x0:_0x4c31d0[_0x40b7('0x1c')];var _0x50507f=_0x429c17?_0x1fa69e['count']:_0x4c31d0[_0x40b7('0x1c')]+_0x4c31d0[_0x40b7('0x1e')];var _0x409ce3;if(_0x50507f>=_0x40f6cb){_0x50507f=_0x40f6cb;_0x409ce3=0xc8;}else{_0x409ce3=0xce;}_0x253199[_0x40b7('0x1a')](_0x409ce3);return _0x253199['set'](_0x40b7('0x20'),_0xb9eb8b+'-'+_0x50507f+'/'+_0x40f6cb)['json'](_0x1fa69e);}return null;};}function patchUpdates(_0x226ab7){return function(_0x3ae0b9){try{jsonpatch[_0x40b7('0x21')](_0x3ae0b9,_0x226ab7,!![]);}catch(_0x21c51e){return BPromise[_0x40b7('0x22')](_0x21c51e);}return _0x3ae0b9[_0x40b7('0x23')]();};}function saveUpdates(_0x343a09,_0x5e9711){return function(_0x3a77ab){if(_0x3a77ab){return _0x3a77ab[_0x40b7('0x24')](_0x343a09)[_0x40b7('0x25')](function(_0x41e114){return _0x41e114;});}return null;};}function removeEntity(_0x1be214,_0x15814a){return function(_0x3c58b1){if(_0x3c58b1){return _0x3c58b1[_0x40b7('0x26')]()[_0x40b7('0x25')](function(){_0x1be214['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x508231,_0x4da132){return function(_0x227ae3){if(!_0x227ae3){_0x508231[_0x40b7('0x18')](0x194);}return _0x227ae3;};}function handleError(_0x5b7b1a,_0xa7e845){_0xa7e845=_0xa7e845||0x1f4;return function(_0xdb5b10){logger[_0x40b7('0x27')](_0xdb5b10[_0x40b7('0x28')]);if(_0xdb5b10[_0x40b7('0x29')]){delete _0xdb5b10['name'];}_0x5b7b1a['status'](_0xa7e845)[_0x40b7('0x2a')](_0xdb5b10);};}exports[_0x40b7('0x24')]=function(_0x4e146b,_0x2a0dbe){if(_0x4e146b[_0x40b7('0x2b')]['id']){delete _0x4e146b['body']['id'];}return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x4e146b[_0x40b7('0x2e')]['id']}})[_0x40b7('0x25')](handleEntityNotFound(_0x2a0dbe,null))[_0x40b7('0x25')](saveUpdates(_0x4e146b[_0x40b7('0x2b')],null))['then'](respondWithResult(_0x2a0dbe,null))[_0x40b7('0x2f')](handleError(_0x2a0dbe,null));};exports[_0x40b7('0x26')]=function(_0x3966ea,_0x3a7f48){return db[_0x40b7('0x2c')][_0x40b7('0x2d')]({'where':{'id':_0x3966ea[_0x40b7('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3a7f48,null))['then'](removeEntity(_0x3a7f48,null))[_0x40b7('0x2f')](handleError(_0x3a7f48,null));};
\ No newline at end of file
+var _0x8a17=['save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','reject'];(function(_0x34412f,_0x116bea){var _0x4b4b5a=function(_0x56fc5b){while(--_0x56fc5b){_0x34412f['push'](_0x34412f['shift']());}};_0x4b4b5a(++_0x116bea);}(_0x8a17,0x1b4));var _0x78a1=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x8a17[_0x470e67];return _0x28bbde;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x78a1('0x0'));var jsonpatch=require(_0x78a1('0x1'));var rp=require(_0x78a1('0x2'));var moment=require('moment');var BPromise=require(_0x78a1('0x3'));var Mustache=require(_0x78a1('0x4'));var util=require(_0x78a1('0x5'));var path=require(_0x78a1('0x6'));var sox=require(_0x78a1('0x7'));var csv=require('to-csv');var ejs=require(_0x78a1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x78a1('0x9'));var squel=require(_0x78a1('0xa'));var crypto=require(_0x78a1('0xb'));var jsforce=require(_0x78a1('0xc'));var deskjs=require(_0x78a1('0xd'));var toCsv=require(_0x78a1('0xe'));var querystring=require(_0x78a1('0xf'));var Papa=require(_0x78a1('0x10'));var Redis=require(_0x78a1('0x11'));var authService=require(_0x78a1('0x12'));var qs=require(_0x78a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78a1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x78a1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x78a1('0x16'));var db=require(_0x78a1('0x17'))['db'];function respondWithStatusCode(_0x3ddf3b,_0x3ce150){_0x3ce150=_0x3ce150||0xcc;return function(_0x2e0500){if(_0x2e0500){return _0x3ddf3b[_0x78a1('0x18')](_0x3ce150);}return _0x3ddf3b['status'](_0x3ce150)[_0x78a1('0x19')]();};}function respondWithResult(_0x1c9ff2,_0xcf2c21){_0xcf2c21=_0xcf2c21||0xc8;return function(_0x3f6560){if(_0x3f6560){return _0x1c9ff2[_0x78a1('0x1a')](_0xcf2c21)['json'](_0x3f6560);}};}function respondWithFilteredResult(_0x1cdda3,_0x5f52da){return function(_0x52118c){if(_0x52118c){var _0x25d85c=typeof _0x5f52da[_0x78a1('0x1b')]===_0x78a1('0x1c')&&typeof _0x5f52da['limit']==='undefined';var _0xa0faae=_0x52118c['count'];var _0x48c091=_0x25d85c?0x0:_0x5f52da['offset'];var _0x14d2dd=_0x25d85c?_0x52118c[_0x78a1('0x1d')]:_0x5f52da[_0x78a1('0x1b')]+_0x5f52da[_0x78a1('0x1e')];var _0x51f326;if(_0x14d2dd>=_0xa0faae){_0x14d2dd=_0xa0faae;_0x51f326=0xc8;}else{_0x51f326=0xce;}_0x1cdda3[_0x78a1('0x1a')](_0x51f326);return _0x1cdda3[_0x78a1('0x1f')]('Content-Range',_0x48c091+'-'+_0x14d2dd+'/'+_0xa0faae)[_0x78a1('0x20')](_0x52118c);}return null;};}function patchUpdates(_0x33cc1c){return function(_0x1135ea){try{jsonpatch['apply'](_0x1135ea,_0x33cc1c,!![]);}catch(_0x6ce39c){return BPromise[_0x78a1('0x21')](_0x6ce39c);}return _0x1135ea[_0x78a1('0x22')]();};}function saveUpdates(_0x4f2d21,_0x57db08){return function(_0x57ee1f){if(_0x57ee1f){return _0x57ee1f[_0x78a1('0x23')](_0x4f2d21)[_0x78a1('0x24')](function(_0x47b9db){return _0x47b9db;});}return null;};}function removeEntity(_0x2f0864,_0x2bb27f){return function(_0x3dbb12){if(_0x3dbb12){return _0x3dbb12[_0x78a1('0x25')]()[_0x78a1('0x24')](function(){_0x2f0864['status'](0xcc)[_0x78a1('0x19')]();});}};}function handleEntityNotFound(_0x5dbcc4,_0xe06174){return function(_0x136629){if(!_0x136629){_0x5dbcc4[_0x78a1('0x18')](0x194);}return _0x136629;};}function handleError(_0x5d076c,_0x4952b2){_0x4952b2=_0x4952b2||0x1f4;return function(_0x356e97){logger[_0x78a1('0x26')](_0x356e97[_0x78a1('0x27')]);if(_0x356e97['name']){delete _0x356e97[_0x78a1('0x28')];}_0x5d076c[_0x78a1('0x1a')](_0x4952b2)[_0x78a1('0x29')](_0x356e97);};}exports[_0x78a1('0x23')]=function(_0x12dc46,_0x2f8cf8){if(_0x12dc46[_0x78a1('0x2a')]['id']){delete _0x12dc46[_0x78a1('0x2a')]['id'];}return db[_0x78a1('0x2b')]['find']({'where':{'id':_0x12dc46['params']['id']}})['then'](handleEntityNotFound(_0x2f8cf8,null))[_0x78a1('0x24')](saveUpdates(_0x12dc46['body'],null))['then'](respondWithResult(_0x2f8cf8,null))['catch'](handleError(_0x2f8cf8,null));};exports['destroy']=function(_0x3b98b7,_0x3710e){return db[_0x78a1('0x2b')][_0x78a1('0x2c')]({'where':{'id':_0x3b98b7[_0x78a1('0x2d')]['id']}})[_0x78a1('0x24')](handleEntityNotFound(_0x3710e,null))[_0x78a1('0x24')](removeEntity(_0x3710e,null))[_0x78a1('0x2e')](handleError(_0x3710e,null));};
\ No newline at end of file
index 043379c..3b52fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61c=['request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','util','../../config/logger','api','moment','bluebird'];(function(_0x367816,_0x35633c){var _0x2cdde2=function(_0x153253){while(--_0x153253){_0x367816['push'](_0x367816['shift']());}};_0x2cdde2(++_0x35633c);}(_0xf61c,0x1c3));var _0xcf61=function(_0x28a9aa,_0x3f054f){_0x28a9aa=_0x28a9aa-0x0;var _0x532458=_0xf61c[_0x28a9aa];return _0x532458;};'use strict';var _=require('lodash');var util=require(_0xcf61('0x0'));var logger=require(_0xcf61('0x1'))(_0xcf61('0x2'));var moment=require(_0xcf61('0x3'));var BPromise=require(_0xcf61('0x4'));var rp=require(_0xcf61('0x5'));var fs=require('fs');var path=require(_0xcf61('0x6'));var rimraf=require(_0xcf61('0x7'));var config=require(_0xcf61('0x8'));var attributes=require(_0xcf61('0x9'));module[_0xcf61('0xa')]=function(_0x7764ec,_0x2f9b93){return _0x7764ec['define'](_0xcf61('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b8=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4cfa9f,_0x144777){var _0x580a6c=function(_0xcaa73d){while(--_0xcaa73d){_0x4cfa9f['push'](_0x4cfa9f['shift']());}};_0x580a6c(++_0x144777);}(_0xd8b8,0x1c7));var _0x8d8b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd8b8[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x8d8b('0x0'));var util=require(_0x8d8b('0x1'));var logger=require(_0x8d8b('0x2'))('api');var moment=require(_0x8d8b('0x3'));var BPromise=require(_0x8d8b('0x4'));var rp=require(_0x8d8b('0x5'));var fs=require('fs');var path=require(_0x8d8b('0x6'));var rimraf=require('rimraf');var config=require(_0x8d8b('0x7'));var attributes=require(_0x8d8b('0x8'));module[_0x8d8b('0x9')]=function(_0x36f44c,_0x6c2fc9){return _0x36f44c[_0x8d8b('0xa')](_0x8d8b('0xb'),attributes,{'tableName':_0x8d8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee94b72..1fe6e52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x10ecd6,_0x26d87b){var _0x516301=function(_0x51c59a){while(--_0x51c59a){_0x10ecd6['push'](_0x10ecd6['shift']());}};_0x516301(++_0x26d87b);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd29c88,_0x141c80){_0xd29c88=_0xd29c88-0x0;var _0x375635=_0x7fbe[_0xd29c88];return _0x375635;};'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
+var _0x7a54=['info','Action,\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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x9a06f7,_0xa0c64c){_0x9a06f7=_0x9a06f7-0x0;var _0x3ad67b=_0x7a54[_0x9a06f7];return _0x3ad67b;};'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')]('Action,\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 f36cf29..0e8785a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3cb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3cb,0x1cb));var _0xbe3c=function(_0x22783e,_0x591a8e){_0x22783e=_0x22783e-0x0;var _0x40887a=_0xe3cb[_0x22783e];return _0x40887a;};'use strict';var multer=require(_0xbe3c('0x0'));var util=require('util');var path=require(_0xbe3c('0x1'));var timeout=require(_0xbe3c('0x2'));var express=require(_0xbe3c('0x3'));var router=express[_0xbe3c('0x4')]();var fs_extra=require(_0xbe3c('0x5'));var auth=require(_0xbe3c('0x6'));var interaction=require(_0xbe3c('0x7'));var config=require(_0xbe3c('0x8'));var controller=require(_0xbe3c('0x9'));router['put'](_0xbe3c('0xa'),auth['isAuthenticated'](),controller[_0xbe3c('0xb')]);router[_0xbe3c('0xc')]('/:id',auth[_0xbe3c('0xd')](),controller[_0xbe3c('0xe')]);module[_0xbe3c('0xf')]=router;
\ No newline at end of file
+var _0x15b5=['exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','update','delete','isAuthenticated','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15b5,0x160));var _0x515b=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x15b5[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0x515b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x515b('0x1'));var express=require('express');var router=express[_0x515b('0x2')]();var fs_extra=require(_0x515b('0x3'));var auth=require(_0x515b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x515b('0x5'));var controller=require(_0x515b('0x6'));router[_0x515b('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x515b('0x8')]);router[_0x515b('0x9')]('/:id',auth[_0x515b('0xa')](),controller[_0x515b('0xb')]);module[_0x515b('0xc')]=router;
\ No newline at end of file
index 32bf193..34c5e14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x3e2423,_0x5554c6){var _0x26c422=function(_0x5b23e7){while(--_0x5b23e7){_0x3e2423['push'](_0x3e2423['shift']());}};_0x26c422(++_0x5554c6);}(_0x5496,0x175));var _0x6549=function(_0x510218,_0x3d8b2e){_0x510218=_0x510218-0x0;var _0x3e80bd=_0x5496[_0x510218];return _0x3e80bd;};'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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x2675,0x75));var _0x5267=function(_0x28031b,_0x2dff75){_0x28031b=_0x28031b-0x0;var _0x20913d=_0x2675[_0x28031b];return _0x20913d;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
index b0e22e8..3aee2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc448=['getFields','select','from','metric','groupBy','clone','output','fullPath','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','countTable','COUNT(*)','SELECT','run','runReport','operator','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','show','params','keys','includeAll','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0xd0746a,_0x726b2b){var _0x36985b=function(_0x252b45){while(--_0x252b45){_0xd0746a['push'](_0xd0746a['shift']());}};_0x36985b(++_0x726b2b);}(_0xc448,0xbc));var _0x8c44=function(_0x4c4edd,_0x31cce5){_0x4c4edd=_0x4c4edd-0x0;var _0x329a8a=_0xc448[_0x4c4edd];return _0x329a8a;};'use strict';var emlformat=require(_0x8c44('0x0'));var rimraf=require(_0x8c44('0x1'));var zipdir=require(_0x8c44('0x2'));var jsonpatch=require(_0x8c44('0x3'));var rp=require(_0x8c44('0x4'));var moment=require(_0x8c44('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c44('0x6'));var util=require(_0x8c44('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8c44('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c44('0x9'));var _=require(_0x8c44('0xa'));var squel=require(_0x8c44('0xb'));var crypto=require(_0x8c44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8c44('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8c44('0xe'));var Papa=require(_0x8c44('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c44('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c44('0x11'))(_0x8c44('0x12'));var utils=require(_0x8c44('0x13'));var config=require(_0x8c44('0x14'));var licenseUtil=require(_0x8c44('0x15'));var db=require(_0x8c44('0x16'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5ad87f,_0x361606){_0x361606=_0x361606||0xcc;return function(_0x472eef){if(_0x472eef){return _0x5ad87f[_0x8c44('0x17')](_0x361606);}return _0x5ad87f['status'](_0x361606)[_0x8c44('0x18')]();};}function respondWithResult(_0x2769a2,_0x1e6fb2){_0x1e6fb2=_0x1e6fb2||0xc8;return function(_0x4db10c){if(_0x4db10c){return _0x2769a2[_0x8c44('0x19')](_0x1e6fb2)[_0x8c44('0x1a')](_0x4db10c);}};}function respondWithFilteredResult(_0x569cb6,_0x19e564){return function(_0x286cbe){if(_0x286cbe){var _0x2c4178=typeof _0x19e564[_0x8c44('0x1b')]==='undefined'&&typeof _0x19e564[_0x8c44('0x1c')]==='undefined';var _0x1b8146=_0x286cbe[_0x8c44('0x1d')];var _0x1e86e0=_0x2c4178?0x0:_0x19e564[_0x8c44('0x1b')];var _0x27876e=_0x2c4178?_0x286cbe['count']:_0x19e564[_0x8c44('0x1b')]+_0x19e564[_0x8c44('0x1c')];var _0x889282;if(_0x27876e>=_0x1b8146){_0x27876e=_0x1b8146;_0x889282=0xc8;}else{_0x889282=0xce;}_0x569cb6['status'](_0x889282);return _0x569cb6[_0x8c44('0x1e')](_0x8c44('0x1f'),_0x1e86e0+'-'+_0x27876e+'/'+_0x1b8146)[_0x8c44('0x1a')](_0x286cbe);}return null;};}function patchUpdates(_0xce1595){return function(_0xc43a48){try{jsonpatch['apply'](_0xc43a48,_0xce1595,!![]);}catch(_0x247303){return BPromise[_0x8c44('0x20')](_0x247303);}return _0xc43a48[_0x8c44('0x21')]();};}function saveUpdates(_0x2ae733,_0xec2324){return function(_0x2b9c7a){if(_0x2b9c7a){return _0x2b9c7a[_0x8c44('0x22')](_0x2ae733)['then'](function(_0x3d4c5f){return _0x3d4c5f;});}return null;};}function removeEntity(_0x203e05,_0x7a70a4){return function(_0x51dc47){if(_0x51dc47){return _0x51dc47[_0x8c44('0x23')]()[_0x8c44('0x24')](function(){var _0x55a290=_0x51dc47[_0x8c44('0x25')]({'plain':!![]});var _0x1ba2b2='CustomReports';return db[_0x8c44('0x26')][_0x8c44('0x23')]({'where':{'type':_0x1ba2b2,'resourceId':_0x55a290['id']}})[_0x8c44('0x24')](function(){return _0x51dc47;});})[_0x8c44('0x24')](function(){_0x203e05['status'](0xcc)[_0x8c44('0x18')]();});}};}function handleEntityNotFound(_0x1db34c,_0x4c3c41){return function(_0x531def){if(!_0x531def){_0x1db34c[_0x8c44('0x17')](0x194);}return _0x531def;};}function handleError(_0x1f8a83,_0x35b828){_0x35b828=_0x35b828||0x1f4;return function(_0x3ecc1a){logger[_0x8c44('0x27')](_0x3ecc1a[_0x8c44('0x28')]);if(_0x3ecc1a[_0x8c44('0x29')]){delete _0x3ecc1a[_0x8c44('0x29')];}_0x1f8a83[_0x8c44('0x19')](_0x35b828)['send'](_0x3ecc1a);};}exports['index']=function(_0x2effcd,_0x407d7a){var _0x235a1a={},_0x547d5e={},_0x252d76={'count':0x0,'rows':[]};var _0xd060d5=_['map'](db[_0x8c44('0x2a')][_0x8c44('0x2b')],function(_0x1c2355){return{'name':_0x1c2355[_0x8c44('0x2c')],'type':_0x1c2355[_0x8c44('0x2d')][_0x8c44('0x2e')]};});_0x547d5e[_0x8c44('0x2f')]=_['map'](_0xd060d5,'name');_0x547d5e[_0x8c44('0x30')]=_['keys'](_0x2effcd[_0x8c44('0x30')]);_0x547d5e[_0x8c44('0x31')]=_['intersection'](_0x547d5e[_0x8c44('0x2f')],_0x547d5e[_0x8c44('0x30')]);_0x235a1a[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x547d5e['model'],qs[_0x8c44('0x34')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x34')]));_0x235a1a[_0x8c44('0x32')]=_0x235a1a[_0x8c44('0x32')][_0x8c44('0x35')]?_0x235a1a[_0x8c44('0x32')]:_0x547d5e['model'];if(!_0x2effcd['query'][_0x8c44('0x36')](_0x8c44('0x37'))){_0x235a1a[_0x8c44('0x1c')]=qs[_0x8c44('0x1c')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1c')]);_0x235a1a['offset']=qs['offset'](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x1b')]);}_0x235a1a[_0x8c44('0x38')]=qs[_0x8c44('0x39')](_0x2effcd[_0x8c44('0x30')][_0x8c44('0x39')]);_0x235a1a[_0x8c44('0x3a')]=qs[_0x8c44('0x31')](_[_0x8c44('0x3b')](_0x2effcd[_0x8c44('0x30')],_0x547d5e[_0x8c44('0x31')]),_0xd060d5);if(_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]){_0x235a1a[_0x8c44('0x3a')]=_[_0x8c44('0x3d')](_0x235a1a['where'],{'$or':_[_0x8c44('0x3e')](_0xd060d5,function(_0x5e2c16){if(_0x5e2c16[_0x8c44('0x2d')]!==_0x8c44('0x3f')){var _0x4cf1d2={};_0x4cf1d2[_0x5e2c16[_0x8c44('0x29')]]={'$like':'%'+_0x2effcd[_0x8c44('0x30')][_0x8c44('0x3c')]+'%'};return _0x4cf1d2;}})});}_0x235a1a=_[_0x8c44('0x3d')]({},_0x235a1a,_0x2effcd['options']);var _0x1ccaa2={'where':_0x235a1a[_0x8c44('0x3a')]};return db['AnalyticCustomReport'][_0x8c44('0x1d')](_0x1ccaa2)[_0x8c44('0x24')](function(_0x81fa4e){_0x252d76[_0x8c44('0x1d')]=_0x81fa4e;if(_0x2effcd[_0x8c44('0x30')]['includeAll']){_0x235a1a[_0x8c44('0x40')]=[{'all':!![]}];}return db[_0x8c44('0x2a')][_0x8c44('0x41')](_0x235a1a);})['then'](function(_0x352a39){_0x252d76[_0x8c44('0x42')]=_0x352a39;return _0x252d76;})['then'](respondWithFilteredResult(_0x407d7a,_0x235a1a))['catch'](handleError(_0x407d7a,null));};exports[_0x8c44('0x43')]=function(_0x4628a4,_0x522d19){var _0x142d15={'raw':![],'where':{'id':_0x4628a4[_0x8c44('0x44')]['id']}},_0x2c2d23={};_0x2c2d23[_0x8c44('0x2f')]=_[_0x8c44('0x45')](db['AnalyticCustomReport'][_0x8c44('0x2b')]);_0x2c2d23['query']=_['keys'](_0x4628a4[_0x8c44('0x30')]);_0x2c2d23['filters']=_[_0x8c44('0x33')](_0x2c2d23[_0x8c44('0x2f')],_0x2c2d23['query']);_0x142d15[_0x8c44('0x32')]=_[_0x8c44('0x33')](_0x2c2d23['model'],qs[_0x8c44('0x34')](_0x4628a4['query'][_0x8c44('0x34')]));_0x142d15[_0x8c44('0x32')]=_0x142d15[_0x8c44('0x32')][_0x8c44('0x35')]?_0x142d15[_0x8c44('0x32')]:_0x2c2d23['model'];if(_0x4628a4[_0x8c44('0x30')][_0x8c44('0x46')]){_0x142d15[_0x8c44('0x40')]=[{'all':!![]}];}_0x142d15=_[_0x8c44('0x3d')]({},_0x142d15,_0x4628a4[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x142d15)[_0x8c44('0x24')](handleEntityNotFound(_0x522d19,null))['then'](respondWithResult(_0x522d19,null))[_0x8c44('0x49')](handleError(_0x522d19,null));};exports[_0x8c44('0x4a')]=function(_0x33cfb0,_0xfb831d){return db[_0x8c44('0x2a')]['create'](_0x33cfb0[_0x8c44('0x4b')],{})[_0x8c44('0x24')](function(_0x5e7d4a){var _0x48e72d=_0x33cfb0[_0x8c44('0x4c')]['get']({'plain':!![]});if(!_0x48e72d)throw new Error(_0x8c44('0x4d'));if(_0x48e72d[_0x8c44('0x4e')]==='user'){var _0x2445eb=_0x5e7d4a['get']({'plain':!![]});var _0xcceb0c=_0x8c44('0x4f');return db[_0x8c44('0x50')]['find']({'where':{'name':_0xcceb0c,'userProfileId':_0x48e72d[_0x8c44('0x51')]},'raw':!![]})[_0x8c44('0x24')](function(_0x32bd3d){if(_0x32bd3d&&_0x32bd3d[_0x8c44('0x52')]===0x0){return db[_0x8c44('0x26')][_0x8c44('0x4a')]({'name':_0x2445eb[_0x8c44('0x29')],'resourceId':_0x2445eb['id'],'type':_0x8c44('0x53'),'sectionId':_0x32bd3d['id']},{})[_0x8c44('0x24')](function(){return _0x5e7d4a;});}else{return _0x5e7d4a;}})[_0x8c44('0x49')](function(_0x18805a){logger[_0x8c44('0x27')](_0x8c44('0x54'),_0x18805a);throw _0x18805a;});}return _0x5e7d4a;})[_0x8c44('0x24')](respondWithResult(_0xfb831d,0xc9))['catch'](handleError(_0xfb831d,null));};exports['update']=function(_0x3f15b6,_0x2bd7c2){if(_0x3f15b6[_0x8c44('0x4b')]['id']){delete _0x3f15b6[_0x8c44('0x4b')]['id'];}return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x3f15b6['params']['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x2bd7c2,null))['then'](saveUpdates(_0x3f15b6[_0x8c44('0x4b')],null))[_0x8c44('0x24')](respondWithResult(_0x2bd7c2,null))['catch'](handleError(_0x2bd7c2,null));};exports[_0x8c44('0x23')]=function(_0x441e54,_0x5194c0){return db[_0x8c44('0x2a')][_0x8c44('0x48')]({'where':{'id':_0x441e54[_0x8c44('0x44')]['id']}})[_0x8c44('0x24')](handleEntityNotFound(_0x5194c0,null))[_0x8c44('0x24')](removeEntity(_0x5194c0,null))['catch'](handleError(_0x5194c0,null));};exports[_0x8c44('0x55')]=function(_0x5c4523,_0x384d79){var _0x3b0436=0xa;var _0x258f66=[_0x8c44('0x56'),_0x8c44('0x57'),_0x8c44('0x58'),_0x8c44('0x59')];var _0x348080={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ec0d0={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x18cdac=function(_0x4b6375){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),_0x8c44('0x64'),_0x8c44('0x65')],_0x4b6375);};var _0x39dd88=function(_0x5f5347){if(!_0x5f5347||!_0x5f5347['rules'][_0x8c44('0x35')]){return'';}for(var _0x43ae35='(',_0x43363d=0x0;_0x43363d<_0x5f5347[_0x8c44('0x66')][_0x8c44('0x35')];_0x43363d+=0x1){_0x43363d>0x0&&(_0x43ae35+='\x20'+_0x5f5347['operator']+'\x20');_0x43ae35+=_0x5f5347[_0x8c44('0x66')][_0x43363d]['group']?_0x39dd88(_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x67')]):_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x68')]+'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x69')]+(_0x18cdac(_0x5f5347['rules'][_0x43363d][_0x8c44('0x69')])?'\x20'+_0x5f5347[_0x8c44('0x66')][_0x43363d][_0x8c44('0x6a')]:'');}return _0x43ae35+')';};var _0x38f929={'where':{'id':_0x5c4523[_0x8c44('0x44')]['id']}},_0x384015,_0x6fbeb0,_0x58653b,_0x54e07c,_0x4496fa;_0x38f929=_[_0x8c44('0x3d')]({},_0x38f929,_0x5c4523[_0x8c44('0x47')]);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x38f929)[_0x8c44('0x24')](function(_0x334eea){if(_0x334eea){_0x384015=_0x334eea;return _0x334eea['getFields']();}return null;})[_0x8c44('0x24')](function(_0x550e3e){if(_0x550e3e){if(!_0x550e3e[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x6fbeb0=_0x550e3e;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x7d282d){if(_0x7d282d){_0x58653b=_[_0x8c44('0x6f')](_0x7d282d,'id');var _0x3f3486;var _0x87cbfd=squel['select']();_0x87cbfd['from'](_0x384015[_0x8c44('0x70')]);for(var _0x1e6750=0x0;_0x1e6750<_0x6fbeb0[_0x8c44('0x35')];_0x1e6750+=0x1){_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]?_0x58653b[_0x6fbeb0[_0x1e6750][_0x8c44('0x71')]]['metric']:_0x6fbeb0[_0x1e6750]['field'];_0x3f3486=_0x6fbeb0[_0x1e6750][_0x8c44('0x72')]?_[_0x8c44('0x73')](_0x348080[_0x6fbeb0[_0x1e6750]['function']],'%s',_0x3f3486):_0x3f3486;_0x3f3486=_0x6fbeb0[_0x1e6750]['format']?_[_0x8c44('0x73')](_0x1ec0d0[_0x6fbeb0[_0x1e6750][_0x8c44('0x74')]],'%s',_0x3f3486):_0x3f3486;if(_0x6fbeb0[_0x1e6750]['groupBy']){_0x87cbfd[_0x8c44('0x67')](_0x3f3486);}_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]&&_0x87cbfd[_0x8c44('0x38')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x87cbfd[_0x8c44('0x68')](_0x3f3486,_0x6fbeb0[_0x1e6750][_0x8c44('0x77')]||_0x3f3486);}if(_0x384015[_0x8c44('0x78')]){_0x384015[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x384015['joins']);for(var _0x178a26=0x0;_0x178a26<_0x384015['joins'][_0x8c44('0x35')];_0x178a26+=0x1){if(_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x258f66,_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')])&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')]&&_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')]&&_0x384015[_0x8c44('0x78')][_0x178a26]['foreignKey']){_0x87cbfd[_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x2d')]](_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7b')],null,util[_0x8c44('0x74')](_0x8c44('0x7c'),_0x384015[_0x8c44('0x70')],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7a')],_0x384015[_0x8c44('0x78')][_0x178a26]['foreignTable'],_0x384015[_0x8c44('0x78')][_0x178a26][_0x8c44('0x7d')]));}}}if(_0x384015[_0x8c44('0x7e')]){_0x384015[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x384015[_0x8c44('0x7e')]);_0x87cbfd[_0x8c44('0x3a')](_0x39dd88(_0x384015[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x4496fa=_0x87cbfd['clone']();_0x87cbfd[_0x8c44('0x1c')](_0x3b0436);_0x87cbfd[_0x8c44('0x1b')](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x87cbfd[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x87cbfd[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](respondWithResult(_0x384d79,null))[_0x8c44('0x49')](handleError(_0x384d79,null));};function runReport(_0x52b284,_0x1683e4,_0x190279){var _0x54f781=_0x1683e4[_0x8c44('0x29')];var _0x29e337=0xa;var _0x2b919e=[_0x8c44('0x56'),'left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x59af2b={'SUM':_0x8c44('0x84'),'COUNT':_0x8c44('0x85'),'COUNT DISTINCT':_0x8c44('0x86'),'MAX':_0x8c44('0x5a'),'MIN':_0x8c44('0x87'),'AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x490771={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d1172=function(_0x464eb2){return!_[_0x8c44('0x62')](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x464eb2);};var _0x2779e3=function(_0x432cbc){if(!_0x432cbc||!_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0xf06ab8='(',_0x4a1f39=0x0;_0x4a1f39<_0x432cbc[_0x8c44('0x66')][_0x8c44('0x35')];_0x4a1f39+=0x1){_0x4a1f39>0x0&&(_0xf06ab8+='\x20'+_0x432cbc['operator']+'\x20');_0xf06ab8+=_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]?_0x2779e3(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x67')]):_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x68')]+'\x20'+_0x432cbc['rules'][_0x4a1f39][_0x8c44('0x69')]+(_0x2d1172(_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x69')])?'\x20'+_0x432cbc[_0x8c44('0x66')][_0x4a1f39][_0x8c44('0x6a')]:'');}return _0xf06ab8+')';};var _0x36392e={'where':{'id':_0x52b284['id']}},_0x1d7f49,_0x29d551,_0x14d747,_0x2a05cd,_0x5f5310;_0x36392e=_[_0x8c44('0x3d')]({},_0x36392e,_0x190279);return db[_0x8c44('0x2a')][_0x8c44('0x48')](_0x36392e)[_0x8c44('0x24')](function(_0x15b389){if(_0x15b389){_0x1d7f49=_0x15b389;return _0x15b389[_0x8c44('0x8a')]();}return null;})[_0x8c44('0x24')](function(_0xb8a6bf){if(_0xb8a6bf){if(!_0xb8a6bf[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x29d551=_0xb8a6bf;return db[_0x8c44('0x6e')][_0x8c44('0x41')]({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x1ef2da){if(_0x1ef2da){_0x14d747=_['keyBy'](_0x1ef2da,'id');var _0x3a57f4;var _0x1d6030=squel[_0x8c44('0x8b')]();_0x1d6030[_0x8c44('0x8c')](_0x1d7f49[_0x8c44('0x70')]);for(var _0x69f34b=0x0;_0x69f34b<_0x29d551[_0x8c44('0x35')];_0x69f34b+=0x1){_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x71')]?_0x14d747[_0x29d551[_0x69f34b]['MetricId']][_0x8c44('0x8d')]:_0x29d551[_0x69f34b][_0x8c44('0x68')];_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x72')]?_['replace'](_0x59af2b[_0x29d551[_0x69f34b][_0x8c44('0x72')]],'%s',_0x3a57f4):_0x3a57f4;_0x3a57f4=_0x29d551[_0x69f34b][_0x8c44('0x74')]?_['replace'](_0x490771[_0x29d551[_0x69f34b][_0x8c44('0x74')]],'%s',_0x3a57f4):_0x3a57f4;if(_0x29d551[_0x69f34b][_0x8c44('0x8e')]){_0x1d6030[_0x8c44('0x67')](_0x3a57f4);}_0x29d551[_0x69f34b]['orderBy']&&_0x1d6030[_0x8c44('0x38')](_0x3a57f4,_0x29d551[_0x69f34b]['orderBy']===_0x8c44('0x76')?![]:!![]);_0x1d6030[_0x8c44('0x68')](_0x3a57f4,_0x29d551[_0x69f34b][_0x8c44('0x77')]||_0x3a57f4);}if(_0x1d7f49[_0x8c44('0x78')]){_0x1d7f49['joins']=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x78')]);for(var _0x5cda5f=0x0;_0x5cda5f<_0x1d7f49[_0x8c44('0x78')]['length'];_0x5cda5f+=0x1){if(_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x2b919e,_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')])&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')]&&_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')]&&_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]){_0x1d6030[_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x2d')]](_0x1d7f49['joins'][_0x5cda5f][_0x8c44('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1d7f49[_0x8c44('0x70')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7a')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7b')],_0x1d7f49[_0x8c44('0x78')][_0x5cda5f][_0x8c44('0x7d')]));}}}if(_0x1d7f49[_0x8c44('0x7e')]){_0x1d7f49[_0x8c44('0x7e')]=JSON[_0x8c44('0x79')](_0x1d7f49[_0x8c44('0x7e')]);_0x1d6030[_0x8c44('0x3a')](_0x2779e3(_0x1d7f49[_0x8c44('0x7e')][_0x8c44('0x67')]));}_0x5f5310=_0x1d6030[_0x8c44('0x8f')]();_0x1d6030[_0x8c44('0x1c')](_0x29e337);_0x1d6030[_0x8c44('0x1b')](0x0);return;}})['then'](function(){if(_0x1683e4[_0x8c44('0x90')]==='web'){return null;}var _0x3e443a=_[_0x8c44('0x3d')](_0x1683e4,{'name':_0x1683e4[_0x8c44('0x91')]||_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],'basename':_0x54f781,'savename':util[_0x8c44('0x74')]('%s-%s.%s',_0x1683e4[_0x8c44('0x29')]||_0x1d7f49[_0x8c44('0x29')],require('randomstring')[_0x8c44('0x92')](0x4),_0x1683e4[_0x8c44('0x90')]||_0x8c44('0x93')),'reportId':_0x1d7f49['id'],'reportType':_0x8c44('0x94')});return db[_0x8c44('0x95')][_0x8c44('0x4a')](_0x3e443a,{'raw':!![]});})[_0x8c44('0x24')](function(_0x32567b){if(_0x1d7f49['table']==='cdr'){_0x5f5310[_0x8c44('0x3a')](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x96'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}else{_0x5f5310['where'](_0x1d7f49[_0x8c44('0x70')]+_0x8c44('0x99'),_0x1683e4[_0x8c44('0x97')],_0x1683e4[_0x8c44('0x98')]);}if(_0x32567b){logger['info'](_0x8c44('0x9a'),_0x5f5310[_0x8c44('0x81')]());require('child_process')[_0x8c44('0x9b')](path['join'](__dirname,_0x8c44('0x9c'),_0x32567b[_0x8c44('0x90')]),[_0x32567b['id'],_0x5f5310[_0x8c44('0x81')](),path['join'](__dirname,'../../files/reports',_0x32567b['savename']),_0x54f781]);return _0x32567b;}else{var _0x4720a8=squel[_0x8c44('0x8b')]();_0x4720a8[_0x8c44('0x8c')]('('+_0x5f5310[_0x8c44('0x81')]()+')',_0x8c44('0x9d'));_0x4720a8['field'](_0x8c44('0x9e'),_0x8c44('0x1d'));_0x5f5310[_0x8c44('0x1c')](_0x1683e4['limit']||_0x29e337);_0x5f5310[_0x8c44('0x1b')](_0x1683e4[_0x8c44('0x1b')]||0x0);return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x4720a8['toString'](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]})[_0x8c44('0x24')](function(_0x18be19){if(!_0x18be19[_0x8c44('0x35')]){_0x2a05cd=0x0;}else{_0x2a05cd=_0x18be19[0x0][_0x8c44('0x1d')]||0x0;}return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x5f5310[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')][_0x8c44('0x9f')]});})[_0x8c44('0x24')](function(_0x3a27ba){return{'rows':_0x3a27ba||[],'count':_0x2a05cd};});}});}exports[_0x8c44('0xa0')]=function(_0x453929,_0xc5c110){return runReport(_0x453929[_0x8c44('0x44')],_0x453929[_0x8c44('0x30')],_0x453929[_0x8c44('0x47')])[_0x8c44('0x24')](respondWithResult(_0xc5c110,null))[_0x8c44('0x49')](handleError(_0xc5c110,null));};exports[_0x8c44('0xa1')]=runReport;exports[_0x8c44('0x30')]=function(_0x10d43e,_0x20679d){var _0x1c013e=0xa;var _0x23b957=['join','left_join',_0x8c44('0x58'),_0x8c44('0x59')];var _0x4ccdbc={'SUM':_0x8c44('0x84'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c44('0x5a'),'MIN':'MIN(%s)','AVG':_0x8c44('0x88'),'GROUP_CONCAT':_0x8c44('0x5b'),'GROUP_CONCAT ASC':_0x8c44('0x5c'),'GROUP_CONCAT DESC':_0x8c44('0x89')};var _0x570cfb={'SEC_TO_TIME':_0x8c44('0x5d'),'DATE':_0x8c44('0x5e'),'HOUR':_0x8c44('0x5f'),'ROUND':_0x8c44('0x60'),'UNIX_TIMESTAMP':_0x8c44('0x61')};var _0x23fde8=function(_0x1ea945){return!_['includes'](['IS\x20NULL',_0x8c44('0x63'),'IS\x20EMPTY',_0x8c44('0x65')],_0x1ea945);};var _0x1df086=function(_0x2427fa){if(!_0x2427fa||!_0x2427fa[_0x8c44('0x66')][_0x8c44('0x35')]){return'';}for(var _0x25a9c7='(',_0x5ab2fb=0x0;_0x5ab2fb<_0x2427fa['rules'][_0x8c44('0x35')];_0x5ab2fb+=0x1){_0x5ab2fb>0x0&&(_0x25a9c7+='\x20'+_0x2427fa[_0x8c44('0xa2')]+'\x20');_0x25a9c7+=_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['group']?_0x1df086(_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x67')]):_0x2427fa[_0x8c44('0x66')][_0x5ab2fb][_0x8c44('0x68')]+'\x20'+_0x2427fa['rules'][_0x5ab2fb][_0x8c44('0x69')]+(_0x23fde8(_0x2427fa[_0x8c44('0x66')][_0x5ab2fb]['condition'])?'\x20'+_0x2427fa['rules'][_0x5ab2fb]['value']:'');}return _0x25a9c7+')';};var _0x22072b={'where':{'id':_0x10d43e[_0x8c44('0x44')]['id']}},_0x31675d,_0x54dc77,_0x394a08,_0x36231f,_0x1a30fa;_0x22072b=_[_0x8c44('0x3d')]({},_0x22072b,_0x10d43e[_0x8c44('0x47')]);return db['AnalyticCustomReport'][_0x8c44('0x48')](_0x22072b)['then'](function(_0x4bddd8){if(_0x4bddd8){_0x31675d=_0x4bddd8;return _0x4bddd8['getFields']();}return null;})['then'](function(_0x481df5){if(_0x481df5){if(!_0x481df5[_0x8c44('0x35')]){throw new db[(_0x8c44('0x6b'))][(_0x8c44('0x6c'))](_0x8c44('0x6d'),0x193);}_0x54dc77=_0x481df5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x8c44('0x24')](function(_0x21c745){if(_0x21c745){_0x394a08=_[_0x8c44('0x6f')](_0x21c745,'id');var _0x4ce2d6;var _0x1a696d=squel[_0x8c44('0x8b')]();_0x1a696d[_0x8c44('0x8c')](_0x31675d[_0x8c44('0x70')]);for(var _0x58859b=0x0;_0x58859b<_0x54dc77[_0x8c44('0x35')];_0x58859b+=0x1){_0x4ce2d6=_0x54dc77[_0x58859b]['MetricId']?_0x394a08[_0x54dc77[_0x58859b]['MetricId']][_0x8c44('0x8d')]:_0x54dc77[_0x58859b][_0x8c44('0x68')];_0x4ce2d6=_0x54dc77[_0x58859b]['function']?_[_0x8c44('0x73')](_0x4ccdbc[_0x54dc77[_0x58859b][_0x8c44('0x72')]],'%s',_0x4ce2d6):_0x4ce2d6;_0x4ce2d6=_0x54dc77[_0x58859b][_0x8c44('0x74')]?_[_0x8c44('0x73')](_0x570cfb[_0x54dc77[_0x58859b][_0x8c44('0x74')]],'%s',_0x4ce2d6):_0x4ce2d6;if(_0x54dc77[_0x58859b][_0x8c44('0x8e')]){_0x1a696d[_0x8c44('0x67')](_0x4ce2d6);}_0x54dc77[_0x58859b][_0x8c44('0x75')]&&_0x1a696d[_0x8c44('0x38')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x75')]===_0x8c44('0x76')?![]:!![]);_0x1a696d[_0x8c44('0x68')](_0x4ce2d6,_0x54dc77[_0x58859b][_0x8c44('0x77')]||_0x4ce2d6);}if(_0x31675d[_0x8c44('0x78')]){_0x31675d[_0x8c44('0x78')]=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x78')]);for(var _0x35cb8c=0x0;_0x35cb8c<_0x31675d[_0x8c44('0x78')][_0x8c44('0x35')];_0x35cb8c+=0x1){if(_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]&&_[_0x8c44('0x62')](_0x23b957,_0x31675d['joins'][_0x35cb8c][_0x8c44('0x2d')])&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7a')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7b')]&&_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]){_0x1a696d[_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x2d')]](_0x31675d[_0x8c44('0x78')][_0x35cb8c]['foreignTable'],null,util[_0x8c44('0x74')]('%s.%s\x20=\x20%s.%s',_0x31675d[_0x8c44('0x70')],_0x31675d['joins'][_0x35cb8c]['parentKey'],_0x31675d['joins'][_0x35cb8c][_0x8c44('0x7b')],_0x31675d[_0x8c44('0x78')][_0x35cb8c][_0x8c44('0x7d')]));}}}if(_0x31675d[_0x8c44('0x7e')]){_0x31675d['conditions']=JSON[_0x8c44('0x79')](_0x31675d[_0x8c44('0x7e')]);_0x1a696d[_0x8c44('0x3a')](_0x1df086(_0x31675d['conditions'][_0x8c44('0x67')]));}_0x1a30fa=_0x1a696d[_0x8c44('0x8f')]();_0x1a696d[_0x8c44('0x1c')](_0x1c013e);_0x1a696d['offset'](0x0);logger[_0x8c44('0x7f')](_0x8c44('0x80'),_0x1a696d[_0x8c44('0x81')]());return dbH[_0x8c44('0x82')][_0x8c44('0x30')](_0x1a696d[_0x8c44('0x81')](),{'type':dbH[_0x8c44('0x82')][_0x8c44('0x83')]['SELECT']});}})[_0x8c44('0x24')](function(){return{'sql':_0x1a30fa[_0x8c44('0x81')]()};})['then'](respondWithResult(_0x20679d,null))[_0x8c44('0x49')](handleError(_0x20679d,null));};
\ No newline at end of file
+var _0x0273=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','MetricId','field','replace','function','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','sequelize','toString','SELECT','COUNT(%s)','HOUR(%s)','IS\x20EMPTY','value','metric','alias','clone','output','web','fullPath','generate','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','QueryTypes','run','runReport','MIN(%s)','Sequelize','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','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','dbH','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','name','index','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','includeAll','include','rows','catch','show','merge','find','create'];(function(_0x35103d,_0x682c7a){var _0x4c65b5=function(_0x169fb8){while(--_0x169fb8){_0x35103d['push'](_0x35103d['shift']());}};_0x4c65b5(++_0x682c7a);}(_0x0273,0x1af));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3027('0x0'));var zipdir=require(_0x3027('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3027('0x2'));var moment=require(_0x3027('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3027('0x4'));var util=require(_0x3027('0x5'));var path=require(_0x3027('0x6'));var sox=require('sox');var csv=require(_0x3027('0x7'));var ejs=require(_0x3027('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3027('0x9'));var crypto=require(_0x3027('0xa'));var jsforce=require(_0x3027('0xb'));var deskjs=require(_0x3027('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3027('0xd'));var Papa=require(_0x3027('0xe'));var Redis=require(_0x3027('0xf'));var authService=require(_0x3027('0x10'));var qs=require(_0x3027('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3027('0x12'));var logger=require(_0x3027('0x13'))(_0x3027('0x14'));var utils=require(_0x3027('0x15'));var config=require(_0x3027('0x16'));var licenseUtil=require(_0x3027('0x17'));var db=require(_0x3027('0x18'))['db'];var dbH=require(_0x3027('0x18'))[_0x3027('0x19')];function respondWithStatusCode(_0x4922d5,_0x22468d){_0x22468d=_0x22468d||0xcc;return function(_0x54f612){if(_0x54f612){return _0x4922d5[_0x3027('0x1a')](_0x22468d);}return _0x4922d5[_0x3027('0x1b')](_0x22468d)[_0x3027('0x1c')]();};}function respondWithResult(_0x169ae6,_0x572fe7){_0x572fe7=_0x572fe7||0xc8;return function(_0xf22d34){if(_0xf22d34){return _0x169ae6[_0x3027('0x1b')](_0x572fe7)['json'](_0xf22d34);}};}function respondWithFilteredResult(_0x1135e3,_0x228aeb){return function(_0x4c264f){if(_0x4c264f){var _0x4db0b8=typeof _0x228aeb[_0x3027('0x1d')]===_0x3027('0x1e')&&typeof _0x228aeb[_0x3027('0x1f')]===_0x3027('0x1e');var _0x3a9462=_0x4c264f[_0x3027('0x20')];var _0x2c16fb=_0x4db0b8?0x0:_0x228aeb['offset'];var _0xfac863=_0x4db0b8?_0x4c264f['count']:_0x228aeb[_0x3027('0x1d')]+_0x228aeb['limit'];var _0x2a182b;if(_0xfac863>=_0x3a9462){_0xfac863=_0x3a9462;_0x2a182b=0xc8;}else{_0x2a182b=0xce;}_0x1135e3['status'](_0x2a182b);return _0x1135e3['set'](_0x3027('0x21'),_0x2c16fb+'-'+_0xfac863+'/'+_0x3a9462)[_0x3027('0x22')](_0x4c264f);}return null;};}function patchUpdates(_0x5d5ec7){return function(_0x116d62){try{jsonpatch[_0x3027('0x23')](_0x116d62,_0x5d5ec7,!![]);}catch(_0x2a9878){return BPromise[_0x3027('0x24')](_0x2a9878);}return _0x116d62[_0x3027('0x25')]();};}function saveUpdates(_0x43ba99,_0x1ca40c){return function(_0x346605){if(_0x346605){return _0x346605[_0x3027('0x26')](_0x43ba99)[_0x3027('0x27')](function(_0x365b8f){return _0x365b8f;});}return null;};}function removeEntity(_0x3c5647,_0x165ac8){return function(_0xbb39f4){if(_0xbb39f4){return _0xbb39f4[_0x3027('0x28')]()[_0x3027('0x27')](function(){var _0x4c9b6d=_0xbb39f4[_0x3027('0x29')]({'plain':!![]});var _0x4a5242=_0x3027('0x2a');return db[_0x3027('0x2b')][_0x3027('0x28')]({'where':{'type':_0x4a5242,'resourceId':_0x4c9b6d['id']}})['then'](function(){return _0xbb39f4;});})[_0x3027('0x27')](function(){_0x3c5647['status'](0xcc)[_0x3027('0x1c')]();});}};}function handleEntityNotFound(_0x3f42eb,_0x2da58d){return function(_0x1e37fa){if(!_0x1e37fa){_0x3f42eb['sendStatus'](0x194);}return _0x1e37fa;};}function handleError(_0x3068b1,_0x4de534){_0x4de534=_0x4de534||0x1f4;return function(_0xc7bdac){logger['error'](_0xc7bdac['stack']);if(_0xc7bdac['name']){delete _0xc7bdac[_0x3027('0x2c')];}_0x3068b1['status'](_0x4de534)['send'](_0xc7bdac);};}exports[_0x3027('0x2d')]=function(_0x4e075c,_0xbf3a31){var _0x35e332={},_0x41dd67={},_0x269955={'count':0x0,'rows':[]};var _0x4ce3c9=_['map'](db[_0x3027('0x2e')][_0x3027('0x2f')],function(_0x20d92f){return{'name':_0x20d92f['fieldName'],'type':_0x20d92f[_0x3027('0x30')][_0x3027('0x31')]};});_0x41dd67[_0x3027('0x32')]=_['map'](_0x4ce3c9,_0x3027('0x2c'));_0x41dd67[_0x3027('0x33')]=_[_0x3027('0x34')](_0x4e075c[_0x3027('0x33')]);_0x41dd67[_0x3027('0x35')]=_[_0x3027('0x36')](_0x41dd67[_0x3027('0x32')],_0x41dd67[_0x3027('0x33')]);_0x35e332[_0x3027('0x37')]=_[_0x3027('0x36')](_0x41dd67[_0x3027('0x32')],qs[_0x3027('0x38')](_0x4e075c[_0x3027('0x33')][_0x3027('0x38')]));_0x35e332['attributes']=_0x35e332[_0x3027('0x37')][_0x3027('0x39')]?_0x35e332[_0x3027('0x37')]:_0x41dd67[_0x3027('0x32')];if(!_0x4e075c['query'][_0x3027('0x3a')](_0x3027('0x3b'))){_0x35e332[_0x3027('0x1f')]=qs[_0x3027('0x1f')](_0x4e075c[_0x3027('0x33')]['limit']);_0x35e332[_0x3027('0x1d')]=qs[_0x3027('0x1d')](_0x4e075c[_0x3027('0x33')][_0x3027('0x1d')]);}_0x35e332[_0x3027('0x3c')]=qs[_0x3027('0x3d')](_0x4e075c[_0x3027('0x33')]['sort']);_0x35e332['where']=qs['filters'](_[_0x3027('0x3e')](_0x4e075c[_0x3027('0x33')],_0x41dd67['filters']),_0x4ce3c9);if(_0x4e075c[_0x3027('0x33')][_0x3027('0x3f')]){_0x35e332[_0x3027('0x40')]=_['merge'](_0x35e332[_0x3027('0x40')],{'$or':_[_0x3027('0x41')](_0x4ce3c9,function(_0x449f41){if(_0x449f41[_0x3027('0x30')]!==_0x3027('0x42')){var _0x1c64d3={};_0x1c64d3[_0x449f41['name']]={'$like':'%'+_0x4e075c[_0x3027('0x33')][_0x3027('0x3f')]+'%'};return _0x1c64d3;}})});}_0x35e332=_['merge']({},_0x35e332,_0x4e075c[_0x3027('0x43')]);var _0xbd5de3={'where':_0x35e332[_0x3027('0x40')]};return db[_0x3027('0x2e')][_0x3027('0x20')](_0xbd5de3)[_0x3027('0x27')](function(_0x29f18f){_0x269955['count']=_0x29f18f;if(_0x4e075c[_0x3027('0x33')][_0x3027('0x44')]){_0x35e332[_0x3027('0x45')]=[{'all':!![]}];}return db[_0x3027('0x2e')]['findAll'](_0x35e332);})[_0x3027('0x27')](function(_0x1a29d9){_0x269955[_0x3027('0x46')]=_0x1a29d9;return _0x269955;})[_0x3027('0x27')](respondWithFilteredResult(_0xbf3a31,_0x35e332))[_0x3027('0x47')](handleError(_0xbf3a31,null));};exports[_0x3027('0x48')]=function(_0x2f277c,_0x5a6ea3){var _0x37051e={'raw':![],'where':{'id':_0x2f277c['params']['id']}},_0xbdcc00={};_0xbdcc00['model']=_['keys'](db[_0x3027('0x2e')][_0x3027('0x2f')]);_0xbdcc00[_0x3027('0x33')]=_[_0x3027('0x34')](_0x2f277c[_0x3027('0x33')]);_0xbdcc00[_0x3027('0x35')]=_[_0x3027('0x36')](_0xbdcc00[_0x3027('0x32')],_0xbdcc00[_0x3027('0x33')]);_0x37051e[_0x3027('0x37')]=_[_0x3027('0x36')](_0xbdcc00[_0x3027('0x32')],qs[_0x3027('0x38')](_0x2f277c[_0x3027('0x33')][_0x3027('0x38')]));_0x37051e['attributes']=_0x37051e[_0x3027('0x37')][_0x3027('0x39')]?_0x37051e[_0x3027('0x37')]:_0xbdcc00[_0x3027('0x32')];if(_0x2f277c['query'][_0x3027('0x44')]){_0x37051e[_0x3027('0x45')]=[{'all':!![]}];}_0x37051e=_[_0x3027('0x49')]({},_0x37051e,_0x2f277c[_0x3027('0x43')]);return db[_0x3027('0x2e')][_0x3027('0x4a')](_0x37051e)[_0x3027('0x27')](handleEntityNotFound(_0x5a6ea3,null))[_0x3027('0x27')](respondWithResult(_0x5a6ea3,null))['catch'](handleError(_0x5a6ea3,null));};exports[_0x3027('0x4b')]=function(_0x4511a9,_0x34906e){return db[_0x3027('0x2e')][_0x3027('0x4b')](_0x4511a9[_0x3027('0x4c')],{})[_0x3027('0x27')](function(_0x28d032){var _0x27e1ee=_0x4511a9[_0x3027('0x4d')][_0x3027('0x29')]({'plain':!![]});if(!_0x27e1ee)throw new Error(_0x3027('0x4e'));if(_0x27e1ee[_0x3027('0x4f')]===_0x3027('0x4d')){var _0x331586=_0x28d032['get']({'plain':!![]});var _0x2f02c1=_0x3027('0x50');return db['UserProfileSection']['find']({'where':{'name':_0x2f02c1,'userProfileId':_0x27e1ee[_0x3027('0x51')]},'raw':!![]})[_0x3027('0x27')](function(_0x159968){if(_0x159968&&_0x159968[_0x3027('0x52')]===0x0){return db[_0x3027('0x2b')][_0x3027('0x4b')]({'name':_0x331586['name'],'resourceId':_0x331586['id'],'type':'CustomReports','sectionId':_0x159968['id']},{})[_0x3027('0x27')](function(){return _0x28d032;});}else{return _0x28d032;}})[_0x3027('0x47')](function(_0x24b486){logger[_0x3027('0x53')](_0x3027('0x54'),_0x24b486);throw _0x24b486;});}return _0x28d032;})[_0x3027('0x27')](respondWithResult(_0x34906e,0xc9))['catch'](handleError(_0x34906e,null));};exports[_0x3027('0x26')]=function(_0x1fbad5,_0x286cba){if(_0x1fbad5['body']['id']){delete _0x1fbad5[_0x3027('0x4c')]['id'];}return db[_0x3027('0x2e')][_0x3027('0x4a')]({'where':{'id':_0x1fbad5[_0x3027('0x55')]['id']}})['then'](handleEntityNotFound(_0x286cba,null))[_0x3027('0x27')](saveUpdates(_0x1fbad5[_0x3027('0x4c')],null))[_0x3027('0x27')](respondWithResult(_0x286cba,null))[_0x3027('0x47')](handleError(_0x286cba,null));};exports[_0x3027('0x28')]=function(_0x3b634a,_0x1f0c76){return db['AnalyticCustomReport'][_0x3027('0x4a')]({'where':{'id':_0x3b634a['params']['id']}})['then'](handleEntityNotFound(_0x1f0c76,null))[_0x3027('0x27')](removeEntity(_0x1f0c76,null))[_0x3027('0x47')](handleError(_0x1f0c76,null));};exports[_0x3027('0x56')]=function(_0x2a9553,_0x4c4bc7){var _0x235ffc=0xa;var _0x2c98d1=[_0x3027('0x57'),_0x3027('0x58'),_0x3027('0x59'),_0x3027('0x5a')];var _0x3ef625={'SUM':_0x3027('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3027('0x5c'),'MAX':_0x3027('0x5d'),'MIN':'MIN(%s)','AVG':_0x3027('0x5e'),'GROUP_CONCAT':_0x3027('0x5f'),'GROUP_CONCAT ASC':_0x3027('0x60'),'GROUP_CONCAT DESC':_0x3027('0x61')};var _0x36d6be={'SEC_TO_TIME':_0x3027('0x62'),'DATE':_0x3027('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x3027('0x64'),'UNIX_TIMESTAMP':_0x3027('0x65')};var _0x5c1a28=function(_0x55729a){return!_[_0x3027('0x66')]([_0x3027('0x67'),_0x3027('0x68'),'IS\x20EMPTY',_0x3027('0x69')],_0x55729a);};var _0x296122=function(_0x27b8d4){if(!_0x27b8d4||!_0x27b8d4['rules'][_0x3027('0x39')]){return'';}for(var _0x159f6b='(',_0x41dc08=0x0;_0x41dc08<_0x27b8d4[_0x3027('0x6a')][_0x3027('0x39')];_0x41dc08+=0x1){_0x41dc08>0x0&&(_0x159f6b+='\x20'+_0x27b8d4[_0x3027('0x6b')]+'\x20');_0x159f6b+=_0x27b8d4[_0x3027('0x6a')][_0x41dc08]['group']?_0x296122(_0x27b8d4[_0x3027('0x6a')][_0x41dc08][_0x3027('0x6c')]):_0x27b8d4['rules'][_0x41dc08]['field']+'\x20'+_0x27b8d4[_0x3027('0x6a')][_0x41dc08]['condition']+(_0x5c1a28(_0x27b8d4[_0x3027('0x6a')][_0x41dc08][_0x3027('0x6d')])?'\x20'+_0x27b8d4['rules'][_0x41dc08]['value']:'');}return _0x159f6b+')';};var _0x23643b={'where':{'id':_0x2a9553[_0x3027('0x55')]['id']}},_0x5dffe4,_0x471ec5,_0x22382c,_0x3bf128,_0x4a1028;_0x23643b=_[_0x3027('0x49')]({},_0x23643b,_0x2a9553[_0x3027('0x43')]);return db[_0x3027('0x2e')]['find'](_0x23643b)['then'](function(_0x2dc732){if(_0x2dc732){_0x5dffe4=_0x2dc732;return _0x2dc732[_0x3027('0x6e')]();}return null;})[_0x3027('0x27')](function(_0x51086e){if(_0x51086e){if(!_0x51086e[_0x3027('0x39')]){throw new db['Sequelize'][(_0x3027('0x6f'))](_0x3027('0x70'),0x193);}_0x471ec5=_0x51086e;return db[_0x3027('0x71')][_0x3027('0x72')]({'raw':!![]});}return null;})[_0x3027('0x27')](function(_0x404249){if(_0x404249){_0x22382c=_[_0x3027('0x73')](_0x404249,'id');var _0x328e51;var _0x3fd5fe=squel['select']();_0x3fd5fe[_0x3027('0x74')](_0x5dffe4['table']);for(var _0x2959e5=0x0;_0x2959e5<_0x471ec5[_0x3027('0x39')];_0x2959e5+=0x1){_0x328e51=_0x471ec5[_0x2959e5]['MetricId']?_0x22382c[_0x471ec5[_0x2959e5][_0x3027('0x75')]]['metric']:_0x471ec5[_0x2959e5][_0x3027('0x76')];_0x328e51=_0x471ec5[_0x2959e5]['function']?_[_0x3027('0x77')](_0x3ef625[_0x471ec5[_0x2959e5][_0x3027('0x78')]],'%s',_0x328e51):_0x328e51;_0x328e51=_0x471ec5[_0x2959e5][_0x3027('0x79')]?_['replace'](_0x36d6be[_0x471ec5[_0x2959e5][_0x3027('0x79')]],'%s',_0x328e51):_0x328e51;if(_0x471ec5[_0x2959e5][_0x3027('0x7a')]){_0x3fd5fe[_0x3027('0x6c')](_0x328e51);}_0x471ec5[_0x2959e5][_0x3027('0x7b')]&&_0x3fd5fe['order'](_0x328e51,_0x471ec5[_0x2959e5][_0x3027('0x7b')]===_0x3027('0x7c')?![]:!![]);_0x3fd5fe[_0x3027('0x76')](_0x328e51,_0x471ec5[_0x2959e5]['alias']||_0x328e51);}if(_0x5dffe4[_0x3027('0x7d')]){_0x5dffe4[_0x3027('0x7d')]=JSON[_0x3027('0x7e')](_0x5dffe4[_0x3027('0x7d')]);for(var _0x1b1de6=0x0;_0x1b1de6<_0x5dffe4['joins'][_0x3027('0x39')];_0x1b1de6+=0x1){if(_0x5dffe4['joins'][_0x1b1de6]['type']&&_[_0x3027('0x66')](_0x2c98d1,_0x5dffe4['joins'][_0x1b1de6][_0x3027('0x30')])&&_0x5dffe4[_0x3027('0x7d')][_0x1b1de6][_0x3027('0x7f')]&&_0x5dffe4[_0x3027('0x7d')][_0x1b1de6][_0x3027('0x80')]&&_0x5dffe4[_0x3027('0x7d')][_0x1b1de6][_0x3027('0x81')]){_0x3fd5fe[_0x5dffe4[_0x3027('0x7d')][_0x1b1de6]['type']](_0x5dffe4[_0x3027('0x7d')][_0x1b1de6][_0x3027('0x80')],null,util[_0x3027('0x79')](_0x3027('0x82'),_0x5dffe4[_0x3027('0x83')],_0x5dffe4[_0x3027('0x7d')][_0x1b1de6]['parentKey'],_0x5dffe4[_0x3027('0x7d')][_0x1b1de6][_0x3027('0x80')],_0x5dffe4[_0x3027('0x7d')][_0x1b1de6]['foreignKey']));}}}if(_0x5dffe4[_0x3027('0x84')]){_0x5dffe4[_0x3027('0x84')]=JSON[_0x3027('0x7e')](_0x5dffe4[_0x3027('0x84')]);_0x3fd5fe[_0x3027('0x40')](_0x296122(_0x5dffe4[_0x3027('0x84')][_0x3027('0x6c')]));}_0x4a1028=_0x3fd5fe['clone']();_0x3fd5fe[_0x3027('0x1f')](_0x235ffc);_0x3fd5fe['offset'](0x0);logger[_0x3027('0x85')](_0x3027('0x86'),_0x3fd5fe['toString']());return dbH[_0x3027('0x87')][_0x3027('0x33')](_0x3fd5fe[_0x3027('0x88')](),{'type':dbH[_0x3027('0x87')]['QueryTypes'][_0x3027('0x89')]});}})[_0x3027('0x27')](respondWithResult(_0x4c4bc7,null))['catch'](handleError(_0x4c4bc7,null));};function runReport(_0x59a0b4,_0x5b69a6,_0xf7cb70){var _0x435ced=_0x5b69a6[_0x3027('0x2c')];var _0x2b378f=0xa;var _0x59b770=[_0x3027('0x57'),_0x3027('0x58'),'right_join',_0x3027('0x5a')];var _0x2d8a54={'SUM':'SUM(%s)','COUNT':_0x3027('0x8a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3027('0x5d'),'MIN':'MIN(%s)','AVG':_0x3027('0x5e'),'GROUP_CONCAT':_0x3027('0x5f'),'GROUP_CONCAT ASC':_0x3027('0x60'),'GROUP_CONCAT DESC':_0x3027('0x61')};var _0x2e7ae2={'SEC_TO_TIME':_0x3027('0x62'),'DATE':'DATE(%s)','HOUR':_0x3027('0x8b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3027('0x65')};var _0x2caf0b=function(_0x2d7b25){return!_[_0x3027('0x66')]([_0x3027('0x67'),_0x3027('0x68'),_0x3027('0x8c'),'IS\x20NOT\x20EMPTY'],_0x2d7b25);};var _0x16a13=function(_0x3a03c3){if(!_0x3a03c3||!_0x3a03c3['rules'][_0x3027('0x39')]){return'';}for(var _0x4a6013='(',_0x3edd17=0x0;_0x3edd17<_0x3a03c3[_0x3027('0x6a')][_0x3027('0x39')];_0x3edd17+=0x1){_0x3edd17>0x0&&(_0x4a6013+='\x20'+_0x3a03c3[_0x3027('0x6b')]+'\x20');_0x4a6013+=_0x3a03c3['rules'][_0x3edd17]['group']?_0x16a13(_0x3a03c3[_0x3027('0x6a')][_0x3edd17][_0x3027('0x6c')]):_0x3a03c3[_0x3027('0x6a')][_0x3edd17]['field']+'\x20'+_0x3a03c3[_0x3027('0x6a')][_0x3edd17][_0x3027('0x6d')]+(_0x2caf0b(_0x3a03c3[_0x3027('0x6a')][_0x3edd17][_0x3027('0x6d')])?'\x20'+_0x3a03c3[_0x3027('0x6a')][_0x3edd17][_0x3027('0x8d')]:'');}return _0x4a6013+')';};var _0x506721={'where':{'id':_0x59a0b4['id']}},_0x1ac315,_0x1174dc,_0x12dbdc,_0x12f62a,_0x16f6e4;_0x506721=_['merge']({},_0x506721,_0xf7cb70);return db[_0x3027('0x2e')]['find'](_0x506721)['then'](function(_0x4a4bcb){if(_0x4a4bcb){_0x1ac315=_0x4a4bcb;return _0x4a4bcb[_0x3027('0x6e')]();}return null;})[_0x3027('0x27')](function(_0x2f40b5){if(_0x2f40b5){if(!_0x2f40b5['length']){throw new db['Sequelize'][(_0x3027('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1174dc=_0x2f40b5;return db[_0x3027('0x71')][_0x3027('0x72')]({'raw':!![]});}return null;})[_0x3027('0x27')](function(_0x571d7b){if(_0x571d7b){_0x12dbdc=_[_0x3027('0x73')](_0x571d7b,'id');var _0x368dee;var _0x32402d=squel['select']();_0x32402d[_0x3027('0x74')](_0x1ac315[_0x3027('0x83')]);for(var _0x51c9ee=0x0;_0x51c9ee<_0x1174dc[_0x3027('0x39')];_0x51c9ee+=0x1){_0x368dee=_0x1174dc[_0x51c9ee][_0x3027('0x75')]?_0x12dbdc[_0x1174dc[_0x51c9ee][_0x3027('0x75')]][_0x3027('0x8e')]:_0x1174dc[_0x51c9ee][_0x3027('0x76')];_0x368dee=_0x1174dc[_0x51c9ee][_0x3027('0x78')]?_[_0x3027('0x77')](_0x2d8a54[_0x1174dc[_0x51c9ee][_0x3027('0x78')]],'%s',_0x368dee):_0x368dee;_0x368dee=_0x1174dc[_0x51c9ee][_0x3027('0x79')]?_[_0x3027('0x77')](_0x2e7ae2[_0x1174dc[_0x51c9ee][_0x3027('0x79')]],'%s',_0x368dee):_0x368dee;if(_0x1174dc[_0x51c9ee][_0x3027('0x7a')]){_0x32402d[_0x3027('0x6c')](_0x368dee);}_0x1174dc[_0x51c9ee]['orderBy']&&_0x32402d[_0x3027('0x3c')](_0x368dee,_0x1174dc[_0x51c9ee]['orderBy']==='DESC'?![]:!![]);_0x32402d[_0x3027('0x76')](_0x368dee,_0x1174dc[_0x51c9ee][_0x3027('0x8f')]||_0x368dee);}if(_0x1ac315[_0x3027('0x7d')]){_0x1ac315[_0x3027('0x7d')]=JSON['parse'](_0x1ac315['joins']);for(var _0x2aca1c=0x0;_0x2aca1c<_0x1ac315[_0x3027('0x7d')][_0x3027('0x39')];_0x2aca1c+=0x1){if(_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x30')]&&_[_0x3027('0x66')](_0x59b770,_0x1ac315['joins'][_0x2aca1c][_0x3027('0x30')])&&_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x7f')]&&_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x80')]&&_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x81')]){_0x32402d[_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x30')]](_0x1ac315['joins'][_0x2aca1c][_0x3027('0x80')],null,util[_0x3027('0x79')](_0x3027('0x82'),_0x1ac315['table'],_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x7f')],_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x80')],_0x1ac315[_0x3027('0x7d')][_0x2aca1c][_0x3027('0x81')]));}}}if(_0x1ac315['conditions']){_0x1ac315[_0x3027('0x84')]=JSON[_0x3027('0x7e')](_0x1ac315['conditions']);_0x32402d[_0x3027('0x40')](_0x16a13(_0x1ac315[_0x3027('0x84')][_0x3027('0x6c')]));}_0x16f6e4=_0x32402d[_0x3027('0x90')]();_0x32402d[_0x3027('0x1f')](_0x2b378f);_0x32402d[_0x3027('0x1d')](0x0);return;}})['then'](function(){if(_0x5b69a6[_0x3027('0x91')]===_0x3027('0x92')){return null;}var _0x39085d=_[_0x3027('0x49')](_0x5b69a6,{'name':_0x5b69a6[_0x3027('0x93')]||_0x5b69a6[_0x3027('0x2c')]||_0x1ac315[_0x3027('0x2c')],'basename':_0x435ced,'savename':util['format']('%s-%s.%s',_0x5b69a6['name']||_0x1ac315['name'],require('randomstring')[_0x3027('0x94')](0x4),_0x5b69a6[_0x3027('0x91')]||_0x3027('0x95')),'reportId':_0x1ac315['id'],'reportType':'custom'});return db[_0x3027('0x96')][_0x3027('0x4b')](_0x39085d,{'raw':!![]});})[_0x3027('0x27')](function(_0x332375){if(_0x1ac315[_0x3027('0x83')]==='cdr'){_0x16f6e4[_0x3027('0x40')](_0x1ac315['table']+_0x3027('0x97'),_0x5b69a6[_0x3027('0x98')],_0x5b69a6['endDate']);}else{_0x16f6e4[_0x3027('0x40')](_0x1ac315[_0x3027('0x83')]+_0x3027('0x99'),_0x5b69a6[_0x3027('0x98')],_0x5b69a6[_0x3027('0x9a')]);}if(_0x332375){logger[_0x3027('0x9b')](_0x3027('0x9c'),_0x16f6e4[_0x3027('0x88')]());require('child_process')[_0x3027('0x9d')](path[_0x3027('0x57')](__dirname,_0x3027('0x9e'),_0x332375[_0x3027('0x91')]),[_0x332375['id'],_0x16f6e4[_0x3027('0x88')](),path['join'](__dirname,_0x3027('0x9f'),_0x332375[_0x3027('0xa0')]),_0x435ced]);return _0x332375;}else{var _0x1446f5=squel[_0x3027('0xa1')]();_0x1446f5[_0x3027('0x74')]('('+_0x16f6e4['toString']()+')',_0x3027('0xa2'));_0x1446f5[_0x3027('0x76')](_0x3027('0xa3'),_0x3027('0x20'));_0x16f6e4[_0x3027('0x1f')](_0x5b69a6[_0x3027('0x1f')]||_0x2b378f);_0x16f6e4['offset'](_0x5b69a6[_0x3027('0x1d')]||0x0);return dbH[_0x3027('0x87')][_0x3027('0x33')](_0x1446f5['toString'](),{'type':dbH[_0x3027('0x87')][_0x3027('0xa4')]['SELECT']})[_0x3027('0x27')](function(_0x5643a3){if(!_0x5643a3[_0x3027('0x39')]){_0x12f62a=0x0;}else{_0x12f62a=_0x5643a3[0x0][_0x3027('0x20')]||0x0;}return dbH[_0x3027('0x87')][_0x3027('0x33')](_0x16f6e4[_0x3027('0x88')](),{'type':dbH[_0x3027('0x87')][_0x3027('0xa4')][_0x3027('0x89')]});})['then'](function(_0x8ed474){return{'rows':_0x8ed474||[],'count':_0x12f62a};});}});}exports[_0x3027('0xa5')]=function(_0x50c838,_0x2de98e){return runReport(_0x50c838[_0x3027('0x55')],_0x50c838['query'],_0x50c838[_0x3027('0x43')])[_0x3027('0x27')](respondWithResult(_0x2de98e,null))[_0x3027('0x47')](handleError(_0x2de98e,null));};exports[_0x3027('0xa6')]=runReport;exports[_0x3027('0x33')]=function(_0x4cddf3,_0x16056f){var _0x463868=0xa;var _0x3abb42=['join',_0x3027('0x58'),_0x3027('0x59'),'cross_join'];var _0x3bf0b3={'SUM':'SUM(%s)','COUNT':_0x3027('0x8a'),'COUNT DISTINCT':_0x3027('0x5c'),'MAX':_0x3027('0x5d'),'MIN':_0x3027('0xa7'),'AVG':_0x3027('0x5e'),'GROUP_CONCAT':_0x3027('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x423804={'SEC_TO_TIME':_0x3027('0x62'),'DATE':_0x3027('0x63'),'HOUR':_0x3027('0x8b'),'ROUND':_0x3027('0x64'),'UNIX_TIMESTAMP':_0x3027('0x65')};var _0x4f53e5=function(_0x9a9972){return!_['includes']([_0x3027('0x67'),_0x3027('0x68'),_0x3027('0x8c'),_0x3027('0x69')],_0x9a9972);};var _0x1d3c65=function(_0x208ee4){if(!_0x208ee4||!_0x208ee4[_0x3027('0x6a')][_0x3027('0x39')]){return'';}for(var _0x3c71c2='(',_0x5e5035=0x0;_0x5e5035<_0x208ee4['rules'][_0x3027('0x39')];_0x5e5035+=0x1){_0x5e5035>0x0&&(_0x3c71c2+='\x20'+_0x208ee4[_0x3027('0x6b')]+'\x20');_0x3c71c2+=_0x208ee4[_0x3027('0x6a')][_0x5e5035][_0x3027('0x6c')]?_0x1d3c65(_0x208ee4[_0x3027('0x6a')][_0x5e5035][_0x3027('0x6c')]):_0x208ee4[_0x3027('0x6a')][_0x5e5035][_0x3027('0x76')]+'\x20'+_0x208ee4[_0x3027('0x6a')][_0x5e5035][_0x3027('0x6d')]+(_0x4f53e5(_0x208ee4[_0x3027('0x6a')][_0x5e5035]['condition'])?'\x20'+_0x208ee4[_0x3027('0x6a')][_0x5e5035][_0x3027('0x8d')]:'');}return _0x3c71c2+')';};var _0x9cbc08={'where':{'id':_0x4cddf3[_0x3027('0x55')]['id']}},_0x1d6166,_0x380fda,_0x5eb1d9,_0x41c0ac,_0x29b555;_0x9cbc08=_[_0x3027('0x49')]({},_0x9cbc08,_0x4cddf3[_0x3027('0x43')]);return db[_0x3027('0x2e')]['find'](_0x9cbc08)[_0x3027('0x27')](function(_0x13cfd6){if(_0x13cfd6){_0x1d6166=_0x13cfd6;return _0x13cfd6['getFields']();}return null;})[_0x3027('0x27')](function(_0x1ecd04){if(_0x1ecd04){if(!_0x1ecd04['length']){throw new db[(_0x3027('0xa8'))][(_0x3027('0x6f'))](_0x3027('0x70'),0x193);}_0x380fda=_0x1ecd04;return db[_0x3027('0x71')][_0x3027('0x72')]({'raw':!![]});}return null;})[_0x3027('0x27')](function(_0x2a3701){if(_0x2a3701){_0x5eb1d9=_[_0x3027('0x73')](_0x2a3701,'id');var _0x18c0a5;var _0x133b51=squel[_0x3027('0xa1')]();_0x133b51[_0x3027('0x74')](_0x1d6166[_0x3027('0x83')]);for(var _0x2a2d94=0x0;_0x2a2d94<_0x380fda[_0x3027('0x39')];_0x2a2d94+=0x1){_0x18c0a5=_0x380fda[_0x2a2d94]['MetricId']?_0x5eb1d9[_0x380fda[_0x2a2d94][_0x3027('0x75')]]['metric']:_0x380fda[_0x2a2d94][_0x3027('0x76')];_0x18c0a5=_0x380fda[_0x2a2d94][_0x3027('0x78')]?_['replace'](_0x3bf0b3[_0x380fda[_0x2a2d94][_0x3027('0x78')]],'%s',_0x18c0a5):_0x18c0a5;_0x18c0a5=_0x380fda[_0x2a2d94][_0x3027('0x79')]?_[_0x3027('0x77')](_0x423804[_0x380fda[_0x2a2d94][_0x3027('0x79')]],'%s',_0x18c0a5):_0x18c0a5;if(_0x380fda[_0x2a2d94][_0x3027('0x7a')]){_0x133b51['group'](_0x18c0a5);}_0x380fda[_0x2a2d94][_0x3027('0x7b')]&&_0x133b51['order'](_0x18c0a5,_0x380fda[_0x2a2d94][_0x3027('0x7b')]===_0x3027('0x7c')?![]:!![]);_0x133b51[_0x3027('0x76')](_0x18c0a5,_0x380fda[_0x2a2d94][_0x3027('0x8f')]||_0x18c0a5);}if(_0x1d6166['joins']){_0x1d6166[_0x3027('0x7d')]=JSON['parse'](_0x1d6166['joins']);for(var _0xb7422=0x0;_0xb7422<_0x1d6166[_0x3027('0x7d')][_0x3027('0x39')];_0xb7422+=0x1){if(_0x1d6166['joins'][_0xb7422][_0x3027('0x30')]&&_[_0x3027('0x66')](_0x3abb42,_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x30')])&&_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x7f')]&&_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x80')]&&_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x81')]){_0x133b51[_0x1d6166[_0x3027('0x7d')][_0xb7422]['type']](_0x1d6166['joins'][_0xb7422][_0x3027('0x80')],null,util['format'](_0x3027('0x82'),_0x1d6166[_0x3027('0x83')],_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x7f')],_0x1d6166[_0x3027('0x7d')][_0xb7422][_0x3027('0x80')],_0x1d6166['joins'][_0xb7422][_0x3027('0x81')]));}}}if(_0x1d6166[_0x3027('0x84')]){_0x1d6166[_0x3027('0x84')]=JSON[_0x3027('0x7e')](_0x1d6166['conditions']);_0x133b51[_0x3027('0x40')](_0x1d3c65(_0x1d6166[_0x3027('0x84')][_0x3027('0x6c')]));}_0x29b555=_0x133b51[_0x3027('0x90')]();_0x133b51[_0x3027('0x1f')](_0x463868);_0x133b51['offset'](0x0);logger['debug'](_0x3027('0x86'),_0x133b51[_0x3027('0x88')]());return dbH[_0x3027('0x87')][_0x3027('0x33')](_0x133b51['toString'](),{'type':dbH[_0x3027('0x87')]['QueryTypes'][_0x3027('0x89')]});}})[_0x3027('0x27')](function(){return{'sql':_0x29b555['toString']()};})['then'](respondWithResult(_0x16056f,null))[_0x3027('0x47')](handleError(_0x16056f,null));};
\ No newline at end of file
index 4f45295..311b4da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x703e=['AnalyticCustomReport','../../config/logger','api','request-promise','./analyticCustomReport.attributes','exports','define'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x703e,0xfd));var _0xe703=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x703e[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe703('0x0'))(_0xe703('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe703('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe703('0x3'));module[_0xe703('0x4')]=function(_0x26a166,_0x49cca5){return _0x26a166[_0xe703('0x5')](_0xe703('0x6'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0bb=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','analytics_custom_reports','util','../../config/logger','api'];(function(_0x277fb8,_0x22b2ef){var _0x4e520e=function(_0x2ab5fc){while(--_0x2ab5fc){_0x277fb8['push'](_0x277fb8['shift']());}};_0x4e520e(++_0x22b2ef);}(_0xe0bb,0x11f));var _0xbe0b=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xe0bb[_0x59c301];return _0x3866b9;};'use strict';var _=require('lodash');var util=require(_0xbe0b('0x0'));var logger=require(_0xbe0b('0x1'))(_0xbe0b('0x2'));var moment=require(_0xbe0b('0x3'));var BPromise=require(_0xbe0b('0x4'));var rp=require(_0xbe0b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe0b('0x6'));var config=require(_0xbe0b('0x7'));var attributes=require(_0xbe0b('0x8'));module['exports']=function(_0x3e46c9,_0x144ccb){return _0x3e46c9['define']('AnalyticCustomReport',attributes,{'tableName':_0xbe0b('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d6c72fc..3dabe57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c3=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x50604e,_0x28e40f){var _0x5bf0fa=function(_0x406aa2){while(--_0x406aa2){_0x50604e['push'](_0x50604e['shift']());}};_0x5bf0fa(++_0x28e40f);}(_0x59c3,0x110));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x359c('0x0'));var util=require(_0x359c('0x1'));var moment=require(_0x359c('0x2'));var BPromise=require(_0x359c('0x3'));var rs=require(_0x359c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x359c('0x5'))['db'];var utils=require(_0x359c('0x6'));var logger=require(_0x359c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x359c('0x8'));var client=jayson[_0x359c('0x9')][_0x359c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e4706,_0x3e0430,_0x483aa3){return new BPromise(function(_0x4a530f,_0x599d44){return client['request'](_0x2e4706,_0x483aa3)['then'](function(_0x405254){logger[_0x359c('0xb')](_0x359c('0xc'),_0x3e0430,_0x359c('0xd'));logger[_0x359c('0xe')](_0x359c('0xf'),_0x3e0430,'request\x20sent',JSON[_0x359c('0x10')](_0x405254));if(_0x405254[_0x359c('0x11')]){if(_0x405254[_0x359c('0x11')][_0x359c('0x12')]===0x1f4){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254[_0x359c('0x11')][_0x359c('0x13')]);return _0x599d44(_0x405254['error']['message']);}logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0x405254['error'][_0x359c('0x13')]);return _0x4a530f(_0x405254['error']['message']);}else{logger[_0x359c('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3e0430,_0x359c('0xd'));_0x4a530f(_0x405254[_0x359c('0x14')]['message']);}})['catch'](function(_0xc8ddc9){logger[_0x359c('0x11')](_0x359c('0xc'),_0x3e0430,_0xc8ddc9);_0x599d44(_0xc8ddc9);});});}
\ No newline at end of file
+var _0xc428=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x229607,_0x5653a6){var _0x5ed9a6=function(_0x4c60b7){while(--_0x4c60b7){_0x229607['push'](_0x229607['shift']());}};_0x5ed9a6(++_0x5653a6);}(_0xc428,0x1bb));var _0x8c42=function(_0x53eb05,_0x44fc8b){_0x53eb05=_0x53eb05-0x0;var _0xbbd392=_0xc428[_0x53eb05];return _0xbbd392;};'use strict';var _=require(_0x8c42('0x0'));var util=require(_0x8c42('0x1'));var moment=require(_0x8c42('0x2'));var BPromise=require(_0x8c42('0x3'));var rs=require(_0x8c42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c42('0x5'))['db'];var utils=require(_0x8c42('0x6'));var logger=require(_0x8c42('0x7'))(_0x8c42('0x8'));var config=require(_0x8c42('0x9'));var jayson=require(_0x8c42('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c998d,_0x2030cd,_0x2e7c3d){return new BPromise(function(_0x3979bc,_0x23a9fd){return client[_0x8c42('0xb')](_0x1c998d,_0x2e7c3d)[_0x8c42('0xc')](function(_0x224c29){logger[_0x8c42('0xd')](_0x8c42('0xe'),_0x2030cd,_0x8c42('0xf'));logger[_0x8c42('0x10')](_0x8c42('0x11'),_0x2030cd,'request\x20sent',JSON[_0x8c42('0x12')](_0x224c29));if(_0x224c29[_0x8c42('0x13')]){if(_0x224c29[_0x8c42('0x13')][_0x8c42('0x14')]===0x1f4){logger[_0x8c42('0x13')](_0x8c42('0xe'),_0x2030cd,_0x224c29['error'][_0x8c42('0x15')]);return _0x23a9fd(_0x224c29[_0x8c42('0x13')][_0x8c42('0x15')]);}logger[_0x8c42('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2030cd,_0x224c29['error'][_0x8c42('0x15')]);return _0x3979bc(_0x224c29[_0x8c42('0x13')][_0x8c42('0x15')]);}else{logger[_0x8c42('0xd')](_0x8c42('0xe'),_0x2030cd,_0x8c42('0xf'));_0x3979bc(_0x224c29['result'][_0x8c42('0x15')]);}})[_0x8c42('0x16')](function(_0x4e274d){logger[_0x8c42('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2030cd,_0x4e274d);_0x23a9fd(_0x4e274d);});});}
\ No newline at end of file
index d4ebd8f..eaf9e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd80d=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete'];(function(_0x40fec9,_0x2dac70){var _0x5842c2=function(_0x3dc0a2){while(--_0x3dc0a2){_0x40fec9['push'](_0x40fec9['shift']());}};_0x5842c2(++_0x2dac70);}(_0xd80d,0x147));var _0xdd80=function(_0x5d8a87,_0xec0615){_0x5d8a87=_0x5d8a87-0x0;var _0x3c2448=_0xd80d[_0x5d8a87];return _0x3c2448;};'use strict';var multer=require(_0xdd80('0x0'));var util=require(_0xdd80('0x1'));var path=require(_0xdd80('0x2'));var timeout=require('connect-timeout');var express=require(_0xdd80('0x3'));var router=express[_0xdd80('0x4')]();var fs_extra=require(_0xdd80('0x5'));var auth=require(_0xdd80('0x6'));var interaction=require(_0xdd80('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xdd80('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd80('0x9')]);router[_0xdd80('0x8')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xc')]);router[_0xdd80('0x8')](_0xdd80('0xd'),auth[_0xdd80('0xb')](),controller[_0xdd80('0xe')]);router[_0xdd80('0x8')](_0xdd80('0xf'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x10')]);router[_0xdd80('0x8')](_0xdd80('0x11'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x12')]);router[_0xdd80('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd80('0x14')](_0xdd80('0xa'),auth[_0xdd80('0xb')](),controller[_0xdd80('0x15')]);router[_0xdd80('0x16')](_0xdd80('0xa'),auth['isAuthenticated'](),controller[_0xdd80('0x17')]);module[_0xdd80('0x18')]=router;
\ No newline at end of file
+var _0x41bd=['../../config/environment','get','isAuthenticated','index','show','preview','/:id/run','run','/:id/query','query','post','/:id','update','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x273305,_0x57815f){var _0x12cf22=function(_0x308154){while(--_0x308154){_0x273305['push'](_0x273305['shift']());}};_0x12cf22(++_0x57815f);}(_0x41bd,0xe5));var _0xd41b=function(_0x386a99,_0x4db80f){_0x386a99=_0x386a99-0x0;var _0x295b4c=_0x41bd[_0x386a99];return _0x295b4c;};'use strict';var multer=require(_0xd41b('0x0'));var util=require(_0xd41b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd41b('0x2'));var auth=require(_0xd41b('0x3'));var interaction=require(_0xd41b('0x4'));var config=require(_0xd41b('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xd41b('0x6')]('/',auth[_0xd41b('0x7')](),controller[_0xd41b('0x8')]);router['get']('/:id',auth[_0xd41b('0x7')](),controller[_0xd41b('0x9')]);router[_0xd41b('0x6')]('/:id/preview',auth[_0xd41b('0x7')](),controller[_0xd41b('0xa')]);router[_0xd41b('0x6')](_0xd41b('0xb'),auth['isAuthenticated'](),controller[_0xd41b('0xc')]);router[_0xd41b('0x6')](_0xd41b('0xd'),auth[_0xd41b('0x7')](),controller[_0xd41b('0xe')]);router[_0xd41b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd41b('0x10'),auth[_0xd41b('0x7')](),controller[_0xd41b('0x11')]);router['delete'](_0xd41b('0x10'),auth[_0xd41b('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index cced836..4dc4ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['TEXT','exports','STRING'];(function(_0x30ec42,_0x3639e1){var _0x2d8415=function(_0x4dcb3c){while(--_0x4dcb3c){_0x30ec42['push'](_0x30ec42['shift']());}};_0x2d8415(++_0x3639e1);}(_0x2eb2,0x19f));var _0x22eb=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x2eb2[_0xdc37a1];return _0x99b4fe;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x5a2b4c,_0x174dbf){var _0x5b5126=function(_0x33b928){while(--_0x33b928){_0x5a2b4c['push'](_0x5a2b4c['shift']());}};_0x5b5126(++_0x174dbf);}(_0x5496,0x175));var _0x6549=function(_0x311d32,_0x49f13d){_0x311d32=_0x311d32-0x0;var _0x622088=_0x5496[_0x311d32];return _0x622088;};'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
index 2b07641..4280670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0x1e332e,_0x4e3356){var _0x5dfe80=function(_0x3ba1cd){while(--_0x3ba1cd){_0x1e332e['push'](_0x1e332e['shift']());}};_0x5dfe80(++_0x4e3356);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
+var _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xabce[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
index e5face4..d8397f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad10=['AnalyticDefaultReport','analytics_default_reports','lodash','api','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x57eb92,_0x224768){var _0x13945e=function(_0x53fa51){while(--_0x53fa51){_0x57eb92['push'](_0x57eb92['shift']());}};_0x13945e(++_0x224768);}(_0xad10,0x156));var _0x0ad1=function(_0x5f99e1,_0x1ac016){_0x5f99e1=_0x5f99e1-0x0;var _0x3871a5=_0xad10[_0x5f99e1];return _0x3871a5;};'use strict';var _=require(_0x0ad1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ad1('0x2'));var rimraf=require(_0x0ad1('0x3'));var config=require(_0x0ad1('0x4'));var attributes=require(_0x0ad1('0x5'));module[_0x0ad1('0x6')]=function(_0x19d9fd,_0x22898c){return _0x19d9fd[_0x0ad1('0x7')](_0x0ad1('0x8'),attributes,{'tableName':_0x0ad1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d3e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d3e,0xa6));var _0xe9d3=function(_0x2d08c5,_0x2b19f1){_0x2d08c5=_0x2d08c5-0x0;var _0x5c71b1=_0x9d3e[_0x2d08c5];return _0x5c71b1;};'use strict';var _=require('lodash');var util=require(_0xe9d3('0x0'));var logger=require(_0xe9d3('0x1'))(_0xe9d3('0x2'));var moment=require(_0xe9d3('0x3'));var BPromise=require(_0xe9d3('0x4'));var rp=require(_0xe9d3('0x5'));var fs=require('fs');var path=require(_0xe9d3('0x6'));var rimraf=require(_0xe9d3('0x7'));var config=require(_0xe9d3('0x8'));var attributes=require(_0xe9d3('0x9'));module[_0xe9d3('0xa')]=function(_0x156242,_0x1cd45a){return _0x156242[_0xe9d3('0xb')](_0xe9d3('0xc'),attributes,{'tableName':_0xe9d3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a72b03c..bc99354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb115=['then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x4570d5,_0x115f91){var _0x314a34=function(_0x100d84){while(--_0x100d84){_0x4570d5['push'](_0x4570d5['shift']());}};_0x314a34(++_0x115f91);}(_0xb115,0x1c2));var _0x5b11=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xb115[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x5b11('0x0'));var util=require(_0x5b11('0x1'));var moment=require(_0x5b11('0x2'));var BPromise=require(_0x5b11('0x3'));var rs=require(_0x5b11('0x4'));var fs=require('fs');var Redis=require(_0x5b11('0x5'));var db=require(_0x5b11('0x6'))['db'];var utils=require(_0x5b11('0x7'));var logger=require(_0x5b11('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5b11('0x9'));var client=jayson[_0x5b11('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x572f47,_0x489366,_0x33a530){return new BPromise(function(_0x2a737a,_0x4d94dc){return client[_0x5b11('0xb')](_0x572f47,_0x33a530)[_0x5b11('0xc')](function(_0x1627c8){logger[_0x5b11('0xd')](_0x5b11('0xe'),_0x489366,'request\x20sent');logger[_0x5b11('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'),JSON[_0x5b11('0x11')](_0x1627c8));if(_0x1627c8['error']){if(_0x1627c8[_0x5b11('0x12')][_0x5b11('0x13')]===0x1f4){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x4d94dc(_0x1627c8[_0x5b11('0x12')]['message']);}logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x1627c8[_0x5b11('0x12')][_0x5b11('0x14')]);return _0x2a737a(_0x1627c8['error'][_0x5b11('0x14')]);}else{logger[_0x5b11('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x489366,_0x5b11('0x10'));_0x2a737a(_0x1627c8['result']['message']);}})[_0x5b11('0x15')](function(_0x45bf30){logger[_0x5b11('0x12')](_0x5b11('0xe'),_0x489366,_0x45bf30);_0x4d94dc(_0x45bf30);});});}
\ No newline at end of file
+var _0xccd1=['util','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xccd1,0x77));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require(_0x1ccd('0x1'));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(_0x1ccd('0x2'))(_0x1ccd('0x3'));var config=require(_0x1ccd('0x4'));var jayson=require(_0x1ccd('0x5'));var client=jayson[_0x1ccd('0x6')][_0x1ccd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x551b38,_0x1afab1,_0x1cfbf2){return new BPromise(function(_0x1ea54f,_0x12c1da){return client[_0x1ccd('0x8')](_0x551b38,_0x1cfbf2)[_0x1ccd('0x9')](function(_0x1c2c90){logger[_0x1ccd('0xa')](_0x1ccd('0xb'),_0x1afab1,_0x1ccd('0xc'));logger[_0x1ccd('0xd')](_0x1ccd('0xe'),_0x1afab1,_0x1ccd('0xc'),JSON[_0x1ccd('0xf')](_0x1c2c90));if(_0x1c2c90[_0x1ccd('0x10')]){if(_0x1c2c90['error'][_0x1ccd('0x11')]===0x1f4){logger[_0x1ccd('0x10')](_0x1ccd('0xb'),_0x1afab1,_0x1c2c90[_0x1ccd('0x10')][_0x1ccd('0x12')]);return _0x12c1da(_0x1c2c90[_0x1ccd('0x10')][_0x1ccd('0x12')]);}logger[_0x1ccd('0x10')](_0x1ccd('0xb'),_0x1afab1,_0x1c2c90[_0x1ccd('0x10')]['message']);return _0x1ea54f(_0x1c2c90[_0x1ccd('0x10')][_0x1ccd('0x12')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1afab1,_0x1ccd('0xc'));_0x1ea54f(_0x1c2c90[_0x1ccd('0x13')][_0x1ccd('0x12')]);}})['catch'](function(_0x44d477){logger[_0x1ccd('0x10')](_0x1ccd('0xb'),_0x1afab1,_0x44d477);_0x12c1da(_0x44d477);});});}
\ No newline at end of file
index 006367c..37a64b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d1=['put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create'];(function(_0x8cb592,_0x1d250d){var _0x108d23=function(_0x1d773f){while(--_0x1d773f){_0x8cb592['push'](_0x8cb592['shift']());}};_0x108d23(++_0x1d250d);}(_0xd6d1,0x14a));var _0x1d6d=function(_0x294d69,_0xe46345){_0x294d69=_0x294d69-0x0;var _0x449951=_0xd6d1[_0x294d69];return _0x449951;};'use strict';var multer=require(_0x1d6d('0x0'));var util=require(_0x1d6d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d6d('0x2'));var router=express[_0x1d6d('0x3')]();var fs_extra=require(_0x1d6d('0x4'));var auth=require(_0x1d6d('0x5'));var interaction=require(_0x1d6d('0x6'));var config=require(_0x1d6d('0x7'));var controller=require(_0x1d6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1d6d('0x9')](_0x1d6d('0xa'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xc')]);router[_0x1d6d('0x9')](_0x1d6d('0xd'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0xe')]);router['get'](_0x1d6d('0xf'),auth[_0x1d6d('0xb')](),controller['run']);router[_0x1d6d('0x9')](_0x1d6d('0x10'),auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x11')]);router[_0x1d6d('0x12')]('/',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x13')]);router[_0x1d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1d6d('0x15')]);router[_0x1d6d('0x16')]('/:id',auth[_0x1d6d('0xb')](),controller[_0x1d6d('0x17')]);module[_0x1d6d('0x18')]=router;
\ No newline at end of file
+var _0xb53b=['put','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','post'];(function(_0xcf04fc,_0x4e3a10){var _0x36ff00=function(_0x4649dd){while(--_0x4649dd){_0xcf04fc['push'](_0xcf04fc['shift']());}};_0x36ff00(++_0x4e3a10);}(_0xb53b,0xd6));var _0xbb53=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xb53b[_0x1b828b];return _0x98da1a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb53('0x0')]();var fs_extra=require(_0xbb53('0x1'));var auth=require(_0xbb53('0x2'));var interaction=require(_0xbb53('0x3'));var config=require(_0xbb53('0x4'));var controller=require(_0xbb53('0x5'));router[_0xbb53('0x6')]('/',auth['isAuthenticated'](),controller[_0xbb53('0x7')]);router[_0xbb53('0x6')](_0xbb53('0x8'),auth[_0xbb53('0x9')](),controller[_0xbb53('0xa')]);router[_0xbb53('0x6')](_0xbb53('0xb'),auth[_0xbb53('0x9')](),controller['preview']);router[_0xbb53('0x6')](_0xbb53('0xc'),auth[_0xbb53('0x9')](),controller[_0xbb53('0xd')]);router[_0xbb53('0x6')](_0xbb53('0xe'),auth['isAuthenticated'](),controller[_0xbb53('0xf')]);router[_0xbb53('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbb53('0x11')](_0xbb53('0x8'),auth[_0xbb53('0x9')](),controller['update']);router[_0xbb53('0x12')](_0xbb53('0x8'),auth['isAuthenticated'](),controller[_0xbb53('0x13')]);module[_0xbb53('0x14')]=router;
\ No newline at end of file
index 9af8a2e..103bee1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef46=['ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','DATE','Loading'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xef46,0x1b2));var _0x6ef4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xef46[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x6ef4('0x0'));var moment=require(_0x6ef4('0x1'));module[_0x6ef4('0x2')]={'name':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x6ef4('0x4'),_0x6ef4('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x6ef4('0x4')},'savename':{'type':Sequelize[_0x6ef4('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6ef4('0x6')]},'endDate':{'type':Sequelize[_0x6ef4('0x6')]},'status':{'type':Sequelize[_0x6ef4('0x3')],'defaultValue':_0x6ef4('0x7')},'type':{'type':Sequelize[_0x6ef4('0x8')](_0x6ef4('0x9'),_0x6ef4('0xa')),'allowNull':![],'defaultValue':_0x6ef4('0x9')},'reportId':{'type':Sequelize[_0x6ef4('0xb')](0xb)[_0x6ef4('0xc')]},'reportType':{'type':Sequelize[_0x6ef4('0x3')]}};
\ No newline at end of file
+var _0x255c=['pdf','xlsx','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x503ea8,_0x22e391){var _0x427e5d=function(_0x1484e8){while(--_0x1484e8){_0x503ea8['push'](_0x503ea8['shift']());}};_0x427e5d(++_0x22e391);}(_0x255c,0x1db));var _0xc255=function(_0x112cb1,_0x13a91a){_0x112cb1=_0x112cb1-0x0;var _0x134d19=_0x255c[_0x112cb1];return _0x134d19;};'use strict';var Sequelize=require(_0xc255('0x0'));var moment=require(_0xc255('0x1'));module[_0xc255('0x2')]={'name':{'type':Sequelize[_0xc255('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xc255('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xc255('0x4')](_0xc255('0x5'),_0xc255('0x6'),_0xc255('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xc255('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xc255('0x8')]},'endDate':{'type':Sequelize[_0xc255('0x8')]},'status':{'type':Sequelize[_0xc255('0x3')],'defaultValue':_0xc255('0x9')},'type':{'type':Sequelize['ENUM']('manual','scheduled'),'allowNull':![],'defaultValue':_0xc255('0xa')},'reportId':{'type':Sequelize[_0xc255('0xb')](0xb)[_0xc255('0xc')]},'reportType':{'type':Sequelize[_0xc255('0x3')]}};
\ No newline at end of file
index f538d3d..5ad390a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa42d=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','basename','eml-format','zip-dir'];(function(_0x579711,_0x389871){var _0x2d8333=function(_0x25b06d){while(--_0x25b06d){_0x579711['push'](_0x579711['shift']());}};_0x2d8333(++_0x389871);}(_0xa42d,0x18a));var _0xda42=function(_0x41c5b9,_0xdbbeb7){_0x41c5b9=_0x41c5b9-0x0;var _0x2c3ab2=_0xa42d[_0x41c5b9];return _0x2c3ab2;};'use strict';var emlformat=require(_0xda42('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xda42('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda42('0x2'));var moment=require(_0xda42('0x3'));var BPromise=require(_0xda42('0x4'));var Mustache=require(_0xda42('0x5'));var util=require(_0xda42('0x6'));var path=require(_0xda42('0x7'));var sox=require(_0xda42('0x8'));var csv=require(_0xda42('0x9'));var ejs=require(_0xda42('0xa'));var fs=require('fs');var fs_extra=require(_0xda42('0xb'));var _=require('lodash');var squel=require(_0xda42('0xc'));var crypto=require(_0xda42('0xd'));var jsforce=require(_0xda42('0xe'));var deskjs=require(_0xda42('0xf'));var toCsv=require(_0xda42('0x9'));var querystring=require(_0xda42('0x10'));var Papa=require(_0xda42('0x11'));var Redis=require(_0xda42('0x12'));var authService=require(_0xda42('0x13'));var qs=require(_0xda42('0x14'));var as=require(_0xda42('0x15'));var hardwareService=require(_0xda42('0x16'));var logger=require(_0xda42('0x17'))(_0xda42('0x18'));var utils=require(_0xda42('0x19'));var config=require(_0xda42('0x1a'));var licenseUtil=require(_0xda42('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x545661,_0x45d3c9){_0x45d3c9=_0x45d3c9||0xcc;return function(_0x53105d){if(_0x53105d){return _0x545661[_0xda42('0x1c')](_0x45d3c9);}return _0x545661[_0xda42('0x1d')](_0x45d3c9)['end']();};}function respondWithResult(_0x18cad0,_0x50ecd6){_0x50ecd6=_0x50ecd6||0xc8;return function(_0x3c689b){if(_0x3c689b){return _0x18cad0[_0xda42('0x1d')](_0x50ecd6)[_0xda42('0x1e')](_0x3c689b);}};}function respondWithFilteredResult(_0x409325,_0x2c24ec){return function(_0x3e282c){if(_0x3e282c){var _0xe8cc03=typeof _0x2c24ec[_0xda42('0x1f')]===_0xda42('0x20')&&typeof _0x2c24ec[_0xda42('0x21')]==='undefined';var _0xfc85ce=_0x3e282c['count'];var _0x24a5a4=_0xe8cc03?0x0:_0x2c24ec['offset'];var _0x1636ec=_0xe8cc03?_0x3e282c[_0xda42('0x22')]:_0x2c24ec[_0xda42('0x1f')]+_0x2c24ec[_0xda42('0x21')];var _0x4856a0;if(_0x1636ec>=_0xfc85ce){_0x1636ec=_0xfc85ce;_0x4856a0=0xc8;}else{_0x4856a0=0xce;}_0x409325['status'](_0x4856a0);return _0x409325[_0xda42('0x23')]('Content-Range',_0x24a5a4+'-'+_0x1636ec+'/'+_0xfc85ce)['json'](_0x3e282c);}return null;};}function patchUpdates(_0x11277c){return function(_0x10217c){try{jsonpatch[_0xda42('0x24')](_0x10217c,_0x11277c,!![]);}catch(_0x30b395){return BPromise['reject'](_0x30b395);}return _0x10217c['save']();};}function saveUpdates(_0x13093c,_0xe65842){return function(_0x2fffc2){if(_0x2fffc2){return _0x2fffc2[_0xda42('0x25')](_0x13093c)[_0xda42('0x26')](function(_0x3c913a){return _0x3c913a;});}return null;};}function removeEntity(_0x30eba5,_0x225b78){return function(_0x386569){if(_0x386569){return _0x386569[_0xda42('0x27')]()['then'](function(){var _0x28b18b=_0x386569[_0xda42('0x28')]({'plain':!![]});var _0x4411c9=_0xda42('0x29');return db[_0xda42('0x2a')][_0xda42('0x27')]({'where':{'type':_0x4411c9,'resourceId':_0x28b18b['id']}})[_0xda42('0x26')](function(){return _0x386569;});})['then'](function(){_0x30eba5[_0xda42('0x1d')](0xcc)[_0xda42('0x2b')]();});}};}function handleEntityNotFound(_0x8f8238,_0x232c74){return function(_0x1be843){if(!_0x1be843){_0x8f8238['sendStatus'](0x194);}return _0x1be843;};}function handleError(_0x314d8a,_0x1fa61c){_0x1fa61c=_0x1fa61c||0x1f4;return function(_0x5e466d){logger[_0xda42('0x2c')](_0x5e466d[_0xda42('0x2d')]);if(_0x5e466d['name']){delete _0x5e466d[_0xda42('0x2e')];}_0x314d8a[_0xda42('0x1d')](_0x1fa61c)[_0xda42('0x2f')](_0x5e466d);};}exports[_0xda42('0x30')]=function(_0x51f4b8,_0x3c04a6){var _0x5d3785={},_0x27351f={},_0x26fe9c={'count':0x0,'rows':[]};var _0x3cf235=_['map'](db[_0xda42('0x31')][_0xda42('0x32')],function(_0x3ed591){return{'name':_0x3ed591[_0xda42('0x33')],'type':_0x3ed591[_0xda42('0x34')][_0xda42('0x35')]};});_0x27351f[_0xda42('0x36')]=_[_0xda42('0x37')](_0x3cf235,_0xda42('0x2e'));_0x27351f[_0xda42('0x38')]=_['keys'](_0x51f4b8[_0xda42('0x38')]);_0x27351f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],_0x27351f[_0xda42('0x38')]);_0x5d3785[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0x27351f[_0xda42('0x36')],qs['fields'](_0x51f4b8['query'][_0xda42('0x3c')]));_0x5d3785[_0xda42('0x3b')]=_0x5d3785[_0xda42('0x3b')][_0xda42('0x3d')]?_0x5d3785[_0xda42('0x3b')]:_0x27351f[_0xda42('0x36')];if(!_0x51f4b8['query'][_0xda42('0x3e')](_0xda42('0x3f'))){_0x5d3785[_0xda42('0x21')]=qs[_0xda42('0x21')](_0x51f4b8[_0xda42('0x38')]['limit']);_0x5d3785[_0xda42('0x1f')]=qs[_0xda42('0x1f')](_0x51f4b8[_0xda42('0x38')][_0xda42('0x1f')]);}_0x5d3785[_0xda42('0x40')]=qs[_0xda42('0x41')](_0x51f4b8[_0xda42('0x38')]['sort']);_0x5d3785[_0xda42('0x42')]=qs['filters'](_[_0xda42('0x43')](_0x51f4b8[_0xda42('0x38')],_0x27351f[_0xda42('0x39')]),_0x3cf235);if(_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]){_0x5d3785[_0xda42('0x42')]=_[_0xda42('0x45')](_0x5d3785[_0xda42('0x42')],{'$or':_[_0xda42('0x37')](_0x3cf235,function(_0x1db34f){if(_0x1db34f[_0xda42('0x34')]!==_0xda42('0x46')){var _0x4336f7={};_0x4336f7[_0x1db34f[_0xda42('0x2e')]]={'$like':'%'+_0x51f4b8[_0xda42('0x38')][_0xda42('0x44')]+'%'};return _0x4336f7;}})});}_0x5d3785=_[_0xda42('0x45')]({},_0x5d3785,_0x51f4b8[_0xda42('0x47')]);var _0x2d60d2={'where':_0x5d3785[_0xda42('0x42')]};return db['AnalyticExtractedReport'][_0xda42('0x22')](_0x2d60d2)[_0xda42('0x26')](function(_0x1bdf76){_0x26fe9c[_0xda42('0x22')]=_0x1bdf76;if(_0x51f4b8[_0xda42('0x38')]['includeAll']){_0x5d3785['include']=[{'all':!![]}];}return db[_0xda42('0x31')][_0xda42('0x48')](_0x5d3785);})[_0xda42('0x26')](function(_0x242ddc){_0x26fe9c['rows']=_0x242ddc;return _0x26fe9c;})[_0xda42('0x26')](respondWithFilteredResult(_0x3c04a6,_0x5d3785))[_0xda42('0x49')](handleError(_0x3c04a6,null));};exports[_0xda42('0x4a')]=function(_0x52b409,_0x544d26){var _0x4d0f37={'raw':!![],'where':{'id':_0x52b409[_0xda42('0x4b')]['id']}},_0xbdaf3f={};_0xbdaf3f['model']=_[_0xda42('0x4c')](db['AnalyticExtractedReport'][_0xda42('0x32')]);_0xbdaf3f[_0xda42('0x38')]=_[_0xda42('0x4c')](_0x52b409[_0xda42('0x38')]);_0xbdaf3f[_0xda42('0x39')]=_[_0xda42('0x3a')](_0xbdaf3f['model'],_0xbdaf3f[_0xda42('0x38')]);_0x4d0f37[_0xda42('0x3b')]=_[_0xda42('0x3a')](_0xbdaf3f[_0xda42('0x36')],qs[_0xda42('0x3c')](_0x52b409[_0xda42('0x38')][_0xda42('0x3c')]));_0x4d0f37['attributes']=_0x4d0f37[_0xda42('0x3b')]['length']?_0x4d0f37[_0xda42('0x3b')]:_0xbdaf3f['model'];if(_0x52b409[_0xda42('0x38')][_0xda42('0x4d')]){_0x4d0f37[_0xda42('0x4e')]=[{'all':!![]}];}_0x4d0f37=_[_0xda42('0x45')]({},_0x4d0f37,_0x52b409[_0xda42('0x47')]);return db[_0xda42('0x31')][_0xda42('0x4f')](_0x4d0f37)['then'](handleEntityNotFound(_0x544d26,null))[_0xda42('0x26')](respondWithResult(_0x544d26,null))['catch'](handleError(_0x544d26,null));};exports[_0xda42('0x50')]=function(_0x5e0e0f,_0x5150fd){return db[_0xda42('0x31')][_0xda42('0x50')](_0x5e0e0f[_0xda42('0x51')],{})['then'](function(_0x4e01cf){var _0x5c80b7=_0x5e0e0f[_0xda42('0x52')]['get']({'plain':!![]});if(!_0x5c80b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c80b7[_0xda42('0x53')]===_0xda42('0x52')){var _0x293304=_0x4e01cf[_0xda42('0x28')]({'plain':!![]});var _0x333101='ExtractedReports';return db[_0xda42('0x54')][_0xda42('0x4f')]({'where':{'name':_0x333101,'userProfileId':_0x5c80b7[_0xda42('0x55')]},'raw':!![]})[_0xda42('0x26')](function(_0x11fe55){if(_0x11fe55&&_0x11fe55[_0xda42('0x56')]===0x0){return db['UserProfileResource'][_0xda42('0x50')]({'name':_0x293304[_0xda42('0x2e')],'resourceId':_0x293304['id'],'type':_0x11fe55[_0xda42('0x2e')],'sectionId':_0x11fe55['id']},{})[_0xda42('0x26')](function(){return _0x4e01cf;});}else{return _0x4e01cf;}})[_0xda42('0x49')](function(_0x50bb8a){logger['error'](_0xda42('0x57'),_0x50bb8a);throw _0x50bb8a;});}return _0x4e01cf;})[_0xda42('0x26')](respondWithResult(_0x5150fd,0xc9))['catch'](handleError(_0x5150fd,null));};exports['update']=function(_0x7e9273,_0xe4e51e){if(_0x7e9273[_0xda42('0x51')]['id']){delete _0x7e9273[_0xda42('0x51')]['id'];}return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x7e9273[_0xda42('0x4b')]['id']}})[_0xda42('0x26')](handleEntityNotFound(_0xe4e51e,null))['then'](saveUpdates(_0x7e9273[_0xda42('0x51')],null))['then'](respondWithResult(_0xe4e51e,null))['catch'](handleError(_0xe4e51e,null));};exports['destroy']=function(_0x5bfce2,_0x502124){return db['AnalyticExtractedReport'][_0xda42('0x4f')]({'where':{'id':_0x5bfce2[_0xda42('0x4b')]['id']}})['then'](handleEntityNotFound(_0x502124,null))['then'](removeEntity(_0x502124,null))[_0xda42('0x49')](handleError(_0x502124,null));};exports[_0xda42('0x58')]=function(_0x33adb6,_0x299a4c,_0x3474ab){return db[_0xda42('0x31')][_0xda42('0x4f')]({'where':{'id':_0x33adb6[_0xda42('0x4b')]['id']},'attributes':['name','basename',_0xda42('0x59'),_0xda42('0x5a')],'raw':!![]})[_0xda42('0x26')](handleEntityNotFound(_0x299a4c,null))[_0xda42('0x26')](function(_0x5e70a9){if(_0x5e70a9){if(!fs['existsSync'](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']))){throw new db[(_0xda42('0x5d'))][(_0xda42('0x5e'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x33adb6[_0xda42('0x38')][_0xda42('0x5f')]){return _0x299a4c[_0xda42('0x1c')](0xc8);}return _0x299a4c[_0xda42('0x58')](path['join'](config[_0xda42('0x5b')],_0xda42('0x5c'),_0x5e70a9['savename']),util[_0xda42('0x60')](_0xda42('0x61'),_0x5e70a9[_0xda42('0x62')]||_0x5e70a9[_0xda42('0x2e')],_0x5e70a9[_0xda42('0x5a')]['toLowerCase']()));}})[_0xda42('0x49')](handleError(_0x299a4c,null));};
\ No newline at end of file
+var _0xd373=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','nolimit','sort','where','pick','filters','filter','merge','name','options','AnalyticExtractedReport','findAll','rows','catch','show','length','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x14f5fd,_0xa396f1){var _0x5d1a44=function(_0x4e75c9){while(--_0x4e75c9){_0x14f5fd['push'](_0x14f5fd['shift']());}};_0x5d1a44(++_0xa396f1);}(_0xd373,0x11f));var _0x3d37=function(_0x441750,_0x2150f9){_0x441750=_0x441750-0x0;var _0x446c9b=_0xd373[_0x441750];return _0x446c9b;};'use strict';var emlformat=require(_0x3d37('0x0'));var rimraf=require(_0x3d37('0x1'));var zipdir=require(_0x3d37('0x2'));var jsonpatch=require(_0x3d37('0x3'));var rp=require(_0x3d37('0x4'));var moment=require(_0x3d37('0x5'));var BPromise=require(_0x3d37('0x6'));var Mustache=require(_0x3d37('0x7'));var util=require(_0x3d37('0x8'));var path=require(_0x3d37('0x9'));var sox=require(_0x3d37('0xa'));var csv=require(_0x3d37('0xb'));var ejs=require(_0x3d37('0xc'));var fs=require('fs');var fs_extra=require(_0x3d37('0xd'));var _=require(_0x3d37('0xe'));var squel=require('squel');var crypto=require(_0x3d37('0xf'));var jsforce=require(_0x3d37('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3d37('0x11'));var Papa=require(_0x3d37('0x12'));var Redis=require(_0x3d37('0x13'));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(_0x3d37('0x14'))(_0x3d37('0x15'));var utils=require(_0x3d37('0x16'));var config=require(_0x3d37('0x17'));var licenseUtil=require(_0x3d37('0x18'));var db=require(_0x3d37('0x19'))['db'];function respondWithStatusCode(_0x351226,_0x33a082){_0x33a082=_0x33a082||0xcc;return function(_0xf47458){if(_0xf47458){return _0x351226['sendStatus'](_0x33a082);}return _0x351226['status'](_0x33a082)[_0x3d37('0x1a')]();};}function respondWithResult(_0x598001,_0x2b5d9a){_0x2b5d9a=_0x2b5d9a||0xc8;return function(_0x1fe1f2){if(_0x1fe1f2){return _0x598001[_0x3d37('0x1b')](_0x2b5d9a)[_0x3d37('0x1c')](_0x1fe1f2);}};}function respondWithFilteredResult(_0x4e6c8a,_0x16e988){return function(_0x20de85){if(_0x20de85){var _0xbb756b=typeof _0x16e988[_0x3d37('0x1d')]==='undefined'&&typeof _0x16e988[_0x3d37('0x1e')]===_0x3d37('0x1f');var _0x3329bd=_0x20de85[_0x3d37('0x20')];var _0x578690=_0xbb756b?0x0:_0x16e988['offset'];var _0x58d26b=_0xbb756b?_0x20de85[_0x3d37('0x20')]:_0x16e988['offset']+_0x16e988[_0x3d37('0x1e')];var _0x105d65;if(_0x58d26b>=_0x3329bd){_0x58d26b=_0x3329bd;_0x105d65=0xc8;}else{_0x105d65=0xce;}_0x4e6c8a[_0x3d37('0x1b')](_0x105d65);return _0x4e6c8a['set'](_0x3d37('0x21'),_0x578690+'-'+_0x58d26b+'/'+_0x3329bd)['json'](_0x20de85);}return null;};}function patchUpdates(_0x3b4bba){return function(_0x33165c){try{jsonpatch[_0x3d37('0x22')](_0x33165c,_0x3b4bba,!![]);}catch(_0xd3d53c){return BPromise[_0x3d37('0x23')](_0xd3d53c);}return _0x33165c[_0x3d37('0x24')]();};}function saveUpdates(_0x36eea3,_0x31a5d6){return function(_0xc2ad53){if(_0xc2ad53){return _0xc2ad53['update'](_0x36eea3)[_0x3d37('0x25')](function(_0x58b335){return _0x58b335;});}return null;};}function removeEntity(_0x31fe8c,_0x5b949f){return function(_0x4a9896){if(_0x4a9896){return _0x4a9896[_0x3d37('0x26')]()['then'](function(){var _0x74b258=_0x4a9896[_0x3d37('0x27')]({'plain':!![]});var _0x175a6b=_0x3d37('0x28');return db[_0x3d37('0x29')][_0x3d37('0x26')]({'where':{'type':_0x175a6b,'resourceId':_0x74b258['id']}})[_0x3d37('0x25')](function(){return _0x4a9896;});})[_0x3d37('0x25')](function(){_0x31fe8c[_0x3d37('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6df17d,_0x2417df){return function(_0x2429e3){if(!_0x2429e3){_0x6df17d[_0x3d37('0x2a')](0x194);}return _0x2429e3;};}function handleError(_0x15bdbd,_0xb007b2){_0xb007b2=_0xb007b2||0x1f4;return function(_0x5c70b0){logger[_0x3d37('0x2b')](_0x5c70b0[_0x3d37('0x2c')]);if(_0x5c70b0['name']){delete _0x5c70b0['name'];}_0x15bdbd[_0x3d37('0x1b')](_0xb007b2)[_0x3d37('0x2d')](_0x5c70b0);};}exports[_0x3d37('0x2e')]=function(_0x3a2791,_0x8e3a35){var _0x4ee329={},_0x33002d={},_0x4d13bc={'count':0x0,'rows':[]};var _0x38e350=_[_0x3d37('0x2f')](db['AnalyticExtractedReport'][_0x3d37('0x30')],function(_0x42d454){return{'name':_0x42d454[_0x3d37('0x31')],'type':_0x42d454[_0x3d37('0x32')]['key']};});_0x33002d[_0x3d37('0x33')]=_[_0x3d37('0x2f')](_0x38e350,'name');_0x33002d[_0x3d37('0x34')]=_[_0x3d37('0x35')](_0x3a2791[_0x3d37('0x34')]);_0x33002d['filters']=_['intersection'](_0x33002d[_0x3d37('0x33')],_0x33002d[_0x3d37('0x34')]);_0x4ee329[_0x3d37('0x36')]=_[_0x3d37('0x37')](_0x33002d['model'],qs[_0x3d37('0x38')](_0x3a2791[_0x3d37('0x34')][_0x3d37('0x38')]));_0x4ee329['attributes']=_0x4ee329['attributes']['length']?_0x4ee329[_0x3d37('0x36')]:_0x33002d[_0x3d37('0x33')];if(!_0x3a2791[_0x3d37('0x34')]['hasOwnProperty'](_0x3d37('0x39'))){_0x4ee329[_0x3d37('0x1e')]=qs[_0x3d37('0x1e')](_0x3a2791[_0x3d37('0x34')][_0x3d37('0x1e')]);_0x4ee329[_0x3d37('0x1d')]=qs[_0x3d37('0x1d')](_0x3a2791[_0x3d37('0x34')][_0x3d37('0x1d')]);}_0x4ee329['order']=qs[_0x3d37('0x3a')](_0x3a2791[_0x3d37('0x34')][_0x3d37('0x3a')]);_0x4ee329[_0x3d37('0x3b')]=qs['filters'](_[_0x3d37('0x3c')](_0x3a2791[_0x3d37('0x34')],_0x33002d[_0x3d37('0x3d')]),_0x38e350);if(_0x3a2791[_0x3d37('0x34')][_0x3d37('0x3e')]){_0x4ee329[_0x3d37('0x3b')]=_[_0x3d37('0x3f')](_0x4ee329[_0x3d37('0x3b')],{'$or':_[_0x3d37('0x2f')](_0x38e350,function(_0x1b1aa2){if(_0x1b1aa2['type']!=='VIRTUAL'){var _0x1cc646={};_0x1cc646[_0x1b1aa2[_0x3d37('0x40')]]={'$like':'%'+_0x3a2791[_0x3d37('0x34')][_0x3d37('0x3e')]+'%'};return _0x1cc646;}})});}_0x4ee329=_[_0x3d37('0x3f')]({},_0x4ee329,_0x3a2791[_0x3d37('0x41')]);var _0x264a22={'where':_0x4ee329[_0x3d37('0x3b')]};return db[_0x3d37('0x42')][_0x3d37('0x20')](_0x264a22)[_0x3d37('0x25')](function(_0x101181){_0x4d13bc[_0x3d37('0x20')]=_0x101181;if(_0x3a2791[_0x3d37('0x34')]['includeAll']){_0x4ee329['include']=[{'all':!![]}];}return db[_0x3d37('0x42')][_0x3d37('0x43')](_0x4ee329);})['then'](function(_0x587dc2){_0x4d13bc[_0x3d37('0x44')]=_0x587dc2;return _0x4d13bc;})[_0x3d37('0x25')](respondWithFilteredResult(_0x8e3a35,_0x4ee329))[_0x3d37('0x45')](handleError(_0x8e3a35,null));};exports[_0x3d37('0x46')]=function(_0x47af36,_0x4b57e8){var _0x1d983e={'raw':!![],'where':{'id':_0x47af36['params']['id']}},_0x4fe703={};_0x4fe703[_0x3d37('0x33')]=_['keys'](db[_0x3d37('0x42')][_0x3d37('0x30')]);_0x4fe703[_0x3d37('0x34')]=_[_0x3d37('0x35')](_0x47af36[_0x3d37('0x34')]);_0x4fe703[_0x3d37('0x3d')]=_[_0x3d37('0x37')](_0x4fe703[_0x3d37('0x33')],_0x4fe703['query']);_0x1d983e[_0x3d37('0x36')]=_[_0x3d37('0x37')](_0x4fe703[_0x3d37('0x33')],qs[_0x3d37('0x38')](_0x47af36[_0x3d37('0x34')]['fields']));_0x1d983e[_0x3d37('0x36')]=_0x1d983e['attributes'][_0x3d37('0x47')]?_0x1d983e[_0x3d37('0x36')]:_0x4fe703[_0x3d37('0x33')];if(_0x47af36[_0x3d37('0x34')][_0x3d37('0x48')]){_0x1d983e[_0x3d37('0x49')]=[{'all':!![]}];}_0x1d983e=_[_0x3d37('0x3f')]({},_0x1d983e,_0x47af36[_0x3d37('0x41')]);return db[_0x3d37('0x42')][_0x3d37('0x4a')](_0x1d983e)[_0x3d37('0x25')](handleEntityNotFound(_0x4b57e8,null))[_0x3d37('0x25')](respondWithResult(_0x4b57e8,null))['catch'](handleError(_0x4b57e8,null));};exports[_0x3d37('0x4b')]=function(_0x1347d9,_0x5639f9){return db[_0x3d37('0x42')][_0x3d37('0x4b')](_0x1347d9[_0x3d37('0x4c')],{})['then'](function(_0x31f949){var _0x439ca4=_0x1347d9[_0x3d37('0x4d')]['get']({'plain':!![]});if(!_0x439ca4)throw new Error(_0x3d37('0x4e'));if(_0x439ca4[_0x3d37('0x4f')]===_0x3d37('0x4d')){var _0x110fb0=_0x31f949['get']({'plain':!![]});var _0x2f44c4='ExtractedReports';return db[_0x3d37('0x50')][_0x3d37('0x4a')]({'where':{'name':_0x2f44c4,'userProfileId':_0x439ca4[_0x3d37('0x51')]},'raw':!![]})['then'](function(_0x4abeed){if(_0x4abeed&&_0x4abeed[_0x3d37('0x52')]===0x0){return db[_0x3d37('0x29')][_0x3d37('0x4b')]({'name':_0x110fb0[_0x3d37('0x40')],'resourceId':_0x110fb0['id'],'type':_0x4abeed['name'],'sectionId':_0x4abeed['id']},{})[_0x3d37('0x25')](function(){return _0x31f949;});}else{return _0x31f949;}})['catch'](function(_0x3fafb1){logger[_0x3d37('0x2b')](_0x3d37('0x53'),_0x3fafb1);throw _0x3fafb1;});}return _0x31f949;})[_0x3d37('0x25')](respondWithResult(_0x5639f9,0xc9))[_0x3d37('0x45')](handleError(_0x5639f9,null));};exports[_0x3d37('0x54')]=function(_0x2c780c,_0x6127c1){if(_0x2c780c[_0x3d37('0x4c')]['id']){delete _0x2c780c[_0x3d37('0x4c')]['id'];}return db['AnalyticExtractedReport'][_0x3d37('0x4a')]({'where':{'id':_0x2c780c[_0x3d37('0x55')]['id']}})[_0x3d37('0x25')](handleEntityNotFound(_0x6127c1,null))['then'](saveUpdates(_0x2c780c[_0x3d37('0x4c')],null))['then'](respondWithResult(_0x6127c1,null))[_0x3d37('0x45')](handleError(_0x6127c1,null));};exports[_0x3d37('0x26')]=function(_0x15ae86,_0x5d2205){return db['AnalyticExtractedReport'][_0x3d37('0x4a')]({'where':{'id':_0x15ae86[_0x3d37('0x55')]['id']}})[_0x3d37('0x25')](handleEntityNotFound(_0x5d2205,null))[_0x3d37('0x25')](removeEntity(_0x5d2205,null))[_0x3d37('0x45')](handleError(_0x5d2205,null));};exports['download']=function(_0x3c32ca,_0x5bc351,_0x2570b1){return db[_0x3d37('0x42')][_0x3d37('0x4a')]({'where':{'id':_0x3c32ca[_0x3d37('0x55')]['id']},'attributes':['name',_0x3d37('0x56'),_0x3d37('0x57'),_0x3d37('0x58')],'raw':!![]})[_0x3d37('0x25')](handleEntityNotFound(_0x5bc351,null))[_0x3d37('0x25')](function(_0x50e115){if(_0x50e115){if(!fs['existsSync'](path[_0x3d37('0x59')](config['root'],_0x3d37('0x5a'),_0x50e115[_0x3d37('0x57')]))){throw new db[(_0x3d37('0x5b'))][(_0x3d37('0x5c'))](_0x3d37('0x5d'));}if(_0x3c32ca['query'][_0x3d37('0x5e')]){return _0x5bc351['sendStatus'](0xc8);}return _0x5bc351[_0x3d37('0x5f')](path['join'](config[_0x3d37('0x60')],'server/files/reports',_0x50e115['savename']),util['format']('%s.%s',_0x50e115[_0x3d37('0x56')]||_0x50e115[_0x3d37('0x40')],_0x50e115[_0x3d37('0x58')][_0x3d37('0x61')]()));}})['catch'](handleError(_0x5bc351,null));};
\ No newline at end of file
index 9f4a342..1254619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5748=['moment','rimraf','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x4ec80b,_0x324203){var _0x187bc7=function(_0x4a8e8a){while(--_0x4a8e8a){_0x4ec80b['push'](_0x4ec80b['shift']());}};_0x187bc7(++_0x324203);}(_0x5748,0x1d2));var _0x8574=function(_0x56b7dc,_0x5a2857){_0x56b7dc=_0x56b7dc-0x0;var _0x31a8dd=_0x5748[_0x56b7dc];return _0x31a8dd;};'use strict';var _=require(_0x8574('0x0'));var util=require(_0x8574('0x1'));var logger=require(_0x8574('0x2'))(_0x8574('0x3'));var moment=require(_0x8574('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8574('0x5'));var config=require(_0x8574('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x8574('0x7')]=function(_0x40738f,_0x4c419d){return _0x40738f['define'](_0x8574('0x8'),attributes,{'tableName':_0x8574('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1d1=['./analyticExtractedReport.attributes','exports','analytics_extracted_reports','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x12b00b,_0x1e11e1){var _0x1748da=function(_0x2a2f46){while(--_0x2a2f46){_0x12b00b['push'](_0x12b00b['shift']());}};_0x1748da(++_0x1e11e1);}(_0xa1d1,0x1ab));var _0x1a1d=function(_0x11a551,_0x40217b){_0x11a551=_0x11a551-0x0;var _0x505c1b=_0xa1d1[_0x11a551];return _0x505c1b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1a1d('0x0'));var moment=require(_0x1a1d('0x1'));var BPromise=require(_0x1a1d('0x2'));var rp=require(_0x1a1d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a1d('0x4'));var attributes=require(_0x1a1d('0x5'));module[_0x1a1d('0x6')]=function(_0xc0b0c2,_0x581671){return _0xc0b0c2['define']('AnalyticExtractedReport',attributes,{'tableName':_0x1a1d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 74e1dcd..beb3e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ed8=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x50ba3a,_0x2afbd0){var _0x5a8554=function(_0x26e2d8){while(--_0x26e2d8){_0x50ba3a['push'](_0x50ba3a['shift']());}};_0x5a8554(++_0x2afbd0);}(_0x4ed8,0xc9));var _0x84ed=function(_0x323658,_0xe37515){_0x323658=_0x323658-0x0;var _0x4ad32c=_0x4ed8[_0x323658];return _0x4ad32c;};'use strict';var _=require(_0x84ed('0x0'));var util=require('util');var moment=require(_0x84ed('0x1'));var BPromise=require(_0x84ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84ed('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x84ed('0x4'));var logger=require(_0x84ed('0x5'))(_0x84ed('0x6'));var config=require(_0x84ed('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84ed('0x8')][_0x84ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4281dc,_0x14dbe2,_0x56a26a){return new BPromise(function(_0x4243c1,_0x2511cd){return client[_0x84ed('0xa')](_0x4281dc,_0x56a26a)['then'](function(_0x16c096){logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));logger[_0x84ed('0xe')](_0x84ed('0xf'),_0x14dbe2,_0x84ed('0xd'),JSON[_0x84ed('0x10')](_0x16c096));if(_0x16c096[_0x84ed('0x11')]){if(_0x16c096[_0x84ed('0x11')]['code']===0x1f4){logger['error'](_0x84ed('0xc'),_0x14dbe2,_0x16c096[_0x84ed('0x11')]['message']);return _0x2511cd(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}logger[_0x84ed('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x14dbe2,_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);return _0x4243c1(_0x16c096[_0x84ed('0x11')][_0x84ed('0x12')]);}else{logger[_0x84ed('0xb')](_0x84ed('0xc'),_0x14dbe2,_0x84ed('0xd'));_0x4243c1(_0x16c096[_0x84ed('0x13')]['message']);}})[_0x84ed('0x14')](function(_0x14a6d0){logger[_0x84ed('0x11')](_0x84ed('0xc'),_0x14dbe2,_0x14a6d0);_0x2511cd(_0x14a6d0);});});}
\ No newline at end of file
+var _0x757c=['result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x1c9aa4,_0x212e77){var _0x3e88ab=function(_0x2d45f3){while(--_0x2d45f3){_0x1c9aa4['push'](_0x1c9aa4['shift']());}};_0x3e88ab(++_0x212e77);}(_0x757c,0x191));var _0xc757=function(_0x108126,_0x8cc887){_0x108126=_0x108126-0x0;var _0x196761=_0x757c[_0x108126];return _0x196761;};'use strict';var _=require(_0xc757('0x0'));var util=require(_0xc757('0x1'));var moment=require('moment');var BPromise=require(_0xc757('0x2'));var rs=require(_0xc757('0x3'));var fs=require('fs');var Redis=require(_0xc757('0x4'));var db=require(_0xc757('0x5'))['db'];var utils=require(_0xc757('0x6'));var logger=require(_0xc757('0x7'))(_0xc757('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc757('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fff5d,_0x6a9867,_0x78a1e2){return new BPromise(function(_0x280ca0,_0x112111){return client[_0xc757('0xa')](_0x4fff5d,_0x78a1e2)[_0xc757('0xb')](function(_0x53d71b){logger['info'](_0xc757('0xc'),_0x6a9867,'request\x20sent');logger[_0xc757('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'),JSON['stringify'](_0x53d71b));if(_0x53d71b[_0xc757('0xf')]){if(_0x53d71b[_0xc757('0xf')][_0xc757('0x10')]===0x1f4){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x53d71b['error'][_0xc757('0x11')]);return _0x112111(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);return _0x280ca0(_0x53d71b[_0xc757('0xf')][_0xc757('0x11')]);}else{logger[_0xc757('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x6a9867,_0xc757('0xe'));_0x280ca0(_0x53d71b[_0xc757('0x13')][_0xc757('0x11')]);}})['catch'](function(_0x21ed91){logger[_0xc757('0xf')](_0xc757('0xc'),_0x6a9867,_0x21ed91);_0x112111(_0x21ed91);});});}
\ No newline at end of file
index cf26cbf..5ff8e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/download','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4adaf2,_0x4a7b4c){var _0x42080f=function(_0x146a50){while(--_0x146a50){_0x4adaf2['push'](_0x4adaf2['shift']());}};_0x42080f(++_0x4a7b4c);}(_0xfa9e,0x8e));var _0xefa9=function(_0x5c172,_0x343986){_0x5c172=_0x5c172-0x0;var _0x5526f3=_0xfa9e[_0x5c172];return _0x5526f3;};'use strict';var multer=require(_0xefa9('0x0'));var util=require(_0xefa9('0x1'));var path=require(_0xefa9('0x2'));var timeout=require(_0xefa9('0x3'));var express=require(_0xefa9('0x4'));var router=express[_0xefa9('0x5')]();var fs_extra=require(_0xefa9('0x6'));var auth=require(_0xefa9('0x7'));var interaction=require(_0xefa9('0x8'));var config=require(_0xefa9('0x9'));var controller=require('./analyticExtractedReport.controller');router[_0xefa9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefa9('0xb')]);router['get']('/:id',auth[_0xefa9('0xc')](),controller[_0xefa9('0xd')]);router[_0xefa9('0xa')](_0xefa9('0xe'),auth[_0xefa9('0xc')](),controller['download']);router[_0xefa9('0xf')]('/',auth['isAuthenticated'](),controller[_0xefa9('0x10')]);router[_0xefa9('0x11')](_0xefa9('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xefa9('0x13')](_0xefa9('0x12'),auth['isAuthenticated'](),controller[_0xefa9('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb8e5=['show','/:id/download','isAuthenticated','download','create','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xb8e5,0x1d0));var _0x5b8e=function(_0x14bbf1,_0xb3abf7){_0x14bbf1=_0x14bbf1-0x0;var _0x69e8e=_0xb8e5[_0x14bbf1];return _0x69e8e;};'use strict';var multer=require(_0x5b8e('0x0'));var util=require('util');var path=require(_0x5b8e('0x1'));var timeout=require(_0x5b8e('0x2'));var express=require(_0x5b8e('0x3'));var router=express['Router']();var fs_extra=require(_0x5b8e('0x4'));var auth=require(_0x5b8e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b8e('0x6'));var controller=require(_0x5b8e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5b8e('0x8')]);router[_0x5b8e('0x9')](_0x5b8e('0xa'),auth['isAuthenticated'](),controller[_0x5b8e('0xb')]);router[_0x5b8e('0x9')](_0x5b8e('0xc'),auth[_0x5b8e('0xd')](),controller[_0x5b8e('0xe')]);router['post']('/',auth[_0x5b8e('0xd')](),controller[_0x5b8e('0xf')]);router['put'](_0x5b8e('0xa'),auth['isAuthenticated'](),controller[_0x5b8e('0x10')]);router[_0x5b8e('0x11')](_0x5b8e('0xa'),auth[_0x5b8e('0xd')](),controller['destroy']);module[_0x5b8e('0x12')]=router;
\ No newline at end of file
index 1621876..2038b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffe=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2f0274,_0x2dd966){var _0x188cca=function(_0x28e7b1){while(--_0x28e7b1){_0x2f0274['push'](_0x2f0274['shift']());}};_0x188cca(++_0x2dd966);}(_0xeffe,0x1e9));var _0xeeff=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xeffe[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xeeff('0x0'));module[_0xeeff('0x1')]={'field':{'type':Sequelize[_0xeeff('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xeeff('0x3')]},'format':{'type':Sequelize[_0xeeff('0x3')]},'groupBy':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xeeff('0x3')]},'custom':{'type':Sequelize[_0xeeff('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc5fd=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x31b6e6,_0x34673a){var _0x317dd9=function(_0x1c95e2){while(--_0x1c95e2){_0x31b6e6['push'](_0x31b6e6['shift']());}};_0x317dd9(++_0x34673a);}(_0xc5fd,0xb4));var _0xdc5f=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xc5fd[_0xb5fc3e];return _0x2efc3c;};'use strict';var Sequelize=require(_0xdc5f('0x0'));module[_0xdc5f('0x1')]={'field':{'type':Sequelize[_0xdc5f('0x2')]},'alias':{'type':Sequelize[_0xdc5f('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdc5f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xdc5f('0x4')],'defaultValue':![]}};
\ No newline at end of file
index ddc460a..30e32e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0e5=['bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','sendStatus','error','stack','name','send','map','AnalyticFieldReport','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','rows','catch','params','intersection','include','find','create','bulkCreate','body','bulkDestroy','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xf0e5,0x185));var _0x5f0e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xf0e5[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x5f0e('0x0'));var rimraf=require(_0x5f0e('0x1'));var zipdir=require(_0x5f0e('0x2'));var jsonpatch=require(_0x5f0e('0x3'));var rp=require(_0x5f0e('0x4'));var moment=require(_0x5f0e('0x5'));var BPromise=require(_0x5f0e('0x6'));var Mustache=require(_0x5f0e('0x7'));var util=require(_0x5f0e('0x8'));var path=require('path');var sox=require(_0x5f0e('0x9'));var csv=require(_0x5f0e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f0e('0xb'));var _=require(_0x5f0e('0xc'));var squel=require(_0x5f0e('0xd'));var crypto=require('crypto');var jsforce=require(_0x5f0e('0xe'));var deskjs=require(_0x5f0e('0xf'));var toCsv=require(_0x5f0e('0xa'));var querystring=require(_0x5f0e('0x10'));var Papa=require(_0x5f0e('0x11'));var Redis=require(_0x5f0e('0x12'));var authService=require(_0x5f0e('0x13'));var qs=require(_0x5f0e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f0e('0x15'));var utils=require(_0x5f0e('0x16'));var config=require(_0x5f0e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f0e('0x18'))['db'];function respondWithStatusCode(_0x64a9b2,_0x4cf23f){_0x4cf23f=_0x4cf23f||0xcc;return function(_0x1fd2be){if(_0x1fd2be){return _0x64a9b2['sendStatus'](_0x4cf23f);}return _0x64a9b2[_0x5f0e('0x19')](_0x4cf23f)[_0x5f0e('0x1a')]();};}function respondWithResult(_0x30a30e,_0x287939){_0x287939=_0x287939||0xc8;return function(_0x17df17){if(_0x17df17){return _0x30a30e[_0x5f0e('0x19')](_0x287939)[_0x5f0e('0x1b')](_0x17df17);}};}function respondWithFilteredResult(_0xbf2f2a,_0x21f168){return function(_0x15a587){if(_0x15a587){var _0x40af2b=typeof _0x21f168[_0x5f0e('0x1c')]===_0x5f0e('0x1d')&&typeof _0x21f168[_0x5f0e('0x1e')]===_0x5f0e('0x1d');var _0x40e4ab=_0x15a587[_0x5f0e('0x1f')];var _0x542c5d=_0x40af2b?0x0:_0x21f168[_0x5f0e('0x1c')];var _0x38d7a8=_0x40af2b?_0x15a587[_0x5f0e('0x1f')]:_0x21f168[_0x5f0e('0x1c')]+_0x21f168[_0x5f0e('0x1e')];var _0x4bdf42;if(_0x38d7a8>=_0x40e4ab){_0x38d7a8=_0x40e4ab;_0x4bdf42=0xc8;}else{_0x4bdf42=0xce;}_0xbf2f2a[_0x5f0e('0x19')](_0x4bdf42);return _0xbf2f2a[_0x5f0e('0x20')]('Content-Range',_0x542c5d+'-'+_0x38d7a8+'/'+_0x40e4ab)[_0x5f0e('0x1b')](_0x15a587);}return null;};}function patchUpdates(_0x20be4c){return function(_0xf70efa){try{jsonpatch[_0x5f0e('0x21')](_0xf70efa,_0x20be4c,!![]);}catch(_0x26b03b){return BPromise['reject'](_0x26b03b);}return _0xf70efa['save']();};}function saveUpdates(_0x3ace8c,_0x1a5045){return function(_0x4faa9b){if(_0x4faa9b){return _0x4faa9b[_0x5f0e('0x22')](_0x3ace8c)['then'](function(_0x373077){return _0x373077;});}return null;};}function removeEntity(_0xd2a027,_0x55eb49){return function(_0xf9ca5e){if(_0xf9ca5e){return _0xf9ca5e[_0x5f0e('0x23')]()['then'](function(){_0xd2a027[_0x5f0e('0x19')](0xcc)[_0x5f0e('0x1a')]();});}};}function handleEntityNotFound(_0x2f50a5,_0x11e761){return function(_0xc7c07e){if(!_0xc7c07e){_0x2f50a5[_0x5f0e('0x24')](0x194);}return _0xc7c07e;};}function handleError(_0x2c63ab,_0x306652){_0x306652=_0x306652||0x1f4;return function(_0x55f5dd){logger[_0x5f0e('0x25')](_0x55f5dd[_0x5f0e('0x26')]);if(_0x55f5dd[_0x5f0e('0x27')]){delete _0x55f5dd[_0x5f0e('0x27')];}_0x2c63ab['status'](_0x306652)[_0x5f0e('0x28')](_0x55f5dd);};}exports['index']=function(_0x2a47e9,_0x2d0c9f){var _0x1a1bcf={},_0x171e3c={},_0x336618={'count':0x0,'rows':[]};var _0x118ccb=_[_0x5f0e('0x29')](db[_0x5f0e('0x2a')]['rawAttributes'],function(_0x211766){return{'name':_0x211766['fieldName'],'type':_0x211766[_0x5f0e('0x2b')][_0x5f0e('0x2c')]};});_0x171e3c[_0x5f0e('0x2d')]=_[_0x5f0e('0x29')](_0x118ccb,_0x5f0e('0x27'));_0x171e3c['query']=_[_0x5f0e('0x2e')](_0x2a47e9[_0x5f0e('0x2f')]);_0x171e3c[_0x5f0e('0x30')]=_['intersection'](_0x171e3c[_0x5f0e('0x2d')],_0x171e3c['query']);_0x1a1bcf['attributes']=_['intersection'](_0x171e3c['model'],qs[_0x5f0e('0x31')](_0x2a47e9['query'][_0x5f0e('0x31')]));_0x1a1bcf[_0x5f0e('0x32')]=_0x1a1bcf[_0x5f0e('0x32')][_0x5f0e('0x33')]?_0x1a1bcf[_0x5f0e('0x32')]:_0x171e3c['model'];if(!_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x34')](_0x5f0e('0x35'))){_0x1a1bcf['limit']=qs[_0x5f0e('0x1e')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x1e')]);_0x1a1bcf[_0x5f0e('0x1c')]=qs[_0x5f0e('0x1c')](_0x2a47e9[_0x5f0e('0x2f')]['offset']);}_0x1a1bcf[_0x5f0e('0x36')]=qs[_0x5f0e('0x37')](_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x37')]);_0x1a1bcf[_0x5f0e('0x38')]=qs['filters'](_[_0x5f0e('0x39')](_0x2a47e9['query'],_0x171e3c[_0x5f0e('0x30')]),_0x118ccb);if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]){_0x1a1bcf[_0x5f0e('0x38')]=_[_0x5f0e('0x3b')](_0x1a1bcf[_0x5f0e('0x38')],{'$or':_[_0x5f0e('0x29')](_0x118ccb,function(_0x3b1572){if(_0x3b1572['type']!==_0x5f0e('0x3c')){var _0x2a112f={};_0x2a112f[_0x3b1572[_0x5f0e('0x27')]]={'$like':'%'+_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3a')]+'%'};return _0x2a112f;}})});}_0x1a1bcf=_[_0x5f0e('0x3b')]({},_0x1a1bcf,_0x2a47e9[_0x5f0e('0x3d')]);var _0x2e7eaf={'where':_0x1a1bcf[_0x5f0e('0x38')]};return db[_0x5f0e('0x2a')][_0x5f0e('0x1f')](_0x2e7eaf)[_0x5f0e('0x3e')](function(_0x4cf602){_0x336618[_0x5f0e('0x1f')]=_0x4cf602;if(_0x2a47e9[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x1a1bcf['include']=[{'all':!![]}];}return db[_0x5f0e('0x2a')]['findAll'](_0x1a1bcf);})[_0x5f0e('0x3e')](function(_0x2eb5f6){_0x336618[_0x5f0e('0x40')]=_0x2eb5f6;return _0x336618;})[_0x5f0e('0x3e')](respondWithFilteredResult(_0x2d0c9f,_0x1a1bcf))[_0x5f0e('0x41')](handleError(_0x2d0c9f,null));};exports['show']=function(_0x300b66,_0x18ed0e){var _0x326c8c={'raw':![],'where':{'id':_0x300b66[_0x5f0e('0x42')]['id']}},_0x386858={};_0x386858[_0x5f0e('0x2d')]=_['keys'](db[_0x5f0e('0x2a')]['rawAttributes']);_0x386858[_0x5f0e('0x2f')]=_[_0x5f0e('0x2e')](_0x300b66[_0x5f0e('0x2f')]);_0x386858['filters']=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],_0x386858[_0x5f0e('0x2f')]);_0x326c8c[_0x5f0e('0x32')]=_[_0x5f0e('0x43')](_0x386858[_0x5f0e('0x2d')],qs[_0x5f0e('0x31')](_0x300b66['query'][_0x5f0e('0x31')]));_0x326c8c[_0x5f0e('0x32')]=_0x326c8c['attributes'][_0x5f0e('0x33')]?_0x326c8c[_0x5f0e('0x32')]:_0x386858['model'];if(_0x300b66[_0x5f0e('0x2f')][_0x5f0e('0x3f')]){_0x326c8c[_0x5f0e('0x44')]=[{'all':!![]}];}_0x326c8c=_[_0x5f0e('0x3b')]({},_0x326c8c,_0x300b66[_0x5f0e('0x3d')]);return db[_0x5f0e('0x2a')][_0x5f0e('0x45')](_0x326c8c)[_0x5f0e('0x3e')](handleEntityNotFound(_0x18ed0e,null))['then'](respondWithResult(_0x18ed0e,null))['catch'](handleError(_0x18ed0e,null));};exports[_0x5f0e('0x46')]=function(_0x5c5f3f,_0x517a47){return db['AnalyticFieldReport']['create'](_0x5c5f3f['body'],{})[_0x5f0e('0x3e')](respondWithResult(_0x517a47,0xc9))[_0x5f0e('0x41')](handleError(_0x517a47,null));};exports[_0x5f0e('0x47')]=function(_0x265d01,_0x3ea3da){return db['AnalyticFieldReport']['bulkCreate'](_0x265d01[_0x5f0e('0x48')],{'raw':![],'individualHooks':!![]})[_0x5f0e('0x3e')](respondWithResult(_0x3ea3da,0xc9))[_0x5f0e('0x41')](handleError(_0x3ea3da,null));};exports[_0x5f0e('0x22')]=function(_0x30fc72,_0x3747c6){if(_0x30fc72[_0x5f0e('0x48')]['id']){delete _0x30fc72[_0x5f0e('0x48')]['id'];}return db[_0x5f0e('0x2a')][_0x5f0e('0x45')]({'where':{'id':_0x30fc72[_0x5f0e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3747c6,null))[_0x5f0e('0x3e')](saveUpdates(_0x30fc72[_0x5f0e('0x48')],null))['then'](respondWithResult(_0x3747c6,null))[_0x5f0e('0x41')](handleError(_0x3747c6,null));};exports[_0x5f0e('0x23')]=function(_0xd0650c,_0xb29786){return db[_0x5f0e('0x2a')]['find']({'where':{'id':_0xd0650c[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0xb29786,null))[_0x5f0e('0x3e')](removeEntity(_0xb29786,null))[_0x5f0e('0x41')](handleError(_0xb29786,null));};exports[_0x5f0e('0x49')]=function(_0x1b10a,_0x20ff95){return db[_0x5f0e('0x2a')][_0x5f0e('0x23')]({'where':{'id':_0x1b10a[_0x5f0e('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x20ff95,0xcc))[_0x5f0e('0x41')](handleError(_0x20ff95,null));};exports['addFields']=function(_0x3a3b32,_0x413671,_0x58cd9a){return db[_0x5f0e('0x4a')][_0x5f0e('0x4b')]({'where':{'id':_0x3a3b32[_0x5f0e('0x42')]['id']}})[_0x5f0e('0x3e')](handleEntityNotFound(_0x413671,null))['then'](function(_0x5c4d0c){if(_0x5c4d0c){return db[_0x5f0e('0x4c')]['transaction'](function(_0x1bdf43){return db[_0x5f0e('0x2a')]['destroy']({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']},'transaction':_0x1bdf43})[_0x5f0e('0x3e')](function(_0x1f34d8){var _0x42cd3b=_[_0x5f0e('0x29')](_0x3a3b32['body'],function(_0x2acff2){delete _0x2acff2['id'];_0x2acff2[_0x5f0e('0x4d')]=_0x3a3b32['params']['id'];return _0x2acff2;});return db[_0x5f0e('0x2a')][_0x5f0e('0x47')](_0x42cd3b,{'transaction':_0x1bdf43});});})[_0x5f0e('0x3e')](function(){return db['AnalyticFieldReport'][_0x5f0e('0x4e')]({'where':{'CustomReportId':_0x3a3b32[_0x5f0e('0x42')]['id']}});});}})[_0x5f0e('0x3e')](respondWithResult(_0x413671,null))[_0x5f0e('0x41')](handleError(_0x413671,null));};
\ No newline at end of file
+var _0x8d40=['findAll','rows','catch','show','params','keys','length','create','body','bulkCreate','find','bulkDestroy','ids','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','AnalyticFieldReport','rawAttributes','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include'];(function(_0x84faec,_0x43c6dd){var _0xb0e2f9=function(_0x1ea21d){while(--_0x1ea21d){_0x84faec['push'](_0x84faec['shift']());}};_0xb0e2f9(++_0x43c6dd);}(_0x8d40,0x1a6));var _0x08d4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8d40[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x08d4('0x0'));var rimraf=require(_0x08d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x08d4('0x2'));var moment=require('moment');var BPromise=require(_0x08d4('0x3'));var Mustache=require(_0x08d4('0x4'));var util=require(_0x08d4('0x5'));var path=require('path');var sox=require(_0x08d4('0x6'));var csv=require('to-csv');var ejs=require(_0x08d4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08d4('0x8'));var squel=require(_0x08d4('0x9'));var crypto=require(_0x08d4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08d4('0xb'));var querystring=require(_0x08d4('0xc'));var Papa=require(_0x08d4('0xd'));var Redis=require(_0x08d4('0xe'));var authService=require(_0x08d4('0xf'));var qs=require(_0x08d4('0x10'));var as=require(_0x08d4('0x11'));var hardwareService=require(_0x08d4('0x12'));var logger=require(_0x08d4('0x13'))(_0x08d4('0x14'));var utils=require(_0x08d4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x08d4('0x16'));var db=require(_0x08d4('0x17'))['db'];function respondWithStatusCode(_0x1e9a00,_0x441d22){_0x441d22=_0x441d22||0xcc;return function(_0x2d7344){if(_0x2d7344){return _0x1e9a00[_0x08d4('0x18')](_0x441d22);}return _0x1e9a00[_0x08d4('0x19')](_0x441d22)[_0x08d4('0x1a')]();};}function respondWithResult(_0x20b972,_0x1d527e){_0x1d527e=_0x1d527e||0xc8;return function(_0xdc2bf2){if(_0xdc2bf2){return _0x20b972[_0x08d4('0x19')](_0x1d527e)[_0x08d4('0x1b')](_0xdc2bf2);}};}function respondWithFilteredResult(_0xd56ced,_0x4b25d6){return function(_0xbd2e15){if(_0xbd2e15){var _0x2e5d55=typeof _0x4b25d6[_0x08d4('0x1c')]==='undefined'&&typeof _0x4b25d6[_0x08d4('0x1d')]===_0x08d4('0x1e');var _0x306268=_0xbd2e15[_0x08d4('0x1f')];var _0x578d5b=_0x2e5d55?0x0:_0x4b25d6['offset'];var _0x5ef2c4=_0x2e5d55?_0xbd2e15[_0x08d4('0x1f')]:_0x4b25d6[_0x08d4('0x1c')]+_0x4b25d6['limit'];var _0x3ca30c;if(_0x5ef2c4>=_0x306268){_0x5ef2c4=_0x306268;_0x3ca30c=0xc8;}else{_0x3ca30c=0xce;}_0xd56ced[_0x08d4('0x19')](_0x3ca30c);return _0xd56ced[_0x08d4('0x20')](_0x08d4('0x21'),_0x578d5b+'-'+_0x5ef2c4+'/'+_0x306268)[_0x08d4('0x1b')](_0xbd2e15);}return null;};}function patchUpdates(_0xf3a6e5){return function(_0xa84e9f){try{jsonpatch[_0x08d4('0x22')](_0xa84e9f,_0xf3a6e5,!![]);}catch(_0x1ade54){return BPromise[_0x08d4('0x23')](_0x1ade54);}return _0xa84e9f[_0x08d4('0x24')]();};}function saveUpdates(_0x55c065,_0x3878fe){return function(_0x147db3){if(_0x147db3){return _0x147db3[_0x08d4('0x25')](_0x55c065)['then'](function(_0x2516f9){return _0x2516f9;});}return null;};}function removeEntity(_0x222dc9,_0x38e9cc){return function(_0x2a321d){if(_0x2a321d){return _0x2a321d[_0x08d4('0x26')]()[_0x08d4('0x27')](function(){_0x222dc9[_0x08d4('0x19')](0xcc)[_0x08d4('0x1a')]();});}};}function handleEntityNotFound(_0x5233ee,_0x45b062){return function(_0x320503){if(!_0x320503){_0x5233ee['sendStatus'](0x194);}return _0x320503;};}function handleError(_0x57b48f,_0x5df74a){_0x5df74a=_0x5df74a||0x1f4;return function(_0x4ed522){logger['error'](_0x4ed522[_0x08d4('0x28')]);if(_0x4ed522[_0x08d4('0x29')]){delete _0x4ed522['name'];}_0x57b48f[_0x08d4('0x19')](_0x5df74a)['send'](_0x4ed522);};}exports[_0x08d4('0x2a')]=function(_0x24e256,_0x46b348){var _0x651479={},_0x59287b={},_0x428cf7={'count':0x0,'rows':[]};var _0x9facc4=_['map'](db[_0x08d4('0x2b')][_0x08d4('0x2c')],function(_0x5f07ee){return{'name':_0x5f07ee['fieldName'],'type':_0x5f07ee['type']['key']};});_0x59287b[_0x08d4('0x2d')]=_[_0x08d4('0x2e')](_0x9facc4,_0x08d4('0x29'));_0x59287b[_0x08d4('0x2f')]=_['keys'](_0x24e256[_0x08d4('0x2f')]);_0x59287b[_0x08d4('0x30')]=_[_0x08d4('0x31')](_0x59287b[_0x08d4('0x2d')],_0x59287b[_0x08d4('0x2f')]);_0x651479[_0x08d4('0x32')]=_[_0x08d4('0x31')](_0x59287b['model'],qs['fields'](_0x24e256['query'][_0x08d4('0x33')]));_0x651479['attributes']=_0x651479['attributes']['length']?_0x651479[_0x08d4('0x32')]:_0x59287b[_0x08d4('0x2d')];if(!_0x24e256[_0x08d4('0x2f')]['hasOwnProperty'](_0x08d4('0x34'))){_0x651479[_0x08d4('0x1d')]=qs[_0x08d4('0x1d')](_0x24e256[_0x08d4('0x2f')][_0x08d4('0x1d')]);_0x651479['offset']=qs['offset'](_0x24e256['query'][_0x08d4('0x1c')]);}_0x651479[_0x08d4('0x35')]=qs[_0x08d4('0x36')](_0x24e256['query'][_0x08d4('0x36')]);_0x651479['where']=qs[_0x08d4('0x30')](_[_0x08d4('0x37')](_0x24e256[_0x08d4('0x2f')],_0x59287b[_0x08d4('0x30')]),_0x9facc4);if(_0x24e256['query'][_0x08d4('0x38')]){_0x651479[_0x08d4('0x39')]=_['merge'](_0x651479[_0x08d4('0x39')],{'$or':_[_0x08d4('0x2e')](_0x9facc4,function(_0x331429){if(_0x331429[_0x08d4('0x3a')]!==_0x08d4('0x3b')){var _0x228608={};_0x228608[_0x331429[_0x08d4('0x29')]]={'$like':'%'+_0x24e256['query'][_0x08d4('0x38')]+'%'};return _0x228608;}})});}_0x651479=_[_0x08d4('0x3c')]({},_0x651479,_0x24e256[_0x08d4('0x3d')]);var _0x2ce715={'where':_0x651479['where']};return db[_0x08d4('0x2b')][_0x08d4('0x1f')](_0x2ce715)[_0x08d4('0x27')](function(_0x226a5d){_0x428cf7[_0x08d4('0x1f')]=_0x226a5d;if(_0x24e256[_0x08d4('0x2f')][_0x08d4('0x3e')]){_0x651479[_0x08d4('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x08d4('0x40')](_0x651479);})['then'](function(_0x1ecc53){_0x428cf7[_0x08d4('0x41')]=_0x1ecc53;return _0x428cf7;})['then'](respondWithFilteredResult(_0x46b348,_0x651479))[_0x08d4('0x42')](handleError(_0x46b348,null));};exports[_0x08d4('0x43')]=function(_0x107d07,_0x13a905){var _0x19e668={'raw':![],'where':{'id':_0x107d07[_0x08d4('0x44')]['id']}},_0x546fd5={};_0x546fd5[_0x08d4('0x2d')]=_[_0x08d4('0x45')](db[_0x08d4('0x2b')][_0x08d4('0x2c')]);_0x546fd5[_0x08d4('0x2f')]=_[_0x08d4('0x45')](_0x107d07['query']);_0x546fd5[_0x08d4('0x30')]=_['intersection'](_0x546fd5[_0x08d4('0x2d')],_0x546fd5[_0x08d4('0x2f')]);_0x19e668[_0x08d4('0x32')]=_[_0x08d4('0x31')](_0x546fd5['model'],qs[_0x08d4('0x33')](_0x107d07[_0x08d4('0x2f')]['fields']));_0x19e668['attributes']=_0x19e668[_0x08d4('0x32')][_0x08d4('0x46')]?_0x19e668[_0x08d4('0x32')]:_0x546fd5[_0x08d4('0x2d')];if(_0x107d07[_0x08d4('0x2f')][_0x08d4('0x3e')]){_0x19e668['include']=[{'all':!![]}];}_0x19e668=_[_0x08d4('0x3c')]({},_0x19e668,_0x107d07[_0x08d4('0x3d')]);return db[_0x08d4('0x2b')]['find'](_0x19e668)['then'](handleEntityNotFound(_0x13a905,null))[_0x08d4('0x27')](respondWithResult(_0x13a905,null))['catch'](handleError(_0x13a905,null));};exports[_0x08d4('0x47')]=function(_0x1c9719,_0x23e90e){return db[_0x08d4('0x2b')][_0x08d4('0x47')](_0x1c9719[_0x08d4('0x48')],{})[_0x08d4('0x27')](respondWithResult(_0x23e90e,0xc9))[_0x08d4('0x42')](handleError(_0x23e90e,null));};exports[_0x08d4('0x49')]=function(_0x191db9,_0x1e48d8){return db[_0x08d4('0x2b')]['bulkCreate'](_0x191db9['body'],{'raw':![],'individualHooks':!![]})[_0x08d4('0x27')](respondWithResult(_0x1e48d8,0xc9))[_0x08d4('0x42')](handleError(_0x1e48d8,null));};exports[_0x08d4('0x25')]=function(_0x726d60,_0x43de72){if(_0x726d60[_0x08d4('0x48')]['id']){delete _0x726d60[_0x08d4('0x48')]['id'];}return db['AnalyticFieldReport'][_0x08d4('0x4a')]({'where':{'id':_0x726d60['params']['id']}})[_0x08d4('0x27')](handleEntityNotFound(_0x43de72,null))['then'](saveUpdates(_0x726d60[_0x08d4('0x48')],null))[_0x08d4('0x27')](respondWithResult(_0x43de72,null))[_0x08d4('0x42')](handleError(_0x43de72,null));};exports[_0x08d4('0x26')]=function(_0x577d06,_0x5e2084){return db[_0x08d4('0x2b')][_0x08d4('0x4a')]({'where':{'id':_0x577d06[_0x08d4('0x44')]['id']}})[_0x08d4('0x27')](handleEntityNotFound(_0x5e2084,null))[_0x08d4('0x27')](removeEntity(_0x5e2084,null))[_0x08d4('0x42')](handleError(_0x5e2084,null));};exports[_0x08d4('0x4b')]=function(_0x588e67,_0x2826d5){return db['AnalyticFieldReport'][_0x08d4('0x26')]({'where':{'id':_0x588e67[_0x08d4('0x2f')][_0x08d4('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x08d4('0x27')](respondWithResult(_0x2826d5,0xcc))[_0x08d4('0x42')](handleError(_0x2826d5,null));};exports['addFields']=function(_0x86321e,_0x455c43,_0xae2747){return db[_0x08d4('0x4d')][_0x08d4('0x4e')]({'where':{'id':_0x86321e['params']['id']}})[_0x08d4('0x27')](handleEntityNotFound(_0x455c43,null))['then'](function(_0x206bba){if(_0x206bba){return db['sequelize'][_0x08d4('0x4f')](function(_0x235bfd){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x86321e[_0x08d4('0x44')]['id']},'transaction':_0x235bfd})['then'](function(_0x345f5b){var _0x14c4e0=_['map'](_0x86321e[_0x08d4('0x48')],function(_0x3dacab){delete _0x3dacab['id'];_0x3dacab[_0x08d4('0x50')]=_0x86321e['params']['id'];return _0x3dacab;});return db['AnalyticFieldReport']['bulkCreate'](_0x14c4e0,{'transaction':_0x235bfd});});})[_0x08d4('0x27')](function(){return db[_0x08d4('0x2b')][_0x08d4('0x40')]({'where':{'CustomReportId':_0x86321e[_0x08d4('0x44')]['id']}});});}})['then'](respondWithResult(_0x455c43,null))['catch'](handleError(_0x455c43,null));};
\ No newline at end of file
index 4796da4..e7e4057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf913=['exports','define','analytics_report_fields','lodash','util','api','moment','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x22d543,_0xdfa138){var _0x14fee8=function(_0x5cac0f){while(--_0x5cac0f){_0x22d543['push'](_0x22d543['shift']());}};_0x14fee8(++_0xdfa138);}(_0xf913,0x121));var _0x3f91=function(_0x25aa8f,_0x47ae2c){_0x25aa8f=_0x25aa8f-0x0;var _0x11a4ed=_0xf913[_0x25aa8f];return _0x11a4ed;};'use strict';var _=require(_0x3f91('0x0'));var util=require(_0x3f91('0x1'));var logger=require('../../config/logger')(_0x3f91('0x2'));var moment=require(_0x3f91('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f91('0x4'));var rimraf=require(_0x3f91('0x5'));var config=require(_0x3f91('0x6'));var attributes=require(_0x3f91('0x7'));module[_0x3f91('0x8')]=function(_0x4eb80d,_0x3d59c6){return _0x4eb80d[_0x3f91('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x3f91('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d4f=['moment','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','util','../../config/logger','api'];(function(_0x1fc9e8,_0x382720){var _0x55b160=function(_0x4e1db6){while(--_0x4e1db6){_0x1fc9e8['push'](_0x1fc9e8['shift']());}};_0x55b160(++_0x382720);}(_0x9d4f,0xce));var _0xf9d4=function(_0x1b2d5c,_0x29820d){_0x1b2d5c=_0x1b2d5c-0x0;var _0x152fa8=_0x9d4f[_0x1b2d5c];return _0x152fa8;};'use strict';var _=require('lodash');var util=require(_0xf9d4('0x0'));var logger=require(_0xf9d4('0x1'))(_0xf9d4('0x2'));var moment=require(_0xf9d4('0x3'));var BPromise=require(_0xf9d4('0x4'));var rp=require(_0xf9d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9d4('0x6'));var config=require('../../config/environment');var attributes=require(_0xf9d4('0x7'));module[_0xf9d4('0x8')]=function(_0x102dc6,_0x4b5c81){return _0x102dc6[_0xf9d4('0x9')](_0xf9d4('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac82c31..c5bae50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x436c=['ioredis','../../mysqldb','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','randomstring'];(function(_0x1b44e2,_0x32103e){var _0x428122=function(_0x3985d0){while(--_0x3985d0){_0x1b44e2['push'](_0x1b44e2['shift']());}};_0x428122(++_0x32103e);}(_0x436c,0xd9));var _0xc436=function(_0x772992,_0x5fce1e){_0x772992=_0x772992-0x0;var _0x37a9ea=_0x436c[_0x772992];return _0x37a9ea;};'use strict';var _=require('lodash');var util=require(_0xc436('0x0'));var moment=require(_0xc436('0x1'));var BPromise=require('bluebird');var rs=require(_0xc436('0x2'));var fs=require('fs');var Redis=require(_0xc436('0x3'));var db=require(_0xc436('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc436('0x5'));var client=jayson[_0xc436('0x6')][_0xc436('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b39bd,_0x1490bd,_0x23c66c){return new BPromise(function(_0x55aeea,_0x1e6aed){return client[_0xc436('0x8')](_0x1b39bd,_0x23c66c)[_0xc436('0x9')](function(_0x10002f){logger[_0xc436('0xa')](_0xc436('0xb'),_0x1490bd,_0xc436('0xc'));logger[_0xc436('0xd')](_0xc436('0xe'),_0x1490bd,_0xc436('0xc'),JSON[_0xc436('0xf')](_0x10002f));if(_0x10002f['error']){if(_0x10002f['error'][_0xc436('0x10')]===0x1f4){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x1e6aed(_0x10002f[_0xc436('0x11')]['message']);}logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);return _0x55aeea(_0x10002f[_0xc436('0x11')][_0xc436('0x12')]);}else{logger[_0xc436('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1490bd,_0xc436('0xc'));_0x55aeea(_0x10002f[_0xc436('0x13')][_0xc436('0x12')]);}})['catch'](function(_0x1c6815){logger[_0xc436('0x11')](_0xc436('0xb'),_0x1490bd,_0x1c6815);_0x1e6aed(_0x1c6815);});});}
\ No newline at end of file
+var _0x4a07=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x442e2d,_0x4d84c3){var _0x157780=function(_0x2abe96){while(--_0x2abe96){_0x442e2d['push'](_0x442e2d['shift']());}};_0x157780(++_0x4d84c3);}(_0x4a07,0x11f));var _0x74a0=function(_0x9967b4,_0x287500){_0x9967b4=_0x9967b4-0x0;var _0x537c2a=_0x4a07[_0x9967b4];return _0x537c2a;};'use strict';var _=require(_0x74a0('0x0'));var util=require(_0x74a0('0x1'));var moment=require(_0x74a0('0x2'));var BPromise=require(_0x74a0('0x3'));var rs=require(_0x74a0('0x4'));var fs=require('fs');var Redis=require(_0x74a0('0x5'));var db=require(_0x74a0('0x6'))['db'];var utils=require(_0x74a0('0x7'));var logger=require(_0x74a0('0x8'))(_0x74a0('0x9'));var config=require('../../config/environment');var jayson=require(_0x74a0('0xa'));var client=jayson['client'][_0x74a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12a8bd,_0x219274,_0x2d1935){return new BPromise(function(_0x408676,_0x3dcdb){return client[_0x74a0('0xc')](_0x12a8bd,_0x2d1935)[_0x74a0('0xd')](function(_0x55b9b5){logger[_0x74a0('0xe')](_0x74a0('0xf'),_0x219274,_0x74a0('0x10'));logger['debug'](_0x74a0('0x11'),_0x219274,_0x74a0('0x10'),JSON['stringify'](_0x55b9b5));if(_0x55b9b5[_0x74a0('0x12')]){if(_0x55b9b5[_0x74a0('0x12')]['code']===0x1f4){logger[_0x74a0('0x12')](_0x74a0('0xf'),_0x219274,_0x55b9b5[_0x74a0('0x12')][_0x74a0('0x13')]);return _0x3dcdb(_0x55b9b5[_0x74a0('0x12')][_0x74a0('0x13')]);}logger[_0x74a0('0x12')](_0x74a0('0xf'),_0x219274,_0x55b9b5[_0x74a0('0x12')][_0x74a0('0x13')]);return _0x408676(_0x55b9b5[_0x74a0('0x12')][_0x74a0('0x13')]);}else{logger['info'](_0x74a0('0xf'),_0x219274,_0x74a0('0x10'));_0x408676(_0x55b9b5['result'][_0x74a0('0x13')]);}})['catch'](function(_0x301e95){logger[_0x74a0('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x219274,_0x301e95);_0x3dcdb(_0x301e95);});});}
\ No newline at end of file
index 4459f5e..db9b4f9 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(_0x5fa0bf,_0x38661b){var _0x636f63=function(_0x2986dc){while(--_0x2986dc){_0x5fa0bf['push'](_0x5fa0bf['shift']());}};_0x636f63(++_0x38661b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x54798d,_0x5b3266){var _0x4bed2d=function(_0x49e0d9){while(--_0x49e0d9){_0x54798d['push'](_0x54798d['shift']());}};_0x4bed2d(++_0x5b3266);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 b355593..bb026fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9703=['name','STRING'];(function(_0x452109,_0x4b63c1){var _0x3c2ffd=function(_0x57b320){while(--_0x57b320){_0x452109['push'](_0x452109['shift']());}};_0x3c2ffd(++_0x4b63c1);}(_0x9703,0xdb));var _0x3970=function(_0xaee241,_0x26d77f){_0xaee241=_0xaee241-0x0;var _0x42384c=_0x9703[_0xaee241];return _0x42384c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3970('0x0')],'allowNull':![],'unique':_0x3970('0x1')},'table':{'type':Sequelize[_0x3970('0x0')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x3970('0x0')]}};
\ No newline at end of file
+var _0xb676=['sequelize','STRING','name','TEXT'];(function(_0x3f826f,_0x36c7d6){var _0x1e349d=function(_0x49634b){while(--_0x49634b){_0x3f826f['push'](_0x3f826f['shift']());}};_0x1e349d(++_0x36c7d6);}(_0xb676,0xbc));var _0x6b67=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xb676[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x6b67('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b67('0x1')],'allowNull':![],'unique':_0x6b67('0x2')},'table':{'type':Sequelize[_0x6b67('0x1')]},'metric':{'type':Sequelize[_0x6b67('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index cffa330..a1f3ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','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','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0x008c,0x188));var _0xc008=function(_0x3df3c6,_0x496e1a){_0x3df3c6=_0x3df3c6-0x0;var _0x254c43=_0x008c[_0x3df3c6];return _0x254c43;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x5c99fa,_0x23259e){var _0x3e45c5=function(_0x971934){while(--_0x971934){_0x5c99fa['push'](_0x5c99fa['shift']());}};_0x3e45c5(++_0x23259e);}(_0xe14b,0x93));var _0xbe14=function(_0x1e5b87,_0x742a1f){_0x1e5b87=_0x1e5b87-0x0;var _0x4e198d=_0xe14b[_0x1e5b87];return _0x4e198d;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
index dcfaecc..1e433e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde81=['analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x389c94,_0x2a93d9){var _0x1455cb=function(_0x5903d6){while(--_0x5903d6){_0x389c94['push'](_0x389c94['shift']());}};_0x1455cb(++_0x2a93d9);}(_0xde81,0x109));var _0x1de8=function(_0x1bc13c,_0x4483a0){_0x1bc13c=_0x1bc13c-0x0;var _0x4a7ceb=_0xde81[_0x1bc13c];return _0x4a7ceb;};'use strict';var _=require(_0x1de8('0x0'));var util=require(_0x1de8('0x1'));var logger=require(_0x1de8('0x2'))(_0x1de8('0x3'));var moment=require(_0x1de8('0x4'));var BPromise=require(_0x1de8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x1de8('0x7'));module[_0x1de8('0x8')]=function(_0x42801a,_0x3ae723){return _0x42801a[_0x1de8('0x9')](_0x1de8('0xa'),attributes,{'tableName':_0x1de8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a2a=['analytics_metrics','lodash','util','../../config/logger','api','path','rimraf','./analyticMetric.attributes','exports','define'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x49c5ab,_0x12a53d){_0x49c5ab=_0x49c5ab-0x0;var _0x39a7f7=_0x5a2a[_0x49c5ab];return _0x39a7f7;};'use strict';var _=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var logger=require(_0xa5a2('0x2'))(_0xa5a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa5a2('0x4'));var rimraf=require(_0xa5a2('0x5'));var config=require('../../config/environment');var attributes=require(_0xa5a2('0x6'));module[_0xa5a2('0x7')]=function(_0x2e97d3,_0x55728b){return _0x2e97d3[_0xa5a2('0x8')]('AnalyticMetric',attributes,{'tableName':_0xa5a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 859d541..a0d2268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dcb=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util'];(function(_0xf0d2ff,_0x3b2df0){var _0x3b06db=function(_0x41d314){while(--_0x41d314){_0xf0d2ff['push'](_0xf0d2ff['shift']());}};_0x3b06db(++_0x3b2df0);}(_0x8dcb,0x6b));var _0xb8dc=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x8dcb[_0x3a73bc];return _0x32891b;};'use strict';var _=require('lodash');var util=require(_0xb8dc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8dc('0x1'));var fs=require('fs');var Redis=require(_0xb8dc('0x2'));var db=require(_0xb8dc('0x3'))['db'];var utils=require(_0xb8dc('0x4'));var logger=require(_0xb8dc('0x5'))(_0xb8dc('0x6'));var config=require(_0xb8dc('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x949d20,_0x588f94,_0x3d793f){return new BPromise(function(_0x2774af,_0x2996b7){return client[_0xb8dc('0x8')](_0x949d20,_0x3d793f)['then'](function(_0x54542e){logger[_0xb8dc('0x9')](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));logger['debug'](_0xb8dc('0xc'),_0x588f94,_0xb8dc('0xb'),JSON[_0xb8dc('0xd')](_0x54542e));if(_0x54542e[_0xb8dc('0xe')]){if(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0xf')]===0x1f4){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x54542e['error']['message']);return _0x2996b7(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}logger['error'](_0xb8dc('0xa'),_0x588f94,_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);return _0x2774af(_0x54542e[_0xb8dc('0xe')][_0xb8dc('0x10')]);}else{logger['info'](_0xb8dc('0xa'),_0x588f94,_0xb8dc('0xb'));_0x2774af(_0x54542e[_0xb8dc('0x11')][_0xb8dc('0x10')]);}})['catch'](function(_0x3933fd){logger[_0xb8dc('0xe')](_0xb8dc('0xa'),_0x588f94,_0x3933fd);_0x2996b7(_0x3933fd);});});}
\ No newline at end of file
+var _0x0786=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0786,0xb7));var _0x6078=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x0786[_0x46c9cc];return _0x21b46e;};'use strict';var _=require(_0x6078('0x0'));var util=require('util');var moment=require(_0x6078('0x1'));var BPromise=require(_0x6078('0x2'));var rs=require(_0x6078('0x3'));var fs=require('fs');var Redis=require(_0x6078('0x4'));var db=require(_0x6078('0x5'))['db'];var utils=require(_0x6078('0x6'));var logger=require(_0x6078('0x7'))(_0x6078('0x8'));var config=require('../../config/environment');var jayson=require(_0x6078('0x9'));var client=jayson[_0x6078('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x371ae0,_0x452cb2,_0x550364){return new BPromise(function(_0x16e9b9,_0x221a2e){return client['request'](_0x371ae0,_0x550364)[_0x6078('0xb')](function(_0x461d85){logger[_0x6078('0xc')](_0x6078('0xd'),_0x452cb2,_0x6078('0xe'));logger[_0x6078('0xf')](_0x6078('0x10'),_0x452cb2,_0x6078('0xe'),JSON['stringify'](_0x461d85));if(_0x461d85[_0x6078('0x11')]){if(_0x461d85[_0x6078('0x11')][_0x6078('0x12')]===0x1f4){logger['error'](_0x6078('0xd'),_0x452cb2,_0x461d85[_0x6078('0x11')][_0x6078('0x13')]);return _0x221a2e(_0x461d85[_0x6078('0x11')][_0x6078('0x13')]);}logger[_0x6078('0x11')](_0x6078('0xd'),_0x452cb2,_0x461d85[_0x6078('0x11')][_0x6078('0x13')]);return _0x16e9b9(_0x461d85[_0x6078('0x11')][_0x6078('0x13')]);}else{logger['info'](_0x6078('0xd'),_0x452cb2,_0x6078('0xe'));_0x16e9b9(_0x461d85[_0x6078('0x14')]['message']);}})[_0x6078('0x15')](function(_0xe43167){logger[_0x6078('0x11')](_0x6078('0xd'),_0x452cb2,_0xe43167);_0x221a2e(_0xe43167);});});}
\ No newline at end of file
index 4bfd87f..bd9b7d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448a=['path','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','util'];(function(_0x4bf89c,_0x1632bc){var _0x3bf7b6=function(_0x5b021f){while(--_0x5b021f){_0x4bf89c['push'](_0x4bf89c['shift']());}};_0x3bf7b6(++_0x1632bc);}(_0x448a,0x1ef));var _0xa448=function(_0x4a3f30,_0x44ad1c){_0x4a3f30=_0x4a3f30-0x0;var _0x1b03eb=_0x448a[_0x4a3f30];return _0x1b03eb;};'use strict';var multer=require('multer');var util=require(_0xa448('0x0'));var path=require(_0xa448('0x1'));var timeout=require('connect-timeout');var express=require(_0xa448('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa448('0x3'));var interaction=require(_0xa448('0x4'));var config=require('../../config/environment');var controller=require(_0xa448('0x5'));router[_0xa448('0x6')]('/',auth[_0xa448('0x7')](),controller[_0xa448('0x8')]);router[_0xa448('0x6')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller['show']);router['post']('/',auth[_0xa448('0x7')](),controller[_0xa448('0xa')]);router[_0xa448('0xb')](_0xa448('0x9'),auth[_0xa448('0x7')](),controller[_0xa448('0xc')]);router[_0xa448('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xa448('0xe')]);module[_0xa448('0xf')]=router;
\ No newline at end of file
+var _0x8d0a=['../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x542911,_0x4356d1){var _0x273b7f=function(_0x4e35a9){while(--_0x4e35a9){_0x542911['push'](_0x542911['shift']());}};_0x273b7f(++_0x4356d1);}(_0x8d0a,0x65));var _0xa8d0=function(_0x2a5c79,_0x32ac4c){_0x2a5c79=_0x2a5c79-0x0;var _0x4c935a=_0x8d0a[_0x2a5c79];return _0x4c935a;};'use strict';var multer=require(_0xa8d0('0x0'));var util=require('util');var path=require(_0xa8d0('0x1'));var timeout=require(_0xa8d0('0x2'));var express=require(_0xa8d0('0x3'));var router=express[_0xa8d0('0x4')]();var fs_extra=require(_0xa8d0('0x5'));var auth=require(_0xa8d0('0x6'));var interaction=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var controller=require(_0xa8d0('0x9'));router['get']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xb')]);router[_0xa8d0('0xc')](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller['show']);router['post']('/',auth[_0xa8d0('0xa')](),controller[_0xa8d0('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa8d0('0xf')]);router['delete'](_0xa8d0('0xd'),auth[_0xa8d0('0xa')](),controller[_0xa8d0('0x10')]);module[_0xa8d0('0x11')]=router;
\ No newline at end of file
index 90a7d9e..beb7a30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d06=['TEXT','sequelize','exports'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x0d06,0x94));var _0x60d0=function(_0x460264,_0x51ddff){_0x460264=_0x460264-0x0;var _0x2d75a1=_0x0d06[_0x460264];return _0x2d75a1;};'use strict';var Sequelize=require(_0x60d0('0x0'));module[_0x60d0('0x1')]={'tree':{'type':Sequelize[_0x60d0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xf616=['sequelize','exports','TEXT'];(function(_0x10973c,_0x5a0c6b){var _0x54bbf4=function(_0x2f20a9){while(--_0x2f20a9){_0x10973c['push'](_0x10973c['shift']());}};_0x54bbf4(++_0x5a0c6b);}(_0xf616,0xf0));var _0x6f61=function(_0x2dd599,_0x8a1aba){_0x2dd599=_0x2dd599-0x0;var _0x3bd9b3=_0xf616[_0x2dd599];return _0x3bd9b3;};'use strict';var Sequelize=require(_0x6f61('0x0'));module[_0x6f61('0x1')]={'tree':{'type':Sequelize[_0x6f61('0x2')],'allowNull':![]}};
\ No newline at end of file
index 93fec37..124a9db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3417=['rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','AnalyticTreeReport'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3417,0x6a));var _0x7341=function(_0x3c51b1,_0x1fdd45){_0x3c51b1=_0x3c51b1-0x0;var _0x1b2bc2=_0x3417[_0x3c51b1];return _0x1b2bc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7341('0x0'));var zipdir=require(_0x7341('0x1'));var jsonpatch=require(_0x7341('0x2'));var rp=require(_0x7341('0x3'));var moment=require(_0x7341('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7341('0x5'));var path=require(_0x7341('0x6'));var sox=require(_0x7341('0x7'));var csv=require('to-csv');var ejs=require(_0x7341('0x8'));var fs=require('fs');var fs_extra=require(_0x7341('0x9'));var _=require('lodash');var squel=require(_0x7341('0xa'));var crypto=require(_0x7341('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7341('0xc'));var toCsv=require(_0x7341('0xd'));var querystring=require(_0x7341('0xe'));var Papa=require('papaparse');var Redis=require(_0x7341('0xf'));var authService=require(_0x7341('0x10'));var qs=require(_0x7341('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7341('0x12'));var logger=require(_0x7341('0x13'))(_0x7341('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7341('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c7c8a,_0x30e0a2){_0x30e0a2=_0x30e0a2||0xcc;return function(_0xfcf74d){if(_0xfcf74d){return _0x3c7c8a['sendStatus'](_0x30e0a2);}return _0x3c7c8a[_0x7341('0x16')](_0x30e0a2)[_0x7341('0x17')]();};}function respondWithResult(_0x3b8842,_0x2dc22e){_0x2dc22e=_0x2dc22e||0xc8;return function(_0x460afe){if(_0x460afe){return _0x3b8842[_0x7341('0x16')](_0x2dc22e)[_0x7341('0x18')](_0x460afe);}};}function respondWithFilteredResult(_0x1d6d1d,_0x4cbcb5){return function(_0x104b8d){if(_0x104b8d){var _0x3f74d2=typeof _0x4cbcb5[_0x7341('0x19')]===_0x7341('0x1a')&&typeof _0x4cbcb5['limit']===_0x7341('0x1a');var _0x7ae82b=_0x104b8d[_0x7341('0x1b')];var _0xc204f5=_0x3f74d2?0x0:_0x4cbcb5[_0x7341('0x19')];var _0x305657=_0x3f74d2?_0x104b8d[_0x7341('0x1b')]:_0x4cbcb5[_0x7341('0x19')]+_0x4cbcb5['limit'];var _0x4214f3;if(_0x305657>=_0x7ae82b){_0x305657=_0x7ae82b;_0x4214f3=0xc8;}else{_0x4214f3=0xce;}_0x1d6d1d[_0x7341('0x16')](_0x4214f3);return _0x1d6d1d[_0x7341('0x1c')](_0x7341('0x1d'),_0xc204f5+'-'+_0x305657+'/'+_0x7ae82b)[_0x7341('0x18')](_0x104b8d);}return null;};}function patchUpdates(_0x405d47){return function(_0x1b83b7){try{jsonpatch[_0x7341('0x1e')](_0x1b83b7,_0x405d47,!![]);}catch(_0x167847){return BPromise['reject'](_0x167847);}return _0x1b83b7[_0x7341('0x1f')]();};}function saveUpdates(_0x214f59,_0x46d4bd){return function(_0xedb8f6){if(_0xedb8f6){return _0xedb8f6[_0x7341('0x20')](_0x214f59)[_0x7341('0x21')](function(_0x1be382){return _0x1be382;});}return null;};}function removeEntity(_0x52f9d4,_0x2a78d7){return function(_0x242074){if(_0x242074){return _0x242074[_0x7341('0x22')]()[_0x7341('0x21')](function(){_0x52f9d4[_0x7341('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50b152,_0x17b3e4){return function(_0x12a06e){if(!_0x12a06e){_0x50b152[_0x7341('0x23')](0x194);}return _0x12a06e;};}function handleError(_0xcd88bd,_0x40916b){_0x40916b=_0x40916b||0x1f4;return function(_0xb8829e){logger[_0x7341('0x24')](_0xb8829e['stack']);if(_0xb8829e[_0x7341('0x25')]){delete _0xb8829e[_0x7341('0x25')];}_0xcd88bd[_0x7341('0x16')](_0x40916b)['send'](_0xb8829e);};}exports[_0x7341('0x26')]=function(_0x5f5da0,_0xf96ac4){var _0x5b5b0d={},_0x209733={},_0x5c129c={'count':0x0,'rows':[]};var _0x3e1873=_['map'](db[_0x7341('0x27')][_0x7341('0x28')],function(_0x27ff50){return{'name':_0x27ff50[_0x7341('0x29')],'type':_0x27ff50[_0x7341('0x2a')][_0x7341('0x2b')]};});_0x209733['model']=_[_0x7341('0x2c')](_0x3e1873,_0x7341('0x25'));_0x209733[_0x7341('0x2d')]=_[_0x7341('0x2e')](_0x5f5da0[_0x7341('0x2d')]);_0x209733[_0x7341('0x2f')]=_['intersection'](_0x209733[_0x7341('0x30')],_0x209733['query']);_0x5b5b0d[_0x7341('0x31')]=_[_0x7341('0x32')](_0x209733['model'],qs['fields'](_0x5f5da0['query'][_0x7341('0x33')]));_0x5b5b0d['attributes']=_0x5b5b0d[_0x7341('0x31')]['length']?_0x5b5b0d[_0x7341('0x31')]:_0x209733[_0x7341('0x30')];if(!_0x5f5da0[_0x7341('0x2d')][_0x7341('0x34')](_0x7341('0x35'))){_0x5b5b0d[_0x7341('0x36')]=qs[_0x7341('0x36')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x36')]);_0x5b5b0d[_0x7341('0x19')]=qs['offset'](_0x5f5da0['query']['offset']);}_0x5b5b0d[_0x7341('0x37')]=qs[_0x7341('0x38')](_0x5f5da0[_0x7341('0x2d')][_0x7341('0x38')]);_0x5b5b0d[_0x7341('0x39')]=qs[_0x7341('0x2f')](_[_0x7341('0x3a')](_0x5f5da0[_0x7341('0x2d')],_0x209733['filters']),_0x3e1873);if(_0x5f5da0['query'][_0x7341('0x3b')]){_0x5b5b0d['where']=_[_0x7341('0x3c')](_0x5b5b0d[_0x7341('0x39')],{'$or':_[_0x7341('0x2c')](_0x3e1873,function(_0x815383){if(_0x815383['type']!==_0x7341('0x3d')){var _0x9dd907={};_0x9dd907[_0x815383[_0x7341('0x25')]]={'$like':'%'+_0x5f5da0['query'][_0x7341('0x3b')]+'%'};return _0x9dd907;}})});}_0x5b5b0d=_[_0x7341('0x3c')]({},_0x5b5b0d,_0x5f5da0[_0x7341('0x3e')]);var _0x28d076={'where':_0x5b5b0d[_0x7341('0x39')]};return db[_0x7341('0x27')][_0x7341('0x1b')](_0x28d076)[_0x7341('0x21')](function(_0x3e5ffb){_0x5c129c[_0x7341('0x1b')]=_0x3e5ffb;if(_0x5f5da0[_0x7341('0x2d')][_0x7341('0x3f')]){_0x5b5b0d[_0x7341('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x7341('0x41')](_0x5b5b0d);})['then'](function(_0x3e2a18){_0x5c129c[_0x7341('0x42')]=_0x3e2a18;return _0x5c129c;})[_0x7341('0x21')](respondWithFilteredResult(_0xf96ac4,_0x5b5b0d))['catch'](handleError(_0xf96ac4,null));};exports[_0x7341('0x43')]=function(_0xf62635,_0xd34c72){var _0x3588ff={'raw':!![],'where':{'id':_0xf62635[_0x7341('0x44')]['id']}},_0x519f12={};_0x519f12[_0x7341('0x30')]=_[_0x7341('0x2e')](db[_0x7341('0x27')][_0x7341('0x28')]);_0x519f12[_0x7341('0x2d')]=_['keys'](_0xf62635['query']);_0x519f12[_0x7341('0x2f')]=_['intersection'](_0x519f12[_0x7341('0x30')],_0x519f12[_0x7341('0x2d')]);_0x3588ff[_0x7341('0x31')]=_[_0x7341('0x32')](_0x519f12[_0x7341('0x30')],qs[_0x7341('0x33')](_0xf62635['query'][_0x7341('0x33')]));_0x3588ff[_0x7341('0x31')]=_0x3588ff[_0x7341('0x31')]['length']?_0x3588ff[_0x7341('0x31')]:_0x519f12[_0x7341('0x30')];if(_0xf62635[_0x7341('0x2d')][_0x7341('0x3f')]){_0x3588ff[_0x7341('0x40')]=[{'all':!![]}];}_0x3588ff=_['merge']({},_0x3588ff,_0xf62635[_0x7341('0x3e')]);return db['AnalyticTreeReport']['find'](_0x3588ff)[_0x7341('0x21')](handleEntityNotFound(_0xd34c72,null))[_0x7341('0x21')](respondWithResult(_0xd34c72,null))[_0x7341('0x45')](handleError(_0xd34c72,null));};exports[_0x7341('0x46')]=function(_0x1a2290,_0x430c00){return db[_0x7341('0x27')][_0x7341('0x46')](_0x1a2290[_0x7341('0x47')],{})[_0x7341('0x21')](respondWithResult(_0x430c00,0xc9))[_0x7341('0x45')](handleError(_0x430c00,null));};exports[_0x7341('0x20')]=function(_0x44605f,_0x3c8927){if(_0x44605f[_0x7341('0x47')]['id']){delete _0x44605f[_0x7341('0x47')]['id'];}return db[_0x7341('0x27')][_0x7341('0x48')]({'where':{'id':_0x44605f['params']['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x3c8927,null))['then'](saveUpdates(_0x44605f[_0x7341('0x47')],null))['then'](respondWithResult(_0x3c8927,null))[_0x7341('0x45')](handleError(_0x3c8927,null));};exports['destroy']=function(_0x4b198b,_0x4dedd6){return db[_0x7341('0x27')]['find']({'where':{'id':_0x4b198b[_0x7341('0x44')]['id']}})[_0x7341('0x21')](handleEntityNotFound(_0x4dedd6,null))[_0x7341('0x21')](removeEntity(_0x4dedd6,null))[_0x7341('0x45')](handleError(_0x4dedd6,null));};
\ No newline at end of file
+var _0x49c6=['index','AnalyticTreeReport','rawAttributes','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send'];(function(_0x4ea823,_0x1ff88e){var _0x263d02=function(_0x2b74e5){while(--_0x2b74e5){_0x4ea823['push'](_0x4ea823['shift']());}};_0x263d02(++_0x1ff88e);}(_0x49c6,0x193));var _0x649c=function(_0xdfdeb7,_0x29649c){_0xdfdeb7=_0xdfdeb7-0x0;var _0x1db931=_0x49c6[_0xdfdeb7];return _0x1db931;};'use strict';var emlformat=require(_0x649c('0x0'));var rimraf=require(_0x649c('0x1'));var zipdir=require(_0x649c('0x2'));var jsonpatch=require(_0x649c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x649c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x649c('0x5'));var sox=require(_0x649c('0x6'));var csv=require(_0x649c('0x7'));var ejs=require(_0x649c('0x8'));var fs=require('fs');var fs_extra=require(_0x649c('0x9'));var _=require(_0x649c('0xa'));var squel=require(_0x649c('0xb'));var crypto=require(_0x649c('0xc'));var jsforce=require(_0x649c('0xd'));var deskjs=require(_0x649c('0xe'));var toCsv=require(_0x649c('0x7'));var querystring=require(_0x649c('0xf'));var Papa=require(_0x649c('0x10'));var Redis=require(_0x649c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x649c('0x12'));var as=require(_0x649c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x649c('0x14'));var utils=require('../../config/utils');var config=require(_0x649c('0x15'));var licenseUtil=require(_0x649c('0x16'));var db=require(_0x649c('0x17'))['db'];function respondWithStatusCode(_0x5f20cc,_0x426ab0){_0x426ab0=_0x426ab0||0xcc;return function(_0x344bf9){if(_0x344bf9){return _0x5f20cc['sendStatus'](_0x426ab0);}return _0x5f20cc[_0x649c('0x18')](_0x426ab0)[_0x649c('0x19')]();};}function respondWithResult(_0x2543c2,_0x1a1577){_0x1a1577=_0x1a1577||0xc8;return function(_0x5676a3){if(_0x5676a3){return _0x2543c2[_0x649c('0x18')](_0x1a1577)['json'](_0x5676a3);}};}function respondWithFilteredResult(_0x11f483,_0x32a7e9){return function(_0x19461a){if(_0x19461a){var _0xf97c57=typeof _0x32a7e9[_0x649c('0x1a')]===_0x649c('0x1b')&&typeof _0x32a7e9[_0x649c('0x1c')]==='undefined';var _0x2103ca=_0x19461a[_0x649c('0x1d')];var _0x1ea325=_0xf97c57?0x0:_0x32a7e9[_0x649c('0x1a')];var _0x239aae=_0xf97c57?_0x19461a[_0x649c('0x1d')]:_0x32a7e9['offset']+_0x32a7e9[_0x649c('0x1c')];var _0x2937b7;if(_0x239aae>=_0x2103ca){_0x239aae=_0x2103ca;_0x2937b7=0xc8;}else{_0x2937b7=0xce;}_0x11f483[_0x649c('0x18')](_0x2937b7);return _0x11f483[_0x649c('0x1e')](_0x649c('0x1f'),_0x1ea325+'-'+_0x239aae+'/'+_0x2103ca)[_0x649c('0x20')](_0x19461a);}return null;};}function patchUpdates(_0x42974b){return function(_0x2ef30f){try{jsonpatch[_0x649c('0x21')](_0x2ef30f,_0x42974b,!![]);}catch(_0x17e5aa){return BPromise[_0x649c('0x22')](_0x17e5aa);}return _0x2ef30f[_0x649c('0x23')]();};}function saveUpdates(_0x38f6b8,_0x483ac4){return function(_0x3fce9c){if(_0x3fce9c){return _0x3fce9c['update'](_0x38f6b8)[_0x649c('0x24')](function(_0x44b06c){return _0x44b06c;});}return null;};}function removeEntity(_0x435c7b,_0x67183){return function(_0x36eccc){if(_0x36eccc){return _0x36eccc['destroy']()[_0x649c('0x24')](function(){_0x435c7b[_0x649c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f3ad,_0x5223b7){return function(_0x48a79a){if(!_0x48a79a){_0x16f3ad[_0x649c('0x25')](0x194);}return _0x48a79a;};}function handleError(_0x46aadf,_0x52d584){_0x52d584=_0x52d584||0x1f4;return function(_0x60addc){logger['error'](_0x60addc[_0x649c('0x26')]);if(_0x60addc[_0x649c('0x27')]){delete _0x60addc[_0x649c('0x27')];}_0x46aadf[_0x649c('0x18')](_0x52d584)[_0x649c('0x28')](_0x60addc);};}exports[_0x649c('0x29')]=function(_0x5e3532,_0x28618c){var _0xac64ac={},_0x1a684d={},_0x1c7414={'count':0x0,'rows':[]};var _0x29e605=_['map'](db[_0x649c('0x2a')][_0x649c('0x2b')],function(_0x1a485b){return{'name':_0x1a485b['fieldName'],'type':_0x1a485b['type'][_0x649c('0x2c')]};});_0x1a684d[_0x649c('0x2d')]=_[_0x649c('0x2e')](_0x29e605,'name');_0x1a684d[_0x649c('0x2f')]=_[_0x649c('0x30')](_0x5e3532[_0x649c('0x2f')]);_0x1a684d[_0x649c('0x31')]=_['intersection'](_0x1a684d[_0x649c('0x2d')],_0x1a684d[_0x649c('0x2f')]);_0xac64ac[_0x649c('0x32')]=_[_0x649c('0x33')](_0x1a684d[_0x649c('0x2d')],qs[_0x649c('0x34')](_0x5e3532['query'][_0x649c('0x34')]));_0xac64ac[_0x649c('0x32')]=_0xac64ac[_0x649c('0x32')][_0x649c('0x35')]?_0xac64ac[_0x649c('0x32')]:_0x1a684d[_0x649c('0x2d')];if(!_0x5e3532[_0x649c('0x2f')][_0x649c('0x36')]('nolimit')){_0xac64ac[_0x649c('0x1c')]=qs[_0x649c('0x1c')](_0x5e3532[_0x649c('0x2f')][_0x649c('0x1c')]);_0xac64ac[_0x649c('0x1a')]=qs[_0x649c('0x1a')](_0x5e3532[_0x649c('0x2f')]['offset']);}_0xac64ac[_0x649c('0x37')]=qs[_0x649c('0x38')](_0x5e3532[_0x649c('0x2f')][_0x649c('0x38')]);_0xac64ac[_0x649c('0x39')]=qs['filters'](_[_0x649c('0x3a')](_0x5e3532['query'],_0x1a684d[_0x649c('0x31')]),_0x29e605);if(_0x5e3532[_0x649c('0x2f')][_0x649c('0x3b')]){_0xac64ac['where']=_[_0x649c('0x3c')](_0xac64ac[_0x649c('0x39')],{'$or':_['map'](_0x29e605,function(_0x1bd203){if(_0x1bd203[_0x649c('0x3d')]!==_0x649c('0x3e')){var _0x1a51e3={};_0x1a51e3[_0x1bd203['name']]={'$like':'%'+_0x5e3532[_0x649c('0x2f')][_0x649c('0x3b')]+'%'};return _0x1a51e3;}})});}_0xac64ac=_[_0x649c('0x3c')]({},_0xac64ac,_0x5e3532['options']);var _0x2c8bcc={'where':_0xac64ac[_0x649c('0x39')]};return db[_0x649c('0x2a')][_0x649c('0x1d')](_0x2c8bcc)['then'](function(_0x174e3c){_0x1c7414[_0x649c('0x1d')]=_0x174e3c;if(_0x5e3532[_0x649c('0x2f')][_0x649c('0x3f')]){_0xac64ac[_0x649c('0x40')]=[{'all':!![]}];}return db[_0x649c('0x2a')]['findAll'](_0xac64ac);})[_0x649c('0x24')](function(_0x48473a){_0x1c7414[_0x649c('0x41')]=_0x48473a;return _0x1c7414;})[_0x649c('0x24')](respondWithFilteredResult(_0x28618c,_0xac64ac))[_0x649c('0x42')](handleError(_0x28618c,null));};exports[_0x649c('0x43')]=function(_0x3a1508,_0x3753dd){var _0x3559fd={'raw':!![],'where':{'id':_0x3a1508[_0x649c('0x44')]['id']}},_0x5cfd98={};_0x5cfd98['model']=_[_0x649c('0x30')](db[_0x649c('0x2a')]['rawAttributes']);_0x5cfd98[_0x649c('0x2f')]=_[_0x649c('0x30')](_0x3a1508[_0x649c('0x2f')]);_0x5cfd98[_0x649c('0x31')]=_[_0x649c('0x33')](_0x5cfd98[_0x649c('0x2d')],_0x5cfd98[_0x649c('0x2f')]);_0x3559fd[_0x649c('0x32')]=_[_0x649c('0x33')](_0x5cfd98[_0x649c('0x2d')],qs[_0x649c('0x34')](_0x3a1508[_0x649c('0x2f')][_0x649c('0x34')]));_0x3559fd[_0x649c('0x32')]=_0x3559fd['attributes'][_0x649c('0x35')]?_0x3559fd['attributes']:_0x5cfd98[_0x649c('0x2d')];if(_0x3a1508[_0x649c('0x2f')][_0x649c('0x3f')]){_0x3559fd[_0x649c('0x40')]=[{'all':!![]}];}_0x3559fd=_[_0x649c('0x3c')]({},_0x3559fd,_0x3a1508[_0x649c('0x45')]);return db[_0x649c('0x2a')][_0x649c('0x46')](_0x3559fd)['then'](handleEntityNotFound(_0x3753dd,null))[_0x649c('0x24')](respondWithResult(_0x3753dd,null))[_0x649c('0x42')](handleError(_0x3753dd,null));};exports[_0x649c('0x47')]=function(_0x420731,_0x3312b5){return db[_0x649c('0x2a')]['create'](_0x420731[_0x649c('0x48')],{})[_0x649c('0x24')](respondWithResult(_0x3312b5,0xc9))[_0x649c('0x42')](handleError(_0x3312b5,null));};exports[_0x649c('0x49')]=function(_0x2e0605,_0x54da8b){if(_0x2e0605[_0x649c('0x48')]['id']){delete _0x2e0605['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x2e0605['params']['id']}})['then'](handleEntityNotFound(_0x54da8b,null))[_0x649c('0x24')](saveUpdates(_0x2e0605[_0x649c('0x48')],null))[_0x649c('0x24')](respondWithResult(_0x54da8b,null))[_0x649c('0x42')](handleError(_0x54da8b,null));};exports['destroy']=function(_0x10f7eb,_0x2193bf){return db[_0x649c('0x2a')][_0x649c('0x46')]({'where':{'id':_0x10f7eb[_0x649c('0x44')]['id']}})[_0x649c('0x24')](handleEntityNotFound(_0x2193bf,null))[_0x649c('0x24')](removeEntity(_0x2193bf,null))[_0x649c('0x42')](handleError(_0x2193bf,null));};
\ No newline at end of file
index 65ab224..a84bacc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabeb=['../../config/logger','api','bluebird','request-promise','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x2c2d11,_0x4308ac){var _0x255f24=function(_0x1aa524){while(--_0x1aa524){_0x2c2d11['push'](_0x2c2d11['shift']());}};_0x255f24(++_0x4308ac);}(_0xabeb,0x153));var _0xbabe=function(_0x5c6bc9,_0x4276f7){_0x5c6bc9=_0x5c6bc9-0x0;var _0x5b1fa5=_0xabeb[_0x5c6bc9];return _0x5b1fa5;};'use strict';var _=require('lodash');var util=require(_0xbabe('0x0'));var logger=require(_0xbabe('0x1'))(_0xbabe('0x2'));var moment=require('moment');var BPromise=require(_0xbabe('0x3'));var rp=require(_0xbabe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbabe('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xbabe('0x6')]=function(_0x13c5de,_0x2f9e91){return _0x13c5de[_0xbabe('0x7')](_0xbabe('0x8'),attributes,{'tableName':_0xbabe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22a2=['api','moment','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util','../../config/logger'];(function(_0x210d5f,_0x59122f){var _0xffc8a0=function(_0xc935b4){while(--_0xc935b4){_0x210d5f['push'](_0x210d5f['shift']());}};_0xffc8a0(++_0x59122f);}(_0x22a2,0x173));var _0x222a=function(_0x48d84b,_0x4c5ae0){_0x48d84b=_0x48d84b-0x0;var _0x236d30=_0x22a2[_0x48d84b];return _0x236d30;};'use strict';var _=require(_0x222a('0x0'));var util=require(_0x222a('0x1'));var logger=require(_0x222a('0x2'))(_0x222a('0x3'));var moment=require(_0x222a('0x4'));var BPromise=require(_0x222a('0x5'));var rp=require(_0x222a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x222a('0x7'));var attributes=require(_0x222a('0x8'));module[_0x222a('0x9')]=function(_0x431736,_0x5ae310){return _0x431736['define'](_0x222a('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b5ac47..536fd1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x59628a,_0x701f80){var _0x3899e4=function(_0xab737c){while(--_0xab737c){_0x59628a['push'](_0x59628a['shift']());}};_0x3899e4(++_0x701f80);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
+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(_0x59e174,_0x43a286){var _0x2d581f=function(_0xfdc0a9){while(--_0xfdc0a9){_0x59e174['push'](_0x59e174['shift']());}};_0x2d581f(++_0x43a286);}(_0xadb5,0xad));var _0x5adb=function(_0x22e7a7,_0x24bb54){_0x22e7a7=_0x22e7a7-0x0;var _0x11b353=_0xadb5[_0x22e7a7];return _0x11b353;};'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
index 18e7431..bdb6f67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','update','delete'];(function(_0x503c6a,_0x738a9d){var _0x5f591e=function(_0x5d080c){while(--_0x5d080c){_0x503c6a['push'](_0x503c6a['shift']());}};_0x5f591e(++_0x738a9d);}(_0xb58b,0x1e8));var _0xbb58=function(_0x4797f8,_0x2ebab8){_0x4797f8=_0x4797f8-0x0;var _0x4062be=_0xb58b[_0x4797f8];return _0x4062be;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require(_0xbb58('0x3'));var router=express['Router']();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require(_0xbb58('0x6'));var controller=require(_0xbb58('0x7'));router[_0xbb58('0x8')]('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x8')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xc')]);router['post']('/',auth[_0xbb58('0x9')](),controller[_0xbb58('0xd')]);router['put'](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xf')](_0xbb58('0xb'),auth[_0xbb58('0x9')](),controller[_0xbb58('0x10')]);module[_0xbb58('0x11')]=router;
\ No newline at end of file
+var _0x46dc=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46dc,0x72));var _0xc46d=function(_0x1f4e2e,_0x26a30d){_0x1f4e2e=_0x1f4e2e-0x0;var _0x36bedf=_0x46dc[_0x1f4e2e];return _0x36bedf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc46d('0x0'));var timeout=require(_0xc46d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc46d('0x2'));var auth=require(_0xc46d('0x3'));var interaction=require(_0xc46d('0x4'));var config=require(_0xc46d('0x5'));var controller=require('./analyticTreeReport.controller');router[_0xc46d('0x6')]('/',auth[_0xc46d('0x7')](),controller[_0xc46d('0x8')]);router[_0xc46d('0x6')](_0xc46d('0x9'),auth['isAuthenticated'](),controller[_0xc46d('0xa')]);router[_0xc46d('0xb')]('/',auth[_0xc46d('0x7')](),controller[_0xc46d('0xc')]);router[_0xc46d('0xd')]('/:id',auth[_0xc46d('0x7')](),controller['update']);router[_0xc46d('0xe')]('/:id',auth[_0xc46d('0x7')](),controller[_0xc46d('0xf')]);module[_0xc46d('0x10')]=router;
\ No newline at end of file
index 5b40364..44be80c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x097c=['STRING','sequelize','exports'];(function(_0x74e775,_0x1c394f){var _0x1b0bd1=function(_0x3ac740){while(--_0x3ac740){_0x74e775['push'](_0x74e775['shift']());}};_0x1b0bd1(++_0x1c394f);}(_0x097c,0x1d5));var _0xc097=function(_0x1241aa,_0x323da9){_0x1241aa=_0x1241aa-0x0;var _0x44d356=_0x097c[_0x1241aa];return _0x44d356;};'use strict';var Sequelize=require(_0xc097('0x0'));module[_0xc097('0x1')]={'name':{'type':Sequelize[_0xc097('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc097('0x2')]}};
\ No newline at end of file
+var _0xb43b=['exports','STRING','sequelize'];(function(_0x487eae,_0x268656){var _0x1417c1=function(_0x440d13){while(--_0x440d13){_0x487eae['push'](_0x487eae['shift']());}};_0x1417c1(++_0x268656);}(_0xb43b,0x1b2));var _0xbb43=function(_0x466531,_0x522caf){_0x466531=_0x466531-0x0;var _0x118877=_0xb43b[_0x466531];return _0x118877;};'use strict';var Sequelize=require(_0xbb43('0x0'));module[_0xbb43('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xbb43('0x2')]},'type':{'type':Sequelize[_0xbb43('0x2')]}};
\ No newline at end of file
index 7cf4eb6..e886bf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa4c=['join','server/files/attachments/','offline-chat/','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Attachment','findAll','catch','show','find','clone','params','includeAll','get','createdAt','omit','body','updatedAt','create','update','destroy','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xaa4c,0x1b6));var _0xcaa4=function(_0x9ded82,_0xca5381){_0x9ded82=_0x9ded82-0x0;var _0x30c7a6=_0xaa4c[_0x9ded82];return _0x30c7a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcaa4('0x0'));var jsonpatch=require(_0xcaa4('0x1'));var rp=require(_0xcaa4('0x2'));var moment=require(_0xcaa4('0x3'));var BPromise=require(_0xcaa4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcaa4('0x5'));var sox=require(_0xcaa4('0x6'));var csv=require(_0xcaa4('0x7'));var ejs=require(_0xcaa4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa4('0x9'));var squel=require('squel');var crypto=require(_0xcaa4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xcaa4('0xb'));var toCsv=require(_0xcaa4('0x7'));var querystring=require(_0xcaa4('0xc'));var Papa=require('papaparse');var Redis=require(_0xcaa4('0xd'));var authService=require(_0xcaa4('0xe'));var qs=require(_0xcaa4('0xf'));var as=require(_0xcaa4('0x10'));var hardwareService=require(_0xcaa4('0x11'));var logger=require(_0xcaa4('0x12'))(_0xcaa4('0x13'));var utils=require(_0xcaa4('0x14'));var config=require(_0xcaa4('0x15'));var licenseUtil=require(_0xcaa4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18c167,_0x46752f){_0x46752f=_0x46752f||0xcc;return function(_0x4ec7b9){if(_0x4ec7b9){return _0x18c167[_0xcaa4('0x17')](_0x46752f);}return _0x18c167[_0xcaa4('0x18')](_0x46752f)[_0xcaa4('0x19')]();};}function respondWithResult(_0xdccc15,_0x5170cb){_0x5170cb=_0x5170cb||0xc8;return function(_0x278a14){if(_0x278a14){return _0xdccc15[_0xcaa4('0x18')](_0x5170cb)[_0xcaa4('0x1a')](_0x278a14);}};}function respondWithFilteredResult(_0x282f16,_0x5c6f4c){return function(_0x4d31d5){if(_0x4d31d5){var _0x47875a=typeof _0x5c6f4c[_0xcaa4('0x1b')]===_0xcaa4('0x1c')&&typeof _0x5c6f4c[_0xcaa4('0x1d')]===_0xcaa4('0x1c');var _0x541793=_0x4d31d5[_0xcaa4('0x1e')];var _0x4b96e6=_0x47875a?0x0:_0x5c6f4c[_0xcaa4('0x1b')];var _0x442d46=_0x47875a?_0x4d31d5[_0xcaa4('0x1e')]:_0x5c6f4c[_0xcaa4('0x1b')]+_0x5c6f4c[_0xcaa4('0x1d')];var _0x3f26fa;if(_0x442d46>=_0x541793){_0x442d46=_0x541793;_0x3f26fa=0xc8;}else{_0x3f26fa=0xce;}_0x282f16[_0xcaa4('0x18')](_0x3f26fa);return _0x282f16[_0xcaa4('0x1f')](_0xcaa4('0x20'),_0x4b96e6+'-'+_0x442d46+'/'+_0x541793)['json'](_0x4d31d5);}return null;};}function patchUpdates(_0x100870){return function(_0x3a222a){try{jsonpatch['apply'](_0x3a222a,_0x100870,!![]);}catch(_0x45da81){return BPromise['reject'](_0x45da81);}return _0x3a222a[_0xcaa4('0x21')]();};}function saveUpdates(_0x44f8cb,_0x4d52c9){return function(_0x1ea7bb){if(_0x1ea7bb){return _0x1ea7bb['update'](_0x44f8cb)[_0xcaa4('0x22')](function(_0x3b51f4){return _0x3b51f4;});}return null;};}function removeEntity(_0x2f8f8d,_0x40c79d){return function(_0x4c5e8f){if(_0x4c5e8f){return _0x4c5e8f['destroy']()['then'](function(){_0x2f8f8d[_0xcaa4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bfe9,_0x5b15dd){return function(_0x2d6f82){if(!_0x2d6f82){_0x11bfe9[_0xcaa4('0x17')](0x194);}return _0x2d6f82;};}function handleError(_0x1b750b,_0x24509e){_0x24509e=_0x24509e||0x1f4;return function(_0x4d6a78){logger[_0xcaa4('0x23')](_0x4d6a78[_0xcaa4('0x24')]);if(_0x4d6a78[_0xcaa4('0x25')]){delete _0x4d6a78[_0xcaa4('0x25')];}_0x1b750b['status'](_0x24509e)['send'](_0x4d6a78);};}exports['index']=function(_0x45d51c,_0x5a3713){var _0x2cb0f6={},_0x10028a={},_0x4aae7c={'count':0x0,'rows':[]};var _0x5e3307=_[_0xcaa4('0x26')](db['Attachment'][_0xcaa4('0x27')],function(_0x3d6462){return{'name':_0x3d6462['fieldName'],'type':_0x3d6462[_0xcaa4('0x28')][_0xcaa4('0x29')]};});_0x10028a[_0xcaa4('0x2a')]=_[_0xcaa4('0x26')](_0x5e3307,'name');_0x10028a['query']=_[_0xcaa4('0x2b')](_0x45d51c[_0xcaa4('0x2c')]);_0x10028a[_0xcaa4('0x2d')]=_[_0xcaa4('0x2e')](_0x10028a['model'],_0x10028a[_0xcaa4('0x2c')]);_0x2cb0f6[_0xcaa4('0x2f')]=_[_0xcaa4('0x2e')](_0x10028a[_0xcaa4('0x2a')],qs[_0xcaa4('0x30')](_0x45d51c[_0xcaa4('0x2c')]['fields']));_0x2cb0f6[_0xcaa4('0x2f')]=_0x2cb0f6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x2cb0f6[_0xcaa4('0x2f')]:_0x10028a['model'];if(!_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x32')](_0xcaa4('0x33'))){_0x2cb0f6['limit']=qs[_0xcaa4('0x1d')](_0x45d51c[_0xcaa4('0x2c')]['limit']);_0x2cb0f6[_0xcaa4('0x1b')]=qs['offset'](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x1b')]);}_0x2cb0f6[_0xcaa4('0x34')]=qs[_0xcaa4('0x35')](_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x35')]);_0x2cb0f6[_0xcaa4('0x36')]=qs[_0xcaa4('0x2d')](_[_0xcaa4('0x37')](_0x45d51c[_0xcaa4('0x2c')],_0x10028a[_0xcaa4('0x2d')]),_0x5e3307);if(_0x45d51c[_0xcaa4('0x2c')][_0xcaa4('0x38')]){_0x2cb0f6[_0xcaa4('0x36')]=_[_0xcaa4('0x39')](_0x2cb0f6['where'],{'$or':_['map'](_0x5e3307,function(_0x3b4209){if(_0x3b4209['type']!==_0xcaa4('0x3a')){var _0xe4afc7={};_0xe4afc7[_0x3b4209['name']]={'$like':'%'+_0x45d51c[_0xcaa4('0x2c')]['filter']+'%'};return _0xe4afc7;}})});}_0x2cb0f6=_[_0xcaa4('0x39')]({},_0x2cb0f6,_0x45d51c[_0xcaa4('0x3b')]);var _0x4d6f9a={'where':_0x2cb0f6[_0xcaa4('0x36')]};return db['Attachment']['count'](_0x4d6f9a)['then'](function(_0x50561e){_0x4aae7c[_0xcaa4('0x1e')]=_0x50561e;if(_0x45d51c[_0xcaa4('0x2c')]['includeAll']){_0x2cb0f6[_0xcaa4('0x3c')]=[{'all':!![]}];}return db[_0xcaa4('0x3d')][_0xcaa4('0x3e')](_0x2cb0f6);})[_0xcaa4('0x22')](function(_0x1da855){_0x4aae7c['rows']=_0x1da855;return _0x4aae7c;})['then'](respondWithFilteredResult(_0x5a3713,_0x2cb0f6))[_0xcaa4('0x3f')](handleError(_0x5a3713,null));};exports[_0xcaa4('0x40')]=function(_0x4a20d8,_0xc7f2c1){var _0x1bd3b6={'raw':!![],'where':{'id':_0x4a20d8['params']['id']}},_0x13e749={};_0x13e749[_0xcaa4('0x2a')]=_[_0xcaa4('0x2b')](db[_0xcaa4('0x3d')]['rawAttributes']);_0x13e749[_0xcaa4('0x2c')]=_[_0xcaa4('0x2b')](_0x4a20d8[_0xcaa4('0x2c')]);_0x13e749[_0xcaa4('0x2d')]=_['intersection'](_0x13e749[_0xcaa4('0x2a')],_0x13e749[_0xcaa4('0x2c')]);_0x1bd3b6['attributes']=_[_0xcaa4('0x2e')](_0x13e749['model'],qs[_0xcaa4('0x30')](_0x4a20d8[_0xcaa4('0x2c')]['fields']));_0x1bd3b6[_0xcaa4('0x2f')]=_0x1bd3b6[_0xcaa4('0x2f')][_0xcaa4('0x31')]?_0x1bd3b6['attributes']:_0x13e749[_0xcaa4('0x2a')];if(_0x4a20d8[_0xcaa4('0x2c')]['includeAll']){_0x1bd3b6[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x1bd3b6=_[_0xcaa4('0x39')]({},_0x1bd3b6,_0x4a20d8[_0xcaa4('0x3b')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x1bd3b6)['then'](handleEntityNotFound(_0xc7f2c1,null))['then'](respondWithResult(_0xc7f2c1,null))[_0xcaa4('0x3f')](handleError(_0xc7f2c1,null));};exports[_0xcaa4('0x42')]=function(_0x2749dc,_0x562cc8){var _0x283ec5={'where':{'id':_0x2749dc[_0xcaa4('0x43')]['id']}},_0x513762={};_0x513762['model']=_[_0xcaa4('0x2b')](db['Attachment'][_0xcaa4('0x27')]);_0x283ec5['attributes']=_[_0xcaa4('0x2e')](_0x513762['model'],qs[_0xcaa4('0x30')](_0x2749dc[_0xcaa4('0x2c')]['fields']));_0x283ec5[_0xcaa4('0x2f')]=_0x283ec5['attributes']['length']?_0x283ec5[_0xcaa4('0x2f')]:_0x513762['model'];if(_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]){_0x283ec5[_0xcaa4('0x3c')]=[{'all':!![]}];}_0x283ec5=_['merge']({},_0x283ec5,_0x2749dc['options']);return db[_0xcaa4('0x3d')][_0xcaa4('0x41')](_0x283ec5)[_0xcaa4('0x22')](handleEntityNotFound(_0x562cc8,null))[_0xcaa4('0x22')](function(_0x2eb83d){if(_0x2eb83d){var _0x379dec=_0x2eb83d[_0xcaa4('0x45')]({'plain':!![]});_0x379dec=qs['omit'](_0x379dec,['id',_0xcaa4('0x46'),'updatedAt']);_0x2749dc['body']=_[_0xcaa4('0x47')](_0x2749dc[_0xcaa4('0x48')],['id',_0xcaa4('0x46'),_0xcaa4('0x49')]);return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_[_0xcaa4('0x39')](_0x379dec,_0x2749dc[_0xcaa4('0x48')]),{'include':_0x2749dc[_0xcaa4('0x2c')][_0xcaa4('0x44')]?[{'all':!![]}]:undefined});}})[_0xcaa4('0x22')](respondWithResult(_0x562cc8,0xc9))[_0xcaa4('0x3f')](handleError(_0x562cc8,null));};exports[_0xcaa4('0x4b')]=function(_0x10054b,_0x2c681c){if(_0x10054b['body']['id']){delete _0x10054b[_0xcaa4('0x48')]['id'];}return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x10054b[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x2c681c,null))['then'](saveUpdates(_0x10054b[_0xcaa4('0x48')],null))[_0xcaa4('0x22')](respondWithResult(_0x2c681c,null))[_0xcaa4('0x3f')](handleError(_0x2c681c,null));};exports[_0xcaa4('0x4c')]=function(_0x5ca145,_0x404d8b){return db['Attachment'][_0xcaa4('0x41')]({'where':{'id':_0x5ca145[_0xcaa4('0x43')]['id']}})[_0xcaa4('0x22')](handleEntityNotFound(_0x404d8b,null))[_0xcaa4('0x22')](removeEntity(_0x404d8b,null))[_0xcaa4('0x3f')](handleError(_0x404d8b,null));};exports[_0xcaa4('0x4a')]=function(_0x253a3f,_0x2e5641,_0x5c830b){_0x253a3f[_0xcaa4('0x48')]['name']=_0x253a3f[_0xcaa4('0x4d')]['originalname'];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x4e')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x4f')];_0x253a3f[_0xcaa4('0x48')][_0xcaa4('0x28')]=_0x253a3f[_0xcaa4('0x4d')][_0xcaa4('0x50')];return db[_0xcaa4('0x3d')][_0xcaa4('0x4a')](_0x253a3f[_0xcaa4('0x48')])[_0xcaa4('0x22')](respondWithResult(_0x2e5641,0xc9))[_0xcaa4('0x3f')](handleError(_0x2e5641,null));};exports[_0xcaa4('0x51')]=function(_0x4d28c4,_0x1d3030,_0x31d2e1){return db[_0xcaa4('0x3d')][_0xcaa4('0x52')]({'where':{'id':_0x4d28c4[_0xcaa4('0x43')]['id']},'raw':!![]})[_0xcaa4('0x22')](handleEntityNotFound(_0x1d3030,null))['then'](function(_0x4c5e00){if(_0x4c5e00){var _0x18ddc0=_0x4c5e00[_0xcaa4('0x53')]!==null;var _0xdc3206=path[_0xcaa4('0x54')](config['root'],_0xcaa4('0x55'));if(_0x18ddc0){_0xdc3206=path[_0xcaa4('0x54')](_0xdc3206,_0xcaa4('0x56'));}var _0x12e2d9=path['join'](_0xdc3206,_0x4c5e00[_0xcaa4('0x4e')]);return _0x1d3030[_0xcaa4('0x51')](_0x12e2d9);}})[_0xcaa4('0x3f')](handleError(_0x1d3030,null));};
\ No newline at end of file
+var _0xdc5d=['set','apply','reject','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','clone','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','download','findOne','join','root','offline-chat/','eml-format','rimraf','zip-dir','mustache','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit'];(function(_0x59bb70,_0x2e6b53){var _0x3a75b6=function(_0x50337d){while(--_0x50337d){_0x59bb70['push'](_0x59bb70['shift']());}};_0x3a75b6(++_0x2e6b53);}(_0xdc5d,0x182));var _0xddc5=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0xdc5d[_0x44039a];return _0x525de5;};'use strict';var emlformat=require(_0xddc5('0x0'));var rimraf=require(_0xddc5('0x1'));var zipdir=require(_0xddc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xddc5('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xddc5('0x4'));var fs=require('fs');var fs_extra=require(_0xddc5('0x5'));var _=require(_0xddc5('0x6'));var squel=require(_0xddc5('0x7'));var crypto=require('crypto');var jsforce=require(_0xddc5('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddc5('0x9'));var Redis=require(_0xddc5('0xa'));var authService=require(_0xddc5('0xb'));var qs=require(_0xddc5('0xc'));var as=require(_0xddc5('0xd'));var hardwareService=require(_0xddc5('0xe'));var logger=require(_0xddc5('0xf'))(_0xddc5('0x10'));var utils=require(_0xddc5('0x11'));var config=require(_0xddc5('0x12'));var licenseUtil=require(_0xddc5('0x13'));var db=require(_0xddc5('0x14'))['db'];function respondWithStatusCode(_0x3eced0,_0x5b05f5){_0x5b05f5=_0x5b05f5||0xcc;return function(_0x6fbfff){if(_0x6fbfff){return _0x3eced0[_0xddc5('0x15')](_0x5b05f5);}return _0x3eced0[_0xddc5('0x16')](_0x5b05f5)[_0xddc5('0x17')]();};}function respondWithResult(_0x293d93,_0x54453f){_0x54453f=_0x54453f||0xc8;return function(_0x1441ca){if(_0x1441ca){return _0x293d93[_0xddc5('0x16')](_0x54453f)[_0xddc5('0x18')](_0x1441ca);}};}function respondWithFilteredResult(_0x1dd5a0,_0x436a98){return function(_0x133691){if(_0x133691){var _0x6a0f39=typeof _0x436a98['offset']===_0xddc5('0x19')&&typeof _0x436a98['limit']==='undefined';var _0x467f46=_0x133691[_0xddc5('0x1a')];var _0x11a6cf=_0x6a0f39?0x0:_0x436a98['offset'];var _0xb3af64=_0x6a0f39?_0x133691[_0xddc5('0x1a')]:_0x436a98[_0xddc5('0x1b')]+_0x436a98[_0xddc5('0x1c')];var _0x2e0454;if(_0xb3af64>=_0x467f46){_0xb3af64=_0x467f46;_0x2e0454=0xc8;}else{_0x2e0454=0xce;}_0x1dd5a0[_0xddc5('0x16')](_0x2e0454);return _0x1dd5a0[_0xddc5('0x1d')]('Content-Range',_0x11a6cf+'-'+_0xb3af64+'/'+_0x467f46)[_0xddc5('0x18')](_0x133691);}return null;};}function patchUpdates(_0xbe232){return function(_0x3a80c0){try{jsonpatch[_0xddc5('0x1e')](_0x3a80c0,_0xbe232,!![]);}catch(_0x1e9044){return BPromise[_0xddc5('0x1f')](_0x1e9044);}return _0x3a80c0['save']();};}function saveUpdates(_0x25f2e3,_0x5e6c1e){return function(_0x504f66){if(_0x504f66){return _0x504f66['update'](_0x25f2e3)[_0xddc5('0x20')](function(_0x4f8cc7){return _0x4f8cc7;});}return null;};}function removeEntity(_0x1adb03,_0x36c5d6){return function(_0x2990ab){if(_0x2990ab){return _0x2990ab[_0xddc5('0x21')]()[_0xddc5('0x20')](function(){_0x1adb03[_0xddc5('0x16')](0xcc)[_0xddc5('0x17')]();});}};}function handleEntityNotFound(_0xa4c676,_0x9009dc){return function(_0x4255c1){if(!_0x4255c1){_0xa4c676[_0xddc5('0x15')](0x194);}return _0x4255c1;};}function handleError(_0x592ab5,_0xac118){_0xac118=_0xac118||0x1f4;return function(_0x4e6170){logger[_0xddc5('0x22')](_0x4e6170[_0xddc5('0x23')]);if(_0x4e6170[_0xddc5('0x24')]){delete _0x4e6170['name'];}_0x592ab5[_0xddc5('0x16')](_0xac118)['send'](_0x4e6170);};}exports[_0xddc5('0x25')]=function(_0x33c1b6,_0x4e1d5c){var _0x49a273={},_0x4515de={},_0x4778b={'count':0x0,'rows':[]};var _0x2f149b=_[_0xddc5('0x26')](db[_0xddc5('0x27')][_0xddc5('0x28')],function(_0x38fe9f){return{'name':_0x38fe9f[_0xddc5('0x29')],'type':_0x38fe9f[_0xddc5('0x2a')]['key']};});_0x4515de[_0xddc5('0x2b')]=_[_0xddc5('0x26')](_0x2f149b,_0xddc5('0x24'));_0x4515de['query']=_[_0xddc5('0x2c')](_0x33c1b6[_0xddc5('0x2d')]);_0x4515de[_0xddc5('0x2e')]=_[_0xddc5('0x2f')](_0x4515de[_0xddc5('0x2b')],_0x4515de[_0xddc5('0x2d')]);_0x49a273[_0xddc5('0x30')]=_[_0xddc5('0x2f')](_0x4515de[_0xddc5('0x2b')],qs[_0xddc5('0x31')](_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x31')]));_0x49a273[_0xddc5('0x30')]=_0x49a273[_0xddc5('0x30')][_0xddc5('0x32')]?_0x49a273[_0xddc5('0x30')]:_0x4515de[_0xddc5('0x2b')];if(!_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x33')](_0xddc5('0x34'))){_0x49a273[_0xddc5('0x1c')]=qs[_0xddc5('0x1c')](_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x1c')]);_0x49a273[_0xddc5('0x1b')]=qs['offset'](_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x1b')]);}_0x49a273[_0xddc5('0x35')]=qs[_0xddc5('0x36')](_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x36')]);_0x49a273['where']=qs[_0xddc5('0x2e')](_[_0xddc5('0x37')](_0x33c1b6[_0xddc5('0x2d')],_0x4515de[_0xddc5('0x2e')]),_0x2f149b);if(_0x33c1b6[_0xddc5('0x2d')][_0xddc5('0x38')]){_0x49a273[_0xddc5('0x39')]=_[_0xddc5('0x3a')](_0x49a273[_0xddc5('0x39')],{'$or':_[_0xddc5('0x26')](_0x2f149b,function(_0x41a077){if(_0x41a077[_0xddc5('0x2a')]!==_0xddc5('0x3b')){var _0x55b091={};_0x55b091[_0x41a077['name']]={'$like':'%'+_0x33c1b6['query'][_0xddc5('0x38')]+'%'};return _0x55b091;}})});}_0x49a273=_[_0xddc5('0x3a')]({},_0x49a273,_0x33c1b6[_0xddc5('0x3c')]);var _0x1e246e={'where':_0x49a273[_0xddc5('0x39')]};return db[_0xddc5('0x27')]['count'](_0x1e246e)['then'](function(_0x592928){_0x4778b[_0xddc5('0x1a')]=_0x592928;if(_0x33c1b6[_0xddc5('0x2d')]['includeAll']){_0x49a273['include']=[{'all':!![]}];}return db[_0xddc5('0x27')][_0xddc5('0x3d')](_0x49a273);})['then'](function(_0x2c0472){_0x4778b[_0xddc5('0x3e')]=_0x2c0472;return _0x4778b;})[_0xddc5('0x20')](respondWithFilteredResult(_0x4e1d5c,_0x49a273))[_0xddc5('0x3f')](handleError(_0x4e1d5c,null));};exports[_0xddc5('0x40')]=function(_0x2e5bc8,_0xaa316d){var _0x6b9ad1={'raw':!![],'where':{'id':_0x2e5bc8[_0xddc5('0x41')]['id']}},_0x27790c={};_0x27790c['model']=_[_0xddc5('0x2c')](db['Attachment'][_0xddc5('0x28')]);_0x27790c['query']=_['keys'](_0x2e5bc8[_0xddc5('0x2d')]);_0x27790c[_0xddc5('0x2e')]=_['intersection'](_0x27790c['model'],_0x27790c[_0xddc5('0x2d')]);_0x6b9ad1[_0xddc5('0x30')]=_[_0xddc5('0x2f')](_0x27790c['model'],qs[_0xddc5('0x31')](_0x2e5bc8[_0xddc5('0x2d')]['fields']));_0x6b9ad1[_0xddc5('0x30')]=_0x6b9ad1[_0xddc5('0x30')][_0xddc5('0x32')]?_0x6b9ad1[_0xddc5('0x30')]:_0x27790c[_0xddc5('0x2b')];if(_0x2e5bc8[_0xddc5('0x2d')][_0xddc5('0x42')]){_0x6b9ad1['include']=[{'all':!![]}];}_0x6b9ad1=_[_0xddc5('0x3a')]({},_0x6b9ad1,_0x2e5bc8[_0xddc5('0x3c')]);return db['Attachment'][_0xddc5('0x43')](_0x6b9ad1)[_0xddc5('0x20')](handleEntityNotFound(_0xaa316d,null))[_0xddc5('0x20')](respondWithResult(_0xaa316d,null))[_0xddc5('0x3f')](handleError(_0xaa316d,null));};exports[_0xddc5('0x44')]=function(_0x449744,_0x33e5ea){var _0x5e8bce={'where':{'id':_0x449744['params']['id']}},_0x4d34b9={};_0x4d34b9['model']=_[_0xddc5('0x2c')](db[_0xddc5('0x27')]['rawAttributes']);_0x5e8bce[_0xddc5('0x30')]=_[_0xddc5('0x2f')](_0x4d34b9[_0xddc5('0x2b')],qs[_0xddc5('0x31')](_0x449744['query'][_0xddc5('0x31')]));_0x5e8bce[_0xddc5('0x30')]=_0x5e8bce['attributes']['length']?_0x5e8bce[_0xddc5('0x30')]:_0x4d34b9[_0xddc5('0x2b')];if(_0x449744['query'][_0xddc5('0x42')]){_0x5e8bce['include']=[{'all':!![]}];}_0x5e8bce=_['merge']({},_0x5e8bce,_0x449744['options']);return db[_0xddc5('0x27')][_0xddc5('0x43')](_0x5e8bce)[_0xddc5('0x20')](handleEntityNotFound(_0x33e5ea,null))['then'](function(_0xba8871){if(_0xba8871){var _0x49c5ea=_0xba8871[_0xddc5('0x45')]({'plain':!![]});_0x49c5ea=qs[_0xddc5('0x46')](_0x49c5ea,['id',_0xddc5('0x47'),_0xddc5('0x48')]);_0x449744['body']=_[_0xddc5('0x46')](_0x449744[_0xddc5('0x49')],['id',_0xddc5('0x47'),'updatedAt']);return db['Attachment'][_0xddc5('0x4a')](_[_0xddc5('0x3a')](_0x49c5ea,_0x449744['body']),{'include':_0x449744[_0xddc5('0x2d')][_0xddc5('0x42')]?[{'all':!![]}]:undefined});}})[_0xddc5('0x20')](respondWithResult(_0x33e5ea,0xc9))['catch'](handleError(_0x33e5ea,null));};exports['update']=function(_0x5b10b4,_0x33d9ad){if(_0x5b10b4[_0xddc5('0x49')]['id']){delete _0x5b10b4[_0xddc5('0x49')]['id'];}return db[_0xddc5('0x27')]['find']({'where':{'id':_0x5b10b4['params']['id']}})['then'](handleEntityNotFound(_0x33d9ad,null))[_0xddc5('0x20')](saveUpdates(_0x5b10b4['body'],null))[_0xddc5('0x20')](respondWithResult(_0x33d9ad,null))[_0xddc5('0x3f')](handleError(_0x33d9ad,null));};exports[_0xddc5('0x21')]=function(_0x1f0333,_0x15e838){return db['Attachment'][_0xddc5('0x43')]({'where':{'id':_0x1f0333[_0xddc5('0x41')]['id']}})[_0xddc5('0x20')](handleEntityNotFound(_0x15e838,null))[_0xddc5('0x20')](removeEntity(_0x15e838,null))[_0xddc5('0x3f')](handleError(_0x15e838,null));};exports[_0xddc5('0x4a')]=function(_0x85842f,_0x27ca8e,_0x33a69e){_0x85842f['body'][_0xddc5('0x24')]=_0x85842f['file'][_0xddc5('0x4b')];_0x85842f[_0xddc5('0x49')][_0xddc5('0x4c')]=_0x85842f[_0xddc5('0x4d')]['filename'];_0x85842f[_0xddc5('0x49')][_0xddc5('0x2a')]=_0x85842f[_0xddc5('0x4d')]['mimetype'];return db[_0xddc5('0x27')][_0xddc5('0x4a')](_0x85842f['body'])[_0xddc5('0x20')](respondWithResult(_0x27ca8e,0xc9))[_0xddc5('0x3f')](handleError(_0x27ca8e,null));};exports[_0xddc5('0x4e')]=function(_0x2a2a93,_0x3e00c0,_0xdef4d8){return db[_0xddc5('0x27')][_0xddc5('0x4f')]({'where':{'id':_0x2a2a93['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3e00c0,null))[_0xddc5('0x20')](function(_0x43919e){if(_0x43919e){var _0x33409e=_0x43919e['ChatOfflineMessageId']!==null;var _0xd8c6a8=path[_0xddc5('0x50')](config[_0xddc5('0x51')],'server/files/attachments/');if(_0x33409e){_0xd8c6a8=path['join'](_0xd8c6a8,_0xddc5('0x52'));}var _0x43686c=path[_0xddc5('0x50')](_0xd8c6a8,_0x43919e['basename']);return _0x3e00c0[_0xddc5('0x4e')](_0x43686c);}})[_0xddc5('0x3f')](handleError(_0x3e00c0,null));};
\ No newline at end of file
index 5cd788d..275391c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','../../config/logger'];(function(_0x19c483,_0x3b63fc){var _0x47ae32=function(_0x5fd5a0){while(--_0x5fd5a0){_0x19c483['push'](_0x19c483['shift']());}};_0x47ae32(++_0x3b63fc);}(_0x207d,0x177));var _0xd207=function(_0x3615f8,_0x5652c6){_0x3615f8=_0x3615f8-0x0;var _0x11ff59=_0x207d[_0x3615f8];return _0x11ff59;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require(_0xd207('0x1'))(_0xd207('0x2'));var moment=require(_0xd207('0x3'));var BPromise=require(_0xd207('0x4'));var rp=require(_0xd207('0x5'));var fs=require('fs');var path=require(_0xd207('0x6'));var rimraf=require(_0xd207('0x7'));var config=require(_0xd207('0x8'));var attributes=require(_0xd207('0x9'));module['exports']=function(_0x54af97,_0x15b43a){return _0x54af97[_0xd207('0xa')](_0xd207('0xb'),attributes,{'tableName':_0xd207('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb105=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','Attachment','attachments','lodash'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0xb105,0x1cd));var _0x5b10=function(_0x42d51a,_0x1ad3de){_0x42d51a=_0x42d51a-0x0;var _0x2b1cbe=_0xb105[_0x42d51a];return _0x2b1cbe;};'use strict';var _=require(_0x5b10('0x0'));var util=require(_0x5b10('0x1'));var logger=require(_0x5b10('0x2'))(_0x5b10('0x3'));var moment=require('moment');var BPromise=require(_0x5b10('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b10('0x5'));var rimraf=require(_0x5b10('0x6'));var config=require(_0x5b10('0x7'));var attributes=require('./attachment.attributes');module[_0x5b10('0x8')]=function(_0x3a6114,_0x2b0c80){return _0x3a6114['define'](_0x5b10('0x9'),attributes,{'tableName':_0x5b10('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ad6d5b9..2aed7f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ce=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','lodash'];(function(_0x3de6f6,_0x5cbf81){var _0x47050d=function(_0x2c983b){while(--_0x2c983b){_0x3de6f6['push'](_0x3de6f6['shift']());}};_0x47050d(++_0x5cbf81);}(_0x20ce,0x10d));var _0xe20c=function(_0x47965b,_0x228ce8){_0x47965b=_0x47965b-0x0;var _0x1eb7e2=_0x20ce[_0x47965b];return _0x1eb7e2;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var moment=require(_0xe20c('0x2'));var BPromise=require('bluebird');var rs=require(_0xe20c('0x3'));var fs=require('fs');var Redis=require(_0xe20c('0x4'));var db=require(_0xe20c('0x5'))['db'];var utils=require(_0xe20c('0x6'));var logger=require(_0xe20c('0x7'))(_0xe20c('0x8'));var config=require(_0xe20c('0x9'));var jayson=require(_0xe20c('0xa'));var client=jayson[_0xe20c('0xb')][_0xe20c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x893e48,_0x26b9be,_0x2d88b5){return new BPromise(function(_0x8f79ad,_0x290fb5){return client[_0xe20c('0xd')](_0x893e48,_0x2d88b5)[_0xe20c('0xe')](function(_0x385d61){logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,_0xe20c('0x11'));logger[_0xe20c('0x12')](_0xe20c('0x13'),_0x26b9be,_0xe20c('0x11'),JSON['stringify'](_0x385d61));if(_0x385d61[_0xe20c('0x14')]){if(_0x385d61[_0xe20c('0x14')][_0xe20c('0x15')]===0x1f4){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61['error'][_0xe20c('0x16')]);return _0x290fb5(_0x385d61[_0xe20c('0x14')]['message']);}logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x385d61[_0xe20c('0x14')]['message']);return _0x8f79ad(_0x385d61[_0xe20c('0x14')][_0xe20c('0x16')]);}else{logger[_0xe20c('0xf')](_0xe20c('0x10'),_0x26b9be,'request\x20sent');_0x8f79ad(_0x385d61[_0xe20c('0x17')]['message']);}})[_0xe20c('0x18')](function(_0x4061ed){logger[_0xe20c('0x14')](_0xe20c('0x10'),_0x26b9be,_0x4061ed);_0x290fb5(_0x4061ed);});});}exports[_0xe20c('0x19')]=function(_0x2d58a7){var _0x2a4292=this;return new Promise(function(_0x3d8df5,_0x305f2f){return db[_0xe20c('0x1a')]['create'](_0x2d58a7[_0xe20c('0x1b')],{'raw':_0x2d58a7[_0xe20c('0x1c')]?_0x2d58a7[_0xe20c('0x1c')][_0xe20c('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x563070){logger[_0xe20c('0xf')](_0xe20c('0x19'),_0x2d58a7);logger[_0xe20c('0x12')]('CreateAttachment',_0x2d58a7,JSON['stringify'](_0x563070));_0x3d8df5(_0x563070);})[_0xe20c('0x18')](function(_0x281449){logger[_0xe20c('0x14')](_0xe20c('0x19'),_0x281449['message'],_0x2d58a7);_0x305f2f(_0x2a4292[_0xe20c('0x14')](0x1f4,_0x281449['message']));});});};
\ No newline at end of file
+var _0xe28e=['info','result','catch','CreateAttachment','Attachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','Attachment,\x20%s,\x20%s','message'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe28e,0x1ba));var _0xee28=function(_0x4ee788,_0x2625c5){_0x4ee788=_0x4ee788-0x0;var _0x666602=_0xe28e[_0x4ee788];return _0x666602;};'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']('Attachment,\x20%s,\x20%s',_0x30224a,_0xee28('0xf'));logger[_0xee28('0x10')]('Attachment,\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')]('Attachment,\x20%s,\x20%s',_0x30224a,_0x4c0eb9);_0x156aad(_0x4c0eb9);});});}exports[_0xee28('0x19')]=function(_0x19472a){var _0x5afd11=this;return new Promise(function(_0x355b07,_0x49be69){return db[_0xee28('0x1a')]['create'](_0x19472a[_0xee28('0x1b')],{'raw':_0x19472a['options']?_0x19472a[_0xee28('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xee28('0xe')](function(_0x2a01ff){logger[_0xee28('0x16')](_0xee28('0x19'),_0x19472a);logger[_0xee28('0x10')](_0xee28('0x19'),_0x19472a,JSON[_0xee28('0x11')](_0x2a01ff));_0x355b07(_0x2a01ff);})['catch'](function(_0x342798){logger[_0xee28('0x12')](_0xee28('0x19'),_0x342798['message'],_0x19472a);_0x49be69(_0x5afd11['error'](0x1f4,_0x342798[_0xee28('0x15')]));});});};
\ No newline at end of file
index db4ea2e..23cbb6f 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0xfaa8d,_0x1f7240){_0xfaa8d=_0xfaa8d-0x0;var _0x2e3407=_0xdb28[_0xfaa8d];return _0x2e3407;};'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(_0x22d8d6,_0x5d2729){var _0x8b7a1f=function(_0x2e8fa9){while(--_0x2e8fa9){_0x22d8d6['push'](_0x22d8d6['shift']());}};_0x8b7a1f(++_0x5d2729);}(_0xb10b,0x12a));var _0xbb10=function(_0x54d506,_0xabf5c2){_0x54d506=_0x54d506-0x0;var _0x5d3040=_0xb10b[_0x54d506];return _0x5d3040;};'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 47fdf77..05ec5d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd492=['google','/login','profile','email','callback','use','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../components/auth/service','../../config/utils','login','authenticate'];(function(_0x48fc52,_0x5cb557){var _0x10233e=function(_0x282d39){while(--_0x282d39){_0x48fc52['push'](_0x48fc52['shift']());}};_0x10233e(++_0x5cb557);}(_0xd492,0x11f));var _0x2d49=function(_0x43b318,_0x301079){_0x43b318=_0x43b318-0x0;var _0x5bd2ec=_0xd492[_0x43b318];return _0x5bd2ec;};'use strict';var _=require(_0x2d49('0x0'));var passport=require(_0x2d49('0x1'));var GoogleStrategy=require(_0x2d49('0x2'))[_0x2d49('0x3')];var moment=require(_0x2d49('0x4'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require(_0x2d49('0x5'))['signToken'];var utils=require(_0x2d49('0x6'));exports[_0x2d49('0x7')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'scope':[_0x2d49('0xb'),_0x2d49('0xc')],'session':![]});exports[_0x2d49('0xd')]=passport[_0x2d49('0x8')](_0x2d49('0x9'),{'failureRedirect':_0x2d49('0xa'),'session':![]});passport[_0x2d49('0xe')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0xf')]:_0x2d49('0x10'),'callbackURL':config[_0x2d49('0x9')]?config[_0x2d49('0x9')][_0x2d49('0x11')]:''},function(_0x48817c,_0x65b811,_0x1a43d8,_0x5482f8){var _0x1d5edc,_0x232e98;return db['Setting'][_0x2d49('0x12')]({'where':{'id':0x1},'attributes':[_0x2d49('0x13'),_0x2d49('0x14')],'raw':!![]})[_0x2d49('0x15')](function(_0x473a25){_0x1d5edc=_0x473a25;return db[_0x2d49('0x16')][_0x2d49('0x17')]({'where':{'email':_['map'](_0x1a43d8[_0x2d49('0x18')],_0x2d49('0x19')),'role':{'$or':[_0x2d49('0x1a'),_0x2d49('0x1b'),_0x2d49('0x1c')]}}});})[_0x2d49('0x15')](function(_0xffa649){_0x232e98=_0xffa649;if(_0x232e98){if(_0x232e98[_0x2d49('0x1d')]){return _0x5482f8(_0x2d49('0x1e'));}else if(_0x1d5edc[_0x2d49('0x14')]>0x0){if(_0x232e98[_0x2d49('0x1f')]){if(moment(_0x232e98[_0x2d49('0x20')])[_0x2d49('0x21')](_0x1d5edc[_0x2d49('0x14')],'minutes')>moment()){return _0x5482f8(_0x2d49('0x1e'));}else{return utils[_0x2d49('0x22')](_0x232e98,0x0,![],null)['then'](function(){return utils[_0x2d49('0x23')](_0x232e98);})[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}else{return utils[_0x2d49('0x23')](_0x232e98)[_0x2d49('0x15')](function(){return _0x5482f8(null,_0x232e98);});}}return _0x5482f8(_0x2d49('0x1e'));})[_0x2d49('0x24')](function(_0x3f301f){_0x5482f8(_0x3f301f);});}));
\ No newline at end of file
+var _0xd59d=['signToken','login','authenticate','/login','email','callback','google','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','map','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','then','catch','passport-google-oauth20'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0xd59d,0x128));var _0xdd59=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0xd59d[_0x5c6994];return _0x1d5c84;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0xdd59('0x0'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xdd59('0x1')];var utils=require('../../config/utils');exports[_0xdd59('0x2')]=passport[_0xdd59('0x3')]('google',{'failureRedirect':_0xdd59('0x4'),'scope':['profile',_0xdd59('0x5')],'session':![]});exports[_0xdd59('0x6')]=passport[_0xdd59('0x3')](_0xdd59('0x7'),{'failureRedirect':'/login','session':![]});passport[_0xdd59('0x8')](new GoogleStrategy({'clientID':config[_0xdd59('0x7')]?config['google'][_0xdd59('0x9')]:'id','clientSecret':config[_0xdd59('0x7')]?config['google'][_0xdd59('0xa')]:'secret','callbackURL':config[_0xdd59('0x7')]?config['google'][_0xdd59('0xb')]:''},function(_0x3cd578,_0x303529,_0x366602,_0x558c76){var _0x45768e,_0x3641a6;return db[_0xdd59('0xc')][_0xdd59('0xd')]({'where':{'id':0x1},'attributes':[_0xdd59('0xe'),_0xdd59('0xf')],'raw':!![]})['then'](function(_0x42c303){_0x45768e=_0x42c303;return db[_0xdd59('0x10')][_0xdd59('0x11')]({'where':{'email':_[_0xdd59('0x12')](_0x366602[_0xdd59('0x13')],_0xdd59('0x14')),'role':{'$or':['admin',_0xdd59('0x15'),_0xdd59('0x16')]}}});})['then'](function(_0x268c39){_0x3641a6=_0x268c39;if(_0x3641a6){if(_0x3641a6[_0xdd59('0x17')]){return _0x558c76(_0xdd59('0x18'));}else if(_0x45768e['blockDuration']>0x0){if(_0x3641a6[_0xdd59('0x19')]){if(moment(_0x3641a6[_0xdd59('0x1a')])[_0xdd59('0x1b')](_0x45768e[_0xdd59('0xf')],_0xdd59('0x1c'))>moment()){return _0x558c76(_0xdd59('0x18'));}else{return utils[_0xdd59('0x1d')](_0x3641a6,0x0,![],null)['then'](function(){return utils[_0xdd59('0x1e')](_0x3641a6);})[_0xdd59('0x1f')](function(){return _0x558c76(null,_0x3641a6);});}}else{return utils[_0xdd59('0x1e')](_0x3641a6)['then'](function(){return _0x558c76(null,_0x3641a6);});}}else{return utils[_0xdd59('0x1e')](_0x3641a6)['then'](function(){return _0x558c76(null,_0x3641a6);});}}return _0x558c76('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xdd59('0x20')](function(_0x34a0f2){_0x558c76(_0x34a0f2);});}));
\ No newline at end of file
index 4ded2ec..32f145e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4369=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x1d1da3,_0x387863){var _0x4ea3b1=function(_0x4ee207){while(--_0x4ee207){_0x1d1da3['push'](_0x1d1da3['shift']());}};_0x4ea3b1(++_0x387863);}(_0x4369,0x147));var _0x9436=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x4369[_0x5ad07c];return _0x204bae;};'use strict';var express=require(_0x9436('0x0'));var passport=require(_0x9436('0x1'));var router=express[_0x9436('0x2')]();var controller=require(_0x9436('0x3'));var userController=require(_0x9436('0x4'));var authService=require(_0x9436('0x5'));router[_0x9436('0x6')]('/',controller[_0x9436('0x7')]);router[_0x9436('0x6')]('/callback',controller[_0x9436('0x8')],authService[_0x9436('0x9')],userController['login'],authService[_0x9436('0xa')]);module[_0x9436('0xb')]=router;
\ No newline at end of file
+var _0xa4c3=['express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback','callback','setTokenCookie'];(function(_0x141b55,_0x957882){var _0x375591=function(_0x11f9dd){while(--_0x11f9dd){_0x141b55['push'](_0x141b55['shift']());}};_0x375591(++_0x957882);}(_0xa4c3,0xb4));var _0x3a4c=function(_0x67b7ef,_0x4d46b5){_0x67b7ef=_0x67b7ef-0x0;var _0x1c913b=_0xa4c3[_0x67b7ef];return _0x1c913b;};'use strict';var express=require(_0x3a4c('0x0'));var passport=require(_0x3a4c('0x1'));var router=express[_0x3a4c('0x2')]();var controller=require(_0x3a4c('0x3'));var userController=require(_0x3a4c('0x4'));var authService=require('../../components/auth/service');router[_0x3a4c('0x5')]('/',controller['login']);router[_0x3a4c('0x5')](_0x3a4c('0x6'),controller[_0x3a4c('0x7')],authService['isMiddleware'],userController['login'],authService[_0x3a4c('0x8')]);module['exports']=router;
\ No newline at end of file
index 010441f..6b66d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f80=['Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','use','util','passport-local','randomstring','../../mysqldb','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','salt','role','disabled','loginAttempts','admin','user','agent','name','authenticate','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','blocked','getLicense','catch','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','send','message','login','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','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','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x48c938,_0x14ac2c){var _0x5625b2=function(_0x3edffd){while(--_0x3edffd){_0x48c938['push'](_0x48c938['shift']());}};_0x5625b2(++_0x14ac2c);}(_0x9f80,0x105));var _0x09f8=function(_0x18ae7c,_0x51e930){_0x18ae7c=_0x18ae7c-0x0;var _0x28057f=_0x9f80[_0x18ae7c];return _0x28057f;};'use strict';var util=require(_0x09f8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x09f8('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0x09f8('0x2'));var moment=require('moment');var db=require(_0x09f8('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x09f8('0x4'));var client=jayson[_0x09f8('0x5')][_0x09f8('0x6')]({'port':0x232b});function localAuthenticate(_0x3b573d,_0x2dcff1,_0x406409,_0x4e3ce5){var _0x1ea626,_0x2fe8b1;return db[_0x09f8('0x7')]['findOne']({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})[_0x09f8('0xa')](function(_0x446224){_0x1ea626=_0x446224;return _0x3b573d[_0x09f8('0xb')]({'attributes':['id','name',_0x09f8('0xc'),_0x09f8('0xd'),_0x09f8('0xe'),_0x09f8('0xf'),'blocked','blockedAt',_0x09f8('0x10')],'where':{'name':_0x2dcff1,'role':{'$or':[_0x09f8('0x11'),_0x09f8('0x12'),_0x09f8('0x13')]}}});})[_0x09f8('0xa')](function(_0x7fc5ee){if(!_0x7fc5ee||_0x7fc5ee&&_0x7fc5ee[_0x09f8('0x14')]!==_0x2dcff1){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2fe8b1=_0x7fc5ee;return _0x2fe8b1;}})[_0x09f8('0xa')](function(){_0x2fe8b1[_0x09f8('0x15')](_0x406409,function(_0x5eda69,_0xc009bf){var _0x169bf1=_0x2fe8b1[_0x09f8('0x10')]+0x1;if(_0x5eda69){return _0x4e3ce5(_0x5eda69);}else if(!_0xc009bf){if(_0x2fe8b1['disabled']){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1ea626['allowedLoginAttempts']>0x0){if(_0x2fe8b1['blocked']){if(_0x1ea626[_0x09f8('0x9')]>0x0){if(moment(_0x2fe8b1[_0x09f8('0x16')])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x169bf1>=_0x1ea626[_0x09f8('0x8')]){return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,!![],moment())['then'](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}else{return utils['clearBlockUser'](_0x2fe8b1,_0x169bf1,![],null)[_0x09f8('0xa')](function(){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});});}}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{if(_0x2fe8b1[_0x09f8('0xf')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else if(_0x1ea626[_0x09f8('0x8')]>0x0){if(_0x2fe8b1[_0x09f8('0x1b')]){if(_0x1ea626['blockDuration']>0x0){if(moment(_0x2fe8b1['blockedAt'])[_0x09f8('0x17')](_0x1ea626[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils[_0x09f8('0x1c')](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}else{return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}}else{return utils[_0x09f8('0x1a')](_0x2fe8b1,0x0,![],null)[_0x09f8('0xa')](function(){return utils['getLicense'](_0x2fe8b1);})[_0x09f8('0xa')](function(){return _0x4e3ce5(null,_0x2fe8b1);})['catch'](function(_0x15bd75){return _0x4e3ce5(null,![],_0x15bd75);});}}else{if(_0x2fe8b1[_0x09f8('0x1b')]){return _0x4e3ce5(null,![],{'message':_0x09f8('0x19')});}else{return utils[_0x09f8('0x1c')](_0x2fe8b1)['then'](function(){return _0x4e3ce5(null,_0x2fe8b1);});}}}});})[_0x09f8('0x1d')](function(_0x4f600b){return _0x4e3ce5(null,![],_0x4f600b);});}function sendServiceMail(_0x45e2f1){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x09f8('0x14'),_0x09f8('0x1e')],'include':[{'model':db[_0x09f8('0x1f')],'as':'Smtp'}]})[_0x09f8('0xa')](function(_0x2fde04){if(!_0x2fde04){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x349e1e={'tls':{'rejectUnauthorized':![]}};if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')]){_0x349e1e[_0x09f8('0x21')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x21')];}else{_0x349e1e[_0x09f8('0x22')]=_0x2fde04[_0x09f8('0x20')]['host'];_0x349e1e[_0x09f8('0x23')]=_0x2fde04[_0x09f8('0x20')][_0x09f8('0x23')];_0x349e1e[_0x09f8('0x24')]=_0x2fde04[_0x09f8('0x20')]['secure'];}if(_0x2fde04[_0x09f8('0x20')][_0x09f8('0x25')]){_0x349e1e[_0x09f8('0x26')]={'user':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x12')],'pass':_0x2fde04[_0x09f8('0x20')][_0x09f8('0x27')]};}var _0x17ff53={'account':_0x349e1e,'message':_[_0x09f8('0x28')]({'from':util[_0x09f8('0x29')](_0x09f8('0x2a'),_0x2fde04[_0x09f8('0x14')],_0x2fde04[_0x09f8('0x1e')]||_0x2fde04['Smtp'][_0x09f8('0x12')])},_0x45e2f1)};return client[_0x09f8('0x2b')](_0x09f8('0x2c'),_0x17ff53);})[_0x09f8('0xa')](function(_0x4081b6){if(_0x4081b6[_0x09f8('0x2d')]){throw new Error(util[_0x09f8('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4081b6[_0x09f8('0x2d')]['message']||JSON[_0x09f8('0x2e')](_0x4081b6[_0x09f8('0x2d')])));}return!![];});}function handleError(_0x53a864,_0x58f20c,_0x10b8ee){return _0x53a864[_0x09f8('0x2f')](_0x58f20c||0x1f4)[_0x09f8('0x30')]({'message':_0x10b8ee?_0x10b8ee[_0x09f8('0x31')]||_0x10b8ee:''});}exports[_0x09f8('0x32')]=function(_0x458e74,_0x443050,_0xe23a14){passport[_0x09f8('0x15')](_0x09f8('0x33'),function(_0x361988,_0x25a23b,_0x540554){var _0x4dcca2=_0x361988||_0x540554;if(_0x4dcca2){return handleError(_0x443050,0x191,_0x4dcca2);}if(!_0x25a23b){return handleError(_0x443050,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xe2ae9f={'payload':{'id':_0x25a23b['id'],'role':_0x25a23b[_0x09f8('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x09f8('0x34')](_0xe2ae9f)[_0x09f8('0xa')](function(_0x14b6c2){_0x443050[_0x09f8('0x35')]({'id':_0x25a23b['id'],'token':_0x14b6c2,'statusCall':'','isAlreadyLogged':_0x25a23b[_0x09f8('0x36')]});});}})(_0x458e74,_0x443050,_0xe23a14);};exports[_0x09f8('0x37')]=function(_0x3ffafc,_0x113245,_0x198750){if(!_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]){return handleError(_0x113245,0x1f4,{'message':_0x09f8('0x39')});}var _0x3c6282=rs[_0x09f8('0x3a')]();_0x3ffafc[_0x09f8('0x38')]['email']=_0x3ffafc[_0x09f8('0x38')]['email']['trim']()[_0x09f8('0x3b')]();var _0x58c81a;return db[_0x09f8('0x7')][_0x09f8('0xb')]({'where':{'id':0x1},'attributes':[_0x09f8('0x8'),_0x09f8('0x9')],'raw':!![]})['then'](function(_0x37c2bf){_0x58c81a=_0x37c2bf;return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'email':_0x3ffafc[_0x09f8('0x38')][_0x09f8('0x1e')]}});})['then'](function(_0x93e483){if(!_0x93e483){throw new Error(_0x09f8('0x3e'));}if(_0x93e483[_0x09f8('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x93e483[_0x09f8('0x1b')]){if(moment(_0x93e483[_0x09f8('0x16')])['add'](_0x58c81a[_0x09f8('0x9')],_0x09f8('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x93e483[_0x09f8('0x1b')]=![];_0x93e483[_0x09f8('0x16')]=null;}}_0x93e483[_0x09f8('0x3f')]=_0x3c6282;_0x93e483['resetPasswordExpires']=Date[_0x09f8('0x40')]()+0x36ee80;return _0x93e483[_0x09f8('0x41')]();})[_0x09f8('0xa')](function(){return sendServiceMail({'to':_0x3ffafc['body']['email'],'subject':_0x09f8('0x42'),'text':_0x09f8('0x43')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x09f8('0x44')+_0x3ffafc[_0x09f8('0x45')][_0x09f8('0x22')]+'/reset/'+_0x3c6282+'\x0a\x0a'+_0x09f8('0x46')});})[_0x09f8('0xa')](function(){_0x113245[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x47')});})['catch'](function(_0xbe4ee1){return handleError(_0x113245,0x1f4,_0xbe4ee1);});};exports[_0x09f8('0x48')]=function(_0x456287,_0x4b48a3,_0x52d85d){return db[_0x09f8('0x3c')][_0x09f8('0x3d')]({'where':{'resetPasswordToken':_0x456287['params'][_0x09f8('0x49')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x09f8('0xa')](function(_0x458ba6){if(!_0x458ba6){throw new Error(_0x09f8('0x4a'));}return db[_0x09f8('0x7')][_0x09f8('0xb')]({'attributes':['id',_0x09f8('0x4b'),_0x09f8('0x4c'),'passwordHistoryLimit']})[_0x09f8('0xa')](function(_0x3685a5){if(_0x3685a5[_0x09f8('0x4b')])authService['validatePasswordPattern'](_0x456287[_0x09f8('0x38')]['password']);if(!_0x3685a5[_0x09f8('0x4c')]||!_0x458ba6[_0x09f8('0x4d')])return _0x458ba6;authService[_0x09f8('0x4e')](_0x456287[_0x09f8('0x38')][_0x09f8('0xc')],_0x458ba6[_0x09f8('0x4d')],_0x3685a5[_0x09f8('0x4f')]);return _0x458ba6;})[_0x09f8('0xa')](function(){_0x458ba6['password']=_0x456287[_0x09f8('0x38')][_0x09f8('0xc')];_0x458ba6[_0x09f8('0x3f')]=null;_0x458ba6[_0x09f8('0x50')]=null;return _0x458ba6[_0x09f8('0x41')]();});})[_0x09f8('0xa')](function(){_0x4b48a3[_0x09f8('0x2f')](0xc8)[_0x09f8('0x30')]({'message':_0x09f8('0x51')});})['catch'](function(_0x181a04){return handleError(_0x4b48a3,0x1f4,_0x181a04);});};passport[_0x09f8('0x52')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x4466ba,_0x51fe21,_0x300686){return localAuthenticate(db[_0x09f8('0x3c')],_0x4466ba,_0x51fe21,_0x300686);}));
\ No newline at end of file
+var _0xec60=['SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','email','Email\x20parameter\x20is\x20missing','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','Reset\x20Email\x20sent!','reset','find','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail'];(function(_0x39ed64,_0xbdb00b){var _0x5b4d71=function(_0x4dae92){while(--_0x4dae92){_0x39ed64['push'](_0x39ed64['shift']());}};_0x5b4d71(++_0xbdb00b);}(_0xec60,0x1de));var _0x0ec6=function(_0xbcbce6,_0x238a41){_0xbcbce6=_0xbcbce6-0x0;var _0x190f14=_0xec60[_0xbcbce6];return _0x190f14;};'use strict';var util=require(_0x0ec6('0x0'));var passport=require(_0x0ec6('0x1'));var LocalStrategy=require(_0x0ec6('0x2'))[_0x0ec6('0x3')];var jayson=require(_0x0ec6('0x4'));var _=require(_0x0ec6('0x5'));var rs=require('randomstring');var moment=require(_0x0ec6('0x6'));var db=require(_0x0ec6('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x0ec6('0x8'));var client=jayson['client'][_0x0ec6('0x9')]({'port':0x232b});function localAuthenticate(_0x539009,_0x45cdd1,_0x20576e,_0x2c3f8c){var _0x5dea24,_0x448f45;return db['Setting'][_0x0ec6('0xa')]({'where':{'id':0x1},'attributes':[_0x0ec6('0xb'),_0x0ec6('0xc')],'raw':!![]})[_0x0ec6('0xd')](function(_0x5033eb){_0x5dea24=_0x5033eb;return _0x539009['findOne']({'attributes':['id',_0x0ec6('0xe'),_0x0ec6('0xf'),'salt',_0x0ec6('0x10'),_0x0ec6('0x11'),'blocked',_0x0ec6('0x12'),'loginAttempts'],'where':{'name':_0x45cdd1,'role':{'$or':['admin',_0x0ec6('0x13'),_0x0ec6('0x14')]}}});})['then'](function(_0x1e6136){if(!_0x1e6136||_0x1e6136&&_0x1e6136[_0x0ec6('0xe')]!==_0x45cdd1){throw new Error(_0x0ec6('0x15'));}else{_0x448f45=_0x1e6136;return _0x448f45;}})[_0x0ec6('0xd')](function(){_0x448f45[_0x0ec6('0x16')](_0x20576e,function(_0x1482a6,_0x3704d9){var _0x5345c5=_0x448f45[_0x0ec6('0x17')]+0x1;if(_0x1482a6){return _0x2c3f8c(_0x1482a6);}else if(!_0x3704d9){if(_0x448f45[_0x0ec6('0x11')]){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}else if(_0x5dea24[_0x0ec6('0xb')]>0x0){if(_0x448f45['blocked']){if(_0x5dea24[_0x0ec6('0xc')]>0x0){if(moment(_0x448f45[_0x0ec6('0x12')])[_0x0ec6('0x18')](_0x5dea24[_0x0ec6('0xc')],_0x0ec6('0x19'))>moment()){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}else{return utils[_0x0ec6('0x1a')](_0x448f45,_0x5345c5,![],null)[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2c3f8c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5345c5>=_0x5dea24['allowedLoginAttempts']){return utils[_0x0ec6('0x1a')](_0x448f45,0x0,!![],moment())[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});});}else{return utils[_0x0ec6('0x1a')](_0x448f45,_0x5345c5,![],null)[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});});}}}else{return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}}else{if(_0x448f45[_0x0ec6('0x11')]){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}else if(_0x5dea24[_0x0ec6('0xb')]>0x0){if(_0x448f45[_0x0ec6('0x1b')]){if(_0x5dea24[_0x0ec6('0xc')]>0x0){if(moment(_0x448f45[_0x0ec6('0x12')])[_0x0ec6('0x18')](_0x5dea24['blockDuration'],'minutes')>moment()){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}else{return utils[_0x0ec6('0x1a')](_0x448f45,0x0,![],null)[_0x0ec6('0xd')](function(){return utils[_0x0ec6('0x1c')](_0x448f45);})[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,_0x448f45);});}}else{return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}}else{return utils[_0x0ec6('0x1a')](_0x448f45,0x0,![],null)['then'](function(){return utils['getLicense'](_0x448f45);})[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,_0x448f45);})[_0x0ec6('0x1d')](function(_0x47db32){return _0x2c3f8c(null,![],_0x47db32);});}}else{if(_0x448f45[_0x0ec6('0x1b')]){return _0x2c3f8c(null,![],{'message':_0x0ec6('0x15')});}else{return utils[_0x0ec6('0x1c')](_0x448f45)[_0x0ec6('0xd')](function(){return _0x2c3f8c(null,_0x448f45);});}}}});})[_0x0ec6('0x1d')](function(_0xcfddc9){return _0x2c3f8c(null,![],_0xcfddc9);});}function sendServiceMail(_0x73022f){return db[_0x0ec6('0x1e')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x0ec6('0x1f')],'as':_0x0ec6('0x20')}]})[_0x0ec6('0xd')](function(_0x590b3d){if(!_0x590b3d){throw new Error(_0x0ec6('0x21'));}var _0x24554a={'tls':{'rejectUnauthorized':![]}};if(_0x590b3d[_0x0ec6('0x20')][_0x0ec6('0x22')]){_0x24554a[_0x0ec6('0x22')]=_0x590b3d[_0x0ec6('0x20')][_0x0ec6('0x22')];}else{_0x24554a[_0x0ec6('0x23')]=_0x590b3d[_0x0ec6('0x20')][_0x0ec6('0x23')];_0x24554a[_0x0ec6('0x24')]=_0x590b3d[_0x0ec6('0x20')][_0x0ec6('0x24')];_0x24554a['secure']=_0x590b3d['Smtp']['secure'];}if(_0x590b3d[_0x0ec6('0x20')]['authentication']){_0x24554a[_0x0ec6('0x25')]={'user':_0x590b3d['Smtp'][_0x0ec6('0x13')],'pass':_0x590b3d['Smtp'][_0x0ec6('0x26')]};}var _0x28096e={'account':_0x24554a,'message':_[_0x0ec6('0x27')]({'from':util[_0x0ec6('0x28')](_0x0ec6('0x29'),_0x590b3d['name'],_0x590b3d['email']||_0x590b3d[_0x0ec6('0x20')]['user'])},_0x73022f)};return client[_0x0ec6('0x2a')](_0x0ec6('0x2b'),_0x28096e);})['then'](function(_0x4b21af){if(_0x4b21af['error']){throw new Error(util[_0x0ec6('0x28')](_0x0ec6('0x2c'),_0x4b21af[_0x0ec6('0x2d')][_0x0ec6('0x2e')]||JSON['stringify'](_0x4b21af[_0x0ec6('0x2d')])));}return!![];});}function handleError(_0x7450db,_0x1bb4a2,_0x15af0e){return _0x7450db[_0x0ec6('0x2f')](_0x1bb4a2||0x1f4)[_0x0ec6('0x30')]({'message':_0x15af0e?_0x15af0e[_0x0ec6('0x2e')]||_0x15af0e:''});}exports[_0x0ec6('0x31')]=function(_0x2e3990,_0x435c97,_0x37c5be){passport['authenticate'](_0x0ec6('0x32'),function(_0x38cb81,_0x195ff7,_0x3221d9){var _0x4fedb0=_0x38cb81||_0x3221d9;if(_0x4fedb0){return handleError(_0x435c97,0x191,_0x4fedb0);}if(!_0x195ff7){return handleError(_0x435c97,0x194,{'message':_0x0ec6('0x33')});}else{var _0x175eea={'payload':{'id':_0x195ff7['id'],'role':_0x195ff7[_0x0ec6('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x0ec6('0x34')](_0x175eea)[_0x0ec6('0xd')](function(_0x49e28e){_0x435c97[_0x0ec6('0x35')]({'id':_0x195ff7['id'],'token':_0x49e28e,'statusCall':'','isAlreadyLogged':_0x195ff7['online']});});}})(_0x2e3990,_0x435c97,_0x37c5be);};exports[_0x0ec6('0x36')]=function(_0x4e8a8b,_0x5a6f93,_0x4d8dc0){if(!_0x4e8a8b[_0x0ec6('0x37')][_0x0ec6('0x38')]){return handleError(_0x5a6f93,0x1f4,{'message':_0x0ec6('0x39')});}var _0x4e23cc=rs[_0x0ec6('0x3a')]();_0x4e8a8b[_0x0ec6('0x37')]['email']=_0x4e8a8b[_0x0ec6('0x37')][_0x0ec6('0x38')][_0x0ec6('0x3b')]()['toLowerCase']();var _0x30dc80;return db['Setting'][_0x0ec6('0xa')]({'where':{'id':0x1},'attributes':[_0x0ec6('0xb'),_0x0ec6('0xc')],'raw':!![]})[_0x0ec6('0xd')](function(_0x6aee5a){_0x30dc80=_0x6aee5a;return db[_0x0ec6('0x3c')]['find']({'where':{'email':_0x4e8a8b[_0x0ec6('0x37')][_0x0ec6('0x38')]}});})['then'](function(_0x2259c1){if(!_0x2259c1){throw new Error(_0x0ec6('0x3d'));}if(_0x2259c1[_0x0ec6('0x11')]){throw new Error(_0x0ec6('0x3e'));}if(_0x2259c1[_0x0ec6('0x1b')]){if(moment(_0x2259c1[_0x0ec6('0x12')])[_0x0ec6('0x18')](_0x30dc80[_0x0ec6('0xc')],_0x0ec6('0x19'))>moment()){throw new Error(_0x0ec6('0x3f'));}else{_0x2259c1[_0x0ec6('0x1b')]=![];_0x2259c1[_0x0ec6('0x12')]=null;}}_0x2259c1[_0x0ec6('0x40')]=_0x4e23cc;_0x2259c1[_0x0ec6('0x41')]=Date[_0x0ec6('0x42')]()+0x36ee80;return _0x2259c1[_0x0ec6('0x43')]();})[_0x0ec6('0xd')](function(){return sendServiceMail({'to':_0x4e8a8b['body']['email'],'subject':_0x0ec6('0x44'),'text':_0x0ec6('0x45')+_0x0ec6('0x46')+'https://'+_0x4e8a8b[_0x0ec6('0x47')][_0x0ec6('0x23')]+_0x0ec6('0x48')+_0x4e23cc+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x5a6f93[_0x0ec6('0x2f')](0xc8)[_0x0ec6('0x30')]({'message':_0x0ec6('0x49')});})[_0x0ec6('0x1d')](function(_0x319264){return handleError(_0x5a6f93,0x1f4,_0x319264);});};exports[_0x0ec6('0x4a')]=function(_0x2d55fa,_0x513f18,_0x36cf04){return db[_0x0ec6('0x3c')][_0x0ec6('0x4b')]({'where':{'resetPasswordToken':_0x2d55fa[_0x0ec6('0x4c')][_0x0ec6('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x0ec6('0x42')]()}}})['then'](function(_0x26dbce){if(!_0x26dbce){throw new Error(_0x0ec6('0x4e'));}return db[_0x0ec6('0x4f')]['findOne']({'attributes':['id',_0x0ec6('0x50'),_0x0ec6('0x51'),_0x0ec6('0x52')]})['then'](function(_0x17b450){if(_0x17b450[_0x0ec6('0x50')])authService[_0x0ec6('0x53')](_0x2d55fa[_0x0ec6('0x37')][_0x0ec6('0xf')]);if(!_0x17b450[_0x0ec6('0x51')]||!_0x26dbce['previousPasswords'])return _0x26dbce;authService['validatePasswordHistory'](_0x2d55fa[_0x0ec6('0x37')][_0x0ec6('0xf')],_0x26dbce[_0x0ec6('0x54')],_0x17b450[_0x0ec6('0x52')]);return _0x26dbce;})['then'](function(){_0x26dbce[_0x0ec6('0xf')]=_0x2d55fa[_0x0ec6('0x37')][_0x0ec6('0xf')];_0x26dbce['resetPasswordToken']=null;_0x26dbce[_0x0ec6('0x41')]=null;return _0x26dbce[_0x0ec6('0x43')]();});})['then'](function(){_0x513f18[_0x0ec6('0x2f')](0xc8)[_0x0ec6('0x30')]({'message':_0x0ec6('0x55')});})['catch'](function(_0x153942){return handleError(_0x513f18,0x1f4,_0x153942);});};passport[_0x0ec6('0x56')](new LocalStrategy({'usernameField':_0x0ec6('0xe'),'passwordField':_0x0ec6('0xf')},function(_0x3708d7,_0x2ebd96,_0x11cd2e){return localAuthenticate(db[_0x0ec6('0x3c')],_0x3708d7,_0x2ebd96,_0x11cd2e);}));
\ No newline at end of file
index 9be22d4..a040c63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb768=['/reset/:token','exports','Router','./authLocal.controller','login','post','/forgot','forgot'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0xb768,0x16a));var _0x8b76=function(_0x408e10,_0x560479){_0x408e10=_0x408e10-0x0;var _0x228eeb=_0xb768[_0x408e10];return _0x228eeb;};'use strict';var express=require('express');var router=express[_0x8b76('0x0')]();var controller=require(_0x8b76('0x1'));router['post']('/',controller[_0x8b76('0x2')]);router[_0x8b76('0x3')](_0x8b76('0x4'),controller[_0x8b76('0x5')]);router[_0x8b76('0x3')](_0x8b76('0x6'),controller['reset']);module[_0x8b76('0x7')]=router;
\ No newline at end of file
+var _0xf485=['./authLocal.controller','post','login','/reset/:token','reset','exports','express','Router'];(function(_0x161951,_0xaab06a){var _0x1b2340=function(_0x2823a2){while(--_0x2823a2){_0x161951['push'](_0x161951['shift']());}};_0x1b2340(++_0xaab06a);}(_0xf485,0x10e));var _0x5f48=function(_0x258748,_0x19ac22){_0x258748=_0x258748-0x0;var _0x42d208=_0xf485[_0x258748];return _0x42d208;};'use strict';var express=require(_0x5f48('0x0'));var router=express[_0x5f48('0x1')]();var controller=require(_0x5f48('0x2'));router[_0x5f48('0x3')]('/',controller[_0x5f48('0x4')]);router[_0x5f48('0x3')]('/forgot',controller['forgot']);router[_0x5f48('0x3')](_0x5f48('0x5'),controller[_0x5f48('0x6')]);module[_0x5f48('0x7')]=router;
\ No newline at end of file
index 4479efe..e62f22f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4875=['BOOLEAN','sequelize','exports','STRING'];(function(_0x12566a,_0x448050){var _0x15f53f=function(_0x31eac9){while(--_0x31eac9){_0x12566a['push'](_0x12566a['shift']());}};_0x15f53f(++_0x448050);}(_0x4875,0x171));var _0x5487=function(_0x519de3,_0xe7c04e){_0x519de3=_0x519de3-0x0;var _0x3e21d9=_0x4875[_0x519de3];return _0x3e21d9;};'use strict';var Sequelize=require(_0x5487('0x0'));module[_0x5487('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5487('0x2')]},'status':{'type':Sequelize[_0x5487('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x6263=['BOOLEAN','INTEGER','STRING'];(function(_0x29e314,_0x19d592){var _0x4c9fcb=function(_0xcb1c9){while(--_0xcb1c9){_0x29e314['push'](_0x29e314['shift']());}};_0x4c9fcb(++_0x19d592);}(_0x6263,0xe0));var _0x3626=function(_0x332e43,_0x252844){_0x332e43=_0x332e43-0x0;var _0x13bee3=_0x6263[_0x332e43];return _0x13bee3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3626('0x0')]},'description':{'type':Sequelize[_0x3626('0x0')]},'status':{'type':Sequelize[_0x3626('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3626('0x2')],'defaultValue':0xa}};
\ No newline at end of file
index eec4bdd..a30dd0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x740e=['key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','show','params','keys','intersection','includeAll','options','find','create','catch','body','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type'];(function(_0xa2b098,_0x461a08){var _0x29502e=function(_0x43291a){while(--_0x43291a){_0xa2b098['push'](_0xa2b098['shift']());}};_0x29502e(++_0x461a08);}(_0x740e,0x179));var _0xe740=function(_0x12de57,_0x3a3edc){_0x12de57=_0x12de57-0x0;var _0x3f668f=_0x740e[_0x12de57];return _0x3f668f;};'use strict';var emlformat=require(_0xe740('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe740('0x1'));var rp=require(_0xe740('0x2'));var moment=require(_0xe740('0x3'));var BPromise=require(_0xe740('0x4'));var Mustache=require(_0xe740('0x5'));var util=require(_0xe740('0x6'));var path=require(_0xe740('0x7'));var sox=require('sox');var csv=require(_0xe740('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe740('0x9'));var _=require(_0xe740('0xa'));var squel=require(_0xe740('0xb'));var crypto=require(_0xe740('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe740('0xd'));var toCsv=require(_0xe740('0x8'));var querystring=require(_0xe740('0xe'));var Papa=require(_0xe740('0xf'));var Redis=require(_0xe740('0x10'));var authService=require(_0xe740('0x11'));var qs=require(_0xe740('0x12'));var as=require(_0xe740('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe740('0x14'))(_0xe740('0x15'));var utils=require(_0xe740('0x16'));var config=require(_0xe740('0x17'));var licenseUtil=require(_0xe740('0x18'));var db=require(_0xe740('0x19'))['db'];function respondWithStatusCode(_0x53e7c1,_0x2a50cc){_0x2a50cc=_0x2a50cc||0xcc;return function(_0xbe8b7b){if(_0xbe8b7b){return _0x53e7c1[_0xe740('0x1a')](_0x2a50cc);}return _0x53e7c1[_0xe740('0x1b')](_0x2a50cc)[_0xe740('0x1c')]();};}function respondWithResult(_0x35ff3f,_0x57dc45){_0x57dc45=_0x57dc45||0xc8;return function(_0x247183){if(_0x247183){return _0x35ff3f[_0xe740('0x1b')](_0x57dc45)[_0xe740('0x1d')](_0x247183);}};}function respondWithFilteredResult(_0x519b5,_0x38b6db){return function(_0x26adfd){if(_0x26adfd){var _0x121bec=typeof _0x38b6db[_0xe740('0x1e')]===_0xe740('0x1f')&&typeof _0x38b6db[_0xe740('0x20')]==='undefined';var _0x446b4b=_0x26adfd['count'];var _0x41e781=_0x121bec?0x0:_0x38b6db[_0xe740('0x1e')];var _0x3b8a6f=_0x121bec?_0x26adfd[_0xe740('0x21')]:_0x38b6db[_0xe740('0x1e')]+_0x38b6db[_0xe740('0x20')];var _0x158db4;if(_0x3b8a6f>=_0x446b4b){_0x3b8a6f=_0x446b4b;_0x158db4=0xc8;}else{_0x158db4=0xce;}_0x519b5['status'](_0x158db4);return _0x519b5[_0xe740('0x22')]('Content-Range',_0x41e781+'-'+_0x3b8a6f+'/'+_0x446b4b)[_0xe740('0x1d')](_0x26adfd);}return null;};}function patchUpdates(_0x1c9c3c){return function(_0x5ccc88){try{jsonpatch[_0xe740('0x23')](_0x5ccc88,_0x1c9c3c,!![]);}catch(_0x2060d5){return BPromise['reject'](_0x2060d5);}return _0x5ccc88['save']();};}function saveUpdates(_0x27d305,_0x39578d){return function(_0x2b092d){if(_0x2b092d){return _0x2b092d[_0xe740('0x24')](_0x27d305)[_0xe740('0x25')](function(_0x16f648){return _0x16f648;});}return null;};}function removeEntity(_0x42a23d,_0x371c03){return function(_0x367418){if(_0x367418){return _0x367418[_0xe740('0x26')]()[_0xe740('0x25')](function(){_0x42a23d['status'](0xcc)[_0xe740('0x1c')]();});}};}function handleEntityNotFound(_0x19fe3c,_0x426250){return function(_0xcbe053){if(!_0xcbe053){_0x19fe3c[_0xe740('0x1a')](0x194);}return _0xcbe053;};}function handleError(_0x3f0878,_0x4e74fb){_0x4e74fb=_0x4e74fb||0x1f4;return function(_0x43c7fa){logger[_0xe740('0x27')](_0x43c7fa[_0xe740('0x28')]);if(_0x43c7fa[_0xe740('0x29')]){delete _0x43c7fa[_0xe740('0x29')];}_0x3f0878[_0xe740('0x1b')](_0x4e74fb)[_0xe740('0x2a')](_0x43c7fa);};}exports[_0xe740('0x2b')]=function(_0x1795c1,_0x3d192b){var _0x52c106={},_0x52675b={},_0x264631={'count':0x0,'rows':[]};var _0x425944=_[_0xe740('0x2c')](db[_0xe740('0x2d')][_0xe740('0x2e')],function(_0x5ded98){return{'name':_0x5ded98['fieldName'],'type':_0x5ded98[_0xe740('0x2f')][_0xe740('0x30')]};});_0x52675b[_0xe740('0x31')]=_[_0xe740('0x2c')](_0x425944,_0xe740('0x29'));_0x52675b[_0xe740('0x32')]=_['keys'](_0x1795c1['query']);_0x52675b[_0xe740('0x33')]=_['intersection'](_0x52675b['model'],_0x52675b[_0xe740('0x32')]);_0x52c106[_0xe740('0x34')]=_['intersection'](_0x52675b[_0xe740('0x31')],qs[_0xe740('0x35')](_0x1795c1[_0xe740('0x32')][_0xe740('0x35')]));_0x52c106[_0xe740('0x34')]=_0x52c106['attributes'][_0xe740('0x36')]?_0x52c106[_0xe740('0x34')]:_0x52675b[_0xe740('0x31')];if(!_0x1795c1[_0xe740('0x32')][_0xe740('0x37')]('nolimit')){_0x52c106[_0xe740('0x20')]=qs[_0xe740('0x20')](_0x1795c1['query'][_0xe740('0x20')]);_0x52c106[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x1795c1['query'][_0xe740('0x1e')]);}_0x52c106[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x1795c1['query'][_0xe740('0x39')]);_0x52c106['where']=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x1795c1[_0xe740('0x32')],_0x52675b['filters']),_0x425944);if(_0x1795c1[_0xe740('0x32')][_0xe740('0x3b')]){_0x52c106[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x52c106[_0xe740('0x3c')],{'$or':_['map'](_0x425944,function(_0x4d5d16){if(_0x4d5d16['type']!==_0xe740('0x3e')){var _0x5b52f5={};_0x5b52f5[_0x4d5d16[_0xe740('0x29')]]={'$like':'%'+_0x1795c1[_0xe740('0x32')]['filter']+'%'};return _0x5b52f5;}})});}_0x52c106=_['merge']({},_0x52c106,_0x1795c1['options']);var _0xb8bcc9={'where':_0x52c106[_0xe740('0x3c')]};return db[_0xe740('0x2d')][_0xe740('0x21')](_0xb8bcc9)[_0xe740('0x25')](function(_0x15b0a4){_0x264631[_0xe740('0x21')]=_0x15b0a4;if(_0x1795c1[_0xe740('0x32')]['includeAll']){_0x52c106['include']=[{'all':!![]}];}return db[_0xe740('0x2d')][_0xe740('0x3f')](_0x52c106);})[_0xe740('0x25')](function(_0x35f6ba){_0x264631[_0xe740('0x40')]=_0x35f6ba;return _0x264631;})['then'](respondWithFilteredResult(_0x3d192b,_0x52c106))['catch'](handleError(_0x3d192b,null));};exports[_0xe740('0x41')]=function(_0x298735,_0x502ef2){var _0x4f67bd={'raw':![],'where':{'id':_0x298735[_0xe740('0x42')]['id']}},_0x3d4192={};_0x3d4192['model']=_[_0xe740('0x43')](db[_0xe740('0x2d')][_0xe740('0x2e')]);_0x3d4192[_0xe740('0x32')]=_[_0xe740('0x43')](_0x298735[_0xe740('0x32')]);_0x3d4192[_0xe740('0x33')]=_[_0xe740('0x44')](_0x3d4192['model'],_0x3d4192[_0xe740('0x32')]);_0x4f67bd['attributes']=_[_0xe740('0x44')](_0x3d4192[_0xe740('0x31')],qs[_0xe740('0x35')](_0x298735['query']['fields']));_0x4f67bd['attributes']=_0x4f67bd['attributes']['length']?_0x4f67bd['attributes']:_0x3d4192['model'];if(_0x298735[_0xe740('0x32')][_0xe740('0x45')]){_0x4f67bd['include']=[{'all':!![]}];}_0x4f67bd=_[_0xe740('0x3d')]({},_0x4f67bd,_0x298735[_0xe740('0x46')]);return db[_0xe740('0x2d')][_0xe740('0x47')](_0x4f67bd)['then'](handleEntityNotFound(_0x502ef2,null))[_0xe740('0x25')](respondWithResult(_0x502ef2,null))['catch'](handleError(_0x502ef2,null));};exports[_0xe740('0x48')]=function(_0x2c5d16,_0x47c960){return db[_0xe740('0x2d')][_0xe740('0x48')](_0x2c5d16['body'],{})[_0xe740('0x25')](respondWithResult(_0x47c960,0xc9))[_0xe740('0x49')](handleError(_0x47c960,null));};exports[_0xe740('0x24')]=function(_0x8989fd,_0x17f55e){if(_0x8989fd[_0xe740('0x4a')]['id']){delete _0x8989fd[_0xe740('0x4a')]['id'];}return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x8989fd[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x17f55e,null))['then'](saveUpdates(_0x8989fd[_0xe740('0x4a')],null))[_0xe740('0x25')](respondWithResult(_0x17f55e,null))['catch'](handleError(_0x17f55e,null));};exports[_0xe740('0x26')]=function(_0x108b9b,_0x2f7675){return db['Automation'][_0xe740('0x47')]({'where':{'id':_0x108b9b[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x2f7675,null))[_0xe740('0x25')](removeEntity(_0x2f7675,null))[_0xe740('0x49')](handleError(_0x2f7675,null));};exports[_0xe740('0x4b')]=function(_0x57a22e,_0x55d19a,_0x1e2915){return db[_0xe740('0x4c')][_0xe740('0x47')]({'where':{'id':_0x57a22e['params']['id']}})['then'](handleEntityNotFound(_0x55d19a,null))['then'](function(_0x5b3697){if(_0x5b3697){return _0x5b3697[_0xe740('0x4b')](_0x57a22e[_0xe740('0x4a')][_0xe740('0x4d')],_[_0xe740('0x4e')](_0x57a22e[_0xe740('0x4a')],['ids','id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x55d19a,null))['catch'](handleError(_0x55d19a,null));};exports[_0xe740('0x4f')]=function(_0x34a276,_0x5868fa,_0x2bc6c6){var _0x4c51c6={};var _0x163e49={};var _0x6baac7;var _0x2fb841;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x34a276[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x5868fa,null))['then'](function(_0x5f45ea){if(_0x5f45ea){_0x6baac7=_0x5f45ea;_0x163e49['model']=_[_0xe740('0x43')](db[_0xe740('0x4c')][_0xe740('0x2e')]);_0x163e49['query']=_[_0xe740('0x43')](_0x34a276[_0xe740('0x32')]);_0x163e49[_0xe740('0x33')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],_0x163e49['query']);_0x4c51c6[_0xe740('0x34')]=_[_0xe740('0x44')](_0x163e49[_0xe740('0x31')],qs[_0xe740('0x35')](_0x34a276[_0xe740('0x32')][_0xe740('0x35')]));_0x4c51c6[_0xe740('0x34')]=_0x4c51c6['attributes'][_0xe740('0x36')]?_0x4c51c6[_0xe740('0x34')]:_0x163e49[_0xe740('0x31')];_0x4c51c6[_0xe740('0x38')]=qs[_0xe740('0x39')](_0x34a276[_0xe740('0x32')][_0xe740('0x39')]);_0x4c51c6[_0xe740('0x3c')]=qs['filters'](_[_0xe740('0x3a')](_0x34a276['query'],_0x163e49[_0xe740('0x33')]));if(_0x34a276[_0xe740('0x32')][_0xe740('0x3b')]){_0x4c51c6[_0xe740('0x3c')]=_['merge'](_0x4c51c6['where'],{'$or':_[_0xe740('0x2c')](_0x4c51c6['attributes'],function(_0x259576){var _0x2df1a5={};_0x2df1a5[_0x259576]={'$like':'%'+_0x34a276['query']['filter']+'%'};return _0x2df1a5;})});}_0x4c51c6=_[_0xe740('0x3d')]({},_0x4c51c6,_0x34a276[_0xe740('0x46')]);return _0x6baac7[_0xe740('0x4f')](_0x4c51c6);}})['then'](function(_0x494117){if(_0x494117){_0x2fb841=_0x494117['length'];if(!_0x34a276[_0xe740('0x32')][_0xe740('0x37')](_0xe740('0x51'))){_0x4c51c6[_0xe740('0x20')]=qs['limit'](_0x34a276[_0xe740('0x32')][_0xe740('0x20')]);_0x4c51c6['offset']=qs[_0xe740('0x1e')](_0x34a276[_0xe740('0x32')][_0xe740('0x1e')]);}return _0x6baac7['getConditions'](_0x4c51c6);}})[_0xe740('0x25')](function(_0x2a9381){if(_0x2a9381){return _0x2a9381?{'count':_0x2fb841,'rows':_0x2a9381}:null;}})[_0xe740('0x25')](respondWithResult(_0x5868fa,null))[_0xe740('0x49')](handleError(_0x5868fa,null));};exports[_0xe740('0x52')]=function(_0x42ad66,_0x504e29,_0x5a7145){return db[_0xe740('0x53')][_0xe740('0x47')]({'where':{'id':_0x42ad66[_0xe740('0x42')]['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x504e29,null))[_0xe740('0x25')](function(_0x1db76d){if(_0x1db76d){return _0x1db76d['addActions'](_0x42ad66[_0xe740('0x4a')][_0xe740('0x4d')],_['omit'](_0x42ad66[_0xe740('0x4a')],[_0xe740('0x4d'),'id'])||{});}})[_0xe740('0x25')](respondWithResult(_0x504e29,null))[_0xe740('0x49')](handleError(_0x504e29,null));};exports[_0xe740('0x54')]=function(_0x37f482,_0x8df0e4,_0x16b686){var _0x25371a={};var _0x586310={};var _0x40fdf0;var _0x23bed4;return db[_0xe740('0x2d')][_0xe740('0x50')]({'where':{'id':_0x37f482['params']['id']}})[_0xe740('0x25')](handleEntityNotFound(_0x8df0e4,null))[_0xe740('0x25')](function(_0x568724){if(_0x568724){_0x40fdf0=_0x568724;_0x586310[_0xe740('0x31')]=_[_0xe740('0x43')](db[_0xe740('0x53')][_0xe740('0x2e')]);_0x586310[_0xe740('0x32')]=_[_0xe740('0x43')](_0x37f482[_0xe740('0x32')]);_0x586310[_0xe740('0x33')]=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],_0x586310[_0xe740('0x32')]);_0x25371a['attributes']=_[_0xe740('0x44')](_0x586310[_0xe740('0x31')],qs['fields'](_0x37f482[_0xe740('0x32')][_0xe740('0x35')]));_0x25371a[_0xe740('0x34')]=_0x25371a['attributes'][_0xe740('0x36')]?_0x25371a[_0xe740('0x34')]:_0x586310[_0xe740('0x31')];_0x25371a[_0xe740('0x38')]=qs['sort'](_0x37f482[_0xe740('0x32')][_0xe740('0x39')]);_0x25371a[_0xe740('0x3c')]=qs[_0xe740('0x33')](_[_0xe740('0x3a')](_0x37f482[_0xe740('0x32')],_0x586310[_0xe740('0x33')]));if(_0x37f482[_0xe740('0x32')][_0xe740('0x3b')]){_0x25371a[_0xe740('0x3c')]=_[_0xe740('0x3d')](_0x25371a['where'],{'$or':_[_0xe740('0x2c')](_0x25371a['attributes'],function(_0x4eca8c){var _0x2121eb={};_0x2121eb[_0x4eca8c]={'$like':'%'+_0x37f482['query'][_0xe740('0x3b')]+'%'};return _0x2121eb;})});}_0x25371a=_[_0xe740('0x3d')]({},_0x25371a,_0x37f482[_0xe740('0x46')]);return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x4c04d3){if(_0x4c04d3){_0x23bed4=_0x4c04d3['length'];if(!_0x37f482[_0xe740('0x32')]['hasOwnProperty']('nolimit')){_0x25371a['limit']=qs[_0xe740('0x20')](_0x37f482[_0xe740('0x32')][_0xe740('0x20')]);_0x25371a[_0xe740('0x1e')]=qs[_0xe740('0x1e')](_0x37f482['query']['offset']);}return _0x40fdf0[_0xe740('0x54')](_0x25371a);}})[_0xe740('0x25')](function(_0x5e5657){if(_0x5e5657){return _0x5e5657?{'count':_0x23bed4,'rows':_0x5e5657}:null;}})[_0xe740('0x25')](respondWithResult(_0x8df0e4,null))[_0xe740('0x49')](handleError(_0x8df0e4,null));};
\ No newline at end of file
+var _0x0f1b=['find','create','body','addConditions','Condition','omit','ids','findOne','pick','getConditions','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','Automation','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f1b,0x1b6));var _0xb0f1=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x0f1b[_0x122096];return _0x3d1966;};'use strict';var emlformat=require(_0xb0f1('0x0'));var rimraf=require(_0xb0f1('0x1'));var zipdir=require(_0xb0f1('0x2'));var jsonpatch=require(_0xb0f1('0x3'));var rp=require('request-promise');var moment=require(_0xb0f1('0x4'));var BPromise=require(_0xb0f1('0x5'));var Mustache=require(_0xb0f1('0x6'));var util=require(_0xb0f1('0x7'));var path=require(_0xb0f1('0x8'));var sox=require('sox');var csv=require(_0xb0f1('0x9'));var ejs=require(_0xb0f1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb0f1('0xb'));var squel=require(_0xb0f1('0xc'));var crypto=require(_0xb0f1('0xd'));var jsforce=require(_0xb0f1('0xe'));var deskjs=require(_0xb0f1('0xf'));var toCsv=require(_0xb0f1('0x9'));var querystring=require(_0xb0f1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb0f1('0x11'));var qs=require(_0xb0f1('0x12'));var as=require(_0xb0f1('0x13'));var hardwareService=require(_0xb0f1('0x14'));var logger=require('../../config/logger')(_0xb0f1('0x15'));var utils=require(_0xb0f1('0x16'));var config=require(_0xb0f1('0x17'));var licenseUtil=require(_0xb0f1('0x18'));var db=require(_0xb0f1('0x19'))['db'];function respondWithStatusCode(_0xe13e38,_0x453350){_0x453350=_0x453350||0xcc;return function(_0x15d8fd){if(_0x15d8fd){return _0xe13e38[_0xb0f1('0x1a')](_0x453350);}return _0xe13e38['status'](_0x453350)['end']();};}function respondWithResult(_0xd444ad,_0x12b615){_0x12b615=_0x12b615||0xc8;return function(_0x43eea8){if(_0x43eea8){return _0xd444ad[_0xb0f1('0x1b')](_0x12b615)[_0xb0f1('0x1c')](_0x43eea8);}};}function respondWithFilteredResult(_0x30334e,_0x368638){return function(_0x30dbe1){if(_0x30dbe1){var _0x5393cb=typeof _0x368638[_0xb0f1('0x1d')]==='undefined'&&typeof _0x368638[_0xb0f1('0x1e')]===_0xb0f1('0x1f');var _0xe6d50d=_0x30dbe1[_0xb0f1('0x20')];var _0x297a00=_0x5393cb?0x0:_0x368638[_0xb0f1('0x1d')];var _0x20b553=_0x5393cb?_0x30dbe1['count']:_0x368638[_0xb0f1('0x1d')]+_0x368638[_0xb0f1('0x1e')];var _0x150335;if(_0x20b553>=_0xe6d50d){_0x20b553=_0xe6d50d;_0x150335=0xc8;}else{_0x150335=0xce;}_0x30334e[_0xb0f1('0x1b')](_0x150335);return _0x30334e[_0xb0f1('0x21')](_0xb0f1('0x22'),_0x297a00+'-'+_0x20b553+'/'+_0xe6d50d)['json'](_0x30dbe1);}return null;};}function patchUpdates(_0x132e40){return function(_0x3c5211){try{jsonpatch[_0xb0f1('0x23')](_0x3c5211,_0x132e40,!![]);}catch(_0x3eba48){return BPromise['reject'](_0x3eba48);}return _0x3c5211[_0xb0f1('0x24')]();};}function saveUpdates(_0x31e418,_0xb459ba){return function(_0x1004cf){if(_0x1004cf){return _0x1004cf[_0xb0f1('0x25')](_0x31e418)['then'](function(_0x20a474){return _0x20a474;});}return null;};}function removeEntity(_0x37fcb8,_0xca9ab1){return function(_0x150e3b){if(_0x150e3b){return _0x150e3b[_0xb0f1('0x26')]()['then'](function(){_0x37fcb8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5119ea,_0x1ff4a4){return function(_0x1285b1){if(!_0x1285b1){_0x5119ea[_0xb0f1('0x1a')](0x194);}return _0x1285b1;};}function handleError(_0x5db15d,_0x46e56d){_0x46e56d=_0x46e56d||0x1f4;return function(_0x293566){logger['error'](_0x293566[_0xb0f1('0x27')]);if(_0x293566[_0xb0f1('0x28')]){delete _0x293566[_0xb0f1('0x28')];}_0x5db15d[_0xb0f1('0x1b')](_0x46e56d)[_0xb0f1('0x29')](_0x293566);};}exports[_0xb0f1('0x2a')]=function(_0x241843,_0x107c69){var _0x275a86={},_0x3a51cb={},_0x1f580b={'count':0x0,'rows':[]};var _0x43f93f=_[_0xb0f1('0x2b')](db['Automation']['rawAttributes'],function(_0x1027de){return{'name':_0x1027de[_0xb0f1('0x2c')],'type':_0x1027de['type'][_0xb0f1('0x2d')]};});_0x3a51cb[_0xb0f1('0x2e')]=_[_0xb0f1('0x2b')](_0x43f93f,'name');_0x3a51cb[_0xb0f1('0x2f')]=_[_0xb0f1('0x30')](_0x241843['query']);_0x3a51cb[_0xb0f1('0x31')]=_['intersection'](_0x3a51cb[_0xb0f1('0x2e')],_0x3a51cb[_0xb0f1('0x2f')]);_0x275a86[_0xb0f1('0x32')]=_['intersection'](_0x3a51cb[_0xb0f1('0x2e')],qs[_0xb0f1('0x33')](_0x241843['query'][_0xb0f1('0x33')]));_0x275a86[_0xb0f1('0x32')]=_0x275a86[_0xb0f1('0x32')]['length']?_0x275a86[_0xb0f1('0x32')]:_0x3a51cb[_0xb0f1('0x2e')];if(!_0x241843[_0xb0f1('0x2f')][_0xb0f1('0x34')](_0xb0f1('0x35'))){_0x275a86[_0xb0f1('0x1e')]=qs[_0xb0f1('0x1e')](_0x241843[_0xb0f1('0x2f')]['limit']);_0x275a86[_0xb0f1('0x1d')]=qs[_0xb0f1('0x1d')](_0x241843[_0xb0f1('0x2f')][_0xb0f1('0x1d')]);}_0x275a86[_0xb0f1('0x36')]=qs[_0xb0f1('0x37')](_0x241843['query'][_0xb0f1('0x37')]);_0x275a86[_0xb0f1('0x38')]=qs[_0xb0f1('0x31')](_['pick'](_0x241843[_0xb0f1('0x2f')],_0x3a51cb['filters']),_0x43f93f);if(_0x241843[_0xb0f1('0x2f')][_0xb0f1('0x39')]){_0x275a86[_0xb0f1('0x38')]=_[_0xb0f1('0x3a')](_0x275a86[_0xb0f1('0x38')],{'$or':_[_0xb0f1('0x2b')](_0x43f93f,function(_0x24d776){if(_0x24d776[_0xb0f1('0x3b')]!=='VIRTUAL'){var _0x1fdb1e={};_0x1fdb1e[_0x24d776[_0xb0f1('0x28')]]={'$like':'%'+_0x241843['query']['filter']+'%'};return _0x1fdb1e;}})});}_0x275a86=_[_0xb0f1('0x3a')]({},_0x275a86,_0x241843[_0xb0f1('0x3c')]);var _0x4bee0c={'where':_0x275a86[_0xb0f1('0x38')]};return db[_0xb0f1('0x3d')][_0xb0f1('0x20')](_0x4bee0c)[_0xb0f1('0x3e')](function(_0x1a6f51){_0x1f580b['count']=_0x1a6f51;if(_0x241843['query'][_0xb0f1('0x3f')]){_0x275a86[_0xb0f1('0x40')]=[{'all':!![]}];}return db[_0xb0f1('0x3d')][_0xb0f1('0x41')](_0x275a86);})[_0xb0f1('0x3e')](function(_0x5e1bad){_0x1f580b[_0xb0f1('0x42')]=_0x5e1bad;return _0x1f580b;})['then'](respondWithFilteredResult(_0x107c69,_0x275a86))[_0xb0f1('0x43')](handleError(_0x107c69,null));};exports['show']=function(_0x2aebe7,_0x24e262){var _0x2c14c7={'raw':![],'where':{'id':_0x2aebe7[_0xb0f1('0x44')]['id']}},_0x36c762={};_0x36c762[_0xb0f1('0x2e')]=_[_0xb0f1('0x30')](db[_0xb0f1('0x3d')][_0xb0f1('0x45')]);_0x36c762[_0xb0f1('0x2f')]=_['keys'](_0x2aebe7[_0xb0f1('0x2f')]);_0x36c762[_0xb0f1('0x31')]=_['intersection'](_0x36c762[_0xb0f1('0x2e')],_0x36c762[_0xb0f1('0x2f')]);_0x2c14c7[_0xb0f1('0x32')]=_[_0xb0f1('0x46')](_0x36c762[_0xb0f1('0x2e')],qs[_0xb0f1('0x33')](_0x2aebe7[_0xb0f1('0x2f')][_0xb0f1('0x33')]));_0x2c14c7[_0xb0f1('0x32')]=_0x2c14c7[_0xb0f1('0x32')][_0xb0f1('0x47')]?_0x2c14c7[_0xb0f1('0x32')]:_0x36c762[_0xb0f1('0x2e')];if(_0x2aebe7['query'][_0xb0f1('0x3f')]){_0x2c14c7[_0xb0f1('0x40')]=[{'all':!![]}];}_0x2c14c7=_[_0xb0f1('0x3a')]({},_0x2c14c7,_0x2aebe7[_0xb0f1('0x3c')]);return db['Automation'][_0xb0f1('0x48')](_0x2c14c7)[_0xb0f1('0x3e')](handleEntityNotFound(_0x24e262,null))[_0xb0f1('0x3e')](respondWithResult(_0x24e262,null))[_0xb0f1('0x43')](handleError(_0x24e262,null));};exports[_0xb0f1('0x49')]=function(_0x42fe87,_0x20918c){return db[_0xb0f1('0x3d')][_0xb0f1('0x49')](_0x42fe87[_0xb0f1('0x4a')],{})[_0xb0f1('0x3e')](respondWithResult(_0x20918c,0xc9))[_0xb0f1('0x43')](handleError(_0x20918c,null));};exports[_0xb0f1('0x25')]=function(_0x31da65,_0x4f3f1a){if(_0x31da65[_0xb0f1('0x4a')]['id']){delete _0x31da65[_0xb0f1('0x4a')]['id'];}return db['Automation'][_0xb0f1('0x48')]({'where':{'id':_0x31da65['params']['id']}})[_0xb0f1('0x3e')](handleEntityNotFound(_0x4f3f1a,null))[_0xb0f1('0x3e')](saveUpdates(_0x31da65[_0xb0f1('0x4a')],null))['then'](respondWithResult(_0x4f3f1a,null))['catch'](handleError(_0x4f3f1a,null));};exports[_0xb0f1('0x26')]=function(_0x5d880b,_0x316f29){return db[_0xb0f1('0x3d')][_0xb0f1('0x48')]({'where':{'id':_0x5d880b[_0xb0f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x316f29,null))[_0xb0f1('0x3e')](removeEntity(_0x316f29,null))[_0xb0f1('0x43')](handleError(_0x316f29,null));};exports[_0xb0f1('0x4b')]=function(_0x4671d5,_0x44de0d,_0x3afb7f){return db[_0xb0f1('0x4c')]['find']({'where':{'id':_0x4671d5['params']['id']}})['then'](handleEntityNotFound(_0x44de0d,null))['then'](function(_0x401193){if(_0x401193){return _0x401193['addConditions'](_0x4671d5[_0xb0f1('0x4a')]['ids'],_[_0xb0f1('0x4d')](_0x4671d5[_0xb0f1('0x4a')],[_0xb0f1('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x44de0d,null))[_0xb0f1('0x43')](handleError(_0x44de0d,null));};exports['getConditions']=function(_0x4fad2e,_0xb95d33,_0x502f9e){var _0x191f86={};var _0x1341d9={};var _0x43293b;var _0x5e68b7;return db[_0xb0f1('0x3d')][_0xb0f1('0x4f')]({'where':{'id':_0x4fad2e[_0xb0f1('0x44')]['id']}})[_0xb0f1('0x3e')](handleEntityNotFound(_0xb95d33,null))[_0xb0f1('0x3e')](function(_0x4e07f6){if(_0x4e07f6){_0x43293b=_0x4e07f6;_0x1341d9[_0xb0f1('0x2e')]=_[_0xb0f1('0x30')](db[_0xb0f1('0x4c')][_0xb0f1('0x45')]);_0x1341d9[_0xb0f1('0x2f')]=_[_0xb0f1('0x30')](_0x4fad2e[_0xb0f1('0x2f')]);_0x1341d9[_0xb0f1('0x31')]=_[_0xb0f1('0x46')](_0x1341d9[_0xb0f1('0x2e')],_0x1341d9['query']);_0x191f86[_0xb0f1('0x32')]=_[_0xb0f1('0x46')](_0x1341d9['model'],qs[_0xb0f1('0x33')](_0x4fad2e[_0xb0f1('0x2f')]['fields']));_0x191f86['attributes']=_0x191f86[_0xb0f1('0x32')][_0xb0f1('0x47')]?_0x191f86[_0xb0f1('0x32')]:_0x1341d9['model'];_0x191f86[_0xb0f1('0x36')]=qs[_0xb0f1('0x37')](_0x4fad2e[_0xb0f1('0x2f')][_0xb0f1('0x37')]);_0x191f86[_0xb0f1('0x38')]=qs[_0xb0f1('0x31')](_[_0xb0f1('0x50')](_0x4fad2e[_0xb0f1('0x2f')],_0x1341d9[_0xb0f1('0x31')]));if(_0x4fad2e[_0xb0f1('0x2f')][_0xb0f1('0x39')]){_0x191f86[_0xb0f1('0x38')]=_[_0xb0f1('0x3a')](_0x191f86['where'],{'$or':_[_0xb0f1('0x2b')](_0x191f86[_0xb0f1('0x32')],function(_0x16f82e){var _0x40b4e6={};_0x40b4e6[_0x16f82e]={'$like':'%'+_0x4fad2e[_0xb0f1('0x2f')][_0xb0f1('0x39')]+'%'};return _0x40b4e6;})});}_0x191f86=_[_0xb0f1('0x3a')]({},_0x191f86,_0x4fad2e[_0xb0f1('0x3c')]);return _0x43293b[_0xb0f1('0x51')](_0x191f86);}})[_0xb0f1('0x3e')](function(_0x5522ad){if(_0x5522ad){_0x5e68b7=_0x5522ad[_0xb0f1('0x47')];if(!_0x4fad2e[_0xb0f1('0x2f')][_0xb0f1('0x34')](_0xb0f1('0x35'))){_0x191f86[_0xb0f1('0x1e')]=qs[_0xb0f1('0x1e')](_0x4fad2e[_0xb0f1('0x2f')][_0xb0f1('0x1e')]);_0x191f86[_0xb0f1('0x1d')]=qs[_0xb0f1('0x1d')](_0x4fad2e[_0xb0f1('0x2f')]['offset']);}return _0x43293b['getConditions'](_0x191f86);}})['then'](function(_0x21914e){if(_0x21914e){return _0x21914e?{'count':_0x5e68b7,'rows':_0x21914e}:null;}})[_0xb0f1('0x3e')](respondWithResult(_0xb95d33,null))[_0xb0f1('0x43')](handleError(_0xb95d33,null));};exports['addActions']=function(_0x27b903,_0x247f40,_0x2014b4){return db[_0xb0f1('0x52')][_0xb0f1('0x48')]({'where':{'id':_0x27b903[_0xb0f1('0x44')]['id']}})[_0xb0f1('0x3e')](handleEntityNotFound(_0x247f40,null))[_0xb0f1('0x3e')](function(_0x2a6d4f){if(_0x2a6d4f){return _0x2a6d4f[_0xb0f1('0x53')](_0x27b903[_0xb0f1('0x4a')][_0xb0f1('0x4e')],_['omit'](_0x27b903['body'],[_0xb0f1('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x247f40,null))[_0xb0f1('0x43')](handleError(_0x247f40,null));};exports[_0xb0f1('0x54')]=function(_0x10fe08,_0x45f504,_0x5502e2){var _0x55b21e={};var _0x5b3b0e={};var _0x3c25d6;var _0x52cc66;return db['Automation']['findOne']({'where':{'id':_0x10fe08[_0xb0f1('0x44')]['id']}})[_0xb0f1('0x3e')](handleEntityNotFound(_0x45f504,null))[_0xb0f1('0x3e')](function(_0x14ff23){if(_0x14ff23){_0x3c25d6=_0x14ff23;_0x5b3b0e[_0xb0f1('0x2e')]=_[_0xb0f1('0x30')](db[_0xb0f1('0x52')]['rawAttributes']);_0x5b3b0e[_0xb0f1('0x2f')]=_['keys'](_0x10fe08[_0xb0f1('0x2f')]);_0x5b3b0e[_0xb0f1('0x31')]=_[_0xb0f1('0x46')](_0x5b3b0e[_0xb0f1('0x2e')],_0x5b3b0e[_0xb0f1('0x2f')]);_0x55b21e['attributes']=_[_0xb0f1('0x46')](_0x5b3b0e[_0xb0f1('0x2e')],qs[_0xb0f1('0x33')](_0x10fe08[_0xb0f1('0x2f')][_0xb0f1('0x33')]));_0x55b21e[_0xb0f1('0x32')]=_0x55b21e['attributes']['length']?_0x55b21e[_0xb0f1('0x32')]:_0x5b3b0e[_0xb0f1('0x2e')];_0x55b21e[_0xb0f1('0x36')]=qs[_0xb0f1('0x37')](_0x10fe08[_0xb0f1('0x2f')][_0xb0f1('0x37')]);_0x55b21e[_0xb0f1('0x38')]=qs['filters'](_['pick'](_0x10fe08[_0xb0f1('0x2f')],_0x5b3b0e[_0xb0f1('0x31')]));if(_0x10fe08['query'][_0xb0f1('0x39')]){_0x55b21e['where']=_[_0xb0f1('0x3a')](_0x55b21e[_0xb0f1('0x38')],{'$or':_[_0xb0f1('0x2b')](_0x55b21e[_0xb0f1('0x32')],function(_0x453d62){var _0x200ded={};_0x200ded[_0x453d62]={'$like':'%'+_0x10fe08['query'][_0xb0f1('0x39')]+'%'};return _0x200ded;})});}_0x55b21e=_['merge']({},_0x55b21e,_0x10fe08[_0xb0f1('0x3c')]);return _0x3c25d6['getActions'](_0x55b21e);}})[_0xb0f1('0x3e')](function(_0x57c9e7){if(_0x57c9e7){_0x52cc66=_0x57c9e7[_0xb0f1('0x47')];if(!_0x10fe08['query'][_0xb0f1('0x34')](_0xb0f1('0x35'))){_0x55b21e[_0xb0f1('0x1e')]=qs[_0xb0f1('0x1e')](_0x10fe08[_0xb0f1('0x2f')][_0xb0f1('0x1e')]);_0x55b21e['offset']=qs['offset'](_0x10fe08['query']['offset']);}return _0x3c25d6[_0xb0f1('0x54')](_0x55b21e);}})[_0xb0f1('0x3e')](function(_0x371744){if(_0x371744){return _0x371744?{'count':_0x52cc66,'rows':_0x371744}:null;}})['then'](respondWithResult(_0x45f504,null))['catch'](handleError(_0x45f504,null));};
\ No newline at end of file
index c9b5e4a..fee9730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06b3=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Automation','lodash'];(function(_0x2299c8,_0xacd528){var _0x151013=function(_0x270d0b){while(--_0x270d0b){_0x2299c8['push'](_0x2299c8['shift']());}};_0x151013(++_0xacd528);}(_0x06b3,0x15f));var _0x306b=function(_0x30040c,_0x2f8c29){_0x30040c=_0x30040c-0x0;var _0x5b0204=_0x06b3[_0x30040c];return _0x5b0204;};'use strict';var _=require(_0x306b('0x0'));var util=require(_0x306b('0x1'));var logger=require(_0x306b('0x2'))(_0x306b('0x3'));var moment=require('moment');var BPromise=require(_0x306b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x306b('0x5'));var rimraf=require(_0x306b('0x6'));var config=require(_0x306b('0x7'));var attributes=require('./automation.attributes');module[_0x306b('0x8')]=function(_0x249d02,_0x12814c){return _0x249d02[_0x306b('0x9')](_0x306b('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d68=['path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','api','moment','request-promise'];(function(_0x4cce8,_0x22d1fe){var _0x458440=function(_0x3d15e4){while(--_0x3d15e4){_0x4cce8['push'](_0x4cce8['shift']());}};_0x458440(++_0x22d1fe);}(_0x7d68,0x1b7));var _0x87d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x87d6('0x0'));var util=require(_0x87d6('0x1'));var logger=require('../../config/logger')(_0x87d6('0x2'));var moment=require(_0x87d6('0x3'));var BPromise=require('bluebird');var rp=require(_0x87d6('0x4'));var fs=require('fs');var path=require(_0x87d6('0x5'));var rimraf=require(_0x87d6('0x6'));var config=require(_0x87d6('0x7'));var attributes=require(_0x87d6('0x8'));module[_0x87d6('0x9')]=function(_0x4378d8,_0x5a4426){return _0x4378d8['define'](_0x87d6('0xa'),attributes,{'tableName':_0x87d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4a8e89..b699668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5454=['stringify','error','code','message','result','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5454,0x15b));var _0x4545=function(_0x281ea8,_0x46e40c){_0x281ea8=_0x281ea8-0x0;var _0x786282=_0x5454[_0x281ea8];return _0x786282;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x4545('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4545('0x1'));var logger=require(_0x4545('0x2'))(_0x4545('0x3'));var config=require(_0x4545('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4545('0x5')][_0x4545('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x6fd3bb,_0xc79c57,_0x3f1134){return new BPromise(function(_0x1fd7e5,_0x1c5649){return client[_0x4545('0x7')](_0x6fd3bb,_0x3f1134)[_0x4545('0x8')](function(_0x3e2526){logger[_0x4545('0x9')](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));logger['debug'](_0x4545('0xc'),_0xc79c57,_0x4545('0xb'),JSON[_0x4545('0xd')](_0x3e2526));if(_0x3e2526[_0x4545('0xe')]){if(_0x3e2526[_0x4545('0xe')][_0x4545('0xf')]===0x1f4){logger['error'](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1c5649(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);return _0x1fd7e5(_0x3e2526[_0x4545('0xe')][_0x4545('0x10')]);}else{logger['info'](_0x4545('0xa'),_0xc79c57,_0x4545('0xb'));_0x1fd7e5(_0x3e2526[_0x4545('0x11')][_0x4545('0x10')]);}})['catch'](function(_0x4a5bdf){logger[_0x4545('0xe')](_0x4545('0xa'),_0xc79c57,_0x4a5bdf);_0x1c5649(_0x4a5bdf);});});}
\ No newline at end of file
+var _0xf08c=['jayson/promise','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x146eed,_0x547c97){var _0x17cdc4=function(_0xeac53){while(--_0xeac53){_0x146eed['push'](_0x146eed['shift']());}};_0x17cdc4(++_0x547c97);}(_0xf08c,0xb5));var _0xcf08=function(_0x5d2d52,_0xca01d0){_0x5d2d52=_0x5d2d52-0x0;var _0x514d0a=_0xf08c[_0x5d2d52];return _0x514d0a;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var moment=require(_0xcf08('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf08('0x3'));var fs=require('fs');var Redis=require(_0xcf08('0x4'));var db=require(_0xcf08('0x5'))['db'];var utils=require(_0xcf08('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf08('0x7'));var jayson=require(_0xcf08('0x8'));var client=jayson['client'][_0xcf08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37efab,_0x13b89c,_0x42c7b0){return new BPromise(function(_0x59d6d6,_0x5044bb){return client[_0xcf08('0xa')](_0x37efab,_0x42c7b0)['then'](function(_0x1ab45d){logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));logger['debug'](_0xcf08('0xe'),_0x13b89c,_0xcf08('0xd'),JSON[_0xcf08('0xf')](_0x1ab45d));if(_0x1ab45d[_0xcf08('0x10')]){if(_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x11')]===0x1f4){logger[_0xcf08('0x10')](_0xcf08('0xc'),_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x5044bb(_0x1ab45d[_0xcf08('0x10')]['message']);}logger['error']('Automation,\x20%s,\x20%s',_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x59d6d6(_0x1ab45d['error'][_0xcf08('0x12')]);}else{logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));_0x59d6d6(_0x1ab45d[_0xcf08('0x13')]['message']);}})[_0xcf08('0x14')](function(_0x5d89a7){logger['error'](_0xcf08('0xc'),_0x13b89c,_0x5d89a7);_0x5044bb(_0x5d89a7);});});}
\ No newline at end of file
index 44d0ed1..e6a6b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fdc=['put','multer','util','connect-timeout','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','addConditions','addActions'];(function(_0x3806e8,_0x5f43ce){var _0x35bc99=function(_0xf5e039){while(--_0xf5e039){_0x3806e8['push'](_0x3806e8['shift']());}};_0x35bc99(++_0x5f43ce);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x33154d,_0x854047){_0x33154d=_0x33154d-0x0;var _0x3b2f03=_0x1fdc[_0x33154d];return _0x3b2f03;};'use strict';var multer=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var path=require('path');var timeout=require(_0xc1fd('0x2'));var express=require(_0xc1fd('0x3'));var router=express[_0xc1fd('0x4')]();var fs_extra=require(_0xc1fd('0x5'));var auth=require(_0xc1fd('0x6'));var interaction=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var controller=require('./automation.controller');router[_0xc1fd('0x9')]('/',auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xb')]);router[_0xc1fd('0x9')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xd')]);router[_0xc1fd('0x9')](_0xc1fd('0xe'),auth[_0xc1fd('0xa')](),controller[_0xc1fd('0xf')]);router[_0xc1fd('0x9')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x11')]);router[_0xc1fd('0x12')]('/',auth['isAuthenticated'](),controller[_0xc1fd('0x13')]);router['post'](_0xc1fd('0xe'),auth['isAuthenticated'](),controller[_0xc1fd('0x14')]);router[_0xc1fd('0x12')](_0xc1fd('0x10'),auth['isAuthenticated'](),controller[_0xc1fd('0x15')]);router[_0xc1fd('0x16')](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['update']);router['delete'](_0xc1fd('0xc'),auth[_0xc1fd('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd765=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','getConditions','/:id/actions','post','create','put'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xd765,0xdf));var _0x5d76=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd765[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var path=require(_0x5d76('0x2'));var timeout=require(_0x5d76('0x3'));var express=require(_0x5d76('0x4'));var router=express[_0x5d76('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d76('0x7'));var controller=require(_0x5d76('0x8'));router['get']('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0xa')]);router[_0x5d76('0xb')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0xd')]);router['get']('/:id/conditions',auth[_0x5d76('0x9')](),controller[_0x5d76('0xe')]);router[_0x5d76('0xb')](_0x5d76('0xf'),auth['isAuthenticated'](),controller['getActions']);router[_0x5d76('0x10')]('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0x11')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x5d76('0x10')](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller['addActions']);router[_0x5d76('0x12')](_0x5d76('0xc'),auth['isAuthenticated'](),controller[_0x5d76('0x13')]);router[_0x5d76('0x14')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x15')]);module['exports']=router;
\ No newline at end of file
index ba79688..b287aa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0b1=['Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr'];(function(_0x17bcc8,_0x3dac2f){var _0x5854aa=function(_0x2fb8a9){while(--_0x2fb8a9){_0x17bcc8['push'](_0x17bcc8['shift']());}};_0x5854aa(++_0x3dac2f);}(_0xc0b1,0x1b3));var _0x1c0b=function(_0x260ce2,_0x2e22b8){_0x260ce2=_0x260ce2-0x0;var _0x16b105=_0xc0b1[_0x260ce2];return _0x16b105;};'use strict';var Sequelize=require('sequelize');module[_0x1c0b('0x0')]={'name':{'type':Sequelize[_0x1c0b('0x1')],'unique':_0x1c0b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x4')),'allowNull':![],'defaultValue':_0x1c0b('0x4')},'description':{'type':Sequelize[_0x1c0b('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1c0b('0x5')},'limitCalls':{'type':Sequelize[_0x1c0b('0x6')](0x4)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1c0b('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c0b('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1c0b('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c0b('0xe')},'dialTimezone':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1c0b('0x1')],'defaultValue':_0x1c0b('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1c0b('0x3')](_0x1c0b('0x10'),_0x1c0b('0x11'),_0x1c0b('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1c0b('0x13')],'defaultValue':0x0,'comment':_0x1c0b('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c0b('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c0b('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)[_0x1c0b('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1c0b('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c0b('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c0b('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1c0b('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1c0b('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1c0b('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1c0b('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c0b('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1c0b('0x3')]('DESC',_0x1c0b('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c0b('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1e')},'dialCutDigit':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c0b('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c0b('0x6')](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0x1c0b('0x6')](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1c0b('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c0b('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c0b('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c0b('0x27')}};
\ No newline at end of file
+var _0xd635=['exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','UNSIGNED','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize'];(function(_0x39fc0a,_0x739d7a){var _0x35013f=function(_0x5e786b){while(--_0x5e786b){_0x39fc0a['push'](_0x39fc0a['shift']());}};_0x35013f(++_0x739d7a);}(_0xd635,0x18b));var _0x5d63=function(_0x6da7fd,_0x194362){_0x6da7fd=_0x6da7fd-0x0;var _0x4a37cc=_0xd635[_0x6da7fd];return _0x4a37cc;};'use strict';var Sequelize=require(_0x5d63('0x0'));module[_0x5d63('0x1')]={'name':{'type':Sequelize[_0x5d63('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5d63('0x3')]('ivr'),'allowNull':![],'defaultValue':_0x5d63('0x4')},'description':{'type':Sequelize[_0x5d63('0x2')]},'active':{'type':Sequelize[_0x5d63('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5d63('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5d63('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5d63('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5d63('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d63('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d63('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5d63('0xd')},'dialTimezone':{'type':Sequelize[_0x5d63('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5d63('0x2')],'defaultValue':_0x5d63('0xe')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x5d63('0xf'),_0x5d63('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5d63('0x5')],'defaultValue':0x0,'comment':_0x5d63('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5d63('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5d63('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5d63('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5d63('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5d63('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5d63('0x6')](0x9)[_0x5d63('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5d63('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5d63('0x3')]('DESC',_0x5d63('0x16')),'defaultValue':_0x5d63('0x17')},'dialPrefix':{'type':Sequelize[_0x5d63('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5d63('0x6')](0x3)[_0x5d63('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d63('0x18')},'dialCutDigit':{'type':Sequelize[_0x5d63('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5d63('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d63('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)[_0x5d63('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5d63('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5d63('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5d63('0x6')](0x5)[_0x5d63('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5d63('0x20')}};
\ No newline at end of file
index f15b219..d19987d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87e4=['CampaignId\x20=\x20?','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','Campaign','include','findAll','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','user','IvrCampaigns','userProfileId','getHoppers','findOne','CampaignId','filter','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)'];(function(_0x55d089,_0x52aa76){var _0x1406de=function(_0x4d68ca){while(--_0x4d68ca){_0x55d089['push'](_0x55d089['shift']());}};_0x1406de(++_0x52aa76);}(_0x87e4,0x8e));var _0x487e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x87e4[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0x487e('0x0'));var rimraf=require(_0x487e('0x1'));var zipdir=require(_0x487e('0x2'));var jsonpatch=require(_0x487e('0x3'));var rp=require(_0x487e('0x4'));var moment=require(_0x487e('0x5'));var BPromise=require(_0x487e('0x6'));var Mustache=require(_0x487e('0x7'));var util=require(_0x487e('0x8'));var path=require(_0x487e('0x9'));var sox=require(_0x487e('0xa'));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('squel');var crypto=require(_0x487e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x487e('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x487e('0xd'));var qs=require(_0x487e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x487e('0xf'))(_0x487e('0x10'));var utils=require(_0x487e('0x11'));var config=require(_0x487e('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20ffba,_0x2ee4d5){_0x2ee4d5=_0x2ee4d5||0xcc;return function(_0x286794){if(_0x286794){return _0x20ffba['sendStatus'](_0x2ee4d5);}return _0x20ffba[_0x487e('0x13')](_0x2ee4d5)[_0x487e('0x14')]();};}function respondWithResult(_0x95af3d,_0x1c5fc4){_0x1c5fc4=_0x1c5fc4||0xc8;return function(_0x2a5a43){if(_0x2a5a43){return _0x95af3d[_0x487e('0x13')](_0x1c5fc4)[_0x487e('0x15')](_0x2a5a43);}};}function respondWithFilteredResult(_0x6dcae,_0x574d4e){return function(_0xa0611a){if(_0xa0611a){var _0x2a9e33=typeof _0x574d4e[_0x487e('0x16')]===_0x487e('0x17')&&typeof _0x574d4e[_0x487e('0x18')]==='undefined';var _0x493b28=_0xa0611a[_0x487e('0x19')];var _0x1daa1a=_0x2a9e33?0x0:_0x574d4e[_0x487e('0x16')];var _0xc5a457=_0x2a9e33?_0xa0611a[_0x487e('0x19')]:_0x574d4e[_0x487e('0x16')]+_0x574d4e['limit'];var _0x1dc264;if(_0xc5a457>=_0x493b28){_0xc5a457=_0x493b28;_0x1dc264=0xc8;}else{_0x1dc264=0xce;}_0x6dcae[_0x487e('0x13')](_0x1dc264);return _0x6dcae['set'](_0x487e('0x1a'),_0x1daa1a+'-'+_0xc5a457+'/'+_0x493b28)[_0x487e('0x15')](_0xa0611a);}return null;};}function patchUpdates(_0x30bc7d){return function(_0xe34c5c){try{jsonpatch['apply'](_0xe34c5c,_0x30bc7d,!![]);}catch(_0x284e01){return BPromise[_0x487e('0x1b')](_0x284e01);}return _0xe34c5c['save']();};}function saveUpdates(_0x3f5ae5,_0x223b32){return function(_0xa67cdc){if(_0xa67cdc){return _0xa67cdc[_0x487e('0x1c')](_0x3f5ae5)[_0x487e('0x1d')](function(_0x1e1410){return _0x1e1410;});}return null;};}function removeEntity(_0x558471,_0x2cd4ba){return function(_0x29f2ff){if(_0x29f2ff){return _0x29f2ff[_0x487e('0x1e')]()[_0x487e('0x1d')](function(){var _0x3afd18=_0x29f2ff['get']({'plain':!![]});var _0x20dc6c='IvrCampaigns';return db['UserProfileResource'][_0x487e('0x1e')]({'where':{'type':_0x20dc6c,'resourceId':_0x3afd18['id']}})[_0x487e('0x1d')](function(){return _0x29f2ff;});})[_0x487e('0x1d')](function(){_0x558471[_0x487e('0x13')](0xcc)[_0x487e('0x14')]();});}};}function handleEntityNotFound(_0xfa5a26,_0x7913a1){return function(_0x38d513){if(!_0x38d513){_0xfa5a26['sendStatus'](0x194);}return _0x38d513;};}function handleError(_0x2af344,_0x284822){_0x284822=_0x284822||0x1f4;return function(_0x756839){logger[_0x487e('0x1f')](_0x756839[_0x487e('0x20')]);if(_0x756839[_0x487e('0x21')]){delete _0x756839[_0x487e('0x21')];}_0x2af344['status'](_0x284822)['send'](_0x756839);};}exports[_0x487e('0x22')]=function(_0x4c31e2,_0x1d7807){var _0x5b9ba0={},_0x3ea044={},_0x165ae3={'count':0x0,'rows':[]};var _0x27253c=_[_0x487e('0x23')](db['Campaign'][_0x487e('0x24')],function(_0x572514){return{'name':_0x572514[_0x487e('0x25')],'type':_0x572514['type'][_0x487e('0x26')]};});_0x3ea044['model']=_[_0x487e('0x23')](_0x27253c,'name');_0x3ea044['query']=_[_0x487e('0x27')](_0x4c31e2[_0x487e('0x28')]);_0x3ea044[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],_0x3ea044[_0x487e('0x28')]);_0x5b9ba0[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3ea044[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x4c31e2['query'][_0x487e('0x2d')]));_0x5b9ba0[_0x487e('0x2c')]=_0x5b9ba0[_0x487e('0x2c')][_0x487e('0x2e')]?_0x5b9ba0[_0x487e('0x2c')]:_0x3ea044[_0x487e('0x2b')];if(!_0x4c31e2[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x5b9ba0[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4c31e2[_0x487e('0x28')][_0x487e('0x18')]);_0x5b9ba0[_0x487e('0x16')]=qs['offset'](_0x4c31e2[_0x487e('0x28')]['offset']);}_0x5b9ba0['order']=qs[_0x487e('0x31')](_0x4c31e2[_0x487e('0x28')]['sort']);_0x5b9ba0[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4c31e2['query'],_0x3ea044['filters']),_0x27253c);if(_0x4c31e2[_0x487e('0x28')]['filter']){_0x5b9ba0[_0x487e('0x32')]=_[_0x487e('0x34')](_0x5b9ba0[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x27253c,function(_0x51b138){if(_0x51b138[_0x487e('0x35')]!==_0x487e('0x36')){var _0x4cb9a6={};_0x4cb9a6[_0x51b138['name']]={'$like':'%'+_0x4c31e2['query']['filter']+'%'};return _0x4cb9a6;}})});}_0x5b9ba0=_[_0x487e('0x34')]({},_0x5b9ba0,_0x4c31e2[_0x487e('0x37')]);var _0x1b4a78={'where':_0x5b9ba0[_0x487e('0x32')]};return db[_0x487e('0x38')]['count'](_0x1b4a78)[_0x487e('0x1d')](function(_0x34c842){_0x165ae3[_0x487e('0x19')]=_0x34c842;if(_0x4c31e2[_0x487e('0x28')]['includeAll']){_0x5b9ba0[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x38')][_0x487e('0x3a')](_0x5b9ba0);})['then'](function(_0x1d92f4){_0x165ae3[_0x487e('0x3b')]=_0x1d92f4;return _0x165ae3;})[_0x487e('0x1d')](respondWithFilteredResult(_0x1d7807,_0x5b9ba0))['catch'](handleError(_0x1d7807,null));};exports[_0x487e('0x3c')]=function(_0x1ec6b0,_0x55cfd6){var _0x35f1cd={'raw':![],'where':{'id':_0x1ec6b0[_0x487e('0x3d')]['id']}},_0x216709={};_0x216709['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x216709['query']=_[_0x487e('0x27')](_0x1ec6b0['query']);_0x216709[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],_0x216709[_0x487e('0x28')]);_0x35f1cd[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x216709[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x1ec6b0[_0x487e('0x28')][_0x487e('0x2d')]));_0x35f1cd[_0x487e('0x2c')]=_0x35f1cd[_0x487e('0x2c')][_0x487e('0x2e')]?_0x35f1cd['attributes']:_0x216709[_0x487e('0x2b')];if(_0x1ec6b0[_0x487e('0x28')][_0x487e('0x3e')]){_0x35f1cd[_0x487e('0x39')]=[{'all':!![]}];}_0x35f1cd=_[_0x487e('0x34')]({},_0x35f1cd,_0x1ec6b0['options']);return db[_0x487e('0x38')][_0x487e('0x3f')](_0x35f1cd)[_0x487e('0x1d')](handleEntityNotFound(_0x55cfd6,null))[_0x487e('0x1d')](respondWithResult(_0x55cfd6,null))[_0x487e('0x40')](handleError(_0x55cfd6,null));};exports[_0x487e('0x41')]=function(_0x4482ee,_0x25fab7){return db[_0x487e('0x38')][_0x487e('0x41')](_0x4482ee['body'],{})['then'](function(_0x12fe88){var _0x1cd66d=_0x4482ee['user'][_0x487e('0x42')]({'plain':!![]});if(!_0x1cd66d)throw new Error(_0x487e('0x43'));if(_0x1cd66d[_0x487e('0x44')]==='user'){var _0x3791d9=_0x12fe88['get']({'plain':!![]});var _0x23c54c='IvrCampaigns';return db[_0x487e('0x45')][_0x487e('0x3f')]({'where':{'name':_0x23c54c,'userProfileId':_0x1cd66d['userProfileId']},'raw':!![]})[_0x487e('0x1d')](function(_0x543a2e){if(_0x543a2e&&_0x543a2e[_0x487e('0x46')]===0x0){return db[_0x487e('0x47')][_0x487e('0x41')]({'name':_0x3791d9[_0x487e('0x21')],'resourceId':_0x3791d9['id'],'type':_0x543a2e[_0x487e('0x21')],'sectionId':_0x543a2e['id']},{})['then'](function(){return _0x12fe88;});}else{return _0x12fe88;}})[_0x487e('0x40')](function(_0x1e4c23){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x1e4c23);throw _0x1e4c23;});}return _0x12fe88;})['then'](respondWithResult(_0x25fab7,0xc9))[_0x487e('0x40')](handleError(_0x25fab7,null));};exports[_0x487e('0x49')]=function(_0x6334b4,_0x121e3c){var _0x512af7={'where':{'id':_0x6334b4[_0x487e('0x3d')]['id']}},_0x2da6de={};_0x2da6de['model']=_[_0x487e('0x27')](db[_0x487e('0x38')][_0x487e('0x24')]);_0x512af7[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x2da6de['model'],qs[_0x487e('0x2d')](_0x6334b4[_0x487e('0x28')]['fields']));_0x512af7[_0x487e('0x2c')]=_0x512af7[_0x487e('0x2c')]['length']?_0x512af7[_0x487e('0x2c')]:_0x2da6de['model'];if(_0x6334b4[_0x487e('0x28')]['includeAll']){_0x512af7[_0x487e('0x39')]=[{'all':!![]}];}_0x512af7=_['merge']({},_0x512af7,_0x6334b4[_0x487e('0x37')]);return db['Campaign']['find'](_0x512af7)[_0x487e('0x1d')](handleEntityNotFound(_0x121e3c,null))[_0x487e('0x1d')](function(_0x58c2a3){if(_0x58c2a3){var _0x4b6c32=_0x58c2a3['get']({'plain':!![]});_0x4b6c32=qs['omit'](_0x4b6c32,['id','createdAt',_0x487e('0x4a')]);_0x6334b4[_0x487e('0x4b')]=_[_0x487e('0x4c')](_0x6334b4[_0x487e('0x4b')],['id',_0x487e('0x4d'),'updatedAt']);return db[_0x487e('0x38')][_0x487e('0x41')](_[_0x487e('0x34')](_0x4b6c32,_0x6334b4[_0x487e('0x4b')]),{'include':_0x6334b4[_0x487e('0x28')]['includeAll']?[{'all':!![]}]:undefined})[_0x487e('0x1d')](function(_0x1c9de2){var _0xceac80=_0x6334b4['user']['get']({'plain':!![]});if(!_0xceac80)throw new Error(_0x487e('0x43'));if(_0xceac80[_0x487e('0x44')]===_0x487e('0x4e')){var _0x204fa9=_0x1c9de2[_0x487e('0x42')]({'plain':!![]});var _0xc5202f=_0x487e('0x4f');return db[_0x487e('0x45')]['find']({'where':{'name':_0xc5202f,'userProfileId':_0xceac80[_0x487e('0x50')]},'raw':!![]})[_0x487e('0x1d')](function(_0x140d7b){if(_0x140d7b&&_0x140d7b[_0x487e('0x46')]===0x0){return db['UserProfileResource'][_0x487e('0x41')]({'name':_0x204fa9[_0x487e('0x21')],'resourceId':_0x204fa9['id'],'type':_0x140d7b[_0x487e('0x21')],'sectionId':_0x140d7b['id']},{})[_0x487e('0x1d')](function(){return _0x1c9de2;});}else{return _0x1c9de2;}})[_0x487e('0x40')](function(_0x18d24b){logger[_0x487e('0x1f')](_0x487e('0x48'),_0x18d24b);throw _0x18d24b;});}return _0x1c9de2;});}})[_0x487e('0x1d')](respondWithResult(_0x121e3c,0xc9))['catch'](handleError(_0x121e3c,null));};exports[_0x487e('0x1c')]=function(_0x486a10,_0x431370){if(_0x486a10['body']['id']){delete _0x486a10[_0x487e('0x4b')]['id'];}return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x486a10[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x431370,null))[_0x487e('0x1d')](saveUpdates(_0x486a10[_0x487e('0x4b')],null))[_0x487e('0x1d')](respondWithResult(_0x431370,null))[_0x487e('0x40')](handleError(_0x431370,null));};exports['destroy']=function(_0x3f30de,_0x211d2e){return db['Campaign'][_0x487e('0x3f')]({'where':{'id':_0x3f30de[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x211d2e,null))[_0x487e('0x1d')](removeEntity(_0x211d2e,null))[_0x487e('0x40')](handleError(_0x211d2e,null));};exports[_0x487e('0x51')]=function(_0x4cb3f6,_0x1ab190,_0x18898f){var _0x57ecb5={'raw':!![],'where':{}};var _0x1d672b={};var _0x14e0d7={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x4cb3f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x1ab190,null))['then'](function(_0x26ae67){if(_0x26ae67){_0x1d672b[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmHopper'][_0x487e('0x24')]);_0x1d672b[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4cb3f6[_0x487e('0x28')]);_0x1d672b['filters']=_[_0x487e('0x2a')](_0x1d672b[_0x487e('0x2b')],_0x1d672b[_0x487e('0x28')]);_0x57ecb5[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x1d672b['model'],qs['fields'](_0x4cb3f6[_0x487e('0x28')]['fields']));_0x57ecb5[_0x487e('0x2c')]=_0x57ecb5['attributes'][_0x487e('0x2e')]?_0x57ecb5[_0x487e('0x2c')]:_0x1d672b[_0x487e('0x2b')];if(!_0x4cb3f6[_0x487e('0x28')][_0x487e('0x2f')]('nolimit')){_0x57ecb5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x18')]);_0x57ecb5[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x16')]);}_0x57ecb5['order']=qs[_0x487e('0x31')](_0x4cb3f6[_0x487e('0x28')][_0x487e('0x31')]);_0x57ecb5[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x4cb3f6['query'],_0x1d672b[_0x487e('0x29')]));_0x57ecb5[_0x487e('0x32')][_0x487e('0x53')]=_0x26ae67['id'];if(_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]){_0x57ecb5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x57ecb5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x57ecb5['attributes'],function(_0x18d66b){var _0x546671={};_0x546671[_0x18d66b]={'$like':'%'+_0x4cb3f6[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x546671;})});}_0x57ecb5=_[_0x487e('0x34')]({},_0x57ecb5,_0x4cb3f6['options']);return db[_0x487e('0x55')][_0x487e('0x19')]({'where':_0x57ecb5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x5a70fc){_0x14e0d7[_0x487e('0x19')]=_0x5a70fc;if(_0x4cb3f6['query'][_0x487e('0x3e')]){_0x57ecb5['include']=[{'all':!![]}];}return db[_0x487e('0x55')]['findAll'](_0x57ecb5);})[_0x487e('0x1d')](function(_0x19b4a8){_0x14e0d7[_0x487e('0x3b')]=_0x19b4a8;return _0x14e0d7;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x1ab190,_0x57ecb5))[_0x487e('0x40')](handleError(_0x1ab190,null));};exports[_0x487e('0x56')]=function(_0x4c3d0a,_0x592caf,_0x90a262){var _0x227b83={'raw':!![],'where':{}};var _0x3a9b4e={};var _0x10d8d3={'count':0x0,'rows':[]};return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x4c3d0a[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x592caf,null))[_0x487e('0x1d')](function(_0xa73d47){if(_0xa73d47){_0x3a9b4e[_0x487e('0x2b')]=_['keys'](db['CmHopperHistory'][_0x487e('0x24')]);_0x3a9b4e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x4c3d0a[_0x487e('0x28')]);_0x3a9b4e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],_0x3a9b4e[_0x487e('0x28')]);_0x227b83[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0x3a9b4e['model'],qs[_0x487e('0x2d')](_0x4c3d0a['query'][_0x487e('0x2d')]));_0x227b83[_0x487e('0x2c')]=_0x227b83[_0x487e('0x2c')][_0x487e('0x2e')]?_0x227b83[_0x487e('0x2c')]:_0x3a9b4e['model'];if(!_0x4c3d0a[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x227b83['limit']=qs[_0x487e('0x18')](_0x4c3d0a['query'][_0x487e('0x18')]);_0x227b83[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x4c3d0a['query'][_0x487e('0x16')]);}_0x227b83['order']=qs[_0x487e('0x31')](_0x4c3d0a[_0x487e('0x28')][_0x487e('0x31')]);_0x227b83[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x4c3d0a['query'],_0x3a9b4e[_0x487e('0x29')]));_0x227b83['where'][_0x487e('0x53')]=_0xa73d47['id'];if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]){_0x227b83['where']=_[_0x487e('0x34')](_0x227b83['where'],{'$or':_[_0x487e('0x23')](_0x227b83[_0x487e('0x2c')],function(_0xa6e4df){var _0x18ca4e={};_0x18ca4e[_0xa6e4df]={'$like':'%'+_0x4c3d0a[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x18ca4e;})});}_0x227b83=_[_0x487e('0x34')]({},_0x227b83,_0x4c3d0a[_0x487e('0x37')]);return db[_0x487e('0x57')]['count']({'where':_0x227b83[_0x487e('0x32')]})['then'](function(_0x2a28ea){_0x10d8d3[_0x487e('0x19')]=_0x2a28ea;if(_0x4c3d0a[_0x487e('0x28')][_0x487e('0x3e')]){_0x227b83['include']=[{'all':!![]}];}return db[_0x487e('0x57')]['findAll'](_0x227b83);})[_0x487e('0x1d')](function(_0x1ead74){_0x10d8d3[_0x487e('0x3b')]=_0x1ead74;return _0x10d8d3;});}})['then'](respondWithFilteredResult(_0x592caf,_0x227b83))[_0x487e('0x40')](handleError(_0x592caf,null));};exports['getHopperFinals']=function(_0x3895fe,_0xf74805,_0x55e384){var _0x46e123={'raw':!![],'where':{}};var _0xc7c207={};var _0x18887e={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x3895fe[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xf74805,null))[_0x487e('0x1d')](function(_0x4c95d6){if(_0x4c95d6){_0xc7c207[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x58')]['rawAttributes']);_0xc7c207['query']=_[_0x487e('0x27')](_0x3895fe[_0x487e('0x28')]);_0xc7c207[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xc7c207['model'],_0xc7c207['query']);_0x46e123['attributes']=_[_0x487e('0x2a')](_0xc7c207[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x3895fe[_0x487e('0x28')][_0x487e('0x2d')]));_0x46e123[_0x487e('0x2c')]=_0x46e123[_0x487e('0x2c')]['length']?_0x46e123[_0x487e('0x2c')]:_0xc7c207['model'];if(!_0x3895fe[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x46e123[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x3895fe[_0x487e('0x28')][_0x487e('0x18')]);_0x46e123[_0x487e('0x16')]=qs['offset'](_0x3895fe['query'][_0x487e('0x16')]);}_0x46e123[_0x487e('0x59')]=qs['sort'](_0x3895fe[_0x487e('0x28')][_0x487e('0x31')]);_0x46e123['where']=qs['filters'](_[_0x487e('0x33')](_0x3895fe[_0x487e('0x28')],_0xc7c207[_0x487e('0x29')]));_0x46e123['where'][_0x487e('0x53')]=_0x4c95d6['id'];if(_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]){_0x46e123[_0x487e('0x32')]=_[_0x487e('0x34')](_0x46e123['where'],{'$or':_[_0x487e('0x23')](_0x46e123['attributes'],function(_0x202b4b){var _0x337c09={};_0x337c09[_0x202b4b]={'$like':'%'+_0x3895fe[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x337c09;})});}_0x46e123=_[_0x487e('0x34')]({},_0x46e123,_0x3895fe[_0x487e('0x37')]);return db[_0x487e('0x58')]['count']({'where':_0x46e123[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x583d4a){_0x18887e[_0x487e('0x19')]=_0x583d4a;if(_0x3895fe[_0x487e('0x28')][_0x487e('0x3e')]){_0x46e123[_0x487e('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x487e('0x3a')](_0x46e123);})[_0x487e('0x1d')](function(_0x54abdd){_0x18887e[_0x487e('0x3b')]=_0x54abdd;return _0x18887e;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0xf74805,_0x46e123))['catch'](handleError(_0xf74805,null));};exports[_0x487e('0x5a')]=function(_0x18bf9e,_0x446d6d,_0x4ec48d){var _0x3392f5={'raw':!![],'where':{}};var _0x5d57da={};var _0x44c231={'count':0x0,'rows':[]};return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x18bf9e[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x446d6d,null))['then'](function(_0x34990a){if(_0x34990a){_0x5d57da[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5b')][_0x487e('0x24')]);_0x5d57da[_0x487e('0x28')]=_[_0x487e('0x27')](_0x18bf9e['query']);_0x5d57da['filters']=_['intersection'](_0x5d57da[_0x487e('0x2b')],_0x5d57da[_0x487e('0x28')]);_0x3392f5[_0x487e('0x2c')]=_['intersection'](_0x5d57da[_0x487e('0x2b')],qs[_0x487e('0x2d')](_0x18bf9e['query'][_0x487e('0x2d')]));_0x3392f5[_0x487e('0x2c')]=_0x3392f5[_0x487e('0x2c')][_0x487e('0x2e')]?_0x3392f5[_0x487e('0x2c')]:_0x5d57da[_0x487e('0x2b')];if(!_0x18bf9e['query']['hasOwnProperty']('nolimit')){_0x3392f5[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x18bf9e[_0x487e('0x28')]['limit']);_0x3392f5['offset']=qs[_0x487e('0x16')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x16')]);}_0x3392f5[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x18bf9e[_0x487e('0x28')][_0x487e('0x31')]);_0x3392f5[_0x487e('0x32')]=qs[_0x487e('0x29')](_['pick'](_0x18bf9e[_0x487e('0x28')],_0x5d57da[_0x487e('0x29')]));_0x3392f5[_0x487e('0x32')]['CampaignId']=_0x34990a['id'];if(_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]){_0x3392f5[_0x487e('0x32')]=_[_0x487e('0x34')](_0x3392f5[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x3392f5[_0x487e('0x2c')],function(_0x38b707){var _0x47b7c8={};_0x47b7c8[_0x38b707]={'$like':'%'+_0x18bf9e[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x47b7c8;})});}_0x3392f5=_[_0x487e('0x34')]({},_0x3392f5,_0x18bf9e[_0x487e('0x37')]);return db[_0x487e('0x5b')][_0x487e('0x19')]({'where':_0x3392f5[_0x487e('0x32')]})[_0x487e('0x1d')](function(_0x3679d5){_0x44c231['count']=_0x3679d5;if(_0x18bf9e['query'][_0x487e('0x3e')]){_0x3392f5[_0x487e('0x39')]=[{'all':!![]}];}return db[_0x487e('0x5b')][_0x487e('0x3a')](_0x3392f5);})['then'](function(_0x355dc1){_0x44c231[_0x487e('0x3b')]=_0x355dc1;return _0x44c231;});}})[_0x487e('0x1d')](respondWithFilteredResult(_0x446d6d,_0x3392f5))[_0x487e('0x40')](handleError(_0x446d6d,null));};exports['getLists']=function(_0x2f2acc,_0xc987cc,_0x267cb8){var _0x13a0a1={};var _0xdf251e={};var _0x37cd63;var _0x2fddbf;return db['Campaign'][_0x487e('0x52')]({'where':{'id':_0x2f2acc[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0xc987cc,null))[_0x487e('0x1d')](function(_0x5564e8){if(_0x5564e8){_0x37cd63=_0x5564e8;_0xdf251e[_0x487e('0x2b')]=_[_0x487e('0x27')](db[_0x487e('0x5c')][_0x487e('0x24')]);_0xdf251e[_0x487e('0x28')]=_[_0x487e('0x27')](_0x2f2acc[_0x487e('0x28')]);_0xdf251e[_0x487e('0x29')]=_[_0x487e('0x2a')](_0xdf251e[_0x487e('0x2b')],_0xdf251e[_0x487e('0x28')]);_0x13a0a1[_0x487e('0x2c')]=_[_0x487e('0x2a')](_0xdf251e['model'],qs[_0x487e('0x2d')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x2d')]));_0x13a0a1[_0x487e('0x2c')]=_0x13a0a1[_0x487e('0x2c')][_0x487e('0x2e')]?_0x13a0a1[_0x487e('0x2c')]:_0xdf251e['model'];_0x13a0a1[_0x487e('0x59')]=qs[_0x487e('0x31')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x31')]);_0x13a0a1[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x2f2acc['query'],_0xdf251e['filters']));if(_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]){_0x13a0a1[_0x487e('0x32')]=_['merge'](_0x13a0a1[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x13a0a1[_0x487e('0x2c')],function(_0x49b9b2){var _0x352a85={};_0x352a85[_0x49b9b2]={'$like':'%'+_0x2f2acc[_0x487e('0x28')][_0x487e('0x54')]+'%'};return _0x352a85;})});}_0x13a0a1=_['merge']({},_0x13a0a1,_0x2f2acc[_0x487e('0x37')]);return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x39ea4f){if(_0x39ea4f){_0x2fddbf=_0x39ea4f[_0x487e('0x2e')];if(!_0x2f2acc[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x13a0a1[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x2f2acc[_0x487e('0x28')][_0x487e('0x18')]);_0x13a0a1[_0x487e('0x16')]=qs[_0x487e('0x16')](_0x2f2acc[_0x487e('0x28')]['offset']);}return _0x37cd63[_0x487e('0x5d')](_0x13a0a1);}})[_0x487e('0x1d')](function(_0x7edc37){if(_0x7edc37){return _0x7edc37?{'count':_0x2fddbf,'rows':_0x7edc37}:null;}})[_0x487e('0x1d')](respondWithResult(_0xc987cc,null))[_0x487e('0x40')](handleError(_0xc987cc,null));};exports[_0x487e('0x5e')]=function(_0x5324ad,_0x2299ac,_0x9a14b5){var _0x595db6,_0x462c1f;return db[_0x487e('0x38')]['find']({'where':{'id':_0x5324ad[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x2299ac,null))[_0x487e('0x1d')](function(_0xdcbc84){if(_0xdcbc84){_0x462c1f=_0xdcbc84;return _0xdcbc84['addLists'](_0x5324ad[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0x5324ad[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})['spread'](function(_0x38d8a7){var _0x2b1561;_0x595db6=_0x38d8a7||[];var _0x5b0625=[];if(_0x38d8a7){for(var _0x2de04d=0x0;_0x2de04d<_0x38d8a7[_0x487e('0x2e')];_0x2de04d+=0x1){var _0x124204=_0x38d8a7[_0x2de04d][_0x487e('0x42')]({'plain':!![]});_0x462c1f['dialCheckDuplicateType']=_0x5324ad['body'][_0x487e('0x60')]?_0x5324ad[_0x487e('0x4b')][_0x487e('0x60')]:_0x462c1f[_0x487e('0x60')];switch(_0x462c1f[_0x487e('0x60')]){case _0x487e('0x61'):_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x67'))[_0x487e('0x6b')]('id',_0x487e('0x68'))['field'](_0x124204['CmListId']['toString'](),_0x487e('0x69'))[_0x487e('0x6b')](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),'createdAt')['field'](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')]('deletedAt\x20IS\x20NULL')[_0x487e('0x32')]('ListId\x20=\x20?',_0x124204['CmListId'][_0x487e('0x6d')]())[_0x487e('0x32')](_0x487e('0x70'))[_0x487e('0x32')](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')]('COALESCE(calleridnum,\x27\x27)')[_0x487e('0x6e')](_0x487e('0x72'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]()))[_0x487e('0x32')](_0x487e('0x71'),squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x73'))['from']('cm_hopper')[_0x487e('0x32')](_0x487e('0x74'),_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')]())))[_0x487e('0x6d')]();break;case'onlyIfOpen':_0x2b1561=squel[_0x487e('0x62')]()['into'](_0x487e('0x64'))[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),'ContactId',_0x487e('0x69'),_0x487e('0x53'),'createdAt',_0x487e('0x4a')],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),_0x487e('0x66'))['field'](_0x487e('0x6c'),'scheduledAt')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),'ListId')['field'](_0x5324ad['params']['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')]('NOW()',_0x487e('0x4d'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204['CmListId']['toString']())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x487e('0x71'),squel['select']()[_0x487e('0x6b')](_0x487e('0x73'))[_0x487e('0x6e')](_0x487e('0x64'))[_0x487e('0x32')]('CampaignId\x20=\x20?',_0x5324ad['params']['id'][_0x487e('0x6d')]())))['toString']();break;default:_0x2b1561=squel[_0x487e('0x62')]()[_0x487e('0x63')]('cm_hopper')[_0x487e('0x65')]([_0x487e('0x66'),_0x487e('0x67'),_0x487e('0x68'),_0x487e('0x69'),_0x487e('0x53'),_0x487e('0x4d'),_0x487e('0x4a')],squel['select']()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('NOW()','scheduledAt')[_0x487e('0x6b')]('id','ContactId')[_0x487e('0x6b')](_0x124204[_0x487e('0x75')][_0x487e('0x6d')](),_0x487e('0x69'))['field'](_0x5324ad[_0x487e('0x3d')]['id'][_0x487e('0x6d')](),'CampaignId')[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')]('cm_contacts')['where'](_0x487e('0x76'))[_0x487e('0x32')](_0x487e('0x77'),_0x124204[_0x487e('0x75')][_0x487e('0x6d')]())[_0x487e('0x32')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x5b0625[_0x487e('0x78')](db['sequelize']['query'](_0x2b1561));}return BPromise[_0x487e('0x79')](_0x5b0625);}})[_0x487e('0x1d')](function(){return _0x595db6;})[_0x487e('0x1d')](respondWithResult(_0x2299ac,null))['catch'](handleError(_0x2299ac,null));};exports['removeLists']=function(_0x3cc4f6,_0x196458,_0xd8c9c0){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x3cc4f6['params']['id']}})['then'](handleEntityNotFound(_0x196458,null))['then'](function(_0x2f4767){if(_0x2f4767){return _0x2f4767[_0x487e('0x7a')](_0x3cc4f6[_0x487e('0x28')][_0x487e('0x5f')]);}})[_0x487e('0x1d')](function(_0x40a701){if(_0x40a701){return db[_0x487e('0x55')][_0x487e('0x1e')]({'where':{'ListId':_0x3cc4f6['query']['ids'],'CampaignId':_0x3cc4f6[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x40a701;});}})[_0x487e('0x1d')](respondWithStatusCode(_0x196458,null))[_0x487e('0x40')](handleError(_0x196458,null));};exports[_0x487e('0x7b')]=function(_0x37c57b,_0x13feca,_0x57af49){var _0x1726b3={};var _0x4ac702={};var _0x38e5d2;var _0x7081eb;return db[_0x487e('0x38')][_0x487e('0x52')]({'where':{'id':_0x37c57b['params']['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x13feca,null))[_0x487e('0x1d')](function(_0x4db0d5){if(_0x4db0d5){_0x38e5d2=_0x4db0d5;_0x4ac702[_0x487e('0x2b')]=_[_0x487e('0x27')](db['CmList'][_0x487e('0x24')]);_0x4ac702['query']=_[_0x487e('0x27')](_0x37c57b[_0x487e('0x28')]);_0x4ac702[_0x487e('0x29')]=_[_0x487e('0x2a')](_0x4ac702['model'],_0x4ac702[_0x487e('0x28')]);_0x1726b3['attributes']=_[_0x487e('0x2a')](_0x4ac702[_0x487e('0x2b')],qs['fields'](_0x37c57b[_0x487e('0x28')]['fields']));_0x1726b3['attributes']=_0x1726b3['attributes'][_0x487e('0x2e')]?_0x1726b3[_0x487e('0x2c')]:_0x4ac702[_0x487e('0x2b')];_0x1726b3['order']=qs[_0x487e('0x31')](_0x37c57b[_0x487e('0x28')][_0x487e('0x31')]);_0x1726b3[_0x487e('0x32')]=qs[_0x487e('0x29')](_[_0x487e('0x33')](_0x37c57b[_0x487e('0x28')],_0x4ac702[_0x487e('0x29')]));if(_0x37c57b[_0x487e('0x28')]['filter']){_0x1726b3['where']=_[_0x487e('0x34')](_0x1726b3[_0x487e('0x32')],{'$or':_[_0x487e('0x23')](_0x1726b3['attributes'],function(_0x3d9230){var _0x3fdf6a={};_0x3fdf6a[_0x3d9230]={'$like':'%'+_0x37c57b['query'][_0x487e('0x54')]+'%'};return _0x3fdf6a;})});}_0x1726b3=_['merge']({},_0x1726b3,_0x37c57b[_0x487e('0x37')]);return _0x38e5d2[_0x487e('0x7b')](_0x1726b3);}})[_0x487e('0x1d')](function(_0x263f2c){if(_0x263f2c){_0x7081eb=_0x263f2c[_0x487e('0x2e')];if(!_0x37c57b[_0x487e('0x28')][_0x487e('0x2f')](_0x487e('0x30'))){_0x1726b3[_0x487e('0x18')]=qs[_0x487e('0x18')](_0x37c57b[_0x487e('0x28')]['limit']);_0x1726b3[_0x487e('0x16')]=qs['offset'](_0x37c57b[_0x487e('0x28')]['offset']);}return _0x38e5d2['getBlackLists'](_0x1726b3);}})[_0x487e('0x1d')](function(_0x584443){if(_0x584443){return _0x584443?{'count':_0x7081eb,'rows':_0x584443}:null;}})[_0x487e('0x1d')](respondWithResult(_0x13feca,null))['catch'](handleError(_0x13feca,null));};exports['addBlackLists']=function(_0xa10b08,_0x41dd4e,_0x49606a){var _0x27ceed,_0x43b470;return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0xa10b08[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x41dd4e,null))[_0x487e('0x1d')](function(_0x561a2b){if(_0x561a2b){_0x43b470=_0x561a2b;return _0x561a2b[_0x487e('0x7c')](_0xa10b08[_0x487e('0x4b')][_0x487e('0x5f')],_['omit'](_0xa10b08[_0x487e('0x4b')],[_0x487e('0x5f'),'id'])||{});}return null;})[_0x487e('0x7d')](function(_0x2272e3){var _0x3c3d10;_0x27ceed=_0x2272e3||[];var _0x5cf7a3=[];if(_0x2272e3){for(var _0x44b027=0x0;_0x44b027<_0x2272e3[_0x487e('0x2e')];_0x44b027+=0x1){var _0x6f9a2d=_0x2272e3[_0x44b027][_0x487e('0x42')]({'plain':!![]});_0x3c3d10=squel['insert']()['into'](_0x487e('0x7e'))[_0x487e('0x65')](['phone',_0x487e('0x68'),'ListId',_0x487e('0x53'),_0x487e('0x4d'),'updatedAt'],squel[_0x487e('0x6a')]()[_0x487e('0x6b')](_0x487e('0x66'),'phone')[_0x487e('0x6b')]('id',_0x487e('0x68'))[_0x487e('0x6b')](_0x6f9a2d['CmListId']['toString'](),_0x487e('0x69'))['field'](_0xa10b08['params']['id'][_0x487e('0x6d')](),_0x487e('0x53'))[_0x487e('0x6b')](_0x487e('0x6c'),_0x487e('0x4d'))[_0x487e('0x6b')]('NOW()',_0x487e('0x4a'))[_0x487e('0x6e')](_0x487e('0x6f'))[_0x487e('0x32')](_0x487e('0x76'))[_0x487e('0x32')]('ListId\x20=\x20?',_0x6f9a2d[_0x487e('0x75')][_0x487e('0x6d')]())['where'](_0x487e('0x70')))[_0x487e('0x6d')]();_0x5cf7a3[_0x487e('0x78')](db[_0x487e('0x7f')]['query'](_0x3c3d10));}return BPromise['all'](_0x5cf7a3);}})[_0x487e('0x1d')](function(){return _0x27ceed;})['then'](respondWithResult(_0x41dd4e,null))[_0x487e('0x40')](handleError(_0x41dd4e,null));};exports[_0x487e('0x80')]=function(_0x110c49,_0x190d48,_0x15c7ce){return db[_0x487e('0x38')][_0x487e('0x3f')]({'where':{'id':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](handleEntityNotFound(_0x190d48,null))[_0x487e('0x1d')](function(_0x113563){if(_0x113563){return _0x113563[_0x487e('0x80')](_0x110c49[_0x487e('0x28')][_0x487e('0x5f')]);}})['then'](function(_0x5aad32){if(_0x5aad32){return db[_0x487e('0x5b')]['destroy']({'where':{'ListId':_0x110c49[_0x487e('0x28')][_0x487e('0x5f')],'CampaignId':_0x110c49[_0x487e('0x3d')]['id']}})[_0x487e('0x1d')](function(){return _0x5aad32;});}})['then'](respondWithStatusCode(_0x190d48,null))[_0x487e('0x40')](handleError(_0x190d48,null));};
\ No newline at end of file
+var _0x24da=['cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','toString','onlyIfOpen','ListId','COALESCE(phone,\x27\x27)','into','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','name','send','index','map','Campaign','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','rawAttributes','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','hasOwnProperty','CampaignId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert'];(function(_0x50250a,_0x25e859){var _0x536856=function(_0x5a0d45){while(--_0x5a0d45){_0x50250a['push'](_0x50250a['shift']());}};_0x536856(++_0x25e859);}(_0x24da,0x1bd));var _0xa24d=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x24da[_0x25662e];return _0x59b7bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa24d('0x0'));var zipdir=require(_0xa24d('0x1'));var jsonpatch=require(_0xa24d('0x2'));var rp=require('request-promise');var moment=require(_0xa24d('0x3'));var BPromise=require(_0xa24d('0x4'));var Mustache=require(_0xa24d('0x5'));var util=require('util');var path=require(_0xa24d('0x6'));var sox=require(_0xa24d('0x7'));var csv=require(_0xa24d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa24d('0x9'));var squel=require(_0xa24d('0xa'));var crypto=require(_0xa24d('0xb'));var jsforce=require(_0xa24d('0xc'));var deskjs=require(_0xa24d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa24d('0xe'));var Papa=require('papaparse');var Redis=require(_0xa24d('0xf'));var authService=require(_0xa24d('0x10'));var qs=require(_0xa24d('0x11'));var as=require(_0xa24d('0x12'));var hardwareService=require(_0xa24d('0x13'));var logger=require(_0xa24d('0x14'))(_0xa24d('0x15'));var utils=require(_0xa24d('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa24d('0x17'));var db=require(_0xa24d('0x18'))['db'];function respondWithStatusCode(_0x301e39,_0x47de24){_0x47de24=_0x47de24||0xcc;return function(_0x4b3512){if(_0x4b3512){return _0x301e39[_0xa24d('0x19')](_0x47de24);}return _0x301e39[_0xa24d('0x1a')](_0x47de24)[_0xa24d('0x1b')]();};}function respondWithResult(_0x47701a,_0x3d7dc6){_0x3d7dc6=_0x3d7dc6||0xc8;return function(_0x1ee8b3){if(_0x1ee8b3){return _0x47701a['status'](_0x3d7dc6)[_0xa24d('0x1c')](_0x1ee8b3);}};}function respondWithFilteredResult(_0x423ca4,_0x538c85){return function(_0x329c3a){if(_0x329c3a){var _0x24f011=typeof _0x538c85[_0xa24d('0x1d')]===_0xa24d('0x1e')&&typeof _0x538c85[_0xa24d('0x1f')]===_0xa24d('0x1e');var _0x33707e=_0x329c3a[_0xa24d('0x20')];var _0x58b008=_0x24f011?0x0:_0x538c85[_0xa24d('0x1d')];var _0x4b38a4=_0x24f011?_0x329c3a[_0xa24d('0x20')]:_0x538c85[_0xa24d('0x1d')]+_0x538c85[_0xa24d('0x1f')];var _0x2a1311;if(_0x4b38a4>=_0x33707e){_0x4b38a4=_0x33707e;_0x2a1311=0xc8;}else{_0x2a1311=0xce;}_0x423ca4[_0xa24d('0x1a')](_0x2a1311);return _0x423ca4[_0xa24d('0x21')]('Content-Range',_0x58b008+'-'+_0x4b38a4+'/'+_0x33707e)[_0xa24d('0x1c')](_0x329c3a);}return null;};}function patchUpdates(_0x1ae507){return function(_0x33ee10){try{jsonpatch['apply'](_0x33ee10,_0x1ae507,!![]);}catch(_0x1b4949){return BPromise[_0xa24d('0x22')](_0x1b4949);}return _0x33ee10[_0xa24d('0x23')]();};}function saveUpdates(_0x179e00,_0x2d09eb){return function(_0x53c123){if(_0x53c123){return _0x53c123['update'](_0x179e00)[_0xa24d('0x24')](function(_0x46bef0){return _0x46bef0;});}return null;};}function removeEntity(_0x257e99,_0x2765e9){return function(_0xddbfd4){if(_0xddbfd4){return _0xddbfd4[_0xa24d('0x25')]()[_0xa24d('0x24')](function(){var _0x151dfc=_0xddbfd4[_0xa24d('0x26')]({'plain':!![]});var _0x4cec05=_0xa24d('0x27');return db[_0xa24d('0x28')][_0xa24d('0x25')]({'where':{'type':_0x4cec05,'resourceId':_0x151dfc['id']}})[_0xa24d('0x24')](function(){return _0xddbfd4;});})[_0xa24d('0x24')](function(){_0x257e99[_0xa24d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x419a52,_0x151467){return function(_0x23b3fe){if(!_0x23b3fe){_0x419a52[_0xa24d('0x19')](0x194);}return _0x23b3fe;};}function handleError(_0x10513f,_0x1b7679){_0x1b7679=_0x1b7679||0x1f4;return function(_0x51b2fa){logger['error'](_0x51b2fa['stack']);if(_0x51b2fa[_0xa24d('0x29')]){delete _0x51b2fa[_0xa24d('0x29')];}_0x10513f['status'](_0x1b7679)[_0xa24d('0x2a')](_0x51b2fa);};}exports[_0xa24d('0x2b')]=function(_0x142dfa,_0x3c562e){var _0x42391a={},_0x21612f={},_0x12335e={'count':0x0,'rows':[]};var _0x3221f1=_[_0xa24d('0x2c')](db[_0xa24d('0x2d')]['rawAttributes'],function(_0x1ca207){return{'name':_0x1ca207[_0xa24d('0x2e')],'type':_0x1ca207[_0xa24d('0x2f')]['key']};});_0x21612f[_0xa24d('0x30')]=_[_0xa24d('0x2c')](_0x3221f1,_0xa24d('0x29'));_0x21612f[_0xa24d('0x31')]=_['keys'](_0x142dfa[_0xa24d('0x31')]);_0x21612f['filters']=_[_0xa24d('0x32')](_0x21612f[_0xa24d('0x30')],_0x21612f['query']);_0x42391a[_0xa24d('0x33')]=_['intersection'](_0x21612f[_0xa24d('0x30')],qs[_0xa24d('0x34')](_0x142dfa[_0xa24d('0x31')][_0xa24d('0x34')]));_0x42391a[_0xa24d('0x33')]=_0x42391a[_0xa24d('0x33')][_0xa24d('0x35')]?_0x42391a[_0xa24d('0x33')]:_0x21612f['model'];if(!_0x142dfa[_0xa24d('0x31')]['hasOwnProperty'](_0xa24d('0x36'))){_0x42391a[_0xa24d('0x1f')]=qs[_0xa24d('0x1f')](_0x142dfa[_0xa24d('0x31')][_0xa24d('0x1f')]);_0x42391a[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x142dfa[_0xa24d('0x31')][_0xa24d('0x1d')]);}_0x42391a[_0xa24d('0x37')]=qs[_0xa24d('0x38')](_0x142dfa[_0xa24d('0x31')][_0xa24d('0x38')]);_0x42391a[_0xa24d('0x39')]=qs[_0xa24d('0x3a')](_[_0xa24d('0x3b')](_0x142dfa[_0xa24d('0x31')],_0x21612f[_0xa24d('0x3a')]),_0x3221f1);if(_0x142dfa[_0xa24d('0x31')][_0xa24d('0x3c')]){_0x42391a['where']=_[_0xa24d('0x3d')](_0x42391a[_0xa24d('0x39')],{'$or':_['map'](_0x3221f1,function(_0x134dbb){if(_0x134dbb[_0xa24d('0x2f')]!==_0xa24d('0x3e')){var _0x46efa6={};_0x46efa6[_0x134dbb[_0xa24d('0x29')]]={'$like':'%'+_0x142dfa[_0xa24d('0x31')][_0xa24d('0x3c')]+'%'};return _0x46efa6;}})});}_0x42391a=_['merge']({},_0x42391a,_0x142dfa[_0xa24d('0x3f')]);var _0x3f46c0={'where':_0x42391a['where']};return db[_0xa24d('0x2d')][_0xa24d('0x20')](_0x3f46c0)['then'](function(_0x92436b){_0x12335e['count']=_0x92436b;if(_0x142dfa['query']['includeAll']){_0x42391a[_0xa24d('0x40')]=[{'all':!![]}];}return db[_0xa24d('0x2d')]['findAll'](_0x42391a);})[_0xa24d('0x24')](function(_0x237bb9){_0x12335e['rows']=_0x237bb9;return _0x12335e;})['then'](respondWithFilteredResult(_0x3c562e,_0x42391a))[_0xa24d('0x41')](handleError(_0x3c562e,null));};exports[_0xa24d('0x42')]=function(_0x4bb89f,_0x3e2118){var _0x2f944f={'raw':![],'where':{'id':_0x4bb89f[_0xa24d('0x43')]['id']}},_0x3e7d33={};_0x3e7d33[_0xa24d('0x30')]=_['keys'](db[_0xa24d('0x2d')][_0xa24d('0x44')]);_0x3e7d33['query']=_[_0xa24d('0x45')](_0x4bb89f[_0xa24d('0x31')]);_0x3e7d33[_0xa24d('0x3a')]=_['intersection'](_0x3e7d33[_0xa24d('0x30')],_0x3e7d33[_0xa24d('0x31')]);_0x2f944f[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x3e7d33[_0xa24d('0x30')],qs['fields'](_0x4bb89f['query'][_0xa24d('0x34')]));_0x2f944f['attributes']=_0x2f944f['attributes']['length']?_0x2f944f[_0xa24d('0x33')]:_0x3e7d33[_0xa24d('0x30')];if(_0x4bb89f['query'][_0xa24d('0x46')]){_0x2f944f[_0xa24d('0x40')]=[{'all':!![]}];}_0x2f944f=_[_0xa24d('0x3d')]({},_0x2f944f,_0x4bb89f['options']);return db[_0xa24d('0x2d')]['find'](_0x2f944f)['then'](handleEntityNotFound(_0x3e2118,null))[_0xa24d('0x24')](respondWithResult(_0x3e2118,null))[_0xa24d('0x41')](handleError(_0x3e2118,null));};exports['create']=function(_0x196070,_0x5ee235){return db['Campaign'][_0xa24d('0x47')](_0x196070[_0xa24d('0x48')],{})[_0xa24d('0x24')](function(_0x41aac7){var _0x452bdb=_0x196070[_0xa24d('0x49')][_0xa24d('0x26')]({'plain':!![]});if(!_0x452bdb)throw new Error(_0xa24d('0x4a'));if(_0x452bdb[_0xa24d('0x4b')]===_0xa24d('0x49')){var _0x15f7fb=_0x41aac7[_0xa24d('0x26')]({'plain':!![]});var _0x148ccb='IvrCampaigns';return db[_0xa24d('0x4c')][_0xa24d('0x4d')]({'where':{'name':_0x148ccb,'userProfileId':_0x452bdb[_0xa24d('0x4e')]},'raw':!![]})[_0xa24d('0x24')](function(_0x6deeef){if(_0x6deeef&&_0x6deeef[_0xa24d('0x4f')]===0x0){return db[_0xa24d('0x28')][_0xa24d('0x47')]({'name':_0x15f7fb[_0xa24d('0x29')],'resourceId':_0x15f7fb['id'],'type':_0x6deeef[_0xa24d('0x29')],'sectionId':_0x6deeef['id']},{})[_0xa24d('0x24')](function(){return _0x41aac7;});}else{return _0x41aac7;}})['catch'](function(_0x525985){logger[_0xa24d('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x525985);throw _0x525985;});}return _0x41aac7;})[_0xa24d('0x24')](respondWithResult(_0x5ee235,0xc9))['catch'](handleError(_0x5ee235,null));};exports[_0xa24d('0x51')]=function(_0x14b8f4,_0x38e830){var _0x51feda={'where':{'id':_0x14b8f4['params']['id']}},_0x38c354={};_0x38c354['model']=_[_0xa24d('0x45')](db['Campaign'][_0xa24d('0x44')]);_0x51feda[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x38c354['model'],qs[_0xa24d('0x34')](_0x14b8f4['query'][_0xa24d('0x34')]));_0x51feda['attributes']=_0x51feda[_0xa24d('0x33')][_0xa24d('0x35')]?_0x51feda[_0xa24d('0x33')]:_0x38c354[_0xa24d('0x30')];if(_0x14b8f4[_0xa24d('0x31')][_0xa24d('0x46')]){_0x51feda[_0xa24d('0x40')]=[{'all':!![]}];}_0x51feda=_[_0xa24d('0x3d')]({},_0x51feda,_0x14b8f4[_0xa24d('0x3f')]);return db[_0xa24d('0x2d')]['find'](_0x51feda)[_0xa24d('0x24')](handleEntityNotFound(_0x38e830,null))[_0xa24d('0x24')](function(_0x21fae0){if(_0x21fae0){var _0x20bb05=_0x21fae0[_0xa24d('0x26')]({'plain':!![]});_0x20bb05=qs[_0xa24d('0x52')](_0x20bb05,['id',_0xa24d('0x53'),_0xa24d('0x54')]);_0x14b8f4[_0xa24d('0x48')]=_['omit'](_0x14b8f4[_0xa24d('0x48')],['id',_0xa24d('0x53'),_0xa24d('0x54')]);return db[_0xa24d('0x2d')][_0xa24d('0x47')](_[_0xa24d('0x3d')](_0x20bb05,_0x14b8f4[_0xa24d('0x48')]),{'include':_0x14b8f4[_0xa24d('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0xa24d('0x24')](function(_0x4caf99){var _0x3a5799=_0x14b8f4['user'][_0xa24d('0x26')]({'plain':!![]});if(!_0x3a5799)throw new Error(_0xa24d('0x4a'));if(_0x3a5799['role']==='user'){var _0x340795=_0x4caf99[_0xa24d('0x26')]({'plain':!![]});var _0x192f4f=_0xa24d('0x27');return db[_0xa24d('0x4c')][_0xa24d('0x4d')]({'where':{'name':_0x192f4f,'userProfileId':_0x3a5799[_0xa24d('0x4e')]},'raw':!![]})[_0xa24d('0x24')](function(_0x21d322){if(_0x21d322&&_0x21d322[_0xa24d('0x4f')]===0x0){return db['UserProfileResource'][_0xa24d('0x47')]({'name':_0x340795['name'],'resourceId':_0x340795['id'],'type':_0x21d322[_0xa24d('0x29')],'sectionId':_0x21d322['id']},{})['then'](function(){return _0x4caf99;});}else{return _0x4caf99;}})[_0xa24d('0x41')](function(_0x58cffe){logger[_0xa24d('0x50')](_0xa24d('0x55'),_0x58cffe);throw _0x58cffe;});}return _0x4caf99;});}})[_0xa24d('0x24')](respondWithResult(_0x38e830,0xc9))[_0xa24d('0x41')](handleError(_0x38e830,null));};exports['update']=function(_0x5bee57,_0x45189d){if(_0x5bee57['body']['id']){delete _0x5bee57[_0xa24d('0x48')]['id'];}return db[_0xa24d('0x2d')][_0xa24d('0x4d')]({'where':{'id':_0x5bee57[_0xa24d('0x43')]['id']}})['then'](handleEntityNotFound(_0x45189d,null))[_0xa24d('0x24')](saveUpdates(_0x5bee57[_0xa24d('0x48')],null))[_0xa24d('0x24')](respondWithResult(_0x45189d,null))[_0xa24d('0x41')](handleError(_0x45189d,null));};exports[_0xa24d('0x25')]=function(_0x38406d,_0x2ad542){return db[_0xa24d('0x2d')][_0xa24d('0x4d')]({'where':{'id':_0x38406d[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x2ad542,null))[_0xa24d('0x24')](removeEntity(_0x2ad542,null))[_0xa24d('0x41')](handleError(_0x2ad542,null));};exports[_0xa24d('0x56')]=function(_0x12521c,_0x4256a0,_0x3147be){var _0x1eb032={'raw':!![],'where':{}};var _0x66c45e={};var _0x394f84={'count':0x0,'rows':[]};return db[_0xa24d('0x2d')]['findOne']({'where':{'id':_0x12521c['params']['id']}})['then'](handleEntityNotFound(_0x4256a0,null))[_0xa24d('0x24')](function(_0x57c385){if(_0x57c385){_0x66c45e[_0xa24d('0x30')]=_[_0xa24d('0x45')](db[_0xa24d('0x57')][_0xa24d('0x44')]);_0x66c45e[_0xa24d('0x31')]=_['keys'](_0x12521c[_0xa24d('0x31')]);_0x66c45e[_0xa24d('0x3a')]=_[_0xa24d('0x32')](_0x66c45e['model'],_0x66c45e[_0xa24d('0x31')]);_0x1eb032[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x66c45e[_0xa24d('0x30')],qs[_0xa24d('0x34')](_0x12521c['query'][_0xa24d('0x34')]));_0x1eb032[_0xa24d('0x33')]=_0x1eb032['attributes'][_0xa24d('0x35')]?_0x1eb032['attributes']:_0x66c45e['model'];if(!_0x12521c[_0xa24d('0x31')][_0xa24d('0x58')](_0xa24d('0x36'))){_0x1eb032[_0xa24d('0x1f')]=qs[_0xa24d('0x1f')](_0x12521c[_0xa24d('0x31')][_0xa24d('0x1f')]);_0x1eb032[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x12521c[_0xa24d('0x31')][_0xa24d('0x1d')]);}_0x1eb032[_0xa24d('0x37')]=qs[_0xa24d('0x38')](_0x12521c['query'][_0xa24d('0x38')]);_0x1eb032[_0xa24d('0x39')]=qs[_0xa24d('0x3a')](_['pick'](_0x12521c[_0xa24d('0x31')],_0x66c45e[_0xa24d('0x3a')]));_0x1eb032[_0xa24d('0x39')][_0xa24d('0x59')]=_0x57c385['id'];if(_0x12521c[_0xa24d('0x31')][_0xa24d('0x3c')]){_0x1eb032[_0xa24d('0x39')]=_[_0xa24d('0x3d')](_0x1eb032['where'],{'$or':_[_0xa24d('0x2c')](_0x1eb032['attributes'],function(_0x3f1858){var _0x4100b8={};_0x4100b8[_0x3f1858]={'$like':'%'+_0x12521c[_0xa24d('0x31')][_0xa24d('0x3c')]+'%'};return _0x4100b8;})});}_0x1eb032=_[_0xa24d('0x3d')]({},_0x1eb032,_0x12521c['options']);return db[_0xa24d('0x57')][_0xa24d('0x20')]({'where':_0x1eb032[_0xa24d('0x39')]})[_0xa24d('0x24')](function(_0xe7b849){_0x394f84['count']=_0xe7b849;if(_0x12521c[_0xa24d('0x31')]['includeAll']){_0x1eb032[_0xa24d('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0xa24d('0x5a')](_0x1eb032);})[_0xa24d('0x24')](function(_0x472adc){_0x394f84[_0xa24d('0x5b')]=_0x472adc;return _0x394f84;});}})['then'](respondWithFilteredResult(_0x4256a0,_0x1eb032))[_0xa24d('0x41')](handleError(_0x4256a0,null));};exports[_0xa24d('0x5c')]=function(_0x25af72,_0x23209b,_0x32c8d5){var _0x248764={'raw':!![],'where':{}};var _0x3aab6b={};var _0x248bd1={'count':0x0,'rows':[]};return db[_0xa24d('0x2d')][_0xa24d('0x5d')]({'where':{'id':_0x25af72[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x23209b,null))[_0xa24d('0x24')](function(_0x1337b9){if(_0x1337b9){_0x3aab6b[_0xa24d('0x30')]=_[_0xa24d('0x45')](db['CmHopperHistory'][_0xa24d('0x44')]);_0x3aab6b[_0xa24d('0x31')]=_[_0xa24d('0x45')](_0x25af72['query']);_0x3aab6b[_0xa24d('0x3a')]=_['intersection'](_0x3aab6b[_0xa24d('0x30')],_0x3aab6b[_0xa24d('0x31')]);_0x248764[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x3aab6b[_0xa24d('0x30')],qs[_0xa24d('0x34')](_0x25af72['query']['fields']));_0x248764[_0xa24d('0x33')]=_0x248764[_0xa24d('0x33')]['length']?_0x248764['attributes']:_0x3aab6b[_0xa24d('0x30')];if(!_0x25af72['query']['hasOwnProperty'](_0xa24d('0x36'))){_0x248764[_0xa24d('0x1f')]=qs['limit'](_0x25af72[_0xa24d('0x31')]['limit']);_0x248764[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x25af72[_0xa24d('0x31')][_0xa24d('0x1d')]);}_0x248764['order']=qs[_0xa24d('0x38')](_0x25af72['query'][_0xa24d('0x38')]);_0x248764['where']=qs['filters'](_[_0xa24d('0x3b')](_0x25af72[_0xa24d('0x31')],_0x3aab6b[_0xa24d('0x3a')]));_0x248764[_0xa24d('0x39')][_0xa24d('0x59')]=_0x1337b9['id'];if(_0x25af72[_0xa24d('0x31')][_0xa24d('0x3c')]){_0x248764[_0xa24d('0x39')]=_[_0xa24d('0x3d')](_0x248764[_0xa24d('0x39')],{'$or':_[_0xa24d('0x2c')](_0x248764['attributes'],function(_0x38f27e){var _0x5594db={};_0x5594db[_0x38f27e]={'$like':'%'+_0x25af72[_0xa24d('0x31')][_0xa24d('0x3c')]+'%'};return _0x5594db;})});}_0x248764=_[_0xa24d('0x3d')]({},_0x248764,_0x25af72[_0xa24d('0x3f')]);return db[_0xa24d('0x5e')]['count']({'where':_0x248764[_0xa24d('0x39')]})[_0xa24d('0x24')](function(_0x5b029e){_0x248bd1['count']=_0x5b029e;if(_0x25af72[_0xa24d('0x31')][_0xa24d('0x46')]){_0x248764['include']=[{'all':!![]}];}return db[_0xa24d('0x5e')]['findAll'](_0x248764);})[_0xa24d('0x24')](function(_0x2009bf){_0x248bd1[_0xa24d('0x5b')]=_0x2009bf;return _0x248bd1;});}})[_0xa24d('0x24')](respondWithFilteredResult(_0x23209b,_0x248764))[_0xa24d('0x41')](handleError(_0x23209b,null));};exports[_0xa24d('0x5f')]=function(_0x507473,_0x1b6426,_0x540131){var _0x164b47={'raw':!![],'where':{}};var _0x5b6131={};var _0x13008d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x507473[_0xa24d('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b6426,null))[_0xa24d('0x24')](function(_0xeea75e){if(_0xeea75e){_0x5b6131['model']=_[_0xa24d('0x45')](db[_0xa24d('0x60')][_0xa24d('0x44')]);_0x5b6131[_0xa24d('0x31')]=_[_0xa24d('0x45')](_0x507473[_0xa24d('0x31')]);_0x5b6131[_0xa24d('0x3a')]=_[_0xa24d('0x32')](_0x5b6131[_0xa24d('0x30')],_0x5b6131['query']);_0x164b47[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x5b6131[_0xa24d('0x30')],qs[_0xa24d('0x34')](_0x507473['query']['fields']));_0x164b47[_0xa24d('0x33')]=_0x164b47[_0xa24d('0x33')][_0xa24d('0x35')]?_0x164b47[_0xa24d('0x33')]:_0x5b6131['model'];if(!_0x507473['query'][_0xa24d('0x58')](_0xa24d('0x36'))){_0x164b47['limit']=qs[_0xa24d('0x1f')](_0x507473[_0xa24d('0x31')]['limit']);_0x164b47[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x507473[_0xa24d('0x31')][_0xa24d('0x1d')]);}_0x164b47[_0xa24d('0x37')]=qs['sort'](_0x507473['query'][_0xa24d('0x38')]);_0x164b47[_0xa24d('0x39')]=qs[_0xa24d('0x3a')](_[_0xa24d('0x3b')](_0x507473[_0xa24d('0x31')],_0x5b6131[_0xa24d('0x3a')]));_0x164b47[_0xa24d('0x39')]['CampaignId']=_0xeea75e['id'];if(_0x507473[_0xa24d('0x31')][_0xa24d('0x3c')]){_0x164b47[_0xa24d('0x39')]=_[_0xa24d('0x3d')](_0x164b47[_0xa24d('0x39')],{'$or':_[_0xa24d('0x2c')](_0x164b47[_0xa24d('0x33')],function(_0x3d9cbf){var _0x349f8a={};_0x349f8a[_0x3d9cbf]={'$like':'%'+_0x507473['query'][_0xa24d('0x3c')]+'%'};return _0x349f8a;})});}_0x164b47=_[_0xa24d('0x3d')]({},_0x164b47,_0x507473[_0xa24d('0x3f')]);return db[_0xa24d('0x60')][_0xa24d('0x20')]({'where':_0x164b47['where']})[_0xa24d('0x24')](function(_0x37e1ae){_0x13008d[_0xa24d('0x20')]=_0x37e1ae;if(_0x507473[_0xa24d('0x31')]['includeAll']){_0x164b47[_0xa24d('0x40')]=[{'all':!![]}];}return db[_0xa24d('0x60')]['findAll'](_0x164b47);})[_0xa24d('0x24')](function(_0xe406e){_0x13008d[_0xa24d('0x5b')]=_0xe406e;return _0x13008d;});}})[_0xa24d('0x24')](respondWithFilteredResult(_0x1b6426,_0x164b47))[_0xa24d('0x41')](handleError(_0x1b6426,null));};exports[_0xa24d('0x61')]=function(_0x1ef22a,_0x5b476d,_0x5144c5){var _0x1cea36={'raw':!![],'where':{}};var _0x102cf3={};var _0x138ae5={'count':0x0,'rows':[]};return db['Campaign'][_0xa24d('0x5d')]({'where':{'id':_0x1ef22a[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x5b476d,null))[_0xa24d('0x24')](function(_0x3661dd){if(_0x3661dd){_0x102cf3[_0xa24d('0x30')]=_['keys'](db[_0xa24d('0x62')]['rawAttributes']);_0x102cf3[_0xa24d('0x31')]=_[_0xa24d('0x45')](_0x1ef22a[_0xa24d('0x31')]);_0x102cf3['filters']=_[_0xa24d('0x32')](_0x102cf3[_0xa24d('0x30')],_0x102cf3[_0xa24d('0x31')]);_0x1cea36[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x102cf3[_0xa24d('0x30')],qs['fields'](_0x1ef22a[_0xa24d('0x31')][_0xa24d('0x34')]));_0x1cea36[_0xa24d('0x33')]=_0x1cea36['attributes'][_0xa24d('0x35')]?_0x1cea36[_0xa24d('0x33')]:_0x102cf3[_0xa24d('0x30')];if(!_0x1ef22a['query']['hasOwnProperty'](_0xa24d('0x36'))){_0x1cea36['limit']=qs[_0xa24d('0x1f')](_0x1ef22a[_0xa24d('0x31')][_0xa24d('0x1f')]);_0x1cea36[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x1ef22a['query'][_0xa24d('0x1d')]);}_0x1cea36[_0xa24d('0x37')]=qs[_0xa24d('0x38')](_0x1ef22a['query']['sort']);_0x1cea36[_0xa24d('0x39')]=qs[_0xa24d('0x3a')](_[_0xa24d('0x3b')](_0x1ef22a[_0xa24d('0x31')],_0x102cf3['filters']));_0x1cea36['where'][_0xa24d('0x59')]=_0x3661dd['id'];if(_0x1ef22a[_0xa24d('0x31')]['filter']){_0x1cea36[_0xa24d('0x39')]=_[_0xa24d('0x3d')](_0x1cea36['where'],{'$or':_[_0xa24d('0x2c')](_0x1cea36[_0xa24d('0x33')],function(_0x126450){var _0x25a616={};_0x25a616[_0x126450]={'$like':'%'+_0x1ef22a[_0xa24d('0x31')][_0xa24d('0x3c')]+'%'};return _0x25a616;})});}_0x1cea36=_[_0xa24d('0x3d')]({},_0x1cea36,_0x1ef22a[_0xa24d('0x3f')]);return db[_0xa24d('0x62')]['count']({'where':_0x1cea36[_0xa24d('0x39')]})[_0xa24d('0x24')](function(_0x3af134){_0x138ae5['count']=_0x3af134;if(_0x1ef22a[_0xa24d('0x31')]['includeAll']){_0x1cea36[_0xa24d('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xa24d('0x5a')](_0x1cea36);})[_0xa24d('0x24')](function(_0x45533a){_0x138ae5[_0xa24d('0x5b')]=_0x45533a;return _0x138ae5;});}})[_0xa24d('0x24')](respondWithFilteredResult(_0x5b476d,_0x1cea36))[_0xa24d('0x41')](handleError(_0x5b476d,null));};exports[_0xa24d('0x63')]=function(_0x491a4e,_0x318d24,_0x5b2e90){var _0x51cc9b={};var _0x161de2={};var _0x4d648e;var _0x5605b5;return db[_0xa24d('0x2d')][_0xa24d('0x5d')]({'where':{'id':_0x491a4e[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x318d24,null))['then'](function(_0x4c1cf0){if(_0x4c1cf0){_0x4d648e=_0x4c1cf0;_0x161de2['model']=_[_0xa24d('0x45')](db[_0xa24d('0x64')]['rawAttributes']);_0x161de2[_0xa24d('0x31')]=_[_0xa24d('0x45')](_0x491a4e[_0xa24d('0x31')]);_0x161de2[_0xa24d('0x3a')]=_[_0xa24d('0x32')](_0x161de2['model'],_0x161de2['query']);_0x51cc9b[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x161de2[_0xa24d('0x30')],qs[_0xa24d('0x34')](_0x491a4e[_0xa24d('0x31')][_0xa24d('0x34')]));_0x51cc9b[_0xa24d('0x33')]=_0x51cc9b[_0xa24d('0x33')]['length']?_0x51cc9b[_0xa24d('0x33')]:_0x161de2['model'];_0x51cc9b['order']=qs['sort'](_0x491a4e[_0xa24d('0x31')][_0xa24d('0x38')]);_0x51cc9b[_0xa24d('0x39')]=qs[_0xa24d('0x3a')](_[_0xa24d('0x3b')](_0x491a4e[_0xa24d('0x31')],_0x161de2[_0xa24d('0x3a')]));if(_0x491a4e['query'][_0xa24d('0x3c')]){_0x51cc9b[_0xa24d('0x39')]=_['merge'](_0x51cc9b['where'],{'$or':_[_0xa24d('0x2c')](_0x51cc9b[_0xa24d('0x33')],function(_0x4b0a5d){var _0x51904b={};_0x51904b[_0x4b0a5d]={'$like':'%'+_0x491a4e[_0xa24d('0x31')][_0xa24d('0x3c')]+'%'};return _0x51904b;})});}_0x51cc9b=_[_0xa24d('0x3d')]({},_0x51cc9b,_0x491a4e[_0xa24d('0x3f')]);return _0x4d648e['getLists'](_0x51cc9b);}})[_0xa24d('0x24')](function(_0xce9ac0){if(_0xce9ac0){_0x5605b5=_0xce9ac0[_0xa24d('0x35')];if(!_0x491a4e[_0xa24d('0x31')][_0xa24d('0x58')]('nolimit')){_0x51cc9b[_0xa24d('0x1f')]=qs[_0xa24d('0x1f')](_0x491a4e[_0xa24d('0x31')][_0xa24d('0x1f')]);_0x51cc9b[_0xa24d('0x1d')]=qs['offset'](_0x491a4e[_0xa24d('0x31')][_0xa24d('0x1d')]);}return _0x4d648e[_0xa24d('0x63')](_0x51cc9b);}})[_0xa24d('0x24')](function(_0x3e344a){if(_0x3e344a){return _0x3e344a?{'count':_0x5605b5,'rows':_0x3e344a}:null;}})[_0xa24d('0x24')](respondWithResult(_0x318d24,null))[_0xa24d('0x41')](handleError(_0x318d24,null));};exports[_0xa24d('0x65')]=function(_0x24acd1,_0x4571ef,_0x3d8fc6){var _0x4d0856,_0x8326e8;return db[_0xa24d('0x2d')][_0xa24d('0x4d')]({'where':{'id':_0x24acd1[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x4571ef,null))['then'](function(_0x2e0199){if(_0x2e0199){_0x8326e8=_0x2e0199;return _0x2e0199[_0xa24d('0x65')](_0x24acd1[_0xa24d('0x48')][_0xa24d('0x66')],_[_0xa24d('0x52')](_0x24acd1[_0xa24d('0x48')],[_0xa24d('0x66'),'id'])||{});}return null;})[_0xa24d('0x67')](function(_0x507a4f){var _0x3b65c7;_0x4d0856=_0x507a4f||[];var _0x38f473=[];if(_0x507a4f){for(var _0x5e41f6=0x0;_0x5e41f6<_0x507a4f[_0xa24d('0x35')];_0x5e41f6+=0x1){var _0x4808e5=_0x507a4f[_0x5e41f6][_0xa24d('0x26')]({'plain':!![]});_0x8326e8[_0xa24d('0x68')]=_0x24acd1[_0xa24d('0x48')][_0xa24d('0x68')]?_0x24acd1[_0xa24d('0x48')][_0xa24d('0x68')]:_0x8326e8['dialCheckDuplicateType'];switch(_0x8326e8[_0xa24d('0x68')]){case _0xa24d('0x69'):_0x3b65c7=squel[_0xa24d('0x6a')]()['into'](_0xa24d('0x6b'))[_0xa24d('0x6c')]([_0xa24d('0x6d'),_0xa24d('0x6e'),_0xa24d('0x6f'),'ListId',_0xa24d('0x59'),_0xa24d('0x53'),'updatedAt'],squel[_0xa24d('0x70')]()[_0xa24d('0x71')](_0xa24d('0x6d'),'phone')[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x6e'))[_0xa24d('0x71')]('id',_0xa24d('0x6f'))['field'](_0x4808e5[_0xa24d('0x73')]['toString'](),'ListId')[_0xa24d('0x71')](_0x24acd1[_0xa24d('0x43')]['id']['toString'](),_0xa24d('0x59'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x53'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x54'))[_0xa24d('0x74')](_0xa24d('0x75'))['where'](_0xa24d('0x76'))['where'](_0xa24d('0x77'),_0x4808e5['CmListId']['toString']())[_0xa24d('0x39')](_0xa24d('0x78'))[_0xa24d('0x39')](_0xa24d('0x79'),squel[_0xa24d('0x70')]()[_0xa24d('0x71')](_0xa24d('0x7a'))[_0xa24d('0x74')](_0xa24d('0x7b'))[_0xa24d('0x39')](_0xa24d('0x7c'),_0x24acd1['params']['id'][_0xa24d('0x7d')]()))[_0xa24d('0x39')](_0xa24d('0x79'),squel[_0xa24d('0x70')]()[_0xa24d('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0xa24d('0x6b'))[_0xa24d('0x39')](_0xa24d('0x7c'),_0x24acd1[_0xa24d('0x43')]['id'][_0xa24d('0x7d')]())))[_0xa24d('0x7d')]();break;case _0xa24d('0x7e'):_0x3b65c7=squel[_0xa24d('0x6a')]()['into'](_0xa24d('0x6b'))['fromQuery']([_0xa24d('0x6d'),_0xa24d('0x6e'),_0xa24d('0x6f'),_0xa24d('0x7f'),'CampaignId',_0xa24d('0x53'),'updatedAt'],squel['select']()['field'](_0xa24d('0x6d'),_0xa24d('0x6d'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x6e'))[_0xa24d('0x71')]('id',_0xa24d('0x6f'))[_0xa24d('0x71')](_0x4808e5['CmListId'][_0xa24d('0x7d')](),_0xa24d('0x7f'))[_0xa24d('0x71')](_0x24acd1[_0xa24d('0x43')]['id'][_0xa24d('0x7d')](),_0xa24d('0x59'))[_0xa24d('0x71')]('NOW()',_0xa24d('0x53'))[_0xa24d('0x71')]('NOW()',_0xa24d('0x54'))[_0xa24d('0x74')](_0xa24d('0x75'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xa24d('0x77'),_0x4808e5['CmListId'][_0xa24d('0x7d')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xa24d('0x39')](_0xa24d('0x79'),squel[_0xa24d('0x70')]()['field'](_0xa24d('0x80'))[_0xa24d('0x74')]('cm_hopper')['where'](_0xa24d('0x7c'),_0x24acd1[_0xa24d('0x43')]['id']['toString']())))[_0xa24d('0x7d')]();break;default:_0x3b65c7=squel[_0xa24d('0x6a')]()[_0xa24d('0x81')](_0xa24d('0x6b'))[_0xa24d('0x6c')](['phone',_0xa24d('0x6e'),_0xa24d('0x6f'),_0xa24d('0x7f'),'CampaignId',_0xa24d('0x53'),_0xa24d('0x54')],squel[_0xa24d('0x70')]()[_0xa24d('0x71')](_0xa24d('0x6d'),_0xa24d('0x6d'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x6e'))['field']('id',_0xa24d('0x6f'))[_0xa24d('0x71')](_0x4808e5['CmListId'][_0xa24d('0x7d')](),_0xa24d('0x7f'))[_0xa24d('0x71')](_0x24acd1['params']['id']['toString'](),_0xa24d('0x59'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x53'))['field'](_0xa24d('0x72'),_0xa24d('0x54'))[_0xa24d('0x74')](_0xa24d('0x75'))[_0xa24d('0x39')]('deletedAt\x20IS\x20NULL')[_0xa24d('0x39')](_0xa24d('0x77'),_0x4808e5['CmListId']['toString']())[_0xa24d('0x39')](_0xa24d('0x78')))[_0xa24d('0x7d')]();}_0x38f473[_0xa24d('0x82')](db['sequelize']['query'](_0x3b65c7));}return BPromise[_0xa24d('0x83')](_0x38f473);}})[_0xa24d('0x24')](function(){return _0x4d0856;})[_0xa24d('0x24')](respondWithResult(_0x4571ef,null))[_0xa24d('0x41')](handleError(_0x4571ef,null));};exports[_0xa24d('0x84')]=function(_0x53af8f,_0x5702ac,_0x4b2ae9){return db[_0xa24d('0x2d')][_0xa24d('0x4d')]({'where':{'id':_0x53af8f['params']['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x5702ac,null))[_0xa24d('0x24')](function(_0x38697d){if(_0x38697d){return _0x38697d['removeLists'](_0x53af8f[_0xa24d('0x31')][_0xa24d('0x66')]);}})[_0xa24d('0x24')](function(_0x3e8055){if(_0x3e8055){return db['CmHopper'][_0xa24d('0x25')]({'where':{'ListId':_0x53af8f[_0xa24d('0x31')][_0xa24d('0x66')],'CampaignId':_0x53af8f[_0xa24d('0x43')]['id']}})['then'](function(){return _0x3e8055;});}})[_0xa24d('0x24')](respondWithStatusCode(_0x5702ac,null))[_0xa24d('0x41')](handleError(_0x5702ac,null));};exports[_0xa24d('0x85')]=function(_0x224913,_0x3d302c,_0x3ddbd0){var _0x44afbe={};var _0x2e7981={};var _0xdfb0d6;var _0x75a901;return db[_0xa24d('0x2d')][_0xa24d('0x5d')]({'where':{'id':_0x224913['params']['id']}})['then'](handleEntityNotFound(_0x3d302c,null))[_0xa24d('0x24')](function(_0x4ecdf8){if(_0x4ecdf8){_0xdfb0d6=_0x4ecdf8;_0x2e7981['model']=_[_0xa24d('0x45')](db[_0xa24d('0x64')][_0xa24d('0x44')]);_0x2e7981[_0xa24d('0x31')]=_[_0xa24d('0x45')](_0x224913[_0xa24d('0x31')]);_0x2e7981[_0xa24d('0x3a')]=_[_0xa24d('0x32')](_0x2e7981[_0xa24d('0x30')],_0x2e7981[_0xa24d('0x31')]);_0x44afbe[_0xa24d('0x33')]=_[_0xa24d('0x32')](_0x2e7981['model'],qs['fields'](_0x224913[_0xa24d('0x31')][_0xa24d('0x34')]));_0x44afbe[_0xa24d('0x33')]=_0x44afbe['attributes']['length']?_0x44afbe[_0xa24d('0x33')]:_0x2e7981['model'];_0x44afbe[_0xa24d('0x37')]=qs[_0xa24d('0x38')](_0x224913['query']['sort']);_0x44afbe['where']=qs[_0xa24d('0x3a')](_['pick'](_0x224913['query'],_0x2e7981[_0xa24d('0x3a')]));if(_0x224913[_0xa24d('0x31')][_0xa24d('0x3c')]){_0x44afbe[_0xa24d('0x39')]=_[_0xa24d('0x3d')](_0x44afbe[_0xa24d('0x39')],{'$or':_[_0xa24d('0x2c')](_0x44afbe[_0xa24d('0x33')],function(_0x4432de){var _0x2fb26d={};_0x2fb26d[_0x4432de]={'$like':'%'+_0x224913['query'][_0xa24d('0x3c')]+'%'};return _0x2fb26d;})});}_0x44afbe=_[_0xa24d('0x3d')]({},_0x44afbe,_0x224913['options']);return _0xdfb0d6[_0xa24d('0x85')](_0x44afbe);}})['then'](function(_0x284a5b){if(_0x284a5b){_0x75a901=_0x284a5b[_0xa24d('0x35')];if(!_0x224913['query'][_0xa24d('0x58')](_0xa24d('0x36'))){_0x44afbe[_0xa24d('0x1f')]=qs['limit'](_0x224913['query']['limit']);_0x44afbe[_0xa24d('0x1d')]=qs[_0xa24d('0x1d')](_0x224913[_0xa24d('0x31')][_0xa24d('0x1d')]);}return _0xdfb0d6[_0xa24d('0x85')](_0x44afbe);}})[_0xa24d('0x24')](function(_0x19c76c){if(_0x19c76c){return _0x19c76c?{'count':_0x75a901,'rows':_0x19c76c}:null;}})[_0xa24d('0x24')](respondWithResult(_0x3d302c,null))[_0xa24d('0x41')](handleError(_0x3d302c,null));};exports[_0xa24d('0x86')]=function(_0x20120e,_0x39434e,_0x33d6a4){var _0x9bc232,_0x1e8293;return db[_0xa24d('0x2d')][_0xa24d('0x4d')]({'where':{'id':_0x20120e['params']['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x39434e,null))[_0xa24d('0x24')](function(_0x45e06a){if(_0x45e06a){_0x1e8293=_0x45e06a;return _0x45e06a['addBlackLists'](_0x20120e[_0xa24d('0x48')][_0xa24d('0x66')],_['omit'](_0x20120e[_0xa24d('0x48')],[_0xa24d('0x66'),'id'])||{});}return null;})[_0xa24d('0x67')](function(_0x52f156){var _0x5aa284;_0x9bc232=_0x52f156||[];var _0xdd1189=[];if(_0x52f156){for(var _0x5eab9f=0x0;_0x5eab9f<_0x52f156['length'];_0x5eab9f+=0x1){var _0x5c1d9c=_0x52f156[_0x5eab9f]['get']({'plain':!![]});_0x5aa284=squel[_0xa24d('0x6a')]()['into'](_0xa24d('0x87'))[_0xa24d('0x6c')](['phone',_0xa24d('0x6f'),_0xa24d('0x7f'),_0xa24d('0x59'),_0xa24d('0x53'),'updatedAt'],squel[_0xa24d('0x70')]()[_0xa24d('0x71')]('phone',_0xa24d('0x6d'))[_0xa24d('0x71')]('id',_0xa24d('0x6f'))['field'](_0x5c1d9c[_0xa24d('0x73')][_0xa24d('0x7d')](),_0xa24d('0x7f'))[_0xa24d('0x71')](_0x20120e[_0xa24d('0x43')]['id'][_0xa24d('0x7d')](),_0xa24d('0x59'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x53'))[_0xa24d('0x71')](_0xa24d('0x72'),_0xa24d('0x54'))[_0xa24d('0x74')]('cm_contacts')[_0xa24d('0x39')](_0xa24d('0x76'))['where'](_0xa24d('0x77'),_0x5c1d9c[_0xa24d('0x73')]['toString']())[_0xa24d('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xa24d('0x7d')]();_0xdd1189[_0xa24d('0x82')](db[_0xa24d('0x88')]['query'](_0x5aa284));}return BPromise[_0xa24d('0x83')](_0xdd1189);}})[_0xa24d('0x24')](function(){return _0x9bc232;})[_0xa24d('0x24')](respondWithResult(_0x39434e,null))['catch'](handleError(_0x39434e,null));};exports[_0xa24d('0x89')]=function(_0x109ffc,_0x23273f,_0x2ff354){return db[_0xa24d('0x2d')]['find']({'where':{'id':_0x109ffc[_0xa24d('0x43')]['id']}})[_0xa24d('0x24')](handleEntityNotFound(_0x23273f,null))[_0xa24d('0x24')](function(_0x4cf51e){if(_0x4cf51e){return _0x4cf51e[_0xa24d('0x89')](_0x109ffc[_0xa24d('0x31')][_0xa24d('0x66')]);}})[_0xa24d('0x24')](function(_0x5299c8){if(_0x5299c8){return db[_0xa24d('0x62')]['destroy']({'where':{'ListId':_0x109ffc[_0xa24d('0x31')][_0xa24d('0x66')],'CampaignId':_0x109ffc['params']['id']}})[_0xa24d('0x24')](function(){return _0x5299c8;});}})['then'](respondWithStatusCode(_0x23273f,null))[_0xa24d('0x41')](handleError(_0x23273f,null));};
\ No newline at end of file
index 0e45ee5..624d67a 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(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xe47817,_0xc0c4b2){var _0x5df0eb=function(_0x3f1a70){while(--_0x3f1a70){_0xe47817['push'](_0xe47817['shift']());}};_0x5df0eb(++_0xc0c4b2);}(_0x7a54,0x106));var _0x47a5=function(_0x58d421,_0x45d801){_0x58d421=_0x58d421-0x0;var _0x3bd4f7=_0x7a54[_0x58d421];return _0x3bd4f7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bcd5238..e5a8342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e83=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x842858,_0x3a3ca0){var _0x46c2a2=function(_0x47f795){while(--_0x47f795){_0x842858['push'](_0x842858['shift']());}};_0x46c2a2(++_0x3a3ca0);}(_0x4e83,0x88));var _0x34e8=function(_0x38230,_0x148d0c){_0x38230=_0x38230-0x0;var _0x522ec9=_0x4e83[_0x38230];return _0x522ec9;};'use strict';var _=require('lodash');var util=require(_0x34e8('0x0'));var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34e8('0x4'))['db'];var utils=require(_0x34e8('0x5'));var logger=require(_0x34e8('0x6'))(_0x34e8('0x7'));var config=require(_0x34e8('0x8'));var jayson=require(_0x34e8('0x9'));var client=jayson[_0x34e8('0xa')][_0x34e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x320b00,_0x146a1f,_0x188f11){return new BPromise(function(_0x18e178,_0x3ace57){return client['request'](_0x320b00,_0x188f11)[_0x34e8('0xc')](function(_0x200425){logger[_0x34e8('0xd')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0x34e8('0xe'));logger[_0x34e8('0xf')](_0x34e8('0x10'),_0x146a1f,_0x34e8('0xe'),JSON[_0x34e8('0x11')](_0x200425));if(_0x200425['error']){if(_0x200425[_0x34e8('0x12')]['code']===0x1f4){logger[_0x34e8('0x12')](_0x34e8('0x13'),_0x146a1f,_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);return _0x3ace57(_0x200425[_0x34e8('0x12')][_0x34e8('0x14')]);}logger['error'](_0x34e8('0x13'),_0x146a1f,_0x200425['error'][_0x34e8('0x14')]);return _0x18e178(_0x200425['error'][_0x34e8('0x14')]);}else{logger[_0x34e8('0xd')](_0x34e8('0x13'),_0x146a1f,'request\x20sent');_0x18e178(_0x200425[_0x34e8('0x15')]['message']);}})[_0x34e8('0x16')](function(_0xed8219){logger[_0x34e8('0x12')]('Campaign,\x20%s,\x20%s',_0x146a1f,_0xed8219);_0x3ace57(_0xed8219);});});}exports[_0x34e8('0x17')]=function(_0x1a2fa7){var _0x3b83bb=this;return new Promise(function(_0x38edda,_0x326416){return db[_0x34e8('0x18')][_0x34e8('0x19')]({'raw':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1a2fa7['options']?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1c')]||null:null,'attributes':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1d')]||null:null,'limit':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1e')]||null:null,'include':_0x1a2fa7[_0x34e8('0x1a')]?_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x1a2fa7[_0x34e8('0x1a')][_0x34e8('0x1f')],function(_0x2e04f8){return{'model':db[_0x2e04f8[_0x34e8('0x21')]],'as':_0x2e04f8['as'],'attributes':_0x2e04f8[_0x34e8('0x1d')],'include':_0x2e04f8[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x2e04f8[_0x34e8('0x1f')],function(_0x4d8780){return{'model':db[_0x4d8780['model']],'as':_0x4d8780['as'],'attributes':_0x4d8780['attributes'],'include':_0x4d8780[_0x34e8('0x1f')]?_[_0x34e8('0x20')](_0x4d8780[_0x34e8('0x1f')],function(_0x2b1179){return{'model':db[_0x2b1179['model']],'as':_0x2b1179['as'],'attributes':_0x2b1179[_0x34e8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1440d0){logger['info'](_0x34e8('0x17'),_0x1a2fa7);logger['debug'](_0x34e8('0x17'),_0x1a2fa7,JSON[_0x34e8('0x11')](_0x1440d0));_0x38edda(_0x1440d0);})[_0x34e8('0x16')](function(_0x1bb4f3){logger['error'](_0x34e8('0x17'),_0x1bb4f3[_0x34e8('0x14')],_0x1a2fa7);_0x326416(_0x3b83bb[_0x34e8('0x12')](0x1f4,_0x1bb4f3['message']));});});};
\ No newline at end of file
+var _0x7a72=['../../config/logger','../../config/environment','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Campaign','options','raw','where','limit','map','include','model','attributes','info','GetCampaign','catch','util','moment','randomstring','../../mysqldb'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7a72,0x1be));var _0x27a7=function(_0x57112d,_0xcfed7d){_0x57112d=_0x57112d-0x0;var _0x5890d9=_0x7a72[_0x57112d];return _0x5890d9;};'use strict';var _=require('lodash');var util=require(_0x27a7('0x0'));var moment=require(_0x27a7('0x1'));var BPromise=require('bluebird');var rs=require(_0x27a7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x27a7('0x4'))('rpc');var config=require(_0x27a7('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x27a7('0x6')][_0x27a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d7305,_0x4ede34,_0x1de957){return new BPromise(function(_0x54e6ee,_0x24e755){return client[_0x27a7('0x8')](_0x5d7305,_0x1de957)[_0x27a7('0x9')](function(_0x248356){logger['info'](_0x27a7('0xa'),_0x4ede34,_0x27a7('0xb'));logger[_0x27a7('0xc')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4ede34,_0x27a7('0xb'),JSON[_0x27a7('0xd')](_0x248356));if(_0x248356['error']){if(_0x248356[_0x27a7('0xe')][_0x27a7('0xf')]===0x1f4){logger['error'](_0x27a7('0xa'),_0x4ede34,_0x248356[_0x27a7('0xe')][_0x27a7('0x10')]);return _0x24e755(_0x248356[_0x27a7('0xe')][_0x27a7('0x10')]);}logger[_0x27a7('0xe')]('Campaign,\x20%s,\x20%s',_0x4ede34,_0x248356['error'][_0x27a7('0x10')]);return _0x54e6ee(_0x248356['error'][_0x27a7('0x10')]);}else{logger['info'](_0x27a7('0xa'),_0x4ede34,_0x27a7('0xb'));_0x54e6ee(_0x248356[_0x27a7('0x11')][_0x27a7('0x10')]);}})['catch'](function(_0x576e79){logger[_0x27a7('0xe')](_0x27a7('0xa'),_0x4ede34,_0x576e79);_0x24e755(_0x576e79);});});}exports['GetCampaign']=function(_0x41074f){var _0x2c82ab=this;return new Promise(function(_0xaf0c9e,_0xe506ee){return db[_0x27a7('0x12')]['findAll']({'raw':_0x41074f[_0x27a7('0x13')]?_0x41074f['options'][_0x27a7('0x14')]===undefined?!![]:![]:!![],'where':_0x41074f[_0x27a7('0x13')]?_0x41074f['options'][_0x27a7('0x15')]||null:null,'attributes':_0x41074f['options']?_0x41074f[_0x27a7('0x13')]['attributes']||null:null,'limit':_0x41074f[_0x27a7('0x13')]?_0x41074f[_0x27a7('0x13')][_0x27a7('0x16')]||null:null,'include':_0x41074f[_0x27a7('0x13')]?_0x41074f['options']['include']?_[_0x27a7('0x17')](_0x41074f[_0x27a7('0x13')][_0x27a7('0x18')],function(_0x5bf3d7){return{'model':db[_0x5bf3d7[_0x27a7('0x19')]],'as':_0x5bf3d7['as'],'attributes':_0x5bf3d7[_0x27a7('0x1a')],'include':_0x5bf3d7[_0x27a7('0x18')]?_[_0x27a7('0x17')](_0x5bf3d7[_0x27a7('0x18')],function(_0x1b5128){return{'model':db[_0x1b5128[_0x27a7('0x19')]],'as':_0x1b5128['as'],'attributes':_0x1b5128[_0x27a7('0x1a')],'include':_0x1b5128[_0x27a7('0x18')]?_[_0x27a7('0x17')](_0x1b5128[_0x27a7('0x18')],function(_0x517b8f){return{'model':db[_0x517b8f[_0x27a7('0x19')]],'as':_0x517b8f['as'],'attributes':_0x517b8f[_0x27a7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x27a7('0x9')](function(_0x2fcfce){logger[_0x27a7('0x1b')](_0x27a7('0x1c'),_0x41074f);logger[_0x27a7('0xc')](_0x27a7('0x1c'),_0x41074f,JSON[_0x27a7('0xd')](_0x2fcfce));_0xaf0c9e(_0x2fcfce);})[_0x27a7('0x1d')](function(_0x3b8471){logger['error'](_0x27a7('0x1c'),_0x3b8471[_0x27a7('0x10')],_0x41074f);_0xe506ee(_0x2c82ab['error'](0x1f4,_0x3b8471[_0x27a7('0x10')]));});});};
\ No newline at end of file
index acd47be..4135ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7800=['path','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','post','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x8e6768,_0x997aad){var _0x4db9e9=function(_0x530ccb){while(--_0x530ccb){_0x8e6768['push'](_0x8e6768['shift']());}};_0x4db9e9(++_0x997aad);}(_0x7800,0x1ee));var _0x0780=function(_0x529287,_0x23957c){_0x529287=_0x529287-0x0;var _0x10936e=_0x7800[_0x529287];return _0x10936e;};'use strict';var multer=require(_0x0780('0x0'));var util=require(_0x0780('0x1'));var path=require(_0x0780('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0780('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0780('0x4'));var config=require(_0x0780('0x5'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0780('0x6')]);router[_0x0780('0x7')](_0x0780('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x0780('0x7')](_0x0780('0x9'),auth[_0x0780('0xa')](),controller[_0x0780('0xb')]);router[_0x0780('0x7')](_0x0780('0xc'),auth[_0x0780('0xa')](),controller['getHopperHistories']);router[_0x0780('0x7')](_0x0780('0xd'),auth['isAuthenticated'](),controller[_0x0780('0xe')]);router[_0x0780('0x7')](_0x0780('0xf'),auth[_0x0780('0xa')](),controller[_0x0780('0x10')]);router[_0x0780('0x7')]('/:id/lists',auth[_0x0780('0xa')](),controller[_0x0780('0x11')]);router[_0x0780('0x7')](_0x0780('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0x0780('0x13')]('/',auth[_0x0780('0xa')](),controller['create']);router[_0x0780('0x13')]('/:id/clone',auth[_0x0780('0xa')](),controller[_0x0780('0x14')]);router[_0x0780('0x13')](_0x0780('0x15'),auth['isAuthenticated'](),controller[_0x0780('0x16')]);router[_0x0780('0x13')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x17')]);router[_0x0780('0x18')]('/:id',auth[_0x0780('0xa')](),controller[_0x0780('0x19')]);router[_0x0780('0x1a')](_0x0780('0x8'),auth['isAuthenticated'](),controller[_0x0780('0x1b')]);router['delete'](_0x0780('0x15'),auth[_0x0780('0xa')](),controller[_0x0780('0x1c')]);router[_0x0780('0x1a')]('/:id/blacklists',auth[_0x0780('0xa')](),controller[_0x0780('0x1d')]);module[_0x0780('0x1e')]=router;
\ No newline at end of file
+var _0xf58a=['getBlackLists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists','exports','util','Router','fs-extra','./campaign.controller','isAuthenticated','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x4df9f0,_0x10eff9){var _0x2f375f=function(_0x19807b){while(--_0x19807b){_0x4df9f0['push'](_0x4df9f0['shift']());}};_0x2f375f(++_0x10eff9);}(_0xf58a,0x1a3));var _0xaf58=function(_0x59eeaf,_0x56e107){_0x59eeaf=_0x59eeaf-0x0;var _0x119d61=_0xf58a[_0x59eeaf];return _0x119d61;};'use strict';var multer=require('multer');var util=require(_0xaf58('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf58('0x1')]();var fs_extra=require(_0xaf58('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaf58('0x3'));router['get']('/',auth[_0xaf58('0x4')](),controller['index']);router[_0xaf58('0x5')](_0xaf58('0x6'),auth['isAuthenticated'](),controller[_0xaf58('0x7')]);router[_0xaf58('0x5')](_0xaf58('0x8'),auth[_0xaf58('0x4')](),controller['getHoppers']);router[_0xaf58('0x5')](_0xaf58('0x9'),auth['isAuthenticated'](),controller[_0xaf58('0xa')]);router[_0xaf58('0x5')](_0xaf58('0xb'),auth[_0xaf58('0x4')](),controller[_0xaf58('0xc')]);router['get'](_0xaf58('0xd'),auth['isAuthenticated'](),controller[_0xaf58('0xe')]);router[_0xaf58('0x5')](_0xaf58('0xf'),auth[_0xaf58('0x4')](),controller['getLists']);router[_0xaf58('0x5')]('/:id/blacklists',auth[_0xaf58('0x4')](),controller[_0xaf58('0x10')]);router[_0xaf58('0x11')]('/',auth[_0xaf58('0x4')](),controller[_0xaf58('0x12')]);router['post'](_0xaf58('0x13'),auth[_0xaf58('0x4')](),controller[_0xaf58('0x14')]);router[_0xaf58('0x11')]('/:id/lists',auth[_0xaf58('0x4')](),controller['addLists']);router[_0xaf58('0x11')](_0xaf58('0x15'),auth[_0xaf58('0x4')](),controller[_0xaf58('0x16')]);router[_0xaf58('0x17')](_0xaf58('0x6'),auth[_0xaf58('0x4')](),controller[_0xaf58('0x18')]);router[_0xaf58('0x19')](_0xaf58('0x6'),auth[_0xaf58('0x4')](),controller[_0xaf58('0x1a')]);router[_0xaf58('0x19')]('/:id/lists',auth[_0xaf58('0x4')](),controller[_0xaf58('0x1b')]);router[_0xaf58('0x19')](_0xaf58('0x15'),auth[_0xaf58('0x4')](),controller['removeBlackLists']);module[_0xaf58('0x1c')]=router;
\ No newline at end of file
index d01e760..c6fc3a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5399=['sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x5399,0xeb));var _0x9539=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x5399[_0x44ceee];return _0x1a065c;};'use strict';var Sequelize=require(_0x9539('0x0'));module[_0x9539('0x1')]={'key':{'type':Sequelize[_0x9539('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9539('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9539('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9539('0x4')]('key');}}};
\ No newline at end of file
+var _0x4a08=['STRING','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4a08,0x1c0));var _0x84a0=function(_0x4e1694,_0x5eede1){_0x4e1694=_0x4e1694-0x0;var _0x1f44d3=_0x4a08[_0x4e1694];return _0x1f44d3;};'use strict';var Sequelize=require(_0x84a0('0x0'));module[_0x84a0('0x1')]={'key':{'type':Sequelize[_0x84a0('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x84a0('0x3')],'get':function(){return this[_0x84a0('0x4')]('key');}}};
\ No newline at end of file
index 3cf4531..ce160f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x258b=['rawAttributes','fieldName','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','CannedAnswer','includeAll','include','catch','show','params','keys','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','mustache','util','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','index'];(function(_0x1e7d26,_0x208a83){var _0x26d190=function(_0x15f3d3){while(--_0x15f3d3){_0x1e7d26['push'](_0x1e7d26['shift']());}};_0x26d190(++_0x208a83);}(_0x258b,0x81));var _0xb258=function(_0x12e32e,_0x158771){_0x12e32e=_0x12e32e-0x0;var _0x306637=_0x258b[_0x12e32e];return _0x306637;};'use strict';var emlformat=require(_0xb258('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb258('0x1'));var util=require(_0xb258('0x2'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb258('0x3'));var squel=require(_0xb258('0x4'));var crypto=require(_0xb258('0x5'));var jsforce=require(_0xb258('0x6'));var deskjs=require('desk.js');var toCsv=require(_0xb258('0x7'));var querystring=require(_0xb258('0x8'));var Papa=require(_0xb258('0x9'));var Redis=require(_0xb258('0xa'));var authService=require(_0xb258('0xb'));var qs=require(_0xb258('0xc'));var as=require(_0xb258('0xd'));var hardwareService=require(_0xb258('0xe'));var logger=require(_0xb258('0xf'))(_0xb258('0x10'));var utils=require('../../config/utils');var config=require(_0xb258('0x11'));var licenseUtil=require(_0xb258('0x12'));var db=require(_0xb258('0x13'))['db'];function respondWithStatusCode(_0x251617,_0x53008a){_0x53008a=_0x53008a||0xcc;return function(_0x2a7d5e){if(_0x2a7d5e){return _0x251617['sendStatus'](_0x53008a);}return _0x251617['status'](_0x53008a)[_0xb258('0x14')]();};}function respondWithResult(_0x46bce1,_0x581d34){_0x581d34=_0x581d34||0xc8;return function(_0x56144e){if(_0x56144e){return _0x46bce1[_0xb258('0x15')](_0x581d34)['json'](_0x56144e);}};}function respondWithFilteredResult(_0x44b235,_0x2d33a9){return function(_0x4f937f){if(_0x4f937f){var _0x32b69a=typeof _0x2d33a9[_0xb258('0x16')]===_0xb258('0x17')&&typeof _0x2d33a9[_0xb258('0x18')]===_0xb258('0x17');var _0x36586e=_0x4f937f[_0xb258('0x19')];var _0x78fe6d=_0x32b69a?0x0:_0x2d33a9[_0xb258('0x16')];var _0x1ac322=_0x32b69a?_0x4f937f[_0xb258('0x19')]:_0x2d33a9[_0xb258('0x16')]+_0x2d33a9[_0xb258('0x18')];var _0x2bb02c;if(_0x1ac322>=_0x36586e){_0x1ac322=_0x36586e;_0x2bb02c=0xc8;}else{_0x2bb02c=0xce;}_0x44b235[_0xb258('0x15')](_0x2bb02c);return _0x44b235[_0xb258('0x1a')](_0xb258('0x1b'),_0x78fe6d+'-'+_0x1ac322+'/'+_0x36586e)[_0xb258('0x1c')](_0x4f937f);}return null;};}function patchUpdates(_0x5851c4){return function(_0x1c80c2){try{jsonpatch[_0xb258('0x1d')](_0x1c80c2,_0x5851c4,!![]);}catch(_0x2b8fa9){return BPromise[_0xb258('0x1e')](_0x2b8fa9);}return _0x1c80c2[_0xb258('0x1f')]();};}function saveUpdates(_0x42a14b,_0x1458ac){return function(_0xb4069f){if(_0xb4069f){return _0xb4069f[_0xb258('0x20')](_0x42a14b)[_0xb258('0x21')](function(_0x32aaea){return _0x32aaea;});}return null;};}function removeEntity(_0x19514e,_0xe2fc8a){return function(_0xe4ddf0){if(_0xe4ddf0){return _0xe4ddf0[_0xb258('0x22')]()[_0xb258('0x21')](function(){var _0x3dd7c6=_0xe4ddf0[_0xb258('0x23')]({'plain':!![]});var _0x215416=_0xb258('0x24');return db[_0xb258('0x25')][_0xb258('0x22')]({'where':{'type':_0x215416,'resourceId':_0x3dd7c6['id']}})['then'](function(){return _0xe4ddf0;});})[_0xb258('0x21')](function(){_0x19514e[_0xb258('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420e48,_0x2c649a){return function(_0x52011e){if(!_0x52011e){_0x420e48[_0xb258('0x26')](0x194);}return _0x52011e;};}function handleError(_0x32633c,_0x24ea6e){_0x24ea6e=_0x24ea6e||0x1f4;return function(_0x39f68e){logger[_0xb258('0x27')](_0x39f68e[_0xb258('0x28')]);if(_0x39f68e[_0xb258('0x29')]){delete _0x39f68e[_0xb258('0x29')];}_0x32633c[_0xb258('0x15')](_0x24ea6e)['send'](_0x39f68e);};}exports[_0xb258('0x2a')]=function(_0x56db73,_0x164900){var _0x6e43c5={},_0x31507b={},_0x505b76={'count':0x0,'rows':[]};var _0x41be0a=_['map'](db['CannedAnswer'][_0xb258('0x2b')],function(_0x1fd5da){return{'name':_0x1fd5da[_0xb258('0x2c')],'type':_0x1fd5da['type'][_0xb258('0x2d')]};});_0x31507b[_0xb258('0x2e')]=_[_0xb258('0x2f')](_0x41be0a,_0xb258('0x29'));_0x31507b[_0xb258('0x30')]=_['keys'](_0x56db73[_0xb258('0x30')]);_0x31507b['filters']=_[_0xb258('0x31')](_0x31507b[_0xb258('0x2e')],_0x31507b[_0xb258('0x30')]);_0x6e43c5['attributes']=_[_0xb258('0x31')](_0x31507b['model'],qs[_0xb258('0x32')](_0x56db73[_0xb258('0x30')]['fields']));_0x6e43c5[_0xb258('0x33')]=_0x6e43c5[_0xb258('0x33')][_0xb258('0x34')]?_0x6e43c5[_0xb258('0x33')]:_0x31507b[_0xb258('0x2e')];if(!_0x56db73[_0xb258('0x30')][_0xb258('0x35')](_0xb258('0x36'))){_0x6e43c5['limit']=qs[_0xb258('0x18')](_0x56db73[_0xb258('0x30')][_0xb258('0x18')]);_0x6e43c5['offset']=qs['offset'](_0x56db73[_0xb258('0x30')]['offset']);}_0x6e43c5[_0xb258('0x37')]=qs['sort'](_0x56db73[_0xb258('0x30')][_0xb258('0x38')]);_0x6e43c5[_0xb258('0x39')]=qs[_0xb258('0x3a')](_[_0xb258('0x3b')](_0x56db73[_0xb258('0x30')],_0x31507b[_0xb258('0x3a')]),_0x41be0a);if(_0x56db73['query']['filter']){_0x6e43c5[_0xb258('0x39')]=_[_0xb258('0x3c')](_0x6e43c5[_0xb258('0x39')],{'$or':[{'key':{'$like':'%'+_0x56db73[_0xb258('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x56db73[_0xb258('0x30')][_0xb258('0x3d')]+'%'}}]});}_0x6e43c5=_['merge']({},_0x6e43c5,_0x56db73[_0xb258('0x3e')]);var _0x2db763={'where':_0x6e43c5['where']};return db[_0xb258('0x3f')][_0xb258('0x19')](_0x2db763)[_0xb258('0x21')](function(_0x53168b){_0x505b76['count']=_0x53168b;if(_0x56db73[_0xb258('0x30')][_0xb258('0x40')]){_0x6e43c5[_0xb258('0x41')]=[{'all':!![]}];}return db[_0xb258('0x3f')]['findAll'](_0x6e43c5);})['then'](function(_0xc35bf9){_0x505b76['rows']=_0xc35bf9;return _0x505b76;})[_0xb258('0x21')](respondWithFilteredResult(_0x164900,_0x6e43c5))[_0xb258('0x42')](handleError(_0x164900,null));};exports[_0xb258('0x43')]=function(_0x255969,_0x561487){var _0x2a3df6={'raw':!![],'where':{'id':_0x255969[_0xb258('0x44')]['id']}},_0x2a4689={};_0x2a4689['model']=_[_0xb258('0x45')](db[_0xb258('0x3f')][_0xb258('0x2b')]);_0x2a4689[_0xb258('0x30')]=_[_0xb258('0x45')](_0x255969[_0xb258('0x30')]);_0x2a4689[_0xb258('0x3a')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],_0x2a4689[_0xb258('0x30')]);_0x2a3df6[_0xb258('0x33')]=_[_0xb258('0x31')](_0x2a4689[_0xb258('0x2e')],qs[_0xb258('0x32')](_0x255969[_0xb258('0x30')][_0xb258('0x32')]));_0x2a3df6[_0xb258('0x33')]=_0x2a3df6[_0xb258('0x33')][_0xb258('0x34')]?_0x2a3df6[_0xb258('0x33')]:_0x2a4689[_0xb258('0x2e')];if(_0x255969[_0xb258('0x30')]['includeAll']){_0x2a3df6[_0xb258('0x41')]=[{'all':!![]}];}_0x2a3df6=_[_0xb258('0x3c')]({},_0x2a3df6,_0x255969[_0xb258('0x3e')]);return db[_0xb258('0x3f')][_0xb258('0x46')](_0x2a3df6)[_0xb258('0x21')](handleEntityNotFound(_0x561487,null))['then'](respondWithResult(_0x561487,null))[_0xb258('0x42')](handleError(_0x561487,null));};exports[_0xb258('0x20')]=function(_0x12c5a1,_0x2b0f56){if(_0x12c5a1[_0xb258('0x47')]['id']){delete _0x12c5a1[_0xb258('0x47')]['id'];}return db[_0xb258('0x3f')]['find']({'where':{'id':_0x12c5a1[_0xb258('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b0f56,null))[_0xb258('0x21')](saveUpdates(_0x12c5a1[_0xb258('0x47')],null))[_0xb258('0x21')](respondWithResult(_0x2b0f56,null))[_0xb258('0x42')](handleError(_0x2b0f56,null));};exports[_0xb258('0x22')]=function(_0x3dc865,_0x282b89){return db[_0xb258('0x3f')][_0xb258('0x46')]({'where':{'id':_0x3dc865[_0xb258('0x44')]['id']}})[_0xb258('0x21')](handleEntityNotFound(_0x282b89,null))['then'](removeEntity(_0x282b89,null))[_0xb258('0x42')](handleError(_0x282b89,null));};exports['create']=function(_0x16776c,_0x16f6bb){var _0x1bb3f5={'key':_0x16776c[_0xb258('0x47')]['key']};if(_0x16776c[_0xb258('0x47')]['MailAccountId']){_0x1bb3f5[_0xb258('0x48')]=_0x16776c[_0xb258('0x47')][_0xb258('0x48')];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x49')]){_0x1bb3f5[_0xb258('0x49')]=_0x16776c[_0xb258('0x47')]['SmsAccountId'];}else if(_0x16776c[_0xb258('0x47')][_0xb258('0x4a')]){_0x1bb3f5['OpenchannelAccountId']=_0x16776c[_0xb258('0x47')][_0xb258('0x4a')];}else if(_0x16776c[_0xb258('0x47')]['ChatWebsiteId']){_0x1bb3f5[_0xb258('0x4b')]=_0x16776c['body'][_0xb258('0x4b')];}return db[_0xb258('0x3f')]['find']({'where':_0x1bb3f5})[_0xb258('0x21')](function(_0x581a2d){if(_0x581a2d){throw new db['Sequelize'][(_0xb258('0x4c'))](_0xb258('0x4d'));}return db[_0xb258('0x3f')][_0xb258('0x4e')](_0x16776c[_0xb258('0x47')]);})['then'](function(_0xb8539b){var _0x465545=_0x16776c[_0xb258('0x4f')][_0xb258('0x23')]({'plain':!![]});if(!_0x465545)throw new Error(_0xb258('0x50'));if(_0x465545[_0xb258('0x51')]===_0xb258('0x4f')){var _0x5333cf=_0xb8539b[_0xb258('0x23')]({'plain':!![]});return db[_0xb258('0x52')][_0xb258('0x46')]({'where':{'name':_0xb258('0x24'),'userProfileId':_0x465545[_0xb258('0x53')]},'raw':!![]})['then'](function(_0x32cb34){if(_0x32cb34&&_0x32cb34[_0xb258('0x54')]===0x0){return db[_0xb258('0x25')][_0xb258('0x4e')]({'name':_0x5333cf['name'],'resourceId':_0x5333cf['id'],'type':_0x32cb34[_0xb258('0x29')],'sectionId':_0x32cb34['id']},{})[_0xb258('0x21')](function(){return _0xb8539b;});}else{return _0xb8539b;}})[_0xb258('0x42')](function(_0x2b557e){logger[_0xb258('0x27')](_0xb258('0x55'),_0x2b557e);throw _0x2b557e;});}return _0xb8539b;})[_0xb258('0x21')](respondWithResult(_0x16f6bb,0xc9))['catch'](handleError(_0x16f6bb,null));};
\ No newline at end of file
+var _0x5392=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','params','keys','length','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','CannedAnswers','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1e3cb5,_0xe897e1){var _0x356c2a=function(_0x2af6e1){while(--_0x2af6e1){_0x1e3cb5['push'](_0x1e3cb5['shift']());}};_0x356c2a(++_0xe897e1);}(_0x5392,0xa1));var _0x2539=function(_0x455cb5,_0x573b29){_0x455cb5=_0x455cb5-0x0;var _0x1b64ea=_0x5392[_0x455cb5];return _0x1b64ea;};'use strict';var emlformat=require(_0x2539('0x0'));var rimraf=require(_0x2539('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2539('0x2'));var rp=require(_0x2539('0x3'));var moment=require(_0x2539('0x4'));var BPromise=require(_0x2539('0x5'));var Mustache=require(_0x2539('0x6'));var util=require(_0x2539('0x7'));var path=require('path');var sox=require(_0x2539('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2539('0x9'));var _=require(_0x2539('0xa'));var squel=require(_0x2539('0xb'));var crypto=require(_0x2539('0xc'));var jsforce=require(_0x2539('0xd'));var deskjs=require(_0x2539('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2539('0xf'));var Papa=require('papaparse');var Redis=require(_0x2539('0x10'));var authService=require(_0x2539('0x11'));var qs=require(_0x2539('0x12'));var as=require(_0x2539('0x13'));var hardwareService=require(_0x2539('0x14'));var logger=require(_0x2539('0x15'))('api');var utils=require(_0x2539('0x16'));var config=require(_0x2539('0x17'));var licenseUtil=require(_0x2539('0x18'));var db=require(_0x2539('0x19'))['db'];function respondWithStatusCode(_0x5e1d96,_0xf7cd7b){_0xf7cd7b=_0xf7cd7b||0xcc;return function(_0x4c4dfd){if(_0x4c4dfd){return _0x5e1d96['sendStatus'](_0xf7cd7b);}return _0x5e1d96[_0x2539('0x1a')](_0xf7cd7b)[_0x2539('0x1b')]();};}function respondWithResult(_0x365635,_0x342aae){_0x342aae=_0x342aae||0xc8;return function(_0x59b3bc){if(_0x59b3bc){return _0x365635[_0x2539('0x1a')](_0x342aae)[_0x2539('0x1c')](_0x59b3bc);}};}function respondWithFilteredResult(_0x4cceed,_0x408808){return function(_0x56b2c8){if(_0x56b2c8){var _0x11ea43=typeof _0x408808['offset']==='undefined'&&typeof _0x408808[_0x2539('0x1d')]===_0x2539('0x1e');var _0x5b4c38=_0x56b2c8[_0x2539('0x1f')];var _0x4ed4e0=_0x11ea43?0x0:_0x408808['offset'];var _0x22ea1f=_0x11ea43?_0x56b2c8[_0x2539('0x1f')]:_0x408808[_0x2539('0x20')]+_0x408808['limit'];var _0x63979b;if(_0x22ea1f>=_0x5b4c38){_0x22ea1f=_0x5b4c38;_0x63979b=0xc8;}else{_0x63979b=0xce;}_0x4cceed['status'](_0x63979b);return _0x4cceed[_0x2539('0x21')](_0x2539('0x22'),_0x4ed4e0+'-'+_0x22ea1f+'/'+_0x5b4c38)[_0x2539('0x1c')](_0x56b2c8);}return null;};}function patchUpdates(_0x376b38){return function(_0x433600){try{jsonpatch[_0x2539('0x23')](_0x433600,_0x376b38,!![]);}catch(_0xc8dd1b){return BPromise['reject'](_0xc8dd1b);}return _0x433600['save']();};}function saveUpdates(_0x47ec58,_0x7cf92e){return function(_0x40b417){if(_0x40b417){return _0x40b417['update'](_0x47ec58)['then'](function(_0x50b653){return _0x50b653;});}return null;};}function removeEntity(_0x355ba4,_0x49b951){return function(_0x1010e0){if(_0x1010e0){return _0x1010e0['destroy']()[_0x2539('0x24')](function(){var _0x3214f5=_0x1010e0[_0x2539('0x25')]({'plain':!![]});var _0x2fcfb6='CannedAnswers';return db[_0x2539('0x26')][_0x2539('0x27')]({'where':{'type':_0x2fcfb6,'resourceId':_0x3214f5['id']}})[_0x2539('0x24')](function(){return _0x1010e0;});})[_0x2539('0x24')](function(){_0x355ba4[_0x2539('0x1a')](0xcc)[_0x2539('0x1b')]();});}};}function handleEntityNotFound(_0x435ac1,_0x513b18){return function(_0x17109b){if(!_0x17109b){_0x435ac1[_0x2539('0x28')](0x194);}return _0x17109b;};}function handleError(_0x176aad,_0x5ca876){_0x5ca876=_0x5ca876||0x1f4;return function(_0x516b79){logger['error'](_0x516b79[_0x2539('0x29')]);if(_0x516b79[_0x2539('0x2a')]){delete _0x516b79['name'];}_0x176aad[_0x2539('0x1a')](_0x5ca876)[_0x2539('0x2b')](_0x516b79);};}exports[_0x2539('0x2c')]=function(_0x38c662,_0x2cb092){var _0x41d22d={},_0x72aba5={},_0x31eb47={'count':0x0,'rows':[]};var _0x34cfbc=_[_0x2539('0x2d')](db['CannedAnswer'][_0x2539('0x2e')],function(_0xb14340){return{'name':_0xb14340[_0x2539('0x2f')],'type':_0xb14340[_0x2539('0x30')][_0x2539('0x31')]};});_0x72aba5[_0x2539('0x32')]=_[_0x2539('0x2d')](_0x34cfbc,_0x2539('0x2a'));_0x72aba5[_0x2539('0x33')]=_['keys'](_0x38c662[_0x2539('0x33')]);_0x72aba5[_0x2539('0x34')]=_['intersection'](_0x72aba5[_0x2539('0x32')],_0x72aba5[_0x2539('0x33')]);_0x41d22d[_0x2539('0x35')]=_[_0x2539('0x36')](_0x72aba5[_0x2539('0x32')],qs[_0x2539('0x37')](_0x38c662[_0x2539('0x33')][_0x2539('0x37')]));_0x41d22d[_0x2539('0x35')]=_0x41d22d[_0x2539('0x35')]['length']?_0x41d22d['attributes']:_0x72aba5[_0x2539('0x32')];if(!_0x38c662[_0x2539('0x33')][_0x2539('0x38')]('nolimit')){_0x41d22d[_0x2539('0x1d')]=qs[_0x2539('0x1d')](_0x38c662[_0x2539('0x33')][_0x2539('0x1d')]);_0x41d22d[_0x2539('0x20')]=qs[_0x2539('0x20')](_0x38c662['query']['offset']);}_0x41d22d[_0x2539('0x39')]=qs[_0x2539('0x3a')](_0x38c662[_0x2539('0x33')][_0x2539('0x3a')]);_0x41d22d[_0x2539('0x3b')]=qs[_0x2539('0x34')](_[_0x2539('0x3c')](_0x38c662[_0x2539('0x33')],_0x72aba5[_0x2539('0x34')]),_0x34cfbc);if(_0x38c662[_0x2539('0x33')][_0x2539('0x3d')]){_0x41d22d[_0x2539('0x3b')]=_[_0x2539('0x3e')](_0x41d22d[_0x2539('0x3b')],{'$or':[{'key':{'$like':'%'+_0x38c662[_0x2539('0x33')][_0x2539('0x3d')]+'%'}},{'value':{'$like':'%'+_0x38c662['query'][_0x2539('0x3d')]+'%'}}]});}_0x41d22d=_[_0x2539('0x3e')]({},_0x41d22d,_0x38c662[_0x2539('0x3f')]);var _0x4f81a0={'where':_0x41d22d[_0x2539('0x3b')]};return db[_0x2539('0x40')][_0x2539('0x1f')](_0x4f81a0)['then'](function(_0x2bad69){_0x31eb47[_0x2539('0x1f')]=_0x2bad69;if(_0x38c662['query'][_0x2539('0x41')]){_0x41d22d[_0x2539('0x42')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2539('0x43')](_0x41d22d);})[_0x2539('0x24')](function(_0x577869){_0x31eb47[_0x2539('0x44')]=_0x577869;return _0x31eb47;})[_0x2539('0x24')](respondWithFilteredResult(_0x2cb092,_0x41d22d))[_0x2539('0x45')](handleError(_0x2cb092,null));};exports['show']=function(_0x649afd,_0x4a4f76){var _0x2a2428={'raw':!![],'where':{'id':_0x649afd[_0x2539('0x46')]['id']}},_0x5d653f={};_0x5d653f[_0x2539('0x32')]=_['keys'](db[_0x2539('0x40')][_0x2539('0x2e')]);_0x5d653f[_0x2539('0x33')]=_[_0x2539('0x47')](_0x649afd['query']);_0x5d653f[_0x2539('0x34')]=_[_0x2539('0x36')](_0x5d653f[_0x2539('0x32')],_0x5d653f[_0x2539('0x33')]);_0x2a2428['attributes']=_[_0x2539('0x36')](_0x5d653f[_0x2539('0x32')],qs[_0x2539('0x37')](_0x649afd[_0x2539('0x33')][_0x2539('0x37')]));_0x2a2428[_0x2539('0x35')]=_0x2a2428[_0x2539('0x35')][_0x2539('0x48')]?_0x2a2428[_0x2539('0x35')]:_0x5d653f[_0x2539('0x32')];if(_0x649afd[_0x2539('0x33')][_0x2539('0x41')]){_0x2a2428[_0x2539('0x42')]=[{'all':!![]}];}_0x2a2428=_[_0x2539('0x3e')]({},_0x2a2428,_0x649afd[_0x2539('0x3f')]);return db[_0x2539('0x40')][_0x2539('0x49')](_0x2a2428)[_0x2539('0x24')](handleEntityNotFound(_0x4a4f76,null))['then'](respondWithResult(_0x4a4f76,null))['catch'](handleError(_0x4a4f76,null));};exports[_0x2539('0x4a')]=function(_0x52a6b3,_0x84cda0){if(_0x52a6b3[_0x2539('0x4b')]['id']){delete _0x52a6b3[_0x2539('0x4b')]['id'];}return db[_0x2539('0x40')]['find']({'where':{'id':_0x52a6b3['params']['id']}})[_0x2539('0x24')](handleEntityNotFound(_0x84cda0,null))[_0x2539('0x24')](saveUpdates(_0x52a6b3[_0x2539('0x4b')],null))[_0x2539('0x24')](respondWithResult(_0x84cda0,null))[_0x2539('0x45')](handleError(_0x84cda0,null));};exports['destroy']=function(_0x5d3d68,_0x43d0d8){return db[_0x2539('0x40')][_0x2539('0x49')]({'where':{'id':_0x5d3d68[_0x2539('0x46')]['id']}})[_0x2539('0x24')](handleEntityNotFound(_0x43d0d8,null))['then'](removeEntity(_0x43d0d8,null))['catch'](handleError(_0x43d0d8,null));};exports[_0x2539('0x4c')]=function(_0x5b014f,_0x3186e2){var _0x4e0795={'key':_0x5b014f[_0x2539('0x4b')][_0x2539('0x31')]};if(_0x5b014f[_0x2539('0x4b')][_0x2539('0x4d')]){_0x4e0795['MailAccountId']=_0x5b014f[_0x2539('0x4b')][_0x2539('0x4d')];}else if(_0x5b014f[_0x2539('0x4b')]['SmsAccountId']){_0x4e0795['SmsAccountId']=_0x5b014f[_0x2539('0x4b')][_0x2539('0x4e')];}else if(_0x5b014f[_0x2539('0x4b')][_0x2539('0x4f')]){_0x4e0795['OpenchannelAccountId']=_0x5b014f['body'][_0x2539('0x4f')];}else if(_0x5b014f['body']['ChatWebsiteId']){_0x4e0795[_0x2539('0x50')]=_0x5b014f[_0x2539('0x4b')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x2539('0x49')]({'where':_0x4e0795})[_0x2539('0x24')](function(_0x563dd4){if(_0x563dd4){throw new db[(_0x2539('0x51'))][(_0x2539('0x52'))](_0x2539('0x53'));}return db[_0x2539('0x40')][_0x2539('0x4c')](_0x5b014f[_0x2539('0x4b')]);})[_0x2539('0x24')](function(_0x1732ca){var _0x51aac0=_0x5b014f[_0x2539('0x54')][_0x2539('0x25')]({'plain':!![]});if(!_0x51aac0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51aac0[_0x2539('0x55')]===_0x2539('0x54')){var _0x20eb62=_0x1732ca[_0x2539('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x2539('0x49')]({'where':{'name':_0x2539('0x56'),'userProfileId':_0x51aac0[_0x2539('0x57')]},'raw':!![]})['then'](function(_0x415357){if(_0x415357&&_0x415357['autoAssociation']===0x0){return db[_0x2539('0x26')]['create']({'name':_0x20eb62['name'],'resourceId':_0x20eb62['id'],'type':_0x415357['name'],'sectionId':_0x415357['id']},{})[_0x2539('0x24')](function(){return _0x1732ca;});}else{return _0x1732ca;}})[_0x2539('0x45')](function(_0x27217f){logger[_0x2539('0x58')](_0x2539('0x59'),_0x27217f);throw _0x27217f;});}return _0x1732ca;})[_0x2539('0x24')](respondWithResult(_0x3186e2,0xc9))['catch'](handleError(_0x3186e2,null));};
\ No newline at end of file
index 6425379..7904653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eef=['moment','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x373ac3,_0x4d7851){var _0x11b344=function(_0x40caff){while(--_0x40caff){_0x373ac3['push'](_0x373ac3['shift']());}};_0x11b344(++_0x4d7851);}(_0x8eef,0xb2));var _0xf8ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8eef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf8ee('0x0'));var util=require(_0xf8ee('0x1'));var logger=require(_0xf8ee('0x2'))(_0xf8ee('0x3'));var moment=require(_0xf8ee('0x4'));var BPromise=require('bluebird');var rp=require(_0xf8ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8ee('0x6'));var config=require('../../config/environment');var attributes=require(_0xf8ee('0x7'));module[_0xf8ee('0x8')]=function(_0x5cb281,_0x3c8258){return _0x5cb281[_0xf8ee('0x9')](_0xf8ee('0xa'),attributes,{'tableName':_0xf8ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf8ee('0xc'),'collate':_0xf8ee('0xd')});};
\ No newline at end of file
+var _0x5673=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x28db11,_0x4c2cd){var _0x2c4759=function(_0x2f2f06){while(--_0x2f2f06){_0x28db11['push'](_0x28db11['shift']());}};_0x2c4759(++_0x4c2cd);}(_0x5673,0x145));var _0x3567=function(_0x149319,_0x4182b5){_0x149319=_0x149319-0x0;var _0x4637c9=_0x5673[_0x149319];return _0x4637c9;};'use strict';var _=require(_0x3567('0x0'));var util=require(_0x3567('0x1'));var logger=require(_0x3567('0x2'))(_0x3567('0x3'));var moment=require(_0x3567('0x4'));var BPromise=require(_0x3567('0x5'));var rp=require(_0x3567('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3567('0x7'));var config=require('../../config/environment');var attributes=require(_0x3567('0x8'));module[_0x3567('0x9')]=function(_0x49ded1,_0x2864c3){return _0x49ded1['define'](_0x3567('0xa'),attributes,{'tableName':_0x3567('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3567('0xc')});};
\ No newline at end of file
index 92aa659..1130530 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(_0x35bd13,_0x50086d){var _0x4ee8a0=function(_0x566bd6){while(--_0x566bd6){_0x35bd13['push'](_0x35bd13['shift']());}};_0x4ee8a0(++_0x50086d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x1cd92f,_0x5611f7){var _0x487097=function(_0x39478b){while(--_0x39478b){_0x1cd92f['push'](_0x1cd92f['shift']());}};_0x487097(++_0x5611f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 0b68d26..5026c3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1824=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0xb6b5b4,_0x174061){var _0x1187a6=function(_0x59ba44){while(--_0x59ba44){_0xb6b5b4['push'](_0xb6b5b4['shift']());}};_0x1187a6(++_0x174061);}(_0x1824,0x1b3));var _0x4182=function(_0x31045e,_0x39f65a){_0x31045e=_0x31045e-0x0;var _0x3a31b1=_0x1824[_0x31045e];return _0x3a31b1;};'use strict';var multer=require('multer');var util=require(_0x4182('0x0'));var path=require('path');var timeout=require(_0x4182('0x1'));var express=require(_0x4182('0x2'));var router=express[_0x4182('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4182('0x4'));var interaction=require(_0x4182('0x5'));var config=require(_0x4182('0x6'));var controller=require(_0x4182('0x7'));router[_0x4182('0x8')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xa')]);router[_0x4182('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x4182('0xb')]);router[_0x4182('0xc')]('/',auth[_0x4182('0x9')](),controller[_0x4182('0xd')]);router[_0x4182('0xe')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x10')]);router[_0x4182('0x11')](_0x4182('0xf'),auth['isAuthenticated'](),controller[_0x4182('0x12')]);module[_0x4182('0x13')]=router;
\ No newline at end of file
+var _0x8f07=['index','/:id','show','post','create','put','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x5b192c,_0x56bb3f){var _0x41c977=function(_0x3d7441){while(--_0x3d7441){_0x5b192c['push'](_0x5b192c['shift']());}};_0x41c977(++_0x56bb3f);}(_0x8f07,0x1ed));var _0x78f0=function(_0x339729,_0x2e4c92){_0x339729=_0x339729-0x0;var _0x447ad7=_0x8f07[_0x339729];return _0x447ad7;};'use strict';var multer=require(_0x78f0('0x0'));var util=require('util');var path=require(_0x78f0('0x1'));var timeout=require(_0x78f0('0x2'));var express=require(_0x78f0('0x3'));var router=express[_0x78f0('0x4')]();var fs_extra=require(_0x78f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x78f0('0x6'));var config=require(_0x78f0('0x7'));var controller=require(_0x78f0('0x8'));router[_0x78f0('0x9')]('/',auth[_0x78f0('0xa')](),controller[_0x78f0('0xb')]);router[_0x78f0('0x9')](_0x78f0('0xc'),auth[_0x78f0('0xa')](),controller[_0x78f0('0xd')]);router[_0x78f0('0xe')]('/',auth[_0x78f0('0xa')](),controller[_0x78f0('0xf')]);router[_0x78f0('0x10')]('/:id',auth[_0x78f0('0xa')](),controller['update']);router['delete'](_0x78f0('0xc'),auth[_0x78f0('0xa')](),controller['destroy']);module[_0x78f0('0x11')]=router;
\ No newline at end of file
index daf1a28..5c4c8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x765e=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x1246ea,_0x5e9190){var _0x486c50=function(_0x20fa12){while(--_0x20fa12){_0x1246ea['push'](_0x1246ea['shift']());}};_0x486c50(++_0x5e9190);}(_0x765e,0x131));var _0xe765=function(_0x13082,_0x3a8a83){_0x13082=_0x13082-0x0;var _0x415358=_0x765e[_0x13082];return _0x415358;};'use strict';var Sequelize=require(_0xe765('0x0'));module[_0xe765('0x1')]={'calldate':{'type':Sequelize[_0xe765('0x2')],'allowNull':![],'defaultValue':_0xe765('0x3')},'clid':{'type':Sequelize[_0xe765('0x4')]},'src':{'type':Sequelize[_0xe765('0x4')]},'dst':{'type':Sequelize[_0xe765('0x4')]},'dcontext':{'type':Sequelize[_0xe765('0x4')]},'channel':{'type':Sequelize[_0xe765('0x4')]},'dstchannel':{'type':Sequelize[_0xe765('0x4')]},'lastapp':{'type':Sequelize[_0xe765('0x4')]},'lastdata':{'type':Sequelize[_0xe765('0x4')]},'duration':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe765('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe765('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe765('0x4')]},'userfield':{'type':Sequelize[_0xe765('0x4')]},'uniqueid':{'type':Sequelize[_0xe765('0x4')]},'linkedid':{'type':Sequelize[_0xe765('0x4')]},'sequence':{'type':Sequelize[_0xe765('0x4')]},'peeraccount':{'type':Sequelize[_0xe765('0x4')]},'type':{'type':Sequelize[_0xe765('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x225c=['STRING','INTEGER','sequelize','exports'];(function(_0x7272a2,_0x2d3660){var _0x3dedd1=function(_0x47a822){while(--_0x47a822){_0x7272a2['push'](_0x7272a2['shift']());}};_0x3dedd1(++_0x2d3660);}(_0x225c,0x106));var _0xc225=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x225c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc225('0x0'));module[_0xc225('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xc225('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xc225('0x2')]},'dcontext':{'type':Sequelize[_0xc225('0x2')]},'channel':{'type':Sequelize[_0xc225('0x2')]},'dstchannel':{'type':Sequelize[_0xc225('0x2')]},'lastapp':{'type':Sequelize[_0xc225('0x2')]},'lastdata':{'type':Sequelize[_0xc225('0x2')]},'duration':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc225('0x2')]},'amaflags':{'type':Sequelize[_0xc225('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc225('0x2')]},'userfield':{'type':Sequelize[_0xc225('0x2')]},'uniqueid':{'type':Sequelize[_0xc225('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xc225('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc225('0x2')]},'tag':{'type':Sequelize[_0xc225('0x2')]}};
\ No newline at end of file
index fad15c8..d1a6f7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','Cdr','fieldName','type','model','query','keys','filters'];(function(_0x2b5a7c,_0x223e71){var _0x1a407c=function(_0x341466){while(--_0x341466){_0x2b5a7c['push'](_0x2b5a7c['shift']());}};_0x1a407c(++_0x223e71);}(_0x5fc3,0xa8));var _0x35fc=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x5fc3[_0x334599];return _0x4cdff2;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}exports['index']=function(_0x26b7cb,_0x645eac){var _0x383837={},_0x9f3c8a={},_0x3735da={'count':0x0,'rows':[]};var _0x134dfa=_[_0x35fc('0x28')](db[_0x35fc('0x29')]['rawAttributes'],function(_0x1cd1ae){return{'name':_0x1cd1ae[_0x35fc('0x2a')],'type':_0x1cd1ae[_0x35fc('0x2b')]['key']};});_0x9f3c8a[_0x35fc('0x2c')]=_[_0x35fc('0x28')](_0x134dfa,_0x35fc('0x26'));_0x9f3c8a[_0x35fc('0x2d')]=_[_0x35fc('0x2e')](_0x26b7cb[_0x35fc('0x2d')]);_0x9f3c8a[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x9f3c8a[_0x35fc('0x2c')],_0x9f3c8a[_0x35fc('0x2d')]);_0x383837['attributes']=_['intersection'](_0x9f3c8a[_0x35fc('0x2c')],qs['fields'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x31')]));_0x383837[_0x35fc('0x32')]=_0x383837[_0x35fc('0x32')][_0x35fc('0x33')]?_0x383837[_0x35fc('0x32')]:_0x9f3c8a['model'];if(!_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x34')](_0x35fc('0x35'))){_0x383837[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x26b7cb[_0x35fc('0x2d')]['limit']);_0x383837[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x26b7cb[_0x35fc('0x2d')]['offset']);}_0x383837[_0x35fc('0x36')]=qs['sort'](_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x37')]);_0x383837[_0x35fc('0x38')]=qs[_0x35fc('0x2f')](_['pick'](_0x26b7cb['query'],_0x9f3c8a['filters']),_0x134dfa);if(_0x26b7cb[_0x35fc('0x2d')]['filter']){_0x383837[_0x35fc('0x38')]=_['merge'](_0x383837[_0x35fc('0x38')],{'$or':_[_0x35fc('0x28')](_0x134dfa,function(_0x2ca9ac){if(_0x2ca9ac[_0x35fc('0x2b')]!==_0x35fc('0x39')){var _0x3313fa={};_0x3313fa[_0x2ca9ac[_0x35fc('0x26')]]={'$like':'%'+_0x26b7cb['query'][_0x35fc('0x3a')]+'%'};return _0x3313fa;}})});}_0x383837=_[_0x35fc('0x3b')]({},_0x383837,_0x26b7cb['options']);var _0x1feda5={'where':_0x383837[_0x35fc('0x38')]};return db[_0x35fc('0x29')][_0x35fc('0x1d')](_0x1feda5)[_0x35fc('0x24')](function(_0x31d926){_0x3735da['count']=_0x31d926;if(_0x26b7cb[_0x35fc('0x2d')][_0x35fc('0x3c')]){_0x383837[_0x35fc('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x35fc('0x3e')](_0x383837);})[_0x35fc('0x24')](function(_0x596919){_0x3735da[_0x35fc('0x3f')]=_0x596919;return _0x3735da;})[_0x35fc('0x24')](respondWithFilteredResult(_0x645eac,_0x383837))[_0x35fc('0x40')](handleError(_0x645eac,null));};exports[_0x35fc('0x41')]=function(_0x331439,_0x2a1cf6){var _0x211b70={'raw':!![],'where':{'id':_0x331439['params']['id']}},_0x3ec51f={};_0x3ec51f['model']=_[_0x35fc('0x2e')](db[_0x35fc('0x29')]['rawAttributes']);_0x3ec51f['query']=_['keys'](_0x331439[_0x35fc('0x2d')]);_0x3ec51f[_0x35fc('0x2f')]=_['intersection'](_0x3ec51f[_0x35fc('0x2c')],_0x3ec51f[_0x35fc('0x2d')]);_0x211b70[_0x35fc('0x32')]=_[_0x35fc('0x30')](_0x3ec51f['model'],qs['fields'](_0x331439['query']['fields']));_0x211b70['attributes']=_0x211b70[_0x35fc('0x32')][_0x35fc('0x33')]?_0x211b70['attributes']:_0x3ec51f[_0x35fc('0x2c')];if(_0x331439['query'][_0x35fc('0x3c')]){_0x211b70[_0x35fc('0x3d')]=[{'all':!![]}];}_0x211b70=_[_0x35fc('0x3b')]({},_0x211b70,_0x331439[_0x35fc('0x42')]);return db[_0x35fc('0x29')]['find'](_0x211b70)[_0x35fc('0x24')](handleEntityNotFound(_0x2a1cf6,null))[_0x35fc('0x24')](respondWithResult(_0x2a1cf6,null))['catch'](handleError(_0x2a1cf6,null));};exports[_0x35fc('0x43')]=function(_0x298b7b,_0x2a8a09){return db[_0x35fc('0x29')]['create'](_0x298b7b[_0x35fc('0x44')],{})['then'](respondWithResult(_0x2a8a09,0xc9))['catch'](handleError(_0x2a8a09,null));};exports[_0x35fc('0x23')]=function(_0x9db7e8,_0x18dc78){if(_0x9db7e8[_0x35fc('0x44')]['id']){delete _0x9db7e8[_0x35fc('0x44')]['id'];}return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x9db7e8[_0x35fc('0x46')]['id']}})['then'](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x24')](saveUpdates(_0x9db7e8[_0x35fc('0x44')],null))[_0x35fc('0x24')](respondWithResult(_0x18dc78,null))[_0x35fc('0x40')](handleError(_0x18dc78,null));};exports[_0x35fc('0x25')]=function(_0x1e3221,_0x1b8229){return db[_0x35fc('0x29')][_0x35fc('0x45')]({'where':{'id':_0x1e3221[_0x35fc('0x46')]['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x1b8229,null))[_0x35fc('0x24')](removeEntity(_0x1b8229,null))[_0x35fc('0x40')](handleError(_0x1b8229,null));};exports[_0x35fc('0x47')]=function(_0x59c666,_0x553ed6){return db[_0x35fc('0x29')][_0x35fc('0x47')]()[_0x35fc('0x24')](respondWithResult(_0x553ed6,null))[_0x35fc('0x40')](handleError(_0x553ed6,null));};
\ No newline at end of file
+var _0xeff8=['include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length'];(function(_0x2b5690,_0x225a75){var _0x48bce5=function(_0x6a2240){while(--_0x6a2240){_0x2b5690['push'](_0x2b5690['shift']());}};_0x48bce5(++_0x225a75);}(_0xeff8,0x186));var _0x8eff=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xeff8[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['Cdr'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['Cdr']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')](_0x33aa8d[_0x8eff('0x4a')],{})[_0x8eff('0x26')](respondWithResult(_0x1b5fda,0xc9))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x4c7013,_0x11e53c){if(_0x4c7013['body']['id']){delete _0x4c7013[_0x8eff('0x4a')]['id'];}return db[_0x8eff('0x2d')][_0x8eff('0x4b')]({'where':{'id':_0x4c7013[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x11e53c,null))[_0x8eff('0x26')](saveUpdates(_0x4c7013[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x11e53c,null))[_0x8eff('0x44')](handleError(_0x11e53c,null));};exports[_0x8eff('0x27')]=function(_0x2a4dbb,_0x452f7a){return db['Cdr'][_0x8eff('0x4b')]({'where':{'id':_0x2a4dbb[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452f7a,null))[_0x8eff('0x26')](removeEntity(_0x452f7a,null))[_0x8eff('0x44')](handleError(_0x452f7a,null));};exports[_0x8eff('0x4c')]=function(_0x16473d,_0x9eb0b9){return db[_0x8eff('0x2d')]['describe']()['then'](respondWithResult(_0x9eb0b9,null))[_0x8eff('0x44')](handleError(_0x9eb0b9,null));};
\ No newline at end of file
index e40201d..94f9432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x54b82a,_0x3ea2d3){var _0x3447ed=function(_0x3e0a42){while(--_0x3e0a42){_0x54b82a['push'](_0x54b82a['shift']());}};_0x3447ed(++_0x3ea2d3);}(_0x7a54,0x106));var _0x47a5=function(_0x2b987c,_0x17b58e){_0x2b987c=_0x2b987c-0x0;var _0x258c25=_0x7a54[_0x2b987c];return _0x258c25;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x244409,_0x309ce2){var _0x5c8579=function(_0x37563d){while(--_0x37563d){_0x244409['push'](_0x244409['shift']());}};_0x5c8579(++_0x309ce2);}(_0x7a54,0x106));var _0x47a5=function(_0x4b7a40,_0x51143e){_0x4b7a40=_0x4b7a40-0x0;var _0x2fb265=_0x7a54[_0x4b7a40];return _0x2fb265;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 4bdf7ca..ce947f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8f7=['Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x565472,_0x56f47){var _0x34d5ef=function(_0x2150f6){while(--_0x2150f6){_0x565472['push'](_0x565472['shift']());}};_0x34d5ef(++_0x56f47);}(_0xf8f7,0x163));var _0x7f8f=function(_0x32a3d4,_0x2779f1){_0x32a3d4=_0x32a3d4-0x0;var _0x332a6f=_0xf8f7[_0x32a3d4];return _0x332a6f;};'use strict';var _=require('lodash');var util=require(_0x7f8f('0x0'));var moment=require('moment');var BPromise=require(_0x7f8f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f8f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f8f('0x3'));var logger=require(_0x7f8f('0x4'))(_0x7f8f('0x5'));var config=require(_0x7f8f('0x6'));var jayson=require(_0x7f8f('0x7'));var client=jayson[_0x7f8f('0x8')][_0x7f8f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53a4c4,_0x7e95d1,_0x1ed517){return new BPromise(function(_0x3aa327,_0x1c2284){return client[_0x7f8f('0xa')](_0x53a4c4,_0x1ed517)[_0x7f8f('0xb')](function(_0x224f52){logger[_0x7f8f('0xc')](_0x7f8f('0xd'),_0x7e95d1,'request\x20sent');logger[_0x7f8f('0xe')](_0x7f8f('0xf'),_0x7e95d1,_0x7f8f('0x10'),JSON[_0x7f8f('0x11')](_0x224f52));if(_0x224f52[_0x7f8f('0x12')]){if(_0x224f52['error'][_0x7f8f('0x13')]===0x1f4){logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);return _0x1c2284(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}logger[_0x7f8f('0x12')]('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x224f52['error'][_0x7f8f('0x14')]);return _0x3aa327(_0x224f52[_0x7f8f('0x12')][_0x7f8f('0x14')]);}else{logger['info'](_0x7f8f('0xd'),_0x7e95d1,_0x7f8f('0x10'));_0x3aa327(_0x224f52[_0x7f8f('0x15')][_0x7f8f('0x14')]);}})[_0x7f8f('0x16')](function(_0x3c0b71){logger['error']('Cdr,\x20%s,\x20%s',_0x7e95d1,_0x3c0b71);_0x1c2284(_0x3c0b71);});});}
\ No newline at end of file
+var _0x5371=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x37b1fc,_0x320704){var _0x304b9b=function(_0x431eb7){while(--_0x431eb7){_0x37b1fc['push'](_0x37b1fc['shift']());}};_0x304b9b(++_0x320704);}(_0x5371,0x19f));var _0x1537=function(_0x208413,_0x91bb2c){_0x208413=_0x208413-0x0;var _0x1f29e9=_0x5371[_0x208413];return _0x1f29e9;};'use strict';var _=require(_0x1537('0x0'));var util=require(_0x1537('0x1'));var moment=require(_0x1537('0x2'));var BPromise=require('bluebird');var rs=require(_0x1537('0x3'));var fs=require('fs');var Redis=require(_0x1537('0x4'));var db=require(_0x1537('0x5'))['db'];var utils=require(_0x1537('0x6'));var logger=require('../../config/logger')(_0x1537('0x7'));var config=require(_0x1537('0x8'));var jayson=require(_0x1537('0x9'));var client=jayson[_0x1537('0xa')][_0x1537('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48e725,_0x23eb7b,_0x555c63){return new BPromise(function(_0x4ebd08,_0xc2230e){return client[_0x1537('0xc')](_0x48e725,_0x555c63)[_0x1537('0xd')](function(_0x27c675){logger['info'](_0x1537('0xe'),_0x23eb7b,'request\x20sent');logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x23eb7b,_0x1537('0xf'),JSON[_0x1537('0x10')](_0x27c675));if(_0x27c675['error']){if(_0x27c675[_0x1537('0x11')][_0x1537('0x12')]===0x1f4){logger[_0x1537('0x11')]('Cdr,\x20%s,\x20%s',_0x23eb7b,_0x27c675['error'][_0x1537('0x13')]);return _0xc2230e(_0x27c675[_0x1537('0x11')][_0x1537('0x13')]);}logger[_0x1537('0x11')](_0x1537('0xe'),_0x23eb7b,_0x27c675[_0x1537('0x11')][_0x1537('0x13')]);return _0x4ebd08(_0x27c675[_0x1537('0x11')]['message']);}else{logger[_0x1537('0x14')](_0x1537('0xe'),_0x23eb7b,_0x1537('0xf'));_0x4ebd08(_0x27c675['result']['message']);}})[_0x1537('0x15')](function(_0x34f25c){logger[_0x1537('0x11')](_0x1537('0xe'),_0x23eb7b,_0x34f25c);_0xc2230e(_0x34f25c);});});}
\ No newline at end of file
index cc883db..b155321 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(_0x524021,_0x25d5ea){var _0x269c3e=function(_0x2418a5){while(--_0x2418a5){_0x524021['push'](_0x524021['shift']());}};_0x269c3e(++_0x25d5ea);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5815a3,_0x4176d3){var _0x35fae0=function(_0x3df8f8){while(--_0x3df8f8){_0x5815a3['push'](_0x5815a3['shift']());}};_0x35fae0(++_0x4176d3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0xb10b[_0x1f27df];return _0x286ee2;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
index 45eed2f..be60a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dfb=['TEXT','STRING','exports','INTEGER','noop'];(function(_0x39f3dc,_0x535b20){var _0x1362af=function(_0x4d4870){while(--_0x4d4870){_0x39f3dc['push'](_0x39f3dc['shift']());}};_0x1362af(++_0x535b20);}(_0x2dfb,0x16f));var _0xb2df=function(_0xbf84f7,_0x26643b){_0xbf84f7=_0xbf84f7-0x0;var _0x55ef36=_0x2dfb[_0xbf84f7];return _0x55ef36;};'use strict';var Sequelize=require('sequelize');module[_0xb2df('0x0')]={'priority':{'type':Sequelize[_0xb2df('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb2df('0x2')},'appdata':{'type':Sequelize[_0xb2df('0x3')]()},'description':{'type':Sequelize[_0xb2df('0x4')]},'interval':{'type':Sequelize[_0xb2df('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xbbc6=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0xbbc6,0x1ba));var _0x6bbc=function(_0x34d26c,_0x28c2af){_0x34d26c=_0x34d26c-0x0;var _0x5a55cd=_0xbbc6[_0x34d26c];return _0x5a55cd;};'use strict';var Sequelize=require(_0x6bbc('0x0'));module[_0x6bbc('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6bbc('0x2')],'allowNull':![],'defaultValue':_0x6bbc('0x3')},'appdata':{'type':Sequelize[_0x6bbc('0x4')]()},'description':{'type':Sequelize[_0x6bbc('0x2')]},'interval':{'type':Sequelize[_0x6bbc('0x2')],'defaultValue':_0x6bbc('0x5')}};
\ No newline at end of file
index 1f6b6c8..d4cefa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f6a=['show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','update','body','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','sendStatus','name','send'];(function(_0xa149e2,_0x571fff){var _0x556c0c=function(_0x5aca0a){while(--_0x5aca0a){_0xa149e2['push'](_0xa149e2['shift']());}};_0x556c0c(++_0x571fff);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x2a4cdc,_0x45c9cb){_0x2a4cdc=_0x2a4cdc-0x0;var _0x14de55=_0x5f6a[_0x2a4cdc];return _0x14de55;};'use strict';var emlformat=require(_0xa5f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa5f6('0x1'));var rp=require(_0xa5f6('0x2'));var moment=require(_0xa5f6('0x3'));var BPromise=require(_0xa5f6('0x4'));var Mustache=require('mustache');var util=require(_0xa5f6('0x5'));var path=require(_0xa5f6('0x6'));var sox=require(_0xa5f6('0x7'));var csv=require(_0xa5f6('0x8'));var ejs=require(_0xa5f6('0x9'));var fs=require('fs');var fs_extra=require(_0xa5f6('0xa'));var _=require(_0xa5f6('0xb'));var squel=require(_0xa5f6('0xc'));var crypto=require(_0xa5f6('0xd'));var jsforce=require(_0xa5f6('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa5f6('0xf'));var Redis=require(_0xa5f6('0x10'));var authService=require(_0xa5f6('0x11'));var qs=require(_0xa5f6('0x12'));var as=require(_0xa5f6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5f6('0x14'))(_0xa5f6('0x15'));var utils=require('../../config/utils');var config=require(_0xa5f6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5f6('0x17'))['db'];function respondWithStatusCode(_0x483f66,_0x13c988){_0x13c988=_0x13c988||0xcc;return function(_0xc8eb34){if(_0xc8eb34){return _0x483f66['sendStatus'](_0x13c988);}return _0x483f66[_0xa5f6('0x18')](_0x13c988)[_0xa5f6('0x19')]();};}function respondWithResult(_0x2919fd,_0xd8faf3){_0xd8faf3=_0xd8faf3||0xc8;return function(_0x5c507e){if(_0x5c507e){return _0x2919fd[_0xa5f6('0x18')](_0xd8faf3)[_0xa5f6('0x1a')](_0x5c507e);}};}function respondWithFilteredResult(_0x17f7f7,_0x5dc17b){return function(_0x3b4780){if(_0x3b4780){var _0x3b2b23=typeof _0x5dc17b[_0xa5f6('0x1b')]===_0xa5f6('0x1c')&&typeof _0x5dc17b[_0xa5f6('0x1d')]==='undefined';var _0x2cc215=_0x3b4780[_0xa5f6('0x1e')];var _0x4ee2cc=_0x3b2b23?0x0:_0x5dc17b[_0xa5f6('0x1b')];var _0x20f35d=_0x3b2b23?_0x3b4780[_0xa5f6('0x1e')]:_0x5dc17b['offset']+_0x5dc17b['limit'];var _0x57a416;if(_0x20f35d>=_0x2cc215){_0x20f35d=_0x2cc215;_0x57a416=0xc8;}else{_0x57a416=0xce;}_0x17f7f7[_0xa5f6('0x18')](_0x57a416);return _0x17f7f7['set'](_0xa5f6('0x1f'),_0x4ee2cc+'-'+_0x20f35d+'/'+_0x2cc215)[_0xa5f6('0x1a')](_0x3b4780);}return null;};}function patchUpdates(_0x29f8fb){return function(_0x5b2a48){try{jsonpatch[_0xa5f6('0x20')](_0x5b2a48,_0x29f8fb,!![]);}catch(_0x55f457){return BPromise[_0xa5f6('0x21')](_0x55f457);}return _0x5b2a48[_0xa5f6('0x22')]();};}function saveUpdates(_0x30caba,_0x471628){return function(_0x37ff20){if(_0x37ff20){return _0x37ff20['update'](_0x30caba)['then'](function(_0x41b66b){return _0x41b66b;});}return null;};}function removeEntity(_0x49e609,_0x4441cc){return function(_0x50e9ba){if(_0x50e9ba){return _0x50e9ba[_0xa5f6('0x23')]()[_0xa5f6('0x24')](function(){_0x49e609[_0xa5f6('0x18')](0xcc)[_0xa5f6('0x19')]();});}};}function handleEntityNotFound(_0x3ef9fb,_0x220992){return function(_0x7613c4){if(!_0x7613c4){_0x3ef9fb[_0xa5f6('0x25')](0x194);}return _0x7613c4;};}function handleError(_0x1c08d3,_0x1ded63){_0x1ded63=_0x1ded63||0x1f4;return function(_0x1e02d9){logger['error'](_0x1e02d9['stack']);if(_0x1e02d9[_0xa5f6('0x26')]){delete _0x1e02d9[_0xa5f6('0x26')];}_0x1c08d3[_0xa5f6('0x18')](_0x1ded63)[_0xa5f6('0x27')](_0x1e02d9);};}exports[_0xa5f6('0x28')]=function(_0x8cab41,_0x5ac06e){var _0x273192={'raw':!![],'where':{'id':_0x8cab41[_0xa5f6('0x29')]['id']}},_0x43fe1d={};_0x43fe1d[_0xa5f6('0x2a')]=_[_0xa5f6('0x2b')](db[_0xa5f6('0x2c')][_0xa5f6('0x2d')]);_0x43fe1d[_0xa5f6('0x2e')]=_['keys'](_0x8cab41[_0xa5f6('0x2e')]);_0x43fe1d[_0xa5f6('0x2f')]=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],_0x43fe1d[_0xa5f6('0x2e')]);_0x273192['attributes']=_[_0xa5f6('0x30')](_0x43fe1d[_0xa5f6('0x2a')],qs[_0xa5f6('0x31')](_0x8cab41['query'][_0xa5f6('0x31')]));_0x273192[_0xa5f6('0x32')]=_0x273192[_0xa5f6('0x32')][_0xa5f6('0x33')]?_0x273192[_0xa5f6('0x32')]:_0x43fe1d['model'];if(_0x8cab41[_0xa5f6('0x2e')][_0xa5f6('0x34')]){_0x273192[_0xa5f6('0x35')]=[{'all':!![]}];}_0x273192=_[_0xa5f6('0x36')]({},_0x273192,_0x8cab41['options']);return db[_0xa5f6('0x2c')][_0xa5f6('0x37')](_0x273192)[_0xa5f6('0x24')](handleEntityNotFound(_0x5ac06e,null))[_0xa5f6('0x24')](respondWithResult(_0x5ac06e,null))['catch'](handleError(_0x5ac06e,null));};exports[_0xa5f6('0x38')]=function(_0x42bba2,_0x3ff708){if(_0x42bba2[_0xa5f6('0x39')]['id']){delete _0x42bba2[_0xa5f6('0x39')]['id'];}return db[_0xa5f6('0x2c')]['find']({'where':{'id':_0x42bba2[_0xa5f6('0x29')]['id']}})['then'](handleEntityNotFound(_0x3ff708,null))[_0xa5f6('0x24')](saveUpdates(_0x42bba2['body'],null))['then'](respondWithResult(_0x3ff708,null))[_0xa5f6('0x3a')](handleError(_0x3ff708,null));};exports['destroy']=function(_0x115a73,_0x357dee){return db['ChatApplication'][_0xa5f6('0x37')]({'where':{'id':_0x115a73['params']['id']}})['then'](handleEntityNotFound(_0x357dee,null))['then'](removeEntity(_0x357dee,null))[_0xa5f6('0x3a')](handleError(_0x357dee,null));};
\ No newline at end of file
+var _0xbefe=['sendStatus','error','model','ChatApplication','query','keys','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','body','params','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy'];(function(_0x4c2bc5,_0x4984e2){var _0x487209=function(_0x3cabbf){while(--_0x3cabbf){_0x4c2bc5['push'](_0x4c2bc5['shift']());}};_0x487209(++_0x4984e2);}(_0xbefe,0x168));var _0xebef=function(_0x1925e5,_0x24d6b9){_0x1925e5=_0x1925e5-0x0;var _0x5ea3e6=_0xbefe[_0x1925e5];return _0x5ea3e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];function respondWithStatusCode(_0x1dcae4,_0x566dbe){_0x566dbe=_0x566dbe||0xcc;return function(_0x584ac2){if(_0x584ac2){return _0x1dcae4['sendStatus'](_0x566dbe);}return _0x1dcae4['status'](_0x566dbe)[_0xebef('0x1a')]();};}function respondWithResult(_0x124634,_0x31772a){_0x31772a=_0x31772a||0xc8;return function(_0x35cd7a){if(_0x35cd7a){return _0x124634[_0xebef('0x1b')](_0x31772a)[_0xebef('0x1c')](_0x35cd7a);}};}function respondWithFilteredResult(_0x5813eb,_0x32ec37){return function(_0x9411d4){if(_0x9411d4){var _0x1921aa=typeof _0x32ec37[_0xebef('0x1d')]===_0xebef('0x1e')&&typeof _0x32ec37[_0xebef('0x1f')]===_0xebef('0x1e');var _0x1e4ddf=_0x9411d4[_0xebef('0x20')];var _0x16856f=_0x1921aa?0x0:_0x32ec37[_0xebef('0x1d')];var _0x5161f1=_0x1921aa?_0x9411d4[_0xebef('0x20')]:_0x32ec37[_0xebef('0x1d')]+_0x32ec37[_0xebef('0x1f')];var _0x502c1e;if(_0x5161f1>=_0x1e4ddf){_0x5161f1=_0x1e4ddf;_0x502c1e=0xc8;}else{_0x502c1e=0xce;}_0x5813eb[_0xebef('0x1b')](_0x502c1e);return _0x5813eb[_0xebef('0x21')](_0xebef('0x22'),_0x16856f+'-'+_0x5161f1+'/'+_0x1e4ddf)[_0xebef('0x1c')](_0x9411d4);}return null;};}function patchUpdates(_0x7ca0cc){return function(_0x138760){try{jsonpatch[_0xebef('0x23')](_0x138760,_0x7ca0cc,!![]);}catch(_0x4cc18e){return BPromise['reject'](_0x4cc18e);}return _0x138760['save']();};}function saveUpdates(_0x59e078,_0x2f1193){return function(_0x38f0b8){if(_0x38f0b8){return _0x38f0b8[_0xebef('0x24')](_0x59e078)[_0xebef('0x25')](function(_0x1ee3b){return _0x1ee3b;});}return null;};}function removeEntity(_0xe8dcbf,_0x5c5091){return function(_0x460104){if(_0x460104){return _0x460104[_0xebef('0x26')]()[_0xebef('0x25')](function(){_0xe8dcbf[_0xebef('0x1b')](0xcc)[_0xebef('0x1a')]();});}};}function handleEntityNotFound(_0x27f212,_0x36ca6b){return function(_0x42d2af){if(!_0x42d2af){_0x27f212[_0xebef('0x27')](0x194);}return _0x42d2af;};}function handleError(_0x2d63a8,_0x456a81){_0x456a81=_0x456a81||0x1f4;return function(_0x4fb77f){logger[_0xebef('0x28')](_0x4fb77f['stack']);if(_0x4fb77f['name']){delete _0x4fb77f['name'];}_0x2d63a8['status'](_0x456a81)['send'](_0x4fb77f);};}exports['show']=function(_0x55732a,_0x5703fc){var _0x506e64={'raw':!![],'where':{'id':_0x55732a['params']['id']}},_0x5a9249={};_0x5a9249[_0xebef('0x29')]=_['keys'](db[_0xebef('0x2a')]['rawAttributes']);_0x5a9249[_0xebef('0x2b')]=_[_0xebef('0x2c')](_0x55732a['query']);_0x5a9249[_0xebef('0x2d')]=_['intersection'](_0x5a9249[_0xebef('0x29')],_0x5a9249[_0xebef('0x2b')]);_0x506e64[_0xebef('0x2e')]=_[_0xebef('0x2f')](_0x5a9249[_0xebef('0x29')],qs[_0xebef('0x30')](_0x55732a['query'][_0xebef('0x30')]));_0x506e64['attributes']=_0x506e64[_0xebef('0x2e')][_0xebef('0x31')]?_0x506e64[_0xebef('0x2e')]:_0x5a9249[_0xebef('0x29')];if(_0x55732a[_0xebef('0x2b')][_0xebef('0x32')]){_0x506e64[_0xebef('0x33')]=[{'all':!![]}];}_0x506e64=_['merge']({},_0x506e64,_0x55732a[_0xebef('0x34')]);return db[_0xebef('0x2a')][_0xebef('0x35')](_0x506e64)[_0xebef('0x25')](handleEntityNotFound(_0x5703fc,null))[_0xebef('0x25')](respondWithResult(_0x5703fc,null))[_0xebef('0x36')](handleError(_0x5703fc,null));};exports[_0xebef('0x24')]=function(_0x48aa2f,_0x53ad2b){if(_0x48aa2f[_0xebef('0x37')]['id']){delete _0x48aa2f['body']['id'];}return db[_0xebef('0x2a')][_0xebef('0x35')]({'where':{'id':_0x48aa2f[_0xebef('0x38')]['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x53ad2b,null))[_0xebef('0x25')](saveUpdates(_0x48aa2f['body'],null))[_0xebef('0x25')](respondWithResult(_0x53ad2b,null))[_0xebef('0x36')](handleError(_0x53ad2b,null));};exports['destroy']=function(_0x5a4750,_0x890f2f){return db['ChatApplication']['find']({'where':{'id':_0x5a4750['params']['id']}})[_0xebef('0x25')](handleEntityNotFound(_0x890f2f,null))['then'](removeEntity(_0x890f2f,null))['catch'](handleError(_0x890f2f,null));};
\ No newline at end of file
index 57c002a..b3b4dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c75=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci'];(function(_0x57f2f4,_0x4addf1){var _0x4d147b=function(_0x171249){while(--_0x171249){_0x57f2f4['push'](_0x57f2f4['shift']());}};_0x4d147b(++_0x4addf1);}(_0x3c75,0xa8));var _0x53c7=function(_0x9fc983,_0xc0a1af){_0x9fc983=_0x9fc983-0x0;var _0x5d8ed9=_0x3c75[_0x9fc983];return _0x5d8ed9;};'use strict';var _=require('lodash');var util=require(_0x53c7('0x0'));var logger=require(_0x53c7('0x1'))(_0x53c7('0x2'));var moment=require(_0x53c7('0x3'));var BPromise=require(_0x53c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c7('0x5'));var rimraf=require(_0x53c7('0x6'));var config=require(_0x53c7('0x7'));var attributes=require(_0x53c7('0x8'));module[_0x53c7('0x9')]=function(_0x1c3e5a,_0x3238da){return _0x1c3e5a['define']('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x53c7('0xa'),'collate':_0x53c7('0xb')});};
\ No newline at end of file
+var _0xf363=['bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0xf363,0xd9));var _0x3f36=function(_0x366104,_0x20fd4b){_0x366104=_0x366104-0x0;var _0x59ea56=_0xf363[_0x366104];return _0x59ea56;};'use strict';var _=require('lodash');var util=require(_0x3f36('0x0'));var logger=require(_0x3f36('0x1'))(_0x3f36('0x2'));var moment=require(_0x3f36('0x3'));var BPromise=require(_0x3f36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f36('0x5'));var rimraf=require(_0x3f36('0x6'));var config=require(_0x3f36('0x7'));var attributes=require(_0x3f36('0x8'));module[_0x3f36('0x9')]=function(_0x243ad7,_0x35151f){return _0x243ad7['define'](_0x3f36('0xa'),attributes,{'tableName':_0x3f36('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3f36('0xc')});};
\ No newline at end of file
index 690eb6b..4f865b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c81=['request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5a5848,_0x3b8fb2){var _0x9fe6d7=function(_0x5aac17){while(--_0x5aac17){_0x5a5848['push'](_0x5a5848['shift']());}};_0x9fe6d7(++_0x3b8fb2);}(_0x5c81,0x7e));var _0x15c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5c81[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x15c8('0x0'));var util=require(_0x15c8('0x1'));var moment=require(_0x15c8('0x2'));var BPromise=require(_0x15c8('0x3'));var rs=require(_0x15c8('0x4'));var fs=require('fs');var Redis=require(_0x15c8('0x5'));var db=require(_0x15c8('0x6'))['db'];var utils=require(_0x15c8('0x7'));var logger=require(_0x15c8('0x8'))(_0x15c8('0x9'));var config=require(_0x15c8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x15c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc685b0,_0x19d851,_0x39bcd9){return new BPromise(function(_0x2c0ab0,_0x3e6435){return client[_0x15c8('0xc')](_0xc685b0,_0x39bcd9)[_0x15c8('0xd')](function(_0x3bb956){logger[_0x15c8('0xe')]('ChatApplication,\x20%s,\x20%s',_0x19d851,_0x15c8('0xf'));logger[_0x15c8('0x10')](_0x15c8('0x11'),_0x19d851,_0x15c8('0xf'),JSON[_0x15c8('0x12')](_0x3bb956));if(_0x3bb956[_0x15c8('0x13')]){if(_0x3bb956['error']['code']===0x1f4){logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);return _0x3e6435(_0x3bb956[_0x15c8('0x13')]['message']);}logger['error'](_0x15c8('0x14'),_0x19d851,_0x3bb956[_0x15c8('0x13')]['message']);return _0x2c0ab0(_0x3bb956[_0x15c8('0x13')][_0x15c8('0x15')]);}else{logger[_0x15c8('0xe')](_0x15c8('0x14'),_0x19d851,_0x15c8('0xf'));_0x2c0ab0(_0x3bb956[_0x15c8('0x16')][_0x15c8('0x15')]);}})['catch'](function(_0xe891a9){logger[_0x15c8('0x13')](_0x15c8('0x14'),_0x19d851,_0xe891a9);_0x3e6435(_0xe891a9);});});}
\ No newline at end of file
+var _0x6fe6=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x393fd4,_0x1bf68e){var _0x522474=function(_0x279229){while(--_0x279229){_0x393fd4['push'](_0x393fd4['shift']());}};_0x522474(++_0x1bf68e);}(_0x6fe6,0x121));var _0x66fe=function(_0x2d9f6c,_0x53a147){_0x2d9f6c=_0x2d9f6c-0x0;var _0x254946=_0x6fe6[_0x2d9f6c];return _0x254946;};'use strict';var _=require(_0x66fe('0x0'));var util=require('util');var moment=require(_0x66fe('0x1'));var BPromise=require('bluebird');var rs=require(_0x66fe('0x2'));var fs=require('fs');var Redis=require(_0x66fe('0x3'));var db=require(_0x66fe('0x4'))['db'];var utils=require(_0x66fe('0x5'));var logger=require(_0x66fe('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x66fe('0x7'));var client=jayson[_0x66fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50a979,_0x53a6a1,_0x300030){return new BPromise(function(_0x294f00,_0x47e5bb){return client[_0x66fe('0x9')](_0x50a979,_0x300030)[_0x66fe('0xa')](function(_0x10bab0){logger[_0x66fe('0xb')](_0x66fe('0xc'),_0x53a6a1,_0x66fe('0xd'));logger[_0x66fe('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x53a6a1,_0x66fe('0xd'),JSON[_0x66fe('0xf')](_0x10bab0));if(_0x10bab0[_0x66fe('0x10')]){if(_0x10bab0['error'][_0x66fe('0x11')]===0x1f4){logger[_0x66fe('0x10')](_0x66fe('0xc'),_0x53a6a1,_0x10bab0[_0x66fe('0x10')][_0x66fe('0x12')]);return _0x47e5bb(_0x10bab0[_0x66fe('0x10')][_0x66fe('0x12')]);}logger[_0x66fe('0x10')](_0x66fe('0xc'),_0x53a6a1,_0x10bab0[_0x66fe('0x10')][_0x66fe('0x12')]);return _0x294f00(_0x10bab0[_0x66fe('0x10')]['message']);}else{logger['info'](_0x66fe('0xc'),_0x53a6a1,_0x66fe('0xd'));_0x294f00(_0x10bab0[_0x66fe('0x13')]['message']);}})[_0x66fe('0x14')](function(_0x44a28b){logger[_0x66fe('0x10')](_0x66fe('0xc'),_0x53a6a1,_0x44a28b);_0x47e5bb(_0x44a28b);});});}
\ No newline at end of file
index 9eb57bd..2bd8eed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc7=['put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4cc7,0x134));var _0x74cc=function(_0x580f5e,_0x2b92fd){_0x580f5e=_0x580f5e-0x0;var _0x5b7812=_0x4cc7[_0x580f5e];return _0x5b7812;};'use strict';var multer=require(_0x74cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x74cc('0x1'));var express=require(_0x74cc('0x2'));var router=express[_0x74cc('0x3')]();var fs_extra=require(_0x74cc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x74cc('0x5'));var config=require(_0x74cc('0x6'));var controller=require(_0x74cc('0x7'));router[_0x74cc('0x8')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xb')]);router[_0x74cc('0xc')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller['update']);router[_0x74cc('0xd')](_0x74cc('0x9'),auth[_0x74cc('0xa')](),controller[_0x74cc('0xe')]);module[_0x74cc('0xf')]=router;
\ No newline at end of file
+var _0x0b28=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','show','put','/:id','update','delete','destroy','exports','multer'];(function(_0x578618,_0x2cd08c){var _0x26e43c=function(_0x495a2){while(--_0x495a2){_0x578618['push'](_0x578618['shift']());}};_0x26e43c(++_0x2cd08c);}(_0x0b28,0x10f));var _0x80b2=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0b28[_0x576170];return _0x397c70;};'use strict';var multer=require(_0x80b2('0x0'));var util=require(_0x80b2('0x1'));var path=require(_0x80b2('0x2'));var timeout=require(_0x80b2('0x3'));var express=require(_0x80b2('0x4'));var router=express['Router']();var fs_extra=require(_0x80b2('0x5'));var auth=require(_0x80b2('0x6'));var interaction=require(_0x80b2('0x7'));var config=require(_0x80b2('0x8'));var controller=require(_0x80b2('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x80b2('0xa')]);router[_0x80b2('0xb')](_0x80b2('0xc'),auth['isAuthenticated'](),controller[_0x80b2('0xd')]);router[_0x80b2('0xe')](_0x80b2('0xc'),auth['isAuthenticated'](),controller[_0x80b2('0xf')]);module[_0x80b2('0x10')]=router;
\ No newline at end of file
index 5205047..4e7a9ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b36=['STRING','BOOLEAN','sequelize'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x4b36,0xcb));var _0x64b3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4b36[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x64b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x64b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x64b3('0x1')]},'write':{'type':Sequelize[_0x64b3('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x3869=['BOOLEAN','sequelize','exports','STRING'];(function(_0x3986c4,_0x628458){var _0x3dec5a=function(_0x232493){while(--_0x232493){_0x3986c4['push'](_0x3986c4['shift']());}};_0x3dec5a(++_0x628458);}(_0x3869,0x115));var _0x9386=function(_0x2c0828,_0x5c1219){_0x2c0828=_0x2c0828-0x0;var _0xa0cc4d=_0x3869[_0x2c0828];return _0xa0cc4d;};'use strict';var Sequelize=require(_0x9386('0x0'));module[_0x9386('0x1')]={'name':{'type':Sequelize[_0x9386('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9386('0x2')]},'write':{'type':Sequelize[_0x9386('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 9181857..cd95651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x304b=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','order','pick','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model'];(function(_0x4592de,_0x4233e6){var _0x27a791=function(_0x2d0f98){while(--_0x2d0f98){_0x4592de['push'](_0x4592de['shift']());}};_0x27a791(++_0x4233e6);}(_0x304b,0x15e));var _0xb304=function(_0x3a1695,_0x5a565d){_0x3a1695=_0x3a1695-0x0;var _0x5ddbb5=_0x304b[_0x3a1695];return _0x5ddbb5;};'use strict';var emlformat=require(_0xb304('0x0'));var rimraf=require(_0xb304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb304('0x2'));var rp=require(_0xb304('0x3'));var moment=require('moment');var BPromise=require(_0xb304('0x4'));var Mustache=require(_0xb304('0x5'));var util=require(_0xb304('0x6'));var path=require(_0xb304('0x7'));var sox=require(_0xb304('0x8'));var csv=require(_0xb304('0x9'));var ejs=require(_0xb304('0xa'));var fs=require('fs');var fs_extra=require(_0xb304('0xb'));var _=require(_0xb304('0xc'));var squel=require(_0xb304('0xd'));var crypto=require(_0xb304('0xe'));var jsforce=require(_0xb304('0xf'));var deskjs=require(_0xb304('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb304('0x11'));var Redis=require(_0xb304('0x12'));var authService=require(_0xb304('0x13'));var qs=require(_0xb304('0x14'));var as=require(_0xb304('0x15'));var hardwareService=require(_0xb304('0x16'));var logger=require(_0xb304('0x17'))(_0xb304('0x18'));var utils=require('../../config/utils');var config=require(_0xb304('0x19'));var licenseUtil=require(_0xb304('0x1a'));var db=require(_0xb304('0x1b'))['db'];config['redis']=_[_0xb304('0x1c')](config[_0xb304('0x1d')],{'host':_0xb304('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb304('0x1f'))[_0xb304('0x20')](socket);function respondWithStatusCode(_0x335bf8,_0x2a93be){_0x2a93be=_0x2a93be||0xcc;return function(_0x34aeff){if(_0x34aeff){return _0x335bf8[_0xb304('0x21')](_0x2a93be);}return _0x335bf8[_0xb304('0x22')](_0x2a93be)[_0xb304('0x23')]();};}function respondWithResult(_0x52c186,_0x5d8f05){_0x5d8f05=_0x5d8f05||0xc8;return function(_0x21967a){if(_0x21967a){return _0x52c186[_0xb304('0x22')](_0x5d8f05)[_0xb304('0x24')](_0x21967a);}};}function respondWithFilteredResult(_0x3a5401,_0x25abbf){return function(_0x36e7f7){if(_0x36e7f7){var _0x59b2a1=typeof _0x25abbf['offset']===_0xb304('0x25')&&typeof _0x25abbf[_0xb304('0x26')]===_0xb304('0x25');var _0xa9ea8f=_0x36e7f7['count'];var _0x9395f3=_0x59b2a1?0x0:_0x25abbf[_0xb304('0x27')];var _0x5d2c72=_0x59b2a1?_0x36e7f7[_0xb304('0x28')]:_0x25abbf[_0xb304('0x27')]+_0x25abbf[_0xb304('0x26')];var _0x4978da;if(_0x5d2c72>=_0xa9ea8f){_0x5d2c72=_0xa9ea8f;_0x4978da=0xc8;}else{_0x4978da=0xce;}_0x3a5401[_0xb304('0x22')](_0x4978da);return _0x3a5401[_0xb304('0x29')]('Content-Range',_0x9395f3+'-'+_0x5d2c72+'/'+_0xa9ea8f)[_0xb304('0x24')](_0x36e7f7);}return null;};}function patchUpdates(_0x54c94f){return function(_0x5994c1){try{jsonpatch[_0xb304('0x2a')](_0x5994c1,_0x54c94f,!![]);}catch(_0x28278c){return BPromise['reject'](_0x28278c);}return _0x5994c1[_0xb304('0x2b')]();};}function saveUpdates(_0x124b23,_0x897ffa){return function(_0x2d9066){if(_0x2d9066){return _0x2d9066[_0xb304('0x2c')](_0x124b23)['then'](function(_0xfb6ecc){return _0xfb6ecc;});}return null;};}function removeEntity(_0x2f5b6c,_0x1adb2a){return function(_0x1d500b){if(_0x1d500b){return _0x1d500b[_0xb304('0x2d')]()[_0xb304('0x2e')](function(){_0x2f5b6c[_0xb304('0x22')](0xcc)[_0xb304('0x23')]();});}};}function handleEntityNotFound(_0x37dfe6,_0x3b61e4){return function(_0x5d6fd8){if(!_0x5d6fd8){_0x37dfe6[_0xb304('0x21')](0x194);}return _0x5d6fd8;};}function handleError(_0x1ded80,_0x754bb8){_0x754bb8=_0x754bb8||0x1f4;return function(_0x2e1a01){logger[_0xb304('0x2f')](_0x2e1a01[_0xb304('0x30')]);if(_0x2e1a01[_0xb304('0x31')]){delete _0x2e1a01[_0xb304('0x31')];}_0x1ded80['status'](_0x754bb8)[_0xb304('0x32')](_0x2e1a01);};}exports[_0xb304('0x33')]=function(_0x5f1d6b,_0x39ae9d){var _0x65a5f1={},_0xe3bab={},_0xf18cd8={'count':0x0,'rows':[]};var _0x3b15af=_[_0xb304('0x34')](db[_0xb304('0x35')][_0xb304('0x36')],function(_0x538285){return{'name':_0x538285[_0xb304('0x37')],'type':_0x538285['type'][_0xb304('0x38')]};});_0xe3bab[_0xb304('0x39')]=_[_0xb304('0x34')](_0x3b15af,'name');_0xe3bab[_0xb304('0x3a')]=_['keys'](_0x5f1d6b[_0xb304('0x3a')]);_0xe3bab[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0xe3bab['model'],_0xe3bab['query']);_0x65a5f1[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0xe3bab[_0xb304('0x39')],qs['fields'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x3e')]));_0x65a5f1[_0xb304('0x3d')]=_0x65a5f1['attributes'][_0xb304('0x3f')]?_0x65a5f1['attributes']:_0xe3bab[_0xb304('0x39')];if(!_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x65a5f1[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x26')]);_0x65a5f1[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x27')]);}_0x65a5f1['order']=qs['sort'](_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x42')]);_0x65a5f1[_0xb304('0x43')]=qs[_0xb304('0x3b')](_['pick'](_0x5f1d6b[_0xb304('0x3a')],_0xe3bab[_0xb304('0x3b')]),_0x3b15af);if(_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]){_0x65a5f1[_0xb304('0x43')]=_[_0xb304('0x45')](_0x65a5f1[_0xb304('0x43')],{'$or':_['map'](_0x3b15af,function(_0x5d2dd9){if(_0x5d2dd9['type']!==_0xb304('0x46')){var _0x1f2ac3={};_0x1f2ac3[_0x5d2dd9[_0xb304('0x31')]]={'$like':'%'+_0x5f1d6b[_0xb304('0x3a')][_0xb304('0x44')]+'%'};return _0x1f2ac3;}})});}_0x65a5f1=_[_0xb304('0x45')]({},_0x65a5f1,_0x5f1d6b[_0xb304('0x47')]);var _0x48284e={'where':_0x65a5f1[_0xb304('0x43')]};return db[_0xb304('0x35')][_0xb304('0x28')](_0x48284e)[_0xb304('0x2e')](function(_0x13c72d){_0xf18cd8[_0xb304('0x28')]=_0x13c72d;if(_0x5f1d6b['query']['includeAll']){_0x65a5f1['include']=[{'all':!![]}];}return db[_0xb304('0x35')][_0xb304('0x48')](_0x65a5f1);})[_0xb304('0x2e')](function(_0x1cb582){_0xf18cd8[_0xb304('0x49')]=_0x1cb582;return _0xf18cd8;})[_0xb304('0x2e')](respondWithFilteredResult(_0x39ae9d,_0x65a5f1))[_0xb304('0x4a')](handleError(_0x39ae9d,null));};exports[_0xb304('0x4b')]=function(_0x2228bd,_0x20ab6e){var _0x20b295={'raw':!![],'where':{'id':_0x2228bd['params']['id']}},_0x17019e={};_0x17019e['model']=_[_0xb304('0x4c')](db[_0xb304('0x35')][_0xb304('0x36')]);_0x17019e[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2228bd[_0xb304('0x3a')]);_0x17019e['filters']=_['intersection'](_0x17019e[_0xb304('0x39')],_0x17019e[_0xb304('0x3a')]);_0x20b295['attributes']=_[_0xb304('0x3c')](_0x17019e[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x2228bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x20b295[_0xb304('0x3d')]=_0x20b295[_0xb304('0x3d')][_0xb304('0x3f')]?_0x20b295[_0xb304('0x3d')]:_0x17019e['model'];if(_0x2228bd[_0xb304('0x3a')][_0xb304('0x4d')]){_0x20b295[_0xb304('0x4e')]=[{'all':!![]}];}_0x20b295=_['merge']({},_0x20b295,_0x2228bd[_0xb304('0x47')]);return db[_0xb304('0x35')][_0xb304('0x4f')](_0x20b295)['then'](handleEntityNotFound(_0x20ab6e,null))[_0xb304('0x2e')](respondWithResult(_0x20ab6e,null))[_0xb304('0x4a')](handleError(_0x20ab6e,null));};exports[_0xb304('0x50')]=function(_0x2f1b45,_0x1158c3){return db[_0xb304('0x35')]['create'](_0x2f1b45[_0xb304('0x51')],{})['then'](respondWithResult(_0x1158c3,0xc9))[_0xb304('0x4a')](handleError(_0x1158c3,null));};exports[_0xb304('0x2c')]=function(_0x2bb54f,_0x37d74d){if(_0x2bb54f[_0xb304('0x51')]['id']){delete _0x2bb54f[_0xb304('0x51')]['id'];}return db[_0xb304('0x35')]['find']({'where':{'id':_0x2bb54f['params']['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x37d74d,null))['then'](saveUpdates(_0x2bb54f[_0xb304('0x51')],null))[_0xb304('0x2e')](respondWithResult(_0x37d74d,null))['catch'](handleError(_0x37d74d,null));};exports[_0xb304('0x2d')]=function(_0x6d1e2e,_0x36c76c){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x6d1e2e[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x36c76c,null))[_0xb304('0x2e')](removeEntity(_0x36c76c,null))['catch'](handleError(_0x36c76c,null));};exports[_0xb304('0x53')]=function(_0x1956b4,_0x35a1f7){return db[_0xb304('0x35')][_0xb304('0x53')]()[_0xb304('0x2e')](respondWithResult(_0x35a1f7,null))[_0xb304('0x4a')](handleError(_0x35a1f7,null));};exports[_0xb304('0x54')]=function(_0x36e942,_0x70563f,_0x8dd461){return db[_0xb304('0x55')][_0xb304('0x28')]({'where':{'ChatGroupId':_0x36e942[_0xb304('0x52')]['id'],'ToId':_0x36e942['user']['id'],'read':![]}})['then'](function(_0x42bf41){return{'id':_[_0xb304('0x56')](_0x36e942[_0xb304('0x52')]['id']),'count':_0x42bf41};})['then'](respondWithResult(_0x70563f,null))[_0xb304('0x4a')](handleError(_0x70563f,null));};exports[_0xb304('0x57')]=function(_0x4bd0d2,_0x58b67b,_0x2e2912){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x4bd0d2[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x58b67b,null))[_0xb304('0x2e')](function(_0x5537de){if(_0x5537de){return _0x5537de[_0xb304('0x57')](_0x4bd0d2['body'][_0xb304('0x58')],_['omit'](_0x4bd0d2[_0xb304('0x51')],[_0xb304('0x58'),'id'])||{});}})[_0xb304('0x2e')](respondWithResult(_0x58b67b,null))['catch'](handleError(_0x58b67b,null));};exports[_0xb304('0x59')]=function(_0x31f214,_0xb22ed3,_0x3fcf6a){var _0x420df8={};var _0x201094={};var _0x4c67e4;var _0x1ee244;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x31f214[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0xb22ed3,null))['then'](function(_0x1bcb54){if(_0x1bcb54){_0x4c67e4=_0x1bcb54;_0x201094[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x5b')][_0xb304('0x36')]);_0x201094[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x31f214['query']);_0x201094['filters']=_['intersection'](_0x201094[_0xb304('0x39')],_0x201094[_0xb304('0x3a')]);_0x420df8['attributes']=_[_0xb304('0x3c')](_0x201094[_0xb304('0x39')],qs[_0xb304('0x3e')](_0x31f214['query'][_0xb304('0x3e')]));_0x420df8[_0xb304('0x3d')]=_0x420df8[_0xb304('0x3d')][_0xb304('0x3f')]?_0x420df8[_0xb304('0x3d')]:_0x201094['model'];_0x420df8[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x31f214[_0xb304('0x3a')][_0xb304('0x42')]);_0x420df8[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x31f214[_0xb304('0x3a')],_0x201094[_0xb304('0x3b')]));if(_0x31f214[_0xb304('0x3a')][_0xb304('0x44')]){_0x420df8['where']=_[_0xb304('0x45')](_0x420df8[_0xb304('0x43')],{'$or':_[_0xb304('0x34')](_0x420df8[_0xb304('0x3d')],function(_0xfc8164){var _0xc6db3f={};_0xc6db3f[_0xfc8164]={'$like':'%'+_0x31f214[_0xb304('0x3a')]['filter']+'%'};return _0xc6db3f;})});}_0x420df8=_[_0xb304('0x45')]({},_0x420df8,_0x31f214['options']);return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0x49621a){if(_0x49621a){_0x1ee244=_0x49621a['length'];if(!_0x31f214[_0xb304('0x3a')]['hasOwnProperty'](_0xb304('0x41'))){_0x420df8['limit']=qs[_0xb304('0x26')](_0x31f214[_0xb304('0x3a')][_0xb304('0x26')]);_0x420df8[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x31f214[_0xb304('0x3a')][_0xb304('0x27')]);}return _0x4c67e4[_0xb304('0x59')](_0x420df8);}})[_0xb304('0x2e')](function(_0xf0d979){if(_0xf0d979){return _0xf0d979?{'count':_0x1ee244,'rows':_0xf0d979}:null;}})[_0xb304('0x2e')](respondWithResult(_0xb22ed3,null))[_0xb304('0x4a')](handleError(_0xb22ed3,null));};exports[_0xb304('0x5e')]=function(_0x27272b,_0x35c99c,_0x45ec35){return db[_0xb304('0x35')][_0xb304('0x4f')]({'where':{'id':_0x27272b[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x35c99c,null))[_0xb304('0x2e')](function(_0x4b71ad){if(_0x4b71ad){return _0x4b71ad[_0xb304('0x5e')](_0x27272b[_0xb304('0x3a')][_0xb304('0x58')]);}})[_0xb304('0x2e')](respondWithStatusCode(_0x35c99c,null))[_0xb304('0x4a')](handleError(_0x35c99c,null));};exports[_0xb304('0x5f')]=function(_0xf09f2a,_0x542fd8,_0x17613b){if(_0xf09f2a[_0xb304('0x51')]['id']){delete _0xf09f2a['body']['id'];}return db['ChatGroup'][_0xb304('0x4f')]({'where':{'id':_0xf09f2a[_0xb304('0x52')]['id']}})[_0xb304('0x2e')](handleEntityNotFound(_0x542fd8,null))[_0xb304('0x2e')](function(_0x2b34d4){if(_0x2b34d4){_0xf09f2a[_0xb304('0x51')][_0xb304('0x60')]=_0x2b34d4['id'];return db[_0xb304('0x55')][_0xb304('0x50')](_0xf09f2a['body']);}})[_0xb304('0x2e')](respondWithResult(_0x542fd8,null))['catch'](handleError(_0x542fd8,null));};exports['getMessages']=function(_0x2785bd,_0x30e20a,_0xbd4262){var _0x8cfe73={};var _0x437471={};var _0x585e13;var _0x177d16;return db[_0xb304('0x35')][_0xb304('0x5a')]({'where':{'id':_0x2785bd[_0xb304('0x52')]['id']}})['then'](handleEntityNotFound(_0x30e20a,null))[_0xb304('0x2e')](function(_0x34f811){if(_0x34f811){_0x585e13=_0x34f811;_0x437471[_0xb304('0x39')]=_[_0xb304('0x4c')](db[_0xb304('0x55')][_0xb304('0x36')]);_0x437471[_0xb304('0x3a')]=_[_0xb304('0x4c')](_0x2785bd['query']);_0x437471[_0xb304('0x3b')]=_[_0xb304('0x3c')](_0x437471[_0xb304('0x39')],_0x437471[_0xb304('0x3a')]);_0x8cfe73[_0xb304('0x3d')]=_[_0xb304('0x3c')](_0x437471['model'],qs['fields'](_0x2785bd[_0xb304('0x3a')][_0xb304('0x3e')]));_0x8cfe73[_0xb304('0x3d')]=_0x8cfe73[_0xb304('0x3d')][_0xb304('0x3f')]?_0x8cfe73[_0xb304('0x3d')]:_0x437471[_0xb304('0x39')];_0x8cfe73[_0xb304('0x5c')]=qs[_0xb304('0x42')](_0x2785bd[_0xb304('0x3a')]['sort']);_0x8cfe73[_0xb304('0x43')]=qs[_0xb304('0x3b')](_[_0xb304('0x5d')](_0x2785bd['query'],_0x437471['filters']));if(_0x2785bd[_0xb304('0x3a')][_0xb304('0x44')]){_0x8cfe73['where']=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],{'$or':_['map'](_0x8cfe73[_0xb304('0x3d')],function(_0x2080c2){var _0xbb2636={};_0xbb2636[_0x2080c2]={'$like':'%'+_0x2785bd['query'][_0xb304('0x44')]+'%'};return _0xbb2636;})});}if(_0x2785bd['query'][_0xb304('0x61')]){var _0x53e355=_0x2785bd[_0xb304('0x3a')][_0xb304('0x61')][_0xb304('0x62')](',');var _0x591cf6={};_0x591cf6[_0x53e355[0x0]]={'$gte':moment(_0x53e355[0x1])[_0xb304('0x63')](_0xb304('0x64'))};_0x8cfe73[_0xb304('0x43')]=_[_0xb304('0x45')](_0x8cfe73[_0xb304('0x43')],_0x591cf6);}_0x8cfe73=_[_0xb304('0x45')]({},_0x8cfe73,_0x2785bd[_0xb304('0x47')]);return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x2355fd){if(_0x2355fd){_0x177d16=_0x2355fd['length'];if(!_0x2785bd[_0xb304('0x3a')][_0xb304('0x40')](_0xb304('0x41'))){_0x8cfe73[_0xb304('0x26')]=qs[_0xb304('0x26')](_0x2785bd[_0xb304('0x3a')]['limit']);_0x8cfe73[_0xb304('0x27')]=qs[_0xb304('0x27')](_0x2785bd['query'][_0xb304('0x27')]);}return _0x585e13[_0xb304('0x65')](_0x8cfe73);}})[_0xb304('0x2e')](function(_0x507f06){if(_0x507f06){return _0x507f06?{'count':_0x177d16,'rows':_0x507f06}:null;}})[_0xb304('0x2e')](respondWithResult(_0x30e20a,null))[_0xb304('0x4a')](handleError(_0x30e20a,null));};
\ No newline at end of file
+var _0xef19=['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','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ChatGroup','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','getMembers','nolimit','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x477135,_0x608263){var _0x39e5d0=function(_0x1bb0d2){while(--_0x1bb0d2){_0x477135['push'](_0x477135['shift']());}};_0x39e5d0(++_0x608263);}(_0xef19,0xb9));var _0x9ef1=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0xef19[_0x539533];return _0x3942f3;};'use strict';var emlformat=require(_0x9ef1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ef1('0x1'));var jsonpatch=require(_0x9ef1('0x2'));var rp=require(_0x9ef1('0x3'));var moment=require(_0x9ef1('0x4'));var BPromise=require(_0x9ef1('0x5'));var Mustache=require('mustache');var util=require(_0x9ef1('0x6'));var path=require(_0x9ef1('0x7'));var sox=require(_0x9ef1('0x8'));var csv=require(_0x9ef1('0x9'));var ejs=require(_0x9ef1('0xa'));var fs=require('fs');var fs_extra=require(_0x9ef1('0xb'));var _=require(_0x9ef1('0xc'));var squel=require(_0x9ef1('0xd'));var crypto=require(_0x9ef1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9ef1('0xf'));var toCsv=require(_0x9ef1('0x9'));var querystring=require(_0x9ef1('0x10'));var Papa=require(_0x9ef1('0x11'));var Redis=require(_0x9ef1('0x12'));var authService=require(_0x9ef1('0x13'));var qs=require(_0x9ef1('0x14'));var as=require(_0x9ef1('0x15'));var hardwareService=require(_0x9ef1('0x16'));var logger=require(_0x9ef1('0x17'))(_0x9ef1('0x18'));var utils=require(_0x9ef1('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x9ef1('0x1a'));var db=require(_0x9ef1('0x1b'))['db'];config['redis']=_[_0x9ef1('0x1c')](config[_0x9ef1('0x1d')],{'host':_0x9ef1('0x1e'),'port':0x18eb});var socket=require(_0x9ef1('0x1f'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x28a72d,_0x2393e7){_0x2393e7=_0x2393e7||0xcc;return function(_0x324e47){if(_0x324e47){return _0x28a72d[_0x9ef1('0x20')](_0x2393e7);}return _0x28a72d[_0x9ef1('0x21')](_0x2393e7)['end']();};}function respondWithResult(_0x5cc1a5,_0x5cbe03){_0x5cbe03=_0x5cbe03||0xc8;return function(_0x4bc671){if(_0x4bc671){return _0x5cc1a5[_0x9ef1('0x21')](_0x5cbe03)[_0x9ef1('0x22')](_0x4bc671);}};}function respondWithFilteredResult(_0x3d3e1d,_0x36ee7b){return function(_0x248f5f){if(_0x248f5f){var _0x5e543c=typeof _0x36ee7b[_0x9ef1('0x23')]===_0x9ef1('0x24')&&typeof _0x36ee7b[_0x9ef1('0x25')]===_0x9ef1('0x24');var _0x2918f1=_0x248f5f['count'];var _0x505f67=_0x5e543c?0x0:_0x36ee7b['offset'];var _0xb92f48=_0x5e543c?_0x248f5f[_0x9ef1('0x26')]:_0x36ee7b[_0x9ef1('0x23')]+_0x36ee7b[_0x9ef1('0x25')];var _0x56a228;if(_0xb92f48>=_0x2918f1){_0xb92f48=_0x2918f1;_0x56a228=0xc8;}else{_0x56a228=0xce;}_0x3d3e1d['status'](_0x56a228);return _0x3d3e1d[_0x9ef1('0x27')](_0x9ef1('0x28'),_0x505f67+'-'+_0xb92f48+'/'+_0x2918f1)['json'](_0x248f5f);}return null;};}function patchUpdates(_0x80ee17){return function(_0x5672b6){try{jsonpatch[_0x9ef1('0x29')](_0x5672b6,_0x80ee17,!![]);}catch(_0x1b4668){return BPromise[_0x9ef1('0x2a')](_0x1b4668);}return _0x5672b6[_0x9ef1('0x2b')]();};}function saveUpdates(_0x321717,_0x2b8d3b){return function(_0x51dd2d){if(_0x51dd2d){return _0x51dd2d[_0x9ef1('0x2c')](_0x321717)[_0x9ef1('0x2d')](function(_0x2b78e4){return _0x2b78e4;});}return null;};}function removeEntity(_0xed8bc5,_0x6661a5){return function(_0x5f34db){if(_0x5f34db){return _0x5f34db[_0x9ef1('0x2e')]()[_0x9ef1('0x2d')](function(){_0xed8bc5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x463427,_0x2c8cbe){return function(_0x13f13a){if(!_0x13f13a){_0x463427['sendStatus'](0x194);}return _0x13f13a;};}function handleError(_0x3c0bc4,_0x3a9ae5){_0x3a9ae5=_0x3a9ae5||0x1f4;return function(_0x5d5de1){logger['error'](_0x5d5de1[_0x9ef1('0x2f')]);if(_0x5d5de1[_0x9ef1('0x30')]){delete _0x5d5de1[_0x9ef1('0x30')];}_0x3c0bc4['status'](_0x3a9ae5)[_0x9ef1('0x31')](_0x5d5de1);};}exports['index']=function(_0x502049,_0x125919){var _0x15f67d={},_0x423f50={},_0x3594fe={'count':0x0,'rows':[]};var _0x2912e4=_[_0x9ef1('0x32')](db['ChatGroup'][_0x9ef1('0x33')],function(_0x5f5d8b){return{'name':_0x5f5d8b[_0x9ef1('0x34')],'type':_0x5f5d8b[_0x9ef1('0x35')]['key']};});_0x423f50[_0x9ef1('0x36')]=_[_0x9ef1('0x32')](_0x2912e4,_0x9ef1('0x30'));_0x423f50[_0x9ef1('0x37')]=_['keys'](_0x502049[_0x9ef1('0x37')]);_0x423f50[_0x9ef1('0x38')]=_['intersection'](_0x423f50[_0x9ef1('0x36')],_0x423f50['query']);_0x15f67d['attributes']=_[_0x9ef1('0x39')](_0x423f50[_0x9ef1('0x36')],qs[_0x9ef1('0x3a')](_0x502049[_0x9ef1('0x37')]['fields']));_0x15f67d[_0x9ef1('0x3b')]=_0x15f67d[_0x9ef1('0x3b')][_0x9ef1('0x3c')]?_0x15f67d[_0x9ef1('0x3b')]:_0x423f50[_0x9ef1('0x36')];if(!_0x502049['query'][_0x9ef1('0x3d')]('nolimit')){_0x15f67d[_0x9ef1('0x25')]=qs['limit'](_0x502049[_0x9ef1('0x37')][_0x9ef1('0x25')]);_0x15f67d['offset']=qs[_0x9ef1('0x23')](_0x502049[_0x9ef1('0x37')][_0x9ef1('0x23')]);}_0x15f67d[_0x9ef1('0x3e')]=qs['sort'](_0x502049['query'][_0x9ef1('0x3f')]);_0x15f67d[_0x9ef1('0x40')]=qs[_0x9ef1('0x38')](_[_0x9ef1('0x41')](_0x502049[_0x9ef1('0x37')],_0x423f50[_0x9ef1('0x38')]),_0x2912e4);if(_0x502049[_0x9ef1('0x37')][_0x9ef1('0x42')]){_0x15f67d[_0x9ef1('0x40')]=_['merge'](_0x15f67d['where'],{'$or':_[_0x9ef1('0x32')](_0x2912e4,function(_0x3f0847){if(_0x3f0847['type']!=='VIRTUAL'){var _0x3ea8ae={};_0x3ea8ae[_0x3f0847[_0x9ef1('0x30')]]={'$like':'%'+_0x502049[_0x9ef1('0x37')][_0x9ef1('0x42')]+'%'};return _0x3ea8ae;}})});}_0x15f67d=_[_0x9ef1('0x43')]({},_0x15f67d,_0x502049[_0x9ef1('0x44')]);var _0x484d96={'where':_0x15f67d[_0x9ef1('0x40')]};return db[_0x9ef1('0x45')][_0x9ef1('0x26')](_0x484d96)[_0x9ef1('0x2d')](function(_0x556c72){_0x3594fe['count']=_0x556c72;if(_0x502049[_0x9ef1('0x37')]['includeAll']){_0x15f67d[_0x9ef1('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0x9ef1('0x47')](_0x15f67d);})['then'](function(_0x5f4107){_0x3594fe[_0x9ef1('0x48')]=_0x5f4107;return _0x3594fe;})[_0x9ef1('0x2d')](respondWithFilteredResult(_0x125919,_0x15f67d))['catch'](handleError(_0x125919,null));};exports[_0x9ef1('0x49')]=function(_0x5e99e9,_0x1de678){var _0x34e5cb={'raw':!![],'where':{'id':_0x5e99e9[_0x9ef1('0x4a')]['id']}},_0x4c6a2a={};_0x4c6a2a['model']=_[_0x9ef1('0x4b')](db[_0x9ef1('0x45')][_0x9ef1('0x33')]);_0x4c6a2a[_0x9ef1('0x37')]=_[_0x9ef1('0x4b')](_0x5e99e9[_0x9ef1('0x37')]);_0x4c6a2a[_0x9ef1('0x38')]=_[_0x9ef1('0x39')](_0x4c6a2a[_0x9ef1('0x36')],_0x4c6a2a[_0x9ef1('0x37')]);_0x34e5cb[_0x9ef1('0x3b')]=_[_0x9ef1('0x39')](_0x4c6a2a['model'],qs[_0x9ef1('0x3a')](_0x5e99e9['query'][_0x9ef1('0x3a')]));_0x34e5cb[_0x9ef1('0x3b')]=_0x34e5cb[_0x9ef1('0x3b')][_0x9ef1('0x3c')]?_0x34e5cb['attributes']:_0x4c6a2a[_0x9ef1('0x36')];if(_0x5e99e9[_0x9ef1('0x37')][_0x9ef1('0x4c')]){_0x34e5cb['include']=[{'all':!![]}];}_0x34e5cb=_['merge']({},_0x34e5cb,_0x5e99e9['options']);return db[_0x9ef1('0x45')][_0x9ef1('0x4d')](_0x34e5cb)['then'](handleEntityNotFound(_0x1de678,null))[_0x9ef1('0x2d')](respondWithResult(_0x1de678,null))[_0x9ef1('0x4e')](handleError(_0x1de678,null));};exports['create']=function(_0x560a06,_0x108c54){return db['ChatGroup'][_0x9ef1('0x4f')](_0x560a06[_0x9ef1('0x50')],{})[_0x9ef1('0x2d')](respondWithResult(_0x108c54,0xc9))[_0x9ef1('0x4e')](handleError(_0x108c54,null));};exports['update']=function(_0x551554,_0x133d9e){if(_0x551554[_0x9ef1('0x50')]['id']){delete _0x551554[_0x9ef1('0x50')]['id'];}return db[_0x9ef1('0x45')][_0x9ef1('0x4d')]({'where':{'id':_0x551554[_0x9ef1('0x4a')]['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x133d9e,null))['then'](saveUpdates(_0x551554[_0x9ef1('0x50')],null))[_0x9ef1('0x2d')](respondWithResult(_0x133d9e,null))[_0x9ef1('0x4e')](handleError(_0x133d9e,null));};exports[_0x9ef1('0x2e')]=function(_0x195daa,_0x16cdf){return db[_0x9ef1('0x45')][_0x9ef1('0x4d')]({'where':{'id':_0x195daa[_0x9ef1('0x4a')]['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x16cdf,null))[_0x9ef1('0x2d')](removeEntity(_0x16cdf,null))[_0x9ef1('0x4e')](handleError(_0x16cdf,null));};exports['describe']=function(_0x598b41,_0x53fb65){return db['ChatGroup'][_0x9ef1('0x51')]()[_0x9ef1('0x2d')](respondWithResult(_0x53fb65,null))[_0x9ef1('0x4e')](handleError(_0x53fb65,null));};exports[_0x9ef1('0x52')]=function(_0x2a6c27,_0x13a050,_0x3d0d98){return db[_0x9ef1('0x53')][_0x9ef1('0x26')]({'where':{'ChatGroupId':_0x2a6c27[_0x9ef1('0x4a')]['id'],'ToId':_0x2a6c27[_0x9ef1('0x54')]['id'],'read':![]}})[_0x9ef1('0x2d')](function(_0x22474a){return{'id':_[_0x9ef1('0x55')](_0x2a6c27[_0x9ef1('0x4a')]['id']),'count':_0x22474a};})[_0x9ef1('0x2d')](respondWithResult(_0x13a050,null))['catch'](handleError(_0x13a050,null));};exports[_0x9ef1('0x56')]=function(_0x32e6a3,_0x56e50f,_0x386f22){return db['ChatGroup']['find']({'where':{'id':_0x32e6a3[_0x9ef1('0x4a')]['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x56e50f,null))[_0x9ef1('0x2d')](function(_0x6e8b42){if(_0x6e8b42){return _0x6e8b42[_0x9ef1('0x56')](_0x32e6a3[_0x9ef1('0x50')][_0x9ef1('0x57')],_['omit'](_0x32e6a3['body'],[_0x9ef1('0x57'),'id'])||{});}})[_0x9ef1('0x2d')](respondWithResult(_0x56e50f,null))['catch'](handleError(_0x56e50f,null));};exports['getMembers']=function(_0x556f48,_0x3bba68,_0x3b3709){var _0x113952={};var _0x1c649e={};var _0x58ef9b;var _0xbdae44;return db[_0x9ef1('0x45')][_0x9ef1('0x58')]({'where':{'id':_0x556f48[_0x9ef1('0x4a')]['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x3bba68,null))[_0x9ef1('0x2d')](function(_0xa0c2d2){if(_0xa0c2d2){_0x58ef9b=_0xa0c2d2;_0x1c649e[_0x9ef1('0x36')]=_[_0x9ef1('0x4b')](db['User']['rawAttributes']);_0x1c649e[_0x9ef1('0x37')]=_[_0x9ef1('0x4b')](_0x556f48['query']);_0x1c649e['filters']=_[_0x9ef1('0x39')](_0x1c649e[_0x9ef1('0x36')],_0x1c649e[_0x9ef1('0x37')]);_0x113952[_0x9ef1('0x3b')]=_[_0x9ef1('0x39')](_0x1c649e[_0x9ef1('0x36')],qs[_0x9ef1('0x3a')](_0x556f48[_0x9ef1('0x37')][_0x9ef1('0x3a')]));_0x113952[_0x9ef1('0x3b')]=_0x113952['attributes'][_0x9ef1('0x3c')]?_0x113952['attributes']:_0x1c649e[_0x9ef1('0x36')];_0x113952['order']=qs[_0x9ef1('0x3f')](_0x556f48[_0x9ef1('0x37')]['sort']);_0x113952[_0x9ef1('0x40')]=qs[_0x9ef1('0x38')](_[_0x9ef1('0x41')](_0x556f48[_0x9ef1('0x37')],_0x1c649e[_0x9ef1('0x38')]));if(_0x556f48[_0x9ef1('0x37')]['filter']){_0x113952[_0x9ef1('0x40')]=_[_0x9ef1('0x43')](_0x113952[_0x9ef1('0x40')],{'$or':_[_0x9ef1('0x32')](_0x113952[_0x9ef1('0x3b')],function(_0x11859f){var _0x3d9533={};_0x3d9533[_0x11859f]={'$like':'%'+_0x556f48[_0x9ef1('0x37')]['filter']+'%'};return _0x3d9533;})});}_0x113952=_[_0x9ef1('0x43')]({},_0x113952,_0x556f48[_0x9ef1('0x44')]);return _0x58ef9b[_0x9ef1('0x59')](_0x113952);}})['then'](function(_0xdef649){if(_0xdef649){_0xbdae44=_0xdef649[_0x9ef1('0x3c')];if(!_0x556f48[_0x9ef1('0x37')][_0x9ef1('0x3d')](_0x9ef1('0x5a'))){_0x113952['limit']=qs[_0x9ef1('0x25')](_0x556f48[_0x9ef1('0x37')][_0x9ef1('0x25')]);_0x113952[_0x9ef1('0x23')]=qs[_0x9ef1('0x23')](_0x556f48['query'][_0x9ef1('0x23')]);}return _0x58ef9b[_0x9ef1('0x59')](_0x113952);}})['then'](function(_0x492f08){if(_0x492f08){return _0x492f08?{'count':_0xbdae44,'rows':_0x492f08}:null;}})[_0x9ef1('0x2d')](respondWithResult(_0x3bba68,null))[_0x9ef1('0x4e')](handleError(_0x3bba68,null));};exports['removeMembers']=function(_0x398740,_0x35f13f,_0x2b5f67){return db['ChatGroup'][_0x9ef1('0x4d')]({'where':{'id':_0x398740['params']['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x35f13f,null))[_0x9ef1('0x2d')](function(_0x174d84){if(_0x174d84){return _0x174d84['removeMembers'](_0x398740[_0x9ef1('0x37')]['ids']);}})[_0x9ef1('0x2d')](respondWithStatusCode(_0x35f13f,null))[_0x9ef1('0x4e')](handleError(_0x35f13f,null));};exports[_0x9ef1('0x5b')]=function(_0x39b0c8,_0x35ba18,_0x31404c){if(_0x39b0c8[_0x9ef1('0x50')]['id']){delete _0x39b0c8[_0x9ef1('0x50')]['id'];}return db['ChatGroup'][_0x9ef1('0x4d')]({'where':{'id':_0x39b0c8['params']['id']}})[_0x9ef1('0x2d')](handleEntityNotFound(_0x35ba18,null))[_0x9ef1('0x2d')](function(_0x2b68d5){if(_0x2b68d5){_0x39b0c8[_0x9ef1('0x50')][_0x9ef1('0x5c')]=_0x2b68d5['id'];return db['ChatInternalMessage']['create'](_0x39b0c8[_0x9ef1('0x50')]);}})[_0x9ef1('0x2d')](respondWithResult(_0x35ba18,null))['catch'](handleError(_0x35ba18,null));};exports[_0x9ef1('0x5d')]=function(_0x4d4f7c,_0x296964,_0x54833e){var _0x3bb3c4={};var _0x5157d1={};var _0x563872;var _0x2b67e4;return db[_0x9ef1('0x45')][_0x9ef1('0x58')]({'where':{'id':_0x4d4f7c[_0x9ef1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x296964,null))['then'](function(_0x42efa4){if(_0x42efa4){_0x563872=_0x42efa4;_0x5157d1[_0x9ef1('0x36')]=_[_0x9ef1('0x4b')](db['ChatInternalMessage'][_0x9ef1('0x33')]);_0x5157d1['query']=_[_0x9ef1('0x4b')](_0x4d4f7c[_0x9ef1('0x37')]);_0x5157d1[_0x9ef1('0x38')]=_[_0x9ef1('0x39')](_0x5157d1[_0x9ef1('0x36')],_0x5157d1[_0x9ef1('0x37')]);_0x3bb3c4[_0x9ef1('0x3b')]=_[_0x9ef1('0x39')](_0x5157d1['model'],qs[_0x9ef1('0x3a')](_0x4d4f7c[_0x9ef1('0x37')]['fields']));_0x3bb3c4[_0x9ef1('0x3b')]=_0x3bb3c4[_0x9ef1('0x3b')][_0x9ef1('0x3c')]?_0x3bb3c4[_0x9ef1('0x3b')]:_0x5157d1['model'];_0x3bb3c4[_0x9ef1('0x3e')]=qs[_0x9ef1('0x3f')](_0x4d4f7c[_0x9ef1('0x37')]['sort']);_0x3bb3c4[_0x9ef1('0x40')]=qs['filters'](_['pick'](_0x4d4f7c['query'],_0x5157d1['filters']));if(_0x4d4f7c['query']['filter']){_0x3bb3c4['where']=_[_0x9ef1('0x43')](_0x3bb3c4[_0x9ef1('0x40')],{'$or':_[_0x9ef1('0x32')](_0x3bb3c4[_0x9ef1('0x3b')],function(_0x4908fe){var _0x4048a3={};_0x4048a3[_0x4908fe]={'$like':'%'+_0x4d4f7c[_0x9ef1('0x37')][_0x9ef1('0x42')]+'%'};return _0x4048a3;})});}if(_0x4d4f7c['query'][_0x9ef1('0x5e')]){var _0x462746=_0x4d4f7c[_0x9ef1('0x37')][_0x9ef1('0x5e')][_0x9ef1('0x5f')](',');var _0x2cf1a4={};_0x2cf1a4[_0x462746[0x0]]={'$gte':moment(_0x462746[0x1])[_0x9ef1('0x60')](_0x9ef1('0x61'))};_0x3bb3c4[_0x9ef1('0x40')]=_[_0x9ef1('0x43')](_0x3bb3c4[_0x9ef1('0x40')],_0x2cf1a4);}_0x3bb3c4=_['merge']({},_0x3bb3c4,_0x4d4f7c[_0x9ef1('0x44')]);return _0x563872[_0x9ef1('0x5d')](_0x3bb3c4);}})['then'](function(_0x9b78a){if(_0x9b78a){_0x2b67e4=_0x9b78a['length'];if(!_0x4d4f7c[_0x9ef1('0x37')][_0x9ef1('0x3d')](_0x9ef1('0x5a'))){_0x3bb3c4['limit']=qs[_0x9ef1('0x25')](_0x4d4f7c[_0x9ef1('0x37')][_0x9ef1('0x25')]);_0x3bb3c4[_0x9ef1('0x23')]=qs[_0x9ef1('0x23')](_0x4d4f7c[_0x9ef1('0x37')][_0x9ef1('0x23')]);}return _0x563872[_0x9ef1('0x5d')](_0x3bb3c4);}})[_0x9ef1('0x2d')](function(_0x27ca6c){if(_0x27ca6c){return _0x27ca6c?{'count':_0x2b67e4,'rows':_0x27ca6c}:null;}})['then'](respondWithResult(_0x296964,null))[_0x9ef1('0x4e')](handleError(_0x296964,null));};
\ No newline at end of file
index 457059f..29e6008 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x582b=['remove','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','save'];(function(_0x5dca91,_0x3e6d9a){var _0x24ce62=function(_0x5d8a40){while(--_0x5d8a40){_0x5dca91['push'](_0x5dca91['shift']());}};_0x24ce62(++_0x3e6d9a);}(_0x582b,0x185));var _0xb582=function(_0x4bad9a,_0x2547bc){_0x4bad9a=_0x4bad9a-0x0;var _0x326988=_0x582b[_0x4bad9a];return _0x326988;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xb582('0x0'))['db'][_0xb582('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb582('0x2'),'afterUpdate':'update','afterDestroy':_0xb582('0x3')};function emitEvent(_0x13f2bd){return function(_0x43b5ac,_0x223f44,_0xfe601a){ChatGroupEvents[_0xb582('0x4')](_0x13f2bd+':'+_0x43b5ac['id'],_0x43b5ac);ChatGroupEvents[_0xb582('0x4')](_0x13f2bd,_0x43b5ac);_0xfe601a(null);};}for(var e in events){if(events[_0xb582('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xb582('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x164d=['remove','emit','hook','exports','events','ChatGroup','setMaxListeners','save','update'];(function(_0x30ea70,_0x94caf4){var _0x5b2c6f=function(_0x1ca2e8){while(--_0x1ca2e8){_0x30ea70['push'](_0x30ea70['shift']());}};_0x5b2c6f(++_0x94caf4);}(_0x164d,0x82));var _0xd164=function(_0xaa4f3,_0x37be20){_0xaa4f3=_0xaa4f3-0x0;var _0x163cc9=_0x164d[_0xaa4f3];return _0x163cc9;};'use strict';var EventEmitter=require(_0xd164('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xd164('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd164('0x2')](0x0);var events={'afterCreate':_0xd164('0x3'),'afterUpdate':_0xd164('0x4'),'afterDestroy':_0xd164('0x5')};function emitEvent(_0x27bab6){return function(_0x5482c4,_0x37aaea,_0x38e379){ChatGroupEvents['emit'](_0x27bab6+':'+_0x5482c4['id'],_0x5482c4);ChatGroupEvents[_0xd164('0x6')](_0x27bab6,_0x5482c4);_0x38e379(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd164('0x7')](e,emitEvent(event));}}module[_0xd164('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 2c78a73..6293d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec47=['path','rimraf','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xec47,0x102));var _0x7ec4=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xec47[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x7ec4('0x0'));var util=require(_0x7ec4('0x1'));var logger=require(_0x7ec4('0x2'))(_0x7ec4('0x3'));var moment=require(_0x7ec4('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ec4('0x5'));var fs=require('fs');var path=require(_0x7ec4('0x6'));var rimraf=require(_0x7ec4('0x7'));var config=require(_0x7ec4('0x8'));var attributes=require('./chatGroup.attributes');module[_0x7ec4('0x9')]=function(_0x45333f,_0x531638){return _0x45333f[_0x7ec4('0xa')](_0x7ec4('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ca9=['path','../../config/environment','./chatGroup.attributes','exports','chat_groups','lodash','api','moment','request-promise'];(function(_0x38b7a9,_0x504d1d){var _0x5344c0=function(_0x5bd76e){while(--_0x5bd76e){_0x38b7a9['push'](_0x38b7a9['shift']());}};_0x5344c0(++_0x504d1d);}(_0x8ca9,0xa7));var _0x98ca=function(_0x458e35,_0x4af9f9){_0x458e35=_0x458e35-0x0;var _0x4c6030=_0x8ca9[_0x458e35];return _0x4c6030;};'use strict';var _=require(_0x98ca('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x98ca('0x1'));var moment=require(_0x98ca('0x2'));var BPromise=require('bluebird');var rp=require(_0x98ca('0x3'));var fs=require('fs');var path=require(_0x98ca('0x4'));var rimraf=require('rimraf');var config=require(_0x98ca('0x5'));var attributes=require(_0x98ca('0x6'));module[_0x98ca('0x7')]=function(_0x143951,_0x5b6b1d){return _0x143951['define']('ChatGroup',attributes,{'tableName':_0x98ca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 80ce822..c7e427a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd765=['request\x20sent','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x22d7bb,_0x4c158e){var _0x40a737=function(_0xd85bab){while(--_0xd85bab){_0x22d7bb['push'](_0x22d7bb['shift']());}};_0x40a737(++_0x4c158e);}(_0xd765,0xdf));var _0x5d76=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd765[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var moment=require(_0x5d76('0x2'));var BPromise=require(_0x5d76('0x3'));var rs=require(_0x5d76('0x4'));var fs=require('fs');var Redis=require(_0x5d76('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5d76('0x6'));var logger=require('../../config/logger')(_0x5d76('0x7'));var config=require(_0x5d76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5d76('0x9')][_0x5d76('0xa')]({'port':0x232a});config[_0x5d76('0xb')]=_[_0x5d76('0xc')](config[_0x5d76('0xb')],{'host':_0x5d76('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5d76('0xe'))[_0x5d76('0xf')](socket);function respondWithRpcPromise(_0x339e41,_0x31c85f,_0x48f1db){return new BPromise(function(_0x504b8b,_0x7345d5){return client[_0x5d76('0x10')](_0x339e41,_0x48f1db)[_0x5d76('0x11')](function(_0x545dfd){logger['info']('ChatGroup,\x20%s,\x20%s',_0x31c85f,'request\x20sent');logger[_0x5d76('0x12')](_0x5d76('0x13'),_0x31c85f,_0x5d76('0x14'),JSON['stringify'](_0x545dfd));if(_0x545dfd[_0x5d76('0x15')]){if(_0x545dfd[_0x5d76('0x15')]['code']===0x1f4){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);return _0x7345d5(_0x545dfd[_0x5d76('0x15')]['message']);}logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x545dfd[_0x5d76('0x15')]['message']);return _0x504b8b(_0x545dfd[_0x5d76('0x15')][_0x5d76('0x17')]);}else{logger[_0x5d76('0x18')]('ChatGroup,\x20%s,\x20%s',_0x31c85f,_0x5d76('0x14'));_0x504b8b(_0x545dfd[_0x5d76('0x19')]['message']);}})[_0x5d76('0x1a')](function(_0x335ee0){logger[_0x5d76('0x15')](_0x5d76('0x16'),_0x31c85f,_0x335ee0);_0x7345d5(_0x335ee0);});});}
\ No newline at end of file
+var _0xf864=['catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result'];(function(_0x59bd48,_0x395fc0){var _0x22ef32=function(_0x2b14df){while(--_0x2b14df){_0x59bd48['push'](_0x59bd48['shift']());}};_0x22ef32(++_0x395fc0);}(_0xf864,0x11f));var _0x4f86=function(_0x3e7db3,_0x4ac551){_0x3e7db3=_0x3e7db3-0x0;var _0x4ee173=_0xf864[_0x3e7db3];return _0x4ee173;};'use strict';var _=require(_0x4f86('0x0'));var util=require('util');var moment=require(_0x4f86('0x1'));var BPromise=require(_0x4f86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f86('0x3'));var logger=require(_0x4f86('0x4'))(_0x4f86('0x5'));var config=require(_0x4f86('0x6'));var jayson=require(_0x4f86('0x7'));var client=jayson[_0x4f86('0x8')][_0x4f86('0x9')]({'port':0x232a});config[_0x4f86('0xa')]=_[_0x4f86('0xb')](config['redis'],{'host':_0x4f86('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f86('0xa')]));require(_0x4f86('0xd'))[_0x4f86('0xe')](socket);function respondWithRpcPromise(_0x1ef1e9,_0x1026cb,_0x332584){return new BPromise(function(_0x9cdb82,_0x2220d5){return client[_0x4f86('0xf')](_0x1ef1e9,_0x332584)['then'](function(_0x1a0f57){logger['info']('ChatGroup,\x20%s,\x20%s',_0x1026cb,_0x4f86('0x10'));logger[_0x4f86('0x11')](_0x4f86('0x12'),_0x1026cb,_0x4f86('0x10'),JSON[_0x4f86('0x13')](_0x1a0f57));if(_0x1a0f57['error']){if(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x15')]===0x1f4){logger['error'](_0x4f86('0x16'),_0x1026cb,_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);return _0x2220d5(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}logger[_0x4f86('0x14')]('ChatGroup,\x20%s,\x20%s',_0x1026cb,_0x1a0f57['error'][_0x4f86('0x17')]);return _0x9cdb82(_0x1a0f57[_0x4f86('0x14')][_0x4f86('0x17')]);}else{logger['info'](_0x4f86('0x16'),_0x1026cb,_0x4f86('0x10'));_0x9cdb82(_0x1a0f57[_0x4f86('0x18')]['message']);}})[_0x4f86('0x19')](function(_0x1a102a){logger[_0x4f86('0x14')]('ChatGroup,\x20%s,\x20%s',_0x1026cb,_0x1a102a);_0x2220d5(_0x1a102a);});});}
\ No newline at end of file
index 7ae010c..0c78243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1cd=['removeListener','register','length','chatGroup:','./chatGroup.events','save','emit'];(function(_0x4f03c3,_0x205978){var _0x2b82d1=function(_0xc5038b){while(--_0xc5038b){_0x4f03c3['push'](_0x4f03c3['shift']());}};_0x2b82d1(++_0x205978);}(_0xf1cd,0x100));var _0xdf1c=function(_0x3a3527,_0x1e6c15){_0x3a3527=_0x3a3527-0x0;var _0x4fcf4e=_0xf1cd[_0x3a3527];return _0x4fcf4e;};'use strict';var ChatGroupEvents=require(_0xdf1c('0x0'));var events=[_0xdf1c('0x1'),'remove','update'];function createListener(_0x431bdf,_0x466960){return function(_0x119407){_0x466960[_0xdf1c('0x2')](_0x431bdf,_0x119407);};}function removeListener(_0x395f11,_0x1c0c26){return function(){ChatGroupEvents[_0xdf1c('0x3')](_0x395f11,_0x1c0c26);};}exports[_0xdf1c('0x4')]=function(_0x456b69){for(var _0x576e8e=0x0,_0x4e9adc=events[_0xdf1c('0x5')];_0x576e8e<_0x4e9adc;_0x576e8e++){var _0x3bfb49=events[_0x576e8e];var _0x29eb66=createListener(_0xdf1c('0x6')+_0x3bfb49,_0x456b69);ChatGroupEvents['on'](_0x3bfb49,_0x29eb66);}};
\ No newline at end of file
+var _0x0427=['chatGroup:','./chatGroup.events','save','remove','emit','removeListener','register','length'];(function(_0x229a9d,_0x4d3229){var _0x5bd600=function(_0x5f5af9){while(--_0x5f5af9){_0x229a9d['push'](_0x229a9d['shift']());}};_0x5bd600(++_0x4d3229);}(_0x0427,0x149));var _0x7042=function(_0x343096,_0x177a10){_0x343096=_0x343096-0x0;var _0x40b216=_0x0427[_0x343096];return _0x40b216;};'use strict';var ChatGroupEvents=require(_0x7042('0x0'));var events=[_0x7042('0x1'),_0x7042('0x2'),'update'];function createListener(_0xa4cc60,_0x244cd0){return function(_0x17199d){_0x244cd0[_0x7042('0x3')](_0xa4cc60,_0x17199d);};}function removeListener(_0x1ebd59,_0x13f23d){return function(){ChatGroupEvents[_0x7042('0x4')](_0x1ebd59,_0x13f23d);};}exports[_0x7042('0x5')]=function(_0x1c59fe){for(var _0x408235=0x0,_0x4e0210=events[_0x7042('0x6')];_0x408235<_0x4e0210;_0x408235++){var _0x446b3f=events[_0x408235];var _0x2caeb2=createListener(_0x7042('0x7')+_0x446b3f,_0x1c59fe);ChatGroupEvents['on'](_0x446b3f,_0x2caeb2);}};
\ No newline at end of file
index fd81aee..e8b8e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c16=['addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create'];(function(_0x5b3a6a,_0x11d9e2){var _0x5315c3=function(_0xd781b){while(--_0xd781b){_0x5b3a6a['push'](_0x5b3a6a['shift']());}};_0x5315c3(++_0x11d9e2);}(_0x7c16,0x1c7));var _0x67c1=function(_0x36bab3,_0x19ce33){_0x36bab3=_0x36bab3-0x0;var _0x2d3989=_0x7c16[_0x36bab3];return _0x2d3989;};'use strict';var multer=require(_0x67c1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x67c1('0x1'));var express=require(_0x67c1('0x2'));var router=express[_0x67c1('0x3')]();var fs_extra=require(_0x67c1('0x4'));var auth=require(_0x67c1('0x5'));var interaction=require(_0x67c1('0x6'));var config=require('../../config/environment');var controller=require(_0x67c1('0x7'));router[_0x67c1('0x8')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0xa')]);router[_0x67c1('0x8')](_0x67c1('0xb'),auth['isAuthenticated'](),controller[_0x67c1('0xc')]);router['get'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller['show']);router['get'](_0x67c1('0xe'),auth[_0x67c1('0x9')](),controller[_0x67c1('0xf')]);router[_0x67c1('0x8')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller['getMembers']);router['get'](_0x67c1('0x11'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x12')]);router[_0x67c1('0x13')]('/',auth[_0x67c1('0x9')](),controller[_0x67c1('0x14')]);router[_0x67c1('0x13')](_0x67c1('0x10'),auth['isAuthenticated'](),controller[_0x67c1('0x15')]);router[_0x67c1('0x13')]('/:id/messages',auth[_0x67c1('0x9')](),controller[_0x67c1('0x16')]);router['put'](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x17')]);router[_0x67c1('0x18')](_0x67c1('0xd'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x19')]);router[_0x67c1('0x18')](_0x67c1('0x10'),auth[_0x67c1('0x9')](),controller[_0x67c1('0x1a')]);module[_0x67c1('0x1b')]=router;
\ No newline at end of file
+var _0x9f90=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports'];(function(_0x38e6d3,_0x5099ab){var _0x3ae9ce=function(_0x2f3c5d){while(--_0x2f3c5d){_0x38e6d3['push'](_0x38e6d3['shift']());}};_0x3ae9ce(++_0x5099ab);}(_0x9f90,0x11e));var _0x09f9=function(_0x294ac1,_0x44cd79){_0x294ac1=_0x294ac1-0x0;var _0x1f63a6=_0x9f90[_0x294ac1];return _0x1f63a6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x09f9('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x09f9('0x1'));var auth=require(_0x09f9('0x2'));var interaction=require(_0x09f9('0x3'));var config=require(_0x09f9('0x4'));var controller=require(_0x09f9('0x5'));router[_0x09f9('0x6')]('/',auth[_0x09f9('0x7')](),controller[_0x09f9('0x8')]);router[_0x09f9('0x6')]('/describe',auth[_0x09f9('0x7')](),controller['describe']);router['get'](_0x09f9('0x9'),auth[_0x09f9('0x7')](),controller[_0x09f9('0xa')]);router['get']('/:id/unread',auth[_0x09f9('0x7')](),controller[_0x09f9('0xb')]);router['get'](_0x09f9('0xc'),auth['isAuthenticated'](),controller[_0x09f9('0xd')]);router[_0x09f9('0x6')](_0x09f9('0xe'),auth[_0x09f9('0x7')](),controller[_0x09f9('0xf')]);router[_0x09f9('0x10')]('/',auth[_0x09f9('0x7')](),controller[_0x09f9('0x11')]);router[_0x09f9('0x10')](_0x09f9('0xc'),auth['isAuthenticated'](),controller[_0x09f9('0x12')]);router[_0x09f9('0x10')](_0x09f9('0xe'),auth[_0x09f9('0x7')](),controller[_0x09f9('0x13')]);router[_0x09f9('0x14')]('/:id',auth[_0x09f9('0x7')](),controller[_0x09f9('0x15')]);router[_0x09f9('0x16')](_0x09f9('0x9'),auth[_0x09f9('0x7')](),controller[_0x09f9('0x17')]);router[_0x09f9('0x16')]('/:id/members',auth[_0x09f9('0x7')](),controller[_0x09f9('0x18')]);module[_0x09f9('0x19')]=router;
\ No newline at end of file
index 44d0fe1..8c778ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de3=['sequelize','BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out'];(function(_0x11e346,_0x1ba6d1){var _0x3b9dbd=function(_0xadaf5a){while(--_0xadaf5a){_0x11e346['push'](_0x11e346['shift']());}};_0x3b9dbd(++_0x1ba6d1);}(_0x3de3,0x1ce));var _0x33de=function(_0x1440ec,_0x4b6aff){_0x1440ec=_0x1440ec-0x0;var _0x13203b=_0x3de3[_0x1440ec];return _0x13203b;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'closed':{'type':Sequelize[_0x33de('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x33de('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x33de('0x3'),_0x33de('0x4')),'defaultValue':_0x33de('0x3')},'ratingMessage':{'type':Sequelize[_0x33de('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x33de('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x33de('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x33de('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x33de('0x6')]},'browserName':{'type':Sequelize[_0x33de('0x6')]},'browserVersion':{'type':Sequelize[_0x33de('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x33de('0x6')]},'deviceModel':{'type':Sequelize[_0x33de('0x6')]},'deviceVendor':{'type':Sequelize[_0x33de('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x33de('0x5')]},'customerIp':{'type':Sequelize[_0x33de('0x6')]},'formData':{'type':Sequelize[_0x33de('0x5')](_0x33de('0x8'))},'read1stAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgAt':{'type':Sequelize[_0x33de('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x33de('0x9')]('in',_0x33de('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x33de('0x6')]},'customerPort':{'type':Sequelize[_0x33de('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x33de('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x3f8c=['DATE','STRING','TEXT','long','BOOLEAN','INTEGER','ENUM','star'];(function(_0x8e4222,_0x572eca){var _0x1eea72=function(_0x23ce1e){while(--_0x23ce1e){_0x8e4222['push'](_0x8e4222['shift']());}};_0x1eea72(++_0x572eca);}(_0x3f8c,0x104));var _0xc3f8=function(_0x122392,_0x5b012b){_0x122392=_0x122392-0x0;var _0x2edef4=_0x3f8c[_0x122392];return _0x2edef4;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xc3f8('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc3f8('0x1')]},'ratingType':{'type':Sequelize[_0xc3f8('0x2')](_0xc3f8('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc3f8('0x4')]},'disposition':{'type':Sequelize[_0xc3f8('0x5')]},'secondDisposition':{'type':Sequelize[_0xc3f8('0x5')]},'thirdDisposition':{'type':Sequelize[_0xc3f8('0x5')]},'note':{'type':Sequelize[_0xc3f8('0x5')]},'browserName':{'type':Sequelize[_0xc3f8('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xc3f8('0x5')]},'osVersion':{'type':Sequelize[_0xc3f8('0x5')]},'deviceModel':{'type':Sequelize[_0xc3f8('0x5')]},'deviceVendor':{'type':Sequelize[_0xc3f8('0x5')]},'deviceType':{'type':Sequelize[_0xc3f8('0x5')]},'referer':{'type':Sequelize[_0xc3f8('0x6')]},'customerIp':{'type':Sequelize[_0xc3f8('0x5')]},'formData':{'type':Sequelize['TEXT'](_0xc3f8('0x7'))},'read1stAt':{'type':Sequelize[_0xc3f8('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc3f8('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xc3f8('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc3f8('0x5')]},'customerPort':{'type':Sequelize[_0xc3f8('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xc3f8('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xc3f8('0x0')],'defaultValue':![]}};
\ No newline at end of file
index 140cc33..0447162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d1=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','ChatInteractionId','all','rows','show','params','includeAll','include','create','destroy','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','update','disposition','file','basename','filename','Attachment','attachmentDownload','closed','json','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','Messages','format','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_fullname','direction','secret','appendFileSync','MailAccount','Smtp','service','host','secure','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','alias','findAll','addTags','setTags','ids','omit','spread','emit','chatInteractionTags:save','removeTags','download','unix','tmp','server','files','attachments','transcript-%d-%s.zip','lastName','ChatWebsite','get','mkdirSync','Chat','Account','Owner','N.A.','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','createWriteStream','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','limit','undefined','count','offset','set','apply','reject','save','stack','name','send','contact','agent','interaction','account','map','fullname','TagIds','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','tools_tags','u.fullname','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','buildExpression','body','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x43bc8f,_0x24a26a){_0x43bc8f=_0x43bc8f-0x0;var _0x34f552=_0xd7d1[_0x43bc8f];return _0x34f552;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x1d7d('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d7d('0x18'))(_0x1d7d('0x19'));var utils=require(_0x1d7d('0x1a'));var config=require(_0x1d7d('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d7d('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1d7d('0x1d')],{'host':_0x1d7d('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1d7d('0x1f'))[_0x1d7d('0x20')](socket);var jayson=require(_0x1d7d('0x21'));var client=jayson[_0x1d7d('0x22')][_0x1d7d('0x23')]({'port':0x232b});var client9004=jayson['client'][_0x1d7d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x1de6cc,_0x51cbca,_0xb90a8c,_0x162c3a){return new BPromise(function(_0x3c3417,_0x47826a){var _0x40db4d=_0x162c3a||client;return _0x40db4d['request'](_0x1de6cc,_0xb90a8c)[_0x1d7d('0x24')](function(_0x191024){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x51cbca,_0x1d7d('0x25'));logger[_0x1d7d('0x26')](_0x1d7d('0x27'),_0x51cbca,_0x1d7d('0x25'),JSON[_0x1d7d('0x28')](_0x191024));if(_0x191024[_0x1d7d('0x29')]){if(_0x191024['error'][_0x1d7d('0x2a')]===0x1f4){logger[_0x1d7d('0x29')](_0x1d7d('0x2b'),_0x51cbca,_0x191024['error'][_0x1d7d('0x2c')]);return _0x47826a(_0x191024[_0x1d7d('0x29')]['message']);}logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x191024[_0x1d7d('0x29')][_0x1d7d('0x2c')]);return _0x3c3417(_0x191024['error'][_0x1d7d('0x2c')]);}else{logger[_0x1d7d('0x2d')](_0x1d7d('0x2b'),_0x51cbca,_0x1d7d('0x25'));_0x3c3417(_0x191024['result'][_0x1d7d('0x2c')]);}})[_0x1d7d('0x2e')](function(_0x5c8257){logger['error'](_0x1d7d('0x2b'),_0x51cbca,_0x5c8257);_0x47826a(_0x5c8257);});});}function respondWithStatusCode(_0x52c618,_0x38c323){_0x38c323=_0x38c323||0xcc;return function(_0x2d4de4){if(_0x2d4de4){return _0x52c618[_0x1d7d('0x2f')](_0x38c323);}return _0x52c618[_0x1d7d('0x30')](_0x38c323)[_0x1d7d('0x31')]();};}function respondWithResult(_0x59f827,_0x1c2616){_0x1c2616=_0x1c2616||0xc8;return function(_0x98c1ad){if(_0x98c1ad){return _0x59f827[_0x1d7d('0x30')](_0x1c2616)['json'](_0x98c1ad);}};}function respondWithFilteredResult(_0x78adbe,_0x1a935a){return function(_0x23ad85){if(_0x23ad85){var _0x482367=typeof _0x1a935a['offset']==='undefined'&&typeof _0x1a935a[_0x1d7d('0x32')]===_0x1d7d('0x33');var _0x559f19=_0x23ad85[_0x1d7d('0x34')];var _0x3e4136=_0x482367?0x0:_0x1a935a[_0x1d7d('0x35')];var _0x3336ab=_0x482367?_0x23ad85[_0x1d7d('0x34')]:_0x1a935a[_0x1d7d('0x35')]+_0x1a935a[_0x1d7d('0x32')];var _0x803dc9;if(_0x3336ab>=_0x559f19){_0x3336ab=_0x559f19;_0x803dc9=0xc8;}else{_0x803dc9=0xce;}_0x78adbe[_0x1d7d('0x30')](_0x803dc9);return _0x78adbe[_0x1d7d('0x36')]('Content-Range',_0x3e4136+'-'+_0x3336ab+'/'+_0x559f19)['json'](_0x23ad85);}return null;};}function patchUpdates(_0x2e4402){return function(_0x2266a6){try{jsonpatch[_0x1d7d('0x37')](_0x2266a6,_0x2e4402,!![]);}catch(_0x40318f){return BPromise[_0x1d7d('0x38')](_0x40318f);}return _0x2266a6[_0x1d7d('0x39')]();};}function saveUpdates(_0x1aee3c,_0x40aca9){return function(_0x2fa3f4){if(_0x2fa3f4){return _0x2fa3f4['update'](_0x1aee3c)[_0x1d7d('0x24')](function(_0xf9d3e4){return _0xf9d3e4;});}return null;};}function removeEntity(_0x13a974,_0x30fb9a){return function(_0x4cc364){if(_0x4cc364){return _0x4cc364['destroy']()[_0x1d7d('0x24')](function(){_0x13a974[_0x1d7d('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x103c77,_0x3fea2e){return function(_0x568092){if(!_0x568092){_0x103c77['sendStatus'](0x194);}return _0x568092;};}function handleError(_0x26f81c,_0xc77f24){_0xc77f24=_0xc77f24||0x1f4;return function(_0x406f57){logger[_0x1d7d('0x29')](_0x406f57[_0x1d7d('0x3a')]);if(_0x406f57[_0x1d7d('0x3b')]){delete _0x406f57[_0x1d7d('0x3b')];}_0x26f81c[_0x1d7d('0x30')](_0xc77f24)[_0x1d7d('0x3c')](_0x406f57);};}function getMustacheRender(_0x318b9a,_0x4fcdcc){return Mustache['render'](_0x318b9a,_['merge'](_0x4fcdcc['body'],{'contact':_0x4fcdcc[_0x1d7d('0x3d')],'message':_0x4fcdcc['message'],'agent':_0x4fcdcc[_0x1d7d('0x3e')],'interaction':_0x4fcdcc[_0x1d7d('0x3f')],'account':_0x4fcdcc[_0x1d7d('0x40')]}))||'';}function getInteractionUsers(_0x515199,_0x5a4052){return new BPromise(function(_0x16a4e0,_0x153979){try{if(_0x5a4052[_0x515199['id']]){_0x515199['Users']=_[_0x1d7d('0x41')](_0x5a4052[_0x515199['id']],function(_0xa53806){return{'id':_0xa53806['id'],'fullname':_0xa53806[_0x1d7d('0x42')]};});}}catch(_0x2100f6){_0x153979(_0x2100f6);}_0x16a4e0(_0x515199);});}function getInteractionTags(_0x5eef0a,_0x1db8e8){return new BPromise(function(_0x42c229,_0x4239fa){try{if(_0x5eef0a[_0x1d7d('0x43')]){_0x5eef0a['Tags']=[];_0x5eef0a[_0x1d7d('0x43')]['split'](',')[_0x1d7d('0x44')](function(_0x31b850){_0x5eef0a[_0x1d7d('0x45')][_0x1d7d('0x46')](_0x1db8e8[_0x31b850]);});}delete _0x5eef0a[_0x1d7d('0x43')];}catch(_0x4becec){_0x4239fa(_0x4becec);}_0x42c229(_0x5eef0a);});}function updateChatInteraction(_0x59b8e7,_0x33582a,_0xe57fa5){return new BPromise(function(_0x1637fc,_0x4bed84){return getInteractionUsers(_0x59b8e7,_0xe57fa5)['then'](function(_0x12f397){return getInteractionTags(_0x12f397,_0x33582a);})['then'](function(_0x86e7bc){_0x1637fc(_0x86e7bc);})[_0x1d7d('0x2e')](function(_0x1d1064){_0x4bed84(_0x1d1064);});});}exports[_0x1d7d('0x47')]=function(_0x1e2ea8,_0x370e8d){var _0x72f5d7={},_0x51cb15={},_0x3ccd44={'count':0x0,'rows':[]};var _0x8b0c22=_['map'](db[_0x1d7d('0x48')][_0x1d7d('0x49')],function(_0x40599b){return{'name':_0x40599b[_0x1d7d('0x4a')],'type':_0x40599b[_0x1d7d('0x4b')][_0x1d7d('0x4c')]};});_0x51cb15[_0x1d7d('0x4d')]=_[_0x1d7d('0x41')](_0x8b0c22,_0x1d7d('0x3b'));_0x51cb15[_0x1d7d('0x4e')]=_[_0x1d7d('0x4f')](_0x1e2ea8[_0x1d7d('0x4e')]);_0x51cb15['filters']=_[_0x1d7d('0x50')](_0x51cb15['model'],_0x51cb15[_0x1d7d('0x4e')]);_0x72f5d7['attributes']=_[_0x1d7d('0x50')](_0x51cb15[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x1e2ea8[_0x1d7d('0x4e')]['fields']));_0x72f5d7[_0x1d7d('0x52')]=_0x72f5d7['attributes']['length']?_0x72f5d7[_0x1d7d('0x52')]:_0x51cb15['model'];if(!_0x1e2ea8['query'][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x72f5d7['limit']=qs[_0x1d7d('0x32')](_0x1e2ea8[_0x1d7d('0x4e')]['limit']);_0x72f5d7[_0x1d7d('0x35')]=qs[_0x1d7d('0x35')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x35')]);}_0x72f5d7['order']=qs['sort'](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x72f5d7[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1e2ea8['query'],_0x51cb15[_0x1d7d('0x57')]),_0x8b0c22);var _0x24e0b7=[];var _0x344b66=squel[_0x1d7d('0x59')]()[_0x1d7d('0x5a')]('id')[_0x1d7d('0x5a')](_0x1d7d('0x3b'))[_0x1d7d('0x5a')](_0x1d7d('0x5b'))['from'](_0x1d7d('0x5c'));var _0x41ad41=squel[_0x1d7d('0x59')]()['field']('u.id')[_0x1d7d('0x5a')](_0x1d7d('0x5d'))[_0x1d7d('0x5a')]('ui.ChatInteractionId')[_0x1d7d('0x5e')](_0x1d7d('0x5f'),'ui')['left_join'](_0x1d7d('0x60'),'u',_0x1d7d('0x61'));var _0x3fc216=squel[_0x1d7d('0x59')]()['from'](_0x1d7d('0x62'),'i')[_0x1d7d('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x1d7d('0x63')](_0x1d7d('0x60'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x1d7d('0x64'),'a',_0x1d7d('0x65'))[_0x1d7d('0x63')](_0x1d7d('0x66'),'me','me.ChatInteractionId\x20=\x20i.id')[_0x1d7d('0x63')]('chat_interaction_has_tags','it',_0x1d7d('0x67'))[_0x1d7d('0x63')](_0x1d7d('0x5c'),'t',_0x1d7d('0x68'));var _0x5a4bd7=squel[_0x1d7d('0x69')]();var _0x1ea966=[];var _0x193135=squel[_0x1d7d('0x69')]();var _0x28ec14;if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]){_0x28ec14=as[_0x1d7d('0x6b')](_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x6a')]);var _0x44a187=_0x28ec14[_0x1d7d('0x6c')];for(var _0x301a67=0x0;_0x301a67<_0x28ec14[_0x1d7d('0x6d')][_0x1d7d('0x6e')];_0x301a67++){var _0x520d3c=_0x28ec14[_0x1d7d('0x6d')][_0x301a67];var _0x566d27='i';var _0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),_0x520d3c[_0x1d7d('0x5a')]]);if(!_0x1c9fe7){switch(_0x520d3c[_0x1d7d('0x5a')]){case _0x1d7d('0x70'):if(_0x520d3c['value']==0x1){_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c[_0x1d7d('0x5a')]+'`\x20=\x200');}else{_0x3fc216[_0x1d7d('0x71')]('`'+_0x520d3c['field']+_0x1d7d('0x72'));}break;case _0x1d7d('0x73'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){if(_0x520d3c[_0x1d7d('0x76')][_0x1d7d('0x77')]('\x20')['length']>0x1){_0x5a4bd7[_0x44a187](_0x1d7d('0x78'),qs[_0x1d7d('0x79')](_0x520d3c['value']),null);}else{var _0x3289c2='%'+_0x520d3c[_0x1d7d('0x76')]+'%';_0x5a4bd7[_0x44a187](_0x1d7d('0x7a'),_0x3289c2,_0x3289c2,_0x3289c2);}}else{_0x1c9fe7=_['find'](_0x8b0c22,[_0x1d7d('0x3b'),_0x1d7d('0x7b')]);_0x520d3c[_0x1d7d('0x5a')]=_0x1d7d('0x7b');_0x2e26d4=as['buildExpression'](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}break;case _0x1d7d('0x7e'):var _0x10dea3=_0x520d3c['value'][_0x1d7d('0x77')](',')[_0x1d7d('0x41')](function(_0x17c174){return Number(_0x17c174);});_0x10dea3[_0x1d7d('0x44')](function(_0x47d27e){_0x193135['or'](_0x1d7d('0x7f'),'%,'+_0x47d27e+',%');});_0x1ea966=_['union'](_0x1ea966,_0x10dea3);break;case _0x1d7d('0x80'):if(_0x520d3c[_0x1d7d('0x74')]===_0x1d7d('0x75')){_0x5a4bd7[_0x44a187]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x520d3c[_0x1d7d('0x76')]+'%',null);}else{_0x1c9fe7=_[_0x1d7d('0x6f')](_0x8b0c22,[_0x1d7d('0x3b'),'UserId']);_0x520d3c[_0x1d7d('0x5a')]='UserId';_0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7[_0x1d7d('0x4b')],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')][_0x1d7d('0x31')]);}break;case _0x1d7d('0x82'):_0x2e26d4=as[_0x1d7d('0x81')]('me',null,_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4[_0x1d7d('0x76')]['start'],_0x2e26d4['value'][_0x1d7d('0x31')]);break;}}else{var _0x2e26d4=as[_0x1d7d('0x81')](_0x566d27,_0x1c9fe7['type'],_0x520d3c);_0x5a4bd7[_0x44a187](_0x2e26d4[_0x1d7d('0x7c')],_0x2e26d4['value'][_0x1d7d('0x7d')],_0x2e26d4[_0x1d7d('0x76')]['end']);}}}else{var _0x1f55a2=_(_0x1e2ea8[_0x1d7d('0x4e')])['keys']()[_0x1d7d('0x41')](function(_0x40ee1f){return _[_0x1d7d('0x83')](_0x8b0c22,['name',_0x40ee1f])?_0x40ee1f:undefined;})['compact']()[_0x1d7d('0x76')]();if(!_[_0x1d7d('0x84')](_0x1f55a2)){_0x1f55a2['forEach'](function(_0x33430c){if(_0x33430c===_0x1d7d('0x85')){_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),[]['concat'](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]));}else if(_0x33430c===_0x1d7d('0x87')){var _0x22cdd1=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x89')];var _0x42a83c=JSON[_0x1d7d('0x88')](_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c])[_0x1d7d('0x8a')];_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x8b'),_0x22cdd1,_0x42a83c);}else{if(_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]==='null'){_0x3fc216[_0x1d7d('0x56')]('i.'+_0x33430c+_0x1d7d('0x8c'));}else{_0x3fc216['where']('i.'+_0x33430c+_0x1d7d('0x8d'),_0x1e2ea8[_0x1d7d('0x4e')][_0x33430c]);}}});}if(_0x1e2ea8['query']['read']){if(_0x1e2ea8['query'][_0x1d7d('0x8e')]==0x1){_0x3fc216[_0x1d7d('0x71')](_0x1d7d('0x8f'));}else{_0x3fc216[_0x1d7d('0x71')]('`unreadMessages`\x20>\x200');}}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]){_0x1ea966=_[_0x1d7d('0x91')](_0x1e2ea8[_0x1d7d('0x4e')]['tag'])?_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]:new Array(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x90')]);_0x1ea966[_0x1d7d('0x44')](function(_0x2a7229){_0x193135['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a7229+',%');});}if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')]){var _0x57aba7=_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x92')][_0x1d7d('0x93')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x1d7d('0x94')](_0x57aba7)){_0x5a4bd7['or']('i.id\x20LIKE\x20?',_0x57aba7+'%');}else{_0x5a4bd7['or'](_0x1d7d('0x95'),qs[_0x1d7d('0x79')](_0x57aba7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x57aba7+'%');}}}_0x3fc216[_0x1d7d('0x56')](_0x5a4bd7);_0x3fc216[_0x1d7d('0x96')](_0x1d7d('0x97'));var _0xc3c42f={'type':db[_0x1d7d('0x98')][_0x1d7d('0x99')][_0x1d7d('0x9a')],'raw':!![]};var _0x155e88=_0x3fc216[_0x1d7d('0x9b')]();_0x155e88[_0x1d7d('0x5a')](_0x1d7d('0x97'));_0x155e88[_0x1d7d('0x5a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x72f5d7[_0x1d7d('0x9c')]){_0x72f5d7[_0x1d7d('0x9c')][_0x1d7d('0x44')](function(_0x395818){var _0x247289=_0x395818[0x0]===_0x1d7d('0x9d')?_0x395818[0x0]:'i.'+_0x395818[0x0];_0x3fc216[_0x1d7d('0x9c')](_0x247289,_0x395818[0x1]===_0x1d7d('0x9e')?![]:!![]);});}if(!_[_0x1d7d('0x84')](_0x1ea966)){_0x3fc216[_0x1d7d('0x71')](_0x193135);_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x9f'),_0x1ea966);}BPromise['resolve']()[_0x1d7d('0x24')](function(){if(!_0x28ec14){if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x85')])return;_0x155e88[_0x1d7d('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa0'));return;}if(_0x1e2ea8[_0x1d7d('0xa1')][_0x1d7d('0xa2')]!=='agent')return;return _0x1e2ea8['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x10925b){if(_[_0x1d7d('0x84')](_0x10925b)){_0x155e88['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0xa3'));}else{_0x155e88[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));_0x3fc216[_0x1d7d('0x56')](_0x1d7d('0x86'),_[_0x1d7d('0x41')](_0x10925b,'id'));}});})[_0x1d7d('0x24')](function(){if(_0x1e2ea8[_0x1d7d('0xa1')]['role']===_0x1d7d('0x3e')&&!_0x28ec14&&!_0x1e2ea8['query'][_0x1d7d('0x85')])return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x155e88['toString'](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x40464c){_0x3ccd44[_0x1d7d('0x34')]=_0x40464c[_0x1d7d('0x6e')];if(_0x3ccd44[_0x1d7d('0x34')]===0x0)return[];return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x344b66[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0x74e3fe){_0x24e0b7=_[_0x1d7d('0xa6')](_0x74e3fe,'id');_0xc3c42f=_[_0x1d7d('0xa7')](_0xc3c42f,{'model':db[_0x1d7d('0x48')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e2ea8[_0x1d7d('0x4e')][_0x1d7d('0x51')]){_0x72f5d7[_0x1d7d('0x52')][_0x1d7d('0x44')](function(_0x2aac19){_0x3fc216[_0x1d7d('0x5a')]('i.'+_0x2aac19);});}else{_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xa8'),_0x1d7d('0x70'));_0x3fc216[_0x1d7d('0x5a')]('a.key',_0x1d7d('0xa9'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xaa'),'Account.mandatoryDisposition');_0x3fc216[_0x1d7d('0x5a')]('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');_0x3fc216['field']('i.*');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xab'),_0x1d7d('0xac'));_0x3fc216['field'](_0x1d7d('0xad'),'Contact.lastName');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xae'),_0x1d7d('0xaf'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb0'),_0x1d7d('0xb1'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb2'),_0x1d7d('0xb3'));_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb4'),'Contact.fax');_0x3fc216[_0x1d7d('0x5a')](_0x1d7d('0xb5'),_0x1d7d('0xb6'));_0x3fc216['field'](_0x1d7d('0xb7'),_0x1d7d('0xb8'));_0x3fc216[_0x1d7d('0x5a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x72f5d7[_0x1d7d('0x32')])_0x3fc216['limit'](_0x72f5d7[_0x1d7d('0x32')]);if(_0x72f5d7[_0x1d7d('0x35')])_0x3fc216['offset'](_0x72f5d7[_0x1d7d('0x35')]);return db[_0x1d7d('0xa4')]['query'](_0x3fc216[_0x1d7d('0xa5')](),_0xc3c42f);})[_0x1d7d('0x24')](function(_0x45b5e2){if(_0x45b5e2[_0x1d7d('0x6e')]>0x0)_0x41ad41['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x1d7d('0x41')](_0x45b5e2,'id'));return db[_0x1d7d('0xa4')][_0x1d7d('0x4e')](_0x41ad41[_0x1d7d('0xa5')](),_0xc3c42f)[_0x1d7d('0x24')](function(_0xa5c005){var _0x1af86a=_[_0x1d7d('0xb9')](_0xa5c005,_0x1d7d('0xba'));var _0x434500=[];_0x45b5e2[_0x1d7d('0x44')](function(_0x26781c){_0x434500[_0x1d7d('0x46')](updateChatInteraction(_0x26781c,_0x24e0b7,_0x1af86a));});return BPromise[_0x1d7d('0xbb')](_0x434500);});});})[_0x1d7d('0x24')](function(_0x39924a){_0x3ccd44[_0x1d7d('0xbc')]=_0x39924a;return _0x3ccd44;})[_0x1d7d('0x24')](respondWithFilteredResult(_0x370e8d,_0x72f5d7))['catch'](handleError(_0x370e8d,null));};exports[_0x1d7d('0xbd')]=function(_0x45e83d,_0x16ce51){var _0x20b99d={'raw':![],'where':{'id':_0x45e83d[_0x1d7d('0xbe')]['id']}},_0x5ca824={};_0x5ca824[_0x1d7d('0x4d')]=_[_0x1d7d('0x4f')](db[_0x1d7d('0x48')]['rawAttributes']);_0x5ca824[_0x1d7d('0x4e')]=_['keys'](_0x45e83d[_0x1d7d('0x4e')]);_0x5ca824[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x5ca824['model'],_0x5ca824[_0x1d7d('0x4e')]);_0x20b99d['attributes']=_[_0x1d7d('0x50')](_0x5ca824[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0x45e83d[_0x1d7d('0x4e')]['fields']));_0x20b99d[_0x1d7d('0x52')]=_0x20b99d['attributes'][_0x1d7d('0x6e')]?_0x20b99d[_0x1d7d('0x52')]:_0x5ca824['model'];if(_0x45e83d[_0x1d7d('0x4e')][_0x1d7d('0xbf')]){_0x20b99d[_0x1d7d('0xc0')]=[{'all':!![]}];}_0x20b99d=_[_0x1d7d('0xa7')]({},_0x20b99d,_0x45e83d['options']);return db['ChatInteraction']['find'](_0x20b99d)[_0x1d7d('0x24')](handleEntityNotFound(_0x16ce51,null))[_0x1d7d('0x24')](respondWithResult(_0x16ce51,null))[_0x1d7d('0x2e')](handleError(_0x16ce51,null));};exports[_0x1d7d('0xc1')]=function(_0x458f92,_0x55ea3b){return db[_0x1d7d('0x48')][_0x1d7d('0xc1')](_0x458f92[_0x1d7d('0x82')],{})[_0x1d7d('0x24')](respondWithResult(_0x55ea3b,0xc9))['catch'](handleError(_0x55ea3b,null));};exports['update']=function(_0xbde512,_0x21995f){if(_0xbde512[_0x1d7d('0x82')]['id']){delete _0xbde512[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0xbde512['params']['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x21995f,null))['then'](saveUpdates(_0xbde512[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](respondWithResult(_0x21995f,null))['catch'](handleError(_0x21995f,null));};exports[_0x1d7d('0xc2')]=function(_0x5a754a,_0x13566e){return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x5a754a[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x13566e,null))['then'](removeEntity(_0x13566e,null))[_0x1d7d('0x2e')](handleError(_0x13566e,null));};exports['describe']=function(_0x303d6f,_0x5bf0de){return db['ChatInteraction'][_0x1d7d('0xc3')]()[_0x1d7d('0x24')](respondWithResult(_0x5bf0de,null))[_0x1d7d('0x2e')](handleError(_0x5bf0de,null));};exports[_0x1d7d('0xc4')]=function(_0x8ce169,_0x3f119f){var _0x14d3fb=_0x8ce169[_0x1d7d('0xbe')]['id'];var _0x3d5fff;var _0x3b7543;var _0x3e94d6;return db[_0x1d7d('0x48')]['findOne']({'where':{'id':_0x14d3fb}})['then'](function(_0x1f2d68){_0x3d5fff=_0x1f2d68;return db['ChatWebsite'][_0x1d7d('0xc5')]({'where':{'id':_0x1f2d68['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x1d7d('0xc6'),_0x1d7d('0xc7'),_0x1d7d('0xc8'),_0x1d7d('0xc9')],'raw':!![]});})[_0x1d7d('0x24')](function(_0xd919b1){if(_0xd919b1&&_0xd919b1[_0x1d7d('0xca')]&&_0xd919b1[_0x1d7d('0xc6')]){_0x3b7543=_0xd919b1;var _0x5690c={'interaction':{'id':_0x14d3fb},'agent':{'id':_0x8ce169['user']['id'],'name':_0x8ce169['user'][_0x1d7d('0x3b')],'fullname':_0x8ce169['user'][_0x1d7d('0x42')],'email':_0x8ce169[_0x1d7d('0xa1')][_0x1d7d('0xcb')]},'contact':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x3d')],'account':_0x8ce169[_0x1d7d('0x82')][_0x1d7d('0x40')]};var _0x3774f8={'rejectUnauthorized':![],'method':_0x1d7d('0xcc'),'url':_0x1d7d('0xcd'),'headers':{'X-APIKEY':_0xd919b1[_0x1d7d('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x8ce169[_0x1d7d('0xa1')]['email']],'buttons':null,'topic':_0x3b7543['vidaooTopic'],'note':_[_0x1d7d('0xce')](_0x3b7543[_0x1d7d('0xc8')])?null:getMustacheRender(_0x3b7543[_0x1d7d('0xc8')],_0x5690c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3b7543[_0x1d7d('0xc9')])){var _0x470f5e=getMustacheRender(_0x3b7543['vidaooMetadata'],_0x5690c);var _0x1f0d9f=JSON['parse'](_0x470f5e);_0x3774f8[_0x1d7d('0x82')]['metadata']=_0x1f0d9f;}}catch(_0x1f50d4){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd0'));}return rp(_0x3774f8);}else{throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xd1'));}})[_0x1d7d('0x24')](function(_0x4f1602){_0x3e94d6=_0x4f1602;if(_0x3e94d6['id']){var _0x202d85={'body':_0x3e94d6[_0x1d7d('0xd2')],'ChatWebsiteId':_0x3b7543['id'],'ChatInteractionId':_0x3d5fff['id'],'direction':_0x1d7d('0xd3'),'UserId':_0x8ce169[_0x1d7d('0xa1')]['id']};return db[_0x1d7d('0xd4')][_0x1d7d('0xc1')](_0x202d85,{});}else{throw new db['Sequelize'][(_0x1d7d('0xcf'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x1d7d('0x24')](function(){return _0x3d5fff[_0x1d7d('0xd5')]({'vidaooSessionId':_0x3e94d6['id']});})['then'](respondWithResult(_0x3f119f,null))[_0x1d7d('0x2e')](handleError(_0x3f119f,null));};exports[_0x1d7d('0xd6')]=function(_0x3e7f3c,_0x454679){if(_0x3e7f3c['body']['id']){delete _0x3e7f3c[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x3e7f3c['params']['id']},'include':[{'model':db[_0x1d7d('0xd7')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x454679,null))['then'](saveUpdates(_0x3e7f3c[_0x1d7d('0x82')],null))['then'](respondWithResult(_0x454679,null))[_0x1d7d('0x2e')](handleError(_0x454679,null));};exports[_0x1d7d('0xd8')]=function(_0x4abfb1,_0x4caa84,_0x561f33){if(_0x4abfb1[_0x1d7d('0x82')]['id']){delete _0x4abfb1[_0x1d7d('0x82')]['id'];}return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x4abfb1[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](function(_0x54616b){if(!_0x54616b){logger['error'](_0x1d7d('0xd9'),'abandon',0x194,'entity\x20not\x20found');_0x4caa84[_0x1d7d('0x2f')](0x194);}else{if(_0x54616b[_0x1d7d('0xda')]){throw new db[(_0x1d7d('0x98'))][(_0x1d7d('0xcf'))](_0x1d7d('0xdb'));}}return _0x54616b;})[_0x1d7d('0x24')](function(_0x19427f){if(_0x19427f){return _0x19427f[_0x1d7d('0xdc')]({'closed':_0x4abfb1['body']['closed'],'disposition':_0x4abfb1[_0x1d7d('0x82')][_0x1d7d('0xdd')]})[_0x1d7d('0x24')](function(_0x4d8a36){return _0x4d8a36;});}})[_0x1d7d('0x24')](function(_0x216585){return respondWithRpcPromise('AbandonInteraction',_0x1d7d('0xd8'),_0x4abfb1[_0x1d7d('0x82')],client9004);})[_0x1d7d('0x24')](respondWithResult(_0x4caa84,null))['catch'](handleError(_0x4caa84,null));};exports['attachmentUpload']=function(_0x854f68,_0x205d6f,_0x149415){_0x854f68[_0x1d7d('0x82')][_0x1d7d('0x3b')]=_0x854f68[_0x1d7d('0xde')]['originalname'];_0x854f68[_0x1d7d('0x82')][_0x1d7d('0xdf')]=_0x854f68['file'][_0x1d7d('0xe0')];_0x854f68[_0x1d7d('0x82')]['type']=_0x854f68['file']['mimetype'];return db[_0x1d7d('0xe1')][_0x1d7d('0xc1')](_0x854f68[_0x1d7d('0x82')])[_0x1d7d('0x24')](respondWithResult(_0x205d6f,0xc9))[_0x1d7d('0x2e')](handleError(_0x205d6f,null));};exports[_0x1d7d('0xe2')]=function(_0x3e358c,_0x2eae3c,_0x3838ef){return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0xbe')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null))['then'](function(_0x545b09){if(_0x545b09){if(_0x545b09[_0x1d7d('0xe3')]){return _0x2eae3c[_0x1d7d('0x30')](0x193)[_0x1d7d('0xe4')]({'status':0x193,'message':_0x1d7d('0xe5')});}return db[_0x1d7d('0xe1')][_0x1d7d('0xc5')]({'where':{'id':_0x3e358c[_0x1d7d('0x4e')][_0x1d7d('0xe6')]},'raw':!![]})['then'](handleEntityNotFound(_0x2eae3c,null));}})['then'](function(_0x549144){if(_0x549144){var _0x2a4feb=_0x549144[_0x1d7d('0xe7')]!==null;var _0x4df896=path[_0x1d7d('0xe8')](config['root'],_0x1d7d('0xe9'));if(_0x2a4feb){_0x4df896=path[_0x1d7d('0xe8')](_0x4df896,_0x1d7d('0xea'));}var _0x37eb97=path[_0x1d7d('0xe8')](_0x4df896,_0x549144[_0x1d7d('0xdf')]);return _0x2eae3c['download'](_0x37eb97);}})[_0x1d7d('0x2e')](handleError(_0x2eae3c,null));};exports[_0x1d7d('0xeb')]=function(_0x185697,_0x4d5753){var _0x55929b=null;var _0x43ce7f=null;var _0x2b0486=null;var _0x337c32=null;if(_0x185697['body']['id']){delete _0x185697[_0x1d7d('0x82')]['id'];}if(_0x185697['body'][_0x1d7d('0xec')]){_0x337c32=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server/files/chat/upload/',util['format'](_0x1d7d('0xee'),Date[_0x1d7d('0xef')]()));_0x185697[_0x1d7d('0x82')][_0x1d7d('0xf0')]=_0x337c32;}return db[_0x1d7d('0x48')][_0x1d7d('0x6f')]({'where':{'id':_0x185697[_0x1d7d('0xbe')]['id']},'include':[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'include':[{'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80')}]}]})['then'](handleEntityNotFound(_0x4d5753,null))[_0x1d7d('0x24')](saveUpdates(_0x185697[_0x1d7d('0x82')],null))[_0x1d7d('0x24')](function(_0x551a56){if(_0x551a56){_0x55929b=_0x551a56;return db['ChatWebsite'][_0x1d7d('0x6f')]({'where':{'id':_0x55929b['ChatWebsiteId']}});}})[_0x1d7d('0x24')](function(_0x1d47d9){if(_0x1d47d9){_0x2b0486=_0x1d47d9;return db[_0x1d7d('0xd7')]['find']({'where':{'id':_0x55929b[_0x1d7d('0x7b')]}});}})['then'](function(_0x5c0be4){if(_0x5c0be4){_0x43ce7f=_0x5c0be4;if(_0x337c32){var _0x46b9e5=null;for(var _0x385e15=0x1;_0x385e15<_0x55929b['Messages'][_0x1d7d('0x6e')];++_0x385e15){_0x46b9e5=_0x55929b[_0x1d7d('0xf1')][_0x385e15];var _0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')]('%s%d',_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5['UserId']):_0x1d7d('0xf4');var _0x474f68=_0x185697['body'][_0x1d7d('0xf5')]||util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x1d7d('0xf7'),_0x46b9e5[_0x1d7d('0x7b')]);switch(_0x2b0486[_0x1d7d('0xf8')]){case _0x1d7d('0xf9'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');break;case'agent_alias':_0x20543c=_0x46b9e5['UserId']?_0x46b9e5[_0x1d7d('0x80')]['alias']||_0x46b9e5['User'][_0x1d7d('0x42')]:'System';break;case _0x1d7d('0xfa'):_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?_0x46b9e5[_0x1d7d('0x80')]['fullname']:_0x1d7d('0xf4');break;default:_0x20543c=_0x46b9e5[_0x1d7d('0xda')]?util[_0x1d7d('0xf2')](_0x1d7d('0xf6'),_0x2b0486[_0x1d7d('0xf3')],_0x46b9e5[_0x1d7d('0xda')]):_0x1d7d('0xf4');}var _0x353bb1=util[_0x1d7d('0xf2')]('[%s]\x20%s:\x20%s\x0a',moment(_0x46b9e5[_0x1d7d('0x87')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x46b9e5[_0x1d7d('0xfb')]==='in'?_0x474f68:_0x20543c,_0x46b9e5['body']);if(!_0x46b9e5[_0x1d7d('0xfc')]){fs[_0x1d7d('0xfd')](_0x337c32,_0x353bb1);}}return db[_0x1d7d('0xfe')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x1d7d('0xff'),'raw':!![]}]});}}})[_0x1d7d('0x24')](function(_0x5c2113){if(_0x5c2113&&_0x5c2113[_0x1d7d('0xff')]&&_0x185697[_0x1d7d('0x82')]){var _0x129d4b={'tls':{'rejectUnauthorized':![]}};if(_0x5c2113['Smtp']['service']){_0x129d4b[_0x1d7d('0x100')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x100')];}else{_0x129d4b['host']=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x101')];_0x129d4b['port']=_0x5c2113['Smtp']['port'];_0x129d4b[_0x1d7d('0x102')]=_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0x102')];}if(_0x5c2113['Smtp']['authentication']){_0x129d4b[_0x1d7d('0x103')]={'user':_0x5c2113[_0x1d7d('0xff')]['user'],'pass':_0x5c2113['Smtp'][_0x1d7d('0x104')]};}return respondWithRpcPromise(_0x1d7d('0x105'),'sendMail',{'account':_0x129d4b,'message':{'from':util[_0x1d7d('0xf2')]('\x22%s\x22\x20<%s>',_0x5c2113[_0x1d7d('0x3b')],_0x5c2113[_0x1d7d('0xcb')]||_0x5c2113[_0x1d7d('0xff')][_0x1d7d('0xa1')]),'to':_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')],'subject':_0x1d7d('0x106'),'text':util[_0x1d7d('0xf2')](_0x1d7d('0x107'),_0x185697[_0x1d7d('0x82')][_0x1d7d('0xec')]),'attachments':[{'path':_0x337c32}]}})['then'](function(){return _0x55929b;})[_0x1d7d('0x2e')](function(_0x18c505){console[_0x1d7d('0x29')](_0x18c505);});}else{return _0x55929b;}})['then'](respondWithStatusCode(_0x4d5753,0xc8))['catch'](handleError(_0x4d5753,null));};exports[_0x1d7d('0x108')]=function(_0x1b41b5,_0x5b79bd,_0xb87340){return db[_0x1d7d('0xd4')][_0x1d7d('0x6f')]({'where':{'id':_0x1b41b5[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x5b79bd,null))[_0x1d7d('0x24')](function(_0x537520){if(_0x537520){return _0x537520[_0x1d7d('0x108')](_0x1b41b5['body']['ids'],_['omit'](_0x1b41b5[_0x1d7d('0x82')],['ids','id'])||{});}})[_0x1d7d('0x24')](respondWithResult(_0x5b79bd,null))[_0x1d7d('0x2e')](handleError(_0x5b79bd,null));};exports['getMessages']=function(_0x1ce79d,_0x7dbbc9,_0x286ddd){var _0x1484b1={'raw':![],'where':{}};var _0x5be0c4={};var _0x50be17={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0x1ce79d[_0x1d7d('0xbe')]['id']}})['then'](handleEntityNotFound(_0x7dbbc9,null))['then'](function(_0x81fadf){if(_0x81fadf){_0x5be0c4['model']=_[_0x1d7d('0x4f')](db[_0x1d7d('0xd4')][_0x1d7d('0x49')]);_0x5be0c4[_0x1d7d('0x4e')]=_['keys'](_0x1ce79d[_0x1d7d('0x4e')]);_0x5be0c4['filters']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],_0x5be0c4[_0x1d7d('0x4e')]);_0x1484b1['attributes']=_[_0x1d7d('0x50')](_0x5be0c4[_0x1d7d('0x4d')],qs['fields'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x51')]));_0x1484b1[_0x1d7d('0x52')]=_0x1484b1[_0x1d7d('0x52')]['length']?_0x1484b1[_0x1d7d('0x52')]:_0x5be0c4[_0x1d7d('0x4d')];if(!_0x1ce79d[_0x1d7d('0x4e')]['hasOwnProperty']('nolimit')){_0x1484b1[_0x1d7d('0x32')]=qs['limit'](_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x32')]);_0x1484b1[_0x1d7d('0x35')]=qs['offset'](_0x1ce79d[_0x1d7d('0x4e')]['offset']);}_0x1484b1[_0x1d7d('0x9c')]=qs['sort'](_0x1ce79d[_0x1d7d('0x4e')]['sort']);_0x1484b1['where']=qs[_0x1d7d('0x57')](_[_0x1d7d('0x58')](_0x1ce79d[_0x1d7d('0x4e')],_0x5be0c4[_0x1d7d('0x57')]));_0x1484b1[_0x1d7d('0x56')]['ChatInteractionId']=_0x81fadf['id'];if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1[_0x1d7d('0x56')],{'$or':_['map'](_0x1484b1['attributes'],function(_0x19ee24){var _0x3cdad2={};_0x3cdad2[_0x19ee24]={'$like':'%'+_0x1ce79d['query'][_0x1d7d('0x92')]+'%'};return _0x3cdad2;})});}if(_0x1ce79d[_0x1d7d('0x4e')][_0x1d7d('0x89')]){var _0x24984d=_0x1ce79d[_0x1d7d('0x4e')]['$gte'][_0x1d7d('0x77')](',');var _0x5a2144={};_0x5a2144[_0x24984d[0x0]]={'$gte':moment(_0x24984d[0x1])[_0x1d7d('0xf2')](_0x1d7d('0x109'))};_0x1484b1[_0x1d7d('0x56')]=_['merge'](_0x1484b1['where'],_0x5a2144);}_0x1484b1=_['merge']({},_0x1484b1,_0x1ce79d['options']);return db['ChatMessage'][_0x1d7d('0x34')]({'where':_0x1484b1[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e83dc){_0x50be17[_0x1d7d('0x34')]=_0x1e83dc;if(_0x1ce79d['query']['includeAll']){_0x1484b1[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')]['findAll'](_0x1484b1);})[_0x1d7d('0x24')](function(_0x2d0232){_0x50be17[_0x1d7d('0xbc')]=_0x2d0232;return _0x50be17;});}})['then'](respondWithFilteredResult(_0x7dbbc9,_0x1484b1))[_0x1d7d('0x2e')](handleError(_0x7dbbc9,null));};exports[_0x1d7d('0x10a')]=function(_0xb42210,_0x3844b6,_0x1181b6){var _0x530493={'where':{}},_0x53cdb8={},_0x960917={'count':0x0,'rows':[]};return db[_0x1d7d('0x48')][_0x1d7d('0xc5')]({'where':{'id':_0xb42210[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x3844b6,null))['then'](function(_0x339603){if(_0x339603){_0x53cdb8[_0x1d7d('0x4d')]=_['keys'](db['ChatMessage'][_0x1d7d('0x49')]);_0x53cdb8['query']=_[_0x1d7d('0x4f')](_0xb42210[_0x1d7d('0x4e')]);_0x53cdb8[_0x1d7d('0x57')]=_[_0x1d7d('0x50')](_0x53cdb8[_0x1d7d('0x4d')],_0x53cdb8[_0x1d7d('0x4e')]);_0x530493[_0x1d7d('0x52')]=_['intersection'](_0x53cdb8[_0x1d7d('0x4d')],qs[_0x1d7d('0x51')](_0xb42210[_0x1d7d('0x4e')]['fields']));_0x530493[_0x1d7d('0x52')]=_0x530493[_0x1d7d('0x52')]['length']?_0x530493[_0x1d7d('0x52')]:_0x53cdb8['model'];if(!_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x53')](_0x1d7d('0x54'))){_0x530493[_0x1d7d('0x32')]=qs[_0x1d7d('0x32')](_0xb42210['query'][_0x1d7d('0x32')]);_0x530493[_0x1d7d('0x35')]=qs['offset'](_0xb42210['query'][_0x1d7d('0x35')]);}_0x530493[_0x1d7d('0x9c')]=qs['sort'](_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x55')]);_0x530493[_0x1d7d('0x56')]=qs[_0x1d7d('0x57')](_['pick'](_0xb42210['query'],_0x53cdb8[_0x1d7d('0x57')]));_0x530493[_0x1d7d('0x56')][_0x1d7d('0xba')]=_0x339603['id'];if(_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]){_0x530493[_0x1d7d('0x56')]=_[_0x1d7d('0xa7')](_0x530493[_0x1d7d('0x56')],{'$or':_[_0x1d7d('0x41')](_0x530493[_0x1d7d('0x52')],function(_0x3dfeb8){var _0x4726cb={};_0x4726cb[_0x3dfeb8]={'$like':'%'+_0xb42210[_0x1d7d('0x4e')][_0x1d7d('0x92')]+'%'};return _0x4726cb;})});}_0x530493[_0x1d7d('0x56')][_0x1d7d('0xfc')]=![];if(_0xb42210[_0x1d7d('0x4e')]['id']){_0x530493['where']['id']={'$gt':_0xb42210[_0x1d7d('0x4e')]['id']};}_0x530493=_['merge']({},_0x530493,_0xb42210['options']);return db[_0x1d7d('0xd4')][_0x1d7d('0x34')]({'where':_0x530493[_0x1d7d('0x56')]})[_0x1d7d('0x24')](function(_0x1e2b03){_0x960917['count']=_0x1e2b03;_0x530493[_0x1d7d('0xc0')]=[];if(_0xb42210[_0x1d7d('0x4e')]['includeAgent']){_0x530493[_0x1d7d('0xc0')]['push']({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42'),_0x1d7d('0x10b')]});}if(_0xb42210[_0x1d7d('0x4e')]['includeAll']){_0x530493[_0x1d7d('0xc0')]=[{'all':!![]}];}return db[_0x1d7d('0xd4')][_0x1d7d('0x10c')](_0x530493);})[_0x1d7d('0x24')](function(_0x2d1258){_0x960917[_0x1d7d('0xbc')]=_0x2d1258;return _0x960917;});}})[_0x1d7d('0x24')](respondWithFilteredResult(_0x3844b6,_0x530493))[_0x1d7d('0x2e')](handleError(_0x3844b6,null));};exports[_0x1d7d('0x10d')]=function(_0x34b43f,_0x14a937,_0x291f26){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x34b43f[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x14a937,null))['then'](function(_0x59b044){if(_0x59b044){return _0x59b044[_0x1d7d('0x10e')](_0x34b43f['body'][_0x1d7d('0x10f')],_[_0x1d7d('0x110')](_0x34b43f[_0x1d7d('0x82')],[_0x1d7d('0x10f'),'id'])||{})[_0x1d7d('0x111')](function(){return db[_0x1d7d('0x7e')]['findAll']({'attributes':['id',_0x1d7d('0x3b'),'color'],'where':{'id':_0x34b43f['body'][_0x1d7d('0x10f')]}});})[_0x1d7d('0x24')](function(_0x5b1ae1){socket[_0x1d7d('0x112')](_0x1d7d('0x113'),{'id':Number(_0x34b43f['params']['id']),'tags':_0x5b1ae1||[]});return{'id':Number(_0x34b43f[_0x1d7d('0xbe')]['id']),'tags':_0x5b1ae1||[]};});}})['then'](respondWithResult(_0x14a937,null))[_0x1d7d('0x2e')](handleError(_0x14a937,null));};exports[_0x1d7d('0x114')]=function(_0x7c3bd8,_0x552481,_0x2c91d5){return db['ChatInteraction'][_0x1d7d('0x6f')]({'where':{'id':_0x7c3bd8[_0x1d7d('0xbe')]['id']}})[_0x1d7d('0x24')](handleEntityNotFound(_0x552481,null))[_0x1d7d('0x24')](function(_0xf5e9f8){if(_0xf5e9f8){return _0xf5e9f8['removeTags'](_0x7c3bd8['query'][_0x1d7d('0x10f')]);}})[_0x1d7d('0x24')](respondWithStatusCode(_0x552481,null))['catch'](handleError(_0x552481,null));};exports[_0x1d7d('0x115')]=function(_0x210be0,_0x5f1b69){var _0x44c5ac=moment()[_0x1d7d('0x116')]()['toString']();var _0x39cae3=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','files',_0x1d7d('0x117'));var _0x1eec70=path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],_0x1d7d('0x118'),_0x1d7d('0x119'),_0x1d7d('0x11a'));var _0x3ded4b=path['join'](_0x39cae3,_0x44c5ac);var _0xe65d48=util[_0x1d7d('0xf2')](_0x1d7d('0x11b'),_0x210be0[_0x1d7d('0xbe')]['id'],_0x44c5ac);var _0x3b440c=path['join'](_0x39cae3,_0xe65d48);var _0x473472=[];_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':_0x1d7d('0x80'),'attributes':['id',_0x1d7d('0x42')],'raw':!![]});_0x473472[_0x1d7d('0x46')]({'model':db[_0x1d7d('0xd7')],'as':_0x1d7d('0x73'),'attributes':['id','firstName',_0x1d7d('0x11c')],'raw':!![]});if(_0x210be0[_0x1d7d('0x4e')][_0x1d7d('0x11a')]){_0x473472[_0x1d7d('0x46')]({'model':db['Attachment'],'as':_0x1d7d('0xe1'),'raw':!![]});}var _0x2aab28=[{'model':db[_0x1d7d('0xd4')],'as':_0x1d7d('0xf1'),'attributes':['id','body',_0x1d7d('0x87'),_0x1d7d('0xfb'),'secret',_0x1d7d('0x8e')],'include':_0x473472}];_0x2aab28['push']({'model':db[_0x1d7d('0x11d')],'as':'Account','attributes':['id','name']});_0x2aab28[_0x1d7d('0x46')]({'model':db[_0x1d7d('0x80')],'as':'Owner','attributes':['id','fullname']});return db[_0x1d7d('0x48')]['find']({'where':{'id':_0x210be0[_0x1d7d('0xbe')]['id']},'include':_0x2aab28})[_0x1d7d('0x24')](handleEntityNotFound(_0x5f1b69,null))[_0x1d7d('0x24')](function(_0x4e8473){if(_0x4e8473){var _0x194822=_0x4e8473[_0x1d7d('0x11e')]({'plain':!![]});fs[_0x1d7d('0x11f')](_0x3ded4b);var _0x3e93bb={'channel':_0x1d7d('0x120'),'account':_0x194822[_0x1d7d('0x121')]['name'],'agent':_0x194822['Owner']?_0x194822[_0x1d7d('0x122')][_0x1d7d('0x42')]:_0x1d7d('0x123'),'createdAt':moment(_0x194822[_0x1d7d('0x87')])[_0x1d7d('0xf2')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x194822[_0x1d7d('0xe3')]?moment(_0x194822['closedAt'])['format'](_0x1d7d('0x109'))[_0x1d7d('0xa5')]():'','disposition':_0x194822[_0x1d7d('0xdd')],'chatInfo':{'browser':_0x194822[_0x1d7d('0x124')],'os':_0x194822[_0x1d7d('0x125')],'referer':_0x194822['referer'],'customerIp':_0x194822[_0x1d7d('0x126')],'customerPort':_0x194822[_0x1d7d('0x127')]?_0x194822[_0x1d7d('0x127')]:_0x1d7d('0x123')},'messages':_(_0x194822[_0x1d7d('0xf1')])[_0x1d7d('0x128')]()['filter']({'secret':![]})[_0x1d7d('0x41')](function(_0x6ea91f){if(_0x6ea91f[_0x1d7d('0xe1')]){var _0x2b3cbd=path[_0x1d7d('0xe8')](_0x1eec70,_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]);if(fs['existsSync'](_0x2b3cbd)){fs[_0x1d7d('0x129')](_0x2b3cbd)[_0x1d7d('0x12a')](fs[_0x1d7d('0x12b')](path[_0x1d7d('0xe8')](_0x3ded4b,_0x6ea91f[_0x1d7d('0xe1')]['basename'])));}}return{'date':moment(_0x6ea91f[_0x1d7d('0x87')])[_0x1d7d('0xf2')](_0x1d7d('0x109'))[_0x1d7d('0xa5')](),'sender':_0x6ea91f['direction']==='out'?_0x6ea91f[_0x1d7d('0x80')]?_0x6ea91f[_0x1d7d('0x80')][_0x1d7d('0x42')]:_0x1d7d('0xf4'):_0x6ea91f[_0x1d7d('0x73')]['firstName']+(_0x6ea91f[_0x1d7d('0x73')][_0x1d7d('0x11c')]?'\x20'+_0x6ea91f[_0x1d7d('0x73')]['lastName']:''),'body':_0x6ea91f[_0x1d7d('0xe1')]?_0x6ea91f[_0x1d7d('0xe1')][_0x1d7d('0xdf')]:_0x6ea91f[_0x1d7d('0x82')],'direction':_0x6ea91f['direction']===_0x1d7d('0xd3')?'A':'C','secret':_0x6ea91f[_0x1d7d('0xfc')],'read':_0x6ea91f[_0x1d7d('0x8e')],'attachment':_0x6ea91f['Attachment']};})[_0x1d7d('0x76')]()};return ejs[_0x1d7d('0x12c')](path[_0x1d7d('0xe8')](config[_0x1d7d('0xed')],'server','views',_0x1d7d('0x12d')),{'interaction':_0x3e93bb})[_0x1d7d('0x24')](function(_0x43f4cb){var _0x21d65a=path[_0x1d7d('0xe8')](_0x3ded4b,'transcript-'+_0x194822['id']+'-'+_0x44c5ac+_0x1d7d('0x12e'));var _0x4d0682={'path':_0x21d65a,'channel':_0x1d7d('0x120'),'interactionId':_0x194822['id']};return pdf[_0x1d7d('0x12f')](_0x43f4cb,_0x4d0682);})['then'](function(){return new BPromise(function(_0x29f93c,_0x582183){zipdir(_0x3ded4b,{'saveTo':_0x3b440c},function(_0x12250e,_0x19127b){if(_0x12250e)return _0x582183(_0x12250e);return _0x29f93c(_0x19127b);});})['then'](function(){return new BPromise(function(_0x35f2d1,_0x588610){rimraf(_0x3ded4b,function(_0x35f18d){if(_0x35f18d)_0x588610(_0x35f18d);return _0x35f2d1();});});})[_0x1d7d('0x24')](function(){return _0x5f1b69[_0x1d7d('0x115')](_0x3b440c,_0xe65d48,function(_0x10263c){if(_0x10263c){console['log']('err',_0x10263c);}else{fs[_0x1d7d('0x130')](_0x3b440c);}});});});}else{return _0x5f1b69[_0x1d7d('0x2f')](0xc8);}})[_0x1d7d('0x2e')](handleError(_0x5f1b69,null));};
\ No newline at end of file
+var _0x8603=['Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','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','mailTranscript','addMessage','ids','omit','getMessages','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','Attachment','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','render','contact','agent','interaction','account','Users','fullname','Tags','TagIds','split','push','catch','index','map','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','forEach','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','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)','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','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','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooMetadata','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','customUpdate','abandon','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','mimetype','attachmentDownload'];(function(_0x56fbb9,_0x196719){var _0x8fdf62=function(_0x25f9e5){while(--_0x25f9e5){_0x56fbb9['push'](_0x56fbb9['shift']());}};_0x8fdf62(++_0x196719);}(_0x8603,0x190));var _0x3860=function(_0x3b8242,_0x2f4be0){_0x3b8242=_0x3b8242-0x0;var _0x337ab2=_0x8603[_0x3b8242];return _0x337ab2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x3860('0x10'));var hardwareService=require(_0x3860('0x11'));var logger=require('../../config/logger')(_0x3860('0x12'));var utils=require(_0x3860('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3860('0x14'));var db=require(_0x3860('0x15'))['db'];config[_0x3860('0x16')]=_[_0x3860('0x17')](config[_0x3860('0x16')],{'host':_0x3860('0x18'),'port':0x18eb});var socket=require(_0x3860('0x19'))(new Redis(config[_0x3860('0x16')]));require(_0x3860('0x1a'))[_0x3860('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232b});var client9004=jayson[_0x3860('0x1c')][_0x3860('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x1055b3,_0xfa0c9a,_0x2d8a3a,_0x378305){return new BPromise(function(_0x311fdb,_0x3c0d91){var _0x3e51b4=_0x378305||client;return _0x3e51b4[_0x3860('0x1e')](_0x1055b3,_0x2d8a3a)['then'](function(_0x4863bd){logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));logger['debug'](_0x3860('0x22'),_0xfa0c9a,_0x3860('0x21'),JSON[_0x3860('0x23')](_0x4863bd));if(_0x4863bd[_0x3860('0x24')]){if(_0x4863bd[_0x3860('0x24')][_0x3860('0x25')]===0x1f4){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);return _0x3c0d91(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x4863bd[_0x3860('0x24')]['message']);return _0x311fdb(_0x4863bd[_0x3860('0x24')][_0x3860('0x26')]);}else{logger[_0x3860('0x1f')](_0x3860('0x20'),_0xfa0c9a,_0x3860('0x21'));_0x311fdb(_0x4863bd['result'][_0x3860('0x26')]);}})['catch'](function(_0x577750){logger[_0x3860('0x24')](_0x3860('0x20'),_0xfa0c9a,_0x577750);_0x3c0d91(_0x577750);});});}function respondWithStatusCode(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0xcc;return function(_0x5f42d5){if(_0x5f42d5){return _0x54b5ec[_0x3860('0x27')](_0x4d9a90);}return _0x54b5ec[_0x3860('0x28')](_0x4d9a90)[_0x3860('0x29')]();};}function respondWithResult(_0x371f3a,_0x9332a5){_0x9332a5=_0x9332a5||0xc8;return function(_0x228d34){if(_0x228d34){return _0x371f3a['status'](_0x9332a5)['json'](_0x228d34);}};}function respondWithFilteredResult(_0x389bd0,_0x1f1809){return function(_0x5a9af2){if(_0x5a9af2){var _0x2551f4=typeof _0x1f1809[_0x3860('0x2a')]===_0x3860('0x2b')&&typeof _0x1f1809[_0x3860('0x2c')]===_0x3860('0x2b');var _0x4bbae9=_0x5a9af2[_0x3860('0x2d')];var _0xf624ba=_0x2551f4?0x0:_0x1f1809[_0x3860('0x2a')];var _0x4bd90c=_0x2551f4?_0x5a9af2[_0x3860('0x2d')]:_0x1f1809['offset']+_0x1f1809[_0x3860('0x2c')];var _0x4825f0;if(_0x4bd90c>=_0x4bbae9){_0x4bd90c=_0x4bbae9;_0x4825f0=0xc8;}else{_0x4825f0=0xce;}_0x389bd0[_0x3860('0x28')](_0x4825f0);return _0x389bd0[_0x3860('0x2e')](_0x3860('0x2f'),_0xf624ba+'-'+_0x4bd90c+'/'+_0x4bbae9)['json'](_0x5a9af2);}return null;};}function patchUpdates(_0x39c751){return function(_0x451b0c){try{jsonpatch['apply'](_0x451b0c,_0x39c751,!![]);}catch(_0x1c94cc){return BPromise['reject'](_0x1c94cc);}return _0x451b0c[_0x3860('0x30')]();};}function saveUpdates(_0x3a577a,_0x35185c){return function(_0x2fc231){if(_0x2fc231){return _0x2fc231[_0x3860('0x31')](_0x3a577a)[_0x3860('0x32')](function(_0x1d3fd0){return _0x1d3fd0;});}return null;};}function removeEntity(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(_0x396ccf){return _0x396ccf['destroy']()[_0x3860('0x32')](function(){_0x4d30bc[_0x3860('0x28')](0xcc)[_0x3860('0x29')]();});}};}function handleEntityNotFound(_0x5af661,_0x523cc1){return function(_0x285b1b){if(!_0x285b1b){_0x5af661[_0x3860('0x27')](0x194);}return _0x285b1b;};}function handleError(_0x3abf18,_0xa921ed){_0xa921ed=_0xa921ed||0x1f4;return function(_0x59271f){logger['error'](_0x59271f[_0x3860('0x33')]);if(_0x59271f[_0x3860('0x34')]){delete _0x59271f[_0x3860('0x34')];}_0x3abf18[_0x3860('0x28')](_0xa921ed)[_0x3860('0x35')](_0x59271f);};}function getMustacheRender(_0x4df2a9,_0x424424){return Mustache[_0x3860('0x36')](_0x4df2a9,_['merge'](_0x424424['body'],{'contact':_0x424424[_0x3860('0x37')],'message':_0x424424[_0x3860('0x26')],'agent':_0x424424[_0x3860('0x38')],'interaction':_0x424424[_0x3860('0x39')],'account':_0x424424[_0x3860('0x3a')]}))||'';}function getInteractionUsers(_0x592311,_0x28f04d){return new BPromise(function(_0x510aef,_0x112600){try{if(_0x28f04d[_0x592311['id']]){_0x592311[_0x3860('0x3b')]=_['map'](_0x28f04d[_0x592311['id']],function(_0x36d9bd){return{'id':_0x36d9bd['id'],'fullname':_0x36d9bd[_0x3860('0x3c')]};});}}catch(_0x4f3303){_0x112600(_0x4f3303);}_0x510aef(_0x592311);});}function getInteractionTags(_0x1ef9aa,_0xc7d34d){return new BPromise(function(_0x15bd2c,_0xf346e){try{if(_0x1ef9aa['TagIds']){_0x1ef9aa[_0x3860('0x3d')]=[];_0x1ef9aa[_0x3860('0x3e')][_0x3860('0x3f')](',')['forEach'](function(_0x3a87e5){_0x1ef9aa['Tags'][_0x3860('0x40')](_0xc7d34d[_0x3a87e5]);});}delete _0x1ef9aa[_0x3860('0x3e')];}catch(_0x405bfc){_0xf346e(_0x405bfc);}_0x15bd2c(_0x1ef9aa);});}function updateChatInteraction(_0x3f613f,_0x2220c8,_0x3f4216){return new BPromise(function(_0x4e0a44,_0xbbbf01){return getInteractionUsers(_0x3f613f,_0x3f4216)[_0x3860('0x32')](function(_0x5dc78f){return getInteractionTags(_0x5dc78f,_0x2220c8);})['then'](function(_0x2938d4){_0x4e0a44(_0x2938d4);})[_0x3860('0x41')](function(_0x4f2f53){_0xbbbf01(_0x4f2f53);});});}exports[_0x3860('0x42')]=function(_0x30d8eb,_0x4c6c23){var _0xa6791a={},_0x56a650={},_0x392dc3={'count':0x0,'rows':[]};var _0x37e5c3=_[_0x3860('0x43')](db[_0x3860('0x44')][_0x3860('0x45')],function(_0x15ebbd){return{'name':_0x15ebbd[_0x3860('0x46')],'type':_0x15ebbd[_0x3860('0x47')][_0x3860('0x48')]};});_0x56a650[_0x3860('0x49')]=_[_0x3860('0x43')](_0x37e5c3,'name');_0x56a650[_0x3860('0x4a')]=_['keys'](_0x30d8eb[_0x3860('0x4a')]);_0x56a650[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],_0x56a650[_0x3860('0x4a')]);_0xa6791a[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x56a650[_0x3860('0x49')],qs['fields'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x4e')]));_0xa6791a[_0x3860('0x4d')]=_0xa6791a['attributes'][_0x3860('0x4f')]?_0xa6791a[_0x3860('0x4d')]:_0x56a650[_0x3860('0x49')];if(!_0x30d8eb[_0x3860('0x4a')]['hasOwnProperty']('nolimit')){_0xa6791a[_0x3860('0x2c')]=qs['limit'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x2c')]);_0xa6791a[_0x3860('0x2a')]=qs['offset'](_0x30d8eb[_0x3860('0x4a')]['offset']);}_0xa6791a[_0x3860('0x50')]=qs['sort'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x51')]);_0xa6791a[_0x3860('0x52')]=qs['filters'](_['pick'](_0x30d8eb[_0x3860('0x4a')],_0x56a650[_0x3860('0x4b')]),_0x37e5c3);var _0x478dd9=[];var _0x3910f5=squel['select']()[_0x3860('0x53')]('id')[_0x3860('0x53')](_0x3860('0x34'))[_0x3860('0x53')](_0x3860('0x54'))[_0x3860('0x55')](_0x3860('0x56'));var _0x5a9987=squel[_0x3860('0x57')]()[_0x3860('0x53')](_0x3860('0x58'))[_0x3860('0x53')](_0x3860('0x59'))[_0x3860('0x53')]('ui.ChatInteractionId')[_0x3860('0x55')](_0x3860('0x5a'),'ui')[_0x3860('0x5b')](_0x3860('0x5c'),'u',_0x3860('0x5d'));var _0x1e2b5d=squel[_0x3860('0x57')]()[_0x3860('0x55')]('chat_interactions','i')[_0x3860('0x5b')](_0x3860('0x5e'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x3860('0x5b')](_0x3860('0x5c'),'o',_0x3860('0x5f'))['left_join'](_0x3860('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3860('0x5b')](_0x3860('0x61'),'me',_0x3860('0x62'))[_0x3860('0x5b')](_0x3860('0x63'),'it',_0x3860('0x64'))[_0x3860('0x5b')](_0x3860('0x56'),'t',_0x3860('0x65'));var _0x151492=squel[_0x3860('0x66')]();var _0x2bac24=[];var _0x58147d=squel['expr']();var _0x5111e0;if(_0x30d8eb[_0x3860('0x4a')]['search']){_0x5111e0=as['parseSearch'](_0x30d8eb[_0x3860('0x4a')][_0x3860('0x67')]);var _0x2ff440=_0x5111e0[_0x3860('0x68')];for(var _0x3d6c17=0x0;_0x3d6c17<_0x5111e0[_0x3860('0x69')]['length'];_0x3d6c17++){var _0x49ec68=_0x5111e0['conditions'][_0x3d6c17];var _0x1d6c70='i';var _0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,['name',_0x49ec68[_0x3860('0x53')]]);if(!_0x1c1da4){switch(_0x49ec68['field']){case _0x3860('0x6b'):if(_0x49ec68[_0x3860('0x6c')]==0x1){_0x1e2b5d['having']('`'+_0x49ec68[_0x3860('0x53')]+_0x3860('0x6d'));}else{_0x1e2b5d[_0x3860('0x6e')]('`'+_0x49ec68[_0x3860('0x53')]+'`\x20>\x200');}break;case _0x3860('0x6f'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){if(_0x49ec68['value']['split']('\x20')[_0x3860('0x4f')]>0x1){_0x151492[_0x2ff440](_0x3860('0x72'),qs[_0x3860('0x73')](_0x49ec68[_0x3860('0x6c')]),null);}else{var _0x28a8b4='%'+_0x49ec68[_0x3860('0x6c')]+'%';_0x151492[_0x2ff440]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x28a8b4,_0x28a8b4,_0x28a8b4);}}else{_0x1c1da4=_[_0x3860('0x6a')](_0x37e5c3,[_0x3860('0x34'),'ContactId']);_0x49ec68[_0x3860('0x53')]=_0x3860('0x74');_0x3427a5=as[_0x3860('0x75')](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x77'):var _0x27e5ab=_0x49ec68[_0x3860('0x6c')][_0x3860('0x3f')](',')['map'](function(_0x1ae31b){return Number(_0x1ae31b);});_0x27e5ab[_0x3860('0x78')](function(_0x1c33dc){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1c33dc+',%');});_0x2bac24=_['union'](_0x2bac24,_0x27e5ab);break;case _0x3860('0x79'):if(_0x49ec68[_0x3860('0x70')]===_0x3860('0x71')){_0x151492[_0x2ff440](_0x3860('0x7a'),'%'+_0x49ec68[_0x3860('0x6c')]+'%',null);}else{_0x1c1da4=_['find'](_0x37e5c3,['name',_0x3860('0x7b')]);_0x49ec68[_0x3860('0x53')]='UserId';_0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5['value'][_0x3860('0x7c')],_0x3427a5[_0x3860('0x6c')][_0x3860('0x29')]);}break;case _0x3860('0x7d'):_0x3427a5=as['buildExpression']('me',null,_0x49ec68);_0x151492[_0x2ff440](_0x3427a5[_0x3860('0x76')],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);break;}}else{var _0x3427a5=as['buildExpression'](_0x1d6c70,_0x1c1da4[_0x3860('0x47')],_0x49ec68);_0x151492[_0x2ff440](_0x3427a5['text'],_0x3427a5[_0x3860('0x6c')]['start'],_0x3427a5['value'][_0x3860('0x29')]);}}}else{var _0x49c356=_(_0x30d8eb[_0x3860('0x4a')])[_0x3860('0x7e')]()[_0x3860('0x43')](function(_0x2fd2f4){return _[_0x3860('0x7f')](_0x37e5c3,[_0x3860('0x34'),_0x2fd2f4])?_0x2fd2f4:undefined;})['compact']()[_0x3860('0x6c')]();if(!_[_0x3860('0x80')](_0x49c356)){_0x49c356[_0x3860('0x78')](function(_0x5d7cc4){if(_0x5d7cc4===_0x3860('0x81')){_0x1e2b5d['where'](_0x3860('0x82'),[][_0x3860('0x83')](_0x30d8eb['query'][_0x5d7cc4]));}else if(_0x5d7cc4===_0x3860('0x84')){var _0x2cd731=JSON[_0x3860('0x85')](_0x30d8eb['query'][_0x5d7cc4])['$gte'];var _0x5a282a=JSON['parse'](_0x30d8eb[_0x3860('0x4a')][_0x5d7cc4])[_0x3860('0x86')];_0x1e2b5d[_0x3860('0x52')](_0x3860('0x87'),_0x2cd731,_0x5a282a);}else{if(_0x30d8eb['query'][_0x5d7cc4]==='null'){_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x88'));}else{_0x1e2b5d[_0x3860('0x52')]('i.'+_0x5d7cc4+_0x3860('0x89'),_0x30d8eb['query'][_0x5d7cc4]);}}});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8a')]){if(_0x30d8eb['query']['read']==0x1){_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8b'));}else{_0x1e2b5d[_0x3860('0x6e')](_0x3860('0x8c'));}}if(_0x30d8eb['query']['tag']){_0x2bac24=_[_0x3860('0x8d')](_0x30d8eb['query'][_0x3860('0x8e')])?_0x30d8eb[_0x3860('0x4a')]['tag']:new Array(_0x30d8eb['query']['tag']);_0x2bac24[_0x3860('0x78')](function(_0x36116e){_0x58147d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x36116e+',%');});}if(_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]){var _0x2351fe=_0x30d8eb[_0x3860('0x4a')][_0x3860('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x3860('0x90')](/'/g,'\x27\x27');if(qs[_0x3860('0x91')](_0x2351fe)){_0x151492['or'](_0x3860('0x92'),_0x2351fe+'%');}else{_0x151492['or'](_0x3860('0x93'),qs[_0x3860('0x73')](_0x2351fe))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2351fe+'%');}}}_0x1e2b5d[_0x3860('0x52')](_0x151492);_0x1e2b5d[_0x3860('0x94')](_0x3860('0x95'));var _0x41ee6f={'type':db[_0x3860('0x96')]['QueryTypes']['SELECT'],'raw':!![]};var _0x196c50=_0x1e2b5d[_0x3860('0x97')]();_0x196c50[_0x3860('0x53')](_0x3860('0x95'));_0x196c50[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));if(_0xa6791a['order']){_0xa6791a[_0x3860('0x50')][_0x3860('0x78')](function(_0x58eddd){var _0x1ff95b=_0x58eddd[0x0]===_0x3860('0x99')?_0x58eddd[0x0]:'i.'+_0x58eddd[0x0];_0x1e2b5d[_0x3860('0x50')](_0x1ff95b,_0x58eddd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x3860('0x80')](_0x2bac24)){_0x1e2b5d[_0x3860('0x6e')](_0x58147d);_0x196c50['where'](_0x3860('0x9a'),_0x2bac24);}BPromise['resolve']()[_0x3860('0x32')](function(){if(!_0x5111e0){if(_0x30d8eb[_0x3860('0x4a')]['ChatWebsiteId'])return;_0x196c50[_0x3860('0x52')](_0x3860('0x9b'));_0x1e2b5d[_0x3860('0x52')](_0x3860('0x9b'));return;}if(_0x30d8eb[_0x3860('0x9c')]['role']!==_0x3860('0x38'))return;return _0x30d8eb[_0x3860('0x9c')][_0x3860('0x9d')]({'attributes':['id'],'raw':!![]})[_0x3860('0x32')](function(_0x3c9837){if(_['isEmpty'](_0x3c9837)){_0x196c50['where'](_0x3860('0x9e'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x196c50[_0x3860('0x52')](_0x3860('0x82'),_[_0x3860('0x43')](_0x3c9837,'id'));_0x1e2b5d[_0x3860('0x52')]('i.ChatWebsiteId\x20IN\x20?',_[_0x3860('0x43')](_0x3c9837,'id'));}});})['then'](function(){if(_0x30d8eb[_0x3860('0x9c')][_0x3860('0x9f')]===_0x3860('0x38')&&!_0x5111e0&&!_0x30d8eb[_0x3860('0x4a')][_0x3860('0x81')])return[];return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x196c50['toString'](),_0x41ee6f);})[_0x3860('0x32')](function(_0x47396d){_0x392dc3['count']=_0x47396d['length'];if(_0x392dc3['count']===0x0)return[];return db['sequelize'][_0x3860('0x4a')](_0x3910f5[_0x3860('0xa1')](),_0x41ee6f)[_0x3860('0x32')](function(_0x1482cd){_0x478dd9=_[_0x3860('0xa2')](_0x1482cd,'id');_0x41ee6f=_[_0x3860('0xa3')](_0x41ee6f,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x30d8eb[_0x3860('0x4a')]['fields']){_0xa6791a[_0x3860('0x4d')][_0x3860('0x78')](function(_0x897ea0){_0x1e2b5d[_0x3860('0x53')]('i.'+_0x897ea0);});}else{_0x1e2b5d[_0x3860('0x53')](_0x3860('0x98'),_0x3860('0x6b'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa4'),_0x3860('0xa5'));_0x1e2b5d[_0x3860('0x53')]('a.mandatoryDisposition',_0x3860('0xa6'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa7'),'contactName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa8'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xa9'),'Contact.firstName');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaa'),_0x3860('0xab'));_0x1e2b5d['field'](_0x3860('0xac'),_0x3860('0xad'));_0x1e2b5d[_0x3860('0x53')]('c.phone',_0x3860('0xae'));_0x1e2b5d[_0x3860('0x53')](_0x3860('0xaf'),'Contact.mobile');_0x1e2b5d[_0x3860('0x53')](_0x3860('0xb0'),_0x3860('0xb1'));_0x1e2b5d['field'](_0x3860('0xb2'),_0x3860('0xb3'));_0x1e2b5d[_0x3860('0x53')]('o.internal',_0x3860('0xb4'));_0x1e2b5d['field'](_0x3860('0xb5'),'TagIds');}if(_0xa6791a[_0x3860('0x2c')])_0x1e2b5d[_0x3860('0x2c')](_0xa6791a[_0x3860('0x2c')]);if(_0xa6791a[_0x3860('0x2a')])_0x1e2b5d[_0x3860('0x2a')](_0xa6791a[_0x3860('0x2a')]);return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x1e2b5d[_0x3860('0xa1')](),_0x41ee6f);})[_0x3860('0x32')](function(_0x10b4e8){if(_0x10b4e8[_0x3860('0x4f')]>0x0)_0x5a9987[_0x3860('0x52')](_0x3860('0xb6'),_[_0x3860('0x43')](_0x10b4e8,'id'));return db[_0x3860('0xa0')][_0x3860('0x4a')](_0x5a9987[_0x3860('0xa1')](),_0x41ee6f)['then'](function(_0x37575b){var _0x1d6d2b=_[_0x3860('0xb7')](_0x37575b,_0x3860('0xb8'));var _0x3e6bf8=[];_0x10b4e8[_0x3860('0x78')](function(_0xffe2a1){_0x3e6bf8[_0x3860('0x40')](updateChatInteraction(_0xffe2a1,_0x478dd9,_0x1d6d2b));});return BPromise[_0x3860('0xb9')](_0x3e6bf8);});});})[_0x3860('0x32')](function(_0x3b932d){_0x392dc3['rows']=_0x3b932d;return _0x392dc3;})[_0x3860('0x32')](respondWithFilteredResult(_0x4c6c23,_0xa6791a))[_0x3860('0x41')](handleError(_0x4c6c23,null));};exports[_0x3860('0xba')]=function(_0x6334ca,_0x4a929e){var _0x1a1994={'raw':![],'where':{'id':_0x6334ca[_0x3860('0xbb')]['id']}},_0x2ece36={};_0x2ece36[_0x3860('0x49')]=_['keys'](db[_0x3860('0x44')]['rawAttributes']);_0x2ece36['query']=_[_0x3860('0x7e')](_0x6334ca[_0x3860('0x4a')]);_0x2ece36[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],_0x2ece36[_0x3860('0x4a')]);_0x1a1994[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x2ece36[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x6334ca[_0x3860('0x4a')][_0x3860('0x4e')]));_0x1a1994[_0x3860('0x4d')]=_0x1a1994['attributes'][_0x3860('0x4f')]?_0x1a1994['attributes']:_0x2ece36[_0x3860('0x49')];if(_0x6334ca[_0x3860('0x4a')]['includeAll']){_0x1a1994[_0x3860('0xbc')]=[{'all':!![]}];}_0x1a1994=_[_0x3860('0xa3')]({},_0x1a1994,_0x6334ca[_0x3860('0xbd')]);return db[_0x3860('0x44')][_0x3860('0x6a')](_0x1a1994)[_0x3860('0x32')](handleEntityNotFound(_0x4a929e,null))[_0x3860('0x32')](respondWithResult(_0x4a929e,null))['catch'](handleError(_0x4a929e,null));};exports[_0x3860('0xbe')]=function(_0x6d1819,_0x9e1682){return db[_0x3860('0x44')][_0x3860('0xbe')](_0x6d1819['body'],{})[_0x3860('0x32')](respondWithResult(_0x9e1682,0xc9))['catch'](handleError(_0x9e1682,null));};exports['update']=function(_0x56af8c,_0x1059a4){if(_0x56af8c[_0x3860('0x7d')]['id']){delete _0x56af8c[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x56af8c[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x1059a4,null))[_0x3860('0x32')](saveUpdates(_0x56af8c['body'],null))[_0x3860('0x32')](respondWithResult(_0x1059a4,null))[_0x3860('0x41')](handleError(_0x1059a4,null));};exports['destroy']=function(_0x490884,_0x4428eb){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x490884['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4428eb,null))['then'](removeEntity(_0x4428eb,null))[_0x3860('0x41')](handleError(_0x4428eb,null));};exports['describe']=function(_0x41fd53,_0xf91fc2){return db['ChatInteraction'][_0x3860('0xbf')]()[_0x3860('0x32')](respondWithResult(_0xf91fc2,null))['catch'](handleError(_0xf91fc2,null));};exports[_0x3860('0xc0')]=function(_0x398bc1,_0x3312c4){var _0x501519=_0x398bc1[_0x3860('0xbb')]['id'];var _0x47fba5;var _0x3e3dac;var _0x18b845;return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x501519}})[_0x3860('0x32')](function(_0x2b1dc1){_0x47fba5=_0x2b1dc1;return db[_0x3860('0xc2')][_0x3860('0xc1')]({'where':{'id':_0x2b1dc1['ChatWebsiteId']},'attributes':['id',_0x3860('0xc3'),_0x3860('0xc4'),'vidaooTopic','vidaooNote',_0x3860('0xc5')],'raw':!![]});})['then'](function(_0xe27f6b){if(_0xe27f6b&&_0xe27f6b[_0x3860('0xc3')]&&_0xe27f6b['vidaooEscalation']){_0x3e3dac=_0xe27f6b;var _0x1041bf={'interaction':{'id':_0x501519},'agent':{'id':_0x398bc1['user']['id'],'name':_0x398bc1[_0x3860('0x9c')]['name'],'fullname':_0x398bc1[_0x3860('0x9c')][_0x3860('0x3c')],'email':_0x398bc1[_0x3860('0x9c')][_0x3860('0xc6')]},'contact':_0x398bc1['body'][_0x3860('0x37')],'account':_0x398bc1[_0x3860('0x7d')][_0x3860('0x3a')]};var _0x1e1baf={'rejectUnauthorized':![],'method':'POST','url':_0x3860('0xc7'),'headers':{'X-APIKEY':_0xe27f6b[_0x3860('0xc3')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x398bc1['user'][_0x3860('0xc6')]],'buttons':null,'topic':_0x3e3dac[_0x3860('0xc8')],'note':_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xca')])?null:getMustacheRender(_0x3e3dac['vidaooNote'],_0x1041bf),'metadata':null},'redirect':_0x3860('0xcb'),'json':!![]};try{if(!_[_0x3860('0xc9')](_0x3e3dac[_0x3860('0xc5')])){var _0x1ce6e6=getMustacheRender(_0x3e3dac['vidaooMetadata'],_0x1041bf);var _0x1df44=JSON['parse'](_0x1ce6e6);_0x1e1baf['body']['metadata']=_0x1df44;}}catch(_0x15b53f){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1e1baf);}else{throw new db[(_0x3860('0x96'))]['ValidationError'](_0x3860('0xcd'));}})[_0x3860('0x32')](function(_0x21c052){_0x18b845=_0x21c052;if(_0x18b845['id']){var _0x3a920b={'body':_0x18b845['join_url'],'ChatWebsiteId':_0x3e3dac['id'],'ChatInteractionId':_0x47fba5['id'],'direction':_0x3860('0xce'),'UserId':_0x398bc1[_0x3860('0x9c')]['id']};return db[_0x3860('0xcf')]['create'](_0x3a920b,{});}else{throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x47fba5['updateAttributes']({'vidaooSessionId':_0x18b845['id']});})['then'](respondWithResult(_0x3312c4,null))[_0x3860('0x41')](handleError(_0x3312c4,null));};exports[_0x3860('0xd0')]=function(_0x2a09a2,_0x266347){if(_0x2a09a2[_0x3860('0x7d')]['id']){delete _0x2a09a2[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')]['find']({'where':{'id':_0x2a09a2['params']['id']},'include':[{'model':db['CmContact'],'as':_0x3860('0x6f')}]})[_0x3860('0x32')](handleEntityNotFound(_0x266347,null))[_0x3860('0x32')](saveUpdates(_0x2a09a2['body'],null))[_0x3860('0x32')](respondWithResult(_0x266347,null))['catch'](handleError(_0x266347,null));};exports['abandon']=function(_0x5f0700,_0x46f630,_0x505ba2){if(_0x5f0700['body']['id']){delete _0x5f0700[_0x3860('0x7d')]['id'];}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x5f0700[_0x3860('0xbb')]['id']}})['then'](function(_0x53392b){if(!_0x53392b){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3860('0xd1'),0x194,'entity\x20not\x20found');_0x46f630['sendStatus'](0x194);}else{if(_0x53392b[_0x3860('0x7b')]){throw new db[(_0x3860('0x96'))][(_0x3860('0xcc'))](_0x3860('0xd2'));}}return _0x53392b;})['then'](function(_0x6e541d){if(_0x6e541d){return _0x6e541d[_0x3860('0x31')]({'closed':_0x5f0700[_0x3860('0x7d')][_0x3860('0xd3')],'disposition':_0x5f0700['body']['disposition']})[_0x3860('0x32')](function(_0x55c19c){return _0x55c19c;});}})[_0x3860('0x32')](function(_0x4ab85d){return respondWithRpcPromise(_0x3860('0xd4'),_0x3860('0xd1'),_0x5f0700[_0x3860('0x7d')],client9004);})[_0x3860('0x32')](respondWithResult(_0x46f630,null))[_0x3860('0x41')](handleError(_0x46f630,null));};exports['attachmentUpload']=function(_0x5d3c4d,_0x5e3c54,_0x39e855){_0x5d3c4d[_0x3860('0x7d')][_0x3860('0x34')]=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd6')];_0x5d3c4d['body'][_0x3860('0xd7')]=_0x5d3c4d[_0x3860('0xd5')]['filename'];_0x5d3c4d[_0x3860('0x7d')]['type']=_0x5d3c4d[_0x3860('0xd5')][_0x3860('0xd8')];return db['Attachment'][_0x3860('0xbe')](_0x5d3c4d[_0x3860('0x7d')])[_0x3860('0x32')](respondWithResult(_0x5e3c54,0xc9))[_0x3860('0x41')](handleError(_0x5e3c54,null));};exports[_0x3860('0xd9')]=function(_0x3e2dfc,_0x135e84,_0x199bbc){return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc[_0x3860('0xbb')]['id']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null))['then'](function(_0x369a4b){if(_0x369a4b){if(_0x369a4b['closed']){return _0x135e84[_0x3860('0x28')](0x193)['json']({'status':0x193,'message':_0x3860('0xda')});}return db['Attachment'][_0x3860('0xc1')]({'where':{'id':_0x3e2dfc['query']['attachId']},'raw':!![]})[_0x3860('0x32')](handleEntityNotFound(_0x135e84,null));}})[_0x3860('0x32')](function(_0xa152b4){if(_0xa152b4){var _0x28931d=_0xa152b4[_0x3860('0xdb')]!==null;var _0x5e65a2=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xde'));if(_0x28931d){_0x5e65a2=path[_0x3860('0xdc')](_0x5e65a2,_0x3860('0xdf'));}var _0x268658=path['join'](_0x5e65a2,_0xa152b4[_0x3860('0xd7')]);return _0x135e84['download'](_0x268658);}})[_0x3860('0x41')](handleError(_0x135e84,null));};exports[_0x3860('0xe0')]=function(_0x118c4e,_0x471da9){var _0x244ceb=null;var _0x24f8a6=null;var _0x532349=null;var _0x17fa12=null;if(_0x118c4e[_0x3860('0x7d')]['id']){delete _0x118c4e[_0x3860('0x7d')]['id'];}if(_0x118c4e[_0x3860('0x7d')]['mailTranscript']){_0x17fa12=path[_0x3860('0xdc')](config[_0x3860('0xdd')],_0x3860('0xe1'),util[_0x3860('0xe2')](_0x3860('0xe3'),Date[_0x3860('0xe4')]()));_0x118c4e['body'][_0x3860('0xe5')]=_0x17fa12;}return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x118c4e[_0x3860('0xbb')]['id']},'include':[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x471da9,null))[_0x3860('0x32')](saveUpdates(_0x118c4e[_0x3860('0x7d')],null))['then'](function(_0x276828){if(_0x276828){_0x244ceb=_0x276828;return db[_0x3860('0xc2')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x81')]}});}})[_0x3860('0x32')](function(_0x1740d0){if(_0x1740d0){_0x532349=_0x1740d0;return db[_0x3860('0xe7')][_0x3860('0x6a')]({'where':{'id':_0x244ceb[_0x3860('0x74')]}});}})[_0x3860('0x32')](function(_0x975c7f){if(_0x975c7f){_0x24f8a6=_0x975c7f;if(_0x17fa12){var _0x23207b=null;for(var _0x1a1366=0x1;_0x1a1366<_0x244ceb[_0x3860('0xe6')][_0x3860('0x4f')];++_0x1a1366){_0x23207b=_0x244ceb['Messages'][_0x1a1366];var _0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');var _0x1290e7=_0x118c4e[_0x3860('0x7d')]['customer']||util[_0x3860('0xe2')](_0x3860('0xe8'),_0x3860('0xeb'),_0x23207b['ContactId']);switch(_0x532349[_0x3860('0xec')]){case _0x3860('0xed'):_0x56566c=_0x23207b[_0x3860('0x7b')]?util[_0x3860('0xe2')](_0x3860('0xe8'),_0x532349[_0x3860('0xe9')],_0x23207b[_0x3860('0x7b')]):_0x3860('0xea');break;case _0x3860('0xee'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0xef')]||_0x23207b['User'][_0x3860('0x3c')]:_0x3860('0xea');break;case _0x3860('0xf0'):_0x56566c=_0x23207b['UserId']?_0x23207b[_0x3860('0x79')][_0x3860('0x3c')]:_0x3860('0xea');break;default:_0x56566c=_0x23207b[_0x3860('0x7b')]?util['format']('%s%d',_0x532349[_0x3860('0xe9')],_0x23207b['UserId']):_0x3860('0xea');}var _0x15314d=util[_0x3860('0xe2')](_0x3860('0xf1'),moment(_0x23207b[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0xf2')),_0x23207b[_0x3860('0xf3')]==='in'?_0x1290e7:_0x56566c,_0x23207b['body']);if(!_0x23207b[_0x3860('0xf4')]){fs[_0x3860('0xf5')](_0x17fa12,_0x15314d);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3860('0xf6')],'as':'Smtp','raw':!![]}]});}}})[_0x3860('0x32')](function(_0x2bf644){if(_0x2bf644&&_0x2bf644[_0x3860('0xf7')]&&_0x118c4e[_0x3860('0x7d')]){var _0xd95981={'tls':{'rejectUnauthorized':![]}};if(_0x2bf644[_0x3860('0xf7')][_0x3860('0xf8')]){_0xd95981[_0x3860('0xf8')]=_0x2bf644['Smtp']['service'];}else{_0xd95981[_0x3860('0xf9')]=_0x2bf644['Smtp'][_0x3860('0xf9')];_0xd95981[_0x3860('0xfa')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfa')];_0xd95981[_0x3860('0xfb')]=_0x2bf644[_0x3860('0xf7')][_0x3860('0xfb')];}if(_0x2bf644['Smtp']['authentication']){_0xd95981[_0x3860('0xfc')]={'user':_0x2bf644[_0x3860('0xf7')][_0x3860('0x9c')],'pass':_0x2bf644['Smtp'][_0x3860('0xfd')]};}return respondWithRpcPromise(_0x3860('0xfe'),_0x3860('0xff'),{'account':_0xd95981,'message':{'from':util['format'](_0x3860('0x100'),_0x2bf644[_0x3860('0x34')],_0x2bf644['email']||_0x2bf644['Smtp']['user']),'to':_0x118c4e['body']['mailTranscript'],'subject':_0x3860('0x101'),'text':util[_0x3860('0xe2')](_0x3860('0x102'),_0x118c4e[_0x3860('0x7d')][_0x3860('0x103')]),'attachments':[{'path':_0x17fa12}]}})['then'](function(){return _0x244ceb;})[_0x3860('0x41')](function(_0x5235e){console['error'](_0x5235e);});}else{return _0x244ceb;}})[_0x3860('0x32')](respondWithStatusCode(_0x471da9,0xc8))[_0x3860('0x41')](handleError(_0x471da9,null));};exports[_0x3860('0x104')]=function(_0x38cdf1,_0x4ab7b2,_0x4c8a10){return db['ChatMessage'][_0x3860('0x6a')]({'where':{'id':_0x38cdf1['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x4ab7b2,null))[_0x3860('0x32')](function(_0x2adf67){if(_0x2adf67){return _0x2adf67[_0x3860('0x104')](_0x38cdf1[_0x3860('0x7d')][_0x3860('0x105')],_[_0x3860('0x106')](_0x38cdf1[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{});}})[_0x3860('0x32')](respondWithResult(_0x4ab7b2,null))[_0x3860('0x41')](handleError(_0x4ab7b2,null));};exports[_0x3860('0x107')]=function(_0x173790,_0x20d0d2,_0x8d3ad7){var _0xf1e9ab={'raw':![],'where':{}};var _0xcf350b={};var _0x1348e0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3860('0xc1')]({'where':{'id':_0x173790['params']['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x20d0d2,null))[_0x3860('0x32')](function(_0x11d0ab){if(_0x11d0ab){_0xcf350b[_0x3860('0x49')]=_[_0x3860('0x7e')](db[_0x3860('0xcf')][_0x3860('0x45')]);_0xcf350b[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x173790['query']);_0xcf350b[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],_0xcf350b[_0x3860('0x4a')]);_0xf1e9ab[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0xcf350b[_0x3860('0x49')],qs['fields'](_0x173790[_0x3860('0x4a')][_0x3860('0x4e')]));_0xf1e9ab[_0x3860('0x4d')]=_0xf1e9ab['attributes'][_0x3860('0x4f')]?_0xf1e9ab[_0x3860('0x4d')]:_0xcf350b[_0x3860('0x49')];if(!_0x173790['query']['hasOwnProperty'](_0x3860('0x108'))){_0xf1e9ab[_0x3860('0x2c')]=qs['limit'](_0x173790[_0x3860('0x4a')]['limit']);_0xf1e9ab[_0x3860('0x2a')]=qs[_0x3860('0x2a')](_0x173790['query'][_0x3860('0x2a')]);}_0xf1e9ab['order']=qs[_0x3860('0x51')](_0x173790[_0x3860('0x4a')][_0x3860('0x51')]);_0xf1e9ab[_0x3860('0x52')]=qs[_0x3860('0x4b')](_[_0x3860('0x109')](_0x173790[_0x3860('0x4a')],_0xcf350b['filters']));_0xf1e9ab[_0x3860('0x52')]['ChatInteractionId']=_0x11d0ab['id'];if(_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]){_0xf1e9ab['where']=_['merge'](_0xf1e9ab[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0xf1e9ab[_0x3860('0x4d')],function(_0x234f93){var _0x5ed001={};_0x5ed001[_0x234f93]={'$like':'%'+_0x173790[_0x3860('0x4a')][_0x3860('0x8f')]+'%'};return _0x5ed001;})});}if(_0x173790[_0x3860('0x4a')]['$gte']){var _0x1ac962=_0x173790[_0x3860('0x4a')]['$gte'][_0x3860('0x3f')](',');var _0x35dbfe={};_0x35dbfe[_0x1ac962[0x0]]={'$gte':moment(_0x1ac962[0x1])[_0x3860('0xe2')](_0x3860('0x10a'))};_0xf1e9ab[_0x3860('0x52')]=_[_0x3860('0xa3')](_0xf1e9ab[_0x3860('0x52')],_0x35dbfe);}_0xf1e9ab=_['merge']({},_0xf1e9ab,_0x173790[_0x3860('0xbd')]);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0xf1e9ab[_0x3860('0x52')]})[_0x3860('0x32')](function(_0x54ebd7){_0x1348e0[_0x3860('0x2d')]=_0x54ebd7;if(_0x173790[_0x3860('0x4a')][_0x3860('0x10b')]){_0xf1e9ab[_0x3860('0xbc')]=[{'all':!![]}];}return db[_0x3860('0xcf')][_0x3860('0x10c')](_0xf1e9ab);})['then'](function(_0x16457e){_0x1348e0[_0x3860('0x10d')]=_0x16457e;return _0x1348e0;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x20d0d2,_0xf1e9ab))[_0x3860('0x41')](handleError(_0x20d0d2,null));};exports[_0x3860('0x10e')]=function(_0x2b6605,_0x11409b,_0x187e3b){var _0x4fb4f3={'where':{}},_0x21b179={},_0x28b7a2={'count':0x0,'rows':[]};return db[_0x3860('0x44')][_0x3860('0xc1')]({'where':{'id':_0x2b6605[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x11409b,null))[_0x3860('0x32')](function(_0x2ca2e7){if(_0x2ca2e7){_0x21b179[_0x3860('0x49')]=_['keys'](db[_0x3860('0xcf')][_0x3860('0x45')]);_0x21b179[_0x3860('0x4a')]=_[_0x3860('0x7e')](_0x2b6605[_0x3860('0x4a')]);_0x21b179[_0x3860('0x4b')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],_0x21b179[_0x3860('0x4a')]);_0x4fb4f3[_0x3860('0x4d')]=_[_0x3860('0x4c')](_0x21b179[_0x3860('0x49')],qs[_0x3860('0x4e')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x4e')]));_0x4fb4f3['attributes']=_0x4fb4f3[_0x3860('0x4d')][_0x3860('0x4f')]?_0x4fb4f3[_0x3860('0x4d')]:_0x21b179[_0x3860('0x49')];if(!_0x2b6605[_0x3860('0x4a')][_0x3860('0x10f')](_0x3860('0x108'))){_0x4fb4f3[_0x3860('0x2c')]=qs[_0x3860('0x2c')](_0x2b6605[_0x3860('0x4a')][_0x3860('0x2c')]);_0x4fb4f3[_0x3860('0x2a')]=qs['offset'](_0x2b6605[_0x3860('0x4a')]['offset']);}_0x4fb4f3[_0x3860('0x50')]=qs['sort'](_0x2b6605[_0x3860('0x4a')]['sort']);_0x4fb4f3[_0x3860('0x52')]=qs[_0x3860('0x4b')](_['pick'](_0x2b6605[_0x3860('0x4a')],_0x21b179[_0x3860('0x4b')]));_0x4fb4f3[_0x3860('0x52')][_0x3860('0xb8')]=_0x2ca2e7['id'];if(_0x2b6605[_0x3860('0x4a')]['filter']){_0x4fb4f3['where']=_[_0x3860('0xa3')](_0x4fb4f3[_0x3860('0x52')],{'$or':_[_0x3860('0x43')](_0x4fb4f3[_0x3860('0x4d')],function(_0x31a537){var _0x438121={};_0x438121[_0x31a537]={'$like':'%'+_0x2b6605[_0x3860('0x4a')]['filter']+'%'};return _0x438121;})});}_0x4fb4f3[_0x3860('0x52')]['secret']=![];if(_0x2b6605[_0x3860('0x4a')]['id']){_0x4fb4f3[_0x3860('0x52')]['id']={'$gt':_0x2b6605[_0x3860('0x4a')]['id']};}_0x4fb4f3=_[_0x3860('0xa3')]({},_0x4fb4f3,_0x2b6605['options']);return db[_0x3860('0xcf')][_0x3860('0x2d')]({'where':_0x4fb4f3['where']})[_0x3860('0x32')](function(_0x4d4366){_0x28b7a2[_0x3860('0x2d')]=_0x4d4366;_0x4fb4f3[_0x3860('0xbc')]=[];if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x110')]){_0x4fb4f3[_0x3860('0xbc')][_0x3860('0x40')]({'model':db[_0x3860('0x79')],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c'),'alias']});}if(_0x2b6605[_0x3860('0x4a')][_0x3860('0x10b')]){_0x4fb4f3[_0x3860('0xbc')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4fb4f3);})['then'](function(_0x39c52e){_0x28b7a2[_0x3860('0x10d')]=_0x39c52e;return _0x28b7a2;});}})[_0x3860('0x32')](respondWithFilteredResult(_0x11409b,_0x4fb4f3))[_0x3860('0x41')](handleError(_0x11409b,null));};exports[_0x3860('0x111')]=function(_0x185040,_0x14cef9,_0x5e1ed4){return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x185040[_0x3860('0xbb')]['id']}})[_0x3860('0x32')](handleEntityNotFound(_0x14cef9,null))['then'](function(_0xbc013a){if(_0xbc013a){return _0xbc013a[_0x3860('0x112')](_0x185040['body'][_0x3860('0x105')],_[_0x3860('0x106')](_0x185040[_0x3860('0x7d')],[_0x3860('0x105'),'id'])||{})[_0x3860('0x113')](function(){return db[_0x3860('0x77')][_0x3860('0x10c')]({'attributes':['id',_0x3860('0x34'),_0x3860('0x54')],'where':{'id':_0x185040[_0x3860('0x7d')][_0x3860('0x105')]}});})[_0x3860('0x32')](function(_0x57f603){socket['emit'](_0x3860('0x114'),{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]});return{'id':Number(_0x185040['params']['id']),'tags':_0x57f603||[]};});}})[_0x3860('0x32')](respondWithResult(_0x14cef9,null))[_0x3860('0x41')](handleError(_0x14cef9,null));};exports[_0x3860('0x115')]=function(_0x2e2ff3,_0x27c591,_0x8b9a7a){return db['ChatInteraction'][_0x3860('0x6a')]({'where':{'id':_0x2e2ff3[_0x3860('0xbb')]['id']}})['then'](handleEntityNotFound(_0x27c591,null))[_0x3860('0x32')](function(_0x5ecd57){if(_0x5ecd57){return _0x5ecd57['removeTags'](_0x2e2ff3['query'][_0x3860('0x105')]);}})[_0x3860('0x32')](respondWithStatusCode(_0x27c591,null))[_0x3860('0x41')](handleError(_0x27c591,null));};exports[_0x3860('0x116')]=function(_0x39524a,_0xa0492b){var _0x4d44de=moment()[_0x3860('0x117')]()[_0x3860('0xa1')]();var _0x1dcd01=path['join'](config[_0x3860('0xdd')],_0x3860('0x118'),_0x3860('0x119'),'tmp');var _0x198422=path['join'](config[_0x3860('0xdd')],'server',_0x3860('0x119'),_0x3860('0x11a'));var _0x1a97c1=path[_0x3860('0xdc')](_0x1dcd01,_0x4d44de);var _0x4cc748=util[_0x3860('0xe2')]('transcript-%d-%s.zip',_0x39524a[_0x3860('0xbb')]['id'],_0x4d44de);var _0x18fd61=path['join'](_0x1dcd01,_0x4cc748);var _0x39eb63=[];_0x39eb63[_0x3860('0x40')]({'model':db['User'],'as':_0x3860('0x79'),'attributes':['id',_0x3860('0x3c')],'raw':!![]});_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0xe7')],'as':_0x3860('0x6f'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x39524a[_0x3860('0x4a')]['attachments']){_0x39eb63[_0x3860('0x40')]({'model':db[_0x3860('0x11b')],'as':'Attachment','raw':!![]});}var _0x134dfd=[{'model':db[_0x3860('0xcf')],'as':_0x3860('0xe6'),'attributes':['id','body',_0x3860('0x84'),'direction','secret','read'],'include':_0x39eb63}];_0x134dfd['push']({'model':db['ChatWebsite'],'as':_0x3860('0x11c'),'attributes':['id',_0x3860('0x34')]});_0x134dfd['push']({'model':db[_0x3860('0x79')],'as':_0x3860('0x11d'),'attributes':['id',_0x3860('0x3c')]});return db[_0x3860('0x44')][_0x3860('0x6a')]({'where':{'id':_0x39524a[_0x3860('0xbb')]['id']},'include':_0x134dfd})[_0x3860('0x32')](handleEntityNotFound(_0xa0492b,null))['then'](function(_0x2fe51b){if(_0x2fe51b){var _0x51bf5a=_0x2fe51b['get']({'plain':!![]});fs[_0x3860('0x11e')](_0x1a97c1);var _0x33abf1={'channel':_0x3860('0x11f'),'account':_0x51bf5a[_0x3860('0x11c')][_0x3860('0x34')],'agent':_0x51bf5a['Owner']?_0x51bf5a[_0x3860('0x11d')]['fullname']:_0x3860('0x120'),'createdAt':moment(_0x51bf5a['createdAt'])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'closedAt':_0x51bf5a[_0x3860('0xd3')]?moment(_0x51bf5a[_0x3860('0x121')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')]():'','disposition':_0x51bf5a[_0x3860('0x122')],'chatInfo':{'browser':_0x51bf5a['browserName'],'os':_0x51bf5a[_0x3860('0x123')],'referer':_0x51bf5a[_0x3860('0x124')],'customerIp':_0x51bf5a[_0x3860('0x125')],'customerPort':_0x51bf5a[_0x3860('0x126')]?_0x51bf5a[_0x3860('0x126')]:'N.A.'},'messages':_(_0x51bf5a[_0x3860('0xe6')])[_0x3860('0x127')]()['filter']({'secret':![]})['map'](function(_0x5b23d2){if(_0x5b23d2[_0x3860('0x11b')]){var _0x409781=path[_0x3860('0xdc')](_0x198422,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')]);if(fs[_0x3860('0x128')](_0x409781)){fs[_0x3860('0x129')](_0x409781)[_0x3860('0x12a')](fs[_0x3860('0x12b')](path[_0x3860('0xdc')](_0x1a97c1,_0x5b23d2[_0x3860('0x11b')][_0x3860('0xd7')])));}}return{'date':moment(_0x5b23d2[_0x3860('0x84')])[_0x3860('0xe2')](_0x3860('0x10a'))[_0x3860('0xa1')](),'sender':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?_0x5b23d2[_0x3860('0x79')]?_0x5b23d2['User'][_0x3860('0x3c')]:_0x3860('0xea'):_0x5b23d2[_0x3860('0x6f')]['firstName']+(_0x5b23d2[_0x3860('0x6f')][_0x3860('0x12c')]?'\x20'+_0x5b23d2['Contact'][_0x3860('0x12c')]:''),'body':_0x5b23d2['Attachment']?_0x5b23d2['Attachment'][_0x3860('0xd7')]:_0x5b23d2[_0x3860('0x7d')],'direction':_0x5b23d2[_0x3860('0xf3')]===_0x3860('0xce')?'A':'C','secret':_0x5b23d2[_0x3860('0xf4')],'read':_0x5b23d2[_0x3860('0x8a')],'attachment':_0x5b23d2['Attachment']};})[_0x3860('0x6c')]()};return ejs[_0x3860('0x12d')](path[_0x3860('0xdc')](config['root'],_0x3860('0x118'),_0x3860('0x12e'),'downloadInteraction.ejs'),{'interaction':_0x33abf1})[_0x3860('0x32')](function(_0x5c5755){var _0x5dfb3b=path[_0x3860('0xdc')](_0x1a97c1,_0x3860('0x12f')+_0x51bf5a['id']+'-'+_0x4d44de+_0x3860('0x130'));var _0x1eba76={'path':_0x5dfb3b,'channel':'Chat','interactionId':_0x51bf5a['id']};return pdf[_0x3860('0x131')](_0x5c5755,_0x1eba76);})['then'](function(){return new BPromise(function(_0x34ad82,_0x44ac65){zipdir(_0x1a97c1,{'saveTo':_0x18fd61},function(_0x43cc98,_0xd9ff70){if(_0x43cc98)return _0x44ac65(_0x43cc98);return _0x34ad82(_0xd9ff70);});})['then'](function(){return new BPromise(function(_0x52e611,_0x4ccefa){rimraf(_0x1a97c1,function(_0x2c90b){if(_0x2c90b)_0x4ccefa(_0x2c90b);return _0x52e611();});});})[_0x3860('0x32')](function(){return _0xa0492b[_0x3860('0x116')](_0x18fd61,_0x4cc748,function(_0x3046f4){if(_0x3046f4){console[_0x3860('0x132')](_0x3860('0x133'),_0x3046f4);}else{fs[_0x3860('0x134')](_0x18fd61);}});});});}else{return _0xa0492b['sendStatus'](0xc8);}})[_0x3860('0x41')](handleError(_0xa0492b,null));};
\ No newline at end of file
index d40ed4e..9b0b8f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf12d=['Users','map','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','getUsers','setDataValue'];(function(_0x5efbce,_0x3d9ebd){var _0x28f15c=function(_0x20045b){while(--_0x20045b){_0x5efbce['push'](_0x5efbce['shift']());}};_0x28f15c(++_0x3d9ebd);}(_0xf12d,0x119));var _0xdf12=function(_0x35f3d4,_0x1ab86d){_0x35f3d4=_0x35f3d4-0x0;var _0x27c69b=_0xf12d[_0x35f3d4];return _0x27c69b;};'use strict';var EventEmitter=require(_0xdf12('0x0'));var ChatInteraction=require(_0xdf12('0x1'))['db'][_0xdf12('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xdf12('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf12('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf12('0x5'),'afterDestroy':'remove'};function emitEvent(_0x376365){return function(_0x115a71,_0x3061d9,_0x109355){_0x115a71[_0xdf12('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x877239){_0x115a71[_0xdf12('0x7')](_0xdf12('0x8'),_0x877239[_0xdf12('0x9')](function(_0xdf393b){return{'id':_0xdf393b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x115a71['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf12('0xa')](function(_0x1c254d){_0x115a71[_0xdf12('0x7')](_0xdf12('0xb'),_0x1c254d[_0xdf12('0xc')]);ChatInteractionEvents['emit'](_0x376365+':'+_0x115a71['id'],_0x115a71);ChatInteractionEvents[_0xdf12('0xd')](_0x376365,_0x115a71);_0x109355(null);})[_0xdf12('0xe')](_0x109355(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdf12('0xf')](e,emitEvent(event));}}module[_0xdf12('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xfa7b=['ChatMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x40b5f5,_0x46820b){var _0x105db1=function(_0x1a41ac){while(--_0x1a41ac){_0x40b5f5['push'](_0x40b5f5['shift']());}};_0x105db1(++_0x46820b);}(_0xfa7b,0x1e3));var _0xbfa7=function(_0x974893,_0x51e86c){_0x974893=_0x974893-0x0;var _0x44a3d3=_0xfa7b[_0x974893];return _0x44a3d3;};'use strict';var EventEmitter=require(_0xbfa7('0x0'));var ChatInteraction=require(_0xbfa7('0x1'))['db'][_0xbfa7('0x2')];var ChatMessage=require(_0xbfa7('0x1'))['db'][_0xbfa7('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfa7('0x4'),'afterDestroy':_0xbfa7('0x5')};function emitEvent(_0x62feae){return function(_0x1fc89d,_0x518a56,_0x55155f){_0x1fc89d[_0xbfa7('0x6')]({'attributes':['id'],'raw':!![]})[_0xbfa7('0x7')](function(_0x372479){_0x1fc89d[_0xbfa7('0x8')](_0xbfa7('0x9'),_0x372479[_0xbfa7('0xa')](function(_0x4e1712){return{'id':_0x4e1712['id']};}));return ChatMessage[_0xbfa7('0xb')]({'where':{'ChatInteractionId':_0x1fc89d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbfa7('0x7')](function(_0x4d2aa7){_0x1fc89d[_0xbfa7('0x8')](_0xbfa7('0xc'),_0x4d2aa7['length']);ChatInteractionEvents[_0xbfa7('0xd')](_0x62feae+':'+_0x1fc89d['id'],_0x1fc89d);ChatInteractionEvents[_0xbfa7('0xd')](_0x62feae,_0x1fc89d);_0x55155f(null);})[_0xbfa7('0xe')](_0x55155f(null));};}for(var e in events){if(events[_0xbfa7('0xf')](e)){var event=events[e];ChatInteraction[_0xbfa7('0x10')](e,emitEvent(event));}}module[_0xbfa7('0x11')]=ChatInteractionEvents;
\ No newline at end of file
index 1003461..2a1606f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x867a=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x867a,0x1b4));var _0xa867=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x867a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xa867('0x0'));var logger=require(_0xa867('0x1'))(_0xa867('0x2'));var moment=require(_0xa867('0x3'));var BPromise=require(_0xa867('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa867('0x5'));var rimraf=require(_0xa867('0x6'));var config=require(_0xa867('0x7'));var attributes=require(_0xa867('0x8'));module[_0xa867('0x9')]=function(_0x13997b,_0x2d6c4f){return _0x13997b[_0xa867('0xa')]('ChatInteraction',attributes,{'tableName':_0xa867('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48fa8f,_0x52297f,_0xa27cd5){if(_0x48fa8f['changed']('closed')){_0x48fa8f[_0xa867('0xc')]=moment()[_0xa867('0xd')](_0xa867('0xe'));}_0xa27cd5(null,_0x48fa8f);}},'charset':'utf8mb4','collate':_0xa867('0xf')});};
\ No newline at end of file
+var _0xe8dc=['request-promise','path','rimraf','./chatInteraction.attributes','exports','define','changed','closed','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x557e1f,_0x1e0a4f){var _0x14d609=function(_0x1a55e7){while(--_0x1a55e7){_0x557e1f['push'](_0x557e1f['shift']());}};_0x14d609(++_0x1e0a4f);}(_0xe8dc,0xbf));var _0xce8d=function(_0x55c3d9,_0x3bf75c){_0x55c3d9=_0x55c3d9-0x0;var _0x19fd97=_0xe8dc[_0x55c3d9];return _0x19fd97;};'use strict';var _=require(_0xce8d('0x0'));var util=require(_0xce8d('0x1'));var logger=require(_0xce8d('0x2'))('api');var moment=require(_0xce8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xce8d('0x4'));var fs=require('fs');var path=require(_0xce8d('0x5'));var rimraf=require(_0xce8d('0x6'));var config=require('../../config/environment');var attributes=require(_0xce8d('0x7'));module[_0xce8d('0x8')]=function(_0x19ca92,_0x19b93b){return _0x19ca92[_0xce8d('0x9')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40c791,_0x509595,_0x4d7024){if(_0x40c791[_0xce8d('0xa')](_0xce8d('0xb'))){_0x40c791['closedAt']=moment()[_0xce8d('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4d7024(null,_0x40c791);}},'charset':_0xce8d('0xd'),'collate':_0xce8d('0xe')});};
\ No newline at end of file
index c39665a..745f16a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdafe=['stringify','catch','AddTagsToChatInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes'];(function(_0x150961,_0x211501){var _0x5e210c=function(_0x186414){while(--_0x186414){_0x150961['push'](_0x150961['shift']());}};_0x5e210c(++_0x211501);}(_0xdafe,0x182));var _0xedaf=function(_0x209609,_0x31ef4e){_0x209609=_0x209609-0x0;var _0x4aa468=_0xdafe[_0x209609];return _0x4aa468;};'use strict';var _=require(_0xedaf('0x0'));var util=require('util');var moment=require(_0xedaf('0x1'));var BPromise=require(_0xedaf('0x2'));var rs=require(_0xedaf('0x3'));var fs=require('fs');var Redis=require(_0xedaf('0x4'));var db=require(_0xedaf('0x5'))['db'];var utils=require(_0xedaf('0x6'));var logger=require(_0xedaf('0x7'))(_0xedaf('0x8'));var config=require(_0xedaf('0x9'));var jayson=require(_0xedaf('0xa'));var client=jayson[_0xedaf('0xb')][_0xedaf('0xc')]({'port':0x232a});config[_0xedaf('0xd')]=_['defaults'](config[_0xedaf('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xedaf('0xe'))(new Redis(config[_0xedaf('0xd')]));require(_0xedaf('0xf'))[_0xedaf('0x10')](socket);function respondWithRpcPromise(_0x4869f9,_0x32603c,_0x1a6df9){return new BPromise(function(_0x4a5a9b,_0x4bfafe){return client['request'](_0x4869f9,_0x1a6df9)[_0xedaf('0x11')](function(_0x134a28){logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));logger[_0xedaf('0x15')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x32603c,_0xedaf('0x14'),JSON['stringify'](_0x134a28));if(_0x134a28[_0xedaf('0x16')]){if(_0x134a28['error'][_0xedaf('0x17')]===0x1f4){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);return _0x4bfafe(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x134a28[_0xedaf('0x16')]['message']);return _0x4a5a9b(_0x134a28[_0xedaf('0x16')][_0xedaf('0x18')]);}else{logger[_0xedaf('0x12')](_0xedaf('0x13'),_0x32603c,_0xedaf('0x14'));_0x4a5a9b(_0x134a28[_0xedaf('0x19')]['message']);}})['catch'](function(_0x233617){logger[_0xedaf('0x16')](_0xedaf('0x13'),_0x32603c,_0x233617);_0x4bfafe(_0x233617);});});}exports[_0xedaf('0x1a')]=function(_0x4633ae){var _0x45a5b2=this;return new Promise(function(_0x5445f7,_0x33138d){return db[_0xedaf('0x1b')][_0xedaf('0x1c')](_0x4633ae[_0xedaf('0x1d')],{'raw':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null,'attributes':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae['options'][_0xedaf('0x21')]||null:null,'limit':_0x4633ae[_0xedaf('0x1e')]?_0x4633ae[_0xedaf('0x1e')]['limit']||null:null})['then'](function(_0x4ee380){logger[_0xedaf('0x12')](_0xedaf('0x1a'),_0x4633ae);logger['debug'](_0xedaf('0x1a'),_0x4633ae,JSON[_0xedaf('0x22')](_0x4ee380));_0x5445f7(_0x4ee380);})[_0xedaf('0x23')](function(_0x4a780f){logger['error'](_0xedaf('0x1a'),_0x4a780f[_0xedaf('0x18')],_0x4633ae);_0x33138d(_0x45a5b2['error'](0x1f4,_0x4a780f[_0xedaf('0x18')]));});});};exports[_0xedaf('0x24')]=function(_0x23f02e){return new Promise(function(_0x5c375f,_0x2a8b7d){return db[_0xedaf('0x1b')]['find']({'where':_0x23f02e[_0xedaf('0x1e')]?_0x23f02e[_0xedaf('0x1e')][_0xedaf('0x20')]||null:null})[_0xedaf('0x11')](function(_0x3c0347){if(_0x3c0347){return _0x3c0347[_0xedaf('0x25')](_0x23f02e['body'][_0xedaf('0x26')],_[_0xedaf('0x27')](_0x23f02e[_0xedaf('0x1d')],[_0xedaf('0x26'),'id'])||{});}})[_0xedaf('0x28')](function(_0x4b41a3){logger['info']('AddTags',_0x23f02e);logger[_0xedaf('0x15')](_0xedaf('0x29'),_0x23f02e,JSON['stringify'](_0x4b41a3));_0x5c375f(_0x4b41a3);})[_0xedaf('0x23')](function(_0xfbb947){logger[_0xedaf('0x16')](_0xedaf('0x29'),_0xfbb947['message'],_0x23f02e);_0x2a8b7d(_this[_0xedaf('0x16')](0x1f4,_0xfbb947[_0xedaf('0x18')]));});});};
\ No newline at end of file
+var _0xb203=['debug','request\x20sent','stringify','error','code','message','result','UpdateChatInteraction','ChatInteraction','update','body','raw','options','attributes','limit','then','catch','AddTagsToChatInteraction','find','where','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s'];(function(_0xc973f8,_0x1759ec){var _0x5cd9d5=function(_0x582522){while(--_0x582522){_0xc973f8['push'](_0xc973f8['shift']());}};_0x5cd9d5(++_0x1759ec);}(_0xb203,0x192));var _0x3b20=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb203[_0x178e48];return _0x440d7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3b20('0x0'));var BPromise=require(_0x3b20('0x1'));var rs=require(_0x3b20('0x2'));var fs=require('fs');var Redis=require(_0x3b20('0x3'));var db=require(_0x3b20('0x4'))['db'];var utils=require(_0x3b20('0x5'));var logger=require(_0x3b20('0x6'))('rpc');var config=require(_0x3b20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3b20('0x8')][_0x3b20('0x9')]({'port':0x232a});config[_0x3b20('0xa')]=_[_0x3b20('0xb')](config['redis'],{'host':_0x3b20('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b20('0xa')]));require(_0x3b20('0xd'))[_0x3b20('0xe')](socket);function respondWithRpcPromise(_0x54d775,_0x231670,_0x40672b){return new BPromise(function(_0x1cd925,_0x5193d9){return client[_0x3b20('0xf')](_0x54d775,_0x40672b)['then'](function(_0x18bbfc){logger[_0x3b20('0x10')](_0x3b20('0x11'),_0x231670,'request\x20sent');logger[_0x3b20('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x231670,_0x3b20('0x13'),JSON[_0x3b20('0x14')](_0x18bbfc));if(_0x18bbfc[_0x3b20('0x15')]){if(_0x18bbfc['error'][_0x3b20('0x16')]===0x1f4){logger[_0x3b20('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x231670,_0x18bbfc['error'][_0x3b20('0x17')]);return _0x5193d9(_0x18bbfc[_0x3b20('0x15')][_0x3b20('0x17')]);}logger[_0x3b20('0x15')](_0x3b20('0x11'),_0x231670,_0x18bbfc[_0x3b20('0x15')][_0x3b20('0x17')]);return _0x1cd925(_0x18bbfc[_0x3b20('0x15')][_0x3b20('0x17')]);}else{logger[_0x3b20('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x231670,'request\x20sent');_0x1cd925(_0x18bbfc[_0x3b20('0x18')]['message']);}})['catch'](function(_0xe1b55d){logger[_0x3b20('0x15')](_0x3b20('0x11'),_0x231670,_0xe1b55d);_0x5193d9(_0xe1b55d);});});}exports[_0x3b20('0x19')]=function(_0x5688ec){var _0x24cf44=this;return new Promise(function(_0x1844d4,_0x10692c){return db[_0x3b20('0x1a')][_0x3b20('0x1b')](_0x5688ec[_0x3b20('0x1c')],{'raw':_0x5688ec['options']?_0x5688ec['options'][_0x3b20('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5688ec[_0x3b20('0x1e')]?_0x5688ec[_0x3b20('0x1e')]['where']||null:null,'attributes':_0x5688ec[_0x3b20('0x1e')]?_0x5688ec[_0x3b20('0x1e')][_0x3b20('0x1f')]||null:null,'limit':_0x5688ec[_0x3b20('0x1e')]?_0x5688ec['options'][_0x3b20('0x20')]||null:null})[_0x3b20('0x21')](function(_0x5c8934){logger[_0x3b20('0x10')]('UpdateChatInteraction',_0x5688ec);logger[_0x3b20('0x12')](_0x3b20('0x19'),_0x5688ec,JSON[_0x3b20('0x14')](_0x5c8934));_0x1844d4(_0x5c8934);})[_0x3b20('0x22')](function(_0x1328a7){logger[_0x3b20('0x15')]('UpdateChatInteraction',_0x1328a7[_0x3b20('0x17')],_0x5688ec);_0x10692c(_0x24cf44[_0x3b20('0x15')](0x1f4,_0x1328a7[_0x3b20('0x17')]));});});};exports[_0x3b20('0x23')]=function(_0x2bacbc){return new Promise(function(_0x1c2b5e,_0x1356e5){return db['ChatInteraction'][_0x3b20('0x24')]({'where':_0x2bacbc[_0x3b20('0x1e')]?_0x2bacbc['options'][_0x3b20('0x25')]||null:null})[_0x3b20('0x21')](function(_0x3e5d16){if(_0x3e5d16){return _0x3e5d16[_0x3b20('0x26')](_0x2bacbc[_0x3b20('0x1c')][_0x3b20('0x27')],_[_0x3b20('0x28')](_0x2bacbc[_0x3b20('0x1c')],[_0x3b20('0x27'),'id'])||{});}})['spread'](function(_0x44797c){logger[_0x3b20('0x10')]('AddTags',_0x2bacbc);logger[_0x3b20('0x12')](_0x3b20('0x29'),_0x2bacbc,JSON[_0x3b20('0x14')](_0x44797c));_0x1c2b5e(_0x44797c);})[_0x3b20('0x22')](function(_0x559150){logger['error'](_0x3b20('0x29'),_0x559150[_0x3b20('0x17')],_0x2bacbc);_0x1356e5(_this[_0x3b20('0x15')](0x1f4,_0x559150['message']));});});};
\ No newline at end of file
index e60a67f..27da0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9865=['emit','removeListener','register','./chatInteraction.events','save','remove'];(function(_0x459cd7,_0x3a1c34){var _0x125653=function(_0x26c7e0){while(--_0x26c7e0){_0x459cd7['push'](_0x459cd7['shift']());}};_0x125653(++_0x3a1c34);}(_0x9865,0x1dd));var _0x5986=function(_0x12be85,_0x4a5721){_0x12be85=_0x12be85-0x0;var _0x5a1135=_0x9865[_0x12be85];return _0x5a1135;};'use strict';var ChatInteractionEvents=require(_0x5986('0x0'));var events=[_0x5986('0x1'),_0x5986('0x2'),'update'];function createListener(_0x2fac99,_0x13474e){return function(_0x16ba5f){_0x13474e[_0x5986('0x3')](_0x2fac99,_0x16ba5f);};}function removeListener(_0x38b430,_0xe8aa39){return function(){ChatInteractionEvents[_0x5986('0x4')](_0x38b430,_0xe8aa39);};}exports[_0x5986('0x5')]=function(_0x1f5e19){for(var _0x5757e5=0x0,_0x4c53ff=events['length'];_0x5757e5<_0x4c53ff;_0x5757e5++){var _0x5c3e3c=events[_0x5757e5];var _0x3ebd8b=createListener('chatInteraction:'+_0x5c3e3c,_0x1f5e19);ChatInteractionEvents['on'](_0x5c3e3c,_0x3ebd8b);}};
\ No newline at end of file
+var _0xb6c5=['removeListener','register','length','chatInteraction:','save','remove','emit'];(function(_0x55d02f,_0x417368){var _0x2dd981=function(_0x1544eb){while(--_0x1544eb){_0x55d02f['push'](_0x55d02f['shift']());}};_0x2dd981(++_0x417368);}(_0xb6c5,0x19a));var _0x5b6c=function(_0x47e821,_0x355c97){_0x47e821=_0x47e821-0x0;var _0x21b33b=_0xb6c5[_0x47e821];return _0x21b33b;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x5b6c('0x0'),_0x5b6c('0x1'),'update'];function createListener(_0x4126ef,_0x39f36f){return function(_0x4aed9d){_0x39f36f[_0x5b6c('0x2')](_0x4126ef,_0x4aed9d);};}function removeListener(_0x211986,_0x4957d3){return function(){ChatInteractionEvents[_0x5b6c('0x3')](_0x211986,_0x4957d3);};}exports[_0x5b6c('0x4')]=function(_0x49eeb3){for(var _0x5c4a08=0x0,_0x2e234e=events[_0x5b6c('0x5')];_0x5c4a08<_0x2e234e;_0x5c4a08++){var _0x779b90=events[_0x5c4a08];var _0x19d3f8=createListener(_0x5b6c('0x6')+_0x779b90,_0x49eeb3);ChatInteractionEvents['on'](_0x779b90,_0x19d3f8);}};
\ No newline at end of file
index a5ad6e4..635daef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6f6=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','format','%s-%s','now','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','put','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','destroy','removeTags','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated'];(function(_0x1ecdaa,_0x32a5f5){var _0x141bb7=function(_0x496b1a){while(--_0x496b1a){_0x1ecdaa['push'](_0x1ecdaa['shift']());}};_0x141bb7(++_0x32a5f5);}(_0xf6f6,0xaf));var _0x6f6f=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0xf6f6[_0x4c7935];return _0x30651d;};'use strict';var multer=require(_0x6f6f('0x0'));var util=require('util');var path=require(_0x6f6f('0x1'));var timeout=require(_0x6f6f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f6f('0x3'));var auth=require(_0x6f6f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f6f('0x5'));var controller=require(_0x6f6f('0x6'));router[_0x6f6f('0x7')]('/',auth[_0x6f6f('0x8')](),controller['index']);router[_0x6f6f('0x7')]('/describe',auth[_0x6f6f('0x8')](),controller['describe']);router[_0x6f6f('0x7')](_0x6f6f('0x9'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xb')]);router[_0x6f6f('0x7')](_0x6f6f('0xc'),auth[_0x6f6f('0xa')](),controller[_0x6f6f('0xd')]);router[_0x6f6f('0x7')](_0x6f6f('0xe'),auth['isAuthenticated'](),controller[_0x6f6f('0xf')]);router[_0x6f6f('0x7')](_0x6f6f('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x11')]);router['get'](_0x6f6f('0x12'),auth[_0x6f6f('0x8')](),controller[_0x6f6f('0x13')]);router[_0x6f6f('0x14')]('/',auth[_0x6f6f('0x8')](),controller['create']);router[_0x6f6f('0x14')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x6f6f('0x15')]);var upload=multer({'storage':multer[_0x6f6f('0x16')]({'destination':function(_0x44fa82,_0x4c855e,_0x47bad1){_0x47bad1(null,path['join'](config[_0x6f6f('0x17')],_0x6f6f('0x18')));},'filename':function(_0x280c8f,_0x396ba6,_0x29a2b8){_0x29a2b8(null,util[_0x6f6f('0x19')](_0x6f6f('0x1a'),Date[_0x6f6f('0x1b')](),_0x396ba6['originalname'][_0x6f6f('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6f6f('0x14')](_0x6f6f('0x1d'),upload['single'](_0x6f6f('0x1e')),controller[_0x6f6f('0x1f')]);router[_0x6f6f('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x6f6f('0x20')]);router[_0x6f6f('0x14')](_0x6f6f('0x21'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:addtags'),controller['addTags']);router[_0x6f6f('0x24')](_0x6f6f('0x9'),auth[_0x6f6f('0x8')](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:update'),controller[_0x6f6f('0x25')]);router[_0x6f6f('0x24')](_0x6f6f('0x26'),controller[_0x6f6f('0x27')]);router[_0x6f6f('0x24')]('/:id/abandon',auth[_0x6f6f('0xa')](),controller[_0x6f6f('0x28')]);router[_0x6f6f('0x24')](_0x6f6f('0x29'),controller['close']);router[_0x6f6f('0x2a')](_0x6f6f('0x9'),auth['isAuthenticated'](),interaction[_0x6f6f('0x22')](_0x6f6f('0x23'),'chatinteraction:destroy'),controller[_0x6f6f('0x2b')]);router[_0x6f6f('0x2a')](_0x6f6f('0x21'),auth['isAuthenticated'](),controller[_0x6f6f('0x2c')]);module[_0x6f6f('0x2d')]=router;
\ No newline at end of file
+var _0x75d0=['removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','diskStorage','join','root','format','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy'];(function(_0x396910,_0x397bda){var _0x217d81=function(_0x1e6ab9){while(--_0x1e6ab9){_0x396910['push'](_0x396910['shift']());}};_0x217d81(++_0x397bda);}(_0x75d0,0x175));var _0x075d=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x75d0[_0x5e3a45];return _0x13419f;};'use strict';var multer=require(_0x075d('0x0'));var util=require(_0x075d('0x1'));var path=require(_0x075d('0x2'));var timeout=require(_0x075d('0x3'));var express=require(_0x075d('0x4'));var router=express['Router']();var fs_extra=require(_0x075d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x075d('0x6'));var config=require('../../config/environment');var controller=require(_0x075d('0x7'));router[_0x075d('0x8')]('/',auth[_0x075d('0x9')](),controller[_0x075d('0xa')]);router[_0x075d('0x8')]('/describe',auth[_0x075d('0x9')](),controller[_0x075d('0xb')]);router[_0x075d('0x8')](_0x075d('0xc'),auth[_0x075d('0xd')](),controller['show']);router[_0x075d('0x8')](_0x075d('0xe'),auth[_0x075d('0xd')](),controller['attachmentDownload']);router[_0x075d('0x8')](_0x075d('0xf'),auth[_0x075d('0x9')](),controller[_0x075d('0x10')]);router[_0x075d('0x8')](_0x075d('0x11'),auth[_0x075d('0xd')](),controller[_0x075d('0x12')]);router['get']('/:id/download',auth[_0x075d('0x9')](),controller['download']);router[_0x075d('0x13')]('/',auth[_0x075d('0x9')](),controller[_0x075d('0x14')]);router[_0x075d('0x13')](_0x075d('0x15'),auth[_0x075d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x075d('0x16')]({'destination':function(_0x49e684,_0x39e873,_0x471b77){_0x471b77(null,path[_0x075d('0x17')](config[_0x075d('0x18')],'server/files/attachments/'));},'filename':function(_0x3d1be1,_0x13c8ad,_0x4e9cb1){_0x4e9cb1(null,util[_0x075d('0x19')](_0x075d('0x1a'),Date[_0x075d('0x1b')](),_0x13c8ad['originalname'][_0x075d('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x075d('0x13')](_0x075d('0x1d'),upload[_0x075d('0x1e')](_0x075d('0x1f')),controller[_0x075d('0x20')]);router[_0x075d('0x13')](_0x075d('0xf'),auth[_0x075d('0xd')](),controller[_0x075d('0x21')]);router[_0x075d('0x13')](_0x075d('0x22'),auth['isAuthenticated'](),interaction[_0x075d('0x23')](_0x075d('0x24'),_0x075d('0x25')),controller[_0x075d('0x26')]);router['put'](_0x075d('0xc'),auth[_0x075d('0x9')](),interaction[_0x075d('0x23')](_0x075d('0x24'),_0x075d('0x27')),controller[_0x075d('0x28')]);router[_0x075d('0x29')](_0x075d('0x2a'),controller[_0x075d('0x2b')]);router[_0x075d('0x29')](_0x075d('0x2c'),auth[_0x075d('0xd')](),controller[_0x075d('0x2d')]);router[_0x075d('0x29')](_0x075d('0x2e'),controller[_0x075d('0x2f')]);router[_0x075d('0x30')](_0x075d('0xc'),auth[_0x075d('0x9')](),interaction[_0x075d('0x23')](_0x075d('0x24'),_0x075d('0x31')),controller[_0x075d('0x32')]);router[_0x075d('0x30')](_0x075d('0x22'),auth['isAuthenticated'](),controller[_0x075d('0x33')]);module[_0x075d('0x34')]=router;
\ No newline at end of file
index b7c6451..6d5987a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75b2=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e14b7,_0x405dbc){var _0x4570f6=function(_0x29d285){while(--_0x29d285){_0x3e14b7['push'](_0x3e14b7['shift']());}};_0x4570f6(++_0x405dbc);}(_0x75b2,0x1c0));var _0x275b=function(_0x125597,_0x1d5ddd){_0x125597=_0x125597-0x0;var _0x5a6818=_0x75b2[_0x125597];return _0x5a6818;};'use strict';var Sequelize=require(_0x275b('0x0'));module[_0x275b('0x1')]={'body':{'type':Sequelize[_0x275b('0x2')](_0x275b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x275b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x275b('0x5')]}};
\ No newline at end of file
+var _0x55f3=['medium','INTEGER','sequelize','TEXT'];(function(_0x1e8777,_0x302837){var _0x915e0=function(_0x135a34){while(--_0x135a34){_0x1e8777['push'](_0x1e8777['shift']());}};_0x915e0(++_0x302837);}(_0x55f3,0xe2));var _0x355f=function(_0x5ebd33,_0x472aa1){_0x5ebd33=_0x5ebd33-0x0;var _0x454403=_0x55f3[_0x5ebd33];return _0x454403;};'use strict';var Sequelize=require(_0x355f('0x0'));module['exports']={'body':{'type':Sequelize[_0x355f('0x1')](_0x355f('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x355f('0x3')]}};
\ No newline at end of file
index 9bd14be..79f46c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3cb=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','describe','get','messages','createdAt','lastMessage','format','getUsers','User','agent','admin','fullname','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ChatInternalMessage','type','model'];(function(_0x14e26d,_0x124ef0){var _0xef0fe2=function(_0x3103db){while(--_0x3103db){_0x14e26d['push'](_0x14e26d['shift']());}};_0xef0fe2(++_0x124ef0);}(_0xe3cb,0x11c));var _0xbe3c=function(_0x3ccd94,_0x3d8018){_0x3ccd94=_0x3ccd94-0x0;var _0x49686c=_0xe3cb[_0x3ccd94];return _0x49686c;};'use strict';var emlformat=require(_0xbe3c('0x0'));var rimraf=require(_0xbe3c('0x1'));var zipdir=require(_0xbe3c('0x2'));var jsonpatch=require(_0xbe3c('0x3'));var rp=require('request-promise');var moment=require(_0xbe3c('0x4'));var BPromise=require(_0xbe3c('0x5'));var Mustache=require(_0xbe3c('0x6'));var util=require(_0xbe3c('0x7'));var path=require(_0xbe3c('0x8'));var sox=require(_0xbe3c('0x9'));var csv=require('to-csv');var ejs=require(_0xbe3c('0xa'));var fs=require('fs');var fs_extra=require(_0xbe3c('0xb'));var _=require(_0xbe3c('0xc'));var squel=require(_0xbe3c('0xd'));var crypto=require(_0xbe3c('0xe'));var jsforce=require(_0xbe3c('0xf'));var deskjs=require(_0xbe3c('0x10'));var toCsv=require(_0xbe3c('0x11'));var querystring=require(_0xbe3c('0x12'));var Papa=require(_0xbe3c('0x13'));var Redis=require(_0xbe3c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xbe3c('0x15'));var as=require(_0xbe3c('0x16'));var hardwareService=require(_0xbe3c('0x17'));var logger=require('../../config/logger')(_0xbe3c('0x18'));var utils=require('../../config/utils');var config=require(_0xbe3c('0x19'));var licenseUtil=require(_0xbe3c('0x1a'));var db=require(_0xbe3c('0x1b'))['db'];config[_0xbe3c('0x1c')]=_[_0xbe3c('0x1d')](config['redis'],{'host':_0xbe3c('0x1e'),'port':0x18eb});var socket=require(_0xbe3c('0x1f'))(new Redis(config[_0xbe3c('0x1c')]));require('./chatInternalMessage.socket')[_0xbe3c('0x20')](socket);function respondWithStatusCode(_0x502029,_0x128858){_0x128858=_0x128858||0xcc;return function(_0x15172f){if(_0x15172f){return _0x502029[_0xbe3c('0x21')](_0x128858);}return _0x502029[_0xbe3c('0x22')](_0x128858)[_0xbe3c('0x23')]();};}function respondWithResult(_0x75609f,_0x1aff71){_0x1aff71=_0x1aff71||0xc8;return function(_0x1d2b38){if(_0x1d2b38){return _0x75609f['status'](_0x1aff71)[_0xbe3c('0x24')](_0x1d2b38);}};}function respondWithFilteredResult(_0x55a3a9,_0x5b762e){return function(_0x19afc2){if(_0x19afc2){var _0xb33d7b=typeof _0x5b762e['offset']===_0xbe3c('0x25')&&typeof _0x5b762e[_0xbe3c('0x26')]===_0xbe3c('0x25');var _0x2219ca=_0x19afc2[_0xbe3c('0x27')];var _0x326745=_0xb33d7b?0x0:_0x5b762e[_0xbe3c('0x28')];var _0x1b0470=_0xb33d7b?_0x19afc2[_0xbe3c('0x27')]:_0x5b762e[_0xbe3c('0x28')]+_0x5b762e[_0xbe3c('0x26')];var _0x4a09b8;if(_0x1b0470>=_0x2219ca){_0x1b0470=_0x2219ca;_0x4a09b8=0xc8;}else{_0x4a09b8=0xce;}_0x55a3a9[_0xbe3c('0x22')](_0x4a09b8);return _0x55a3a9['set'](_0xbe3c('0x29'),_0x326745+'-'+_0x1b0470+'/'+_0x2219ca)[_0xbe3c('0x24')](_0x19afc2);}return null;};}function patchUpdates(_0x7ebad7){return function(_0x117d15){try{jsonpatch[_0xbe3c('0x2a')](_0x117d15,_0x7ebad7,!![]);}catch(_0x1ace9d){return BPromise[_0xbe3c('0x2b')](_0x1ace9d);}return _0x117d15[_0xbe3c('0x2c')]();};}function saveUpdates(_0x507368,_0x5a5643){return function(_0x4a61c4){if(_0x4a61c4){return _0x4a61c4[_0xbe3c('0x2d')](_0x507368)[_0xbe3c('0x2e')](function(_0x2e005c){return _0x2e005c;});}return null;};}function removeEntity(_0x17657f,_0x48abb9){return function(_0x331566){if(_0x331566){return _0x331566[_0xbe3c('0x2f')]()[_0xbe3c('0x2e')](function(){_0x17657f[_0xbe3c('0x22')](0xcc)[_0xbe3c('0x23')]();});}};}function handleEntityNotFound(_0x433665,_0x5b152c){return function(_0x3dfde7){if(!_0x3dfde7){_0x433665[_0xbe3c('0x21')](0x194);}return _0x3dfde7;};}function handleError(_0xc79910,_0x161cf1){_0x161cf1=_0x161cf1||0x1f4;return function(_0x1928f4){logger[_0xbe3c('0x30')](_0x1928f4[_0xbe3c('0x31')]);if(_0x1928f4[_0xbe3c('0x32')]){delete _0x1928f4['name'];}_0xc79910['status'](_0x161cf1)['send'](_0x1928f4);};}exports['index']=function(_0x4bf8d4,_0x410113){var _0x1ee5e8={},_0x24804e={},_0x1ece8d={'count':0x0,'rows':[]};var _0x9f2d1e=_[_0xbe3c('0x33')](db[_0xbe3c('0x34')]['rawAttributes'],function(_0x42707d){return{'name':_0x42707d['fieldName'],'type':_0x42707d[_0xbe3c('0x35')]['key']};});_0x24804e[_0xbe3c('0x36')]=_[_0xbe3c('0x33')](_0x9f2d1e,_0xbe3c('0x32'));_0x24804e[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x4bf8d4[_0xbe3c('0x37')]);_0x24804e[_0xbe3c('0x39')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],_0x24804e[_0xbe3c('0x37')]);_0x1ee5e8[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x24804e[_0xbe3c('0x36')],qs['fields'](_0x4bf8d4['query'][_0xbe3c('0x3c')]));_0x1ee5e8[_0xbe3c('0x3b')]=_0x1ee5e8['attributes'][_0xbe3c('0x3d')]?_0x1ee5e8[_0xbe3c('0x3b')]:_0x24804e[_0xbe3c('0x36')];if(!_0x4bf8d4['query'][_0xbe3c('0x3e')](_0xbe3c('0x3f'))){_0x1ee5e8[_0xbe3c('0x26')]=qs[_0xbe3c('0x26')](_0x4bf8d4['query'][_0xbe3c('0x26')]);_0x1ee5e8[_0xbe3c('0x28')]=qs[_0xbe3c('0x28')](_0x4bf8d4[_0xbe3c('0x37')]['offset']);}_0x1ee5e8[_0xbe3c('0x40')]=qs[_0xbe3c('0x41')](_0x4bf8d4['query'][_0xbe3c('0x41')]);_0x1ee5e8['where']=qs['filters'](_[_0xbe3c('0x42')](_0x4bf8d4[_0xbe3c('0x37')],_0x24804e['filters']),_0x9f2d1e);if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x43')]){_0x1ee5e8['where']=_[_0xbe3c('0x44')](_0x1ee5e8[_0xbe3c('0x45')],{'$or':_[_0xbe3c('0x33')](_0x9f2d1e,function(_0xd84bdf){if(_0xd84bdf[_0xbe3c('0x35')]!==_0xbe3c('0x46')){var _0x3b24bb={};_0x3b24bb[_0xd84bdf[_0xbe3c('0x32')]]={'$like':'%'+_0x4bf8d4['query']['filter']+'%'};return _0x3b24bb;}})});}_0x1ee5e8=_['merge']({},_0x1ee5e8,_0x4bf8d4[_0xbe3c('0x47')]);var _0x30db93={'where':_0x1ee5e8['where']};return db[_0xbe3c('0x34')]['count'](_0x30db93)['then'](function(_0x47ae32){_0x1ece8d[_0xbe3c('0x27')]=_0x47ae32;if(_0x4bf8d4[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x1ee5e8[_0xbe3c('0x49')]=[{'all':!![]}];}return db[_0xbe3c('0x34')][_0xbe3c('0x4a')](_0x1ee5e8);})[_0xbe3c('0x2e')](function(_0x53ef9b){_0x1ece8d[_0xbe3c('0x4b')]=_0x53ef9b;return _0x1ece8d;})[_0xbe3c('0x2e')](respondWithFilteredResult(_0x410113,_0x1ee5e8))[_0xbe3c('0x4c')](handleError(_0x410113,null));};exports['show']=function(_0x3d62ff,_0x216f85){var _0x40c542={'raw':!![],'where':{'id':_0x3d62ff[_0xbe3c('0x4d')]['id']}},_0x435493={};_0x435493['model']=_[_0xbe3c('0x38')](db[_0xbe3c('0x34')][_0xbe3c('0x4e')]);_0x435493[_0xbe3c('0x37')]=_[_0xbe3c('0x38')](_0x3d62ff['query']);_0x435493['filters']=_[_0xbe3c('0x3a')](_0x435493['model'],_0x435493[_0xbe3c('0x37')]);_0x40c542[_0xbe3c('0x3b')]=_[_0xbe3c('0x3a')](_0x435493[_0xbe3c('0x36')],qs[_0xbe3c('0x3c')](_0x3d62ff['query'][_0xbe3c('0x3c')]));_0x40c542[_0xbe3c('0x3b')]=_0x40c542['attributes'][_0xbe3c('0x3d')]?_0x40c542['attributes']:_0x435493[_0xbe3c('0x36')];if(_0x3d62ff[_0xbe3c('0x37')][_0xbe3c('0x48')]){_0x40c542['include']=[{'all':!![]}];}_0x40c542=_[_0xbe3c('0x44')]({},_0x40c542,_0x3d62ff['options']);return db['ChatInternalMessage']['find'](_0x40c542)['then'](handleEntityNotFound(_0x216f85,null))['then'](respondWithResult(_0x216f85,null))[_0xbe3c('0x4c')](handleError(_0x216f85,null));};exports[_0xbe3c('0x4f')]=function(_0x2a6bdb,_0x5b5d78){return db['ChatInternalMessage']['create'](_0x2a6bdb[_0xbe3c('0x50')],{})[_0xbe3c('0x2e')](respondWithResult(_0x5b5d78,0xc9))[_0xbe3c('0x4c')](handleError(_0x5b5d78,null));};exports[_0xbe3c('0x2d')]=function(_0x33bac2,_0x2d66f4){if(_0x33bac2['body']['id']){delete _0x33bac2['body']['id'];}return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x33bac2[_0xbe3c('0x4d')]['id']}})[_0xbe3c('0x2e')](handleEntityNotFound(_0x2d66f4,null))['then'](saveUpdates(_0x33bac2['body'],null))[_0xbe3c('0x2e')](respondWithResult(_0x2d66f4,null))['catch'](handleError(_0x2d66f4,null));};exports[_0xbe3c('0x2f')]=function(_0x5336d0,_0x36d4b5){return db[_0xbe3c('0x34')]['find']({'where':{'id':_0x5336d0[_0xbe3c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36d4b5,null))[_0xbe3c('0x2e')](removeEntity(_0x36d4b5,null))[_0xbe3c('0x4c')](handleError(_0x36d4b5,null));};exports[_0xbe3c('0x51')]=function(_0x1ad725,_0x1bc3b5){return db[_0xbe3c('0x34')][_0xbe3c('0x51')]()[_0xbe3c('0x2e')](respondWithResult(_0x1bc3b5,null))['catch'](handleError(_0x1bc3b5,null));};function wrapUser(_0x33fdd0){return function(_0x35fc4a){var _0x380501=_0x33fdd0[_0xbe3c('0x52')]({'plain':!![]});_0x380501[_0xbe3c('0x53')]=[];if(_0x35fc4a){_0x380501['lastMessageAt']=_0x35fc4a[_0xbe3c('0x54')];_0x380501[_0xbe3c('0x55')]=_0x35fc4a;}else{_0x380501['lastMessageAt']=moment(0x0)[_0xbe3c('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x380501[_0xbe3c('0x55')]={};}return _0x380501;};}exports[_0xbe3c('0x57')]=function(_0x41af49,_0x2c2439,_0x5e7164){var _0x4c7012=[];return db[_0xbe3c('0x58')][_0xbe3c('0x4a')]({'where':{'role':[_0xbe3c('0x59'),_0xbe3c('0x5a'),'user']},'attributes':['id',_0xbe3c('0x5b'),_0xbe3c('0x32'),'role','userpic',_0xbe3c('0x5c'),_0xbe3c('0x5d'),_0xbe3c('0x5e'),_0xbe3c('0x5f'),'showWebBar'],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x60')),'include':[{'model':db[_0xbe3c('0x61')],'as':'VoiceQueues','attributes':['id',_0xbe3c('0x32'),'type'],'through':{'attributes':[]}}]})['then'](function(_0x31572f){if(_0x31572f){var _0x114473=_0x41af49[_0xbe3c('0x62')]['get']({'plain':!![]});if(!_0x114473)throw new Error(_0xbe3c('0x63'));if(_0x114473[_0xbe3c('0x64')]===_0xbe3c('0x62')){return db[_0xbe3c('0x65')][_0xbe3c('0x66')]({'where':{'name':_0xbe3c('0x67'),'userProfileId':_0x114473['userProfileId']},'raw':!![]})[_0xbe3c('0x2e')](function(_0x389dbd){if(_0x389dbd){if(_0x389dbd[_0xbe3c('0x68')]===0x0){return db[_0xbe3c('0x69')][_0xbe3c('0x4a')]({'where':{'sectionId':_0x389dbd['id']},'raw':!![]})['then'](function(_0x577e87){var _0x52eed0=[];if(_[_0xbe3c('0x6a')](_0x577e87)){_0x52eed0=_[_0xbe3c('0x43')](_0x31572f,function(_0x916437){if(_0x916437[_0xbe3c('0x64')]!==_0xbe3c('0x59')){return _0x916437;}});return _0x52eed0;}else{for(var _0x4473e8=0x0;_0x4473e8<_0x31572f['length'];_0x4473e8++){var _0x3fe62b=_0x31572f[_0x4473e8];if(_0x3fe62b[_0xbe3c('0x64')]===_0xbe3c('0x59')){var _0x9d6caf=_['find'](_0x577e87,function(_0x1f5d0e){return _0x1f5d0e[_0xbe3c('0x6b')]===_0x3fe62b['id'];});if(_0x9d6caf)_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}else{_0x52eed0[_0xbe3c('0x6c')](_0x3fe62b);}}return _0x52eed0;}});}else{return _0x31572f;}}else{var _0xcf8a7f=_['filter'](_0x31572f,function(_0x28171a){if(_0x28171a['role']!==_0xbe3c('0x59')){return _0x28171a;}});return _0xcf8a7f;}});}else{return _0x31572f;}}})[_0xbe3c('0x2e')](function(_0x359d94){var _0x504af7=[];if(_0x359d94){_0x4c7012=_0x359d94;for(var _0x12b923=0x0;_0x12b923<_0x359d94[_0xbe3c('0x3d')];_0x12b923+=0x1){_0x4c7012[_0x12b923][_0xbe3c('0x53')]=[];_0x504af7[_0xbe3c('0x6c')](db['ChatInternalMessage'][_0xbe3c('0x66')]({'where':{'FromId':[_0x41af49['user']['id'],_0x359d94[_0x12b923]['id']],'ToId':[_0x41af49[_0xbe3c('0x62')]['id'],_0x359d94[_0x12b923]['id']],'ChatGroupId':null},'attributes':['id',_0xbe3c('0x54'),'FromId',_0xbe3c('0x6d'),_0xbe3c('0x6e'),_0xbe3c('0x50')],'order':qs[_0xbe3c('0x41')](_0xbe3c('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xbe3c('0x2e')](wrapUser(_0x359d94[_0x12b923])));}return BPromise[_0xbe3c('0x70')](_0x504af7);}return[];})[_0xbe3c('0x2e')](function(_0x1ba77c){return{'rows':_0x1ba77c,'count':_0x1ba77c[_0xbe3c('0x3d')]};})[_0xbe3c('0x2e')](respondWithResult(_0x2c2439,null))[_0xbe3c('0x4c')](handleError(_0x2c2439,null));};
\ No newline at end of file
+var _0xa6b0=['autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','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','redis','./chatInternalMessage.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','options','create','body','update','find','params','destroy','get','messages','lastMessageAt','createdAt','lastMessage','User','agent','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId'];(function(_0x4a4892,_0x36d225){var _0x2aa999=function(_0xc61d93){while(--_0xc61d93){_0x4a4892['push'](_0x4a4892['shift']());}};_0x2aa999(++_0x36d225);}(_0xa6b0,0xdd));var _0x0a6b=function(_0x16e6aa,_0x4ca862){_0x16e6aa=_0x16e6aa-0x0;var _0x33c8d3=_0xa6b0[_0x16e6aa];return _0x33c8d3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a6b('0x0'));var rp=require('request-promise');var moment=require(_0x0a6b('0x1'));var BPromise=require(_0x0a6b('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0a6b('0x3'));var csv=require(_0x0a6b('0x4'));var ejs=require(_0x0a6b('0x5'));var fs=require('fs');var fs_extra=require(_0x0a6b('0x6'));var _=require('lodash');var squel=require(_0x0a6b('0x7'));var crypto=require('crypto');var jsforce=require(_0x0a6b('0x8'));var deskjs=require(_0x0a6b('0x9'));var toCsv=require(_0x0a6b('0x4'));var querystring=require(_0x0a6b('0xa'));var Papa=require('papaparse');var Redis=require(_0x0a6b('0xb'));var authService=require(_0x0a6b('0xc'));var qs=require(_0x0a6b('0xd'));var as=require(_0x0a6b('0xe'));var hardwareService=require(_0x0a6b('0xf'));var logger=require(_0x0a6b('0x10'))(_0x0a6b('0x11'));var utils=require(_0x0a6b('0x12'));var config=require(_0x0a6b('0x13'));var licenseUtil=require(_0x0a6b('0x14'));var db=require(_0x0a6b('0x15'))['db'];config['redis']=_['defaults'](config[_0x0a6b('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a6b('0x16')]));require(_0x0a6b('0x17'))[_0x0a6b('0x18')](socket);function respondWithStatusCode(_0x363a64,_0x218c25){_0x218c25=_0x218c25||0xcc;return function(_0x46f18b){if(_0x46f18b){return _0x363a64['sendStatus'](_0x218c25);}return _0x363a64[_0x0a6b('0x19')](_0x218c25)[_0x0a6b('0x1a')]();};}function respondWithResult(_0x2e7edb,_0x1c6108){_0x1c6108=_0x1c6108||0xc8;return function(_0xbe0c35){if(_0xbe0c35){return _0x2e7edb['status'](_0x1c6108)[_0x0a6b('0x1b')](_0xbe0c35);}};}function respondWithFilteredResult(_0x333a37,_0x54db3a){return function(_0x38fdd4){if(_0x38fdd4){var _0x1be1e7=typeof _0x54db3a['offset']===_0x0a6b('0x1c')&&typeof _0x54db3a[_0x0a6b('0x1d')]===_0x0a6b('0x1c');var _0x276d45=_0x38fdd4[_0x0a6b('0x1e')];var _0x1432bc=_0x1be1e7?0x0:_0x54db3a[_0x0a6b('0x1f')];var _0x42afae=_0x1be1e7?_0x38fdd4[_0x0a6b('0x1e')]:_0x54db3a[_0x0a6b('0x1f')]+_0x54db3a['limit'];var _0x2cff7c;if(_0x42afae>=_0x276d45){_0x42afae=_0x276d45;_0x2cff7c=0xc8;}else{_0x2cff7c=0xce;}_0x333a37[_0x0a6b('0x19')](_0x2cff7c);return _0x333a37[_0x0a6b('0x20')](_0x0a6b('0x21'),_0x1432bc+'-'+_0x42afae+'/'+_0x276d45)[_0x0a6b('0x1b')](_0x38fdd4);}return null;};}function patchUpdates(_0x2105fb){return function(_0x3cb952){try{jsonpatch[_0x0a6b('0x22')](_0x3cb952,_0x2105fb,!![]);}catch(_0x19ad1a){return BPromise[_0x0a6b('0x23')](_0x19ad1a);}return _0x3cb952[_0x0a6b('0x24')]();};}function saveUpdates(_0x783a70,_0x5ee3b3){return function(_0x456d54){if(_0x456d54){return _0x456d54['update'](_0x783a70)[_0x0a6b('0x25')](function(_0x320b66){return _0x320b66;});}return null;};}function removeEntity(_0x4afb3d,_0x53d412){return function(_0x158858){if(_0x158858){return _0x158858['destroy']()[_0x0a6b('0x25')](function(){_0x4afb3d[_0x0a6b('0x19')](0xcc)[_0x0a6b('0x1a')]();});}};}function handleEntityNotFound(_0x76f082,_0x14b174){return function(_0x1af047){if(!_0x1af047){_0x76f082[_0x0a6b('0x26')](0x194);}return _0x1af047;};}function handleError(_0x344063,_0x117b7e){_0x117b7e=_0x117b7e||0x1f4;return function(_0x46fd4a){logger['error'](_0x46fd4a[_0x0a6b('0x27')]);if(_0x46fd4a[_0x0a6b('0x28')]){delete _0x46fd4a[_0x0a6b('0x28')];}_0x344063[_0x0a6b('0x19')](_0x117b7e)[_0x0a6b('0x29')](_0x46fd4a);};}exports[_0x0a6b('0x2a')]=function(_0x3922a1,_0x1352a6){var _0x4d2424={},_0x575961={},_0xc1b4a5={'count':0x0,'rows':[]};var _0x1fad65=_[_0x0a6b('0x2b')](db[_0x0a6b('0x2c')][_0x0a6b('0x2d')],function(_0x16f034){return{'name':_0x16f034[_0x0a6b('0x2e')],'type':_0x16f034['type'][_0x0a6b('0x2f')]};});_0x575961[_0x0a6b('0x30')]=_['map'](_0x1fad65,_0x0a6b('0x28'));_0x575961[_0x0a6b('0x31')]=_[_0x0a6b('0x32')](_0x3922a1[_0x0a6b('0x31')]);_0x575961[_0x0a6b('0x33')]=_[_0x0a6b('0x34')](_0x575961['model'],_0x575961[_0x0a6b('0x31')]);_0x4d2424['attributes']=_[_0x0a6b('0x34')](_0x575961[_0x0a6b('0x30')],qs[_0x0a6b('0x35')](_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x35')]));_0x4d2424[_0x0a6b('0x36')]=_0x4d2424[_0x0a6b('0x36')][_0x0a6b('0x37')]?_0x4d2424[_0x0a6b('0x36')]:_0x575961[_0x0a6b('0x30')];if(!_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x38')](_0x0a6b('0x39'))){_0x4d2424[_0x0a6b('0x1d')]=qs['limit'](_0x3922a1['query'][_0x0a6b('0x1d')]);_0x4d2424[_0x0a6b('0x1f')]=qs[_0x0a6b('0x1f')](_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x1f')]);}_0x4d2424[_0x0a6b('0x3a')]=qs[_0x0a6b('0x3b')](_0x3922a1['query'][_0x0a6b('0x3b')]);_0x4d2424[_0x0a6b('0x3c')]=qs['filters'](_[_0x0a6b('0x3d')](_0x3922a1['query'],_0x575961[_0x0a6b('0x33')]),_0x1fad65);if(_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x3e')]){_0x4d2424[_0x0a6b('0x3c')]=_[_0x0a6b('0x3f')](_0x4d2424[_0x0a6b('0x3c')],{'$or':_[_0x0a6b('0x2b')](_0x1fad65,function(_0x24ebba){if(_0x24ebba[_0x0a6b('0x40')]!=='VIRTUAL'){var _0x3f8d3b={};_0x3f8d3b[_0x24ebba['name']]={'$like':'%'+_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x3e')]+'%'};return _0x3f8d3b;}})});}_0x4d2424=_[_0x0a6b('0x3f')]({},_0x4d2424,_0x3922a1['options']);var _0x45580d={'where':_0x4d2424[_0x0a6b('0x3c')]};return db[_0x0a6b('0x2c')][_0x0a6b('0x1e')](_0x45580d)[_0x0a6b('0x25')](function(_0x4fc120){_0xc1b4a5['count']=_0x4fc120;if(_0x3922a1[_0x0a6b('0x31')][_0x0a6b('0x41')]){_0x4d2424[_0x0a6b('0x42')]=[{'all':!![]}];}return db[_0x0a6b('0x2c')][_0x0a6b('0x43')](_0x4d2424);})['then'](function(_0x5b3430){_0xc1b4a5[_0x0a6b('0x44')]=_0x5b3430;return _0xc1b4a5;})[_0x0a6b('0x25')](respondWithFilteredResult(_0x1352a6,_0x4d2424))[_0x0a6b('0x45')](handleError(_0x1352a6,null));};exports[_0x0a6b('0x46')]=function(_0xf085dd,_0x189811){var _0x426e0e={'raw':!![],'where':{'id':_0xf085dd['params']['id']}},_0x5ce281={};_0x5ce281[_0x0a6b('0x30')]=_[_0x0a6b('0x32')](db[_0x0a6b('0x2c')]['rawAttributes']);_0x5ce281['query']=_[_0x0a6b('0x32')](_0xf085dd['query']);_0x5ce281[_0x0a6b('0x33')]=_[_0x0a6b('0x34')](_0x5ce281[_0x0a6b('0x30')],_0x5ce281[_0x0a6b('0x31')]);_0x426e0e[_0x0a6b('0x36')]=_[_0x0a6b('0x34')](_0x5ce281[_0x0a6b('0x30')],qs[_0x0a6b('0x35')](_0xf085dd[_0x0a6b('0x31')]['fields']));_0x426e0e['attributes']=_0x426e0e[_0x0a6b('0x36')][_0x0a6b('0x37')]?_0x426e0e[_0x0a6b('0x36')]:_0x5ce281[_0x0a6b('0x30')];if(_0xf085dd[_0x0a6b('0x31')][_0x0a6b('0x41')]){_0x426e0e[_0x0a6b('0x42')]=[{'all':!![]}];}_0x426e0e=_[_0x0a6b('0x3f')]({},_0x426e0e,_0xf085dd[_0x0a6b('0x47')]);return db['ChatInternalMessage']['find'](_0x426e0e)[_0x0a6b('0x25')](handleEntityNotFound(_0x189811,null))[_0x0a6b('0x25')](respondWithResult(_0x189811,null))[_0x0a6b('0x45')](handleError(_0x189811,null));};exports['create']=function(_0x42ff48,_0x1762c5){return db[_0x0a6b('0x2c')][_0x0a6b('0x48')](_0x42ff48[_0x0a6b('0x49')],{})[_0x0a6b('0x25')](respondWithResult(_0x1762c5,0xc9))['catch'](handleError(_0x1762c5,null));};exports[_0x0a6b('0x4a')]=function(_0x28fe67,_0x1b3ffb){if(_0x28fe67[_0x0a6b('0x49')]['id']){delete _0x28fe67[_0x0a6b('0x49')]['id'];}return db[_0x0a6b('0x2c')][_0x0a6b('0x4b')]({'where':{'id':_0x28fe67[_0x0a6b('0x4c')]['id']}})[_0x0a6b('0x25')](handleEntityNotFound(_0x1b3ffb,null))['then'](saveUpdates(_0x28fe67['body'],null))[_0x0a6b('0x25')](respondWithResult(_0x1b3ffb,null))[_0x0a6b('0x45')](handleError(_0x1b3ffb,null));};exports[_0x0a6b('0x4d')]=function(_0x1301de,_0x2f8530){return db['ChatInternalMessage'][_0x0a6b('0x4b')]({'where':{'id':_0x1301de['params']['id']}})[_0x0a6b('0x25')](handleEntityNotFound(_0x2f8530,null))[_0x0a6b('0x25')](removeEntity(_0x2f8530,null))[_0x0a6b('0x45')](handleError(_0x2f8530,null));};exports['describe']=function(_0x4bf7f4,_0xf65847){return db[_0x0a6b('0x2c')]['describe']()[_0x0a6b('0x25')](respondWithResult(_0xf65847,null))[_0x0a6b('0x45')](handleError(_0xf65847,null));};function wrapUser(_0x255c0f){return function(_0x5a098e){var _0x886d8=_0x255c0f[_0x0a6b('0x4e')]({'plain':!![]});_0x886d8[_0x0a6b('0x4f')]=[];if(_0x5a098e){_0x886d8[_0x0a6b('0x50')]=_0x5a098e[_0x0a6b('0x51')];_0x886d8['lastMessage']=_0x5a098e;}else{_0x886d8[_0x0a6b('0x50')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x886d8[_0x0a6b('0x52')]={};}return _0x886d8;};}exports['getUsers']=function(_0x2d73e2,_0x3960e1,_0x54a5ae){var _0x9a6a9d=[];return db[_0x0a6b('0x53')][_0x0a6b('0x43')]({'where':{'role':[_0x0a6b('0x54'),'admin',_0x0a6b('0x55')]},'attributes':['id',_0x0a6b('0x56'),_0x0a6b('0x28'),'role',_0x0a6b('0x57'),_0x0a6b('0x58'),_0x0a6b('0x59'),_0x0a6b('0x5a'),'allowmessenger',_0x0a6b('0x5b')],'order':qs[_0x0a6b('0x3b')](_0x0a6b('0x5c')),'include':[{'model':db[_0x0a6b('0x5d')],'as':'VoiceQueues','attributes':['id','name',_0x0a6b('0x40')],'through':{'attributes':[]}}]})[_0x0a6b('0x25')](function(_0x5a45ab){if(_0x5a45ab){var _0x595992=_0x2d73e2[_0x0a6b('0x55')][_0x0a6b('0x4e')]({'plain':!![]});if(!_0x595992)throw new Error(_0x0a6b('0x5e'));if(_0x595992[_0x0a6b('0x5f')]===_0x0a6b('0x55')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x595992[_0x0a6b('0x60')]},'raw':!![]})[_0x0a6b('0x25')](function(_0x580938){if(_0x580938){if(_0x580938[_0x0a6b('0x61')]===0x0){return db[_0x0a6b('0x62')]['findAll']({'where':{'sectionId':_0x580938['id']},'raw':!![]})[_0x0a6b('0x25')](function(_0x562e75){var _0x2a4fdd=[];if(_['isEmpty'](_0x562e75)){_0x2a4fdd=_[_0x0a6b('0x3e')](_0x5a45ab,function(_0x346355){if(_0x346355['role']!==_0x0a6b('0x54')){return _0x346355;}});return _0x2a4fdd;}else{for(var _0x1f31ad=0x0;_0x1f31ad<_0x5a45ab[_0x0a6b('0x37')];_0x1f31ad++){var _0x31636d=_0x5a45ab[_0x1f31ad];if(_0x31636d[_0x0a6b('0x5f')]===_0x0a6b('0x54')){var _0x2c6b6b=_[_0x0a6b('0x4b')](_0x562e75,function(_0x213252){return _0x213252[_0x0a6b('0x63')]===_0x31636d['id'];});if(_0x2c6b6b)_0x2a4fdd[_0x0a6b('0x64')](_0x31636d);}else{_0x2a4fdd['push'](_0x31636d);}}return _0x2a4fdd;}});}else{return _0x5a45ab;}}else{var _0x21d649=_[_0x0a6b('0x3e')](_0x5a45ab,function(_0x28fc8c){if(_0x28fc8c[_0x0a6b('0x5f')]!==_0x0a6b('0x54')){return _0x28fc8c;}});return _0x21d649;}});}else{return _0x5a45ab;}}})[_0x0a6b('0x25')](function(_0x119b43){var _0x469457=[];if(_0x119b43){_0x9a6a9d=_0x119b43;for(var _0x2922b4=0x0;_0x2922b4<_0x119b43[_0x0a6b('0x37')];_0x2922b4+=0x1){_0x9a6a9d[_0x2922b4]['messages']=[];_0x469457[_0x0a6b('0x64')](db['ChatInternalMessage'][_0x0a6b('0x4b')]({'where':{'FromId':[_0x2d73e2[_0x0a6b('0x55')]['id'],_0x119b43[_0x2922b4]['id']],'ToId':[_0x2d73e2[_0x0a6b('0x55')]['id'],_0x119b43[_0x2922b4]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x0a6b('0x65'),_0x0a6b('0x66'),_0x0a6b('0x67'),_0x0a6b('0x49')],'order':qs[_0x0a6b('0x3b')](_0x0a6b('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x119b43[_0x2922b4])));}return BPromise[_0x0a6b('0x69')](_0x469457);}return[];})[_0x0a6b('0x25')](function(_0x322c44){return{'rows':_0x322c44,'count':_0x322c44['length']};})[_0x0a6b('0x25')](respondWithResult(_0x3960e1,null))[_0x0a6b('0x45')](handleError(_0x3960e1,null));};
\ No newline at end of file
index 546ff8e..6165e45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bc0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3bc0,0xec));var _0x03bc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x3bc0[_0xe73080];return _0x12cbc4;};'use strict';var EventEmitter=require(_0x03bc('0x0'));var ChatInternalMessage=require(_0x03bc('0x1'))['db'][_0x03bc('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x03bc('0x3')](0x0);var events={'afterCreate':_0x03bc('0x4'),'afterUpdate':_0x03bc('0x5'),'afterDestroy':_0x03bc('0x6')};function emitEvent(_0x4a7840){return function(_0x59a8a0,_0x2caa44,_0x4668d3){ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840+':'+_0x59a8a0['id'],_0x59a8a0);ChatInternalMessageEvents[_0x03bc('0x7')](_0x4a7840,_0x59a8a0);_0x4668d3(null);};}for(var e in events){if(events[_0x03bc('0x8')](e)){var event=events[e];ChatInternalMessage[_0x03bc('0x9')](e,emitEvent(event));}}module[_0x03bc('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xe1fc=['emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0x224aab,_0x5732d6){var _0x33a66b=function(_0x511a23){while(--_0x511a23){_0x224aab['push'](_0x224aab['shift']());}};_0x33a66b(++_0x5732d6);}(_0xe1fc,0x1e3));var _0xce1f=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0xe1fc[_0xf34b0a];return _0x5021e1;};'use strict';var EventEmitter=require(_0xce1f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xce1f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xce1f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xce1f('0x3'),'afterDestroy':_0xce1f('0x4')};function emitEvent(_0x476894){return function(_0x50c42d,_0x467c43,_0x3363e7){ChatInternalMessageEvents[_0xce1f('0x5')](_0x476894+':'+_0x50c42d['id'],_0x50c42d);ChatInternalMessageEvents[_0xce1f('0x5')](_0x476894,_0x50c42d);_0x3363e7(null);};}for(var e in events){if(events[_0xce1f('0x6')](e)){var event=events[e];ChatInternalMessage[_0xce1f('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index b0ec637..2e85dfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa85b=['exports','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./chatInternalMessage.attributes'];(function(_0x19708b,_0xe342c1){var _0xebb783=function(_0x1fa024){while(--_0x1fa024){_0x19708b['push'](_0x19708b['shift']());}};_0xebb783(++_0xe342c1);}(_0xa85b,0x1ce));var _0xba85=function(_0x5da099,_0x4c0874){_0x5da099=_0x5da099-0x0;var _0x2336db=_0xa85b[_0x5da099];return _0x2336db;};'use strict';var _=require(_0xba85('0x0'));var util=require('util');var logger=require(_0xba85('0x1'))(_0xba85('0x2'));var moment=require(_0xba85('0x3'));var BPromise=require('bluebird');var rp=require(_0xba85('0x4'));var fs=require('fs');var path=require(_0xba85('0x5'));var rimraf=require(_0xba85('0x6'));var config=require('../../config/environment');var attributes=require(_0xba85('0x7'));module[_0xba85('0x8')]=function(_0x5e0bf5,_0x3fb318){return _0x5e0bf5['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba85('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe954=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe954,0x94));var _0x4e95=function(_0x166975,_0x162e81){_0x166975=_0x166975-0x0;var _0x589681=_0xe954[_0x166975];return _0x589681;};'use strict';var _=require(_0x4e95('0x0'));var util=require('util');var logger=require(_0x4e95('0x1'))(_0x4e95('0x2'));var moment=require('moment');var BPromise=require(_0x4e95('0x3'));var rp=require(_0x4e95('0x4'));var fs=require('fs');var path=require(_0x4e95('0x5'));var rimraf=require('rimraf');var config=require(_0x4e95('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x4e95('0x7')]=function(_0x344e35,_0x497d8f){return _0x344e35['define'](_0x4e95('0x8'),attributes,{'tableName':_0x4e95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e95('0xa'),'collate':_0x4e95('0xb')});};
\ No newline at end of file
index 85cf001..1150e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fac=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x223394,_0x2a99ca){var _0x2eb43b=function(_0xfddc3d){while(--_0xfddc3d){_0x223394['push'](_0x223394['shift']());}};_0x2eb43b(++_0x2a99ca);}(_0x7fac,0x137));var _0xc7fa=function(_0x49d19d,_0x245cf5){_0x49d19d=_0x49d19d-0x0;var _0x4ebef1=_0x7fac[_0x49d19d];return _0x4ebef1;};'use strict';var _=require(_0xc7fa('0x0'));var util=require('util');var moment=require(_0xc7fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7fa('0x2'));var fs=require('fs');var Redis=require(_0xc7fa('0x3'));var db=require(_0xc7fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc7fa('0x5'))(_0xc7fa('0x6'));var config=require(_0xc7fa('0x7'));var jayson=require(_0xc7fa('0x8'));var client=jayson[_0xc7fa('0x9')][_0xc7fa('0xa')]({'port':0x232a});config[_0xc7fa('0xb')]=_[_0xc7fa('0xc')](config[_0xc7fa('0xb')],{'host':_0xc7fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7fa('0xb')]));require(_0xc7fa('0xe'))[_0xc7fa('0xf')](socket);function respondWithRpcPromise(_0x30aa72,_0x58b60a,_0x40ad16){return new BPromise(function(_0x8c070c,_0x882892){return client[_0xc7fa('0x10')](_0x30aa72,_0x40ad16)[_0xc7fa('0x11')](function(_0x1e78a2){logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));logger['debug'](_0xc7fa('0x15'),_0x58b60a,_0xc7fa('0x14'),JSON[_0xc7fa('0x16')](_0x1e78a2));if(_0x1e78a2[_0xc7fa('0x17')]){if(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x18')]===0x1f4){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);return _0x882892(_0x1e78a2[_0xc7fa('0x17')][_0xc7fa('0x19')]);}logger[_0xc7fa('0x17')](_0xc7fa('0x13'),_0x58b60a,_0x1e78a2['error'][_0xc7fa('0x19')]);return _0x8c070c(_0x1e78a2['error'][_0xc7fa('0x19')]);}else{logger[_0xc7fa('0x12')](_0xc7fa('0x13'),_0x58b60a,_0xc7fa('0x14'));_0x8c070c(_0x1e78a2['result'][_0xc7fa('0x19')]);}})[_0xc7fa('0x1a')](function(_0x922fa2){logger['error'](_0xc7fa('0x13'),_0x58b60a,_0x922fa2);_0x882892(_0x922fa2);});});}
\ No newline at end of file
+var _0x4b74=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5650d7,_0x51f443){var _0x42431d=function(_0x5262c2){while(--_0x5262c2){_0x5650d7['push'](_0x5650d7['shift']());}};_0x42431d(++_0x51f443);}(_0x4b74,0x111));var _0x44b7=function(_0x48abe7,_0x4f83b9){_0x48abe7=_0x48abe7-0x0;var _0x3eda96=_0x4b74[_0x48abe7];return _0x3eda96;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var moment=require(_0x44b7('0x2'));var BPromise=require(_0x44b7('0x3'));var rs=require(_0x44b7('0x4'));var fs=require('fs');var Redis=require(_0x44b7('0x5'));var db=require(_0x44b7('0x6'))['db'];var utils=require(_0x44b7('0x7'));var logger=require(_0x44b7('0x8'))(_0x44b7('0x9'));var config=require(_0x44b7('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x44b7('0xb')]({'port':0x232a});config[_0x44b7('0xc')]=_[_0x44b7('0xd')](config[_0x44b7('0xc')],{'host':_0x44b7('0xe'),'port':0x18eb});var socket=require(_0x44b7('0xf'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xfd8b39,_0x2efe8a,_0x1063b2){return new BPromise(function(_0x862d64,_0x4bc7e6){return client['request'](_0xfd8b39,_0x1063b2)[_0x44b7('0x10')](function(_0x2919b1){logger[_0x44b7('0x11')](_0x44b7('0x12'),_0x2efe8a,_0x44b7('0x13'));logger['debug'](_0x44b7('0x14'),_0x2efe8a,_0x44b7('0x13'),JSON[_0x44b7('0x15')](_0x2919b1));if(_0x2919b1['error']){if(_0x2919b1[_0x44b7('0x16')][_0x44b7('0x17')]===0x1f4){logger[_0x44b7('0x16')](_0x44b7('0x12'),_0x2efe8a,_0x2919b1[_0x44b7('0x16')]['message']);return _0x4bc7e6(_0x2919b1['error'][_0x44b7('0x18')]);}logger[_0x44b7('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x2efe8a,_0x2919b1[_0x44b7('0x16')][_0x44b7('0x18')]);return _0x862d64(_0x2919b1['error'][_0x44b7('0x18')]);}else{logger[_0x44b7('0x11')](_0x44b7('0x12'),_0x2efe8a,_0x44b7('0x13'));_0x862d64(_0x2919b1[_0x44b7('0x19')][_0x44b7('0x18')]);}})[_0x44b7('0x1a')](function(_0x27df9){logger[_0x44b7('0x16')](_0x44b7('0x12'),_0x2efe8a,_0x27df9);_0x4bc7e6(_0x27df9);});});}
\ No newline at end of file
index 2406ad2..f27e6dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534c=['chatInternalMessage:','./chatInternalMessage.events','save','remove','emit','length'];(function(_0x15c80a,_0xa0a750){var _0x153e1f=function(_0x15dca1){while(--_0x15dca1){_0x15c80a['push'](_0x15c80a['shift']());}};_0x153e1f(++_0xa0a750);}(_0x534c,0xfd));var _0xc534=function(_0xfe3bae,_0x5d97fa){_0xfe3bae=_0xfe3bae-0x0;var _0x5c3f54=_0x534c[_0xfe3bae];return _0x5c3f54;};'use strict';var ChatInternalMessageEvents=require(_0xc534('0x0'));var events=[_0xc534('0x1'),_0xc534('0x2'),'update'];function createListener(_0x10b2b5,_0x598e66){return function(_0x2ef186){_0x598e66[_0xc534('0x3')](_0x10b2b5,_0x2ef186);};}function removeListener(_0x5ad847,_0x5cd356){return function(){ChatInternalMessageEvents['removeListener'](_0x5ad847,_0x5cd356);};}exports['register']=function(_0x3a9138){for(var _0x456655=0x0,_0x78c61e=events[_0xc534('0x4')];_0x456655<_0x78c61e;_0x456655++){var _0x309685=events[_0x456655];var _0x467fd7=createListener(_0xc534('0x5')+_0x309685,_0x3a9138);ChatInternalMessageEvents['on'](_0x309685,_0x467fd7);}};
\ No newline at end of file
+var _0xbc01=['length','save','remove','update','removeListener','register'];(function(_0x411a65,_0x35f910){var _0x2e4c73=function(_0x3282d4){while(--_0x3282d4){_0x411a65['push'](_0x411a65['shift']());}};_0x2e4c73(++_0x35f910);}(_0xbc01,0x109));var _0x1bc0=function(_0xfb249,_0x35aa76){_0xfb249=_0xfb249-0x0;var _0x1d839f=_0xbc01[_0xfb249];return _0x1d839f;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x1bc0('0x0'),_0x1bc0('0x1'),_0x1bc0('0x2')];function createListener(_0x2dd017,_0x4fba92){return function(_0x55756a){_0x4fba92['emit'](_0x2dd017,_0x55756a);};}function removeListener(_0x3c5c6c,_0x1aa975){return function(){ChatInternalMessageEvents[_0x1bc0('0x3')](_0x3c5c6c,_0x1aa975);};}exports[_0x1bc0('0x4')]=function(_0x19a366){for(var _0x12f213=0x0,_0x51008e=events[_0x1bc0('0x5')];_0x12f213<_0x51008e;_0x12f213++){var _0x454761=events[_0x12f213];var _0x192091=createListener('chatInternalMessage:'+_0x454761,_0x19a366);ChatInternalMessageEvents['on'](_0x454761,_0x192091);}};
\ No newline at end of file
index 17da2ec..8d863d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf197=['path','Router','../../config/environment','isAuthenticated','index','get','/describe','describe','getUsers','show','post','put','update','delete','/:id','exports','multer','util'];(function(_0x4cf8a9,_0xb488cf){var _0x3528e2=function(_0x4c065d){while(--_0x4c065d){_0x4cf8a9['push'](_0x4cf8a9['shift']());}};_0x3528e2(++_0xb488cf);}(_0xf197,0x130));var _0x7f19=function(_0x442435,_0x57c938){_0x442435=_0x442435-0x0;var _0x459823=_0xf197[_0x442435];return _0x459823;};'use strict';var multer=require(_0x7f19('0x0'));var util=require(_0x7f19('0x1'));var path=require(_0x7f19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7f19('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f19('0x4'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0x7f19('0x5')](),controller[_0x7f19('0x6')]);router[_0x7f19('0x7')](_0x7f19('0x8'),auth[_0x7f19('0x5')](),controller[_0x7f19('0x9')]);router[_0x7f19('0x7')]('/users',auth[_0x7f19('0x5')](),controller[_0x7f19('0xa')]);router[_0x7f19('0x7')]('/:id',auth[_0x7f19('0x5')](),controller[_0x7f19('0xb')]);router[_0x7f19('0xc')]('/',auth[_0x7f19('0x5')](),controller['create']);router[_0x7f19('0xd')]('/:id',controller[_0x7f19('0xe')]);router[_0x7f19('0xf')](_0x7f19('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x7f19('0x11')]=router;
\ No newline at end of file
+var _0xf855=['post','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','isAuthenticated','describe','/users','getUsers','show'];(function(_0x2c22a9,_0x2d62e1){var _0x4626c6=function(_0x13ab58){while(--_0x13ab58){_0x2c22a9['push'](_0x2c22a9['shift']());}};_0x4626c6(++_0x2d62e1);}(_0xf855,0x147));var _0x5f85=function(_0xd5bd7f,_0x893218){_0xd5bd7f=_0xd5bd7f-0x0;var _0x373327=_0xf855[_0xd5bd7f];return _0x373327;};'use strict';var multer=require(_0x5f85('0x0'));var util=require(_0x5f85('0x1'));var path=require(_0x5f85('0x2'));var timeout=require(_0x5f85('0x3'));var express=require(_0x5f85('0x4'));var router=express['Router']();var fs_extra=require(_0x5f85('0x5'));var auth=require(_0x5f85('0x6'));var interaction=require(_0x5f85('0x7'));var config=require(_0x5f85('0x8'));var controller=require(_0x5f85('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5f85('0xa')]);router[_0x5f85('0xb')](_0x5f85('0xc'),auth[_0x5f85('0xd')](),controller[_0x5f85('0xe')]);router[_0x5f85('0xb')](_0x5f85('0xf'),auth[_0x5f85('0xd')](),controller[_0x5f85('0x10')]);router['get']('/:id',auth[_0x5f85('0xd')](),controller[_0x5f85('0x11')]);router[_0x5f85('0x12')]('/',auth[_0x5f85('0xd')](),controller['create']);router[_0x5f85('0x13')](_0x5f85('0x14'),controller['update']);router['delete']('/:id',auth[_0x5f85('0xd')](),controller[_0x5f85('0x15')]);module[_0x5f85('0x16')]=router;
\ No newline at end of file
index 4e5c2e1..10a332a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc3=['out','DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0x1cc3,0x11b));var _0x31cc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1cc3[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x31cc('0x0'));module[_0x31cc('0x1')]={'body':{'type':Sequelize['TEXT'](_0x31cc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x31cc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x31cc('0x4')]('in',_0x31cc('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x31cc('0x6')]},'providerName':{'type':Sequelize[_0x31cc('0x7')]},'providerResponse':{'type':Sequelize[_0x31cc('0x8')]}};
\ No newline at end of file
+var _0x6a95=['ENUM','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x163eb2,_0x14555c){var _0xbb4049=function(_0xb411c9){while(--_0xb411c9){_0x163eb2['push'](_0x163eb2['shift']());}};_0xbb4049(++_0x14555c);}(_0x6a95,0x1db));var _0x56a9=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x6a95[_0x934425];return _0x31d596;};'use strict';var Sequelize=require(_0x56a9('0x0'));module[_0x56a9('0x1')]={'body':{'type':Sequelize[_0x56a9('0x2')](_0x56a9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x56a9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x56a9('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x56a9('0x6')]},'providerName':{'type':Sequelize[_0x56a9('0x7')]},'providerResponse':{'type':Sequelize[_0x56a9('0x2')]}};
\ No newline at end of file
index 4bcf98a..42da3b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc73e=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','find','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','fullname','internal','interface','motionChannel','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','stack','name','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','rows','params','create','body','destroy','describe','chat-interactions','accept','read','format'];(function(_0x59fc33,_0x2e182d){var _0x39066f=function(_0x4d843d){while(--_0x4d843d){_0x59fc33['push'](_0x59fc33['shift']());}};_0x39066f(++_0x2e182d);}(_0xc73e,0xaf));var _0xec73=function(_0x55b351,_0x1bb062){_0x55b351=_0x55b351-0x0;var _0x3f684f=_0xc73e[_0x55b351];return _0x3f684f;};'use strict';var emlformat=require(_0xec73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec73('0x1'));var jsonpatch=require(_0xec73('0x2'));var rp=require(_0xec73('0x3'));var moment=require(_0xec73('0x4'));var BPromise=require(_0xec73('0x5'));var Mustache=require(_0xec73('0x6'));var util=require(_0xec73('0x7'));var path=require(_0xec73('0x8'));var sox=require(_0xec73('0x9'));var csv=require(_0xec73('0xa'));var ejs=require(_0xec73('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec73('0xc'));var squel=require(_0xec73('0xd'));var crypto=require('crypto');var jsforce=require(_0xec73('0xe'));var deskjs=require(_0xec73('0xf'));var toCsv=require(_0xec73('0xa'));var querystring=require(_0xec73('0x10'));var Papa=require('papaparse');var Redis=require(_0xec73('0x11'));var authService=require(_0xec73('0x12'));var qs=require(_0xec73('0x13'));var as=require(_0xec73('0x14'));var hardwareService=require(_0xec73('0x15'));var logger=require(_0xec73('0x16'))(_0xec73('0x17'));var utils=require(_0xec73('0x18'));var config=require(_0xec73('0x19'));var licenseUtil=require(_0xec73('0x1a'));var db=require(_0xec73('0x1b'))['db'];config[_0xec73('0x1c')]=_[_0xec73('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xec73('0x1e'))(new Redis(config['redis']));require('./chatMessage.socket')[_0xec73('0x1f')](socket);var jayson=require(_0xec73('0x20'));var client=jayson['client'][_0xec73('0x21')]({'port':0x232c});var client9002=jayson[_0xec73('0x22')][_0xec73('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3311fa,_0x2e8afc,_0x5e09a4,_0x47eaf9){return new BPromise(function(_0x15dedc,_0x1ec343){var _0xf4a610=_0x47eaf9||client;return _0xf4a610['request'](_0x3311fa,_0x5e09a4)[_0xec73('0x23')](function(_0x24223c){logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2e8afc,_0xec73('0x26'),JSON['stringify'](_0x24223c));if(_0x24223c['error']){if(_0x24223c[_0xec73('0x27')]['code']===0x1f4){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x1ec343(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x24223c['error'][_0xec73('0x28')]);return _0x15dedc(_0x24223c[_0xec73('0x27')][_0xec73('0x28')]);}else{logger[_0xec73('0x24')](_0xec73('0x25'),_0x2e8afc,_0xec73('0x26'));_0x15dedc(_0x24223c[_0xec73('0x29')][_0xec73('0x28')]);}})[_0xec73('0x2a')](function(_0x4ada95){logger[_0xec73('0x27')](_0xec73('0x25'),_0x2e8afc,_0x4ada95);_0x1ec343(_0x4ada95);});});}function respondWithStatusCode(_0x4ea73e,_0x580114){_0x580114=_0x580114||0xcc;return function(_0x4eb256){if(_0x4eb256){return _0x4ea73e[_0xec73('0x2b')](_0x580114);}return _0x4ea73e['status'](_0x580114)[_0xec73('0x2c')]();};}function respondWithResult(_0x50b9df,_0x2e427b){_0x2e427b=_0x2e427b||0xc8;return function(_0x5c73cc){if(_0x5c73cc){return _0x50b9df[_0xec73('0x2d')](_0x2e427b)[_0xec73('0x2e')](_0x5c73cc);}};}function respondWithFilteredResult(_0x1a6b16,_0x63aa){return function(_0x3eaf78){if(_0x3eaf78){var _0x21e957=typeof _0x63aa[_0xec73('0x2f')]===_0xec73('0x30')&&typeof _0x63aa[_0xec73('0x31')]===_0xec73('0x30');var _0x19ff12=_0x3eaf78[_0xec73('0x32')];var _0x474efc=_0x21e957?0x0:_0x63aa[_0xec73('0x2f')];var _0x10d863=_0x21e957?_0x3eaf78[_0xec73('0x32')]:_0x63aa[_0xec73('0x2f')]+_0x63aa[_0xec73('0x31')];var _0x31f287;if(_0x10d863>=_0x19ff12){_0x10d863=_0x19ff12;_0x31f287=0xc8;}else{_0x31f287=0xce;}_0x1a6b16[_0xec73('0x2d')](_0x31f287);return _0x1a6b16[_0xec73('0x33')](_0xec73('0x34'),_0x474efc+'-'+_0x10d863+'/'+_0x19ff12)['json'](_0x3eaf78);}return null;};}function patchUpdates(_0x607075){return function(_0x3cf268){try{jsonpatch[_0xec73('0x35')](_0x3cf268,_0x607075,!![]);}catch(_0x3b042b){return BPromise['reject'](_0x3b042b);}return _0x3cf268[_0xec73('0x36')]();};}function saveUpdates(_0x1ad54b,_0x2acc15){return function(_0x4699a0){if(_0x4699a0){return _0x4699a0[_0xec73('0x37')](_0x1ad54b)[_0xec73('0x23')](function(_0x6944b1){return _0x6944b1;});}return null;};}function removeEntity(_0x4cfa86,_0x334c44){return function(_0x397334){if(_0x397334){return _0x397334['destroy']()[_0xec73('0x23')](function(){_0x4cfa86[_0xec73('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a11a8,_0x133772){return function(_0x3494aa){if(!_0x3494aa){_0x4a11a8['sendStatus'](0x194);}return _0x3494aa;};}function handleError(_0x208055,_0x169865){_0x169865=_0x169865||0x1f4;return function(_0x1b3302){logger['error'](_0x1b3302[_0xec73('0x38')]);if(_0x1b3302['name']){delete _0x1b3302[_0xec73('0x39')];}_0x208055[_0xec73('0x2d')](_0x169865)['send'](_0x1b3302);};}exports[_0xec73('0x3a')]=function(_0x1a3a67,_0x527758){var _0x889c14={},_0x59b3d9={},_0x438a3f={'count':0x0,'rows':[]};var _0x58d3f0=_[_0xec73('0x3b')](db[_0xec73('0x3c')][_0xec73('0x3d')],function(_0x351044){return{'name':_0x351044[_0xec73('0x3e')],'type':_0x351044[_0xec73('0x3f')][_0xec73('0x40')]};});_0x59b3d9[_0xec73('0x41')]=_[_0xec73('0x3b')](_0x58d3f0,_0xec73('0x39'));_0x59b3d9[_0xec73('0x42')]=_[_0xec73('0x43')](_0x1a3a67[_0xec73('0x42')]);_0x59b3d9['filters']=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],_0x59b3d9['query']);_0x889c14[_0xec73('0x45')]=_[_0xec73('0x44')](_0x59b3d9[_0xec73('0x41')],qs['fields'](_0x1a3a67['query']['fields']));_0x889c14['attributes']=_0x889c14[_0xec73('0x45')][_0xec73('0x46')]?_0x889c14[_0xec73('0x45')]:_0x59b3d9[_0xec73('0x41')];if(!_0x1a3a67[_0xec73('0x42')]['hasOwnProperty'](_0xec73('0x47'))){_0x889c14[_0xec73('0x31')]=qs[_0xec73('0x31')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x31')]);_0x889c14[_0xec73('0x2f')]=qs[_0xec73('0x2f')](_0x1a3a67[_0xec73('0x42')][_0xec73('0x2f')]);}_0x889c14['order']=qs[_0xec73('0x48')](_0x1a3a67['query'][_0xec73('0x48')]);_0x889c14['where']=qs[_0xec73('0x49')](_[_0xec73('0x4a')](_0x1a3a67[_0xec73('0x42')],_0x59b3d9['filters']),_0x58d3f0);if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]){_0x889c14[_0xec73('0x4c')]=_[_0xec73('0x4d')](_0x889c14['where'],{'$or':_[_0xec73('0x3b')](_0x58d3f0,function(_0x30d90c){if(_0x30d90c[_0xec73('0x3f')]!=='VIRTUAL'){var _0x31790a={};_0x31790a[_0x30d90c[_0xec73('0x39')]]={'$like':'%'+_0x1a3a67[_0xec73('0x42')][_0xec73('0x4b')]+'%'};return _0x31790a;}})});}_0x889c14=_[_0xec73('0x4d')]({},_0x889c14,_0x1a3a67[_0xec73('0x4e')]);var _0x26e6a7={'where':_0x889c14[_0xec73('0x4c')]};return db[_0xec73('0x3c')][_0xec73('0x32')](_0x26e6a7)[_0xec73('0x23')](function(_0x37a835){_0x438a3f[_0xec73('0x32')]=_0x37a835;if(_0x1a3a67[_0xec73('0x42')][_0xec73('0x4f')]){_0x889c14[_0xec73('0x50')]=[{'all':!![]}];}return db[_0xec73('0x3c')]['findAll'](_0x889c14);})[_0xec73('0x23')](function(_0x19321d){_0x438a3f[_0xec73('0x51')]=_0x19321d;return _0x438a3f;})[_0xec73('0x23')](respondWithFilteredResult(_0x527758,_0x889c14))[_0xec73('0x2a')](handleError(_0x527758,null));};exports['show']=function(_0x4bca59,_0x4a9cd5){var _0x1ed829={'raw':!![],'where':{'id':_0x4bca59[_0xec73('0x52')]['id']}},_0x2266f6={};_0x2266f6[_0xec73('0x41')]=_[_0xec73('0x43')](db[_0xec73('0x3c')][_0xec73('0x3d')]);_0x2266f6['query']=_[_0xec73('0x43')](_0x4bca59[_0xec73('0x42')]);_0x2266f6[_0xec73('0x49')]=_[_0xec73('0x44')](_0x2266f6[_0xec73('0x41')],_0x2266f6[_0xec73('0x42')]);_0x1ed829[_0xec73('0x45')]=_['intersection'](_0x2266f6[_0xec73('0x41')],qs['fields'](_0x4bca59[_0xec73('0x42')]['fields']));_0x1ed829[_0xec73('0x45')]=_0x1ed829[_0xec73('0x45')][_0xec73('0x46')]?_0x1ed829['attributes']:_0x2266f6[_0xec73('0x41')];if(_0x4bca59[_0xec73('0x42')][_0xec73('0x4f')]){_0x1ed829[_0xec73('0x50')]=[{'all':!![]}];}_0x1ed829=_[_0xec73('0x4d')]({},_0x1ed829,_0x4bca59[_0xec73('0x4e')]);return db['ChatMessage']['find'](_0x1ed829)['then'](handleEntityNotFound(_0x4a9cd5,null))[_0xec73('0x23')](respondWithResult(_0x4a9cd5,null))[_0xec73('0x2a')](handleError(_0x4a9cd5,null));};exports[_0xec73('0x53')]=function(_0x8922cf,_0x5bb3c8){return db[_0xec73('0x3c')]['create'](_0x8922cf[_0xec73('0x54')],{})[_0xec73('0x23')](respondWithResult(_0x5bb3c8,0xc9))[_0xec73('0x2a')](handleError(_0x5bb3c8,null));};exports[_0xec73('0x37')]=function(_0xf335dd,_0x371061){if(_0xf335dd[_0xec73('0x54')]['id']){delete _0xf335dd[_0xec73('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0xf335dd[_0xec73('0x52')]['id']}})['then'](handleEntityNotFound(_0x371061,null))[_0xec73('0x23')](saveUpdates(_0xf335dd[_0xec73('0x54')],null))[_0xec73('0x23')](respondWithResult(_0x371061,null))[_0xec73('0x2a')](handleError(_0x371061,null));};exports[_0xec73('0x55')]=function(_0x1d40d3,_0x229e28){return db[_0xec73('0x3c')]['find']({'where':{'id':_0x1d40d3['params']['id']}})['then'](handleEntityNotFound(_0x229e28,null))['then'](removeEntity(_0x229e28,null))[_0xec73('0x2a')](handleError(_0x229e28,null));};exports[_0xec73('0x56')]=function(_0x594163,_0x443b39){return db[_0xec73('0x3c')][_0xec73('0x56')]()[_0xec73('0x23')](respondWithResult(_0x443b39,null))[_0xec73('0x2a')](handleError(_0x443b39,null));};var interaction_log=require(_0xec73('0x16'))(_0xec73('0x57'));exports[_0xec73('0x58')]=function(_0x438c27,_0x496e57,_0x2e1295){var _0x3168bd={'agent':{},'channel':'chat'};if(_0x438c27[_0xec73('0x54')]['id']){delete _0x438c27['body']['id'];}_0x438c27[_0xec73('0x54')][_0xec73('0x59')]=!![];_0x438c27[_0xec73('0x54')]['readAt']=moment()[_0xec73('0x5a')](_0xec73('0x5b'));_0x438c27['body'][_0xec73('0x5c')]=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')]||_0x438c27[_0xec73('0x5d')]['id'];_0x3168bd[_0xec73('0x5e')]['id']=_0x438c27[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')]['find']({'where':{'id':_0x438c27['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x496e57,null))[_0xec73('0x23')](saveUpdates(_0x438c27[_0xec73('0x54')],null))[_0xec73('0x23')](function(_0x154054){if(_0x154054){_0x3168bd['message']=_0x154054[_0xec73('0x5f')]({'plain':!![]});return db[_0xec73('0x60')]['find']({'where':{'id':_0x154054[_0xec73('0x61')]}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x496e57,null))['then'](function(_0x419603){if(_0x419603){return _0x419603['update']({'UserId':_0x438c27[_0xec73('0x54')]['UserId'],'read1stAt':_[_0xec73('0x62')](_0x419603['read1stAt'])?moment()[_0xec73('0x5a')](_0xec73('0x5b')):undefined});}return null;})[_0xec73('0x23')](function(_0x1cb479){if(_0x1cb479){_0x3168bd[_0xec73('0x63')]=_0x1cb479[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x64'),_0x438c27['user']['id'],_0x438c27[_0xec73('0x5d')][_0xec73('0x39')],_0x438c27[_0xec73('0x5d')][_0xec73('0x65')],_0x3168bd['interaction']['id'],_0x438c27[_0xec73('0x54')]?JSON[_0xec73('0x66')](_0x438c27[_0xec73('0x54')]):_0xec73('0x67'));return respondWithRpcPromise(_0xec73('0x68'),_0xec73('0x69'),_0x3168bd);}return null;})[_0xec73('0x23')](function(_0x262a34){var _0x2f3527=_0xec73('0x6a')+_0x262a34['message']['ContactId'];return db[_0xec73('0x6b')][_0xec73('0x42')](_0x2f3527,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')][_0xec73('0x6e')],'raw':!![]})['then'](function(_0x305898){return _0x305898;});})['then'](function(_0x437ac4){if(_0x437ac4){_0x3168bd[_0xec73('0x28')][_0xec73('0x6f')]=_0x437ac4[0x0];if(!_0x438c27[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x438c27[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id','name','fullname',_0xec73('0x72'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4fa439){if(!_0x4fa439)return null;_0x3168bd[_0xec73('0x28')]['agent']=_0x4fa439;return _0x3168bd;})[_0xec73('0x23')](function(_0x5070e9){if(_0x5070e9){if(_0x438c27['body'][_0xec73('0x73')]){_0x3168bd[_0xec73('0x28')]['interface']=util[_0xec73('0x5a')](_0xec73('0x74'),_0x438c27[_0xec73('0x5d')][_0xec73('0x39')]);_0x3168bd[_0xec73('0x28')][_0xec73('0x75')]=_0x3168bd[_0xec73('0x75')];_0x3168bd[_0xec73('0x28')]['motionChannel']=_0x3168bd[_0xec73('0x75')];_0x3168bd['message'][_0xec73('0x76')]=_0xec73('0x58');return respondWithRpcPromise('EventManager',_0xec73('0x77'),{'event':_0xec73('0x78'),'message':_['merge'](_0x3168bd[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3168bd[_0xec73('0x63')][_0xec73('0x7a')]))},client9002)[_0xec73('0x23')](function(){return _0x3168bd;});}return _0x3168bd;}return null;})[_0xec73('0x23')](respondWithResult(_0x496e57,null))['catch'](handleError(_0x496e57,null));};var interaction_log=require(_0xec73('0x16'))('chat-interactions');exports[_0xec73('0x7b')]=function(_0x25c0a5,_0x34901a,_0x89984c){var _0x3ca2d3={'agent':{},'channel':_0xec73('0x7c')};if(_0x25c0a5['body']['id']){delete _0x25c0a5['body']['id'];}_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')]=_0x25c0a5['body'][_0xec73('0x5c')]||_0x25c0a5[_0xec73('0x5d')]['id'];_0x3ca2d3[_0xec73('0x5e')]['id']=_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')];return db[_0xec73('0x3c')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x52')]['id'],'UserId':null}})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x4b1d0c){if(_0x4b1d0c){_0x3ca2d3[_0xec73('0x28')]=_0x4b1d0c['get']({'plain':!![]});return db[_0xec73('0x60')][_0xec73('0x71')]({'where':{'id':_0x4b1d0c['ChatInteractionId']}});}return null;})[_0xec73('0x23')](handleEntityNotFound(_0x34901a,null))[_0xec73('0x23')](function(_0x488b63){if(_0x488b63){_0x3ca2d3[_0xec73('0x63')]=_0x488b63[_0xec73('0x5f')]({'plain':!![]});interaction_log[_0xec73('0x24')](_0xec73('0x7d'),_0x25c0a5[_0xec73('0x5d')]['id'],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')],_0x25c0a5[_0xec73('0x5d')][_0xec73('0x65')],_0x3ca2d3[_0xec73('0x63')]['id'],_0x25c0a5[_0xec73('0x54')]?JSON['stringify'](_0x25c0a5[_0xec73('0x54')]):'null');return respondWithRpcPromise('RejectMessage',_0xec73('0x7e'),_0x3ca2d3);}return null;})[_0xec73('0x23')](function(_0x1b7e9d){var _0x46c9a7=_0xec73('0x6a')+_0x1b7e9d['message'][_0xec73('0x7f')];return db['sequelize']['query'](_0x46c9a7,{'type':db[_0xec73('0x6c')][_0xec73('0x6d')]['SELECT'],'raw':!![]})['then'](function(_0x5a9d39){return _0x5a9d39;});})[_0xec73('0x23')](function(_0x569b1d){if(_0x569b1d){_0x3ca2d3[_0xec73('0x28')]['contact']=_0x569b1d[0x0];if(!_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')])return;return db[_0xec73('0x70')][_0xec73('0x71')]({'where':{'id':_0x25c0a5[_0xec73('0x54')][_0xec73('0x5c')],'role':_0xec73('0x5e')},'attributes':['id',_0xec73('0x39'),_0xec73('0x80'),_0xec73('0x72'),_0xec73('0x81')],'raw':!![]});}return null;})[_0xec73('0x23')](function(_0x50f9cc){if(!_0x50f9cc)return null;_0x3ca2d3['message'][_0xec73('0x5e')]=_0x50f9cc;return _0x3ca2d3;})[_0xec73('0x23')](function(_0x45e3e0){if(_0x45e3e0){_0x45e3e0[_0xec73('0x28')][_0xec73('0x82')]=util['format'](_0xec73('0x74'),_0x25c0a5[_0xec73('0x5d')][_0xec73('0x39')]);_0x45e3e0[_0xec73('0x28')][_0xec73('0x75')]=_0x3ca2d3['channel'];_0x45e3e0[_0xec73('0x28')][_0xec73('0x83')]=_0x3ca2d3[_0xec73('0x75')];_0x45e3e0[_0xec73('0x28')][_0xec73('0x76')]=_0xec73('0x7b');respondWithRpcPromise('EventManager','EventManager',{'event':_0xec73('0x84'),'message':_[_0xec73('0x4d')](_0x3ca2d3[_0xec73('0x28')],JSON[_0xec73('0x79')](_0x3ca2d3[_0xec73('0x63')][_0xec73('0x7a')]))},client9002);return _0x3ca2d3;}return null;})[_0xec73('0x23')](respondWithResult(_0x34901a,null))[_0xec73('0x2a')](handleError(_0x34901a,null));};
\ No newline at end of file
+var _0xd17c=['filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','length','create','body','find','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','interface','format','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','SELECT','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','end','stack','name','send','index','ChatMessage','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','nolimit','sort','pick'];(function(_0x456a4b,_0x51df8){var _0x42957c=function(_0x431de8){while(--_0x431de8){_0x456a4b['push'](_0x456a4b['shift']());}};_0x42957c(++_0x51df8);}(_0xd17c,0xb9));var _0xcd17=function(_0x56f58b,_0x54a849){_0x56f58b=_0x56f58b-0x0;var _0x2389ee=_0xd17c[_0x56f58b];return _0x2389ee;};'use strict';var emlformat=require(_0xcd17('0x0'));var rimraf=require(_0xcd17('0x1'));var zipdir=require(_0xcd17('0x2'));var jsonpatch=require(_0xcd17('0x3'));var rp=require('request-promise');var moment=require(_0xcd17('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcd17('0x5'));var path=require(_0xcd17('0x6'));var sox=require('sox');var csv=require(_0xcd17('0x7'));var ejs=require(_0xcd17('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd17('0x9'));var squel=require(_0xcd17('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd17('0x7'));var querystring=require(_0xcd17('0xb'));var Papa=require(_0xcd17('0xc'));var Redis=require(_0xcd17('0xd'));var authService=require(_0xcd17('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcd17('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd17('0x10'))(_0xcd17('0x11'));var utils=require('../../config/utils');var config=require(_0xcd17('0x12'));var licenseUtil=require(_0xcd17('0x13'));var db=require(_0xcd17('0x14'))['db'];config[_0xcd17('0x15')]=_[_0xcd17('0x16')](config[_0xcd17('0x15')],{'host':_0xcd17('0x17'),'port':0x18eb});var socket=require(_0xcd17('0x18'))(new Redis(config[_0xcd17('0x15')]));require(_0xcd17('0x19'))['register'](socket);var jayson=require(_0xcd17('0x1a'));var client=jayson[_0xcd17('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xcd17('0x1b')][_0xcd17('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x11aa90,_0x2f545b,_0x5d7db2,_0x47ec0a){return new BPromise(function(_0x3f28fd,_0x1662e8){var _0x4665b3=_0x47ec0a||client;return _0x4665b3['request'](_0x11aa90,_0x5d7db2)[_0xcd17('0x1d')](function(_0x1d94ef){logger[_0xcd17('0x1e')](_0xcd17('0x1f'),_0x2f545b,_0xcd17('0x20'));logger[_0xcd17('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2f545b,_0xcd17('0x20'),JSON[_0xcd17('0x22')](_0x1d94ef));if(_0x1d94ef[_0xcd17('0x23')]){if(_0x1d94ef[_0xcd17('0x23')]['code']===0x1f4){logger[_0xcd17('0x23')](_0xcd17('0x1f'),_0x2f545b,_0x1d94ef[_0xcd17('0x23')][_0xcd17('0x24')]);return _0x1662e8(_0x1d94ef[_0xcd17('0x23')][_0xcd17('0x24')]);}logger[_0xcd17('0x23')](_0xcd17('0x1f'),_0x2f545b,_0x1d94ef['error']['message']);return _0x3f28fd(_0x1d94ef['error']['message']);}else{logger['info'](_0xcd17('0x1f'),_0x2f545b,_0xcd17('0x20'));_0x3f28fd(_0x1d94ef['result'][_0xcd17('0x24')]);}})['catch'](function(_0x50701d){logger[_0xcd17('0x23')](_0xcd17('0x1f'),_0x2f545b,_0x50701d);_0x1662e8(_0x50701d);});});}function respondWithStatusCode(_0x54b3d9,_0x398a6a){_0x398a6a=_0x398a6a||0xcc;return function(_0x2a09d7){if(_0x2a09d7){return _0x54b3d9[_0xcd17('0x25')](_0x398a6a);}return _0x54b3d9['status'](_0x398a6a)['end']();};}function respondWithResult(_0x3a840a,_0x654e6e){_0x654e6e=_0x654e6e||0xc8;return function(_0x10047c){if(_0x10047c){return _0x3a840a[_0xcd17('0x26')](_0x654e6e)[_0xcd17('0x27')](_0x10047c);}};}function respondWithFilteredResult(_0x219927,_0x126e01){return function(_0x1b1ce8){if(_0x1b1ce8){var _0x4eaaf9=typeof _0x126e01['offset']===_0xcd17('0x28')&&typeof _0x126e01[_0xcd17('0x29')]===_0xcd17('0x28');var _0x3aa743=_0x1b1ce8['count'];var _0x23bb48=_0x4eaaf9?0x0:_0x126e01['offset'];var _0x4dbca8=_0x4eaaf9?_0x1b1ce8[_0xcd17('0x2a')]:_0x126e01[_0xcd17('0x2b')]+_0x126e01['limit'];var _0x1b2fb8;if(_0x4dbca8>=_0x3aa743){_0x4dbca8=_0x3aa743;_0x1b2fb8=0xc8;}else{_0x1b2fb8=0xce;}_0x219927[_0xcd17('0x26')](_0x1b2fb8);return _0x219927[_0xcd17('0x2c')](_0xcd17('0x2d'),_0x23bb48+'-'+_0x4dbca8+'/'+_0x3aa743)[_0xcd17('0x27')](_0x1b1ce8);}return null;};}function patchUpdates(_0x491dee){return function(_0x543ece){try{jsonpatch[_0xcd17('0x2e')](_0x543ece,_0x491dee,!![]);}catch(_0x4a2fa9){return BPromise[_0xcd17('0x2f')](_0x4a2fa9);}return _0x543ece['save']();};}function saveUpdates(_0x52d57d,_0x2218a2){return function(_0x2d446e){if(_0x2d446e){return _0x2d446e['update'](_0x52d57d)[_0xcd17('0x1d')](function(_0x55e4dc){return _0x55e4dc;});}return null;};}function removeEntity(_0x1dd4a0,_0x3fbddd){return function(_0x5f4cb3){if(_0x5f4cb3){return _0x5f4cb3[_0xcd17('0x30')]()[_0xcd17('0x1d')](function(){_0x1dd4a0['status'](0xcc)[_0xcd17('0x31')]();});}};}function handleEntityNotFound(_0x58a106,_0x34e413){return function(_0x8d7ab8){if(!_0x8d7ab8){_0x58a106[_0xcd17('0x25')](0x194);}return _0x8d7ab8;};}function handleError(_0x29225a,_0x2f05d7){_0x2f05d7=_0x2f05d7||0x1f4;return function(_0x302b82){logger[_0xcd17('0x23')](_0x302b82[_0xcd17('0x32')]);if(_0x302b82[_0xcd17('0x33')]){delete _0x302b82[_0xcd17('0x33')];}_0x29225a[_0xcd17('0x26')](_0x2f05d7)[_0xcd17('0x34')](_0x302b82);};}exports[_0xcd17('0x35')]=function(_0x2ecada,_0x172e97){var _0x5973bc={},_0x5b8359={},_0x64429f={'count':0x0,'rows':[]};var _0x57b934=_['map'](db[_0xcd17('0x36')][_0xcd17('0x37')],function(_0x1618a5){return{'name':_0x1618a5[_0xcd17('0x38')],'type':_0x1618a5['type']['key']};});_0x5b8359[_0xcd17('0x39')]=_[_0xcd17('0x3a')](_0x57b934,_0xcd17('0x33'));_0x5b8359['query']=_['keys'](_0x2ecada[_0xcd17('0x3b')]);_0x5b8359[_0xcd17('0x3c')]=_[_0xcd17('0x3d')](_0x5b8359[_0xcd17('0x39')],_0x5b8359['query']);_0x5973bc[_0xcd17('0x3e')]=_[_0xcd17('0x3d')](_0x5b8359[_0xcd17('0x39')],qs['fields'](_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x3f')]));_0x5973bc['attributes']=_0x5973bc[_0xcd17('0x3e')]['length']?_0x5973bc[_0xcd17('0x3e')]:_0x5b8359['model'];if(!_0x2ecada[_0xcd17('0x3b')]['hasOwnProperty'](_0xcd17('0x40'))){_0x5973bc[_0xcd17('0x29')]=qs[_0xcd17('0x29')](_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x29')]);_0x5973bc[_0xcd17('0x2b')]=qs[_0xcd17('0x2b')](_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x2b')]);}_0x5973bc['order']=qs['sort'](_0x2ecada['query'][_0xcd17('0x41')]);_0x5973bc['where']=qs[_0xcd17('0x3c')](_[_0xcd17('0x42')](_0x2ecada[_0xcd17('0x3b')],_0x5b8359[_0xcd17('0x3c')]),_0x57b934);if(_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x43')]){_0x5973bc[_0xcd17('0x44')]=_[_0xcd17('0x45')](_0x5973bc['where'],{'$or':_['map'](_0x57b934,function(_0x5d9188){if(_0x5d9188['type']!==_0xcd17('0x46')){var _0x52ff70={};_0x52ff70[_0x5d9188['name']]={'$like':'%'+_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x43')]+'%'};return _0x52ff70;}})});}_0x5973bc=_['merge']({},_0x5973bc,_0x2ecada[_0xcd17('0x47')]);var _0x3ac4b8={'where':_0x5973bc['where']};return db[_0xcd17('0x36')][_0xcd17('0x2a')](_0x3ac4b8)[_0xcd17('0x1d')](function(_0x158803){_0x64429f[_0xcd17('0x2a')]=_0x158803;if(_0x2ecada[_0xcd17('0x3b')][_0xcd17('0x48')]){_0x5973bc[_0xcd17('0x49')]=[{'all':!![]}];}return db[_0xcd17('0x36')][_0xcd17('0x4a')](_0x5973bc);})['then'](function(_0x40df6b){_0x64429f['rows']=_0x40df6b;return _0x64429f;})[_0xcd17('0x1d')](respondWithFilteredResult(_0x172e97,_0x5973bc))[_0xcd17('0x4b')](handleError(_0x172e97,null));};exports[_0xcd17('0x4c')]=function(_0x2957aa,_0xaa7a56){var _0x1a014f={'raw':!![],'where':{'id':_0x2957aa[_0xcd17('0x4d')]['id']}},_0x3acf64={};_0x3acf64['model']=_[_0xcd17('0x4e')](db[_0xcd17('0x36')]['rawAttributes']);_0x3acf64[_0xcd17('0x3b')]=_['keys'](_0x2957aa[_0xcd17('0x3b')]);_0x3acf64[_0xcd17('0x3c')]=_[_0xcd17('0x3d')](_0x3acf64[_0xcd17('0x39')],_0x3acf64[_0xcd17('0x3b')]);_0x1a014f[_0xcd17('0x3e')]=_[_0xcd17('0x3d')](_0x3acf64['model'],qs[_0xcd17('0x3f')](_0x2957aa['query'][_0xcd17('0x3f')]));_0x1a014f[_0xcd17('0x3e')]=_0x1a014f['attributes'][_0xcd17('0x4f')]?_0x1a014f[_0xcd17('0x3e')]:_0x3acf64[_0xcd17('0x39')];if(_0x2957aa[_0xcd17('0x3b')]['includeAll']){_0x1a014f[_0xcd17('0x49')]=[{'all':!![]}];}_0x1a014f=_[_0xcd17('0x45')]({},_0x1a014f,_0x2957aa[_0xcd17('0x47')]);return db['ChatMessage']['find'](_0x1a014f)[_0xcd17('0x1d')](handleEntityNotFound(_0xaa7a56,null))[_0xcd17('0x1d')](respondWithResult(_0xaa7a56,null))[_0xcd17('0x4b')](handleError(_0xaa7a56,null));};exports[_0xcd17('0x50')]=function(_0x5bcee9,_0x18f634){return db[_0xcd17('0x36')][_0xcd17('0x50')](_0x5bcee9[_0xcd17('0x51')],{})[_0xcd17('0x1d')](respondWithResult(_0x18f634,0xc9))[_0xcd17('0x4b')](handleError(_0x18f634,null));};exports['update']=function(_0x3c639c,_0x2b5690){if(_0x3c639c[_0xcd17('0x51')]['id']){delete _0x3c639c[_0xcd17('0x51')]['id'];}return db[_0xcd17('0x36')][_0xcd17('0x52')]({'where':{'id':_0x3c639c[_0xcd17('0x4d')]['id']}})[_0xcd17('0x1d')](handleEntityNotFound(_0x2b5690,null))[_0xcd17('0x1d')](saveUpdates(_0x3c639c[_0xcd17('0x51')],null))[_0xcd17('0x1d')](respondWithResult(_0x2b5690,null))[_0xcd17('0x4b')](handleError(_0x2b5690,null));};exports['destroy']=function(_0x7ea81e,_0xa3c0e3){return db[_0xcd17('0x36')][_0xcd17('0x52')]({'where':{'id':_0x7ea81e[_0xcd17('0x4d')]['id']}})[_0xcd17('0x1d')](handleEntityNotFound(_0xa3c0e3,null))[_0xcd17('0x1d')](removeEntity(_0xa3c0e3,null))[_0xcd17('0x4b')](handleError(_0xa3c0e3,null));};exports[_0xcd17('0x53')]=function(_0x2c2229,_0x5ed1ca){return db[_0xcd17('0x36')][_0xcd17('0x53')]()[_0xcd17('0x1d')](respondWithResult(_0x5ed1ca,null))[_0xcd17('0x4b')](handleError(_0x5ed1ca,null));};var interaction_log=require(_0xcd17('0x10'))(_0xcd17('0x54'));exports[_0xcd17('0x55')]=function(_0x186504,_0x28b3eb,_0x145e3e){var _0x431d84={'agent':{},'channel':_0xcd17('0x56')};if(_0x186504[_0xcd17('0x51')]['id']){delete _0x186504['body']['id'];}_0x186504[_0xcd17('0x51')][_0xcd17('0x57')]=!![];_0x186504[_0xcd17('0x51')][_0xcd17('0x58')]=moment()['format'](_0xcd17('0x59'));_0x186504[_0xcd17('0x51')][_0xcd17('0x5a')]=_0x186504[_0xcd17('0x51')]['UserId']||_0x186504[_0xcd17('0x5b')]['id'];_0x431d84[_0xcd17('0x5c')]['id']=_0x186504['body'][_0xcd17('0x5a')];return db['ChatMessage']['find']({'where':{'id':_0x186504['params']['id'],'UserId':null}})[_0xcd17('0x1d')](handleEntityNotFound(_0x28b3eb,null))['then'](saveUpdates(_0x186504['body'],null))['then'](function(_0x11da03){if(_0x11da03){_0x431d84[_0xcd17('0x24')]=_0x11da03[_0xcd17('0x5d')]({'plain':!![]});return db[_0xcd17('0x5e')][_0xcd17('0x52')]({'where':{'id':_0x11da03[_0xcd17('0x5f')]}});}return null;})[_0xcd17('0x1d')](handleEntityNotFound(_0x28b3eb,null))['then'](function(_0x147799){if(_0x147799){return _0x147799['update']({'UserId':_0x186504[_0xcd17('0x51')][_0xcd17('0x5a')],'read1stAt':_[_0xcd17('0x60')](_0x147799[_0xcd17('0x61')])?moment()['format'](_0xcd17('0x59')):undefined});}return null;})[_0xcd17('0x1d')](function(_0x2bb6c2){if(_0x2bb6c2){_0x431d84[_0xcd17('0x62')]=_0x2bb6c2[_0xcd17('0x5d')]({'plain':!![]});interaction_log[_0xcd17('0x1e')](_0xcd17('0x63'),_0x186504[_0xcd17('0x5b')]['id'],_0x186504[_0xcd17('0x5b')][_0xcd17('0x33')],_0x186504[_0xcd17('0x5b')]['role'],_0x431d84['interaction']['id'],_0x186504[_0xcd17('0x51')]?JSON['stringify'](_0x186504[_0xcd17('0x51')]):_0xcd17('0x64'));return respondWithRpcPromise('AcceptMessage',_0xcd17('0x65'),_0x431d84);}return null;})[_0xcd17('0x1d')](function(_0x4097b6){var _0x4b2e39=_0xcd17('0x66')+_0x4097b6[_0xcd17('0x24')]['ContactId'];return db[_0xcd17('0x67')][_0xcd17('0x3b')](_0x4b2e39,{'type':db[_0xcd17('0x68')][_0xcd17('0x69')]['SELECT'],'raw':!![]})[_0xcd17('0x1d')](function(_0x2fc532){return _0x2fc532;});})['then'](function(_0x2f01c3){if(_0x2f01c3){_0x431d84['message'][_0xcd17('0x6a')]=_0x2f01c3[0x0];if(!_0x186504[_0xcd17('0x51')]['UserId'])return;return db[_0xcd17('0x6b')]['find']({'where':{'id':_0x186504['body'][_0xcd17('0x5a')],'role':'agent'},'attributes':['id','name',_0xcd17('0x6c'),'email',_0xcd17('0x6d')],'raw':!![]});}return null;})[_0xcd17('0x1d')](function(_0x2f08f2){if(!_0x2f08f2)return null;_0x431d84[_0xcd17('0x24')][_0xcd17('0x5c')]=_0x2f08f2;return _0x431d84;})[_0xcd17('0x1d')](function(_0x47eec4){if(_0x47eec4){if(_0x186504[_0xcd17('0x51')]['manual']){_0x431d84[_0xcd17('0x24')][_0xcd17('0x6e')]=util[_0xcd17('0x6f')]('SIP/%s',_0x186504['user'][_0xcd17('0x33')]);_0x431d84[_0xcd17('0x24')]['channel']=_0x431d84[_0xcd17('0x70')];_0x431d84[_0xcd17('0x24')][_0xcd17('0x71')]=_0x431d84[_0xcd17('0x70')];_0x431d84[_0xcd17('0x24')][_0xcd17('0x72')]=_0xcd17('0x55');return respondWithRpcPromise(_0xcd17('0x73'),_0xcd17('0x73'),{'event':_0xcd17('0x74'),'message':_['merge'](_0x431d84['message'],JSON['parse'](_0x431d84['interaction'][_0xcd17('0x75')]))},client9002)[_0xcd17('0x1d')](function(){return _0x431d84;});}return _0x431d84;}return null;})[_0xcd17('0x1d')](respondWithResult(_0x28b3eb,null))['catch'](handleError(_0x28b3eb,null));};var interaction_log=require('../../config/logger')(_0xcd17('0x54'));exports['reject']=function(_0x811d04,_0xf06fbb,_0x252df7){var _0x3e4a65={'agent':{},'channel':'chat'};if(_0x811d04['body']['id']){delete _0x811d04[_0xcd17('0x51')]['id'];}_0x811d04[_0xcd17('0x51')][_0xcd17('0x5a')]=_0x811d04[_0xcd17('0x51')][_0xcd17('0x5a')]||_0x811d04['user']['id'];_0x3e4a65[_0xcd17('0x5c')]['id']=_0x811d04[_0xcd17('0x51')][_0xcd17('0x5a')];return db['ChatMessage'][_0xcd17('0x52')]({'where':{'id':_0x811d04[_0xcd17('0x4d')]['id'],'UserId':null}})[_0xcd17('0x1d')](handleEntityNotFound(_0xf06fbb,null))[_0xcd17('0x1d')](function(_0x168455){if(_0x168455){_0x3e4a65['message']=_0x168455['get']({'plain':!![]});return db[_0xcd17('0x5e')][_0xcd17('0x52')]({'where':{'id':_0x168455[_0xcd17('0x5f')]}});}return null;})[_0xcd17('0x1d')](handleEntityNotFound(_0xf06fbb,null))[_0xcd17('0x1d')](function(_0x192d80){if(_0x192d80){_0x3e4a65[_0xcd17('0x62')]=_0x192d80[_0xcd17('0x5d')]({'plain':!![]});interaction_log[_0xcd17('0x1e')](_0xcd17('0x76'),_0x811d04[_0xcd17('0x5b')]['id'],_0x811d04['user']['name'],_0x811d04[_0xcd17('0x5b')][_0xcd17('0x77')],_0x3e4a65[_0xcd17('0x62')]['id'],_0x811d04[_0xcd17('0x51')]?JSON[_0xcd17('0x22')](_0x811d04[_0xcd17('0x51')]):_0xcd17('0x64'));return respondWithRpcPromise(_0xcd17('0x78'),_0xcd17('0x79'),_0x3e4a65);}return null;})[_0xcd17('0x1d')](function(_0x517fd8){var _0x574b37=_0xcd17('0x66')+_0x517fd8[_0xcd17('0x24')][_0xcd17('0x7a')];return db[_0xcd17('0x67')]['query'](_0x574b37,{'type':db[_0xcd17('0x68')][_0xcd17('0x69')][_0xcd17('0x7b')],'raw':!![]})[_0xcd17('0x1d')](function(_0x4f7154){return _0x4f7154;});})[_0xcd17('0x1d')](function(_0x5ace17){if(_0x5ace17){_0x3e4a65['message'][_0xcd17('0x6a')]=_0x5ace17[0x0];if(!_0x811d04['body'][_0xcd17('0x5a')])return;return db[_0xcd17('0x6b')][_0xcd17('0x52')]({'where':{'id':_0x811d04[_0xcd17('0x51')][_0xcd17('0x5a')],'role':_0xcd17('0x5c')},'attributes':['id','name',_0xcd17('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0xcd17('0x1d')](function(_0x66f2b8){if(!_0x66f2b8)return null;_0x3e4a65['message'][_0xcd17('0x5c')]=_0x66f2b8;return _0x3e4a65;})[_0xcd17('0x1d')](function(_0x3f83e6){if(_0x3f83e6){_0x3f83e6['message']['interface']=util[_0xcd17('0x6f')]('SIP/%s',_0x811d04[_0xcd17('0x5b')][_0xcd17('0x33')]);_0x3f83e6[_0xcd17('0x24')]['channel']=_0x3e4a65['channel'];_0x3f83e6['message']['motionChannel']=_0x3e4a65[_0xcd17('0x70')];_0x3f83e6[_0xcd17('0x24')][_0xcd17('0x72')]=_0xcd17('0x2f');respondWithRpcPromise(_0xcd17('0x73'),_0xcd17('0x73'),{'event':_0xcd17('0x7c'),'message':_['merge'](_0x3e4a65[_0xcd17('0x24')],JSON[_0xcd17('0x7d')](_0x3e4a65['interaction'][_0xcd17('0x75')]))},client9002);return _0x3e4a65;}return null;})[_0xcd17('0x1d')](respondWithResult(_0xf06fbb,null))['catch'](handleError(_0xf06fbb,null));};
\ No newline at end of file
index debfe73..abc9b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b79=['hasOwnProperty','events','../../mysqldb','ChatMessage','save','update','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3b79,0x112));var _0x93b7=function(_0x7538f2,_0x3f02cb){_0x7538f2=_0x7538f2-0x0;var _0x3e34c0=_0x3b79[_0x7538f2];return _0x3e34c0;};'use strict';var EventEmitter=require(_0x93b7('0x0'));var ChatMessage=require(_0x93b7('0x1'))['db'][_0x93b7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x93b7('0x3'),'afterUpdate':_0x93b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x64dc6a){return function(_0x315c84,_0x300c6b,_0x50b17c){ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a+':'+_0x315c84['id'],_0x315c84);ChatMessageEvents[_0x93b7('0x5')](_0x64dc6a,_0x315c84);_0x50b17c(null);};}for(var e in events){if(events[_0x93b7('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x6edf=['exports','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6edf,0x12a));var _0xf6ed=function(_0x216a61,_0x476d43){_0x216a61=_0x216a61-0x0;var _0x5a5cd4=_0x6edf[_0x216a61];return _0x5a5cd4;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf6ed('0x0'))['db'][_0xf6ed('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf6ed('0x2')](0x0);var events={'afterCreate':_0xf6ed('0x3'),'afterUpdate':'update','afterDestroy':_0xf6ed('0x4')};function emitEvent(_0xb16864){return function(_0x1cf761,_0x11e100,_0x557e83){ChatMessageEvents[_0xf6ed('0x5')](_0xb16864+':'+_0x1cf761['id'],_0x1cf761);ChatMessageEvents[_0xf6ed('0x5')](_0xb16864,_0x1cf761);_0x557e83(null);};}for(var e in events){if(events[_0xf6ed('0x6')](e)){var event=events[e];ChatMessage[_0xf6ed('0x7')](e,emitEvent(event));}}module[_0xf6ed('0x8')]=ChatMessageEvents;
\ No newline at end of file
index f050514..fd2441e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda72=['direction','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','toLowerCase'];(function(_0x161530,_0x2d2f6d){var _0x5d58e6=function(_0x1ef75e){while(--_0x1ef75e){_0x161530['push'](_0x161530['shift']());}};_0x5d58e6(++_0x2d2f6d);}(_0xda72,0x7e));var _0x2da7=function(_0x293b44,_0x47fe5d){_0x293b44=_0x293b44-0x0;var _0x4a42eb=_0xda72[_0x293b44];return _0x4a42eb;};'use strict';var _=require('lodash');var util=require(_0x2da7('0x0'));var logger=require(_0x2da7('0x1'))(_0x2da7('0x2'));var moment=require('moment');var BPromise=require(_0x2da7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2da7('0x4'));var rimraf=require(_0x2da7('0x5'));var config=require(_0x2da7('0x6'));var attributes=require('./chatMessage.attributes');module[_0x2da7('0x7')]=function(_0x1bf00a,_0x5e5adb){return _0x1bf00a['define'](_0x2da7('0x8'),attributes,{'tableName':_0x2da7('0x9'),'paranoid':![],'indexes':[{'name':_0x2da7('0xa'),'fields':['body'],'type':_0x2da7('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d4de7,_0x1e9847,_0x4f56de){var _0x5f12f3=_0x1bf00a['models'];var _0x305f24=_0x4d4de7[_0x2da7('0xc')]({'plain':!![]});if(_0x305f24['direction'][_0x2da7('0xd')]()==='in'||_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()===_0x2da7('0xf')&&!_0x305f24['secret']&&!_[_0x2da7('0x10')](_0x305f24[_0x2da7('0x11')])){_0x5f12f3[_0x2da7('0x12')][_0x2da7('0x13')]({'where':{'id':_0x305f24[_0x2da7('0x14')]}})[_0x2da7('0x15')](function(_0x44b814){if(_0x44b814){_0x44b814[_0x2da7('0x16')]({'lastMsgAt':_0x305f24[_0x2da7('0x17')],'lastMsgDirection':_0x305f24[_0x2da7('0xe')][_0x2da7('0xd')]()});}})[_0x2da7('0x18')](function(_0x4be0a9){console[_0x2da7('0x19')](_0x4be0a9);});}_0x4f56de();}},'charset':_0x2da7('0x1a'),'collate':_0x2da7('0x1b')});};
\ No newline at end of file
+var _0xf9f4=['../../config/logger','api','bluebird','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3cf5c7,_0x1eb319){var _0xf3d981=function(_0x3521ef){while(--_0x3521ef){_0x3cf5c7['push'](_0x3cf5c7['shift']());}};_0xf3d981(++_0x1eb319);}(_0xf9f4,0x1be));var _0x4f9f=function(_0x21a89f,_0x347f0a){_0x21a89f=_0x21a89f-0x0;var _0xef6eb7=_0xf9f4[_0x21a89f];return _0xef6eb7;};'use strict';var _=require(_0x4f9f('0x0'));var util=require(_0x4f9f('0x1'));var logger=require(_0x4f9f('0x2'))(_0x4f9f('0x3'));var moment=require('moment');var BPromise=require(_0x4f9f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f9f('0x5'));var rimraf=require(_0x4f9f('0x6'));var config=require('../../config/environment');var attributes=require(_0x4f9f('0x7'));module[_0x4f9f('0x8')]=function(_0x425bfe,_0x23c05a){return _0x425bfe[_0x4f9f('0x9')](_0x4f9f('0xa'),attributes,{'tableName':_0x4f9f('0xb'),'paranoid':![],'indexes':[{'name':_0x4f9f('0xc'),'fields':['body'],'type':_0x4f9f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37c601,_0x21aac2,_0xbdf24){var _0x2e0e35=_0x425bfe['models'];var _0x2a0013=_0x37c601[_0x4f9f('0xe')]({'plain':!![]});if(_0x2a0013[_0x4f9f('0xf')]['toLowerCase']()==='in'||_0x2a0013[_0x4f9f('0xf')][_0x4f9f('0x10')]()==='out'&&!_0x2a0013[_0x4f9f('0x11')]&&!_['isNil'](_0x2a0013[_0x4f9f('0x12')])){_0x2e0e35[_0x4f9f('0x13')][_0x4f9f('0x14')]({'where':{'id':_0x2a0013[_0x4f9f('0x15')]}})[_0x4f9f('0x16')](function(_0x1382d4){if(_0x1382d4){_0x1382d4['update']({'lastMsgAt':_0x2a0013[_0x4f9f('0x17')],'lastMsgDirection':_0x2a0013[_0x4f9f('0xf')][_0x4f9f('0x10')]()});}})[_0x4f9f('0x18')](function(_0x2541cf){console[_0x4f9f('0x19')](_0x2541cf);});}_0xbdf24();}},'charset':_0x4f9f('0x1a'),'collate':_0x4f9f('0x1b')});};
\ No newline at end of file
index 2c65316..bd0c4fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc52c=['body','options','raw','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','then','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatMessage,\x20%s,\x20%s','message','CreateChatMessage','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc52c,0x144));var _0xcc52=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xc52c[_0xf2662b];return _0x257dc7;};'use strict';var _=require(_0xcc52('0x0'));var util=require(_0xcc52('0x1'));var moment=require(_0xcc52('0x2'));var BPromise=require(_0xcc52('0x3'));var rs=require(_0xcc52('0x4'));var fs=require('fs');var Redis=require(_0xcc52('0x5'));var db=require(_0xcc52('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc52('0x7'));var config=require(_0xcc52('0x8'));var jayson=require(_0xcc52('0x9'));var client=jayson['client'][_0xcc52('0xa')]({'port':0x232a});config[_0xcc52('0xb')]=_[_0xcc52('0xc')](config[_0xcc52('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatMessage.socket')[_0xcc52('0xd')](socket);function respondWithRpcPromise(_0x463999,_0x139154,_0xc44204){return new BPromise(function(_0x38bf62,_0x4242b7){return client['request'](_0x463999,_0xc44204)[_0xcc52('0xe')](function(_0x1af4dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x139154,'request\x20sent');logger[_0xcc52('0xf')](_0xcc52('0x10'),_0x139154,_0xcc52('0x11'),JSON[_0xcc52('0x12')](_0x1af4dd));if(_0x1af4dd[_0xcc52('0x13')]){if(_0x1af4dd['error']['code']===0x1f4){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd[_0xcc52('0x13')][_0xcc52('0x15')]);return _0x4242b7(_0x1af4dd[_0xcc52('0x13')]['message']);}logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x1af4dd['error'][_0xcc52('0x15')]);return _0x38bf62(_0x1af4dd[_0xcc52('0x13')]['message']);}else{logger['info'](_0xcc52('0x14'),_0x139154,_0xcc52('0x11'));_0x38bf62(_0x1af4dd['result'][_0xcc52('0x15')]);}})['catch'](function(_0x4015ed){logger[_0xcc52('0x13')](_0xcc52('0x14'),_0x139154,_0x4015ed);_0x4242b7(_0x4015ed);});});}exports[_0xcc52('0x16')]=function(_0x1072c6){var _0x40ea65=this;return new Promise(function(_0x1c3206,_0x2805e5){return db['ChatMessage'][_0xcc52('0x17')](_0x1072c6[_0xcc52('0x18')],{'raw':_0x1072c6[_0xcc52('0x19')]?_0x1072c6[_0xcc52('0x19')][_0xcc52('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x30c328){logger[_0xcc52('0x1b')](_0xcc52('0x16'),_0x1072c6);logger[_0xcc52('0xf')]('CreateChatMessage',_0x1072c6,JSON[_0xcc52('0x12')](_0x30c328));_0x1c3206(_0x30c328);})[_0xcc52('0x1c')](function(_0x425d76){logger['error']('CreateChatMessage',_0x425d76[_0xcc52('0x15')],_0x1072c6);_0x2805e5(_0x40ea65[_0xcc52('0x13')](0x1f4,_0x425d76[_0xcc52('0x15')]));});});};
\ No newline at end of file
+var _0x522e=['stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./chatMessage.socket','request','then','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x522e,0x9c));var _0xe522=function(_0x836c0b,_0xbfd311){_0x836c0b=_0x836c0b-0x0;var _0x3d3c6d=_0x522e[_0x836c0b];return _0x3d3c6d;};'use strict';var _=require(_0xe522('0x0'));var util=require(_0xe522('0x1'));var moment=require('moment');var BPromise=require(_0xe522('0x2'));var rs=require(_0xe522('0x3'));var fs=require('fs');var Redis=require(_0xe522('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe522('0x5'));var logger=require(_0xe522('0x6'))(_0xe522('0x7'));var config=require(_0xe522('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe522('0x9')][_0xe522('0xa')]({'port':0x232a});config[_0xe522('0xb')]=_['defaults'](config[_0xe522('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe522('0xc'))['register'](socket);function respondWithRpcPromise(_0x32fc42,_0x3c09bc,_0x4f2fff){return new BPromise(function(_0x412a0a,_0x44c31b){return client[_0xe522('0xd')](_0x32fc42,_0x4f2fff)[_0xe522('0xe')](function(_0x579e97){logger[_0xe522('0xf')]('ChatMessage,\x20%s,\x20%s',_0x3c09bc,'request\x20sent');logger[_0xe522('0x10')](_0xe522('0x11'),_0x3c09bc,_0xe522('0x12'),JSON['stringify'](_0x579e97));if(_0x579e97['error']){if(_0x579e97['error'][_0xe522('0x13')]===0x1f4){logger[_0xe522('0x14')](_0xe522('0x15'),_0x3c09bc,_0x579e97[_0xe522('0x14')][_0xe522('0x16')]);return _0x44c31b(_0x579e97[_0xe522('0x14')][_0xe522('0x16')]);}logger[_0xe522('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3c09bc,_0x579e97[_0xe522('0x14')][_0xe522('0x16')]);return _0x412a0a(_0x579e97['error']['message']);}else{logger['info'](_0xe522('0x15'),_0x3c09bc,_0xe522('0x12'));_0x412a0a(_0x579e97[_0xe522('0x17')][_0xe522('0x16')]);}})[_0xe522('0x18')](function(_0x308605){logger[_0xe522('0x14')](_0xe522('0x15'),_0x3c09bc,_0x308605);_0x44c31b(_0x308605);});});}exports[_0xe522('0x19')]=function(_0x5708cc){var _0xc02507=this;return new Promise(function(_0x2ca782,_0x1b35ca){return db[_0xe522('0x1a')]['create'](_0x5708cc[_0xe522('0x1b')],{'raw':_0x5708cc[_0xe522('0x1c')]?_0x5708cc[_0xe522('0x1c')][_0xe522('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x296443){logger[_0xe522('0xf')](_0xe522('0x19'),_0x5708cc);logger[_0xe522('0x10')](_0xe522('0x19'),_0x5708cc,JSON[_0xe522('0x1e')](_0x296443));_0x2ca782(_0x296443);})[_0xe522('0x18')](function(_0x137844){logger[_0xe522('0x14')](_0xe522('0x19'),_0x137844[_0xe522('0x16')],_0x5708cc);_0x1b35ca(_0xc02507['error'](0x1f4,_0x137844[_0xe522('0x16')]));});});};
\ No newline at end of file
index 8b27cc5..d2326e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9b1=['chatMessage:','remove','update','emit','register','length'];(function(_0x27ff37,_0x2f9194){var _0x525816=function(_0x59fdaa){while(--_0x59fdaa){_0x27ff37['push'](_0x27ff37['shift']());}};_0x525816(++_0x2f9194);}(_0xa9b1,0x133));var _0x1a9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9b1[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x1a9b('0x0'),_0x1a9b('0x1')];function createListener(_0x11c1ff,_0x3f42db){return function(_0xc88712){_0x3f42db[_0x1a9b('0x2')](_0x11c1ff,_0xc88712);};}function removeListener(_0x52f55f,_0x57b453){return function(){ChatMessageEvents['removeListener'](_0x52f55f,_0x57b453);};}exports[_0x1a9b('0x3')]=function(_0x15861d){for(var _0x1a78b6=0x0,_0xc55657=events[_0x1a9b('0x4')];_0x1a78b6<_0xc55657;_0x1a78b6++){var _0x16c344=events[_0x1a78b6];var _0x263b84=createListener(_0x1a9b('0x5')+_0x16c344,_0x15861d);ChatMessageEvents['on'](_0x16c344,_0x263b84);}};
\ No newline at end of file
+var _0x45d1=['removeListener','register','length','./chatMessage.events','save','update'];(function(_0x574709,_0x6ff052){var _0x476bb1=function(_0x39795b){while(--_0x39795b){_0x574709['push'](_0x574709['shift']());}};_0x476bb1(++_0x6ff052);}(_0x45d1,0x1cb));var _0x145d=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x45d1[_0x1c72b8];return _0x191114;};'use strict';var ChatMessageEvents=require(_0x145d('0x0'));var events=[_0x145d('0x1'),'remove',_0x145d('0x2')];function createListener(_0x1d1ab1,_0x4f5dd4){return function(_0x22f728){_0x4f5dd4['emit'](_0x1d1ab1,_0x22f728);};}function removeListener(_0x3076c2,_0x327cd3){return function(){ChatMessageEvents[_0x145d('0x3')](_0x3076c2,_0x327cd3);};}exports[_0x145d('0x4')]=function(_0x14ddd8){for(var _0x2896c3=0x0,_0xbc4161=events[_0x145d('0x5')];_0x2896c3<_0xbc4161;_0x2896c3++){var _0x46a729=events[_0x2896c3];var _0x47eadc=createListener('chatMessage:'+_0x46a729,_0x14ddd8);ChatMessageEvents['on'](_0x46a729,_0x47eadc);}};
\ No newline at end of file
index 6fc6b92..e9382c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df0=['chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','post','tracked'];(function(_0x5524a1,_0x37c171){var _0x4ea5e3=function(_0x493ee1){while(--_0x493ee1){_0x5524a1['push'](_0x5524a1['shift']());}};_0x4ea5e3(++_0x37c171);}(_0x6df0,0x8c));var _0x06df=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x6df0[_0x2aee2f];return _0x19337f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06df('0x0'));var timeout=require(_0x06df('0x1'));var express=require('express');var router=express[_0x06df('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x06df('0x3'));var interaction=require(_0x06df('0x4'));var config=require(_0x06df('0x5'));var controller=require(_0x06df('0x6'));router[_0x06df('0x7')]('/',auth['isAuthenticated'](),controller[_0x06df('0x8')]);router[_0x06df('0x7')](_0x06df('0x9'),auth[_0x06df('0xa')](),controller['describe']);router[_0x06df('0x7')](_0x06df('0xb'),auth[_0x06df('0xa')](),controller['show']);router[_0x06df('0xc')]('/',auth['isAuthenticated'](),interaction[_0x06df('0xd')]('chat',_0x06df('0xe')),controller[_0x06df('0xf')]);router[_0x06df('0x10')]('/:id',controller[_0x06df('0x11')]);router[_0x06df('0x10')](_0x06df('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x06df('0x13'),auth[_0x06df('0xa')](),controller[_0x06df('0x14')]);router[_0x06df('0x15')](_0x06df('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6529=['isAuthenticated','index','/describe','describe','/:id','show','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get'];(function(_0x12fb0a,_0x2a3d35){var _0x32c98d=function(_0x308008){while(--_0x308008){_0x12fb0a['push'](_0x12fb0a['shift']());}};_0x32c98d(++_0x2a3d35);}(_0x6529,0x6a));var _0x9652=function(_0x33f367,_0x31e422){_0x33f367=_0x33f367-0x0;var _0xc7970d=_0x6529[_0x33f367];return _0xc7970d;};'use strict';var multer=require(_0x9652('0x0'));var util=require(_0x9652('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9652('0x2'));var router=express['Router']();var fs_extra=require(_0x9652('0x3'));var auth=require(_0x9652('0x4'));var interaction=require(_0x9652('0x5'));var config=require(_0x9652('0x6'));var controller=require(_0x9652('0x7'));router[_0x9652('0x8')]('/',auth[_0x9652('0x9')](),controller[_0x9652('0xa')]);router['get'](_0x9652('0xb'),auth['isAuthenticated'](),controller[_0x9652('0xc')]);router[_0x9652('0x8')](_0x9652('0xd'),auth[_0x9652('0x9')](),controller[_0x9652('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0x9652('0xf')),controller[_0x9652('0x10')]);router[_0x9652('0x11')](_0x9652('0xd'),controller['update']);router['put'](_0x9652('0x12'),auth['isAuthenticated'](),controller[_0x9652('0x13')]);router[_0x9652('0x11')](_0x9652('0x14'),auth[_0x9652('0x9')](),controller['reject']);router[_0x9652('0x15')](_0x9652('0xd'),auth[_0x9652('0x9')](),controller[_0x9652('0x16')]);module['exports']=router;
\ No newline at end of file
index 6704ffe..9716cae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fcc=['sequelize','TEXT','medium'];(function(_0x5b2002,_0x1a5b3c){var _0x54683f=function(_0x552edc){while(--_0x552edc){_0x5b2002['push'](_0x5b2002['shift']());}};_0x54683f(++_0x1a5b3c);}(_0x5fcc,0x12c));var _0xc5fc=function(_0x1b5463,_0x5716f8){_0x1b5463=_0x1b5463-0x0;var _0x33a19d=_0x5fcc[_0x1b5463];return _0x33a19d;};'use strict';var Sequelize=require(_0xc5fc('0x0'));module['exports']={'body':{'type':Sequelize[_0xc5fc('0x1')](_0xc5fc('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xc51b=['exports','TEXT','sequelize'];(function(_0x2490fd,_0x195a80){var _0x170515=function(_0x4ae6aa){while(--_0x4ae6aa){_0x2490fd['push'](_0x2490fd['shift']());}};_0x170515(++_0x195a80);}(_0xc51b,0x18b));var _0xbc51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc51b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbc51('0x0'));module[_0xbc51('0x1')]={'body':{'type':Sequelize[_0xbc51('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
index a7c1902..a8f011c 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(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x7a54,0x106));var _0x47a5=function(_0x366ab2,_0x1ac782){_0x366ab2=_0x366ab2-0x0;var _0x12f965=_0x7a54[_0x366ab2];return _0x12f965;};'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(_0x183223,_0xe296c){var _0xbd9560=function(_0x327483){while(--_0x327483){_0x183223['push'](_0x183223['shift']());}};_0xbd9560(++_0xe296c);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 883e5d4..7e337be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0679=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x1cb715,_0x41950d){var _0x37dfff=function(_0xfccda1){while(--_0xfccda1){_0x1cb715['push'](_0x1cb715['shift']());}};_0x37dfff(++_0x41950d);}(_0x0679,0x7f));var _0x9067=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0679[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9067('0x2'));var fs=require('fs');var path=require(_0x9067('0x3'));var rimraf=require(_0x9067('0x4'));var config=require(_0x9067('0x5'));var attributes=require(_0x9067('0x6'));module[_0x9067('0x7')]=function(_0x141c3c,_0x39d74c){return _0x141c3c[_0x9067('0x8')](_0x9067('0x9'),attributes,{'tableName':_0x9067('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9067('0xb'),'collate':_0x9067('0xc')});};
\ No newline at end of file
+var _0x9fd3=['path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x5caa42,_0x4993f6){var _0x3c9cf7=function(_0x329e07){while(--_0x329e07){_0x5caa42['push'](_0x5caa42['shift']());}};_0x3c9cf7(++_0x4993f6);}(_0x9fd3,0x1d0));var _0x39fd=function(_0x13d71a,_0x25ac53){_0x13d71a=_0x13d71a-0x0;var _0x48d55e=_0x9fd3[_0x13d71a];return _0x48d55e;};'use strict';var _=require('lodash');var util=require(_0x39fd('0x0'));var logger=require(_0x39fd('0x1'))(_0x39fd('0x2'));var moment=require('moment');var BPromise=require(_0x39fd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39fd('0x4'));var rimraf=require(_0x39fd('0x5'));var config=require(_0x39fd('0x6'));var attributes=require(_0x39fd('0x7'));module[_0x39fd('0x8')]=function(_0xc75332,_0x5e3eea){return _0xc75332['define']('ChatOfflineMessage',attributes,{'tableName':_0x39fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x39fd('0xa'),'collate':_0x39fd('0xb')});};
\ No newline at end of file
index 9d40973..f3a7f19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b2a=['ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0xe96a60,_0x5756e9){var _0x1da175=function(_0x4b3a8e){while(--_0x4b3a8e){_0xe96a60['push'](_0xe96a60['shift']());}};_0x1da175(++_0x5756e9);}(_0x3b2a,0x90));var _0xa3b2=function(_0x55a345,_0x5d3188){_0x55a345=_0x55a345-0x0;var _0xd74d62=_0x3b2a[_0x55a345];return _0xd74d62;};'use strict';var _=require('lodash');var util=require(_0xa3b2('0x0'));var moment=require('moment');var BPromise=require(_0xa3b2('0x1'));var rs=require(_0xa3b2('0x2'));var fs=require('fs');var Redis=require(_0xa3b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa3b2('0x4'))(_0xa3b2('0x5'));var config=require(_0xa3b2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa3b2('0x7')][_0xa3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59dc01,_0xc01ac1,_0x42a74c){return new BPromise(function(_0xa63d94,_0xe1ef79){return client[_0xa3b2('0x9')](_0x59dc01,_0x42a74c)[_0xa3b2('0xa')](function(_0x198b5a){logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));logger[_0xa3b2('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xc01ac1,_0xa3b2('0xd'),JSON[_0xa3b2('0xf')](_0x198b5a));if(_0x198b5a[_0xa3b2('0x10')]){if(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x11')]===0x1f4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a['error']['message']);return _0xe1ef79(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}logger[_0xa3b2('0x10')](_0xa3b2('0xc'),_0xc01ac1,_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);return _0xa63d94(_0x198b5a[_0xa3b2('0x10')][_0xa3b2('0x12')]);}else{logger[_0xa3b2('0xb')](_0xa3b2('0xc'),_0xc01ac1,_0xa3b2('0xd'));_0xa63d94(_0x198b5a[_0xa3b2('0x13')][_0xa3b2('0x12')]);}})[_0xa3b2('0x14')](function(_0x5132e4){logger['error'](_0xa3b2('0xc'),_0xc01ac1,_0x5132e4);_0xe1ef79(_0x5132e4);});});}
\ No newline at end of file
+var _0x4082=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x379165,_0x4c6ecb){var _0x328fc8=function(_0x570fd2){while(--_0x570fd2){_0x379165['push'](_0x379165['shift']());}};_0x328fc8(++_0x4c6ecb);}(_0x4082,0x118));var _0x2408=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0x4082[_0x35b18a];return _0x4db1bd;};'use strict';var _=require(_0x2408('0x0'));var util=require(_0x2408('0x1'));var moment=require(_0x2408('0x2'));var BPromise=require('bluebird');var rs=require(_0x2408('0x3'));var fs=require('fs');var Redis=require(_0x2408('0x4'));var db=require(_0x2408('0x5'))['db'];var utils=require(_0x2408('0x6'));var logger=require(_0x2408('0x7'))('rpc');var config=require(_0x2408('0x8'));var jayson=require(_0x2408('0x9'));var client=jayson[_0x2408('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d32f7,_0x1d732f,_0x4f2f08){return new BPromise(function(_0x11e0cd,_0x1c513b){return client['request'](_0x2d32f7,_0x4f2f08)[_0x2408('0xb')](function(_0x1db137){logger[_0x2408('0xc')](_0x2408('0xd'),_0x1d732f,'request\x20sent');logger[_0x2408('0xe')](_0x2408('0xf'),_0x1d732f,_0x2408('0x10'),JSON[_0x2408('0x11')](_0x1db137));if(_0x1db137[_0x2408('0x12')]){if(_0x1db137[_0x2408('0x12')][_0x2408('0x13')]===0x1f4){logger[_0x2408('0x12')](_0x2408('0xd'),_0x1d732f,_0x1db137[_0x2408('0x12')][_0x2408('0x14')]);return _0x1c513b(_0x1db137[_0x2408('0x12')][_0x2408('0x14')]);}logger['error'](_0x2408('0xd'),_0x1d732f,_0x1db137[_0x2408('0x12')]['message']);return _0x11e0cd(_0x1db137[_0x2408('0x12')][_0x2408('0x14')]);}else{logger[_0x2408('0xc')](_0x2408('0xd'),_0x1d732f,_0x2408('0x10'));_0x11e0cd(_0x1db137[_0x2408('0x15')]['message']);}})[_0x2408('0x16')](function(_0x1e4d00){logger['error'](_0x2408('0xd'),_0x1d732f,_0x1e4d00);_0x1c513b(_0x1e4d00);});});}
\ No newline at end of file
index d79605a..1d27d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a48=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5a48,0x64));var _0x85a4=function(_0x591781,_0x8e0ed2){_0x591781=_0x591781-0x0;var _0x315bd9=_0x5a48[_0x591781];return _0x315bd9;};'use strict';var multer=require(_0x85a4('0x0'));var util=require('util');var path=require(_0x85a4('0x1'));var timeout=require(_0x85a4('0x2'));var express=require(_0x85a4('0x3'));var router=express[_0x85a4('0x4')]();var fs_extra=require(_0x85a4('0x5'));var auth=require(_0x85a4('0x6'));var interaction=require(_0x85a4('0x7'));var config=require(_0x85a4('0x8'));var controller=require(_0x85a4('0x9'));router[_0x85a4('0xa')]('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xc')]);router['get']('/describe',auth[_0x85a4('0xb')](),controller['describe']);router['get'](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller['show']);router['post']('/',auth[_0x85a4('0xb')](),controller[_0x85a4('0xe')]);router[_0x85a4('0xf')]('/:id',auth[_0x85a4('0xb')](),controller[_0x85a4('0x10')]);router[_0x85a4('0x11')](_0x85a4('0xd'),auth[_0x85a4('0xb')](),controller[_0x85a4('0x12')]);module[_0x85a4('0x13')]=router;
\ No newline at end of file
+var _0x5a7b=['exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','delete'];(function(_0x306f5b,_0x3bb6e1){var _0x3be080=function(_0x486d21){while(--_0x486d21){_0x306f5b['push'](_0x306f5b['shift']());}};_0x3be080(++_0x3bb6e1);}(_0x5a7b,0x17d));var _0xb5a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a7b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb5a7('0x0'));var timeout=require('connect-timeout');var express=require(_0xb5a7('0x1'));var router=express[_0xb5a7('0x2')]();var fs_extra=require(_0xb5a7('0x3'));var auth=require(_0xb5a7('0x4'));var interaction=require(_0xb5a7('0x5'));var config=require(_0xb5a7('0x6'));var controller=require(_0xb5a7('0x7'));router[_0xb5a7('0x8')]('/',auth[_0xb5a7('0x9')](),controller[_0xb5a7('0xa')]);router[_0xb5a7('0x8')](_0xb5a7('0xb'),auth[_0xb5a7('0x9')](),controller[_0xb5a7('0xc')]);router[_0xb5a7('0x8')]('/:id',auth[_0xb5a7('0x9')](),controller[_0xb5a7('0xd')]);router[_0xb5a7('0xe')]('/',auth[_0xb5a7('0x9')](),controller[_0xb5a7('0xf')]);router['put'](_0xb5a7('0x10'),auth[_0xb5a7('0x9')](),controller['update']);router[_0xb5a7('0x11')](_0xb5a7('0x10'),auth[_0xb5a7('0x9')](),controller['destroy']);module[_0xb5a7('0x12')]=router;
\ No newline at end of file
index 13aaa24..feb45ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c57=['STRING','mouseOver','timeout','sequelize','exports'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0x2c57,0xc6));var _0x72c5=function(_0x10ab93,_0x1fcb57){_0x10ab93=_0x10ab93-0x0;var _0x1a8a68=_0x2c57[_0x10ab93];return _0x1a8a68;};'use strict';var Sequelize=require(_0x72c5('0x0'));module[_0x72c5('0x1')]={'name':{'type':Sequelize[_0x72c5('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x72c5('0x3'),_0x72c5('0x4')),'defaultValue':_0x72c5('0x3')},'selector':{'type':Sequelize[_0x72c5('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7d3a=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x19d72b,_0x189be8){var _0x423278=function(_0x5a590f){while(--_0x5a590f){_0x19d72b['push'](_0x19d72b['shift']());}};_0x423278(++_0x189be8);}(_0x7d3a,0x17a));var _0xa7d3=function(_0x536e07,_0x182822){_0x536e07=_0x536e07-0x0;var _0x19d915=_0x7d3a[_0x536e07];return _0x19d915;};'use strict';var Sequelize=require(_0xa7d3('0x0'));module[_0xa7d3('0x1')]={'name':{'type':Sequelize[_0xa7d3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa7d3('0x3'),_0xa7d3('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xa7d3('0x2')]},'timeout':{'type':Sequelize[_0xa7d3('0x5')]}};
\ No newline at end of file
index 6fba67b..aac0230 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x556b=['ChatProactiveAction','rawAttributes','query','intersection','model','fields','attributes','includeAll','merge','options','catch','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','sendStatus','stack','send','show'];(function(_0x4ada2b,_0x129e77){var _0x27b275=function(_0x90cf7b){while(--_0x90cf7b){_0x4ada2b['push'](_0x4ada2b['shift']());}};_0x27b275(++_0x129e77);}(_0x556b,0x1d7));var _0xb556=function(_0x4ae509,_0x27c36a){_0x4ae509=_0x4ae509-0x0;var _0x10e96e=_0x556b[_0x4ae509];return _0x10e96e;};'use strict';var emlformat=require(_0xb556('0x0'));var rimraf=require(_0xb556('0x1'));var zipdir=require(_0xb556('0x2'));var jsonpatch=require(_0xb556('0x3'));var rp=require(_0xb556('0x4'));var moment=require('moment');var BPromise=require(_0xb556('0x5'));var Mustache=require(_0xb556('0x6'));var util=require(_0xb556('0x7'));var path=require(_0xb556('0x8'));var sox=require(_0xb556('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb556('0xa'));var squel=require(_0xb556('0xb'));var crypto=require(_0xb556('0xc'));var jsforce=require(_0xb556('0xd'));var deskjs=require(_0xb556('0xe'));var toCsv=require(_0xb556('0xf'));var querystring=require(_0xb556('0x10'));var Papa=require(_0xb556('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb556('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb556('0x13'));var logger=require(_0xb556('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb556('0x15'));var licenseUtil=require(_0xb556('0x16'));var db=require(_0xb556('0x17'))['db'];function respondWithStatusCode(_0x40d9f2,_0xef593){_0xef593=_0xef593||0xcc;return function(_0x383401){if(_0x383401){return _0x40d9f2['sendStatus'](_0xef593);}return _0x40d9f2['status'](_0xef593)[_0xb556('0x18')]();};}function respondWithResult(_0x5a002a,_0x29fa7e){_0x29fa7e=_0x29fa7e||0xc8;return function(_0x52ff5e){if(_0x52ff5e){return _0x5a002a['status'](_0x29fa7e)['json'](_0x52ff5e);}};}function respondWithFilteredResult(_0x39305f,_0x9c69d9){return function(_0xffd07){if(_0xffd07){var _0x329bd0=typeof _0x9c69d9[_0xb556('0x19')]===_0xb556('0x1a')&&typeof _0x9c69d9[_0xb556('0x1b')]===_0xb556('0x1a');var _0xcfaa19=_0xffd07['count'];var _0x475808=_0x329bd0?0x0:_0x9c69d9[_0xb556('0x19')];var _0xb378b2=_0x329bd0?_0xffd07[_0xb556('0x1c')]:_0x9c69d9['offset']+_0x9c69d9[_0xb556('0x1b')];var _0x355b15;if(_0xb378b2>=_0xcfaa19){_0xb378b2=_0xcfaa19;_0x355b15=0xc8;}else{_0x355b15=0xce;}_0x39305f[_0xb556('0x1d')](_0x355b15);return _0x39305f[_0xb556('0x1e')]('Content-Range',_0x475808+'-'+_0xb378b2+'/'+_0xcfaa19)[_0xb556('0x1f')](_0xffd07);}return null;};}function patchUpdates(_0x3f1f30){return function(_0xa840e7){try{jsonpatch[_0xb556('0x20')](_0xa840e7,_0x3f1f30,!![]);}catch(_0x49d0b5){return BPromise[_0xb556('0x21')](_0x49d0b5);}return _0xa840e7[_0xb556('0x22')]();};}function saveUpdates(_0x21a3b6,_0x126af6){return function(_0x420ddb){if(_0x420ddb){return _0x420ddb[_0xb556('0x23')](_0x21a3b6)[_0xb556('0x24')](function(_0x5f10a5){return _0x5f10a5;});}return null;};}function removeEntity(_0x33797a,_0x3d5ae7){return function(_0x12b195){if(_0x12b195){return _0x12b195[_0xb556('0x25')]()[_0xb556('0x24')](function(){_0x33797a[_0xb556('0x1d')](0xcc)[_0xb556('0x18')]();});}};}function handleEntityNotFound(_0x442264,_0x22abed){return function(_0x184e87){if(!_0x184e87){_0x442264[_0xb556('0x26')](0x194);}return _0x184e87;};}function handleError(_0x3a328c,_0xb89dbe){_0xb89dbe=_0xb89dbe||0x1f4;return function(_0x1962b1){logger['error'](_0x1962b1[_0xb556('0x27')]);if(_0x1962b1['name']){delete _0x1962b1['name'];}_0x3a328c['status'](_0xb89dbe)[_0xb556('0x28')](_0x1962b1);};}exports[_0xb556('0x29')]=function(_0x27fd7e,_0x58180c){var _0x19544e={'raw':!![],'where':{'id':_0x27fd7e['params']['id']}},_0x3c9a87={};_0x3c9a87['model']=_['keys'](db[_0xb556('0x2a')][_0xb556('0x2b')]);_0x3c9a87['query']=_['keys'](_0x27fd7e[_0xb556('0x2c')]);_0x3c9a87['filters']=_[_0xb556('0x2d')](_0x3c9a87['model'],_0x3c9a87[_0xb556('0x2c')]);_0x19544e['attributes']=_[_0xb556('0x2d')](_0x3c9a87[_0xb556('0x2e')],qs['fields'](_0x27fd7e['query'][_0xb556('0x2f')]));_0x19544e[_0xb556('0x30')]=_0x19544e[_0xb556('0x30')]['length']?_0x19544e[_0xb556('0x30')]:_0x3c9a87[_0xb556('0x2e')];if(_0x27fd7e[_0xb556('0x2c')][_0xb556('0x31')]){_0x19544e['include']=[{'all':!![]}];}_0x19544e=_[_0xb556('0x32')]({},_0x19544e,_0x27fd7e[_0xb556('0x33')]);return db['ChatProactiveAction']['find'](_0x19544e)[_0xb556('0x24')](handleEntityNotFound(_0x58180c,null))[_0xb556('0x24')](respondWithResult(_0x58180c,null))[_0xb556('0x34')](handleError(_0x58180c,null));};exports['create']=function(_0x272ffe,_0x2af3fa){return db['ChatProactiveAction'][_0xb556('0x35')](_0x272ffe[_0xb556('0x36')],{})[_0xb556('0x24')](respondWithResult(_0x2af3fa,0xc9))['catch'](handleError(_0x2af3fa,null));};exports['update']=function(_0x34273c,_0x2db02e){if(_0x34273c[_0xb556('0x36')]['id']){delete _0x34273c['body']['id'];}return db[_0xb556('0x2a')][_0xb556('0x37')]({'where':{'id':_0x34273c['params']['id']}})['then'](handleEntityNotFound(_0x2db02e,null))[_0xb556('0x24')](saveUpdates(_0x34273c[_0xb556('0x36')],null))['then'](respondWithResult(_0x2db02e,null))['catch'](handleError(_0x2db02e,null));};exports[_0xb556('0x25')]=function(_0x13d1d5,_0x38c26d){return db[_0xb556('0x2a')]['find']({'where':{'id':_0x13d1d5[_0xb556('0x38')]['id']}})['then'](handleEntityNotFound(_0x38c26d,null))['then'](removeEntity(_0x38c26d,null))[_0xb556('0x34')](handleError(_0x38c26d,null));};
\ No newline at end of file
+var _0x0207=['rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x0207,0x162));var _0x7020=function(_0x385154,_0x70ebfc){_0x385154=_0x385154-0x0;var _0x26a8f8=_0x0207[_0x385154];return _0x26a8f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7020('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7020('0x1'));var moment=require(_0x7020('0x2'));var BPromise=require(_0x7020('0x3'));var Mustache=require(_0x7020('0x4'));var util=require(_0x7020('0x5'));var path=require(_0x7020('0x6'));var sox=require(_0x7020('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7020('0x8'));var _=require(_0x7020('0x9'));var squel=require(_0x7020('0xa'));var crypto=require(_0x7020('0xb'));var jsforce=require(_0x7020('0xc'));var deskjs=require(_0x7020('0xd'));var toCsv=require(_0x7020('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7020('0xf'));var authService=require(_0x7020('0x10'));var qs=require(_0x7020('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7020('0x12'));var logger=require(_0x7020('0x13'))('api');var utils=require(_0x7020('0x14'));var config=require(_0x7020('0x15'));var licenseUtil=require(_0x7020('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7d79,_0x598198){_0x598198=_0x598198||0xcc;return function(_0xd41aed){if(_0xd41aed){return _0x2d7d79[_0x7020('0x17')](_0x598198);}return _0x2d7d79[_0x7020('0x18')](_0x598198)['end']();};}function respondWithResult(_0x9403e5,_0x5f5872){_0x5f5872=_0x5f5872||0xc8;return function(_0x3b8d60){if(_0x3b8d60){return _0x9403e5[_0x7020('0x18')](_0x5f5872)[_0x7020('0x19')](_0x3b8d60);}};}function respondWithFilteredResult(_0x176190,_0x17260e){return function(_0x308324){if(_0x308324){var _0x55c8b9=typeof _0x17260e[_0x7020('0x1a')]==='undefined'&&typeof _0x17260e[_0x7020('0x1b')]===_0x7020('0x1c');var _0x1a3569=_0x308324[_0x7020('0x1d')];var _0x4fe6f1=_0x55c8b9?0x0:_0x17260e[_0x7020('0x1a')];var _0x3ac2f6=_0x55c8b9?_0x308324[_0x7020('0x1d')]:_0x17260e[_0x7020('0x1a')]+_0x17260e[_0x7020('0x1b')];var _0x1a79fb;if(_0x3ac2f6>=_0x1a3569){_0x3ac2f6=_0x1a3569;_0x1a79fb=0xc8;}else{_0x1a79fb=0xce;}_0x176190['status'](_0x1a79fb);return _0x176190['set'](_0x7020('0x1e'),_0x4fe6f1+'-'+_0x3ac2f6+'/'+_0x1a3569)[_0x7020('0x19')](_0x308324);}return null;};}function patchUpdates(_0x1d1986){return function(_0xb96d30){try{jsonpatch['apply'](_0xb96d30,_0x1d1986,!![]);}catch(_0x382e06){return BPromise[_0x7020('0x1f')](_0x382e06);}return _0xb96d30[_0x7020('0x20')]();};}function saveUpdates(_0x860099,_0x493cc7){return function(_0xcc48f){if(_0xcc48f){return _0xcc48f[_0x7020('0x21')](_0x860099)[_0x7020('0x22')](function(_0x362705){return _0x362705;});}return null;};}function removeEntity(_0x384fe9,_0xe3f4d2){return function(_0x147986){if(_0x147986){return _0x147986[_0x7020('0x23')]()['then'](function(){_0x384fe9[_0x7020('0x18')](0xcc)[_0x7020('0x24')]();});}};}function handleEntityNotFound(_0x35b539,_0x5586f8){return function(_0x28f9f0){if(!_0x28f9f0){_0x35b539['sendStatus'](0x194);}return _0x28f9f0;};}function handleError(_0x496471,_0x50aecb){_0x50aecb=_0x50aecb||0x1f4;return function(_0x178cbd){logger['error'](_0x178cbd[_0x7020('0x25')]);if(_0x178cbd['name']){delete _0x178cbd[_0x7020('0x26')];}_0x496471[_0x7020('0x18')](_0x50aecb)[_0x7020('0x27')](_0x178cbd);};}exports[_0x7020('0x28')]=function(_0xb03bd6,_0x1dff20){var _0x2ba734={'raw':!![],'where':{'id':_0xb03bd6[_0x7020('0x29')]['id']}},_0x15a1cc={};_0x15a1cc[_0x7020('0x2a')]=_[_0x7020('0x2b')](db[_0x7020('0x2c')][_0x7020('0x2d')]);_0x15a1cc['query']=_[_0x7020('0x2b')](_0xb03bd6[_0x7020('0x2e')]);_0x15a1cc[_0x7020('0x2f')]=_[_0x7020('0x30')](_0x15a1cc[_0x7020('0x2a')],_0x15a1cc[_0x7020('0x2e')]);_0x2ba734[_0x7020('0x31')]=_[_0x7020('0x30')](_0x15a1cc[_0x7020('0x2a')],qs[_0x7020('0x32')](_0xb03bd6[_0x7020('0x2e')][_0x7020('0x32')]));_0x2ba734[_0x7020('0x31')]=_0x2ba734[_0x7020('0x31')]['length']?_0x2ba734[_0x7020('0x31')]:_0x15a1cc[_0x7020('0x2a')];if(_0xb03bd6[_0x7020('0x2e')][_0x7020('0x33')]){_0x2ba734[_0x7020('0x34')]=[{'all':!![]}];}_0x2ba734=_[_0x7020('0x35')]({},_0x2ba734,_0xb03bd6[_0x7020('0x36')]);return db[_0x7020('0x2c')][_0x7020('0x37')](_0x2ba734)[_0x7020('0x22')](handleEntityNotFound(_0x1dff20,null))[_0x7020('0x22')](respondWithResult(_0x1dff20,null))[_0x7020('0x38')](handleError(_0x1dff20,null));};exports[_0x7020('0x39')]=function(_0x43db16,_0x5dddba){return db[_0x7020('0x2c')][_0x7020('0x39')](_0x43db16[_0x7020('0x3a')],{})['then'](respondWithResult(_0x5dddba,0xc9))[_0x7020('0x38')](handleError(_0x5dddba,null));};exports[_0x7020('0x21')]=function(_0x3bf437,_0x371b27){if(_0x3bf437[_0x7020('0x3a')]['id']){delete _0x3bf437[_0x7020('0x3a')]['id'];}return db['ChatProactiveAction'][_0x7020('0x37')]({'where':{'id':_0x3bf437['params']['id']}})['then'](handleEntityNotFound(_0x371b27,null))['then'](saveUpdates(_0x3bf437[_0x7020('0x3a')],null))[_0x7020('0x22')](respondWithResult(_0x371b27,null))[_0x7020('0x38')](handleError(_0x371b27,null));};exports[_0x7020('0x23')]=function(_0x3537e2,_0x4f1cca){return db['ChatProactiveAction'][_0x7020('0x37')]({'where':{'id':_0x3537e2[_0x7020('0x29')]['id']}})[_0x7020('0x22')](handleEntityNotFound(_0x4f1cca,null))[_0x7020('0x22')](removeEntity(_0x4f1cca,null))['catch'](handleError(_0x4f1cca,null));};
\ No newline at end of file
index 475d323..15e51a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6140=['bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','util','../../config/logger'];(function(_0x34a459,_0x136cd9){var _0x500f8b=function(_0xdcad7f){while(--_0xdcad7f){_0x34a459['push'](_0x34a459['shift']());}};_0x500f8b(++_0x136cd9);}(_0x6140,0x1d6));var _0x0614=function(_0x4345be,_0x1e1dd6){_0x4345be=_0x4345be-0x0;var _0xf851a1=_0x6140[_0x4345be];return _0xf851a1;};'use strict';var _=require('lodash');var util=require(_0x0614('0x0'));var logger=require(_0x0614('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0614('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0614('0x3'));var attributes=require(_0x0614('0x4'));module[_0x0614('0x5')]=function(_0x324dde,_0x4dd7f1){return _0x324dde[_0x0614('0x6')](_0x0614('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ee6=['lodash','util','api','moment','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x488491,_0x3831db){var _0x18434d=function(_0x3c7c7b){while(--_0x3c7c7b){_0x488491['push'](_0x488491['shift']());}};_0x18434d(++_0x3831db);}(_0x8ee6,0x1ce));var _0x68ee=function(_0x32acba,_0x1c794c){_0x32acba=_0x32acba-0x0;var _0x2bc33c=_0x8ee6[_0x32acba];return _0x2bc33c;};'use strict';var _=require(_0x68ee('0x0'));var util=require(_0x68ee('0x1'));var logger=require('../../config/logger')(_0x68ee('0x2'));var moment=require(_0x68ee('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x68ee('0x4'));var rimraf=require('rimraf');var config=require(_0x68ee('0x5'));var attributes=require(_0x68ee('0x6'));module[_0x68ee('0x7')]=function(_0x3d8676,_0x4f5a39){return _0x3d8676[_0x68ee('0x8')](_0x68ee('0x9'),attributes,{'tableName':_0x68ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 969b2c8..c8d48c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff7e=['../../config/logger','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','../../config/utils'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0xff7e,0x163));var _0xeff7=function(_0x4ac7f3,_0x580162){_0x4ac7f3=_0x4ac7f3-0x0;var _0x5690f1=_0xff7e[_0x4ac7f3];return _0x5690f1;};'use strict';var _=require(_0xeff7('0x0'));var util=require(_0xeff7('0x1'));var moment=require(_0xeff7('0x2'));var BPromise=require(_0xeff7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeff7('0x4'));var logger=require(_0xeff7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeff7('0x6'));var client=jayson['client'][_0xeff7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45a825,_0x422243,_0x16876c){return new BPromise(function(_0x392f3f,_0x136a47){return client[_0xeff7('0x8')](_0x45a825,_0x16876c)['then'](function(_0xc61a7f){logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');logger[_0xeff7('0xb')](_0xeff7('0xc'),_0x422243,_0xeff7('0xd'),JSON[_0xeff7('0xe')](_0xc61a7f));if(_0xc61a7f[_0xeff7('0xf')]){if(_0xc61a7f[_0xeff7('0xf')]['code']===0x1f4){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')]['message']);return _0x136a47(_0xc61a7f['error'][_0xeff7('0x10')]);}logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);return _0x392f3f(_0xc61a7f[_0xeff7('0xf')][_0xeff7('0x10')]);}else{logger[_0xeff7('0x9')](_0xeff7('0xa'),_0x422243,'request\x20sent');_0x392f3f(_0xc61a7f[_0xeff7('0x11')][_0xeff7('0x10')]);}})['catch'](function(_0x5f3b6d){logger[_0xeff7('0xf')](_0xeff7('0xa'),_0x422243,_0x5f3b6d);_0x136a47(_0x5f3b6d);});});}
\ No newline at end of file
+var _0x507a=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2f601c,_0x5a94a2){var _0x50a269=function(_0x1c4680){while(--_0x1c4680){_0x2f601c['push'](_0x2f601c['shift']());}};_0x50a269(++_0x5a94a2);}(_0x507a,0x12f));var _0xa507=function(_0x262f15,_0x3881cd){_0x262f15=_0x262f15-0x0;var _0x425a6d=_0x507a[_0x262f15];return _0x425a6d;};'use strict';var _=require(_0xa507('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa507('0x1'));var rs=require(_0xa507('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa507('0x3'));var logger=require('../../config/logger')(_0xa507('0x4'));var config=require(_0xa507('0x5'));var jayson=require(_0xa507('0x6'));var client=jayson[_0xa507('0x7')][_0xa507('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x258f35,_0x1530f9,_0x37240b){return new BPromise(function(_0x59c293,_0x216b80){return client[_0xa507('0x9')](_0x258f35,_0x37240b)['then'](function(_0x1f152d){logger[_0xa507('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x1530f9,_0xa507('0xb'));logger[_0xa507('0xc')](_0xa507('0xd'),_0x1530f9,_0xa507('0xb'),JSON['stringify'](_0x1f152d));if(_0x1f152d[_0xa507('0xe')]){if(_0x1f152d[_0xa507('0xe')][_0xa507('0xf')]===0x1f4){logger[_0xa507('0xe')](_0xa507('0x10'),_0x1530f9,_0x1f152d[_0xa507('0xe')][_0xa507('0x11')]);return _0x216b80(_0x1f152d[_0xa507('0xe')][_0xa507('0x11')]);}logger[_0xa507('0xe')](_0xa507('0x10'),_0x1530f9,_0x1f152d['error']['message']);return _0x59c293(_0x1f152d[_0xa507('0xe')]['message']);}else{logger[_0xa507('0xa')](_0xa507('0x10'),_0x1530f9,'request\x20sent');_0x59c293(_0x1f152d['result'][_0xa507('0x11')]);}})[_0xa507('0x12')](function(_0x4d7494){logger[_0xa507('0xe')](_0xa507('0x10'),_0x1530f9,_0x4d7494);_0x216b80(_0x4d7494);});});}
\ No newline at end of file
index c13d473..ccb7cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['create','put','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','/:id','show','post'];(function(_0x370c84,_0x1163e0){var _0x4cca44=function(_0x3b53a7){while(--_0x3b53a7){_0x370c84['push'](_0x370c84['shift']());}};_0x4cca44(++_0x1163e0);}(_0x53ec,0x192));var _0xc53e=function(_0x3d3d96,_0x28998e){_0x3d3d96=_0x3d3d96-0x0;var _0x2e479a=_0x53ec[_0x3d3d96];return _0x2e479a;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get'](_0xc53e('0x9'),auth['isAuthenticated'](),controller[_0xc53e('0xa')]);router[_0xc53e('0xb')]('/',auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xd')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0x9'),auth[_0xc53e('0xe')](),controller[_0xc53e('0x11')]);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(_0x28999c,_0x5c72a0){var _0x40cdc5=function(_0xf3855c){while(--_0xf3855c){_0x28999c['push'](_0x28999c['shift']());}};_0x40cdc5(++_0x5c72a0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x5fc3[_0x5a26f5];return _0x2e9ef7;};'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 fc31f52..52d87ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x948b=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x61711c,_0x5b2962){var _0x4cf0e9=function(_0x179352){while(--_0x179352){_0x61711c['push'](_0x61711c['shift']());}};_0x4cf0e9(++_0x5b2962);}(_0x948b,0x15c));var _0xb948=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0x948b[_0x2e2681];return _0x368a64;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb948('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb948('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb948('0x2')](_0xb948('0x3'),_0xb948('0x4'),_0xb948('0x5'))}};
\ No newline at end of file
+var _0x59d0=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1238fc,_0x404d1f){var _0x66d410=function(_0x22b1bc){while(--_0x22b1bc){_0x1238fc['push'](_0x1238fc['shift']());}};_0x66d410(++_0x404d1f);}(_0x59d0,0xc8));var _0x059d=function(_0x5385af,_0x4eed9d){_0x5385af=_0x5385af-0x0;var _0x5b1420=_0x59d0[_0x5385af];return _0x5b1420;};'use strict';var Sequelize=require('sequelize');module[_0x059d('0x0')]={'name':{'type':Sequelize[_0x059d('0x1')],'unique':_0x059d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x059d('0x1')]},'timeout':{'type':Sequelize[_0x059d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x059d('0x4')](_0x059d('0x5'),_0x059d('0x6'),_0x059d('0x7'))}};
\ No newline at end of file
index 1ac4930..6f6acb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddb=['options','includeAll','include','findAll','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','UserId','chatPause','rows','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','sequelize','transaction','findOrCreate','emit','userChatQueue:save','field','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','compact','removeTeams','removeAgents','forEach','userChatQueue:remove','addAgents','spread','getAgents','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','destroy','get','end','stack','send','index','map','ChatQueue','rawAttributes','key','model','name','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ddb,0x1d1));var _0xb6dd=function(_0x2f4445,_0x5ced13){_0x2f4445=_0x2f4445-0x0;var _0x570b2e=_0x6ddb[_0x2f4445];return _0x570b2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6dd('0x0'));var zipdir=require(_0xb6dd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb6dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb6dd('0x3'));var sox=require('sox');var csv=require(_0xb6dd('0x4'));var ejs=require(_0xb6dd('0x5'));var fs=require('fs');var fs_extra=require(_0xb6dd('0x6'));var _=require(_0xb6dd('0x7'));var squel=require(_0xb6dd('0x8'));var crypto=require(_0xb6dd('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb6dd('0xa'));var toCsv=require(_0xb6dd('0x4'));var querystring=require(_0xb6dd('0xb'));var Papa=require('papaparse');var Redis=require(_0xb6dd('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb6dd('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6dd('0xe'));var logger=require(_0xb6dd('0xf'))('api');var utils=require(_0xb6dd('0x10'));var config=require(_0xb6dd('0x11'));var licenseUtil=require(_0xb6dd('0x12'));var db=require(_0xb6dd('0x13'))['db'];config[_0xb6dd('0x14')]=_[_0xb6dd('0x15')](config[_0xb6dd('0x14')],{'host':_0xb6dd('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb6dd('0x14')]));require(_0xb6dd('0x17'))[_0xb6dd('0x18')](socket);var jayson=require(_0xb6dd('0x19'));var client=jayson['client'][_0xb6dd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x980006,_0x30de7e,_0x5ce4e4,_0xbf1fdb){return new BPromise(function(_0x519132,_0x2b9178){var _0x2adf59=_0xbf1fdb||client;return _0x2adf59[_0xb6dd('0x1b')](_0x980006,_0x5ce4e4)[_0xb6dd('0x1c')](function(_0x530d48){logger[_0xb6dd('0x1d')](_0xb6dd('0x1e'),_0x30de7e,_0xb6dd('0x1f'));logger[_0xb6dd('0x20')](_0xb6dd('0x21'),_0x30de7e,_0xb6dd('0x1f'),JSON['stringify'](_0x530d48));if(_0x530d48[_0xb6dd('0x22')]){if(_0x530d48[_0xb6dd('0x22')]['code']===0x1f4){logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x2b9178(_0x530d48['error'][_0xb6dd('0x23')]);}logger[_0xb6dd('0x22')](_0xb6dd('0x1e'),_0x30de7e,_0x530d48['error'][_0xb6dd('0x23')]);return _0x519132(_0x530d48[_0xb6dd('0x22')][_0xb6dd('0x23')]);}else{logger[_0xb6dd('0x1d')]('ChatQueue,\x20%s,\x20%s',_0x30de7e,_0xb6dd('0x1f'));_0x519132(_0x530d48[_0xb6dd('0x24')][_0xb6dd('0x23')]);}})[_0xb6dd('0x25')](function(_0x21da18){logger['error'](_0xb6dd('0x1e'),_0x30de7e,_0x21da18);_0x2b9178(_0x21da18);});});}function respondWithStatusCode(_0x6f4209,_0x56fd6f){_0x56fd6f=_0x56fd6f||0xcc;return function(_0x123d65){if(_0x123d65){return _0x6f4209[_0xb6dd('0x26')](_0x56fd6f);}return _0x6f4209[_0xb6dd('0x27')](_0x56fd6f)['end']();};}function respondWithResult(_0x4e8b67,_0x5dd003){_0x5dd003=_0x5dd003||0xc8;return function(_0x4e2113){if(_0x4e2113){return _0x4e8b67[_0xb6dd('0x27')](_0x5dd003)[_0xb6dd('0x28')](_0x4e2113);}};}function respondWithFilteredResult(_0x3b9548,_0x27a391){return function(_0x154f08){if(_0x154f08){var _0x2c792e=typeof _0x27a391['offset']===_0xb6dd('0x29')&&typeof _0x27a391[_0xb6dd('0x2a')]===_0xb6dd('0x29');var _0xc3dddc=_0x154f08[_0xb6dd('0x2b')];var _0x590f9=_0x2c792e?0x0:_0x27a391['offset'];var _0x48cdbc=_0x2c792e?_0x154f08['count']:_0x27a391[_0xb6dd('0x2c')]+_0x27a391['limit'];var _0x492d51;if(_0x48cdbc>=_0xc3dddc){_0x48cdbc=_0xc3dddc;_0x492d51=0xc8;}else{_0x492d51=0xce;}_0x3b9548[_0xb6dd('0x27')](_0x492d51);return _0x3b9548[_0xb6dd('0x2d')]('Content-Range',_0x590f9+'-'+_0x48cdbc+'/'+_0xc3dddc)[_0xb6dd('0x28')](_0x154f08);}return null;};}function patchUpdates(_0x2fb15f){return function(_0x16d1a4){try{jsonpatch[_0xb6dd('0x2e')](_0x16d1a4,_0x2fb15f,!![]);}catch(_0x2d5d41){return BPromise[_0xb6dd('0x2f')](_0x2d5d41);}return _0x16d1a4['save']();};}function saveUpdates(_0x54651e,_0x4d9ea1){return function(_0x455b48){if(_0x455b48){return _0x455b48['update'](_0x54651e)[_0xb6dd('0x1c')](function(_0x36452a){return _0x36452a;});}return null;};}function removeEntity(_0x3be45f,_0xdb9101){return function(_0x303670){if(_0x303670){return _0x303670[_0xb6dd('0x30')]()[_0xb6dd('0x1c')](function(){var _0x5dfb20=_0x303670[_0xb6dd('0x31')]({'plain':!![]});var _0x2a0865='ChatQueues';return db['UserProfileResource'][_0xb6dd('0x30')]({'where':{'type':_0x2a0865,'resourceId':_0x5dfb20['id']}})[_0xb6dd('0x1c')](function(){return _0x303670;});})[_0xb6dd('0x1c')](function(){_0x3be45f[_0xb6dd('0x27')](0xcc)[_0xb6dd('0x32')]();});}};}function handleEntityNotFound(_0x1ec873,_0x4d7faf){return function(_0x2ea282){if(!_0x2ea282){_0x1ec873['sendStatus'](0x194);}return _0x2ea282;};}function handleError(_0x15707f,_0x25d182){_0x25d182=_0x25d182||0x1f4;return function(_0x126fac){logger[_0xb6dd('0x22')](_0x126fac[_0xb6dd('0x33')]);if(_0x126fac['name']){delete _0x126fac['name'];}_0x15707f[_0xb6dd('0x27')](_0x25d182)[_0xb6dd('0x34')](_0x126fac);};}exports[_0xb6dd('0x35')]=function(_0x12f9f8,_0x3081b5){var _0x2c6052={},_0x44b1a3={},_0x41b267={'count':0x0,'rows':[]};var _0x3f5565=_[_0xb6dd('0x36')](db[_0xb6dd('0x37')][_0xb6dd('0x38')],function(_0x14079f){return{'name':_0x14079f['fieldName'],'type':_0x14079f['type'][_0xb6dd('0x39')]};});_0x44b1a3[_0xb6dd('0x3a')]=_['map'](_0x3f5565,_0xb6dd('0x3b'));_0x44b1a3['query']=_[_0xb6dd('0x3c')](_0x12f9f8['query']);_0x44b1a3[_0xb6dd('0x3d')]=_['intersection'](_0x44b1a3[_0xb6dd('0x3a')],_0x44b1a3[_0xb6dd('0x3e')]);_0x2c6052[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x44b1a3[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x2c6052[_0xb6dd('0x3f')]=_0x2c6052[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x2c6052[_0xb6dd('0x3f')]:_0x44b1a3[_0xb6dd('0x3a')];if(!_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x2c6052[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x2c6052[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x12f9f8[_0xb6dd('0x3e')]['offset']);}_0x2c6052['order']=qs[_0xb6dd('0x45')](_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x2c6052[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x12f9f8[_0xb6dd('0x3e')],_0x44b1a3['filters']),_0x3f5565);if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x2c6052[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x2c6052[_0xb6dd('0x46')],{'$or':_['map'](_0x3f5565,function(_0x2fc37f){if(_0x2fc37f[_0xb6dd('0x4a')]!=='VIRTUAL'){var _0x3eacaf={};_0x3eacaf[_0x2fc37f[_0xb6dd('0x3b')]]={'$like':'%'+_0x12f9f8['query'][_0xb6dd('0x48')]+'%'};return _0x3eacaf;}})});}_0x2c6052=_[_0xb6dd('0x49')]({},_0x2c6052,_0x12f9f8[_0xb6dd('0x4b')]);var _0x45b423={'where':_0x2c6052[_0xb6dd('0x46')]};return db[_0xb6dd('0x37')][_0xb6dd('0x2b')](_0x45b423)['then'](function(_0x1381a0){_0x41b267[_0xb6dd('0x2b')]=_0x1381a0;if(_0x12f9f8[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x2c6052[_0xb6dd('0x4d')]=[{'all':!![]}];}return db[_0xb6dd('0x37')][_0xb6dd('0x4e')](_0x2c6052);})[_0xb6dd('0x1c')](function(_0x1cbe17){_0x41b267['rows']=_0x1cbe17;return _0x41b267;})['then'](respondWithFilteredResult(_0x3081b5,_0x2c6052))['catch'](handleError(_0x3081b5,null));};exports[_0xb6dd('0x4f')]=function(_0x42cfe6,_0x311964){var _0x5cb8dd={'raw':!![],'where':{'id':_0x42cfe6[_0xb6dd('0x50')]['id']}},_0x331319={};_0x331319['model']=_['keys'](db['ChatQueue'][_0xb6dd('0x38')]);_0x331319[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x42cfe6[_0xb6dd('0x3e')]);_0x331319[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],_0x331319[_0xb6dd('0x3e')]);_0x5cb8dd[_0xb6dd('0x3f')]=_[_0xb6dd('0x40')](_0x331319[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0x42cfe6[_0xb6dd('0x3e')]['fields']));_0x5cb8dd[_0xb6dd('0x3f')]=_0x5cb8dd[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x5cb8dd['attributes']:_0x331319[_0xb6dd('0x3a')];if(_0x42cfe6[_0xb6dd('0x3e')][_0xb6dd('0x4c')]){_0x5cb8dd[_0xb6dd('0x4d')]=[{'all':!![]}];}_0x5cb8dd=_[_0xb6dd('0x49')]({},_0x5cb8dd,_0x42cfe6['options']);return db[_0xb6dd('0x37')][_0xb6dd('0x51')](_0x5cb8dd)[_0xb6dd('0x1c')](handleEntityNotFound(_0x311964,null))[_0xb6dd('0x1c')](respondWithResult(_0x311964,null))[_0xb6dd('0x25')](handleError(_0x311964,null));};exports['create']=function(_0x3a8cec,_0x3a74d4){return db['ChatQueue'][_0xb6dd('0x52')](_0x3a8cec[_0xb6dd('0x53')],{})['then'](function(_0x4e0bb7){var _0x13bb69=_0x3a8cec[_0xb6dd('0x54')][_0xb6dd('0x31')]({'plain':!![]});if(!_0x13bb69)throw new Error(_0xb6dd('0x55'));if(_0x13bb69[_0xb6dd('0x56')]===_0xb6dd('0x54')){var _0x15e262=_0x4e0bb7['get']({'plain':!![]});var _0xbc31a6=_0xb6dd('0x57');return db[_0xb6dd('0x58')][_0xb6dd('0x51')]({'where':{'name':_0xbc31a6,'userProfileId':_0x13bb69[_0xb6dd('0x59')]},'raw':!![]})[_0xb6dd('0x1c')](function(_0x5a5ef9){if(_0x5a5ef9&&_0x5a5ef9[_0xb6dd('0x5a')]===0x0){return db[_0xb6dd('0x5b')][_0xb6dd('0x52')]({'name':_0x15e262[_0xb6dd('0x3b')],'resourceId':_0x15e262['id'],'type':_0x5a5ef9['name'],'sectionId':_0x5a5ef9['id']},{})[_0xb6dd('0x1c')](function(){return _0x4e0bb7;});}else{return _0x4e0bb7;}})[_0xb6dd('0x25')](function(_0x5af82d){logger['error'](_0xb6dd('0x5c'),_0x5af82d);throw _0x5af82d;});}return _0x4e0bb7;})['then'](respondWithResult(_0x3a74d4,0xc9))[_0xb6dd('0x25')](handleError(_0x3a74d4,null));};exports['update']=function(_0x11b558,_0x31476b){if(_0x11b558[_0xb6dd('0x53')]['id']){delete _0x11b558[_0xb6dd('0x53')]['id'];}return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x11b558[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x31476b,null))['then'](saveUpdates(_0x11b558[_0xb6dd('0x53')],null))[_0xb6dd('0x1c')](respondWithResult(_0x31476b,null))[_0xb6dd('0x25')](handleError(_0x31476b,null));};exports[_0xb6dd('0x30')]=function(_0xdde89c,_0xec0e54){return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0xdde89c[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0xec0e54,null))[_0xb6dd('0x1c')](removeEntity(_0xec0e54,null))[_0xb6dd('0x25')](handleError(_0xec0e54,null));};exports[_0xb6dd('0x5d')]=function(_0x40008a,_0x2b0caa){return db[_0xb6dd('0x37')]['describe']()[_0xb6dd('0x1c')](respondWithResult(_0x2b0caa,null))[_0xb6dd('0x25')](handleError(_0x2b0caa,null));};exports[_0xb6dd('0x5e')]=function(_0x913d32,_0x2dc156,_0x14cb41){var _0x37da2c={'raw':!![],'where':{}},_0x35afef={},_0xb512b9;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x913d32[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x2dc156,null))[_0xb6dd('0x1c')](function(_0x3fb06f){if(_0x3fb06f){_0xb512b9=_0x3fb06f[_0xb6dd('0x31')]({'plain':!![]});_0x35afef['model']=_[_0xb6dd('0x3c')](db[_0xb6dd('0x60')][_0xb6dd('0x38')]);_0x35afef[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x913d32[_0xb6dd('0x3e')]);_0x35afef['filters']=_[_0xb6dd('0x40')](_0x35afef[_0xb6dd('0x3a')],_0x35afef[_0xb6dd('0x3e')]);_0x37da2c[_0xb6dd('0x3f')]=_['intersection'](_0x35afef[_0xb6dd('0x3a')],qs['fields'](_0x913d32[_0xb6dd('0x3e')]['fields']));_0x37da2c[_0xb6dd('0x3f')]=_0x37da2c['attributes'][_0xb6dd('0x42')]?_0x37da2c['attributes']:_0x35afef['model'];if(!_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x37da2c[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x37da2c[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}_0x37da2c[_0xb6dd('0x61')]=qs[_0xb6dd('0x45')](_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x45')]);_0x37da2c[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x913d32['query'],_0x35afef['filters']));_0x37da2c[_0xb6dd('0x46')][_0xb6dd('0x62')]=_0x3fb06f['id'];if(_0x913d32[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x37da2c[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x37da2c['where'],{'$or':_[_0xb6dd('0x36')](_0x37da2c['attributes'],function(_0x59af98){var _0x34ef6e={};_0x34ef6e[_0x59af98]={'$like':'%'+_0x913d32['query'][_0xb6dd('0x48')]+'%'};return _0x34ef6e;})});}_0x37da2c=_[_0xb6dd('0x49')]({},_0x37da2c,_0x913d32[_0xb6dd('0x4b')]);return db[_0xb6dd('0x60')][_0xb6dd('0x4e')](_0x37da2c);}})[_0xb6dd('0x1c')](function(_0x3293d5){if(_0x3293d5){return db[_0xb6dd('0x63')]['findAndCountAll']({'where':{'id':_[_0xb6dd('0x36')](_0x3293d5,_0xb6dd('0x64')),'role':'agent'},'attributes':['id','name',_0xb6dd('0x65'),'updatedAt','createdAt']});}})[_0xb6dd('0x1c')](function(_0x1ab21c){if(_0x1ab21c){return{'count':_0x1ab21c[_0xb6dd('0x2b')],'rows':_[_0xb6dd('0x36')](_0x1ab21c[_0xb6dd('0x66')],function(_0x391bc0){return{'membername':_0x391bc0[_0xb6dd('0x3b')],'UserId':_0x391bc0['id'],'queue_name':_0xb512b9[_0xb6dd('0x3b')],'ChatQueueId':_0xb512b9['id'],'interface':util['format'](_0xb6dd('0x67'),_0xb6dd('0x68'),_0x391bc0['name']),'penalty':0x0,'paused':_0x391bc0[_0xb6dd('0x65')],'createdAt':_0x391bc0['createdAt'],'updatedAt':_0x391bc0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb6dd('0x1c')](respondWithFilteredResult(_0x2dc156,_0x37da2c))[_0xb6dd('0x25')](handleError(_0x2dc156,null));};exports[_0xb6dd('0x69')]=function(_0xd5d37a,_0x58d620,_0x5c098a){var _0x50221d={};var _0x56306b={};var _0x50d296;var _0x5f4d0b;return db[_0xb6dd('0x37')]['findOne']({'where':{'id':_0xd5d37a[_0xb6dd('0x50')]['id']}})['then'](handleEntityNotFound(_0x58d620,null))[_0xb6dd('0x1c')](function(_0x4be74a){if(_0x4be74a){_0x50d296=_0x4be74a;_0x56306b[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db['Team'][_0xb6dd('0x38')]);_0x56306b['query']=_[_0xb6dd('0x3c')](_0xd5d37a[_0xb6dd('0x3e')]);_0x56306b[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x56306b[_0xb6dd('0x3a')],_0x56306b[_0xb6dd('0x3e')]);_0x50221d[_0xb6dd('0x3f')]=_['intersection'](_0x56306b[_0xb6dd('0x3a')],qs[_0xb6dd('0x41')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x50221d[_0xb6dd('0x3f')]=_0x50221d[_0xb6dd('0x3f')][_0xb6dd('0x42')]?_0x50221d['attributes']:_0x56306b[_0xb6dd('0x3a')];_0x50221d['order']=qs[_0xb6dd('0x45')](_0xd5d37a[_0xb6dd('0x3e')]['sort']);_0x50221d[_0xb6dd('0x46')]=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0xd5d37a[_0xb6dd('0x3e')],_0x56306b['filters']));if(_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x48')]){_0x50221d[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x50221d['where'],{'$or':_[_0xb6dd('0x36')](_0x50221d[_0xb6dd('0x3f')],function(_0x39489b){var _0x1ad1c6={};_0x1ad1c6[_0x39489b]={'$like':'%'+_0xd5d37a[_0xb6dd('0x3e')]['filter']+'%'};return _0x1ad1c6;})});}_0x50221d=_[_0xb6dd('0x49')]({},_0x50221d,_0xd5d37a[_0xb6dd('0x4b')]);return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x23358c){if(_0x23358c){_0x5f4d0b=_0x23358c['length'];if(!_0xd5d37a['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x50221d[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2a')]);_0x50221d[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0xd5d37a[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x50d296[_0xb6dd('0x69')](_0x50221d);}})[_0xb6dd('0x1c')](function(_0x46c12a){if(_0x46c12a){return _0x46c12a?{'count':_0x5f4d0b,'rows':_0x46c12a}:null;}})['then'](respondWithResult(_0x58d620,null))['catch'](handleError(_0x58d620,null));};exports[_0xb6dd('0x6a')]=function(_0x460028,_0x1fafe9,_0x20ad37){var _0x3ad4fc=_0x460028[_0xb6dd('0x53')][_0xb6dd('0x6b')];return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x3ad4fc},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':_0xb6dd('0x6d'),'attributes':['id',_0xb6dd('0x3b'),'online',_0xb6dd('0x6e'),_0xb6dd('0x6f')],'raw':!![]}]})[_0xb6dd('0x1c')](function(_0x515f90){if(_0x515f90){var _0xd0d196=_['flatMap'](_0x515f90,function(_0x23f927){var _0x45d812=_0x23f927[_0xb6dd('0x31')]({'plain':!![]});return _0x45d812[_0xb6dd('0x6d')];});return db[_0xb6dd('0x37')][_0xb6dd('0x51')]({'where':{'id':_0x460028[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](function(_0x10c044){return db[_0xb6dd('0x70')][_0xb6dd('0x71')](function(_0xbe871a){return _0x10c044[_0xb6dd('0x6a')](_0x3ad4fc,{'transaction':_0xbe871a})['then'](function(){return BPromise['each'](_0xd0d196,function(_0x14ec80){return db[_0xb6dd('0x60')][_0xb6dd('0x72')]({'where':{'UserId':_0x14ec80['id'],'ChatQueueId':_0x460028['params']['id']},'transaction':_0xbe871a});});})[_0xb6dd('0x1c')](function(){_0xd0d196['forEach'](function(_0x5156de){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':_0x5156de['id'],'ChatQueueId':_0x10c044['id']});});});});});}})['then'](respondWithStatusCode(_0x1fafe9,null))[_0xb6dd('0x25')](handleError(_0x1fafe9,null));};exports['removeTeams']=function(_0x21b78c,_0x46c7e2,_0x1d2be9){return db[_0xb6dd('0x6c')]['findAll']({'where':{'id':_0x21b78c[_0xb6dd('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb6dd('0x63')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46c7e2,null))['then'](function(_0x1006e1){var _0x310222=_[_0xb6dd('0x36')](_0x1006e1,'id');var _0x1dabba=[];var _0xcd75d7=[];var _0x1c92ec=squel['select']();_0x1c92ec[_0xb6dd('0x75')](_0xb6dd('0x76'))['from']('team_has_chat_queues','tq')[_0xb6dd('0x77')](_0xb6dd('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xb6dd('0x46')](_0xb6dd('0x79'),_0x21b78c[_0xb6dd('0x50')]['id']);for(var _0x35d5f7=0x0;_0x35d5f7<_0x1006e1[_0xb6dd('0x42')];_0x35d5f7+=0x1){let _0x4f9a7=_0x1006e1[_0x35d5f7];for(var _0x2dc497=0x0;_0x2dc497<_0x4f9a7['Agents'][_0xb6dd('0x42')];_0x2dc497+=0x1){let _0x4d2909=_0x4f9a7[_0xb6dd('0x6d')][_0x2dc497];var _0x41cee7=_0x1c92ec['clone']();_0x41cee7[_0xb6dd('0x46')](_0xb6dd('0x7a'),_0x4d2909['id']);_0xcd75d7[_0xb6dd('0x7b')](db['sequelize']['query'](_0x41cee7['toString'](),{'type':db[_0xb6dd('0x70')][_0xb6dd('0x7c')]['SELECT']})[_0xb6dd('0x1c')](function(_0x39c09b){if(_0x39c09b[_0xb6dd('0x42')]===0x1){return _0x4d2909['id'];}else{var _0x33b2e4=_['every'](_[_0xb6dd('0x36')](_0x39c09b,_0xb6dd('0x7d')),function(_0x4419f0){return _[_0xb6dd('0x7e')](_0x310222,_0x4419f0);});if(_0x33b2e4){return _0x4d2909['id'];}}}));}}return BPromise['all'](_0xcd75d7)['then'](function(_0x4871b9){_0x1dabba=_(_0x1dabba)['union'](_0x4871b9)[_0xb6dd('0x7f')]()['value']();return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x21b78c['params']['id']}})[_0xb6dd('0x1c')](function(_0x3fd1c5){return db['sequelize'][_0xb6dd('0x71')](function(_0x1d61b6){return _0x3fd1c5[_0xb6dd('0x80')](_0x21b78c[_0xb6dd('0x3e')][_0xb6dd('0x6b')],{'transaction':_0x1d61b6})['then'](function(){if(!_['isEmpty'](_0x1dabba)){return _0x3fd1c5[_0xb6dd('0x81')](_0x1dabba,{'transaction':_0x1d61b6});}})['then'](function(){_0x1dabba[_0xb6dd('0x82')](function(_0x26cd8d){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':_0x26cd8d,'ChatQueueId':_0x3fd1c5['id']});});});});});});})[_0xb6dd('0x1c')](respondWithStatusCode(_0x46c7e2,null))[_0xb6dd('0x25')](handleError(_0x46c7e2,null));};exports[_0xb6dd('0x84')]=function(_0x993cbd,_0x52688a,_0x540f73){return db[_0xb6dd('0x37')]['find']({'where':{'id':_0x993cbd[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x52688a,null))['then'](function(_0x42b31e){if(_0x42b31e){return _0x42b31e[_0xb6dd('0x84')](_0x993cbd[_0xb6dd('0x53')]['ids'],_['omit'](_0x993cbd[_0xb6dd('0x53')],[_0xb6dd('0x6b'),'id'])||{})[_0xb6dd('0x85')](function(_0xfbfc6d){for(var _0x197c8c=0x0;_0x197c8c<_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x197c8c+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x74'),{'UserId':Number(_0x993cbd[_0xb6dd('0x53')][_0xb6dd('0x6b')][_0x197c8c]),'ChatQueueId':Number(_0x993cbd[_0xb6dd('0x50')]['id'])});}return _0xfbfc6d;});}})[_0xb6dd('0x1c')](respondWithResult(_0x52688a,null))[_0xb6dd('0x25')](handleError(_0x52688a,null));};exports[_0xb6dd('0x81')]=function(_0x1a0309,_0x230619,_0x3ea4e3){return db['ChatQueue'][_0xb6dd('0x51')]({'where':{'id':_0x1a0309[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x230619,null))[_0xb6dd('0x1c')](function(_0x375f4d){if(_0x375f4d){return _0x375f4d[_0xb6dd('0x81')](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])[_0xb6dd('0x1c')](function(){if(_['isArray'](_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')])){for(var _0x3dd365=0x0;_0x3dd365<_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')][_0xb6dd('0x42')];_0x3dd365+=0x1){socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309['query']['ids'][_0x3dd365]),'ChatQueueId':Number(_0x1a0309['params']['id'])});}}else{socket[_0xb6dd('0x73')](_0xb6dd('0x83'),{'UserId':Number(_0x1a0309[_0xb6dd('0x3e')][_0xb6dd('0x6b')]),'ChatQueueId':Number(_0x1a0309[_0xb6dd('0x50')]['id'])});}});}})[_0xb6dd('0x1c')](respondWithStatusCode(_0x230619,null))[_0xb6dd('0x25')](handleError(_0x230619,null));};exports[_0xb6dd('0x86')]=function(_0x6a6cb3,_0x39185d,_0x439247){var _0x3343cb={};var _0x3345f5={};var _0x49f929;var _0x38816f;return db[_0xb6dd('0x37')][_0xb6dd('0x5f')]({'where':{'id':_0x6a6cb3[_0xb6dd('0x50')]['id']}})[_0xb6dd('0x1c')](handleEntityNotFound(_0x39185d,null))[_0xb6dd('0x1c')](function(_0x5ced20){if(_0x5ced20){_0x49f929=_0x5ced20;_0x3345f5[_0xb6dd('0x3a')]=_[_0xb6dd('0x3c')](db[_0xb6dd('0x63')][_0xb6dd('0x38')]);_0x3345f5[_0xb6dd('0x3e')]=_[_0xb6dd('0x3c')](_0x6a6cb3[_0xb6dd('0x3e')]);_0x3345f5[_0xb6dd('0x3d')]=_[_0xb6dd('0x40')](_0x3345f5[_0xb6dd('0x3a')],_0x3345f5['query']);_0x3343cb[_0xb6dd('0x3f')]=_['intersection'](_0x3345f5[_0xb6dd('0x3a')],qs['fields'](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x41')]));_0x3343cb[_0xb6dd('0x3f')]=_0x3343cb['attributes'][_0xb6dd('0x42')]?_0x3343cb[_0xb6dd('0x3f')]:_0x3345f5[_0xb6dd('0x3a')];_0x3343cb['order']=qs[_0xb6dd('0x45')](_0x6a6cb3[_0xb6dd('0x3e')]['sort']);_0x3343cb['where']=qs[_0xb6dd('0x3d')](_[_0xb6dd('0x47')](_0x6a6cb3['query'],_0x3345f5['filters']));if(_0x6a6cb3[_0xb6dd('0x3e')]['filter']){_0x3343cb[_0xb6dd('0x46')]=_[_0xb6dd('0x49')](_0x3343cb['where'],{'$or':_[_0xb6dd('0x36')](_0x3343cb[_0xb6dd('0x3f')],function(_0x35b745){var _0x254592={};_0x254592[_0x35b745]={'$like':'%'+_0x6a6cb3['query'][_0xb6dd('0x48')]+'%'};return _0x254592;})});}_0x3343cb=_['merge']({},_0x3343cb,_0x6a6cb3[_0xb6dd('0x4b')]);return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})['then'](function(_0x5bd415){if(_0x5bd415){_0x38816f=_0x5bd415[_0xb6dd('0x42')];if(!_0x6a6cb3['query'][_0xb6dd('0x43')](_0xb6dd('0x44'))){_0x3343cb[_0xb6dd('0x2a')]=qs[_0xb6dd('0x2a')](_0x6a6cb3['query'][_0xb6dd('0x2a')]);_0x3343cb[_0xb6dd('0x2c')]=qs[_0xb6dd('0x2c')](_0x6a6cb3[_0xb6dd('0x3e')][_0xb6dd('0x2c')]);}return _0x49f929[_0xb6dd('0x86')](_0x3343cb);}})[_0xb6dd('0x1c')](function(_0x3764ac){if(_0x3764ac){return _0x3764ac?{'count':_0x38816f,'rows':_0x3764ac}:null;}})[_0xb6dd('0x1c')](respondWithResult(_0x39185d,null))[_0xb6dd('0x25')](handleError(_0x39185d,null));};
\ No newline at end of file
+var _0xbfca=['stack','name','send','index','ChatQueue','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','rows','show','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','team_has_chat_queues','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','includes','union','compact','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','ChatQueues','UserProfileResource'];(function(_0x4c340b,_0x59eadb){var _0x7e853b=function(_0x470caa){while(--_0x470caa){_0x4c340b['push'](_0x4c340b['shift']());}};_0x7e853b(++_0x59eadb);}(_0xbfca,0x188));var _0xabfc=function(_0x1196e9,_0x4d9507){_0x1196e9=_0x1196e9-0x0;var _0x14bd83=_0xbfca[_0x1196e9];return _0x14bd83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xabfc('0x0'));var zipdir=require(_0xabfc('0x1'));var jsonpatch=require(_0xabfc('0x2'));var rp=require(_0xabfc('0x3'));var moment=require(_0xabfc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xabfc('0x5'));var path=require('path');var sox=require(_0xabfc('0x6'));var csv=require(_0xabfc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabfc('0x8'));var _=require(_0xabfc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xabfc('0xa'));var deskjs=require(_0xabfc('0xb'));var toCsv=require(_0xabfc('0x7'));var querystring=require(_0xabfc('0xc'));var Papa=require(_0xabfc('0xd'));var Redis=require(_0xabfc('0xe'));var authService=require(_0xabfc('0xf'));var qs=require(_0xabfc('0x10'));var as=require(_0xabfc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabfc('0x12'))(_0xabfc('0x13'));var utils=require(_0xabfc('0x14'));var config=require(_0xabfc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xabfc('0x16'))['db'];config[_0xabfc('0x17')]=_[_0xabfc('0x18')](config[_0xabfc('0x17')],{'host':_0xabfc('0x19'),'port':0x18eb});var socket=require(_0xabfc('0x1a'))(new Redis(config[_0xabfc('0x17')]));require(_0xabfc('0x1b'))['register'](socket);var jayson=require(_0xabfc('0x1c'));var client=jayson[_0xabfc('0x1d')][_0xabfc('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x46805f,_0x2091f8,_0x58d9e4,_0x56db32){return new BPromise(function(_0xdfa33c,_0x2e1cc2){var _0x30be0f=_0x56db32||client;return _0x30be0f[_0xabfc('0x1f')](_0x46805f,_0x58d9e4)[_0xabfc('0x20')](function(_0x2f01f0){logger['info'](_0xabfc('0x21'),_0x2091f8,_0xabfc('0x22'));logger['debug'](_0xabfc('0x23'),_0x2091f8,_0xabfc('0x22'),JSON['stringify'](_0x2f01f0));if(_0x2f01f0['error']){if(_0x2f01f0[_0xabfc('0x24')][_0xabfc('0x25')]===0x1f4){logger[_0xabfc('0x24')](_0xabfc('0x21'),_0x2091f8,_0x2f01f0[_0xabfc('0x24')][_0xabfc('0x26')]);return _0x2e1cc2(_0x2f01f0[_0xabfc('0x24')][_0xabfc('0x26')]);}logger['error'](_0xabfc('0x21'),_0x2091f8,_0x2f01f0[_0xabfc('0x24')][_0xabfc('0x26')]);return _0xdfa33c(_0x2f01f0[_0xabfc('0x24')][_0xabfc('0x26')]);}else{logger[_0xabfc('0x27')](_0xabfc('0x21'),_0x2091f8,_0xabfc('0x22'));_0xdfa33c(_0x2f01f0[_0xabfc('0x28')][_0xabfc('0x26')]);}})[_0xabfc('0x29')](function(_0x456dec){logger[_0xabfc('0x24')](_0xabfc('0x21'),_0x2091f8,_0x456dec);_0x2e1cc2(_0x456dec);});});}function respondWithStatusCode(_0x3339bc,_0x42ccc4){_0x42ccc4=_0x42ccc4||0xcc;return function(_0x2f1db9){if(_0x2f1db9){return _0x3339bc[_0xabfc('0x2a')](_0x42ccc4);}return _0x3339bc[_0xabfc('0x2b')](_0x42ccc4)[_0xabfc('0x2c')]();};}function respondWithResult(_0x5309f5,_0x49a84f){_0x49a84f=_0x49a84f||0xc8;return function(_0x243432){if(_0x243432){return _0x5309f5[_0xabfc('0x2b')](_0x49a84f)['json'](_0x243432);}};}function respondWithFilteredResult(_0x337bf7,_0x43f5a1){return function(_0x593cc9){if(_0x593cc9){var _0x1e36cf=typeof _0x43f5a1[_0xabfc('0x2d')]===_0xabfc('0x2e')&&typeof _0x43f5a1[_0xabfc('0x2f')]===_0xabfc('0x2e');var _0x2a3546=_0x593cc9[_0xabfc('0x30')];var _0x3160f3=_0x1e36cf?0x0:_0x43f5a1[_0xabfc('0x2d')];var _0x491032=_0x1e36cf?_0x593cc9[_0xabfc('0x30')]:_0x43f5a1[_0xabfc('0x2d')]+_0x43f5a1[_0xabfc('0x2f')];var _0x2aef89;if(_0x491032>=_0x2a3546){_0x491032=_0x2a3546;_0x2aef89=0xc8;}else{_0x2aef89=0xce;}_0x337bf7['status'](_0x2aef89);return _0x337bf7[_0xabfc('0x31')](_0xabfc('0x32'),_0x3160f3+'-'+_0x491032+'/'+_0x2a3546)[_0xabfc('0x33')](_0x593cc9);}return null;};}function patchUpdates(_0x77575e){return function(_0x47463b){try{jsonpatch['apply'](_0x47463b,_0x77575e,!![]);}catch(_0x47f570){return BPromise[_0xabfc('0x34')](_0x47f570);}return _0x47463b[_0xabfc('0x35')]();};}function saveUpdates(_0x39b5cc,_0x3e7184){return function(_0xeb4b8d){if(_0xeb4b8d){return _0xeb4b8d[_0xabfc('0x36')](_0x39b5cc)['then'](function(_0x5557fe){return _0x5557fe;});}return null;};}function removeEntity(_0x261bc4,_0x1a9460){return function(_0x1cd800){if(_0x1cd800){return _0x1cd800[_0xabfc('0x37')]()['then'](function(){var _0x328bb0=_0x1cd800['get']({'plain':!![]});var _0x333d00=_0xabfc('0x38');return db[_0xabfc('0x39')][_0xabfc('0x37')]({'where':{'type':_0x333d00,'resourceId':_0x328bb0['id']}})[_0xabfc('0x20')](function(){return _0x1cd800;});})['then'](function(){_0x261bc4[_0xabfc('0x2b')](0xcc)[_0xabfc('0x2c')]();});}};}function handleEntityNotFound(_0x2975c8,_0x382b4e){return function(_0x328a33){if(!_0x328a33){_0x2975c8['sendStatus'](0x194);}return _0x328a33;};}function handleError(_0x499d1e,_0x562482){_0x562482=_0x562482||0x1f4;return function(_0x527796){logger['error'](_0x527796[_0xabfc('0x3a')]);if(_0x527796[_0xabfc('0x3b')]){delete _0x527796['name'];}_0x499d1e[_0xabfc('0x2b')](_0x562482)[_0xabfc('0x3c')](_0x527796);};}exports[_0xabfc('0x3d')]=function(_0x15c232,_0x2bc069){var _0x3d819a={},_0x552159={},_0xa1d8c8={'count':0x0,'rows':[]};var _0x4e428e=_['map'](db[_0xabfc('0x3e')]['rawAttributes'],function(_0x53cd1b){return{'name':_0x53cd1b['fieldName'],'type':_0x53cd1b['type'][_0xabfc('0x3f')]};});_0x552159[_0xabfc('0x40')]=_[_0xabfc('0x41')](_0x4e428e,_0xabfc('0x3b'));_0x552159[_0xabfc('0x42')]=_[_0xabfc('0x43')](_0x15c232[_0xabfc('0x42')]);_0x552159[_0xabfc('0x44')]=_[_0xabfc('0x45')](_0x552159['model'],_0x552159[_0xabfc('0x42')]);_0x3d819a[_0xabfc('0x46')]=_['intersection'](_0x552159['model'],qs['fields'](_0x15c232[_0xabfc('0x42')][_0xabfc('0x47')]));_0x3d819a[_0xabfc('0x46')]=_0x3d819a[_0xabfc('0x46')][_0xabfc('0x48')]?_0x3d819a[_0xabfc('0x46')]:_0x552159[_0xabfc('0x40')];if(!_0x15c232[_0xabfc('0x42')][_0xabfc('0x49')](_0xabfc('0x4a'))){_0x3d819a[_0xabfc('0x2f')]=qs['limit'](_0x15c232[_0xabfc('0x42')][_0xabfc('0x2f')]);_0x3d819a['offset']=qs[_0xabfc('0x2d')](_0x15c232[_0xabfc('0x42')][_0xabfc('0x2d')]);}_0x3d819a[_0xabfc('0x4b')]=qs[_0xabfc('0x4c')](_0x15c232[_0xabfc('0x42')][_0xabfc('0x4c')]);_0x3d819a[_0xabfc('0x4d')]=qs['filters'](_[_0xabfc('0x4e')](_0x15c232['query'],_0x552159[_0xabfc('0x44')]),_0x4e428e);if(_0x15c232[_0xabfc('0x42')]['filter']){_0x3d819a['where']=_['merge'](_0x3d819a[_0xabfc('0x4d')],{'$or':_['map'](_0x4e428e,function(_0x403fb2){if(_0x403fb2['type']!==_0xabfc('0x4f')){var _0x200da8={};_0x200da8[_0x403fb2[_0xabfc('0x3b')]]={'$like':'%'+_0x15c232[_0xabfc('0x42')][_0xabfc('0x50')]+'%'};return _0x200da8;}})});}_0x3d819a=_[_0xabfc('0x51')]({},_0x3d819a,_0x15c232[_0xabfc('0x52')]);var _0x1f2cd1={'where':_0x3d819a['where']};return db[_0xabfc('0x3e')][_0xabfc('0x30')](_0x1f2cd1)[_0xabfc('0x20')](function(_0x1f11ed){_0xa1d8c8[_0xabfc('0x30')]=_0x1f11ed;if(_0x15c232[_0xabfc('0x42')][_0xabfc('0x53')]){_0x3d819a['include']=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3d819a);})[_0xabfc('0x20')](function(_0x3cfa21){_0xa1d8c8[_0xabfc('0x54')]=_0x3cfa21;return _0xa1d8c8;})[_0xabfc('0x20')](respondWithFilteredResult(_0x2bc069,_0x3d819a))[_0xabfc('0x29')](handleError(_0x2bc069,null));};exports[_0xabfc('0x55')]=function(_0x2d3d25,_0x211958){var _0x2b37cc={'raw':!![],'where':{'id':_0x2d3d25['params']['id']}},_0x45a997={};_0x45a997[_0xabfc('0x40')]=_[_0xabfc('0x43')](db[_0xabfc('0x3e')][_0xabfc('0x56')]);_0x45a997[_0xabfc('0x42')]=_['keys'](_0x2d3d25[_0xabfc('0x42')]);_0x45a997[_0xabfc('0x44')]=_[_0xabfc('0x45')](_0x45a997[_0xabfc('0x40')],_0x45a997[_0xabfc('0x42')]);_0x2b37cc[_0xabfc('0x46')]=_['intersection'](_0x45a997[_0xabfc('0x40')],qs[_0xabfc('0x47')](_0x2d3d25[_0xabfc('0x42')][_0xabfc('0x47')]));_0x2b37cc['attributes']=_0x2b37cc[_0xabfc('0x46')][_0xabfc('0x48')]?_0x2b37cc[_0xabfc('0x46')]:_0x45a997[_0xabfc('0x40')];if(_0x2d3d25[_0xabfc('0x42')][_0xabfc('0x53')]){_0x2b37cc[_0xabfc('0x57')]=[{'all':!![]}];}_0x2b37cc=_[_0xabfc('0x51')]({},_0x2b37cc,_0x2d3d25[_0xabfc('0x52')]);return db['ChatQueue'][_0xabfc('0x58')](_0x2b37cc)['then'](handleEntityNotFound(_0x211958,null))['then'](respondWithResult(_0x211958,null))[_0xabfc('0x29')](handleError(_0x211958,null));};exports[_0xabfc('0x59')]=function(_0xa7a9e2,_0x24d54f){return db[_0xabfc('0x3e')][_0xabfc('0x59')](_0xa7a9e2[_0xabfc('0x5a')],{})[_0xabfc('0x20')](function(_0x3f18d4){var _0x18bb45=_0xa7a9e2[_0xabfc('0x5b')][_0xabfc('0x5c')]({'plain':!![]});if(!_0x18bb45)throw new Error(_0xabfc('0x5d'));if(_0x18bb45['role']===_0xabfc('0x5b')){var _0x1fa4cb=_0x3f18d4['get']({'plain':!![]});var _0x46988f=_0xabfc('0x38');return db[_0xabfc('0x5e')][_0xabfc('0x58')]({'where':{'name':_0x46988f,'userProfileId':_0x18bb45[_0xabfc('0x5f')]},'raw':!![]})[_0xabfc('0x20')](function(_0x3c6a3e){if(_0x3c6a3e&&_0x3c6a3e[_0xabfc('0x60')]===0x0){return db[_0xabfc('0x39')][_0xabfc('0x59')]({'name':_0x1fa4cb['name'],'resourceId':_0x1fa4cb['id'],'type':_0x3c6a3e[_0xabfc('0x3b')],'sectionId':_0x3c6a3e['id']},{})['then'](function(){return _0x3f18d4;});}else{return _0x3f18d4;}})[_0xabfc('0x29')](function(_0x54ad61){logger[_0xabfc('0x24')](_0xabfc('0x61'),_0x54ad61);throw _0x54ad61;});}return _0x3f18d4;})[_0xabfc('0x20')](respondWithResult(_0x24d54f,0xc9))[_0xabfc('0x29')](handleError(_0x24d54f,null));};exports['update']=function(_0x2a39dd,_0x33cb3b){if(_0x2a39dd['body']['id']){delete _0x2a39dd[_0xabfc('0x5a')]['id'];}return db[_0xabfc('0x3e')][_0xabfc('0x58')]({'where':{'id':_0x2a39dd[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x33cb3b,null))[_0xabfc('0x20')](saveUpdates(_0x2a39dd[_0xabfc('0x5a')],null))[_0xabfc('0x20')](respondWithResult(_0x33cb3b,null))[_0xabfc('0x29')](handleError(_0x33cb3b,null));};exports['destroy']=function(_0x3b0406,_0x107590){return db[_0xabfc('0x3e')][_0xabfc('0x58')]({'where':{'id':_0x3b0406[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x107590,null))[_0xabfc('0x20')](removeEntity(_0x107590,null))[_0xabfc('0x29')](handleError(_0x107590,null));};exports[_0xabfc('0x63')]=function(_0x115c98,_0x24bbb8){return db[_0xabfc('0x3e')]['describe']()[_0xabfc('0x20')](respondWithResult(_0x24bbb8,null))[_0xabfc('0x29')](handleError(_0x24bbb8,null));};exports[_0xabfc('0x64')]=function(_0x53f905,_0x3c8fc6,_0x1f4c89){var _0x1b1a9f={'raw':!![],'where':{}},_0x5e3319={},_0x25b5b1;return db[_0xabfc('0x3e')][_0xabfc('0x65')]({'where':{'id':_0x53f905['params']['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x3c8fc6,null))[_0xabfc('0x20')](function(_0x58dca6){if(_0x58dca6){_0x25b5b1=_0x58dca6['get']({'plain':!![]});_0x5e3319['model']=_[_0xabfc('0x43')](db[_0xabfc('0x66')][_0xabfc('0x56')]);_0x5e3319['query']=_[_0xabfc('0x43')](_0x53f905[_0xabfc('0x42')]);_0x5e3319['filters']=_[_0xabfc('0x45')](_0x5e3319[_0xabfc('0x40')],_0x5e3319['query']);_0x1b1a9f[_0xabfc('0x46')]=_[_0xabfc('0x45')](_0x5e3319['model'],qs['fields'](_0x53f905[_0xabfc('0x42')][_0xabfc('0x47')]));_0x1b1a9f['attributes']=_0x1b1a9f['attributes'][_0xabfc('0x48')]?_0x1b1a9f['attributes']:_0x5e3319[_0xabfc('0x40')];if(!_0x53f905[_0xabfc('0x42')][_0xabfc('0x49')](_0xabfc('0x4a'))){_0x1b1a9f[_0xabfc('0x2f')]=qs[_0xabfc('0x2f')](_0x53f905[_0xabfc('0x42')][_0xabfc('0x2f')]);_0x1b1a9f[_0xabfc('0x2d')]=qs[_0xabfc('0x2d')](_0x53f905[_0xabfc('0x42')][_0xabfc('0x2d')]);}_0x1b1a9f[_0xabfc('0x4b')]=qs[_0xabfc('0x4c')](_0x53f905['query'][_0xabfc('0x4c')]);_0x1b1a9f['where']=qs['filters'](_[_0xabfc('0x4e')](_0x53f905['query'],_0x5e3319[_0xabfc('0x44')]));_0x1b1a9f[_0xabfc('0x4d')][_0xabfc('0x67')]=_0x58dca6['id'];if(_0x53f905[_0xabfc('0x42')][_0xabfc('0x50')]){_0x1b1a9f[_0xabfc('0x4d')]=_[_0xabfc('0x51')](_0x1b1a9f['where'],{'$or':_[_0xabfc('0x41')](_0x1b1a9f['attributes'],function(_0xcd9e9){var _0x12ed47={};_0x12ed47[_0xcd9e9]={'$like':'%'+_0x53f905[_0xabfc('0x42')][_0xabfc('0x50')]+'%'};return _0x12ed47;})});}_0x1b1a9f=_['merge']({},_0x1b1a9f,_0x53f905[_0xabfc('0x52')]);return db['UserChatQueue']['findAll'](_0x1b1a9f);}})[_0xabfc('0x20')](function(_0x292ca4){if(_0x292ca4){return db[_0xabfc('0x68')][_0xabfc('0x69')]({'where':{'id':_[_0xabfc('0x41')](_0x292ca4,_0xabfc('0x6a')),'role':'agent'},'attributes':['id',_0xabfc('0x3b'),_0xabfc('0x6b'),'updatedAt',_0xabfc('0x6c')]});}})[_0xabfc('0x20')](function(_0x4da49c){if(_0x4da49c){return{'count':_0x4da49c[_0xabfc('0x30')],'rows':_[_0xabfc('0x41')](_0x4da49c[_0xabfc('0x54')],function(_0x9e1535){return{'membername':_0x9e1535[_0xabfc('0x3b')],'UserId':_0x9e1535['id'],'queue_name':_0x25b5b1['name'],'ChatQueueId':_0x25b5b1['id'],'interface':util[_0xabfc('0x6d')](_0xabfc('0x6e'),_0xabfc('0x6f'),_0x9e1535['name']),'penalty':0x0,'paused':_0x9e1535[_0xabfc('0x6b')],'createdAt':_0x9e1535[_0xabfc('0x6c')],'updatedAt':_0x9e1535[_0xabfc('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xabfc('0x20')](respondWithFilteredResult(_0x3c8fc6,_0x1b1a9f))[_0xabfc('0x29')](handleError(_0x3c8fc6,null));};exports[_0xabfc('0x71')]=function(_0x43c794,_0x41b83f,_0x582062){var _0xca50c1={};var _0x3f1636={};var _0x31467e;var _0x42e429;return db[_0xabfc('0x3e')]['findOne']({'where':{'id':_0x43c794[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x41b83f,null))['then'](function(_0x4baa82){if(_0x4baa82){_0x31467e=_0x4baa82;_0x3f1636[_0xabfc('0x40')]=_['keys'](db[_0xabfc('0x72')][_0xabfc('0x56')]);_0x3f1636['query']=_[_0xabfc('0x43')](_0x43c794['query']);_0x3f1636['filters']=_[_0xabfc('0x45')](_0x3f1636[_0xabfc('0x40')],_0x3f1636['query']);_0xca50c1[_0xabfc('0x46')]=_[_0xabfc('0x45')](_0x3f1636['model'],qs[_0xabfc('0x47')](_0x43c794[_0xabfc('0x42')][_0xabfc('0x47')]));_0xca50c1[_0xabfc('0x46')]=_0xca50c1[_0xabfc('0x46')][_0xabfc('0x48')]?_0xca50c1[_0xabfc('0x46')]:_0x3f1636['model'];_0xca50c1['order']=qs[_0xabfc('0x4c')](_0x43c794[_0xabfc('0x42')][_0xabfc('0x4c')]);_0xca50c1['where']=qs['filters'](_['pick'](_0x43c794[_0xabfc('0x42')],_0x3f1636[_0xabfc('0x44')]));if(_0x43c794[_0xabfc('0x42')]['filter']){_0xca50c1[_0xabfc('0x4d')]=_[_0xabfc('0x51')](_0xca50c1['where'],{'$or':_['map'](_0xca50c1[_0xabfc('0x46')],function(_0x34035b){var _0x5ca6cf={};_0x5ca6cf[_0x34035b]={'$like':'%'+_0x43c794[_0xabfc('0x42')][_0xabfc('0x50')]+'%'};return _0x5ca6cf;})});}_0xca50c1=_[_0xabfc('0x51')]({},_0xca50c1,_0x43c794[_0xabfc('0x52')]);return _0x31467e['getTeams'](_0xca50c1);}})[_0xabfc('0x20')](function(_0x336372){if(_0x336372){_0x42e429=_0x336372[_0xabfc('0x48')];if(!_0x43c794[_0xabfc('0x42')][_0xabfc('0x49')](_0xabfc('0x4a'))){_0xca50c1[_0xabfc('0x2f')]=qs[_0xabfc('0x2f')](_0x43c794['query']['limit']);_0xca50c1['offset']=qs['offset'](_0x43c794[_0xabfc('0x42')][_0xabfc('0x2d')]);}return _0x31467e[_0xabfc('0x71')](_0xca50c1);}})[_0xabfc('0x20')](function(_0x55f7d5){if(_0x55f7d5){return _0x55f7d5?{'count':_0x42e429,'rows':_0x55f7d5}:null;}})['then'](respondWithResult(_0x41b83f,null))[_0xabfc('0x29')](handleError(_0x41b83f,null));};exports[_0xabfc('0x73')]=function(_0x1b84df,_0x20ba45,_0x516b7f){var _0x2bd29a=_0x1b84df[_0xabfc('0x5a')]['ids'];return db['Team'][_0xabfc('0x74')]({'where':{'id':_0x2bd29a},'attributes':['id'],'include':[{'model':db[_0xabfc('0x68')],'as':_0xabfc('0x75'),'attributes':['id','name',_0xabfc('0x76'),_0xabfc('0x77'),_0xabfc('0x78')],'raw':!![]}]})[_0xabfc('0x20')](function(_0x2f78d1){if(_0x2f78d1){var _0x22e3da=_[_0xabfc('0x79')](_0x2f78d1,function(_0x163314){var _0x1cbf08=_0x163314[_0xabfc('0x5c')]({'plain':!![]});return _0x1cbf08['Agents'];});return db[_0xabfc('0x3e')][_0xabfc('0x58')]({'where':{'id':_0x1b84df[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](function(_0x559890){return db[_0xabfc('0x7a')][_0xabfc('0x7b')](function(_0xe12451){return _0x559890[_0xabfc('0x73')](_0x2bd29a,{'transaction':_0xe12451})[_0xabfc('0x20')](function(){return BPromise[_0xabfc('0x7c')](_0x22e3da,function(_0x2eab1f){return db[_0xabfc('0x66')][_0xabfc('0x7d')]({'where':{'UserId':_0x2eab1f['id'],'ChatQueueId':_0x1b84df[_0xabfc('0x62')]['id']},'transaction':_0xe12451});});})[_0xabfc('0x20')](function(){_0x22e3da[_0xabfc('0x7e')](function(_0x508643){socket[_0xabfc('0x7f')](_0xabfc('0x80'),{'UserId':_0x508643['id'],'ChatQueueId':_0x559890['id']});});});});});}})['then'](respondWithStatusCode(_0x20ba45,null))['catch'](handleError(_0x20ba45,null));};exports[_0xabfc('0x81')]=function(_0x6a064,_0x46a355,_0x182351){return db['Team']['findAll']({'where':{'id':_0x6a064[_0xabfc('0x42')][_0xabfc('0x82')]},'attributes':['id'],'include':[{'model':db[_0xabfc('0x68')],'as':_0xabfc('0x75'),'attributes':['id'],'raw':!![]}]})[_0xabfc('0x20')](handleEntityNotFound(_0x46a355,null))[_0xabfc('0x20')](function(_0x39629f){var _0x813c65=_[_0xabfc('0x41')](_0x39629f,'id');var _0x1e2db5=[];var _0x39e1c2=[];var _0x2c35c8=squel[_0xabfc('0x83')]();_0x2c35c8['field'](_0xabfc('0x84'))['from'](_0xabfc('0x85'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xabfc('0x86'),_0x6a064[_0xabfc('0x62')]['id']);for(var _0x4e03b7=0x0;_0x4e03b7<_0x39629f[_0xabfc('0x48')];_0x4e03b7+=0x1){let _0x303fb6=_0x39629f[_0x4e03b7];for(var _0x57e562=0x0;_0x57e562<_0x303fb6['Agents'][_0xabfc('0x48')];_0x57e562+=0x1){let _0x37da88=_0x303fb6[_0xabfc('0x75')][_0x57e562];var _0x4175d1=_0x2c35c8['clone']();_0x4175d1[_0xabfc('0x4d')](_0xabfc('0x87'),_0x37da88['id']);_0x39e1c2[_0xabfc('0x88')](db[_0xabfc('0x7a')][_0xabfc('0x42')](_0x4175d1[_0xabfc('0x89')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xabfc('0x20')](function(_0x27d9ea){if(_0x27d9ea[_0xabfc('0x48')]===0x1){return _0x37da88['id'];}else{var _0x3f0cfe=_[_0xabfc('0x8a')](_[_0xabfc('0x41')](_0x27d9ea,'TeamId'),function(_0x4c5ff2){return _[_0xabfc('0x8b')](_0x813c65,_0x4c5ff2);});if(_0x3f0cfe){return _0x37da88['id'];}}}));}}return BPromise['all'](_0x39e1c2)[_0xabfc('0x20')](function(_0x4849ca){_0x1e2db5=_(_0x1e2db5)[_0xabfc('0x8c')](_0x4849ca)[_0xabfc('0x8d')]()['value']();return db[_0xabfc('0x3e')]['find']({'where':{'id':_0x6a064[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](function(_0x12db04){return db[_0xabfc('0x7a')][_0xabfc('0x7b')](function(_0x1fcce8){return _0x12db04['removeTeams'](_0x6a064[_0xabfc('0x42')][_0xabfc('0x82')],{'transaction':_0x1fcce8})['then'](function(){if(!_[_0xabfc('0x8e')](_0x1e2db5)){return _0x12db04['removeAgents'](_0x1e2db5,{'transaction':_0x1fcce8});}})['then'](function(){_0x1e2db5[_0xabfc('0x7e')](function(_0x54b3ac){socket['emit'](_0xabfc('0x8f'),{'UserId':_0x54b3ac,'ChatQueueId':_0x12db04['id']});});});});});});})['then'](respondWithStatusCode(_0x46a355,null))[_0xabfc('0x29')](handleError(_0x46a355,null));};exports[_0xabfc('0x90')]=function(_0x4c2077,_0x60232c,_0x5c4d80){return db['ChatQueue']['find']({'where':{'id':_0x4c2077['params']['id']}})['then'](handleEntityNotFound(_0x60232c,null))['then'](function(_0x5b39cc){if(_0x5b39cc){return _0x5b39cc[_0xabfc('0x90')](_0x4c2077[_0xabfc('0x5a')][_0xabfc('0x82')],_[_0xabfc('0x91')](_0x4c2077[_0xabfc('0x5a')],['ids','id'])||{})[_0xabfc('0x92')](function(_0x3f66f3){for(var _0x4daf47=0x0;_0x4daf47<_0x4c2077[_0xabfc('0x5a')][_0xabfc('0x82')][_0xabfc('0x48')];_0x4daf47+=0x1){socket[_0xabfc('0x7f')](_0xabfc('0x80'),{'UserId':Number(_0x4c2077[_0xabfc('0x5a')]['ids'][_0x4daf47]),'ChatQueueId':Number(_0x4c2077[_0xabfc('0x62')]['id'])});}return _0x3f66f3;});}})[_0xabfc('0x20')](respondWithResult(_0x60232c,null))[_0xabfc('0x29')](handleError(_0x60232c,null));};exports['removeAgents']=function(_0x240166,_0x3eeaec,_0x3093dc){return db[_0xabfc('0x3e')][_0xabfc('0x58')]({'where':{'id':_0x240166[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x3eeaec,null))['then'](function(_0x5e5620){if(_0x5e5620){return _0x5e5620[_0xabfc('0x93')](_0x240166['query'][_0xabfc('0x82')])[_0xabfc('0x20')](function(){if(_[_0xabfc('0x94')](_0x240166[_0xabfc('0x42')][_0xabfc('0x82')])){for(var _0x41318e=0x0;_0x41318e<_0x240166['query']['ids']['length'];_0x41318e+=0x1){socket[_0xabfc('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x240166['query'][_0xabfc('0x82')][_0x41318e]),'ChatQueueId':Number(_0x240166[_0xabfc('0x62')]['id'])});}}else{socket['emit'](_0xabfc('0x8f'),{'UserId':Number(_0x240166[_0xabfc('0x42')][_0xabfc('0x82')]),'ChatQueueId':Number(_0x240166['params']['id'])});}});}})[_0xabfc('0x20')](respondWithStatusCode(_0x3eeaec,null))['catch'](handleError(_0x3eeaec,null));};exports[_0xabfc('0x95')]=function(_0x34203a,_0x2fae56,_0x292e8e){var _0x1c303d={};var _0x35b484={};var _0xbe8e01;var _0x11aeb2;return db['ChatQueue'][_0xabfc('0x65')]({'where':{'id':_0x34203a[_0xabfc('0x62')]['id']}})[_0xabfc('0x20')](handleEntityNotFound(_0x2fae56,null))[_0xabfc('0x20')](function(_0x3fb93e){if(_0x3fb93e){_0xbe8e01=_0x3fb93e;_0x35b484[_0xabfc('0x40')]=_[_0xabfc('0x43')](db[_0xabfc('0x68')][_0xabfc('0x56')]);_0x35b484[_0xabfc('0x42')]=_['keys'](_0x34203a['query']);_0x35b484[_0xabfc('0x44')]=_[_0xabfc('0x45')](_0x35b484[_0xabfc('0x40')],_0x35b484[_0xabfc('0x42')]);_0x1c303d[_0xabfc('0x46')]=_['intersection'](_0x35b484[_0xabfc('0x40')],qs['fields'](_0x34203a[_0xabfc('0x42')][_0xabfc('0x47')]));_0x1c303d[_0xabfc('0x46')]=_0x1c303d['attributes'][_0xabfc('0x48')]?_0x1c303d[_0xabfc('0x46')]:_0x35b484[_0xabfc('0x40')];_0x1c303d[_0xabfc('0x4b')]=qs['sort'](_0x34203a[_0xabfc('0x42')][_0xabfc('0x4c')]);_0x1c303d['where']=qs[_0xabfc('0x44')](_['pick'](_0x34203a[_0xabfc('0x42')],_0x35b484[_0xabfc('0x44')]));if(_0x34203a['query'][_0xabfc('0x50')]){_0x1c303d[_0xabfc('0x4d')]=_[_0xabfc('0x51')](_0x1c303d[_0xabfc('0x4d')],{'$or':_[_0xabfc('0x41')](_0x1c303d['attributes'],function(_0x511fab){var _0x5cb4a9={};_0x5cb4a9[_0x511fab]={'$like':'%'+_0x34203a[_0xabfc('0x42')][_0xabfc('0x50')]+'%'};return _0x5cb4a9;})});}_0x1c303d=_['merge']({},_0x1c303d,_0x34203a['options']);return _0xbe8e01[_0xabfc('0x95')](_0x1c303d);}})[_0xabfc('0x20')](function(_0xcc7a35){if(_0xcc7a35){_0x11aeb2=_0xcc7a35[_0xabfc('0x48')];if(!_0x34203a[_0xabfc('0x42')][_0xabfc('0x49')](_0xabfc('0x4a'))){_0x1c303d['limit']=qs[_0xabfc('0x2f')](_0x34203a['query'][_0xabfc('0x2f')]);_0x1c303d[_0xabfc('0x2d')]=qs[_0xabfc('0x2d')](_0x34203a[_0xabfc('0x42')]['offset']);}return _0xbe8e01[_0xabfc('0x95')](_0x1c303d);}})[_0xabfc('0x20')](function(_0x734533){if(_0x734533){return _0x734533?{'count':_0x11aeb2,'rows':_0x734533}:null;}})[_0xabfc('0x20')](respondWithResult(_0x2fae56,null))[_0xabfc('0x29')](handleError(_0x2fae56,null));};
\ No newline at end of file
index e35ff64..bca85e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa31c=['update','remove','emit','hook','exports','../../mysqldb','save'];(function(_0x50bffc,_0x8eb3ac){var _0x36747b=function(_0x283736){while(--_0x283736){_0x50bffc['push'](_0x50bffc['shift']());}};_0x36747b(++_0x8eb3ac);}(_0xa31c,0x11d));var _0xca31=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0xa31c[_0x219fa0];return _0xc603fb;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xca31('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca31('0x1'),'afterUpdate':_0xca31('0x2'),'afterDestroy':_0xca31('0x3')};function emitEvent(_0x234c47){return function(_0x95fe68,_0x36282a,_0x21cb6a){ChatQueueEvents[_0xca31('0x4')](_0x234c47+':'+_0x95fe68['id'],_0x95fe68);ChatQueueEvents[_0xca31('0x4')](_0x234c47,_0x95fe68);_0x21cb6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xca31('0x5')](e,emitEvent(event));}}module[_0xca31('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x1246=['hook','events','../../mysqldb','save','update','remove','emit'];(function(_0x718250,_0x412226){var _0xb1138b=function(_0x161bdc){while(--_0x161bdc){_0x718250['push'](_0x718250['shift']());}};_0xb1138b(++_0x412226);}(_0x1246,0x10b));var _0x6124=function(_0x53fa69,_0x585c82){_0x53fa69=_0x53fa69-0x0;var _0x1d25bd=_0x1246[_0x53fa69];return _0x1d25bd;};'use strict';var EventEmitter=require(_0x6124('0x0'));var ChatQueue=require(_0x6124('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6124('0x2'),'afterUpdate':_0x6124('0x3'),'afterDestroy':_0x6124('0x4')};function emitEvent(_0x3ff2bf){return function(_0x30286b,_0x4d34ba,_0x1b5b1b){ChatQueueEvents['emit'](_0x3ff2bf+':'+_0x30286b['id'],_0x30286b);ChatQueueEvents[_0x6124('0x5')](_0x3ff2bf,_0x30286b);_0x1b5b1b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6124('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
index 7485c01..c13a888 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ecb=['./chatQueue.attributes','exports','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x224523,_0x4a351a){var _0x4a1a35=function(_0x342cd1){while(--_0x342cd1){_0x224523['push'](_0x224523['shift']());}};_0x4a1a35(++_0x4a351a);}(_0x5ecb,0x87));var _0xb5ec=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x5ecb[_0x291f8b];return _0x275171;};'use strict';var _=require(_0xb5ec('0x0'));var util=require(_0xb5ec('0x1'));var logger=require(_0xb5ec('0x2'))(_0xb5ec('0x3'));var moment=require(_0xb5ec('0x4'));var BPromise=require(_0xb5ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5ec('0x6'));var rimraf=require(_0xb5ec('0x7'));var config=require(_0xb5ec('0x8'));var attributes=require(_0xb5ec('0x9'));module[_0xb5ec('0xa')]=function(_0x165383,_0x5a706e){return _0x165383['define'](_0xb5ec('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d7f=['define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x30bf4e,_0x59f3a8){var _0x512062=function(_0x3e6c6a){while(--_0x3e6c6a){_0x30bf4e['push'](_0x30bf4e['shift']());}};_0x512062(++_0x59f3a8);}(_0x1d7f,0xfa));var _0xf1d7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1d7f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf1d7('0x0'));var util=require(_0xf1d7('0x1'));var logger=require(_0xf1d7('0x2'))(_0xf1d7('0x3'));var moment=require(_0xf1d7('0x4'));var BPromise=require(_0xf1d7('0x5'));var rp=require(_0xf1d7('0x6'));var fs=require('fs');var path=require(_0xf1d7('0x7'));var rimraf=require('rimraf');var config=require(_0xf1d7('0x8'));var attributes=require('./chatQueue.attributes');module[_0xf1d7('0x9')]=function(_0x4b198f,_0x3fd696){return _0x4b198f[_0xf1d7('0xa')](_0xf1d7('0xb'),attributes,{'tableName':_0xf1d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe292b9..decce55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71af=['attributes','GetChatQueue','ShowChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ChatQueue','findAll','options','raw','where','include','map','model'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0x71af,0x194));var _0xf71a=function(_0x1cb354,_0x5f057d){_0x1cb354=_0x1cb354-0x0;var _0x4f9b3c=_0x71af[_0x1cb354];return _0x4f9b3c;};'use strict';var _=require(_0xf71a('0x0'));var util=require(_0xf71a('0x1'));var moment=require('moment');var BPromise=require(_0xf71a('0x2'));var rs=require(_0xf71a('0x3'));var fs=require('fs');var Redis=require(_0xf71a('0x4'));var db=require(_0xf71a('0x5'))['db'];var utils=require(_0xf71a('0x6'));var logger=require(_0xf71a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf71a('0x8'));var client=jayson[_0xf71a('0x9')][_0xf71a('0xa')]({'port':0x232a});config[_0xf71a('0xb')]=_[_0xf71a('0xc')](config[_0xf71a('0xb')],{'host':_0xf71a('0xd'),'port':0x18eb});var socket=require(_0xf71a('0xe'))(new Redis(config[_0xf71a('0xb')]));require(_0xf71a('0xf'))['register'](socket);function respondWithRpcPromise(_0x318a72,_0xbac86d,_0x53869b){return new BPromise(function(_0x331793,_0x42802f){return client[_0xf71a('0x10')](_0x318a72,_0x53869b)[_0xf71a('0x11')](function(_0x1d9575){logger['info'](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));logger[_0xf71a('0x14')](_0xf71a('0x15'),_0xbac86d,_0xf71a('0x13'),JSON[_0xf71a('0x16')](_0x1d9575));if(_0x1d9575[_0xf71a('0x17')]){if(_0x1d9575[_0xf71a('0x17')][_0xf71a('0x18')]===0x1f4){logger['error'](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x42802f(_0x1d9575[_0xf71a('0x17')]['message']);}logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x1d9575[_0xf71a('0x17')][_0xf71a('0x19')]);return _0x331793(_0x1d9575['error'][_0xf71a('0x19')]);}else{logger[_0xf71a('0x1a')](_0xf71a('0x12'),_0xbac86d,_0xf71a('0x13'));_0x331793(_0x1d9575['result'][_0xf71a('0x19')]);}})[_0xf71a('0x1b')](function(_0x3e61a9){logger[_0xf71a('0x17')](_0xf71a('0x12'),_0xbac86d,_0x3e61a9);_0x42802f(_0x3e61a9);});});}exports['GetChatQueue']=function(_0x189e22){var _0x566b6d=this;return new Promise(function(_0x51ecda,_0x40d8ac){return db[_0xf71a('0x1c')][_0xf71a('0x1d')]({'raw':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x189e22['options']?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')]['attributes']||null:null,'limit':_0x189e22[_0xf71a('0x1e')]?_0x189e22['options']['limit']||null:null,'include':_0x189e22[_0xf71a('0x1e')]?_0x189e22[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x189e22[_0xf71a('0x1e')]['include'],function(_0x596a8a){return{'model':db[_0x596a8a[_0xf71a('0x23')]],'as':_0x596a8a['as'],'attributes':_0x596a8a[_0xf71a('0x24')],'include':_0x596a8a[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x596a8a[_0xf71a('0x21')],function(_0x1351a6){return{'model':db[_0x1351a6[_0xf71a('0x23')]],'as':_0x1351a6['as'],'attributes':_0x1351a6[_0xf71a('0x24')],'include':_0x1351a6[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x1351a6[_0xf71a('0x21')],function(_0x17980a){return{'model':db[_0x17980a['model']],'as':_0x17980a['as'],'attributes':_0x17980a[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x41cdef){logger[_0xf71a('0x1a')]('GetChatQueue',_0x189e22);logger['debug']('GetChatQueue',_0x189e22,JSON['stringify'](_0x41cdef));_0x51ecda(_0x41cdef);})[_0xf71a('0x1b')](function(_0x2836a6){logger[_0xf71a('0x17')](_0xf71a('0x25'),_0x2836a6[_0xf71a('0x19')],_0x189e22);_0x40d8ac(_0x566b6d[_0xf71a('0x17')](0x1f4,_0x2836a6[_0xf71a('0x19')]));});});};exports[_0xf71a('0x26')]=function(_0x5841ea){var _0x470eeb=this;return new Promise(function(_0x213b36,_0x38fde9){return db[_0xf71a('0x1c')][_0xf71a('0x27')]({'raw':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x1f')]===undefined?!![]:![]:!![],'where':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x20')]||null:null,'attributes':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x24')]||null:null,'include':_0x5841ea['options']?_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x5841ea[_0xf71a('0x1e')][_0xf71a('0x21')],function(_0xbb7507){return{'model':db[_0xbb7507['model']],'as':_0xbb7507['as'],'attributes':_0xbb7507['attributes'],'include':_0xbb7507[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0xbb7507[_0xf71a('0x21')],function(_0x4d4188){return{'model':db[_0x4d4188[_0xf71a('0x23')]],'as':_0x4d4188['as'],'attributes':_0x4d4188['attributes'],'include':_0x4d4188[_0xf71a('0x21')]?_[_0xf71a('0x22')](_0x4d4188[_0xf71a('0x21')],function(_0x1073ca){return{'model':db[_0x1073ca['model']],'as':_0x1073ca['as'],'attributes':_0x1073ca[_0xf71a('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf71a('0x11')](function(_0x591347){logger[_0xf71a('0x1a')]('ShowChatQueue',_0x5841ea);logger[_0xf71a('0x14')](_0xf71a('0x26'),_0x5841ea,JSON[_0xf71a('0x16')](_0x591347));_0x213b36(_0x591347);})[_0xf71a('0x1b')](function(_0x352336){logger[_0xf71a('0x17')]('ShowChatQueue',_0x352336[_0xf71a('0x19')],_0x5841ea);_0x38fde9(_0x470eeb[_0xf71a('0x17')](0x1f4,_0x352336['message']));});});};
\ No newline at end of file
+var _0xc9de=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','find','ShowChatQueue'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xc9de,0x140));var _0xec9d=function(_0x4b8f22,_0x371e17){_0x4b8f22=_0x4b8f22-0x0;var _0x3f0511=_0xc9de[_0x4b8f22];return _0x3f0511;};'use strict';var _=require(_0xec9d('0x0'));var util=require(_0xec9d('0x1'));var moment=require(_0xec9d('0x2'));var BPromise=require('bluebird');var rs=require(_0xec9d('0x3'));var fs=require('fs');var Redis=require(_0xec9d('0x4'));var db=require(_0xec9d('0x5'))['db'];var utils=require(_0xec9d('0x6'));var logger=require(_0xec9d('0x7'))(_0xec9d('0x8'));var config=require(_0xec9d('0x9'));var jayson=require(_0xec9d('0xa'));var client=jayson['client'][_0xec9d('0xb')]({'port':0x232a});config[_0xec9d('0xc')]=_[_0xec9d('0xd')](config[_0xec9d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xec9d('0xe'))(new Redis(config['redis']));require(_0xec9d('0xf'))['register'](socket);function respondWithRpcPromise(_0x47b131,_0x5ea938,_0x6e9b2c){return new BPromise(function(_0x120698,_0x4faf62){return client[_0xec9d('0x10')](_0x47b131,_0x6e9b2c)[_0xec9d('0x11')](function(_0x3fd0b9){logger['info'](_0xec9d('0x12'),_0x5ea938,_0xec9d('0x13'));logger[_0xec9d('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5ea938,_0xec9d('0x13'),JSON['stringify'](_0x3fd0b9));if(_0x3fd0b9[_0xec9d('0x15')]){if(_0x3fd0b9[_0xec9d('0x15')]['code']===0x1f4){logger[_0xec9d('0x15')](_0xec9d('0x12'),_0x5ea938,_0x3fd0b9[_0xec9d('0x15')][_0xec9d('0x16')]);return _0x4faf62(_0x3fd0b9[_0xec9d('0x15')][_0xec9d('0x16')]);}logger['error'](_0xec9d('0x12'),_0x5ea938,_0x3fd0b9[_0xec9d('0x15')][_0xec9d('0x16')]);return _0x120698(_0x3fd0b9['error'][_0xec9d('0x16')]);}else{logger[_0xec9d('0x17')](_0xec9d('0x12'),_0x5ea938,_0xec9d('0x13'));_0x120698(_0x3fd0b9[_0xec9d('0x18')]['message']);}})['catch'](function(_0x1d331a){logger[_0xec9d('0x15')](_0xec9d('0x12'),_0x5ea938,_0x1d331a);_0x4faf62(_0x1d331a);});});}exports[_0xec9d('0x19')]=function(_0x4ddaaf){var _0x3c525f=this;return new Promise(function(_0x4d930f,_0x463cbc){return db[_0xec9d('0x1a')][_0xec9d('0x1b')]({'raw':_0x4ddaaf[_0xec9d('0x1c')]?_0x4ddaaf['options'][_0xec9d('0x1d')]===undefined?!![]:![]:!![],'where':_0x4ddaaf[_0xec9d('0x1c')]?_0x4ddaaf['options'][_0xec9d('0x1e')]||null:null,'attributes':_0x4ddaaf[_0xec9d('0x1c')]?_0x4ddaaf['options'][_0xec9d('0x1f')]||null:null,'limit':_0x4ddaaf[_0xec9d('0x1c')]?_0x4ddaaf[_0xec9d('0x1c')][_0xec9d('0x20')]||null:null,'include':_0x4ddaaf['options']?_0x4ddaaf[_0xec9d('0x1c')][_0xec9d('0x21')]?_[_0xec9d('0x22')](_0x4ddaaf['options'][_0xec9d('0x21')],function(_0x57907d){return{'model':db[_0x57907d['model']],'as':_0x57907d['as'],'attributes':_0x57907d[_0xec9d('0x1f')],'include':_0x57907d[_0xec9d('0x21')]?_[_0xec9d('0x22')](_0x57907d[_0xec9d('0x21')],function(_0x295ff2){return{'model':db[_0x295ff2['model']],'as':_0x295ff2['as'],'attributes':_0x295ff2[_0xec9d('0x1f')],'include':_0x295ff2['include']?_[_0xec9d('0x22')](_0x295ff2[_0xec9d('0x21')],function(_0x145a7a){return{'model':db[_0x145a7a[_0xec9d('0x23')]],'as':_0x145a7a['as'],'attributes':_0x145a7a[_0xec9d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x383d6e){logger[_0xec9d('0x17')]('GetChatQueue',_0x4ddaaf);logger[_0xec9d('0x14')]('GetChatQueue',_0x4ddaaf,JSON[_0xec9d('0x24')](_0x383d6e));_0x4d930f(_0x383d6e);})[_0xec9d('0x25')](function(_0x570371){logger['error']('GetChatQueue',_0x570371[_0xec9d('0x16')],_0x4ddaaf);_0x463cbc(_0x3c525f[_0xec9d('0x15')](0x1f4,_0x570371[_0xec9d('0x16')]));});});};exports['ShowChatQueue']=function(_0x4418de){var _0x1cb20a=this;return new Promise(function(_0x768098,_0x191be3){return db[_0xec9d('0x1a')][_0xec9d('0x26')]({'raw':_0x4418de[_0xec9d('0x1c')]?_0x4418de[_0xec9d('0x1c')][_0xec9d('0x1d')]===undefined?!![]:![]:!![],'where':_0x4418de[_0xec9d('0x1c')]?_0x4418de['options'][_0xec9d('0x1e')]||null:null,'attributes':_0x4418de[_0xec9d('0x1c')]?_0x4418de[_0xec9d('0x1c')][_0xec9d('0x1f')]||null:null,'include':_0x4418de[_0xec9d('0x1c')]?_0x4418de[_0xec9d('0x1c')][_0xec9d('0x21')]?_['map'](_0x4418de['options'][_0xec9d('0x21')],function(_0x2a1b7b){return{'model':db[_0x2a1b7b[_0xec9d('0x23')]],'as':_0x2a1b7b['as'],'attributes':_0x2a1b7b['attributes'],'include':_0x2a1b7b[_0xec9d('0x21')]?_[_0xec9d('0x22')](_0x2a1b7b['include'],function(_0x30c66d){return{'model':db[_0x30c66d['model']],'as':_0x30c66d['as'],'attributes':_0x30c66d[_0xec9d('0x1f')],'include':_0x30c66d[_0xec9d('0x21')]?_[_0xec9d('0x22')](_0x30c66d[_0xec9d('0x21')],function(_0x405b29){return{'model':db[_0x405b29[_0xec9d('0x23')]],'as':_0x405b29['as'],'attributes':_0x405b29[_0xec9d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xec9d('0x11')](function(_0xdfd2fd){logger[_0xec9d('0x17')]('ShowChatQueue',_0x4418de);logger[_0xec9d('0x14')]('ShowChatQueue',_0x4418de,JSON[_0xec9d('0x24')](_0xdfd2fd));_0x768098(_0xdfd2fd);})[_0xec9d('0x25')](function(_0x5ae720){logger[_0xec9d('0x15')](_0xec9d('0x27'),_0x5ae720['message'],_0x4418de);_0x191be3(_0x1cb20a['error'](0x1f4,_0x5ae720['message']));});});};
\ No newline at end of file
index c89a189..a3b0a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x2252dd,_0x170894){var _0x30244f=function(_0x4c20bc){while(--_0x4c20bc){_0x2252dd['push'](_0x2252dd['shift']());}};_0x30244f(++_0x170894);}(_0x8ce3,0xc3));var _0x38ce=function(_0xc84cea,_0x7058f1){_0xc84cea=_0xc84cea-0x0;var _0x572c6c=_0x8ce3[_0xc84cea];return _0x572c6c;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}};
\ No newline at end of file
+var _0x2bc6=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x328534,_0x33b41e){var _0x2796c0=function(_0x1ba8ad){while(--_0x1ba8ad){_0x328534['push'](_0x328534['shift']());}};_0x2796c0(++_0x33b41e);}(_0x2bc6,0x163));var _0x62bc=function(_0x2ccc01,_0x38f9a3){_0x2ccc01=_0x2ccc01-0x0;var _0x44dfc3=_0x2bc6[_0x2ccc01];return _0x44dfc3;};'use strict';var ChatQueueEvents=require(_0x62bc('0x0'));var events=[_0x62bc('0x1'),_0x62bc('0x2'),'update'];function createListener(_0x4b4e73,_0x5a2676){return function(_0x5c5a2a){_0x5a2676[_0x62bc('0x3')](_0x4b4e73,_0x5c5a2a);};}function removeListener(_0x576608,_0x2a1959){return function(){ChatQueueEvents[_0x62bc('0x4')](_0x576608,_0x2a1959);};}exports['register']=function(_0x3cce26){for(var _0x450cb6=0x0,_0x40af10=events[_0x62bc('0x5')];_0x450cb6<_0x40af10;_0x450cb6++){var _0x3ed6ad=events[_0x450cb6];var _0x3f625c=createListener('chatQueue:'+_0x3ed6ad,_0x3cce26);ChatQueueEvents['on'](_0x3ed6ad,_0x3f625c);}};
\ No newline at end of file
index 37f2657..03272ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x221b5d,_0x3705c7){_0x221b5d=_0x221b5d-0x0;var _0x3b970a=_0x3e74[_0x221b5d];return _0x3b970a;};'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('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('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(_0x4d0ba3,_0x5130ce){var _0x464558=function(_0x39b397){while(--_0x39b397){_0x4d0ba3['push'](_0x4d0ba3['shift']());}};_0x464558(++_0x5130ce);}(_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 39cc382..f287d55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75e2=['moment','exports','STRING','DATE'];(function(_0x43f707,_0x5b4f4e){var _0x364654=function(_0xc8e531){while(--_0xc8e531){_0x43f707['push'](_0x43f707['shift']());}};_0x364654(++_0x5b4f4e);}(_0x75e2,0x16c));var _0x275e=function(_0x497d6d,_0xff7558){_0x497d6d=_0x497d6d-0x0;var _0x4a1d9a=_0x75e2[_0x497d6d];return _0x4a1d9a;};'use strict';var moment=require(_0x275e('0x0'));var Sequelize=require('sequelize');module[_0x275e('0x1')]={'uniqueid':{'type':Sequelize[_0x275e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x275e('0x2')]},'joinAt':{'type':Sequelize[_0x275e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x275e('0x3')]},'exitAt':{'type':Sequelize[_0x275e('0x3')]},'reason':{'type':Sequelize[_0x275e('0x2')]}};
\ No newline at end of file
+var _0x8de8=['STRING','DATE'];(function(_0x16697e,_0x112bf8){var _0x218ede=function(_0x1104dd){while(--_0x1104dd){_0x16697e['push'](_0x16697e['shift']());}};_0x218ede(++_0x112bf8);}(_0x8de8,0xfd));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x88de('0x0')]},'leaveAt':{'type':Sequelize[_0x88de('0x0')]},'acceptAt':{'type':Sequelize[_0x88de('0x0')]},'exitAt':{'type':Sequelize[_0x88de('0x0')]},'reason':{'type':Sequelize[_0x88de('0x1')]}};
\ No newline at end of file
index 4f4a65f..6bdd349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe3b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','type','key','map','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','ChatQueueReport','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','fs-extra','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','status','end'];(function(_0x43e4b3,_0x1444de){var _0x10c655=function(_0x56c01d){while(--_0x56c01d){_0x43e4b3['push'](_0x43e4b3['shift']());}};_0x10c655(++_0x1444de);}(_0xbe3b,0x19c));var _0xbbe3=function(_0x1586c6,_0x59e7da){_0x1586c6=_0x1586c6-0x0;var _0x957ef1=_0xbe3b[_0x1586c6];return _0x957ef1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbe3('0x0'));var zipdir=require(_0xbbe3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbbe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbe3('0x3'));var util=require('util');var path=require('path');var sox=require(_0xbbe3('0x4'));var csv=require(_0xbbe3('0x5'));var ejs=require(_0xbbe3('0x6'));var fs=require('fs');var fs_extra=require(_0xbbe3('0x7'));var _=require('lodash');var squel=require(_0xbbe3('0x8'));var crypto=require(_0xbbe3('0x9'));var jsforce=require(_0xbbe3('0xa'));var deskjs=require(_0xbbe3('0xb'));var toCsv=require(_0xbbe3('0x5'));var querystring=require('querystring');var Papa=require(_0xbbe3('0xc'));var Redis=require(_0xbbe3('0xd'));var authService=require(_0xbbe3('0xe'));var qs=require(_0xbbe3('0xf'));var as=require(_0xbbe3('0x10'));var hardwareService=require(_0xbbe3('0x11'));var logger=require(_0xbbe3('0x12'))(_0xbbe3('0x13'));var utils=require('../../config/utils');var config=require(_0xbbe3('0x14'));var licenseUtil=require(_0xbbe3('0x15'));var db=require(_0xbbe3('0x16'))['db'];function respondWithStatusCode(_0x464538,_0x5ea5b7){_0x5ea5b7=_0x5ea5b7||0xcc;return function(_0x5bd27e){if(_0x5bd27e){return _0x464538[_0xbbe3('0x17')](_0x5ea5b7);}return _0x464538[_0xbbe3('0x18')](_0x5ea5b7)[_0xbbe3('0x19')]();};}function respondWithResult(_0x32b786,_0x1e1552){_0x1e1552=_0x1e1552||0xc8;return function(_0x2df26d){if(_0x2df26d){return _0x32b786['status'](_0x1e1552)[_0xbbe3('0x1a')](_0x2df26d);}};}function respondWithFilteredResult(_0x5ba69a,_0x41b8ba){return function(_0x12a90c){if(_0x12a90c){var _0x46c91b=typeof _0x41b8ba[_0xbbe3('0x1b')]===_0xbbe3('0x1c')&&typeof _0x41b8ba[_0xbbe3('0x1d')]===_0xbbe3('0x1c');var _0x14b84a=_0x12a90c[_0xbbe3('0x1e')];var _0x2ad70e=_0x46c91b?0x0:_0x41b8ba[_0xbbe3('0x1b')];var _0x3de02e=_0x46c91b?_0x12a90c['count']:_0x41b8ba['offset']+_0x41b8ba['limit'];var _0x39d104;if(_0x3de02e>=_0x14b84a){_0x3de02e=_0x14b84a;_0x39d104=0xc8;}else{_0x39d104=0xce;}_0x5ba69a[_0xbbe3('0x18')](_0x39d104);return _0x5ba69a[_0xbbe3('0x1f')](_0xbbe3('0x20'),_0x2ad70e+'-'+_0x3de02e+'/'+_0x14b84a)[_0xbbe3('0x1a')](_0x12a90c);}return null;};}function patchUpdates(_0x4d13da){return function(_0x25f694){try{jsonpatch[_0xbbe3('0x21')](_0x25f694,_0x4d13da,!![]);}catch(_0x46cb49){return BPromise[_0xbbe3('0x22')](_0x46cb49);}return _0x25f694['save']();};}function saveUpdates(_0x545084,_0x4a5d39){return function(_0x5e78dc){if(_0x5e78dc){return _0x5e78dc[_0xbbe3('0x23')](_0x545084)[_0xbbe3('0x24')](function(_0x1e2464){return _0x1e2464;});}return null;};}function removeEntity(_0x4997bf,_0x224bad){return function(_0x190611){if(_0x190611){return _0x190611['destroy']()['then'](function(){_0x4997bf[_0xbbe3('0x18')](0xcc)[_0xbbe3('0x19')]();});}};}function handleEntityNotFound(_0x4df833,_0x2dd461){return function(_0xa09178){if(!_0xa09178){_0x4df833[_0xbbe3('0x17')](0x194);}return _0xa09178;};}function handleError(_0x20988d,_0x541b28){_0x541b28=_0x541b28||0x1f4;return function(_0x1784a4){logger[_0xbbe3('0x25')](_0x1784a4[_0xbbe3('0x26')]);if(_0x1784a4['name']){delete _0x1784a4[_0xbbe3('0x27')];}_0x20988d['status'](_0x541b28)[_0xbbe3('0x28')](_0x1784a4);};}exports[_0xbbe3('0x29')]=function(_0x3e9cf9,_0x158fef){var _0x15b311={},_0x503ba5={},_0x57d480={'count':0x0,'rows':[]};var _0x46fcb3=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0xf29abc){return{'name':_0xf29abc['fieldName'],'type':_0xf29abc[_0xbbe3('0x2a')][_0xbbe3('0x2b')]};});_0x503ba5['model']=_[_0xbbe3('0x2c')](_0x46fcb3,_0xbbe3('0x27'));_0x503ba5['query']=_[_0xbbe3('0x2d')](_0x3e9cf9[_0xbbe3('0x2e')]);_0x503ba5['filters']=_['intersection'](_0x503ba5[_0xbbe3('0x2f')],_0x503ba5['query']);_0x15b311[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x503ba5['model'],qs[_0xbbe3('0x32')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x15b311[_0xbbe3('0x30')]=_0x15b311[_0xbbe3('0x30')][_0xbbe3('0x33')]?_0x15b311['attributes']:_0x503ba5[_0xbbe3('0x2f')];if(!_0x3e9cf9['query'][_0xbbe3('0x34')](_0xbbe3('0x35'))){_0x15b311['limit']=qs[_0xbbe3('0x1d')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1d')]);_0x15b311['offset']=qs[_0xbbe3('0x1b')](_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x1b')]);}_0x15b311['order']=qs[_0xbbe3('0x36')](_0x3e9cf9['query'][_0xbbe3('0x36')]);_0x15b311[_0xbbe3('0x37')]=qs[_0xbbe3('0x38')](_[_0xbbe3('0x39')](_0x3e9cf9[_0xbbe3('0x2e')],_0x503ba5[_0xbbe3('0x38')]),_0x46fcb3);if(_0x3e9cf9[_0xbbe3('0x2e')]['filter']){_0x15b311[_0xbbe3('0x37')]=_[_0xbbe3('0x3a')](_0x15b311[_0xbbe3('0x37')],{'$or':_[_0xbbe3('0x2c')](_0x46fcb3,function(_0x55f88a){if(_0x55f88a[_0xbbe3('0x2a')]!=='VIRTUAL'){var _0x45fff0={};_0x45fff0[_0x55f88a['name']]={'$like':'%'+_0x3e9cf9['query'][_0xbbe3('0x3b')]+'%'};return _0x45fff0;}})});}_0x15b311=_[_0xbbe3('0x3a')]({},_0x15b311,_0x3e9cf9[_0xbbe3('0x3c')]);var _0x10091f={'where':_0x15b311[_0xbbe3('0x37')]};return db[_0xbbe3('0x3d')][_0xbbe3('0x1e')](_0x10091f)[_0xbbe3('0x24')](function(_0x704ecf){_0x57d480[_0xbbe3('0x1e')]=_0x704ecf;if(_0x3e9cf9[_0xbbe3('0x2e')][_0xbbe3('0x3e')]){_0x15b311[_0xbbe3('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xbbe3('0x40')](_0x15b311);})['then'](function(_0x579a42){_0x57d480[_0xbbe3('0x41')]=_0x579a42;return _0x57d480;})[_0xbbe3('0x24')](respondWithFilteredResult(_0x158fef,_0x15b311))['catch'](handleError(_0x158fef,null));};exports['show']=function(_0x52e815,_0x163dd2){var _0x24e080={'raw':!![],'where':{'id':_0x52e815[_0xbbe3('0x42')]['id']}},_0x22a62c={};_0x22a62c[_0xbbe3('0x2f')]=_[_0xbbe3('0x2d')](db[_0xbbe3('0x3d')][_0xbbe3('0x43')]);_0x22a62c[_0xbbe3('0x2e')]=_['keys'](_0x52e815['query']);_0x22a62c[_0xbbe3('0x38')]=_[_0xbbe3('0x31')](_0x22a62c['model'],_0x22a62c[_0xbbe3('0x2e')]);_0x24e080[_0xbbe3('0x30')]=_[_0xbbe3('0x31')](_0x22a62c[_0xbbe3('0x2f')],qs[_0xbbe3('0x32')](_0x52e815[_0xbbe3('0x2e')][_0xbbe3('0x32')]));_0x24e080['attributes']=_0x24e080['attributes']['length']?_0x24e080['attributes']:_0x22a62c['model'];if(_0x52e815[_0xbbe3('0x2e')]['includeAll']){_0x24e080[_0xbbe3('0x3f')]=[{'all':!![]}];}_0x24e080=_['merge']({},_0x24e080,_0x52e815[_0xbbe3('0x3c')]);return db[_0xbbe3('0x3d')][_0xbbe3('0x44')](_0x24e080)['then'](handleEntityNotFound(_0x163dd2,null))[_0xbbe3('0x24')](respondWithResult(_0x163dd2,null))[_0xbbe3('0x45')](handleError(_0x163dd2,null));};exports[_0xbbe3('0x46')]=function(_0x560e57,_0x4b9b51){return db[_0xbbe3('0x3d')]['create'](_0x560e57[_0xbbe3('0x47')],{})['then'](respondWithResult(_0x4b9b51,0xc9))[_0xbbe3('0x45')](handleError(_0x4b9b51,null));};exports[_0xbbe3('0x23')]=function(_0x291f1a,_0x1ddc51){if(_0x291f1a[_0xbbe3('0x47')]['id']){delete _0x291f1a[_0xbbe3('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x291f1a[_0xbbe3('0x42')]['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x1ddc51,null))[_0xbbe3('0x24')](saveUpdates(_0x291f1a[_0xbbe3('0x47')],null))[_0xbbe3('0x24')](respondWithResult(_0x1ddc51,null))[_0xbbe3('0x45')](handleError(_0x1ddc51,null));};exports['destroy']=function(_0x4da713,_0x449beb){return db['ChatQueueReport']['find']({'where':{'id':_0x4da713['params']['id']}})[_0xbbe3('0x24')](handleEntityNotFound(_0x449beb,null))[_0xbbe3('0x24')](removeEntity(_0x449beb,null))['catch'](handleError(_0x449beb,null));};exports[_0xbbe3('0x48')]=function(_0x1cc61b,_0x454bb7){return db['ChatQueueReport'][_0xbbe3('0x48')]()[_0xbbe3('0x24')](respondWithResult(_0x454bb7,null))['catch'](handleError(_0x454bb7,null));};
\ No newline at end of file
+var _0x31f0=['rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','stack','name','send','index','map','ChatQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x31f0,0xb7));var _0x031f=function(_0x7be0a1,_0x7e6d37){_0x7be0a1=_0x7be0a1-0x0;var _0x42e073=_0x31f0[_0x7be0a1];return _0x42e073;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];function respondWithStatusCode(_0x351052,_0x3819bb){_0x3819bb=_0x3819bb||0xcc;return function(_0x405896){if(_0x405896){return _0x351052[_0x031f('0x18')](_0x3819bb);}return _0x351052['status'](_0x3819bb)[_0x031f('0x19')]();};}function respondWithResult(_0x23b40c,_0x17a699){_0x17a699=_0x17a699||0xc8;return function(_0x2e3dfe){if(_0x2e3dfe){return _0x23b40c[_0x031f('0x1a')](_0x17a699)['json'](_0x2e3dfe);}};}function respondWithFilteredResult(_0x4b7011,_0x1f08db){return function(_0x3a10aa){if(_0x3a10aa){var _0xe4fc1d=typeof _0x1f08db[_0x031f('0x1b')]==='undefined'&&typeof _0x1f08db[_0x031f('0x1c')]===_0x031f('0x1d');var _0x5d0c70=_0x3a10aa[_0x031f('0x1e')];var _0x535e70=_0xe4fc1d?0x0:_0x1f08db[_0x031f('0x1b')];var _0x5f2199=_0xe4fc1d?_0x3a10aa[_0x031f('0x1e')]:_0x1f08db[_0x031f('0x1b')]+_0x1f08db[_0x031f('0x1c')];var _0x26cb5e;if(_0x5f2199>=_0x5d0c70){_0x5f2199=_0x5d0c70;_0x26cb5e=0xc8;}else{_0x26cb5e=0xce;}_0x4b7011[_0x031f('0x1a')](_0x26cb5e);return _0x4b7011[_0x031f('0x1f')](_0x031f('0x20'),_0x535e70+'-'+_0x5f2199+'/'+_0x5d0c70)[_0x031f('0x21')](_0x3a10aa);}return null;};}function patchUpdates(_0x29dd6e){return function(_0x48a76e){try{jsonpatch[_0x031f('0x22')](_0x48a76e,_0x29dd6e,!![]);}catch(_0x33926c){return BPromise[_0x031f('0x23')](_0x33926c);}return _0x48a76e['save']();};}function saveUpdates(_0x5c4184,_0xa11a2b){return function(_0x4d0f92){if(_0x4d0f92){return _0x4d0f92[_0x031f('0x24')](_0x5c4184)['then'](function(_0x54d054){return _0x54d054;});}return null;};}function removeEntity(_0x47d639,_0x971691){return function(_0x12c406){if(_0x12c406){return _0x12c406[_0x031f('0x25')]()[_0x031f('0x26')](function(){_0x47d639['status'](0xcc)[_0x031f('0x19')]();});}};}function handleEntityNotFound(_0x5a64c0,_0x40cb1c){return function(_0x1f5a14){if(!_0x1f5a14){_0x5a64c0[_0x031f('0x18')](0x194);}return _0x1f5a14;};}function handleError(_0x567666,_0x35af16){_0x35af16=_0x35af16||0x1f4;return function(_0x3b2a51){logger['error'](_0x3b2a51[_0x031f('0x27')]);if(_0x3b2a51[_0x031f('0x28')]){delete _0x3b2a51[_0x031f('0x28')];}_0x567666['status'](_0x35af16)[_0x031f('0x29')](_0x3b2a51);};}exports[_0x031f('0x2a')]=function(_0xb6ed6c,_0xaf5bea){var _0xfaa36={},_0x301bd2={},_0x52b544={'count':0x0,'rows':[]};var _0x1f62eb=_[_0x031f('0x2b')](db[_0x031f('0x2c')][_0x031f('0x2d')],function(_0x428ec4){return{'name':_0x428ec4[_0x031f('0x2e')],'type':_0x428ec4[_0x031f('0x2f')][_0x031f('0x30')]};});_0x301bd2[_0x031f('0x31')]=_[_0x031f('0x2b')](_0x1f62eb,_0x031f('0x28'));_0x301bd2['query']=_[_0x031f('0x32')](_0xb6ed6c[_0x031f('0x33')]);_0x301bd2[_0x031f('0x34')]=_[_0x031f('0x35')](_0x301bd2[_0x031f('0x31')],_0x301bd2[_0x031f('0x33')]);_0xfaa36[_0x031f('0x36')]=_[_0x031f('0x35')](_0x301bd2[_0x031f('0x31')],qs[_0x031f('0x37')](_0xb6ed6c[_0x031f('0x33')][_0x031f('0x37')]));_0xfaa36[_0x031f('0x36')]=_0xfaa36['attributes'][_0x031f('0x38')]?_0xfaa36[_0x031f('0x36')]:_0x301bd2['model'];if(!_0xb6ed6c[_0x031f('0x33')][_0x031f('0x39')]('nolimit')){_0xfaa36[_0x031f('0x1c')]=qs[_0x031f('0x1c')](_0xb6ed6c[_0x031f('0x33')][_0x031f('0x1c')]);_0xfaa36['offset']=qs['offset'](_0xb6ed6c[_0x031f('0x33')]['offset']);}_0xfaa36[_0x031f('0x3a')]=qs[_0x031f('0x3b')](_0xb6ed6c[_0x031f('0x33')]['sort']);_0xfaa36['where']=qs[_0x031f('0x34')](_['pick'](_0xb6ed6c['query'],_0x301bd2[_0x031f('0x34')]),_0x1f62eb);if(_0xb6ed6c[_0x031f('0x33')][_0x031f('0x3c')]){_0xfaa36[_0x031f('0x3d')]=_[_0x031f('0x3e')](_0xfaa36[_0x031f('0x3d')],{'$or':_[_0x031f('0x2b')](_0x1f62eb,function(_0x55c85f){if(_0x55c85f[_0x031f('0x2f')]!==_0x031f('0x3f')){var _0xb3b188={};_0xb3b188[_0x55c85f[_0x031f('0x28')]]={'$like':'%'+_0xb6ed6c['query'][_0x031f('0x3c')]+'%'};return _0xb3b188;}})});}_0xfaa36=_[_0x031f('0x3e')]({},_0xfaa36,_0xb6ed6c[_0x031f('0x40')]);var _0x5895f6={'where':_0xfaa36[_0x031f('0x3d')]};return db[_0x031f('0x2c')]['count'](_0x5895f6)[_0x031f('0x26')](function(_0x268dc7){_0x52b544['count']=_0x268dc7;if(_0xb6ed6c['query'][_0x031f('0x41')]){_0xfaa36[_0x031f('0x42')]=[{'all':!![]}];}return db[_0x031f('0x2c')][_0x031f('0x43')](_0xfaa36);})[_0x031f('0x26')](function(_0xf0fb95){_0x52b544[_0x031f('0x44')]=_0xf0fb95;return _0x52b544;})['then'](respondWithFilteredResult(_0xaf5bea,_0xfaa36))[_0x031f('0x45')](handleError(_0xaf5bea,null));};exports[_0x031f('0x46')]=function(_0x4d701e,_0x12279a){var _0x505e93={'raw':!![],'where':{'id':_0x4d701e[_0x031f('0x47')]['id']}},_0x456a98={};_0x456a98['model']=_[_0x031f('0x32')](db[_0x031f('0x2c')][_0x031f('0x2d')]);_0x456a98['query']=_[_0x031f('0x32')](_0x4d701e[_0x031f('0x33')]);_0x456a98[_0x031f('0x34')]=_[_0x031f('0x35')](_0x456a98[_0x031f('0x31')],_0x456a98[_0x031f('0x33')]);_0x505e93[_0x031f('0x36')]=_[_0x031f('0x35')](_0x456a98[_0x031f('0x31')],qs['fields'](_0x4d701e[_0x031f('0x33')][_0x031f('0x37')]));_0x505e93[_0x031f('0x36')]=_0x505e93[_0x031f('0x36')][_0x031f('0x38')]?_0x505e93[_0x031f('0x36')]:_0x456a98[_0x031f('0x31')];if(_0x4d701e[_0x031f('0x33')][_0x031f('0x41')]){_0x505e93['include']=[{'all':!![]}];}_0x505e93=_[_0x031f('0x3e')]({},_0x505e93,_0x4d701e['options']);return db['ChatQueueReport'][_0x031f('0x48')](_0x505e93)[_0x031f('0x26')](handleEntityNotFound(_0x12279a,null))[_0x031f('0x26')](respondWithResult(_0x12279a,null))[_0x031f('0x45')](handleError(_0x12279a,null));};exports[_0x031f('0x49')]=function(_0x553f01,_0x309642){return db[_0x031f('0x2c')][_0x031f('0x49')](_0x553f01['body'],{})[_0x031f('0x26')](respondWithResult(_0x309642,0xc9))[_0x031f('0x45')](handleError(_0x309642,null));};exports[_0x031f('0x24')]=function(_0x318829,_0x2c93ea){if(_0x318829[_0x031f('0x4a')]['id']){delete _0x318829['body']['id'];}return db['ChatQueueReport'][_0x031f('0x48')]({'where':{'id':_0x318829['params']['id']}})[_0x031f('0x26')](handleEntityNotFound(_0x2c93ea,null))[_0x031f('0x26')](saveUpdates(_0x318829['body'],null))[_0x031f('0x26')](respondWithResult(_0x2c93ea,null))['catch'](handleError(_0x2c93ea,null));};exports['destroy']=function(_0x35a949,_0x48ca85){return db[_0x031f('0x2c')]['find']({'where':{'id':_0x35a949[_0x031f('0x47')]['id']}})[_0x031f('0x26')](handleEntityNotFound(_0x48ca85,null))['then'](removeEntity(_0x48ca85,null))[_0x031f('0x45')](handleError(_0x48ca85,null));};exports[_0x031f('0x4b')]=function(_0x57e32d,_0x46471a){return db['ChatQueueReport'][_0x031f('0x4b')]()['then'](respondWithResult(_0x46471a,null))[_0x031f('0x45')](handleError(_0x46471a,null));};
\ No newline at end of file
index 5d6f94a..0e89081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x179ea1,_0x367ffc){var _0x314d33=function(_0x2b94a7){while(--_0x2b94a7){_0x179ea1['push'](_0x179ea1['shift']());}};_0x314d33(++_0x367ffc);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x5b955c,_0x1b03c0){var _0x28028a=function(_0xd7775d){while(--_0xd7775d){_0x5b955c['push'](_0x5b955c['shift']());}};_0x28028a(++_0x1b03c0);}(_0xe706,0xa3));var _0x6e70=function(_0xd4627b,_0xff27fe){_0xd4627b=_0xd4627b-0x0;var _0x30e307=_0xe706[_0xd4627b];return _0x30e307;};'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
index 6e5f65e..9725dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9007=['info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','options','raw','ChatQueueReport','update','where','limit','UpdateChatQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x59a5f4,_0x2b1063){var _0x3d3a6f=function(_0x630d89){while(--_0x630d89){_0x59a5f4['push'](_0x59a5f4['shift']());}};_0x3d3a6f(++_0x2b1063);}(_0x9007,0x1db));var _0x7900=function(_0x2c9cf9,_0x2bed45){_0x2c9cf9=_0x2c9cf9-0x0;var _0x560d6d=_0x9007[_0x2c9cf9];return _0x560d6d;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var moment=require(_0x7900('0x2'));var BPromise=require('bluebird');var rs=require(_0x7900('0x3'));var fs=require('fs');var Redis=require(_0x7900('0x4'));var db=require(_0x7900('0x5'))['db'];var utils=require(_0x7900('0x6'));var logger=require(_0x7900('0x7'))(_0x7900('0x8'));var config=require(_0x7900('0x9'));var jayson=require(_0x7900('0xa'));var client=jayson[_0x7900('0xb')][_0x7900('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x537274,_0x237967,_0x5a75ab){return new BPromise(function(_0x39508a,_0x385913){return client[_0x7900('0xd')](_0x537274,_0x5a75ab)[_0x7900('0xe')](function(_0x32be3f){logger[_0x7900('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x7900('0x10'));logger[_0x7900('0x11')](_0x7900('0x12'),_0x237967,_0x7900('0x10'),JSON[_0x7900('0x13')](_0x32be3f));if(_0x32be3f[_0x7900('0x14')]){if(_0x32be3f[_0x7900('0x14')][_0x7900('0x15')]===0x1f4){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x32be3f['error'][_0x7900('0x17')]);return _0x385913(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x237967,_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);return _0x39508a(_0x32be3f[_0x7900('0x14')][_0x7900('0x17')]);}else{logger[_0x7900('0xf')](_0x7900('0x16'),_0x237967,_0x7900('0x10'));_0x39508a(_0x32be3f[_0x7900('0x18')]['message']);}})[_0x7900('0x19')](function(_0x45e83c){logger[_0x7900('0x14')](_0x7900('0x16'),_0x237967,_0x45e83c);_0x385913(_0x45e83c);});});}exports[_0x7900('0x1a')]=function(_0x1baf93){var _0xd3645c=this;return new Promise(function(_0x12fb13,_0x2fcf84){return db['ChatQueueReport'][_0x7900('0x1b')](_0x1baf93['body'],{'raw':_0x1baf93[_0x7900('0x1c')]?_0x1baf93[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x318e13){logger[_0x7900('0xf')](_0x7900('0x1a'),_0x1baf93);logger['debug'](_0x7900('0x1a'),_0x1baf93,JSON[_0x7900('0x13')](_0x318e13));_0x12fb13(_0x318e13);})[_0x7900('0x19')](function(_0x4795f1){logger[_0x7900('0x14')](_0x7900('0x1a'),_0x4795f1[_0x7900('0x17')],_0x1baf93);_0x2fcf84(_0xd3645c[_0x7900('0x14')](0x1f4,_0x4795f1[_0x7900('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0xeebcda){var _0x3e43ca=this;return new Promise(function(_0x19ae4f,_0x3fb249){return db[_0x7900('0x1e')][_0x7900('0x1f')](_0xeebcda['body'],{'raw':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeebcda[_0x7900('0x1c')]?_0xeebcda['options'][_0x7900('0x20')]||null:null,'attributes':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')]['attributes']||null:null,'limit':_0xeebcda[_0x7900('0x1c')]?_0xeebcda[_0x7900('0x1c')][_0x7900('0x21')]||null:null})['then'](function(_0x11d0fd){logger[_0x7900('0xf')](_0x7900('0x22'),_0xeebcda);logger[_0x7900('0x11')](_0x7900('0x22'),_0xeebcda,JSON[_0x7900('0x13')](_0x11d0fd));_0x19ae4f(_0x11d0fd);})['catch'](function(_0x5d4a48){logger[_0x7900('0x14')]('UpdateChatQueueReport',_0x5d4a48[_0x7900('0x17')],_0xeebcda);_0x3fb249(_0x3e43ca[_0x7900('0x14')](0x1f4,_0x5d4a48[_0x7900('0x17')]));});});};
\ No newline at end of file
+var _0x5880=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','stringify','catch','UpdateChatQueueReport','update','where'];(function(_0xb54936,_0x4867be){var _0x36aba6=function(_0x2bc4c5){while(--_0x2bc4c5){_0xb54936['push'](_0xb54936['shift']());}};_0x36aba6(++_0x4867be);}(_0x5880,0xcd));var _0x0588=function(_0x51266d,_0x11e599){_0x51266d=_0x51266d-0x0;var _0x1c58ce=_0x5880[_0x51266d];return _0x1c58ce;};'use strict';var _=require(_0x0588('0x0'));var util=require(_0x0588('0x1'));var moment=require(_0x0588('0x2'));var BPromise=require(_0x0588('0x3'));var rs=require(_0x0588('0x4'));var fs=require('fs');var Redis=require(_0x0588('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0588('0x6'))(_0x0588('0x7'));var config=require(_0x0588('0x8'));var jayson=require(_0x0588('0x9'));var client=jayson[_0x0588('0xa')][_0x0588('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5b5c,_0x49f348,_0x5ec5e7){return new BPromise(function(_0x30e498,_0x4cfa60){return client[_0x0588('0xc')](_0x1d5b5c,_0x5ec5e7)['then'](function(_0x3cfdbd){logger[_0x0588('0xd')](_0x0588('0xe'),_0x49f348,'request\x20sent');logger[_0x0588('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x49f348,'request\x20sent',JSON['stringify'](_0x3cfdbd));if(_0x3cfdbd[_0x0588('0x10')]){if(_0x3cfdbd[_0x0588('0x10')][_0x0588('0x11')]===0x1f4){logger['error'](_0x0588('0xe'),_0x49f348,_0x3cfdbd[_0x0588('0x10')][_0x0588('0x12')]);return _0x4cfa60(_0x3cfdbd['error']['message']);}logger[_0x0588('0x10')](_0x0588('0xe'),_0x49f348,_0x3cfdbd['error']['message']);return _0x30e498(_0x3cfdbd['error'][_0x0588('0x12')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x49f348,_0x0588('0x13'));_0x30e498(_0x3cfdbd[_0x0588('0x14')][_0x0588('0x12')]);}})['catch'](function(_0x6b76aa){logger['error'](_0x0588('0xe'),_0x49f348,_0x6b76aa);_0x4cfa60(_0x6b76aa);});});}exports[_0x0588('0x15')]=function(_0x4a5db2){var _0x314951=this;return new Promise(function(_0x2050b1,_0x3f6456){return db[_0x0588('0x16')][_0x0588('0x17')](_0x4a5db2[_0x0588('0x18')],{'raw':_0x4a5db2['options']?_0x4a5db2[_0x0588('0x19')][_0x0588('0x1a')]===undefined?!![]:![]:!![]})[_0x0588('0x1b')](function(_0xa9dd7f){logger['info'](_0x0588('0x15'),_0x4a5db2);logger[_0x0588('0xf')](_0x0588('0x15'),_0x4a5db2,JSON[_0x0588('0x1c')](_0xa9dd7f));_0x2050b1(_0xa9dd7f);})[_0x0588('0x1d')](function(_0x4649a5){logger[_0x0588('0x10')]('CreateChatQueueReport',_0x4649a5[_0x0588('0x12')],_0x4a5db2);_0x3f6456(_0x314951[_0x0588('0x10')](0x1f4,_0x4649a5[_0x0588('0x12')]));});});};exports[_0x0588('0x1e')]=function(_0x5b6b9d){var _0x4ec253=this;return new Promise(function(_0xab686d,_0xbfe725){return db[_0x0588('0x16')][_0x0588('0x1f')](_0x5b6b9d['body'],{'raw':_0x5b6b9d['options']?_0x5b6b9d[_0x0588('0x19')][_0x0588('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6b9d[_0x0588('0x19')]?_0x5b6b9d[_0x0588('0x19')][_0x0588('0x20')]||null:null,'attributes':_0x5b6b9d[_0x0588('0x19')]?_0x5b6b9d['options']['attributes']||null:null,'limit':_0x5b6b9d['options']?_0x5b6b9d[_0x0588('0x19')][_0x0588('0x21')]||null:null})[_0x0588('0x1b')](function(_0x11362f){logger[_0x0588('0xd')](_0x0588('0x1e'),_0x5b6b9d);logger[_0x0588('0xf')](_0x0588('0x1e'),_0x5b6b9d,JSON[_0x0588('0x1c')](_0x11362f));_0xab686d(_0x11362f);})[_0x0588('0x1d')](function(_0x368de8){logger[_0x0588('0x10')](_0x0588('0x1e'),_0x368de8[_0x0588('0x12')],_0x5b6b9d);_0xbfe725(_0x4ec253[_0x0588('0x10')](0x1f4,_0x368de8['message']));});});};
\ No newline at end of file
index 244b109..5ec0835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75dc=['describe','/:id','show','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x36d9b5,_0x38491f){var _0x2ec0bb=function(_0x378da9){while(--_0x378da9){_0x36d9b5['push'](_0x36d9b5['shift']());}};_0x2ec0bb(++_0x38491f);}(_0x75dc,0x1db));var _0xc75d=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0x75dc[_0x44e7b9];return _0x1de7ac;};'use strict';var multer=require(_0xc75d('0x0'));var util=require(_0xc75d('0x1'));var path=require('path');var timeout=require(_0xc75d('0x2'));var express=require(_0xc75d('0x3'));var router=express[_0xc75d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc75d('0x5'));var controller=require(_0xc75d('0x6'));router[_0xc75d('0x7')]('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0x9')]);router[_0xc75d('0x7')](_0xc75d('0xa'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xb')]);router[_0xc75d('0x7')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0xd')]);router['post']('/',auth[_0xc75d('0x8')](),controller[_0xc75d('0xe')]);router[_0xc75d('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc75d('0x10')](_0xc75d('0xc'),auth[_0xc75d('0x8')](),controller[_0xc75d('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xbbff=['/describe','describe','/:id','show','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatQueueReport.controller','isAuthenticated','index','get'];(function(_0x368590,_0x48ad74){var _0x5ceb60=function(_0x322b8e){while(--_0x322b8e){_0x368590['push'](_0x368590['shift']());}};_0x5ceb60(++_0x48ad74);}(_0xbbff,0xa9));var _0xfbbf=function(_0x5ac831,_0x59ee41){_0x5ac831=_0x5ac831-0x0;var _0x4ae5f5=_0xbbff[_0x5ac831];return _0x4ae5f5;};'use strict';var multer=require(_0xfbbf('0x0'));var util=require(_0xfbbf('0x1'));var path=require('path');var timeout=require(_0xfbbf('0x2'));var express=require(_0xfbbf('0x3'));var router=express[_0xfbbf('0x4')]();var fs_extra=require(_0xfbbf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfbbf('0x6'));var config=require('../../config/environment');var controller=require(_0xfbbf('0x7'));router['get']('/',auth[_0xfbbf('0x8')](),controller[_0xfbbf('0x9')]);router[_0xfbbf('0xa')](_0xfbbf('0xb'),auth[_0xfbbf('0x8')](),controller[_0xfbbf('0xc')]);router['get'](_0xfbbf('0xd'),auth[_0xfbbf('0x8')](),controller[_0xfbbf('0xe')]);router['post']('/',auth[_0xfbbf('0x8')](),controller[_0xfbbf('0xf')]);router[_0xfbbf('0x10')](_0xfbbf('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfbbf('0xd'),auth[_0xfbbf('0x8')](),controller['destroy']);module[_0xfbbf('0x11')]=router;
\ No newline at end of file
index cc67038..4188fe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x5d1caf,_0x1fc81e){var _0xc452cf=function(_0x5c36fb){while(--_0x5c36fb){_0x5d1caf['push'](_0x5d1caf['shift']());}};_0xc452cf(++_0x1fc81e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x608daf,_0x589a32){_0x608daf=_0x608daf-0x0;var _0x1bc560=_0xf4eb[_0x608daf];return _0x1bc560;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x184b59,_0x25e519){var _0x5475cc=function(_0x3e23dc){while(--_0x3e23dc){_0x184b59['push'](_0x184b59['shift']());}};_0x5475cc(++_0x25e519);}(_0xe706,0xa3));var _0x6e70=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xe706[_0x28d18d];return _0x470640;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
index 80de743..8543bba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7919=['order','sort','where','pick','type','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x469346,_0x4ee770){var _0x3b1b6d=function(_0x2bea74){while(--_0x2bea74){_0x469346['push'](_0x469346['shift']());}};_0x3b1b6d(++_0x4ee770);}(_0x7919,0x1db));var _0x9791=function(_0x53b0d1,_0xffa3c9){_0x53b0d1=_0x53b0d1-0x0;var _0x37bc3d=_0x7919[_0x53b0d1];return _0x37bc3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9791('0x0'));var zipdir=require(_0x9791('0x1'));var jsonpatch=require(_0x9791('0x2'));var rp=require(_0x9791('0x3'));var moment=require(_0x9791('0x4'));var BPromise=require(_0x9791('0x5'));var Mustache=require(_0x9791('0x6'));var util=require(_0x9791('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9791('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9791('0x9'));var squel=require(_0x9791('0xa'));var crypto=require(_0x9791('0xb'));var jsforce=require(_0x9791('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9791('0xd'));var Papa=require(_0x9791('0xe'));var Redis=require(_0x9791('0xf'));var authService=require(_0x9791('0x10'));var qs=require(_0x9791('0x11'));var as=require(_0x9791('0x12'));var hardwareService=require(_0x9791('0x13'));var logger=require(_0x9791('0x14'))(_0x9791('0x15'));var utils=require(_0x9791('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8b6ef5,_0x1f2e63){_0x1f2e63=_0x1f2e63||0xcc;return function(_0x51d8e0){if(_0x51d8e0){return _0x8b6ef5[_0x9791('0x17')](_0x1f2e63);}return _0x8b6ef5[_0x9791('0x18')](_0x1f2e63)[_0x9791('0x19')]();};}function respondWithResult(_0x40f5cc,_0x535652){_0x535652=_0x535652||0xc8;return function(_0xd2bdd3){if(_0xd2bdd3){return _0x40f5cc[_0x9791('0x18')](_0x535652)[_0x9791('0x1a')](_0xd2bdd3);}};}function respondWithFilteredResult(_0x2fafe6,_0x308117){return function(_0xf9f120){if(_0xf9f120){var _0x4c9a8c=typeof _0x308117[_0x9791('0x1b')]===_0x9791('0x1c')&&typeof _0x308117[_0x9791('0x1d')]===_0x9791('0x1c');var _0x2e48a2=_0xf9f120['count'];var _0x5c4ab8=_0x4c9a8c?0x0:_0x308117[_0x9791('0x1b')];var _0x19b151=_0x4c9a8c?_0xf9f120[_0x9791('0x1e')]:_0x308117[_0x9791('0x1b')]+_0x308117[_0x9791('0x1d')];var _0x594ec2;if(_0x19b151>=_0x2e48a2){_0x19b151=_0x2e48a2;_0x594ec2=0xc8;}else{_0x594ec2=0xce;}_0x2fafe6[_0x9791('0x18')](_0x594ec2);return _0x2fafe6[_0x9791('0x1f')](_0x9791('0x20'),_0x5c4ab8+'-'+_0x19b151+'/'+_0x2e48a2)[_0x9791('0x1a')](_0xf9f120);}return null;};}function patchUpdates(_0xe3da4f){return function(_0x2eb577){try{jsonpatch[_0x9791('0x21')](_0x2eb577,_0xe3da4f,!![]);}catch(_0x164ca3){return BPromise[_0x9791('0x22')](_0x164ca3);}return _0x2eb577['save']();};}function saveUpdates(_0x4bcbd6,_0x1fcf42){return function(_0x1eb66e){if(_0x1eb66e){return _0x1eb66e[_0x9791('0x23')](_0x4bcbd6)[_0x9791('0x24')](function(_0x3294a9){return _0x3294a9;});}return null;};}function removeEntity(_0x392a87,_0x1ea05b){return function(_0x46cf2f){if(_0x46cf2f){return _0x46cf2f[_0x9791('0x25')]()[_0x9791('0x24')](function(){_0x392a87[_0x9791('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b1338,_0xe032a){return function(_0x481845){if(!_0x481845){_0x2b1338[_0x9791('0x17')](0x194);}return _0x481845;};}function handleError(_0x2adf38,_0x1c70af){_0x1c70af=_0x1c70af||0x1f4;return function(_0x1b4ace){logger[_0x9791('0x26')](_0x1b4ace[_0x9791('0x27')]);if(_0x1b4ace[_0x9791('0x28')]){delete _0x1b4ace['name'];}_0x2adf38[_0x9791('0x18')](_0x1c70af)['send'](_0x1b4ace);};}exports[_0x9791('0x29')]=function(_0x2e9fbb,_0x1bafe3){var _0x55d741={},_0x2ed874={},_0x5e0d68={'count':0x0,'rows':[]};var _0x3c453b=_[_0x9791('0x2a')](db[_0x9791('0x2b')][_0x9791('0x2c')],function(_0x2cd647){return{'name':_0x2cd647[_0x9791('0x2d')],'type':_0x2cd647['type'][_0x9791('0x2e')]};});_0x2ed874['model']=_[_0x9791('0x2a')](_0x3c453b,_0x9791('0x28'));_0x2ed874[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x2e9fbb['query']);_0x2ed874[_0x9791('0x31')]=_['intersection'](_0x2ed874[_0x9791('0x32')],_0x2ed874[_0x9791('0x2f')]);_0x55d741[_0x9791('0x33')]=_[_0x9791('0x34')](_0x2ed874['model'],qs[_0x9791('0x35')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x35')]));_0x55d741[_0x9791('0x33')]=_0x55d741[_0x9791('0x33')][_0x9791('0x36')]?_0x55d741[_0x9791('0x33')]:_0x2ed874[_0x9791('0x32')];if(!_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x37')](_0x9791('0x38'))){_0x55d741['limit']=qs['limit'](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1d')]);_0x55d741['offset']=qs[_0x9791('0x1b')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x1b')]);}_0x55d741[_0x9791('0x39')]=qs[_0x9791('0x3a')](_0x2e9fbb[_0x9791('0x2f')][_0x9791('0x3a')]);_0x55d741[_0x9791('0x3b')]=qs[_0x9791('0x31')](_[_0x9791('0x3c')](_0x2e9fbb[_0x9791('0x2f')],_0x2ed874[_0x9791('0x31')]),_0x3c453b);if(_0x2e9fbb[_0x9791('0x2f')]['filter']){_0x55d741[_0x9791('0x3b')]=_['merge'](_0x55d741[_0x9791('0x3b')],{'$or':_[_0x9791('0x2a')](_0x3c453b,function(_0x48e1b3){if(_0x48e1b3[_0x9791('0x3d')]!=='VIRTUAL'){var _0x206f14={};_0x206f14[_0x48e1b3[_0x9791('0x28')]]={'$like':'%'+_0x2e9fbb['query'][_0x9791('0x3e')]+'%'};return _0x206f14;}})});}_0x55d741=_[_0x9791('0x3f')]({},_0x55d741,_0x2e9fbb[_0x9791('0x40')]);var _0x349cbd={'where':_0x55d741[_0x9791('0x3b')]};return db[_0x9791('0x2b')]['count'](_0x349cbd)[_0x9791('0x24')](function(_0x5cb980){_0x5e0d68[_0x9791('0x1e')]=_0x5cb980;if(_0x2e9fbb['query']['includeAll']){_0x55d741[_0x9791('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9791('0x42')](_0x55d741);})[_0x9791('0x24')](function(_0x2c4511){_0x5e0d68[_0x9791('0x43')]=_0x2c4511;return _0x5e0d68;})[_0x9791('0x24')](respondWithFilteredResult(_0x1bafe3,_0x55d741))[_0x9791('0x44')](handleError(_0x1bafe3,null));};exports[_0x9791('0x45')]=function(_0x21242e,_0x6512a8){var _0x5de9d8={'raw':!![],'where':{'id':_0x21242e[_0x9791('0x46')]['id']}},_0x4deca1={};_0x4deca1['model']=_[_0x9791('0x30')](db['ChatTransferReport'][_0x9791('0x2c')]);_0x4deca1[_0x9791('0x2f')]=_[_0x9791('0x30')](_0x21242e[_0x9791('0x2f')]);_0x4deca1[_0x9791('0x31')]=_[_0x9791('0x34')](_0x4deca1[_0x9791('0x32')],_0x4deca1['query']);_0x5de9d8[_0x9791('0x33')]=_['intersection'](_0x4deca1['model'],qs[_0x9791('0x35')](_0x21242e[_0x9791('0x2f')][_0x9791('0x35')]));_0x5de9d8[_0x9791('0x33')]=_0x5de9d8[_0x9791('0x33')][_0x9791('0x36')]?_0x5de9d8[_0x9791('0x33')]:_0x4deca1['model'];if(_0x21242e['query'][_0x9791('0x47')]){_0x5de9d8['include']=[{'all':!![]}];}_0x5de9d8=_[_0x9791('0x3f')]({},_0x5de9d8,_0x21242e[_0x9791('0x40')]);return db[_0x9791('0x2b')]['find'](_0x5de9d8)[_0x9791('0x24')](handleEntityNotFound(_0x6512a8,null))[_0x9791('0x24')](respondWithResult(_0x6512a8,null))[_0x9791('0x44')](handleError(_0x6512a8,null));};exports['create']=function(_0x230522,_0x29dc19){return db[_0x9791('0x2b')][_0x9791('0x48')](_0x230522[_0x9791('0x49')],{})[_0x9791('0x24')](respondWithResult(_0x29dc19,0xc9))['catch'](handleError(_0x29dc19,null));};exports[_0x9791('0x23')]=function(_0x239682,_0x227314){if(_0x239682[_0x9791('0x49')]['id']){delete _0x239682[_0x9791('0x49')]['id'];}return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x239682[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x227314,null))[_0x9791('0x24')](saveUpdates(_0x239682[_0x9791('0x49')],null))[_0x9791('0x24')](respondWithResult(_0x227314,null))[_0x9791('0x44')](handleError(_0x227314,null));};exports['destroy']=function(_0x5d836c,_0x2affe5){return db[_0x9791('0x2b')][_0x9791('0x4a')]({'where':{'id':_0x5d836c[_0x9791('0x46')]['id']}})[_0x9791('0x24')](handleEntityNotFound(_0x2affe5,null))['then'](removeEntity(_0x2affe5,null))[_0x9791('0x44')](handleError(_0x2affe5,null));};exports[_0x9791('0x4b')]=function(_0x411208,_0x10aeff){return db[_0x9791('0x2b')][_0x9791('0x4b')]()[_0x9791('0x24')](respondWithResult(_0x10aeff,null))[_0x9791('0x44')](handleError(_0x10aeff,null));};
\ No newline at end of file
+var _0xe49c=['length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','fields','include','create','body','update','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','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','status','end','json','offset','undefined','count','limit','Content-Range','apply','then','sendStatus','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','attributes'];(function(_0x1faffd,_0x34052e){var _0x31648e=function(_0x5b1d01){while(--_0x5b1d01){_0x1faffd['push'](_0x1faffd['shift']());}};_0x31648e(++_0x34052e);}(_0xe49c,0x189));var _0xce49=function(_0x4b36bd,_0x25a84a){_0x4b36bd=_0x4b36bd-0x0;var _0xb4a41f=_0xe49c[_0x4b36bd];return _0xb4a41f;};'use strict';var emlformat=require(_0xce49('0x0'));var rimraf=require(_0xce49('0x1'));var zipdir=require(_0xce49('0x2'));var jsonpatch=require(_0xce49('0x3'));var rp=require('request-promise');var moment=require(_0xce49('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xce49('0x5'));var path=require(_0xce49('0x6'));var sox=require('sox');var csv=require(_0xce49('0x7'));var ejs=require(_0xce49('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce49('0x9'));var squel=require('squel');var crypto=require(_0xce49('0xa'));var jsforce=require(_0xce49('0xb'));var deskjs=require(_0xce49('0xc'));var toCsv=require('to-csv');var querystring=require(_0xce49('0xd'));var Papa=require(_0xce49('0xe'));var Redis=require(_0xce49('0xf'));var authService=require(_0xce49('0x10'));var qs=require(_0xce49('0x11'));var as=require(_0xce49('0x12'));var hardwareService=require(_0xce49('0x13'));var logger=require('../../config/logger')(_0xce49('0x14'));var utils=require(_0xce49('0x15'));var config=require(_0xce49('0x16'));var licenseUtil=require(_0xce49('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a86bf,_0x21b6ca){_0x21b6ca=_0x21b6ca||0xcc;return function(_0x17ef53){if(_0x17ef53){return _0x1a86bf['sendStatus'](_0x21b6ca);}return _0x1a86bf[_0xce49('0x18')](_0x21b6ca)[_0xce49('0x19')]();};}function respondWithResult(_0x1db5ea,_0x30abd9){_0x30abd9=_0x30abd9||0xc8;return function(_0x3ecc30){if(_0x3ecc30){return _0x1db5ea['status'](_0x30abd9)[_0xce49('0x1a')](_0x3ecc30);}};}function respondWithFilteredResult(_0x1cb832,_0x5c83f8){return function(_0x539dc8){if(_0x539dc8){var _0x277539=typeof _0x5c83f8[_0xce49('0x1b')]==='undefined'&&typeof _0x5c83f8['limit']===_0xce49('0x1c');var _0x4496c7=_0x539dc8[_0xce49('0x1d')];var _0x1f0403=_0x277539?0x0:_0x5c83f8[_0xce49('0x1b')];var _0x160203=_0x277539?_0x539dc8[_0xce49('0x1d')]:_0x5c83f8[_0xce49('0x1b')]+_0x5c83f8[_0xce49('0x1e')];var _0x36c997;if(_0x160203>=_0x4496c7){_0x160203=_0x4496c7;_0x36c997=0xc8;}else{_0x36c997=0xce;}_0x1cb832[_0xce49('0x18')](_0x36c997);return _0x1cb832['set'](_0xce49('0x1f'),_0x1f0403+'-'+_0x160203+'/'+_0x4496c7)[_0xce49('0x1a')](_0x539dc8);}return null;};}function patchUpdates(_0x14d98d){return function(_0x5380e0){try{jsonpatch[_0xce49('0x20')](_0x5380e0,_0x14d98d,!![]);}catch(_0x488103){return BPromise['reject'](_0x488103);}return _0x5380e0['save']();};}function saveUpdates(_0x24e39f,_0x5f3004){return function(_0x62c68e){if(_0x62c68e){return _0x62c68e['update'](_0x24e39f)['then'](function(_0x59872d){return _0x59872d;});}return null;};}function removeEntity(_0x545919,_0x1b83f6){return function(_0x120f06){if(_0x120f06){return _0x120f06['destroy']()[_0xce49('0x21')](function(){_0x545919[_0xce49('0x18')](0xcc)[_0xce49('0x19')]();});}};}function handleEntityNotFound(_0x1822bc,_0x4c2915){return function(_0x40999b){if(!_0x40999b){_0x1822bc[_0xce49('0x22')](0x194);}return _0x40999b;};}function handleError(_0x4c563e,_0x10c177){_0x10c177=_0x10c177||0x1f4;return function(_0x83a90d){logger[_0xce49('0x23')](_0x83a90d[_0xce49('0x24')]);if(_0x83a90d[_0xce49('0x25')]){delete _0x83a90d[_0xce49('0x25')];}_0x4c563e[_0xce49('0x18')](_0x10c177)['send'](_0x83a90d);};}exports[_0xce49('0x26')]=function(_0xeecfc3,_0x576252){var _0x21a41e={},_0x477d85={},_0x42d3e1={'count':0x0,'rows':[]};var _0x319b78=_[_0xce49('0x27')](db[_0xce49('0x28')][_0xce49('0x29')],function(_0x392e62){return{'name':_0x392e62[_0xce49('0x2a')],'type':_0x392e62[_0xce49('0x2b')][_0xce49('0x2c')]};});_0x477d85['model']=_[_0xce49('0x27')](_0x319b78,'name');_0x477d85[_0xce49('0x2d')]=_[_0xce49('0x2e')](_0xeecfc3[_0xce49('0x2d')]);_0x477d85[_0xce49('0x2f')]=_['intersection'](_0x477d85[_0xce49('0x30')],_0x477d85[_0xce49('0x2d')]);_0x21a41e['attributes']=_[_0xce49('0x31')](_0x477d85[_0xce49('0x30')],qs['fields'](_0xeecfc3['query']['fields']));_0x21a41e[_0xce49('0x32')]=_0x21a41e[_0xce49('0x32')][_0xce49('0x33')]?_0x21a41e[_0xce49('0x32')]:_0x477d85[_0xce49('0x30')];if(!_0xeecfc3[_0xce49('0x2d')][_0xce49('0x34')]('nolimit')){_0x21a41e['limit']=qs[_0xce49('0x1e')](_0xeecfc3['query'][_0xce49('0x1e')]);_0x21a41e['offset']=qs[_0xce49('0x1b')](_0xeecfc3[_0xce49('0x2d')]['offset']);}_0x21a41e[_0xce49('0x35')]=qs['sort'](_0xeecfc3[_0xce49('0x2d')][_0xce49('0x36')]);_0x21a41e[_0xce49('0x37')]=qs[_0xce49('0x2f')](_['pick'](_0xeecfc3[_0xce49('0x2d')],_0x477d85[_0xce49('0x2f')]),_0x319b78);if(_0xeecfc3[_0xce49('0x2d')][_0xce49('0x38')]){_0x21a41e['where']=_[_0xce49('0x39')](_0x21a41e[_0xce49('0x37')],{'$or':_[_0xce49('0x27')](_0x319b78,function(_0x2abcba){if(_0x2abcba[_0xce49('0x2b')]!==_0xce49('0x3a')){var _0x929751={};_0x929751[_0x2abcba[_0xce49('0x25')]]={'$like':'%'+_0xeecfc3[_0xce49('0x2d')][_0xce49('0x38')]+'%'};return _0x929751;}})});}_0x21a41e=_['merge']({},_0x21a41e,_0xeecfc3[_0xce49('0x3b')]);var _0x4660e6={'where':_0x21a41e[_0xce49('0x37')]};return db[_0xce49('0x28')][_0xce49('0x1d')](_0x4660e6)[_0xce49('0x21')](function(_0x38f743){_0x42d3e1[_0xce49('0x1d')]=_0x38f743;if(_0xeecfc3[_0xce49('0x2d')][_0xce49('0x3c')]){_0x21a41e['include']=[{'all':!![]}];}return db[_0xce49('0x28')][_0xce49('0x3d')](_0x21a41e);})[_0xce49('0x21')](function(_0x59234c){_0x42d3e1[_0xce49('0x3e')]=_0x59234c;return _0x42d3e1;})['then'](respondWithFilteredResult(_0x576252,_0x21a41e))[_0xce49('0x3f')](handleError(_0x576252,null));};exports[_0xce49('0x40')]=function(_0x41366a,_0x476940){var _0x1381a0={'raw':!![],'where':{'id':_0x41366a['params']['id']}},_0x2476d2={};_0x2476d2[_0xce49('0x30')]=_[_0xce49('0x2e')](db[_0xce49('0x28')][_0xce49('0x29')]);_0x2476d2[_0xce49('0x2d')]=_[_0xce49('0x2e')](_0x41366a['query']);_0x2476d2[_0xce49('0x2f')]=_[_0xce49('0x31')](_0x2476d2['model'],_0x2476d2[_0xce49('0x2d')]);_0x1381a0[_0xce49('0x32')]=_[_0xce49('0x31')](_0x2476d2['model'],qs['fields'](_0x41366a[_0xce49('0x2d')][_0xce49('0x41')]));_0x1381a0['attributes']=_0x1381a0[_0xce49('0x32')]['length']?_0x1381a0[_0xce49('0x32')]:_0x2476d2[_0xce49('0x30')];if(_0x41366a[_0xce49('0x2d')][_0xce49('0x3c')]){_0x1381a0[_0xce49('0x42')]=[{'all':!![]}];}_0x1381a0=_[_0xce49('0x39')]({},_0x1381a0,_0x41366a[_0xce49('0x3b')]);return db['ChatTransferReport']['find'](_0x1381a0)[_0xce49('0x21')](handleEntityNotFound(_0x476940,null))[_0xce49('0x21')](respondWithResult(_0x476940,null))[_0xce49('0x3f')](handleError(_0x476940,null));};exports[_0xce49('0x43')]=function(_0x58ddfb,_0x2f6dbb){return db['ChatTransferReport']['create'](_0x58ddfb[_0xce49('0x44')],{})[_0xce49('0x21')](respondWithResult(_0x2f6dbb,0xc9))[_0xce49('0x3f')](handleError(_0x2f6dbb,null));};exports[_0xce49('0x45')]=function(_0x2fc02b,_0x23200c){if(_0x2fc02b['body']['id']){delete _0x2fc02b['body']['id'];}return db[_0xce49('0x28')][_0xce49('0x46')]({'where':{'id':_0x2fc02b[_0xce49('0x47')]['id']}})[_0xce49('0x21')](handleEntityNotFound(_0x23200c,null))[_0xce49('0x21')](saveUpdates(_0x2fc02b[_0xce49('0x44')],null))[_0xce49('0x21')](respondWithResult(_0x23200c,null))[_0xce49('0x3f')](handleError(_0x23200c,null));};exports[_0xce49('0x48')]=function(_0x51dedb,_0x249d0a){return db[_0xce49('0x28')]['find']({'where':{'id':_0x51dedb['params']['id']}})[_0xce49('0x21')](handleEntityNotFound(_0x249d0a,null))[_0xce49('0x21')](removeEntity(_0x249d0a,null))[_0xce49('0x3f')](handleError(_0x249d0a,null));};exports['describe']=function(_0x4af47f,_0x3cba35){return db[_0xce49('0x28')][_0xce49('0x49')]()[_0xce49('0x21')](respondWithResult(_0x3cba35,null))['catch'](handleError(_0x3cba35,null));};
\ No newline at end of file
index 278fb20..bc77617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xece2=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x4b41d7,_0x281be8){var _0x52eecd=function(_0x491658){while(--_0x491658){_0x4b41d7['push'](_0x4b41d7['shift']());}};_0x52eecd(++_0x281be8);}(_0xece2,0x79));var _0x2ece=function(_0x3b3e4c,_0x1a90b7){_0x3b3e4c=_0x3b3e4c-0x0;var _0x53f518=_0xece2[_0x3b3e4c];return _0x53f518;};'use strict';var _=require(_0x2ece('0x0'));var util=require('util');var logger=require(_0x2ece('0x1'))('api');var moment=require(_0x2ece('0x2'));var BPromise=require('bluebird');var rp=require(_0x2ece('0x3'));var fs=require('fs');var path=require(_0x2ece('0x4'));var rimraf=require(_0x2ece('0x5'));var config=require(_0x2ece('0x6'));var attributes=require(_0x2ece('0x7'));module[_0x2ece('0x8')]=function(_0x142ffd,_0x45e030){return _0x142ffd[_0x2ece('0x9')](_0x2ece('0xa'),attributes,{'tableName':_0x2ece('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2ece('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7562=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x13727f,_0x2c2308){var _0x3b4e80=function(_0x2249ce){while(--_0x2249ce){_0x13727f['push'](_0x13727f['shift']());}};_0x3b4e80(++_0x2c2308);}(_0x7562,0xdb));var _0x2756=function(_0x294126,_0x3ad8d5){_0x294126=_0x294126-0x0;var _0x97aff0=_0x7562[_0x294126];return _0x97aff0;};'use strict';var _=require(_0x2756('0x0'));var util=require(_0x2756('0x1'));var logger=require(_0x2756('0x2'))('api');var moment=require(_0x2756('0x3'));var BPromise=require(_0x2756('0x4'));var rp=require(_0x2756('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2756('0x6'));var config=require(_0x2756('0x7'));var attributes=require(_0x2756('0x8'));module[_0x2756('0x9')]=function(_0x21ff07,_0x44ab19){return _0x21ff07['define'](_0x2756('0xa'),attributes,{'tableName':_0x2756('0xb'),'paranoid':![],'indexes':[{'name':_0x2756('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 59fd3ac..09a4014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd89=['debug','stringify','error','code','message','catch','lodash','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4067ac,_0x363603){var _0x53d74d=function(_0x492ad4){while(--_0x492ad4){_0x4067ac['push'](_0x4067ac['shift']());}};_0x53d74d(++_0x363603);}(_0xcd89,0xde));var _0x9cd8=function(_0x5a2e1d,_0x301293){_0x5a2e1d=_0x5a2e1d-0x0;var _0xdde36f=_0xcd89[_0x5a2e1d];return _0xdde36f;};'use strict';var _=require(_0x9cd8('0x0'));var util=require('util');var moment=require(_0x9cd8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9cd8('0x2'))['db'];var utils=require(_0x9cd8('0x3'));var logger=require('../../config/logger')(_0x9cd8('0x4'));var config=require(_0x9cd8('0x5'));var jayson=require(_0x9cd8('0x6'));var client=jayson['client'][_0x9cd8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d87ac,_0x5b47d1,_0xab85ad){return new BPromise(function(_0x456420,_0x19b443){return client[_0x9cd8('0x8')](_0x3d87ac,_0xab85ad)[_0x9cd8('0x9')](function(_0x2041b7){logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));logger[_0x9cd8('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5b47d1,'request\x20sent',JSON[_0x9cd8('0xd')](_0x2041b7));if(_0x2041b7[_0x9cd8('0xe')]){if(_0x2041b7['error'][_0x9cd8('0xf')]===0x1f4){logger[_0x9cd8('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x5b47d1,_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);return _0x19b443(_0x2041b7[_0x9cd8('0xe')][_0x9cd8('0x10')]);}logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x2041b7[_0x9cd8('0xe')]['message']);return _0x456420(_0x2041b7[_0x9cd8('0xe')]['message']);}else{logger['info'](_0x9cd8('0xa'),_0x5b47d1,_0x9cd8('0xb'));_0x456420(_0x2041b7['result'][_0x9cd8('0x10')]);}})[_0x9cd8('0x11')](function(_0x5b1061){logger[_0x9cd8('0xe')](_0x9cd8('0xa'),_0x5b47d1,_0x5b1061);_0x19b443(_0x5b1061);});});}
\ No newline at end of file
+var _0x3ec8=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x3ec8,0x1cb));var _0x83ec=function(_0x25fe7f,_0x150120){_0x25fe7f=_0x25fe7f-0x0;var _0xa2cb47=_0x3ec8[_0x25fe7f];return _0xa2cb47;};'use strict';var _=require(_0x83ec('0x0'));var util=require(_0x83ec('0x1'));var moment=require(_0x83ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x83ec('0x3'));var fs=require('fs');var Redis=require(_0x83ec('0x4'));var db=require(_0x83ec('0x5'))['db'];var utils=require(_0x83ec('0x6'));var logger=require(_0x83ec('0x7'))(_0x83ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x83ec('0x9'));var client=jayson['client'][_0x83ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x657d60,_0x2153b6,_0x37f04d){return new BPromise(function(_0x508cb5,_0x7063d4){return client[_0x83ec('0xb')](_0x657d60,_0x37f04d)[_0x83ec('0xc')](function(_0x3010cf){logger[_0x83ec('0xd')](_0x83ec('0xe'),_0x2153b6,_0x83ec('0xf'));logger[_0x83ec('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2153b6,_0x83ec('0xf'),JSON[_0x83ec('0x11')](_0x3010cf));if(_0x3010cf[_0x83ec('0x12')]){if(_0x3010cf[_0x83ec('0x12')][_0x83ec('0x13')]===0x1f4){logger[_0x83ec('0x12')](_0x83ec('0xe'),_0x2153b6,_0x3010cf[_0x83ec('0x12')][_0x83ec('0x14')]);return _0x7063d4(_0x3010cf[_0x83ec('0x12')]['message']);}logger[_0x83ec('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2153b6,_0x3010cf[_0x83ec('0x12')][_0x83ec('0x14')]);return _0x508cb5(_0x3010cf[_0x83ec('0x12')][_0x83ec('0x14')]);}else{logger[_0x83ec('0xd')](_0x83ec('0xe'),_0x2153b6,_0x83ec('0xf'));_0x508cb5(_0x3010cf[_0x83ec('0x15')][_0x83ec('0x14')]);}})[_0x83ec('0x16')](function(_0x2936b5){logger['error'](_0x83ec('0xe'),_0x2153b6,_0x2936b5);_0x7063d4(_0x2936b5);});});}
\ No newline at end of file
index 436e6c1..55db60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fee=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update'];(function(_0x2c398d,_0x1fc888){var _0x29e856=function(_0x149dc4){while(--_0x149dc4){_0x2c398d['push'](_0x2c398d['shift']());}};_0x29e856(++_0x1fc888);}(_0x3fee,0x11f));var _0xe3fe=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3fee[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xe3fe('0x0'));var util=require(_0xe3fe('0x1'));var path=require(_0xe3fe('0x2'));var timeout=require(_0xe3fe('0x3'));var express=require(_0xe3fe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe3fe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xe3fe('0x6')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x8')]);router[_0xe3fe('0x6')](_0xe3fe('0x9'),auth['isAuthenticated'](),controller[_0xe3fe('0xa')]);router[_0xe3fe('0x6')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xc')]);router[_0xe3fe('0xd')]('/',auth[_0xe3fe('0x7')](),controller[_0xe3fe('0xe')]);router[_0xe3fe('0xf')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller[_0xe3fe('0x10')]);router[_0xe3fe('0x11')](_0xe3fe('0xb'),auth[_0xe3fe('0x7')](),controller['destroy']);module[_0xe3fe('0x12')]=router;
\ No newline at end of file
+var _0x8ed4=['/describe','/:id','post','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get'];(function(_0x55e874,_0x46afae){var _0x1850f3=function(_0x1fcb17){while(--_0x1fcb17){_0x55e874['push'](_0x55e874['shift']());}};_0x1850f3(++_0x46afae);}(_0x8ed4,0x1a5));var _0x48ed=function(_0x4dce75,_0x144d75){_0x4dce75=_0x4dce75-0x0;var _0x889f3b=_0x8ed4[_0x4dce75];return _0x889f3b;};'use strict';var multer=require(_0x48ed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x48ed('0x1'));var express=require(_0x48ed('0x2'));var router=express[_0x48ed('0x3')]();var fs_extra=require(_0x48ed('0x4'));var auth=require(_0x48ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48ed('0x6'));var controller=require(_0x48ed('0x7'));router['get']('/',auth[_0x48ed('0x8')](),controller[_0x48ed('0x9')]);router[_0x48ed('0xa')](_0x48ed('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x48ed('0xc'),auth[_0x48ed('0x8')](),controller['show']);router[_0x48ed('0xd')]('/',auth[_0x48ed('0x8')](),controller[_0x48ed('0xe')]);router['put'](_0x48ed('0xc'),auth['isAuthenticated'](),controller[_0x48ed('0xf')]);router[_0x48ed('0x10')](_0x48ed('0xc'),auth['isAuthenticated'](),controller[_0x48ed('0x11')]);module['exports']=router;
\ No newline at end of file
index ed4959c..0551c86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16dd=['Chat','Send','Contact\x20us','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','TEXT','name','text','input','getDataValue','onlineForm','parse','stringify','textarea','Comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','We\x20are\x20here!'];(function(_0x4f0b97,_0x3ff57b){var _0x4d24b3=function(_0x5333fe){while(--_0x5333fe){_0x4f0b97['push'](_0x4f0b97['shift']());}};_0x4d24b3(++_0x3ff57b);}(_0x16dd,0x144));var _0xd16d=function(_0x4cb048,_0x3eeba5){_0x4cb048=_0x4cb048-0x0;var _0x278aaf=_0x16dd[_0x4cb048];return _0x278aaf;};'use strict';var Sequelize=require(_0xd16d('0x0'));var rs=require('randomstring');module[_0xd16d('0x1')]={'name':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![],'unique':_0xd16d('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x4')},'key':{'type':Sequelize[_0xd16d('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x5')},'customerAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd16d('0xa')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0xe')},'download_transcript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xf')},'closingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x10')},'closingMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'skipMessageButton':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd16d('0x11')},'ratingType':{'type':Sequelize[_0xd16d('0xa')]('star',_0xd16d('0x12')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd16d('0x14'),'type':_0xd16d('0x15'),'required':!![]},'props':{'title':_0xd16d('0x14'),'helpText':''}},{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':_0xd16d('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd16d('0x17')](_0xd16d('0x18'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x18'))):{};},'set':function(_0x27d3e4){return this['setDataValue'](_0xd16d('0x18'),JSON[_0xd16d('0x1a')](_0x27d3e4));}},'offlineForm':{'type':Sequelize[_0xd16d('0x13')],'defaultValue':function(){return JSON[_0xd16d('0x1a')]({'items':[{'type':_0xd16d('0x16'),'props':{'title':_0xd16d('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd16d('0x4'),'type':'email'},'variable':null},{'type':_0xd16d('0x1b'),'config':{'placeholder':_0xd16d('0x1c')},'props':{'title':_0xd16d('0x1c'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xd16d('0x1d'))?JSON[_0xd16d('0x19')](this[_0xd16d('0x17')](_0xd16d('0x1d'))):{};},'set':function(_0x1d5e0c){return this[_0xd16d('0x1e')](_0xd16d('0x1d'),JSON[_0xd16d('0x1a')](_0x1d5e0c));}},'token':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd16d('0x2')]},'forwardOffline':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd16d('0x2')]},'waitingTitle':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x1f')},'waitingMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x20')},'offlineMessageSubject':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x21')},'offlineMessageBody':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x23')},'skipUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x24')},'sendUnmanaged':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd16d('0x13')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd16d('0x25');}},'notificationSound':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x27')},'verticalAlignment':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x28')},'defaultTitle':{'type':Sequelize[_0xd16d('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd16d('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd16d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':_0xd16d('0x2a')},'systemAvatar':{'type':Sequelize[_0xd16d('0x13')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd16d('0x8')],'comment':_0xd16d('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd16d('0x2c'),'set':function(_0x4a33ba){if(!_0x4a33ba)this[_0xd16d('0x1e')]('mandatoryDispositionPauseId',null);this[_0xd16d('0x1e')](_0xd16d('0x2d'),_0x4a33ba);}},'vidaooEscalation':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd16d('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd16d('0x2e')},'vidaooNote':{'type':Sequelize[_0xd16d('0x2')],'defaultValue':function(){return _0xd16d('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd16d('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd16d('0x13')]}};
\ No newline at end of file
+var _0x37f3=['TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN'];(function(_0x48e727,_0x385c16){var _0x470867=function(_0x5e1df0){while(--_0x5e1df0){_0x48e727['push'](_0x48e727['shift']());}};_0x470867(++_0x385c16);}(_0x37f3,0x178));var _0x337f=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x37f3[_0x277fa3];return _0x2e4520;};'use strict';var Sequelize=require(_0x337f('0x0'));var rs=require(_0x337f('0x1'));module['exports']={'name':{'type':Sequelize[_0x337f('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x337f('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0x3')},'mapKeyOffline':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x3')},'key':{'type':Sequelize[_0x337f('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0x4')},'customerAlias':{'type':Sequelize[_0x337f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x337f('0x2')],'allowNull':![],'defaultValue':_0x337f('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x337f('0x2')],'allowNull':![],'defaultValue':_0x337f('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x337f('0x2')],'allowNull':![],'defaultValue':_0x337f('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x337f('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x337f('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x337f('0x8')](_0x337f('0x9'),_0x337f('0xa')),'defaultValue':_0x337f('0x9')},'header_online':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0xb')},'start_chat_button':{'type':Sequelize[_0x337f('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x337f('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x337f('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x337f('0x10')]},'closingQuestion':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0x14')},'placeholderMessage':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x15')},'closingMessage':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x16')},'closingMessageButton':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0xc')},'skipMessageButton':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x17')},'conditionAgreement':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x18')},'ratingType':{'type':Sequelize['ENUM'](_0x337f('0x19'),_0x337f('0x1a')),'defaultValue':_0x337f('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x337f('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x337f('0x10')],'defaultValue':function(){return JSON[_0x337f('0x1b')]({'items':[{'type':_0x337f('0x1c'),'variable':null,'config':{'placeholder':_0x337f('0x1d'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x337f('0x1c'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x337f('0x3'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x337f('0x1e'))?JSON[_0x337f('0x1f')](this['getDataValue'](_0x337f('0x1e'))):{};},'set':function(_0x342471){return this[_0x337f('0x20')]('onlineForm',JSON[_0x337f('0x1b')](_0x342471));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x337f('0x1b')]({'items':[{'type':'input','props':{'title':_0x337f('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x337f('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x337f('0x21'),'helpText':_0x337f('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x337f('0x23')](_0x337f('0x24'))?JSON[_0x337f('0x1f')](this[_0x337f('0x23')](_0x337f('0x24'))):{};},'set':function(_0x1c9568){return this['setDataValue'](_0x337f('0x24'),JSON[_0x337f('0x1b')](_0x1c9568));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x337f('0x25')]();}},'autoclose':{'type':Sequelize[_0x337f('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x337f('0x2')]},'forwardOffline':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x337f('0x2')]},'waitingTitle':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x26')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x27')},'offlineMessageBody':{'type':Sequelize[_0x337f('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x337f('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0x17')},'sendUnmanaged':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x337f('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x337f('0x2')]},'notificationTemplate':{'type':Sequelize[_0x337f('0x10')],'defaultValue':function(){return _0x337f('0x28');}},'notificationSound':{'type':Sequelize[_0x337f('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x337f('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x337f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x2a')},'verticalAlignment':{'type':Sequelize[_0x337f('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x337f('0x2')],'defaultValue':_0x337f('0x2b')},'defaultTitle':{'type':Sequelize[_0x337f('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x337f('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x337f('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x337f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x337f('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![],'comment':_0x337f('0x2d'),'set':function(_0x3210b0){if(!_0x3210b0)this[_0x337f('0x20')]('mandatoryDispositionPauseId',null);this[_0x337f('0x20')](_0x337f('0x2e'),_0x3210b0);}},'vidaooEscalation':{'type':Sequelize[_0x337f('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x337f('0x2')]},'vidaooTopic':{'type':Sequelize[_0x337f('0x2')],'allowNull':![],'defaultValue':_0x337f('0x2f')},'vidaooNote':{'type':Sequelize[_0x337f('0x2')],'defaultValue':function(){return _0x337f('0x30');}},'vidaooMetadata':{'type':Sequelize[_0x337f('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 3013270..d1f5b6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc04f=['color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','findOne','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','ChatWebsite','rows','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','systemAvatar','notify','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','asc','from','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','push','close','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','sendMail','email','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags'];(function(_0x160085,_0x5c8fd2){var _0x2f61d3=function(_0x374fba){while(--_0x374fba){_0x160085['push'](_0x160085['shift']());}};_0x2f61d3(++_0x5c8fd2);}(_0xc04f,0x165));var _0xfc04=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0xc04f[_0x2331f8];return _0x244773;};'use strict';var emlformat=require(_0xfc04('0x0'));var rimraf=require(_0xfc04('0x1'));var zipdir=require(_0xfc04('0x2'));var jsonpatch=require(_0xfc04('0x3'));var rp=require(_0xfc04('0x4'));var moment=require(_0xfc04('0x5'));var BPromise=require(_0xfc04('0x6'));var Mustache=require(_0xfc04('0x7'));var util=require('util');var path=require('path');var sox=require(_0xfc04('0x8'));var csv=require(_0xfc04('0x9'));var ejs=require(_0xfc04('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc04('0xb'));var squel=require(_0xfc04('0xc'));var crypto=require('crypto');var jsforce=require(_0xfc04('0xd'));var deskjs=require(_0xfc04('0xe'));var toCsv=require(_0xfc04('0x9'));var querystring=require(_0xfc04('0xf'));var Papa=require(_0xfc04('0x10'));var Redis=require(_0xfc04('0x11'));var authService=require(_0xfc04('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc04('0x13'));var logger=require('../../config/logger')(_0xfc04('0x14'));var utils=require(_0xfc04('0x15'));var config=require(_0xfc04('0x16'));var licenseUtil=require(_0xfc04('0x17'));var db=require(_0xfc04('0x18'))['db'];config[_0xfc04('0x19')]=_[_0xfc04('0x1a')](config[_0xfc04('0x19')],{'host':_0xfc04('0x1b'),'port':0x18eb});var socket=require(_0xfc04('0x1c'))(new Redis(config[_0xfc04('0x19')]));require(_0xfc04('0x1d'))[_0xfc04('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfc04('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xfc04('0x1f')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0xfc04('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5df5bb,_0x5e8c00,_0x39b177,_0x3e1aa1){return new BPromise(function(_0x13f951,_0x403f70){var _0x46162d=_0x3e1aa1||client;return _0x46162d[_0xfc04('0x21')](_0x5df5bb,_0x39b177)[_0xfc04('0x22')](function(_0x31d2e5){logger[_0xfc04('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5e8c00,_0xfc04('0x24'));logger[_0xfc04('0x25')](_0xfc04('0x26'),_0x5e8c00,_0xfc04('0x24'),JSON['stringify'](_0x31d2e5));if(_0x31d2e5[_0xfc04('0x27')]){if(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x28')]===0x1f4){logger['error'](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x403f70(_0x31d2e5[_0xfc04('0x27')]['message']);}logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x31d2e5['error'][_0xfc04('0x2a')]);return _0x13f951(_0x31d2e5[_0xfc04('0x27')][_0xfc04('0x2a')]);}else{logger['info'](_0xfc04('0x29'),_0x5e8c00,'request\x20sent');_0x13f951(_0x31d2e5[_0xfc04('0x2b')][_0xfc04('0x2a')]);}})[_0xfc04('0x2c')](function(_0x3579f1){logger[_0xfc04('0x27')](_0xfc04('0x29'),_0x5e8c00,_0x3579f1);_0x403f70(_0x3579f1);});});}function respondWithStatusCode(_0x7224d0,_0x2ae4a2){_0x2ae4a2=_0x2ae4a2||0xcc;return function(_0x5f09ba){if(_0x5f09ba){return _0x7224d0['sendStatus'](_0x2ae4a2);}return _0x7224d0[_0xfc04('0x2d')](_0x2ae4a2)[_0xfc04('0x2e')]();};}function respondWithResult(_0x3fdbed,_0x2b8264){_0x2b8264=_0x2b8264||0xc8;return function(_0x1fd986){if(_0x1fd986){return _0x3fdbed[_0xfc04('0x2d')](_0x2b8264)[_0xfc04('0x2f')](_0x1fd986);}};}function respondWithFilteredResult(_0x5ea5d1,_0x42525e){return function(_0x5d2b36){if(_0x5d2b36){var _0x44b659=typeof _0x42525e[_0xfc04('0x30')]===_0xfc04('0x31')&&typeof _0x42525e[_0xfc04('0x32')]===_0xfc04('0x31');var _0x3bbd4f=_0x5d2b36[_0xfc04('0x33')];var _0x48c848=_0x44b659?0x0:_0x42525e[_0xfc04('0x30')];var _0x202c61=_0x44b659?_0x5d2b36[_0xfc04('0x33')]:_0x42525e[_0xfc04('0x30')]+_0x42525e['limit'];var _0x5bbbc2;if(_0x202c61>=_0x3bbd4f){_0x202c61=_0x3bbd4f;_0x5bbbc2=0xc8;}else{_0x5bbbc2=0xce;}_0x5ea5d1[_0xfc04('0x2d')](_0x5bbbc2);return _0x5ea5d1['set'](_0xfc04('0x34'),_0x48c848+'-'+_0x202c61+'/'+_0x3bbd4f)[_0xfc04('0x2f')](_0x5d2b36);}return null;};}function patchUpdates(_0x390d1d){return function(_0x2e0d36){try{jsonpatch[_0xfc04('0x35')](_0x2e0d36,_0x390d1d,!![]);}catch(_0xab5f87){return BPromise[_0xfc04('0x36')](_0xab5f87);}return _0x2e0d36[_0xfc04('0x37')]();};}function saveUpdates(_0x530af7,_0x833d8){return function(_0x18f868){if(_0x18f868){return _0x18f868[_0xfc04('0x38')](_0x530af7)['then'](function(_0x142e54){return _0x142e54;});}return null;};}function removeEntity(_0x1b80f0,_0x29b787){return function(_0x5ebfce){if(_0x5ebfce){return _0x5ebfce[_0xfc04('0x39')]()[_0xfc04('0x22')](function(){var _0x29fc1d=_0x5ebfce[_0xfc04('0x3a')]({'plain':!![]});var _0x5abaaa='ChatWebsites';return db[_0xfc04('0x3b')][_0xfc04('0x39')]({'where':{'type':_0x5abaaa,'resourceId':_0x29fc1d['id']}})[_0xfc04('0x22')](function(){return _0x5ebfce;});})[_0xfc04('0x22')](function(){_0x1b80f0[_0xfc04('0x2d')](0xcc)[_0xfc04('0x2e')]();});}};}function handleEntityNotFound(_0x3e050e,_0x10adf4){return function(_0xf8870c){if(!_0xf8870c){_0x3e050e[_0xfc04('0x3c')](0x194);}return _0xf8870c;};}function handleError(_0x52576e,_0x34c3fe){_0x34c3fe=_0x34c3fe||0x1f4;return function(_0xacb3de){logger['error'](_0xacb3de[_0xfc04('0x3d')]);if(_0xacb3de[_0xfc04('0x3e')]){delete _0xacb3de[_0xfc04('0x3e')];}_0x52576e[_0xfc04('0x2d')](_0x34c3fe)[_0xfc04('0x3f')](_0xacb3de);};}exports[_0xfc04('0x40')]=function(_0x20863d,_0x57cef0){var _0x2b0a7e={'include':[{'model':db[_0xfc04('0x41')],'as':'mandatoryDispositionPause'}]},_0x120424={},_0x4b539b={'count':0x0,'rows':[]};var _0x4a6285=_[_0xfc04('0x42')](db['ChatWebsite'][_0xfc04('0x43')],function(_0x38309e){return{'name':_0x38309e[_0xfc04('0x44')],'type':_0x38309e['type'][_0xfc04('0x45')]};});_0x120424[_0xfc04('0x46')]=_['map'](_0x4a6285,_0xfc04('0x3e'));_0x120424[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x20863d[_0xfc04('0x47')]);_0x120424[_0xfc04('0x49')]=_['intersection'](_0x120424[_0xfc04('0x46')],_0x120424[_0xfc04('0x47')]);_0x2b0a7e['attributes']=_[_0xfc04('0x4a')](_0x120424['model'],qs[_0xfc04('0x4b')](_0x20863d['query'][_0xfc04('0x4b')]));_0x2b0a7e[_0xfc04('0x4c')]=_0x2b0a7e['attributes'][_0xfc04('0x4d')]?_0x2b0a7e['attributes']:_0x120424[_0xfc04('0x46')];if(!_0x20863d[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x2b0a7e[_0xfc04('0x32')]=qs['limit'](_0x20863d['query'][_0xfc04('0x32')]);_0x2b0a7e[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x20863d[_0xfc04('0x47')]['offset']);}_0x2b0a7e[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x20863d[_0xfc04('0x47')][_0xfc04('0x51')]);_0x2b0a7e[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x20863d[_0xfc04('0x47')],_0x120424[_0xfc04('0x49')]),_0x4a6285);if(_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x2b0a7e[_0xfc04('0x52')]=_['merge'](_0x2b0a7e['where'],{'$or':_[_0xfc04('0x42')](_0x4a6285,function(_0x4bd8cf){if(_0x4bd8cf[_0xfc04('0x55')]!==_0xfc04('0x56')){var _0x137b2c={};_0x137b2c[_0x4bd8cf[_0xfc04('0x3e')]]={'$like':'%'+_0x20863d[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x137b2c;}})});}_0x2b0a7e=_[_0xfc04('0x57')]({},_0x2b0a7e,_0x20863d[_0xfc04('0x58')]);var _0x57ee42={'where':_0x2b0a7e[_0xfc04('0x52')]};return db['ChatWebsite'][_0xfc04('0x33')](_0x57ee42)[_0xfc04('0x22')](function(_0x4eb103){_0x4b539b['count']=_0x4eb103;if(_0x20863d['query'][_0xfc04('0x59')]){_0x2b0a7e['include']=[{'all':!![]}];}return db[_0xfc04('0x5a')]['findAll'](_0x2b0a7e);})['then'](function(_0x586975){_0x4b539b[_0xfc04('0x5b')]=_0x586975;return _0x4b539b;})[_0xfc04('0x22')](respondWithFilteredResult(_0x57cef0,_0x2b0a7e))[_0xfc04('0x2c')](handleError(_0x57cef0,null));};exports[_0xfc04('0x5c')]=function(_0x19ca83,_0x5e090a){var _0x3ec12b={'raw':![],'where':{'id':_0x19ca83[_0xfc04('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2300a0={};_0x2300a0[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x5a')][_0xfc04('0x43')]);_0x2300a0[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x19ca83['query']);_0x2300a0['filters']=_['intersection'](_0x2300a0['model'],_0x2300a0['query']);_0x3ec12b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2300a0['model'],qs[_0xfc04('0x4b')](_0x19ca83['query']['fields']));_0x3ec12b[_0xfc04('0x4c')]=_0x3ec12b[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x3ec12b['attributes']:_0x2300a0[_0xfc04('0x46')];if(_0x19ca83[_0xfc04('0x47')][_0xfc04('0x59')]){_0x3ec12b[_0xfc04('0x5e')]=[{'all':!![]}];}_0x3ec12b=_[_0xfc04('0x57')]({},_0x3ec12b,_0x19ca83['options']);return db[_0xfc04('0x5a')]['find'](_0x3ec12b)[_0xfc04('0x22')](handleEntityNotFound(_0x5e090a,null))['then'](respondWithResult(_0x5e090a,null))['catch'](handleError(_0x5e090a,null));};exports[_0xfc04('0x5f')]=function(_0x171ced,_0x7445de){return db['ChatWebsite'][_0xfc04('0x5f')](_0x171ced['body'],{})[_0xfc04('0x22')](function(_0x1d2d66){var _0x10f94a=_0x171ced[_0xfc04('0x60')]['get']({'plain':!![]});if(!_0x10f94a)throw new Error(_0xfc04('0x61'));if(_0x10f94a[_0xfc04('0x62')]===_0xfc04('0x60')){var _0x5854c0=_0x1d2d66[_0xfc04('0x3a')]({'plain':!![]});var _0x1ed749='ChatWebsites';return db['UserProfileSection'][_0xfc04('0x63')]({'where':{'name':_0x1ed749,'userProfileId':_0x10f94a[_0xfc04('0x64')]},'raw':!![]})[_0xfc04('0x22')](function(_0x51569e){if(_0x51569e&&_0x51569e[_0xfc04('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0x5854c0[_0xfc04('0x3e')],'resourceId':_0x5854c0['id'],'type':_0x51569e[_0xfc04('0x3e')],'sectionId':_0x51569e['id']},{})[_0xfc04('0x22')](function(){return _0x1d2d66;});}else{return _0x1d2d66;}})[_0xfc04('0x2c')](function(_0x47f75c){logger[_0xfc04('0x27')](_0xfc04('0x66'),_0x47f75c);throw _0x47f75c;});}return _0x1d2d66;})[_0xfc04('0x22')](respondWithResult(_0x7445de,0xc9))[_0xfc04('0x2c')](handleError(_0x7445de,null));};exports[_0xfc04('0x38')]=function(_0x2f879f,_0x460a82){if(_0x2f879f[_0xfc04('0x67')]['id']){delete _0x2f879f['body']['id'];}return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x2f879f['params']['id']},'include':[{'model':db[_0xfc04('0x41')],'as':_0xfc04('0x68')}]})[_0xfc04('0x22')](handleEntityNotFound(_0x460a82,null))[_0xfc04('0x22')](saveUpdates(_0x2f879f['body'],null))['then'](respondWithResult(_0x460a82,null))[_0xfc04('0x2c')](handleError(_0x460a82,null));};exports[_0xfc04('0x39')]=function(_0xde6582,_0x4239a2){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xde6582[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x4239a2,null))['then'](removeEntity(_0x4239a2,null))[_0xfc04('0x2c')](handleError(_0x4239a2,null));};exports['describe']=function(_0x2ad72c,_0x10d275){return db['ChatWebsite'][_0xfc04('0x69')]()[_0xfc04('0x22')](respondWithResult(_0x10d275,null))[_0xfc04('0x2c')](handleError(_0x10d275,null));};exports[_0xfc04('0x6a')]=function(_0x530320,_0x20bb9a,_0x18e662){if(_0x530320[_0xfc04('0x67')]['id']){delete _0x530320[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x530320[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x20bb9a,null))[_0xfc04('0x22')](function(_0x3d8971){if(_0x3d8971){_0x530320['body'][_0xfc04('0x6b')]=_0x3d8971['id'];return db[_0xfc04('0x6c')][_0xfc04('0x5f')](_0x530320[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x20bb9a,null))[_0xfc04('0x2c')](handleError(_0x20bb9a,null));};exports[_0xfc04('0x6d')]=function(_0x60be3d,_0x5d8ba8,_0x327db7){var _0x5c20bf={'raw':![],'where':{}};var _0x223e4f={};var _0x504750={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0x60be3d[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x5d8ba8,null))[_0xfc04('0x22')](function(_0x1362a7){if(_0x1362a7){_0x223e4f[_0xfc04('0x46')]=_['keys'](db['Disposition'][_0xfc04('0x43')]);_0x223e4f[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x60be3d[_0xfc04('0x47')]);_0x223e4f['filters']=_[_0xfc04('0x4a')](_0x223e4f[_0xfc04('0x46')],_0x223e4f[_0xfc04('0x47')]);_0x5c20bf[_0xfc04('0x4c')]=_['intersection'](_0x223e4f[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x60be3d[_0xfc04('0x47')]['fields']));_0x5c20bf['attributes']=_0x5c20bf[_0xfc04('0x4c')]['length']?_0x5c20bf[_0xfc04('0x4c')]:_0x223e4f[_0xfc04('0x46')];if(!_0x60be3d['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x5c20bf[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x60be3d[_0xfc04('0x47')]['limit']);_0x5c20bf['offset']=qs[_0xfc04('0x30')](_0x60be3d[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x5c20bf['order']=qs[_0xfc04('0x51')](_0x60be3d[_0xfc04('0x47')]['sort']);_0x5c20bf[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x60be3d[_0xfc04('0x47')],_0x223e4f[_0xfc04('0x49')]));_0x5c20bf['where']['ChatWebsiteId']=_0x1362a7['id'];if(_0x60be3d[_0xfc04('0x47')][_0xfc04('0x54')]){_0x5c20bf['where']=_[_0xfc04('0x57')](_0x5c20bf['where'],{'$or':_['map'](_0x5c20bf[_0xfc04('0x4c')],function(_0x2e473e){var _0x413268={};_0x413268[_0x2e473e]={'$like':'%'+_0x60be3d[_0xfc04('0x47')]['filter']+'%'};return _0x413268;})});}_0x5c20bf=_[_0xfc04('0x57')]({},_0x5c20bf,_0x60be3d['options']);return db[_0xfc04('0x6c')]['count']({'where':_0x5c20bf['where']})[_0xfc04('0x22')](function(_0x38cee5){_0x504750[_0xfc04('0x33')]=_0x38cee5;if(_0x60be3d['query'][_0xfc04('0x59')]){_0x5c20bf['include']=[{'all':!![]}];}return db[_0xfc04('0x6c')][_0xfc04('0x6e')](_0x5c20bf);})[_0xfc04('0x22')](function(_0x59a2e3){_0x504750['rows']=_0x59a2e3;return _0x504750;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x5d8ba8,_0x5c20bf))[_0xfc04('0x2c')](handleError(_0x5d8ba8,null));};exports['removeDispositions']=function(_0xfa1bc3,_0x4719d0,_0x295f3a){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0xfa1bc3[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4719d0,null))[_0xfc04('0x22')](function(_0x3cb129){if(_0x3cb129){return _0x3cb129[_0xfc04('0x6f')](_0xfa1bc3[_0xfc04('0x47')][_0xfc04('0x70')]);}})[_0xfc04('0x22')](respondWithStatusCode(_0x4719d0,null))['catch'](handleError(_0x4719d0,null));};exports[_0xfc04('0x71')]=function(_0x23ce7a,_0x4ab686,_0x24c0bd){if(_0x23ce7a[_0xfc04('0x67')]['id']){delete _0x23ce7a[_0xfc04('0x67')]['id'];}return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x23ce7a[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4ab686,null))[_0xfc04('0x22')](function(_0x552d6e){if(_0x552d6e){_0x23ce7a[_0xfc04('0x67')][_0xfc04('0x6b')]=_0x552d6e['id'];return db[_0xfc04('0x72')][_0xfc04('0x5f')](_0x23ce7a[_0xfc04('0x67')]);}})[_0xfc04('0x22')](respondWithResult(_0x4ab686,null))[_0xfc04('0x2c')](handleError(_0x4ab686,null));};exports[_0xfc04('0x73')]=function(_0x79dd9e,_0x19e961,_0x4c5a1b){var _0x23df0a={'raw':![],'where':{}};var _0x4a71b5={};var _0x328ec6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x79dd9e[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19e961,null))['then'](function(_0x5852fa){if(_0x5852fa){_0x4a71b5[_0xfc04('0x46')]=_['keys'](db['CannedAnswer'][_0xfc04('0x43')]);_0x4a71b5['query']=_[_0xfc04('0x48')](_0x79dd9e[_0xfc04('0x47')]);_0x4a71b5[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x4a71b5[_0xfc04('0x46')],_0x4a71b5[_0xfc04('0x47')]);_0x23df0a[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x4a71b5['model'],qs['fields'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x23df0a[_0xfc04('0x4c')]=_0x23df0a['attributes'][_0xfc04('0x4d')]?_0x23df0a['attributes']:_0x4a71b5['model'];if(!_0x79dd9e['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x23df0a[_0xfc04('0x32')]=qs[_0xfc04('0x32')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x32')]);_0x23df0a[_0xfc04('0x30')]=qs['offset'](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x23df0a[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x51')]);_0x23df0a[_0xfc04('0x52')]=qs['filters'](_[_0xfc04('0x53')](_0x79dd9e[_0xfc04('0x47')],_0x4a71b5[_0xfc04('0x49')]));_0x23df0a[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x5852fa['id'];if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]){_0x23df0a['where']=_[_0xfc04('0x57')](_0x23df0a[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x23df0a[_0xfc04('0x4c')],function(_0x3f46a7){var _0x1a0120={};_0x1a0120[_0x3f46a7]={'$like':'%'+_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x1a0120;})});}_0x23df0a=_['merge']({},_0x23df0a,_0x79dd9e['options']);return db['CannedAnswer'][_0xfc04('0x33')]({'where':_0x23df0a['where']})[_0xfc04('0x22')](function(_0x18be60){_0x328ec6['count']=_0x18be60;if(_0x79dd9e[_0xfc04('0x47')][_0xfc04('0x59')]){_0x23df0a[_0xfc04('0x5e')]=[{'all':!![]}];}return db[_0xfc04('0x72')][_0xfc04('0x6e')](_0x23df0a);})[_0xfc04('0x22')](function(_0x448655){_0x328ec6[_0xfc04('0x5b')]=_0x448655;return _0x328ec6;});}})['then'](respondWithFilteredResult(_0x19e961,_0x23df0a))[_0xfc04('0x2c')](handleError(_0x19e961,null));};exports[_0xfc04('0x74')]=function(_0x242562,_0xf75fb6,_0x56470c){return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x242562[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xf75fb6,null))[_0xfc04('0x22')](function(_0x45302c){if(_0x45302c){return _0x45302c[_0xfc04('0x74')](_0x242562[_0xfc04('0x47')][_0xfc04('0x70')]);}})['then'](respondWithStatusCode(_0xf75fb6,null))[_0xfc04('0x2c')](handleError(_0xf75fb6,null));};exports[_0xfc04('0x75')]=function(_0x2554f3,_0x21684b,_0x36cd28){_0x2554f3[_0xfc04('0x67')][_0xfc04('0x76')]=_0x2554f3[_0xfc04('0x77')][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x2554f3[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x21684b,null))[_0xfc04('0x22')](saveUpdates(_0x2554f3['body'],null))[_0xfc04('0x22')](respondWithResult(_0x21684b,null))[_0xfc04('0x2c')](handleError(_0x21684b,null));};exports[_0xfc04('0x79')]=function(_0x115469,_0xdb620d,_0x1fe7c2){_0x115469[_0xfc04('0x67')][_0xfc04('0x7a')]=_0x115469[_0xfc04('0x77')][_0xfc04('0x78')];return db['ChatWebsite'][_0xfc04('0x63')]({'where':{'id':_0x115469[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xdb620d,null))[_0xfc04('0x22')](saveUpdates(_0x115469[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0xdb620d,null))[_0xfc04('0x2c')](handleError(_0xdb620d,null));};exports['addCustomerAvatar']=function(_0x1c11ca,_0x49179e,_0x335315){_0x1c11ca['body'][_0xfc04('0x7b')]=_0x1c11ca[_0xfc04('0x77')]['filename'];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x1c11ca[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x49179e,null))[_0xfc04('0x22')](saveUpdates(_0x1c11ca['body'],null))[_0xfc04('0x22')](respondWithResult(_0x49179e,null))[_0xfc04('0x2c')](handleError(_0x49179e,null));};exports[_0xfc04('0x7c')]=function(_0x15a5f1,_0x3a3d1a,_0x40db3f){_0x15a5f1[_0xfc04('0x67')]['systemAvatar']=_0x15a5f1['file'][_0xfc04('0x78')];return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x15a5f1['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3a3d1a,null))[_0xfc04('0x22')](saveUpdates(_0x15a5f1[_0xfc04('0x67')],null))[_0xfc04('0x22')](respondWithResult(_0x3a3d1a,null))[_0xfc04('0x2c')](handleError(_0x3a3d1a,null));};exports[_0xfc04('0x7d')]=function(_0x50fa63,_0x3fa8d1,_0x209946){var _0x1c34c3=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x80'));var _0x3d603e={'where':{'id':_0x50fa63[_0xfc04('0x5d')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x33a855=![];return require(_0xfc04('0x17'))[_0xfc04('0x81')]()[_0xfc04('0x22')](function(_0x365b24){if(_0x365b24){_0x33a855=_0x365b24[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x3d603e);})[_0xfc04('0x22')](handleEntityNotFound(_0x3fa8d1,null))[_0xfc04('0x22')](function(_0x5e5a7a){if(_0x5e5a7a){if(!_['isNil'](_0x5e5a7a[_0xfc04('0x76')])){if(fs['existsSync'](path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]))&&_0x33a855){_0x1c34c3=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x83'),_0x5e5a7a[_0xfc04('0x76')]);}}return _0x3fa8d1['download'](_0x1c34c3);}})['catch'](handleError(_0x3fa8d1,null));};exports[_0xfc04('0x84')]=function(_0x2742cd,_0x1d2cc3,_0x1bdd4f){var _0x5f195a=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x85'));var _0x517954={'where':{'id':_0x2742cd[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7a')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x517954)[_0xfc04('0x22')](handleEntityNotFound(_0x1d2cc3,null))[_0xfc04('0x22')](function(_0x14e4fe){if(_0x14e4fe){if(!_[_0xfc04('0x86')](_0x14e4fe[_0xfc04('0x7a')])){if(fs[_0xfc04('0x87')](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]))){_0x5f195a=path['join'](config['root'],_0xfc04('0x88'),_0x14e4fe[_0xfc04('0x7a')]);}}return _0x1d2cc3[_0xfc04('0x89')](_0x5f195a);}})[_0xfc04('0x2c')](handleError(_0x1d2cc3,null));};exports[_0xfc04('0x8a')]=function(_0x1c5dae,_0x1c40fc,_0x3f7094){var _0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x8b'));var _0x427a80={'where':{'id':_0x1c5dae[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x7b'),_0xfc04('0x8c')],'raw':!![]};return db[_0xfc04('0x5a')][_0xfc04('0x63')](_0x427a80)[_0xfc04('0x22')](handleEntityNotFound(_0x1c40fc,null))['then'](function(_0xb07993){if(_0xb07993){if(!_[_0xfc04('0x86')](_0xb07993['customerAvatar'])){if(fs['existsSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]))&&_0xb07993[_0xfc04('0x8c')]){_0x34806b=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0xb07993[_0xfc04('0x7b')]);}}return _0x1c40fc[_0xfc04('0x89')](_0x34806b);}})[_0xfc04('0x2c')](handleError(_0x1c40fc,null));};exports['getSystemAvatar']=function(_0x3c3516,_0x344d5f,_0x32f04d){var _0x3c84a5=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],'server/files/images/avatars/system_avatar.png');var _0x1a20fd={'where':{'id':_0x3c3516[_0xfc04('0x5d')]['id']},'attributes':['id',_0xfc04('0x8d')],'raw':!![]};return db['ChatWebsite'][_0xfc04('0x63')](_0x1a20fd)[_0xfc04('0x22')](handleEntityNotFound(_0x344d5f,null))['then'](function(_0x332c55){if(_0x332c55){if(!_[_0xfc04('0x86')](_0x332c55[_0xfc04('0x8d')])){if(fs['existsSync'](path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55['systemAvatar']))){_0x3c84a5=path['join'](config[_0xfc04('0x7f')],_0xfc04('0x88'),_0x332c55[_0xfc04('0x8d')]);}}return _0x344d5f[_0xfc04('0x89')](_0x3c84a5);}})[_0xfc04('0x2c')](handleError(_0x344d5f,null));};exports[_0xfc04('0x8e')]=function(_0x3610cd,_0x2ef341,_0x1ae391){var _0x5e9092=require('user-agent-parser');var _0x156611=new _0x5e9092();var _0x461408=_0x156611[_0xfc04('0x8f')](_0x3610cd[_0xfc04('0x90')][_0xfc04('0x91')])[_0xfc04('0x92')]();var _0x48a19f={'body':_0x3610cd[_0xfc04('0x67')],'channel':'chat'};var _0x4eaac9=[];var _0x1fcf7c=[];var _0x4240c5={};var _0x56e5bf=![];return db[_0xfc04('0x93')][_0xfc04('0x69')]()[_0xfc04('0x22')](function(_0xecb567){if(!_0xecb567){throw new db['Sequelize'][(_0xfc04('0x94'))]('no\x20available\x20attributes');}_0x4eaac9=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x1fcf7c=_[_0xfc04('0x95')](_['keys'](_0xecb567),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3610cd[_0xfc04('0x67')]['id']){delete _0x3610cd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')]['from'])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')])||_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')]===''){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c'));}if(_[_0xfc04('0x86')](_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9e')+_0x1fcf7c);}if(!_['includes'](_0x1fcf7c,_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')])){throw new db[(_0xfc04('0x9a'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fcf7c);}_0x4240c5[_0x3610cd[_0xfc04('0x67')][_0xfc04('0x9d')]]=_0x3610cd[_0xfc04('0x67')]['from'];})['then'](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3610cd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':'List','include':[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xa0'),'where':_0x4240c5,'limit':0x1,'order':[[_0xfc04('0x97'),_0xfc04('0xa1')]]}]},{'model':db[_0xfc04('0xa2')],'as':_0xfc04('0xa3')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))[_0xfc04('0x22')](function(_0x414bf7){if(_0x414bf7&&_0x414bf7[_0xfc04('0xa4')]){_0x48a19f[_0xfc04('0xa5')]=_0x414bf7;_0x48a19f['applications']=_0x414bf7['Applications'];_0x48a19f[_0xfc04('0xa6')]=_0x414bf7[_0xfc04('0xa4')];_0x48a19f[_0xfc04('0xa7')]=_[_0xfc04('0xa8')](_0x48a19f[_0xfc04('0xa7')],['priority'],[_0xfc04('0xa9')]);if(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa3')]){delete _0x48a19f[_0xfc04('0xa5')]['Applications'];}if(_0x48a19f[_0xfc04('0xa5')]['List']&&_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xa4')][_0xfc04('0xa0')][_0xfc04('0x4d')]){return _0x48a19f['account'][_0xfc04('0xa4')]['Contacts'][0x0];}var _0x35588e=_[_0xfc04('0x1a')](_0x3610cd['body'],{'firstName':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x414bf7['ListId']});_0x35588e[_0x3610cd['body'][_0xfc04('0x9d')]]=_0x3610cd['body'][_0xfc04('0xaa')];return db['CmContact'][_0xfc04('0x5f')](_0x35588e,{'fields':_0x4eaac9,'raw':!![]});}})[_0xfc04('0x22')](handleEntityNotFound(_0x2ef341,null))['then'](function(_0x19d902){_0x48a19f['contact']=_0x19d902;var _0x2fbeb8=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xab')];if(_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')]){_0x2fbeb8=_0x3610cd[_0xfc04('0x90')][_0xfc04('0xac')];}else if(_0x3610cd['headers']['x-forwarded-for']){_0x2fbeb8=_[_0xfc04('0xad')](_0x3610cd['headers'][_0xfc04('0xae')][_0xfc04('0xaf')](','));}if(_0x19d902){var _0x268065={'ContactId':_0x19d902['id'],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'from':(_0x19d902[_0xfc04('0xb0')]||'')+'\x20'+(_0x19d902[_0xfc04('0xb1')]||''),'customerIp':_0x2fbeb8,'customerPort':_0x3610cd['headers'][_0xfc04('0xb2')]?_0x3610cd[_0xfc04('0x90')][_0xfc04('0xb2')]:null,'referer':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xb3')],'browserName':_0x461408['browser'][_0xfc04('0x3e')]&&_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]?util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408[_0xfc04('0xb4')][_0xfc04('0x3e')],_0x461408['browser'][_0xfc04('0xb5')]):_0xfc04('0xb8'),'browserVersion':_0x461408[_0xfc04('0xb4')][_0xfc04('0xb5')]||_0xfc04('0xb8'),'osName':util[_0xfc04('0xb6')](_0xfc04('0xb7'),_0x461408['os'][_0xfc04('0x3e')],_0x461408['os'][_0xfc04('0xb5')]),'osVersion':_0x461408['os'][_0xfc04('0xb5')],'deviceModel':_0x461408['device']['model']&&_0x461408[_0xfc04('0xb9')]['vendor']?util[_0xfc04('0xb6')](_0xfc04('0xba'),_0x461408[_0xfc04('0xb9')]['model'],_0x461408[_0xfc04('0xb9')]['vendor'],_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')]):null,'deviceVendor':_0x461408[_0xfc04('0xb9')][_0xfc04('0xbb')],'deviceType':_0x461408[_0xfc04('0xb9')][_0xfc04('0x55')],'formData':JSON['stringify'](_0x3610cd[_0xfc04('0x67')])};var _0x2ca0af={'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'closed':![]};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]){_0x2ca0af['threadId']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')];return db[_0xfc04('0xbd')]['find']({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x17d1ea){if(_0x17d1ea){return[_0x17d1ea,![]];}_0x268065[_0xfc04('0xbc')]=_0x3610cd['body']['threadId'];_0x268065['externalUrl']=_0x3610cd['body'][_0xfc04('0xbe')];return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x226f0a){return[_0x226f0a,!![]];});});}_0x2ca0af[_0xfc04('0xbf')]=_0x19d902['id'];if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id']){_0x2ca0af['id']=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc0')]['id'];return db[_0xfc04('0xbd')][_0xfc04('0x63')]({'where':_0x2ca0af})[_0xfc04('0x22')](function(_0x3cb86a){if(_0x3cb86a){return[_0x3cb86a,![]];}return db[_0xfc04('0xbd')][_0xfc04('0x5f')](_0x268065)['then'](function(_0xd2b3de){return[_0xd2b3de,!![]];});});}return db['ChatInteraction'][_0xfc04('0x5f')](_0x268065)[_0xfc04('0x22')](function(_0x161d95){return[_0x161d95,!![]];});}})[_0xfc04('0xc1')](function(_0x49958c,_0x2fd701){if(_0x49958c){_0x56e5bf=_0x2fd701;if(!_0x2fd701){var _0x1d25dc={'from':(_0x48a19f[_0xfc04('0xc2')]['firstName']||'')+'\x20'+(_0x48a19f[_0xfc04('0xc2')][_0xfc04('0xb1')]||'')};if(_0x3610cd[_0xfc04('0x67')][_0xfc04('0xbc')]&&_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]&&_0x3610cd['body']['threadId']!=_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc3')]){_0x1d25dc[_0xfc04('0xbc')]=_0x3610cd['body'][_0xfc04('0xc3')];}return _0x49958c[_0xfc04('0x38')](_0x1d25dc);}else{return _0x49958c;}}})[_0xfc04('0x22')](function(_0x29f6b8){_0x48a19f['interaction']=_0x29f6b8[_0xfc04('0x3a')]({'plain':!![]});_0x48a19f['interaction'][_0xfc04('0xc4')]=_0x56e5bf;if(_0x48a19f['interaction'][_0xfc04('0xc4')]){if(_0x48a19f[_0xfc04('0xa5')]['autoclose']){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xc5')]({'id':0x0,'priority':_0x48a19f[_0xfc04('0xa7')][_0xfc04('0x4d')]+0x1,'app':_0xfc04('0xc6'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xfc04('0xc7')][_0xfc04('0x5f')]({'body':_0x3610cd[_0xfc04('0x67')][_0xfc04('0x67')],'ChatWebsiteId':_0x3610cd[_0xfc04('0x5d')]['id'],'ChatInteractionId':_0x29f6b8['id'],'direction':'in','ContactId':_0x48a19f[_0xfc04('0xc2')]['id'],'AttachmentId':_0x3610cd[_0xfc04('0x67')][_0xfc04('0xc8')]});})[_0xfc04('0x22')](function(_0x532a74){_0x48a19f[_0xfc04('0x2a')]=_0x532a74;if(_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]){return db[_0xfc04('0xca')][_0xfc04('0x63')]({'attributes':['id','name'],'where':{'id':_0x48a19f[_0xfc04('0xc0')][_0xfc04('0xc9')]}})[_0xfc04('0x22')](function(_0x586a3f){if(_0x586a3f){_0x48a19f[_0xfc04('0xa7')][_0xfc04('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x586a3f[_0xfc04('0x3e')]+','+(_0x48a19f[_0xfc04('0xa5')][_0xfc04('0xcc')]||0xa),'interval':_0xfc04('0xcd')});_0x48a19f['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfc04('0xce'),_0xfc04('0xcf'),_0x48a19f);});}return respondWithRpcPromise(_0xfc04('0xce'),'startRouting',_0x48a19f);})[_0xfc04('0x22')](function(_0x5c2e16){respondWithRpcPromise('EventManager',_0xfc04('0xd0'),{'event':_0xfc04('0x8e'),'message':_0x5c2e16},client9002);return _0x5c2e16;})['then'](respondWithResult(_0x2ef341,null))[_0xfc04('0x2c')](handleError(_0x2ef341,null));};exports['offline']=function(_0x3ab9dd,_0x332d6b,_0x515444){var _0x3a53b6,_0x295b34,_0xca2025;var _0x37cb57=[];var _0x843d8b=[];var _0x2f2231={};var _0x2b64cd=_0x3ab9dd[_0xfc04('0xd1')]||[];var _0x4ba4a3=[];var _0x375e57;return db[_0xfc04('0x93')][_0xfc04('0x69')]()['then'](function(_0x3e717d){if(!_0x3e717d){throw new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd2'));}_0x843d8b=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97')]);_0x37cb57=_[_0xfc04('0x95')](_[_0xfc04('0x48')](_0x3e717d),[_0xfc04('0x96'),_0xfc04('0x97'),_0xfc04('0x98'),_0xfc04('0x99')]);if(_0x3ab9dd[_0xfc04('0x67')]['id']){delete _0x3ab9dd[_0xfc04('0x67')]['id'];}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0xaa')])){throw _0x332d6b['status'](0x1f4)['send'](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9b')));}if(_[_0xfc04('0x86')](_0x3ab9dd['body'][_0xfc04('0x67')])||_0x3ab9dd['body']['body']===''){throw _0x332d6b[_0xfc04('0x2d')](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0x9c')));}if(_[_0xfc04('0x86')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))][(_0xfc04('0x94'))](_0xfc04('0xd4')+_0x37cb57));}if(!_[_0xfc04('0xd5')](_0x37cb57,_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')])){throw _0x332d6b['status'](0x1f4)[_0xfc04('0x3f')](new db[(_0xfc04('0x9a'))]['ValidationError'](_0xfc04('0xd6')+_0x37cb57));}_0x2f2231[_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xd3')]]=_0x3ab9dd[_0xfc04('0x67')]['from'];})[_0xfc04('0x22')](function(){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x3ab9dd[_0xfc04('0x5d')]['id']},'include':[{'model':db[_0xfc04('0x9f')],'as':_0xfc04('0xa4')},{'model':db['MailAccount'],'as':_0xfc04('0xd7')}]});})[_0xfc04('0x22')](handleEntityNotFound(_0x332d6b,null))[_0xfc04('0x22')](function(_0x1cbc51){if(_0x1cbc51&&_0x1cbc51[_0xfc04('0xa4')]){_0x295b34=_0x1cbc51;var _0x3e3c46=_[_0xfc04('0x1a')](_0x3ab9dd[_0xfc04('0x67')],{'firstName':_0x3ab9dd[_0xfc04('0x67')]['from'],'phone':_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0xaa')],'ListId':_0x1cbc51[_0xfc04('0x99')]});_0x3e3c46[_0x3ab9dd[_0xfc04('0x67')]['mapKeyOffline']]=_0x3ab9dd[_0xfc04('0x67')]['from'];return db['CmContact'][_0xfc04('0xd8')]({'where':_0x2f2231,'defaults':_0x3e3c46});}})[_0xfc04('0xc1')](function(_0x1fbc9b){if(_0x1fbc9b){_0xca2025=_0x1fbc9b;var _0x6d08a0=fs[_0xfc04('0xd9')](path[_0xfc04('0x7e')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xfc04('0xda'));var _0x5d9c9c=ejs[_0xfc04('0xdb')](_0x6d08a0,{'body':_[_0xfc04('0xdc')](_0x3ab9dd[_0xfc04('0x67')][_0xfc04('0x67')]),'bodyTitle':_0x295b34[_0xfc04('0xdd')]});return db[_0xfc04('0xde')][_0xfc04('0x5f')]({'body':_0x5d9c9c,'ContactId':_0x1fbc9b['id'],'ChatWebsiteId':_0x295b34['id']});}})[_0xfc04('0x22')](function(_0xb159a1){_0x375e57=_0xb159a1;if(_0x2b64cd['length']){var _0x3234b3=_0x2b64cd[_0xfc04('0x42')](function(_0x33aa84){return{'name':_0x33aa84['originalname'],'basename':_0x33aa84[_0xfc04('0x78')],'type':_0x33aa84[_0xfc04('0xdf')],'ChatOfflineMessageId':_0xb159a1['id']};});_0x4ba4a3=_0x3234b3[_0xfc04('0x42')](_0x5cc30d=>{var _0x50c124={'filename':_0x5cc30d['name'],'path':path[_0xfc04('0x7e')](config['root'],_0xfc04('0xe0'),'files',_0xfc04('0xe1'),_0xfc04('0xe2'),_0x5cc30d[_0xfc04('0xe3')])};return _0x50c124;});if(!_0x295b34[_0xfc04('0xe4')]){return db['sequelize'][_0xfc04('0xe5')](function(_0x5d07a4){return db['Attachment'][_0xfc04('0xe6')](_0x3234b3,{'transaction':_0x5d07a4});});}}})['then'](function(){if(_0x375e57){_0x3a53b6=_0x375e57;return db[_0xfc04('0xd7')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xfc04('0xe7')],'as':_0xfc04('0xe8'),'raw':!![]}]});}})['then'](function(_0x51cf68){if(_0x51cf68&&_0x51cf68['Smtp']&&_0x295b34['forwardOffline']&&_0x295b34[_0xfc04('0xe9')]){var _0xc222b3={'tls':{'rejectUnauthorized':![]}};if(_0x51cf68[_0xfc04('0xe8')]['service']){_0xc222b3[_0xfc04('0xea')]=_0x51cf68['Smtp'][_0xfc04('0xea')];}else{_0xc222b3[_0xfc04('0xeb')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xeb')];_0xc222b3[_0xfc04('0xec')]=_0x51cf68[_0xfc04('0xe8')][_0xfc04('0xec')];_0xc222b3['secure']=_0x51cf68['Smtp'][_0xfc04('0xed')];}if(_0x51cf68[_0xfc04('0xe8')]['authentication']){_0xc222b3[_0xfc04('0xee')]={'user':_0x51cf68['Smtp'][_0xfc04('0x60')],'pass':_0x51cf68['Smtp'][_0xfc04('0xef')]};}return respondWithRpcPromise('SendMail',_0xfc04('0xf0'),{'account':_0xc222b3,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x51cf68[_0xfc04('0x3e')],_0x51cf68[_0xfc04('0xf1')]||_0x51cf68['Smtp'][_0xfc04('0x60')]),'to':_0x295b34['forwardOfflineAddress'],'subject':_0x295b34['offlineMessageSubject'],'html':_0x3a53b6['body'],'attachments':_0x4ba4a3}},client9003)[_0xfc04('0x22')](function(){return _0x3a53b6;})['catch'](function(_0x13ad14){console['error'](_0x13ad14);});}})['then'](function(){if(_0x295b34&&_0x295b34[_0xfc04('0xe4')]&&_0x295b34['MailAccountId']){var _0x26b203=[];if(_0x2b64cd['length']){_0x26b203=_0x2b64cd[_0xfc04('0x42')](function(_0x56d1a8){return{'name':_0x56d1a8['originalname'],'basename':_0x56d1a8[_0xfc04('0x78')],'type':_0x56d1a8['mimetype'],'ChatOfflineMessageId':_0x375e57['id']};});}var _0x4e9fae;if(!_['isNil'](_0x295b34[_0xfc04('0xf2')])){var _0x3c9f73=_['map'](_0x3ab9dd[_0xfc04('0x67')],function(_0x1e736f){return _0x1e736f;});var _0x2f215e=_[_0xfc04('0xf3')](_0x3c9f73)[0x0];var _0x2cfd60=_[_0xfc04('0xf4')](_0x2f215e,function(_0x27d3f4){return _0x27d3f4;});_0x4e9fae=_0x2cfd60[0x1][_0x295b34[_0xfc04('0xf2')]];}var _0x218341={'from':_0xca2025['email'],'firstName':_0xca2025[_0xfc04('0xb0')],'lastName':_0xca2025[_0xfc04('0xb1')],'mapKey':_0xfc04('0xf1'),'message':{'from':_0xca2025[_0xfc04('0xf1')],'to':_0x295b34[_0xfc04('0xd7')][_0xfc04('0xf1')],'cc':'','subject':_[_0xfc04('0x86')](_0x4e9fae)?_0x295b34[_0xfc04('0xf5')]:_0x4e9fae,'messageId':'','sentAt':new Date(),'attach':_0x26b203[_0xfc04('0x4d')],'attachments':_0x26b203,'originChannel':_0xfc04('0xf6'),'ChatWebsiteId':_0x295b34['id'],'ChatOfflineMessageId':_0x3a53b6['id'],'originTo':_0x295b34[_0xfc04('0xd7')]['email']},'body':_0x3a53b6[_0xfc04('0x67')]};var _0x5c1924={'account':{'id':_0x295b34[_0xfc04('0xf7')]},'body':_0x218341,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xfc04('0xf8'),_0x5c1924,client9001)[_0xfc04('0x22')](function(){return _0x3a53b6;})[_0xfc04('0x2c')](function(_0x58e085){console[_0xfc04('0x27')](_0x58e085);});}return;})['then'](function(){if(_0x3a53b6){return _0x3a53b6;}})['then'](respondWithResult(_0x332d6b,null))[_0xfc04('0x2c')](function(_0x2fb138){console['error'](_0xfc04('0x2c'),_0x2fb138);for(var _0x14dfc3 of _0x2b64cd){var _0x1d6b67=path[_0xfc04('0x7e')](config[_0xfc04('0x7f')],_0xfc04('0xe0'),_0xfc04('0xd1'),'attachments','offline-chat',_0x14dfc3[_0xfc04('0x78')]);fs_extra['remove'](_0x1d6b67)[_0xfc04('0x2c')](function(_0x921364){console[_0xfc04('0x27')](_0xfc04('0xf9'),_0x1d6b67,_0x921364);});}});};exports[_0xfc04('0xfa')]=function(_0x279702,_0x560b65,_0x19ce19){return db[_0xfc04('0xbd')]['find']({'where':{'id':_0x279702[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x560b65,null))['then'](function(_0x4bba70){if(_0x4bba70){return _0x4bba70[_0xfc04('0xfa')](_0x279702[_0xfc04('0x67')][_0xfc04('0x70')],_[_0xfc04('0xfb')](_0x279702[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})[_0xfc04('0x22')](respondWithResult(_0x560b65,null))['catch'](handleError(_0x560b65,null));};exports[_0xfc04('0xfc')]=function(_0xd11fb,_0x2d3dda,_0x590501){var _0x4de7b7={'raw':![],'where':{}};var _0x3abe26={};var _0x284ab9={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')]['findOne']({'where':{'id':_0xd11fb[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2d3dda,null))[_0xfc04('0x22')](function(_0x43160c){if(_0x43160c){_0x3abe26[_0xfc04('0x46')]=_[_0xfc04('0x48')](db['ChatInteraction'][_0xfc04('0x43')]);_0x3abe26['query']=_['keys'](_0xd11fb[_0xfc04('0x47')]);_0x3abe26[_0xfc04('0x49')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],_0x3abe26[_0xfc04('0x47')]);_0x4de7b7[_0xfc04('0x4c')]=_['intersection'](_0x3abe26[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x4de7b7[_0xfc04('0x4c')]=_0x4de7b7[_0xfc04('0x4c')]['length']?_0x4de7b7[_0xfc04('0x4c')]:_0x3abe26[_0xfc04('0x46')];if(!_0xd11fb[_0xfc04('0x47')][_0xfc04('0x4e')](_0xfc04('0x4f'))){_0x4de7b7[_0xfc04('0x32')]=qs['limit'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4de7b7[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x30')]);}_0x4de7b7[_0xfc04('0x50')]=qs['sort'](_0xd11fb[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4de7b7[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0xd11fb[_0xfc04('0x47')],_0x3abe26[_0xfc04('0x49')]));_0x4de7b7[_0xfc04('0x52')][_0xfc04('0x6b')]=_0x43160c['id'];if(_0xd11fb['query'][_0xfc04('0x54')]){_0x4de7b7[_0xfc04('0x52')]=_['merge'](_0x4de7b7[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x4de7b7['attributes'],function(_0x435600){var _0x5731c0={};_0x5731c0[_0x435600]={'$like':'%'+_0xd11fb[_0xfc04('0x47')]['filter']+'%'};return _0x5731c0;})});}_0x4de7b7=_[_0xfc04('0x57')]({},_0x4de7b7,_0xd11fb[_0xfc04('0x58')]);return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':_0x4de7b7[_0xfc04('0x52')]})[_0xfc04('0x22')](function(_0x45ce8c){_0x284ab9['count']=_0x45ce8c;if(_0xd11fb['query'][_0xfc04('0x59')]){_0x4de7b7[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':_0xfc04('0xfd'),'required':![]},{'model':db[_0xfc04('0xca')],'as':_0xfc04('0xfe'),'attributes':[_0xfc04('0x3e'),_0xfc04('0xff'),_0xfc04('0x100')],'required':![]},{'model':db[_0xfc04('0x101')],'as':_0xfc04('0x102'),'attributes':['id',_0xfc04('0x3e'),_0xfc04('0x103')],'where':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?{'id':_0xd11fb['query'][_0xfc04('0x104')]}:undefined,'required':_0xd11fb[_0xfc04('0x47')][_0xfc04('0x104')]?!![]:![]}];}return db[_0xfc04('0xbd')][_0xfc04('0x6e')](_0x4de7b7);})[_0xfc04('0x22')](function(_0x4f2dca){_0x284ab9['rows']=_0x4f2dca;return _0x284ab9;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x2d3dda,_0x4de7b7))[_0xfc04('0x2c')](handleError(_0x2d3dda,null));};function iftimePromise(_0x49b35c,_0x423b1a){return respondWithRpcPromise(_0xfc04('0x105'),_0xfc04('0x106'),{'command':_0x423b1a[_0xfc04('0x107')]?util[_0xfc04('0xb6')](_0xfc04('0x108'),_0x49b35c[_0xfc04('0x109')],_0x423b1a[_0xfc04('0x107')]):util[_0xfc04('0xb6')](_0xfc04('0x10a'),_0x49b35c['interval'])},client9002)[_0xfc04('0x22')](function(_0x37e748){var _0x4dfcdf=_0x37e748&&_0x37e748[_0xfc04('0x10b')]('true')>=0x0?!![]:![];logger[_0xfc04('0x23')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c['interval'],_0x4dfcdf?_0xfc04('0x10d'):'OFFLINE',_0x423b1a[_0xfc04('0x107')]?_0x423b1a[_0xfc04('0x107')]:_0xfc04('0x10e'));return _0x4dfcdf;})[_0xfc04('0x2c')](function(_0x18a6b4){logger[_0xfc04('0x27')](_0xfc04('0x10c'),_0x423b1a['id'],_0x49b35c['id'],_0x49b35c[_0xfc04('0x109')],util[_0xfc04('0x10f')](_0x18a6b4,{'showHidden':![],'depth':null}),_0x423b1a['timezone']?_0x423b1a['timezone']:'No\x20timezone');return![];});}exports[_0xfc04('0x106')]=function(_0x18c462,_0x1afa9f,_0x22ed68){var _0x22c8cf=0x0;var _0x2ed40b=0x0;var _0x1b8422=![];var _0x528e8f;var _0x4ba54c;return db['ChatWebsite']['find']({'where':{'id':_0x18c462['params']['id']},'include':[{'model':db['Interval'],'as':_0xfc04('0x110'),'include':[{'model':db[_0xfc04('0x110')],'as':_0xfc04('0x111'),'attributes':['id',_0xfc04('0x109')],'raw':!![]}]}]})[_0xfc04('0x22')](handleEntityNotFound(_0x1afa9f,null))[_0xfc04('0x22')](function(_0x110b18){if(_0x110b18){_0x528e8f=_0x110b18;return _0x110b18['getProactiveActions']({'raw':!![]});}})[_0xfc04('0x22')](function(_0x344550){if(_0x528e8f){if(_0x344550){_0x4ba54c=_0x344550;}}return require(_0xfc04('0x17'))[_0xfc04('0x81')]();})['then'](function(_0x39fc75){if(_0x39fc75){_0x2ed40b=_0x39fc75['virtual'];_0x1b8422=_0x39fc75[_0xfc04('0x82')];}})[_0xfc04('0x22')](function(){return db[_0xfc04('0xbd')][_0xfc04('0x33')]({'where':{'closed':![]}});})['then'](function(_0x381e8f){_0x22c8cf=_0x381e8f;if(_0x2ed40b&&_0x381e8f>_0x2ed40b){return db['License']['findOne']({'where':{'id':0x1}})[_0xfc04('0x22')](function(_0x21d0a6){if(_0x21d0a6){_0x21d0a6[_0xfc04('0x112')](_0xfc04('0x113'));}});}})['then'](function(){if(_0x528e8f['Interval']&&_0x528e8f[_0xfc04('0x110')][_0xfc04('0x111')]){var _0x525a37=[];for(var _0xcec488=0x0;_0xcec488<_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xfc04('0x4d')];_0xcec488++){var _0x40e63c=_0x528e8f[_0xfc04('0x110')]['Intervals'][_0xcec488][_0xfc04('0x3a')]({'plain':!![]});_0x525a37[_0xfc04('0xc5')](iftimePromise(_0x40e63c,_0x528e8f));}return BPromise['all'](_0x525a37)['then'](function(_0x553a9d){return _['some'](_0x553a9d);});}else{return!![];}})[_0xfc04('0x22')](function(_0x7fe9a5){var _0x17f5b0=fs['readFileSync'](path[_0xfc04('0x7e')](config['root'],_0xfc04('0x114')),_0xfc04('0xda'));var _0x4e0bc4={'remote':_0x528e8f[_0xfc04('0x115')],'query':querystring['stringify'](_['merge'](_0x528e8f[_0xfc04('0x3a')]({'plain':!![]}),{'customerIp':_0x18c462['headers'][_0xfc04('0xae')]||_0x18c462[_0xfc04('0x90')][_0xfc04('0x116')]||_0x18c462[_0xfc04('0x117')][_0xfc04('0x118')]||_0x18c462['ip'],'referer':_0x18c462[_0xfc04('0x90')][_0xfc04('0xb3')],'openedInteractions':_0x22c8cf,'maxInteractions':_0x2ed40b,'virtual':_0x1b8422['virtual'],'online':_0x7fe9a5,'custom':_0x1b8422}))[_0xfc04('0x119')](/'/g,'\x5c\x27')};_0x1afa9f[_0xfc04('0x3f')](ejs[_0xfc04('0xdb')](Mustache[_0xfc04('0xdb')](_0x17f5b0,_0x4e0bc4),{'proactiveActions':_0x4ba54c,'alignment':_0x528e8f[_0xfc04('0x11a')],'verticalAlignment':_0x528e8f[_0xfc04('0x11b')],'div_color':_0x528e8f[_0xfc04('0x103')],'text_color':_0x528e8f[_0xfc04('0x11c')],'button_color':_0x528e8f[_0xfc04('0x11d')],'background_color':_0x528e8f[_0xfc04('0x11e')]}));})[_0xfc04('0x2c')](handleError(_0x1afa9f,null));};exports[_0xfc04('0x11f')]=function(_0x3a59e9,_0x39056d,_0x2c70be){return db['ChatWebsite']['findOne']({'where':{'id':_0x3a59e9['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x39056d,null))[_0xfc04('0x22')](function(_0x24c2e3){if(_0x24c2e3){return db[_0xfc04('0x120')][_0xfc04('0xe5')](function(_0x5cb436){return db[_0xfc04('0xa2')][_0xfc04('0x39')]({'where':{'ChatWebsiteId':_0x3a59e9[_0xfc04('0x5d')]['id']},'transaction':_0x5cb436})['then'](function(_0x2a0a3){var _0x19cd20=_['map'](_0x3a59e9[_0xfc04('0x67')],function(_0x21f5cf){_0x21f5cf[_0xfc04('0x6b')]=_0x3a59e9['params']['id'];return _0x21f5cf;});return db['ChatApplication'][_0xfc04('0xe6')](_0x19cd20,{'transaction':_0x5cb436});});})['then'](function(){return db['ChatApplication'][_0xfc04('0x121')]({'where':{'ChatWebsiteId':_0x3a59e9['params']['id']},'order':'priority'});});}})[_0xfc04('0x22')](respondWithResult(_0x39056d,null))[_0xfc04('0x2c')](handleError(_0x39056d,null));};exports['getApplications']=function(_0x3898e5,_0x21430d,_0x5b5c22){var _0x3cf178={};var _0xa638a7={};var _0x574cae;var _0x28925b;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x3898e5['params']['id']}})['then'](handleEntityNotFound(_0x21430d,null))['then'](function(_0x6facfe){if(_0x6facfe){_0x574cae=_0x6facfe;_0xa638a7[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0xa2')]['rawAttributes']);_0xa638a7[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x3898e5[_0xfc04('0x47')]);_0xa638a7[_0xfc04('0x49')]=_['intersection'](_0xa638a7[_0xfc04('0x46')],_0xa638a7['query']);_0x3cf178[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0xa638a7[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x3cf178[_0xfc04('0x4c')]=_0x3cf178['attributes']['length']?_0x3cf178['attributes']:_0xa638a7['model'];_0x3cf178[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x51')]);_0x3cf178[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_['pick'](_0x3898e5[_0xfc04('0x47')],_0xa638a7[_0xfc04('0x49')]));if(_0x3898e5['query'][_0xfc04('0x54')]){_0x3cf178[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x3cf178[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x3cf178[_0xfc04('0x4c')],function(_0x56f0f5){var _0x50cf7c={};_0x50cf7c[_0x56f0f5]={'$like':'%'+_0x3898e5[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0x50cf7c;})});}_0x3cf178=_[_0xfc04('0x57')]({},_0x3cf178,_0x3898e5['options']);return _0x574cae['getApplications'](_0x3cf178);}})['then'](function(_0x339aca){if(_0x339aca){_0x28925b=_0x339aca[_0xfc04('0x4d')];if(!_0x3898e5['query']['hasOwnProperty'](_0xfc04('0x4f'))){_0x3cf178['limit']=qs[_0xfc04('0x32')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x32')]);_0x3cf178['offset']=qs[_0xfc04('0x30')](_0x3898e5[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x574cae['getApplications'](_0x3cf178);}})[_0xfc04('0x22')](function(_0x34a2ba){if(_0x34a2ba){return _0x34a2ba?{'count':_0x28925b,'rows':_0x34a2ba}:null;}})[_0xfc04('0x22')](respondWithResult(_0x21430d,null))[_0xfc04('0x2c')](handleError(_0x21430d,null));};exports[_0xfc04('0x123')]=function(_0x339192,_0x3d08ae,_0x1e7fae){return db[_0xfc04('0x124')][_0xfc04('0x63')]({'where':{'id':_0x339192[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x3d08ae,null))[_0xfc04('0x22')](function(_0x344a3d){if(_0x344a3d){return _0x344a3d['addProactiveActions'](_0x339192[_0xfc04('0x67')][_0xfc04('0x70')],_['omit'](_0x339192[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{});}})['then'](respondWithResult(_0x3d08ae,null))[_0xfc04('0x2c')](handleError(_0x3d08ae,null));};exports[_0xfc04('0x125')]=function(_0x5b6193,_0x2dc7e0,_0x2f5aea){var _0x22016b={};var _0x194577={};var _0x1f9730;var _0x37ddfb;return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x5b6193['params']['id']}})['then'](handleEntityNotFound(_0x2dc7e0,null))[_0xfc04('0x22')](function(_0x1792d5){if(_0x1792d5){_0x1f9730=_0x1792d5;_0x194577[_0xfc04('0x46')]=_[_0xfc04('0x48')](db[_0xfc04('0x126')][_0xfc04('0x43')]);_0x194577[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x5b6193[_0xfc04('0x47')]);_0x194577[_0xfc04('0x49')]=_['intersection'](_0x194577['model'],_0x194577[_0xfc04('0x47')]);_0x22016b[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x194577[_0xfc04('0x46')],qs['fields'](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x4b')]));_0x22016b['attributes']=_0x22016b[_0xfc04('0x4c')]['length']?_0x22016b['attributes']:_0x194577[_0xfc04('0x46')];_0x22016b[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x5b6193[_0xfc04('0x47')]['sort']);_0x22016b[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x5b6193[_0xfc04('0x47')],_0x194577[_0xfc04('0x49')]));if(_0x5b6193['query'][_0xfc04('0x54')]){_0x22016b[_0xfc04('0x52')]=_['merge'](_0x22016b[_0xfc04('0x52')],{'$or':_[_0xfc04('0x42')](_0x22016b[_0xfc04('0x4c')],function(_0x265eef){var _0x5a6d92={};_0x5a6d92[_0x265eef]={'$like':'%'+_0x5b6193[_0xfc04('0x47')]['filter']+'%'};return _0x5a6d92;})});}_0x22016b=_[_0xfc04('0x57')]({},_0x22016b,_0x5b6193['options']);return _0x1f9730['getProactiveActions'](_0x22016b);}})[_0xfc04('0x22')](function(_0x442aa6){if(_0x442aa6){_0x37ddfb=_0x442aa6['length'];if(!_0x5b6193[_0xfc04('0x47')]['hasOwnProperty']('nolimit')){_0x22016b[_0xfc04('0x32')]=qs['limit'](_0x5b6193['query'][_0xfc04('0x32')]);_0x22016b[_0xfc04('0x30')]=qs[_0xfc04('0x30')](_0x5b6193[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x1f9730[_0xfc04('0x125')](_0x22016b);}})[_0xfc04('0x22')](function(_0x1086bc){if(_0x1086bc){return _0x1086bc?{'count':_0x37ddfb,'rows':_0x1086bc}:null;}})['then'](respondWithResult(_0x2dc7e0,null))['catch'](handleError(_0x2dc7e0,null));};exports[_0xfc04('0x127')]=function(_0xb28a49,_0x506bf4,_0x176f7f){var _0x3b2f7d=_0xb28a49['query'][_0xfc04('0x128')]===_0xfc04('0x129')?_0xfc04('0x12a'):'onlineForm';return db['ChatWebsite'][_0xfc04('0x63')]({'attributes':['id',_0x3b2f7d],'where':{'id':_0xb28a49['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x506bf4,null))['then'](function(_0x399679){if(_0x399679){var _0x2c0ba8=_0x399679[_0x3b2f7d];var _0x1e051c=_0x2c0ba8&&_0x2c0ba8[_0xfc04('0x12b')]?_0x2c0ba8[_0xfc04('0x12b')]:[];_0x506bf4[_0xfc04('0x3f')]({'fromKey':_[_0xfc04('0x86')](_0x2c0ba8['fromKey'])?undefined:_0x2c0ba8['fromKey'],'count':_0x1e051c['length'],'rows':_0x1e051c});}})['catch'](handleError(_0x506bf4,null));};exports[_0xfc04('0x12c')]=function(_0x496f22,_0x597cc2,_0xbb1255){var _0x4427c5={'raw':![],'where':{}};var _0x2320f0={};var _0x55d937={'count':0x0,'rows':[]};return db[_0xfc04('0x5a')][_0xfc04('0x122')]({'where':{'id':_0x496f22[_0xfc04('0x5d')]['id']}})['then'](handleEntityNotFound(_0x597cc2,null))['then'](function(_0x421152){if(_0x421152){_0x2320f0[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xde')][_0xfc04('0x43')]);_0x2320f0['query']=_[_0xfc04('0x48')](_0x496f22[_0xfc04('0x47')]);_0x2320f0[_0xfc04('0x49')]=_['intersection'](_0x2320f0[_0xfc04('0x46')],_0x2320f0[_0xfc04('0x47')]);_0x4427c5[_0xfc04('0x4c')]=_[_0xfc04('0x4a')](_0x2320f0[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x496f22[_0xfc04('0x47')]['fields']));_0x4427c5[_0xfc04('0x4c')]=_0x4427c5[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x4427c5[_0xfc04('0x4c')]:_0x2320f0[_0xfc04('0x46')];if(!_0x496f22['query']['hasOwnProperty']('nolimit')){_0x4427c5['limit']=qs[_0xfc04('0x32')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x32')]);_0x4427c5['offset']=qs[_0xfc04('0x30')](_0x496f22['query'][_0xfc04('0x30')]);}_0x4427c5[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x496f22[_0xfc04('0x47')][_0xfc04('0x51')]);_0x4427c5['where']=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x496f22[_0xfc04('0x47')],_0x2320f0[_0xfc04('0x49')]));_0x4427c5[_0xfc04('0x52')]['ChatWebsiteId']=_0x421152['id'];if(_0x496f22['query'][_0xfc04('0x54')]){_0x4427c5[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x4427c5['where'],{'$or':_['map'](_0x4427c5[_0xfc04('0x4c')],function(_0x363a99){var _0x2ca98f={};_0x2ca98f[_0x363a99]={'$like':'%'+_0x496f22[_0xfc04('0x47')]['filter']+'%'};return _0x2ca98f;})});}_0x4427c5=_['merge']({},_0x4427c5,_0x496f22[_0xfc04('0x58')]);return db['ChatOfflineMessage'][_0xfc04('0x33')]({'where':_0x4427c5['where']})['then'](function(_0x501ca1){_0x55d937['count']=_0x501ca1;if(_0x496f22[_0xfc04('0x47')][_0xfc04('0x59')]){_0x4427c5[_0xfc04('0x5e')]=[{'all':!![]}];}else{_0x4427c5[_0xfc04('0x5e')]=[{'model':db[_0xfc04('0x93')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xfc04('0xde')][_0xfc04('0x6e')](_0x4427c5);})[_0xfc04('0x22')](function(_0x24d194){_0x55d937[_0xfc04('0x5b')]=_0x24d194;return _0x55d937;});}})[_0xfc04('0x22')](respondWithFilteredResult(_0x597cc2,_0x4427c5))[_0xfc04('0x2c')](handleError(_0x597cc2,null));};exports['addAgents']=function(_0x25d77,_0x2329de,_0x5beece){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0x25d77['params']['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2329de,null))['then'](function(_0x18e5eb){if(_0x18e5eb){return _0x18e5eb[_0xfc04('0x12d')](_0x25d77[_0xfc04('0x67')]['ids'],_[_0xfc04('0xfb')](_0x25d77[_0xfc04('0x67')],[_0xfc04('0x70'),'id'])||{})[_0xfc04('0xc1')](function(_0x22e36b){for(var _0x474341=0x0;_0x474341<_0x25d77[_0xfc04('0x67')]['ids'][_0xfc04('0x4d')];_0x474341+=0x1){socket['emit'](_0xfc04('0x12e'),{'UserId':Number(_0x25d77[_0xfc04('0x67')]['ids'][_0x474341]),'ChatWebsiteId':Number(_0x25d77[_0xfc04('0x5d')]['id'])});}return _0x22e36b;});}})[_0xfc04('0x22')](respondWithResult(_0x2329de,null))['catch'](handleError(_0x2329de,null));};exports[_0xfc04('0x12f')]=function(_0xb16b8f,_0x2a2e2d,_0x1f1a7a){return db[_0xfc04('0x5a')][_0xfc04('0x63')]({'where':{'id':_0xb16b8f[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0x2a2e2d,null))[_0xfc04('0x22')](function(_0x31f579){if(_0x31f579){return _0x31f579[_0xfc04('0x12f')](_0xb16b8f[_0xfc04('0x47')]['ids'])['then'](function(){if(_[_0xfc04('0x130')](_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')])){for(var _0x48304f=0x0;_0x48304f<_0xb16b8f[_0xfc04('0x47')]['ids']['length'];_0x48304f+=0x1){socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f['query']['ids'][_0x48304f]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}}else{socket[_0xfc04('0x131')](_0xfc04('0x132'),{'UserId':Number(_0xb16b8f[_0xfc04('0x47')][_0xfc04('0x70')]),'ChatWebsiteId':Number(_0xb16b8f[_0xfc04('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a2e2d,null))['catch'](handleError(_0x2a2e2d,null));};exports[_0xfc04('0x133')]=function(_0x4f0ed0,_0xbb0f91,_0x4398f4){var _0x1624d0={};var _0x3e8dea={};var _0x154f95;var _0x1d15b8;return db['ChatWebsite']['findOne']({'where':{'id':_0x4f0ed0[_0xfc04('0x5d')]['id']}})[_0xfc04('0x22')](handleEntityNotFound(_0xbb0f91,null))['then'](function(_0x1d120b){if(_0x1d120b){_0x154f95=_0x1d120b;_0x3e8dea[_0xfc04('0x46')]=_['keys'](db[_0xfc04('0xca')][_0xfc04('0x43')]);_0x3e8dea[_0xfc04('0x47')]=_[_0xfc04('0x48')](_0x4f0ed0[_0xfc04('0x47')]);_0x3e8dea[_0xfc04('0x49')]=_[_0xfc04('0x4a')](_0x3e8dea['model'],_0x3e8dea[_0xfc04('0x47')]);_0x1624d0[_0xfc04('0x4c')]=_['intersection'](_0x3e8dea[_0xfc04('0x46')],qs[_0xfc04('0x4b')](_0x4f0ed0['query']['fields']));_0x1624d0[_0xfc04('0x4c')]=_0x1624d0[_0xfc04('0x4c')][_0xfc04('0x4d')]?_0x1624d0[_0xfc04('0x4c')]:_0x3e8dea[_0xfc04('0x46')];_0x1624d0[_0xfc04('0x50')]=qs[_0xfc04('0x51')](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x51')]);_0x1624d0[_0xfc04('0x52')]=qs[_0xfc04('0x49')](_[_0xfc04('0x53')](_0x4f0ed0[_0xfc04('0x47')],_0x3e8dea[_0xfc04('0x49')]));if(_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]){_0x1624d0[_0xfc04('0x52')]=_[_0xfc04('0x57')](_0x1624d0['where'],{'$or':_[_0xfc04('0x42')](_0x1624d0[_0xfc04('0x4c')],function(_0x3f2e2e){var _0xe6baf={};_0xe6baf[_0x3f2e2e]={'$like':'%'+_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x54')]+'%'};return _0xe6baf;})});}_0x1624d0=_[_0xfc04('0x57')]({},_0x1624d0,_0x4f0ed0['options']);return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2ae1a1){if(_0x2ae1a1){_0x1d15b8=_0x2ae1a1['length'];if(!_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x4e')]('nolimit')){_0x1624d0['limit']=qs[_0xfc04('0x32')](_0x4f0ed0[_0xfc04('0x47')]['limit']);_0x1624d0[_0xfc04('0x30')]=qs['offset'](_0x4f0ed0[_0xfc04('0x47')][_0xfc04('0x30')]);}return _0x154f95[_0xfc04('0x133')](_0x1624d0);}})[_0xfc04('0x22')](function(_0x2599fd){if(_0x2599fd){return _0x2599fd?{'count':_0x1d15b8,'rows':_0x2599fd}:null;}})[_0xfc04('0x22')](respondWithResult(_0xbb0f91,null))['catch'](handleError(_0xbb0f91,null));};
\ No newline at end of file
+var _0x6f5d=['forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','Tag','Tags','color','tag','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','remote','x-real-ip','remoteAddress','referer','alignment','verticalAlignment','textColor','color_button','addApplications','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','http','ChatWebsite,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatWebsite','rows','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','findOne','Disposition','ChatWebsiteId','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','includeAll','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','account','Applications','list','applications','priority','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','forwardOffline','service','host','port','secure','authentication','pass','sendMail','email'];(function(_0x339d6c,_0x3ffdc2){var _0x556648=function(_0x2bcb4c){while(--_0x2bcb4c){_0x339d6c['push'](_0x339d6c['shift']());}};_0x556648(++_0x3ffdc2);}(_0x6f5d,0x170));var _0xd6f5=function(_0x398f1b,_0x4ab7c5){_0x398f1b=_0x398f1b-0x0;var _0x310f27=_0x6f5d[_0x398f1b];return _0x310f27;};'use strict';var emlformat=require(_0xd6f5('0x0'));var rimraf=require(_0xd6f5('0x1'));var zipdir=require(_0xd6f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6f5('0x3'));var moment=require(_0xd6f5('0x4'));var BPromise=require(_0xd6f5('0x5'));var Mustache=require(_0xd6f5('0x6'));var util=require(_0xd6f5('0x7'));var path=require(_0xd6f5('0x8'));var sox=require(_0xd6f5('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd6f5('0xa'));var _=require(_0xd6f5('0xb'));var squel=require(_0xd6f5('0xc'));var crypto=require(_0xd6f5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd6f5('0xe'));var toCsv=require(_0xd6f5('0xf'));var querystring=require(_0xd6f5('0x10'));var Papa=require(_0xd6f5('0x11'));var Redis=require(_0xd6f5('0x12'));var authService=require(_0xd6f5('0x13'));var qs=require(_0xd6f5('0x14'));var as=require(_0xd6f5('0x15'));var hardwareService=require(_0xd6f5('0x16'));var logger=require(_0xd6f5('0x17'))(_0xd6f5('0x18'));var utils=require(_0xd6f5('0x19'));var config=require(_0xd6f5('0x1a'));var licenseUtil=require(_0xd6f5('0x1b'));var db=require(_0xd6f5('0x1c'))['db'];config['redis']=_[_0xd6f5('0x1d')](config[_0xd6f5('0x1e')],{'host':_0xd6f5('0x1f'),'port':0x18eb});var socket=require(_0xd6f5('0x20'))(new Redis(config[_0xd6f5('0x1e')]));require('./chatWebsite.socket')[_0xd6f5('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd6f5('0x22')][_0xd6f5('0x23')]({'port':0x232c});var client9002=jayson[_0xd6f5('0x22')][_0xd6f5('0x23')]({'port':0x232a});var client9003=jayson[_0xd6f5('0x22')]['http']({'port':0x232b});var client9001=jayson[_0xd6f5('0x22')]['http']({'port':0x2329});function respondWithRpcPromise(_0x1796a5,_0x3acfe1,_0x594114,_0x4f74da){return new BPromise(function(_0x309460,_0x2df313){var _0x3453bf=_0x4f74da||client;return _0x3453bf['request'](_0x1796a5,_0x594114)['then'](function(_0x5e3b02){logger['info'](_0xd6f5('0x24'),_0x3acfe1,'request\x20sent');logger[_0xd6f5('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3acfe1,'request\x20sent',JSON[_0xd6f5('0x26')](_0x5e3b02));if(_0x5e3b02['error']){if(_0x5e3b02[_0xd6f5('0x27')][_0xd6f5('0x28')]===0x1f4){logger[_0xd6f5('0x27')](_0xd6f5('0x24'),_0x3acfe1,_0x5e3b02['error'][_0xd6f5('0x29')]);return _0x2df313(_0x5e3b02[_0xd6f5('0x27')][_0xd6f5('0x29')]);}logger[_0xd6f5('0x27')](_0xd6f5('0x24'),_0x3acfe1,_0x5e3b02['error'][_0xd6f5('0x29')]);return _0x309460(_0x5e3b02[_0xd6f5('0x27')]['message']);}else{logger[_0xd6f5('0x2a')](_0xd6f5('0x24'),_0x3acfe1,_0xd6f5('0x2b'));_0x309460(_0x5e3b02[_0xd6f5('0x2c')][_0xd6f5('0x29')]);}})['catch'](function(_0x2c7fa4){logger[_0xd6f5('0x27')](_0xd6f5('0x24'),_0x3acfe1,_0x2c7fa4);_0x2df313(_0x2c7fa4);});});}function respondWithStatusCode(_0x26bcb3,_0x1126bc){_0x1126bc=_0x1126bc||0xcc;return function(_0x44c72f){if(_0x44c72f){return _0x26bcb3[_0xd6f5('0x2d')](_0x1126bc);}return _0x26bcb3[_0xd6f5('0x2e')](_0x1126bc)[_0xd6f5('0x2f')]();};}function respondWithResult(_0xfa492d,_0x6d02e6){_0x6d02e6=_0x6d02e6||0xc8;return function(_0x5d459f){if(_0x5d459f){return _0xfa492d[_0xd6f5('0x2e')](_0x6d02e6)[_0xd6f5('0x30')](_0x5d459f);}};}function respondWithFilteredResult(_0x954050,_0x2e525f){return function(_0x125d5b){if(_0x125d5b){var _0x4c5e4c=typeof _0x2e525f[_0xd6f5('0x31')]===_0xd6f5('0x32')&&typeof _0x2e525f[_0xd6f5('0x33')]===_0xd6f5('0x32');var _0xd195cd=_0x125d5b['count'];var _0x1b7cc0=_0x4c5e4c?0x0:_0x2e525f[_0xd6f5('0x31')];var _0x1d06e3=_0x4c5e4c?_0x125d5b[_0xd6f5('0x34')]:_0x2e525f[_0xd6f5('0x31')]+_0x2e525f[_0xd6f5('0x33')];var _0x4a4e11;if(_0x1d06e3>=_0xd195cd){_0x1d06e3=_0xd195cd;_0x4a4e11=0xc8;}else{_0x4a4e11=0xce;}_0x954050[_0xd6f5('0x2e')](_0x4a4e11);return _0x954050[_0xd6f5('0x35')]('Content-Range',_0x1b7cc0+'-'+_0x1d06e3+'/'+_0xd195cd)[_0xd6f5('0x30')](_0x125d5b);}return null;};}function patchUpdates(_0x1744e3){return function(_0x381899){try{jsonpatch['apply'](_0x381899,_0x1744e3,!![]);}catch(_0x95fd72){return BPromise[_0xd6f5('0x36')](_0x95fd72);}return _0x381899[_0xd6f5('0x37')]();};}function saveUpdates(_0x4f6cd6,_0x16b472){return function(_0x158d73){if(_0x158d73){return _0x158d73[_0xd6f5('0x38')](_0x4f6cd6)[_0xd6f5('0x39')](function(_0x54d261){return _0x54d261;});}return null;};}function removeEntity(_0x2a8837,_0x4c3257){return function(_0x5d0c6a){if(_0x5d0c6a){return _0x5d0c6a[_0xd6f5('0x3a')]()[_0xd6f5('0x39')](function(){var _0x20bed3=_0x5d0c6a[_0xd6f5('0x3b')]({'plain':!![]});var _0x33b43d=_0xd6f5('0x3c');return db[_0xd6f5('0x3d')][_0xd6f5('0x3a')]({'where':{'type':_0x33b43d,'resourceId':_0x20bed3['id']}})['then'](function(){return _0x5d0c6a;});})[_0xd6f5('0x39')](function(){_0x2a8837[_0xd6f5('0x2e')](0xcc)[_0xd6f5('0x2f')]();});}};}function handleEntityNotFound(_0x9e7624,_0x550c77){return function(_0x76683f){if(!_0x76683f){_0x9e7624[_0xd6f5('0x2d')](0x194);}return _0x76683f;};}function handleError(_0xd5e25b,_0x2bf3ef){_0x2bf3ef=_0x2bf3ef||0x1f4;return function(_0x4addf2){logger[_0xd6f5('0x27')](_0x4addf2[_0xd6f5('0x3e')]);if(_0x4addf2[_0xd6f5('0x3f')]){delete _0x4addf2[_0xd6f5('0x3f')];}_0xd5e25b['status'](_0x2bf3ef)[_0xd6f5('0x40')](_0x4addf2);};}exports[_0xd6f5('0x41')]=function(_0x640431,_0x9af6e2){var _0x2e9b01={'include':[{'model':db[_0xd6f5('0x42')],'as':_0xd6f5('0x43')}]},_0x394450={},_0x166138={'count':0x0,'rows':[]};var _0x12ee45=_[_0xd6f5('0x44')](db['ChatWebsite']['rawAttributes'],function(_0xb8402b){return{'name':_0xb8402b[_0xd6f5('0x45')],'type':_0xb8402b[_0xd6f5('0x46')][_0xd6f5('0x47')]};});_0x394450[_0xd6f5('0x48')]=_[_0xd6f5('0x44')](_0x12ee45,'name');_0x394450[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x640431[_0xd6f5('0x49')]);_0x394450[_0xd6f5('0x4b')]=_[_0xd6f5('0x4c')](_0x394450[_0xd6f5('0x48')],_0x394450[_0xd6f5('0x49')]);_0x2e9b01[_0xd6f5('0x4d')]=_['intersection'](_0x394450[_0xd6f5('0x48')],qs[_0xd6f5('0x4e')](_0x640431[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0x2e9b01['attributes']=_0x2e9b01[_0xd6f5('0x4d')][_0xd6f5('0x4f')]?_0x2e9b01[_0xd6f5('0x4d')]:_0x394450[_0xd6f5('0x48')];if(!_0x640431[_0xd6f5('0x49')][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0x2e9b01[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x640431[_0xd6f5('0x49')][_0xd6f5('0x33')]);_0x2e9b01[_0xd6f5('0x31')]=qs['offset'](_0x640431['query'][_0xd6f5('0x31')]);}_0x2e9b01[_0xd6f5('0x52')]=qs[_0xd6f5('0x53')](_0x640431[_0xd6f5('0x49')][_0xd6f5('0x53')]);_0x2e9b01[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0x640431[_0xd6f5('0x49')],_0x394450[_0xd6f5('0x4b')]),_0x12ee45);if(_0x640431[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0x2e9b01[_0xd6f5('0x54')]=_[_0xd6f5('0x57')](_0x2e9b01[_0xd6f5('0x54')],{'$or':_[_0xd6f5('0x44')](_0x12ee45,function(_0x2b841c){if(_0x2b841c[_0xd6f5('0x46')]!==_0xd6f5('0x58')){var _0x59c39e={};_0x59c39e[_0x2b841c[_0xd6f5('0x3f')]]={'$like':'%'+_0x640431[_0xd6f5('0x49')][_0xd6f5('0x56')]+'%'};return _0x59c39e;}})});}_0x2e9b01=_[_0xd6f5('0x57')]({},_0x2e9b01,_0x640431[_0xd6f5('0x59')]);var _0xd2ce22={'where':_0x2e9b01[_0xd6f5('0x54')]};return db[_0xd6f5('0x5a')][_0xd6f5('0x34')](_0xd2ce22)[_0xd6f5('0x39')](function(_0x5d0707){_0x166138[_0xd6f5('0x34')]=_0x5d0707;if(_0x640431['query']['includeAll']){_0x2e9b01['include']=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x2e9b01);})[_0xd6f5('0x39')](function(_0x5a68ff){_0x166138[_0xd6f5('0x5b')]=_0x5a68ff;return _0x166138;})[_0xd6f5('0x39')](respondWithFilteredResult(_0x9af6e2,_0x2e9b01))[_0xd6f5('0x5c')](handleError(_0x9af6e2,null));};exports[_0xd6f5('0x5d')]=function(_0x3bcc3c,_0x1b8d09){var _0x116549={'raw':![],'where':{'id':_0x3bcc3c[_0xd6f5('0x5e')]['id']},'include':[{'model':db[_0xd6f5('0x42')],'as':_0xd6f5('0x43')}]},_0x153af3={};_0x153af3[_0xd6f5('0x48')]=_[_0xd6f5('0x4a')](db[_0xd6f5('0x5a')][_0xd6f5('0x5f')]);_0x153af3['query']=_[_0xd6f5('0x4a')](_0x3bcc3c['query']);_0x153af3[_0xd6f5('0x4b')]=_['intersection'](_0x153af3['model'],_0x153af3['query']);_0x116549[_0xd6f5('0x4d')]=_['intersection'](_0x153af3[_0xd6f5('0x48')],qs[_0xd6f5('0x4e')](_0x3bcc3c[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0x116549[_0xd6f5('0x4d')]=_0x116549[_0xd6f5('0x4d')][_0xd6f5('0x4f')]?_0x116549[_0xd6f5('0x4d')]:_0x153af3[_0xd6f5('0x48')];if(_0x3bcc3c['query']['includeAll']){_0x116549['include']=[{'all':!![]}];}_0x116549=_['merge']({},_0x116549,_0x3bcc3c[_0xd6f5('0x59')]);return db[_0xd6f5('0x5a')][_0xd6f5('0x60')](_0x116549)[_0xd6f5('0x39')](handleEntityNotFound(_0x1b8d09,null))[_0xd6f5('0x39')](respondWithResult(_0x1b8d09,null))['catch'](handleError(_0x1b8d09,null));};exports[_0xd6f5('0x61')]=function(_0x250e54,_0x52214d){return db[_0xd6f5('0x5a')][_0xd6f5('0x61')](_0x250e54['body'],{})['then'](function(_0x33154b){var _0x5463e2=_0x250e54['user'][_0xd6f5('0x3b')]({'plain':!![]});if(!_0x5463e2)throw new Error(_0xd6f5('0x62'));if(_0x5463e2['role']===_0xd6f5('0x63')){var _0x2cceda=_0x33154b[_0xd6f5('0x3b')]({'plain':!![]});var _0x130a2a=_0xd6f5('0x3c');return db[_0xd6f5('0x64')][_0xd6f5('0x60')]({'where':{'name':_0x130a2a,'userProfileId':_0x5463e2[_0xd6f5('0x65')]},'raw':!![]})[_0xd6f5('0x39')](function(_0x4a024e){if(_0x4a024e&&_0x4a024e[_0xd6f5('0x66')]===0x0){return db['UserProfileResource'][_0xd6f5('0x61')]({'name':_0x2cceda['name'],'resourceId':_0x2cceda['id'],'type':_0x4a024e[_0xd6f5('0x3f')],'sectionId':_0x4a024e['id']},{})['then'](function(){return _0x33154b;});}else{return _0x33154b;}})[_0xd6f5('0x5c')](function(_0x5eb787){logger[_0xd6f5('0x27')](_0xd6f5('0x67'),_0x5eb787);throw _0x5eb787;});}return _0x33154b;})['then'](respondWithResult(_0x52214d,0xc9))[_0xd6f5('0x5c')](handleError(_0x52214d,null));};exports[_0xd6f5('0x38')]=function(_0x16cff0,_0xd20e4f){if(_0x16cff0[_0xd6f5('0x68')]['id']){delete _0x16cff0[_0xd6f5('0x68')]['id'];}return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x16cff0['params']['id']},'include':[{'model':db[_0xd6f5('0x42')],'as':_0xd6f5('0x43')}]})[_0xd6f5('0x39')](handleEntityNotFound(_0xd20e4f,null))[_0xd6f5('0x39')](saveUpdates(_0x16cff0[_0xd6f5('0x68')],null))['then'](respondWithResult(_0xd20e4f,null))[_0xd6f5('0x5c')](handleError(_0xd20e4f,null));};exports['destroy']=function(_0x269267,_0x3418ca){return db['ChatWebsite'][_0xd6f5('0x60')]({'where':{'id':_0x269267[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x3418ca,null))[_0xd6f5('0x39')](removeEntity(_0x3418ca,null))['catch'](handleError(_0x3418ca,null));};exports[_0xd6f5('0x69')]=function(_0x48eba4,_0x25992a){return db[_0xd6f5('0x5a')]['describe']()[_0xd6f5('0x39')](respondWithResult(_0x25992a,null))[_0xd6f5('0x5c')](handleError(_0x25992a,null));};exports[_0xd6f5('0x6a')]=function(_0x191e64,_0x17e3c9,_0x665773){if(_0x191e64[_0xd6f5('0x68')]['id']){delete _0x191e64[_0xd6f5('0x68')]['id'];}return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x191e64[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x17e3c9,null))[_0xd6f5('0x39')](function(_0x14bf23){if(_0x14bf23){_0x191e64[_0xd6f5('0x68')]['ChatWebsiteId']=_0x14bf23['id'];return db['Disposition'][_0xd6f5('0x61')](_0x191e64['body']);}})[_0xd6f5('0x39')](respondWithResult(_0x17e3c9,null))[_0xd6f5('0x5c')](handleError(_0x17e3c9,null));};exports['getDispositions']=function(_0x4b42c7,_0xa654fb,_0x7ce908){var _0x5bee60={'raw':![],'where':{}};var _0xff40ae={};var _0x14d45e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd6f5('0x6b')]({'where':{'id':_0x4b42c7[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0xa654fb,null))[_0xd6f5('0x39')](function(_0x1b23fe){if(_0x1b23fe){_0xff40ae['model']=_[_0xd6f5('0x4a')](db[_0xd6f5('0x6c')][_0xd6f5('0x5f')]);_0xff40ae['query']=_[_0xd6f5('0x4a')](_0x4b42c7[_0xd6f5('0x49')]);_0xff40ae['filters']=_['intersection'](_0xff40ae[_0xd6f5('0x48')],_0xff40ae['query']);_0x5bee60[_0xd6f5('0x4d')]=_[_0xd6f5('0x4c')](_0xff40ae[_0xd6f5('0x48')],qs['fields'](_0x4b42c7[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0x5bee60[_0xd6f5('0x4d')]=_0x5bee60[_0xd6f5('0x4d')][_0xd6f5('0x4f')]?_0x5bee60['attributes']:_0xff40ae['model'];if(!_0x4b42c7['query'][_0xd6f5('0x50')]('nolimit')){_0x5bee60[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x4b42c7[_0xd6f5('0x49')][_0xd6f5('0x33')]);_0x5bee60[_0xd6f5('0x31')]=qs[_0xd6f5('0x31')](_0x4b42c7[_0xd6f5('0x49')]['offset']);}_0x5bee60[_0xd6f5('0x52')]=qs[_0xd6f5('0x53')](_0x4b42c7[_0xd6f5('0x49')]['sort']);_0x5bee60[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0x4b42c7[_0xd6f5('0x49')],_0xff40ae['filters']));_0x5bee60['where'][_0xd6f5('0x6d')]=_0x1b23fe['id'];if(_0x4b42c7['query'][_0xd6f5('0x56')]){_0x5bee60[_0xd6f5('0x54')]=_[_0xd6f5('0x57')](_0x5bee60[_0xd6f5('0x54')],{'$or':_[_0xd6f5('0x44')](_0x5bee60[_0xd6f5('0x4d')],function(_0x1fb296){var _0x44adc9={};_0x44adc9[_0x1fb296]={'$like':'%'+_0x4b42c7[_0xd6f5('0x49')][_0xd6f5('0x56')]+'%'};return _0x44adc9;})});}_0x5bee60=_[_0xd6f5('0x57')]({},_0x5bee60,_0x4b42c7[_0xd6f5('0x59')]);return db[_0xd6f5('0x6c')][_0xd6f5('0x34')]({'where':_0x5bee60['where']})['then'](function(_0x1cc3ba){_0x14d45e[_0xd6f5('0x34')]=_0x1cc3ba;if(_0x4b42c7['query']['includeAll']){_0x5bee60[_0xd6f5('0x6e')]=[{'all':!![]}];}return db['Disposition'][_0xd6f5('0x6f')](_0x5bee60);})[_0xd6f5('0x39')](function(_0x4931be){_0x14d45e[_0xd6f5('0x5b')]=_0x4931be;return _0x14d45e;});}})[_0xd6f5('0x39')](respondWithFilteredResult(_0xa654fb,_0x5bee60))[_0xd6f5('0x5c')](handleError(_0xa654fb,null));};exports[_0xd6f5('0x70')]=function(_0x1c791b,_0x1a980c,_0x53312f){return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x1c791b['params']['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x1a980c,null))[_0xd6f5('0x39')](function(_0x248ffc){if(_0x248ffc){return _0x248ffc[_0xd6f5('0x70')](_0x1c791b[_0xd6f5('0x49')][_0xd6f5('0x71')]);}})['then'](respondWithStatusCode(_0x1a980c,null))[_0xd6f5('0x5c')](handleError(_0x1a980c,null));};exports[_0xd6f5('0x72')]=function(_0x2257a7,_0x49b90c,_0x368cc6){if(_0x2257a7['body']['id']){delete _0x2257a7[_0xd6f5('0x68')]['id'];}return db[_0xd6f5('0x5a')]['find']({'where':{'id':_0x2257a7[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x49b90c,null))[_0xd6f5('0x39')](function(_0x368344){if(_0x368344){_0x2257a7[_0xd6f5('0x68')][_0xd6f5('0x6d')]=_0x368344['id'];return db[_0xd6f5('0x73')][_0xd6f5('0x61')](_0x2257a7[_0xd6f5('0x68')]);}})[_0xd6f5('0x39')](respondWithResult(_0x49b90c,null))[_0xd6f5('0x5c')](handleError(_0x49b90c,null));};exports['getAnswers']=function(_0x104152,_0x57986c,_0x1565a0){var _0x84558c={'raw':![],'where':{}};var _0x32e31d={};var _0x5de8db={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd6f5('0x6b')]({'where':{'id':_0x104152[_0xd6f5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x57986c,null))['then'](function(_0x43edc7){if(_0x43edc7){_0x32e31d[_0xd6f5('0x48')]=_[_0xd6f5('0x4a')](db[_0xd6f5('0x73')][_0xd6f5('0x5f')]);_0x32e31d[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x104152[_0xd6f5('0x49')]);_0x32e31d['filters']=_[_0xd6f5('0x4c')](_0x32e31d[_0xd6f5('0x48')],_0x32e31d[_0xd6f5('0x49')]);_0x84558c[_0xd6f5('0x4d')]=_[_0xd6f5('0x4c')](_0x32e31d[_0xd6f5('0x48')],qs[_0xd6f5('0x4e')](_0x104152[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0x84558c[_0xd6f5('0x4d')]=_0x84558c[_0xd6f5('0x4d')][_0xd6f5('0x4f')]?_0x84558c[_0xd6f5('0x4d')]:_0x32e31d[_0xd6f5('0x48')];if(!_0x104152[_0xd6f5('0x49')][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0x84558c[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x104152[_0xd6f5('0x49')][_0xd6f5('0x33')]);_0x84558c[_0xd6f5('0x31')]=qs[_0xd6f5('0x31')](_0x104152['query'][_0xd6f5('0x31')]);}_0x84558c['order']=qs['sort'](_0x104152[_0xd6f5('0x49')][_0xd6f5('0x53')]);_0x84558c[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0x104152['query'],_0x32e31d[_0xd6f5('0x4b')]));_0x84558c['where'][_0xd6f5('0x6d')]=_0x43edc7['id'];if(_0x104152[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0x84558c['where']=_['merge'](_0x84558c[_0xd6f5('0x54')],{'$or':_[_0xd6f5('0x44')](_0x84558c[_0xd6f5('0x4d')],function(_0x643092){var _0x43a6d3={};_0x43a6d3[_0x643092]={'$like':'%'+_0x104152['query'][_0xd6f5('0x56')]+'%'};return _0x43a6d3;})});}_0x84558c=_[_0xd6f5('0x57')]({},_0x84558c,_0x104152[_0xd6f5('0x59')]);return db[_0xd6f5('0x73')][_0xd6f5('0x34')]({'where':_0x84558c['where']})['then'](function(_0x53a54f){_0x5de8db[_0xd6f5('0x34')]=_0x53a54f;if(_0x104152[_0xd6f5('0x49')][_0xd6f5('0x74')]){_0x84558c[_0xd6f5('0x6e')]=[{'all':!![]}];}return db[_0xd6f5('0x73')][_0xd6f5('0x6f')](_0x84558c);})[_0xd6f5('0x39')](function(_0x4c0bb8){_0x5de8db[_0xd6f5('0x5b')]=_0x4c0bb8;return _0x5de8db;});}})[_0xd6f5('0x39')](respondWithFilteredResult(_0x57986c,_0x84558c))['catch'](handleError(_0x57986c,null));};exports[_0xd6f5('0x75')]=function(_0xf5e125,_0x4e4fea,_0x454ebc){return db['ChatWebsite'][_0xd6f5('0x60')]({'where':{'id':_0xf5e125['params']['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x4e4fea,null))[_0xd6f5('0x39')](function(_0x7fdb69){if(_0x7fdb69){return _0x7fdb69[_0xd6f5('0x75')](_0xf5e125[_0xd6f5('0x49')]['ids']);}})[_0xd6f5('0x39')](respondWithStatusCode(_0x4e4fea,null))[_0xd6f5('0x5c')](handleError(_0x4e4fea,null));};exports[_0xd6f5('0x76')]=function(_0x5dfb6f,_0xd5ebf,_0x1843b8){_0x5dfb6f[_0xd6f5('0x68')]['sitepic']=_0x5dfb6f[_0xd6f5('0x77')][_0xd6f5('0x78')];return db['ChatWebsite'][_0xd6f5('0x60')]({'where':{'id':_0x5dfb6f[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0xd5ebf,null))[_0xd6f5('0x39')](saveUpdates(_0x5dfb6f[_0xd6f5('0x68')],null))[_0xd6f5('0x39')](respondWithResult(_0xd5ebf,null))[_0xd6f5('0x5c')](handleError(_0xd5ebf,null));};exports[_0xd6f5('0x79')]=function(_0x6b50b9,_0x324f6b,_0x19f6d6){_0x6b50b9[_0xd6f5('0x68')][_0xd6f5('0x7a')]=_0x6b50b9[_0xd6f5('0x77')][_0xd6f5('0x78')];return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x6b50b9[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x324f6b,null))[_0xd6f5('0x39')](saveUpdates(_0x6b50b9[_0xd6f5('0x68')],null))[_0xd6f5('0x39')](respondWithResult(_0x324f6b,null))[_0xd6f5('0x5c')](handleError(_0x324f6b,null));};exports['addCustomerAvatar']=function(_0x5e77db,_0xee7852,_0x196d06){_0x5e77db[_0xd6f5('0x68')]['customerAvatar']=_0x5e77db[_0xd6f5('0x77')][_0xd6f5('0x78')];return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x5e77db['params']['id']}})['then'](handleEntityNotFound(_0xee7852,null))[_0xd6f5('0x39')](saveUpdates(_0x5e77db['body'],null))[_0xd6f5('0x39')](respondWithResult(_0xee7852,null))['catch'](handleError(_0xee7852,null));};exports[_0xd6f5('0x7b')]=function(_0x50d265,_0x44e7da,_0x2d909b){_0x50d265[_0xd6f5('0x68')][_0xd6f5('0x7c')]=_0x50d265[_0xd6f5('0x77')][_0xd6f5('0x78')];return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x50d265['params']['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x44e7da,null))['then'](saveUpdates(_0x50d265[_0xd6f5('0x68')],null))[_0xd6f5('0x39')](respondWithResult(_0x44e7da,null))[_0xd6f5('0x5c')](handleError(_0x44e7da,null));};exports[_0xd6f5('0x7d')]=function(_0x541d8a,_0x5a1bb8,_0x389b4a){var _0x371324=path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0x80'));var _0x9ab84f={'where':{'id':_0x541d8a[_0xd6f5('0x5e')]['id']},'attributes':['id',_0xd6f5('0x81')],'raw':!![]};var _0x1c0d06=![];return require(_0xd6f5('0x1b'))[_0xd6f5('0x82')]()[_0xd6f5('0x39')](function(_0xb3203){if(_0xb3203){_0x1c0d06=_0xb3203[_0xd6f5('0x83')];}})['then'](function(){return db['ChatWebsite']['find'](_0x9ab84f);})[_0xd6f5('0x39')](handleEntityNotFound(_0x5a1bb8,null))[_0xd6f5('0x39')](function(_0x1c3c01){if(_0x1c3c01){if(!_[_0xd6f5('0x84')](_0x1c3c01[_0xd6f5('0x81')])){if(fs['existsSync'](path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],'server/files/images/logos/',_0x1c3c01[_0xd6f5('0x81')]))&&_0x1c0d06){_0x371324=path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0x85'),_0x1c3c01['sitepic']);}}return _0x5a1bb8[_0xd6f5('0x86')](_0x371324);}})[_0xd6f5('0x5c')](handleError(_0x5a1bb8,null));};exports[_0xd6f5('0x87')]=function(_0x33aec2,_0xd8a37e,_0xb3db7b){var _0x375a2a=path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0x88'));var _0x435b31={'where':{'id':_0x33aec2[_0xd6f5('0x5e')]['id']},'attributes':['id',_0xd6f5('0x7a')],'raw':!![]};return db[_0xd6f5('0x5a')][_0xd6f5('0x60')](_0x435b31)[_0xd6f5('0x39')](handleEntityNotFound(_0xd8a37e,null))['then'](function(_0x3e0eba){if(_0x3e0eba){if(!_[_0xd6f5('0x84')](_0x3e0eba[_0xd6f5('0x7a')])){if(fs[_0xd6f5('0x89')](path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0x8a'),_0x3e0eba[_0xd6f5('0x7a')]))){_0x375a2a=path['join'](config[_0xd6f5('0x7f')],_0xd6f5('0x8a'),_0x3e0eba[_0xd6f5('0x7a')]);}}return _0xd8a37e['download'](_0x375a2a);}})[_0xd6f5('0x5c')](handleError(_0xd8a37e,null));};exports['getCustomerAvatar']=function(_0x239aed,_0x30d6fd,_0xad6789){var _0xe4c299=path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],'server/files/images/avatars/customer_avatar.png');var _0x463b0b={'where':{'id':_0x239aed[_0xd6f5('0x5e')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xd6f5('0x5a')]['find'](_0x463b0b)['then'](handleEntityNotFound(_0x30d6fd,null))[_0xd6f5('0x39')](function(_0x4719e0){if(_0x4719e0){if(!_['isNil'](_0x4719e0[_0xd6f5('0x8b')])){if(fs[_0xd6f5('0x89')](path['join'](config['root'],'server/files/images/avatars/',_0x4719e0[_0xd6f5('0x8b')]))&&_0x4719e0[_0xd6f5('0x8c')]){_0xe4c299=path[_0xd6f5('0x7e')](config['root'],_0xd6f5('0x8a'),_0x4719e0['customerAvatar']);}}return _0x30d6fd['download'](_0xe4c299);}})['catch'](handleError(_0x30d6fd,null));};exports['getSystemAvatar']=function(_0x129591,_0x2e65bf,_0x53fef1){var _0x5f4a76=path['join'](config[_0xd6f5('0x7f')],_0xd6f5('0x8d'));var _0x107647={'where':{'id':_0x129591[_0xd6f5('0x5e')]['id']},'attributes':['id',_0xd6f5('0x7c')],'raw':!![]};return db[_0xd6f5('0x5a')][_0xd6f5('0x60')](_0x107647)[_0xd6f5('0x39')](handleEntityNotFound(_0x2e65bf,null))[_0xd6f5('0x39')](function(_0x24ef07){if(_0x24ef07){if(!_['isNil'](_0x24ef07[_0xd6f5('0x7c')])){if(fs[_0xd6f5('0x89')](path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0x8a'),_0x24ef07['systemAvatar']))){_0x5f4a76=path['join'](config[_0xd6f5('0x7f')],_0xd6f5('0x8a'),_0x24ef07[_0xd6f5('0x7c')]);}}return _0x2e65bf[_0xd6f5('0x86')](_0x5f4a76);}})['catch'](handleError(_0x2e65bf,null));};exports[_0xd6f5('0x8e')]=function(_0x29a366,_0x1394f9,_0x1c0b02){var _0x4d3ce6=require('user-agent-parser');var _0x5584e0=new _0x4d3ce6();var _0xf8bb19=_0x5584e0[_0xd6f5('0x8f')](_0x29a366[_0xd6f5('0x90')][_0xd6f5('0x91')])['getResult']();var _0x459551={'body':_0x29a366[_0xd6f5('0x68')],'channel':_0xd6f5('0x92')};var _0x4213e8=[];var _0x1aca76=[];var _0x2a4344={};var _0x5e3473=![];return db[_0xd6f5('0x93')]['describe']()[_0xd6f5('0x39')](function(_0x23ce8d){if(!_0x23ce8d){throw new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))]('no\x20available\x20attributes');}_0x4213e8=_['difference'](_[_0xd6f5('0x4a')](_0x23ce8d),[_0xd6f5('0x96'),_0xd6f5('0x97')]);_0x1aca76=_[_0xd6f5('0x98')](_[_0xd6f5('0x4a')](_0x23ce8d),[_0xd6f5('0x96'),_0xd6f5('0x97'),'CompanyId',_0xd6f5('0x99')]);if(_0x29a366['body']['id']){delete _0x29a366['body']['id'];}if(_['isNil'](_0x29a366[_0xd6f5('0x68')]['from'])){throw new db[(_0xd6f5('0x94'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd6f5('0x84')](_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x68')])||_0x29a366['body'][_0xd6f5('0x68')]===''){throw new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))](_0xd6f5('0x9a'));}if(_['isNil'](_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x9b')])){throw new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))](_0xd6f5('0x9c')+_0x1aca76);}if(!_[_0xd6f5('0x9d')](_0x1aca76,_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x9b')])){throw new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))](_0xd6f5('0x9e')+_0x1aca76);}_0x2a4344[_0x29a366['body'][_0xd6f5('0x9b')]]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x9f')];})[_0xd6f5('0x39')](function(){return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x29a366[_0xd6f5('0x5e')]['id']},'include':[{'model':db[_0xd6f5('0xa0')],'as':_0xd6f5('0xa1'),'include':[{'model':db['CmContact'],'as':_0xd6f5('0xa2'),'where':_0x2a4344,'limit':0x1,'order':[[_0xd6f5('0x97'),_0xd6f5('0xa3')]]}]},{'model':db[_0xd6f5('0xa4')],'as':'Applications'}]});})[_0xd6f5('0x39')](handleEntityNotFound(_0x1394f9,null))[_0xd6f5('0x39')](function(_0x2f2d08){if(_0x2f2d08&&_0x2f2d08[_0xd6f5('0xa1')]){_0x459551[_0xd6f5('0xa5')]=_0x2f2d08;_0x459551['applications']=_0x2f2d08[_0xd6f5('0xa6')];_0x459551[_0xd6f5('0xa7')]=_0x2f2d08[_0xd6f5('0xa1')];_0x459551[_0xd6f5('0xa8')]=_['orderBy'](_0x459551[_0xd6f5('0xa8')],[_0xd6f5('0xa9')],['asc']);if(_0x459551['account'][_0xd6f5('0xa6')]){delete _0x459551[_0xd6f5('0xa5')]['Applications'];}if(_0x459551[_0xd6f5('0xa5')]['List']&&_0x459551[_0xd6f5('0xa5')][_0xd6f5('0xa1')]['Contacts'][_0xd6f5('0x4f')]){return _0x459551[_0xd6f5('0xa5')][_0xd6f5('0xa1')][_0xd6f5('0xa2')][0x0];}var _0x1700a8=_[_0xd6f5('0x1d')](_0x29a366[_0xd6f5('0x68')],{'firstName':_0x29a366['body'][_0xd6f5('0x9f')],'ListId':_0x2f2d08[_0xd6f5('0x99')]});_0x1700a8[_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x9b')]]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0x9f')];return db[_0xd6f5('0x93')]['create'](_0x1700a8,{'fields':_0x4213e8,'raw':!![]});}})[_0xd6f5('0x39')](handleEntityNotFound(_0x1394f9,null))['then'](function(_0x37726c){_0x459551[_0xd6f5('0xaa')]=_0x37726c;var _0x5167e0=_0x29a366['body'][_0xd6f5('0xab')];if(_0x29a366['headers'][_0xd6f5('0xac')]){_0x5167e0=_0x29a366['headers'][_0xd6f5('0xac')];}else if(_0x29a366[_0xd6f5('0x90')][_0xd6f5('0xad')]){_0x5167e0=_[_0xd6f5('0xae')](_0x29a366[_0xd6f5('0x90')][_0xd6f5('0xad')][_0xd6f5('0xaf')](','));}if(_0x37726c){var _0x350b3c={'ContactId':_0x37726c['id'],'ChatWebsiteId':_0x29a366[_0xd6f5('0x5e')]['id'],'from':(_0x37726c[_0xd6f5('0xb0')]||'')+'\x20'+(_0x37726c['lastName']||''),'customerIp':_0x5167e0,'customerPort':_0x29a366[_0xd6f5('0x90')][_0xd6f5('0xb1')]?_0x29a366[_0xd6f5('0x90')][_0xd6f5('0xb1')]:null,'referer':_0x29a366[_0xd6f5('0x68')]['referer'],'browserName':_0xf8bb19[_0xd6f5('0xb2')][_0xd6f5('0x3f')]&&_0xf8bb19[_0xd6f5('0xb2')][_0xd6f5('0xb3')]?util[_0xd6f5('0xb4')](_0xd6f5('0xb5'),_0xf8bb19['browser']['name'],_0xf8bb19[_0xd6f5('0xb2')][_0xd6f5('0xb3')]):_0xd6f5('0xb6'),'browserVersion':_0xf8bb19[_0xd6f5('0xb2')][_0xd6f5('0xb3')]||'unknown','osName':util[_0xd6f5('0xb4')](_0xd6f5('0xb5'),_0xf8bb19['os'][_0xd6f5('0x3f')],_0xf8bb19['os'][_0xd6f5('0xb3')]),'osVersion':_0xf8bb19['os'][_0xd6f5('0xb3')],'deviceModel':_0xf8bb19[_0xd6f5('0xb7')][_0xd6f5('0x48')]&&_0xf8bb19[_0xd6f5('0xb7')][_0xd6f5('0xb8')]?util[_0xd6f5('0xb4')](_0xd6f5('0xb9'),_0xf8bb19[_0xd6f5('0xb7')][_0xd6f5('0x48')],_0xf8bb19[_0xd6f5('0xb7')][_0xd6f5('0xb8')],_0xf8bb19[_0xd6f5('0xb7')]['type']):null,'deviceVendor':_0xf8bb19[_0xd6f5('0xb7')]['vendor'],'deviceType':_0xf8bb19[_0xd6f5('0xb7')][_0xd6f5('0x46')],'formData':JSON[_0xd6f5('0x26')](_0x29a366[_0xd6f5('0x68')])};var _0xd33e52={'ChatWebsiteId':_0x29a366[_0xd6f5('0x5e')]['id'],'closed':![]};if(_0x29a366['body'][_0xd6f5('0xba')]){_0xd33e52[_0xd6f5('0xba')]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xba')];return db[_0xd6f5('0xbb')][_0xd6f5('0x60')]({'where':_0xd33e52})[_0xd6f5('0x39')](function(_0x10e8b5){if(_0x10e8b5){return[_0x10e8b5,![]];}_0x350b3c[_0xd6f5('0xba')]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xba')];_0x350b3c[_0xd6f5('0xbc')]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xbc')];return db['ChatInteraction'][_0xd6f5('0x61')](_0x350b3c)['then'](function(_0x28d95c){return[_0x28d95c,!![]];});});}_0xd33e52['ContactId']=_0x37726c['id'];if(_0x29a366['body'][_0xd6f5('0xbd')]&&_0x29a366[_0xd6f5('0x68')]['interaction']['id']){_0xd33e52['id']=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xbd')]['id'];return db[_0xd6f5('0xbb')][_0xd6f5('0x60')]({'where':_0xd33e52})['then'](function(_0x9682fc){if(_0x9682fc){return[_0x9682fc,![]];}return db[_0xd6f5('0xbb')][_0xd6f5('0x61')](_0x350b3c)[_0xd6f5('0x39')](function(_0x50e750){return[_0x50e750,!![]];});});}return db[_0xd6f5('0xbb')][_0xd6f5('0x61')](_0x350b3c)[_0xd6f5('0x39')](function(_0x4fb2c2){return[_0x4fb2c2,!![]];});}})[_0xd6f5('0xbe')](function(_0x407905,_0x5c3ed8){if(_0x407905){_0x5e3473=_0x5c3ed8;if(!_0x5c3ed8){var _0x312dfc={'from':(_0x459551['contact'][_0xd6f5('0xb0')]||'')+'\x20'+(_0x459551[_0xd6f5('0xaa')]['lastName']||'')};if(_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xba')]&&_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xbf')]&&_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xba')]!=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xbf')]){_0x312dfc[_0xd6f5('0xba')]=_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xbf')];}return _0x407905['update'](_0x312dfc);}else{return _0x407905;}}})[_0xd6f5('0x39')](function(_0x4b8994){_0x459551['interaction']=_0x4b8994[_0xd6f5('0x3b')]({'plain':!![]});_0x459551['interaction'][_0xd6f5('0xc0')]=_0x5e3473;if(_0x459551[_0xd6f5('0xbd')][_0xd6f5('0xc0')]){if(_0x459551[_0xd6f5('0xa5')]['autoclose']){_0x459551[_0xd6f5('0xa8')][_0xd6f5('0xc1')]({'id':0x0,'priority':_0x459551['applications'][_0xd6f5('0x4f')]+0x1,'app':'close','appdata':_0xd6f5('0xc2'),'interval':_0xd6f5('0xc3')});}}return db[_0xd6f5('0xc4')][_0xd6f5('0x61')]({'body':_0x29a366[_0xd6f5('0x68')]['body'],'ChatWebsiteId':_0x29a366[_0xd6f5('0x5e')]['id'],'ChatInteractionId':_0x4b8994['id'],'direction':'in','ContactId':_0x459551['contact']['id'],'AttachmentId':_0x29a366[_0xd6f5('0x68')][_0xd6f5('0xc5')]});})[_0xd6f5('0x39')](function(_0x33fd4e){_0x459551[_0xd6f5('0x29')]=_0x33fd4e;if(_0x459551[_0xd6f5('0xbd')][_0xd6f5('0xc6')]){return db[_0xd6f5('0xc7')][_0xd6f5('0x60')]({'attributes':['id',_0xd6f5('0x3f')],'where':{'id':_0x459551[_0xd6f5('0xbd')][_0xd6f5('0xc6')]}})[_0xd6f5('0x39')](function(_0x5f48b2){if(_0x5f48b2){_0x459551['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xd6f5('0xc8'),'appdata':_0x5f48b2[_0xd6f5('0x3f')]+','+(_0x459551[_0xd6f5('0xa5')][_0xd6f5('0xc9')]||0xa),'interval':'*,*,*,*'});_0x459551[_0xd6f5('0xca')]=!![];}return respondWithRpcPromise(_0xd6f5('0xcb'),_0xd6f5('0xcc'),_0x459551);});}return respondWithRpcPromise(_0xd6f5('0xcb'),'startRouting',_0x459551);})[_0xd6f5('0x39')](function(_0x5ec175){respondWithRpcPromise(_0xd6f5('0xcd'),_0xd6f5('0xcd'),{'event':_0xd6f5('0x8e'),'message':_0x5ec175},client9002);return _0x5ec175;})[_0xd6f5('0x39')](respondWithResult(_0x1394f9,null))[_0xd6f5('0x5c')](handleError(_0x1394f9,null));};exports[_0xd6f5('0xce')]=function(_0x19423b,_0x541821,_0x3a6fd2){var _0x9dd530,_0x196759,_0x200523;var _0x2e5cf4=[];var _0x1a4405=[];var _0x5c68a8={};var _0x27a5d5=_0x19423b[_0xd6f5('0xcf')]||[];var _0x14bd99=[];var _0x3e1d1e;return db[_0xd6f5('0x93')][_0xd6f5('0x69')]()['then'](function(_0x4941c2){if(!_0x4941c2){throw new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))]('no\x20available\x20attributes');}_0x1a4405=_[_0xd6f5('0x98')](_['keys'](_0x4941c2),['createdAt','updatedAt']);_0x2e5cf4=_[_0xd6f5('0x98')](_['keys'](_0x4941c2),[_0xd6f5('0x96'),_0xd6f5('0x97'),'CompanyId',_0xd6f5('0x99')]);if(_0x19423b[_0xd6f5('0x68')]['id']){delete _0x19423b[_0xd6f5('0x68')]['id'];}if(_[_0xd6f5('0x84')](_0x19423b[_0xd6f5('0x68')][_0xd6f5('0x9f')])){throw _0x541821['status'](0x1f4)[_0xd6f5('0x40')](new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))]('from\x20is\x20mandatory'));}if(_[_0xd6f5('0x84')](_0x19423b[_0xd6f5('0x68')][_0xd6f5('0x68')])||_0x19423b[_0xd6f5('0x68')][_0xd6f5('0x68')]===''){throw _0x541821[_0xd6f5('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0xd6f5('0x95'))](_0xd6f5('0x9a')));}if(_[_0xd6f5('0x84')](_0x19423b[_0xd6f5('0x68')][_0xd6f5('0xd0')])){throw _0x541821['status'](0x1f4)['send'](new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e5cf4));}if(!_['includes'](_0x2e5cf4,_0x19423b[_0xd6f5('0x68')][_0xd6f5('0xd0')])){throw _0x541821[_0xd6f5('0x2e')](0x1f4)[_0xd6f5('0x40')](new db[(_0xd6f5('0x94'))][(_0xd6f5('0x95'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e5cf4));}_0x5c68a8[_0x19423b[_0xd6f5('0x68')][_0xd6f5('0xd0')]]=_0x19423b[_0xd6f5('0x68')][_0xd6f5('0x9f')];})[_0xd6f5('0x39')](function(){return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x19423b['params']['id']},'include':[{'model':db[_0xd6f5('0xa0')],'as':_0xd6f5('0xa1')},{'model':db['MailAccount'],'as':_0xd6f5('0xd1')}]});})['then'](handleEntityNotFound(_0x541821,null))[_0xd6f5('0x39')](function(_0x5a2f14){if(_0x5a2f14&&_0x5a2f14[_0xd6f5('0xa1')]){_0x196759=_0x5a2f14;var _0x699158=_[_0xd6f5('0x1d')](_0x19423b[_0xd6f5('0x68')],{'firstName':_0x19423b['body']['from'],'phone':_0x19423b[_0xd6f5('0x68')]['from'],'ListId':_0x5a2f14[_0xd6f5('0x99')]});_0x699158[_0x19423b[_0xd6f5('0x68')][_0xd6f5('0xd0')]]=_0x19423b[_0xd6f5('0x68')]['from'];return db['CmContact'][_0xd6f5('0xd2')]({'where':_0x5c68a8,'defaults':_0x699158});}})['spread'](function(_0x4d091d){if(_0x4d091d){_0x200523=_0x4d091d;var _0x567bd7=fs[_0xd6f5('0xd3')](path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0xd4')),_0xd6f5('0xd5'));var _0x121d97=ejs[_0xd6f5('0xd6')](_0x567bd7,{'body':_[_0xd6f5('0xd7')](_0x19423b['body'][_0xd6f5('0x68')]),'bodyTitle':_0x196759[_0xd6f5('0xd8')]});return db['ChatOfflineMessage']['create']({'body':_0x121d97,'ContactId':_0x4d091d['id'],'ChatWebsiteId':_0x196759['id']});}})[_0xd6f5('0x39')](function(_0xb20706){_0x3e1d1e=_0xb20706;if(_0x27a5d5[_0xd6f5('0x4f')]){var _0x182db7=_0x27a5d5['map'](function(_0x32d8b7){return{'name':_0x32d8b7[_0xd6f5('0xd9')],'basename':_0x32d8b7['filename'],'type':_0x32d8b7[_0xd6f5('0xda')],'ChatOfflineMessageId':_0xb20706['id']};});_0x14bd99=_0x182db7['map'](_0x4b91da=>{var _0x188732={'filename':_0x4b91da[_0xd6f5('0x3f')],'path':path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],_0xd6f5('0xdb'),'files',_0xd6f5('0xdc'),'offline-chat',_0x4b91da[_0xd6f5('0xdd')])};return _0x188732;});if(!_0x196759[_0xd6f5('0xde')]){return db[_0xd6f5('0xdf')]['transaction'](function(_0xec2f7a){return db[_0xd6f5('0xe0')][_0xd6f5('0xe1')](_0x182db7,{'transaction':_0xec2f7a});});}}})[_0xd6f5('0x39')](function(){if(_0x3e1d1e){_0x9dd530=_0x3e1d1e;return db[_0xd6f5('0xd1')][_0xd6f5('0x6b')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x4bfa06){if(_0x4bfa06&&_0x4bfa06[_0xd6f5('0xe2')]&&_0x196759[_0xd6f5('0xe3')]&&_0x196759['forwardOfflineAddress']){var _0x2aef7f={'tls':{'rejectUnauthorized':![]}};if(_0x4bfa06[_0xd6f5('0xe2')][_0xd6f5('0xe4')]){_0x2aef7f[_0xd6f5('0xe4')]=_0x4bfa06['Smtp'][_0xd6f5('0xe4')];}else{_0x2aef7f['host']=_0x4bfa06['Smtp'][_0xd6f5('0xe5')];_0x2aef7f[_0xd6f5('0xe6')]=_0x4bfa06[_0xd6f5('0xe2')][_0xd6f5('0xe6')];_0x2aef7f[_0xd6f5('0xe7')]=_0x4bfa06[_0xd6f5('0xe2')][_0xd6f5('0xe7')];}if(_0x4bfa06['Smtp'][_0xd6f5('0xe8')]){_0x2aef7f['auth']={'user':_0x4bfa06[_0xd6f5('0xe2')]['user'],'pass':_0x4bfa06['Smtp'][_0xd6f5('0xe9')]};}return respondWithRpcPromise('SendMail',_0xd6f5('0xea'),{'account':_0x2aef7f,'message':{'from':util[_0xd6f5('0xb4')]('\x22%s\x22\x20<%s>',_0x4bfa06[_0xd6f5('0x3f')],_0x4bfa06[_0xd6f5('0xeb')]||_0x4bfa06['Smtp'][_0xd6f5('0x63')]),'to':_0x196759[_0xd6f5('0xec')],'subject':_0x196759['offlineMessageSubject'],'html':_0x9dd530['body'],'attachments':_0x14bd99}},client9003)['then'](function(){return _0x9dd530;})[_0xd6f5('0x5c')](function(_0x1679af){console['error'](_0x1679af);});}})[_0xd6f5('0x39')](function(){if(_0x196759&&_0x196759[_0xd6f5('0xde')]&&_0x196759[_0xd6f5('0xed')]){var _0x28c0a0=[];if(_0x27a5d5[_0xd6f5('0x4f')]){_0x28c0a0=_0x27a5d5['map'](function(_0x151dd6){return{'name':_0x151dd6[_0xd6f5('0xd9')],'basename':_0x151dd6['filename'],'type':_0x151dd6['mimetype'],'ChatOfflineMessageId':_0x3e1d1e['id']};});}var _0x36c653;if(!_[_0xd6f5('0x84')](_0x196759[_0xd6f5('0xee')])){var _0xc759d0=_[_0xd6f5('0x44')](_0x19423b[_0xd6f5('0x68')],function(_0x44757e){return _0x44757e;});var _0x455f64=_[_0xd6f5('0xef')](_0xc759d0)[0x0];var _0xb4c40d=_[_0xd6f5('0xf0')](_0x455f64,function(_0x5607ab){return _0x5607ab;});_0x36c653=_0xb4c40d[0x1][_0x196759[_0xd6f5('0xee')]];}var _0x2e8445={'from':_0x200523[_0xd6f5('0xeb')],'firstName':_0x200523['firstName'],'lastName':_0x200523[_0xd6f5('0xf1')],'mapKey':'email','message':{'from':_0x200523['email'],'to':_0x196759[_0xd6f5('0xd1')][_0xd6f5('0xeb')],'cc':'','subject':_[_0xd6f5('0x84')](_0x36c653)?_0x196759['offlineMessageSubject']:_0x36c653,'messageId':'','sentAt':new Date(),'attach':_0x28c0a0[_0xd6f5('0x4f')],'attachments':_0x28c0a0,'originChannel':_0xd6f5('0xf2'),'ChatWebsiteId':_0x196759['id'],'ChatOfflineMessageId':_0x9dd530['id'],'originTo':_0x196759[_0xd6f5('0xd1')][_0xd6f5('0xeb')]},'body':_0x9dd530[_0xd6f5('0x68')]};var _0x6e3b1a={'account':{'id':_0x196759[_0xd6f5('0xed')]},'body':_0x2e8445,'log':_0xd6f5('0xf3')};return respondWithRpcPromise('NotifyMailAccount',_0xd6f5('0xf4'),_0x6e3b1a,client9001)[_0xd6f5('0x39')](function(){return _0x9dd530;})[_0xd6f5('0x5c')](function(_0x7eba5){console[_0xd6f5('0x27')](_0x7eba5);});}return;})[_0xd6f5('0x39')](function(){if(_0x9dd530){return _0x9dd530;}})['then'](respondWithResult(_0x541821,null))[_0xd6f5('0x5c')](function(_0x3ca4ca){console[_0xd6f5('0x27')](_0xd6f5('0x5c'),_0x3ca4ca);for(var _0x296243 of _0x27a5d5){var _0x5f11a4=path['join'](config['root'],_0xd6f5('0xdb'),'files','attachments',_0xd6f5('0xf5'),_0x296243[_0xd6f5('0x78')]);fs_extra['remove'](_0x5f11a4)['catch'](function(_0x4c4df7){console[_0xd6f5('0x27')](_0xd6f5('0xf6'),_0x5f11a4,_0x4c4df7);});}});};exports[_0xd6f5('0xf7')]=function(_0x111f5e,_0x40be31,_0x2bc0d6){return db['ChatInteraction']['find']({'where':{'id':_0x111f5e[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x40be31,null))['then'](function(_0x2c3aba){if(_0x2c3aba){return _0x2c3aba['addInteraction'](_0x111f5e[_0xd6f5('0x68')]['ids'],_[_0xd6f5('0xf8')](_0x111f5e[_0xd6f5('0x68')],['ids','id'])||{});}})[_0xd6f5('0x39')](respondWithResult(_0x40be31,null))[_0xd6f5('0x5c')](handleError(_0x40be31,null));};exports['getInteractions']=function(_0x4fdb26,_0xff8612,_0x41d1a1){var _0xd9bb9b={'raw':![],'where':{}};var _0x74983c={};var _0xea6378={'count':0x0,'rows':[]};return db[_0xd6f5('0x5a')]['findOne']({'where':{'id':_0x4fdb26[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0xff8612,null))[_0xd6f5('0x39')](function(_0x2d8608){if(_0x2d8608){_0x74983c[_0xd6f5('0x48')]=_[_0xd6f5('0x4a')](db['ChatInteraction'][_0xd6f5('0x5f')]);_0x74983c[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x4fdb26['query']);_0x74983c[_0xd6f5('0x4b')]=_[_0xd6f5('0x4c')](_0x74983c[_0xd6f5('0x48')],_0x74983c[_0xd6f5('0x49')]);_0xd9bb9b[_0xd6f5('0x4d')]=_['intersection'](_0x74983c['model'],qs['fields'](_0x4fdb26[_0xd6f5('0x49')]['fields']));_0xd9bb9b[_0xd6f5('0x4d')]=_0xd9bb9b[_0xd6f5('0x4d')]['length']?_0xd9bb9b[_0xd6f5('0x4d')]:_0x74983c[_0xd6f5('0x48')];if(!_0x4fdb26[_0xd6f5('0x49')][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0xd9bb9b[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x4fdb26[_0xd6f5('0x49')][_0xd6f5('0x33')]);_0xd9bb9b['offset']=qs[_0xd6f5('0x31')](_0x4fdb26[_0xd6f5('0x49')]['offset']);}_0xd9bb9b[_0xd6f5('0x52')]=qs['sort'](_0x4fdb26[_0xd6f5('0x49')][_0xd6f5('0x53')]);_0xd9bb9b[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_['pick'](_0x4fdb26[_0xd6f5('0x49')],_0x74983c[_0xd6f5('0x4b')]));_0xd9bb9b[_0xd6f5('0x54')]['ChatWebsiteId']=_0x2d8608['id'];if(_0x4fdb26[_0xd6f5('0x49')]['filter']){_0xd9bb9b[_0xd6f5('0x54')]=_[_0xd6f5('0x57')](_0xd9bb9b[_0xd6f5('0x54')],{'$or':_[_0xd6f5('0x44')](_0xd9bb9b[_0xd6f5('0x4d')],function(_0xf0e354){var _0x47f841={};_0x47f841[_0xf0e354]={'$like':'%'+_0x4fdb26['query'][_0xd6f5('0x56')]+'%'};return _0x47f841;})});}_0xd9bb9b=_[_0xd6f5('0x57')]({},_0xd9bb9b,_0x4fdb26[_0xd6f5('0x59')]);return db[_0xd6f5('0xbb')][_0xd6f5('0x34')]({'where':_0xd9bb9b[_0xd6f5('0x54')]})[_0xd6f5('0x39')](function(_0x5b742e){_0xea6378[_0xd6f5('0x34')]=_0x5b742e;if(_0x4fdb26['query'][_0xd6f5('0x74')]){_0xd9bb9b[_0xd6f5('0x6e')]=[{'model':db['CmContact'],'as':_0xd6f5('0xf9'),'required':![]},{'model':db[_0xd6f5('0xc7')],'as':'Owner','attributes':[_0xd6f5('0x3f'),_0xd6f5('0xfa'),'internal'],'required':![]},{'model':db[_0xd6f5('0xfb')],'as':_0xd6f5('0xfc'),'attributes':['id',_0xd6f5('0x3f'),_0xd6f5('0xfd')],'where':_0x4fdb26['query']['tag']?{'id':_0x4fdb26[_0xd6f5('0x49')][_0xd6f5('0xfe')]}:undefined,'required':_0x4fdb26[_0xd6f5('0x49')][_0xd6f5('0xfe')]?!![]:![]}];}return db['ChatInteraction'][_0xd6f5('0x6f')](_0xd9bb9b);})['then'](function(_0x17418e){_0xea6378[_0xd6f5('0x5b')]=_0x17418e;return _0xea6378;});}})[_0xd6f5('0x39')](respondWithFilteredResult(_0xff8612,_0xd9bb9b))[_0xd6f5('0x5c')](handleError(_0xff8612,null));};function iftimePromise(_0x4fe625,_0x3c1e9c){return respondWithRpcPromise('Command',_0xd6f5('0xff'),{'command':_0x3c1e9c[_0xd6f5('0x100')]?util[_0xd6f5('0xb4')]('iftime\x20%s,%s',_0x4fe625[_0xd6f5('0x101')],_0x3c1e9c['timezone']):util['format'](_0xd6f5('0x102'),_0x4fe625['interval'])},client9002)['then'](function(_0x1c74af){var _0x5a4261=_0x1c74af&&_0x1c74af[_0xd6f5('0x103')](_0xd6f5('0x104'))>=0x0?!![]:![];logger[_0xd6f5('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3c1e9c['id'],_0x4fe625['id'],_0x4fe625['interval'],_0x5a4261?'ONLINE':'OFFLINE',_0x3c1e9c[_0xd6f5('0x100')]?_0x3c1e9c['timezone']:'No\x20timezone');return _0x5a4261;})[_0xd6f5('0x5c')](function(_0x20b10d){logger['error'](_0xd6f5('0x105'),_0x3c1e9c['id'],_0x4fe625['id'],_0x4fe625[_0xd6f5('0x101')],util[_0xd6f5('0x106')](_0x20b10d,{'showHidden':![],'depth':null}),_0x3c1e9c[_0xd6f5('0x100')]?_0x3c1e9c[_0xd6f5('0x100')]:_0xd6f5('0x107'));return![];});}exports[_0xd6f5('0xff')]=function(_0x11058d,_0x56ce74,_0x5f06b5){var _0x5c64d=0x0;var _0x1e2224=0x0;var _0x1a2bc7=![];var _0x50e6bd;var _0x1942cf;return db['ChatWebsite']['find']({'where':{'id':_0x11058d[_0xd6f5('0x5e')]['id']},'include':[{'model':db[_0xd6f5('0x108')],'as':_0xd6f5('0x108'),'include':[{'model':db['Interval'],'as':_0xd6f5('0x109'),'attributes':['id',_0xd6f5('0x101')],'raw':!![]}]}]})[_0xd6f5('0x39')](handleEntityNotFound(_0x56ce74,null))[_0xd6f5('0x39')](function(_0xf73f0f){if(_0xf73f0f){_0x50e6bd=_0xf73f0f;return _0xf73f0f[_0xd6f5('0x10a')]({'raw':!![]});}})[_0xd6f5('0x39')](function(_0x1d0b20){if(_0x50e6bd){if(_0x1d0b20){_0x1942cf=_0x1d0b20;}}return require(_0xd6f5('0x1b'))[_0xd6f5('0x82')]();})[_0xd6f5('0x39')](function(_0x143550){if(_0x143550){_0x1e2224=_0x143550[_0xd6f5('0x10b')];_0x1a2bc7=_0x143550[_0xd6f5('0x83')];}})['then'](function(){return db[_0xd6f5('0xbb')][_0xd6f5('0x34')]({'where':{'closed':![]}});})[_0xd6f5('0x39')](function(_0x26177d){_0x5c64d=_0x26177d;if(_0x1e2224&&_0x26177d>_0x1e2224){return db['License'][_0xd6f5('0x6b')]({'where':{'id':0x1}})[_0xd6f5('0x39')](function(_0x23cf60){if(_0x23cf60){_0x23cf60[_0xd6f5('0x10c')](_0xd6f5('0x10d'));}});}})[_0xd6f5('0x39')](function(){if(_0x50e6bd[_0xd6f5('0x108')]&&_0x50e6bd['Interval'][_0xd6f5('0x109')]){var _0x5cd4d9=[];for(var _0xa7f4b9=0x0;_0xa7f4b9<_0x50e6bd['Interval'][_0xd6f5('0x109')][_0xd6f5('0x4f')];_0xa7f4b9++){var _0x52f779=_0x50e6bd['Interval']['Intervals'][_0xa7f4b9][_0xd6f5('0x3b')]({'plain':!![]});_0x5cd4d9[_0xd6f5('0xc1')](iftimePromise(_0x52f779,_0x50e6bd));}return BPromise[_0xd6f5('0x10e')](_0x5cd4d9)[_0xd6f5('0x39')](function(_0x48f9a6){return _[_0xd6f5('0x10f')](_0x48f9a6);});}else{return!![];}})[_0xd6f5('0x39')](function(_0x56960a){var _0x1f3f4b=fs[_0xd6f5('0xd3')](path[_0xd6f5('0x7e')](config[_0xd6f5('0x7f')],'server/files/chat/iframe.ejs'),_0xd6f5('0xd5'));var _0x1d861b={'remote':_0x50e6bd[_0xd6f5('0x110')],'query':querystring['stringify'](_[_0xd6f5('0x57')](_0x50e6bd[_0xd6f5('0x3b')]({'plain':!![]}),{'customerIp':_0x11058d[_0xd6f5('0x90')][_0xd6f5('0xad')]||_0x11058d[_0xd6f5('0x90')][_0xd6f5('0x111')]||_0x11058d['connection'][_0xd6f5('0x112')]||_0x11058d['ip'],'referer':_0x11058d[_0xd6f5('0x90')][_0xd6f5('0x113')],'openedInteractions':_0x5c64d,'maxInteractions':_0x1e2224,'virtual':_0x1a2bc7[_0xd6f5('0x10b')],'online':_0x56960a,'custom':_0x1a2bc7}))['replace'](/'/g,'\x5c\x27')};_0x56ce74[_0xd6f5('0x40')](ejs[_0xd6f5('0xd6')](Mustache['render'](_0x1f3f4b,_0x1d861b),{'proactiveActions':_0x1942cf,'alignment':_0x50e6bd[_0xd6f5('0x114')],'verticalAlignment':_0x50e6bd[_0xd6f5('0x115')],'div_color':_0x50e6bd[_0xd6f5('0xfd')],'text_color':_0x50e6bd[_0xd6f5('0x116')],'button_color':_0x50e6bd[_0xd6f5('0x117')],'background_color':_0x50e6bd['backgroundColor']}));})['catch'](handleError(_0x56ce74,null));};exports[_0xd6f5('0x118')]=function(_0x4b9fdb,_0x57e4fe,_0x1ba575){return db[_0xd6f5('0x5a')][_0xd6f5('0x6b')]({'where':{'id':_0x4b9fdb['params']['id']}})['then'](handleEntityNotFound(_0x57e4fe,null))[_0xd6f5('0x39')](function(_0x3ab785){if(_0x3ab785){return db['sequelize']['transaction'](function(_0x547905){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x4b9fdb[_0xd6f5('0x5e')]['id']},'transaction':_0x547905})[_0xd6f5('0x39')](function(_0x112cf7){var _0x1e462e=_['map'](_0x4b9fdb[_0xd6f5('0x68')],function(_0x1146fd){_0x1146fd[_0xd6f5('0x6d')]=_0x4b9fdb['params']['id'];return _0x1146fd;});return db[_0xd6f5('0xa4')][_0xd6f5('0xe1')](_0x1e462e,{'transaction':_0x547905});});})[_0xd6f5('0x39')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x4b9fdb['params']['id']},'order':'priority'});});}})[_0xd6f5('0x39')](respondWithResult(_0x57e4fe,null))[_0xd6f5('0x5c')](handleError(_0x57e4fe,null));};exports[_0xd6f5('0x119')]=function(_0xc811cf,_0x4b7d05,_0x122c7b){var _0xf671fb={};var _0x160aac={};var _0xa1e7ed;var _0xa50197;return db['ChatWebsite']['findOne']({'where':{'id':_0xc811cf[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x4b7d05,null))[_0xd6f5('0x39')](function(_0x19c808){if(_0x19c808){_0xa1e7ed=_0x19c808;_0x160aac[_0xd6f5('0x48')]=_['keys'](db[_0xd6f5('0xa4')][_0xd6f5('0x5f')]);_0x160aac[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0xc811cf['query']);_0x160aac['filters']=_[_0xd6f5('0x4c')](_0x160aac[_0xd6f5('0x48')],_0x160aac[_0xd6f5('0x49')]);_0xf671fb['attributes']=_[_0xd6f5('0x4c')](_0x160aac['model'],qs[_0xd6f5('0x4e')](_0xc811cf[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0xf671fb[_0xd6f5('0x4d')]=_0xf671fb['attributes'][_0xd6f5('0x4f')]?_0xf671fb['attributes']:_0x160aac['model'];_0xf671fb[_0xd6f5('0x52')]=qs[_0xd6f5('0x53')](_0xc811cf[_0xd6f5('0x49')][_0xd6f5('0x53')]);_0xf671fb[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0xc811cf['query'],_0x160aac[_0xd6f5('0x4b')]));if(_0xc811cf[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0xf671fb['where']=_[_0xd6f5('0x57')](_0xf671fb[_0xd6f5('0x54')],{'$or':_['map'](_0xf671fb['attributes'],function(_0x4528aa){var _0x11ca94={};_0x11ca94[_0x4528aa]={'$like':'%'+_0xc811cf[_0xd6f5('0x49')][_0xd6f5('0x56')]+'%'};return _0x11ca94;})});}_0xf671fb=_[_0xd6f5('0x57')]({},_0xf671fb,_0xc811cf[_0xd6f5('0x59')]);return _0xa1e7ed[_0xd6f5('0x119')](_0xf671fb);}})[_0xd6f5('0x39')](function(_0xb62dc4){if(_0xb62dc4){_0xa50197=_0xb62dc4['length'];if(!_0xc811cf[_0xd6f5('0x49')][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0xf671fb[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0xc811cf['query']['limit']);_0xf671fb['offset']=qs[_0xd6f5('0x31')](_0xc811cf[_0xd6f5('0x49')]['offset']);}return _0xa1e7ed['getApplications'](_0xf671fb);}})[_0xd6f5('0x39')](function(_0x5351f9){if(_0x5351f9){return _0x5351f9?{'count':_0xa50197,'rows':_0x5351f9}:null;}})[_0xd6f5('0x39')](respondWithResult(_0x4b7d05,null))[_0xd6f5('0x5c')](handleError(_0x4b7d05,null));};exports[_0xd6f5('0x11a')]=function(_0x5d34fa,_0x41ceed,_0x1a5342){return db[_0xd6f5('0x11b')]['find']({'where':{'id':_0x5d34fa[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x41ceed,null))[_0xd6f5('0x39')](function(_0xa9d90f){if(_0xa9d90f){return _0xa9d90f['addProactiveActions'](_0x5d34fa[_0xd6f5('0x68')][_0xd6f5('0x71')],_[_0xd6f5('0xf8')](_0x5d34fa['body'],[_0xd6f5('0x71'),'id'])||{});}})['then'](respondWithResult(_0x41ceed,null))[_0xd6f5('0x5c')](handleError(_0x41ceed,null));};exports[_0xd6f5('0x10a')]=function(_0x2536d1,_0x1b88e8,_0x2d41af){var _0x552137={};var _0x362dae={};var _0x3afd2b;var _0x136625;return db[_0xd6f5('0x5a')][_0xd6f5('0x6b')]({'where':{'id':_0x2536d1[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x1b88e8,null))[_0xd6f5('0x39')](function(_0x135ec2){if(_0x135ec2){_0x3afd2b=_0x135ec2;_0x362dae[_0xd6f5('0x48')]=_[_0xd6f5('0x4a')](db[_0xd6f5('0x11c')]['rawAttributes']);_0x362dae[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x2536d1[_0xd6f5('0x49')]);_0x362dae['filters']=_[_0xd6f5('0x4c')](_0x362dae[_0xd6f5('0x48')],_0x362dae[_0xd6f5('0x49')]);_0x552137[_0xd6f5('0x4d')]=_[_0xd6f5('0x4c')](_0x362dae[_0xd6f5('0x48')],qs[_0xd6f5('0x4e')](_0x2536d1['query'][_0xd6f5('0x4e')]));_0x552137[_0xd6f5('0x4d')]=_0x552137[_0xd6f5('0x4d')][_0xd6f5('0x4f')]?_0x552137[_0xd6f5('0x4d')]:_0x362dae[_0xd6f5('0x48')];_0x552137[_0xd6f5('0x52')]=qs[_0xd6f5('0x53')](_0x2536d1['query'][_0xd6f5('0x53')]);_0x552137[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0x2536d1[_0xd6f5('0x49')],_0x362dae['filters']));if(_0x2536d1[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0x552137[_0xd6f5('0x54')]=_[_0xd6f5('0x57')](_0x552137[_0xd6f5('0x54')],{'$or':_[_0xd6f5('0x44')](_0x552137[_0xd6f5('0x4d')],function(_0xd80c33){var _0x14962f={};_0x14962f[_0xd80c33]={'$like':'%'+_0x2536d1[_0xd6f5('0x49')]['filter']+'%'};return _0x14962f;})});}_0x552137=_[_0xd6f5('0x57')]({},_0x552137,_0x2536d1[_0xd6f5('0x59')]);return _0x3afd2b[_0xd6f5('0x10a')](_0x552137);}})[_0xd6f5('0x39')](function(_0xcba18e){if(_0xcba18e){_0x136625=_0xcba18e[_0xd6f5('0x4f')];if(!_0x2536d1['query'][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0x552137[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x2536d1[_0xd6f5('0x49')][_0xd6f5('0x33')]);_0x552137[_0xd6f5('0x31')]=qs[_0xd6f5('0x31')](_0x2536d1[_0xd6f5('0x49')]['offset']);}return _0x3afd2b[_0xd6f5('0x10a')](_0x552137);}})[_0xd6f5('0x39')](function(_0x3f8c60){if(_0x3f8c60){return _0x3f8c60?{'count':_0x136625,'rows':_0x3f8c60}:null;}})[_0xd6f5('0x39')](respondWithResult(_0x1b88e8,null))[_0xd6f5('0x5c')](handleError(_0x1b88e8,null));};exports[_0xd6f5('0x11d')]=function(_0x215fd5,_0x4f4745,_0x3778c8){var _0x4ff396=_0x215fd5[_0xd6f5('0x49')][_0xd6f5('0x11e')]===_0xd6f5('0x11f')?_0xd6f5('0x120'):_0xd6f5('0x121');return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'attributes':['id',_0x4ff396],'where':{'id':_0x215fd5[_0xd6f5('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4f4745,null))[_0xd6f5('0x39')](function(_0x5ece16){if(_0x5ece16){var _0x1eaa8b=_0x5ece16[_0x4ff396];var _0x413dfe=_0x1eaa8b&&_0x1eaa8b[_0xd6f5('0x122')]?_0x1eaa8b['items']:[];_0x4f4745['send']({'fromKey':_[_0xd6f5('0x84')](_0x1eaa8b[_0xd6f5('0x123')])?undefined:_0x1eaa8b[_0xd6f5('0x123')],'count':_0x413dfe[_0xd6f5('0x4f')],'rows':_0x413dfe});}})[_0xd6f5('0x5c')](handleError(_0x4f4745,null));};exports[_0xd6f5('0x124')]=function(_0x408691,_0x4ce46e,_0x198d1d){var _0x2fbbbd={'raw':![],'where':{}};var _0x2e8257={};var _0x5541a8={'count':0x0,'rows':[]};return db[_0xd6f5('0x5a')]['findOne']({'where':{'id':_0x408691[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x4ce46e,null))[_0xd6f5('0x39')](function(_0x15c885){if(_0x15c885){_0x2e8257[_0xd6f5('0x48')]=_['keys'](db[_0xd6f5('0x125')]['rawAttributes']);_0x2e8257[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x408691[_0xd6f5('0x49')]);_0x2e8257[_0xd6f5('0x4b')]=_[_0xd6f5('0x4c')](_0x2e8257[_0xd6f5('0x48')],_0x2e8257[_0xd6f5('0x49')]);_0x2fbbbd[_0xd6f5('0x4d')]=_['intersection'](_0x2e8257[_0xd6f5('0x48')],qs['fields'](_0x408691[_0xd6f5('0x49')][_0xd6f5('0x4e')]));_0x2fbbbd['attributes']=_0x2fbbbd['attributes']['length']?_0x2fbbbd['attributes']:_0x2e8257[_0xd6f5('0x48')];if(!_0x408691[_0xd6f5('0x49')][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0x2fbbbd[_0xd6f5('0x33')]=qs['limit'](_0x408691['query'][_0xd6f5('0x33')]);_0x2fbbbd[_0xd6f5('0x31')]=qs['offset'](_0x408691[_0xd6f5('0x49')][_0xd6f5('0x31')]);}_0x2fbbbd['order']=qs[_0xd6f5('0x53')](_0x408691[_0xd6f5('0x49')][_0xd6f5('0x53')]);_0x2fbbbd[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_['pick'](_0x408691[_0xd6f5('0x49')],_0x2e8257['filters']));_0x2fbbbd['where']['ChatWebsiteId']=_0x15c885['id'];if(_0x408691[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0x2fbbbd[_0xd6f5('0x54')]=_['merge'](_0x2fbbbd['where'],{'$or':_[_0xd6f5('0x44')](_0x2fbbbd[_0xd6f5('0x4d')],function(_0x2a2a4d){var _0x489feb={};_0x489feb[_0x2a2a4d]={'$like':'%'+_0x408691[_0xd6f5('0x49')]['filter']+'%'};return _0x489feb;})});}_0x2fbbbd=_[_0xd6f5('0x57')]({},_0x2fbbbd,_0x408691[_0xd6f5('0x59')]);return db[_0xd6f5('0x125')]['count']({'where':_0x2fbbbd[_0xd6f5('0x54')]})['then'](function(_0x250a9d){_0x5541a8[_0xd6f5('0x34')]=_0x250a9d;if(_0x408691[_0xd6f5('0x49')][_0xd6f5('0x74')]){_0x2fbbbd[_0xd6f5('0x6e')]=[{'all':!![]}];}else{_0x2fbbbd[_0xd6f5('0x6e')]=[{'model':db[_0xd6f5('0x93')],'as':'Contact','required':![]},{'model':db[_0xd6f5('0xe0')],'as':_0xd6f5('0x126'),'required':![]}];}return db[_0xd6f5('0x125')][_0xd6f5('0x6f')](_0x2fbbbd);})[_0xd6f5('0x39')](function(_0x2b6ea2){_0x5541a8[_0xd6f5('0x5b')]=_0x2b6ea2;return _0x5541a8;});}})['then'](respondWithFilteredResult(_0x4ce46e,_0x2fbbbd))[_0xd6f5('0x5c')](handleError(_0x4ce46e,null));};exports['addAgents']=function(_0x3be5ae,_0x5c923d,_0x1d07dd){return db[_0xd6f5('0x5a')][_0xd6f5('0x60')]({'where':{'id':_0x3be5ae['params']['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x5c923d,null))[_0xd6f5('0x39')](function(_0x4ca5af){if(_0x4ca5af){return _0x4ca5af[_0xd6f5('0x127')](_0x3be5ae['body'][_0xd6f5('0x71')],_['omit'](_0x3be5ae[_0xd6f5('0x68')],[_0xd6f5('0x71'),'id'])||{})[_0xd6f5('0xbe')](function(_0x5e8c1c){for(var _0x2c071d=0x0;_0x2c071d<_0x3be5ae[_0xd6f5('0x68')]['ids'][_0xd6f5('0x4f')];_0x2c071d+=0x1){socket['emit'](_0xd6f5('0x128'),{'UserId':Number(_0x3be5ae[_0xd6f5('0x68')][_0xd6f5('0x71')][_0x2c071d]),'ChatWebsiteId':Number(_0x3be5ae[_0xd6f5('0x5e')]['id'])});}return _0x5e8c1c;});}})[_0xd6f5('0x39')](respondWithResult(_0x5c923d,null))['catch'](handleError(_0x5c923d,null));};exports[_0xd6f5('0x129')]=function(_0x2f80ef,_0x12fe26,_0x6afc05){return db['ChatWebsite']['find']({'where':{'id':_0x2f80ef[_0xd6f5('0x5e')]['id']}})[_0xd6f5('0x39')](handleEntityNotFound(_0x12fe26,null))['then'](function(_0x1b2e57){if(_0x1b2e57){return _0x1b2e57['removeAgents'](_0x2f80ef[_0xd6f5('0x49')][_0xd6f5('0x71')])['then'](function(){if(_[_0xd6f5('0x12a')](_0x2f80ef[_0xd6f5('0x49')][_0xd6f5('0x71')])){for(var _0x3d0280=0x0;_0x3d0280<_0x2f80ef[_0xd6f5('0x49')][_0xd6f5('0x71')][_0xd6f5('0x4f')];_0x3d0280+=0x1){socket['emit'](_0xd6f5('0x12b'),{'UserId':Number(_0x2f80ef[_0xd6f5('0x49')][_0xd6f5('0x71')][_0x3d0280]),'ChatWebsiteId':Number(_0x2f80ef[_0xd6f5('0x5e')]['id'])});}}else{socket[_0xd6f5('0x12c')](_0xd6f5('0x12b'),{'UserId':Number(_0x2f80ef[_0xd6f5('0x49')][_0xd6f5('0x71')]),'ChatWebsiteId':Number(_0x2f80ef['params']['id'])});}});}})['then'](respondWithStatusCode(_0x12fe26,null))[_0xd6f5('0x5c')](handleError(_0x12fe26,null));};exports[_0xd6f5('0x12d')]=function(_0x47c02b,_0x4bf233,_0x4ca8cb){var _0x4a1131={};var _0x389b63={};var _0x5e5881;var _0x4c1447;return db['ChatWebsite'][_0xd6f5('0x6b')]({'where':{'id':_0x47c02b['params']['id']}})['then'](handleEntityNotFound(_0x4bf233,null))['then'](function(_0x2a38ad){if(_0x2a38ad){_0x5e5881=_0x2a38ad;_0x389b63['model']=_[_0xd6f5('0x4a')](db[_0xd6f5('0xc7')][_0xd6f5('0x5f')]);_0x389b63[_0xd6f5('0x49')]=_[_0xd6f5('0x4a')](_0x47c02b[_0xd6f5('0x49')]);_0x389b63[_0xd6f5('0x4b')]=_[_0xd6f5('0x4c')](_0x389b63[_0xd6f5('0x48')],_0x389b63[_0xd6f5('0x49')]);_0x4a1131['attributes']=_[_0xd6f5('0x4c')](_0x389b63[_0xd6f5('0x48')],qs[_0xd6f5('0x4e')](_0x47c02b['query'][_0xd6f5('0x4e')]));_0x4a1131['attributes']=_0x4a1131['attributes'][_0xd6f5('0x4f')]?_0x4a1131[_0xd6f5('0x4d')]:_0x389b63[_0xd6f5('0x48')];_0x4a1131[_0xd6f5('0x52')]=qs[_0xd6f5('0x53')](_0x47c02b['query'][_0xd6f5('0x53')]);_0x4a1131[_0xd6f5('0x54')]=qs[_0xd6f5('0x4b')](_[_0xd6f5('0x55')](_0x47c02b[_0xd6f5('0x49')],_0x389b63['filters']));if(_0x47c02b[_0xd6f5('0x49')][_0xd6f5('0x56')]){_0x4a1131[_0xd6f5('0x54')]=_['merge'](_0x4a1131[_0xd6f5('0x54')],{'$or':_['map'](_0x4a1131[_0xd6f5('0x4d')],function(_0x4623f3){var _0x1616fc={};_0x1616fc[_0x4623f3]={'$like':'%'+_0x47c02b[_0xd6f5('0x49')][_0xd6f5('0x56')]+'%'};return _0x1616fc;})});}_0x4a1131=_[_0xd6f5('0x57')]({},_0x4a1131,_0x47c02b[_0xd6f5('0x59')]);return _0x5e5881[_0xd6f5('0x12d')](_0x4a1131);}})[_0xd6f5('0x39')](function(_0x67c8e8){if(_0x67c8e8){_0x4c1447=_0x67c8e8[_0xd6f5('0x4f')];if(!_0x47c02b['query'][_0xd6f5('0x50')](_0xd6f5('0x51'))){_0x4a1131[_0xd6f5('0x33')]=qs[_0xd6f5('0x33')](_0x47c02b[_0xd6f5('0x49')]['limit']);_0x4a1131[_0xd6f5('0x31')]=qs['offset'](_0x47c02b['query'][_0xd6f5('0x31')]);}return _0x5e5881[_0xd6f5('0x12d')](_0x4a1131);}})[_0xd6f5('0x39')](function(_0x104056){if(_0x104056){return _0x104056?{'count':_0x4c1447,'rows':_0x104056}:null;}})[_0xd6f5('0x39')](respondWithResult(_0x4bf233,null))[_0xd6f5('0x5c')](handleError(_0x4bf233,null));};
\ No newline at end of file
index 2705604..4e1fd4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0c3=['events','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x1cdac4,_0x45db76){var _0xa4a3cb=function(_0x32a0f0){while(--_0x32a0f0){_0x1cdac4['push'](_0x1cdac4['shift']());}};_0xa4a3cb(++_0x45db76);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x3e0c('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':_0x3e0c('0x3'),'afterUpdate':_0x3e0c('0x4'),'afterDestroy':_0x3e0c('0x5')};function emitEvent(_0x410ec4){return function(_0x31851c,_0x26c964,_0x1a026f){ChatWebsiteEvents['emit'](_0x410ec4+':'+_0x31851c['id'],_0x31851c);ChatWebsiteEvents['emit'](_0x410ec4,_0x31851c);_0x1a026f(null);};}for(var e in events){if(events[_0x3e0c('0x6')](e)){var event=events[e];ChatWebsite[_0x3e0c('0x7')](e,emitEvent(event));}}module[_0x3e0c('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1247=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x4cb408,_0x2054c9){var _0x28fc52=function(_0x5a2d57){while(--_0x5a2d57){_0x4cb408['push'](_0x4cb408['shift']());}};_0x28fc52(++_0x2054c9);}(_0x1247,0xb6));var _0x7124=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x1247[_0x28014d];return _0x2572cc;};'use strict';var EventEmitter=require(_0x7124('0x0'));var ChatWebsite=require(_0x7124('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7124('0x2'),'afterUpdate':_0x7124('0x3'),'afterDestroy':_0x7124('0x4')};function emitEvent(_0x5ebbfa){return function(_0x3bdce3,_0x3ab32e,_0x2dd15c){ChatWebsiteEvents[_0x7124('0x5')](_0x5ebbfa+':'+_0x3bdce3['id'],_0x3bdce3);ChatWebsiteEvents[_0x7124('0x5')](_0x5ebbfa,_0x3bdce3);_0x2dd15c(null);};}for(var e in events){if(events[_0x7124('0x6')](e)){var event=events[e];ChatWebsite[_0x7124('0x7')](e,emitEvent(event));}}module[_0x7124('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
index ff39b1c..a4e54fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6766=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x6766,0x1f2));var _0x6676=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x6766[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x6676('0x0'));var util=require(_0x6676('0x1'));var logger=require(_0x6676('0x2'))(_0x6676('0x3'));var moment=require(_0x6676('0x4'));var BPromise=require(_0x6676('0x5'));var rp=require(_0x6676('0x6'));var fs=require('fs');var path=require(_0x6676('0x7'));var rimraf=require(_0x6676('0x8'));var config=require(_0x6676('0x9'));var attributes=require(_0x6676('0xa'));module['exports']=function(_0x14c67c,_0x319e6){return _0x14c67c[_0x6676('0xb')](_0x6676('0xc'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2163=['path','rimraf','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x146f25,_0x1d6489){var _0x2c17a2=function(_0x368e9a){while(--_0x368e9a){_0x146f25['push'](_0x146f25['shift']());}};_0x2c17a2(++_0x1d6489);}(_0x2163,0x1c1));var _0x3216=function(_0x19dc44,_0xb12d6b){_0x19dc44=_0x19dc44-0x0;var _0x1edf0c=_0x2163[_0x19dc44];return _0x1edf0c;};'use strict';var _=require(_0x3216('0x0'));var util=require('util');var logger=require(_0x3216('0x1'))(_0x3216('0x2'));var moment=require(_0x3216('0x3'));var BPromise=require(_0x3216('0x4'));var rp=require(_0x3216('0x5'));var fs=require('fs');var path=require(_0x3216('0x6'));var rimraf=require(_0x3216('0x7'));var config=require('../../config/environment');var attributes=require(_0x3216('0x8'));module[_0x3216('0x9')]=function(_0x1d3a94,_0x33511a){return _0x1d3a94[_0x3216('0xa')](_0x3216('0xb'),attributes,{'tableName':_0x3216('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4498946..7962e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab5=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2bd5ec,_0x467020){var _0x5cebbb=function(_0x3ff0c7){while(--_0x3ff0c7){_0x2bd5ec['push'](_0x2bd5ec['shift']());}};_0x5cebbb(++_0x467020);}(_0xaab5,0x1e0));var _0x5aab=function(_0x40e65b,_0x51a4c1){_0x40e65b=_0x40e65b-0x0;var _0x329dba=_0xaab5[_0x40e65b];return _0x329dba;};'use strict';var _=require('lodash');var util=require(_0x5aab('0x0'));var moment=require(_0x5aab('0x1'));var BPromise=require(_0x5aab('0x2'));var rs=require(_0x5aab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5aab('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5aab('0x5'));var jayson=require(_0x5aab('0x6'));var client=jayson[_0x5aab('0x7')][_0x5aab('0x8')]({'port':0x232a});config[_0x5aab('0x9')]=_[_0x5aab('0xa')](config[_0x5aab('0x9')],{'host':_0x5aab('0xb'),'port':0x18eb});var socket=require(_0x5aab('0xc'))(new Redis(config[_0x5aab('0x9')]));require(_0x5aab('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ca3f3,_0x156757,_0x5f1334){return new BPromise(function(_0xb88f24,_0x128bb6){return client['request'](_0x1ca3f3,_0x5f1334)['then'](function(_0xeeaac9){logger[_0x5aab('0xe')](_0x5aab('0xf'),_0x156757,_0x5aab('0x10'));logger[_0x5aab('0x11')](_0x5aab('0x12'),_0x156757,_0x5aab('0x10'),JSON[_0x5aab('0x13')](_0xeeaac9));if(_0xeeaac9[_0x5aab('0x14')]){if(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x15')]===0x1f4){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9['error']['message']);return _0x128bb6(_0xeeaac9[_0x5aab('0x14')]['message']);}logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0xeeaac9[_0x5aab('0x14')]['message']);return _0xb88f24(_0xeeaac9[_0x5aab('0x14')][_0x5aab('0x16')]);}else{logger['info'](_0x5aab('0xf'),_0x156757,'request\x20sent');_0xb88f24(_0xeeaac9['result'][_0x5aab('0x16')]);}})[_0x5aab('0x17')](function(_0x2a4398){logger[_0x5aab('0x14')](_0x5aab('0xf'),_0x156757,_0x2a4398);_0x128bb6(_0x2a4398);});});}
\ No newline at end of file
+var _0x4fa8=['then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request'];(function(_0x15d0dc,_0xa62ba4){var _0x23c760=function(_0x288733){while(--_0x288733){_0x15d0dc['push'](_0x15d0dc['shift']());}};_0x23c760(++_0xa62ba4);}(_0x4fa8,0xfd));var _0x84fa=function(_0x2bfbc7,_0x6275a2){_0x2bfbc7=_0x2bfbc7-0x0;var _0x2c2c27=_0x4fa8[_0x2bfbc7];return _0x2c2c27;};'use strict';var _=require('lodash');var util=require(_0x84fa('0x0'));var moment=require(_0x84fa('0x1'));var BPromise=require(_0x84fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84fa('0x3'));var db=require(_0x84fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84fa('0x5'));var config=require(_0x84fa('0x6'));var jayson=require(_0x84fa('0x7'));var client=jayson[_0x84fa('0x8')][_0x84fa('0x9')]({'port':0x232a});config[_0x84fa('0xa')]=_[_0x84fa('0xb')](config[_0x84fa('0xa')],{'host':_0x84fa('0xc'),'port':0x18eb});var socket=require(_0x84fa('0xd'))(new Redis(config[_0x84fa('0xa')]));require(_0x84fa('0xe'))[_0x84fa('0xf')](socket);function respondWithRpcPromise(_0x448651,_0x3df593,_0x56c225){return new BPromise(function(_0xfef212,_0x1991bb){return client[_0x84fa('0x10')](_0x448651,_0x56c225)[_0x84fa('0x11')](function(_0x4f0653){logger[_0x84fa('0x12')](_0x84fa('0x13'),_0x3df593,'request\x20sent');logger[_0x84fa('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3df593,_0x84fa('0x15'),JSON['stringify'](_0x4f0653));if(_0x4f0653[_0x84fa('0x16')]){if(_0x4f0653[_0x84fa('0x16')][_0x84fa('0x17')]===0x1f4){logger[_0x84fa('0x16')](_0x84fa('0x13'),_0x3df593,_0x4f0653[_0x84fa('0x16')][_0x84fa('0x18')]);return _0x1991bb(_0x4f0653[_0x84fa('0x16')][_0x84fa('0x18')]);}logger[_0x84fa('0x16')](_0x84fa('0x13'),_0x3df593,_0x4f0653[_0x84fa('0x16')][_0x84fa('0x18')]);return _0xfef212(_0x4f0653[_0x84fa('0x16')]['message']);}else{logger[_0x84fa('0x12')](_0x84fa('0x13'),_0x3df593,_0x84fa('0x15'));_0xfef212(_0x4f0653[_0x84fa('0x19')][_0x84fa('0x18')]);}})[_0x84fa('0x1a')](function(_0x346a8e){logger['error'](_0x84fa('0x13'),_0x3df593,_0x346a8e);_0x1991bb(_0x346a8e);});});}
\ No newline at end of file
index cf04254..c64a723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f0=['./chatWebsite.events','save','remove','update','emit','removeListener','length','chatWebsite:'];(function(_0x424329,_0x1a3e61){var _0x324625=function(_0x3e2ce2){while(--_0x3e2ce2){_0x424329['push'](_0x424329['shift']());}};_0x324625(++_0x1a3e61);}(_0xe9f0,0x140));var _0x0e9f=function(_0x1ee568,_0x5593b7){_0x1ee568=_0x1ee568-0x0;var _0x52c783=_0xe9f0[_0x1ee568];return _0x52c783;};'use strict';var ChatWebsiteEvents=require(_0x0e9f('0x0'));var events=[_0x0e9f('0x1'),_0x0e9f('0x2'),_0x0e9f('0x3')];function createListener(_0x4258b8,_0x36a4bc){return function(_0x1ef4e5){_0x36a4bc[_0x0e9f('0x4')](_0x4258b8,_0x1ef4e5);};}function removeListener(_0x49487e,_0x578c92){return function(){ChatWebsiteEvents[_0x0e9f('0x5')](_0x49487e,_0x578c92);};}exports['register']=function(_0x11f26c){for(var _0x9b7ee1=0x0,_0x300e9e=events[_0x0e9f('0x6')];_0x9b7ee1<_0x300e9e;_0x9b7ee1++){var _0x19e41d=events[_0x9b7ee1];var _0x28da26=createListener(_0x0e9f('0x7')+_0x19e41d,_0x11f26c);ChatWebsiteEvents['on'](_0x19e41d,_0x28da26);}};
\ No newline at end of file
+var _0xa9d4=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0xa9d4,0xbe));var _0x4a9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9d4[_0x3dd15e];return _0x231fd0;};'use strict';var ChatWebsiteEvents=require(_0x4a9d('0x0'));var events=[_0x4a9d('0x1'),_0x4a9d('0x2'),_0x4a9d('0x3')];function createListener(_0x47eb4a,_0x436e71){return function(_0x315aff){_0x436e71[_0x4a9d('0x4')](_0x47eb4a,_0x315aff);};}function removeListener(_0x19fde2,_0x2a12ec){return function(){ChatWebsiteEvents[_0x4a9d('0x5')](_0x19fde2,_0x2a12ec);};}exports[_0x4a9d('0x6')]=function(_0x2b3a0a){for(var _0x52dc18=0x0,_0x61212a=events[_0x4a9d('0x7')];_0x52dc18<_0x61212a;_0x52dc18++){var _0x1b4032=events[_0x52dc18];var _0x5866b3=createListener(_0x4a9d('0x8')+_0x1b4032,_0x2b3a0a);ChatWebsiteEvents['on'](_0x1b4032,_0x5866b3);}};
\ No newline at end of file
index 2bb364e..1832633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3982=['describe','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','notify','server/files','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','/:id/interactions','addInteraction','put','/:id','update','destroy','/:id/dispositions','removeDispositions','removeAnswers','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe'];(function(_0x331e77,_0x114123){var _0x5b1b95=function(_0x1691ae){while(--_0x1691ae){_0x331e77['push'](_0x331e77['shift']());}};_0x5b1b95(++_0x114123);}(_0x3982,0x196));var _0x2398=function(_0x2bf68c,_0x18920b){_0x2bf68c=_0x2bf68c-0x0;var _0x54c487=_0x3982[_0x2bf68c];return _0x54c487;};'use strict';var multer=require(_0x2398('0x0'));var util=require(_0x2398('0x1'));var path=require(_0x2398('0x2'));var timeout=require(_0x2398('0x3'));var express=require(_0x2398('0x4'));var router=express[_0x2398('0x5')]();var fs_extra=require(_0x2398('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2398('0x7'));var config=require(_0x2398('0x8'));var controller=require(_0x2398('0x9'));router['get']('/',auth[_0x2398('0xa')](),controller[_0x2398('0xb')]);router[_0x2398('0xc')](_0x2398('0xd'),auth[_0x2398('0xa')](),controller[_0x2398('0xe')]);router['get']('/:id',auth[_0x2398('0xa')](),controller['show']);router[_0x2398('0xc')]('/:id/dispositions',auth[_0x2398('0xa')](),controller['getDispositions']);router[_0x2398('0xc')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x10')]);router[_0x2398('0xc')](_0x2398('0x11'),controller['getLogo']);router[_0x2398('0xc')](_0x2398('0x12'),controller[_0x2398('0x13')]);router[_0x2398('0xc')](_0x2398('0x14'),controller['getCustomerAvatar']);router[_0x2398('0xc')](_0x2398('0x15'),controller['getSystemAvatar']);router[_0x2398('0xc')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x2398('0x16')]);router['get'](_0x2398('0x17'),controller[_0x2398('0x18')]);router['get'](_0x2398('0x19'),auth['isAuthenticated'](),controller[_0x2398('0x1a')]);router[_0x2398('0xc')](_0x2398('0x1b'),auth[_0x2398('0xa')](),controller[_0x2398('0x1c')]);router['get'](_0x2398('0x1d'),controller[_0x2398('0x1e')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x2398('0x1f')]);router[_0x2398('0xc')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller[_0x2398('0x21')]);router[_0x2398('0x22')]('/',auth[_0x2398('0xa')](),controller['create']);router[_0x2398('0x22')]('/:id/dispositions',auth[_0x2398('0xa')](),controller[_0x2398('0x23')]);router[_0x2398('0x22')](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x24')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x460ecc,_0x497ad3,_0x195dbb){_0x195dbb(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x28')));},'filename':function(_0x4763d9,_0x38d99d,_0x5647d6){_0x5647d6(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x38d99d[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x11'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller[_0x2398('0x2f')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x137609,_0x47e9f4,_0x246673){_0x246673(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x2d4f45,_0x146874,_0xeb3da0){_0xeb3da0(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date['now'](),_0x146874[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x12'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x4127f8,_0x169c00,_0x1025a5){_0x1025a5(null,path[_0x2398('0x26')](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0x336bf1,_0x5e2354,_0x6b3add){_0x6b3add(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x5e2354[_0x2398('0x2c')]));}})});router['post'](_0x2398('0x14'),upload[_0x2398('0x2d')]('file'),controller[_0x2398('0x31')]);var upload=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x15c7b0,_0x207d00,_0x34fc5a){_0x34fc5a(null,path['join'](config[_0x2398('0x27')],_0x2398('0x30')));},'filename':function(_0xc03907,_0x44f176,_0x40afa2){_0x40afa2(null,util[_0x2398('0x29')](_0x2398('0x2a'),Date[_0x2398('0x2b')](),_0x44f176[_0x2398('0x2c')]));}})});router[_0x2398('0x22')](_0x2398('0x15'),upload[_0x2398('0x2d')](_0x2398('0x2e')),controller['addSystemAvatar']);router[_0x2398('0x22')]('/:id/notify',controller[_0x2398('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x2398('0x25')]({'destination':function(_0x3a5bf7,_0x5c937d,_0x34a0c5){const _0x500dca=path['join'](config[_0x2398('0x27')],_0x2398('0x33'),'attachments',_0x2398('0x34'));fs_extra[_0x2398('0x35')](_0x500dca,function(){_0x34a0c5(null,_0x500dca);});},'filename':function(_0x158980,_0x513f8d,_0x33c658){const _0x5bde9f=_0x513f8d[_0x2398('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x57d52a=path[_0x2398('0x36')](_0x5bde9f);const _0x88d459=Date['now']()+'-'+_0x5bde9f[_0x2398('0x37')](_0x57d52a,'')+_0x57d52a;_0x33c658(null,_0x88d459);}})});router[_0x2398('0x22')](_0x2398('0x38'),offlineUploadMulter[_0x2398('0x39')](),controller[_0x2398('0x3a')]);router[_0x2398('0x22')](_0x2398('0x3b'),auth[_0x2398('0xa')](),controller[_0x2398('0x3c')]);router[_0x2398('0x22')]('/:id/applications',auth[_0x2398('0xa')](),controller['addApplications']);router[_0x2398('0x22')](_0x2398('0x1b'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x2398('0x22')](_0x2398('0x20'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2398('0x3d')](_0x2398('0x3e'),auth[_0x2398('0xa')](),controller[_0x2398('0x3f')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2398('0x40')]);router['delete'](_0x2398('0x41'),auth[_0x2398('0xa')](),controller[_0x2398('0x42')]);router['delete'](_0x2398('0xf'),auth[_0x2398('0xa')](),controller[_0x2398('0x43')]);router[_0x2398('0x44')](_0x2398('0x20'),auth[_0x2398('0xa')](),controller['removeAgents']);module[_0x2398('0x45')]=router;
\ No newline at end of file
+var _0x94f8=['ensureDir','extname','replace','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','format','server/files','offline-chat'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x94f8,0x94));var _0x894f=function(_0x51c938,_0x7b322){_0x51c938=_0x51c938-0x0;var _0x4bb8b2=_0x94f8[_0x51c938];return _0x4bb8b2;};'use strict';var multer=require(_0x894f('0x0'));var util=require(_0x894f('0x1'));var path=require(_0x894f('0x2'));var timeout=require(_0x894f('0x3'));var express=require(_0x894f('0x4'));var router=express['Router']();var fs_extra=require(_0x894f('0x5'));var auth=require(_0x894f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x894f('0x7'));router[_0x894f('0x8')]('/',auth[_0x894f('0x9')](),controller[_0x894f('0xa')]);router[_0x894f('0x8')](_0x894f('0xb'),auth['isAuthenticated'](),controller[_0x894f('0xc')]);router['get'](_0x894f('0xd'),auth['isAuthenticated'](),controller[_0x894f('0xe')]);router[_0x894f('0x8')](_0x894f('0xf'),auth[_0x894f('0x9')](),controller[_0x894f('0x10')]);router[_0x894f('0x8')](_0x894f('0x11'),auth[_0x894f('0x9')](),controller['getAnswers']);router[_0x894f('0x8')](_0x894f('0x12'),controller['getLogo']);router[_0x894f('0x8')](_0x894f('0x13'),controller[_0x894f('0x14')]);router['get'](_0x894f('0x15'),controller[_0x894f('0x16')]);router[_0x894f('0x8')](_0x894f('0x17'),controller[_0x894f('0x18')]);router[_0x894f('0x8')](_0x894f('0x19'),auth[_0x894f('0x9')](),controller['getInteractions']);router[_0x894f('0x8')]('/:id/snippet',controller['getSnippet']);router[_0x894f('0x8')](_0x894f('0x1a'),auth[_0x894f('0x9')](),controller[_0x894f('0x1b')]);router[_0x894f('0x8')](_0x894f('0x1c'),auth[_0x894f('0x9')](),controller[_0x894f('0x1d')]);router['get'](_0x894f('0x1e'),controller['getFields']);router[_0x894f('0x8')](_0x894f('0x1f'),auth[_0x894f('0x9')](),controller[_0x894f('0x20')]);router[_0x894f('0x8')](_0x894f('0x21'),auth[_0x894f('0x9')](),controller[_0x894f('0x22')]);router[_0x894f('0x23')]('/',auth[_0x894f('0x9')](),controller[_0x894f('0x24')]);router[_0x894f('0x23')]('/:id/dispositions',auth[_0x894f('0x9')](),controller[_0x894f('0x25')]);router[_0x894f('0x23')](_0x894f('0x11'),auth['isAuthenticated'](),controller[_0x894f('0x26')]);var upload=multer({'storage':multer[_0x894f('0x27')]({'destination':function(_0x34ab7f,_0xb104df,_0x53aad9){_0x53aad9(null,path['join'](config[_0x894f('0x28')],_0x894f('0x29')));},'filename':function(_0x13ed04,_0x43a8a6,_0x1c9948){_0x1c9948(null,util['format'](_0x894f('0x2a'),Date[_0x894f('0x2b')](),_0x43a8a6[_0x894f('0x2c')]));}})});router[_0x894f('0x23')](_0x894f('0x12'),upload[_0x894f('0x2d')](_0x894f('0x2e')),controller[_0x894f('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5552fc,_0x5bc327,_0x58b1a0){_0x58b1a0(null,path[_0x894f('0x30')](config[_0x894f('0x28')],_0x894f('0x31')));},'filename':function(_0x25cb5f,_0x549ffa,_0xce3cfc){_0xce3cfc(null,util[_0x894f('0x32')](_0x894f('0x2a'),Date['now'](),_0x549ffa[_0x894f('0x2c')]));}})});router['post']('/:id/avatar',upload[_0x894f('0x2d')](_0x894f('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer[_0x894f('0x27')]({'destination':function(_0x4c9d57,_0x51f23b,_0x12df74){_0x12df74(null,path['join'](config[_0x894f('0x28')],_0x894f('0x31')));},'filename':function(_0x33eaf3,_0x50feb2,_0xc55c7e){_0xc55c7e(null,util[_0x894f('0x32')]('%s-%s',Date[_0x894f('0x2b')](),_0x50feb2[_0x894f('0x2c')]));}})});router[_0x894f('0x23')]('/:id/customer_avatar',upload[_0x894f('0x2d')](_0x894f('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb532c3,_0x422ddc,_0x7d798c){_0x7d798c(null,path[_0x894f('0x30')](config[_0x894f('0x28')],'server/files/images/avatars/'));},'filename':function(_0x43dd31,_0xba24f2,_0xbb5873){_0xbb5873(null,util[_0x894f('0x32')](_0x894f('0x2a'),Date[_0x894f('0x2b')](),_0xba24f2[_0x894f('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x894f('0x2d')](_0x894f('0x2e')),controller['addSystemAvatar']);router[_0x894f('0x23')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x363e42,_0xf4eb9f,_0x1b758f){const _0x43f425=path[_0x894f('0x30')](config[_0x894f('0x28')],_0x894f('0x33'),'attachments',_0x894f('0x34'));fs_extra[_0x894f('0x35')](_0x43f425,function(){_0x1b758f(null,_0x43f425);});},'filename':function(_0x27e76d,_0x84fb2c,_0x178a2a){const _0x57eb1b=_0x84fb2c[_0x894f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x312446=path[_0x894f('0x36')](_0x57eb1b);const _0x413efd=Date[_0x894f('0x2b')]()+'-'+_0x57eb1b[_0x894f('0x37')](_0x312446,'')+_0x312446;_0x178a2a(null,_0x413efd);}})});router['post'](_0x894f('0x38'),offlineUploadMulter['any'](),controller[_0x894f('0x39')]);router['post'](_0x894f('0x19'),auth[_0x894f('0x9')](),controller[_0x894f('0x3a')]);router[_0x894f('0x23')](_0x894f('0x1a'),auth[_0x894f('0x9')](),controller[_0x894f('0x3b')]);router[_0x894f('0x23')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x894f('0x3c')]);router['post'](_0x894f('0x21'),auth[_0x894f('0x9')](),controller['addAgents']);router[_0x894f('0x3d')](_0x894f('0xd'),auth[_0x894f('0x9')](),controller[_0x894f('0x3e')]);router[_0x894f('0x3f')](_0x894f('0xd'),auth[_0x894f('0x9')](),controller[_0x894f('0x40')]);router[_0x894f('0x3f')](_0x894f('0xf'),auth[_0x894f('0x9')](),controller['removeDispositions']);router[_0x894f('0x3f')]('/:id/canned_answers',auth[_0x894f('0x9')](),controller['removeAnswers']);router['delete'](_0x894f('0x21'),auth[_0x894f('0x9')](),controller[_0x894f('0x41')]);module[_0x894f('0x42')]=router;
\ No newline at end of file
index 8264e56..90ad6d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eff=['ENUM','Google','exports','STRING'];(function(_0x2596e6,_0x1d37fb){var _0x1d37d6=function(_0x3ce9b7){while(--_0x3ce9b7){_0x2596e6['push'](_0x2596e6['shift']());}};_0x1d37d6(++_0x1d37fb);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf7ef('0x0')]={'name':{'type':Sequelize[_0xf7ef('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf7ef('0x2')]('AmazonAWS',_0xf7ef('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xf7ef('0x1')]},'data2':{'type':Sequelize[_0xf7ef('0x1')]}};
\ No newline at end of file
+var _0x539d=['ENUM','sequelize','STRING'];(function(_0x54b17b,_0xcac443){var _0x587335=function(_0x5e716b){while(--_0x5e716b){_0x54b17b['push'](_0x54b17b['shift']());}};_0x587335(++_0xcac443);}(_0x539d,0x17b));var _0xd539=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x539d[_0x3ba924];return _0x4cc1df;};'use strict';var Sequelize=require(_0xd539('0x0'));module['exports']={'name':{'type':Sequelize[_0xd539('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd539('0x2')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xd539('0x1')]},'data2':{'type':Sequelize[_0xd539('0x1')]}};
\ No newline at end of file
index f2cdbe4..d5f7f84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ee191,_0x2b8c91){_0x1ee191=_0x1ee191-0x0;var _0x5288bc=_0x5f2f[_0x1ee191];return _0x5288bc;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};
\ No newline at end of file
+var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x89c0f5,_0x2cd1d8){var _0x206725=function(_0x2470a){while(--_0x2470a){_0x89c0f5['push'](_0x89c0f5['shift']());}};_0x206725(++_0x2cd1d8);}(_0x2ef3,0xba));var _0x32ef=function(_0x59a5cb,_0x36c499){_0x59a5cb=_0x59a5cb-0x0;var _0x2454df=_0x2ef3[_0x59a5cb];return _0x2454df;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
index 21665b3..8ff6453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb85c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util'];(function(_0x33d6b0,_0x183044){var _0x41d3d9=function(_0x5aead0){while(--_0x5aead0){_0x33d6b0['push'](_0x33d6b0['shift']());}};_0x41d3d9(++_0x183044);}(_0xb85c,0x197));var _0xcb85=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb85c[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require('lodash');var util=require(_0xcb85('0x0'));var logger=require(_0xcb85('0x1'))(_0xcb85('0x2'));var moment=require(_0xcb85('0x3'));var BPromise=require(_0xcb85('0x4'));var rp=require(_0xcb85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb85('0x6'));var config=require(_0xcb85('0x7'));var attributes=require(_0xcb85('0x8'));module[_0xcb85('0x9')]=function(_0xadfd76,_0x24fd74){return _0xadfd76[_0xcb85('0xa')](_0xcb85('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a62=['util','api','moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers'];(function(_0x8a938a,_0xe07504){var _0x5bd3ee=function(_0x4de940){while(--_0x4de940){_0x8a938a['push'](_0x8a938a['shift']());}};_0x5bd3ee(++_0xe07504);}(_0x0a62,0x1b8));var _0x20a6=function(_0x4f526c,_0x6c4dbe){_0x4f526c=_0x4f526c-0x0;var _0x38a51e=_0x0a62[_0x4f526c];return _0x38a51e;};'use strict';var _=require('lodash');var util=require(_0x20a6('0x0'));var logger=require('../../config/logger')(_0x20a6('0x1'));var moment=require(_0x20a6('0x2'));var BPromise=require('bluebird');var rp=require(_0x20a6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20a6('0x4'));var config=require(_0x20a6('0x5'));var attributes=require(_0x20a6('0x6'));module[_0x20a6('0x7')]=function(_0x5add5d,_0x10d049){return _0x5add5d['define'](_0x20a6('0x8'),attributes,{'tableName':_0x20a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 15e1c03..8387189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x531a=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x19fabd,_0x4cf7d5){var _0x2fa7d8=function(_0x121c85){while(--_0x121c85){_0x19fabd['push'](_0x19fabd['shift']());}};_0x2fa7d8(++_0x4cf7d5);}(_0x531a,0x100));var _0xa531=function(_0x3e6aed,_0x97a2f1){_0x3e6aed=_0x3e6aed-0x0;var _0x3220dd=_0x531a[_0x3e6aed];return _0x3220dd;};'use strict';var _=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var moment=require(_0xa531('0x2'));var BPromise=require(_0xa531('0x3'));var rs=require(_0xa531('0x4'));var fs=require('fs');var Redis=require(_0xa531('0x5'));var db=require(_0xa531('0x6'))['db'];var utils=require(_0xa531('0x7'));var logger=require(_0xa531('0x8'))(_0xa531('0x9'));var config=require('../../config/environment');var jayson=require(_0xa531('0xa'));var client=jayson['client'][_0xa531('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4446b9,_0x3fd172,_0x286dc7){return new BPromise(function(_0x3b68a7,_0x5bd2f9){return client[_0xa531('0xc')](_0x4446b9,_0x286dc7)[_0xa531('0xd')](function(_0x4d07e4){logger[_0xa531('0xe')](_0xa531('0xf'),_0x3fd172,_0xa531('0x10'));logger[_0xa531('0x11')](_0xa531('0x12'),_0x3fd172,'request\x20sent',JSON[_0xa531('0x13')](_0x4d07e4));if(_0x4d07e4['error']){if(_0x4d07e4[_0xa531('0x14')][_0xa531('0x15')]===0x1f4){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x5bd2f9(_0x4d07e4['error'][_0xa531('0x16')]);}logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x4d07e4[_0xa531('0x14')][_0xa531('0x16')]);return _0x3b68a7(_0x4d07e4[_0xa531('0x14')]['message']);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0xa531('0x10'));_0x3b68a7(_0x4d07e4[_0xa531('0x17')][_0xa531('0x16')]);}})[_0xa531('0x18')](function(_0x324076){logger[_0xa531('0x14')]('CloudProvider,\x20%s,\x20%s',_0x3fd172,_0x324076);_0x5bd2f9(_0x324076);});});}
\ No newline at end of file
+var _0x9a18=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x45b583,_0x891a5d){var _0x399269=function(_0x2868b7){while(--_0x2868b7){_0x45b583['push'](_0x45b583['shift']());}};_0x399269(++_0x891a5d);}(_0x9a18,0x187));var _0x89a1=function(_0x47475b,_0x37c142){_0x47475b=_0x47475b-0x0;var _0xc0c5d6=_0x9a18[_0x47475b];return _0xc0c5d6;};'use strict';var _=require(_0x89a1('0x0'));var util=require('util');var moment=require(_0x89a1('0x1'));var BPromise=require(_0x89a1('0x2'));var rs=require(_0x89a1('0x3'));var fs=require('fs');var Redis=require(_0x89a1('0x4'));var db=require(_0x89a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89a1('0x6'))(_0x89a1('0x7'));var config=require(_0x89a1('0x8'));var jayson=require(_0x89a1('0x9'));var client=jayson[_0x89a1('0xa')][_0x89a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec780,_0xcde361,_0x5da9e6){return new BPromise(function(_0x55ac1e,_0x3bba21){return client['request'](_0x3ec780,_0x5da9e6)[_0x89a1('0xc')](function(_0x541951){logger[_0x89a1('0xd')](_0x89a1('0xe'),_0xcde361,_0x89a1('0xf'));logger[_0x89a1('0x10')](_0x89a1('0x11'),_0xcde361,_0x89a1('0xf'),JSON[_0x89a1('0x12')](_0x541951));if(_0x541951[_0x89a1('0x13')]){if(_0x541951[_0x89a1('0x13')][_0x89a1('0x14')]===0x1f4){logger[_0x89a1('0x13')]('CloudProvider,\x20%s,\x20%s',_0xcde361,_0x541951['error'][_0x89a1('0x15')]);return _0x3bba21(_0x541951[_0x89a1('0x13')][_0x89a1('0x15')]);}logger[_0x89a1('0x13')]('CloudProvider,\x20%s,\x20%s',_0xcde361,_0x541951[_0x89a1('0x13')][_0x89a1('0x15')]);return _0x55ac1e(_0x541951['error'][_0x89a1('0x15')]);}else{logger[_0x89a1('0xd')](_0x89a1('0xe'),_0xcde361,_0x89a1('0xf'));_0x55ac1e(_0x541951[_0x89a1('0x16')][_0x89a1('0x15')]);}})[_0x89a1('0x17')](function(_0x325a5a){logger['error'](_0x89a1('0xe'),_0xcde361,_0x325a5a);_0x3bba21(_0x325a5a);});});}
\ No newline at end of file
index 4fd9bfe..0b03d02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ba1=['update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x1ef49c,_0x55c959){var _0x1936ef=function(_0x1d23d4){while(--_0x1d23d4){_0x1ef49c['push'](_0x1ef49c['shift']());}};_0x1936ef(++_0x55c959);}(_0x4ba1,0x159));var _0x14ba=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4ba1[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0x14ba('0x0'));var util=require(_0x14ba('0x1'));var path=require(_0x14ba('0x2'));var timeout=require(_0x14ba('0x3'));var express=require(_0x14ba('0x4'));var router=express['Router']();var fs_extra=require(_0x14ba('0x5'));var auth=require(_0x14ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x14ba('0x7'));var controller=require(_0x14ba('0x8'));router[_0x14ba('0x9')]('/',auth[_0x14ba('0xa')](),controller[_0x14ba('0xb')]);router[_0x14ba('0x9')](_0x14ba('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x14ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x14ba('0xe')]);router[_0x14ba('0xf')](_0x14ba('0xc'),auth['isAuthenticated'](),controller[_0x14ba('0x10')]);router[_0x14ba('0x11')](_0x14ba('0xc'),auth[_0x14ba('0xa')](),controller[_0x14ba('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2186=['./cloudProvider.controller','get','isAuthenticated','show','post','create','/:id','update','delete','destroy','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2186,0x1ca));var _0x6218=function(_0x2cb7e5,_0xdf45f4){_0x2cb7e5=_0x2cb7e5-0x0;var _0x5414f0=_0x2186[_0x2cb7e5];return _0x5414f0;};'use strict';var multer=require(_0x6218('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6218('0x1'));var router=express[_0x6218('0x2')]();var fs_extra=require(_0x6218('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6218('0x4'));var config=require(_0x6218('0x5'));var controller=require(_0x6218('0x6'));router[_0x6218('0x7')]('/',auth[_0x6218('0x8')](),controller['index']);router['get']('/:id',auth[_0x6218('0x8')](),controller[_0x6218('0x9')]);router[_0x6218('0xa')]('/',auth[_0x6218('0x8')](),controller[_0x6218('0xb')]);router['put'](_0x6218('0xc'),auth[_0x6218('0x8')](),controller[_0x6218('0xd')]);router[_0x6218('0xe')](_0x6218('0xc'),auth[_0x6218('0x8')](),controller[_0x6218('0xf')]);module['exports']=router;
\ No newline at end of file
index 374aef4..efe2ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68de=['STRING','sequelize','exports'];(function(_0x2eb067,_0x1b0899){var _0xf87aaf=function(_0x7f9ce3){while(--_0x7f9ce3){_0x2eb067['push'](_0x2eb067['shift']());}};_0xf87aaf(++_0x1b0899);}(_0x68de,0xfa));var _0xe68d=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x68de[_0x1b25c1];return _0x1e4447;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'name':{'type':Sequelize[_0xe68d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe68d('0x2')]},'companyId':{'type':Sequelize[_0xe68d('0x2')]},'website':{'type':Sequelize[_0xe68d('0x2')]},'phone':{'type':Sequelize[_0xe68d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe68d('0x2')]},'street':{'type':Sequelize[_0xe68d('0x2')]},'postalCode':{'type':Sequelize[_0xe68d('0x2')]},'city':{'type':Sequelize[_0xe68d('0x2')]},'country':{'type':Sequelize[_0xe68d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe68d('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xe68d('0x2')]},'sCity':{'type':Sequelize[_0xe68d('0x2')]},'sCountry':{'type':Sequelize[_0xe68d('0x2')]},'description':{'type':Sequelize[_0xe68d('0x2')]}};
\ No newline at end of file
+var _0xf13a=['STRING'];(function(_0x491ee6,_0x290b18){var _0x541e79=function(_0x4f1b11){while(--_0x4f1b11){_0x491ee6['push'](_0x491ee6['shift']());}};_0x541e79(++_0x290b18);}(_0xf13a,0x10b));var _0xaf13=function(_0xa2b098,_0x461a08){_0xa2b098=_0xa2b098-0x0;var _0x29502e=_0xf13a[_0xa2b098];return _0x29502e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xaf13('0x0')]},'companyId':{'type':Sequelize[_0xaf13('0x0')]},'website':{'type':Sequelize[_0xaf13('0x0')]},'phone':{'type':Sequelize[_0xaf13('0x0')]},'fax':{'type':Sequelize[_0xaf13('0x0')]},'type':{'type':Sequelize[_0xaf13('0x0')]},'street':{'type':Sequelize[_0xaf13('0x0')]},'postalCode':{'type':Sequelize[_0xaf13('0x0')]},'city':{'type':Sequelize[_0xaf13('0x0')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xaf13('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xaf13('0x0')]},'sStreet':{'type':Sequelize[_0xaf13('0x0')]},'sPostalCode':{'type':Sequelize[_0xaf13('0x0')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xaf13('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d042390..cade34d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20c3=['hasOwnProperty','nolimit','pick','where','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','CmCompany','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','order','sort','filter','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','save','update','then','Companies','UserProfileResource','destroy','sendStatus','error','stack','send','index','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x1e701a,_0x44b807){var _0x497de0=function(_0x1a2de6){while(--_0x1a2de6){_0x1e701a['push'](_0x1e701a['shift']());}};_0x497de0(++_0x44b807);}(_0x20c3,0x7b));var _0x320c=function(_0x5d9171,_0x5ccd64){_0x5d9171=_0x5d9171-0x0;var _0x49aa7b=_0x20c3[_0x5d9171];return _0x49aa7b;};'use strict';var emlformat=require(_0x320c('0x0'));var rimraf=require(_0x320c('0x1'));var zipdir=require(_0x320c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x320c('0x3'));var BPromise=require(_0x320c('0x4'));var Mustache=require(_0x320c('0x5'));var util=require(_0x320c('0x6'));var path=require(_0x320c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x320c('0x8'));var fs=require('fs');var fs_extra=require(_0x320c('0x9'));var _=require(_0x320c('0xa'));var squel=require(_0x320c('0xb'));var crypto=require('crypto');var jsforce=require(_0x320c('0xc'));var deskjs=require(_0x320c('0xd'));var toCsv=require(_0x320c('0xe'));var querystring=require(_0x320c('0xf'));var Papa=require('papaparse');var Redis=require(_0x320c('0x10'));var authService=require(_0x320c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x320c('0x12'))('api');var utils=require(_0x320c('0x13'));var config=require(_0x320c('0x14'));var licenseUtil=require(_0x320c('0x15'));var db=require(_0x320c('0x16'))['db'];function respondWithStatusCode(_0x2aa04e,_0x4bf946){_0x4bf946=_0x4bf946||0xcc;return function(_0x53a7c7){if(_0x53a7c7){return _0x2aa04e['sendStatus'](_0x4bf946);}return _0x2aa04e[_0x320c('0x17')](_0x4bf946)[_0x320c('0x18')]();};}function respondWithResult(_0x64752e,_0x85bdd9){_0x85bdd9=_0x85bdd9||0xc8;return function(_0x586e99){if(_0x586e99){return _0x64752e[_0x320c('0x17')](_0x85bdd9)[_0x320c('0x19')](_0x586e99);}};}function respondWithFilteredResult(_0x3832c7,_0x40ed90){return function(_0x4ef851){if(_0x4ef851){var _0x1d314f=typeof _0x40ed90['offset']===_0x320c('0x1a')&&typeof _0x40ed90['limit']==='undefined';var _0x3cf5b5=_0x4ef851[_0x320c('0x1b')];var _0x457e78=_0x1d314f?0x0:_0x40ed90[_0x320c('0x1c')];var _0x5c01a2=_0x1d314f?_0x4ef851[_0x320c('0x1b')]:_0x40ed90[_0x320c('0x1c')]+_0x40ed90[_0x320c('0x1d')];var _0xa813c;if(_0x5c01a2>=_0x3cf5b5){_0x5c01a2=_0x3cf5b5;_0xa813c=0xc8;}else{_0xa813c=0xce;}_0x3832c7[_0x320c('0x17')](_0xa813c);return _0x3832c7[_0x320c('0x1e')](_0x320c('0x1f'),_0x457e78+'-'+_0x5c01a2+'/'+_0x3cf5b5)[_0x320c('0x19')](_0x4ef851);}return null;};}function patchUpdates(_0x432efe){return function(_0x46cebb){try{jsonpatch['apply'](_0x46cebb,_0x432efe,!![]);}catch(_0x34953d){return BPromise['reject'](_0x34953d);}return _0x46cebb[_0x320c('0x20')]();};}function saveUpdates(_0x1dc3ba,_0x2be585){return function(_0x5170e6){if(_0x5170e6){return _0x5170e6[_0x320c('0x21')](_0x1dc3ba)['then'](function(_0x27cbc1){return _0x27cbc1;});}return null;};}function removeEntity(_0x42cbf4,_0x875f2){return function(_0x7bb72f){if(_0x7bb72f){return _0x7bb72f['destroy']()[_0x320c('0x22')](function(){var _0x9a3674=_0x7bb72f['get']({'plain':!![]});var _0x2dbd84=_0x320c('0x23');return db[_0x320c('0x24')][_0x320c('0x25')]({'where':{'type':_0x2dbd84,'resourceId':_0x9a3674['id']}})[_0x320c('0x22')](function(){return _0x7bb72f;});})[_0x320c('0x22')](function(){_0x42cbf4[_0x320c('0x17')](0xcc)[_0x320c('0x18')]();});}};}function handleEntityNotFound(_0x23385a,_0x45cc91){return function(_0xa70f06){if(!_0xa70f06){_0x23385a[_0x320c('0x26')](0x194);}return _0xa70f06;};}function handleError(_0xef7eca,_0x337830){_0x337830=_0x337830||0x1f4;return function(_0x564e3b){logger[_0x320c('0x27')](_0x564e3b[_0x320c('0x28')]);if(_0x564e3b['name']){delete _0x564e3b['name'];}_0xef7eca[_0x320c('0x17')](_0x337830)[_0x320c('0x29')](_0x564e3b);};}exports[_0x320c('0x2a')]=function(_0x4c8a6d,_0x155d35){var _0x5bf607={},_0x33ec2d={},_0x3abd09={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x320c('0x22')](function(_0x42a5ac){_0x33ec2d[_0x320c('0x2b')]=_[_0x320c('0x2c')](_0x42a5ac);_0x33ec2d[_0x320c('0x2d')]=_[_0x320c('0x2c')](_0x4c8a6d[_0x320c('0x2d')]);_0x33ec2d[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x33ec2d[_0x320c('0x2b')],_0x33ec2d[_0x320c('0x2d')]);_0x5bf607[_0x320c('0x30')]=_['intersection'](_0x33ec2d[_0x320c('0x2b')],qs[_0x320c('0x31')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x31')]));_0x5bf607['attributes']=_0x5bf607['attributes'][_0x320c('0x32')]?_0x5bf607['attributes']:_0x33ec2d[_0x320c('0x2b')];if(!_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x33')](_0x320c('0x34'))){_0x5bf607['limit']=qs[_0x320c('0x1d')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1d')]);_0x5bf607['offset']=qs[_0x320c('0x1c')](_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x1c')]);}_0x5bf607['order']=qs['sort'](_0x4c8a6d[_0x320c('0x2d')]['sort']);_0x5bf607['where']=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x4c8a6d[_0x320c('0x2d')],_0x33ec2d[_0x320c('0x2e')]),_0x42a5ac);if(_0x4c8a6d[_0x320c('0x2d')]['filter']){_0x5bf607[_0x320c('0x36')]=_[_0x320c('0x37')](_0x5bf607[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x5bf607[_0x320c('0x30')],function(_0x2cd283){var _0x3afb1d={};_0x3afb1d[_0x2cd283]={'$like':'%'+_0x4c8a6d[_0x320c('0x2d')]['filter']+'%'};return _0x3afb1d;})});}_0x5bf607=_[_0x320c('0x37')]({},_0x5bf607,_0x4c8a6d[_0x320c('0x39')]);var _0x20c9e0={'where':_0x5bf607[_0x320c('0x36')]};return db['CmCompany'][_0x320c('0x1b')](_0x20c9e0)[_0x320c('0x22')](function(_0xaf3168){_0x3abd09[_0x320c('0x1b')]=_0xaf3168;if(_0x4c8a6d[_0x320c('0x2d')][_0x320c('0x3a')]){_0x5bf607['include']=[{'all':!![]}];}return db['CmCompany'][_0x320c('0x3b')](_0x5bf607);})[_0x320c('0x22')](function(_0x1815b5){_0x3abd09[_0x320c('0x3c')]=_0x1815b5;return _0x3abd09;})[_0x320c('0x22')](respondWithFilteredResult(_0x155d35,_0x5bf607))[_0x320c('0x3d')](handleError(_0x155d35,null));})[_0x320c('0x3d')](handleError(_0x155d35,null));};exports[_0x320c('0x3e')]=function(_0x5efc34,_0x592b8e){var _0x7aa1f9={'raw':![],'where':{'id':_0x5efc34[_0x320c('0x3f')]['id']}},_0x1af88b={};_0x1af88b[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmCompany'][_0x320c('0x40')]);_0x1af88b[_0x320c('0x2d')]=_['keys'](_0x5efc34[_0x320c('0x2d')]);_0x1af88b[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x1af88b['model'],_0x1af88b[_0x320c('0x2d')]);_0x7aa1f9[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x1af88b['model'],qs['fields'](_0x5efc34[_0x320c('0x2d')][_0x320c('0x31')]));_0x7aa1f9['attributes']=_0x7aa1f9[_0x320c('0x30')]['length']?_0x7aa1f9[_0x320c('0x30')]:_0x1af88b[_0x320c('0x2b')];if(_0x5efc34[_0x320c('0x2d')]['includeAll']){_0x7aa1f9[_0x320c('0x41')]=[{'all':!![]}];}_0x7aa1f9=_[_0x320c('0x37')]({},_0x7aa1f9,_0x5efc34[_0x320c('0x39')]);return db[_0x320c('0x42')][_0x320c('0x43')](_0x7aa1f9)[_0x320c('0x22')](handleEntityNotFound(_0x592b8e,null))[_0x320c('0x22')](respondWithResult(_0x592b8e,null))[_0x320c('0x3d')](handleError(_0x592b8e,null));};exports['create']=function(_0x1a4ac9,_0x5105e0){return db[_0x320c('0x42')][_0x320c('0x44')](_0x1a4ac9[_0x320c('0x45')],{})['then'](function(_0x367f68){var _0x1a2fc4=_0x1a4ac9[_0x320c('0x46')]['get']({'plain':!![]});if(!_0x1a2fc4)throw new Error(_0x320c('0x47'));if(_0x1a2fc4['role']===_0x320c('0x46')){var _0x32e47f=_0x367f68[_0x320c('0x48')]({'plain':!![]});var _0x1b0053=_0x320c('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x1b0053,'userProfileId':_0x1a2fc4[_0x320c('0x49')]},'raw':!![]})[_0x320c('0x22')](function(_0x2fe99d){if(_0x2fe99d&&_0x2fe99d[_0x320c('0x4a')]===0x0){return db[_0x320c('0x24')][_0x320c('0x44')]({'name':_0x32e47f[_0x320c('0x4b')],'resourceId':_0x32e47f['id'],'type':_0x2fe99d[_0x320c('0x4b')],'sectionId':_0x2fe99d['id']},{})[_0x320c('0x22')](function(){return _0x367f68;});}else{return _0x367f68;}})[_0x320c('0x3d')](function(_0x9c7b31){logger[_0x320c('0x27')](_0x320c('0x4c'),_0x9c7b31);throw _0x9c7b31;});}return _0x367f68;})[_0x320c('0x22')](respondWithResult(_0x5105e0,0xc9))['catch'](handleError(_0x5105e0,null));};exports[_0x320c('0x21')]=function(_0x549c74,_0x43225f){if(_0x549c74[_0x320c('0x45')]['id']){delete _0x549c74['body']['id'];}return db[_0x320c('0x42')][_0x320c('0x43')]({'where':{'id':_0x549c74[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x43225f,null))['then'](saveUpdates(_0x549c74[_0x320c('0x45')],null))[_0x320c('0x22')](respondWithResult(_0x43225f,null))[_0x320c('0x3d')](handleError(_0x43225f,null));};exports[_0x320c('0x25')]=function(_0x51b331,_0x533d3a){return db['CmCompany'][_0x320c('0x43')]({'where':{'id':_0x51b331[_0x320c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x533d3a,null))[_0x320c('0x22')](removeEntity(_0x533d3a,null))[_0x320c('0x3d')](handleError(_0x533d3a,null));};exports[_0x320c('0x4d')]=function(_0x266d76,_0x33af2b){return db[_0x320c('0x42')]['describe']()[_0x320c('0x22')](respondWithResult(_0x33af2b,null))[_0x320c('0x3d')](handleError(_0x33af2b,null));};exports[_0x320c('0x4e')]=function(_0x2177cb,_0x45d8ee,_0x115bb2){return db[_0x320c('0x4f')][_0x320c('0x43')]({'where':{'id':_0x2177cb[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x45d8ee,null))['then'](function(_0x598cb2){if(_0x598cb2){return _0x598cb2['addContacts'](_0x2177cb[_0x320c('0x45')][_0x320c('0x50')],_[_0x320c('0x51')](_0x2177cb[_0x320c('0x45')],[_0x320c('0x50'),'id'])||{});}})['then'](respondWithResult(_0x45d8ee,null))['catch'](handleError(_0x45d8ee,null));};exports[_0x320c('0x52')]=function(_0x3fbe02,_0x122af7,_0x455969){var _0x485194={};var _0x3c7c51={};var _0x12d3e9;var _0x34c50f;return db[_0x320c('0x42')][_0x320c('0x53')]({'where':{'id':_0x3fbe02[_0x320c('0x3f')]['id']}})[_0x320c('0x22')](handleEntityNotFound(_0x122af7,null))[_0x320c('0x22')](function(_0x21367b){if(_0x21367b){_0x12d3e9=_0x21367b;_0x3c7c51[_0x320c('0x2b')]=_[_0x320c('0x2c')](db['CmContact'][_0x320c('0x40')]);_0x3c7c51[_0x320c('0x2d')]=_['keys'](_0x3fbe02[_0x320c('0x2d')]);_0x3c7c51[_0x320c('0x2e')]=_[_0x320c('0x2f')](_0x3c7c51[_0x320c('0x2b')],_0x3c7c51[_0x320c('0x2d')]);_0x485194[_0x320c('0x30')]=_[_0x320c('0x2f')](_0x3c7c51['model'],qs[_0x320c('0x31')](_0x3fbe02['query'][_0x320c('0x31')]));_0x485194[_0x320c('0x30')]=_0x485194[_0x320c('0x30')][_0x320c('0x32')]?_0x485194['attributes']:_0x3c7c51[_0x320c('0x2b')];_0x485194[_0x320c('0x54')]=qs[_0x320c('0x55')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x55')]);_0x485194[_0x320c('0x36')]=qs[_0x320c('0x2e')](_[_0x320c('0x35')](_0x3fbe02[_0x320c('0x2d')],_0x3c7c51['filters']));if(_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]){_0x485194['where']=_[_0x320c('0x37')](_0x485194[_0x320c('0x36')],{'$or':_[_0x320c('0x38')](_0x485194[_0x320c('0x30')],function(_0x3eedce){var _0x570cbb={};_0x570cbb[_0x3eedce]={'$like':'%'+_0x3fbe02[_0x320c('0x2d')][_0x320c('0x56')]+'%'};return _0x570cbb;})});}_0x485194=_[_0x320c('0x37')]({},_0x485194,_0x3fbe02['options']);return _0x12d3e9['getContacts'](_0x485194);}})[_0x320c('0x22')](function(_0x53b04d){if(_0x53b04d){_0x34c50f=_0x53b04d[_0x320c('0x32')];if(!_0x3fbe02[_0x320c('0x2d')]['hasOwnProperty'](_0x320c('0x34'))){_0x485194['limit']=qs[_0x320c('0x1d')](_0x3fbe02[_0x320c('0x2d')][_0x320c('0x1d')]);_0x485194['offset']=qs[_0x320c('0x1c')](_0x3fbe02[_0x320c('0x2d')]['offset']);}return _0x12d3e9[_0x320c('0x52')](_0x485194);}})[_0x320c('0x22')](function(_0x46c3a8){if(_0x46c3a8){return _0x46c3a8?{'count':_0x34c50f,'rows':_0x46c3a8}:null;}})[_0x320c('0x22')](respondWithResult(_0x122af7,null))[_0x320c('0x3d')](handleError(_0x122af7,null));};
\ No newline at end of file
+var _0x214e=['name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','destroy','end','error','stack'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x214e,0x192));var _0xe214=function(_0x404424,_0x26187b){_0x404424=_0x404424-0x0;var _0x1ffeae=_0x214e[_0x404424];return _0x1ffeae;};'use strict';var emlformat=require(_0xe214('0x0'));var rimraf=require(_0xe214('0x1'));var zipdir=require(_0xe214('0x2'));var jsonpatch=require(_0xe214('0x3'));var rp=require(_0xe214('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe214('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe214('0x6'));var csv=require('to-csv');var ejs=require(_0xe214('0x7'));var fs=require('fs');var fs_extra=require(_0xe214('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe214('0x9'));var jsforce=require(_0xe214('0xa'));var deskjs=require(_0xe214('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe214('0xc'));var Papa=require(_0xe214('0xd'));var Redis=require(_0xe214('0xe'));var authService=require(_0xe214('0xf'));var qs=require(_0xe214('0x10'));var as=require(_0xe214('0x11'));var hardwareService=require(_0xe214('0x12'));var logger=require(_0xe214('0x13'))(_0xe214('0x14'));var utils=require('../../config/utils');var config=require(_0xe214('0x15'));var licenseUtil=require(_0xe214('0x16'));var db=require(_0xe214('0x17'))['db'];function respondWithStatusCode(_0x24e039,_0x40330a){_0x40330a=_0x40330a||0xcc;return function(_0x29e20){if(_0x29e20){return _0x24e039[_0xe214('0x18')](_0x40330a);}return _0x24e039[_0xe214('0x19')](_0x40330a)['end']();};}function respondWithResult(_0x38c961,_0x28081e){_0x28081e=_0x28081e||0xc8;return function(_0x7f94ab){if(_0x7f94ab){return _0x38c961[_0xe214('0x19')](_0x28081e)[_0xe214('0x1a')](_0x7f94ab);}};}function respondWithFilteredResult(_0x55f257,_0x5902e1){return function(_0x34c6f1){if(_0x34c6f1){var _0x34fcc1=typeof _0x5902e1[_0xe214('0x1b')]===_0xe214('0x1c')&&typeof _0x5902e1[_0xe214('0x1d')]==='undefined';var _0x2e9c49=_0x34c6f1[_0xe214('0x1e')];var _0x5e4197=_0x34fcc1?0x0:_0x5902e1[_0xe214('0x1b')];var _0x54491e=_0x34fcc1?_0x34c6f1[_0xe214('0x1e')]:_0x5902e1[_0xe214('0x1b')]+_0x5902e1[_0xe214('0x1d')];var _0xfe1ef4;if(_0x54491e>=_0x2e9c49){_0x54491e=_0x2e9c49;_0xfe1ef4=0xc8;}else{_0xfe1ef4=0xce;}_0x55f257[_0xe214('0x19')](_0xfe1ef4);return _0x55f257['set'](_0xe214('0x1f'),_0x5e4197+'-'+_0x54491e+'/'+_0x2e9c49)[_0xe214('0x1a')](_0x34c6f1);}return null;};}function patchUpdates(_0x21dd5d){return function(_0x47b5d9){try{jsonpatch[_0xe214('0x20')](_0x47b5d9,_0x21dd5d,!![]);}catch(_0x122a3a){return BPromise[_0xe214('0x21')](_0x122a3a);}return _0x47b5d9[_0xe214('0x22')]();};}function saveUpdates(_0x39787e,_0x364fc7){return function(_0x13c4f0){if(_0x13c4f0){return _0x13c4f0[_0xe214('0x23')](_0x39787e)['then'](function(_0x4a9ef0){return _0x4a9ef0;});}return null;};}function removeEntity(_0x3c7216,_0x50897f){return function(_0x29cc46){if(_0x29cc46){return _0x29cc46['destroy']()[_0xe214('0x24')](function(){var _0x331571=_0x29cc46['get']({'plain':!![]});var _0x416b68=_0xe214('0x25');return db[_0xe214('0x26')][_0xe214('0x27')]({'where':{'type':_0x416b68,'resourceId':_0x331571['id']}})[_0xe214('0x24')](function(){return _0x29cc46;});})[_0xe214('0x24')](function(){_0x3c7216[_0xe214('0x19')](0xcc)[_0xe214('0x28')]();});}};}function handleEntityNotFound(_0x370fd6,_0x47b7e5){return function(_0x1c54fd){if(!_0x1c54fd){_0x370fd6[_0xe214('0x18')](0x194);}return _0x1c54fd;};}function handleError(_0xe50d1e,_0xbcbe06){_0xbcbe06=_0xbcbe06||0x1f4;return function(_0x23753f){logger[_0xe214('0x29')](_0x23753f[_0xe214('0x2a')]);if(_0x23753f[_0xe214('0x2b')]){delete _0x23753f['name'];}_0xe50d1e[_0xe214('0x19')](_0xbcbe06)[_0xe214('0x2c')](_0x23753f);};}exports[_0xe214('0x2d')]=function(_0x4860e9,_0x5f5976){var _0x496506={},_0x5bbb14={},_0x24cfac={'count':0x0,'rows':[]};return db['CmCompany'][_0xe214('0x2e')]()[_0xe214('0x24')](function(_0x3ee84f){_0x5bbb14[_0xe214('0x2f')]=_[_0xe214('0x30')](_0x3ee84f);_0x5bbb14['query']=_['keys'](_0x4860e9[_0xe214('0x31')]);_0x5bbb14[_0xe214('0x32')]=_[_0xe214('0x33')](_0x5bbb14['model'],_0x5bbb14[_0xe214('0x31')]);_0x496506[_0xe214('0x34')]=_['intersection'](_0x5bbb14[_0xe214('0x2f')],qs[_0xe214('0x35')](_0x4860e9['query']['fields']));_0x496506[_0xe214('0x34')]=_0x496506[_0xe214('0x34')][_0xe214('0x36')]?_0x496506[_0xe214('0x34')]:_0x5bbb14[_0xe214('0x2f')];if(!_0x4860e9[_0xe214('0x31')][_0xe214('0x37')](_0xe214('0x38'))){_0x496506[_0xe214('0x1d')]=qs[_0xe214('0x1d')](_0x4860e9[_0xe214('0x31')]['limit']);_0x496506[_0xe214('0x1b')]=qs[_0xe214('0x1b')](_0x4860e9[_0xe214('0x31')][_0xe214('0x1b')]);}_0x496506[_0xe214('0x39')]=qs[_0xe214('0x3a')](_0x4860e9[_0xe214('0x31')][_0xe214('0x3a')]);_0x496506[_0xe214('0x3b')]=qs[_0xe214('0x32')](_[_0xe214('0x3c')](_0x4860e9[_0xe214('0x31')],_0x5bbb14['filters']),_0x3ee84f);if(_0x4860e9[_0xe214('0x31')][_0xe214('0x3d')]){_0x496506[_0xe214('0x3b')]=_[_0xe214('0x3e')](_0x496506['where'],{'$or':_[_0xe214('0x3f')](_0x496506['attributes'],function(_0x4ea27d){var _0x498350={};_0x498350[_0x4ea27d]={'$like':'%'+_0x4860e9[_0xe214('0x31')]['filter']+'%'};return _0x498350;})});}_0x496506=_[_0xe214('0x3e')]({},_0x496506,_0x4860e9[_0xe214('0x40')]);var _0x552a83={'where':_0x496506[_0xe214('0x3b')]};return db[_0xe214('0x41')][_0xe214('0x1e')](_0x552a83)['then'](function(_0x502114){_0x24cfac[_0xe214('0x1e')]=_0x502114;if(_0x4860e9[_0xe214('0x31')][_0xe214('0x42')]){_0x496506['include']=[{'all':!![]}];}return db[_0xe214('0x41')][_0xe214('0x43')](_0x496506);})[_0xe214('0x24')](function(_0x4642d3){_0x24cfac[_0xe214('0x44')]=_0x4642d3;return _0x24cfac;})['then'](respondWithFilteredResult(_0x5f5976,_0x496506))[_0xe214('0x45')](handleError(_0x5f5976,null));})[_0xe214('0x45')](handleError(_0x5f5976,null));};exports[_0xe214('0x46')]=function(_0x383bc0,_0x2deb28){var _0x4f49c9={'raw':![],'where':{'id':_0x383bc0[_0xe214('0x47')]['id']}},_0x151ea2={};_0x151ea2[_0xe214('0x2f')]=_[_0xe214('0x30')](db[_0xe214('0x41')][_0xe214('0x48')]);_0x151ea2[_0xe214('0x31')]=_[_0xe214('0x30')](_0x383bc0['query']);_0x151ea2[_0xe214('0x32')]=_['intersection'](_0x151ea2['model'],_0x151ea2['query']);_0x4f49c9[_0xe214('0x34')]=_[_0xe214('0x33')](_0x151ea2['model'],qs['fields'](_0x383bc0[_0xe214('0x31')][_0xe214('0x35')]));_0x4f49c9['attributes']=_0x4f49c9[_0xe214('0x34')]['length']?_0x4f49c9[_0xe214('0x34')]:_0x151ea2[_0xe214('0x2f')];if(_0x383bc0[_0xe214('0x31')][_0xe214('0x42')]){_0x4f49c9[_0xe214('0x49')]=[{'all':!![]}];}_0x4f49c9=_[_0xe214('0x3e')]({},_0x4f49c9,_0x383bc0['options']);return db[_0xe214('0x41')]['find'](_0x4f49c9)[_0xe214('0x24')](handleEntityNotFound(_0x2deb28,null))[_0xe214('0x24')](respondWithResult(_0x2deb28,null))[_0xe214('0x45')](handleError(_0x2deb28,null));};exports[_0xe214('0x4a')]=function(_0x2b1f0d,_0x50f268){return db[_0xe214('0x41')][_0xe214('0x4a')](_0x2b1f0d[_0xe214('0x4b')],{})[_0xe214('0x24')](function(_0x454503){var _0x4edaf5=_0x2b1f0d['user']['get']({'plain':!![]});if(!_0x4edaf5)throw new Error(_0xe214('0x4c'));if(_0x4edaf5[_0xe214('0x4d')]===_0xe214('0x4e')){var _0x21cb1b=_0x454503[_0xe214('0x4f')]({'plain':!![]});var _0x2e2b6c=_0xe214('0x25');return db['UserProfileSection'][_0xe214('0x50')]({'where':{'name':_0x2e2b6c,'userProfileId':_0x4edaf5[_0xe214('0x51')]},'raw':!![]})['then'](function(_0x5457ad){if(_0x5457ad&&_0x5457ad[_0xe214('0x52')]===0x0){return db[_0xe214('0x26')][_0xe214('0x4a')]({'name':_0x21cb1b[_0xe214('0x2b')],'resourceId':_0x21cb1b['id'],'type':_0x5457ad[_0xe214('0x2b')],'sectionId':_0x5457ad['id']},{})['then'](function(){return _0x454503;});}else{return _0x454503;}})[_0xe214('0x45')](function(_0x512cc2){logger[_0xe214('0x29')](_0xe214('0x53'),_0x512cc2);throw _0x512cc2;});}return _0x454503;})[_0xe214('0x24')](respondWithResult(_0x50f268,0xc9))[_0xe214('0x45')](handleError(_0x50f268,null));};exports[_0xe214('0x23')]=function(_0x1d426a,_0x415d9e){if(_0x1d426a[_0xe214('0x4b')]['id']){delete _0x1d426a['body']['id'];}return db['CmCompany']['find']({'where':{'id':_0x1d426a[_0xe214('0x47')]['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x415d9e,null))[_0xe214('0x24')](saveUpdates(_0x1d426a[_0xe214('0x4b')],null))[_0xe214('0x24')](respondWithResult(_0x415d9e,null))[_0xe214('0x45')](handleError(_0x415d9e,null));};exports[_0xe214('0x27')]=function(_0x48fa86,_0x2b79fd){return db[_0xe214('0x41')]['find']({'where':{'id':_0x48fa86[_0xe214('0x47')]['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x2b79fd,null))['then'](removeEntity(_0x2b79fd,null))[_0xe214('0x45')](handleError(_0x2b79fd,null));};exports['describe']=function(_0x1d494d,_0x3a5a2d){return db[_0xe214('0x41')][_0xe214('0x2e')]()[_0xe214('0x24')](respondWithResult(_0x3a5a2d,null))[_0xe214('0x45')](handleError(_0x3a5a2d,null));};exports[_0xe214('0x54')]=function(_0x1f2774,_0x424c6c,_0x33cc5b){return db['CmContact'][_0xe214('0x50')]({'where':{'id':_0x1f2774['params']['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x424c6c,null))['then'](function(_0x1bd583){if(_0x1bd583){return _0x1bd583[_0xe214('0x54')](_0x1f2774[_0xe214('0x4b')][_0xe214('0x55')],_[_0xe214('0x56')](_0x1f2774['body'],[_0xe214('0x55'),'id'])||{});}})[_0xe214('0x24')](respondWithResult(_0x424c6c,null))[_0xe214('0x45')](handleError(_0x424c6c,null));};exports[_0xe214('0x57')]=function(_0x21f40a,_0x14267d,_0x41a182){var _0x4af628={};var _0x477d84={};var _0x3acac5;var _0x2a7ceb;return db[_0xe214('0x41')]['findOne']({'where':{'id':_0x21f40a[_0xe214('0x47')]['id']}})[_0xe214('0x24')](handleEntityNotFound(_0x14267d,null))[_0xe214('0x24')](function(_0x46fb32){if(_0x46fb32){_0x3acac5=_0x46fb32;_0x477d84[_0xe214('0x2f')]=_[_0xe214('0x30')](db[_0xe214('0x58')][_0xe214('0x48')]);_0x477d84[_0xe214('0x31')]=_[_0xe214('0x30')](_0x21f40a[_0xe214('0x31')]);_0x477d84[_0xe214('0x32')]=_[_0xe214('0x33')](_0x477d84[_0xe214('0x2f')],_0x477d84['query']);_0x4af628['attributes']=_[_0xe214('0x33')](_0x477d84[_0xe214('0x2f')],qs[_0xe214('0x35')](_0x21f40a[_0xe214('0x31')][_0xe214('0x35')]));_0x4af628[_0xe214('0x34')]=_0x4af628['attributes'][_0xe214('0x36')]?_0x4af628[_0xe214('0x34')]:_0x477d84[_0xe214('0x2f')];_0x4af628[_0xe214('0x39')]=qs[_0xe214('0x3a')](_0x21f40a[_0xe214('0x31')][_0xe214('0x3a')]);_0x4af628[_0xe214('0x3b')]=qs[_0xe214('0x32')](_[_0xe214('0x3c')](_0x21f40a[_0xe214('0x31')],_0x477d84['filters']));if(_0x21f40a[_0xe214('0x31')][_0xe214('0x3d')]){_0x4af628[_0xe214('0x3b')]=_[_0xe214('0x3e')](_0x4af628[_0xe214('0x3b')],{'$or':_[_0xe214('0x3f')](_0x4af628[_0xe214('0x34')],function(_0x39da08){var _0x163436={};_0x163436[_0x39da08]={'$like':'%'+_0x21f40a[_0xe214('0x31')][_0xe214('0x3d')]+'%'};return _0x163436;})});}_0x4af628=_[_0xe214('0x3e')]({},_0x4af628,_0x21f40a['options']);return _0x3acac5[_0xe214('0x57')](_0x4af628);}})[_0xe214('0x24')](function(_0x509f74){if(_0x509f74){_0x2a7ceb=_0x509f74[_0xe214('0x36')];if(!_0x21f40a[_0xe214('0x31')][_0xe214('0x37')]('nolimit')){_0x4af628['limit']=qs[_0xe214('0x1d')](_0x21f40a[_0xe214('0x31')]['limit']);_0x4af628[_0xe214('0x1b')]=qs[_0xe214('0x1b')](_0x21f40a[_0xe214('0x31')][_0xe214('0x1b')]);}return _0x3acac5[_0xe214('0x57')](_0x4af628);}})[_0xe214('0x24')](function(_0x1c61cb){if(_0x1c61cb){return _0x1c61cb?{'count':_0x2a7ceb,'rows':_0x1c61cb}:null;}})[_0xe214('0x24')](respondWithResult(_0x14267d,null))[_0xe214('0x45')](handleError(_0x14267d,null));};
\ No newline at end of file
index 5eb8823..7e62f9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5872=['request-promise','path','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment'];(function(_0x17f461,_0x4ecbdd){var _0x37ec91=function(_0x161819){while(--_0x161819){_0x17f461['push'](_0x17f461['shift']());}};_0x37ec91(++_0x4ecbdd);}(_0x5872,0x1be));var _0x2587=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x5872[_0x46800d];return _0x3824cd;};'use strict';var _=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var logger=require(_0x2587('0x2'))(_0x2587('0x3'));var moment=require(_0x2587('0x4'));var BPromise=require('bluebird');var rp=require(_0x2587('0x5'));var fs=require('fs');var path=require(_0x2587('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2587('0x7'));module[_0x2587('0x8')]=function(_0x53d2de,_0x530b8c){return _0x53d2de['define'](_0x2587('0x9'),attributes,{'tableName':_0x2587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66f2=['../../config/logger','moment','bluebird','../../config/environment','./cmCompany.attributes','CmCompany','lodash','util'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x66f2,0x1b6));var _0x266f=function(_0x5df61d,_0x158640){_0x5df61d=_0x5df61d-0x0;var _0x24cc4c=_0x66f2[_0x5df61d];return _0x24cc4c;};'use strict';var _=require(_0x266f('0x0'));var util=require(_0x266f('0x1'));var logger=require(_0x266f('0x2'))('api');var moment=require(_0x266f('0x3'));var BPromise=require(_0x266f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x266f('0x5'));var attributes=require(_0x266f('0x6'));module['exports']=function(_0x395334,_0x43eb5a){return _0x395334['define'](_0x266f('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30b01c3..5cc24d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6a5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2ca72,_0x396df6){var _0x14dbc2=function(_0x5e68b3){while(--_0x5e68b3){_0x2ca72['push'](_0x2ca72['shift']());}};_0x14dbc2(++_0x396df6);}(_0xa6a5,0xd1));var _0x5a6a=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa6a5[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x5a6a('0x0'));var moment=require(_0x5a6a('0x1'));var BPromise=require(_0x5a6a('0x2'));var rs=require(_0x5a6a('0x3'));var fs=require('fs');var Redis=require(_0x5a6a('0x4'));var db=require(_0x5a6a('0x5'))['db'];var utils=require(_0x5a6a('0x6'));var logger=require(_0x5a6a('0x7'))(_0x5a6a('0x8'));var config=require(_0x5a6a('0x9'));var jayson=require(_0x5a6a('0xa'));var client=jayson[_0x5a6a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a87f2,_0x14fa40,_0x535d97){return new BPromise(function(_0x25d9a3,_0x57e0f9){return client[_0x5a6a('0xc')](_0x3a87f2,_0x535d97)[_0x5a6a('0xd')](function(_0x57b902){logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));logger[_0x5a6a('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x14fa40,_0x5a6a('0x10'),JSON[_0x5a6a('0x12')](_0x57b902));if(_0x57b902[_0x5a6a('0x13')]){if(_0x57b902['error'][_0x5a6a('0x14')]===0x1f4){logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')]['message']);return _0x57e0f9(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}logger[_0x5a6a('0x13')](_0x5a6a('0xf'),_0x14fa40,_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);return _0x25d9a3(_0x57b902[_0x5a6a('0x13')][_0x5a6a('0x15')]);}else{logger[_0x5a6a('0xe')](_0x5a6a('0xf'),_0x14fa40,_0x5a6a('0x10'));_0x25d9a3(_0x57b902[_0x5a6a('0x16')][_0x5a6a('0x15')]);}})[_0x5a6a('0x17')](function(_0x1754cb){logger[_0x5a6a('0x13')]('CmCompany,\x20%s,\x20%s',_0x14fa40,_0x1754cb);_0x57e0f9(_0x1754cb);});});}
\ No newline at end of file
+var _0xb516=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xb516,0x6d));var _0x6b51=function(_0x35397a,_0xbd3d74){_0x35397a=_0x35397a-0x0;var _0x1bbc66=_0xb516[_0x35397a];return _0x1bbc66;};'use strict';var _=require(_0x6b51('0x0'));var util=require(_0x6b51('0x1'));var moment=require(_0x6b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b51('0x3'));var fs=require('fs');var Redis=require(_0x6b51('0x4'));var db=require(_0x6b51('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b51('0x6'))(_0x6b51('0x7'));var config=require(_0x6b51('0x8'));var jayson=require(_0x6b51('0x9'));var client=jayson[_0x6b51('0xa')][_0x6b51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a80f8,_0x1f72fe,_0x5b13ae){return new BPromise(function(_0x32378c,_0x416501){return client['request'](_0x5a80f8,_0x5b13ae)[_0x6b51('0xc')](function(_0xa67e5f){logger[_0x6b51('0xd')]('CmCompany,\x20%s,\x20%s',_0x1f72fe,_0x6b51('0xe'));logger[_0x6b51('0xf')](_0x6b51('0x10'),_0x1f72fe,_0x6b51('0xe'),JSON[_0x6b51('0x11')](_0xa67e5f));if(_0xa67e5f[_0x6b51('0x12')]){if(_0xa67e5f[_0x6b51('0x12')]['code']===0x1f4){logger['error'](_0x6b51('0x13'),_0x1f72fe,_0xa67e5f[_0x6b51('0x12')]['message']);return _0x416501(_0xa67e5f['error'][_0x6b51('0x14')]);}logger['error'](_0x6b51('0x13'),_0x1f72fe,_0xa67e5f['error'][_0x6b51('0x14')]);return _0x32378c(_0xa67e5f[_0x6b51('0x12')]['message']);}else{logger[_0x6b51('0xd')]('CmCompany,\x20%s,\x20%s',_0x1f72fe,_0x6b51('0xe'));_0x32378c(_0xa67e5f[_0x6b51('0x15')][_0x6b51('0x14')]);}})[_0x6b51('0x16')](function(_0x1630cd){logger[_0x6b51('0x12')](_0x6b51('0x13'),_0x1f72fe,_0x1630cd);_0x416501(_0x1630cd);});});}
\ No newline at end of file
index 953d1b4..bfed52d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa775=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/:id','show','/:id/contacts','post','addContacts','put','update','destroy','exports','multer'];(function(_0x4dd063,_0x386d0c){var _0x2b8747=function(_0x282e72){while(--_0x282e72){_0x4dd063['push'](_0x4dd063['shift']());}};_0x2b8747(++_0x386d0c);}(_0xa775,0xf6));var _0x5a77=function(_0x55a233,_0x524fb7){_0x55a233=_0x55a233-0x0;var _0x39ae55=_0xa775[_0x55a233];return _0x39ae55;};'use strict';var multer=require(_0x5a77('0x0'));var util=require('util');var path=require(_0x5a77('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5a77('0x2')]();var fs_extra=require(_0x5a77('0x3'));var auth=require(_0x5a77('0x4'));var interaction=require(_0x5a77('0x5'));var config=require('../../config/environment');var controller=require(_0x5a77('0x6'));router[_0x5a77('0x7')]('/',auth[_0x5a77('0x8')](),controller[_0x5a77('0x9')]);router[_0x5a77('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0xb')]);router[_0x5a77('0x7')](_0x5a77('0xc'),auth[_0x5a77('0x8')](),controller['getContacts']);router[_0x5a77('0xd')]('/',auth[_0x5a77('0x8')](),controller['create']);router[_0x5a77('0xd')]('/:id/contacts',auth[_0x5a77('0x8')](),controller[_0x5a77('0xe')]);router[_0x5a77('0xf')](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x10')]);router['delete'](_0x5a77('0xa'),auth[_0x5a77('0x8')](),controller[_0x5a77('0x11')]);module[_0x5a77('0x12')]=router;
\ No newline at end of file
+var _0x6b50=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x6b50,0x1cc));var _0x06b5=function(_0x4f7829,_0x480bd2){_0x4f7829=_0x4f7829-0x0;var _0x23c9ee=_0x6b50[_0x4f7829];return _0x23c9ee;};'use strict';var multer=require(_0x06b5('0x0'));var util=require('util');var path=require(_0x06b5('0x1'));var timeout=require(_0x06b5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x06b5('0x3'));var auth=require(_0x06b5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x06b5('0x5'));var controller=require('./cmCompany.controller');router[_0x06b5('0x6')]('/',auth[_0x06b5('0x7')](),controller['index']);router[_0x06b5('0x6')]('/describe',auth[_0x06b5('0x7')](),controller[_0x06b5('0x8')]);router['get'](_0x06b5('0x9'),auth[_0x06b5('0x7')](),controller[_0x06b5('0xa')]);router[_0x06b5('0x6')](_0x06b5('0xb'),auth['isAuthenticated'](),controller[_0x06b5('0xc')]);router[_0x06b5('0xd')]('/',auth[_0x06b5('0x7')](),controller[_0x06b5('0xe')]);router[_0x06b5('0xd')](_0x06b5('0xb'),auth['isAuthenticated'](),controller[_0x06b5('0xf')]);router[_0x06b5('0x10')]('/:id',auth[_0x06b5('0x7')](),controller[_0x06b5('0x11')]);router['delete']('/:id',auth[_0x06b5('0x7')](),controller[_0x06b5('0x12')]);module[_0x06b5('0x13')]=router;
\ No newline at end of file
index 78d669d..41aee37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfec9=['TEXT','INTEGER','UNSIGNED','NOW','lodash','exports','STRING'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xfec9,0x146));var _0x9fec=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0xfec9[_0x4dcb47];return _0x352b40;};'use strict';var _=require(_0x9fec('0x0'));var Sequelize=require('sequelize');module[_0x9fec('0x1')]={'firstName':{'type':Sequelize[_0x9fec('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9fec('0x2')]},'street':{'type':Sequelize[_0x9fec('0x2')]},'postalCode':{'type':Sequelize[_0x9fec('0x2')]},'city':{'type':Sequelize[_0x9fec('0x2')]},'country':{'type':Sequelize[_0x9fec('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9fec('0x2')]},'description':{'type':Sequelize[_0x9fec('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x9fec('0x2')]},'fax':{'type':Sequelize[_0x9fec('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x9fec('0x2')]},'facebook':{'type':Sequelize[_0x9fec('0x2')]},'fb_data':{'type':Sequelize[_0x9fec('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x9fec('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x9fec('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x9fec('0x2')]},'telegram':{'type':Sequelize[_0x9fec('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x9fec('0x4')](0x2)[_0x9fec('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9fec('0x6')]}};
\ No newline at end of file
+var _0x8531=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0xb2d80f,_0x4a3fb9){var _0x77c94d=function(_0x2fcc21){while(--_0x2fcc21){_0xb2d80f['push'](_0xb2d80f['shift']());}};_0x77c94d(++_0x4a3fb9);}(_0x8531,0x11a));var _0x1853=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x8531[_0x1809c5];return _0x5254a4;};'use strict';var _=require(_0x1853('0x0'));var Sequelize=require(_0x1853('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x1853('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1853('0x2')]},'street':{'type':Sequelize[_0x1853('0x2')]},'postalCode':{'type':Sequelize[_0x1853('0x2')]},'city':{'type':Sequelize[_0x1853('0x2')]},'country':{'type':Sequelize[_0x1853('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1853('0x2')]},'description':{'type':Sequelize[_0x1853('0x3')]},'phone':{'type':Sequelize[_0x1853('0x2')]},'mobile':{'type':Sequelize[_0x1853('0x2')]},'fax':{'type':Sequelize[_0x1853('0x2')]},'email':{'type':Sequelize[_0x1853('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x1853('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1853('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x1853('0x2')]},'line':{'type':Sequelize[_0x1853('0x2')]},'wechat':{'type':Sequelize[_0x1853('0x2')]},'telegram':{'type':Sequelize[_0x1853('0x2')]},'UserId':{'type':Sequelize[_0x1853('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x1853('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1853('0x6')],'defaultValue':Sequelize[_0x1853('0x7')]}};
\ No newline at end of file
index 6f09f31..9a70b38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd46e=['c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','keyBy','merge','c.id','c.firstName','c.lastName','c.phone','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','sequelize','Tags','rows','catch','find','params','tags','columnName','analytics','displayName','custom','values','body','findAll','get','mergeWith','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','update','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','SmsQueueReport','WhatsappMessage','bulkCreate','duplicates','spread','show','Tag','$and','omit','format','cf_%d','setFields','id\x20=\x20?','toParam','phone','getTags','findOne','rawAttributes','options','setTags','ids','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','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!','pid','upload','parse','file','meta','import','User','binding','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','fullname','alias','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','subject','substatus','all','flatten','sortBy','reverse','slice','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','localhost','./cmContact.socket','register','status','offset','undefined','count','limit','set','json','then','destroy','end','sendStatus','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','value','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','dateOfBirth','datetime','buildExpression','text','filter','isNil','Contact','isEmpty','forEach','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','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.mobile\x20LIKE\x20?','isEmail'];(function(_0x8b7b93,_0x5a9dac){var _0x4d9eb1=function(_0x4198f2){while(--_0x4198f2){_0x8b7b93['push'](_0x8b7b93['shift']());}};_0x4d9eb1(++_0x5a9dac);}(_0xd46e,0x1bf));var _0xed46=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd46e[_0x50a0c2];return _0x5ebadd;};'use strict';var moment=require('moment');var BPromise=require(_0xed46('0x0'));var util=require(_0xed46('0x1'));var path=require(_0xed46('0x2'));var fs=require('fs');var _=require(_0xed46('0x3'));var squel=require(_0xed46('0x4'));var Papa=require(_0xed46('0x5'));var Redis=require(_0xed46('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0xed46('0x7'));var logger=require(_0xed46('0x8'))('api');var config=require(_0xed46('0x9'));var db=require('../../mysqldb')['db'];config[_0xed46('0xa')]=_[_0xed46('0xb')](config[_0xed46('0xa')],{'host':_0xed46('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed46('0xa')]));require(_0xed46('0xd'))[_0xed46('0xe')](socket);function respondWithResult(_0x325f55,_0x266053){_0x266053=_0x266053||0xc8;return function(_0x1e51fd){if(_0x1e51fd){return _0x325f55[_0xed46('0xf')](_0x266053)['json'](_0x1e51fd);}};}function respondWithFilteredResult(_0x285301,_0x43e143){return function(_0x21a8d5){if(_0x21a8d5){var _0x385abd=typeof _0x43e143[_0xed46('0x10')]===_0xed46('0x11')&&typeof _0x43e143['limit']===_0xed46('0x11');var _0x280542=_0x21a8d5[_0xed46('0x12')];var _0x384f3e=_0x385abd?0x0:_0x43e143[_0xed46('0x10')];var _0x59a1aa=_0x385abd?_0x21a8d5[_0xed46('0x12')]:_0x43e143[_0xed46('0x10')]+_0x43e143[_0xed46('0x13')];var _0x3f6b6b;if(_0x59a1aa>=_0x280542){_0x59a1aa=_0x280542;_0x3f6b6b=0xc8;}else{_0x3f6b6b=0xce;}_0x285301[_0xed46('0xf')](_0x3f6b6b);return _0x285301[_0xed46('0x14')]('Content-Range',_0x384f3e+'-'+_0x59a1aa+'/'+_0x280542)[_0xed46('0x15')](_0x21a8d5);}return null;};}function saveUpdates(_0x12cb8a){return function(_0x5a7578){if(_0x5a7578){return _0x5a7578['update'](_0x12cb8a)[_0xed46('0x16')](function(_0x1cedde){return _0x1cedde;});}return null;};}function removeEntity(_0x2908c3){return function(_0x1de4e0){if(_0x1de4e0){return _0x1de4e0[_0xed46('0x17')]()[_0xed46('0x16')](function(){_0x2908c3['status'](0xcc)[_0xed46('0x18')]();});}};}function handleEntityNotFound(_0x3e1dfa){return function(_0x521846){if(!_0x521846){_0x3e1dfa[_0xed46('0x19')](0x194);}return _0x521846;};}function handleError(_0x2a2a1b,_0x5ad15e){_0x5ad15e=_0x5ad15e||0x1f4;return function(_0x158100){logger['error'](_0x158100['stack']);if(_0x158100['name']){delete _0x158100[_0xed46('0x1a')];}_0x2a2a1b[_0xed46('0xf')](_0x5ad15e)[_0xed46('0x1b')](_0x158100);};}exports[_0xed46('0x1c')]=function(_0x2126e0,_0x550785){var _0x8789c0={},_0xe25b6b={},_0x3984d3={'count':0x0,'rows':[]};return db[_0xed46('0x1d')][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x39ef32){var _0x479616=[];for(var _0x4316e6=0x0;_0x4316e6<Object[_0xed46('0x1f')](_0x39ef32)[_0xed46('0x20')];_0x4316e6++){var _0x1b8d5b=Object[_0xed46('0x1f')](_0x39ef32)[_0x4316e6];if(_[_0xed46('0x21')](_0x1b8d5b,_0xed46('0x22'))){_0x479616[_0xed46('0x23')](db[_0xed46('0x24')]['findOne']({'where':{'id':_['trimStart'](_0x1b8d5b,_0xed46('0x22'))},'raw':!![]}));}}return BPromise['all'](_0x479616)[_0xed46('0x16')](function(_0x2da9c6){for(var _0x13aac4=0x0;_0x13aac4<_0x2da9c6[_0xed46('0x20')];_0x13aac4++){if(_0x2da9c6[_0x13aac4]){var _0x390f37=_0xed46('0x22')+_0x2da9c6[_0x13aac4]['id'];var _0xb3ffa4=_0x39ef32[_0x390f37];_0xb3ffa4[_0xed46('0x25')]=_0x2da9c6[_0x13aac4][_0xed46('0x26')];}}return _0x39ef32;});})[_0xed46('0x16')](function(_0x2b96cd){_0xe25b6b[_0xed46('0x27')]=_['keys'](_0x2b96cd);_0xe25b6b[_0xed46('0x28')]=_[_0xed46('0x1f')](_0x2126e0[_0xed46('0x28')]);_0xe25b6b[_0xed46('0x29')]=_[_0xed46('0x2a')](_0xe25b6b[_0xed46('0x27')],_0xe25b6b[_0xed46('0x28')]);_0x8789c0[_0xed46('0x2b')]=_[_0xed46('0x2a')](_0xe25b6b[_0xed46('0x27')],qs['fields'](_0x2126e0[_0xed46('0x28')][_0xed46('0x2c')]));_0x8789c0['attributes']=_0x8789c0['attributes'][_0xed46('0x20')]?_0x8789c0[_0xed46('0x2b')]:_0xe25b6b[_0xed46('0x27')];if(!_0x2126e0['query'][_0xed46('0x2d')](_0xed46('0x2e'))){_0x8789c0[_0xed46('0x13')]=qs[_0xed46('0x13')](_0x2126e0['query'][_0xed46('0x13')]);_0x8789c0[_0xed46('0x10')]=qs[_0xed46('0x10')](_0x2126e0['query'][_0xed46('0x10')]);}_0x8789c0['order']=qs[_0xed46('0x2f')](_0x2126e0[_0xed46('0x28')][_0xed46('0x2f')]);_0x8789c0[_0xed46('0x30')]=qs[_0xed46('0x29')](_[_0xed46('0x31')](_0x2126e0[_0xed46('0x28')],_0xe25b6b['filters']),_0x2b96cd);var _0x3a7d58=[];var _0xc8972c=squel[_0xed46('0x32')]()[_0xed46('0x33')]('id')[_0xed46('0x33')]('name')[_0xed46('0x33')](_0xed46('0x34'))[_0xed46('0x35')](_0xed46('0x36'));var _0x2c6933=squel[_0xed46('0x32')]()[_0xed46('0x35')](_0xed46('0x37'),'c')[_0xed46('0x38')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20c.id')[_0xed46('0x38')]('cm_contact_has_tags','ct',_0xed46('0x39'))[_0xed46('0x38')](_0xed46('0x36'),'t',_0xed46('0x3a'))[_0xed46('0x30')](_0xed46('0x3b'));var _0x1d843c=squel[_0xed46('0x3c')]();var _0xcba9b8=[];var _0x771a9d=squel[_0xed46('0x3c')]();var _0x3c0d6f;if(_0x2126e0[_0xed46('0x28')][_0xed46('0x3d')]){_0x3c0d6f=as['parseSearch'](_0x2126e0['query'][_0xed46('0x3d')]);var _0x17f801=_0x3c0d6f[_0xed46('0x3e')];for(var _0x2b8931=0x0;_0x2b8931<_0x3c0d6f[_0xed46('0x3f')]['length'];_0x2b8931++){var _0x1df7c2=_0x3c0d6f[_0xed46('0x3f')][_0x2b8931];var _0x23b14f='c';var _0x2e606a=_(_0x2b96cd)['keys']()['find'](function(_0x1a418c){return _0x1a418c===_0x1df7c2[_0xed46('0x33')];});if(_0x2e606a)_0x2e606a=_0x2b96cd[_0x1df7c2[_0xed46('0x33')]];if(!_0x2e606a){if(_0x1df7c2[_0xed46('0x33')]==='Tag'){var _0x354a7e=_0x1df7c2[_0xed46('0x40')][_0xed46('0x41')](',')[_0xed46('0x42')](function(_0x411002){return Number(_0x411002);});_0x354a7e['forEach'](function(_0x1b8ac8){_0x771a9d['or'](_0xed46('0x43'),'%,'+_0x1b8ac8+',%');});_0xcba9b8=_['union'](_0xcba9b8,_0x354a7e);}else if(_0x1df7c2[_0xed46('0x33')]==='User'){_0x1d843c['and']('uc.UserId\x20=\x20?',_0x1df7c2[_0xed46('0x40')]);}}else{if(_0x1df7c2[_0xed46('0x33')]===_0xed46('0x44')||_0x2e606a['fieldType']===_0xed46('0x45'))_0x1df7c2['castTo']='DATE';var _0x401b1d=as[_0xed46('0x46')](_0x23b14f,_0x2e606a[_0xed46('0x26')],_0x1df7c2);_0x1d843c[_0x17f801](_0x401b1d[_0xed46('0x47')],_0x401b1d[_0xed46('0x40')]['start'],_0x401b1d[_0xed46('0x40')][_0xed46('0x18')]);}}}else{var _0x5f54ec=_(Object[_0xed46('0x1f')](_0x2126e0['query']))['map'](function(_0x204ac3){return _0x2b96cd['hasOwnProperty'](_0x204ac3)?_0x204ac3:undefined;})[_0xed46('0x48')](function(_0x5e93a4){return!_[_0xed46('0x49')](_0x5e93a4);})['value']();if(_0x2126e0[_0xed46('0x28')][_0xed46('0x4a')])_0x5f54ec[_0xed46('0x23')](_0xed46('0x4a'));if(!_[_0xed46('0x4b')](_0x5f54ec)){_0x5f54ec[_0xed46('0x4c')](function(_0x143842){if(_0x143842===_0xed46('0x4d')){_0x2c6933[_0xed46('0x30')]('c.ListId\x20IN\x20?',[][_0xed46('0x4e')](_0x2126e0[_0xed46('0x28')][_0x143842]));}else if(_0x143842===_0xed46('0x4a')){var _0x243644='%'+_0x2126e0[_0xed46('0x28')][_0x143842]+'%';_0x2c6933[_0xed46('0x30')](_0xed46('0x4f'),_0x243644);}else{_0x2c6933[_0xed46('0x30')]('c.'+_0x143842+_0xed46('0x50'),_0x2126e0[_0xed46('0x28')][_0x143842]);}});}if(_0x2126e0[_0xed46('0x28')]['tag']){_0xcba9b8=_[_0xed46('0x51')](_0x2126e0[_0xed46('0x28')][_0xed46('0x52')])?_0x2126e0[_0xed46('0x28')][_0xed46('0x52')]:new Array(_0x2126e0[_0xed46('0x28')][_0xed46('0x52')]);_0xcba9b8[_0xed46('0x4c')](function(_0x802aa3){_0x771a9d['or'](_0xed46('0x43'),'%,'+_0x802aa3+',%');});}if(_0x2126e0[_0xed46('0x28')][_0xed46('0x48')]){var _0x448370=_0x2126e0['query'][_0xed46('0x48')][_0xed46('0x53')]('\x5c','\x5c\x5c')[_0xed46('0x53')](/'/g,'\x27\x27');if(_0x448370[_0xed46('0x41')]('\x20')[_0xed46('0x20')]>0x1){_0x1d843c['or'](_0xed46('0x54'),qs[_0xed46('0x55')](_0x448370),null);}else{if(qs['isNumeric'](_0x448370)){_0x1d843c['or'](_0xed46('0x56'),_0x448370+'%');_0x1d843c['or']('c.phone\x20LIKE\x20?',_0x448370+'%');_0x1d843c['or'](_0xed46('0x57'),_0x448370+'%');_0x1d843c['or']('c.fax\x20LIKE\x20?',_0x448370+'%');}else if(qs[_0xed46('0x58')](_0x448370)){_0x1d843c['or'](_0xed46('0x59'),_0x448370+'%');}else{_0x1d843c['or'](_0xed46('0x5a'),'%'+_0x448370+'%');_0x1d843c['or'](_0xed46('0x5b'),'%'+_0x448370+'%');_0x1d843c['or']('c.email\x20LIKE\x20?','%'+_0x448370+'%');}}}}_0x2c6933[_0xed46('0x30')](_0x1d843c);_0x2c6933[_0xed46('0x5c')]('c.id');var _0x455abf={'type':db[_0xed46('0x5d')][_0xed46('0x5e')][_0xed46('0x5f')],'raw':!![]};var _0x336ce3=_0x2c6933[_0xed46('0x60')]()[_0xed46('0x33')]('c.id');if(_0x8789c0[_0xed46('0x61')]){_0x8789c0[_0xed46('0x61')][_0xed46('0x4c')](function(_0x12a6a4){_0x2c6933[_0xed46('0x61')]('c.'+_0x12a6a4[0x0],_0x12a6a4[0x1]===_0xed46('0x62')?![]:!![]);});}if(!_[_0xed46('0x4b')](_0xcba9b8)){_0x2c6933[_0xed46('0x63')](_0x771a9d);_0x336ce3['where'](_0xed46('0x64'),_0xcba9b8);}BPromise[_0xed46('0x65')]()[_0xed46('0x16')](function(){if(!_0x3c0d6f)return;if(_0x2126e0[_0xed46('0x66')][_0xed46('0x67')]!==_0xed46('0x68'))return;if(!_[_0xed46('0x69')](_0x3c0d6f[_0xed46('0x3f')],[_0xed46('0x33'),'User'])){return _0x2126e0[_0xed46('0x66')][_0xed46('0x6a')]({'attributes':['id'],'raw':!![]})[_0xed46('0x16')](function(_0x2687d1){if(_[_0xed46('0x4b')](_0x2687d1)){_0x336ce3['where']('c.ListId\x20IS\x20NULL');_0x2c6933[_0xed46('0x30')](_0xed46('0x6b'));}else{_0x336ce3[_0xed46('0x30')](_0xed46('0x6c'),_[_0xed46('0x42')](_0x2687d1,'id'));_0x2c6933['where'](_0xed46('0x6c'),_['map'](_0x2687d1,'id'));}});}})['then'](function(){if(_0x2126e0['user']['role']===_0xed46('0x68')&&!_0x3c0d6f&&!_0x2126e0[_0xed46('0x28')][_0xed46('0x4d')])return[];return db['sequelize'][_0xed46('0x28')](_0x336ce3['toString'](),_0x455abf);})['then'](function(_0x38ec5c){_0x3984d3['count']=_0x38ec5c[_0xed46('0x20')];if(_0x3984d3[_0xed46('0x12')]===0x0)return[];return db['sequelize']['query'](_0xc8972c['toString'](),_0x455abf)[_0xed46('0x16')](function(_0x1d660d){_0x3a7d58=_[_0xed46('0x6d')](_0x1d660d,'id');_0x455abf=_[_0xed46('0x6e')](_0x455abf,{'model':db[_0xed46('0x1d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2126e0['query'][_0xed46('0x2c')]){_0x8789c0[_0xed46('0x2b')]['forEach'](function(_0x13e1ef){_0x2c6933[_0xed46('0x33')]('c.'+_0x13e1ef);});}else{_0x2c6933[_0xed46('0x33')](_0xed46('0x6f'));_0x2c6933[_0xed46('0x33')](_0xed46('0x70'));_0x2c6933['field'](_0xed46('0x71'));_0x2c6933[_0xed46('0x33')](_0xed46('0x72'));_0x2c6933['field']('c.mobile');_0x2c6933[_0xed46('0x33')]('c.fax');_0x2c6933['field'](_0xed46('0x73'));_0x2c6933[_0xed46('0x33')](_0xed46('0x74'));_0x2c6933['field']('c.createdAt');_0x2c6933[_0xed46('0x33')](_0xed46('0x75'));_0x2c6933[_0xed46('0x33')](_0xed46('0x76'));_0x2c6933['field'](_0xed46('0x77'),_0xed46('0x78'));}if(_0x8789c0[_0xed46('0x13')])_0x2c6933[_0xed46('0x13')](_0x8789c0[_0xed46('0x13')]);if(_0x8789c0[_0xed46('0x10')])_0x2c6933[_0xed46('0x10')](_0x8789c0[_0xed46('0x10')]);return db[_0xed46('0x79')][_0xed46('0x28')](_0x2c6933['toString'](),_0x455abf);});})[_0xed46('0x16')](function(_0x3cbed0){_0x3cbed0[_0xed46('0x4c')](function(_0x49c8d1){if(_0x49c8d1[_0xed46('0x78')]){_0x49c8d1[_0xed46('0x7a')]=[];_0x49c8d1['TagIds'][_0xed46('0x41')](',')[_0xed46('0x4c')](function(_0x3d1756){_0x49c8d1['Tags']['push'](_0x3a7d58[_0x3d1756]);});}delete _0x49c8d1['TagIds'];});_0x3984d3[_0xed46('0x7b')]=_0x3cbed0;return _0x3984d3;})[_0xed46('0x16')](respondWithFilteredResult(_0x550785,_0x8789c0));})[_0xed46('0x7c')](handleError(_0x550785,null));};exports[_0xed46('0x17')]=function(_0x3b8ec0,_0x22228f){return db[_0xed46('0x1d')][_0xed46('0x7d')]({'where':{'id':_0x3b8ec0[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x22228f,null))['then'](removeEntity(_0x22228f,null))[_0xed46('0x7c')](handleError(_0x22228f,null));};exports['describe']=function(_0x4b4126,_0x3e32c4){return db[_0xed46('0x1d')][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x4031ad){delete _0x4031ad[_0xed46('0x7f')];for(var _0x45dded=0x0;_0x45dded<Object[_0xed46('0x1f')](_0x4031ad)[_0xed46('0x20')];_0x45dded++){var _0x1c1510=Object[_0xed46('0x1f')](_0x4031ad)[_0x45dded];if(!_[_0xed46('0x21')](_0x1c1510,'cf_')){_0x4031ad[_0x1c1510][_0xed46('0x80')]=_0x1c1510;_0x4031ad[_0x1c1510]['displayName']=_0x1c1510;}}return _0x4031ad;})[_0xed46('0x16')](function(_0x36ec81){var _0x2f21fd={'where':Boolean(_0x4b4126['query'][_0xed46('0x81')])===!![]?undefined:{'$or':[{'ListId':_0x4b4126[_0xed46('0x28')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xed46('0x24')]['findAll'](_0x2f21fd)[_0xed46('0x16')](function(_0x3fcefb){for(var _0x3afc26=0x0;_0x3afc26<_0x3fcefb[_0xed46('0x20')];_0x3afc26++){var _0xfea251=_0xed46('0x22')+_0x3fcefb[_0x3afc26]['id'];_0x36ec81[_0xfea251][_0xed46('0x80')]=_0xfea251;_0x36ec81[_0xfea251][_0xed46('0x82')]=_0x3fcefb[_0x3afc26]['alias'];_0x36ec81[_0xfea251][_0xed46('0x83')]={'type':_0x3fcefb[_0x3afc26][_0xed46('0x26')],'values':_0x3fcefb[_0x3afc26][_0xed46('0x84')]};}Object[_0xed46('0x1f')](_0x36ec81)[_0xed46('0x4c')](function(_0x4d8bcc){if(!_0x36ec81[_0x4d8bcc]['hasOwnProperty'](_0xed46('0x80'))){delete _0x36ec81[_0x4d8bcc];}});return _0x36ec81;});})['then'](respondWithResult(_0x3e32c4,null))[_0xed46('0x7c')](handleError(_0x3e32c4,null));};exports[_0xed46('0x6e')]=function(_0x2dbe54,_0x69834b){var _0x4b9bf8;var _0xbbefdd;var _0x513e36;if(_0x2dbe54[_0xed46('0x85')]['id']){delete _0x2dbe54[_0xed46('0x85')]['id'];}return db['CmContact'][_0xed46('0x86')]({'where':{'id':[_0x2dbe54['body']['to'],_0x2dbe54[_0xed46('0x85')][_0xed46('0x35')]]}})[_0xed46('0x16')](function(_0x169f9f){if(_0x169f9f){if(_0x169f9f[_0xed46('0x20')]!==0x2){return null;}_0x169f9f[0x0]=_0x169f9f[0x0][_0xed46('0x87')]({'plain':!![]});_0x169f9f[0x1]=_0x169f9f[0x1][_0xed46('0x87')]({'plain':!![]});delete _0x169f9f[0x0]['id'];delete _0x169f9f[0x1]['id'];return _[_0xed46('0x88')](_0x169f9f[0x0],_0x169f9f[0x1],function(_0x2f9c02,_0x435e49){if(Array['isArray'](_0x435e49)&&!_0x435e49[_0xed46('0x20')]){return _0x2f9c02;}else if(!_0x435e49){return _0x2f9c02;}});}})[_0xed46('0x16')](handleEntityNotFound(_0x69834b,null))['then'](function(_0x44e01b){if(_0x44e01b){if(_0x44e01b[_0xed46('0x7f')]&&_['isArray'](_0x44e01b['tags'])){_0x44e01b['tags']=_0x44e01b[_0xed46('0x7f')][_0xed46('0x89')]();}logger[_0xed46('0x8a')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x2dbe54['body']['to'],_0x2dbe54[_0xed46('0x85')][_0xed46('0x35')]);return db[_0xed46('0x8b')][_0xed46('0x17')]({'where':{'ContactId':[_0x2dbe54[_0xed46('0x85')]['to'],_0x2dbe54[_0xed46('0x85')][_0xed46('0x35')]]}})[_0xed46('0x16')](function(_0x1edca7){logger['info'](_0xed46('0x8c'),_0x1edca7);return db[_0xed46('0x8d')][_0xed46('0x17')]({'where':{'ContactId':[_0x2dbe54[_0xed46('0x85')]['to'],_0x2dbe54[_0xed46('0x85')][_0xed46('0x35')]]}})['then'](function(_0x4a3937){logger[_0xed46('0x8a')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x4a3937);return db['CmContact'][_0xed46('0x8e')](_0x44e01b);});});}})[_0xed46('0x16')](function(_0x2b0075){if(_0x2b0075){_0x4b9bf8=_0x2b0075;_0xbbefdd={'ContactId':_0x4b9bf8['id']};_0x513e36={'where':{'ContactId':[_0x2dbe54[_0xed46('0x85')]['to'],_0x2dbe54[_0xed46('0x85')]['from']]}};return db['ChatInteraction']['update'](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['ChatMessage'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x90')]['update'](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['MailInteraction'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x91')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x92')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x91')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x93')]['update'](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['SmsMessage']['update'](_0xbbefdd,_0x513e36);}})['then'](function(){if(_0x4b9bf8){return db['FaxInteraction'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['FaxMessage'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})['then'](function(){if(_0x4b9bf8){return db['OpenchannelInteraction'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['OpenchannelMessage']['update'](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x94')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x95')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x96')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x97')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x98')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x99')]['update'](_0xbbefdd,_0x513e36);}})['then'](function(){if(_0x4b9bf8){return db['MailQueueReport'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})['then'](function(){if(_0x4b9bf8){return db['OpenchannelQueueReport'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x9a')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['JscriptySessionReport'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})['then'](function(){if(_0x4b9bf8){return db['WhatsappInteraction'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db[_0xed46('0x9b')][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['WhatsappQueueReport'][_0xed46('0x8f')](_0xbbefdd,_0x513e36);}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return db['CmContact'][_0xed46('0x17')]({'where':{'id':[_0x2dbe54[_0xed46('0x85')]['to'],_0x2dbe54[_0xed46('0x85')][_0xed46('0x35')]]}});}})[_0xed46('0x16')](function(){if(_0x4b9bf8){return _0x4b9bf8;}})[_0xed46('0x16')](respondWithResult(_0x69834b,null))[_0xed46('0x7c')](handleError(_0x69834b,null));};exports['create']=function(_0x441edc,_0x4c0de4){return db[_0xed46('0x1d')][_0xed46('0x1e')]()['then'](function(_0x4c195a){if(_0x441edc[_0xed46('0x85')][_0xed46('0x7f')]&&_[_0xed46('0x51')](_0x441edc[_0xed46('0x85')][_0xed46('0x7f')])){if(_0x441edc[_0xed46('0x85')][_0xed46('0x7f')]['length']){_0x441edc['body']['tags']=_0x441edc['body']['tags'][_0xed46('0x89')](';')+';';}else{_0x441edc[_0xed46('0x85')][_0xed46('0x7f')]=null;}}else{_0x441edc[_0xed46('0x85')]['tags']=null;}return db[_0xed46('0x1d')][_0xed46('0x8e')](_0x441edc[_0xed46('0x85')],{'fields':_[_0xed46('0x1f')](_0x4c195a),'raw':!![]});})[_0xed46('0x16')](respondWithResult(_0x4c0de4,0xc9))[_0xed46('0x7c')](handleError(_0x4c0de4,null));};exports[_0xed46('0x9c')]=function(_0x339779,_0x595efa){var _0x56b9eb=0x0;var _0x767d57=0x0;var _0x517ee0=0x0;return db[_0xed46('0x1d')][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x56de7f){return BPromise['each'](_0x339779['body'],function(_0x12600d){var _0x4e7797={'where':{'$or':[]},'defaults':_0x12600d,'fields':_[_0xed46('0x1f')](_0x56de7f),'raw':!![]};if(_0x12600d[_0xed46('0x9d')]){for(var _0xf2d5b5=0x0;_0xf2d5b5<_0x12600d[_0xed46('0x9d')]['length'];_0xf2d5b5++){var _0x6f7745={};_0x6f7745[_0x12600d[_0xed46('0x9d')][_0xf2d5b5]]=_0x12600d[_0x12600d[_0xed46('0x9d')][_0xf2d5b5]];_0x4e7797[_0xed46('0x30')]['$or'][_0xed46('0x23')](_0x6f7745);}_0x4e7797[_0xed46('0x30')][_0xed46('0x4d')]=_0x12600d['ListId'];}return db[_0xed46('0x1d')]['findOrCreate'](_0x4e7797)[_0xed46('0x9e')](function(_0x4bc47c,_0x1a2d72){if(_0x1a2d72){_0x56b9eb++;}else{_0x517ee0++;}})[_0xed46('0x7c')](function(){_0x767d57++;});});})[_0xed46('0x16')](function(_0x575a8c){if(_0x575a8c){return{'success':_0x56b9eb,'failure':_0x767d57,'duplicates':_0x517ee0};}})[_0xed46('0x16')](respondWithResult(_0x595efa,0xc9))[_0xed46('0x7c')](handleError(_0x595efa,null));};exports[_0xed46('0x9f')]=function(_0x588f4e,_0x3ad1a5){var _0x481af3;return db['CmContact'][_0xed46('0x1e')]()[_0xed46('0x16')](function(_0x2095f3){return db[_0xed46('0x1d')][_0xed46('0x7d')]({'where':{'id':_0x588f4e[_0xed46('0x7e')]['id']},'include':[{'model':db[_0xed46('0xa0')],'as':_0xed46('0x7a'),'attributes':['id',_0xed46('0x1a'),_0xed46('0x34')],'required':_0x588f4e[_0xed46('0x28')]['tag']?!![]:![]}],'attributes':_['keys'](_0x2095f3)});})[_0xed46('0x16')](function(_0x32c575){if(!_[_0xed46('0x49')](_0x32c575)){_0x481af3=_0x32c575[_0xed46('0x87')]({'plain':!![]});var _0x5375e2={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x32c575&&_0x32c575[_0xed46('0x4d')]){if(_0x32c575['ListId']){_0x5375e2[_0xed46('0x30')][_0xed46('0xa1')]['push']({'ListId':{'$ne':_0x32c575['ListId']}});}}return db[_0xed46('0x24')][_0xed46('0x86')](_0x5375e2);}})['then'](function(_0x50e831){if(!_[_0xed46('0x49')](_0x50e831)){return _[_0xed46('0xa2')](_0x481af3,_[_0xed46('0x42')](_0x50e831,function(_0x1b5321){return util[_0xed46('0xa3')]('cf_%d',_0x1b5321['id']);}));}})[_0xed46('0x16')](handleEntityNotFound(_0x3ad1a5,null))[_0xed46('0x16')](respondWithResult(_0x3ad1a5,null))['catch'](handleError(_0x3ad1a5,null));};exports['update']=function(_0x4ad36b,_0xb8a8a5){var _0x5dadcd;if(_0x4ad36b[_0xed46('0x85')]['id']){delete _0x4ad36b[_0xed46('0x85')]['id'];}return db[_0xed46('0x1d')][_0xed46('0x7d')]({'where':{'id':_0x4ad36b[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0xb8a8a5,null))[_0xed46('0x16')](saveUpdates(_0x4ad36b[_0xed46('0x85')],null))['then'](function(_0x42bdd8){_0x5dadcd=_0x42bdd8;var _0x3ee768={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x42bdd8&&_0x42bdd8[_0xed46('0x4d')]){if(_0x42bdd8[_0xed46('0x4d')]){_0x3ee768['where'][_0xed46('0xa1')]['push']({'ListId':{'$ne':_0x42bdd8[_0xed46('0x4d')]}});}}return db['CmCustomField'][_0xed46('0x86')](_0x3ee768);})[_0xed46('0x16')](function(_0x14888d){if(_0x14888d){return _['omit'](_['pickBy'](_0x4ad36b[_0xed46('0x85')],function(_0x5249a4,_0x9c45c){return _[_0xed46('0x21')](_0x9c45c,_0xed46('0x22'));}),_['map'](_0x14888d,function(_0x1c4f26){return util[_0xed46('0xa3')](_0xed46('0xa4'),_0x1c4f26['id']);}));}})['then'](function(_0xa2e9f){if(_0xa2e9f&&!_[_0xed46('0x4b')](_0xa2e9f)){var _0x3d8871=squel['update']()['table']('cm_contacts')[_0xed46('0xa5')](_0xa2e9f)[_0xed46('0x30')](_0xed46('0xa6'),_0x4ad36b['params']['id'])[_0xed46('0xa7')]();return db[_0xed46('0x79')]['query'](_0x3d8871[_0xed46('0x47')],{'replacements':_0x3d8871[_0xed46('0x84')]});}})[_0xed46('0x16')](function(){if(_0x4ad36b['body'][_0xed46('0xa8')]&&_0x5dadcd){return db[_0xed46('0x8b')][_0xed46('0x8f')]({'phone':_0x4ad36b[_0xed46('0x85')]['phone']},{'where':{'ContactId':_0x5dadcd['id']}});}})[_0xed46('0x16')](function(){return _0x5dadcd;})[_0xed46('0x16')](respondWithResult(_0xb8a8a5,null))['catch'](handleError(_0xb8a8a5,null));};exports[_0xed46('0xa9')]=function(_0x1369f9,_0x4b6daf){var _0x17a5a4={};var _0x3c2019={};var _0x2696b5;var _0x4be2da;return db[_0xed46('0x1d')][_0xed46('0xaa')]({'where':{'id':_0x1369f9[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x4b6daf,null))[_0xed46('0x16')](function(_0x3b2743){if(_0x3b2743){_0x2696b5=_0x3b2743;_0x3c2019['model']=_[_0xed46('0x1f')](db[_0xed46('0xa0')][_0xed46('0xab')]);_0x3c2019[_0xed46('0x28')]=_[_0xed46('0x1f')](_0x1369f9['query']);_0x3c2019[_0xed46('0x29')]=_['intersection'](_0x3c2019[_0xed46('0x27')],_0x3c2019['query']);_0x17a5a4[_0xed46('0x2b')]=_[_0xed46('0x2a')](_0x3c2019['model'],qs[_0xed46('0x2c')](_0x1369f9['query'][_0xed46('0x2c')]));_0x17a5a4[_0xed46('0x2b')]=_0x17a5a4[_0xed46('0x2b')]['length']?_0x17a5a4['attributes']:_0x3c2019[_0xed46('0x27')];_0x17a5a4[_0xed46('0x61')]=qs[_0xed46('0x2f')](_0x1369f9['query'][_0xed46('0x2f')]);_0x17a5a4[_0xed46('0x30')]=qs[_0xed46('0x29')](_[_0xed46('0x31')](_0x1369f9[_0xed46('0x28')],_0x3c2019[_0xed46('0x29')]));if(_0x1369f9[_0xed46('0x28')]['filter']){_0x17a5a4[_0xed46('0x30')]=_[_0xed46('0x6e')](_0x17a5a4['where'],{'$or':_[_0xed46('0x42')](_0x17a5a4[_0xed46('0x2b')],function(_0xecd52){var _0x1e06bb={};_0x1e06bb[_0xecd52]={'$like':'%'+_0x1369f9[_0xed46('0x28')][_0xed46('0x48')]+'%'};return _0x1e06bb;})});}_0x17a5a4=_[_0xed46('0x6e')]({},_0x17a5a4,_0x1369f9[_0xed46('0xac')]);return _0x2696b5[_0xed46('0xa9')](_0x17a5a4);}})['then'](function(_0x137fc8){if(_0x137fc8){_0x4be2da=_0x137fc8[_0xed46('0x20')];if(!_0x1369f9['query'][_0xed46('0x2d')]('nolimit')){_0x17a5a4[_0xed46('0x13')]=qs[_0xed46('0x13')](_0x1369f9[_0xed46('0x28')][_0xed46('0x13')]);_0x17a5a4[_0xed46('0x10')]=qs[_0xed46('0x10')](_0x1369f9['query'][_0xed46('0x10')]);}return _0x2696b5['getTags'](_0x17a5a4);}})[_0xed46('0x16')](function(_0x47b683){if(_0x47b683){return _0x47b683?{'count':_0x4be2da,'rows':_0x47b683}:null;}})[_0xed46('0x16')](respondWithResult(_0x4b6daf,null))[_0xed46('0x7c')](handleError(_0x4b6daf,null));};exports[_0xed46('0xad')]=function(_0x51b164,_0x54bf05){if(_0x51b164[_0xed46('0x85')]['id']){delete _0x51b164[_0xed46('0x85')]['id'];}return db[_0xed46('0x1d')][_0xed46('0xaa')]({'where':{'id':_0x51b164[_0xed46('0x7e')]['id']}})['then'](handleEntityNotFound(_0x54bf05,null))[_0xed46('0x16')](function(_0x210e81){if(_0x210e81){return _0x210e81['setTags'](_0x51b164['body'][_0xed46('0xae')]||[]);}return null;})[_0xed46('0x16')](respondWithResult(_0x54bf05,null))['catch'](handleError(_0x54bf05,null));};exports['getHoppers']=function(_0x4c87df,_0x5ee782){var _0x17ae66={'raw':![],'where':{}};var _0x2e7b55={};var _0xf77e47={'count':0x0,'rows':[]};return db[_0xed46('0x1d')][_0xed46('0xaa')]({'where':{'id':_0x4c87df[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x5ee782,null))['then'](function(_0x4a5fc6){if(_0x4a5fc6){_0x2e7b55[_0xed46('0x27')]=_[_0xed46('0x1f')](db['CmHopper']['rawAttributes']);_0x2e7b55[_0xed46('0x28')]=_[_0xed46('0x1f')](_0x4c87df[_0xed46('0x28')]);_0x2e7b55[_0xed46('0x29')]=_[_0xed46('0x2a')](_0x2e7b55['model'],_0x2e7b55[_0xed46('0x28')]);_0x17ae66[_0xed46('0x2b')]=_[_0xed46('0x2a')](_0x2e7b55[_0xed46('0x27')],qs[_0xed46('0x2c')](_0x4c87df['query']['fields']));_0x17ae66[_0xed46('0x2b')]=_0x17ae66[_0xed46('0x2b')]['length']?_0x17ae66[_0xed46('0x2b')]:_0x2e7b55[_0xed46('0x27')];if(!_0x4c87df[_0xed46('0x28')][_0xed46('0x2d')](_0xed46('0x2e'))){_0x17ae66[_0xed46('0x13')]=qs[_0xed46('0x13')](_0x4c87df['query'][_0xed46('0x13')]);_0x17ae66[_0xed46('0x10')]=qs[_0xed46('0x10')](_0x4c87df[_0xed46('0x28')][_0xed46('0x10')]);}_0x17ae66[_0xed46('0x61')]=qs[_0xed46('0x2f')](_0x4c87df['query']['sort']);_0x17ae66[_0xed46('0x30')]=qs['filters'](_['pick'](_0x4c87df[_0xed46('0x28')],_0x2e7b55[_0xed46('0x29')]));_0x17ae66[_0xed46('0x30')][_0xed46('0xaf')]=_0x4a5fc6['id'];if(_0x4c87df[_0xed46('0x28')][_0xed46('0x48')]){_0x17ae66[_0xed46('0x30')]=_['merge'](_0x17ae66[_0xed46('0x30')],{'$or':_[_0xed46('0x42')](_0x17ae66[_0xed46('0x2b')],function(_0x308cfe){var _0x579793={};_0x579793[_0x308cfe]={'$like':'%'+_0x4c87df[_0xed46('0x28')][_0xed46('0x48')]+'%'};return _0x579793;})});}_0x17ae66=_[_0xed46('0x6e')]({},_0x17ae66,_0x4c87df[_0xed46('0xac')]);return db[_0xed46('0x8b')][_0xed46('0x12')]({'where':_0x17ae66['where']})['then'](function(_0x379a7b){_0xf77e47['count']=_0x379a7b;if(_0x4c87df[_0xed46('0x28')][_0xed46('0xb0')]){_0x17ae66[_0xed46('0xb1')]=[{'all':!![]}];}return db[_0xed46('0x8b')]['findAll'](_0x17ae66);})['then'](function(_0x2d0103){_0xf77e47['rows']=_0x2d0103;return _0xf77e47;});}})[_0xed46('0x16')](respondWithFilteredResult(_0x5ee782,_0x17ae66))[_0xed46('0x7c')](handleError(_0x5ee782,null));};exports[_0xed46('0xb2')]=function(_0x500f1d,_0x489afa){var _0x1fb65e={'raw':!![],'where':{}};var _0x3a473b={};var _0x38623d={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0x500f1d['params']['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x489afa,null))[_0xed46('0x16')](function(_0x5bb56a){if(_0x5bb56a){_0x3a473b['model']=_['keys'](db[_0xed46('0x95')][_0xed46('0xab')]);_0x3a473b['query']=_[_0xed46('0x1f')](_0x500f1d[_0xed46('0x28')]);_0x3a473b[_0xed46('0x29')]=_['intersection'](_0x3a473b[_0xed46('0x27')],_0x3a473b['query']);_0x1fb65e[_0xed46('0x2b')]=_[_0xed46('0x2a')](_0x3a473b['model'],qs[_0xed46('0x2c')](_0x500f1d['query'][_0xed46('0x2c')]));_0x1fb65e[_0xed46('0x2b')]=_0x1fb65e[_0xed46('0x2b')][_0xed46('0x20')]?_0x1fb65e[_0xed46('0x2b')]:_0x3a473b[_0xed46('0x27')];if(!_0x500f1d[_0xed46('0x28')][_0xed46('0x2d')](_0xed46('0x2e'))){_0x1fb65e['limit']=qs[_0xed46('0x13')](_0x500f1d[_0xed46('0x28')]['limit']);_0x1fb65e['offset']=qs[_0xed46('0x10')](_0x500f1d[_0xed46('0x28')][_0xed46('0x10')]);}_0x1fb65e[_0xed46('0x61')]=qs[_0xed46('0x2f')](_0x500f1d[_0xed46('0x28')][_0xed46('0x2f')]);_0x1fb65e['where']=qs[_0xed46('0x29')](_[_0xed46('0x31')](_0x500f1d['query'],_0x3a473b[_0xed46('0x29')]));_0x1fb65e[_0xed46('0x30')][_0xed46('0xaf')]=_0x5bb56a['id'];if(_0x500f1d[_0xed46('0x28')][_0xed46('0x48')]){_0x1fb65e[_0xed46('0x30')]=_['merge'](_0x1fb65e[_0xed46('0x30')],{'$or':_[_0xed46('0x42')](_0x1fb65e[_0xed46('0x2b')],function(_0x4c309b){var _0x5b2e25={};_0x5b2e25[_0x4c309b]={'$like':'%'+_0x500f1d[_0xed46('0x28')][_0xed46('0x48')]+'%'};return _0x5b2e25;})});}_0x1fb65e=_[_0xed46('0x6e')]({},_0x1fb65e,_0x500f1d[_0xed46('0xac')]);return db[_0xed46('0x95')]['count']({'where':_0x1fb65e[_0xed46('0x30')]})[_0xed46('0x16')](function(_0x577b0f){_0x38623d[_0xed46('0x12')]=_0x577b0f;if(_0x500f1d[_0xed46('0x28')][_0xed46('0xb0')]){_0x1fb65e['include']=[{'all':!![]}];}return db[_0xed46('0x95')][_0xed46('0x86')](_0x1fb65e);})[_0xed46('0x16')](function(_0x4e338a){_0x38623d[_0xed46('0x7b')]=_0x4e338a;return _0x38623d;});}})[_0xed46('0x16')](respondWithFilteredResult(_0x489afa,_0x1fb65e))[_0xed46('0x7c')](handleError(_0x489afa,null));};exports[_0xed46('0xb3')]=function(_0x21ff2b,_0x4421e9){var _0x1d0460={'raw':!![],'where':{}};var _0x36e81b={};var _0x3f8449={'count':0x0,'rows':[]};return db[_0xed46('0x1d')][_0xed46('0xaa')]({'where':{'id':_0x21ff2b['params']['id']}})['then'](handleEntityNotFound(_0x4421e9,null))[_0xed46('0x16')](function(_0xe6badb){if(_0xe6badb){_0x36e81b[_0xed46('0x27')]=_[_0xed46('0x1f')](db[_0xed46('0x94')][_0xed46('0xab')]);_0x36e81b['query']=_[_0xed46('0x1f')](_0x21ff2b['query']);_0x36e81b['filters']=_[_0xed46('0x2a')](_0x36e81b[_0xed46('0x27')],_0x36e81b[_0xed46('0x28')]);_0x1d0460['attributes']=_['intersection'](_0x36e81b[_0xed46('0x27')],qs[_0xed46('0x2c')](_0x21ff2b['query'][_0xed46('0x2c')]));_0x1d0460[_0xed46('0x2b')]=_0x1d0460[_0xed46('0x2b')][_0xed46('0x20')]?_0x1d0460['attributes']:_0x36e81b[_0xed46('0x27')];if(!_0x21ff2b[_0xed46('0x28')]['hasOwnProperty'](_0xed46('0x2e'))){_0x1d0460['limit']=qs[_0xed46('0x13')](_0x21ff2b['query'][_0xed46('0x13')]);_0x1d0460[_0xed46('0x10')]=qs[_0xed46('0x10')](_0x21ff2b[_0xed46('0x28')][_0xed46('0x10')]);}_0x1d0460[_0xed46('0x61')]=qs[_0xed46('0x2f')](_0x21ff2b[_0xed46('0x28')][_0xed46('0x2f')]);_0x1d0460['where']=qs['filters'](_[_0xed46('0x31')](_0x21ff2b[_0xed46('0x28')],_0x36e81b[_0xed46('0x29')]));_0x1d0460['where'][_0xed46('0xaf')]=_0xe6badb['id'];if(_0x21ff2b['query'][_0xed46('0x48')]){_0x1d0460[_0xed46('0x30')]=_['merge'](_0x1d0460[_0xed46('0x30')],{'$or':_[_0xed46('0x42')](_0x1d0460[_0xed46('0x2b')],function(_0x487b9a){var _0xe6e736={};_0xe6e736[_0x487b9a]={'$like':'%'+_0x21ff2b[_0xed46('0x28')]['filter']+'%'};return _0xe6e736;})});}_0x1d0460=_[_0xed46('0x6e')]({},_0x1d0460,_0x21ff2b[_0xed46('0xac')]);return db[_0xed46('0x94')][_0xed46('0x12')]({'where':_0x1d0460[_0xed46('0x30')]})[_0xed46('0x16')](function(_0x2305eb){_0x3f8449[_0xed46('0x12')]=_0x2305eb;if(_0x21ff2b[_0xed46('0x28')][_0xed46('0xb0')]){_0x1d0460[_0xed46('0xb1')]=[{'all':!![]}];}return db[_0xed46('0x94')][_0xed46('0x86')](_0x1d0460);})['then'](function(_0x3af503){_0x3f8449[_0xed46('0x7b')]=_0x3af503;return _0x3f8449;});}})[_0xed46('0x16')](respondWithFilteredResult(_0x4421e9,_0x1d0460))[_0xed46('0x7c')](handleError(_0x4421e9,null));};exports[_0xed46('0xb4')]=function(_0x4031e7,_0x35c3a5){var _0x5e9fb7={'raw':!![],'where':{}};var _0x4f8626={};var _0x548830={'count':0x0,'rows':[]};return db['CmContact'][_0xed46('0xaa')]({'where':{'id':_0x4031e7[_0xed46('0x7e')]['id']}})[_0xed46('0x16')](handleEntityNotFound(_0x35c3a5,null))[_0xed46('0x16')](function(_0x22aaed){if(_0x22aaed){_0x4f8626['model']=_['keys'](db[_0xed46('0xb5')][_0xed46('0xab')]);_0x4f8626['query']=_[_0xed46('0x1f')](_0x4031e7[_0xed46('0x28')]);_0x4f8626[_0xed46('0x29')]=_[_0xed46('0x2a')](_0x4f8626[_0xed46('0x27')],_0x4f8626[_0xed46('0x28')]);_0x5e9fb7[_0xed46('0x2b')]=_[_0xed46('0x2a')](_0x4f8626[_0xed46('0x27')],qs[_0xed46('0x2c')](_0x4031e7['query'][_0xed46('0x2c')]));_0x5e9fb7[_0xed46('0x2b')]=_0x5e9fb7[_0xed46('0x2b')]['length']?_0x5e9fb7[_0xed46('0x2b')]:_0x4f8626[_0xed46('0x27')];if(!_0x4031e7[_0xed46('0x28')][_0xed46('0x2d')](_0xed46('0x2e'))){_0x5e9fb7[_0xed46('0x13')]=qs['limit'](_0x4031e7['query']['limit']);_0x5e9fb7[_0xed46('0x10')]=qs[_0xed46('0x10')](_0x4031e7['query'][_0xed46('0x10')]);}_0x5e9fb7['order']=qs[_0xed46('0x2f')](_0x4031e7['query']['sort']);_0x5e9fb7[_0xed46('0x30')]=qs[_0xed46('0x29')](_[_0xed46('0x31')](_0x4031e7[_0xed46('0x28')],_0x4f8626[_0xed46('0x29')]));_0x5e9fb7['where'][_0xed46('0xaf')]=_0x22aaed['id'];if(_0x4031e7[_0xed46('0x28')][_0xed46('0x48')]){_0x5e9fb7[_0xed46('0x30')]=_[_0xed46('0x6e')](_0x5e9fb7[_0xed46('0x30')],{'$or':_[_0xed46('0x42')](_0x5e9fb7['attributes'],function(_0x521032){var _0x3cfcfb={};_0x3cfcfb[_0x521032]={'$like':'%'+_0x4031e7[_0xed46('0x28')][_0xed46('0x48')]+'%'};return _0x3cfcfb;})});}_0x5e9fb7=_[_0xed46('0x6e')]({},_0x5e9fb7,_0x4031e7[_0xed46('0xac')]);return db[_0xed46('0xb5')][_0xed46('0x12')]({'where':_0x5e9fb7[_0xed46('0x30')]})[_0xed46('0x16')](function(_0x2f79db){_0x548830[_0xed46('0x12')]=_0x2f79db;if(_0x4031e7[_0xed46('0x28')][_0xed46('0xb0')]){_0x5e9fb7[_0xed46('0xb1')]=[{'all':!![]}];}return db[_0xed46('0xb5')][_0xed46('0x86')](_0x5e9fb7);})[_0xed46('0x16')](function(_0x23e124){_0x548830['rows']=_0x23e124;return _0x548830;});}})[_0xed46('0x16')](respondWithFilteredResult(_0x35c3a5,_0x5e9fb7))[_0xed46('0x7c')](handleError(_0x35c3a5,null));};exports[_0xed46('0xb6')]=function(_0x52a2aa,_0x467327){try{if(!_0x52a2aa['body'][_0xed46('0x4d')]){throw new Error(_0xed46('0xb7'));}if(!_0x52a2aa['body'][_0xed46('0xb8')]){throw new Error(_0xed46('0xb9'));}if(!_0x52a2aa[_0xed46('0x85')][_0xed46('0xba')]){throw new Error(_0xed46('0xbb'));}if(!_0x52a2aa[_0xed46('0x85')][_0xed46('0xbc')]){throw new Error(_0xed46('0xbd'));}var _0x12c25c=_0x52a2aa[_0xed46('0x85')]['binding_keys']['split'](',');var _0x4c6226=_0x52a2aa[_0xed46('0x85')]['binding_values'][_0xed46('0x41')](',');if(!_0x12c25c['length']||!_0x4c6226[_0xed46('0x20')]||_0x12c25c['length']!==_0x4c6226[_0xed46('0x20')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x52a2aa[_0xed46('0x85')][_0xed46('0x2c')]=_[_0xed46('0xbe')](_0x12c25c,_0x4c6226);if(!_0x52a2aa[_0xed46('0x85')][_0xed46('0x2c')][_0xed46('0xa8')]){throw new Error(_0xed46('0xbf'));}if(!_0x52a2aa[_0xed46('0x85')]['fields'][_0xed46('0xc0')]){throw new Error(_0xed46('0xc1'));}var _0xc98dff=path[_0xed46('0x89')](config[_0xed46('0xc2')],_0xed46('0xc3'),_0x52a2aa['file'][_0xed46('0xc4')]);fs[_0xed46('0xc5')](_0xc98dff,parseInt(_0xed46('0xc6'),0x8));var _0x2d7473=require(_0xed46('0xc7'))[_0xed46('0xc8')](path[_0xed46('0x89')](__dirname,_0xed46('0xc9')),[_0xc98dff,_0x52a2aa[_0xed46('0x85')][_0xed46('0xb8')],_0x52a2aa[_0xed46('0x85')][_0xed46('0xba')],_0x52a2aa['body']['ListId'],_0x52a2aa['body']['CompanyId'],_0x52a2aa[_0xed46('0x85')][_0xed46('0x9d')],_0x52a2aa[_0xed46('0x85')][_0xed46('0xbc')]]);return _0x467327[_0xed46('0xf')](0xc8)['json']({'message':_0xed46('0xca'),'pid':_0x2d7473[_0xed46('0xcb')]});}catch(_0x1482eb){return _0x467327[_0xed46('0xf')](0x1f4)[_0xed46('0x1b')](_0x1482eb);}};exports[_0xed46('0xcc')]=function(_0xca51fc,_0x4c9314){var _0x3d3c74=fs['createReadStream'](_0xca51fc['file'][_0xed46('0x2')]);Papa[_0xed46('0xcd')](_0x3d3c74,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4feb2c){return _0x4c9314[_0xed46('0xf')](0xc8)[_0xed46('0x15')]({'file':_0xca51fc[_0xed46('0xce')],'fields':_0x4feb2c[_0xed46('0xcf')][_0xed46('0x2c')]});}});};exports[_0xed46('0xd0')]=function(_0x224448,_0x2fb8d1){return db[_0xed46('0xd1')][_0xed46('0x86')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xed46('0x16')](function(_0x1d93e6){var _0x35672e=![];if(!_0x224448[_0xed46('0x85')][_0xed46('0x4d')]){throw new Error(_0xed46('0xb7'));}if(!_0x224448[_0xed46('0x85')][_0xed46('0xd2')][_0xed46('0xa8')]){throw new Error(_0xed46('0xbf'));}if(!_0x224448['body'][_0xed46('0xd2')][_0xed46('0xc0')]){throw new Error(_0xed46('0xc1'));}if(!_0x224448[_0xed46('0x85')]['socket_timestamp']){throw new Error(_0xed46('0xbd'));}var _0x444530=require(_0xed46('0xc7'))[_0xed46('0xc8')](path[_0xed46('0x89')](__dirname,_0xed46('0xd3')),[_0x224448[_0xed46('0x7e')]['id'],JSON[_0xed46('0xd4')](_0x224448[_0xed46('0x85')]),JSON[_0xed46('0xd4')](_0x1d93e6)]);_0x444530['on'](_0xed46('0xd5'),function(){_0x35672e=!![];return _0x2fb8d1[_0xed46('0xf')](0xc8)[_0xed46('0x15')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x444530[_0xed46('0xcb')]});});_0x444530['on'](_0xed46('0xd6'),function(_0x512411){if(_0x512411&&!_0x35672e){return _0x2fb8d1['status'](0x1f4)[_0xed46('0x15')]({'message':_0xed46('0xd7'),'pid':_0x444530[_0xed46('0xcb')]});}});})['catch'](handleError(_0x2fb8d1,null));};exports[_0xed46('0xd8')]=function(_0x215903,_0x478724){var _0x153e73=[_0xed46('0xd9'),_0xed46('0xda'),_0xed46('0xdb'),_0xed46('0xdc'),'fax',_0xed46('0xdd'),_0xed46('0xde')];var _0x55a367={'offset':0x0,'order':qs[_0xed46('0x2f')](_0xed46('0xdf'))},_0x41e244={'count':0x0,'rows':[]};Promise[_0xed46('0x65')]()[_0xed46('0x16')](function(){if(_0x215903[_0xed46('0x28')][_0xed46('0xe0')]){if(!_['includes'](_0x153e73,_0x215903[_0xed46('0x28')][_0xed46('0xe0')]['toLowerCase']())){throw new Error(_0xed46('0xe1'));}_0x153e73=[_0x215903['query']['channel']['toLowerCase']()];}if(_0x215903[_0xed46('0x28')][_0xed46('0xe2')]){try{var _0x5eeead=JSON[_0xed46('0xcd')](_0x215903[_0xed46('0x28')][_0xed46('0xe2')]);if(!moment(_0x5eeead[_0xed46('0x35')])[_0xed46('0xe3')]()){throw new Error(_0xed46('0xe4'));}if(!moment(_0x5eeead['to'])[_0xed46('0xe3')]()){throw new Error(_0xed46('0xe5'));}}catch(_0x4c5a12){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x215903[_0xed46('0x28')][_0xed46('0x2d')](_0xed46('0x2e'))){_0x55a367['limit']=qs[_0xed46('0x13')](_0x215903[_0xed46('0x28')][_0xed46('0x13')]||0xa);_0x55a367['offset']=qs['offset'](_0x215903[_0xed46('0x28')][_0xed46('0x10')]);}var _0x3a46b1=_0x153e73['map'](function(_0x825185){if(_0x825185===_0xed46('0xde')){var _0x8ba003={'attributes':['id',_0xed46('0xe6'),'type',_0xed46('0xe7'),'destination',_0xed46('0xe8'),_0xed46('0xe9'),_0xed46('0xea'),_0xed46('0xeb'),_0xed46('0xec'),_0xed46('0xed'),_0xed46('0xee'),_0xed46('0xef'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x215903[_0xed46('0x7e')]['id']},'include':[{'model':db[_0xed46('0xd1')],'as':'User','attributes':['id','name',_0xed46('0xf0'),_0xed46('0xf1')]}],'order':[['createdAt',_0xed46('0x62')]]};if(_0x215903[_0xed46('0x28')]['range']){_0x8ba003[_0xed46('0x30')]['createdAt']={'$gte':_0x5eeead[_0xed46('0x35')],'$lte':_0x5eeead['to']};}return db[_0xed46('0x97')][_0xed46('0xf2')](_0x8ba003)[_0xed46('0x16')](function(_0x491e4c){_0x41e244[_0xed46('0x12')]+=_0x491e4c[_0xed46('0x12')];return _[_0xed46('0x42')](_0x491e4c[_0xed46('0x7b')],function(_0x4e41ce){var _0x387491=_0x4e41ce[_0xed46('0x87')]({'plain':!![]});_0x387491[_0xed46('0xe0')]=_0x825185;if(_0x387491['User']){_0x387491[_0xed46('0xd1')]={'id':_0x387491[_0xed46('0xd1')]['id'],'name':_0x387491[_0xed46('0xd1')][_0xed46('0x1a')],'fullname':_0x387491[_0xed46('0xd1')][_0xed46('0xf0')],'alias':_0x387491[_0xed46('0xd1')][_0xed46('0xf1')]};}return _0x387491;});});}else{var _0x277422=_[_0xed46('0xf3')](_0x825185)+(_0x825185===_0xed46('0xda')?_0xed46('0xf4'):_0xed46('0xf5'));var _0x4186ed={'attributes':['id','closed',_0xed46('0xf6'),_0xed46('0xed'),'note',_0xed46('0xf7'),_0xed46('0xf8'),_0xed46('0xf9'),_0xed46('0xfa'),_0x277422+'Id'],'where':{'ContactId':_0x215903['params']['id']},'include':[{'model':db[_0x277422],'as':_0xed46('0xf5'),'attributes':['id',_0xed46('0x1a'),_0xed46('0xfb')]},{'model':db[_0xed46('0xd1')],'as':_0xed46('0xfc'),'attributes':['id',_0xed46('0x1a'),'fullname']},{'model':db['Tag'],'as':_0xed46('0x7a'),'attributes':['id',_0xed46('0x1a'),_0xed46('0x34')],'through':{'attributes':[]}}],'order':[['createdAt',_0xed46('0x62')]]};if(_0x215903[_0xed46('0x28')][_0xed46('0xe2')]){_0x4186ed[_0xed46('0x30')]['createdAt']={'$gte':_0x5eeead[_0xed46('0x35')],'$lte':_0x5eeead['to']};}switch(_0x825185){case _0xed46('0xda'):_0x4186ed[_0xed46('0x2b')]['push'](_0xed46('0xfd'),_0xed46('0xfe'),_0xed46('0xff'),_0xed46('0x100'),_0xed46('0x101'),_0xed46('0x102'),_0xed46('0x103'),_0xed46('0x104'),'referer');break;case _0xed46('0xd9'):_0x4186ed['attributes'][_0xed46('0x23')](_0xed46('0x105'),_0xed46('0x106'));break;case _0xed46('0xdc'):_0x4186ed[_0xed46('0x2b')][_0xed46('0x23')]('externalUrl','threadId');break;}return db[_[_0xed46('0xf3')](_0x825185)+'Interaction'][_0xed46('0xf2')](_0x4186ed)[_0xed46('0x16')](function(_0x4a7cf5){_0x41e244[_0xed46('0x12')]+=_0x4a7cf5[_0xed46('0x12')];return _[_0xed46('0x42')](_0x4a7cf5['rows'],function(_0x4aed62){var _0x1b6daf=_0x4aed62[_0xed46('0x87')]({'plain':!![]});_0x1b6daf[_0xed46('0xe0')]=_0x825185;if(_0x1b6daf[_0xed46('0xfc')]){_0x1b6daf[_0xed46('0xfc')]={'id':_0x1b6daf[_0xed46('0xfc')]['id'],'name':_0x1b6daf[_0xed46('0xfc')]['name'],'fullname':_0x1b6daf['Owner'][_0xed46('0xf0')]};}return _0x1b6daf;});});}});return Promise[_0xed46('0x107')](_0x3a46b1);})['then'](function(_0x2a7d43){return _(_0x2a7d43)[_0xed46('0x108')]()[_0xed46('0x109')]('createdAt')[_0xed46('0x10a')]()[_0xed46('0x40')]();})[_0xed46('0x16')](function(_0x1d0af4){_0x41e244[_0xed46('0x7b')]=_0x55a367[_0xed46('0x13')]?_0x1d0af4[_0xed46('0x10b')](_0x55a367[_0xed46('0x10')],_0x55a367['offset']+_0x55a367[_0xed46('0x13')]):_0x1d0af4;return _0x41e244;})[_0xed46('0x16')](respondWithFilteredResult(_0x478724,_0x55a367))[_0xed46('0x7c')](handleError(_0x478724,null));};
\ No newline at end of file
+var _0xce9f=['Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','userSecondDisposition','userThirdDisposition','UserId','createdAt','fullname','startCase','Account','closed','closedAt','thirdDisposition','browserName','customerIp','customerPort','osName','ratingType','ratingValue','referer','mail','subject','threadId','Interaction','Owner','flatten','sortBy','reverse','value','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','socket.io-emitter','register','status','json','offset','limit','count','update','then','destroy','end','sendStatus','stack','send','CmContact','describe','keys','cf_','push','findOne','trimStart','all','length','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','field','name','tools_tags','select','from','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','dateOfBirth','datetime','castTo','DATE','buildExpression','text','filter','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','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?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','QueryTypes','SELECT','clone','c.id','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','analytics','CmCustomField','alias','custom','body','findAll','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','info','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','create','each','duplicates','findOrCreate','spread','Tag','color','$and','omit','format','cf_%d','pickBy','startsWith','table','setFields','toParam','phone','getTags','options','nolimit','setTags','getHoppers','rawAttributes','includeAll','include','getHopperHistories','ContactId','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','meta','import','No\x20phone\x20column\x20specified','binding','firstName','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','../../components/import/cm/csv2','stringify','message','exit','getJourney','chat','sms','fax','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','isValid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce9f,0x137));var _0xfce9=function(_0x42fc00,_0x29ab3d){_0x42fc00=_0x42fc00-0x0;var _0x2a78d2=_0xce9f[_0x42fc00];return _0x2a78d2;};'use strict';var moment=require(_0xfce9('0x0'));var BPromise=require(_0xfce9('0x1'));var util=require(_0xfce9('0x2'));var path=require(_0xfce9('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfce9('0x4'));var Papa=require(_0xfce9('0x5'));var Redis=require(_0xfce9('0x6'));var qs=require(_0xfce9('0x7'));var as=require(_0xfce9('0x8'));var logger=require(_0xfce9('0x9'))(_0xfce9('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xfce9('0xb')]=_[_0xfce9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfce9('0xd'))(new Redis(config['redis']));require('./cmContact.socket')[_0xfce9('0xe')](socket);function respondWithResult(_0x5d7627,_0xe2bb2c){_0xe2bb2c=_0xe2bb2c||0xc8;return function(_0x23b425){if(_0x23b425){return _0x5d7627[_0xfce9('0xf')](_0xe2bb2c)[_0xfce9('0x10')](_0x23b425);}};}function respondWithFilteredResult(_0x139bf9,_0x3dff42){return function(_0x2fe00d){if(_0x2fe00d){var _0x185fd3=typeof _0x3dff42[_0xfce9('0x11')]==='undefined'&&typeof _0x3dff42[_0xfce9('0x12')]==='undefined';var _0x2df39e=_0x2fe00d[_0xfce9('0x13')];var _0x97328a=_0x185fd3?0x0:_0x3dff42[_0xfce9('0x11')];var _0x551f34=_0x185fd3?_0x2fe00d['count']:_0x3dff42[_0xfce9('0x11')]+_0x3dff42[_0xfce9('0x12')];var _0x3907c9;if(_0x551f34>=_0x2df39e){_0x551f34=_0x2df39e;_0x3907c9=0xc8;}else{_0x3907c9=0xce;}_0x139bf9[_0xfce9('0xf')](_0x3907c9);return _0x139bf9['set']('Content-Range',_0x97328a+'-'+_0x551f34+'/'+_0x2df39e)[_0xfce9('0x10')](_0x2fe00d);}return null;};}function saveUpdates(_0x381605){return function(_0x5f3a26){if(_0x5f3a26){return _0x5f3a26[_0xfce9('0x14')](_0x381605)[_0xfce9('0x15')](function(_0x248b6d){return _0x248b6d;});}return null;};}function removeEntity(_0x3f42f4){return function(_0x2f21d0){if(_0x2f21d0){return _0x2f21d0[_0xfce9('0x16')]()[_0xfce9('0x15')](function(){_0x3f42f4[_0xfce9('0xf')](0xcc)[_0xfce9('0x17')]();});}};}function handleEntityNotFound(_0x5858df){return function(_0x45306c){if(!_0x45306c){_0x5858df[_0xfce9('0x18')](0x194);}return _0x45306c;};}function handleError(_0x80b163,_0x430868){_0x430868=_0x430868||0x1f4;return function(_0x5bf113){logger['error'](_0x5bf113[_0xfce9('0x19')]);if(_0x5bf113['name']){delete _0x5bf113['name'];}_0x80b163[_0xfce9('0xf')](_0x430868)[_0xfce9('0x1a')](_0x5bf113);};}exports['index']=function(_0x160849,_0x538a5c){var _0x2bb4b3={},_0x4f42c3={},_0x21fe67={'count':0x0,'rows':[]};return db[_0xfce9('0x1b')][_0xfce9('0x1c')]()[_0xfce9('0x15')](function(_0x575d1d){var _0x39f5f3=[];for(var _0x516062=0x0;_0x516062<Object['keys'](_0x575d1d)['length'];_0x516062++){var _0x3ea97c=Object[_0xfce9('0x1d')](_0x575d1d)[_0x516062];if(_['startsWith'](_0x3ea97c,_0xfce9('0x1e'))){_0x39f5f3[_0xfce9('0x1f')](db['CmCustomField'][_0xfce9('0x20')]({'where':{'id':_[_0xfce9('0x21')](_0x3ea97c,'cf_')},'raw':!![]}));}}return BPromise[_0xfce9('0x22')](_0x39f5f3)[_0xfce9('0x15')](function(_0x269019){for(var _0x1cd5d5=0x0;_0x1cd5d5<_0x269019[_0xfce9('0x23')];_0x1cd5d5++){if(_0x269019[_0x1cd5d5]){var _0x25ca29='cf_'+_0x269019[_0x1cd5d5]['id'];var _0xe69e98=_0x575d1d[_0x25ca29];_0xe69e98[_0xfce9('0x24')]=_0x269019[_0x1cd5d5][_0xfce9('0x25')];}}return _0x575d1d;});})[_0xfce9('0x15')](function(_0x53676a){_0x4f42c3['model']=_[_0xfce9('0x1d')](_0x53676a);_0x4f42c3[_0xfce9('0x26')]=_[_0xfce9('0x1d')](_0x160849['query']);_0x4f42c3[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0x4f42c3[_0xfce9('0x29')],_0x4f42c3[_0xfce9('0x26')]);_0x2bb4b3[_0xfce9('0x2a')]=_[_0xfce9('0x28')](_0x4f42c3[_0xfce9('0x29')],qs[_0xfce9('0x2b')](_0x160849[_0xfce9('0x26')]['fields']));_0x2bb4b3[_0xfce9('0x2a')]=_0x2bb4b3[_0xfce9('0x2a')]['length']?_0x2bb4b3[_0xfce9('0x2a')]:_0x4f42c3['model'];if(!_0x160849[_0xfce9('0x26')][_0xfce9('0x2c')]('nolimit')){_0x2bb4b3[_0xfce9('0x12')]=qs[_0xfce9('0x12')](_0x160849[_0xfce9('0x26')]['limit']);_0x2bb4b3[_0xfce9('0x11')]=qs[_0xfce9('0x11')](_0x160849[_0xfce9('0x26')][_0xfce9('0x11')]);}_0x2bb4b3[_0xfce9('0x2d')]=qs[_0xfce9('0x2e')](_0x160849[_0xfce9('0x26')][_0xfce9('0x2e')]);_0x2bb4b3[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x160849[_0xfce9('0x26')],_0x4f42c3[_0xfce9('0x27')]),_0x53676a);var _0x2688d2=[];var _0x311b99=squel['select']()[_0xfce9('0x31')]('id')[_0xfce9('0x31')](_0xfce9('0x32'))[_0xfce9('0x31')]('color')['from'](_0xfce9('0x33'));var _0x8be1d=squel[_0xfce9('0x34')]()[_0xfce9('0x35')](_0xfce9('0x36'),'c')[_0xfce9('0x37')](_0xfce9('0x38'),'uc','uc.CmContactId\x20=\x20c.id')[_0xfce9('0x37')](_0xfce9('0x39'),'ct',_0xfce9('0x3a'))[_0xfce9('0x37')](_0xfce9('0x33'),'t',_0xfce9('0x3b'))[_0xfce9('0x2f')](_0xfce9('0x3c'));var _0x2b6ce4=squel[_0xfce9('0x3d')]();var _0x2c0a88=[];var _0x44a19b=squel[_0xfce9('0x3d')]();var _0x43061e;if(_0x160849['query'][_0xfce9('0x3e')]){_0x43061e=as[_0xfce9('0x3f')](_0x160849[_0xfce9('0x26')][_0xfce9('0x3e')]);var _0x199fb8=_0x43061e['sqlOperator'];for(var _0x4eb441=0x0;_0x4eb441<_0x43061e[_0xfce9('0x40')][_0xfce9('0x23')];_0x4eb441++){var _0x237fdc=_0x43061e['conditions'][_0x4eb441];var _0x39d0c8='c';var _0x2a6e19=_(_0x53676a)[_0xfce9('0x1d')]()[_0xfce9('0x41')](function(_0x811967){return _0x811967===_0x237fdc[_0xfce9('0x31')];});if(_0x2a6e19)_0x2a6e19=_0x53676a[_0x237fdc['field']];if(!_0x2a6e19){if(_0x237fdc[_0xfce9('0x31')]==='Tag'){var _0x3f7e53=_0x237fdc['value'][_0xfce9('0x42')](',')[_0xfce9('0x43')](function(_0x43b447){return Number(_0x43b447);});_0x3f7e53['forEach'](function(_0x191d72){_0x44a19b['or'](_0xfce9('0x44'),'%,'+_0x191d72+',%');});_0x2c0a88=_[_0xfce9('0x45')](_0x2c0a88,_0x3f7e53);}else if(_0x237fdc[_0xfce9('0x31')]===_0xfce9('0x46')){_0x2b6ce4['and']('uc.UserId\x20=\x20?',_0x237fdc['value']);}}else{if(_0x237fdc[_0xfce9('0x31')]===_0xfce9('0x47')||_0x2a6e19[_0xfce9('0x24')]===_0xfce9('0x48'))_0x237fdc[_0xfce9('0x49')]=_0xfce9('0x4a');var _0x2346e1=as[_0xfce9('0x4b')](_0x39d0c8,_0x2a6e19[_0xfce9('0x25')],_0x237fdc);_0x2b6ce4[_0x199fb8](_0x2346e1[_0xfce9('0x4c')],_0x2346e1['value']['start'],_0x2346e1['value'][_0xfce9('0x17')]);}}}else{var _0x499bf8=_(Object[_0xfce9('0x1d')](_0x160849[_0xfce9('0x26')]))[_0xfce9('0x43')](function(_0x4f3597){return _0x53676a[_0xfce9('0x2c')](_0x4f3597)?_0x4f3597:undefined;})[_0xfce9('0x4d')](function(_0x4876e8){return!_['isNil'](_0x4876e8);})['value']();if(_0x160849[_0xfce9('0x26')][_0xfce9('0x4e')])_0x499bf8[_0xfce9('0x1f')](_0xfce9('0x4e'));if(!_[_0xfce9('0x4f')](_0x499bf8)){_0x499bf8[_0xfce9('0x50')](function(_0x3a0837){if(_0x3a0837===_0xfce9('0x51')){_0x8be1d[_0xfce9('0x2f')](_0xfce9('0x52'),[][_0xfce9('0x53')](_0x160849[_0xfce9('0x26')][_0x3a0837]));}else if(_0x3a0837===_0xfce9('0x4e')){var _0x50fe38='%'+_0x160849[_0xfce9('0x26')][_0x3a0837]+'%';_0x8be1d['where'](_0xfce9('0x54'),_0x50fe38);}else{_0x8be1d[_0xfce9('0x2f')]('c.'+_0x3a0837+_0xfce9('0x55'),_0x160849[_0xfce9('0x26')][_0x3a0837]);}});}if(_0x160849[_0xfce9('0x26')][_0xfce9('0x56')]){_0x2c0a88=_[_0xfce9('0x57')](_0x160849[_0xfce9('0x26')][_0xfce9('0x56')])?_0x160849[_0xfce9('0x26')][_0xfce9('0x56')]:new Array(_0x160849['query'][_0xfce9('0x56')]);_0x2c0a88[_0xfce9('0x50')](function(_0x3f0a02){_0x44a19b['or'](_0xfce9('0x44'),'%,'+_0x3f0a02+',%');});}if(_0x160849['query'][_0xfce9('0x4d')]){var _0x97af7e=_0x160849[_0xfce9('0x26')][_0xfce9('0x4d')][_0xfce9('0x58')]('\x5c','\x5c\x5c')[_0xfce9('0x58')](/'/g,'\x27\x27');if(_0x97af7e['split']('\x20')[_0xfce9('0x23')]>0x1){_0x2b6ce4['or'](_0xfce9('0x59'),qs[_0xfce9('0x5a')](_0x97af7e),null);}else{if(qs['isNumeric'](_0x97af7e)){_0x2b6ce4['or'](_0xfce9('0x5b'),_0x97af7e+'%');_0x2b6ce4['or'](_0xfce9('0x5c'),_0x97af7e+'%');_0x2b6ce4['or'](_0xfce9('0x5d'),_0x97af7e+'%');_0x2b6ce4['or'](_0xfce9('0x5e'),_0x97af7e+'%');}else if(qs['isEmail'](_0x97af7e)){_0x2b6ce4['or'](_0xfce9('0x5f'),_0x97af7e+'%');}else{_0x2b6ce4['or'](_0xfce9('0x60'),'%'+_0x97af7e+'%');_0x2b6ce4['or'](_0xfce9('0x61'),'%'+_0x97af7e+'%');_0x2b6ce4['or'](_0xfce9('0x5f'),'%'+_0x97af7e+'%');}}}}_0x8be1d[_0xfce9('0x2f')](_0x2b6ce4);_0x8be1d[_0xfce9('0x62')]('c.id');var _0x52245a={'type':db['Sequelize'][_0xfce9('0x63')][_0xfce9('0x64')],'raw':!![]};var _0x3fc52f=_0x8be1d[_0xfce9('0x65')]()[_0xfce9('0x31')](_0xfce9('0x66'));if(_0x2bb4b3[_0xfce9('0x2d')]){_0x2bb4b3[_0xfce9('0x2d')][_0xfce9('0x50')](function(_0x42dee7){_0x8be1d[_0xfce9('0x2d')]('c.'+_0x42dee7[0x0],_0x42dee7[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2c0a88)){_0x8be1d[_0xfce9('0x67')](_0x44a19b);_0x3fc52f[_0xfce9('0x2f')](_0xfce9('0x68'),_0x2c0a88);}BPromise[_0xfce9('0x69')]()[_0xfce9('0x15')](function(){if(!_0x43061e)return;if(_0x160849[_0xfce9('0x6a')][_0xfce9('0x6b')]!==_0xfce9('0x6c'))return;if(!_[_0xfce9('0x6d')](_0x43061e[_0xfce9('0x40')],[_0xfce9('0x31'),'User'])){return _0x160849[_0xfce9('0x6a')][_0xfce9('0x6e')]({'attributes':['id'],'raw':!![]})[_0xfce9('0x15')](function(_0x5d92ff){if(_[_0xfce9('0x4f')](_0x5d92ff)){_0x3fc52f[_0xfce9('0x2f')](_0xfce9('0x6f'));_0x8be1d[_0xfce9('0x2f')](_0xfce9('0x6f'));}else{_0x3fc52f[_0xfce9('0x2f')](_0xfce9('0x52'),_[_0xfce9('0x43')](_0x5d92ff,'id'));_0x8be1d[_0xfce9('0x2f')](_0xfce9('0x52'),_[_0xfce9('0x43')](_0x5d92ff,'id'));}});}})[_0xfce9('0x15')](function(){if(_0x160849[_0xfce9('0x6a')][_0xfce9('0x6b')]===_0xfce9('0x6c')&&!_0x43061e&&!_0x160849[_0xfce9('0x26')][_0xfce9('0x51')])return[];return db['sequelize'][_0xfce9('0x26')](_0x3fc52f[_0xfce9('0x70')](),_0x52245a);})[_0xfce9('0x15')](function(_0x42fc2a){_0x21fe67[_0xfce9('0x13')]=_0x42fc2a[_0xfce9('0x23')];if(_0x21fe67[_0xfce9('0x13')]===0x0)return[];return db[_0xfce9('0x71')][_0xfce9('0x26')](_0x311b99['toString'](),_0x52245a)[_0xfce9('0x15')](function(_0x406c6e){_0x2688d2=_['keyBy'](_0x406c6e,'id');_0x52245a=_[_0xfce9('0x72')](_0x52245a,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x160849[_0xfce9('0x26')][_0xfce9('0x2b')]){_0x2bb4b3[_0xfce9('0x2a')][_0xfce9('0x50')](function(_0x205627){_0x8be1d[_0xfce9('0x31')]('c.'+_0x205627);});}else{_0x8be1d[_0xfce9('0x31')](_0xfce9('0x66'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x73'));_0x8be1d[_0xfce9('0x31')]('c.lastName');_0x8be1d[_0xfce9('0x31')](_0xfce9('0x74'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x75'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x76'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x77'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x78'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x79'));_0x8be1d[_0xfce9('0x31')](_0xfce9('0x7a'));_0x8be1d[_0xfce9('0x31')]('c.CompanyId');_0x8be1d[_0xfce9('0x31')](_0xfce9('0x7b'),'TagIds');}if(_0x2bb4b3['limit'])_0x8be1d[_0xfce9('0x12')](_0x2bb4b3[_0xfce9('0x12')]);if(_0x2bb4b3[_0xfce9('0x11')])_0x8be1d[_0xfce9('0x11')](_0x2bb4b3[_0xfce9('0x11')]);return db['sequelize'][_0xfce9('0x26')](_0x8be1d[_0xfce9('0x70')](),_0x52245a);});})[_0xfce9('0x15')](function(_0x51e1a5){_0x51e1a5[_0xfce9('0x50')](function(_0x57f6ff){if(_0x57f6ff[_0xfce9('0x7c')]){_0x57f6ff[_0xfce9('0x7d')]=[];_0x57f6ff[_0xfce9('0x7c')]['split'](',')['forEach'](function(_0x422be2){_0x57f6ff[_0xfce9('0x7d')][_0xfce9('0x1f')](_0x2688d2[_0x422be2]);});}delete _0x57f6ff[_0xfce9('0x7c')];});_0x21fe67[_0xfce9('0x7e')]=_0x51e1a5;return _0x21fe67;})['then'](respondWithFilteredResult(_0x538a5c,_0x2bb4b3));})[_0xfce9('0x7f')](handleError(_0x538a5c,null));};exports[_0xfce9('0x16')]=function(_0x1eaeae,_0xb492f4){return db[_0xfce9('0x1b')][_0xfce9('0x41')]({'where':{'id':_0x1eaeae[_0xfce9('0x80')]['id']}})['then'](handleEntityNotFound(_0xb492f4,null))[_0xfce9('0x15')](removeEntity(_0xb492f4,null))[_0xfce9('0x7f')](handleError(_0xb492f4,null));};exports[_0xfce9('0x1c')]=function(_0x2862ab,_0x4375c7){return db[_0xfce9('0x1b')][_0xfce9('0x1c')]()[_0xfce9('0x15')](function(_0x119756){delete _0x119756['tags'];for(var _0x1115d8=0x0;_0x1115d8<Object[_0xfce9('0x1d')](_0x119756)[_0xfce9('0x23')];_0x1115d8++){var _0x37e32d=Object[_0xfce9('0x1d')](_0x119756)[_0x1115d8];if(!_['startsWith'](_0x37e32d,_0xfce9('0x1e'))){_0x119756[_0x37e32d][_0xfce9('0x81')]=_0x37e32d;_0x119756[_0x37e32d][_0xfce9('0x82')]=_0x37e32d;}}return _0x119756;})['then'](function(_0x425e49){var _0x3c5e21={'where':Boolean(_0x2862ab[_0xfce9('0x26')][_0xfce9('0x83')])===!![]?undefined:{'$or':[{'ListId':_0x2862ab['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0xfce9('0x84')]['findAll'](_0x3c5e21)[_0xfce9('0x15')](function(_0x16cfbb){for(var _0x13f297=0x0;_0x13f297<_0x16cfbb[_0xfce9('0x23')];_0x13f297++){var _0x497e90=_0xfce9('0x1e')+_0x16cfbb[_0x13f297]['id'];_0x425e49[_0x497e90][_0xfce9('0x81')]=_0x497e90;_0x425e49[_0x497e90]['displayName']=_0x16cfbb[_0x13f297][_0xfce9('0x85')];_0x425e49[_0x497e90][_0xfce9('0x86')]={'type':_0x16cfbb[_0x13f297][_0xfce9('0x25')],'values':_0x16cfbb[_0x13f297]['values']};}Object[_0xfce9('0x1d')](_0x425e49)[_0xfce9('0x50')](function(_0x382915){if(!_0x425e49[_0x382915]['hasOwnProperty'](_0xfce9('0x81'))){delete _0x425e49[_0x382915];}});return _0x425e49;});})['then'](respondWithResult(_0x4375c7,null))[_0xfce9('0x7f')](handleError(_0x4375c7,null));};exports['merge']=function(_0x2c2cdf,_0x3b7c3a){var _0x20f6f1;var _0x333168;var _0x5811e0;if(_0x2c2cdf[_0xfce9('0x87')]['id']){delete _0x2c2cdf['body']['id'];}return db['CmContact'][_0xfce9('0x88')]({'where':{'id':[_0x2c2cdf['body']['to'],_0x2c2cdf['body']['from']]}})[_0xfce9('0x15')](function(_0x50fb7b){if(_0x50fb7b){if(_0x50fb7b[_0xfce9('0x23')]!==0x2){return null;}_0x50fb7b[0x0]=_0x50fb7b[0x0]['get']({'plain':!![]});_0x50fb7b[0x1]=_0x50fb7b[0x1][_0xfce9('0x89')]({'plain':!![]});delete _0x50fb7b[0x0]['id'];delete _0x50fb7b[0x1]['id'];return _[_0xfce9('0x8a')](_0x50fb7b[0x0],_0x50fb7b[0x1],function(_0x14f10e,_0x98d31){if(Array[_0xfce9('0x57')](_0x98d31)&&!_0x98d31[_0xfce9('0x23')]){return _0x14f10e;}else if(!_0x98d31){return _0x14f10e;}});}})['then'](handleEntityNotFound(_0x3b7c3a,null))[_0xfce9('0x15')](function(_0x4e8122){if(_0x4e8122){if(_0x4e8122['tags']&&_[_0xfce9('0x57')](_0x4e8122[_0xfce9('0x8b')])){_0x4e8122[_0xfce9('0x8b')]=_0x4e8122[_0xfce9('0x8b')][_0xfce9('0x8c')]();}logger['info'](_0xfce9('0x8d'),_0x2c2cdf[_0xfce9('0x87')]['to'],_0x2c2cdf[_0xfce9('0x87')]['from']);return db[_0xfce9('0x8e')][_0xfce9('0x16')]({'where':{'ContactId':[_0x2c2cdf[_0xfce9('0x87')]['to'],_0x2c2cdf[_0xfce9('0x87')][_0xfce9('0x35')]]}})[_0xfce9('0x15')](function(_0x581e4c){logger['info'](_0xfce9('0x8f'),_0x581e4c);return db['CmHopperBlack'][_0xfce9('0x16')]({'where':{'ContactId':[_0x2c2cdf[_0xfce9('0x87')]['to'],_0x2c2cdf[_0xfce9('0x87')][_0xfce9('0x35')]]}})[_0xfce9('0x15')](function(_0x95c9d0){logger[_0xfce9('0x90')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x95c9d0);return db[_0xfce9('0x1b')]['create'](_0x4e8122);});});}})[_0xfce9('0x15')](function(_0x155c84){if(_0x155c84){_0x20f6f1=_0x155c84;_0x333168={'ContactId':_0x20f6f1['id']};_0x5811e0={'where':{'ContactId':[_0x2c2cdf['body']['to'],_0x2c2cdf[_0xfce9('0x87')][_0xfce9('0x35')]]}};return db[_0xfce9('0x91')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db['ChatMessage'][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x92')]['update'](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x93')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})['then'](function(){if(_0x20f6f1){return db[_0xfce9('0x94')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x93')]['update'](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x94')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x95')]['update'](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x96')]['update'](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x97')]['update'](_0x333168,_0x5811e0);}})['then'](function(){if(_0x20f6f1){return db[_0xfce9('0x98')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x99')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x9a')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x9b')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x9c')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})['then'](function(){if(_0x20f6f1){return db['ReportAgentPreview'][_0xfce9('0x14')](_0x333168,_0x5811e0);}})['then'](function(){if(_0x20f6f1){return db[_0xfce9('0x9d')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x9e')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x9f')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0xa0')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db['OpenchannelQueueReport'][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0xa1')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0xa2')]['update'](_0x333168,_0x5811e0);}})['then'](function(){if(_0x20f6f1){return db['WhatsappInteraction'][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0xa3')][_0xfce9('0x14')](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0xa4')]['update'](_0x333168,_0x5811e0);}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return db[_0xfce9('0x1b')][_0xfce9('0x16')]({'where':{'id':[_0x2c2cdf['body']['to'],_0x2c2cdf[_0xfce9('0x87')][_0xfce9('0x35')]]}});}})[_0xfce9('0x15')](function(){if(_0x20f6f1){return _0x20f6f1;}})[_0xfce9('0x15')](respondWithResult(_0x3b7c3a,null))['catch'](handleError(_0x3b7c3a,null));};exports[_0xfce9('0xa5')]=function(_0x2076d5,_0x49c8cf){return db[_0xfce9('0x1b')][_0xfce9('0x1c')]()['then'](function(_0x2f2865){if(_0x2076d5[_0xfce9('0x87')][_0xfce9('0x8b')]&&_['isArray'](_0x2076d5[_0xfce9('0x87')][_0xfce9('0x8b')])){if(_0x2076d5[_0xfce9('0x87')]['tags'][_0xfce9('0x23')]){_0x2076d5[_0xfce9('0x87')][_0xfce9('0x8b')]=_0x2076d5[_0xfce9('0x87')]['tags'][_0xfce9('0x8c')](';')+';';}else{_0x2076d5[_0xfce9('0x87')][_0xfce9('0x8b')]=null;}}else{_0x2076d5[_0xfce9('0x87')][_0xfce9('0x8b')]=null;}return db['CmContact'][_0xfce9('0xa5')](_0x2076d5[_0xfce9('0x87')],{'fields':_[_0xfce9('0x1d')](_0x2f2865),'raw':!![]});})[_0xfce9('0x15')](respondWithResult(_0x49c8cf,0xc9))[_0xfce9('0x7f')](handleError(_0x49c8cf,null));};exports['bulkCreate']=function(_0x45eebf,_0x2c2d4f){var _0x862c8b=0x0;var _0x404aff=0x0;var _0x9a95d7=0x0;return db['CmContact']['describe']()['then'](function(_0x42f85f){return BPromise[_0xfce9('0xa6')](_0x45eebf[_0xfce9('0x87')],function(_0x263b24){var _0x497597={'where':{'$or':[]},'defaults':_0x263b24,'fields':_[_0xfce9('0x1d')](_0x42f85f),'raw':!![]};if(_0x263b24[_0xfce9('0xa7')]){for(var _0x325c8a=0x0;_0x325c8a<_0x263b24[_0xfce9('0xa7')][_0xfce9('0x23')];_0x325c8a++){var _0x3ba081={};_0x3ba081[_0x263b24[_0xfce9('0xa7')][_0x325c8a]]=_0x263b24[_0x263b24['duplicates'][_0x325c8a]];_0x497597[_0xfce9('0x2f')]['$or'][_0xfce9('0x1f')](_0x3ba081);}_0x497597[_0xfce9('0x2f')]['ListId']=_0x263b24[_0xfce9('0x51')];}return db[_0xfce9('0x1b')][_0xfce9('0xa8')](_0x497597)[_0xfce9('0xa9')](function(_0x3ad842,_0x5dfe6b){if(_0x5dfe6b){_0x862c8b++;}else{_0x9a95d7++;}})[_0xfce9('0x7f')](function(){_0x404aff++;});});})[_0xfce9('0x15')](function(_0x27c97c){if(_0x27c97c){return{'success':_0x862c8b,'failure':_0x404aff,'duplicates':_0x9a95d7};}})[_0xfce9('0x15')](respondWithResult(_0x2c2d4f,0xc9))[_0xfce9('0x7f')](handleError(_0x2c2d4f,null));};exports['show']=function(_0x166453,_0x10e57b){var _0x525ee5;return db[_0xfce9('0x1b')][_0xfce9('0x1c')]()[_0xfce9('0x15')](function(_0x4e7ffd){return db[_0xfce9('0x1b')]['find']({'where':{'id':_0x166453[_0xfce9('0x80')]['id']},'include':[{'model':db[_0xfce9('0xaa')],'as':'Tags','attributes':['id',_0xfce9('0x32'),_0xfce9('0xab')],'required':_0x166453[_0xfce9('0x26')][_0xfce9('0x56')]?!![]:![]}],'attributes':_[_0xfce9('0x1d')](_0x4e7ffd)});})[_0xfce9('0x15')](function(_0xc4f95f){if(!_['isNil'](_0xc4f95f)){_0x525ee5=_0xc4f95f[_0xfce9('0x89')]({'plain':!![]});var _0x2c7b32={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xc4f95f&&_0xc4f95f[_0xfce9('0x51')]){if(_0xc4f95f['ListId']){_0x2c7b32['where'][_0xfce9('0xac')]['push']({'ListId':{'$ne':_0xc4f95f['ListId']}});}}return db[_0xfce9('0x84')][_0xfce9('0x88')](_0x2c7b32);}})[_0xfce9('0x15')](function(_0x103cc1){if(!_['isNil'](_0x103cc1)){return _[_0xfce9('0xad')](_0x525ee5,_[_0xfce9('0x43')](_0x103cc1,function(_0x5b9019){return util[_0xfce9('0xae')](_0xfce9('0xaf'),_0x5b9019['id']);}));}})[_0xfce9('0x15')](handleEntityNotFound(_0x10e57b,null))[_0xfce9('0x15')](respondWithResult(_0x10e57b,null))[_0xfce9('0x7f')](handleError(_0x10e57b,null));};exports['update']=function(_0xa41cd9,_0x5bcc67){var _0x224c8e;if(_0xa41cd9[_0xfce9('0x87')]['id']){delete _0xa41cd9[_0xfce9('0x87')]['id'];}return db[_0xfce9('0x1b')][_0xfce9('0x41')]({'where':{'id':_0xa41cd9[_0xfce9('0x80')]['id']}})[_0xfce9('0x15')](handleEntityNotFound(_0x5bcc67,null))['then'](saveUpdates(_0xa41cd9[_0xfce9('0x87')],null))[_0xfce9('0x15')](function(_0x243199){_0x224c8e=_0x243199;var _0x1808fb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x243199&&_0x243199[_0xfce9('0x51')]){if(_0x243199[_0xfce9('0x51')]){_0x1808fb[_0xfce9('0x2f')]['$and'][_0xfce9('0x1f')]({'ListId':{'$ne':_0x243199[_0xfce9('0x51')]}});}}return db[_0xfce9('0x84')][_0xfce9('0x88')](_0x1808fb);})[_0xfce9('0x15')](function(_0x3531dd){if(_0x3531dd){return _['omit'](_[_0xfce9('0xb0')](_0xa41cd9['body'],function(_0x5c43b5,_0x20e303){return _[_0xfce9('0xb1')](_0x20e303,_0xfce9('0x1e'));}),_['map'](_0x3531dd,function(_0x2b25fc){return util[_0xfce9('0xae')](_0xfce9('0xaf'),_0x2b25fc['id']);}));}})[_0xfce9('0x15')](function(_0x1cc920){if(_0x1cc920&&!_[_0xfce9('0x4f')](_0x1cc920)){var _0x474261=squel[_0xfce9('0x14')]()[_0xfce9('0xb2')](_0xfce9('0x36'))[_0xfce9('0xb3')](_0x1cc920)[_0xfce9('0x2f')]('id\x20=\x20?',_0xa41cd9['params']['id'])[_0xfce9('0xb4')]();return db[_0xfce9('0x71')]['query'](_0x474261[_0xfce9('0x4c')],{'replacements':_0x474261['values']});}})[_0xfce9('0x15')](function(){if(_0xa41cd9[_0xfce9('0x87')][_0xfce9('0xb5')]&&_0x224c8e){return db['CmHopper'][_0xfce9('0x14')]({'phone':_0xa41cd9['body'][_0xfce9('0xb5')]},{'where':{'ContactId':_0x224c8e['id']}});}})['then'](function(){return _0x224c8e;})[_0xfce9('0x15')](respondWithResult(_0x5bcc67,null))[_0xfce9('0x7f')](handleError(_0x5bcc67,null));};exports[_0xfce9('0xb6')]=function(_0x3c53cc,_0x4dd177){var _0x57b776={};var _0x22c3d6={};var _0x24377b;var _0x21b4df;return db[_0xfce9('0x1b')][_0xfce9('0x20')]({'where':{'id':_0x3c53cc[_0xfce9('0x80')]['id']}})['then'](handleEntityNotFound(_0x4dd177,null))[_0xfce9('0x15')](function(_0x443b31){if(_0x443b31){_0x24377b=_0x443b31;_0x22c3d6[_0xfce9('0x29')]=_['keys'](db['Tag']['rawAttributes']);_0x22c3d6[_0xfce9('0x26')]=_['keys'](_0x3c53cc[_0xfce9('0x26')]);_0x22c3d6[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0x22c3d6[_0xfce9('0x29')],_0x22c3d6[_0xfce9('0x26')]);_0x57b776[_0xfce9('0x2a')]=_[_0xfce9('0x28')](_0x22c3d6[_0xfce9('0x29')],qs['fields'](_0x3c53cc['query'][_0xfce9('0x2b')]));_0x57b776[_0xfce9('0x2a')]=_0x57b776['attributes'][_0xfce9('0x23')]?_0x57b776['attributes']:_0x22c3d6[_0xfce9('0x29')];_0x57b776[_0xfce9('0x2d')]=qs[_0xfce9('0x2e')](_0x3c53cc['query'][_0xfce9('0x2e')]);_0x57b776[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x3c53cc[_0xfce9('0x26')],_0x22c3d6[_0xfce9('0x27')]));if(_0x3c53cc[_0xfce9('0x26')]['filter']){_0x57b776[_0xfce9('0x2f')]=_[_0xfce9('0x72')](_0x57b776[_0xfce9('0x2f')],{'$or':_[_0xfce9('0x43')](_0x57b776[_0xfce9('0x2a')],function(_0x3fc98a){var _0x4d8d1c={};_0x4d8d1c[_0x3fc98a]={'$like':'%'+_0x3c53cc[_0xfce9('0x26')][_0xfce9('0x4d')]+'%'};return _0x4d8d1c;})});}_0x57b776=_[_0xfce9('0x72')]({},_0x57b776,_0x3c53cc[_0xfce9('0xb7')]);return _0x24377b['getTags'](_0x57b776);}})[_0xfce9('0x15')](function(_0x2f3592){if(_0x2f3592){_0x21b4df=_0x2f3592[_0xfce9('0x23')];if(!_0x3c53cc['query'][_0xfce9('0x2c')](_0xfce9('0xb8'))){_0x57b776[_0xfce9('0x12')]=qs['limit'](_0x3c53cc['query'][_0xfce9('0x12')]);_0x57b776['offset']=qs['offset'](_0x3c53cc[_0xfce9('0x26')][_0xfce9('0x11')]);}return _0x24377b[_0xfce9('0xb6')](_0x57b776);}})['then'](function(_0x5c93e9){if(_0x5c93e9){return _0x5c93e9?{'count':_0x21b4df,'rows':_0x5c93e9}:null;}})[_0xfce9('0x15')](respondWithResult(_0x4dd177,null))['catch'](handleError(_0x4dd177,null));};exports[_0xfce9('0xb9')]=function(_0x4742b3,_0x1a2bdc){if(_0x4742b3[_0xfce9('0x87')]['id']){delete _0x4742b3[_0xfce9('0x87')]['id'];}return db[_0xfce9('0x1b')][_0xfce9('0x20')]({'where':{'id':_0x4742b3[_0xfce9('0x80')]['id']}})[_0xfce9('0x15')](handleEntityNotFound(_0x1a2bdc,null))[_0xfce9('0x15')](function(_0x34b2d5){if(_0x34b2d5){return _0x34b2d5['setTags'](_0x4742b3[_0xfce9('0x87')]['ids']||[]);}return null;})[_0xfce9('0x15')](respondWithResult(_0x1a2bdc,null))[_0xfce9('0x7f')](handleError(_0x1a2bdc,null));};exports[_0xfce9('0xba')]=function(_0x1d333f,_0x34b098){var _0xb032af={'raw':![],'where':{}};var _0xf27bb7={};var _0xbafcb2={'count':0x0,'rows':[]};return db[_0xfce9('0x1b')][_0xfce9('0x20')]({'where':{'id':_0x1d333f[_0xfce9('0x80')]['id']}})[_0xfce9('0x15')](handleEntityNotFound(_0x34b098,null))[_0xfce9('0x15')](function(_0x20b7d9){if(_0x20b7d9){_0xf27bb7[_0xfce9('0x29')]=_['keys'](db[_0xfce9('0x8e')][_0xfce9('0xbb')]);_0xf27bb7['query']=_[_0xfce9('0x1d')](_0x1d333f[_0xfce9('0x26')]);_0xf27bb7[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0xf27bb7['model'],_0xf27bb7[_0xfce9('0x26')]);_0xb032af['attributes']=_[_0xfce9('0x28')](_0xf27bb7[_0xfce9('0x29')],qs['fields'](_0x1d333f[_0xfce9('0x26')][_0xfce9('0x2b')]));_0xb032af[_0xfce9('0x2a')]=_0xb032af[_0xfce9('0x2a')][_0xfce9('0x23')]?_0xb032af[_0xfce9('0x2a')]:_0xf27bb7[_0xfce9('0x29')];if(!_0x1d333f[_0xfce9('0x26')]['hasOwnProperty'](_0xfce9('0xb8'))){_0xb032af['limit']=qs[_0xfce9('0x12')](_0x1d333f[_0xfce9('0x26')]['limit']);_0xb032af[_0xfce9('0x11')]=qs[_0xfce9('0x11')](_0x1d333f[_0xfce9('0x26')][_0xfce9('0x11')]);}_0xb032af['order']=qs[_0xfce9('0x2e')](_0x1d333f['query'][_0xfce9('0x2e')]);_0xb032af[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x1d333f['query'],_0xf27bb7[_0xfce9('0x27')]));_0xb032af[_0xfce9('0x2f')]['ContactId']=_0x20b7d9['id'];if(_0x1d333f[_0xfce9('0x26')][_0xfce9('0x4d')]){_0xb032af[_0xfce9('0x2f')]=_[_0xfce9('0x72')](_0xb032af[_0xfce9('0x2f')],{'$or':_[_0xfce9('0x43')](_0xb032af[_0xfce9('0x2a')],function(_0x461f9a){var _0x376ce3={};_0x376ce3[_0x461f9a]={'$like':'%'+_0x1d333f[_0xfce9('0x26')]['filter']+'%'};return _0x376ce3;})});}_0xb032af=_[_0xfce9('0x72')]({},_0xb032af,_0x1d333f['options']);return db[_0xfce9('0x8e')][_0xfce9('0x13')]({'where':_0xb032af[_0xfce9('0x2f')]})[_0xfce9('0x15')](function(_0x4eb92c){_0xbafcb2[_0xfce9('0x13')]=_0x4eb92c;if(_0x1d333f[_0xfce9('0x26')][_0xfce9('0xbc')]){_0xb032af[_0xfce9('0xbd')]=[{'all':!![]}];}return db[_0xfce9('0x8e')]['findAll'](_0xb032af);})[_0xfce9('0x15')](function(_0x3a080a){_0xbafcb2['rows']=_0x3a080a;return _0xbafcb2;});}})[_0xfce9('0x15')](respondWithFilteredResult(_0x34b098,_0xb032af))[_0xfce9('0x7f')](handleError(_0x34b098,null));};exports[_0xfce9('0xbe')]=function(_0x1f018b,_0x4ac10c){var _0x2273a5={'raw':!![],'where':{}};var _0x506261={};var _0xda5ae3={'count':0x0,'rows':[]};return db[_0xfce9('0x1b')][_0xfce9('0x20')]({'where':{'id':_0x1f018b['params']['id']}})['then'](handleEntityNotFound(_0x4ac10c,null))['then'](function(_0x44dba5){if(_0x44dba5){_0x506261[_0xfce9('0x29')]=_['keys'](db['CmHopperHistory'][_0xfce9('0xbb')]);_0x506261['query']=_[_0xfce9('0x1d')](_0x1f018b[_0xfce9('0x26')]);_0x506261[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0x506261[_0xfce9('0x29')],_0x506261[_0xfce9('0x26')]);_0x2273a5[_0xfce9('0x2a')]=_['intersection'](_0x506261['model'],qs[_0xfce9('0x2b')](_0x1f018b[_0xfce9('0x26')][_0xfce9('0x2b')]));_0x2273a5['attributes']=_0x2273a5[_0xfce9('0x2a')][_0xfce9('0x23')]?_0x2273a5[_0xfce9('0x2a')]:_0x506261[_0xfce9('0x29')];if(!_0x1f018b[_0xfce9('0x26')][_0xfce9('0x2c')]('nolimit')){_0x2273a5[_0xfce9('0x12')]=qs[_0xfce9('0x12')](_0x1f018b[_0xfce9('0x26')]['limit']);_0x2273a5[_0xfce9('0x11')]=qs['offset'](_0x1f018b['query'][_0xfce9('0x11')]);}_0x2273a5[_0xfce9('0x2d')]=qs[_0xfce9('0x2e')](_0x1f018b[_0xfce9('0x26')][_0xfce9('0x2e')]);_0x2273a5[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x1f018b['query'],_0x506261[_0xfce9('0x27')]));_0x2273a5[_0xfce9('0x2f')][_0xfce9('0xbf')]=_0x44dba5['id'];if(_0x1f018b['query'][_0xfce9('0x4d')]){_0x2273a5[_0xfce9('0x2f')]=_[_0xfce9('0x72')](_0x2273a5[_0xfce9('0x2f')],{'$or':_[_0xfce9('0x43')](_0x2273a5[_0xfce9('0x2a')],function(_0x2dff39){var _0x31116e={};_0x31116e[_0x2dff39]={'$like':'%'+_0x1f018b[_0xfce9('0x26')]['filter']+'%'};return _0x31116e;})});}_0x2273a5=_[_0xfce9('0x72')]({},_0x2273a5,_0x1f018b[_0xfce9('0xb7')]);return db['CmHopperHistory'][_0xfce9('0x13')]({'where':_0x2273a5[_0xfce9('0x2f')]})[_0xfce9('0x15')](function(_0x139f2d){_0xda5ae3[_0xfce9('0x13')]=_0x139f2d;if(_0x1f018b[_0xfce9('0x26')][_0xfce9('0xbc')]){_0x2273a5[_0xfce9('0xbd')]=[{'all':!![]}];}return db[_0xfce9('0x9c')][_0xfce9('0x88')](_0x2273a5);})[_0xfce9('0x15')](function(_0x3dd054){_0xda5ae3[_0xfce9('0x7e')]=_0x3dd054;return _0xda5ae3;});}})[_0xfce9('0x15')](respondWithFilteredResult(_0x4ac10c,_0x2273a5))[_0xfce9('0x7f')](handleError(_0x4ac10c,null));};exports[_0xfce9('0xc0')]=function(_0x558d25,_0xa82a22){var _0x49004e={'raw':!![],'where':{}};var _0x59cf94={};var _0x21afde={'count':0x0,'rows':[]};return db[_0xfce9('0x1b')][_0xfce9('0x20')]({'where':{'id':_0x558d25[_0xfce9('0x80')]['id']}})[_0xfce9('0x15')](handleEntityNotFound(_0xa82a22,null))[_0xfce9('0x15')](function(_0x525b8a){if(_0x525b8a){_0x59cf94['model']=_['keys'](db[_0xfce9('0x9b')][_0xfce9('0xbb')]);_0x59cf94[_0xfce9('0x26')]=_['keys'](_0x558d25['query']);_0x59cf94[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0x59cf94[_0xfce9('0x29')],_0x59cf94['query']);_0x49004e['attributes']=_['intersection'](_0x59cf94[_0xfce9('0x29')],qs[_0xfce9('0x2b')](_0x558d25[_0xfce9('0x26')]['fields']));_0x49004e[_0xfce9('0x2a')]=_0x49004e['attributes'][_0xfce9('0x23')]?_0x49004e[_0xfce9('0x2a')]:_0x59cf94[_0xfce9('0x29')];if(!_0x558d25[_0xfce9('0x26')][_0xfce9('0x2c')](_0xfce9('0xb8'))){_0x49004e['limit']=qs[_0xfce9('0x12')](_0x558d25['query'][_0xfce9('0x12')]);_0x49004e[_0xfce9('0x11')]=qs[_0xfce9('0x11')](_0x558d25[_0xfce9('0x26')][_0xfce9('0x11')]);}_0x49004e[_0xfce9('0x2d')]=qs[_0xfce9('0x2e')](_0x558d25[_0xfce9('0x26')]['sort']);_0x49004e[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x558d25[_0xfce9('0x26')],_0x59cf94['filters']));_0x49004e['where'][_0xfce9('0xbf')]=_0x525b8a['id'];if(_0x558d25[_0xfce9('0x26')][_0xfce9('0x4d')]){_0x49004e['where']=_[_0xfce9('0x72')](_0x49004e[_0xfce9('0x2f')],{'$or':_[_0xfce9('0x43')](_0x49004e[_0xfce9('0x2a')],function(_0x287a24){var _0x406fb0={};_0x406fb0[_0x287a24]={'$like':'%'+_0x558d25[_0xfce9('0x26')][_0xfce9('0x4d')]+'%'};return _0x406fb0;})});}_0x49004e=_[_0xfce9('0x72')]({},_0x49004e,_0x558d25[_0xfce9('0xb7')]);return db[_0xfce9('0x9b')][_0xfce9('0x13')]({'where':_0x49004e[_0xfce9('0x2f')]})[_0xfce9('0x15')](function(_0x23a2c8){_0x21afde['count']=_0x23a2c8;if(_0x558d25[_0xfce9('0x26')][_0xfce9('0xbc')]){_0x49004e[_0xfce9('0xbd')]=[{'all':!![]}];}return db[_0xfce9('0x9b')][_0xfce9('0x88')](_0x49004e);})[_0xfce9('0x15')](function(_0x3d6d15){_0x21afde['rows']=_0x3d6d15;return _0x21afde;});}})['then'](respondWithFilteredResult(_0xa82a22,_0x49004e))['catch'](handleError(_0xa82a22,null));};exports['getJscriptySessions']=function(_0x1c69c1,_0x6758a4){var _0x4198e2={'raw':!![],'where':{}};var _0x4bdbea={};var _0x1325a5={'count':0x0,'rows':[]};return db[_0xfce9('0x1b')]['findOne']({'where':{'id':_0x1c69c1[_0xfce9('0x80')]['id']}})[_0xfce9('0x15')](handleEntityNotFound(_0x6758a4,null))[_0xfce9('0x15')](function(_0x368e8f){if(_0x368e8f){_0x4bdbea[_0xfce9('0x29')]=_[_0xfce9('0x1d')](db[_0xfce9('0xa2')][_0xfce9('0xbb')]);_0x4bdbea[_0xfce9('0x26')]=_[_0xfce9('0x1d')](_0x1c69c1[_0xfce9('0x26')]);_0x4bdbea[_0xfce9('0x27')]=_[_0xfce9('0x28')](_0x4bdbea[_0xfce9('0x29')],_0x4bdbea['query']);_0x4198e2['attributes']=_[_0xfce9('0x28')](_0x4bdbea[_0xfce9('0x29')],qs[_0xfce9('0x2b')](_0x1c69c1[_0xfce9('0x26')][_0xfce9('0x2b')]));_0x4198e2[_0xfce9('0x2a')]=_0x4198e2[_0xfce9('0x2a')][_0xfce9('0x23')]?_0x4198e2['attributes']:_0x4bdbea['model'];if(!_0x1c69c1['query'][_0xfce9('0x2c')](_0xfce9('0xb8'))){_0x4198e2['limit']=qs[_0xfce9('0x12')](_0x1c69c1[_0xfce9('0x26')][_0xfce9('0x12')]);_0x4198e2[_0xfce9('0x11')]=qs[_0xfce9('0x11')](_0x1c69c1[_0xfce9('0x26')]['offset']);}_0x4198e2[_0xfce9('0x2d')]=qs[_0xfce9('0x2e')](_0x1c69c1[_0xfce9('0x26')]['sort']);_0x4198e2[_0xfce9('0x2f')]=qs[_0xfce9('0x27')](_[_0xfce9('0x30')](_0x1c69c1['query'],_0x4bdbea[_0xfce9('0x27')]));_0x4198e2[_0xfce9('0x2f')][_0xfce9('0xbf')]=_0x368e8f['id'];if(_0x1c69c1[_0xfce9('0x26')]['filter']){_0x4198e2[_0xfce9('0x2f')]=_[_0xfce9('0x72')](_0x4198e2['where'],{'$or':_[_0xfce9('0x43')](_0x4198e2[_0xfce9('0x2a')],function(_0x2ced1c){var _0x59f992={};_0x59f992[_0x2ced1c]={'$like':'%'+_0x1c69c1[_0xfce9('0x26')][_0xfce9('0x4d')]+'%'};return _0x59f992;})});}_0x4198e2=_['merge']({},_0x4198e2,_0x1c69c1[_0xfce9('0xb7')]);return db[_0xfce9('0xa2')][_0xfce9('0x13')]({'where':_0x4198e2[_0xfce9('0x2f')]})[_0xfce9('0x15')](function(_0x215ed2){_0x1325a5[_0xfce9('0x13')]=_0x215ed2;if(_0x1c69c1[_0xfce9('0x26')][_0xfce9('0xbc')]){_0x4198e2[_0xfce9('0xbd')]=[{'all':!![]}];}return db[_0xfce9('0xa2')][_0xfce9('0x88')](_0x4198e2);})[_0xfce9('0x15')](function(_0x421744){_0x1325a5[_0xfce9('0x7e')]=_0x421744;return _0x1325a5;});}})['then'](respondWithFilteredResult(_0x6758a4,_0x4198e2))[_0xfce9('0x7f')](handleError(_0x6758a4,null));};exports[_0xfce9('0xc1')]=function(_0x2218a1,_0x5360f7){try{if(!_0x2218a1[_0xfce9('0x87')][_0xfce9('0x51')]){throw new Error(_0xfce9('0xc2'));}if(!_0x2218a1[_0xfce9('0x87')][_0xfce9('0xc3')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x2218a1['body'][_0xfce9('0xc4')]){throw new Error(_0xfce9('0xc5'));}if(!_0x2218a1[_0xfce9('0x87')][_0xfce9('0xc6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1b9cc2=_0x2218a1[_0xfce9('0x87')][_0xfce9('0xc3')][_0xfce9('0x42')](',');var _0x1659d9=_0x2218a1[_0xfce9('0x87')][_0xfce9('0xc4')][_0xfce9('0x42')](',');if(!_0x1b9cc2[_0xfce9('0x23')]||!_0x1659d9[_0xfce9('0x23')]||_0x1b9cc2[_0xfce9('0x23')]!==_0x1659d9['length']){throw new Error(_0xfce9('0xc7'));}_0x2218a1[_0xfce9('0x87')][_0xfce9('0x2b')]=_[_0xfce9('0xc8')](_0x1b9cc2,_0x1659d9);if(!_0x2218a1[_0xfce9('0x87')][_0xfce9('0x2b')][_0xfce9('0xb5')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x2218a1[_0xfce9('0x87')][_0xfce9('0x2b')]['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}var _0x5d035e=path[_0xfce9('0x8c')](config[_0xfce9('0xc9')],'server/files/tmp',_0x2218a1[_0xfce9('0xca')][_0xfce9('0xcb')]);fs[_0xfce9('0xcc')](_0x5d035e,parseInt(_0xfce9('0xcd'),0x8));var _0x165054=require('child_process')[_0xfce9('0xce')](path[_0xfce9('0x8c')](__dirname,_0xfce9('0xcf')),[_0x5d035e,_0x2218a1[_0xfce9('0x87')][_0xfce9('0xc3')],_0x2218a1['body'][_0xfce9('0xc4')],_0x2218a1['body']['ListId'],_0x2218a1[_0xfce9('0x87')][_0xfce9('0xd0')],_0x2218a1[_0xfce9('0x87')][_0xfce9('0xa7')],_0x2218a1['body']['socket_timestamp']]);return _0x5360f7[_0xfce9('0xf')](0xc8)[_0xfce9('0x10')]({'message':_0xfce9('0xd1'),'pid':_0x165054[_0xfce9('0xd2')]});}catch(_0x34a284){return _0x5360f7[_0xfce9('0xf')](0x1f4)[_0xfce9('0x1a')](_0x34a284);}};exports['upload']=function(_0xba4713,_0x5295c3){var _0x3d289b=fs[_0xfce9('0xd3')](_0xba4713['file'][_0xfce9('0x3')]);Papa['parse'](_0x3d289b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5cc245){return _0x5295c3[_0xfce9('0xf')](0xc8)[_0xfce9('0x10')]({'file':_0xba4713[_0xfce9('0xca')],'fields':_0x5cc245[_0xfce9('0xd4')][_0xfce9('0x2b')]});}});};exports[_0xfce9('0xd5')]=function(_0x1e21f3,_0x395fc2){return db[_0xfce9('0x46')][_0xfce9('0x88')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfce9('0x6c')}})[_0xfce9('0x15')](function(_0xb0658d){var _0x361945=![];if(!_0x1e21f3[_0xfce9('0x87')][_0xfce9('0x51')]){throw new Error(_0xfce9('0xc2'));}if(!_0x1e21f3[_0xfce9('0x87')]['binding'][_0xfce9('0xb5')]){throw new Error(_0xfce9('0xd6'));}if(!_0x1e21f3[_0xfce9('0x87')][_0xfce9('0xd7')][_0xfce9('0xd8')]){throw new Error(_0xfce9('0xd9'));}if(!_0x1e21f3[_0xfce9('0x87')]['socket_timestamp']){throw new Error(_0xfce9('0xda'));}var _0x3eee6e=require(_0xfce9('0xdb'))[_0xfce9('0xce')](path[_0xfce9('0x8c')](__dirname,_0xfce9('0xdc')),[_0x1e21f3['params']['id'],JSON[_0xfce9('0xdd')](_0x1e21f3[_0xfce9('0x87')]),JSON[_0xfce9('0xdd')](_0xb0658d)]);_0x3eee6e['on'](_0xfce9('0xde'),function(){_0x361945=!![];return _0x395fc2[_0xfce9('0xf')](0xc8)[_0xfce9('0x10')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x3eee6e['pid']});});_0x3eee6e['on'](_0xfce9('0xdf'),function(_0x10236d){if(_0x10236d&&!_0x361945){return _0x395fc2[_0xfce9('0xf')](0x1f4)[_0xfce9('0x10')]({'message':'error\x20child\x20process','pid':_0x3eee6e[_0xfce9('0xd2')]});}});})[_0xfce9('0x7f')](handleError(_0x395fc2,null));};exports[_0xfce9('0xe0')]=function(_0x43272a,_0x5763f0){var _0x3eea5b=['mail',_0xfce9('0xe1'),_0xfce9('0xe2'),'openchannel',_0xfce9('0xe3'),_0xfce9('0xe4'),'voice'];var _0x23f9a7={'offset':0x0,'order':qs[_0xfce9('0x2e')](_0xfce9('0xe5'))},_0x529af2={'count':0x0,'rows':[]};Promise[_0xfce9('0x69')]()[_0xfce9('0x15')](function(){if(_0x43272a[_0xfce9('0x26')][_0xfce9('0xe6')]){if(!_[_0xfce9('0xe7')](_0x3eea5b,_0x43272a[_0xfce9('0x26')][_0xfce9('0xe6')][_0xfce9('0xe8')]())){throw new Error(_0xfce9('0xe9'));}_0x3eea5b=[_0x43272a['query']['channel'][_0xfce9('0xe8')]()];}if(_0x43272a[_0xfce9('0x26')]['range']){try{var _0x3844f3=JSON[_0xfce9('0xea')](_0x43272a[_0xfce9('0x26')][_0xfce9('0xeb')]);if(!moment(_0x3844f3[_0xfce9('0x35')])[_0xfce9('0xec')]()){throw new Error(_0xfce9('0xed'));}if(!moment(_0x3844f3['to'])[_0xfce9('0xec')]()){throw new Error(_0xfce9('0xee'));}}catch(_0x404b7c){throw new Error(_0xfce9('0xef'));}}if(!_0x43272a[_0xfce9('0x26')]['hasOwnProperty'](_0xfce9('0xb8'))){_0x23f9a7['limit']=qs[_0xfce9('0x12')](_0x43272a['query'][_0xfce9('0x12')]||0xa);_0x23f9a7[_0xfce9('0x11')]=qs[_0xfce9('0x11')](_0x43272a['query']['offset']);}var _0x5c8b02=_0x3eea5b[_0xfce9('0x43')](function(_0x3af1a0){if(_0x3af1a0==='voice'){var _0x1ed0eb={'attributes':['id',_0xfce9('0xf0'),_0xfce9('0x25'),_0xfce9('0xf1'),_0xfce9('0xf2'),_0xfce9('0xf3'),_0xfce9('0xf4'),_0xfce9('0xf5'),_0xfce9('0xf6'),_0xfce9('0xf7'),'createdAt','userDisposition',_0xfce9('0xf8'),_0xfce9('0xf9'),_0xfce9('0xfa')],'where':{'ContactId':_0x43272a[_0xfce9('0x80')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0xfce9('0x32'),'fullname',_0xfce9('0x85')]}],'order':[[_0xfce9('0xfb'),'DESC']]};if(_0x43272a[_0xfce9('0x26')][_0xfce9('0xeb')]){_0x1ed0eb[_0xfce9('0x2f')][_0xfce9('0xfb')]={'$gte':_0x3844f3[_0xfce9('0x35')],'$lte':_0x3844f3['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x1ed0eb)[_0xfce9('0x15')](function(_0x5bc58b){_0x529af2[_0xfce9('0x13')]+=_0x5bc58b[_0xfce9('0x13')];return _[_0xfce9('0x43')](_0x5bc58b[_0xfce9('0x7e')],function(_0x4b2bb7){var _0x5d5666=_0x4b2bb7['get']({'plain':!![]});_0x5d5666[_0xfce9('0xe6')]=_0x3af1a0;if(_0x5d5666[_0xfce9('0x46')]){_0x5d5666['User']={'id':_0x5d5666[_0xfce9('0x46')]['id'],'name':_0x5d5666[_0xfce9('0x46')][_0xfce9('0x32')],'fullname':_0x5d5666['User'][_0xfce9('0xfc')],'alias':_0x5d5666[_0xfce9('0x46')]['alias']};}return _0x5d5666;});});}else{var _0x2498e2=_[_0xfce9('0xfd')](_0x3af1a0)+(_0x3af1a0===_0xfce9('0xe1')?'Website':_0xfce9('0xfe'));var _0x1d022c={'attributes':['id',_0xfce9('0xff'),_0xfce9('0x100'),_0xfce9('0xfb'),_0xfce9('0xf7'),'disposition','secondDisposition',_0xfce9('0x101'),_0xfce9('0xfa'),_0x2498e2+'Id'],'where':{'ContactId':_0x43272a[_0xfce9('0x80')]['id']},'include':[{'model':db[_0x2498e2],'as':'Account','attributes':['id',_0xfce9('0x32'),'key']},{'model':db[_0xfce9('0x46')],'as':'Owner','attributes':['id',_0xfce9('0x32'),'fullname']},{'model':db[_0xfce9('0xaa')],'as':_0xfce9('0x7d'),'attributes':['id','name',_0xfce9('0xab')],'through':{'attributes':[]}}],'order':[[_0xfce9('0xfb'),'DESC']]};if(_0x43272a[_0xfce9('0x26')][_0xfce9('0xeb')]){_0x1d022c['where'][_0xfce9('0xfb')]={'$gte':_0x3844f3[_0xfce9('0x35')],'$lte':_0x3844f3['to']};}switch(_0x3af1a0){case _0xfce9('0xe1'):_0x1d022c[_0xfce9('0x2a')][_0xfce9('0x1f')](_0xfce9('0x102'),_0xfce9('0x103'),_0xfce9('0x104'),'deviceModel',_0xfce9('0x105'),'ratingMessage',_0xfce9('0x106'),_0xfce9('0x107'),_0xfce9('0x108'));break;case _0xfce9('0x109'):_0x1d022c[_0xfce9('0x2a')][_0xfce9('0x1f')](_0xfce9('0x10a'),'substatus');break;case'openchannel':_0x1d022c[_0xfce9('0x2a')]['push']('externalUrl',_0xfce9('0x10b'));break;}return db[_['startCase'](_0x3af1a0)+_0xfce9('0x10c')]['findAndCountAll'](_0x1d022c)[_0xfce9('0x15')](function(_0xa32d9b){_0x529af2[_0xfce9('0x13')]+=_0xa32d9b[_0xfce9('0x13')];return _[_0xfce9('0x43')](_0xa32d9b[_0xfce9('0x7e')],function(_0x449d17){var _0x59b457=_0x449d17[_0xfce9('0x89')]({'plain':!![]});_0x59b457[_0xfce9('0xe6')]=_0x3af1a0;if(_0x59b457[_0xfce9('0x10d')]){_0x59b457['Owner']={'id':_0x59b457['Owner']['id'],'name':_0x59b457['Owner'][_0xfce9('0x32')],'fullname':_0x59b457[_0xfce9('0x10d')][_0xfce9('0xfc')]};}return _0x59b457;});});}});return Promise['all'](_0x5c8b02);})[_0xfce9('0x15')](function(_0x2f3f17){return _(_0x2f3f17)[_0xfce9('0x10e')]()[_0xfce9('0x10f')](_0xfce9('0xfb'))[_0xfce9('0x110')]()[_0xfce9('0x111')]();})['then'](function(_0x37a09c){_0x529af2[_0xfce9('0x7e')]=_0x23f9a7[_0xfce9('0x12')]?_0x37a09c['slice'](_0x23f9a7[_0xfce9('0x11')],_0x23f9a7[_0xfce9('0x11')]+_0x23f9a7[_0xfce9('0x12')]):_0x37a09c;return _0x529af2;})[_0xfce9('0x15')](respondWithFilteredResult(_0x5763f0,_0x23f9a7))[_0xfce9('0x7f')](handleError(_0x5763f0,null));};
\ No newline at end of file
index 6ff5dcd..e47a7c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd17f=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5541f9,_0xe6be6a){var _0x1e7b8f=function(_0x2f83a4){while(--_0x2f83a4){_0x5541f9['push'](_0x5541f9['shift']());}};_0x1e7b8f(++_0xe6be6a);}(_0xd17f,0x12e));var _0xfd17=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd17f[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0xfd17('0x0'));var CmContact=require(_0xfd17('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfd17('0x2')](0x0);var events={'afterCreate':_0xfd17('0x3'),'afterUpdate':_0xfd17('0x4'),'afterDestroy':_0xfd17('0x5')};function emitEvent(_0x2155f6){return function(_0x5bbfe8,_0x18c267,_0x16e967){CmContactEvents[_0xfd17('0x6')](_0x2155f6+':'+_0x5bbfe8['id'],_0x5bbfe8);CmContactEvents[_0xfd17('0x6')](_0x2155f6,_0x5bbfe8);_0x16e967(null);};}for(var e in events){if(events[_0xfd17('0x7')](e)){var event=events[e];CmContact[_0xfd17('0x8')](e,emitEvent(event));}}module[_0xfd17('0x9')]=CmContactEvents;
\ No newline at end of file
+var _0xc1e7=['hasOwnProperty','hook','exports','events','CmContact','setMaxListeners','save','update','emit'];(function(_0x4dc03d,_0x4552fb){var _0x36cd8c=function(_0x4d1f2a){while(--_0x4d1f2a){_0x4dc03d['push'](_0x4dc03d['shift']());}};_0x36cd8c(++_0x4552fb);}(_0xc1e7,0x11a));var _0x7c1e=function(_0xd54317,_0x300047){_0xd54317=_0xd54317-0x0;var _0x341edb=_0xc1e7[_0xd54317];return _0x341edb;};'use strict';var EventEmitter=require(_0x7c1e('0x0'));var CmContact=require('../../mysqldb')['db'][_0x7c1e('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7c1e('0x2')](0x0);var events={'afterCreate':_0x7c1e('0x3'),'afterUpdate':_0x7c1e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x224790){return function(_0x34f76f,_0x22b326,_0x7a2d8f){CmContactEvents[_0x7c1e('0x5')](_0x224790+':'+_0x34f76f['id'],_0x34f76f);CmContactEvents[_0x7c1e('0x5')](_0x224790,_0x34f76f);_0x7a2d8f(null);};}for(var e in events){if(events[_0x7c1e('0x6')](e)){var event=events[e];CmContact[_0x7c1e('0x7')](e,emitEvent(event));}}module[_0x7c1e('0x8')]=CmContactEvents;
\ No newline at end of file
index bcbf593..8695693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49b=['onlyIfOpen','findAll','BlackLists','Campaign','CmHopperBlack','cmContact,\x20%s,\x20%s','isEmpty','destroy','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','api','moment','request-promise','path','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','firstName','lastName','phone','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','inspect','CmHopper','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','findOne','\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','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','length','always'];(function(_0x2715cf,_0x517bb2){var _0x1bdcb8=function(_0x5dec7b){while(--_0x5dec7b){_0x2715cf['push'](_0x2715cf['shift']());}};_0x1bdcb8(++_0x517bb2);}(_0xb49b,0x194));var _0xbb49=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb49b[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xbb49('0x0'));var logger=require('../../config/logger')(_0xbb49('0x1'));var moment=require(_0xbb49('0x2'));var BPromise=require('bluebird');var rp=require(_0xbb49('0x3'));var fs=require('fs');var path=require(_0xbb49('0x4'));var rimraf=require('rimraf');var config=require(_0xbb49('0x5'));var attributes=require(_0xbb49('0x6'));module[_0xbb49('0x7')]=function(_0x22efa4,_0x3f829f){return _0x22efa4[_0xbb49('0x8')](_0xbb49('0x9'),attributes,{'tableName':_0xbb49('0xa'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':[_0xbb49('0xb'),_0xbb49('0xc'),_0xbb49('0xd'),'mobile',_0xbb49('0xe'),_0xbb49('0xf')],'type':_0xbb49('0x10')}],'timestamps':!![],'charset':_0xbb49('0x11'),'collate':_0xbb49('0x12'),'hooks':{'afterCreate':function(_0x5526b5,_0x3c21d3,_0x247db5){var _0x340f49=_0x22efa4[_0xbb49('0x13')];var _0x7a971b=_0x5526b5[_0xbb49('0x14')]({'plain':!![]});function _0x2ae134(){return function(_0x1ffb86){logger[_0xbb49('0x15')](_0xbb49('0x16'),_0xbb49('0x17'),util[_0xbb49('0x18')](_0x1ffb86,{'showHidden':![],'depth':null}));};}var _0x22d8e9=function(_0x255611){return new BPromise(function(_0x459325,_0x311cb9){_0x340f49[_0xbb49('0x19')]['findOne']({'where':{'phone':_0x7a971b[_0xbb49('0xd')],'VoiceQueueId':_0x255611['id']}})[_0xbb49('0x1a')](function(_0x14af5a){if(!_[_0xbb49('0x1b')](_0x14af5a)){throw new Error(_0xbb49('0x1c')+_0x7a971b[_0xbb49('0xd')]+_0xbb49('0x1d')+_0x255611['id']);}return _0x340f49[_0xbb49('0x19')][_0xbb49('0x1e')]({'phone':_0x7a971b[_0xbb49('0xd')],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'priority':_0x7a971b[_0xbb49('0x20')]?_0x7a971b['priority']:0x2,'scheduledat':_0x7a971b[_0xbb49('0x21')]?_0x7a971b[_0xbb49('0x21')]:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'callback':_0x7a971b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x7a971b[_0xbb49('0x24')]?_0x7a971b[_0xbb49('0x24')]:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()[_0xbb49('0x22')](_0xbb49('0x23')):undefined,'VoiceQueueId':_0x255611['id']});})[_0xbb49('0x25')](function(_0x4e1d51){_0x311cb9(_0x4e1d51);});});};var _0x3029ac=function(_0x2e2909){return new BPromise(function(_0x4f551f,_0x7a53a2){_0x340f49['CmHopper']['findOne']({'where':{'phone':_0x7a971b[_0xbb49('0xd')],'VoiceQueueId':_0x2e2909['id']}})[_0xbb49('0x1a')](function(_0x2837a2){if(!_['isNil'](_0x2837a2)){throw new Error('cmContact,\x20afterCreate\x20'+_0x7a971b[_0xbb49('0xd')]+_0xbb49('0x26')+_0x2e2909['id']);}return _0x340f49[_0xbb49('0x27')][_0xbb49('0x28')]({'where':{'calleridnum':_0x7a971b[_0xbb49('0xd')],'VoiceQueueId':_0x2e2909['id']}});})['then'](function(_0x4ddcc7){if(!_[_0xbb49('0x1b')](_0x4ddcc7)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x7a971b[_0xbb49('0xd')]+_0xbb49('0x29')+_0x2e2909['id']);}return _0x340f49[_0xbb49('0x19')]['create']({'phone':_0x7a971b[_0xbb49('0xd')],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'priority':_0x7a971b[_0xbb49('0x20')]?_0x7a971b[_0xbb49('0x20')]:0x2,'scheduledat':_0x7a971b['scheduledat']?_0x7a971b['scheduledat']:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'callback':_0x7a971b[_0xbb49('0x24')]?!![]:![],'callbackuniqueid':_0x7a971b[_0xbb49('0x24')]?_0x7a971b[_0xbb49('0x24')]:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2e2909['id']});})[_0xbb49('0x25')](function(_0x397f9a){_0x7a53a2(_0x397f9a);});});};function _0x41fea0(){return function(_0xe29a1a){logger[_0xbb49('0x15')](_0xbb49('0x16'),'afterCreate',util[_0xbb49('0x18')](_0xe29a1a,{'showHidden':![],'depth':null}));};}var _0xb8a693=function(_0x3a3510){return new BPromise(function(_0x444f33,_0x2a8029){_0x340f49['CmHopper'][_0xbb49('0x28')]({'where':{'phone':_0x7a971b[_0xbb49('0xd')],'CampaignId':_0x3a3510['id']}})[_0xbb49('0x1a')](function(_0xddf7db){if(!_[_0xbb49('0x1b')](_0xddf7db)){throw new Error(_0xbb49('0x1c')+_0x7a971b[_0xbb49('0xd')]+_0xbb49('0x2a')+_0x3a3510['id']);}return _0x340f49[_0xbb49('0x19')][_0xbb49('0x1e')]({'phone':_0x7a971b['phone'],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'priority':_0x7a971b[_0xbb49('0x20')]?_0x7a971b['priority']:0x2,'scheduledat':_0x7a971b[_0xbb49('0x21')]?_0x7a971b['scheduledat']:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'callback':_0x7a971b[_0xbb49('0x24')]?!![]:![],'callbackuniqueid':_0x7a971b['callbackUniqueid']?_0x7a971b[_0xbb49('0x24')]:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()[_0xbb49('0x22')](_0xbb49('0x23')):undefined,'CampaignId':_0x3a3510['id']});})['catch'](function(_0x466ebf){_0x2a8029(_0x466ebf);});});};var _0x3a36c7=function(_0x5145c9){return new BPromise(function(_0x42a4a7,_0x18f62d){_0x340f49[_0xbb49('0x19')][_0xbb49('0x28')]({'where':{'phone':_0x7a971b['phone'],'CampaignId':_0x5145c9['id']}})[_0xbb49('0x1a')](function(_0x34657c){if(!_[_0xbb49('0x1b')](_0x34657c)){throw new Error(_0xbb49('0x1c')+_0x7a971b[_0xbb49('0xd')]+_0xbb49('0x2b')+_0x5145c9['id']);}return _0x340f49[_0xbb49('0x27')][_0xbb49('0x28')]({'where':{'calleridnum':_0x7a971b[_0xbb49('0xd')],'CampaignId':_0x5145c9['id']}});})['then'](function(_0x230ddf){if(!_[_0xbb49('0x1b')](_0x230ddf)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x7a971b[_0xbb49('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5145c9['id']);}return _0x340f49[_0xbb49('0x19')][_0xbb49('0x1e')]({'phone':_0x7a971b['phone'],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'priority':_0x7a971b['priority']?_0x7a971b[_0xbb49('0x20')]:0x2,'scheduledat':_0x7a971b[_0xbb49('0x21')]?_0x7a971b[_0xbb49('0x21')]:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'callback':_0x7a971b[_0xbb49('0x24')]?!![]:![],'callbackuniqueid':_0x7a971b['callbackUniqueid']?_0x7a971b['callbackUniqueid']:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()[_0xbb49('0x22')](_0xbb49('0x23')):undefined,'CampaignId':_0x5145c9['id']});})['catch'](function(_0xae148f){_0x18f62d(_0xae148f);});});};if(_0x7a971b[_0xbb49('0x1f')]){_0x340f49[_0xbb49('0x2c')]['findAll']({'where':{'type':_0xbb49('0x2d')},'attributes':['id',_0xbb49('0x2e')],'include':[{'model':_0x340f49[_0xbb49('0x2f')],'as':_0xbb49('0x30'),'where':{'id':_0x7a971b[_0xbb49('0x1f')]}}]})[_0xbb49('0x1a')](function(_0x47da34){if(_0x47da34){var _0x3502fe=[];for(var _0xf8abf5=0x0,_0x272a90;_0xf8abf5<_0x47da34[_0xbb49('0x31')];_0xf8abf5+=0x1){_0x272a90=_0x47da34[_0xf8abf5][_0xbb49('0x14')]({'plain':!![]});switch(_0x272a90[_0xbb49('0x2e')]){case _0xbb49('0x32'):_0x3029ac(_0x272a90)[_0xbb49('0x25')](_0x2ae134());break;case _0xbb49('0x33'):_0x22d8e9(_0x272a90)[_0xbb49('0x25')](_0x2ae134());break;default:_0x340f49[_0xbb49('0x19')][_0xbb49('0x1e')]({'phone':_0x7a971b['phone'],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b['ListId'],'scheduledat':_0x7a971b['scheduledat']?_0x7a971b['scheduledat']:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'priority':_0x7a971b[_0xbb49('0x20')]?_0x7a971b[_0xbb49('0x20')]:0x2,'callback':_0x7a971b[_0xbb49('0x24')]?!![]:![],'callbackuniqueid':_0x7a971b['callbackUniqueid']?_0x7a971b[_0xbb49('0x24')]:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()[_0xbb49('0x22')](_0xbb49('0x23')):undefined,'VoiceQueueId':_0x272a90['id']})[_0xbb49('0x25')](_0x2ae134());}}}})[_0xbb49('0x1a')](function(){return _0x340f49[_0xbb49('0x2c')][_0xbb49('0x34')]({'where':{'type':_0xbb49('0x2d')},'attributes':['id'],'include':[{'model':_0x340f49[_0xbb49('0x2f')],'as':_0xbb49('0x35'),'where':{'id':_0x7a971b[_0xbb49('0x1f')]}}]})['then'](function(_0x5bd0ce){if(_0x5bd0ce){var _0x5515ad=[];for(var _0x89b109=0x0,_0x5b68d7;_0x89b109<_0x5bd0ce[_0xbb49('0x31')];_0x89b109+=0x1){_0x5b68d7=_0x5bd0ce[_0x89b109][_0xbb49('0x14')]({'plain':!![]});_0x340f49['CmHopperBlack']['create']({'phone':_0x7a971b[_0xbb49('0xd')],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'VoiceQueueId':_0x5b68d7['id']})[_0xbb49('0x25')](function(_0x55c9a3){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x55c9a3['message']);});}}});})['then'](function(){return _0x340f49['Campaign'][_0xbb49('0x34')]({'attributes':['id',_0xbb49('0x2e')],'include':[{'model':_0x340f49[_0xbb49('0x2f')],'as':_0xbb49('0x30'),'where':{'id':_0x7a971b[_0xbb49('0x1f')]}}]})[_0xbb49('0x1a')](function(_0x7c1357){if(_0x7c1357){var _0x3436fd=[];for(var _0x46789e=0x0,_0xc37da8;_0x46789e<_0x7c1357[_0xbb49('0x31')];_0x46789e+=0x1){_0xc37da8=_0x7c1357[_0x46789e][_0xbb49('0x14')]({'plain':!![]});switch(_0xc37da8[_0xbb49('0x2e')]){case _0xbb49('0x32'):_0x3a36c7(_0xc37da8)[_0xbb49('0x25')](_0x41fea0());break;case _0xbb49('0x33'):_0xb8a693(_0xc37da8)[_0xbb49('0x25')](_0x41fea0());break;default:_0x340f49[_0xbb49('0x19')][_0xbb49('0x1e')]({'phone':_0x7a971b['phone'],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b[_0xbb49('0x1f')],'scheduledat':_0x7a971b[_0xbb49('0x21')]?_0x7a971b['scheduledat']:moment()[_0xbb49('0x22')](_0xbb49('0x23')),'priority':_0x7a971b[_0xbb49('0x20')]?_0x7a971b[_0xbb49('0x20')]:0x2,'callback':_0x7a971b[_0xbb49('0x24')]?!![]:![],'callbackuniqueid':_0x7a971b[_0xbb49('0x24')]?_0x7a971b[_0xbb49('0x24')]:undefined,'callbackat':_0x7a971b[_0xbb49('0x24')]?moment()[_0xbb49('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0xc37da8['id']})['catch'](_0x41fea0());}}}});})[_0xbb49('0x1a')](function(){return _0x340f49[_0xbb49('0x36')][_0xbb49('0x34')]({'attributes':['id'],'include':[{'model':_0x340f49['CmList'],'as':_0xbb49('0x35'),'where':{'id':_0x7a971b[_0xbb49('0x1f')]}}]})[_0xbb49('0x1a')](function(_0x4ade59){if(_0x4ade59){var _0x2bfd23=[];for(var _0x557b73=0x0,_0x5afd06;_0x557b73<_0x4ade59[_0xbb49('0x31')];_0x557b73+=0x1){_0x5afd06=_0x4ade59[_0x557b73]['get']({'plain':!![]});_0x340f49[_0xbb49('0x37')][_0xbb49('0x1e')]({'phone':_0x7a971b[_0xbb49('0xd')],'ContactId':_0x7a971b['id'],'ListId':_0x7a971b['ListId'],'CampaignId':_0x5afd06['id']})['catch'](function(_0x2b4105){logger['error'](_0xbb49('0x38'),_0xbb49('0x17'),_0x2b4105['message']);});}}});})[_0xbb49('0x1a')](function(){_0x247db5();})['catch'](function(_0x14738d){logger[_0xbb49('0x15')](_0xbb49('0x38'),'afterCreate',_0x14738d['message']);_0x247db5(_0x14738d);});}else{_0x247db5(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0xc49527,_0x16d24e,_0x25bfe4){var _0x32559f=_0x22efa4[_0xbb49('0x13')];var _0x2c51c1=_0xc49527['get']({'plain':!![]});return _0x32559f[_0xbb49('0x19')][_0xbb49('0x34')]({'raw':!![],'where':{'ListId':_0x2c51c1[_0xbb49('0x1f')],'ContactId':_0x2c51c1['id']}})[_0xbb49('0x1a')](function(_0x3a5c2a){if(!_[_0xbb49('0x39')](_0x3a5c2a)){var _0x2f9574=[];for(var _0x4d063c=0x0;_0x4d063c<_0x3a5c2a[_0xbb49('0x31')];_0x4d063c+=0x1){var _0x402ae3=_0x32559f[_0xbb49('0x19')][_0xbb49('0x3a')]({'where':{'ListId':_0x3a5c2a[_0x4d063c]['ListId'],'ContactId':_0x3a5c2a[_0x4d063c][_0xbb49('0x3b')],'VoiceQueueId':_0x3a5c2a[_0x4d063c]['VoiceQueueId'],'CampaignId':_0x3a5c2a[_0x4d063c]['CampaignId']}});_0x2f9574[_0xbb49('0x3c')](_0x402ae3);}return BPromise[_0xbb49('0x3d')](_0x2f9574);}})[_0xbb49('0x1a')](function(_0x39cdda){logger[_0xbb49('0x3e')](_0xbb49('0x3f'),util[_0xbb49('0x18')](_0x39cdda,{'showHidden':![],'depth':null}));_0x25bfe4();})[_0xbb49('0x25')](function(_0x466f3c){logger[_0xbb49('0x15')](_0xbb49('0x40'),util[_0xbb49('0x18')](_0x466f3c,{'showHidden':![],'depth':null}));_0x25bfe4(_0x466f3c);});}}});};
\ No newline at end of file
+var _0x4314=['\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','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','CmHopperFinal','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','always','outbound','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','Campaign','message','List\x20not\x20found','models','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','mobile','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','get','error','cmContact','afterCreate','inspect','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','create','ListId','priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x4314,0xe5));var _0x4431=function(_0x214d5b,_0x260ee7){_0x214d5b=_0x214d5b-0x0;var _0x3125db=_0x4314[_0x214d5b];return _0x3125db;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4431('0x0'))(_0x4431('0x1'));var moment=require(_0x4431('0x2'));var BPromise=require(_0x4431('0x3'));var rp=require(_0x4431('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4431('0x5'));var config=require(_0x4431('0x6'));var attributes=require(_0x4431('0x7'));module[_0x4431('0x8')]=function(_0x113e42,_0x121ecf){return _0x113e42[_0x4431('0x9')](_0x4431('0xa'),attributes,{'tableName':_0x4431('0xb'),'paranoid':!![],'indexes':[{'name':_0x4431('0xc'),'fields':[_0x4431('0xc')]},{'name':_0x4431('0xd'),'fields':['firstName',_0x4431('0xe'),_0x4431('0xc'),_0x4431('0xf'),_0x4431('0x10'),_0x4431('0x11')],'type':_0x4431('0x12')}],'timestamps':!![],'charset':_0x4431('0x13'),'collate':_0x4431('0x14'),'hooks':{'afterCreate':function(_0x37a771,_0x519bd0,_0x46d7c4){var _0xe5b9fc=_0x113e42['models'];var _0x539459=_0x37a771[_0x4431('0x15')]({'plain':!![]});function _0x21af6f(){return function(_0x24ea2b){logger[_0x4431('0x16')](_0x4431('0x17'),_0x4431('0x18'),util[_0x4431('0x19')](_0x24ea2b,{'showHidden':![],'depth':null}));};}var _0x4b079c=function(_0x4851e8){return new BPromise(function(_0x2f3aa4,_0x5d235a){_0xe5b9fc[_0x4431('0x1a')][_0x4431('0x1b')]({'where':{'phone':_0x539459[_0x4431('0xc')],'VoiceQueueId':_0x4851e8['id']}})[_0x4431('0x1c')](function(_0x36ff4e){if(!_[_0x4431('0x1d')](_0x36ff4e)){throw new Error(_0x4431('0x1e')+_0x539459[_0x4431('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4851e8['id']);}return _0xe5b9fc[_0x4431('0x1a')][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459[_0x4431('0x20')],'priority':_0x539459[_0x4431('0x21')]?_0x539459['priority']:0x2,'scheduledat':_0x539459[_0x4431('0x22')]?_0x539459['scheduledat']:moment()[_0x4431('0x23')](_0x4431('0x24')),'callback':_0x539459[_0x4431('0x25')]?!![]:![],'callbackuniqueid':_0x539459[_0x4431('0x25')]?_0x539459['callbackUniqueid']:undefined,'callbackat':_0x539459[_0x4431('0x25')]?moment()[_0x4431('0x23')](_0x4431('0x24')):undefined,'VoiceQueueId':_0x4851e8['id']});})[_0x4431('0x26')](function(_0x43a985){_0x5d235a(_0x43a985);});});};var _0x46cdb2=function(_0x413f9a){return new BPromise(function(_0x53ef82,_0x359457){_0xe5b9fc[_0x4431('0x1a')][_0x4431('0x1b')]({'where':{'phone':_0x539459['phone'],'VoiceQueueId':_0x413f9a['id']}})['then'](function(_0x1aacb9){if(!_['isNil'](_0x1aacb9)){throw new Error('cmContact,\x20afterCreate\x20'+_0x539459[_0x4431('0xc')]+_0x4431('0x27')+_0x413f9a['id']);}return _0xe5b9fc['CmHopperFinal'][_0x4431('0x1b')]({'where':{'calleridnum':_0x539459[_0x4431('0xc')],'VoiceQueueId':_0x413f9a['id']}});})[_0x4431('0x1c')](function(_0x480f71){if(!_[_0x4431('0x1d')](_0x480f71)){throw new Error(_0x4431('0x28')+_0x539459[_0x4431('0xc')]+_0x4431('0x29')+_0x413f9a['id']);}return _0xe5b9fc['CmHopper'][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459['ListId'],'priority':_0x539459['priority']?_0x539459[_0x4431('0x21')]:0x2,'scheduledat':_0x539459['scheduledat']?_0x539459[_0x4431('0x22')]:moment()[_0x4431('0x23')](_0x4431('0x24')),'callback':_0x539459[_0x4431('0x25')]?!![]:![],'callbackuniqueid':_0x539459[_0x4431('0x25')]?_0x539459['callbackUniqueid']:undefined,'callbackat':_0x539459[_0x4431('0x25')]?moment()['format'](_0x4431('0x24')):undefined,'VoiceQueueId':_0x413f9a['id']});})['catch'](function(_0x2c94e4){_0x359457(_0x2c94e4);});});};function _0x1e2311(){return function(_0x137352){logger[_0x4431('0x16')]('cmContact','afterCreate',util[_0x4431('0x19')](_0x137352,{'showHidden':![],'depth':null}));};}var _0x3c3b4f=function(_0x49aa23){return new BPromise(function(_0x9a5f3e,_0x56ffe7){_0xe5b9fc[_0x4431('0x1a')]['findOne']({'where':{'phone':_0x539459[_0x4431('0xc')],'CampaignId':_0x49aa23['id']}})['then'](function(_0x1d6ffd){if(!_['isNil'](_0x1d6ffd)){throw new Error('cmContact,\x20afterCreate\x20'+_0x539459[_0x4431('0xc')]+_0x4431('0x2a')+_0x49aa23['id']);}return _0xe5b9fc[_0x4431('0x1a')][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459['ListId'],'priority':_0x539459[_0x4431('0x21')]?_0x539459[_0x4431('0x21')]:0x2,'scheduledat':_0x539459[_0x4431('0x22')]?_0x539459['scheduledat']:moment()[_0x4431('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x539459[_0x4431('0x25')]?!![]:![],'callbackuniqueid':_0x539459[_0x4431('0x25')]?_0x539459['callbackUniqueid']:undefined,'callbackat':_0x539459[_0x4431('0x25')]?moment()[_0x4431('0x23')](_0x4431('0x24')):undefined,'CampaignId':_0x49aa23['id']});})['catch'](function(_0x27e926){_0x56ffe7(_0x27e926);});});};var _0x8c9387=function(_0x50467e){return new BPromise(function(_0x857cab,_0x695af){_0xe5b9fc[_0x4431('0x1a')]['findOne']({'where':{'phone':_0x539459[_0x4431('0xc')],'CampaignId':_0x50467e['id']}})[_0x4431('0x1c')](function(_0x41f8e9){if(!_[_0x4431('0x1d')](_0x41f8e9)){throw new Error(_0x4431('0x1e')+_0x539459[_0x4431('0xc')]+_0x4431('0x2b')+_0x50467e['id']);}return _0xe5b9fc[_0x4431('0x2c')][_0x4431('0x1b')]({'where':{'calleridnum':_0x539459[_0x4431('0xc')],'CampaignId':_0x50467e['id']}});})[_0x4431('0x1c')](function(_0x21db77){if(!_[_0x4431('0x1d')](_0x21db77)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x539459['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x50467e['id']);}return _0xe5b9fc['CmHopper']['create']({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459['ListId'],'priority':_0x539459[_0x4431('0x21')]?_0x539459[_0x4431('0x21')]:0x2,'scheduledat':_0x539459[_0x4431('0x22')]?_0x539459[_0x4431('0x22')]:moment()[_0x4431('0x23')](_0x4431('0x24')),'callback':_0x539459[_0x4431('0x25')]?!![]:![],'callbackuniqueid':_0x539459['callbackUniqueid']?_0x539459[_0x4431('0x25')]:undefined,'callbackat':_0x539459[_0x4431('0x25')]?moment()['format'](_0x4431('0x24')):undefined,'CampaignId':_0x50467e['id']});})[_0x4431('0x26')](function(_0xedafeb){_0x695af(_0xedafeb);});});};if(_0x539459[_0x4431('0x20')]){_0xe5b9fc[_0x4431('0x2d')][_0x4431('0x2e')]({'where':{'type':'outbound'},'attributes':['id',_0x4431('0x2f')],'include':[{'model':_0xe5b9fc[_0x4431('0x30')],'as':_0x4431('0x31'),'where':{'id':_0x539459[_0x4431('0x20')]}}]})['then'](function(_0x80052a){if(_0x80052a){var _0x424abf=[];for(var _0x31d017=0x0,_0x3dcf1f;_0x31d017<_0x80052a['length'];_0x31d017+=0x1){_0x3dcf1f=_0x80052a[_0x31d017][_0x4431('0x15')]({'plain':!![]});switch(_0x3dcf1f[_0x4431('0x2f')]){case _0x4431('0x32'):_0x46cdb2(_0x3dcf1f)[_0x4431('0x26')](_0x21af6f());break;case'onlyIfOpen':_0x4b079c(_0x3dcf1f)[_0x4431('0x26')](_0x21af6f());break;default:_0xe5b9fc[_0x4431('0x1a')][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459['ListId'],'scheduledat':_0x539459['scheduledat']?_0x539459[_0x4431('0x22')]:moment()[_0x4431('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x539459[_0x4431('0x21')]?_0x539459[_0x4431('0x21')]:0x2,'callback':_0x539459['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x539459[_0x4431('0x25')]?_0x539459[_0x4431('0x25')]:undefined,'callbackat':_0x539459['callbackUniqueid']?moment()['format'](_0x4431('0x24')):undefined,'VoiceQueueId':_0x3dcf1f['id']})['catch'](_0x21af6f());}}}})[_0x4431('0x1c')](function(){return _0xe5b9fc[_0x4431('0x2d')][_0x4431('0x2e')]({'where':{'type':_0x4431('0x33')},'attributes':['id'],'include':[{'model':_0xe5b9fc['CmList'],'as':_0x4431('0x34'),'where':{'id':_0x539459[_0x4431('0x20')]}}]})[_0x4431('0x1c')](function(_0x3c347b){if(_0x3c347b){var _0x5eea3d=[];for(var _0x28dd32=0x0,_0x296007;_0x28dd32<_0x3c347b[_0x4431('0x35')];_0x28dd32+=0x1){_0x296007=_0x3c347b[_0x28dd32]['get']({'plain':!![]});_0xe5b9fc[_0x4431('0x36')][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459[_0x4431('0x20')],'VoiceQueueId':_0x296007['id']})['catch'](function(_0x3c03bf){logger[_0x4431('0x16')](_0x4431('0x37'),_0x4431('0x18'),_0x3c03bf['message']);});}}});})[_0x4431('0x1c')](function(){return _0xe5b9fc[_0x4431('0x38')]['findAll']({'attributes':['id',_0x4431('0x2f')],'include':[{'model':_0xe5b9fc[_0x4431('0x30')],'as':_0x4431('0x31'),'where':{'id':_0x539459[_0x4431('0x20')]}}]})['then'](function(_0x4b2cb8){if(_0x4b2cb8){var _0x3bb7d2=[];for(var _0x48b183=0x0,_0x1ef6ae;_0x48b183<_0x4b2cb8[_0x4431('0x35')];_0x48b183+=0x1){_0x1ef6ae=_0x4b2cb8[_0x48b183][_0x4431('0x15')]({'plain':!![]});switch(_0x1ef6ae[_0x4431('0x2f')]){case'always':_0x8c9387(_0x1ef6ae)[_0x4431('0x26')](_0x1e2311());break;case'onlyIfOpen':_0x3c3b4f(_0x1ef6ae)[_0x4431('0x26')](_0x1e2311());break;default:_0xe5b9fc['CmHopper'][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459[_0x4431('0x20')],'scheduledat':_0x539459[_0x4431('0x22')]?_0x539459[_0x4431('0x22')]:moment()[_0x4431('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x539459['priority']?_0x539459[_0x4431('0x21')]:0x2,'callback':_0x539459['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x539459[_0x4431('0x25')]?_0x539459['callbackUniqueid']:undefined,'callbackat':_0x539459['callbackUniqueid']?moment()[_0x4431('0x23')](_0x4431('0x24')):undefined,'CampaignId':_0x1ef6ae['id']})[_0x4431('0x26')](_0x1e2311());}}}});})[_0x4431('0x1c')](function(){return _0xe5b9fc[_0x4431('0x38')][_0x4431('0x2e')]({'attributes':['id'],'include':[{'model':_0xe5b9fc['CmList'],'as':_0x4431('0x34'),'where':{'id':_0x539459[_0x4431('0x20')]}}]})[_0x4431('0x1c')](function(_0x22e771){if(_0x22e771){var _0x130a5a=[];for(var _0x4384e5=0x0,_0x1e684e;_0x4384e5<_0x22e771[_0x4431('0x35')];_0x4384e5+=0x1){_0x1e684e=_0x22e771[_0x4384e5][_0x4431('0x15')]({'plain':!![]});_0xe5b9fc[_0x4431('0x36')][_0x4431('0x1f')]({'phone':_0x539459[_0x4431('0xc')],'ContactId':_0x539459['id'],'ListId':_0x539459[_0x4431('0x20')],'CampaignId':_0x1e684e['id']})[_0x4431('0x26')](function(_0x474f83){logger['error']('cmContact,\x20%s,\x20%s',_0x4431('0x18'),_0x474f83[_0x4431('0x39')]);});}}});})[_0x4431('0x1c')](function(){_0x46d7c4();})[_0x4431('0x26')](function(_0x1b6b45){logger[_0x4431('0x16')](_0x4431('0x37'),_0x4431('0x18'),_0x1b6b45[_0x4431('0x39')]);_0x46d7c4(_0x1b6b45);});}else{_0x46d7c4(new Error(_0x4431('0x3a')));}},'afterDestroy':function(_0x2826dd,_0x7deefe,_0x461204){var _0x430b7c=_0x113e42[_0x4431('0x3b')];var _0x35a6d0=_0x2826dd[_0x4431('0x15')]({'plain':!![]});return _0x430b7c[_0x4431('0x1a')][_0x4431('0x2e')]({'raw':!![],'where':{'ListId':_0x35a6d0[_0x4431('0x20')],'ContactId':_0x35a6d0['id']}})[_0x4431('0x1c')](function(_0x1d2bad){if(!_['isEmpty'](_0x1d2bad)){var _0x54b9cd=[];for(var _0x5d6271=0x0;_0x5d6271<_0x1d2bad[_0x4431('0x35')];_0x5d6271+=0x1){var _0x18d2a1=_0x430b7c['CmHopper']['destroy']({'where':{'ListId':_0x1d2bad[_0x5d6271]['ListId'],'ContactId':_0x1d2bad[_0x5d6271][_0x4431('0x3c')],'VoiceQueueId':_0x1d2bad[_0x5d6271][_0x4431('0x3d')],'CampaignId':_0x1d2bad[_0x5d6271][_0x4431('0x3e')]}});_0x54b9cd[_0x4431('0x3f')](_0x18d2a1);}return BPromise[_0x4431('0x40')](_0x54b9cd);}})[_0x4431('0x1c')](function(_0x535784){logger[_0x4431('0x41')](_0x4431('0x42'),util[_0x4431('0x19')](_0x535784,{'showHidden':![],'depth':null}));_0x461204();})[_0x4431('0x26')](function(_0x23c8ab){logger['error']('[CmContact][afterDestroy][Error]',util[_0x4431('0x19')](_0x23c8ab,{'showHidden':![],'depth':null}));_0x461204(_0x23c8ab);});}}});};
\ No newline at end of file
index c14cc39..b802e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d8=['register','then','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContact,\x20%s,\x20%s','message','info','GetCmContact','options','raw','where','limit','include','map','model','attributes','CreateCmContact','CmContact','create','body','keys','startsWith','cf_','update','table','cm_contacts','set','id\x20=\x20?','sequelize','query','catch','lodash','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./cmContact.socket'];(function(_0x3eaa5f,_0x29e5e0){var _0x1ed2b2=function(_0x53b7af){while(--_0x53b7af){_0x3eaa5f['push'](_0x3eaa5f['shift']());}};_0x1ed2b2(++_0x29e5e0);}(_0xa6d8,0xeb));var _0x8a6d=function(_0x2862b1,_0x51a367){_0x2862b1=_0x2862b1-0x0;var _0x817ee6=_0xa6d8[_0x2862b1];return _0x817ee6;};'use strict';var _=require(_0x8a6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a6d('0x1'));var rs=require(_0x8a6d('0x2'));var fs=require('fs');var Redis=require(_0x8a6d('0x3'));var squel=require(_0x8a6d('0x4'));var db=require(_0x8a6d('0x5'))['db'];var utils=require(_0x8a6d('0x6'));var logger=require(_0x8a6d('0x7'))(_0x8a6d('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a6d('0x9'));var client=jayson['client'][_0x8a6d('0xa')]({'port':0x232a});config[_0x8a6d('0xb')]=_[_0x8a6d('0xc')](config['redis'],{'host':_0x8a6d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a6d('0xb')]));require(_0x8a6d('0xe'))[_0x8a6d('0xf')](socket);function respondWithRpcPromise(_0x2e4869,_0x89be53,_0x2d24d4){return new BPromise(function(_0x49f41c,_0x82caf3){return client['request'](_0x2e4869,_0x2d24d4)[_0x8a6d('0x10')](function(_0x239f48){logger['info']('CmContact,\x20%s,\x20%s',_0x89be53,_0x8a6d('0x11'));logger[_0x8a6d('0x12')](_0x8a6d('0x13'),_0x89be53,_0x8a6d('0x11'),JSON[_0x8a6d('0x14')](_0x239f48));if(_0x239f48[_0x8a6d('0x15')]){if(_0x239f48[_0x8a6d('0x15')][_0x8a6d('0x16')]===0x1f4){logger[_0x8a6d('0x15')](_0x8a6d('0x17'),_0x89be53,_0x239f48['error'][_0x8a6d('0x18')]);return _0x82caf3(_0x239f48[_0x8a6d('0x15')][_0x8a6d('0x18')]);}logger[_0x8a6d('0x15')](_0x8a6d('0x17'),_0x89be53,_0x239f48[_0x8a6d('0x15')]['message']);return _0x49f41c(_0x239f48[_0x8a6d('0x15')][_0x8a6d('0x18')]);}else{logger[_0x8a6d('0x19')](_0x8a6d('0x17'),_0x89be53,_0x8a6d('0x11'));_0x49f41c(_0x239f48['result'][_0x8a6d('0x18')]);}})['catch'](function(_0x5b07ec){logger[_0x8a6d('0x15')](_0x8a6d('0x17'),_0x89be53,_0x5b07ec);_0x82caf3(_0x5b07ec);});});}exports[_0x8a6d('0x1a')]=function(_0x53c1f7){var _0x322774=this;return new Promise(function(_0x2fc109,_0x4be0a9){return db['CmContact']['findAll']({'raw':_0x53c1f7[_0x8a6d('0x1b')]?_0x53c1f7[_0x8a6d('0x1b')][_0x8a6d('0x1c')]===undefined?!![]:![]:!![],'where':_0x53c1f7[_0x8a6d('0x1b')]?_0x53c1f7[_0x8a6d('0x1b')][_0x8a6d('0x1d')]||null:null,'attributes':_0x53c1f7[_0x8a6d('0x1b')]?_0x53c1f7[_0x8a6d('0x1b')]['attributes']||null:null,'limit':_0x53c1f7['options']?_0x53c1f7[_0x8a6d('0x1b')][_0x8a6d('0x1e')]||null:null,'include':_0x53c1f7[_0x8a6d('0x1b')]?_0x53c1f7[_0x8a6d('0x1b')][_0x8a6d('0x1f')]?_[_0x8a6d('0x20')](_0x53c1f7['options'][_0x8a6d('0x1f')],function(_0x2ff9d2){return{'model':db[_0x2ff9d2[_0x8a6d('0x21')]],'as':_0x2ff9d2['as'],'attributes':_0x2ff9d2['attributes'],'include':_0x2ff9d2[_0x8a6d('0x1f')]?_[_0x8a6d('0x20')](_0x2ff9d2[_0x8a6d('0x1f')],function(_0x9f15b8){return{'model':db[_0x9f15b8[_0x8a6d('0x21')]],'as':_0x9f15b8['as'],'attributes':_0x9f15b8[_0x8a6d('0x22')],'include':_0x9f15b8['include']?_[_0x8a6d('0x20')](_0x9f15b8[_0x8a6d('0x1f')],function(_0x2c5945){return{'model':db[_0x2c5945[_0x8a6d('0x21')]],'as':_0x2c5945['as'],'attributes':_0x2c5945[_0x8a6d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8a6d('0x10')](function(_0x10998b){logger[_0x8a6d('0x19')](_0x8a6d('0x1a'),_0x53c1f7);logger[_0x8a6d('0x12')](_0x8a6d('0x1a'),_0x53c1f7,JSON[_0x8a6d('0x14')](_0x10998b));_0x2fc109(_0x10998b);})['catch'](function(_0x39295e){logger['error'](_0x8a6d('0x1a'),_0x39295e[_0x8a6d('0x18')],_0x53c1f7);_0x4be0a9(_0x322774['error'](0x1f4,_0x39295e['message']));});});};exports[_0x8a6d('0x23')]=function(_0x6459ce){var _0x2b9418=this;return new Promise(function(_0x5c93f8,_0x2b0bf9){return db[_0x8a6d('0x24')][_0x8a6d('0x25')](_0x6459ce[_0x8a6d('0x26')],{'raw':_0x6459ce[_0x8a6d('0x1b')]?_0x6459ce[_0x8a6d('0x1b')][_0x8a6d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2f2d00){var _0x4ab798;for(var _0x52debf=0x0;_0x52debf<Object[_0x8a6d('0x27')](_0x6459ce['body'])['length'];_0x52debf++){var _0xa29cab=Object['keys'](_0x6459ce[_0x8a6d('0x26')])[_0x52debf];if(_0xa29cab[_0x8a6d('0x28')](_0x8a6d('0x29'))){_0x4ab798=squel[_0x8a6d('0x2a')]()[_0x8a6d('0x2b')](_0x8a6d('0x2c'))[_0x8a6d('0x2d')](_0xa29cab,_0x6459ce['body'][_0xa29cab])[_0x8a6d('0x1d')](_0x8a6d('0x2e'),_0x2f2d00['id'])['toString']();break;}}if(!_0x4ab798)return _0x2f2d00;return db[_0x8a6d('0x2f')][_0x8a6d('0x30')](_0x4ab798)[_0x8a6d('0x10')](function(){return _0x2f2d00;});})['then'](function(_0xc63412){logger[_0x8a6d('0x19')](_0x8a6d('0x23'),_0x6459ce);logger[_0x8a6d('0x12')](_0x8a6d('0x23'),_0x6459ce,JSON['stringify'](_0xc63412));_0x5c93f8(_0xc63412);})[_0x8a6d('0x31')](function(_0xe6422b){logger[_0x8a6d('0x15')](_0x8a6d('0x23'),_0xe6422b[_0x8a6d('0x18')],_0x6459ce);_0x2b0bf9(_0x2b9418[_0x8a6d('0x15')](0x1f4,_0xe6422b['message']));});});};
\ No newline at end of file
+var _0xdc8c=['request\x20sent','stringify','error','message','info','catch','options','raw','where','attributes','limit','include','model','map','GetCmContact','CreateCmContact','CmContact','body','startsWith','cf_','update','cm_contacts','set','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s'];(function(_0x22e2c5,_0x115b33){var _0x19e58d=function(_0x11f4ea){while(--_0x11f4ea){_0x22e2c5['push'](_0x22e2c5['shift']());}};_0x19e58d(++_0x115b33);}(_0xdc8c,0xeb));var _0xcdc8=function(_0x1fcaf3,_0x2b922e){_0x1fcaf3=_0x1fcaf3-0x0;var _0x264641=_0xdc8c[_0x1fcaf3];return _0x264641;};'use strict';var _=require(_0xcdc8('0x0'));var util=require(_0xcdc8('0x1'));var moment=require(_0xcdc8('0x2'));var BPromise=require(_0xcdc8('0x3'));var rs=require(_0xcdc8('0x4'));var fs=require('fs');var Redis=require(_0xcdc8('0x5'));var squel=require('squel');var db=require(_0xcdc8('0x6'))['db'];var utils=require(_0xcdc8('0x7'));var logger=require(_0xcdc8('0x8'))(_0xcdc8('0x9'));var config=require(_0xcdc8('0xa'));var jayson=require(_0xcdc8('0xb'));var client=jayson[_0xcdc8('0xc')][_0xcdc8('0xd')]({'port':0x232a});config[_0xcdc8('0xe')]=_[_0xcdc8('0xf')](config['redis'],{'host':_0xcdc8('0x10'),'port':0x18eb});var socket=require(_0xcdc8('0x11'))(new Redis(config[_0xcdc8('0xe')]));require(_0xcdc8('0x12'))[_0xcdc8('0x13')](socket);function respondWithRpcPromise(_0x401149,_0x41b377,_0x3bea65){return new BPromise(function(_0x53ebc5,_0x591537){return client[_0xcdc8('0x14')](_0x401149,_0x3bea65)[_0xcdc8('0x15')](function(_0x4e9f06){logger['info'](_0xcdc8('0x16'),_0x41b377,'request\x20sent');logger[_0xcdc8('0x17')](_0xcdc8('0x18'),_0x41b377,_0xcdc8('0x19'),JSON[_0xcdc8('0x1a')](_0x4e9f06));if(_0x4e9f06[_0xcdc8('0x1b')]){if(_0x4e9f06[_0xcdc8('0x1b')]['code']===0x1f4){logger['error'](_0xcdc8('0x16'),_0x41b377,_0x4e9f06[_0xcdc8('0x1b')][_0xcdc8('0x1c')]);return _0x591537(_0x4e9f06['error']['message']);}logger[_0xcdc8('0x1b')]('CmContact,\x20%s,\x20%s',_0x41b377,_0x4e9f06[_0xcdc8('0x1b')]['message']);return _0x53ebc5(_0x4e9f06[_0xcdc8('0x1b')]['message']);}else{logger[_0xcdc8('0x1d')]('CmContact,\x20%s,\x20%s',_0x41b377,_0xcdc8('0x19'));_0x53ebc5(_0x4e9f06['result'][_0xcdc8('0x1c')]);}})[_0xcdc8('0x1e')](function(_0x39c95f){logger['error']('CmContact,\x20%s,\x20%s',_0x41b377,_0x39c95f);_0x591537(_0x39c95f);});});}exports['GetCmContact']=function(_0x32b580){var _0x3778f5=this;return new Promise(function(_0x5103c2,_0x28b73d){return db['CmContact']['findAll']({'raw':_0x32b580['options']?_0x32b580[_0xcdc8('0x1f')][_0xcdc8('0x20')]===undefined?!![]:![]:!![],'where':_0x32b580[_0xcdc8('0x1f')]?_0x32b580[_0xcdc8('0x1f')][_0xcdc8('0x21')]||null:null,'attributes':_0x32b580['options']?_0x32b580[_0xcdc8('0x1f')][_0xcdc8('0x22')]||null:null,'limit':_0x32b580[_0xcdc8('0x1f')]?_0x32b580[_0xcdc8('0x1f')][_0xcdc8('0x23')]||null:null,'include':_0x32b580['options']?_0x32b580[_0xcdc8('0x1f')][_0xcdc8('0x24')]?_['map'](_0x32b580['options'][_0xcdc8('0x24')],function(_0x4f9560){return{'model':db[_0x4f9560[_0xcdc8('0x25')]],'as':_0x4f9560['as'],'attributes':_0x4f9560['attributes'],'include':_0x4f9560[_0xcdc8('0x24')]?_['map'](_0x4f9560[_0xcdc8('0x24')],function(_0x4766b2){return{'model':db[_0x4766b2[_0xcdc8('0x25')]],'as':_0x4766b2['as'],'attributes':_0x4766b2[_0xcdc8('0x22')],'include':_0x4766b2[_0xcdc8('0x24')]?_[_0xcdc8('0x26')](_0x4766b2[_0xcdc8('0x24')],function(_0x4d52e5){return{'model':db[_0x4d52e5['model']],'as':_0x4d52e5['as'],'attributes':_0x4d52e5['attributes']};}):[]};}):[]};}):[]:[]})[_0xcdc8('0x15')](function(_0x262c9a){logger[_0xcdc8('0x1d')](_0xcdc8('0x27'),_0x32b580);logger[_0xcdc8('0x17')]('GetCmContact',_0x32b580,JSON['stringify'](_0x262c9a));_0x5103c2(_0x262c9a);})[_0xcdc8('0x1e')](function(_0x38e876){logger[_0xcdc8('0x1b')](_0xcdc8('0x27'),_0x38e876[_0xcdc8('0x1c')],_0x32b580);_0x28b73d(_0x3778f5[_0xcdc8('0x1b')](0x1f4,_0x38e876[_0xcdc8('0x1c')]));});});};exports[_0xcdc8('0x28')]=function(_0x3ce84d){var _0x59cf69=this;return new Promise(function(_0x44eb5a,_0x4fbf57){return db[_0xcdc8('0x29')]['create'](_0x3ce84d[_0xcdc8('0x2a')],{'raw':_0x3ce84d[_0xcdc8('0x1f')]?_0x3ce84d['options']['raw']===undefined?!![]:![]:!![]})[_0xcdc8('0x15')](function(_0x34ff83){var _0x51d355;for(var _0x3e71e4=0x0;_0x3e71e4<Object['keys'](_0x3ce84d['body'])['length'];_0x3e71e4++){var _0x2eba0f=Object['keys'](_0x3ce84d[_0xcdc8('0x2a')])[_0x3e71e4];if(_0x2eba0f[_0xcdc8('0x2b')](_0xcdc8('0x2c'))){_0x51d355=squel[_0xcdc8('0x2d')]()['table'](_0xcdc8('0x2e'))[_0xcdc8('0x2f')](_0x2eba0f,_0x3ce84d['body'][_0x2eba0f])[_0xcdc8('0x21')](_0xcdc8('0x30'),_0x34ff83['id'])[_0xcdc8('0x31')]();break;}}if(!_0x51d355)return _0x34ff83;return db[_0xcdc8('0x32')][_0xcdc8('0x33')](_0x51d355)['then'](function(){return _0x34ff83;});})[_0xcdc8('0x15')](function(_0xdc457){logger[_0xcdc8('0x1d')](_0xcdc8('0x28'),_0x3ce84d);logger['debug'](_0xcdc8('0x28'),_0x3ce84d,JSON[_0xcdc8('0x1a')](_0xdc457));_0x44eb5a(_0xdc457);})[_0xcdc8('0x1e')](function(_0x1258c0){logger['error'](_0xcdc8('0x28'),_0x1258c0[_0xcdc8('0x1c')],_0x3ce84d);_0x4fbf57(_0x59cf69[_0xcdc8('0x1b')](0x1f4,_0x1258c0[_0xcdc8('0x1c')]));});});};
\ No newline at end of file
index 1a362aa..85fed86 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 d615c4d..fcd6cd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa90e=['/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','extname','now','/csv','single','file','uploadCsv','/upload','upload','/upload/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get'];(function(_0x52969d,_0xe22051){var _0x2a27bd=function(_0x381578){while(--_0x381578){_0x52969d['push'](_0x52969d['shift']());}};_0x2a27bd(++_0xe22051);}(_0xa90e,0x89));var _0xea90=function(_0xd98ce4,_0x2a9a9d){_0xd98ce4=_0xd98ce4-0x0;var _0x4dfc16=_0xa90e[_0xd98ce4];return _0x4dfc16;};'use strict';var multer=require(_0xea90('0x0'));var util=require(_0xea90('0x1'));var path=require(_0xea90('0x2'));var timeout=require(_0xea90('0x3'));var express=require(_0xea90('0x4'));var router=express[_0xea90('0x5')]();var fs_extra=require(_0xea90('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xea90('0x7'));var config=require(_0xea90('0x8'));var controller=require(_0xea90('0x9'));router['get']('/',auth[_0xea90('0xa')](),controller[_0xea90('0xb')]);router[_0xea90('0xc')]('/describe',auth[_0xea90('0xa')](),controller['describe']);router['get'](_0xea90('0xd'),auth[_0xea90('0xa')](),controller['show']);router[_0xea90('0xc')](_0xea90('0xe'),auth[_0xea90('0xa')](),controller[_0xea90('0xf')]);router['get'](_0xea90('0x10'),auth[_0xea90('0xa')](),controller[_0xea90('0x11')]);router[_0xea90('0xc')](_0xea90('0x12'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xea90('0xc')](_0xea90('0x13'),auth['isAuthenticated'](),controller[_0xea90('0x14')]);router[_0xea90('0xc')](_0xea90('0x15'),auth[_0xea90('0xa')](),controller[_0xea90('0x16')]);router[_0xea90('0xc')](_0xea90('0x17'),auth[_0xea90('0xa')](),controller[_0xea90('0x18')]);router['post'](_0xea90('0x19'),auth[_0xea90('0xa')](),controller[_0xea90('0x1a')]);router[_0xea90('0x1b')]('/',auth[_0xea90('0xa')](),controller[_0xea90('0x1c')]);router['post'](_0xea90('0x1d'),auth['isAuthenticated'](),controller[_0xea90('0x1e')]);router[_0xea90('0x1b')](_0xea90('0xe'),auth['isAuthenticated'](),controller[_0xea90('0x1f')]);var upload=multer({'storage':multer[_0xea90('0x20')]({'destination':function(_0x588096,_0x88338e,_0x3185ce){_0x3185ce(null,path[_0xea90('0x21')](config[_0xea90('0x22')],_0xea90('0x23')));},'filename':function(_0x143b12,_0x1b784b,_0x193b4d){_0x1b784b[_0xea90('0x24')]=_0x1b784b[_0xea90('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x193b4d(null,util[_0xea90('0x25')](_0xea90('0x26'),path['basename'](_0x1b784b[_0xea90('0x24')],path[_0xea90('0x27')](_0x1b784b[_0xea90('0x24')])),Date[_0xea90('0x28')](),path[_0xea90('0x27')](_0x1b784b[_0xea90('0x24')])));}})});router[_0xea90('0x1b')](_0xea90('0x29'),upload[_0xea90('0x2a')](_0xea90('0x2b')),controller[_0xea90('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x49b555,_0x335305,_0x420442){_0x420442(null,path[_0xea90('0x21')](config['root'],_0xea90('0x23')));},'filename':function(_0x2c8a9f,_0x17f4c8,_0x322978){_0x17f4c8['originalname']=_0x17f4c8[_0xea90('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x322978(null,util['format']('%s-%s%s',path['basename'](_0x17f4c8['originalname'],path[_0xea90('0x27')](_0x17f4c8[_0xea90('0x24')])),Date[_0xea90('0x28')](),path[_0xea90('0x27')](_0x17f4c8[_0xea90('0x24')])));}})});router[_0xea90('0x1b')](_0xea90('0x2d'),upload[_0xea90('0x2a')](_0xea90('0x2b')),controller[_0xea90('0x2e')]);router[_0xea90('0x1b')](_0xea90('0x2f'),auth[_0xea90('0xa')](),controller['import']);router['put'](_0xea90('0xd'),auth[_0xea90('0xa')](),controller['update']);router[_0xea90('0x30')]('/:id',auth[_0xea90('0xa')](),controller[_0xea90('0x31')]);module['exports']=router;
\ No newline at end of file
+var _0xa2bb=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','format','%s-%s%s','now','single','uploadCsv','replace','basename','extname','/upload','file','upload','import','put','update','delete'];(function(_0x20e6f2,_0x3ba024){var _0x885af8=function(_0xfa012b){while(--_0xfa012b){_0x20e6f2['push'](_0x20e6f2['shift']());}};_0x885af8(++_0x3ba024);}(_0xa2bb,0x146));var _0xba2b=function(_0x457fd6,_0x4b1ffe){_0x457fd6=_0x457fd6-0x0;var _0x496897=_0xa2bb[_0x457fd6];return _0x496897;};'use strict';var multer=require('multer');var util=require(_0xba2b('0x0'));var path=require(_0xba2b('0x1'));var timeout=require(_0xba2b('0x2'));var express=require(_0xba2b('0x3'));var router=express[_0xba2b('0x4')]();var fs_extra=require(_0xba2b('0x5'));var auth=require(_0xba2b('0x6'));var interaction=require(_0xba2b('0x7'));var config=require(_0xba2b('0x8'));var controller=require(_0xba2b('0x9'));router[_0xba2b('0xa')]('/',auth[_0xba2b('0xb')](),controller['index']);router[_0xba2b('0xa')]('/describe',auth[_0xba2b('0xb')](),controller[_0xba2b('0xc')]);router[_0xba2b('0xa')](_0xba2b('0xd'),auth[_0xba2b('0xb')](),controller['show']);router[_0xba2b('0xa')](_0xba2b('0xe'),auth['isAuthenticated'](),controller[_0xba2b('0xf')]);router['get'](_0xba2b('0x10'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x11')]);router[_0xba2b('0xa')](_0xba2b('0x12'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x13')]);router['get'](_0xba2b('0x14'),auth['isAuthenticated'](),controller[_0xba2b('0x15')]);router[_0xba2b('0xa')](_0xba2b('0x16'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x17')]);router[_0xba2b('0xa')](_0xba2b('0x18'),auth[_0xba2b('0xb')](),controller['getJourney']);router[_0xba2b('0x19')](_0xba2b('0x1a'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x1b')]);router[_0xba2b('0x19')]('/',auth[_0xba2b('0xb')](),controller[_0xba2b('0x1c')]);router[_0xba2b('0x19')](_0xba2b('0x1d'),auth['isAuthenticated'](),controller[_0xba2b('0x1e')]);router[_0xba2b('0x19')](_0xba2b('0xe'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x1f')]);var upload=multer({'storage':multer[_0xba2b('0x20')]({'destination':function(_0xa986e7,_0x5be043,_0x3d322a){_0x3d322a(null,path[_0xba2b('0x21')](config[_0xba2b('0x22')],_0xba2b('0x23')));},'filename':function(_0x53f95e,_0x531956,_0x3ba88a){_0x531956[_0xba2b('0x24')]=_0x531956[_0xba2b('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ba88a(null,util[_0xba2b('0x25')](_0xba2b('0x26'),path['basename'](_0x531956[_0xba2b('0x24')],path['extname'](_0x531956[_0xba2b('0x24')])),Date[_0xba2b('0x27')](),path['extname'](_0x531956[_0xba2b('0x24')])));}})});router[_0xba2b('0x19')]('/csv',upload[_0xba2b('0x28')]('file'),controller[_0xba2b('0x29')]);var upload=multer({'storage':multer[_0xba2b('0x20')]({'destination':function(_0x1019e0,_0x2c5d73,_0x320f86){_0x320f86(null,path['join'](config[_0xba2b('0x22')],'server/files/tmp'));},'filename':function(_0x560f37,_0x2e5314,_0x5c120b){_0x2e5314[_0xba2b('0x24')]=_0x2e5314[_0xba2b('0x24')][_0xba2b('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c120b(null,util[_0xba2b('0x25')]('%s-%s%s',path[_0xba2b('0x2b')](_0x2e5314[_0xba2b('0x24')],path[_0xba2b('0x2c')](_0x2e5314[_0xba2b('0x24')])),Date['now'](),path[_0xba2b('0x2c')](_0x2e5314[_0xba2b('0x24')])));}})});router[_0xba2b('0x19')](_0xba2b('0x2d'),upload[_0xba2b('0x28')](_0xba2b('0x2e')),controller[_0xba2b('0x2f')]);router[_0xba2b('0x19')]('/upload/:id',auth['isAuthenticated'](),controller[_0xba2b('0x30')]);router[_0xba2b('0x31')](_0xba2b('0xd'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x32')]);router[_0xba2b('0x33')](_0xba2b('0xd'),auth[_0xba2b('0xb')](),controller[_0xba2b('0x34')]);module[_0xba2b('0x35')]=router;
\ No newline at end of file
index da746b3..6df7706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x487b=['sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','parse','values','isArray','BOOLEAN','ENUM','voice'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x487b,0x19e));var _0xb487=function(_0x351145,_0x574f81){_0x351145=_0x351145-0x0;var _0xc4db5d=_0x487b[_0x351145];return _0xc4db5d;};'use strict';var Sequelize=require(_0xb487('0x0'));var _=require(_0xb487('0x1'));module[_0xb487('0x2')]={'name':{'type':Sequelize[_0xb487('0x3')],'get':function(_0x5aba2d){return this[_0xb487('0x4')]('alias');}},'alias':{'type':Sequelize[_0xb487('0x5')],'allowNull':![],'set':function(_0x33c224){this[_0xb487('0x6')](_0xb487('0x7'),_0x33c224?_0x33c224:this[_0xb487('0x4')](_0xb487('0x8')));}},'type':{'type':Sequelize[_0xb487('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb487('0x9')]('long'),'get':function(){if(this['getDataValue'](_0xb487('0xa'))===_0xb487('0xb')){return JSON[_0xb487('0xc')](this[_0xb487('0x4')]('values'));}else{return this[_0xb487('0x4')](_0xb487('0xd'));}},'set':function(_0x19abe3){if(Array[_0xb487('0xe')](_0x19abe3)){this[_0xb487('0x6')]('values',JSON['stringify'](_0x19abe3));}else{this[_0xb487('0x6')](_0xb487('0xd'),_0x19abe3);}}},'required':{'type':Sequelize[_0xb487('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb487('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xb487('0x10')](_0xb487('0x11'))}};
\ No newline at end of file
+var _0x191f=['exports','alias','STRING','getDataValue','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize'];(function(_0x18efc2,_0x35d1cb){var _0x2a92a7=function(_0x11b2ec){while(--_0x11b2ec){_0x18efc2['push'](_0x18efc2['shift']());}};_0x2a92a7(++_0x35d1cb);}(_0x191f,0xe0));var _0xf191=function(_0x9ece6,_0x2419cf){_0x9ece6=_0x9ece6-0x0;var _0x5a8248=_0x191f[_0x9ece6];return _0x5a8248;};'use strict';var Sequelize=require(_0xf191('0x0'));var _=require('lodash');module[_0xf191('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4468d6){return this['getDataValue'](_0xf191('0x2'));}},'alias':{'type':Sequelize[_0xf191('0x3')],'allowNull':![],'set':function(_0x342e89){this['setDataValue'](_0xf191('0x2'),_0x342e89?_0x342e89:this[_0xf191('0x4')]('name'));}},'type':{'type':Sequelize[_0xf191('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xf191('0x4')](_0xf191('0x5'))===_0xf191('0x6')){return JSON[_0xf191('0x7')](this['getDataValue']('values'));}else{return this[_0xf191('0x4')](_0xf191('0x8'));}},'set':function(_0x1fa3e0){if(Array[_0xf191('0x9')](_0x1fa3e0)){this[_0xf191('0xa')](_0xf191('0x8'),JSON[_0xf191('0xb')](_0x1fa3e0));}else{this['setDataValue'](_0xf191('0x8'),_0x1fa3e0);}}},'required':{'type':Sequelize[_0xf191('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf191('0xd')](_0xf191('0xe'))}};
\ No newline at end of file
index 030fa64..97203e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ea=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','name','send','index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','body','transaction','create','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x49d236,_0x4998f4){var _0x57dd2b=function(_0x1127eb){while(--_0x1127eb){_0x49d236['push'](_0x49d236['shift']());}};_0x57dd2b(++_0x4998f4);}(_0x06ea,0x9b));var _0xa06e=function(_0x3121ee,_0x1fb011){_0x3121ee=_0x3121ee-0x0;var _0x55b96c=_0x06ea[_0x3121ee];return _0x55b96c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa06e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa06e('0x1'));var BPromise=require(_0xa06e('0x2'));var Mustache=require(_0xa06e('0x3'));var util=require(_0xa06e('0x4'));var path=require(_0xa06e('0x5'));var sox=require(_0xa06e('0x6'));var csv=require(_0xa06e('0x7'));var ejs=require(_0xa06e('0x8'));var fs=require('fs');var fs_extra=require(_0xa06e('0x9'));var _=require(_0xa06e('0xa'));var squel=require('squel');var crypto=require(_0xa06e('0xb'));var jsforce=require(_0xa06e('0xc'));var deskjs=require(_0xa06e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa06e('0xe'));var Redis=require(_0xa06e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa06e('0x10'));var as=require(_0xa06e('0x11'));var hardwareService=require(_0xa06e('0x12'));var logger=require(_0xa06e('0x13'))(_0xa06e('0x14'));var utils=require(_0xa06e('0x15'));var config=require(_0xa06e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa06e('0x17'))['db'];function respondWithStatusCode(_0x151f41,_0x21ecc6){_0x21ecc6=_0x21ecc6||0xcc;return function(_0x1876d1){if(_0x1876d1){return _0x151f41[_0xa06e('0x18')](_0x21ecc6);}return _0x151f41[_0xa06e('0x19')](_0x21ecc6)[_0xa06e('0x1a')]();};}function respondWithResult(_0x22f987,_0x5ee41e){_0x5ee41e=_0x5ee41e||0xc8;return function(_0x1f056d){if(_0x1f056d){return _0x22f987[_0xa06e('0x19')](_0x5ee41e)['json'](_0x1f056d);}};}function respondWithFilteredResult(_0x22fbca,_0x118d69){return function(_0x323f21){if(_0x323f21){var _0x2a21d6=typeof _0x118d69[_0xa06e('0x1b')]==='undefined'&&typeof _0x118d69[_0xa06e('0x1c')]===_0xa06e('0x1d');var _0x3a60eb=_0x323f21[_0xa06e('0x1e')];var _0x3f2800=_0x2a21d6?0x0:_0x118d69[_0xa06e('0x1b')];var _0x118abd=_0x2a21d6?_0x323f21['count']:_0x118d69[_0xa06e('0x1b')]+_0x118d69['limit'];var _0x4b1ed2;if(_0x118abd>=_0x3a60eb){_0x118abd=_0x3a60eb;_0x4b1ed2=0xc8;}else{_0x4b1ed2=0xce;}_0x22fbca[_0xa06e('0x19')](_0x4b1ed2);return _0x22fbca[_0xa06e('0x1f')](_0xa06e('0x20'),_0x3f2800+'-'+_0x118abd+'/'+_0x3a60eb)[_0xa06e('0x21')](_0x323f21);}return null;};}function patchUpdates(_0x571ec4){return function(_0x4ff572){try{jsonpatch[_0xa06e('0x22')](_0x4ff572,_0x571ec4,!![]);}catch(_0x3c4ef6){return BPromise['reject'](_0x3c4ef6);}return _0x4ff572[_0xa06e('0x23')]();};}function saveUpdates(_0x3d7dcc,_0x25e590){return function(_0x264159){if(_0x264159){return _0x264159[_0xa06e('0x24')](_0x3d7dcc)['then'](function(_0x8952a3){return _0x8952a3;});}return null;};}function removeEntity(_0x1c85a1,_0x2693ae){return function(_0x252f36){if(_0x252f36){return _0x252f36[_0xa06e('0x25')]()[_0xa06e('0x26')](function(){_0x1c85a1['status'](0xcc)[_0xa06e('0x1a')]();});}};}function handleEntityNotFound(_0x439a68,_0x5068d3){return function(_0x5c544a){if(!_0x5c544a){_0x439a68[_0xa06e('0x18')](0x194);}return _0x5c544a;};}function handleError(_0x57cbf0,_0x49fdcf){_0x49fdcf=_0x49fdcf||0x1f4;return function(_0x570609){logger['error'](_0x570609['stack']);if(_0x570609[_0xa06e('0x27')]){delete _0x570609['name'];}_0x57cbf0['status'](_0x49fdcf)[_0xa06e('0x28')](_0x570609);};}exports[_0xa06e('0x29')]=function(_0x158ec5,_0x280f13){var _0x24e8fe={},_0x3886b9={},_0x2b5965={'count':0x0,'rows':[]};var _0xbcf657=_['map'](db[_0xa06e('0x2a')][_0xa06e('0x2b')],function(_0x477882){return{'name':_0x477882[_0xa06e('0x2c')],'type':_0x477882[_0xa06e('0x2d')][_0xa06e('0x2e')]};});_0x3886b9[_0xa06e('0x2f')]=_[_0xa06e('0x30')](_[_0xa06e('0x31')](_0xbcf657,'name'),[_0xa06e('0x27')]);_0x3886b9[_0xa06e('0x32')]=_[_0xa06e('0x33')](_0x158ec5[_0xa06e('0x32')]);_0x3886b9[_0xa06e('0x34')]=_['intersection'](_0x3886b9['model'],_0x3886b9[_0xa06e('0x32')]);_0x24e8fe[_0xa06e('0x35')]=_[_0xa06e('0x36')](_0x3886b9[_0xa06e('0x2f')],qs['fields'](_0x158ec5['query'][_0xa06e('0x37')]));_0x24e8fe[_0xa06e('0x35')]=_0x24e8fe[_0xa06e('0x35')]['length']?_0x24e8fe['attributes']:_0x3886b9[_0xa06e('0x2f')];if(!_0x158ec5[_0xa06e('0x32')][_0xa06e('0x38')](_0xa06e('0x39'))){_0x24e8fe[_0xa06e('0x1c')]=qs[_0xa06e('0x1c')](_0x158ec5[_0xa06e('0x32')][_0xa06e('0x1c')]);_0x24e8fe[_0xa06e('0x1b')]=qs[_0xa06e('0x1b')](_0x158ec5['query'][_0xa06e('0x1b')]);}_0x24e8fe['order']=qs[_0xa06e('0x3a')](_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3a')]);_0x24e8fe[_0xa06e('0x3b')]=qs['filters'](_['pick'](_0x158ec5[_0xa06e('0x32')],_0x3886b9[_0xa06e('0x34')]),_0xbcf657);if(_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3c')]){_0x24e8fe[_0xa06e('0x3b')]=_[_0xa06e('0x3d')](_0x24e8fe[_0xa06e('0x3b')],{'$or':_['map'](_0xbcf657,function(_0x4501ee){if(_0x4501ee[_0xa06e('0x2d')]!=='VIRTUAL'){var _0x4fbbb2={};_0x4fbbb2[_0x4501ee[_0xa06e('0x27')]]={'$like':'%'+_0x158ec5[_0xa06e('0x32')][_0xa06e('0x3c')]+'%'};return _0x4fbbb2;}})});}_0x24e8fe=_[_0xa06e('0x3d')]({},_0x24e8fe,_0x158ec5[_0xa06e('0x3e')]);var _0x319635={'where':_0x24e8fe[_0xa06e('0x3b')]};return db['CmCustomField'][_0xa06e('0x1e')](_0x319635)[_0xa06e('0x26')](function(_0x427fa2){_0x2b5965['count']=_0x427fa2;if(_0x158ec5['query'][_0xa06e('0x3f')]){_0x24e8fe[_0xa06e('0x40')]=[{'all':!![]}];}return db[_0xa06e('0x2a')]['findAll'](_0x24e8fe);})[_0xa06e('0x26')](function(_0x3a3f7a){_0x2b5965[_0xa06e('0x41')]=_0x3a3f7a;return _0x2b5965;})[_0xa06e('0x26')](respondWithFilteredResult(_0x280f13,_0x24e8fe))[_0xa06e('0x42')](handleError(_0x280f13,null));};exports[_0xa06e('0x43')]=function(_0x395f42,_0x433b42){var _0x291551={'raw':!![],'where':{'id':_0x395f42[_0xa06e('0x44')]['id']}},_0x5630e7={};_0x5630e7[_0xa06e('0x2f')]=_[_0xa06e('0x33')](db['CmCustomField']['rawAttributes']);_0x5630e7['query']=_[_0xa06e('0x33')](_0x395f42[_0xa06e('0x32')]);_0x5630e7['filters']=_[_0xa06e('0x36')](_0x5630e7[_0xa06e('0x2f')],_0x5630e7['query']);_0x291551[_0xa06e('0x35')]=_['intersection'](_0x5630e7[_0xa06e('0x2f')],qs[_0xa06e('0x37')](_0x395f42['query']['fields']));_0x291551[_0xa06e('0x35')]=_0x291551['attributes'][_0xa06e('0x45')]?_0x291551['attributes']:_0x5630e7[_0xa06e('0x2f')];if(_0x395f42[_0xa06e('0x32')][_0xa06e('0x3f')]){_0x291551[_0xa06e('0x40')]=[{'all':!![]}];}_0x291551=_[_0xa06e('0x3d')]({},_0x291551,_0x395f42[_0xa06e('0x3e')]);return db[_0xa06e('0x2a')][_0xa06e('0x46')](_0x291551)[_0xa06e('0x26')](handleEntityNotFound(_0x433b42,null))[_0xa06e('0x26')](respondWithResult(_0x433b42,null))[_0xa06e('0x42')](handleError(_0x433b42,null));};exports[_0xa06e('0x24')]=function(_0xe2404c,_0x16921d){if(_0xe2404c[_0xa06e('0x47')]['id']){delete _0xe2404c[_0xa06e('0x47')]['id'];}return db[_0xa06e('0x2a')][_0xa06e('0x46')]({'where':{'id':_0xe2404c['params']['id']}})[_0xa06e('0x26')](handleEntityNotFound(_0x16921d,null))[_0xa06e('0x26')](saveUpdates(_0xe2404c[_0xa06e('0x47')],null))['then'](respondWithResult(_0x16921d,null))['catch'](handleError(_0x16921d,null));};exports[_0xa06e('0x25')]=function(_0x558ddf,_0x90039){return db[_0xa06e('0x2a')][_0xa06e('0x46')]({'where':{'id':_0x558ddf[_0xa06e('0x44')]['id']}})[_0xa06e('0x26')](handleEntityNotFound(_0x90039,null))['then'](removeEntity(_0x90039,null))[_0xa06e('0x42')](handleError(_0x90039,null));};exports['create']=function(_0x355d4e,_0x13b4e6){var _0x345505;return db['sequelize'][_0xa06e('0x48')](function(_0x233c9d){return db[_0xa06e('0x2a')][_0xa06e('0x49')](_0x355d4e[_0xa06e('0x47')],{'transaction':_0x233c9d})['then'](function(_0x1945c4){_0x345505=_0x1945c4;var _0x1a9f21={'type':db['Sequelize'][_0xa06e('0x4a')],'transaction':_0x233c9d};switch(_0x355d4e[_0xa06e('0x47')]['type']){case _0xa06e('0x4b'):_0x1a9f21[_0xa06e('0x2d')]=db['Sequelize'][_0xa06e('0x4a')];break;case _0xa06e('0x4c'):_0x1a9f21['type']=db[_0xa06e('0x4d')][_0xa06e('0x4e')];break;case _0xa06e('0x4f'):_0x1a9f21[_0xa06e('0x2d')]=db[_0xa06e('0x4d')][_0xa06e('0x50')];_0x1a9f21[_0xa06e('0x51')]=![];break;default:}return db[_0xa06e('0x52')][_0xa06e('0x53')][_0xa06e('0x54')](_0xa06e('0x55'),util[_0xa06e('0x56')](_0xa06e('0x57'),_0x345505['id']),_0x1a9f21);})[_0xa06e('0x26')](function(){return _0x345505;});})[_0xa06e('0x26')](respondWithResult(_0x13b4e6,0xc9))['catch'](handleError(_0x13b4e6,null));};
\ No newline at end of file
+var _0x9414=['undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','CmCustomField','includeAll','include','findAll','rows','catch','show','params','fields','find','update','body','destroy','sequelize','transaction','create','text','Sequelize','TEXT','number','BOOLEAN','queryInterface','addColumn','cf_%d','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9414,0x90));var _0x4941=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0x9414[_0x2493f7];return _0x594ab2;};'use strict';var emlformat=require(_0x4941('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4941('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4941('0x2'));var moment=require(_0x4941('0x3'));var BPromise=require(_0x4941('0x4'));var Mustache=require('mustache');var util=require(_0x4941('0x5'));var path=require(_0x4941('0x6'));var sox=require(_0x4941('0x7'));var csv=require(_0x4941('0x8'));var ejs=require(_0x4941('0x9'));var fs=require('fs');var fs_extra=require(_0x4941('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4941('0xb'));var jsforce=require(_0x4941('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4941('0x8'));var querystring=require('querystring');var Papa=require(_0x4941('0xd'));var Redis=require(_0x4941('0xe'));var authService=require(_0x4941('0xf'));var qs=require(_0x4941('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4941('0x11'));var utils=require('../../config/utils');var config=require(_0x4941('0x12'));var licenseUtil=require(_0x4941('0x13'));var db=require(_0x4941('0x14'))['db'];function respondWithStatusCode(_0x181f60,_0x572099){_0x572099=_0x572099||0xcc;return function(_0x474371){if(_0x474371){return _0x181f60[_0x4941('0x15')](_0x572099);}return _0x181f60['status'](_0x572099)[_0x4941('0x16')]();};}function respondWithResult(_0x581860,_0x2b00f3){_0x2b00f3=_0x2b00f3||0xc8;return function(_0x22fc78){if(_0x22fc78){return _0x581860[_0x4941('0x17')](_0x2b00f3)[_0x4941('0x18')](_0x22fc78);}};}function respondWithFilteredResult(_0x1de2a4,_0x250c15){return function(_0x4b3ddd){if(_0x4b3ddd){var _0x4a8d8b=typeof _0x250c15[_0x4941('0x19')]===_0x4941('0x1a')&&typeof _0x250c15['limit']===_0x4941('0x1a');var _0xf68906=_0x4b3ddd[_0x4941('0x1b')];var _0x299868=_0x4a8d8b?0x0:_0x250c15[_0x4941('0x19')];var _0x4ea352=_0x4a8d8b?_0x4b3ddd[_0x4941('0x1b')]:_0x250c15[_0x4941('0x19')]+_0x250c15[_0x4941('0x1c')];var _0x1974bf;if(_0x4ea352>=_0xf68906){_0x4ea352=_0xf68906;_0x1974bf=0xc8;}else{_0x1974bf=0xce;}_0x1de2a4[_0x4941('0x17')](_0x1974bf);return _0x1de2a4[_0x4941('0x1d')](_0x4941('0x1e'),_0x299868+'-'+_0x4ea352+'/'+_0xf68906)[_0x4941('0x18')](_0x4b3ddd);}return null;};}function patchUpdates(_0x447327){return function(_0xbaebdb){try{jsonpatch[_0x4941('0x1f')](_0xbaebdb,_0x447327,!![]);}catch(_0x53e18f){return BPromise[_0x4941('0x20')](_0x53e18f);}return _0xbaebdb[_0x4941('0x21')]();};}function saveUpdates(_0x304df2,_0x350f52){return function(_0x31ede2){if(_0x31ede2){return _0x31ede2['update'](_0x304df2)['then'](function(_0x52178d){return _0x52178d;});}return null;};}function removeEntity(_0x41c4ca,_0x281fb4){return function(_0x4f5998){if(_0x4f5998){return _0x4f5998['destroy']()[_0x4941('0x22')](function(){_0x41c4ca['status'](0xcc)[_0x4941('0x16')]();});}};}function handleEntityNotFound(_0x48b656,_0x1e31ae){return function(_0x119d16){if(!_0x119d16){_0x48b656[_0x4941('0x15')](0x194);}return _0x119d16;};}function handleError(_0x2184bf,_0x328bff){_0x328bff=_0x328bff||0x1f4;return function(_0xc42e7d){logger[_0x4941('0x23')](_0xc42e7d[_0x4941('0x24')]);if(_0xc42e7d[_0x4941('0x25')]){delete _0xc42e7d[_0x4941('0x25')];}_0x2184bf['status'](_0x328bff)[_0x4941('0x26')](_0xc42e7d);};}exports[_0x4941('0x27')]=function(_0x419ce2,_0x360192){var _0x5de3db={},_0x2ef563={},_0x3ead70={'count':0x0,'rows':[]};var _0x45c474=_[_0x4941('0x28')](db['CmCustomField'][_0x4941('0x29')],function(_0x2d7e28){return{'name':_0x2d7e28[_0x4941('0x2a')],'type':_0x2d7e28[_0x4941('0x2b')][_0x4941('0x2c')]};});_0x2ef563[_0x4941('0x2d')]=_[_0x4941('0x2e')](_['map'](_0x45c474,_0x4941('0x25')),[_0x4941('0x25')]);_0x2ef563['query']=_[_0x4941('0x2f')](_0x419ce2[_0x4941('0x30')]);_0x2ef563[_0x4941('0x31')]=_[_0x4941('0x32')](_0x2ef563['model'],_0x2ef563[_0x4941('0x30')]);_0x5de3db['attributes']=_[_0x4941('0x32')](_0x2ef563[_0x4941('0x2d')],qs['fields'](_0x419ce2['query']['fields']));_0x5de3db[_0x4941('0x33')]=_0x5de3db[_0x4941('0x33')][_0x4941('0x34')]?_0x5de3db[_0x4941('0x33')]:_0x2ef563[_0x4941('0x2d')];if(!_0x419ce2[_0x4941('0x30')][_0x4941('0x35')]('nolimit')){_0x5de3db[_0x4941('0x1c')]=qs[_0x4941('0x1c')](_0x419ce2['query'][_0x4941('0x1c')]);_0x5de3db[_0x4941('0x19')]=qs[_0x4941('0x19')](_0x419ce2[_0x4941('0x30')][_0x4941('0x19')]);}_0x5de3db['order']=qs['sort'](_0x419ce2['query'][_0x4941('0x36')]);_0x5de3db['where']=qs[_0x4941('0x31')](_[_0x4941('0x37')](_0x419ce2['query'],_0x2ef563['filters']),_0x45c474);if(_0x419ce2[_0x4941('0x30')][_0x4941('0x38')]){_0x5de3db[_0x4941('0x39')]=_['merge'](_0x5de3db[_0x4941('0x39')],{'$or':_['map'](_0x45c474,function(_0x37e7ef){if(_0x37e7ef['type']!==_0x4941('0x3a')){var _0x585704={};_0x585704[_0x37e7ef[_0x4941('0x25')]]={'$like':'%'+_0x419ce2['query']['filter']+'%'};return _0x585704;}})});}_0x5de3db=_[_0x4941('0x3b')]({},_0x5de3db,_0x419ce2[_0x4941('0x3c')]);var _0x313e75={'where':_0x5de3db[_0x4941('0x39')]};return db[_0x4941('0x3d')][_0x4941('0x1b')](_0x313e75)[_0x4941('0x22')](function(_0x9ef8fc){_0x3ead70['count']=_0x9ef8fc;if(_0x419ce2[_0x4941('0x30')][_0x4941('0x3e')]){_0x5de3db[_0x4941('0x3f')]=[{'all':!![]}];}return db[_0x4941('0x3d')][_0x4941('0x40')](_0x5de3db);})[_0x4941('0x22')](function(_0x4a8d08){_0x3ead70[_0x4941('0x41')]=_0x4a8d08;return _0x3ead70;})[_0x4941('0x22')](respondWithFilteredResult(_0x360192,_0x5de3db))[_0x4941('0x42')](handleError(_0x360192,null));};exports[_0x4941('0x43')]=function(_0x221797,_0x202da1){var _0x76c5e6={'raw':!![],'where':{'id':_0x221797[_0x4941('0x44')]['id']}},_0x8b9f57={};_0x8b9f57['model']=_[_0x4941('0x2f')](db['CmCustomField'][_0x4941('0x29')]);_0x8b9f57[_0x4941('0x30')]=_['keys'](_0x221797['query']);_0x8b9f57['filters']=_['intersection'](_0x8b9f57[_0x4941('0x2d')],_0x8b9f57[_0x4941('0x30')]);_0x76c5e6[_0x4941('0x33')]=_[_0x4941('0x32')](_0x8b9f57[_0x4941('0x2d')],qs['fields'](_0x221797['query'][_0x4941('0x45')]));_0x76c5e6[_0x4941('0x33')]=_0x76c5e6[_0x4941('0x33')]['length']?_0x76c5e6[_0x4941('0x33')]:_0x8b9f57[_0x4941('0x2d')];if(_0x221797['query'][_0x4941('0x3e')]){_0x76c5e6[_0x4941('0x3f')]=[{'all':!![]}];}_0x76c5e6=_[_0x4941('0x3b')]({},_0x76c5e6,_0x221797[_0x4941('0x3c')]);return db[_0x4941('0x3d')][_0x4941('0x46')](_0x76c5e6)[_0x4941('0x22')](handleEntityNotFound(_0x202da1,null))[_0x4941('0x22')](respondWithResult(_0x202da1,null))[_0x4941('0x42')](handleError(_0x202da1,null));};exports[_0x4941('0x47')]=function(_0x49133b,_0x315ba6){if(_0x49133b[_0x4941('0x48')]['id']){delete _0x49133b['body']['id'];}return db['CmCustomField'][_0x4941('0x46')]({'where':{'id':_0x49133b['params']['id']}})[_0x4941('0x22')](handleEntityNotFound(_0x315ba6,null))[_0x4941('0x22')](saveUpdates(_0x49133b[_0x4941('0x48')],null))['then'](respondWithResult(_0x315ba6,null))['catch'](handleError(_0x315ba6,null));};exports[_0x4941('0x49')]=function(_0xa1e130,_0x1398f0){return db['CmCustomField'][_0x4941('0x46')]({'where':{'id':_0xa1e130[_0x4941('0x44')]['id']}})[_0x4941('0x22')](handleEntityNotFound(_0x1398f0,null))[_0x4941('0x22')](removeEntity(_0x1398f0,null))[_0x4941('0x42')](handleError(_0x1398f0,null));};exports['create']=function(_0x3fee48,_0x4dcc9d){var _0x27f9f1;return db[_0x4941('0x4a')][_0x4941('0x4b')](function(_0x1bedff){return db['CmCustomField'][_0x4941('0x4c')](_0x3fee48['body'],{'transaction':_0x1bedff})[_0x4941('0x22')](function(_0x312318){_0x27f9f1=_0x312318;var _0x34eb2f={'type':db['Sequelize']['TEXT'],'transaction':_0x1bedff};switch(_0x3fee48[_0x4941('0x48')][_0x4941('0x2b')]){case _0x4941('0x4d'):_0x34eb2f['type']=db[_0x4941('0x4e')][_0x4941('0x4f')];break;case _0x4941('0x50'):_0x34eb2f['type']=db[_0x4941('0x4e')]['INTEGER'];break;case'switch':_0x34eb2f['type']=db['Sequelize'][_0x4941('0x51')];_0x34eb2f['defaultValue']=![];break;default:}return db[_0x4941('0x4a')][_0x4941('0x52')][_0x4941('0x53')]('cm_contacts',util['format'](_0x4941('0x54'),_0x27f9f1['id']),_0x34eb2f);})[_0x4941('0x22')](function(){return _0x27f9f1;});})['then'](respondWithResult(_0x4dcc9d,0xc9))[_0x4941('0x42')](handleError(_0x4dcc9d,null));};
\ No newline at end of file
index bb6d82b..5820e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8657=['path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3d67b6,_0x482b88){var _0x185095=function(_0x1c7e98){while(--_0x1c7e98){_0x3d67b6['push'](_0x3d67b6['shift']());}};_0x185095(++_0x482b88);}(_0x8657,0x1b6));var _0x7865=function(_0x253df7,_0x2af793){_0x253df7=_0x253df7-0x0;var _0x12bd19=_0x8657[_0x253df7];return _0x12bd19;};'use strict';var _=require(_0x7865('0x0'));var util=require(_0x7865('0x1'));var logger=require(_0x7865('0x2'))(_0x7865('0x3'));var moment=require('moment');var BPromise=require(_0x7865('0x4'));var rp=require(_0x7865('0x5'));var fs=require('fs');var path=require(_0x7865('0x6'));var rimraf=require(_0x7865('0x7'));var config=require(_0x7865('0x8'));var attributes=require(_0x7865('0x9'));module['exports']=function(_0x350165,_0x49d012){return _0x350165[_0x7865('0xa')](_0x7865('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x81b5=['CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./cmCustomField.attributes','define'];(function(_0x330fae,_0x470b97){var _0x3b7bd=function(_0x3c4547){while(--_0x3c4547){_0x330fae['push'](_0x330fae['shift']());}};_0x3b7bd(++_0x470b97);}(_0x81b5,0xff));var _0x581b=function(_0x59542f,_0x55de07){_0x59542f=_0x59542f-0x0;var _0x38e995=_0x81b5[_0x59542f];return _0x38e995;};'use strict';var _=require('lodash');var util=require(_0x581b('0x0'));var logger=require(_0x581b('0x1'))(_0x581b('0x2'));var moment=require(_0x581b('0x3'));var BPromise=require(_0x581b('0x4'));var rp=require(_0x581b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x581b('0x6'));var attributes=require(_0x581b('0x7'));module['exports']=function(_0x50f8c7,_0xbfdd69){return _0x50f8c7[_0x581b('0x8')](_0x581b('0x9'),attributes,{'tableName':_0x581b('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1269223..4ffe48f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23e9=['CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then'];(function(_0x4a68f1,_0x194e22){var _0x208ca5=function(_0x410254){while(--_0x410254){_0x4a68f1['push'](_0x4a68f1['shift']());}};_0x208ca5(++_0x194e22);}(_0x23e9,0xaa));var _0x923e=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x23e9[_0x599e60];return _0x468e19;};'use strict';var _=require('lodash');var util=require(_0x923e('0x0'));var moment=require(_0x923e('0x1'));var BPromise=require(_0x923e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x923e('0x3'))['db'];var utils=require(_0x923e('0x4'));var logger=require('../../config/logger')(_0x923e('0x5'));var config=require('../../config/environment');var jayson=require(_0x923e('0x6'));var client=jayson['client'][_0x923e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x19819f,_0x42fe0c,_0x3ede86){return new BPromise(function(_0x420271,_0x192e8b){return client[_0x923e('0x8')](_0x19819f,_0x3ede86)[_0x923e('0x9')](function(_0x2123a3){logger['info'](_0x923e('0xa'),_0x42fe0c,'request\x20sent');logger[_0x923e('0xb')](_0x923e('0xc'),_0x42fe0c,_0x923e('0xd'),JSON['stringify'](_0x2123a3));if(_0x2123a3[_0x923e('0xe')]){if(_0x2123a3[_0x923e('0xe')]['code']===0x1f4){logger['error'](_0x923e('0xa'),_0x42fe0c,_0x2123a3['error'][_0x923e('0xf')]);return _0x192e8b(_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);}logger[_0x923e('0xe')](_0x923e('0xa'),_0x42fe0c,_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);return _0x420271(_0x2123a3[_0x923e('0xe')][_0x923e('0xf')]);}else{logger[_0x923e('0x10')](_0x923e('0xa'),_0x42fe0c,_0x923e('0xd'));_0x420271(_0x2123a3['result']['message']);}})[_0x923e('0x11')](function(_0x57780d){logger[_0x923e('0xe')](_0x923e('0xa'),_0x42fe0c,_0x57780d);_0x192e8b(_0x57780d);});});}
\ No newline at end of file
+var _0x660e=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x5a5053,_0x2d0983){var _0x2799ab=function(_0x9784db){while(--_0x9784db){_0x5a5053['push'](_0x5a5053['shift']());}};_0x2799ab(++_0x2d0983);}(_0x660e,0x179));var _0xe660=function(_0x18e2fb,_0x183716){_0x18e2fb=_0x18e2fb-0x0;var _0x58c736=_0x660e[_0x18e2fb];return _0x58c736;};'use strict';var _=require(_0xe660('0x0'));var util=require(_0xe660('0x1'));var moment=require(_0xe660('0x2'));var BPromise=require('bluebird');var rs=require(_0xe660('0x3'));var fs=require('fs');var Redis=require(_0xe660('0x4'));var db=require(_0xe660('0x5'))['db'];var utils=require(_0xe660('0x6'));var logger=require('../../config/logger')(_0xe660('0x7'));var config=require(_0xe660('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe660('0x9')][_0xe660('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b09b1,_0x5ead47,_0xfcef3f){return new BPromise(function(_0x275d05,_0x343f85){return client[_0xe660('0xb')](_0x3b09b1,_0xfcef3f)[_0xe660('0xc')](function(_0xb0b88d){logger[_0xe660('0xd')](_0xe660('0xe'),_0x5ead47,_0xe660('0xf'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x5ead47,_0xe660('0xf'),JSON['stringify'](_0xb0b88d));if(_0xb0b88d['error']){if(_0xb0b88d[_0xe660('0x10')][_0xe660('0x11')]===0x1f4){logger[_0xe660('0x10')](_0xe660('0xe'),_0x5ead47,_0xb0b88d[_0xe660('0x10')][_0xe660('0x12')]);return _0x343f85(_0xb0b88d[_0xe660('0x10')][_0xe660('0x12')]);}logger[_0xe660('0x10')]('CmCustomField,\x20%s,\x20%s',_0x5ead47,_0xb0b88d[_0xe660('0x10')][_0xe660('0x12')]);return _0x275d05(_0xb0b88d[_0xe660('0x10')][_0xe660('0x12')]);}else{logger[_0xe660('0xd')](_0xe660('0xe'),_0x5ead47,_0xe660('0xf'));_0x275d05(_0xb0b88d[_0xe660('0x13')][_0xe660('0x12')]);}})[_0xe660('0x14')](function(_0xa502d7){logger[_0xe660('0x10')](_0xe660('0xe'),_0x5ead47,_0xa502d7);_0x343f85(_0xa502d7);});});}
\ No newline at end of file
index a54f76b..3c23b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3f=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x16d830,_0x10e8a7){var _0x1dcf53=function(_0x3b4f23){while(--_0x3b4f23){_0x16d830['push'](_0x16d830['shift']());}};_0x1dcf53(++_0x10e8a7);}(_0xab3f,0x72));var _0xfab3=function(_0x489e5a,_0x6c58ae){_0x489e5a=_0x489e5a-0x0;var _0x3c58ae=_0xab3f[_0x489e5a];return _0x3c58ae;};'use strict';var multer=require(_0xfab3('0x0'));var util=require('util');var path=require(_0xfab3('0x1'));var timeout=require(_0xfab3('0x2'));var express=require(_0xfab3('0x3'));var router=express[_0xfab3('0x4')]();var fs_extra=require(_0xfab3('0x5'));var auth=require(_0xfab3('0x6'));var interaction=require(_0xfab3('0x7'));var config=require(_0xfab3('0x8'));var controller=require(_0xfab3('0x9'));router[_0xfab3('0xa')]('/',auth[_0xfab3('0xb')](),controller['index']);router[_0xfab3('0xa')](_0xfab3('0xc'),auth[_0xfab3('0xb')](),controller[_0xfab3('0xd')]);router[_0xfab3('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfab3('0xf')]('/:id',auth[_0xfab3('0xb')](),controller['update']);router[_0xfab3('0x10')]('/:id',auth[_0xfab3('0xb')](),controller[_0xfab3('0x11')]);module[_0xfab3('0x12')]=router;
\ No newline at end of file
+var _0xfdcd=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','util'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdfdc('0x0'));var path=require(_0xdfdc('0x1'));var timeout=require(_0xdfdc('0x2'));var express=require('express');var router=express[_0xdfdc('0x3')]();var fs_extra=require(_0xdfdc('0x4'));var auth=require(_0xdfdc('0x5'));var interaction=require(_0xdfdc('0x6'));var config=require(_0xdfdc('0x7'));var controller=require(_0xdfdc('0x8'));router[_0xdfdc('0x9')]('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xb')]);router[_0xdfdc('0x9')](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xd')]);router['post']('/',auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xe')]);router['put'](_0xdfdc('0xc'),auth[_0xdfdc('0xa')](),controller[_0xdfdc('0xf')]);router[_0xdfdc('0x10')](_0xdfdc('0xc'),auth['isAuthenticated'](),controller[_0xdfdc('0x11')]);module['exports']=router;
\ No newline at end of file
index 95f80bd..9109115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5cc=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE'];(function(_0x38e6b7,_0x5b3c41){var _0x369ee0=function(_0x186a87){while(--_0x186a87){_0x38e6b7['push'](_0x38e6b7['shift']());}};_0x369ee0(++_0x5b3c41);}(_0xe5cc,0x174));var _0xce5c=function(_0x57d98e,_0x2cdedb){_0x57d98e=_0x57d98e-0x0;var _0x5e3656=_0xe5cc[_0x57d98e];return _0x5e3656;};'use strict';var moment=require('moment');var Sequelize=require(_0xce5c('0x0'));module[_0xce5c('0x1')]={'phone':{'type':Sequelize[_0xce5c('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xce5c('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xce5c('0x4')](_0xce5c('0x5'))},'countbusyretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xce5c('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xce5c('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xce5c('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xce5c('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xce5c('0x6')],'unique':_0xce5c('0x9')},'UserId':{'type':Sequelize[_0xce5c('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xce5c('0x9')},'CampaignId':{'type':Sequelize[_0xce5c('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xce5c('0x6')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x42f3=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','sequelize','STRING','BOOLEAN','DATE'];(function(_0x38e59a,_0x2e97ac){var _0x5df2ac=function(_0x1584ff){while(--_0x1584ff){_0x38e59a['push'](_0x38e59a['shift']());}};_0x5df2ac(++_0x2e97ac);}(_0x42f3,0x1d9));var _0x342f=function(_0x4927dc,_0x54b3f6){_0x4927dc=_0x4927dc-0x0;var _0x45e1c3=_0x42f3[_0x4927dc];return _0x45e1c3;};'use strict';var moment=require('moment');var Sequelize=require(_0x342f('0x0'));module['exports']={'phone':{'type':Sequelize[_0x342f('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x342f('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x342f('0x3')],'defaultValue':moment()[_0x342f('0x4')](_0x342f('0x5'))},'countbusyretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x342f('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x342f('0x3')]},'priority':{'type':Sequelize[_0x342f('0x6')](0x2)[_0x342f('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x342f('0x6')],'unique':_0x342f('0x8')},'ListId':{'type':Sequelize[_0x342f('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x342f('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x342f('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x342f('0x6')],'defaultValue':0x0}};
\ No newline at end of file
index 48d3704..a62d232 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9de2=['$eq','$between','$in','$notIn','$like','$iLike','$overlap','$contains','$any','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','fields','find','create','body','params','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','calleridname','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','priority','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getOpenContacts','getVoiceQueues','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','$and','$or','$gt','$gte','$lte'];(function(_0x292f35,_0x72e859){var _0x288e75=function(_0x1bba68){while(--_0x1bba68){_0x292f35['push'](_0x292f35['shift']());}};_0x288e75(++_0x72e859);}(_0x9de2,0x18b));var _0x29de=function(_0x55573e,_0x700c78){_0x55573e=_0x55573e-0x0;var _0x41259b=_0x9de2[_0x55573e];return _0x41259b;};'use strict';var emlformat=require(_0x29de('0x0'));var rimraf=require(_0x29de('0x1'));var zipdir=require(_0x29de('0x2'));var jsonpatch=require(_0x29de('0x3'));var rp=require(_0x29de('0x4'));var moment=require(_0x29de('0x5'));var BPromise=require(_0x29de('0x6'));var Mustache=require(_0x29de('0x7'));var util=require(_0x29de('0x8'));var path=require(_0x29de('0x9'));var sox=require(_0x29de('0xa'));var csv=require(_0x29de('0xb'));var ejs=require(_0x29de('0xc'));var fs=require('fs');var fs_extra=require(_0x29de('0xd'));var _=require(_0x29de('0xe'));var squel=require('squel');var crypto=require(_0x29de('0xf'));var jsforce=require(_0x29de('0x10'));var deskjs=require(_0x29de('0x11'));var toCsv=require('to-csv');var querystring=require(_0x29de('0x12'));var Papa=require(_0x29de('0x13'));var Redis=require(_0x29de('0x14'));var authService=require(_0x29de('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29de('0x16'))(_0x29de('0x17'));var utils=require(_0x29de('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x29de('0x19'));var db=require(_0x29de('0x1a'))['db'];function respondWithStatusCode(_0x4ea5c3,_0x493f78){_0x493f78=_0x493f78||0xcc;return function(_0x3426b7){if(_0x3426b7){return _0x4ea5c3[_0x29de('0x1b')](_0x493f78);}return _0x4ea5c3[_0x29de('0x1c')](_0x493f78)[_0x29de('0x1d')]();};}function respondWithResult(_0x16f4b6,_0x611b8){_0x611b8=_0x611b8||0xc8;return function(_0x127e14){if(_0x127e14){return _0x16f4b6[_0x29de('0x1c')](_0x611b8)[_0x29de('0x1e')](_0x127e14);}};}function respondWithFilteredResult(_0x5e397d,_0x4fd9cb){return function(_0xfee42d){if(_0xfee42d){var _0x10f4d3=typeof _0x4fd9cb[_0x29de('0x1f')]===_0x29de('0x20')&&typeof _0x4fd9cb[_0x29de('0x21')]===_0x29de('0x20');var _0x8333cb=_0xfee42d[_0x29de('0x22')];var _0x351ce1=_0x10f4d3?0x0:_0x4fd9cb[_0x29de('0x1f')];var _0xae4f9=_0x10f4d3?_0xfee42d[_0x29de('0x22')]:_0x4fd9cb[_0x29de('0x1f')]+_0x4fd9cb[_0x29de('0x21')];var _0x5b3156;if(_0xae4f9>=_0x8333cb){_0xae4f9=_0x8333cb;_0x5b3156=0xc8;}else{_0x5b3156=0xce;}_0x5e397d['status'](_0x5b3156);return _0x5e397d[_0x29de('0x23')](_0x29de('0x24'),_0x351ce1+'-'+_0xae4f9+'/'+_0x8333cb)[_0x29de('0x1e')](_0xfee42d);}return null;};}function patchUpdates(_0x4c8c11){return function(_0x3d58c9){try{jsonpatch[_0x29de('0x25')](_0x3d58c9,_0x4c8c11,!![]);}catch(_0x2c08b3){return BPromise['reject'](_0x2c08b3);}return _0x3d58c9[_0x29de('0x26')]();};}function saveUpdates(_0x3caa06,_0x1e1330){return function(_0x53edaa){if(_0x53edaa){return _0x53edaa[_0x29de('0x27')](_0x3caa06)['then'](function(_0x232095){return _0x232095;});}return null;};}function removeEntity(_0x4e8081,_0x1fcf8c){return function(_0x530052){if(_0x530052){return _0x530052['destroy']()[_0x29de('0x28')](function(){_0x4e8081[_0x29de('0x1c')](0xcc)[_0x29de('0x1d')]();});}};}function handleEntityNotFound(_0x25ec12,_0x2c00d5){return function(_0x292d05){if(!_0x292d05){_0x25ec12[_0x29de('0x1b')](0x194);}return _0x292d05;};}function handleError(_0x7813c,_0x160187){_0x160187=_0x160187||0x1f4;return function(_0x345368){logger['error'](_0x345368['stack']);if(_0x345368[_0x29de('0x29')]){delete _0x345368[_0x29de('0x29')];}_0x7813c[_0x29de('0x1c')](_0x160187)[_0x29de('0x2a')](_0x345368);};}exports[_0x29de('0x2b')]=function(_0x5a53ab,_0x3d5a13){var _0x45add4={},_0x1a5325={},_0x45606f={'count':0x0,'rows':[]};var _0x359f3d=_[_0x29de('0x2c')](db[_0x29de('0x2d')][_0x29de('0x2e')],function(_0x5a4263){return{'name':_0x5a4263[_0x29de('0x2f')],'type':_0x5a4263['type'][_0x29de('0x30')]};});_0x1a5325[_0x29de('0x31')]=_[_0x29de('0x2c')](_0x359f3d,'name');_0x1a5325[_0x29de('0x32')]=_[_0x29de('0x33')](_0x5a53ab[_0x29de('0x32')]);_0x1a5325[_0x29de('0x34')]=_['intersection'](_0x1a5325[_0x29de('0x31')],_0x1a5325[_0x29de('0x32')]);_0x1a5325[_0x29de('0x34')]=_['concat'](_0x1a5325['filters'],[_0x29de('0x35'),_0x29de('0x36'),_0x29de('0x37'),_0x29de('0x38'),'$lt',_0x29de('0x39'),'$ne',_0x29de('0x3a'),'$not',_0x29de('0x3b'),'$notBetween',_0x29de('0x3c'),_0x29de('0x3d'),_0x29de('0x3e'),'$notLike',_0x29de('0x3f'),'$notILike','$like',_0x29de('0x40'),_0x29de('0x41'),'$contained',_0x29de('0x42')]);_0x45add4[_0x29de('0x43')]=_[_0x29de('0x44')](_0x1a5325[_0x29de('0x31')],qs['fields'](_0x5a53ab['query']['fields']));_0x45add4[_0x29de('0x43')]=_0x45add4[_0x29de('0x43')][_0x29de('0x45')]?_0x45add4[_0x29de('0x43')]:_0x1a5325[_0x29de('0x31')];if(!_0x5a53ab['query'][_0x29de('0x46')](_0x29de('0x47'))){_0x45add4[_0x29de('0x21')]=qs[_0x29de('0x21')](_0x5a53ab[_0x29de('0x32')][_0x29de('0x21')]);_0x45add4[_0x29de('0x1f')]=qs[_0x29de('0x1f')](_0x5a53ab['query']['offset']);}_0x45add4[_0x29de('0x48')]=qs[_0x29de('0x49')](_0x5a53ab[_0x29de('0x32')][_0x29de('0x49')]);_0x45add4[_0x29de('0x4a')]=qs[_0x29de('0x34')](_[_0x29de('0x4b')](_0x5a53ab[_0x29de('0x32')],_0x1a5325[_0x29de('0x34')]),_0x359f3d);if(_0x5a53ab[_0x29de('0x32')][_0x29de('0x4c')]){_0x45add4[_0x29de('0x4a')]=_[_0x29de('0x4d')](_0x45add4[_0x29de('0x4a')],{'$or':_['map'](_0x359f3d,function(_0x393062){if(_0x393062[_0x29de('0x4e')]!==_0x29de('0x4f')){var _0x7ff1fd={};_0x7ff1fd[_0x393062['name']]={'$like':'%'+_0x5a53ab[_0x29de('0x32')]['filter']+'%'};return _0x7ff1fd;}})});}_0x45add4=_[_0x29de('0x4d')]({},_0x45add4,_0x5a53ab[_0x29de('0x50')]);var _0x3150bb={'where':_0x45add4[_0x29de('0x4a')]};return db[_0x29de('0x2d')][_0x29de('0x22')](_0x3150bb)['then'](function(_0x1023e6){_0x45606f[_0x29de('0x22')]=_0x1023e6;if(_0x5a53ab[_0x29de('0x32')][_0x29de('0x51')]){_0x45add4[_0x29de('0x52')]=[{'all':!![]}];}return db[_0x29de('0x2d')]['findAll'](_0x45add4);})[_0x29de('0x28')](function(_0x572982){_0x45606f[_0x29de('0x53')]=_0x572982;return _0x45606f;})[_0x29de('0x28')](respondWithFilteredResult(_0x3d5a13,_0x45add4))[_0x29de('0x54')](handleError(_0x3d5a13,null));};exports['show']=function(_0x58e188,_0x4c13a1){var _0x5826e1={'raw':!![],'where':{'id':_0x58e188['params']['id']}},_0x7ff0ba={};_0x7ff0ba[_0x29de('0x31')]=_[_0x29de('0x33')](db['CmHopper']['rawAttributes']);_0x7ff0ba[_0x29de('0x32')]=_[_0x29de('0x33')](_0x58e188['query']);_0x7ff0ba[_0x29de('0x34')]=_[_0x29de('0x44')](_0x7ff0ba[_0x29de('0x31')],_0x7ff0ba[_0x29de('0x32')]);_0x5826e1[_0x29de('0x43')]=_[_0x29de('0x44')](_0x7ff0ba['model'],qs[_0x29de('0x55')](_0x58e188[_0x29de('0x32')][_0x29de('0x55')]));_0x5826e1['attributes']=_0x5826e1[_0x29de('0x43')]['length']?_0x5826e1['attributes']:_0x7ff0ba[_0x29de('0x31')];if(_0x58e188[_0x29de('0x32')][_0x29de('0x51')]){_0x5826e1[_0x29de('0x52')]=[{'all':!![]}];}_0x5826e1=_['merge']({},_0x5826e1,_0x58e188[_0x29de('0x50')]);return db['CmHopper'][_0x29de('0x56')](_0x5826e1)[_0x29de('0x28')](handleEntityNotFound(_0x4c13a1,null))[_0x29de('0x28')](respondWithResult(_0x4c13a1,null))[_0x29de('0x54')](handleError(_0x4c13a1,null));};exports[_0x29de('0x57')]=function(_0x12e6e2,_0x3e1775){return db['CmHopper'][_0x29de('0x57')](_0x12e6e2[_0x29de('0x58')],{})[_0x29de('0x28')](respondWithResult(_0x3e1775,0xc9))['catch'](handleError(_0x3e1775,null));};exports['update']=function(_0x53c25c,_0x47c13f){if(_0x53c25c[_0x29de('0x58')]['id']){delete _0x53c25c[_0x29de('0x58')]['id'];}return db[_0x29de('0x2d')][_0x29de('0x56')]({'where':{'id':_0x53c25c[_0x29de('0x59')]['id']}})[_0x29de('0x28')](handleEntityNotFound(_0x47c13f,null))['then'](saveUpdates(_0x53c25c[_0x29de('0x58')],null))[_0x29de('0x28')](respondWithResult(_0x47c13f,null))[_0x29de('0x54')](handleError(_0x47c13f,null));};exports[_0x29de('0x5a')]=function(_0x1b9fe5,_0x226a03){return db[_0x29de('0x2d')][_0x29de('0x5a')]()[_0x29de('0x28')](respondWithResult(_0x226a03,null))[_0x29de('0x54')](handleError(_0x226a03,null));};exports[_0x29de('0x5b')]=function(_0x409605,_0x1b476c){var _0x3f5982;return db[_0x29de('0x2d')]['find']({'where':{'id':_0x409605[_0x29de('0x59')]['id']}})[_0x29de('0x28')](handleEntityNotFound(_0x1b476c,null))[_0x29de('0x28')](function(_0x2895d8){if(_0x2895d8){return _0x2895d8[_0x29de('0x5b')]()[_0x29de('0x28')](function(_0x35b3b3){return _0x35b3b3;});}})['then'](function(_0x19b1ec){_0x3f5982=_0x19b1ec;if(_0x19b1ec){if(_0x19b1ec['VoiceQueueId']||_0x19b1ec[_0x29de('0x5c')]){return db[_0x19b1ec[_0x29de('0x5d')]?_0x29de('0x5e'):_0x29de('0x5f')]['find']({'where':{'id':_0x19b1ec[_0x29de('0x5d')]?_0x19b1ec['VoiceQueueId']:_0x19b1ec['CampaignId']},'attributes':['id',_0x29de('0x29')],'raw':!![]});}}})[_0x29de('0x28')](function(_0x4c513a){var _0x4638fe={};if(_0x4c513a){_[_0x29de('0x4d')](_0x4638fe,_['omit'](_0x3f5982[_0x29de('0x60')],[_0x29de('0x61'),_0x29de('0x62'),'id']));_0x4638fe[_0x29de('0x63')]=0x15;_0x4638fe[_0x29de('0x64')]=_0x29de('0x65');_0x4638fe[_0x29de('0x66')]=_0x4c513a['name'];_0x4638fe[_0x29de('0x67')]=_0x409605[_0x29de('0x68')][_0x29de('0x29')];_0x4638fe[_0x29de('0x69')]=_0x409605[_0x29de('0x68')]['id'];_0x4638fe[_0x29de('0x65')]=!![];_0x4638fe[_0x29de('0x6a')]=moment()[_0x29de('0x6b')](_0x29de('0x6c'));_0x4638fe[_0x29de('0x6d')]=_0x3f5982[_0x29de('0x6e')];_0x4638fe[_0x29de('0x6f')]=_0x3f5982[_0x29de('0x5d')]?_0x29de('0x70'):_0x29de('0x71');return db[_0x29de('0x72')][_0x29de('0x56')]({'where':{'id':_0x4638fe['ContactId']},'attributes':['firstName',_0x29de('0x73')]})[_0x29de('0x28')](function(_0x21e2e8){if(!_[_0x29de('0x74')](_0x1b476c)&&!_[_0x29de('0x74')](_0x21e2e8[_0x29de('0x75')])){_0x4638fe[_0x29de('0x76')]=_0x21e2e8[_0x29de('0x75')];if(!_['isNil'](_0x21e2e8[_0x29de('0x73')])){_0x4638fe['calleridname']+='\x20'+_0x21e2e8['lastName'];}}})['finally'](function(){return db[_0x29de('0x77')]['create'](_0x4638fe);});}})[_0x29de('0x28')](function(){return _0x1b476c[_0x29de('0x1c')](0xcc)['end']();})[_0x29de('0x54')](handleError(_0x1b476c,null));};exports[_0x29de('0x78')]=function(_0x59e8b3,_0x383732,_0x9bb5df){var _0x5c7075=[];return db[_0x29de('0x72')]['describe']()['then'](function(_0x76d0f1){_0x5c7075=_[_0x29de('0x33')](_0x76d0f1);return _0x59e8b3['user']['getVoiceQueues']({'where':{'type':_0x29de('0x79'),'dialActive':!![],'dialMethod':_0x29de('0x7a')},'attributes':['id',_0x29de('0x7b')],'raw':!![]});})[_0x29de('0x28')](function(_0x4314ec){if(_0x4314ec&&_0x4314ec[_0x29de('0x45')]){return db['sequelize'][_0x29de('0x7c')](function(_0x26a649){var _0x525ebd={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x29de('0x6b')](_0x29de('0x6c'))},'VoiceQueueId':{'$in':_[_0x29de('0x2c')](_0x4314ec,'id')},'$or':[{'UserId':null},{'UserId':_0x59e8b3[_0x29de('0x68')]['id']}]};var _0x138377=[];if(_0x59e8b3[_0x29de('0x58')][_0x29de('0x7d')]&&_0x59e8b3[_0x29de('0x58')][_0x29de('0x7d')]===_0x29de('0x7e')){if(!_[_0x29de('0x7f')](_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')])){_0x525ebd['id']={'$in':_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')]};}_0x138377=[['priority',_0x29de('0x81')],[_0x29de('0x82'),_0x4314ec[0x0][_0x29de('0x7b')]==='ASC'?_0x29de('0x83'):_0x29de('0x81')],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x29de('0x83')]];}else{if(!_['isEmpty'](_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')])){_0x525ebd['id']={'$notIn':_0x59e8b3[_0x29de('0x58')][_0x29de('0x80')]};}_0x138377=[[_0x29de('0x84'),_0x29de('0x83')],[_0x29de('0x82'),_0x4314ec[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x29de('0x85')](_0x29de('0x86')),['id',_0x29de('0x81')]];}return db[_0x29de('0x2d')][_0x29de('0x87')]({'attributes':['id',_0x29de('0x88')],'where':_0x525ebd,'order':_0x138377,'transaction':_0x26a649,'lock':_0x26a649[_0x29de('0x89')][_0x29de('0x8a')],'include':[{'model':db[_0x29de('0x72')],'as':_0x29de('0x8b'),'attributes':_0x5c7075,'include':[{'model':db[_0x29de('0x8c')],'as':_0x29de('0x8d'),'attributes':['id',_0x29de('0x29')]}]},{'model':db[_0x29de('0x8e')],'as':_0x29de('0x8f'),'attributes':['id',_0x29de('0x29')]},{'model':db[_0x29de('0x5e')],'as':'Queue','attributes':['id',_0x29de('0x29'),_0x29de('0x90')]}]})[_0x29de('0x28')](function(_0x4fc473){if(_0x4fc473){return _0x4fc473[_0x29de('0x27')]({'UserId':_0x59e8b3[_0x29de('0x68')]['id']},{'transaction':_0x26a649});}});});}})[_0x29de('0x28')](handleEntityNotFound(_0x383732,null))['then'](respondWithResult(_0x383732,null))[_0x29de('0x54')](handleError(_0x383732,null));};exports[_0x29de('0x91')]=function(_0x198a2d,_0x4e7f9f,_0x56b030){return _0x198a2d[_0x29de('0x68')][_0x29de('0x92')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x29de('0x7a')},'attributes':['id'],'raw':!![]})[_0x29de('0x28')](function(_0x42bda5){if(_0x42bda5&&_0x42bda5[_0x29de('0x45')]){return db[_0x29de('0x2d')][_0x29de('0x22')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x29de('0x6b')](_0x29de('0x6c'))},'VoiceQueueId':{'$in':_[_0x29de('0x2c')](_0x42bda5,'id')},'$or':[{'UserId':null},{'UserId':_0x198a2d[_0x29de('0x68')]['id']}]}});}return 0x0;})[_0x29de('0x28')](function(_0x129c34){if(!_['isNil'](_0x129c34)&&_[_0x29de('0x93')](_0x129c34)){return _0x4e7f9f[_0x29de('0x1c')](0xc8)[_0x29de('0x1e')]({'contacts':_0x129c34});}else{logger[_0x29de('0x94')](_0x29de('0x95'),_0x29de('0x91'),0x194,_0x29de('0x96'));_0x4e7f9f[_0x29de('0x1b')](0x194);}})['catch'](handleError(_0x4e7f9f,null));};
\ No newline at end of file
+var _0x2c58=['membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','outbound','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','undefined','count','offset','limit','set','json','save','update','then','end','sendStatus','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','concat','$and','$or','$gt','$lt','$eq','$not','$notBetween','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$any','attributes','length','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','updatedAt','state','statedesc','deleted'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c58,0xc1));var _0x82c5=function(_0x30bdb5,_0x151c38){_0x30bdb5=_0x30bdb5-0x0;var _0x26ce01=_0x2c58[_0x30bdb5];return _0x26ce01;};'use strict';var emlformat=require(_0x82c5('0x0'));var rimraf=require(_0x82c5('0x1'));var zipdir=require(_0x82c5('0x2'));var jsonpatch=require(_0x82c5('0x3'));var rp=require(_0x82c5('0x4'));var moment=require('moment');var BPromise=require(_0x82c5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x82c5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x82c5('0x7'));var fs=require('fs');var fs_extra=require(_0x82c5('0x8'));var _=require(_0x82c5('0x9'));var squel=require('squel');var crypto=require(_0x82c5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x82c5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x82c5('0xc'));var Papa=require(_0x82c5('0xd'));var Redis=require(_0x82c5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x82c5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82c5('0x10'));var logger=require(_0x82c5('0x11'))(_0x82c5('0x12'));var utils=require(_0x82c5('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x82c5('0x14'))['db'];function respondWithStatusCode(_0x47506f,_0x334fe0){_0x334fe0=_0x334fe0||0xcc;return function(_0x4cce14){if(_0x4cce14){return _0x47506f['sendStatus'](_0x334fe0);}return _0x47506f[_0x82c5('0x15')](_0x334fe0)['end']();};}function respondWithResult(_0x2af3e2,_0x45390e){_0x45390e=_0x45390e||0xc8;return function(_0x397dd8){if(_0x397dd8){return _0x2af3e2['status'](_0x45390e)['json'](_0x397dd8);}};}function respondWithFilteredResult(_0x2b9a1f,_0xdcdd50){return function(_0x19c398){if(_0x19c398){var _0x4301a9=typeof _0xdcdd50['offset']===_0x82c5('0x16')&&typeof _0xdcdd50['limit']==='undefined';var _0x2e5daa=_0x19c398[_0x82c5('0x17')];var _0x149074=_0x4301a9?0x0:_0xdcdd50[_0x82c5('0x18')];var _0x13bc37=_0x4301a9?_0x19c398['count']:_0xdcdd50['offset']+_0xdcdd50[_0x82c5('0x19')];var _0x3fab08;if(_0x13bc37>=_0x2e5daa){_0x13bc37=_0x2e5daa;_0x3fab08=0xc8;}else{_0x3fab08=0xce;}_0x2b9a1f[_0x82c5('0x15')](_0x3fab08);return _0x2b9a1f[_0x82c5('0x1a')]('Content-Range',_0x149074+'-'+_0x13bc37+'/'+_0x2e5daa)[_0x82c5('0x1b')](_0x19c398);}return null;};}function patchUpdates(_0x5aed5c){return function(_0xf1f842){try{jsonpatch['apply'](_0xf1f842,_0x5aed5c,!![]);}catch(_0x57df27){return BPromise['reject'](_0x57df27);}return _0xf1f842[_0x82c5('0x1c')]();};}function saveUpdates(_0x1e03ac,_0x42e5a6){return function(_0x33251a){if(_0x33251a){return _0x33251a[_0x82c5('0x1d')](_0x1e03ac)[_0x82c5('0x1e')](function(_0x16bd17){return _0x16bd17;});}return null;};}function removeEntity(_0x245695,_0x522cbe){return function(_0x1cc67b){if(_0x1cc67b){return _0x1cc67b['destroy']()[_0x82c5('0x1e')](function(){_0x245695[_0x82c5('0x15')](0xcc)[_0x82c5('0x1f')]();});}};}function handleEntityNotFound(_0x8ac740,_0x5c7155){return function(_0x2b2426){if(!_0x2b2426){_0x8ac740[_0x82c5('0x20')](0x194);}return _0x2b2426;};}function handleError(_0x1686cc,_0x3549c1){_0x3549c1=_0x3549c1||0x1f4;return function(_0x5766f5){logger[_0x82c5('0x21')](_0x5766f5[_0x82c5('0x22')]);if(_0x5766f5[_0x82c5('0x23')]){delete _0x5766f5[_0x82c5('0x23')];}_0x1686cc[_0x82c5('0x15')](_0x3549c1)[_0x82c5('0x24')](_0x5766f5);};}exports[_0x82c5('0x25')]=function(_0x308f93,_0x3ae565){var _0xd358e4={},_0x11bb94={},_0x1aebfe={'count':0x0,'rows':[]};var _0xb89113=_[_0x82c5('0x26')](db[_0x82c5('0x27')][_0x82c5('0x28')],function(_0xf27b8f){return{'name':_0xf27b8f[_0x82c5('0x29')],'type':_0xf27b8f[_0x82c5('0x2a')][_0x82c5('0x2b')]};});_0x11bb94[_0x82c5('0x2c')]=_[_0x82c5('0x26')](_0xb89113,_0x82c5('0x23'));_0x11bb94[_0x82c5('0x2d')]=_[_0x82c5('0x2e')](_0x308f93[_0x82c5('0x2d')]);_0x11bb94['filters']=_[_0x82c5('0x2f')](_0x11bb94[_0x82c5('0x2c')],_0x11bb94[_0x82c5('0x2d')]);_0x11bb94['filters']=_[_0x82c5('0x30')](_0x11bb94['filters'],[_0x82c5('0x31'),_0x82c5('0x32'),_0x82c5('0x33'),'$gte',_0x82c5('0x34'),'$lte','$ne',_0x82c5('0x35'),_0x82c5('0x36'),'$between',_0x82c5('0x37'),'$in',_0x82c5('0x38'),'$like',_0x82c5('0x39'),_0x82c5('0x3a'),_0x82c5('0x3b'),_0x82c5('0x3c'),_0x82c5('0x3d'),'$contains','$contained',_0x82c5('0x3e')]);_0xd358e4[_0x82c5('0x3f')]=_[_0x82c5('0x2f')](_0x11bb94['model'],qs['fields'](_0x308f93[_0x82c5('0x2d')]['fields']));_0xd358e4[_0x82c5('0x3f')]=_0xd358e4['attributes'][_0x82c5('0x40')]?_0xd358e4['attributes']:_0x11bb94['model'];if(!_0x308f93['query']['hasOwnProperty']('nolimit')){_0xd358e4[_0x82c5('0x19')]=qs[_0x82c5('0x19')](_0x308f93[_0x82c5('0x2d')][_0x82c5('0x19')]);_0xd358e4['offset']=qs[_0x82c5('0x18')](_0x308f93['query'][_0x82c5('0x18')]);}_0xd358e4[_0x82c5('0x41')]=qs[_0x82c5('0x42')](_0x308f93[_0x82c5('0x2d')][_0x82c5('0x42')]);_0xd358e4['where']=qs['filters'](_[_0x82c5('0x43')](_0x308f93[_0x82c5('0x2d')],_0x11bb94[_0x82c5('0x44')]),_0xb89113);if(_0x308f93[_0x82c5('0x2d')][_0x82c5('0x45')]){_0xd358e4[_0x82c5('0x46')]=_[_0x82c5('0x47')](_0xd358e4[_0x82c5('0x46')],{'$or':_['map'](_0xb89113,function(_0x4ec464){if(_0x4ec464[_0x82c5('0x2a')]!==_0x82c5('0x48')){var _0x4bac34={};_0x4bac34[_0x4ec464[_0x82c5('0x23')]]={'$like':'%'+_0x308f93[_0x82c5('0x2d')][_0x82c5('0x45')]+'%'};return _0x4bac34;}})});}_0xd358e4=_[_0x82c5('0x47')]({},_0xd358e4,_0x308f93[_0x82c5('0x49')]);var _0x447912={'where':_0xd358e4[_0x82c5('0x46')]};return db['CmHopper'][_0x82c5('0x17')](_0x447912)[_0x82c5('0x1e')](function(_0x11dfd6){_0x1aebfe['count']=_0x11dfd6;if(_0x308f93[_0x82c5('0x2d')][_0x82c5('0x4a')]){_0xd358e4[_0x82c5('0x4b')]=[{'all':!![]}];}return db['CmHopper'][_0x82c5('0x4c')](_0xd358e4);})[_0x82c5('0x1e')](function(_0xc33ea3){_0x1aebfe[_0x82c5('0x4d')]=_0xc33ea3;return _0x1aebfe;})[_0x82c5('0x1e')](respondWithFilteredResult(_0x3ae565,_0xd358e4))[_0x82c5('0x4e')](handleError(_0x3ae565,null));};exports[_0x82c5('0x4f')]=function(_0x69b212,_0x1295e8){var _0x2eb0a3={'raw':!![],'where':{'id':_0x69b212[_0x82c5('0x50')]['id']}},_0x42fbfb={};_0x42fbfb['model']=_[_0x82c5('0x2e')](db[_0x82c5('0x27')][_0x82c5('0x28')]);_0x42fbfb[_0x82c5('0x2d')]=_[_0x82c5('0x2e')](_0x69b212['query']);_0x42fbfb['filters']=_[_0x82c5('0x2f')](_0x42fbfb[_0x82c5('0x2c')],_0x42fbfb[_0x82c5('0x2d')]);_0x2eb0a3['attributes']=_[_0x82c5('0x2f')](_0x42fbfb[_0x82c5('0x2c')],qs[_0x82c5('0x51')](_0x69b212[_0x82c5('0x2d')][_0x82c5('0x51')]));_0x2eb0a3[_0x82c5('0x3f')]=_0x2eb0a3['attributes'][_0x82c5('0x40')]?_0x2eb0a3[_0x82c5('0x3f')]:_0x42fbfb[_0x82c5('0x2c')];if(_0x69b212['query'][_0x82c5('0x4a')]){_0x2eb0a3[_0x82c5('0x4b')]=[{'all':!![]}];}_0x2eb0a3=_['merge']({},_0x2eb0a3,_0x69b212[_0x82c5('0x49')]);return db[_0x82c5('0x27')][_0x82c5('0x52')](_0x2eb0a3)[_0x82c5('0x1e')](handleEntityNotFound(_0x1295e8,null))[_0x82c5('0x1e')](respondWithResult(_0x1295e8,null))[_0x82c5('0x4e')](handleError(_0x1295e8,null));};exports[_0x82c5('0x53')]=function(_0x499b2c,_0x17e9e6){return db[_0x82c5('0x27')][_0x82c5('0x53')](_0x499b2c['body'],{})['then'](respondWithResult(_0x17e9e6,0xc9))[_0x82c5('0x4e')](handleError(_0x17e9e6,null));};exports['update']=function(_0x4ff60f,_0x10db18){if(_0x4ff60f[_0x82c5('0x54')]['id']){delete _0x4ff60f[_0x82c5('0x54')]['id'];}return db[_0x82c5('0x27')][_0x82c5('0x52')]({'where':{'id':_0x4ff60f['params']['id']}})[_0x82c5('0x1e')](handleEntityNotFound(_0x10db18,null))[_0x82c5('0x1e')](saveUpdates(_0x4ff60f[_0x82c5('0x54')],null))[_0x82c5('0x1e')](respondWithResult(_0x10db18,null))['catch'](handleError(_0x10db18,null));};exports[_0x82c5('0x55')]=function(_0x476c83,_0x4669f1){return db[_0x82c5('0x27')][_0x82c5('0x55')]()['then'](respondWithResult(_0x4669f1,null))[_0x82c5('0x4e')](handleError(_0x4669f1,null));};exports['destroy']=function(_0x364265,_0x4b8b03){var _0x2e3475;return db[_0x82c5('0x27')]['find']({'where':{'id':_0x364265[_0x82c5('0x50')]['id']}})[_0x82c5('0x1e')](handleEntityNotFound(_0x4b8b03,null))[_0x82c5('0x1e')](function(_0x3c979b){if(_0x3c979b){return _0x3c979b[_0x82c5('0x56')]()[_0x82c5('0x1e')](function(_0x1b6ac3){return _0x1b6ac3;});}})[_0x82c5('0x1e')](function(_0xec1de){_0x2e3475=_0xec1de;if(_0xec1de){if(_0xec1de[_0x82c5('0x57')]||_0xec1de[_0x82c5('0x58')]){return db[_0xec1de[_0x82c5('0x57')]?'VoiceQueue':_0x82c5('0x59')][_0x82c5('0x52')]({'where':{'id':_0xec1de[_0x82c5('0x57')]?_0xec1de[_0x82c5('0x57')]:_0xec1de[_0x82c5('0x58')]},'attributes':['id',_0x82c5('0x23')],'raw':!![]});}}})[_0x82c5('0x1e')](function(_0x51f1b9){var _0x5a581e={};if(_0x51f1b9){_['merge'](_0x5a581e,_[_0x82c5('0x5a')](_0x2e3475['dataValues'],['createdAt',_0x82c5('0x5b'),'id']));_0x5a581e[_0x82c5('0x5c')]=0x15;_0x5a581e[_0x82c5('0x5d')]=_0x82c5('0x5e');_0x5a581e['campaign']=_0x51f1b9[_0x82c5('0x23')];_0x5a581e[_0x82c5('0x5f')]=_0x364265[_0x82c5('0x60')][_0x82c5('0x23')];_0x5a581e['UserId']=_0x364265[_0x82c5('0x60')]['id'];_0x5a581e[_0x82c5('0x5e')]=!![];_0x5a581e[_0x82c5('0x61')]=moment()[_0x82c5('0x62')](_0x82c5('0x63'));_0x5a581e['calleridnum']=_0x2e3475[_0x82c5('0x64')];_0x5a581e['campaigntype']=_0x2e3475[_0x82c5('0x57')]?'queue':_0x82c5('0x65');return db[_0x82c5('0x66')][_0x82c5('0x52')]({'where':{'id':_0x5a581e[_0x82c5('0x67')]},'attributes':['firstName',_0x82c5('0x68')]})[_0x82c5('0x1e')](function(_0xd945fd){if(!_['isNil'](_0x4b8b03)&&!_[_0x82c5('0x69')](_0xd945fd[_0x82c5('0x6a')])){_0x5a581e[_0x82c5('0x6b')]=_0xd945fd[_0x82c5('0x6a')];if(!_[_0x82c5('0x69')](_0xd945fd[_0x82c5('0x68')])){_0x5a581e['calleridname']+='\x20'+_0xd945fd['lastName'];}}})[_0x82c5('0x6c')](function(){return db[_0x82c5('0x6d')][_0x82c5('0x53')](_0x5a581e);});}})[_0x82c5('0x1e')](function(){return _0x4b8b03[_0x82c5('0x15')](0xcc)[_0x82c5('0x1f')]();})[_0x82c5('0x4e')](handleError(_0x4b8b03,null));};exports[_0x82c5('0x6e')]=function(_0x4cd217,_0x10a47a,_0x287630){var _0x19f1d4=[];return db[_0x82c5('0x66')]['describe']()['then'](function(_0x2a4315){_0x19f1d4=_[_0x82c5('0x2e')](_0x2a4315);return _0x4cd217[_0x82c5('0x60')]['getVoiceQueues']({'where':{'type':_0x82c5('0x6f'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x82c5('0x70')],'raw':!![]});})['then'](function(_0x4875d6){if(_0x4875d6&&_0x4875d6[_0x82c5('0x40')]){return db['sequelize'][_0x82c5('0x71')](function(_0x5e4312){var _0x2a39bb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x82c5('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x82c5('0x26')](_0x4875d6,'id')},'$or':[{'UserId':null},{'UserId':_0x4cd217[_0x82c5('0x60')]['id']}]};var _0x3dc16c=[];if(_0x4cd217['body'][_0x82c5('0x72')]&&_0x4cd217[_0x82c5('0x54')]['direction']===_0x82c5('0x73')){if(!_[_0x82c5('0x74')](_0x4cd217[_0x82c5('0x54')][_0x82c5('0x75')])){_0x2a39bb['id']={'$in':_0x4cd217[_0x82c5('0x54')][_0x82c5('0x75')]};}_0x3dc16c=[['priority',_0x82c5('0x76')],[_0x82c5('0x77'),_0x4875d6[0x0][_0x82c5('0x70')]===_0x82c5('0x76')?_0x82c5('0x78'):_0x82c5('0x76')],db[_0x82c5('0x79')][_0x82c5('0x7a')](_0x82c5('0x7b')),['id',_0x82c5('0x78')]];}else{if(!_[_0x82c5('0x74')](_0x4cd217[_0x82c5('0x54')]['hopperIds'])){_0x2a39bb['id']={'$notIn':_0x4cd217['body'][_0x82c5('0x75')]};}_0x3dc16c=[[_0x82c5('0x7c'),_0x82c5('0x78')],[_0x82c5('0x77'),_0x4875d6[0x0][_0x82c5('0x70')]],db[_0x82c5('0x79')]['literal'](_0x82c5('0x7d')),['id',_0x82c5('0x76')]];}return db[_0x82c5('0x27')][_0x82c5('0x7e')]({'attributes':['id',_0x82c5('0x7f')],'where':_0x2a39bb,'order':_0x3dc16c,'transaction':_0x5e4312,'lock':_0x5e4312[_0x82c5('0x80')][_0x82c5('0x81')],'include':[{'model':db['CmContact'],'as':_0x82c5('0x82'),'attributes':_0x19f1d4,'include':[{'model':db[_0x82c5('0x83')],'as':_0x82c5('0x84'),'attributes':['id','name']}]},{'model':db[_0x82c5('0x85')],'as':_0x82c5('0x86'),'attributes':['id',_0x82c5('0x23')]},{'model':db[_0x82c5('0x87')],'as':_0x82c5('0x88'),'attributes':['id',_0x82c5('0x23'),_0x82c5('0x89')]}]})[_0x82c5('0x1e')](function(_0xf8428a){if(_0xf8428a){return _0xf8428a['update']({'UserId':_0x4cd217[_0x82c5('0x60')]['id']},{'transaction':_0x5e4312});}});});}})[_0x82c5('0x1e')](handleEntityNotFound(_0x10a47a,null))[_0x82c5('0x1e')](respondWithResult(_0x10a47a,null))[_0x82c5('0x4e')](handleError(_0x10a47a,null));};exports[_0x82c5('0x8a')]=function(_0x3d04ef,_0x8957c,_0x26e9a0){return _0x3d04ef[_0x82c5('0x60')][_0x82c5('0x8b')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x82c5('0x8c')},'attributes':['id'],'raw':!![]})[_0x82c5('0x1e')](function(_0x2668b1){if(_0x2668b1&&_0x2668b1[_0x82c5('0x40')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x82c5('0x62')](_0x82c5('0x63'))},'VoiceQueueId':{'$in':_[_0x82c5('0x26')](_0x2668b1,'id')},'$or':[{'UserId':null},{'UserId':_0x3d04ef[_0x82c5('0x60')]['id']}]}});}return 0x0;})[_0x82c5('0x1e')](function(_0x94e396){if(!_[_0x82c5('0x69')](_0x94e396)&&_[_0x82c5('0x8d')](_0x94e396)){return _0x8957c[_0x82c5('0x15')](0xc8)[_0x82c5('0x1b')]({'contacts':_0x94e396});}else{logger[_0x82c5('0x21')](_0x82c5('0x8e'),_0x82c5('0x8a'),0x194,_0x82c5('0x8f'));_0x8957c[_0x82c5('0x20')](0x194);}})[_0x82c5('0x4e')](handleError(_0x8957c,null));};
\ No newline at end of file
index 7061fe1..cd8fa15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['exports','define','cm_hopper','scheduledat','phone','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes'];(function(_0x21120c,_0x352f55){var _0x2cd561=function(_0xe5f298){while(--_0xe5f298){_0x21120c['push'](_0x21120c['shift']());}};_0x2cd561(++_0x352f55);}(_0xeda8,0x104));var _0x8eda=function(_0xac95e2,_0x2bfc1a){_0xac95e2=_0xac95e2-0x0;var _0x2ddb52=_0xeda8[_0xac95e2];return _0x2ddb52;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('CmHopper',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[{'name':_0x8eda('0xd'),'fields':[_0x8eda('0xd')]},{'name':_0x8eda('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x687b=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0xa087f5,_0x34fd10){_0xa087f5=_0xa087f5-0x0;var _0x4c8806=_0x687b[_0xa087f5];return _0x4c8806;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]},{'name':'phone','fields':[_0xb687('0xd')]},{'name':_0xb687('0xe'),'fields':[_0xb687('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 8812ffc..e04f4f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3b9=['literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','LOCK','all','GetCmHopperPreview','keys','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopper','options','raw','where','limit','include','map','model','attributes','GetCmHopper','ShowCmHopper','find','CreateCmHopper','body','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','findAll','UPDATE','CmContact','Contact','User','Agent','voicePause','length','push','MoveContactManagedDialer','transaction','create','COUNT'];(function(_0x75f3fd,_0x1bcfa1){var _0x40c64d=function(_0x39a019){while(--_0x39a019){_0x75f3fd['push'](_0x75f3fd['shift']());}};_0x40c64d(++_0x1bcfa1);}(_0xf3b9,0x1be));var _0x9f3b=function(_0x823229,_0x1710e2){_0x823229=_0x823229-0x0;var _0x2d2103=_0xf3b9[_0x823229];return _0x2d2103;};'use strict';var _=require(_0x9f3b('0x0'));var util=require(_0x9f3b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9f3b('0x2'));var fs=require('fs');var Redis=require(_0x9f3b('0x3'));var db=require(_0x9f3b('0x4'))['db'];var utils=require(_0x9f3b('0x5'));var logger=require(_0x9f3b('0x6'))(_0x9f3b('0x7'));var config=require(_0x9f3b('0x8'));var jayson=require(_0x9f3b('0x9'));var client=jayson[_0x9f3b('0xa')][_0x9f3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a5e15,_0x42d921,_0x259307){return new BPromise(function(_0x2fbbf9,_0x6a2f2b){return client[_0x9f3b('0xc')](_0x1a5e15,_0x259307)[_0x9f3b('0xd')](function(_0xe42fd0){logger[_0x9f3b('0xe')](_0x9f3b('0xf'),_0x42d921,_0x9f3b('0x10'));logger[_0x9f3b('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x42d921,'request\x20sent',JSON[_0x9f3b('0x12')](_0xe42fd0));if(_0xe42fd0[_0x9f3b('0x13')]){if(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x14')]===0x1f4){logger['error'](_0x9f3b('0xf'),_0x42d921,_0xe42fd0['error'][_0x9f3b('0x15')]);return _0x6a2f2b(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x15')]);}logger['error'](_0x9f3b('0xf'),_0x42d921,_0xe42fd0['error'][_0x9f3b('0x15')]);return _0x2fbbf9(_0xe42fd0[_0x9f3b('0x13')][_0x9f3b('0x15')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x42d921,'request\x20sent');_0x2fbbf9(_0xe42fd0[_0x9f3b('0x16')]['message']);}})[_0x9f3b('0x17')](function(_0x1bb4cc){logger[_0x9f3b('0x13')]('CmHopper,\x20%s,\x20%s',_0x42d921,_0x1bb4cc);_0x6a2f2b(_0x1bb4cc);});});}exports['GetCmHopper']=function(_0x5c5b93){var _0xbce5a2=this;return new Promise(function(_0x5975eb,_0x595a6c){return db[_0x9f3b('0x18')]['findAll']({'raw':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c5b93['options']?_0x5c5b93['options'][_0x9f3b('0x1b')]||null:null,'attributes':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')]['attributes']||null:null,'limit':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'include':_0x5c5b93[_0x9f3b('0x19')]?_0x5c5b93[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x5c5b93['options'][_0x9f3b('0x1d')],function(_0x47869a){return{'model':db[_0x47869a[_0x9f3b('0x1f')]],'as':_0x47869a['as'],'attributes':_0x47869a[_0x9f3b('0x20')],'include':_0x47869a[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x47869a[_0x9f3b('0x1d')],function(_0x31bd57){return{'model':db[_0x31bd57[_0x9f3b('0x1f')]],'as':_0x31bd57['as'],'attributes':_0x31bd57['attributes'],'include':_0x31bd57[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x31bd57['include'],function(_0x53f1b7){return{'model':db[_0x53f1b7[_0x9f3b('0x1f')]],'as':_0x53f1b7['as'],'attributes':_0x53f1b7[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0xa9a118){logger['info'](_0x9f3b('0x21'),_0x5c5b93);logger[_0x9f3b('0x11')](_0x9f3b('0x21'),_0x5c5b93,JSON[_0x9f3b('0x12')](_0xa9a118));_0x5975eb(_0xa9a118);})[_0x9f3b('0x17')](function(_0x161266){logger[_0x9f3b('0x13')]('GetCmHopper',_0x161266[_0x9f3b('0x15')],_0x5c5b93);_0x595a6c(_0xbce5a2['error'](0x1f4,_0x161266[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x22')]=function(_0x2bcd0a){var _0x4ad01e=this;return new Promise(function(_0x1fc013,_0x5304bf){return db[_0x9f3b('0x18')][_0x9f3b('0x23')]({'raw':_0x2bcd0a['options']?_0x2bcd0a['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a[_0x9f3b('0x19')]['where']||null:null,'attributes':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a['options'][_0x9f3b('0x20')]||null:null,'include':_0x2bcd0a[_0x9f3b('0x19')]?_0x2bcd0a[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x2bcd0a[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0x197a82){return{'model':db[_0x197a82['model']],'as':_0x197a82['as'],'attributes':_0x197a82[_0x9f3b('0x20')],'include':_0x197a82['include']?_['map'](_0x197a82[_0x9f3b('0x1d')],function(_0x1ec8d9){return{'model':db[_0x1ec8d9['model']],'as':_0x1ec8d9['as'],'attributes':_0x1ec8d9[_0x9f3b('0x20')],'include':_0x1ec8d9[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x1ec8d9[_0x9f3b('0x1d')],function(_0x16afa9){return{'model':db[_0x16afa9['model']],'as':_0x16afa9['as'],'attributes':_0x16afa9[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0xe3a4b5){logger['info'](_0x9f3b('0x22'),_0x2bcd0a);logger[_0x9f3b('0x11')](_0x9f3b('0x22'),_0x2bcd0a,JSON[_0x9f3b('0x12')](_0xe3a4b5));_0x1fc013(_0xe3a4b5);})[_0x9f3b('0x17')](function(_0x44e8f4){logger[_0x9f3b('0x13')](_0x9f3b('0x22'),_0x44e8f4['message'],_0x2bcd0a);_0x5304bf(_0x4ad01e[_0x9f3b('0x13')](0x1f4,_0x44e8f4[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x24')]=function(_0x449937){var _0x5a5df4=this;return new Promise(function(_0x5c97ff,_0x84f20b){return db[_0x9f3b('0x18')]['create'](_0x449937[_0x9f3b('0x25')],{'raw':_0x449937[_0x9f3b('0x19')]?_0x449937[_0x9f3b('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58d12a){logger[_0x9f3b('0xe')](_0x9f3b('0x24'),_0x449937);logger[_0x9f3b('0x11')]('CreateCmHopper',_0x449937,JSON[_0x9f3b('0x12')](_0x58d12a));_0x5c97ff(_0x58d12a);})[_0x9f3b('0x17')](function(_0x2250ad){logger[_0x9f3b('0x13')](_0x9f3b('0x24'),_0x2250ad[_0x9f3b('0x15')],_0x449937);_0x84f20b(_0x5a5df4['error'](0x1f4,_0x2250ad['message']));});});};exports['UpdateCmHopper']=function(_0x2dd274){var _0x2488bd=this;return new Promise(function(_0x539c7e,_0x36580b){return db[_0x9f3b('0x18')][_0x9f3b('0x26')](_0x2dd274[_0x9f3b('0x25')],{'raw':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274['options'][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')]['attributes']||null:null,'limit':_0x2dd274[_0x9f3b('0x19')]?_0x2dd274[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null})[_0x9f3b('0xd')](function(_0x5cceab){logger[_0x9f3b('0xe')](_0x9f3b('0x27'),_0x2dd274);logger['debug'](_0x9f3b('0x27'),_0x2dd274,JSON['stringify'](_0x5cceab));_0x539c7e(_0x5cceab);})[_0x9f3b('0x17')](function(_0x591e72){logger[_0x9f3b('0x13')](_0x9f3b('0x27'),_0x591e72[_0x9f3b('0x15')],_0x2dd274);_0x36580b(_0x2488bd[_0x9f3b('0x13')](0x1f4,_0x591e72[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x28')]=function(_0x273652){var _0x4c42f3=this;return new Promise(function(_0x257636,_0x55a66e){return db['CmHopper'][_0x9f3b('0x29')]({'where':_0x273652[_0x9f3b('0x19')]?_0x273652[_0x9f3b('0x19')]['where']||null:null})[_0x9f3b('0xd')](function(_0xbee772){logger[_0x9f3b('0xe')]('DestroyCmHopper',_0x273652);logger['debug'](_0x9f3b('0x28'),_0x273652,JSON[_0x9f3b('0x12')](_0xbee772));_0x257636(_0xbee772);})[_0x9f3b('0x17')](function(_0x5475bc){logger['error']('DestroyCmHopper',_0x5475bc[_0x9f3b('0x15')],_0x273652);_0x55a66e(_0x4c42f3['error'](0x1f4,_0x5475bc[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x2a')]=function(_0x5399fc){var _0x2d5846=this;return new Promise(function(_0x5a9419,_0x3356bb){return db['CmContact'][_0x9f3b('0x2b')]()[_0x9f3b('0xd')](function(_0x3839cc){return db[_0x9f3b('0x2c')]['transaction'](function(_0x3239d){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'where':_0x5399fc[_0x9f3b('0x19')]?_0x5399fc[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':_0x5399fc['options']?_0x5399fc['options'][_0x9f3b('0x20')]||null:null,'limit':_0x5399fc['options']?_0x5399fc[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'order':_0x5399fc[_0x9f3b('0x19')]?_0x5399fc[_0x9f3b('0x19')]['order']||null:null,'transaction':_0x3239d,'lock':_0x3239d['LOCK'][_0x9f3b('0x2e')],'include':[{'model':db[_0x9f3b('0x2f')],'as':_0x9f3b('0x30'),'attributes':_['keys'](_0x3839cc)},{'model':db[_0x9f3b('0x31')],'as':_0x9f3b('0x32'),'attributes':['id','name',_0x9f3b('0x33')]}]})[_0x9f3b('0xd')](function(_0x282be8){var _0x4567ce=[];var _0x5d0de3=[];for(var _0x4cd325=0x0;_0x4cd325<_0x282be8[_0x9f3b('0x34')];_0x4cd325+=0x1){var _0x6d9b57=_0x282be8[_0x4cd325]['UserId'];if(_0x6d9b57===null){_0x4567ce['push'](_0x282be8[_0x4cd325][_0x9f3b('0x26')](_0x5399fc[_0x9f3b('0x25')],{'transaction':_0x3239d}));}else if(!_0x5d0de3['includes'](_0x6d9b57)){_0x5d0de3[_0x9f3b('0x35')](_0x6d9b57);_0x4567ce[_0x9f3b('0x35')](_0x282be8[_0x4cd325][_0x9f3b('0x26')](_0x5399fc[_0x9f3b('0x25')],{'transaction':_0x3239d}));}}return BPromise['all'](_0x4567ce);});})[_0x9f3b('0xd')](function(_0x346a26){logger['info'](_0x9f3b('0x2a'),_0x5399fc);logger[_0x9f3b('0x11')]('GetContactDialer',_0x5399fc,JSON[_0x9f3b('0x12')](_0x346a26));_0x5a9419(_0x346a26);})['catch'](function(_0x3dff88){logger['error'](_0x9f3b('0x2a'),_0x3dff88[_0x9f3b('0x15')],_0x5399fc);_0x3356bb(_0x2d5846[_0x9f3b('0x13')](0x1f4,_0x3dff88[_0x9f3b('0x15')]));});});});};exports[_0x9f3b('0x36')]=function(_0x33088d){var _0x5316c1=this;return new Promise(function(_0x441398,_0x25f9d8){return db[_0x9f3b('0x2c')][_0x9f3b('0x37')](function(_0x56df40){return db['CmHopperFinal'][_0x9f3b('0x38')](_0x33088d['body'],{'raw':_0x33088d[_0x9f3b('0x19')]?_0x33088d[_0x9f3b('0x19')][_0x9f3b('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x56df40})[_0x9f3b('0xd')](function(){return db[_0x9f3b('0x18')][_0x9f3b('0x29')]({'where':_0x33088d[_0x9f3b('0x19')]?_0x33088d['options'][_0x9f3b('0x1b')]||null:null,'transaction':_0x56df40});});})[_0x9f3b('0xd')](function(_0x36a811){logger['info'](_0x9f3b('0x36'),_0x33088d);logger[_0x9f3b('0x11')]('MoveContactManagedDialer',_0x33088d,JSON['stringify'](_0x36a811));_0x441398(_0x36a811);})[_0x9f3b('0x17')](function(_0x462af7){logger[_0x9f3b('0x13')](_0x9f3b('0x36'),_0x462af7[_0x9f3b('0x15')],_0x33088d);_0x25f9d8(_0x5316c1['error'](0x1f4,_0x462af7[_0x9f3b('0x15')]));});});};exports['CountReScheduled']=function(_0x41e4d6){var _0x35ccbe=this;return new Promise(function(_0x4d6581,_0x10ffd5){return db[_0x9f3b('0x18')]['findAll']({'raw':_0x41e4d6[_0x9f3b('0x19')]?_0x41e4d6[_0x9f3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x41e4d6[_0x9f3b('0x19')]?_0x41e4d6[_0x9f3b('0x19')][_0x9f3b('0x1b')]||null:null,'attributes':[[db[_0x9f3b('0x2c')]['fn'](_0x9f3b('0x39'),db['sequelize']['fn']('IF',db[_0x9f3b('0x2c')][_0x9f3b('0x3a')](_0x9f3b('0x3b')+util[_0x9f3b('0x3c')](_0x9f3b('0x3d'),moment()['format'](_0x9f3b('0x3e')))+_0x9f3b('0x3f')))),_0x9f3b('0x40')]]})['then'](function(_0x1638d1){logger[_0x9f3b('0xe')](_0x9f3b('0x41'),_0x41e4d6);logger[_0x9f3b('0x11')](_0x9f3b('0x41'),_0x41e4d6,JSON[_0x9f3b('0x12')](_0x1638d1));_0x4d6581(_0x1638d1);})[_0x9f3b('0x17')](function(_0x34a222){logger[_0x9f3b('0x13')]('CountReScheduled',_0x34a222['message'],_0x41e4d6);_0x10ffd5(_0x35ccbe[_0x9f3b('0x13')](0x1f4,_0x34a222[_0x9f3b('0x15')]));});});};exports[_0x9f3b('0x42')]=function(_0x385146){var _0x1714f0=this;return new Promise(function(_0x1fd4a3,_0x3eca2c){return db[_0x9f3b('0x2f')][_0x9f3b('0x2b')]()[_0x9f3b('0xd')](function(_0xf8330a){return db[_0x9f3b('0x2c')][_0x9f3b('0x37')](function(_0x55e0da){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'where':_0x385146[_0x9f3b('0x19')]?_0x385146[_0x9f3b('0x19')]['where']||null:null,'attributes':_0x385146[_0x9f3b('0x19')]?_0x385146[_0x9f3b('0x19')][_0x9f3b('0x20')]||null:null,'limit':0x1,'order':_0x385146[_0x9f3b('0x19')]?_0x385146['options'][_0x9f3b('0x43')]||null:null,'group':db[_0x9f3b('0x18')]['UserId'],'transaction':_0x55e0da,'lock':_0x55e0da[_0x9f3b('0x44')][_0x9f3b('0x2e')],'include':_0x385146[_0x9f3b('0x19')]?_0x385146['options'][_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x385146[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0x417409){return{'model':db[_0x417409['model']],'as':_0x417409['as'],'attributes':_0x417409[_0x9f3b('0x20')],'include':_0x417409['include']?_[_0x9f3b('0x1e')](_0x417409[_0x9f3b('0x1d')],function(_0x3bbdd7){return{'model':db[_0x3bbdd7[_0x9f3b('0x1f')]],'as':_0x3bbdd7['as'],'attributes':_0x3bbdd7['attributes'],'include':_0x3bbdd7[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x3bbdd7[_0x9f3b('0x1d')],function(_0x11c9a9){return{'model':db[_0x11c9a9['model']],'as':_0x11c9a9['as'],'attributes':_0x11c9a9[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0x502afd){var _0x2e095d=[];for(var _0x1860b9=0x0;_0x1860b9<_0x502afd[_0x9f3b('0x34')];_0x1860b9+=0x1){_0x2e095d[_0x9f3b('0x35')](_0x502afd[_0x1860b9][_0x9f3b('0x26')](_0x385146[_0x9f3b('0x25')],{'transaction':_0x55e0da}));}return BPromise[_0x9f3b('0x45')](_0x2e095d);});})[_0x9f3b('0xd')](function(_0x13b5e0){logger[_0x9f3b('0xe')]('GetContactRecallMe',_0x385146);logger[_0x9f3b('0x11')]('GetContactRecallMe',_0x385146,JSON[_0x9f3b('0x12')](_0x13b5e0));_0x1fd4a3(_0x13b5e0);})[_0x9f3b('0x17')](function(_0x5f4f79){logger['error'](_0x9f3b('0x42'),_0x5f4f79['message'],_0x385146);_0x3eca2c(_0x1714f0[_0x9f3b('0x13')](0x1f4,_0x5f4f79[_0x9f3b('0x15')]));});});});};exports[_0x9f3b('0x46')]=function(_0x4483a2){var _0x1578bf=this;return new Promise(function(_0x51f521,_0x37a3ae){db['CmContact']['describe']()['then'](function(_0x1ea800){return db[_0x9f3b('0x18')][_0x9f3b('0x2d')]({'raw':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2['options'][_0x9f3b('0x1b')]||null:null,'attributes':_0x4483a2['options']?_0x4483a2['options']['attributes']||null:null,'limit':_0x4483a2['options']?_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1c')]||null:null,'include':_0x4483a2[_0x9f3b('0x19')]?_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1d')]?_['map'](_0x4483a2[_0x9f3b('0x19')][_0x9f3b('0x1d')],function(_0xfd6dc2){return{'model':db[_0xfd6dc2[_0x9f3b('0x1f')]],'as':_0xfd6dc2['as'],'attributes':_0xfd6dc2['as']===_0x9f3b('0x30')?_[_0x9f3b('0x47')](_0x1ea800):_0xfd6dc2[_0x9f3b('0x20')],'include':_0xfd6dc2['include']?_[_0x9f3b('0x1e')](_0xfd6dc2[_0x9f3b('0x1d')],function(_0x1147e9){return{'model':db[_0x1147e9[_0x9f3b('0x1f')]],'as':_0x1147e9['as'],'attributes':_0x1147e9[_0x9f3b('0x20')],'include':_0x1147e9[_0x9f3b('0x1d')]?_[_0x9f3b('0x1e')](_0x1147e9[_0x9f3b('0x1d')],function(_0x2cd00a){return{'model':db[_0x2cd00a[_0x9f3b('0x1f')]],'as':_0x2cd00a['as'],'attributes':_0x2cd00a[_0x9f3b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xd')](function(_0x4637b4){logger[_0x9f3b('0xe')](_0x9f3b('0x21'),_0x4483a2);logger['debug'](_0x9f3b('0x21'),_0x4483a2,JSON[_0x9f3b('0x12')](_0x4637b4));_0x51f521(_0x4637b4);})[_0x9f3b('0x17')](function(_0x225d53){logger['error'](_0x9f3b('0x21'),_0x225d53[_0x9f3b('0x15')],_0x4483a2);_0x37a3ae(_0x1578bf[_0x9f3b('0x13')](0x1f4,_0x225d53[_0x9f3b('0x15')]));});});});};
\ No newline at end of file
+var _0x7482=['transaction','order','LOCK','Contact','keys','Agent','length','push','includes','all','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','UserId','UPDATE','GetCmHopperPreview','describe','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize'];(function(_0x348f19,_0x2badb0){var _0x2e4291=function(_0xf62019){while(--_0xf62019){_0x348f19['push'](_0x348f19['shift']());}};_0x2e4291(++_0x2badb0);}(_0x7482,0x181));var _0x2748=function(_0x273492,_0x4aebb2){_0x273492=_0x273492-0x0;var _0x4e4787=_0x7482[_0x273492];return _0x4e4787;};'use strict';var _=require('lodash');var util=require(_0x2748('0x0'));var moment=require(_0x2748('0x1'));var BPromise=require(_0x2748('0x2'));var rs=require(_0x2748('0x3'));var fs=require('fs');var Redis=require(_0x2748('0x4'));var db=require(_0x2748('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2748('0x6'))(_0x2748('0x7'));var config=require(_0x2748('0x8'));var jayson=require(_0x2748('0x9'));var client=jayson[_0x2748('0xa')][_0x2748('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25a2b4,_0x327fd4,_0x38fe6c){return new BPromise(function(_0x22b0dd,_0x187840){return client[_0x2748('0xc')](_0x25a2b4,_0x38fe6c)[_0x2748('0xd')](function(_0xb34812){logger[_0x2748('0xe')](_0x2748('0xf'),_0x327fd4,_0x2748('0x10'));logger['debug'](_0x2748('0x11'),_0x327fd4,'request\x20sent',JSON[_0x2748('0x12')](_0xb34812));if(_0xb34812[_0x2748('0x13')]){if(_0xb34812['error']['code']===0x1f4){logger[_0x2748('0x13')](_0x2748('0xf'),_0x327fd4,_0xb34812[_0x2748('0x13')][_0x2748('0x14')]);return _0x187840(_0xb34812[_0x2748('0x13')][_0x2748('0x14')]);}logger[_0x2748('0x13')](_0x2748('0xf'),_0x327fd4,_0xb34812['error'][_0x2748('0x14')]);return _0x22b0dd(_0xb34812['error'][_0x2748('0x14')]);}else{logger[_0x2748('0xe')](_0x2748('0xf'),_0x327fd4,_0x2748('0x10'));_0x22b0dd(_0xb34812[_0x2748('0x15')][_0x2748('0x14')]);}})[_0x2748('0x16')](function(_0x4615d5){logger['error']('CmHopper,\x20%s,\x20%s',_0x327fd4,_0x4615d5);_0x187840(_0x4615d5);});});}exports[_0x2748('0x17')]=function(_0x5d69fb){var _0x234d4d=this;return new Promise(function(_0x2deb69,_0x37ca05){return db[_0x2748('0x18')][_0x2748('0x19')]({'raw':_0x5d69fb[_0x2748('0x1a')]?_0x5d69fb[_0x2748('0x1a')][_0x2748('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d69fb[_0x2748('0x1a')]?_0x5d69fb[_0x2748('0x1a')][_0x2748('0x1c')]||null:null,'attributes':_0x5d69fb['options']?_0x5d69fb[_0x2748('0x1a')]['attributes']||null:null,'limit':_0x5d69fb['options']?_0x5d69fb[_0x2748('0x1a')][_0x2748('0x1d')]||null:null,'include':_0x5d69fb[_0x2748('0x1a')]?_0x5d69fb[_0x2748('0x1a')][_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x5d69fb['options'][_0x2748('0x1e')],function(_0x216f3b){return{'model':db[_0x216f3b[_0x2748('0x20')]],'as':_0x216f3b['as'],'attributes':_0x216f3b[_0x2748('0x21')],'include':_0x216f3b['include']?_['map'](_0x216f3b['include'],function(_0x5e4a6e){return{'model':db[_0x5e4a6e[_0x2748('0x20')]],'as':_0x5e4a6e['as'],'attributes':_0x5e4a6e[_0x2748('0x21')],'include':_0x5e4a6e[_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x5e4a6e['include'],function(_0x5e6995){return{'model':db[_0x5e6995[_0x2748('0x20')]],'as':_0x5e6995['as'],'attributes':_0x5e6995[_0x2748('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa8e21d){logger[_0x2748('0xe')](_0x2748('0x17'),_0x5d69fb);logger[_0x2748('0x22')]('GetCmHopper',_0x5d69fb,JSON[_0x2748('0x12')](_0xa8e21d));_0x2deb69(_0xa8e21d);})[_0x2748('0x16')](function(_0x135c7d){logger[_0x2748('0x13')](_0x2748('0x17'),_0x135c7d['message'],_0x5d69fb);_0x37ca05(_0x234d4d[_0x2748('0x13')](0x1f4,_0x135c7d[_0x2748('0x14')]));});});};exports[_0x2748('0x23')]=function(_0x4dfbc4){var _0x58a99c=this;return new Promise(function(_0x5a7d42,_0x149a81){return db['CmHopper'][_0x2748('0x24')]({'raw':_0x4dfbc4[_0x2748('0x1a')]?_0x4dfbc4[_0x2748('0x1a')][_0x2748('0x1b')]===undefined?!![]:![]:!![],'where':_0x4dfbc4[_0x2748('0x1a')]?_0x4dfbc4['options'][_0x2748('0x1c')]||null:null,'attributes':_0x4dfbc4[_0x2748('0x1a')]?_0x4dfbc4[_0x2748('0x1a')]['attributes']||null:null,'include':_0x4dfbc4[_0x2748('0x1a')]?_0x4dfbc4[_0x2748('0x1a')][_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x4dfbc4[_0x2748('0x1a')][_0x2748('0x1e')],function(_0x388251){return{'model':db[_0x388251[_0x2748('0x20')]],'as':_0x388251['as'],'attributes':_0x388251[_0x2748('0x21')],'include':_0x388251['include']?_[_0x2748('0x1f')](_0x388251['include'],function(_0x20e538){return{'model':db[_0x20e538[_0x2748('0x20')]],'as':_0x20e538['as'],'attributes':_0x20e538[_0x2748('0x21')],'include':_0x20e538['include']?_[_0x2748('0x1f')](_0x20e538['include'],function(_0xf6f603){return{'model':db[_0xf6f603[_0x2748('0x20')]],'as':_0xf6f603['as'],'attributes':_0xf6f603[_0x2748('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x479adc){logger[_0x2748('0xe')](_0x2748('0x23'),_0x4dfbc4);logger[_0x2748('0x22')](_0x2748('0x23'),_0x4dfbc4,JSON[_0x2748('0x12')](_0x479adc));_0x5a7d42(_0x479adc);})['catch'](function(_0x5c421c){logger[_0x2748('0x13')](_0x2748('0x23'),_0x5c421c[_0x2748('0x14')],_0x4dfbc4);_0x149a81(_0x58a99c[_0x2748('0x13')](0x1f4,_0x5c421c[_0x2748('0x14')]));});});};exports[_0x2748('0x25')]=function(_0x4d227b){var _0x541eb4=this;return new Promise(function(_0x7ef534,_0x4091ae){return db[_0x2748('0x18')][_0x2748('0x26')](_0x4d227b['body'],{'raw':_0x4d227b[_0x2748('0x1a')]?_0x4d227b[_0x2748('0x1a')][_0x2748('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x4e0013){logger[_0x2748('0xe')](_0x2748('0x25'),_0x4d227b);logger[_0x2748('0x22')](_0x2748('0x25'),_0x4d227b,JSON[_0x2748('0x12')](_0x4e0013));_0x7ef534(_0x4e0013);})[_0x2748('0x16')](function(_0x5ef4f9){logger[_0x2748('0x13')](_0x2748('0x25'),_0x5ef4f9['message'],_0x4d227b);_0x4091ae(_0x541eb4[_0x2748('0x13')](0x1f4,_0x5ef4f9['message']));});});};exports[_0x2748('0x27')]=function(_0x456565){var _0x22c94c=this;return new Promise(function(_0x1dbddb,_0x39b0f6){return db[_0x2748('0x18')][_0x2748('0x28')](_0x456565[_0x2748('0x29')],{'raw':_0x456565['options']?_0x456565[_0x2748('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456565[_0x2748('0x1a')]?_0x456565[_0x2748('0x1a')][_0x2748('0x1c')]||null:null,'attributes':_0x456565[_0x2748('0x1a')]?_0x456565['options'][_0x2748('0x21')]||null:null,'limit':_0x456565[_0x2748('0x1a')]?_0x456565[_0x2748('0x1a')][_0x2748('0x1d')]||null:null})[_0x2748('0xd')](function(_0x559a7e){logger[_0x2748('0xe')](_0x2748('0x27'),_0x456565);logger[_0x2748('0x22')](_0x2748('0x27'),_0x456565,JSON['stringify'](_0x559a7e));_0x1dbddb(_0x559a7e);})[_0x2748('0x16')](function(_0x4c8205){logger[_0x2748('0x13')](_0x2748('0x27'),_0x4c8205[_0x2748('0x14')],_0x456565);_0x39b0f6(_0x22c94c[_0x2748('0x13')](0x1f4,_0x4c8205[_0x2748('0x14')]));});});};exports[_0x2748('0x2a')]=function(_0x3b656e){var _0x1803ea=this;return new Promise(function(_0x18e861,_0x3c5790){return db[_0x2748('0x18')][_0x2748('0x2b')]({'where':_0x3b656e['options']?_0x3b656e[_0x2748('0x1a')]['where']||null:null})[_0x2748('0xd')](function(_0xc51d8b){logger[_0x2748('0xe')]('DestroyCmHopper',_0x3b656e);logger[_0x2748('0x22')](_0x2748('0x2a'),_0x3b656e,JSON[_0x2748('0x12')](_0xc51d8b));_0x18e861(_0xc51d8b);})['catch'](function(_0x4e5433){logger[_0x2748('0x13')]('DestroyCmHopper',_0x4e5433[_0x2748('0x14')],_0x3b656e);_0x3c5790(_0x1803ea['error'](0x1f4,_0x4e5433['message']));});});};exports[_0x2748('0x2c')]=function(_0x261035){var _0x514fdf=this;return new Promise(function(_0x2f8eaa,_0x288ce3){return db[_0x2748('0x2d')]['describe']()[_0x2748('0xd')](function(_0x4274f2){return db[_0x2748('0x2e')][_0x2748('0x2f')](function(_0x2b1922){return db['CmHopper'][_0x2748('0x19')]({'where':_0x261035[_0x2748('0x1a')]?_0x261035[_0x2748('0x1a')]['where']||null:null,'attributes':_0x261035[_0x2748('0x1a')]?_0x261035[_0x2748('0x1a')][_0x2748('0x21')]||null:null,'limit':_0x261035[_0x2748('0x1a')]?_0x261035[_0x2748('0x1a')][_0x2748('0x1d')]||null:null,'order':_0x261035['options']?_0x261035[_0x2748('0x1a')][_0x2748('0x30')]||null:null,'transaction':_0x2b1922,'lock':_0x2b1922[_0x2748('0x31')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x2748('0x32'),'attributes':_[_0x2748('0x33')](_0x4274f2)},{'model':db['User'],'as':_0x2748('0x34'),'attributes':['id','name','voicePause']}]})[_0x2748('0xd')](function(_0x276b8c){var _0x2f6e9a=[];var _0x172d42=[];for(var _0x11d621=0x0;_0x11d621<_0x276b8c[_0x2748('0x35')];_0x11d621+=0x1){var _0x344e08=_0x276b8c[_0x11d621]['UserId'];if(_0x344e08===null){_0x2f6e9a[_0x2748('0x36')](_0x276b8c[_0x11d621][_0x2748('0x28')](_0x261035[_0x2748('0x29')],{'transaction':_0x2b1922}));}else if(!_0x172d42[_0x2748('0x37')](_0x344e08)){_0x172d42[_0x2748('0x36')](_0x344e08);_0x2f6e9a[_0x2748('0x36')](_0x276b8c[_0x11d621][_0x2748('0x28')](_0x261035[_0x2748('0x29')],{'transaction':_0x2b1922}));}}return BPromise[_0x2748('0x38')](_0x2f6e9a);});})['then'](function(_0x1b1127){logger[_0x2748('0xe')](_0x2748('0x2c'),_0x261035);logger['debug'](_0x2748('0x2c'),_0x261035,JSON[_0x2748('0x12')](_0x1b1127));_0x2f8eaa(_0x1b1127);})[_0x2748('0x16')](function(_0x2712a8){logger['error'](_0x2748('0x2c'),_0x2712a8[_0x2748('0x14')],_0x261035);_0x288ce3(_0x514fdf['error'](0x1f4,_0x2712a8[_0x2748('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x1c3eba){var _0x267e26=this;return new Promise(function(_0x1d5321,_0x25bc7d){return db[_0x2748('0x2e')][_0x2748('0x2f')](function(_0x3bf152){return db[_0x2748('0x39')]['create'](_0x1c3eba[_0x2748('0x29')],{'raw':_0x1c3eba[_0x2748('0x1a')]?_0x1c3eba['options'][_0x2748('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x3bf152})[_0x2748('0xd')](function(){return db[_0x2748('0x18')]['destroy']({'where':_0x1c3eba[_0x2748('0x1a')]?_0x1c3eba[_0x2748('0x1a')]['where']||null:null,'transaction':_0x3bf152});});})['then'](function(_0x479d8a){logger[_0x2748('0xe')](_0x2748('0x3a'),_0x1c3eba);logger[_0x2748('0x22')](_0x2748('0x3a'),_0x1c3eba,JSON[_0x2748('0x12')](_0x479d8a));_0x1d5321(_0x479d8a);})[_0x2748('0x16')](function(_0x2d730b){logger['error'](_0x2748('0x3a'),_0x2d730b['message'],_0x1c3eba);_0x25bc7d(_0x267e26[_0x2748('0x13')](0x1f4,_0x2d730b['message']));});});};exports[_0x2748('0x3b')]=function(_0x3af960){var _0x12865a=this;return new Promise(function(_0xc997f1,_0x1b0358){return db[_0x2748('0x18')][_0x2748('0x19')]({'raw':_0x3af960[_0x2748('0x1a')]?_0x3af960[_0x2748('0x1a')][_0x2748('0x1b')]===undefined?!![]:![]:!![],'where':_0x3af960['options']?_0x3af960['options'][_0x2748('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2748('0x3c'),db[_0x2748('0x2e')]['fn']('IF',db['sequelize'][_0x2748('0x3d')](_0x2748('0x3e')+util[_0x2748('0x3f')](_0x2748('0x40'),moment()[_0x2748('0x3f')](_0x2748('0x41')))+'\x20,\x201,\x20null'))),_0x2748('0x42')]]})[_0x2748('0xd')](function(_0x1f3357){logger[_0x2748('0xe')](_0x2748('0x3b'),_0x3af960);logger[_0x2748('0x22')](_0x2748('0x3b'),_0x3af960,JSON[_0x2748('0x12')](_0x1f3357));_0xc997f1(_0x1f3357);})[_0x2748('0x16')](function(_0x50590c){logger[_0x2748('0x13')]('CountReScheduled',_0x50590c[_0x2748('0x14')],_0x3af960);_0x1b0358(_0x12865a[_0x2748('0x13')](0x1f4,_0x50590c[_0x2748('0x14')]));});});};exports[_0x2748('0x43')]=function(_0x41e85){var _0x93af98=this;return new Promise(function(_0x452b4b,_0xe78e53){return db[_0x2748('0x2d')]['describe']()['then'](function(_0x1864eb){return db[_0x2748('0x2e')][_0x2748('0x2f')](function(_0x49120d){return db['CmHopper'][_0x2748('0x19')]({'where':_0x41e85[_0x2748('0x1a')]?_0x41e85[_0x2748('0x1a')][_0x2748('0x1c')]||null:null,'attributes':_0x41e85[_0x2748('0x1a')]?_0x41e85[_0x2748('0x1a')][_0x2748('0x21')]||null:null,'limit':0x1,'order':_0x41e85[_0x2748('0x1a')]?_0x41e85[_0x2748('0x1a')][_0x2748('0x30')]||null:null,'group':db[_0x2748('0x18')][_0x2748('0x44')],'transaction':_0x49120d,'lock':_0x49120d[_0x2748('0x31')][_0x2748('0x45')],'include':_0x41e85[_0x2748('0x1a')]?_0x41e85[_0x2748('0x1a')][_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x41e85['options'][_0x2748('0x1e')],function(_0x1817e7){return{'model':db[_0x1817e7[_0x2748('0x20')]],'as':_0x1817e7['as'],'attributes':_0x1817e7[_0x2748('0x21')],'include':_0x1817e7[_0x2748('0x1e')]?_['map'](_0x1817e7[_0x2748('0x1e')],function(_0x37e48f){return{'model':db[_0x37e48f[_0x2748('0x20')]],'as':_0x37e48f['as'],'attributes':_0x37e48f[_0x2748('0x21')],'include':_0x37e48f[_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x37e48f[_0x2748('0x1e')],function(_0x475c73){return{'model':db[_0x475c73[_0x2748('0x20')]],'as':_0x475c73['as'],'attributes':_0x475c73[_0x2748('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2748('0xd')](function(_0xd82f5c){var _0x84a3f9=[];for(var _0x3235dd=0x0;_0x3235dd<_0xd82f5c['length'];_0x3235dd+=0x1){_0x84a3f9['push'](_0xd82f5c[_0x3235dd][_0x2748('0x28')](_0x41e85[_0x2748('0x29')],{'transaction':_0x49120d}));}return BPromise['all'](_0x84a3f9);});})[_0x2748('0xd')](function(_0x8dad83){logger['info'](_0x2748('0x43'),_0x41e85);logger[_0x2748('0x22')](_0x2748('0x43'),_0x41e85,JSON['stringify'](_0x8dad83));_0x452b4b(_0x8dad83);})[_0x2748('0x16')](function(_0x40b1c8){logger[_0x2748('0x13')](_0x2748('0x43'),_0x40b1c8[_0x2748('0x14')],_0x41e85);_0xe78e53(_0x93af98[_0x2748('0x13')](0x1f4,_0x40b1c8[_0x2748('0x14')]));});});});};exports[_0x2748('0x46')]=function(_0x248198){var _0x495c02=this;return new Promise(function(_0x42f0fe,_0x174d39){db[_0x2748('0x2d')][_0x2748('0x47')]()[_0x2748('0xd')](function(_0x382656){return db[_0x2748('0x18')][_0x2748('0x19')]({'raw':_0x248198[_0x2748('0x1a')]?_0x248198['options'][_0x2748('0x1b')]===undefined?!![]:![]:!![],'where':_0x248198['options']?_0x248198[_0x2748('0x1a')]['where']||null:null,'attributes':_0x248198[_0x2748('0x1a')]?_0x248198[_0x2748('0x1a')][_0x2748('0x21')]||null:null,'limit':_0x248198[_0x2748('0x1a')]?_0x248198[_0x2748('0x1a')][_0x2748('0x1d')]||null:null,'include':_0x248198[_0x2748('0x1a')]?_0x248198[_0x2748('0x1a')][_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x248198[_0x2748('0x1a')]['include'],function(_0x2ae789){return{'model':db[_0x2ae789[_0x2748('0x20')]],'as':_0x2ae789['as'],'attributes':_0x2ae789['as']===_0x2748('0x32')?_[_0x2748('0x33')](_0x382656):_0x2ae789[_0x2748('0x21')],'include':_0x2ae789[_0x2748('0x1e')]?_[_0x2748('0x1f')](_0x2ae789['include'],function(_0x1bb77d){return{'model':db[_0x1bb77d[_0x2748('0x20')]],'as':_0x1bb77d['as'],'attributes':_0x1bb77d[_0x2748('0x21')],'include':_0x1bb77d['include']?_[_0x2748('0x1f')](_0x1bb77d[_0x2748('0x1e')],function(_0x3fd39e){return{'model':db[_0x3fd39e[_0x2748('0x20')]],'as':_0x3fd39e['as'],'attributes':_0x3fd39e[_0x2748('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2748('0xd')](function(_0x392564){logger[_0x2748('0xe')]('GetCmHopper',_0x248198);logger[_0x2748('0x22')]('GetCmHopper',_0x248198,JSON[_0x2748('0x12')](_0x392564));_0x42f0fe(_0x392564);})[_0x2748('0x16')](function(_0x1d0d15){logger[_0x2748('0x13')](_0x2748('0x17'),_0x1d0d15[_0x2748('0x14')],_0x248198);_0x174d39(_0x495c02[_0x2748('0x13')](0x1f4,_0x1d0d15['message']));});});});};
\ No newline at end of file
index 463c4de..e9c46f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf49=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x398b3d,_0x53a2a0){var _0x4230e7=function(_0x209e4c){while(--_0x209e4c){_0x398b3d['push'](_0x398b3d['shift']());}};_0x4230e7(++_0x53a2a0);}(_0xbf49,0x1f0));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9bf4('0x0'));var path=require(_0x9bf4('0x1'));var timeout=require('connect-timeout');var express=require(_0x9bf4('0x2'));var router=express['Router']();var fs_extra=require(_0x9bf4('0x3'));var auth=require(_0x9bf4('0x4'));var interaction=require(_0x9bf4('0x5'));var config=require(_0x9bf4('0x6'));var controller=require('./cmHopper.controller');router[_0x9bf4('0x7')]('/',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x9')]);router[_0x9bf4('0x7')](_0x9bf4('0xa'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0xb')]);router['get'](_0x9bf4('0xc'),auth['isAuthenticated'](),controller[_0x9bf4('0xd')]);router['get'](_0x9bf4('0xe'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0xf')]);router[_0x9bf4('0x10')]('/',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x11')]);router[_0x9bf4('0x10')](_0x9bf4('0x12'),auth['isAuthenticated'](),controller[_0x9bf4('0x13')]);router[_0x9bf4('0x14')]('/:id',auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x15')]);router[_0x9bf4('0x16')](_0x9bf4('0xe'),auth[_0x9bf4('0x8')](),controller[_0x9bf4('0x17')]);module[_0x9bf4('0x18')]=router;
\ No newline at end of file
+var _0xc274=['show','post','create','getPreview','update','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id'];(function(_0x41159b,_0x18ae88){var _0x5bea4e=function(_0x95177e){while(--_0x95177e){_0x41159b['push'](_0x41159b['shift']());}};_0x5bea4e(++_0x18ae88);}(_0xc274,0x17e));var _0x4c27=function(_0x175f09,_0x4996f5){_0x175f09=_0x175f09-0x0;var _0x187417=_0xc274[_0x175f09];return _0x187417;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c27('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4c27('0x1')]();var fs_extra=require(_0x4c27('0x2'));var auth=require(_0x4c27('0x3'));var interaction=require(_0x4c27('0x4'));var config=require(_0x4c27('0x5'));var controller=require(_0x4c27('0x6'));router[_0x4c27('0x7')]('/',auth[_0x4c27('0x8')](),controller[_0x4c27('0x9')]);router[_0x4c27('0x7')](_0x4c27('0xa'),auth[_0x4c27('0x8')](),controller['describe']);router[_0x4c27('0x7')](_0x4c27('0xb'),auth['isAuthenticated'](),controller[_0x4c27('0xc')]);router[_0x4c27('0x7')](_0x4c27('0xd'),auth['isAuthenticated'](),controller[_0x4c27('0xe')]);router[_0x4c27('0xf')]('/',auth[_0x4c27('0x8')](),controller[_0x4c27('0x10')]);router[_0x4c27('0xf')]('/preview',auth[_0x4c27('0x8')](),controller[_0x4c27('0x11')]);router['put'](_0x4c27('0xd'),auth[_0x4c27('0x8')](),controller[_0x4c27('0x12')]);router[_0x4c27('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4c27('0x14')]);module[_0x4c27('0x15')]=router;
\ No newline at end of file
index d3b2f3a..cd55599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd714=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x4276fb,_0x51bab2){var _0x6469dc=function(_0x3cdc42){while(--_0x3cdc42){_0x4276fb['push'](_0x4276fb['shift']());}};_0x6469dc(++_0x51bab2);}(_0xd714,0x1e4));var _0x4d71=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xd714[_0x2142c8];return _0x4286e9;};'use strict';var moment=require(_0x4d71('0x0'));var Sequelize=require(_0x4d71('0x1'));module['exports']={'phone':{'type':Sequelize[_0x4d71('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4d71('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4d71('0x4')},'VoiceQueueId':{'type':Sequelize[_0x4d71('0x3')],'unique':_0x4d71('0x4')}};
\ No newline at end of file
+var _0xe626=['INTEGER','moment','sequelize','exports','STRING','contactListQueue'];(function(_0x535d6e,_0x3579e3){var _0x49bc77=function(_0x57a618){while(--_0x57a618){_0x535d6e['push'](_0x535d6e['shift']());}};_0x49bc77(++_0x3579e3);}(_0xe626,0x9d));var _0x6e62=function(_0x38de9c,_0xcd7035){_0x38de9c=_0x38de9c-0x0;var _0x5020a4=_0xe626[_0x38de9c];return _0x5020a4;};'use strict';var moment=require(_0x6e62('0x0'));var Sequelize=require(_0x6e62('0x1'));module[_0x6e62('0x2')]={'phone':{'type':Sequelize[_0x6e62('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x6e62('0x4')},'ListId':{'type':Sequelize[_0x6e62('0x5')],'unique':_0x6e62('0x4')},'VoiceQueueId':{'type':Sequelize[_0x6e62('0x5')],'unique':_0x6e62('0x4')}};
\ No newline at end of file
index 54aa40b..0fa5be9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39bd=['sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','intersection','find','catch','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5eb7d2,_0x3327a4){var _0x6d7f92=function(_0x225660){while(--_0x225660){_0x5eb7d2['push'](_0x5eb7d2['shift']());}};_0x6d7f92(++_0x3327a4);}(_0x39bd,0x7c));var _0xd39b=function(_0x367d24,_0x309534){_0x367d24=_0x367d24-0x0;var _0x4432d9=_0x39bd[_0x367d24];return _0x4432d9;};'use strict';var emlformat=require(_0xd39b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd39b('0x1'));var rp=require('request-promise');var moment=require(_0xd39b('0x2'));var BPromise=require(_0xd39b('0x3'));var Mustache=require(_0xd39b('0x4'));var util=require(_0xd39b('0x5'));var path=require(_0xd39b('0x6'));var sox=require(_0xd39b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd39b('0x8'));var _=require(_0xd39b('0x9'));var squel=require(_0xd39b('0xa'));var crypto=require(_0xd39b('0xb'));var jsforce=require(_0xd39b('0xc'));var deskjs=require(_0xd39b('0xd'));var toCsv=require(_0xd39b('0xe'));var querystring=require('querystring');var Papa=require(_0xd39b('0xf'));var Redis=require(_0xd39b('0x10'));var authService=require(_0xd39b('0x11'));var qs=require(_0xd39b('0x12'));var as=require(_0xd39b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd39b('0x14'))(_0xd39b('0x15'));var utils=require(_0xd39b('0x16'));var config=require(_0xd39b('0x17'));var licenseUtil=require(_0xd39b('0x18'));var db=require(_0xd39b('0x19'))['db'];function respondWithStatusCode(_0x1c41d6,_0x33ba97){_0x33ba97=_0x33ba97||0xcc;return function(_0x35c576){if(_0x35c576){return _0x1c41d6[_0xd39b('0x1a')](_0x33ba97);}return _0x1c41d6[_0xd39b('0x1b')](_0x33ba97)['end']();};}function respondWithResult(_0x51ade2,_0x4d12b9){_0x4d12b9=_0x4d12b9||0xc8;return function(_0x2af409){if(_0x2af409){return _0x51ade2['status'](_0x4d12b9)['json'](_0x2af409);}};}function respondWithFilteredResult(_0x55b3ba,_0x341d60){return function(_0x2def47){if(_0x2def47){var _0x13db19=typeof _0x341d60['offset']===_0xd39b('0x1c')&&typeof _0x341d60[_0xd39b('0x1d')]===_0xd39b('0x1c');var _0x3407d3=_0x2def47['count'];var _0x3921ad=_0x13db19?0x0:_0x341d60[_0xd39b('0x1e')];var _0x13d83c=_0x13db19?_0x2def47['count']:_0x341d60[_0xd39b('0x1e')]+_0x341d60['limit'];var _0x96732c;if(_0x13d83c>=_0x3407d3){_0x13d83c=_0x3407d3;_0x96732c=0xc8;}else{_0x96732c=0xce;}_0x55b3ba['status'](_0x96732c);return _0x55b3ba[_0xd39b('0x1f')](_0xd39b('0x20'),_0x3921ad+'-'+_0x13d83c+'/'+_0x3407d3)[_0xd39b('0x21')](_0x2def47);}return null;};}function patchUpdates(_0x995406){return function(_0x5a2cd6){try{jsonpatch[_0xd39b('0x22')](_0x5a2cd6,_0x995406,!![]);}catch(_0x5a0d5b){return BPromise[_0xd39b('0x23')](_0x5a0d5b);}return _0x5a2cd6[_0xd39b('0x24')]();};}function saveUpdates(_0x243657,_0x4d947c){return function(_0x21d108){if(_0x21d108){return _0x21d108[_0xd39b('0x25')](_0x243657)[_0xd39b('0x26')](function(_0x10950a){return _0x10950a;});}return null;};}function removeEntity(_0x5092ad,_0x1f3c93){return function(_0x5949bb){if(_0x5949bb){return _0x5949bb[_0xd39b('0x27')]()[_0xd39b('0x26')](function(){_0x5092ad[_0xd39b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46a54a,_0x5d2ac5){return function(_0x240567){if(!_0x240567){_0x46a54a['sendStatus'](0x194);}return _0x240567;};}function handleError(_0x14c18c,_0x405558){_0x405558=_0x405558||0x1f4;return function(_0x2a2fc0){logger[_0xd39b('0x28')](_0x2a2fc0['stack']);if(_0x2a2fc0[_0xd39b('0x29')]){delete _0x2a2fc0[_0xd39b('0x29')];}_0x14c18c[_0xd39b('0x1b')](_0x405558)['send'](_0x2a2fc0);};}exports[_0xd39b('0x2a')]=function(_0x109eca,_0x3d1a41){var _0x3dff89={},_0x71270f={},_0x36cafd={'count':0x0,'rows':[]};var _0x272bfc=_[_0xd39b('0x2b')](db[_0xd39b('0x2c')][_0xd39b('0x2d')],function(_0x1d0f1b){return{'name':_0x1d0f1b[_0xd39b('0x2e')],'type':_0x1d0f1b['type'][_0xd39b('0x2f')]};});_0x71270f[_0xd39b('0x30')]=_['map'](_0x272bfc,_0xd39b('0x29'));_0x71270f['query']=_[_0xd39b('0x31')](_0x109eca[_0xd39b('0x32')]);_0x71270f[_0xd39b('0x33')]=_['intersection'](_0x71270f['model'],_0x71270f[_0xd39b('0x32')]);_0x3dff89[_0xd39b('0x34')]=_['intersection'](_0x71270f[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x35')]));_0x3dff89['attributes']=_0x3dff89[_0xd39b('0x34')][_0xd39b('0x36')]?_0x3dff89['attributes']:_0x71270f['model'];if(!_0x109eca['query']['hasOwnProperty'](_0xd39b('0x37'))){_0x3dff89[_0xd39b('0x1d')]=qs[_0xd39b('0x1d')](_0x109eca[_0xd39b('0x32')][_0xd39b('0x1d')]);_0x3dff89[_0xd39b('0x1e')]=qs[_0xd39b('0x1e')](_0x109eca[_0xd39b('0x32')]['offset']);}_0x3dff89[_0xd39b('0x38')]=qs[_0xd39b('0x39')](_0x109eca[_0xd39b('0x32')]['sort']);_0x3dff89[_0xd39b('0x3a')]=qs[_0xd39b('0x33')](_['pick'](_0x109eca['query'],_0x71270f['filters']),_0x272bfc);if(_0x109eca['query'][_0xd39b('0x3b')]){_0x3dff89[_0xd39b('0x3a')]=_[_0xd39b('0x3c')](_0x3dff89[_0xd39b('0x3a')],{'$or':_[_0xd39b('0x2b')](_0x272bfc,function(_0x322f49){if(_0x322f49[_0xd39b('0x3d')]!==_0xd39b('0x3e')){var _0x533905={};_0x533905[_0x322f49[_0xd39b('0x29')]]={'$like':'%'+_0x109eca[_0xd39b('0x32')]['filter']+'%'};return _0x533905;}})});}_0x3dff89=_[_0xd39b('0x3c')]({},_0x3dff89,_0x109eca['options']);var _0x9cb3a6={'where':_0x3dff89[_0xd39b('0x3a')]};return db[_0xd39b('0x2c')][_0xd39b('0x3f')](_0x9cb3a6)['then'](function(_0x3a4567){_0x36cafd[_0xd39b('0x3f')]=_0x3a4567;if(_0x109eca[_0xd39b('0x32')][_0xd39b('0x40')]){_0x3dff89[_0xd39b('0x41')]=[{'all':!![]}];}return db[_0xd39b('0x2c')][_0xd39b('0x42')](_0x3dff89);})[_0xd39b('0x26')](function(_0xd083ad){_0x36cafd[_0xd39b('0x43')]=_0xd083ad;return _0x36cafd;})[_0xd39b('0x26')](respondWithFilteredResult(_0x3d1a41,_0x3dff89))['catch'](handleError(_0x3d1a41,null));};exports[_0xd39b('0x44')]=function(_0x2657f5,_0x487c75){var _0x35ab7f={'raw':!![],'where':{'id':_0x2657f5['params']['id']}},_0x49f112={};_0x49f112['model']=_['keys'](db[_0xd39b('0x2c')][_0xd39b('0x2d')]);_0x49f112[_0xd39b('0x32')]=_[_0xd39b('0x31')](_0x2657f5[_0xd39b('0x32')]);_0x49f112[_0xd39b('0x33')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],_0x49f112[_0xd39b('0x32')]);_0x35ab7f[_0xd39b('0x34')]=_[_0xd39b('0x45')](_0x49f112[_0xd39b('0x30')],qs[_0xd39b('0x35')](_0x2657f5['query'][_0xd39b('0x35')]));_0x35ab7f[_0xd39b('0x34')]=_0x35ab7f[_0xd39b('0x34')][_0xd39b('0x36')]?_0x35ab7f[_0xd39b('0x34')]:_0x49f112[_0xd39b('0x30')];if(_0x2657f5[_0xd39b('0x32')][_0xd39b('0x40')]){_0x35ab7f[_0xd39b('0x41')]=[{'all':!![]}];}_0x35ab7f=_[_0xd39b('0x3c')]({},_0x35ab7f,_0x2657f5['options']);return db[_0xd39b('0x2c')][_0xd39b('0x46')](_0x35ab7f)[_0xd39b('0x26')](handleEntityNotFound(_0x487c75,null))[_0xd39b('0x26')](respondWithResult(_0x487c75,null))[_0xd39b('0x47')](handleError(_0x487c75,null));};exports[_0xd39b('0x25')]=function(_0x2f2db1,_0x189ba8){if(_0x2f2db1['body']['id']){delete _0x2f2db1[_0xd39b('0x48')]['id'];}return db[_0xd39b('0x2c')]['find']({'where':{'id':_0x2f2db1[_0xd39b('0x49')]['id']}})[_0xd39b('0x26')](handleEntityNotFound(_0x189ba8,null))[_0xd39b('0x26')](saveUpdates(_0x2f2db1[_0xd39b('0x48')],null))[_0xd39b('0x26')](respondWithResult(_0x189ba8,null))[_0xd39b('0x47')](handleError(_0x189ba8,null));};exports[_0xd39b('0x27')]=function(_0x3e9f07,_0x34e74c){return db['CmHopperBlack'][_0xd39b('0x46')]({'where':{'id':_0x3e9f07[_0xd39b('0x49')]['id']}})[_0xd39b('0x26')](handleEntityNotFound(_0x34e74c,null))[_0xd39b('0x26')](removeEntity(_0x34e74c,null))[_0xd39b('0x47')](handleError(_0x34e74c,null));};exports[_0xd39b('0x4a')]=function(_0x3a8d4c,_0x3552f4){return db['CmHopperBlack'][_0xd39b('0x4a')]()[_0xd39b('0x26')](respondWithResult(_0x3552f4,null))[_0xd39b('0x47')](handleError(_0x3552f4,null));};
\ No newline at end of file
+var _0x6fb0=['error','name','send','index','map','CmHopperBlack','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','merge','options','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','then','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6fb0,0x6a));var _0x06fb=function(_0x26d625,_0x33ee89){_0x26d625=_0x26d625-0x0;var _0x3d53b0=_0x6fb0[_0x26d625];return _0x3d53b0;};'use strict';var emlformat=require(_0x06fb('0x0'));var rimraf=require(_0x06fb('0x1'));var zipdir=require(_0x06fb('0x2'));var jsonpatch=require(_0x06fb('0x3'));var rp=require(_0x06fb('0x4'));var moment=require(_0x06fb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x06fb('0x6'));var sox=require(_0x06fb('0x7'));var csv=require(_0x06fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06fb('0x9'));var _=require('lodash');var squel=require(_0x06fb('0xa'));var crypto=require('crypto');var jsforce=require(_0x06fb('0xb'));var deskjs=require(_0x06fb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x06fb('0xd'));var Papa=require('papaparse');var Redis=require(_0x06fb('0xe'));var authService=require(_0x06fb('0xf'));var qs=require(_0x06fb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06fb('0x11'));var logger=require(_0x06fb('0x12'))(_0x06fb('0x13'));var utils=require(_0x06fb('0x14'));var config=require(_0x06fb('0x15'));var licenseUtil=require(_0x06fb('0x16'));var db=require(_0x06fb('0x17'))['db'];function respondWithStatusCode(_0x36c847,_0x5a2a32){_0x5a2a32=_0x5a2a32||0xcc;return function(_0x1807ee){if(_0x1807ee){return _0x36c847['sendStatus'](_0x5a2a32);}return _0x36c847[_0x06fb('0x18')](_0x5a2a32)[_0x06fb('0x19')]();};}function respondWithResult(_0xed2a28,_0x1498f2){_0x1498f2=_0x1498f2||0xc8;return function(_0x4734c1){if(_0x4734c1){return _0xed2a28['status'](_0x1498f2)[_0x06fb('0x1a')](_0x4734c1);}};}function respondWithFilteredResult(_0x28b530,_0xd302ca){return function(_0x338ae9){if(_0x338ae9){var _0x441158=typeof _0xd302ca[_0x06fb('0x1b')]===_0x06fb('0x1c')&&typeof _0xd302ca[_0x06fb('0x1d')]==='undefined';var _0x3ae084=_0x338ae9['count'];var _0x1f5f0d=_0x441158?0x0:_0xd302ca[_0x06fb('0x1b')];var _0x14efc9=_0x441158?_0x338ae9[_0x06fb('0x1e')]:_0xd302ca[_0x06fb('0x1b')]+_0xd302ca['limit'];var _0x286903;if(_0x14efc9>=_0x3ae084){_0x14efc9=_0x3ae084;_0x286903=0xc8;}else{_0x286903=0xce;}_0x28b530[_0x06fb('0x18')](_0x286903);return _0x28b530[_0x06fb('0x1f')]('Content-Range',_0x1f5f0d+'-'+_0x14efc9+'/'+_0x3ae084)[_0x06fb('0x1a')](_0x338ae9);}return null;};}function patchUpdates(_0x3845cb){return function(_0xcdd89b){try{jsonpatch['apply'](_0xcdd89b,_0x3845cb,!![]);}catch(_0x172992){return BPromise[_0x06fb('0x20')](_0x172992);}return _0xcdd89b[_0x06fb('0x21')]();};}function saveUpdates(_0xcb2257,_0x1990b7){return function(_0x4e4c5a){if(_0x4e4c5a){return _0x4e4c5a['update'](_0xcb2257)[_0x06fb('0x22')](function(_0x1fafc7){return _0x1fafc7;});}return null;};}function removeEntity(_0xd07f7e,_0x2243fb){return function(_0x1bc375){if(_0x1bc375){return _0x1bc375['destroy']()[_0x06fb('0x22')](function(){_0xd07f7e[_0x06fb('0x18')](0xcc)[_0x06fb('0x19')]();});}};}function handleEntityNotFound(_0x2a03a9,_0xb136f3){return function(_0x330457){if(!_0x330457){_0x2a03a9[_0x06fb('0x23')](0x194);}return _0x330457;};}function handleError(_0x4cd278,_0x45a80d){_0x45a80d=_0x45a80d||0x1f4;return function(_0x9fd179){logger[_0x06fb('0x24')](_0x9fd179['stack']);if(_0x9fd179[_0x06fb('0x25')]){delete _0x9fd179['name'];}_0x4cd278[_0x06fb('0x18')](_0x45a80d)[_0x06fb('0x26')](_0x9fd179);};}exports[_0x06fb('0x27')]=function(_0x4405fc,_0x5d3ec3){var _0x2e5aba={},_0x3856ae={},_0x4b17d6={'count':0x0,'rows':[]};var _0x43e151=_[_0x06fb('0x28')](db[_0x06fb('0x29')][_0x06fb('0x2a')],function(_0x4dd531){return{'name':_0x4dd531['fieldName'],'type':_0x4dd531[_0x06fb('0x2b')][_0x06fb('0x2c')]};});_0x3856ae[_0x06fb('0x2d')]=_[_0x06fb('0x28')](_0x43e151,_0x06fb('0x25'));_0x3856ae[_0x06fb('0x2e')]=_[_0x06fb('0x2f')](_0x4405fc['query']);_0x3856ae[_0x06fb('0x30')]=_['intersection'](_0x3856ae['model'],_0x3856ae['query']);_0x2e5aba[_0x06fb('0x31')]=_[_0x06fb('0x32')](_0x3856ae['model'],qs[_0x06fb('0x33')](_0x4405fc[_0x06fb('0x2e')]['fields']));_0x2e5aba['attributes']=_0x2e5aba[_0x06fb('0x31')][_0x06fb('0x34')]?_0x2e5aba[_0x06fb('0x31')]:_0x3856ae[_0x06fb('0x2d')];if(!_0x4405fc['query']['hasOwnProperty'](_0x06fb('0x35'))){_0x2e5aba[_0x06fb('0x1d')]=qs[_0x06fb('0x1d')](_0x4405fc[_0x06fb('0x2e')][_0x06fb('0x1d')]);_0x2e5aba[_0x06fb('0x1b')]=qs[_0x06fb('0x1b')](_0x4405fc[_0x06fb('0x2e')][_0x06fb('0x1b')]);}_0x2e5aba[_0x06fb('0x36')]=qs[_0x06fb('0x37')](_0x4405fc[_0x06fb('0x2e')]['sort']);_0x2e5aba[_0x06fb('0x38')]=qs[_0x06fb('0x30')](_[_0x06fb('0x39')](_0x4405fc[_0x06fb('0x2e')],_0x3856ae[_0x06fb('0x30')]),_0x43e151);if(_0x4405fc[_0x06fb('0x2e')][_0x06fb('0x3a')]){_0x2e5aba['where']=_['merge'](_0x2e5aba[_0x06fb('0x38')],{'$or':_['map'](_0x43e151,function(_0x11eceb){if(_0x11eceb[_0x06fb('0x2b')]!==_0x06fb('0x3b')){var _0x295208={};_0x295208[_0x11eceb[_0x06fb('0x25')]]={'$like':'%'+_0x4405fc[_0x06fb('0x2e')][_0x06fb('0x3a')]+'%'};return _0x295208;}})});}_0x2e5aba=_['merge']({},_0x2e5aba,_0x4405fc['options']);var _0x55ecbf={'where':_0x2e5aba[_0x06fb('0x38')]};return db['CmHopperBlack']['count'](_0x55ecbf)[_0x06fb('0x22')](function(_0x273cfd){_0x4b17d6[_0x06fb('0x1e')]=_0x273cfd;if(_0x4405fc[_0x06fb('0x2e')][_0x06fb('0x3c')]){_0x2e5aba['include']=[{'all':!![]}];}return db[_0x06fb('0x29')][_0x06fb('0x3d')](_0x2e5aba);})['then'](function(_0x3c5550){_0x4b17d6[_0x06fb('0x3e')]=_0x3c5550;return _0x4b17d6;})[_0x06fb('0x22')](respondWithFilteredResult(_0x5d3ec3,_0x2e5aba))[_0x06fb('0x3f')](handleError(_0x5d3ec3,null));};exports[_0x06fb('0x40')]=function(_0x564774,_0x259f68){var _0x73fdd8={'raw':!![],'where':{'id':_0x564774[_0x06fb('0x41')]['id']}},_0x5c3d0d={};_0x5c3d0d[_0x06fb('0x2d')]=_[_0x06fb('0x2f')](db[_0x06fb('0x29')][_0x06fb('0x2a')]);_0x5c3d0d['query']=_[_0x06fb('0x2f')](_0x564774[_0x06fb('0x2e')]);_0x5c3d0d[_0x06fb('0x30')]=_['intersection'](_0x5c3d0d['model'],_0x5c3d0d[_0x06fb('0x2e')]);_0x73fdd8[_0x06fb('0x31')]=_['intersection'](_0x5c3d0d[_0x06fb('0x2d')],qs['fields'](_0x564774[_0x06fb('0x2e')][_0x06fb('0x33')]));_0x73fdd8[_0x06fb('0x31')]=_0x73fdd8['attributes']['length']?_0x73fdd8[_0x06fb('0x31')]:_0x5c3d0d[_0x06fb('0x2d')];if(_0x564774['query'][_0x06fb('0x3c')]){_0x73fdd8['include']=[{'all':!![]}];}_0x73fdd8=_[_0x06fb('0x42')]({},_0x73fdd8,_0x564774[_0x06fb('0x43')]);return db['CmHopperBlack']['find'](_0x73fdd8)[_0x06fb('0x22')](handleEntityNotFound(_0x259f68,null))[_0x06fb('0x22')](respondWithResult(_0x259f68,null))[_0x06fb('0x3f')](handleError(_0x259f68,null));};exports['update']=function(_0x144631,_0x17d1f6){if(_0x144631[_0x06fb('0x44')]['id']){delete _0x144631['body']['id'];}return db[_0x06fb('0x29')]['find']({'where':{'id':_0x144631[_0x06fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x17d1f6,null))['then'](saveUpdates(_0x144631[_0x06fb('0x44')],null))[_0x06fb('0x22')](respondWithResult(_0x17d1f6,null))[_0x06fb('0x3f')](handleError(_0x17d1f6,null));};exports[_0x06fb('0x45')]=function(_0x450c3c,_0x5e63c9){return db[_0x06fb('0x29')]['find']({'where':{'id':_0x450c3c[_0x06fb('0x41')]['id']}})[_0x06fb('0x22')](handleEntityNotFound(_0x5e63c9,null))[_0x06fb('0x22')](removeEntity(_0x5e63c9,null))[_0x06fb('0x3f')](handleError(_0x5e63c9,null));};exports['describe']=function(_0x576d39,_0xa92ce4){return db[_0x06fb('0x29')][_0x06fb('0x46')]()[_0x06fb('0x22')](respondWithResult(_0xa92ce4,null))[_0x06fb('0x3f')](handleError(_0xa92ce4,null));};
\ No newline at end of file
index 03e76b3..05a3c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd8f=['moment','bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api'];(function(_0x4c7f57,_0x259bba){var _0x30b8e3=function(_0x88bb69){while(--_0x88bb69){_0x4c7f57['push'](_0x4c7f57['shift']());}};_0x30b8e3(++_0x259bba);}(_0xbd8f,0xc0));var _0xfbd8=function(_0x3f9a64,_0x224930){_0x3f9a64=_0x3f9a64-0x0;var _0x353b88=_0xbd8f[_0x3f9a64];return _0x353b88;};'use strict';var _=require(_0xfbd8('0x0'));var util=require(_0xfbd8('0x1'));var logger=require('../../config/logger')(_0xfbd8('0x2'));var moment=require(_0xfbd8('0x3'));var BPromise=require(_0xfbd8('0x4'));var rp=require(_0xfbd8('0x5'));var fs=require('fs');var path=require(_0xfbd8('0x6'));var rimraf=require(_0xfbd8('0x7'));var config=require('../../config/environment');var attributes=require(_0xfbd8('0x8'));module[_0xfbd8('0x9')]=function(_0x591c2f,_0x47c840){return _0x591c2f[_0xfbd8('0xa')](_0xfbd8('0xb'),attributes,{'tableName':_0xfbd8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb13=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cmHopperBlack.attributes','exports','define','lodash'];(function(_0x3c8e7f,_0x5ac5dd){var _0x363d67=function(_0x11c553){while(--_0x11c553){_0x3c8e7f['push'](_0x3c8e7f['shift']());}};_0x363d67(++_0x5ac5dd);}(_0xdb13,0x83));var _0x3db1=function(_0x5ba6d7,_0x3ebc1a){_0x5ba6d7=_0x5ba6d7-0x0;var _0x4a718b=_0xdb13[_0x5ba6d7];return _0x4a718b;};'use strict';var _=require(_0x3db1('0x0'));var util=require(_0x3db1('0x1'));var logger=require(_0x3db1('0x2'))(_0x3db1('0x3'));var moment=require(_0x3db1('0x4'));var BPromise=require(_0x3db1('0x5'));var rp=require(_0x3db1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3db1('0x7'));var config=require('../../config/environment');var attributes=require(_0x3db1('0x8'));module[_0x3db1('0x9')]=function(_0x3a463a,_0xbfbee2){return _0x3a463a[_0x3db1('0xa')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf1cce8..ea428ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e36=['map','include','model','attributes','then','debug','UpdateCmHopperBlack','CmHopperBlack','raw','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','options','where'];(function(_0x32a0bb,_0x21b192){var _0x40b1f8=function(_0x2d84c4){while(--_0x2d84c4){_0x32a0bb['push'](_0x32a0bb['shift']());}};_0x40b1f8(++_0x21b192);}(_0x8e36,0x1ed));var _0x68e3=function(_0x5a5c76,_0x201fd6){_0x5a5c76=_0x5a5c76-0x0;var _0x2f800e=_0x8e36[_0x5a5c76];return _0x2f800e;};'use strict';var _=require(_0x68e3('0x0'));var util=require(_0x68e3('0x1'));var moment=require(_0x68e3('0x2'));var BPromise=require(_0x68e3('0x3'));var rs=require(_0x68e3('0x4'));var fs=require('fs');var Redis=require(_0x68e3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x68e3('0x6'));var logger=require(_0x68e3('0x7'))(_0x68e3('0x8'));var config=require(_0x68e3('0x9'));var jayson=require(_0x68e3('0xa'));var client=jayson['client'][_0x68e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106346,_0x13ba03,_0x2ec115){return new BPromise(function(_0x3cde24,_0x5ae712){return client['request'](_0x106346,_0x2ec115)['then'](function(_0x1fff91){logger['info'](_0x68e3('0xc'),_0x13ba03,_0x68e3('0xd'));logger['debug'](_0x68e3('0xe'),_0x13ba03,_0x68e3('0xd'),JSON[_0x68e3('0xf')](_0x1fff91));if(_0x1fff91[_0x68e3('0x10')]){if(_0x1fff91[_0x68e3('0x10')][_0x68e3('0x11')]===0x1f4){logger[_0x68e3('0x10')](_0x68e3('0xc'),_0x13ba03,_0x1fff91[_0x68e3('0x10')][_0x68e3('0x12')]);return _0x5ae712(_0x1fff91[_0x68e3('0x10')]['message']);}logger[_0x68e3('0x10')](_0x68e3('0xc'),_0x13ba03,_0x1fff91[_0x68e3('0x10')]['message']);return _0x3cde24(_0x1fff91[_0x68e3('0x10')][_0x68e3('0x12')]);}else{logger[_0x68e3('0x13')](_0x68e3('0xc'),_0x13ba03,_0x68e3('0xd'));_0x3cde24(_0x1fff91[_0x68e3('0x14')]['message']);}})[_0x68e3('0x15')](function(_0x16f680){logger['error'](_0x68e3('0xc'),_0x13ba03,_0x16f680);_0x5ae712(_0x16f680);});});}exports[_0x68e3('0x16')]=function(_0xd7a41e){var _0xfe3135=this;return new Promise(function(_0xc560a,_0x3a3239){return db['CmHopperBlack']['findAll']({'raw':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xd7a41e['options']?_0xd7a41e[_0x68e3('0x17')][_0x68e3('0x18')]||null:null,'attributes':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['attributes']||null:null,'limit':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e['options']['limit']||null:null,'include':_0xd7a41e[_0x68e3('0x17')]?_0xd7a41e[_0x68e3('0x17')]['include']?_[_0x68e3('0x19')](_0xd7a41e[_0x68e3('0x17')][_0x68e3('0x1a')],function(_0x1f938c){return{'model':db[_0x1f938c[_0x68e3('0x1b')]],'as':_0x1f938c['as'],'attributes':_0x1f938c['attributes'],'include':_0x1f938c[_0x68e3('0x1a')]?_[_0x68e3('0x19')](_0x1f938c['include'],function(_0x3a4714){return{'model':db[_0x3a4714['model']],'as':_0x3a4714['as'],'attributes':_0x3a4714[_0x68e3('0x1c')],'include':_0x3a4714[_0x68e3('0x1a')]?_[_0x68e3('0x19')](_0x3a4714['include'],function(_0x1f3633){return{'model':db[_0x1f3633['model']],'as':_0x1f3633['as'],'attributes':_0x1f3633[_0x68e3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68e3('0x1d')](function(_0x5509b3){logger[_0x68e3('0x13')]('GetCmHopperBlack',_0xd7a41e);logger[_0x68e3('0x1e')](_0x68e3('0x16'),_0xd7a41e,JSON[_0x68e3('0xf')](_0x5509b3));_0xc560a(_0x5509b3);})[_0x68e3('0x15')](function(_0x5436be){logger[_0x68e3('0x10')]('GetCmHopperBlack',_0x5436be['message'],_0xd7a41e);_0x3a3239(_0xfe3135[_0x68e3('0x10')](0x1f4,_0x5436be['message']));});});};exports[_0x68e3('0x1f')]=function(_0xdbe496){var _0x2caa62=this;return new Promise(function(_0x4d20c1,_0x101648){return db[_0x68e3('0x20')]['update'](_0xdbe496['body'],{'raw':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x18')]||null:null,'attributes':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x1c')]||null:null,'limit':_0xdbe496[_0x68e3('0x17')]?_0xdbe496[_0x68e3('0x17')][_0x68e3('0x22')]||null:null})['then'](function(_0x208444){logger['info']('UpdateCmHopperBlack',_0xdbe496);logger[_0x68e3('0x1e')](_0x68e3('0x1f'),_0xdbe496,JSON[_0x68e3('0xf')](_0x208444));_0x4d20c1(_0x208444);})[_0x68e3('0x15')](function(_0x5b7b0b){logger[_0x68e3('0x10')]('UpdateCmHopperBlack',_0x5b7b0b[_0x68e3('0x12')],_0xdbe496);_0x101648(_0x2caa62['error'](0x1f4,_0x5b7b0b[_0x68e3('0x12')]));});});};exports[_0x68e3('0x23')]=function(_0x539d46){var _0x19707d=this;return new Promise(function(_0x38584a,_0x4cb714){return db[_0x68e3('0x20')][_0x68e3('0x24')]({'where':_0x539d46[_0x68e3('0x17')]?_0x539d46[_0x68e3('0x17')]['where']||null:null})[_0x68e3('0x1d')](function(_0x184fc9){logger[_0x68e3('0x13')](_0x68e3('0x23'),_0x539d46);logger[_0x68e3('0x1e')](_0x68e3('0x23'),_0x539d46,JSON[_0x68e3('0xf')](_0x184fc9));_0x38584a(_0x184fc9);})[_0x68e3('0x15')](function(_0x57dd9e){logger[_0x68e3('0x10')]('DestroyCmHopperBlack',_0x57dd9e[_0x68e3('0x12')],_0x539d46);_0x4cb714(_0x19707d[_0x68e3('0x10')](0x1f4,_0x57dd9e[_0x68e3('0x12')]));});});};
\ No newline at end of file
+var _0x378c=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','body','DestroyCmHopperBlack','lodash','util'];(function(_0xe1149f,_0x4d83de){var _0x4db68b=function(_0x51309e){while(--_0x51309e){_0xe1149f['push'](_0xe1149f['shift']());}};_0x4db68b(++_0x4d83de);}(_0x378c,0x14b));var _0xc378=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x378c[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xc378('0x0'));var util=require(_0xc378('0x1'));var moment=require(_0xc378('0x2'));var BPromise=require(_0xc378('0x3'));var rs=require(_0xc378('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc378('0x5'))['db'];var utils=require(_0xc378('0x6'));var logger=require('../../config/logger')(_0xc378('0x7'));var config=require('../../config/environment');var jayson=require(_0xc378('0x8'));var client=jayson[_0xc378('0x9')][_0xc378('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x571334,_0x67643d,_0x24b9d4){return new BPromise(function(_0x136717,_0x1ed41a){return client[_0xc378('0xb')](_0x571334,_0x24b9d4)[_0xc378('0xc')](function(_0x6a578e){logger[_0xc378('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x67643d,_0xc378('0xe'));logger[_0xc378('0xf')](_0xc378('0x10'),_0x67643d,_0xc378('0xe'),JSON['stringify'](_0x6a578e));if(_0x6a578e[_0xc378('0x11')]){if(_0x6a578e[_0xc378('0x11')][_0xc378('0x12')]===0x1f4){logger[_0xc378('0x11')](_0xc378('0x13'),_0x67643d,_0x6a578e[_0xc378('0x11')][_0xc378('0x14')]);return _0x1ed41a(_0x6a578e['error'][_0xc378('0x14')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x67643d,_0x6a578e[_0xc378('0x11')][_0xc378('0x14')]);return _0x136717(_0x6a578e[_0xc378('0x11')][_0xc378('0x14')]);}else{logger[_0xc378('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x67643d,'request\x20sent');_0x136717(_0x6a578e['result'][_0xc378('0x14')]);}})[_0xc378('0x15')](function(_0x181d7f){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x67643d,_0x181d7f);_0x1ed41a(_0x181d7f);});});}exports[_0xc378('0x16')]=function(_0x271a1d){var _0x1e5807=this;return new Promise(function(_0x455b88,_0x4661fa){return db[_0xc378('0x17')][_0xc378('0x18')]({'raw':_0x271a1d['options']?_0x271a1d[_0xc378('0x19')][_0xc378('0x1a')]===undefined?!![]:![]:!![],'where':_0x271a1d[_0xc378('0x19')]?_0x271a1d[_0xc378('0x19')][_0xc378('0x1b')]||null:null,'attributes':_0x271a1d[_0xc378('0x19')]?_0x271a1d[_0xc378('0x19')][_0xc378('0x1c')]||null:null,'limit':_0x271a1d[_0xc378('0x19')]?_0x271a1d['options'][_0xc378('0x1d')]||null:null,'include':_0x271a1d[_0xc378('0x19')]?_0x271a1d[_0xc378('0x19')][_0xc378('0x1e')]?_[_0xc378('0x1f')](_0x271a1d['options'][_0xc378('0x1e')],function(_0x452308){return{'model':db[_0x452308[_0xc378('0x20')]],'as':_0x452308['as'],'attributes':_0x452308[_0xc378('0x1c')],'include':_0x452308[_0xc378('0x1e')]?_[_0xc378('0x1f')](_0x452308[_0xc378('0x1e')],function(_0x1de454){return{'model':db[_0x1de454[_0xc378('0x20')]],'as':_0x1de454['as'],'attributes':_0x1de454['attributes'],'include':_0x1de454[_0xc378('0x1e')]?_[_0xc378('0x1f')](_0x1de454['include'],function(_0x460ef8){return{'model':db[_0x460ef8['model']],'as':_0x460ef8['as'],'attributes':_0x460ef8[_0xc378('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc378('0xc')](function(_0x1e5165){logger[_0xc378('0xd')]('GetCmHopperBlack',_0x271a1d);logger[_0xc378('0xf')](_0xc378('0x16'),_0x271a1d,JSON[_0xc378('0x21')](_0x1e5165));_0x455b88(_0x1e5165);})[_0xc378('0x15')](function(_0x44ba2b){logger[_0xc378('0x11')]('GetCmHopperBlack',_0x44ba2b[_0xc378('0x14')],_0x271a1d);_0x4661fa(_0x1e5807['error'](0x1f4,_0x44ba2b['message']));});});};exports[_0xc378('0x22')]=function(_0xf0c3d3){var _0x5a74d5=this;return new Promise(function(_0x39c0c1,_0x18daf4){return db[_0xc378('0x17')]['update'](_0xf0c3d3[_0xc378('0x23')],{'raw':_0xf0c3d3[_0xc378('0x19')]?_0xf0c3d3[_0xc378('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf0c3d3['options']?_0xf0c3d3[_0xc378('0x19')][_0xc378('0x1b')]||null:null,'attributes':_0xf0c3d3['options']?_0xf0c3d3['options'][_0xc378('0x1c')]||null:null,'limit':_0xf0c3d3[_0xc378('0x19')]?_0xf0c3d3['options'][_0xc378('0x1d')]||null:null})[_0xc378('0xc')](function(_0x525a47){logger[_0xc378('0xd')](_0xc378('0x22'),_0xf0c3d3);logger[_0xc378('0xf')]('UpdateCmHopperBlack',_0xf0c3d3,JSON['stringify'](_0x525a47));_0x39c0c1(_0x525a47);})[_0xc378('0x15')](function(_0x2e6e2f){logger[_0xc378('0x11')](_0xc378('0x22'),_0x2e6e2f[_0xc378('0x14')],_0xf0c3d3);_0x18daf4(_0x5a74d5[_0xc378('0x11')](0x1f4,_0x2e6e2f['message']));});});};exports['DestroyCmHopperBlack']=function(_0x2311f8){var _0x24f7fd=this;return new Promise(function(_0x17a0a4,_0x3d0a73){return db[_0xc378('0x17')]['destroy']({'where':_0x2311f8[_0xc378('0x19')]?_0x2311f8[_0xc378('0x19')]['where']||null:null})[_0xc378('0xc')](function(_0x4c686a){logger[_0xc378('0xd')](_0xc378('0x24'),_0x2311f8);logger['debug'](_0xc378('0x24'),_0x2311f8,JSON[_0xc378('0x21')](_0x4c686a));_0x17a0a4(_0x4c686a);})['catch'](function(_0x15a527){logger['error'](_0xc378('0x24'),_0x15a527[_0xc378('0x14')],_0x2311f8);_0x3d0a73(_0x24f7fd[_0xc378('0x11')](0x1f4,_0x15a527[_0xc378('0x14')]));});});};
\ No newline at end of file
index 37d2dc0..662572d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7b84,0x17c));var _0x47b8=function(_0x5ba06c,_0x3b6312){_0x5ba06c=_0x5ba06c-0x0;var _0x8e1e71=_0x7b84[_0x5ba06c];return _0x8e1e71;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0x11')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0x13')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);module[_0x47b8('0x15')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','put','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x326f,0xd1));var _0xf326=function(_0x57a687,_0x596d83){_0x57a687=_0x57a687-0x0;var _0x4e9af7=_0x326f[_0x57a687];return _0x4e9af7;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')](_0xf326('0xf'),auth[_0xf326('0xa')](),controller[_0xf326('0x10')]);router['delete'](_0xf326('0xf'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
index 0fb6bb8..3ea798e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x345b=['exports','INTEGER','STRING','DATE','endtime','setDataValue','diff','dispositionat','BOOLEAN','sequelize','moment'];(function(_0x29efbb,_0x293036){var _0x4b1456=function(_0x32ff20){while(--_0x32ff20){_0x29efbb['push'](_0x29efbb['shift']());}};_0x4b1456(++_0x293036);}(_0x345b,0x98));var _0xb345=function(_0x3162d8,_0x4003e2){_0x3162d8=_0x3162d8-0x0;var _0x2a0d90=_0x345b[_0x3162d8];return _0x2a0d90;};'use strict';var Sequelize=require(_0xb345('0x0'));var moment=require(_0xb345('0x1'));module[_0xb345('0x2')]={'state':{'type':Sequelize[_0xb345('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xb345('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xb345('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb345('0x4')]},'calleridnum':{'type':Sequelize[_0xb345('0x4')]},'calleridname':{'type':Sequelize[_0xb345('0x4')]},'starttime':{'type':Sequelize[_0xb345('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb345('0x5')]},'droptime':{'type':Sequelize[_0xb345('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb345('0x4')]},'campaign':{'type':Sequelize[_0xb345('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb345('0x4')]},'reason':{'type':Sequelize[_0xb345('0x4')]},'disposition':{'type':Sequelize[_0xb345('0x4')]},'secondDisposition':{'type':Sequelize[_0xb345('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb345('0x4')]},'dispositionat':{'type':Sequelize[_0xb345('0x5')],'set':function(_0x49838f){var _0x528b92=this['getDataValue'](_0xb345('0x6'));if(_0x528b92&&_0x49838f){this[_0xb345('0x7')]('followuptime',moment(_0x49838f)[_0xb345('0x8')](moment(_0x528b92),'seconds'));}return this[_0xb345('0x7')](_0xb345('0x9'),_0x49838f);}},'amd':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb345('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xb345('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb345('0x5')]},'recallme':{'type':Sequelize[_0xb345('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb345('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa6cd=['DATE','endtime','setDataValue','followuptime','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6cd,0x19d));var _0xda6c=function(_0xdf569b,_0x37f63e){_0xdf569b=_0xdf569b-0x0;var _0x5e8103=_0xa6cd[_0xdf569b];return _0x5e8103;};'use strict';var Sequelize=require(_0xda6c('0x0'));var moment=require(_0xda6c('0x1'));module[_0xda6c('0x2')]={'state':{'type':Sequelize[_0xda6c('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xda6c('0x4')]},'scheduledat':{'type':Sequelize[_0xda6c('0x5')]},'countbusyretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xda6c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xda6c('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xda6c('0x4')]},'calleridname':{'type':Sequelize[_0xda6c('0x4')]},'starttime':{'type':Sequelize[_0xda6c('0x5')]},'responsetime':{'type':Sequelize[_0xda6c('0x5')]},'answertime':{'type':Sequelize[_0xda6c('0x5')]},'droptime':{'type':Sequelize[_0xda6c('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xda6c('0x4')]},'campaign':{'type':Sequelize[_0xda6c('0x4')]},'campaigntype':{'type':Sequelize[_0xda6c('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xda6c('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xda6c('0x4')]},'dispositionat':{'type':Sequelize[_0xda6c('0x5')],'set':function(_0x3a2012){var _0x57dd11=this['getDataValue'](_0xda6c('0x6'));if(_0x57dd11&&_0x3a2012){this[_0xda6c('0x7')](_0xda6c('0x8'),moment(_0x3a2012)['diff'](moment(_0x57dd11),'seconds'));}return this[_0xda6c('0x7')](_0xda6c('0x9'),_0x3a2012);}},'amd':{'type':Sequelize[_0xda6c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xda6c('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xda6c('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xda6c('0x5')]},'callback':{'type':Sequelize[_0xda6c('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xda6c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xda6c('0x5')]},'deleted':{'type':Sequelize[_0xda6c('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xda6c('0x5')]},'recallme':{'type':Sequelize[_0xda6c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xda6c('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xda6c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index d15869f..25c009b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x5ebd54,_0x928763){var _0x5f53f5=function(_0x380b5f){while(--_0x380b5f){_0x5ebd54['push'](_0x5ebd54['shift']());}};_0x5f53f5(++_0x928763);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));};
\ No newline at end of file
+var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x4ae024,_0x2e3bfc){var _0x1b0f81=function(_0x52417d){while(--_0x52417d){_0x4ae024['push'](_0x4ae024['shift']());}};_0x1b0f81(++_0x2e3bfc);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));};
\ No newline at end of file
index b42a821..45f94db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c9=['exports','define','CmHopperFinal','cm_hopper_final','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e6747,_0x3db877){var _0x154a35=function(_0x227ee0){while(--_0x227ee0){_0x2e6747['push'](_0x2e6747['shift']());}};_0x154a35(++_0x3db877);}(_0x24c9,0x1cc));var _0x924c=function(_0x470d7d,_0x3cfccb){_0x470d7d=_0x470d7d-0x0;var _0x2181b2=_0x24c9[_0x470d7d];return _0x2181b2;};'use strict';var _=require(_0x924c('0x0'));var util=require(_0x924c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x924c('0x2'));var BPromise=require(_0x924c('0x3'));var rp=require(_0x924c('0x4'));var fs=require('fs');var path=require(_0x924c('0x5'));var rimraf=require(_0x924c('0x6'));var config=require(_0x924c('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x924c('0x8')]=function(_0x5e1c79,_0x3d032c){return _0x5e1c79[_0x924c('0x9')](_0x924c('0xa'),attributes,{'tableName':_0x924c('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x924c('0xc'),'fields':[_0x924c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x964b=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment'];(function(_0x247c49,_0x5c8fa9){var _0x505dff=function(_0x45ea79){while(--_0x45ea79){_0x247c49['push'](_0x247c49['shift']());}};_0x505dff(++_0x5c8fa9);}(_0x964b,0x65));var _0xb964=function(_0x50bb7d,_0x3328b2){_0x50bb7d=_0x50bb7d-0x0;var _0x41bd36=_0x964b[_0x50bb7d];return _0x41bd36;};'use strict';var _=require('lodash');var util=require(_0xb964('0x0'));var logger=require(_0xb964('0x1'))(_0xb964('0x2'));var moment=require(_0xb964('0x3'));var BPromise=require(_0xb964('0x4'));var rp=require(_0xb964('0x5'));var fs=require('fs');var path=require(_0xb964('0x6'));var rimraf=require(_0xb964('0x7'));var config=require(_0xb964('0x8'));var attributes=require(_0xb964('0x9'));module['exports']=function(_0x5167d0,_0x42cf3e){return _0x5167d0[_0xb964('0xa')](_0xb964('0xb'),attributes,{'tableName':_0xb964('0xc'),'paranoid':![],'indexes':[{'name':_0xb964('0xd'),'fields':[_0xb964('0xd')]},{'name':_0xb964('0xe'),'fields':[_0xb964('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index d142fb3..00857fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x555095,_0x5d32e8){var _0x13d776=function(_0x1396ba){while(--_0x1396ba){_0x555095['push'](_0x555095['shift']());}};_0x13d776(++_0x5d32e8);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab268,_0x146628){_0x5ab268=_0x5ab268-0x0;var _0x4b6c89=_0x7a54[_0x5ab268];return _0x4b6c89;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1096f0,_0x55e29e){var _0x5b3b7a=function(_0x7e28ad){while(--_0x7e28ad){_0x1096f0['push'](_0x1096f0['shift']());}};_0x5b3b7a(++_0x55e29e);}(_0x7a54,0x106));var _0x47a5=function(_0x5e95cb,_0x301436){_0x5e95cb=_0x5e95cb-0x0;var _0x19927a=_0x7a54[_0x5e95cb];return _0x19927a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index f255bac..bfe2c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['show','/voice/queue/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe'];(function(_0x177f03,_0x23208f){var _0x85dc43=function(_0x4e49ac){while(--_0x4e49ac){_0x177f03['push'](_0x177f03['shift']());}};_0x85dc43(++_0x23208f);}(_0x32f4,0x154));var _0x432f=function(_0x9cede6,_0x435984){_0x9cede6=_0x9cede6-0x0;var _0x48aa48=_0x32f4[_0x9cede6];return _0x48aa48;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['describe']);router[_0x432f('0x9')]('/:id',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0x9')](_0x432f('0xd'),auth[_0x432f('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x432f('0x9')]('/campaign/countAttributes/:id',auth[_0x432f('0xa')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x432f('0xe')](_0x432f('0xf'),auth['isAuthenticated'](),controller[_0x432f('0x10')]);router[_0x432f('0xe')]('/voice/campaign/moveContacts/:id',auth[_0x432f('0xa')](),controller[_0x432f('0x11')]);router['post']('/checkContactHopper',auth[_0x432f('0xa')](),controller[_0x432f('0x12')]);router[_0x432f('0x13')](_0x432f('0x14'),auth[_0x432f('0xa')](),controller['update']);module[_0x432f('0x15')]=router;
\ No newline at end of file
+var _0x7d14=['/checkContactHopper','checkContactHopper','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0x7d14,0x6d));var _0x47d1=function(_0xdad450,_0x23f7da){_0xdad450=_0xdad450-0x0;var _0x11382e=_0x7d14[_0xdad450];return _0x11382e;};'use strict';var multer=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var path=require('path');var timeout=require(_0x47d1('0x2'));var express=require(_0x47d1('0x3'));var router=express[_0x47d1('0x4')]();var fs_extra=require(_0x47d1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47d1('0x6'));var config=require(_0x47d1('0x7'));var controller=require(_0x47d1('0x8'));router[_0x47d1('0x9')]('/',auth[_0x47d1('0xa')](),controller['index']);router['get']('/describe',auth[_0x47d1('0xa')](),controller['describe']);router[_0x47d1('0x9')](_0x47d1('0xb'),auth[_0x47d1('0xa')](),controller[_0x47d1('0xc')]);router[_0x47d1('0x9')](_0x47d1('0xd'),auth[_0x47d1('0xa')](),controller[_0x47d1('0xe')]);router[_0x47d1('0x9')](_0x47d1('0xf'),auth[_0x47d1('0xa')](),controller[_0x47d1('0x10')]);router[_0x47d1('0x11')]('/voice/queue/moveContacts/:id',auth[_0x47d1('0xa')](),controller[_0x47d1('0x12')]);router[_0x47d1('0x11')](_0x47d1('0x13'),auth[_0x47d1('0xa')](),controller[_0x47d1('0x14')]);router[_0x47d1('0x11')](_0x47d1('0x15'),auth[_0x47d1('0xa')](),controller[_0x47d1('0x16')]);router[_0x47d1('0x17')](_0x47d1('0xb'),auth[_0x47d1('0xa')](),controller[_0x47d1('0x18')]);module[_0x47d1('0x19')]=router;
\ No newline at end of file
index 344ac7a..cb318ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x722d=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3fb8f2,_0x282fc6){var _0x3fa5c6=function(_0xd503){while(--_0xd503){_0x3fb8f2['push'](_0x3fb8f2['shift']());}};_0x3fa5c6(++_0x282fc6);}(_0x722d,0x121));var _0xd722=function(_0x2f0bf1,_0x183ef1){_0x2f0bf1=_0x2f0bf1-0x0;var _0xf1df38=_0x722d[_0x2f0bf1];return _0xf1df38;};'use strict';var Sequelize=require(_0xd722('0x0'));module[_0xd722('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd722('0x2')]},'scheduledat':{'type':Sequelize[_0xd722('0x3')]},'countbusyretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xd722('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd722('0x2')]},'calleridname':{'type':Sequelize[_0xd722('0x2')]},'starttime':{'type':Sequelize[_0xd722('0x3')]},'responsetime':{'type':Sequelize[_0xd722('0x3')]},'answertime':{'type':Sequelize[_0xd722('0x3')]},'droptime':{'type':Sequelize[_0xd722('0x3')]},'endtime':{'type':Sequelize[_0xd722('0x3')]},'ringtime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd722('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd722('0x2')]},'membername':{'type':Sequelize[_0xd722('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd722('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd722('0x3')]},'recallme':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd722('0x3')]},'edited':{'type':Sequelize[_0xd722('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd722('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4ca0=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x476194,_0x2463b6){var _0x44ba29=function(_0x5d2a50){while(--_0x5d2a50){_0x476194['push'](_0x476194['shift']());}};_0x44ba29(++_0x2463b6);}(_0x4ca0,0xac));var _0x04ca=function(_0x272ea6,_0x3f0673){_0x272ea6=_0x272ea6-0x0;var _0x43ef03=_0x4ca0[_0x272ea6];return _0x43ef03;};'use strict';var Sequelize=require(_0x04ca('0x0'));module[_0x04ca('0x1')]={'state':{'type':Sequelize[_0x04ca('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x04ca('0x3')]},'scheduledat':{'type':Sequelize[_0x04ca('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x04ca('0x3')]},'originatecalleridname':{'type':Sequelize[_0x04ca('0x3')]},'calleridnum':{'type':Sequelize[_0x04ca('0x3')]},'calleridname':{'type':Sequelize[_0x04ca('0x3')]},'starttime':{'type':Sequelize[_0x04ca('0x4')]},'responsetime':{'type':Sequelize[_0x04ca('0x4')]},'answertime':{'type':Sequelize[_0x04ca('0x4')]},'droptime':{'type':Sequelize[_0x04ca('0x4')]},'endtime':{'type':Sequelize[_0x04ca('0x4')]},'ringtime':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x04ca('0x3')]},'campaigntype':{'type':Sequelize[_0x04ca('0x3')]},'membername':{'type':Sequelize[_0x04ca('0x3')]},'reason':{'type':Sequelize[_0x04ca('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x04ca('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x04ca('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x04ca('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x04ca('0x4')]},'recallme':{'type':Sequelize[_0x04ca('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x04ca('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x04ca('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index fe99cea..4523515 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58de=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','error','name','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','uniqueid','find','rimraf','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x12410c,_0x1874d){var _0xc075d=function(_0x47da7a){while(--_0x47da7a){_0x12410c['push'](_0x12410c['shift']());}};_0xc075d(++_0x1874d);}(_0x58de,0x83));var _0xe58d=function(_0x46a23c,_0x2221d8){_0x46a23c=_0x46a23c-0x0;var _0x5a09a8=_0x58de[_0x46a23c];return _0x5a09a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe58d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe58d('0x1'));var BPromise=require(_0xe58d('0x2'));var Mustache=require(_0xe58d('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe58d('0x4'));var csv=require('to-csv');var ejs=require(_0xe58d('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe58d('0x6'));var crypto=require(_0xe58d('0x7'));var jsforce=require(_0xe58d('0x8'));var deskjs=require(_0xe58d('0x9'));var toCsv=require(_0xe58d('0xa'));var querystring=require('querystring');var Papa=require(_0xe58d('0xb'));var Redis=require(_0xe58d('0xc'));var authService=require(_0xe58d('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe58d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe58d('0xf'))(_0xe58d('0x10'));var utils=require('../../config/utils');var config=require(_0xe58d('0x11'));var licenseUtil=require(_0xe58d('0x12'));var db=require(_0xe58d('0x13'))['db'];function respondWithStatusCode(_0xaf2d33,_0x56f2f4){_0x56f2f4=_0x56f2f4||0xcc;return function(_0x1e93ff){if(_0x1e93ff){return _0xaf2d33[_0xe58d('0x14')](_0x56f2f4);}return _0xaf2d33['status'](_0x56f2f4)[_0xe58d('0x15')]();};}function respondWithResult(_0x14bdbc,_0x10cde9){_0x10cde9=_0x10cde9||0xc8;return function(_0x46816a){if(_0x46816a){return _0x14bdbc[_0xe58d('0x16')](_0x10cde9)[_0xe58d('0x17')](_0x46816a);}};}function respondWithFilteredResult(_0x292c8d,_0x29174d){return function(_0x159d1d){if(_0x159d1d){var _0x3936bf=typeof _0x29174d[_0xe58d('0x18')]===_0xe58d('0x19')&&typeof _0x29174d[_0xe58d('0x1a')]===_0xe58d('0x19');var _0x34f23b=_0x159d1d[_0xe58d('0x1b')];var _0x34b11a=_0x3936bf?0x0:_0x29174d[_0xe58d('0x18')];var _0x3ec193=_0x3936bf?_0x159d1d[_0xe58d('0x1b')]:_0x29174d[_0xe58d('0x18')]+_0x29174d[_0xe58d('0x1a')];var _0x10c262;if(_0x3ec193>=_0x34f23b){_0x3ec193=_0x34f23b;_0x10c262=0xc8;}else{_0x10c262=0xce;}_0x292c8d['status'](_0x10c262);return _0x292c8d[_0xe58d('0x1c')]('Content-Range',_0x34b11a+'-'+_0x3ec193+'/'+_0x34f23b)['json'](_0x159d1d);}return null;};}function patchUpdates(_0x1f931f){return function(_0x4b3320){try{jsonpatch['apply'](_0x4b3320,_0x1f931f,!![]);}catch(_0x5b7361){return BPromise[_0xe58d('0x1d')](_0x5b7361);}return _0x4b3320[_0xe58d('0x1e')]();};}function saveUpdates(_0x303836,_0x21d4f3){return function(_0x2950a2){if(_0x2950a2){return _0x2950a2[_0xe58d('0x1f')](_0x303836)['then'](function(_0x5d6ba2){return _0x5d6ba2;});}return null;};}function removeEntity(_0x36e1ec,_0x34bc9b){return function(_0x18f04a){if(_0x18f04a){return _0x18f04a[_0xe58d('0x20')]()[_0xe58d('0x21')](function(){_0x36e1ec['status'](0xcc)[_0xe58d('0x15')]();});}};}function handleEntityNotFound(_0x368991,_0x6a9dbe){return function(_0x549d12){if(!_0x549d12){_0x368991['sendStatus'](0x194);}return _0x549d12;};}function handleError(_0x26402b,_0x59be93){_0x59be93=_0x59be93||0x1f4;return function(_0xcd16c0){logger[_0xe58d('0x22')](_0xcd16c0['stack']);if(_0xcd16c0[_0xe58d('0x23')]){delete _0xcd16c0['name'];}_0x26402b[_0xe58d('0x16')](_0x59be93)['send'](_0xcd16c0);};}exports[_0xe58d('0x24')]=function(_0x18da20,_0x211cde){var _0x24d4ba={},_0x2450f6={},_0x5374d4={'count':0x0,'rows':[]};var _0x12ff2b=_[_0xe58d('0x25')](db[_0xe58d('0x26')][_0xe58d('0x27')],function(_0x2a9237){return{'name':_0x2a9237[_0xe58d('0x28')],'type':_0x2a9237['type'][_0xe58d('0x29')]};});_0x2450f6[_0xe58d('0x2a')]=_['map'](_0x12ff2b,'name');_0x2450f6['query']=_[_0xe58d('0x2b')](_0x18da20[_0xe58d('0x2c')]);_0x2450f6[_0xe58d('0x2d')]=_[_0xe58d('0x2e')](_0x2450f6[_0xe58d('0x2a')],_0x2450f6[_0xe58d('0x2c')]);_0x24d4ba['attributes']=_[_0xe58d('0x2e')](_0x2450f6['model'],qs[_0xe58d('0x2f')](_0x18da20['query'][_0xe58d('0x2f')]));_0x24d4ba[_0xe58d('0x30')]=_0x24d4ba['attributes'][_0xe58d('0x31')]?_0x24d4ba[_0xe58d('0x30')]:_0x2450f6['model'];if(!_0x18da20[_0xe58d('0x2c')][_0xe58d('0x32')](_0xe58d('0x33'))){_0x24d4ba[_0xe58d('0x1a')]=qs['limit'](_0x18da20[_0xe58d('0x2c')][_0xe58d('0x1a')]);_0x24d4ba[_0xe58d('0x18')]=qs[_0xe58d('0x18')](_0x18da20[_0xe58d('0x2c')][_0xe58d('0x18')]);}_0x24d4ba[_0xe58d('0x34')]=qs[_0xe58d('0x35')](_0x18da20[_0xe58d('0x2c')]['sort']);_0x24d4ba['where']=qs[_0xe58d('0x2d')](_['pick'](_0x18da20[_0xe58d('0x2c')],_0x2450f6[_0xe58d('0x2d')]),_0x12ff2b);if(_0x18da20['query'][_0xe58d('0x36')]){_0x24d4ba[_0xe58d('0x37')]=_[_0xe58d('0x38')](_0x24d4ba['where'],{'$or':_[_0xe58d('0x25')](_0x12ff2b,function(_0x20a8df){if(_0x20a8df['type']!==_0xe58d('0x39')){var _0x50abee={};_0x50abee[_0x20a8df[_0xe58d('0x23')]]={'$like':'%'+_0x18da20[_0xe58d('0x2c')][_0xe58d('0x36')]+'%'};return _0x50abee;}})});}_0x24d4ba=_['merge']({},_0x24d4ba,_0x18da20[_0xe58d('0x3a')]);var _0x19635b={'where':_0x24d4ba['where']};return db['CmHopperHistory'][_0xe58d('0x1b')](_0x19635b)[_0xe58d('0x21')](function(_0x3b913b){_0x5374d4['count']=_0x3b913b;if(_0x18da20['query'][_0xe58d('0x3b')]){_0x24d4ba[_0xe58d('0x3c')]=[{'all':!![]}];}return db[_0xe58d('0x26')][_0xe58d('0x3d')](_0x24d4ba);})[_0xe58d('0x21')](function(_0x488bdd){_0x5374d4[_0xe58d('0x3e')]=_0x488bdd;return _0x5374d4;})['then'](respondWithFilteredResult(_0x211cde,_0x24d4ba))[_0xe58d('0x3f')](handleError(_0x211cde,null));};exports[_0xe58d('0x40')]=function(_0x21c4e7,_0x73abe3){var _0xea5ffe={'raw':!![],'where':{'id':_0x21c4e7[_0xe58d('0x41')]['id']}},_0x359cc3={};_0x359cc3[_0xe58d('0x2a')]=_['keys'](db['CmHopperHistory'][_0xe58d('0x27')]);_0x359cc3[_0xe58d('0x2c')]=_[_0xe58d('0x2b')](_0x21c4e7['query']);_0x359cc3[_0xe58d('0x2d')]=_['intersection'](_0x359cc3[_0xe58d('0x2a')],_0x359cc3['query']);_0xea5ffe[_0xe58d('0x30')]=_[_0xe58d('0x2e')](_0x359cc3[_0xe58d('0x2a')],qs[_0xe58d('0x2f')](_0x21c4e7[_0xe58d('0x2c')][_0xe58d('0x2f')]));_0xea5ffe[_0xe58d('0x30')]=_0xea5ffe[_0xe58d('0x30')][_0xe58d('0x31')]?_0xea5ffe[_0xe58d('0x30')]:_0x359cc3[_0xe58d('0x2a')];if(_0x21c4e7[_0xe58d('0x2c')][_0xe58d('0x3b')]){_0xea5ffe[_0xe58d('0x3c')]=[{'all':!![]}];}_0xea5ffe=_['merge']({},_0xea5ffe,_0x21c4e7[_0xe58d('0x3a')]);return db[_0xe58d('0x26')]['find'](_0xea5ffe)[_0xe58d('0x21')](handleEntityNotFound(_0x73abe3,null))['then'](respondWithResult(_0x73abe3,null))['catch'](handleError(_0x73abe3,null));};exports['create']=function(_0x3823b0,_0x2d4fd8){return db[_0xe58d('0x26')][_0xe58d('0x42')](_0x3823b0[_0xe58d('0x43')],{})[_0xe58d('0x21')](respondWithResult(_0x2d4fd8,0xc9))['catch'](handleError(_0x2d4fd8,null));};exports[_0xe58d('0x44')]=function(_0xa7b680,_0x2c0cdf){return db[_0xe58d('0x26')][_0xe58d('0x44')]()[_0xe58d('0x21')](respondWithResult(_0x2c0cdf,null))['catch'](handleError(_0x2c0cdf,null));};exports[_0xe58d('0x1f')]=function(_0x1521ab,_0x1db3bc){if(_0x1521ab[_0xe58d('0x43')][_0xe58d('0x45')]){delete _0x1521ab[_0xe58d('0x43')]['uniqueid'];}return db['CmHopperHistory'][_0xe58d('0x46')]({'where':{'uniqueid':_0x1521ab[_0xe58d('0x41')]['id']}})[_0xe58d('0x21')](handleEntityNotFound(_0x1db3bc,null))['then'](saveUpdates(_0x1521ab[_0xe58d('0x43')],null))['then'](respondWithResult(_0x1db3bc,null))[_0xe58d('0x3f')](handleError(_0x1db3bc,null));};
\ No newline at end of file
+var _0xebd3=['params','keys','rawAttributes','include','options','body','uniqueid','find','eml-format','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','reject','save','update','then','error','stack','name','map','CmHopperHistory','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','findAll','rows','catch','show'];(function(_0x3e92ff,_0x2a93c7){var _0x3f7501=function(_0xf8b098){while(--_0xf8b098){_0x3e92ff['push'](_0x3e92ff['shift']());}};_0x3f7501(++_0x2a93c7);}(_0xebd3,0x194));var _0x3ebd=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0xebd3[_0x42bfb7];return _0x5c497d;};'use strict';var emlformat=require(_0x3ebd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ebd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ebd('0x2'));var moment=require(_0x3ebd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3ebd('0x4'));var sox=require(_0x3ebd('0x5'));var csv=require(_0x3ebd('0x6'));var ejs=require(_0x3ebd('0x7'));var fs=require('fs');var fs_extra=require(_0x3ebd('0x8'));var _=require(_0x3ebd('0x9'));var squel=require(_0x3ebd('0xa'));var crypto=require(_0x3ebd('0xb'));var jsforce=require(_0x3ebd('0xc'));var deskjs=require(_0x3ebd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3ebd('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ebd('0xf'));var authService=require(_0x3ebd('0x10'));var qs=require(_0x3ebd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ebd('0x12'));var logger=require('../../config/logger')(_0x3ebd('0x13'));var utils=require('../../config/utils');var config=require(_0x3ebd('0x14'));var licenseUtil=require(_0x3ebd('0x15'));var db=require(_0x3ebd('0x16'))['db'];function respondWithStatusCode(_0x3542f5,_0x3f9327){_0x3f9327=_0x3f9327||0xcc;return function(_0x4c0429){if(_0x4c0429){return _0x3542f5[_0x3ebd('0x17')](_0x3f9327);}return _0x3542f5[_0x3ebd('0x18')](_0x3f9327)['end']();};}function respondWithResult(_0x3c5efa,_0x1ee5b2){_0x1ee5b2=_0x1ee5b2||0xc8;return function(_0xd78833){if(_0xd78833){return _0x3c5efa['status'](_0x1ee5b2)['json'](_0xd78833);}};}function respondWithFilteredResult(_0x3b6ced,_0x585ff7){return function(_0x116f7b){if(_0x116f7b){var _0x6e6291=typeof _0x585ff7[_0x3ebd('0x19')]===_0x3ebd('0x1a')&&typeof _0x585ff7[_0x3ebd('0x1b')]===_0x3ebd('0x1a');var _0x476828=_0x116f7b[_0x3ebd('0x1c')];var _0x115dd3=_0x6e6291?0x0:_0x585ff7['offset'];var _0x4bdb2e=_0x6e6291?_0x116f7b['count']:_0x585ff7[_0x3ebd('0x19')]+_0x585ff7['limit'];var _0x9cc3b6;if(_0x4bdb2e>=_0x476828){_0x4bdb2e=_0x476828;_0x9cc3b6=0xc8;}else{_0x9cc3b6=0xce;}_0x3b6ced['status'](_0x9cc3b6);return _0x3b6ced['set']('Content-Range',_0x115dd3+'-'+_0x4bdb2e+'/'+_0x476828)['json'](_0x116f7b);}return null;};}function patchUpdates(_0xce49bf){return function(_0x2d17e7){try{jsonpatch['apply'](_0x2d17e7,_0xce49bf,!![]);}catch(_0x496937){return BPromise[_0x3ebd('0x1d')](_0x496937);}return _0x2d17e7[_0x3ebd('0x1e')]();};}function saveUpdates(_0x280e6a,_0x53f61f){return function(_0x2e60bf){if(_0x2e60bf){return _0x2e60bf[_0x3ebd('0x1f')](_0x280e6a)[_0x3ebd('0x20')](function(_0x373a7d){return _0x373a7d;});}return null;};}function removeEntity(_0x4e8b6d,_0x3f1154){return function(_0x2767fa){if(_0x2767fa){return _0x2767fa['destroy']()['then'](function(){_0x4e8b6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x30b523,_0x339c8b){return function(_0x2b17d1){if(!_0x2b17d1){_0x30b523[_0x3ebd('0x17')](0x194);}return _0x2b17d1;};}function handleError(_0x326d77,_0x4151e8){_0x4151e8=_0x4151e8||0x1f4;return function(_0x39ab25){logger[_0x3ebd('0x21')](_0x39ab25[_0x3ebd('0x22')]);if(_0x39ab25[_0x3ebd('0x23')]){delete _0x39ab25[_0x3ebd('0x23')];}_0x326d77[_0x3ebd('0x18')](_0x4151e8)['send'](_0x39ab25);};}exports['index']=function(_0x29537a,_0x1f4e46){var _0x2a47a9={},_0x1080a1={},_0x25fc30={'count':0x0,'rows':[]};var _0x438610=_[_0x3ebd('0x24')](db[_0x3ebd('0x25')]['rawAttributes'],function(_0x441992){return{'name':_0x441992['fieldName'],'type':_0x441992[_0x3ebd('0x26')]['key']};});_0x1080a1['model']=_['map'](_0x438610,_0x3ebd('0x23'));_0x1080a1['query']=_['keys'](_0x29537a[_0x3ebd('0x27')]);_0x1080a1['filters']=_[_0x3ebd('0x28')](_0x1080a1[_0x3ebd('0x29')],_0x1080a1[_0x3ebd('0x27')]);_0x2a47a9[_0x3ebd('0x2a')]=_[_0x3ebd('0x28')](_0x1080a1[_0x3ebd('0x29')],qs['fields'](_0x29537a[_0x3ebd('0x27')][_0x3ebd('0x2b')]));_0x2a47a9[_0x3ebd('0x2a')]=_0x2a47a9[_0x3ebd('0x2a')][_0x3ebd('0x2c')]?_0x2a47a9[_0x3ebd('0x2a')]:_0x1080a1['model'];if(!_0x29537a[_0x3ebd('0x27')][_0x3ebd('0x2d')](_0x3ebd('0x2e'))){_0x2a47a9['limit']=qs[_0x3ebd('0x1b')](_0x29537a[_0x3ebd('0x27')]['limit']);_0x2a47a9['offset']=qs[_0x3ebd('0x19')](_0x29537a[_0x3ebd('0x27')][_0x3ebd('0x19')]);}_0x2a47a9[_0x3ebd('0x2f')]=qs['sort'](_0x29537a[_0x3ebd('0x27')][_0x3ebd('0x30')]);_0x2a47a9[_0x3ebd('0x31')]=qs[_0x3ebd('0x32')](_['pick'](_0x29537a['query'],_0x1080a1[_0x3ebd('0x32')]),_0x438610);if(_0x29537a[_0x3ebd('0x27')][_0x3ebd('0x33')]){_0x2a47a9[_0x3ebd('0x31')]=_[_0x3ebd('0x34')](_0x2a47a9[_0x3ebd('0x31')],{'$or':_['map'](_0x438610,function(_0x3bd7bf){if(_0x3bd7bf[_0x3ebd('0x26')]!==_0x3ebd('0x35')){var _0x44c932={};_0x44c932[_0x3bd7bf['name']]={'$like':'%'+_0x29537a['query'][_0x3ebd('0x33')]+'%'};return _0x44c932;}})});}_0x2a47a9=_['merge']({},_0x2a47a9,_0x29537a['options']);var _0x4c226={'where':_0x2a47a9[_0x3ebd('0x31')]};return db[_0x3ebd('0x25')][_0x3ebd('0x1c')](_0x4c226)[_0x3ebd('0x20')](function(_0x3f0c2c){_0x25fc30['count']=_0x3f0c2c;if(_0x29537a[_0x3ebd('0x27')]['includeAll']){_0x2a47a9['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3ebd('0x36')](_0x2a47a9);})[_0x3ebd('0x20')](function(_0x2db8b6){_0x25fc30[_0x3ebd('0x37')]=_0x2db8b6;return _0x25fc30;})['then'](respondWithFilteredResult(_0x1f4e46,_0x2a47a9))[_0x3ebd('0x38')](handleError(_0x1f4e46,null));};exports[_0x3ebd('0x39')]=function(_0x51fad6,_0x1df48d){var _0x4f2bb3={'raw':!![],'where':{'id':_0x51fad6[_0x3ebd('0x3a')]['id']}},_0x4e1a3a={};_0x4e1a3a[_0x3ebd('0x29')]=_[_0x3ebd('0x3b')](db['CmHopperHistory'][_0x3ebd('0x3c')]);_0x4e1a3a[_0x3ebd('0x27')]=_[_0x3ebd('0x3b')](_0x51fad6[_0x3ebd('0x27')]);_0x4e1a3a[_0x3ebd('0x32')]=_[_0x3ebd('0x28')](_0x4e1a3a[_0x3ebd('0x29')],_0x4e1a3a[_0x3ebd('0x27')]);_0x4f2bb3[_0x3ebd('0x2a')]=_['intersection'](_0x4e1a3a[_0x3ebd('0x29')],qs[_0x3ebd('0x2b')](_0x51fad6[_0x3ebd('0x27')][_0x3ebd('0x2b')]));_0x4f2bb3[_0x3ebd('0x2a')]=_0x4f2bb3[_0x3ebd('0x2a')]['length']?_0x4f2bb3['attributes']:_0x4e1a3a[_0x3ebd('0x29')];if(_0x51fad6['query']['includeAll']){_0x4f2bb3[_0x3ebd('0x3d')]=[{'all':!![]}];}_0x4f2bb3=_[_0x3ebd('0x34')]({},_0x4f2bb3,_0x51fad6[_0x3ebd('0x3e')]);return db[_0x3ebd('0x25')]['find'](_0x4f2bb3)[_0x3ebd('0x20')](handleEntityNotFound(_0x1df48d,null))['then'](respondWithResult(_0x1df48d,null))[_0x3ebd('0x38')](handleError(_0x1df48d,null));};exports['create']=function(_0x488ceb,_0x281f6b){return db[_0x3ebd('0x25')]['create'](_0x488ceb['body'],{})['then'](respondWithResult(_0x281f6b,0xc9))[_0x3ebd('0x38')](handleError(_0x281f6b,null));};exports['describe']=function(_0x3caef5,_0x4804bb){return db[_0x3ebd('0x25')]['describe']()['then'](respondWithResult(_0x4804bb,null))['catch'](handleError(_0x4804bb,null));};exports[_0x3ebd('0x1f')]=function(_0x2ee16e,_0x43fc46){if(_0x2ee16e[_0x3ebd('0x3f')][_0x3ebd('0x40')]){delete _0x2ee16e[_0x3ebd('0x3f')][_0x3ebd('0x40')];}return db[_0x3ebd('0x25')][_0x3ebd('0x41')]({'where':{'uniqueid':_0x2ee16e[_0x3ebd('0x3a')]['id']}})[_0x3ebd('0x20')](handleEntityNotFound(_0x43fc46,null))[_0x3ebd('0x20')](saveUpdates(_0x2ee16e[_0x3ebd('0x3f')],null))[_0x3ebd('0x20')](respondWithResult(_0x43fc46,null))[_0x3ebd('0x38')](handleError(_0x43fc46,null));};
\ No newline at end of file
index 009ed11..5e07f85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0dc=['bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xe0dc,0x190));var _0xce0d=function(_0x5229a1,_0x5349f8){_0x5229a1=_0x5229a1-0x0;var _0xc4cb55=_0xe0dc[_0x5229a1];return _0xc4cb55;};'use strict';var _=require(_0xce0d('0x0'));var util=require('util');var logger=require(_0xce0d('0x1'))(_0xce0d('0x2'));var moment=require('moment');var BPromise=require(_0xce0d('0x3'));var rp=require(_0xce0d('0x4'));var fs=require('fs');var path=require(_0xce0d('0x5'));var rimraf=require(_0xce0d('0x6'));var config=require('../../config/environment');var attributes=require(_0xce0d('0x7'));module['exports']=function(_0x3e7888,_0x33f430){return _0x3e7888[_0xce0d('0x8')](_0xce0d('0x9'),attributes,{'tableName':_0xce0d('0xa'),'paranoid':![],'indexes':[{'name':_0xce0d('0xb'),'fields':[_0xce0d('0xb')]},{'name':_0xce0d('0xc'),'fields':[_0xce0d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f25=['bluebird','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x25a57a,_0x111c22){var _0x3e203f=function(_0x3fdda5){while(--_0x3fdda5){_0x25a57a['push'](_0x25a57a['shift']());}};_0x3e203f(++_0x111c22);}(_0x8f25,0x14b));var _0x58f2=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8f25[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x58f2('0x0'));var util=require(_0x58f2('0x1'));var logger=require(_0x58f2('0x2'))(_0x58f2('0x3'));var moment=require(_0x58f2('0x4'));var BPromise=require(_0x58f2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x58f2('0x6'));var attributes=require(_0x58f2('0x7'));module[_0x58f2('0x8')]=function(_0x486395,_0x415a68){return _0x486395[_0x58f2('0x9')](_0x58f2('0xa'),attributes,{'tableName':_0x58f2('0xb'),'paranoid':![],'indexes':[{'name':_0x58f2('0xc'),'fields':[_0x58f2('0xc')]},{'name':_0x58f2('0xd'),'fields':[_0x58f2('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5ebd9b0..5473867 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','create','options','raw','stringify','AvgHandleTime','findAll','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','where','ivrAnswerCallsDay','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xf109,0xce));var _0x9f10=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xf109[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});}exports[_0x9f10('0x17')]=function(_0x509fba){var _0x150813=this;return new Promise(function(_0x53bfbd,_0xe221d0){return db['CmHopperHistory'][_0x9f10('0x18')](_0x509fba['body'],{'raw':_0x509fba['options']?_0x509fba[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![]})[_0x9f10('0xc')](function(_0x3a78be){logger[_0x9f10('0xd')](_0x9f10('0x17'),_0x509fba);logger[_0x9f10('0xf')]('CreateCmHopperHistory',_0x509fba,JSON[_0x9f10('0x1b')](_0x3a78be));_0x53bfbd(_0x3a78be);})['catch'](function(_0x293990){logger[_0x9f10('0x11')](_0x9f10('0x17'),_0x293990['message'],_0x509fba);_0xe221d0(_0x150813[_0x9f10('0x11')](0x1f4,_0x293990[_0x9f10('0x14')]));});});};exports[_0x9f10('0x1c')]=function(_0x4d21c5){var _0x36821e=this;return new Promise(function(_0x37e9ac,_0x44b99d){return db['CmHopperHistory'][_0x9f10('0x1d')]({'raw':_0x4d21c5[_0x9f10('0x19')]?_0x4d21c5[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d21c5['options']?_0x4d21c5['options']['where']||null:null,'attributes':[[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')][_0x9f10('0x1f')]('id')),_0x9f10('0x20')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x23')))),_0x9f10('0x24')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x25')))),_0x9f10('0x26')],[db['sequelize']['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x27')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x28'),db[_0x9f10('0x1e')]['fn']('IF',db['sequelize'][_0x9f10('0x22')](_0x9f10('0x29')))),_0x9f10('0x2a')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x28'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x2b')))),_0x9f10('0x2c')]]})[_0x9f10('0xc')](function(_0x11ee9c){logger[_0x9f10('0xd')](_0x9f10('0x1c'),_0x4d21c5);logger['debug'](_0x9f10('0x1c'),_0x4d21c5,JSON[_0x9f10('0x1b')](_0x11ee9c));_0x37e9ac(_0x11ee9c);})[_0x9f10('0x16')](function(_0x5e63b1){logger[_0x9f10('0x11')](_0x9f10('0x1c'),_0x5e63b1['message'],_0x4d21c5);_0x44b99d(_0x36821e[_0x9f10('0x11')](0x1f4,_0x5e63b1['message']));});});};exports[_0x9f10('0x2d')]=function(_0x1b7a66){var _0x26df66=this;return new Promise(function(_0xc17ea2,_0x20605a){return db[_0x9f10('0x2e')][_0x9f10('0x1d')]({'raw':_0x1b7a66[_0x9f10('0x19')]?_0x1b7a66['options'][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b7a66[_0x9f10('0x19')]?_0x1b7a66[_0x9f10('0x19')]['where']||null:null,'attributes':[[_0x9f10('0x2f'),_0x9f10('0x30')],[db['sequelize']['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x9f10('0x31')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x32')))),_0x9f10('0x33')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')]('`state`\x20=\x205,\x201,\x20null'))),_0x9f10('0x34')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db['sequelize'][_0x9f10('0x22')](_0x9f10('0x35')))),_0x9f10('0x36')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x37')))),_0x9f10('0x38')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x39')))),_0x9f10('0x3a')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x3b')))),_0x9f10('0x3c')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x3d')))),_0x9f10('0x3e')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x3f')))),_0x9f10('0x40')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db['sequelize']['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x41')))),_0x9f10('0x42')],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')]['literal'](_0x9f10('0x43')))),'outboundRejectCallsDay'],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x44')))),_0x9f10('0x45')]],'group':['campaign']})[_0x9f10('0xc')](function(_0x63abfb){logger[_0x9f10('0xd')](_0x9f10('0x2d'),_0x1b7a66);logger['debug']('GetVoiceQueueHopperHistory',_0x1b7a66,JSON[_0x9f10('0x1b')](_0x63abfb));_0xc17ea2(_0x63abfb);})[_0x9f10('0x16')](function(_0x4bd874){logger['error'](_0x9f10('0x2d'),_0x4bd874[_0x9f10('0x14')],_0x1b7a66);_0x20605a(_0x26df66[_0x9f10('0x11')](0x1f4,_0x4bd874['message']));});});};exports[_0x9f10('0x46')]=function(_0x44a5d9){var _0x7611e8=this;return new Promise(function(_0x4c3d18,_0x37ae9c){return db[_0x9f10('0x2e')][_0x9f10('0x1d')]({'raw':_0x44a5d9['options']?_0x44a5d9[_0x9f10('0x19')][_0x9f10('0x1a')]===undefined?!![]:![]:!![],'where':_0x44a5d9['options']?_0x44a5d9[_0x9f10('0x19')][_0x9f10('0x47')]||null:null,'attributes':[[_0x9f10('0x2f'),_0x9f10('0x30')],[db[_0x9f10('0x1e')]['fn']('COUNT',db[_0x9f10('0x1e')]['col']('id')),'ivrTotalCallsDays'],[db[_0x9f10('0x1e')]['fn'](_0x9f10('0x21'),db[_0x9f10('0x1e')]['fn']('IF',db[_0x9f10('0x1e')][_0x9f10('0x22')](_0x9f10('0x23')))),_0x9f10('0x48')]],'group':['campaign']})['then'](function(_0x4245be){logger[_0x9f10('0xd')](_0x9f10('0x46'),_0x44a5d9);logger[_0x9f10('0xf')](_0x9f10('0x46'),_0x44a5d9,JSON[_0x9f10('0x1b')](_0x4245be));_0x4c3d18(_0x4245be);})[_0x9f10('0x16')](function(_0x526184){logger[_0x9f10('0x11')](_0x9f10('0x46'),_0x526184['message'],_0x44a5d9);_0x37ae9c(_0x7611e8[_0x9f10('0x11')](0x1f4,_0x526184[_0x9f10('0x14')]));});});};
\ No newline at end of file
+var _0xf2f3=['then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','debug','AvgHandleTime','findAll','raw','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','catch','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x3b5c56,_0x42a6e4){var _0x4c9d54=function(_0x4c634f){while(--_0x4c634f){_0x3b5c56['push'](_0x3b5c56['shift']());}};_0x4c9d54(++_0x42a6e4);}(_0xf2f3,0x15d));var _0x3f2f=function(_0x20110b,_0xb2f01a){_0x20110b=_0x20110b-0x0;var _0x56503f=_0xf2f3[_0x20110b];return _0x56503f;};'use strict';var _=require('lodash');var util=require(_0x3f2f('0x0'));var moment=require(_0x3f2f('0x1'));var BPromise=require(_0x3f2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f2f('0x3'));var db=require(_0x3f2f('0x4'))['db'];var utils=require(_0x3f2f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f2f('0x6'));var jayson=require(_0x3f2f('0x7'));var client=jayson[_0x3f2f('0x8')][_0x3f2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbcd687,_0x4650c5,_0x401c52){return new BPromise(function(_0x19fe4a,_0xc83ca3){return client[_0x3f2f('0xa')](_0xbcd687,_0x401c52)[_0x3f2f('0xb')](function(_0x438f59){logger[_0x3f2f('0xc')](_0x3f2f('0xd'),_0x4650c5,_0x3f2f('0xe'));logger['debug'](_0x3f2f('0xf'),_0x4650c5,_0x3f2f('0xe'),JSON[_0x3f2f('0x10')](_0x438f59));if(_0x438f59['error']){if(_0x438f59[_0x3f2f('0x11')][_0x3f2f('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4650c5,_0x438f59[_0x3f2f('0x11')]['message']);return _0xc83ca3(_0x438f59['error'][_0x3f2f('0x13')]);}logger[_0x3f2f('0x11')](_0x3f2f('0xd'),_0x4650c5,_0x438f59['error']['message']);return _0x19fe4a(_0x438f59[_0x3f2f('0x11')][_0x3f2f('0x13')]);}else{logger[_0x3f2f('0xc')](_0x3f2f('0xd'),_0x4650c5,_0x3f2f('0xe'));_0x19fe4a(_0x438f59[_0x3f2f('0x14')][_0x3f2f('0x13')]);}})['catch'](function(_0x474ed2){logger[_0x3f2f('0x11')](_0x3f2f('0xd'),_0x4650c5,_0x474ed2);_0xc83ca3(_0x474ed2);});});}exports[_0x3f2f('0x15')]=function(_0x34813b){var _0x88470f=this;return new Promise(function(_0xb1602f,_0x4be3f7){return db[_0x3f2f('0x16')][_0x3f2f('0x17')](_0x34813b[_0x3f2f('0x18')],{'raw':_0x34813b['options']?_0x34813b[_0x3f2f('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3f2f('0xb')](function(_0x28a669){logger[_0x3f2f('0xc')](_0x3f2f('0x15'),_0x34813b);logger[_0x3f2f('0x1a')](_0x3f2f('0x15'),_0x34813b,JSON[_0x3f2f('0x10')](_0x28a669));_0xb1602f(_0x28a669);})['catch'](function(_0xa6488d){logger[_0x3f2f('0x11')]('CreateCmHopperHistory',_0xa6488d[_0x3f2f('0x13')],_0x34813b);_0x4be3f7(_0x88470f[_0x3f2f('0x11')](0x1f4,_0xa6488d[_0x3f2f('0x13')]));});});};exports[_0x3f2f('0x1b')]=function(_0x4661cc){var _0x397395=this;return new Promise(function(_0x33f2a5,_0x4aea5f){return db[_0x3f2f('0x16')][_0x3f2f('0x1c')]({'raw':_0x4661cc['options']?_0x4661cc[_0x3f2f('0x19')][_0x3f2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4661cc[_0x3f2f('0x19')]?_0x4661cc['options'][_0x3f2f('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x3f2f('0x1f')][_0x3f2f('0x20')]('id')),_0x3f2f('0x21')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x24')))),_0x3f2f('0x25')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x26')))),_0x3f2f('0x27')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x28'),db['sequelize']['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x28'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x3f2f('0xb')](function(_0x35f09f){logger[_0x3f2f('0xc')](_0x3f2f('0x1b'),_0x4661cc);logger['debug'](_0x3f2f('0x1b'),_0x4661cc,JSON['stringify'](_0x35f09f));_0x33f2a5(_0x35f09f);})['catch'](function(_0x345ea6){logger[_0x3f2f('0x11')](_0x3f2f('0x1b'),_0x345ea6[_0x3f2f('0x13')],_0x4661cc);_0x4aea5f(_0x397395['error'](0x1f4,_0x345ea6[_0x3f2f('0x13')]));});});};exports[_0x3f2f('0x2a')]=function(_0x210a70){var _0x24c469=this;return new Promise(function(_0xa698a9,_0x34963f){return db[_0x3f2f('0x16')][_0x3f2f('0x1c')]({'raw':_0x210a70[_0x3f2f('0x19')]?_0x210a70[_0x3f2f('0x19')][_0x3f2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x210a70[_0x3f2f('0x19')]?_0x210a70[_0x3f2f('0x19')][_0x3f2f('0x1e')]||null:null,'attributes':[[_0x3f2f('0x2b'),_0x3f2f('0x2c')],[db[_0x3f2f('0x1f')]['fn']('COUNT',db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x2d')))),_0x3f2f('0x2e')],[db['sequelize']['fn']('COUNT',db[_0x3f2f('0x1f')]['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x2f')))),_0x3f2f('0x30')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x24')))),'outboundAnswerCallsDay'],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x31')))),'outboundBusyCallsDay'],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db['sequelize']['literal'](_0x3f2f('0x32')))),_0x3f2f('0x33')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x34')))),_0x3f2f('0x35')],[db[_0x3f2f('0x1f')]['fn']('COUNT',db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x36')))),_0x3f2f('0x37')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x38')))),_0x3f2f('0x39')],[db['sequelize']['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x3a')))),_0x3f2f('0x3b')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')]['literal'](_0x3f2f('0x3c')))),_0x3f2f('0x3d')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db['sequelize'][_0x3f2f('0x23')](_0x3f2f('0x3e')))),_0x3f2f('0x3f')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db[_0x3f2f('0x1f')]['literal'](_0x3f2f('0x40')))),_0x3f2f('0x41')],[db['sequelize']['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')]['literal'](_0x3f2f('0x42')))),_0x3f2f('0x3f')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db[_0x3f2f('0x1f')]['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x3f2f('0x43')]],'group':[_0x3f2f('0x2b')]})[_0x3f2f('0xb')](function(_0x300808){logger['info']('GetVoiceQueueHopperHistory',_0x210a70);logger[_0x3f2f('0x1a')](_0x3f2f('0x2a'),_0x210a70,JSON['stringify'](_0x300808));_0xa698a9(_0x300808);})[_0x3f2f('0x44')](function(_0x5ffdc8){logger[_0x3f2f('0x11')](_0x3f2f('0x2a'),_0x5ffdc8[_0x3f2f('0x13')],_0x210a70);_0x34963f(_0x24c469['error'](0x1f4,_0x5ffdc8[_0x3f2f('0x13')]));});});};exports[_0x3f2f('0x45')]=function(_0x15b8c4){var _0x344637=this;return new Promise(function(_0x14fcf8,_0x3e757c){return db[_0x3f2f('0x16')][_0x3f2f('0x1c')]({'raw':_0x15b8c4[_0x3f2f('0x19')]?_0x15b8c4['options'][_0x3f2f('0x1d')]===undefined?!![]:![]:!![],'where':_0x15b8c4[_0x3f2f('0x19')]?_0x15b8c4[_0x3f2f('0x19')][_0x3f2f('0x1e')]||null:null,'attributes':[[_0x3f2f('0x2b'),_0x3f2f('0x2c')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize'][_0x3f2f('0x20')]('id')),_0x3f2f('0x46')],[db[_0x3f2f('0x1f')]['fn'](_0x3f2f('0x22'),db['sequelize']['fn']('IF',db[_0x3f2f('0x1f')][_0x3f2f('0x23')](_0x3f2f('0x24')))),_0x3f2f('0x47')]],'group':['campaign']})[_0x3f2f('0xb')](function(_0x5e70af){logger[_0x3f2f('0xc')](_0x3f2f('0x45'),_0x15b8c4);logger[_0x3f2f('0x1a')](_0x3f2f('0x45'),_0x15b8c4,JSON['stringify'](_0x5e70af));_0x14fcf8(_0x5e70af);})[_0x3f2f('0x44')](function(_0x58331f){logger[_0x3f2f('0x11')]('GetCampaignHopperHistory',_0x58331f[_0x3f2f('0x13')],_0x15b8c4);_0x3e757c(_0x344637[_0x3f2f('0x11')](0x1f4,_0x58331f[_0x3f2f('0x13')]));});});};
\ No newline at end of file
index f50c632..3fa686b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf9=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','multer','util','path','connect-timeout'];(function(_0x56a0aa,_0x49cb8a){var _0x56754f=function(_0x44272e){while(--_0x44272e){_0x56a0aa['push'](_0x56a0aa['shift']());}};_0x56754f(++_0x49cb8a);}(_0x7bf9,0xec));var _0x97bf=function(_0xdb027c,_0x555595){_0xdb027c=_0xdb027c-0x0;var _0x7b4cf3=_0x7bf9[_0xdb027c];return _0x7b4cf3;};'use strict';var multer=require(_0x97bf('0x0'));var util=require(_0x97bf('0x1'));var path=require(_0x97bf('0x2'));var timeout=require(_0x97bf('0x3'));var express=require(_0x97bf('0x4'));var router=express[_0x97bf('0x5')]();var fs_extra=require(_0x97bf('0x6'));var auth=require(_0x97bf('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x97bf('0x8'));var controller=require(_0x97bf('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x97bf('0xa')]);router[_0x97bf('0xb')](_0x97bf('0xc'),auth[_0x97bf('0xd')](),controller[_0x97bf('0xe')]);router[_0x97bf('0xb')](_0x97bf('0xf'),auth[_0x97bf('0xd')](),controller['show']);router[_0x97bf('0x10')]('/',auth[_0x97bf('0xd')](),controller[_0x97bf('0x11')]);router[_0x97bf('0x12')](_0x97bf('0xf'),auth[_0x97bf('0xd')](),controller[_0x97bf('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x636c=['describe','/:id','show','put','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe'];(function(_0x25fe9e,_0x2088a4){var _0x1210ce=function(_0x43ff87){while(--_0x43ff87){_0x25fe9e['push'](_0x25fe9e['shift']());}};_0x1210ce(++_0x2088a4);}(_0x636c,0xe2));var _0xc636=function(_0xc21bdd,_0xd65590){_0xc21bdd=_0xc21bdd-0x0;var _0x35dd99=_0x636c[_0xc21bdd];return _0x35dd99;};'use strict';var multer=require(_0xc636('0x0'));var util=require(_0xc636('0x1'));var path=require('path');var timeout=require(_0xc636('0x2'));var express=require(_0xc636('0x3'));var router=express[_0xc636('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc636('0x5'));var interaction=require(_0xc636('0x6'));var config=require(_0xc636('0x7'));var controller=require(_0xc636('0x8'));router[_0xc636('0x9')]('/',auth[_0xc636('0xa')](),controller['index']);router['get'](_0xc636('0xb'),auth[_0xc636('0xa')](),controller[_0xc636('0xc')]);router[_0xc636('0x9')](_0xc636('0xd'),auth[_0xc636('0xa')](),controller[_0xc636('0xe')]);router['post']('/',auth[_0xc636('0xa')](),controller['create']);router[_0xc636('0xf')](_0xc636('0xd'),auth[_0xc636('0xa')](),controller[_0xc636('0x10')]);module['exports']=router;
\ No newline at end of file
index b2e2932..c505c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86f4=['STRING','name','sequelize','exports'];(function(_0x2f7089,_0x4f71db){var _0x49abb7=function(_0x43c74e){while(--_0x43c74e){_0x2f7089['push'](_0x2f7089['shift']());}};_0x49abb7(++_0x4f71db);}(_0x86f4,0x18a));var _0x486f=function(_0x5600f5,_0x78c4be){_0x5600f5=_0x5600f5-0x0;var _0x50a8e6=_0x86f4[_0x5600f5];return _0x50a8e6;};'use strict';var Sequelize=require(_0x486f('0x0'));module[_0x486f('0x1')]={'name':{'type':Sequelize[_0x486f('0x2')],'unique':_0x486f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x486f('0x2')]},'dialPrefix':{'type':Sequelize[_0x486f('0x2')]}};
\ No newline at end of file
+var _0x0dec=['sequelize','exports','STRING','name'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x0dec,0x11c));var _0xc0de=function(_0x4cf6ad,_0x262926){_0x4cf6ad=_0x4cf6ad-0x0;var _0x191351=_0x0dec[_0x4cf6ad];return _0x191351;};'use strict';var Sequelize=require(_0xc0de('0x0'));module[_0xc0de('0x1')]={'name':{'type':Sequelize[_0xc0de('0x2')],'unique':_0xc0de('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xc0de('0x2')]}};
\ No newline at end of file
index 0d4b47d..f0876d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9ad=['bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','error','stack','name','index','map','CmList','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addDisposition','ListId','Disposition','getDispositions','findOne','filter','removeDispositions','ids','describe','tags','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','CmContact','now','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0xb9ad,0x1b1));var _0xdb9a=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb9ad[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0xdb9a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb9a('0x1'));var jsonpatch=require(_0xdb9a('0x2'));var rp=require(_0xdb9a('0x3'));var moment=require(_0xdb9a('0x4'));var BPromise=require(_0xdb9a('0x5'));var Mustache=require(_0xdb9a('0x6'));var util=require(_0xdb9a('0x7'));var path=require(_0xdb9a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdb9a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb9a('0xa'));var squel=require(_0xdb9a('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb9a('0xc'));var deskjs=require(_0xdb9a('0xd'));var toCsv=require(_0xdb9a('0xe'));var querystring=require(_0xdb9a('0xf'));var Papa=require(_0xdb9a('0x10'));var Redis=require('ioredis');var authService=require(_0xdb9a('0x11'));var qs=require(_0xdb9a('0x12'));var as=require(_0xdb9a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb9a('0x14'))('api');var utils=require(_0xdb9a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdb9a('0x16'));var db=require(_0xdb9a('0x17'))['db'];config['redis']=_[_0xdb9a('0x18')](config[_0xdb9a('0x19')],{'host':_0xdb9a('0x1a'),'port':0x18eb});var socket=require(_0xdb9a('0x1b'))(new Redis(config[_0xdb9a('0x19')]));require(_0xdb9a('0x1c'))['register'](socket);function respondWithStatusCode(_0x542fcb,_0x3498c8){_0x3498c8=_0x3498c8||0xcc;return function(_0x429fab){if(_0x429fab){return _0x542fcb[_0xdb9a('0x1d')](_0x3498c8);}return _0x542fcb[_0xdb9a('0x1e')](_0x3498c8)[_0xdb9a('0x1f')]();};}function respondWithResult(_0x121dfd,_0x334d49){_0x334d49=_0x334d49||0xc8;return function(_0x44e188){if(_0x44e188){return _0x121dfd['status'](_0x334d49)[_0xdb9a('0x20')](_0x44e188);}};}function respondWithFilteredResult(_0x1c7d20,_0x15376c){return function(_0xe707f2){if(_0xe707f2){var _0x422a8b=typeof _0x15376c[_0xdb9a('0x21')]===_0xdb9a('0x22')&&typeof _0x15376c[_0xdb9a('0x23')]===_0xdb9a('0x22');var _0x47990b=_0xe707f2[_0xdb9a('0x24')];var _0x3cb1ec=_0x422a8b?0x0:_0x15376c[_0xdb9a('0x21')];var _0x42f208=_0x422a8b?_0xe707f2[_0xdb9a('0x24')]:_0x15376c[_0xdb9a('0x21')]+_0x15376c['limit'];var _0x59b3f5;if(_0x42f208>=_0x47990b){_0x42f208=_0x47990b;_0x59b3f5=0xc8;}else{_0x59b3f5=0xce;}_0x1c7d20['status'](_0x59b3f5);return _0x1c7d20[_0xdb9a('0x25')](_0xdb9a('0x26'),_0x3cb1ec+'-'+_0x42f208+'/'+_0x47990b)[_0xdb9a('0x20')](_0xe707f2);}return null;};}function patchUpdates(_0x16207b){return function(_0x398f1e){try{jsonpatch[_0xdb9a('0x27')](_0x398f1e,_0x16207b,!![]);}catch(_0x49b476){return BPromise[_0xdb9a('0x28')](_0x49b476);}return _0x398f1e[_0xdb9a('0x29')]();};}function saveUpdates(_0x540cf8,_0x379b5f){return function(_0x570562){if(_0x570562){return _0x570562[_0xdb9a('0x2a')](_0x540cf8)[_0xdb9a('0x2b')](function(_0x5ca072){return _0x5ca072;});}return null;};}function removeEntity(_0x1fdeef,_0x82cd02){return function(_0x5bef56){if(_0x5bef56){return _0x5bef56['destroy']()[_0xdb9a('0x2b')](function(){var _0x54cb2a=_0x5bef56[_0xdb9a('0x2c')]({'plain':!![]});var _0x1b7b0a=_0xdb9a('0x2d');return db[_0xdb9a('0x2e')]['destroy']({'where':{'type':_0x1b7b0a,'resourceId':_0x54cb2a['id']}})['then'](function(){return _0x5bef56;});})['then'](function(){_0x1fdeef[_0xdb9a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d899,_0x1e733b){return function(_0x55aeca){if(!_0x55aeca){_0x43d899['sendStatus'](0x194);}return _0x55aeca;};}function handleError(_0xaa770c,_0x2595ec){_0x2595ec=_0x2595ec||0x1f4;return function(_0x45892a){logger[_0xdb9a('0x2f')](_0x45892a[_0xdb9a('0x30')]);if(_0x45892a[_0xdb9a('0x31')]){delete _0x45892a[_0xdb9a('0x31')];}_0xaa770c[_0xdb9a('0x1e')](_0x2595ec)['send'](_0x45892a);};}exports[_0xdb9a('0x32')]=function(_0x43493b,_0x135ef1){var _0x5a9638={},_0x3bb55a={},_0x1460c2={'count':0x0,'rows':[]};var _0x24317c=_[_0xdb9a('0x33')](db[_0xdb9a('0x34')][_0xdb9a('0x35')],function(_0xaa027d){return{'name':_0xaa027d[_0xdb9a('0x36')],'type':_0xaa027d[_0xdb9a('0x37')]['key']};});_0x3bb55a['model']=_[_0xdb9a('0x33')](_0x24317c,_0xdb9a('0x31'));_0x3bb55a[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x43493b[_0xdb9a('0x38')]);_0x3bb55a[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0x3bb55a[_0xdb9a('0x3c')],_0x3bb55a[_0xdb9a('0x38')]);_0x5a9638['attributes']=_[_0xdb9a('0x3b')](_0x3bb55a[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x5a9638[_0xdb9a('0x3e')]=_0x5a9638['attributes'][_0xdb9a('0x3f')]?_0x5a9638[_0xdb9a('0x3e')]:_0x3bb55a[_0xdb9a('0x3c')];if(!_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x5a9638[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x43493b[_0xdb9a('0x38')]['limit']);_0x5a9638['offset']=qs[_0xdb9a('0x21')](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x21')]);}_0x5a9638[_0xdb9a('0x42')]=qs['sort'](_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x5a9638[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x43493b[_0xdb9a('0x38')],_0x3bb55a[_0xdb9a('0x3a')]),_0x24317c);if(_0x43493b[_0xdb9a('0x38')]['filter']){_0x5a9638[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5a9638[_0xdb9a('0x44')],{'$or':_['map'](_0x24317c,function(_0x36b160){if(_0x36b160[_0xdb9a('0x37')]!==_0xdb9a('0x47')){var _0x9c9eac={};_0x9c9eac[_0x36b160[_0xdb9a('0x31')]]={'$like':'%'+_0x43493b[_0xdb9a('0x38')]['filter']+'%'};return _0x9c9eac;}})});}_0x5a9638=_[_0xdb9a('0x46')]({},_0x5a9638,_0x43493b['options']);var _0x2b330a={'where':_0x5a9638['where']};return db[_0xdb9a('0x34')][_0xdb9a('0x24')](_0x2b330a)[_0xdb9a('0x2b')](function(_0x1dcede){_0x1460c2['count']=_0x1dcede;if(_0x43493b[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x5a9638['include']=[{'all':!![]}];}return db[_0xdb9a('0x34')][_0xdb9a('0x49')](_0x5a9638);})[_0xdb9a('0x2b')](function(_0x2239e8){_0x1460c2[_0xdb9a('0x4a')]=_0x2239e8;return _0x1460c2;})[_0xdb9a('0x2b')](respondWithFilteredResult(_0x135ef1,_0x5a9638))[_0xdb9a('0x4b')](handleError(_0x135ef1,null));};exports['show']=function(_0x1b52b1,_0x3f19db){var _0x1ccd36={'raw':![],'where':{'id':_0x1b52b1[_0xdb9a('0x4c')]['id']}},_0x3e7c45={};_0x3e7c45['model']=_[_0xdb9a('0x39')](db[_0xdb9a('0x34')][_0xdb9a('0x35')]);_0x3e7c45[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x1b52b1[_0xdb9a('0x38')]);_0x3e7c45['filters']=_[_0xdb9a('0x3b')](_0x3e7c45[_0xdb9a('0x3c')],_0x3e7c45['query']);_0x1ccd36[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x3e7c45[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x1b52b1[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x1ccd36[_0xdb9a('0x3e')]=_0x1ccd36['attributes'][_0xdb9a('0x3f')]?_0x1ccd36[_0xdb9a('0x3e')]:_0x3e7c45['model'];if(_0x1b52b1[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x1ccd36[_0xdb9a('0x4d')]=[{'all':!![]}];}_0x1ccd36=_['merge']({},_0x1ccd36,_0x1b52b1[_0xdb9a('0x4e')]);return db[_0xdb9a('0x34')][_0xdb9a('0x4f')](_0x1ccd36)[_0xdb9a('0x2b')](handleEntityNotFound(_0x3f19db,null))[_0xdb9a('0x2b')](respondWithResult(_0x3f19db,null))['catch'](handleError(_0x3f19db,null));};exports['create']=function(_0x4b7077,_0x1c5d4b){return db['CmList'][_0xdb9a('0x50')](_0x4b7077[_0xdb9a('0x51')],{})[_0xdb9a('0x2b')](function(_0x254ec9){var _0x29ff41=_0x4b7077[_0xdb9a('0x52')]['get']({'plain':!![]});if(!_0x29ff41)throw new Error(_0xdb9a('0x53'));if(_0x29ff41[_0xdb9a('0x54')]===_0xdb9a('0x52')){var _0x4c55e7=_0x254ec9[_0xdb9a('0x2c')]({'plain':!![]});var _0x4d3c02=_0xdb9a('0x2d');return db[_0xdb9a('0x55')]['find']({'where':{'name':_0x4d3c02,'userProfileId':_0x29ff41[_0xdb9a('0x56')]},'raw':!![]})['then'](function(_0x32096e){if(_0x32096e&&_0x32096e['autoAssociation']===0x0){return db[_0xdb9a('0x2e')]['create']({'name':_0x4c55e7[_0xdb9a('0x31')],'resourceId':_0x4c55e7['id'],'type':_0x32096e[_0xdb9a('0x31')],'sectionId':_0x32096e['id']},{})[_0xdb9a('0x2b')](function(){return _0x254ec9;});}else{return _0x254ec9;}})['catch'](function(_0x2549c1){logger[_0xdb9a('0x2f')](_0xdb9a('0x57'),_0x2549c1);throw _0x2549c1;});}return _0x254ec9;})[_0xdb9a('0x2b')](respondWithResult(_0x1c5d4b,0xc9))[_0xdb9a('0x4b')](handleError(_0x1c5d4b,null));};exports['update']=function(_0x5d44e4,_0x8c5622){if(_0x5d44e4[_0xdb9a('0x51')]['id']){delete _0x5d44e4[_0xdb9a('0x51')]['id'];}return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x5d44e4[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x8c5622,null))[_0xdb9a('0x2b')](saveUpdates(_0x5d44e4[_0xdb9a('0x51')],null))[_0xdb9a('0x2b')](respondWithResult(_0x8c5622,null))[_0xdb9a('0x4b')](handleError(_0x8c5622,null));};exports[_0xdb9a('0x58')]=function(_0x2e1fdf,_0x37fbad){return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x2e1fdf[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x37fbad,null))['then'](removeEntity(_0x37fbad,null))['catch'](handleError(_0x37fbad,null));};exports['describe']=function(_0x37e6f0,_0x3412b9){return db[_0xdb9a('0x34')]['describe']()[_0xdb9a('0x2b')](respondWithResult(_0x3412b9,null))['catch'](handleError(_0x3412b9,null));};exports[_0xdb9a('0x59')]=function(_0x370251,_0x4466ef,_0x5e0c92){if(_0x370251[_0xdb9a('0x51')]['id']){delete _0x370251[_0xdb9a('0x51')]['id'];}return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x370251[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4466ef,null))[_0xdb9a('0x2b')](function(_0x3b3f4f){if(_0x3b3f4f){_0x370251['body'][_0xdb9a('0x5a')]=_0x3b3f4f['id'];return db[_0xdb9a('0x5b')]['create'](_0x370251[_0xdb9a('0x51')]);}})[_0xdb9a('0x2b')](respondWithResult(_0x4466ef,null))[_0xdb9a('0x4b')](handleError(_0x4466ef,null));};exports[_0xdb9a('0x5c')]=function(_0x430936,_0x8c7f1a,_0x3125ab){var _0x14bb39={'raw':![],'where':{}};var _0x5523f9={};var _0x75ac5e={'count':0x0,'rows':[]};return db[_0xdb9a('0x34')][_0xdb9a('0x5d')]({'where':{'id':_0x430936['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x8c7f1a,null))[_0xdb9a('0x2b')](function(_0x48edc3){if(_0x48edc3){_0x5523f9[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db[_0xdb9a('0x5b')]['rawAttributes']);_0x5523f9[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x430936[_0xdb9a('0x38')]);_0x5523f9[_0xdb9a('0x3a')]=_['intersection'](_0x5523f9[_0xdb9a('0x3c')],_0x5523f9['query']);_0x14bb39[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x5523f9[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x430936['query'][_0xdb9a('0x3d')]));_0x14bb39[_0xdb9a('0x3e')]=_0x14bb39[_0xdb9a('0x3e')][_0xdb9a('0x3f')]?_0x14bb39[_0xdb9a('0x3e')]:_0x5523f9[_0xdb9a('0x3c')];if(!_0x430936[_0xdb9a('0x38')][_0xdb9a('0x40')]('nolimit')){_0x14bb39[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x430936['query'][_0xdb9a('0x23')]);_0x14bb39[_0xdb9a('0x21')]=qs['offset'](_0x430936[_0xdb9a('0x38')]['offset']);}_0x14bb39[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x430936[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x14bb39[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x430936['query'],_0x5523f9[_0xdb9a('0x3a')]));_0x14bb39[_0xdb9a('0x44')][_0xdb9a('0x5a')]=_0x48edc3['id'];if(_0x430936['query'][_0xdb9a('0x5e')]){_0x14bb39[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x14bb39['where'],{'$or':_['map'](_0x14bb39['attributes'],function(_0x52fe77){var _0x924be4={};_0x924be4[_0x52fe77]={'$like':'%'+_0x430936[_0xdb9a('0x38')]['filter']+'%'};return _0x924be4;})});}_0x14bb39=_[_0xdb9a('0x46')]({},_0x14bb39,_0x430936['options']);return db['Disposition'][_0xdb9a('0x24')]({'where':_0x14bb39[_0xdb9a('0x44')]})[_0xdb9a('0x2b')](function(_0x324330){_0x75ac5e[_0xdb9a('0x24')]=_0x324330;if(_0x430936[_0xdb9a('0x38')][_0xdb9a('0x48')]){_0x14bb39[_0xdb9a('0x4d')]=[{'all':!![]}];}return db[_0xdb9a('0x5b')][_0xdb9a('0x49')](_0x14bb39);})[_0xdb9a('0x2b')](function(_0x33a23d){_0x75ac5e[_0xdb9a('0x4a')]=_0x33a23d;return _0x75ac5e;});}})[_0xdb9a('0x2b')](respondWithFilteredResult(_0x8c7f1a,_0x14bb39))[_0xdb9a('0x4b')](handleError(_0x8c7f1a,null));};exports[_0xdb9a('0x5f')]=function(_0x513a18,_0x4a4690,_0x707118){return db['CmList']['find']({'where':{'id':_0x513a18[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4a4690,null))[_0xdb9a('0x2b')](function(_0x59b83d){if(_0x59b83d){return _0x59b83d['removeDispositions'](_0x513a18['query'][_0xdb9a('0x60')]);}})[_0xdb9a('0x2b')](respondWithStatusCode(_0x4a4690,null))[_0xdb9a('0x4b')](handleError(_0x4a4690,null));};exports['addContacts']=function(_0xbaf4c7,_0x4f6341,_0x11cbf0){return db[_0xdb9a('0x34')]['find']({'where':{'id':_0xbaf4c7[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4f6341,null))[_0xdb9a('0x2b')](function(_0x293890){if(_0x293890){var _0x54fade=[];var _0x5b256f={'success':[],'errors':[]};return db['CmContact'][_0xdb9a('0x61')]()[_0xdb9a('0x2b')](function(_0x145977){if(_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]&&_[_0xdb9a('0x63')](_0xbaf4c7[_0xdb9a('0x51')]['tags'])){if(_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]['length']){_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]['join'](';')+';';}else{_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=null;}}else{_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x62')]=null;}if(_0xbaf4c7['body']&&_[_0xdb9a('0x63')](_0xbaf4c7[_0xdb9a('0x51')])){for(var _0x1f802c=0x0;_0x1f802c<_0xbaf4c7[_0xdb9a('0x51')][_0xdb9a('0x3f')];_0x1f802c+=0x1){_0xbaf4c7['body'][_0x1f802c]['ListId']=_0xbaf4c7[_0xdb9a('0x4c')]['id'];_0x54fade[_0xdb9a('0x64')](_0xbaf4c7[_0xdb9a('0x51')][_0x1f802c]);}return BPromise[_0xdb9a('0x65')](_0x54fade,function(_0x56146a){return db['CmContact']['create'](_[_0xdb9a('0x66')](_0x56146a,[_0xdb9a('0x60'),'id'])||{},{'fields':_['keys'](_0x145977),'raw':!![]})[_0xdb9a('0x2b')](function(_0x3103bc){_0x5b256f[_0xdb9a('0x67')][_0xdb9a('0x64')](_0x3103bc[_0xdb9a('0x68')]);})[_0xdb9a('0x4b')](function(_0x274b5e){_0x5b256f[_0xdb9a('0x69')]['push']({'data':_0x56146a,'error':_0x274b5e[_0xdb9a('0x6a')]});});})[_0xdb9a('0x2b')](function(_0xa95c31){return _0x5b256f;})[_0xdb9a('0x4b')](function(_0x1e488b){return _0x1e488b;});}else{_0x4f6341[_0xdb9a('0x1e')](0x190)['json']({'message':_0xdb9a('0x6b')});}});}})['then'](respondWithResult(_0x4f6341,null))[_0xdb9a('0x4b')](handleError(_0x4f6341,null));};exports[_0xdb9a('0x6c')]=function(_0x3e36fc,_0x36a093,_0x4e7d59){var _0x38693a;return db[_0xdb9a('0x34')][_0xdb9a('0x4f')]({'where':{'id':_0x3e36fc['params']['id']},'include':[{'model':db[_0xdb9a('0x6d')],'as':_0xdb9a('0x6e')}]})['then'](handleEntityNotFound(_0x36a093,null))[_0xdb9a('0x2b')](function(_0x18bbcc){if(_0x18bbcc){_0x38693a=_0x18bbcc;return db['CmContact'][_0xdb9a('0x35')];}})[_0xdb9a('0x2b')](function(_0x5cca43){if(_0x5cca43){var _0x4c0180={};var _0x3732ca={};_0x3732ca[_0xdb9a('0x3c')]=_[_0xdb9a('0x6f')](_[_0xdb9a('0x39')](_0x5cca43),_['map'](_0x38693a['CustomFields'],function(_0x14d24c){return util[_0xdb9a('0x70')](_0xdb9a('0x71'),_0x14d24c['id']);}));_0x3732ca[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x3e36fc[_0xdb9a('0x38')]);_0x3732ca['filters']=_[_0xdb9a('0x3b')](_0x3732ca[_0xdb9a('0x3c')],_0x3732ca['query']);_0x4c0180['attributes']=_['intersection'](_0x3732ca['model'],qs[_0xdb9a('0x3d')](_0x3e36fc[_0xdb9a('0x38')]['fields']));_0x4c0180['attributes']=_0x4c0180['attributes'][_0xdb9a('0x3f')]?_0x4c0180['attributes']:_0x3732ca[_0xdb9a('0x3c')];if(!_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x40')]('nolimit')){_0x4c0180[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x23')]);_0x4c0180[_0xdb9a('0x21')]=qs[_0xdb9a('0x21')](_0x3e36fc['query'][_0xdb9a('0x21')]);}_0x4c0180[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x4c0180[_0xdb9a('0x44')]=qs['filters'](_[_0xdb9a('0x45')](_0x3e36fc[_0xdb9a('0x38')],_0x3732ca[_0xdb9a('0x3a')]));_0x4c0180[_0xdb9a('0x72')]=!![];if(_0x3e36fc['query']['filter']){_0x4c0180[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x4c0180['where'],{'$or':_[_0xdb9a('0x33')](_0x4c0180[_0xdb9a('0x3e')],function(_0x5918a8){var _0x51fd92={};_0x51fd92[_0x5918a8]={'$like':'%'+_0x3e36fc[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x51fd92;})});}_0x4c0180=_[_0xdb9a('0x46')]({},_0x4c0180,_0x3e36fc['options']);return _0x38693a['getContacts'](_0x4c0180);}})[_0xdb9a('0x2b')](respondWithResult(_0x36a093,null))[_0xdb9a('0x4b')](handleError(_0x36a093,null));};exports[_0xdb9a('0x73')]=function(_0x652482,_0x1dbdd4,_0x3a8a76){var _0x5292a0;return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x652482[_0xdb9a('0x4c')]['id']},'include':[{'model':db[_0xdb9a('0x6d')],'as':_0xdb9a('0x6e')}]})[_0xdb9a('0x2b')](handleEntityNotFound(_0x1dbdd4,null))[_0xdb9a('0x2b')](function(_0x1aab1d){if(_0x1aab1d){_0x5292a0=_0x1aab1d;return db[_0xdb9a('0x74')][_0xdb9a('0x35')];}})[_0xdb9a('0x2b')](function(_0xf3704a){if(_0xf3704a){var _0x31ad26={};var _0x366fdc={};_0x366fdc[_0xdb9a('0x3c')]=_['concat'](_[_0xdb9a('0x39')](_0xf3704a),_[_0xdb9a('0x33')](_0x5292a0['CustomFields'],function(_0x396f99){return util['format']('cf_%d',_0x396f99['id']);}));_0x366fdc[_0xdb9a('0x38')]=_[_0xdb9a('0x39')](_0x652482[_0xdb9a('0x38')]);_0x366fdc[_0xdb9a('0x3a')]=_['intersection'](_0x366fdc[_0xdb9a('0x3c')],_0x366fdc[_0xdb9a('0x38')]);_0x31ad26[_0xdb9a('0x3e')]=_['intersection'](_0x366fdc['model'],qs[_0xdb9a('0x3d')](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x3d')]));_0x31ad26[_0xdb9a('0x3e')]=_0x31ad26[_0xdb9a('0x3e')]['length']?_0x31ad26[_0xdb9a('0x3e')]:_0x366fdc[_0xdb9a('0x3c')];if(!_0x652482[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x31ad26[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x652482[_0xdb9a('0x38')]['limit']);_0x31ad26['offset']=qs['offset'](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x21')]);}_0x31ad26[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x652482[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x31ad26[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x652482['query'],_0x366fdc['filters']));_0x31ad26['raw']=!![];if(_0x652482[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x31ad26[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x31ad26[_0xdb9a('0x44')],{'$or':_['map'](_0x31ad26[_0xdb9a('0x3e')],function(_0x1b0615){var _0x4f6069={};_0x4f6069[_0x1b0615]={'$like':'%'+_0x652482[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x4f6069;})});}_0x31ad26=_[_0xdb9a('0x46')]({},_0x31ad26,_0x652482[_0xdb9a('0x4e')]);return _0x5292a0[_0xdb9a('0x6c')](_0x31ad26);}})[_0xdb9a('0x2b')](function(_0x37e163){if(!_['isEmpty'](_0x37e163)){var _0x251b9e=toCsv(_0x37e163);var _0x13451b=Date[_0xdb9a('0x75')]();fs['writeFileSync'](util[_0xdb9a('0x70')]('/tmp/list_%d_%s.csv',_0x5292a0['id'],_0x13451b),_0x251b9e);_0x1dbdd4[_0xdb9a('0x76')](_0xdb9a('0x77'),_0xdb9a('0x78')+util[_0xdb9a('0x70')]('list_%d_%s.csv',_0x5292a0['id'],_0x13451b));_0x1dbdd4[_0xdb9a('0x76')]('Content-type',_0xdb9a('0x79'));return _0x1dbdd4[_0xdb9a('0x7a')](util[_0xdb9a('0x70')](_0xdb9a('0x7b'),_0x5292a0['id'],_0x13451b));}else{return _0x1dbdd4[_0xdb9a('0x1d')](0xcc);}})[_0xdb9a('0x4b')](handleError(_0x1dbdd4,null));};exports[_0xdb9a('0x7c')]=function(_0x32c586,_0x1f8d2e,_0x1470b2){var _0x487b4b;delete _0x32c586[_0xdb9a('0x51')]['id'];return db[_0xdb9a('0x34')]['findOne']({'where':{'id':_0x32c586['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x1f8d2e,null))[_0xdb9a('0x2b')](function(_0x436e7c){if(_0x436e7c){return db['sequelize'][_0xdb9a('0x7d')](function(_0x2d3d50){return db[_0xdb9a('0x6d')][_0xdb9a('0x50')](_0x32c586[_0xdb9a('0x51')],{'transaction':_0x2d3d50})['then'](function(_0x4cba46){_0x487b4b=_0x4cba46;return _0x436e7c[_0xdb9a('0x7e')](_0x4cba46,{'transaction':_0x2d3d50});})[_0xdb9a('0x2b')](function(){var _0x265e60={'type':db[_0xdb9a('0x7f')]['TEXT'],'transaction':_0x2d3d50};switch(_0x32c586[_0xdb9a('0x51')][_0xdb9a('0x37')]){case _0xdb9a('0x80'):_0x265e60['type']=db[_0xdb9a('0x7f')][_0xdb9a('0x81')];break;case _0xdb9a('0x82'):_0x265e60[_0xdb9a('0x37')]=db['Sequelize'][_0xdb9a('0x83')];break;case'switch':_0x265e60[_0xdb9a('0x37')]=db[_0xdb9a('0x7f')][_0xdb9a('0x84')];_0x265e60[_0xdb9a('0x85')]=![];break;default:}return db['sequelize'][_0xdb9a('0x86')][_0xdb9a('0x87')](_0xdb9a('0x88'),util['format'](_0xdb9a('0x89'),_0x487b4b['id']),_0x265e60);})['then'](function(){return _0x487b4b;});});}})[_0xdb9a('0x2b')](respondWithResult(_0x1f8d2e,null))[_0xdb9a('0x4b')](handleError(_0x1f8d2e,null));};exports[_0xdb9a('0x8a')]=function(_0x1eb66e,_0x408de8,_0x1e348d){var _0x5863fd={};var _0xfd5675={};var _0x2203bf;var _0x5cc033;return db[_0xdb9a('0x34')][_0xdb9a('0x5d')]({'where':{'id':_0x1eb66e['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x408de8,null))['then'](function(_0x455107){if(_0x455107){_0x2203bf=_0x455107;_0xfd5675[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db['CmCustomField'][_0xdb9a('0x35')]);_0xfd5675[_0xdb9a('0x38')]=_['keys'](_0x1eb66e[_0xdb9a('0x38')]);_0xfd5675[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0xfd5675['model'],_0xfd5675[_0xdb9a('0x38')]);_0x5863fd[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0xfd5675['model'],qs['fields'](_0x1eb66e['query'][_0xdb9a('0x3d')]));_0x5863fd[_0xdb9a('0x3e')]=_0x5863fd['attributes']['length']?_0x5863fd['attributes']:_0xfd5675['model'];_0x5863fd[_0xdb9a('0x42')]=qs[_0xdb9a('0x43')](_0x1eb66e['query'][_0xdb9a('0x43')]);_0x5863fd[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_['pick'](_0x1eb66e[_0xdb9a('0x38')],_0xfd5675[_0xdb9a('0x3a')]));_0x5863fd[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5863fd[_0xdb9a('0x44')],{'$or':[{'ListId':_0x455107['id']},{'ListId':null}]});if(_0x1eb66e[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x5863fd[_0xdb9a('0x44')]=_[_0xdb9a('0x46')](_0x5863fd[_0xdb9a('0x44')],{'$or':_[_0xdb9a('0x33')](_0x5863fd[_0xdb9a('0x3e')],function(_0x3af669){var _0x26b9e4={};_0x26b9e4[_0x3af669]={'$like':'%'+_0x1eb66e[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x26b9e4;})});}_0x5863fd=_[_0xdb9a('0x46')]({},_0x5863fd,_0x1eb66e['options']);return db['CmCustomField']['findAndCountAll'](_0x5863fd);}})[_0xdb9a('0x2b')](respondWithResult(_0x408de8,null))[_0xdb9a('0x4b')](handleError(_0x408de8,null));};exports[_0xdb9a('0x8b')]=function(_0x3cfb3f,_0x20b8e4,_0x5dbb47){return db[_0xdb9a('0x34')]['find']({'where':{'id':_0x3cfb3f['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x20b8e4,null))['then'](function(_0x1209b5){if(_0x1209b5){return _0x1209b5[_0xdb9a('0x8b')](_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')],_[_0xdb9a('0x66')](_0x3cfb3f['body'],[_0xdb9a('0x60'),'id'])||{})['spread'](function(_0x572805){for(var _0x3a63ca=0x0;_0x3a63ca<_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')][_0xdb9a('0x3f')];_0x3a63ca+=0x1){socket[_0xdb9a('0x8c')](_0xdb9a('0x8d'),{'UserId':Number(_0x3cfb3f[_0xdb9a('0x51')][_0xdb9a('0x60')][_0x3a63ca]),'CmListId':Number(_0x3cfb3f[_0xdb9a('0x4c')]['id'])});}return _0x572805;});}})[_0xdb9a('0x2b')](respondWithResult(_0x20b8e4,null))[_0xdb9a('0x4b')](handleError(_0x20b8e4,null));};exports[_0xdb9a('0x8e')]=function(_0x542c6e,_0x4b7f7f,_0x2b0425){return db['CmList'][_0xdb9a('0x4f')]({'where':{'id':_0x542c6e['params']['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x4b7f7f,null))[_0xdb9a('0x2b')](function(_0x493481){if(_0x493481){return _0x493481['removeAgents'](_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')])['then'](function(){if(_[_0xdb9a('0x63')](_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')])){for(var _0x5ec4c0=0x0;_0x5ec4c0<_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')][_0xdb9a('0x3f')];_0x5ec4c0+=0x1){socket[_0xdb9a('0x8c')]('userCmList:remove',{'UserId':Number(_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')][_0x5ec4c0]),'CmListId':Number(_0x542c6e['params']['id'])});}}else{socket['emit'](_0xdb9a('0x8f'),{'UserId':Number(_0x542c6e[_0xdb9a('0x38')][_0xdb9a('0x60')]),'CmListId':Number(_0x542c6e[_0xdb9a('0x4c')]['id'])});}});}})[_0xdb9a('0x2b')](respondWithStatusCode(_0x4b7f7f,null))[_0xdb9a('0x4b')](handleError(_0x4b7f7f,null));};exports['getAgents']=function(_0x30afba,_0x2c5bb8,_0x49fad1){var _0x181e1f={};var _0x4caca9={};var _0x367e69;var _0x523498;return db[_0xdb9a('0x34')]['findOne']({'where':{'id':_0x30afba[_0xdb9a('0x4c')]['id']}})[_0xdb9a('0x2b')](handleEntityNotFound(_0x2c5bb8,null))[_0xdb9a('0x2b')](function(_0x1622c9){if(_0x1622c9){_0x367e69=_0x1622c9;_0x4caca9[_0xdb9a('0x3c')]=_[_0xdb9a('0x39')](db[_0xdb9a('0x90')]['rawAttributes']);_0x4caca9['query']=_[_0xdb9a('0x39')](_0x30afba[_0xdb9a('0x38')]);_0x4caca9[_0xdb9a('0x3a')]=_[_0xdb9a('0x3b')](_0x4caca9[_0xdb9a('0x3c')],_0x4caca9[_0xdb9a('0x38')]);_0x181e1f[_0xdb9a('0x3e')]=_[_0xdb9a('0x3b')](_0x4caca9[_0xdb9a('0x3c')],qs[_0xdb9a('0x3d')](_0x30afba['query']['fields']));_0x181e1f['attributes']=_0x181e1f[_0xdb9a('0x3e')][_0xdb9a('0x3f')]?_0x181e1f['attributes']:_0x4caca9[_0xdb9a('0x3c')];_0x181e1f['order']=qs[_0xdb9a('0x43')](_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x43')]);_0x181e1f[_0xdb9a('0x44')]=qs[_0xdb9a('0x3a')](_[_0xdb9a('0x45')](_0x30afba[_0xdb9a('0x38')],_0x4caca9[_0xdb9a('0x3a')]));if(_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x5e')]){_0x181e1f['where']=_[_0xdb9a('0x46')](_0x181e1f[_0xdb9a('0x44')],{'$or':_[_0xdb9a('0x33')](_0x181e1f['attributes'],function(_0x4364fb){var _0x28b5d3={};_0x28b5d3[_0x4364fb]={'$like':'%'+_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x5e')]+'%'};return _0x28b5d3;})});}_0x181e1f=_['merge']({},_0x181e1f,_0x30afba[_0xdb9a('0x4e')]);return _0x367e69[_0xdb9a('0x91')](_0x181e1f);}})[_0xdb9a('0x2b')](function(_0x519aab){if(_0x519aab){_0x523498=_0x519aab[_0xdb9a('0x3f')];if(!_0x30afba[_0xdb9a('0x38')][_0xdb9a('0x40')](_0xdb9a('0x41'))){_0x181e1f[_0xdb9a('0x23')]=qs[_0xdb9a('0x23')](_0x30afba[_0xdb9a('0x38')]['limit']);_0x181e1f['offset']=qs[_0xdb9a('0x21')](_0x30afba['query'][_0xdb9a('0x21')]);}return _0x367e69[_0xdb9a('0x91')](_0x181e1f);}})[_0xdb9a('0x2b')](function(_0x5a9311){if(_0x5a9311){return _0x5a9311?{'count':_0x523498,'rows':_0x5a9311}:null;}})[_0xdb9a('0x2b')](respondWithResult(_0x2c5bb8,null))[_0xdb9a('0x4b')](handleError(_0x2c5bb8,null));};
\ No newline at end of file
+var _0x0e87=['ListId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','status','end','error','stack','name','send','map','CmList','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','filters','intersection','includeAll','include','find','create','body','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','addDisposition'];(function(_0x18071b,_0xf8221d){var _0x57842a=function(_0x1e3c0b){while(--_0x1e3c0b){_0x18071b['push'](_0x18071b['shift']());}};_0x57842a(++_0xf8221d);}(_0x0e87,0x1d4));var _0x70e8=function(_0x503aa5,_0xa010a6){_0x503aa5=_0x503aa5-0x0;var _0x15f84a=_0x0e87[_0x503aa5];return _0x15f84a;};'use strict';var emlformat=require(_0x70e8('0x0'));var rimraf=require(_0x70e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x70e8('0x2'));var moment=require(_0x70e8('0x3'));var BPromise=require(_0x70e8('0x4'));var Mustache=require(_0x70e8('0x5'));var util=require('util');var path=require(_0x70e8('0x6'));var sox=require(_0x70e8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70e8('0x8'));var _=require(_0x70e8('0x9'));var squel=require(_0x70e8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x70e8('0xb'));var toCsv=require(_0x70e8('0xc'));var querystring=require(_0x70e8('0xd'));var Papa=require(_0x70e8('0xe'));var Redis=require(_0x70e8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x70e8('0x10'));var as=require(_0x70e8('0x11'));var hardwareService=require(_0x70e8('0x12'));var logger=require(_0x70e8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x70e8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x70e8('0x15'))['db'];config['redis']=_[_0x70e8('0x16')](config[_0x70e8('0x17')],{'host':_0x70e8('0x18'),'port':0x18eb});var socket=require(_0x70e8('0x19'))(new Redis(config[_0x70e8('0x17')]));require(_0x70e8('0x1a'))[_0x70e8('0x1b')](socket);function respondWithStatusCode(_0x5c6e51,_0x1710cf){_0x1710cf=_0x1710cf||0xcc;return function(_0x3cbf14){if(_0x3cbf14){return _0x5c6e51[_0x70e8('0x1c')](_0x1710cf);}return _0x5c6e51['status'](_0x1710cf)['end']();};}function respondWithResult(_0x29c61b,_0x24affa){_0x24affa=_0x24affa||0xc8;return function(_0x446303){if(_0x446303){return _0x29c61b['status'](_0x24affa)['json'](_0x446303);}};}function respondWithFilteredResult(_0x308b6e,_0x1c9e5a){return function(_0x540fc0){if(_0x540fc0){var _0x205132=typeof _0x1c9e5a[_0x70e8('0x1d')]===_0x70e8('0x1e')&&typeof _0x1c9e5a[_0x70e8('0x1f')]===_0x70e8('0x1e');var _0x99a540=_0x540fc0[_0x70e8('0x20')];var _0x2c5654=_0x205132?0x0:_0x1c9e5a[_0x70e8('0x1d')];var _0x237c2d=_0x205132?_0x540fc0[_0x70e8('0x20')]:_0x1c9e5a[_0x70e8('0x1d')]+_0x1c9e5a['limit'];var _0x3b367d;if(_0x237c2d>=_0x99a540){_0x237c2d=_0x99a540;_0x3b367d=0xc8;}else{_0x3b367d=0xce;}_0x308b6e['status'](_0x3b367d);return _0x308b6e[_0x70e8('0x21')](_0x70e8('0x22'),_0x2c5654+'-'+_0x237c2d+'/'+_0x99a540)[_0x70e8('0x23')](_0x540fc0);}return null;};}function patchUpdates(_0x3ba52e){return function(_0x1701a6){try{jsonpatch[_0x70e8('0x24')](_0x1701a6,_0x3ba52e,!![]);}catch(_0x401e99){return BPromise[_0x70e8('0x25')](_0x401e99);}return _0x1701a6[_0x70e8('0x26')]();};}function saveUpdates(_0x4716e,_0x1edb7f){return function(_0x42707a){if(_0x42707a){return _0x42707a[_0x70e8('0x27')](_0x4716e)[_0x70e8('0x28')](function(_0x1fd48d){return _0x1fd48d;});}return null;};}function removeEntity(_0x2432cb,_0x59c556){return function(_0x35f90e){if(_0x35f90e){return _0x35f90e[_0x70e8('0x29')]()['then'](function(){var _0x58821b=_0x35f90e['get']({'plain':!![]});var _0x18c1e4='Lists';return db[_0x70e8('0x2a')][_0x70e8('0x29')]({'where':{'type':_0x18c1e4,'resourceId':_0x58821b['id']}})[_0x70e8('0x28')](function(){return _0x35f90e;});})[_0x70e8('0x28')](function(){_0x2432cb[_0x70e8('0x2b')](0xcc)[_0x70e8('0x2c')]();});}};}function handleEntityNotFound(_0x43e6d3,_0x15bb30){return function(_0x11bc09){if(!_0x11bc09){_0x43e6d3['sendStatus'](0x194);}return _0x11bc09;};}function handleError(_0x23297f,_0x23e84b){_0x23e84b=_0x23e84b||0x1f4;return function(_0x547fe2){logger[_0x70e8('0x2d')](_0x547fe2[_0x70e8('0x2e')]);if(_0x547fe2[_0x70e8('0x2f')]){delete _0x547fe2['name'];}_0x23297f['status'](_0x23e84b)[_0x70e8('0x30')](_0x547fe2);};}exports['index']=function(_0x14acae,_0x4edb83){var _0x313c94={},_0x1a4d1={},_0x206b3e={'count':0x0,'rows':[]};var _0x38c14a=_[_0x70e8('0x31')](db[_0x70e8('0x32')][_0x70e8('0x33')],function(_0x513663){return{'name':_0x513663[_0x70e8('0x34')],'type':_0x513663[_0x70e8('0x35')]['key']};});_0x1a4d1[_0x70e8('0x36')]=_['map'](_0x38c14a,_0x70e8('0x2f'));_0x1a4d1[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x14acae['query']);_0x1a4d1['filters']=_['intersection'](_0x1a4d1['model'],_0x1a4d1['query']);_0x313c94[_0x70e8('0x39')]=_['intersection'](_0x1a4d1[_0x70e8('0x36')],qs['fields'](_0x14acae[_0x70e8('0x37')][_0x70e8('0x3a')]));_0x313c94[_0x70e8('0x39')]=_0x313c94[_0x70e8('0x39')][_0x70e8('0x3b')]?_0x313c94['attributes']:_0x1a4d1[_0x70e8('0x36')];if(!_0x14acae[_0x70e8('0x37')][_0x70e8('0x3c')](_0x70e8('0x3d'))){_0x313c94[_0x70e8('0x1f')]=qs[_0x70e8('0x1f')](_0x14acae[_0x70e8('0x37')][_0x70e8('0x1f')]);_0x313c94['offset']=qs['offset'](_0x14acae[_0x70e8('0x37')][_0x70e8('0x1d')]);}_0x313c94[_0x70e8('0x3e')]=qs['sort'](_0x14acae[_0x70e8('0x37')][_0x70e8('0x3f')]);_0x313c94[_0x70e8('0x40')]=qs['filters'](_[_0x70e8('0x41')](_0x14acae[_0x70e8('0x37')],_0x1a4d1['filters']),_0x38c14a);if(_0x14acae[_0x70e8('0x37')][_0x70e8('0x42')]){_0x313c94[_0x70e8('0x40')]=_[_0x70e8('0x43')](_0x313c94[_0x70e8('0x40')],{'$or':_['map'](_0x38c14a,function(_0x250940){if(_0x250940[_0x70e8('0x35')]!==_0x70e8('0x44')){var _0x536923={};_0x536923[_0x250940['name']]={'$like':'%'+_0x14acae[_0x70e8('0x37')][_0x70e8('0x42')]+'%'};return _0x536923;}})});}_0x313c94=_[_0x70e8('0x43')]({},_0x313c94,_0x14acae[_0x70e8('0x45')]);var _0x2165af={'where':_0x313c94[_0x70e8('0x40')]};return db['CmList']['count'](_0x2165af)['then'](function(_0xc3bce6){_0x206b3e[_0x70e8('0x20')]=_0xc3bce6;if(_0x14acae[_0x70e8('0x37')]['includeAll']){_0x313c94['include']=[{'all':!![]}];}return db[_0x70e8('0x32')][_0x70e8('0x46')](_0x313c94);})[_0x70e8('0x28')](function(_0x52519f){_0x206b3e['rows']=_0x52519f;return _0x206b3e;})[_0x70e8('0x28')](respondWithFilteredResult(_0x4edb83,_0x313c94))['catch'](handleError(_0x4edb83,null));};exports[_0x70e8('0x47')]=function(_0x549471,_0x70e188){var _0x264e19={'raw':![],'where':{'id':_0x549471[_0x70e8('0x48')]['id']}},_0x3010d1={};_0x3010d1[_0x70e8('0x36')]=_[_0x70e8('0x38')](db[_0x70e8('0x32')]['rawAttributes']);_0x3010d1[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x549471[_0x70e8('0x37')]);_0x3010d1[_0x70e8('0x49')]=_[_0x70e8('0x4a')](_0x3010d1['model'],_0x3010d1['query']);_0x264e19[_0x70e8('0x39')]=_['intersection'](_0x3010d1[_0x70e8('0x36')],qs[_0x70e8('0x3a')](_0x549471[_0x70e8('0x37')][_0x70e8('0x3a')]));_0x264e19[_0x70e8('0x39')]=_0x264e19[_0x70e8('0x39')][_0x70e8('0x3b')]?_0x264e19['attributes']:_0x3010d1['model'];if(_0x549471[_0x70e8('0x37')][_0x70e8('0x4b')]){_0x264e19[_0x70e8('0x4c')]=[{'all':!![]}];}_0x264e19=_['merge']({},_0x264e19,_0x549471[_0x70e8('0x45')]);return db[_0x70e8('0x32')][_0x70e8('0x4d')](_0x264e19)[_0x70e8('0x28')](handleEntityNotFound(_0x70e188,null))[_0x70e8('0x28')](respondWithResult(_0x70e188,null))['catch'](handleError(_0x70e188,null));};exports[_0x70e8('0x4e')]=function(_0x149750,_0xde170f){return db[_0x70e8('0x32')][_0x70e8('0x4e')](_0x149750[_0x70e8('0x4f')],{})[_0x70e8('0x28')](function(_0x565dbd){var _0x2a5817=_0x149750[_0x70e8('0x50')][_0x70e8('0x51')]({'plain':!![]});if(!_0x2a5817)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a5817['role']===_0x70e8('0x50')){var _0x2e1e08=_0x565dbd['get']({'plain':!![]});var _0x2e55d2='Lists';return db[_0x70e8('0x52')][_0x70e8('0x4d')]({'where':{'name':_0x2e55d2,'userProfileId':_0x2a5817['userProfileId']},'raw':!![]})[_0x70e8('0x28')](function(_0x2a48ce){if(_0x2a48ce&&_0x2a48ce[_0x70e8('0x53')]===0x0){return db[_0x70e8('0x2a')]['create']({'name':_0x2e1e08[_0x70e8('0x2f')],'resourceId':_0x2e1e08['id'],'type':_0x2a48ce[_0x70e8('0x2f')],'sectionId':_0x2a48ce['id']},{})[_0x70e8('0x28')](function(){return _0x565dbd;});}else{return _0x565dbd;}})['catch'](function(_0x122628){logger[_0x70e8('0x2d')](_0x70e8('0x54'),_0x122628);throw _0x122628;});}return _0x565dbd;})[_0x70e8('0x28')](respondWithResult(_0xde170f,0xc9))[_0x70e8('0x55')](handleError(_0xde170f,null));};exports[_0x70e8('0x27')]=function(_0x48a26d,_0x2b36b8){if(_0x48a26d['body']['id']){delete _0x48a26d[_0x70e8('0x4f')]['id'];}return db['CmList'][_0x70e8('0x4d')]({'where':{'id':_0x48a26d[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x2b36b8,null))[_0x70e8('0x28')](saveUpdates(_0x48a26d['body'],null))[_0x70e8('0x28')](respondWithResult(_0x2b36b8,null))['catch'](handleError(_0x2b36b8,null));};exports['destroy']=function(_0x598eb0,_0x45dc19){return db[_0x70e8('0x32')]['find']({'where':{'id':_0x598eb0['params']['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x45dc19,null))[_0x70e8('0x28')](removeEntity(_0x45dc19,null))[_0x70e8('0x55')](handleError(_0x45dc19,null));};exports[_0x70e8('0x56')]=function(_0x6ce819,_0x85d8ea){return db[_0x70e8('0x32')][_0x70e8('0x56')]()[_0x70e8('0x28')](respondWithResult(_0x85d8ea,null))['catch'](handleError(_0x85d8ea,null));};exports[_0x70e8('0x57')]=function(_0x2c9832,_0x2a07be,_0x3c2938){if(_0x2c9832[_0x70e8('0x4f')]['id']){delete _0x2c9832[_0x70e8('0x4f')]['id'];}return db['CmList'][_0x70e8('0x4d')]({'where':{'id':_0x2c9832[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x2a07be,null))[_0x70e8('0x28')](function(_0x5699fc){if(_0x5699fc){_0x2c9832[_0x70e8('0x4f')][_0x70e8('0x58')]=_0x5699fc['id'];return db[_0x70e8('0x59')][_0x70e8('0x4e')](_0x2c9832[_0x70e8('0x4f')]);}})[_0x70e8('0x28')](respondWithResult(_0x2a07be,null))['catch'](handleError(_0x2a07be,null));};exports[_0x70e8('0x5a')]=function(_0x2f0d8e,_0x46893c,_0x2dea1c){var _0x4296bf={'raw':![],'where':{}};var _0xc40e8c={};var _0x51b36a={'count':0x0,'rows':[]};return db[_0x70e8('0x32')][_0x70e8('0x5b')]({'where':{'id':_0x2f0d8e[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x46893c,null))[_0x70e8('0x28')](function(_0x18698c){if(_0x18698c){_0xc40e8c['model']=_['keys'](db[_0x70e8('0x59')][_0x70e8('0x33')]);_0xc40e8c[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x2f0d8e[_0x70e8('0x37')]);_0xc40e8c[_0x70e8('0x49')]=_[_0x70e8('0x4a')](_0xc40e8c[_0x70e8('0x36')],_0xc40e8c[_0x70e8('0x37')]);_0x4296bf[_0x70e8('0x39')]=_[_0x70e8('0x4a')](_0xc40e8c['model'],qs['fields'](_0x2f0d8e[_0x70e8('0x37')][_0x70e8('0x3a')]));_0x4296bf['attributes']=_0x4296bf[_0x70e8('0x39')][_0x70e8('0x3b')]?_0x4296bf[_0x70e8('0x39')]:_0xc40e8c['model'];if(!_0x2f0d8e[_0x70e8('0x37')][_0x70e8('0x3c')](_0x70e8('0x3d'))){_0x4296bf[_0x70e8('0x1f')]=qs[_0x70e8('0x1f')](_0x2f0d8e[_0x70e8('0x37')][_0x70e8('0x1f')]);_0x4296bf[_0x70e8('0x1d')]=qs[_0x70e8('0x1d')](_0x2f0d8e[_0x70e8('0x37')][_0x70e8('0x1d')]);}_0x4296bf[_0x70e8('0x3e')]=qs[_0x70e8('0x3f')](_0x2f0d8e[_0x70e8('0x37')][_0x70e8('0x3f')]);_0x4296bf['where']=qs['filters'](_[_0x70e8('0x41')](_0x2f0d8e[_0x70e8('0x37')],_0xc40e8c['filters']));_0x4296bf[_0x70e8('0x40')][_0x70e8('0x58')]=_0x18698c['id'];if(_0x2f0d8e[_0x70e8('0x37')]['filter']){_0x4296bf[_0x70e8('0x40')]=_[_0x70e8('0x43')](_0x4296bf[_0x70e8('0x40')],{'$or':_[_0x70e8('0x31')](_0x4296bf[_0x70e8('0x39')],function(_0x408bc6){var _0x42324d={};_0x42324d[_0x408bc6]={'$like':'%'+_0x2f0d8e['query'][_0x70e8('0x42')]+'%'};return _0x42324d;})});}_0x4296bf=_['merge']({},_0x4296bf,_0x2f0d8e['options']);return db['Disposition'][_0x70e8('0x20')]({'where':_0x4296bf[_0x70e8('0x40')]})[_0x70e8('0x28')](function(_0x23e09e){_0x51b36a['count']=_0x23e09e;if(_0x2f0d8e[_0x70e8('0x37')]['includeAll']){_0x4296bf[_0x70e8('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x70e8('0x46')](_0x4296bf);})['then'](function(_0x47e810){_0x51b36a[_0x70e8('0x5c')]=_0x47e810;return _0x51b36a;});}})[_0x70e8('0x28')](respondWithFilteredResult(_0x46893c,_0x4296bf))[_0x70e8('0x55')](handleError(_0x46893c,null));};exports[_0x70e8('0x5d')]=function(_0x412ca4,_0x44d668,_0x90a4f1){return db['CmList']['find']({'where':{'id':_0x412ca4['params']['id']}})['then'](handleEntityNotFound(_0x44d668,null))[_0x70e8('0x28')](function(_0x517b65){if(_0x517b65){return _0x517b65[_0x70e8('0x5d')](_0x412ca4[_0x70e8('0x37')][_0x70e8('0x5e')]);}})[_0x70e8('0x28')](respondWithStatusCode(_0x44d668,null))[_0x70e8('0x55')](handleError(_0x44d668,null));};exports[_0x70e8('0x5f')]=function(_0x2c4222,_0x4a932b,_0x2be598){return db[_0x70e8('0x32')][_0x70e8('0x4d')]({'where':{'id':_0x2c4222[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x4a932b,null))[_0x70e8('0x28')](function(_0x37ea25){if(_0x37ea25){var _0x4d8c83=[];var _0x116694={'success':[],'errors':[]};return db[_0x70e8('0x60')][_0x70e8('0x56')]()[_0x70e8('0x28')](function(_0x338bd0){if(_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x61')]&&_[_0x70e8('0x62')](_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x61')])){if(_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x61')][_0x70e8('0x3b')]){_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x61')]=_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x61')][_0x70e8('0x63')](';')+';';}else{_0x2c4222[_0x70e8('0x4f')]['tags']=null;}}else{_0x2c4222['body'][_0x70e8('0x61')]=null;}if(_0x2c4222[_0x70e8('0x4f')]&&_[_0x70e8('0x62')](_0x2c4222[_0x70e8('0x4f')])){for(var _0x44f48a=0x0;_0x44f48a<_0x2c4222[_0x70e8('0x4f')][_0x70e8('0x3b')];_0x44f48a+=0x1){_0x2c4222['body'][_0x44f48a][_0x70e8('0x58')]=_0x2c4222[_0x70e8('0x48')]['id'];_0x4d8c83[_0x70e8('0x64')](_0x2c4222[_0x70e8('0x4f')][_0x44f48a]);}return BPromise[_0x70e8('0x65')](_0x4d8c83,function(_0x4ba5f9){return db[_0x70e8('0x60')]['create'](_[_0x70e8('0x66')](_0x4ba5f9,[_0x70e8('0x5e'),'id'])||{},{'fields':_[_0x70e8('0x38')](_0x338bd0),'raw':!![]})[_0x70e8('0x28')](function(_0x5cf76c){_0x116694[_0x70e8('0x67')][_0x70e8('0x64')](_0x5cf76c['dataValues']);})['catch'](function(_0x36b833){_0x116694['errors'][_0x70e8('0x64')]({'data':_0x4ba5f9,'error':_0x36b833[_0x70e8('0x68')]});});})[_0x70e8('0x28')](function(_0x581b08){return _0x116694;})[_0x70e8('0x55')](function(_0x292d43){return _0x292d43;});}else{_0x4a932b[_0x70e8('0x2b')](0x190)[_0x70e8('0x23')]({'message':_0x70e8('0x69')});}});}})[_0x70e8('0x28')](respondWithResult(_0x4a932b,null))[_0x70e8('0x55')](handleError(_0x4a932b,null));};exports[_0x70e8('0x6a')]=function(_0x1d85b2,_0x2f9754,_0x244bc9){var _0x623387;return db['CmList'][_0x70e8('0x4d')]({'where':{'id':_0x1d85b2[_0x70e8('0x48')]['id']},'include':[{'model':db[_0x70e8('0x6b')],'as':_0x70e8('0x6c')}]})[_0x70e8('0x28')](handleEntityNotFound(_0x2f9754,null))[_0x70e8('0x28')](function(_0x4e880a){if(_0x4e880a){_0x623387=_0x4e880a;return db['CmContact'][_0x70e8('0x33')];}})[_0x70e8('0x28')](function(_0x132a13){if(_0x132a13){var _0x1c41c2={};var _0x1f4623={};_0x1f4623[_0x70e8('0x36')]=_[_0x70e8('0x6d')](_[_0x70e8('0x38')](_0x132a13),_['map'](_0x623387[_0x70e8('0x6c')],function(_0x205309){return util[_0x70e8('0x6e')](_0x70e8('0x6f'),_0x205309['id']);}));_0x1f4623[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x1d85b2['query']);_0x1f4623[_0x70e8('0x49')]=_[_0x70e8('0x4a')](_0x1f4623[_0x70e8('0x36')],_0x1f4623[_0x70e8('0x37')]);_0x1c41c2[_0x70e8('0x39')]=_['intersection'](_0x1f4623['model'],qs[_0x70e8('0x3a')](_0x1d85b2[_0x70e8('0x37')][_0x70e8('0x3a')]));_0x1c41c2[_0x70e8('0x39')]=_0x1c41c2['attributes'][_0x70e8('0x3b')]?_0x1c41c2[_0x70e8('0x39')]:_0x1f4623[_0x70e8('0x36')];if(!_0x1d85b2['query'][_0x70e8('0x3c')](_0x70e8('0x3d'))){_0x1c41c2['limit']=qs[_0x70e8('0x1f')](_0x1d85b2['query'][_0x70e8('0x1f')]);_0x1c41c2[_0x70e8('0x1d')]=qs[_0x70e8('0x1d')](_0x1d85b2[_0x70e8('0x37')][_0x70e8('0x1d')]);}_0x1c41c2[_0x70e8('0x3e')]=qs[_0x70e8('0x3f')](_0x1d85b2['query'][_0x70e8('0x3f')]);_0x1c41c2[_0x70e8('0x40')]=qs[_0x70e8('0x49')](_[_0x70e8('0x41')](_0x1d85b2[_0x70e8('0x37')],_0x1f4623[_0x70e8('0x49')]));_0x1c41c2['raw']=!![];if(_0x1d85b2['query'][_0x70e8('0x42')]){_0x1c41c2[_0x70e8('0x40')]=_[_0x70e8('0x43')](_0x1c41c2['where'],{'$or':_[_0x70e8('0x31')](_0x1c41c2['attributes'],function(_0x5cba28){var _0x1fdf33={};_0x1fdf33[_0x5cba28]={'$like':'%'+_0x1d85b2[_0x70e8('0x37')][_0x70e8('0x42')]+'%'};return _0x1fdf33;})});}_0x1c41c2=_['merge']({},_0x1c41c2,_0x1d85b2[_0x70e8('0x45')]);return _0x623387[_0x70e8('0x6a')](_0x1c41c2);}})[_0x70e8('0x28')](respondWithResult(_0x2f9754,null))['catch'](handleError(_0x2f9754,null));};exports['getContactsCsv']=function(_0x2ba344,_0x57f166,_0x57afd0){var _0x292fb3;return db[_0x70e8('0x32')][_0x70e8('0x4d')]({'where':{'id':_0x2ba344[_0x70e8('0x48')]['id']},'include':[{'model':db[_0x70e8('0x6b')],'as':'CustomFields'}]})[_0x70e8('0x28')](handleEntityNotFound(_0x57f166,null))['then'](function(_0x55853e){if(_0x55853e){_0x292fb3=_0x55853e;return db[_0x70e8('0x60')][_0x70e8('0x33')];}})['then'](function(_0x1ec8fd){if(_0x1ec8fd){var _0x58d0c0={};var _0x1375db={};_0x1375db[_0x70e8('0x36')]=_[_0x70e8('0x6d')](_[_0x70e8('0x38')](_0x1ec8fd),_['map'](_0x292fb3[_0x70e8('0x6c')],function(_0x4936c1){return util[_0x70e8('0x6e')]('cf_%d',_0x4936c1['id']);}));_0x1375db[_0x70e8('0x37')]=_['keys'](_0x2ba344[_0x70e8('0x37')]);_0x1375db[_0x70e8('0x49')]=_[_0x70e8('0x4a')](_0x1375db[_0x70e8('0x36')],_0x1375db['query']);_0x58d0c0[_0x70e8('0x39')]=_['intersection'](_0x1375db[_0x70e8('0x36')],qs[_0x70e8('0x3a')](_0x2ba344['query'][_0x70e8('0x3a')]));_0x58d0c0[_0x70e8('0x39')]=_0x58d0c0[_0x70e8('0x39')][_0x70e8('0x3b')]?_0x58d0c0['attributes']:_0x1375db[_0x70e8('0x36')];if(!_0x2ba344[_0x70e8('0x37')]['hasOwnProperty'](_0x70e8('0x3d'))){_0x58d0c0[_0x70e8('0x1f')]=qs['limit'](_0x2ba344[_0x70e8('0x37')][_0x70e8('0x1f')]);_0x58d0c0[_0x70e8('0x1d')]=qs[_0x70e8('0x1d')](_0x2ba344[_0x70e8('0x37')][_0x70e8('0x1d')]);}_0x58d0c0['order']=qs[_0x70e8('0x3f')](_0x2ba344['query']['sort']);_0x58d0c0[_0x70e8('0x40')]=qs['filters'](_[_0x70e8('0x41')](_0x2ba344[_0x70e8('0x37')],_0x1375db[_0x70e8('0x49')]));_0x58d0c0[_0x70e8('0x70')]=!![];if(_0x2ba344['query'][_0x70e8('0x42')]){_0x58d0c0['where']=_[_0x70e8('0x43')](_0x58d0c0[_0x70e8('0x40')],{'$or':_[_0x70e8('0x31')](_0x58d0c0[_0x70e8('0x39')],function(_0x348985){var _0x450ba8={};_0x450ba8[_0x348985]={'$like':'%'+_0x2ba344[_0x70e8('0x37')][_0x70e8('0x42')]+'%'};return _0x450ba8;})});}_0x58d0c0=_[_0x70e8('0x43')]({},_0x58d0c0,_0x2ba344[_0x70e8('0x45')]);return _0x292fb3['getContacts'](_0x58d0c0);}})[_0x70e8('0x28')](function(_0x33e28e){if(!_['isEmpty'](_0x33e28e)){var _0x1e1b64=toCsv(_0x33e28e);var _0x310eb3=Date['now']();fs['writeFileSync'](util[_0x70e8('0x6e')](_0x70e8('0x71'),_0x292fb3['id'],_0x310eb3),_0x1e1b64);_0x57f166['setHeader'](_0x70e8('0x72'),_0x70e8('0x73')+util[_0x70e8('0x6e')]('list_%d_%s.csv',_0x292fb3['id'],_0x310eb3));_0x57f166['setHeader'](_0x70e8('0x74'),_0x70e8('0x75'));return _0x57f166['download'](util[_0x70e8('0x6e')](_0x70e8('0x71'),_0x292fb3['id'],_0x310eb3));}else{return _0x57f166['sendStatus'](0xcc);}})[_0x70e8('0x55')](handleError(_0x57f166,null));};exports[_0x70e8('0x76')]=function(_0x18a9c2,_0x361677,_0x568e45){var _0x2f3e4c;delete _0x18a9c2[_0x70e8('0x4f')]['id'];return db[_0x70e8('0x32')]['findOne']({'where':{'id':_0x18a9c2['params']['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x361677,null))[_0x70e8('0x28')](function(_0x6a99c4){if(_0x6a99c4){return db[_0x70e8('0x77')][_0x70e8('0x78')](function(_0x53eb15){return db[_0x70e8('0x6b')][_0x70e8('0x4e')](_0x18a9c2[_0x70e8('0x4f')],{'transaction':_0x53eb15})['then'](function(_0x3048af){_0x2f3e4c=_0x3048af;return _0x6a99c4[_0x70e8('0x79')](_0x3048af,{'transaction':_0x53eb15});})[_0x70e8('0x28')](function(){var _0x4e9070={'type':db['Sequelize'][_0x70e8('0x7a')],'transaction':_0x53eb15};switch(_0x18a9c2[_0x70e8('0x4f')]['type']){case'text':_0x4e9070[_0x70e8('0x35')]=db[_0x70e8('0x7b')][_0x70e8('0x7a')];break;case _0x70e8('0x7c'):_0x4e9070[_0x70e8('0x35')]=db['Sequelize'][_0x70e8('0x7d')];break;case'switch':_0x4e9070[_0x70e8('0x35')]=db[_0x70e8('0x7b')][_0x70e8('0x7e')];_0x4e9070[_0x70e8('0x7f')]=![];break;default:}return db[_0x70e8('0x77')][_0x70e8('0x80')][_0x70e8('0x81')]('cm_contacts',util[_0x70e8('0x6e')](_0x70e8('0x82'),_0x2f3e4c['id']),_0x4e9070);})[_0x70e8('0x28')](function(){return _0x2f3e4c;});});}})[_0x70e8('0x28')](respondWithResult(_0x361677,null))[_0x70e8('0x55')](handleError(_0x361677,null));};exports['getCustomFields']=function(_0x1e0900,_0x5b1854,_0x2314fe){var _0xd7351c={};var _0x1ab0f5={};var _0x304eea;var _0x832bf7;return db['CmList'][_0x70e8('0x5b')]({'where':{'id':_0x1e0900[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x5b1854,null))[_0x70e8('0x28')](function(_0x280903){if(_0x280903){_0x304eea=_0x280903;_0x1ab0f5[_0x70e8('0x36')]=_[_0x70e8('0x38')](db[_0x70e8('0x6b')][_0x70e8('0x33')]);_0x1ab0f5[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x1e0900['query']);_0x1ab0f5[_0x70e8('0x49')]=_['intersection'](_0x1ab0f5[_0x70e8('0x36')],_0x1ab0f5['query']);_0xd7351c[_0x70e8('0x39')]=_[_0x70e8('0x4a')](_0x1ab0f5[_0x70e8('0x36')],qs['fields'](_0x1e0900[_0x70e8('0x37')]['fields']));_0xd7351c[_0x70e8('0x39')]=_0xd7351c[_0x70e8('0x39')][_0x70e8('0x3b')]?_0xd7351c[_0x70e8('0x39')]:_0x1ab0f5[_0x70e8('0x36')];_0xd7351c['order']=qs['sort'](_0x1e0900[_0x70e8('0x37')][_0x70e8('0x3f')]);_0xd7351c[_0x70e8('0x40')]=qs[_0x70e8('0x49')](_['pick'](_0x1e0900['query'],_0x1ab0f5[_0x70e8('0x49')]));_0xd7351c[_0x70e8('0x40')]=_['merge'](_0xd7351c[_0x70e8('0x40')],{'$or':[{'ListId':_0x280903['id']},{'ListId':null}]});if(_0x1e0900[_0x70e8('0x37')]['filter']){_0xd7351c[_0x70e8('0x40')]=_['merge'](_0xd7351c['where'],{'$or':_['map'](_0xd7351c[_0x70e8('0x39')],function(_0x5b66f2){var _0x18599a={};_0x18599a[_0x5b66f2]={'$like':'%'+_0x1e0900[_0x70e8('0x37')][_0x70e8('0x42')]+'%'};return _0x18599a;})});}_0xd7351c=_['merge']({},_0xd7351c,_0x1e0900[_0x70e8('0x45')]);return db[_0x70e8('0x6b')]['findAndCountAll'](_0xd7351c);}})[_0x70e8('0x28')](respondWithResult(_0x5b1854,null))[_0x70e8('0x55')](handleError(_0x5b1854,null));};exports[_0x70e8('0x83')]=function(_0x19ab5,_0x5b8d45,_0x39efc7){return db[_0x70e8('0x32')][_0x70e8('0x4d')]({'where':{'id':_0x19ab5[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x5b8d45,null))['then'](function(_0x45eb81){if(_0x45eb81){return _0x45eb81[_0x70e8('0x83')](_0x19ab5[_0x70e8('0x4f')][_0x70e8('0x5e')],_['omit'](_0x19ab5['body'],[_0x70e8('0x5e'),'id'])||{})[_0x70e8('0x84')](function(_0x1c5392){for(var _0xe662fd=0x0;_0xe662fd<_0x19ab5[_0x70e8('0x4f')][_0x70e8('0x5e')][_0x70e8('0x3b')];_0xe662fd+=0x1){socket['emit'](_0x70e8('0x85'),{'UserId':Number(_0x19ab5[_0x70e8('0x4f')][_0x70e8('0x5e')][_0xe662fd]),'CmListId':Number(_0x19ab5['params']['id'])});}return _0x1c5392;});}})[_0x70e8('0x28')](respondWithResult(_0x5b8d45,null))[_0x70e8('0x55')](handleError(_0x5b8d45,null));};exports[_0x70e8('0x86')]=function(_0xcc3ff6,_0x304e54,_0x109954){return db['CmList'][_0x70e8('0x4d')]({'where':{'id':_0xcc3ff6[_0x70e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x304e54,null))[_0x70e8('0x28')](function(_0x137993){if(_0x137993){return _0x137993[_0x70e8('0x86')](_0xcc3ff6[_0x70e8('0x37')][_0x70e8('0x5e')])[_0x70e8('0x28')](function(){if(_[_0x70e8('0x62')](_0xcc3ff6['query'][_0x70e8('0x5e')])){for(var _0x4d06d9=0x0;_0x4d06d9<_0xcc3ff6['query'][_0x70e8('0x5e')][_0x70e8('0x3b')];_0x4d06d9+=0x1){socket['emit'](_0x70e8('0x87'),{'UserId':Number(_0xcc3ff6[_0x70e8('0x37')][_0x70e8('0x5e')][_0x4d06d9]),'CmListId':Number(_0xcc3ff6[_0x70e8('0x48')]['id'])});}}else{socket[_0x70e8('0x88')](_0x70e8('0x87'),{'UserId':Number(_0xcc3ff6[_0x70e8('0x37')]['ids']),'CmListId':Number(_0xcc3ff6[_0x70e8('0x48')]['id'])});}});}})[_0x70e8('0x28')](respondWithStatusCode(_0x304e54,null))[_0x70e8('0x55')](handleError(_0x304e54,null));};exports[_0x70e8('0x89')]=function(_0x6b209e,_0x5cc871,_0x38ed1a){var _0x73ebe8={};var _0x105dcc={};var _0x425dc0;var _0xebe4c5;return db[_0x70e8('0x32')][_0x70e8('0x5b')]({'where':{'id':_0x6b209e[_0x70e8('0x48')]['id']}})[_0x70e8('0x28')](handleEntityNotFound(_0x5cc871,null))[_0x70e8('0x28')](function(_0x1ed610){if(_0x1ed610){_0x425dc0=_0x1ed610;_0x105dcc[_0x70e8('0x36')]=_['keys'](db[_0x70e8('0x8a')][_0x70e8('0x33')]);_0x105dcc[_0x70e8('0x37')]=_[_0x70e8('0x38')](_0x6b209e[_0x70e8('0x37')]);_0x105dcc['filters']=_[_0x70e8('0x4a')](_0x105dcc[_0x70e8('0x36')],_0x105dcc[_0x70e8('0x37')]);_0x73ebe8[_0x70e8('0x39')]=_[_0x70e8('0x4a')](_0x105dcc[_0x70e8('0x36')],qs['fields'](_0x6b209e[_0x70e8('0x37')][_0x70e8('0x3a')]));_0x73ebe8[_0x70e8('0x39')]=_0x73ebe8['attributes'][_0x70e8('0x3b')]?_0x73ebe8[_0x70e8('0x39')]:_0x105dcc[_0x70e8('0x36')];_0x73ebe8[_0x70e8('0x3e')]=qs['sort'](_0x6b209e['query'][_0x70e8('0x3f')]);_0x73ebe8['where']=qs[_0x70e8('0x49')](_['pick'](_0x6b209e[_0x70e8('0x37')],_0x105dcc[_0x70e8('0x49')]));if(_0x6b209e['query'][_0x70e8('0x42')]){_0x73ebe8[_0x70e8('0x40')]=_[_0x70e8('0x43')](_0x73ebe8[_0x70e8('0x40')],{'$or':_[_0x70e8('0x31')](_0x73ebe8[_0x70e8('0x39')],function(_0x236cdc){var _0x5768bf={};_0x5768bf[_0x236cdc]={'$like':'%'+_0x6b209e[_0x70e8('0x37')][_0x70e8('0x42')]+'%'};return _0x5768bf;})});}_0x73ebe8=_[_0x70e8('0x43')]({},_0x73ebe8,_0x6b209e['options']);return _0x425dc0[_0x70e8('0x89')](_0x73ebe8);}})[_0x70e8('0x28')](function(_0x4e5bf8){if(_0x4e5bf8){_0xebe4c5=_0x4e5bf8[_0x70e8('0x3b')];if(!_0x6b209e[_0x70e8('0x37')][_0x70e8('0x3c')](_0x70e8('0x3d'))){_0x73ebe8[_0x70e8('0x1f')]=qs[_0x70e8('0x1f')](_0x6b209e['query'][_0x70e8('0x1f')]);_0x73ebe8[_0x70e8('0x1d')]=qs['offset'](_0x6b209e[_0x70e8('0x37')][_0x70e8('0x1d')]);}return _0x425dc0[_0x70e8('0x89')](_0x73ebe8);}})[_0x70e8('0x28')](function(_0x565e31){if(_0x565e31){return _0x565e31?{'count':_0xebe4c5,'rows':_0x565e31}:null;}})[_0x70e8('0x28')](respondWithResult(_0x5cc871,null))[_0x70e8('0x55')](handleError(_0x5cc871,null));};
\ No newline at end of file
index 53fe8f8..cc09bc3 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(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x5fc3,0xa8));var _0x35fc=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x5fc3[_0x496738];return _0xee1381;};'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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x2ad177,_0x5ac628){_0x2ad177=_0x2ad177-0x0;var _0x29435e=_0x3e74[_0x2ad177];return _0x29435e;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents;
\ No newline at end of file
index 2d81ffc..3169aa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2547=['rimraf','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc25778,_0xf5d1f6){var _0x314223=function(_0x5e15bc){while(--_0x5e15bc){_0xc25778['push'](_0xc25778['shift']());}};_0x314223(++_0xf5d1f6);}(_0x2547,0x1cd));var _0x7254=function(_0x1519b5,_0x2b43b0){_0x1519b5=_0x1519b5-0x0;var _0x17da29=_0x2547[_0x1519b5];return _0x17da29;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4522=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api','moment','request-promise'];(function(_0x45cf81,_0x2a2595){var _0x4cb75b=function(_0x3e2d62){while(--_0x3e2d62){_0x45cf81['push'](_0x45cf81['shift']());}};_0x4cb75b(++_0x2a2595);}(_0x4522,0x1a0));var _0x2452=function(_0x547bd5,_0x5de1f2){_0x547bd5=_0x547bd5-0x0;var _0x59d24a=_0x4522[_0x547bd5];return _0x59d24a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e59923..d5eb979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bb3=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./cmList.socket','request','then','info','request\x20sent','debug'];(function(_0x36b1ce,_0x179492){var _0x32034f=function(_0x45a018){while(--_0x45a018){_0x36b1ce['push'](_0x36b1ce['shift']());}};_0x32034f(++_0x179492);}(_0x4bb3,0x67));var _0x34bb=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0x4bb3[_0x2353fe];return _0x4d43f6;};'use strict';var _=require(_0x34bb('0x0'));var util=require(_0x34bb('0x1'));var moment=require(_0x34bb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bb('0x3'))['db'];var utils=require(_0x34bb('0x4'));var logger=require('../../config/logger')(_0x34bb('0x5'));var config=require(_0x34bb('0x6'));var jayson=require(_0x34bb('0x7'));var client=jayson[_0x34bb('0x8')]['http']({'port':0x232a});config[_0x34bb('0x9')]=_[_0x34bb('0xa')](config[_0x34bb('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34bb('0x9')]));require(_0x34bb('0xb'))['register'](socket);function respondWithRpcPromise(_0x47d8c3,_0x3e19bc,_0x26fc80){return new BPromise(function(_0x113bf5,_0x11c619){return client[_0x34bb('0xc')](_0x47d8c3,_0x26fc80)[_0x34bb('0xd')](function(_0x4f1673){logger[_0x34bb('0xe')]('CmList,\x20%s,\x20%s',_0x3e19bc,_0x34bb('0xf'));logger[_0x34bb('0x10')](_0x34bb('0x11'),_0x3e19bc,'request\x20sent',JSON[_0x34bb('0x12')](_0x4f1673));if(_0x4f1673[_0x34bb('0x13')]){if(_0x4f1673[_0x34bb('0x13')]['code']===0x1f4){logger['error'](_0x34bb('0x14'),_0x3e19bc,_0x4f1673[_0x34bb('0x13')][_0x34bb('0x15')]);return _0x11c619(_0x4f1673[_0x34bb('0x13')]['message']);}logger[_0x34bb('0x13')](_0x34bb('0x14'),_0x3e19bc,_0x4f1673[_0x34bb('0x13')][_0x34bb('0x15')]);return _0x113bf5(_0x4f1673['error'][_0x34bb('0x15')]);}else{logger[_0x34bb('0xe')](_0x34bb('0x14'),_0x3e19bc,_0x34bb('0xf'));_0x113bf5(_0x4f1673[_0x34bb('0x16')][_0x34bb('0x15')]);}})[_0x34bb('0x17')](function(_0x457517){logger[_0x34bb('0x13')]('CmList,\x20%s,\x20%s',_0x3e19bc,_0x457517);_0x11c619(_0x457517);});});}
\ No newline at end of file
+var _0x4672=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./cmList.socket','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x53a073,_0x3448be){var _0x3b6aab=function(_0xbfcc76){while(--_0xbfcc76){_0x53a073['push'](_0x53a073['shift']());}};_0x3b6aab(++_0x3448be);}(_0x4672,0x145));var _0x2467=function(_0x280a97,_0x1c3a99){_0x280a97=_0x280a97-0x0;var _0x54e2a2=_0x4672[_0x280a97];return _0x54e2a2;};'use strict';var _=require(_0x2467('0x0'));var util=require(_0x2467('0x1'));var moment=require(_0x2467('0x2'));var BPromise=require(_0x2467('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2467('0x4'))['db'];var utils=require(_0x2467('0x5'));var logger=require(_0x2467('0x6'))(_0x2467('0x7'));var config=require(_0x2467('0x8'));var jayson=require(_0x2467('0x9'));var client=jayson[_0x2467('0xa')]['http']({'port':0x232a});config[_0x2467('0xb')]=_[_0x2467('0xc')](config[_0x2467('0xb')],{'host':_0x2467('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2467('0xb')]));require(_0x2467('0xe'))['register'](socket);function respondWithRpcPromise(_0x39f184,_0x32a3f5,_0x37e159){return new BPromise(function(_0x3b2ec0,_0x3dab98){return client[_0x2467('0xf')](_0x39f184,_0x37e159)[_0x2467('0x10')](function(_0x2eebe9){logger['info'](_0x2467('0x11'),_0x32a3f5,_0x2467('0x12'));logger[_0x2467('0x13')](_0x2467('0x14'),_0x32a3f5,_0x2467('0x12'),JSON[_0x2467('0x15')](_0x2eebe9));if(_0x2eebe9[_0x2467('0x16')]){if(_0x2eebe9[_0x2467('0x16')][_0x2467('0x17')]===0x1f4){logger[_0x2467('0x16')]('CmList,\x20%s,\x20%s',_0x32a3f5,_0x2eebe9[_0x2467('0x16')]['message']);return _0x3dab98(_0x2eebe9[_0x2467('0x16')]['message']);}logger['error'](_0x2467('0x11'),_0x32a3f5,_0x2eebe9[_0x2467('0x16')][_0x2467('0x18')]);return _0x3b2ec0(_0x2eebe9[_0x2467('0x16')]['message']);}else{logger[_0x2467('0x19')]('CmList,\x20%s,\x20%s',_0x32a3f5,_0x2467('0x12'));_0x3b2ec0(_0x2eebe9['result'][_0x2467('0x18')]);}})[_0x2467('0x1a')](function(_0xdc8e7d){logger['error'](_0x2467('0x11'),_0x32a3f5,_0xdc8e7d);_0x3dab98(_0xdc8e7d);});});}
\ No newline at end of file
index 607c442..0977f2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7eb=['removeListener','register','./cmList.events','save','remove','update','emit'];(function(_0x55daed,_0x892a6d){var _0x5d5451=function(_0x5e5e93){while(--_0x5e5e93){_0x55daed['push'](_0x55daed['shift']());}};_0x5d5451(++_0x892a6d);}(_0xe7eb,0x16e));var _0xbe7e=function(_0x2bdddb,_0x40181b){_0x2bdddb=_0x2bdddb-0x0;var _0x237a67=_0xe7eb[_0x2bdddb];return _0x237a67;};'use strict';var CmListEvents=require(_0xbe7e('0x0'));var events=[_0xbe7e('0x1'),_0xbe7e('0x2'),_0xbe7e('0x3')];function createListener(_0x3dba57,_0x383c58){return function(_0x594303){_0x383c58[_0xbe7e('0x4')](_0x3dba57,_0x594303);};}function removeListener(_0x18a6ac,_0x16b0a7){return function(){CmListEvents[_0xbe7e('0x5')](_0x18a6ac,_0x16b0a7);};}exports[_0xbe7e('0x6')]=function(_0x22ba4c){for(var _0x3db7b9=0x0,_0x3f3675=events['length'];_0x3db7b9<_0x3f3675;_0x3db7b9++){var _0x1c1b15=events[_0x3db7b9];var _0x2f3bb8=createListener('cmList:'+_0x1c1b15,_0x22ba4c);CmListEvents['on'](_0x1c1b15,_0x2f3bb8);}};
\ No newline at end of file
+var _0x2c39=['register','length','cmList:','./cmList.events','save','remove','emit'];(function(_0x3034c8,_0x4d59c0){var _0xce6e84=function(_0x199b7a){while(--_0x199b7a){_0x3034c8['push'](_0x3034c8['shift']());}};_0xce6e84(++_0x4d59c0);}(_0x2c39,0x176));var _0x92c3=function(_0x11238d,_0x499ac8){_0x11238d=_0x11238d-0x0;var _0x3686b0=_0x2c39[_0x11238d];return _0x3686b0;};'use strict';var CmListEvents=require(_0x92c3('0x0'));var events=[_0x92c3('0x1'),_0x92c3('0x2'),'update'];function createListener(_0x506016,_0x5dab01){return function(_0x11c608){_0x5dab01[_0x92c3('0x3')](_0x506016,_0x11c608);};}function removeListener(_0x569c2b,_0x3116b1){return function(){CmListEvents['removeListener'](_0x569c2b,_0x3116b1);};}exports[_0x92c3('0x4')]=function(_0x40b596){for(var _0x46acef=0x0,_0xdb09f9=events[_0x92c3('0x5')];_0x46acef<_0xdb09f9;_0x46acef++){var _0x44d4cc=events[_0x46acef];var _0xa22d99=createListener(_0x92c3('0x6')+_0x44d4cc,_0x40b596);CmListEvents['on'](_0x44d4cc,_0xa22d99);}};
\ No newline at end of file
index fa3e13e..a11424e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9663=['/:id/contacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','./cmList.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions'];(function(_0x2ae19a,_0x2e72a4){var _0x2b2b18=function(_0x891615){while(--_0x891615){_0x2ae19a['push'](_0x2ae19a['shift']());}};_0x2b2b18(++_0x2e72a4);}(_0x9663,0x6b));var _0x3966=function(_0x597978,_0x4f830b){_0x597978=_0x597978-0x0;var _0x8f9fe6=_0x9663[_0x597978];return _0x8f9fe6;};'use strict';var multer=require(_0x3966('0x0'));var util=require(_0x3966('0x1'));var path=require(_0x3966('0x2'));var timeout=require(_0x3966('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3966('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3966('0x5'));router[_0x3966('0x6')]('/',auth[_0x3966('0x7')](),controller[_0x3966('0x8')]);router[_0x3966('0x6')]('/describe',auth[_0x3966('0x7')](),controller['describe']);router[_0x3966('0x6')](_0x3966('0x9'),auth[_0x3966('0x7')](),controller[_0x3966('0xa')]);router[_0x3966('0x6')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller[_0x3966('0xc')]);router[_0x3966('0x6')](_0x3966('0xd'),auth[_0x3966('0x7')](),controller['getContacts']);router[_0x3966('0x6')](_0x3966('0xe'),auth[_0x3966('0x7')](),controller['getContactsCsv']);router[_0x3966('0x6')](_0x3966('0xf'),auth[_0x3966('0x7')](),controller[_0x3966('0x10')]);router[_0x3966('0x6')](_0x3966('0x11'),auth[_0x3966('0x7')](),controller[_0x3966('0x12')]);router['post']('/',auth[_0x3966('0x7')](),controller[_0x3966('0x13')]);router[_0x3966('0x14')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller['addDisposition']);router[_0x3966('0x14')]('/:id/contacts',auth[_0x3966('0x7')](),controller['addContacts']);router[_0x3966('0x14')](_0x3966('0xf'),auth[_0x3966('0x7')](),controller[_0x3966('0x15')]);router[_0x3966('0x14')](_0x3966('0x11'),auth[_0x3966('0x7')](),controller[_0x3966('0x16')]);router[_0x3966('0x17')](_0x3966('0x9'),auth['isAuthenticated'](),controller[_0x3966('0x18')]);router[_0x3966('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x3966('0x1a')]);router[_0x3966('0x19')](_0x3966('0xb'),auth[_0x3966('0x7')](),controller[_0x3966('0x1b')]);router[_0x3966('0x19')]('/:id/users',auth[_0x3966('0x7')](),controller[_0x3966('0x1c')]);module[_0x3966('0x1d')]=router;
\ No newline at end of file
+var _0x7692=['addCustomField','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./cmList.controller','isAuthenticated','index','/describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContactsCsv','/:id/users','getAgents','post','create','addDisposition','/:id/fields'];(function(_0x47970b,_0x129e78){var _0x40650e=function(_0x80d3cb){while(--_0x80d3cb){_0x47970b['push'](_0x47970b['shift']());}};_0x40650e(++_0x129e78);}(_0x7692,0x84));var _0x2769=function(_0x1a6e19,_0x3d67f0){_0x1a6e19=_0x1a6e19-0x0;var _0x122bc2=_0x7692[_0x1a6e19];return _0x122bc2;};'use strict';var multer=require(_0x2769('0x0'));var util=require(_0x2769('0x1'));var path=require(_0x2769('0x2'));var timeout=require(_0x2769('0x3'));var express=require(_0x2769('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2769('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2769('0x6'));router['get']('/',auth[_0x2769('0x7')](),controller[_0x2769('0x8')]);router['get'](_0x2769('0x9'),auth[_0x2769('0x7')](),controller['describe']);router[_0x2769('0xa')](_0x2769('0xb'),auth[_0x2769('0x7')](),controller[_0x2769('0xc')]);router[_0x2769('0xa')](_0x2769('0xd'),auth[_0x2769('0x7')](),controller[_0x2769('0xe')]);router[_0x2769('0xa')](_0x2769('0xf'),auth['isAuthenticated'](),controller['getContacts']);router[_0x2769('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x2769('0x10')]);router[_0x2769('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0x2769('0xa')](_0x2769('0x11'),auth['isAuthenticated'](),controller[_0x2769('0x12')]);router[_0x2769('0x13')]('/',auth['isAuthenticated'](),controller[_0x2769('0x14')]);router[_0x2769('0x13')](_0x2769('0xd'),auth[_0x2769('0x7')](),controller[_0x2769('0x15')]);router[_0x2769('0x13')]('/:id/contacts',auth[_0x2769('0x7')](),controller['addContacts']);router['post'](_0x2769('0x16'),auth['isAuthenticated'](),controller[_0x2769('0x17')]);router[_0x2769('0x13')](_0x2769('0x11'),auth[_0x2769('0x7')](),controller[_0x2769('0x18')]);router[_0x2769('0x19')](_0x2769('0xb'),auth['isAuthenticated'](),controller[_0x2769('0x1a')]);router['delete'](_0x2769('0xb'),auth[_0x2769('0x7')](),controller[_0x2769('0x1b')]);router[_0x2769('0x1c')](_0x2769('0xd'),auth[_0x2769('0x7')](),controller['removeDispositions']);router['delete']('/:id/users',auth[_0x2769('0x7')](),controller[_0x2769('0x1d')]);module[_0x2769('0x1e')]=router;
\ No newline at end of file
index a603066..6bb0dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea1=['field','STRING','exports'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x7ea1,0x113));var _0x17ea=function(_0x3b8f2e,_0x5a99a8){_0x3b8f2e=_0x3b8f2e-0x0;var _0x1433d5=_0x7ea1[_0x3b8f2e];return _0x1433d5;};'use strict';var Sequelize=require('sequelize');module[_0x17ea('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1e26ff){return this['getDataValue'](_0x17ea('0x1'));}},'field':{'type':Sequelize[_0x17ea('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x17ea('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xaaed=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0xaaed,0x170));var _0xdaae=function(_0xb20d45,_0x16a384){_0xb20d45=_0xb20d45-0x0;var _0x501b84=_0xaaed[_0xb20d45];return _0x501b84;};'use strict';var Sequelize=require(_0xdaae('0x0'));module[_0xdaae('0x1')]={'name':{'type':Sequelize[_0xdaae('0x2')],'get':function(_0x18a6d2){return this[_0xdaae('0x3')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xdaae('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xdaae('0x4')],'allowNull':![]}};
\ No newline at end of file
index 81b10e5..c180163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4638d1,_0x51327b){var _0x22f079=function(_0x36ccce){while(--_0x36ccce){_0x4638d1['push'](_0x4638d1['shift']());}};_0x22f079(++_0x51327b);}(_0x7a54,0x106));var _0x47a5=function(_0xbdb3bf,_0x44f068){_0xbdb3bf=_0xbdb3bf-0x0;var _0x48a7ec=_0x7a54[_0xbdb3bf];return _0x48a7ec;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xded267,_0x437236){var _0x1f2763=function(_0x475fcb){while(--_0x475fcb){_0xded267['push'](_0xded267['shift']());}};_0x1f2763(++_0x437236);}(_0x7a54,0x106));var _0x47a5=function(_0x2a4bd2,_0x51bc90){_0x2a4bd2=_0x2a4bd2-0x0;var _0x41d5a7=_0x7a54[_0x2a4bd2];return _0x41d5a7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index c88c5dd..bdab7d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe7a=['../../config/environment','./condition.attributes','exports','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2b91ac,_0x310741){var _0xe88814=function(_0x59c51b){while(--_0x59c51b){_0x2b91ac['push'](_0x2b91ac['shift']());}};_0xe88814(++_0x310741);}(_0xfe7a,0x160));var _0xafe7=function(_0x4de297,_0x51262e){_0x4de297=_0x4de297-0x0;var _0x3c2bf0=_0xfe7a[_0x4de297];return _0x3c2bf0;};'use strict';var _=require(_0xafe7('0x0'));var util=require(_0xafe7('0x1'));var logger=require(_0xafe7('0x2'))(_0xafe7('0x3'));var moment=require(_0xafe7('0x4'));var BPromise=require(_0xafe7('0x5'));var rp=require(_0xafe7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xafe7('0x7'));var config=require(_0xafe7('0x8'));var attributes=require(_0xafe7('0x9'));module[_0xafe7('0xa')]=function(_0x26b9cb,_0x1c9313){return _0x26b9cb['define']('Condition',attributes,{'tableName':_0xafe7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x73ee=['./condition.attributes','define','Condition','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d07dd,_0x23f389){var _0x394d55=function(_0x4c1e8d){while(--_0x4c1e8d){_0x3d07dd['push'](_0x3d07dd['shift']());}};_0x394d55(++_0x23f389);}(_0x73ee,0xf5));var _0xe73e=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x73ee[_0x279d37];return _0x530173;};'use strict';var _=require('lodash');var util=require(_0xe73e('0x0'));var logger=require(_0xe73e('0x1'))('api');var moment=require(_0xe73e('0x2'));var BPromise=require(_0xe73e('0x3'));var rp=require(_0xe73e('0x4'));var fs=require('fs');var path=require(_0xe73e('0x5'));var rimraf=require(_0xe73e('0x6'));var config=require(_0xe73e('0x7'));var attributes=require(_0xe73e('0x8'));module['exports']=function(_0xe2aab3,_0x389131){return _0xe2aab3[_0xe73e('0x9')](_0xe73e('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1af13d2..55ca5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3320=['request','then','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Condition,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3564af,_0x43a7d4){var _0x46d2da=function(_0x2a5290){while(--_0x2a5290){_0x3564af['push'](_0x3564af['shift']());}};_0x46d2da(++_0x43a7d4);}(_0x3320,0x68));var _0x0332=function(_0x694b9d,_0x352d80){_0x694b9d=_0x694b9d-0x0;var _0x137ca8=_0x3320[_0x694b9d];return _0x137ca8;};'use strict';var _=require(_0x0332('0x0'));var util=require(_0x0332('0x1'));var moment=require('moment');var BPromise=require(_0x0332('0x2'));var rs=require(_0x0332('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0332('0x4'));var logger=require(_0x0332('0x5'))(_0x0332('0x6'));var config=require(_0x0332('0x7'));var jayson=require(_0x0332('0x8'));var client=jayson[_0x0332('0x9')][_0x0332('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265a25,_0x45efcc,_0x36eebb){return new BPromise(function(_0x3e08c5,_0x30c80d){return client[_0x0332('0xb')](_0x265a25,_0x36eebb)[_0x0332('0xc')](function(_0x171b83){logger['info']('Condition,\x20%s,\x20%s',_0x45efcc,'request\x20sent');logger[_0x0332('0xd')](_0x0332('0xe'),_0x45efcc,_0x0332('0xf'),JSON[_0x0332('0x10')](_0x171b83));if(_0x171b83[_0x0332('0x11')]){if(_0x171b83[_0x0332('0x11')][_0x0332('0x12')]===0x1f4){logger[_0x0332('0x11')]('Condition,\x20%s,\x20%s',_0x45efcc,_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);return _0x30c80d(_0x171b83['error'][_0x0332('0x13')]);}logger['error'](_0x0332('0x14'),_0x45efcc,_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);return _0x3e08c5(_0x171b83[_0x0332('0x11')][_0x0332('0x13')]);}else{logger['info'](_0x0332('0x14'),_0x45efcc,'request\x20sent');_0x3e08c5(_0x171b83[_0x0332('0x15')]['message']);}})[_0x0332('0x16')](function(_0x9c2a5a){logger[_0x0332('0x11')](_0x0332('0x14'),_0x45efcc,_0x9c2a5a);_0x30c80d(_0x9c2a5a);});});}
\ No newline at end of file
+var _0x7ad8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7ad8,0x1dc));var _0x87ad=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x7ad8[_0x45161c];return _0x186581;};'use strict';var _=require(_0x87ad('0x0'));var util=require(_0x87ad('0x1'));var moment=require(_0x87ad('0x2'));var BPromise=require(_0x87ad('0x3'));var rs=require(_0x87ad('0x4'));var fs=require('fs');var Redis=require(_0x87ad('0x5'));var db=require(_0x87ad('0x6'))['db'];var utils=require(_0x87ad('0x7'));var logger=require(_0x87ad('0x8'))(_0x87ad('0x9'));var config=require(_0x87ad('0xa'));var jayson=require(_0x87ad('0xb'));var client=jayson[_0x87ad('0xc')][_0x87ad('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4f71ab,_0x43660d,_0x30a672){return new BPromise(function(_0xc2973a,_0x372a48){return client['request'](_0x4f71ab,_0x30a672)[_0x87ad('0xe')](function(_0x1c9a23){logger['info'](_0x87ad('0xf'),_0x43660d,_0x87ad('0x10'));logger[_0x87ad('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x43660d,_0x87ad('0x10'),JSON[_0x87ad('0x12')](_0x1c9a23));if(_0x1c9a23['error']){if(_0x1c9a23[_0x87ad('0x13')]['code']===0x1f4){logger['error'](_0x87ad('0xf'),_0x43660d,_0x1c9a23[_0x87ad('0x13')][_0x87ad('0x14')]);return _0x372a48(_0x1c9a23[_0x87ad('0x13')][_0x87ad('0x14')]);}logger[_0x87ad('0x13')]('Condition,\x20%s,\x20%s',_0x43660d,_0x1c9a23[_0x87ad('0x13')]['message']);return _0xc2973a(_0x1c9a23[_0x87ad('0x13')]['message']);}else{logger[_0x87ad('0x15')]('Condition,\x20%s,\x20%s',_0x43660d,_0x87ad('0x10'));_0xc2973a(_0x1c9a23[_0x87ad('0x16')]['message']);}})[_0x87ad('0x17')](function(_0x4b9945){logger[_0x87ad('0x13')]('Condition,\x20%s,\x20%s',_0x43660d,_0x4b9945);_0x372a48(_0x4b9945);});});}
\ No newline at end of file
index 78fce77..af5cb65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48c=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb48c,0x116));var _0xcb48=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb48c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xcb48('0x0'));var util=require(_0xcb48('0x1'));var path=require(_0xcb48('0x2'));var timeout=require('connect-timeout');var express=require(_0xcb48('0x3'));var router=express[_0xcb48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb48('0x5'));var interaction=require(_0xcb48('0x6'));var config=require(_0xcb48('0x7'));var controller=require(_0xcb48('0x8'));router['put'](_0xcb48('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcb48('0x9'),auth['isAuthenticated'](),controller[_0xcb48('0xa')]);module[_0xcb48('0xb')]=router;
\ No newline at end of file
+var _0xe1c9=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe1c9,0x1df));var _0x9e1c=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0xe1c9[_0x3932eb];return _0x5316e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e1c('0x0'));var timeout=require(_0x9e1c('0x1'));var express=require(_0x9e1c('0x2'));var router=express[_0x9e1c('0x3')]();var fs_extra=require(_0x9e1c('0x4'));var auth=require(_0x9e1c('0x5'));var interaction=require(_0x9e1c('0x6'));var config=require(_0x9e1c('0x7'));var controller=require(_0x9e1c('0x8'));router['put'](_0x9e1c('0x9'),auth[_0x9e1c('0xa')](),controller['update']);router[_0x9e1c('0xb')](_0x9e1c('0x9'),auth[_0x9e1c('0xa')](),controller[_0x9e1c('0xc')]);module[_0x9e1c('0xd')]=router;
\ No newline at end of file
index bd50057..822c3e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x325212,_0x125fd6){var _0x166738=function(_0x4e6393){while(--_0x4e6393){_0x325212['push'](_0x325212['shift']());}};_0x166738(++_0x125fd6);}(_0x757a,0xde));var _0xa757=function(_0x51a543,_0x22e6d7){_0x51a543=_0x51a543-0x0;var _0x3df0bb=_0x757a[_0x51a543];return _0x3df0bb;};'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(_0x1bf3d0,_0x54e6a7){var _0x3bf85e=function(_0xaaab35){while(--_0xaaab35){_0x1bf3d0['push'](_0x1bf3d0['shift']());}};_0x3bf85e(++_0x54e6a7);}(_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 9de8f88..f1535b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d6f=['autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x4d6f,0x11c));var _0xf4d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d6f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf4d6('0x0'));var rimraf=require(_0xf4d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4d6('0x2'));var rp=require(_0xf4d6('0x3'));var moment=require(_0xf4d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4d6('0x5'));var util=require(_0xf4d6('0x6'));var path=require(_0xf4d6('0x7'));var sox=require(_0xf4d6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf4d6('0x9'));var _=require(_0xf4d6('0xa'));var squel=require(_0xf4d6('0xb'));var crypto=require(_0xf4d6('0xc'));var jsforce=require(_0xf4d6('0xd'));var deskjs=require(_0xf4d6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4d6('0xf'));var Papa=require(_0xf4d6('0x10'));var Redis=require('ioredis');var authService=require(_0xf4d6('0x11'));var qs=require(_0xf4d6('0x12'));var as=require(_0xf4d6('0x13'));var hardwareService=require(_0xf4d6('0x14'));var logger=require(_0xf4d6('0x15'))(_0xf4d6('0x16'));var utils=require(_0xf4d6('0x17'));var config=require(_0xf4d6('0x18'));var licenseUtil=require(_0xf4d6('0x19'));var db=require(_0xf4d6('0x1a'))['db'];config[_0xf4d6('0x1b')]=_[_0xf4d6('0x1c')](config[_0xf4d6('0x1b')],{'host':_0xf4d6('0x1d'),'port':0x18eb});var socket=require(_0xf4d6('0x1e'))(new Redis(config[_0xf4d6('0x1b')]));require(_0xf4d6('0x1f'))['register'](socket);function respondWithStatusCode(_0x259e7d,_0x106c22){_0x106c22=_0x106c22||0xcc;return function(_0x192ee8){if(_0x192ee8){return _0x259e7d[_0xf4d6('0x20')](_0x106c22);}return _0x259e7d[_0xf4d6('0x21')](_0x106c22)['end']();};}function respondWithResult(_0x5b759a,_0x14ab99){_0x14ab99=_0x14ab99||0xc8;return function(_0x16bb81){if(_0x16bb81){return _0x5b759a['status'](_0x14ab99)[_0xf4d6('0x22')](_0x16bb81);}};}function respondWithFilteredResult(_0x20e8ed,_0x3dffcf){return function(_0x863fab){if(_0x863fab){var _0x64485=typeof _0x3dffcf['offset']===_0xf4d6('0x23')&&typeof _0x3dffcf[_0xf4d6('0x24')]===_0xf4d6('0x23');var _0x2c3ee0=_0x863fab[_0xf4d6('0x25')];var _0x2725b6=_0x64485?0x0:_0x3dffcf['offset'];var _0x2957c1=_0x64485?_0x863fab[_0xf4d6('0x25')]:_0x3dffcf[_0xf4d6('0x26')]+_0x3dffcf['limit'];var _0x244cf3;if(_0x2957c1>=_0x2c3ee0){_0x2957c1=_0x2c3ee0;_0x244cf3=0xc8;}else{_0x244cf3=0xce;}_0x20e8ed[_0xf4d6('0x21')](_0x244cf3);return _0x20e8ed[_0xf4d6('0x27')]('Content-Range',_0x2725b6+'-'+_0x2957c1+'/'+_0x2c3ee0)[_0xf4d6('0x22')](_0x863fab);}return null;};}function patchUpdates(_0x4a8c39){return function(_0x117840){try{jsonpatch[_0xf4d6('0x28')](_0x117840,_0x4a8c39,!![]);}catch(_0x55f453){return BPromise[_0xf4d6('0x29')](_0x55f453);}return _0x117840[_0xf4d6('0x2a')]();};}function saveUpdates(_0x2d6c6e,_0x27e28c){return function(_0x454c8b){if(_0x454c8b){return _0x454c8b[_0xf4d6('0x2b')](_0x2d6c6e)[_0xf4d6('0x2c')](function(_0x5e3a6c){return _0x5e3a6c;});}return null;};}function removeEntity(_0x3d4ba7,_0x18f79a){return function(_0x266ba0){if(_0x266ba0){return _0x266ba0['destroy']()[_0xf4d6('0x2c')](function(){var _0x568f7d=_0x266ba0['get']({'plain':!![]});var _0xe794b0=_0xf4d6('0x2d');return db[_0xf4d6('0x2e')][_0xf4d6('0x2f')]({'where':{'type':_0xe794b0,'resourceId':_0x568f7d['id']}})['then'](function(){return _0x266ba0;});})['then'](function(){_0x3d4ba7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x374804,_0x3f495d){return function(_0x56a43f){if(!_0x56a43f){_0x374804[_0xf4d6('0x20')](0x194);}return _0x56a43f;};}function handleError(_0x42315b,_0x2d2d7c){_0x2d2d7c=_0x2d2d7c||0x1f4;return function(_0x99f4c8){logger[_0xf4d6('0x30')](_0x99f4c8[_0xf4d6('0x31')]);if(_0x99f4c8['name']){delete _0x99f4c8[_0xf4d6('0x32')];}_0x42315b['status'](_0x2d2d7c)[_0xf4d6('0x33')](_0x99f4c8);};}exports[_0xf4d6('0x34')]=function(_0x582b82,_0x7eacda){var _0x204f29={},_0x4c17e6={},_0x138054={'count':0x0,'rows':[]};var _0x19ad44=_[_0xf4d6('0x35')](db[_0xf4d6('0x36')][_0xf4d6('0x37')],function(_0x50e770){return{'name':_0x50e770[_0xf4d6('0x38')],'type':_0x50e770['type'][_0xf4d6('0x39')]};});_0x4c17e6[_0xf4d6('0x3a')]=_[_0xf4d6('0x35')](_0x19ad44,'name');_0x4c17e6['query']=_[_0xf4d6('0x3b')](_0x582b82[_0xf4d6('0x3c')]);_0x4c17e6['filters']=_[_0xf4d6('0x3d')](_0x4c17e6[_0xf4d6('0x3a')],_0x4c17e6[_0xf4d6('0x3c')]);_0x204f29['attributes']=_[_0xf4d6('0x3d')](_0x4c17e6['model'],qs['fields'](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x3e')]));_0x204f29['attributes']=_0x204f29[_0xf4d6('0x3f')]['length']?_0x204f29['attributes']:_0x4c17e6[_0xf4d6('0x3a')];if(!_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x40')](_0xf4d6('0x41'))){_0x204f29[_0xf4d6('0x24')]=qs[_0xf4d6('0x24')](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x24')]);_0x204f29[_0xf4d6('0x26')]=qs['offset'](_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x26')]);}_0x204f29[_0xf4d6('0x42')]=qs[_0xf4d6('0x43')](_0x582b82['query'][_0xf4d6('0x43')]);_0x204f29[_0xf4d6('0x44')]=qs[_0xf4d6('0x45')](_[_0xf4d6('0x46')](_0x582b82[_0xf4d6('0x3c')],_0x4c17e6[_0xf4d6('0x45')]),_0x19ad44);if(_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x47')]){_0x204f29[_0xf4d6('0x44')]=_[_0xf4d6('0x48')](_0x204f29['where'],{'$or':_[_0xf4d6('0x35')](_0x19ad44,function(_0x11f627){if(_0x11f627[_0xf4d6('0x49')]!==_0xf4d6('0x4a')){var _0x576370={};_0x576370[_0x11f627['name']]={'$like':'%'+_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x47')]+'%'};return _0x576370;}})});}_0x204f29=_[_0xf4d6('0x48')]({},_0x204f29,_0x582b82[_0xf4d6('0x4b')]);var _0x2c0f6a={'where':_0x204f29[_0xf4d6('0x44')]};return db['Dashboard'][_0xf4d6('0x25')](_0x2c0f6a)[_0xf4d6('0x2c')](function(_0x168455){_0x138054[_0xf4d6('0x25')]=_0x168455;if(_0x582b82[_0xf4d6('0x3c')][_0xf4d6('0x4c')]){_0x204f29[_0xf4d6('0x4d')]=[{'all':!![]}];}return db[_0xf4d6('0x36')][_0xf4d6('0x4e')](_0x204f29);})['then'](function(_0x51c832){_0x138054[_0xf4d6('0x4f')]=_0x51c832;return _0x138054;})['then'](respondWithFilteredResult(_0x7eacda,_0x204f29))['catch'](handleError(_0x7eacda,null));};exports[_0xf4d6('0x50')]=function(_0x1af6d7,_0x246500){var _0x500264={'raw':![],'where':{'id':_0x1af6d7['params']['id']}},_0x5cf9d6={};_0x5cf9d6[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db['Dashboard'][_0xf4d6('0x37')]);_0x5cf9d6['query']=_['keys'](_0x1af6d7[_0xf4d6('0x3c')]);_0x5cf9d6[_0xf4d6('0x45')]=_[_0xf4d6('0x3d')](_0x5cf9d6[_0xf4d6('0x3a')],_0x5cf9d6[_0xf4d6('0x3c')]);_0x500264[_0xf4d6('0x3f')]=_[_0xf4d6('0x3d')](_0x5cf9d6[_0xf4d6('0x3a')],qs[_0xf4d6('0x3e')](_0x1af6d7[_0xf4d6('0x3c')]['fields']));_0x500264['attributes']=_0x500264[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x500264[_0xf4d6('0x3f')]:_0x5cf9d6[_0xf4d6('0x3a')];if(_0x1af6d7[_0xf4d6('0x3c')][_0xf4d6('0x4c')]){_0x500264[_0xf4d6('0x4d')]=[{'all':!![]}];}_0x500264=_[_0xf4d6('0x48')]({},_0x500264,_0x1af6d7['options']);return db[_0xf4d6('0x36')][_0xf4d6('0x52')](_0x500264)[_0xf4d6('0x2c')](handleEntityNotFound(_0x246500,null))['then'](respondWithResult(_0x246500,null))[_0xf4d6('0x53')](handleError(_0x246500,null));};exports[_0xf4d6('0x54')]=function(_0x34b0f8,_0x524922){return db[_0xf4d6('0x36')][_0xf4d6('0x54')](_0x34b0f8[_0xf4d6('0x55')],{})['then'](function(_0x4a3a2d){var _0x19aef4=_0x34b0f8[_0xf4d6('0x56')][_0xf4d6('0x57')]({'plain':!![]});if(!_0x19aef4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19aef4[_0xf4d6('0x58')]==='user'){var _0x3b7150=_0x4a3a2d['get']({'plain':!![]});var _0x574488='CustomDashboards';return db[_0xf4d6('0x59')][_0xf4d6('0x52')]({'where':{'name':_0x574488,'userProfileId':_0x19aef4['userProfileId']},'raw':!![]})[_0xf4d6('0x2c')](function(_0x394d7c){if(_0x394d7c&&_0x394d7c['autoAssociation']===0x0){return db[_0xf4d6('0x2e')]['create']({'name':_0x3b7150[_0xf4d6('0x32')],'resourceId':_0x3b7150['id'],'type':_0x394d7c['name'],'sectionId':_0x394d7c['id']},{})[_0xf4d6('0x2c')](function(){return _0x4a3a2d;});}else{return _0x4a3a2d;}})[_0xf4d6('0x53')](function(_0x57c44a){logger[_0xf4d6('0x30')](_0xf4d6('0x5a'),_0x57c44a);throw _0x57c44a;});}return _0x4a3a2d;})[_0xf4d6('0x2c')](respondWithResult(_0x524922,0xc9))[_0xf4d6('0x53')](handleError(_0x524922,null));};exports[_0xf4d6('0x5b')]=function(_0x1658e8,_0x3bc3a2){var _0x302b43={'where':{'id':_0x1658e8[_0xf4d6('0x5c')]['id']}},_0x18536f={};_0x18536f[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db[_0xf4d6('0x36')][_0xf4d6('0x37')]);_0x302b43['attributes']=_[_0xf4d6('0x3d')](_0x18536f[_0xf4d6('0x3a')],qs[_0xf4d6('0x3e')](_0x1658e8[_0xf4d6('0x3c')][_0xf4d6('0x3e')]));_0x302b43['attributes']=_0x302b43[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x302b43[_0xf4d6('0x3f')]:_0x18536f[_0xf4d6('0x3a')];if(_0x1658e8['query']['includeAll']){_0x302b43[_0xf4d6('0x4d')]=[{'all':!![]}];}_0x302b43=_[_0xf4d6('0x48')]({},_0x302b43,_0x1658e8[_0xf4d6('0x4b')]);return db[_0xf4d6('0x36')]['find'](_0x302b43)['then'](handleEntityNotFound(_0x3bc3a2,null))[_0xf4d6('0x2c')](function(_0x26480f){if(_0x26480f){var _0x56cd2a=_0x26480f[_0xf4d6('0x57')]({'plain':!![]});_0x56cd2a=qs['omit'](_0x56cd2a,['id',_0xf4d6('0x5d'),_0xf4d6('0x5e')]);_0x1658e8[_0xf4d6('0x55')]=_[_0xf4d6('0x5f')](_0x1658e8[_0xf4d6('0x55')],['id',_0xf4d6('0x5d'),_0xf4d6('0x5e')]);return db[_0xf4d6('0x36')][_0xf4d6('0x54')](_['merge'](_0x56cd2a,_0x1658e8['body']),{'include':_0x1658e8['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf4d6('0x2c')](function(_0x50e146){var _0x3fc7b9=_0x1658e8[_0xf4d6('0x56')]['get']({'plain':!![]});if(!_0x3fc7b9)throw new Error(_0xf4d6('0x60'));if(_0x3fc7b9[_0xf4d6('0x58')]===_0xf4d6('0x56')){var _0x169991=_0x50e146['get']({'plain':!![]});var _0x30dbb1=_0xf4d6('0x2d');return db[_0xf4d6('0x59')][_0xf4d6('0x52')]({'where':{'name':_0x30dbb1,'userProfileId':_0x3fc7b9['userProfileId']},'raw':!![]})[_0xf4d6('0x2c')](function(_0x1c1bcf){if(_0x1c1bcf&&_0x1c1bcf[_0xf4d6('0x61')]===0x0){return db['UserProfileResource'][_0xf4d6('0x54')]({'name':_0x169991[_0xf4d6('0x32')],'resourceId':_0x169991['id'],'type':_0x1c1bcf['name'],'sectionId':_0x1c1bcf['id']},{})[_0xf4d6('0x2c')](function(){return _0x50e146;});}else{return _0x50e146;}})[_0xf4d6('0x53')](function(_0x18f89f){logger[_0xf4d6('0x30')](_0xf4d6('0x5a'),_0x18f89f);throw _0x18f89f;});}return _0x50e146;});}})[_0xf4d6('0x2c')](respondWithResult(_0x3bc3a2,0xc9))[_0xf4d6('0x53')](handleError(_0x3bc3a2,null));};exports[_0xf4d6('0x2b')]=function(_0x181b0a,_0x32eb33){if(_0x181b0a[_0xf4d6('0x55')]['id']){delete _0x181b0a[_0xf4d6('0x55')]['id'];}return db[_0xf4d6('0x36')]['find']({'where':{'id':_0x181b0a[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x32eb33,null))[_0xf4d6('0x2c')](saveUpdates(_0x181b0a['body'],null))['then'](respondWithResult(_0x32eb33,null))['catch'](handleError(_0x32eb33,null));};exports[_0xf4d6('0x2f')]=function(_0x4508dc,_0x2087c1){return db[_0xf4d6('0x36')]['find']({'where':{'id':_0x4508dc[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x2087c1,null))[_0xf4d6('0x2c')](removeEntity(_0x2087c1,null))['catch'](handleError(_0x2087c1,null));};function widgetAttributes(_0x39d2e5){try{switch(_0x39d2e5[_0xf4d6('0x49')]){case _0xf4d6('0x62'):return[{'name':_0xf4d6('0x63'),'value':_0x39d2e5['attrUrl']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x66')}];case _0xf4d6('0x67'):return[{'name':'attrPath','value':_0x39d2e5[_0xf4d6('0x68')]||(_0x39d2e5['attrs']&&_0x39d2e5['attrs'][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||''}];case'clock':return[{'name':_0xf4d6('0x69'),'value':_0x39d2e5['attrHourFormat']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6a')},{'name':'attrTimezone','value':_0x39d2e5['attrTimezone']||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5[_0xf4d6('0x64')][0x1][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6b')},{'name':_0xf4d6('0x6c'),'value':_0x39d2e5[_0xf4d6('0x6c')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2][_0xf4d6('0x65')]:undefined)||0xc}];case _0xf4d6('0x6d'):return[{'name':_0xf4d6('0x6e'),'value':_0x39d2e5[_0xf4d6('0x6e')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6f')},{'name':_0xf4d6('0x70'),'value':_0x39d2e5[_0xf4d6('0x70')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5['attrs'][0x1][_0xf4d6('0x65')]:undefined)||[]},{'name':'attrFontSize','value':_0x39d2e5[_0xf4d6('0x6c')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2][_0xf4d6('0x65')]:undefined)||0x14}];case _0xf4d6('0x71'):case'pie-chart':return[{'name':_0xf4d6('0x72'),'value':_0x39d2e5[_0xf4d6('0x72')]||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x65')]:undefined)||_0xf4d6('0x6f')},{'name':_0xf4d6('0x73'),'value':_0x39d2e5[_0xf4d6('0x73')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5['attrs'][0x1][_0xf4d6('0x65')]:undefined)||null},{'name':'attrSerie3','value':_0x39d2e5[_0xf4d6('0x74')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x2]?_0x39d2e5[_0xf4d6('0x64')][0x2]['value']:undefined)||null},{'name':_0xf4d6('0x70'),'value':_0x39d2e5['attrVoiceQueues']||(_0x39d2e5['attrs']&&_0x39d2e5[_0xf4d6('0x64')][0x3]?_0x39d2e5[_0xf4d6('0x64')][0x3]['value']:undefined)||[]}];case _0xf4d6('0x75'):return[{'name':_0xf4d6('0x76'),'type':_0x39d2e5[_0xf4d6('0x77')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0][_0xf4d6('0x49')]:undefined)||null,'value':_0x39d2e5[_0xf4d6('0x76')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x0]?_0x39d2e5[_0xf4d6('0x64')][0x0]['value']:undefined)||null},{'name':_0xf4d6('0x78'),'value':_0x39d2e5[_0xf4d6('0x78')]||(_0x39d2e5[_0xf4d6('0x64')]&&_0x39d2e5[_0xf4d6('0x64')][0x1]?_0x39d2e5[_0xf4d6('0x64')][0x1][_0xf4d6('0x65')]:undefined)||0x0}];default:return[];}}catch(_0x2f2769){logger[_0xf4d6('0x30')](_0xf4d6('0x79'),JSON['stringify'](_0x2f2769));return[];}}exports[_0xf4d6('0x7a')]=function(_0x332940,_0x485a88,_0x12a5ae){if(_0x332940[_0xf4d6('0x55')]['id']){delete _0x332940[_0xf4d6('0x55')]['id'];}return db[_0xf4d6('0x36')][_0xf4d6('0x52')]({'where':{'id':_0x332940[_0xf4d6('0x5c')]['id']}})[_0xf4d6('0x2c')](handleEntityNotFound(_0x485a88,null))[_0xf4d6('0x2c')](function(_0x3b12f1){if(_0x3b12f1){_0x332940['body'][_0xf4d6('0x7b')]=_0x3b12f1['id'];_0x332940['body'][_0xf4d6('0x64')]=widgetAttributes(_0x332940[_0xf4d6('0x55')]);return db[_0xf4d6('0x7c')][_0xf4d6('0x54')](_0x332940[_0xf4d6('0x55')]);}})[_0xf4d6('0x2c')](respondWithResult(_0x485a88,null))['catch'](handleError(_0x485a88,null));};exports[_0xf4d6('0x7d')]=function(_0xbf0740,_0x236c1b,_0x330803){var _0x15f14f={};var _0x352677={};var _0x31f71b;var _0x2c1f20;return db[_0xf4d6('0x36')][_0xf4d6('0x7e')]({'where':{'id':_0xbf0740['params']['id']}})['then'](handleEntityNotFound(_0x236c1b,null))[_0xf4d6('0x2c')](function(_0x98ded3){if(_0x98ded3){_0x31f71b=_0x98ded3;_0x352677[_0xf4d6('0x3a')]=_[_0xf4d6('0x3b')](db['DashboardItem'][_0xf4d6('0x37')]);_0x352677['query']=_[_0xf4d6('0x3b')](_0xbf0740[_0xf4d6('0x3c')]);_0x352677[_0xf4d6('0x45')]=_['intersection'](_0x352677[_0xf4d6('0x3a')],_0x352677[_0xf4d6('0x3c')]);_0x15f14f['attributes']=_[_0xf4d6('0x3d')](_0x352677['model'],qs[_0xf4d6('0x3e')](_0xbf0740[_0xf4d6('0x3c')]['fields']));_0x15f14f[_0xf4d6('0x3f')]=_0x15f14f[_0xf4d6('0x3f')][_0xf4d6('0x51')]?_0x15f14f[_0xf4d6('0x3f')]:_0x352677[_0xf4d6('0x3a')];_0x15f14f[_0xf4d6('0x42')]=qs[_0xf4d6('0x43')](_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x43')]);_0x15f14f[_0xf4d6('0x44')]=qs['filters'](_[_0xf4d6('0x46')](_0xbf0740['query'],_0x352677[_0xf4d6('0x45')]));if(_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x47')]){_0x15f14f[_0xf4d6('0x44')]=_['merge'](_0x15f14f[_0xf4d6('0x44')],{'$or':_[_0xf4d6('0x35')](_0x15f14f[_0xf4d6('0x3f')],function(_0x11e79c){var _0x59780f={};_0x59780f[_0x11e79c]={'$like':'%'+_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x47')]+'%'};return _0x59780f;})});}_0x15f14f=_[_0xf4d6('0x48')]({},_0x15f14f,_0xbf0740[_0xf4d6('0x4b')]);return _0x31f71b[_0xf4d6('0x7d')](_0x15f14f);}})[_0xf4d6('0x2c')](function(_0x16df74){if(_0x16df74){_0x2c1f20=_0x16df74['length'];if(!_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x40')]('nolimit')){_0x15f14f['limit']=qs[_0xf4d6('0x24')](_0xbf0740[_0xf4d6('0x3c')][_0xf4d6('0x24')]);_0x15f14f[_0xf4d6('0x26')]=qs[_0xf4d6('0x26')](_0xbf0740['query'][_0xf4d6('0x26')]);}return _0x31f71b[_0xf4d6('0x7d')](_0x15f14f);}})[_0xf4d6('0x2c')](function(_0x18bc31){if(_0x18bc31){return _0x18bc31?{'count':_0x2c1f20,'rows':_0x18bc31}:null;}})['then'](respondWithResult(_0x236c1b,null))['catch'](handleError(_0x236c1b,null));};
\ No newline at end of file
+var _0xb216=['type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','updatedAt','omit','body','createdAt','userProfileId','autoAssociation','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','fieldName'];(function(_0x116549,_0x210e8b){var _0x1321e5=function(_0x413542){while(--_0x413542){_0x116549['push'](_0x116549['shift']());}};_0x1321e5(++_0x210e8b);}(_0xb216,0xba));var _0x6b21=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xb216[_0x313c96];return _0x522f53;};'use strict';var emlformat=require(_0x6b21('0x0'));var rimraf=require(_0x6b21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b21('0x2'));var rp=require('request-promise');var moment=require(_0x6b21('0x3'));var BPromise=require(_0x6b21('0x4'));var Mustache=require(_0x6b21('0x5'));var util=require(_0x6b21('0x6'));var path=require(_0x6b21('0x7'));var sox=require('sox');var csv=require(_0x6b21('0x8'));var ejs=require(_0x6b21('0x9'));var fs=require('fs');var fs_extra=require(_0x6b21('0xa'));var _=require(_0x6b21('0xb'));var squel=require(_0x6b21('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6b21('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6b21('0xe'));var authService=require(_0x6b21('0xf'));var qs=require(_0x6b21('0x10'));var as=require(_0x6b21('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b21('0x12'));var utils=require(_0x6b21('0x13'));var config=require(_0x6b21('0x14'));var licenseUtil=require(_0x6b21('0x15'));var db=require(_0x6b21('0x16'))['db'];config['redis']=_['defaults'](config[_0x6b21('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b21('0x18'))(new Redis(config[_0x6b21('0x17')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x20e550,_0x5f587b){_0x5f587b=_0x5f587b||0xcc;return function(_0x2dd23f){if(_0x2dd23f){return _0x20e550[_0x6b21('0x19')](_0x5f587b);}return _0x20e550[_0x6b21('0x1a')](_0x5f587b)['end']();};}function respondWithResult(_0x963ad0,_0x110995){_0x110995=_0x110995||0xc8;return function(_0x49bcf7){if(_0x49bcf7){return _0x963ad0[_0x6b21('0x1a')](_0x110995)[_0x6b21('0x1b')](_0x49bcf7);}};}function respondWithFilteredResult(_0x1179ba,_0x275b0b){return function(_0xfb02ed){if(_0xfb02ed){var _0xcf95a2=typeof _0x275b0b[_0x6b21('0x1c')]===_0x6b21('0x1d')&&typeof _0x275b0b[_0x6b21('0x1e')]===_0x6b21('0x1d');var _0x43bc0c=_0xfb02ed['count'];var _0x5809d5=_0xcf95a2?0x0:_0x275b0b[_0x6b21('0x1c')];var _0x172b3e=_0xcf95a2?_0xfb02ed[_0x6b21('0x1f')]:_0x275b0b[_0x6b21('0x1c')]+_0x275b0b[_0x6b21('0x1e')];var _0x5f58af;if(_0x172b3e>=_0x43bc0c){_0x172b3e=_0x43bc0c;_0x5f58af=0xc8;}else{_0x5f58af=0xce;}_0x1179ba['status'](_0x5f58af);return _0x1179ba[_0x6b21('0x20')](_0x6b21('0x21'),_0x5809d5+'-'+_0x172b3e+'/'+_0x43bc0c)['json'](_0xfb02ed);}return null;};}function patchUpdates(_0x5783c0){return function(_0x33653e){try{jsonpatch[_0x6b21('0x22')](_0x33653e,_0x5783c0,!![]);}catch(_0x321b8a){return BPromise['reject'](_0x321b8a);}return _0x33653e[_0x6b21('0x23')]();};}function saveUpdates(_0x554cf1,_0x52eb91){return function(_0x1dbce5){if(_0x1dbce5){return _0x1dbce5['update'](_0x554cf1)[_0x6b21('0x24')](function(_0x56c789){return _0x56c789;});}return null;};}function removeEntity(_0x24b6b7,_0x5d26eb){return function(_0x2d2746){if(_0x2d2746){return _0x2d2746[_0x6b21('0x25')]()['then'](function(){var _0x10d87d=_0x2d2746[_0x6b21('0x26')]({'plain':!![]});var _0x324021=_0x6b21('0x27');return db[_0x6b21('0x28')][_0x6b21('0x25')]({'where':{'type':_0x324021,'resourceId':_0x10d87d['id']}})[_0x6b21('0x24')](function(){return _0x2d2746;});})['then'](function(){_0x24b6b7[_0x6b21('0x1a')](0xcc)[_0x6b21('0x29')]();});}};}function handleEntityNotFound(_0x1b2ed2,_0x1ae7e7){return function(_0x18c525){if(!_0x18c525){_0x1b2ed2[_0x6b21('0x19')](0x194);}return _0x18c525;};}function handleError(_0x422881,_0xf505bc){_0xf505bc=_0xf505bc||0x1f4;return function(_0x17acde){logger[_0x6b21('0x2a')](_0x17acde['stack']);if(_0x17acde['name']){delete _0x17acde[_0x6b21('0x2b')];}_0x422881[_0x6b21('0x1a')](_0xf505bc)[_0x6b21('0x2c')](_0x17acde);};}exports[_0x6b21('0x2d')]=function(_0x1fe0cf,_0x5571af){var _0x29cc04={},_0x3d4795={},_0x4b8f0d={'count':0x0,'rows':[]};var _0x539807=_[_0x6b21('0x2e')](db[_0x6b21('0x2f')][_0x6b21('0x30')],function(_0x26cc30){return{'name':_0x26cc30[_0x6b21('0x31')],'type':_0x26cc30[_0x6b21('0x32')][_0x6b21('0x33')]};});_0x3d4795['model']=_[_0x6b21('0x2e')](_0x539807,_0x6b21('0x2b'));_0x3d4795['query']=_['keys'](_0x1fe0cf[_0x6b21('0x34')]);_0x3d4795[_0x6b21('0x35')]=_[_0x6b21('0x36')](_0x3d4795[_0x6b21('0x37')],_0x3d4795['query']);_0x29cc04['attributes']=_[_0x6b21('0x36')](_0x3d4795['model'],qs[_0x6b21('0x38')](_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x38')]));_0x29cc04[_0x6b21('0x39')]=_0x29cc04['attributes'][_0x6b21('0x3a')]?_0x29cc04[_0x6b21('0x39')]:_0x3d4795['model'];if(!_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x3b')]('nolimit')){_0x29cc04[_0x6b21('0x1e')]=qs[_0x6b21('0x1e')](_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x1e')]);_0x29cc04['offset']=qs[_0x6b21('0x1c')](_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x1c')]);}_0x29cc04[_0x6b21('0x3c')]=qs[_0x6b21('0x3d')](_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x3d')]);_0x29cc04[_0x6b21('0x3e')]=qs[_0x6b21('0x35')](_['pick'](_0x1fe0cf[_0x6b21('0x34')],_0x3d4795['filters']),_0x539807);if(_0x1fe0cf['query'][_0x6b21('0x3f')]){_0x29cc04[_0x6b21('0x3e')]=_[_0x6b21('0x40')](_0x29cc04[_0x6b21('0x3e')],{'$or':_[_0x6b21('0x2e')](_0x539807,function(_0xe060eb){if(_0xe060eb[_0x6b21('0x32')]!==_0x6b21('0x41')){var _0x45279a={};_0x45279a[_0xe060eb[_0x6b21('0x2b')]]={'$like':'%'+_0x1fe0cf[_0x6b21('0x34')][_0x6b21('0x3f')]+'%'};return _0x45279a;}})});}_0x29cc04=_[_0x6b21('0x40')]({},_0x29cc04,_0x1fe0cf[_0x6b21('0x42')]);var _0x4e9ed3={'where':_0x29cc04[_0x6b21('0x3e')]};return db[_0x6b21('0x2f')][_0x6b21('0x1f')](_0x4e9ed3)['then'](function(_0x15cc84){_0x4b8f0d['count']=_0x15cc84;if(_0x1fe0cf['query']['includeAll']){_0x29cc04[_0x6b21('0x43')]=[{'all':!![]}];}return db[_0x6b21('0x2f')]['findAll'](_0x29cc04);})[_0x6b21('0x24')](function(_0x2994b7){_0x4b8f0d[_0x6b21('0x44')]=_0x2994b7;return _0x4b8f0d;})['then'](respondWithFilteredResult(_0x5571af,_0x29cc04))[_0x6b21('0x45')](handleError(_0x5571af,null));};exports[_0x6b21('0x46')]=function(_0x154cc5,_0x2bc256){var _0xce4c1c={'raw':![],'where':{'id':_0x154cc5[_0x6b21('0x47')]['id']}},_0xb95c3c={};_0xb95c3c[_0x6b21('0x37')]=_[_0x6b21('0x48')](db['Dashboard']['rawAttributes']);_0xb95c3c[_0x6b21('0x34')]=_[_0x6b21('0x48')](_0x154cc5['query']);_0xb95c3c['filters']=_[_0x6b21('0x36')](_0xb95c3c[_0x6b21('0x37')],_0xb95c3c[_0x6b21('0x34')]);_0xce4c1c[_0x6b21('0x39')]=_[_0x6b21('0x36')](_0xb95c3c[_0x6b21('0x37')],qs[_0x6b21('0x38')](_0x154cc5['query'][_0x6b21('0x38')]));_0xce4c1c['attributes']=_0xce4c1c[_0x6b21('0x39')][_0x6b21('0x3a')]?_0xce4c1c[_0x6b21('0x39')]:_0xb95c3c[_0x6b21('0x37')];if(_0x154cc5['query']['includeAll']){_0xce4c1c['include']=[{'all':!![]}];}_0xce4c1c=_[_0x6b21('0x40')]({},_0xce4c1c,_0x154cc5[_0x6b21('0x42')]);return db[_0x6b21('0x2f')][_0x6b21('0x49')](_0xce4c1c)['then'](handleEntityNotFound(_0x2bc256,null))['then'](respondWithResult(_0x2bc256,null))[_0x6b21('0x45')](handleError(_0x2bc256,null));};exports['create']=function(_0x5485da,_0x2ca3ad){return db[_0x6b21('0x2f')]['create'](_0x5485da['body'],{})[_0x6b21('0x24')](function(_0x2ee33d){var _0x55a60f=_0x5485da[_0x6b21('0x4a')]['get']({'plain':!![]});if(!_0x55a60f)throw new Error(_0x6b21('0x4b'));if(_0x55a60f[_0x6b21('0x4c')]===_0x6b21('0x4a')){var _0x46e0ef=_0x2ee33d[_0x6b21('0x26')]({'plain':!![]});var _0x2bc5dd=_0x6b21('0x27');return db[_0x6b21('0x4d')]['find']({'where':{'name':_0x2bc5dd,'userProfileId':_0x55a60f['userProfileId']},'raw':!![]})['then'](function(_0x50a1ea){if(_0x50a1ea&&_0x50a1ea['autoAssociation']===0x0){return db[_0x6b21('0x28')][_0x6b21('0x4e')]({'name':_0x46e0ef[_0x6b21('0x2b')],'resourceId':_0x46e0ef['id'],'type':_0x50a1ea[_0x6b21('0x2b')],'sectionId':_0x50a1ea['id']},{})['then'](function(){return _0x2ee33d;});}else{return _0x2ee33d;}})[_0x6b21('0x45')](function(_0x219340){logger[_0x6b21('0x2a')](_0x6b21('0x4f'),_0x219340);throw _0x219340;});}return _0x2ee33d;})['then'](respondWithResult(_0x2ca3ad,0xc9))['catch'](handleError(_0x2ca3ad,null));};exports[_0x6b21('0x50')]=function(_0x4f4b0c,_0x4685d5){var _0x1f8ae4={'where':{'id':_0x4f4b0c[_0x6b21('0x47')]['id']}},_0x5b6a7d={};_0x5b6a7d[_0x6b21('0x37')]=_[_0x6b21('0x48')](db[_0x6b21('0x2f')][_0x6b21('0x30')]);_0x1f8ae4['attributes']=_[_0x6b21('0x36')](_0x5b6a7d[_0x6b21('0x37')],qs['fields'](_0x4f4b0c[_0x6b21('0x34')][_0x6b21('0x38')]));_0x1f8ae4[_0x6b21('0x39')]=_0x1f8ae4[_0x6b21('0x39')][_0x6b21('0x3a')]?_0x1f8ae4[_0x6b21('0x39')]:_0x5b6a7d[_0x6b21('0x37')];if(_0x4f4b0c[_0x6b21('0x34')][_0x6b21('0x51')]){_0x1f8ae4[_0x6b21('0x43')]=[{'all':!![]}];}_0x1f8ae4=_[_0x6b21('0x40')]({},_0x1f8ae4,_0x4f4b0c['options']);return db['Dashboard'][_0x6b21('0x49')](_0x1f8ae4)[_0x6b21('0x24')](handleEntityNotFound(_0x4685d5,null))[_0x6b21('0x24')](function(_0x3f14ce){if(_0x3f14ce){var _0x5df064=_0x3f14ce['get']({'plain':!![]});_0x5df064=qs['omit'](_0x5df064,['id','createdAt',_0x6b21('0x52')]);_0x4f4b0c['body']=_[_0x6b21('0x53')](_0x4f4b0c[_0x6b21('0x54')],['id',_0x6b21('0x55'),_0x6b21('0x52')]);return db[_0x6b21('0x2f')][_0x6b21('0x4e')](_[_0x6b21('0x40')](_0x5df064,_0x4f4b0c[_0x6b21('0x54')]),{'include':_0x4f4b0c[_0x6b21('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x6b21('0x24')](function(_0x5003f8){var _0x2212cf=_0x4f4b0c[_0x6b21('0x4a')][_0x6b21('0x26')]({'plain':!![]});if(!_0x2212cf)throw new Error(_0x6b21('0x4b'));if(_0x2212cf['role']===_0x6b21('0x4a')){var _0x4489f2=_0x5003f8[_0x6b21('0x26')]({'plain':!![]});var _0x5347b8=_0x6b21('0x27');return db[_0x6b21('0x4d')][_0x6b21('0x49')]({'where':{'name':_0x5347b8,'userProfileId':_0x2212cf[_0x6b21('0x56')]},'raw':!![]})['then'](function(_0x7ed4ed){if(_0x7ed4ed&&_0x7ed4ed[_0x6b21('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x4489f2['name'],'resourceId':_0x4489f2['id'],'type':_0x7ed4ed['name'],'sectionId':_0x7ed4ed['id']},{})[_0x6b21('0x24')](function(){return _0x5003f8;});}else{return _0x5003f8;}})[_0x6b21('0x45')](function(_0x153314){logger[_0x6b21('0x2a')](_0x6b21('0x4f'),_0x153314);throw _0x153314;});}return _0x5003f8;});}})[_0x6b21('0x24')](respondWithResult(_0x4685d5,0xc9))['catch'](handleError(_0x4685d5,null));};exports[_0x6b21('0x58')]=function(_0x5405a3,_0x3453b7){if(_0x5405a3['body']['id']){delete _0x5405a3[_0x6b21('0x54')]['id'];}return db[_0x6b21('0x2f')]['find']({'where':{'id':_0x5405a3[_0x6b21('0x47')]['id']}})[_0x6b21('0x24')](handleEntityNotFound(_0x3453b7,null))[_0x6b21('0x24')](saveUpdates(_0x5405a3[_0x6b21('0x54')],null))[_0x6b21('0x24')](respondWithResult(_0x3453b7,null))[_0x6b21('0x45')](handleError(_0x3453b7,null));};exports[_0x6b21('0x25')]=function(_0x3e3ec4,_0x49b644){return db[_0x6b21('0x2f')][_0x6b21('0x49')]({'where':{'id':_0x3e3ec4[_0x6b21('0x47')]['id']}})[_0x6b21('0x24')](handleEntityNotFound(_0x49b644,null))[_0x6b21('0x24')](removeEntity(_0x49b644,null))[_0x6b21('0x45')](handleError(_0x49b644,null));};function widgetAttributes(_0x4f413c){try{switch(_0x4f413c[_0x6b21('0x32')]){case _0x6b21('0x59'):return[{'name':_0x6b21('0x5a'),'value':_0x4f413c[_0x6b21('0x5a')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c['attrs'][0x0][_0x6b21('0x5c')]:undefined)||_0x6b21('0x5d')}];case _0x6b21('0x5e'):return[{'name':_0x6b21('0x5f'),'value':_0x4f413c[_0x6b21('0x5f')]||(_0x4f413c['attrs']&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0][_0x6b21('0x5c')]:undefined)||''}];case'clock':return[{'name':_0x6b21('0x60'),'value':_0x4f413c['attrHourFormat']||(_0x4f413c['attrs']&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0][_0x6b21('0x5c')]:undefined)||_0x6b21('0x61')},{'name':_0x6b21('0x62'),'value':_0x4f413c[_0x6b21('0x62')]||(_0x4f413c['attrs']&&_0x4f413c[_0x6b21('0x5b')][0x1]?_0x4f413c[_0x6b21('0x5b')][0x1]['value']:undefined)||_0x6b21('0x63')},{'name':_0x6b21('0x64'),'value':_0x4f413c[_0x6b21('0x64')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x2]?_0x4f413c[_0x6b21('0x5b')][0x2][_0x6b21('0x5c')]:undefined)||0xc}];case _0x6b21('0x65'):return[{'name':'attrMetric','value':_0x4f413c['attrMetric']||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0][_0x6b21('0x5c')]:undefined)||_0x6b21('0x66')},{'name':'attrVoiceQueues','value':_0x4f413c[_0x6b21('0x67')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x1]?_0x4f413c[_0x6b21('0x5b')][0x1][_0x6b21('0x5c')]:undefined)||[]},{'name':_0x6b21('0x64'),'value':_0x4f413c[_0x6b21('0x64')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c['attrs'][0x2]?_0x4f413c[_0x6b21('0x5b')][0x2][_0x6b21('0x5c')]:undefined)||0x14}];case _0x6b21('0x68'):case _0x6b21('0x69'):return[{'name':'attrSerie1','value':_0x4f413c[_0x6b21('0x6a')]||(_0x4f413c['attrs']&&_0x4f413c['attrs'][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0][_0x6b21('0x5c')]:undefined)||_0x6b21('0x66')},{'name':_0x6b21('0x6b'),'value':_0x4f413c[_0x6b21('0x6b')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x1]?_0x4f413c[_0x6b21('0x5b')][0x1][_0x6b21('0x5c')]:undefined)||null},{'name':_0x6b21('0x6c'),'value':_0x4f413c['attrSerie3']||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x2]?_0x4f413c['attrs'][0x2][_0x6b21('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x4f413c[_0x6b21('0x67')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x3]?_0x4f413c['attrs'][0x3][_0x6b21('0x5c')]:undefined)||[]}];case'web-report':return[{'name':_0x6b21('0x6d'),'type':_0x4f413c[_0x6b21('0x6e')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0][_0x6b21('0x32')]:undefined)||null,'value':_0x4f413c[_0x6b21('0x6d')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x0]?_0x4f413c[_0x6b21('0x5b')][0x0]['value']:undefined)||null},{'name':_0x6b21('0x6f'),'value':_0x4f413c[_0x6b21('0x6f')]||(_0x4f413c[_0x6b21('0x5b')]&&_0x4f413c[_0x6b21('0x5b')][0x1]?_0x4f413c[_0x6b21('0x5b')][0x1][_0x6b21('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x6c4da8){logger[_0x6b21('0x2a')]('widgetAttributes:\x20%s',JSON[_0x6b21('0x70')](_0x6c4da8));return[];}}exports[_0x6b21('0x71')]=function(_0x39caf1,_0x5ce400,_0x299ac7){if(_0x39caf1[_0x6b21('0x54')]['id']){delete _0x39caf1[_0x6b21('0x54')]['id'];}return db[_0x6b21('0x2f')][_0x6b21('0x49')]({'where':{'id':_0x39caf1['params']['id']}})[_0x6b21('0x24')](handleEntityNotFound(_0x5ce400,null))['then'](function(_0x4d3ca5){if(_0x4d3ca5){_0x39caf1['body'][_0x6b21('0x72')]=_0x4d3ca5['id'];_0x39caf1[_0x6b21('0x54')][_0x6b21('0x5b')]=widgetAttributes(_0x39caf1[_0x6b21('0x54')]);return db[_0x6b21('0x73')][_0x6b21('0x4e')](_0x39caf1[_0x6b21('0x54')]);}})['then'](respondWithResult(_0x5ce400,null))[_0x6b21('0x45')](handleError(_0x5ce400,null));};exports[_0x6b21('0x74')]=function(_0x35d05a,_0x39386e,_0x355a8f){var _0x211dd1={};var _0x526320={};var _0x2264b6;var _0xc994ed;return db[_0x6b21('0x2f')][_0x6b21('0x75')]({'where':{'id':_0x35d05a['params']['id']}})[_0x6b21('0x24')](handleEntityNotFound(_0x39386e,null))[_0x6b21('0x24')](function(_0x2e4f91){if(_0x2e4f91){_0x2264b6=_0x2e4f91;_0x526320[_0x6b21('0x37')]=_[_0x6b21('0x48')](db[_0x6b21('0x73')]['rawAttributes']);_0x526320[_0x6b21('0x34')]=_[_0x6b21('0x48')](_0x35d05a[_0x6b21('0x34')]);_0x526320['filters']=_[_0x6b21('0x36')](_0x526320[_0x6b21('0x37')],_0x526320[_0x6b21('0x34')]);_0x211dd1['attributes']=_['intersection'](_0x526320[_0x6b21('0x37')],qs['fields'](_0x35d05a[_0x6b21('0x34')][_0x6b21('0x38')]));_0x211dd1[_0x6b21('0x39')]=_0x211dd1[_0x6b21('0x39')][_0x6b21('0x3a')]?_0x211dd1[_0x6b21('0x39')]:_0x526320[_0x6b21('0x37')];_0x211dd1['order']=qs[_0x6b21('0x3d')](_0x35d05a[_0x6b21('0x34')][_0x6b21('0x3d')]);_0x211dd1[_0x6b21('0x3e')]=qs[_0x6b21('0x35')](_['pick'](_0x35d05a[_0x6b21('0x34')],_0x526320['filters']));if(_0x35d05a[_0x6b21('0x34')][_0x6b21('0x3f')]){_0x211dd1[_0x6b21('0x3e')]=_[_0x6b21('0x40')](_0x211dd1[_0x6b21('0x3e')],{'$or':_[_0x6b21('0x2e')](_0x211dd1[_0x6b21('0x39')],function(_0x1ba0b9){var _0x447a69={};_0x447a69[_0x1ba0b9]={'$like':'%'+_0x35d05a[_0x6b21('0x34')][_0x6b21('0x3f')]+'%'};return _0x447a69;})});}_0x211dd1=_[_0x6b21('0x40')]({},_0x211dd1,_0x35d05a[_0x6b21('0x42')]);return _0x2264b6[_0x6b21('0x74')](_0x211dd1);}})[_0x6b21('0x24')](function(_0x56f1d8){if(_0x56f1d8){_0xc994ed=_0x56f1d8[_0x6b21('0x3a')];if(!_0x35d05a['query'][_0x6b21('0x3b')]('nolimit')){_0x211dd1[_0x6b21('0x1e')]=qs[_0x6b21('0x1e')](_0x35d05a['query'][_0x6b21('0x1e')]);_0x211dd1[_0x6b21('0x1c')]=qs['offset'](_0x35d05a[_0x6b21('0x34')][_0x6b21('0x1c')]);}return _0x2264b6[_0x6b21('0x74')](_0x211dd1);}})['then'](function(_0x12616f){if(_0x12616f){return _0x12616f?{'count':_0xc994ed,'rows':_0x12616f}:null;}})[_0x6b21('0x24')](respondWithResult(_0x39386e,null))[_0x6b21('0x45')](handleError(_0x39386e,null));};
\ No newline at end of file
index 3a8d15c..ad03ad0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x23da4d,_0x63498c){var _0x4ae55=function(_0x323d75){while(--_0x323d75){_0x23da4d['push'](_0x23da4d['shift']());}};_0x4ae55(++_0x63498c);}(_0x9f02,0x68));var _0x29f0=function(_0x1ded00,_0x4973f1){_0x1ded00=_0x1ded00-0x0;var _0x40e2b5=_0x9f02[_0x1ded00];return _0x40e2b5;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){DashboardEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);DashboardEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];Dashboard[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0x19c9=['Dashboard','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x34bd72,_0x271f9b){var _0x39c88e=function(_0x125013){while(--_0x125013){_0x34bd72['push'](_0x34bd72['shift']());}};_0x39c88e(++_0x271f9b);}(_0x19c9,0x1bf));var _0x919c=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x19c9[_0x13b8f3];return _0x1a6d06;};'use strict';var EventEmitter=require(_0x919c('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x919c('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x919c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x919c('0x3'),'afterDestroy':_0x919c('0x4')};function emitEvent(_0x531acd){return function(_0x30f4fe,_0x43e440,_0xe44b42){DashboardEvents['emit'](_0x531acd+':'+_0x30f4fe['id'],_0x30f4fe);DashboardEvents[_0x919c('0x5')](_0x531acd,_0x30f4fe);_0xe44b42(null);};}for(var e in events){if(events[_0x919c('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x919c('0x7')]=DashboardEvents;
\ No newline at end of file
index 99ac671..6460be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86e6=['request-promise','path','rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x86e6,0x1c2));var _0x686e=function(_0x5484c9,_0x4f3d11){_0x5484c9=_0x5484c9-0x0;var _0x4a2e78=_0x86e6[_0x5484c9];return _0x4a2e78;};'use strict';var _=require(_0x686e('0x0'));var util=require('util');var logger=require(_0x686e('0x1'))(_0x686e('0x2'));var moment=require(_0x686e('0x3'));var BPromise=require(_0x686e('0x4'));var rp=require(_0x686e('0x5'));var fs=require('fs');var path=require(_0x686e('0x6'));var rimraf=require(_0x686e('0x7'));var config=require('../../config/environment');var attributes=require(_0x686e('0x8'));module[_0x686e('0x9')]=function(_0x148e6d,_0x5672cb){return _0x148e6d[_0x686e('0xa')](_0x686e('0xb'),attributes,{'tableName':_0x686e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xecd8=['define','Dashboard','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1f109a,_0x1e8918){var _0x5f82cc=function(_0x293042){while(--_0x293042){_0x1f109a['push'](_0x1f109a['shift']());}};_0x5f82cc(++_0x1e8918);}(_0xecd8,0x6e));var _0x8ecd=function(_0x4d8213,_0x5e36d2){_0x4d8213=_0x4d8213-0x0;var _0x525f42=_0xecd8[_0x4d8213];return _0x525f42;};'use strict';var _=require(_0x8ecd('0x0'));var util=require('util');var logger=require(_0x8ecd('0x1'))(_0x8ecd('0x2'));var moment=require(_0x8ecd('0x3'));var BPromise=require(_0x8ecd('0x4'));var rp=require(_0x8ecd('0x5'));var fs=require('fs');var path=require(_0x8ecd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module['exports']=function(_0x2f993e,_0x4a866e){return _0x2f993e[_0x8ecd('0x7')](_0x8ecd('0x8'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index efbe0ad..a90b601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a37=['http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xa0a3c5,_0x4c4618){var _0x42f6bd=function(_0x56f56a){while(--_0x56f56a){_0xa0a3c5['push'](_0xa0a3c5['shift']());}};_0x42f6bd(++_0x4c4618);}(_0x2a37,0xcf));var _0x72a3=function(_0x20fcd4,_0xcbea7){_0x20fcd4=_0x20fcd4-0x0;var _0x432eaa=_0x2a37[_0x20fcd4];return _0x432eaa;};'use strict';var _=require(_0x72a3('0x0'));var util=require(_0x72a3('0x1'));var moment=require(_0x72a3('0x2'));var BPromise=require(_0x72a3('0x3'));var rs=require(_0x72a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x72a3('0x6'))(_0x72a3('0x7'));var config=require('../../config/environment');var jayson=require(_0x72a3('0x8'));var client=jayson['client'][_0x72a3('0x9')]({'port':0x232a});config[_0x72a3('0xa')]=_[_0x72a3('0xb')](config[_0x72a3('0xa')],{'host':_0x72a3('0xc'),'port':0x18eb});var socket=require(_0x72a3('0xd'))(new Redis(config[_0x72a3('0xa')]));require(_0x72a3('0xe'))[_0x72a3('0xf')](socket);function respondWithRpcPromise(_0xc50d48,_0x32eea0,_0xa73a1d){return new BPromise(function(_0x46a106,_0x34fdd0){return client[_0x72a3('0x10')](_0xc50d48,_0xa73a1d)[_0x72a3('0x11')](function(_0x465a82){logger[_0x72a3('0x12')](_0x72a3('0x13'),_0x32eea0,_0x72a3('0x14'));logger['debug'](_0x72a3('0x15'),_0x32eea0,'request\x20sent',JSON[_0x72a3('0x16')](_0x465a82));if(_0x465a82[_0x72a3('0x17')]){if(_0x465a82[_0x72a3('0x17')][_0x72a3('0x18')]===0x1f4){logger[_0x72a3('0x17')]('Dashboard,\x20%s,\x20%s',_0x32eea0,_0x465a82[_0x72a3('0x17')]['message']);return _0x34fdd0(_0x465a82['error'][_0x72a3('0x19')]);}logger[_0x72a3('0x17')](_0x72a3('0x13'),_0x32eea0,_0x465a82['error'][_0x72a3('0x19')]);return _0x46a106(_0x465a82['error'][_0x72a3('0x19')]);}else{logger['info'](_0x72a3('0x13'),_0x32eea0,_0x72a3('0x14'));_0x46a106(_0x465a82[_0x72a3('0x1a')][_0x72a3('0x19')]);}})['catch'](function(_0xd407ae){logger[_0x72a3('0x17')](_0x72a3('0x13'),_0x32eea0,_0xd407ae);_0x34fdd0(_0xd407ae);});});}
\ No newline at end of file
+var _0xf8fb=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0xf8fb,0x1b3));var _0xbf8f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf8fb[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbf8f('0x0'));var BPromise=require('bluebird');var rs=require(_0xbf8f('0x1'));var fs=require('fs');var Redis=require(_0xbf8f('0x2'));var db=require(_0xbf8f('0x3'))['db'];var utils=require(_0xbf8f('0x4'));var logger=require('../../config/logger')(_0xbf8f('0x5'));var config=require(_0xbf8f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbf8f('0x7')][_0xbf8f('0x8')]({'port':0x232a});config[_0xbf8f('0x9')]=_['defaults'](config[_0xbf8f('0x9')],{'host':_0xbf8f('0xa'),'port':0x18eb});var socket=require(_0xbf8f('0xb'))(new Redis(config[_0xbf8f('0x9')]));require(_0xbf8f('0xc'))[_0xbf8f('0xd')](socket);function respondWithRpcPromise(_0x168ca3,_0x409121,_0x507fb0){return new BPromise(function(_0x363e65,_0x161508){return client['request'](_0x168ca3,_0x507fb0)['then'](function(_0x4420bc){logger['info'](_0xbf8f('0xe'),_0x409121,_0xbf8f('0xf'));logger['debug'](_0xbf8f('0x10'),_0x409121,_0xbf8f('0xf'),JSON[_0xbf8f('0x11')](_0x4420bc));if(_0x4420bc['error']){if(_0x4420bc[_0xbf8f('0x12')][_0xbf8f('0x13')]===0x1f4){logger[_0xbf8f('0x12')]('Dashboard,\x20%s,\x20%s',_0x409121,_0x4420bc[_0xbf8f('0x12')]['message']);return _0x161508(_0x4420bc[_0xbf8f('0x12')][_0xbf8f('0x14')]);}logger['error'](_0xbf8f('0xe'),_0x409121,_0x4420bc[_0xbf8f('0x12')][_0xbf8f('0x14')]);return _0x363e65(_0x4420bc[_0xbf8f('0x12')][_0xbf8f('0x14')]);}else{logger['info'](_0xbf8f('0xe'),_0x409121,_0xbf8f('0xf'));_0x363e65(_0x4420bc[_0xbf8f('0x15')][_0xbf8f('0x14')]);}})[_0xbf8f('0x16')](function(_0x279679){logger[_0xbf8f('0x12')](_0xbf8f('0xe'),_0x409121,_0x279679);_0x161508(_0x279679);});});}
\ No newline at end of file
index d74436f..5f0a911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x117a=['update','emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove'];(function(_0x2b7389,_0x58311b){var _0xe5d9da=function(_0xecec75){while(--_0xecec75){_0x2b7389['push'](_0x2b7389['shift']());}};_0xe5d9da(++_0x58311b);}(_0x117a,0x126));var _0xa117=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0x117a[_0x2e76a7];return _0x454cde;};'use strict';var DashboardEvents=require(_0xa117('0x0'));var events=[_0xa117('0x1'),_0xa117('0x2'),_0xa117('0x3')];function createListener(_0x42101e,_0x1a4646){return function(_0x2329a3){_0x1a4646[_0xa117('0x4')](_0x42101e,_0x2329a3);};}function removeListener(_0x1d2369,_0x4ad5c6){return function(){DashboardEvents[_0xa117('0x5')](_0x1d2369,_0x4ad5c6);};}exports[_0xa117('0x6')]=function(_0x208de8){for(var _0x4ee0f6=0x0,_0x38e2bf=events[_0xa117('0x7')];_0x4ee0f6<_0x38e2bf;_0x4ee0f6++){var _0x29b3a2=events[_0x4ee0f6];var _0x85dae1=createListener(_0xa117('0x8')+_0x29b3a2,_0x208de8);DashboardEvents['on'](_0x29b3a2,_0x85dae1);}};
\ No newline at end of file
+var _0x62bd=['removeListener','register','length','dashboard:','./dashboard.events','remove','update'];(function(_0x12a0c0,_0x578d90){var _0x22b605=function(_0x531ed5){while(--_0x531ed5){_0x12a0c0['push'](_0x12a0c0['shift']());}};_0x22b605(++_0x578d90);}(_0x62bd,0x89));var _0xd62b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62bd[_0x14add3];return _0x4a174f;};'use strict';var DashboardEvents=require(_0xd62b('0x0'));var events=['save',_0xd62b('0x1'),_0xd62b('0x2')];function createListener(_0x3358e9,_0x285b36){return function(_0x2961be){_0x285b36['emit'](_0x3358e9,_0x2961be);};}function removeListener(_0x20038b,_0x14a1f6){return function(){DashboardEvents[_0xd62b('0x3')](_0x20038b,_0x14a1f6);};}exports[_0xd62b('0x4')]=function(_0x1835e8){for(var _0x448af9=0x0,_0x1b02bb=events[_0xd62b('0x5')];_0x448af9<_0x1b02bb;_0x448af9++){var _0x1108b7=events[_0x448af9];var _0x402de9=createListener(_0xd62b('0x6')+_0x1108b7,_0x1835e8);DashboardEvents['on'](_0x1108b7,_0x402de9);}};
\ No newline at end of file
index 6a12f67..f7960c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd98a=['get','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','index'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0xd98a,0xcd));var _0xad98=function(_0x4c0744,_0x2d6c65){_0x4c0744=_0x4c0744-0x0;var _0xda5533=_0xd98a[_0x4c0744];return _0xda5533;};'use strict';var multer=require(_0xad98('0x0'));var util=require('util');var path=require(_0xad98('0x1'));var timeout=require(_0xad98('0x2'));var express=require(_0xad98('0x3'));var router=express[_0xad98('0x4')]();var fs_extra=require(_0xad98('0x5'));var auth=require(_0xad98('0x6'));var interaction=require(_0xad98('0x7'));var config=require(_0xad98('0x8'));var controller=require(_0xad98('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xad98('0xa')]);router[_0xad98('0xb')]('/:id',auth[_0xad98('0xc')](),controller[_0xad98('0xd')]);router[_0xad98('0xb')](_0xad98('0xe'),auth[_0xad98('0xc')](),controller[_0xad98('0xf')]);router['post']('/',auth[_0xad98('0xc')](),controller['create']);router[_0xad98('0x10')](_0xad98('0x11'),auth[_0xad98('0xc')](),controller[_0xad98('0x12')]);router[_0xad98('0x10')]('/:id/items',auth['isAuthenticated'](),controller[_0xad98('0x13')]);router[_0xad98('0x14')](_0xad98('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xad98('0x16')](_0xad98('0x15'),auth[_0xad98('0xc')](),controller[_0xad98('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xd137=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','/:id/clone','clone','put','update','multer','util','path','Router','fs-extra'];(function(_0x574f07,_0x354d5b){var _0x31b35e=function(_0x54db50){while(--_0x54db50){_0x574f07['push'](_0x574f07['shift']());}};_0x31b35e(++_0x354d5b);}(_0xd137,0x64));var _0x7d13=function(_0xa38c70,_0x46d6cb){_0xa38c70=_0xa38c70-0x0;var _0x5e706f=_0xd137[_0xa38c70];return _0x5e706f;};'use strict';var multer=require(_0x7d13('0x0'));var util=require(_0x7d13('0x1'));var path=require(_0x7d13('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7d13('0x3')]();var fs_extra=require(_0x7d13('0x4'));var auth=require(_0x7d13('0x5'));var interaction=require(_0x7d13('0x6'));var config=require(_0x7d13('0x7'));var controller=require(_0x7d13('0x8'));router[_0x7d13('0x9')]('/',auth[_0x7d13('0xa')](),controller[_0x7d13('0xb')]);router[_0x7d13('0x9')](_0x7d13('0xc'),auth[_0x7d13('0xa')](),controller[_0x7d13('0xd')]);router[_0x7d13('0x9')](_0x7d13('0xe'),auth[_0x7d13('0xa')](),controller[_0x7d13('0xf')]);router[_0x7d13('0x10')]('/',auth[_0x7d13('0xa')](),controller['create']);router[_0x7d13('0x10')](_0x7d13('0x11'),auth[_0x7d13('0xa')](),controller[_0x7d13('0x12')]);router[_0x7d13('0x10')](_0x7d13('0xe'),auth[_0x7d13('0xa')](),controller['addItem']);router[_0x7d13('0x13')](_0x7d13('0xc'),auth[_0x7d13('0xa')](),controller[_0x7d13('0x14')]);router['delete'](_0x7d13('0xc'),auth[_0x7d13('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fa70c0c..896aad9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','exports','STRING','TEXT','long'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x1623,0xab));var _0x3162=function(_0x2222db,_0x552930){_0x2222db=_0x2222db-0x0;var _0x3d0042=_0x1623[_0x2222db];return _0x3d0042;};'use strict';var Sequelize=require(_0x3162('0x0'));var squel=require('squel');var _=require('lodash');module[_0x3162('0x1')]={'title':{'type':Sequelize[_0x3162('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3162('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3162('0x3')](_0x3162('0x4')),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x3162('0x5')));}catch(_0x4b77c4){return[];}},'set':function(_0x1b55f2){try{this[_0x3162('0x6')]('attrs',JSON[_0x3162('0x7')](_0x1b55f2));}catch(_0x2dc07e){this[_0x3162('0x6')](_0x3162('0x5'),JSON[_0x3162('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3162('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3162('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3162('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3162('0x2')],'allowNull':![],'defaultValue':_0x3162('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3162('0x2')]},'titleFontSize':{'type':Sequelize[_0x3162('0x8')],'defaultValue':0xc}};
\ No newline at end of file
+var _0xe3da=['squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x2742e0,_0x1a6af2){var _0x13ffa3=function(_0x25cf79){while(--_0x25cf79){_0x2742e0['push'](_0x2742e0['shift']());}};_0x13ffa3(++_0x1a6af2);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xae3d('0x0'));var squel=require(_0xae3d('0x1'));var _=require(_0xae3d('0x2'));module[_0xae3d('0x3')]={'title':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xae3d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xae3d('0x5')](_0xae3d('0x6')),'get':function(){try{return JSON[_0xae3d('0x7')](this[_0xae3d('0x8')](_0xae3d('0x9')));}catch(_0x26282d){return[];}},'set':function(_0xa9a1a){try{this[_0xae3d('0xa')](_0xae3d('0x9'),JSON[_0xae3d('0xb')](_0xa9a1a));}catch(_0x583b98){this[_0xae3d('0xa')](_0xae3d('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xae3d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xae3d('0xc')]},'col':{'type':Sequelize[_0xae3d('0xc')]},'background':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':_0xae3d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xae3d('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xae3d('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index 05b8db1..0b420d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa243=['sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge','options','DashboardItem','find','catch','iframe','attrUrl','attrs','https://','attrPath','value','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x5ee800,_0x2c551f){var _0x386ba6=function(_0x304227){while(--_0x304227){_0x5ee800['push'](_0x5ee800['shift']());}};_0x386ba6(++_0x2c551f);}(_0xa243,0x19d));var _0x3a24=function(_0x48a057,_0x497e13){_0x48a057=_0x48a057-0x0;var _0x1a5c74=_0xa243[_0x48a057];return _0x1a5c74;};'use strict';var emlformat=require(_0x3a24('0x0'));var rimraf=require(_0x3a24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a24('0x2'));var rp=require(_0x3a24('0x3'));var moment=require('moment');var BPromise=require(_0x3a24('0x4'));var Mustache=require(_0x3a24('0x5'));var util=require('util');var path=require(_0x3a24('0x6'));var sox=require('sox');var csv=require(_0x3a24('0x7'));var ejs=require(_0x3a24('0x8'));var fs=require('fs');var fs_extra=require(_0x3a24('0x9'));var _=require('lodash');var squel=require(_0x3a24('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a24('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3a24('0xc'));var Papa=require(_0x3a24('0xd'));var Redis=require('ioredis');var authService=require(_0x3a24('0xe'));var qs=require(_0x3a24('0xf'));var as=require(_0x3a24('0x10'));var hardwareService=require(_0x3a24('0x11'));var logger=require(_0x3a24('0x12'))(_0x3a24('0x13'));var utils=require(_0x3a24('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3a24('0x15'))['db'];config[_0x3a24('0x16')]=_[_0x3a24('0x17')](config[_0x3a24('0x16')],{'host':_0x3a24('0x18'),'port':0x18eb});var socket=require(_0x3a24('0x19'))(new Redis(config[_0x3a24('0x16')]));require('./dashboardItem.socket')[_0x3a24('0x1a')](socket);function respondWithStatusCode(_0x35a279,_0xfeaaa4){_0xfeaaa4=_0xfeaaa4||0xcc;return function(_0x3410f0){if(_0x3410f0){return _0x35a279[_0x3a24('0x1b')](_0xfeaaa4);}return _0x35a279['status'](_0xfeaaa4)[_0x3a24('0x1c')]();};}function respondWithResult(_0x1875e0,_0x3222c6){_0x3222c6=_0x3222c6||0xc8;return function(_0xd3c583){if(_0xd3c583){return _0x1875e0[_0x3a24('0x1d')](_0x3222c6)[_0x3a24('0x1e')](_0xd3c583);}};}function respondWithFilteredResult(_0x12557c,_0x2d40a9){return function(_0x1015ba){if(_0x1015ba){var _0x2fe169=typeof _0x2d40a9['offset']===_0x3a24('0x1f')&&typeof _0x2d40a9['limit']===_0x3a24('0x1f');var _0xb2da14=_0x1015ba[_0x3a24('0x20')];var _0xed0421=_0x2fe169?0x0:_0x2d40a9[_0x3a24('0x21')];var _0x157d32=_0x2fe169?_0x1015ba[_0x3a24('0x20')]:_0x2d40a9[_0x3a24('0x21')]+_0x2d40a9[_0x3a24('0x22')];var _0x3d02a8;if(_0x157d32>=_0xb2da14){_0x157d32=_0xb2da14;_0x3d02a8=0xc8;}else{_0x3d02a8=0xce;}_0x12557c[_0x3a24('0x1d')](_0x3d02a8);return _0x12557c[_0x3a24('0x23')](_0x3a24('0x24'),_0xed0421+'-'+_0x157d32+'/'+_0xb2da14)[_0x3a24('0x1e')](_0x1015ba);}return null;};}function patchUpdates(_0x90bb2a){return function(_0x261ee2){try{jsonpatch[_0x3a24('0x25')](_0x261ee2,_0x90bb2a,!![]);}catch(_0x3b15db){return BPromise[_0x3a24('0x26')](_0x3b15db);}return _0x261ee2[_0x3a24('0x27')]();};}function saveUpdates(_0x390a54,_0x5ac14b){return function(_0x35de7a){if(_0x35de7a){return _0x35de7a['update'](_0x390a54)[_0x3a24('0x28')](function(_0x4e9587){return _0x4e9587;});}return null;};}function removeEntity(_0x3f8d7e,_0x57853b){return function(_0x357861){if(_0x357861){return _0x357861['destroy']()[_0x3a24('0x28')](function(){_0x3f8d7e[_0x3a24('0x1d')](0xcc)[_0x3a24('0x1c')]();});}};}function handleEntityNotFound(_0x4d18aa,_0x20c35a){return function(_0x193f72){if(!_0x193f72){_0x4d18aa['sendStatus'](0x194);}return _0x193f72;};}function handleError(_0x855e7e,_0x26dc86){_0x26dc86=_0x26dc86||0x1f4;return function(_0x29b356){logger[_0x3a24('0x29')](_0x29b356[_0x3a24('0x2a')]);if(_0x29b356[_0x3a24('0x2b')]){delete _0x29b356[_0x3a24('0x2b')];}_0x855e7e[_0x3a24('0x1d')](_0x26dc86)['send'](_0x29b356);};}exports[_0x3a24('0x2c')]=function(_0x1b0f60,_0x378571){var _0x3f481a={'raw':![],'where':{'id':_0x1b0f60[_0x3a24('0x2d')]['id']}},_0x2e40ec={};_0x2e40ec[_0x3a24('0x2e')]=_[_0x3a24('0x2f')](db['DashboardItem'][_0x3a24('0x30')]);_0x2e40ec['query']=_[_0x3a24('0x2f')](_0x1b0f60[_0x3a24('0x31')]);_0x2e40ec[_0x3a24('0x32')]=_[_0x3a24('0x33')](_0x2e40ec[_0x3a24('0x2e')],_0x2e40ec['query']);_0x3f481a[_0x3a24('0x34')]=_[_0x3a24('0x33')](_0x2e40ec[_0x3a24('0x2e')],qs['fields'](_0x1b0f60[_0x3a24('0x31')]['fields']));_0x3f481a[_0x3a24('0x34')]=_0x3f481a[_0x3a24('0x34')][_0x3a24('0x35')]?_0x3f481a[_0x3a24('0x34')]:_0x2e40ec[_0x3a24('0x2e')];if(_0x1b0f60[_0x3a24('0x31')][_0x3a24('0x36')]){_0x3f481a[_0x3a24('0x37')]=[{'all':!![]}];}_0x3f481a=_[_0x3a24('0x38')]({},_0x3f481a,_0x1b0f60[_0x3a24('0x39')]);return db[_0x3a24('0x3a')][_0x3a24('0x3b')](_0x3f481a)[_0x3a24('0x28')](handleEntityNotFound(_0x378571,null))['then'](respondWithResult(_0x378571,null))[_0x3a24('0x3c')](handleError(_0x378571,null));};exports['destroy']=function(_0xe162e8,_0x4d14b2){return db['DashboardItem']['find']({'where':{'id':_0xe162e8[_0x3a24('0x2d')]['id']}})[_0x3a24('0x28')](handleEntityNotFound(_0x4d14b2,null))[_0x3a24('0x28')](removeEntity(_0x4d14b2,null))[_0x3a24('0x3c')](handleError(_0x4d14b2,null));};function widgetAttributes(_0x1f3bcc){try{switch(_0x1f3bcc['type']){case _0x3a24('0x3d'):return[{'name':_0x3a24('0x3e'),'value':_0x1f3bcc[_0x3a24('0x3e')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||_0x3a24('0x40')}];case'custom':return[{'name':_0x3a24('0x41'),'value':_0x1f3bcc[_0x3a24('0x41')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0][_0x3a24('0x42')]:undefined)||''}];case'clock':return[{'name':_0x3a24('0x43'),'value':_0x1f3bcc[_0x3a24('0x43')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0][_0x3a24('0x42')]:undefined)||_0x3a24('0x44')},{'name':_0x3a24('0x45'),'value':_0x1f3bcc[_0x3a24('0x45')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc['attrs'][0x1]['value']:undefined)||_0x3a24('0x46')},{'name':_0x3a24('0x47'),'value':_0x1f3bcc['attrFontSize']||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2][_0x3a24('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x3a24('0x48'),'value':_0x1f3bcc[_0x3a24('0x48')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||_0x3a24('0x49')},{'name':'attrVoiceQueues','value':_0x1f3bcc[_0x3a24('0x4a')]||(_0x1f3bcc['attrs']&&_0x1f3bcc['attrs'][0x1]?_0x1f3bcc[_0x3a24('0x3f')][0x1]['value']:undefined)||[]},{'name':_0x3a24('0x47'),'value':_0x1f3bcc[_0x3a24('0x47')]||(_0x1f3bcc['attrs']&&_0x1f3bcc['attrs'][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2]['value']:undefined)||0x14}];case _0x3a24('0x4b'):case _0x3a24('0x4c'):return[{'name':_0x3a24('0x4d'),'value':_0x1f3bcc[_0x3a24('0x4d')]||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc['attrs'][0x0]['value']:undefined)||_0x3a24('0x49')},{'name':'attrSerie2','value':_0x1f3bcc[_0x3a24('0x4e')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc[_0x3a24('0x3f')][0x1][_0x3a24('0x42')]:undefined)||null},{'name':_0x3a24('0x4f'),'value':_0x1f3bcc['attrSerie3']||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x2]?_0x1f3bcc[_0x3a24('0x3f')][0x2]['value']:undefined)||null},{'name':_0x3a24('0x4a'),'value':_0x1f3bcc[_0x3a24('0x4a')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x3]?_0x1f3bcc[_0x3a24('0x3f')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x1f3bcc[_0x3a24('0x50')]||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc['attrs'][0x0]?_0x1f3bcc['attrs'][0x0][_0x3a24('0x51')]:undefined)||null,'value':_0x1f3bcc['attrReport']||(_0x1f3bcc[_0x3a24('0x3f')]&&_0x1f3bcc[_0x3a24('0x3f')][0x0]?_0x1f3bcc[_0x3a24('0x3f')][0x0]['value']:undefined)||null},{'name':_0x3a24('0x52'),'value':_0x1f3bcc[_0x3a24('0x52')]||(_0x1f3bcc['attrs']&&_0x1f3bcc[_0x3a24('0x3f')][0x1]?_0x1f3bcc['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3270cc){logger[_0x3a24('0x29')](_0x3a24('0x53'),JSON[_0x3a24('0x54')](_0x3270cc));return[];}}exports['create']=function(_0x149c74,_0x1fadae){if(_0x149c74[_0x3a24('0x55')]){_0x149c74[_0x3a24('0x55')]['attrs']=widgetAttributes(_0x149c74[_0x3a24('0x55')]);}return db['DashboardItem'][_0x3a24('0x56')](_0x149c74[_0x3a24('0x55')],{})[_0x3a24('0x28')](respondWithResult(_0x1fadae,0xc9))['catch'](handleError(_0x1fadae,null));};exports[_0x3a24('0x57')]=function(_0x40000f,_0x11d5a7){if(_0x40000f['body']['id']){delete _0x40000f[_0x3a24('0x55')]['id'];}_0x40000f['body'][_0x3a24('0x3f')]=widgetAttributes(_0x40000f[_0x3a24('0x55')]);return db['DashboardItem']['find']({'where':{'id':_0x40000f[_0x3a24('0x2d')]['id']}})[_0x3a24('0x28')](handleEntityNotFound(_0x11d5a7,null))[_0x3a24('0x28')](saveUpdates(_0x40000f['body'],null))['then'](respondWithResult(_0x11d5a7,null))[_0x3a24('0x3c')](handleError(_0x11d5a7,null));};
\ No newline at end of file
+var _0xaedd=['attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','type','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total'];(function(_0x1a410,_0x4e92fe){var _0x1703e9=function(_0x45c235){while(--_0x45c235){_0x1a410['push'](_0x1a410['shift']());}};_0x1703e9(++_0x4e92fe);}(_0xaedd,0x1ef));var _0xdaed=function(_0x2feb9f,_0x24a235){_0x2feb9f=_0x2feb9f-0x0;var _0x11b1a4=_0xaedd[_0x2feb9f];return _0x11b1a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdaed('0x0'));var jsonpatch=require(_0xdaed('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdaed('0x2'));var Mustache=require(_0xdaed('0x3'));var util=require('util');var path=require(_0xdaed('0x4'));var sox=require(_0xdaed('0x5'));var csv=require(_0xdaed('0x6'));var ejs=require(_0xdaed('0x7'));var fs=require('fs');var fs_extra=require(_0xdaed('0x8'));var _=require(_0xdaed('0x9'));var squel=require(_0xdaed('0xa'));var crypto=require(_0xdaed('0xb'));var jsforce=require(_0xdaed('0xc'));var deskjs=require(_0xdaed('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdaed('0xe'));var Papa=require('papaparse');var Redis=require(_0xdaed('0xf'));var authService=require(_0xdaed('0x10'));var qs=require(_0xdaed('0x11'));var as=require(_0xdaed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaed('0x13'))(_0xdaed('0x14'));var utils=require(_0xdaed('0x15'));var config=require(_0xdaed('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdaed('0x17'))['db'];config[_0xdaed('0x18')]=_[_0xdaed('0x19')](config['redis'],{'host':_0xdaed('0x1a'),'port':0x18eb});var socket=require(_0xdaed('0x1b'))(new Redis(config[_0xdaed('0x18')]));require(_0xdaed('0x1c'))['register'](socket);function respondWithStatusCode(_0x57a533,_0x4e1471){_0x4e1471=_0x4e1471||0xcc;return function(_0x516774){if(_0x516774){return _0x57a533[_0xdaed('0x1d')](_0x4e1471);}return _0x57a533['status'](_0x4e1471)[_0xdaed('0x1e')]();};}function respondWithResult(_0x4e9924,_0x4be5db){_0x4be5db=_0x4be5db||0xc8;return function(_0x406589){if(_0x406589){return _0x4e9924[_0xdaed('0x1f')](_0x4be5db)[_0xdaed('0x20')](_0x406589);}};}function respondWithFilteredResult(_0x180d61,_0x2ec070){return function(_0x3f3bb4){if(_0x3f3bb4){var _0xe242b1=typeof _0x2ec070[_0xdaed('0x21')]===_0xdaed('0x22')&&typeof _0x2ec070['limit']===_0xdaed('0x22');var _0x2e5367=_0x3f3bb4[_0xdaed('0x23')];var _0x27de27=_0xe242b1?0x0:_0x2ec070[_0xdaed('0x21')];var _0x309152=_0xe242b1?_0x3f3bb4[_0xdaed('0x23')]:_0x2ec070['offset']+_0x2ec070[_0xdaed('0x24')];var _0x454fad;if(_0x309152>=_0x2e5367){_0x309152=_0x2e5367;_0x454fad=0xc8;}else{_0x454fad=0xce;}_0x180d61['status'](_0x454fad);return _0x180d61[_0xdaed('0x25')](_0xdaed('0x26'),_0x27de27+'-'+_0x309152+'/'+_0x2e5367)['json'](_0x3f3bb4);}return null;};}function patchUpdates(_0x2a9e77){return function(_0x46edb4){try{jsonpatch[_0xdaed('0x27')](_0x46edb4,_0x2a9e77,!![]);}catch(_0x3fe36b){return BPromise[_0xdaed('0x28')](_0x3fe36b);}return _0x46edb4[_0xdaed('0x29')]();};}function saveUpdates(_0x14578d,_0x160603){return function(_0x5cdb33){if(_0x5cdb33){return _0x5cdb33['update'](_0x14578d)[_0xdaed('0x2a')](function(_0xbfeed7){return _0xbfeed7;});}return null;};}function removeEntity(_0x3c284c,_0x5aa141){return function(_0xc395ac){if(_0xc395ac){return _0xc395ac[_0xdaed('0x2b')]()['then'](function(){_0x3c284c[_0xdaed('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f146d,_0x485764){return function(_0x42d915){if(!_0x42d915){_0x1f146d[_0xdaed('0x1d')](0x194);}return _0x42d915;};}function handleError(_0x2f056e,_0x179aa9){_0x179aa9=_0x179aa9||0x1f4;return function(_0x2ac061){logger[_0xdaed('0x2c')](_0x2ac061[_0xdaed('0x2d')]);if(_0x2ac061[_0xdaed('0x2e')]){delete _0x2ac061['name'];}_0x2f056e[_0xdaed('0x1f')](_0x179aa9)[_0xdaed('0x2f')](_0x2ac061);};}exports[_0xdaed('0x30')]=function(_0x1b8626,_0x339ae5){var _0x3926c1={'raw':![],'where':{'id':_0x1b8626[_0xdaed('0x31')]['id']}},_0x3aa14b={};_0x3aa14b[_0xdaed('0x32')]=_[_0xdaed('0x33')](db[_0xdaed('0x34')][_0xdaed('0x35')]);_0x3aa14b[_0xdaed('0x36')]=_[_0xdaed('0x33')](_0x1b8626[_0xdaed('0x36')]);_0x3aa14b[_0xdaed('0x37')]=_['intersection'](_0x3aa14b[_0xdaed('0x32')],_0x3aa14b[_0xdaed('0x36')]);_0x3926c1[_0xdaed('0x38')]=_[_0xdaed('0x39')](_0x3aa14b[_0xdaed('0x32')],qs['fields'](_0x1b8626['query'][_0xdaed('0x3a')]));_0x3926c1[_0xdaed('0x38')]=_0x3926c1[_0xdaed('0x38')][_0xdaed('0x3b')]?_0x3926c1['attributes']:_0x3aa14b[_0xdaed('0x32')];if(_0x1b8626['query'][_0xdaed('0x3c')]){_0x3926c1[_0xdaed('0x3d')]=[{'all':!![]}];}_0x3926c1=_[_0xdaed('0x3e')]({},_0x3926c1,_0x1b8626[_0xdaed('0x3f')]);return db[_0xdaed('0x34')][_0xdaed('0x40')](_0x3926c1)[_0xdaed('0x2a')](handleEntityNotFound(_0x339ae5,null))[_0xdaed('0x2a')](respondWithResult(_0x339ae5,null))[_0xdaed('0x41')](handleError(_0x339ae5,null));};exports['destroy']=function(_0x48d848,_0xff4ea1){return db['DashboardItem'][_0xdaed('0x40')]({'where':{'id':_0x48d848['params']['id']}})['then'](handleEntityNotFound(_0xff4ea1,null))['then'](removeEntity(_0xff4ea1,null))['catch'](handleError(_0xff4ea1,null));};function widgetAttributes(_0x397ec1){try{switch(_0x397ec1['type']){case'iframe':return[{'name':_0xdaed('0x42'),'value':_0x397ec1[_0xdaed('0x42')]||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x0]?_0x397ec1[_0xdaed('0x43')][0x0][_0xdaed('0x44')]:undefined)||_0xdaed('0x45')}];case _0xdaed('0x46'):return[{'name':_0xdaed('0x47'),'value':_0x397ec1[_0xdaed('0x47')]||(_0x397ec1['attrs']&&_0x397ec1['attrs'][0x0]?_0x397ec1[_0xdaed('0x43')][0x0][_0xdaed('0x44')]:undefined)||''}];case _0xdaed('0x48'):return[{'name':_0xdaed('0x49'),'value':_0x397ec1[_0xdaed('0x49')]||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x0]?_0x397ec1[_0xdaed('0x43')][0x0][_0xdaed('0x44')]:undefined)||_0xdaed('0x4a')},{'name':_0xdaed('0x4b'),'value':_0x397ec1[_0xdaed('0x4b')]||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1['attrs'][0x1]?_0x397ec1[_0xdaed('0x43')][0x1][_0xdaed('0x44')]:undefined)||_0xdaed('0x4c')},{'name':_0xdaed('0x4d'),'value':_0x397ec1['attrFontSize']||(_0x397ec1['attrs']&&_0x397ec1[_0xdaed('0x43')][0x2]?_0x397ec1[_0xdaed('0x43')][0x2][_0xdaed('0x44')]:undefined)||0xc}];case _0xdaed('0x4e'):return[{'name':_0xdaed('0x4f'),'value':_0x397ec1['attrMetric']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x0]?_0x397ec1[_0xdaed('0x43')][0x0][_0xdaed('0x44')]:undefined)||_0xdaed('0x50')},{'name':_0xdaed('0x51'),'value':_0x397ec1['attrVoiceQueues']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x1]?_0x397ec1['attrs'][0x1][_0xdaed('0x44')]:undefined)||[]},{'name':_0xdaed('0x4d'),'value':_0x397ec1['attrFontSize']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1['attrs'][0x2]?_0x397ec1[_0xdaed('0x43')][0x2][_0xdaed('0x44')]:undefined)||0x14}];case _0xdaed('0x52'):case _0xdaed('0x53'):return[{'name':_0xdaed('0x54'),'value':_0x397ec1['attrSerie1']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x0]?_0x397ec1['attrs'][0x0][_0xdaed('0x44')]:undefined)||_0xdaed('0x50')},{'name':_0xdaed('0x55'),'value':_0x397ec1['attrSerie2']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1['attrs'][0x1]?_0x397ec1[_0xdaed('0x43')][0x1][_0xdaed('0x44')]:undefined)||null},{'name':_0xdaed('0x56'),'value':_0x397ec1[_0xdaed('0x56')]||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x2]?_0x397ec1[_0xdaed('0x43')][0x2][_0xdaed('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x397ec1['attrVoiceQueues']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x3]?_0x397ec1[_0xdaed('0x43')][0x3][_0xdaed('0x44')]:undefined)||[]}];case _0xdaed('0x57'):return[{'name':'attrReport','type':_0x397ec1['reportType']||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1['attrs'][0x0]?_0x397ec1['attrs'][0x0][_0xdaed('0x58')]:undefined)||null,'value':_0x397ec1[_0xdaed('0x59')]||(_0x397ec1[_0xdaed('0x43')]&&_0x397ec1[_0xdaed('0x43')][0x0]?_0x397ec1['attrs'][0x0][_0xdaed('0x44')]:undefined)||null},{'name':_0xdaed('0x5a'),'value':_0x397ec1[_0xdaed('0x5a')]||(_0x397ec1['attrs']&&_0x397ec1[_0xdaed('0x43')][0x1]?_0x397ec1[_0xdaed('0x43')][0x1][_0xdaed('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x3c9b8d){logger[_0xdaed('0x2c')](_0xdaed('0x5b'),JSON[_0xdaed('0x5c')](_0x3c9b8d));return[];}}exports[_0xdaed('0x5d')]=function(_0x165dbc,_0x206977){if(_0x165dbc[_0xdaed('0x5e')]){_0x165dbc[_0xdaed('0x5e')][_0xdaed('0x43')]=widgetAttributes(_0x165dbc[_0xdaed('0x5e')]);}return db[_0xdaed('0x34')][_0xdaed('0x5d')](_0x165dbc[_0xdaed('0x5e')],{})[_0xdaed('0x2a')](respondWithResult(_0x206977,0xc9))['catch'](handleError(_0x206977,null));};exports[_0xdaed('0x5f')]=function(_0x1f0bb8,_0x375c7e){if(_0x1f0bb8[_0xdaed('0x5e')]['id']){delete _0x1f0bb8[_0xdaed('0x5e')]['id'];}_0x1f0bb8[_0xdaed('0x5e')][_0xdaed('0x43')]=widgetAttributes(_0x1f0bb8[_0xdaed('0x5e')]);return db[_0xdaed('0x34')][_0xdaed('0x40')]({'where':{'id':_0x1f0bb8[_0xdaed('0x31')]['id']}})[_0xdaed('0x2a')](handleEntityNotFound(_0x375c7e,null))[_0xdaed('0x2a')](saveUpdates(_0x1f0bb8[_0xdaed('0x5e')],null))['then'](respondWithResult(_0x375c7e,null))[_0xdaed('0x41')](handleError(_0x375c7e,null));};
\ No newline at end of file
index 2af9573..2a53015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc8=['save','update','remove','emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners'];(function(_0x456671,_0x5e92e2){var _0x43789d=function(_0x3dc021){while(--_0x3dc021){_0x456671['push'](_0x456671['shift']());}};_0x43789d(++_0x5e92e2);}(_0x9bc8,0xa6));var _0x89bc=function(_0x2d7ffc,_0x17fffe){_0x2d7ffc=_0x2d7ffc-0x0;var _0x106b28=_0x9bc8[_0x2d7ffc];return _0x106b28;};'use strict';var EventEmitter=require(_0x89bc('0x0'));var DashboardItem=require(_0x89bc('0x1'))['db'][_0x89bc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x89bc('0x3')](0x0);var events={'afterCreate':_0x89bc('0x4'),'afterUpdate':_0x89bc('0x5'),'afterDestroy':_0x89bc('0x6')};function emitEvent(_0x1bdd2f){return function(_0x490c9a,_0x5b5f98,_0x5d6caf){DashboardItemEvents[_0x89bc('0x7')](_0x1bdd2f+':'+_0x490c9a['id'],_0x490c9a);DashboardItemEvents[_0x89bc('0x7')](_0x1bdd2f,_0x490c9a);_0x5d6caf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x89bc('0x8')](e,emitEvent(event));}}module[_0x89bc('0x9')]=DashboardItemEvents;
\ No newline at end of file
+var _0x09d2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove'];(function(_0x19d24a,_0x150c52){var _0x1854fd=function(_0x42d732){while(--_0x42d732){_0x19d24a['push'](_0x19d24a['shift']());}};_0x1854fd(++_0x150c52);}(_0x09d2,0x1d2));var _0x209d=function(_0x28a3f7,_0x55dbec){_0x28a3f7=_0x28a3f7-0x0;var _0x53b7bf=_0x09d2[_0x28a3f7];return _0x53b7bf;};'use strict';var EventEmitter=require(_0x209d('0x0'));var DashboardItem=require(_0x209d('0x1'))['db'][_0x209d('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x209d('0x3')](0x0);var events={'afterCreate':_0x209d('0x4'),'afterUpdate':_0x209d('0x5'),'afterDestroy':_0x209d('0x6')};function emitEvent(_0x18ecfb){return function(_0x4245a0,_0x30337b,_0x4d0786){DashboardItemEvents[_0x209d('0x7')](_0x18ecfb+':'+_0x4245a0['id'],_0x4245a0);DashboardItemEvents[_0x209d('0x7')](_0x18ecfb,_0x4245a0);_0x4d0786(null);};}for(var e in events){if(events[_0x209d('0x8')](e)){var event=events[e];DashboardItem[_0x209d('0x9')](e,emitEvent(event));}}module[_0x209d('0xa')]=DashboardItemEvents;
\ No newline at end of file
index 3ce3315..7ddde91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b19=['../../config/logger','bluebird','rimraf','../../config/environment','define','DashboardItem','dashboard_items','lodash'];(function(_0x138836,_0x229129){var _0x322688=function(_0x54b101){while(--_0x54b101){_0x138836['push'](_0x138836['shift']());}};_0x322688(++_0x229129);}(_0x7b19,0x1df));var _0x97b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x97b1('0x0'));var util=require('util');var logger=require(_0x97b1('0x1'))('api');var moment=require('moment');var BPromise=require(_0x97b1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97b1('0x3'));var config=require(_0x97b1('0x4'));var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x277466,_0x27238){return _0x277466[_0x97b1('0x5')](_0x97b1('0x6'),attributes,{'tableName':_0x97b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x004c=['../../config/environment','exports','define','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xe51711,_0x329f59){var _0x350f09=function(_0x3a0bd4){while(--_0x3a0bd4){_0xe51711['push'](_0xe51711['shift']());}};_0x350f09(++_0x329f59);}(_0x004c,0x1de));var _0xc004=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x004c[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc004('0x0'))(_0xc004('0x1'));var moment=require(_0xc004('0x2'));var BPromise=require(_0xc004('0x3'));var rp=require(_0xc004('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc004('0x5'));var config=require(_0xc004('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xc004('0x7')]=function(_0x27a9d6,_0x2b72c1){return _0x27a9d6[_0xc004('0x8')](_0xc004('0x9'),attributes,{'tableName':_0xc004('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 571bf15..30d101e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10da=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x115977,_0x14bb0f){var _0x1e1c2b=function(_0x14aa4a){while(--_0x14aa4a){_0x115977['push'](_0x115977['shift']());}};_0x1e1c2b(++_0x14bb0f);}(_0x10da,0x66));var _0xa10d=function(_0x263fa7,_0x364151){_0x263fa7=_0x263fa7-0x0;var _0x4fad10=_0x10da[_0x263fa7];return _0x4fad10;};'use strict';var _=require(_0xa10d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa10d('0x1'));var rs=require(_0xa10d('0x2'));var fs=require('fs');var Redis=require(_0xa10d('0x3'));var db=require(_0xa10d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa10d('0x5'))(_0xa10d('0x6'));var config=require(_0xa10d('0x7'));var jayson=require(_0xa10d('0x8'));var client=jayson[_0xa10d('0x9')][_0xa10d('0xa')]({'port':0x232a});config[_0xa10d('0xb')]=_[_0xa10d('0xc')](config['redis'],{'host':_0xa10d('0xd'),'port':0x18eb});var socket=require(_0xa10d('0xe'))(new Redis(config[_0xa10d('0xb')]));require('./dashboardItem.socket')[_0xa10d('0xf')](socket);function respondWithRpcPromise(_0xb6c120,_0x374a81,_0x1dbb01){return new BPromise(function(_0x283b11,_0x41acbd){return client[_0xa10d('0x10')](_0xb6c120,_0x1dbb01)[_0xa10d('0x11')](function(_0x31f719){logger[_0xa10d('0x12')](_0xa10d('0x13'),_0x374a81,'request\x20sent');logger[_0xa10d('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x374a81,_0xa10d('0x15'),JSON['stringify'](_0x31f719));if(_0x31f719[_0xa10d('0x16')]){if(_0x31f719[_0xa10d('0x16')][_0xa10d('0x17')]===0x1f4){logger[_0xa10d('0x16')](_0xa10d('0x13'),_0x374a81,_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);return _0x41acbd(_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);}logger['error'](_0xa10d('0x13'),_0x374a81,_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);return _0x283b11(_0x31f719[_0xa10d('0x16')][_0xa10d('0x18')]);}else{logger[_0xa10d('0x12')]('DashboardItem,\x20%s,\x20%s',_0x374a81,_0xa10d('0x15'));_0x283b11(_0x31f719[_0xa10d('0x19')][_0xa10d('0x18')]);}})[_0xa10d('0x1a')](function(_0x5a7705){logger['error'](_0xa10d('0x13'),_0x374a81,_0x5a7705);_0x41acbd(_0x5a7705);});});}
\ No newline at end of file
+var _0x850a=['request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0xbc6eb9,_0x211e83){var _0x4cd82a=function(_0x10e2a6){while(--_0x10e2a6){_0xbc6eb9['push'](_0xbc6eb9['shift']());}};_0x4cd82a(++_0x211e83);}(_0x850a,0x1dd));var _0xa850=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x850a[_0x434804];return _0x573fc8;};'use strict';var _=require(_0xa850('0x0'));var util=require(_0xa850('0x1'));var moment=require(_0xa850('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa850('0x3'))['db'];var utils=require(_0xa850('0x4'));var logger=require(_0xa850('0x5'))(_0xa850('0x6'));var config=require(_0xa850('0x7'));var jayson=require(_0xa850('0x8'));var client=jayson[_0xa850('0x9')][_0xa850('0xa')]({'port':0x232a});config[_0xa850('0xb')]=_[_0xa850('0xc')](config[_0xa850('0xb')],{'host':_0xa850('0xd'),'port':0x18eb});var socket=require(_0xa850('0xe'))(new Redis(config[_0xa850('0xb')]));require(_0xa850('0xf'))['register'](socket);function respondWithRpcPromise(_0xb73da6,_0x5405f7,_0x14b245){return new BPromise(function(_0x162f70,_0x216d9a){return client[_0xa850('0x10')](_0xb73da6,_0x14b245)[_0xa850('0x11')](function(_0x2629a2){logger[_0xa850('0x12')](_0xa850('0x13'),_0x5405f7,_0xa850('0x14'));logger[_0xa850('0x15')](_0xa850('0x16'),_0x5405f7,_0xa850('0x14'),JSON[_0xa850('0x17')](_0x2629a2));if(_0x2629a2[_0xa850('0x18')]){if(_0x2629a2[_0xa850('0x18')][_0xa850('0x19')]===0x1f4){logger['error'](_0xa850('0x13'),_0x5405f7,_0x2629a2[_0xa850('0x18')][_0xa850('0x1a')]);return _0x216d9a(_0x2629a2[_0xa850('0x18')][_0xa850('0x1a')]);}logger['error'](_0xa850('0x13'),_0x5405f7,_0x2629a2[_0xa850('0x18')]['message']);return _0x162f70(_0x2629a2[_0xa850('0x18')][_0xa850('0x1a')]);}else{logger[_0xa850('0x12')](_0xa850('0x13'),_0x5405f7,_0xa850('0x14'));_0x162f70(_0x2629a2[_0xa850('0x1b')][_0xa850('0x1a')]);}})[_0xa850('0x1c')](function(_0x3b9db0){logger[_0xa850('0x18')](_0xa850('0x13'),_0x5405f7,_0x3b9db0);_0x216d9a(_0x3b9db0);});});}
\ No newline at end of file
index 025b5f8..baed932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8d0=['register','dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener'];(function(_0x1dae40,_0x3193a0){var _0x93c15c=function(_0x12f67d){while(--_0x12f67d){_0x1dae40['push'](_0x1dae40['shift']());}};_0x93c15c(++_0x3193a0);}(_0xf8d0,0xc2));var _0x0f8d=function(_0x1faa5c,_0x4b6ee2){_0x1faa5c=_0x1faa5c-0x0;var _0x5c54fd=_0xf8d0[_0x1faa5c];return _0x5c54fd;};'use strict';var DashboardItemEvents=require(_0x0f8d('0x0'));var events=[_0x0f8d('0x1'),_0x0f8d('0x2'),_0x0f8d('0x3')];function createListener(_0x253b59,_0xd55505){return function(_0x24a9e9){_0xd55505[_0x0f8d('0x4')](_0x253b59,_0x24a9e9);};}function removeListener(_0x34752a,_0x1cc2c7){return function(){DashboardItemEvents[_0x0f8d('0x5')](_0x34752a,_0x1cc2c7);};}exports[_0x0f8d('0x6')]=function(_0x44a93c){for(var _0x4f48b2=0x0,_0x496a47=events['length'];_0x4f48b2<_0x496a47;_0x4f48b2++){var _0x478efa=events[_0x4f48b2];var _0x3a1796=createListener(_0x0f8d('0x7')+_0x478efa,_0x44a93c);DashboardItemEvents['on'](_0x478efa,_0x3a1796);}};
\ No newline at end of file
+var _0xc1b2=['dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener','register','length'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0xc1b2,0xb1));var _0x2c1b=function(_0xdd29c3,_0x2f284b){_0xdd29c3=_0xdd29c3-0x0;var _0x410354=_0xc1b2[_0xdd29c3];return _0x410354;};'use strict';var DashboardItemEvents=require(_0x2c1b('0x0'));var events=[_0x2c1b('0x1'),_0x2c1b('0x2'),'update'];function createListener(_0xc56698,_0xf1fbda){return function(_0xbcb25b){_0xf1fbda[_0x2c1b('0x3')](_0xc56698,_0xbcb25b);};}function removeListener(_0x2c7b47,_0x314bb0){return function(){DashboardItemEvents[_0x2c1b('0x4')](_0x2c7b47,_0x314bb0);};}exports[_0x2c1b('0x5')]=function(_0x28336f){for(var _0x3d064f=0x0,_0x46a0f5=events[_0x2c1b('0x6')];_0x3d064f<_0x46a0f5;_0x3d064f++){var _0x3b55c3=events[_0x3d064f];var _0x109b55=createListener(_0x2c1b('0x7')+_0x3b55c3,_0x28336f);DashboardItemEvents['on'](_0x3b55c3,_0x109b55);}};
\ No newline at end of file
index d0fc246..f7c07d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7681=['./dashboardItem.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x37f2a7,_0x4c881c){var _0x5d6541=function(_0x5ed84a){while(--_0x5ed84a){_0x37f2a7['push'](_0x37f2a7['shift']());}};_0x5d6541(++_0x4c881c);}(_0x7681,0x128));var _0x1768=function(_0xc69bd0,_0x4d1aa3){_0xc69bd0=_0xc69bd0-0x0;var _0x454d11=_0x7681[_0xc69bd0];return _0x454d11;};'use strict';var multer=require(_0x1768('0x0'));var util=require('util');var path=require(_0x1768('0x1'));var timeout=require(_0x1768('0x2'));var express=require(_0x1768('0x3'));var router=express[_0x1768('0x4')]();var fs_extra=require(_0x1768('0x5'));var auth=require(_0x1768('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1768('0x7'));var controller=require(_0x1768('0x8'));router[_0x1768('0x9')]('/:id',auth[_0x1768('0xa')](),controller[_0x1768('0xb')]);router[_0x1768('0xc')]('/',auth['isAuthenticated'](),controller[_0x1768('0xd')]);router[_0x1768('0xe')](_0x1768('0xf'),auth['isAuthenticated'](),controller[_0x1768('0x10')]);router[_0x1768('0x11')](_0x1768('0xf'),auth[_0x1768('0xa')](),controller[_0x1768('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x80a7=['/:id','show','post','isAuthenticated','create','put','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./dashboardItem.controller','get'];(function(_0x41e684,_0x2b326){var _0x5a7e40=function(_0x599c86){while(--_0x599c86){_0x41e684['push'](_0x41e684['shift']());}};_0x5a7e40(++_0x2b326);}(_0x80a7,0x168));var _0x780a=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x80a7[_0x18cd5b];return _0x5eaa52;};'use strict';var multer=require(_0x780a('0x0'));var util=require(_0x780a('0x1'));var path=require('path');var timeout=require(_0x780a('0x2'));var express=require('express');var router=express[_0x780a('0x3')]();var fs_extra=require(_0x780a('0x4'));var auth=require(_0x780a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x780a('0x6'));router[_0x780a('0x7')](_0x780a('0x8'),auth['isAuthenticated'](),controller[_0x780a('0x9')]);router[_0x780a('0xa')]('/',auth[_0x780a('0xb')](),controller[_0x780a('0xc')]);router[_0x780a('0xd')](_0x780a('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x780a('0xe')](_0x780a('0x8'),auth[_0x780a('0xb')](),controller[_0x780a('0xf')]);module['exports']=router;
\ No newline at end of file
index 44e08e3..85b0c3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6115=['first','sequelize','STRING'];(function(_0x37fff5,_0x2e32a4){var _0x51c788=function(_0x3738bd){while(--_0x3738bd){_0x37fff5['push'](_0x37fff5['shift']());}};_0x51c788(++_0x2e32a4);}(_0x6115,0x13f));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5611('0x0'));module['exports']={'name':{'type':Sequelize[_0x5611('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first','second','third'),'allowNull':![],'defaultValue':_0x5611('0x2')},'description':{'type':Sequelize[_0x5611('0x1')]}};
\ No newline at end of file
+var _0x80d4=['second','third','sequelize','STRING','ENUM','first'];(function(_0x2efa42,_0x153467){var _0xe92061=function(_0x4000d7){while(--_0x4000d7){_0x2efa42['push'](_0x2efa42['shift']());}};_0xe92061(++_0x153467);}(_0x80d4,0x98));var _0x480d=function(_0x42637a,_0x2f3700){_0x42637a=_0x42637a-0x0;var _0x2f577e=_0x80d4[_0x42637a];return _0x2f577e;};'use strict';var Sequelize=require(_0x480d('0x0'));module['exports']={'name':{'type':Sequelize[_0x480d('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x480d('0x2')](_0x480d('0x3'),_0x480d('0x4'),_0x480d('0x5')),'allowNull':![],'defaultValue':_0x480d('0x3')},'description':{'type':Sequelize[_0x480d('0x1')]}};
\ No newline at end of file
index a2123c2..bbffd33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4044=['model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Dispositions','UserProfileResource','stack','name','index','map','Disposition','rawAttributes','fieldName','key'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4044,0xcb));var _0x4404=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4044[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x4404('0x0'));var rimraf=require(_0x4404('0x1'));var zipdir=require(_0x4404('0x2'));var jsonpatch=require(_0x4404('0x3'));var rp=require(_0x4404('0x4'));var moment=require(_0x4404('0x5'));var BPromise=require(_0x4404('0x6'));var Mustache=require(_0x4404('0x7'));var util=require(_0x4404('0x8'));var path=require(_0x4404('0x9'));var sox=require(_0x4404('0xa'));var csv=require(_0x4404('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4404('0xc'));var squel=require(_0x4404('0xd'));var crypto=require('crypto');var jsforce=require(_0x4404('0xe'));var deskjs=require(_0x4404('0xf'));var toCsv=require(_0x4404('0xb'));var querystring=require(_0x4404('0x10'));var Papa=require(_0x4404('0x11'));var Redis=require(_0x4404('0x12'));var authService=require(_0x4404('0x13'));var qs=require(_0x4404('0x14'));var as=require(_0x4404('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4404('0x16'))(_0x4404('0x17'));var utils=require(_0x4404('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4404('0x19'));var db=require(_0x4404('0x1a'))['db'];function respondWithStatusCode(_0x2eabcd,_0x8cb16f){_0x8cb16f=_0x8cb16f||0xcc;return function(_0x161ff7){if(_0x161ff7){return _0x2eabcd[_0x4404('0x1b')](_0x8cb16f);}return _0x2eabcd[_0x4404('0x1c')](_0x8cb16f)[_0x4404('0x1d')]();};}function respondWithResult(_0x3ad991,_0x43ee2f){_0x43ee2f=_0x43ee2f||0xc8;return function(_0x376305){if(_0x376305){return _0x3ad991[_0x4404('0x1c')](_0x43ee2f)[_0x4404('0x1e')](_0x376305);}};}function respondWithFilteredResult(_0x31f4dc,_0x3a883b){return function(_0x33b72c){if(_0x33b72c){var _0x5bbe49=typeof _0x3a883b[_0x4404('0x1f')]===_0x4404('0x20')&&typeof _0x3a883b[_0x4404('0x21')]===_0x4404('0x20');var _0x45965f=_0x33b72c[_0x4404('0x22')];var _0x21dea7=_0x5bbe49?0x0:_0x3a883b[_0x4404('0x1f')];var _0x3e46ae=_0x5bbe49?_0x33b72c[_0x4404('0x22')]:_0x3a883b[_0x4404('0x1f')]+_0x3a883b[_0x4404('0x21')];var _0x3cf7ba;if(_0x3e46ae>=_0x45965f){_0x3e46ae=_0x45965f;_0x3cf7ba=0xc8;}else{_0x3cf7ba=0xce;}_0x31f4dc['status'](_0x3cf7ba);return _0x31f4dc['set'](_0x4404('0x23'),_0x21dea7+'-'+_0x3e46ae+'/'+_0x45965f)[_0x4404('0x1e')](_0x33b72c);}return null;};}function patchUpdates(_0x179ad6){return function(_0x2fa6e8){try{jsonpatch[_0x4404('0x24')](_0x2fa6e8,_0x179ad6,!![]);}catch(_0x31778b){return BPromise[_0x4404('0x25')](_0x31778b);}return _0x2fa6e8[_0x4404('0x26')]();};}function saveUpdates(_0x4f2736,_0x57c5b4){return function(_0x454973){if(_0x454973){return _0x454973[_0x4404('0x27')](_0x4f2736)[_0x4404('0x28')](function(_0x23f235){return _0x23f235;});}return null;};}function removeEntity(_0x1fb2af,_0x1f74e1){return function(_0x2f99f8){if(_0x2f99f8){return _0x2f99f8[_0x4404('0x29')]()[_0x4404('0x28')](function(){var _0x25731f=_0x2f99f8['get']({'plain':!![]});var _0x33e3db=_0x4404('0x2a');return db[_0x4404('0x2b')][_0x4404('0x29')]({'where':{'type':_0x33e3db,'resourceId':_0x25731f['id']}})[_0x4404('0x28')](function(){return _0x2f99f8;});})[_0x4404('0x28')](function(){_0x1fb2af['status'](0xcc)[_0x4404('0x1d')]();});}};}function handleEntityNotFound(_0x2001c0,_0x53b79c){return function(_0x5bddb7){if(!_0x5bddb7){_0x2001c0[_0x4404('0x1b')](0x194);}return _0x5bddb7;};}function handleError(_0x46a13e,_0x2de456){_0x2de456=_0x2de456||0x1f4;return function(_0x3983af){logger['error'](_0x3983af[_0x4404('0x2c')]);if(_0x3983af[_0x4404('0x2d')]){delete _0x3983af[_0x4404('0x2d')];}_0x46a13e[_0x4404('0x1c')](_0x2de456)['send'](_0x3983af);};}exports[_0x4404('0x2e')]=function(_0x5f1f15,_0x2fd4c9){var _0x20c190={},_0x334aa4={},_0x3ccdc6={'count':0x0,'rows':[]};var _0xb0f44=_[_0x4404('0x2f')](db[_0x4404('0x30')][_0x4404('0x31')],function(_0x25a452){return{'name':_0x25a452[_0x4404('0x32')],'type':_0x25a452['type'][_0x4404('0x33')]};});_0x334aa4[_0x4404('0x34')]=_['map'](_0xb0f44,_0x4404('0x2d'));_0x334aa4[_0x4404('0x35')]=_['keys'](_0x5f1f15[_0x4404('0x35')]);_0x334aa4[_0x4404('0x36')]=_['intersection'](_0x334aa4[_0x4404('0x34')],_0x334aa4[_0x4404('0x35')]);_0x20c190[_0x4404('0x37')]=_[_0x4404('0x38')](_0x334aa4[_0x4404('0x34')],qs[_0x4404('0x39')](_0x5f1f15[_0x4404('0x35')][_0x4404('0x39')]));_0x20c190[_0x4404('0x37')]=_0x20c190[_0x4404('0x37')][_0x4404('0x3a')]?_0x20c190[_0x4404('0x37')]:_0x334aa4['model'];if(!_0x5f1f15[_0x4404('0x35')]['hasOwnProperty'](_0x4404('0x3b'))){_0x20c190['limit']=qs[_0x4404('0x21')](_0x5f1f15[_0x4404('0x35')]['limit']);_0x20c190[_0x4404('0x1f')]=qs['offset'](_0x5f1f15[_0x4404('0x35')][_0x4404('0x1f')]);}_0x20c190[_0x4404('0x3c')]=qs[_0x4404('0x3d')](_0x5f1f15[_0x4404('0x35')]['sort']);_0x20c190[_0x4404('0x3e')]=qs['filters'](_[_0x4404('0x3f')](_0x5f1f15[_0x4404('0x35')],_0x334aa4[_0x4404('0x36')]),_0xb0f44);if(_0x5f1f15[_0x4404('0x35')][_0x4404('0x40')]){_0x20c190[_0x4404('0x3e')]=_[_0x4404('0x41')](_0x20c190[_0x4404('0x3e')],{'$or':_[_0x4404('0x2f')](_0xb0f44,function(_0x366520){if(_0x366520['type']!==_0x4404('0x42')){var _0x30d933={};_0x30d933[_0x366520[_0x4404('0x2d')]]={'$like':'%'+_0x5f1f15[_0x4404('0x35')]['filter']+'%'};return _0x30d933;}})});}_0x20c190=_[_0x4404('0x41')]({},_0x20c190,_0x5f1f15[_0x4404('0x43')]);var _0x180970={'where':_0x20c190[_0x4404('0x3e')]};return db['Disposition'][_0x4404('0x22')](_0x180970)[_0x4404('0x28')](function(_0x3c7b55){_0x3ccdc6[_0x4404('0x22')]=_0x3c7b55;if(_0x5f1f15[_0x4404('0x35')]['includeAll']){_0x20c190[_0x4404('0x44')]=[{'all':!![]}];}return db[_0x4404('0x30')][_0x4404('0x45')](_0x20c190);})[_0x4404('0x28')](function(_0x4d44a0){_0x3ccdc6[_0x4404('0x46')]=_0x4d44a0;return _0x3ccdc6;})['then'](respondWithFilteredResult(_0x2fd4c9,_0x20c190))['catch'](handleError(_0x2fd4c9,null));};exports[_0x4404('0x47')]=function(_0x22d2c2,_0xef872d){var _0x42cb1e={'raw':!![],'where':{'id':_0x22d2c2[_0x4404('0x48')]['id']}},_0x2fcb61={};_0x2fcb61['model']=_[_0x4404('0x49')](db[_0x4404('0x30')][_0x4404('0x31')]);_0x2fcb61[_0x4404('0x35')]=_[_0x4404('0x49')](_0x22d2c2[_0x4404('0x35')]);_0x2fcb61[_0x4404('0x36')]=_[_0x4404('0x38')](_0x2fcb61[_0x4404('0x34')],_0x2fcb61[_0x4404('0x35')]);_0x42cb1e[_0x4404('0x37')]=_['intersection'](_0x2fcb61['model'],qs[_0x4404('0x39')](_0x22d2c2[_0x4404('0x35')][_0x4404('0x39')]));_0x42cb1e[_0x4404('0x37')]=_0x42cb1e[_0x4404('0x37')]['length']?_0x42cb1e['attributes']:_0x2fcb61['model'];if(_0x22d2c2[_0x4404('0x35')]['includeAll']){_0x42cb1e['include']=[{'all':!![]}];}_0x42cb1e=_['merge']({},_0x42cb1e,_0x22d2c2[_0x4404('0x43')]);return db[_0x4404('0x30')][_0x4404('0x4a')](_0x42cb1e)[_0x4404('0x28')](handleEntityNotFound(_0xef872d,null))['then'](respondWithResult(_0xef872d,null))[_0x4404('0x4b')](handleError(_0xef872d,null));};exports[_0x4404('0x4c')]=function(_0x25dbff,_0x334f9c){return db[_0x4404('0x30')][_0x4404('0x4c')](_0x25dbff[_0x4404('0x4d')],{})[_0x4404('0x28')](function(_0x33e487){var _0x53a2cf=_0x25dbff[_0x4404('0x4e')][_0x4404('0x4f')]({'plain':!![]});if(!_0x53a2cf)throw new Error(_0x4404('0x50'));if(_0x53a2cf[_0x4404('0x51')]==='user'){var _0x33ae2b=_0x33e487[_0x4404('0x4f')]({'plain':!![]});var _0x44d82b=_0x4404('0x2a');return db[_0x4404('0x52')]['find']({'where':{'name':_0x44d82b,'userProfileId':_0x53a2cf[_0x4404('0x53')]},'raw':!![]})['then'](function(_0x99956){if(_0x99956&&_0x99956[_0x4404('0x54')]===0x0){return db['UserProfileResource'][_0x4404('0x4c')]({'name':_0x33ae2b[_0x4404('0x2d')],'resourceId':_0x33ae2b['id'],'type':_0x99956[_0x4404('0x2d')],'sectionId':_0x99956['id']},{})[_0x4404('0x28')](function(){return _0x33e487;});}else{return _0x33e487;}})['catch'](function(_0x3da024){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3da024);throw _0x3da024;});}return _0x33e487;})[_0x4404('0x28')](respondWithResult(_0x334f9c,0xc9))[_0x4404('0x4b')](handleError(_0x334f9c,null));};exports[_0x4404('0x27')]=function(_0xd1da79,_0x5d788b){if(_0xd1da79[_0x4404('0x4d')]['id']){delete _0xd1da79[_0x4404('0x4d')]['id'];}return db['Disposition']['find']({'where':{'id':_0xd1da79[_0x4404('0x48')]['id']}})[_0x4404('0x28')](handleEntityNotFound(_0x5d788b,null))[_0x4404('0x28')](saveUpdates(_0xd1da79[_0x4404('0x4d')],null))[_0x4404('0x28')](respondWithResult(_0x5d788b,null))[_0x4404('0x4b')](handleError(_0x5d788b,null));};exports[_0x4404('0x29')]=function(_0x4c9351,_0x2755d4){return db[_0x4404('0x30')][_0x4404('0x4a')]({'where':{'id':_0x4c9351[_0x4404('0x48')]['id']}})[_0x4404('0x28')](handleEntityNotFound(_0x2755d4,null))[_0x4404('0x28')](removeEntity(_0x2755d4,null))[_0x4404('0x4b')](handleError(_0x2755d4,null));};
\ No newline at end of file
+var _0x87d3=['undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','type','Disposition','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x46fd05,_0x2a121d){var _0xdcbee=function(_0x32967f){while(--_0x32967f){_0x46fd05['push'](_0x46fd05['shift']());}};_0xdcbee(++_0x2a121d);}(_0x87d3,0x86));var _0x387d=function(_0x42f154,_0x32110c){_0x42f154=_0x42f154-0x0;var _0x471993=_0x87d3[_0x42f154];return _0x471993;};'use strict';var emlformat=require(_0x387d('0x0'));var rimraf=require(_0x387d('0x1'));var zipdir=require(_0x387d('0x2'));var jsonpatch=require(_0x387d('0x3'));var rp=require(_0x387d('0x4'));var moment=require(_0x387d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x387d('0x6'));var util=require('util');var path=require(_0x387d('0x7'));var sox=require(_0x387d('0x8'));var csv=require(_0x387d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x387d('0xa'));var _=require(_0x387d('0xb'));var squel=require(_0x387d('0xc'));var crypto=require(_0x387d('0xd'));var jsforce=require(_0x387d('0xe'));var deskjs=require(_0x387d('0xf'));var toCsv=require(_0x387d('0x9'));var querystring=require(_0x387d('0x10'));var Papa=require(_0x387d('0x11'));var Redis=require(_0x387d('0x12'));var authService=require(_0x387d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x387d('0x14'));var hardwareService=require(_0x387d('0x15'));var logger=require(_0x387d('0x16'))(_0x387d('0x17'));var utils=require(_0x387d('0x18'));var config=require(_0x387d('0x19'));var licenseUtil=require(_0x387d('0x1a'));var db=require(_0x387d('0x1b'))['db'];function respondWithStatusCode(_0x325292,_0x45c990){_0x45c990=_0x45c990||0xcc;return function(_0x371959){if(_0x371959){return _0x325292[_0x387d('0x1c')](_0x45c990);}return _0x325292[_0x387d('0x1d')](_0x45c990)[_0x387d('0x1e')]();};}function respondWithResult(_0x11c3bd,_0x51000d){_0x51000d=_0x51000d||0xc8;return function(_0x4914a8){if(_0x4914a8){return _0x11c3bd[_0x387d('0x1d')](_0x51000d)['json'](_0x4914a8);}};}function respondWithFilteredResult(_0x54c482,_0x516b42){return function(_0xf6f574){if(_0xf6f574){var _0x316368=typeof _0x516b42[_0x387d('0x1f')]===_0x387d('0x20')&&typeof _0x516b42[_0x387d('0x21')]===_0x387d('0x20');var _0x3bbf9f=_0xf6f574[_0x387d('0x22')];var _0x560b1c=_0x316368?0x0:_0x516b42[_0x387d('0x1f')];var _0xa50585=_0x316368?_0xf6f574[_0x387d('0x22')]:_0x516b42['offset']+_0x516b42[_0x387d('0x21')];var _0x53933a;if(_0xa50585>=_0x3bbf9f){_0xa50585=_0x3bbf9f;_0x53933a=0xc8;}else{_0x53933a=0xce;}_0x54c482[_0x387d('0x1d')](_0x53933a);return _0x54c482['set'](_0x387d('0x23'),_0x560b1c+'-'+_0xa50585+'/'+_0x3bbf9f)[_0x387d('0x24')](_0xf6f574);}return null;};}function patchUpdates(_0x2abd07){return function(_0x37b84b){try{jsonpatch[_0x387d('0x25')](_0x37b84b,_0x2abd07,!![]);}catch(_0x5c733b){return BPromise['reject'](_0x5c733b);}return _0x37b84b[_0x387d('0x26')]();};}function saveUpdates(_0x7799a7,_0x2f2827){return function(_0x580a6e){if(_0x580a6e){return _0x580a6e[_0x387d('0x27')](_0x7799a7)[_0x387d('0x28')](function(_0x3e5620){return _0x3e5620;});}return null;};}function removeEntity(_0x2be266,_0x36ee8b){return function(_0x5569db){if(_0x5569db){return _0x5569db['destroy']()['then'](function(){var _0x463121=_0x5569db['get']({'plain':!![]});var _0x5c567b='Dispositions';return db['UserProfileResource'][_0x387d('0x29')]({'where':{'type':_0x5c567b,'resourceId':_0x463121['id']}})[_0x387d('0x28')](function(){return _0x5569db;});})[_0x387d('0x28')](function(){_0x2be266[_0x387d('0x1d')](0xcc)[_0x387d('0x1e')]();});}};}function handleEntityNotFound(_0xe0982e,_0x1d3f3a){return function(_0x2df701){if(!_0x2df701){_0xe0982e[_0x387d('0x1c')](0x194);}return _0x2df701;};}function handleError(_0x270231,_0x25214f){_0x25214f=_0x25214f||0x1f4;return function(_0x22a7a6){logger[_0x387d('0x2a')](_0x22a7a6[_0x387d('0x2b')]);if(_0x22a7a6[_0x387d('0x2c')]){delete _0x22a7a6[_0x387d('0x2c')];}_0x270231['status'](_0x25214f)[_0x387d('0x2d')](_0x22a7a6);};}exports[_0x387d('0x2e')]=function(_0x4495fb,_0x588feb){var _0x370689={},_0x452a11={},_0x386af6={'count':0x0,'rows':[]};var _0x23a388=_[_0x387d('0x2f')](db['Disposition'][_0x387d('0x30')],function(_0x11f171){return{'name':_0x11f171['fieldName'],'type':_0x11f171['type'][_0x387d('0x31')]};});_0x452a11[_0x387d('0x32')]=_[_0x387d('0x2f')](_0x23a388,_0x387d('0x2c'));_0x452a11[_0x387d('0x33')]=_[_0x387d('0x34')](_0x4495fb['query']);_0x452a11[_0x387d('0x35')]=_[_0x387d('0x36')](_0x452a11[_0x387d('0x32')],_0x452a11[_0x387d('0x33')]);_0x370689[_0x387d('0x37')]=_[_0x387d('0x36')](_0x452a11[_0x387d('0x32')],qs['fields'](_0x4495fb[_0x387d('0x33')][_0x387d('0x38')]));_0x370689[_0x387d('0x37')]=_0x370689[_0x387d('0x37')][_0x387d('0x39')]?_0x370689[_0x387d('0x37')]:_0x452a11['model'];if(!_0x4495fb['query']['hasOwnProperty']('nolimit')){_0x370689[_0x387d('0x21')]=qs[_0x387d('0x21')](_0x4495fb['query'][_0x387d('0x21')]);_0x370689[_0x387d('0x1f')]=qs['offset'](_0x4495fb[_0x387d('0x33')][_0x387d('0x1f')]);}_0x370689[_0x387d('0x3a')]=qs['sort'](_0x4495fb[_0x387d('0x33')]['sort']);_0x370689[_0x387d('0x3b')]=qs[_0x387d('0x35')](_[_0x387d('0x3c')](_0x4495fb[_0x387d('0x33')],_0x452a11['filters']),_0x23a388);if(_0x4495fb[_0x387d('0x33')][_0x387d('0x3d')]){_0x370689['where']=_[_0x387d('0x3e')](_0x370689['where'],{'$or':_[_0x387d('0x2f')](_0x23a388,function(_0x1d2116){if(_0x1d2116[_0x387d('0x3f')]!=='VIRTUAL'){var _0x39bdff={};_0x39bdff[_0x1d2116[_0x387d('0x2c')]]={'$like':'%'+_0x4495fb[_0x387d('0x33')]['filter']+'%'};return _0x39bdff;}})});}_0x370689=_[_0x387d('0x3e')]({},_0x370689,_0x4495fb['options']);var _0x564b18={'where':_0x370689[_0x387d('0x3b')]};return db[_0x387d('0x40')][_0x387d('0x22')](_0x564b18)[_0x387d('0x28')](function(_0x539063){_0x386af6['count']=_0x539063;if(_0x4495fb[_0x387d('0x33')][_0x387d('0x41')]){_0x370689[_0x387d('0x42')]=[{'all':!![]}];}return db[_0x387d('0x40')][_0x387d('0x43')](_0x370689);})[_0x387d('0x28')](function(_0x4e78c6){_0x386af6['rows']=_0x4e78c6;return _0x386af6;})[_0x387d('0x28')](respondWithFilteredResult(_0x588feb,_0x370689))[_0x387d('0x44')](handleError(_0x588feb,null));};exports[_0x387d('0x45')]=function(_0x4deb33,_0x1cc685){var _0x5b89dd={'raw':!![],'where':{'id':_0x4deb33[_0x387d('0x46')]['id']}},_0x286ffc={};_0x286ffc[_0x387d('0x32')]=_['keys'](db[_0x387d('0x40')][_0x387d('0x30')]);_0x286ffc['query']=_[_0x387d('0x34')](_0x4deb33[_0x387d('0x33')]);_0x286ffc['filters']=_[_0x387d('0x36')](_0x286ffc[_0x387d('0x32')],_0x286ffc[_0x387d('0x33')]);_0x5b89dd[_0x387d('0x37')]=_['intersection'](_0x286ffc[_0x387d('0x32')],qs['fields'](_0x4deb33[_0x387d('0x33')][_0x387d('0x38')]));_0x5b89dd[_0x387d('0x37')]=_0x5b89dd['attributes'][_0x387d('0x39')]?_0x5b89dd[_0x387d('0x37')]:_0x286ffc[_0x387d('0x32')];if(_0x4deb33[_0x387d('0x33')][_0x387d('0x41')]){_0x5b89dd[_0x387d('0x42')]=[{'all':!![]}];}_0x5b89dd=_[_0x387d('0x3e')]({},_0x5b89dd,_0x4deb33[_0x387d('0x47')]);return db[_0x387d('0x40')][_0x387d('0x48')](_0x5b89dd)[_0x387d('0x28')](handleEntityNotFound(_0x1cc685,null))['then'](respondWithResult(_0x1cc685,null))[_0x387d('0x44')](handleError(_0x1cc685,null));};exports[_0x387d('0x49')]=function(_0x4160dc,_0x59d681){return db['Disposition']['create'](_0x4160dc[_0x387d('0x4a')],{})[_0x387d('0x28')](function(_0xec2ef4){var _0x30b3e9=_0x4160dc[_0x387d('0x4b')][_0x387d('0x4c')]({'plain':!![]});if(!_0x30b3e9)throw new Error(_0x387d('0x4d'));if(_0x30b3e9[_0x387d('0x4e')]===_0x387d('0x4b')){var _0x172461=_0xec2ef4[_0x387d('0x4c')]({'plain':!![]});var _0x46d651=_0x387d('0x4f');return db[_0x387d('0x50')][_0x387d('0x48')]({'where':{'name':_0x46d651,'userProfileId':_0x30b3e9[_0x387d('0x51')]},'raw':!![]})[_0x387d('0x28')](function(_0x381089){if(_0x381089&&_0x381089[_0x387d('0x52')]===0x0){return db['UserProfileResource'][_0x387d('0x49')]({'name':_0x172461[_0x387d('0x2c')],'resourceId':_0x172461['id'],'type':_0x381089['name'],'sectionId':_0x381089['id']},{})['then'](function(){return _0xec2ef4;});}else{return _0xec2ef4;}})[_0x387d('0x44')](function(_0x201f57){logger[_0x387d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x201f57);throw _0x201f57;});}return _0xec2ef4;})[_0x387d('0x28')](respondWithResult(_0x59d681,0xc9))[_0x387d('0x44')](handleError(_0x59d681,null));};exports[_0x387d('0x27')]=function(_0x1f363f,_0x32031d){if(_0x1f363f[_0x387d('0x4a')]['id']){delete _0x1f363f[_0x387d('0x4a')]['id'];}return db[_0x387d('0x40')][_0x387d('0x48')]({'where':{'id':_0x1f363f[_0x387d('0x46')]['id']}})[_0x387d('0x28')](handleEntityNotFound(_0x32031d,null))['then'](saveUpdates(_0x1f363f[_0x387d('0x4a')],null))[_0x387d('0x28')](respondWithResult(_0x32031d,null))[_0x387d('0x44')](handleError(_0x32031d,null));};exports[_0x387d('0x29')]=function(_0x334f8c,_0x29e320){return db[_0x387d('0x40')][_0x387d('0x48')]({'where':{'id':_0x334f8c[_0x387d('0x46')]['id']}})[_0x387d('0x28')](handleEntityNotFound(_0x29e320,null))[_0x387d('0x28')](removeEntity(_0x29e320,null))['catch'](handleError(_0x29e320,null));};
\ No newline at end of file
index fa674db..4fa496a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d3=['moment','rimraf','./disposition.attributes','exports','define','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x25d3,0x1b2));var _0x325d=function(_0x30dfef,_0x334867){_0x30dfef=_0x30dfef-0x0;var _0x3a7d6d=_0x25d3[_0x30dfef];return _0x3a7d6d;};'use strict';var _=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var logger=require(_0x325d('0x2'))('api');var moment=require(_0x325d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x325d('0x4'));var config=require('../../config/environment');var attributes=require(_0x325d('0x5'));module[_0x325d('0x6')]=function(_0x535e88,_0x483d29){return _0x535e88[_0x325d('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x325d('0x8'),'fields':[_0x325d('0x9'),_0x325d('0xa')]},{'unique':!![],'name':'name_chat','fields':[_0x325d('0x9'),_0x325d('0xb')]},{'unique':!![],'name':_0x325d('0xc'),'fields':['name',_0x325d('0xd')]},{'unique':!![],'name':'name_sms','fields':[_0x325d('0x9'),'SmsAccountId']},{'unique':!![],'name':_0x325d('0xe'),'fields':[_0x325d('0x9'),_0x325d('0xf')]},{'unique':!![],'name':_0x325d('0x10'),'fields':[_0x325d('0x9'),_0x325d('0x11')]},{'unique':!![],'name':'name_whatsapp','fields':['name',_0x325d('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cbe=['exports','Disposition','tools_dispositions','name_voice','name','name_chat','name_mail','MailAccountId','SmsAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x4de26a,_0x1364b1){var _0x508b26=function(_0x25a877){while(--_0x25a877){_0x4de26a['push'](_0x4de26a['shift']());}};_0x508b26(++_0x1364b1);}(_0x6cbe,0xd6));var _0xe6cb=function(_0x37c85b,_0x4b0a19){_0x37c85b=_0x37c85b-0x0;var _0x4e3569=_0x6cbe[_0x37c85b];return _0x4e3569;};'use strict';var _=require(_0xe6cb('0x0'));var util=require(_0xe6cb('0x1'));var logger=require(_0xe6cb('0x2'))(_0xe6cb('0x3'));var moment=require(_0xe6cb('0x4'));var BPromise=require(_0xe6cb('0x5'));var rp=require(_0xe6cb('0x6'));var fs=require('fs');var path=require(_0xe6cb('0x7'));var rimraf=require(_0xe6cb('0x8'));var config=require(_0xe6cb('0x9'));var attributes=require(_0xe6cb('0xa'));module[_0xe6cb('0xb')]=function(_0x2b6f3e,_0x5d37af){return _0x2b6f3e['define'](_0xe6cb('0xc'),attributes,{'tableName':_0xe6cb('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe6cb('0xe'),'fields':[_0xe6cb('0xf'),'ListId']},{'unique':!![],'name':_0xe6cb('0x10'),'fields':[_0xe6cb('0xf'),'ChatWebsiteId']},{'unique':!![],'name':_0xe6cb('0x11'),'fields':[_0xe6cb('0xf'),_0xe6cb('0x12')]},{'unique':!![],'name':'name_sms','fields':[_0xe6cb('0xf'),_0xe6cb('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0xe6cb('0xf'),_0xe6cb('0x14')]},{'unique':!![],'name':_0xe6cb('0x15'),'fields':['name',_0xe6cb('0x16')]},{'unique':!![],'name':_0xe6cb('0x17'),'fields':[_0xe6cb('0xf'),_0xe6cb('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
index c422690..2233484 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(_0x1b83fe,_0xcfc1bc){var _0x4c1722=function(_0x1208be){while(--_0x1208be){_0x1b83fe['push'](_0x1b83fe['shift']());}};_0x4c1722(++_0xcfc1bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x3daf53,_0x582c91){var _0x13e433=function(_0x3ac2bf){while(--_0x3ac2bf){_0x3daf53['push'](_0x3daf53['shift']());}};_0x13e433(++_0x582c91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 dc258db..92168f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc26e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','show','create','update','delete','/:id','destroy','util','path','express','fs-extra','../../components/auth/service'];(function(_0x2f7cd0,_0x547a97){var _0x4dc774=function(_0x573760){while(--_0x573760){_0x2f7cd0['push'](_0x2f7cd0['shift']());}};_0x4dc774(++_0x547a97);}(_0xc26e,0x109));var _0xec26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc26e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xec26('0x0'));var path=require(_0xec26('0x1'));var timeout=require('connect-timeout');var express=require(_0xec26('0x2'));var router=express['Router']();var fs_extra=require(_0xec26('0x3'));var auth=require(_0xec26('0x4'));var interaction=require(_0xec26('0x5'));var config=require(_0xec26('0x6'));var controller=require('./disposition.controller');router[_0xec26('0x7')]('/',auth[_0xec26('0x8')](),controller['index']);router[_0xec26('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xec26('0x9')]);router['post']('/',auth[_0xec26('0x8')](),controller[_0xec26('0xa')]);router['put']('/:id',auth[_0xec26('0x8')](),controller[_0xec26('0xb')]);router[_0xec26('0xc')](_0xec26('0xd'),auth[_0xec26('0x8')](),controller[_0xec26('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x4aa8=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','/:id','show','post','create','put'];(function(_0x46f34a,_0x533acd){var _0xf617fe=function(_0x9bdd2e){while(--_0x9bdd2e){_0x46f34a['push'](_0x46f34a['shift']());}};_0xf617fe(++_0x533acd);}(_0x4aa8,0x88));var _0x84aa=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x4aa8[_0x1c8c28];return _0x1f59b4;};'use strict';var multer=require(_0x84aa('0x0'));var util=require('util');var path=require(_0x84aa('0x1'));var timeout=require(_0x84aa('0x2'));var express=require(_0x84aa('0x3'));var router=express[_0x84aa('0x4')]();var fs_extra=require(_0x84aa('0x5'));var auth=require(_0x84aa('0x6'));var interaction=require(_0x84aa('0x7'));var config=require(_0x84aa('0x8'));var controller=require(_0x84aa('0x9'));router['get']('/',auth[_0x84aa('0xa')](),controller['index']);router['get'](_0x84aa('0xb'),auth['isAuthenticated'](),controller[_0x84aa('0xc')]);router[_0x84aa('0xd')]('/',auth[_0x84aa('0xa')](),controller[_0x84aa('0xe')]);router[_0x84aa('0xf')](_0x84aa('0xb'),auth[_0x84aa('0xa')](),controller[_0x84aa('0x10')]);router[_0x84aa('0x11')](_0x84aa('0xb'),auth[_0x84aa('0xa')](),controller[_0x84aa('0x12')]);module['exports']=router;
\ No newline at end of file
index 6bf5972..86957f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ac=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','yes','localstationid','ENUM','9600','14400','4800','v17,v27,v29','INTEGER','SIP','TEXT'];(function(_0x5246fd,_0x3e0234){var _0x427e84=function(_0x422d56){while(--_0x422d56){_0x5246fd['push'](_0x5246fd['shift']());}};_0x427e84(++_0x3e0234);}(_0xf7ac,0x9d));var _0xcf7a=function(_0x2ca794,_0x3e0030){_0x2ca794=_0x2ca794-0x0;var _0x27b67b=_0xf7ac[_0x2ca794];return _0x27b67b;};'use strict';var Sequelize=require(_0xcf7a('0x0'));module[_0xcf7a('0x1')]={'name':{'type':Sequelize[_0xcf7a('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xcf7a('0x3'),'no'),'defaultValue':_0xcf7a('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xcf7a('0x4')},'minrate':{'type':Sequelize[_0xcf7a('0x5')]('2400','4800','7200',_0xcf7a('0x6'),'12000',_0xcf7a('0x7')),'defaultValue':_0xcf7a('0x8')},'maxrate':{'type':Sequelize[_0xcf7a('0x5')]('2400',_0xcf7a('0x8'),'7200',_0xcf7a('0x6'),'12000',_0xcf7a('0x7')),'defaultValue':_0xcf7a('0x7')},'modem':{'type':Sequelize[_0xcf7a('0x2')],'defaultValue':_0xcf7a('0x9')},'gateway':{'type':Sequelize['STRING'],'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[_0xcf7a('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xcf7a('0x5')]('SIP','IAX','DADHI','KHOMP'),'defaultValue':_0xcf7a('0xb')},'key':{'type':Sequelize[_0xcf7a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcf7a('0xc')],'defaultValue':function(){return _0xcf7a('0xd');}},'notificationSound':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'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['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xcf7a('0xe')],'defaultValue':![],'comment':_0xcf7a('0xf'),'set':function(_0x43df0b){if(!_0x43df0b)this[_0xcf7a('0x10')]('mandatoryDispositionPauseId',null);this[_0xcf7a('0x10')]('mandatoryDisposition',_0x43df0b);}}};
\ No newline at end of file
+var _0x87bf=['v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','xCALLY\x20Motion\x20Fax','localstationid','4800','12000','7200','9600','14400'];(function(_0x12bd4f,_0x1cc07e){var _0xab3f87=function(_0x5099b2){while(--_0x5099b2){_0x12bd4f['push'](_0x12bd4f['shift']());}};_0xab3f87(++_0x1cc07e);}(_0x87bf,0x90));var _0xf87b=function(_0x17558f,_0x42f9f5){_0x17558f=_0x17558f-0x0;var _0x4a81a5=_0x87bf[_0x17558f];return _0x4a81a5;};'use strict';var Sequelize=require(_0xf87b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf87b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf87b('0x1')]},'ecm':{'type':Sequelize[_0xf87b('0x2')]('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xf87b('0x1')],'defaultValue':_0xf87b('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xf87b('0x4')},'minrate':{'type':Sequelize[_0xf87b('0x2')]('2400',_0xf87b('0x5'),'7200','9600',_0xf87b('0x6'),'14400'),'defaultValue':_0xf87b('0x5')},'maxrate':{'type':Sequelize[_0xf87b('0x2')]('2400',_0xf87b('0x5'),_0xf87b('0x7'),_0xf87b('0x8'),_0xf87b('0x6'),_0xf87b('0x9')),'defaultValue':_0xf87b('0x9')},'modem':{'type':Sequelize[_0xf87b('0x1')],'defaultValue':_0xf87b('0xa')},'gateway':{'type':Sequelize[_0xf87b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf87b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf87b('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xf87b('0xc'),_0xf87b('0xd'),_0xf87b('0xe'),_0xf87b('0xf')),'defaultValue':_0xf87b('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf87b('0x10');}},'notificationSound':{'type':Sequelize[_0xf87b('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf87b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf87b('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf87b('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf87b('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf87b('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf87b('0x11')],'defaultValue':![],'comment':_0xf87b('0x12'),'set':function(_0x362198){if(!_0x362198)this[_0xf87b('0x13')](_0xf87b('0x14'),null);this[_0xf87b('0x13')](_0xf87b('0x15'),_0x362198);}}};
\ No newline at end of file
index 98ae18a..46e3df7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf42f=['minrate','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','bulkCreate','createdAt','updatedAt','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','then','stack','name','index','Pause','map','FaxAccount','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','include','rows','show','params','mandatoryDispositionPause','keys','rawAttributes','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','FaxAccountId','Disposition','getDispositions','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','addInteraction','omit','findOne','FaxInteraction','Contact','User','Owner','fullname','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm','headerinfo','maxrate'];(function(_0x493a51,_0x45128c){var _0xc85756=function(_0x2c39a8){while(--_0x2c39a8){_0x493a51['push'](_0x493a51['shift']());}};_0xc85756(++_0x45128c);}(_0xf42f,0x1ab));var _0xff42=function(_0x5cd2ba,_0x32b007){_0x5cd2ba=_0x5cd2ba-0x0;var _0x46bc68=_0xf42f[_0x5cd2ba];return _0x46bc68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff42('0x0'));var zipdir=require(_0xff42('0x1'));var jsonpatch=require(_0xff42('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xff42('0x3'));var Mustache=require(_0xff42('0x4'));var util=require(_0xff42('0x5'));var path=require(_0xff42('0x6'));var sox=require(_0xff42('0x7'));var csv=require(_0xff42('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff42('0x9'));var _=require(_0xff42('0xa'));var squel=require(_0xff42('0xb'));var crypto=require(_0xff42('0xc'));var jsforce=require(_0xff42('0xd'));var deskjs=require(_0xff42('0xe'));var toCsv=require(_0xff42('0x8'));var querystring=require(_0xff42('0xf'));var Papa=require('papaparse');var Redis=require(_0xff42('0x10'));var authService=require(_0xff42('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xff42('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff42('0x13'))(_0xff42('0x14'));var utils=require(_0xff42('0x15'));var config=require(_0xff42('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xff42('0x17'))['db'];config[_0xff42('0x18')]=_[_0xff42('0x19')](config['redis'],{'host':_0xff42('0x1a'),'port':0x18eb});var socket=require(_0xff42('0x1b'))(new Redis(config[_0xff42('0x18')]));require(_0xff42('0x1c'))[_0xff42('0x1d')](socket);var jayson=require(_0xff42('0x1e'));var client=jayson[_0xff42('0x1f')][_0xff42('0x20')]({'port':0x232c});var client9002=jayson[_0xff42('0x1f')][_0xff42('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x56bad2,_0x76bc8a,_0xbb1ebe,_0x5cacab){return new BPromise(function(_0x1c3218,_0x4bd868){var _0x3f16e7=_0x5cacab||client;return _0x3f16e7['request'](_0x56bad2,_0xbb1ebe)['then'](function(_0x5baee7){logger[_0xff42('0x21')](_0xff42('0x22'),_0x76bc8a,_0xff42('0x23'));logger['debug'](_0xff42('0x24'),_0x76bc8a,_0xff42('0x23'),JSON[_0xff42('0x25')](_0x5baee7));if(_0x5baee7[_0xff42('0x26')]){if(_0x5baee7[_0xff42('0x26')][_0xff42('0x27')]===0x1f4){logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x5baee7['error'][_0xff42('0x28')]);return _0x4bd868(_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);}logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);return _0x1c3218(_0x5baee7[_0xff42('0x26')][_0xff42('0x28')]);}else{logger[_0xff42('0x21')](_0xff42('0x22'),_0x76bc8a,'request\x20sent');_0x1c3218(_0x5baee7['result'][_0xff42('0x28')]);}})[_0xff42('0x29')](function(_0x58e40e){logger[_0xff42('0x26')](_0xff42('0x22'),_0x76bc8a,_0x58e40e);_0x4bd868(_0x58e40e);});});}function respondWithStatusCode(_0x50e8c1,_0x328d72){_0x328d72=_0x328d72||0xcc;return function(_0x41be68){if(_0x41be68){return _0x50e8c1[_0xff42('0x2a')](_0x328d72);}return _0x50e8c1['status'](_0x328d72)[_0xff42('0x2b')]();};}function respondWithResult(_0x19e0c2,_0x4380c4){_0x4380c4=_0x4380c4||0xc8;return function(_0x396efb){if(_0x396efb){return _0x19e0c2[_0xff42('0x2c')](_0x4380c4)[_0xff42('0x2d')](_0x396efb);}};}function respondWithFilteredResult(_0x4f6931,_0x27b162){return function(_0x161234){if(_0x161234){var _0x1d0fa9=typeof _0x27b162['offset']==='undefined'&&typeof _0x27b162[_0xff42('0x2e')]===_0xff42('0x2f');var _0x476f88=_0x161234[_0xff42('0x30')];var _0x1deefb=_0x1d0fa9?0x0:_0x27b162[_0xff42('0x31')];var _0x2a42ee=_0x1d0fa9?_0x161234[_0xff42('0x30')]:_0x27b162[_0xff42('0x31')]+_0x27b162['limit'];var _0x4e0aa6;if(_0x2a42ee>=_0x476f88){_0x2a42ee=_0x476f88;_0x4e0aa6=0xc8;}else{_0x4e0aa6=0xce;}_0x4f6931[_0xff42('0x2c')](_0x4e0aa6);return _0x4f6931[_0xff42('0x32')]('Content-Range',_0x1deefb+'-'+_0x2a42ee+'/'+_0x476f88)['json'](_0x161234);}return null;};}function patchUpdates(_0x552797){return function(_0x47c4c3){try{jsonpatch[_0xff42('0x33')](_0x47c4c3,_0x552797,!![]);}catch(_0x5dd14f){return BPromise[_0xff42('0x34')](_0x5dd14f);}return _0x47c4c3[_0xff42('0x35')]();};}function saveUpdates(_0x5a0832,_0x5b9cbb){return function(_0x19a3b5){if(_0x19a3b5){return _0x19a3b5[_0xff42('0x36')](_0x5a0832)['then'](function(_0x3eda62){return _0x3eda62;});}return null;};}function removeEntity(_0x1a044f,_0x31eea5){return function(_0x114011){if(_0x114011){return _0x114011[_0xff42('0x37')]()['then'](function(){var _0x4494fa=_0x114011[_0xff42('0x38')]({'plain':!![]});var _0x43ed21=_0xff42('0x39');return db[_0xff42('0x3a')][_0xff42('0x37')]({'where':{'type':_0x43ed21,'resourceId':_0x4494fa['id']}})['then'](function(){return _0x114011;});})[_0xff42('0x3b')](function(){_0x1a044f[_0xff42('0x2c')](0xcc)[_0xff42('0x2b')]();});}};}function handleEntityNotFound(_0x27203b,_0x3f6a94){return function(_0x4395f6){if(!_0x4395f6){_0x27203b[_0xff42('0x2a')](0x194);}return _0x4395f6;};}function handleError(_0x1259da,_0x510c4c){_0x510c4c=_0x510c4c||0x1f4;return function(_0x352ae2){logger[_0xff42('0x26')](_0x352ae2[_0xff42('0x3c')]);if(_0x352ae2[_0xff42('0x3d')]){delete _0x352ae2[_0xff42('0x3d')];}_0x1259da[_0xff42('0x2c')](_0x510c4c)['send'](_0x352ae2);};}exports[_0xff42('0x3e')]=function(_0x108d3f,_0x10e90a){var _0x2022c3={'include':[{'model':db[_0xff42('0x3f')],'as':'mandatoryDispositionPause'}]},_0x40e75e={},_0x13fba8={'count':0x0,'rows':[]};var _0x4ff9dc=_[_0xff42('0x40')](db[_0xff42('0x41')]['rawAttributes'],function(_0x585129){return{'name':_0x585129['fieldName'],'type':_0x585129['type'][_0xff42('0x42')]};});_0x40e75e['model']=_['map'](_0x4ff9dc,_0xff42('0x3d'));_0x40e75e[_0xff42('0x43')]=_['keys'](_0x108d3f[_0xff42('0x43')]);_0x40e75e[_0xff42('0x44')]=_[_0xff42('0x45')](_0x40e75e[_0xff42('0x46')],_0x40e75e[_0xff42('0x43')]);_0x2022c3['attributes']=_[_0xff42('0x45')](_0x40e75e[_0xff42('0x46')],qs[_0xff42('0x47')](_0x108d3f[_0xff42('0x43')]['fields']));_0x2022c3[_0xff42('0x48')]=_0x2022c3[_0xff42('0x48')][_0xff42('0x49')]?_0x2022c3['attributes']:_0x40e75e[_0xff42('0x46')];if(!_0x108d3f[_0xff42('0x43')][_0xff42('0x4a')]('nolimit')){_0x2022c3[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x108d3f['query'][_0xff42('0x2e')]);_0x2022c3[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x108d3f[_0xff42('0x43')][_0xff42('0x31')]);}_0x2022c3[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x108d3f[_0xff42('0x43')][_0xff42('0x4c')]);_0x2022c3[_0xff42('0x4d')]=qs[_0xff42('0x44')](_['pick'](_0x108d3f['query'],_0x40e75e[_0xff42('0x44')]),_0x4ff9dc);if(_0x108d3f[_0xff42('0x43')][_0xff42('0x4e')]){_0x2022c3[_0xff42('0x4d')]=_[_0xff42('0x4f')](_0x2022c3['where'],{'$or':_['map'](_0x4ff9dc,function(_0xd3bbeb){if(_0xd3bbeb['type']!==_0xff42('0x50')){var _0x3c8d23={};_0x3c8d23[_0xd3bbeb[_0xff42('0x3d')]]={'$like':'%'+_0x108d3f[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x3c8d23;}})});}_0x2022c3=_[_0xff42('0x4f')]({},_0x2022c3,_0x108d3f['options']);var _0x5bd324={'where':_0x2022c3[_0xff42('0x4d')]};return db[_0xff42('0x41')][_0xff42('0x30')](_0x5bd324)['then'](function(_0x341ec7){_0x13fba8[_0xff42('0x30')]=_0x341ec7;if(_0x108d3f['query']['includeAll']){_0x2022c3[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x41')]['findAll'](_0x2022c3);})[_0xff42('0x3b')](function(_0x492f67){_0x13fba8[_0xff42('0x52')]=_0x492f67;return _0x13fba8;})[_0xff42('0x3b')](respondWithFilteredResult(_0x10e90a,_0x2022c3))[_0xff42('0x29')](handleError(_0x10e90a,null));};exports[_0xff42('0x53')]=function(_0x3a3c10,_0x41bba8){var _0x142300={'raw':![],'where':{'id':_0x3a3c10[_0xff42('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xff42('0x55')}]},_0x1fc2ba={};_0x1fc2ba[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x41')][_0xff42('0x57')]);_0x1fc2ba['query']=_[_0xff42('0x56')](_0x3a3c10['query']);_0x1fc2ba[_0xff42('0x44')]=_[_0xff42('0x45')](_0x1fc2ba[_0xff42('0x46')],_0x1fc2ba['query']);_0x142300['attributes']=_[_0xff42('0x45')](_0x1fc2ba[_0xff42('0x46')],qs[_0xff42('0x47')](_0x3a3c10[_0xff42('0x43')][_0xff42('0x47')]));_0x142300['attributes']=_0x142300[_0xff42('0x48')][_0xff42('0x49')]?_0x142300[_0xff42('0x48')]:_0x1fc2ba[_0xff42('0x46')];if(_0x3a3c10[_0xff42('0x43')][_0xff42('0x58')]){_0x142300[_0xff42('0x51')]=[{'all':!![]}];}_0x142300=_[_0xff42('0x4f')]({},_0x142300,_0x3a3c10[_0xff42('0x59')]);return db[_0xff42('0x41')]['find'](_0x142300)[_0xff42('0x3b')](handleEntityNotFound(_0x41bba8,null))[_0xff42('0x3b')](respondWithResult(_0x41bba8,null))['catch'](handleError(_0x41bba8,null));};exports['create']=function(_0x2b86d2,_0x511e1e){return db[_0xff42('0x41')][_0xff42('0x5a')](_0x2b86d2[_0xff42('0x5b')],{})[_0xff42('0x3b')](function(_0x102c33){var _0x2343a6=_0x2b86d2[_0xff42('0x5c')][_0xff42('0x38')]({'plain':!![]});if(!_0x2343a6)throw new Error(_0xff42('0x5d'));if(_0x2343a6[_0xff42('0x5e')]===_0xff42('0x5c')){var _0x412542=_0x102c33['get']({'plain':!![]});var _0x3e062c=_0xff42('0x39');return db['UserProfileSection'][_0xff42('0x5f')]({'where':{'name':_0x3e062c,'userProfileId':_0x2343a6[_0xff42('0x60')]},'raw':!![]})['then'](function(_0x1f85c8){if(_0x1f85c8&&_0x1f85c8[_0xff42('0x61')]===0x0){return db[_0xff42('0x3a')][_0xff42('0x5a')]({'name':_0x412542[_0xff42('0x3d')],'resourceId':_0x412542['id'],'type':_0x1f85c8[_0xff42('0x3d')],'sectionId':_0x1f85c8['id']},{})[_0xff42('0x3b')](function(){return _0x102c33;});}else{return _0x102c33;}})[_0xff42('0x29')](function(_0x5bf116){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bf116);throw _0x5bf116;});}return _0x102c33;})['then'](respondWithResult(_0x511e1e,0xc9))[_0xff42('0x29')](handleError(_0x511e1e,null));};exports[_0xff42('0x36')]=function(_0x20e1c6,_0x20a293){if(_0x20e1c6[_0xff42('0x5b')]['id']){delete _0x20e1c6['body']['id'];}return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x20e1c6[_0xff42('0x54')]['id']},'include':[{'model':db[_0xff42('0x3f')],'as':'mandatoryDispositionPause'}]})[_0xff42('0x3b')](handleEntityNotFound(_0x20a293,null))[_0xff42('0x3b')](saveUpdates(_0x20e1c6['body'],null))[_0xff42('0x3b')](respondWithResult(_0x20a293,null))['catch'](handleError(_0x20a293,null));};exports[_0xff42('0x37')]=function(_0x2f9df3,_0x45b216){return db['FaxAccount']['find']({'where':{'id':_0x2f9df3[_0xff42('0x54')]['id']}})['then'](handleEntityNotFound(_0x45b216,null))[_0xff42('0x3b')](removeEntity(_0x45b216,null))[_0xff42('0x29')](handleError(_0x45b216,null));};exports[_0xff42('0x62')]=function(_0x2c7010,_0x202e09){return db['FaxAccount'][_0xff42('0x62')]()['then'](respondWithResult(_0x202e09,null))[_0xff42('0x29')](handleError(_0x202e09,null));};exports['addDisposition']=function(_0x2cb519,_0x4b7da2,_0x4563ab){if(_0x2cb519[_0xff42('0x5b')]['id']){delete _0x2cb519[_0xff42('0x5b')]['id'];}return db['FaxAccount'][_0xff42('0x5f')]({'where':{'id':_0x2cb519[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x4b7da2,null))[_0xff42('0x3b')](function(_0x116883){if(_0x116883){_0x2cb519[_0xff42('0x5b')][_0xff42('0x63')]=_0x116883['id'];return db[_0xff42('0x64')][_0xff42('0x5a')](_0x2cb519[_0xff42('0x5b')]);}})[_0xff42('0x3b')](respondWithResult(_0x4b7da2,null))[_0xff42('0x29')](handleError(_0x4b7da2,null));};exports[_0xff42('0x65')]=function(_0x1fb53e,_0xc5d25,_0x360a58){var _0x248b95={'raw':![],'where':{}};var _0x7ab4e9={};var _0x47200b={'count':0x0,'rows':[]};return db[_0xff42('0x41')]['findOne']({'where':{'id':_0x1fb53e[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0xc5d25,null))['then'](function(_0x4f4c52){if(_0x4f4c52){_0x7ab4e9[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x64')][_0xff42('0x57')]);_0x7ab4e9[_0xff42('0x43')]=_[_0xff42('0x56')](_0x1fb53e[_0xff42('0x43')]);_0x7ab4e9[_0xff42('0x44')]=_[_0xff42('0x45')](_0x7ab4e9['model'],_0x7ab4e9['query']);_0x248b95[_0xff42('0x48')]=_['intersection'](_0x7ab4e9[_0xff42('0x46')],qs[_0xff42('0x47')](_0x1fb53e[_0xff42('0x43')][_0xff42('0x47')]));_0x248b95['attributes']=_0x248b95[_0xff42('0x48')][_0xff42('0x49')]?_0x248b95[_0xff42('0x48')]:_0x7ab4e9['model'];if(!_0x1fb53e[_0xff42('0x43')][_0xff42('0x4a')]('nolimit')){_0x248b95[_0xff42('0x2e')]=qs['limit'](_0x1fb53e[_0xff42('0x43')]['limit']);_0x248b95['offset']=qs[_0xff42('0x31')](_0x1fb53e['query'][_0xff42('0x31')]);}_0x248b95[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x1fb53e[_0xff42('0x43')][_0xff42('0x4c')]);_0x248b95[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0x1fb53e[_0xff42('0x43')],_0x7ab4e9[_0xff42('0x44')]));_0x248b95[_0xff42('0x4d')][_0xff42('0x63')]=_0x4f4c52['id'];if(_0x1fb53e[_0xff42('0x43')]['filter']){_0x248b95[_0xff42('0x4d')]=_['merge'](_0x248b95[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x248b95[_0xff42('0x48')],function(_0x2e24ff){var _0x4a5226={};_0x4a5226[_0x2e24ff]={'$like':'%'+_0x1fb53e[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4a5226;})});}_0x248b95=_[_0xff42('0x4f')]({},_0x248b95,_0x1fb53e[_0xff42('0x59')]);return db['Disposition'][_0xff42('0x30')]({'where':_0x248b95[_0xff42('0x4d')]})[_0xff42('0x3b')](function(_0x4821e9){_0x47200b['count']=_0x4821e9;if(_0x1fb53e[_0xff42('0x43')]['includeAll']){_0x248b95[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x64')][_0xff42('0x67')](_0x248b95);})[_0xff42('0x3b')](function(_0x48e058){_0x47200b['rows']=_0x48e058;return _0x47200b;});}})[_0xff42('0x3b')](respondWithFilteredResult(_0xc5d25,_0x248b95))[_0xff42('0x29')](handleError(_0xc5d25,null));};exports[_0xff42('0x68')]=function(_0x1e7fb9,_0x43fb73,_0x3d04e7){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x1e7fb9[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x43fb73,null))[_0xff42('0x3b')](function(_0x42769b){if(_0x42769b){return _0x42769b['removeDispositions'](_0x1e7fb9[_0xff42('0x43')][_0xff42('0x69')]);}})[_0xff42('0x3b')](respondWithStatusCode(_0x43fb73,null))[_0xff42('0x29')](handleError(_0x43fb73,null));};exports[_0xff42('0x6a')]=function(_0x1b904,_0x11341e,_0x26278f){if(_0x1b904[_0xff42('0x5b')]['id']){delete _0x1b904[_0xff42('0x5b')]['id'];}return db[_0xff42('0x41')]['find']({'where':{'id':_0x1b904[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x11341e,null))[_0xff42('0x3b')](function(_0x3864d8){if(_0x3864d8){_0x1b904[_0xff42('0x5b')][_0xff42('0x63')]=_0x3864d8['id'];return db[_0xff42('0x6b')][_0xff42('0x5a')](_0x1b904[_0xff42('0x5b')]);}})[_0xff42('0x3b')](respondWithResult(_0x11341e,null))['catch'](handleError(_0x11341e,null));};exports[_0xff42('0x6c')]=function(_0xa1e519,_0x4b74f3,_0x4c9791){var _0x2eacfd={'raw':![],'where':{}};var _0x25a4b5={};var _0x38a6aa={'count':0x0,'rows':[]};return db[_0xff42('0x41')]['findOne']({'where':{'id':_0xa1e519[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x4b74f3,null))[_0xff42('0x3b')](function(_0x4a8f39){if(_0x4a8f39){_0x25a4b5[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x6b')][_0xff42('0x57')]);_0x25a4b5['query']=_['keys'](_0xa1e519[_0xff42('0x43')]);_0x25a4b5[_0xff42('0x44')]=_['intersection'](_0x25a4b5[_0xff42('0x46')],_0x25a4b5[_0xff42('0x43')]);_0x2eacfd['attributes']=_[_0xff42('0x45')](_0x25a4b5['model'],qs[_0xff42('0x47')](_0xa1e519[_0xff42('0x43')]['fields']));_0x2eacfd['attributes']=_0x2eacfd['attributes'][_0xff42('0x49')]?_0x2eacfd['attributes']:_0x25a4b5[_0xff42('0x46')];if(!_0xa1e519[_0xff42('0x43')]['hasOwnProperty'](_0xff42('0x6d'))){_0x2eacfd['limit']=qs[_0xff42('0x2e')](_0xa1e519['query'][_0xff42('0x2e')]);_0x2eacfd['offset']=qs['offset'](_0xa1e519[_0xff42('0x43')]['offset']);}_0x2eacfd[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0xa1e519[_0xff42('0x43')]['sort']);_0x2eacfd[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0xa1e519[_0xff42('0x43')],_0x25a4b5[_0xff42('0x44')]));_0x2eacfd[_0xff42('0x4d')][_0xff42('0x63')]=_0x4a8f39['id'];if(_0xa1e519[_0xff42('0x43')][_0xff42('0x4e')]){_0x2eacfd['where']=_[_0xff42('0x4f')](_0x2eacfd[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x2eacfd['attributes'],function(_0x556d15){var _0x4e1136={};_0x4e1136[_0x556d15]={'$like':'%'+_0xa1e519[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4e1136;})});}_0x2eacfd=_['merge']({},_0x2eacfd,_0xa1e519[_0xff42('0x59')]);return db[_0xff42('0x6b')]['count']({'where':_0x2eacfd[_0xff42('0x4d')]})['then'](function(_0x169980){_0x38a6aa[_0xff42('0x30')]=_0x169980;if(_0xa1e519[_0xff42('0x43')][_0xff42('0x58')]){_0x2eacfd[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x6b')][_0xff42('0x67')](_0x2eacfd);})[_0xff42('0x3b')](function(_0x457344){_0x38a6aa['rows']=_0x457344;return _0x38a6aa;});}})['then'](respondWithFilteredResult(_0x4b74f3,_0x2eacfd))[_0xff42('0x29')](handleError(_0x4b74f3,null));};exports[_0xff42('0x6e')]=function(_0x369efc,_0x2b6232,_0x2f1ee8){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x369efc[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2b6232,null))[_0xff42('0x3b')](function(_0x5ae098){if(_0x5ae098){return _0x5ae098['removeAnswers'](_0x369efc['query']['ids']);}})[_0xff42('0x3b')](respondWithStatusCode(_0x2b6232,null))[_0xff42('0x29')](handleError(_0x2b6232,null));};exports[_0xff42('0x6f')]=function(_0x3c6b47,_0x14b02d,_0x28fa33){return db['FaxInteraction']['find']({'where':{'id':_0x3c6b47[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x14b02d,null))[_0xff42('0x3b')](function(_0x1c5f4d){if(_0x1c5f4d){return _0x1c5f4d[_0xff42('0x6f')](_0x3c6b47['body'][_0xff42('0x69')],_[_0xff42('0x70')](_0x3c6b47[_0xff42('0x5b')],[_0xff42('0x69'),'id'])||{});}})[_0xff42('0x3b')](respondWithResult(_0x14b02d,null))[_0xff42('0x29')](handleError(_0x14b02d,null));};exports['getInteractions']=function(_0x4d7875,_0x25d9b1,_0x54a07d){var _0x1dc0d4={'raw':![],'where':{}};var _0x2d60a4={};var _0x4f4f0d={'count':0x0,'rows':[]};return db[_0xff42('0x41')][_0xff42('0x71')]({'where':{'id':_0x4d7875[_0xff42('0x54')]['id']}})['then'](handleEntityNotFound(_0x25d9b1,null))[_0xff42('0x3b')](function(_0x271e91){if(_0x271e91){_0x2d60a4[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x72')][_0xff42('0x57')]);_0x2d60a4[_0xff42('0x43')]=_['keys'](_0x4d7875[_0xff42('0x43')]);_0x2d60a4[_0xff42('0x44')]=_[_0xff42('0x45')](_0x2d60a4[_0xff42('0x46')],_0x2d60a4['query']);_0x1dc0d4[_0xff42('0x48')]=_[_0xff42('0x45')](_0x2d60a4[_0xff42('0x46')],qs[_0xff42('0x47')](_0x4d7875[_0xff42('0x43')][_0xff42('0x47')]));_0x1dc0d4[_0xff42('0x48')]=_0x1dc0d4[_0xff42('0x48')][_0xff42('0x49')]?_0x1dc0d4[_0xff42('0x48')]:_0x2d60a4[_0xff42('0x46')];if(!_0x4d7875[_0xff42('0x43')][_0xff42('0x4a')](_0xff42('0x6d'))){_0x1dc0d4[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x4d7875[_0xff42('0x43')][_0xff42('0x2e')]);_0x1dc0d4[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x4d7875[_0xff42('0x43')]['offset']);}_0x1dc0d4[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x4d7875['query'][_0xff42('0x4c')]);_0x1dc0d4[_0xff42('0x4d')]=qs['filters'](_[_0xff42('0x66')](_0x4d7875[_0xff42('0x43')],_0x2d60a4['filters']));_0x1dc0d4[_0xff42('0x4d')]['FaxAccountId']=_0x271e91['id'];if(_0x4d7875[_0xff42('0x43')][_0xff42('0x4e')]){_0x1dc0d4[_0xff42('0x4d')]=_['merge'](_0x1dc0d4[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0x1dc0d4[_0xff42('0x48')],function(_0x5a1843){var _0x399fba={};_0x399fba[_0x5a1843]={'$like':'%'+_0x4d7875[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x399fba;})});}_0x1dc0d4=_['merge']({},_0x1dc0d4,_0x4d7875['options']);return db[_0xff42('0x72')]['count']({'where':_0x1dc0d4[_0xff42('0x4d')]})[_0xff42('0x3b')](function(_0x2b356c){_0x4f4f0d['count']=_0x2b356c;if(_0x4d7875[_0xff42('0x43')][_0xff42('0x58')]){_0x1dc0d4[_0xff42('0x51')]=[{'model':db['CmContact'],'as':_0xff42('0x73'),'required':![]},{'model':db[_0xff42('0x74')],'as':_0xff42('0x75'),'attributes':['name',_0xff42('0x76'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xff42('0x3d'),_0xff42('0x77')],'where':_0x4d7875['query']['tag']?{'id':_0x4d7875[_0xff42('0x43')][_0xff42('0x78')]}:undefined,'required':_0x4d7875['query'][_0xff42('0x78')]?!![]:![]}];}return db[_0xff42('0x72')][_0xff42('0x67')](_0x1dc0d4);})[_0xff42('0x3b')](function(_0x3409f2){_0x4f4f0d['rows']=_0x3409f2;return _0x4f4f0d;});}})[_0xff42('0x3b')](respondWithFilteredResult(_0x25d9b1,_0x1dc0d4))['catch'](handleError(_0x25d9b1,null));};exports['addApplications']=function(_0x34e2d9,_0x2dccef,_0x3925c1){return db['FaxAccount']['findOne']({'where':{'id':_0x34e2d9['params']['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2dccef,null))['then'](function(_0x2e11c2){if(_0x2e11c2){return db[_0xff42('0x79')][_0xff42('0x7a')](function(_0x5b17c9){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x34e2d9['params']['id']},'transaction':_0x5b17c9})[_0xff42('0x3b')](function(_0x1d0c13){var _0x44fba2=_['map'](_0x34e2d9[_0xff42('0x5b')],function(_0x5c3b9b){_0x5c3b9b[_0xff42('0x63')]=_0x34e2d9['params']['id'];return _0x5c3b9b;});return db[_0xff42('0x7b')]['bulkCreate'](_0x44fba2,{'transaction':_0x5b17c9});});})['then'](function(){return db[_0xff42('0x7b')][_0xff42('0x7c')]({'where':{'FaxAccountId':_0x34e2d9[_0xff42('0x54')]['id']},'order':_0xff42('0x7d')});});}})[_0xff42('0x3b')](respondWithResult(_0x2dccef,null))[_0xff42('0x29')](handleError(_0x2dccef,null));};exports[_0xff42('0x7e')]=function(_0x5a9e31,_0x5a1cd8,_0x4b3263){var _0x540376={};var _0x42fdc3={};var _0x2b0fea;var _0x35ff64;return db[_0xff42('0x41')][_0xff42('0x71')]({'where':{'id':_0x5a9e31[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x5a1cd8,null))[_0xff42('0x3b')](function(_0x3f56c6){if(_0x3f56c6){_0x2b0fea=_0x3f56c6;_0x42fdc3[_0xff42('0x46')]=_['keys'](db[_0xff42('0x7b')]['rawAttributes']);_0x42fdc3[_0xff42('0x43')]=_[_0xff42('0x56')](_0x5a9e31[_0xff42('0x43')]);_0x42fdc3['filters']=_[_0xff42('0x45')](_0x42fdc3[_0xff42('0x46')],_0x42fdc3[_0xff42('0x43')]);_0x540376['attributes']=_[_0xff42('0x45')](_0x42fdc3[_0xff42('0x46')],qs[_0xff42('0x47')](_0x5a9e31['query'][_0xff42('0x47')]));_0x540376[_0xff42('0x48')]=_0x540376[_0xff42('0x48')][_0xff42('0x49')]?_0x540376[_0xff42('0x48')]:_0x42fdc3[_0xff42('0x46')];_0x540376['order']=qs['sort'](_0x5a9e31[_0xff42('0x43')][_0xff42('0x4c')]);_0x540376[_0xff42('0x4d')]=qs[_0xff42('0x44')](_[_0xff42('0x66')](_0x5a9e31['query'],_0x42fdc3[_0xff42('0x44')]));if(_0x5a9e31['query'][_0xff42('0x4e')]){_0x540376['where']=_[_0xff42('0x4f')](_0x540376['where'],{'$or':_[_0xff42('0x40')](_0x540376[_0xff42('0x48')],function(_0x17cd07){var _0x14a2ca={};_0x14a2ca[_0x17cd07]={'$like':'%'+_0x5a9e31['query'][_0xff42('0x4e')]+'%'};return _0x14a2ca;})});}_0x540376=_['merge']({},_0x540376,_0x5a9e31[_0xff42('0x59')]);return _0x2b0fea[_0xff42('0x7e')](_0x540376);}})['then'](function(_0x93691f){if(_0x93691f){_0x35ff64=_0x93691f[_0xff42('0x49')];if(!_0x5a9e31['query'][_0xff42('0x4a')](_0xff42('0x6d'))){_0x540376[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x5a9e31[_0xff42('0x43')][_0xff42('0x2e')]);_0x540376[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x5a9e31['query']['offset']);}return _0x2b0fea[_0xff42('0x7e')](_0x540376);}})[_0xff42('0x3b')](function(_0x150dd8){if(_0x150dd8){return _0x150dd8?{'count':_0x35ff64,'rows':_0x150dd8}:null;}})[_0xff42('0x3b')](respondWithResult(_0x5a1cd8,null))[_0xff42('0x29')](handleError(_0x5a1cd8,null));};function Extension(_0x21ad30,_0x2b7a78,_0x1b8114,_0xb50946){this[_0xff42('0x7f')]=_0xff42('0x80');this[_0xff42('0x81')]=_0x21ad30[_0xff42('0x82')];this[_0xff42('0x83')]=_0xb50946;this['type']=_0xff42('0x84');this[_0xff42('0x85')]=_0xff42('0x86');this[_0xff42('0x63')]=_0x21ad30['id'];this[_0xff42('0x7d')]=_0x2b7a78;this['appdata']=_0x1b8114;}function createExtensionsReciveFax(_0xd865f0){var _0x4de3d9=0x1;var _0x4e89b3=[];_0x4e89b3['push'](new Extension(_0xd865f0,_0x4de3d9,'','Answer'));_0x4de3d9+=0x1;_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x88'),'Set'));_0x4de3d9+=0x1;for(var _0x545eab in _0xd865f0){if(_0xd865f0[_0xff42('0x4a')](_0x545eab)&&(_0x545eab===_0xff42('0x89')||_0x545eab===_0xff42('0x82')||_0x545eab==='gateway'||_0x545eab==='faxdetect'||_0x545eab===_0xff42('0x8a')||_0x545eab===_0xff42('0x8b')||_0x545eab===_0xff42('0x8c')||_0x545eab==='modem'||_0x545eab===_0xff42('0x8d'))){_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x8e')+_0x545eab+')='+_0xd865f0[_0x545eab],_0xff42('0x8f')));_0x4de3d9+=0x1;}}_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,'6',_0xff42('0x90')));_0x4de3d9+=0x1;_0x4e89b3[_0xff42('0x87')](new Extension(_0xd865f0,_0x4de3d9,_0xff42('0x91'),_0xff42('0x92')));_0x4de3d9=0x0;return _0x4e89b3;}exports['addAccountApplications']=function(_0x943d07,_0x19fed5,_0x1f9a21){var _0x5da55e;return db['sequelize'][_0xff42('0x7a')](function(_0x26f9aa){return db[_0xff42('0x41')][_0xff42('0x5a')](_0x943d07[_0xff42('0x5b')],{'transaction':_0x26f9aa})['then'](function(_0x2a6c6f){_0x5da55e=_0x2a6c6f['get']({'plain':!![]});return db[_0xff42('0x93')]['bulkCreate'](createExtensionsReciveFax(_0x5da55e),{'transaction':_0x26f9aa});});})[_0xff42('0x3b')](function(){return _0x5da55e;})['then'](respondWithResult(_0x19fed5,null))[_0xff42('0x29')](handleError(_0x19fed5,null));};exports[_0xff42('0x94')]=function(_0xfa47ec,_0x17ee0c,_0x3380fb){var _0x1151e5;return db[_0xff42('0x79')][_0xff42('0x7a')](function(_0x213034){return db[_0xff42('0x41')][_0xff42('0x36')](_0xfa47ec[_0xff42('0x5b')],{'where':{'id':_0xfa47ec[_0xff42('0x5b')]['id']},'transaction':_0x213034})[_0xff42('0x3b')](function(_0x5d7679){return db[_0xff42('0x93')]['destroy']({'where':{'FaxAccountId':_0xfa47ec['body']['id']},'transaction':_0x213034})[_0xff42('0x3b')](function(_0x204b5b){return db['VoiceExtension'][_0xff42('0x95')](createExtensionsReciveFax(_[_0xff42('0x70')](_0xfa47ec[_0xff42('0x5b')],['tech',_0xff42('0x42'),_0xff42('0x96'),_0xff42('0x97'),'TrunkId','ListId'])),{'transaction':_0x213034});});});})['then'](function(){return db[_0xff42('0x41')][_0xff42('0x98')](_0xfa47ec['body']['id']);})['then'](respondWithResult(_0x17ee0c,null))[_0xff42('0x29')](handleError(_0x17ee0c,null));};exports[_0xff42('0x99')]=function(_0x1a9c3d,_0x1af310,_0x3d329b){var _0xa98529={'raw':!![],'where':{}};var _0x514d3b={};var _0x2f1793={'count':0x0,'rows':[]};return db['FaxAccount'][_0xff42('0x71')]({'where':{'id':_0x1a9c3d[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x1af310,null))[_0xff42('0x3b')](function(_0x5aed59){if(_0x5aed59){_0x514d3b[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x9a')][_0xff42('0x57')]);_0x514d3b[_0xff42('0x43')]=_[_0xff42('0x56')](_0x1a9c3d[_0xff42('0x43')]);_0x514d3b['filters']=_[_0xff42('0x45')](_0x514d3b[_0xff42('0x46')],_0x514d3b[_0xff42('0x43')]);_0xa98529[_0xff42('0x48')]=_[_0xff42('0x45')](_0x514d3b['model'],qs['fields'](_0x1a9c3d[_0xff42('0x43')][_0xff42('0x47')]));_0xa98529[_0xff42('0x48')]=_0xa98529[_0xff42('0x48')][_0xff42('0x49')]?_0xa98529[_0xff42('0x48')]:_0x514d3b[_0xff42('0x46')];if(!_0x1a9c3d['query'][_0xff42('0x4a')](_0xff42('0x6d'))){_0xa98529['limit']=qs[_0xff42('0x2e')](_0x1a9c3d[_0xff42('0x43')]['limit']);_0xa98529['offset']=qs[_0xff42('0x31')](_0x1a9c3d[_0xff42('0x43')][_0xff42('0x31')]);}_0xa98529[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x1a9c3d[_0xff42('0x43')]['sort']);_0xa98529[_0xff42('0x4d')]=qs[_0xff42('0x44')](_['pick'](_0x1a9c3d['query'],_0x514d3b[_0xff42('0x44')]));_0xa98529[_0xff42('0x4d')][_0xff42('0x63')]=_0x5aed59['id'];if(_0x1a9c3d['query'][_0xff42('0x4e')]){_0xa98529[_0xff42('0x4d')]=_[_0xff42('0x4f')](_0xa98529[_0xff42('0x4d')],{'$or':_[_0xff42('0x40')](_0xa98529['attributes'],function(_0x47485f){var _0x4a17e0={};_0x4a17e0[_0x47485f]={'$like':'%'+_0x1a9c3d[_0xff42('0x43')][_0xff42('0x4e')]+'%'};return _0x4a17e0;})});}if(_0x1a9c3d[_0xff42('0x43')][_0xff42('0x9b')]){var _0x2dfa0f=_0x1a9c3d[_0xff42('0x43')][_0xff42('0x9b')][_0xff42('0x9c')](',');var _0x335cc3={};_0x335cc3[_0x2dfa0f[0x0]]={'$gte':moment(_0x2dfa0f[0x1])[_0xff42('0x9d')](_0xff42('0x9e'))};_0xa98529['where']=_[_0xff42('0x4f')](_0xa98529['where'],_0x335cc3);}_0xa98529=_['merge']({},_0xa98529,_0x1a9c3d[_0xff42('0x59')]);return db[_0xff42('0x9a')][_0xff42('0x30')]({'where':_0xa98529['where']})[_0xff42('0x3b')](function(_0x473748){_0x2f1793[_0xff42('0x30')]=_0x473748;if(_0x1a9c3d[_0xff42('0x43')][_0xff42('0x58')]){_0xa98529[_0xff42('0x51')]=[{'all':!![]}];}return db[_0xff42('0x9a')][_0xff42('0x67')](_0xa98529);})[_0xff42('0x3b')](function(_0x352050){_0x2f1793['rows']=_0x352050;return _0x2f1793;});}})['then'](respondWithFilteredResult(_0x1af310,_0xa98529))['catch'](handleError(_0x1af310,null));};exports['send']=function(_0x429601,_0x111dc3,_0x2d1cd5){var _0xb8d8a3,_0x203758={},_0x1836ef;if(_0x429601[_0xff42('0x5b')]['to']){_0x1836ef=_0x429601[_0xff42('0x5b')]['to'][0x0];}return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x429601[_0xff42('0x54')]['id']},'include':[{'model':db[_0xff42('0x9f')],'as':_0xff42('0xa0'),'include':[{'model':db[_0xff42('0xa1')],'as':_0xff42('0xa2'),'where':{'fax':_0x1836ef},'limit':0x1,'order':[[_0xff42('0x97'),_0xff42('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x111dc3,null))[_0xff42('0x3b')](function(_0x403b8c){_0xb8d8a3=_0x403b8c;if(_0x429601[_0xff42('0x5b')]['attachments']&&_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0xff42('0x49')]){for(var _0x21566e=0x0;_0x21566e<_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0xff42('0x49')];_0x21566e+=0x1){_0x429601['body'][_0xff42('0xa4')][_0x21566e]={'filename':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][_0x21566e]['name'],'id':_0x429601['body'][_0xff42('0xa4')][_0x21566e]['id'],'path':path[_0xff42('0xa5')](config['root'],_0xff42('0xa6'),_0x429601['body'][_0xff42('0xa4')][_0x21566e][_0xff42('0xa7')])};}}return respondWithRpcPromise(_0xff42('0xa8'),_0xff42('0xa8'),{'FaxAccountId':_[_0xff42('0xa9')](_0x429601[_0xff42('0x54')]['id'])?undefined:_0x429601[_0xff42('0x54')]['id'],'path':_['isNil'](_0x429601['body']['attachments'][0x0]['path'])?undefined:_0x429601[_0xff42('0x5b')]['attachments'][0x0][_0xff42('0x6')],'fax':_['isNil'](_0x429601[_0xff42('0x5b')]['to'][0x0])?undefined:_0x429601[_0xff42('0x5b')]['to'][0x0]},client9002);})[_0xff42('0x3b')](function(){if(_0xb8d8a3){if(_[_0xff42('0xa9')](_0x429601[_0xff42('0x5b')][_0xff42('0xaa')])){_0x429601[_0xff42('0x5b')][_0xff42('0xaa')]=util[_0xff42('0x9d')](_0xff42('0xab'),_0xb8d8a3[_0xff42('0x3d')],_0xb8d8a3[_0xff42('0xac')]);}if(_0xb8d8a3[_0xff42('0xa0')]){if(_0xb8d8a3['List'][_0xff42('0xa2')][_0xff42('0x49')]){return _0xb8d8a3['List'][_0xff42('0xa2')][0x0];}else{return db['CmContact'][_0xff42('0x5a')](_['defaults'](_0x429601[_0xff42('0x5b')],{'firstName':_0x429601['body']['to'][0x0],'phone':_0x429601[_0xff42('0x5b')]['to'][0x0],'fax':_0x429601[_0xff42('0x5b')]['to'][0x0],'ListId':_0xb8d8a3[_0xff42('0xad')]}));}}else{throw new Error(_0xff42('0xae'));}}else{throw new Error(_0xff42('0xaf'));}})[_0xff42('0x3b')](function(_0x1c9ef6){if(_0x1c9ef6){return db[_0xff42('0x72')][_0xff42('0x5f')]({'where':{'ContactId':_0x1c9ef6['id'],'closed':![],'FaxAccountId':_0xb8d8a3['id']}})[_0xff42('0x3b')](function(_0x5ee1c7){if(_0x5ee1c7){return[_0x5ee1c7,![]];}return db[_0xff42('0x72')]['create']({'UserId':_0x429601[_0xff42('0x5c')]['id'],'ContactId':_0x1c9ef6['id'],'FaxAccountId':_0xb8d8a3['id'],'fax':_0x429601['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x429601[_0xff42('0x5b')],{'read':![],'body':_0x429601['body'][_0xff42('0xa4')][0x0]['filename'],'FaxAccountId':_0xb8d8a3['id'],'UserId':_0x429601['user']['id'],'ContactId':_0x1c9ef6['id'],'AttachmentId':_0x429601['body'][_0xff42('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xff42('0x9a')],'as':_0xff42('0xb0')}]})[_0xff42('0x3b')](function(_0x434a33){return[_0x434a33,!![]];});});}else{throw new Error(_0xff42('0xb1'));}})[_0xff42('0xb2')](function(_0x20df2c,_0x499e04){if(_0x499e04){return _0x20df2c;}return db[_0xff42('0x9a')][_0xff42('0x5a')]({'direction':'out','read':![],'body':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0][_0xff42('0xb3')],'FaxAccountId':_0xb8d8a3['id'],'FaxInteractionId':_0x20df2c['id'],'UserId':_0x429601['user']['id'],'ContactId':_0x20df2c[_0xff42('0xb4')],'AttachmentId':_0x429601[_0xff42('0x5b')]['attachments'][0x0]['id']})[_0xff42('0x3b')](function(_0x47b13e){_0x20df2c['dataValues'][_0xff42('0xb0')]=[];_0x20df2c[_0xff42('0xb5')]['Messages']['push'](_0x47b13e[_0xff42('0xb5')]);return _0x20df2c;});})[_0xff42('0x3b')](function(_0x4e7e34){respondWithRpcPromise(_0xff42('0xb6'),_0xff42('0xb6'),{'FaxAccountId':_['isNil'](_0x429601[_0xff42('0x54')]['id'])?undefined:_0x429601[_0xff42('0x54')]['id'],'path':_[_0xff42('0xa9')](_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0]['path'])?undefined:_0x429601[_0xff42('0x5b')]['attachments'][0x0][_0xff42('0x6')],'fax':_[_0xff42('0xa9')](_0x429601['body']['to'][0x0])?undefined:_0x429601['body']['to'][0x0],'AttachmentId':_0x429601[_0xff42('0x5b')][_0xff42('0xa4')][0x0]['id']},client9002)[_0xff42('0x3b')](function(_0x29ca4b){logger[_0xff42('0x21')](_0xff42('0xb7'),_0x29ca4b);})[_0xff42('0x29')](function(_0x4c87b0){logger[_0xff42('0x21')]('SendFaxRpc,\x20%s',_0x4c87b0);});return _0x4e7e34;})[_0xff42('0x3b')](respondWithResult(_0x111dc3,null))[_0xff42('0x29')](handleError(_0x111dc3,null));};exports[_0xff42('0xb8')]=function(_0x57678a,_0x2ff249,_0x1e3e8d){return db[_0xff42('0x41')][_0xff42('0x5f')]({'where':{'id':_0x57678a['params']['id']}})['then'](handleEntityNotFound(_0x2ff249,null))[_0xff42('0x3b')](function(_0x593383){if(_0x593383){return _0x593383[_0xff42('0xb8')](_0x57678a['body'][_0xff42('0x69')],_[_0xff42('0x70')](_0x57678a[_0xff42('0x5b')],['ids','id'])||{})['spread'](function(_0x582a00){for(var _0x22186c=0x0;_0x22186c<_0x57678a[_0xff42('0x5b')]['ids'][_0xff42('0x49')];_0x22186c+=0x1){socket[_0xff42('0xb9')](_0xff42('0xba'),{'UserId':Number(_0x57678a[_0xff42('0x5b')][_0xff42('0x69')][_0x22186c]),'FaxAccountId':Number(_0x57678a[_0xff42('0x54')]['id'])});}return _0x582a00;});}})['then'](respondWithResult(_0x2ff249,null))['catch'](handleError(_0x2ff249,null));};exports[_0xff42('0xbb')]=function(_0x31aeda,_0x486d6e,_0x1edd50){return db['FaxAccount'][_0xff42('0x5f')]({'where':{'id':_0x31aeda[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x486d6e,null))['then'](function(_0x4bc57e){if(_0x4bc57e){return _0x4bc57e[_0xff42('0xbb')](_0x31aeda[_0xff42('0x43')][_0xff42('0x69')])[_0xff42('0x3b')](function(){if(_['isArray'](_0x31aeda[_0xff42('0x43')][_0xff42('0x69')])){for(var _0x327099=0x0;_0x327099<_0x31aeda[_0xff42('0x43')][_0xff42('0x69')]['length'];_0x327099+=0x1){socket[_0xff42('0xb9')](_0xff42('0xbc'),{'UserId':Number(_0x31aeda[_0xff42('0x43')][_0xff42('0x69')][_0x327099]),'FaxAccountId':Number(_0x31aeda[_0xff42('0x54')]['id'])});}}else{socket[_0xff42('0xb9')](_0xff42('0xbc'),{'UserId':Number(_0x31aeda[_0xff42('0x43')][_0xff42('0x69')]),'FaxAccountId':Number(_0x31aeda['params']['id'])});}});}})[_0xff42('0x3b')](respondWithStatusCode(_0x486d6e,null))[_0xff42('0x29')](handleError(_0x486d6e,null));};exports['getAgents']=function(_0x25f741,_0x2ab51f,_0x3d8de4){var _0x3ff19b={};var _0x4a8af3={};var _0x33c1ad;var _0x3e22fe;return db['FaxAccount'][_0xff42('0x71')]({'where':{'id':_0x25f741[_0xff42('0x54')]['id']}})[_0xff42('0x3b')](handleEntityNotFound(_0x2ab51f,null))[_0xff42('0x3b')](function(_0x85e40a){if(_0x85e40a){_0x33c1ad=_0x85e40a;_0x4a8af3[_0xff42('0x46')]=_[_0xff42('0x56')](db[_0xff42('0x74')]['rawAttributes']);_0x4a8af3[_0xff42('0x43')]=_[_0xff42('0x56')](_0x25f741[_0xff42('0x43')]);_0x4a8af3[_0xff42('0x44')]=_[_0xff42('0x45')](_0x4a8af3[_0xff42('0x46')],_0x4a8af3[_0xff42('0x43')]);_0x3ff19b[_0xff42('0x48')]=_[_0xff42('0x45')](_0x4a8af3[_0xff42('0x46')],qs[_0xff42('0x47')](_0x25f741[_0xff42('0x43')][_0xff42('0x47')]));_0x3ff19b[_0xff42('0x48')]=_0x3ff19b['attributes']['length']?_0x3ff19b['attributes']:_0x4a8af3[_0xff42('0x46')];_0x3ff19b[_0xff42('0x4b')]=qs[_0xff42('0x4c')](_0x25f741[_0xff42('0x43')][_0xff42('0x4c')]);_0x3ff19b['where']=qs[_0xff42('0x44')](_['pick'](_0x25f741[_0xff42('0x43')],_0x4a8af3[_0xff42('0x44')]));if(_0x25f741[_0xff42('0x43')][_0xff42('0x4e')]){_0x3ff19b[_0xff42('0x4d')]=_['merge'](_0x3ff19b['where'],{'$or':_[_0xff42('0x40')](_0x3ff19b['attributes'],function(_0x562e09){var _0x1f345d={};_0x1f345d[_0x562e09]={'$like':'%'+_0x25f741[_0xff42('0x43')]['filter']+'%'};return _0x1f345d;})});}_0x3ff19b=_[_0xff42('0x4f')]({},_0x3ff19b,_0x25f741[_0xff42('0x59')]);return _0x33c1ad['getAgents'](_0x3ff19b);}})['then'](function(_0x539a79){if(_0x539a79){_0x3e22fe=_0x539a79[_0xff42('0x49')];if(!_0x25f741['query'][_0xff42('0x4a')]('nolimit')){_0x3ff19b[_0xff42('0x2e')]=qs[_0xff42('0x2e')](_0x25f741[_0xff42('0x43')][_0xff42('0x2e')]);_0x3ff19b[_0xff42('0x31')]=qs[_0xff42('0x31')](_0x25f741[_0xff42('0x43')]['offset']);}return _0x33c1ad['getAgents'](_0x3ff19b);}})[_0xff42('0x3b')](function(_0x290daa){if(_0x290daa){return _0x290daa?{'count':_0x3e22fe,'rows':_0x290daa}:null;}})[_0xff42('0x3b')](respondWithResult(_0x2ab51f,null))[_0xff42('0x29')](handleError(_0x2ab51f,null));};
\ No newline at end of file
+var _0x0c5f=['getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','localstationid','gateway','faxdetect','headerinfo','maxrate','modem','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','transaction','bulkCreate','updateAccountApplications','VoiceExtension','omit','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','CmList','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','end','name','index','Pause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','pick','includeAll','findAll','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction'];(function(_0x5ce075,_0x20b649){var _0x595e7d=function(_0x4384dc){while(--_0x4384dc){_0x5ce075['push'](_0x5ce075['shift']());}};_0x595e7d(++_0x20b649);}(_0x0c5f,0x1e4));var _0xf0c5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c5f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xf0c5('0x0'));var rimraf=require(_0xf0c5('0x1'));var zipdir=require(_0xf0c5('0x2'));var jsonpatch=require(_0xf0c5('0x3'));var rp=require(_0xf0c5('0x4'));var moment=require(_0xf0c5('0x5'));var BPromise=require(_0xf0c5('0x6'));var Mustache=require('mustache');var util=require(_0xf0c5('0x7'));var path=require(_0xf0c5('0x8'));var sox=require(_0xf0c5('0x9'));var csv=require(_0xf0c5('0xa'));var ejs=require(_0xf0c5('0xb'));var fs=require('fs');var fs_extra=require(_0xf0c5('0xc'));var _=require('lodash');var squel=require(_0xf0c5('0xd'));var crypto=require(_0xf0c5('0xe'));var jsforce=require(_0xf0c5('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf0c5('0xa'));var querystring=require(_0xf0c5('0x10'));var Papa=require(_0xf0c5('0x11'));var Redis=require(_0xf0c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf0c5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf0c5('0x14'))(_0xf0c5('0x15'));var utils=require(_0xf0c5('0x16'));var config=require(_0xf0c5('0x17'));var licenseUtil=require(_0xf0c5('0x18'));var db=require(_0xf0c5('0x19'))['db'];config[_0xf0c5('0x1a')]=_['defaults'](config[_0xf0c5('0x1a')],{'host':_0xf0c5('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf0c5('0x1a')]));require('./faxAccount.socket')[_0xf0c5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf0c5('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf0c5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5c012f,_0x249593,_0x2be643,_0xfff6d1){return new BPromise(function(_0xb45dcd,_0x8f8ae5){var _0x51a6c0=_0xfff6d1||client;return _0x51a6c0[_0xf0c5('0x1f')](_0x5c012f,_0x2be643)[_0xf0c5('0x20')](function(_0x316a06){logger[_0xf0c5('0x21')](_0xf0c5('0x22'),_0x249593,'request\x20sent');logger[_0xf0c5('0x23')](_0xf0c5('0x24'),_0x249593,_0xf0c5('0x25'),JSON[_0xf0c5('0x26')](_0x316a06));if(_0x316a06[_0xf0c5('0x27')]){if(_0x316a06[_0xf0c5('0x27')][_0xf0c5('0x28')]===0x1f4){logger[_0xf0c5('0x27')]('FaxAccount,\x20%s,\x20%s',_0x249593,_0x316a06[_0xf0c5('0x27')][_0xf0c5('0x29')]);return _0x8f8ae5(_0x316a06['error']['message']);}logger[_0xf0c5('0x27')](_0xf0c5('0x22'),_0x249593,_0x316a06['error'][_0xf0c5('0x29')]);return _0xb45dcd(_0x316a06[_0xf0c5('0x27')]['message']);}else{logger['info'](_0xf0c5('0x22'),_0x249593,'request\x20sent');_0xb45dcd(_0x316a06[_0xf0c5('0x2a')][_0xf0c5('0x29')]);}})['catch'](function(_0x518e77){logger[_0xf0c5('0x27')](_0xf0c5('0x22'),_0x249593,_0x518e77);_0x8f8ae5(_0x518e77);});});}function respondWithStatusCode(_0x18daf2,_0x5a481b){_0x5a481b=_0x5a481b||0xcc;return function(_0x2d3998){if(_0x2d3998){return _0x18daf2[_0xf0c5('0x2b')](_0x5a481b);}return _0x18daf2[_0xf0c5('0x2c')](_0x5a481b)['end']();};}function respondWithResult(_0x4c28b4,_0x5210bd){_0x5210bd=_0x5210bd||0xc8;return function(_0x299a5e){if(_0x299a5e){return _0x4c28b4[_0xf0c5('0x2c')](_0x5210bd)[_0xf0c5('0x2d')](_0x299a5e);}};}function respondWithFilteredResult(_0x1c566b,_0x5ab3bf){return function(_0x37c55e){if(_0x37c55e){var _0x3001d0=typeof _0x5ab3bf[_0xf0c5('0x2e')]===_0xf0c5('0x2f')&&typeof _0x5ab3bf[_0xf0c5('0x30')]===_0xf0c5('0x2f');var _0x20524e=_0x37c55e['count'];var _0x39d14f=_0x3001d0?0x0:_0x5ab3bf[_0xf0c5('0x2e')];var _0x28f5ff=_0x3001d0?_0x37c55e[_0xf0c5('0x31')]:_0x5ab3bf[_0xf0c5('0x2e')]+_0x5ab3bf[_0xf0c5('0x30')];var _0x1cd043;if(_0x28f5ff>=_0x20524e){_0x28f5ff=_0x20524e;_0x1cd043=0xc8;}else{_0x1cd043=0xce;}_0x1c566b[_0xf0c5('0x2c')](_0x1cd043);return _0x1c566b[_0xf0c5('0x32')](_0xf0c5('0x33'),_0x39d14f+'-'+_0x28f5ff+'/'+_0x20524e)['json'](_0x37c55e);}return null;};}function patchUpdates(_0x21227f){return function(_0x1b5b5f){try{jsonpatch[_0xf0c5('0x34')](_0x1b5b5f,_0x21227f,!![]);}catch(_0x1d2846){return BPromise[_0xf0c5('0x35')](_0x1d2846);}return _0x1b5b5f[_0xf0c5('0x36')]();};}function saveUpdates(_0x97801d,_0x530c27){return function(_0x278eae){if(_0x278eae){return _0x278eae['update'](_0x97801d)[_0xf0c5('0x20')](function(_0xff63fb){return _0xff63fb;});}return null;};}function removeEntity(_0xba34e1,_0x3f59d2){return function(_0x8c1cd8){if(_0x8c1cd8){return _0x8c1cd8[_0xf0c5('0x37')]()[_0xf0c5('0x20')](function(){var _0x1e62d5=_0x8c1cd8[_0xf0c5('0x38')]({'plain':!![]});var _0x5b09d5=_0xf0c5('0x39');return db['UserProfileResource'][_0xf0c5('0x37')]({'where':{'type':_0x5b09d5,'resourceId':_0x1e62d5['id']}})[_0xf0c5('0x20')](function(){return _0x8c1cd8;});})[_0xf0c5('0x20')](function(){_0xba34e1[_0xf0c5('0x2c')](0xcc)[_0xf0c5('0x3a')]();});}};}function handleEntityNotFound(_0x5c6fa6,_0x4e1f62){return function(_0x982843){if(!_0x982843){_0x5c6fa6[_0xf0c5('0x2b')](0x194);}return _0x982843;};}function handleError(_0x2ea94b,_0x3e65a8){_0x3e65a8=_0x3e65a8||0x1f4;return function(_0x387e84){logger[_0xf0c5('0x27')](_0x387e84['stack']);if(_0x387e84['name']){delete _0x387e84[_0xf0c5('0x3b')];}_0x2ea94b['status'](_0x3e65a8)['send'](_0x387e84);};}exports[_0xf0c5('0x3c')]=function(_0x372d01,_0x49ad8f){var _0x3f0730={'include':[{'model':db[_0xf0c5('0x3d')],'as':'mandatoryDispositionPause'}]},_0x52c8bb={},_0x47324c={'count':0x0,'rows':[]};var _0x1d63a9=_['map'](db[_0xf0c5('0x3e')][_0xf0c5('0x3f')],function(_0x5dd2a6){return{'name':_0x5dd2a6[_0xf0c5('0x40')],'type':_0x5dd2a6[_0xf0c5('0x41')][_0xf0c5('0x42')]};});_0x52c8bb[_0xf0c5('0x43')]=_[_0xf0c5('0x44')](_0x1d63a9,'name');_0x52c8bb[_0xf0c5('0x45')]=_[_0xf0c5('0x46')](_0x372d01[_0xf0c5('0x45')]);_0x52c8bb[_0xf0c5('0x47')]=_['intersection'](_0x52c8bb[_0xf0c5('0x43')],_0x52c8bb[_0xf0c5('0x45')]);_0x3f0730[_0xf0c5('0x48')]=_['intersection'](_0x52c8bb[_0xf0c5('0x43')],qs[_0xf0c5('0x49')](_0x372d01['query']['fields']));_0x3f0730[_0xf0c5('0x48')]=_0x3f0730['attributes'][_0xf0c5('0x4a')]?_0x3f0730[_0xf0c5('0x48')]:_0x52c8bb['model'];if(!_0x372d01[_0xf0c5('0x45')][_0xf0c5('0x4b')](_0xf0c5('0x4c'))){_0x3f0730[_0xf0c5('0x30')]=qs[_0xf0c5('0x30')](_0x372d01[_0xf0c5('0x45')][_0xf0c5('0x30')]);_0x3f0730[_0xf0c5('0x2e')]=qs['offset'](_0x372d01['query'][_0xf0c5('0x2e')]);}_0x3f0730[_0xf0c5('0x4d')]=qs['sort'](_0x372d01[_0xf0c5('0x45')][_0xf0c5('0x4e')]);_0x3f0730[_0xf0c5('0x4f')]=qs['filters'](_['pick'](_0x372d01[_0xf0c5('0x45')],_0x52c8bb[_0xf0c5('0x47')]),_0x1d63a9);if(_0x372d01[_0xf0c5('0x45')][_0xf0c5('0x50')]){_0x3f0730['where']=_[_0xf0c5('0x51')](_0x3f0730[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x1d63a9,function(_0x11d794){if(_0x11d794[_0xf0c5('0x41')]!==_0xf0c5('0x52')){var _0x246b77={};_0x246b77[_0x11d794[_0xf0c5('0x3b')]]={'$like':'%'+_0x372d01['query']['filter']+'%'};return _0x246b77;}})});}_0x3f0730=_[_0xf0c5('0x51')]({},_0x3f0730,_0x372d01[_0xf0c5('0x53')]);var _0x377fa0={'where':_0x3f0730[_0xf0c5('0x4f')]};return db['FaxAccount'][_0xf0c5('0x31')](_0x377fa0)[_0xf0c5('0x20')](function(_0x959cba){_0x47324c['count']=_0x959cba;if(_0x372d01[_0xf0c5('0x45')]['includeAll']){_0x3f0730[_0xf0c5('0x54')]=[{'all':!![]}];}return db[_0xf0c5('0x3e')]['findAll'](_0x3f0730);})['then'](function(_0x41929f){_0x47324c[_0xf0c5('0x55')]=_0x41929f;return _0x47324c;})['then'](respondWithFilteredResult(_0x49ad8f,_0x3f0730))[_0xf0c5('0x56')](handleError(_0x49ad8f,null));};exports['show']=function(_0x1c7f4e,_0x30c9db){var _0x3fb27e={'raw':![],'where':{'id':_0x1c7f4e['params']['id']},'include':[{'model':db[_0xf0c5('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5741db={};_0x5741db[_0xf0c5('0x43')]=_['keys'](db[_0xf0c5('0x3e')][_0xf0c5('0x3f')]);_0x5741db[_0xf0c5('0x45')]=_[_0xf0c5('0x46')](_0x1c7f4e[_0xf0c5('0x45')]);_0x5741db['filters']=_[_0xf0c5('0x57')](_0x5741db[_0xf0c5('0x43')],_0x5741db[_0xf0c5('0x45')]);_0x3fb27e[_0xf0c5('0x48')]=_['intersection'](_0x5741db['model'],qs['fields'](_0x1c7f4e[_0xf0c5('0x45')][_0xf0c5('0x49')]));_0x3fb27e[_0xf0c5('0x48')]=_0x3fb27e[_0xf0c5('0x48')][_0xf0c5('0x4a')]?_0x3fb27e['attributes']:_0x5741db[_0xf0c5('0x43')];if(_0x1c7f4e[_0xf0c5('0x45')]['includeAll']){_0x3fb27e[_0xf0c5('0x54')]=[{'all':!![]}];}_0x3fb27e=_[_0xf0c5('0x51')]({},_0x3fb27e,_0x1c7f4e[_0xf0c5('0x53')]);return db['FaxAccount'][_0xf0c5('0x58')](_0x3fb27e)['then'](handleEntityNotFound(_0x30c9db,null))[_0xf0c5('0x20')](respondWithResult(_0x30c9db,null))['catch'](handleError(_0x30c9db,null));};exports['create']=function(_0x5e92e6,_0x45d14b){return db[_0xf0c5('0x3e')][_0xf0c5('0x59')](_0x5e92e6[_0xf0c5('0x5a')],{})[_0xf0c5('0x20')](function(_0x716b40){var _0x12864d=_0x5e92e6['user'][_0xf0c5('0x38')]({'plain':!![]});if(!_0x12864d)throw new Error(_0xf0c5('0x5b'));if(_0x12864d['role']===_0xf0c5('0x5c')){var _0x4b11df=_0x716b40[_0xf0c5('0x38')]({'plain':!![]});var _0x3e799f='FaxAccounts';return db['UserProfileSection'][_0xf0c5('0x58')]({'where':{'name':_0x3e799f,'userProfileId':_0x12864d[_0xf0c5('0x5d')]},'raw':!![]})[_0xf0c5('0x20')](function(_0x3fbc45){if(_0x3fbc45&&_0x3fbc45['autoAssociation']===0x0){return db['UserProfileResource'][_0xf0c5('0x59')]({'name':_0x4b11df[_0xf0c5('0x3b')],'resourceId':_0x4b11df['id'],'type':_0x3fbc45[_0xf0c5('0x3b')],'sectionId':_0x3fbc45['id']},{})['then'](function(){return _0x716b40;});}else{return _0x716b40;}})[_0xf0c5('0x56')](function(_0x5c315b){logger[_0xf0c5('0x27')](_0xf0c5('0x5e'),_0x5c315b);throw _0x5c315b;});}return _0x716b40;})[_0xf0c5('0x20')](respondWithResult(_0x45d14b,0xc9))[_0xf0c5('0x56')](handleError(_0x45d14b,null));};exports[_0xf0c5('0x5f')]=function(_0x402299,_0x4d4277){if(_0x402299[_0xf0c5('0x5a')]['id']){delete _0x402299['body']['id'];}return db[_0xf0c5('0x3e')]['find']({'where':{'id':_0x402299[_0xf0c5('0x60')]['id']},'include':[{'model':db[_0xf0c5('0x3d')],'as':_0xf0c5('0x61')}]})[_0xf0c5('0x20')](handleEntityNotFound(_0x4d4277,null))[_0xf0c5('0x20')](saveUpdates(_0x402299[_0xf0c5('0x5a')],null))[_0xf0c5('0x20')](respondWithResult(_0x4d4277,null))[_0xf0c5('0x56')](handleError(_0x4d4277,null));};exports['destroy']=function(_0x2e4e52,_0x569717){return db[_0xf0c5('0x3e')]['find']({'where':{'id':_0x2e4e52[_0xf0c5('0x60')]['id']}})['then'](handleEntityNotFound(_0x569717,null))[_0xf0c5('0x20')](removeEntity(_0x569717,null))[_0xf0c5('0x56')](handleError(_0x569717,null));};exports[_0xf0c5('0x62')]=function(_0x4fd04d,_0x408cd5){return db[_0xf0c5('0x3e')][_0xf0c5('0x62')]()[_0xf0c5('0x20')](respondWithResult(_0x408cd5,null))['catch'](handleError(_0x408cd5,null));};exports[_0xf0c5('0x63')]=function(_0x30f08e,_0x55e5cd,_0x20ef31){if(_0x30f08e[_0xf0c5('0x5a')]['id']){delete _0x30f08e['body']['id'];}return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x30f08e[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x55e5cd,null))[_0xf0c5('0x20')](function(_0x353213){if(_0x353213){_0x30f08e[_0xf0c5('0x5a')][_0xf0c5('0x64')]=_0x353213['id'];return db[_0xf0c5('0x65')][_0xf0c5('0x59')](_0x30f08e[_0xf0c5('0x5a')]);}})['then'](respondWithResult(_0x55e5cd,null))[_0xf0c5('0x56')](handleError(_0x55e5cd,null));};exports[_0xf0c5('0x66')]=function(_0x60a441,_0x456b8d,_0x325722){var _0x444110={'raw':![],'where':{}};var _0x456b95={};var _0x28a486={'count':0x0,'rows':[]};return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x60a441['params']['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x456b8d,null))[_0xf0c5('0x20')](function(_0x50038f){if(_0x50038f){_0x456b95[_0xf0c5('0x43')]=_['keys'](db['Disposition'][_0xf0c5('0x3f')]);_0x456b95[_0xf0c5('0x45')]=_[_0xf0c5('0x46')](_0x60a441[_0xf0c5('0x45')]);_0x456b95[_0xf0c5('0x47')]=_[_0xf0c5('0x57')](_0x456b95[_0xf0c5('0x43')],_0x456b95[_0xf0c5('0x45')]);_0x444110[_0xf0c5('0x48')]=_[_0xf0c5('0x57')](_0x456b95['model'],qs[_0xf0c5('0x49')](_0x60a441[_0xf0c5('0x45')][_0xf0c5('0x49')]));_0x444110[_0xf0c5('0x48')]=_0x444110[_0xf0c5('0x48')][_0xf0c5('0x4a')]?_0x444110[_0xf0c5('0x48')]:_0x456b95[_0xf0c5('0x43')];if(!_0x60a441[_0xf0c5('0x45')][_0xf0c5('0x4b')]('nolimit')){_0x444110['limit']=qs[_0xf0c5('0x30')](_0x60a441[_0xf0c5('0x45')]['limit']);_0x444110[_0xf0c5('0x2e')]=qs[_0xf0c5('0x2e')](_0x60a441[_0xf0c5('0x45')]['offset']);}_0x444110['order']=qs[_0xf0c5('0x4e')](_0x60a441[_0xf0c5('0x45')][_0xf0c5('0x4e')]);_0x444110[_0xf0c5('0x4f')]=qs[_0xf0c5('0x47')](_[_0xf0c5('0x68')](_0x60a441[_0xf0c5('0x45')],_0x456b95[_0xf0c5('0x47')]));_0x444110['where'][_0xf0c5('0x64')]=_0x50038f['id'];if(_0x60a441['query'][_0xf0c5('0x50')]){_0x444110[_0xf0c5('0x4f')]=_[_0xf0c5('0x51')](_0x444110[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x444110[_0xf0c5('0x48')],function(_0x14a5e0){var _0x2aec49={};_0x2aec49[_0x14a5e0]={'$like':'%'+_0x60a441['query']['filter']+'%'};return _0x2aec49;})});}_0x444110=_[_0xf0c5('0x51')]({},_0x444110,_0x60a441['options']);return db[_0xf0c5('0x65')][_0xf0c5('0x31')]({'where':_0x444110[_0xf0c5('0x4f')]})[_0xf0c5('0x20')](function(_0x143954){_0x28a486['count']=_0x143954;if(_0x60a441['query'][_0xf0c5('0x69')]){_0x444110['include']=[{'all':!![]}];}return db['Disposition'][_0xf0c5('0x6a')](_0x444110);})[_0xf0c5('0x20')](function(_0x5eb6e9){_0x28a486['rows']=_0x5eb6e9;return _0x28a486;});}})[_0xf0c5('0x20')](respondWithFilteredResult(_0x456b8d,_0x444110))[_0xf0c5('0x56')](handleError(_0x456b8d,null));};exports['removeDispositions']=function(_0x865ebb,_0x33dc28,_0x543509){return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x865ebb[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x33dc28,null))['then'](function(_0x3323cf){if(_0x3323cf){return _0x3323cf['removeDispositions'](_0x865ebb[_0xf0c5('0x45')][_0xf0c5('0x6b')]);}})[_0xf0c5('0x20')](respondWithStatusCode(_0x33dc28,null))[_0xf0c5('0x56')](handleError(_0x33dc28,null));};exports[_0xf0c5('0x6c')]=function(_0x44c60d,_0x509732,_0x53fee7){if(_0x44c60d[_0xf0c5('0x5a')]['id']){delete _0x44c60d['body']['id'];}return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x44c60d[_0xf0c5('0x60')]['id']}})['then'](handleEntityNotFound(_0x509732,null))[_0xf0c5('0x20')](function(_0x563842){if(_0x563842){_0x44c60d['body'][_0xf0c5('0x64')]=_0x563842['id'];return db['CannedAnswer'][_0xf0c5('0x59')](_0x44c60d['body']);}})[_0xf0c5('0x20')](respondWithResult(_0x509732,null))[_0xf0c5('0x56')](handleError(_0x509732,null));};exports[_0xf0c5('0x6d')]=function(_0x2b7645,_0x29a637,_0x1216f2){var _0x24e07b={'raw':![],'where':{}};var _0x43c138={};var _0x422142={'count':0x0,'rows':[]};return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x2b7645[_0xf0c5('0x60')]['id']}})['then'](handleEntityNotFound(_0x29a637,null))[_0xf0c5('0x20')](function(_0x10ed87){if(_0x10ed87){_0x43c138['model']=_[_0xf0c5('0x46')](db['CannedAnswer'][_0xf0c5('0x3f')]);_0x43c138[_0xf0c5('0x45')]=_['keys'](_0x2b7645['query']);_0x43c138['filters']=_[_0xf0c5('0x57')](_0x43c138['model'],_0x43c138[_0xf0c5('0x45')]);_0x24e07b['attributes']=_[_0xf0c5('0x57')](_0x43c138[_0xf0c5('0x43')],qs[_0xf0c5('0x49')](_0x2b7645['query'][_0xf0c5('0x49')]));_0x24e07b[_0xf0c5('0x48')]=_0x24e07b['attributes'][_0xf0c5('0x4a')]?_0x24e07b['attributes']:_0x43c138[_0xf0c5('0x43')];if(!_0x2b7645[_0xf0c5('0x45')]['hasOwnProperty'](_0xf0c5('0x4c'))){_0x24e07b[_0xf0c5('0x30')]=qs[_0xf0c5('0x30')](_0x2b7645['query']['limit']);_0x24e07b['offset']=qs[_0xf0c5('0x2e')](_0x2b7645[_0xf0c5('0x45')][_0xf0c5('0x2e')]);}_0x24e07b[_0xf0c5('0x4d')]=qs[_0xf0c5('0x4e')](_0x2b7645[_0xf0c5('0x45')][_0xf0c5('0x4e')]);_0x24e07b[_0xf0c5('0x4f')]=qs[_0xf0c5('0x47')](_[_0xf0c5('0x68')](_0x2b7645[_0xf0c5('0x45')],_0x43c138[_0xf0c5('0x47')]));_0x24e07b[_0xf0c5('0x4f')]['FaxAccountId']=_0x10ed87['id'];if(_0x2b7645[_0xf0c5('0x45')][_0xf0c5('0x50')]){_0x24e07b['where']=_[_0xf0c5('0x51')](_0x24e07b[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x24e07b[_0xf0c5('0x48')],function(_0x13a6e8){var _0x2e137a={};_0x2e137a[_0x13a6e8]={'$like':'%'+_0x2b7645[_0xf0c5('0x45')][_0xf0c5('0x50')]+'%'};return _0x2e137a;})});}_0x24e07b=_[_0xf0c5('0x51')]({},_0x24e07b,_0x2b7645[_0xf0c5('0x53')]);return db[_0xf0c5('0x6e')][_0xf0c5('0x31')]({'where':_0x24e07b[_0xf0c5('0x4f')]})[_0xf0c5('0x20')](function(_0x2dcdab){_0x422142[_0xf0c5('0x31')]=_0x2dcdab;if(_0x2b7645[_0xf0c5('0x45')][_0xf0c5('0x69')]){_0x24e07b['include']=[{'all':!![]}];}return db[_0xf0c5('0x6e')]['findAll'](_0x24e07b);})[_0xf0c5('0x20')](function(_0x616f26){_0x422142[_0xf0c5('0x55')]=_0x616f26;return _0x422142;});}})[_0xf0c5('0x20')](respondWithFilteredResult(_0x29a637,_0x24e07b))[_0xf0c5('0x56')](handleError(_0x29a637,null));};exports[_0xf0c5('0x6f')]=function(_0x15d04b,_0x4377f6,_0x47e3e6){return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x15d04b['params']['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x4377f6,null))[_0xf0c5('0x20')](function(_0x1c507c){if(_0x1c507c){return _0x1c507c[_0xf0c5('0x6f')](_0x15d04b['query'][_0xf0c5('0x6b')]);}})[_0xf0c5('0x20')](respondWithStatusCode(_0x4377f6,null))[_0xf0c5('0x56')](handleError(_0x4377f6,null));};exports[_0xf0c5('0x70')]=function(_0x24fc40,_0x3cd677,_0x29aeb0){return db['FaxInteraction'][_0xf0c5('0x58')]({'where':{'id':_0x24fc40['params']['id']}})['then'](handleEntityNotFound(_0x3cd677,null))[_0xf0c5('0x20')](function(_0x5e097e){if(_0x5e097e){return _0x5e097e['addInteraction'](_0x24fc40[_0xf0c5('0x5a')][_0xf0c5('0x6b')],_['omit'](_0x24fc40[_0xf0c5('0x5a')],['ids','id'])||{});}})[_0xf0c5('0x20')](respondWithResult(_0x3cd677,null))[_0xf0c5('0x56')](handleError(_0x3cd677,null));};exports[_0xf0c5('0x71')]=function(_0x1fb933,_0x4c5695,_0x1e19ec){var _0x5b84b3={'raw':![],'where':{}};var _0x5611c3={};var _0x44994d={'count':0x0,'rows':[]};return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x1fb933[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x4c5695,null))['then'](function(_0x35454f){if(_0x35454f){_0x5611c3[_0xf0c5('0x43')]=_[_0xf0c5('0x46')](db['FaxInteraction'][_0xf0c5('0x3f')]);_0x5611c3['query']=_[_0xf0c5('0x46')](_0x1fb933[_0xf0c5('0x45')]);_0x5611c3['filters']=_[_0xf0c5('0x57')](_0x5611c3[_0xf0c5('0x43')],_0x5611c3[_0xf0c5('0x45')]);_0x5b84b3[_0xf0c5('0x48')]=_[_0xf0c5('0x57')](_0x5611c3[_0xf0c5('0x43')],qs[_0xf0c5('0x49')](_0x1fb933[_0xf0c5('0x45')]['fields']));_0x5b84b3[_0xf0c5('0x48')]=_0x5b84b3['attributes'][_0xf0c5('0x4a')]?_0x5b84b3[_0xf0c5('0x48')]:_0x5611c3[_0xf0c5('0x43')];if(!_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x4b')](_0xf0c5('0x4c'))){_0x5b84b3[_0xf0c5('0x30')]=qs[_0xf0c5('0x30')](_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x30')]);_0x5b84b3[_0xf0c5('0x2e')]=qs[_0xf0c5('0x2e')](_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x2e')]);}_0x5b84b3[_0xf0c5('0x4d')]=qs['sort'](_0x1fb933['query'][_0xf0c5('0x4e')]);_0x5b84b3[_0xf0c5('0x4f')]=qs[_0xf0c5('0x47')](_[_0xf0c5('0x68')](_0x1fb933[_0xf0c5('0x45')],_0x5611c3[_0xf0c5('0x47')]));_0x5b84b3['where']['FaxAccountId']=_0x35454f['id'];if(_0x1fb933[_0xf0c5('0x45')]['filter']){_0x5b84b3[_0xf0c5('0x4f')]=_[_0xf0c5('0x51')](_0x5b84b3[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x5b84b3[_0xf0c5('0x48')],function(_0x4eb73e){var _0x20f245={};_0x20f245[_0x4eb73e]={'$like':'%'+_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x50')]+'%'};return _0x20f245;})});}_0x5b84b3=_[_0xf0c5('0x51')]({},_0x5b84b3,_0x1fb933['options']);return db[_0xf0c5('0x72')][_0xf0c5('0x31')]({'where':_0x5b84b3[_0xf0c5('0x4f')]})[_0xf0c5('0x20')](function(_0x54f742){_0x44994d[_0xf0c5('0x31')]=_0x54f742;if(_0x1fb933['query']['includeAll']){_0x5b84b3[_0xf0c5('0x54')]=[{'model':db[_0xf0c5('0x73')],'as':_0xf0c5('0x74'),'required':![]},{'model':db[_0xf0c5('0x75')],'as':_0xf0c5('0x76'),'attributes':[_0xf0c5('0x3b'),_0xf0c5('0x77'),_0xf0c5('0x78')],'required':![]},{'model':db[_0xf0c5('0x79')],'as':_0xf0c5('0x7a'),'attributes':['id','name',_0xf0c5('0x7b')],'where':_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x7c')]?{'id':_0x1fb933[_0xf0c5('0x45')][_0xf0c5('0x7c')]}:undefined,'required':_0x1fb933['query'][_0xf0c5('0x7c')]?!![]:![]}];}return db[_0xf0c5('0x72')][_0xf0c5('0x6a')](_0x5b84b3);})['then'](function(_0x57bec0){_0x44994d[_0xf0c5('0x55')]=_0x57bec0;return _0x44994d;});}})[_0xf0c5('0x20')](respondWithFilteredResult(_0x4c5695,_0x5b84b3))[_0xf0c5('0x56')](handleError(_0x4c5695,null));};exports['addApplications']=function(_0x361894,_0x31af72,_0x253253){return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x361894[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x31af72,null))['then'](function(_0x4977f7){if(_0x4977f7){return db[_0xf0c5('0x7d')]['transaction'](function(_0x3779d4){return db[_0xf0c5('0x7e')][_0xf0c5('0x37')]({'where':{'FaxAccountId':_0x361894['params']['id']},'transaction':_0x3779d4})[_0xf0c5('0x20')](function(_0x64655d){var _0x5ee9d8=_[_0xf0c5('0x44')](_0x361894['body'],function(_0x478815){_0x478815[_0xf0c5('0x64')]=_0x361894['params']['id'];return _0x478815;});return db['FaxApplication']['bulkCreate'](_0x5ee9d8,{'transaction':_0x3779d4});});})[_0xf0c5('0x20')](function(){return db[_0xf0c5('0x7e')][_0xf0c5('0x7f')]({'where':{'FaxAccountId':_0x361894[_0xf0c5('0x60')]['id']},'order':_0xf0c5('0x80')});});}})['then'](respondWithResult(_0x31af72,null))[_0xf0c5('0x56')](handleError(_0x31af72,null));};exports['getApplications']=function(_0x4b9388,_0x2a6bb0,_0x1c32c1){var _0x449262={};var _0x3a1fb9={};var _0x20f10c;var _0x2582f9;return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x4b9388[_0xf0c5('0x60')]['id']}})['then'](handleEntityNotFound(_0x2a6bb0,null))[_0xf0c5('0x20')](function(_0xa8ee5){if(_0xa8ee5){_0x20f10c=_0xa8ee5;_0x3a1fb9[_0xf0c5('0x43')]=_[_0xf0c5('0x46')](db[_0xf0c5('0x7e')]['rawAttributes']);_0x3a1fb9['query']=_['keys'](_0x4b9388[_0xf0c5('0x45')]);_0x3a1fb9[_0xf0c5('0x47')]=_[_0xf0c5('0x57')](_0x3a1fb9[_0xf0c5('0x43')],_0x3a1fb9['query']);_0x449262[_0xf0c5('0x48')]=_[_0xf0c5('0x57')](_0x3a1fb9[_0xf0c5('0x43')],qs[_0xf0c5('0x49')](_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x49')]));_0x449262[_0xf0c5('0x48')]=_0x449262[_0xf0c5('0x48')][_0xf0c5('0x4a')]?_0x449262[_0xf0c5('0x48')]:_0x3a1fb9[_0xf0c5('0x43')];_0x449262[_0xf0c5('0x4d')]=qs[_0xf0c5('0x4e')](_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x4e')]);_0x449262['where']=qs[_0xf0c5('0x47')](_[_0xf0c5('0x68')](_0x4b9388[_0xf0c5('0x45')],_0x3a1fb9[_0xf0c5('0x47')]));if(_0x4b9388['query'][_0xf0c5('0x50')]){_0x449262[_0xf0c5('0x4f')]=_['merge'](_0x449262[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x449262['attributes'],function(_0x5327a2){var _0x4cf121={};_0x4cf121[_0x5327a2]={'$like':'%'+_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x50')]+'%'};return _0x4cf121;})});}_0x449262=_[_0xf0c5('0x51')]({},_0x449262,_0x4b9388[_0xf0c5('0x53')]);return _0x20f10c[_0xf0c5('0x81')](_0x449262);}})[_0xf0c5('0x20')](function(_0x4aebe4){if(_0x4aebe4){_0x2582f9=_0x4aebe4['length'];if(!_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x4b')](_0xf0c5('0x4c'))){_0x449262[_0xf0c5('0x30')]=qs['limit'](_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x30')]);_0x449262[_0xf0c5('0x2e')]=qs[_0xf0c5('0x2e')](_0x4b9388[_0xf0c5('0x45')][_0xf0c5('0x2e')]);}return _0x20f10c[_0xf0c5('0x81')](_0x449262);}})[_0xf0c5('0x20')](function(_0x2cf0b7){if(_0x2cf0b7){return _0x2cf0b7?{'count':_0x2582f9,'rows':_0x2cf0b7}:null;}})[_0xf0c5('0x20')](respondWithResult(_0x2a6bb0,null))['catch'](handleError(_0x2a6bb0,null));};function Extension(_0x145c52,_0x21c611,_0x3911dc,_0x6f0ae9){this[_0xf0c5('0x82')]=_0xf0c5('0x83');this[_0xf0c5('0x84')]=_0x145c52['localstationid'];this[_0xf0c5('0x85')]=_0x6f0ae9;this['type']=_0xf0c5('0x86');this[_0xf0c5('0x87')]=_0xf0c5('0x88');this['FaxAccountId']=_0x145c52['id'];this[_0xf0c5('0x80')]=_0x21c611;this[_0xf0c5('0x89')]=_0x3911dc;}function createExtensionsReciveFax(_0x36c1e5){var _0x4d3bc4=0x1;var _0x37990f=[];_0x37990f[_0xf0c5('0x8a')](new Extension(_0x36c1e5,_0x4d3bc4,'',_0xf0c5('0x8b')));_0x4d3bc4+=0x1;_0x37990f[_0xf0c5('0x8a')](new Extension(_0x36c1e5,_0x4d3bc4,'CDR(type)=inbound-fax',_0xf0c5('0x8c')));_0x4d3bc4+=0x1;for(var _0x1ea9b8 in _0x36c1e5){if(_0x36c1e5[_0xf0c5('0x4b')](_0x1ea9b8)&&(_0x1ea9b8===_0xf0c5('0x8d')||_0x1ea9b8===_0xf0c5('0x8e')||_0x1ea9b8===_0xf0c5('0x8f')||_0x1ea9b8===_0xf0c5('0x90')||_0x1ea9b8===_0xf0c5('0x91')||_0x1ea9b8===_0xf0c5('0x92')||_0x1ea9b8==='minrate'||_0x1ea9b8===_0xf0c5('0x93')||_0x1ea9b8==='t38timeout')){_0x37990f['push'](new Extension(_0x36c1e5,_0x4d3bc4,_0xf0c5('0x94')+_0x1ea9b8+')='+_0x36c1e5[_0x1ea9b8],_0xf0c5('0x8c')));_0x4d3bc4+=0x1;}}_0x37990f[_0xf0c5('0x8a')](new Extension(_0x36c1e5,_0x4d3bc4,'6',_0xf0c5('0x95')));_0x4d3bc4+=0x1;_0x37990f[_0xf0c5('0x8a')](new Extension(_0x36c1e5,_0x4d3bc4,_0xf0c5('0x96'),_0xf0c5('0x97')));_0x4d3bc4=0x0;return _0x37990f;}exports[_0xf0c5('0x98')]=function(_0x2088e4,_0x1df8c9,_0x1a1073){var _0x51bc31;return db['sequelize'][_0xf0c5('0x99')](function(_0x2c0fbd){return db['FaxAccount'][_0xf0c5('0x59')](_0x2088e4[_0xf0c5('0x5a')],{'transaction':_0x2c0fbd})[_0xf0c5('0x20')](function(_0x4eb3ac){_0x51bc31=_0x4eb3ac[_0xf0c5('0x38')]({'plain':!![]});return db['VoiceExtension'][_0xf0c5('0x9a')](createExtensionsReciveFax(_0x51bc31),{'transaction':_0x2c0fbd});});})['then'](function(){return _0x51bc31;})[_0xf0c5('0x20')](respondWithResult(_0x1df8c9,null))['catch'](handleError(_0x1df8c9,null));};exports[_0xf0c5('0x9b')]=function(_0xdaf4fe,_0x1cf006,_0x2a09ef){var _0x36db4b;return db[_0xf0c5('0x7d')][_0xf0c5('0x99')](function(_0x50a211){return db[_0xf0c5('0x3e')]['update'](_0xdaf4fe[_0xf0c5('0x5a')],{'where':{'id':_0xdaf4fe[_0xf0c5('0x5a')]['id']},'transaction':_0x50a211})[_0xf0c5('0x20')](function(_0x599718){return db[_0xf0c5('0x9c')]['destroy']({'where':{'FaxAccountId':_0xdaf4fe[_0xf0c5('0x5a')]['id']},'transaction':_0x50a211})[_0xf0c5('0x20')](function(_0x226f0f){return db['VoiceExtension'][_0xf0c5('0x9a')](createExtensionsReciveFax(_[_0xf0c5('0x9d')](_0xdaf4fe[_0xf0c5('0x5a')],['tech',_0xf0c5('0x42'),_0xf0c5('0x9e'),_0xf0c5('0x9f'),_0xf0c5('0xa0'),_0xf0c5('0xa1')])),{'transaction':_0x50a211});});});})[_0xf0c5('0x20')](function(){return db['FaxAccount'][_0xf0c5('0xa2')](_0xdaf4fe['body']['id']);})[_0xf0c5('0x20')](respondWithResult(_0x1cf006,null))[_0xf0c5('0x56')](handleError(_0x1cf006,null));};exports['getMessages']=function(_0x55c6c7,_0x5ba488,_0x4ea6a5){var _0x1a4a9f={'raw':!![],'where':{}};var _0x1ecd6f={};var _0x1dc2a9={'count':0x0,'rows':[]};return db[_0xf0c5('0x3e')][_0xf0c5('0x67')]({'where':{'id':_0x55c6c7['params']['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x5ba488,null))['then'](function(_0x1f6d06){if(_0x1f6d06){_0x1ecd6f[_0xf0c5('0x43')]=_[_0xf0c5('0x46')](db[_0xf0c5('0xa3')]['rawAttributes']);_0x1ecd6f['query']=_[_0xf0c5('0x46')](_0x55c6c7['query']);_0x1ecd6f[_0xf0c5('0x47')]=_[_0xf0c5('0x57')](_0x1ecd6f['model'],_0x1ecd6f[_0xf0c5('0x45')]);_0x1a4a9f[_0xf0c5('0x48')]=_['intersection'](_0x1ecd6f[_0xf0c5('0x43')],qs['fields'](_0x55c6c7['query'][_0xf0c5('0x49')]));_0x1a4a9f[_0xf0c5('0x48')]=_0x1a4a9f[_0xf0c5('0x48')][_0xf0c5('0x4a')]?_0x1a4a9f[_0xf0c5('0x48')]:_0x1ecd6f[_0xf0c5('0x43')];if(!_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x4b')](_0xf0c5('0x4c'))){_0x1a4a9f[_0xf0c5('0x30')]=qs['limit'](_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x30')]);_0x1a4a9f[_0xf0c5('0x2e')]=qs[_0xf0c5('0x2e')](_0x55c6c7[_0xf0c5('0x45')]['offset']);}_0x1a4a9f['order']=qs[_0xf0c5('0x4e')](_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x4e')]);_0x1a4a9f[_0xf0c5('0x4f')]=qs['filters'](_[_0xf0c5('0x68')](_0x55c6c7[_0xf0c5('0x45')],_0x1ecd6f[_0xf0c5('0x47')]));_0x1a4a9f[_0xf0c5('0x4f')][_0xf0c5('0x64')]=_0x1f6d06['id'];if(_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x50')]){_0x1a4a9f[_0xf0c5('0x4f')]=_['merge'](_0x1a4a9f['where'],{'$or':_[_0xf0c5('0x44')](_0x1a4a9f[_0xf0c5('0x48')],function(_0x42e0e7){var _0x3d72f0={};_0x3d72f0[_0x42e0e7]={'$like':'%'+_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x50')]+'%'};return _0x3d72f0;})});}if(_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0xa4')]){var _0x5b9627=_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0xa4')][_0xf0c5('0xa5')](',');var _0xf6f0f3={};_0xf6f0f3[_0x5b9627[0x0]]={'$gte':moment(_0x5b9627[0x1])['format'](_0xf0c5('0xa6'))};_0x1a4a9f[_0xf0c5('0x4f')]=_[_0xf0c5('0x51')](_0x1a4a9f[_0xf0c5('0x4f')],_0xf6f0f3);}_0x1a4a9f=_[_0xf0c5('0x51')]({},_0x1a4a9f,_0x55c6c7[_0xf0c5('0x53')]);return db[_0xf0c5('0xa3')][_0xf0c5('0x31')]({'where':_0x1a4a9f[_0xf0c5('0x4f')]})[_0xf0c5('0x20')](function(_0x5f2bff){_0x1dc2a9[_0xf0c5('0x31')]=_0x5f2bff;if(_0x55c6c7[_0xf0c5('0x45')][_0xf0c5('0x69')]){_0x1a4a9f[_0xf0c5('0x54')]=[{'all':!![]}];}return db[_0xf0c5('0xa3')][_0xf0c5('0x6a')](_0x1a4a9f);})[_0xf0c5('0x20')](function(_0x2a977f){_0x1dc2a9[_0xf0c5('0x55')]=_0x2a977f;return _0x1dc2a9;});}})['then'](respondWithFilteredResult(_0x5ba488,_0x1a4a9f))[_0xf0c5('0x56')](handleError(_0x5ba488,null));};exports[_0xf0c5('0xa7')]=function(_0x346974,_0x57a403,_0x2188c2){var _0x450c13,_0x4e3a04={},_0x259bca;if(_0x346974[_0xf0c5('0x5a')]['to']){_0x259bca=_0x346974[_0xf0c5('0x5a')]['to'][0x0];}return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x346974['params']['id']},'include':[{'model':db[_0xf0c5('0xa8')],'as':'List','include':[{'model':db[_0xf0c5('0x73')],'as':_0xf0c5('0xa9'),'where':{'fax':_0x259bca},'limit':0x1,'order':[[_0xf0c5('0x9f'),_0xf0c5('0xaa')]]}]}]})[_0xf0c5('0x20')](handleEntityNotFound(_0x57a403,null))[_0xf0c5('0x20')](function(_0x1d8ee4){_0x450c13=_0x1d8ee4;if(_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')]&&_0x346974[_0xf0c5('0x5a')]['attachments']['length']){for(var _0x3c9083=0x0;_0x3c9083<_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][_0xf0c5('0x4a')];_0x3c9083+=0x1){_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][_0x3c9083]={'filename':_0x346974['body'][_0xf0c5('0xab')][_0x3c9083][_0xf0c5('0x3b')],'id':_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][_0x3c9083]['id'],'path':path[_0xf0c5('0xac')](config[_0xf0c5('0xad')],_0xf0c5('0xae'),_0x346974[_0xf0c5('0x5a')]['attachments'][_0x3c9083]['basename'])};}}return respondWithRpcPromise(_0xf0c5('0xaf'),_0xf0c5('0xaf'),{'FaxAccountId':_[_0xf0c5('0xb0')](_0x346974['params']['id'])?undefined:_0x346974[_0xf0c5('0x60')]['id'],'path':_[_0xf0c5('0xb0')](_0x346974['body'][_0xf0c5('0xab')][0x0][_0xf0c5('0x8')])?undefined:_0x346974['body'][_0xf0c5('0xab')][0x0][_0xf0c5('0x8')],'fax':_['isNil'](_0x346974['body']['to'][0x0])?undefined:_0x346974[_0xf0c5('0x5a')]['to'][0x0]},client9002);})[_0xf0c5('0x20')](function(){if(_0x450c13){if(_[_0xf0c5('0xb0')](_0x346974['body'][_0xf0c5('0xb1')])){_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xb1')]=util[_0xf0c5('0xb2')](_0xf0c5('0xb3'),_0x450c13[_0xf0c5('0x3b')],_0x450c13['fax']);}if(_0x450c13['List']){if(_0x450c13[_0xf0c5('0xb4')][_0xf0c5('0xa9')][_0xf0c5('0x4a')]){return _0x450c13[_0xf0c5('0xb4')]['Contacts'][0x0];}else{return db[_0xf0c5('0x73')][_0xf0c5('0x59')](_[_0xf0c5('0xb5')](_0x346974[_0xf0c5('0x5a')],{'firstName':_0x346974[_0xf0c5('0x5a')]['to'][0x0],'phone':_0x346974[_0xf0c5('0x5a')]['to'][0x0],'fax':_0x346974[_0xf0c5('0x5a')]['to'][0x0],'ListId':_0x450c13['ListId']}));}}else{throw new Error(_0xf0c5('0xb6'));}}else{throw new Error(_0xf0c5('0xb7'));}})[_0xf0c5('0x20')](function(_0x1ae275){if(_0x1ae275){return db[_0xf0c5('0x72')][_0xf0c5('0x58')]({'where':{'ContactId':_0x1ae275['id'],'closed':![],'FaxAccountId':_0x450c13['id']}})[_0xf0c5('0x20')](function(_0x20d4ec){if(_0x20d4ec){return[_0x20d4ec,![]];}return db[_0xf0c5('0x72')][_0xf0c5('0x59')]({'UserId':_0x346974['user']['id'],'ContactId':_0x1ae275['id'],'FaxAccountId':_0x450c13['id'],'fax':_0x346974[_0xf0c5('0x5a')]['to'][0x0],'firstMsgDirection':_0xf0c5('0xb8'),'Messages':[_[_0xf0c5('0x51')](_0x346974[_0xf0c5('0x5a')],{'read':![],'body':_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][0x0][_0xf0c5('0xb9')],'FaxAccountId':_0x450c13['id'],'UserId':_0x346974[_0xf0c5('0x5c')]['id'],'ContactId':_0x1ae275['id'],'AttachmentId':_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xf0c5('0xba')}]})['then'](function(_0x21fcea){return[_0x21fcea,!![]];});});}else{throw new Error(_0xf0c5('0xbb'));}})[_0xf0c5('0xbc')](function(_0x5cc126,_0xdfe90d){if(_0xdfe90d){return _0x5cc126;}return db['FaxMessage'][_0xf0c5('0x59')]({'direction':_0xf0c5('0xb8'),'read':![],'body':_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][0x0][_0xf0c5('0xb9')],'FaxAccountId':_0x450c13['id'],'FaxInteractionId':_0x5cc126['id'],'UserId':_0x346974['user']['id'],'ContactId':_0x5cc126[_0xf0c5('0xbd')],'AttachmentId':_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][0x0]['id']})[_0xf0c5('0x20')](function(_0x30cf26){_0x5cc126[_0xf0c5('0xbe')][_0xf0c5('0xba')]=[];_0x5cc126[_0xf0c5('0xbe')][_0xf0c5('0xba')][_0xf0c5('0x8a')](_0x30cf26[_0xf0c5('0xbe')]);return _0x5cc126;});})[_0xf0c5('0x20')](function(_0xb57b0a){respondWithRpcPromise(_0xf0c5('0xbf'),_0xf0c5('0xbf'),{'FaxAccountId':_[_0xf0c5('0xb0')](_0x346974[_0xf0c5('0x60')]['id'])?undefined:_0x346974[_0xf0c5('0x60')]['id'],'path':_['isNil'](_0x346974['body']['attachments'][0x0][_0xf0c5('0x8')])?undefined:_0x346974[_0xf0c5('0x5a')][_0xf0c5('0xab')][0x0][_0xf0c5('0x8')],'fax':_[_0xf0c5('0xb0')](_0x346974[_0xf0c5('0x5a')]['to'][0x0])?undefined:_0x346974['body']['to'][0x0],'AttachmentId':_0x346974[_0xf0c5('0x5a')]['attachments'][0x0]['id']},client9002)[_0xf0c5('0x20')](function(_0x521f88){logger[_0xf0c5('0x21')](_0xf0c5('0xc0'),_0x521f88);})[_0xf0c5('0x56')](function(_0x48eec2){logger[_0xf0c5('0x21')](_0xf0c5('0xc0'),_0x48eec2);});return _0xb57b0a;})[_0xf0c5('0x20')](respondWithResult(_0x57a403,null))[_0xf0c5('0x56')](handleError(_0x57a403,null));};exports[_0xf0c5('0xc1')]=function(_0x4fbfec,_0x53edc3,_0x45673d){return db[_0xf0c5('0x3e')][_0xf0c5('0x58')]({'where':{'id':_0x4fbfec[_0xf0c5('0x60')]['id']}})['then'](handleEntityNotFound(_0x53edc3,null))[_0xf0c5('0x20')](function(_0x3c377c){if(_0x3c377c){return _0x3c377c[_0xf0c5('0xc1')](_0x4fbfec['body'][_0xf0c5('0x6b')],_['omit'](_0x4fbfec['body'],[_0xf0c5('0x6b'),'id'])||{})[_0xf0c5('0xbc')](function(_0x23dd36){for(var _0x181bce=0x0;_0x181bce<_0x4fbfec[_0xf0c5('0x5a')][_0xf0c5('0x6b')]['length'];_0x181bce+=0x1){socket[_0xf0c5('0xc2')](_0xf0c5('0xc3'),{'UserId':Number(_0x4fbfec['body'][_0xf0c5('0x6b')][_0x181bce]),'FaxAccountId':Number(_0x4fbfec[_0xf0c5('0x60')]['id'])});}return _0x23dd36;});}})['then'](respondWithResult(_0x53edc3,null))[_0xf0c5('0x56')](handleError(_0x53edc3,null));};exports[_0xf0c5('0xc4')]=function(_0x5a28cf,_0x10b5e5,_0xeff921){return db[_0xf0c5('0x3e')]['find']({'where':{'id':_0x5a28cf[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x10b5e5,null))[_0xf0c5('0x20')](function(_0x21e58f){if(_0x21e58f){return _0x21e58f[_0xf0c5('0xc4')](_0x5a28cf[_0xf0c5('0x45')][_0xf0c5('0x6b')])[_0xf0c5('0x20')](function(){if(_['isArray'](_0x5a28cf[_0xf0c5('0x45')][_0xf0c5('0x6b')])){for(var _0x1bafe6=0x0;_0x1bafe6<_0x5a28cf[_0xf0c5('0x45')][_0xf0c5('0x6b')]['length'];_0x1bafe6+=0x1){socket[_0xf0c5('0xc2')](_0xf0c5('0xc5'),{'UserId':Number(_0x5a28cf['query'][_0xf0c5('0x6b')][_0x1bafe6]),'FaxAccountId':Number(_0x5a28cf[_0xf0c5('0x60')]['id'])});}}else{socket[_0xf0c5('0xc2')](_0xf0c5('0xc5'),{'UserId':Number(_0x5a28cf[_0xf0c5('0x45')]['ids']),'FaxAccountId':Number(_0x5a28cf[_0xf0c5('0x60')]['id'])});}});}})[_0xf0c5('0x20')](respondWithStatusCode(_0x10b5e5,null))[_0xf0c5('0x56')](handleError(_0x10b5e5,null));};exports['getAgents']=function(_0x526498,_0x5b40fa,_0x4cc68e){var _0x59af23={};var _0x472abb={};var _0x2df68e;var _0x41d3d4;return db['FaxAccount'][_0xf0c5('0x67')]({'where':{'id':_0x526498[_0xf0c5('0x60')]['id']}})[_0xf0c5('0x20')](handleEntityNotFound(_0x5b40fa,null))[_0xf0c5('0x20')](function(_0x3a6e69){if(_0x3a6e69){_0x2df68e=_0x3a6e69;_0x472abb[_0xf0c5('0x43')]=_['keys'](db[_0xf0c5('0x75')][_0xf0c5('0x3f')]);_0x472abb['query']=_[_0xf0c5('0x46')](_0x526498[_0xf0c5('0x45')]);_0x472abb[_0xf0c5('0x47')]=_[_0xf0c5('0x57')](_0x472abb[_0xf0c5('0x43')],_0x472abb[_0xf0c5('0x45')]);_0x59af23[_0xf0c5('0x48')]=_['intersection'](_0x472abb['model'],qs[_0xf0c5('0x49')](_0x526498[_0xf0c5('0x45')][_0xf0c5('0x49')]));_0x59af23['attributes']=_0x59af23[_0xf0c5('0x48')][_0xf0c5('0x4a')]?_0x59af23[_0xf0c5('0x48')]:_0x472abb[_0xf0c5('0x43')];_0x59af23['order']=qs[_0xf0c5('0x4e')](_0x526498['query'][_0xf0c5('0x4e')]);_0x59af23[_0xf0c5('0x4f')]=qs['filters'](_[_0xf0c5('0x68')](_0x526498['query'],_0x472abb[_0xf0c5('0x47')]));if(_0x526498[_0xf0c5('0x45')][_0xf0c5('0x50')]){_0x59af23[_0xf0c5('0x4f')]=_['merge'](_0x59af23[_0xf0c5('0x4f')],{'$or':_[_0xf0c5('0x44')](_0x59af23[_0xf0c5('0x48')],function(_0x360e6c){var _0x3484b9={};_0x3484b9[_0x360e6c]={'$like':'%'+_0x526498['query'][_0xf0c5('0x50')]+'%'};return _0x3484b9;})});}_0x59af23=_[_0xf0c5('0x51')]({},_0x59af23,_0x526498['options']);return _0x2df68e['getAgents'](_0x59af23);}})['then'](function(_0x22c1f3){if(_0x22c1f3){_0x41d3d4=_0x22c1f3['length'];if(!_0x526498[_0xf0c5('0x45')][_0xf0c5('0x4b')]('nolimit')){_0x59af23['limit']=qs[_0xf0c5('0x30')](_0x526498[_0xf0c5('0x45')][_0xf0c5('0x30')]);_0x59af23[_0xf0c5('0x2e')]=qs[_0xf0c5('0x2e')](_0x526498['query'][_0xf0c5('0x2e')]);}return _0x2df68e[_0xf0c5('0xc6')](_0x59af23);}})[_0xf0c5('0x20')](function(_0x126da7){if(_0x126da7){return _0x126da7?{'count':_0x41d3d4,'rows':_0x126da7}:null;}})[_0xf0c5('0x20')](respondWithResult(_0x5b40fa,null))['catch'](handleError(_0x5b40fa,null));};
\ No newline at end of file
index 58a77ab..80e049a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x442e=['update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount','save'];(function(_0x20057a,_0x4d8685){var _0x31c79b=function(_0xc2b2f2){while(--_0xc2b2f2){_0x20057a['push'](_0x20057a['shift']());}};_0x31c79b(++_0x4d8685);}(_0x442e,0x1d1));var _0xe442=function(_0x14b7df,_0x550c08){_0x14b7df=_0x14b7df-0x0;var _0x46830d=_0x442e[_0x14b7df];return _0x46830d;};'use strict';var EventEmitter=require(_0xe442('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe442('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe442('0x2'),'afterUpdate':_0xe442('0x3'),'afterDestroy':_0xe442('0x4')};function emitEvent(_0x5f31f6){return function(_0x105ecf,_0x304838,_0xbd9e5){FaxAccountEvents[_0xe442('0x5')](_0x5f31f6+':'+_0x105ecf['id'],_0x105ecf);FaxAccountEvents['emit'](_0x5f31f6,_0x105ecf);_0xbd9e5(null);};}for(var e in events){if(events[_0xe442('0x6')](e)){var event=events[e];FaxAccount[_0xe442('0x7')](e,emitEvent(event));}}module[_0xe442('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0x2721=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount'];(function(_0x1bb037,_0x2f1f54){var _0x346870=function(_0x37bf21){while(--_0x37bf21){_0x1bb037['push'](_0x1bb037['shift']());}};_0x346870(++_0x2f1f54);}(_0x2721,0x151));var _0x1272=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2721[_0x2e4e19];return _0x9ba20b;};'use strict';var EventEmitter=require(_0x1272('0x0'));var FaxAccount=require(_0x1272('0x1'))['db'][_0x1272('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1272('0x3')](0x0);var events={'afterCreate':_0x1272('0x4'),'afterUpdate':_0x1272('0x5'),'afterDestroy':'remove'};function emitEvent(_0x28adb6){return function(_0x7ca49a,_0x3ac6e0,_0x5746de){FaxAccountEvents[_0x1272('0x6')](_0x28adb6+':'+_0x7ca49a['id'],_0x7ca49a);FaxAccountEvents[_0x1272('0x6')](_0x28adb6,_0x7ca49a);_0x5746de(null);};}for(var e in events){if(events[_0x1272('0x7')](e)){var event=events[e];FaxAccount[_0x1272('0x8')](e,emitEvent(event));}}module[_0x1272('0x9')]=FaxAccountEvents;
\ No newline at end of file
index e9bccc6..ee4a060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff9a=['./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xbb6ed5,_0xcdaf35){var _0x269302=function(_0x151647){while(--_0x151647){_0xbb6ed5['push'](_0xbb6ed5['shift']());}};_0x269302(++_0xcdaf35);}(_0xff9a,0x88));var _0xaff9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff9a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaff9('0x0'));var util=require(_0xaff9('0x1'));var logger=require(_0xaff9('0x2'))(_0xaff9('0x3'));var moment=require('moment');var BPromise=require(_0xaff9('0x4'));var rp=require(_0xaff9('0x5'));var fs=require('fs');var path=require(_0xaff9('0x6'));var rimraf=require(_0xaff9('0x7'));var config=require('../../config/environment');var attributes=require(_0xaff9('0x8'));module[_0xaff9('0x9')]=function(_0x343bbb,_0x1ed4e7){return _0x343bbb[_0xaff9('0xa')]('FaxAccount',attributes,{'tableName':_0xaff9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1844=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash'];(function(_0x2659bf,_0x50c078){var _0x168472=function(_0x5b34b5){while(--_0x5b34b5){_0x2659bf['push'](_0x2659bf['shift']());}};_0x168472(++_0x50c078);}(_0x1844,0x192));var _0x4184=function(_0x544cb8,_0x2d06d6){_0x544cb8=_0x544cb8-0x0;var _0x45ad68=_0x1844[_0x544cb8];return _0x45ad68;};'use strict';var _=require(_0x4184('0x0'));var util=require(_0x4184('0x1'));var logger=require('../../config/logger')(_0x4184('0x2'));var moment=require(_0x4184('0x3'));var BPromise=require(_0x4184('0x4'));var rp=require(_0x4184('0x5'));var fs=require('fs');var path=require(_0x4184('0x6'));var rimraf=require(_0x4184('0x7'));var config=require(_0x4184('0x8'));var attributes=require(_0x4184('0x9'));module['exports']=function(_0x488e2f,_0x1a6b54){return _0x488e2f[_0x4184('0xa')](_0x4184('0xb'),attributes,{'tableName':_0x4184('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0602a42..5e0d0e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x550d=['length','ListId','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','startRouting','Start','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetFaxAccount','FaxAccount','findAll','options','where','limit','map','include','attributes','model','debug','NotifyFaxAccount','body','fax','CmContact','Sequelize','difference','createdAt','updatedAt','keys','CompanyId','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','List','Contacts','DESC','FaxApplication','applications','Applications','list','orderBy','asc'];(function(_0x57a52,_0x3e2f4b){var _0x3604d7=function(_0x547ea0){while(--_0x547ea0){_0x57a52['push'](_0x57a52['shift']());}};_0x3604d7(++_0x3e2f4b);}(_0x550d,0x116));var _0xd550=function(_0x12ea60,_0x526b72){_0x12ea60=_0x12ea60-0x0;var _0xb55f2=_0x550d[_0x12ea60];return _0xb55f2;};'use strict';var _=require(_0xd550('0x0'));var util=require(_0xd550('0x1'));var moment=require(_0xd550('0x2'));var BPromise=require('bluebird');var rs=require(_0xd550('0x3'));var fs=require('fs');var Redis=require(_0xd550('0x4'));var db=require(_0xd550('0x5'))['db'];var utils=require(_0xd550('0x6'));var logger=require(_0xd550('0x7'))(_0xd550('0x8'));var config=require('../../config/environment');var jayson=require(_0xd550('0x9'));var client=jayson[_0xd550('0xa')][_0xd550('0xb')]({'port':0x232c});config[_0xd550('0xc')]=_[_0xd550('0xd')](config['redis'],{'host':_0xd550('0xe'),'port':0x18eb});var socket=require(_0xd550('0xf'))(new Redis(config[_0xd550('0xc')]));require(_0xd550('0x10'))[_0xd550('0x11')](socket);function respondWithRpcPromise(_0xa132f3,_0x460c07,_0x16150d){return new BPromise(function(_0x5e58ab,_0x5eada3){return client['request'](_0xa132f3,_0x16150d)[_0xd550('0x12')](function(_0x2356c7){logger[_0xd550('0x13')](_0xd550('0x14'),_0x460c07,_0xd550('0x15'));logger['debug'](_0xd550('0x16'),_0x460c07,_0xd550('0x15'),JSON[_0xd550('0x17')](_0x2356c7));if(_0x2356c7[_0xd550('0x18')]){if(_0x2356c7['error'][_0xd550('0x19')]===0x1f4){logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x2356c7[_0xd550('0x18')][_0xd550('0x1a')]);return _0x5eada3(_0x2356c7['error']['message']);}logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x2356c7['error']['message']);return _0x5e58ab(_0x2356c7[_0xd550('0x18')][_0xd550('0x1a')]);}else{logger[_0xd550('0x13')]('FaxAccount,\x20%s,\x20%s',_0x460c07,_0xd550('0x15'));_0x5e58ab(_0x2356c7['result']['message']);}})['catch'](function(_0x1ed8e9){logger[_0xd550('0x18')](_0xd550('0x14'),_0x460c07,_0x1ed8e9);_0x5eada3(_0x1ed8e9);});});}exports[_0xd550('0x1b')]=function(_0x4606f7){var _0x38615b=this;return new Promise(function(_0x2c2383,_0x415183){return db[_0xd550('0x1c')][_0xd550('0x1d')]({'raw':_0x4606f7[_0xd550('0x1e')]?_0x4606f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x4606f7['options']?_0x4606f7[_0xd550('0x1e')][_0xd550('0x1f')]||null:null,'attributes':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')]['attributes']||null:null,'limit':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')][_0xd550('0x20')]||null:null,'include':_0x4606f7[_0xd550('0x1e')]?_0x4606f7[_0xd550('0x1e')]['include']?_[_0xd550('0x21')](_0x4606f7[_0xd550('0x1e')][_0xd550('0x22')],function(_0x1c267e){return{'model':db[_0x1c267e['model']],'as':_0x1c267e['as'],'attributes':_0x1c267e[_0xd550('0x23')],'include':_0x1c267e[_0xd550('0x22')]?_[_0xd550('0x21')](_0x1c267e[_0xd550('0x22')],function(_0x24c6e1){return{'model':db[_0x24c6e1[_0xd550('0x24')]],'as':_0x24c6e1['as'],'attributes':_0x24c6e1['attributes'],'include':_0x24c6e1['include']?_[_0xd550('0x21')](_0x24c6e1[_0xd550('0x22')],function(_0x43f3dd){return{'model':db[_0x43f3dd['model']],'as':_0x43f3dd['as'],'attributes':_0x43f3dd[_0xd550('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd550('0x12')](function(_0x27ade5){logger[_0xd550('0x13')](_0xd550('0x1b'),_0x4606f7);logger[_0xd550('0x25')]('GetFaxAccount',_0x4606f7,JSON['stringify'](_0x27ade5));_0x2c2383(_0x27ade5);})['catch'](function(_0x4da3be){logger[_0xd550('0x18')](_0xd550('0x1b'),_0x4da3be[_0xd550('0x1a')],_0x4606f7);_0x415183(_0x38615b['error'](0x1f4,_0x4da3be[_0xd550('0x1a')]));});});};exports[_0xd550('0x26')]=function(_0x1bc79e,_0x47cd21,_0x61b849){var _0x2dd21f=this;return new Promise(function(_0x3bb470,_0x28aa77){var _0x551577={'body':_0x1bc79e[_0xd550('0x27')],'channel':_0xd550('0x28')};var _0x1c01e7=[];var _0x3ca836=[];var _0xe7541a={};return db[_0xd550('0x29')]['describe']()[_0xd550('0x12')](function(_0x1d9f2b){if(!_0x1d9f2b){throw new db[(_0xd550('0x2a'))]['ValidationError']('no\x20available\x20attributes');}_0x1c01e7=_[_0xd550('0x2b')](_['keys'](_0x1d9f2b),[_0xd550('0x2c'),_0xd550('0x2d')]);_0x3ca836=_[_0xd550('0x2b')](_[_0xd550('0x2e')](_0x1d9f2b),[_0xd550('0x2c'),_0xd550('0x2d'),_0xd550('0x2f'),'ListId']);if(_0x1bc79e[_0xd550('0x27')]['id']){delete _0x1bc79e['body']['id'];}if(_['isNil'](_0x1bc79e['body']['from'])){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x31'));}if(_[_0xd550('0x32')](_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')])||_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')]===''){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x33'));}if(_[_0xd550('0x32')](_0x1bc79e['body']['mapKey'])){throw new db[(_0xd550('0x2a'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ca836);}if(!_['includes'](_0x3ca836,_0x1bc79e['body'][_0xd550('0x34')])){throw new db[(_0xd550('0x2a'))][(_0xd550('0x30'))](_0xd550('0x35')+_0x3ca836);}_0xe7541a[_0x1bc79e['body']['mapKey']]=_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')];})['then'](function(){return db[_0xd550('0x1c')][_0xd550('0x37')]({'where':{'id':_0x1bc79e[_0xd550('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0xd550('0x39'),'include':[{'model':db[_0xd550('0x29')],'as':_0xd550('0x3a'),'where':_0xe7541a,'limit':0x1,'order':[[_0xd550('0x2d'),_0xd550('0x3b')]]}]},{'model':db[_0xd550('0x3c')],'as':'Applications'}]});})[_0xd550('0x12')](function(_0x3c96be){if(_0x3c96be&&_0x3c96be[_0xd550('0x39')]){var _0x2a99bc=_0x3c96be['get']({'plain':!![]});_0x551577['account']=_0x2a99bc;_0x551577[_0xd550('0x3d')]=_0x2a99bc[_0xd550('0x3e')];_0x551577[_0xd550('0x3f')]=_0x2a99bc[_0xd550('0x39')];_0x551577['applications']=_[_0xd550('0x40')](_0x551577['applications'],['priority'],[_0xd550('0x41')]);if(_0x551577[_0xd550('0x38')][_0xd550('0x3e')]){delete _0x551577[_0xd550('0x38')]['Applications'];}if(_0x551577['account'][_0xd550('0x39')]&&_0x551577[_0xd550('0x38')]['List'][_0xd550('0x3a')][_0xd550('0x42')]){return _0x551577[_0xd550('0x38')][_0xd550('0x39')][_0xd550('0x3a')][0x0];}var _0x262ff9=_[_0xd550('0xd')](_0x1bc79e[_0xd550('0x27')],{'firstName':_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')],'ListId':_0x2a99bc[_0xd550('0x43')]});_0x262ff9[_0x1bc79e[_0xd550('0x27')]['mapKey']]=_0x1bc79e[_0xd550('0x27')][_0xd550('0x36')];return db['CmContact']['create'](_0x262ff9,{'fields':_0x1c01e7,'raw':!![]});}})[_0xd550('0x12')](function(_0x51b8ab){_0x551577['contact']=_0x51b8ab;if(_0x51b8ab){var _0x3a78af={'ContactId':_0x51b8ab['id'],'FaxAccountId':_0x1bc79e[_0xd550('0x38')]['id'],'fax':_0x51b8ab['fax']};return db[_0xd550('0x44')][_0xd550('0x37')]({'where':{'ContactId':_0x51b8ab['id'],'closed':![],'FaxAccountId':_0x1bc79e[_0xd550('0x38')]['id']}})[_0xd550('0x12')](function(_0x2b9f3c){if(_0x2b9f3c){return[_0x2b9f3c,![]];}return db[_0xd550('0x44')][_0xd550('0x45')](_0x3a78af)[_0xd550('0x12')](function(_0x1a7e7d){return[_0x1a7e7d,!![]];});});}else{throw new Error(_0xd550('0x46'));}})[_0xd550('0x47')](function(_0x15c7fa,_0x22b8e8){var _0x402619=_0x15c7fa['get']({'plain':!![]});if(_0x22b8e8){if(_0x551577[_0xd550('0x38')][_0xd550('0x48')]){_0x551577['applications']['push']({'id':0x0,'priority':_0x551577[_0xd550('0x3d')][_0xd550('0x42')]+0x1,'app':_0xd550('0x49'),'appdata':'unmanaged','interval':_0xd550('0x4a')});}_0x402619[_0xd550('0x4b')]=!![];}else{_0x402619['created']=![];}_0x551577[_0xd550('0x4c')]=_0x402619;return db[_0xd550('0x4d')]['create']({'body':_0x1bc79e[_0xd550('0x27')][_0xd550('0x27')],'FaxAccountId':_0x1bc79e['account']['id'],'FaxInteractionId':_0x15c7fa['id'],'direction':'in','ContactId':_0x15c7fa['ContactId'],'AttachmentId':_0x1bc79e[_0xd550('0x27')][_0xd550('0x4e')]});})[_0xd550('0x12')](function(_0x397f75){_0x551577[_0xd550('0x1a')]=_0x397f75;if(_0x551577['interaction'][_0xd550('0x4f')]){return db[_0xd550('0x50')][_0xd550('0x37')]({'attributes':['id',_0xd550('0x51')],'where':{'id':_0x551577['interaction'][_0xd550('0x4f')]}})['then'](function(_0x43a28c){if(_0x43a28c){_0x551577[_0xd550('0x3d')][_0xd550('0x52')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43a28c['name']+','+(_0x551577[_0xd550('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xd550('0x53'),_0x551577);});}return respondWithRpcPromise(_0xd550('0x54'),_0xd550('0x53'),_0x551577);})[_0xd550('0x12')](function(_0x50d15f){_0x3bb470(_0x50d15f);})[_0xd550('0x55')](function(_0x593879){_0x28aa77(_0x2dd21f[_0xd550('0x18')](0x1f4,_0x593879[_0xd550('0x1a')]));});});};
\ No newline at end of file
+var _0xd717=['from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','Contacts','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','unmanaged','*,*,*,*','created','FaxMessage','ContactId','UserId','User','name','unshift','agent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil'];(function(_0x1d78b1,_0x5a8894){var _0x23cfbd=function(_0x26bf52){while(--_0x26bf52){_0x1d78b1['push'](_0x1d78b1['shift']());}};_0x23cfbd(++_0x5a8894);}(_0xd717,0x12e));var _0x7d71=function(_0x494003,_0xfb195f){_0x494003=_0x494003-0x0;var _0x4a4c1e=_0xd717[_0x494003];return _0x4a4c1e;};'use strict';var _=require(_0x7d71('0x0'));var util=require(_0x7d71('0x1'));var moment=require(_0x7d71('0x2'));var BPromise=require(_0x7d71('0x3'));var rs=require(_0x7d71('0x4'));var fs=require('fs');var Redis=require(_0x7d71('0x5'));var db=require(_0x7d71('0x6'))['db'];var utils=require(_0x7d71('0x7'));var logger=require(_0x7d71('0x8'))(_0x7d71('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7d71('0xa')][_0x7d71('0xb')]({'port':0x232c});config[_0x7d71('0xc')]=_[_0x7d71('0xd')](config[_0x7d71('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d71('0xe'))(new Redis(config['redis']));require(_0x7d71('0xf'))[_0x7d71('0x10')](socket);function respondWithRpcPromise(_0x48c0da,_0x610f33,_0x20ba5f){return new BPromise(function(_0x5c3d93,_0x1f7b71){return client['request'](_0x48c0da,_0x20ba5f)[_0x7d71('0x11')](function(_0x1ab2a2){logger[_0x7d71('0x12')](_0x7d71('0x13'),_0x610f33,'request\x20sent');logger[_0x7d71('0x14')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x610f33,_0x7d71('0x15'),JSON['stringify'](_0x1ab2a2));if(_0x1ab2a2['error']){if(_0x1ab2a2[_0x7d71('0x16')][_0x7d71('0x17')]===0x1f4){logger['error'](_0x7d71('0x13'),_0x610f33,_0x1ab2a2[_0x7d71('0x16')][_0x7d71('0x18')]);return _0x1f7b71(_0x1ab2a2[_0x7d71('0x16')][_0x7d71('0x18')]);}logger[_0x7d71('0x16')](_0x7d71('0x13'),_0x610f33,_0x1ab2a2[_0x7d71('0x16')][_0x7d71('0x18')]);return _0x5c3d93(_0x1ab2a2[_0x7d71('0x16')][_0x7d71('0x18')]);}else{logger['info'](_0x7d71('0x13'),_0x610f33,_0x7d71('0x15'));_0x5c3d93(_0x1ab2a2[_0x7d71('0x19')]['message']);}})[_0x7d71('0x1a')](function(_0x4e9304){logger[_0x7d71('0x16')]('FaxAccount,\x20%s,\x20%s',_0x610f33,_0x4e9304);_0x1f7b71(_0x4e9304);});});}exports[_0x7d71('0x1b')]=function(_0x4989ac){var _0x51a359=this;return new Promise(function(_0x1841a4,_0x3ed2d6){return db[_0x7d71('0x1c')]['findAll']({'raw':_0x4989ac['options']?_0x4989ac[_0x7d71('0x1d')][_0x7d71('0x1e')]===undefined?!![]:![]:!![],'where':_0x4989ac['options']?_0x4989ac[_0x7d71('0x1d')][_0x7d71('0x1f')]||null:null,'attributes':_0x4989ac[_0x7d71('0x1d')]?_0x4989ac[_0x7d71('0x1d')][_0x7d71('0x20')]||null:null,'limit':_0x4989ac[_0x7d71('0x1d')]?_0x4989ac[_0x7d71('0x1d')][_0x7d71('0x21')]||null:null,'include':_0x4989ac['options']?_0x4989ac['options'][_0x7d71('0x22')]?_[_0x7d71('0x23')](_0x4989ac['options'][_0x7d71('0x22')],function(_0x4738d1){return{'model':db[_0x4738d1[_0x7d71('0x24')]],'as':_0x4738d1['as'],'attributes':_0x4738d1[_0x7d71('0x20')],'include':_0x4738d1['include']?_[_0x7d71('0x23')](_0x4738d1[_0x7d71('0x22')],function(_0x1f12bf){return{'model':db[_0x1f12bf[_0x7d71('0x24')]],'as':_0x1f12bf['as'],'attributes':_0x1f12bf[_0x7d71('0x20')],'include':_0x1f12bf[_0x7d71('0x22')]?_[_0x7d71('0x23')](_0x1f12bf[_0x7d71('0x22')],function(_0x1bddf7){return{'model':db[_0x1bddf7[_0x7d71('0x24')]],'as':_0x1bddf7['as'],'attributes':_0x1bddf7[_0x7d71('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x322772){logger[_0x7d71('0x12')](_0x7d71('0x1b'),_0x4989ac);logger['debug']('GetFaxAccount',_0x4989ac,JSON['stringify'](_0x322772));_0x1841a4(_0x322772);})[_0x7d71('0x1a')](function(_0x69b9a1){logger[_0x7d71('0x16')](_0x7d71('0x1b'),_0x69b9a1[_0x7d71('0x18')],_0x4989ac);_0x3ed2d6(_0x51a359[_0x7d71('0x16')](0x1f4,_0x69b9a1[_0x7d71('0x18')]));});});};exports[_0x7d71('0x25')]=function(_0x36dcea,_0x57edc5,_0xa194f9){var _0x3e8257=this;return new Promise(function(_0x2081de,_0x2dcc27){var _0x3e886f={'body':_0x36dcea['body'],'channel':_0x7d71('0x26')};var _0x1d633b=[];var _0x9a2a6e=[];var _0x569543={};return db[_0x7d71('0x27')]['describe']()[_0x7d71('0x11')](function(_0x4c455e){if(!_0x4c455e){throw new db[(_0x7d71('0x28'))]['ValidationError'](_0x7d71('0x29'));}_0x1d633b=_[_0x7d71('0x2a')](_[_0x7d71('0x2b')](_0x4c455e),[_0x7d71('0x2c'),_0x7d71('0x2d')]);_0x9a2a6e=_[_0x7d71('0x2a')](_[_0x7d71('0x2b')](_0x4c455e),[_0x7d71('0x2c'),_0x7d71('0x2d'),_0x7d71('0x2e'),_0x7d71('0x2f')]);if(_0x36dcea[_0x7d71('0x30')]['id']){delete _0x36dcea[_0x7d71('0x30')]['id'];}if(_[_0x7d71('0x31')](_0x36dcea[_0x7d71('0x30')][_0x7d71('0x32')])){throw new db['Sequelize'][(_0x7d71('0x33'))]('from\x20is\x20mandatory');}if(_[_0x7d71('0x31')](_0x36dcea[_0x7d71('0x30')][_0x7d71('0x30')])||_0x36dcea[_0x7d71('0x30')][_0x7d71('0x30')]===''){throw new db['Sequelize'][(_0x7d71('0x33'))](_0x7d71('0x34'));}if(_['isNil'](_0x36dcea[_0x7d71('0x30')][_0x7d71('0x35')])){throw new db[(_0x7d71('0x28'))][(_0x7d71('0x33'))](_0x7d71('0x36')+_0x9a2a6e);}if(!_[_0x7d71('0x37')](_0x9a2a6e,_0x36dcea[_0x7d71('0x30')][_0x7d71('0x35')])){throw new db[(_0x7d71('0x28'))][(_0x7d71('0x33'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9a2a6e);}_0x569543[_0x36dcea[_0x7d71('0x30')][_0x7d71('0x35')]]=_0x36dcea[_0x7d71('0x30')][_0x7d71('0x32')];})[_0x7d71('0x11')](function(){return db[_0x7d71('0x1c')][_0x7d71('0x38')]({'where':{'id':_0x36dcea[_0x7d71('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x7d71('0x3a'),'include':[{'model':db[_0x7d71('0x27')],'as':'Contacts','where':_0x569543,'limit':0x1,'order':[['updatedAt',_0x7d71('0x3b')]]}]},{'model':db[_0x7d71('0x3c')],'as':_0x7d71('0x3d')}]});})[_0x7d71('0x11')](function(_0x57d24f){if(_0x57d24f&&_0x57d24f[_0x7d71('0x3a')]){var _0x460c9c=_0x57d24f[_0x7d71('0x3e')]({'plain':!![]});_0x3e886f[_0x7d71('0x39')]=_0x460c9c;_0x3e886f[_0x7d71('0x3f')]=_0x460c9c[_0x7d71('0x3d')];_0x3e886f[_0x7d71('0x40')]=_0x460c9c[_0x7d71('0x3a')];_0x3e886f[_0x7d71('0x3f')]=_[_0x7d71('0x41')](_0x3e886f[_0x7d71('0x3f')],['priority'],[_0x7d71('0x42')]);if(_0x3e886f[_0x7d71('0x39')]['Applications']){delete _0x3e886f[_0x7d71('0x39')][_0x7d71('0x3d')];}if(_0x3e886f[_0x7d71('0x39')][_0x7d71('0x3a')]&&_0x3e886f[_0x7d71('0x39')][_0x7d71('0x3a')][_0x7d71('0x43')][_0x7d71('0x44')]){return _0x3e886f[_0x7d71('0x39')]['List'][_0x7d71('0x43')][0x0];}var _0x480318=_[_0x7d71('0xd')](_0x36dcea[_0x7d71('0x30')],{'firstName':_0x36dcea[_0x7d71('0x30')][_0x7d71('0x32')],'ListId':_0x460c9c['ListId']});_0x480318[_0x36dcea['body'][_0x7d71('0x35')]]=_0x36dcea[_0x7d71('0x30')][_0x7d71('0x32')];return db[_0x7d71('0x27')][_0x7d71('0x45')](_0x480318,{'fields':_0x1d633b,'raw':!![]});}})[_0x7d71('0x11')](function(_0x548446){_0x3e886f[_0x7d71('0x46')]=_0x548446;if(_0x548446){var _0x8359b8={'ContactId':_0x548446['id'],'FaxAccountId':_0x36dcea[_0x7d71('0x39')]['id'],'fax':_0x548446['fax']};return db['FaxInteraction'][_0x7d71('0x38')]({'where':{'ContactId':_0x548446['id'],'closed':![],'FaxAccountId':_0x36dcea[_0x7d71('0x39')]['id']}})[_0x7d71('0x11')](function(_0x2811d8){if(_0x2811d8){return[_0x2811d8,![]];}return db[_0x7d71('0x47')][_0x7d71('0x45')](_0x8359b8)[_0x7d71('0x11')](function(_0x20bba6){return[_0x20bba6,!![]];});});}else{throw new Error(_0x7d71('0x48'));}})[_0x7d71('0x49')](function(_0x26a00d,_0x4ea8e8){var _0xbb134e=_0x26a00d[_0x7d71('0x3e')]({'plain':!![]});if(_0x4ea8e8){if(_0x3e886f[_0x7d71('0x39')][_0x7d71('0x4a')]){_0x3e886f[_0x7d71('0x3f')][_0x7d71('0x4b')]({'id':0x0,'priority':_0x3e886f['applications'][_0x7d71('0x44')]+0x1,'app':'close','appdata':_0x7d71('0x4c'),'interval':_0x7d71('0x4d')});}_0xbb134e[_0x7d71('0x4e')]=!![];}else{_0xbb134e[_0x7d71('0x4e')]=![];}_0x3e886f['interaction']=_0xbb134e;return db[_0x7d71('0x4f')]['create']({'body':_0x36dcea[_0x7d71('0x30')][_0x7d71('0x30')],'FaxAccountId':_0x36dcea[_0x7d71('0x39')]['id'],'FaxInteractionId':_0x26a00d['id'],'direction':'in','ContactId':_0x26a00d[_0x7d71('0x50')],'AttachmentId':_0x36dcea[_0x7d71('0x30')]['AttachmentId']});})['then'](function(_0x385d69){_0x3e886f['message']=_0x385d69;if(_0x3e886f['interaction'][_0x7d71('0x51')]){return db[_0x7d71('0x52')][_0x7d71('0x38')]({'attributes':['id',_0x7d71('0x53')],'where':{'id':_0x3e886f['interaction'][_0x7d71('0x51')]}})[_0x7d71('0x11')](function(_0x22ff00){if(_0x22ff00){_0x3e886f[_0x7d71('0x3f')][_0x7d71('0x54')]({'id':0x0,'priority':0x0,'app':_0x7d71('0x55'),'appdata':_0x22ff00[_0x7d71('0x53')]+','+(_0x3e886f[_0x7d71('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x7d71('0x56'),_0x3e886f);});}return respondWithRpcPromise(_0x7d71('0x57'),_0x7d71('0x56'),_0x3e886f);})['then'](function(_0x4ea64f){_0x2081de(_0x4ea64f);})['catch'](function(_0x4c64c6){_0x2dcc27(_0x3e8257[_0x7d71('0x16')](0x1f4,_0x4c64c6['message']));});});};
\ No newline at end of file
index 17375db..38188de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x712a=['remove','update','removeListener','register','faxAccount:','./faxAccount.events','save'];(function(_0x2a1b1f,_0x307251){var _0x5e0390=function(_0x1018be){while(--_0x1018be){_0x2a1b1f['push'](_0x2a1b1f['shift']());}};_0x5e0390(++_0x307251);}(_0x712a,0x139));var _0xa712=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x712a[_0x22b68a];return _0x1ac67a;};'use strict';var FaxAccountEvents=require(_0xa712('0x0'));var events=[_0xa712('0x1'),_0xa712('0x2'),_0xa712('0x3')];function createListener(_0x49eca2,_0x3c1e3a){return function(_0xa80be){_0x3c1e3a['emit'](_0x49eca2,_0xa80be);};}function removeListener(_0xb5a801,_0x355987){return function(){FaxAccountEvents[_0xa712('0x4')](_0xb5a801,_0x355987);};}exports[_0xa712('0x5')]=function(_0x3dfb7c){for(var _0x447cb0=0x0,_0x242099=events['length'];_0x447cb0<_0x242099;_0x447cb0++){var _0x4fbe43=events[_0x447cb0];var _0x301150=createListener(_0xa712('0x6')+_0x4fbe43,_0x3dfb7c);FaxAccountEvents['on'](_0x4fbe43,_0x301150);}};
\ No newline at end of file
+var _0x990f=['length','faxAccount:','./faxAccount.events','save','remove','removeListener','register'];(function(_0x39758d,_0x346423){var _0x44ac11=function(_0x175008){while(--_0x175008){_0x39758d['push'](_0x39758d['shift']());}};_0x44ac11(++_0x346423);}(_0x990f,0x175));var _0xf990=function(_0x338cac,_0x3e8474){_0x338cac=_0x338cac-0x0;var _0x266468=_0x990f[_0x338cac];return _0x266468;};'use strict';var FaxAccountEvents=require(_0xf990('0x0'));var events=[_0xf990('0x1'),_0xf990('0x2'),'update'];function createListener(_0x4356c1,_0x52a9c3){return function(_0x254dc5){_0x52a9c3['emit'](_0x4356c1,_0x254dc5);};}function removeListener(_0x428749,_0x5eae11){return function(){FaxAccountEvents[_0xf990('0x3')](_0x428749,_0x5eae11);};}exports[_0xf990('0x4')]=function(_0x232e19){for(var _0x241b1f=0x0,_0xbe62ce=events[_0xf990('0x5')];_0x241b1f<_0xbe62ce;_0x241b1f++){var _0x4711e2=events[_0x241b1f];var _0x526f36=createListener(_0xf990('0x6')+_0x4711e2,_0x232e19);FaxAccountEvents['on'](_0x4711e2,_0x526f36);}};
\ No newline at end of file
index 28208fb..99ac080 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(_0x4688f3,_0x36fa36){var _0x3cb0b9=function(_0x50daea){while(--_0x50daea){_0x4688f3['push'](_0x4688f3['shift']());}};_0x3cb0b9(++_0x36fa36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x59b969,_0x59b1a8){var _0x2b2f54=function(_0x2a92a2){while(--_0x2a92a2){_0x59b969['push'](_0x59b969['shift']());}};_0x2b2f54(++_0x59b1a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 13e831b..8159efe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba6=['TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x1c280a,_0x405606){var _0x5910bd=function(_0x31fde1){while(--_0x31fde1){_0x1c280a['push'](_0x1c280a['shift']());}};_0x5910bd(++_0x405606);}(_0xcba6,0xfd));var _0x6cba=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xcba6[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0x6cba('0x0'));module[_0x6cba('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6cba('0x2')]()},'description':{'type':Sequelize[_0x6cba('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6cba('0x4')}};
\ No newline at end of file
+var _0xfb17=['noop','TEXT','STRING','sequelize','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb17,0x189));var _0x7fb1=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xfb17[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x7fb1('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7fb1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7fb1('0x2')},'appdata':{'type':Sequelize[_0x7fb1('0x3')]()},'description':{'type':Sequelize[_0x7fb1('0x4')]},'interval':{'type':Sequelize[_0x7fb1('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a6e6bad..bc01010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeea5=['limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','FaxApplication','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','options','count','includeAll','findAll','catch','params','rawAttributes','include','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined'];(function(_0x65b37e,_0x22500b){var _0x485d15=function(_0x31d35f){while(--_0x31d35f){_0x65b37e['push'](_0x65b37e['shift']());}};_0x485d15(++_0x22500b);}(_0xeea5,0x158));var _0x5eea=function(_0x40f993,_0x488687){_0x40f993=_0x40f993-0x0;var _0x364845=_0xeea5[_0x40f993];return _0x364845;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eea('0x0'));var zipdir=require(_0x5eea('0x1'));var jsonpatch=require(_0x5eea('0x2'));var rp=require(_0x5eea('0x3'));var moment=require(_0x5eea('0x4'));var BPromise=require(_0x5eea('0x5'));var Mustache=require('mustache');var util=require(_0x5eea('0x6'));var path=require(_0x5eea('0x7'));var sox=require(_0x5eea('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5eea('0x9'));var squel=require(_0x5eea('0xa'));var crypto=require(_0x5eea('0xb'));var jsforce=require(_0x5eea('0xc'));var deskjs=require(_0x5eea('0xd'));var toCsv=require(_0x5eea('0xe'));var querystring=require(_0x5eea('0xf'));var Papa=require(_0x5eea('0x10'));var Redis=require(_0x5eea('0x11'));var authService=require(_0x5eea('0x12'));var qs=require(_0x5eea('0x13'));var as=require(_0x5eea('0x14'));var hardwareService=require(_0x5eea('0x15'));var logger=require(_0x5eea('0x16'))(_0x5eea('0x17'));var utils=require('../../config/utils');var config=require(_0x5eea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5eea('0x19'))['db'];function respondWithStatusCode(_0x1c1495,_0x3a6792){_0x3a6792=_0x3a6792||0xcc;return function(_0x2b6ee0){if(_0x2b6ee0){return _0x1c1495['sendStatus'](_0x3a6792);}return _0x1c1495['status'](_0x3a6792)[_0x5eea('0x1a')]();};}function respondWithResult(_0x488b87,_0x3edeec){_0x3edeec=_0x3edeec||0xc8;return function(_0x383145){if(_0x383145){return _0x488b87[_0x5eea('0x1b')](_0x3edeec)[_0x5eea('0x1c')](_0x383145);}};}function respondWithFilteredResult(_0x435b26,_0x3b3731){return function(_0x458b08){if(_0x458b08){var _0x4932da=typeof _0x3b3731[_0x5eea('0x1d')]===_0x5eea('0x1e')&&typeof _0x3b3731[_0x5eea('0x1f')]===_0x5eea('0x1e');var _0x313944=_0x458b08['count'];var _0x39c371=_0x4932da?0x0:_0x3b3731[_0x5eea('0x1d')];var _0x4bcd19=_0x4932da?_0x458b08['count']:_0x3b3731[_0x5eea('0x1d')]+_0x3b3731[_0x5eea('0x1f')];var _0x46ecf2;if(_0x4bcd19>=_0x313944){_0x4bcd19=_0x313944;_0x46ecf2=0xc8;}else{_0x46ecf2=0xce;}_0x435b26[_0x5eea('0x1b')](_0x46ecf2);return _0x435b26[_0x5eea('0x20')](_0x5eea('0x21'),_0x39c371+'-'+_0x4bcd19+'/'+_0x313944)[_0x5eea('0x1c')](_0x458b08);}return null;};}function patchUpdates(_0x33b3d7){return function(_0x4fb199){try{jsonpatch[_0x5eea('0x22')](_0x4fb199,_0x33b3d7,!![]);}catch(_0x23a96a){return BPromise[_0x5eea('0x23')](_0x23a96a);}return _0x4fb199[_0x5eea('0x24')]();};}function saveUpdates(_0x54384e,_0x5e6beb){return function(_0x96912e){if(_0x96912e){return _0x96912e[_0x5eea('0x25')](_0x54384e)[_0x5eea('0x26')](function(_0x1c1c64){return _0x1c1c64;});}return null;};}function removeEntity(_0x26aecd,_0xf58942){return function(_0xcc9dd9){if(_0xcc9dd9){return _0xcc9dd9['destroy']()[_0x5eea('0x26')](function(){_0x26aecd[_0x5eea('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24552f,_0x46aeb8){return function(_0x1ddde5){if(!_0x1ddde5){_0x24552f[_0x5eea('0x27')](0x194);}return _0x1ddde5;};}function handleError(_0x3de4a8,_0x25f558){_0x25f558=_0x25f558||0x1f4;return function(_0x2cd105){logger[_0x5eea('0x28')](_0x2cd105[_0x5eea('0x29')]);if(_0x2cd105[_0x5eea('0x2a')]){delete _0x2cd105[_0x5eea('0x2a')];}_0x3de4a8['status'](_0x25f558)[_0x5eea('0x2b')](_0x2cd105);};}exports[_0x5eea('0x2c')]=function(_0x42c04a,_0x310490){var _0x2490e9={},_0x2e307e={},_0xeed37a={'count':0x0,'rows':[]};var _0x518f44=_['map'](db[_0x5eea('0x2d')]['rawAttributes'],function(_0x4fccef){return{'name':_0x4fccef[_0x5eea('0x2e')],'type':_0x4fccef[_0x5eea('0x2f')]['key']};});_0x2e307e[_0x5eea('0x30')]=_['map'](_0x518f44,'name');_0x2e307e[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x42c04a[_0x5eea('0x31')]);_0x2e307e[_0x5eea('0x33')]=_[_0x5eea('0x34')](_0x2e307e[_0x5eea('0x30')],_0x2e307e[_0x5eea('0x31')]);_0x2490e9[_0x5eea('0x35')]=_[_0x5eea('0x34')](_0x2e307e[_0x5eea('0x30')],qs[_0x5eea('0x36')](_0x42c04a[_0x5eea('0x31')][_0x5eea('0x36')]));_0x2490e9[_0x5eea('0x35')]=_0x2490e9['attributes'][_0x5eea('0x37')]?_0x2490e9[_0x5eea('0x35')]:_0x2e307e[_0x5eea('0x30')];if(!_0x42c04a[_0x5eea('0x31')]['hasOwnProperty']('nolimit')){_0x2490e9['limit']=qs['limit'](_0x42c04a[_0x5eea('0x31')][_0x5eea('0x1f')]);_0x2490e9[_0x5eea('0x1d')]=qs[_0x5eea('0x1d')](_0x42c04a['query'][_0x5eea('0x1d')]);}_0x2490e9[_0x5eea('0x38')]=qs[_0x5eea('0x39')](_0x42c04a['query'][_0x5eea('0x39')]);_0x2490e9[_0x5eea('0x3a')]=qs[_0x5eea('0x33')](_[_0x5eea('0x3b')](_0x42c04a[_0x5eea('0x31')],_0x2e307e[_0x5eea('0x33')]),_0x518f44);if(_0x42c04a[_0x5eea('0x31')][_0x5eea('0x3c')]){_0x2490e9['where']=_[_0x5eea('0x3d')](_0x2490e9['where'],{'$or':_[_0x5eea('0x3e')](_0x518f44,function(_0xa21ae5){if(_0xa21ae5['type']!=='VIRTUAL'){var _0x5db541={};_0x5db541[_0xa21ae5[_0x5eea('0x2a')]]={'$like':'%'+_0x42c04a[_0x5eea('0x31')]['filter']+'%'};return _0x5db541;}})});}_0x2490e9=_[_0x5eea('0x3d')]({},_0x2490e9,_0x42c04a[_0x5eea('0x3f')]);var _0x571557={'where':_0x2490e9[_0x5eea('0x3a')]};return db[_0x5eea('0x2d')][_0x5eea('0x40')](_0x571557)[_0x5eea('0x26')](function(_0x514fd4){_0xeed37a['count']=_0x514fd4;if(_0x42c04a[_0x5eea('0x31')][_0x5eea('0x41')]){_0x2490e9['include']=[{'all':!![]}];}return db[_0x5eea('0x2d')][_0x5eea('0x42')](_0x2490e9);})['then'](function(_0x39d579){_0xeed37a['rows']=_0x39d579;return _0xeed37a;})[_0x5eea('0x26')](respondWithFilteredResult(_0x310490,_0x2490e9))[_0x5eea('0x43')](handleError(_0x310490,null));};exports['show']=function(_0x86be70,_0x51f718){var _0x30705c={'raw':!![],'where':{'id':_0x86be70[_0x5eea('0x44')]['id']}},_0x379b14={};_0x379b14[_0x5eea('0x30')]=_[_0x5eea('0x32')](db[_0x5eea('0x2d')][_0x5eea('0x45')]);_0x379b14[_0x5eea('0x31')]=_[_0x5eea('0x32')](_0x86be70[_0x5eea('0x31')]);_0x379b14[_0x5eea('0x33')]=_[_0x5eea('0x34')](_0x379b14[_0x5eea('0x30')],_0x379b14[_0x5eea('0x31')]);_0x30705c['attributes']=_['intersection'](_0x379b14[_0x5eea('0x30')],qs[_0x5eea('0x36')](_0x86be70[_0x5eea('0x31')][_0x5eea('0x36')]));_0x30705c[_0x5eea('0x35')]=_0x30705c[_0x5eea('0x35')]['length']?_0x30705c[_0x5eea('0x35')]:_0x379b14[_0x5eea('0x30')];if(_0x86be70[_0x5eea('0x31')][_0x5eea('0x41')]){_0x30705c[_0x5eea('0x46')]=[{'all':!![]}];}_0x30705c=_['merge']({},_0x30705c,_0x86be70[_0x5eea('0x3f')]);return db['FaxApplication'][_0x5eea('0x47')](_0x30705c)['then'](handleEntityNotFound(_0x51f718,null))['then'](respondWithResult(_0x51f718,null))[_0x5eea('0x43')](handleError(_0x51f718,null));};exports['create']=function(_0x20d41f,_0x338c9d){return db[_0x5eea('0x2d')][_0x5eea('0x48')](_0x20d41f[_0x5eea('0x49')],{})[_0x5eea('0x26')](respondWithResult(_0x338c9d,0xc9))[_0x5eea('0x43')](handleError(_0x338c9d,null));};exports[_0x5eea('0x25')]=function(_0x549f48,_0x31651c){if(_0x549f48[_0x5eea('0x49')]['id']){delete _0x549f48[_0x5eea('0x49')]['id'];}return db[_0x5eea('0x2d')][_0x5eea('0x47')]({'where':{'id':_0x549f48[_0x5eea('0x44')]['id']}})[_0x5eea('0x26')](handleEntityNotFound(_0x31651c,null))[_0x5eea('0x26')](saveUpdates(_0x549f48[_0x5eea('0x49')],null))[_0x5eea('0x26')](respondWithResult(_0x31651c,null))[_0x5eea('0x43')](handleError(_0x31651c,null));};exports[_0x5eea('0x4a')]=function(_0x5a7623,_0x162ef2){return db['FaxApplication']['find']({'where':{'id':_0x5a7623[_0x5eea('0x44')]['id']}})[_0x5eea('0x26')](handleEntityNotFound(_0x162ef2,null))['then'](removeEntity(_0x162ef2,null))['catch'](handleError(_0x162ef2,null));};
\ No newline at end of file
+var _0x08fc=['VIRTUAL','options','include','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','stack','name','send','index','FaxApplication','rawAttributes','fieldName','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','type'];(function(_0x217c95,_0x5832de){var _0x2cc5c8=function(_0x513d22){while(--_0x513d22){_0x217c95['push'](_0x217c95['shift']());}};_0x2cc5c8(++_0x5832de);}(_0x08fc,0x9a));var _0xc08f=function(_0x53afa6,_0x59e786){_0x53afa6=_0x53afa6-0x0;var _0x51f86a=_0x08fc[_0x53afa6];return _0x51f86a;};'use strict';var emlformat=require(_0xc08f('0x0'));var rimraf=require(_0xc08f('0x1'));var zipdir=require(_0xc08f('0x2'));var jsonpatch=require(_0xc08f('0x3'));var rp=require(_0xc08f('0x4'));var moment=require(_0xc08f('0x5'));var BPromise=require(_0xc08f('0x6'));var Mustache=require('mustache');var util=require(_0xc08f('0x7'));var path=require(_0xc08f('0x8'));var sox=require(_0xc08f('0x9'));var csv=require(_0xc08f('0xa'));var ejs=require(_0xc08f('0xb'));var fs=require('fs');var fs_extra=require(_0xc08f('0xc'));var _=require(_0xc08f('0xd'));var squel=require(_0xc08f('0xe'));var crypto=require(_0xc08f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xc08f('0x10'));var toCsv=require(_0xc08f('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc08f('0x11'));var qs=require(_0xc08f('0x12'));var as=require(_0xc08f('0x13'));var hardwareService=require(_0xc08f('0x14'));var logger=require(_0xc08f('0x15'))(_0xc08f('0x16'));var utils=require(_0xc08f('0x17'));var config=require(_0xc08f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302140,_0x34681b){_0x34681b=_0x34681b||0xcc;return function(_0x46a221){if(_0x46a221){return _0x302140[_0xc08f('0x19')](_0x34681b);}return _0x302140[_0xc08f('0x1a')](_0x34681b)[_0xc08f('0x1b')]();};}function respondWithResult(_0x118df2,_0xc3e6c3){_0xc3e6c3=_0xc3e6c3||0xc8;return function(_0x31ce93){if(_0x31ce93){return _0x118df2['status'](_0xc3e6c3)[_0xc08f('0x1c')](_0x31ce93);}};}function respondWithFilteredResult(_0x38b0d7,_0x14771b){return function(_0x50e680){if(_0x50e680){var _0x355855=typeof _0x14771b[_0xc08f('0x1d')]===_0xc08f('0x1e')&&typeof _0x14771b[_0xc08f('0x1f')]===_0xc08f('0x1e');var _0x1269ed=_0x50e680[_0xc08f('0x20')];var _0x1653fe=_0x355855?0x0:_0x14771b[_0xc08f('0x1d')];var _0x10644a=_0x355855?_0x50e680[_0xc08f('0x20')]:_0x14771b[_0xc08f('0x1d')]+_0x14771b[_0xc08f('0x1f')];var _0x152a4b;if(_0x10644a>=_0x1269ed){_0x10644a=_0x1269ed;_0x152a4b=0xc8;}else{_0x152a4b=0xce;}_0x38b0d7[_0xc08f('0x1a')](_0x152a4b);return _0x38b0d7[_0xc08f('0x21')]('Content-Range',_0x1653fe+'-'+_0x10644a+'/'+_0x1269ed)[_0xc08f('0x1c')](_0x50e680);}return null;};}function patchUpdates(_0x226130){return function(_0x89f9f){try{jsonpatch[_0xc08f('0x22')](_0x89f9f,_0x226130,!![]);}catch(_0x2aba1d){return BPromise[_0xc08f('0x23')](_0x2aba1d);}return _0x89f9f['save']();};}function saveUpdates(_0x3dee9a,_0x270296){return function(_0x2725b0){if(_0x2725b0){return _0x2725b0[_0xc08f('0x24')](_0x3dee9a)[_0xc08f('0x25')](function(_0x540ff7){return _0x540ff7;});}return null;};}function removeEntity(_0x471cca,_0x252b92){return function(_0x1ed56b){if(_0x1ed56b){return _0x1ed56b[_0xc08f('0x26')]()[_0xc08f('0x25')](function(){_0x471cca[_0xc08f('0x1a')](0xcc)[_0xc08f('0x1b')]();});}};}function handleEntityNotFound(_0x3aa21a,_0x1838da){return function(_0x20441a){if(!_0x20441a){_0x3aa21a[_0xc08f('0x19')](0x194);}return _0x20441a;};}function handleError(_0xd638da,_0x231bc7){_0x231bc7=_0x231bc7||0x1f4;return function(_0x30f891){logger['error'](_0x30f891[_0xc08f('0x27')]);if(_0x30f891[_0xc08f('0x28')]){delete _0x30f891['name'];}_0xd638da[_0xc08f('0x1a')](_0x231bc7)[_0xc08f('0x29')](_0x30f891);};}exports[_0xc08f('0x2a')]=function(_0x4be52c,_0x2ced28){var _0x236dc7={},_0x379bda={},_0x47b958={'count':0x0,'rows':[]};var _0x466c32=_['map'](db[_0xc08f('0x2b')][_0xc08f('0x2c')],function(_0x1670c6){return{'name':_0x1670c6[_0xc08f('0x2d')],'type':_0x1670c6['type']['key']};});_0x379bda['model']=_['map'](_0x466c32,_0xc08f('0x28'));_0x379bda[_0xc08f('0x2e')]=_[_0xc08f('0x2f')](_0x4be52c[_0xc08f('0x2e')]);_0x379bda['filters']=_[_0xc08f('0x30')](_0x379bda[_0xc08f('0x31')],_0x379bda[_0xc08f('0x2e')]);_0x236dc7[_0xc08f('0x32')]=_[_0xc08f('0x30')](_0x379bda[_0xc08f('0x31')],qs[_0xc08f('0x33')](_0x4be52c[_0xc08f('0x2e')][_0xc08f('0x33')]));_0x236dc7[_0xc08f('0x32')]=_0x236dc7['attributes']['length']?_0x236dc7[_0xc08f('0x32')]:_0x379bda[_0xc08f('0x31')];if(!_0x4be52c['query'][_0xc08f('0x34')](_0xc08f('0x35'))){_0x236dc7['limit']=qs[_0xc08f('0x1f')](_0x4be52c[_0xc08f('0x2e')][_0xc08f('0x1f')]);_0x236dc7[_0xc08f('0x1d')]=qs['offset'](_0x4be52c['query'][_0xc08f('0x1d')]);}_0x236dc7['order']=qs[_0xc08f('0x36')](_0x4be52c['query']['sort']);_0x236dc7['where']=qs[_0xc08f('0x37')](_[_0xc08f('0x38')](_0x4be52c[_0xc08f('0x2e')],_0x379bda['filters']),_0x466c32);if(_0x4be52c[_0xc08f('0x2e')][_0xc08f('0x39')]){_0x236dc7[_0xc08f('0x3a')]=_[_0xc08f('0x3b')](_0x236dc7[_0xc08f('0x3a')],{'$or':_[_0xc08f('0x3c')](_0x466c32,function(_0x586658){if(_0x586658[_0xc08f('0x3d')]!==_0xc08f('0x3e')){var _0x30a66a={};_0x30a66a[_0x586658['name']]={'$like':'%'+_0x4be52c[_0xc08f('0x2e')][_0xc08f('0x39')]+'%'};return _0x30a66a;}})});}_0x236dc7=_[_0xc08f('0x3b')]({},_0x236dc7,_0x4be52c[_0xc08f('0x3f')]);var _0x227dd3={'where':_0x236dc7[_0xc08f('0x3a')]};return db['FaxApplication'][_0xc08f('0x20')](_0x227dd3)[_0xc08f('0x25')](function(_0x263077){_0x47b958[_0xc08f('0x20')]=_0x263077;if(_0x4be52c[_0xc08f('0x2e')]['includeAll']){_0x236dc7[_0xc08f('0x40')]=[{'all':!![]}];}return db[_0xc08f('0x2b')]['findAll'](_0x236dc7);})['then'](function(_0x40edbc){_0x47b958[_0xc08f('0x41')]=_0x40edbc;return _0x47b958;})['then'](respondWithFilteredResult(_0x2ced28,_0x236dc7))[_0xc08f('0x42')](handleError(_0x2ced28,null));};exports['show']=function(_0x1b509d,_0x2bc7a6){var _0x564564={'raw':!![],'where':{'id':_0x1b509d[_0xc08f('0x43')]['id']}},_0x2ef125={};_0x2ef125['model']=_[_0xc08f('0x2f')](db[_0xc08f('0x2b')][_0xc08f('0x2c')]);_0x2ef125['query']=_[_0xc08f('0x2f')](_0x1b509d[_0xc08f('0x2e')]);_0x2ef125[_0xc08f('0x37')]=_[_0xc08f('0x30')](_0x2ef125[_0xc08f('0x31')],_0x2ef125[_0xc08f('0x2e')]);_0x564564[_0xc08f('0x32')]=_[_0xc08f('0x30')](_0x2ef125[_0xc08f('0x31')],qs[_0xc08f('0x33')](_0x1b509d['query']['fields']));_0x564564[_0xc08f('0x32')]=_0x564564[_0xc08f('0x32')][_0xc08f('0x44')]?_0x564564[_0xc08f('0x32')]:_0x2ef125[_0xc08f('0x31')];if(_0x1b509d[_0xc08f('0x2e')]['includeAll']){_0x564564[_0xc08f('0x40')]=[{'all':!![]}];}_0x564564=_[_0xc08f('0x3b')]({},_0x564564,_0x1b509d['options']);return db['FaxApplication'][_0xc08f('0x45')](_0x564564)[_0xc08f('0x25')](handleEntityNotFound(_0x2bc7a6,null))[_0xc08f('0x25')](respondWithResult(_0x2bc7a6,null))[_0xc08f('0x42')](handleError(_0x2bc7a6,null));};exports[_0xc08f('0x46')]=function(_0x4ba725,_0x31c1f8){return db['FaxApplication'][_0xc08f('0x46')](_0x4ba725['body'],{})[_0xc08f('0x25')](respondWithResult(_0x31c1f8,0xc9))[_0xc08f('0x42')](handleError(_0x31c1f8,null));};exports[_0xc08f('0x24')]=function(_0x34e06e,_0x3fc4e1){if(_0x34e06e[_0xc08f('0x47')]['id']){delete _0x34e06e[_0xc08f('0x47')]['id'];}return db['FaxApplication'][_0xc08f('0x45')]({'where':{'id':_0x34e06e[_0xc08f('0x43')]['id']}})[_0xc08f('0x25')](handleEntityNotFound(_0x3fc4e1,null))[_0xc08f('0x25')](saveUpdates(_0x34e06e['body'],null))[_0xc08f('0x25')](respondWithResult(_0x3fc4e1,null))[_0xc08f('0x42')](handleError(_0x3fc4e1,null));};exports[_0xc08f('0x26')]=function(_0x1bb655,_0x1a2b6f){return db['FaxApplication'][_0xc08f('0x45')]({'where':{'id':_0x1bb655['params']['id']}})[_0xc08f('0x25')](handleEntityNotFound(_0x1a2b6f,null))['then'](removeEntity(_0x1a2b6f,null))[_0xc08f('0x42')](handleError(_0x1a2b6f,null));};
\ No newline at end of file
index 1c27535..0734cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8df8=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8df8,0x19a));var _0x88df=function(_0x5e509a,_0xaf5ac4){_0x5e509a=_0x5e509a-0x0;var _0x1b33ad=_0x8df8[_0x5e509a];return _0x1b33ad;};'use strict';var _=require('lodash');var util=require(_0x88df('0x0'));var logger=require(_0x88df('0x1'))('api');var moment=require(_0x88df('0x2'));var BPromise=require(_0x88df('0x3'));var rp=require(_0x88df('0x4'));var fs=require('fs');var path=require(_0x88df('0x5'));var rimraf=require('rimraf');var config=require(_0x88df('0x6'));var attributes=require(_0x88df('0x7'));module[_0x88df('0x8')]=function(_0x2f4a6f,_0x55eb32){return _0x2f4a6f[_0x88df('0x9')](_0x88df('0xa'),attributes,{'tableName':_0x88df('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x88df('0xc')});};
\ No newline at end of file
+var _0x1765=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','define','FaxApplication'];(function(_0x1280b4,_0xd6a4cf){var _0x5dda69=function(_0x130fda){while(--_0x130fda){_0x1280b4['push'](_0x1280b4['shift']());}};_0x5dda69(++_0xd6a4cf);}(_0x1765,0xec));var _0x5176=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x1765[_0x1139d0];return _0xcc01a6;};'use strict';var _=require(_0x5176('0x0'));var util=require(_0x5176('0x1'));var logger=require(_0x5176('0x2'))('api');var moment=require(_0x5176('0x3'));var BPromise=require(_0x5176('0x4'));var rp=require(_0x5176('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5176('0x6'));var config=require(_0x5176('0x7'));var attributes=require(_0x5176('0x8'));module['exports']=function(_0x40d067,_0x43da2b){return _0x40d067[_0x5176('0x9')](_0x5176('0xa'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5176('0xb'),'collate':_0x5176('0xc')});};
\ No newline at end of file
index 166b836..4ad990d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd05=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','attributes','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4329b6,_0x995f74){var _0x25cbe6=function(_0x460a5f){while(--_0x460a5f){_0x4329b6['push'](_0x4329b6['shift']());}};_0x25cbe6(++_0x995f74);}(_0xdd05,0xcb));var _0x5dd0=function(_0x4d1ce8,_0x1a778e){_0x4d1ce8=_0x4d1ce8-0x0;var _0x129384=_0xdd05[_0x4d1ce8];return _0x129384;};'use strict';var _=require(_0x5dd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5dd0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dd0('0x2'));var db=require(_0x5dd0('0x3'))['db'];var utils=require(_0x5dd0('0x4'));var logger=require(_0x5dd0('0x5'))(_0x5dd0('0x6'));var config=require(_0x5dd0('0x7'));var jayson=require(_0x5dd0('0x8'));var client=jayson[_0x5dd0('0x9')][_0x5dd0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575d4b,_0x250920,_0x4a666d){return new BPromise(function(_0x2ec8e1,_0x302fdc){return client[_0x5dd0('0xb')](_0x575d4b,_0x4a666d)[_0x5dd0('0xc')](function(_0x53a540){logger[_0x5dd0('0xd')](_0x5dd0('0xe'),_0x250920,_0x5dd0('0xf'));logger['debug'](_0x5dd0('0x10'),_0x250920,_0x5dd0('0xf'),JSON[_0x5dd0('0x11')](_0x53a540));if(_0x53a540[_0x5dd0('0x12')]){if(_0x53a540[_0x5dd0('0x12')]['code']===0x1f4){logger[_0x5dd0('0x12')](_0x5dd0('0xe'),_0x250920,_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);return _0x302fdc(_0x53a540[_0x5dd0('0x12')]['message']);}logger['error'](_0x5dd0('0xe'),_0x250920,_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);return _0x2ec8e1(_0x53a540[_0x5dd0('0x12')][_0x5dd0('0x13')]);}else{logger[_0x5dd0('0xd')](_0x5dd0('0xe'),_0x250920,_0x5dd0('0xf'));_0x2ec8e1(_0x53a540[_0x5dd0('0x14')][_0x5dd0('0x13')]);}})[_0x5dd0('0x15')](function(_0x2eed58){logger[_0x5dd0('0x12')]('FaxApplication,\x20%s,\x20%s',_0x250920,_0x2eed58);_0x302fdc(_0x2eed58);});});}exports[_0x5dd0('0x16')]=function(_0x76343a){var _0x37db81=this;return new Promise(function(_0x50420c,_0x4579db){return db[_0x5dd0('0x17')]['update'](_0x76343a['body'],{'raw':_0x76343a[_0x5dd0('0x18')]?_0x76343a['options'][_0x5dd0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x76343a['options']?_0x76343a['options']['where']||null:null,'attributes':_0x76343a[_0x5dd0('0x18')]?_0x76343a[_0x5dd0('0x18')][_0x5dd0('0x1a')]||null:null,'limit':_0x76343a[_0x5dd0('0x18')]?_0x76343a[_0x5dd0('0x18')]['limit']||null:null})[_0x5dd0('0xc')](function(_0xf8725f){logger['info'](_0x5dd0('0x16'),_0x76343a);logger['debug'](_0x5dd0('0x16'),_0x76343a,JSON['stringify'](_0xf8725f));_0x50420c(_0xf8725f);})['catch'](function(_0x4e76bd){logger[_0x5dd0('0x12')](_0x5dd0('0x16'),_0x4e76bd[_0x5dd0('0x13')],_0x76343a);_0x4579db(_0x37db81[_0x5dd0('0x12')](0x1f4,_0x4e76bd[_0x5dd0('0x13')]));});});};
\ No newline at end of file
+var _0x23a6=['UpdateFaxApplication','update','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x1ab9f4,_0x14f8cc){var _0x573210=function(_0x4fbd68){while(--_0x4fbd68){_0x1ab9f4['push'](_0x1ab9f4['shift']());}};_0x573210(++_0x14f8cc);}(_0x23a6,0xff));var _0x623a=function(_0x3dc05c,_0x192932){_0x3dc05c=_0x3dc05c-0x0;var _0x1465e4=_0x23a6[_0x3dc05c];return _0x1465e4;};'use strict';var _=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var moment=require(_0x623a('0x2'));var BPromise=require(_0x623a('0x3'));var rs=require(_0x623a('0x4'));var fs=require('fs');var Redis=require(_0x623a('0x5'));var db=require(_0x623a('0x6'))['db'];var utils=require(_0x623a('0x7'));var logger=require(_0x623a('0x8'))(_0x623a('0x9'));var config=require(_0x623a('0xa'));var jayson=require(_0x623a('0xb'));var client=jayson[_0x623a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26262d,_0x3d4b4c,_0x341054){return new BPromise(function(_0x16debb,_0x5969ad){return client[_0x623a('0xd')](_0x26262d,_0x341054)[_0x623a('0xe')](function(_0x16b000){logger['info'](_0x623a('0xf'),_0x3d4b4c,_0x623a('0x10'));logger[_0x623a('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3d4b4c,'request\x20sent',JSON[_0x623a('0x12')](_0x16b000));if(_0x16b000[_0x623a('0x13')]){if(_0x16b000[_0x623a('0x13')]['code']===0x1f4){logger[_0x623a('0x13')](_0x623a('0xf'),_0x3d4b4c,_0x16b000[_0x623a('0x13')]['message']);return _0x5969ad(_0x16b000[_0x623a('0x13')][_0x623a('0x14')]);}logger['error'](_0x623a('0xf'),_0x3d4b4c,_0x16b000['error'][_0x623a('0x14')]);return _0x16debb(_0x16b000[_0x623a('0x13')][_0x623a('0x14')]);}else{logger[_0x623a('0x15')](_0x623a('0xf'),_0x3d4b4c,'request\x20sent');_0x16debb(_0x16b000[_0x623a('0x16')][_0x623a('0x14')]);}})[_0x623a('0x17')](function(_0x173da0){logger[_0x623a('0x13')](_0x623a('0xf'),_0x3d4b4c,_0x173da0);_0x5969ad(_0x173da0);});});}exports[_0x623a('0x18')]=function(_0x209ee0){var _0x20245a=this;return new Promise(function(_0x554d2e,_0x48a366){return db['FaxApplication'][_0x623a('0x19')](_0x209ee0['body'],{'raw':_0x209ee0[_0x623a('0x1a')]?_0x209ee0['options'][_0x623a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209ee0[_0x623a('0x1a')]?_0x209ee0[_0x623a('0x1a')][_0x623a('0x1c')]||null:null,'attributes':_0x209ee0[_0x623a('0x1a')]?_0x209ee0[_0x623a('0x1a')][_0x623a('0x1d')]||null:null,'limit':_0x209ee0[_0x623a('0x1a')]?_0x209ee0[_0x623a('0x1a')][_0x623a('0x1e')]||null:null})[_0x623a('0xe')](function(_0x450c6e){logger[_0x623a('0x15')](_0x623a('0x18'),_0x209ee0);logger[_0x623a('0x11')](_0x623a('0x18'),_0x209ee0,JSON[_0x623a('0x12')](_0x450c6e));_0x554d2e(_0x450c6e);})[_0x623a('0x17')](function(_0x15f560){logger[_0x623a('0x13')](_0x623a('0x18'),_0x15f560[_0x623a('0x14')],_0x209ee0);_0x48a366(_0x20245a[_0x623a('0x13')](0x1f4,_0x15f560['message']));});});};
\ No newline at end of file
index 058f0c5..25c282f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x47eb27,_0x22d4fc){var _0xe8cae8=function(_0x2fd189){while(--_0x2fd189){_0x47eb27['push'](_0x47eb27['shift']());}};_0xe8cae8(++_0x22d4fc);}(_0x2032,0xd9));var _0x2203=function(_0x10e5fb,_0x380dc7){_0x10e5fb=_0x10e5fb-0x0;var _0x1a2d3e=_0x2032[_0x10e5fb];return _0x1a2d3e;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router;
\ No newline at end of file
+var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x10ffa3,_0x536569){var _0x309948=function(_0x2f952a){while(--_0x2f952a){_0x10ffa3['push'](_0x10ffa3['shift']());}};_0x309948(++_0x536569);}(_0xac4a,0x13f));var _0xaac4=function(_0x4e24dd,_0x382e6d){_0x4e24dd=_0x4e24dd-0x0;var _0x5a0c2c=_0xac4a[_0x4e24dd];return _0x5a0c2c;};'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['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router;
\ No newline at end of file
index c949962..a6abbc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3be0=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x209a3e,_0x139a0b){var _0x59d268=function(_0x42849c){while(--_0x42849c){_0x209a3e['push'](_0x209a3e['shift']());}};_0x59d268(++_0x139a0b);}(_0x3be0,0x136));var _0x03be=function(_0x47d7ec,_0x17f197){_0x47d7ec=_0x47d7ec-0x0;var _0x98674a=_0x3be0[_0x47d7ec];return _0x98674a;};'use strict';var Sequelize=require(_0x03be('0x0'));module[_0x03be('0x1')]={'closed':{'type':Sequelize[_0x03be('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x03be('0x3')]},'disposition':{'type':Sequelize[_0x03be('0x4')]},'secondDisposition':{'type':Sequelize[_0x03be('0x4')]},'thirdDisposition':{'type':Sequelize[_0x03be('0x4')]},'note':{'type':Sequelize[_0x03be('0x4')]},'read1stAt':{'type':Sequelize[_0x03be('0x3')]},'fax':{'type':Sequelize[_0x03be('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x03be('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x03be('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x03be('0x5')]('in',_0x03be('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xd179=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3ca675,_0x467e81){var _0x150ea3=function(_0xdb8371){while(--_0xdb8371){_0x3ca675['push'](_0x3ca675['shift']());}};_0x150ea3(++_0x467e81);}(_0xd179,0x16b));var _0x9d17=function(_0x4cbf20,_0x1bfa66){_0x4cbf20=_0x4cbf20-0x0;var _0x582ae4=_0xd179[_0x4cbf20];return _0x582ae4;};'use strict';var Sequelize=require(_0x9d17('0x0'));module[_0x9d17('0x1')]={'closed':{'type':Sequelize[_0x9d17('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9d17('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9d17('0x4')]},'note':{'type':Sequelize[_0x9d17('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x9d17('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9d17('0x5')]('in',_0x9d17('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9d17('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9d17('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 9152b60..a624a70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ef4=['send','fullname','TagIds','split','forEach','Tags','catch','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','createdAt','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','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','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','FaxAccountId','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','emit','faxInteractionTags:save','removeTags','download','unix','root','server','files','join','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','pipe','log','err','unlinkSync','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','json','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','end','error','stack','name'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x7ef4,0x179));var _0x47ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7ef4[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x47ef('0x0'));var rimraf=require(_0x47ef('0x1'));var zipdir=require(_0x47ef('0x2'));var jsonpatch=require(_0x47ef('0x3'));var rp=require(_0x47ef('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x47ef('0x5'));var path=require(_0x47ef('0x6'));var sox=require('sox');var csv=require(_0x47ef('0x7'));var ejs=require(_0x47ef('0x8'));var fs=require('fs');var fs_extra=require(_0x47ef('0x9'));var _=require(_0x47ef('0xa'));var squel=require(_0x47ef('0xb'));var crypto=require(_0x47ef('0xc'));var jsforce=require(_0x47ef('0xd'));var deskjs=require(_0x47ef('0xe'));var toCsv=require(_0x47ef('0x7'));var querystring=require(_0x47ef('0xf'));var Papa=require(_0x47ef('0x10'));var Redis=require(_0x47ef('0x11'));var authService=require(_0x47ef('0x12'));var qs=require(_0x47ef('0x13'));var as=require(_0x47ef('0x14'));var hardwareService=require(_0x47ef('0x15'));var logger=require(_0x47ef('0x16'))(_0x47ef('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x47ef('0x18'));var db=require(_0x47ef('0x19'))['db'];config[_0x47ef('0x1a')]=_['defaults'](config['redis'],{'host':_0x47ef('0x1b'),'port':0x18eb});var socket=require(_0x47ef('0x1c'))(new Redis(config[_0x47ef('0x1a')]));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x5cbe05,_0x24d684){_0x24d684=_0x24d684||0xcc;return function(_0x4325ca){if(_0x4325ca){return _0x5cbe05['sendStatus'](_0x24d684);}return _0x5cbe05['status'](_0x24d684)['end']();};}function respondWithResult(_0x205ff7,_0x19b1e1){_0x19b1e1=_0x19b1e1||0xc8;return function(_0x1d1381){if(_0x1d1381){return _0x205ff7['status'](_0x19b1e1)[_0x47ef('0x1d')](_0x1d1381);}};}function respondWithFilteredResult(_0x3b78ea,_0x178bfd){return function(_0x4eb7ee){if(_0x4eb7ee){var _0x4df94b=typeof _0x178bfd[_0x47ef('0x1e')]===_0x47ef('0x1f')&&typeof _0x178bfd[_0x47ef('0x20')]===_0x47ef('0x1f');var _0x299e4a=_0x4eb7ee[_0x47ef('0x21')];var _0x12bdf6=_0x4df94b?0x0:_0x178bfd[_0x47ef('0x1e')];var _0x89c25c=_0x4df94b?_0x4eb7ee[_0x47ef('0x21')]:_0x178bfd[_0x47ef('0x1e')]+_0x178bfd[_0x47ef('0x20')];var _0x4528d1;if(_0x89c25c>=_0x299e4a){_0x89c25c=_0x299e4a;_0x4528d1=0xc8;}else{_0x4528d1=0xce;}_0x3b78ea[_0x47ef('0x22')](_0x4528d1);return _0x3b78ea['set']('Content-Range',_0x12bdf6+'-'+_0x89c25c+'/'+_0x299e4a)['json'](_0x4eb7ee);}return null;};}function patchUpdates(_0x44991b){return function(_0x2d367c){try{jsonpatch[_0x47ef('0x23')](_0x2d367c,_0x44991b,!![]);}catch(_0x4f978a){return BPromise[_0x47ef('0x24')](_0x4f978a);}return _0x2d367c[_0x47ef('0x25')]();};}function saveUpdates(_0x574b5c,_0x3458c6){return function(_0x281b46){if(_0x281b46){return _0x281b46[_0x47ef('0x26')](_0x574b5c)[_0x47ef('0x27')](function(_0x22ded6){return _0x22ded6;});}return null;};}function removeEntity(_0x2bc96f,_0x286942){return function(_0x47eb36){if(_0x47eb36){return _0x47eb36[_0x47ef('0x28')]()[_0x47ef('0x27')](function(){_0x2bc96f['status'](0xcc)[_0x47ef('0x29')]();});}};}function handleEntityNotFound(_0x24acdd,_0x207988){return function(_0x1ab789){if(!_0x1ab789){_0x24acdd['sendStatus'](0x194);}return _0x1ab789;};}function handleError(_0x3d7fb4,_0x35a375){_0x35a375=_0x35a375||0x1f4;return function(_0x4e38b4){logger[_0x47ef('0x2a')](_0x4e38b4[_0x47ef('0x2b')]);if(_0x4e38b4[_0x47ef('0x2c')]){delete _0x4e38b4[_0x47ef('0x2c')];}_0x3d7fb4['status'](_0x35a375)[_0x47ef('0x2d')](_0x4e38b4);};}function getInteractionUsers(_0x580eb5,_0x48ce0e){return new BPromise(function(_0x4e783b,_0x56397b){try{if(_0x48ce0e[_0x580eb5['id']]){_0x580eb5['Users']=_['map'](_0x48ce0e[_0x580eb5['id']],function(_0x13eeb8){return{'id':_0x13eeb8['id'],'fullname':_0x13eeb8[_0x47ef('0x2e')]};});}}catch(_0x56ef3a){_0x56397b(_0x56ef3a);}_0x4e783b(_0x580eb5);});}function getInteractionTags(_0x264f4d,_0x5b2ca5){return new BPromise(function(_0x275626,_0x450e3b){try{if(_0x264f4d[_0x47ef('0x2f')]){_0x264f4d['Tags']=[];_0x264f4d[_0x47ef('0x2f')][_0x47ef('0x30')](',')[_0x47ef('0x31')](function(_0x79fcf2){_0x264f4d[_0x47ef('0x32')]['push'](_0x5b2ca5[_0x79fcf2]);});}delete _0x264f4d[_0x47ef('0x2f')];}catch(_0x2d4790){_0x450e3b(_0x2d4790);}_0x275626(_0x264f4d);});}function updateFaxInteraction(_0x49a46f,_0x17fbcc,_0x4592c1){return new BPromise(function(_0x156136,_0x21bf0d){return getInteractionUsers(_0x49a46f,_0x4592c1)[_0x47ef('0x27')](function(_0x5ad040){return getInteractionTags(_0x5ad040,_0x17fbcc);})[_0x47ef('0x27')](function(_0x5e2104){_0x156136(_0x5e2104);})[_0x47ef('0x33')](function(_0x2bd465){_0x21bf0d(_0x2bd465);});});}exports[_0x47ef('0x34')]=function(_0x53d151,_0x4022fb){var _0x35a505={},_0x1dc764={},_0x1f811a={'count':0x0,'rows':[]};var _0x2f15d0=_[_0x47ef('0x35')](db['FaxInteraction'][_0x47ef('0x36')],function(_0x5f3230){return{'name':_0x5f3230[_0x47ef('0x37')],'type':_0x5f3230[_0x47ef('0x38')]['key']};});_0x1dc764[_0x47ef('0x39')]=_[_0x47ef('0x35')](_0x2f15d0,_0x47ef('0x2c'));_0x1dc764[_0x47ef('0x3a')]=_[_0x47ef('0x3b')](_0x53d151[_0x47ef('0x3a')]);_0x1dc764[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x1dc764[_0x47ef('0x39')],_0x1dc764[_0x47ef('0x3a')]);_0x35a505[_0x47ef('0x3e')]=_['intersection'](_0x1dc764['model'],qs[_0x47ef('0x3f')](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x3f')]));_0x35a505['attributes']=_0x35a505[_0x47ef('0x3e')][_0x47ef('0x40')]?_0x35a505[_0x47ef('0x3e')]:_0x1dc764['model'];if(!_0x53d151[_0x47ef('0x3a')][_0x47ef('0x41')](_0x47ef('0x42'))){_0x35a505[_0x47ef('0x20')]=qs[_0x47ef('0x20')](_0x53d151['query'][_0x47ef('0x20')]);_0x35a505[_0x47ef('0x1e')]=qs['offset'](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x1e')]);}_0x35a505[_0x47ef('0x43')]=qs['sort'](_0x53d151['query'][_0x47ef('0x44')]);_0x35a505[_0x47ef('0x45')]=qs[_0x47ef('0x3c')](_[_0x47ef('0x46')](_0x53d151[_0x47ef('0x3a')],_0x1dc764[_0x47ef('0x3c')]),_0x2f15d0);var _0x3b520c=[];var _0x474563=squel[_0x47ef('0x47')]()[_0x47ef('0x48')]('id')[_0x47ef('0x48')]('name')[_0x47ef('0x48')](_0x47ef('0x49'))[_0x47ef('0x4a')](_0x47ef('0x4b'));var _0x1dbc71=squel['select']()[_0x47ef('0x48')](_0x47ef('0x4c'))[_0x47ef('0x48')](_0x47ef('0x4d'))[_0x47ef('0x48')](_0x47ef('0x4e'))['from'](_0x47ef('0x4f'),'ui')[_0x47ef('0x50')](_0x47ef('0x51'),'u',_0x47ef('0x52'));var _0x40fd34=squel[_0x47ef('0x47')]()[_0x47ef('0x4a')]('fax_interactions','i')[_0x47ef('0x50')](_0x47ef('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x47ef('0x51'),'o',_0x47ef('0x54'))[_0x47ef('0x50')](_0x47ef('0x55'),'a',_0x47ef('0x56'))[_0x47ef('0x50')]('fax_messages','me',_0x47ef('0x57'))['left_join'](_0x47ef('0x58'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x47ef('0x50')](_0x47ef('0x4b'),'t','t.id\x20=\x20it.TagId');var _0x230f64=squel[_0x47ef('0x59')]();var _0x587c20=[];var _0x43143f=squel['expr']();var _0x179bec;if(_0x53d151[_0x47ef('0x3a')][_0x47ef('0x5a')]){_0x179bec=as[_0x47ef('0x5b')](_0x53d151['query']['search']);var _0x27a910=_0x179bec[_0x47ef('0x5c')];for(var _0x1698fd=0x0;_0x1698fd<_0x179bec[_0x47ef('0x5d')][_0x47ef('0x40')];_0x1698fd++){var _0x1f98a4=_0x179bec[_0x47ef('0x5d')][_0x1698fd];var _0x548ec6='i';var _0x12a4f6=_['find'](_0x2f15d0,[_0x47ef('0x2c'),_0x1f98a4[_0x47ef('0x48')]]);if(!_0x12a4f6){switch(_0x1f98a4[_0x47ef('0x48')]){case _0x47ef('0x5e'):if(_0x1f98a4[_0x47ef('0x5f')]==0x1){_0x40fd34[_0x47ef('0x60')]('`'+_0x1f98a4[_0x47ef('0x48')]+_0x47ef('0x61'));}else{_0x40fd34[_0x47ef('0x60')]('`'+_0x1f98a4['field']+_0x47ef('0x62'));}break;case _0x47ef('0x63'):if(_0x1f98a4[_0x47ef('0x64')]===_0x47ef('0x65')){if(_0x1f98a4[_0x47ef('0x5f')][_0x47ef('0x30')]('\x20')[_0x47ef('0x40')]>0x1){_0x230f64[_0x27a910]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47ef('0x66')](_0x1f98a4['value']),null);}else{var _0x35e56e='%'+_0x1f98a4[_0x47ef('0x5f')]+'%';_0x230f64[_0x27a910](_0x47ef('0x67'),_0x35e56e,_0x35e56e,_0x35e56e);}}else{_0x12a4f6=_[_0x47ef('0x68')](_0x2f15d0,[_0x47ef('0x2c'),'ContactId']);_0x1f98a4[_0x47ef('0x48')]='ContactId';_0x14c33d=as['buildExpression'](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d[_0x47ef('0x69')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x6a')],_0x14c33d['value'][_0x47ef('0x29')]);}break;case _0x47ef('0x6b'):var _0x140435=_0x1f98a4[_0x47ef('0x5f')][_0x47ef('0x30')](',')[_0x47ef('0x35')](function(_0x204b97){return Number(_0x204b97);});_0x140435[_0x47ef('0x31')](function(_0x1e153f){_0x43143f['or'](_0x47ef('0x6c'),'%,'+_0x1e153f+',%');});_0x587c20=_[_0x47ef('0x6d')](_0x587c20,_0x140435);break;case _0x47ef('0x6e'):if(_0x1f98a4[_0x47ef('0x64')]==='$substring'){_0x230f64[_0x27a910](_0x47ef('0x6f'),'%'+_0x1f98a4[_0x47ef('0x5f')]+'%',null);}else{_0x12a4f6=_['find'](_0x2f15d0,[_0x47ef('0x2c'),_0x47ef('0x70')]);_0x1f98a4['field']=_0x47ef('0x70');_0x14c33d=as[_0x47ef('0x71')](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d[_0x47ef('0x69')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x29')]);}break;case _0x47ef('0x72'):_0x14c33d=as[_0x47ef('0x71')]('me',null,_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d['text'],_0x14c33d['value'][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')][_0x47ef('0x29')]);break;}}else{var _0x14c33d=as['buildExpression'](_0x548ec6,_0x12a4f6[_0x47ef('0x38')],_0x1f98a4);_0x230f64[_0x27a910](_0x14c33d['text'],_0x14c33d['value'][_0x47ef('0x6a')],_0x14c33d[_0x47ef('0x5f')]['end']);}}}else{var _0x1190a3=_(_0x53d151['query'])[_0x47ef('0x3b')]()[_0x47ef('0x35')](function(_0xb5659f){return _[_0x47ef('0x73')](_0x2f15d0,[_0x47ef('0x2c'),_0xb5659f])?_0xb5659f:undefined;})[_0x47ef('0x74')]()[_0x47ef('0x5f')]();if(!_[_0x47ef('0x75')](_0x1190a3)){_0x1190a3['forEach'](function(_0xc36192){if(_0xc36192==='FaxAccountId'){_0x40fd34[_0x47ef('0x45')](_0x47ef('0x76'),[]['concat'](_0x53d151[_0x47ef('0x3a')][_0xc36192]));}else if(_0xc36192===_0x47ef('0x77')){var _0x407085=JSON['parse'](_0x53d151['query'][_0xc36192])['$gte'];var _0x58671e=JSON['parse'](_0x53d151['query'][_0xc36192])['$lte'];_0x40fd34[_0x47ef('0x45')](_0x47ef('0x78'),_0x407085,_0x58671e);}else{if(_0x53d151[_0x47ef('0x3a')][_0xc36192]===_0x47ef('0x79')){_0x40fd34[_0x47ef('0x45')]('i.'+_0xc36192+'\x20IS\x20NULL');}else{_0x40fd34[_0x47ef('0x45')]('i.'+_0xc36192+_0x47ef('0x7a'),_0x53d151['query'][_0xc36192]);}}});}if(_0x53d151[_0x47ef('0x3a')]['read']){if(_0x53d151[_0x47ef('0x3a')]['read']==0x1){_0x40fd34[_0x47ef('0x60')]('`unreadMessages`\x20=\x200');}else{_0x40fd34[_0x47ef('0x60')](_0x47ef('0x7b'));}}if(_0x53d151[_0x47ef('0x3a')]['tag']){_0x587c20=_[_0x47ef('0x7c')](_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7d')])?_0x53d151['query'][_0x47ef('0x7d')]:new Array(_0x53d151['query'][_0x47ef('0x7d')]);_0x587c20['forEach'](function(_0x34713d){_0x43143f['or'](_0x47ef('0x6c'),'%,'+_0x34713d+',%');});}if(_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7e')]){var _0x202c8c=_0x53d151[_0x47ef('0x3a')][_0x47ef('0x7e')][_0x47ef('0x7f')]('\x5c','\x5c\x5c')[_0x47ef('0x7f')](/'/g,'\x27\x27');if(qs[_0x47ef('0x80')](_0x202c8c)){_0x230f64['or'](_0x47ef('0x81'),_0x202c8c+'%')['or'](_0x47ef('0x82'),_0x202c8c+'%');}_0x230f64['or'](_0x47ef('0x83'),_0x202c8c+'%');}}_0x40fd34[_0x47ef('0x45')](_0x230f64);_0x40fd34[_0x47ef('0x84')]('i.id');var _0x335466={'type':db[_0x47ef('0x85')][_0x47ef('0x86')][_0x47ef('0x87')],'raw':!![]};var _0x2c0357=_0x40fd34[_0x47ef('0x88')]();_0x2c0357[_0x47ef('0x48')]('i.id');_0x2c0357[_0x47ef('0x48')](_0x47ef('0x89'),_0x47ef('0x5e'));if(_0x35a505['order']){_0x35a505['order'][_0x47ef('0x31')](function(_0x11df04){var _0x692aa9=_0x11df04[0x0]===_0x47ef('0x8a')?_0x11df04[0x0]:'i.'+_0x11df04[0x0];_0x40fd34[_0x47ef('0x43')](_0x692aa9,_0x11df04[0x1]===_0x47ef('0x8b')?![]:!![]);});}if(!_[_0x47ef('0x75')](_0x587c20)){_0x40fd34[_0x47ef('0x60')](_0x43143f);_0x2c0357['where'](_0x47ef('0x8c'),_0x587c20);}BPromise[_0x47ef('0x8d')]()[_0x47ef('0x27')](function(){if(!_0x179bec){if(_0x53d151[_0x47ef('0x3a')]['FaxAccountId'])return;_0x2c0357[_0x47ef('0x45')](_0x47ef('0x8e'));_0x40fd34[_0x47ef('0x45')](_0x47ef('0x8e'));return;}if(_0x53d151[_0x47ef('0x8f')][_0x47ef('0x90')]!==_0x47ef('0x91'))return;return _0x53d151[_0x47ef('0x8f')][_0x47ef('0x92')]({'attributes':['id'],'raw':!![]})[_0x47ef('0x27')](function(_0x10960c){if(_[_0x47ef('0x75')](_0x10960c)){_0x2c0357[_0x47ef('0x45')](_0x47ef('0x93'));_0x40fd34[_0x47ef('0x45')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x2c0357[_0x47ef('0x45')](_0x47ef('0x76'),_[_0x47ef('0x35')](_0x10960c,'id'));_0x40fd34[_0x47ef('0x45')](_0x47ef('0x76'),_[_0x47ef('0x35')](_0x10960c,'id'));}});})['then'](function(){if(_0x53d151[_0x47ef('0x8f')]['role']===_0x47ef('0x91')&&!_0x179bec&&!_0x53d151['query'][_0x47ef('0x94')])return[];return db[_0x47ef('0x95')][_0x47ef('0x3a')](_0x2c0357[_0x47ef('0x96')](),_0x335466);})[_0x47ef('0x27')](function(_0x94c48c){_0x1f811a[_0x47ef('0x21')]=_0x94c48c[_0x47ef('0x40')];if(_0x1f811a['count']===0x0)return[];return db[_0x47ef('0x95')]['query'](_0x474563[_0x47ef('0x96')](),_0x335466)[_0x47ef('0x27')](function(_0x268b3b){_0x3b520c=_[_0x47ef('0x97')](_0x268b3b,'id');_0x335466=_[_0x47ef('0x98')](_0x335466,{'model':db[_0x47ef('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53d151['query'][_0x47ef('0x3f')]){_0x35a505[_0x47ef('0x3e')]['forEach'](function(_0x4585d9){_0x40fd34[_0x47ef('0x48')]('i.'+_0x4585d9);});}else{_0x40fd34[_0x47ef('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47ef('0x5e'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0x9a'),_0x47ef('0x9b'));_0x40fd34['field'](_0x47ef('0x9c'),_0x47ef('0x9d'));_0x40fd34[_0x47ef('0x48')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x47ef('0x8a'));_0x40fd34[_0x47ef('0x48')]('i.*');_0x40fd34[_0x47ef('0x48')](_0x47ef('0x9e'),_0x47ef('0x9f'));_0x40fd34['field'](_0x47ef('0xa0'),'Contact.lastName');_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa1'),_0x47ef('0xa2'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa3'),'Contact.phone');_0x40fd34[_0x47ef('0x48')]('c.mobile','Contact.mobile');_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa4'),_0x47ef('0xa5'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa6'),_0x47ef('0xa7'));_0x40fd34[_0x47ef('0x48')](_0x47ef('0xa8'),'Owner.internal');_0x40fd34[_0x47ef('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x47ef('0x2f'));}if(_0x35a505[_0x47ef('0x20')])_0x40fd34[_0x47ef('0x20')](_0x35a505[_0x47ef('0x20')]);if(_0x35a505[_0x47ef('0x1e')])_0x40fd34[_0x47ef('0x1e')](_0x35a505[_0x47ef('0x1e')]);return db['sequelize'][_0x47ef('0x3a')](_0x40fd34[_0x47ef('0x96')](),_0x335466);})[_0x47ef('0x27')](function(_0xe90d89){if(_0xe90d89[_0x47ef('0x40')]>0x0)_0x1dbc71[_0x47ef('0x45')](_0x47ef('0xa9'),_[_0x47ef('0x35')](_0xe90d89,'id'));return db['sequelize']['query'](_0x1dbc71[_0x47ef('0x96')](),_0x335466)[_0x47ef('0x27')](function(_0x2954b9){var _0x57ed79=_[_0x47ef('0xaa')](_0x2954b9,'FaxInteractionId');var _0x460b15=[];_0xe90d89[_0x47ef('0x31')](function(_0x1ab1f1){_0x460b15[_0x47ef('0xab')](updateFaxInteraction(_0x1ab1f1,_0x3b520c,_0x57ed79));});return BPromise[_0x47ef('0xac')](_0x460b15);});});})[_0x47ef('0x27')](function(_0x5269b9){_0x1f811a[_0x47ef('0xad')]=_0x5269b9;return _0x1f811a;})['then'](respondWithFilteredResult(_0x4022fb,_0x35a505))[_0x47ef('0x33')](handleError(_0x4022fb,null));};exports[_0x47ef('0xae')]=function(_0x5e4baf,_0x3d0edd){var _0x851623={'raw':![],'where':{'id':_0x5e4baf[_0x47ef('0xaf')]['id']}},_0x41687e={};_0x41687e[_0x47ef('0x39')]=_[_0x47ef('0x3b')](db[_0x47ef('0x99')][_0x47ef('0x36')]);_0x41687e['query']=_[_0x47ef('0x3b')](_0x5e4baf[_0x47ef('0x3a')]);_0x41687e[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x41687e[_0x47ef('0x39')],_0x41687e['query']);_0x851623[_0x47ef('0x3e')]=_['intersection'](_0x41687e[_0x47ef('0x39')],qs[_0x47ef('0x3f')](_0x5e4baf['query']['fields']));_0x851623[_0x47ef('0x3e')]=_0x851623[_0x47ef('0x3e')]['length']?_0x851623['attributes']:_0x41687e[_0x47ef('0x39')];if(_0x5e4baf[_0x47ef('0x3a')][_0x47ef('0xb0')]){_0x851623[_0x47ef('0xb1')]=[{'all':!![]}];}_0x851623=_[_0x47ef('0x98')]({},_0x851623,_0x5e4baf[_0x47ef('0xb2')]);return db[_0x47ef('0x99')][_0x47ef('0x68')](_0x851623)[_0x47ef('0x27')](handleEntityNotFound(_0x3d0edd,null))[_0x47ef('0x27')](respondWithResult(_0x3d0edd,null))[_0x47ef('0x33')](handleError(_0x3d0edd,null));};exports[_0x47ef('0xb3')]=function(_0x5cbaa2,_0xd1026f){return db[_0x47ef('0x99')][_0x47ef('0xb3')](_0x5cbaa2['body'],{})['then'](respondWithResult(_0xd1026f,0xc9))['catch'](handleError(_0xd1026f,null));};exports['update']=function(_0x33cd19,_0x5c71eb){if(_0x33cd19[_0x47ef('0x72')]['id']){delete _0x33cd19[_0x47ef('0x72')]['id'];}return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x33cd19[_0x47ef('0xaf')]['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x5c71eb,null))[_0x47ef('0x27')](saveUpdates(_0x33cd19[_0x47ef('0x72')],null))['then'](respondWithResult(_0x5c71eb,null))['catch'](handleError(_0x5c71eb,null));};exports[_0x47ef('0x28')]=function(_0x1a103d,_0x1863c0){return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x1a103d[_0x47ef('0xaf')]['id']}})['then'](handleEntityNotFound(_0x1863c0,null))[_0x47ef('0x27')](removeEntity(_0x1863c0,null))[_0x47ef('0x33')](handleError(_0x1863c0,null));};exports[_0x47ef('0xb4')]=function(_0x44c733,_0x46c4f1){return db[_0x47ef('0x99')][_0x47ef('0xb4')]()[_0x47ef('0x27')](respondWithResult(_0x46c4f1,null))[_0x47ef('0x33')](handleError(_0x46c4f1,null));};exports[_0x47ef('0xb5')]=function(_0x89b8e5,_0x38fe44,_0x3f29f3){return db[_0x47ef('0xb6')][_0x47ef('0x68')]({'where':{'id':_0x89b8e5[_0x47ef('0xaf')]['id']}})['then'](handleEntityNotFound(_0x38fe44,null))[_0x47ef('0x27')](function(_0xce441c){if(_0xce441c){return _0xce441c[_0x47ef('0xb5')](_0x89b8e5[_0x47ef('0x72')][_0x47ef('0xb7')],_[_0x47ef('0xb8')](_0x89b8e5['body'],[_0x47ef('0xb7'),'id'])||{});}})[_0x47ef('0x27')](respondWithResult(_0x38fe44,null))[_0x47ef('0x33')](handleError(_0x38fe44,null));};exports['getMessages']=function(_0x16fb20,_0x10d462,_0x109a21){var _0x53bde7={'raw':![],'where':{}};var _0x56df13={};var _0x4f3ad9={'count':0x0,'rows':[]};return db[_0x47ef('0x99')]['findOne']({'where':{'id':_0x16fb20['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x10d462,null))[_0x47ef('0x27')](function(_0x25cb9d){if(_0x25cb9d){_0x56df13['model']=_[_0x47ef('0x3b')](db[_0x47ef('0xb6')]['rawAttributes']);_0x56df13[_0x47ef('0x3a')]=_[_0x47ef('0x3b')](_0x16fb20['query']);_0x56df13[_0x47ef('0x3c')]=_[_0x47ef('0x3d')](_0x56df13[_0x47ef('0x39')],_0x56df13['query']);_0x53bde7['attributes']=_[_0x47ef('0x3d')](_0x56df13[_0x47ef('0x39')],qs[_0x47ef('0x3f')](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x3f')]));_0x53bde7['attributes']=_0x53bde7[_0x47ef('0x3e')]['length']?_0x53bde7[_0x47ef('0x3e')]:_0x56df13[_0x47ef('0x39')];if(!_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x41')](_0x47ef('0x42'))){_0x53bde7[_0x47ef('0x20')]=qs[_0x47ef('0x20')](_0x16fb20['query'][_0x47ef('0x20')]);_0x53bde7[_0x47ef('0x1e')]=qs['offset'](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x1e')]);}_0x53bde7[_0x47ef('0x43')]=qs[_0x47ef('0x44')](_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x44')]);_0x53bde7['where']=qs[_0x47ef('0x3c')](_['pick'](_0x16fb20[_0x47ef('0x3a')],_0x56df13[_0x47ef('0x3c')]));_0x53bde7[_0x47ef('0x45')][_0x47ef('0xb9')]=_0x25cb9d['id'];if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x7e')]){_0x53bde7['where']=_[_0x47ef('0x98')](_0x53bde7['where'],{'$or':_[_0x47ef('0x35')](_0x53bde7['attributes'],function(_0x3c62f2){var _0x60decd={};_0x60decd[_0x3c62f2]={'$like':'%'+_0x16fb20[_0x47ef('0x3a')][_0x47ef('0x7e')]+'%'};return _0x60decd;})});}if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xba')]){var _0x2a7187=_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xba')]['split'](',');var _0x2336d0={};_0x2336d0[_0x2a7187[0x0]]={'$gte':moment(_0x2a7187[0x1])[_0x47ef('0xbb')](_0x47ef('0xbc'))};_0x53bde7[_0x47ef('0x45')]=_[_0x47ef('0x98')](_0x53bde7['where'],_0x2336d0);}_0x53bde7=_['merge']({},_0x53bde7,_0x16fb20['options']);return db['FaxMessage'][_0x47ef('0x21')]({'where':_0x53bde7['where']})[_0x47ef('0x27')](function(_0xcdc6a8){_0x4f3ad9[_0x47ef('0x21')]=_0xcdc6a8;if(_0x16fb20[_0x47ef('0x3a')][_0x47ef('0xb0')]){_0x53bde7[_0x47ef('0xb1')]=[{'all':!![]}];}return db[_0x47ef('0xb6')][_0x47ef('0xbd')](_0x53bde7);})['then'](function(_0x26f2c9){_0x4f3ad9[_0x47ef('0xad')]=_0x26f2c9;return _0x4f3ad9;});}})['then'](respondWithFilteredResult(_0x10d462,_0x53bde7))[_0x47ef('0x33')](handleError(_0x10d462,null));};exports['addTags']=function(_0x88e13a,_0x11538b,_0x51c551){return db['FaxInteraction'][_0x47ef('0x68')]({'where':{'id':_0x88e13a['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x11538b,null))['then'](function(_0x23ee35){if(_0x23ee35){return _0x23ee35['setTags'](_0x88e13a[_0x47ef('0x72')][_0x47ef('0xb7')],_[_0x47ef('0xb8')](_0x88e13a[_0x47ef('0x72')],[_0x47ef('0xb7'),'id'])||{})[_0x47ef('0xbe')](function(){return db[_0x47ef('0x6b')][_0x47ef('0xbd')]({'attributes':['id','name',_0x47ef('0x49')],'where':{'id':_0x88e13a['body'][_0x47ef('0xb7')]}});})[_0x47ef('0x27')](function(_0x1aa953){socket[_0x47ef('0xbf')](_0x47ef('0xc0'),{'id':Number(_0x88e13a[_0x47ef('0xaf')]['id']),'tags':_0x1aa953||[]});return{'id':Number(_0x88e13a['params']['id']),'tags':_0x1aa953||[]};});}})[_0x47ef('0x27')](respondWithResult(_0x11538b,null))['catch'](handleError(_0x11538b,null));};exports[_0x47ef('0xc1')]=function(_0x359150,_0x5196ed,_0x5cc439){return db[_0x47ef('0x99')][_0x47ef('0x68')]({'where':{'id':_0x359150['params']['id']}})[_0x47ef('0x27')](handleEntityNotFound(_0x5196ed,null))['then'](function(_0x56ea9d){if(_0x56ea9d){return _0x56ea9d['removeTags'](_0x359150['query']['ids']);}})[_0x47ef('0x27')](respondWithStatusCode(_0x5196ed,null))[_0x47ef('0x33')](handleError(_0x5196ed,null));};exports[_0x47ef('0xc2')]=function(_0x511bee,_0x4c7ebc){var _0x7c3e07=moment()[_0x47ef('0xc3')]()[_0x47ef('0x96')]();var _0x2b5813=path['join'](config[_0x47ef('0xc4')],_0x47ef('0xc5'),_0x47ef('0xc6'),'tmp');var _0x169441=path[_0x47ef('0xc7')](config['root'],_0x47ef('0xc5'),_0x47ef('0xc6'),'attachments');var _0x48019a=path[_0x47ef('0xc7')](_0x2b5813,_0x7c3e07);var _0x577767=util[_0x47ef('0xbb')](_0x47ef('0xc8'),_0x511bee[_0x47ef('0xaf')]['id'],_0x7c3e07);var _0x5cfaa9=path[_0x47ef('0xc7')](_0x2b5813,_0x577767);var _0x9196c9=[];_0x9196c9[_0x47ef('0xab')]({'model':db['Attachment'],'as':_0x47ef('0xc9'),'raw':!![]});var _0x6fd94e=[{'model':db[_0x47ef('0xb6')],'as':_0x47ef('0xca'),'attributes':['id',_0x47ef('0x72'),_0x47ef('0x77')],'include':_0x9196c9}];return db[_0x47ef('0x99')]['find']({'where':{'id':_0x511bee[_0x47ef('0xaf')]['id']},'include':_0x6fd94e})['then'](handleEntityNotFound(_0x4c7ebc,null))[_0x47ef('0x27')](function(_0x176aa7){if(_0x176aa7&&_0x176aa7['Messages']){var _0x2ee782=_0x176aa7['get']({'plain':!![]});fs[_0x47ef('0xcb')](_0x48019a);for(var _0x1e6111=0x0;_0x1e6111<_0x2ee782['Messages'][_0x47ef('0x40')];_0x1e6111++){var _0x4d08e1=_0x2ee782[_0x47ef('0xca')][_0x1e6111]['Attachment'];if(_0x4d08e1){var _0x13717f=path[_0x47ef('0xc7')](_0x169441,_0x4d08e1[_0x47ef('0xcc')]);if(fs['existsSync'](_0x13717f)){fs[_0x47ef('0xcd')](_0x13717f)[_0x47ef('0xce')](fs['createWriteStream'](path[_0x47ef('0xc7')](_0x48019a,_0x4d08e1[_0x47ef('0xcc')])));}}}return BPromise[_0x47ef('0x8d')]()[_0x47ef('0x27')](function(){return new BPromise(function(_0xf307e6,_0x19b884){zipdir(_0x48019a,{'saveTo':_0x5cfaa9},function(_0x327d4a,_0x3e3b6e){if(_0x327d4a)return _0x19b884(_0x327d4a);return _0xf307e6(_0x3e3b6e);});})[_0x47ef('0x27')](function(){return new BPromise(function(_0x134252,_0x5ede2e){rimraf(_0x48019a,function(_0x3b1273){if(_0x3b1273)_0x5ede2e(_0x3b1273);return _0x134252();});});})['then'](function(){return _0x4c7ebc[_0x47ef('0xc2')](_0x5cfaa9,_0x577767,function(_0x404bff){if(_0x404bff){console[_0x47ef('0xcf')](_0x47ef('0xd0'),_0x404bff);}else{fs[_0x47ef('0xd1')](_0x5cfaa9);}});});});}else{return _0x4c7ebc[_0x47ef('0xd2')](0xc8);}})['catch'](handleError(_0x4c7ebc,null));};
\ No newline at end of file
+var _0x3575=['Users','map','TagIds','Tags','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','unreadMessages','value','having','Contact','operator','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','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?','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.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','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','rows','params','includeAll','include','create','body','describe','addMessage','FaxMessage','ids','findOne','merge','format','options','findAll','addTags','setTags','color','faxInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','pipe','createWriteStream','resolve','log','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x27209b,_0x13f886){var _0x219e6a=function(_0x217acc){while(--_0x217acc){_0x27209b['push'](_0x27209b['shift']());}};_0x219e6a(++_0x13f886);}(_0x3575,0xa0));var _0x5357=function(_0x56984d,_0x411d26){_0x56984d=_0x56984d-0x0;var _0x2aecc0=_0x3575[_0x56984d];return _0x2aecc0;};'use strict';var emlformat=require(_0x5357('0x0'));var rimraf=require(_0x5357('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5357('0x2'));var rp=require(_0x5357('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5357('0x4'));var util=require(_0x5357('0x5'));var path=require(_0x5357('0x6'));var sox=require('sox');var csv=require(_0x5357('0x7'));var ejs=require(_0x5357('0x8'));var fs=require('fs');var fs_extra=require(_0x5357('0x9'));var _=require(_0x5357('0xa'));var squel=require(_0x5357('0xb'));var crypto=require(_0x5357('0xc'));var jsforce=require(_0x5357('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5357('0x7'));var querystring=require(_0x5357('0xe'));var Papa=require(_0x5357('0xf'));var Redis=require(_0x5357('0x10'));var authService=require(_0x5357('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5357('0x12'));var hardwareService=require(_0x5357('0x13'));var logger=require(_0x5357('0x14'))(_0x5357('0x15'));var utils=require(_0x5357('0x16'));var config=require(_0x5357('0x17'));var licenseUtil=require(_0x5357('0x18'));var db=require(_0x5357('0x19'))['db'];config[_0x5357('0x1a')]=_[_0x5357('0x1b')](config['redis'],{'host':_0x5357('0x1c'),'port':0x18eb});var socket=require(_0x5357('0x1d'))(new Redis(config[_0x5357('0x1a')]));require(_0x5357('0x1e'))[_0x5357('0x1f')](socket);function respondWithStatusCode(_0x423914,_0x4a53fa){_0x4a53fa=_0x4a53fa||0xcc;return function(_0x5af876){if(_0x5af876){return _0x423914[_0x5357('0x20')](_0x4a53fa);}return _0x423914[_0x5357('0x21')](_0x4a53fa)[_0x5357('0x22')]();};}function respondWithResult(_0x5088f3,_0x4f4f15){_0x4f4f15=_0x4f4f15||0xc8;return function(_0x4391ae){if(_0x4391ae){return _0x5088f3[_0x5357('0x21')](_0x4f4f15)[_0x5357('0x23')](_0x4391ae);}};}function respondWithFilteredResult(_0x7f7e45,_0x25a906){return function(_0x2dfb69){if(_0x2dfb69){var _0x5bd807=typeof _0x25a906[_0x5357('0x24')]==='undefined'&&typeof _0x25a906[_0x5357('0x25')]===_0x5357('0x26');var _0x51255c=_0x2dfb69[_0x5357('0x27')];var _0x1d313c=_0x5bd807?0x0:_0x25a906['offset'];var _0x1f25c0=_0x5bd807?_0x2dfb69[_0x5357('0x27')]:_0x25a906['offset']+_0x25a906['limit'];var _0x31594f;if(_0x1f25c0>=_0x51255c){_0x1f25c0=_0x51255c;_0x31594f=0xc8;}else{_0x31594f=0xce;}_0x7f7e45[_0x5357('0x21')](_0x31594f);return _0x7f7e45[_0x5357('0x28')]('Content-Range',_0x1d313c+'-'+_0x1f25c0+'/'+_0x51255c)['json'](_0x2dfb69);}return null;};}function patchUpdates(_0x2f227c){return function(_0x2c8b67){try{jsonpatch[_0x5357('0x29')](_0x2c8b67,_0x2f227c,!![]);}catch(_0x10b419){return BPromise[_0x5357('0x2a')](_0x10b419);}return _0x2c8b67[_0x5357('0x2b')]();};}function saveUpdates(_0x46dae2,_0x2fd362){return function(_0x36c628){if(_0x36c628){return _0x36c628[_0x5357('0x2c')](_0x46dae2)[_0x5357('0x2d')](function(_0x48ec4){return _0x48ec4;});}return null;};}function removeEntity(_0x4cad65,_0x3c88fd){return function(_0x1e57f8){if(_0x1e57f8){return _0x1e57f8[_0x5357('0x2e')]()[_0x5357('0x2d')](function(){_0x4cad65[_0x5357('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e47d5,_0x5a44a9){return function(_0x31a9ed){if(!_0x31a9ed){_0x1e47d5['sendStatus'](0x194);}return _0x31a9ed;};}function handleError(_0x405965,_0x11783a){_0x11783a=_0x11783a||0x1f4;return function(_0x4271a1){logger[_0x5357('0x2f')](_0x4271a1[_0x5357('0x30')]);if(_0x4271a1['name']){delete _0x4271a1[_0x5357('0x31')];}_0x405965[_0x5357('0x21')](_0x11783a)[_0x5357('0x32')](_0x4271a1);};}function getInteractionUsers(_0x3a7f2f,_0x3a6814){return new BPromise(function(_0x342ea5,_0x32bfed){try{if(_0x3a6814[_0x3a7f2f['id']]){_0x3a7f2f[_0x5357('0x33')]=_[_0x5357('0x34')](_0x3a6814[_0x3a7f2f['id']],function(_0x229429){return{'id':_0x229429['id'],'fullname':_0x229429['fullname']};});}}catch(_0x36a4cb){_0x32bfed(_0x36a4cb);}_0x342ea5(_0x3a7f2f);});}function getInteractionTags(_0x1eebf5,_0x1205c8){return new BPromise(function(_0x4f5393,_0x11bdc6){try{if(_0x1eebf5[_0x5357('0x35')]){_0x1eebf5[_0x5357('0x36')]=[];_0x1eebf5[_0x5357('0x35')]['split'](',')[_0x5357('0x37')](function(_0x4ade63){_0x1eebf5[_0x5357('0x36')][_0x5357('0x38')](_0x1205c8[_0x4ade63]);});}delete _0x1eebf5[_0x5357('0x35')];}catch(_0x392a33){_0x11bdc6(_0x392a33);}_0x4f5393(_0x1eebf5);});}function updateFaxInteraction(_0x4310eb,_0x20e0ac,_0x5b840d){return new BPromise(function(_0x2e930a,_0x550069){return getInteractionUsers(_0x4310eb,_0x5b840d)[_0x5357('0x2d')](function(_0x5afde9){return getInteractionTags(_0x5afde9,_0x20e0ac);})[_0x5357('0x2d')](function(_0xb6a450){_0x2e930a(_0xb6a450);})[_0x5357('0x39')](function(_0x8e3dc7){_0x550069(_0x8e3dc7);});});}exports[_0x5357('0x3a')]=function(_0x2588f4,_0x40e0c2){var _0x28db65={},_0x3225da={},_0x2f8f64={'count':0x0,'rows':[]};var _0x40e805=_[_0x5357('0x34')](db[_0x5357('0x3b')][_0x5357('0x3c')],function(_0x442bc7){return{'name':_0x442bc7[_0x5357('0x3d')],'type':_0x442bc7['type'][_0x5357('0x3e')]};});_0x3225da[_0x5357('0x3f')]=_['map'](_0x40e805,_0x5357('0x31'));_0x3225da[_0x5357('0x40')]=_[_0x5357('0x41')](_0x2588f4[_0x5357('0x40')]);_0x3225da[_0x5357('0x42')]=_[_0x5357('0x43')](_0x3225da['model'],_0x3225da[_0x5357('0x40')]);_0x28db65[_0x5357('0x44')]=_[_0x5357('0x43')](_0x3225da[_0x5357('0x3f')],qs['fields'](_0x2588f4['query'][_0x5357('0x45')]));_0x28db65[_0x5357('0x44')]=_0x28db65[_0x5357('0x44')][_0x5357('0x46')]?_0x28db65[_0x5357('0x44')]:_0x3225da[_0x5357('0x3f')];if(!_0x2588f4[_0x5357('0x40')][_0x5357('0x47')](_0x5357('0x48'))){_0x28db65[_0x5357('0x25')]=qs[_0x5357('0x25')](_0x2588f4[_0x5357('0x40')][_0x5357('0x25')]);_0x28db65['offset']=qs[_0x5357('0x24')](_0x2588f4[_0x5357('0x40')]['offset']);}_0x28db65[_0x5357('0x49')]=qs['sort'](_0x2588f4[_0x5357('0x40')][_0x5357('0x4a')]);_0x28db65[_0x5357('0x4b')]=qs[_0x5357('0x42')](_[_0x5357('0x4c')](_0x2588f4[_0x5357('0x40')],_0x3225da['filters']),_0x40e805);var _0x18b48c=[];var _0x4b9685=squel[_0x5357('0x4d')]()[_0x5357('0x4e')]('id')['field'](_0x5357('0x31'))[_0x5357('0x4e')]('color')[_0x5357('0x4f')](_0x5357('0x50'));var _0xe66232=squel[_0x5357('0x4d')]()[_0x5357('0x4e')](_0x5357('0x51'))['field'](_0x5357('0x52'))[_0x5357('0x4e')](_0x5357('0x53'))[_0x5357('0x4f')](_0x5357('0x54'),'ui')[_0x5357('0x55')](_0x5357('0x56'),'u',_0x5357('0x57'));var _0x4b87fb=squel['select']()['from']('fax_interactions','i')['left_join']('cm_contacts','c',_0x5357('0x58'))['left_join'](_0x5357('0x56'),'o','o.id\x20=\x20i.UserId')[_0x5357('0x55')]('fax_accounts','a',_0x5357('0x59'))[_0x5357('0x55')](_0x5357('0x5a'),'me',_0x5357('0x5b'))['left_join'](_0x5357('0x5c'),'it',_0x5357('0x5d'))[_0x5357('0x55')](_0x5357('0x50'),'t','t.id\x20=\x20it.TagId');var _0x1f6327=squel[_0x5357('0x5e')]();var _0x5587c3=[];var _0x42908f=squel[_0x5357('0x5e')]();var _0x2d169c;if(_0x2588f4['query'][_0x5357('0x5f')]){_0x2d169c=as[_0x5357('0x60')](_0x2588f4['query']['search']);var _0x231b13=_0x2d169c[_0x5357('0x61')];for(var _0x160563=0x0;_0x160563<_0x2d169c['conditions'][_0x5357('0x46')];_0x160563++){var _0x2383a6=_0x2d169c['conditions'][_0x160563];var _0x432ce7='i';var _0x1c95b8=_['find'](_0x40e805,[_0x5357('0x31'),_0x2383a6[_0x5357('0x4e')]]);if(!_0x1c95b8){switch(_0x2383a6[_0x5357('0x4e')]){case _0x5357('0x62'):if(_0x2383a6[_0x5357('0x63')]==0x1){_0x4b87fb[_0x5357('0x64')]('`'+_0x2383a6[_0x5357('0x4e')]+'`\x20=\x200');}else{_0x4b87fb[_0x5357('0x64')]('`'+_0x2383a6[_0x5357('0x4e')]+'`\x20>\x200');}break;case _0x5357('0x65'):if(_0x2383a6[_0x5357('0x66')]==='$substring'){if(_0x2383a6[_0x5357('0x63')][_0x5357('0x67')]('\x20')[_0x5357('0x46')]>0x1){_0x1f6327[_0x231b13]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x2383a6[_0x5357('0x63')]),null);}else{var _0x1379de='%'+_0x2383a6[_0x5357('0x63')]+'%';_0x1f6327[_0x231b13](_0x5357('0x68'),_0x1379de,_0x1379de,_0x1379de);}}else{_0x1c95b8=_[_0x5357('0x69')](_0x40e805,[_0x5357('0x31'),'ContactId']);_0x2383a6['field']='ContactId';_0x472934=as[_0x5357('0x6a')](_0x432ce7,_0x1c95b8[_0x5357('0x6b')],_0x2383a6);_0x1f6327[_0x231b13](_0x472934[_0x5357('0x6c')],_0x472934['value'][_0x5357('0x6d')],_0x472934[_0x5357('0x63')][_0x5357('0x22')]);}break;case _0x5357('0x6e'):var _0x13de6d=_0x2383a6[_0x5357('0x63')]['split'](',')['map'](function(_0x4312a6){return Number(_0x4312a6);});_0x13de6d[_0x5357('0x37')](function(_0x1ec0c1){_0x42908f['or'](_0x5357('0x6f'),'%,'+_0x1ec0c1+',%');});_0x5587c3=_[_0x5357('0x70')](_0x5587c3,_0x13de6d);break;case _0x5357('0x71'):if(_0x2383a6[_0x5357('0x66')]===_0x5357('0x72')){_0x1f6327[_0x231b13](_0x5357('0x73'),'%'+_0x2383a6[_0x5357('0x63')]+'%',null);}else{_0x1c95b8=_[_0x5357('0x69')](_0x40e805,[_0x5357('0x31'),_0x5357('0x74')]);_0x2383a6[_0x5357('0x4e')]=_0x5357('0x74');_0x472934=as[_0x5357('0x6a')](_0x432ce7,_0x1c95b8['type'],_0x2383a6);_0x1f6327[_0x231b13](_0x472934[_0x5357('0x6c')],_0x472934['value']['start'],_0x472934['value'][_0x5357('0x22')]);}break;case'body':_0x472934=as[_0x5357('0x6a')]('me',null,_0x2383a6);_0x1f6327[_0x231b13](_0x472934[_0x5357('0x6c')],_0x472934[_0x5357('0x63')][_0x5357('0x6d')],_0x472934[_0x5357('0x63')]['end']);break;}}else{var _0x472934=as[_0x5357('0x6a')](_0x432ce7,_0x1c95b8[_0x5357('0x6b')],_0x2383a6);_0x1f6327[_0x231b13](_0x472934[_0x5357('0x6c')],_0x472934[_0x5357('0x63')][_0x5357('0x6d')],_0x472934[_0x5357('0x63')][_0x5357('0x22')]);}}}else{var _0x365f2b=_(_0x2588f4[_0x5357('0x40')])[_0x5357('0x41')]()['map'](function(_0x37c58f){return _[_0x5357('0x75')](_0x40e805,['name',_0x37c58f])?_0x37c58f:undefined;})[_0x5357('0x76')]()[_0x5357('0x63')]();if(!_[_0x5357('0x77')](_0x365f2b)){_0x365f2b['forEach'](function(_0x96c029){if(_0x96c029===_0x5357('0x78')){_0x4b87fb[_0x5357('0x4b')](_0x5357('0x79'),[][_0x5357('0x7a')](_0x2588f4['query'][_0x96c029]));}else if(_0x96c029===_0x5357('0x7b')){var _0x16fbcb=JSON[_0x5357('0x7c')](_0x2588f4[_0x5357('0x40')][_0x96c029])[_0x5357('0x7d')];var _0xb58350=JSON[_0x5357('0x7c')](_0x2588f4['query'][_0x96c029])[_0x5357('0x7e')];_0x4b87fb['where'](_0x5357('0x7f'),_0x16fbcb,_0xb58350);}else{if(_0x2588f4[_0x5357('0x40')][_0x96c029]===_0x5357('0x80')){_0x4b87fb[_0x5357('0x4b')]('i.'+_0x96c029+'\x20IS\x20NULL');}else{_0x4b87fb[_0x5357('0x4b')]('i.'+_0x96c029+_0x5357('0x81'),_0x2588f4[_0x5357('0x40')][_0x96c029]);}}});}if(_0x2588f4[_0x5357('0x40')][_0x5357('0x82')]){if(_0x2588f4[_0x5357('0x40')]['read']==0x1){_0x4b87fb['having'](_0x5357('0x83'));}else{_0x4b87fb[_0x5357('0x64')](_0x5357('0x84'));}}if(_0x2588f4[_0x5357('0x40')]['tag']){_0x5587c3=_[_0x5357('0x85')](_0x2588f4[_0x5357('0x40')][_0x5357('0x86')])?_0x2588f4['query'][_0x5357('0x86')]:new Array(_0x2588f4[_0x5357('0x40')][_0x5357('0x86')]);_0x5587c3[_0x5357('0x37')](function(_0x4341bf){_0x42908f['or'](_0x5357('0x6f'),'%,'+_0x4341bf+',%');});}if(_0x2588f4[_0x5357('0x40')][_0x5357('0x87')]){var _0x15a642=_0x2588f4[_0x5357('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0x5357('0x88')](/'/g,'\x27\x27');if(qs[_0x5357('0x89')](_0x15a642)){_0x1f6327['or']('i.id\x20LIKE\x20?',_0x15a642+'%')['or'](_0x5357('0x8a'),_0x15a642+'%');}_0x1f6327['or'](_0x5357('0x8b'),_0x15a642+'%');}}_0x4b87fb[_0x5357('0x4b')](_0x1f6327);_0x4b87fb[_0x5357('0x8c')](_0x5357('0x8d'));var _0x23e546={'type':db[_0x5357('0x8e')][_0x5357('0x8f')][_0x5357('0x90')],'raw':!![]};var _0x538dac=_0x4b87fb[_0x5357('0x91')]();_0x538dac[_0x5357('0x4e')]('i.id');_0x538dac[_0x5357('0x4e')](_0x5357('0x92'),_0x5357('0x62'));if(_0x28db65[_0x5357('0x49')]){_0x28db65[_0x5357('0x49')][_0x5357('0x37')](function(_0x2b5610){var _0xbeff1f=_0x2b5610[0x0]===_0x5357('0x93')?_0x2b5610[0x0]:'i.'+_0x2b5610[0x0];_0x4b87fb[_0x5357('0x49')](_0xbeff1f,_0x2b5610[0x1]===_0x5357('0x94')?![]:!![]);});}if(!_[_0x5357('0x77')](_0x5587c3)){_0x4b87fb[_0x5357('0x64')](_0x42908f);_0x538dac[_0x5357('0x4b')](_0x5357('0x95'),_0x5587c3);}BPromise['resolve']()[_0x5357('0x2d')](function(){if(!_0x2d169c){if(_0x2588f4['query']['FaxAccountId'])return;_0x538dac['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4b87fb[_0x5357('0x4b')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2588f4[_0x5357('0x96')][_0x5357('0x97')]!==_0x5357('0x98'))return;return _0x2588f4[_0x5357('0x96')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x57b709){if(_[_0x5357('0x77')](_0x57b709)){_0x538dac[_0x5357('0x4b')](_0x5357('0x99'));_0x4b87fb['where']('i.FaxAccountId\x20IS\x20NULL');}else{_0x538dac[_0x5357('0x4b')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x57b709,'id'));_0x4b87fb[_0x5357('0x4b')](_0x5357('0x79'),_[_0x5357('0x34')](_0x57b709,'id'));}});})[_0x5357('0x2d')](function(){if(_0x2588f4[_0x5357('0x96')][_0x5357('0x97')]===_0x5357('0x98')&&!_0x2d169c&&!_0x2588f4['query'][_0x5357('0x78')])return[];return db[_0x5357('0x9a')][_0x5357('0x40')](_0x538dac[_0x5357('0x9b')](),_0x23e546);})[_0x5357('0x2d')](function(_0x1d4579){_0x2f8f64['count']=_0x1d4579[_0x5357('0x46')];if(_0x2f8f64['count']===0x0)return[];return db['sequelize']['query'](_0x4b9685['toString'](),_0x23e546)['then'](function(_0x34cb40){_0x18b48c=_[_0x5357('0x9c')](_0x34cb40,'id');_0x23e546=_['merge'](_0x23e546,{'model':db[_0x5357('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2588f4['query']['fields']){_0x28db65[_0x5357('0x44')]['forEach'](function(_0x1a92a8){_0x4b87fb[_0x5357('0x4e')]('i.'+_0x1a92a8);});}else{_0x4b87fb['field'](_0x5357('0x92'),_0x5357('0x62'));_0x4b87fb[_0x5357('0x4e')](_0x5357('0x9d'),'Account.key');_0x4b87fb['field'](_0x5357('0x9e'),'Account.mandatoryDisposition');_0x4b87fb[_0x5357('0x4e')](_0x5357('0x9f'),'contactName');_0x4b87fb[_0x5357('0x4e')](_0x5357('0xa0'));_0x4b87fb[_0x5357('0x4e')](_0x5357('0xa1'),'Contact.firstName');_0x4b87fb[_0x5357('0x4e')](_0x5357('0xa2'),'Contact.lastName');_0x4b87fb[_0x5357('0x4e')]('c.email','Contact.email');_0x4b87fb[_0x5357('0x4e')](_0x5357('0xa3'),_0x5357('0xa4'));_0x4b87fb[_0x5357('0x4e')](_0x5357('0xa5'),_0x5357('0xa6'));_0x4b87fb[_0x5357('0x4e')]('c.fax',_0x5357('0xa7'));_0x4b87fb[_0x5357('0x4e')]('o.fullname',_0x5357('0xa8'));_0x4b87fb['field'](_0x5357('0xa9'),'Owner.internal');_0x4b87fb['field'](_0x5357('0xaa'),_0x5357('0x35'));}if(_0x28db65[_0x5357('0x25')])_0x4b87fb[_0x5357('0x25')](_0x28db65[_0x5357('0x25')]);if(_0x28db65[_0x5357('0x24')])_0x4b87fb[_0x5357('0x24')](_0x28db65[_0x5357('0x24')]);return db[_0x5357('0x9a')]['query'](_0x4b87fb[_0x5357('0x9b')](),_0x23e546);})[_0x5357('0x2d')](function(_0x473137){if(_0x473137[_0x5357('0x46')]>0x0)_0xe66232[_0x5357('0x4b')]('ui.FaxInteractionId\x20IN\x20?',_[_0x5357('0x34')](_0x473137,'id'));return db['sequelize']['query'](_0xe66232['toString'](),_0x23e546)[_0x5357('0x2d')](function(_0x2d8b6c){var _0x3748a4=_[_0x5357('0xab')](_0x2d8b6c,_0x5357('0xac'));var _0x41636f=[];_0x473137[_0x5357('0x37')](function(_0x174efc){_0x41636f[_0x5357('0x38')](updateFaxInteraction(_0x174efc,_0x18b48c,_0x3748a4));});return BPromise['all'](_0x41636f);});});})[_0x5357('0x2d')](function(_0x2ba62d){_0x2f8f64[_0x5357('0xad')]=_0x2ba62d;return _0x2f8f64;})['then'](respondWithFilteredResult(_0x40e0c2,_0x28db65))[_0x5357('0x39')](handleError(_0x40e0c2,null));};exports['show']=function(_0xe95d56,_0x495277){var _0xacf89={'raw':![],'where':{'id':_0xe95d56[_0x5357('0xae')]['id']}},_0x65d32c={};_0x65d32c[_0x5357('0x3f')]=_[_0x5357('0x41')](db[_0x5357('0x3b')][_0x5357('0x3c')]);_0x65d32c[_0x5357('0x40')]=_[_0x5357('0x41')](_0xe95d56['query']);_0x65d32c[_0x5357('0x42')]=_[_0x5357('0x43')](_0x65d32c[_0x5357('0x3f')],_0x65d32c[_0x5357('0x40')]);_0xacf89[_0x5357('0x44')]=_[_0x5357('0x43')](_0x65d32c[_0x5357('0x3f')],qs['fields'](_0xe95d56[_0x5357('0x40')][_0x5357('0x45')]));_0xacf89[_0x5357('0x44')]=_0xacf89[_0x5357('0x44')][_0x5357('0x46')]?_0xacf89[_0x5357('0x44')]:_0x65d32c[_0x5357('0x3f')];if(_0xe95d56[_0x5357('0x40')][_0x5357('0xaf')]){_0xacf89[_0x5357('0xb0')]=[{'all':!![]}];}_0xacf89=_['merge']({},_0xacf89,_0xe95d56['options']);return db['FaxInteraction'][_0x5357('0x69')](_0xacf89)[_0x5357('0x2d')](handleEntityNotFound(_0x495277,null))[_0x5357('0x2d')](respondWithResult(_0x495277,null))[_0x5357('0x39')](handleError(_0x495277,null));};exports[_0x5357('0xb1')]=function(_0x13b72a,_0x438b9b){return db['FaxInteraction'][_0x5357('0xb1')](_0x13b72a[_0x5357('0xb2')],{})[_0x5357('0x2d')](respondWithResult(_0x438b9b,0xc9))['catch'](handleError(_0x438b9b,null));};exports[_0x5357('0x2c')]=function(_0x324cf5,_0x4936e3){if(_0x324cf5[_0x5357('0xb2')]['id']){delete _0x324cf5[_0x5357('0xb2')]['id'];}return db[_0x5357('0x3b')][_0x5357('0x69')]({'where':{'id':_0x324cf5[_0x5357('0xae')]['id']}})[_0x5357('0x2d')](handleEntityNotFound(_0x4936e3,null))[_0x5357('0x2d')](saveUpdates(_0x324cf5[_0x5357('0xb2')],null))[_0x5357('0x2d')](respondWithResult(_0x4936e3,null))[_0x5357('0x39')](handleError(_0x4936e3,null));};exports['destroy']=function(_0x21b29d,_0x7f84d9){return db[_0x5357('0x3b')][_0x5357('0x69')]({'where':{'id':_0x21b29d[_0x5357('0xae')]['id']}})[_0x5357('0x2d')](handleEntityNotFound(_0x7f84d9,null))[_0x5357('0x2d')](removeEntity(_0x7f84d9,null))[_0x5357('0x39')](handleError(_0x7f84d9,null));};exports[_0x5357('0xb3')]=function(_0x17a91a,_0x4d3791){return db['FaxInteraction'][_0x5357('0xb3')]()[_0x5357('0x2d')](respondWithResult(_0x4d3791,null))['catch'](handleError(_0x4d3791,null));};exports[_0x5357('0xb4')]=function(_0x1b57a2,_0x2801b1,_0x4f7d43){return db[_0x5357('0xb5')][_0x5357('0x69')]({'where':{'id':_0x1b57a2[_0x5357('0xae')]['id']}})['then'](handleEntityNotFound(_0x2801b1,null))[_0x5357('0x2d')](function(_0x54b426){if(_0x54b426){return _0x54b426[_0x5357('0xb4')](_0x1b57a2['body'][_0x5357('0xb6')],_['omit'](_0x1b57a2['body'],[_0x5357('0xb6'),'id'])||{});}})[_0x5357('0x2d')](respondWithResult(_0x2801b1,null))['catch'](handleError(_0x2801b1,null));};exports['getMessages']=function(_0x32f8c8,_0x2ecbcb,_0x7946f8){var _0x38bd0e={'raw':![],'where':{}};var _0x5b4ca7={};var _0x1082cb={'count':0x0,'rows':[]};return db[_0x5357('0x3b')][_0x5357('0xb7')]({'where':{'id':_0x32f8c8[_0x5357('0xae')]['id']}})['then'](handleEntityNotFound(_0x2ecbcb,null))[_0x5357('0x2d')](function(_0x3892e0){if(_0x3892e0){_0x5b4ca7[_0x5357('0x3f')]=_[_0x5357('0x41')](db[_0x5357('0xb5')][_0x5357('0x3c')]);_0x5b4ca7[_0x5357('0x40')]=_[_0x5357('0x41')](_0x32f8c8[_0x5357('0x40')]);_0x5b4ca7['filters']=_[_0x5357('0x43')](_0x5b4ca7[_0x5357('0x3f')],_0x5b4ca7[_0x5357('0x40')]);_0x38bd0e[_0x5357('0x44')]=_[_0x5357('0x43')](_0x5b4ca7[_0x5357('0x3f')],qs[_0x5357('0x45')](_0x32f8c8['query'][_0x5357('0x45')]));_0x38bd0e['attributes']=_0x38bd0e[_0x5357('0x44')]['length']?_0x38bd0e['attributes']:_0x5b4ca7[_0x5357('0x3f')];if(!_0x32f8c8['query'][_0x5357('0x47')](_0x5357('0x48'))){_0x38bd0e[_0x5357('0x25')]=qs[_0x5357('0x25')](_0x32f8c8[_0x5357('0x40')][_0x5357('0x25')]);_0x38bd0e[_0x5357('0x24')]=qs[_0x5357('0x24')](_0x32f8c8[_0x5357('0x40')][_0x5357('0x24')]);}_0x38bd0e[_0x5357('0x49')]=qs['sort'](_0x32f8c8['query'][_0x5357('0x4a')]);_0x38bd0e[_0x5357('0x4b')]=qs[_0x5357('0x42')](_['pick'](_0x32f8c8['query'],_0x5b4ca7['filters']));_0x38bd0e[_0x5357('0x4b')][_0x5357('0xac')]=_0x3892e0['id'];if(_0x32f8c8['query'][_0x5357('0x87')]){_0x38bd0e[_0x5357('0x4b')]=_[_0x5357('0xb8')](_0x38bd0e[_0x5357('0x4b')],{'$or':_[_0x5357('0x34')](_0x38bd0e[_0x5357('0x44')],function(_0x3b0441){var _0x789bde={};_0x789bde[_0x3b0441]={'$like':'%'+_0x32f8c8[_0x5357('0x40')][_0x5357('0x87')]+'%'};return _0x789bde;})});}if(_0x32f8c8[_0x5357('0x40')]['$gte']){var _0xa568df=_0x32f8c8[_0x5357('0x40')][_0x5357('0x7d')][_0x5357('0x67')](',');var _0x904e0d={};_0x904e0d[_0xa568df[0x0]]={'$gte':moment(_0xa568df[0x1])[_0x5357('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x38bd0e[_0x5357('0x4b')]=_[_0x5357('0xb8')](_0x38bd0e['where'],_0x904e0d);}_0x38bd0e=_[_0x5357('0xb8')]({},_0x38bd0e,_0x32f8c8[_0x5357('0xba')]);return db[_0x5357('0xb5')][_0x5357('0x27')]({'where':_0x38bd0e[_0x5357('0x4b')]})[_0x5357('0x2d')](function(_0x286a74){_0x1082cb[_0x5357('0x27')]=_0x286a74;if(_0x32f8c8[_0x5357('0x40')][_0x5357('0xaf')]){_0x38bd0e['include']=[{'all':!![]}];}return db[_0x5357('0xb5')][_0x5357('0xbb')](_0x38bd0e);})['then'](function(_0x48c1b2){_0x1082cb[_0x5357('0xad')]=_0x48c1b2;return _0x1082cb;});}})[_0x5357('0x2d')](respondWithFilteredResult(_0x2ecbcb,_0x38bd0e))[_0x5357('0x39')](handleError(_0x2ecbcb,null));};exports[_0x5357('0xbc')]=function(_0x1a7659,_0x2f1276,_0x45984f){return db[_0x5357('0x3b')][_0x5357('0x69')]({'where':{'id':_0x1a7659[_0x5357('0xae')]['id']}})['then'](handleEntityNotFound(_0x2f1276,null))[_0x5357('0x2d')](function(_0x2bcfa6){if(_0x2bcfa6){return _0x2bcfa6[_0x5357('0xbd')](_0x1a7659[_0x5357('0xb2')][_0x5357('0xb6')],_['omit'](_0x1a7659[_0x5357('0xb2')],[_0x5357('0xb6'),'id'])||{})['spread'](function(){return db['Tag'][_0x5357('0xbb')]({'attributes':['id',_0x5357('0x31'),_0x5357('0xbe')],'where':{'id':_0x1a7659[_0x5357('0xb2')][_0x5357('0xb6')]}});})[_0x5357('0x2d')](function(_0x207f78){socket['emit'](_0x5357('0xbf'),{'id':Number(_0x1a7659[_0x5357('0xae')]['id']),'tags':_0x207f78||[]});return{'id':Number(_0x1a7659[_0x5357('0xae')]['id']),'tags':_0x207f78||[]};});}})[_0x5357('0x2d')](respondWithResult(_0x2f1276,null))['catch'](handleError(_0x2f1276,null));};exports[_0x5357('0xc0')]=function(_0x45aeba,_0x17f146,_0x1deb7f){return db['FaxInteraction'][_0x5357('0x69')]({'where':{'id':_0x45aeba['params']['id']}})['then'](handleEntityNotFound(_0x17f146,null))['then'](function(_0x537153){if(_0x537153){return _0x537153['removeTags'](_0x45aeba[_0x5357('0x40')][_0x5357('0xb6')]);}})['then'](respondWithStatusCode(_0x17f146,null))['catch'](handleError(_0x17f146,null));};exports[_0x5357('0xc1')]=function(_0x34eede,_0x33e40c){var _0x22705e=moment()['unix']()[_0x5357('0x9b')]();var _0x587dd7=path['join'](config[_0x5357('0xc2')],_0x5357('0xc3'),_0x5357('0xc4'),_0x5357('0xc5'));var _0x2ce16b=path[_0x5357('0xc6')](config['root'],'server',_0x5357('0xc4'),_0x5357('0xc7'));var _0x2dc570=path[_0x5357('0xc6')](_0x587dd7,_0x22705e);var _0x1a6732=util['format'](_0x5357('0xc8'),_0x34eede[_0x5357('0xae')]['id'],_0x22705e);var _0x523f61=path[_0x5357('0xc6')](_0x587dd7,_0x1a6732);var _0x46622b=[];_0x46622b[_0x5357('0x38')]({'model':db[_0x5357('0xc9')],'as':_0x5357('0xc9'),'raw':!![]});var _0x59a47f=[{'model':db[_0x5357('0xb5')],'as':_0x5357('0xca'),'attributes':['id',_0x5357('0xb2'),'createdAt'],'include':_0x46622b}];return db[_0x5357('0x3b')][_0x5357('0x69')]({'where':{'id':_0x34eede[_0x5357('0xae')]['id']},'include':_0x59a47f})[_0x5357('0x2d')](handleEntityNotFound(_0x33e40c,null))[_0x5357('0x2d')](function(_0x57233c){if(_0x57233c&&_0x57233c[_0x5357('0xca')]){var _0x54f09f=_0x57233c[_0x5357('0xcb')]({'plain':!![]});fs['mkdirSync'](_0x2dc570);for(var _0x55d372=0x0;_0x55d372<_0x54f09f[_0x5357('0xca')][_0x5357('0x46')];_0x55d372++){var _0x4885c1=_0x54f09f[_0x5357('0xca')][_0x55d372][_0x5357('0xc9')];if(_0x4885c1){var _0x2a708f=path[_0x5357('0xc6')](_0x2ce16b,_0x4885c1[_0x5357('0xcc')]);if(fs[_0x5357('0xcd')](_0x2a708f)){fs['createReadStream'](_0x2a708f)[_0x5357('0xce')](fs[_0x5357('0xcf')](path[_0x5357('0xc6')](_0x2dc570,_0x4885c1[_0x5357('0xcc')])));}}}return BPromise[_0x5357('0xd0')]()['then'](function(){return new BPromise(function(_0x9cbcac,_0x36c429){zipdir(_0x2dc570,{'saveTo':_0x523f61},function(_0x468831,_0x100d71){if(_0x468831)return _0x36c429(_0x468831);return _0x9cbcac(_0x100d71);});})['then'](function(){return new BPromise(function(_0x30e441,_0x5851a1){rimraf(_0x2dc570,function(_0x4e5adf){if(_0x4e5adf)_0x5851a1(_0x4e5adf);return _0x30e441();});});})[_0x5357('0x2d')](function(){return _0x33e40c[_0x5357('0xc1')](_0x523f61,_0x1a6732,function(_0x5ba0e5){if(_0x5ba0e5){console[_0x5357('0xd1')]('err',_0x5ba0e5);}else{fs[_0x5357('0xd2')](_0x523f61);}});});});}else{return _0x33e40c[_0x5357('0x20')](0xc8);}})['catch'](handleError(_0x33e40c,null));};
\ No newline at end of file
index a389f5a..c642fe2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fdf=['length','emit','catch','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','Users','findAll','setDataValue','unreadMessages'];(function(_0x36cef1,_0x140a7c){var _0x1d333d=function(_0x51a4c4){while(--_0x51a4c4){_0x36cef1['push'](_0x36cef1['shift']());}};_0x1d333d(++_0x140a7c);}(_0x8fdf,0x1f4));var _0xf8fd=function(_0x1d66c2,_0x1167e2){_0x1d66c2=_0x1d66c2-0x0;var _0x4c443c=_0x8fdf[_0x1d66c2];return _0x4c443c;};'use strict';var EventEmitter=require(_0xf8fd('0x0'));var FaxInteraction=require(_0xf8fd('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xf8fd('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf8fd('0x2')](0x0);var events={'afterCreate':_0xf8fd('0x3'),'afterUpdate':_0xf8fd('0x4'),'afterDestroy':_0xf8fd('0x5')};function emitEvent(_0x38a245){return function(_0x145a2d,_0x7bd052,_0x1987a4){_0x145a2d['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x518d17){_0x145a2d['setDataValue'](_0xf8fd('0x6'),_0x518d17['map'](function(_0x1bb1e6){return{'id':_0x1bb1e6['id']};}));return FaxMessage[_0xf8fd('0x7')]({'where':{'FaxInteractionId':_0x145a2d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xde5c5e){_0x145a2d[_0xf8fd('0x8')](_0xf8fd('0x9'),_0xde5c5e[_0xf8fd('0xa')]);FaxInteractionEvents[_0xf8fd('0xb')](_0x38a245+':'+_0x145a2d['id'],_0x145a2d);FaxInteractionEvents[_0xf8fd('0xb')](_0x38a245,_0x145a2d);_0x1987a4(null);})[_0xf8fd('0xc')](_0x1987a4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf8fd('0xd')](e,emitEvent(event));}}module[_0xf8fd('0xe')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x33d3=['hook','events','FaxInteraction','../../mysqldb','save','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x33d3,0x1e1));var _0x333d=function(_0x1314d4,_0xb0b16d){_0x1314d4=_0x1314d4-0x0;var _0x584ba5=_0x33d3[_0x1314d4];return _0x584ba5;};'use strict';var EventEmitter=require(_0x333d('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x333d('0x1')];var FaxMessage=require(_0x333d('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x333d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ed899){return function(_0x4b0307,_0x1af20a,_0x270eef){_0x4b0307[_0x333d('0x4')]({'attributes':['id'],'raw':!![]})[_0x333d('0x5')](function(_0xb1fdde){_0x4b0307[_0x333d('0x6')](_0x333d('0x7'),_0xb1fdde['map'](function(_0x10a133){return{'id':_0x10a133['id']};}));return FaxMessage[_0x333d('0x8')]({'where':{'FaxInteractionId':_0x4b0307['id'],'direction':'in','read':![]},'raw':!![]});})[_0x333d('0x5')](function(_0x13c179){_0x4b0307[_0x333d('0x6')](_0x333d('0x9'),_0x13c179[_0x333d('0xa')]);FaxInteractionEvents[_0x333d('0xb')](_0x4ed899+':'+_0x4b0307['id'],_0x4b0307);FaxInteractionEvents[_0x333d('0xb')](_0x4ed899,_0x4b0307);_0x270eef(null);})[_0x333d('0xc')](_0x270eef(null));};}for(var e in events){if(events[_0x333d('0xd')](e)){var event=events[e];FaxInteraction[_0x333d('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
index f386f72..1ac53de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x242c=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x2f60f5,_0xcbf7cb){var _0x28ec03=function(_0x54928a){while(--_0x54928a){_0x2f60f5['push'](_0x2f60f5['shift']());}};_0x28ec03(++_0xcbf7cb);}(_0x242c,0xfb));var _0xc242=function(_0x275983,_0x2e8bb0){_0x275983=_0x275983-0x0;var _0x234332=_0x242c[_0x275983];return _0x234332;};'use strict';var _=require(_0xc242('0x0'));var util=require(_0xc242('0x1'));var logger=require(_0xc242('0x2'))(_0xc242('0x3'));var moment=require(_0xc242('0x4'));var BPromise=require('bluebird');var rp=require(_0xc242('0x5'));var fs=require('fs');var path=require(_0xc242('0x6'));var rimraf=require(_0xc242('0x7'));var config=require(_0xc242('0x8'));var attributes=require(_0xc242('0x9'));module['exports']=function(_0x143325,_0x1cc0cd){return _0x143325[_0xc242('0xa')](_0xc242('0xb'),attributes,{'tableName':_0xc242('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3374e9,_0x47f994,_0x4d8087){if(_0x3374e9[_0xc242('0xd')](_0xc242('0xe'))){_0x3374e9[_0xc242('0xf')]=moment()[_0xc242('0x10')](_0xc242('0x11'));}_0x4d8087(null,_0x3374e9);}}});};
\ No newline at end of file
+var _0x80d5=['../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e9552,_0x5a4e94){var _0x36db8b=function(_0x6c77ef){while(--_0x6c77ef){_0x1e9552['push'](_0x1e9552['shift']());}};_0x36db8b(++_0x5a4e94);}(_0x80d5,0x186));var _0x580d=function(_0x4fa882,_0x421f14){_0x4fa882=_0x4fa882-0x0;var _0x3fa61a=_0x80d5[_0x4fa882];return _0x3fa61a;};'use strict';var _=require(_0x580d('0x0'));var util=require(_0x580d('0x1'));var logger=require(_0x580d('0x2'))(_0x580d('0x3'));var moment=require(_0x580d('0x4'));var BPromise=require(_0x580d('0x5'));var rp=require(_0x580d('0x6'));var fs=require('fs');var path=require(_0x580d('0x7'));var rimraf=require(_0x580d('0x8'));var config=require(_0x580d('0x9'));var attributes=require(_0x580d('0xa'));module[_0x580d('0xb')]=function(_0x49dcb8,_0x502719){return _0x49dcb8[_0x580d('0xc')](_0x580d('0xd'),attributes,{'tableName':_0x580d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a2904,_0x9db9b,_0x40ce0a){if(_0x2a2904[_0x580d('0xf')](_0x580d('0x10'))){_0x2a2904[_0x580d('0x11')]=moment()['format'](_0x580d('0x12'));}_0x40ce0a(null,_0x2a2904);}}});};
\ No newline at end of file
index 86b897e..293152d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0deb=['client','http','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','limit','AddTagsToFaxInteraction','find','where','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x0deb,0x8c));var _0xb0de=function(_0x2490c1,_0x5ebf4d){_0x2490c1=_0x2490c1-0x0;var _0x5b140b=_0x0deb[_0x2490c1];return _0x5b140b;};'use strict';var _=require(_0xb0de('0x0'));var util=require(_0xb0de('0x1'));var moment=require(_0xb0de('0x2'));var BPromise=require(_0xb0de('0x3'));var rs=require(_0xb0de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb0de('0x5'));var logger=require(_0xb0de('0x6'))('rpc');var config=require(_0xb0de('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb0de('0x8')][_0xb0de('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb0de('0xa'),'port':0x18eb});var socket=require(_0xb0de('0xb'))(new Redis(config['redis']));require(_0xb0de('0xc'))[_0xb0de('0xd')](socket);function respondWithRpcPromise(_0x429e96,_0x550556,_0x405514){return new BPromise(function(_0x33afa8,_0x5682c7){return client[_0xb0de('0xe')](_0x429e96,_0x405514)[_0xb0de('0xf')](function(_0xa0b5bf){logger[_0xb0de('0x10')](_0xb0de('0x11'),_0x550556,'request\x20sent');logger[_0xb0de('0x12')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x550556,_0xb0de('0x13'),JSON[_0xb0de('0x14')](_0xa0b5bf));if(_0xa0b5bf[_0xb0de('0x15')]){if(_0xa0b5bf[_0xb0de('0x15')]['code']===0x1f4){logger[_0xb0de('0x15')](_0xb0de('0x11'),_0x550556,_0xa0b5bf['error'][_0xb0de('0x16')]);return _0x5682c7(_0xa0b5bf[_0xb0de('0x15')][_0xb0de('0x16')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x550556,_0xa0b5bf[_0xb0de('0x15')][_0xb0de('0x16')]);return _0x33afa8(_0xa0b5bf['error'][_0xb0de('0x16')]);}else{logger[_0xb0de('0x10')](_0xb0de('0x11'),_0x550556,_0xb0de('0x13'));_0x33afa8(_0xa0b5bf['result'][_0xb0de('0x16')]);}})[_0xb0de('0x17')](function(_0x35d4a7){logger[_0xb0de('0x15')](_0xb0de('0x11'),_0x550556,_0x35d4a7);_0x5682c7(_0x35d4a7);});});}exports[_0xb0de('0x18')]=function(_0x51c3d9){var _0x346f10=this;return new Promise(function(_0x31f8fc,_0x237a9b){return db[_0xb0de('0x19')][_0xb0de('0x1a')](_0x51c3d9[_0xb0de('0x1b')],{'raw':_0x51c3d9['options']?_0x51c3d9[_0xb0de('0x1c')][_0xb0de('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c3d9['options']?_0x51c3d9['options']['where']||null:null,'attributes':_0x51c3d9[_0xb0de('0x1c')]?_0x51c3d9[_0xb0de('0x1c')]['attributes']||null:null,'limit':_0x51c3d9[_0xb0de('0x1c')]?_0x51c3d9[_0xb0de('0x1c')][_0xb0de('0x1e')]||null:null})['then'](function(_0x4e737c){logger[_0xb0de('0x10')]('UpdateFaxInteraction',_0x51c3d9);logger['debug'](_0xb0de('0x18'),_0x51c3d9,JSON[_0xb0de('0x14')](_0x4e737c));_0x31f8fc(_0x4e737c);})[_0xb0de('0x17')](function(_0x449987){logger['error'](_0xb0de('0x18'),_0x449987[_0xb0de('0x16')],_0x51c3d9);_0x237a9b(_0x346f10[_0xb0de('0x15')](0x1f4,_0x449987[_0xb0de('0x16')]));});});};exports[_0xb0de('0x1f')]=function(_0x1bcd4e){return new Promise(function(_0x19896d,_0x4a6bc6){return db[_0xb0de('0x19')][_0xb0de('0x20')]({'where':_0x1bcd4e[_0xb0de('0x1c')]?_0x1bcd4e['options'][_0xb0de('0x21')]||null:null})[_0xb0de('0xf')](function(_0x17084e){if(_0x17084e){return _0x17084e['addTags'](_0x1bcd4e[_0xb0de('0x1b')]['ids'],_[_0xb0de('0x22')](_0x1bcd4e[_0xb0de('0x1b')],['ids','id'])||{});}})[_0xb0de('0x23')](function(_0x59569e){logger['info']('AddTags',_0x1bcd4e);logger[_0xb0de('0x12')](_0xb0de('0x24'),_0x1bcd4e,JSON[_0xb0de('0x14')](_0x59569e));_0x19896d(_0x59569e);})[_0xb0de('0x17')](function(_0x436583){logger['error'](_0xb0de('0x24'),_0x436583[_0xb0de('0x16')],_0x1bcd4e);_0x4a6bc6(_this[_0xb0de('0x15')](0x1f4,_0x436583[_0xb0de('0x16')]));});});};
\ No newline at end of file
+var _0x0c57=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes','then','AddTagsToFaxInteraction','find','where','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x54c4d9,_0x3623cb){var _0x35dc37=function(_0x57c712){while(--_0x57c712){_0x54c4d9['push'](_0x54c4d9['shift']());}};_0x35dc37(++_0x3623cb);}(_0x0c57,0x107));var _0x70c5=function(_0x3151a9,_0x48675b){_0x3151a9=_0x3151a9-0x0;var _0x1635e1=_0x0c57[_0x3151a9];return _0x1635e1;};'use strict';var _=require(_0x70c5('0x0'));var util=require('util');var moment=require(_0x70c5('0x1'));var BPromise=require(_0x70c5('0x2'));var rs=require(_0x70c5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70c5('0x4'))['db'];var utils=require(_0x70c5('0x5'));var logger=require(_0x70c5('0x6'))(_0x70c5('0x7'));var config=require(_0x70c5('0x8'));var jayson=require(_0x70c5('0x9'));var client=jayson[_0x70c5('0xa')][_0x70c5('0xb')]({'port':0x232a});config[_0x70c5('0xc')]=_[_0x70c5('0xd')](config[_0x70c5('0xc')],{'host':_0x70c5('0xe'),'port':0x18eb});var socket=require(_0x70c5('0xf'))(new Redis(config['redis']));require(_0x70c5('0x10'))[_0x70c5('0x11')](socket);function respondWithRpcPromise(_0x3acb53,_0x2be398,_0x327659){return new BPromise(function(_0x7447ed,_0x133b26){return client[_0x70c5('0x12')](_0x3acb53,_0x327659)['then'](function(_0x1619a3){logger['info'](_0x70c5('0x13'),_0x2be398,_0x70c5('0x14'));logger[_0x70c5('0x15')](_0x70c5('0x16'),_0x2be398,_0x70c5('0x14'),JSON[_0x70c5('0x17')](_0x1619a3));if(_0x1619a3[_0x70c5('0x18')]){if(_0x1619a3[_0x70c5('0x18')][_0x70c5('0x19')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x2be398,_0x1619a3[_0x70c5('0x18')][_0x70c5('0x1a')]);return _0x133b26(_0x1619a3['error'][_0x70c5('0x1a')]);}logger[_0x70c5('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x2be398,_0x1619a3[_0x70c5('0x18')][_0x70c5('0x1a')]);return _0x7447ed(_0x1619a3[_0x70c5('0x18')][_0x70c5('0x1a')]);}else{logger[_0x70c5('0x1b')](_0x70c5('0x13'),_0x2be398,_0x70c5('0x14'));_0x7447ed(_0x1619a3[_0x70c5('0x1c')][_0x70c5('0x1a')]);}})[_0x70c5('0x1d')](function(_0x55a89f){logger[_0x70c5('0x18')](_0x70c5('0x13'),_0x2be398,_0x55a89f);_0x133b26(_0x55a89f);});});}exports[_0x70c5('0x1e')]=function(_0x558f1e){var _0x591c57=this;return new Promise(function(_0x57d086,_0x1f6220){return db[_0x70c5('0x1f')][_0x70c5('0x20')](_0x558f1e['body'],{'raw':_0x558f1e['options']?_0x558f1e[_0x70c5('0x21')][_0x70c5('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558f1e[_0x70c5('0x21')]?_0x558f1e['options']['where']||null:null,'attributes':_0x558f1e['options']?_0x558f1e[_0x70c5('0x21')][_0x70c5('0x23')]||null:null,'limit':_0x558f1e[_0x70c5('0x21')]?_0x558f1e[_0x70c5('0x21')]['limit']||null:null})[_0x70c5('0x24')](function(_0x513e08){logger[_0x70c5('0x1b')]('UpdateFaxInteraction',_0x558f1e);logger['debug']('UpdateFaxInteraction',_0x558f1e,JSON['stringify'](_0x513e08));_0x57d086(_0x513e08);})[_0x70c5('0x1d')](function(_0x36f4eb){logger[_0x70c5('0x18')]('UpdateFaxInteraction',_0x36f4eb['message'],_0x558f1e);_0x1f6220(_0x591c57[_0x70c5('0x18')](0x1f4,_0x36f4eb['message']));});});};exports[_0x70c5('0x25')]=function(_0x305a62){return new Promise(function(_0x3e8c90,_0x449c87){return db[_0x70c5('0x1f')][_0x70c5('0x26')]({'where':_0x305a62[_0x70c5('0x21')]?_0x305a62[_0x70c5('0x21')][_0x70c5('0x27')]||null:null})['then'](function(_0x312f12){if(_0x312f12){return _0x312f12['addTags'](_0x305a62[_0x70c5('0x28')][_0x70c5('0x29')],_[_0x70c5('0x2a')](_0x305a62[_0x70c5('0x28')],[_0x70c5('0x29'),'id'])||{});}})[_0x70c5('0x2b')](function(_0x305cfe){logger[_0x70c5('0x1b')]('AddTags',_0x305a62);logger[_0x70c5('0x15')](_0x70c5('0x2c'),_0x305a62,JSON[_0x70c5('0x17')](_0x305cfe));_0x3e8c90(_0x305cfe);})[_0x70c5('0x1d')](function(_0x36b9bc){logger['error'](_0x70c5('0x2c'),_0x36b9bc[_0x70c5('0x1a')],_0x305a62);_0x449c87(_this[_0x70c5('0x18')](0x1f4,_0x36b9bc[_0x70c5('0x1a')]));});});};
\ No newline at end of file
index ef9f31c..d8bb890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee74=['./faxInteraction.events','save','remove','update','removeListener','register','length','faxInteraction:'];(function(_0x5ad0d1,_0x50161b){var _0x266f22=function(_0x2d676d){while(--_0x2d676d){_0x5ad0d1['push'](_0x5ad0d1['shift']());}};_0x266f22(++_0x50161b);}(_0xee74,0x108));var _0x4ee7=function(_0x379a8f,_0x473f24){_0x379a8f=_0x379a8f-0x0;var _0x226fe7=_0xee74[_0x379a8f];return _0x226fe7;};'use strict';var FaxInteractionEvents=require(_0x4ee7('0x0'));var events=[_0x4ee7('0x1'),_0x4ee7('0x2'),_0x4ee7('0x3')];function createListener(_0x3284e8,_0x1b07ee){return function(_0x27faf5){_0x1b07ee['emit'](_0x3284e8,_0x27faf5);};}function removeListener(_0x421d2b,_0x3ead84){return function(){FaxInteractionEvents[_0x4ee7('0x4')](_0x421d2b,_0x3ead84);};}exports[_0x4ee7('0x5')]=function(_0x5ddec7){for(var _0x50eae4=0x0,_0xda57ea=events[_0x4ee7('0x6')];_0x50eae4<_0xda57ea;_0x50eae4++){var _0x5833af=events[_0x50eae4];var _0x1f3275=createListener(_0x4ee7('0x7')+_0x5833af,_0x5ddec7);FaxInteractionEvents['on'](_0x5833af,_0x1f3275);}};
\ No newline at end of file
+var _0x69b1=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4dba75,_0x4f94d9){var _0x523883=function(_0x176955){while(--_0x176955){_0x4dba75['push'](_0x4dba75['shift']());}};_0x523883(++_0x4f94d9);}(_0x69b1,0x88));var _0x169b=function(_0x5c4a09,_0x87d302){_0x5c4a09=_0x5c4a09-0x0;var _0x4b42d8=_0x69b1[_0x5c4a09];return _0x4b42d8;};'use strict';var FaxInteractionEvents=require(_0x169b('0x0'));var events=[_0x169b('0x1'),_0x169b('0x2'),_0x169b('0x3')];function createListener(_0x47801d,_0x26fc79){return function(_0x410809){_0x26fc79[_0x169b('0x4')](_0x47801d,_0x410809);};}function removeListener(_0x5e513b,_0x176313){return function(){FaxInteractionEvents[_0x169b('0x5')](_0x5e513b,_0x176313);};}exports[_0x169b('0x6')]=function(_0x11d185){for(var _0x2eaf05=0x0,_0x9678cf=events[_0x169b('0x7')];_0x2eaf05<_0x9678cf;_0x2eaf05++){var _0x102597=events[_0x2eaf05];var _0x5e790c=createListener(_0x169b('0x8')+_0x102597,_0x11d185);FaxInteractionEvents['on'](_0x102597,_0x5e790c);}};
\ No newline at end of file
index b01365b..bc7fae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27c0=['fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','util','connect-timeout'];(function(_0x5c604c,_0x3c638f){var _0x565a0e=function(_0x363a79){while(--_0x363a79){_0x5c604c['push'](_0x5c604c['shift']());}};_0x565a0e(++_0x3c638f);}(_0x27c0,0x8f));var _0x027c=function(_0xa78009,_0x6f957){_0xa78009=_0xa78009-0x0;var _0x13c5ec=_0x27c0[_0xa78009];return _0x13c5ec;};'use strict';var multer=require('multer');var util=require(_0x027c('0x0'));var path=require('path');var timeout=require(_0x027c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x027c('0x2'));var auth=require(_0x027c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x027c('0x4'));var controller=require(_0x027c('0x5'));router[_0x027c('0x6')]('/',auth[_0x027c('0x7')](),controller[_0x027c('0x8')]);router[_0x027c('0x6')](_0x027c('0x9'),auth[_0x027c('0x7')](),controller[_0x027c('0xa')]);router[_0x027c('0x6')](_0x027c('0xb'),auth[_0x027c('0x7')](),controller[_0x027c('0xc')]);router[_0x027c('0x6')](_0x027c('0xd'),auth[_0x027c('0x7')](),controller['getMessages']);router[_0x027c('0x6')](_0x027c('0xe'),auth['isAuthenticated'](),controller[_0x027c('0xf')]);router[_0x027c('0x10')]('/',auth[_0x027c('0x7')](),controller['create']);router[_0x027c('0x10')](_0x027c('0xd'),auth[_0x027c('0x7')](),controller[_0x027c('0x11')]);router['post'](_0x027c('0x12'),auth[_0x027c('0x7')](),interaction['tracked'](_0x027c('0x13'),_0x027c('0x14')),controller[_0x027c('0x15')]);router[_0x027c('0x16')](_0x027c('0xb'),auth[_0x027c('0x7')](),interaction['tracked']('fax','faxinteraction:update'),controller[_0x027c('0x17')]);router[_0x027c('0x18')]('/:id',auth[_0x027c('0x7')](),interaction[_0x027c('0x19')](_0x027c('0x13'),_0x027c('0x1a')),controller[_0x027c('0x1b')]);router[_0x027c('0x18')](_0x027c('0x12'),auth[_0x027c('0x7')](),controller[_0x027c('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x058f=['addMessage','/:id/tags','tracked','fax','addTags','put','update','delete','faxinteraction:destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x058f,0xc6));var _0xf058=function(_0x59a0f3,_0x378f28){_0x59a0f3=_0x59a0f3-0x0;var _0xe1de73=_0x058f[_0x59a0f3];return _0xe1de73;};'use strict';var multer=require(_0xf058('0x0'));var util=require(_0xf058('0x1'));var path=require('path');var timeout=require(_0xf058('0x2'));var express=require(_0xf058('0x3'));var router=express['Router']();var fs_extra=require(_0xf058('0x4'));var auth=require(_0xf058('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf058('0x6'));var controller=require(_0xf058('0x7'));router[_0xf058('0x8')]('/',auth[_0xf058('0x9')](),controller[_0xf058('0xa')]);router[_0xf058('0x8')]('/describe',auth[_0xf058('0x9')](),controller[_0xf058('0xb')]);router[_0xf058('0x8')](_0xf058('0xc'),auth[_0xf058('0x9')](),controller['show']);router['get'](_0xf058('0xd'),auth['isAuthenticated'](),controller[_0xf058('0xe')]);router['get'](_0xf058('0xf'),auth[_0xf058('0x9')](),controller['download']);router[_0xf058('0x10')]('/',auth[_0xf058('0x9')](),controller[_0xf058('0x11')]);router['post'](_0xf058('0xd'),auth[_0xf058('0x9')](),controller[_0xf058('0x12')]);router[_0xf058('0x10')](_0xf058('0x13'),auth[_0xf058('0x9')](),interaction[_0xf058('0x14')](_0xf058('0x15'),'faxinteraction:addtags'),controller[_0xf058('0x16')]);router[_0xf058('0x17')](_0xf058('0xc'),auth['isAuthenticated'](),interaction[_0xf058('0x14')](_0xf058('0x15'),'faxinteraction:update'),controller[_0xf058('0x18')]);router[_0xf058('0x19')](_0xf058('0xc'),auth[_0xf058('0x9')](),interaction[_0xf058('0x14')]('fax',_0xf058('0x1a')),controller['destroy']);router[_0xf058('0x19')](_0xf058('0x13'),auth[_0xf058('0x9')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index d5ff10c..25db7f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207d=['exports','TEXT','medium','ENUM','out','sequelize'];(function(_0x485b5d,_0x5692b6){var _0xa90291=function(_0x57ea35){while(--_0x57ea35){_0x485b5d['push'](_0x485b5d['shift']());}};_0xa90291(++_0x5692b6);}(_0x207d,0x10d));var _0xd207=function(_0xe7108,_0x3ea674){_0xe7108=_0xe7108-0x0;var _0x2e0701=_0x207d[_0xe7108];return _0x2e0701;};'use strict';var Sequelize=require(_0xd207('0x0'));module[_0xd207('0x1')]={'body':{'type':Sequelize[_0xd207('0x2')](_0xd207('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd207('0x4')]('in','out'),'defaultValue':_0xd207('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd207('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x4fdb=['ENUM','out','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4e568c,_0x13e586){var _0x4e7d61=function(_0x4fde08){while(--_0x4fde08){_0x4e568c['push'](_0x4e568c['shift']());}};_0x4e7d61(++_0x13e586);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x4fcf4e,_0x21694a){_0x4fcf4e=_0x4fcf4e-0x0;var _0xe91581=_0x4fdb[_0x4fcf4e];return _0xe91581;};'use strict';var Sequelize=require(_0xb4fd('0x0'));module[_0xb4fd('0x1')]={'body':{'type':Sequelize[_0xb4fd('0x2')](_0xb4fd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb4fd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb4fd('0x5')]('in',_0xb4fd('0x6')),'defaultValue':_0xb4fd('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb4fd('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 796394e..d337f92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda75=['api','../../config/environment','redis','defaults','localhost','./faxMessage.socket','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','FaxMessage,\x20%s,\x20%s','error','message','status','offset','undefined','count','limit','set','Content-Range','apply','save','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxMessage','include','findAll','rows','catch','show','params','keys','includeAll','find','body','destroy','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','format','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','event','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2bf169,_0x14b015){var _0x8318a1=function(_0x5b22af){while(--_0x5b22af){_0x2bf169['push'](_0x2bf169['shift']());}};_0x8318a1(++_0x14b015);}(_0xda75,0x192));var _0x5da7=function(_0x5f2108,_0x2e2cd5){_0x5f2108=_0x5f2108-0x0;var _0x10ef49=_0xda75[_0x5f2108];return _0x10ef49;};'use strict';var emlformat=require(_0x5da7('0x0'));var rimraf=require(_0x5da7('0x1'));var zipdir=require(_0x5da7('0x2'));var jsonpatch=require(_0x5da7('0x3'));var rp=require(_0x5da7('0x4'));var moment=require(_0x5da7('0x5'));var BPromise=require(_0x5da7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5da7('0x7'));var sox=require(_0x5da7('0x8'));var csv=require(_0x5da7('0x9'));var ejs=require(_0x5da7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5da7('0xb'));var squel=require(_0x5da7('0xc'));var crypto=require('crypto');var jsforce=require(_0x5da7('0xd'));var deskjs=require(_0x5da7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5da7('0xf'));var Papa=require(_0x5da7('0x10'));var Redis=require('ioredis');var authService=require(_0x5da7('0x11'));var qs=require(_0x5da7('0x12'));var as=require(_0x5da7('0x13'));var hardwareService=require(_0x5da7('0x14'));var logger=require('../../config/logger')(_0x5da7('0x15'));var utils=require('../../config/utils');var config=require(_0x5da7('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5da7('0x17')]=_[_0x5da7('0x18')](config[_0x5da7('0x17')],{'host':_0x5da7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5da7('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5da7('0x1b')][_0x5da7('0x1c')]({'port':0x232c});var client9002=jayson[_0x5da7('0x1b')][_0x5da7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x189ded,_0x47020a,_0x1cd060,_0x5e785f){return new BPromise(function(_0x107059,_0x344a85){var _0x1e1e17=_0x5e785f||client;return _0x1e1e17[_0x5da7('0x1d')](_0x189ded,_0x1cd060)[_0x5da7('0x1e')](function(_0x558615){logger[_0x5da7('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x47020a,_0x5da7('0x20'));logger[_0x5da7('0x21')](_0x5da7('0x22'),_0x47020a,_0x5da7('0x20'),JSON[_0x5da7('0x23')](_0x558615));if(_0x558615['error']){if(_0x558615['error']['code']===0x1f4){logger['error'](_0x5da7('0x24'),_0x47020a,_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);return _0x344a85(_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);}logger[_0x5da7('0x25')](_0x5da7('0x24'),_0x47020a,_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);return _0x107059(_0x558615[_0x5da7('0x25')][_0x5da7('0x26')]);}else{logger[_0x5da7('0x1f')]('FaxMessage,\x20%s,\x20%s',_0x47020a,_0x5da7('0x20'));_0x107059(_0x558615['result'][_0x5da7('0x26')]);}})['catch'](function(_0x3a4857){logger['error'](_0x5da7('0x24'),_0x47020a,_0x3a4857);_0x344a85(_0x3a4857);});});}function respondWithStatusCode(_0x2d4919,_0x21703b){_0x21703b=_0x21703b||0xcc;return function(_0xc90c91){if(_0xc90c91){return _0x2d4919['sendStatus'](_0x21703b);}return _0x2d4919[_0x5da7('0x27')](_0x21703b)['end']();};}function respondWithResult(_0x16f67b,_0x5a81f1){_0x5a81f1=_0x5a81f1||0xc8;return function(_0x1570f5){if(_0x1570f5){return _0x16f67b['status'](_0x5a81f1)['json'](_0x1570f5);}};}function respondWithFilteredResult(_0x3aeaf4,_0x61b5ee){return function(_0x5bb836){if(_0x5bb836){var _0x1305e3=typeof _0x61b5ee[_0x5da7('0x28')]===_0x5da7('0x29')&&typeof _0x61b5ee['limit']===_0x5da7('0x29');var _0x5396aa=_0x5bb836[_0x5da7('0x2a')];var _0x51fcef=_0x1305e3?0x0:_0x61b5ee[_0x5da7('0x28')];var _0x3331dc=_0x1305e3?_0x5bb836[_0x5da7('0x2a')]:_0x61b5ee['offset']+_0x61b5ee[_0x5da7('0x2b')];var _0x472954;if(_0x3331dc>=_0x5396aa){_0x3331dc=_0x5396aa;_0x472954=0xc8;}else{_0x472954=0xce;}_0x3aeaf4['status'](_0x472954);return _0x3aeaf4[_0x5da7('0x2c')](_0x5da7('0x2d'),_0x51fcef+'-'+_0x3331dc+'/'+_0x5396aa)['json'](_0x5bb836);}return null;};}function patchUpdates(_0x48d9de){return function(_0x1c771e){try{jsonpatch[_0x5da7('0x2e')](_0x1c771e,_0x48d9de,!![]);}catch(_0x24120e){return BPromise['reject'](_0x24120e);}return _0x1c771e[_0x5da7('0x2f')]();};}function saveUpdates(_0x14f4ff,_0x2352a3){return function(_0x994403){if(_0x994403){return _0x994403['update'](_0x14f4ff)[_0x5da7('0x1e')](function(_0x427b1a){return _0x427b1a;});}return null;};}function removeEntity(_0x352f88,_0xc7dc61){return function(_0x16eee7){if(_0x16eee7){return _0x16eee7['destroy']()[_0x5da7('0x1e')](function(){_0x352f88['status'](0xcc)[_0x5da7('0x30')]();});}};}function handleEntityNotFound(_0x3f642c,_0x373690){return function(_0x218bf7){if(!_0x218bf7){_0x3f642c[_0x5da7('0x31')](0x194);}return _0x218bf7;};}function handleError(_0x1a78aa,_0x4f8e68){_0x4f8e68=_0x4f8e68||0x1f4;return function(_0xb163bf){logger[_0x5da7('0x25')](_0xb163bf[_0x5da7('0x32')]);if(_0xb163bf[_0x5da7('0x33')]){delete _0xb163bf[_0x5da7('0x33')];}_0x1a78aa[_0x5da7('0x27')](_0x4f8e68)[_0x5da7('0x34')](_0xb163bf);};}exports[_0x5da7('0x35')]=function(_0x8d0fe5,_0x4bcadd){var _0x3843b3={},_0x220bcc={},_0x5c8fed={'count':0x0,'rows':[]};var _0x188220=_[_0x5da7('0x36')](db['FaxMessage'][_0x5da7('0x37')],function(_0x51f030){return{'name':_0x51f030[_0x5da7('0x38')],'type':_0x51f030['type']['key']};});_0x220bcc[_0x5da7('0x39')]=_[_0x5da7('0x36')](_0x188220,'name');_0x220bcc[_0x5da7('0x3a')]=_['keys'](_0x8d0fe5[_0x5da7('0x3a')]);_0x220bcc[_0x5da7('0x3b')]=_[_0x5da7('0x3c')](_0x220bcc[_0x5da7('0x39')],_0x220bcc['query']);_0x3843b3['attributes']=_[_0x5da7('0x3c')](_0x220bcc[_0x5da7('0x39')],qs[_0x5da7('0x3d')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x3d')]));_0x3843b3[_0x5da7('0x3e')]=_0x3843b3[_0x5da7('0x3e')][_0x5da7('0x3f')]?_0x3843b3[_0x5da7('0x3e')]:_0x220bcc['model'];if(!_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x40')](_0x5da7('0x41'))){_0x3843b3['limit']=qs[_0x5da7('0x2b')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x2b')]);_0x3843b3[_0x5da7('0x28')]=qs[_0x5da7('0x28')](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x28')]);}_0x3843b3[_0x5da7('0x42')]=qs['sort'](_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x43')]);_0x3843b3['where']=qs[_0x5da7('0x3b')](_[_0x5da7('0x44')](_0x8d0fe5[_0x5da7('0x3a')],_0x220bcc[_0x5da7('0x3b')]),_0x188220);if(_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x45')]){_0x3843b3[_0x5da7('0x46')]=_[_0x5da7('0x47')](_0x3843b3[_0x5da7('0x46')],{'$or':_[_0x5da7('0x36')](_0x188220,function(_0x599b31){if(_0x599b31['type']!==_0x5da7('0x48')){var _0x570939={};_0x570939[_0x599b31[_0x5da7('0x33')]]={'$like':'%'+_0x8d0fe5[_0x5da7('0x3a')][_0x5da7('0x45')]+'%'};return _0x570939;}})});}_0x3843b3=_[_0x5da7('0x47')]({},_0x3843b3,_0x8d0fe5[_0x5da7('0x49')]);var _0x573bf4={'where':_0x3843b3[_0x5da7('0x46')]};return db[_0x5da7('0x4a')][_0x5da7('0x2a')](_0x573bf4)[_0x5da7('0x1e')](function(_0x1132e9){_0x5c8fed[_0x5da7('0x2a')]=_0x1132e9;if(_0x8d0fe5[_0x5da7('0x3a')]['includeAll']){_0x3843b3[_0x5da7('0x4b')]=[{'all':!![]}];}return db['FaxMessage'][_0x5da7('0x4c')](_0x3843b3);})['then'](function(_0x372b53){_0x5c8fed[_0x5da7('0x4d')]=_0x372b53;return _0x5c8fed;})[_0x5da7('0x1e')](respondWithFilteredResult(_0x4bcadd,_0x3843b3))[_0x5da7('0x4e')](handleError(_0x4bcadd,null));};exports[_0x5da7('0x4f')]=function(_0x5c5985,_0x8cc459){var _0x3a4c3b={'raw':!![],'where':{'id':_0x5c5985[_0x5da7('0x50')]['id']}},_0x1e21eb={};_0x1e21eb[_0x5da7('0x39')]=_[_0x5da7('0x51')](db[_0x5da7('0x4a')][_0x5da7('0x37')]);_0x1e21eb[_0x5da7('0x3a')]=_['keys'](_0x5c5985[_0x5da7('0x3a')]);_0x1e21eb[_0x5da7('0x3b')]=_[_0x5da7('0x3c')](_0x1e21eb[_0x5da7('0x39')],_0x1e21eb[_0x5da7('0x3a')]);_0x3a4c3b['attributes']=_[_0x5da7('0x3c')](_0x1e21eb[_0x5da7('0x39')],qs[_0x5da7('0x3d')](_0x5c5985[_0x5da7('0x3a')][_0x5da7('0x3d')]));_0x3a4c3b[_0x5da7('0x3e')]=_0x3a4c3b[_0x5da7('0x3e')][_0x5da7('0x3f')]?_0x3a4c3b[_0x5da7('0x3e')]:_0x1e21eb[_0x5da7('0x39')];if(_0x5c5985[_0x5da7('0x3a')][_0x5da7('0x52')]){_0x3a4c3b['include']=[{'all':!![]}];}_0x3a4c3b=_[_0x5da7('0x47')]({},_0x3a4c3b,_0x5c5985[_0x5da7('0x49')]);return db['FaxMessage'][_0x5da7('0x53')](_0x3a4c3b)[_0x5da7('0x1e')](handleEntityNotFound(_0x8cc459,null))[_0x5da7('0x1e')](respondWithResult(_0x8cc459,null))[_0x5da7('0x4e')](handleError(_0x8cc459,null));};exports['update']=function(_0x2bc9ec,_0x483054){if(_0x2bc9ec[_0x5da7('0x54')]['id']){delete _0x2bc9ec[_0x5da7('0x54')]['id'];}return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x2bc9ec[_0x5da7('0x50')]['id']}})[_0x5da7('0x1e')](handleEntityNotFound(_0x483054,null))['then'](saveUpdates(_0x2bc9ec[_0x5da7('0x54')],null))[_0x5da7('0x1e')](respondWithResult(_0x483054,null))[_0x5da7('0x4e')](handleError(_0x483054,null));};exports[_0x5da7('0x55')]=function(_0x3b448c,_0x3bbbbf){return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x3b448c[_0x5da7('0x50')]['id']}})[_0x5da7('0x1e')](handleEntityNotFound(_0x3bbbbf,null))['then'](removeEntity(_0x3bbbbf,null))['catch'](handleError(_0x3bbbbf,null));};exports[_0x5da7('0x56')]=function(_0x3ed599,_0xebf879){return db[_0x5da7('0x4a')][_0x5da7('0x56')]()[_0x5da7('0x1e')](respondWithResult(_0xebf879,null))['catch'](handleError(_0xebf879,null));};var interaction_log=require(_0x5da7('0x57'))(_0x5da7('0x58'));exports[_0x5da7('0x59')]=function(_0x331e7e,_0x5f56c3,_0x570a6a){var _0xd0d0b={'agent':{},'channel':_0x5da7('0x5a')};if(_0x331e7e[_0x5da7('0x54')]['id']){delete _0x331e7e[_0x5da7('0x54')]['id'];}_0x331e7e['body']['read']=!![];_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5b')]=moment()['format'](_0x5da7('0x5c'));_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5d')]=_0x331e7e[_0x5da7('0x54')]['UserId']||_0x331e7e[_0x5da7('0x5e')]['id'];_0xd0d0b['agent']['id']=_0x331e7e[_0x5da7('0x54')]['UserId'];return db[_0x5da7('0x4a')]['find']({'where':{'id':_0x331e7e[_0x5da7('0x50')]['id'],'UserId':null}})[_0x5da7('0x1e')](handleEntityNotFound(_0x5f56c3,null))[_0x5da7('0x1e')](saveUpdates(_0x331e7e[_0x5da7('0x54')],null))[_0x5da7('0x1e')](function(_0x4bf235){if(_0x4bf235){_0xd0d0b['message']=_0x4bf235[_0x5da7('0x5f')]({'plain':!![]});return db[_0x5da7('0x60')]['find']({'where':{'id':_0x4bf235['FaxInteractionId']}});}return null;})[_0x5da7('0x1e')](handleEntityNotFound(_0x5f56c3,null))[_0x5da7('0x1e')](function(_0x1e222d){if(_0x1e222d){return _0x1e222d['update']({'UserId':_0x331e7e['body'][_0x5da7('0x5d')],'read1stAt':_['isNil'](_0x1e222d[_0x5da7('0x61')])?moment()[_0x5da7('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5da7('0x1e')](function(_0x1ee95e){if(_0x1ee95e){_0xd0d0b[_0x5da7('0x63')]=_0x1ee95e[_0x5da7('0x5f')]({'plain':!![]});interaction_log[_0x5da7('0x1f')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x331e7e[_0x5da7('0x5e')]['id'],_0x331e7e['user']['name'],_0x331e7e[_0x5da7('0x5e')][_0x5da7('0x64')],_0xd0d0b['interaction']['id'],_0x331e7e[_0x5da7('0x54')]?JSON[_0x5da7('0x23')](_0x331e7e[_0x5da7('0x54')]):_0x5da7('0x65'));return respondWithRpcPromise(_0x5da7('0x66'),_0x5da7('0x67'),_0xd0d0b);}return null;})[_0x5da7('0x1e')](function(_0x33ac5a){var _0x1196a5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x33ac5a[_0x5da7('0x26')][_0x5da7('0x68')];return db[_0x5da7('0x69')][_0x5da7('0x3a')](_0x1196a5,{'type':db[_0x5da7('0x6a')][_0x5da7('0x6b')][_0x5da7('0x6c')],'raw':!![]})[_0x5da7('0x1e')](function(_0x3638c6){return _0x3638c6;});})['then'](function(_0x405588){if(_0x405588){_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x6d')]=_0x405588[0x0];if(!_0x331e7e[_0x5da7('0x54')]['UserId'])return;return db[_0x5da7('0x6e')][_0x5da7('0x53')]({'where':{'id':_0x331e7e[_0x5da7('0x54')][_0x5da7('0x5d')],'role':_0x5da7('0x6f')},'attributes':['id',_0x5da7('0x33'),_0x5da7('0x70'),_0x5da7('0x71'),_0x5da7('0x72')],'raw':!![]});}return null;})[_0x5da7('0x1e')](function(_0x3a5229){if(!_0x3a5229)return null;_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x6f')]=_0x3a5229;return _0xd0d0b;})[_0x5da7('0x1e')](function(_0x27d2ce){if(_0x27d2ce){if(_0x331e7e[_0x5da7('0x54')][_0x5da7('0x73')]){_0xd0d0b[_0x5da7('0x26')]['interface']=util[_0x5da7('0x62')](_0x5da7('0x74'),_0x331e7e['user'][_0x5da7('0x33')]);_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x75')]=_0xd0d0b[_0x5da7('0x75')];_0xd0d0b[_0x5da7('0x26')][_0x5da7('0x76')]=_0xd0d0b[_0x5da7('0x75')];_0xd0d0b['message']['event']='accept';return respondWithRpcPromise(_0x5da7('0x77'),_0x5da7('0x77'),{'event':_0x5da7('0x78'),'message':_0xd0d0b[_0x5da7('0x26')]},client9002)[_0x5da7('0x1e')](function(){return _0xd0d0b;});}return _0xd0d0b;}return null;})[_0x5da7('0x1e')](respondWithResult(_0x5f56c3,null))[_0x5da7('0x4e')](handleError(_0x5f56c3,null));};var interaction_log=require(_0x5da7('0x57'))(_0x5da7('0x58'));exports[_0x5da7('0x79')]=function(_0x1aa3c8,_0x1dbecc,_0x5dc491){var _0x1faccb={'agent':{},'channel':_0x5da7('0x5a')};if(_0x1aa3c8[_0x5da7('0x54')]['id']){delete _0x1aa3c8['body']['id'];}_0x1aa3c8['body'][_0x5da7('0x5d')]=_0x1aa3c8['body']['UserId']||_0x1aa3c8[_0x5da7('0x5e')]['id'];_0x1faccb['agent']['id']=_0x1aa3c8[_0x5da7('0x54')][_0x5da7('0x5d')];return db[_0x5da7('0x4a')][_0x5da7('0x53')]({'where':{'id':_0x1aa3c8[_0x5da7('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1dbecc,null))[_0x5da7('0x1e')](function(_0x59c8fd){if(_0x59c8fd){_0x1faccb[_0x5da7('0x26')]=_0x59c8fd[_0x5da7('0x5f')]({'plain':!![]});return db['FaxInteraction'][_0x5da7('0x53')]({'where':{'id':_0x59c8fd['FaxInteractionId']}});}return null;})[_0x5da7('0x1e')](handleEntityNotFound(_0x1dbecc,null))[_0x5da7('0x1e')](function(_0x3afa66){if(_0x3afa66){_0x1faccb[_0x5da7('0x63')]=_0x3afa66[_0x5da7('0x5f')]({'plain':!![]});interaction_log[_0x5da7('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1aa3c8[_0x5da7('0x5e')]['id'],_0x1aa3c8[_0x5da7('0x5e')]['name'],_0x1aa3c8[_0x5da7('0x5e')][_0x5da7('0x64')],_0x1faccb['interaction']['id'],_0x1aa3c8[_0x5da7('0x54')]?JSON[_0x5da7('0x23')](_0x1aa3c8[_0x5da7('0x54')]):_0x5da7('0x65'));return respondWithRpcPromise(_0x5da7('0x7a'),_0x5da7('0x7b'),_0x1faccb);}return null;})[_0x5da7('0x1e')](function(_0x570ca5){var _0x437c87='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x570ca5[_0x5da7('0x26')]['ContactId'];return db[_0x5da7('0x69')][_0x5da7('0x3a')](_0x437c87,{'type':db[_0x5da7('0x6a')][_0x5da7('0x6b')][_0x5da7('0x6c')],'raw':!![]})[_0x5da7('0x1e')](function(_0x360de1){return _0x360de1;});})[_0x5da7('0x1e')](function(_0x212770){if(_0x212770){_0x1faccb[_0x5da7('0x26')]['contact']=_0x212770[0x0];if(!_0x1aa3c8[_0x5da7('0x54')][_0x5da7('0x5d')])return;return db[_0x5da7('0x6e')][_0x5da7('0x53')]({'where':{'id':_0x1aa3c8['body']['UserId'],'role':_0x5da7('0x6f')},'attributes':['id','name',_0x5da7('0x70'),_0x5da7('0x71'),_0x5da7('0x72')],'raw':!![]});}return null;})[_0x5da7('0x1e')](function(_0x2b7048){if(!_0x2b7048)return null;_0x1faccb[_0x5da7('0x26')]['agent']=_0x2b7048;return _0x1faccb;})['then'](function(_0x49e25e){if(_0x49e25e){_0x49e25e['message']['interface']=util['format'](_0x5da7('0x74'),_0x1aa3c8[_0x5da7('0x5e')][_0x5da7('0x33')]);_0x49e25e[_0x5da7('0x26')][_0x5da7('0x75')]=_0x1faccb[_0x5da7('0x75')];_0x49e25e['message'][_0x5da7('0x76')]=_0x1faccb['channel'];_0x49e25e[_0x5da7('0x26')][_0x5da7('0x7c')]=_0x5da7('0x79');respondWithRpcPromise(_0x5da7('0x77'),_0x5da7('0x77'),{'event':_0x5da7('0x7d'),'message':_0x49e25e[_0x5da7('0x26')]},client9002);return _0x1faccb;}return null;})['then'](respondWithResult(_0x1dbecc,null))['catch'](handleError(_0x1dbecc,null));};exports[_0x5da7('0x7e')]=function(_0x228e08,_0x2016e5){var _0x2e6c56;return db[_0x5da7('0x4a')]['create'](_0x228e08[_0x5da7('0x54')],{})[_0x5da7('0x1e')](function(_0x1adb9e){_0x2e6c56=_0x1adb9e;return db[_0x5da7('0x7f')][_0x5da7('0x80')]({'where':{'id':_0x2e6c56[_0x5da7('0x68')]}});})['then'](function(_0x50a4dc){if(_[_0x5da7('0x81')](_0x50a4dc)){return;}else{_0x2e6c56[_0x5da7('0x5a')]=_0x50a4dc[_0x5da7('0x5a')];return db[_0x5da7('0x82')]['findOne']({'where':{'id':_0x2e6c56[_0x5da7('0x83')]}});}})['then'](function(_0x4859c2){return respondWithRpcPromise(_0x5da7('0x84'),'SendFax',{'FaxAccountId':_[_0x5da7('0x81')](_0x228e08[_0x5da7('0x54')])?undefined:_0x228e08[_0x5da7('0x54')][_0x5da7('0x85')],'path':_[_0x5da7('0x81')](_0x4859c2)?undefined:util[_0x5da7('0x62')](_0x5da7('0x86'),_0x4859c2[_0x5da7('0x87')]),'fax':_[_0x5da7('0x81')](_0x2e6c56[_0x5da7('0x5a')])?undefined:_0x2e6c56['fax'],'AttachmentId':_0x2e6c56['AttachmentId']},client9002);})['then'](respondWithResult(_0x2016e5,0xc9))['catch'](handleError(_0x2016e5,null));};exports[_0x5da7('0x88')]=function(_0x4a715e,_0x446b43){var _0x801712=path[_0x5da7('0x89')](config['root'],_0x5da7('0x8a'),_0x5da7('0x8b'),_0x5da7('0x8c'));return db['FaxMessage'][_0x5da7('0x53')]({'where':{'id':_0x4a715e[_0x5da7('0x50')]['id']},'include':[{'model':db[_0x5da7('0x82')],'as':_0x5da7('0x82')}]})['then'](handleEntityNotFound(_0x446b43,null))['then'](function(_0xe0698b){if(_0xe0698b){return _0x446b43['download'](path['join'](_0x801712,_0xe0698b['Attachment'][_0x5da7('0x87')]));}})[_0x5da7('0x4e')](handleError(_0x446b43,null));};
\ No newline at end of file
+var _0x067e=['defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','sendStatus','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','FaxMessage','length','options','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','email','motionChannel','rejectmessage','create','CmContact','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x200a6e,_0x1f354c){var _0x4f0cbf=function(_0x3dfe2e){while(--_0x3dfe2e){_0x200a6e['push'](_0x200a6e['shift']());}};_0x4f0cbf(++_0x1f354c);}(_0x067e,0x19f));var _0xe067=function(_0x3267ff,_0x177378){_0x3267ff=_0x3267ff-0x0;var _0xa98fd8=_0x067e[_0x3267ff];return _0xa98fd8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe067('0x0'));var zipdir=require(_0xe067('0x1'));var jsonpatch=require(_0xe067('0x2'));var rp=require('request-promise');var moment=require(_0xe067('0x3'));var BPromise=require(_0xe067('0x4'));var Mustache=require(_0xe067('0x5'));var util=require(_0xe067('0x6'));var path=require(_0xe067('0x7'));var sox=require(_0xe067('0x8'));var csv=require(_0xe067('0x9'));var ejs=require(_0xe067('0xa'));var fs=require('fs');var fs_extra=require(_0xe067('0xb'));var _=require(_0xe067('0xc'));var squel=require(_0xe067('0xd'));var crypto=require(_0xe067('0xe'));var jsforce=require(_0xe067('0xf'));var deskjs=require(_0xe067('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe067('0x11'));var authService=require(_0xe067('0x12'));var qs=require(_0xe067('0x13'));var as=require(_0xe067('0x14'));var hardwareService=require(_0xe067('0x15'));var logger=require(_0xe067('0x16'))(_0xe067('0x17'));var utils=require(_0xe067('0x18'));var config=require(_0xe067('0x19'));var licenseUtil=require(_0xe067('0x1a'));var db=require(_0xe067('0x1b'))['db'];config[_0xe067('0x1c')]=_[_0xe067('0x1d')](config[_0xe067('0x1c')],{'host':_0xe067('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe067('0x1f'))[_0xe067('0x20')](socket);var jayson=require(_0xe067('0x21'));var client=jayson[_0xe067('0x22')][_0xe067('0x23')]({'port':0x232c});var client9002=jayson[_0xe067('0x22')][_0xe067('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1c25ae,_0x4453fa,_0x24990d,_0x1560a4){return new BPromise(function(_0x3a2402,_0x2c8d2c){var _0x28e066=_0x1560a4||client;return _0x28e066[_0xe067('0x24')](_0x1c25ae,_0x24990d)[_0xe067('0x25')](function(_0x39ae8c){logger['info'](_0xe067('0x26'),_0x4453fa,_0xe067('0x27'));logger[_0xe067('0x28')](_0xe067('0x29'),_0x4453fa,_0xe067('0x27'),JSON[_0xe067('0x2a')](_0x39ae8c));if(_0x39ae8c[_0xe067('0x2b')]){if(_0x39ae8c[_0xe067('0x2b')][_0xe067('0x2c')]===0x1f4){logger[_0xe067('0x2b')](_0xe067('0x26'),_0x4453fa,_0x39ae8c[_0xe067('0x2b')]['message']);return _0x2c8d2c(_0x39ae8c['error'][_0xe067('0x2d')]);}logger[_0xe067('0x2b')](_0xe067('0x26'),_0x4453fa,_0x39ae8c[_0xe067('0x2b')][_0xe067('0x2d')]);return _0x3a2402(_0x39ae8c[_0xe067('0x2b')][_0xe067('0x2d')]);}else{logger[_0xe067('0x2e')](_0xe067('0x26'),_0x4453fa,_0xe067('0x27'));_0x3a2402(_0x39ae8c[_0xe067('0x2f')][_0xe067('0x2d')]);}})['catch'](function(_0xe6724c){logger[_0xe067('0x2b')]('FaxMessage,\x20%s,\x20%s',_0x4453fa,_0xe6724c);_0x2c8d2c(_0xe6724c);});});}function respondWithStatusCode(_0x47d568,_0x1db60b){_0x1db60b=_0x1db60b||0xcc;return function(_0x423295){if(_0x423295){return _0x47d568['sendStatus'](_0x1db60b);}return _0x47d568[_0xe067('0x30')](_0x1db60b)[_0xe067('0x31')]();};}function respondWithResult(_0x6bfd2a,_0xd12d8d){_0xd12d8d=_0xd12d8d||0xc8;return function(_0x1662e9){if(_0x1662e9){return _0x6bfd2a[_0xe067('0x30')](_0xd12d8d)[_0xe067('0x32')](_0x1662e9);}};}function respondWithFilteredResult(_0x4984d3,_0x3a8b59){return function(_0x186201){if(_0x186201){var _0xd6378d=typeof _0x3a8b59['offset']===_0xe067('0x33')&&typeof _0x3a8b59['limit']===_0xe067('0x33');var _0x3faae2=_0x186201[_0xe067('0x34')];var _0x3e7f40=_0xd6378d?0x0:_0x3a8b59[_0xe067('0x35')];var _0x31d786=_0xd6378d?_0x186201[_0xe067('0x34')]:_0x3a8b59[_0xe067('0x35')]+_0x3a8b59['limit'];var _0x313960;if(_0x31d786>=_0x3faae2){_0x31d786=_0x3faae2;_0x313960=0xc8;}else{_0x313960=0xce;}_0x4984d3[_0xe067('0x30')](_0x313960);return _0x4984d3['set'](_0xe067('0x36'),_0x3e7f40+'-'+_0x31d786+'/'+_0x3faae2)[_0xe067('0x32')](_0x186201);}return null;};}function patchUpdates(_0x32709f){return function(_0x165546){try{jsonpatch[_0xe067('0x37')](_0x165546,_0x32709f,!![]);}catch(_0x2990b2){return BPromise[_0xe067('0x38')](_0x2990b2);}return _0x165546[_0xe067('0x39')]();};}function saveUpdates(_0x287509,_0x5c56fb){return function(_0x19771d){if(_0x19771d){return _0x19771d[_0xe067('0x3a')](_0x287509)[_0xe067('0x25')](function(_0x90fac7){return _0x90fac7;});}return null;};}function removeEntity(_0x22cc35,_0x2b43dc){return function(_0x44b6bc){if(_0x44b6bc){return _0x44b6bc['destroy']()['then'](function(){_0x22cc35[_0xe067('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2def4e,_0x380b5b){return function(_0x3d0467){if(!_0x3d0467){_0x2def4e[_0xe067('0x3b')](0x194);}return _0x3d0467;};}function handleError(_0x161cbd,_0x8effcc){_0x8effcc=_0x8effcc||0x1f4;return function(_0x3c9d48){logger[_0xe067('0x2b')](_0x3c9d48[_0xe067('0x3c')]);if(_0x3c9d48[_0xe067('0x3d')]){delete _0x3c9d48['name'];}_0x161cbd[_0xe067('0x30')](_0x8effcc)[_0xe067('0x3e')](_0x3c9d48);};}exports['index']=function(_0x1b19f6,_0x6af755){var _0x45d92d={},_0x44746c={},_0x1c3b51={'count':0x0,'rows':[]};var _0x298894=_[_0xe067('0x3f')](db['FaxMessage'][_0xe067('0x40')],function(_0x3e473f){return{'name':_0x3e473f['fieldName'],'type':_0x3e473f[_0xe067('0x41')][_0xe067('0x42')]};});_0x44746c[_0xe067('0x43')]=_['map'](_0x298894,_0xe067('0x3d'));_0x44746c[_0xe067('0x44')]=_[_0xe067('0x45')](_0x1b19f6[_0xe067('0x44')]);_0x44746c[_0xe067('0x46')]=_[_0xe067('0x47')](_0x44746c[_0xe067('0x43')],_0x44746c[_0xe067('0x44')]);_0x45d92d[_0xe067('0x48')]=_['intersection'](_0x44746c[_0xe067('0x43')],qs[_0xe067('0x49')](_0x1b19f6['query'][_0xe067('0x49')]));_0x45d92d[_0xe067('0x48')]=_0x45d92d[_0xe067('0x48')]['length']?_0x45d92d[_0xe067('0x48')]:_0x44746c[_0xe067('0x43')];if(!_0x1b19f6['query'][_0xe067('0x4a')](_0xe067('0x4b'))){_0x45d92d[_0xe067('0x4c')]=qs['limit'](_0x1b19f6[_0xe067('0x44')]['limit']);_0x45d92d[_0xe067('0x35')]=qs[_0xe067('0x35')](_0x1b19f6[_0xe067('0x44')][_0xe067('0x35')]);}_0x45d92d[_0xe067('0x4d')]=qs[_0xe067('0x4e')](_0x1b19f6[_0xe067('0x44')][_0xe067('0x4e')]);_0x45d92d[_0xe067('0x4f')]=qs[_0xe067('0x46')](_[_0xe067('0x50')](_0x1b19f6[_0xe067('0x44')],_0x44746c['filters']),_0x298894);if(_0x1b19f6[_0xe067('0x44')][_0xe067('0x51')]){_0x45d92d[_0xe067('0x4f')]=_[_0xe067('0x52')](_0x45d92d['where'],{'$or':_[_0xe067('0x3f')](_0x298894,function(_0x18ff02){if(_0x18ff02[_0xe067('0x41')]!==_0xe067('0x53')){var _0x5882ed={};_0x5882ed[_0x18ff02[_0xe067('0x3d')]]={'$like':'%'+_0x1b19f6[_0xe067('0x44')]['filter']+'%'};return _0x5882ed;}})});}_0x45d92d=_[_0xe067('0x52')]({},_0x45d92d,_0x1b19f6['options']);var _0x243df0={'where':_0x45d92d[_0xe067('0x4f')]};return db['FaxMessage']['count'](_0x243df0)[_0xe067('0x25')](function(_0x2dcd51){_0x1c3b51[_0xe067('0x34')]=_0x2dcd51;if(_0x1b19f6[_0xe067('0x44')][_0xe067('0x54')]){_0x45d92d['include']=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x45d92d);})[_0xe067('0x25')](function(_0x409e59){_0x1c3b51[_0xe067('0x55')]=_0x409e59;return _0x1c3b51;})['then'](respondWithFilteredResult(_0x6af755,_0x45d92d))[_0xe067('0x56')](handleError(_0x6af755,null));};exports[_0xe067('0x57')]=function(_0x3773fa,_0x1bdfd3){var _0x51a844={'raw':!![],'where':{'id':_0x3773fa[_0xe067('0x58')]['id']}},_0x48fc37={};_0x48fc37[_0xe067('0x43')]=_['keys'](db[_0xe067('0x59')]['rawAttributes']);_0x48fc37[_0xe067('0x44')]=_[_0xe067('0x45')](_0x3773fa[_0xe067('0x44')]);_0x48fc37[_0xe067('0x46')]=_[_0xe067('0x47')](_0x48fc37[_0xe067('0x43')],_0x48fc37[_0xe067('0x44')]);_0x51a844[_0xe067('0x48')]=_[_0xe067('0x47')](_0x48fc37[_0xe067('0x43')],qs[_0xe067('0x49')](_0x3773fa[_0xe067('0x44')][_0xe067('0x49')]));_0x51a844[_0xe067('0x48')]=_0x51a844[_0xe067('0x48')][_0xe067('0x5a')]?_0x51a844[_0xe067('0x48')]:_0x48fc37['model'];if(_0x3773fa[_0xe067('0x44')][_0xe067('0x54')]){_0x51a844['include']=[{'all':!![]}];}_0x51a844=_[_0xe067('0x52')]({},_0x51a844,_0x3773fa[_0xe067('0x5b')]);return db['FaxMessage'][_0xe067('0x5c')](_0x51a844)['then'](handleEntityNotFound(_0x1bdfd3,null))[_0xe067('0x25')](respondWithResult(_0x1bdfd3,null))['catch'](handleError(_0x1bdfd3,null));};exports[_0xe067('0x3a')]=function(_0x5239ba,_0x1a4506){if(_0x5239ba['body']['id']){delete _0x5239ba['body']['id'];}return db[_0xe067('0x59')]['find']({'where':{'id':_0x5239ba[_0xe067('0x58')]['id']}})[_0xe067('0x25')](handleEntityNotFound(_0x1a4506,null))[_0xe067('0x25')](saveUpdates(_0x5239ba[_0xe067('0x5d')],null))[_0xe067('0x25')](respondWithResult(_0x1a4506,null))[_0xe067('0x56')](handleError(_0x1a4506,null));};exports[_0xe067('0x5e')]=function(_0x2572b0,_0x1b743e){return db[_0xe067('0x59')][_0xe067('0x5c')]({'where':{'id':_0x2572b0['params']['id']}})[_0xe067('0x25')](handleEntityNotFound(_0x1b743e,null))[_0xe067('0x25')](removeEntity(_0x1b743e,null))[_0xe067('0x56')](handleError(_0x1b743e,null));};exports[_0xe067('0x5f')]=function(_0x4183b4,_0x80b3ed){return db['FaxMessage']['describe']()[_0xe067('0x25')](respondWithResult(_0x80b3ed,null))[_0xe067('0x56')](handleError(_0x80b3ed,null));};var interaction_log=require(_0xe067('0x16'))(_0xe067('0x60'));exports[_0xe067('0x61')]=function(_0x4594ef,_0x47ea73,_0x11a2ef){var _0x1e36ec={'agent':{},'channel':_0xe067('0x62')};if(_0x4594ef['body']['id']){delete _0x4594ef[_0xe067('0x5d')]['id'];}_0x4594ef['body'][_0xe067('0x63')]=!![];_0x4594ef[_0xe067('0x5d')][_0xe067('0x64')]=moment()[_0xe067('0x65')](_0xe067('0x66'));_0x4594ef[_0xe067('0x5d')]['UserId']=_0x4594ef[_0xe067('0x5d')][_0xe067('0x67')]||_0x4594ef[_0xe067('0x68')]['id'];_0x1e36ec[_0xe067('0x69')]['id']=_0x4594ef['body'][_0xe067('0x67')];return db[_0xe067('0x59')]['find']({'where':{'id':_0x4594ef[_0xe067('0x58')]['id'],'UserId':null}})[_0xe067('0x25')](handleEntityNotFound(_0x47ea73,null))[_0xe067('0x25')](saveUpdates(_0x4594ef['body'],null))[_0xe067('0x25')](function(_0x36573f){if(_0x36573f){_0x1e36ec[_0xe067('0x2d')]=_0x36573f[_0xe067('0x6a')]({'plain':!![]});return db[_0xe067('0x6b')]['find']({'where':{'id':_0x36573f[_0xe067('0x6c')]}});}return null;})[_0xe067('0x25')](handleEntityNotFound(_0x47ea73,null))[_0xe067('0x25')](function(_0x46a50a){if(_0x46a50a){return _0x46a50a['update']({'UserId':_0x4594ef[_0xe067('0x5d')][_0xe067('0x67')],'read1stAt':_[_0xe067('0x6d')](_0x46a50a[_0xe067('0x6e')])?moment()[_0xe067('0x65')](_0xe067('0x66')):undefined});}return null;})[_0xe067('0x25')](function(_0x197570){if(_0x197570){_0x1e36ec[_0xe067('0x6f')]=_0x197570['get']({'plain':!![]});interaction_log[_0xe067('0x2e')](_0xe067('0x70'),_0x4594ef[_0xe067('0x68')]['id'],_0x4594ef[_0xe067('0x68')][_0xe067('0x3d')],_0x4594ef[_0xe067('0x68')][_0xe067('0x71')],_0x1e36ec[_0xe067('0x6f')]['id'],_0x4594ef[_0xe067('0x5d')]?JSON[_0xe067('0x2a')](_0x4594ef['body']):'null');return respondWithRpcPromise(_0xe067('0x72'),'acceptMessage',_0x1e36ec);}return null;})[_0xe067('0x25')](function(_0xbc5d9b){var _0x44fc33=_0xe067('0x73')+_0xbc5d9b[_0xe067('0x2d')][_0xe067('0x74')];return db[_0xe067('0x75')]['query'](_0x44fc33,{'type':db[_0xe067('0x76')][_0xe067('0x77')]['SELECT'],'raw':!![]})['then'](function(_0x211a2f){return _0x211a2f;});})[_0xe067('0x25')](function(_0x5a2e23){if(_0x5a2e23){_0x1e36ec[_0xe067('0x2d')][_0xe067('0x78')]=_0x5a2e23[0x0];if(!_0x4594ef['body']['UserId'])return;return db[_0xe067('0x79')][_0xe067('0x5c')]({'where':{'id':_0x4594ef[_0xe067('0x5d')][_0xe067('0x67')],'role':_0xe067('0x69')},'attributes':['id',_0xe067('0x3d'),'fullname','email',_0xe067('0x7a')],'raw':!![]});}return null;})['then'](function(_0x114a5e){if(!_0x114a5e)return null;_0x1e36ec[_0xe067('0x2d')][_0xe067('0x69')]=_0x114a5e;return _0x1e36ec;})[_0xe067('0x25')](function(_0x251470){if(_0x251470){if(_0x4594ef['body']['manual']){_0x1e36ec[_0xe067('0x2d')][_0xe067('0x7b')]=util['format'](_0xe067('0x7c'),_0x4594ef[_0xe067('0x68')][_0xe067('0x3d')]);_0x1e36ec['message'][_0xe067('0x7d')]=_0x1e36ec[_0xe067('0x7d')];_0x1e36ec[_0xe067('0x2d')]['motionChannel']=_0x1e36ec[_0xe067('0x7d')];_0x1e36ec[_0xe067('0x2d')][_0xe067('0x7e')]=_0xe067('0x61');return respondWithRpcPromise(_0xe067('0x7f'),_0xe067('0x7f'),{'event':_0xe067('0x80'),'message':_0x1e36ec[_0xe067('0x2d')]},client9002)[_0xe067('0x25')](function(){return _0x1e36ec;});}return _0x1e36ec;}return null;})[_0xe067('0x25')](respondWithResult(_0x47ea73,null))[_0xe067('0x56')](handleError(_0x47ea73,null));};var interaction_log=require(_0xe067('0x16'))(_0xe067('0x60'));exports[_0xe067('0x38')]=function(_0x5bc151,_0x56c00a,_0x46007d){var _0x37036e={'agent':{},'channel':'fax'};if(_0x5bc151[_0xe067('0x5d')]['id']){delete _0x5bc151['body']['id'];}_0x5bc151[_0xe067('0x5d')][_0xe067('0x67')]=_0x5bc151[_0xe067('0x5d')][_0xe067('0x67')]||_0x5bc151[_0xe067('0x68')]['id'];_0x37036e['agent']['id']=_0x5bc151[_0xe067('0x5d')][_0xe067('0x67')];return db[_0xe067('0x59')][_0xe067('0x5c')]({'where':{'id':_0x5bc151[_0xe067('0x58')]['id'],'UserId':null}})[_0xe067('0x25')](handleEntityNotFound(_0x56c00a,null))[_0xe067('0x25')](function(_0x231592){if(_0x231592){_0x37036e['message']=_0x231592[_0xe067('0x6a')]({'plain':!![]});return db[_0xe067('0x6b')]['find']({'where':{'id':_0x231592[_0xe067('0x6c')]}});}return null;})[_0xe067('0x25')](handleEntityNotFound(_0x56c00a,null))[_0xe067('0x25')](function(_0x3c2f11){if(_0x3c2f11){_0x37036e[_0xe067('0x6f')]=_0x3c2f11[_0xe067('0x6a')]({'plain':!![]});interaction_log[_0xe067('0x2e')](_0xe067('0x81'),_0x5bc151[_0xe067('0x68')]['id'],_0x5bc151['user'][_0xe067('0x3d')],_0x5bc151['user'][_0xe067('0x71')],_0x37036e['interaction']['id'],_0x5bc151[_0xe067('0x5d')]?JSON['stringify'](_0x5bc151[_0xe067('0x5d')]):'null');return respondWithRpcPromise(_0xe067('0x82'),_0xe067('0x83'),_0x37036e);}return null;})[_0xe067('0x25')](function(_0x42a26b){var _0x38caa2=_0xe067('0x73')+_0x42a26b[_0xe067('0x2d')][_0xe067('0x74')];return db['sequelize']['query'](_0x38caa2,{'type':db[_0xe067('0x76')][_0xe067('0x77')]['SELECT'],'raw':!![]})['then'](function(_0x39c313){return _0x39c313;});})['then'](function(_0x5df321){if(_0x5df321){_0x37036e['message'][_0xe067('0x78')]=_0x5df321[0x0];if(!_0x5bc151[_0xe067('0x5d')][_0xe067('0x67')])return;return db[_0xe067('0x79')][_0xe067('0x5c')]({'where':{'id':_0x5bc151[_0xe067('0x5d')][_0xe067('0x67')],'role':_0xe067('0x69')},'attributes':['id',_0xe067('0x3d'),_0xe067('0x84'),_0xe067('0x85'),_0xe067('0x7a')],'raw':!![]});}return null;})[_0xe067('0x25')](function(_0x51d466){if(!_0x51d466)return null;_0x37036e[_0xe067('0x2d')]['agent']=_0x51d466;return _0x37036e;})[_0xe067('0x25')](function(_0x932717){if(_0x932717){_0x932717['message'][_0xe067('0x7b')]=util[_0xe067('0x65')]('SIP/%s',_0x5bc151[_0xe067('0x68')][_0xe067('0x3d')]);_0x932717['message']['channel']=_0x37036e[_0xe067('0x7d')];_0x932717[_0xe067('0x2d')][_0xe067('0x86')]=_0x37036e[_0xe067('0x7d')];_0x932717['message'][_0xe067('0x7e')]=_0xe067('0x38');respondWithRpcPromise(_0xe067('0x7f'),_0xe067('0x7f'),{'event':_0xe067('0x87'),'message':_0x932717[_0xe067('0x2d')]},client9002);return _0x37036e;}return null;})[_0xe067('0x25')](respondWithResult(_0x56c00a,null))[_0xe067('0x56')](handleError(_0x56c00a,null));};exports[_0xe067('0x88')]=function(_0x5200b6,_0x365f4e){var _0x38f70f;return db[_0xe067('0x59')][_0xe067('0x88')](_0x5200b6[_0xe067('0x5d')],{})[_0xe067('0x25')](function(_0x5361ee){_0x38f70f=_0x5361ee;return db[_0xe067('0x89')]['findOne']({'where':{'id':_0x38f70f[_0xe067('0x74')]}});})[_0xe067('0x25')](function(_0x32163d){if(_[_0xe067('0x6d')](_0x32163d)){return;}else{_0x38f70f[_0xe067('0x62')]=_0x32163d['fax'];return db[_0xe067('0x8a')][_0xe067('0x8b')]({'where':{'id':_0x38f70f[_0xe067('0x8c')]}});}})[_0xe067('0x25')](function(_0x25b9c2){return respondWithRpcPromise(_0xe067('0x8d'),_0xe067('0x8d'),{'FaxAccountId':_[_0xe067('0x6d')](_0x5200b6['body'])?undefined:_0x5200b6[_0xe067('0x5d')]['FaxAccountId'],'path':_[_0xe067('0x6d')](_0x25b9c2)?undefined:util[_0xe067('0x65')](_0xe067('0x8e'),_0x25b9c2[_0xe067('0x8f')]),'fax':_['isNil'](_0x38f70f[_0xe067('0x62')])?undefined:_0x38f70f[_0xe067('0x62')],'AttachmentId':_0x38f70f[_0xe067('0x8c')]},client9002);})['then'](respondWithResult(_0x365f4e,0xc9))[_0xe067('0x56')](handleError(_0x365f4e,null));};exports[_0xe067('0x90')]=function(_0x4ef9c2,_0x4bcacd){var _0x562b58=path[_0xe067('0x91')](config['root'],_0xe067('0x92'),_0xe067('0x93'),'attachments');return db['FaxMessage'][_0xe067('0x5c')]({'where':{'id':_0x4ef9c2[_0xe067('0x58')]['id']},'include':[{'model':db[_0xe067('0x8a')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x4bcacd,null))[_0xe067('0x25')](function(_0x2fb2fb){if(_0x2fb2fb){return _0x4bcacd[_0xe067('0x90')](path[_0xe067('0x91')](_0x562b58,_0x2fb2fb[_0xe067('0x8a')][_0xe067('0x8f')]));}})['catch'](handleError(_0x4bcacd,null));};
\ No newline at end of file
index c54e9db..295833e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6209=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6209,0x1e8));var _0x9620=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6209[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x9620('0x0'));var FaxMessage=require(_0x9620('0x1'))['db'][_0x9620('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9620('0x3')](0x0);var events={'afterCreate':_0x9620('0x4'),'afterUpdate':_0x9620('0x5'),'afterDestroy':_0x9620('0x6')};function emitEvent(_0x5deb40){return function(_0x2869e2,_0x17dc92,_0x2fa00b){FaxMessageEvents['emit'](_0x5deb40+':'+_0x2869e2['id'],_0x2869e2);FaxMessageEvents[_0x9620('0x7')](_0x5deb40,_0x2869e2);_0x2fa00b(null);};}for(var e in events){if(events[_0x9620('0x8')](e)){var event=events[e];FaxMessage[_0x9620('0x9')](e,emitEvent(event));}}module[_0x9620('0xa')]=FaxMessageEvents;
\ No newline at end of file
+var _0x1b64=['setMaxListeners','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x1d0a84,_0x5b74c0){var _0xc51c70=function(_0x36cabc){while(--_0x36cabc){_0x1d0a84['push'](_0x1d0a84['shift']());}};_0xc51c70(++_0x5b74c0);}(_0x1b64,0x76));var _0x41b6=function(_0x4b29e0,_0x39ca17){_0x4b29e0=_0x4b29e0-0x0;var _0x21d00b=_0x1b64[_0x4b29e0];return _0x21d00b;};'use strict';var EventEmitter=require(_0x41b6('0x0'));var FaxMessage=require(_0x41b6('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x41b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3204fe){return function(_0x1f979b,_0xd38c24,_0x19f577){FaxMessageEvents['emit'](_0x3204fe+':'+_0x1f979b['id'],_0x1f979b);FaxMessageEvents[_0x41b6('0x3')](_0x3204fe,_0x1f979b);_0x19f577(null);};}for(var e in events){if(events[_0x41b6('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index fefd483..10f0cff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b62=['toLowerCase','out','secret','isNil','UserId','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxMessage.attributes','exports','define','fti_fax_messages','FULLTEXT','models','get','direction'];(function(_0x2990f2,_0x3793a8){var _0xd6d649=function(_0xad8bad){while(--_0xad8bad){_0x2990f2['push'](_0x2990f2['shift']());}};_0xd6d649(++_0x3793a8);}(_0x0b62,0xec));var _0x20b6=function(_0x4e30ba,_0x5932a1){_0x4e30ba=_0x4e30ba-0x0;var _0x1c8ac4=_0x0b62[_0x4e30ba];return _0x1c8ac4;};'use strict';var _=require('lodash');var util=require(_0x20b6('0x0'));var logger=require(_0x20b6('0x1'))(_0x20b6('0x2'));var moment=require(_0x20b6('0x3'));var BPromise=require(_0x20b6('0x4'));var rp=require(_0x20b6('0x5'));var fs=require('fs');var path=require(_0x20b6('0x6'));var rimraf=require(_0x20b6('0x7'));var config=require('../../config/environment');var attributes=require(_0x20b6('0x8'));module[_0x20b6('0x9')]=function(_0x596944,_0x340f6e){return _0x596944[_0x20b6('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x20b6('0xb'),'fields':['body'],'type':_0x20b6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x120a6a,_0x1224a9,_0x4dc19d){var _0x1fd4ac=_0x596944[_0x20b6('0xd')];var _0x130f1d=_0x120a6a[_0x20b6('0xe')]({'plain':!![]});if(_0x130f1d[_0x20b6('0xf')][_0x20b6('0x10')]()==='in'||_0x130f1d[_0x20b6('0xf')][_0x20b6('0x10')]()===_0x20b6('0x11')&&!_0x130f1d[_0x20b6('0x12')]&&!_[_0x20b6('0x13')](_0x130f1d[_0x20b6('0x14')])){_0x1fd4ac['FaxInteraction']['findOne']({'where':{'id':_0x130f1d[_0x20b6('0x15')]}})[_0x20b6('0x16')](function(_0xbe2c09){if(_0xbe2c09){_0xbe2c09[_0x20b6('0x17')]({'lastMsgAt':_0x130f1d[_0x20b6('0x18')],'lastMsgDirection':_0x130f1d[_0x20b6('0xf')]['toLowerCase']()});}})[_0x20b6('0x19')](function(_0x28c447){console[_0x20b6('0x1a')](_0x28c447);});}_0x4dc19d();}},'charset':_0x20b6('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2b5c=['./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','direction','out','secret','isNil','UserId','findOne','FaxInteractionId','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x42c445,_0x41cf5b){var _0x4f9158=function(_0x3ad169){while(--_0x3ad169){_0x42c445['push'](_0x42c445['shift']());}};_0x4f9158(++_0x41cf5b);}(_0x2b5c,0x1b9));var _0xc2b5=function(_0x206bde,_0x2bc75f){_0x206bde=_0x206bde-0x0;var _0x368007=_0x2b5c[_0x206bde];return _0x368007;};'use strict';var _=require(_0xc2b5('0x0'));var util=require(_0xc2b5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc2b5('0x2'));var BPromise=require(_0xc2b5('0x3'));var rp=require(_0xc2b5('0x4'));var fs=require('fs');var path=require(_0xc2b5('0x5'));var rimraf=require('rimraf');var config=require(_0xc2b5('0x6'));var attributes=require(_0xc2b5('0x7'));module[_0xc2b5('0x8')]=function(_0x59c974,_0x3d9d96){return _0x59c974['define'](_0xc2b5('0x9'),attributes,{'tableName':_0xc2b5('0xa'),'paranoid':![],'indexes':[{'name':_0xc2b5('0xb'),'fields':[_0xc2b5('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x332e1a,_0x169495,_0x3498e9){var _0x548830=_0x59c974[_0xc2b5('0xd')];var _0x3888f2=_0x332e1a['get']({'plain':!![]});if(_0x3888f2['direction']['toLowerCase']()==='in'||_0x3888f2[_0xc2b5('0xe')]['toLowerCase']()===_0xc2b5('0xf')&&!_0x3888f2[_0xc2b5('0x10')]&&!_[_0xc2b5('0x11')](_0x3888f2[_0xc2b5('0x12')])){_0x548830['FaxInteraction'][_0xc2b5('0x13')]({'where':{'id':_0x3888f2[_0xc2b5('0x14')]}})['then'](function(_0x8279f0){if(_0x8279f0){_0x8279f0[_0xc2b5('0x15')]({'lastMsgAt':_0x3888f2[_0xc2b5('0x16')],'lastMsgDirection':_0x3888f2[_0xc2b5('0xe')][_0xc2b5('0x17')]()});}})[_0xc2b5('0x18')](function(_0x287b1b){console[_0xc2b5('0x19')](_0x287b1b);});}_0x3498e9();}},'charset':_0xc2b5('0x1a'),'collate':_0xc2b5('0x1b')});};
\ No newline at end of file
index c4ee9e7..6f9f939 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4cad64,_0x13a1d1){var _0x1ebb2d=function(_0x564d94){while(--_0x564d94){_0x4cad64['push'](_0x4cad64['shift']());}};_0x1ebb2d(++_0x13a1d1);}(_0xd2ea,0x15f));var _0xad2e=function(_0x4c9c47,_0x28a81c){_0x4c9c47=_0x4c9c47-0x0;var _0x47563e=_0xd2ea[_0x4c9c47];return _0x47563e;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});};
\ No newline at end of file
+var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0xa8785c,_0x2f5a6a){var _0x59f57f=function(_0x295d7f){while(--_0x295d7f){_0xa8785c['push'](_0xa8785c['shift']());}};_0x59f57f(++_0x2f5a6a);}(_0x9f62,0x154));var _0x29f6=function(_0x322d33,_0x39d776){_0x322d33=_0x322d33-0x0;var _0x4d3f8b=_0x9f62[_0x322d33];return _0x4d3f8b;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});};
\ No newline at end of file
index 6717352..6244532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc986=['removeListener','length','faxMessage:','./faxMessage.events','save','update','emit'];(function(_0x60c642,_0xd270ca){var _0xd32484=function(_0x1234b6){while(--_0x1234b6){_0x60c642['push'](_0x60c642['shift']());}};_0xd32484(++_0xd270ca);}(_0xc986,0x176));var _0x6c98=function(_0xc19b38,_0x535577){_0xc19b38=_0xc19b38-0x0;var _0x2d3082=_0xc986[_0xc19b38];return _0x2d3082;};'use strict';var FaxMessageEvents=require(_0x6c98('0x0'));var events=[_0x6c98('0x1'),'remove',_0x6c98('0x2')];function createListener(_0x503301,_0x5aa80b){return function(_0x3692a9){_0x5aa80b[_0x6c98('0x3')](_0x503301,_0x3692a9);};}function removeListener(_0x5c0b05,_0x3a4159){return function(){FaxMessageEvents[_0x6c98('0x4')](_0x5c0b05,_0x3a4159);};}exports['register']=function(_0x5c4a39){for(var _0xcccd6d=0x0,_0x158ff6=events[_0x6c98('0x5')];_0xcccd6d<_0x158ff6;_0xcccd6d++){var _0x308d13=events[_0xcccd6d];var _0x248f9c=createListener(_0x6c98('0x6')+_0x308d13,_0x5c4a39);FaxMessageEvents['on'](_0x308d13,_0x248f9c);}};
\ No newline at end of file
+var _0x1518=['register','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x45c9d9,_0x27eced){var _0x244d0a=function(_0x44b360){while(--_0x44b360){_0x45c9d9['push'](_0x45c9d9['shift']());}};_0x244d0a(++_0x27eced);}(_0x1518,0x10c));var _0x8151=function(_0x50097a,_0x3d5415){_0x50097a=_0x50097a-0x0;var _0x33abcc=_0x1518[_0x50097a];return _0x33abcc;};'use strict';var FaxMessageEvents=require(_0x8151('0x0'));var events=[_0x8151('0x1'),_0x8151('0x2'),_0x8151('0x3')];function createListener(_0x459e52,_0x39b238){return function(_0x1f37e7){_0x39b238[_0x8151('0x4')](_0x459e52,_0x1f37e7);};}function removeListener(_0x491ab3,_0x1c5c61){return function(){FaxMessageEvents['removeListener'](_0x491ab3,_0x1c5c61);};}exports[_0x8151('0x5')]=function(_0x33ffc7){for(var _0xabf041=0x0,_0x38f49f=events['length'];_0xabf041<_0x38f49f;_0xabf041++){var _0x2a4a80=events[_0xabf041];var _0x46d9be=createListener(_0x8151('0x6')+_0x2a4a80,_0x33ffc7);FaxMessageEvents['on'](_0x2a4a80,_0x46d9be);}};
\ No newline at end of file
index 9c81634..d537f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87e=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxMessage.controller','isAuthenticated','/describe','describe','get','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/accept','accept','reject','delete','/:id','destroy','exports','multer'];(function(_0x4452d2,_0x623e6d){var _0x361c20=function(_0x32e340){while(--_0x32e340){_0x4452d2['push'](_0x4452d2['shift']());}};_0x361c20(++_0x623e6d);}(_0xd87e,0x1bf));var _0xed87=function(_0x3aac36,_0x287fe1){_0x3aac36=_0x3aac36-0x0;var _0x519fe0=_0xd87e[_0x3aac36];return _0x519fe0;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),interaction[_0xed87('0x10')](_0xed87('0x11'),'faxmessage:create'),controller[_0xed87('0x12')]);router[_0xed87('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xed87('0x14')]);router[_0xed87('0x13')](_0xed87('0x15'),auth[_0xed87('0x8')](),controller[_0xed87('0x16')]);router[_0xed87('0x13')]('/:id/reject',auth[_0xed87('0x8')](),controller[_0xed87('0x17')]);router[_0xed87('0x18')](_0xed87('0x19'),auth[_0xed87('0x8')](),controller[_0xed87('0x1a')]);module[_0xed87('0x1b')]=router;
\ No newline at end of file
+var _0xbf6e=['accept','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept'];(function(_0x180bc5,_0x17fd8d){var _0x310566=function(_0x5cf9fd){while(--_0x5cf9fd){_0x180bc5['push'](_0x180bc5['shift']());}};_0x310566(++_0x17fd8d);}(_0xbf6e,0x149));var _0xebf6=function(_0x54ee20,_0x1c2fa7){_0x54ee20=_0x54ee20-0x0;var _0x4ce8ac=_0xbf6e[_0x54ee20];return _0x4ce8ac;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['describe']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0x8')](_0xebf6('0xd'),auth['isAuthenticated'](),controller[_0xebf6('0xe')]);router[_0xebf6('0xf')]('/',auth[_0xebf6('0x9')](),interaction[_0xebf6('0x10')](_0xebf6('0x11'),_0xebf6('0x12')),controller['create']);router[_0xebf6('0x13')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x14')]);router[_0xebf6('0x13')](_0xebf6('0x15'),auth[_0xebf6('0x9')](),controller[_0xebf6('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xebf6('0x17')]);router[_0xebf6('0x18')]('/:id',auth[_0xebf6('0x9')](),controller[_0xebf6('0x19')]);module[_0xebf6('0x1a')]=router;
\ No newline at end of file
index b5d01b2..9c65fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9b=['ENUM','beepall','roundrobin','INTEGER','sequelize','exports','STRING','name'];(function(_0x51b51a,_0x2f156c){var _0x40bcd6=function(_0x429572){while(--_0x429572){_0x51b51a['push'](_0x51b51a['shift']());}};_0x40bcd6(++_0x2f156c);}(_0xca9b,0x194));var _0xbca9=function(_0x6ac095,_0x5e6e99){_0x6ac095=_0x6ac095-0x0;var _0x37cb75=_0xca9b[_0x6ac095];return _0x37cb75;};'use strict';var Sequelize=require(_0xbca9('0x0'));module[_0xbca9('0x1')]={'name':{'type':Sequelize[_0xbca9('0x2')],'unique':_0xbca9('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbca9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbca9('0x4')]('rrmemory',_0xbca9('0x5'),_0xbca9('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbca9('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7019=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','name'];(function(_0x3d8e26,_0xee242d){var _0x322d42=function(_0x3ead66){while(--_0x3ead66){_0x3d8e26['push'](_0x3d8e26['shift']());}};_0x322d42(++_0xee242d);}(_0x7019,0x16d));var _0x9701=function(_0x544a43,_0x110c81){_0x544a43=_0x544a43-0x0;var _0x5d98ac=_0x7019[_0x544a43];return _0x5d98ac;};'use strict';var Sequelize=require(_0x9701('0x0'));module['exports']={'name':{'type':Sequelize[_0x9701('0x1')],'unique':_0x9701('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9701('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9701('0x4')](_0x9701('0x5'),_0x9701('0x6'),_0x9701('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 429b554..867e404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec6=['getAgents','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','catch','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','SIP','getTeams','addTeams','ids','findAll','User','Agents','voicePause','interface','flatMap','sequelize','each','userFaxQueue:save','removeTeams','Team','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','transaction','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','emit','removeAgents','isArray'];(function(_0x591142,_0x17f4c7){var _0x5e7a97=function(_0x43dbe1){while(--_0x43dbe1){_0x591142['push'](_0x591142['shift']());}};_0x5e7a97(++_0x17f4c7);}(_0x9ec6,0x117));var _0x69ec=function(_0x1a014b,_0x48acae){_0x1a014b=_0x1a014b-0x0;var _0x462258=_0x9ec6[_0x1a014b];return _0x462258;};'use strict';var emlformat=require(_0x69ec('0x0'));var rimraf=require(_0x69ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x69ec('0x2'));var moment=require(_0x69ec('0x3'));var BPromise=require(_0x69ec('0x4'));var Mustache=require(_0x69ec('0x5'));var util=require(_0x69ec('0x6'));var path=require(_0x69ec('0x7'));var sox=require(_0x69ec('0x8'));var csv=require('to-csv');var ejs=require(_0x69ec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x69ec('0xa'));var crypto=require(_0x69ec('0xb'));var jsforce=require(_0x69ec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x69ec('0xd'));var querystring=require(_0x69ec('0xe'));var Papa=require(_0x69ec('0xf'));var Redis=require(_0x69ec('0x10'));var authService=require(_0x69ec('0x11'));var qs=require(_0x69ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69ec('0x13'));var logger=require(_0x69ec('0x14'))(_0x69ec('0x15'));var utils=require('../../config/utils');var config=require(_0x69ec('0x16'));var licenseUtil=require(_0x69ec('0x17'));var db=require('../../mysqldb')['db'];config[_0x69ec('0x18')]=_[_0x69ec('0x19')](config[_0x69ec('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x69ec('0x1a'))(new Redis(config['redis']));require(_0x69ec('0x1b'))['register'](socket);function respondWithStatusCode(_0xb7dded,_0x2d3180){_0x2d3180=_0x2d3180||0xcc;return function(_0x23a385){if(_0x23a385){return _0xb7dded[_0x69ec('0x1c')](_0x2d3180);}return _0xb7dded[_0x69ec('0x1d')](_0x2d3180)[_0x69ec('0x1e')]();};}function respondWithResult(_0x55ee13,_0xc4f90f){_0xc4f90f=_0xc4f90f||0xc8;return function(_0x3c15aa){if(_0x3c15aa){return _0x55ee13[_0x69ec('0x1d')](_0xc4f90f)['json'](_0x3c15aa);}};}function respondWithFilteredResult(_0x520697,_0x427510){return function(_0x3ad73b){if(_0x3ad73b){var _0x313c80=typeof _0x427510[_0x69ec('0x1f')]===_0x69ec('0x20')&&typeof _0x427510[_0x69ec('0x21')]===_0x69ec('0x20');var _0x28ffe3=_0x3ad73b[_0x69ec('0x22')];var _0x3be7c3=_0x313c80?0x0:_0x427510[_0x69ec('0x1f')];var _0x2ef538=_0x313c80?_0x3ad73b[_0x69ec('0x22')]:_0x427510[_0x69ec('0x1f')]+_0x427510[_0x69ec('0x21')];var _0x29c80f;if(_0x2ef538>=_0x28ffe3){_0x2ef538=_0x28ffe3;_0x29c80f=0xc8;}else{_0x29c80f=0xce;}_0x520697['status'](_0x29c80f);return _0x520697[_0x69ec('0x23')]('Content-Range',_0x3be7c3+'-'+_0x2ef538+'/'+_0x28ffe3)['json'](_0x3ad73b);}return null;};}function patchUpdates(_0x5e4764){return function(_0x4a5972){try{jsonpatch[_0x69ec('0x24')](_0x4a5972,_0x5e4764,!![]);}catch(_0x29c404){return BPromise[_0x69ec('0x25')](_0x29c404);}return _0x4a5972['save']();};}function saveUpdates(_0x313673,_0x3de3f9){return function(_0x3c4660){if(_0x3c4660){return _0x3c4660[_0x69ec('0x26')](_0x313673)[_0x69ec('0x27')](function(_0x18f2e8){return _0x18f2e8;});}return null;};}function removeEntity(_0x5e9b53,_0x3cf22e){return function(_0x5e3c63){if(_0x5e3c63){return _0x5e3c63[_0x69ec('0x28')]()[_0x69ec('0x27')](function(){var _0x5cdcf4=_0x5e3c63[_0x69ec('0x29')]({'plain':!![]});var _0x517e4a='FaxQueues';return db[_0x69ec('0x2a')][_0x69ec('0x28')]({'where':{'type':_0x517e4a,'resourceId':_0x5cdcf4['id']}})[_0x69ec('0x27')](function(){return _0x5e3c63;});})[_0x69ec('0x27')](function(){_0x5e9b53['status'](0xcc)[_0x69ec('0x1e')]();});}};}function handleEntityNotFound(_0x4456e0,_0x200ce0){return function(_0x4ce5a5){if(!_0x4ce5a5){_0x4456e0[_0x69ec('0x1c')](0x194);}return _0x4ce5a5;};}function handleError(_0x5bdf82,_0x1883a4){_0x1883a4=_0x1883a4||0x1f4;return function(_0xea2925){logger['error'](_0xea2925[_0x69ec('0x2b')]);if(_0xea2925['name']){delete _0xea2925[_0x69ec('0x2c')];}_0x5bdf82[_0x69ec('0x1d')](_0x1883a4)['send'](_0xea2925);};}exports['index']=function(_0x5bf4a5,_0x2767e6){var _0x1c14a9={},_0x309110={},_0x270e02={'count':0x0,'rows':[]};var _0x5f228c=_[_0x69ec('0x2d')](db[_0x69ec('0x2e')][_0x69ec('0x2f')],function(_0x1bcccc){return{'name':_0x1bcccc[_0x69ec('0x30')],'type':_0x1bcccc[_0x69ec('0x31')][_0x69ec('0x32')]};});_0x309110[_0x69ec('0x33')]=_[_0x69ec('0x2d')](_0x5f228c,_0x69ec('0x2c'));_0x309110[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x5bf4a5['query']);_0x309110[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x309110['model'],_0x309110[_0x69ec('0x34')]);_0x1c14a9[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x309110[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x5bf4a5[_0x69ec('0x34')]['fields']));_0x1c14a9[_0x69ec('0x38')]=_0x1c14a9[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x1c14a9[_0x69ec('0x38')]:_0x309110['model'];if(!_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x3b')](_0x69ec('0x3c'))){_0x1c14a9['limit']=qs['limit'](_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x21')]);_0x1c14a9[_0x69ec('0x1f')]=qs['offset'](_0x5bf4a5[_0x69ec('0x34')]['offset']);}_0x1c14a9[_0x69ec('0x3d')]=qs[_0x69ec('0x3e')](_0x5bf4a5['query']['sort']);_0x1c14a9[_0x69ec('0x3f')]=qs[_0x69ec('0x36')](_[_0x69ec('0x40')](_0x5bf4a5[_0x69ec('0x34')],_0x309110[_0x69ec('0x36')]),_0x5f228c);if(_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x41')]){_0x1c14a9[_0x69ec('0x3f')]=_['merge'](_0x1c14a9['where'],{'$or':_[_0x69ec('0x2d')](_0x5f228c,function(_0x5c96c3){if(_0x5c96c3[_0x69ec('0x31')]!==_0x69ec('0x42')){var _0x5e82bd={};_0x5e82bd[_0x5c96c3[_0x69ec('0x2c')]]={'$like':'%'+_0x5bf4a5['query'][_0x69ec('0x41')]+'%'};return _0x5e82bd;}})});}_0x1c14a9=_[_0x69ec('0x43')]({},_0x1c14a9,_0x5bf4a5[_0x69ec('0x44')]);var _0xcd651d={'where':_0x1c14a9[_0x69ec('0x3f')]};return db[_0x69ec('0x2e')][_0x69ec('0x22')](_0xcd651d)[_0x69ec('0x27')](function(_0x49216a){_0x270e02[_0x69ec('0x22')]=_0x49216a;if(_0x5bf4a5[_0x69ec('0x34')][_0x69ec('0x45')]){_0x1c14a9['include']=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x1c14a9);})[_0x69ec('0x27')](function(_0x373f64){_0x270e02['rows']=_0x373f64;return _0x270e02;})['then'](respondWithFilteredResult(_0x2767e6,_0x1c14a9))[_0x69ec('0x46')](handleError(_0x2767e6,null));};exports['show']=function(_0x4c8d7e,_0x13864a){var _0x39a06e={'raw':!![],'where':{'id':_0x4c8d7e['params']['id']}},_0x4846fd={};_0x4846fd['model']=_[_0x69ec('0x35')](db['FaxQueue']['rawAttributes']);_0x4846fd['query']=_[_0x69ec('0x35')](_0x4c8d7e[_0x69ec('0x34')]);_0x4846fd[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x4846fd['model'],_0x4846fd[_0x69ec('0x34')]);_0x39a06e[_0x69ec('0x38')]=_['intersection'](_0x4846fd[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x4c8d7e[_0x69ec('0x34')][_0x69ec('0x39')]));_0x39a06e[_0x69ec('0x38')]=_0x39a06e[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x39a06e[_0x69ec('0x38')]:_0x4846fd['model'];if(_0x4c8d7e[_0x69ec('0x34')]['includeAll']){_0x39a06e[_0x69ec('0x47')]=[{'all':!![]}];}_0x39a06e=_['merge']({},_0x39a06e,_0x4c8d7e['options']);return db['FaxQueue'][_0x69ec('0x48')](_0x39a06e)[_0x69ec('0x27')](handleEntityNotFound(_0x13864a,null))[_0x69ec('0x27')](respondWithResult(_0x13864a,null))['catch'](handleError(_0x13864a,null));};exports[_0x69ec('0x49')]=function(_0x3f28b8,_0x3dcbcf){return db[_0x69ec('0x2e')][_0x69ec('0x49')](_0x3f28b8[_0x69ec('0x4a')],{})[_0x69ec('0x27')](function(_0x4e31f3){var _0x3fabd7=_0x3f28b8[_0x69ec('0x4b')]['get']({'plain':!![]});if(!_0x3fabd7)throw new Error(_0x69ec('0x4c'));if(_0x3fabd7[_0x69ec('0x4d')]===_0x69ec('0x4b')){var _0xfd5451=_0x4e31f3[_0x69ec('0x29')]({'plain':!![]});var _0x44d551=_0x69ec('0x4e');return db['UserProfileSection']['find']({'where':{'name':_0x44d551,'userProfileId':_0x3fabd7['userProfileId']},'raw':!![]})[_0x69ec('0x27')](function(_0x46c841){if(_0x46c841&&_0x46c841[_0x69ec('0x4f')]===0x0){return db[_0x69ec('0x2a')][_0x69ec('0x49')]({'name':_0xfd5451[_0x69ec('0x2c')],'resourceId':_0xfd5451['id'],'type':_0x46c841[_0x69ec('0x2c')],'sectionId':_0x46c841['id']},{})[_0x69ec('0x27')](function(){return _0x4e31f3;});}else{return _0x4e31f3;}})['catch'](function(_0x2bf067){logger[_0x69ec('0x50')](_0x69ec('0x51'),_0x2bf067);throw _0x2bf067;});}return _0x4e31f3;})[_0x69ec('0x27')](respondWithResult(_0x3dcbcf,0xc9))[_0x69ec('0x46')](handleError(_0x3dcbcf,null));};exports[_0x69ec('0x26')]=function(_0x2f41bf,_0x31b4bf){if(_0x2f41bf['body']['id']){delete _0x2f41bf[_0x69ec('0x4a')]['id'];}return db['FaxQueue'][_0x69ec('0x48')]({'where':{'id':_0x2f41bf[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x31b4bf,null))[_0x69ec('0x27')](saveUpdates(_0x2f41bf['body'],null))[_0x69ec('0x27')](respondWithResult(_0x31b4bf,null))['catch'](handleError(_0x31b4bf,null));};exports[_0x69ec('0x28')]=function(_0x18da00,_0x1d3e69){return db[_0x69ec('0x2e')]['find']({'where':{'id':_0x18da00['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x1d3e69,null))['then'](removeEntity(_0x1d3e69,null))[_0x69ec('0x46')](handleError(_0x1d3e69,null));};exports[_0x69ec('0x53')]=function(_0x6ea0a,_0x1805e3){return db['FaxQueue'][_0x69ec('0x53')]()[_0x69ec('0x27')](respondWithResult(_0x1805e3,null))[_0x69ec('0x46')](handleError(_0x1805e3,null));};exports[_0x69ec('0x54')]=function(_0x301151,_0x2afdef,_0x4435cc){var _0x2f3edf={'raw':!![],'where':{}},_0x131a29={},_0x28e266;return db['FaxQueue'][_0x69ec('0x55')]({'where':{'id':_0x301151['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x2afdef,null))[_0x69ec('0x27')](function(_0x2e4404){if(_0x2e4404){_0x28e266=_0x2e4404[_0x69ec('0x29')]({'plain':!![]});_0x131a29[_0x69ec('0x33')]=_[_0x69ec('0x35')](db[_0x69ec('0x56')]['rawAttributes']);_0x131a29[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x301151[_0x69ec('0x34')]);_0x131a29['filters']=_[_0x69ec('0x37')](_0x131a29[_0x69ec('0x33')],_0x131a29[_0x69ec('0x34')]);_0x2f3edf[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x131a29[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x301151[_0x69ec('0x34')][_0x69ec('0x39')]));_0x2f3edf[_0x69ec('0x38')]=_0x2f3edf[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x2f3edf[_0x69ec('0x38')]:_0x131a29[_0x69ec('0x33')];if(!_0x301151[_0x69ec('0x34')][_0x69ec('0x3b')]('nolimit')){_0x2f3edf['limit']=qs[_0x69ec('0x21')](_0x301151[_0x69ec('0x34')]['limit']);_0x2f3edf['offset']=qs['offset'](_0x301151['query'][_0x69ec('0x1f')]);}_0x2f3edf[_0x69ec('0x3d')]=qs[_0x69ec('0x3e')](_0x301151[_0x69ec('0x34')][_0x69ec('0x3e')]);_0x2f3edf[_0x69ec('0x3f')]=qs[_0x69ec('0x36')](_[_0x69ec('0x40')](_0x301151[_0x69ec('0x34')],_0x131a29[_0x69ec('0x36')]));_0x2f3edf['where'][_0x69ec('0x57')]=_0x2e4404['id'];if(_0x301151[_0x69ec('0x34')][_0x69ec('0x41')]){_0x2f3edf['where']=_[_0x69ec('0x43')](_0x2f3edf[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x2f3edf[_0x69ec('0x38')],function(_0x236f00){var _0x239135={};_0x239135[_0x236f00]={'$like':'%'+_0x301151['query'][_0x69ec('0x41')]+'%'};return _0x239135;})});}_0x2f3edf=_[_0x69ec('0x43')]({},_0x2f3edf,_0x301151[_0x69ec('0x44')]);return db[_0x69ec('0x56')]['findAll'](_0x2f3edf);}})[_0x69ec('0x27')](function(_0x53ebdd){if(_0x53ebdd){return db['User'][_0x69ec('0x58')]({'where':{'id':_[_0x69ec('0x2d')](_0x53ebdd,_0x69ec('0x59')),'role':_0x69ec('0x5a')},'attributes':['id',_0x69ec('0x2c'),_0x69ec('0x5b'),_0x69ec('0x5c'),_0x69ec('0x5d')]});}})[_0x69ec('0x27')](function(_0x2fc1ad){if(_0x2fc1ad){return{'count':_0x2fc1ad[_0x69ec('0x22')],'rows':_['map'](_0x2fc1ad[_0x69ec('0x5e')],function(_0x7edd3e){return{'membername':_0x7edd3e[_0x69ec('0x2c')],'UserId':_0x7edd3e['id'],'queue_name':_0x28e266[_0x69ec('0x2c')],'FaxQueueId':_0x28e266['id'],'interface':util['format']('%s/%s',_0x69ec('0x5f'),_0x7edd3e[_0x69ec('0x2c')]),'penalty':0x0,'paused':_0x7edd3e[_0x69ec('0x5b')],'createdAt':_0x7edd3e[_0x69ec('0x5d')],'updatedAt':_0x7edd3e[_0x69ec('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2afdef,_0x2f3edf))['catch'](handleError(_0x2afdef,null));};exports['getTeams']=function(_0x55d4fc,_0x3d1d89,_0x32a7b1){var _0x2c475a={};var _0x170bf7={};var _0x27f510;var _0x31e457;return db['FaxQueue'][_0x69ec('0x55')]({'where':{'id':_0x55d4fc[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x3d1d89,null))[_0x69ec('0x27')](function(_0x46088d){if(_0x46088d){_0x27f510=_0x46088d;_0x170bf7['model']=_['keys'](db['Team'][_0x69ec('0x2f')]);_0x170bf7[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x55d4fc[_0x69ec('0x34')]);_0x170bf7[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x170bf7[_0x69ec('0x33')],_0x170bf7['query']);_0x2c475a[_0x69ec('0x38')]=_[_0x69ec('0x37')](_0x170bf7[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x55d4fc[_0x69ec('0x34')][_0x69ec('0x39')]));_0x2c475a['attributes']=_0x2c475a[_0x69ec('0x38')]['length']?_0x2c475a['attributes']:_0x170bf7[_0x69ec('0x33')];_0x2c475a['order']=qs['sort'](_0x55d4fc['query'][_0x69ec('0x3e')]);_0x2c475a[_0x69ec('0x3f')]=qs['filters'](_[_0x69ec('0x40')](_0x55d4fc[_0x69ec('0x34')],_0x170bf7[_0x69ec('0x36')]));if(_0x55d4fc[_0x69ec('0x34')]['filter']){_0x2c475a[_0x69ec('0x3f')]=_[_0x69ec('0x43')](_0x2c475a[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x2c475a['attributes'],function(_0x1ac3c4){var _0x496a16={};_0x496a16[_0x1ac3c4]={'$like':'%'+_0x55d4fc[_0x69ec('0x34')][_0x69ec('0x41')]+'%'};return _0x496a16;})});}_0x2c475a=_['merge']({},_0x2c475a,_0x55d4fc[_0x69ec('0x44')]);return _0x27f510[_0x69ec('0x60')](_0x2c475a);}})[_0x69ec('0x27')](function(_0x5812dc){if(_0x5812dc){_0x31e457=_0x5812dc[_0x69ec('0x3a')];if(!_0x55d4fc[_0x69ec('0x34')]['hasOwnProperty']('nolimit')){_0x2c475a[_0x69ec('0x21')]=qs[_0x69ec('0x21')](_0x55d4fc[_0x69ec('0x34')]['limit']);_0x2c475a[_0x69ec('0x1f')]=qs[_0x69ec('0x1f')](_0x55d4fc[_0x69ec('0x34')]['offset']);}return _0x27f510[_0x69ec('0x60')](_0x2c475a);}})['then'](function(_0x337137){if(_0x337137){return _0x337137?{'count':_0x31e457,'rows':_0x337137}:null;}})[_0x69ec('0x27')](respondWithResult(_0x3d1d89,null))[_0x69ec('0x46')](handleError(_0x3d1d89,null));};exports[_0x69ec('0x61')]=function(_0x23976f,_0x292724,_0x9dd177){var _0x5305d5=_0x23976f[_0x69ec('0x4a')][_0x69ec('0x62')];return db['Team'][_0x69ec('0x63')]({'where':{'id':_0x5305d5},'attributes':['id'],'include':[{'model':db[_0x69ec('0x64')],'as':_0x69ec('0x65'),'attributes':['id',_0x69ec('0x2c'),'online',_0x69ec('0x66'),_0x69ec('0x67')],'raw':!![]}]})[_0x69ec('0x27')](function(_0x755c17){if(_0x755c17){var _0x31fb75=_[_0x69ec('0x68')](_0x755c17,function(_0xb883a4){var _0x3ad319=_0xb883a4[_0x69ec('0x29')]({'plain':!![]});return _0x3ad319[_0x69ec('0x65')];});return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x23976f[_0x69ec('0x52')]['id']}})['then'](function(_0x4539e3){return db[_0x69ec('0x69')]['transaction'](function(_0x5c12ba){return _0x4539e3[_0x69ec('0x61')](_0x5305d5,{'transaction':_0x5c12ba})[_0x69ec('0x27')](function(){return BPromise[_0x69ec('0x6a')](_0x31fb75,function(_0xaca918){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0xaca918['id'],'FaxQueueId':_0x23976f[_0x69ec('0x52')]['id']},'transaction':_0x5c12ba});});})[_0x69ec('0x27')](function(){_0x31fb75['forEach'](function(_0x589377){socket['emit'](_0x69ec('0x6b'),{'UserId':_0x589377['id'],'FaxQueueId':_0x4539e3['id']});});});});});}})['then'](respondWithStatusCode(_0x292724,null))['catch'](handleError(_0x292724,null));};exports[_0x69ec('0x6c')]=function(_0x4d6c0d,_0x404927,_0x48769c){return db[_0x69ec('0x6d')][_0x69ec('0x63')]({'where':{'id':_0x4d6c0d['query'][_0x69ec('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x69ec('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x404927,null))['then'](function(_0x330143){var _0x2af2ad=_[_0x69ec('0x2d')](_0x330143,'id');var _0x54284c=[];var _0x3d464f=[];var _0x35b2e0=squel[_0x69ec('0x6e')]();_0x35b2e0[_0x69ec('0x6f')](_0x69ec('0x70'))[_0x69ec('0x71')](_0x69ec('0x72'),'tq')['join'](_0x69ec('0x73'),'ut',_0x69ec('0x74'))[_0x69ec('0x3f')](_0x69ec('0x75'),_0x4d6c0d[_0x69ec('0x52')]['id']);for(var _0x5dd11c=0x0;_0x5dd11c<_0x330143[_0x69ec('0x3a')];_0x5dd11c+=0x1){let _0x202d39=_0x330143[_0x5dd11c];for(var _0x3a3739=0x0;_0x3a3739<_0x202d39['Agents']['length'];_0x3a3739+=0x1){let _0x13029d=_0x202d39[_0x69ec('0x65')][_0x3a3739];var _0x474f76=_0x35b2e0[_0x69ec('0x76')]();_0x474f76[_0x69ec('0x3f')](_0x69ec('0x77'),_0x13029d['id']);_0x3d464f[_0x69ec('0x78')](db[_0x69ec('0x69')][_0x69ec('0x34')](_0x474f76[_0x69ec('0x79')](),{'type':db[_0x69ec('0x69')][_0x69ec('0x7a')][_0x69ec('0x7b')]})['then'](function(_0x4bb3b3){if(_0x4bb3b3['length']===0x1){return _0x13029d['id'];}else{var _0x41e87a=_[_0x69ec('0x7c')](_[_0x69ec('0x2d')](_0x4bb3b3,'TeamId'),function(_0x209bcd){return _['includes'](_0x2af2ad,_0x209bcd);});if(_0x41e87a){return _0x13029d['id'];}}}));}}return BPromise[_0x69ec('0x7d')](_0x3d464f)[_0x69ec('0x27')](function(_0x5ef484){_0x54284c=_(_0x54284c)[_0x69ec('0x7e')](_0x5ef484)[_0x69ec('0x7f')]()['value']();return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x4d6c0d[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](function(_0x28c487){return db[_0x69ec('0x69')][_0x69ec('0x80')](function(_0x55b504){return _0x28c487[_0x69ec('0x6c')](_0x4d6c0d[_0x69ec('0x34')]['ids'],{'transaction':_0x55b504})['then'](function(){if(!_[_0x69ec('0x81')](_0x54284c)){return _0x28c487['removeAgents'](_0x54284c,{'transaction':_0x55b504});}})[_0x69ec('0x27')](function(){_0x54284c[_0x69ec('0x82')](function(_0x589dd7){socket['emit'](_0x69ec('0x83'),{'UserId':_0x589dd7,'FaxQueueId':_0x28c487['id']});});});});});});})[_0x69ec('0x27')](respondWithStatusCode(_0x404927,null))['catch'](handleError(_0x404927,null));};exports[_0x69ec('0x84')]=function(_0x5c3af1,_0xbc7d8d,_0x5ba1ad){return db['FaxQueue'][_0x69ec('0x48')]({'where':{'id':_0x5c3af1[_0x69ec('0x52')]['id']}})['then'](handleEntityNotFound(_0xbc7d8d,null))[_0x69ec('0x27')](function(_0x235c17){if(_0x235c17){return _0x235c17[_0x69ec('0x84')](_0x5c3af1[_0x69ec('0x4a')][_0x69ec('0x62')],_[_0x69ec('0x85')](_0x5c3af1[_0x69ec('0x4a')],[_0x69ec('0x62'),'id'])||{})[_0x69ec('0x86')](function(_0x29f4c3){for(var _0x8e3b92=0x0;_0x8e3b92<_0x5c3af1['body']['ids'][_0x69ec('0x3a')];_0x8e3b92+=0x1){socket[_0x69ec('0x87')](_0x69ec('0x6b'),{'UserId':Number(_0x5c3af1[_0x69ec('0x4a')]['ids'][_0x8e3b92]),'FaxQueueId':Number(_0x5c3af1[_0x69ec('0x52')]['id'])});}return _0x29f4c3;});}})[_0x69ec('0x27')](respondWithResult(_0xbc7d8d,null))[_0x69ec('0x46')](handleError(_0xbc7d8d,null));};exports[_0x69ec('0x88')]=function(_0x32f09b,_0x5d9f92,_0x565780){return db[_0x69ec('0x2e')][_0x69ec('0x48')]({'where':{'id':_0x32f09b['params']['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x5d9f92,null))['then'](function(_0x464c82){if(_0x464c82){return _0x464c82['removeAgents'](_0x32f09b['query']['ids'])[_0x69ec('0x27')](function(){if(_[_0x69ec('0x89')](_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')])){for(var _0x4c6d9e=0x0;_0x4c6d9e<_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')]['length'];_0x4c6d9e+=0x1){socket[_0x69ec('0x87')](_0x69ec('0x83'),{'UserId':Number(_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')][_0x4c6d9e]),'FaxQueueId':Number(_0x32f09b[_0x69ec('0x52')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x32f09b[_0x69ec('0x34')][_0x69ec('0x62')]),'FaxQueueId':Number(_0x32f09b['params']['id'])});}});}})[_0x69ec('0x27')](respondWithStatusCode(_0x5d9f92,null))[_0x69ec('0x46')](handleError(_0x5d9f92,null));};exports[_0x69ec('0x8a')]=function(_0x2b829b,_0x1b372e,_0x2d610c){var _0x198f49={};var _0x10cd0c={};var _0x11a1ab;var _0x5cad0c;return db[_0x69ec('0x2e')][_0x69ec('0x55')]({'where':{'id':_0x2b829b[_0x69ec('0x52')]['id']}})[_0x69ec('0x27')](handleEntityNotFound(_0x1b372e,null))[_0x69ec('0x27')](function(_0x535971){if(_0x535971){_0x11a1ab=_0x535971;_0x10cd0c[_0x69ec('0x33')]=_[_0x69ec('0x35')](db[_0x69ec('0x64')][_0x69ec('0x2f')]);_0x10cd0c[_0x69ec('0x34')]=_[_0x69ec('0x35')](_0x2b829b['query']);_0x10cd0c[_0x69ec('0x36')]=_[_0x69ec('0x37')](_0x10cd0c[_0x69ec('0x33')],_0x10cd0c[_0x69ec('0x34')]);_0x198f49['attributes']=_['intersection'](_0x10cd0c[_0x69ec('0x33')],qs[_0x69ec('0x39')](_0x2b829b['query'][_0x69ec('0x39')]));_0x198f49[_0x69ec('0x38')]=_0x198f49[_0x69ec('0x38')][_0x69ec('0x3a')]?_0x198f49['attributes']:_0x10cd0c[_0x69ec('0x33')];_0x198f49['order']=qs[_0x69ec('0x3e')](_0x2b829b[_0x69ec('0x34')][_0x69ec('0x3e')]);_0x198f49[_0x69ec('0x3f')]=qs['filters'](_[_0x69ec('0x40')](_0x2b829b[_0x69ec('0x34')],_0x10cd0c['filters']));if(_0x2b829b['query'][_0x69ec('0x41')]){_0x198f49[_0x69ec('0x3f')]=_[_0x69ec('0x43')](_0x198f49[_0x69ec('0x3f')],{'$or':_[_0x69ec('0x2d')](_0x198f49['attributes'],function(_0x2296b5){var _0x589354={};_0x589354[_0x2296b5]={'$like':'%'+_0x2b829b['query'][_0x69ec('0x41')]+'%'};return _0x589354;})});}_0x198f49=_[_0x69ec('0x43')]({},_0x198f49,_0x2b829b[_0x69ec('0x44')]);return _0x11a1ab[_0x69ec('0x8a')](_0x198f49);}})['then'](function(_0x3f1204){if(_0x3f1204){_0x5cad0c=_0x3f1204['length'];if(!_0x2b829b[_0x69ec('0x34')][_0x69ec('0x3b')](_0x69ec('0x3c'))){_0x198f49['limit']=qs[_0x69ec('0x21')](_0x2b829b[_0x69ec('0x34')]['limit']);_0x198f49[_0x69ec('0x1f')]=qs['offset'](_0x2b829b[_0x69ec('0x34')]['offset']);}return _0x11a1ab[_0x69ec('0x8a')](_0x198f49);}})[_0x69ec('0x27')](function(_0x553c3a){if(_0x553c3a){return _0x553c3a?{'count':_0x5cad0c,'rows':_0x553c3a}:null;}})[_0x69ec('0x27')](respondWithResult(_0x1b372e,null))[_0x69ec('0x46')](handleError(_0x1b372e,null));};
\ No newline at end of file
+var _0x2434=['removeTeams','select','field','from','team_has_fax_queues','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','spread','isArray','userFaxQueue:remove','getAgents','eml-format','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','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','undefined','count','set','Content-Range','apply','reject','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','nolimit','User','UserId','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userFaxQueue:save'];(function(_0x352963,_0x341c2b){var _0xc86a9f=function(_0x10273e){while(--_0x10273e){_0x352963['push'](_0x352963['shift']());}};_0xc86a9f(++_0x341c2b);}(_0x2434,0xa9));var _0x4243=function(_0x566db7,_0xb62d8e){_0x566db7=_0x566db7-0x0;var _0x29b6be=_0x2434[_0x566db7];return _0x29b6be;};'use strict';var emlformat=require(_0x4243('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4243('0x1'));var jsonpatch=require(_0x4243('0x2'));var rp=require(_0x4243('0x3'));var moment=require(_0x4243('0x4'));var BPromise=require(_0x4243('0x5'));var Mustache=require('mustache');var util=require(_0x4243('0x6'));var path=require(_0x4243('0x7'));var sox=require(_0x4243('0x8'));var csv=require(_0x4243('0x9'));var ejs=require(_0x4243('0xa'));var fs=require('fs');var fs_extra=require(_0x4243('0xb'));var _=require(_0x4243('0xc'));var squel=require(_0x4243('0xd'));var crypto=require(_0x4243('0xe'));var jsforce=require(_0x4243('0xf'));var deskjs=require(_0x4243('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4243('0x11'));var Papa=require(_0x4243('0x12'));var Redis=require('ioredis');var authService=require(_0x4243('0x13'));var qs=require(_0x4243('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4243('0x15'));var utils=require(_0x4243('0x16'));var config=require(_0x4243('0x17'));var licenseUtil=require(_0x4243('0x18'));var db=require(_0x4243('0x19'))['db'];config[_0x4243('0x1a')]=_['defaults'](config[_0x4243('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x4243('0x1b'))(new Redis(config[_0x4243('0x1a')]));require(_0x4243('0x1c'))['register'](socket);function respondWithStatusCode(_0x1f1c6f,_0x49acac){_0x49acac=_0x49acac||0xcc;return function(_0x514e49){if(_0x514e49){return _0x1f1c6f[_0x4243('0x1d')](_0x49acac);}return _0x1f1c6f[_0x4243('0x1e')](_0x49acac)[_0x4243('0x1f')]();};}function respondWithResult(_0x344971,_0x16dc0d){_0x16dc0d=_0x16dc0d||0xc8;return function(_0x3337fb){if(_0x3337fb){return _0x344971[_0x4243('0x1e')](_0x16dc0d)[_0x4243('0x20')](_0x3337fb);}};}function respondWithFilteredResult(_0x130ecd,_0x546d84){return function(_0x343c65){if(_0x343c65){var _0x3a6b64=typeof _0x546d84['offset']===_0x4243('0x21')&&typeof _0x546d84['limit']===_0x4243('0x21');var _0x56358a=_0x343c65[_0x4243('0x22')];var _0x430a1a=_0x3a6b64?0x0:_0x546d84['offset'];var _0x885f5a=_0x3a6b64?_0x343c65[_0x4243('0x22')]:_0x546d84['offset']+_0x546d84['limit'];var _0x48937e;if(_0x885f5a>=_0x56358a){_0x885f5a=_0x56358a;_0x48937e=0xc8;}else{_0x48937e=0xce;}_0x130ecd[_0x4243('0x1e')](_0x48937e);return _0x130ecd[_0x4243('0x23')](_0x4243('0x24'),_0x430a1a+'-'+_0x885f5a+'/'+_0x56358a)[_0x4243('0x20')](_0x343c65);}return null;};}function patchUpdates(_0x230453){return function(_0x4c2d96){try{jsonpatch[_0x4243('0x25')](_0x4c2d96,_0x230453,!![]);}catch(_0x4c22dd){return BPromise[_0x4243('0x26')](_0x4c22dd);}return _0x4c2d96['save']();};}function saveUpdates(_0xa2491b,_0x35828a){return function(_0x4eb780){if(_0x4eb780){return _0x4eb780[_0x4243('0x27')](_0xa2491b)[_0x4243('0x28')](function(_0x5bf5b4){return _0x5bf5b4;});}return null;};}function removeEntity(_0x5007e2,_0x284984){return function(_0x37757a){if(_0x37757a){return _0x37757a[_0x4243('0x29')]()[_0x4243('0x28')](function(){var _0x2ef5ff=_0x37757a['get']({'plain':!![]});var _0x555ab1=_0x4243('0x2a');return db[_0x4243('0x2b')][_0x4243('0x29')]({'where':{'type':_0x555ab1,'resourceId':_0x2ef5ff['id']}})['then'](function(){return _0x37757a;});})[_0x4243('0x28')](function(){_0x5007e2[_0x4243('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cdb26,_0x24eb8f){return function(_0x336d8e){if(!_0x336d8e){_0x1cdb26[_0x4243('0x1d')](0x194);}return _0x336d8e;};}function handleError(_0x523e10,_0x4ae2db){_0x4ae2db=_0x4ae2db||0x1f4;return function(_0x20f06b){logger[_0x4243('0x2c')](_0x20f06b[_0x4243('0x2d')]);if(_0x20f06b[_0x4243('0x2e')]){delete _0x20f06b['name'];}_0x523e10[_0x4243('0x1e')](_0x4ae2db)[_0x4243('0x2f')](_0x20f06b);};}exports[_0x4243('0x30')]=function(_0x43e1d1,_0x100679){var _0x5bee41={},_0x58bc59={},_0x2e3b24={'count':0x0,'rows':[]};var _0x9546ec=_[_0x4243('0x31')](db[_0x4243('0x32')][_0x4243('0x33')],function(_0x263a85){return{'name':_0x263a85[_0x4243('0x34')],'type':_0x263a85[_0x4243('0x35')][_0x4243('0x36')]};});_0x58bc59[_0x4243('0x37')]=_[_0x4243('0x31')](_0x9546ec,'name');_0x58bc59[_0x4243('0x38')]=_[_0x4243('0x39')](_0x43e1d1[_0x4243('0x38')]);_0x58bc59[_0x4243('0x3a')]=_['intersection'](_0x58bc59['model'],_0x58bc59[_0x4243('0x38')]);_0x5bee41[_0x4243('0x3b')]=_[_0x4243('0x3c')](_0x58bc59[_0x4243('0x37')],qs[_0x4243('0x3d')](_0x43e1d1[_0x4243('0x38')][_0x4243('0x3d')]));_0x5bee41[_0x4243('0x3b')]=_0x5bee41[_0x4243('0x3b')][_0x4243('0x3e')]?_0x5bee41[_0x4243('0x3b')]:_0x58bc59[_0x4243('0x37')];if(!_0x43e1d1[_0x4243('0x38')][_0x4243('0x3f')]('nolimit')){_0x5bee41['limit']=qs[_0x4243('0x40')](_0x43e1d1['query'][_0x4243('0x40')]);_0x5bee41[_0x4243('0x41')]=qs[_0x4243('0x41')](_0x43e1d1[_0x4243('0x38')]['offset']);}_0x5bee41[_0x4243('0x42')]=qs[_0x4243('0x43')](_0x43e1d1[_0x4243('0x38')][_0x4243('0x43')]);_0x5bee41[_0x4243('0x44')]=qs[_0x4243('0x3a')](_[_0x4243('0x45')](_0x43e1d1[_0x4243('0x38')],_0x58bc59[_0x4243('0x3a')]),_0x9546ec);if(_0x43e1d1[_0x4243('0x38')][_0x4243('0x46')]){_0x5bee41[_0x4243('0x44')]=_[_0x4243('0x47')](_0x5bee41[_0x4243('0x44')],{'$or':_[_0x4243('0x31')](_0x9546ec,function(_0x21a46a){if(_0x21a46a[_0x4243('0x35')]!==_0x4243('0x48')){var _0x2a3d98={};_0x2a3d98[_0x21a46a[_0x4243('0x2e')]]={'$like':'%'+_0x43e1d1[_0x4243('0x38')][_0x4243('0x46')]+'%'};return _0x2a3d98;}})});}_0x5bee41=_[_0x4243('0x47')]({},_0x5bee41,_0x43e1d1[_0x4243('0x49')]);var _0x3c0f95={'where':_0x5bee41['where']};return db[_0x4243('0x32')][_0x4243('0x22')](_0x3c0f95)[_0x4243('0x28')](function(_0xdda97e){_0x2e3b24[_0x4243('0x22')]=_0xdda97e;if(_0x43e1d1[_0x4243('0x38')]['includeAll']){_0x5bee41[_0x4243('0x4a')]=[{'all':!![]}];}return db[_0x4243('0x32')][_0x4243('0x4b')](_0x5bee41);})[_0x4243('0x28')](function(_0x35ce6b){_0x2e3b24[_0x4243('0x4c')]=_0x35ce6b;return _0x2e3b24;})[_0x4243('0x28')](respondWithFilteredResult(_0x100679,_0x5bee41))[_0x4243('0x4d')](handleError(_0x100679,null));};exports['show']=function(_0x39f1fa,_0x10c251){var _0x453a3b={'raw':!![],'where':{'id':_0x39f1fa['params']['id']}},_0x53b7c3={};_0x53b7c3[_0x4243('0x37')]=_[_0x4243('0x39')](db[_0x4243('0x32')][_0x4243('0x33')]);_0x53b7c3[_0x4243('0x38')]=_[_0x4243('0x39')](_0x39f1fa[_0x4243('0x38')]);_0x53b7c3[_0x4243('0x3a')]=_[_0x4243('0x3c')](_0x53b7c3[_0x4243('0x37')],_0x53b7c3['query']);_0x453a3b['attributes']=_[_0x4243('0x3c')](_0x53b7c3['model'],qs['fields'](_0x39f1fa[_0x4243('0x38')]['fields']));_0x453a3b[_0x4243('0x3b')]=_0x453a3b['attributes']['length']?_0x453a3b[_0x4243('0x3b')]:_0x53b7c3[_0x4243('0x37')];if(_0x39f1fa[_0x4243('0x38')][_0x4243('0x4e')]){_0x453a3b[_0x4243('0x4a')]=[{'all':!![]}];}_0x453a3b=_[_0x4243('0x47')]({},_0x453a3b,_0x39f1fa[_0x4243('0x49')]);return db[_0x4243('0x32')][_0x4243('0x4f')](_0x453a3b)[_0x4243('0x28')](handleEntityNotFound(_0x10c251,null))[_0x4243('0x28')](respondWithResult(_0x10c251,null))[_0x4243('0x4d')](handleError(_0x10c251,null));};exports[_0x4243('0x50')]=function(_0x12b6bd,_0x4ec966){return db[_0x4243('0x32')][_0x4243('0x50')](_0x12b6bd[_0x4243('0x51')],{})['then'](function(_0x174691){var _0x3895a0=_0x12b6bd[_0x4243('0x52')][_0x4243('0x53')]({'plain':!![]});if(!_0x3895a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3895a0[_0x4243('0x54')]===_0x4243('0x52')){var _0x31d6f9=_0x174691[_0x4243('0x53')]({'plain':!![]});var _0x1935b0=_0x4243('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x1935b0,'userProfileId':_0x3895a0[_0x4243('0x55')]},'raw':!![]})[_0x4243('0x28')](function(_0x45c98e){if(_0x45c98e&&_0x45c98e[_0x4243('0x56')]===0x0){return db[_0x4243('0x2b')][_0x4243('0x50')]({'name':_0x31d6f9[_0x4243('0x2e')],'resourceId':_0x31d6f9['id'],'type':_0x45c98e[_0x4243('0x2e')],'sectionId':_0x45c98e['id']},{})[_0x4243('0x28')](function(){return _0x174691;});}else{return _0x174691;}})[_0x4243('0x4d')](function(_0x4281d9){logger[_0x4243('0x2c')](_0x4243('0x57'),_0x4281d9);throw _0x4281d9;});}return _0x174691;})[_0x4243('0x28')](respondWithResult(_0x4ec966,0xc9))[_0x4243('0x4d')](handleError(_0x4ec966,null));};exports[_0x4243('0x27')]=function(_0x36963b,_0x45dd00){if(_0x36963b[_0x4243('0x51')]['id']){delete _0x36963b[_0x4243('0x51')]['id'];}return db[_0x4243('0x32')][_0x4243('0x4f')]({'where':{'id':_0x36963b[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x45dd00,null))[_0x4243('0x28')](saveUpdates(_0x36963b[_0x4243('0x51')],null))[_0x4243('0x28')](respondWithResult(_0x45dd00,null))[_0x4243('0x4d')](handleError(_0x45dd00,null));};exports[_0x4243('0x29')]=function(_0x53b29c,_0x1e5e6e){return db[_0x4243('0x32')][_0x4243('0x4f')]({'where':{'id':_0x53b29c[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x1e5e6e,null))[_0x4243('0x28')](removeEntity(_0x1e5e6e,null))[_0x4243('0x4d')](handleError(_0x1e5e6e,null));};exports[_0x4243('0x59')]=function(_0x150f78,_0xaa4d5f){return db[_0x4243('0x32')][_0x4243('0x59')]()['then'](respondWithResult(_0xaa4d5f,null))[_0x4243('0x4d')](handleError(_0xaa4d5f,null));};exports[_0x4243('0x5a')]=function(_0x4e89fb,_0xd2461c,_0x2bda96){var _0x33912d={'raw':!![],'where':{}},_0x363e2e={},_0x2dcf6f;return db[_0x4243('0x32')][_0x4243('0x5b')]({'where':{'id':_0x4e89fb[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0xd2461c,null))[_0x4243('0x28')](function(_0x6eac4f){if(_0x6eac4f){_0x2dcf6f=_0x6eac4f['get']({'plain':!![]});_0x363e2e[_0x4243('0x37')]=_[_0x4243('0x39')](db[_0x4243('0x5c')][_0x4243('0x33')]);_0x363e2e[_0x4243('0x38')]=_[_0x4243('0x39')](_0x4e89fb[_0x4243('0x38')]);_0x363e2e[_0x4243('0x3a')]=_[_0x4243('0x3c')](_0x363e2e['model'],_0x363e2e[_0x4243('0x38')]);_0x33912d['attributes']=_[_0x4243('0x3c')](_0x363e2e[_0x4243('0x37')],qs['fields'](_0x4e89fb[_0x4243('0x38')][_0x4243('0x3d')]));_0x33912d[_0x4243('0x3b')]=_0x33912d[_0x4243('0x3b')][_0x4243('0x3e')]?_0x33912d[_0x4243('0x3b')]:_0x363e2e[_0x4243('0x37')];if(!_0x4e89fb[_0x4243('0x38')][_0x4243('0x3f')](_0x4243('0x5d'))){_0x33912d[_0x4243('0x40')]=qs['limit'](_0x4e89fb[_0x4243('0x38')]['limit']);_0x33912d[_0x4243('0x41')]=qs[_0x4243('0x41')](_0x4e89fb[_0x4243('0x38')][_0x4243('0x41')]);}_0x33912d[_0x4243('0x42')]=qs[_0x4243('0x43')](_0x4e89fb[_0x4243('0x38')][_0x4243('0x43')]);_0x33912d[_0x4243('0x44')]=qs[_0x4243('0x3a')](_['pick'](_0x4e89fb[_0x4243('0x38')],_0x363e2e[_0x4243('0x3a')]));_0x33912d[_0x4243('0x44')]['FaxQueueId']=_0x6eac4f['id'];if(_0x4e89fb[_0x4243('0x38')][_0x4243('0x46')]){_0x33912d[_0x4243('0x44')]=_[_0x4243('0x47')](_0x33912d[_0x4243('0x44')],{'$or':_[_0x4243('0x31')](_0x33912d[_0x4243('0x3b')],function(_0x2ceebe){var _0x28afa8={};_0x28afa8[_0x2ceebe]={'$like':'%'+_0x4e89fb[_0x4243('0x38')][_0x4243('0x46')]+'%'};return _0x28afa8;})});}_0x33912d=_[_0x4243('0x47')]({},_0x33912d,_0x4e89fb[_0x4243('0x49')]);return db['UserFaxQueue'][_0x4243('0x4b')](_0x33912d);}})[_0x4243('0x28')](function(_0x3bdda4){if(_0x3bdda4){return db[_0x4243('0x5e')]['findAndCountAll']({'where':{'id':_[_0x4243('0x31')](_0x3bdda4,_0x4243('0x5f')),'role':'agent'},'attributes':['id',_0x4243('0x2e'),_0x4243('0x60'),'updatedAt',_0x4243('0x61')]});}})[_0x4243('0x28')](function(_0x54785d){if(_0x54785d){return{'count':_0x54785d[_0x4243('0x22')],'rows':_['map'](_0x54785d[_0x4243('0x4c')],function(_0xd976a7){return{'membername':_0xd976a7[_0x4243('0x2e')],'UserId':_0xd976a7['id'],'queue_name':_0x2dcf6f['name'],'FaxQueueId':_0x2dcf6f['id'],'interface':util[_0x4243('0x62')](_0x4243('0x63'),_0x4243('0x64'),_0xd976a7['name']),'penalty':0x0,'paused':_0xd976a7[_0x4243('0x60')],'createdAt':_0xd976a7[_0x4243('0x61')],'updatedAt':_0xd976a7[_0x4243('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4243('0x28')](respondWithFilteredResult(_0xd2461c,_0x33912d))[_0x4243('0x4d')](handleError(_0xd2461c,null));};exports[_0x4243('0x66')]=function(_0x4df974,_0x27abef,_0x4796a1){var _0x5ea03e={};var _0x1eab0c={};var _0x2b8708;var _0x2e676f;return db[_0x4243('0x32')][_0x4243('0x5b')]({'where':{'id':_0x4df974[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x27abef,null))[_0x4243('0x28')](function(_0x58cc46){if(_0x58cc46){_0x2b8708=_0x58cc46;_0x1eab0c['model']=_[_0x4243('0x39')](db[_0x4243('0x67')][_0x4243('0x33')]);_0x1eab0c[_0x4243('0x38')]=_[_0x4243('0x39')](_0x4df974['query']);_0x1eab0c[_0x4243('0x3a')]=_['intersection'](_0x1eab0c[_0x4243('0x37')],_0x1eab0c[_0x4243('0x38')]);_0x5ea03e[_0x4243('0x3b')]=_[_0x4243('0x3c')](_0x1eab0c['model'],qs[_0x4243('0x3d')](_0x4df974[_0x4243('0x38')][_0x4243('0x3d')]));_0x5ea03e[_0x4243('0x3b')]=_0x5ea03e['attributes'][_0x4243('0x3e')]?_0x5ea03e[_0x4243('0x3b')]:_0x1eab0c[_0x4243('0x37')];_0x5ea03e[_0x4243('0x42')]=qs[_0x4243('0x43')](_0x4df974['query']['sort']);_0x5ea03e[_0x4243('0x44')]=qs[_0x4243('0x3a')](_['pick'](_0x4df974[_0x4243('0x38')],_0x1eab0c[_0x4243('0x3a')]));if(_0x4df974[_0x4243('0x38')]['filter']){_0x5ea03e['where']=_['merge'](_0x5ea03e[_0x4243('0x44')],{'$or':_['map'](_0x5ea03e[_0x4243('0x3b')],function(_0x5d85a5){var _0x1508ac={};_0x1508ac[_0x5d85a5]={'$like':'%'+_0x4df974['query'][_0x4243('0x46')]+'%'};return _0x1508ac;})});}_0x5ea03e=_[_0x4243('0x47')]({},_0x5ea03e,_0x4df974[_0x4243('0x49')]);return _0x2b8708[_0x4243('0x66')](_0x5ea03e);}})[_0x4243('0x28')](function(_0x2d73a0){if(_0x2d73a0){_0x2e676f=_0x2d73a0[_0x4243('0x3e')];if(!_0x4df974['query']['hasOwnProperty'](_0x4243('0x5d'))){_0x5ea03e['limit']=qs['limit'](_0x4df974['query']['limit']);_0x5ea03e[_0x4243('0x41')]=qs[_0x4243('0x41')](_0x4df974[_0x4243('0x38')][_0x4243('0x41')]);}return _0x2b8708[_0x4243('0x66')](_0x5ea03e);}})[_0x4243('0x28')](function(_0x465500){if(_0x465500){return _0x465500?{'count':_0x2e676f,'rows':_0x465500}:null;}})[_0x4243('0x28')](respondWithResult(_0x27abef,null))[_0x4243('0x4d')](handleError(_0x27abef,null));};exports[_0x4243('0x68')]=function(_0x106b09,_0x24dd69,_0x5778b4){var _0x5d9ab8=_0x106b09['body'][_0x4243('0x69')];return db['Team']['findAll']({'where':{'id':_0x5d9ab8},'attributes':['id'],'include':[{'model':db[_0x4243('0x5e')],'as':_0x4243('0x6a'),'attributes':['id',_0x4243('0x2e'),'online','voicePause',_0x4243('0x6b')],'raw':!![]}]})['then'](function(_0xc36462){if(_0xc36462){var _0x3f4cea=_[_0x4243('0x6c')](_0xc36462,function(_0x1262f4){var _0x4aa3fa=_0x1262f4[_0x4243('0x53')]({'plain':!![]});return _0x4aa3fa[_0x4243('0x6a')];});return db[_0x4243('0x32')][_0x4243('0x4f')]({'where':{'id':_0x106b09[_0x4243('0x58')]['id']}})['then'](function(_0x2d4938){return db[_0x4243('0x6d')]['transaction'](function(_0x2c4e4){return _0x2d4938[_0x4243('0x68')](_0x5d9ab8,{'transaction':_0x2c4e4})[_0x4243('0x28')](function(){return BPromise[_0x4243('0x6e')](_0x3f4cea,function(_0x263de5){return db['UserFaxQueue'][_0x4243('0x6f')]({'where':{'UserId':_0x263de5['id'],'FaxQueueId':_0x106b09[_0x4243('0x58')]['id']},'transaction':_0x2c4e4});});})[_0x4243('0x28')](function(){_0x3f4cea[_0x4243('0x70')](function(_0x40d4c4){socket[_0x4243('0x71')](_0x4243('0x72'),{'UserId':_0x40d4c4['id'],'FaxQueueId':_0x2d4938['id']});});});});});}})['then'](respondWithStatusCode(_0x24dd69,null))[_0x4243('0x4d')](handleError(_0x24dd69,null));};exports[_0x4243('0x73')]=function(_0x10dc2a,_0x5dab63,_0xb31bee){return db['Team']['findAll']({'where':{'id':_0x10dc2a[_0x4243('0x38')][_0x4243('0x69')]},'attributes':['id'],'include':[{'model':db[_0x4243('0x5e')],'as':_0x4243('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5dab63,null))['then'](function(_0x9e1ac0){var _0x2e0be5=_[_0x4243('0x31')](_0x9e1ac0,'id');var _0x563d9f=[];var _0x180368=[];var _0x16f92a=squel[_0x4243('0x74')]();_0x16f92a[_0x4243('0x75')]('tq.TeamId')[_0x4243('0x76')](_0x4243('0x77'),'tq')['join'](_0x4243('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4243('0x44')]('FaxQueueId\x20=\x20?',_0x10dc2a[_0x4243('0x58')]['id']);for(var _0x24327f=0x0;_0x24327f<_0x9e1ac0[_0x4243('0x3e')];_0x24327f+=0x1){let _0x44d0c0=_0x9e1ac0[_0x24327f];for(var _0x16ea8b=0x0;_0x16ea8b<_0x44d0c0[_0x4243('0x6a')]['length'];_0x16ea8b+=0x1){let _0x59a789=_0x44d0c0[_0x4243('0x6a')][_0x16ea8b];var _0x4a49bf=_0x16f92a[_0x4243('0x79')]();_0x4a49bf[_0x4243('0x44')](_0x4243('0x7a'),_0x59a789['id']);_0x180368[_0x4243('0x7b')](db[_0x4243('0x6d')][_0x4243('0x38')](_0x4a49bf[_0x4243('0x7c')](),{'type':db[_0x4243('0x6d')][_0x4243('0x7d')][_0x4243('0x7e')]})[_0x4243('0x28')](function(_0x55f1c6){if(_0x55f1c6[_0x4243('0x3e')]===0x1){return _0x59a789['id'];}else{var _0x454b19=_[_0x4243('0x7f')](_[_0x4243('0x31')](_0x55f1c6,_0x4243('0x80')),function(_0x26de3a){return _[_0x4243('0x81')](_0x2e0be5,_0x26de3a);});if(_0x454b19){return _0x59a789['id'];}}}));}}return BPromise[_0x4243('0x82')](_0x180368)[_0x4243('0x28')](function(_0x4d1a00){_0x563d9f=_(_0x563d9f)[_0x4243('0x83')](_0x4d1a00)[_0x4243('0x84')]()[_0x4243('0x85')]();return db['FaxQueue'][_0x4243('0x4f')]({'where':{'id':_0x10dc2a[_0x4243('0x58')]['id']}})[_0x4243('0x28')](function(_0x2769d6){return db[_0x4243('0x6d')][_0x4243('0x86')](function(_0x26f35f){return _0x2769d6[_0x4243('0x73')](_0x10dc2a[_0x4243('0x38')][_0x4243('0x69')],{'transaction':_0x26f35f})[_0x4243('0x28')](function(){if(!_[_0x4243('0x87')](_0x563d9f)){return _0x2769d6[_0x4243('0x88')](_0x563d9f,{'transaction':_0x26f35f});}})[_0x4243('0x28')](function(){_0x563d9f[_0x4243('0x70')](function(_0x48ca42){socket[_0x4243('0x71')]('userFaxQueue:remove',{'UserId':_0x48ca42,'FaxQueueId':_0x2769d6['id']});});});});});});})[_0x4243('0x28')](respondWithStatusCode(_0x5dab63,null))[_0x4243('0x4d')](handleError(_0x5dab63,null));};exports[_0x4243('0x89')]=function(_0x4d2b65,_0x3b55f4,_0x5d45f3){return db[_0x4243('0x32')][_0x4243('0x4f')]({'where':{'id':_0x4d2b65[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x3b55f4,null))[_0x4243('0x28')](function(_0x32c838){if(_0x32c838){return _0x32c838['addAgents'](_0x4d2b65[_0x4243('0x51')][_0x4243('0x69')],_['omit'](_0x4d2b65[_0x4243('0x51')],['ids','id'])||{})[_0x4243('0x8a')](function(_0x1b1c50){for(var _0x35c69e=0x0;_0x35c69e<_0x4d2b65[_0x4243('0x51')][_0x4243('0x69')][_0x4243('0x3e')];_0x35c69e+=0x1){socket[_0x4243('0x71')](_0x4243('0x72'),{'UserId':Number(_0x4d2b65[_0x4243('0x51')]['ids'][_0x35c69e]),'FaxQueueId':Number(_0x4d2b65[_0x4243('0x58')]['id'])});}return _0x1b1c50;});}})[_0x4243('0x28')](respondWithResult(_0x3b55f4,null))[_0x4243('0x4d')](handleError(_0x3b55f4,null));};exports[_0x4243('0x88')]=function(_0x2d4fda,_0x57c57e,_0x469622){return db['FaxQueue'][_0x4243('0x4f')]({'where':{'id':_0x2d4fda[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x57c57e,null))['then'](function(_0x28f06b){if(_0x28f06b){return _0x28f06b['removeAgents'](_0x2d4fda[_0x4243('0x38')][_0x4243('0x69')])[_0x4243('0x28')](function(){if(_[_0x4243('0x8b')](_0x2d4fda[_0x4243('0x38')]['ids'])){for(var _0x4b10d4=0x0;_0x4b10d4<_0x2d4fda[_0x4243('0x38')][_0x4243('0x69')][_0x4243('0x3e')];_0x4b10d4+=0x1){socket[_0x4243('0x71')](_0x4243('0x8c'),{'UserId':Number(_0x2d4fda[_0x4243('0x38')]['ids'][_0x4b10d4]),'FaxQueueId':Number(_0x2d4fda[_0x4243('0x58')]['id'])});}}else{socket['emit'](_0x4243('0x8c'),{'UserId':Number(_0x2d4fda[_0x4243('0x38')][_0x4243('0x69')]),'FaxQueueId':Number(_0x2d4fda['params']['id'])});}});}})[_0x4243('0x28')](respondWithStatusCode(_0x57c57e,null))['catch'](handleError(_0x57c57e,null));};exports['getAgents']=function(_0x193f28,_0x2ddbbe,_0x2d5428){var _0x146b85={};var _0x7f4bd0={};var _0x645441;var _0x5a3b00;return db[_0x4243('0x32')]['findOne']({'where':{'id':_0x193f28[_0x4243('0x58')]['id']}})[_0x4243('0x28')](handleEntityNotFound(_0x2ddbbe,null))[_0x4243('0x28')](function(_0xdd1ebf){if(_0xdd1ebf){_0x645441=_0xdd1ebf;_0x7f4bd0['model']=_['keys'](db[_0x4243('0x5e')]['rawAttributes']);_0x7f4bd0['query']=_[_0x4243('0x39')](_0x193f28[_0x4243('0x38')]);_0x7f4bd0[_0x4243('0x3a')]=_[_0x4243('0x3c')](_0x7f4bd0[_0x4243('0x37')],_0x7f4bd0[_0x4243('0x38')]);_0x146b85[_0x4243('0x3b')]=_[_0x4243('0x3c')](_0x7f4bd0[_0x4243('0x37')],qs[_0x4243('0x3d')](_0x193f28[_0x4243('0x38')][_0x4243('0x3d')]));_0x146b85[_0x4243('0x3b')]=_0x146b85[_0x4243('0x3b')]['length']?_0x146b85['attributes']:_0x7f4bd0['model'];_0x146b85[_0x4243('0x42')]=qs[_0x4243('0x43')](_0x193f28[_0x4243('0x38')]['sort']);_0x146b85[_0x4243('0x44')]=qs[_0x4243('0x3a')](_['pick'](_0x193f28[_0x4243('0x38')],_0x7f4bd0[_0x4243('0x3a')]));if(_0x193f28[_0x4243('0x38')][_0x4243('0x46')]){_0x146b85['where']=_[_0x4243('0x47')](_0x146b85[_0x4243('0x44')],{'$or':_[_0x4243('0x31')](_0x146b85[_0x4243('0x3b')],function(_0x2c4e68){var _0x671986={};_0x671986[_0x2c4e68]={'$like':'%'+_0x193f28[_0x4243('0x38')]['filter']+'%'};return _0x671986;})});}_0x146b85=_[_0x4243('0x47')]({},_0x146b85,_0x193f28['options']);return _0x645441[_0x4243('0x8d')](_0x146b85);}})[_0x4243('0x28')](function(_0x37ca79){if(_0x37ca79){_0x5a3b00=_0x37ca79['length'];if(!_0x193f28[_0x4243('0x38')]['hasOwnProperty'](_0x4243('0x5d'))){_0x146b85[_0x4243('0x40')]=qs[_0x4243('0x40')](_0x193f28[_0x4243('0x38')][_0x4243('0x40')]);_0x146b85[_0x4243('0x41')]=qs[_0x4243('0x41')](_0x193f28['query'][_0x4243('0x41')]);}return _0x645441['getAgents'](_0x146b85);}})[_0x4243('0x28')](function(_0x14ce86){if(_0x14ce86){return _0x14ce86?{'count':_0x5a3b00,'rows':_0x14ce86}:null;}})[_0x4243('0x28')](respondWithResult(_0x2ddbbe,null))[_0x4243('0x4d')](handleError(_0x2ddbbe,null));};
\ No newline at end of file
index 67ad7e6..bf67ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x882c=['events','FaxQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports'];(function(_0x540e86,_0xffb59a){var _0x1afd39=function(_0x23e266){while(--_0x23e266){_0x540e86['push'](_0x540e86['shift']());}};_0x1afd39(++_0xffb59a);}(_0x882c,0x19e));var _0xc882=function(_0x3e4e85,_0x3472c3){_0x3e4e85=_0x3e4e85-0x0;var _0x3102c6=_0x882c[_0x3e4e85];return _0x3102c6;};'use strict';var EventEmitter=require(_0xc882('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xc882('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc882('0x2')](0x0);var events={'afterCreate':_0xc882('0x3'),'afterUpdate':_0xc882('0x4'),'afterDestroy':_0xc882('0x5')};function emitEvent(_0x3fbf70){return function(_0x183be7,_0x230cc5,_0x299018){FaxQueueEvents['emit'](_0x3fbf70+':'+_0x183be7['id'],_0x183be7);FaxQueueEvents['emit'](_0x3fbf70,_0x183be7);_0x299018(null);};}for(var e in events){if(events[_0xc882('0x6')](e)){var event=events[e];FaxQueue[_0xc882('0x7')](e,emitEvent(event));}}module[_0xc882('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x9800=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x4afa1c,_0x3e309e){var _0x14f9b9=function(_0x539a30){while(--_0x539a30){_0x4afa1c['push'](_0x4afa1c['shift']());}};_0x14f9b9(++_0x3e309e);}(_0x9800,0x1eb));var _0x0980=function(_0x4c0778,_0x458014){_0x4c0778=_0x4c0778-0x0;var _0x5ed0d3=_0x9800[_0x4c0778];return _0x5ed0d3;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x0980('0x0'))['db'][_0x0980('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x0980('0x2')](0x0);var events={'afterCreate':_0x0980('0x3'),'afterUpdate':'update','afterDestroy':_0x0980('0x4')};function emitEvent(_0x64fd4f){return function(_0x3abcc0,_0x47080d,_0x555685){FaxQueueEvents[_0x0980('0x5')](_0x64fd4f+':'+_0x3abcc0['id'],_0x3abcc0);FaxQueueEvents['emit'](_0x64fd4f,_0x3abcc0);_0x555685(null);};}for(var e in events){if(events[_0x0980('0x6')](e)){var event=events[e];FaxQueue[_0x0980('0x7')](e,emitEvent(event));}}module[_0x0980('0x8')]=FaxQueueEvents;
\ No newline at end of file
index 31747bf..3c98d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfb8=['request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xcfb8,0x94));var _0x8cfb=function(_0x3cb1c7,_0x229b64){_0x3cb1c7=_0x3cb1c7-0x0;var _0x4db120=_0xcfb8[_0x3cb1c7];return _0x4db120;};'use strict';var _=require(_0x8cfb('0x0'));var util=require(_0x8cfb('0x1'));var logger=require(_0x8cfb('0x2'))(_0x8cfb('0x3'));var moment=require(_0x8cfb('0x4'));var BPromise=require(_0x8cfb('0x5'));var rp=require(_0x8cfb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8cfb('0x7'));var config=require(_0x8cfb('0x8'));var attributes=require(_0x8cfb('0x9'));module[_0x8cfb('0xa')]=function(_0x37e44b,_0x319b95){return _0x37e44b[_0x8cfb('0xb')](_0x8cfb('0xc'),attributes,{'tableName':_0x8cfb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x57a9=['path','rimraf','../../config/environment','./faxQueue.attributes','define','lodash','api','moment','bluebird','request-promise'];(function(_0x356ec3,_0x2544e8){var _0xa3f892=function(_0x1680a3){while(--_0x1680a3){_0x356ec3['push'](_0x356ec3['shift']());}};_0xa3f892(++_0x2544e8);}(_0x57a9,0x109));var _0x957a=function(_0x1008f2,_0x256928){_0x1008f2=_0x1008f2-0x0;var _0x8c07c4=_0x57a9[_0x1008f2];return _0x8c07c4;};'use strict';var _=require(_0x957a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x957a('0x1'));var moment=require(_0x957a('0x2'));var BPromise=require(_0x957a('0x3'));var rp=require(_0x957a('0x4'));var fs=require('fs');var path=require(_0x957a('0x5'));var rimraf=require(_0x957a('0x6'));var config=require(_0x957a('0x7'));var attributes=require(_0x957a('0x8'));module['exports']=function(_0x20ec95,_0x25b0b4){return _0x20ec95[_0x957a('0x9')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8b05f76..6a83b61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64ef=['info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowFaxQueue','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then'];(function(_0x34144b,_0x231870){var _0x49cb8a=function(_0x31e92d){while(--_0x31e92d){_0x34144b['push'](_0x34144b['shift']());}};_0x49cb8a(++_0x231870);}(_0x64ef,0x136));var _0xf64e=function(_0xf1a97c,_0x388439){_0xf1a97c=_0xf1a97c-0x0;var _0x5e722c=_0x64ef[_0xf1a97c];return _0x5e722c;};'use strict';var _=require(_0xf64e('0x0'));var util=require('util');var moment=require(_0xf64e('0x1'));var BPromise=require(_0xf64e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf64e('0x3'));var db=require(_0xf64e('0x4'))['db'];var utils=require(_0xf64e('0x5'));var logger=require(_0xf64e('0x6'))(_0xf64e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf64e('0x8'));var client=jayson['client'][_0xf64e('0x9')]({'port':0x232a});config[_0xf64e('0xa')]=_[_0xf64e('0xb')](config[_0xf64e('0xa')],{'host':_0xf64e('0xc'),'port':0x18eb});var socket=require(_0xf64e('0xd'))(new Redis(config['redis']));require(_0xf64e('0xe'))[_0xf64e('0xf')](socket);function respondWithRpcPromise(_0x3766f,_0x1df27a,_0x4f55ca){return new BPromise(function(_0x57dede,_0x18cb7c){return client[_0xf64e('0x10')](_0x3766f,_0x4f55ca)[_0xf64e('0x11')](function(_0x234241){logger[_0xf64e('0x12')](_0xf64e('0x13'),_0x1df27a,_0xf64e('0x14'));logger['debug'](_0xf64e('0x15'),_0x1df27a,_0xf64e('0x14'),JSON['stringify'](_0x234241));if(_0x234241[_0xf64e('0x16')]){if(_0x234241[_0xf64e('0x16')][_0xf64e('0x17')]===0x1f4){logger[_0xf64e('0x16')](_0xf64e('0x13'),_0x1df27a,_0x234241[_0xf64e('0x16')][_0xf64e('0x18')]);return _0x18cb7c(_0x234241[_0xf64e('0x16')]['message']);}logger['error'](_0xf64e('0x13'),_0x1df27a,_0x234241['error'][_0xf64e('0x18')]);return _0x57dede(_0x234241['error']['message']);}else{logger[_0xf64e('0x12')](_0xf64e('0x13'),_0x1df27a,_0xf64e('0x14'));_0x57dede(_0x234241[_0xf64e('0x19')]['message']);}})[_0xf64e('0x1a')](function(_0x242250){logger[_0xf64e('0x16')](_0xf64e('0x13'),_0x1df27a,_0x242250);_0x18cb7c(_0x242250);});});}exports[_0xf64e('0x1b')]=function(_0x291971){var _0x31f68d=this;return new Promise(function(_0x537902,_0x32e64c){return db[_0xf64e('0x1c')][_0xf64e('0x1d')]({'raw':_0x291971[_0xf64e('0x1e')]?_0x291971[_0xf64e('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x291971['options']?_0x291971[_0xf64e('0x1e')][_0xf64e('0x1f')]||null:null,'attributes':_0x291971['options']?_0x291971[_0xf64e('0x1e')][_0xf64e('0x20')]||null:null,'limit':_0x291971[_0xf64e('0x1e')]?_0x291971[_0xf64e('0x1e')][_0xf64e('0x21')]||null:null,'include':_0x291971['options']?_0x291971['options'][_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x291971[_0xf64e('0x1e')][_0xf64e('0x22')],function(_0x506381){return{'model':db[_0x506381['model']],'as':_0x506381['as'],'attributes':_0x506381[_0xf64e('0x20')],'include':_0x506381[_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x506381[_0xf64e('0x22')],function(_0x50f295){return{'model':db[_0x50f295[_0xf64e('0x24')]],'as':_0x50f295['as'],'attributes':_0x50f295[_0xf64e('0x20')],'include':_0x50f295[_0xf64e('0x22')]?_['map'](_0x50f295[_0xf64e('0x22')],function(_0x4003ef){return{'model':db[_0x4003ef[_0xf64e('0x24')]],'as':_0x4003ef['as'],'attributes':_0x4003ef[_0xf64e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf64e('0x11')](function(_0x113fda){logger[_0xf64e('0x12')](_0xf64e('0x1b'),_0x291971);logger[_0xf64e('0x25')]('GetFaxQueue',_0x291971,JSON[_0xf64e('0x26')](_0x113fda));_0x537902(_0x113fda);})[_0xf64e('0x1a')](function(_0x49b990){logger['error'](_0xf64e('0x1b'),_0x49b990['message'],_0x291971);_0x32e64c(_0x31f68d['error'](0x1f4,_0x49b990[_0xf64e('0x18')]));});});};exports[_0xf64e('0x27')]=function(_0x104a54){var _0x544e11=this;return new Promise(function(_0x5503db,_0x156f36){return db[_0xf64e('0x1c')]['find']({'raw':_0x104a54[_0xf64e('0x1e')]?_0x104a54['options'][_0xf64e('0x28')]===undefined?!![]:![]:!![],'where':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')]['where']||null:null,'attributes':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')][_0xf64e('0x20')]||null:null,'include':_0x104a54[_0xf64e('0x1e')]?_0x104a54[_0xf64e('0x1e')][_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x104a54['options'][_0xf64e('0x22')],function(_0x2b74f7){return{'model':db[_0x2b74f7['model']],'as':_0x2b74f7['as'],'attributes':_0x2b74f7[_0xf64e('0x20')],'include':_0x2b74f7[_0xf64e('0x22')]?_[_0xf64e('0x23')](_0x2b74f7[_0xf64e('0x22')],function(_0x5cedaf){return{'model':db[_0x5cedaf[_0xf64e('0x24')]],'as':_0x5cedaf['as'],'attributes':_0x5cedaf[_0xf64e('0x20')],'include':_0x5cedaf['include']?_[_0xf64e('0x23')](_0x5cedaf[_0xf64e('0x22')],function(_0x559ad8){return{'model':db[_0x559ad8['model']],'as':_0x559ad8['as'],'attributes':_0x559ad8['attributes']};}):[]};}):[]};}):[]:[]})[_0xf64e('0x11')](function(_0x5f28d7){logger[_0xf64e('0x12')](_0xf64e('0x27'),_0x104a54);logger['debug']('ShowFaxQueue',_0x104a54,JSON[_0xf64e('0x26')](_0x5f28d7));_0x5503db(_0x5f28d7);})['catch'](function(_0x4271e0){logger[_0xf64e('0x16')](_0xf64e('0x27'),_0x4271e0[_0xf64e('0x18')],_0x104a54);_0x156f36(_0x544e11[_0xf64e('0x16')](0x1f4,_0x4271e0['message']));});});};
\ No newline at end of file
+var _0x69c4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','include','map','model','attributes','find','ShowFaxQueue','lodash','moment','bluebird'];(function(_0x3fe446,_0x52c277){var _0x1d43c3=function(_0x479c99){while(--_0x479c99){_0x3fe446['push'](_0x3fe446['shift']());}};_0x1d43c3(++_0x52c277);}(_0x69c4,0x15c));var _0x469c=function(_0x3cea7e,_0x556ebc){_0x3cea7e=_0x3cea7e-0x0;var _0x531b81=_0x69c4[_0x3cea7e];return _0x531b81;};'use strict';var _=require(_0x469c('0x0'));var util=require('util');var moment=require(_0x469c('0x1'));var BPromise=require(_0x469c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x469c('0x3'))['db'];var utils=require(_0x469c('0x4'));var logger=require(_0x469c('0x5'))(_0x469c('0x6'));var config=require(_0x469c('0x7'));var jayson=require(_0x469c('0x8'));var client=jayson['client'][_0x469c('0x9')]({'port':0x232a});config[_0x469c('0xa')]=_[_0x469c('0xb')](config[_0x469c('0xa')],{'host':_0x469c('0xc'),'port':0x18eb});var socket=require(_0x469c('0xd'))(new Redis(config[_0x469c('0xa')]));require(_0x469c('0xe'))[_0x469c('0xf')](socket);function respondWithRpcPromise(_0x38126f,_0x2eeffa,_0x4823dd){return new BPromise(function(_0xbeae01,_0x24d228){return client[_0x469c('0x10')](_0x38126f,_0x4823dd)[_0x469c('0x11')](function(_0x4742e2){logger['info'](_0x469c('0x12'),_0x2eeffa,'request\x20sent');logger[_0x469c('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x2eeffa,_0x469c('0x14'),JSON[_0x469c('0x15')](_0x4742e2));if(_0x4742e2[_0x469c('0x16')]){if(_0x4742e2['error']['code']===0x1f4){logger['error'](_0x469c('0x12'),_0x2eeffa,_0x4742e2[_0x469c('0x16')][_0x469c('0x17')]);return _0x24d228(_0x4742e2[_0x469c('0x16')][_0x469c('0x17')]);}logger['error'](_0x469c('0x12'),_0x2eeffa,_0x4742e2[_0x469c('0x16')]['message']);return _0xbeae01(_0x4742e2[_0x469c('0x16')][_0x469c('0x17')]);}else{logger[_0x469c('0x18')](_0x469c('0x12'),_0x2eeffa,_0x469c('0x14'));_0xbeae01(_0x4742e2[_0x469c('0x19')][_0x469c('0x17')]);}})[_0x469c('0x1a')](function(_0x1afd6b){logger[_0x469c('0x16')](_0x469c('0x12'),_0x2eeffa,_0x1afd6b);_0x24d228(_0x1afd6b);});});}exports[_0x469c('0x1b')]=function(_0x5763f9){var _0x3f3496=this;return new Promise(function(_0x46de7c,_0x17cf55){return db[_0x469c('0x1c')][_0x469c('0x1d')]({'raw':_0x5763f9[_0x469c('0x1e')]?_0x5763f9['options'][_0x469c('0x1f')]===undefined?!![]:![]:!![],'where':_0x5763f9[_0x469c('0x1e')]?_0x5763f9[_0x469c('0x1e')][_0x469c('0x20')]||null:null,'attributes':_0x5763f9[_0x469c('0x1e')]?_0x5763f9[_0x469c('0x1e')]['attributes']||null:null,'limit':_0x5763f9[_0x469c('0x1e')]?_0x5763f9[_0x469c('0x1e')]['limit']||null:null,'include':_0x5763f9[_0x469c('0x1e')]?_0x5763f9[_0x469c('0x1e')][_0x469c('0x21')]?_[_0x469c('0x22')](_0x5763f9[_0x469c('0x1e')][_0x469c('0x21')],function(_0x45125b){return{'model':db[_0x45125b[_0x469c('0x23')]],'as':_0x45125b['as'],'attributes':_0x45125b[_0x469c('0x24')],'include':_0x45125b[_0x469c('0x21')]?_[_0x469c('0x22')](_0x45125b['include'],function(_0x14ec01){return{'model':db[_0x14ec01[_0x469c('0x23')]],'as':_0x14ec01['as'],'attributes':_0x14ec01[_0x469c('0x24')],'include':_0x14ec01[_0x469c('0x21')]?_[_0x469c('0x22')](_0x14ec01[_0x469c('0x21')],function(_0x535795){return{'model':db[_0x535795[_0x469c('0x23')]],'as':_0x535795['as'],'attributes':_0x535795[_0x469c('0x24')]};}):[]};}):[]};}):[]:[]})[_0x469c('0x11')](function(_0x2db9a6){logger[_0x469c('0x18')]('GetFaxQueue',_0x5763f9);logger['debug'](_0x469c('0x1b'),_0x5763f9,JSON[_0x469c('0x15')](_0x2db9a6));_0x46de7c(_0x2db9a6);})['catch'](function(_0x30964a){logger[_0x469c('0x16')](_0x469c('0x1b'),_0x30964a[_0x469c('0x17')],_0x5763f9);_0x17cf55(_0x3f3496['error'](0x1f4,_0x30964a[_0x469c('0x17')]));});});};exports['ShowFaxQueue']=function(_0xdb8e4b){var _0xc8b100=this;return new Promise(function(_0x159bc8,_0x1ab834){return db[_0x469c('0x1c')][_0x469c('0x25')]({'raw':_0xdb8e4b['options']?_0xdb8e4b[_0x469c('0x1e')][_0x469c('0x1f')]===undefined?!![]:![]:!![],'where':_0xdb8e4b[_0x469c('0x1e')]?_0xdb8e4b[_0x469c('0x1e')]['where']||null:null,'attributes':_0xdb8e4b[_0x469c('0x1e')]?_0xdb8e4b[_0x469c('0x1e')]['attributes']||null:null,'include':_0xdb8e4b['options']?_0xdb8e4b[_0x469c('0x1e')][_0x469c('0x21')]?_[_0x469c('0x22')](_0xdb8e4b['options']['include'],function(_0x3ff96e){return{'model':db[_0x3ff96e[_0x469c('0x23')]],'as':_0x3ff96e['as'],'attributes':_0x3ff96e[_0x469c('0x24')],'include':_0x3ff96e[_0x469c('0x21')]?_[_0x469c('0x22')](_0x3ff96e[_0x469c('0x21')],function(_0x34e255){return{'model':db[_0x34e255['model']],'as':_0x34e255['as'],'attributes':_0x34e255[_0x469c('0x24')],'include':_0x34e255[_0x469c('0x21')]?_[_0x469c('0x22')](_0x34e255[_0x469c('0x21')],function(_0x1b5cff){return{'model':db[_0x1b5cff[_0x469c('0x23')]],'as':_0x1b5cff['as'],'attributes':_0x1b5cff[_0x469c('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x739a71){logger['info'](_0x469c('0x26'),_0xdb8e4b);logger[_0x469c('0x13')](_0x469c('0x26'),_0xdb8e4b,JSON[_0x469c('0x15')](_0x739a71));_0x159bc8(_0x739a71);})[_0x469c('0x1a')](function(_0x1bd490){logger[_0x469c('0x16')](_0x469c('0x26'),_0x1bd490['message'],_0xdb8e4b);_0x1ab834(_0xc8b100['error'](0x1f4,_0x1bd490['message']));});});};
\ No newline at end of file
index 934e228..3917734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fac=['remove','update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x2fac,0x1a5));var _0xc2fa=function(_0x1a5949,_0x3f6077){_0x1a5949=_0x1a5949-0x0;var _0x1be6ff=_0x2fac[_0x1a5949];return _0x1be6ff;};'use strict';var FaxQueueEvents=require(_0xc2fa('0x0'));var events=[_0xc2fa('0x1'),_0xc2fa('0x2'),_0xc2fa('0x3')];function createListener(_0x46b2ff,_0x1b01a5){return function(_0x357857){_0x1b01a5[_0xc2fa('0x4')](_0x46b2ff,_0x357857);};}function removeListener(_0x158644,_0xf67859){return function(){FaxQueueEvents[_0xc2fa('0x5')](_0x158644,_0xf67859);};}exports[_0xc2fa('0x6')]=function(_0x356c25){for(var _0x39d0c3=0x0,_0x2fa51e=events[_0xc2fa('0x7')];_0x39d0c3<_0x2fa51e;_0x39d0c3++){var _0x110a2e=events[_0x39d0c3];var _0x5703c6=createListener(_0xc2fa('0x8')+_0x110a2e,_0x356c25);FaxQueueEvents['on'](_0x110a2e,_0x5703c6);}};
\ No newline at end of file
+var _0x0b3b=['emit','removeListener','register','length','faxQueue:','save','remove','update'];(function(_0x9defc4,_0x569d66){var _0x5bb415=function(_0x55a37d){while(--_0x55a37d){_0x9defc4['push'](_0x9defc4['shift']());}};_0x5bb415(++_0x569d66);}(_0x0b3b,0xcd));var _0xb0b3=function(_0x3278b9,_0xcbd4){_0x3278b9=_0x3278b9-0x0;var _0x5075ce=_0x0b3b[_0x3278b9];return _0x5075ce;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xb0b3('0x0'),_0xb0b3('0x1'),_0xb0b3('0x2')];function createListener(_0x1ac609,_0x17c1d9){return function(_0xf01cb7){_0x17c1d9[_0xb0b3('0x3')](_0x1ac609,_0xf01cb7);};}function removeListener(_0x3ebac2,_0x2be17a){return function(){FaxQueueEvents[_0xb0b3('0x4')](_0x3ebac2,_0x2be17a);};}exports[_0xb0b3('0x5')]=function(_0x48d980){for(var _0x44822c=0x0,_0x5f23af=events[_0xb0b3('0x6')];_0x44822c<_0x5f23af;_0x44822c++){var _0x187130=events[_0x44822c];var _0x212086=createListener(_0xb0b3('0x7')+_0x187130,_0x48d980);FaxQueueEvents['on'](_0x187130,_0x212086);}};
\ No newline at end of file
index 314699f..38a51d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['index','/describe','describe','/:id/members','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','/:id','update','delete','destroy','removeTeams','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated'];(function(_0x9b14ee,_0x574340){var _0xc3fa3c=function(_0x44476d){while(--_0x44476d){_0x9b14ee['push'](_0x9b14ee['shift']());}};_0xc3fa3c(++_0x574340);}(_0x2675,0x75));var _0x5267=function(_0x1b3afa,_0x2a755a){_0x1b3afa=_0x1b3afa-0x0;var _0xbde4e9=_0x2675[_0x1b3afa];return _0xbde4e9;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0x6')](_0x5267('0xb'),auth[_0x5267('0x7')](),controller['getMembers']);router[_0x5267('0x6')]('/:id/teams',auth[_0x5267('0x7')](),controller['getTeams']);router[_0x5267('0x6')](_0x5267('0xc'),auth[_0x5267('0x7')](),controller[_0x5267('0xd')]);router[_0x5267('0xe')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0xf')]);router[_0x5267('0xe')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x11')]);router[_0x5267('0xe')](_0x5267('0xc'),auth['isAuthenticated'](),controller['addAgents']);router[_0x5267('0x12')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x14')]);router[_0x5267('0x15')](_0x5267('0x13'),auth[_0x5267('0x7')](),controller[_0x5267('0x16')]);router[_0x5267('0x15')](_0x5267('0x10'),auth[_0x5267('0x7')](),controller[_0x5267('0x17')]);router['delete'](_0x5267('0xc'),auth[_0x5267('0x7')](),controller['removeAgents']);module[_0x5267('0x18')]=router;
\ No newline at end of file
+var _0x8f9d=['getMembers','/:id/teams','getTeams','post','create','addTeams','addAgents','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x405541,_0x2945cc){var _0x194a1e=function(_0x46fffe){while(--_0x46fffe){_0x405541['push'](_0x405541['shift']());}};_0x194a1e(++_0x2945cc);}(_0x8f9d,0x93));var _0xd8f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8f9d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['get']('/:id/members',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0xb')](_0xd8f9('0x10'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);router[_0xd8f9('0xb')]('/:id/users',auth[_0xd8f9('0x9')](),controller['getAgents']);router[_0xd8f9('0x12')]('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x13')]);router['post'](_0xd8f9('0x10'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x14')]);router[_0xd8f9('0x12')]('/:id/users',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x15')]);router[_0xd8f9('0x16')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x17')]);router[_0xd8f9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xd8f9('0x19')]);router[_0xd8f9('0x18')]('/:id/teams',auth[_0xd8f9('0x9')](),controller['removeTeams']);router[_0xd8f9('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xd8f9('0x1a')]=router;
\ No newline at end of file
index 9df9943..d4169e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed5a=['DATE','moment','exports','STRING'];(function(_0x548d2b,_0x4547ac){var _0x150241=function(_0x2a1edf){while(--_0x2a1edf){_0x548d2b['push'](_0x548d2b['shift']());}};_0x150241(++_0x4547ac);}(_0xed5a,0x1f1));var _0xaed5=function(_0x48b810,_0x173a5e){_0x48b810=_0x48b810-0x0;var _0x23c17d=_0xed5a[_0x48b810];return _0x23c17d;};'use strict';var moment=require(_0xaed5('0x0'));var Sequelize=require('sequelize');module[_0xaed5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaed5('0x2')]},'joinAt':{'type':Sequelize[_0xaed5('0x3')]},'leaveAt':{'type':Sequelize[_0xaed5('0x3')]},'acceptAt':{'type':Sequelize[_0xaed5('0x3')]},'exitAt':{'type':Sequelize[_0xaed5('0x3')]},'reason':{'type':Sequelize[_0xaed5('0x2')]}};
\ No newline at end of file
+var _0x5cfb=['DATE','moment','sequelize','STRING'];(function(_0x89c994,_0x48078f){var _0x31ef0b=function(_0x4de9b1){while(--_0x4de9b1){_0x89c994['push'](_0x89c994['shift']());}};_0x31ef0b(++_0x48078f);}(_0x5cfb,0x9d));var _0xb5cf=function(_0x366a38,_0x3f9c95){_0x366a38=_0x366a38-0x0;var _0x35dbc0=_0x5cfb[_0x366a38];return _0x35dbc0;};'use strict';var moment=require(_0xb5cf('0x0'));var Sequelize=require(_0xb5cf('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb5cf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb5cf('0x2')]},'joinAt':{'type':Sequelize[_0xb5cf('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb5cf('0x3')]},'exitAt':{'type':Sequelize[_0xb5cf('0x3')]},'reason':{'type':Sequelize[_0xb5cf('0x2')]}};
\ No newline at end of file
index bda1d2b..900af8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc125=['set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','FaxQueueReport','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','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','limit','undefined','count','offset'];(function(_0x2b4f7c,_0x318404){var _0x2f9e22=function(_0x156be8){while(--_0x156be8){_0x2b4f7c['push'](_0x2b4f7c['shift']());}};_0x2f9e22(++_0x318404);}(_0xc125,0x150));var _0x5c12=function(_0x140549,_0x2752b9){_0x140549=_0x140549-0x0;var _0x30e476=_0xc125[_0x140549];return _0x30e476;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c12('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5c12('0x1'));var rp=require(_0x5c12('0x2'));var moment=require(_0x5c12('0x3'));var BPromise=require(_0x5c12('0x4'));var Mustache=require(_0x5c12('0x5'));var util=require(_0x5c12('0x6'));var path=require(_0x5c12('0x7'));var sox=require(_0x5c12('0x8'));var csv=require(_0x5c12('0x9'));var ejs=require(_0x5c12('0xa'));var fs=require('fs');var fs_extra=require(_0x5c12('0xb'));var _=require(_0x5c12('0xc'));var squel=require('squel');var crypto=require(_0x5c12('0xd'));var jsforce=require(_0x5c12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c12('0x9'));var querystring=require(_0x5c12('0xf'));var Papa=require(_0x5c12('0x10'));var Redis=require(_0x5c12('0x11'));var authService=require(_0x5c12('0x12'));var qs=require(_0x5c12('0x13'));var as=require(_0x5c12('0x14'));var hardwareService=require(_0x5c12('0x15'));var logger=require('../../config/logger')(_0x5c12('0x16'));var utils=require(_0x5c12('0x17'));var config=require(_0x5c12('0x18'));var licenseUtil=require(_0x5c12('0x19'));var db=require(_0x5c12('0x1a'))['db'];function respondWithStatusCode(_0x4a1279,_0x4f40ae){_0x4f40ae=_0x4f40ae||0xcc;return function(_0x40d80b){if(_0x40d80b){return _0x4a1279['sendStatus'](_0x4f40ae);}return _0x4a1279[_0x5c12('0x1b')](_0x4f40ae)[_0x5c12('0x1c')]();};}function respondWithResult(_0x448667,_0x4a9910){_0x4a9910=_0x4a9910||0xc8;return function(_0x5676a9){if(_0x5676a9){return _0x448667[_0x5c12('0x1b')](_0x4a9910)[_0x5c12('0x1d')](_0x5676a9);}};}function respondWithFilteredResult(_0x5cb237,_0x460ff1){return function(_0xf18ba2){if(_0xf18ba2){var _0x244216=typeof _0x460ff1['offset']==='undefined'&&typeof _0x460ff1[_0x5c12('0x1e')]===_0x5c12('0x1f');var _0x319cc8=_0xf18ba2[_0x5c12('0x20')];var _0x1bd895=_0x244216?0x0:_0x460ff1[_0x5c12('0x21')];var _0x16543f=_0x244216?_0xf18ba2[_0x5c12('0x20')]:_0x460ff1['offset']+_0x460ff1['limit'];var _0x2f7d71;if(_0x16543f>=_0x319cc8){_0x16543f=_0x319cc8;_0x2f7d71=0xc8;}else{_0x2f7d71=0xce;}_0x5cb237[_0x5c12('0x1b')](_0x2f7d71);return _0x5cb237[_0x5c12('0x22')](_0x5c12('0x23'),_0x1bd895+'-'+_0x16543f+'/'+_0x319cc8)['json'](_0xf18ba2);}return null;};}function patchUpdates(_0x3ea1b5){return function(_0x4c096d){try{jsonpatch[_0x5c12('0x24')](_0x4c096d,_0x3ea1b5,!![]);}catch(_0x26aa3f){return BPromise['reject'](_0x26aa3f);}return _0x4c096d['save']();};}function saveUpdates(_0xa1ad8f,_0x5f7e40){return function(_0x5b0552){if(_0x5b0552){return _0x5b0552[_0x5c12('0x25')](_0xa1ad8f)['then'](function(_0xfa7c1e){return _0xfa7c1e;});}return null;};}function removeEntity(_0x7bc2ff,_0x1d9e30){return function(_0x40f6ab){if(_0x40f6ab){return _0x40f6ab[_0x5c12('0x26')]()[_0x5c12('0x27')](function(){_0x7bc2ff[_0x5c12('0x1b')](0xcc)[_0x5c12('0x1c')]();});}};}function handleEntityNotFound(_0xca0f79,_0x1d6d76){return function(_0x23e787){if(!_0x23e787){_0xca0f79[_0x5c12('0x28')](0x194);}return _0x23e787;};}function handleError(_0x146bce,_0x598c2b){_0x598c2b=_0x598c2b||0x1f4;return function(_0x37979e){logger[_0x5c12('0x29')](_0x37979e[_0x5c12('0x2a')]);if(_0x37979e[_0x5c12('0x2b')]){delete _0x37979e[_0x5c12('0x2b')];}_0x146bce[_0x5c12('0x1b')](_0x598c2b)['send'](_0x37979e);};}exports[_0x5c12('0x2c')]=function(_0x3e9bf5,_0x4d21b6){var _0x5939a8={},_0x5815d4={},_0x130be5={'count':0x0,'rows':[]};var _0x2dded3=_['map'](db[_0x5c12('0x2d')][_0x5c12('0x2e')],function(_0xdb38eb){return{'name':_0xdb38eb['fieldName'],'type':_0xdb38eb[_0x5c12('0x2f')]['key']};});_0x5815d4[_0x5c12('0x30')]=_[_0x5c12('0x31')](_0x2dded3,_0x5c12('0x2b'));_0x5815d4[_0x5c12('0x32')]=_[_0x5c12('0x33')](_0x3e9bf5[_0x5c12('0x32')]);_0x5815d4[_0x5c12('0x34')]=_['intersection'](_0x5815d4['model'],_0x5815d4[_0x5c12('0x32')]);_0x5939a8[_0x5c12('0x35')]=_[_0x5c12('0x36')](_0x5815d4[_0x5c12('0x30')],qs['fields'](_0x3e9bf5['query'][_0x5c12('0x37')]));_0x5939a8[_0x5c12('0x35')]=_0x5939a8['attributes']['length']?_0x5939a8['attributes']:_0x5815d4[_0x5c12('0x30')];if(!_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x38')](_0x5c12('0x39'))){_0x5939a8[_0x5c12('0x1e')]=qs['limit'](_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x1e')]);_0x5939a8['offset']=qs[_0x5c12('0x21')](_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x21')]);}_0x5939a8[_0x5c12('0x3a')]=qs[_0x5c12('0x3b')](_0x3e9bf5['query'][_0x5c12('0x3b')]);_0x5939a8[_0x5c12('0x3c')]=qs['filters'](_[_0x5c12('0x3d')](_0x3e9bf5[_0x5c12('0x32')],_0x5815d4[_0x5c12('0x34')]),_0x2dded3);if(_0x3e9bf5['query'][_0x5c12('0x3e')]){_0x5939a8[_0x5c12('0x3c')]=_[_0x5c12('0x3f')](_0x5939a8['where'],{'$or':_[_0x5c12('0x31')](_0x2dded3,function(_0x52e976){if(_0x52e976['type']!=='VIRTUAL'){var _0x1b377f={};_0x1b377f[_0x52e976[_0x5c12('0x2b')]]={'$like':'%'+_0x3e9bf5[_0x5c12('0x32')][_0x5c12('0x3e')]+'%'};return _0x1b377f;}})});}_0x5939a8=_[_0x5c12('0x3f')]({},_0x5939a8,_0x3e9bf5[_0x5c12('0x40')]);var _0x1c1f22={'where':_0x5939a8['where']};return db[_0x5c12('0x2d')][_0x5c12('0x20')](_0x1c1f22)[_0x5c12('0x27')](function(_0x47fece){_0x130be5['count']=_0x47fece;if(_0x3e9bf5['query'][_0x5c12('0x41')]){_0x5939a8['include']=[{'all':!![]}];}return db[_0x5c12('0x2d')][_0x5c12('0x42')](_0x5939a8);})[_0x5c12('0x27')](function(_0x2d3bf8){_0x130be5[_0x5c12('0x43')]=_0x2d3bf8;return _0x130be5;})[_0x5c12('0x27')](respondWithFilteredResult(_0x4d21b6,_0x5939a8))[_0x5c12('0x44')](handleError(_0x4d21b6,null));};exports['show']=function(_0x44da8b,_0x217dbe){var _0x4c1225={'raw':!![],'where':{'id':_0x44da8b[_0x5c12('0x45')]['id']}},_0x312d55={};_0x312d55[_0x5c12('0x30')]=_[_0x5c12('0x33')](db[_0x5c12('0x2d')][_0x5c12('0x2e')]);_0x312d55[_0x5c12('0x32')]=_['keys'](_0x44da8b['query']);_0x312d55[_0x5c12('0x34')]=_[_0x5c12('0x36')](_0x312d55[_0x5c12('0x30')],_0x312d55[_0x5c12('0x32')]);_0x4c1225[_0x5c12('0x35')]=_[_0x5c12('0x36')](_0x312d55[_0x5c12('0x30')],qs[_0x5c12('0x37')](_0x44da8b[_0x5c12('0x32')][_0x5c12('0x37')]));_0x4c1225[_0x5c12('0x35')]=_0x4c1225[_0x5c12('0x35')]['length']?_0x4c1225['attributes']:_0x312d55[_0x5c12('0x30')];if(_0x44da8b[_0x5c12('0x32')][_0x5c12('0x41')]){_0x4c1225['include']=[{'all':!![]}];}_0x4c1225=_[_0x5c12('0x3f')]({},_0x4c1225,_0x44da8b[_0x5c12('0x40')]);return db[_0x5c12('0x2d')][_0x5c12('0x46')](_0x4c1225)[_0x5c12('0x27')](handleEntityNotFound(_0x217dbe,null))[_0x5c12('0x27')](respondWithResult(_0x217dbe,null))['catch'](handleError(_0x217dbe,null));};exports[_0x5c12('0x47')]=function(_0x11801c,_0x36ac79){return db['FaxQueueReport']['create'](_0x11801c[_0x5c12('0x48')],{})[_0x5c12('0x27')](respondWithResult(_0x36ac79,0xc9))[_0x5c12('0x44')](handleError(_0x36ac79,null));};exports[_0x5c12('0x25')]=function(_0x3f80d5,_0x1908c7){if(_0x3f80d5[_0x5c12('0x48')]['id']){delete _0x3f80d5['body']['id'];}return db[_0x5c12('0x2d')][_0x5c12('0x46')]({'where':{'id':_0x3f80d5['params']['id']}})['then'](handleEntityNotFound(_0x1908c7,null))[_0x5c12('0x27')](saveUpdates(_0x3f80d5[_0x5c12('0x48')],null))[_0x5c12('0x27')](respondWithResult(_0x1908c7,null))[_0x5c12('0x44')](handleError(_0x1908c7,null));};exports['destroy']=function(_0x461529,_0x48ac1b){return db['FaxQueueReport'][_0x5c12('0x46')]({'where':{'id':_0x461529['params']['id']}})[_0x5c12('0x27')](handleEntityNotFound(_0x48ac1b,null))[_0x5c12('0x27')](removeEntity(_0x48ac1b,null))[_0x5c12('0x44')](handleError(_0x48ac1b,null));};exports['describe']=function(_0x42ffbc,_0x5083ba){return db[_0x5c12('0x2d')][_0x5c12('0x49')]()[_0x5c12('0x27')](respondWithResult(_0x5083ba,null))[_0x5c12('0x44')](handleError(_0x5083ba,null));};
\ No newline at end of file
+var _0x949d=['path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','send','index','FaxQueueReport','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x1417c6,_0x194309){var _0x44db97=function(_0xa2a293){while(--_0xa2a293){_0x1417c6['push'](_0x1417c6['shift']());}};_0x44db97(++_0x194309);}(_0x949d,0x162));var _0xd949=function(_0x5e4870,_0x90bfec){_0x5e4870=_0x5e4870-0x0;var _0x341e6f=_0x949d[_0x5e4870];return _0x341e6f;};'use strict';var emlformat=require(_0xd949('0x0'));var rimraf=require(_0xd949('0x1'));var zipdir=require(_0xd949('0x2'));var jsonpatch=require(_0xd949('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd949('0x4'));var Mustache=require(_0xd949('0x5'));var util=require('util');var path=require(_0xd949('0x6'));var sox=require(_0xd949('0x7'));var csv=require('to-csv');var ejs=require(_0xd949('0x8'));var fs=require('fs');var fs_extra=require(_0xd949('0x9'));var _=require(_0xd949('0xa'));var squel=require('squel');var crypto=require(_0xd949('0xb'));var jsforce=require(_0xd949('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd949('0xd'));var Papa=require(_0xd949('0xe'));var Redis=require(_0xd949('0xf'));var authService=require(_0xd949('0x10'));var qs=require(_0xd949('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd949('0x12'))(_0xd949('0x13'));var utils=require(_0xd949('0x14'));var config=require(_0xd949('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd949('0x16'))['db'];function respondWithStatusCode(_0x4e9244,_0xfe1b0f){_0xfe1b0f=_0xfe1b0f||0xcc;return function(_0x182284){if(_0x182284){return _0x4e9244[_0xd949('0x17')](_0xfe1b0f);}return _0x4e9244[_0xd949('0x18')](_0xfe1b0f)[_0xd949('0x19')]();};}function respondWithResult(_0x2a7fe8,_0x4eb028){_0x4eb028=_0x4eb028||0xc8;return function(_0x319286){if(_0x319286){return _0x2a7fe8[_0xd949('0x18')](_0x4eb028)[_0xd949('0x1a')](_0x319286);}};}function respondWithFilteredResult(_0x45870e,_0x50ee4d){return function(_0x16f1ad){if(_0x16f1ad){var _0x1f4fb4=typeof _0x50ee4d[_0xd949('0x1b')]===_0xd949('0x1c')&&typeof _0x50ee4d[_0xd949('0x1d')]===_0xd949('0x1c');var _0x1b50f0=_0x16f1ad['count'];var _0x37614d=_0x1f4fb4?0x0:_0x50ee4d[_0xd949('0x1b')];var _0x5a0790=_0x1f4fb4?_0x16f1ad[_0xd949('0x1e')]:_0x50ee4d[_0xd949('0x1b')]+_0x50ee4d[_0xd949('0x1d')];var _0x2f5ecf;if(_0x5a0790>=_0x1b50f0){_0x5a0790=_0x1b50f0;_0x2f5ecf=0xc8;}else{_0x2f5ecf=0xce;}_0x45870e[_0xd949('0x18')](_0x2f5ecf);return _0x45870e['set'](_0xd949('0x1f'),_0x37614d+'-'+_0x5a0790+'/'+_0x1b50f0)[_0xd949('0x1a')](_0x16f1ad);}return null;};}function patchUpdates(_0x56d8f2){return function(_0x582d8e){try{jsonpatch[_0xd949('0x20')](_0x582d8e,_0x56d8f2,!![]);}catch(_0xb06b83){return BPromise[_0xd949('0x21')](_0xb06b83);}return _0x582d8e[_0xd949('0x22')]();};}function saveUpdates(_0x5e69b3,_0x478f5b){return function(_0x1c0a66){if(_0x1c0a66){return _0x1c0a66[_0xd949('0x23')](_0x5e69b3)[_0xd949('0x24')](function(_0xf0cc12){return _0xf0cc12;});}return null;};}function removeEntity(_0x1bff18,_0x38978f){return function(_0x94a7a8){if(_0x94a7a8){return _0x94a7a8['destroy']()[_0xd949('0x24')](function(){_0x1bff18[_0xd949('0x18')](0xcc)[_0xd949('0x19')]();});}};}function handleEntityNotFound(_0x32701a,_0x58adcc){return function(_0x103921){if(!_0x103921){_0x32701a[_0xd949('0x17')](0x194);}return _0x103921;};}function handleError(_0x1e9abd,_0xfd040a){_0xfd040a=_0xfd040a||0x1f4;return function(_0x31811d){logger['error'](_0x31811d['stack']);if(_0x31811d[_0xd949('0x25')]){delete _0x31811d[_0xd949('0x25')];}_0x1e9abd['status'](_0xfd040a)[_0xd949('0x26')](_0x31811d);};}exports[_0xd949('0x27')]=function(_0x4cf485,_0x56aeab){var _0x298ed2={},_0x263a42={},_0x2db741={'count':0x0,'rows':[]};var _0x27a36c=_['map'](db[_0xd949('0x28')]['rawAttributes'],function(_0x3c729b){return{'name':_0x3c729b['fieldName'],'type':_0x3c729b['type'][_0xd949('0x29')]};});_0x263a42['model']=_[_0xd949('0x2a')](_0x27a36c,_0xd949('0x25'));_0x263a42['query']=_['keys'](_0x4cf485[_0xd949('0x2b')]);_0x263a42[_0xd949('0x2c')]=_['intersection'](_0x263a42[_0xd949('0x2d')],_0x263a42['query']);_0x298ed2[_0xd949('0x2e')]=_[_0xd949('0x2f')](_0x263a42['model'],qs['fields'](_0x4cf485[_0xd949('0x2b')][_0xd949('0x30')]));_0x298ed2[_0xd949('0x2e')]=_0x298ed2[_0xd949('0x2e')][_0xd949('0x31')]?_0x298ed2[_0xd949('0x2e')]:_0x263a42[_0xd949('0x2d')];if(!_0x4cf485[_0xd949('0x2b')][_0xd949('0x32')](_0xd949('0x33'))){_0x298ed2[_0xd949('0x1d')]=qs[_0xd949('0x1d')](_0x4cf485[_0xd949('0x2b')][_0xd949('0x1d')]);_0x298ed2['offset']=qs[_0xd949('0x1b')](_0x4cf485[_0xd949('0x2b')][_0xd949('0x1b')]);}_0x298ed2[_0xd949('0x34')]=qs[_0xd949('0x35')](_0x4cf485['query']['sort']);_0x298ed2[_0xd949('0x36')]=qs[_0xd949('0x2c')](_[_0xd949('0x37')](_0x4cf485[_0xd949('0x2b')],_0x263a42[_0xd949('0x2c')]),_0x27a36c);if(_0x4cf485[_0xd949('0x2b')]['filter']){_0x298ed2['where']=_[_0xd949('0x38')](_0x298ed2['where'],{'$or':_[_0xd949('0x2a')](_0x27a36c,function(_0x319bad){if(_0x319bad[_0xd949('0x39')]!==_0xd949('0x3a')){var _0x64a235={};_0x64a235[_0x319bad[_0xd949('0x25')]]={'$like':'%'+_0x4cf485[_0xd949('0x2b')][_0xd949('0x3b')]+'%'};return _0x64a235;}})});}_0x298ed2=_[_0xd949('0x38')]({},_0x298ed2,_0x4cf485[_0xd949('0x3c')]);var _0x3c5810={'where':_0x298ed2[_0xd949('0x36')]};return db[_0xd949('0x28')][_0xd949('0x1e')](_0x3c5810)[_0xd949('0x24')](function(_0x6efcaa){_0x2db741[_0xd949('0x1e')]=_0x6efcaa;if(_0x4cf485[_0xd949('0x2b')][_0xd949('0x3d')]){_0x298ed2[_0xd949('0x3e')]=[{'all':!![]}];}return db[_0xd949('0x28')]['findAll'](_0x298ed2);})[_0xd949('0x24')](function(_0x1f95f2){_0x2db741[_0xd949('0x3f')]=_0x1f95f2;return _0x2db741;})[_0xd949('0x24')](respondWithFilteredResult(_0x56aeab,_0x298ed2))['catch'](handleError(_0x56aeab,null));};exports[_0xd949('0x40')]=function(_0x495a8a,_0xab7d50){var _0x531d33={'raw':!![],'where':{'id':_0x495a8a[_0xd949('0x41')]['id']}},_0x288170={};_0x288170[_0xd949('0x2d')]=_[_0xd949('0x42')](db[_0xd949('0x28')][_0xd949('0x43')]);_0x288170[_0xd949('0x2b')]=_[_0xd949('0x42')](_0x495a8a['query']);_0x288170[_0xd949('0x2c')]=_[_0xd949('0x2f')](_0x288170[_0xd949('0x2d')],_0x288170['query']);_0x531d33['attributes']=_['intersection'](_0x288170[_0xd949('0x2d')],qs[_0xd949('0x30')](_0x495a8a[_0xd949('0x2b')][_0xd949('0x30')]));_0x531d33[_0xd949('0x2e')]=_0x531d33[_0xd949('0x2e')][_0xd949('0x31')]?_0x531d33[_0xd949('0x2e')]:_0x288170[_0xd949('0x2d')];if(_0x495a8a[_0xd949('0x2b')][_0xd949('0x3d')]){_0x531d33[_0xd949('0x3e')]=[{'all':!![]}];}_0x531d33=_[_0xd949('0x38')]({},_0x531d33,_0x495a8a[_0xd949('0x3c')]);return db[_0xd949('0x28')][_0xd949('0x44')](_0x531d33)[_0xd949('0x24')](handleEntityNotFound(_0xab7d50,null))['then'](respondWithResult(_0xab7d50,null))[_0xd949('0x45')](handleError(_0xab7d50,null));};exports['create']=function(_0x20cde5,_0x491614){return db[_0xd949('0x28')]['create'](_0x20cde5[_0xd949('0x46')],{})['then'](respondWithResult(_0x491614,0xc9))[_0xd949('0x45')](handleError(_0x491614,null));};exports[_0xd949('0x23')]=function(_0x1001db,_0x320541){if(_0x1001db[_0xd949('0x46')]['id']){delete _0x1001db['body']['id'];}return db[_0xd949('0x28')][_0xd949('0x44')]({'where':{'id':_0x1001db[_0xd949('0x41')]['id']}})[_0xd949('0x24')](handleEntityNotFound(_0x320541,null))[_0xd949('0x24')](saveUpdates(_0x1001db[_0xd949('0x46')],null))[_0xd949('0x24')](respondWithResult(_0x320541,null))[_0xd949('0x45')](handleError(_0x320541,null));};exports['destroy']=function(_0x130d8b,_0x220494){return db[_0xd949('0x28')]['find']({'where':{'id':_0x130d8b['params']['id']}})[_0xd949('0x24')](handleEntityNotFound(_0x220494,null))['then'](removeEntity(_0x220494,null))[_0xd949('0x45')](handleError(_0x220494,null));};exports[_0xd949('0x47')]=function(_0x4d06c9,_0x3cc3cc){return db[_0xd949('0x28')]['describe']()[_0xd949('0x24')](respondWithResult(_0x3cc3cc,null))[_0xd949('0x45')](handleError(_0x3cc3cc,null));};
\ No newline at end of file
index 0c5ea71..6a1c694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x172be5,_0x51cae2){var _0x3662b1=function(_0x29db51){while(--_0x29db51){_0x172be5['push'](_0x172be5['shift']());}};_0x3662b1(++_0x51cae2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x5fc3[_0x3438cf];return _0x278698;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x4ad8fd,_0x561f3e){var _0xe1cf0e=function(_0x1e34b9){while(--_0x1e34b9){_0x4ad8fd['push'](_0x4ad8fd['shift']());}};_0xe1cf0e(++_0x561f3e);}(_0x5fab,0x177));var _0xb5fa=function(_0x4614eb,_0x5ee1de){_0x4614eb=_0x4614eb-0x0;var _0x123f27=_0x5fab[_0x4614eb];return _0x123f27;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 2378faf..dc8b9ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7cd=['FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','raw','UpdateFaxQueueReport','update','where','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x2555fa,_0x4c53c1){var _0x1cd62d=function(_0xd395a){while(--_0xd395a){_0x2555fa['push'](_0x2555fa['shift']());}};_0x1cd62d(++_0x4c53c1);}(_0xf7cd,0x1ef));var _0xdf7c=function(_0x1ffe40,_0xa78028){_0x1ffe40=_0x1ffe40-0x0;var _0x5385e5=_0xf7cd[_0x1ffe40];return _0x5385e5;};'use strict';var _=require('lodash');var util=require(_0xdf7c('0x0'));var moment=require(_0xdf7c('0x1'));var BPromise=require(_0xdf7c('0x2'));var rs=require(_0xdf7c('0x3'));var fs=require('fs');var Redis=require(_0xdf7c('0x4'));var db=require(_0xdf7c('0x5'))['db'];var utils=require(_0xdf7c('0x6'));var logger=require(_0xdf7c('0x7'))(_0xdf7c('0x8'));var config=require(_0xdf7c('0x9'));var jayson=require(_0xdf7c('0xa'));var client=jayson['client'][_0xdf7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca9358,_0x1caca5,_0x2d7a40){return new BPromise(function(_0x570725,_0x777575){return client[_0xdf7c('0xc')](_0xca9358,_0x2d7a40)[_0xdf7c('0xd')](function(_0x4a3e7e){logger[_0xdf7c('0xe')](_0xdf7c('0xf'),_0x1caca5,'request\x20sent');logger[_0xdf7c('0x10')](_0xdf7c('0x11'),_0x1caca5,_0xdf7c('0x12'),JSON[_0xdf7c('0x13')](_0x4a3e7e));if(_0x4a3e7e[_0xdf7c('0x14')]){if(_0x4a3e7e['error'][_0xdf7c('0x15')]===0x1f4){logger['error'](_0xdf7c('0xf'),_0x1caca5,_0x4a3e7e[_0xdf7c('0x14')][_0xdf7c('0x16')]);return _0x777575(_0x4a3e7e[_0xdf7c('0x14')]['message']);}logger[_0xdf7c('0x14')](_0xdf7c('0xf'),_0x1caca5,_0x4a3e7e[_0xdf7c('0x14')][_0xdf7c('0x16')]);return _0x570725(_0x4a3e7e['error'][_0xdf7c('0x16')]);}else{logger[_0xdf7c('0xe')](_0xdf7c('0xf'),_0x1caca5,_0xdf7c('0x12'));_0x570725(_0x4a3e7e[_0xdf7c('0x17')]['message']);}})['catch'](function(_0x15893e){logger[_0xdf7c('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x1caca5,_0x15893e);_0x777575(_0x15893e);});});}exports[_0xdf7c('0x18')]=function(_0x34b78b){var _0x41c8fd=this;return new Promise(function(_0xdd006d,_0x3e0ae1){return db[_0xdf7c('0x19')][_0xdf7c('0x1a')](_0x34b78b['body'],{'raw':_0x34b78b['options']?_0x34b78b[_0xdf7c('0x1b')][_0xdf7c('0x1c')]===undefined?!![]:![]:!![]})[_0xdf7c('0xd')](function(_0x18b65b){logger[_0xdf7c('0xe')](_0xdf7c('0x18'),_0x34b78b);logger[_0xdf7c('0x10')]('CreateFaxQueueReport',_0x34b78b,JSON[_0xdf7c('0x13')](_0x18b65b));_0xdd006d(_0x18b65b);})['catch'](function(_0x382442){logger[_0xdf7c('0x14')](_0xdf7c('0x18'),_0x382442[_0xdf7c('0x16')],_0x34b78b);_0x3e0ae1(_0x41c8fd[_0xdf7c('0x14')](0x1f4,_0x382442[_0xdf7c('0x16')]));});});};exports[_0xdf7c('0x1d')]=function(_0x24e7d0){var _0x49c74c=this;return new Promise(function(_0x3b5538,_0x564b71){return db[_0xdf7c('0x19')][_0xdf7c('0x1e')](_0x24e7d0['body'],{'raw':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x1f')]||null:null,'attributes':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')][_0xdf7c('0x20')]||null:null,'limit':_0x24e7d0[_0xdf7c('0x1b')]?_0x24e7d0[_0xdf7c('0x1b')]['limit']||null:null})[_0xdf7c('0xd')](function(_0x5b0254){logger[_0xdf7c('0xe')](_0xdf7c('0x1d'),_0x24e7d0);logger['debug'](_0xdf7c('0x1d'),_0x24e7d0,JSON[_0xdf7c('0x13')](_0x5b0254));_0x3b5538(_0x5b0254);})[_0xdf7c('0x21')](function(_0x55801e){logger['error'](_0xdf7c('0x1d'),_0x55801e[_0xdf7c('0x16')],_0x24e7d0);_0x564b71(_0x49c74c[_0xdf7c('0x14')](0x1f4,_0x55801e[_0xdf7c('0x16')]));});});};
\ No newline at end of file
+var _0x5661=['request\x20sent','debug','stringify','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x5661,0x1e7));var _0x1566=function(_0x25e10c,_0x49596a){_0x25e10c=_0x25e10c-0x0;var _0x5dfd94=_0x5661[_0x25e10c];return _0x5dfd94;};'use strict';var _=require(_0x1566('0x0'));var util=require(_0x1566('0x1'));var moment=require('moment');var BPromise=require(_0x1566('0x2'));var rs=require(_0x1566('0x3'));var fs=require('fs');var Redis=require(_0x1566('0x4'));var db=require(_0x1566('0x5'))['db'];var utils=require(_0x1566('0x6'));var logger=require(_0x1566('0x7'))(_0x1566('0x8'));var config=require(_0x1566('0x9'));var jayson=require(_0x1566('0xa'));var client=jayson[_0x1566('0xb')][_0x1566('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5078be,_0x5d9809,_0x4fb0c0){return new BPromise(function(_0x4bb880,_0x24ce72){return client[_0x1566('0xd')](_0x5078be,_0x4fb0c0)[_0x1566('0xe')](function(_0x4e55cf){logger[_0x1566('0xf')](_0x1566('0x10'),_0x5d9809,_0x1566('0x11'));logger[_0x1566('0x12')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5d9809,'request\x20sent',JSON[_0x1566('0x13')](_0x4e55cf));if(_0x4e55cf['error']){if(_0x4e55cf['error'][_0x1566('0x14')]===0x1f4){logger[_0x1566('0x15')]('FaxQueueReport,\x20%s,\x20%s',_0x5d9809,_0x4e55cf[_0x1566('0x15')][_0x1566('0x16')]);return _0x24ce72(_0x4e55cf[_0x1566('0x15')]['message']);}logger[_0x1566('0x15')](_0x1566('0x10'),_0x5d9809,_0x4e55cf[_0x1566('0x15')][_0x1566('0x16')]);return _0x4bb880(_0x4e55cf['error'][_0x1566('0x16')]);}else{logger['info'](_0x1566('0x10'),_0x5d9809,_0x1566('0x11'));_0x4bb880(_0x4e55cf[_0x1566('0x17')][_0x1566('0x16')]);}})[_0x1566('0x18')](function(_0x14d4f3){logger[_0x1566('0x15')]('FaxQueueReport,\x20%s,\x20%s',_0x5d9809,_0x14d4f3);_0x24ce72(_0x14d4f3);});});}exports[_0x1566('0x19')]=function(_0x2bbc3d){var _0x3dc7da=this;return new Promise(function(_0x247582,_0x31bd53){return db[_0x1566('0x1a')][_0x1566('0x1b')](_0x2bbc3d[_0x1566('0x1c')],{'raw':_0x2bbc3d[_0x1566('0x1d')]?_0x2bbc3d[_0x1566('0x1d')][_0x1566('0x1e')]===undefined?!![]:![]:!![]})[_0x1566('0xe')](function(_0x3c26a9){logger[_0x1566('0xf')](_0x1566('0x19'),_0x2bbc3d);logger[_0x1566('0x12')](_0x1566('0x19'),_0x2bbc3d,JSON[_0x1566('0x13')](_0x3c26a9));_0x247582(_0x3c26a9);})['catch'](function(_0x3dbaa4){logger[_0x1566('0x15')](_0x1566('0x19'),_0x3dbaa4['message'],_0x2bbc3d);_0x31bd53(_0x3dc7da[_0x1566('0x15')](0x1f4,_0x3dbaa4[_0x1566('0x16')]));});});};exports[_0x1566('0x1f')]=function(_0x16d817){var _0x470b04=this;return new Promise(function(_0x4d3fe2,_0x6c8107){return db[_0x1566('0x1a')][_0x1566('0x20')](_0x16d817[_0x1566('0x1c')],{'raw':_0x16d817[_0x1566('0x1d')]?_0x16d817[_0x1566('0x1d')][_0x1566('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16d817[_0x1566('0x1d')]?_0x16d817['options'][_0x1566('0x21')]||null:null,'attributes':_0x16d817[_0x1566('0x1d')]?_0x16d817[_0x1566('0x1d')][_0x1566('0x22')]||null:null,'limit':_0x16d817['options']?_0x16d817[_0x1566('0x1d')][_0x1566('0x23')]||null:null})[_0x1566('0xe')](function(_0x1f9095){logger['info']('UpdateFaxQueueReport',_0x16d817);logger[_0x1566('0x12')](_0x1566('0x1f'),_0x16d817,JSON[_0x1566('0x13')](_0x1f9095));_0x4d3fe2(_0x1f9095);})[_0x1566('0x18')](function(_0x29c830){logger['error'](_0x1566('0x1f'),_0x29c830['message'],_0x16d817);_0x6c8107(_0x470b04[_0x1566('0x15')](0x1f4,_0x29c830[_0x1566('0x16')]));});});};
\ No newline at end of file
index ea88613..6486079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01e3=['/describe','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x585c86,_0x1489e4){var _0x1100bc=function(_0x7bf28){while(--_0x7bf28){_0x585c86['push'](_0x585c86['shift']());}};_0x1100bc(++_0x1489e4);}(_0x01e3,0xf9));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x301e('0x0'));var util=require('util');var path=require(_0x301e('0x1'));var timeout=require(_0x301e('0x2'));var express=require(_0x301e('0x3'));var router=express[_0x301e('0x4')]();var fs_extra=require(_0x301e('0x5'));var auth=require(_0x301e('0x6'));var interaction=require(_0x301e('0x7'));var config=require(_0x301e('0x8'));var controller=require(_0x301e('0x9'));router[_0x301e('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x301e('0xa')](_0x301e('0xb'),auth[_0x301e('0xc')](),controller['describe']);router[_0x301e('0xa')](_0x301e('0xd'),auth[_0x301e('0xc')](),controller[_0x301e('0xe')]);router[_0x301e('0xf')]('/',auth[_0x301e('0xc')](),controller[_0x301e('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x301e('0x11')](_0x301e('0xd'),auth[_0x301e('0xc')](),controller[_0x301e('0x12')]);module[_0x301e('0x13')]=router;
\ No newline at end of file
+var _0x94dd=['./faxQueueReport.controller','index','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x49b4fe,_0x12ff3d){var _0x9516f1=function(_0x3c4ed3){while(--_0x3c4ed3){_0x49b4fe['push'](_0x49b4fe['shift']());}};_0x9516f1(++_0x12ff3d);}(_0x94dd,0x1ee));var _0xd94d=function(_0x54059f,_0x552d92){_0x54059f=_0x54059f-0x0;var _0x9e5b25=_0x94dd[_0x54059f];return _0x9e5b25;};'use strict';var multer=require(_0xd94d('0x0'));var util=require(_0xd94d('0x1'));var path=require(_0xd94d('0x2'));var timeout=require(_0xd94d('0x3'));var express=require(_0xd94d('0x4'));var router=express[_0xd94d('0x5')]();var fs_extra=require(_0xd94d('0x6'));var auth=require(_0xd94d('0x7'));var interaction=require(_0xd94d('0x8'));var config=require(_0xd94d('0x9'));var controller=require(_0xd94d('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xd94d('0xb')]);router['get']('/describe',auth[_0xd94d('0xc')](),controller[_0xd94d('0xd')]);router[_0xd94d('0xe')](_0xd94d('0xf'),auth[_0xd94d('0xc')](),controller[_0xd94d('0x10')]);router[_0xd94d('0x11')]('/',auth['isAuthenticated'](),controller[_0xd94d('0x12')]);router[_0xd94d('0x13')](_0xd94d('0xf'),auth[_0xd94d('0xc')](),controller[_0xd94d('0x14')]);router[_0xd94d('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd94d('0x16')]);module[_0xd94d('0x17')]=router;
\ No newline at end of file
index 77cac38..e37d82d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x5a26f5,_0x196300){var _0x2e9ef7=function(_0x593736){while(--_0x593736){_0x5a26f5['push'](_0x5a26f5['shift']());}};_0x2e9ef7(++_0x196300);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4312f0,_0x47772f){_0x4312f0=_0x4312f0-0x0;var _0x3d89f4=_0x9bde[_0x4312f0];return _0x3d89f4;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xb43b,0x1b2));var _0xbb43=function(_0x299e8a,_0x223627){_0x299e8a=_0x299e8a-0x0;var _0x3aec82=_0xb43b[_0x299e8a];return _0x3aec82;};'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 1c2a015..a4b8d7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa357=['rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','FaxTransferReport','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','rimraf','request-promise','bluebird','util','path','to-csv','ejs','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','status','end','undefined','limit','count','offset','set','apply','reject','update','then','error','stack','name','send','index'];(function(_0x419aa4,_0x5926a7){var _0x557d9b=function(_0x43c9ac){while(--_0x43c9ac){_0x419aa4['push'](_0x419aa4['shift']());}};_0x557d9b(++_0x5926a7);}(_0xa357,0x172));var _0x7a35=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xa357[_0x1b1a3b];return _0x385347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7a35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7a35('0x1'));var moment=require('moment');var BPromise=require(_0x7a35('0x2'));var Mustache=require('mustache');var util=require(_0x7a35('0x3'));var path=require(_0x7a35('0x4'));var sox=require('sox');var csv=require(_0x7a35('0x5'));var ejs=require(_0x7a35('0x6'));var fs=require('fs');var fs_extra=require(_0x7a35('0x7'));var _=require(_0x7a35('0x8'));var squel=require(_0x7a35('0x9'));var crypto=require('crypto');var jsforce=require(_0x7a35('0xa'));var deskjs=require(_0x7a35('0xb'));var toCsv=require(_0x7a35('0x5'));var querystring=require('querystring');var Papa=require(_0x7a35('0xc'));var Redis=require('ioredis');var authService=require(_0x7a35('0xd'));var qs=require(_0x7a35('0xe'));var as=require(_0x7a35('0xf'));var hardwareService=require(_0x7a35('0x10'));var logger=require(_0x7a35('0x11'))(_0x7a35('0x12'));var utils=require(_0x7a35('0x13'));var config=require(_0x7a35('0x14'));var licenseUtil=require(_0x7a35('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58895d,_0x4c7bd3){_0x4c7bd3=_0x4c7bd3||0xcc;return function(_0x58b163){if(_0x58b163){return _0x58895d['sendStatus'](_0x4c7bd3);}return _0x58895d[_0x7a35('0x16')](_0x4c7bd3)[_0x7a35('0x17')]();};}function respondWithResult(_0x391164,_0x24880c){_0x24880c=_0x24880c||0xc8;return function(_0x139ef8){if(_0x139ef8){return _0x391164[_0x7a35('0x16')](_0x24880c)['json'](_0x139ef8);}};}function respondWithFilteredResult(_0x54d5fb,_0x338afc){return function(_0x4ca4c3){if(_0x4ca4c3){var _0x6085a2=typeof _0x338afc['offset']===_0x7a35('0x18')&&typeof _0x338afc[_0x7a35('0x19')]==='undefined';var _0x7a4462=_0x4ca4c3[_0x7a35('0x1a')];var _0x1486fc=_0x6085a2?0x0:_0x338afc[_0x7a35('0x1b')];var _0x3a16ea=_0x6085a2?_0x4ca4c3['count']:_0x338afc['offset']+_0x338afc[_0x7a35('0x19')];var _0x220751;if(_0x3a16ea>=_0x7a4462){_0x3a16ea=_0x7a4462;_0x220751=0xc8;}else{_0x220751=0xce;}_0x54d5fb['status'](_0x220751);return _0x54d5fb[_0x7a35('0x1c')]('Content-Range',_0x1486fc+'-'+_0x3a16ea+'/'+_0x7a4462)['json'](_0x4ca4c3);}return null;};}function patchUpdates(_0x41e576){return function(_0x3bac30){try{jsonpatch[_0x7a35('0x1d')](_0x3bac30,_0x41e576,!![]);}catch(_0x48c606){return BPromise[_0x7a35('0x1e')](_0x48c606);}return _0x3bac30['save']();};}function saveUpdates(_0x43dca9,_0x4ec9c8){return function(_0x6fb75e){if(_0x6fb75e){return _0x6fb75e[_0x7a35('0x1f')](_0x43dca9)[_0x7a35('0x20')](function(_0x3d5494){return _0x3d5494;});}return null;};}function removeEntity(_0x69981d,_0x54a8fd){return function(_0x55b5cb){if(_0x55b5cb){return _0x55b5cb['destroy']()['then'](function(){_0x69981d[_0x7a35('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190a28,_0x38100d){return function(_0x180781){if(!_0x180781){_0x190a28['sendStatus'](0x194);}return _0x180781;};}function handleError(_0x6680b6,_0x15030e){_0x15030e=_0x15030e||0x1f4;return function(_0x2e00bb){logger[_0x7a35('0x21')](_0x2e00bb[_0x7a35('0x22')]);if(_0x2e00bb['name']){delete _0x2e00bb[_0x7a35('0x23')];}_0x6680b6[_0x7a35('0x16')](_0x15030e)[_0x7a35('0x24')](_0x2e00bb);};}exports[_0x7a35('0x25')]=function(_0x32b73d,_0x548a83){var _0x15d2e4={},_0x1e3f8e={},_0x335901={'count':0x0,'rows':[]};var _0x1ea3d4=_['map'](db['FaxTransferReport'][_0x7a35('0x26')],function(_0x399d21){return{'name':_0x399d21['fieldName'],'type':_0x399d21[_0x7a35('0x27')][_0x7a35('0x28')]};});_0x1e3f8e['model']=_['map'](_0x1ea3d4,_0x7a35('0x23'));_0x1e3f8e[_0x7a35('0x29')]=_['keys'](_0x32b73d[_0x7a35('0x29')]);_0x1e3f8e[_0x7a35('0x2a')]=_[_0x7a35('0x2b')](_0x1e3f8e[_0x7a35('0x2c')],_0x1e3f8e[_0x7a35('0x29')]);_0x15d2e4[_0x7a35('0x2d')]=_[_0x7a35('0x2b')](_0x1e3f8e[_0x7a35('0x2c')],qs[_0x7a35('0x2e')](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x2e')]));_0x15d2e4['attributes']=_0x15d2e4['attributes'][_0x7a35('0x2f')]?_0x15d2e4[_0x7a35('0x2d')]:_0x1e3f8e[_0x7a35('0x2c')];if(!_0x32b73d[_0x7a35('0x29')][_0x7a35('0x30')](_0x7a35('0x31'))){_0x15d2e4[_0x7a35('0x19')]=qs[_0x7a35('0x19')](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x19')]);_0x15d2e4['offset']=qs['offset'](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x1b')]);}_0x15d2e4['order']=qs['sort'](_0x32b73d[_0x7a35('0x29')][_0x7a35('0x32')]);_0x15d2e4[_0x7a35('0x33')]=qs[_0x7a35('0x2a')](_['pick'](_0x32b73d[_0x7a35('0x29')],_0x1e3f8e['filters']),_0x1ea3d4);if(_0x32b73d['query'][_0x7a35('0x34')]){_0x15d2e4[_0x7a35('0x33')]=_[_0x7a35('0x35')](_0x15d2e4['where'],{'$or':_['map'](_0x1ea3d4,function(_0x266804){if(_0x266804[_0x7a35('0x27')]!=='VIRTUAL'){var _0x205447={};_0x205447[_0x266804[_0x7a35('0x23')]]={'$like':'%'+_0x32b73d[_0x7a35('0x29')][_0x7a35('0x34')]+'%'};return _0x205447;}})});}_0x15d2e4=_[_0x7a35('0x35')]({},_0x15d2e4,_0x32b73d[_0x7a35('0x36')]);var _0x449db6={'where':_0x15d2e4['where']};return db[_0x7a35('0x37')][_0x7a35('0x1a')](_0x449db6)[_0x7a35('0x20')](function(_0x6779ae){_0x335901[_0x7a35('0x1a')]=_0x6779ae;if(_0x32b73d[_0x7a35('0x29')]['includeAll']){_0x15d2e4[_0x7a35('0x38')]=[{'all':!![]}];}return db[_0x7a35('0x37')][_0x7a35('0x39')](_0x15d2e4);})['then'](function(_0x1687be){_0x335901[_0x7a35('0x3a')]=_0x1687be;return _0x335901;})[_0x7a35('0x20')](respondWithFilteredResult(_0x548a83,_0x15d2e4))[_0x7a35('0x3b')](handleError(_0x548a83,null));};exports[_0x7a35('0x3c')]=function(_0xb3a061,_0x1d99da){var _0x1537e9={'raw':!![],'where':{'id':_0xb3a061[_0x7a35('0x3d')]['id']}},_0x13272b={};_0x13272b['model']=_[_0x7a35('0x3e')](db[_0x7a35('0x37')]['rawAttributes']);_0x13272b[_0x7a35('0x29')]=_[_0x7a35('0x3e')](_0xb3a061[_0x7a35('0x29')]);_0x13272b[_0x7a35('0x2a')]=_[_0x7a35('0x2b')](_0x13272b[_0x7a35('0x2c')],_0x13272b[_0x7a35('0x29')]);_0x1537e9['attributes']=_[_0x7a35('0x2b')](_0x13272b['model'],qs[_0x7a35('0x2e')](_0xb3a061[_0x7a35('0x29')]['fields']));_0x1537e9[_0x7a35('0x2d')]=_0x1537e9[_0x7a35('0x2d')][_0x7a35('0x2f')]?_0x1537e9[_0x7a35('0x2d')]:_0x13272b[_0x7a35('0x2c')];if(_0xb3a061['query'][_0x7a35('0x3f')]){_0x1537e9[_0x7a35('0x38')]=[{'all':!![]}];}_0x1537e9=_[_0x7a35('0x35')]({},_0x1537e9,_0xb3a061[_0x7a35('0x36')]);return db[_0x7a35('0x37')][_0x7a35('0x40')](_0x1537e9)[_0x7a35('0x20')](handleEntityNotFound(_0x1d99da,null))[_0x7a35('0x20')](respondWithResult(_0x1d99da,null))['catch'](handleError(_0x1d99da,null));};exports[_0x7a35('0x41')]=function(_0x302faf,_0x22754c){return db[_0x7a35('0x37')]['create'](_0x302faf[_0x7a35('0x42')],{})[_0x7a35('0x20')](respondWithResult(_0x22754c,0xc9))[_0x7a35('0x3b')](handleError(_0x22754c,null));};exports[_0x7a35('0x1f')]=function(_0x7370e,_0xcff456){if(_0x7370e['body']['id']){delete _0x7370e['body']['id'];}return db[_0x7a35('0x37')][_0x7a35('0x40')]({'where':{'id':_0x7370e[_0x7a35('0x3d')]['id']}})[_0x7a35('0x20')](handleEntityNotFound(_0xcff456,null))['then'](saveUpdates(_0x7370e['body'],null))['then'](respondWithResult(_0xcff456,null))[_0x7a35('0x3b')](handleError(_0xcff456,null));};exports['destroy']=function(_0x596131,_0x5bc4ed){return db[_0x7a35('0x37')][_0x7a35('0x40')]({'where':{'id':_0x596131[_0x7a35('0x3d')]['id']}})[_0x7a35('0x20')](handleEntityNotFound(_0x5bc4ed,null))[_0x7a35('0x20')](removeEntity(_0x5bc4ed,null))[_0x7a35('0x3b')](handleError(_0x5bc4ed,null));};exports[_0x7a35('0x43')]=function(_0x1b0803,_0x188a66){return db['FaxTransferReport'][_0x7a35('0x43')]()[_0x7a35('0x20')](respondWithResult(_0x188a66,null))[_0x7a35('0x3b')](handleError(_0x188a66,null));};
\ No newline at end of file
+var _0x7294=['set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count'];(function(_0x44799d,_0x26c23a){var _0x4f4a20=function(_0x298a71){while(--_0x298a71){_0x44799d['push'](_0x44799d['shift']());}};_0x4f4a20(++_0x26c23a);}(_0x7294,0xc7));var _0x4729=function(_0x5c1adf,_0x4d07b5){_0x5c1adf=_0x5c1adf-0x0;var _0x3f601b=_0x7294[_0x5c1adf];return _0x3f601b;};'use strict';var emlformat=require(_0x4729('0x0'));var rimraf=require(_0x4729('0x1'));var zipdir=require(_0x4729('0x2'));var jsonpatch=require(_0x4729('0x3'));var rp=require(_0x4729('0x4'));var moment=require(_0x4729('0x5'));var BPromise=require(_0x4729('0x6'));var Mustache=require(_0x4729('0x7'));var util=require(_0x4729('0x8'));var path=require('path');var sox=require(_0x4729('0x9'));var csv=require(_0x4729('0xa'));var ejs=require(_0x4729('0xb'));var fs=require('fs');var fs_extra=require(_0x4729('0xc'));var _=require(_0x4729('0xd'));var squel=require('squel');var crypto=require(_0x4729('0xe'));var jsforce=require(_0x4729('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4729('0x10'));var Papa=require(_0x4729('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4729('0x12'));var hardwareService=require(_0x4729('0x13'));var logger=require(_0x4729('0x14'))(_0x4729('0x15'));var utils=require(_0x4729('0x16'));var config=require(_0x4729('0x17'));var licenseUtil=require(_0x4729('0x18'));var db=require(_0x4729('0x19'))['db'];function respondWithStatusCode(_0x5a9c1a,_0x54c8c1){_0x54c8c1=_0x54c8c1||0xcc;return function(_0x10e656){if(_0x10e656){return _0x5a9c1a['sendStatus'](_0x54c8c1);}return _0x5a9c1a[_0x4729('0x1a')](_0x54c8c1)[_0x4729('0x1b')]();};}function respondWithResult(_0x1ed67f,_0x5a1d25){_0x5a1d25=_0x5a1d25||0xc8;return function(_0x17efdc){if(_0x17efdc){return _0x1ed67f['status'](_0x5a1d25)[_0x4729('0x1c')](_0x17efdc);}};}function respondWithFilteredResult(_0x47676b,_0x55eb3a){return function(_0x3afe32){if(_0x3afe32){var _0x100f44=typeof _0x55eb3a[_0x4729('0x1d')]===_0x4729('0x1e')&&typeof _0x55eb3a['limit']===_0x4729('0x1e');var _0x2902e3=_0x3afe32[_0x4729('0x1f')];var _0xece4b5=_0x100f44?0x0:_0x55eb3a[_0x4729('0x1d')];var _0x3eff3b=_0x100f44?_0x3afe32[_0x4729('0x1f')]:_0x55eb3a[_0x4729('0x1d')]+_0x55eb3a['limit'];var _0x5bebdd;if(_0x3eff3b>=_0x2902e3){_0x3eff3b=_0x2902e3;_0x5bebdd=0xc8;}else{_0x5bebdd=0xce;}_0x47676b[_0x4729('0x1a')](_0x5bebdd);return _0x47676b[_0x4729('0x20')](_0x4729('0x21'),_0xece4b5+'-'+_0x3eff3b+'/'+_0x2902e3)['json'](_0x3afe32);}return null;};}function patchUpdates(_0x2df929){return function(_0x279552){try{jsonpatch[_0x4729('0x22')](_0x279552,_0x2df929,!![]);}catch(_0x43d4ea){return BPromise[_0x4729('0x23')](_0x43d4ea);}return _0x279552['save']();};}function saveUpdates(_0x16c726,_0x3e6cb4){return function(_0x125dc0){if(_0x125dc0){return _0x125dc0[_0x4729('0x24')](_0x16c726)[_0x4729('0x25')](function(_0x1b5356){return _0x1b5356;});}return null;};}function removeEntity(_0x2b2be1,_0x24aaf8){return function(_0x1d5faf){if(_0x1d5faf){return _0x1d5faf['destroy']()[_0x4729('0x25')](function(){_0x2b2be1['status'](0xcc)[_0x4729('0x1b')]();});}};}function handleEntityNotFound(_0x47a97f,_0x469a97){return function(_0x198f43){if(!_0x198f43){_0x47a97f[_0x4729('0x26')](0x194);}return _0x198f43;};}function handleError(_0x4adc20,_0x4a9a41){_0x4a9a41=_0x4a9a41||0x1f4;return function(_0x3aa2e0){logger[_0x4729('0x27')](_0x3aa2e0[_0x4729('0x28')]);if(_0x3aa2e0[_0x4729('0x29')]){delete _0x3aa2e0[_0x4729('0x29')];}_0x4adc20[_0x4729('0x1a')](_0x4a9a41)[_0x4729('0x2a')](_0x3aa2e0);};}exports[_0x4729('0x2b')]=function(_0x86fa03,_0x3e44d8){var _0x39af0b={},_0x2554ad={},_0xa58307={'count':0x0,'rows':[]};var _0x2e9da8=_[_0x4729('0x2c')](db[_0x4729('0x2d')][_0x4729('0x2e')],function(_0x3acec7){return{'name':_0x3acec7[_0x4729('0x2f')],'type':_0x3acec7[_0x4729('0x30')]['key']};});_0x2554ad[_0x4729('0x31')]=_[_0x4729('0x2c')](_0x2e9da8,'name');_0x2554ad[_0x4729('0x32')]=_[_0x4729('0x33')](_0x86fa03[_0x4729('0x32')]);_0x2554ad['filters']=_[_0x4729('0x34')](_0x2554ad['model'],_0x2554ad[_0x4729('0x32')]);_0x39af0b[_0x4729('0x35')]=_['intersection'](_0x2554ad[_0x4729('0x31')],qs[_0x4729('0x36')](_0x86fa03['query']['fields']));_0x39af0b[_0x4729('0x35')]=_0x39af0b[_0x4729('0x35')][_0x4729('0x37')]?_0x39af0b['attributes']:_0x2554ad[_0x4729('0x31')];if(!_0x86fa03[_0x4729('0x32')][_0x4729('0x38')](_0x4729('0x39'))){_0x39af0b[_0x4729('0x3a')]=qs['limit'](_0x86fa03[_0x4729('0x32')][_0x4729('0x3a')]);_0x39af0b[_0x4729('0x1d')]=qs[_0x4729('0x1d')](_0x86fa03[_0x4729('0x32')][_0x4729('0x1d')]);}_0x39af0b['order']=qs['sort'](_0x86fa03[_0x4729('0x32')][_0x4729('0x3b')]);_0x39af0b['where']=qs[_0x4729('0x3c')](_[_0x4729('0x3d')](_0x86fa03[_0x4729('0x32')],_0x2554ad[_0x4729('0x3c')]),_0x2e9da8);if(_0x86fa03['query'][_0x4729('0x3e')]){_0x39af0b[_0x4729('0x3f')]=_['merge'](_0x39af0b['where'],{'$or':_[_0x4729('0x2c')](_0x2e9da8,function(_0x26a9af){if(_0x26a9af[_0x4729('0x30')]!=='VIRTUAL'){var _0xd9d9e9={};_0xd9d9e9[_0x26a9af[_0x4729('0x29')]]={'$like':'%'+_0x86fa03['query']['filter']+'%'};return _0xd9d9e9;}})});}_0x39af0b=_[_0x4729('0x40')]({},_0x39af0b,_0x86fa03['options']);var _0xe1a86c={'where':_0x39af0b[_0x4729('0x3f')]};return db[_0x4729('0x2d')][_0x4729('0x1f')](_0xe1a86c)[_0x4729('0x25')](function(_0x4a1c5a){_0xa58307[_0x4729('0x1f')]=_0x4a1c5a;if(_0x86fa03[_0x4729('0x32')][_0x4729('0x41')]){_0x39af0b['include']=[{'all':!![]}];}return db[_0x4729('0x2d')][_0x4729('0x42')](_0x39af0b);})[_0x4729('0x25')](function(_0x3cf352){_0xa58307[_0x4729('0x43')]=_0x3cf352;return _0xa58307;})['then'](respondWithFilteredResult(_0x3e44d8,_0x39af0b))[_0x4729('0x44')](handleError(_0x3e44d8,null));};exports[_0x4729('0x45')]=function(_0x18f91b,_0x222ed4){var _0x3ab3bd={'raw':!![],'where':{'id':_0x18f91b[_0x4729('0x46')]['id']}},_0x576792={};_0x576792['model']=_[_0x4729('0x33')](db['FaxTransferReport'][_0x4729('0x2e')]);_0x576792['query']=_['keys'](_0x18f91b[_0x4729('0x32')]);_0x576792[_0x4729('0x3c')]=_[_0x4729('0x34')](_0x576792[_0x4729('0x31')],_0x576792[_0x4729('0x32')]);_0x3ab3bd[_0x4729('0x35')]=_[_0x4729('0x34')](_0x576792['model'],qs[_0x4729('0x36')](_0x18f91b['query'][_0x4729('0x36')]));_0x3ab3bd['attributes']=_0x3ab3bd[_0x4729('0x35')]['length']?_0x3ab3bd[_0x4729('0x35')]:_0x576792[_0x4729('0x31')];if(_0x18f91b[_0x4729('0x32')][_0x4729('0x41')]){_0x3ab3bd[_0x4729('0x47')]=[{'all':!![]}];}_0x3ab3bd=_['merge']({},_0x3ab3bd,_0x18f91b['options']);return db['FaxTransferReport'][_0x4729('0x48')](_0x3ab3bd)[_0x4729('0x25')](handleEntityNotFound(_0x222ed4,null))['then'](respondWithResult(_0x222ed4,null))[_0x4729('0x44')](handleError(_0x222ed4,null));};exports[_0x4729('0x49')]=function(_0x26cb89,_0x5d28d3){return db[_0x4729('0x2d')][_0x4729('0x49')](_0x26cb89['body'],{})['then'](respondWithResult(_0x5d28d3,0xc9))[_0x4729('0x44')](handleError(_0x5d28d3,null));};exports[_0x4729('0x24')]=function(_0x41ef43,_0x121634){if(_0x41ef43[_0x4729('0x4a')]['id']){delete _0x41ef43[_0x4729('0x4a')]['id'];}return db[_0x4729('0x2d')][_0x4729('0x48')]({'where':{'id':_0x41ef43['params']['id']}})[_0x4729('0x25')](handleEntityNotFound(_0x121634,null))[_0x4729('0x25')](saveUpdates(_0x41ef43[_0x4729('0x4a')],null))['then'](respondWithResult(_0x121634,null))[_0x4729('0x44')](handleError(_0x121634,null));};exports[_0x4729('0x4b')]=function(_0x403c21,_0x3d6eed){return db[_0x4729('0x2d')][_0x4729('0x48')]({'where':{'id':_0x403c21['params']['id']}})[_0x4729('0x25')](handleEntityNotFound(_0x3d6eed,null))[_0x4729('0x25')](removeEntity(_0x3d6eed,null))[_0x4729('0x44')](handleError(_0x3d6eed,null));};exports['describe']=function(_0x37aeab,_0x9f3056){return db['FaxTransferReport'][_0x4729('0x4c')]()[_0x4729('0x25')](respondWithResult(_0x9f3056,null))[_0x4729('0x44')](handleError(_0x9f3056,null));};
\ No newline at end of file
index 67d8709..8d5d851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a3=['define','report_fax_transfer','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x484195,_0x25a4d2){var _0xd057ff=function(_0x4a1b2b){while(--_0x4a1b2b){_0x484195['push'](_0x484195['shift']());}};_0xd057ff(++_0x25a4d2);}(_0xa3a3,0x141));var _0x3a3a=function(_0x35bb5b,_0x5f5200){_0x35bb5b=_0x35bb5b-0x0;var _0x53a08a=_0xa3a3[_0x35bb5b];return _0x53a08a;};'use strict';var _=require('lodash');var util=require(_0x3a3a('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3a3a('0x1'));var BPromise=require(_0x3a3a('0x2'));var rp=require(_0x3a3a('0x3'));var fs=require('fs');var path=require(_0x3a3a('0x4'));var rimraf=require(_0x3a3a('0x5'));var config=require(_0x3a3a('0x6'));var attributes=require(_0x3a3a('0x7'));module[_0x3a3a('0x8')]=function(_0x36b63d,_0x497a1b){return _0x36b63d[_0x3a3a('0x9')]('FaxTransferReport',attributes,{'tableName':_0x3a3a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5060=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x38509a,_0x3ef6bb){var _0xbb0aac=function(_0x3b5e54){while(--_0x3b5e54){_0x38509a['push'](_0x38509a['shift']());}};_0xbb0aac(++_0x3ef6bb);}(_0x5060,0x13f));var _0x0506=function(_0x1e228f,_0x3361ad){_0x1e228f=_0x1e228f-0x0;var _0x359921=_0x5060[_0x1e228f];return _0x359921;};'use strict';var _=require(_0x0506('0x0'));var util=require(_0x0506('0x1'));var logger=require(_0x0506('0x2'))(_0x0506('0x3'));var moment=require(_0x0506('0x4'));var BPromise=require(_0x0506('0x5'));var rp=require(_0x0506('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x0506('0x7')]=function(_0x3700ae,_0x32c5d5){return _0x3700ae[_0x0506('0x8')](_0x0506('0x9'),attributes,{'tableName':_0x0506('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 29d099e..09d5677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe01b=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3c23fb,_0x44e8a0){var _0x1ba956=function(_0x2dafb4){while(--_0x2dafb4){_0x3c23fb['push'](_0x3c23fb['shift']());}};_0x1ba956(++_0x44e8a0);}(_0xe01b,0x7e));var _0xbe01=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xe01b[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xbe01('0x0'));var util=require(_0xbe01('0x1'));var moment=require('moment');var BPromise=require(_0xbe01('0x2'));var rs=require(_0xbe01('0x3'));var fs=require('fs');var Redis=require(_0xbe01('0x4'));var db=require(_0xbe01('0x5'))['db'];var utils=require(_0xbe01('0x6'));var logger=require(_0xbe01('0x7'))(_0xbe01('0x8'));var config=require(_0xbe01('0x9'));var jayson=require(_0xbe01('0xa'));var client=jayson[_0xbe01('0xb')][_0xbe01('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c93ac,_0x3e4327,_0x175a69){return new BPromise(function(_0x496d2c,_0xe13df3){return client[_0xbe01('0xd')](_0x2c93ac,_0x175a69)[_0xbe01('0xe')](function(_0x39de6c){logger[_0xbe01('0xf')](_0xbe01('0x10'),_0x3e4327,_0xbe01('0x11'));logger[_0xbe01('0x12')](_0xbe01('0x13'),_0x3e4327,'request\x20sent',JSON['stringify'](_0x39de6c));if(_0x39de6c['error']){if(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x15')]===0x1f4){logger[_0xbe01('0x14')](_0xbe01('0x10'),_0x3e4327,_0x39de6c['error'][_0xbe01('0x16')]);return _0xe13df3(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);}logger[_0xbe01('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x3e4327,_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);return _0x496d2c(_0x39de6c[_0xbe01('0x14')][_0xbe01('0x16')]);}else{logger[_0xbe01('0xf')](_0xbe01('0x10'),_0x3e4327,_0xbe01('0x11'));_0x496d2c(_0x39de6c[_0xbe01('0x17')][_0xbe01('0x16')]);}})[_0xbe01('0x18')](function(_0x3c046c){logger[_0xbe01('0x14')](_0xbe01('0x10'),_0x3e4327,_0x3c046c);_0xe13df3(_0x3c046c);});});}
\ No newline at end of file
+var _0x5f6d=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x5f6d,0x1e8));var _0xd5f6=function(_0x1aa012,_0xab696d){_0x1aa012=_0x1aa012-0x0;var _0x3c1f56=_0x5f6d[_0x1aa012];return _0x3c1f56;};'use strict';var _=require('lodash');var util=require(_0xd5f6('0x0'));var moment=require(_0xd5f6('0x1'));var BPromise=require(_0xd5f6('0x2'));var rs=require(_0xd5f6('0x3'));var fs=require('fs');var Redis=require(_0xd5f6('0x4'));var db=require(_0xd5f6('0x5'))['db'];var utils=require(_0xd5f6('0x6'));var logger=require(_0xd5f6('0x7'))(_0xd5f6('0x8'));var config=require('../../config/environment');var jayson=require(_0xd5f6('0x9'));var client=jayson[_0xd5f6('0xa')][_0xd5f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x69fb18,_0x4276b7,_0x2c282b){return new BPromise(function(_0xd5e3a9,_0x419665){return client[_0xd5f6('0xc')](_0x69fb18,_0x2c282b)['then'](function(_0x527106){logger[_0xd5f6('0xd')](_0xd5f6('0xe'),_0x4276b7,'request\x20sent');logger[_0xd5f6('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4276b7,_0xd5f6('0x10'),JSON['stringify'](_0x527106));if(_0x527106['error']){if(_0x527106[_0xd5f6('0x11')][_0xd5f6('0x12')]===0x1f4){logger[_0xd5f6('0x11')](_0xd5f6('0xe'),_0x4276b7,_0x527106[_0xd5f6('0x11')][_0xd5f6('0x13')]);return _0x419665(_0x527106[_0xd5f6('0x11')][_0xd5f6('0x13')]);}logger[_0xd5f6('0x11')](_0xd5f6('0xe'),_0x4276b7,_0x527106['error'][_0xd5f6('0x13')]);return _0xd5e3a9(_0x527106[_0xd5f6('0x11')]['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x4276b7,_0xd5f6('0x10'));_0xd5e3a9(_0x527106[_0xd5f6('0x14')][_0xd5f6('0x13')]);}})[_0xd5f6('0x15')](function(_0x444e1a){logger[_0xd5f6('0x11')](_0xd5f6('0xe'),_0x4276b7,_0x444e1a);_0x419665(_0x444e1a);});});}
\ No newline at end of file
index e2dab2d..94f0cc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ea1=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy'];(function(_0x133c1c,_0x52fd1f){var _0x138a82=function(_0x28e94a){while(--_0x28e94a){_0x133c1c['push'](_0x133c1c['shift']());}};_0x138a82(++_0x52fd1f);}(_0x8ea1,0x169));var _0x18ea=function(_0x5b3c61,_0x3eb2aa){_0x5b3c61=_0x5b3c61-0x0;var _0x153389=_0x8ea1[_0x5b3c61];return _0x153389;};'use strict';var multer=require('multer');var util=require(_0x18ea('0x0'));var path=require(_0x18ea('0x1'));var timeout=require(_0x18ea('0x2'));var express=require(_0x18ea('0x3'));var router=express[_0x18ea('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x18ea('0x5'));var interaction=require(_0x18ea('0x6'));var config=require(_0x18ea('0x7'));var controller=require(_0x18ea('0x8'));router[_0x18ea('0x9')]('/',auth[_0x18ea('0xa')](),controller[_0x18ea('0xb')]);router[_0x18ea('0x9')]('/describe',auth[_0x18ea('0xa')](),controller[_0x18ea('0xc')]);router['get'](_0x18ea('0xd'),auth[_0x18ea('0xa')](),controller[_0x18ea('0xe')]);router[_0x18ea('0xf')]('/',auth[_0x18ea('0xa')](),controller['create']);router[_0x18ea('0x10')](_0x18ea('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x18ea('0x11')]('/:id',auth[_0x18ea('0xa')](),controller[_0x18ea('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xbbbf=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','post','put','update'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0xbbbf,0x1ac));var _0xfbbb=function(_0x424a6a,_0x1c8a63){_0x424a6a=_0x424a6a-0x0;var _0x4700d7=_0xbbbf[_0x424a6a];return _0x4700d7;};'use strict';var multer=require(_0xfbbb('0x0'));var util=require(_0xfbbb('0x1'));var path=require('path');var timeout=require(_0xfbbb('0x2'));var express=require(_0xfbbb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfbbb('0x4'));var config=require(_0xfbbb('0x5'));var controller=require(_0xfbbb('0x6'));router[_0xfbbb('0x7')]('/',auth[_0xfbbb('0x8')](),controller['index']);router[_0xfbbb('0x7')]('/describe',auth[_0xfbbb('0x8')](),controller[_0xfbbb('0x9')]);router[_0xfbbb('0x7')](_0xfbbb('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xfbbb('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfbbb('0xc')](_0xfbbb('0xa'),auth['isAuthenticated'](),controller[_0xfbbb('0xd')]);router[_0xfbbb('0xe')]('/:id',auth[_0xfbbb('0x8')](),controller[_0xfbbb('0xf')]);module[_0xfbbb('0x10')]=router;
\ No newline at end of file
index 40bfd72..b3498e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x244b=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update'];(function(_0x46fdfc,_0x43cdbd){var _0x54eef3=function(_0x4cdbe5){while(--_0x4cdbe5){_0x46fdfc['push'](_0x46fdfc['shift']());}};_0x54eef3(++_0x43cdbd);}(_0x244b,0x1ba));var _0xb244=function(_0x1af4c8,_0x1ddb77){_0x1af4c8=_0x1af4c8-0x0;var _0x34d739=_0x244b[_0x1af4c8];return _0x34d739;};'use strict';var multer=require(_0xb244('0x0'));var util=require('util');var path=require(_0xb244('0x1'));var timeout=require(_0xb244('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb244('0x3'));var auth=require(_0xb244('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xb244('0x5')](),controller[_0xb244('0x6')]);router[_0xb244('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb244('0x7')](_0xb244('0x8'),auth[_0xb244('0x5')](),controller[_0xb244('0x9')]);router['get'](_0xb244('0xa'),auth['isAuthenticated'](),controller[_0xb244('0xb')]);router[_0xb244('0xc')]('/',auth[_0xb244('0x5')](),controller[_0xb244('0xd')]);router[_0xb244('0xc')](_0xb244('0x8'),auth['isAuthenticated'](),controller[_0xb244('0xe')]);router[_0xb244('0xf')](_0xb244('0x10'),auth[_0xb244('0x5')](),controller[_0xb244('0x11')]);router['delete'](_0xb244('0x10'),auth[_0xb244('0x5')](),controller[_0xb244('0x12')]);module[_0xb244('0x13')]=router;
\ No newline at end of file
+var _0x57cc=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller'];(function(_0x5c9d12,_0x13fdf3){var _0x9f2eb8=function(_0x230490){while(--_0x230490){_0x5c9d12['push'](_0x5c9d12['shift']());}};_0x9f2eb8(++_0x13fdf3);}(_0x57cc,0x15f));var _0xc57c=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x57cc[_0x1abb09];return _0xea1c07;};'use strict';var multer=require(_0xc57c('0x0'));var util=require(_0xc57c('0x1'));var path=require(_0xc57c('0x2'));var timeout=require('connect-timeout');var express=require(_0xc57c('0x3'));var router=express[_0xc57c('0x4')]();var fs_extra=require(_0xc57c('0x5'));var auth=require(_0xc57c('0x6'));var interaction=require(_0xc57c('0x7'));var config=require('../../config/environment');var controller=require(_0xc57c('0x8'));router[_0xc57c('0x9')]('/',auth[_0xc57c('0xa')](),controller[_0xc57c('0xb')]);router[_0xc57c('0x9')](_0xc57c('0xc'),auth['isAuthenticated'](),controller[_0xc57c('0xd')]);router[_0xc57c('0x9')](_0xc57c('0xe'),auth['isAuthenticated'](),controller[_0xc57c('0xf')]);router['get'](_0xc57c('0x10'),auth[_0xc57c('0xa')](),controller[_0xc57c('0x11')]);router[_0xc57c('0x12')]('/',auth[_0xc57c('0xa')](),controller[_0xc57c('0x13')]);router[_0xc57c('0x12')](_0xc57c('0xe'),auth[_0xc57c('0xa')](),controller[_0xc57c('0x14')]);router['put']('/:id',auth[_0xc57c('0xa')](),controller[_0xc57c('0x15')]);router[_0xc57c('0x16')](_0xc57c('0xc'),auth[_0xc57c('0xa')](),controller['destroy']);module[_0xc57c('0x17')]=router;
\ No newline at end of file
index 9f09340..35b0bb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e96=['sequelize','STRING','ENUM','basic','newTab'];(function(_0x47f47a,_0xdca6ab){var _0x382697=function(_0x4e0d5d){while(--_0x4e0d5d){_0x47f47a['push'](_0x47f47a['shift']());}};_0x382697(++_0xdca6ab);}(_0x3e96,0x64));var _0x63e9=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x3e96[_0x419550];return _0x55f9ef;};'use strict';var Sequelize=require(_0x63e9('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x63e9('0x1')]},'authType':{'type':Sequelize[_0x63e9('0x2')](_0x63e9('0x3')),'defaultValue':_0x63e9('0x3')},'password':{'type':Sequelize[_0x63e9('0x1')]},'consumerKey':{'type':Sequelize[_0x63e9('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x63e9('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x63e9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x63e9('0x2')]('integrationTab',_0x63e9('0x4')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x277d=['STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x558702,_0x393e31){var _0x2de64e=function(_0x103a70){while(--_0x103a70){_0x558702['push'](_0x558702['shift']());}};_0x2de64e(++_0x393e31);}(_0x277d,0xcb));var _0xd277=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x277d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd277('0x0'));module['exports']={'name':{'type':Sequelize[_0xd277('0x1')]},'description':{'type':Sequelize[_0xd277('0x1')]},'username':{'type':Sequelize[_0xd277('0x1')]},'remoteUri':{'type':Sequelize[_0xd277('0x1')]},'authType':{'type':Sequelize[_0xd277('0x2')](_0xd277('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xd277('0x1')]},'consumerKey':{'type':Sequelize[_0xd277('0x1')]},'consumerSecret':{'type':Sequelize[_0xd277('0x1')]},'token':{'type':Sequelize[_0xd277('0x1')]},'tokenSecret':{'type':Sequelize[_0xd277('0x1')]},'serverUrl':{'type':Sequelize[_0xd277('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd277('0x2')]('integrationTab',_0xd277('0x4')),'defaultValue':_0xd277('0x5')}};
\ No newline at end of file
index 3d39aa5..9808ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac26=['attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','DeskField','priority','remoteUri','authType','username','password','token','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','active','label','statusCode','error','stringify','send','test','Wrong\x20credentials','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','json','limit','undefined','count','offset','status','Content-Range','apply','reject','then','destroy','end','stack','name','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac26,0x1f0));var _0x6ac2=function(_0x18316e,_0xa84b48){_0x18316e=_0x18316e-0x0;var _0x3be979=_0xac26[_0x18316e];return _0x3be979;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ac2('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ac2('0x1'));var moment=require(_0x6ac2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6ac2('0x3'));var util=require(_0x6ac2('0x4'));var path=require(_0x6ac2('0x5'));var sox=require(_0x6ac2('0x6'));var csv=require('to-csv');var ejs=require(_0x6ac2('0x7'));var fs=require('fs');var fs_extra=require(_0x6ac2('0x8'));var _=require('lodash');var squel=require(_0x6ac2('0x9'));var crypto=require('crypto');var jsforce=require(_0x6ac2('0xa'));var deskjs=require(_0x6ac2('0xb'));var toCsv=require(_0x6ac2('0xc'));var querystring=require(_0x6ac2('0xd'));var Papa=require(_0x6ac2('0xe'));var Redis=require(_0x6ac2('0xf'));var authService=require(_0x6ac2('0x10'));var qs=require(_0x6ac2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ac2('0x12'));var logger=require(_0x6ac2('0x13'))(_0x6ac2('0x14'));var utils=require(_0x6ac2('0x15'));var config=require(_0x6ac2('0x16'));var licenseUtil=require(_0x6ac2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6ac2('0x18'));function respondWithStatusCode(_0x3a0b0c,_0x2eb14c){_0x2eb14c=_0x2eb14c||0xcc;return function(_0x4cc73e){if(_0x4cc73e){return _0x3a0b0c[_0x6ac2('0x19')](_0x2eb14c);}return _0x3a0b0c['status'](_0x2eb14c)['end']();};}function respondWithResult(_0x4abf12,_0x2e268e){_0x2e268e=_0x2e268e||0xc8;return function(_0x3fc1e9){if(_0x3fc1e9){return _0x4abf12['status'](_0x2e268e)[_0x6ac2('0x1a')](_0x3fc1e9);}};}function respondWithFilteredResult(_0x46b8c6,_0x13c983){return function(_0x5dab5e){if(_0x5dab5e){var _0x332116=typeof _0x13c983['offset']==='undefined'&&typeof _0x13c983[_0x6ac2('0x1b')]===_0x6ac2('0x1c');var _0x310fc2=_0x5dab5e[_0x6ac2('0x1d')];var _0x347240=_0x332116?0x0:_0x13c983[_0x6ac2('0x1e')];var _0x51c496=_0x332116?_0x5dab5e['count']:_0x13c983[_0x6ac2('0x1e')]+_0x13c983[_0x6ac2('0x1b')];var _0x567bab;if(_0x51c496>=_0x310fc2){_0x51c496=_0x310fc2;_0x567bab=0xc8;}else{_0x567bab=0xce;}_0x46b8c6[_0x6ac2('0x1f')](_0x567bab);return _0x46b8c6['set'](_0x6ac2('0x20'),_0x347240+'-'+_0x51c496+'/'+_0x310fc2)['json'](_0x5dab5e);}return null;};}function patchUpdates(_0x443fc2){return function(_0x30bfd1){try{jsonpatch[_0x6ac2('0x21')](_0x30bfd1,_0x443fc2,!![]);}catch(_0x10577d){return BPromise[_0x6ac2('0x22')](_0x10577d);}return _0x30bfd1['save']();};}function saveUpdates(_0x124c3a,_0x2f559b){return function(_0x18db6f){if(_0x18db6f){return _0x18db6f['update'](_0x124c3a)[_0x6ac2('0x23')](function(_0xf4cc42){return _0xf4cc42;});}return null;};}function removeEntity(_0x4b0e45,_0x578576){return function(_0x497595){if(_0x497595){return _0x497595[_0x6ac2('0x24')]()[_0x6ac2('0x23')](function(){_0x4b0e45[_0x6ac2('0x1f')](0xcc)[_0x6ac2('0x25')]();});}};}function handleEntityNotFound(_0x21e514,_0x1f2894){return function(_0x483903){if(!_0x483903){_0x21e514[_0x6ac2('0x19')](0x194);}return _0x483903;};}function handleError(_0x5d78bb,_0x1212aa){_0x1212aa=_0x1212aa||0x1f4;return function(_0x3a7723){logger['error'](_0x3a7723[_0x6ac2('0x26')]);if(_0x3a7723[_0x6ac2('0x27')]){delete _0x3a7723[_0x6ac2('0x27')];}_0x5d78bb[_0x6ac2('0x1f')](_0x1212aa)['send'](_0x3a7723);};}exports['index']=function(_0x254ba8,_0x5c0c5e){var _0x297208={},_0x5c1f8e={},_0xcd59fa={'count':0x0,'rows':[]};var _0x19135b=_[_0x6ac2('0x28')](db[_0x6ac2('0x29')][_0x6ac2('0x2a')],function(_0x374d0c){return{'name':_0x374d0c[_0x6ac2('0x2b')],'type':_0x374d0c['type'][_0x6ac2('0x2c')]};});_0x5c1f8e[_0x6ac2('0x2d')]=_['map'](_0x19135b,'name');_0x5c1f8e[_0x6ac2('0x2e')]=_[_0x6ac2('0x2f')](_0x254ba8['query']);_0x5c1f8e['filters']=_[_0x6ac2('0x30')](_0x5c1f8e[_0x6ac2('0x2d')],_0x5c1f8e['query']);_0x297208[_0x6ac2('0x31')]=_[_0x6ac2('0x30')](_0x5c1f8e[_0x6ac2('0x2d')],qs['fields'](_0x254ba8[_0x6ac2('0x2e')]['fields']));_0x297208[_0x6ac2('0x31')]=_0x297208['attributes'][_0x6ac2('0x32')]?_0x297208['attributes']:_0x5c1f8e[_0x6ac2('0x2d')];if(!_0x254ba8['query']['hasOwnProperty'](_0x6ac2('0x33'))){_0x297208[_0x6ac2('0x1b')]=qs['limit'](_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x1b')]);_0x297208[_0x6ac2('0x1e')]=qs[_0x6ac2('0x1e')](_0x254ba8[_0x6ac2('0x2e')]['offset']);}_0x297208['order']=qs[_0x6ac2('0x34')](_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x34')]);_0x297208[_0x6ac2('0x35')]=qs['filters'](_['pick'](_0x254ba8['query'],_0x5c1f8e[_0x6ac2('0x36')]),_0x19135b);if(_0x254ba8[_0x6ac2('0x2e')]['filter']){_0x297208[_0x6ac2('0x35')]=_[_0x6ac2('0x37')](_0x297208[_0x6ac2('0x35')],{'$or':_[_0x6ac2('0x28')](_0x19135b,function(_0x487fa7){if(_0x487fa7['type']!==_0x6ac2('0x38')){var _0x1e6c6f={};_0x1e6c6f[_0x487fa7[_0x6ac2('0x27')]]={'$like':'%'+_0x254ba8['query'][_0x6ac2('0x39')]+'%'};return _0x1e6c6f;}})});}_0x297208=_[_0x6ac2('0x37')]({},_0x297208,_0x254ba8[_0x6ac2('0x3a')]);var _0x384aa7={'where':_0x297208[_0x6ac2('0x35')]};return db[_0x6ac2('0x29')][_0x6ac2('0x1d')](_0x384aa7)[_0x6ac2('0x23')](function(_0x48b4f9){_0xcd59fa[_0x6ac2('0x1d')]=_0x48b4f9;if(_0x254ba8[_0x6ac2('0x2e')][_0x6ac2('0x3b')]){_0x297208[_0x6ac2('0x3c')]=[{'all':!![]}];}return db[_0x6ac2('0x29')][_0x6ac2('0x3d')](_0x297208);})['then'](function(_0x23a66d){_0xcd59fa[_0x6ac2('0x3e')]=_0x23a66d;return _0xcd59fa;})['then'](respondWithFilteredResult(_0x5c0c5e,_0x297208))[_0x6ac2('0x3f')](handleError(_0x5c0c5e,null));};exports['show']=function(_0xc6366,_0x168036){var _0x174932={'raw':![],'where':{'id':_0xc6366[_0x6ac2('0x40')]['id']}},_0x170a8d={};_0x170a8d[_0x6ac2('0x2d')]=_['keys'](db[_0x6ac2('0x29')][_0x6ac2('0x2a')]);_0x170a8d[_0x6ac2('0x2e')]=_['keys'](_0xc6366[_0x6ac2('0x2e')]);_0x170a8d[_0x6ac2('0x36')]=_[_0x6ac2('0x30')](_0x170a8d[_0x6ac2('0x2d')],_0x170a8d['query']);_0x174932[_0x6ac2('0x31')]=_['intersection'](_0x170a8d[_0x6ac2('0x2d')],qs[_0x6ac2('0x41')](_0xc6366[_0x6ac2('0x2e')][_0x6ac2('0x41')]));_0x174932[_0x6ac2('0x31')]=_0x174932[_0x6ac2('0x31')][_0x6ac2('0x32')]?_0x174932[_0x6ac2('0x31')]:_0x170a8d['model'];if(_0xc6366[_0x6ac2('0x2e')][_0x6ac2('0x3b')]){_0x174932[_0x6ac2('0x3c')]=[{'all':!![]}];}_0x174932=_[_0x6ac2('0x37')]({},_0x174932,_0xc6366[_0x6ac2('0x3a')]);return db[_0x6ac2('0x29')][_0x6ac2('0x42')](_0x174932)[_0x6ac2('0x23')](handleEntityNotFound(_0x168036,null))[_0x6ac2('0x23')](respondWithResult(_0x168036,null))[_0x6ac2('0x3f')](handleError(_0x168036,null));};exports[_0x6ac2('0x43')]=function(_0xb33c7e,_0x4d5dca){return db[_0x6ac2('0x29')]['create'](_0xb33c7e[_0x6ac2('0x44')],{})[_0x6ac2('0x23')](respondWithResult(_0x4d5dca,0xc9))[_0x6ac2('0x3f')](handleError(_0x4d5dca,null));};exports['update']=function(_0x4063f9,_0xb49f32){if(_0x4063f9[_0x6ac2('0x44')]['id']){delete _0x4063f9[_0x6ac2('0x44')]['id'];}return db[_0x6ac2('0x29')]['find']({'where':{'id':_0x4063f9[_0x6ac2('0x40')]['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0xb49f32,null))[_0x6ac2('0x23')](saveUpdates(_0x4063f9[_0x6ac2('0x44')],null))['then'](respondWithResult(_0xb49f32,null))[_0x6ac2('0x3f')](handleError(_0xb49f32,null));};exports[_0x6ac2('0x24')]=function(_0x1e6b12,_0x21f426){return db['DeskAccount'][_0x6ac2('0x42')]({'where':{'id':_0x1e6b12['params']['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x21f426,null))[_0x6ac2('0x23')](removeEntity(_0x21f426,null))['catch'](handleError(_0x21f426,null));};exports[_0x6ac2('0x45')]=function(_0x875a25,_0x231bbd,_0x3e42cb){var _0x2214af={};var _0x2cb6bd={};var _0x4df512;var _0x5d6b6c;return db['DeskAccount'][_0x6ac2('0x46')]({'where':{'id':_0x875a25['params']['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x231bbd,null))[_0x6ac2('0x23')](function(_0x594b93){if(_0x594b93){_0x4df512=_0x594b93;_0x2cb6bd['model']=_['keys'](db['DeskConfiguration'][_0x6ac2('0x2a')]);_0x2cb6bd[_0x6ac2('0x2e')]=_[_0x6ac2('0x2f')](_0x875a25[_0x6ac2('0x2e')]);_0x2cb6bd[_0x6ac2('0x36')]=_[_0x6ac2('0x30')](_0x2cb6bd[_0x6ac2('0x2d')],_0x2cb6bd[_0x6ac2('0x2e')]);_0x2214af[_0x6ac2('0x31')]=_[_0x6ac2('0x30')](_0x2cb6bd[_0x6ac2('0x2d')],qs[_0x6ac2('0x41')](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x41')]));_0x2214af[_0x6ac2('0x31')]=_0x2214af[_0x6ac2('0x31')][_0x6ac2('0x32')]?_0x2214af[_0x6ac2('0x31')]:_0x2cb6bd[_0x6ac2('0x2d')];_0x2214af[_0x6ac2('0x47')]=qs['sort'](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x34')]);_0x2214af[_0x6ac2('0x35')]=qs[_0x6ac2('0x36')](_[_0x6ac2('0x48')](_0x875a25[_0x6ac2('0x2e')],_0x2cb6bd[_0x6ac2('0x36')]));if(_0x875a25[_0x6ac2('0x2e')]['filter']){_0x2214af['where']=_[_0x6ac2('0x37')](_0x2214af['where'],{'$or':_['map'](_0x2214af['attributes'],function(_0x5b288e){var _0x2cb239={};_0x2cb239[_0x5b288e]={'$like':'%'+_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x39')]+'%'};return _0x2cb239;})});}_0x2214af=_[_0x6ac2('0x37')]({},_0x2214af,_0x875a25[_0x6ac2('0x3a')]);return _0x4df512[_0x6ac2('0x45')](_0x2214af);}})[_0x6ac2('0x23')](function(_0x583a7a){if(_0x583a7a){_0x5d6b6c=_0x583a7a['length'];if(!_0x875a25[_0x6ac2('0x2e')]['hasOwnProperty']('nolimit')){_0x2214af[_0x6ac2('0x1b')]=qs[_0x6ac2('0x1b')](_0x875a25[_0x6ac2('0x2e')]['limit']);_0x2214af[_0x6ac2('0x1e')]=qs[_0x6ac2('0x1e')](_0x875a25[_0x6ac2('0x2e')][_0x6ac2('0x1e')]);}return _0x4df512[_0x6ac2('0x45')](_0x2214af);}})[_0x6ac2('0x23')](function(_0x25262a){if(_0x25262a){return _0x25262a?{'count':_0x5d6b6c,'rows':_0x25262a}:null;}})[_0x6ac2('0x23')](respondWithResult(_0x231bbd,null))[_0x6ac2('0x3f')](handleError(_0x231bbd,null));};exports[_0x6ac2('0x49')]=function(_0x5c8044,_0x4a954f,_0x12dbe){if(_0x5c8044[_0x6ac2('0x44')]['id']){delete _0x5c8044[_0x6ac2('0x44')]['id'];}return db[_0x6ac2('0x29')][_0x6ac2('0x46')]({'where':{'id':_0x5c8044[_0x6ac2('0x40')]['id']}})[_0x6ac2('0x23')](handleEntityNotFound(_0x4a954f,null))[_0x6ac2('0x23')](function(_0x329a5b){if(_0x329a5b){_0x5c8044['body'][_0x6ac2('0x4a')]=_0x329a5b['id'];_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4b')]=integrations[_0x6ac2('0x4c')](_0x5c8044[_0x6ac2('0x44')]['channel'],_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4d')]);_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4e')]=integrations[_0x6ac2('0x4f')](_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x50')],_0x5c8044[_0x6ac2('0x44')][_0x6ac2('0x4d')]);return db['DeskConfiguration'][_0x6ac2('0x43')](_0x5c8044['body'],{'include':[{'model':db[_0x6ac2('0x51')],'as':_0x6ac2('0x4b')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4a954f,null))['catch'](handleError(_0x4a954f,null));};exports['getFields']=function(_0x3be5ff,_0x417f85,_0xcfabde){var _0x24deee=[{'name':_0x6ac2('0x52'),'label':_0x6ac2('0x52'),'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 _0x571e4c='';return db['DeskAccount']['findOne']({'where':{'id':_0x3be5ff[_0x6ac2('0x40')]['id']},'attributes':['id',_0x6ac2('0x53'),_0x6ac2('0x54'),_0x6ac2('0x55'),_0x6ac2('0x56'),'consumerKey','consumerSecret',_0x6ac2('0x57'),'tokenSecret']})[_0x6ac2('0x23')](handleEntityNotFound(_0x417f85,null))[_0x6ac2('0x23')](function(_0x36f742){if(_0x36f742){_0x571e4c=_0x36f742[_0x6ac2('0x53')];var _0x3afbc7=_0x571e4c['slice'](-0x1);if(_0x3afbc7==='/'){_0x571e4c=_0x571e4c[_0x6ac2('0x58')](0x0,_0x571e4c[_0x6ac2('0x59')](_0x3afbc7));}var _0x4960d0={'method':'GET','uri':util[_0x6ac2('0x5a')](_0x6ac2('0x5b'),_0x571e4c),'headers':{'Content-Type':_0x6ac2('0x5c'),'Accept':_0x6ac2('0x5c')},'json':!![]};if(_0x36f742[_0x6ac2('0x54')]===_0x6ac2('0x5d')){_0x4960d0[_0x6ac2('0x5e')]['Authorization']=util[_0x6ac2('0x5a')](_0x6ac2('0x5f'),new Buffer(util[_0x6ac2('0x5a')](_0x6ac2('0x60'),_0x36f742[_0x6ac2('0x55')],_0x36f742['password']))[_0x6ac2('0x61')](_0x6ac2('0x62')));}return rp(_0x4960d0)[_0x6ac2('0x23')](function(_0xebb803){return _0x24deee[_0x6ac2('0x63')](_[_0x6ac2('0x28')](_0xebb803[_0x6ac2('0x64')]['entries'],function(_0xb9fec5){return{'id':_0xb9fec5[_0x6ac2('0x27')],'name':_0xb9fec5[_0x6ac2('0x27')],'type':_0xb9fec5[_0x6ac2('0x4d')],'active':_0xb9fec5[_0x6ac2('0x65')],'label':_0xb9fec5[_0x6ac2('0x66')],'custom':!![]};}));});}})[_0x6ac2('0x23')](function(_0x4530b5){return{'count':_0x4530b5[_0x6ac2('0x32')],'rows':_0x4530b5};})[_0x6ac2('0x23')](respondWithResult(_0x417f85,null))[_0x6ac2('0x3f')](function(_0x31e49a){var _0x515870=_0x3be5ff['query']['test']?0x1f4:_0x31e49a[_0x6ac2('0x67')]||0x1f4;logger[_0x6ac2('0x68')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x515870,JSON[_0x6ac2('0x69')](_0x31e49a));delete _0x31e49a[_0x6ac2('0x27')];if(_0x515870===0x191){_0x515870=0x190;}_0x417f85[_0x6ac2('0x1f')](_0x515870)[_0x6ac2('0x6a')](_0x3be5ff[_0x6ac2('0x2e')][_0x6ac2('0x6b')]?{'message':_0x6ac2('0x6c'),'statusCode':_0x31e49a[_0x6ac2('0x67')]}:_0x31e49a);});};
\ No newline at end of file
+var _0xf926=['getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','format','%s:%s','username','toString','base64','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','then','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','body','update','destroy','params','getConfigurations','order','pick','addConfiguration','findOne','AccountId','channel','getDescriptions','DeskConfiguration','create','DeskField','Subjects','Descriptions'];(function(_0x4b269e,_0x4f5ebd){var _0x1ac62d=function(_0x1fc085){while(--_0x1fc085){_0x4b269e['push'](_0x4b269e['shift']());}};_0x1ac62d(++_0x4f5ebd);}(_0xf926,0x174));var _0x6f92=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xf926[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require(_0x6f92('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6f92('0x1'));var rp=require(_0x6f92('0x2'));var moment=require(_0x6f92('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6f92('0x4'));var sox=require(_0x6f92('0x5'));var csv=require(_0x6f92('0x6'));var ejs=require(_0x6f92('0x7'));var fs=require('fs');var fs_extra=require(_0x6f92('0x8'));var _=require(_0x6f92('0x9'));var squel=require(_0x6f92('0xa'));var crypto=require(_0x6f92('0xb'));var jsforce=require(_0x6f92('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f92('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6f92('0xd'));var qs=require(_0x6f92('0xe'));var as=require(_0x6f92('0xf'));var hardwareService=require(_0x6f92('0x10'));var logger=require(_0x6f92('0x11'))(_0x6f92('0x12'));var utils=require('../../config/utils');var config=require(_0x6f92('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f92('0x14'))['db'];var integrations=require(_0x6f92('0x15'));function respondWithStatusCode(_0xd2cebd,_0x34392b){_0x34392b=_0x34392b||0xcc;return function(_0x1eaff6){if(_0x1eaff6){return _0xd2cebd[_0x6f92('0x16')](_0x34392b);}return _0xd2cebd['status'](_0x34392b)[_0x6f92('0x17')]();};}function respondWithResult(_0x5704b3,_0x2d2b07){_0x2d2b07=_0x2d2b07||0xc8;return function(_0x975f80){if(_0x975f80){return _0x5704b3[_0x6f92('0x18')](_0x2d2b07)[_0x6f92('0x19')](_0x975f80);}};}function respondWithFilteredResult(_0x302c6c,_0x156e2f){return function(_0x49149a){if(_0x49149a){var _0x4676d4=typeof _0x156e2f[_0x6f92('0x1a')]==='undefined'&&typeof _0x156e2f['limit']===_0x6f92('0x1b');var _0x4d23a5=_0x49149a['count'];var _0x5499fe=_0x4676d4?0x0:_0x156e2f[_0x6f92('0x1a')];var _0x16a861=_0x4676d4?_0x49149a[_0x6f92('0x1c')]:_0x156e2f[_0x6f92('0x1a')]+_0x156e2f[_0x6f92('0x1d')];var _0x3eaecb;if(_0x16a861>=_0x4d23a5){_0x16a861=_0x4d23a5;_0x3eaecb=0xc8;}else{_0x3eaecb=0xce;}_0x302c6c['status'](_0x3eaecb);return _0x302c6c['set'](_0x6f92('0x1e'),_0x5499fe+'-'+_0x16a861+'/'+_0x4d23a5)[_0x6f92('0x19')](_0x49149a);}return null;};}function patchUpdates(_0x3aa7a2){return function(_0x541cb2){try{jsonpatch['apply'](_0x541cb2,_0x3aa7a2,!![]);}catch(_0x43d631){return BPromise[_0x6f92('0x1f')](_0x43d631);}return _0x541cb2[_0x6f92('0x20')]();};}function saveUpdates(_0x8f9a1a,_0x571bfd){return function(_0x36aec9){if(_0x36aec9){return _0x36aec9['update'](_0x8f9a1a)['then'](function(_0x3641da){return _0x3641da;});}return null;};}function removeEntity(_0x18c207,_0x484974){return function(_0x58d078){if(_0x58d078){return _0x58d078['destroy']()[_0x6f92('0x21')](function(){_0x18c207[_0x6f92('0x18')](0xcc)[_0x6f92('0x17')]();});}};}function handleEntityNotFound(_0x1a9fdd,_0x1f13ab){return function(_0x4da373){if(!_0x4da373){_0x1a9fdd[_0x6f92('0x16')](0x194);}return _0x4da373;};}function handleError(_0x3f62e0,_0x4d6a30){_0x4d6a30=_0x4d6a30||0x1f4;return function(_0x4ae8c8){logger[_0x6f92('0x22')](_0x4ae8c8[_0x6f92('0x23')]);if(_0x4ae8c8[_0x6f92('0x24')]){delete _0x4ae8c8['name'];}_0x3f62e0[_0x6f92('0x18')](_0x4d6a30)['send'](_0x4ae8c8);};}exports[_0x6f92('0x25')]=function(_0x53c80f,_0x348964){var _0x39760e={},_0x376060={},_0x27c1ca={'count':0x0,'rows':[]};var _0x423471=_['map'](db[_0x6f92('0x26')][_0x6f92('0x27')],function(_0x34e818){return{'name':_0x34e818[_0x6f92('0x28')],'type':_0x34e818[_0x6f92('0x29')][_0x6f92('0x2a')]};});_0x376060[_0x6f92('0x2b')]=_[_0x6f92('0x2c')](_0x423471,_0x6f92('0x24'));_0x376060[_0x6f92('0x2d')]=_[_0x6f92('0x2e')](_0x53c80f[_0x6f92('0x2d')]);_0x376060['filters']=_[_0x6f92('0x2f')](_0x376060['model'],_0x376060['query']);_0x39760e[_0x6f92('0x30')]=_[_0x6f92('0x2f')](_0x376060[_0x6f92('0x2b')],qs[_0x6f92('0x31')](_0x53c80f[_0x6f92('0x2d')]['fields']));_0x39760e['attributes']=_0x39760e[_0x6f92('0x30')][_0x6f92('0x32')]?_0x39760e['attributes']:_0x376060[_0x6f92('0x2b')];if(!_0x53c80f[_0x6f92('0x2d')][_0x6f92('0x33')](_0x6f92('0x34'))){_0x39760e[_0x6f92('0x1d')]=qs['limit'](_0x53c80f[_0x6f92('0x2d')][_0x6f92('0x1d')]);_0x39760e[_0x6f92('0x1a')]=qs[_0x6f92('0x1a')](_0x53c80f[_0x6f92('0x2d')]['offset']);}_0x39760e['order']=qs[_0x6f92('0x35')](_0x53c80f[_0x6f92('0x2d')][_0x6f92('0x35')]);_0x39760e[_0x6f92('0x36')]=qs['filters'](_['pick'](_0x53c80f[_0x6f92('0x2d')],_0x376060[_0x6f92('0x37')]),_0x423471);if(_0x53c80f[_0x6f92('0x2d')][_0x6f92('0x38')]){_0x39760e[_0x6f92('0x36')]=_['merge'](_0x39760e[_0x6f92('0x36')],{'$or':_[_0x6f92('0x2c')](_0x423471,function(_0x67f9b3){if(_0x67f9b3[_0x6f92('0x29')]!==_0x6f92('0x39')){var _0x465d7d={};_0x465d7d[_0x67f9b3[_0x6f92('0x24')]]={'$like':'%'+_0x53c80f['query'][_0x6f92('0x38')]+'%'};return _0x465d7d;}})});}_0x39760e=_[_0x6f92('0x3a')]({},_0x39760e,_0x53c80f[_0x6f92('0x3b')]);var _0x345c02={'where':_0x39760e['where']};return db['DeskAccount']['count'](_0x345c02)['then'](function(_0x29227f){_0x27c1ca[_0x6f92('0x1c')]=_0x29227f;if(_0x53c80f[_0x6f92('0x2d')][_0x6f92('0x3c')]){_0x39760e[_0x6f92('0x3d')]=[{'all':!![]}];}return db[_0x6f92('0x26')][_0x6f92('0x3e')](_0x39760e);})[_0x6f92('0x21')](function(_0x11e613){_0x27c1ca[_0x6f92('0x3f')]=_0x11e613;return _0x27c1ca;})[_0x6f92('0x21')](respondWithFilteredResult(_0x348964,_0x39760e))[_0x6f92('0x40')](handleError(_0x348964,null));};exports[_0x6f92('0x41')]=function(_0x4649ef,_0x47b193){var _0x14961e={'raw':![],'where':{'id':_0x4649ef['params']['id']}},_0x46b133={};_0x46b133[_0x6f92('0x2b')]=_[_0x6f92('0x2e')](db[_0x6f92('0x26')][_0x6f92('0x27')]);_0x46b133['query']=_['keys'](_0x4649ef['query']);_0x46b133['filters']=_['intersection'](_0x46b133['model'],_0x46b133[_0x6f92('0x2d')]);_0x14961e['attributes']=_[_0x6f92('0x2f')](_0x46b133[_0x6f92('0x2b')],qs[_0x6f92('0x31')](_0x4649ef[_0x6f92('0x2d')][_0x6f92('0x31')]));_0x14961e[_0x6f92('0x30')]=_0x14961e[_0x6f92('0x30')][_0x6f92('0x32')]?_0x14961e[_0x6f92('0x30')]:_0x46b133[_0x6f92('0x2b')];if(_0x4649ef[_0x6f92('0x2d')][_0x6f92('0x3c')]){_0x14961e[_0x6f92('0x3d')]=[{'all':!![]}];}_0x14961e=_[_0x6f92('0x3a')]({},_0x14961e,_0x4649ef[_0x6f92('0x3b')]);return db[_0x6f92('0x26')][_0x6f92('0x42')](_0x14961e)['then'](handleEntityNotFound(_0x47b193,null))[_0x6f92('0x21')](respondWithResult(_0x47b193,null))[_0x6f92('0x40')](handleError(_0x47b193,null));};exports['create']=function(_0x5b41a6,_0x2f3722){return db['DeskAccount']['create'](_0x5b41a6[_0x6f92('0x43')],{})['then'](respondWithResult(_0x2f3722,0xc9))['catch'](handleError(_0x2f3722,null));};exports[_0x6f92('0x44')]=function(_0x5474f3,_0x4c2509){if(_0x5474f3['body']['id']){delete _0x5474f3[_0x6f92('0x43')]['id'];}return db[_0x6f92('0x26')][_0x6f92('0x42')]({'where':{'id':_0x5474f3['params']['id']}})[_0x6f92('0x21')](handleEntityNotFound(_0x4c2509,null))[_0x6f92('0x21')](saveUpdates(_0x5474f3[_0x6f92('0x43')],null))[_0x6f92('0x21')](respondWithResult(_0x4c2509,null))['catch'](handleError(_0x4c2509,null));};exports[_0x6f92('0x45')]=function(_0x5dee65,_0x3ac5f4){return db[_0x6f92('0x26')][_0x6f92('0x42')]({'where':{'id':_0x5dee65[_0x6f92('0x46')]['id']}})[_0x6f92('0x21')](handleEntityNotFound(_0x3ac5f4,null))[_0x6f92('0x21')](removeEntity(_0x3ac5f4,null))[_0x6f92('0x40')](handleError(_0x3ac5f4,null));};exports[_0x6f92('0x47')]=function(_0x486742,_0x2ceb7e,_0x1a9d22){var _0x5f4b03={};var _0x315dfb={};var _0x44a1d2;var _0x188a5d;return db['DeskAccount']['findOne']({'where':{'id':_0x486742[_0x6f92('0x46')]['id']}})[_0x6f92('0x21')](handleEntityNotFound(_0x2ceb7e,null))[_0x6f92('0x21')](function(_0x2f581c){if(_0x2f581c){_0x44a1d2=_0x2f581c;_0x315dfb[_0x6f92('0x2b')]=_[_0x6f92('0x2e')](db['DeskConfiguration'][_0x6f92('0x27')]);_0x315dfb['query']=_[_0x6f92('0x2e')](_0x486742[_0x6f92('0x2d')]);_0x315dfb[_0x6f92('0x37')]=_[_0x6f92('0x2f')](_0x315dfb[_0x6f92('0x2b')],_0x315dfb[_0x6f92('0x2d')]);_0x5f4b03[_0x6f92('0x30')]=_[_0x6f92('0x2f')](_0x315dfb[_0x6f92('0x2b')],qs[_0x6f92('0x31')](_0x486742['query'][_0x6f92('0x31')]));_0x5f4b03[_0x6f92('0x30')]=_0x5f4b03['attributes']['length']?_0x5f4b03[_0x6f92('0x30')]:_0x315dfb[_0x6f92('0x2b')];_0x5f4b03[_0x6f92('0x48')]=qs[_0x6f92('0x35')](_0x486742[_0x6f92('0x2d')][_0x6f92('0x35')]);_0x5f4b03[_0x6f92('0x36')]=qs[_0x6f92('0x37')](_[_0x6f92('0x49')](_0x486742[_0x6f92('0x2d')],_0x315dfb[_0x6f92('0x37')]));if(_0x486742[_0x6f92('0x2d')][_0x6f92('0x38')]){_0x5f4b03[_0x6f92('0x36')]=_[_0x6f92('0x3a')](_0x5f4b03[_0x6f92('0x36')],{'$or':_[_0x6f92('0x2c')](_0x5f4b03[_0x6f92('0x30')],function(_0x1fba08){var _0x481d84={};_0x481d84[_0x1fba08]={'$like':'%'+_0x486742[_0x6f92('0x2d')][_0x6f92('0x38')]+'%'};return _0x481d84;})});}_0x5f4b03=_[_0x6f92('0x3a')]({},_0x5f4b03,_0x486742[_0x6f92('0x3b')]);return _0x44a1d2['getConfigurations'](_0x5f4b03);}})[_0x6f92('0x21')](function(_0x5aa095){if(_0x5aa095){_0x188a5d=_0x5aa095[_0x6f92('0x32')];if(!_0x486742[_0x6f92('0x2d')][_0x6f92('0x33')](_0x6f92('0x34'))){_0x5f4b03['limit']=qs['limit'](_0x486742[_0x6f92('0x2d')][_0x6f92('0x1d')]);_0x5f4b03['offset']=qs[_0x6f92('0x1a')](_0x486742[_0x6f92('0x2d')][_0x6f92('0x1a')]);}return _0x44a1d2[_0x6f92('0x47')](_0x5f4b03);}})['then'](function(_0x4bda17){if(_0x4bda17){return _0x4bda17?{'count':_0x188a5d,'rows':_0x4bda17}:null;}})['then'](respondWithResult(_0x2ceb7e,null))['catch'](handleError(_0x2ceb7e,null));};exports[_0x6f92('0x4a')]=function(_0x3d1a6a,_0x25e78f,_0x16e3a6){if(_0x3d1a6a[_0x6f92('0x43')]['id']){delete _0x3d1a6a[_0x6f92('0x43')]['id'];}return db['DeskAccount'][_0x6f92('0x4b')]({'where':{'id':_0x3d1a6a[_0x6f92('0x46')]['id']}})[_0x6f92('0x21')](handleEntityNotFound(_0x25e78f,null))['then'](function(_0x272280){if(_0x272280){_0x3d1a6a['body'][_0x6f92('0x4c')]=_0x272280['id'];_0x3d1a6a[_0x6f92('0x43')]['Subjects']=integrations['getSubjects'](_0x3d1a6a[_0x6f92('0x43')][_0x6f92('0x4d')],_0x3d1a6a[_0x6f92('0x43')]['type']);_0x3d1a6a[_0x6f92('0x43')]['Descriptions']=integrations[_0x6f92('0x4e')](_0x3d1a6a[_0x6f92('0x43')][_0x6f92('0x4d')],_0x3d1a6a[_0x6f92('0x43')][_0x6f92('0x29')]);return db[_0x6f92('0x4f')][_0x6f92('0x50')](_0x3d1a6a[_0x6f92('0x43')],{'include':[{'model':db[_0x6f92('0x51')],'as':_0x6f92('0x52')},{'model':db[_0x6f92('0x51')],'as':_0x6f92('0x53')}]});}return null;})[_0x6f92('0x21')](respondWithResult(_0x25e78f,null))['catch'](handleError(_0x25e78f,null));};exports[_0x6f92('0x54')]=function(_0x5d287d,_0x13d9a4,_0xb919b6){var _0x22989c=[{'name':_0x6f92('0x55'),'label':_0x6f92('0x55'),'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 _0x404488='';return db['DeskAccount'][_0x6f92('0x4b')]({'where':{'id':_0x5d287d[_0x6f92('0x46')]['id']},'attributes':['id',_0x6f92('0x56'),_0x6f92('0x57'),'username',_0x6f92('0x58'),_0x6f92('0x59'),_0x6f92('0x5a'),_0x6f92('0x5b'),'tokenSecret']})['then'](handleEntityNotFound(_0x13d9a4,null))[_0x6f92('0x21')](function(_0x563836){if(_0x563836){_0x404488=_0x563836[_0x6f92('0x56')];var _0x59ee82=_0x404488[_0x6f92('0x5c')](-0x1);if(_0x59ee82==='/'){_0x404488=_0x404488[_0x6f92('0x5d')](0x0,_0x404488[_0x6f92('0x5e')](_0x59ee82));}var _0xa0b20f={'method':'GET','uri':util['format'](_0x6f92('0x5f'),_0x404488),'headers':{'Content-Type':_0x6f92('0x60'),'Accept':_0x6f92('0x60')},'json':!![]};if(_0x563836[_0x6f92('0x57')]===_0x6f92('0x61')){_0xa0b20f['headers'][_0x6f92('0x62')]=util['format'](_0x6f92('0x63'),new Buffer(util[_0x6f92('0x64')](_0x6f92('0x65'),_0x563836[_0x6f92('0x66')],_0x563836['password']))[_0x6f92('0x67')](_0x6f92('0x68')));}return rp(_0xa0b20f)[_0x6f92('0x21')](function(_0x339bee){return _0x22989c[_0x6f92('0x69')](_[_0x6f92('0x2c')](_0x339bee[_0x6f92('0x6a')][_0x6f92('0x6b')],function(_0x3a7a64){return{'id':_0x3a7a64[_0x6f92('0x24')],'name':_0x3a7a64['name'],'type':_0x3a7a64[_0x6f92('0x29')],'active':_0x3a7a64['active'],'label':_0x3a7a64[_0x6f92('0x6c')],'custom':!![]};}));});}})[_0x6f92('0x21')](function(_0xf91896){return{'count':_0xf91896[_0x6f92('0x32')],'rows':_0xf91896};})[_0x6f92('0x21')](respondWithResult(_0x13d9a4,null))[_0x6f92('0x40')](function(_0x59cb1f){var _0x15bc6d=_0x5d287d[_0x6f92('0x2d')][_0x6f92('0x6d')]?0x1f4:_0x59cb1f['statusCode']||0x1f4;logger[_0x6f92('0x22')](_0x6f92('0x6e'),_0x6f92('0x54'),_0x15bc6d,JSON[_0x6f92('0x6f')](_0x59cb1f));delete _0x59cb1f[_0x6f92('0x24')];if(_0x15bc6d===0x191){_0x15bc6d=0x190;}_0x13d9a4[_0x6f92('0x18')](_0x15bc6d)[_0x6f92('0x70')](_0x5d287d[_0x6f92('0x2d')][_0x6f92('0x6d')]?{'message':_0x6f92('0x71'),'statusCode':_0x59cb1f['statusCode']}:_0x59cb1f);});};
\ No newline at end of file
index 3bf5311..914b232 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcd0=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','int_desk_accounts','api','moment'];(function(_0x16bb8e,_0x4f2d87){var _0x55b01a=function(_0x243a21){while(--_0x243a21){_0x16bb8e['push'](_0x16bb8e['shift']());}};_0x55b01a(++_0x4f2d87);}(_0xbcd0,0xf0));var _0x0bcd=function(_0x5b1bb7,_0x15748c){_0x5b1bb7=_0x5b1bb7-0x0;var _0x4f3b78=_0xbcd0[_0x5b1bb7];return _0x4f3b78;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0bcd('0x0'));var moment=require(_0x0bcd('0x1'));var BPromise=require(_0x0bcd('0x2'));var rp=require(_0x0bcd('0x3'));var fs=require('fs');var path=require(_0x0bcd('0x4'));var rimraf=require(_0x0bcd('0x5'));var config=require(_0x0bcd('0x6'));var attributes=require(_0x0bcd('0x7'));var integrations=require(_0x0bcd('0x8'));module['exports']=function(_0x1f3520,_0x589c24){return _0x1f3520[_0x0bcd('0x9')]('DeskAccount',attributes,{'tableName':_0x0bcd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c97=['util','../../config/logger','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash'];(function(_0x18aa14,_0x4e0c06){var _0x49b131=function(_0x16ca1c){while(--_0x16ca1c){_0x18aa14['push'](_0x18aa14['shift']());}};_0x49b131(++_0x4e0c06);}(_0x8c97,0x1ac));var _0x78c9=function(_0x4e32c9,_0x5b0816){_0x4e32c9=_0x4e32c9-0x0;var _0x5707fe=_0x8c97[_0x4e32c9];return _0x5707fe;};'use strict';var _=require(_0x78c9('0x0'));var util=require(_0x78c9('0x1'));var logger=require(_0x78c9('0x2'))('api');var moment=require(_0x78c9('0x3'));var BPromise=require(_0x78c9('0x4'));var rp=require(_0x78c9('0x5'));var fs=require('fs');var path=require(_0x78c9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x78c9('0x7'));module[_0x78c9('0x8')]=function(_0xa248eb,_0x56273f){return _0xa248eb['define'](_0x78c9('0x9'),attributes,{'tableName':_0x78c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e16623f..bc9b837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02f6=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','DeskAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1730dd,_0x3cacb2){var _0x15a53c=function(_0x470500){while(--_0x470500){_0x1730dd['push'](_0x1730dd['shift']());}};_0x15a53c(++_0x3cacb2);}(_0x02f6,0xc2));var _0x602f=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0x02f6[_0x187718];return _0x29ddf4;};'use strict';var _=require('lodash');var util=require(_0x602f('0x0'));var moment=require(_0x602f('0x1'));var BPromise=require(_0x602f('0x2'));var rs=require(_0x602f('0x3'));var fs=require('fs');var Redis=require(_0x602f('0x4'));var db=require(_0x602f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x602f('0x6'))(_0x602f('0x7'));var config=require(_0x602f('0x8'));var jayson=require(_0x602f('0x9'));var client=jayson[_0x602f('0xa')][_0x602f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e8d50,_0xd656c2,_0x157ce4){return new BPromise(function(_0x1ced19,_0x218a0b){return client['request'](_0x1e8d50,_0x157ce4)[_0x602f('0xc')](function(_0x3f381f){logger[_0x602f('0xd')](_0x602f('0xe'),_0xd656c2,_0x602f('0xf'));logger[_0x602f('0x10')](_0x602f('0x11'),_0xd656c2,_0x602f('0xf'),JSON[_0x602f('0x12')](_0x3f381f));if(_0x3f381f[_0x602f('0x13')]){if(_0x3f381f['error'][_0x602f('0x14')]===0x1f4){logger[_0x602f('0x13')]('DeskAccount,\x20%s,\x20%s',_0xd656c2,_0x3f381f['error'][_0x602f('0x15')]);return _0x218a0b(_0x3f381f['error'][_0x602f('0x15')]);}logger[_0x602f('0x13')](_0x602f('0xe'),_0xd656c2,_0x3f381f[_0x602f('0x13')][_0x602f('0x15')]);return _0x1ced19(_0x3f381f[_0x602f('0x13')][_0x602f('0x15')]);}else{logger[_0x602f('0xd')](_0x602f('0xe'),_0xd656c2,_0x602f('0xf'));_0x1ced19(_0x3f381f[_0x602f('0x16')]['message']);}})[_0x602f('0x17')](function(_0x272edf){logger[_0x602f('0x13')](_0x602f('0xe'),_0xd656c2,_0x272edf);_0x218a0b(_0x272edf);});});}exports[_0x602f('0x18')]=function(_0x23d956){var _0x12e023=this;return new Promise(function(_0x154c3a,_0x4b39f2){return db['DeskAccount']['findAll']({'raw':_0x23d956[_0x602f('0x19')]?_0x23d956['options'][_0x602f('0x1a')]===undefined?!![]:![]:!![],'where':_0x23d956['options']?_0x23d956[_0x602f('0x19')][_0x602f('0x1b')]||null:null,'attributes':_0x23d956[_0x602f('0x19')]?_0x23d956[_0x602f('0x19')][_0x602f('0x1c')]||null:null,'limit':_0x23d956[_0x602f('0x19')]?_0x23d956['options'][_0x602f('0x1d')]||null:null,'include':_0x23d956[_0x602f('0x19')]?_0x23d956[_0x602f('0x19')][_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x23d956[_0x602f('0x19')][_0x602f('0x1e')],function(_0x4be19d){return{'model':db[_0x4be19d[_0x602f('0x20')]],'as':_0x4be19d['as'],'attributes':_0x4be19d['attributes'],'include':_0x4be19d[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x4be19d[_0x602f('0x1e')],function(_0x33e7c7){return{'model':db[_0x33e7c7[_0x602f('0x20')]],'as':_0x33e7c7['as'],'attributes':_0x33e7c7[_0x602f('0x1c')],'include':_0x33e7c7[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x33e7c7['include'],function(_0x32edff){return{'model':db[_0x32edff[_0x602f('0x20')]],'as':_0x32edff['as'],'attributes':_0x32edff[_0x602f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x602f('0xc')](function(_0x226c8b){logger[_0x602f('0xd')](_0x602f('0x18'),_0x23d956);logger[_0x602f('0x10')](_0x602f('0x18'),_0x23d956,JSON[_0x602f('0x12')](_0x226c8b));_0x154c3a(_0x226c8b);})[_0x602f('0x17')](function(_0xc51851){logger[_0x602f('0x13')](_0x602f('0x18'),_0xc51851['message'],_0x23d956);_0x4b39f2(_0x12e023[_0x602f('0x13')](0x1f4,_0xc51851[_0x602f('0x15')]));});});};exports[_0x602f('0x21')]=function(_0x2cb770){var _0xe339e9=this;return new Promise(function(_0x41f869,_0x27e7fb){return db[_0x602f('0x22')]['find']({'raw':_0x2cb770['options']?_0x2cb770['options']['raw']===undefined?!![]:![]:!![],'where':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1b')]||null:null,'attributes':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1c')]||null:null,'include':_0x2cb770[_0x602f('0x19')]?_0x2cb770[_0x602f('0x19')][_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x2cb770[_0x602f('0x19')][_0x602f('0x1e')],function(_0x17c474){return{'model':db[_0x17c474[_0x602f('0x20')]],'as':_0x17c474['as'],'attributes':_0x17c474[_0x602f('0x1c')],'include':_0x17c474[_0x602f('0x1e')]?_[_0x602f('0x1f')](_0x17c474[_0x602f('0x1e')],function(_0x499325){return{'model':db[_0x499325[_0x602f('0x20')]],'as':_0x499325['as'],'attributes':_0x499325[_0x602f('0x1c')],'include':_0x499325[_0x602f('0x1e')]?_['map'](_0x499325['include'],function(_0xb054e3){return{'model':db[_0xb054e3[_0x602f('0x20')]],'as':_0xb054e3['as'],'attributes':_0xb054e3[_0x602f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x602f('0xc')](function(_0x1dcc0d){logger[_0x602f('0xd')](_0x602f('0x21'),_0x2cb770);logger[_0x602f('0x10')](_0x602f('0x21'),_0x2cb770,JSON['stringify'](_0x1dcc0d));_0x41f869(_0x1dcc0d);})['catch'](function(_0x1f4d32){logger[_0x602f('0x13')]('ShowDeskAccount',_0x1f4d32[_0x602f('0x15')],_0x2cb770);_0x27e7fb(_0xe339e9[_0x602f('0x13')](0x1f4,_0x1f4d32[_0x602f('0x15')]));});});};
\ No newline at end of file
+var _0x7c6c=['request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetDeskAccount','DeskAccount','findAll','options','where','attributes','limit','include','map','model','then','catch','ShowDeskAccount','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x356b27,_0x256340){var _0x1bf395=function(_0x544143){while(--_0x544143){_0x356b27['push'](_0x356b27['shift']());}};_0x1bf395(++_0x256340);}(_0x7c6c,0x1c4));var _0xc7c6=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x7c6c[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xc7c6('0x0'));var util=require('util');var moment=require(_0xc7c6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7c6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc7c6('0x3'));var logger=require(_0xc7c6('0x4'))(_0xc7c6('0x5'));var config=require(_0xc7c6('0x6'));var jayson=require(_0xc7c6('0x7'));var client=jayson[_0xc7c6('0x8')][_0xc7c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aa54a,_0x3fd5ae,_0x1cec1a){return new BPromise(function(_0x43d9df,_0x56c9d3){return client[_0xc7c6('0xa')](_0x2aa54a,_0x1cec1a)['then'](function(_0x38f090){logger[_0xc7c6('0xb')](_0xc7c6('0xc'),_0x3fd5ae,_0xc7c6('0xd'));logger[_0xc7c6('0xe')](_0xc7c6('0xf'),_0x3fd5ae,_0xc7c6('0xd'),JSON[_0xc7c6('0x10')](_0x38f090));if(_0x38f090[_0xc7c6('0x11')]){if(_0x38f090[_0xc7c6('0x11')][_0xc7c6('0x12')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3fd5ae,_0x38f090[_0xc7c6('0x11')][_0xc7c6('0x13')]);return _0x56c9d3(_0x38f090[_0xc7c6('0x11')][_0xc7c6('0x13')]);}logger[_0xc7c6('0x11')](_0xc7c6('0xc'),_0x3fd5ae,_0x38f090[_0xc7c6('0x11')][_0xc7c6('0x13')]);return _0x43d9df(_0x38f090[_0xc7c6('0x11')]['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x3fd5ae,_0xc7c6('0xd'));_0x43d9df(_0x38f090['result']['message']);}})['catch'](function(_0x3ff64e){logger['error']('DeskAccount,\x20%s,\x20%s',_0x3fd5ae,_0x3ff64e);_0x56c9d3(_0x3ff64e);});});}exports[_0xc7c6('0x14')]=function(_0x4acd59){var _0x11c8d3=this;return new Promise(function(_0x3fc8c5,_0x33220a){return db[_0xc7c6('0x15')][_0xc7c6('0x16')]({'raw':_0x4acd59[_0xc7c6('0x17')]?_0x4acd59[_0xc7c6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4acd59[_0xc7c6('0x17')]?_0x4acd59['options'][_0xc7c6('0x18')]||null:null,'attributes':_0x4acd59[_0xc7c6('0x17')]?_0x4acd59[_0xc7c6('0x17')][_0xc7c6('0x19')]||null:null,'limit':_0x4acd59['options']?_0x4acd59[_0xc7c6('0x17')][_0xc7c6('0x1a')]||null:null,'include':_0x4acd59[_0xc7c6('0x17')]?_0x4acd59[_0xc7c6('0x17')][_0xc7c6('0x1b')]?_[_0xc7c6('0x1c')](_0x4acd59[_0xc7c6('0x17')]['include'],function(_0x4beabc){return{'model':db[_0x4beabc[_0xc7c6('0x1d')]],'as':_0x4beabc['as'],'attributes':_0x4beabc[_0xc7c6('0x19')],'include':_0x4beabc['include']?_[_0xc7c6('0x1c')](_0x4beabc[_0xc7c6('0x1b')],function(_0x4b9c1b){return{'model':db[_0x4b9c1b[_0xc7c6('0x1d')]],'as':_0x4b9c1b['as'],'attributes':_0x4b9c1b[_0xc7c6('0x19')],'include':_0x4b9c1b['include']?_['map'](_0x4b9c1b[_0xc7c6('0x1b')],function(_0x714836){return{'model':db[_0x714836['model']],'as':_0x714836['as'],'attributes':_0x714836['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7c6('0x1e')](function(_0x57a03e){logger[_0xc7c6('0xb')](_0xc7c6('0x14'),_0x4acd59);logger['debug']('GetDeskAccount',_0x4acd59,JSON['stringify'](_0x57a03e));_0x3fc8c5(_0x57a03e);})[_0xc7c6('0x1f')](function(_0x161605){logger[_0xc7c6('0x11')](_0xc7c6('0x14'),_0x161605['message'],_0x4acd59);_0x33220a(_0x11c8d3['error'](0x1f4,_0x161605[_0xc7c6('0x13')]));});});};exports[_0xc7c6('0x20')]=function(_0x18f38f){var _0x45bf9f=this;return new Promise(function(_0x26cdd1,_0x1fa3d1){return db[_0xc7c6('0x15')]['find']({'raw':_0x18f38f[_0xc7c6('0x17')]?_0x18f38f[_0xc7c6('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x18f38f['options']?_0x18f38f[_0xc7c6('0x17')][_0xc7c6('0x18')]||null:null,'attributes':_0x18f38f[_0xc7c6('0x17')]?_0x18f38f[_0xc7c6('0x17')][_0xc7c6('0x19')]||null:null,'include':_0x18f38f[_0xc7c6('0x17')]?_0x18f38f[_0xc7c6('0x17')]['include']?_['map'](_0x18f38f[_0xc7c6('0x17')]['include'],function(_0xa92cdb){return{'model':db[_0xa92cdb[_0xc7c6('0x1d')]],'as':_0xa92cdb['as'],'attributes':_0xa92cdb[_0xc7c6('0x19')],'include':_0xa92cdb[_0xc7c6('0x1b')]?_['map'](_0xa92cdb[_0xc7c6('0x1b')],function(_0x341752){return{'model':db[_0x341752[_0xc7c6('0x1d')]],'as':_0x341752['as'],'attributes':_0x341752[_0xc7c6('0x19')],'include':_0x341752[_0xc7c6('0x1b')]?_[_0xc7c6('0x1c')](_0x341752[_0xc7c6('0x1b')],function(_0x34a800){return{'model':db[_0x34a800[_0xc7c6('0x1d')]],'as':_0x34a800['as'],'attributes':_0x34a800[_0xc7c6('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc7c6('0x1e')](function(_0x51fbf8){logger['info'](_0xc7c6('0x20'),_0x18f38f);logger[_0xc7c6('0xe')](_0xc7c6('0x20'),_0x18f38f,JSON[_0xc7c6('0x10')](_0x51fbf8));_0x26cdd1(_0x51fbf8);})[_0xc7c6('0x1f')](function(_0x28a522){logger[_0xc7c6('0x11')]('ShowDeskAccount',_0x28a522[_0xc7c6('0x13')],_0x18f38f);_0x1fa3d1(_0x45bf9f[_0xc7c6('0x11')](0x1f4,_0x28a522[_0xc7c6('0x13')]));});});};
\ No newline at end of file
index 20f40d8..64956a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x566827,_0x26dd8a){var _0x2c48b4=function(_0x473030){while(--_0x473030){_0x566827['push'](_0x566827['shift']());}};_0x2c48b4(++_0x26dd8a);}(_0x3e74,0x175));var _0x43e7=function(_0x286caa,_0x572db5){_0x286caa=_0x286caa-0x0;var _0x70848d=_0x3e74[_0x286caa];return _0x70848d;};'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('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router;
\ No newline at end of file
+var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x345ec8,_0xaea65f){var _0x3add95=function(_0xce6269){while(--_0xce6269){_0x345ec8['push'](_0x345ec8['shift']());}};_0x3add95(++_0xaea65f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
index 519d104..9e5d4a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x663c=['sequelize','STRING'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x663c,0xe8));var _0xc663=function(_0x37306a,_0x435902){_0x37306a=_0x37306a-0x0;var _0x552039=_0x663c[_0x37306a];return _0x552039;};'use strict';var Sequelize=require(_0xc663('0x0'));module['exports']={'name':{'type':Sequelize[_0xc663('0x1')]},'description':{'type':Sequelize[_0xc663('0x1')]}};
\ No newline at end of file
+var _0xc0b4=['STRING','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc0b4,0x1d5));var _0x4c0b=function(_0x30a8b4,_0x125565){_0x30a8b4=_0x30a8b4-0x0;var _0xeab516=_0xc0b4[_0x30a8b4];return _0xeab516;};'use strict';var Sequelize=require(_0x4c0b('0x0'));module[_0x4c0b('0x1')]={'name':{'type':Sequelize[_0x4c0b('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 776c874..cc0e3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8632=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','DeskField','pick','options','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','to-csv'];(function(_0x4cdff0,_0x41336e){var _0x34eac2=function(_0x199353){while(--_0x199353){_0x4cdff0['push'](_0x4cdff0['shift']());}};_0x34eac2(++_0x41336e);}(_0x8632,0x18a));var _0x2863=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x8632[_0x10852d];return _0x13a8d6;};'use strict';var emlformat=require(_0x2863('0x0'));var rimraf=require(_0x2863('0x1'));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(_0x2863('0x2'));var util=require(_0x2863('0x3'));var path=require(_0x2863('0x4'));var sox=require(_0x2863('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2863('0x6'));var _=require('lodash');var squel=require(_0x2863('0x7'));var crypto=require(_0x2863('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2863('0x9'));var toCsv=require(_0x2863('0xa'));var querystring=require('querystring');var Papa=require(_0x2863('0xb'));var Redis=require(_0x2863('0xc'));var authService=require(_0x2863('0xd'));var qs=require(_0x2863('0xe'));var as=require(_0x2863('0xf'));var hardwareService=require(_0x2863('0x10'));var logger=require(_0x2863('0x11'))(_0x2863('0x12'));var utils=require(_0x2863('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2863('0x14'))['db'];function respondWithStatusCode(_0x37bb46,_0x137756){_0x137756=_0x137756||0xcc;return function(_0x43ec7d){if(_0x43ec7d){return _0x37bb46[_0x2863('0x15')](_0x137756);}return _0x37bb46[_0x2863('0x16')](_0x137756)[_0x2863('0x17')]();};}function respondWithResult(_0x1db833,_0x3b6601){_0x3b6601=_0x3b6601||0xc8;return function(_0x459698){if(_0x459698){return _0x1db833['status'](_0x3b6601)['json'](_0x459698);}};}function respondWithFilteredResult(_0x2abaca,_0x4f27c0){return function(_0x2d3e6d){if(_0x2d3e6d){var _0x5b15b5=typeof _0x4f27c0[_0x2863('0x18')]==='undefined'&&typeof _0x4f27c0[_0x2863('0x19')]==='undefined';var _0x561abc=_0x2d3e6d[_0x2863('0x1a')];var _0x5daa8b=_0x5b15b5?0x0:_0x4f27c0[_0x2863('0x18')];var _0x25009c=_0x5b15b5?_0x2d3e6d['count']:_0x4f27c0[_0x2863('0x18')]+_0x4f27c0[_0x2863('0x19')];var _0xdc3384;if(_0x25009c>=_0x561abc){_0x25009c=_0x561abc;_0xdc3384=0xc8;}else{_0xdc3384=0xce;}_0x2abaca['status'](_0xdc3384);return _0x2abaca[_0x2863('0x1b')](_0x2863('0x1c'),_0x5daa8b+'-'+_0x25009c+'/'+_0x561abc)['json'](_0x2d3e6d);}return null;};}function patchUpdates(_0x277cce){return function(_0xaffa35){try{jsonpatch[_0x2863('0x1d')](_0xaffa35,_0x277cce,!![]);}catch(_0x59d577){return BPromise[_0x2863('0x1e')](_0x59d577);}return _0xaffa35['save']();};}function saveUpdates(_0x18eab0,_0x33022a){return function(_0x59f4d2){if(_0x59f4d2){return _0x59f4d2[_0x2863('0x1f')](_0x18eab0)[_0x2863('0x20')](function(_0x357e1a){return _0x357e1a;});}return null;};}function removeEntity(_0x16fa08,_0xa67c37){return function(_0x5ee45c){if(_0x5ee45c){return _0x5ee45c[_0x2863('0x21')]()[_0x2863('0x20')](function(){_0x16fa08[_0x2863('0x16')](0xcc)[_0x2863('0x17')]();});}};}function handleEntityNotFound(_0x2e952d,_0x5d4c82){return function(_0x1e4de0){if(!_0x1e4de0){_0x2e952d[_0x2863('0x15')](0x194);}return _0x1e4de0;};}function handleError(_0x22cd9a,_0x5ebf72){_0x5ebf72=_0x5ebf72||0x1f4;return function(_0x23751c){logger[_0x2863('0x22')](_0x23751c[_0x2863('0x23')]);if(_0x23751c[_0x2863('0x24')]){delete _0x23751c['name'];}_0x22cd9a[_0x2863('0x16')](_0x5ebf72)[_0x2863('0x25')](_0x23751c);};}exports[_0x2863('0x26')]=function(_0x2c9f3e,_0x4d7e89){var _0x1e93c9={},_0x2c40e2={},_0x14fe65={'count':0x0,'rows':[]};var _0x3da9ad=_[_0x2863('0x27')](db['DeskConfiguration'][_0x2863('0x28')],function(_0x9e0bca){return{'name':_0x9e0bca[_0x2863('0x29')],'type':_0x9e0bca[_0x2863('0x2a')][_0x2863('0x2b')]};});_0x2c40e2['model']=_[_0x2863('0x27')](_0x3da9ad,'name');_0x2c40e2[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x2c9f3e[_0x2863('0x2c')]);_0x2c40e2['filters']=_[_0x2863('0x2e')](_0x2c40e2[_0x2863('0x2f')],_0x2c40e2['query']);_0x1e93c9[_0x2863('0x30')]=_[_0x2863('0x2e')](_0x2c40e2[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x31')]));_0x1e93c9[_0x2863('0x30')]=_0x1e93c9['attributes'][_0x2863('0x32')]?_0x1e93c9[_0x2863('0x30')]:_0x2c40e2[_0x2863('0x2f')];if(!_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x1e93c9[_0x2863('0x19')]=qs[_0x2863('0x19')](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x19')]);_0x1e93c9[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x2c9f3e[_0x2863('0x2c')]['offset']);}_0x1e93c9[_0x2863('0x35')]=qs['sort'](_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x36')]);_0x1e93c9[_0x2863('0x37')]=qs['filters'](_['pick'](_0x2c9f3e[_0x2863('0x2c')],_0x2c40e2[_0x2863('0x38')]),_0x3da9ad);if(_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x39')]){_0x1e93c9['where']=_[_0x2863('0x3a')](_0x1e93c9[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x3da9ad,function(_0x2f03a5){if(_0x2f03a5['type']!=='VIRTUAL'){var _0x205850={};_0x205850[_0x2f03a5[_0x2863('0x24')]]={'$like':'%'+_0x2c9f3e['query']['filter']+'%'};return _0x205850;}})});}_0x1e93c9=_['merge']({},_0x1e93c9,_0x2c9f3e['options']);var _0x534bea={'where':_0x1e93c9[_0x2863('0x37')]};return db[_0x2863('0x3b')][_0x2863('0x1a')](_0x534bea)[_0x2863('0x20')](function(_0x1c84ef){_0x14fe65[_0x2863('0x1a')]=_0x1c84ef;if(_0x2c9f3e[_0x2863('0x2c')][_0x2863('0x3c')]){_0x1e93c9[_0x2863('0x3d')]=[{'all':!![]}];}return db[_0x2863('0x3b')][_0x2863('0x3e')](_0x1e93c9);})[_0x2863('0x20')](function(_0x4a51f3){_0x14fe65[_0x2863('0x3f')]=_0x4a51f3;return _0x14fe65;})[_0x2863('0x20')](respondWithFilteredResult(_0x4d7e89,_0x1e93c9))[_0x2863('0x40')](handleError(_0x4d7e89,null));};exports[_0x2863('0x41')]=function(_0x498c75,_0x94928){var _0x565777={'raw':![],'where':{'id':_0x498c75[_0x2863('0x42')]['id']}},_0x4f0597={};_0x4f0597['model']=_[_0x2863('0x2d')](db[_0x2863('0x3b')][_0x2863('0x28')]);_0x4f0597['query']=_[_0x2863('0x2d')](_0x498c75[_0x2863('0x2c')]);_0x4f0597[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x4f0597['model'],_0x4f0597[_0x2863('0x2c')]);_0x565777[_0x2863('0x30')]=_['intersection'](_0x4f0597[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x498c75[_0x2863('0x2c')][_0x2863('0x31')]));_0x565777[_0x2863('0x30')]=_0x565777['attributes'][_0x2863('0x32')]?_0x565777['attributes']:_0x4f0597[_0x2863('0x2f')];if(_0x498c75[_0x2863('0x2c')][_0x2863('0x3c')]){_0x565777[_0x2863('0x3d')]=[{'all':!![]}];}_0x565777=_[_0x2863('0x3a')]({},_0x565777,_0x498c75['options']);return db[_0x2863('0x3b')][_0x2863('0x43')](_0x565777)['then'](handleEntityNotFound(_0x94928,null))[_0x2863('0x20')](respondWithResult(_0x94928,null))['catch'](handleError(_0x94928,null));};exports[_0x2863('0x44')]=function(_0x48353d,_0x2144bf){return db[_0x2863('0x3b')][_0x2863('0x44')](_0x48353d[_0x2863('0x45')],{})['then'](respondWithResult(_0x2144bf,0xc9))[_0x2863('0x40')](handleError(_0x2144bf,null));};exports['update']=function(_0x1ac3c8,_0xc413b0){if(_0x1ac3c8[_0x2863('0x45')]['id']){delete _0x1ac3c8[_0x2863('0x45')]['id'];}return db[_0x2863('0x3b')][_0x2863('0x43')]({'where':{'id':_0x1ac3c8[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0xc413b0,null))[_0x2863('0x20')](saveUpdates(_0x1ac3c8[_0x2863('0x45')],null))[_0x2863('0x20')](respondWithResult(_0xc413b0,null))[_0x2863('0x40')](handleError(_0xc413b0,null));};exports[_0x2863('0x21')]=function(_0x2f0a1b,_0x40062){return db[_0x2863('0x3b')][_0x2863('0x43')]({'where':{'id':_0x2f0a1b[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0x40062,null))['then'](removeEntity(_0x40062,null))[_0x2863('0x40')](handleError(_0x40062,null));};exports['getFields']=function(_0x3d3daa,_0x172d91,_0x4999d4){var _0xdf6b2e={};var _0x442375={};var _0x464d14;var _0x220511;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x3d3daa[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0x172d91,null))[_0x2863('0x20')](function(_0x34582f){if(_0x34582f){_0x464d14=_0x34582f;_0x442375['model']=_[_0x2863('0x2d')](db[_0x2863('0x47')][_0x2863('0x28')]);_0x442375['query']=_['keys'](_0x3d3daa[_0x2863('0x2c')]);_0x442375[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x442375['model'],_0x442375[_0x2863('0x2c')]);_0xdf6b2e['attributes']=_[_0x2863('0x2e')](_0x442375[_0x2863('0x2f')],qs['fields'](_0x3d3daa['query'][_0x2863('0x31')]));_0xdf6b2e[_0x2863('0x30')]=_0xdf6b2e['attributes']['length']?_0xdf6b2e[_0x2863('0x30')]:_0x442375[_0x2863('0x2f')];_0xdf6b2e[_0x2863('0x35')]=qs[_0x2863('0x36')](_0x3d3daa[_0x2863('0x2c')]['sort']);_0xdf6b2e[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x3d3daa[_0x2863('0x2c')],_0x442375[_0x2863('0x38')]));if(_0x3d3daa['query'][_0x2863('0x39')]){_0xdf6b2e[_0x2863('0x37')]=_['merge'](_0xdf6b2e[_0x2863('0x37')],{'$or':_['map'](_0xdf6b2e[_0x2863('0x30')],function(_0xf1f169){var _0x1b892e={};_0x1b892e[_0xf1f169]={'$like':'%'+_0x3d3daa[_0x2863('0x2c')]['filter']+'%'};return _0x1b892e;})});}_0xdf6b2e=_[_0x2863('0x3a')]({},_0xdf6b2e,_0x3d3daa[_0x2863('0x49')]);return _0x464d14[_0x2863('0x4a')](_0xdf6b2e);}})['then'](function(_0x5642c6){if(_0x5642c6){_0x220511=_0x5642c6[_0x2863('0x32')];if(!_0x3d3daa[_0x2863('0x2c')]['hasOwnProperty'](_0x2863('0x34'))){_0xdf6b2e['limit']=qs[_0x2863('0x19')](_0x3d3daa[_0x2863('0x2c')][_0x2863('0x19')]);_0xdf6b2e[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x3d3daa['query'][_0x2863('0x18')]);}return _0x464d14['getFields'](_0xdf6b2e);}})['then'](function(_0x5cd9f9){if(_0x5cd9f9){return _0x5cd9f9?{'count':_0x220511,'rows':_0x5cd9f9}:null;}})[_0x2863('0x20')](respondWithResult(_0x172d91,null))[_0x2863('0x40')](handleError(_0x172d91,null));};exports[_0x2863('0x4b')]=function(_0x4a43f8,_0x38f386,_0x410d61){var _0x29aa1c={};var _0x2b0dd8={};var _0x3f2f63;var _0x30a276;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x4a43f8[_0x2863('0x42')]['id']}})['then'](handleEntityNotFound(_0x38f386,null))[_0x2863('0x20')](function(_0x2989bd){if(_0x2989bd){_0x3f2f63=_0x2989bd;_0x2b0dd8[_0x2863('0x2f')]=_['keys'](db[_0x2863('0x47')]['rawAttributes']);_0x2b0dd8[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x4a43f8[_0x2863('0x2c')]);_0x2b0dd8[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x2b0dd8[_0x2863('0x2f')],_0x2b0dd8['query']);_0x29aa1c[_0x2863('0x30')]=_[_0x2863('0x2e')](_0x2b0dd8['model'],qs['fields'](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x31')]));_0x29aa1c['attributes']=_0x29aa1c[_0x2863('0x30')][_0x2863('0x32')]?_0x29aa1c[_0x2863('0x30')]:_0x2b0dd8[_0x2863('0x2f')];_0x29aa1c[_0x2863('0x35')]=qs['sort'](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x36')]);_0x29aa1c[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x4a43f8['query'],_0x2b0dd8[_0x2863('0x38')]));if(_0x4a43f8[_0x2863('0x2c')][_0x2863('0x39')]){_0x29aa1c[_0x2863('0x37')]=_[_0x2863('0x3a')](_0x29aa1c[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x29aa1c['attributes'],function(_0x10bebc){var _0xbe1567={};_0xbe1567[_0x10bebc]={'$like':'%'+_0x4a43f8['query']['filter']+'%'};return _0xbe1567;})});}_0x29aa1c=_[_0x2863('0x3a')]({},_0x29aa1c,_0x4a43f8[_0x2863('0x49')]);return _0x3f2f63[_0x2863('0x4b')](_0x29aa1c);}})[_0x2863('0x20')](function(_0x1f3ac7){if(_0x1f3ac7){_0x30a276=_0x1f3ac7[_0x2863('0x32')];if(!_0x4a43f8[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x29aa1c[_0x2863('0x19')]=qs[_0x2863('0x19')](_0x4a43f8[_0x2863('0x2c')][_0x2863('0x19')]);_0x29aa1c['offset']=qs[_0x2863('0x18')](_0x4a43f8[_0x2863('0x2c')]['offset']);}return _0x3f2f63[_0x2863('0x4b')](_0x29aa1c);}})[_0x2863('0x20')](function(_0x42e486){if(_0x42e486){return _0x42e486?{'count':_0x30a276,'rows':_0x42e486}:null;}})['then'](respondWithResult(_0x38f386,null))['catch'](handleError(_0x38f386,null));};exports[_0x2863('0x4c')]=function(_0x5bab18,_0xbeee4b,_0x1317e4){var _0x519cb4={};var _0x499201={};var _0x58fa37;var _0x41c434;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x5bab18[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0xbeee4b,null))['then'](function(_0x589d7e){if(_0x589d7e){_0x58fa37=_0x589d7e;_0x499201[_0x2863('0x2f')]=_[_0x2863('0x2d')](db['DeskField'][_0x2863('0x28')]);_0x499201[_0x2863('0x2c')]=_[_0x2863('0x2d')](_0x5bab18[_0x2863('0x2c')]);_0x499201[_0x2863('0x38')]=_[_0x2863('0x2e')](_0x499201[_0x2863('0x2f')],_0x499201[_0x2863('0x2c')]);_0x519cb4['attributes']=_[_0x2863('0x2e')](_0x499201[_0x2863('0x2f')],qs[_0x2863('0x31')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x31')]));_0x519cb4['attributes']=_0x519cb4[_0x2863('0x30')]['length']?_0x519cb4[_0x2863('0x30')]:_0x499201[_0x2863('0x2f')];_0x519cb4[_0x2863('0x35')]=qs[_0x2863('0x36')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x36')]);_0x519cb4[_0x2863('0x37')]=qs[_0x2863('0x38')](_[_0x2863('0x48')](_0x5bab18[_0x2863('0x2c')],_0x499201['filters']));if(_0x5bab18[_0x2863('0x2c')][_0x2863('0x39')]){_0x519cb4['where']=_[_0x2863('0x3a')](_0x519cb4[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x519cb4[_0x2863('0x30')],function(_0x59287f){var _0x9143ba={};_0x9143ba[_0x59287f]={'$like':'%'+_0x5bab18['query'][_0x2863('0x39')]+'%'};return _0x9143ba;})});}_0x519cb4=_[_0x2863('0x3a')]({},_0x519cb4,_0x5bab18[_0x2863('0x49')]);return _0x58fa37[_0x2863('0x4c')](_0x519cb4);}})['then'](function(_0x17e89a){if(_0x17e89a){_0x41c434=_0x17e89a[_0x2863('0x32')];if(!_0x5bab18['query'][_0x2863('0x33')](_0x2863('0x34'))){_0x519cb4['limit']=qs[_0x2863('0x19')](_0x5bab18[_0x2863('0x2c')][_0x2863('0x19')]);_0x519cb4[_0x2863('0x18')]=qs['offset'](_0x5bab18[_0x2863('0x2c')][_0x2863('0x18')]);}return _0x58fa37['getDescriptions'](_0x519cb4);}})[_0x2863('0x20')](function(_0x2da7a5){if(_0x2da7a5){return _0x2da7a5?{'count':_0x41c434,'rows':_0x2da7a5}:null;}})[_0x2863('0x20')](respondWithResult(_0xbeee4b,null))[_0x2863('0x40')](handleError(_0xbeee4b,null));};exports[_0x2863('0x4d')]=function(_0x52d183,_0xed1a24,_0x1a60d1){var _0x3e9543={};var _0x3bd33c={};var _0x1a2ce8;var _0x165aa4;return db[_0x2863('0x3b')][_0x2863('0x46')]({'where':{'id':_0x52d183[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0xed1a24,null))['then'](function(_0x57541a){if(_0x57541a){_0x1a2ce8=_0x57541a;_0x3bd33c[_0x2863('0x2f')]=_[_0x2863('0x2d')](db[_0x2863('0x4e')][_0x2863('0x28')]);_0x3bd33c['query']=_[_0x2863('0x2d')](_0x52d183['query']);_0x3bd33c[_0x2863('0x38')]=_['intersection'](_0x3bd33c[_0x2863('0x2f')],_0x3bd33c[_0x2863('0x2c')]);_0x3e9543['attributes']=_[_0x2863('0x2e')](_0x3bd33c['model'],qs['fields'](_0x52d183[_0x2863('0x2c')][_0x2863('0x31')]));_0x3e9543[_0x2863('0x30')]=_0x3e9543['attributes'][_0x2863('0x32')]?_0x3e9543[_0x2863('0x30')]:_0x3bd33c[_0x2863('0x2f')];_0x3e9543['order']=qs['sort'](_0x52d183['query']['sort']);_0x3e9543[_0x2863('0x37')]=qs['filters'](_['pick'](_0x52d183['query'],_0x3bd33c['filters']));if(_0x52d183[_0x2863('0x2c')][_0x2863('0x39')]){_0x3e9543['where']=_[_0x2863('0x3a')](_0x3e9543[_0x2863('0x37')],{'$or':_[_0x2863('0x27')](_0x3e9543[_0x2863('0x30')],function(_0x11398e){var _0x4b0456={};_0x4b0456[_0x11398e]={'$like':'%'+_0x52d183[_0x2863('0x2c')][_0x2863('0x39')]+'%'};return _0x4b0456;})});}_0x3e9543=_['merge']({},_0x3e9543,_0x52d183[_0x2863('0x49')]);return _0x1a2ce8['getTags'](_0x3e9543);}})[_0x2863('0x20')](function(_0x464158){if(_0x464158){_0x165aa4=_0x464158[_0x2863('0x32')];if(!_0x52d183[_0x2863('0x2c')][_0x2863('0x33')](_0x2863('0x34'))){_0x3e9543[_0x2863('0x19')]=qs['limit'](_0x52d183['query'][_0x2863('0x19')]);_0x3e9543[_0x2863('0x18')]=qs[_0x2863('0x18')](_0x52d183[_0x2863('0x2c')][_0x2863('0x18')]);}return _0x1a2ce8[_0x2863('0x4d')](_0x3e9543);}})['then'](function(_0x365628){if(_0x365628){return _0x365628?{'count':_0x165aa4,'rows':_0x365628}:null;}})[_0x2863('0x20')](respondWithResult(_0xed1a24,null))[_0x2863('0x40')](handleError(_0xed1a24,null));};exports[_0x2863('0x4f')]=function(_0x61d35f,_0x24b7bd,_0x521533){if(_0x61d35f[_0x2863('0x45')]['id']){delete _0x61d35f[_0x2863('0x45')]['id'];}return db[_0x2863('0x3b')]['findOne']({'where':{'id':_0x61d35f[_0x2863('0x42')]['id']}})[_0x2863('0x20')](handleEntityNotFound(_0x24b7bd,null))['then'](function(_0x5e7dcf){if(_0x5e7dcf){return _0x5e7dcf[_0x2863('0x4f')](_0x61d35f['body'][_0x2863('0x50')]||[]);}return null;})[_0x2863('0x20')](respondWithResult(_0x24b7bd,null))[_0x2863('0x40')](handleError(_0x24b7bd,null));};
\ No newline at end of file
+var _0x9412=['find','create','body','getFields','findOne','getSubjects','getDescriptions','DeskField','getTags','rimraf','zip-dir','moment','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','catch','show','params'];(function(_0x52ad4d,_0x27a0fa){var _0x5a9cc3=function(_0x331a86){while(--_0x331a86){_0x52ad4d['push'](_0x52ad4d['shift']());}};_0x5a9cc3(++_0x27a0fa);}(_0x9412,0x151));var _0x2941=function(_0x28cde3,_0x5d4fc6){_0x28cde3=_0x28cde3-0x0;var _0x2dba45=_0x9412[_0x28cde3];return _0x2dba45;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2941('0x0'));var zipdir=require(_0x2941('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2941('0x2'));var BPromise=require(_0x2941('0x3'));var Mustache=require(_0x2941('0x4'));var util=require(_0x2941('0x5'));var path=require(_0x2941('0x6'));var sox=require(_0x2941('0x7'));var csv=require(_0x2941('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2941('0x9'));var _=require(_0x2941('0xa'));var squel=require(_0x2941('0xb'));var crypto=require('crypto');var jsforce=require(_0x2941('0xc'));var deskjs=require(_0x2941('0xd'));var toCsv=require(_0x2941('0x8'));var querystring=require(_0x2941('0xe'));var Papa=require('papaparse');var Redis=require(_0x2941('0xf'));var authService=require(_0x2941('0x10'));var qs=require(_0x2941('0x11'));var as=require(_0x2941('0x12'));var hardwareService=require(_0x2941('0x13'));var logger=require(_0x2941('0x14'))(_0x2941('0x15'));var utils=require(_0x2941('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2941('0x17'));var db=require(_0x2941('0x18'))['db'];function respondWithStatusCode(_0xc414d,_0x3b7233){_0x3b7233=_0x3b7233||0xcc;return function(_0x577dec){if(_0x577dec){return _0xc414d['sendStatus'](_0x3b7233);}return _0xc414d[_0x2941('0x19')](_0x3b7233)[_0x2941('0x1a')]();};}function respondWithResult(_0x2e4a6c,_0x44d344){_0x44d344=_0x44d344||0xc8;return function(_0x1e6be4){if(_0x1e6be4){return _0x2e4a6c[_0x2941('0x19')](_0x44d344)[_0x2941('0x1b')](_0x1e6be4);}};}function respondWithFilteredResult(_0x1ba076,_0x36b23e){return function(_0x42e1c9){if(_0x42e1c9){var _0x25671b=typeof _0x36b23e[_0x2941('0x1c')]===_0x2941('0x1d')&&typeof _0x36b23e[_0x2941('0x1e')]===_0x2941('0x1d');var _0x7cff06=_0x42e1c9[_0x2941('0x1f')];var _0x789fcc=_0x25671b?0x0:_0x36b23e['offset'];var _0x26ef6d=_0x25671b?_0x42e1c9[_0x2941('0x1f')]:_0x36b23e[_0x2941('0x1c')]+_0x36b23e[_0x2941('0x1e')];var _0x13caa2;if(_0x26ef6d>=_0x7cff06){_0x26ef6d=_0x7cff06;_0x13caa2=0xc8;}else{_0x13caa2=0xce;}_0x1ba076[_0x2941('0x19')](_0x13caa2);return _0x1ba076[_0x2941('0x20')](_0x2941('0x21'),_0x789fcc+'-'+_0x26ef6d+'/'+_0x7cff06)[_0x2941('0x1b')](_0x42e1c9);}return null;};}function patchUpdates(_0x97ccc2){return function(_0x5b8cbe){try{jsonpatch[_0x2941('0x22')](_0x5b8cbe,_0x97ccc2,!![]);}catch(_0x116748){return BPromise[_0x2941('0x23')](_0x116748);}return _0x5b8cbe[_0x2941('0x24')]();};}function saveUpdates(_0x1ff56e,_0x3245f0){return function(_0x1b9488){if(_0x1b9488){return _0x1b9488[_0x2941('0x25')](_0x1ff56e)[_0x2941('0x26')](function(_0x5cec6c){return _0x5cec6c;});}return null;};}function removeEntity(_0x148dc5,_0x4b9a80){return function(_0x145039){if(_0x145039){return _0x145039['destroy']()[_0x2941('0x26')](function(){_0x148dc5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x858f06,_0x2322e4){return function(_0x21f66d){if(!_0x21f66d){_0x858f06[_0x2941('0x27')](0x194);}return _0x21f66d;};}function handleError(_0x443bc,_0x1b6c51){_0x1b6c51=_0x1b6c51||0x1f4;return function(_0x4e5407){logger[_0x2941('0x28')](_0x4e5407[_0x2941('0x29')]);if(_0x4e5407[_0x2941('0x2a')]){delete _0x4e5407[_0x2941('0x2a')];}_0x443bc['status'](_0x1b6c51)['send'](_0x4e5407);};}exports[_0x2941('0x2b')]=function(_0x45d42b,_0x31a4ad){var _0x5ee644={},_0x10f1b0={},_0x2c959c={'count':0x0,'rows':[]};var _0xdbbc9a=_['map'](db['DeskConfiguration'][_0x2941('0x2c')],function(_0x5a04c1){return{'name':_0x5a04c1[_0x2941('0x2d')],'type':_0x5a04c1[_0x2941('0x2e')]['key']};});_0x10f1b0[_0x2941('0x2f')]=_[_0x2941('0x30')](_0xdbbc9a,_0x2941('0x2a'));_0x10f1b0['query']=_[_0x2941('0x31')](_0x45d42b[_0x2941('0x32')]);_0x10f1b0[_0x2941('0x33')]=_[_0x2941('0x34')](_0x10f1b0[_0x2941('0x2f')],_0x10f1b0[_0x2941('0x32')]);_0x5ee644[_0x2941('0x35')]=_[_0x2941('0x34')](_0x10f1b0['model'],qs[_0x2941('0x36')](_0x45d42b[_0x2941('0x32')][_0x2941('0x36')]));_0x5ee644['attributes']=_0x5ee644['attributes'][_0x2941('0x37')]?_0x5ee644[_0x2941('0x35')]:_0x10f1b0['model'];if(!_0x45d42b['query'][_0x2941('0x38')](_0x2941('0x39'))){_0x5ee644['limit']=qs[_0x2941('0x1e')](_0x45d42b['query'][_0x2941('0x1e')]);_0x5ee644[_0x2941('0x1c')]=qs[_0x2941('0x1c')](_0x45d42b[_0x2941('0x32')][_0x2941('0x1c')]);}_0x5ee644[_0x2941('0x3a')]=qs['sort'](_0x45d42b[_0x2941('0x32')][_0x2941('0x3b')]);_0x5ee644['where']=qs[_0x2941('0x33')](_[_0x2941('0x3c')](_0x45d42b[_0x2941('0x32')],_0x10f1b0['filters']),_0xdbbc9a);if(_0x45d42b[_0x2941('0x32')][_0x2941('0x3d')]){_0x5ee644[_0x2941('0x3e')]=_[_0x2941('0x3f')](_0x5ee644[_0x2941('0x3e')],{'$or':_['map'](_0xdbbc9a,function(_0x55f437){if(_0x55f437['type']!==_0x2941('0x40')){var _0x3e87f8={};_0x3e87f8[_0x55f437[_0x2941('0x2a')]]={'$like':'%'+_0x45d42b[_0x2941('0x32')][_0x2941('0x3d')]+'%'};return _0x3e87f8;}})});}_0x5ee644=_['merge']({},_0x5ee644,_0x45d42b[_0x2941('0x41')]);var _0x518db8={'where':_0x5ee644[_0x2941('0x3e')]};return db[_0x2941('0x42')][_0x2941('0x1f')](_0x518db8)[_0x2941('0x26')](function(_0x3b5494){_0x2c959c[_0x2941('0x1f')]=_0x3b5494;if(_0x45d42b[_0x2941('0x32')][_0x2941('0x43')]){_0x5ee644[_0x2941('0x44')]=[{'all':!![]}];}return db[_0x2941('0x42')][_0x2941('0x45')](_0x5ee644);})['then'](function(_0x3beba8){_0x2c959c['rows']=_0x3beba8;return _0x2c959c;})[_0x2941('0x26')](respondWithFilteredResult(_0x31a4ad,_0x5ee644))[_0x2941('0x46')](handleError(_0x31a4ad,null));};exports[_0x2941('0x47')]=function(_0x1f7cff,_0xf536f8){var _0x47c5ba={'raw':![],'where':{'id':_0x1f7cff[_0x2941('0x48')]['id']}},_0x3a315e={};_0x3a315e['model']=_[_0x2941('0x31')](db['DeskConfiguration']['rawAttributes']);_0x3a315e[_0x2941('0x32')]=_[_0x2941('0x31')](_0x1f7cff[_0x2941('0x32')]);_0x3a315e['filters']=_['intersection'](_0x3a315e['model'],_0x3a315e[_0x2941('0x32')]);_0x47c5ba[_0x2941('0x35')]=_[_0x2941('0x34')](_0x3a315e[_0x2941('0x2f')],qs[_0x2941('0x36')](_0x1f7cff[_0x2941('0x32')][_0x2941('0x36')]));_0x47c5ba['attributes']=_0x47c5ba['attributes'][_0x2941('0x37')]?_0x47c5ba[_0x2941('0x35')]:_0x3a315e[_0x2941('0x2f')];if(_0x1f7cff[_0x2941('0x32')]['includeAll']){_0x47c5ba[_0x2941('0x44')]=[{'all':!![]}];}_0x47c5ba=_[_0x2941('0x3f')]({},_0x47c5ba,_0x1f7cff[_0x2941('0x41')]);return db[_0x2941('0x42')][_0x2941('0x49')](_0x47c5ba)['then'](handleEntityNotFound(_0xf536f8,null))['then'](respondWithResult(_0xf536f8,null))[_0x2941('0x46')](handleError(_0xf536f8,null));};exports[_0x2941('0x4a')]=function(_0x54880c,_0x381849){return db['DeskConfiguration'][_0x2941('0x4a')](_0x54880c['body'],{})[_0x2941('0x26')](respondWithResult(_0x381849,0xc9))['catch'](handleError(_0x381849,null));};exports[_0x2941('0x25')]=function(_0x56d447,_0x4fdac3){if(_0x56d447['body']['id']){delete _0x56d447[_0x2941('0x4b')]['id'];}return db[_0x2941('0x42')]['find']({'where':{'id':_0x56d447[_0x2941('0x48')]['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x4fdac3,null))[_0x2941('0x26')](saveUpdates(_0x56d447[_0x2941('0x4b')],null))['then'](respondWithResult(_0x4fdac3,null))[_0x2941('0x46')](handleError(_0x4fdac3,null));};exports['destroy']=function(_0x200e4d,_0x43baeb){return db[_0x2941('0x42')][_0x2941('0x49')]({'where':{'id':_0x200e4d[_0x2941('0x48')]['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x43baeb,null))[_0x2941('0x26')](removeEntity(_0x43baeb,null))[_0x2941('0x46')](handleError(_0x43baeb,null));};exports['getFields']=function(_0x47f75f,_0x2a8230,_0x15ba7a){var _0x391b89={};var _0x1e4ba1={};var _0x53d1f8;var _0x54e93e;return db[_0x2941('0x42')]['findOne']({'where':{'id':_0x47f75f[_0x2941('0x48')]['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x2a8230,null))[_0x2941('0x26')](function(_0x34b61b){if(_0x34b61b){_0x53d1f8=_0x34b61b;_0x1e4ba1[_0x2941('0x2f')]=_['keys'](db['DeskField']['rawAttributes']);_0x1e4ba1['query']=_[_0x2941('0x31')](_0x47f75f[_0x2941('0x32')]);_0x1e4ba1['filters']=_[_0x2941('0x34')](_0x1e4ba1['model'],_0x1e4ba1[_0x2941('0x32')]);_0x391b89[_0x2941('0x35')]=_[_0x2941('0x34')](_0x1e4ba1[_0x2941('0x2f')],qs[_0x2941('0x36')](_0x47f75f[_0x2941('0x32')][_0x2941('0x36')]));_0x391b89[_0x2941('0x35')]=_0x391b89[_0x2941('0x35')][_0x2941('0x37')]?_0x391b89['attributes']:_0x1e4ba1['model'];_0x391b89[_0x2941('0x3a')]=qs[_0x2941('0x3b')](_0x47f75f[_0x2941('0x32')][_0x2941('0x3b')]);_0x391b89[_0x2941('0x3e')]=qs[_0x2941('0x33')](_[_0x2941('0x3c')](_0x47f75f[_0x2941('0x32')],_0x1e4ba1[_0x2941('0x33')]));if(_0x47f75f[_0x2941('0x32')][_0x2941('0x3d')]){_0x391b89[_0x2941('0x3e')]=_[_0x2941('0x3f')](_0x391b89['where'],{'$or':_[_0x2941('0x30')](_0x391b89[_0x2941('0x35')],function(_0x55aa50){var _0x1233df={};_0x1233df[_0x55aa50]={'$like':'%'+_0x47f75f['query'][_0x2941('0x3d')]+'%'};return _0x1233df;})});}_0x391b89=_[_0x2941('0x3f')]({},_0x391b89,_0x47f75f[_0x2941('0x41')]);return _0x53d1f8['getFields'](_0x391b89);}})[_0x2941('0x26')](function(_0x4970c6){if(_0x4970c6){_0x54e93e=_0x4970c6[_0x2941('0x37')];if(!_0x47f75f['query']['hasOwnProperty'](_0x2941('0x39'))){_0x391b89[_0x2941('0x1e')]=qs['limit'](_0x47f75f[_0x2941('0x32')][_0x2941('0x1e')]);_0x391b89[_0x2941('0x1c')]=qs[_0x2941('0x1c')](_0x47f75f[_0x2941('0x32')][_0x2941('0x1c')]);}return _0x53d1f8[_0x2941('0x4c')](_0x391b89);}})[_0x2941('0x26')](function(_0x253783){if(_0x253783){return _0x253783?{'count':_0x54e93e,'rows':_0x253783}:null;}})[_0x2941('0x26')](respondWithResult(_0x2a8230,null))[_0x2941('0x46')](handleError(_0x2a8230,null));};exports['getSubjects']=function(_0x1f8978,_0x4af13f,_0x4c4083){var _0x3bf467={};var _0x4344c8={};var _0x5b7fc0;var _0x1aee7b;return db[_0x2941('0x42')][_0x2941('0x4d')]({'where':{'id':_0x1f8978[_0x2941('0x48')]['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x4af13f,null))[_0x2941('0x26')](function(_0x5994f9){if(_0x5994f9){_0x5b7fc0=_0x5994f9;_0x4344c8[_0x2941('0x2f')]=_[_0x2941('0x31')](db['DeskField'][_0x2941('0x2c')]);_0x4344c8[_0x2941('0x32')]=_[_0x2941('0x31')](_0x1f8978[_0x2941('0x32')]);_0x4344c8[_0x2941('0x33')]=_[_0x2941('0x34')](_0x4344c8[_0x2941('0x2f')],_0x4344c8['query']);_0x3bf467[_0x2941('0x35')]=_[_0x2941('0x34')](_0x4344c8[_0x2941('0x2f')],qs['fields'](_0x1f8978[_0x2941('0x32')][_0x2941('0x36')]));_0x3bf467['attributes']=_0x3bf467[_0x2941('0x35')]['length']?_0x3bf467[_0x2941('0x35')]:_0x4344c8[_0x2941('0x2f')];_0x3bf467[_0x2941('0x3a')]=qs[_0x2941('0x3b')](_0x1f8978['query'][_0x2941('0x3b')]);_0x3bf467[_0x2941('0x3e')]=qs[_0x2941('0x33')](_['pick'](_0x1f8978[_0x2941('0x32')],_0x4344c8[_0x2941('0x33')]));if(_0x1f8978['query'][_0x2941('0x3d')]){_0x3bf467['where']=_[_0x2941('0x3f')](_0x3bf467['where'],{'$or':_[_0x2941('0x30')](_0x3bf467['attributes'],function(_0x3877f6){var _0x4d2d79={};_0x4d2d79[_0x3877f6]={'$like':'%'+_0x1f8978['query'][_0x2941('0x3d')]+'%'};return _0x4d2d79;})});}_0x3bf467=_[_0x2941('0x3f')]({},_0x3bf467,_0x1f8978[_0x2941('0x41')]);return _0x5b7fc0[_0x2941('0x4e')](_0x3bf467);}})['then'](function(_0x4e97c9){if(_0x4e97c9){_0x1aee7b=_0x4e97c9[_0x2941('0x37')];if(!_0x1f8978[_0x2941('0x32')][_0x2941('0x38')]('nolimit')){_0x3bf467['limit']=qs[_0x2941('0x1e')](_0x1f8978['query'][_0x2941('0x1e')]);_0x3bf467[_0x2941('0x1c')]=qs[_0x2941('0x1c')](_0x1f8978[_0x2941('0x32')][_0x2941('0x1c')]);}return _0x5b7fc0[_0x2941('0x4e')](_0x3bf467);}})[_0x2941('0x26')](function(_0x2b36f5){if(_0x2b36f5){return _0x2b36f5?{'count':_0x1aee7b,'rows':_0x2b36f5}:null;}})['then'](respondWithResult(_0x4af13f,null))[_0x2941('0x46')](handleError(_0x4af13f,null));};exports[_0x2941('0x4f')]=function(_0x5e4b64,_0x2489b9,_0x5478a9){var _0x350db6={};var _0x258ee7={};var _0x296a10;var _0x15e3c2;return db['DeskConfiguration'][_0x2941('0x4d')]({'where':{'id':_0x5e4b64['params']['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x2489b9,null))[_0x2941('0x26')](function(_0x4f1ff7){if(_0x4f1ff7){_0x296a10=_0x4f1ff7;_0x258ee7['model']=_[_0x2941('0x31')](db[_0x2941('0x50')]['rawAttributes']);_0x258ee7[_0x2941('0x32')]=_[_0x2941('0x31')](_0x5e4b64[_0x2941('0x32')]);_0x258ee7[_0x2941('0x33')]=_[_0x2941('0x34')](_0x258ee7['model'],_0x258ee7[_0x2941('0x32')]);_0x350db6[_0x2941('0x35')]=_[_0x2941('0x34')](_0x258ee7[_0x2941('0x2f')],qs['fields'](_0x5e4b64[_0x2941('0x32')][_0x2941('0x36')]));_0x350db6[_0x2941('0x35')]=_0x350db6['attributes']['length']?_0x350db6[_0x2941('0x35')]:_0x258ee7['model'];_0x350db6[_0x2941('0x3a')]=qs[_0x2941('0x3b')](_0x5e4b64['query']['sort']);_0x350db6['where']=qs[_0x2941('0x33')](_['pick'](_0x5e4b64[_0x2941('0x32')],_0x258ee7['filters']));if(_0x5e4b64[_0x2941('0x32')]['filter']){_0x350db6['where']=_[_0x2941('0x3f')](_0x350db6[_0x2941('0x3e')],{'$or':_[_0x2941('0x30')](_0x350db6[_0x2941('0x35')],function(_0x5c4d6e){var _0x5e6f23={};_0x5e6f23[_0x5c4d6e]={'$like':'%'+_0x5e4b64[_0x2941('0x32')][_0x2941('0x3d')]+'%'};return _0x5e6f23;})});}_0x350db6=_[_0x2941('0x3f')]({},_0x350db6,_0x5e4b64['options']);return _0x296a10[_0x2941('0x4f')](_0x350db6);}})[_0x2941('0x26')](function(_0x3c5bff){if(_0x3c5bff){_0x15e3c2=_0x3c5bff[_0x2941('0x37')];if(!_0x5e4b64['query']['hasOwnProperty']('nolimit')){_0x350db6['limit']=qs[_0x2941('0x1e')](_0x5e4b64['query'][_0x2941('0x1e')]);_0x350db6['offset']=qs[_0x2941('0x1c')](_0x5e4b64[_0x2941('0x32')][_0x2941('0x1c')]);}return _0x296a10['getDescriptions'](_0x350db6);}})['then'](function(_0x261beb){if(_0x261beb){return _0x261beb?{'count':_0x15e3c2,'rows':_0x261beb}:null;}})[_0x2941('0x26')](respondWithResult(_0x2489b9,null))['catch'](handleError(_0x2489b9,null));};exports[_0x2941('0x51')]=function(_0x16840c,_0x137a1c,_0x4dffc2){var _0x55837f={};var _0x1feaa0={};var _0x35e0ac;var _0x2ba7d3;return db[_0x2941('0x42')]['findOne']({'where':{'id':_0x16840c['params']['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x137a1c,null))[_0x2941('0x26')](function(_0x232c8d){if(_0x232c8d){_0x35e0ac=_0x232c8d;_0x1feaa0[_0x2941('0x2f')]=_['keys'](db['Tag'][_0x2941('0x2c')]);_0x1feaa0[_0x2941('0x32')]=_['keys'](_0x16840c[_0x2941('0x32')]);_0x1feaa0[_0x2941('0x33')]=_[_0x2941('0x34')](_0x1feaa0[_0x2941('0x2f')],_0x1feaa0[_0x2941('0x32')]);_0x55837f[_0x2941('0x35')]=_['intersection'](_0x1feaa0[_0x2941('0x2f')],qs['fields'](_0x16840c[_0x2941('0x32')]['fields']));_0x55837f['attributes']=_0x55837f['attributes'][_0x2941('0x37')]?_0x55837f['attributes']:_0x1feaa0[_0x2941('0x2f')];_0x55837f[_0x2941('0x3a')]=qs[_0x2941('0x3b')](_0x16840c['query']['sort']);_0x55837f[_0x2941('0x3e')]=qs[_0x2941('0x33')](_[_0x2941('0x3c')](_0x16840c[_0x2941('0x32')],_0x1feaa0[_0x2941('0x33')]));if(_0x16840c[_0x2941('0x32')][_0x2941('0x3d')]){_0x55837f['where']=_['merge'](_0x55837f[_0x2941('0x3e')],{'$or':_[_0x2941('0x30')](_0x55837f[_0x2941('0x35')],function(_0xb92941){var _0x53e105={};_0x53e105[_0xb92941]={'$like':'%'+_0x16840c['query'][_0x2941('0x3d')]+'%'};return _0x53e105;})});}_0x55837f=_[_0x2941('0x3f')]({},_0x55837f,_0x16840c['options']);return _0x35e0ac[_0x2941('0x51')](_0x55837f);}})[_0x2941('0x26')](function(_0x194e08){if(_0x194e08){_0x2ba7d3=_0x194e08[_0x2941('0x37')];if(!_0x16840c[_0x2941('0x32')][_0x2941('0x38')](_0x2941('0x39'))){_0x55837f[_0x2941('0x1e')]=qs[_0x2941('0x1e')](_0x16840c[_0x2941('0x32')][_0x2941('0x1e')]);_0x55837f['offset']=qs[_0x2941('0x1c')](_0x16840c[_0x2941('0x32')][_0x2941('0x1c')]);}return _0x35e0ac['getTags'](_0x55837f);}})['then'](function(_0x4597d4){if(_0x4597d4){return _0x4597d4?{'count':_0x2ba7d3,'rows':_0x4597d4}:null;}})[_0x2941('0x26')](respondWithResult(_0x137a1c,null))[_0x2941('0x46')](handleError(_0x137a1c,null));};exports['setTags']=function(_0x3b2c93,_0x5c782b,_0x5bdf70){if(_0x3b2c93[_0x2941('0x4b')]['id']){delete _0x3b2c93[_0x2941('0x4b')]['id'];}return db[_0x2941('0x42')][_0x2941('0x4d')]({'where':{'id':_0x3b2c93[_0x2941('0x48')]['id']}})[_0x2941('0x26')](handleEntityNotFound(_0x5c782b,null))[_0x2941('0x26')](function(_0x2a1618){if(_0x2a1618){return _0x2a1618['setTags'](_0x3b2c93[_0x2941('0x4b')]['ids']||[]);}return null;})['then'](respondWithResult(_0x5c782b,null))['catch'](handleError(_0x5c782b,null));};
\ No newline at end of file
index 9afbb86..4ba1866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfdb=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x270c1e,_0x1b44cb){var _0xd77473=function(_0x50aeda){while(--_0x50aeda){_0x270c1e['push'](_0x270c1e['shift']());}};_0xd77473(++_0x1b44cb);}(_0xbfdb,0x13a));var _0xbbfd=function(_0x1b6b61,_0x1ebdfd){_0x1b6b61=_0x1b6b61-0x0;var _0x578b5b=_0xbfdb[_0x1b6b61];return _0x578b5b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbfd('0x0'));var moment=require(_0xbbfd('0x1'));var BPromise=require(_0xbbfd('0x2'));var rp=require(_0xbbfd('0x3'));var fs=require('fs');var path=require(_0xbbfd('0x4'));var rimraf=require('rimraf');var config=require(_0xbbfd('0x5'));var attributes=require(_0xbbfd('0x6'));module[_0xbbfd('0x7')]=function(_0x5a1363,_0x1ffae0){return _0x5a1363[_0xbbfd('0x8')](_0xbbfd('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a40=['./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x588370,_0x4563b9){var _0x1b0dc1=function(_0x2a1689){while(--_0x2a1689){_0x588370['push'](_0x588370['shift']());}};_0x1b0dc1(++_0x4563b9);}(_0x6a40,0x1a7));var _0x06a4=function(_0x426866,_0xf3b760){_0x426866=_0x426866-0x0;var _0x27fce9=_0x6a40[_0x426866];return _0x27fce9;};'use strict';var _=require(_0x06a4('0x0'));var util=require('util');var logger=require(_0x06a4('0x1'))(_0x06a4('0x2'));var moment=require(_0x06a4('0x3'));var BPromise=require('bluebird');var rp=require(_0x06a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x06a4('0x5'));var config=require(_0x06a4('0x6'));var attributes=require(_0x06a4('0x7'));module[_0x06a4('0x8')]=function(_0x368276,_0x1c4f85){return _0x368276['define']('DeskConfiguration',attributes,{'tableName':_0x06a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c7025e1..df70c00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca4=['http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x69e5a9,_0x51afa7){var _0x28a0d1=function(_0x1ac166){while(--_0x1ac166){_0x69e5a9['push'](_0x69e5a9['shift']());}};_0x28a0d1(++_0x51afa7);}(_0xdca4,0x138));var _0x4dca=function(_0x169db3,_0x3ce092){_0x169db3=_0x169db3-0x0;var _0x499e19=_0xdca4[_0x169db3];return _0x499e19;};'use strict';var _=require(_0x4dca('0x0'));var util=require('util');var moment=require(_0x4dca('0x1'));var BPromise=require('bluebird');var rs=require(_0x4dca('0x2'));var fs=require('fs');var Redis=require(_0x4dca('0x3'));var db=require(_0x4dca('0x4'))['db'];var utils=require(_0x4dca('0x5'));var logger=require(_0x4dca('0x6'))(_0x4dca('0x7'));var config=require(_0x4dca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4dca('0x9')][_0x4dca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ecf67,_0x3209c4,_0x56017c){return new BPromise(function(_0x2e66ad,_0x35966b){return client[_0x4dca('0xb')](_0x3ecf67,_0x56017c)[_0x4dca('0xc')](function(_0x1e1e56){logger[_0x4dca('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x3209c4,_0x4dca('0xe'));logger[_0x4dca('0xf')](_0x4dca('0x10'),_0x3209c4,'request\x20sent',JSON[_0x4dca('0x11')](_0x1e1e56));if(_0x1e1e56[_0x4dca('0x12')]){if(_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x13')]===0x1f4){logger[_0x4dca('0x12')](_0x4dca('0x14'),_0x3209c4,_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);return _0x35966b(_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);}logger[_0x4dca('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3209c4,_0x1e1e56[_0x4dca('0x12')][_0x4dca('0x15')]);return _0x2e66ad(_0x1e1e56[_0x4dca('0x12')]['message']);}else{logger[_0x4dca('0xd')](_0x4dca('0x14'),_0x3209c4,'request\x20sent');_0x2e66ad(_0x1e1e56[_0x4dca('0x16')][_0x4dca('0x15')]);}})['catch'](function(_0x327050){logger[_0x4dca('0x12')](_0x4dca('0x14'),_0x3209c4,_0x327050);_0x35966b(_0x327050);});});}
\ No newline at end of file
+var _0xed0b=['http','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','moment','bluebird','randomstring','../../config/logger','../../config/environment'];(function(_0x4660b9,_0x172664){var _0x3d0b6b=function(_0x3632e1){while(--_0x3632e1){_0x4660b9['push'](_0x4660b9['shift']());}};_0x3d0b6b(++_0x172664);}(_0xed0b,0x15f));var _0xbed0=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0xed0b[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xbed0('0x0'));var util=require('util');var moment=require(_0xbed0('0x1'));var BPromise=require(_0xbed0('0x2'));var rs=require(_0xbed0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbed0('0x4'))('rpc');var config=require(_0xbed0('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbed0('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15508e,_0x1d748e,_0x305014){return new BPromise(function(_0xf85e12,_0x4ca3a0){return client[_0xbed0('0x7')](_0x15508e,_0x305014)[_0xbed0('0x8')](function(_0x34cc5e){logger[_0xbed0('0x9')](_0xbed0('0xa'),_0x1d748e,'request\x20sent');logger[_0xbed0('0xb')](_0xbed0('0xc'),_0x1d748e,_0xbed0('0xd'),JSON['stringify'](_0x34cc5e));if(_0x34cc5e[_0xbed0('0xe')]){if(_0x34cc5e['error'][_0xbed0('0xf')]===0x1f4){logger[_0xbed0('0xe')](_0xbed0('0xa'),_0x1d748e,_0x34cc5e[_0xbed0('0xe')][_0xbed0('0x10')]);return _0x4ca3a0(_0x34cc5e[_0xbed0('0xe')]['message']);}logger[_0xbed0('0xe')](_0xbed0('0xa'),_0x1d748e,_0x34cc5e['error'][_0xbed0('0x10')]);return _0xf85e12(_0x34cc5e[_0xbed0('0xe')][_0xbed0('0x10')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x1d748e,_0xbed0('0xd'));_0xf85e12(_0x34cc5e['result']['message']);}})['catch'](function(_0xf2c2a3){logger[_0xbed0('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x1d748e,_0xf2c2a3);_0x4ca3a0(_0xf2c2a3);});});}
\ No newline at end of file
index 14c55e3..98d5e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc468=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get'];(function(_0x4d88b8,_0x195547){var _0x32f725=function(_0x32145a){while(--_0x32145a){_0x4d88b8['push'](_0x4d88b8['shift']());}};_0x32f725(++_0x195547);}(_0xc468,0xd0));var _0x8c46=function(_0x423b1c,_0x403585){_0x423b1c=_0x423b1c-0x0;var _0xa050b6=_0xc468[_0x423b1c];return _0xa050b6;};'use strict';var multer=require(_0x8c46('0x0'));var util=require('util');var path=require(_0x8c46('0x1'));var timeout=require(_0x8c46('0x2'));var express=require(_0x8c46('0x3'));var router=express[_0x8c46('0x4')]();var fs_extra=require(_0x8c46('0x5'));var auth=require(_0x8c46('0x6'));var interaction=require(_0x8c46('0x7'));var config=require(_0x8c46('0x8'));var controller=require(_0x8c46('0x9'));router['get']('/',auth[_0x8c46('0xa')](),controller['index']);router[_0x8c46('0xb')](_0x8c46('0xc'),auth[_0x8c46('0xa')](),controller[_0x8c46('0xd')]);router['post']('/',auth[_0x8c46('0xa')](),controller[_0x8c46('0xe')]);router[_0x8c46('0xf')]('/:id',auth[_0x8c46('0xa')](),controller[_0x8c46('0x10')]);router[_0x8c46('0x11')]('/:id',auth[_0x8c46('0xa')](),controller[_0x8c46('0x12')]);module[_0x8c46('0x13')]=router;
\ No newline at end of file
+var _0xf99c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x128b2e,_0x3ef096){var _0x3be698=function(_0x493e67){while(--_0x493e67){_0x128b2e['push'](_0x128b2e['shift']());}};_0x3be698(++_0x3ef096);}(_0xf99c,0x129));var _0xcf99=function(_0x370513,_0x5d3dc9){_0x370513=_0x370513-0x0;var _0x2c55d6=_0xf99c[_0x370513];return _0x2c55d6;};'use strict';var multer=require(_0xcf99('0x0'));var util=require(_0xcf99('0x1'));var path=require(_0xcf99('0x2'));var timeout=require(_0xcf99('0x3'));var express=require(_0xcf99('0x4'));var router=express[_0xcf99('0x5')]();var fs_extra=require(_0xcf99('0x6'));var auth=require(_0xcf99('0x7'));var interaction=require(_0xcf99('0x8'));var config=require(_0xcf99('0x9'));var controller=require(_0xcf99('0xa'));router['get']('/',auth[_0xcf99('0xb')](),controller[_0xcf99('0xc')]);router[_0xcf99('0xd')](_0xcf99('0xe'),auth[_0xcf99('0xb')](),controller['show']);router['post']('/',auth[_0xcf99('0xb')](),controller[_0xcf99('0xf')]);router['put'](_0xcf99('0xe'),auth[_0xcf99('0xb')](),controller[_0xcf99('0x10')]);router[_0xcf99('0x11')](_0xcf99('0xe'),auth[_0xcf99('0xb')](),controller['destroy']);module[_0xcf99('0x12')]=router;
\ No newline at end of file
index 02140f5..9292b2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb639=['customVariable','keyValue','STRING','ENUM','sequelize','string','variable'];(function(_0x1f9559,_0x27ad92){var _0x1715fe=function(_0x457563){while(--_0x457563){_0x1f9559['push'](_0x1f9559['shift']());}};_0x1715fe(++_0x27ad92);}(_0xb639,0x1c4));var _0x9b63=function(_0x156b75,_0x2778d7){_0x156b75=_0x156b75-0x0;var _0x472179=_0xb639[_0x156b75];return _0x472179;};'use strict';var Sequelize=require(_0x9b63('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x9b63('0x1'),_0x9b63('0x2'),_0x9b63('0x3'),_0x9b63('0x4'),'picklist'),'defaultValue':_0x9b63('0x1')},'content':{'type':Sequelize[_0x9b63('0x5')]},'key':{'type':Sequelize[_0x9b63('0x5')]},'keyType':{'type':Sequelize[_0x9b63('0x6')](_0x9b63('0x1'),_0x9b63('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x9b63('0x5')]},'idField':{'type':Sequelize[_0x9b63('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9b63('0x5')]}};
\ No newline at end of file
+var _0x006a=['variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x006a,0x133));var _0xa006=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x006a[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0xa006('0x0'));module[_0xa006('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa006('0x2'),_0xa006('0x3'),_0xa006('0x4'),_0xa006('0x5'),_0xa006('0x6')),'defaultValue':_0xa006('0x2')},'content':{'type':Sequelize[_0xa006('0x7')]},'key':{'type':Sequelize[_0xa006('0x7')]},'keyType':{'type':Sequelize[_0xa006('0x8')](_0xa006('0x2'),'variable',_0xa006('0x4'))},'keyContent':{'type':Sequelize[_0xa006('0x7')]},'idField':{'type':Sequelize[_0xa006('0x7')]},'nameField':{'type':Sequelize[_0xa006('0x7')]},'customField':{'type':Sequelize[_0xa006('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa006('0x7')]}};
\ No newline at end of file
index 19a0746..b2494b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x573a=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto'];(function(_0x3c6675,_0x2d8ce3){var _0x2bb20d=function(_0x21574a){while(--_0x21574a){_0x3c6675['push'](_0x3c6675['shift']());}};_0x2bb20d(++_0x2d8ce3);}(_0x573a,0x124));var _0xa573=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x573a[_0x2405bc];return _0x5272d4;};'use strict';var emlformat=require(_0xa573('0x0'));var rimraf=require(_0xa573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa573('0x2'));var rp=require(_0xa573('0x3'));var moment=require(_0xa573('0x4'));var BPromise=require(_0xa573('0x5'));var Mustache=require(_0xa573('0x6'));var util=require('util');var path=require(_0xa573('0x7'));var sox=require('sox');var csv=require(_0xa573('0x8'));var ejs=require(_0xa573('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa573('0xa'));var crypto=require(_0xa573('0xb'));var jsforce=require(_0xa573('0xc'));var deskjs=require(_0xa573('0xd'));var toCsv=require(_0xa573('0x8'));var querystring=require(_0xa573('0xe'));var Papa=require(_0xa573('0xf'));var Redis=require(_0xa573('0x10'));var authService=require(_0xa573('0x11'));var qs=require(_0xa573('0x12'));var as=require(_0xa573('0x13'));var hardwareService=require(_0xa573('0x14'));var logger=require(_0xa573('0x15'))('api');var utils=require(_0xa573('0x16'));var config=require(_0xa573('0x17'));var licenseUtil=require(_0xa573('0x18'));var db=require(_0xa573('0x19'))['db'];function respondWithStatusCode(_0x38a8ba,_0x3423ed){_0x3423ed=_0x3423ed||0xcc;return function(_0x2dda47){if(_0x2dda47){return _0x38a8ba[_0xa573('0x1a')](_0x3423ed);}return _0x38a8ba[_0xa573('0x1b')](_0x3423ed)[_0xa573('0x1c')]();};}function respondWithResult(_0x5d14d6,_0x1b5253){_0x1b5253=_0x1b5253||0xc8;return function(_0x1ccd64){if(_0x1ccd64){return _0x5d14d6[_0xa573('0x1b')](_0x1b5253)[_0xa573('0x1d')](_0x1ccd64);}};}function respondWithFilteredResult(_0x32c68c,_0x332d8b){return function(_0x19fc97){if(_0x19fc97){var _0x23da4b=typeof _0x332d8b[_0xa573('0x1e')]===_0xa573('0x1f')&&typeof _0x332d8b[_0xa573('0x20')]===_0xa573('0x1f');var _0xe40bdd=_0x19fc97[_0xa573('0x21')];var _0x305c47=_0x23da4b?0x0:_0x332d8b[_0xa573('0x1e')];var _0x470591=_0x23da4b?_0x19fc97[_0xa573('0x21')]:_0x332d8b[_0xa573('0x1e')]+_0x332d8b[_0xa573('0x20')];var _0x2163be;if(_0x470591>=_0xe40bdd){_0x470591=_0xe40bdd;_0x2163be=0xc8;}else{_0x2163be=0xce;}_0x32c68c[_0xa573('0x1b')](_0x2163be);return _0x32c68c[_0xa573('0x22')](_0xa573('0x23'),_0x305c47+'-'+_0x470591+'/'+_0xe40bdd)[_0xa573('0x1d')](_0x19fc97);}return null;};}function patchUpdates(_0x2f4944){return function(_0x5bdb30){try{jsonpatch['apply'](_0x5bdb30,_0x2f4944,!![]);}catch(_0x535e33){return BPromise[_0xa573('0x24')](_0x535e33);}return _0x5bdb30[_0xa573('0x25')]();};}function saveUpdates(_0x453592,_0x2b9149){return function(_0x333fd8){if(_0x333fd8){return _0x333fd8[_0xa573('0x26')](_0x453592)['then'](function(_0x568baa){return _0x568baa;});}return null;};}function removeEntity(_0x305075,_0x4e5840){return function(_0x424270){if(_0x424270){return _0x424270[_0xa573('0x27')]()[_0xa573('0x28')](function(){_0x305075[_0xa573('0x1b')](0xcc)[_0xa573('0x1c')]();});}};}function handleEntityNotFound(_0x533747,_0x4bf797){return function(_0x5842b3){if(!_0x5842b3){_0x533747[_0xa573('0x1a')](0x194);}return _0x5842b3;};}function handleError(_0x588b1f,_0x5c1404){_0x5c1404=_0x5c1404||0x1f4;return function(_0x12d0b1){logger[_0xa573('0x29')](_0x12d0b1[_0xa573('0x2a')]);if(_0x12d0b1[_0xa573('0x2b')]){delete _0x12d0b1['name'];}_0x588b1f['status'](_0x5c1404)[_0xa573('0x2c')](_0x12d0b1);};}exports['index']=function(_0x3f4631,_0x41f9ac){var _0x18148f={},_0x13596f={},_0x33ad90={'count':0x0,'rows':[]};var _0x47fcd6=_[_0xa573('0x2d')](db[_0xa573('0x2e')][_0xa573('0x2f')],function(_0x2aa460){return{'name':_0x2aa460[_0xa573('0x30')],'type':_0x2aa460[_0xa573('0x31')][_0xa573('0x32')]};});_0x13596f[_0xa573('0x33')]=_['map'](_0x47fcd6,_0xa573('0x2b'));_0x13596f['query']=_[_0xa573('0x34')](_0x3f4631[_0xa573('0x35')]);_0x13596f[_0xa573('0x36')]=_[_0xa573('0x37')](_0x13596f['model'],_0x13596f[_0xa573('0x35')]);_0x18148f['attributes']=_[_0xa573('0x37')](_0x13596f['model'],qs[_0xa573('0x38')](_0x3f4631[_0xa573('0x35')][_0xa573('0x38')]));_0x18148f[_0xa573('0x39')]=_0x18148f[_0xa573('0x39')][_0xa573('0x3a')]?_0x18148f[_0xa573('0x39')]:_0x13596f[_0xa573('0x33')];if(!_0x3f4631[_0xa573('0x35')][_0xa573('0x3b')]('nolimit')){_0x18148f[_0xa573('0x20')]=qs[_0xa573('0x20')](_0x3f4631[_0xa573('0x35')]['limit']);_0x18148f[_0xa573('0x1e')]=qs['offset'](_0x3f4631[_0xa573('0x35')]['offset']);}_0x18148f['order']=qs[_0xa573('0x3c')](_0x3f4631[_0xa573('0x35')][_0xa573('0x3c')]);_0x18148f[_0xa573('0x3d')]=qs[_0xa573('0x36')](_['pick'](_0x3f4631['query'],_0x13596f[_0xa573('0x36')]),_0x47fcd6);if(_0x3f4631[_0xa573('0x35')][_0xa573('0x3e')]){_0x18148f[_0xa573('0x3d')]=_['merge'](_0x18148f[_0xa573('0x3d')],{'$or':_['map'](_0x47fcd6,function(_0x4d42b6){if(_0x4d42b6['type']!==_0xa573('0x3f')){var _0x57965e={};_0x57965e[_0x4d42b6[_0xa573('0x2b')]]={'$like':'%'+_0x3f4631[_0xa573('0x35')][_0xa573('0x3e')]+'%'};return _0x57965e;}})});}_0x18148f=_[_0xa573('0x40')]({},_0x18148f,_0x3f4631[_0xa573('0x41')]);var _0x43c8ac={'where':_0x18148f[_0xa573('0x3d')]};return db[_0xa573('0x2e')][_0xa573('0x21')](_0x43c8ac)[_0xa573('0x28')](function(_0x27bece){_0x33ad90[_0xa573('0x21')]=_0x27bece;if(_0x3f4631['query'][_0xa573('0x42')]){_0x18148f[_0xa573('0x43')]=[{'all':!![]}];}return db[_0xa573('0x2e')][_0xa573('0x44')](_0x18148f);})[_0xa573('0x28')](function(_0x118efd){_0x33ad90[_0xa573('0x45')]=_0x118efd;return _0x33ad90;})[_0xa573('0x28')](respondWithFilteredResult(_0x41f9ac,_0x18148f))[_0xa573('0x46')](handleError(_0x41f9ac,null));};exports[_0xa573('0x47')]=function(_0x287204,_0x665dc2){var _0x39d2f8={'raw':!![],'where':{'id':_0x287204[_0xa573('0x48')]['id']}},_0x368490={};_0x368490['model']=_[_0xa573('0x34')](db['DeskField']['rawAttributes']);_0x368490[_0xa573('0x35')]=_['keys'](_0x287204[_0xa573('0x35')]);_0x368490[_0xa573('0x36')]=_[_0xa573('0x37')](_0x368490[_0xa573('0x33')],_0x368490[_0xa573('0x35')]);_0x39d2f8[_0xa573('0x39')]=_[_0xa573('0x37')](_0x368490['model'],qs[_0xa573('0x38')](_0x287204[_0xa573('0x35')]['fields']));_0x39d2f8[_0xa573('0x39')]=_0x39d2f8[_0xa573('0x39')][_0xa573('0x3a')]?_0x39d2f8[_0xa573('0x39')]:_0x368490[_0xa573('0x33')];if(_0x287204[_0xa573('0x35')]['includeAll']){_0x39d2f8[_0xa573('0x43')]=[{'all':!![]}];}_0x39d2f8=_[_0xa573('0x40')]({},_0x39d2f8,_0x287204[_0xa573('0x41')]);return db[_0xa573('0x2e')]['find'](_0x39d2f8)[_0xa573('0x28')](handleEntityNotFound(_0x665dc2,null))[_0xa573('0x28')](respondWithResult(_0x665dc2,null))[_0xa573('0x46')](handleError(_0x665dc2,null));};exports[_0xa573('0x49')]=function(_0x2e3e08,_0x315e3d){return db['DeskField']['create'](_0x2e3e08[_0xa573('0x4a')],{})[_0xa573('0x28')](respondWithResult(_0x315e3d,0xc9))[_0xa573('0x46')](handleError(_0x315e3d,null));};exports[_0xa573('0x26')]=function(_0x9fea38,_0x53f64d){if(_0x9fea38[_0xa573('0x4a')]['id']){delete _0x9fea38[_0xa573('0x4a')]['id'];}return db['DeskField'][_0xa573('0x4b')]({'where':{'id':_0x9fea38[_0xa573('0x48')]['id']}})[_0xa573('0x28')](handleEntityNotFound(_0x53f64d,null))[_0xa573('0x28')](saveUpdates(_0x9fea38[_0xa573('0x4a')],null))[_0xa573('0x28')](respondWithResult(_0x53f64d,null))[_0xa573('0x46')](handleError(_0x53f64d,null));};exports[_0xa573('0x27')]=function(_0x5917cc,_0x5216ef){return db[_0xa573('0x2e')][_0xa573('0x4b')]({'where':{'id':_0x5917cc['params']['id']}})[_0xa573('0x28')](handleEntityNotFound(_0x5216ef,null))[_0xa573('0x28')](removeEntity(_0x5216ef,null))[_0xa573('0x46')](handleError(_0x5216ef,null));};
\ No newline at end of file
+var _0x22e3=['map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','DeskField','rows','catch','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x324af1,_0x45050d){var _0xf51d=function(_0xcb6d7){while(--_0xcb6d7){_0x324af1['push'](_0x324af1['shift']());}};_0xf51d(++_0x45050d);}(_0x22e3,0xf3));var _0x322e=function(_0x19291b,_0x7d006f){_0x19291b=_0x19291b-0x0;var _0x27010b=_0x22e3[_0x19291b];return _0x27010b;};'use strict';var emlformat=require(_0x322e('0x0'));var rimraf=require(_0x322e('0x1'));var zipdir=require(_0x322e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x322e('0x3'));var moment=require(_0x322e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x322e('0x5'));var util=require(_0x322e('0x6'));var path=require(_0x322e('0x7'));var sox=require(_0x322e('0x8'));var csv=require(_0x322e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x322e('0xa'));var _=require(_0x322e('0xb'));var squel=require(_0x322e('0xc'));var crypto=require(_0x322e('0xd'));var jsforce=require(_0x322e('0xe'));var deskjs=require(_0x322e('0xf'));var toCsv=require(_0x322e('0x9'));var querystring=require(_0x322e('0x10'));var Papa=require(_0x322e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x322e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x322e('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x322e('0x14'));var licenseUtil=require(_0x322e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f4694,_0x43937a){_0x43937a=_0x43937a||0xcc;return function(_0xe93e0d){if(_0xe93e0d){return _0x3f4694['sendStatus'](_0x43937a);}return _0x3f4694[_0x322e('0x16')](_0x43937a)[_0x322e('0x17')]();};}function respondWithResult(_0x1276b2,_0xe9ec66){_0xe9ec66=_0xe9ec66||0xc8;return function(_0x48b169){if(_0x48b169){return _0x1276b2['status'](_0xe9ec66)[_0x322e('0x18')](_0x48b169);}};}function respondWithFilteredResult(_0x3ba8ed,_0x4ebfcb){return function(_0x17a969){if(_0x17a969){var _0x3a27ec=typeof _0x4ebfcb[_0x322e('0x19')]===_0x322e('0x1a')&&typeof _0x4ebfcb[_0x322e('0x1b')]==='undefined';var _0x2d0bea=_0x17a969[_0x322e('0x1c')];var _0x340f78=_0x3a27ec?0x0:_0x4ebfcb[_0x322e('0x19')];var _0x5042c6=_0x3a27ec?_0x17a969[_0x322e('0x1c')]:_0x4ebfcb[_0x322e('0x19')]+_0x4ebfcb[_0x322e('0x1b')];var _0x1050ba;if(_0x5042c6>=_0x2d0bea){_0x5042c6=_0x2d0bea;_0x1050ba=0xc8;}else{_0x1050ba=0xce;}_0x3ba8ed[_0x322e('0x16')](_0x1050ba);return _0x3ba8ed[_0x322e('0x1d')](_0x322e('0x1e'),_0x340f78+'-'+_0x5042c6+'/'+_0x2d0bea)[_0x322e('0x18')](_0x17a969);}return null;};}function patchUpdates(_0x5462b8){return function(_0x1b1bc0){try{jsonpatch[_0x322e('0x1f')](_0x1b1bc0,_0x5462b8,!![]);}catch(_0x12b652){return BPromise[_0x322e('0x20')](_0x12b652);}return _0x1b1bc0[_0x322e('0x21')]();};}function saveUpdates(_0x8a7a7f,_0x2ff06d){return function(_0x27a0f2){if(_0x27a0f2){return _0x27a0f2[_0x322e('0x22')](_0x8a7a7f)['then'](function(_0x21cb8d){return _0x21cb8d;});}return null;};}function removeEntity(_0xc6a1d4,_0x2d1678){return function(_0x2d2b66){if(_0x2d2b66){return _0x2d2b66['destroy']()[_0x322e('0x23')](function(){_0xc6a1d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db967,_0x37ad2f){return function(_0x3efe3b){if(!_0x3efe3b){_0x4db967['sendStatus'](0x194);}return _0x3efe3b;};}function handleError(_0x326e01,_0x3797e9){_0x3797e9=_0x3797e9||0x1f4;return function(_0x5e1590){logger[_0x322e('0x24')](_0x5e1590[_0x322e('0x25')]);if(_0x5e1590[_0x322e('0x26')]){delete _0x5e1590[_0x322e('0x26')];}_0x326e01[_0x322e('0x16')](_0x3797e9)[_0x322e('0x27')](_0x5e1590);};}exports[_0x322e('0x28')]=function(_0x1a7dc8,_0x4da8e0){var _0x31b35f={},_0x5d2e82={},_0x1189d5={'count':0x0,'rows':[]};var _0x3cd5ba=_[_0x322e('0x29')](db['DeskField'][_0x322e('0x2a')],function(_0x1a0f88){return{'name':_0x1a0f88[_0x322e('0x2b')],'type':_0x1a0f88['type'][_0x322e('0x2c')]};});_0x5d2e82[_0x322e('0x2d')]=_['map'](_0x3cd5ba,_0x322e('0x26'));_0x5d2e82['query']=_['keys'](_0x1a7dc8[_0x322e('0x2e')]);_0x5d2e82[_0x322e('0x2f')]=_[_0x322e('0x30')](_0x5d2e82[_0x322e('0x2d')],_0x5d2e82[_0x322e('0x2e')]);_0x31b35f['attributes']=_[_0x322e('0x30')](_0x5d2e82[_0x322e('0x2d')],qs['fields'](_0x1a7dc8[_0x322e('0x2e')][_0x322e('0x31')]));_0x31b35f[_0x322e('0x32')]=_0x31b35f['attributes'][_0x322e('0x33')]?_0x31b35f['attributes']:_0x5d2e82[_0x322e('0x2d')];if(!_0x1a7dc8['query'][_0x322e('0x34')](_0x322e('0x35'))){_0x31b35f['limit']=qs[_0x322e('0x1b')](_0x1a7dc8[_0x322e('0x2e')][_0x322e('0x1b')]);_0x31b35f[_0x322e('0x19')]=qs['offset'](_0x1a7dc8[_0x322e('0x2e')]['offset']);}_0x31b35f['order']=qs[_0x322e('0x36')](_0x1a7dc8[_0x322e('0x2e')][_0x322e('0x36')]);_0x31b35f[_0x322e('0x37')]=qs[_0x322e('0x2f')](_[_0x322e('0x38')](_0x1a7dc8[_0x322e('0x2e')],_0x5d2e82['filters']),_0x3cd5ba);if(_0x1a7dc8[_0x322e('0x2e')][_0x322e('0x39')]){_0x31b35f[_0x322e('0x37')]=_[_0x322e('0x3a')](_0x31b35f['where'],{'$or':_[_0x322e('0x29')](_0x3cd5ba,function(_0x42f8e2){if(_0x42f8e2['type']!=='VIRTUAL'){var _0x1a8774={};_0x1a8774[_0x42f8e2[_0x322e('0x26')]]={'$like':'%'+_0x1a7dc8['query']['filter']+'%'};return _0x1a8774;}})});}_0x31b35f=_['merge']({},_0x31b35f,_0x1a7dc8[_0x322e('0x3b')]);var _0x1e8007={'where':_0x31b35f[_0x322e('0x37')]};return db['DeskField'][_0x322e('0x1c')](_0x1e8007)[_0x322e('0x23')](function(_0x3c2b80){_0x1189d5[_0x322e('0x1c')]=_0x3c2b80;if(_0x1a7dc8['query'][_0x322e('0x3c')]){_0x31b35f[_0x322e('0x3d')]=[{'all':!![]}];}return db[_0x322e('0x3e')]['findAll'](_0x31b35f);})[_0x322e('0x23')](function(_0x4e263c){_0x1189d5[_0x322e('0x3f')]=_0x4e263c;return _0x1189d5;})[_0x322e('0x23')](respondWithFilteredResult(_0x4da8e0,_0x31b35f))[_0x322e('0x40')](handleError(_0x4da8e0,null));};exports['show']=function(_0x204bb6,_0x2ab2e1){var _0x3856ce={'raw':!![],'where':{'id':_0x204bb6[_0x322e('0x41')]['id']}},_0xcb8f53={};_0xcb8f53[_0x322e('0x2d')]=_[_0x322e('0x42')](db['DeskField']['rawAttributes']);_0xcb8f53['query']=_[_0x322e('0x42')](_0x204bb6[_0x322e('0x2e')]);_0xcb8f53[_0x322e('0x2f')]=_[_0x322e('0x30')](_0xcb8f53[_0x322e('0x2d')],_0xcb8f53[_0x322e('0x2e')]);_0x3856ce['attributes']=_[_0x322e('0x30')](_0xcb8f53[_0x322e('0x2d')],qs['fields'](_0x204bb6[_0x322e('0x2e')][_0x322e('0x31')]));_0x3856ce[_0x322e('0x32')]=_0x3856ce[_0x322e('0x32')]['length']?_0x3856ce[_0x322e('0x32')]:_0xcb8f53[_0x322e('0x2d')];if(_0x204bb6[_0x322e('0x2e')][_0x322e('0x3c')]){_0x3856ce[_0x322e('0x3d')]=[{'all':!![]}];}_0x3856ce=_[_0x322e('0x3a')]({},_0x3856ce,_0x204bb6[_0x322e('0x3b')]);return db[_0x322e('0x3e')][_0x322e('0x43')](_0x3856ce)[_0x322e('0x23')](handleEntityNotFound(_0x2ab2e1,null))[_0x322e('0x23')](respondWithResult(_0x2ab2e1,null))[_0x322e('0x40')](handleError(_0x2ab2e1,null));};exports['create']=function(_0x51ea74,_0x1f52d4){return db['DeskField'][_0x322e('0x44')](_0x51ea74[_0x322e('0x45')],{})['then'](respondWithResult(_0x1f52d4,0xc9))[_0x322e('0x40')](handleError(_0x1f52d4,null));};exports[_0x322e('0x22')]=function(_0xc4c4b2,_0x4ace6c){if(_0xc4c4b2[_0x322e('0x45')]['id']){delete _0xc4c4b2[_0x322e('0x45')]['id'];}return db['DeskField'][_0x322e('0x43')]({'where':{'id':_0xc4c4b2[_0x322e('0x41')]['id']}})[_0x322e('0x23')](handleEntityNotFound(_0x4ace6c,null))[_0x322e('0x23')](saveUpdates(_0xc4c4b2[_0x322e('0x45')],null))[_0x322e('0x23')](respondWithResult(_0x4ace6c,null))[_0x322e('0x40')](handleError(_0x4ace6c,null));};exports[_0x322e('0x46')]=function(_0x1b3044,_0x15a3aa){return db[_0x322e('0x3e')][_0x322e('0x43')]({'where':{'id':_0x1b3044[_0x322e('0x41')]['id']}})[_0x322e('0x23')](handleEntityNotFound(_0x15a3aa,null))[_0x322e('0x23')](removeEntity(_0x15a3aa,null))['catch'](handleError(_0x15a3aa,null));};
\ No newline at end of file
index 774ffa5..f6254d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc952=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','idField','FieldId'];(function(_0x193109,_0x50a9ca){var _0x4af109=function(_0x21c390){while(--_0x21c390){_0x193109['push'](_0x193109['shift']());}};_0x4af109(++_0x50a9ca);}(_0xc952,0x1a2));var _0x2c95=function(_0x3cb370,_0x381159){_0x3cb370=_0x3cb370-0x0;var _0x1721e7=_0xc952[_0x3cb370];return _0x1721e7;};'use strict';var _=require(_0x2c95('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2c95('0x1'));var moment=require(_0x2c95('0x2'));var BPromise=require(_0x2c95('0x3'));var rp=require(_0x2c95('0x4'));var fs=require('fs');var path=require(_0x2c95('0x5'));var rimraf=require(_0x2c95('0x6'));var config=require(_0x2c95('0x7'));var attributes=require(_0x2c95('0x8'));module['exports']=function(_0x3e57e2,_0x5c6921){return _0x3e57e2['define']('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x2c95('0x9'),_0x2c95('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ee6=['util','moment','bluebird','request-promise','path','rimraf','exports','DeskField','desk_unique_index','FieldId','lodash'];(function(_0x2910a8,_0x15f8c8){var _0x452925=function(_0x2f0219){while(--_0x2f0219){_0x2910a8['push'](_0x2910a8['shift']());}};_0x452925(++_0x15f8c8);}(_0x5ee6,0xa4));var _0x65ee=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5ee6[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x65ee('0x0'));var util=require(_0x65ee('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65ee('0x2'));var BPromise=require(_0x65ee('0x3'));var rp=require(_0x65ee('0x4'));var fs=require('fs');var path=require(_0x65ee('0x5'));var rimraf=require(_0x65ee('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x65ee('0x7')]=function(_0x971d42,_0x7b52df){return _0x971d42['define'](_0x65ee('0x8'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x65ee('0x9'),'fields':['idField',_0x65ee('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e959b19..1762fd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85cc=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird'];(function(_0xb90fb5,_0x11e894){var _0x52875c=function(_0x5c5dec){while(--_0x5c5dec){_0xb90fb5['push'](_0xb90fb5['shift']());}};_0x52875c(++_0x11e894);}(_0x85cc,0x1a1));var _0xc85c=function(_0x6c66a4,_0x2473fe){_0x6c66a4=_0x6c66a4-0x0;var _0x247d8d=_0x85cc[_0x6c66a4];return _0x247d8d;};'use strict';var _=require(_0xc85c('0x0'));var util=require('util');var moment=require(_0xc85c('0x1'));var BPromise=require(_0xc85c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc85c('0x3'));var db=require(_0xc85c('0x4'))['db'];var utils=require(_0xc85c('0x5'));var logger=require('../../config/logger')(_0xc85c('0x6'));var config=require('../../config/environment');var jayson=require(_0xc85c('0x7'));var client=jayson[_0xc85c('0x8')][_0xc85c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x313d37,_0x11ebfb,_0xa9e7ac){return new BPromise(function(_0x5786b3,_0x26ab16){return client['request'](_0x313d37,_0xa9e7ac)[_0xc85c('0xa')](function(_0x26839d){logger['info'](_0xc85c('0xb'),_0x11ebfb,_0xc85c('0xc'));logger[_0xc85c('0xd')](_0xc85c('0xe'),_0x11ebfb,_0xc85c('0xc'),JSON['stringify'](_0x26839d));if(_0x26839d[_0xc85c('0xf')]){if(_0x26839d[_0xc85c('0xf')][_0xc85c('0x10')]===0x1f4){logger['error'](_0xc85c('0xb'),_0x11ebfb,_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);return _0x26ab16(_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);}logger['error'](_0xc85c('0xb'),_0x11ebfb,_0x26839d[_0xc85c('0xf')][_0xc85c('0x11')]);return _0x5786b3(_0x26839d['error']['message']);}else{logger[_0xc85c('0x12')]('DeskField,\x20%s,\x20%s',_0x11ebfb,_0xc85c('0xc'));_0x5786b3(_0x26839d[_0xc85c('0x13')][_0xc85c('0x11')]);}})[_0xc85c('0x14')](function(_0xdcf8f1){logger['error']('DeskField,\x20%s,\x20%s',_0x11ebfb,_0xdcf8f1);_0x26ab16(_0xdcf8f1);});});}
\ No newline at end of file
+var _0xa702=['client','http','request','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa702,0xb7));var _0x2a70=function(_0x297f50,_0x10470b){_0x297f50=_0x297f50-0x0;var _0x3d2e1d=_0xa702[_0x297f50];return _0x3d2e1d;};'use strict';var _=require('lodash');var util=require(_0x2a70('0x0'));var moment=require(_0x2a70('0x1'));var BPromise=require(_0x2a70('0x2'));var rs=require(_0x2a70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a70('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2a70('0x5'));var jayson=require(_0x2a70('0x6'));var client=jayson[_0x2a70('0x7')][_0x2a70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x492524,_0x1612ff,_0x4dee25){return new BPromise(function(_0x55777f,_0x478cee){return client[_0x2a70('0x9')](_0x492524,_0x4dee25)['then'](function(_0x7934cc){logger['info'](_0x2a70('0xa'),_0x1612ff,_0x2a70('0xb'));logger['debug'](_0x2a70('0xc'),_0x1612ff,_0x2a70('0xb'),JSON[_0x2a70('0xd')](_0x7934cc));if(_0x7934cc[_0x2a70('0xe')]){if(_0x7934cc[_0x2a70('0xe')][_0x2a70('0xf')]===0x1f4){logger[_0x2a70('0xe')](_0x2a70('0xa'),_0x1612ff,_0x7934cc[_0x2a70('0xe')]['message']);return _0x478cee(_0x7934cc[_0x2a70('0xe')][_0x2a70('0x10')]);}logger['error'](_0x2a70('0xa'),_0x1612ff,_0x7934cc[_0x2a70('0xe')][_0x2a70('0x10')]);return _0x55777f(_0x7934cc[_0x2a70('0xe')][_0x2a70('0x10')]);}else{logger[_0x2a70('0x11')](_0x2a70('0xa'),_0x1612ff,_0x2a70('0xb'));_0x55777f(_0x7934cc[_0x2a70('0x12')][_0x2a70('0x10')]);}})['catch'](function(_0x23309a){logger[_0x2a70('0xe')](_0x2a70('0xa'),_0x1612ff,_0x23309a);_0x478cee(_0x23309a);});});}
\ No newline at end of file
index 2332954..ccb134c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd317=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','addConfiguration','update','destroy','util','path','connect-timeout'];(function(_0x49682d,_0x3d3d62){var _0xdbd8ec=function(_0x412ccd){while(--_0x412ccd){_0x49682d['push'](_0x49682d['shift']());}};_0xdbd8ec(++_0x3d3d62);}(_0xd317,0x75));var _0x7d31=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xd317[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x7d31('0x0'));var path=require(_0x7d31('0x1'));var timeout=require(_0x7d31('0x2'));var express=require(_0x7d31('0x3'));var router=express[_0x7d31('0x4')]();var fs_extra=require(_0x7d31('0x5'));var auth=require(_0x7d31('0x6'));var interaction=require(_0x7d31('0x7'));var config=require(_0x7d31('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x7d31('0x9')]('/',auth[_0x7d31('0xa')](),controller[_0x7d31('0xb')]);router[_0x7d31('0x9')](_0x7d31('0xc'),auth[_0x7d31('0xa')](),controller[_0x7d31('0xd')]);router['get'](_0x7d31('0xe'),auth[_0x7d31('0xa')](),controller['getConfigurations']);router[_0x7d31('0x9')](_0x7d31('0xf'),auth[_0x7d31('0xa')](),controller['getFields']);router[_0x7d31('0x10')]('/',auth[_0x7d31('0xa')](),controller['create']);router[_0x7d31('0x10')](_0x7d31('0xe'),auth[_0x7d31('0xa')](),controller[_0x7d31('0x11')]);router['put'](_0x7d31('0xc'),auth[_0x7d31('0xa')](),controller[_0x7d31('0x12')]);router['delete']('/:id',auth[_0x7d31('0xa')](),controller[_0x7d31('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2bcb=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util'];(function(_0x38a4b0,_0x327540){var _0x37fd9d=function(_0x5b1c55){while(--_0x5b1c55){_0x38a4b0['push'](_0x38a4b0['shift']());}};_0x37fd9d(++_0x327540);}(_0x2bcb,0x1c6));var _0xb2bc=function(_0x288e3c,_0x205f28){_0x288e3c=_0x288e3c-0x0;var _0x3dcd18=_0x2bcb[_0x288e3c];return _0x3dcd18;};'use strict';var multer=require(_0xb2bc('0x0'));var util=require(_0xb2bc('0x1'));var path=require('path');var timeout=require(_0xb2bc('0x2'));var express=require(_0xb2bc('0x3'));var router=express['Router']();var fs_extra=require(_0xb2bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb2bc('0x5'));var config=require(_0xb2bc('0x6'));var controller=require(_0xb2bc('0x7'));router[_0xb2bc('0x8')]('/',auth['isAuthenticated'](),controller[_0xb2bc('0x9')]);router[_0xb2bc('0x8')]('/:id',auth[_0xb2bc('0xa')](),controller[_0xb2bc('0xb')]);router[_0xb2bc('0x8')](_0xb2bc('0xc'),auth[_0xb2bc('0xa')](),controller[_0xb2bc('0xd')]);router[_0xb2bc('0x8')](_0xb2bc('0xe'),auth[_0xb2bc('0xa')](),controller[_0xb2bc('0xf')]);router[_0xb2bc('0x10')]('/',auth[_0xb2bc('0xa')](),controller[_0xb2bc('0x11')]);router[_0xb2bc('0x10')](_0xb2bc('0xc'),auth[_0xb2bc('0xa')](),controller[_0xb2bc('0x12')]);router[_0xb2bc('0x13')](_0xb2bc('0x14'),auth[_0xb2bc('0xa')](),controller[_0xb2bc('0x15')]);router['delete'](_0xb2bc('0x14'),auth['isAuthenticated'](),controller[_0xb2bc('0x16')]);module[_0xb2bc('0x17')]=router;
\ No newline at end of file
index 298a4e9..a457025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3468=['sequelize','exports','STRING'];(function(_0x2c9112,_0x298c93){var _0x190813=function(_0x54649a){while(--_0x54649a){_0x2c9112['push'](_0x2c9112['shift']());}};_0x190813(++_0x298c93);}(_0x3468,0x14d));var _0x8346=function(_0x54d9d6,_0x165635){_0x54d9d6=_0x54d9d6-0x0;var _0x1b2b84=_0x3468[_0x54d9d6];return _0x1b2b84;};'use strict';var Sequelize=require(_0x8346('0x0'));module[_0x8346('0x1')]={'name':{'type':Sequelize[_0x8346('0x2')]},'username':{'type':Sequelize[_0x8346('0x2')]},'password':{'type':Sequelize[_0x8346('0x2')]},'remoteUri':{'type':Sequelize[_0x8346('0x2')]},'tenantId':{'type':Sequelize[_0x8346('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x8346('0x2')]},'serverUrl':{'type':Sequelize[_0x8346('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8346('0x2')]}};
\ No newline at end of file
+var _0x37b2=['sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x37b2,0x14d));var _0x237b=function(_0x56e4b7,_0x4c0b79){_0x56e4b7=_0x56e4b7-0x0;var _0x463c26=_0x37b2[_0x56e4b7];return _0x463c26;};'use strict';var Sequelize=require(_0x237b('0x0'));module[_0x237b('0x1')]={'name':{'type':Sequelize[_0x237b('0x2')]},'username':{'type':Sequelize[_0x237b('0x2')]},'password':{'type':Sequelize[_0x237b('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x237b('0x2')]},'serverUrl':{'type':Sequelize[_0x237b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x237b('0x2')]}};
\ No newline at end of file
index e41e34d..9b22160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f42=['kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','primarycontactidname','prioritycodename','productidname','productserialnumber','responseby','responsiblecontactidname','responsiblecontactidyominame','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','username','password','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','/oauth2/token','clientId','access_token','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','push','all','isNil','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','stack','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','model','map','intersection','query','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','findOne','Dynamics365Configuration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Field','Descriptions','ticketType','incident','Incident','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','influencescore'];(function(_0x1a007a,_0x5f3509){var _0x1b3ea8=function(_0x26e958){while(--_0x26e958){_0x1a007a['push'](_0x1a007a['shift']());}};_0x1b3ea8(++_0x5f3509);}(_0x7f42,0x1dd));var _0x27f4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f42[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x27f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x27f4('0x1'));var jsonpatch=require(_0x27f4('0x2'));var rp=require('request-promise');var moment=require(_0x27f4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27f4('0x4'));var util=require('util');var path=require(_0x27f4('0x5'));var sox=require('sox');var csv=require(_0x27f4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27f4('0x7'));var _=require(_0x27f4('0x8'));var squel=require(_0x27f4('0x9'));var crypto=require(_0x27f4('0xa'));var jsforce=require(_0x27f4('0xb'));var deskjs=require(_0x27f4('0xc'));var toCsv=require(_0x27f4('0x6'));var querystring=require(_0x27f4('0xd'));var Papa=require(_0x27f4('0xe'));var Redis=require(_0x27f4('0xf'));var authService=require(_0x27f4('0x10'));var qs=require(_0x27f4('0x11'));var as=require(_0x27f4('0x12'));var hardwareService=require(_0x27f4('0x13'));var logger=require(_0x27f4('0x14'))(_0x27f4('0x15'));var utils=require(_0x27f4('0x16'));var config=require(_0x27f4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x27f4('0x18'));function respondWithStatusCode(_0x1347ea,_0x27cdaa){_0x27cdaa=_0x27cdaa||0xcc;return function(_0x1fed6b){if(_0x1fed6b){return _0x1347ea[_0x27f4('0x19')](_0x27cdaa);}return _0x1347ea[_0x27f4('0x1a')](_0x27cdaa)[_0x27f4('0x1b')]();};}function respondWithResult(_0x40393e,_0x5cd1bd){_0x5cd1bd=_0x5cd1bd||0xc8;return function(_0x4a8ff6){if(_0x4a8ff6){return _0x40393e[_0x27f4('0x1a')](_0x5cd1bd)[_0x27f4('0x1c')](_0x4a8ff6);}};}function respondWithFilteredResult(_0x10f24a,_0x2e8264){return function(_0x4e0e5b){if(_0x4e0e5b){var _0x185ed6=typeof _0x2e8264[_0x27f4('0x1d')]===_0x27f4('0x1e')&&typeof _0x2e8264['limit']===_0x27f4('0x1e');var _0x11b6f7=_0x4e0e5b[_0x27f4('0x1f')];var _0x49e6c0=_0x185ed6?0x0:_0x2e8264[_0x27f4('0x1d')];var _0xe4a7b6=_0x185ed6?_0x4e0e5b['count']:_0x2e8264['offset']+_0x2e8264[_0x27f4('0x20')];var _0x2957a1;if(_0xe4a7b6>=_0x11b6f7){_0xe4a7b6=_0x11b6f7;_0x2957a1=0xc8;}else{_0x2957a1=0xce;}_0x10f24a[_0x27f4('0x1a')](_0x2957a1);return _0x10f24a[_0x27f4('0x21')](_0x27f4('0x22'),_0x49e6c0+'-'+_0xe4a7b6+'/'+_0x11b6f7)[_0x27f4('0x1c')](_0x4e0e5b);}return null;};}function patchUpdates(_0x28e88c){return function(_0x16dd8a){try{jsonpatch[_0x27f4('0x23')](_0x16dd8a,_0x28e88c,!![]);}catch(_0x3ceba6){return BPromise[_0x27f4('0x24')](_0x3ceba6);}return _0x16dd8a[_0x27f4('0x25')]();};}function saveUpdates(_0x22f794,_0x4035f4){return function(_0x2fbe70){if(_0x2fbe70){return _0x2fbe70['update'](_0x22f794)[_0x27f4('0x26')](function(_0x112803){return _0x112803;});}return null;};}function removeEntity(_0x202e8f,_0x3e1dca){return function(_0x45fefa){if(_0x45fefa){return _0x45fefa[_0x27f4('0x27')]()[_0x27f4('0x26')](function(){_0x202e8f[_0x27f4('0x1a')](0xcc)[_0x27f4('0x1b')]();});}};}function handleEntityNotFound(_0x34c943,_0x2fe71b){return function(_0x1e24c3){if(!_0x1e24c3){_0x34c943[_0x27f4('0x19')](0x194);}return _0x1e24c3;};}function handleError(_0x400d8d,_0x2b9e38){_0x2b9e38=_0x2b9e38||0x1f4;return function(_0x19068a){logger[_0x27f4('0x28')](_0x19068a['stack']);if(_0x19068a[_0x27f4('0x29')]){delete _0x19068a['name'];}_0x400d8d[_0x27f4('0x1a')](_0x2b9e38)[_0x27f4('0x2a')](_0x19068a);};}exports[_0x27f4('0x2b')]=function(_0x48beb5,_0x38eb1c){var _0x351dba={},_0x4874f2={},_0x350767={'count':0x0,'rows':[]};var _0x26a2c2=_['map'](db[_0x27f4('0x2c')][_0x27f4('0x2d')],function(_0x5a241e){return{'name':_0x5a241e[_0x27f4('0x2e')],'type':_0x5a241e[_0x27f4('0x2f')]['key']};});_0x4874f2[_0x27f4('0x30')]=_[_0x27f4('0x31')](_0x26a2c2,_0x27f4('0x29'));_0x4874f2['query']=_['keys'](_0x48beb5['query']);_0x4874f2['filters']=_[_0x27f4('0x32')](_0x4874f2[_0x27f4('0x30')],_0x4874f2[_0x27f4('0x33')]);_0x351dba[_0x27f4('0x34')]=_[_0x27f4('0x32')](_0x4874f2[_0x27f4('0x30')],qs[_0x27f4('0x35')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x35')]));_0x351dba[_0x27f4('0x34')]=_0x351dba[_0x27f4('0x34')]['length']?_0x351dba[_0x27f4('0x34')]:_0x4874f2[_0x27f4('0x30')];if(!_0x48beb5[_0x27f4('0x33')]['hasOwnProperty'](_0x27f4('0x36'))){_0x351dba[_0x27f4('0x20')]=qs[_0x27f4('0x20')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x20')]);_0x351dba[_0x27f4('0x1d')]=qs[_0x27f4('0x1d')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x1d')]);}_0x351dba[_0x27f4('0x37')]=qs[_0x27f4('0x38')](_0x48beb5[_0x27f4('0x33')][_0x27f4('0x38')]);_0x351dba[_0x27f4('0x39')]=qs[_0x27f4('0x3a')](_[_0x27f4('0x3b')](_0x48beb5['query'],_0x4874f2['filters']),_0x26a2c2);if(_0x48beb5[_0x27f4('0x33')][_0x27f4('0x3c')]){_0x351dba[_0x27f4('0x39')]=_['merge'](_0x351dba[_0x27f4('0x39')],{'$or':_[_0x27f4('0x31')](_0x26a2c2,function(_0x210126){if(_0x210126['type']!==_0x27f4('0x3d')){var _0x187ab8={};_0x187ab8[_0x210126['name']]={'$like':'%'+_0x48beb5[_0x27f4('0x33')][_0x27f4('0x3c')]+'%'};return _0x187ab8;}})});}_0x351dba=_[_0x27f4('0x3e')]({},_0x351dba,_0x48beb5[_0x27f4('0x3f')]);var _0x1f1a9e={'where':_0x351dba['where']};return db[_0x27f4('0x2c')][_0x27f4('0x1f')](_0x1f1a9e)[_0x27f4('0x26')](function(_0x30b68a){_0x350767['count']=_0x30b68a;if(_0x48beb5[_0x27f4('0x33')][_0x27f4('0x40')]){_0x351dba[_0x27f4('0x41')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x27f4('0x42')](_0x351dba);})['then'](function(_0x32f87f){_0x350767[_0x27f4('0x43')]=_0x32f87f;return _0x350767;})[_0x27f4('0x26')](respondWithFilteredResult(_0x38eb1c,_0x351dba))[_0x27f4('0x44')](handleError(_0x38eb1c,null));};exports['show']=function(_0x290c58,_0x3f7051){var _0x28fc2d={'raw':![],'where':{'id':_0x290c58[_0x27f4('0x45')]['id']}},_0xbbcd3={};_0xbbcd3['model']=_[_0x27f4('0x46')](db['Dynamics365Account']['rawAttributes']);_0xbbcd3['query']=_[_0x27f4('0x46')](_0x290c58[_0x27f4('0x33')]);_0xbbcd3[_0x27f4('0x3a')]=_[_0x27f4('0x32')](_0xbbcd3['model'],_0xbbcd3[_0x27f4('0x33')]);_0x28fc2d[_0x27f4('0x34')]=_[_0x27f4('0x32')](_0xbbcd3[_0x27f4('0x30')],qs['fields'](_0x290c58['query'][_0x27f4('0x35')]));_0x28fc2d[_0x27f4('0x34')]=_0x28fc2d[_0x27f4('0x34')][_0x27f4('0x47')]?_0x28fc2d['attributes']:_0xbbcd3[_0x27f4('0x30')];if(_0x290c58['query']['includeAll']){_0x28fc2d['include']=[{'all':!![]}];}_0x28fc2d=_[_0x27f4('0x3e')]({},_0x28fc2d,_0x290c58['options']);return db[_0x27f4('0x2c')][_0x27f4('0x48')](_0x28fc2d)['then'](handleEntityNotFound(_0x3f7051,null))[_0x27f4('0x26')](respondWithResult(_0x3f7051,null))[_0x27f4('0x44')](handleError(_0x3f7051,null));};exports['create']=function(_0x1f424a,_0x9b2015){return db[_0x27f4('0x2c')][_0x27f4('0x49')](_0x1f424a[_0x27f4('0x4a')],{})[_0x27f4('0x26')](respondWithResult(_0x9b2015,0xc9))[_0x27f4('0x44')](handleError(_0x9b2015,null));};exports[_0x27f4('0x4b')]=function(_0x505d5a,_0xd94538){if(_0x505d5a['body']['id']){delete _0x505d5a[_0x27f4('0x4a')]['id'];}return db[_0x27f4('0x2c')][_0x27f4('0x48')]({'where':{'id':_0x505d5a['params']['id']}})['then'](handleEntityNotFound(_0xd94538,null))[_0x27f4('0x26')](saveUpdates(_0x505d5a[_0x27f4('0x4a')],null))['then'](respondWithResult(_0xd94538,null))[_0x27f4('0x44')](handleError(_0xd94538,null));};exports['destroy']=function(_0x4714df,_0x21bb87){return db[_0x27f4('0x2c')][_0x27f4('0x48')]({'where':{'id':_0x4714df[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x21bb87,null))[_0x27f4('0x26')](removeEntity(_0x21bb87,null))['catch'](handleError(_0x21bb87,null));};exports['getConfigurations']=function(_0x1d3284,_0x4d65fa,_0x2d54b0){var _0x1ddae2={};var _0x580903={};var _0x2b0719;var _0x102b48;return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x1d3284[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x4d65fa,null))[_0x27f4('0x26')](function(_0x31964f){if(_0x31964f){_0x2b0719=_0x31964f;_0x580903[_0x27f4('0x30')]=_[_0x27f4('0x46')](db[_0x27f4('0x4d')][_0x27f4('0x2d')]);_0x580903[_0x27f4('0x33')]=_[_0x27f4('0x46')](_0x1d3284[_0x27f4('0x33')]);_0x580903['filters']=_[_0x27f4('0x32')](_0x580903[_0x27f4('0x30')],_0x580903['query']);_0x1ddae2[_0x27f4('0x34')]=_['intersection'](_0x580903['model'],qs[_0x27f4('0x35')](_0x1d3284['query']['fields']));_0x1ddae2['attributes']=_0x1ddae2['attributes'][_0x27f4('0x47')]?_0x1ddae2['attributes']:_0x580903[_0x27f4('0x30')];_0x1ddae2['order']=qs[_0x27f4('0x38')](_0x1d3284[_0x27f4('0x33')][_0x27f4('0x38')]);_0x1ddae2[_0x27f4('0x39')]=qs['filters'](_[_0x27f4('0x3b')](_0x1d3284[_0x27f4('0x33')],_0x580903['filters']));if(_0x1d3284[_0x27f4('0x33')][_0x27f4('0x3c')]){_0x1ddae2['where']=_['merge'](_0x1ddae2[_0x27f4('0x39')],{'$or':_[_0x27f4('0x31')](_0x1ddae2['attributes'],function(_0x4784d1){var _0x5c4b99={};_0x5c4b99[_0x4784d1]={'$like':'%'+_0x1d3284[_0x27f4('0x33')][_0x27f4('0x3c')]+'%'};return _0x5c4b99;})});}_0x1ddae2=_[_0x27f4('0x3e')]({},_0x1ddae2,_0x1d3284[_0x27f4('0x3f')]);return _0x2b0719[_0x27f4('0x4e')](_0x1ddae2);}})['then'](function(_0x1deb54){if(_0x1deb54){_0x102b48=_0x1deb54['length'];if(!_0x1d3284[_0x27f4('0x33')][_0x27f4('0x4f')](_0x27f4('0x36'))){_0x1ddae2['limit']=qs[_0x27f4('0x20')](_0x1d3284[_0x27f4('0x33')]['limit']);_0x1ddae2[_0x27f4('0x1d')]=qs[_0x27f4('0x1d')](_0x1d3284[_0x27f4('0x33')][_0x27f4('0x1d')]);}return _0x2b0719[_0x27f4('0x4e')](_0x1ddae2);}})[_0x27f4('0x26')](function(_0xb1731e){if(_0xb1731e){return _0xb1731e?{'count':_0x102b48,'rows':_0xb1731e}:null;}})[_0x27f4('0x26')](respondWithResult(_0x4d65fa,null))[_0x27f4('0x44')](handleError(_0x4d65fa,null));};exports[_0x27f4('0x50')]=function(_0x155e80,_0x489d79,_0x110ce1){if(_0x155e80[_0x27f4('0x4a')]['id']){delete _0x155e80[_0x27f4('0x4a')]['id'];}return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x155e80[_0x27f4('0x45')]['id']}})[_0x27f4('0x26')](handleEntityNotFound(_0x489d79,null))['then'](function(_0x1728b7){if(_0x1728b7){_0x155e80['body'][_0x27f4('0x51')]=_0x1728b7['id'];_0x155e80[_0x27f4('0x4a')][_0x27f4('0x52')]=integrations['getSubjects'](_0x155e80[_0x27f4('0x4a')][_0x27f4('0x53')],_0x155e80[_0x27f4('0x4a')][_0x27f4('0x2f')]);_0x155e80[_0x27f4('0x4a')]['Descriptions']=integrations[_0x27f4('0x54')](_0x155e80[_0x27f4('0x4a')][_0x27f4('0x53')],_0x155e80[_0x27f4('0x4a')][_0x27f4('0x2f')]);return db[_0x27f4('0x4d')][_0x27f4('0x49')](_0x155e80[_0x27f4('0x4a')],{'include':[{'model':db[_0x27f4('0x55')],'as':'Subjects'},{'model':db[_0x27f4('0x55')],'as':_0x27f4('0x56')}]});}return null;})[_0x27f4('0x26')](respondWithResult(_0x489d79,null))['catch'](handleError(_0x489d79,null));};exports['getFields']=function(_0x271f9e,_0x17bc43,_0x1e8b82){var _0x19b3d3=_0x271f9e['query'][_0x27f4('0x57')];var _0x574a1b=_0x19b3d3===_0x27f4('0x58')?_0x27f4('0x59'):'PhoneCall';var _0x4fdcf6='';var _0x210e90='';var _0x38efe5='';var _0x5995f7='';var _0x231653='';var _0x178cfe='';var _0x2d9e3b='';var _0x3275e1='';var _0x1699d3=[_0x27f4('0x5a'),_0x27f4('0x5b'),'customerid',_0x27f4('0x5c'),_0x27f4('0x5d'),_0x27f4('0x5e'),_0x27f4('0x5f'),_0x27f4('0x60'),'directioncode','phonecall_activity_parties'];var _0x39e9e4=['accountidname',_0x27f4('0x61'),_0x27f4('0x62'),_0x27f4('0x63'),'contactidname',_0x27f4('0x64'),_0x27f4('0x65'),'contractidname','createdbyexternalpartyname',_0x27f4('0x66'),_0x27f4('0x67'),_0x27f4('0x68'),_0x27f4('0x69'),_0x27f4('0x6a'),_0x27f4('0x6b'),'customeridname',_0x27f4('0x6c'),_0x27f4('0x6d'),_0x27f4('0x6e'),'entitlementidname',_0x27f4('0x6f'),_0x27f4('0x70'),'escalatedon','exchangerate',_0x27f4('0x71'),_0x27f4('0x72'),_0x27f4('0x73'),_0x27f4('0x74'),_0x27f4('0x75'),_0x27f4('0x76'),'masteridname',_0x27f4('0x77'),_0x27f4('0x78'),_0x27f4('0x79'),_0x27f4('0x7a'),'modifiedon',_0x27f4('0x7b'),_0x27f4('0x7c'),_0x27f4('0x7d'),_0x27f4('0x7e'),_0x27f4('0x7f'),_0x27f4('0x80'),_0x27f4('0x81'),_0x27f4('0x82'),'owneridtype',_0x27f4('0x83'),'parentcaseidname',_0x27f4('0x84'),'primarycontactidyominame',_0x27f4('0x85'),_0x27f4('0x86'),_0x27f4('0x87'),'resolveby','resolvebykpiidname',_0x27f4('0x88'),_0x27f4('0x89'),_0x27f4('0x8a'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode',_0x27f4('0x8b'),_0x27f4('0x8c'),_0x27f4('0x8d'),_0x27f4('0x8e'),_0x27f4('0x8f'),_0x27f4('0x90'),'versionnumber'];var _0x2504b7=_0x1699d3['concat'](_0x39e9e4);return db[_0x27f4('0x2c')][_0x27f4('0x4c')]({'where':{'id':_0x271f9e[_0x27f4('0x45')]['id']},'attributes':['id',_0x27f4('0x91'),_0x27f4('0x92'),_0x27f4('0x93'),_0x27f4('0x94'),'clientId',_0x27f4('0x95')]})['then'](handleEntityNotFound(_0x17bc43,null))[_0x27f4('0x26')](function(_0x5dbbec){if(_0x5dbbec){_0x3275e1=_0x5dbbec[_0x27f4('0x93')];var _0x1e53a6=_0x3275e1[_0x27f4('0x96')](-0x1);if(_0x1e53a6==='/'){_0x3275e1=_0x3275e1[_0x27f4('0x97')](0x0,_0x3275e1[_0x27f4('0x98')](_0x1e53a6));}_0x2d9e3b=util['format'](_0x27f4('0x99'),_0x3275e1);var _0x6dd064={'method':_0x27f4('0x9a'),'uri':'https://login.microsoftonline.com/'+_0x5dbbec[_0x27f4('0x94')]+_0x27f4('0x9b'),'form':{'client_id':_0x5dbbec[_0x27f4('0x9c')],'resource':_0x3275e1,'username':_0x5dbbec[_0x27f4('0x91')],'password':_0x5dbbec[_0x27f4('0x92')],'grant_type':_0x27f4('0x92'),'client_secret':_0x5dbbec[_0x27f4('0x95')]},'json':!![]};return rp(_0x6dd064);}})['then'](function(_0x2ce2a8){_0x178cfe=_0x2ce2a8[_0x27f4('0x9d')];var _0x51ccd2={'method':'GET','uri':encodeURI(_0x2d9e3b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x574a1b+'\x27'),'headers':{'Authorization':_0x27f4('0x9e')+_0x178cfe,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x51ccd2);})[_0x27f4('0x26')](function(_0x139c6e){var _0x27a360=_0x139c6e[_0x27f4('0xa0')][0x0];var _0x354007=_0x27a360[_0x27f4('0xa1')];var _0x220a4b={'method':_0x27f4('0xa2'),'uri':_0x2d9e3b+_0x27f4('0xa3')+_0x354007+_0x27f4('0xa4'),'headers':{'Authorization':_0x27f4('0x9e')+_0x178cfe,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x220a4b);})[_0x27f4('0x26')](function(_0x3e4a0e){_0x4fdcf6=_0x3e4a0e;_0x210e90=_0x4fdcf6[_0x27f4('0xa5')];_0x210e90=_['remove'](_0x210e90,function(_0x39f5bc){return!_0x2504b7[_0x27f4('0xa6')](_0x39f5bc[_0x27f4('0xa7')]);});var _0x337811=[];var _0xc89d88=[];_0x210e90[_0x27f4('0xa8')](function(_0x14829f){if(_0x14829f[_0x27f4('0xa9')]){var _0x4ea92a=_0x14829f[_0x27f4('0xa9')]['substring'](_0x14829f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x4ea92a==='PicklistAttributeMetadata'){_0x337811[_0x27f4('0xaa')](getSelectList(_0x2d9e3b,_0x19b3d3,_0xc89d88,_0x4fdcf6['MetadataId'],_0x14829f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x337811);})[_0x27f4('0x26')](function(_0x1eebe4){_0x38efe5=_0x1eebe4[0x0];var _0x56431=[];var _0x240708=[];_0x210e90[_0x27f4('0xa8')](function(_0x47b64f){if(!_[_0x27f4('0xac')](_0x47b64f['@odata.type'])){var _0x2e82ae=_0x47b64f['@odata.type'][_0x27f4('0x97')](_0x47b64f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x2e82ae==='BooleanAttributeMetadata'){_0x56431[_0x27f4('0xaa')](getBooleanList(_0x2d9e3b,_0x19b3d3,_0x240708,_0x4fdcf6[_0x27f4('0xa1')],_0x47b64f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x56431);})['then'](function(_0x2008a4){_0x5995f7=_0x2008a4[0x0];var _0x3f7b15=[];var _0x3b11bd=[];_0x210e90['forEach'](function(_0x30607f){if(_0x30607f[_0x27f4('0xa9')]){var _0x33605d=_0x30607f[_0x27f4('0xa9')][_0x27f4('0x97')](_0x30607f[_0x27f4('0xa9')][_0x27f4('0x98')]('.')+0x1);if(_0x33605d===_0x27f4('0xad')||_0x33605d==='DoubleAttributeMetadata'||_0x33605d===_0x27f4('0xae')||_0x33605d==='IntegerAttributeMetadata'||_0x33605d===_0x27f4('0xaf')||_0x33605d===_0x27f4('0xb0')||_0x33605d===_0x27f4('0xb1')||_0x33605d===_0x27f4('0xb2')||_0x33605d===_0x27f4('0xb3')||_0x33605d===_0x27f4('0xb4')){_0x3f7b15[_0x27f4('0xaa')](getInputList(_0x2d9e3b,_0x19b3d3,_0x33605d,_0x3b11bd,_0x4fdcf6['MetadataId'],_0x30607f[_0x27f4('0xa1')],_0x178cfe));}}});return Promise[_0x27f4('0xab')](_0x3f7b15);})[_0x27f4('0x26')](function(_0x2e94d4){_0x231653=_0x2e94d4[0x0];var _0x400d81=_0x38efe5[_0x27f4('0xb5')](_0x5995f7)['concat'](_0x231653);var _0x3716e1={'count':_0x400d81['length'],'rows':_0x400d81};return _0x3716e1;})[_0x27f4('0x26')](respondWithResult(_0x17bc43,null))['catch'](function(_0x2a6a90){var _0x4bb880=_0x271f9e['query'][_0x27f4('0xb6')]?0x1f4:_0x2a6a90['statusCode']||0x1f4;logger[_0x27f4('0x28')](_0x2a6a90[_0x27f4('0xb7')]);delete _0x2a6a90['name'];if(_0x4bb880===0x191){_0x4bb880=0x190;}_0x17bc43[_0x27f4('0x1a')](_0x4bb880)['send'](_0x271f9e[_0x27f4('0x33')][_0x27f4('0xb6')]?{'message':_0x27f4('0xb8'),'statusCode':_0x2a6a90[_0x27f4('0xb9')]}:_0x2a6a90);});};function getSelectList(_0x2b5539,_0x14195e,_0x4a478e,_0x431959,_0xb6553f,_0x18e5e1){var _0x343724={'method':_0x27f4('0xa2'),'uri':_0x2b5539+_0x27f4('0xa3')+_0x431959+_0x27f4('0xba')+_0xb6553f+_0x27f4('0xbb')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x27f4('0x9e')+_0x18e5e1,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x343724)[_0x27f4('0x26')](function(_0xd07b9d){var _0x3a6399=[];var _0x1e8d1b=_0xd07b9d[_0x27f4('0xbc')][_0x27f4('0xbd')];_0x1e8d1b[_0x27f4('0xa8')](function(_0x32506a){_0x3a6399['push']({'name':_0x32506a[_0x27f4('0xbe')][_0x27f4('0xbf')][_0x27f4('0xbe')],'value':String(_0x32506a[_0x27f4('0xc0')])});});var _0x57d11f={'id':_0x14195e+'_'+_0xd07b9d[_0x27f4('0xa7')],'name':_0xd07b9d[_0x27f4('0xc1')][_0x27f4('0xbf')][_0x27f4('0xbe')],'custom':![],'options':_0x3a6399};_0x4a478e[_0x27f4('0xaa')](_0x57d11f);return _0x4a478e;});}function getBooleanList(_0x2b5926,_0x1fbbb7,_0x4a4a19,_0x19b143,_0x2deb4c,_0x548abe){var _0x4fe687={'method':'GET','uri':_0x2b5926+_0x27f4('0xa3')+_0x19b143+')/Attributes('+_0x2deb4c+_0x27f4('0xc2'),'headers':{'Authorization':_0x27f4('0x9e')+_0x548abe,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x4fe687)['then'](function(_0x4e72df){var _0x10025d=[];_0x10025d[_0x27f4('0xaa')]({'name':_0x4e72df[_0x27f4('0xbc')]['TrueOption'][_0x27f4('0xbe')][_0x27f4('0xbf')][_0x27f4('0xbe')],'value':_0x27f4('0xc3')},{'name':_0x4e72df[_0x27f4('0xbc')]['FalseOption'][_0x27f4('0xbe')][_0x27f4('0xbf')]['Label'],'value':_0x27f4('0xc4')});var _0x1d7082={'id':_0x1fbbb7+'_'+_0x4e72df[_0x27f4('0xa7')],'name':_0x4e72df[_0x27f4('0xc1')]['UserLocalizedLabel'][_0x27f4('0xbe')],'custom':![],'options':_0x10025d};_0x4a4a19[_0x27f4('0xaa')](_0x1d7082);return _0x4a4a19;});}function getInputList(_0xcf7a35,_0x328ab3,_0x5815fd,_0x533b20,_0x338a6d,_0x2e171f,_0x585975){var _0x3129f8={'method':_0x27f4('0xa2'),'uri':_0xcf7a35+_0x27f4('0xa3')+_0x338a6d+_0x27f4('0xba')+_0x2e171f+')/Microsoft.Dynamics.CRM.'+_0x5815fd+_0x27f4('0xc5'),'headers':{'Authorization':_0x27f4('0x9e')+_0x585975,'If-None-Match':null,'OData-Version':_0x27f4('0x9f')},'json':!![]};return rp(_0x3129f8)['then'](function(_0x23300e){var _0x48239a={'id':_0x328ab3+'_'+_0x23300e[_0x27f4('0xa7')],'name':_0x23300e[_0x27f4('0xc1')][_0x27f4('0xbf')]?_0x23300e[_0x27f4('0xc1')][_0x27f4('0xbf')]['Label']:_0x23300e[_0x27f4('0xa7')],'custom':![],'options':[]};_0x533b20[_0x27f4('0xaa')](_0x48239a);return _0x533b20;});}
\ No newline at end of file
+var _0xe2cc=['accountidname','accountidyominame','actualserviceunits','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties'];(function(_0x1e575a,_0x2d0116){var _0x396443=function(_0x1c1008){while(--_0x1c1008){_0x1e575a['push'](_0x1e575a['shift']());}};_0x396443(++_0x2d0116);}(_0xe2cc,0x69));var _0xce2c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe2cc[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xce2c('0x0'));var rimraf=require(_0xce2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce2c('0x2'));var moment=require(_0xce2c('0x3'));var BPromise=require(_0xce2c('0x4'));var Mustache=require(_0xce2c('0x5'));var util=require(_0xce2c('0x6'));var path=require(_0xce2c('0x7'));var sox=require(_0xce2c('0x8'));var csv=require(_0xce2c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce2c('0xa'));var squel=require(_0xce2c('0xb'));var crypto=require(_0xce2c('0xc'));var jsforce=require(_0xce2c('0xd'));var deskjs=require(_0xce2c('0xe'));var toCsv=require(_0xce2c('0x9'));var querystring=require('querystring');var Papa=require(_0xce2c('0xf'));var Redis=require(_0xce2c('0x10'));var authService=require(_0xce2c('0x11'));var qs=require(_0xce2c('0x12'));var as=require(_0xce2c('0x13'));var hardwareService=require(_0xce2c('0x14'));var logger=require(_0xce2c('0x15'))(_0xce2c('0x16'));var utils=require(_0xce2c('0x17'));var config=require(_0xce2c('0x18'));var licenseUtil=require(_0xce2c('0x19'));var db=require(_0xce2c('0x1a'))['db'];var integrations=require(_0xce2c('0x1b'));function respondWithStatusCode(_0x27928d,_0x2421f6){_0x2421f6=_0x2421f6||0xcc;return function(_0x5dfbac){if(_0x5dfbac){return _0x27928d['sendStatus'](_0x2421f6);}return _0x27928d[_0xce2c('0x1c')](_0x2421f6)['end']();};}function respondWithResult(_0x214c62,_0x179855){_0x179855=_0x179855||0xc8;return function(_0x23c26b){if(_0x23c26b){return _0x214c62[_0xce2c('0x1c')](_0x179855)['json'](_0x23c26b);}};}function respondWithFilteredResult(_0xb99213,_0x1c3046){return function(_0x146830){if(_0x146830){var _0x46a5b5=typeof _0x1c3046[_0xce2c('0x1d')]===_0xce2c('0x1e')&&typeof _0x1c3046[_0xce2c('0x1f')]==='undefined';var _0x1b9ea4=_0x146830[_0xce2c('0x20')];var _0x383085=_0x46a5b5?0x0:_0x1c3046[_0xce2c('0x1d')];var _0x24537f=_0x46a5b5?_0x146830['count']:_0x1c3046[_0xce2c('0x1d')]+_0x1c3046[_0xce2c('0x1f')];var _0x591921;if(_0x24537f>=_0x1b9ea4){_0x24537f=_0x1b9ea4;_0x591921=0xc8;}else{_0x591921=0xce;}_0xb99213['status'](_0x591921);return _0xb99213[_0xce2c('0x21')](_0xce2c('0x22'),_0x383085+'-'+_0x24537f+'/'+_0x1b9ea4)[_0xce2c('0x23')](_0x146830);}return null;};}function patchUpdates(_0x2f409c){return function(_0x121836){try{jsonpatch[_0xce2c('0x24')](_0x121836,_0x2f409c,!![]);}catch(_0x28e2c9){return BPromise['reject'](_0x28e2c9);}return _0x121836[_0xce2c('0x25')]();};}function saveUpdates(_0xb8057b,_0x399f67){return function(_0x4c02fc){if(_0x4c02fc){return _0x4c02fc[_0xce2c('0x26')](_0xb8057b)[_0xce2c('0x27')](function(_0x1e263d){return _0x1e263d;});}return null;};}function removeEntity(_0x39880d,_0x451e86){return function(_0x1d6e55){if(_0x1d6e55){return _0x1d6e55['destroy']()[_0xce2c('0x27')](function(){_0x39880d[_0xce2c('0x1c')](0xcc)[_0xce2c('0x28')]();});}};}function handleEntityNotFound(_0x1d1e5c,_0x16382d){return function(_0x657f66){if(!_0x657f66){_0x1d1e5c['sendStatus'](0x194);}return _0x657f66;};}function handleError(_0x1e744b,_0x5728c7){_0x5728c7=_0x5728c7||0x1f4;return function(_0x4486b4){logger[_0xce2c('0x29')](_0x4486b4[_0xce2c('0x2a')]);if(_0x4486b4[_0xce2c('0x2b')]){delete _0x4486b4[_0xce2c('0x2b')];}_0x1e744b[_0xce2c('0x1c')](_0x5728c7)[_0xce2c('0x2c')](_0x4486b4);};}exports[_0xce2c('0x2d')]=function(_0x1e349c,_0x4f9808){var _0x4358ee={},_0x45efae={},_0x385b0d={'count':0x0,'rows':[]};var _0x4b020f=_[_0xce2c('0x2e')](db[_0xce2c('0x2f')][_0xce2c('0x30')],function(_0x371a3b){return{'name':_0x371a3b[_0xce2c('0x31')],'type':_0x371a3b['type'][_0xce2c('0x32')]};});_0x45efae[_0xce2c('0x33')]=_['map'](_0x4b020f,_0xce2c('0x2b'));_0x45efae[_0xce2c('0x34')]=_[_0xce2c('0x35')](_0x1e349c[_0xce2c('0x34')]);_0x45efae[_0xce2c('0x36')]=_['intersection'](_0x45efae[_0xce2c('0x33')],_0x45efae['query']);_0x4358ee[_0xce2c('0x37')]=_[_0xce2c('0x38')](_0x45efae['model'],qs[_0xce2c('0x39')](_0x1e349c[_0xce2c('0x34')][_0xce2c('0x39')]));_0x4358ee[_0xce2c('0x37')]=_0x4358ee['attributes'][_0xce2c('0x3a')]?_0x4358ee[_0xce2c('0x37')]:_0x45efae['model'];if(!_0x1e349c[_0xce2c('0x34')][_0xce2c('0x3b')](_0xce2c('0x3c'))){_0x4358ee[_0xce2c('0x1f')]=qs[_0xce2c('0x1f')](_0x1e349c[_0xce2c('0x34')][_0xce2c('0x1f')]);_0x4358ee[_0xce2c('0x1d')]=qs['offset'](_0x1e349c[_0xce2c('0x34')][_0xce2c('0x1d')]);}_0x4358ee['order']=qs[_0xce2c('0x3d')](_0x1e349c[_0xce2c('0x34')][_0xce2c('0x3d')]);_0x4358ee[_0xce2c('0x3e')]=qs[_0xce2c('0x36')](_[_0xce2c('0x3f')](_0x1e349c[_0xce2c('0x34')],_0x45efae[_0xce2c('0x36')]),_0x4b020f);if(_0x1e349c[_0xce2c('0x34')][_0xce2c('0x40')]){_0x4358ee[_0xce2c('0x3e')]=_['merge'](_0x4358ee[_0xce2c('0x3e')],{'$or':_[_0xce2c('0x2e')](_0x4b020f,function(_0x1db8b6){if(_0x1db8b6[_0xce2c('0x41')]!==_0xce2c('0x42')){var _0x2e2fc7={};_0x2e2fc7[_0x1db8b6[_0xce2c('0x2b')]]={'$like':'%'+_0x1e349c[_0xce2c('0x34')][_0xce2c('0x40')]+'%'};return _0x2e2fc7;}})});}_0x4358ee=_[_0xce2c('0x43')]({},_0x4358ee,_0x1e349c[_0xce2c('0x44')]);var _0x1ba81b={'where':_0x4358ee[_0xce2c('0x3e')]};return db[_0xce2c('0x2f')]['count'](_0x1ba81b)['then'](function(_0x5a64c0){_0x385b0d['count']=_0x5a64c0;if(_0x1e349c[_0xce2c('0x34')][_0xce2c('0x45')]){_0x4358ee['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0xce2c('0x46')](_0x4358ee);})[_0xce2c('0x27')](function(_0x7577c7){_0x385b0d[_0xce2c('0x47')]=_0x7577c7;return _0x385b0d;})[_0xce2c('0x27')](respondWithFilteredResult(_0x4f9808,_0x4358ee))[_0xce2c('0x48')](handleError(_0x4f9808,null));};exports[_0xce2c('0x49')]=function(_0x1012fb,_0x4e2ae2){var _0x8bbc9a={'raw':![],'where':{'id':_0x1012fb[_0xce2c('0x4a')]['id']}},_0xbad021={};_0xbad021['model']=_[_0xce2c('0x35')](db[_0xce2c('0x2f')]['rawAttributes']);_0xbad021['query']=_[_0xce2c('0x35')](_0x1012fb[_0xce2c('0x34')]);_0xbad021['filters']=_['intersection'](_0xbad021['model'],_0xbad021[_0xce2c('0x34')]);_0x8bbc9a[_0xce2c('0x37')]=_['intersection'](_0xbad021[_0xce2c('0x33')],qs[_0xce2c('0x39')](_0x1012fb['query']['fields']));_0x8bbc9a['attributes']=_0x8bbc9a[_0xce2c('0x37')]['length']?_0x8bbc9a[_0xce2c('0x37')]:_0xbad021[_0xce2c('0x33')];if(_0x1012fb['query'][_0xce2c('0x45')]){_0x8bbc9a[_0xce2c('0x4b')]=[{'all':!![]}];}_0x8bbc9a=_[_0xce2c('0x43')]({},_0x8bbc9a,_0x1012fb[_0xce2c('0x44')]);return db['Dynamics365Account'][_0xce2c('0x4c')](_0x8bbc9a)[_0xce2c('0x27')](handleEntityNotFound(_0x4e2ae2,null))[_0xce2c('0x27')](respondWithResult(_0x4e2ae2,null))['catch'](handleError(_0x4e2ae2,null));};exports[_0xce2c('0x4d')]=function(_0x1313ea,_0x535b66){return db[_0xce2c('0x2f')]['create'](_0x1313ea[_0xce2c('0x4e')],{})[_0xce2c('0x27')](respondWithResult(_0x535b66,0xc9))[_0xce2c('0x48')](handleError(_0x535b66,null));};exports[_0xce2c('0x26')]=function(_0xff694f,_0x1cb498){if(_0xff694f['body']['id']){delete _0xff694f[_0xce2c('0x4e')]['id'];}return db[_0xce2c('0x2f')][_0xce2c('0x4c')]({'where':{'id':_0xff694f[_0xce2c('0x4a')]['id']}})[_0xce2c('0x27')](handleEntityNotFound(_0x1cb498,null))[_0xce2c('0x27')](saveUpdates(_0xff694f[_0xce2c('0x4e')],null))[_0xce2c('0x27')](respondWithResult(_0x1cb498,null))[_0xce2c('0x48')](handleError(_0x1cb498,null));};exports[_0xce2c('0x4f')]=function(_0x3414b3,_0x29406c){return db[_0xce2c('0x2f')]['find']({'where':{'id':_0x3414b3['params']['id']}})['then'](handleEntityNotFound(_0x29406c,null))[_0xce2c('0x27')](removeEntity(_0x29406c,null))[_0xce2c('0x48')](handleError(_0x29406c,null));};exports[_0xce2c('0x50')]=function(_0xd5f25b,_0x1db8ed,_0x389fcb){var _0x3441eb={};var _0x3124df={};var _0x550b80;var _0xb420b0;return db['Dynamics365Account'][_0xce2c('0x51')]({'where':{'id':_0xd5f25b[_0xce2c('0x4a')]['id']}})[_0xce2c('0x27')](handleEntityNotFound(_0x1db8ed,null))[_0xce2c('0x27')](function(_0x52a479){if(_0x52a479){_0x550b80=_0x52a479;_0x3124df[_0xce2c('0x33')]=_[_0xce2c('0x35')](db['Dynamics365Configuration'][_0xce2c('0x30')]);_0x3124df[_0xce2c('0x34')]=_['keys'](_0xd5f25b[_0xce2c('0x34')]);_0x3124df[_0xce2c('0x36')]=_[_0xce2c('0x38')](_0x3124df[_0xce2c('0x33')],_0x3124df[_0xce2c('0x34')]);_0x3441eb[_0xce2c('0x37')]=_[_0xce2c('0x38')](_0x3124df[_0xce2c('0x33')],qs[_0xce2c('0x39')](_0xd5f25b['query'][_0xce2c('0x39')]));_0x3441eb[_0xce2c('0x37')]=_0x3441eb[_0xce2c('0x37')][_0xce2c('0x3a')]?_0x3441eb['attributes']:_0x3124df[_0xce2c('0x33')];_0x3441eb['order']=qs['sort'](_0xd5f25b[_0xce2c('0x34')][_0xce2c('0x3d')]);_0x3441eb[_0xce2c('0x3e')]=qs[_0xce2c('0x36')](_[_0xce2c('0x3f')](_0xd5f25b[_0xce2c('0x34')],_0x3124df[_0xce2c('0x36')]));if(_0xd5f25b[_0xce2c('0x34')][_0xce2c('0x40')]){_0x3441eb[_0xce2c('0x3e')]=_[_0xce2c('0x43')](_0x3441eb[_0xce2c('0x3e')],{'$or':_[_0xce2c('0x2e')](_0x3441eb[_0xce2c('0x37')],function(_0x3343c0){var _0x329f3a={};_0x329f3a[_0x3343c0]={'$like':'%'+_0xd5f25b[_0xce2c('0x34')][_0xce2c('0x40')]+'%'};return _0x329f3a;})});}_0x3441eb=_['merge']({},_0x3441eb,_0xd5f25b['options']);return _0x550b80[_0xce2c('0x50')](_0x3441eb);}})['then'](function(_0x108847){if(_0x108847){_0xb420b0=_0x108847['length'];if(!_0xd5f25b['query'][_0xce2c('0x3b')](_0xce2c('0x3c'))){_0x3441eb['limit']=qs[_0xce2c('0x1f')](_0xd5f25b[_0xce2c('0x34')]['limit']);_0x3441eb[_0xce2c('0x1d')]=qs[_0xce2c('0x1d')](_0xd5f25b[_0xce2c('0x34')]['offset']);}return _0x550b80[_0xce2c('0x50')](_0x3441eb);}})[_0xce2c('0x27')](function(_0x386db5){if(_0x386db5){return _0x386db5?{'count':_0xb420b0,'rows':_0x386db5}:null;}})[_0xce2c('0x27')](respondWithResult(_0x1db8ed,null))[_0xce2c('0x48')](handleError(_0x1db8ed,null));};exports[_0xce2c('0x52')]=function(_0x25061d,_0x401001,_0x5c7839){if(_0x25061d[_0xce2c('0x4e')]['id']){delete _0x25061d[_0xce2c('0x4e')]['id'];}return db[_0xce2c('0x2f')][_0xce2c('0x51')]({'where':{'id':_0x25061d['params']['id']}})[_0xce2c('0x27')](handleEntityNotFound(_0x401001,null))[_0xce2c('0x27')](function(_0x903ee1){if(_0x903ee1){_0x25061d[_0xce2c('0x4e')][_0xce2c('0x53')]=_0x903ee1['id'];_0x25061d[_0xce2c('0x4e')][_0xce2c('0x54')]=integrations[_0xce2c('0x55')](_0x25061d['body']['channel'],_0x25061d[_0xce2c('0x4e')][_0xce2c('0x41')]);_0x25061d[_0xce2c('0x4e')][_0xce2c('0x56')]=integrations[_0xce2c('0x57')](_0x25061d[_0xce2c('0x4e')][_0xce2c('0x58')],_0x25061d['body'][_0xce2c('0x41')]);return db['Dynamics365Configuration'][_0xce2c('0x4d')](_0x25061d[_0xce2c('0x4e')],{'include':[{'model':db[_0xce2c('0x59')],'as':_0xce2c('0x54')},{'model':db[_0xce2c('0x59')],'as':_0xce2c('0x56')}]});}return null;})[_0xce2c('0x27')](respondWithResult(_0x401001,null))[_0xce2c('0x48')](handleError(_0x401001,null));};exports[_0xce2c('0x5a')]=function(_0x2f5145,_0x379b64,_0x4bfa75){var _0x31949c=_0x2f5145[_0xce2c('0x34')][_0xce2c('0x5b')];var _0x4fa46e=_0x31949c===_0xce2c('0x5c')?'Incident':_0xce2c('0x5d');var _0x55e17d='';var _0x253a0b='';var _0x32f367='';var _0x131d24='';var _0x1b6380='';var _0x2f73be='';var _0x2c6b07='';var _0x36a11a='';var _0x43557b=[_0xce2c('0x5e'),'description',_0xce2c('0x5f'),'ownerid',_0xce2c('0x60'),_0xce2c('0x61'),'phonenumber',_0xce2c('0x62'),_0xce2c('0x63'),_0xce2c('0x64')];var _0x517d49=[_0xce2c('0x65'),_0xce2c('0x66'),_0xce2c('0x67'),'billedserviceunits','contactidname','contactidyominame','contractdetailidname',_0xce2c('0x68'),_0xce2c('0x69'),'createdbyexternalpartyyominame',_0xce2c('0x6a'),_0xce2c('0x6b'),'createdon',_0xce2c('0x6c'),_0xce2c('0x6d'),'customeridname',_0xce2c('0x6e'),'customeridyominame','emailaddress',_0xce2c('0x6f'),_0xce2c('0x70'),_0xce2c('0x71'),_0xce2c('0x72'),_0xce2c('0x73'),_0xce2c('0x74'),_0xce2c('0x75'),_0xce2c('0x76'),_0xce2c('0x77'),_0xce2c('0x78'),_0xce2c('0x79'),_0xce2c('0x7a'),_0xce2c('0x7b'),_0xce2c('0x7c'),_0xce2c('0x7d'),_0xce2c('0x7e'),_0xce2c('0x7f'),_0xce2c('0x80'),_0xce2c('0x81'),_0xce2c('0x82'),_0xce2c('0x83'),_0xce2c('0x84'),_0xce2c('0x85'),_0xce2c('0x86'),_0xce2c('0x87'),_0xce2c('0x88'),_0xce2c('0x89'),_0xce2c('0x8a'),'primarycontactidname','primarycontactidyominame',_0xce2c('0x8b'),_0xce2c('0x8c'),_0xce2c('0x8d'),_0xce2c('0x8e'),_0xce2c('0x8f'),'responseby','responsiblecontactidname',_0xce2c('0x90'),'sentimentvalue','slainvokedidname','slaname','socialprofileidname',_0xce2c('0x91'),_0xce2c('0x92'),_0xce2c('0x93'),_0xce2c('0x94'),_0xce2c('0x95'),_0xce2c('0x96'),_0xce2c('0x97'),_0xce2c('0x98'),_0xce2c('0x99')];var _0x141a2a=_0x43557b[_0xce2c('0x9a')](_0x517d49);return db[_0xce2c('0x2f')]['findOne']({'where':{'id':_0x2f5145[_0xce2c('0x4a')]['id']},'attributes':['id',_0xce2c('0x9b'),_0xce2c('0x9c'),'remoteUri','tenantId',_0xce2c('0x9d'),_0xce2c('0x9e')]})[_0xce2c('0x27')](handleEntityNotFound(_0x379b64,null))[_0xce2c('0x27')](function(_0x596238){if(_0x596238){_0x36a11a=_0x596238['remoteUri'];var _0x32fff9=_0x36a11a[_0xce2c('0x9f')](-0x1);if(_0x32fff9==='/'){_0x36a11a=_0x36a11a[_0xce2c('0xa0')](0x0,_0x36a11a[_0xce2c('0xa1')](_0x32fff9));}_0x2c6b07=util['format'](_0xce2c('0xa2'),_0x36a11a);var _0x34db43={'method':_0xce2c('0xa3'),'uri':_0xce2c('0xa4')+_0x596238[_0xce2c('0xa5')]+_0xce2c('0xa6'),'form':{'client_id':_0x596238[_0xce2c('0x9d')],'resource':_0x36a11a,'username':_0x596238[_0xce2c('0x9b')],'password':_0x596238[_0xce2c('0x9c')],'grant_type':'password','client_secret':_0x596238[_0xce2c('0x9e')]},'json':!![]};return rp(_0x34db43);}})[_0xce2c('0x27')](function(_0x1fe487){_0x2f73be=_0x1fe487[_0xce2c('0xa7')];var _0x1b0328={'method':_0xce2c('0xa8'),'uri':encodeURI(_0x2c6b07+_0xce2c('0xa9')+_0x4fa46e+'\x27'),'headers':{'Authorization':_0xce2c('0xaa')+_0x2f73be,'If-None-Match':null,'OData-Version':_0xce2c('0xab')},'json':!![]};return rp(_0x1b0328);})[_0xce2c('0x27')](function(_0x546009){var _0x4b76d8=_0x546009[_0xce2c('0xac')][0x0];var _0x3f9501=_0x4b76d8[_0xce2c('0xad')];var _0x293500={'method':_0xce2c('0xa8'),'uri':_0x2c6b07+_0xce2c('0xae')+_0x3f9501+_0xce2c('0xaf'),'headers':{'Authorization':'Bearer\x20'+_0x2f73be,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x293500);})['then'](function(_0x1b6290){_0x55e17d=_0x1b6290;_0x253a0b=_0x55e17d[_0xce2c('0xb0')];_0x253a0b=_[_0xce2c('0xb1')](_0x253a0b,function(_0x2ec42c){return!_0x141a2a[_0xce2c('0xb2')](_0x2ec42c[_0xce2c('0xb3')]);});var _0x5e82b7=[];var _0x4ca24a=[];_0x253a0b[_0xce2c('0xb4')](function(_0x578ad5){if(_0x578ad5[_0xce2c('0xb5')]){var _0x8cf87c=_0x578ad5[_0xce2c('0xb5')][_0xce2c('0xa0')](_0x578ad5[_0xce2c('0xb5')][_0xce2c('0xa1')]('.')+0x1);if(_0x8cf87c==='PicklistAttributeMetadata'){_0x5e82b7[_0xce2c('0xb6')](getSelectList(_0x2c6b07,_0x31949c,_0x4ca24a,_0x55e17d[_0xce2c('0xad')],_0x578ad5[_0xce2c('0xad')],_0x2f73be));}}});return Promise[_0xce2c('0xb7')](_0x5e82b7);})[_0xce2c('0x27')](function(_0x27ac37){_0x32f367=_0x27ac37[0x0];var _0x31da1d=[];var _0xd776fe=[];_0x253a0b[_0xce2c('0xb4')](function(_0x110606){if(!_['isNil'](_0x110606['@odata.type'])){var _0x4c78bf=_0x110606[_0xce2c('0xb5')][_0xce2c('0xa0')](_0x110606[_0xce2c('0xb5')][_0xce2c('0xa1')]('.')+0x1);if(_0x4c78bf==='BooleanAttributeMetadata'){_0x31da1d[_0xce2c('0xb6')](getBooleanList(_0x2c6b07,_0x31949c,_0xd776fe,_0x55e17d[_0xce2c('0xad')],_0x110606[_0xce2c('0xad')],_0x2f73be));}}});return Promise[_0xce2c('0xb7')](_0x31da1d);})[_0xce2c('0x27')](function(_0x484948){_0x131d24=_0x484948[0x0];var _0x189332=[];var _0x37333f=[];_0x253a0b['forEach'](function(_0x160b5c){if(_0x160b5c[_0xce2c('0xb5')]){var _0x534af3=_0x160b5c[_0xce2c('0xb5')][_0xce2c('0xa0')](_0x160b5c['@odata.type'][_0xce2c('0xa1')]('.')+0x1);if(_0x534af3===_0xce2c('0xb8')||_0x534af3==='DoubleAttributeMetadata'||_0x534af3==='BigIntAttributeMetadata'||_0x534af3===_0xce2c('0xb9')||_0x534af3===_0xce2c('0xba')||_0x534af3==='DateTimeAttributeMetadata'||_0x534af3==='StatusAttributeMetadata'||_0x534af3==='EntityNameAttributeMetadata'||_0x534af3===_0xce2c('0xbb')||_0x534af3===_0xce2c('0xbc')){_0x189332[_0xce2c('0xb6')](getInputList(_0x2c6b07,_0x31949c,_0x534af3,_0x37333f,_0x55e17d[_0xce2c('0xad')],_0x160b5c[_0xce2c('0xad')],_0x2f73be));}}});return Promise['all'](_0x189332);})['then'](function(_0x1912cb){_0x1b6380=_0x1912cb[0x0];var _0x4a1050=_0x32f367['concat'](_0x131d24)['concat'](_0x1b6380);var _0x5f0581={'count':_0x4a1050[_0xce2c('0x3a')],'rows':_0x4a1050};return _0x5f0581;})['then'](respondWithResult(_0x379b64,null))[_0xce2c('0x48')](function(_0x31d141){var _0x1cb37a=_0x2f5145['query']['test']?0x1f4:_0x31d141[_0xce2c('0xbd')]||0x1f4;logger[_0xce2c('0x29')](_0x31d141[_0xce2c('0x2a')]);delete _0x31d141[_0xce2c('0x2b')];if(_0x1cb37a===0x191){_0x1cb37a=0x190;}_0x379b64['status'](_0x1cb37a)['send'](_0x2f5145[_0xce2c('0x34')][_0xce2c('0xbe')]?{'message':_0xce2c('0xbf'),'statusCode':_0x31d141[_0xce2c('0xbd')]}:_0x31d141);});};function getSelectList(_0x439a2a,_0x109414,_0x16bb8b,_0x37e216,_0x2f39ac,_0x2b7710){var _0x2c46a8={'method':_0xce2c('0xa8'),'uri':_0x439a2a+_0xce2c('0xae')+_0x37e216+_0xce2c('0xc0')+_0x2f39ac+_0xce2c('0xc1')+_0xce2c('0xc2'),'headers':{'Authorization':_0xce2c('0xaa')+_0x2b7710,'If-None-Match':null,'OData-Version':_0xce2c('0xab')},'json':!![]};return rp(_0x2c46a8)['then'](function(_0x2df188){var _0x551d81=[];var _0x5468fa=_0x2df188[_0xce2c('0xc3')]['Options'];_0x5468fa['forEach'](function(_0x417e31){_0x551d81[_0xce2c('0xb6')]({'name':_0x417e31[_0xce2c('0xc4')][_0xce2c('0xc5')][_0xce2c('0xc4')],'value':String(_0x417e31[_0xce2c('0xc6')])});});var _0xb56e8d={'id':_0x109414+'_'+_0x2df188['LogicalName'],'name':_0x2df188[_0xce2c('0xc7')][_0xce2c('0xc5')][_0xce2c('0xc4')],'custom':![],'options':_0x551d81};_0x16bb8b[_0xce2c('0xb6')](_0xb56e8d);return _0x16bb8b;});}function getBooleanList(_0x3797ce,_0x4dd0be,_0x4ba33d,_0x363dc3,_0x1a6997,_0x5f4050){var _0x19bc41={'method':_0xce2c('0xa8'),'uri':_0x3797ce+_0xce2c('0xae')+_0x363dc3+_0xce2c('0xc0')+_0x1a6997+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xce2c('0xaa')+_0x5f4050,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x19bc41)[_0xce2c('0x27')](function(_0x408808){var _0x53ed07=[];_0x53ed07[_0xce2c('0xb6')]({'name':_0x408808['OptionSet'][_0xce2c('0xc8')][_0xce2c('0xc4')][_0xce2c('0xc5')][_0xce2c('0xc4')],'value':_0xce2c('0xc9')},{'name':_0x408808[_0xce2c('0xc3')][_0xce2c('0xca')][_0xce2c('0xc4')][_0xce2c('0xc5')]['Label'],'value':_0xce2c('0xcb')});var _0x5a56d1={'id':_0x4dd0be+'_'+_0x408808['LogicalName'],'name':_0x408808[_0xce2c('0xc7')]['UserLocalizedLabel'][_0xce2c('0xc4')],'custom':![],'options':_0x53ed07};_0x4ba33d[_0xce2c('0xb6')](_0x5a56d1);return _0x4ba33d;});}function getInputList(_0x27fa0a,_0x3ca884,_0x1fde5c,_0x5946fe,_0x1e242b,_0x547178,_0x205dec){var _0x345462={'method':_0xce2c('0xa8'),'uri':_0x27fa0a+_0xce2c('0xae')+_0x1e242b+_0xce2c('0xc0')+_0x547178+_0xce2c('0xcc')+_0x1fde5c+_0xce2c('0xcd'),'headers':{'Authorization':_0xce2c('0xaa')+_0x205dec,'If-None-Match':null,'OData-Version':_0xce2c('0xab')},'json':!![]};return rp(_0x345462)[_0xce2c('0x27')](function(_0x3c762e){var _0x3c2c7f={'id':_0x3ca884+'_'+_0x3c762e['LogicalName'],'name':_0x3c762e[_0xce2c('0xc7')][_0xce2c('0xc5')]?_0x3c762e[_0xce2c('0xc7')][_0xce2c('0xc5')][_0xce2c('0xc4')]:_0x3c762e[_0xce2c('0xb3')],'custom':![],'options':[]};_0x5946fe[_0xce2c('0xb6')](_0x3c2c7f);return _0x5946fe;});}
\ No newline at end of file
index b8718a0..052a1ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x6a22b8,_0x2582f6){var _0x4e89d4=function(_0x451fe5){while(--_0x451fe5){_0x6a22b8['push'](_0x6a22b8['shift']());}};_0x4e89d4(++_0x2582f6);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x12be22,_0x1c6f73){var _0x3ab9b5=function(_0x1e94c3){while(--_0x1e94c3){_0x12be22['push'](_0x12be22['shift']());}};_0x3ab9b5(++_0x1c6f73);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5982e4..0f3ed9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a01=['jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetDynamics365Account','options','where','attributes','limit','include','model','ShowDynamics365Account','Dynamics365Account','find','map','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x2a01,0x119));var _0x12a0=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x2a01[_0x819464];return _0x49dcc0;};'use strict';var _=require('lodash');var util=require(_0x12a0('0x0'));var moment=require(_0x12a0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12a0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x12a0('0x3'));var logger=require(_0x12a0('0x4'))(_0x12a0('0x5'));var config=require(_0x12a0('0x6'));var jayson=require(_0x12a0('0x7'));var client=jayson[_0x12a0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1074b6,_0xf4e5a7,_0x3f0b88){return new BPromise(function(_0x5a6f7f,_0x32a907){return client[_0x12a0('0x9')](_0x1074b6,_0x3f0b88)[_0x12a0('0xa')](function(_0x3714a9){logger[_0x12a0('0xb')](_0x12a0('0xc'),_0xf4e5a7,_0x12a0('0xd'));logger[_0x12a0('0xe')](_0x12a0('0xf'),_0xf4e5a7,'request\x20sent',JSON[_0x12a0('0x10')](_0x3714a9));if(_0x3714a9[_0x12a0('0x11')]){if(_0x3714a9[_0x12a0('0x11')]['code']===0x1f4){logger[_0x12a0('0x11')](_0x12a0('0xc'),_0xf4e5a7,_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);return _0x32a907(_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);}logger[_0x12a0('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0xf4e5a7,_0x3714a9[_0x12a0('0x11')][_0x12a0('0x12')]);return _0x5a6f7f(_0x3714a9['error']['message']);}else{logger[_0x12a0('0xb')](_0x12a0('0xc'),_0xf4e5a7,_0x12a0('0xd'));_0x5a6f7f(_0x3714a9[_0x12a0('0x13')][_0x12a0('0x12')]);}})[_0x12a0('0x14')](function(_0xa42c10){logger[_0x12a0('0x11')](_0x12a0('0xc'),_0xf4e5a7,_0xa42c10);_0x32a907(_0xa42c10);});});}exports[_0x12a0('0x15')]=function(_0xbaa831){var _0x5dac4b=this;return new Promise(function(_0x18999b,_0xa33638){return db['Dynamics365Account']['findAll']({'raw':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options']['raw']===undefined?!![]:![]:!![],'where':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options'][_0x12a0('0x17')]||null:null,'attributes':_0xbaa831['options']?_0xbaa831[_0x12a0('0x16')][_0x12a0('0x18')]||null:null,'limit':_0xbaa831['options']?_0xbaa831['options'][_0x12a0('0x19')]||null:null,'include':_0xbaa831[_0x12a0('0x16')]?_0xbaa831['options']['include']?_['map'](_0xbaa831['options'][_0x12a0('0x1a')],function(_0x41d898){return{'model':db[_0x41d898[_0x12a0('0x1b')]],'as':_0x41d898['as'],'attributes':_0x41d898[_0x12a0('0x18')],'include':_0x41d898['include']?_['map'](_0x41d898['include'],function(_0x5900bf){return{'model':db[_0x5900bf['model']],'as':_0x5900bf['as'],'attributes':_0x5900bf['attributes'],'include':_0x5900bf['include']?_['map'](_0x5900bf['include'],function(_0x56ce82){return{'model':db[_0x56ce82[_0x12a0('0x1b')]],'as':_0x56ce82['as'],'attributes':_0x56ce82[_0x12a0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x12a0('0xa')](function(_0x36a9f6){logger[_0x12a0('0xb')](_0x12a0('0x15'),_0xbaa831);logger['debug'](_0x12a0('0x15'),_0xbaa831,JSON['stringify'](_0x36a9f6));_0x18999b(_0x36a9f6);})['catch'](function(_0x51b588){logger[_0x12a0('0x11')](_0x12a0('0x15'),_0x51b588[_0x12a0('0x12')],_0xbaa831);_0xa33638(_0x5dac4b[_0x12a0('0x11')](0x1f4,_0x51b588[_0x12a0('0x12')]));});});};exports[_0x12a0('0x1c')]=function(_0x5a4464){var _0x276f02=this;return new Promise(function(_0x44aeaf,_0xc3546e){return db[_0x12a0('0x1d')][_0x12a0('0x1e')]({'raw':_0x5a4464['options']?_0x5a4464[_0x12a0('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5a4464['options']?_0x5a4464[_0x12a0('0x16')][_0x12a0('0x17')]||null:null,'attributes':_0x5a4464[_0x12a0('0x16')]?_0x5a4464[_0x12a0('0x16')][_0x12a0('0x18')]||null:null,'include':_0x5a4464[_0x12a0('0x16')]?_0x5a4464[_0x12a0('0x16')]['include']?_['map'](_0x5a4464[_0x12a0('0x16')][_0x12a0('0x1a')],function(_0x202e13){return{'model':db[_0x202e13[_0x12a0('0x1b')]],'as':_0x202e13['as'],'attributes':_0x202e13[_0x12a0('0x18')],'include':_0x202e13['include']?_[_0x12a0('0x1f')](_0x202e13[_0x12a0('0x1a')],function(_0xaa71be){return{'model':db[_0xaa71be[_0x12a0('0x1b')]],'as':_0xaa71be['as'],'attributes':_0xaa71be['attributes'],'include':_0xaa71be['include']?_[_0x12a0('0x1f')](_0xaa71be[_0x12a0('0x1a')],function(_0x1c430e){return{'model':db[_0x1c430e[_0x12a0('0x1b')]],'as':_0x1c430e['as'],'attributes':_0x1c430e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4adcdb){logger[_0x12a0('0xb')](_0x12a0('0x1c'),_0x5a4464);logger[_0x12a0('0xe')](_0x12a0('0x1c'),_0x5a4464,JSON[_0x12a0('0x10')](_0x4adcdb));_0x44aeaf(_0x4adcdb);})[_0x12a0('0x14')](function(_0x831fed){logger[_0x12a0('0x11')](_0x12a0('0x1c'),_0x831fed[_0x12a0('0x12')],_0x5a4464);_0xc3546e(_0x276f02[_0x12a0('0x11')](0x1f4,_0x831fed[_0x12a0('0x12')]));});});};
\ No newline at end of file
+var _0x18b2=['catch','GetDynamics365Account','Dynamics365Account','options','raw','where','limit','map','attributes','include','model','ShowDynamics365Account','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x8abe9f,_0x7c3ee){var _0x4b7ada=function(_0x5b86a5){while(--_0x5b86a5){_0x8abe9f['push'](_0x8abe9f['shift']());}};_0x4b7ada(++_0x7c3ee);}(_0x18b2,0x12c));var _0x218b=function(_0x27d475,_0xc29411){_0x27d475=_0x27d475-0x0;var _0x56b37b=_0x18b2[_0x27d475];return _0x56b37b;};'use strict';var _=require('lodash');var util=require(_0x218b('0x0'));var moment=require(_0x218b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x218b('0x2'));var db=require(_0x218b('0x3'))['db'];var utils=require(_0x218b('0x4'));var logger=require('../../config/logger')(_0x218b('0x5'));var config=require(_0x218b('0x6'));var jayson=require(_0x218b('0x7'));var client=jayson[_0x218b('0x8')][_0x218b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x367ce1,_0x5486b1,_0x1dcdcf){return new BPromise(function(_0x367b47,_0x469fbc){return client['request'](_0x367ce1,_0x1dcdcf)[_0x218b('0xa')](function(_0x2199b6){logger[_0x218b('0xb')](_0x218b('0xc'),_0x5486b1,_0x218b('0xd'));logger['debug'](_0x218b('0xe'),_0x5486b1,_0x218b('0xd'),JSON[_0x218b('0xf')](_0x2199b6));if(_0x2199b6[_0x218b('0x10')]){if(_0x2199b6['error'][_0x218b('0x11')]===0x1f4){logger[_0x218b('0x10')](_0x218b('0xc'),_0x5486b1,_0x2199b6['error'][_0x218b('0x12')]);return _0x469fbc(_0x2199b6[_0x218b('0x10')][_0x218b('0x12')]);}logger[_0x218b('0x10')](_0x218b('0xc'),_0x5486b1,_0x2199b6[_0x218b('0x10')][_0x218b('0x12')]);return _0x367b47(_0x2199b6['error'][_0x218b('0x12')]);}else{logger[_0x218b('0xb')](_0x218b('0xc'),_0x5486b1,_0x218b('0xd'));_0x367b47(_0x2199b6[_0x218b('0x13')][_0x218b('0x12')]);}})[_0x218b('0x14')](function(_0x33de23){logger[_0x218b('0x10')]('Dynamics365Account,\x20%s,\x20%s',_0x5486b1,_0x33de23);_0x469fbc(_0x33de23);});});}exports[_0x218b('0x15')]=function(_0x4e8a9e){var _0x547072=this;return new Promise(function(_0x1ef059,_0x162ae2){return db[_0x218b('0x16')]['findAll']({'raw':_0x4e8a9e[_0x218b('0x17')]?_0x4e8a9e['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x4e8a9e[_0x218b('0x17')]?_0x4e8a9e[_0x218b('0x17')][_0x218b('0x19')]||null:null,'attributes':_0x4e8a9e['options']?_0x4e8a9e[_0x218b('0x17')]['attributes']||null:null,'limit':_0x4e8a9e[_0x218b('0x17')]?_0x4e8a9e[_0x218b('0x17')][_0x218b('0x1a')]||null:null,'include':_0x4e8a9e['options']?_0x4e8a9e[_0x218b('0x17')]['include']?_[_0x218b('0x1b')](_0x4e8a9e[_0x218b('0x17')]['include'],function(_0x40c0c8){return{'model':db[_0x40c0c8['model']],'as':_0x40c0c8['as'],'attributes':_0x40c0c8[_0x218b('0x1c')],'include':_0x40c0c8['include']?_[_0x218b('0x1b')](_0x40c0c8[_0x218b('0x1d')],function(_0x532112){return{'model':db[_0x532112[_0x218b('0x1e')]],'as':_0x532112['as'],'attributes':_0x532112['attributes'],'include':_0x532112[_0x218b('0x1d')]?_[_0x218b('0x1b')](_0x532112[_0x218b('0x1d')],function(_0x7847f7){return{'model':db[_0x7847f7[_0x218b('0x1e')]],'as':_0x7847f7['as'],'attributes':_0x7847f7[_0x218b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c520b){logger['info'](_0x218b('0x15'),_0x4e8a9e);logger['debug'](_0x218b('0x15'),_0x4e8a9e,JSON[_0x218b('0xf')](_0x5c520b));_0x1ef059(_0x5c520b);})[_0x218b('0x14')](function(_0x2353d9){logger[_0x218b('0x10')]('GetDynamics365Account',_0x2353d9[_0x218b('0x12')],_0x4e8a9e);_0x162ae2(_0x547072[_0x218b('0x10')](0x1f4,_0x2353d9['message']));});});};exports[_0x218b('0x1f')]=function(_0x5a5ac2){var _0x3cd9ea=this;return new Promise(function(_0x20cfc0,_0x46b300){return db[_0x218b('0x16')]['find']({'raw':_0x5a5ac2[_0x218b('0x17')]?_0x5a5ac2['options'][_0x218b('0x18')]===undefined?!![]:![]:!![],'where':_0x5a5ac2[_0x218b('0x17')]?_0x5a5ac2[_0x218b('0x17')]['where']||null:null,'attributes':_0x5a5ac2[_0x218b('0x17')]?_0x5a5ac2[_0x218b('0x17')][_0x218b('0x1c')]||null:null,'include':_0x5a5ac2[_0x218b('0x17')]?_0x5a5ac2[_0x218b('0x17')][_0x218b('0x1d')]?_[_0x218b('0x1b')](_0x5a5ac2[_0x218b('0x17')][_0x218b('0x1d')],function(_0xfd4239){return{'model':db[_0xfd4239[_0x218b('0x1e')]],'as':_0xfd4239['as'],'attributes':_0xfd4239[_0x218b('0x1c')],'include':_0xfd4239[_0x218b('0x1d')]?_['map'](_0xfd4239[_0x218b('0x1d')],function(_0x317cd9){return{'model':db[_0x317cd9['model']],'as':_0x317cd9['as'],'attributes':_0x317cd9[_0x218b('0x1c')],'include':_0x317cd9[_0x218b('0x1d')]?_[_0x218b('0x1b')](_0x317cd9[_0x218b('0x1d')],function(_0x13dc1c){return{'model':db[_0x13dc1c[_0x218b('0x1e')]],'as':_0x13dc1c['as'],'attributes':_0x13dc1c[_0x218b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x289bac){logger[_0x218b('0xb')](_0x218b('0x1f'),_0x5a5ac2);logger['debug'](_0x218b('0x1f'),_0x5a5ac2,JSON[_0x218b('0xf')](_0x289bac));_0x20cfc0(_0x289bac);})[_0x218b('0x14')](function(_0x5ccdbd){logger[_0x218b('0x10')]('ShowDynamics365Account',_0x5ccdbd['message'],_0x5a5ac2);_0x46b300(_0x3cd9ea['error'](0x1f4,_0x5ccdbd['message']));});});};
\ No newline at end of file
index 08ebfad..d2de02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a3e=['/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1a3e,0xad));var _0xe1a3=function(_0x2bdeb7,_0x333bfb){_0x2bdeb7=_0x2bdeb7-0x0;var _0xf286eb=_0x1a3e[_0x2bdeb7];return _0xf286eb;};'use strict';var multer=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var path=require(_0xe1a3('0x2'));var timeout=require(_0xe1a3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe1a3('0x4'));var auth=require(_0xe1a3('0x5'));var interaction=require(_0xe1a3('0x6'));var config=require(_0xe1a3('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0xe1a3('0x8')]('/',auth[_0xe1a3('0x9')](),controller[_0xe1a3('0xa')]);router[_0xe1a3('0x8')](_0xe1a3('0xb'),auth['isAuthenticated'](),controller[_0xe1a3('0xc')]);router[_0xe1a3('0x8')](_0xe1a3('0xd'),auth[_0xe1a3('0x9')](),controller['getFields']);router['get'](_0xe1a3('0xe'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0xf')]);router[_0xe1a3('0x8')]('/:id/descriptions',auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x10')]);router[_0xe1a3('0x11')]('/',auth['isAuthenticated'](),controller[_0xe1a3('0x12')]);router['put'](_0xe1a3('0xb'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x13')]);router[_0xe1a3('0x14')](_0xe1a3('0xb'),auth[_0xe1a3('0x9')](),controller[_0xe1a3('0x15')]);module[_0xe1a3('0x16')]=router;
\ No newline at end of file
+var _0x5e8e=['/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id','show','/:id/fields'];(function(_0x56f00b,_0x15ccd3){var _0xfa647=function(_0x302df9){while(--_0x302df9){_0x56f00b['push'](_0x56f00b['shift']());}};_0xfa647(++_0x15ccd3);}(_0x5e8e,0x1d4));var _0xe5e8=function(_0x12e3b9,_0x460cf6){_0x12e3b9=_0x12e3b9-0x0;var _0x3de075=_0x5e8e[_0x12e3b9];return _0x3de075;};'use strict';var multer=require('multer');var util=require(_0xe5e8('0x0'));var path=require(_0xe5e8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe5e8('0x2'));var router=express[_0xe5e8('0x3')]();var fs_extra=require(_0xe5e8('0x4'));var auth=require(_0xe5e8('0x5'));var interaction=require(_0xe5e8('0x6'));var config=require(_0xe5e8('0x7'));var controller=require(_0xe5e8('0x8'));router['get']('/',auth[_0xe5e8('0x9')](),controller[_0xe5e8('0xa')]);router[_0xe5e8('0xb')](_0xe5e8('0xc'),auth[_0xe5e8('0x9')](),controller[_0xe5e8('0xd')]);router['get'](_0xe5e8('0xe'),auth[_0xe5e8('0x9')](),controller['getFields']);router[_0xe5e8('0xb')]('/:id/subjects',auth[_0xe5e8('0x9')](),controller['getSubjects']);router['get'](_0xe5e8('0xf'),auth['isAuthenticated'](),controller[_0xe5e8('0x10')]);router[_0xe5e8('0x11')]('/',auth['isAuthenticated'](),controller[_0xe5e8('0x12')]);router[_0xe5e8('0x13')](_0xe5e8('0xc'),auth[_0xe5e8('0x9')](),controller[_0xe5e8('0x14')]);router[_0xe5e8('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe5e8('0x16')]=router;
\ No newline at end of file
index dcc0a79..59339bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1157=['exports','STRING','ENUM','incident','sequelize'];(function(_0x337ed3,_0x2f1606){var _0x3fc3e5=function(_0x58b63c){while(--_0x58b63c){_0x337ed3['push'](_0x337ed3['shift']());}};_0x3fc3e5(++_0x2f1606);}(_0x1157,0xe0));var _0x7115=function(_0x516b4e,_0x75e8f3){_0x516b4e=_0x516b4e-0x0;var _0x58d624=_0x1157[_0x516b4e];return _0x58d624;};'use strict';var Sequelize=require(_0x7115('0x0'));module[_0x7115('0x1')]={'name':{'type':Sequelize[_0x7115('0x2')]},'description':{'type':Sequelize[_0x7115('0x2')]},'ticketType':{'type':Sequelize[_0x7115('0x3')](_0x7115('0x4'),'phonecall'),'defaultValue':'incident'}};
\ No newline at end of file
+var _0x0084=['sequelize','exports','incident','phonecall'];(function(_0x31788f,_0x1b12f5){var _0x34cf4e=function(_0x597cd1){while(--_0x597cd1){_0x31788f['push'](_0x31788f['shift']());}};_0x34cf4e(++_0x1b12f5);}(_0x0084,0x1a4));var _0x4008=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0x0084[_0x18776a];return _0x484e4a;};'use strict';var Sequelize=require(_0x4008('0x0'));module[_0x4008('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x4008('0x2'),_0x4008('0x3')),'defaultValue':'incident'}};
\ No newline at end of file
index 46f62c3..0da076f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d4d=['json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','sort','where','filters','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','length','includeAll','find','create','body','findOne','Dynamics365Field','order','pick','getFields','hasOwnProperty','getSubjects','nolimit','getDescriptions','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x4b6ff9,_0xa8b4ac){var _0x53cad0=function(_0x3d90f5){while(--_0x3d90f5){_0x4b6ff9['push'](_0x4b6ff9['shift']());}};_0x53cad0(++_0xa8b4ac);}(_0x6d4d,0x11f));var _0xd6d4=function(_0x42642f,_0x16a458){_0x42642f=_0x42642f-0x0;var _0x57c5e8=_0x6d4d[_0x42642f];return _0x57c5e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6d4('0x1'));var rp=require('request-promise');var moment=require(_0xd6d4('0x2'));var BPromise=require(_0xd6d4('0x3'));var Mustache=require(_0xd6d4('0x4'));var util=require(_0xd6d4('0x5'));var path=require(_0xd6d4('0x6'));var sox=require(_0xd6d4('0x7'));var csv=require(_0xd6d4('0x8'));var ejs=require(_0xd6d4('0x9'));var fs=require('fs');var fs_extra=require(_0xd6d4('0xa'));var _=require(_0xd6d4('0xb'));var squel=require(_0xd6d4('0xc'));var crypto=require(_0xd6d4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd6d4('0x8'));var querystring=require(_0xd6d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xd6d4('0xf'));var authService=require(_0xd6d4('0x10'));var qs=require(_0xd6d4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6d4('0x12'));var logger=require(_0xd6d4('0x13'))(_0xd6d4('0x14'));var utils=require('../../config/utils');var config=require(_0xd6d4('0x15'));var licenseUtil=require(_0xd6d4('0x16'));var db=require(_0xd6d4('0x17'))['db'];function respondWithStatusCode(_0x1e2ce0,_0x52eb54){_0x52eb54=_0x52eb54||0xcc;return function(_0x27eb0a){if(_0x27eb0a){return _0x1e2ce0['sendStatus'](_0x52eb54);}return _0x1e2ce0['status'](_0x52eb54)['end']();};}function respondWithResult(_0xdfb497,_0x192150){_0x192150=_0x192150||0xc8;return function(_0x2d8317){if(_0x2d8317){return _0xdfb497[_0xd6d4('0x18')](_0x192150)[_0xd6d4('0x19')](_0x2d8317);}};}function respondWithFilteredResult(_0x241ea5,_0xfedcdd){return function(_0x44bab4){if(_0x44bab4){var _0x233a64=typeof _0xfedcdd[_0xd6d4('0x1a')]===_0xd6d4('0x1b')&&typeof _0xfedcdd[_0xd6d4('0x1c')]===_0xd6d4('0x1b');var _0x564112=_0x44bab4[_0xd6d4('0x1d')];var _0x2de46c=_0x233a64?0x0:_0xfedcdd[_0xd6d4('0x1a')];var _0x19b475=_0x233a64?_0x44bab4['count']:_0xfedcdd[_0xd6d4('0x1a')]+_0xfedcdd[_0xd6d4('0x1c')];var _0x1f6cab;if(_0x19b475>=_0x564112){_0x19b475=_0x564112;_0x1f6cab=0xc8;}else{_0x1f6cab=0xce;}_0x241ea5[_0xd6d4('0x18')](_0x1f6cab);return _0x241ea5[_0xd6d4('0x1e')]('Content-Range',_0x2de46c+'-'+_0x19b475+'/'+_0x564112)[_0xd6d4('0x19')](_0x44bab4);}return null;};}function patchUpdates(_0x12d2f0){return function(_0x8bf3eb){try{jsonpatch[_0xd6d4('0x1f')](_0x8bf3eb,_0x12d2f0,!![]);}catch(_0x3fe811){return BPromise[_0xd6d4('0x20')](_0x3fe811);}return _0x8bf3eb['save']();};}function saveUpdates(_0x311dc5,_0x31132a){return function(_0x2f6c2e){if(_0x2f6c2e){return _0x2f6c2e[_0xd6d4('0x21')](_0x311dc5)[_0xd6d4('0x22')](function(_0x14dc53){return _0x14dc53;});}return null;};}function removeEntity(_0x13ad41,_0x1f41c0){return function(_0x5cce8e){if(_0x5cce8e){return _0x5cce8e[_0xd6d4('0x23')]()['then'](function(){_0x13ad41[_0xd6d4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e201e,_0x1f329f){return function(_0x1b2662){if(!_0x1b2662){_0x4e201e['sendStatus'](0x194);}return _0x1b2662;};}function handleError(_0x513b69,_0x53ee1c){_0x53ee1c=_0x53ee1c||0x1f4;return function(_0x4a42ae){logger[_0xd6d4('0x24')](_0x4a42ae[_0xd6d4('0x25')]);if(_0x4a42ae['name']){delete _0x4a42ae[_0xd6d4('0x26')];}_0x513b69[_0xd6d4('0x18')](_0x53ee1c)['send'](_0x4a42ae);};}exports[_0xd6d4('0x27')]=function(_0x4b66df,_0x4d4b96){var _0x5f18fe={},_0x331d5f={},_0x49efc7={'count':0x0,'rows':[]};var _0x4f2371=_['map'](db[_0xd6d4('0x28')][_0xd6d4('0x29')],function(_0x1a2933){return{'name':_0x1a2933[_0xd6d4('0x2a')],'type':_0x1a2933[_0xd6d4('0x2b')][_0xd6d4('0x2c')]};});_0x331d5f['model']=_[_0xd6d4('0x2d')](_0x4f2371,_0xd6d4('0x26'));_0x331d5f[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x4b66df[_0xd6d4('0x2e')]);_0x331d5f['filters']=_[_0xd6d4('0x30')](_0x331d5f[_0xd6d4('0x31')],_0x331d5f['query']);_0x5f18fe[_0xd6d4('0x32')]=_['intersection'](_0x331d5f[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x4b66df[_0xd6d4('0x2e')]['fields']));_0x5f18fe[_0xd6d4('0x32')]=_0x5f18fe[_0xd6d4('0x32')]['length']?_0x5f18fe[_0xd6d4('0x32')]:_0x331d5f[_0xd6d4('0x31')];if(!_0x4b66df[_0xd6d4('0x2e')]['hasOwnProperty']('nolimit')){_0x5f18fe[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x4b66df['query'][_0xd6d4('0x1c')]);_0x5f18fe[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x4b66df['query'][_0xd6d4('0x1a')]);}_0x5f18fe['order']=qs[_0xd6d4('0x34')](_0x4b66df[_0xd6d4('0x2e')]['sort']);_0x5f18fe[_0xd6d4('0x35')]=qs[_0xd6d4('0x36')](_['pick'](_0x4b66df[_0xd6d4('0x2e')],_0x331d5f[_0xd6d4('0x36')]),_0x4f2371);if(_0x4b66df[_0xd6d4('0x2e')]['filter']){_0x5f18fe[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0x5f18fe[_0xd6d4('0x35')],{'$or':_[_0xd6d4('0x2d')](_0x4f2371,function(_0x175e75){if(_0x175e75[_0xd6d4('0x2b')]!==_0xd6d4('0x38')){var _0x4e573e={};_0x4e573e[_0x175e75[_0xd6d4('0x26')]]={'$like':'%'+_0x4b66df[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x4e573e;}})});}_0x5f18fe=_[_0xd6d4('0x37')]({},_0x5f18fe,_0x4b66df[_0xd6d4('0x3a')]);var _0x3cdc57={'where':_0x5f18fe[_0xd6d4('0x35')]};return db[_0xd6d4('0x28')][_0xd6d4('0x1d')](_0x3cdc57)[_0xd6d4('0x22')](function(_0x10648d){_0x49efc7['count']=_0x10648d;if(_0x4b66df[_0xd6d4('0x2e')]['includeAll']){_0x5f18fe[_0xd6d4('0x3b')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xd6d4('0x3c')](_0x5f18fe);})[_0xd6d4('0x22')](function(_0x26258e){_0x49efc7['rows']=_0x26258e;return _0x49efc7;})[_0xd6d4('0x22')](respondWithFilteredResult(_0x4d4b96,_0x5f18fe))[_0xd6d4('0x3d')](handleError(_0x4d4b96,null));};exports[_0xd6d4('0x3e')]=function(_0x5040c7,_0x15c30e){var _0x2562aa={'raw':![],'where':{'id':_0x5040c7[_0xd6d4('0x3f')]['id']}},_0x4486d6={};_0x4486d6['model']=_[_0xd6d4('0x2f')](db[_0xd6d4('0x28')][_0xd6d4('0x29')]);_0x4486d6[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x5040c7[_0xd6d4('0x2e')]);_0x4486d6[_0xd6d4('0x36')]=_['intersection'](_0x4486d6[_0xd6d4('0x31')],_0x4486d6['query']);_0x2562aa[_0xd6d4('0x32')]=_[_0xd6d4('0x30')](_0x4486d6[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x5040c7[_0xd6d4('0x2e')][_0xd6d4('0x33')]));_0x2562aa['attributes']=_0x2562aa['attributes'][_0xd6d4('0x40')]?_0x2562aa[_0xd6d4('0x32')]:_0x4486d6[_0xd6d4('0x31')];if(_0x5040c7[_0xd6d4('0x2e')][_0xd6d4('0x41')]){_0x2562aa['include']=[{'all':!![]}];}_0x2562aa=_[_0xd6d4('0x37')]({},_0x2562aa,_0x5040c7[_0xd6d4('0x3a')]);return db[_0xd6d4('0x28')][_0xd6d4('0x42')](_0x2562aa)[_0xd6d4('0x22')](handleEntityNotFound(_0x15c30e,null))[_0xd6d4('0x22')](respondWithResult(_0x15c30e,null))[_0xd6d4('0x3d')](handleError(_0x15c30e,null));};exports[_0xd6d4('0x43')]=function(_0x191112,_0x498907){return db[_0xd6d4('0x28')][_0xd6d4('0x43')](_0x191112['body'],{})[_0xd6d4('0x22')](respondWithResult(_0x498907,0xc9))[_0xd6d4('0x3d')](handleError(_0x498907,null));};exports['update']=function(_0x1482db,_0x5827d7){if(_0x1482db['body']['id']){delete _0x1482db[_0xd6d4('0x44')]['id'];}return db['Dynamics365Configuration'][_0xd6d4('0x42')]({'where':{'id':_0x1482db[_0xd6d4('0x3f')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x5827d7,null))[_0xd6d4('0x22')](saveUpdates(_0x1482db[_0xd6d4('0x44')],null))[_0xd6d4('0x22')](respondWithResult(_0x5827d7,null))[_0xd6d4('0x3d')](handleError(_0x5827d7,null));};exports[_0xd6d4('0x23')]=function(_0x2db78f,_0x14718a){return db[_0xd6d4('0x28')][_0xd6d4('0x42')]({'where':{'id':_0x2db78f['params']['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x14718a,null))[_0xd6d4('0x22')](removeEntity(_0x14718a,null))[_0xd6d4('0x3d')](handleError(_0x14718a,null));};exports['getFields']=function(_0x383649,_0x36100d,_0x31c5c2){var _0xc1913b={};var _0x29776a={};var _0x3d6b22;var _0x5e8839;return db[_0xd6d4('0x28')][_0xd6d4('0x45')]({'where':{'id':_0x383649['params']['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x36100d,null))[_0xd6d4('0x22')](function(_0x5b9881){if(_0x5b9881){_0x3d6b22=_0x5b9881;_0x29776a[_0xd6d4('0x31')]=_[_0xd6d4('0x2f')](db[_0xd6d4('0x46')][_0xd6d4('0x29')]);_0x29776a[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x383649[_0xd6d4('0x2e')]);_0x29776a[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0x29776a['model'],_0x29776a['query']);_0xc1913b[_0xd6d4('0x32')]=_['intersection'](_0x29776a[_0xd6d4('0x31')],qs[_0xd6d4('0x33')](_0x383649[_0xd6d4('0x2e')]['fields']));_0xc1913b[_0xd6d4('0x32')]=_0xc1913b[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0xc1913b[_0xd6d4('0x32')]:_0x29776a[_0xd6d4('0x31')];_0xc1913b[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x34')]);_0xc1913b['where']=qs['filters'](_[_0xd6d4('0x48')](_0x383649[_0xd6d4('0x2e')],_0x29776a[_0xd6d4('0x36')]));if(_0x383649['query'][_0xd6d4('0x39')]){_0xc1913b[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0xc1913b['where'],{'$or':_['map'](_0xc1913b[_0xd6d4('0x32')],function(_0x349b05){var _0x48e973={};_0x48e973[_0x349b05]={'$like':'%'+_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x48e973;})});}_0xc1913b=_[_0xd6d4('0x37')]({},_0xc1913b,_0x383649['options']);return _0x3d6b22[_0xd6d4('0x49')](_0xc1913b);}})['then'](function(_0x2ef623){if(_0x2ef623){_0x5e8839=_0x2ef623[_0xd6d4('0x40')];if(!_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x4a')]('nolimit')){_0xc1913b[_0xd6d4('0x1c')]=qs['limit'](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x1c')]);_0xc1913b[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x383649[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x3d6b22[_0xd6d4('0x49')](_0xc1913b);}})['then'](function(_0x4799ee){if(_0x4799ee){return _0x4799ee?{'count':_0x5e8839,'rows':_0x4799ee}:null;}})['then'](respondWithResult(_0x36100d,null))['catch'](handleError(_0x36100d,null));};exports[_0xd6d4('0x4b')]=function(_0x1c898e,_0x1bfce3,_0x4b2b85){var _0x9cf133={};var _0x31f065={};var _0x2482fc;var _0x1952ab;return db['Dynamics365Configuration'][_0xd6d4('0x45')]({'where':{'id':_0x1c898e[_0xd6d4('0x3f')]['id']}})[_0xd6d4('0x22')](handleEntityNotFound(_0x1bfce3,null))[_0xd6d4('0x22')](function(_0x165de4){if(_0x165de4){_0x2482fc=_0x165de4;_0x31f065[_0xd6d4('0x31')]=_[_0xd6d4('0x2f')](db['Dynamics365Field'][_0xd6d4('0x29')]);_0x31f065[_0xd6d4('0x2e')]=_[_0xd6d4('0x2f')](_0x1c898e[_0xd6d4('0x2e')]);_0x31f065[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0x31f065['model'],_0x31f065[_0xd6d4('0x2e')]);_0x9cf133[_0xd6d4('0x32')]=_[_0xd6d4('0x30')](_0x31f065['model'],qs['fields'](_0x1c898e['query']['fields']));_0x9cf133[_0xd6d4('0x32')]=_0x9cf133[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0x9cf133[_0xd6d4('0x32')]:_0x31f065['model'];_0x9cf133[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x1c898e['query'][_0xd6d4('0x34')]);_0x9cf133['where']=qs[_0xd6d4('0x36')](_[_0xd6d4('0x48')](_0x1c898e[_0xd6d4('0x2e')],_0x31f065[_0xd6d4('0x36')]));if(_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x39')]){_0x9cf133[_0xd6d4('0x35')]=_[_0xd6d4('0x37')](_0x9cf133[_0xd6d4('0x35')],{'$or':_['map'](_0x9cf133['attributes'],function(_0x26e8e2){var _0x3fa954={};_0x3fa954[_0x26e8e2]={'$like':'%'+_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x39')]+'%'};return _0x3fa954;})});}_0x9cf133=_[_0xd6d4('0x37')]({},_0x9cf133,_0x1c898e['options']);return _0x2482fc[_0xd6d4('0x4b')](_0x9cf133);}})['then'](function(_0x3433d8){if(_0x3433d8){_0x1952ab=_0x3433d8[_0xd6d4('0x40')];if(!_0x1c898e['query'][_0xd6d4('0x4a')](_0xd6d4('0x4c'))){_0x9cf133[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x1c')]);_0x9cf133[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x1c898e[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x2482fc[_0xd6d4('0x4b')](_0x9cf133);}})[_0xd6d4('0x22')](function(_0x105032){if(_0x105032){return _0x105032?{'count':_0x1952ab,'rows':_0x105032}:null;}})[_0xd6d4('0x22')](respondWithResult(_0x1bfce3,null))[_0xd6d4('0x3d')](handleError(_0x1bfce3,null));};exports['getDescriptions']=function(_0x9e74ef,_0xa28944,_0x55b9a9){var _0x54347b={};var _0xdf8f7b={};var _0x40c9d5;var _0x5b6e76;return db[_0xd6d4('0x28')][_0xd6d4('0x45')]({'where':{'id':_0x9e74ef[_0xd6d4('0x3f')]['id']}})['then'](handleEntityNotFound(_0xa28944,null))[_0xd6d4('0x22')](function(_0x2d53c6){if(_0x2d53c6){_0x40c9d5=_0x2d53c6;_0xdf8f7b[_0xd6d4('0x31')]=_['keys'](db[_0xd6d4('0x46')][_0xd6d4('0x29')]);_0xdf8f7b['query']=_[_0xd6d4('0x2f')](_0x9e74ef[_0xd6d4('0x2e')]);_0xdf8f7b[_0xd6d4('0x36')]=_[_0xd6d4('0x30')](_0xdf8f7b['model'],_0xdf8f7b[_0xd6d4('0x2e')]);_0x54347b[_0xd6d4('0x32')]=_['intersection'](_0xdf8f7b[_0xd6d4('0x31')],qs['fields'](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x33')]));_0x54347b[_0xd6d4('0x32')]=_0x54347b[_0xd6d4('0x32')][_0xd6d4('0x40')]?_0x54347b[_0xd6d4('0x32')]:_0xdf8f7b['model'];_0x54347b[_0xd6d4('0x47')]=qs[_0xd6d4('0x34')](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x34')]);_0x54347b[_0xd6d4('0x35')]=qs[_0xd6d4('0x36')](_['pick'](_0x9e74ef[_0xd6d4('0x2e')],_0xdf8f7b[_0xd6d4('0x36')]));if(_0x9e74ef['query']['filter']){_0x54347b[_0xd6d4('0x35')]=_['merge'](_0x54347b['where'],{'$or':_[_0xd6d4('0x2d')](_0x54347b[_0xd6d4('0x32')],function(_0x44571a){var _0x318762={};_0x318762[_0x44571a]={'$like':'%'+_0x9e74ef[_0xd6d4('0x2e')]['filter']+'%'};return _0x318762;})});}_0x54347b=_[_0xd6d4('0x37')]({},_0x54347b,_0x9e74ef[_0xd6d4('0x3a')]);return _0x40c9d5[_0xd6d4('0x4d')](_0x54347b);}})[_0xd6d4('0x22')](function(_0x59d7c7){if(_0x59d7c7){_0x5b6e76=_0x59d7c7['length'];if(!_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x4a')](_0xd6d4('0x4c'))){_0x54347b[_0xd6d4('0x1c')]=qs[_0xd6d4('0x1c')](_0x9e74ef[_0xd6d4('0x2e')]['limit']);_0x54347b[_0xd6d4('0x1a')]=qs[_0xd6d4('0x1a')](_0x9e74ef[_0xd6d4('0x2e')][_0xd6d4('0x1a')]);}return _0x40c9d5[_0xd6d4('0x4d')](_0x54347b);}})[_0xd6d4('0x22')](function(_0x2b0a19){if(_0x2b0a19){return _0x2b0a19?{'count':_0x5b6e76,'rows':_0x2b0a19}:null;}})[_0xd6d4('0x22')](respondWithResult(_0xa28944,null))['catch'](handleError(_0xa28944,null));};
\ No newline at end of file
+var _0xdc01=['util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','type','options','Dynamics365Configuration','includeAll','include','findAll','catch','find','create','body','params','getFields','findOne','Dynamics365Field','order','sort','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x1f3be3,_0xab0907){var _0x180433=function(_0x57a296){while(--_0x57a296){_0x1f3be3['push'](_0x1f3be3['shift']());}};_0x180433(++_0xab0907);}(_0xdc01,0x92));var _0x1dc0=function(_0xc02f4,_0x1e1479){_0xc02f4=_0xc02f4-0x0;var _0x473b09=_0xdc01[_0xc02f4];return _0x473b09;};'use strict';var emlformat=require(_0x1dc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1dc0('0x1'));var jsonpatch=require(_0x1dc0('0x2'));var rp=require('request-promise');var moment=require(_0x1dc0('0x3'));var BPromise=require(_0x1dc0('0x4'));var Mustache=require(_0x1dc0('0x5'));var util=require(_0x1dc0('0x6'));var path=require(_0x1dc0('0x7'));var sox=require(_0x1dc0('0x8'));var csv=require(_0x1dc0('0x9'));var ejs=require(_0x1dc0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1dc0('0xb'));var squel=require('squel');var crypto=require(_0x1dc0('0xc'));var jsforce=require(_0x1dc0('0xd'));var deskjs=require(_0x1dc0('0xe'));var toCsv=require(_0x1dc0('0x9'));var querystring=require('querystring');var Papa=require(_0x1dc0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1dc0('0x10'));var as=require(_0x1dc0('0x11'));var hardwareService=require(_0x1dc0('0x12'));var logger=require('../../config/logger')(_0x1dc0('0x13'));var utils=require(_0x1dc0('0x14'));var config=require(_0x1dc0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1dc0('0x16'))['db'];function respondWithStatusCode(_0x5b1b3e,_0x2f668e){_0x2f668e=_0x2f668e||0xcc;return function(_0x38230a){if(_0x38230a){return _0x5b1b3e['sendStatus'](_0x2f668e);}return _0x5b1b3e[_0x1dc0('0x17')](_0x2f668e)[_0x1dc0('0x18')]();};}function respondWithResult(_0x192b67,_0x185256){_0x185256=_0x185256||0xc8;return function(_0x44c3c4){if(_0x44c3c4){return _0x192b67[_0x1dc0('0x17')](_0x185256)[_0x1dc0('0x19')](_0x44c3c4);}};}function respondWithFilteredResult(_0x2fedbf,_0x4b7406){return function(_0xa3a537){if(_0xa3a537){var _0x4ab7cb=typeof _0x4b7406[_0x1dc0('0x1a')]===_0x1dc0('0x1b')&&typeof _0x4b7406[_0x1dc0('0x1c')]==='undefined';var _0x579dab=_0xa3a537[_0x1dc0('0x1d')];var _0x157b4c=_0x4ab7cb?0x0:_0x4b7406['offset'];var _0x26118d=_0x4ab7cb?_0xa3a537[_0x1dc0('0x1d')]:_0x4b7406[_0x1dc0('0x1a')]+_0x4b7406[_0x1dc0('0x1c')];var _0x3853c7;if(_0x26118d>=_0x579dab){_0x26118d=_0x579dab;_0x3853c7=0xc8;}else{_0x3853c7=0xce;}_0x2fedbf[_0x1dc0('0x17')](_0x3853c7);return _0x2fedbf['set']('Content-Range',_0x157b4c+'-'+_0x26118d+'/'+_0x579dab)[_0x1dc0('0x19')](_0xa3a537);}return null;};}function patchUpdates(_0x28abda){return function(_0x1f0267){try{jsonpatch[_0x1dc0('0x1e')](_0x1f0267,_0x28abda,!![]);}catch(_0x2a5a3d){return BPromise[_0x1dc0('0x1f')](_0x2a5a3d);}return _0x1f0267[_0x1dc0('0x20')]();};}function saveUpdates(_0x3a87a0,_0x5a53ca){return function(_0x41ff5f){if(_0x41ff5f){return _0x41ff5f[_0x1dc0('0x21')](_0x3a87a0)[_0x1dc0('0x22')](function(_0x2e98e8){return _0x2e98e8;});}return null;};}function removeEntity(_0x554591,_0x2a6f4c){return function(_0x158b01){if(_0x158b01){return _0x158b01[_0x1dc0('0x23')]()[_0x1dc0('0x22')](function(){_0x554591[_0x1dc0('0x17')](0xcc)[_0x1dc0('0x18')]();});}};}function handleEntityNotFound(_0x4f5526,_0x3e2b33){return function(_0xf6c20e){if(!_0xf6c20e){_0x4f5526['sendStatus'](0x194);}return _0xf6c20e;};}function handleError(_0x6cba9c,_0x5e7961){_0x5e7961=_0x5e7961||0x1f4;return function(_0x154ef0){logger[_0x1dc0('0x24')](_0x154ef0[_0x1dc0('0x25')]);if(_0x154ef0['name']){delete _0x154ef0['name'];}_0x6cba9c[_0x1dc0('0x17')](_0x5e7961)[_0x1dc0('0x26')](_0x154ef0);};}exports[_0x1dc0('0x27')]=function(_0x3fe719,_0xd7f2f8){var _0x47c62d={},_0x344006={},_0x2b5175={'count':0x0,'rows':[]};var _0x4141c1=_[_0x1dc0('0x28')](db['Dynamics365Configuration'][_0x1dc0('0x29')],function(_0x2fd9fe){return{'name':_0x2fd9fe[_0x1dc0('0x2a')],'type':_0x2fd9fe['type']['key']};});_0x344006[_0x1dc0('0x2b')]=_[_0x1dc0('0x28')](_0x4141c1,_0x1dc0('0x2c'));_0x344006[_0x1dc0('0x2d')]=_[_0x1dc0('0x2e')](_0x3fe719[_0x1dc0('0x2d')]);_0x344006[_0x1dc0('0x2f')]=_[_0x1dc0('0x30')](_0x344006['model'],_0x344006['query']);_0x47c62d[_0x1dc0('0x31')]=_['intersection'](_0x344006[_0x1dc0('0x2b')],qs[_0x1dc0('0x32')](_0x3fe719[_0x1dc0('0x2d')]['fields']));_0x47c62d[_0x1dc0('0x31')]=_0x47c62d['attributes'][_0x1dc0('0x33')]?_0x47c62d[_0x1dc0('0x31')]:_0x344006[_0x1dc0('0x2b')];if(!_0x3fe719['query'][_0x1dc0('0x34')]('nolimit')){_0x47c62d[_0x1dc0('0x1c')]=qs[_0x1dc0('0x1c')](_0x3fe719[_0x1dc0('0x2d')][_0x1dc0('0x1c')]);_0x47c62d[_0x1dc0('0x1a')]=qs[_0x1dc0('0x1a')](_0x3fe719[_0x1dc0('0x2d')][_0x1dc0('0x1a')]);}_0x47c62d['order']=qs['sort'](_0x3fe719[_0x1dc0('0x2d')]['sort']);_0x47c62d[_0x1dc0('0x35')]=qs[_0x1dc0('0x2f')](_[_0x1dc0('0x36')](_0x3fe719[_0x1dc0('0x2d')],_0x344006[_0x1dc0('0x2f')]),_0x4141c1);if(_0x3fe719['query'][_0x1dc0('0x37')]){_0x47c62d[_0x1dc0('0x35')]=_[_0x1dc0('0x38')](_0x47c62d[_0x1dc0('0x35')],{'$or':_['map'](_0x4141c1,function(_0x32f38d){if(_0x32f38d[_0x1dc0('0x39')]!=='VIRTUAL'){var _0x390a59={};_0x390a59[_0x32f38d['name']]={'$like':'%'+_0x3fe719[_0x1dc0('0x2d')]['filter']+'%'};return _0x390a59;}})});}_0x47c62d=_['merge']({},_0x47c62d,_0x3fe719[_0x1dc0('0x3a')]);var _0x6af4e1={'where':_0x47c62d[_0x1dc0('0x35')]};return db[_0x1dc0('0x3b')][_0x1dc0('0x1d')](_0x6af4e1)[_0x1dc0('0x22')](function(_0x3784fd){_0x2b5175[_0x1dc0('0x1d')]=_0x3784fd;if(_0x3fe719['query'][_0x1dc0('0x3c')]){_0x47c62d[_0x1dc0('0x3d')]=[{'all':!![]}];}return db[_0x1dc0('0x3b')][_0x1dc0('0x3e')](_0x47c62d);})[_0x1dc0('0x22')](function(_0xbd69f4){_0x2b5175['rows']=_0xbd69f4;return _0x2b5175;})[_0x1dc0('0x22')](respondWithFilteredResult(_0xd7f2f8,_0x47c62d))[_0x1dc0('0x3f')](handleError(_0xd7f2f8,null));};exports['show']=function(_0x526981,_0x2564fa){var _0x208d42={'raw':![],'where':{'id':_0x526981['params']['id']}},_0x769ac5={};_0x769ac5['model']=_[_0x1dc0('0x2e')](db[_0x1dc0('0x3b')][_0x1dc0('0x29')]);_0x769ac5[_0x1dc0('0x2d')]=_['keys'](_0x526981['query']);_0x769ac5['filters']=_[_0x1dc0('0x30')](_0x769ac5['model'],_0x769ac5['query']);_0x208d42[_0x1dc0('0x31')]=_[_0x1dc0('0x30')](_0x769ac5[_0x1dc0('0x2b')],qs['fields'](_0x526981['query'][_0x1dc0('0x32')]));_0x208d42[_0x1dc0('0x31')]=_0x208d42[_0x1dc0('0x31')][_0x1dc0('0x33')]?_0x208d42[_0x1dc0('0x31')]:_0x769ac5['model'];if(_0x526981[_0x1dc0('0x2d')][_0x1dc0('0x3c')]){_0x208d42['include']=[{'all':!![]}];}_0x208d42=_['merge']({},_0x208d42,_0x526981[_0x1dc0('0x3a')]);return db[_0x1dc0('0x3b')][_0x1dc0('0x40')](_0x208d42)[_0x1dc0('0x22')](handleEntityNotFound(_0x2564fa,null))[_0x1dc0('0x22')](respondWithResult(_0x2564fa,null))[_0x1dc0('0x3f')](handleError(_0x2564fa,null));};exports['create']=function(_0x5231cc,_0x4782fa){return db[_0x1dc0('0x3b')][_0x1dc0('0x41')](_0x5231cc[_0x1dc0('0x42')],{})[_0x1dc0('0x22')](respondWithResult(_0x4782fa,0xc9))['catch'](handleError(_0x4782fa,null));};exports['update']=function(_0x2d6fab,_0x3d5860){if(_0x2d6fab[_0x1dc0('0x42')]['id']){delete _0x2d6fab[_0x1dc0('0x42')]['id'];}return db[_0x1dc0('0x3b')]['find']({'where':{'id':_0x2d6fab['params']['id']}})[_0x1dc0('0x22')](handleEntityNotFound(_0x3d5860,null))[_0x1dc0('0x22')](saveUpdates(_0x2d6fab[_0x1dc0('0x42')],null))[_0x1dc0('0x22')](respondWithResult(_0x3d5860,null))[_0x1dc0('0x3f')](handleError(_0x3d5860,null));};exports[_0x1dc0('0x23')]=function(_0x1c186f,_0x482e06){return db['Dynamics365Configuration']['find']({'where':{'id':_0x1c186f[_0x1dc0('0x43')]['id']}})[_0x1dc0('0x22')](handleEntityNotFound(_0x482e06,null))['then'](removeEntity(_0x482e06,null))[_0x1dc0('0x3f')](handleError(_0x482e06,null));};exports[_0x1dc0('0x44')]=function(_0x5c02c1,_0x22c98b,_0x413cb9){var _0x172997={};var _0x1c374c={};var _0x896bf4;var _0x186166;return db[_0x1dc0('0x3b')][_0x1dc0('0x45')]({'where':{'id':_0x5c02c1['params']['id']}})[_0x1dc0('0x22')](handleEntityNotFound(_0x22c98b,null))[_0x1dc0('0x22')](function(_0x285bee){if(_0x285bee){_0x896bf4=_0x285bee;_0x1c374c['model']=_[_0x1dc0('0x2e')](db[_0x1dc0('0x46')][_0x1dc0('0x29')]);_0x1c374c[_0x1dc0('0x2d')]=_[_0x1dc0('0x2e')](_0x5c02c1[_0x1dc0('0x2d')]);_0x1c374c[_0x1dc0('0x2f')]=_[_0x1dc0('0x30')](_0x1c374c[_0x1dc0('0x2b')],_0x1c374c[_0x1dc0('0x2d')]);_0x172997[_0x1dc0('0x31')]=_[_0x1dc0('0x30')](_0x1c374c['model'],qs['fields'](_0x5c02c1[_0x1dc0('0x2d')][_0x1dc0('0x32')]));_0x172997[_0x1dc0('0x31')]=_0x172997[_0x1dc0('0x31')]['length']?_0x172997[_0x1dc0('0x31')]:_0x1c374c[_0x1dc0('0x2b')];_0x172997[_0x1dc0('0x47')]=qs[_0x1dc0('0x48')](_0x5c02c1[_0x1dc0('0x2d')][_0x1dc0('0x48')]);_0x172997[_0x1dc0('0x35')]=qs[_0x1dc0('0x2f')](_[_0x1dc0('0x36')](_0x5c02c1[_0x1dc0('0x2d')],_0x1c374c[_0x1dc0('0x2f')]));if(_0x5c02c1[_0x1dc0('0x2d')]['filter']){_0x172997['where']=_['merge'](_0x172997[_0x1dc0('0x35')],{'$or':_['map'](_0x172997[_0x1dc0('0x31')],function(_0x424455){var _0x588db3={};_0x588db3[_0x424455]={'$like':'%'+_0x5c02c1['query'][_0x1dc0('0x37')]+'%'};return _0x588db3;})});}_0x172997=_['merge']({},_0x172997,_0x5c02c1['options']);return _0x896bf4[_0x1dc0('0x44')](_0x172997);}})[_0x1dc0('0x22')](function(_0x54c47e){if(_0x54c47e){_0x186166=_0x54c47e[_0x1dc0('0x33')];if(!_0x5c02c1['query'][_0x1dc0('0x34')](_0x1dc0('0x49'))){_0x172997['limit']=qs[_0x1dc0('0x1c')](_0x5c02c1[_0x1dc0('0x2d')]['limit']);_0x172997[_0x1dc0('0x1a')]=qs[_0x1dc0('0x1a')](_0x5c02c1[_0x1dc0('0x2d')][_0x1dc0('0x1a')]);}return _0x896bf4[_0x1dc0('0x44')](_0x172997);}})[_0x1dc0('0x22')](function(_0x2033a2){if(_0x2033a2){return _0x2033a2?{'count':_0x186166,'rows':_0x2033a2}:null;}})[_0x1dc0('0x22')](respondWithResult(_0x22c98b,null))['catch'](handleError(_0x22c98b,null));};exports[_0x1dc0('0x4a')]=function(_0x9f9e82,_0x44110a,_0x20f7fe){var _0x45c2dc={};var _0x379b17={};var _0xc33b40;var _0x1af448;return db[_0x1dc0('0x3b')][_0x1dc0('0x45')]({'where':{'id':_0x9f9e82[_0x1dc0('0x43')]['id']}})[_0x1dc0('0x22')](handleEntityNotFound(_0x44110a,null))[_0x1dc0('0x22')](function(_0x1f7f9c){if(_0x1f7f9c){_0xc33b40=_0x1f7f9c;_0x379b17[_0x1dc0('0x2b')]=_[_0x1dc0('0x2e')](db[_0x1dc0('0x46')]['rawAttributes']);_0x379b17[_0x1dc0('0x2d')]=_[_0x1dc0('0x2e')](_0x9f9e82[_0x1dc0('0x2d')]);_0x379b17['filters']=_[_0x1dc0('0x30')](_0x379b17[_0x1dc0('0x2b')],_0x379b17[_0x1dc0('0x2d')]);_0x45c2dc[_0x1dc0('0x31')]=_[_0x1dc0('0x30')](_0x379b17[_0x1dc0('0x2b')],qs[_0x1dc0('0x32')](_0x9f9e82[_0x1dc0('0x2d')][_0x1dc0('0x32')]));_0x45c2dc['attributes']=_0x45c2dc[_0x1dc0('0x31')][_0x1dc0('0x33')]?_0x45c2dc[_0x1dc0('0x31')]:_0x379b17[_0x1dc0('0x2b')];_0x45c2dc[_0x1dc0('0x47')]=qs[_0x1dc0('0x48')](_0x9f9e82[_0x1dc0('0x2d')][_0x1dc0('0x48')]);_0x45c2dc[_0x1dc0('0x35')]=qs[_0x1dc0('0x2f')](_[_0x1dc0('0x36')](_0x9f9e82[_0x1dc0('0x2d')],_0x379b17[_0x1dc0('0x2f')]));if(_0x9f9e82[_0x1dc0('0x2d')][_0x1dc0('0x37')]){_0x45c2dc[_0x1dc0('0x35')]=_['merge'](_0x45c2dc['where'],{'$or':_[_0x1dc0('0x28')](_0x45c2dc[_0x1dc0('0x31')],function(_0x37f777){var _0x165e5d={};_0x165e5d[_0x37f777]={'$like':'%'+_0x9f9e82[_0x1dc0('0x2d')][_0x1dc0('0x37')]+'%'};return _0x165e5d;})});}_0x45c2dc=_[_0x1dc0('0x38')]({},_0x45c2dc,_0x9f9e82[_0x1dc0('0x3a')]);return _0xc33b40[_0x1dc0('0x4a')](_0x45c2dc);}})[_0x1dc0('0x22')](function(_0x44ce79){if(_0x44ce79){_0x1af448=_0x44ce79[_0x1dc0('0x33')];if(!_0x9f9e82[_0x1dc0('0x2d')]['hasOwnProperty']('nolimit')){_0x45c2dc[_0x1dc0('0x1c')]=qs[_0x1dc0('0x1c')](_0x9f9e82[_0x1dc0('0x2d')][_0x1dc0('0x1c')]);_0x45c2dc[_0x1dc0('0x1a')]=qs['offset'](_0x9f9e82['query'][_0x1dc0('0x1a')]);}return _0xc33b40[_0x1dc0('0x4a')](_0x45c2dc);}})[_0x1dc0('0x22')](function(_0x1e2f59){if(_0x1e2f59){return _0x1e2f59?{'count':_0x1af448,'rows':_0x1e2f59}:null;}})[_0x1dc0('0x22')](respondWithResult(_0x44110a,null))[_0x1dc0('0x3f')](handleError(_0x44110a,null));};exports['getDescriptions']=function(_0x1025b9,_0x32fbb8,_0x3e5f45){var _0x12d65c={};var _0x552c10={};var _0x466a67;var _0x1a5845;return db['Dynamics365Configuration'][_0x1dc0('0x45')]({'where':{'id':_0x1025b9[_0x1dc0('0x43')]['id']}})['then'](handleEntityNotFound(_0x32fbb8,null))['then'](function(_0x1a4358){if(_0x1a4358){_0x466a67=_0x1a4358;_0x552c10['model']=_[_0x1dc0('0x2e')](db[_0x1dc0('0x46')][_0x1dc0('0x29')]);_0x552c10[_0x1dc0('0x2d')]=_[_0x1dc0('0x2e')](_0x1025b9[_0x1dc0('0x2d')]);_0x552c10[_0x1dc0('0x2f')]=_[_0x1dc0('0x30')](_0x552c10[_0x1dc0('0x2b')],_0x552c10[_0x1dc0('0x2d')]);_0x12d65c['attributes']=_[_0x1dc0('0x30')](_0x552c10[_0x1dc0('0x2b')],qs['fields'](_0x1025b9[_0x1dc0('0x2d')][_0x1dc0('0x32')]));_0x12d65c[_0x1dc0('0x31')]=_0x12d65c['attributes'][_0x1dc0('0x33')]?_0x12d65c[_0x1dc0('0x31')]:_0x552c10[_0x1dc0('0x2b')];_0x12d65c['order']=qs[_0x1dc0('0x48')](_0x1025b9[_0x1dc0('0x2d')]['sort']);_0x12d65c[_0x1dc0('0x35')]=qs[_0x1dc0('0x2f')](_[_0x1dc0('0x36')](_0x1025b9[_0x1dc0('0x2d')],_0x552c10[_0x1dc0('0x2f')]));if(_0x1025b9[_0x1dc0('0x2d')]['filter']){_0x12d65c[_0x1dc0('0x35')]=_[_0x1dc0('0x38')](_0x12d65c[_0x1dc0('0x35')],{'$or':_['map'](_0x12d65c['attributes'],function(_0x3708d0){var _0x38d167={};_0x38d167[_0x3708d0]={'$like':'%'+_0x1025b9[_0x1dc0('0x2d')][_0x1dc0('0x37')]+'%'};return _0x38d167;})});}_0x12d65c=_[_0x1dc0('0x38')]({},_0x12d65c,_0x1025b9[_0x1dc0('0x3a')]);return _0x466a67[_0x1dc0('0x4b')](_0x12d65c);}})[_0x1dc0('0x22')](function(_0x5a6c13){if(_0x5a6c13){_0x1a5845=_0x5a6c13[_0x1dc0('0x33')];if(!_0x1025b9[_0x1dc0('0x2d')][_0x1dc0('0x34')](_0x1dc0('0x49'))){_0x12d65c[_0x1dc0('0x1c')]=qs[_0x1dc0('0x1c')](_0x1025b9[_0x1dc0('0x2d')][_0x1dc0('0x1c')]);_0x12d65c[_0x1dc0('0x1a')]=qs[_0x1dc0('0x1a')](_0x1025b9[_0x1dc0('0x2d')][_0x1dc0('0x1a')]);}return _0x466a67[_0x1dc0('0x4b')](_0x12d65c);}})['then'](function(_0x607a05){if(_0x607a05){return _0x607a05?{'count':_0x1a5845,'rows':_0x607a05}:null;}})[_0x1dc0('0x22')](respondWithResult(_0x32fbb8,null))[_0x1dc0('0x3f')](handleError(_0x32fbb8,null));};
\ No newline at end of file
index cc3b319..a7085bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xe14d,0x1ee));var _0xde14=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xe14d[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x2237cf,_0x3e11fc){var _0x39844b=function(_0x3f27d8){while(--_0x3f27d8){_0x2237cf['push'](_0x2237cf['shift']());}};_0x39844b(++_0x3e11fc);}(_0xa41a,0x6b));var _0xaa41=function(_0xe8fb72,_0x566dd2){_0xe8fb72=_0xe8fb72-0x0;var _0x551114=_0xa41a[_0xe8fb72];return _0x551114;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index daaf9ad..a5e23e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0d7=['../../config/logger','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x16d6fa,_0xff299f){var _0x4a875e=function(_0x2d6f88){while(--_0x2d6f88){_0x16d6fa['push'](_0x16d6fa['shift']());}};_0x4a875e(++_0xff299f);}(_0xd0d7,0x120));var _0x7d0d=function(_0x3b58e2,_0x4fbf5f){_0x3b58e2=_0x3b58e2-0x0;var _0x5a6677=_0xd0d7[_0x3b58e2];return _0x5a6677;};'use strict';var _=require(_0x7d0d('0x0'));var util=require(_0x7d0d('0x1'));var moment=require(_0x7d0d('0x2'));var BPromise=require(_0x7d0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d0d('0x4'))['db'];var utils=require(_0x7d0d('0x5'));var logger=require(_0x7d0d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7d0d('0x7'));var client=jayson[_0x7d0d('0x8')][_0x7d0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229a38,_0x2ee01b,_0x484791){return new BPromise(function(_0x3681ed,_0x129cbb){return client[_0x7d0d('0xa')](_0x229a38,_0x484791)[_0x7d0d('0xb')](function(_0xd9f079){logger['info'](_0x7d0d('0xc'),_0x2ee01b,_0x7d0d('0xd'));logger['debug'](_0x7d0d('0xe'),_0x2ee01b,_0x7d0d('0xd'),JSON[_0x7d0d('0xf')](_0xd9f079));if(_0xd9f079[_0x7d0d('0x10')]){if(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x11')]===0x1f4){logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);return _0x129cbb(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);}logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0xd9f079['error'][_0x7d0d('0x12')]);return _0x3681ed(_0xd9f079[_0x7d0d('0x10')][_0x7d0d('0x12')]);}else{logger['info'](_0x7d0d('0xc'),_0x2ee01b,_0x7d0d('0xd'));_0x3681ed(_0xd9f079[_0x7d0d('0x13')]['message']);}})[_0x7d0d('0x14')](function(_0x226548){logger[_0x7d0d('0x10')](_0x7d0d('0xc'),_0x2ee01b,_0x226548);_0x129cbb(_0x226548);});});}
\ No newline at end of file
+var _0x3318=['ioredis','../../mysqldb','../../config/utils','client','http','then','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x5e4fdc,_0x183475){var _0xe2d401=function(_0x59ac98){while(--_0x59ac98){_0x5e4fdc['push'](_0x5e4fdc['shift']());}};_0xe2d401(++_0x183475);}(_0x3318,0x79));var _0x8331=function(_0x96a519,_0x1de251){_0x96a519=_0x96a519-0x0;var _0xf31872=_0x3318[_0x96a519];return _0xf31872;};'use strict';var _=require(_0x8331('0x0'));var util=require(_0x8331('0x1'));var moment=require(_0x8331('0x2'));var BPromise=require(_0x8331('0x3'));var rs=require(_0x8331('0x4'));var fs=require('fs');var Redis=require(_0x8331('0x5'));var db=require(_0x8331('0x6'))['db'];var utils=require(_0x8331('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8331('0x8')][_0x8331('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b780d,_0x38b15a,_0x3cb46d){return new BPromise(function(_0x54ea83,_0x59c1ae){return client['request'](_0x5b780d,_0x3cb46d)[_0x8331('0xa')](function(_0x15a3a2){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x38b15a,'request\x20sent');logger[_0x8331('0xb')](_0x8331('0xc'),_0x38b15a,_0x8331('0xd'),JSON[_0x8331('0xe')](_0x15a3a2));if(_0x15a3a2[_0x8331('0xf')]){if(_0x15a3a2[_0x8331('0xf')][_0x8331('0x10')]===0x1f4){logger[_0x8331('0xf')](_0x8331('0x11'),_0x38b15a,_0x15a3a2[_0x8331('0xf')]['message']);return _0x59c1ae(_0x15a3a2[_0x8331('0xf')][_0x8331('0x12')]);}logger[_0x8331('0xf')](_0x8331('0x11'),_0x38b15a,_0x15a3a2['error'][_0x8331('0x12')]);return _0x54ea83(_0x15a3a2[_0x8331('0xf')][_0x8331('0x12')]);}else{logger[_0x8331('0x13')](_0x8331('0x11'),_0x38b15a,_0x8331('0xd'));_0x54ea83(_0x15a3a2[_0x8331('0x14')][_0x8331('0x12')]);}})['catch'](function(_0x4d228e){logger[_0x8331('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x38b15a,_0x4d228e);_0x59c1ae(_0x4d228e);});});}
\ No newline at end of file
index 57b5c5d..fc2917d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd956=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','show','post','create','/:id','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd956,0xf3));var _0x6d95=function(_0xe65463,_0x42e927){_0xe65463=_0xe65463-0x0;var _0x1a4fee=_0xd956[_0xe65463];return _0x1a4fee;};'use strict';var multer=require(_0x6d95('0x0'));var util=require(_0x6d95('0x1'));var path=require(_0x6d95('0x2'));var timeout=require(_0x6d95('0x3'));var express=require(_0x6d95('0x4'));var router=express[_0x6d95('0x5')]();var fs_extra=require(_0x6d95('0x6'));var auth=require(_0x6d95('0x7'));var interaction=require(_0x6d95('0x8'));var config=require(_0x6d95('0x9'));var controller=require(_0x6d95('0xa'));router[_0x6d95('0xb')]('/',auth[_0x6d95('0xc')](),controller['index']);router[_0x6d95('0xb')]('/:id',auth[_0x6d95('0xc')](),controller[_0x6d95('0xd')]);router[_0x6d95('0xe')]('/',auth[_0x6d95('0xc')](),controller[_0x6d95('0xf')]);router['put'](_0x6d95('0x10'),auth[_0x6d95('0xc')](),controller['update']);router[_0x6d95('0x11')]('/:id',auth[_0x6d95('0xc')](),controller[_0x6d95('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x6d61=['index','show','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated'];(function(_0x4b45ef,_0x4828c2){var _0xf00ba8=function(_0xd4c312){while(--_0xd4c312){_0x4b45ef['push'](_0x4b45ef['shift']());}};_0xf00ba8(++_0x4828c2);}(_0x6d61,0x103));var _0x16d6=function(_0x46d9c9,_0x39a084){_0x46d9c9=_0x46d9c9-0x0;var _0x46b104=_0x6d61[_0x46d9c9];return _0x46b104;};'use strict';var multer=require(_0x16d6('0x0'));var util=require(_0x16d6('0x1'));var path=require(_0x16d6('0x2'));var timeout=require(_0x16d6('0x3'));var express=require(_0x16d6('0x4'));var router=express['Router']();var fs_extra=require(_0x16d6('0x5'));var auth=require(_0x16d6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x16d6('0x7'));var controller=require(_0x16d6('0x8'));router[_0x16d6('0x9')]('/',auth[_0x16d6('0xa')](),controller[_0x16d6('0xb')]);router['get']('/:id',auth[_0x16d6('0xa')](),controller[_0x16d6('0xc')]);router[_0x16d6('0xd')]('/',auth[_0x16d6('0xa')](),controller['create']);router['put'](_0x16d6('0xe'),auth[_0x16d6('0xa')](),controller[_0x16d6('0xf')]);router[_0x16d6('0x10')](_0x16d6('0xe'),auth[_0x16d6('0xa')](),controller['destroy']);module[_0x16d6('0x11')]=router;
\ No newline at end of file
index 9795d35..e9cc52c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c35=['keyValue','picklist','STRING','BOOLEAN','sequelize','string','variable'];(function(_0x22795e,_0x11640f){var _0x2ea9bc=function(_0x256cfa){while(--_0x256cfa){_0x22795e['push'](_0x22795e['shift']());}};_0x2ea9bc(++_0x11640f);}(_0x0c35,0x89));var _0x50c3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c35[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x50c3('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x50c3('0x1'),_0x50c3('0x2'),'customVariable',_0x50c3('0x3'),_0x50c3('0x4')),'defaultValue':_0x50c3('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x50c3('0x1'),_0x50c3('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x50c3('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x50c3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb02a=['sequelize','string','variable','picklist','STRING','ENUM'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0xb02a,0x16e));var _0xab02=function(_0x1dd8c3,_0x270b89){_0x1dd8c3=_0x1dd8c3-0x0;var _0x370c40=_0xb02a[_0x1dd8c3];return _0x370c40;};'use strict';var Sequelize=require(_0xab02('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xab02('0x1'),_0xab02('0x2'),'customVariable','keyValue',_0xab02('0x3')),'defaultValue':_0xab02('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xab02('0x4')]},'keyType':{'type':Sequelize[_0xab02('0x5')](_0xab02('0x1'),_0xab02('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xab02('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xab02('0x4')]}};
\ No newline at end of file
index 9238ca5..2fb13e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21fb=['find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21fb,0x13e));var _0xb21f=function(_0x9ca94e,_0x2d3caa){_0x9ca94e=_0x9ca94e-0x0;var _0x1f9d8a=_0x21fb[_0x9ca94e];return _0x1f9d8a;};'use strict';var emlformat=require(_0xb21f('0x0'));var rimraf=require(_0xb21f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb21f('0x2'));var rp=require(_0xb21f('0x3'));var moment=require(_0xb21f('0x4'));var BPromise=require(_0xb21f('0x5'));var Mustache=require(_0xb21f('0x6'));var util=require(_0xb21f('0x7'));var path=require(_0xb21f('0x8'));var sox=require(_0xb21f('0x9'));var csv=require(_0xb21f('0xa'));var ejs=require(_0xb21f('0xb'));var fs=require('fs');var fs_extra=require(_0xb21f('0xc'));var _=require(_0xb21f('0xd'));var squel=require(_0xb21f('0xe'));var crypto=require(_0xb21f('0xf'));var jsforce=require(_0xb21f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb21f('0xa'));var querystring=require(_0xb21f('0x11'));var Papa=require(_0xb21f('0x12'));var Redis=require(_0xb21f('0x13'));var authService=require(_0xb21f('0x14'));var qs=require(_0xb21f('0x15'));var as=require(_0xb21f('0x16'));var hardwareService=require(_0xb21f('0x17'));var logger=require(_0xb21f('0x18'))(_0xb21f('0x19'));var utils=require(_0xb21f('0x1a'));var config=require(_0xb21f('0x1b'));var licenseUtil=require(_0xb21f('0x1c'));var db=require(_0xb21f('0x1d'))['db'];function respondWithStatusCode(_0x1dcb15,_0x4e27a8){_0x4e27a8=_0x4e27a8||0xcc;return function(_0x228d2b){if(_0x228d2b){return _0x1dcb15[_0xb21f('0x1e')](_0x4e27a8);}return _0x1dcb15[_0xb21f('0x1f')](_0x4e27a8)[_0xb21f('0x20')]();};}function respondWithResult(_0x3a7eb0,_0x4ce353){_0x4ce353=_0x4ce353||0xc8;return function(_0x5abbce){if(_0x5abbce){return _0x3a7eb0[_0xb21f('0x1f')](_0x4ce353)[_0xb21f('0x21')](_0x5abbce);}};}function respondWithFilteredResult(_0x3381c9,_0x12dae5){return function(_0x5656cb){if(_0x5656cb){var _0x161ad2=typeof _0x12dae5[_0xb21f('0x22')]==='undefined'&&typeof _0x12dae5[_0xb21f('0x23')]==='undefined';var _0x2b5b5e=_0x5656cb['count'];var _0x188370=_0x161ad2?0x0:_0x12dae5['offset'];var _0x466c1d=_0x161ad2?_0x5656cb[_0xb21f('0x24')]:_0x12dae5[_0xb21f('0x22')]+_0x12dae5['limit'];var _0x21afff;if(_0x466c1d>=_0x2b5b5e){_0x466c1d=_0x2b5b5e;_0x21afff=0xc8;}else{_0x21afff=0xce;}_0x3381c9['status'](_0x21afff);return _0x3381c9['set'](_0xb21f('0x25'),_0x188370+'-'+_0x466c1d+'/'+_0x2b5b5e)[_0xb21f('0x21')](_0x5656cb);}return null;};}function patchUpdates(_0x3f30b0){return function(_0x39e1bf){try{jsonpatch['apply'](_0x39e1bf,_0x3f30b0,!![]);}catch(_0x4bdc27){return BPromise[_0xb21f('0x26')](_0x4bdc27);}return _0x39e1bf[_0xb21f('0x27')]();};}function saveUpdates(_0xed4af7,_0x2ec215){return function(_0x2d9c0f){if(_0x2d9c0f){return _0x2d9c0f[_0xb21f('0x28')](_0xed4af7)[_0xb21f('0x29')](function(_0x162e27){return _0x162e27;});}return null;};}function removeEntity(_0xc9c99d,_0x8a162d){return function(_0x135fe3){if(_0x135fe3){return _0x135fe3['destroy']()[_0xb21f('0x29')](function(){_0xc9c99d[_0xb21f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b92ed,_0x4ccd2f){return function(_0x3671e8){if(!_0x3671e8){_0x4b92ed[_0xb21f('0x1e')](0x194);}return _0x3671e8;};}function handleError(_0x17b433,_0x19cd9f){_0x19cd9f=_0x19cd9f||0x1f4;return function(_0xc4e39e){logger[_0xb21f('0x2a')](_0xc4e39e[_0xb21f('0x2b')]);if(_0xc4e39e['name']){delete _0xc4e39e[_0xb21f('0x2c')];}_0x17b433[_0xb21f('0x1f')](_0x19cd9f)[_0xb21f('0x2d')](_0xc4e39e);};}exports[_0xb21f('0x2e')]=function(_0x1d6bfc,_0x331e76){var _0x259ed6={},_0x41ffee={},_0x263bd2={'count':0x0,'rows':[]};var _0x963de1=_[_0xb21f('0x2f')](db[_0xb21f('0x30')]['rawAttributes'],function(_0x37c866){return{'name':_0x37c866[_0xb21f('0x31')],'type':_0x37c866[_0xb21f('0x32')][_0xb21f('0x33')]};});_0x41ffee[_0xb21f('0x34')]=_[_0xb21f('0x2f')](_0x963de1,'name');_0x41ffee[_0xb21f('0x35')]=_[_0xb21f('0x36')](_0x1d6bfc[_0xb21f('0x35')]);_0x41ffee[_0xb21f('0x37')]=_['intersection'](_0x41ffee[_0xb21f('0x34')],_0x41ffee['query']);_0x259ed6[_0xb21f('0x38')]=_[_0xb21f('0x39')](_0x41ffee[_0xb21f('0x34')],qs[_0xb21f('0x3a')](_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x3a')]));_0x259ed6['attributes']=_0x259ed6[_0xb21f('0x38')][_0xb21f('0x3b')]?_0x259ed6[_0xb21f('0x38')]:_0x41ffee[_0xb21f('0x34')];if(!_0x1d6bfc['query'][_0xb21f('0x3c')]('nolimit')){_0x259ed6[_0xb21f('0x23')]=qs['limit'](_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x23')]);_0x259ed6[_0xb21f('0x22')]=qs[_0xb21f('0x22')](_0x1d6bfc['query'][_0xb21f('0x22')]);}_0x259ed6[_0xb21f('0x3d')]=qs[_0xb21f('0x3e')](_0x1d6bfc[_0xb21f('0x35')]['sort']);_0x259ed6['where']=qs[_0xb21f('0x37')](_[_0xb21f('0x3f')](_0x1d6bfc[_0xb21f('0x35')],_0x41ffee[_0xb21f('0x37')]),_0x963de1);if(_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x40')]){_0x259ed6[_0xb21f('0x41')]=_[_0xb21f('0x42')](_0x259ed6[_0xb21f('0x41')],{'$or':_[_0xb21f('0x2f')](_0x963de1,function(_0x4b48a0){if(_0x4b48a0[_0xb21f('0x32')]!==_0xb21f('0x43')){var _0x3103f8={};_0x3103f8[_0x4b48a0[_0xb21f('0x2c')]]={'$like':'%'+_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x40')]+'%'};return _0x3103f8;}})});}_0x259ed6=_[_0xb21f('0x42')]({},_0x259ed6,_0x1d6bfc[_0xb21f('0x44')]);var _0x193dff={'where':_0x259ed6[_0xb21f('0x41')]};return db[_0xb21f('0x30')][_0xb21f('0x24')](_0x193dff)[_0xb21f('0x29')](function(_0x14b5a9){_0x263bd2[_0xb21f('0x24')]=_0x14b5a9;if(_0x1d6bfc[_0xb21f('0x35')][_0xb21f('0x45')]){_0x259ed6[_0xb21f('0x46')]=[{'all':!![]}];}return db[_0xb21f('0x30')]['findAll'](_0x259ed6);})[_0xb21f('0x29')](function(_0xe6f3e1){_0x263bd2[_0xb21f('0x47')]=_0xe6f3e1;return _0x263bd2;})[_0xb21f('0x29')](respondWithFilteredResult(_0x331e76,_0x259ed6))['catch'](handleError(_0x331e76,null));};exports[_0xb21f('0x48')]=function(_0x4ae518,_0x11da1f){var _0x170e39={'raw':!![],'where':{'id':_0x4ae518[_0xb21f('0x49')]['id']}},_0x1d6313={};_0x1d6313[_0xb21f('0x34')]=_[_0xb21f('0x36')](db[_0xb21f('0x30')][_0xb21f('0x4a')]);_0x1d6313[_0xb21f('0x35')]=_[_0xb21f('0x36')](_0x4ae518[_0xb21f('0x35')]);_0x1d6313[_0xb21f('0x37')]=_[_0xb21f('0x39')](_0x1d6313[_0xb21f('0x34')],_0x1d6313[_0xb21f('0x35')]);_0x170e39[_0xb21f('0x38')]=_[_0xb21f('0x39')](_0x1d6313[_0xb21f('0x34')],qs[_0xb21f('0x3a')](_0x4ae518['query'][_0xb21f('0x3a')]));_0x170e39['attributes']=_0x170e39[_0xb21f('0x38')][_0xb21f('0x3b')]?_0x170e39['attributes']:_0x1d6313[_0xb21f('0x34')];if(_0x4ae518['query']['includeAll']){_0x170e39[_0xb21f('0x46')]=[{'all':!![]}];}_0x170e39=_[_0xb21f('0x42')]({},_0x170e39,_0x4ae518['options']);return db[_0xb21f('0x30')]['find'](_0x170e39)[_0xb21f('0x29')](handleEntityNotFound(_0x11da1f,null))[_0xb21f('0x29')](respondWithResult(_0x11da1f,null))['catch'](handleError(_0x11da1f,null));};exports['create']=function(_0x3dfb1d,_0x2f1521){return db['Dynamics365Field'][_0xb21f('0x4b')](_0x3dfb1d[_0xb21f('0x4c')],{})['then'](respondWithResult(_0x2f1521,0xc9))['catch'](handleError(_0x2f1521,null));};exports['update']=function(_0x183a68,_0x47c907){if(_0x183a68[_0xb21f('0x4c')]['id']){delete _0x183a68['body']['id'];}return db[_0xb21f('0x30')][_0xb21f('0x4d')]({'where':{'id':_0x183a68[_0xb21f('0x49')]['id']}})['then'](handleEntityNotFound(_0x47c907,null))[_0xb21f('0x29')](saveUpdates(_0x183a68[_0xb21f('0x4c')],null))[_0xb21f('0x29')](respondWithResult(_0x47c907,null))[_0xb21f('0x4e')](handleError(_0x47c907,null));};exports['destroy']=function(_0x356269,_0x5a249a){return db[_0xb21f('0x30')][_0xb21f('0x4d')]({'where':{'id':_0x356269['params']['id']}})[_0xb21f('0x29')](handleEntityNotFound(_0x5a249a,null))[_0xb21f('0x29')](removeEntity(_0x5a249a,null))[_0xb21f('0x4e')](handleError(_0x5a249a,null));};
\ No newline at end of file
+var _0x1373=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','update','then','error','stack','name','index','map','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1373,0xc1));var _0x3137=function(_0x5cd984,_0x594791){_0x5cd984=_0x5cd984-0x0;var _0x497425=_0x1373[_0x5cd984];return _0x497425;};'use strict';var emlformat=require(_0x3137('0x0'));var rimraf=require(_0x3137('0x1'));var zipdir=require(_0x3137('0x2'));var jsonpatch=require(_0x3137('0x3'));var rp=require(_0x3137('0x4'));var moment=require(_0x3137('0x5'));var BPromise=require(_0x3137('0x6'));var Mustache=require(_0x3137('0x7'));var util=require(_0x3137('0x8'));var path=require(_0x3137('0x9'));var sox=require('sox');var csv=require(_0x3137('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3137('0xb'));var _=require(_0x3137('0xc'));var squel=require('squel');var crypto=require(_0x3137('0xd'));var jsforce=require(_0x3137('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3137('0xf'));var Papa=require(_0x3137('0x10'));var Redis=require(_0x3137('0x11'));var authService=require(_0x3137('0x12'));var qs=require(_0x3137('0x13'));var as=require(_0x3137('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3137('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x3137('0x16'));var licenseUtil=require(_0x3137('0x17'));var db=require(_0x3137('0x18'))['db'];function respondWithStatusCode(_0x10369c,_0x2d3d8f){_0x2d3d8f=_0x2d3d8f||0xcc;return function(_0xebfb1b){if(_0xebfb1b){return _0x10369c[_0x3137('0x19')](_0x2d3d8f);}return _0x10369c[_0x3137('0x1a')](_0x2d3d8f)[_0x3137('0x1b')]();};}function respondWithResult(_0x59ba1f,_0x21df51){_0x21df51=_0x21df51||0xc8;return function(_0x2361ca){if(_0x2361ca){return _0x59ba1f[_0x3137('0x1a')](_0x21df51)['json'](_0x2361ca);}};}function respondWithFilteredResult(_0x345ac0,_0x4cbf72){return function(_0x403ee4){if(_0x403ee4){var _0x8fcf85=typeof _0x4cbf72[_0x3137('0x1c')]===_0x3137('0x1d')&&typeof _0x4cbf72[_0x3137('0x1e')]===_0x3137('0x1d');var _0x523be6=_0x403ee4[_0x3137('0x1f')];var _0x504c11=_0x8fcf85?0x0:_0x4cbf72[_0x3137('0x1c')];var _0x4434e0=_0x8fcf85?_0x403ee4['count']:_0x4cbf72[_0x3137('0x1c')]+_0x4cbf72[_0x3137('0x1e')];var _0x37d0c6;if(_0x4434e0>=_0x523be6){_0x4434e0=_0x523be6;_0x37d0c6=0xc8;}else{_0x37d0c6=0xce;}_0x345ac0[_0x3137('0x1a')](_0x37d0c6);return _0x345ac0[_0x3137('0x20')](_0x3137('0x21'),_0x504c11+'-'+_0x4434e0+'/'+_0x523be6)['json'](_0x403ee4);}return null;};}function patchUpdates(_0x54632e){return function(_0x286ac6){try{jsonpatch[_0x3137('0x22')](_0x286ac6,_0x54632e,!![]);}catch(_0x284edd){return BPromise['reject'](_0x284edd);}return _0x286ac6['save']();};}function saveUpdates(_0x3ea647,_0x31fada){return function(_0x6e2d07){if(_0x6e2d07){return _0x6e2d07[_0x3137('0x23')](_0x3ea647)[_0x3137('0x24')](function(_0x5305ca){return _0x5305ca;});}return null;};}function removeEntity(_0x5156a6,_0x4032b2){return function(_0x5879ec){if(_0x5879ec){return _0x5879ec['destroy']()['then'](function(){_0x5156a6[_0x3137('0x1a')](0xcc)[_0x3137('0x1b')]();});}};}function handleEntityNotFound(_0x53790c,_0x1d5771){return function(_0x28305d){if(!_0x28305d){_0x53790c[_0x3137('0x19')](0x194);}return _0x28305d;};}function handleError(_0x2c566e,_0x264763){_0x264763=_0x264763||0x1f4;return function(_0x5974ca){logger[_0x3137('0x25')](_0x5974ca[_0x3137('0x26')]);if(_0x5974ca[_0x3137('0x27')]){delete _0x5974ca['name'];}_0x2c566e[_0x3137('0x1a')](_0x264763)['send'](_0x5974ca);};}exports[_0x3137('0x28')]=function(_0x575f2c,_0x361387){var _0x3240b6={},_0x18b304={},_0x36c9c7={'count':0x0,'rows':[]};var _0xfbf963=_[_0x3137('0x29')](db['Dynamics365Field'][_0x3137('0x2a')],function(_0xe8722c){return{'name':_0xe8722c['fieldName'],'type':_0xe8722c[_0x3137('0x2b')]['key']};});_0x18b304['model']=_[_0x3137('0x29')](_0xfbf963,_0x3137('0x27'));_0x18b304[_0x3137('0x2c')]=_[_0x3137('0x2d')](_0x575f2c[_0x3137('0x2c')]);_0x18b304[_0x3137('0x2e')]=_[_0x3137('0x2f')](_0x18b304[_0x3137('0x30')],_0x18b304['query']);_0x3240b6[_0x3137('0x31')]=_[_0x3137('0x2f')](_0x18b304[_0x3137('0x30')],qs[_0x3137('0x32')](_0x575f2c[_0x3137('0x2c')][_0x3137('0x32')]));_0x3240b6[_0x3137('0x31')]=_0x3240b6[_0x3137('0x31')][_0x3137('0x33')]?_0x3240b6[_0x3137('0x31')]:_0x18b304[_0x3137('0x30')];if(!_0x575f2c[_0x3137('0x2c')][_0x3137('0x34')]('nolimit')){_0x3240b6[_0x3137('0x1e')]=qs['limit'](_0x575f2c['query'][_0x3137('0x1e')]);_0x3240b6[_0x3137('0x1c')]=qs['offset'](_0x575f2c[_0x3137('0x2c')][_0x3137('0x1c')]);}_0x3240b6[_0x3137('0x35')]=qs[_0x3137('0x36')](_0x575f2c[_0x3137('0x2c')]['sort']);_0x3240b6[_0x3137('0x37')]=qs[_0x3137('0x2e')](_[_0x3137('0x38')](_0x575f2c[_0x3137('0x2c')],_0x18b304[_0x3137('0x2e')]),_0xfbf963);if(_0x575f2c['query'][_0x3137('0x39')]){_0x3240b6[_0x3137('0x37')]=_[_0x3137('0x3a')](_0x3240b6[_0x3137('0x37')],{'$or':_['map'](_0xfbf963,function(_0x1e450b){if(_0x1e450b[_0x3137('0x2b')]!==_0x3137('0x3b')){var _0x3d7a5c={};_0x3d7a5c[_0x1e450b[_0x3137('0x27')]]={'$like':'%'+_0x575f2c[_0x3137('0x2c')]['filter']+'%'};return _0x3d7a5c;}})});}_0x3240b6=_[_0x3137('0x3a')]({},_0x3240b6,_0x575f2c[_0x3137('0x3c')]);var _0x28662b={'where':_0x3240b6[_0x3137('0x37')]};return db[_0x3137('0x3d')]['count'](_0x28662b)['then'](function(_0x3cecbe){_0x36c9c7['count']=_0x3cecbe;if(_0x575f2c['query'][_0x3137('0x3e')]){_0x3240b6[_0x3137('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x3137('0x40')](_0x3240b6);})[_0x3137('0x24')](function(_0x2c3b0c){_0x36c9c7[_0x3137('0x41')]=_0x2c3b0c;return _0x36c9c7;})['then'](respondWithFilteredResult(_0x361387,_0x3240b6))[_0x3137('0x42')](handleError(_0x361387,null));};exports['show']=function(_0x55aed1,_0x4b072b){var _0x411b45={'raw':!![],'where':{'id':_0x55aed1[_0x3137('0x43')]['id']}},_0x46e218={};_0x46e218['model']=_['keys'](db[_0x3137('0x3d')][_0x3137('0x2a')]);_0x46e218[_0x3137('0x2c')]=_['keys'](_0x55aed1[_0x3137('0x2c')]);_0x46e218['filters']=_[_0x3137('0x2f')](_0x46e218[_0x3137('0x30')],_0x46e218[_0x3137('0x2c')]);_0x411b45[_0x3137('0x31')]=_[_0x3137('0x2f')](_0x46e218[_0x3137('0x30')],qs[_0x3137('0x32')](_0x55aed1[_0x3137('0x2c')]['fields']));_0x411b45[_0x3137('0x31')]=_0x411b45['attributes'][_0x3137('0x33')]?_0x411b45[_0x3137('0x31')]:_0x46e218[_0x3137('0x30')];if(_0x55aed1[_0x3137('0x2c')][_0x3137('0x3e')]){_0x411b45['include']=[{'all':!![]}];}_0x411b45=_[_0x3137('0x3a')]({},_0x411b45,_0x55aed1['options']);return db[_0x3137('0x3d')][_0x3137('0x44')](_0x411b45)['then'](handleEntityNotFound(_0x4b072b,null))['then'](respondWithResult(_0x4b072b,null))[_0x3137('0x42')](handleError(_0x4b072b,null));};exports[_0x3137('0x45')]=function(_0x30884c,_0x2e94ad){return db[_0x3137('0x3d')]['create'](_0x30884c[_0x3137('0x46')],{})[_0x3137('0x24')](respondWithResult(_0x2e94ad,0xc9))[_0x3137('0x42')](handleError(_0x2e94ad,null));};exports[_0x3137('0x23')]=function(_0x10231d,_0x4971ae){if(_0x10231d[_0x3137('0x46')]['id']){delete _0x10231d[_0x3137('0x46')]['id'];}return db[_0x3137('0x3d')]['find']({'where':{'id':_0x10231d['params']['id']}})[_0x3137('0x24')](handleEntityNotFound(_0x4971ae,null))[_0x3137('0x24')](saveUpdates(_0x10231d['body'],null))['then'](respondWithResult(_0x4971ae,null))[_0x3137('0x42')](handleError(_0x4971ae,null));};exports[_0x3137('0x47')]=function(_0x5b198f,_0x8af79e){return db['Dynamics365Field'][_0x3137('0x44')]({'where':{'id':_0x5b198f['params']['id']}})[_0x3137('0x24')](handleEntityNotFound(_0x8af79e,null))[_0x3137('0x24')](removeEntity(_0x8af79e,null))[_0x3137('0x42')](handleError(_0x8af79e,null));};
\ No newline at end of file
index 9c6f238..fb2e24c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb0b=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0x14dd4f,_0x26964e){var _0xdf6c68=function(_0x4f7d22){while(--_0x4f7d22){_0x14dd4f['push'](_0x14dd4f['shift']());}};_0xdf6c68(++_0x26964e);}(_0xfb0b,0x166));var _0xbfb0=function(_0x1463b7,_0x28f54e){_0x1463b7=_0x1463b7-0x0;var _0x5eeeab=_0xfb0b[_0x1463b7];return _0x5eeeab;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbfb0('0x2'));var BPromise=require(_0xbfb0('0x3'));var rp=require(_0xbfb0('0x4'));var fs=require('fs');var path=require(_0xbfb0('0x5'));var rimraf=require(_0xbfb0('0x6'));var config=require(_0xbfb0('0x7'));var attributes=require(_0xbfb0('0x8'));module[_0xbfb0('0x9')]=function(_0x479251,_0x503ff7){return _0x479251[_0xbfb0('0xa')](_0xbfb0('0xb'),attributes,{'tableName':_0xbfb0('0xc'),'paranoid':![],'indexes':[{'name':_0xbfb0('0xd'),'fields':[_0xbfb0('0xe'),_0xbfb0('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf092=['bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','../../config/logger','moment'];(function(_0x7d196e,_0x9b3e2d){var _0x3b9269=function(_0x5d9641){while(--_0x5d9641){_0x7d196e['push'](_0x7d196e['shift']());}};_0x3b9269(++_0x9b3e2d);}(_0xf092,0x8c));var _0x2f09=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xf092[_0x1d558c];return _0x15767d;};'use strict';var _=require(_0x2f09('0x0'));var util=require('util');var logger=require(_0x2f09('0x1'))('api');var moment=require(_0x2f09('0x2'));var BPromise=require(_0x2f09('0x3'));var rp=require(_0x2f09('0x4'));var fs=require('fs');var path=require(_0x2f09('0x5'));var rimraf=require(_0x2f09('0x6'));var config=require(_0x2f09('0x7'));var attributes=require(_0x2f09('0x8'));module[_0x2f09('0x9')]=function(_0x26438c,_0x2278bb){return _0x26438c['define'](_0x2f09('0xa'),attributes,{'tableName':_0x2f09('0xb'),'paranoid':![],'indexes':[{'name':_0x2f09('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d6de86d..588c19f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5f1=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd5f1,0x78));var _0x1d5f=function(_0x4066c2,_0xad48e8){_0x4066c2=_0x4066c2-0x0;var _0x3870a0=_0xd5f1[_0x4066c2];return _0x3870a0;};'use strict';var _=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var moment=require(_0x1d5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d5f('0x3'));var fs=require('fs');var Redis=require(_0x1d5f('0x4'));var db=require(_0x1d5f('0x5'))['db'];var utils=require(_0x1d5f('0x6'));var logger=require(_0x1d5f('0x7'))(_0x1d5f('0x8'));var config=require(_0x1d5f('0x9'));var jayson=require(_0x1d5f('0xa'));var client=jayson[_0x1d5f('0xb')][_0x1d5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2200d6,_0x1dbe26,_0x21f6d9){return new BPromise(function(_0x3120a1,_0x59392f){return client[_0x1d5f('0xd')](_0x2200d6,_0x21f6d9)[_0x1d5f('0xe')](function(_0x97a85c){logger[_0x1d5f('0xf')](_0x1d5f('0x10'),_0x1dbe26,_0x1d5f('0x11'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1dbe26,'request\x20sent',JSON[_0x1d5f('0x12')](_0x97a85c));if(_0x97a85c[_0x1d5f('0x13')]){if(_0x97a85c[_0x1d5f('0x13')][_0x1d5f('0x14')]===0x1f4){logger[_0x1d5f('0x13')](_0x1d5f('0x10'),_0x1dbe26,_0x97a85c[_0x1d5f('0x13')]['message']);return _0x59392f(_0x97a85c[_0x1d5f('0x13')]['message']);}logger[_0x1d5f('0x13')](_0x1d5f('0x10'),_0x1dbe26,_0x97a85c['error']['message']);return _0x3120a1(_0x97a85c['error'][_0x1d5f('0x15')]);}else{logger[_0x1d5f('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x1dbe26,_0x1d5f('0x11'));_0x3120a1(_0x97a85c[_0x1d5f('0x16')][_0x1d5f('0x15')]);}})[_0x1d5f('0x17')](function(_0x3a0032){logger[_0x1d5f('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x1dbe26,_0x3a0032);_0x59392f(_0x3a0032);});});}
\ No newline at end of file
+var _0xadd7=['result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x4364fc,_0x98f2ea){var _0x4d8fc6=function(_0x2cd9ad){while(--_0x2cd9ad){_0x4364fc['push'](_0x4364fc['shift']());}};_0x4d8fc6(++_0x98f2ea);}(_0xadd7,0x1ca));var _0x7add=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xadd7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7add('0x0'));var util=require('util');var moment=require(_0x7add('0x1'));var BPromise=require('bluebird');var rs=require(_0x7add('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7add('0x3'));var logger=require(_0x7add('0x4'))('rpc');var config=require(_0x7add('0x5'));var jayson=require(_0x7add('0x6'));var client=jayson[_0x7add('0x7')][_0x7add('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a1f73,_0x2ccb1c,_0x1ffbc8){return new BPromise(function(_0x5c28fd,_0x1513b6){return client[_0x7add('0x9')](_0x1a1f73,_0x1ffbc8)[_0x7add('0xa')](function(_0x47b9c9){logger[_0x7add('0xb')](_0x7add('0xc'),_0x2ccb1c,_0x7add('0xd'));logger[_0x7add('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2ccb1c,'request\x20sent',JSON['stringify'](_0x47b9c9));if(_0x47b9c9[_0x7add('0xf')]){if(_0x47b9c9[_0x7add('0xf')]['code']===0x1f4){logger[_0x7add('0xf')](_0x7add('0xc'),_0x2ccb1c,_0x47b9c9[_0x7add('0xf')][_0x7add('0x10')]);return _0x1513b6(_0x47b9c9[_0x7add('0xf')][_0x7add('0x10')]);}logger['error'](_0x7add('0xc'),_0x2ccb1c,_0x47b9c9['error'][_0x7add('0x10')]);return _0x5c28fd(_0x47b9c9[_0x7add('0xf')]['message']);}else{logger[_0x7add('0xb')](_0x7add('0xc'),_0x2ccb1c,_0x7add('0xd'));_0x5c28fd(_0x47b9c9[_0x7add('0x11')][_0x7add('0x10')]);}})[_0x7add('0x12')](function(_0x8783c1){logger[_0x7add('0xf')](_0x7add('0xc'),_0x2ccb1c,_0x8783c1);_0x1513b6(_0x8783c1);});});}
\ No newline at end of file
index d652ba9..af339dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1889=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get'];(function(_0x5f65e5,_0x53b531){var _0x4da00d=function(_0x47baf1){while(--_0x47baf1){_0x5f65e5['push'](_0x5f65e5['shift']());}};_0x4da00d(++_0x53b531);}(_0x1889,0xdd));var _0x9188=function(_0x351dd1,_0x46fb55){_0x351dd1=_0x351dd1-0x0;var _0x1fd43d=_0x1889[_0x351dd1];return _0x1fd43d;};'use strict';var multer=require(_0x9188('0x0'));var util=require(_0x9188('0x1'));var path=require(_0x9188('0x2'));var timeout=require(_0x9188('0x3'));var express=require('express');var router=express[_0x9188('0x4')]();var fs_extra=require(_0x9188('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9188('0x6'));var controller=require(_0x9188('0x7'));router[_0x9188('0x8')]('/',auth[_0x9188('0x9')](),controller[_0x9188('0xa')]);router[_0x9188('0x8')](_0x9188('0xb'),auth[_0x9188('0x9')](),controller[_0x9188('0xc')]);router['get'](_0x9188('0xd'),auth['isAuthenticated'](),controller[_0x9188('0xe')]);router['get'](_0x9188('0xf'),auth[_0x9188('0x9')](),controller[_0x9188('0x10')]);router['post']('/',auth[_0x9188('0x9')](),controller[_0x9188('0x11')]);router[_0x9188('0x12')]('/:id/configurations',auth[_0x9188('0x9')](),controller[_0x9188('0x13')]);router[_0x9188('0x14')](_0x9188('0xb'),auth[_0x9188('0x9')](),controller[_0x9188('0x15')]);router['delete'](_0x9188('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9188('0x16')]=router;
\ No newline at end of file
+var _0x359f=['create','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x397080,_0x3e70ec){var _0x2d65c3=function(_0x4f23a6){while(--_0x4f23a6){_0x397080['push'](_0x397080['shift']());}};_0x2d65c3(++_0x3e70ec);}(_0x359f,0xad));var _0xf359=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x359f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf359('0x0'));var util=require(_0xf359('0x1'));var path=require('path');var timeout=require(_0xf359('0x2'));var express=require(_0xf359('0x3'));var router=express[_0xf359('0x4')]();var fs_extra=require(_0xf359('0x5'));var auth=require(_0xf359('0x6'));var interaction=require(_0xf359('0x7'));var config=require(_0xf359('0x8'));var controller=require(_0xf359('0x9'));router[_0xf359('0xa')]('/',auth[_0xf359('0xb')](),controller[_0xf359('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf359('0xd')]);router['get'](_0xf359('0xe'),auth[_0xf359('0xb')](),controller[_0xf359('0xf')]);router[_0xf359('0xa')](_0xf359('0x10'),auth[_0xf359('0xb')](),controller[_0xf359('0x11')]);router[_0xf359('0x12')]('/',auth[_0xf359('0xb')](),controller[_0xf359('0x13')]);router[_0xf359('0x12')](_0xf359('0xe'),auth[_0xf359('0xb')](),controller['addConfiguration']);router['put'](_0xf359('0x14'),auth[_0xf359('0xb')](),controller[_0xf359('0x15')]);router[_0xf359('0x16')](_0xf359('0x14'),auth[_0xf359('0xb')](),controller[_0xf359('0x17')]);module['exports']=router;
\ No newline at end of file
index d2a5573..189f903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['exports','STRING','remoteUri'];(function(_0x3cb3ca,_0x44d697){var _0x214366=function(_0x6b38e1){while(--_0x6b38e1){_0x3cb3ca['push'](_0x3cb3ca['shift']());}};_0x214366(++_0x44d697);}(_0x6d38,0x1ef));var _0x86d3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6d38[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'name':{'type':Sequelize[_0x86d3('0x1')]},'description':{'type':Sequelize[_0x86d3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x86d3('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x86d3('0x2')},'serverUrl':{'type':Sequelize[_0x86d3('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x7708=['sequelize','exports','STRING','remoteUri'];(function(_0x28046a,_0x415ac5){var _0x537a67=function(_0x462072){while(--_0x462072){_0x28046a['push'](_0x28046a['shift']());}};_0x537a67(++_0x415ac5);}(_0x7708,0x188));var _0x8770=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x7708[_0x5a7e3c];return _0x59252b;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8770('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8770('0x3')},'serverUrl':{'type':Sequelize[_0x8770('0x2')],'allowNull':![]}};
\ No newline at end of file
index e37eb9a..9992165 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8164=['substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','statusCode','error','stringify','test','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','sendStatus','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','getConfigurations','FreshdeskConfiguration','order','sort','pick','addConfiguration','findOne','AccountId','Subjects','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice'];(function(_0x13d60e,_0x67a91c){var _0x134524=function(_0x22a37b){while(--_0x22a37b){_0x13d60e['push'](_0x13d60e['shift']());}};_0x134524(++_0x67a91c);}(_0x8164,0x170));var _0x4816=function(_0x4ec3de,_0x1c67c4){_0x4ec3de=_0x4ec3de-0x0;var _0x37478a=_0x8164[_0x4ec3de];return _0x37478a;};'use strict';var emlformat=require(_0x4816('0x0'));var rimraf=require(_0x4816('0x1'));var zipdir=require(_0x4816('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4816('0x3'));var moment=require(_0x4816('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4816('0x5'));var util=require('util');var path=require(_0x4816('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4816('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4816('0x8'));var crypto=require(_0x4816('0x9'));var jsforce=require(_0x4816('0xa'));var deskjs=require(_0x4816('0xb'));var toCsv=require(_0x4816('0xc'));var querystring=require(_0x4816('0xd'));var Papa=require(_0x4816('0xe'));var Redis=require(_0x4816('0xf'));var authService=require(_0x4816('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4816('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4816('0x12'))(_0x4816('0x13'));var utils=require('../../config/utils');var config=require(_0x4816('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x4816('0x15'));function respondWithStatusCode(_0x51a5f8,_0x5c4d42){_0x5c4d42=_0x5c4d42||0xcc;return function(_0x45a360){if(_0x45a360){return _0x51a5f8['sendStatus'](_0x5c4d42);}return _0x51a5f8[_0x4816('0x16')](_0x5c4d42)[_0x4816('0x17')]();};}function respondWithResult(_0x13a685,_0x316f36){_0x316f36=_0x316f36||0xc8;return function(_0x42fc52){if(_0x42fc52){return _0x13a685[_0x4816('0x16')](_0x316f36)[_0x4816('0x18')](_0x42fc52);}};}function respondWithFilteredResult(_0x2a58b7,_0x45c006){return function(_0x21354c){if(_0x21354c){var _0x1ce1fb=typeof _0x45c006[_0x4816('0x19')]===_0x4816('0x1a')&&typeof _0x45c006[_0x4816('0x1b')]===_0x4816('0x1a');var _0x5c446b=_0x21354c['count'];var _0x5b54d4=_0x1ce1fb?0x0:_0x45c006[_0x4816('0x19')];var _0x354fdd=_0x1ce1fb?_0x21354c[_0x4816('0x1c')]:_0x45c006[_0x4816('0x19')]+_0x45c006[_0x4816('0x1b')];var _0x37effd;if(_0x354fdd>=_0x5c446b){_0x354fdd=_0x5c446b;_0x37effd=0xc8;}else{_0x37effd=0xce;}_0x2a58b7[_0x4816('0x16')](_0x37effd);return _0x2a58b7[_0x4816('0x1d')](_0x4816('0x1e'),_0x5b54d4+'-'+_0x354fdd+'/'+_0x5c446b)['json'](_0x21354c);}return null;};}function patchUpdates(_0x1ab50d){return function(_0x583a99){try{jsonpatch['apply'](_0x583a99,_0x1ab50d,!![]);}catch(_0x233902){return BPromise[_0x4816('0x1f')](_0x233902);}return _0x583a99['save']();};}function saveUpdates(_0x2bbaf4,_0x576221){return function(_0x46eb06){if(_0x46eb06){return _0x46eb06[_0x4816('0x20')](_0x2bbaf4)['then'](function(_0x504851){return _0x504851;});}return null;};}function removeEntity(_0xe484b2,_0x2c8dc4){return function(_0x394ecd){if(_0x394ecd){return _0x394ecd['destroy']()[_0x4816('0x21')](function(){_0xe484b2[_0x4816('0x16')](0xcc)[_0x4816('0x17')]();});}};}function handleEntityNotFound(_0x3f07f1,_0x571a05){return function(_0x565651){if(!_0x565651){_0x3f07f1[_0x4816('0x22')](0x194);}return _0x565651;};}function handleError(_0x47701a,_0x590349){_0x590349=_0x590349||0x1f4;return function(_0x3c96ce){logger['error'](_0x3c96ce['stack']);if(_0x3c96ce[_0x4816('0x23')]){delete _0x3c96ce[_0x4816('0x23')];}_0x47701a[_0x4816('0x16')](_0x590349)['send'](_0x3c96ce);};}exports[_0x4816('0x24')]=function(_0x521259,_0x39ddbd){var _0x229086={},_0x49c337={},_0x8ca388={'count':0x0,'rows':[]};var _0x34ba85=_[_0x4816('0x25')](db[_0x4816('0x26')][_0x4816('0x27')],function(_0x332af7){return{'name':_0x332af7[_0x4816('0x28')],'type':_0x332af7[_0x4816('0x29')][_0x4816('0x2a')]};});_0x49c337['model']=_[_0x4816('0x25')](_0x34ba85,_0x4816('0x23'));_0x49c337['query']=_['keys'](_0x521259[_0x4816('0x2b')]);_0x49c337[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x49c337[_0x4816('0x2e')],_0x49c337[_0x4816('0x2b')]);_0x229086['attributes']=_['intersection'](_0x49c337['model'],qs[_0x4816('0x2f')](_0x521259[_0x4816('0x2b')][_0x4816('0x2f')]));_0x229086[_0x4816('0x30')]=_0x229086[_0x4816('0x30')][_0x4816('0x31')]?_0x229086['attributes']:_0x49c337[_0x4816('0x2e')];if(!_0x521259['query'][_0x4816('0x32')](_0x4816('0x33'))){_0x229086[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x521259[_0x4816('0x2b')]['limit']);_0x229086[_0x4816('0x19')]=qs['offset'](_0x521259['query'][_0x4816('0x19')]);}_0x229086['order']=qs['sort'](_0x521259['query']['sort']);_0x229086[_0x4816('0x34')]=qs[_0x4816('0x2c')](_['pick'](_0x521259[_0x4816('0x2b')],_0x49c337[_0x4816('0x2c')]),_0x34ba85);if(_0x521259['query'][_0x4816('0x35')]){_0x229086[_0x4816('0x34')]=_[_0x4816('0x36')](_0x229086[_0x4816('0x34')],{'$or':_['map'](_0x34ba85,function(_0x30ed56){if(_0x30ed56[_0x4816('0x29')]!==_0x4816('0x37')){var _0x442a63={};_0x442a63[_0x30ed56[_0x4816('0x23')]]={'$like':'%'+_0x521259[_0x4816('0x2b')][_0x4816('0x35')]+'%'};return _0x442a63;}})});}_0x229086=_[_0x4816('0x36')]({},_0x229086,_0x521259[_0x4816('0x38')]);var _0x2d5752={'where':_0x229086[_0x4816('0x34')]};return db[_0x4816('0x26')][_0x4816('0x1c')](_0x2d5752)['then'](function(_0x3fa20c){_0x8ca388[_0x4816('0x1c')]=_0x3fa20c;if(_0x521259[_0x4816('0x2b')][_0x4816('0x39')]){_0x229086[_0x4816('0x3a')]=[{'all':!![]}];}return db[_0x4816('0x26')][_0x4816('0x3b')](_0x229086);})['then'](function(_0x39b205){_0x8ca388['rows']=_0x39b205;return _0x8ca388;})['then'](respondWithFilteredResult(_0x39ddbd,_0x229086))[_0x4816('0x3c')](handleError(_0x39ddbd,null));};exports[_0x4816('0x3d')]=function(_0x560170,_0x23d3a1){var _0x432bce={'raw':![],'where':{'id':_0x560170['params']['id']}},_0x476765={};_0x476765[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x26')][_0x4816('0x27')]);_0x476765[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x560170['query']);_0x476765[_0x4816('0x2c')]=_['intersection'](_0x476765['model'],_0x476765['query']);_0x432bce[_0x4816('0x30')]=_[_0x4816('0x2d')](_0x476765[_0x4816('0x2e')],qs[_0x4816('0x2f')](_0x560170[_0x4816('0x2b')][_0x4816('0x2f')]));_0x432bce[_0x4816('0x30')]=_0x432bce[_0x4816('0x30')][_0x4816('0x31')]?_0x432bce[_0x4816('0x30')]:_0x476765['model'];if(_0x560170['query'][_0x4816('0x39')]){_0x432bce[_0x4816('0x3a')]=[{'all':!![]}];}_0x432bce=_[_0x4816('0x36')]({},_0x432bce,_0x560170[_0x4816('0x38')]);return db[_0x4816('0x26')][_0x4816('0x3f')](_0x432bce)[_0x4816('0x21')](handleEntityNotFound(_0x23d3a1,null))[_0x4816('0x21')](respondWithResult(_0x23d3a1,null))['catch'](handleError(_0x23d3a1,null));};exports[_0x4816('0x40')]=function(_0x1ea828,_0x31993a){return db['FreshdeskAccount']['create'](_0x1ea828[_0x4816('0x41')],{})[_0x4816('0x21')](respondWithResult(_0x31993a,0xc9))[_0x4816('0x3c')](handleError(_0x31993a,null));};exports['update']=function(_0x247adb,_0x41ce8f){if(_0x247adb[_0x4816('0x41')]['id']){delete _0x247adb[_0x4816('0x41')]['id'];}return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x247adb[_0x4816('0x42')]['id']}})['then'](handleEntityNotFound(_0x41ce8f,null))[_0x4816('0x21')](saveUpdates(_0x247adb[_0x4816('0x41')],null))[_0x4816('0x21')](respondWithResult(_0x41ce8f,null))[_0x4816('0x3c')](handleError(_0x41ce8f,null));};exports[_0x4816('0x43')]=function(_0x47112a,_0x309778){return db[_0x4816('0x26')][_0x4816('0x3f')]({'where':{'id':_0x47112a[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x309778,null))[_0x4816('0x21')](removeEntity(_0x309778,null))[_0x4816('0x3c')](handleError(_0x309778,null));};exports[_0x4816('0x44')]=function(_0x2930f4,_0x433ac5,_0x306e86){var _0x11272b={};var _0x2e619f={};var _0x56321c;var _0x1702bf;return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2930f4[_0x4816('0x42')]['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x433ac5,null))['then'](function(_0x3604e6){if(_0x3604e6){_0x56321c=_0x3604e6;_0x2e619f[_0x4816('0x2e')]=_[_0x4816('0x3e')](db[_0x4816('0x45')][_0x4816('0x27')]);_0x2e619f[_0x4816('0x2b')]=_[_0x4816('0x3e')](_0x2930f4[_0x4816('0x2b')]);_0x2e619f[_0x4816('0x2c')]=_[_0x4816('0x2d')](_0x2e619f['model'],_0x2e619f[_0x4816('0x2b')]);_0x11272b['attributes']=_[_0x4816('0x2d')](_0x2e619f[_0x4816('0x2e')],qs['fields'](_0x2930f4[_0x4816('0x2b')][_0x4816('0x2f')]));_0x11272b[_0x4816('0x30')]=_0x11272b[_0x4816('0x30')][_0x4816('0x31')]?_0x11272b['attributes']:_0x2e619f[_0x4816('0x2e')];_0x11272b[_0x4816('0x46')]=qs[_0x4816('0x47')](_0x2930f4[_0x4816('0x2b')][_0x4816('0x47')]);_0x11272b[_0x4816('0x34')]=qs['filters'](_[_0x4816('0x48')](_0x2930f4[_0x4816('0x2b')],_0x2e619f[_0x4816('0x2c')]));if(_0x2930f4['query'][_0x4816('0x35')]){_0x11272b[_0x4816('0x34')]=_[_0x4816('0x36')](_0x11272b['where'],{'$or':_[_0x4816('0x25')](_0x11272b[_0x4816('0x30')],function(_0xa67f45){var _0xfb9e4a={};_0xfb9e4a[_0xa67f45]={'$like':'%'+_0x2930f4['query'][_0x4816('0x35')]+'%'};return _0xfb9e4a;})});}_0x11272b=_[_0x4816('0x36')]({},_0x11272b,_0x2930f4[_0x4816('0x38')]);return _0x56321c['getConfigurations'](_0x11272b);}})['then'](function(_0x2a9d8b){if(_0x2a9d8b){_0x1702bf=_0x2a9d8b[_0x4816('0x31')];if(!_0x2930f4[_0x4816('0x2b')][_0x4816('0x32')](_0x4816('0x33'))){_0x11272b[_0x4816('0x1b')]=qs[_0x4816('0x1b')](_0x2930f4['query'][_0x4816('0x1b')]);_0x11272b[_0x4816('0x19')]=qs[_0x4816('0x19')](_0x2930f4['query'][_0x4816('0x19')]);}return _0x56321c[_0x4816('0x44')](_0x11272b);}})[_0x4816('0x21')](function(_0x2c2a8c){if(_0x2c2a8c){return _0x2c2a8c?{'count':_0x1702bf,'rows':_0x2c2a8c}:null;}})[_0x4816('0x21')](respondWithResult(_0x433ac5,null))[_0x4816('0x3c')](handleError(_0x433ac5,null));};exports[_0x4816('0x49')]=function(_0x52cf85,_0x171c2b,_0x11e6f9){if(_0x52cf85[_0x4816('0x41')]['id']){delete _0x52cf85['body']['id'];}return db[_0x4816('0x26')][_0x4816('0x4a')]({'where':{'id':_0x52cf85['params']['id']}})[_0x4816('0x21')](handleEntityNotFound(_0x171c2b,null))[_0x4816('0x21')](function(_0x211a2b){if(_0x211a2b){_0x52cf85[_0x4816('0x41')][_0x4816('0x4b')]=_0x211a2b['id'];_0x52cf85[_0x4816('0x41')][_0x4816('0x4c')]=integrations['getSubjects'](_0x52cf85[_0x4816('0x41')]['channel'],_0x52cf85['body']['type']);_0x52cf85['body']['Descriptions']=integrations[_0x4816('0x4d')](_0x52cf85[_0x4816('0x41')][_0x4816('0x4e')],_0x52cf85['body'][_0x4816('0x29')]);return db[_0x4816('0x45')][_0x4816('0x40')](_0x52cf85[_0x4816('0x41')],{'include':[{'model':db[_0x4816('0x4f')],'as':_0x4816('0x4c')},{'model':db[_0x4816('0x4f')],'as':'Descriptions'}]});}return null;})[_0x4816('0x21')](respondWithResult(_0x171c2b,null))['catch'](handleError(_0x171c2b,null));};exports[_0x4816('0x50')]=function(_0x2cbc59,_0x5277dc,_0x3002b7){var _0x9165c8='';return db[_0x4816('0x26')]['findOne']({'where':{'id':_0x2cbc59[_0x4816('0x42')]['id']},'attributes':['id',_0x4816('0x51'),_0x4816('0x52')]})['then'](handleEntityNotFound(_0x5277dc,null))[_0x4816('0x21')](function(_0x1540cf){if(_0x1540cf){_0x9165c8=_0x1540cf[_0x4816('0x51')];var _0x5742fa=_0x9165c8[_0x4816('0x53')](-0x1);if(_0x5742fa==='/'){_0x9165c8=_0x9165c8[_0x4816('0x54')](0x0,_0x9165c8[_0x4816('0x55')](_0x5742fa));}return rp({'method':_0x4816('0x56'),'uri':util[_0x4816('0x57')](_0x4816('0x58'),_0x9165c8,_0x4816('0x59')),'headers':{'Authorization':util['format'](_0x4816('0x5a'),new Buffer(util[_0x4816('0x57')](_0x4816('0x5b'),_0x1540cf[_0x4816('0x52')]))[_0x4816('0x5c')](_0x4816('0x5d')))},'json':!![]});}})[_0x4816('0x21')](function(_0x4abba0){if(_0x4abba0){var _0x1d41a3=[_0x4816('0x5e'),_0x4816('0x5f'),_0x4816('0x60'),'description',_0x4816('0x16'),_0x4816('0x61'),_0x4816('0x62'),_0x4816('0x63'),_0x4816('0x64'),_0x4816('0x62'),_0x4816('0x65')];_[_0x4816('0x66')](_0x4abba0,function(_0x28419c){return _0x1d41a3[_0x4816('0x67')](_0x28419c[_0x4816('0x23')])||!_0x28419c[_0x4816('0x68')]&&_0x28419c[_0x4816('0x29')]!=='custom_text'&&_0x28419c[_0x4816('0x29')]!==_0x4816('0x69');});return{'count':_0x4abba0[_0x4816('0x31')],'rows':_[_0x4816('0x25')](_0x4abba0,function(_0x21fe50){return{'id':_0x21fe50[_0x4816('0x23')],'name':_0x21fe50[_0x4816('0x6a')],'custom':!_0x21fe50[_0x4816('0x68')],'options':_0x21fe50[_0x4816('0x6b')]?_[_0x4816('0x25')](_0x21fe50[_0x4816('0x6b')],function(_0x2bf3aa){return{'name':_[_0x4816('0x6c')](_0x2bf3aa),'value':_0x2bf3aa};}):[]};})};}})['then'](respondWithResult(_0x5277dc,null))[_0x4816('0x3c')](function(_0x2dca54){var _0xad3f8e=_0x2cbc59['query']['test']?0x1f4:_0x2dca54[_0x4816('0x6d')]||0x1f4;logger[_0x4816('0x6e')]('getFields,\x20%s,\x20%s,\x20%s',_0x4816('0x50'),_0xad3f8e,JSON[_0x4816('0x6f')](_0x2dca54));delete _0x2dca54[_0x4816('0x23')];if(_0xad3f8e===0x191){_0xad3f8e=0x190;}_0x5277dc[_0x4816('0x16')](_0xad3f8e)['send'](_0x2cbc59[_0x4816('0x2b')][_0x4816('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x2dca54[_0x4816('0x6d')]}:_0x2dca54);});};
\ No newline at end of file
+var _0x9c5e=['findOne','FreshdeskConfiguration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','Basic\x20%s','format','%s:X','toString','base64','agent','description','priority','group','source','company','remove','includes','custom_text','custom_dropdown','label','default','choices','test','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','FreshdeskAccount','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch','params','rawAttributes','find','create','body'];(function(_0x629d6a,_0x132a43){var _0x58a3fc=function(_0x398d22){while(--_0x398d22){_0x629d6a['push'](_0x629d6a['shift']());}};_0x58a3fc(++_0x132a43);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x49b934,_0x5c1416){_0x49b934=_0x49b934-0x0;var _0xea4057=_0x9c5e[_0x49b934];return _0xea4057;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];var integrations=require(_0xe9c5('0x19'));function respondWithStatusCode(_0x471401,_0x25ff11){_0x25ff11=_0x25ff11||0xcc;return function(_0x3962b8){if(_0x3962b8){return _0x471401[_0xe9c5('0x1a')](_0x25ff11);}return _0x471401['status'](_0x25ff11)[_0xe9c5('0x1b')]();};}function respondWithResult(_0xe98b11,_0x5eb474){_0x5eb474=_0x5eb474||0xc8;return function(_0x3bbd96){if(_0x3bbd96){return _0xe98b11[_0xe9c5('0x1c')](_0x5eb474)[_0xe9c5('0x1d')](_0x3bbd96);}};}function respondWithFilteredResult(_0x5d8236,_0x163253){return function(_0x14eb41){if(_0x14eb41){var _0x5d5fb4=typeof _0x163253[_0xe9c5('0x1e')]===_0xe9c5('0x1f')&&typeof _0x163253[_0xe9c5('0x20')]===_0xe9c5('0x1f');var _0x23156c=_0x14eb41['count'];var _0x3678fc=_0x5d5fb4?0x0:_0x163253[_0xe9c5('0x1e')];var _0x2f050b=_0x5d5fb4?_0x14eb41[_0xe9c5('0x21')]:_0x163253['offset']+_0x163253[_0xe9c5('0x20')];var _0x9d93d;if(_0x2f050b>=_0x23156c){_0x2f050b=_0x23156c;_0x9d93d=0xc8;}else{_0x9d93d=0xce;}_0x5d8236[_0xe9c5('0x1c')](_0x9d93d);return _0x5d8236[_0xe9c5('0x22')](_0xe9c5('0x23'),_0x3678fc+'-'+_0x2f050b+'/'+_0x23156c)['json'](_0x14eb41);}return null;};}function patchUpdates(_0x51e860){return function(_0xaa891){try{jsonpatch['apply'](_0xaa891,_0x51e860,!![]);}catch(_0x3c3d53){return BPromise[_0xe9c5('0x24')](_0x3c3d53);}return _0xaa891[_0xe9c5('0x25')]();};}function saveUpdates(_0x4d16bc,_0x5750ff){return function(_0x391582){if(_0x391582){return _0x391582[_0xe9c5('0x26')](_0x4d16bc)[_0xe9c5('0x27')](function(_0x189a13){return _0x189a13;});}return null;};}function removeEntity(_0x34a7c8,_0x245161){return function(_0x44ba59){if(_0x44ba59){return _0x44ba59[_0xe9c5('0x28')]()[_0xe9c5('0x27')](function(){_0x34a7c8[_0xe9c5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8bb7,_0x250e1c){return function(_0x3dd39d){if(!_0x3dd39d){_0x5c8bb7[_0xe9c5('0x1a')](0x194);}return _0x3dd39d;};}function handleError(_0x3bf679,_0x33fe71){_0x33fe71=_0x33fe71||0x1f4;return function(_0x100eda){logger['error'](_0x100eda[_0xe9c5('0x29')]);if(_0x100eda['name']){delete _0x100eda[_0xe9c5('0x2a')];}_0x3bf679['status'](_0x33fe71)[_0xe9c5('0x2b')](_0x100eda);};}exports[_0xe9c5('0x2c')]=function(_0x52d008,_0x36d145){var _0x46d253={},_0x334f5a={},_0x37cfa5={'count':0x0,'rows':[]};var _0x1fa0f6=_['map'](db[_0xe9c5('0x2d')]['rawAttributes'],function(_0x46d3e6){return{'name':_0x46d3e6['fieldName'],'type':_0x46d3e6[_0xe9c5('0x2e')][_0xe9c5('0x2f')]};});_0x334f5a[_0xe9c5('0x30')]=_[_0xe9c5('0x31')](_0x1fa0f6,_0xe9c5('0x2a'));_0x334f5a['query']=_[_0xe9c5('0x32')](_0x52d008[_0xe9c5('0x33')]);_0x334f5a[_0xe9c5('0x34')]=_[_0xe9c5('0x35')](_0x334f5a[_0xe9c5('0x30')],_0x334f5a['query']);_0x46d253['attributes']=_[_0xe9c5('0x35')](_0x334f5a[_0xe9c5('0x30')],qs[_0xe9c5('0x36')](_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x36')]));_0x46d253[_0xe9c5('0x37')]=_0x46d253[_0xe9c5('0x37')][_0xe9c5('0x38')]?_0x46d253['attributes']:_0x334f5a[_0xe9c5('0x30')];if(!_0x52d008[_0xe9c5('0x33')]['hasOwnProperty'](_0xe9c5('0x39'))){_0x46d253['limit']=qs[_0xe9c5('0x20')](_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x20')]);_0x46d253[_0xe9c5('0x1e')]=qs[_0xe9c5('0x1e')](_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x1e')]);}_0x46d253[_0xe9c5('0x3a')]=qs[_0xe9c5('0x3b')](_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x3b')]);_0x46d253[_0xe9c5('0x3c')]=qs[_0xe9c5('0x34')](_[_0xe9c5('0x3d')](_0x52d008[_0xe9c5('0x33')],_0x334f5a[_0xe9c5('0x34')]),_0x1fa0f6);if(_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x3e')]){_0x46d253[_0xe9c5('0x3c')]=_['merge'](_0x46d253[_0xe9c5('0x3c')],{'$or':_[_0xe9c5('0x31')](_0x1fa0f6,function(_0x19480d){if(_0x19480d[_0xe9c5('0x2e')]!==_0xe9c5('0x3f')){var _0x3b85bf={};_0x3b85bf[_0x19480d['name']]={'$like':'%'+_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x3e')]+'%'};return _0x3b85bf;}})});}_0x46d253=_[_0xe9c5('0x40')]({},_0x46d253,_0x52d008['options']);var _0x34eb01={'where':_0x46d253[_0xe9c5('0x3c')]};return db[_0xe9c5('0x2d')][_0xe9c5('0x21')](_0x34eb01)[_0xe9c5('0x27')](function(_0x3ad23f){_0x37cfa5[_0xe9c5('0x21')]=_0x3ad23f;if(_0x52d008[_0xe9c5('0x33')][_0xe9c5('0x41')]){_0x46d253[_0xe9c5('0x42')]=[{'all':!![]}];}return db[_0xe9c5('0x2d')]['findAll'](_0x46d253);})['then'](function(_0x101421){_0x37cfa5[_0xe9c5('0x43')]=_0x101421;return _0x37cfa5;})[_0xe9c5('0x27')](respondWithFilteredResult(_0x36d145,_0x46d253))[_0xe9c5('0x44')](handleError(_0x36d145,null));};exports['show']=function(_0x4a3fc5,_0x382405){var _0x144e85={'raw':![],'where':{'id':_0x4a3fc5[_0xe9c5('0x45')]['id']}},_0x539bae={};_0x539bae['model']=_['keys'](db['FreshdeskAccount'][_0xe9c5('0x46')]);_0x539bae[_0xe9c5('0x33')]=_[_0xe9c5('0x32')](_0x4a3fc5[_0xe9c5('0x33')]);_0x539bae['filters']=_[_0xe9c5('0x35')](_0x539bae[_0xe9c5('0x30')],_0x539bae[_0xe9c5('0x33')]);_0x144e85[_0xe9c5('0x37')]=_[_0xe9c5('0x35')](_0x539bae[_0xe9c5('0x30')],qs[_0xe9c5('0x36')](_0x4a3fc5[_0xe9c5('0x33')]['fields']));_0x144e85[_0xe9c5('0x37')]=_0x144e85[_0xe9c5('0x37')][_0xe9c5('0x38')]?_0x144e85[_0xe9c5('0x37')]:_0x539bae[_0xe9c5('0x30')];if(_0x4a3fc5[_0xe9c5('0x33')]['includeAll']){_0x144e85['include']=[{'all':!![]}];}_0x144e85=_['merge']({},_0x144e85,_0x4a3fc5['options']);return db[_0xe9c5('0x2d')][_0xe9c5('0x47')](_0x144e85)[_0xe9c5('0x27')](handleEntityNotFound(_0x382405,null))['then'](respondWithResult(_0x382405,null))[_0xe9c5('0x44')](handleError(_0x382405,null));};exports[_0xe9c5('0x48')]=function(_0x1ed99e,_0x1712a1){return db[_0xe9c5('0x2d')][_0xe9c5('0x48')](_0x1ed99e['body'],{})[_0xe9c5('0x27')](respondWithResult(_0x1712a1,0xc9))[_0xe9c5('0x44')](handleError(_0x1712a1,null));};exports[_0xe9c5('0x26')]=function(_0x249940,_0x4f0caa){if(_0x249940[_0xe9c5('0x49')]['id']){delete _0x249940[_0xe9c5('0x49')]['id'];}return db[_0xe9c5('0x2d')][_0xe9c5('0x47')]({'where':{'id':_0x249940[_0xe9c5('0x45')]['id']}})[_0xe9c5('0x27')](handleEntityNotFound(_0x4f0caa,null))['then'](saveUpdates(_0x249940[_0xe9c5('0x49')],null))[_0xe9c5('0x27')](respondWithResult(_0x4f0caa,null))[_0xe9c5('0x44')](handleError(_0x4f0caa,null));};exports[_0xe9c5('0x28')]=function(_0x5e7c24,_0x375f60){return db[_0xe9c5('0x2d')][_0xe9c5('0x47')]({'where':{'id':_0x5e7c24[_0xe9c5('0x45')]['id']}})[_0xe9c5('0x27')](handleEntityNotFound(_0x375f60,null))[_0xe9c5('0x27')](removeEntity(_0x375f60,null))['catch'](handleError(_0x375f60,null));};exports['getConfigurations']=function(_0x1235c3,_0x15380c,_0xf4a735){var _0x677922={};var _0x30a79b={};var _0x143928;var _0x2a9260;return db[_0xe9c5('0x2d')][_0xe9c5('0x4a')]({'where':{'id':_0x1235c3[_0xe9c5('0x45')]['id']}})[_0xe9c5('0x27')](handleEntityNotFound(_0x15380c,null))[_0xe9c5('0x27')](function(_0x2086fd){if(_0x2086fd){_0x143928=_0x2086fd;_0x30a79b[_0xe9c5('0x30')]=_[_0xe9c5('0x32')](db[_0xe9c5('0x4b')]['rawAttributes']);_0x30a79b['query']=_['keys'](_0x1235c3[_0xe9c5('0x33')]);_0x30a79b[_0xe9c5('0x34')]=_[_0xe9c5('0x35')](_0x30a79b['model'],_0x30a79b[_0xe9c5('0x33')]);_0x677922['attributes']=_[_0xe9c5('0x35')](_0x30a79b[_0xe9c5('0x30')],qs[_0xe9c5('0x36')](_0x1235c3[_0xe9c5('0x33')][_0xe9c5('0x36')]));_0x677922['attributes']=_0x677922[_0xe9c5('0x37')][_0xe9c5('0x38')]?_0x677922['attributes']:_0x30a79b[_0xe9c5('0x30')];_0x677922[_0xe9c5('0x3a')]=qs[_0xe9c5('0x3b')](_0x1235c3[_0xe9c5('0x33')]['sort']);_0x677922[_0xe9c5('0x3c')]=qs['filters'](_[_0xe9c5('0x3d')](_0x1235c3[_0xe9c5('0x33')],_0x30a79b[_0xe9c5('0x34')]));if(_0x1235c3[_0xe9c5('0x33')]['filter']){_0x677922[_0xe9c5('0x3c')]=_[_0xe9c5('0x40')](_0x677922[_0xe9c5('0x3c')],{'$or':_[_0xe9c5('0x31')](_0x677922[_0xe9c5('0x37')],function(_0x31963c){var _0x54253f={};_0x54253f[_0x31963c]={'$like':'%'+_0x1235c3[_0xe9c5('0x33')][_0xe9c5('0x3e')]+'%'};return _0x54253f;})});}_0x677922=_['merge']({},_0x677922,_0x1235c3[_0xe9c5('0x4c')]);return _0x143928['getConfigurations'](_0x677922);}})[_0xe9c5('0x27')](function(_0x227311){if(_0x227311){_0x2a9260=_0x227311[_0xe9c5('0x38')];if(!_0x1235c3[_0xe9c5('0x33')][_0xe9c5('0x4d')](_0xe9c5('0x39'))){_0x677922[_0xe9c5('0x20')]=qs['limit'](_0x1235c3[_0xe9c5('0x33')][_0xe9c5('0x20')]);_0x677922[_0xe9c5('0x1e')]=qs['offset'](_0x1235c3[_0xe9c5('0x33')]['offset']);}return _0x143928['getConfigurations'](_0x677922);}})[_0xe9c5('0x27')](function(_0x1af7d9){if(_0x1af7d9){return _0x1af7d9?{'count':_0x2a9260,'rows':_0x1af7d9}:null;}})[_0xe9c5('0x27')](respondWithResult(_0x15380c,null))[_0xe9c5('0x44')](handleError(_0x15380c,null));};exports[_0xe9c5('0x4e')]=function(_0x1bd2f5,_0x3c4280,_0x18820f){if(_0x1bd2f5[_0xe9c5('0x49')]['id']){delete _0x1bd2f5[_0xe9c5('0x49')]['id'];}return db['FreshdeskAccount'][_0xe9c5('0x4a')]({'where':{'id':_0x1bd2f5[_0xe9c5('0x45')]['id']}})[_0xe9c5('0x27')](handleEntityNotFound(_0x3c4280,null))[_0xe9c5('0x27')](function(_0x3e2c1b){if(_0x3e2c1b){_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x4f')]=_0x3e2c1b['id'];_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x50')]=integrations['getSubjects'](_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x51')],_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x2e')]);_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x52')]=integrations[_0xe9c5('0x53')](_0x1bd2f5['body'][_0xe9c5('0x51')],_0x1bd2f5[_0xe9c5('0x49')][_0xe9c5('0x2e')]);return db[_0xe9c5('0x4b')][_0xe9c5('0x48')](_0x1bd2f5['body'],{'include':[{'model':db[_0xe9c5('0x54')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xe9c5('0x52')}]});}return null;})[_0xe9c5('0x27')](respondWithResult(_0x3c4280,null))['catch'](handleError(_0x3c4280,null));};exports['getFields']=function(_0x2a4821,_0x583369,_0x476fee){var _0x4155d4='';return db['FreshdeskAccount'][_0xe9c5('0x4a')]({'where':{'id':_0x2a4821[_0xe9c5('0x45')]['id']},'attributes':['id',_0xe9c5('0x55'),_0xe9c5('0x56')]})[_0xe9c5('0x27')](handleEntityNotFound(_0x583369,null))[_0xe9c5('0x27')](function(_0x58b9b2){if(_0x58b9b2){_0x4155d4=_0x58b9b2[_0xe9c5('0x55')];var _0x12bf41=_0x4155d4[_0xe9c5('0x57')](-0x1);if(_0x12bf41==='/'){_0x4155d4=_0x4155d4[_0xe9c5('0x58')](0x0,_0x4155d4[_0xe9c5('0x59')](_0x12bf41));}return rp({'method':_0xe9c5('0x5a'),'uri':util['format'](_0xe9c5('0x5b'),_0x4155d4,_0xe9c5('0x5c')),'headers':{'Authorization':util['format'](_0xe9c5('0x5d'),new Buffer(util[_0xe9c5('0x5e')](_0xe9c5('0x5f'),_0x58b9b2[_0xe9c5('0x56')]))[_0xe9c5('0x60')](_0xe9c5('0x61')))},'json':!![]});}})['then'](function(_0x399161){if(_0x399161){var _0x5b1fc4=['requester','subject',_0xe9c5('0x62'),_0xe9c5('0x63'),_0xe9c5('0x1c'),_0xe9c5('0x64'),_0xe9c5('0x65'),_0xe9c5('0x66'),'ticket_type',_0xe9c5('0x65'),_0xe9c5('0x67')];_[_0xe9c5('0x68')](_0x399161,function(_0x355b46){return _0x5b1fc4[_0xe9c5('0x69')](_0x355b46['name'])||!_0x355b46['default']&&_0x355b46[_0xe9c5('0x2e')]!==_0xe9c5('0x6a')&&_0x355b46[_0xe9c5('0x2e')]!==_0xe9c5('0x6b');});return{'count':_0x399161[_0xe9c5('0x38')],'rows':_['map'](_0x399161,function(_0x308f01){return{'id':_0x308f01['name'],'name':_0x308f01[_0xe9c5('0x6c')],'custom':!_0x308f01[_0xe9c5('0x6d')],'options':_0x308f01[_0xe9c5('0x6e')]?_['map'](_0x308f01['choices'],function(_0x505e1c){return{'name':_['capitalize'](_0x505e1c),'value':_0x505e1c};}):[]};})};}})['then'](respondWithResult(_0x583369,null))[_0xe9c5('0x44')](function(_0x29cb33){var _0x100a33=_0x2a4821[_0xe9c5('0x33')][_0xe9c5('0x6f')]?0x1f4:_0x29cb33['statusCode']||0x1f4;logger[_0xe9c5('0x70')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x100a33,JSON[_0xe9c5('0x71')](_0x29cb33));delete _0x29cb33['name'];if(_0x100a33===0x191){_0x100a33=0x190;}_0x583369['status'](_0x100a33)['send'](_0x2a4821[_0xe9c5('0x33')]['test']?{'message':_0xe9c5('0x72'),'statusCode':_0x29cb33['statusCode']}:_0x29cb33);});};
\ No newline at end of file
index e817795..b663cb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b72=['request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5186b7,_0x949724){var _0x138be6=function(_0x2b3f82){while(--_0x2b3f82){_0x5186b7['push'](_0x5186b7['shift']());}};_0x138be6(++_0x949724);}(_0x5b72,0x14a));var _0x25b7=function(_0x4f2d54,_0x2ead29){_0x4f2d54=_0x4f2d54-0x0;var _0x13f7db=_0x5b72[_0x4f2d54];return _0x13f7db;};'use strict';var _=require(_0x25b7('0x0'));var util=require(_0x25b7('0x1'));var logger=require(_0x25b7('0x2'))(_0x25b7('0x3'));var moment=require(_0x25b7('0x4'));var BPromise=require(_0x25b7('0x5'));var rp=require(_0x25b7('0x6'));var fs=require('fs');var path=require(_0x25b7('0x7'));var rimraf=require('rimraf');var config=require(_0x25b7('0x8'));var attributes=require(_0x25b7('0x9'));var integrations=require(_0x25b7('0xa'));module[_0x25b7('0xb')]=function(_0x56bfa0,_0xddae6d){return _0x56bfa0['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x174f=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','util'];(function(_0x5daef8,_0x46f940){var _0x431b34=function(_0x2459ce){while(--_0x2459ce){_0x5daef8['push'](_0x5daef8['shift']());}};_0x431b34(++_0x46f940);}(_0x174f,0x83));var _0xf174=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x174f[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require('lodash');var util=require(_0xf174('0x0'));var logger=require(_0xf174('0x1'))(_0xf174('0x2'));var moment=require(_0xf174('0x3'));var BPromise=require(_0xf174('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf174('0x5'));var config=require(_0xf174('0x6'));var attributes=require(_0xf174('0x7'));var integrations=require(_0xf174('0x8'));module['exports']=function(_0x5d07e0,_0x2c9f24){return _0x5d07e0[_0xf174('0x9')](_0xf174('0xa'),attributes,{'tableName':_0xf174('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2cd9d47..31837bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40ea=['result','catch','GetFreshdeskAccount','raw','options','where','limit','include','attributes','map','model','ShowFreshdeskAccount','FreshdeskAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5e570c,_0x233990){var _0xc62527=function(_0xd18777){while(--_0xd18777){_0x5e570c['push'](_0x5e570c['shift']());}};_0xc62527(++_0x233990);}(_0x40ea,0x99));var _0xa40e=function(_0x5b8e08,_0x3131d9){_0x5b8e08=_0x5b8e08-0x0;var _0x31f09b=_0x40ea[_0x5b8e08];return _0x31f09b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa40e('0x0'));var BPromise=require(_0xa40e('0x1'));var rs=require(_0xa40e('0x2'));var fs=require('fs');var Redis=require(_0xa40e('0x3'));var db=require(_0xa40e('0x4'))['db'];var utils=require(_0xa40e('0x5'));var logger=require(_0xa40e('0x6'))(_0xa40e('0x7'));var config=require(_0xa40e('0x8'));var jayson=require(_0xa40e('0x9'));var client=jayson['client'][_0xa40e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x990486,_0x531b88,_0x4dc534){return new BPromise(function(_0x5624ef,_0x1651ec){return client[_0xa40e('0xb')](_0x990486,_0x4dc534)[_0xa40e('0xc')](function(_0x15523e){logger['info'](_0xa40e('0xd'),_0x531b88,_0xa40e('0xe'));logger[_0xa40e('0xf')](_0xa40e('0x10'),_0x531b88,_0xa40e('0xe'),JSON[_0xa40e('0x11')](_0x15523e));if(_0x15523e[_0xa40e('0x12')]){if(_0x15523e[_0xa40e('0x12')][_0xa40e('0x13')]===0x1f4){logger[_0xa40e('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);return _0x1651ec(_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);}logger[_0xa40e('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);return _0x5624ef(_0x15523e[_0xa40e('0x12')][_0xa40e('0x14')]);}else{logger[_0xa40e('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x531b88,_0xa40e('0xe'));_0x5624ef(_0x15523e[_0xa40e('0x16')][_0xa40e('0x14')]);}})[_0xa40e('0x17')](function(_0x353659){logger[_0xa40e('0x12')](_0xa40e('0xd'),_0x531b88,_0x353659);_0x1651ec(_0x353659);});});}exports[_0xa40e('0x18')]=function(_0x1e70b8){var _0x2930bd=this;return new Promise(function(_0x33bf2a,_0x9daf9f){return db['FreshdeskAccount']['findAll']({'raw':_0x1e70b8['options']?_0x1e70b8['options'][_0xa40e('0x19')]===undefined?!![]:![]:!![],'where':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options'][_0xa40e('0x1b')]||null:null,'attributes':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options']['attributes']||null:null,'limit':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8['options'][_0xa40e('0x1c')]||null:null,'include':_0x1e70b8[_0xa40e('0x1a')]?_0x1e70b8[_0xa40e('0x1a')][_0xa40e('0x1d')]?_['map'](_0x1e70b8[_0xa40e('0x1a')][_0xa40e('0x1d')],function(_0xfe9c86){return{'model':db[_0xfe9c86['model']],'as':_0xfe9c86['as'],'attributes':_0xfe9c86[_0xa40e('0x1e')],'include':_0xfe9c86[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0xfe9c86['include'],function(_0x3b21ab){return{'model':db[_0x3b21ab[_0xa40e('0x20')]],'as':_0x3b21ab['as'],'attributes':_0x3b21ab[_0xa40e('0x1e')],'include':_0x3b21ab[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x3b21ab[_0xa40e('0x1d')],function(_0x47ecf4){return{'model':db[_0x47ecf4[_0xa40e('0x20')]],'as':_0x47ecf4['as'],'attributes':_0x47ecf4['attributes']};}):[]};}):[]};}):[]:[]})[_0xa40e('0xc')](function(_0x85e951){logger['info'](_0xa40e('0x18'),_0x1e70b8);logger[_0xa40e('0xf')](_0xa40e('0x18'),_0x1e70b8,JSON[_0xa40e('0x11')](_0x85e951));_0x33bf2a(_0x85e951);})['catch'](function(_0x2a6ba7){logger[_0xa40e('0x12')]('GetFreshdeskAccount',_0x2a6ba7[_0xa40e('0x14')],_0x1e70b8);_0x9daf9f(_0x2930bd[_0xa40e('0x12')](0x1f4,_0x2a6ba7[_0xa40e('0x14')]));});});};exports[_0xa40e('0x21')]=function(_0x33853a){var _0x40a727=this;return new Promise(function(_0x4a83bd,_0x4a5003){return db[_0xa40e('0x22')]['find']({'raw':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x19')]===undefined?!![]:![]:!![],'where':_0x33853a[_0xa40e('0x1a')]?_0x33853a['options'][_0xa40e('0x1b')]||null:null,'attributes':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1e')]||null:null,'include':_0x33853a[_0xa40e('0x1a')]?_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x33853a[_0xa40e('0x1a')][_0xa40e('0x1d')],function(_0x3b694b){return{'model':db[_0x3b694b['model']],'as':_0x3b694b['as'],'attributes':_0x3b694b[_0xa40e('0x1e')],'include':_0x3b694b['include']?_[_0xa40e('0x1f')](_0x3b694b[_0xa40e('0x1d')],function(_0x40bdd9){return{'model':db[_0x40bdd9[_0xa40e('0x20')]],'as':_0x40bdd9['as'],'attributes':_0x40bdd9[_0xa40e('0x1e')],'include':_0x40bdd9[_0xa40e('0x1d')]?_[_0xa40e('0x1f')](_0x40bdd9[_0xa40e('0x1d')],function(_0x5a9ab5){return{'model':db[_0x5a9ab5[_0xa40e('0x20')]],'as':_0x5a9ab5['as'],'attributes':_0x5a9ab5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56b726){logger['info']('ShowFreshdeskAccount',_0x33853a);logger[_0xa40e('0xf')]('ShowFreshdeskAccount',_0x33853a,JSON[_0xa40e('0x11')](_0x56b726));_0x4a83bd(_0x56b726);})[_0xa40e('0x17')](function(_0x1d006d){logger[_0xa40e('0x12')](_0xa40e('0x21'),_0x1d006d[_0xa40e('0x14')],_0x33853a);_0x4a5003(_0x40a727['error'](0x1f4,_0x1d006d['message']));});});};
\ No newline at end of file
+var _0xc906=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','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','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','catch','lodash','util','bluebird'];(function(_0x16ce4b,_0x2097c4){var _0x346707=function(_0x166d4a){while(--_0x166d4a){_0x16ce4b['push'](_0x16ce4b['shift']());}};_0x346707(++_0x2097c4);}(_0xc906,0x1ad));var _0x6c90=function(_0x38ac42,_0x1b5175){_0x38ac42=_0x38ac42-0x0;var _0x45ee0e=_0xc906[_0x38ac42];return _0x45ee0e;};'use strict';var _=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var moment=require('moment');var BPromise=require(_0x6c90('0x2'));var rs=require(_0x6c90('0x3'));var fs=require('fs');var Redis=require(_0x6c90('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c90('0x5'));var logger=require(_0x6c90('0x6'))(_0x6c90('0x7'));var config=require(_0x6c90('0x8'));var jayson=require(_0x6c90('0x9'));var client=jayson[_0x6c90('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c1d85,_0x5cf85f,_0x2a960d){return new BPromise(function(_0x54d440,_0x2af0f0){return client[_0x6c90('0xb')](_0x4c1d85,_0x2a960d)[_0x6c90('0xc')](function(_0x207e03){logger[_0x6c90('0xd')](_0x6c90('0xe'),_0x5cf85f,_0x6c90('0xf'));logger[_0x6c90('0x10')](_0x6c90('0x11'),_0x5cf85f,_0x6c90('0xf'),JSON[_0x6c90('0x12')](_0x207e03));if(_0x207e03[_0x6c90('0x13')]){if(_0x207e03[_0x6c90('0x13')][_0x6c90('0x14')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x5cf85f,_0x207e03[_0x6c90('0x13')][_0x6c90('0x15')]);return _0x2af0f0(_0x207e03[_0x6c90('0x13')][_0x6c90('0x15')]);}logger[_0x6c90('0x13')](_0x6c90('0xe'),_0x5cf85f,_0x207e03[_0x6c90('0x13')][_0x6c90('0x15')]);return _0x54d440(_0x207e03[_0x6c90('0x13')][_0x6c90('0x15')]);}else{logger['info'](_0x6c90('0xe'),_0x5cf85f,_0x6c90('0xf'));_0x54d440(_0x207e03[_0x6c90('0x16')][_0x6c90('0x15')]);}})['catch'](function(_0x111217){logger[_0x6c90('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x5cf85f,_0x111217);_0x2af0f0(_0x111217);});});}exports[_0x6c90('0x17')]=function(_0x3f9572){var _0x1701d5=this;return new Promise(function(_0x424902,_0x222ea3){return db[_0x6c90('0x18')]['findAll']({'raw':_0x3f9572[_0x6c90('0x19')]?_0x3f9572[_0x6c90('0x19')][_0x6c90('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f9572['options']?_0x3f9572['options'][_0x6c90('0x1b')]||null:null,'attributes':_0x3f9572[_0x6c90('0x19')]?_0x3f9572['options'][_0x6c90('0x1c')]||null:null,'limit':_0x3f9572['options']?_0x3f9572[_0x6c90('0x19')][_0x6c90('0x1d')]||null:null,'include':_0x3f9572['options']?_0x3f9572[_0x6c90('0x19')]['include']?_['map'](_0x3f9572[_0x6c90('0x19')]['include'],function(_0x26139e){return{'model':db[_0x26139e['model']],'as':_0x26139e['as'],'attributes':_0x26139e[_0x6c90('0x1c')],'include':_0x26139e[_0x6c90('0x1e')]?_[_0x6c90('0x1f')](_0x26139e[_0x6c90('0x1e')],function(_0xf51b92){return{'model':db[_0xf51b92['model']],'as':_0xf51b92['as'],'attributes':_0xf51b92[_0x6c90('0x1c')],'include':_0xf51b92[_0x6c90('0x1e')]?_['map'](_0xf51b92[_0x6c90('0x1e')],function(_0x5aaf2f){return{'model':db[_0x5aaf2f[_0x6c90('0x20')]],'as':_0x5aaf2f['as'],'attributes':_0x5aaf2f[_0x6c90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6c90('0xc')](function(_0x20e4f7){logger[_0x6c90('0xd')]('GetFreshdeskAccount',_0x3f9572);logger[_0x6c90('0x10')](_0x6c90('0x17'),_0x3f9572,JSON[_0x6c90('0x12')](_0x20e4f7));_0x424902(_0x20e4f7);})['catch'](function(_0x17dfbd){logger[_0x6c90('0x13')](_0x6c90('0x17'),_0x17dfbd[_0x6c90('0x15')],_0x3f9572);_0x222ea3(_0x1701d5[_0x6c90('0x13')](0x1f4,_0x17dfbd[_0x6c90('0x15')]));});});};exports[_0x6c90('0x21')]=function(_0x4a010e){var _0x366ccd=this;return new Promise(function(_0x290b0d,_0x131a83){return db['FreshdeskAccount'][_0x6c90('0x22')]({'raw':_0x4a010e[_0x6c90('0x19')]?_0x4a010e[_0x6c90('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4a010e[_0x6c90('0x19')]?_0x4a010e['options'][_0x6c90('0x1b')]||null:null,'attributes':_0x4a010e['options']?_0x4a010e[_0x6c90('0x19')]['attributes']||null:null,'include':_0x4a010e[_0x6c90('0x19')]?_0x4a010e['options'][_0x6c90('0x1e')]?_[_0x6c90('0x1f')](_0x4a010e['options']['include'],function(_0x2a01ba){return{'model':db[_0x2a01ba['model']],'as':_0x2a01ba['as'],'attributes':_0x2a01ba[_0x6c90('0x1c')],'include':_0x2a01ba[_0x6c90('0x1e')]?_[_0x6c90('0x1f')](_0x2a01ba[_0x6c90('0x1e')],function(_0x1ad62a){return{'model':db[_0x1ad62a[_0x6c90('0x20')]],'as':_0x1ad62a['as'],'attributes':_0x1ad62a[_0x6c90('0x1c')],'include':_0x1ad62a['include']?_[_0x6c90('0x1f')](_0x1ad62a[_0x6c90('0x1e')],function(_0x4d1dc9){return{'model':db[_0x4d1dc9[_0x6c90('0x20')]],'as':_0x4d1dc9['as'],'attributes':_0x4d1dc9[_0x6c90('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6c90('0xc')](function(_0x103c35){logger[_0x6c90('0xd')](_0x6c90('0x21'),_0x4a010e);logger['debug']('ShowFreshdeskAccount',_0x4a010e,JSON[_0x6c90('0x12')](_0x103c35));_0x290b0d(_0x103c35);})[_0x6c90('0x23')](function(_0x58024a){logger['error'](_0x6c90('0x21'),_0x58024a[_0x6c90('0x15')],_0x4a010e);_0x131a83(_0x366ccd[_0x6c90('0x13')](0x1f4,_0x58024a[_0x6c90('0x15')]));});});};
\ No newline at end of file
index 8e7b860..6ea7d71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e1c=['Router','fs-extra','../../components/auth/service','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x4e1c,0x17c));var _0xc4e1=function(_0xa46b86,_0x5c1465){_0xa46b86=_0xa46b86-0x0;var _0x417360=_0x4e1c[_0xa46b86];return _0x417360;};'use strict';var multer=require('multer');var util=require(_0xc4e1('0x0'));var path=require(_0xc4e1('0x1'));var timeout=require(_0xc4e1('0x2'));var express=require(_0xc4e1('0x3'));var router=express[_0xc4e1('0x4')]();var fs_extra=require(_0xc4e1('0x5'));var auth=require(_0xc4e1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc4e1('0x7'));router[_0xc4e1('0x8')]('/',auth['isAuthenticated'](),controller[_0xc4e1('0x9')]);router[_0xc4e1('0x8')](_0xc4e1('0xa'),auth[_0xc4e1('0xb')](),controller['show']);router[_0xc4e1('0x8')](_0xc4e1('0xc'),auth[_0xc4e1('0xb')](),controller['getFields']);router[_0xc4e1('0x8')](_0xc4e1('0xd'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0xe')]);router[_0xc4e1('0x8')](_0xc4e1('0xf'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x10')]);router[_0xc4e1('0x8')](_0xc4e1('0x11'),auth[_0xc4e1('0xb')](),controller['getTags']);router[_0xc4e1('0x12')]('/',auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x13')]);router[_0xc4e1('0x12')](_0xc4e1('0x11'),auth[_0xc4e1('0xb')](),controller['setTags']);router[_0xc4e1('0x14')](_0xc4e1('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc4e1('0x15')](_0xc4e1('0xa'),auth[_0xc4e1('0xb')](),controller[_0xc4e1('0x16')]);module[_0xc4e1('0x17')]=router;
\ No newline at end of file
+var _0xb781=['./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xb781,0x1a8));var _0x1b78=function(_0xbb664a,_0x424a42){_0xbb664a=_0xbb664a-0x0;var _0x3d9e42=_0xb781[_0xbb664a];return _0x3d9e42;};'use strict';var multer=require(_0x1b78('0x0'));var util=require(_0x1b78('0x1'));var path=require(_0x1b78('0x2'));var timeout=require(_0x1b78('0x3'));var express=require(_0x1b78('0x4'));var router=express[_0x1b78('0x5')]();var fs_extra=require(_0x1b78('0x6'));var auth=require(_0x1b78('0x7'));var interaction=require(_0x1b78('0x8'));var config=require(_0x1b78('0x9'));var controller=require(_0x1b78('0xa'));router[_0x1b78('0xb')]('/',auth[_0x1b78('0xc')](),controller[_0x1b78('0xd')]);router['get'](_0x1b78('0xe'),auth[_0x1b78('0xc')](),controller['show']);router[_0x1b78('0xb')](_0x1b78('0xf'),auth['isAuthenticated'](),controller[_0x1b78('0x10')]);router[_0x1b78('0xb')](_0x1b78('0x11'),auth[_0x1b78('0xc')](),controller[_0x1b78('0x12')]);router[_0x1b78('0xb')](_0x1b78('0x13'),auth[_0x1b78('0xc')](),controller[_0x1b78('0x14')]);router[_0x1b78('0xb')]('/:id/tags',auth[_0x1b78('0xc')](),controller[_0x1b78('0x15')]);router[_0x1b78('0x16')]('/',auth['isAuthenticated'](),controller[_0x1b78('0x17')]);router[_0x1b78('0x16')](_0x1b78('0x18'),auth[_0x1b78('0xc')](),controller[_0x1b78('0x19')]);router[_0x1b78('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x1b78('0x1b')]);router[_0x1b78('0x1c')](_0x1b78('0xe'),auth['isAuthenticated'](),controller[_0x1b78('0x1d')]);module[_0x1b78('0x1e')]=router;
\ No newline at end of file
index 7135c65..edacb23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e10=['exports','STRING'];(function(_0x458f10,_0x291210){var _0x198bb=function(_0x5b1e59){while(--_0x5b1e59){_0x458f10['push'](_0x458f10['shift']());}};_0x198bb(++_0x291210);}(_0x8e10,0x1ea));var _0x08e1=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x8e10[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0x08e1('0x0')]={'name':{'type':Sequelize[_0x08e1('0x1')]},'description':{'type':Sequelize[_0x08e1('0x1')]}};
\ No newline at end of file
+var _0x1123=['STRING'];(function(_0x4012b4,_0x46946e){var _0x20231f=function(_0x50b85e){while(--_0x50b85e){_0x4012b4['push'](_0x4012b4['shift']());}};_0x20231f(++_0x46946e);}(_0x1123,0x90));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3112('0x0')]}};
\ No newline at end of file
index a17f80a..94eba2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x809c=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','FreshdeskConfiguration','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length'];(function(_0x37f9c1,_0x217be1){var _0x27b999=function(_0x185289){while(--_0x185289){_0x37f9c1['push'](_0x37f9c1['shift']());}};_0x27b999(++_0x217be1);}(_0x809c,0x69));var _0xc809=function(_0x58a45f,_0x42dd71){_0x58a45f=_0x58a45f-0x0;var _0x2daa1b=_0x809c[_0x58a45f];return _0x2daa1b;};'use strict';var emlformat=require(_0xc809('0x0'));var rimraf=require(_0xc809('0x1'));var zipdir=require(_0xc809('0x2'));var jsonpatch=require(_0xc809('0x3'));var rp=require(_0xc809('0x4'));var moment=require('moment');var BPromise=require(_0xc809('0x5'));var Mustache=require(_0xc809('0x6'));var util=require('util');var path=require(_0xc809('0x7'));var sox=require('sox');var csv=require(_0xc809('0x8'));var ejs=require(_0xc809('0x9'));var fs=require('fs');var fs_extra=require(_0xc809('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc809('0xb'));var deskjs=require(_0xc809('0xc'));var toCsv=require(_0xc809('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc809('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc809('0xe'));var as=require(_0xc809('0xf'));var hardwareService=require(_0xc809('0x10'));var logger=require(_0xc809('0x11'))(_0xc809('0x12'));var utils=require(_0xc809('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc809('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x875dae,_0x3a186a){_0x3a186a=_0x3a186a||0xcc;return function(_0xb798cb){if(_0xb798cb){return _0x875dae[_0xc809('0x15')](_0x3a186a);}return _0x875dae[_0xc809('0x16')](_0x3a186a)['end']();};}function respondWithResult(_0x4a84af,_0x38ccc6){_0x38ccc6=_0x38ccc6||0xc8;return function(_0x5e8900){if(_0x5e8900){return _0x4a84af[_0xc809('0x16')](_0x38ccc6)[_0xc809('0x17')](_0x5e8900);}};}function respondWithFilteredResult(_0x3f2428,_0x152198){return function(_0x51e204){if(_0x51e204){var _0x2128bb=typeof _0x152198[_0xc809('0x18')]===_0xc809('0x19')&&typeof _0x152198[_0xc809('0x1a')]==='undefined';var _0x10a414=_0x51e204[_0xc809('0x1b')];var _0x36855a=_0x2128bb?0x0:_0x152198[_0xc809('0x18')];var _0x3b1359=_0x2128bb?_0x51e204['count']:_0x152198[_0xc809('0x18')]+_0x152198[_0xc809('0x1a')];var _0x25d852;if(_0x3b1359>=_0x10a414){_0x3b1359=_0x10a414;_0x25d852=0xc8;}else{_0x25d852=0xce;}_0x3f2428[_0xc809('0x16')](_0x25d852);return _0x3f2428['set'](_0xc809('0x1c'),_0x36855a+'-'+_0x3b1359+'/'+_0x10a414)[_0xc809('0x17')](_0x51e204);}return null;};}function patchUpdates(_0x27fbc1){return function(_0x42d6a6){try{jsonpatch['apply'](_0x42d6a6,_0x27fbc1,!![]);}catch(_0x4769e0){return BPromise['reject'](_0x4769e0);}return _0x42d6a6[_0xc809('0x1d')]();};}function saveUpdates(_0x34028e,_0x13108a){return function(_0x14eb1c){if(_0x14eb1c){return _0x14eb1c[_0xc809('0x1e')](_0x34028e)['then'](function(_0x4b4325){return _0x4b4325;});}return null;};}function removeEntity(_0x5ed97a,_0x1f02c3){return function(_0x40a122){if(_0x40a122){return _0x40a122[_0xc809('0x1f')]()[_0xc809('0x20')](function(){_0x5ed97a[_0xc809('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x254722,_0xb471ab){return function(_0x2c51e7){if(!_0x2c51e7){_0x254722[_0xc809('0x15')](0x194);}return _0x2c51e7;};}function handleError(_0x3bcbf0,_0x277a68){_0x277a68=_0x277a68||0x1f4;return function(_0x2356a4){logger['error'](_0x2356a4['stack']);if(_0x2356a4[_0xc809('0x21')]){delete _0x2356a4[_0xc809('0x21')];}_0x3bcbf0['status'](_0x277a68)['send'](_0x2356a4);};}exports[_0xc809('0x22')]=function(_0x1bc4ba,_0x50bc9d){var _0x1c5948={},_0x4ca63d={},_0x3502a7={'count':0x0,'rows':[]};var _0x5c61f6=_[_0xc809('0x23')](db['FreshdeskConfiguration'][_0xc809('0x24')],function(_0x189c98){return{'name':_0x189c98[_0xc809('0x25')],'type':_0x189c98[_0xc809('0x26')][_0xc809('0x27')]};});_0x4ca63d['model']=_[_0xc809('0x23')](_0x5c61f6,_0xc809('0x21'));_0x4ca63d[_0xc809('0x28')]=_['keys'](_0x1bc4ba['query']);_0x4ca63d[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x4ca63d[_0xc809('0x2b')],_0x4ca63d['query']);_0x1c5948[_0xc809('0x2c')]=_['intersection'](_0x4ca63d[_0xc809('0x2b')],qs['fields'](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x2d')]));_0x1c5948[_0xc809('0x2c')]=_0x1c5948['attributes'][_0xc809('0x2e')]?_0x1c5948[_0xc809('0x2c')]:_0x4ca63d[_0xc809('0x2b')];if(!_0x1bc4ba[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x1c5948[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x1a')]);_0x1c5948['offset']=qs['offset'](_0x1bc4ba[_0xc809('0x28')][_0xc809('0x18')]);}_0x1c5948[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x1bc4ba['query'][_0xc809('0x32')]);_0x1c5948[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x1bc4ba[_0xc809('0x28')],_0x4ca63d['filters']),_0x5c61f6);if(_0x1bc4ba[_0xc809('0x28')]['filter']){_0x1c5948['where']=_[_0xc809('0x35')](_0x1c5948[_0xc809('0x33')],{'$or':_['map'](_0x5c61f6,function(_0x17ec15){if(_0x17ec15[_0xc809('0x26')]!==_0xc809('0x36')){var _0x52f267={};_0x52f267[_0x17ec15[_0xc809('0x21')]]={'$like':'%'+_0x1bc4ba['query'][_0xc809('0x37')]+'%'};return _0x52f267;}})});}_0x1c5948=_['merge']({},_0x1c5948,_0x1bc4ba['options']);var _0x54d38e={'where':_0x1c5948[_0xc809('0x33')]};return db[_0xc809('0x38')][_0xc809('0x1b')](_0x54d38e)[_0xc809('0x20')](function(_0x33f13a){_0x3502a7[_0xc809('0x1b')]=_0x33f13a;if(_0x1bc4ba[_0xc809('0x28')][_0xc809('0x39')]){_0x1c5948[_0xc809('0x3a')]=[{'all':!![]}];}return db[_0xc809('0x38')][_0xc809('0x3b')](_0x1c5948);})['then'](function(_0x43c21d){_0x3502a7['rows']=_0x43c21d;return _0x3502a7;})[_0xc809('0x20')](respondWithFilteredResult(_0x50bc9d,_0x1c5948))[_0xc809('0x3c')](handleError(_0x50bc9d,null));};exports[_0xc809('0x3d')]=function(_0x1dc11f,_0x57f9ca){var _0x58fef4={'raw':![],'where':{'id':_0x1dc11f[_0xc809('0x3e')]['id']}},_0x2d44f6={};_0x2d44f6['model']=_[_0xc809('0x3f')](db['FreshdeskConfiguration'][_0xc809('0x24')]);_0x2d44f6[_0xc809('0x28')]=_['keys'](_0x1dc11f['query']);_0x2d44f6['filters']=_[_0xc809('0x2a')](_0x2d44f6[_0xc809('0x2b')],_0x2d44f6[_0xc809('0x28')]);_0x58fef4[_0xc809('0x2c')]=_['intersection'](_0x2d44f6[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x1dc11f['query']['fields']));_0x58fef4['attributes']=_0x58fef4[_0xc809('0x2c')]['length']?_0x58fef4[_0xc809('0x2c')]:_0x2d44f6[_0xc809('0x2b')];if(_0x1dc11f[_0xc809('0x28')][_0xc809('0x39')]){_0x58fef4[_0xc809('0x3a')]=[{'all':!![]}];}_0x58fef4=_[_0xc809('0x35')]({},_0x58fef4,_0x1dc11f[_0xc809('0x40')]);return db[_0xc809('0x38')][_0xc809('0x41')](_0x58fef4)[_0xc809('0x20')](handleEntityNotFound(_0x57f9ca,null))[_0xc809('0x20')](respondWithResult(_0x57f9ca,null))[_0xc809('0x3c')](handleError(_0x57f9ca,null));};exports[_0xc809('0x42')]=function(_0x57b3c3,_0x19fe7c){return db[_0xc809('0x38')]['create'](_0x57b3c3[_0xc809('0x43')],{})[_0xc809('0x20')](respondWithResult(_0x19fe7c,0xc9))[_0xc809('0x3c')](handleError(_0x19fe7c,null));};exports[_0xc809('0x1e')]=function(_0x201ea2,_0x2a9a58){if(_0x201ea2[_0xc809('0x43')]['id']){delete _0x201ea2[_0xc809('0x43')]['id'];}return db[_0xc809('0x38')][_0xc809('0x41')]({'where':{'id':_0x201ea2[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x2a9a58,null))[_0xc809('0x20')](saveUpdates(_0x201ea2['body'],null))[_0xc809('0x20')](respondWithResult(_0x2a9a58,null))['catch'](handleError(_0x2a9a58,null));};exports[_0xc809('0x1f')]=function(_0x26ecfe,_0x12c73a){return db[_0xc809('0x38')][_0xc809('0x41')]({'where':{'id':_0x26ecfe[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x12c73a,null))['then'](removeEntity(_0x12c73a,null))[_0xc809('0x3c')](handleError(_0x12c73a,null));};exports[_0xc809('0x44')]=function(_0xea74a0,_0x5f0941,_0x1e51e1){var _0x42dac2={};var _0x4a9c3a={};var _0x1fe98b;var _0xf889d6;return db[_0xc809('0x38')]['findOne']({'where':{'id':_0xea74a0[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x5f0941,null))[_0xc809('0x20')](function(_0x260483){if(_0x260483){_0x1fe98b=_0x260483;_0x4a9c3a[_0xc809('0x2b')]=_['keys'](db[_0xc809('0x45')]['rawAttributes']);_0x4a9c3a[_0xc809('0x28')]=_['keys'](_0xea74a0[_0xc809('0x28')]);_0x4a9c3a[_0xc809('0x29')]=_['intersection'](_0x4a9c3a[_0xc809('0x2b')],_0x4a9c3a[_0xc809('0x28')]);_0x42dac2[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x4a9c3a[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0xea74a0[_0xc809('0x28')][_0xc809('0x2d')]));_0x42dac2[_0xc809('0x2c')]=_0x42dac2[_0xc809('0x2c')][_0xc809('0x2e')]?_0x42dac2[_0xc809('0x2c')]:_0x4a9c3a[_0xc809('0x2b')];_0x42dac2['order']=qs[_0xc809('0x32')](_0xea74a0['query'][_0xc809('0x32')]);_0x42dac2[_0xc809('0x33')]=qs['filters'](_[_0xc809('0x34')](_0xea74a0[_0xc809('0x28')],_0x4a9c3a[_0xc809('0x29')]));if(_0xea74a0[_0xc809('0x28')][_0xc809('0x37')]){_0x42dac2['where']=_[_0xc809('0x35')](_0x42dac2[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x42dac2[_0xc809('0x2c')],function(_0x526fc5){var _0x29fbd5={};_0x29fbd5[_0x526fc5]={'$like':'%'+_0xea74a0[_0xc809('0x28')][_0xc809('0x37')]+'%'};return _0x29fbd5;})});}_0x42dac2=_[_0xc809('0x35')]({},_0x42dac2,_0xea74a0['options']);return _0x1fe98b[_0xc809('0x44')](_0x42dac2);}})[_0xc809('0x20')](function(_0x2e6fd0){if(_0x2e6fd0){_0xf889d6=_0x2e6fd0['length'];if(!_0xea74a0[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x42dac2[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0xea74a0[_0xc809('0x28')][_0xc809('0x1a')]);_0x42dac2[_0xc809('0x18')]=qs['offset'](_0xea74a0[_0xc809('0x28')][_0xc809('0x18')]);}return _0x1fe98b[_0xc809('0x44')](_0x42dac2);}})[_0xc809('0x20')](function(_0x523f57){if(_0x523f57){return _0x523f57?{'count':_0xf889d6,'rows':_0x523f57}:null;}})[_0xc809('0x20')](respondWithResult(_0x5f0941,null))[_0xc809('0x3c')](handleError(_0x5f0941,null));};exports[_0xc809('0x46')]=function(_0x45af6f,_0x383bee,_0x5130cd){var _0x5eb9a3={};var _0x222867={};var _0x491259;var _0x1b272b;return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x45af6f[_0xc809('0x3e')]['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x383bee,null))['then'](function(_0xe10f1b){if(_0xe10f1b){_0x491259=_0xe10f1b;_0x222867['model']=_[_0xc809('0x3f')](db[_0xc809('0x45')][_0xc809('0x24')]);_0x222867[_0xc809('0x28')]=_[_0xc809('0x3f')](_0x45af6f['query']);_0x222867[_0xc809('0x29')]=_['intersection'](_0x222867[_0xc809('0x2b')],_0x222867['query']);_0x5eb9a3[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x222867[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x45af6f['query'][_0xc809('0x2d')]));_0x5eb9a3['attributes']=_0x5eb9a3['attributes'][_0xc809('0x2e')]?_0x5eb9a3[_0xc809('0x2c')]:_0x222867[_0xc809('0x2b')];_0x5eb9a3[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x45af6f[_0xc809('0x28')][_0xc809('0x32')]);_0x5eb9a3[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x45af6f[_0xc809('0x28')],_0x222867['filters']));if(_0x45af6f['query'][_0xc809('0x37')]){_0x5eb9a3[_0xc809('0x33')]=_['merge'](_0x5eb9a3[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x5eb9a3['attributes'],function(_0x67c8e7){var _0x53fed9={};_0x53fed9[_0x67c8e7]={'$like':'%'+_0x45af6f[_0xc809('0x28')][_0xc809('0x37')]+'%'};return _0x53fed9;})});}_0x5eb9a3=_[_0xc809('0x35')]({},_0x5eb9a3,_0x45af6f[_0xc809('0x40')]);return _0x491259[_0xc809('0x46')](_0x5eb9a3);}})[_0xc809('0x20')](function(_0xbcec8e){if(_0xbcec8e){_0x1b272b=_0xbcec8e['length'];if(!_0x45af6f[_0xc809('0x28')][_0xc809('0x2f')]('nolimit')){_0x5eb9a3['limit']=qs[_0xc809('0x1a')](_0x45af6f[_0xc809('0x28')][_0xc809('0x1a')]);_0x5eb9a3['offset']=qs[_0xc809('0x18')](_0x45af6f[_0xc809('0x28')]['offset']);}return _0x491259['getSubjects'](_0x5eb9a3);}})[_0xc809('0x20')](function(_0x494747){if(_0x494747){return _0x494747?{'count':_0x1b272b,'rows':_0x494747}:null;}})[_0xc809('0x20')](respondWithResult(_0x383bee,null))[_0xc809('0x3c')](handleError(_0x383bee,null));};exports[_0xc809('0x48')]=function(_0x613713,_0x16c8ae,_0x43f913){var _0x5b5fe5={};var _0x222dde={};var _0x68a657;var _0x50718d;return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x613713['params']['id']}})[_0xc809('0x20')](handleEntityNotFound(_0x16c8ae,null))[_0xc809('0x20')](function(_0x4a8d14){if(_0x4a8d14){_0x68a657=_0x4a8d14;_0x222dde[_0xc809('0x2b')]=_[_0xc809('0x3f')](db[_0xc809('0x45')][_0xc809('0x24')]);_0x222dde[_0xc809('0x28')]=_['keys'](_0x613713['query']);_0x222dde[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x222dde[_0xc809('0x2b')],_0x222dde[_0xc809('0x28')]);_0x5b5fe5['attributes']=_['intersection'](_0x222dde['model'],qs['fields'](_0x613713['query'][_0xc809('0x2d')]));_0x5b5fe5[_0xc809('0x2c')]=_0x5b5fe5[_0xc809('0x2c')][_0xc809('0x2e')]?_0x5b5fe5[_0xc809('0x2c')]:_0x222dde[_0xc809('0x2b')];_0x5b5fe5[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x613713[_0xc809('0x28')][_0xc809('0x32')]);_0x5b5fe5[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x613713[_0xc809('0x28')],_0x222dde[_0xc809('0x29')]));if(_0x613713[_0xc809('0x28')][_0xc809('0x37')]){_0x5b5fe5[_0xc809('0x33')]=_[_0xc809('0x35')](_0x5b5fe5[_0xc809('0x33')],{'$or':_[_0xc809('0x23')](_0x5b5fe5[_0xc809('0x2c')],function(_0xc59426){var _0x24cbfc={};_0x24cbfc[_0xc59426]={'$like':'%'+_0x613713['query'][_0xc809('0x37')]+'%'};return _0x24cbfc;})});}_0x5b5fe5=_[_0xc809('0x35')]({},_0x5b5fe5,_0x613713[_0xc809('0x40')]);return _0x68a657['getDescriptions'](_0x5b5fe5);}})['then'](function(_0x4b1797){if(_0x4b1797){_0x50718d=_0x4b1797[_0xc809('0x2e')];if(!_0x613713[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x5b5fe5[_0xc809('0x1a')]=qs[_0xc809('0x1a')](_0x613713[_0xc809('0x28')][_0xc809('0x1a')]);_0x5b5fe5[_0xc809('0x18')]=qs['offset'](_0x613713[_0xc809('0x28')][_0xc809('0x18')]);}return _0x68a657['getDescriptions'](_0x5b5fe5);}})[_0xc809('0x20')](function(_0x430f78){if(_0x430f78){return _0x430f78?{'count':_0x50718d,'rows':_0x430f78}:null;}})[_0xc809('0x20')](respondWithResult(_0x16c8ae,null))[_0xc809('0x3c')](handleError(_0x16c8ae,null));};exports[_0xc809('0x49')]=function(_0x5cbae3,_0x2177f4,_0x399c4e){var _0x3b40da={};var _0x417ba3={};var _0x3b92a2;var _0x281d53;return db[_0xc809('0x38')][_0xc809('0x47')]({'where':{'id':_0x5cbae3[_0xc809('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2177f4,null))[_0xc809('0x20')](function(_0x330482){if(_0x330482){_0x3b92a2=_0x330482;_0x417ba3[_0xc809('0x2b')]=_[_0xc809('0x3f')](db[_0xc809('0x4a')][_0xc809('0x24')]);_0x417ba3['query']=_[_0xc809('0x3f')](_0x5cbae3[_0xc809('0x28')]);_0x417ba3[_0xc809('0x29')]=_[_0xc809('0x2a')](_0x417ba3[_0xc809('0x2b')],_0x417ba3[_0xc809('0x28')]);_0x3b40da[_0xc809('0x2c')]=_[_0xc809('0x2a')](_0x417ba3[_0xc809('0x2b')],qs[_0xc809('0x2d')](_0x5cbae3['query']['fields']));_0x3b40da['attributes']=_0x3b40da[_0xc809('0x2c')]['length']?_0x3b40da[_0xc809('0x2c')]:_0x417ba3[_0xc809('0x2b')];_0x3b40da[_0xc809('0x31')]=qs[_0xc809('0x32')](_0x5cbae3['query'][_0xc809('0x32')]);_0x3b40da[_0xc809('0x33')]=qs[_0xc809('0x29')](_[_0xc809('0x34')](_0x5cbae3['query'],_0x417ba3['filters']));if(_0x5cbae3[_0xc809('0x28')][_0xc809('0x37')]){_0x3b40da[_0xc809('0x33')]=_[_0xc809('0x35')](_0x3b40da[_0xc809('0x33')],{'$or':_['map'](_0x3b40da[_0xc809('0x2c')],function(_0x6246c5){var _0x497d3b={};_0x497d3b[_0x6246c5]={'$like':'%'+_0x5cbae3[_0xc809('0x28')]['filter']+'%'};return _0x497d3b;})});}_0x3b40da=_[_0xc809('0x35')]({},_0x3b40da,_0x5cbae3[_0xc809('0x40')]);return _0x3b92a2[_0xc809('0x49')](_0x3b40da);}})[_0xc809('0x20')](function(_0x349188){if(_0x349188){_0x281d53=_0x349188[_0xc809('0x2e')];if(!_0x5cbae3[_0xc809('0x28')][_0xc809('0x2f')](_0xc809('0x30'))){_0x3b40da['limit']=qs[_0xc809('0x1a')](_0x5cbae3[_0xc809('0x28')]['limit']);_0x3b40da[_0xc809('0x18')]=qs['offset'](_0x5cbae3[_0xc809('0x28')][_0xc809('0x18')]);}return _0x3b92a2[_0xc809('0x49')](_0x3b40da);}})['then'](function(_0x58eff3){if(_0x58eff3){return _0x58eff3?{'count':_0x281d53,'rows':_0x58eff3}:null;}})[_0xc809('0x20')](respondWithResult(_0x2177f4,null))['catch'](handleError(_0x2177f4,null));};exports['setTags']=function(_0x147953,_0x51c7bc,_0x36c364){if(_0x147953[_0xc809('0x43')]['id']){delete _0x147953[_0xc809('0x43')]['id'];}return db['FreshdeskConfiguration'][_0xc809('0x47')]({'where':{'id':_0x147953[_0xc809('0x3e')]['id']}})['then'](handleEntityNotFound(_0x51c7bc,null))[_0xc809('0x20')](function(_0x5f473d){if(_0x5f473d){return _0x5f473d['setTags'](_0x147953['body'][_0xc809('0x4b')]||[]);}return null;})[_0xc809('0x20')](respondWithResult(_0x51c7bc,null))['catch'](handleError(_0x51c7bc,null));};
\ No newline at end of file
+var _0x7c71=['length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','create','catch','body','params','getFields','order','pick','getSubjects','findOne','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x7c71,0x177));var _0x17c7=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0x7c71[_0x549278];return _0x1ea9a1;};'use strict';var emlformat=require(_0x17c7('0x0'));var rimraf=require(_0x17c7('0x1'));var zipdir=require(_0x17c7('0x2'));var jsonpatch=require(_0x17c7('0x3'));var rp=require('request-promise');var moment=require(_0x17c7('0x4'));var BPromise=require(_0x17c7('0x5'));var Mustache=require(_0x17c7('0x6'));var util=require('util');var path=require('path');var sox=require(_0x17c7('0x7'));var csv=require(_0x17c7('0x8'));var ejs=require(_0x17c7('0x9'));var fs=require('fs');var fs_extra=require(_0x17c7('0xa'));var _=require(_0x17c7('0xb'));var squel=require(_0x17c7('0xc'));var crypto=require(_0x17c7('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x17c7('0xe'));var toCsv=require(_0x17c7('0x8'));var querystring=require(_0x17c7('0xf'));var Papa=require(_0x17c7('0x10'));var Redis=require(_0x17c7('0x11'));var authService=require(_0x17c7('0x12'));var qs=require(_0x17c7('0x13'));var as=require(_0x17c7('0x14'));var hardwareService=require(_0x17c7('0x15'));var logger=require(_0x17c7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x17c7('0x17'));var licenseUtil=require(_0x17c7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x430506,_0x22ad50){_0x22ad50=_0x22ad50||0xcc;return function(_0x4fd6af){if(_0x4fd6af){return _0x430506[_0x17c7('0x19')](_0x22ad50);}return _0x430506[_0x17c7('0x1a')](_0x22ad50)['end']();};}function respondWithResult(_0x56ef3b,_0xfae300){_0xfae300=_0xfae300||0xc8;return function(_0x2d980d){if(_0x2d980d){return _0x56ef3b[_0x17c7('0x1a')](_0xfae300)[_0x17c7('0x1b')](_0x2d980d);}};}function respondWithFilteredResult(_0x3d0fb2,_0x2851){return function(_0x2c992f){if(_0x2c992f){var _0x295168=typeof _0x2851[_0x17c7('0x1c')]===_0x17c7('0x1d')&&typeof _0x2851[_0x17c7('0x1e')]===_0x17c7('0x1d');var _0x5470ab=_0x2c992f[_0x17c7('0x1f')];var _0x81d998=_0x295168?0x0:_0x2851['offset'];var _0x42d06c=_0x295168?_0x2c992f[_0x17c7('0x1f')]:_0x2851[_0x17c7('0x1c')]+_0x2851[_0x17c7('0x1e')];var _0x5b9e72;if(_0x42d06c>=_0x5470ab){_0x42d06c=_0x5470ab;_0x5b9e72=0xc8;}else{_0x5b9e72=0xce;}_0x3d0fb2['status'](_0x5b9e72);return _0x3d0fb2[_0x17c7('0x20')](_0x17c7('0x21'),_0x81d998+'-'+_0x42d06c+'/'+_0x5470ab)[_0x17c7('0x1b')](_0x2c992f);}return null;};}function patchUpdates(_0x86956b){return function(_0x2579b7){try{jsonpatch[_0x17c7('0x22')](_0x2579b7,_0x86956b,!![]);}catch(_0x357c27){return BPromise['reject'](_0x357c27);}return _0x2579b7[_0x17c7('0x23')]();};}function saveUpdates(_0x3885c8,_0x3c25ba){return function(_0x16700d){if(_0x16700d){return _0x16700d[_0x17c7('0x24')](_0x3885c8)[_0x17c7('0x25')](function(_0x29a4ac){return _0x29a4ac;});}return null;};}function removeEntity(_0x196e0e,_0x512c3c){return function(_0x312373){if(_0x312373){return _0x312373[_0x17c7('0x26')]()[_0x17c7('0x25')](function(){_0x196e0e[_0x17c7('0x1a')](0xcc)[_0x17c7('0x27')]();});}};}function handleEntityNotFound(_0xa6cfe5,_0x4eb516){return function(_0x36236d){if(!_0x36236d){_0xa6cfe5[_0x17c7('0x19')](0x194);}return _0x36236d;};}function handleError(_0x5e21ec,_0x30a3be){_0x30a3be=_0x30a3be||0x1f4;return function(_0x4d2460){logger[_0x17c7('0x28')](_0x4d2460[_0x17c7('0x29')]);if(_0x4d2460['name']){delete _0x4d2460[_0x17c7('0x2a')];}_0x5e21ec[_0x17c7('0x1a')](_0x30a3be)[_0x17c7('0x2b')](_0x4d2460);};}exports[_0x17c7('0x2c')]=function(_0xe6f177,_0xc6d7b2){var _0x3ca9d3={},_0x14ddac={},_0x3ccf3b={'count':0x0,'rows':[]};var _0x24a2cc=_[_0x17c7('0x2d')](db[_0x17c7('0x2e')][_0x17c7('0x2f')],function(_0xd38b0b){return{'name':_0xd38b0b['fieldName'],'type':_0xd38b0b[_0x17c7('0x30')]['key']};});_0x14ddac[_0x17c7('0x31')]=_[_0x17c7('0x2d')](_0x24a2cc,_0x17c7('0x2a'));_0x14ddac[_0x17c7('0x32')]=_[_0x17c7('0x33')](_0xe6f177['query']);_0x14ddac['filters']=_[_0x17c7('0x34')](_0x14ddac[_0x17c7('0x31')],_0x14ddac[_0x17c7('0x32')]);_0x3ca9d3[_0x17c7('0x35')]=_[_0x17c7('0x34')](_0x14ddac[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x36')]));_0x3ca9d3['attributes']=_0x3ca9d3[_0x17c7('0x35')][_0x17c7('0x37')]?_0x3ca9d3[_0x17c7('0x35')]:_0x14ddac['model'];if(!_0xe6f177[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x3ca9d3[_0x17c7('0x1e')]=qs[_0x17c7('0x1e')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x1e')]);_0x3ca9d3['offset']=qs['offset'](_0xe6f177['query'][_0x17c7('0x1c')]);}_0x3ca9d3['order']=qs[_0x17c7('0x3a')](_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3a')]);_0x3ca9d3['where']=qs[_0x17c7('0x3b')](_['pick'](_0xe6f177['query'],_0x14ddac[_0x17c7('0x3b')]),_0x24a2cc);if(_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3c')]){_0x3ca9d3[_0x17c7('0x3d')]=_[_0x17c7('0x3e')](_0x3ca9d3[_0x17c7('0x3d')],{'$or':_[_0x17c7('0x2d')](_0x24a2cc,function(_0x342b18){if(_0x342b18[_0x17c7('0x30')]!==_0x17c7('0x3f')){var _0x4ae7a6={};_0x4ae7a6[_0x342b18[_0x17c7('0x2a')]]={'$like':'%'+_0xe6f177[_0x17c7('0x32')][_0x17c7('0x3c')]+'%'};return _0x4ae7a6;}})});}_0x3ca9d3=_[_0x17c7('0x3e')]({},_0x3ca9d3,_0xe6f177[_0x17c7('0x40')]);var _0xbd845c={'where':_0x3ca9d3['where']};return db[_0x17c7('0x2e')][_0x17c7('0x1f')](_0xbd845c)[_0x17c7('0x25')](function(_0x21f15d){_0x3ccf3b[_0x17c7('0x1f')]=_0x21f15d;if(_0xe6f177[_0x17c7('0x32')][_0x17c7('0x41')]){_0x3ca9d3['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x17c7('0x42')](_0x3ca9d3);})[_0x17c7('0x25')](function(_0xef91f1){_0x3ccf3b[_0x17c7('0x43')]=_0xef91f1;return _0x3ccf3b;})[_0x17c7('0x25')](respondWithFilteredResult(_0xc6d7b2,_0x3ca9d3))['catch'](handleError(_0xc6d7b2,null));};exports[_0x17c7('0x44')]=function(_0x2813ef,_0x5b45db){var _0x13420f={'raw':![],'where':{'id':_0x2813ef['params']['id']}},_0x3d4f9d={};_0x3d4f9d[_0x17c7('0x31')]=_[_0x17c7('0x33')](db[_0x17c7('0x2e')]['rawAttributes']);_0x3d4f9d['query']=_[_0x17c7('0x33')](_0x2813ef[_0x17c7('0x32')]);_0x3d4f9d[_0x17c7('0x3b')]=_['intersection'](_0x3d4f9d[_0x17c7('0x31')],_0x3d4f9d['query']);_0x13420f[_0x17c7('0x35')]=_['intersection'](_0x3d4f9d[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x2813ef[_0x17c7('0x32')]['fields']));_0x13420f[_0x17c7('0x35')]=_0x13420f[_0x17c7('0x35')][_0x17c7('0x37')]?_0x13420f[_0x17c7('0x35')]:_0x3d4f9d[_0x17c7('0x31')];if(_0x2813ef[_0x17c7('0x32')][_0x17c7('0x41')]){_0x13420f[_0x17c7('0x45')]=[{'all':!![]}];}_0x13420f=_[_0x17c7('0x3e')]({},_0x13420f,_0x2813ef[_0x17c7('0x40')]);return db['FreshdeskConfiguration'][_0x17c7('0x46')](_0x13420f)['then'](handleEntityNotFound(_0x5b45db,null))[_0x17c7('0x25')](respondWithResult(_0x5b45db,null))['catch'](handleError(_0x5b45db,null));};exports[_0x17c7('0x47')]=function(_0x48d0e5,_0x3b2e65){return db[_0x17c7('0x2e')]['create'](_0x48d0e5['body'],{})[_0x17c7('0x25')](respondWithResult(_0x3b2e65,0xc9))[_0x17c7('0x48')](handleError(_0x3b2e65,null));};exports[_0x17c7('0x24')]=function(_0x32d007,_0x2f1136){if(_0x32d007[_0x17c7('0x49')]['id']){delete _0x32d007[_0x17c7('0x49')]['id'];}return db[_0x17c7('0x2e')]['find']({'where':{'id':_0x32d007[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x2f1136,null))[_0x17c7('0x25')](saveUpdates(_0x32d007[_0x17c7('0x49')],null))[_0x17c7('0x25')](respondWithResult(_0x2f1136,null))[_0x17c7('0x48')](handleError(_0x2f1136,null));};exports[_0x17c7('0x26')]=function(_0x5166c0,_0xb2bb36){return db[_0x17c7('0x2e')]['find']({'where':{'id':_0x5166c0[_0x17c7('0x4a')]['id']}})['then'](handleEntityNotFound(_0xb2bb36,null))[_0x17c7('0x25')](removeEntity(_0xb2bb36,null))[_0x17c7('0x48')](handleError(_0xb2bb36,null));};exports[_0x17c7('0x4b')]=function(_0x292d21,_0x6519f2,_0x40097a){var _0x3149cb={};var _0x2cc814={};var _0x1c5ce4;var _0x51f60a;return db[_0x17c7('0x2e')]['findOne']({'where':{'id':_0x292d21[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x6519f2,null))[_0x17c7('0x25')](function(_0x39f727){if(_0x39f727){_0x1c5ce4=_0x39f727;_0x2cc814[_0x17c7('0x31')]=_['keys'](db['FreshdeskField'][_0x17c7('0x2f')]);_0x2cc814[_0x17c7('0x32')]=_[_0x17c7('0x33')](_0x292d21[_0x17c7('0x32')]);_0x2cc814[_0x17c7('0x3b')]=_[_0x17c7('0x34')](_0x2cc814[_0x17c7('0x31')],_0x2cc814[_0x17c7('0x32')]);_0x3149cb[_0x17c7('0x35')]=_['intersection'](_0x2cc814[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x292d21[_0x17c7('0x32')][_0x17c7('0x36')]));_0x3149cb['attributes']=_0x3149cb[_0x17c7('0x35')][_0x17c7('0x37')]?_0x3149cb['attributes']:_0x2cc814[_0x17c7('0x31')];_0x3149cb[_0x17c7('0x4c')]=qs['sort'](_0x292d21[_0x17c7('0x32')][_0x17c7('0x3a')]);_0x3149cb[_0x17c7('0x3d')]=qs['filters'](_[_0x17c7('0x4d')](_0x292d21[_0x17c7('0x32')],_0x2cc814[_0x17c7('0x3b')]));if(_0x292d21[_0x17c7('0x32')][_0x17c7('0x3c')]){_0x3149cb[_0x17c7('0x3d')]=_[_0x17c7('0x3e')](_0x3149cb[_0x17c7('0x3d')],{'$or':_[_0x17c7('0x2d')](_0x3149cb[_0x17c7('0x35')],function(_0x26c3a5){var _0x2b5f7d={};_0x2b5f7d[_0x26c3a5]={'$like':'%'+_0x292d21[_0x17c7('0x32')][_0x17c7('0x3c')]+'%'};return _0x2b5f7d;})});}_0x3149cb=_[_0x17c7('0x3e')]({},_0x3149cb,_0x292d21[_0x17c7('0x40')]);return _0x1c5ce4[_0x17c7('0x4b')](_0x3149cb);}})['then'](function(_0x40aca1){if(_0x40aca1){_0x51f60a=_0x40aca1[_0x17c7('0x37')];if(!_0x292d21[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x3149cb[_0x17c7('0x1e')]=qs[_0x17c7('0x1e')](_0x292d21['query']['limit']);_0x3149cb[_0x17c7('0x1c')]=qs[_0x17c7('0x1c')](_0x292d21[_0x17c7('0x32')][_0x17c7('0x1c')]);}return _0x1c5ce4['getFields'](_0x3149cb);}})[_0x17c7('0x25')](function(_0x21068e){if(_0x21068e){return _0x21068e?{'count':_0x51f60a,'rows':_0x21068e}:null;}})[_0x17c7('0x25')](respondWithResult(_0x6519f2,null))[_0x17c7('0x48')](handleError(_0x6519f2,null));};exports[_0x17c7('0x4e')]=function(_0x4b086a,_0x3e5844,_0x1b9a8f){var _0x557b3c={};var _0xc8d6e2={};var _0x27becb;var _0x3f25a8;return db[_0x17c7('0x2e')][_0x17c7('0x4f')]({'where':{'id':_0x4b086a[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x3e5844,null))[_0x17c7('0x25')](function(_0xecc813){if(_0xecc813){_0x27becb=_0xecc813;_0xc8d6e2[_0x17c7('0x31')]=_[_0x17c7('0x33')](db['FreshdeskField'][_0x17c7('0x2f')]);_0xc8d6e2[_0x17c7('0x32')]=_[_0x17c7('0x33')](_0x4b086a[_0x17c7('0x32')]);_0xc8d6e2[_0x17c7('0x3b')]=_[_0x17c7('0x34')](_0xc8d6e2[_0x17c7('0x31')],_0xc8d6e2[_0x17c7('0x32')]);_0x557b3c[_0x17c7('0x35')]=_[_0x17c7('0x34')](_0xc8d6e2[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x4b086a['query'][_0x17c7('0x36')]));_0x557b3c[_0x17c7('0x35')]=_0x557b3c[_0x17c7('0x35')][_0x17c7('0x37')]?_0x557b3c[_0x17c7('0x35')]:_0xc8d6e2[_0x17c7('0x31')];_0x557b3c[_0x17c7('0x4c')]=qs[_0x17c7('0x3a')](_0x4b086a[_0x17c7('0x32')][_0x17c7('0x3a')]);_0x557b3c[_0x17c7('0x3d')]=qs[_0x17c7('0x3b')](_[_0x17c7('0x4d')](_0x4b086a[_0x17c7('0x32')],_0xc8d6e2[_0x17c7('0x3b')]));if(_0x4b086a['query'][_0x17c7('0x3c')]){_0x557b3c[_0x17c7('0x3d')]=_[_0x17c7('0x3e')](_0x557b3c[_0x17c7('0x3d')],{'$or':_[_0x17c7('0x2d')](_0x557b3c[_0x17c7('0x35')],function(_0x48a500){var _0x2aba24={};_0x2aba24[_0x48a500]={'$like':'%'+_0x4b086a[_0x17c7('0x32')]['filter']+'%'};return _0x2aba24;})});}_0x557b3c=_[_0x17c7('0x3e')]({},_0x557b3c,_0x4b086a[_0x17c7('0x40')]);return _0x27becb[_0x17c7('0x4e')](_0x557b3c);}})[_0x17c7('0x25')](function(_0x37bbb1){if(_0x37bbb1){_0x3f25a8=_0x37bbb1[_0x17c7('0x37')];if(!_0x4b086a[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x557b3c[_0x17c7('0x1e')]=qs['limit'](_0x4b086a[_0x17c7('0x32')]['limit']);_0x557b3c['offset']=qs['offset'](_0x4b086a[_0x17c7('0x32')]['offset']);}return _0x27becb[_0x17c7('0x4e')](_0x557b3c);}})['then'](function(_0x3afb8a){if(_0x3afb8a){return _0x3afb8a?{'count':_0x3f25a8,'rows':_0x3afb8a}:null;}})['then'](respondWithResult(_0x3e5844,null))[_0x17c7('0x48')](handleError(_0x3e5844,null));};exports[_0x17c7('0x50')]=function(_0x4d850e,_0xf41c2d,_0x1b6428){var _0x580dac={};var _0x2c155a={};var _0x34c2b3;var _0x1b3507;return db[_0x17c7('0x2e')]['findOne']({'where':{'id':_0x4d850e[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0xf41c2d,null))[_0x17c7('0x25')](function(_0x288a47){if(_0x288a47){_0x34c2b3=_0x288a47;_0x2c155a['model']=_[_0x17c7('0x33')](db[_0x17c7('0x51')][_0x17c7('0x2f')]);_0x2c155a['query']=_[_0x17c7('0x33')](_0x4d850e['query']);_0x2c155a[_0x17c7('0x3b')]=_[_0x17c7('0x34')](_0x2c155a[_0x17c7('0x31')],_0x2c155a[_0x17c7('0x32')]);_0x580dac['attributes']=_['intersection'](_0x2c155a[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x4d850e[_0x17c7('0x32')]['fields']));_0x580dac[_0x17c7('0x35')]=_0x580dac[_0x17c7('0x35')]['length']?_0x580dac[_0x17c7('0x35')]:_0x2c155a[_0x17c7('0x31')];_0x580dac[_0x17c7('0x4c')]=qs[_0x17c7('0x3a')](_0x4d850e['query'][_0x17c7('0x3a')]);_0x580dac[_0x17c7('0x3d')]=qs['filters'](_['pick'](_0x4d850e[_0x17c7('0x32')],_0x2c155a[_0x17c7('0x3b')]));if(_0x4d850e[_0x17c7('0x32')][_0x17c7('0x3c')]){_0x580dac[_0x17c7('0x3d')]=_[_0x17c7('0x3e')](_0x580dac[_0x17c7('0x3d')],{'$or':_['map'](_0x580dac[_0x17c7('0x35')],function(_0x1e4175){var _0x2ef046={};_0x2ef046[_0x1e4175]={'$like':'%'+_0x4d850e[_0x17c7('0x32')][_0x17c7('0x3c')]+'%'};return _0x2ef046;})});}_0x580dac=_[_0x17c7('0x3e')]({},_0x580dac,_0x4d850e[_0x17c7('0x40')]);return _0x34c2b3[_0x17c7('0x50')](_0x580dac);}})['then'](function(_0x319e1e){if(_0x319e1e){_0x1b3507=_0x319e1e[_0x17c7('0x37')];if(!_0x4d850e[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x580dac[_0x17c7('0x1e')]=qs['limit'](_0x4d850e[_0x17c7('0x32')][_0x17c7('0x1e')]);_0x580dac[_0x17c7('0x1c')]=qs[_0x17c7('0x1c')](_0x4d850e[_0x17c7('0x32')][_0x17c7('0x1c')]);}return _0x34c2b3[_0x17c7('0x50')](_0x580dac);}})[_0x17c7('0x25')](function(_0x1f0fed){if(_0x1f0fed){return _0x1f0fed?{'count':_0x1b3507,'rows':_0x1f0fed}:null;}})['then'](respondWithResult(_0xf41c2d,null))[_0x17c7('0x48')](handleError(_0xf41c2d,null));};exports[_0x17c7('0x52')]=function(_0x256a6a,_0x25d02e,_0x4eeb7c){var _0x5be779={};var _0x581e0={};var _0x2a9e03;var _0x563738;return db[_0x17c7('0x2e')][_0x17c7('0x4f')]({'where':{'id':_0x256a6a[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x25d02e,null))['then'](function(_0x5933bc){if(_0x5933bc){_0x2a9e03=_0x5933bc;_0x581e0[_0x17c7('0x31')]=_[_0x17c7('0x33')](db[_0x17c7('0x53')]['rawAttributes']);_0x581e0['query']=_[_0x17c7('0x33')](_0x256a6a[_0x17c7('0x32')]);_0x581e0[_0x17c7('0x3b')]=_['intersection'](_0x581e0[_0x17c7('0x31')],_0x581e0[_0x17c7('0x32')]);_0x5be779[_0x17c7('0x35')]=_[_0x17c7('0x34')](_0x581e0[_0x17c7('0x31')],qs[_0x17c7('0x36')](_0x256a6a['query'][_0x17c7('0x36')]));_0x5be779[_0x17c7('0x35')]=_0x5be779[_0x17c7('0x35')][_0x17c7('0x37')]?_0x5be779[_0x17c7('0x35')]:_0x581e0[_0x17c7('0x31')];_0x5be779[_0x17c7('0x4c')]=qs[_0x17c7('0x3a')](_0x256a6a[_0x17c7('0x32')][_0x17c7('0x3a')]);_0x5be779[_0x17c7('0x3d')]=qs['filters'](_[_0x17c7('0x4d')](_0x256a6a[_0x17c7('0x32')],_0x581e0['filters']));if(_0x256a6a[_0x17c7('0x32')][_0x17c7('0x3c')]){_0x5be779[_0x17c7('0x3d')]=_['merge'](_0x5be779[_0x17c7('0x3d')],{'$or':_[_0x17c7('0x2d')](_0x5be779[_0x17c7('0x35')],function(_0x34ccec){var _0x425776={};_0x425776[_0x34ccec]={'$like':'%'+_0x256a6a[_0x17c7('0x32')][_0x17c7('0x3c')]+'%'};return _0x425776;})});}_0x5be779=_[_0x17c7('0x3e')]({},_0x5be779,_0x256a6a[_0x17c7('0x40')]);return _0x2a9e03['getTags'](_0x5be779);}})[_0x17c7('0x25')](function(_0x276bec){if(_0x276bec){_0x563738=_0x276bec[_0x17c7('0x37')];if(!_0x256a6a[_0x17c7('0x32')][_0x17c7('0x38')](_0x17c7('0x39'))){_0x5be779[_0x17c7('0x1e')]=qs[_0x17c7('0x1e')](_0x256a6a['query']['limit']);_0x5be779[_0x17c7('0x1c')]=qs['offset'](_0x256a6a[_0x17c7('0x32')][_0x17c7('0x1c')]);}return _0x2a9e03['getTags'](_0x5be779);}})[_0x17c7('0x25')](function(_0x47e6c4){if(_0x47e6c4){return _0x47e6c4?{'count':_0x563738,'rows':_0x47e6c4}:null;}})[_0x17c7('0x25')](respondWithResult(_0x25d02e,null))[_0x17c7('0x48')](handleError(_0x25d02e,null));};exports[_0x17c7('0x54')]=function(_0x284957,_0x2f549e,_0x2640df){if(_0x284957[_0x17c7('0x49')]['id']){delete _0x284957[_0x17c7('0x49')]['id'];}return db['FreshdeskConfiguration'][_0x17c7('0x4f')]({'where':{'id':_0x284957[_0x17c7('0x4a')]['id']}})[_0x17c7('0x25')](handleEntityNotFound(_0x2f549e,null))['then'](function(_0x579b50){if(_0x579b50){return _0x579b50[_0x17c7('0x54')](_0x284957[_0x17c7('0x49')][_0x17c7('0x55')]||[]);}return null;})[_0x17c7('0x25')](respondWithResult(_0x2f549e,null))[_0x17c7('0x48')](handleError(_0x2f549e,null));};
\ No newline at end of file
index f37004d..0f21420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e4=['../../config/logger','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util'];(function(_0xada7af,_0x19e596){var _0x1769a4=function(_0x529d4a){while(--_0x529d4a){_0xada7af['push'](_0xada7af['shift']());}};_0x1769a4(++_0x19e596);}(_0x59e4,0xe5));var _0x459e=function(_0x5acb94,_0x389dbc){_0x5acb94=_0x5acb94-0x0;var _0x11800a=_0x59e4[_0x5acb94];return _0x11800a;};'use strict';var _=require(_0x459e('0x0'));var util=require(_0x459e('0x1'));var logger=require(_0x459e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x459e('0x3'));var rimraf=require(_0x459e('0x4'));var config=require(_0x459e('0x5'));var attributes=require(_0x459e('0x6'));module[_0x459e('0x7')]=function(_0x78e54,_0x325f7f){return _0x78e54[_0x459e('0x8')](_0x459e('0x9'),attributes,{'tableName':_0x459e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0d4=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b04e8,_0x222047){var _0x400172=function(_0x55b7a0){while(--_0x55b7a0){_0x5b04e8['push'](_0x5b04e8['shift']());}};_0x400172(++_0x222047);}(_0xa0d4,0x149));var _0x4a0d=function(_0x469d4f,_0x1ca9a5){_0x469d4f=_0x469d4f-0x0;var _0x18fcaf=_0xa0d4[_0x469d4f];return _0x18fcaf;};'use strict';var _=require(_0x4a0d('0x0'));var util=require('util');var logger=require(_0x4a0d('0x1'))(_0x4a0d('0x2'));var moment=require(_0x4a0d('0x3'));var BPromise=require(_0x4a0d('0x4'));var rp=require(_0x4a0d('0x5'));var fs=require('fs');var path=require(_0x4a0d('0x6'));var rimraf=require(_0x4a0d('0x7'));var config=require(_0x4a0d('0x8'));var attributes=require(_0x4a0d('0x9'));module[_0x4a0d('0xa')]=function(_0x517bb6,_0x161703){return _0x517bb6[_0x4a0d('0xb')](_0x4a0d('0xc'),attributes,{'tableName':_0x4a0d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d51548..7383dea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4727=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1d3625,_0x4e11f5){var _0x6fb216=function(_0x55a815){while(--_0x55a815){_0x1d3625['push'](_0x1d3625['shift']());}};_0x6fb216(++_0x4e11f5);}(_0x4727,0xf6));var _0x7472=function(_0x45e3ef,_0x558886){_0x45e3ef=_0x45e3ef-0x0;var _0x43d68e=_0x4727[_0x45e3ef];return _0x43d68e;};'use strict';var _=require(_0x7472('0x0'));var util=require('util');var moment=require(_0x7472('0x1'));var BPromise=require(_0x7472('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7472('0x3'));var db=require(_0x7472('0x4'))['db'];var utils=require(_0x7472('0x5'));var logger=require(_0x7472('0x6'))(_0x7472('0x7'));var config=require(_0x7472('0x8'));var jayson=require(_0x7472('0x9'));var client=jayson[_0x7472('0xa')][_0x7472('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d99d7,_0x465867,_0x3d71bc){return new BPromise(function(_0xbb6fd9,_0x350566){return client[_0x7472('0xc')](_0x1d99d7,_0x3d71bc)['then'](function(_0x3ca9af){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x465867,_0x7472('0xd'));logger[_0x7472('0xe')](_0x7472('0xf'),_0x465867,_0x7472('0xd'),JSON[_0x7472('0x10')](_0x3ca9af));if(_0x3ca9af[_0x7472('0x11')]){if(_0x3ca9af[_0x7472('0x11')][_0x7472('0x12')]===0x1f4){logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);return _0x350566(_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);}logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);return _0xbb6fd9(_0x3ca9af[_0x7472('0x11')][_0x7472('0x14')]);}else{logger['info'](_0x7472('0x13'),_0x465867,'request\x20sent');_0xbb6fd9(_0x3ca9af[_0x7472('0x15')][_0x7472('0x14')]);}})[_0x7472('0x16')](function(_0x13a7d6){logger[_0x7472('0x11')](_0x7472('0x13'),_0x465867,_0x13a7d6);_0x350566(_0x13a7d6);});});}
\ No newline at end of file
+var _0xaa3c=['then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x72c31,_0x1b795e){var _0x2f552e=function(_0x3cea7a){while(--_0x3cea7a){_0x72c31['push'](_0x72c31['shift']());}};_0x2f552e(++_0x1b795e);}(_0xaa3c,0x16e));var _0xcaa3=function(_0xb60c0e,_0x190168){_0xb60c0e=_0xb60c0e-0x0;var _0x14047c=_0xaa3c[_0xb60c0e];return _0x14047c;};'use strict';var _=require(_0xcaa3('0x0'));var util=require(_0xcaa3('0x1'));var moment=require(_0xcaa3('0x2'));var BPromise=require(_0xcaa3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcaa3('0x4'));var db=require(_0xcaa3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaa3('0x6'))(_0xcaa3('0x7'));var config=require(_0xcaa3('0x8'));var jayson=require(_0xcaa3('0x9'));var client=jayson[_0xcaa3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47fa54,_0x5bc90c,_0x37ee3c){return new BPromise(function(_0xea2e8,_0x4d58e5){return client[_0xcaa3('0xb')](_0x47fa54,_0x37ee3c)[_0xcaa3('0xc')](function(_0xd0e17e){logger['info'](_0xcaa3('0xd'),_0x5bc90c,_0xcaa3('0xe'));logger[_0xcaa3('0xf')](_0xcaa3('0x10'),_0x5bc90c,_0xcaa3('0xe'),JSON['stringify'](_0xd0e17e));if(_0xd0e17e['error']){if(_0xd0e17e[_0xcaa3('0x11')][_0xcaa3('0x12')]===0x1f4){logger[_0xcaa3('0x11')](_0xcaa3('0xd'),_0x5bc90c,_0xd0e17e[_0xcaa3('0x11')]['message']);return _0x4d58e5(_0xd0e17e['error'][_0xcaa3('0x13')]);}logger[_0xcaa3('0x11')](_0xcaa3('0xd'),_0x5bc90c,_0xd0e17e['error'][_0xcaa3('0x13')]);return _0xea2e8(_0xd0e17e[_0xcaa3('0x11')]['message']);}else{logger['info'](_0xcaa3('0xd'),_0x5bc90c,_0xcaa3('0xe'));_0xea2e8(_0xd0e17e['result']['message']);}})[_0xcaa3('0x14')](function(_0x37ad2d){logger[_0xcaa3('0x11')](_0xcaa3('0xd'),_0x5bc90c,_0x37ad2d);_0x4d58e5(_0x37ad2d);});});}
\ No newline at end of file
index 04ef013..692a415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeae=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create','put','destroy','exports','multer'];(function(_0x423eba,_0xb6826c){var _0x138f29=function(_0x22e9e3){while(--_0x22e9e3){_0x423eba['push'](_0x423eba['shift']());}};_0x138f29(++_0xb6826c);}(_0xbeae,0x6f));var _0xebea=function(_0x493030,_0x29ec7e){_0x493030=_0x493030-0x0;var _0x56f5e4=_0xbeae[_0x493030];return _0x56f5e4;};'use strict';var multer=require(_0xebea('0x0'));var util=require(_0xebea('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebea('0x2')]();var fs_extra=require(_0xebea('0x3'));var auth=require(_0xebea('0x4'));var interaction=require(_0xebea('0x5'));var config=require(_0xebea('0x6'));var controller=require(_0xebea('0x7'));router[_0xebea('0x8')]('/',auth[_0xebea('0x9')](),controller[_0xebea('0xa')]);router[_0xebea('0x8')](_0xebea('0xb'),auth[_0xebea('0x9')](),controller['show']);router['post']('/',auth[_0xebea('0x9')](),controller[_0xebea('0xc')]);router[_0xebea('0xd')](_0xebea('0xb'),auth[_0xebea('0x9')](),controller['update']);router['delete'](_0xebea('0xb'),auth[_0xebea('0x9')](),controller[_0xebea('0xe')]);module[_0xebea('0xf')]=router;
\ No newline at end of file
+var _0x68aa=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','update','/:id'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x68aa,0x142));var _0xa68a=function(_0x1fd827,_0x45f86c){_0x1fd827=_0x1fd827-0x0;var _0x1d52d6=_0x68aa[_0x1fd827];return _0x1d52d6;};'use strict';var multer=require(_0xa68a('0x0'));var util=require(_0xa68a('0x1'));var path=require(_0xa68a('0x2'));var timeout=require(_0xa68a('0x3'));var express=require(_0xa68a('0x4'));var router=express['Router']();var fs_extra=require(_0xa68a('0x5'));var auth=require(_0xa68a('0x6'));var interaction=require(_0xa68a('0x7'));var config=require(_0xa68a('0x8'));var controller=require(_0xa68a('0x9'));router[_0xa68a('0xa')]('/',auth[_0xa68a('0xb')](),controller['index']);router['get']('/:id',auth[_0xa68a('0xb')](),controller[_0xa68a('0xc')]);router[_0xa68a('0xd')]('/',auth[_0xa68a('0xb')](),controller[_0xa68a('0xe')]);router[_0xa68a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa68a('0x10')]);router['delete'](_0xa68a('0x11'),auth[_0xa68a('0xb')](),controller[_0xa68a('0x12')]);module[_0xa68a('0x13')]=router;
\ No newline at end of file
index 2bd126c..d304cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ff9=['picklist','string','STRING','ENUM','BOOLEAN','variable','customVariable','keyValue'];(function(_0x44bcb6,_0x16e9a3){var _0x49ac0f=function(_0x418622){while(--_0x418622){_0x44bcb6['push'](_0x44bcb6['shift']());}};_0x49ac0f(++_0x16e9a3);}(_0x3ff9,0x8d));var _0x93ff=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x3ff9[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x93ff('0x0'),_0x93ff('0x1'),_0x93ff('0x2'),_0x93ff('0x3')),'defaultValue':_0x93ff('0x4')},'content':{'type':Sequelize[_0x93ff('0x5')]},'key':{'type':Sequelize[_0x93ff('0x5')]},'keyType':{'type':Sequelize[_0x93ff('0x6')](_0x93ff('0x4'),'variable',_0x93ff('0x1'))},'keyContent':{'type':Sequelize[_0x93ff('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x93ff('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9b26=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x405faf,_0x38d0f0){var _0x2308e5=function(_0x34e928){while(--_0x34e928){_0x405faf['push'](_0x405faf['shift']());}};_0x2308e5(++_0x38d0f0);}(_0x9b26,0x136));var _0x69b2=function(_0x2547c9,_0x36595c){_0x2547c9=_0x2547c9-0x0;var _0x537cd7=_0x9b26[_0x2547c9];return _0x537cd7;};'use strict';var Sequelize=require(_0x69b2('0x0'));module[_0x69b2('0x1')]={'type':{'type':Sequelize[_0x69b2('0x2')](_0x69b2('0x3'),'variable',_0x69b2('0x4'),_0x69b2('0x5'),_0x69b2('0x6')),'defaultValue':_0x69b2('0x3')},'content':{'type':Sequelize[_0x69b2('0x7')]},'key':{'type':Sequelize[_0x69b2('0x7')]},'keyType':{'type':Sequelize[_0x69b2('0x2')]('string',_0x69b2('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x69b2('0x7')]},'idField':{'type':Sequelize[_0x69b2('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x69b2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x69b2('0x7')]}};
\ No newline at end of file
index 937d98e..5c53ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc788=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','type','key','map','query','filters','intersection','attributes','model','fields','length','nolimit','offset','sort','where','pick','filter','merge','options','includeAll','include','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x4e58c1,_0x4cb68f){var _0x2993e=function(_0x15bde3){while(--_0x15bde3){_0x4e58c1['push'](_0x4e58c1['shift']());}};_0x2993e(++_0x4cb68f);}(_0xc788,0xc4));var _0x8c78=function(_0xca18be,_0x5bbe40){_0xca18be=_0xca18be-0x0;var _0x2815ad=_0xc788[_0xca18be];return _0x2815ad;};'use strict';var emlformat=require(_0x8c78('0x0'));var rimraf=require(_0x8c78('0x1'));var zipdir=require(_0x8c78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c78('0x3'));var BPromise=require(_0x8c78('0x4'));var Mustache=require(_0x8c78('0x5'));var util=require(_0x8c78('0x6'));var path=require(_0x8c78('0x7'));var sox=require('sox');var csv=require(_0x8c78('0x8'));var ejs=require(_0x8c78('0x9'));var fs=require('fs');var fs_extra=require(_0x8c78('0xa'));var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x8'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c78('0x17'))['db'];function respondWithStatusCode(_0x4b2eca,_0x56a802){_0x56a802=_0x56a802||0xcc;return function(_0x349dfa){if(_0x349dfa){return _0x4b2eca[_0x8c78('0x18')](_0x56a802);}return _0x4b2eca[_0x8c78('0x19')](_0x56a802)[_0x8c78('0x1a')]();};}function respondWithResult(_0x2eedff,_0x3d1306){_0x3d1306=_0x3d1306||0xc8;return function(_0xe5f8ae){if(_0xe5f8ae){return _0x2eedff[_0x8c78('0x19')](_0x3d1306)[_0x8c78('0x1b')](_0xe5f8ae);}};}function respondWithFilteredResult(_0x1157d0,_0x4ff4b0){return function(_0x1fa78e){if(_0x1fa78e){var _0x293cfe=typeof _0x4ff4b0['offset']===_0x8c78('0x1c')&&typeof _0x4ff4b0[_0x8c78('0x1d')]===_0x8c78('0x1c');var _0x23824e=_0x1fa78e[_0x8c78('0x1e')];var _0x461eff=_0x293cfe?0x0:_0x4ff4b0['offset'];var _0x4f7bf9=_0x293cfe?_0x1fa78e[_0x8c78('0x1e')]:_0x4ff4b0['offset']+_0x4ff4b0['limit'];var _0xece4f0;if(_0x4f7bf9>=_0x23824e){_0x4f7bf9=_0x23824e;_0xece4f0=0xc8;}else{_0xece4f0=0xce;}_0x1157d0['status'](_0xece4f0);return _0x1157d0[_0x8c78('0x1f')](_0x8c78('0x20'),_0x461eff+'-'+_0x4f7bf9+'/'+_0x23824e)['json'](_0x1fa78e);}return null;};}function patchUpdates(_0x6c9a12){return function(_0x5b111b){try{jsonpatch[_0x8c78('0x21')](_0x5b111b,_0x6c9a12,!![]);}catch(_0x3af73c){return BPromise['reject'](_0x3af73c);}return _0x5b111b[_0x8c78('0x22')]();};}function saveUpdates(_0x188cc3,_0x499603){return function(_0x2bc595){if(_0x2bc595){return _0x2bc595[_0x8c78('0x23')](_0x188cc3)[_0x8c78('0x24')](function(_0x9581c6){return _0x9581c6;});}return null;};}function removeEntity(_0x215940,_0x20f483){return function(_0xbfdf6f){if(_0xbfdf6f){return _0xbfdf6f[_0x8c78('0x25')]()[_0x8c78('0x24')](function(){_0x215940['status'](0xcc)[_0x8c78('0x1a')]();});}};}function handleEntityNotFound(_0x458763,_0x1d1cef){return function(_0x49cccb){if(!_0x49cccb){_0x458763[_0x8c78('0x18')](0x194);}return _0x49cccb;};}function handleError(_0x5d7445,_0xe85d05){_0xe85d05=_0xe85d05||0x1f4;return function(_0x24f9a7){logger[_0x8c78('0x26')](_0x24f9a7['stack']);if(_0x24f9a7[_0x8c78('0x27')]){delete _0x24f9a7[_0x8c78('0x27')];}_0x5d7445['status'](_0xe85d05)[_0x8c78('0x28')](_0x24f9a7);};}exports[_0x8c78('0x29')]=function(_0x394c1d,_0x36e8e5){var _0x253776={},_0x2ab5cc={},_0x5ba7d4={'count':0x0,'rows':[]};var _0x1c3039=_['map'](db[_0x8c78('0x2a')][_0x8c78('0x2b')],function(_0xb69c52){return{'name':_0xb69c52['fieldName'],'type':_0xb69c52[_0x8c78('0x2c')][_0x8c78('0x2d')]};});_0x2ab5cc['model']=_[_0x8c78('0x2e')](_0x1c3039,_0x8c78('0x27'));_0x2ab5cc[_0x8c78('0x2f')]=_['keys'](_0x394c1d[_0x8c78('0x2f')]);_0x2ab5cc[_0x8c78('0x30')]=_[_0x8c78('0x31')](_0x2ab5cc['model'],_0x2ab5cc[_0x8c78('0x2f')]);_0x253776[_0x8c78('0x32')]=_['intersection'](_0x2ab5cc[_0x8c78('0x33')],qs[_0x8c78('0x34')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x34')]));_0x253776[_0x8c78('0x32')]=_0x253776[_0x8c78('0x32')][_0x8c78('0x35')]?_0x253776[_0x8c78('0x32')]:_0x2ab5cc[_0x8c78('0x33')];if(!_0x394c1d[_0x8c78('0x2f')]['hasOwnProperty'](_0x8c78('0x36'))){_0x253776[_0x8c78('0x1d')]=qs[_0x8c78('0x1d')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x1d')]);_0x253776['offset']=qs[_0x8c78('0x37')](_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x37')]);}_0x253776['order']=qs[_0x8c78('0x38')](_0x394c1d[_0x8c78('0x2f')]['sort']);_0x253776[_0x8c78('0x39')]=qs['filters'](_[_0x8c78('0x3a')](_0x394c1d[_0x8c78('0x2f')],_0x2ab5cc[_0x8c78('0x30')]),_0x1c3039);if(_0x394c1d[_0x8c78('0x2f')]['filter']){_0x253776[_0x8c78('0x39')]=_['merge'](_0x253776[_0x8c78('0x39')],{'$or':_[_0x8c78('0x2e')](_0x1c3039,function(_0x2dbd5e){if(_0x2dbd5e['type']!=='VIRTUAL'){var _0x3a3694={};_0x3a3694[_0x2dbd5e[_0x8c78('0x27')]]={'$like':'%'+_0x394c1d[_0x8c78('0x2f')][_0x8c78('0x3b')]+'%'};return _0x3a3694;}})});}_0x253776=_[_0x8c78('0x3c')]({},_0x253776,_0x394c1d[_0x8c78('0x3d')]);var _0x326b34={'where':_0x253776[_0x8c78('0x39')]};return db[_0x8c78('0x2a')][_0x8c78('0x1e')](_0x326b34)[_0x8c78('0x24')](function(_0x426401){_0x5ba7d4[_0x8c78('0x1e')]=_0x426401;if(_0x394c1d['query'][_0x8c78('0x3e')]){_0x253776[_0x8c78('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x253776);})[_0x8c78('0x24')](function(_0x1612d5){_0x5ba7d4['rows']=_0x1612d5;return _0x5ba7d4;})[_0x8c78('0x24')](respondWithFilteredResult(_0x36e8e5,_0x253776))[_0x8c78('0x40')](handleError(_0x36e8e5,null));};exports['show']=function(_0x348a2f,_0x27603f){var _0x57e2c7={'raw':!![],'where':{'id':_0x348a2f[_0x8c78('0x41')]['id']}},_0x10d521={};_0x10d521[_0x8c78('0x33')]=_[_0x8c78('0x42')](db[_0x8c78('0x2a')]['rawAttributes']);_0x10d521['query']=_[_0x8c78('0x42')](_0x348a2f[_0x8c78('0x2f')]);_0x10d521[_0x8c78('0x30')]=_[_0x8c78('0x31')](_0x10d521[_0x8c78('0x33')],_0x10d521[_0x8c78('0x2f')]);_0x57e2c7[_0x8c78('0x32')]=_[_0x8c78('0x31')](_0x10d521[_0x8c78('0x33')],qs[_0x8c78('0x34')](_0x348a2f[_0x8c78('0x2f')]['fields']));_0x57e2c7[_0x8c78('0x32')]=_0x57e2c7[_0x8c78('0x32')][_0x8c78('0x35')]?_0x57e2c7[_0x8c78('0x32')]:_0x10d521[_0x8c78('0x33')];if(_0x348a2f['query'][_0x8c78('0x3e')]){_0x57e2c7[_0x8c78('0x3f')]=[{'all':!![]}];}_0x57e2c7=_[_0x8c78('0x3c')]({},_0x57e2c7,_0x348a2f[_0x8c78('0x3d')]);return db[_0x8c78('0x2a')]['find'](_0x57e2c7)[_0x8c78('0x24')](handleEntityNotFound(_0x27603f,null))['then'](respondWithResult(_0x27603f,null))['catch'](handleError(_0x27603f,null));};exports[_0x8c78('0x43')]=function(_0x33fbba,_0x61e20){return db['FreshdeskField'][_0x8c78('0x43')](_0x33fbba[_0x8c78('0x44')],{})[_0x8c78('0x24')](respondWithResult(_0x61e20,0xc9))[_0x8c78('0x40')](handleError(_0x61e20,null));};exports[_0x8c78('0x23')]=function(_0x38083e,_0x26103c){if(_0x38083e[_0x8c78('0x44')]['id']){delete _0x38083e[_0x8c78('0x44')]['id'];}return db['FreshdeskField'][_0x8c78('0x45')]({'where':{'id':_0x38083e[_0x8c78('0x41')]['id']}})[_0x8c78('0x24')](handleEntityNotFound(_0x26103c,null))[_0x8c78('0x24')](saveUpdates(_0x38083e['body'],null))[_0x8c78('0x24')](respondWithResult(_0x26103c,null))[_0x8c78('0x40')](handleError(_0x26103c,null));};exports[_0x8c78('0x25')]=function(_0x431125,_0x53e75c){return db[_0x8c78('0x2a')][_0x8c78('0x45')]({'where':{'id':_0x431125[_0x8c78('0x41')]['id']}})['then'](handleEntityNotFound(_0x53e75c,null))[_0x8c78('0x24')](removeEntity(_0x53e75c,null))['catch'](handleError(_0x53e75c,null));};
\ No newline at end of file
+var _0x684c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','query','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x5e51c7,_0x58e2a1){var _0x582322=function(_0xf3b6c4){while(--_0xf3b6c4){_0x5e51c7['push'](_0x5e51c7['shift']());}};_0x582322(++_0x58e2a1);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc684('0x0'));var rimraf=require(_0xc684('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc684('0x2'));var rp=require(_0xc684('0x3'));var moment=require(_0xc684('0x4'));var BPromise=require(_0xc684('0x5'));var Mustache=require(_0xc684('0x6'));var util=require('util');var path=require(_0xc684('0x7'));var sox=require(_0xc684('0x8'));var csv=require(_0xc684('0x9'));var ejs=require(_0xc684('0xa'));var fs=require('fs');var fs_extra=require(_0xc684('0xb'));var _=require(_0xc684('0xc'));var squel=require(_0xc684('0xd'));var crypto=require(_0xc684('0xe'));var jsforce=require(_0xc684('0xf'));var deskjs=require(_0xc684('0x10'));var toCsv=require(_0xc684('0x9'));var querystring=require(_0xc684('0x11'));var Papa=require(_0xc684('0x12'));var Redis=require(_0xc684('0x13'));var authService=require(_0xc684('0x14'));var qs=require(_0xc684('0x15'));var as=require(_0xc684('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc684('0x17'))(_0xc684('0x18'));var utils=require(_0xc684('0x19'));var config=require(_0xc684('0x1a'));var licenseUtil=require(_0xc684('0x1b'));var db=require(_0xc684('0x1c'))['db'];function respondWithStatusCode(_0x4f3ff9,_0x3004a6){_0x3004a6=_0x3004a6||0xcc;return function(_0x10cc25){if(_0x10cc25){return _0x4f3ff9['sendStatus'](_0x3004a6);}return _0x4f3ff9['status'](_0x3004a6)[_0xc684('0x1d')]();};}function respondWithResult(_0x34cfd7,_0x32d5da){_0x32d5da=_0x32d5da||0xc8;return function(_0x2ad4f1){if(_0x2ad4f1){return _0x34cfd7[_0xc684('0x1e')](_0x32d5da)[_0xc684('0x1f')](_0x2ad4f1);}};}function respondWithFilteredResult(_0x4f26f7,_0x56d76f){return function(_0x43235d){if(_0x43235d){var _0x599c93=typeof _0x56d76f['offset']==='undefined'&&typeof _0x56d76f['limit']==='undefined';var _0x264cb5=_0x43235d[_0xc684('0x20')];var _0x3b6f5e=_0x599c93?0x0:_0x56d76f[_0xc684('0x21')];var _0x1c3af5=_0x599c93?_0x43235d['count']:_0x56d76f[_0xc684('0x21')]+_0x56d76f[_0xc684('0x22')];var _0x4afdd0;if(_0x1c3af5>=_0x264cb5){_0x1c3af5=_0x264cb5;_0x4afdd0=0xc8;}else{_0x4afdd0=0xce;}_0x4f26f7[_0xc684('0x1e')](_0x4afdd0);return _0x4f26f7[_0xc684('0x23')](_0xc684('0x24'),_0x3b6f5e+'-'+_0x1c3af5+'/'+_0x264cb5)['json'](_0x43235d);}return null;};}function patchUpdates(_0x62c4e5){return function(_0x11a159){try{jsonpatch[_0xc684('0x25')](_0x11a159,_0x62c4e5,!![]);}catch(_0xe7aadb){return BPromise[_0xc684('0x26')](_0xe7aadb);}return _0x11a159['save']();};}function saveUpdates(_0x13d43f,_0x39f39a){return function(_0x1fb8b0){if(_0x1fb8b0){return _0x1fb8b0['update'](_0x13d43f)['then'](function(_0x5a7b2e){return _0x5a7b2e;});}return null;};}function removeEntity(_0x41162b,_0x15ce5d){return function(_0xd2a943){if(_0xd2a943){return _0xd2a943['destroy']()['then'](function(){_0x41162b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27c7cc,_0x321a88){return function(_0x236f02){if(!_0x236f02){_0x27c7cc['sendStatus'](0x194);}return _0x236f02;};}function handleError(_0x32cc56,_0x4dbf22){_0x4dbf22=_0x4dbf22||0x1f4;return function(_0x125d55){logger[_0xc684('0x27')](_0x125d55[_0xc684('0x28')]);if(_0x125d55['name']){delete _0x125d55[_0xc684('0x29')];}_0x32cc56['status'](_0x4dbf22)[_0xc684('0x2a')](_0x125d55);};}exports[_0xc684('0x2b')]=function(_0x210dcd,_0x9fdc2c){var _0x5df482={},_0xc0f77b={},_0x2710c1={'count':0x0,'rows':[]};var _0x28a48a=_[_0xc684('0x2c')](db[_0xc684('0x2d')][_0xc684('0x2e')],function(_0x10db0d){return{'name':_0x10db0d[_0xc684('0x2f')],'type':_0x10db0d['type']['key']};});_0xc0f77b['model']=_[_0xc684('0x2c')](_0x28a48a,_0xc684('0x29'));_0xc0f77b['query']=_['keys'](_0x210dcd[_0xc684('0x30')]);_0xc0f77b['filters']=_[_0xc684('0x31')](_0xc0f77b[_0xc684('0x32')],_0xc0f77b[_0xc684('0x30')]);_0x5df482['attributes']=_['intersection'](_0xc0f77b[_0xc684('0x32')],qs[_0xc684('0x33')](_0x210dcd['query']['fields']));_0x5df482[_0xc684('0x34')]=_0x5df482[_0xc684('0x34')][_0xc684('0x35')]?_0x5df482[_0xc684('0x34')]:_0xc0f77b[_0xc684('0x32')];if(!_0x210dcd[_0xc684('0x30')]['hasOwnProperty'](_0xc684('0x36'))){_0x5df482['limit']=qs['limit'](_0x210dcd[_0xc684('0x30')][_0xc684('0x22')]);_0x5df482['offset']=qs['offset'](_0x210dcd[_0xc684('0x30')][_0xc684('0x21')]);}_0x5df482[_0xc684('0x37')]=qs[_0xc684('0x38')](_0x210dcd[_0xc684('0x30')]['sort']);_0x5df482[_0xc684('0x39')]=qs[_0xc684('0x3a')](_['pick'](_0x210dcd['query'],_0xc0f77b[_0xc684('0x3a')]),_0x28a48a);if(_0x210dcd[_0xc684('0x30')][_0xc684('0x3b')]){_0x5df482[_0xc684('0x39')]=_[_0xc684('0x3c')](_0x5df482[_0xc684('0x39')],{'$or':_[_0xc684('0x2c')](_0x28a48a,function(_0x4889ad){if(_0x4889ad['type']!==_0xc684('0x3d')){var _0x1a863f={};_0x1a863f[_0x4889ad['name']]={'$like':'%'+_0x210dcd['query']['filter']+'%'};return _0x1a863f;}})});}_0x5df482=_[_0xc684('0x3c')]({},_0x5df482,_0x210dcd[_0xc684('0x3e')]);var _0xb1be5c={'where':_0x5df482[_0xc684('0x39')]};return db[_0xc684('0x2d')]['count'](_0xb1be5c)[_0xc684('0x3f')](function(_0x5b44eb){_0x2710c1[_0xc684('0x20')]=_0x5b44eb;if(_0x210dcd[_0xc684('0x30')][_0xc684('0x40')]){_0x5df482[_0xc684('0x41')]=[{'all':!![]}];}return db['FreshdeskField'][_0xc684('0x42')](_0x5df482);})[_0xc684('0x3f')](function(_0xd9eae7){_0x2710c1[_0xc684('0x43')]=_0xd9eae7;return _0x2710c1;})[_0xc684('0x3f')](respondWithFilteredResult(_0x9fdc2c,_0x5df482))[_0xc684('0x44')](handleError(_0x9fdc2c,null));};exports['show']=function(_0x2b3aa7,_0x5aa42f){var _0x566c61={'raw':!![],'where':{'id':_0x2b3aa7[_0xc684('0x45')]['id']}},_0x46c6ad={};_0x46c6ad[_0xc684('0x32')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x46c6ad['query']=_['keys'](_0x2b3aa7[_0xc684('0x30')]);_0x46c6ad[_0xc684('0x3a')]=_[_0xc684('0x31')](_0x46c6ad['model'],_0x46c6ad[_0xc684('0x30')]);_0x566c61['attributes']=_[_0xc684('0x31')](_0x46c6ad['model'],qs[_0xc684('0x33')](_0x2b3aa7[_0xc684('0x30')][_0xc684('0x33')]));_0x566c61[_0xc684('0x34')]=_0x566c61[_0xc684('0x34')]['length']?_0x566c61[_0xc684('0x34')]:_0x46c6ad[_0xc684('0x32')];if(_0x2b3aa7[_0xc684('0x30')][_0xc684('0x40')]){_0x566c61[_0xc684('0x41')]=[{'all':!![]}];}_0x566c61=_[_0xc684('0x3c')]({},_0x566c61,_0x2b3aa7[_0xc684('0x3e')]);return db[_0xc684('0x2d')][_0xc684('0x46')](_0x566c61)['then'](handleEntityNotFound(_0x5aa42f,null))[_0xc684('0x3f')](respondWithResult(_0x5aa42f,null))[_0xc684('0x44')](handleError(_0x5aa42f,null));};exports['create']=function(_0x30abd0,_0x4fb1d5){return db[_0xc684('0x2d')]['create'](_0x30abd0[_0xc684('0x47')],{})[_0xc684('0x3f')](respondWithResult(_0x4fb1d5,0xc9))[_0xc684('0x44')](handleError(_0x4fb1d5,null));};exports[_0xc684('0x48')]=function(_0x1bfd8d,_0x1fde57){if(_0x1bfd8d[_0xc684('0x47')]['id']){delete _0x1bfd8d[_0xc684('0x47')]['id'];}return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1bfd8d['params']['id']}})[_0xc684('0x3f')](handleEntityNotFound(_0x1fde57,null))[_0xc684('0x3f')](saveUpdates(_0x1bfd8d['body'],null))['then'](respondWithResult(_0x1fde57,null))['catch'](handleError(_0x1fde57,null));};exports[_0xc684('0x49')]=function(_0x1304a2,_0x5439ae){return db[_0xc684('0x2d')][_0xc684('0x46')]({'where':{'id':_0x1304a2[_0xc684('0x45')]['id']}})['then'](handleEntityNotFound(_0x5439ae,null))[_0xc684('0x3f')](removeEntity(_0x5439ae,null))[_0xc684('0x44')](handleError(_0x5439ae,null));};
\ No newline at end of file
index e68333d..22cf326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1904=['FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define'];(function(_0x310170,_0x391a8a){var _0x11d7f8=function(_0x4921cf){while(--_0x4921cf){_0x310170['push'](_0x310170['shift']());}};_0x11d7f8(++_0x391a8a);}(_0x1904,0x1b1));var _0x4190=function(_0x1550d0,_0xc6f629){_0x1550d0=_0x1550d0-0x0;var _0x2efba2=_0x1904[_0x1550d0];return _0x2efba2;};'use strict';var _=require(_0x4190('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4190('0x1'));var BPromise=require(_0x4190('0x2'));var rp=require(_0x4190('0x3'));var fs=require('fs');var path=require(_0x4190('0x4'));var rimraf=require(_0x4190('0x5'));var config=require('../../config/environment');var attributes=require(_0x4190('0x6'));module[_0x4190('0x7')]=function(_0x4dce03,_0x18db79){return _0x4dce03[_0x4190('0x8')](_0x4190('0x9'),attributes,{'tableName':_0x4190('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x4190('0xb'),_0x4190('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8ef=['request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x13afb3,_0x18ba46){var _0x1da142=function(_0x18c41c){while(--_0x18c41c){_0x13afb3['push'](_0x13afb3['shift']());}};_0x1da142(++_0x18ba46);}(_0xb8ef,0x64));var _0xfb8e=function(_0x9ebce4,_0x10f10c){_0x9ebce4=_0x9ebce4-0x0;var _0x2ba839=_0xb8ef[_0x9ebce4];return _0x2ba839;};'use strict';var _=require(_0xfb8e('0x0'));var util=require('util');var logger=require(_0xfb8e('0x1'))(_0xfb8e('0x2'));var moment=require(_0xfb8e('0x3'));var BPromise=require(_0xfb8e('0x4'));var rp=require(_0xfb8e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb8e('0x6'));var config=require(_0xfb8e('0x7'));var attributes=require(_0xfb8e('0x8'));module[_0xfb8e('0x9')]=function(_0x217a11,_0x460c83){return _0x217a11[_0xfb8e('0xa')](_0xfb8e('0xb'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xfb8e('0xc'),'fields':[_0xfb8e('0xd'),_0xfb8e('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ab4fe80..283a69a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3940=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x3940,0x1b9));var _0x0394=function(_0x59de3d,_0x131b92){_0x59de3d=_0x59de3d-0x0;var _0x4f4dac=_0x3940[_0x59de3d];return _0x4f4dac;};'use strict';var _=require(_0x0394('0x0'));var util=require(_0x0394('0x1'));var moment=require(_0x0394('0x2'));var BPromise=require(_0x0394('0x3'));var rs=require(_0x0394('0x4'));var fs=require('fs');var Redis=require(_0x0394('0x5'));var db=require(_0x0394('0x6'))['db'];var utils=require(_0x0394('0x7'));var logger=require(_0x0394('0x8'))(_0x0394('0x9'));var config=require(_0x0394('0xa'));var jayson=require(_0x0394('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39fe6b,_0x2d365b,_0x40aa7a){return new BPromise(function(_0x547c8f,_0x2bdc32){return client[_0x0394('0xc')](_0x39fe6b,_0x40aa7a)[_0x0394('0xd')](function(_0x4e18fd){logger['info'](_0x0394('0xe'),_0x2d365b,_0x0394('0xf'));logger[_0x0394('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2d365b,'request\x20sent',JSON['stringify'](_0x4e18fd));if(_0x4e18fd[_0x0394('0x11')]){if(_0x4e18fd['error'][_0x0394('0x12')]===0x1f4){logger[_0x0394('0x11')](_0x0394('0xe'),_0x2d365b,_0x4e18fd['error']['message']);return _0x2bdc32(_0x4e18fd[_0x0394('0x11')][_0x0394('0x13')]);}logger[_0x0394('0x11')](_0x0394('0xe'),_0x2d365b,_0x4e18fd[_0x0394('0x11')][_0x0394('0x13')]);return _0x547c8f(_0x4e18fd[_0x0394('0x11')]['message']);}else{logger[_0x0394('0x14')](_0x0394('0xe'),_0x2d365b,_0x0394('0xf'));_0x547c8f(_0x4e18fd['result'][_0x0394('0x13')]);}})['catch'](function(_0x2087fd){logger['error'](_0x0394('0xe'),_0x2d365b,_0x2087fd);_0x2bdc32(_0x2087fd);});});}
\ No newline at end of file
+var _0x1db7=['rpc','../../config/environment','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x1db7,0x15d));var _0x71db=function(_0x3d70f6,_0x5c87e7){_0x3d70f6=_0x3d70f6-0x0;var _0xebb9b0=_0x1db7[_0x3d70f6];return _0xebb9b0;};'use strict';var _=require(_0x71db('0x0'));var util=require(_0x71db('0x1'));var moment=require(_0x71db('0x2'));var BPromise=require(_0x71db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71db('0x4'));var db=require(_0x71db('0x5'))['db'];var utils=require(_0x71db('0x6'));var logger=require(_0x71db('0x7'))(_0x71db('0x8'));var config=require(_0x71db('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa2d9,_0x389b65,_0x227315){return new BPromise(function(_0x2303a8,_0x3c47f2){return client[_0x71db('0xa')](_0x3aa2d9,_0x227315)[_0x71db('0xb')](function(_0x26ed42){logger[_0x71db('0xc')](_0x71db('0xd'),_0x389b65,_0x71db('0xe'));logger['debug'](_0x71db('0xf'),_0x389b65,_0x71db('0xe'),JSON[_0x71db('0x10')](_0x26ed42));if(_0x26ed42['error']){if(_0x26ed42[_0x71db('0x11')][_0x71db('0x12')]===0x1f4){logger['error'](_0x71db('0xd'),_0x389b65,_0x26ed42[_0x71db('0x11')]['message']);return _0x3c47f2(_0x26ed42[_0x71db('0x11')]['message']);}logger[_0x71db('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x389b65,_0x26ed42[_0x71db('0x11')]['message']);return _0x2303a8(_0x26ed42[_0x71db('0x11')][_0x71db('0x13')]);}else{logger['info'](_0x71db('0xd'),_0x389b65,_0x71db('0xe'));_0x2303a8(_0x26ed42['result'][_0x71db('0x13')]);}})[_0x71db('0x14')](function(_0xa49acc){logger[_0x71db('0x11')](_0x71db('0xd'),_0x389b65,_0xa49acc);_0x3c47f2(_0xa49acc);});});}
\ No newline at end of file
index 0858202..12dffbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0xcefab6,_0x66648b){var _0xa382d4=function(_0x25c45d){while(--_0x25c45d){_0xcefab6['push'](_0xcefab6['shift']());}};_0xa382d4(++_0x66648b);}(_0xb688,0xcf));var _0x8b68=function(_0x1c3158,_0x5ebb9e){_0x1c3158=_0x1c3158-0x0;var _0x55cfee=_0xb688[_0x1c3158];return _0x55cfee;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')]('/',auth[_0x8b68('0xc')](),controller['create']);router[_0x8b68('0x12')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x13')]);router[_0x8b68('0x14')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeb74=['getFields','post','/:id/configurations','addConfiguration','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0xf79d1b,_0x597b68){var _0x28d26c=function(_0x4783e3){while(--_0x4783e3){_0xf79d1b['push'](_0xf79d1b['shift']());}};_0x28d26c(++_0x597b68);}(_0xeb74,0xe3));var _0x4eb7=function(_0x2c0a83,_0xa851e){_0x2c0a83=_0x2c0a83-0x0;var _0x21d504=_0xeb74[_0x2c0a83];return _0x21d504;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id/configurations',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),controller['create']);router[_0x4eb7('0x10')](_0x4eb7('0x11'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x12')]);router[_0x4eb7('0x13')](_0x4eb7('0x14'),auth[_0x4eb7('0xb')](),controller['update']);router['delete']('/:id',auth[_0x4eb7('0xb')](),controller['destroy']);module[_0x4eb7('0x15')]=router;
\ No newline at end of file
index 2777942..baa445e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a55=['STRING','sequelize'];(function(_0x40fe39,_0x4df272){var _0xba3289=function(_0x11147c){while(--_0x11147c){_0x40fe39['push'](_0x40fe39['shift']());}};_0xba3289(++_0x4df272);}(_0x6a55,0xdb));var _0x56a5=function(_0x5fe7ce,_0x1a0d39){_0x5fe7ce=_0x5fe7ce-0x0;var _0x3b5793=_0x6a55[_0x5fe7ce];return _0x3b5793;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x56a5('0x1')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x56a5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x583c=['exports','STRING','username','sequelize'];(function(_0x547b91,_0x5f29e8){var _0x393046=function(_0x2321a6){while(--_0x2321a6){_0x547b91['push'](_0x547b91['shift']());}};_0x393046(++_0x5f29e8);}(_0x583c,0x12b));var _0xc583=function(_0x4a29a9,_0x58cd04){_0x4a29a9=_0x4a29a9-0x0;var _0x386570=_0x583c[_0x4a29a9];return _0x386570;};'use strict';var Sequelize=require(_0xc583('0x0'));module[_0xc583('0x1')]={'name':{'type':Sequelize[_0xc583('0x2')]},'description':{'type':Sequelize[_0xc583('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc583('0x3')},'apiKey':{'type':Sequelize[_0xc583('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xc583('0x2')],'allowNull':![]}};
\ No newline at end of file
index 7e32160..3331b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff5=['Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','name','map','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','model','find','create','body','update','destroy','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','/api/selector/owners'];(function(_0x2b84af,_0x471328){var _0xed1ae3=function(_0x546592){while(--_0x546592){_0x2b84af['push'](_0x2b84af['shift']());}};_0xed1ae3(++_0x471328);}(_0xeff5,0x6c));var _0x5eff=function(_0x429fe7,_0x3cff5f){_0x429fe7=_0x429fe7-0x0;var _0x3d5347=_0xeff5[_0x429fe7];return _0x3d5347;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5eff('0x0'));var zipdir=require(_0x5eff('0x1'));var jsonpatch=require(_0x5eff('0x2'));var rp=require(_0x5eff('0x3'));var moment=require(_0x5eff('0x4'));var BPromise=require(_0x5eff('0x5'));var Mustache=require(_0x5eff('0x6'));var util=require(_0x5eff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5eff('0x8'));var ejs=require(_0x5eff('0x9'));var fs=require('fs');var fs_extra=require(_0x5eff('0xa'));var _=require(_0x5eff('0xb'));var squel=require(_0x5eff('0xc'));var crypto=require(_0x5eff('0xd'));var jsforce=require(_0x5eff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5eff('0x8'));var querystring=require('querystring');var Papa=require(_0x5eff('0xf'));var Redis=require(_0x5eff('0x10'));var authService=require(_0x5eff('0x11'));var qs=require(_0x5eff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5eff('0x13'));var logger=require(_0x5eff('0x14'))(_0x5eff('0x15'));var utils=require(_0x5eff('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5eff('0x17'));var db=require(_0x5eff('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5bd0bd,_0xbe7f3b){_0xbe7f3b=_0xbe7f3b||0xcc;return function(_0x27ced7){if(_0x27ced7){return _0x5bd0bd[_0x5eff('0x19')](_0xbe7f3b);}return _0x5bd0bd[_0x5eff('0x1a')](_0xbe7f3b)[_0x5eff('0x1b')]();};}function respondWithResult(_0x1570f8,_0x421cd5){_0x421cd5=_0x421cd5||0xc8;return function(_0x43473b){if(_0x43473b){return _0x1570f8[_0x5eff('0x1a')](_0x421cd5)[_0x5eff('0x1c')](_0x43473b);}};}function respondWithFilteredResult(_0x2f1ddb,_0x41266e){return function(_0x31afe0){if(_0x31afe0){var _0x488cf4=typeof _0x41266e[_0x5eff('0x1d')]===_0x5eff('0x1e')&&typeof _0x41266e[_0x5eff('0x1f')]==='undefined';var _0x2832d6=_0x31afe0[_0x5eff('0x20')];var _0x1ed5f8=_0x488cf4?0x0:_0x41266e[_0x5eff('0x1d')];var _0x531c3f=_0x488cf4?_0x31afe0['count']:_0x41266e[_0x5eff('0x1d')]+_0x41266e[_0x5eff('0x1f')];var _0x2f16cc;if(_0x531c3f>=_0x2832d6){_0x531c3f=_0x2832d6;_0x2f16cc=0xc8;}else{_0x2f16cc=0xce;}_0x2f1ddb[_0x5eff('0x1a')](_0x2f16cc);return _0x2f1ddb[_0x5eff('0x21')](_0x5eff('0x22'),_0x1ed5f8+'-'+_0x531c3f+'/'+_0x2832d6)['json'](_0x31afe0);}return null;};}function patchUpdates(_0xd692a8){return function(_0x2c5b52){try{jsonpatch['apply'](_0x2c5b52,_0xd692a8,!![]);}catch(_0x5b0c2d){return BPromise[_0x5eff('0x23')](_0x5b0c2d);}return _0x2c5b52[_0x5eff('0x24')]();};}function saveUpdates(_0x288c82,_0x1b1e8e){return function(_0x315ce2){if(_0x315ce2){return _0x315ce2['update'](_0x288c82)[_0x5eff('0x25')](function(_0x9041ba){return _0x9041ba;});}return null;};}function removeEntity(_0x2df371,_0x17d784){return function(_0x3d8add){if(_0x3d8add){return _0x3d8add['destroy']()['then'](function(){_0x2df371[_0x5eff('0x1a')](0xcc)[_0x5eff('0x1b')]();});}};}function handleEntityNotFound(_0x55d607,_0x3cf825){return function(_0x46cd2d){if(!_0x46cd2d){_0x55d607[_0x5eff('0x19')](0x194);}return _0x46cd2d;};}function handleError(_0x4d957f,_0x1f7ce8){_0x1f7ce8=_0x1f7ce8||0x1f4;return function(_0x1510ac){logger['error'](_0x1510ac['stack']);if(_0x1510ac[_0x5eff('0x26')]){delete _0x1510ac['name'];}_0x4d957f[_0x5eff('0x1a')](_0x1f7ce8)['send'](_0x1510ac);};}exports['index']=function(_0x406f35,_0x300245){var _0x339c9d={},_0x1c8421={},_0x35e177={'count':0x0,'rows':[]};var _0x35a7b3=_[_0x5eff('0x27')](db[_0x5eff('0x28')][_0x5eff('0x29')],function(_0x3679e6){return{'name':_0x3679e6[_0x5eff('0x2a')],'type':_0x3679e6[_0x5eff('0x2b')][_0x5eff('0x2c')]};});_0x1c8421['model']=_[_0x5eff('0x27')](_0x35a7b3,_0x5eff('0x26'));_0x1c8421[_0x5eff('0x2d')]=_[_0x5eff('0x2e')](_0x406f35[_0x5eff('0x2d')]);_0x1c8421['filters']=_[_0x5eff('0x2f')](_0x1c8421['model'],_0x1c8421[_0x5eff('0x2d')]);_0x339c9d[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x1c8421['model'],qs[_0x5eff('0x31')](_0x406f35[_0x5eff('0x2d')][_0x5eff('0x31')]));_0x339c9d[_0x5eff('0x30')]=_0x339c9d[_0x5eff('0x30')][_0x5eff('0x32')]?_0x339c9d[_0x5eff('0x30')]:_0x1c8421['model'];if(!_0x406f35[_0x5eff('0x2d')][_0x5eff('0x33')](_0x5eff('0x34'))){_0x339c9d[_0x5eff('0x1f')]=qs['limit'](_0x406f35[_0x5eff('0x2d')][_0x5eff('0x1f')]);_0x339c9d[_0x5eff('0x1d')]=qs['offset'](_0x406f35['query']['offset']);}_0x339c9d[_0x5eff('0x35')]=qs['sort'](_0x406f35['query'][_0x5eff('0x36')]);_0x339c9d[_0x5eff('0x37')]=qs[_0x5eff('0x38')](_['pick'](_0x406f35[_0x5eff('0x2d')],_0x1c8421[_0x5eff('0x38')]),_0x35a7b3);if(_0x406f35[_0x5eff('0x2d')][_0x5eff('0x39')]){_0x339c9d['where']=_[_0x5eff('0x3a')](_0x339c9d[_0x5eff('0x37')],{'$or':_[_0x5eff('0x27')](_0x35a7b3,function(_0x1d7105){if(_0x1d7105[_0x5eff('0x2b')]!==_0x5eff('0x3b')){var _0x585eb6={};_0x585eb6[_0x1d7105[_0x5eff('0x26')]]={'$like':'%'+_0x406f35[_0x5eff('0x2d')]['filter']+'%'};return _0x585eb6;}})});}_0x339c9d=_['merge']({},_0x339c9d,_0x406f35[_0x5eff('0x3c')]);var _0x446806={'where':_0x339c9d[_0x5eff('0x37')]};return db[_0x5eff('0x28')]['count'](_0x446806)[_0x5eff('0x25')](function(_0x142bb2){_0x35e177[_0x5eff('0x20')]=_0x142bb2;if(_0x406f35[_0x5eff('0x2d')][_0x5eff('0x3d')]){_0x339c9d[_0x5eff('0x3e')]=[{'all':!![]}];}return db[_0x5eff('0x28')][_0x5eff('0x3f')](_0x339c9d);})['then'](function(_0x99f4a9){_0x35e177[_0x5eff('0x40')]=_0x99f4a9;return _0x35e177;})[_0x5eff('0x25')](respondWithFilteredResult(_0x300245,_0x339c9d))[_0x5eff('0x41')](handleError(_0x300245,null));};exports['show']=function(_0x33c4ce,_0x1dcdd8){var _0x54047e={'raw':![],'where':{'id':_0x33c4ce[_0x5eff('0x42')]['id']}},_0x3debd1={};_0x3debd1['model']=_[_0x5eff('0x2e')](db[_0x5eff('0x28')][_0x5eff('0x29')]);_0x3debd1[_0x5eff('0x2d')]=_[_0x5eff('0x2e')](_0x33c4ce['query']);_0x3debd1[_0x5eff('0x38')]=_[_0x5eff('0x2f')](_0x3debd1[_0x5eff('0x43')],_0x3debd1[_0x5eff('0x2d')]);_0x54047e[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x3debd1['model'],qs[_0x5eff('0x31')](_0x33c4ce['query']['fields']));_0x54047e['attributes']=_0x54047e['attributes'][_0x5eff('0x32')]?_0x54047e[_0x5eff('0x30')]:_0x3debd1[_0x5eff('0x43')];if(_0x33c4ce['query'][_0x5eff('0x3d')]){_0x54047e[_0x5eff('0x3e')]=[{'all':!![]}];}_0x54047e=_[_0x5eff('0x3a')]({},_0x54047e,_0x33c4ce['options']);return db[_0x5eff('0x28')][_0x5eff('0x44')](_0x54047e)[_0x5eff('0x25')](handleEntityNotFound(_0x1dcdd8,null))[_0x5eff('0x25')](respondWithResult(_0x1dcdd8,null))[_0x5eff('0x41')](handleError(_0x1dcdd8,null));};exports['create']=function(_0x253a10,_0x2a7fa8){return db[_0x5eff('0x28')][_0x5eff('0x45')](_0x253a10[_0x5eff('0x46')],{})[_0x5eff('0x25')](respondWithResult(_0x2a7fa8,0xc9))[_0x5eff('0x41')](handleError(_0x2a7fa8,null));};exports[_0x5eff('0x47')]=function(_0x5bb81b,_0x4e1546){if(_0x5bb81b[_0x5eff('0x46')]['id']){delete _0x5bb81b['body']['id'];}return db[_0x5eff('0x28')]['find']({'where':{'id':_0x5bb81b[_0x5eff('0x42')]['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x4e1546,null))['then'](saveUpdates(_0x5bb81b[_0x5eff('0x46')],null))[_0x5eff('0x25')](respondWithResult(_0x4e1546,null))[_0x5eff('0x41')](handleError(_0x4e1546,null));};exports[_0x5eff('0x48')]=function(_0x1e2210,_0x3daf9f){return db[_0x5eff('0x28')]['find']({'where':{'id':_0x1e2210['params']['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x3daf9f,null))[_0x5eff('0x25')](removeEntity(_0x3daf9f,null))[_0x5eff('0x41')](handleError(_0x3daf9f,null));};exports['getConfigurations']=function(_0x470810,_0x3e8aa4,_0x49fa39){var _0x32e0e6={};var _0x287dab={};var _0x10329b;var _0x50cb11;return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x470810['params']['id']}})['then'](handleEntityNotFound(_0x3e8aa4,null))[_0x5eff('0x25')](function(_0x51a761){if(_0x51a761){_0x10329b=_0x51a761;_0x287dab[_0x5eff('0x43')]=_['keys'](db[_0x5eff('0x4a')][_0x5eff('0x29')]);_0x287dab['query']=_['keys'](_0x470810[_0x5eff('0x2d')]);_0x287dab[_0x5eff('0x38')]=_[_0x5eff('0x2f')](_0x287dab[_0x5eff('0x43')],_0x287dab[_0x5eff('0x2d')]);_0x32e0e6[_0x5eff('0x30')]=_[_0x5eff('0x2f')](_0x287dab[_0x5eff('0x43')],qs[_0x5eff('0x31')](_0x470810['query'][_0x5eff('0x31')]));_0x32e0e6['attributes']=_0x32e0e6[_0x5eff('0x30')][_0x5eff('0x32')]?_0x32e0e6['attributes']:_0x287dab[_0x5eff('0x43')];_0x32e0e6[_0x5eff('0x35')]=qs[_0x5eff('0x36')](_0x470810[_0x5eff('0x2d')]['sort']);_0x32e0e6['where']=qs[_0x5eff('0x38')](_['pick'](_0x470810[_0x5eff('0x2d')],_0x287dab[_0x5eff('0x38')]));if(_0x470810[_0x5eff('0x2d')][_0x5eff('0x39')]){_0x32e0e6[_0x5eff('0x37')]=_[_0x5eff('0x3a')](_0x32e0e6['where'],{'$or':_['map'](_0x32e0e6[_0x5eff('0x30')],function(_0x4cb028){var _0x48f4f6={};_0x48f4f6[_0x4cb028]={'$like':'%'+_0x470810['query'][_0x5eff('0x39')]+'%'};return _0x48f4f6;})});}_0x32e0e6=_[_0x5eff('0x3a')]({},_0x32e0e6,_0x470810[_0x5eff('0x3c')]);return _0x10329b['getConfigurations'](_0x32e0e6);}})[_0x5eff('0x25')](function(_0x44d331){if(_0x44d331){_0x50cb11=_0x44d331[_0x5eff('0x32')];if(!_0x470810['query'][_0x5eff('0x33')](_0x5eff('0x34'))){_0x32e0e6['limit']=qs[_0x5eff('0x1f')](_0x470810['query'][_0x5eff('0x1f')]);_0x32e0e6[_0x5eff('0x1d')]=qs[_0x5eff('0x1d')](_0x470810[_0x5eff('0x2d')][_0x5eff('0x1d')]);}return _0x10329b[_0x5eff('0x4b')](_0x32e0e6);}})['then'](function(_0x4ae22a){if(_0x4ae22a){return _0x4ae22a?{'count':_0x50cb11,'rows':_0x4ae22a}:null;}})[_0x5eff('0x25')](respondWithResult(_0x3e8aa4,null))[_0x5eff('0x41')](handleError(_0x3e8aa4,null));};exports[_0x5eff('0x4c')]=function(_0x53f5ac,_0x15cbcd,_0x5790e8){if(_0x53f5ac[_0x5eff('0x46')]['id']){delete _0x53f5ac['body']['id'];}return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x53f5ac['params']['id']}})[_0x5eff('0x25')](handleEntityNotFound(_0x15cbcd,null))[_0x5eff('0x25')](function(_0x104157){if(_0x104157){_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x4d')]=_0x104157['id'];_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x4e')]=integrations[_0x5eff('0x4f')](_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x50')],_0x53f5ac['body'][_0x5eff('0x2b')]);_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x51')]=integrations[_0x5eff('0x52')](_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x50')],_0x53f5ac[_0x5eff('0x46')][_0x5eff('0x2b')]);return db['FreshsalesConfiguration']['create'](_0x53f5ac['body'],{'include':[{'model':db[_0x5eff('0x53')],'as':'Subjects'},{'model':db[_0x5eff('0x53')],'as':_0x5eff('0x51')}]});}return null;})[_0x5eff('0x25')](respondWithResult(_0x15cbcd,null))[_0x5eff('0x41')](handleError(_0x15cbcd,null));};exports['getFields']=function(_0x137a1c,_0x216d7c,_0x54bc6c){var _0x87bfe5='';var _0x140941='';return db['FreshsalesAccount'][_0x5eff('0x49')]({'where':{'id':_0x137a1c[_0x5eff('0x42')]['id']},'attributes':['id',_0x5eff('0x54'),'remoteUri',_0x5eff('0x55')]})[_0x5eff('0x25')](handleEntityNotFound(_0x216d7c,null))[_0x5eff('0x25')](function(_0x13aa11){if(_0x13aa11){_0x140941=_0x13aa11[_0x5eff('0x54')];_0x87bfe5=_0x13aa11['remoteUri'];var _0x47d4b7=_0x13aa11[_0x5eff('0x56')][_0x5eff('0x57')](-0x1);if(_0x47d4b7==='/'){_0x87bfe5=_0x87bfe5[_0x5eff('0x58')](0x0,_0x87bfe5[_0x5eff('0x59')](_0x47d4b7));}return rp({'method':_0x5eff('0x5a'),'uri':util['format']('%s%s',_0x87bfe5,_0x5eff('0x5b')),'headers':{'Authorization':_0x5eff('0x5c')+_0x13aa11[_0x5eff('0x55')]},'json':!![]});}})[_0x5eff('0x25')](function(_0x16143e){if(_0x16143e){var _0xc7e61f=_0x16143e[_0x5eff('0x5d')];var _0x3b4b75=![];var _0x14c205=null;for(_0x14c205=0x0;_0x14c205<_0xc7e61f[_0x5eff('0x32')];_0x14c205++){if(_0xc7e61f[_0x14c205][_0x5eff('0x5e')]===_0x140941){_0x3b4b75=!![];}}if(_0x3b4b75){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5eff('0x5f')});}}})[_0x5eff('0x25')](respondWithResult(_0x216d7c,null))[_0x5eff('0x41')](function(_0x2f2b25){var _0x19ce0e=_0x137a1c['query'][_0x5eff('0x60')]?0x1f4:_0x2f2b25['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x5eff('0x61'),_0x19ce0e,JSON[_0x5eff('0x62')](_0x2f2b25));delete _0x2f2b25[_0x5eff('0x26')];if(_0x19ce0e===0x191){_0x19ce0e=0x190;}_0x216d7c[_0x5eff('0x1a')](_0x19ce0e)['send'](_0x137a1c[_0x5eff('0x2d')][_0x5eff('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x2f2b25[_0x5eff('0x63')]}:_0x2f2b25);});};
\ No newline at end of file
+var _0x7b8b=['then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','params','find','catch','create','update','body','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','findOne','remoteUri','username','slice','substring','lastIndexOf','/api/selector/owners','Token\x20token=','apiKey','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','limit','set','json','apply','reject','save'];(function(_0x476673,_0x588957){var _0x50c1b4=function(_0x56d5ba){while(--_0x56d5ba){_0x476673['push'](_0x476673['shift']());}};_0x50c1b4(++_0x588957);}(_0x7b8b,0x119));var _0xb7b8=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x7b8b[_0x2de020];return _0x182b7c;};'use strict';var emlformat=require(_0xb7b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb7b8('0x2'));var Mustache=require(_0xb7b8('0x3'));var util=require(_0xb7b8('0x4'));var path=require(_0xb7b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb7b8('0x6'));var fs=require('fs');var fs_extra=require(_0xb7b8('0x7'));var _=require(_0xb7b8('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb7b8('0x9'));var deskjs=require(_0xb7b8('0xa'));var toCsv=require(_0xb7b8('0xb'));var querystring=require(_0xb7b8('0xc'));var Papa=require(_0xb7b8('0xd'));var Redis=require(_0xb7b8('0xe'));var authService=require(_0xb7b8('0xf'));var qs=require(_0xb7b8('0x10'));var as=require(_0xb7b8('0x11'));var hardwareService=require(_0xb7b8('0x12'));var logger=require('../../config/logger')(_0xb7b8('0x13'));var utils=require(_0xb7b8('0x14'));var config=require(_0xb7b8('0x15'));var licenseUtil=require(_0xb7b8('0x16'));var db=require(_0xb7b8('0x17'))['db'];var integrations=require(_0xb7b8('0x18'));function respondWithStatusCode(_0x2a7853,_0x17014f){_0x17014f=_0x17014f||0xcc;return function(_0x2c4abe){if(_0x2c4abe){return _0x2a7853['sendStatus'](_0x17014f);}return _0x2a7853['status'](_0x17014f)['end']();};}function respondWithResult(_0x143ad6,_0x16aa40){_0x16aa40=_0x16aa40||0xc8;return function(_0x1cf066){if(_0x1cf066){return _0x143ad6[_0xb7b8('0x19')](_0x16aa40)['json'](_0x1cf066);}};}function respondWithFilteredResult(_0x5d49d4,_0xce6408){return function(_0x10b8eb){if(_0x10b8eb){var _0x3ceb2a=typeof _0xce6408[_0xb7b8('0x1a')]===_0xb7b8('0x1b')&&typeof _0xce6408[_0xb7b8('0x1c')]==='undefined';var _0x1eb5a4=_0x10b8eb['count'];var _0xad99d3=_0x3ceb2a?0x0:_0xce6408[_0xb7b8('0x1a')];var _0x2fb54a=_0x3ceb2a?_0x10b8eb['count']:_0xce6408[_0xb7b8('0x1a')]+_0xce6408[_0xb7b8('0x1c')];var _0x213118;if(_0x2fb54a>=_0x1eb5a4){_0x2fb54a=_0x1eb5a4;_0x213118=0xc8;}else{_0x213118=0xce;}_0x5d49d4[_0xb7b8('0x19')](_0x213118);return _0x5d49d4[_0xb7b8('0x1d')]('Content-Range',_0xad99d3+'-'+_0x2fb54a+'/'+_0x1eb5a4)[_0xb7b8('0x1e')](_0x10b8eb);}return null;};}function patchUpdates(_0x59f17a){return function(_0x586fbf){try{jsonpatch[_0xb7b8('0x1f')](_0x586fbf,_0x59f17a,!![]);}catch(_0x81e182){return BPromise[_0xb7b8('0x20')](_0x81e182);}return _0x586fbf[_0xb7b8('0x21')]();};}function saveUpdates(_0xab6d13,_0x5dd1e4){return function(_0x192ab7){if(_0x192ab7){return _0x192ab7['update'](_0xab6d13)[_0xb7b8('0x22')](function(_0xb298fb){return _0xb298fb;});}return null;};}function removeEntity(_0x2d0473,_0x5330a7){return function(_0x3a1fe6){if(_0x3a1fe6){return _0x3a1fe6[_0xb7b8('0x23')]()[_0xb7b8('0x22')](function(){_0x2d0473[_0xb7b8('0x19')](0xcc)[_0xb7b8('0x24')]();});}};}function handleEntityNotFound(_0x1354ab,_0x4812a7){return function(_0x52e8ea){if(!_0x52e8ea){_0x1354ab[_0xb7b8('0x25')](0x194);}return _0x52e8ea;};}function handleError(_0x141bef,_0x1e121f){_0x1e121f=_0x1e121f||0x1f4;return function(_0x5591fd){logger[_0xb7b8('0x26')](_0x5591fd[_0xb7b8('0x27')]);if(_0x5591fd[_0xb7b8('0x28')]){delete _0x5591fd[_0xb7b8('0x28')];}_0x141bef[_0xb7b8('0x19')](_0x1e121f)[_0xb7b8('0x29')](_0x5591fd);};}exports[_0xb7b8('0x2a')]=function(_0x2f10bd,_0x287d1d){var _0x451bae={},_0x19906d={},_0x5e5d2e={'count':0x0,'rows':[]};var _0x3f14b6=_[_0xb7b8('0x2b')](db[_0xb7b8('0x2c')][_0xb7b8('0x2d')],function(_0x33b9ec){return{'name':_0x33b9ec[_0xb7b8('0x2e')],'type':_0x33b9ec['type'][_0xb7b8('0x2f')]};});_0x19906d[_0xb7b8('0x30')]=_[_0xb7b8('0x2b')](_0x3f14b6,_0xb7b8('0x28'));_0x19906d[_0xb7b8('0x31')]=_[_0xb7b8('0x32')](_0x2f10bd[_0xb7b8('0x31')]);_0x19906d[_0xb7b8('0x33')]=_[_0xb7b8('0x34')](_0x19906d['model'],_0x19906d['query']);_0x451bae[_0xb7b8('0x35')]=_[_0xb7b8('0x34')](_0x19906d[_0xb7b8('0x30')],qs[_0xb7b8('0x36')](_0x2f10bd[_0xb7b8('0x31')][_0xb7b8('0x36')]));_0x451bae['attributes']=_0x451bae['attributes'][_0xb7b8('0x37')]?_0x451bae[_0xb7b8('0x35')]:_0x19906d['model'];if(!_0x2f10bd[_0xb7b8('0x31')]['hasOwnProperty'](_0xb7b8('0x38'))){_0x451bae[_0xb7b8('0x1c')]=qs[_0xb7b8('0x1c')](_0x2f10bd[_0xb7b8('0x31')]['limit']);_0x451bae['offset']=qs[_0xb7b8('0x1a')](_0x2f10bd[_0xb7b8('0x31')]['offset']);}_0x451bae[_0xb7b8('0x39')]=qs[_0xb7b8('0x3a')](_0x2f10bd[_0xb7b8('0x31')][_0xb7b8('0x3a')]);_0x451bae[_0xb7b8('0x3b')]=qs[_0xb7b8('0x33')](_[_0xb7b8('0x3c')](_0x2f10bd['query'],_0x19906d[_0xb7b8('0x33')]),_0x3f14b6);if(_0x2f10bd['query'][_0xb7b8('0x3d')]){_0x451bae[_0xb7b8('0x3b')]=_[_0xb7b8('0x3e')](_0x451bae['where'],{'$or':_['map'](_0x3f14b6,function(_0x6050c0){if(_0x6050c0[_0xb7b8('0x3f')]!==_0xb7b8('0x40')){var _0x100e72={};_0x100e72[_0x6050c0['name']]={'$like':'%'+_0x2f10bd[_0xb7b8('0x31')][_0xb7b8('0x3d')]+'%'};return _0x100e72;}})});}_0x451bae=_[_0xb7b8('0x3e')]({},_0x451bae,_0x2f10bd[_0xb7b8('0x41')]);var _0x5f167f={'where':_0x451bae[_0xb7b8('0x3b')]};return db['FreshsalesAccount'][_0xb7b8('0x42')](_0x5f167f)['then'](function(_0x5eea70){_0x5e5d2e['count']=_0x5eea70;if(_0x2f10bd[_0xb7b8('0x31')][_0xb7b8('0x43')]){_0x451bae[_0xb7b8('0x44')]=[{'all':!![]}];}return db[_0xb7b8('0x2c')]['findAll'](_0x451bae);})[_0xb7b8('0x22')](function(_0x3080e6){_0x5e5d2e[_0xb7b8('0x45')]=_0x3080e6;return _0x5e5d2e;})[_0xb7b8('0x22')](respondWithFilteredResult(_0x287d1d,_0x451bae))['catch'](handleError(_0x287d1d,null));};exports[_0xb7b8('0x46')]=function(_0xf25073,_0x3d573e){var _0x2efc8e={'raw':![],'where':{'id':_0xf25073[_0xb7b8('0x47')]['id']}},_0x1573af={};_0x1573af[_0xb7b8('0x30')]=_[_0xb7b8('0x32')](db[_0xb7b8('0x2c')][_0xb7b8('0x2d')]);_0x1573af[_0xb7b8('0x31')]=_[_0xb7b8('0x32')](_0xf25073['query']);_0x1573af[_0xb7b8('0x33')]=_[_0xb7b8('0x34')](_0x1573af[_0xb7b8('0x30')],_0x1573af[_0xb7b8('0x31')]);_0x2efc8e[_0xb7b8('0x35')]=_['intersection'](_0x1573af[_0xb7b8('0x30')],qs['fields'](_0xf25073[_0xb7b8('0x31')]['fields']));_0x2efc8e[_0xb7b8('0x35')]=_0x2efc8e['attributes']['length']?_0x2efc8e['attributes']:_0x1573af[_0xb7b8('0x30')];if(_0xf25073[_0xb7b8('0x31')][_0xb7b8('0x43')]){_0x2efc8e[_0xb7b8('0x44')]=[{'all':!![]}];}_0x2efc8e=_['merge']({},_0x2efc8e,_0xf25073[_0xb7b8('0x41')]);return db['FreshsalesAccount'][_0xb7b8('0x48')](_0x2efc8e)[_0xb7b8('0x22')](handleEntityNotFound(_0x3d573e,null))[_0xb7b8('0x22')](respondWithResult(_0x3d573e,null))[_0xb7b8('0x49')](handleError(_0x3d573e,null));};exports[_0xb7b8('0x4a')]=function(_0x58e945,_0x2cbfa7){return db[_0xb7b8('0x2c')][_0xb7b8('0x4a')](_0x58e945['body'],{})[_0xb7b8('0x22')](respondWithResult(_0x2cbfa7,0xc9))[_0xb7b8('0x49')](handleError(_0x2cbfa7,null));};exports[_0xb7b8('0x4b')]=function(_0xb9631c,_0x319828){if(_0xb9631c['body']['id']){delete _0xb9631c[_0xb7b8('0x4c')]['id'];}return db[_0xb7b8('0x2c')][_0xb7b8('0x48')]({'where':{'id':_0xb9631c['params']['id']}})['then'](handleEntityNotFound(_0x319828,null))[_0xb7b8('0x22')](saveUpdates(_0xb9631c['body'],null))[_0xb7b8('0x22')](respondWithResult(_0x319828,null))['catch'](handleError(_0x319828,null));};exports[_0xb7b8('0x23')]=function(_0x3bdb47,_0x399d1b){return db['FreshsalesAccount'][_0xb7b8('0x48')]({'where':{'id':_0x3bdb47['params']['id']}})[_0xb7b8('0x22')](handleEntityNotFound(_0x399d1b,null))['then'](removeEntity(_0x399d1b,null))[_0xb7b8('0x49')](handleError(_0x399d1b,null));};exports['getConfigurations']=function(_0x3dd8ff,_0x47233f,_0x270250){var _0xd7cc15={};var _0x529b0e={};var _0x5d2cfe;var _0x5de6fb;return db[_0xb7b8('0x2c')]['findOne']({'where':{'id':_0x3dd8ff[_0xb7b8('0x47')]['id']}})[_0xb7b8('0x22')](handleEntityNotFound(_0x47233f,null))['then'](function(_0x50b479){if(_0x50b479){_0x5d2cfe=_0x50b479;_0x529b0e[_0xb7b8('0x30')]=_['keys'](db[_0xb7b8('0x4d')]['rawAttributes']);_0x529b0e[_0xb7b8('0x31')]=_[_0xb7b8('0x32')](_0x3dd8ff['query']);_0x529b0e[_0xb7b8('0x33')]=_[_0xb7b8('0x34')](_0x529b0e[_0xb7b8('0x30')],_0x529b0e['query']);_0xd7cc15[_0xb7b8('0x35')]=_[_0xb7b8('0x34')](_0x529b0e[_0xb7b8('0x30')],qs[_0xb7b8('0x36')](_0x3dd8ff[_0xb7b8('0x31')][_0xb7b8('0x36')]));_0xd7cc15['attributes']=_0xd7cc15['attributes'][_0xb7b8('0x37')]?_0xd7cc15[_0xb7b8('0x35')]:_0x529b0e[_0xb7b8('0x30')];_0xd7cc15[_0xb7b8('0x39')]=qs['sort'](_0x3dd8ff[_0xb7b8('0x31')][_0xb7b8('0x3a')]);_0xd7cc15[_0xb7b8('0x3b')]=qs[_0xb7b8('0x33')](_[_0xb7b8('0x3c')](_0x3dd8ff[_0xb7b8('0x31')],_0x529b0e['filters']));if(_0x3dd8ff[_0xb7b8('0x31')][_0xb7b8('0x3d')]){_0xd7cc15[_0xb7b8('0x3b')]=_[_0xb7b8('0x3e')](_0xd7cc15['where'],{'$or':_[_0xb7b8('0x2b')](_0xd7cc15['attributes'],function(_0x32bc25){var _0x51931c={};_0x51931c[_0x32bc25]={'$like':'%'+_0x3dd8ff['query'][_0xb7b8('0x3d')]+'%'};return _0x51931c;})});}_0xd7cc15=_[_0xb7b8('0x3e')]({},_0xd7cc15,_0x3dd8ff[_0xb7b8('0x41')]);return _0x5d2cfe[_0xb7b8('0x4e')](_0xd7cc15);}})['then'](function(_0x4b3835){if(_0x4b3835){_0x5de6fb=_0x4b3835[_0xb7b8('0x37')];if(!_0x3dd8ff[_0xb7b8('0x31')][_0xb7b8('0x4f')]('nolimit')){_0xd7cc15[_0xb7b8('0x1c')]=qs[_0xb7b8('0x1c')](_0x3dd8ff[_0xb7b8('0x31')]['limit']);_0xd7cc15[_0xb7b8('0x1a')]=qs[_0xb7b8('0x1a')](_0x3dd8ff['query']['offset']);}return _0x5d2cfe[_0xb7b8('0x4e')](_0xd7cc15);}})['then'](function(_0x19b1fe){if(_0x19b1fe){return _0x19b1fe?{'count':_0x5de6fb,'rows':_0x19b1fe}:null;}})[_0xb7b8('0x22')](respondWithResult(_0x47233f,null))[_0xb7b8('0x49')](handleError(_0x47233f,null));};exports[_0xb7b8('0x50')]=function(_0x10dfff,_0x137507,_0x1e2714){if(_0x10dfff[_0xb7b8('0x4c')]['id']){delete _0x10dfff[_0xb7b8('0x4c')]['id'];}return db[_0xb7b8('0x2c')]['findOne']({'where':{'id':_0x10dfff[_0xb7b8('0x47')]['id']}})[_0xb7b8('0x22')](handleEntityNotFound(_0x137507,null))[_0xb7b8('0x22')](function(_0x20d5b7){if(_0x20d5b7){_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x51')]=_0x20d5b7['id'];_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x52')]=integrations[_0xb7b8('0x53')](_0x10dfff['body'][_0xb7b8('0x54')],_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x3f')]);_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x55')]=integrations[_0xb7b8('0x56')](_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x54')],_0x10dfff[_0xb7b8('0x4c')][_0xb7b8('0x3f')]);return db[_0xb7b8('0x4d')]['create'](_0x10dfff[_0xb7b8('0x4c')],{'include':[{'model':db[_0xb7b8('0x57')],'as':_0xb7b8('0x52')},{'model':db[_0xb7b8('0x57')],'as':_0xb7b8('0x55')}]});}return null;})['then'](respondWithResult(_0x137507,null))[_0xb7b8('0x49')](handleError(_0x137507,null));};exports['getFields']=function(_0x202946,_0x3b0e0b,_0xbc47e5){var _0x57ae5f='';var _0x7b8bd1='';return db[_0xb7b8('0x2c')][_0xb7b8('0x58')]({'where':{'id':_0x202946[_0xb7b8('0x47')]['id']},'attributes':['id','username',_0xb7b8('0x59'),'apiKey']})[_0xb7b8('0x22')](handleEntityNotFound(_0x3b0e0b,null))[_0xb7b8('0x22')](function(_0x2cee2f){if(_0x2cee2f){_0x7b8bd1=_0x2cee2f[_0xb7b8('0x5a')];_0x57ae5f=_0x2cee2f['remoteUri'];var _0x527790=_0x2cee2f[_0xb7b8('0x59')][_0xb7b8('0x5b')](-0x1);if(_0x527790==='/'){_0x57ae5f=_0x57ae5f[_0xb7b8('0x5c')](0x0,_0x57ae5f[_0xb7b8('0x5d')](_0x527790));}return rp({'method':'GET','uri':util['format']('%s%s',_0x57ae5f,_0xb7b8('0x5e')),'headers':{'Authorization':_0xb7b8('0x5f')+_0x2cee2f[_0xb7b8('0x60')]},'json':!![]});}})[_0xb7b8('0x22')](function(_0x5b77b6){if(_0x5b77b6){var _0x5c97cc=_0x5b77b6[_0xb7b8('0x61')];var _0xea7afa=![];var _0x6078d=null;for(_0x6078d=0x0;_0x6078d<_0x5c97cc[_0xb7b8('0x37')];_0x6078d++){if(_0x5c97cc[_0x6078d]['email']===_0x7b8bd1){_0xea7afa=!![];}}if(_0xea7afa){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb7b8('0x62')});}}})[_0xb7b8('0x22')](respondWithResult(_0x3b0e0b,null))[_0xb7b8('0x49')](function(_0x474c81){var _0x1f4059=_0x202946[_0xb7b8('0x31')][_0xb7b8('0x63')]?0x1f4:_0x474c81[_0xb7b8('0x64')]||0x1f4;logger['error'](_0xb7b8('0x65'),_0xb7b8('0x66'),_0x1f4059,JSON[_0xb7b8('0x67')](_0x474c81));delete _0x474c81[_0xb7b8('0x28')];if(_0x1f4059===0x191){_0x1f4059=0x190;}_0x3b0e0b[_0xb7b8('0x19')](_0x1f4059)[_0xb7b8('0x29')](_0x202946['query'][_0xb7b8('0x63')]?{'message':_0xb7b8('0x68'),'statusCode':_0x474c81[_0xb7b8('0x64')]}:_0x474c81);});};
\ No newline at end of file
index ee4a616..4acf309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x56009f,_0x22f09e){_0x56009f=_0x56009f-0x0;var _0x3804a5=_0xc6ac[_0x56009f];return _0x3804a5;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));var integrations=require(_0xcc6a('0xb'));module[_0xcc6a('0xc')]=function(_0x197bd7,_0x5f3887){return _0x197bd7[_0xcc6a('0xd')](_0xcc6a('0xe'),attributes,{'tableName':_0xcc6a('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x27a0=['int_freshsales_accounts','util','../../config/logger','api','moment','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4d6691,_0x5049dd){var _0x2f168a=function(_0xe2898f){while(--_0xe2898f){_0x4d6691['push'](_0x4d6691['shift']());}};_0x2f168a(++_0x5049dd);}(_0x27a0,0xbf));var _0x027a=function(_0x45344d,_0x4e5833){_0x45344d=_0x45344d-0x0;var _0x5106c8=_0x27a0[_0x45344d];return _0x5106c8;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var logger=require(_0x027a('0x1'))(_0x027a('0x2'));var moment=require(_0x027a('0x3'));var BPromise=require(_0x027a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x027a('0x5'));var integrations=require(_0x027a('0x6'));module[_0x027a('0x7')]=function(_0x639bec,_0xe233ed){return _0x639bec[_0x027a('0x8')]('FreshsalesAccount',attributes,{'tableName':_0x027a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3d554c9..f877424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb9=['ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','map','attributes','include','model','debug'];(function(_0x5e54c2,_0xfd1b43){var _0x201e15=function(_0x3df8dd){while(--_0x3df8dd){_0x5e54c2['push'](_0x5e54c2['shift']());}};_0x201e15(++_0xfd1b43);}(_0xafb9,0x68));var _0x9afb=function(_0x50d3ee,_0x5ee1c9){_0x50d3ee=_0x50d3ee-0x0;var _0x250f2b=_0xafb9[_0x50d3ee];return _0x250f2b;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var moment=require(_0x9afb('0x2'));var BPromise=require(_0x9afb('0x3'));var rs=require(_0x9afb('0x4'));var fs=require('fs');var Redis=require(_0x9afb('0x5'));var db=require(_0x9afb('0x6'))['db'];var utils=require(_0x9afb('0x7'));var logger=require(_0x9afb('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9afb('0x9'));var client=jayson['client'][_0x9afb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548b24,_0x556880,_0x4c0e9d){return new BPromise(function(_0x1edf77,_0x20b8c1){return client['request'](_0x548b24,_0x4c0e9d)[_0x9afb('0xb')](function(_0x3e0264){logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x556880,_0x9afb('0xe'),JSON[_0x9afb('0xf')](_0x3e0264));if(_0x3e0264[_0x9afb('0x10')]){if(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x11')]===0x1f4){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);return _0x20b8c1(_0x3e0264[_0x9afb('0x10')]['message']);}logger[_0x9afb('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x556880,_0x3e0264['error'][_0x9afb('0x12')]);return _0x1edf77(_0x3e0264[_0x9afb('0x10')][_0x9afb('0x12')]);}else{logger[_0x9afb('0xc')](_0x9afb('0xd'),_0x556880,_0x9afb('0xe'));_0x1edf77(_0x3e0264[_0x9afb('0x13')]['message']);}})[_0x9afb('0x14')](function(_0x2145c2){logger[_0x9afb('0x10')](_0x9afb('0xd'),_0x556880,_0x2145c2);_0x20b8c1(_0x2145c2);});});}exports[_0x9afb('0x15')]=function(_0x508433){var _0x201ff4=this;return new Promise(function(_0x50a7e4,_0x3fdb34){return db[_0x9afb('0x16')]['findAll']({'raw':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')][_0x9afb('0x19')]||null:null,'attributes':_0x508433['options']?_0x508433[_0x9afb('0x17')]['attributes']||null:null,'limit':_0x508433['options']?_0x508433[_0x9afb('0x17')][_0x9afb('0x1a')]||null:null,'include':_0x508433[_0x9afb('0x17')]?_0x508433[_0x9afb('0x17')]['include']?_[_0x9afb('0x1b')](_0x508433[_0x9afb('0x17')]['include'],function(_0x571bd9){return{'model':db[_0x571bd9['model']],'as':_0x571bd9['as'],'attributes':_0x571bd9[_0x9afb('0x1c')],'include':_0x571bd9['include']?_[_0x9afb('0x1b')](_0x571bd9[_0x9afb('0x1d')],function(_0x50a919){return{'model':db[_0x50a919[_0x9afb('0x1e')]],'as':_0x50a919['as'],'attributes':_0x50a919[_0x9afb('0x1c')],'include':_0x50a919[_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x50a919['include'],function(_0x348255){return{'model':db[_0x348255['model']],'as':_0x348255['as'],'attributes':_0x348255[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5692fa){logger[_0x9afb('0xc')](_0x9afb('0x15'),_0x508433);logger[_0x9afb('0x1f')](_0x9afb('0x15'),_0x508433,JSON[_0x9afb('0xf')](_0x5692fa));_0x50a7e4(_0x5692fa);})[_0x9afb('0x14')](function(_0x46673d){logger['error']('GetFreshsalesAccount',_0x46673d[_0x9afb('0x12')],_0x508433);_0x3fdb34(_0x201ff4[_0x9afb('0x10')](0x1f4,_0x46673d['message']));});});};exports[_0x9afb('0x20')]=function(_0x2f388c){var _0x5560bd=this;return new Promise(function(_0x1b9f18,_0xc220e9){return db[_0x9afb('0x16')][_0x9afb('0x21')]({'raw':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x18')]===undefined?!![]:![]:!![],'where':_0x2f388c[_0x9afb('0x17')]?_0x2f388c['options']['where']||null:null,'attributes':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1c')]||null:null,'include':_0x2f388c[_0x9afb('0x17')]?_0x2f388c[_0x9afb('0x17')][_0x9afb('0x1d')]?_[_0x9afb('0x1b')](_0x2f388c['options']['include'],function(_0x67d63a){return{'model':db[_0x67d63a[_0x9afb('0x1e')]],'as':_0x67d63a['as'],'attributes':_0x67d63a['attributes'],'include':_0x67d63a[_0x9afb('0x1d')]?_['map'](_0x67d63a[_0x9afb('0x1d')],function(_0xc59d55){return{'model':db[_0xc59d55['model']],'as':_0xc59d55['as'],'attributes':_0xc59d55[_0x9afb('0x1c')],'include':_0xc59d55['include']?_[_0x9afb('0x1b')](_0xc59d55[_0x9afb('0x1d')],function(_0x45c57f){return{'model':db[_0x45c57f[_0x9afb('0x1e')]],'as':_0x45c57f['as'],'attributes':_0x45c57f[_0x9afb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9afb('0xb')](function(_0x19227f){logger[_0x9afb('0xc')]('ShowFreshsalesAccount',_0x2f388c);logger[_0x9afb('0x1f')]('ShowFreshsalesAccount',_0x2f388c,JSON[_0x9afb('0xf')](_0x19227f));_0x1b9f18(_0x19227f);})[_0x9afb('0x14')](function(_0x3c5231){logger[_0x9afb('0x10')](_0x9afb('0x20'),_0x3c5231[_0x9afb('0x12')],_0x2f388c);_0xc220e9(_0x5560bd[_0x9afb('0x10')](0x1f4,_0x3c5231[_0x9afb('0x12')]));});});};
\ No newline at end of file
+var _0x6d38=['moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','attributes','include','model','debug','catch','ShowFreshsalesAccount','find','map','util'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x6d38[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});}exports[_0x86d3('0x12')]=function(_0x46feec){var _0x120ef3=this;return new Promise(function(_0x33e459,_0x32dee7){return db[_0x86d3('0x13')]['findAll']({'raw':_0x46feec[_0x86d3('0x14')]?_0x46feec['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x46feec['options']?_0x46feec['options'][_0x86d3('0x16')]||null:null,'attributes':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x17')]||null:null,'limit':_0x46feec['options']?_0x46feec[_0x86d3('0x14')]['limit']||null:null,'include':_0x46feec[_0x86d3('0x14')]?_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')]?_['map'](_0x46feec[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x1fa4ac){return{'model':db[_0x1fa4ac['model']],'as':_0x1fa4ac['as'],'attributes':_0x1fa4ac['attributes'],'include':_0x1fa4ac[_0x86d3('0x18')]?_['map'](_0x1fa4ac[_0x86d3('0x18')],function(_0x1bea5e){return{'model':db[_0x1bea5e[_0x86d3('0x19')]],'as':_0x1bea5e['as'],'attributes':_0x1bea5e[_0x86d3('0x17')],'include':_0x1bea5e['include']?_['map'](_0x1bea5e[_0x86d3('0x18')],function(_0x611764){return{'model':db[_0x611764['model']],'as':_0x611764['as'],'attributes':_0x611764[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42413c){logger[_0x86d3('0x10')](_0x86d3('0x12'),_0x46feec);logger[_0x86d3('0x1a')](_0x86d3('0x12'),_0x46feec,JSON[_0x86d3('0xd')](_0x42413c));_0x33e459(_0x42413c);})[_0x86d3('0x1b')](function(_0x35d708){logger[_0x86d3('0xe')](_0x86d3('0x12'),_0x35d708[_0x86d3('0xf')],_0x46feec);_0x32dee7(_0x120ef3[_0x86d3('0xe')](0x1f4,_0x35d708[_0x86d3('0xf')]));});});};exports[_0x86d3('0x1c')]=function(_0x5b09f6){var _0x120a0c=this;return new Promise(function(_0x403be3,_0x2bda35){return db[_0x86d3('0x13')][_0x86d3('0x1d')]({'raw':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6['options'][_0x86d3('0x15')]===undefined?!![]:![]:!![],'where':_0x5b09f6['options']?_0x5b09f6['options'][_0x86d3('0x16')]||null:null,'attributes':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['attributes']||null:null,'include':_0x5b09f6[_0x86d3('0x14')]?_0x5b09f6[_0x86d3('0x14')]['include']?_[_0x86d3('0x1e')](_0x5b09f6[_0x86d3('0x14')][_0x86d3('0x18')],function(_0x476eb3){return{'model':db[_0x476eb3[_0x86d3('0x19')]],'as':_0x476eb3['as'],'attributes':_0x476eb3[_0x86d3('0x17')],'include':_0x476eb3[_0x86d3('0x18')]?_[_0x86d3('0x1e')](_0x476eb3['include'],function(_0x4cdf45){return{'model':db[_0x4cdf45['model']],'as':_0x4cdf45['as'],'attributes':_0x4cdf45[_0x86d3('0x17')],'include':_0x4cdf45['include']?_[_0x86d3('0x1e')](_0x4cdf45['include'],function(_0x366943){return{'model':db[_0x366943[_0x86d3('0x19')]],'as':_0x366943['as'],'attributes':_0x366943[_0x86d3('0x17')]};}):[]};}):[]};}):[]:[]})[_0x86d3('0xa')](function(_0x1e22c2){logger[_0x86d3('0x10')](_0x86d3('0x1c'),_0x5b09f6);logger['debug'](_0x86d3('0x1c'),_0x5b09f6,JSON[_0x86d3('0xd')](_0x1e22c2));_0x403be3(_0x1e22c2);})['catch'](function(_0x178fc6){logger[_0x86d3('0xe')](_0x86d3('0x1c'),_0x178fc6[_0x86d3('0xf')],_0x5b09f6);_0x2bda35(_0x120a0c['error'](0x1f4,_0x178fc6[_0x86d3('0xf')]));});});};
\ No newline at end of file
index 6022f60..1e16996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d3d=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','update','delete','destroy','exports'];(function(_0x1d63dc,_0x3ccc6b){var _0x31247e=function(_0x2b4ec7){while(--_0x2b4ec7){_0x1d63dc['push'](_0x1d63dc['shift']());}};_0x31247e(++_0x3ccc6b);}(_0x5d3d,0x170));var _0xd5d3=function(_0x56b683,_0x114669){_0x56b683=_0x56b683-0x0;var _0x18ac57=_0x5d3d[_0x56b683];return _0x18ac57;};'use strict';var multer=require(_0xd5d3('0x0'));var util=require('util');var path=require(_0xd5d3('0x1'));var timeout=require(_0xd5d3('0x2'));var express=require(_0xd5d3('0x3'));var router=express['Router']();var fs_extra=require(_0xd5d3('0x4'));var auth=require(_0xd5d3('0x5'));var interaction=require(_0xd5d3('0x6'));var config=require(_0xd5d3('0x7'));var controller=require(_0xd5d3('0x8'));router[_0xd5d3('0x9')]('/',auth['isAuthenticated'](),controller[_0xd5d3('0xa')]);router['get'](_0xd5d3('0xb'),auth[_0xd5d3('0xc')](),controller['show']);router[_0xd5d3('0x9')](_0xd5d3('0xd'),auth[_0xd5d3('0xc')](),controller['getSubjects']);router[_0xd5d3('0x9')](_0xd5d3('0xe'),auth[_0xd5d3('0xc')](),controller[_0xd5d3('0xf')]);router[_0xd5d3('0x9')]('/:id/fields',auth[_0xd5d3('0xc')](),controller[_0xd5d3('0x10')]);router[_0xd5d3('0x11')]('/',auth[_0xd5d3('0xc')](),controller[_0xd5d3('0x12')]);router['put'](_0xd5d3('0xb'),auth['isAuthenticated'](),controller[_0xd5d3('0x13')]);router[_0xd5d3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd5d3('0x15')]);module[_0xd5d3('0x16')]=router;
\ No newline at end of file
+var _0x283e=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','get','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','getFields'];(function(_0x357596,_0x14985b){var _0x26053a=function(_0x3f4ae1){while(--_0x3f4ae1){_0x357596['push'](_0x357596['shift']());}};_0x26053a(++_0x14985b);}(_0x283e,0x15f));var _0xe283=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x283e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xe283('0x0'));var util=require(_0xe283('0x1'));var path=require(_0xe283('0x2'));var timeout=require(_0xe283('0x3'));var express=require(_0xe283('0x4'));var router=express['Router']();var fs_extra=require(_0xe283('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe283('0x6'));var config=require(_0xe283('0x7'));var controller=require(_0xe283('0x8'));router['get']('/',auth[_0xe283('0x9')](),controller['index']);router[_0xe283('0xa')](_0xe283('0xb'),auth[_0xe283('0x9')](),controller[_0xe283('0xc')]);router[_0xe283('0xa')](_0xe283('0xd'),auth[_0xe283('0x9')](),controller['getSubjects']);router['get'](_0xe283('0xe'),auth[_0xe283('0x9')](),controller[_0xe283('0xf')]);router[_0xe283('0xa')]('/:id/fields',auth[_0xe283('0x9')](),controller[_0xe283('0x10')]);router[_0xe283('0x11')]('/',auth[_0xe283('0x9')](),controller[_0xe283('0x12')]);router['put'](_0xe283('0xb'),auth[_0xe283('0x9')](),controller[_0xe283('0x13')]);router[_0xe283('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe283('0x15')]);module[_0xe283('0x16')]=router;
\ No newline at end of file
index b85ca9a..007eeff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e32=['exports','STRING','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3e32,0xc5));var _0x23e3=function(_0x11ed3a,_0x2852bb){_0x11ed3a=_0x11ed3a-0x0;var _0x4c63cc=_0x3e32[_0x11ed3a];return _0x4c63cc;};'use strict';var Sequelize=require(_0x23e3('0x0'));module[_0x23e3('0x1')]={'name':{'type':Sequelize[_0x23e3('0x2')]},'description':{'type':Sequelize[_0x23e3('0x2')]}};
\ No newline at end of file
+var _0xfd08=['STRING','sequelize'];(function(_0x3df93e,_0x5af13a){var _0x2d4f2a=function(_0x14c85c){while(--_0x14c85c){_0x3df93e['push'](_0x3df93e['shift']());}};_0x2d4f2a(++_0x5af13a);}(_0xfd08,0xfb));var _0x8fd0=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0xfd08[_0x49aa7d];return _0xdd0d26;};'use strict';var Sequelize=require(_0x8fd0('0x0'));module['exports']={'name':{'type':Sequelize[_0x8fd0('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5c0e220..d9e1161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6265=['nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','order','sort','pick','merge','where','type','filter','options','includeAll','include','rows','show','params','intersection','fields','find','catch','create','body','findOne','FreshsalesField','getSubjects','getDescriptions','getFields'];(function(_0x18a1a1,_0x8c1d2){var _0x5a9931=function(_0x39dd53){while(--_0x39dd53){_0x18a1a1['push'](_0x18a1a1['shift']());}};_0x5a9931(++_0x8c1d2);}(_0x6265,0x1cf));var _0x5626=function(_0x35728b,_0x2a760e){_0x35728b=_0x35728b-0x0;var _0x32946f=_0x6265[_0x35728b];return _0x32946f;};'use strict';var emlformat=require(_0x5626('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5626('0x1'));var jsonpatch=require(_0x5626('0x2'));var rp=require(_0x5626('0x3'));var moment=require(_0x5626('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5626('0x5'));var util=require(_0x5626('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5626('0x7'));var fs=require('fs');var fs_extra=require(_0x5626('0x8'));var _=require(_0x5626('0x9'));var squel=require(_0x5626('0xa'));var crypto=require(_0x5626('0xb'));var jsforce=require(_0x5626('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5626('0xd'));var Redis=require(_0x5626('0xe'));var authService=require(_0x5626('0xf'));var qs=require(_0x5626('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5626('0x11'));var utils=require(_0x5626('0x12'));var config=require(_0x5626('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5626('0x14'))['db'];function respondWithStatusCode(_0x1024e9,_0x148b25){_0x148b25=_0x148b25||0xcc;return function(_0x39ce62){if(_0x39ce62){return _0x1024e9[_0x5626('0x15')](_0x148b25);}return _0x1024e9[_0x5626('0x16')](_0x148b25)[_0x5626('0x17')]();};}function respondWithResult(_0x44de1f,_0x4cf015){_0x4cf015=_0x4cf015||0xc8;return function(_0x208261){if(_0x208261){return _0x44de1f[_0x5626('0x16')](_0x4cf015)['json'](_0x208261);}};}function respondWithFilteredResult(_0x352c07,_0x2f63b7){return function(_0x294567){if(_0x294567){var _0x3fbd92=typeof _0x2f63b7[_0x5626('0x18')]===_0x5626('0x19')&&typeof _0x2f63b7[_0x5626('0x1a')]===_0x5626('0x19');var _0x88caa9=_0x294567['count'];var _0x5021a6=_0x3fbd92?0x0:_0x2f63b7['offset'];var _0x28f776=_0x3fbd92?_0x294567[_0x5626('0x1b')]:_0x2f63b7[_0x5626('0x18')]+_0x2f63b7[_0x5626('0x1a')];var _0x3589de;if(_0x28f776>=_0x88caa9){_0x28f776=_0x88caa9;_0x3589de=0xc8;}else{_0x3589de=0xce;}_0x352c07['status'](_0x3589de);return _0x352c07[_0x5626('0x1c')]('Content-Range',_0x5021a6+'-'+_0x28f776+'/'+_0x88caa9)['json'](_0x294567);}return null;};}function patchUpdates(_0x500aa4){return function(_0x9f0a2c){try{jsonpatch[_0x5626('0x1d')](_0x9f0a2c,_0x500aa4,!![]);}catch(_0x1d0c7a){return BPromise[_0x5626('0x1e')](_0x1d0c7a);}return _0x9f0a2c[_0x5626('0x1f')]();};}function saveUpdates(_0x5d1f5a,_0x1ab17c){return function(_0x1ead6f){if(_0x1ead6f){return _0x1ead6f[_0x5626('0x20')](_0x5d1f5a)['then'](function(_0x14dae7){return _0x14dae7;});}return null;};}function removeEntity(_0x40d304,_0x7bdd8e){return function(_0x1cef95){if(_0x1cef95){return _0x1cef95[_0x5626('0x21')]()[_0x5626('0x22')](function(){_0x40d304['status'](0xcc)[_0x5626('0x17')]();});}};}function handleEntityNotFound(_0x597c77,_0xdf590){return function(_0xdc60dc){if(!_0xdc60dc){_0x597c77['sendStatus'](0x194);}return _0xdc60dc;};}function handleError(_0x33c2ef,_0x4d9ee4){_0x4d9ee4=_0x4d9ee4||0x1f4;return function(_0x4200d1){logger[_0x5626('0x23')](_0x4200d1[_0x5626('0x24')]);if(_0x4200d1[_0x5626('0x25')]){delete _0x4200d1[_0x5626('0x25')];}_0x33c2ef[_0x5626('0x16')](_0x4d9ee4)[_0x5626('0x26')](_0x4200d1);};}exports[_0x5626('0x27')]=function(_0x5a2c46,_0x15a5ca){var _0x5ea58a={},_0x30a427={},_0x50b45c={'count':0x0,'rows':[]};var _0x14bceb=_['map'](db[_0x5626('0x28')][_0x5626('0x29')],function(_0x5f4b08){return{'name':_0x5f4b08[_0x5626('0x2a')],'type':_0x5f4b08['type'][_0x5626('0x2b')]};});_0x30a427[_0x5626('0x2c')]=_[_0x5626('0x2d')](_0x14bceb,_0x5626('0x25'));_0x30a427[_0x5626('0x2e')]=_[_0x5626('0x2f')](_0x5a2c46[_0x5626('0x2e')]);_0x30a427[_0x5626('0x30')]=_['intersection'](_0x30a427[_0x5626('0x2c')],_0x30a427[_0x5626('0x2e')]);_0x5ea58a[_0x5626('0x31')]=_['intersection'](_0x30a427['model'],qs['fields'](_0x5a2c46[_0x5626('0x2e')]['fields']));_0x5ea58a[_0x5626('0x31')]=_0x5ea58a['attributes'][_0x5626('0x32')]?_0x5ea58a['attributes']:_0x30a427[_0x5626('0x2c')];if(!_0x5a2c46[_0x5626('0x2e')][_0x5626('0x33')]('nolimit')){_0x5ea58a['limit']=qs[_0x5626('0x1a')](_0x5a2c46[_0x5626('0x2e')][_0x5626('0x1a')]);_0x5ea58a[_0x5626('0x18')]=qs[_0x5626('0x18')](_0x5a2c46['query']['offset']);}_0x5ea58a[_0x5626('0x34')]=qs[_0x5626('0x35')](_0x5a2c46[_0x5626('0x2e')]['sort']);_0x5ea58a['where']=qs['filters'](_[_0x5626('0x36')](_0x5a2c46[_0x5626('0x2e')],_0x30a427[_0x5626('0x30')]),_0x14bceb);if(_0x5a2c46[_0x5626('0x2e')]['filter']){_0x5ea58a['where']=_[_0x5626('0x37')](_0x5ea58a[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x14bceb,function(_0x2c059c){if(_0x2c059c[_0x5626('0x39')]!=='VIRTUAL'){var _0x5f1b45={};_0x5f1b45[_0x2c059c['name']]={'$like':'%'+_0x5a2c46[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x5f1b45;}})});}_0x5ea58a=_[_0x5626('0x37')]({},_0x5ea58a,_0x5a2c46[_0x5626('0x3b')]);var _0x22e93d={'where':_0x5ea58a[_0x5626('0x38')]};return db[_0x5626('0x28')][_0x5626('0x1b')](_0x22e93d)['then'](function(_0x14bf74){_0x50b45c['count']=_0x14bf74;if(_0x5a2c46[_0x5626('0x2e')][_0x5626('0x3c')]){_0x5ea58a[_0x5626('0x3d')]=[{'all':!![]}];}return db[_0x5626('0x28')]['findAll'](_0x5ea58a);})[_0x5626('0x22')](function(_0x438625){_0x50b45c[_0x5626('0x3e')]=_0x438625;return _0x50b45c;})[_0x5626('0x22')](respondWithFilteredResult(_0x15a5ca,_0x5ea58a))['catch'](handleError(_0x15a5ca,null));};exports[_0x5626('0x3f')]=function(_0x32cf43,_0x596d21){var _0x4e02b1={'raw':![],'where':{'id':_0x32cf43[_0x5626('0x40')]['id']}},_0x4cdfb3={};_0x4cdfb3[_0x5626('0x2c')]=_[_0x5626('0x2f')](db[_0x5626('0x28')][_0x5626('0x29')]);_0x4cdfb3[_0x5626('0x2e')]=_['keys'](_0x32cf43[_0x5626('0x2e')]);_0x4cdfb3[_0x5626('0x30')]=_['intersection'](_0x4cdfb3[_0x5626('0x2c')],_0x4cdfb3[_0x5626('0x2e')]);_0x4e02b1[_0x5626('0x31')]=_[_0x5626('0x41')](_0x4cdfb3[_0x5626('0x2c')],qs[_0x5626('0x42')](_0x32cf43[_0x5626('0x2e')][_0x5626('0x42')]));_0x4e02b1[_0x5626('0x31')]=_0x4e02b1[_0x5626('0x31')][_0x5626('0x32')]?_0x4e02b1[_0x5626('0x31')]:_0x4cdfb3[_0x5626('0x2c')];if(_0x32cf43['query'][_0x5626('0x3c')]){_0x4e02b1[_0x5626('0x3d')]=[{'all':!![]}];}_0x4e02b1=_[_0x5626('0x37')]({},_0x4e02b1,_0x32cf43[_0x5626('0x3b')]);return db[_0x5626('0x28')][_0x5626('0x43')](_0x4e02b1)[_0x5626('0x22')](handleEntityNotFound(_0x596d21,null))[_0x5626('0x22')](respondWithResult(_0x596d21,null))[_0x5626('0x44')](handleError(_0x596d21,null));};exports[_0x5626('0x45')]=function(_0x5ab6fa,_0x4cf080){return db[_0x5626('0x28')][_0x5626('0x45')](_0x5ab6fa[_0x5626('0x46')],{})['then'](respondWithResult(_0x4cf080,0xc9))[_0x5626('0x44')](handleError(_0x4cf080,null));};exports[_0x5626('0x20')]=function(_0x8b9d3f,_0x48aa6a){if(_0x8b9d3f['body']['id']){delete _0x8b9d3f['body']['id'];}return db['FreshsalesConfiguration'][_0x5626('0x43')]({'where':{'id':_0x8b9d3f[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x48aa6a,null))[_0x5626('0x22')](saveUpdates(_0x8b9d3f['body'],null))[_0x5626('0x22')](respondWithResult(_0x48aa6a,null))[_0x5626('0x44')](handleError(_0x48aa6a,null));};exports['destroy']=function(_0x1e3602,_0x208045){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x1e3602[_0x5626('0x40')]['id']}})['then'](handleEntityNotFound(_0x208045,null))[_0x5626('0x22')](removeEntity(_0x208045,null))[_0x5626('0x44')](handleError(_0x208045,null));};exports['getSubjects']=function(_0x18214a,_0x39e97a,_0x19b70a){var _0x300e42={};var _0x4b6a59={};var _0x490d70;var _0x77d53f;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0x18214a['params']['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x39e97a,null))[_0x5626('0x22')](function(_0x1d5827){if(_0x1d5827){_0x490d70=_0x1d5827;_0x4b6a59[_0x5626('0x2c')]=_['keys'](db[_0x5626('0x48')][_0x5626('0x29')]);_0x4b6a59[_0x5626('0x2e')]=_['keys'](_0x18214a['query']);_0x4b6a59[_0x5626('0x30')]=_[_0x5626('0x41')](_0x4b6a59['model'],_0x4b6a59[_0x5626('0x2e')]);_0x300e42['attributes']=_[_0x5626('0x41')](_0x4b6a59['model'],qs['fields'](_0x18214a[_0x5626('0x2e')]['fields']));_0x300e42[_0x5626('0x31')]=_0x300e42[_0x5626('0x31')][_0x5626('0x32')]?_0x300e42[_0x5626('0x31')]:_0x4b6a59[_0x5626('0x2c')];_0x300e42[_0x5626('0x34')]=qs[_0x5626('0x35')](_0x18214a[_0x5626('0x2e')]['sort']);_0x300e42[_0x5626('0x38')]=qs[_0x5626('0x30')](_[_0x5626('0x36')](_0x18214a['query'],_0x4b6a59[_0x5626('0x30')]));if(_0x18214a[_0x5626('0x2e')]['filter']){_0x300e42[_0x5626('0x38')]=_['merge'](_0x300e42['where'],{'$or':_[_0x5626('0x2d')](_0x300e42[_0x5626('0x31')],function(_0x3b53b6){var _0x505dee={};_0x505dee[_0x3b53b6]={'$like':'%'+_0x18214a[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x505dee;})});}_0x300e42=_[_0x5626('0x37')]({},_0x300e42,_0x18214a[_0x5626('0x3b')]);return _0x490d70[_0x5626('0x49')](_0x300e42);}})['then'](function(_0x3202e5){if(_0x3202e5){_0x77d53f=_0x3202e5['length'];if(!_0x18214a['query']['hasOwnProperty']('nolimit')){_0x300e42[_0x5626('0x1a')]=qs[_0x5626('0x1a')](_0x18214a[_0x5626('0x2e')][_0x5626('0x1a')]);_0x300e42[_0x5626('0x18')]=qs[_0x5626('0x18')](_0x18214a[_0x5626('0x2e')][_0x5626('0x18')]);}return _0x490d70[_0x5626('0x49')](_0x300e42);}})['then'](function(_0x3a3c18){if(_0x3a3c18){return _0x3a3c18?{'count':_0x77d53f,'rows':_0x3a3c18}:null;}})[_0x5626('0x22')](respondWithResult(_0x39e97a,null))['catch'](handleError(_0x39e97a,null));};exports[_0x5626('0x4a')]=function(_0x3f6b79,_0x12beb9,_0x46277b){var _0x2b5eb9={};var _0x43fd85={};var _0x132e2c;var _0x732c56;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0x3f6b79[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x12beb9,null))['then'](function(_0x2a6323){if(_0x2a6323){_0x132e2c=_0x2a6323;_0x43fd85[_0x5626('0x2c')]=_[_0x5626('0x2f')](db['FreshsalesField'][_0x5626('0x29')]);_0x43fd85['query']=_['keys'](_0x3f6b79[_0x5626('0x2e')]);_0x43fd85[_0x5626('0x30')]=_['intersection'](_0x43fd85['model'],_0x43fd85['query']);_0x2b5eb9['attributes']=_[_0x5626('0x41')](_0x43fd85[_0x5626('0x2c')],qs['fields'](_0x3f6b79[_0x5626('0x2e')][_0x5626('0x42')]));_0x2b5eb9[_0x5626('0x31')]=_0x2b5eb9[_0x5626('0x31')]['length']?_0x2b5eb9['attributes']:_0x43fd85[_0x5626('0x2c')];_0x2b5eb9[_0x5626('0x34')]=qs['sort'](_0x3f6b79[_0x5626('0x2e')]['sort']);_0x2b5eb9['where']=qs['filters'](_[_0x5626('0x36')](_0x3f6b79['query'],_0x43fd85[_0x5626('0x30')]));if(_0x3f6b79[_0x5626('0x2e')][_0x5626('0x3a')]){_0x2b5eb9['where']=_[_0x5626('0x37')](_0x2b5eb9[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x2b5eb9[_0x5626('0x31')],function(_0x4c532e){var _0x5a3604={};_0x5a3604[_0x4c532e]={'$like':'%'+_0x3f6b79[_0x5626('0x2e')][_0x5626('0x3a')]+'%'};return _0x5a3604;})});}_0x2b5eb9=_[_0x5626('0x37')]({},_0x2b5eb9,_0x3f6b79[_0x5626('0x3b')]);return _0x132e2c['getDescriptions'](_0x2b5eb9);}})[_0x5626('0x22')](function(_0x12cce4){if(_0x12cce4){_0x732c56=_0x12cce4[_0x5626('0x32')];if(!_0x3f6b79[_0x5626('0x2e')][_0x5626('0x33')]('nolimit')){_0x2b5eb9['limit']=qs[_0x5626('0x1a')](_0x3f6b79[_0x5626('0x2e')][_0x5626('0x1a')]);_0x2b5eb9['offset']=qs['offset'](_0x3f6b79['query'][_0x5626('0x18')]);}return _0x132e2c[_0x5626('0x4a')](_0x2b5eb9);}})[_0x5626('0x22')](function(_0xd24741){if(_0xd24741){return _0xd24741?{'count':_0x732c56,'rows':_0xd24741}:null;}})['then'](respondWithResult(_0x12beb9,null))[_0x5626('0x44')](handleError(_0x12beb9,null));};exports[_0x5626('0x4b')]=function(_0xcbc53e,_0x40b46e,_0x1adfd7){var _0x3cc626={};var _0x13054e={};var _0x51120b;var _0x32df5f;return db[_0x5626('0x28')][_0x5626('0x47')]({'where':{'id':_0xcbc53e[_0x5626('0x40')]['id']}})[_0x5626('0x22')](handleEntityNotFound(_0x40b46e,null))[_0x5626('0x22')](function(_0x210814){if(_0x210814){_0x51120b=_0x210814;_0x13054e['model']=_[_0x5626('0x2f')](db['FreshsalesField'][_0x5626('0x29')]);_0x13054e[_0x5626('0x2e')]=_['keys'](_0xcbc53e[_0x5626('0x2e')]);_0x13054e[_0x5626('0x30')]=_[_0x5626('0x41')](_0x13054e[_0x5626('0x2c')],_0x13054e['query']);_0x3cc626['attributes']=_[_0x5626('0x41')](_0x13054e[_0x5626('0x2c')],qs['fields'](_0xcbc53e[_0x5626('0x2e')][_0x5626('0x42')]));_0x3cc626[_0x5626('0x31')]=_0x3cc626['attributes'][_0x5626('0x32')]?_0x3cc626[_0x5626('0x31')]:_0x13054e[_0x5626('0x2c')];_0x3cc626[_0x5626('0x34')]=qs[_0x5626('0x35')](_0xcbc53e['query'][_0x5626('0x35')]);_0x3cc626[_0x5626('0x38')]=qs[_0x5626('0x30')](_['pick'](_0xcbc53e['query'],_0x13054e[_0x5626('0x30')]));if(_0xcbc53e[_0x5626('0x2e')][_0x5626('0x3a')]){_0x3cc626[_0x5626('0x38')]=_[_0x5626('0x37')](_0x3cc626[_0x5626('0x38')],{'$or':_[_0x5626('0x2d')](_0x3cc626[_0x5626('0x31')],function(_0x54fd0b){var _0x5697d8={};_0x5697d8[_0x54fd0b]={'$like':'%'+_0xcbc53e['query'][_0x5626('0x3a')]+'%'};return _0x5697d8;})});}_0x3cc626=_[_0x5626('0x37')]({},_0x3cc626,_0xcbc53e['options']);return _0x51120b[_0x5626('0x4b')](_0x3cc626);}})[_0x5626('0x22')](function(_0x134e88){if(_0x134e88){_0x32df5f=_0x134e88[_0x5626('0x32')];if(!_0xcbc53e[_0x5626('0x2e')][_0x5626('0x33')](_0x5626('0x4c'))){_0x3cc626[_0x5626('0x1a')]=qs[_0x5626('0x1a')](_0xcbc53e[_0x5626('0x2e')][_0x5626('0x1a')]);_0x3cc626[_0x5626('0x18')]=qs['offset'](_0xcbc53e[_0x5626('0x2e')]['offset']);}return _0x51120b[_0x5626('0x4b')](_0x3cc626);}})[_0x5626('0x22')](function(_0x1a5347){if(_0x1a5347){return _0x1a5347?{'count':_0x32df5f,'rows':_0x1a5347}:null;}})[_0x5626('0x22')](respondWithResult(_0x40b46e,null))[_0x5626('0x44')](handleError(_0x40b46e,null));};
\ No newline at end of file
+var _0xdfcd=['crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','rawAttributes','length','include','create','body','find','getSubjects','findOne','FreshsalesField','getDescriptions','options','getFields','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel'];(function(_0x5c63c7,_0x2e39c5){var _0x4f2ebd=function(_0x542ed2){while(--_0x542ed2){_0x5c63c7['push'](_0x5c63c7['shift']());}};_0x4f2ebd(++_0x2e39c5);}(_0xdfcd,0x135));var _0xddfc=function(_0x408f6f,_0x52efac){_0x408f6f=_0x408f6f-0x0;var _0x3eaab3=_0xdfcd[_0x408f6f];return _0x3eaab3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddfc('0x0'));var zipdir=require(_0xddfc('0x1'));var jsonpatch=require(_0xddfc('0x2'));var rp=require('request-promise');var moment=require(_0xddfc('0x3'));var BPromise=require(_0xddfc('0x4'));var Mustache=require(_0xddfc('0x5'));var util=require(_0xddfc('0x6'));var path=require(_0xddfc('0x7'));var sox=require(_0xddfc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddfc('0x9'));var _=require('lodash');var squel=require(_0xddfc('0xa'));var crypto=require(_0xddfc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xddfc('0xc'));var toCsv=require(_0xddfc('0xd'));var querystring=require(_0xddfc('0xe'));var Papa=require(_0xddfc('0xf'));var Redis=require('ioredis');var authService=require(_0xddfc('0x10'));var qs=require(_0xddfc('0x11'));var as=require(_0xddfc('0x12'));var hardwareService=require(_0xddfc('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xddfc('0x14'));var config=require(_0xddfc('0x15'));var licenseUtil=require(_0xddfc('0x16'));var db=require(_0xddfc('0x17'))['db'];function respondWithStatusCode(_0x1217cc,_0x14bc8c){_0x14bc8c=_0x14bc8c||0xcc;return function(_0x23545d){if(_0x23545d){return _0x1217cc[_0xddfc('0x18')](_0x14bc8c);}return _0x1217cc['status'](_0x14bc8c)[_0xddfc('0x19')]();};}function respondWithResult(_0x39b188,_0x2bf18e){_0x2bf18e=_0x2bf18e||0xc8;return function(_0x4d9911){if(_0x4d9911){return _0x39b188[_0xddfc('0x1a')](_0x2bf18e)[_0xddfc('0x1b')](_0x4d9911);}};}function respondWithFilteredResult(_0x599148,_0x2d17a5){return function(_0x37c552){if(_0x37c552){var _0x59482a=typeof _0x2d17a5['offset']==='undefined'&&typeof _0x2d17a5[_0xddfc('0x1c')]==='undefined';var _0x32768e=_0x37c552[_0xddfc('0x1d')];var _0x5851b5=_0x59482a?0x0:_0x2d17a5[_0xddfc('0x1e')];var _0x3d14da=_0x59482a?_0x37c552['count']:_0x2d17a5[_0xddfc('0x1e')]+_0x2d17a5[_0xddfc('0x1c')];var _0x51dcf3;if(_0x3d14da>=_0x32768e){_0x3d14da=_0x32768e;_0x51dcf3=0xc8;}else{_0x51dcf3=0xce;}_0x599148[_0xddfc('0x1a')](_0x51dcf3);return _0x599148[_0xddfc('0x1f')]('Content-Range',_0x5851b5+'-'+_0x3d14da+'/'+_0x32768e)[_0xddfc('0x1b')](_0x37c552);}return null;};}function patchUpdates(_0x47b530){return function(_0x4f8bbf){try{jsonpatch[_0xddfc('0x20')](_0x4f8bbf,_0x47b530,!![]);}catch(_0x5581ea){return BPromise[_0xddfc('0x21')](_0x5581ea);}return _0x4f8bbf[_0xddfc('0x22')]();};}function saveUpdates(_0x5d8dcd,_0x1bc973){return function(_0x2ea339){if(_0x2ea339){return _0x2ea339[_0xddfc('0x23')](_0x5d8dcd)[_0xddfc('0x24')](function(_0x2e1bbb){return _0x2e1bbb;});}return null;};}function removeEntity(_0x31846f,_0x24a217){return function(_0x4c4e86){if(_0x4c4e86){return _0x4c4e86[_0xddfc('0x25')]()[_0xddfc('0x24')](function(){_0x31846f[_0xddfc('0x1a')](0xcc)[_0xddfc('0x19')]();});}};}function handleEntityNotFound(_0x151c92,_0x25504e){return function(_0x1388ee){if(!_0x1388ee){_0x151c92[_0xddfc('0x18')](0x194);}return _0x1388ee;};}function handleError(_0x23c08,_0x14a217){_0x14a217=_0x14a217||0x1f4;return function(_0x566825){logger[_0xddfc('0x26')](_0x566825[_0xddfc('0x27')]);if(_0x566825['name']){delete _0x566825[_0xddfc('0x28')];}_0x23c08[_0xddfc('0x1a')](_0x14a217)[_0xddfc('0x29')](_0x566825);};}exports[_0xddfc('0x2a')]=function(_0x10e98a,_0x446c0a){var _0x21d0ae={},_0xc4a42d={},_0x3b1e90={'count':0x0,'rows':[]};var _0x40ae05=_[_0xddfc('0x2b')](db[_0xddfc('0x2c')]['rawAttributes'],function(_0x4db971){return{'name':_0x4db971[_0xddfc('0x2d')],'type':_0x4db971[_0xddfc('0x2e')][_0xddfc('0x2f')]};});_0xc4a42d[_0xddfc('0x30')]=_[_0xddfc('0x2b')](_0x40ae05,'name');_0xc4a42d[_0xddfc('0x31')]=_[_0xddfc('0x32')](_0x10e98a[_0xddfc('0x31')]);_0xc4a42d['filters']=_[_0xddfc('0x33')](_0xc4a42d[_0xddfc('0x30')],_0xc4a42d[_0xddfc('0x31')]);_0x21d0ae['attributes']=_['intersection'](_0xc4a42d['model'],qs['fields'](_0x10e98a[_0xddfc('0x31')][_0xddfc('0x34')]));_0x21d0ae[_0xddfc('0x35')]=_0x21d0ae['attributes']['length']?_0x21d0ae[_0xddfc('0x35')]:_0xc4a42d[_0xddfc('0x30')];if(!_0x10e98a[_0xddfc('0x31')][_0xddfc('0x36')](_0xddfc('0x37'))){_0x21d0ae[_0xddfc('0x1c')]=qs[_0xddfc('0x1c')](_0x10e98a[_0xddfc('0x31')]['limit']);_0x21d0ae[_0xddfc('0x1e')]=qs[_0xddfc('0x1e')](_0x10e98a[_0xddfc('0x31')]['offset']);}_0x21d0ae[_0xddfc('0x38')]=qs[_0xddfc('0x39')](_0x10e98a[_0xddfc('0x31')]['sort']);_0x21d0ae[_0xddfc('0x3a')]=qs[_0xddfc('0x3b')](_[_0xddfc('0x3c')](_0x10e98a[_0xddfc('0x31')],_0xc4a42d[_0xddfc('0x3b')]),_0x40ae05);if(_0x10e98a[_0xddfc('0x31')][_0xddfc('0x3d')]){_0x21d0ae[_0xddfc('0x3a')]=_[_0xddfc('0x3e')](_0x21d0ae['where'],{'$or':_[_0xddfc('0x2b')](_0x40ae05,function(_0x591d6a){if(_0x591d6a[_0xddfc('0x2e')]!==_0xddfc('0x3f')){var _0x1a3c74={};_0x1a3c74[_0x591d6a[_0xddfc('0x28')]]={'$like':'%'+_0x10e98a[_0xddfc('0x31')][_0xddfc('0x3d')]+'%'};return _0x1a3c74;}})});}_0x21d0ae=_[_0xddfc('0x3e')]({},_0x21d0ae,_0x10e98a['options']);var _0x2550fe={'where':_0x21d0ae['where']};return db[_0xddfc('0x2c')][_0xddfc('0x1d')](_0x2550fe)[_0xddfc('0x24')](function(_0x423e9d){_0x3b1e90[_0xddfc('0x1d')]=_0x423e9d;if(_0x10e98a['query'][_0xddfc('0x40')]){_0x21d0ae['include']=[{'all':!![]}];}return db[_0xddfc('0x2c')]['findAll'](_0x21d0ae);})[_0xddfc('0x24')](function(_0x5589fd){_0x3b1e90[_0xddfc('0x41')]=_0x5589fd;return _0x3b1e90;})['then'](respondWithFilteredResult(_0x446c0a,_0x21d0ae))[_0xddfc('0x42')](handleError(_0x446c0a,null));};exports['show']=function(_0x2076a5,_0x31d80a){var _0x42a696={'raw':![],'where':{'id':_0x2076a5[_0xddfc('0x43')]['id']}},_0x386a3={};_0x386a3['model']=_[_0xddfc('0x32')](db[_0xddfc('0x2c')][_0xddfc('0x44')]);_0x386a3[_0xddfc('0x31')]=_[_0xddfc('0x32')](_0x2076a5[_0xddfc('0x31')]);_0x386a3[_0xddfc('0x3b')]=_[_0xddfc('0x33')](_0x386a3[_0xddfc('0x30')],_0x386a3[_0xddfc('0x31')]);_0x42a696[_0xddfc('0x35')]=_[_0xddfc('0x33')](_0x386a3['model'],qs[_0xddfc('0x34')](_0x2076a5[_0xddfc('0x31')][_0xddfc('0x34')]));_0x42a696[_0xddfc('0x35')]=_0x42a696[_0xddfc('0x35')][_0xddfc('0x45')]?_0x42a696[_0xddfc('0x35')]:_0x386a3['model'];if(_0x2076a5['query']['includeAll']){_0x42a696[_0xddfc('0x46')]=[{'all':!![]}];}_0x42a696=_[_0xddfc('0x3e')]({},_0x42a696,_0x2076a5['options']);return db['FreshsalesConfiguration']['find'](_0x42a696)[_0xddfc('0x24')](handleEntityNotFound(_0x31d80a,null))['then'](respondWithResult(_0x31d80a,null))['catch'](handleError(_0x31d80a,null));};exports[_0xddfc('0x47')]=function(_0x5c5e76,_0x288c76){return db[_0xddfc('0x2c')][_0xddfc('0x47')](_0x5c5e76[_0xddfc('0x48')],{})[_0xddfc('0x24')](respondWithResult(_0x288c76,0xc9))[_0xddfc('0x42')](handleError(_0x288c76,null));};exports[_0xddfc('0x23')]=function(_0x31bf88,_0x943c9f){if(_0x31bf88[_0xddfc('0x48')]['id']){delete _0x31bf88['body']['id'];}return db[_0xddfc('0x2c')][_0xddfc('0x49')]({'where':{'id':_0x31bf88[_0xddfc('0x43')]['id']}})['then'](handleEntityNotFound(_0x943c9f,null))[_0xddfc('0x24')](saveUpdates(_0x31bf88[_0xddfc('0x48')],null))[_0xddfc('0x24')](respondWithResult(_0x943c9f,null))['catch'](handleError(_0x943c9f,null));};exports[_0xddfc('0x25')]=function(_0x3f87a4,_0x1205c6){return db[_0xddfc('0x2c')][_0xddfc('0x49')]({'where':{'id':_0x3f87a4[_0xddfc('0x43')]['id']}})[_0xddfc('0x24')](handleEntityNotFound(_0x1205c6,null))[_0xddfc('0x24')](removeEntity(_0x1205c6,null))[_0xddfc('0x42')](handleError(_0x1205c6,null));};exports[_0xddfc('0x4a')]=function(_0x44e48b,_0x34618b,_0x3336bb){var _0x394763={};var _0x34b714={};var _0x2833c2;var _0x4671f7;return db[_0xddfc('0x2c')][_0xddfc('0x4b')]({'where':{'id':_0x44e48b['params']['id']}})[_0xddfc('0x24')](handleEntityNotFound(_0x34618b,null))[_0xddfc('0x24')](function(_0x1f2569){if(_0x1f2569){_0x2833c2=_0x1f2569;_0x34b714[_0xddfc('0x30')]=_[_0xddfc('0x32')](db[_0xddfc('0x4c')][_0xddfc('0x44')]);_0x34b714['query']=_[_0xddfc('0x32')](_0x44e48b[_0xddfc('0x31')]);_0x34b714[_0xddfc('0x3b')]=_[_0xddfc('0x33')](_0x34b714[_0xddfc('0x30')],_0x34b714[_0xddfc('0x31')]);_0x394763[_0xddfc('0x35')]=_['intersection'](_0x34b714['model'],qs[_0xddfc('0x34')](_0x44e48b[_0xddfc('0x31')][_0xddfc('0x34')]));_0x394763[_0xddfc('0x35')]=_0x394763['attributes'][_0xddfc('0x45')]?_0x394763[_0xddfc('0x35')]:_0x34b714[_0xddfc('0x30')];_0x394763[_0xddfc('0x38')]=qs['sort'](_0x44e48b[_0xddfc('0x31')][_0xddfc('0x39')]);_0x394763[_0xddfc('0x3a')]=qs[_0xddfc('0x3b')](_[_0xddfc('0x3c')](_0x44e48b['query'],_0x34b714[_0xddfc('0x3b')]));if(_0x44e48b[_0xddfc('0x31')][_0xddfc('0x3d')]){_0x394763[_0xddfc('0x3a')]=_[_0xddfc('0x3e')](_0x394763['where'],{'$or':_['map'](_0x394763[_0xddfc('0x35')],function(_0x54596a){var _0x3282bd={};_0x3282bd[_0x54596a]={'$like':'%'+_0x44e48b[_0xddfc('0x31')][_0xddfc('0x3d')]+'%'};return _0x3282bd;})});}_0x394763=_[_0xddfc('0x3e')]({},_0x394763,_0x44e48b['options']);return _0x2833c2[_0xddfc('0x4a')](_0x394763);}})[_0xddfc('0x24')](function(_0x2bea10){if(_0x2bea10){_0x4671f7=_0x2bea10[_0xddfc('0x45')];if(!_0x44e48b[_0xddfc('0x31')][_0xddfc('0x36')]('nolimit')){_0x394763[_0xddfc('0x1c')]=qs[_0xddfc('0x1c')](_0x44e48b[_0xddfc('0x31')][_0xddfc('0x1c')]);_0x394763[_0xddfc('0x1e')]=qs[_0xddfc('0x1e')](_0x44e48b[_0xddfc('0x31')][_0xddfc('0x1e')]);}return _0x2833c2[_0xddfc('0x4a')](_0x394763);}})['then'](function(_0x5975c2){if(_0x5975c2){return _0x5975c2?{'count':_0x4671f7,'rows':_0x5975c2}:null;}})['then'](respondWithResult(_0x34618b,null))['catch'](handleError(_0x34618b,null));};exports[_0xddfc('0x4d')]=function(_0x471d3c,_0x53641f,_0x4d8a95){var _0x117fd6={};var _0xf8647c={};var _0x1ef0bc;var _0x36d1e3;return db['FreshsalesConfiguration'][_0xddfc('0x4b')]({'where':{'id':_0x471d3c['params']['id']}})[_0xddfc('0x24')](handleEntityNotFound(_0x53641f,null))[_0xddfc('0x24')](function(_0x26178a){if(_0x26178a){_0x1ef0bc=_0x26178a;_0xf8647c[_0xddfc('0x30')]=_[_0xddfc('0x32')](db[_0xddfc('0x4c')][_0xddfc('0x44')]);_0xf8647c[_0xddfc('0x31')]=_[_0xddfc('0x32')](_0x471d3c[_0xddfc('0x31')]);_0xf8647c[_0xddfc('0x3b')]=_[_0xddfc('0x33')](_0xf8647c[_0xddfc('0x30')],_0xf8647c['query']);_0x117fd6[_0xddfc('0x35')]=_[_0xddfc('0x33')](_0xf8647c[_0xddfc('0x30')],qs['fields'](_0x471d3c[_0xddfc('0x31')][_0xddfc('0x34')]));_0x117fd6[_0xddfc('0x35')]=_0x117fd6['attributes']['length']?_0x117fd6[_0xddfc('0x35')]:_0xf8647c[_0xddfc('0x30')];_0x117fd6[_0xddfc('0x38')]=qs[_0xddfc('0x39')](_0x471d3c['query']['sort']);_0x117fd6[_0xddfc('0x3a')]=qs[_0xddfc('0x3b')](_[_0xddfc('0x3c')](_0x471d3c['query'],_0xf8647c[_0xddfc('0x3b')]));if(_0x471d3c[_0xddfc('0x31')][_0xddfc('0x3d')]){_0x117fd6['where']=_[_0xddfc('0x3e')](_0x117fd6['where'],{'$or':_['map'](_0x117fd6[_0xddfc('0x35')],function(_0x5d2e8f){var _0xe3e30e={};_0xe3e30e[_0x5d2e8f]={'$like':'%'+_0x471d3c[_0xddfc('0x31')][_0xddfc('0x3d')]+'%'};return _0xe3e30e;})});}_0x117fd6=_['merge']({},_0x117fd6,_0x471d3c[_0xddfc('0x4e')]);return _0x1ef0bc['getDescriptions'](_0x117fd6);}})[_0xddfc('0x24')](function(_0x4f1284){if(_0x4f1284){_0x36d1e3=_0x4f1284[_0xddfc('0x45')];if(!_0x471d3c[_0xddfc('0x31')][_0xddfc('0x36')]('nolimit')){_0x117fd6[_0xddfc('0x1c')]=qs[_0xddfc('0x1c')](_0x471d3c[_0xddfc('0x31')]['limit']);_0x117fd6[_0xddfc('0x1e')]=qs['offset'](_0x471d3c[_0xddfc('0x31')][_0xddfc('0x1e')]);}return _0x1ef0bc['getDescriptions'](_0x117fd6);}})[_0xddfc('0x24')](function(_0x186c41){if(_0x186c41){return _0x186c41?{'count':_0x36d1e3,'rows':_0x186c41}:null;}})[_0xddfc('0x24')](respondWithResult(_0x53641f,null))['catch'](handleError(_0x53641f,null));};exports[_0xddfc('0x4f')]=function(_0x2bc104,_0x2ad44f,_0x2ae63f){var _0x447a8f={};var _0x200fa1={};var _0x3da544;var _0xe9d912;return db[_0xddfc('0x2c')]['findOne']({'where':{'id':_0x2bc104[_0xddfc('0x43')]['id']}})[_0xddfc('0x24')](handleEntityNotFound(_0x2ad44f,null))['then'](function(_0x2dd814){if(_0x2dd814){_0x3da544=_0x2dd814;_0x200fa1[_0xddfc('0x30')]=_[_0xddfc('0x32')](db['FreshsalesField']['rawAttributes']);_0x200fa1[_0xddfc('0x31')]=_['keys'](_0x2bc104[_0xddfc('0x31')]);_0x200fa1[_0xddfc('0x3b')]=_[_0xddfc('0x33')](_0x200fa1['model'],_0x200fa1[_0xddfc('0x31')]);_0x447a8f[_0xddfc('0x35')]=_['intersection'](_0x200fa1[_0xddfc('0x30')],qs['fields'](_0x2bc104[_0xddfc('0x31')][_0xddfc('0x34')]));_0x447a8f[_0xddfc('0x35')]=_0x447a8f[_0xddfc('0x35')][_0xddfc('0x45')]?_0x447a8f[_0xddfc('0x35')]:_0x200fa1['model'];_0x447a8f[_0xddfc('0x38')]=qs['sort'](_0x2bc104[_0xddfc('0x31')]['sort']);_0x447a8f[_0xddfc('0x3a')]=qs['filters'](_[_0xddfc('0x3c')](_0x2bc104[_0xddfc('0x31')],_0x200fa1[_0xddfc('0x3b')]));if(_0x2bc104['query'][_0xddfc('0x3d')]){_0x447a8f[_0xddfc('0x3a')]=_['merge'](_0x447a8f['where'],{'$or':_[_0xddfc('0x2b')](_0x447a8f[_0xddfc('0x35')],function(_0x5005a5){var _0x319a47={};_0x319a47[_0x5005a5]={'$like':'%'+_0x2bc104['query'][_0xddfc('0x3d')]+'%'};return _0x319a47;})});}_0x447a8f=_[_0xddfc('0x3e')]({},_0x447a8f,_0x2bc104[_0xddfc('0x4e')]);return _0x3da544['getFields'](_0x447a8f);}})[_0xddfc('0x24')](function(_0xc27eaf){if(_0xc27eaf){_0xe9d912=_0xc27eaf[_0xddfc('0x45')];if(!_0x2bc104['query'][_0xddfc('0x36')](_0xddfc('0x37'))){_0x447a8f[_0xddfc('0x1c')]=qs[_0xddfc('0x1c')](_0x2bc104['query'][_0xddfc('0x1c')]);_0x447a8f[_0xddfc('0x1e')]=qs[_0xddfc('0x1e')](_0x2bc104[_0xddfc('0x31')][_0xddfc('0x1e')]);}return _0x3da544[_0xddfc('0x4f')](_0x447a8f);}})[_0xddfc('0x24')](function(_0x39232f){if(_0x39232f){return _0x39232f?{'count':_0xe9d912,'rows':_0x39232f}:null;}})['then'](respondWithResult(_0x2ad44f,null))['catch'](handleError(_0x2ad44f,null));};
\ No newline at end of file
index 66d2ddf..a033d33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf250=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment'];(function(_0x22a81b,_0x51edff){var _0x4540aa=function(_0x10b676){while(--_0x10b676){_0x22a81b['push'](_0x22a81b['shift']());}};_0x4540aa(++_0x51edff);}(_0xf250,0x184));var _0x0f25=function(_0x3642e7,_0x16358e){_0x3642e7=_0x3642e7-0x0;var _0x31e3dd=_0xf250[_0x3642e7];return _0x31e3dd;};'use strict';var _=require(_0x0f25('0x0'));var util=require('util');var logger=require(_0x0f25('0x1'))(_0x0f25('0x2'));var moment=require(_0x0f25('0x3'));var BPromise=require(_0x0f25('0x4'));var rp=require(_0x0f25('0x5'));var fs=require('fs');var path=require(_0x0f25('0x6'));var rimraf=require(_0x0f25('0x7'));var config=require(_0x0f25('0x8'));var attributes=require(_0x0f25('0x9'));module[_0x0f25('0xa')]=function(_0x1ab08e,_0x49e173){return _0x1ab08e[_0x0f25('0xb')](_0x0f25('0xc'),attributes,{'tableName':_0x0f25('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7ee=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x52dcf9,_0x4b39c1){var _0x182ed8=function(_0x30057e){while(--_0x30057e){_0x52dcf9['push'](_0x52dcf9['shift']());}};_0x182ed8(++_0x4b39c1);}(_0xd7ee,0x7b));var _0xed7e=function(_0x1830a9,_0x1583bd){_0x1830a9=_0x1830a9-0x0;var _0x2b6166=_0xd7ee[_0x1830a9];return _0x2b6166;};'use strict';var _=require(_0xed7e('0x0'));var util=require(_0xed7e('0x1'));var logger=require(_0xed7e('0x2'))(_0xed7e('0x3'));var moment=require(_0xed7e('0x4'));var BPromise=require(_0xed7e('0x5'));var rp=require(_0xed7e('0x6'));var fs=require('fs');var path=require(_0xed7e('0x7'));var rimraf=require(_0xed7e('0x8'));var config=require(_0xed7e('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xed7e('0xa')]=function(_0x189407,_0x2f217b){return _0x189407[_0xed7e('0xb')](_0xed7e('0xc'),attributes,{'tableName':_0xed7e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ef23a86..f574471 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e4=['info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x109b8d,_0x13784f){var _0x19b81e=function(_0x1d66c3){while(--_0x1d66c3){_0x109b8d['push'](_0x109b8d['shift']());}};_0x19b81e(++_0x13784f);}(_0xf5e4,0x7a));var _0x4f5e=function(_0x157a7e,_0x3edf06){_0x157a7e=_0x157a7e-0x0;var _0x383d25=_0xf5e4[_0x157a7e];return _0x383d25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f5e('0x0'));var BPromise=require('bluebird');var rs=require(_0x4f5e('0x1'));var fs=require('fs');var Redis=require(_0x4f5e('0x2'));var db=require(_0x4f5e('0x3'))['db'];var utils=require(_0x4f5e('0x4'));var logger=require(_0x4f5e('0x5'))(_0x4f5e('0x6'));var config=require(_0x4f5e('0x7'));var jayson=require(_0x4f5e('0x8'));var client=jayson['client'][_0x4f5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dd3be,_0x44c780,_0x2fa858){return new BPromise(function(_0x79e276,_0x8fa2c6){return client['request'](_0x1dd3be,_0x2fa858)[_0x4f5e('0xa')](function(_0x21fa6f){logger[_0x4f5e('0xb')](_0x4f5e('0xc'),_0x44c780,_0x4f5e('0xd'));logger[_0x4f5e('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x44c780,_0x4f5e('0xd'),JSON['stringify'](_0x21fa6f));if(_0x21fa6f[_0x4f5e('0xf')]){if(_0x21fa6f[_0x4f5e('0xf')]['code']===0x1f4){logger[_0x4f5e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x44c780,_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);return _0x8fa2c6(_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);}logger[_0x4f5e('0xf')](_0x4f5e('0xc'),_0x44c780,_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);return _0x79e276(_0x21fa6f[_0x4f5e('0xf')][_0x4f5e('0x10')]);}else{logger[_0x4f5e('0xb')](_0x4f5e('0xc'),_0x44c780,_0x4f5e('0xd'));_0x79e276(_0x21fa6f[_0x4f5e('0x11')]['message']);}})[_0x4f5e('0x12')](function(_0x5d3710){logger[_0x4f5e('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x44c780,_0x5d3710);_0x8fa2c6(_0x5d3710);});});}
\ No newline at end of file
+var _0xda75=['FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3eb2d4,_0x4e39ff){var _0x5b95c6=function(_0x4723f7){while(--_0x4723f7){_0x3eb2d4['push'](_0x3eb2d4['shift']());}};_0x5b95c6(++_0x4e39ff);}(_0xda75,0x190));var _0x5da7=function(_0x48fe42,_0x202b5c){_0x48fe42=_0x48fe42-0x0;var _0x58f312=_0xda75[_0x48fe42];return _0x58f312;};'use strict';var _=require(_0x5da7('0x0'));var util=require(_0x5da7('0x1'));var moment=require(_0x5da7('0x2'));var BPromise=require(_0x5da7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5da7('0x4'));var db=require(_0x5da7('0x5'))['db'];var utils=require(_0x5da7('0x6'));var logger=require('../../config/logger')(_0x5da7('0x7'));var config=require(_0x5da7('0x8'));var jayson=require(_0x5da7('0x9'));var client=jayson[_0x5da7('0xa')][_0x5da7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5794,_0x1751f2,_0x280bc7){return new BPromise(function(_0x264523,_0x18872d){return client['request'](_0x4f5794,_0x280bc7)[_0x5da7('0xc')](function(_0x4d1518){logger[_0x5da7('0xd')](_0x5da7('0xe'),_0x1751f2,'request\x20sent');logger['debug'](_0x5da7('0xf'),_0x1751f2,_0x5da7('0x10'),JSON[_0x5da7('0x11')](_0x4d1518));if(_0x4d1518['error']){if(_0x4d1518[_0x5da7('0x12')][_0x5da7('0x13')]===0x1f4){logger[_0x5da7('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1751f2,_0x4d1518[_0x5da7('0x12')][_0x5da7('0x14')]);return _0x18872d(_0x4d1518[_0x5da7('0x12')][_0x5da7('0x14')]);}logger[_0x5da7('0x12')](_0x5da7('0xe'),_0x1751f2,_0x4d1518[_0x5da7('0x12')][_0x5da7('0x14')]);return _0x264523(_0x4d1518[_0x5da7('0x12')][_0x5da7('0x14')]);}else{logger[_0x5da7('0xd')](_0x5da7('0xe'),_0x1751f2,_0x5da7('0x10'));_0x264523(_0x4d1518[_0x5da7('0x15')]['message']);}})[_0x5da7('0x16')](function(_0x54bc8f){logger['error'](_0x5da7('0xe'),_0x1751f2,_0x54bc8f);_0x18872d(_0x54bc8f);});});}
\ No newline at end of file
index 4caf962..dda6ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x526399,_0x1bac7b){var _0x2a814c=function(_0x43dc3a){while(--_0x43dc3a){_0x526399['push'](_0x526399['shift']());}};_0x2a814c(++_0x1bac7b);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0xa1fd[_0x4a8bad];return _0x30cf32;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xc73e=['isAuthenticated','index','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc73e,0x1e9));var _0xec73=function(_0x57b35f,_0x358299){_0x57b35f=_0x57b35f-0x0;var _0x57d4fe=_0xc73e[_0x57b35f];return _0x57d4fe;};'use strict';var multer=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var path=require('path');var timeout=require(_0xec73('0x2'));var express=require(_0xec73('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec73('0x4'));var config=require(_0xec73('0x5'));var controller=require('./intFreshsalesField.controller');router[_0xec73('0x6')]('/',auth[_0xec73('0x7')](),controller[_0xec73('0x8')]);router[_0xec73('0x6')]('/:id',auth[_0xec73('0x7')](),controller['show']);router[_0xec73('0x9')]('/',auth[_0xec73('0x7')](),controller[_0xec73('0xa')]);router[_0xec73('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xec73('0xc')]);router[_0xec73('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xec73('0xe')]);module[_0xec73('0xf')]=router;
\ No newline at end of file
index 1d97078..e05f49b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2901=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x531607,_0x73fa88){var _0x1b1fbb=function(_0x4af491){while(--_0x4af491){_0x531607['push'](_0x531607['shift']());}};_0x1b1fbb(++_0x73fa88);}(_0x2901,0xb3));var _0x1290=function(_0xb1ec0b,_0x47e760){_0xb1ec0b=_0xb1ec0b-0x0;var _0x3e0293=_0x2901[_0xb1ec0b];return _0x3e0293;};'use strict';var Sequelize=require(_0x1290('0x0'));module[_0x1290('0x1')]={'type':{'type':Sequelize[_0x1290('0x2')]('string',_0x1290('0x3'),_0x1290('0x4'),_0x1290('0x5'),_0x1290('0x6')),'defaultValue':_0x1290('0x7')},'content':{'type':Sequelize[_0x1290('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1290('0x2')]('string',_0x1290('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1290('0x8')]},'idField':{'type':Sequelize[_0x1290('0x8')]},'nameField':{'type':Sequelize[_0x1290('0x8')]},'customField':{'type':Sequelize[_0x1290('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1290('0x8')]}};
\ No newline at end of file
+var _0x6eff=['BOOLEAN','sequelize','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x4d95db,_0x28b7e9){var _0x1cc484=function(_0x42c09c){while(--_0x42c09c){_0x4d95db['push'](_0x4d95db['shift']());}};_0x1cc484(++_0x28b7e9);}(_0x6eff,0x129));var _0xf6ef=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x6eff[_0x36d25e];return _0x4b95b8;};'use strict';var Sequelize=require(_0xf6ef('0x0'));module['exports']={'type':{'type':Sequelize[_0xf6ef('0x1')](_0xf6ef('0x2'),_0xf6ef('0x3'),_0xf6ef('0x4'),'keyValue',_0xf6ef('0x5')),'defaultValue':_0xf6ef('0x2')},'content':{'type':Sequelize[_0xf6ef('0x6')]},'key':{'type':Sequelize[_0xf6ef('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xf6ef('0x3'),_0xf6ef('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf6ef('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf6ef('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf6ef('0x6')]}};
\ No newline at end of file
index 5b27226..d022ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa98b=['status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','FreshsalesField','include','findAll','catch','show','params','includeAll','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xa98b,0xcc));var _0xba98=function(_0x20e407,_0x9021a7){_0x20e407=_0x20e407-0x0;var _0x147b7f=_0xa98b[_0x20e407];return _0x147b7f;};'use strict';var emlformat=require(_0xba98('0x0'));var rimraf=require(_0xba98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba98('0x2'));var rp=require(_0xba98('0x3'));var moment=require(_0xba98('0x4'));var BPromise=require(_0xba98('0x5'));var Mustache=require(_0xba98('0x6'));var util=require(_0xba98('0x7'));var path=require(_0xba98('0x8'));var sox=require(_0xba98('0x9'));var csv=require(_0xba98('0xa'));var ejs=require(_0xba98('0xb'));var fs=require('fs');var fs_extra=require(_0xba98('0xc'));var _=require(_0xba98('0xd'));var squel=require(_0xba98('0xe'));var crypto=require(_0xba98('0xf'));var jsforce=require(_0xba98('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xba98('0xa'));var querystring=require(_0xba98('0x11'));var Papa=require(_0xba98('0x12'));var Redis=require('ioredis');var authService=require(_0xba98('0x13'));var qs=require(_0xba98('0x14'));var as=require(_0xba98('0x15'));var hardwareService=require(_0xba98('0x16'));var logger=require(_0xba98('0x17'))(_0xba98('0x18'));var utils=require(_0xba98('0x19'));var config=require(_0xba98('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34ec1d,_0x1cdfa2){_0x1cdfa2=_0x1cdfa2||0xcc;return function(_0x185704){if(_0x185704){return _0x34ec1d['sendStatus'](_0x1cdfa2);}return _0x34ec1d[_0xba98('0x1b')](_0x1cdfa2)[_0xba98('0x1c')]();};}function respondWithResult(_0x5c6547,_0x5756a3){_0x5756a3=_0x5756a3||0xc8;return function(_0x425d51){if(_0x425d51){return _0x5c6547[_0xba98('0x1b')](_0x5756a3)['json'](_0x425d51);}};}function respondWithFilteredResult(_0x14723f,_0x6f828){return function(_0x1b8093){if(_0x1b8093){var _0x380dd4=typeof _0x6f828[_0xba98('0x1d')]==='undefined'&&typeof _0x6f828[_0xba98('0x1e')]===_0xba98('0x1f');var _0x3ae726=_0x1b8093[_0xba98('0x20')];var _0x3a9fd3=_0x380dd4?0x0:_0x6f828['offset'];var _0x2327d0=_0x380dd4?_0x1b8093[_0xba98('0x20')]:_0x6f828['offset']+_0x6f828[_0xba98('0x1e')];var _0x265a4e;if(_0x2327d0>=_0x3ae726){_0x2327d0=_0x3ae726;_0x265a4e=0xc8;}else{_0x265a4e=0xce;}_0x14723f[_0xba98('0x1b')](_0x265a4e);return _0x14723f[_0xba98('0x21')](_0xba98('0x22'),_0x3a9fd3+'-'+_0x2327d0+'/'+_0x3ae726)[_0xba98('0x23')](_0x1b8093);}return null;};}function patchUpdates(_0x1e67f8){return function(_0x4cb753){try{jsonpatch[_0xba98('0x24')](_0x4cb753,_0x1e67f8,!![]);}catch(_0x277010){return BPromise['reject'](_0x277010);}return _0x4cb753[_0xba98('0x25')]();};}function saveUpdates(_0x371e1b,_0x40c7cc){return function(_0x25aab8){if(_0x25aab8){return _0x25aab8[_0xba98('0x26')](_0x371e1b)[_0xba98('0x27')](function(_0x1edad9){return _0x1edad9;});}return null;};}function removeEntity(_0x59c264,_0x3c9988){return function(_0x23e55b){if(_0x23e55b){return _0x23e55b['destroy']()[_0xba98('0x27')](function(){_0x59c264[_0xba98('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e28fa,_0x4fe515){return function(_0x57cc11){if(!_0x57cc11){_0x3e28fa['sendStatus'](0x194);}return _0x57cc11;};}function handleError(_0x574ae3,_0x399671){_0x399671=_0x399671||0x1f4;return function(_0x680448){logger['error'](_0x680448[_0xba98('0x28')]);if(_0x680448[_0xba98('0x29')]){delete _0x680448[_0xba98('0x29')];}_0x574ae3['status'](_0x399671)[_0xba98('0x2a')](_0x680448);};}exports['index']=function(_0xe56603,_0x1de971){var _0xd6304a={},_0xee26ba={},_0x4da45d={'count':0x0,'rows':[]};var _0x35be89=_[_0xba98('0x2b')](db['FreshsalesField'][_0xba98('0x2c')],function(_0x3ea09e){return{'name':_0x3ea09e[_0xba98('0x2d')],'type':_0x3ea09e[_0xba98('0x2e')][_0xba98('0x2f')]};});_0xee26ba['model']=_[_0xba98('0x2b')](_0x35be89,'name');_0xee26ba[_0xba98('0x30')]=_[_0xba98('0x31')](_0xe56603[_0xba98('0x30')]);_0xee26ba['filters']=_['intersection'](_0xee26ba['model'],_0xee26ba[_0xba98('0x30')]);_0xd6304a[_0xba98('0x32')]=_[_0xba98('0x33')](_0xee26ba[_0xba98('0x34')],qs[_0xba98('0x35')](_0xe56603[_0xba98('0x30')][_0xba98('0x35')]));_0xd6304a[_0xba98('0x32')]=_0xd6304a[_0xba98('0x32')][_0xba98('0x36')]?_0xd6304a[_0xba98('0x32')]:_0xee26ba[_0xba98('0x34')];if(!_0xe56603['query'][_0xba98('0x37')](_0xba98('0x38'))){_0xd6304a[_0xba98('0x1e')]=qs['limit'](_0xe56603[_0xba98('0x30')][_0xba98('0x1e')]);_0xd6304a[_0xba98('0x1d')]=qs['offset'](_0xe56603[_0xba98('0x30')][_0xba98('0x1d')]);}_0xd6304a[_0xba98('0x39')]=qs['sort'](_0xe56603[_0xba98('0x30')][_0xba98('0x3a')]);_0xd6304a[_0xba98('0x3b')]=qs[_0xba98('0x3c')](_[_0xba98('0x3d')](_0xe56603[_0xba98('0x30')],_0xee26ba[_0xba98('0x3c')]),_0x35be89);if(_0xe56603[_0xba98('0x30')]['filter']){_0xd6304a[_0xba98('0x3b')]=_[_0xba98('0x3e')](_0xd6304a[_0xba98('0x3b')],{'$or':_['map'](_0x35be89,function(_0x1b3223){if(_0x1b3223[_0xba98('0x2e')]!==_0xba98('0x3f')){var _0x278f54={};_0x278f54[_0x1b3223[_0xba98('0x29')]]={'$like':'%'+_0xe56603[_0xba98('0x30')][_0xba98('0x40')]+'%'};return _0x278f54;}})});}_0xd6304a=_['merge']({},_0xd6304a,_0xe56603[_0xba98('0x41')]);var _0x5d7c79={'where':_0xd6304a[_0xba98('0x3b')]};return db[_0xba98('0x42')][_0xba98('0x20')](_0x5d7c79)['then'](function(_0x1077d3){_0x4da45d[_0xba98('0x20')]=_0x1077d3;if(_0xe56603[_0xba98('0x30')]['includeAll']){_0xd6304a[_0xba98('0x43')]=[{'all':!![]}];}return db[_0xba98('0x42')][_0xba98('0x44')](_0xd6304a);})['then'](function(_0x20f481){_0x4da45d['rows']=_0x20f481;return _0x4da45d;})[_0xba98('0x27')](respondWithFilteredResult(_0x1de971,_0xd6304a))[_0xba98('0x45')](handleError(_0x1de971,null));};exports[_0xba98('0x46')]=function(_0xd808e4,_0x5442e3){var _0x5a79b4={'raw':!![],'where':{'id':_0xd808e4[_0xba98('0x47')]['id']}},_0x20b0a7={};_0x20b0a7[_0xba98('0x34')]=_[_0xba98('0x31')](db[_0xba98('0x42')][_0xba98('0x2c')]);_0x20b0a7[_0xba98('0x30')]=_['keys'](_0xd808e4[_0xba98('0x30')]);_0x20b0a7[_0xba98('0x3c')]=_[_0xba98('0x33')](_0x20b0a7[_0xba98('0x34')],_0x20b0a7['query']);_0x5a79b4[_0xba98('0x32')]=_[_0xba98('0x33')](_0x20b0a7[_0xba98('0x34')],qs[_0xba98('0x35')](_0xd808e4[_0xba98('0x30')][_0xba98('0x35')]));_0x5a79b4[_0xba98('0x32')]=_0x5a79b4[_0xba98('0x32')][_0xba98('0x36')]?_0x5a79b4[_0xba98('0x32')]:_0x20b0a7[_0xba98('0x34')];if(_0xd808e4[_0xba98('0x30')][_0xba98('0x48')]){_0x5a79b4[_0xba98('0x43')]=[{'all':!![]}];}_0x5a79b4=_[_0xba98('0x3e')]({},_0x5a79b4,_0xd808e4['options']);return db[_0xba98('0x42')]['find'](_0x5a79b4)[_0xba98('0x27')](handleEntityNotFound(_0x5442e3,null))[_0xba98('0x27')](respondWithResult(_0x5442e3,null))['catch'](handleError(_0x5442e3,null));};exports['create']=function(_0x19cc40,_0x400101){return db['FreshsalesField'][_0xba98('0x49')](_0x19cc40[_0xba98('0x4a')],{})[_0xba98('0x27')](respondWithResult(_0x400101,0xc9))[_0xba98('0x45')](handleError(_0x400101,null));};exports[_0xba98('0x26')]=function(_0x3c6606,_0x540ef1){if(_0x3c6606[_0xba98('0x4a')]['id']){delete _0x3c6606[_0xba98('0x4a')]['id'];}return db['FreshsalesField'][_0xba98('0x4b')]({'where':{'id':_0x3c6606[_0xba98('0x47')]['id']}})['then'](handleEntityNotFound(_0x540ef1,null))['then'](saveUpdates(_0x3c6606[_0xba98('0x4a')],null))['then'](respondWithResult(_0x540ef1,null))[_0xba98('0x45')](handleError(_0x540ef1,null));};exports[_0xba98('0x4c')]=function(_0xc78478,_0x463462){return db[_0xba98('0x42')][_0xba98('0x4b')]({'where':{'id':_0xc78478[_0xba98('0x47')]['id']}})[_0xba98('0x27')](handleEntityNotFound(_0x463462,null))[_0xba98('0x27')](removeEntity(_0x463462,null))[_0xba98('0x45')](handleError(_0x463462,null));};
\ No newline at end of file
+var _0xf5bc=['apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','FreshsalesField','fieldName','key','model','keys','query','attributes','fields','length','hasOwnProperty','order','where','filters','filter','merge','type','VIRTUAL','includeAll','findAll','rawAttributes','options','find','catch','create','body','params','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x50682b,_0x2f713a){var _0x28e328=function(_0x7bac32){while(--_0x7bac32){_0x50682b['push'](_0x50682b['shift']());}};_0x28e328(++_0x2f713a);}(_0xf5bc,0xb7));var _0xcf5b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf5bc[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf5b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf5b('0x1'));var rp=require(_0xcf5b('0x2'));var moment=require('moment');var BPromise=require(_0xcf5b('0x3'));var Mustache=require(_0xcf5b('0x4'));var util=require('util');var path=require(_0xcf5b('0x5'));var sox=require(_0xcf5b('0x6'));var csv=require(_0xcf5b('0x7'));var ejs=require(_0xcf5b('0x8'));var fs=require('fs');var fs_extra=require(_0xcf5b('0x9'));var _=require(_0xcf5b('0xa'));var squel=require('squel');var crypto=require(_0xcf5b('0xb'));var jsforce=require(_0xcf5b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcf5b('0x7'));var querystring=require(_0xcf5b('0xd'));var Papa=require('papaparse');var Redis=require(_0xcf5b('0xe'));var authService=require(_0xcf5b('0xf'));var qs=require(_0xcf5b('0x10'));var as=require(_0xcf5b('0x11'));var hardwareService=require(_0xcf5b('0x12'));var logger=require(_0xcf5b('0x13'))(_0xcf5b('0x14'));var utils=require(_0xcf5b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcf5b('0x16'));var db=require(_0xcf5b('0x17'))['db'];function respondWithStatusCode(_0x1d4840,_0x3c1f91){_0x3c1f91=_0x3c1f91||0xcc;return function(_0x581528){if(_0x581528){return _0x1d4840[_0xcf5b('0x18')](_0x3c1f91);}return _0x1d4840[_0xcf5b('0x19')](_0x3c1f91)['end']();};}function respondWithResult(_0x2ef330,_0x55b6b7){_0x55b6b7=_0x55b6b7||0xc8;return function(_0xdb26dd){if(_0xdb26dd){return _0x2ef330[_0xcf5b('0x19')](_0x55b6b7)[_0xcf5b('0x1a')](_0xdb26dd);}};}function respondWithFilteredResult(_0x31aaf5,_0xc568c3){return function(_0x4f7d33){if(_0x4f7d33){var _0x165ab8=typeof _0xc568c3[_0xcf5b('0x1b')]===_0xcf5b('0x1c')&&typeof _0xc568c3[_0xcf5b('0x1d')]===_0xcf5b('0x1c');var _0x21c6af=_0x4f7d33['count'];var _0x5d30d7=_0x165ab8?0x0:_0xc568c3[_0xcf5b('0x1b')];var _0x203aa7=_0x165ab8?_0x4f7d33[_0xcf5b('0x1e')]:_0xc568c3[_0xcf5b('0x1b')]+_0xc568c3[_0xcf5b('0x1d')];var _0x49b833;if(_0x203aa7>=_0x21c6af){_0x203aa7=_0x21c6af;_0x49b833=0xc8;}else{_0x49b833=0xce;}_0x31aaf5['status'](_0x49b833);return _0x31aaf5[_0xcf5b('0x1f')](_0xcf5b('0x20'),_0x5d30d7+'-'+_0x203aa7+'/'+_0x21c6af)['json'](_0x4f7d33);}return null;};}function patchUpdates(_0x3ff16b){return function(_0x362ea4){try{jsonpatch[_0xcf5b('0x21')](_0x362ea4,_0x3ff16b,!![]);}catch(_0x3ec9ce){return BPromise[_0xcf5b('0x22')](_0x3ec9ce);}return _0x362ea4[_0xcf5b('0x23')]();};}function saveUpdates(_0x4fc479,_0x470c1b){return function(_0xc71df){if(_0xc71df){return _0xc71df[_0xcf5b('0x24')](_0x4fc479)[_0xcf5b('0x25')](function(_0x1ef7d4){return _0x1ef7d4;});}return null;};}function removeEntity(_0x5e57a6,_0x145f65){return function(_0x32a2f4){if(_0x32a2f4){return _0x32a2f4[_0xcf5b('0x26')]()['then'](function(){_0x5e57a6[_0xcf5b('0x19')](0xcc)[_0xcf5b('0x27')]();});}};}function handleEntityNotFound(_0x2b446c,_0x3a75ed){return function(_0x30207f){if(!_0x30207f){_0x2b446c[_0xcf5b('0x18')](0x194);}return _0x30207f;};}function handleError(_0x4b795d,_0x2f7073){_0x2f7073=_0x2f7073||0x1f4;return function(_0x31a4dd){logger[_0xcf5b('0x28')](_0x31a4dd[_0xcf5b('0x29')]);if(_0x31a4dd[_0xcf5b('0x2a')]){delete _0x31a4dd['name'];}_0x4b795d[_0xcf5b('0x19')](_0x2f7073)[_0xcf5b('0x2b')](_0x31a4dd);};}exports[_0xcf5b('0x2c')]=function(_0xea76d,_0x1c7a82){var _0x43a3bf={},_0x5bdd3c={},_0x291897={'count':0x0,'rows':[]};var _0x45b363=_[_0xcf5b('0x2d')](db[_0xcf5b('0x2e')]['rawAttributes'],function(_0x3d474a){return{'name':_0x3d474a[_0xcf5b('0x2f')],'type':_0x3d474a['type'][_0xcf5b('0x30')]};});_0x5bdd3c[_0xcf5b('0x31')]=_['map'](_0x45b363,_0xcf5b('0x2a'));_0x5bdd3c['query']=_[_0xcf5b('0x32')](_0xea76d[_0xcf5b('0x33')]);_0x5bdd3c['filters']=_['intersection'](_0x5bdd3c[_0xcf5b('0x31')],_0x5bdd3c[_0xcf5b('0x33')]);_0x43a3bf[_0xcf5b('0x34')]=_['intersection'](_0x5bdd3c[_0xcf5b('0x31')],qs[_0xcf5b('0x35')](_0xea76d[_0xcf5b('0x33')][_0xcf5b('0x35')]));_0x43a3bf[_0xcf5b('0x34')]=_0x43a3bf[_0xcf5b('0x34')][_0xcf5b('0x36')]?_0x43a3bf[_0xcf5b('0x34')]:_0x5bdd3c['model'];if(!_0xea76d['query'][_0xcf5b('0x37')]('nolimit')){_0x43a3bf[_0xcf5b('0x1d')]=qs[_0xcf5b('0x1d')](_0xea76d['query'][_0xcf5b('0x1d')]);_0x43a3bf[_0xcf5b('0x1b')]=qs[_0xcf5b('0x1b')](_0xea76d[_0xcf5b('0x33')]['offset']);}_0x43a3bf[_0xcf5b('0x38')]=qs['sort'](_0xea76d[_0xcf5b('0x33')]['sort']);_0x43a3bf[_0xcf5b('0x39')]=qs[_0xcf5b('0x3a')](_['pick'](_0xea76d['query'],_0x5bdd3c[_0xcf5b('0x3a')]),_0x45b363);if(_0xea76d[_0xcf5b('0x33')][_0xcf5b('0x3b')]){_0x43a3bf['where']=_[_0xcf5b('0x3c')](_0x43a3bf[_0xcf5b('0x39')],{'$or':_[_0xcf5b('0x2d')](_0x45b363,function(_0x42cbb0){if(_0x42cbb0[_0xcf5b('0x3d')]!==_0xcf5b('0x3e')){var _0x1afcdb={};_0x1afcdb[_0x42cbb0[_0xcf5b('0x2a')]]={'$like':'%'+_0xea76d[_0xcf5b('0x33')][_0xcf5b('0x3b')]+'%'};return _0x1afcdb;}})});}_0x43a3bf=_['merge']({},_0x43a3bf,_0xea76d['options']);var _0x1358a9={'where':_0x43a3bf[_0xcf5b('0x39')]};return db['FreshsalesField'][_0xcf5b('0x1e')](_0x1358a9)[_0xcf5b('0x25')](function(_0x432a23){_0x291897[_0xcf5b('0x1e')]=_0x432a23;if(_0xea76d[_0xcf5b('0x33')][_0xcf5b('0x3f')]){_0x43a3bf['include']=[{'all':!![]}];}return db[_0xcf5b('0x2e')][_0xcf5b('0x40')](_0x43a3bf);})[_0xcf5b('0x25')](function(_0x229b9a){_0x291897['rows']=_0x229b9a;return _0x291897;})['then'](respondWithFilteredResult(_0x1c7a82,_0x43a3bf))['catch'](handleError(_0x1c7a82,null));};exports['show']=function(_0x4fee67,_0xdcd55b){var _0x55232d={'raw':!![],'where':{'id':_0x4fee67['params']['id']}},_0x4520f8={};_0x4520f8[_0xcf5b('0x31')]=_[_0xcf5b('0x32')](db[_0xcf5b('0x2e')][_0xcf5b('0x41')]);_0x4520f8[_0xcf5b('0x33')]=_[_0xcf5b('0x32')](_0x4fee67[_0xcf5b('0x33')]);_0x4520f8['filters']=_['intersection'](_0x4520f8['model'],_0x4520f8[_0xcf5b('0x33')]);_0x55232d[_0xcf5b('0x34')]=_['intersection'](_0x4520f8[_0xcf5b('0x31')],qs[_0xcf5b('0x35')](_0x4fee67[_0xcf5b('0x33')]['fields']));_0x55232d['attributes']=_0x55232d[_0xcf5b('0x34')][_0xcf5b('0x36')]?_0x55232d[_0xcf5b('0x34')]:_0x4520f8['model'];if(_0x4fee67[_0xcf5b('0x33')][_0xcf5b('0x3f')]){_0x55232d['include']=[{'all':!![]}];}_0x55232d=_[_0xcf5b('0x3c')]({},_0x55232d,_0x4fee67[_0xcf5b('0x42')]);return db[_0xcf5b('0x2e')][_0xcf5b('0x43')](_0x55232d)['then'](handleEntityNotFound(_0xdcd55b,null))[_0xcf5b('0x25')](respondWithResult(_0xdcd55b,null))[_0xcf5b('0x44')](handleError(_0xdcd55b,null));};exports[_0xcf5b('0x45')]=function(_0x2dfe20,_0x5d5f65){return db[_0xcf5b('0x2e')][_0xcf5b('0x45')](_0x2dfe20[_0xcf5b('0x46')],{})[_0xcf5b('0x25')](respondWithResult(_0x5d5f65,0xc9))[_0xcf5b('0x44')](handleError(_0x5d5f65,null));};exports[_0xcf5b('0x24')]=function(_0xe1959d,_0x4c1656){if(_0xe1959d[_0xcf5b('0x46')]['id']){delete _0xe1959d[_0xcf5b('0x46')]['id'];}return db[_0xcf5b('0x2e')][_0xcf5b('0x43')]({'where':{'id':_0xe1959d[_0xcf5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c1656,null))[_0xcf5b('0x25')](saveUpdates(_0xe1959d[_0xcf5b('0x46')],null))['then'](respondWithResult(_0x4c1656,null))['catch'](handleError(_0x4c1656,null));};exports['destroy']=function(_0x80814a,_0x188487){return db['FreshsalesField'][_0xcf5b('0x43')]({'where':{'id':_0x80814a[_0xcf5b('0x47')]['id']}})[_0xcf5b('0x25')](handleEntityNotFound(_0x188487,null))['then'](removeEntity(_0x188487,null))['catch'](handleError(_0x188487,null));};
\ No newline at end of file
index 43f287c..db6ae53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a6=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','idField','FieldId','util'];(function(_0xfd377f,_0x375ef1){var _0x2de2a2=function(_0x3abe53){while(--_0x3abe53){_0xfd377f['push'](_0xfd377f['shift']());}};_0x2de2a2(++_0x375ef1);}(_0x63a6,0x1c7));var _0x663a=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x63a6[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x663a('0xa'),_0x663a('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7033=['path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x47c8b9,_0x5a444b){var _0x3f2216=function(_0x273958){while(--_0x273958){_0x47c8b9['push'](_0x47c8b9['shift']());}};_0x3f2216(++_0x5a444b);}(_0x7033,0x19e));var _0x3703=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7033[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var logger=require(_0x3703('0x2'))(_0x3703('0x3'));var moment=require('moment');var BPromise=require(_0x3703('0x4'));var rp=require(_0x3703('0x5'));var fs=require('fs');var path=require(_0x3703('0x6'));var rimraf=require(_0x3703('0x7'));var config=require(_0x3703('0x8'));var attributes=require(_0x3703('0x9'));module[_0x3703('0xa')]=function(_0x283af9,_0x1170b6){return _0x283af9[_0x3703('0xb')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x3703('0xc'),_0x3703('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c2a21c7..21412e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x3b5b67,_0x2f1f83){var _0x35c69=function(_0x502f9f){while(--_0x502f9f){_0x3b5b67['push'](_0x3b5b67['shift']());}};_0x35c69(++_0x2f1f83);}(_0x4c60,0xc1));var _0x04c6=function(_0x3009be,_0x20844d){_0x3009be=_0x3009be-0x0;var _0x3ce6b9=_0x4c60[_0x3009be];return _0x3ce6b9;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}
\ No newline at end of file
+var _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x35a140,_0x3aeac6){var _0x30ab82=function(_0x15a7c3){while(--_0x15a7c3){_0x35a140['push'](_0x35a140['shift']());}};_0x30ab82(++_0x3aeac6);}(_0x7c09,0x102));var _0x97c0=function(_0x6c2a3,_0x50d2e2){_0x6c2a3=_0x6c2a3-0x0;var _0x32313f=_0x7c09[_0x6c2a3];return _0x32313f;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});}
\ No newline at end of file
index 69c90a1..fbf88a1 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','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4a8e0d,_0x1fdc67){var _0xf54ee2=function(_0x207da9){while(--_0x207da9){_0x4a8e0d['push'](_0x4a8e0d['shift']());}};_0xf54ee2(++_0x1fdc67);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x54eb2d,_0x4c9b90){var _0x550bf1=function(_0x5d4771){while(--_0x5d4771){_0x54eb2d['push'](_0x54eb2d['shift']());}};_0x550bf1(++_0x4c9b90);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 5f2f98e..2363192 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd26f=['newTab','integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xd26f,0x113));var _0xfd26=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd26f[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x3')},'remoteUri':{'type':Sequelize[_0xfd26('0x2')]},'password':{'type':Sequelize[_0xfd26('0x2')]},'clientId':{'type':Sequelize[_0xfd26('0x2')]},'clientSecret':{'type':Sequelize[_0xfd26('0x2')]},'securityToken':{'type':Sequelize[_0xfd26('0x2')]},'serverUrl':{'type':Sequelize[_0xfd26('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfd26('0x4')]('integrationTab',_0xfd26('0x5')),'defaultValue':_0xfd26('0x6')}};
\ No newline at end of file
+var _0xf55c=['ENUM','integrationTab','sequelize','STRING','username'];(function(_0x288265,_0x3bc1e2){var _0x2892ad=function(_0x23f74c){while(--_0x23f74c){_0x288265['push'](_0x288265['shift']());}};_0x2892ad(++_0x3bc1e2);}(_0xf55c,0x1e7));var _0xcf55=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xf55c[_0x4c7fb5];return _0x2e10ac;};'use strict';var Sequelize=require(_0xcf55('0x0'));module['exports']={'name':{'type':Sequelize[_0xcf55('0x1')]},'description':{'type':Sequelize[_0xcf55('0x1')]},'username':{'type':Sequelize[_0xcf55('0x1')],'unique':_0xcf55('0x2')},'remoteUri':{'type':Sequelize[_0xcf55('0x1')]},'password':{'type':Sequelize[_0xcf55('0x1')]},'clientId':{'type':Sequelize[_0xcf55('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xcf55('0x1')]},'serverUrl':{'type':Sequelize[_0xcf55('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xcf55('0x3')](_0xcf55('0x4'),'newTab'),'defaultValue':_0xcf55('0x4')}};
\ No newline at end of file
index 4b2ab40..0bc7c65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x824e=['SalesforceAccount','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','getConfigurations','SalesforceConfiguration','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','string','picklist','email','remove','includes','label','custom','picklistValues','True','False','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','undefined','limit','count','offset','set','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map'];(function(_0x5c40e3,_0x14e4c1){var _0x3cddb8=function(_0x4c1e8d){while(--_0x4c1e8d){_0x5c40e3['push'](_0x5c40e3['shift']());}};_0x3cddb8(++_0x14e4c1);}(_0x824e,0xc4));var _0xe824=function(_0x157d23,_0x4027b9){_0x157d23=_0x157d23-0x0;var _0x5b93cc=_0x824e[_0x157d23];return _0x5b93cc;};'use strict';var emlformat=require(_0xe824('0x0'));var rimraf=require(_0xe824('0x1'));var zipdir=require(_0xe824('0x2'));var jsonpatch=require(_0xe824('0x3'));var rp=require(_0xe824('0x4'));var moment=require(_0xe824('0x5'));var BPromise=require(_0xe824('0x6'));var Mustache=require(_0xe824('0x7'));var util=require(_0xe824('0x8'));var path=require('path');var sox=require(_0xe824('0x9'));var csv=require('to-csv');var ejs=require(_0xe824('0xa'));var fs=require('fs');var fs_extra=require(_0xe824('0xb'));var _=require('lodash');var squel=require(_0xe824('0xc'));var crypto=require(_0xe824('0xd'));var jsforce=require(_0xe824('0xe'));var deskjs=require(_0xe824('0xf'));var toCsv=require(_0xe824('0x10'));var querystring=require(_0xe824('0x11'));var Papa=require(_0xe824('0x12'));var Redis=require(_0xe824('0x13'));var authService=require(_0xe824('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe824('0x15'));var hardwareService=require(_0xe824('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xe824('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe824('0x18'))['db'];var integrations=require(_0xe824('0x19'));function respondWithStatusCode(_0xd7dbd1,_0x476bbc){_0x476bbc=_0x476bbc||0xcc;return function(_0x507704){if(_0x507704){return _0xd7dbd1['sendStatus'](_0x476bbc);}return _0xd7dbd1[_0xe824('0x1a')](_0x476bbc)[_0xe824('0x1b')]();};}function respondWithResult(_0x2e0713,_0x25dea6){_0x25dea6=_0x25dea6||0xc8;return function(_0x506de6){if(_0x506de6){return _0x2e0713[_0xe824('0x1a')](_0x25dea6)['json'](_0x506de6);}};}function respondWithFilteredResult(_0x46c971,_0x4bf02d){return function(_0x52887a){if(_0x52887a){var _0x184d27=typeof _0x4bf02d['offset']===_0xe824('0x1c')&&typeof _0x4bf02d[_0xe824('0x1d')]===_0xe824('0x1c');var _0x52ddfc=_0x52887a[_0xe824('0x1e')];var _0x279bc5=_0x184d27?0x0:_0x4bf02d[_0xe824('0x1f')];var _0x3be7e7=_0x184d27?_0x52887a['count']:_0x4bf02d[_0xe824('0x1f')]+_0x4bf02d['limit'];var _0x5e38c6;if(_0x3be7e7>=_0x52ddfc){_0x3be7e7=_0x52ddfc;_0x5e38c6=0xc8;}else{_0x5e38c6=0xce;}_0x46c971['status'](_0x5e38c6);return _0x46c971[_0xe824('0x20')]('Content-Range',_0x279bc5+'-'+_0x3be7e7+'/'+_0x52ddfc)['json'](_0x52887a);}return null;};}function patchUpdates(_0x7b42f3){return function(_0x48b120){try{jsonpatch[_0xe824('0x21')](_0x48b120,_0x7b42f3,!![]);}catch(_0x11655c){return BPromise[_0xe824('0x22')](_0x11655c);}return _0x48b120['save']();};}function saveUpdates(_0x1c4c7e,_0x7ac1e7){return function(_0x598893){if(_0x598893){return _0x598893[_0xe824('0x23')](_0x1c4c7e)[_0xe824('0x24')](function(_0x3f0416){return _0x3f0416;});}return null;};}function removeEntity(_0x58cfbe,_0xf221bf){return function(_0x285fdd){if(_0x285fdd){return _0x285fdd[_0xe824('0x25')]()[_0xe824('0x24')](function(){_0x58cfbe[_0xe824('0x1a')](0xcc)[_0xe824('0x1b')]();});}};}function handleEntityNotFound(_0x2e9a46,_0x44b78b){return function(_0x2d864c){if(!_0x2d864c){_0x2e9a46[_0xe824('0x26')](0x194);}return _0x2d864c;};}function handleError(_0x495259,_0x100b8a){_0x100b8a=_0x100b8a||0x1f4;return function(_0x5c3f98){logger[_0xe824('0x27')](_0x5c3f98[_0xe824('0x28')]);if(_0x5c3f98[_0xe824('0x29')]){delete _0x5c3f98[_0xe824('0x29')];}_0x495259['status'](_0x100b8a)['send'](_0x5c3f98);};}exports[_0xe824('0x2a')]=function(_0x1bf0dc,_0x36e146){var _0x187bf5={},_0x30187b={},_0x582ffc={'count':0x0,'rows':[]};var _0x222cd9=_[_0xe824('0x2b')](db[_0xe824('0x2c')]['rawAttributes'],function(_0x51fc89){return{'name':_0x51fc89['fieldName'],'type':_0x51fc89[_0xe824('0x2d')][_0xe824('0x2e')]};});_0x30187b[_0xe824('0x2f')]=_[_0xe824('0x2b')](_0x222cd9,'name');_0x30187b['query']=_['keys'](_0x1bf0dc[_0xe824('0x30')]);_0x30187b[_0xe824('0x31')]=_[_0xe824('0x32')](_0x30187b[_0xe824('0x2f')],_0x30187b['query']);_0x187bf5['attributes']=_[_0xe824('0x32')](_0x30187b['model'],qs['fields'](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x33')]));_0x187bf5[_0xe824('0x34')]=_0x187bf5['attributes'][_0xe824('0x35')]?_0x187bf5[_0xe824('0x34')]:_0x30187b['model'];if(!_0x1bf0dc['query'][_0xe824('0x36')](_0xe824('0x37'))){_0x187bf5['limit']=qs[_0xe824('0x1d')](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x1d')]);_0x187bf5[_0xe824('0x1f')]=qs[_0xe824('0x1f')](_0x1bf0dc['query'][_0xe824('0x1f')]);}_0x187bf5[_0xe824('0x38')]=qs['sort'](_0x1bf0dc[_0xe824('0x30')][_0xe824('0x39')]);_0x187bf5[_0xe824('0x3a')]=qs[_0xe824('0x31')](_['pick'](_0x1bf0dc['query'],_0x30187b[_0xe824('0x31')]),_0x222cd9);if(_0x1bf0dc[_0xe824('0x30')]['filter']){_0x187bf5['where']=_[_0xe824('0x3b')](_0x187bf5[_0xe824('0x3a')],{'$or':_[_0xe824('0x2b')](_0x222cd9,function(_0x2302bc){if(_0x2302bc[_0xe824('0x2d')]!==_0xe824('0x3c')){var _0x3f18da={};_0x3f18da[_0x2302bc[_0xe824('0x29')]]={'$like':'%'+_0x1bf0dc[_0xe824('0x30')][_0xe824('0x3d')]+'%'};return _0x3f18da;}})});}_0x187bf5=_[_0xe824('0x3b')]({},_0x187bf5,_0x1bf0dc[_0xe824('0x3e')]);var _0x4324b7={'where':_0x187bf5['where']};return db[_0xe824('0x2c')][_0xe824('0x1e')](_0x4324b7)[_0xe824('0x24')](function(_0x239c86){_0x582ffc[_0xe824('0x1e')]=_0x239c86;if(_0x1bf0dc['query'][_0xe824('0x3f')]){_0x187bf5['include']=[{'all':!![]}];}return db[_0xe824('0x2c')][_0xe824('0x40')](_0x187bf5);})[_0xe824('0x24')](function(_0x47cd74){_0x582ffc[_0xe824('0x41')]=_0x47cd74;return _0x582ffc;})[_0xe824('0x24')](respondWithFilteredResult(_0x36e146,_0x187bf5))[_0xe824('0x42')](handleError(_0x36e146,null));};exports[_0xe824('0x43')]=function(_0xc0f0f5,_0x36b300){var _0xa09c8b={'raw':![],'where':{'id':_0xc0f0f5['params']['id']}},_0xbb5cae={};_0xbb5cae[_0xe824('0x2f')]=_[_0xe824('0x44')](db[_0xe824('0x2c')][_0xe824('0x45')]);_0xbb5cae['query']=_[_0xe824('0x44')](_0xc0f0f5[_0xe824('0x30')]);_0xbb5cae['filters']=_['intersection'](_0xbb5cae[_0xe824('0x2f')],_0xbb5cae[_0xe824('0x30')]);_0xa09c8b[_0xe824('0x34')]=_[_0xe824('0x32')](_0xbb5cae[_0xe824('0x2f')],qs[_0xe824('0x33')](_0xc0f0f5[_0xe824('0x30')][_0xe824('0x33')]));_0xa09c8b[_0xe824('0x34')]=_0xa09c8b[_0xe824('0x34')][_0xe824('0x35')]?_0xa09c8b[_0xe824('0x34')]:_0xbb5cae[_0xe824('0x2f')];if(_0xc0f0f5[_0xe824('0x30')][_0xe824('0x3f')]){_0xa09c8b[_0xe824('0x46')]=[{'all':!![]}];}_0xa09c8b=_['merge']({},_0xa09c8b,_0xc0f0f5[_0xe824('0x3e')]);return db[_0xe824('0x2c')][_0xe824('0x47')](_0xa09c8b)[_0xe824('0x24')](handleEntityNotFound(_0x36b300,null))[_0xe824('0x24')](respondWithResult(_0x36b300,null))[_0xe824('0x42')](handleError(_0x36b300,null));};exports[_0xe824('0x48')]=function(_0x4a5348,_0x257180){return db['SalesforceAccount'][_0xe824('0x48')](_0x4a5348[_0xe824('0x49')],{})[_0xe824('0x24')](respondWithResult(_0x257180,0xc9))[_0xe824('0x42')](handleError(_0x257180,null));};exports[_0xe824('0x23')]=function(_0x128a81,_0x4aa30b){if(_0x128a81[_0xe824('0x49')]['id']){delete _0x128a81[_0xe824('0x49')]['id'];}return db[_0xe824('0x2c')][_0xe824('0x47')]({'where':{'id':_0x128a81[_0xe824('0x4a')]['id']}})[_0xe824('0x24')](handleEntityNotFound(_0x4aa30b,null))[_0xe824('0x24')](saveUpdates(_0x128a81[_0xe824('0x49')],null))[_0xe824('0x24')](respondWithResult(_0x4aa30b,null))[_0xe824('0x42')](handleError(_0x4aa30b,null));};exports[_0xe824('0x25')]=function(_0xc6bd17,_0x2d8ec9){return db[_0xe824('0x2c')][_0xe824('0x47')]({'where':{'id':_0xc6bd17[_0xe824('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d8ec9,null))[_0xe824('0x24')](removeEntity(_0x2d8ec9,null))[_0xe824('0x42')](handleError(_0x2d8ec9,null));};exports[_0xe824('0x4b')]=function(_0x45c94d,_0x5759f7,_0x4d6045){var _0xf2c50={};var _0x4acbab={};var _0x1b2f05;var _0x1224b2;return db[_0xe824('0x2c')]['findOne']({'where':{'id':_0x45c94d['params']['id']}})['then'](handleEntityNotFound(_0x5759f7,null))[_0xe824('0x24')](function(_0x34b2fe){if(_0x34b2fe){_0x1b2f05=_0x34b2fe;_0x4acbab[_0xe824('0x2f')]=_[_0xe824('0x44')](db[_0xe824('0x4c')]['rawAttributes']);_0x4acbab[_0xe824('0x30')]=_[_0xe824('0x44')](_0x45c94d['query']);_0x4acbab['filters']=_[_0xe824('0x32')](_0x4acbab['model'],_0x4acbab[_0xe824('0x30')]);_0xf2c50[_0xe824('0x34')]=_['intersection'](_0x4acbab[_0xe824('0x2f')],qs[_0xe824('0x33')](_0x45c94d['query']['fields']));_0xf2c50[_0xe824('0x34')]=_0xf2c50['attributes'][_0xe824('0x35')]?_0xf2c50['attributes']:_0x4acbab[_0xe824('0x2f')];_0xf2c50['order']=qs[_0xe824('0x39')](_0x45c94d[_0xe824('0x30')][_0xe824('0x39')]);_0xf2c50[_0xe824('0x3a')]=qs[_0xe824('0x31')](_[_0xe824('0x4d')](_0x45c94d['query'],_0x4acbab[_0xe824('0x31')]));if(_0x45c94d[_0xe824('0x30')][_0xe824('0x3d')]){_0xf2c50[_0xe824('0x3a')]=_['merge'](_0xf2c50[_0xe824('0x3a')],{'$or':_[_0xe824('0x2b')](_0xf2c50[_0xe824('0x34')],function(_0x40c858){var _0x4f12f3={};_0x4f12f3[_0x40c858]={'$like':'%'+_0x45c94d[_0xe824('0x30')][_0xe824('0x3d')]+'%'};return _0x4f12f3;})});}_0xf2c50=_[_0xe824('0x3b')]({},_0xf2c50,_0x45c94d[_0xe824('0x3e')]);return _0x1b2f05[_0xe824('0x4b')](_0xf2c50);}})[_0xe824('0x24')](function(_0x14b104){if(_0x14b104){_0x1224b2=_0x14b104[_0xe824('0x35')];if(!_0x45c94d['query'][_0xe824('0x36')](_0xe824('0x37'))){_0xf2c50['limit']=qs[_0xe824('0x1d')](_0x45c94d[_0xe824('0x30')][_0xe824('0x1d')]);_0xf2c50[_0xe824('0x1f')]=qs[_0xe824('0x1f')](_0x45c94d[_0xe824('0x30')]['offset']);}return _0x1b2f05[_0xe824('0x4b')](_0xf2c50);}})[_0xe824('0x24')](function(_0x100aff){if(_0x100aff){return _0x100aff?{'count':_0x1224b2,'rows':_0x100aff}:null;}})[_0xe824('0x24')](respondWithResult(_0x5759f7,null))['catch'](handleError(_0x5759f7,null));};exports[_0xe824('0x4e')]=function(_0x29b3ef,_0x1f392d,_0x3d4c41){if(_0x29b3ef[_0xe824('0x49')]['id']){delete _0x29b3ef[_0xe824('0x49')]['id'];}return db[_0xe824('0x2c')][_0xe824('0x4f')]({'where':{'id':_0x29b3ef['params']['id']}})['then'](handleEntityNotFound(_0x1f392d,null))[_0xe824('0x24')](function(_0x5b0eee){if(_0x5b0eee){_0x29b3ef['body'][_0xe824('0x50')]=_0x5b0eee['id'];_0x29b3ef[_0xe824('0x49')][_0xe824('0x51')]=integrations[_0xe824('0x52')](_0x29b3ef[_0xe824('0x49')]['channel'],_0x29b3ef[_0xe824('0x49')][_0xe824('0x2d')]);_0x29b3ef['body'][_0xe824('0x53')]=integrations['getDescriptions'](_0x29b3ef[_0xe824('0x49')]['channel'],_0x29b3ef[_0xe824('0x49')][_0xe824('0x2d')]);return db[_0xe824('0x4c')][_0xe824('0x48')](_0x29b3ef['body'],{'include':[{'model':db[_0xe824('0x54')],'as':'Subjects'},{'model':db[_0xe824('0x54')],'as':'Descriptions'}]});}return null;})[_0xe824('0x24')](respondWithResult(_0x1f392d,null))[_0xe824('0x42')](handleError(_0x1f392d,null));};exports['getFields']=function(_0x116429,_0x4ee88c,_0x87bbdb){var _0x1bc5b9;var _0x4ab1b3='';var _0x587241=_0xe824('0x55');return db[_0xe824('0x2c')][_0xe824('0x4f')]({'where':{'id':_0x116429[_0xe824('0x4a')]['id']},'attributes':['id','remoteUri',_0xe824('0x56'),_0xe824('0x57'),_0xe824('0x58'),_0xe824('0x59'),_0xe824('0x5a')]})[_0xe824('0x24')](handleEntityNotFound(_0x4ee88c,null))[_0xe824('0x24')](function(_0x2d9ba6){if(_0x2d9ba6){_0x4ab1b3=_0x2d9ba6[_0xe824('0x5b')];var _0x1283a6=_0x4ab1b3[_0xe824('0x5c')](-0x1);if(_0x1283a6==='/'){_0x4ab1b3=_0x4ab1b3['substring'](0x0,_0x4ab1b3[_0xe824('0x5d')](_0x1283a6));}_0x1bc5b9=new jsforce[(_0xe824('0x5e'))]({'oauth2':{'loginUrl':_0x4ab1b3,'clientId':_0x2d9ba6[_0xe824('0x56')],'clientSecret':_0x2d9ba6[_0xe824('0x57')]}});return _0x1bc5b9['login'](_0x2d9ba6[_0xe824('0x58')],_0x2d9ba6['password'][_0xe824('0x5f')](_0x2d9ba6[_0xe824('0x5a')]));}})[_0xe824('0x24')](function(_0xf42ea1){if(_0xf42ea1){if(!_[_0xe824('0x60')](_0x116429[_0xe824('0x30')][_0xe824('0x61')])){_0x587241=_0x116429[_0xe824('0x30')][_0xe824('0x61')];}return _0x1bc5b9[_0xe824('0x62')](_0x587241)[_0xe824('0x63')]();}})['then'](function(_0x36bd99){var _0x383558=[_0xe824('0x64'),_0xe824('0x65'),'IsReminderSet',_0xe824('0x66'),_0xe824('0x67'),'Description'];var _0x5be038=[_0xe824('0x68'),'int',_0xe824('0x69'),'boolean',_0xe824('0x6a'),'textarea','phone'];if(_0x36bd99){_[_0xe824('0x6b')](_0x36bd99[_0xe824('0x33')],function(_0xdb93e7){return _0x383558[_0xe824('0x6c')](_0xdb93e7['name'])||!_0x5be038['includes'](_0xdb93e7['type']);});return{'count':_0x36bd99[_0xe824('0x33')][_0xe824('0x35')],'rows':_[_0xe824('0x2b')](_0x36bd99[_0xe824('0x33')],function(_0x26cbaa){return{'id':_0x26cbaa[_0xe824('0x29')],'name':_0x26cbaa[_0xe824('0x6d')],'custom':_0x26cbaa[_0xe824('0x6e')],'options':_0x26cbaa['picklistValues'][_0xe824('0x35')]>0x0?_[_0xe824('0x2b')](_0x26cbaa[_0xe824('0x6f')],function(_0x333650){return{'name':_0x333650['label'],'value':_0x333650['value']};}):_0x26cbaa[_0xe824('0x2d')]=='boolean'?[{'name':_0xe824('0x70'),'value':'true'},{'name':_0xe824('0x71'),'value':_0xe824('0x72')}]:[]};})};}})['then'](respondWithResult(_0x4ee88c,null))[_0xe824('0x42')](function(_0x37eb4d){var _0x55cca1=_0x116429['query']['test']?0x1f4:_0x37eb4d['statusCode']||0x1f4;logger[_0xe824('0x27')](_0xe824('0x73'),'getFields',_0x55cca1,JSON[_0xe824('0x74')](_0x37eb4d));delete _0x37eb4d[_0xe824('0x29')];if(_0x55cca1===0x191){_0x55cca1=0x190;}_0x4ee88c['status'](_0x55cca1)['send'](_0x116429[_0xe824('0x30')][_0xe824('0x75')]?{'message':_0xe824('0x76'),'statusCode':_0x37eb4d[_0xe824('0x77')]}:_0x37eb4d);});};
\ No newline at end of file
+var _0xe33a=['end','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','getConfigurations','findOne','keys','SalesforceConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','isNil','ticketType','sobject','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','textarea','includes','label','custom','picklistValues','value','boolean','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xe77e6,_0x345c7c){var _0x188e2a=function(_0xe7abdb){while(--_0xe7abdb){_0xe77e6['push'](_0xe77e6['shift']());}};_0x188e2a(++_0x345c7c);}(_0xe33a,0x158));var _0xae33=function(_0xf95c3f,_0x141f04){_0xf95c3f=_0xf95c3f-0x0;var _0x2fa879=_0xe33a[_0xf95c3f];return _0x2fa879;};'use strict';var emlformat=require(_0xae33('0x0'));var rimraf=require(_0xae33('0x1'));var zipdir=require(_0xae33('0x2'));var jsonpatch=require(_0xae33('0x3'));var rp=require(_0xae33('0x4'));var moment=require(_0xae33('0x5'));var BPromise=require(_0xae33('0x6'));var Mustache=require(_0xae33('0x7'));var util=require('util');var path=require('path');var sox=require(_0xae33('0x8'));var csv=require('to-csv');var ejs=require(_0xae33('0x9'));var fs=require('fs');var fs_extra=require(_0xae33('0xa'));var _=require(_0xae33('0xb'));var squel=require(_0xae33('0xc'));var crypto=require('crypto');var jsforce=require(_0xae33('0xd'));var deskjs=require(_0xae33('0xe'));var toCsv=require(_0xae33('0xf'));var querystring=require(_0xae33('0x10'));var Papa=require(_0xae33('0x11'));var Redis=require('ioredis');var authService=require(_0xae33('0x12'));var qs=require(_0xae33('0x13'));var as=require(_0xae33('0x14'));var hardwareService=require(_0xae33('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xae33('0x16'));var config=require(_0xae33('0x17'));var licenseUtil=require(_0xae33('0x18'));var db=require(_0xae33('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16559b,_0x20ed0c){_0x20ed0c=_0x20ed0c||0xcc;return function(_0xaa55be){if(_0xaa55be){return _0x16559b[_0xae33('0x1a')](_0x20ed0c);}return _0x16559b[_0xae33('0x1b')](_0x20ed0c)[_0xae33('0x1c')]();};}function respondWithResult(_0x113225,_0x3e88f4){_0x3e88f4=_0x3e88f4||0xc8;return function(_0x479d47){if(_0x479d47){return _0x113225[_0xae33('0x1b')](_0x3e88f4)['json'](_0x479d47);}};}function respondWithFilteredResult(_0x240ba9,_0x24a7e1){return function(_0x109f6f){if(_0x109f6f){var _0x14cac4=typeof _0x24a7e1[_0xae33('0x1d')]===_0xae33('0x1e')&&typeof _0x24a7e1[_0xae33('0x1f')]===_0xae33('0x1e');var _0x35f6d4=_0x109f6f['count'];var _0x26a897=_0x14cac4?0x0:_0x24a7e1['offset'];var _0x5f5407=_0x14cac4?_0x109f6f['count']:_0x24a7e1[_0xae33('0x1d')]+_0x24a7e1[_0xae33('0x1f')];var _0x2147c8;if(_0x5f5407>=_0x35f6d4){_0x5f5407=_0x35f6d4;_0x2147c8=0xc8;}else{_0x2147c8=0xce;}_0x240ba9[_0xae33('0x1b')](_0x2147c8);return _0x240ba9[_0xae33('0x20')](_0xae33('0x21'),_0x26a897+'-'+_0x5f5407+'/'+_0x35f6d4)['json'](_0x109f6f);}return null;};}function patchUpdates(_0x5abea6){return function(_0x13aefc){try{jsonpatch[_0xae33('0x22')](_0x13aefc,_0x5abea6,!![]);}catch(_0x410dd0){return BPromise[_0xae33('0x23')](_0x410dd0);}return _0x13aefc[_0xae33('0x24')]();};}function saveUpdates(_0x21fb86,_0x1cfe1b){return function(_0x2f5a7b){if(_0x2f5a7b){return _0x2f5a7b[_0xae33('0x25')](_0x21fb86)[_0xae33('0x26')](function(_0x1ab26b){return _0x1ab26b;});}return null;};}function removeEntity(_0x5cd45b,_0x429e8f){return function(_0x3f533a){if(_0x3f533a){return _0x3f533a[_0xae33('0x27')]()['then'](function(){_0x5cd45b[_0xae33('0x1b')](0xcc)[_0xae33('0x1c')]();});}};}function handleEntityNotFound(_0x574bcd,_0x36f243){return function(_0x1f169f){if(!_0x1f169f){_0x574bcd[_0xae33('0x1a')](0x194);}return _0x1f169f;};}function handleError(_0x2c6fb7,_0xd5d97d){_0xd5d97d=_0xd5d97d||0x1f4;return function(_0x19effe){logger[_0xae33('0x28')](_0x19effe[_0xae33('0x29')]);if(_0x19effe[_0xae33('0x2a')]){delete _0x19effe[_0xae33('0x2a')];}_0x2c6fb7['status'](_0xd5d97d)[_0xae33('0x2b')](_0x19effe);};}exports[_0xae33('0x2c')]=function(_0x15c365,_0x5b276e){var _0x3803ac={},_0x3bd543={},_0x2e27a3={'count':0x0,'rows':[]};var _0x215e72=_['map'](db[_0xae33('0x2d')]['rawAttributes'],function(_0x40e338){return{'name':_0x40e338[_0xae33('0x2e')],'type':_0x40e338[_0xae33('0x2f')][_0xae33('0x30')]};});_0x3bd543[_0xae33('0x31')]=_['map'](_0x215e72,_0xae33('0x2a'));_0x3bd543[_0xae33('0x32')]=_['keys'](_0x15c365[_0xae33('0x32')]);_0x3bd543[_0xae33('0x33')]=_[_0xae33('0x34')](_0x3bd543[_0xae33('0x31')],_0x3bd543[_0xae33('0x32')]);_0x3803ac[_0xae33('0x35')]=_[_0xae33('0x34')](_0x3bd543[_0xae33('0x31')],qs[_0xae33('0x36')](_0x15c365['query'][_0xae33('0x36')]));_0x3803ac[_0xae33('0x35')]=_0x3803ac[_0xae33('0x35')]['length']?_0x3803ac[_0xae33('0x35')]:_0x3bd543['model'];if(!_0x15c365[_0xae33('0x32')][_0xae33('0x37')]('nolimit')){_0x3803ac[_0xae33('0x1f')]=qs['limit'](_0x15c365[_0xae33('0x32')]['limit']);_0x3803ac[_0xae33('0x1d')]=qs[_0xae33('0x1d')](_0x15c365[_0xae33('0x32')][_0xae33('0x1d')]);}_0x3803ac[_0xae33('0x38')]=qs[_0xae33('0x39')](_0x15c365[_0xae33('0x32')][_0xae33('0x39')]);_0x3803ac[_0xae33('0x3a')]=qs[_0xae33('0x33')](_[_0xae33('0x3b')](_0x15c365[_0xae33('0x32')],_0x3bd543[_0xae33('0x33')]),_0x215e72);if(_0x15c365[_0xae33('0x32')][_0xae33('0x3c')]){_0x3803ac[_0xae33('0x3a')]=_[_0xae33('0x3d')](_0x3803ac['where'],{'$or':_[_0xae33('0x3e')](_0x215e72,function(_0x554587){if(_0x554587[_0xae33('0x2f')]!==_0xae33('0x3f')){var _0x57370b={};_0x57370b[_0x554587[_0xae33('0x2a')]]={'$like':'%'+_0x15c365[_0xae33('0x32')][_0xae33('0x3c')]+'%'};return _0x57370b;}})});}_0x3803ac=_[_0xae33('0x3d')]({},_0x3803ac,_0x15c365[_0xae33('0x40')]);var _0x1854e6={'where':_0x3803ac['where']};return db[_0xae33('0x2d')][_0xae33('0x41')](_0x1854e6)['then'](function(_0x58d41f){_0x2e27a3['count']=_0x58d41f;if(_0x15c365[_0xae33('0x32')][_0xae33('0x42')]){_0x3803ac[_0xae33('0x43')]=[{'all':!![]}];}return db['SalesforceAccount']['findAll'](_0x3803ac);})[_0xae33('0x26')](function(_0xa4b37b){_0x2e27a3[_0xae33('0x44')]=_0xa4b37b;return _0x2e27a3;})['then'](respondWithFilteredResult(_0x5b276e,_0x3803ac))[_0xae33('0x45')](handleError(_0x5b276e,null));};exports[_0xae33('0x46')]=function(_0x21d73f,_0x370557){var _0x6c1648={'raw':![],'where':{'id':_0x21d73f[_0xae33('0x47')]['id']}},_0x43330e={};_0x43330e[_0xae33('0x31')]=_['keys'](db[_0xae33('0x2d')][_0xae33('0x48')]);_0x43330e[_0xae33('0x32')]=_['keys'](_0x21d73f['query']);_0x43330e[_0xae33('0x33')]=_[_0xae33('0x34')](_0x43330e[_0xae33('0x31')],_0x43330e[_0xae33('0x32')]);_0x6c1648[_0xae33('0x35')]=_[_0xae33('0x34')](_0x43330e[_0xae33('0x31')],qs[_0xae33('0x36')](_0x21d73f[_0xae33('0x32')]['fields']));_0x6c1648[_0xae33('0x35')]=_0x6c1648['attributes'][_0xae33('0x49')]?_0x6c1648[_0xae33('0x35')]:_0x43330e[_0xae33('0x31')];if(_0x21d73f[_0xae33('0x32')]['includeAll']){_0x6c1648[_0xae33('0x43')]=[{'all':!![]}];}_0x6c1648=_[_0xae33('0x3d')]({},_0x6c1648,_0x21d73f[_0xae33('0x40')]);return db[_0xae33('0x2d')][_0xae33('0x4a')](_0x6c1648)[_0xae33('0x26')](handleEntityNotFound(_0x370557,null))[_0xae33('0x26')](respondWithResult(_0x370557,null))[_0xae33('0x45')](handleError(_0x370557,null));};exports[_0xae33('0x4b')]=function(_0x1e9f0c,_0x376ec4){return db['SalesforceAccount']['create'](_0x1e9f0c['body'],{})[_0xae33('0x26')](respondWithResult(_0x376ec4,0xc9))[_0xae33('0x45')](handleError(_0x376ec4,null));};exports[_0xae33('0x25')]=function(_0x1c5820,_0x328243){if(_0x1c5820['body']['id']){delete _0x1c5820['body']['id'];}return db[_0xae33('0x2d')][_0xae33('0x4a')]({'where':{'id':_0x1c5820['params']['id']}})[_0xae33('0x26')](handleEntityNotFound(_0x328243,null))[_0xae33('0x26')](saveUpdates(_0x1c5820[_0xae33('0x4c')],null))[_0xae33('0x26')](respondWithResult(_0x328243,null))[_0xae33('0x45')](handleError(_0x328243,null));};exports[_0xae33('0x27')]=function(_0x1107f8,_0xe55a18){return db['SalesforceAccount']['find']({'where':{'id':_0x1107f8[_0xae33('0x47')]['id']}})[_0xae33('0x26')](handleEntityNotFound(_0xe55a18,null))['then'](removeEntity(_0xe55a18,null))[_0xae33('0x45')](handleError(_0xe55a18,null));};exports[_0xae33('0x4d')]=function(_0x1c0cc8,_0x45d748,_0xb14d11){var _0x14f834={};var _0x1da585={};var _0x3c5930;var _0x22ec95;return db[_0xae33('0x2d')][_0xae33('0x4e')]({'where':{'id':_0x1c0cc8[_0xae33('0x47')]['id']}})[_0xae33('0x26')](handleEntityNotFound(_0x45d748,null))[_0xae33('0x26')](function(_0x2a05eb){if(_0x2a05eb){_0x3c5930=_0x2a05eb;_0x1da585['model']=_[_0xae33('0x4f')](db[_0xae33('0x50')][_0xae33('0x48')]);_0x1da585[_0xae33('0x32')]=_['keys'](_0x1c0cc8[_0xae33('0x32')]);_0x1da585[_0xae33('0x33')]=_[_0xae33('0x34')](_0x1da585['model'],_0x1da585['query']);_0x14f834[_0xae33('0x35')]=_['intersection'](_0x1da585['model'],qs[_0xae33('0x36')](_0x1c0cc8[_0xae33('0x32')][_0xae33('0x36')]));_0x14f834['attributes']=_0x14f834['attributes']['length']?_0x14f834[_0xae33('0x35')]:_0x1da585['model'];_0x14f834['order']=qs[_0xae33('0x39')](_0x1c0cc8[_0xae33('0x32')][_0xae33('0x39')]);_0x14f834[_0xae33('0x3a')]=qs[_0xae33('0x33')](_['pick'](_0x1c0cc8['query'],_0x1da585[_0xae33('0x33')]));if(_0x1c0cc8['query'][_0xae33('0x3c')]){_0x14f834[_0xae33('0x3a')]=_[_0xae33('0x3d')](_0x14f834[_0xae33('0x3a')],{'$or':_[_0xae33('0x3e')](_0x14f834[_0xae33('0x35')],function(_0x3b8cf0){var _0x4bb4c3={};_0x4bb4c3[_0x3b8cf0]={'$like':'%'+_0x1c0cc8[_0xae33('0x32')][_0xae33('0x3c')]+'%'};return _0x4bb4c3;})});}_0x14f834=_[_0xae33('0x3d')]({},_0x14f834,_0x1c0cc8[_0xae33('0x40')]);return _0x3c5930[_0xae33('0x4d')](_0x14f834);}})[_0xae33('0x26')](function(_0x14881f){if(_0x14881f){_0x22ec95=_0x14881f['length'];if(!_0x1c0cc8[_0xae33('0x32')][_0xae33('0x37')](_0xae33('0x51'))){_0x14f834[_0xae33('0x1f')]=qs[_0xae33('0x1f')](_0x1c0cc8[_0xae33('0x32')][_0xae33('0x1f')]);_0x14f834['offset']=qs[_0xae33('0x1d')](_0x1c0cc8[_0xae33('0x32')]['offset']);}return _0x3c5930[_0xae33('0x4d')](_0x14f834);}})[_0xae33('0x26')](function(_0x4bb4f5){if(_0x4bb4f5){return _0x4bb4f5?{'count':_0x22ec95,'rows':_0x4bb4f5}:null;}})[_0xae33('0x26')](respondWithResult(_0x45d748,null))[_0xae33('0x45')](handleError(_0x45d748,null));};exports['addConfiguration']=function(_0x1a3dd2,_0x2ed669,_0x2d424c){if(_0x1a3dd2[_0xae33('0x4c')]['id']){delete _0x1a3dd2['body']['id'];}return db['SalesforceAccount'][_0xae33('0x4e')]({'where':{'id':_0x1a3dd2[_0xae33('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ed669,null))['then'](function(_0x5f4ff9){if(_0x5f4ff9){_0x1a3dd2[_0xae33('0x4c')][_0xae33('0x52')]=_0x5f4ff9['id'];_0x1a3dd2[_0xae33('0x4c')][_0xae33('0x53')]=integrations[_0xae33('0x54')](_0x1a3dd2[_0xae33('0x4c')][_0xae33('0x55')],_0x1a3dd2[_0xae33('0x4c')][_0xae33('0x2f')]);_0x1a3dd2['body']['Descriptions']=integrations[_0xae33('0x56')](_0x1a3dd2[_0xae33('0x4c')]['channel'],_0x1a3dd2[_0xae33('0x4c')]['type']);return db[_0xae33('0x50')][_0xae33('0x4b')](_0x1a3dd2[_0xae33('0x4c')],{'include':[{'model':db['SalesforceField'],'as':_0xae33('0x53')},{'model':db[_0xae33('0x57')],'as':_0xae33('0x58')}]});}return null;})['then'](respondWithResult(_0x2ed669,null))['catch'](handleError(_0x2ed669,null));};exports[_0xae33('0x59')]=function(_0x2bc999,_0x514150,_0xc8d5ca){var _0x28f48f;var _0x148e1a='';var _0xaf5473=_0xae33('0x5a');return db[_0xae33('0x2d')][_0xae33('0x4e')]({'where':{'id':_0x2bc999[_0xae33('0x47')]['id']},'attributes':['id',_0xae33('0x5b'),_0xae33('0x5c'),_0xae33('0x5d'),_0xae33('0x5e'),_0xae33('0x5f'),_0xae33('0x60')]})['then'](handleEntityNotFound(_0x514150,null))[_0xae33('0x26')](function(_0x439c11){if(_0x439c11){_0x148e1a=_0x439c11[_0xae33('0x5b')];var _0x512809=_0x148e1a['slice'](-0x1);if(_0x512809==='/'){_0x148e1a=_0x148e1a[_0xae33('0x61')](0x0,_0x148e1a[_0xae33('0x62')](_0x512809));}_0x28f48f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x148e1a,'clientId':_0x439c11[_0xae33('0x5c')],'clientSecret':_0x439c11['clientSecret']}});return _0x28f48f['login'](_0x439c11[_0xae33('0x5e')],_0x439c11[_0xae33('0x5f')]['concat'](_0x439c11['securityToken']));}})[_0xae33('0x26')](function(_0x1a10c1){if(_0x1a10c1){if(!_[_0xae33('0x63')](_0x2bc999[_0xae33('0x32')][_0xae33('0x64')])){_0xaf5473=_0x2bc999['query'][_0xae33('0x64')];}return _0x28f48f[_0xae33('0x65')](_0xaf5473)['describe']();}})['then'](function(_0x2c96e2){var _0xb6c93d=[_0xae33('0x66'),'ActivityDate',_0xae33('0x67'),_0xae33('0x68'),_0xae33('0x69'),_0xae33('0x6a')];var _0x221af2=[_0xae33('0x6b'),_0xae33('0x6c'),_0xae33('0x6d'),'boolean','email',_0xae33('0x6e'),'phone'];if(_0x2c96e2){_['remove'](_0x2c96e2[_0xae33('0x36')],function(_0x21ff40){return _0xb6c93d[_0xae33('0x6f')](_0x21ff40['name'])||!_0x221af2['includes'](_0x21ff40[_0xae33('0x2f')]);});return{'count':_0x2c96e2[_0xae33('0x36')]['length'],'rows':_['map'](_0x2c96e2[_0xae33('0x36')],function(_0x50ae2b){return{'id':_0x50ae2b[_0xae33('0x2a')],'name':_0x50ae2b[_0xae33('0x70')],'custom':_0x50ae2b[_0xae33('0x71')],'options':_0x50ae2b['picklistValues'][_0xae33('0x49')]>0x0?_[_0xae33('0x3e')](_0x50ae2b[_0xae33('0x72')],function(_0x40ccea){return{'name':_0x40ccea[_0xae33('0x70')],'value':_0x40ccea[_0xae33('0x73')]};}):_0x50ae2b[_0xae33('0x2f')]==_0xae33('0x74')?[{'name':_0xae33('0x75'),'value':'true'},{'name':_0xae33('0x76'),'value':_0xae33('0x77')}]:[]};})};}})[_0xae33('0x26')](respondWithResult(_0x514150,null))['catch'](function(_0x3456e6){var _0x1ae309=_0x2bc999[_0xae33('0x32')][_0xae33('0x78')]?0x1f4:_0x3456e6[_0xae33('0x79')]||0x1f4;logger[_0xae33('0x28')](_0xae33('0x7a'),'getFields',_0x1ae309,JSON['stringify'](_0x3456e6));delete _0x3456e6[_0xae33('0x2a')];if(_0x1ae309===0x191){_0x1ae309=0x190;}_0x514150[_0xae33('0x1b')](_0x1ae309)['send'](_0x2bc999['query'][_0xae33('0x78')]?{'message':_0xae33('0x7b'),'statusCode':_0x3456e6['statusCode']}:_0x3456e6);});};
\ No newline at end of file
index 942e788..db8bc86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af9=['exports','define','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x1e2ee8,_0x51bb43){var _0x1134b5=function(_0x1fec42){while(--_0x1fec42){_0x1e2ee8['push'](_0x1e2ee8['shift']());}};_0x1134b5(++_0x51bb43);}(_0x0af9,0xb9));var _0x90af=function(_0x41c9fe,_0x12c7e4){_0x41c9fe=_0x41c9fe-0x0;var _0x146d93=_0x0af9[_0x41c9fe];return _0x146d93;};'use strict';var _=require(_0x90af('0x0'));var util=require(_0x90af('0x1'));var logger=require(_0x90af('0x2'))(_0x90af('0x3'));var moment=require('moment');var BPromise=require(_0x90af('0x4'));var rp=require(_0x90af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90af('0x6'));var config=require(_0x90af('0x7'));var attributes=require(_0x90af('0x8'));var integrations=require(_0x90af('0x9'));module[_0x90af('0xa')]=function(_0x29a4c7,_0xec8217){return _0x29a4c7[_0x90af('0xb')]('SalesforceAccount',attributes,{'tableName':_0x90af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x18ca=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x64b24a,_0x46fcea){var _0x2c466f=function(_0x3130b6){while(--_0x3130b6){_0x64b24a['push'](_0x64b24a['shift']());}};_0x2c466f(++_0x46fcea);}(_0x18ca,0x6e));var _0xa18c=function(_0x262483,_0xf841e4){_0x262483=_0x262483-0x0;var _0x54604e=_0x18ca[_0x262483];return _0x54604e;};'use strict';var _=require(_0xa18c('0x0'));var util=require(_0xa18c('0x1'));var logger=require(_0xa18c('0x2'))(_0xa18c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa18c('0x4'));var fs=require('fs');var path=require(_0xa18c('0x5'));var rimraf=require(_0xa18c('0x6'));var config=require(_0xa18c('0x7'));var attributes=require(_0xa18c('0x8'));var integrations=require(_0xa18c('0x9'));module[_0xa18c('0xa')]=function(_0x1f6031,_0x376477){return _0x1f6031[_0xa18c('0xb')](_0xa18c('0xc'),attributes,{'tableName':_0xa18c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3cce495..f7a4ad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bae=['attributes','limit','include','map','model','GetSalesforceAccount','debug','catch','ShowSalesforceAccount','where','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','SalesforceAccount','findAll','options','raw'];(function(_0xea9b1d,_0x422a8d){var _0x2a2ee6=function(_0x2a09a4){while(--_0x2a09a4){_0xea9b1d['push'](_0xea9b1d['shift']());}};_0x2a2ee6(++_0x422a8d);}(_0x2bae,0xe2));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xe2ba('0x3'));var fs=require('fs');var Redis=require(_0xe2ba('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2ba('0x5'));var logger=require(_0xe2ba('0x6'))(_0xe2ba('0x7'));var config=require(_0xe2ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe2ba('0x9')][_0xe2ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35ec31,_0x5a8154,_0x3a6bfd){return new BPromise(function(_0x2409b,_0x608b0f){return client[_0xe2ba('0xb')](_0x35ec31,_0x3a6bfd)[_0xe2ba('0xc')](function(_0x3ab464){logger[_0xe2ba('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));logger['debug'](_0xe2ba('0xf'),_0x5a8154,_0xe2ba('0xe'),JSON[_0xe2ba('0x10')](_0x3ab464));if(_0x3ab464[_0xe2ba('0x11')]){if(_0x3ab464[_0xe2ba('0x11')][_0xe2ba('0x12')]===0x1f4){logger[_0xe2ba('0x11')](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error'][_0xe2ba('0x14')]);return _0x608b0f(_0x3ab464[_0xe2ba('0x11')]['message']);}logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x3ab464['error']['message']);return _0x2409b(_0x3ab464['error'][_0xe2ba('0x14')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x5a8154,_0xe2ba('0xe'));_0x2409b(_0x3ab464[_0xe2ba('0x15')][_0xe2ba('0x14')]);}})['catch'](function(_0x29c4f6){logger['error'](_0xe2ba('0x13'),_0x5a8154,_0x29c4f6);_0x608b0f(_0x29c4f6);});});}exports['GetSalesforceAccount']=function(_0x337454){var _0x2ef082=this;return new Promise(function(_0x526667,_0x472c03){return db[_0xe2ba('0x16')][_0xe2ba('0x17')]({'raw':_0x337454[_0xe2ba('0x18')]?_0x337454['options'][_0xe2ba('0x19')]===undefined?!![]:![]:!![],'where':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')]['where']||null:null,'attributes':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')][_0xe2ba('0x1a')]||null:null,'limit':_0x337454[_0xe2ba('0x18')]?_0x337454[_0xe2ba('0x18')][_0xe2ba('0x1b')]||null:null,'include':_0x337454[_0xe2ba('0x18')]?_0x337454['options'][_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x337454['options'][_0xe2ba('0x1c')],function(_0x1df864){return{'model':db[_0x1df864[_0xe2ba('0x1e')]],'as':_0x1df864['as'],'attributes':_0x1df864[_0xe2ba('0x1a')],'include':_0x1df864[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x1df864['include'],function(_0x4ec4f7){return{'model':db[_0x4ec4f7[_0xe2ba('0x1e')]],'as':_0x4ec4f7['as'],'attributes':_0x4ec4f7[_0xe2ba('0x1a')],'include':_0x4ec4f7[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x4ec4f7[_0xe2ba('0x1c')],function(_0x5d88c7){return{'model':db[_0x5d88c7[_0xe2ba('0x1e')]],'as':_0x5d88c7['as'],'attributes':_0x5d88c7[_0xe2ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2ba('0xc')](function(_0x59b99a){logger[_0xe2ba('0xd')](_0xe2ba('0x1f'),_0x337454);logger[_0xe2ba('0x20')](_0xe2ba('0x1f'),_0x337454,JSON[_0xe2ba('0x10')](_0x59b99a));_0x526667(_0x59b99a);})[_0xe2ba('0x21')](function(_0x3535bf){logger['error'](_0xe2ba('0x1f'),_0x3535bf[_0xe2ba('0x14')],_0x337454);_0x472c03(_0x2ef082[_0xe2ba('0x11')](0x1f4,_0x3535bf['message']));});});};exports[_0xe2ba('0x22')]=function(_0x145e5e){var _0x389e3c=this;return new Promise(function(_0x240cdd,_0xa1f582){return db[_0xe2ba('0x16')]['find']({'raw':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')][_0xe2ba('0x23')]||null:null,'attributes':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e['options'][_0xe2ba('0x1a')]||null:null,'include':_0x145e5e[_0xe2ba('0x18')]?_0x145e5e[_0xe2ba('0x18')][_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x145e5e[_0xe2ba('0x18')]['include'],function(_0x1509be){return{'model':db[_0x1509be[_0xe2ba('0x1e')]],'as':_0x1509be['as'],'attributes':_0x1509be[_0xe2ba('0x1a')],'include':_0x1509be[_0xe2ba('0x1c')]?_['map'](_0x1509be['include'],function(_0x291f41){return{'model':db[_0x291f41[_0xe2ba('0x1e')]],'as':_0x291f41['as'],'attributes':_0x291f41[_0xe2ba('0x1a')],'include':_0x291f41[_0xe2ba('0x1c')]?_[_0xe2ba('0x1d')](_0x291f41[_0xe2ba('0x1c')],function(_0x4d4c39){return{'model':db[_0x4d4c39[_0xe2ba('0x1e')]],'as':_0x4d4c39['as'],'attributes':_0x4d4c39[_0xe2ba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe2ba('0xc')](function(_0x5443bf){logger[_0xe2ba('0xd')](_0xe2ba('0x22'),_0x145e5e);logger[_0xe2ba('0x20')]('ShowSalesforceAccount',_0x145e5e,JSON[_0xe2ba('0x10')](_0x5443bf));_0x240cdd(_0x5443bf);})[_0xe2ba('0x21')](function(_0x5e8272){logger[_0xe2ba('0x11')](_0xe2ba('0x22'),_0x5e8272['message'],_0x145e5e);_0xa1f582(_0x389e3c[_0xe2ba('0x11')](0x1f4,_0x5e8272[_0xe2ba('0x14')]));});});};
\ No newline at end of file
+var _0xa673=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x46361e,_0x243aaf){var _0x14e302=function(_0x9ebecf){while(--_0x9ebecf){_0x46361e['push'](_0x46361e['shift']());}};_0x14e302(++_0x243aaf);}(_0xa673,0x17b));var _0x3a67=function(_0x7f9916,_0xc73c04){_0x7f9916=_0x7f9916-0x0;var _0x3294ac=_0xa673[_0x7f9916];return _0x3294ac;};'use strict';var _=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var moment=require(_0x3a67('0x2'));var BPromise=require(_0x3a67('0x3'));var rs=require(_0x3a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a67('0x5'))['db'];var utils=require(_0x3a67('0x6'));var logger=require(_0x3a67('0x7'))('rpc');var config=require(_0x3a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a67('0x9')][_0x3a67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ebb80,_0x4cfa1c,_0x360452){return new BPromise(function(_0x4ad037,_0x4606e0){return client[_0x3a67('0xb')](_0x5ebb80,_0x360452)[_0x3a67('0xc')](function(_0x5b9382){logger['info'](_0x3a67('0xd'),_0x4cfa1c,_0x3a67('0xe'));logger[_0x3a67('0xf')](_0x3a67('0x10'),_0x4cfa1c,_0x3a67('0xe'),JSON[_0x3a67('0x11')](_0x5b9382));if(_0x5b9382['error']){if(_0x5b9382['error'][_0x3a67('0x12')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x4cfa1c,_0x5b9382[_0x3a67('0x13')][_0x3a67('0x14')]);return _0x4606e0(_0x5b9382['error'][_0x3a67('0x14')]);}logger['error'](_0x3a67('0xd'),_0x4cfa1c,_0x5b9382[_0x3a67('0x13')][_0x3a67('0x14')]);return _0x4ad037(_0x5b9382['error'][_0x3a67('0x14')]);}else{logger[_0x3a67('0x15')](_0x3a67('0xd'),_0x4cfa1c,_0x3a67('0xe'));_0x4ad037(_0x5b9382['result']['message']);}})[_0x3a67('0x16')](function(_0x2a930a){logger[_0x3a67('0x13')](_0x3a67('0xd'),_0x4cfa1c,_0x2a930a);_0x4606e0(_0x2a930a);});});}exports[_0x3a67('0x17')]=function(_0x14bd27){var _0x3a8ac5=this;return new Promise(function(_0x11ff72,_0x1b7403){return db[_0x3a67('0x18')][_0x3a67('0x19')]({'raw':_0x14bd27[_0x3a67('0x1a')]?_0x14bd27[_0x3a67('0x1a')][_0x3a67('0x1b')]===undefined?!![]:![]:!![],'where':_0x14bd27[_0x3a67('0x1a')]?_0x14bd27[_0x3a67('0x1a')][_0x3a67('0x1c')]||null:null,'attributes':_0x14bd27['options']?_0x14bd27[_0x3a67('0x1a')][_0x3a67('0x1d')]||null:null,'limit':_0x14bd27[_0x3a67('0x1a')]?_0x14bd27[_0x3a67('0x1a')][_0x3a67('0x1e')]||null:null,'include':_0x14bd27['options']?_0x14bd27[_0x3a67('0x1a')]['include']?_[_0x3a67('0x1f')](_0x14bd27[_0x3a67('0x1a')][_0x3a67('0x20')],function(_0x20472f){return{'model':db[_0x20472f[_0x3a67('0x21')]],'as':_0x20472f['as'],'attributes':_0x20472f[_0x3a67('0x1d')],'include':_0x20472f[_0x3a67('0x20')]?_['map'](_0x20472f[_0x3a67('0x20')],function(_0x3f265f){return{'model':db[_0x3f265f['model']],'as':_0x3f265f['as'],'attributes':_0x3f265f['attributes'],'include':_0x3f265f['include']?_[_0x3a67('0x1f')](_0x3f265f[_0x3a67('0x20')],function(_0x2a3182){return{'model':db[_0x2a3182[_0x3a67('0x21')]],'as':_0x2a3182['as'],'attributes':_0x2a3182[_0x3a67('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4992c0){logger[_0x3a67('0x15')]('GetSalesforceAccount',_0x14bd27);logger['debug'](_0x3a67('0x17'),_0x14bd27,JSON['stringify'](_0x4992c0));_0x11ff72(_0x4992c0);})['catch'](function(_0x2b72ad){logger['error'](_0x3a67('0x17'),_0x2b72ad['message'],_0x14bd27);_0x1b7403(_0x3a8ac5[_0x3a67('0x13')](0x1f4,_0x2b72ad[_0x3a67('0x14')]));});});};exports[_0x3a67('0x22')]=function(_0x379c6b){var _0x1ea9c3=this;return new Promise(function(_0x4d2ca0,_0x1ae921){return db[_0x3a67('0x18')]['find']({'raw':_0x379c6b['options']?_0x379c6b[_0x3a67('0x1a')][_0x3a67('0x1b')]===undefined?!![]:![]:!![],'where':_0x379c6b['options']?_0x379c6b[_0x3a67('0x1a')][_0x3a67('0x1c')]||null:null,'attributes':_0x379c6b['options']?_0x379c6b[_0x3a67('0x1a')][_0x3a67('0x1d')]||null:null,'include':_0x379c6b['options']?_0x379c6b[_0x3a67('0x1a')][_0x3a67('0x20')]?_[_0x3a67('0x1f')](_0x379c6b['options'][_0x3a67('0x20')],function(_0x14c74e){return{'model':db[_0x14c74e[_0x3a67('0x21')]],'as':_0x14c74e['as'],'attributes':_0x14c74e[_0x3a67('0x1d')],'include':_0x14c74e[_0x3a67('0x20')]?_[_0x3a67('0x1f')](_0x14c74e['include'],function(_0x71ddf4){return{'model':db[_0x71ddf4[_0x3a67('0x21')]],'as':_0x71ddf4['as'],'attributes':_0x71ddf4['attributes'],'include':_0x71ddf4['include']?_[_0x3a67('0x1f')](_0x71ddf4[_0x3a67('0x20')],function(_0x3c79a4){return{'model':db[_0x3c79a4[_0x3a67('0x21')]],'as':_0x3c79a4['as'],'attributes':_0x3c79a4[_0x3a67('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3a67('0xc')](function(_0x150250){logger[_0x3a67('0x15')](_0x3a67('0x22'),_0x379c6b);logger['debug'](_0x3a67('0x22'),_0x379c6b,JSON[_0x3a67('0x11')](_0x150250));_0x4d2ca0(_0x150250);})['catch'](function(_0x310216){logger['error'](_0x3a67('0x22'),_0x310216[_0x3a67('0x14')],_0x379c6b);_0x1ae921(_0x1ea9c3[_0x3a67('0x13')](0x1f4,_0x310216[_0x3a67('0x14')]));});});};
\ No newline at end of file
index 60b1c81..5f2fb66 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/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdb28,0x106));var _0x8db2=function(_0x13806a,_0x15b16e){_0x13806a=_0x13806a-0x0;var _0x3064dd=_0xdb28[_0x13806a];return _0x3064dd;};'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
+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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xdb28,0x106));var _0x8db2=function(_0x523609,_0x2a413a){_0x523609=_0x523609-0x0;var _0x26d9a4=_0xdb28[_0x523609];return _0x26d9a4;};'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 6649eb2..0992ee0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fc2=['lead','account_contact_lead','account','nothing','contact','sequelize','exports','STRING','Task','ENUM','contact_lead'];(function(_0xed1e61,_0xfefacc){var _0x2ef513=function(_0x4f861d){while(--_0x4f861d){_0xed1e61['push'](_0xed1e61['shift']());}};_0x2ef513(++_0xfefacc);}(_0x1fc2,0x123));var _0x21fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1fc2[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x21fc('0x0'));module[_0x21fc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21fc('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task','Case'),'defaultValue':_0x21fc('0x3')},'moduleSearch':{'type':Sequelize[_0x21fc('0x4')](_0x21fc('0x5'),'contact',_0x21fc('0x6'),_0x21fc('0x7'),_0x21fc('0x8')),'defaultValue':_0x21fc('0x5')},'moduleCreate':{'type':Sequelize[_0x21fc('0x4')](_0x21fc('0x9'),_0x21fc('0xa'),_0x21fc('0x6'),_0x21fc('0x8')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x21fc('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x91d3=['exports','STRING','Task','Case','ENUM','contact_lead','contact','lead','account_contact_lead','account','nothing'];(function(_0x1c3b03,_0x56ac74){var _0x37397d=function(_0x588ffe){while(--_0x588ffe){_0x1c3b03['push'](_0x1c3b03['shift']());}};_0x37397d(++_0x56ac74);}(_0x91d3,0x113));var _0x391d=function(_0x387a7d,_0x2a6ae6){_0x387a7d=_0x387a7d-0x0;var _0x490bc4=_0x91d3[_0x387a7d];return _0x490bc4;};'use strict';var Sequelize=require('sequelize');module[_0x391d('0x0')]={'name':{'type':Sequelize[_0x391d('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x391d('0x2'),_0x391d('0x3')),'defaultValue':_0x391d('0x2')},'moduleSearch':{'type':Sequelize[_0x391d('0x4')](_0x391d('0x5'),_0x391d('0x6'),_0x391d('0x7'),_0x391d('0x8'),_0x391d('0x9')),'defaultValue':_0x391d('0x5')},'moduleCreate':{'type':Sequelize[_0x391d('0x4')](_0x391d('0xa'),_0x391d('0x6'),_0x391d('0x7'),'account'),'defaultValue':_0x391d('0x7')},'leadId':{'type':Sequelize[_0x391d('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x391d('0x1')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x391d('0x1')]}};
\ No newline at end of file
index 05ed98a..3ed90b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1220=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x1220,0x8a));var _0x0122=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1220[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x0122('0x0'));var rimraf=require(_0x0122('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0122('0x2'));var BPromise=require(_0x0122('0x3'));var Mustache=require(_0x0122('0x4'));var util=require(_0x0122('0x5'));var path=require(_0x0122('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0122('0x7'));var fs=require('fs');var fs_extra=require(_0x0122('0x8'));var _=require(_0x0122('0x9'));var squel=require(_0x0122('0xa'));var crypto=require('crypto');var jsforce=require(_0x0122('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0122('0xc'));var authService=require(_0x0122('0xd'));var qs=require(_0x0122('0xe'));var as=require(_0x0122('0xf'));var hardwareService=require(_0x0122('0x10'));var logger=require(_0x0122('0x11'))(_0x0122('0x12'));var utils=require(_0x0122('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0122('0x14'));var db=require(_0x0122('0x15'))['db'];function respondWithStatusCode(_0x417daa,_0x35ae04){_0x35ae04=_0x35ae04||0xcc;return function(_0x31f2a1){if(_0x31f2a1){return _0x417daa[_0x0122('0x16')](_0x35ae04);}return _0x417daa[_0x0122('0x17')](_0x35ae04)[_0x0122('0x18')]();};}function respondWithResult(_0x190f80,_0x3877b1){_0x3877b1=_0x3877b1||0xc8;return function(_0x4091e7){if(_0x4091e7){return _0x190f80[_0x0122('0x17')](_0x3877b1)[_0x0122('0x19')](_0x4091e7);}};}function respondWithFilteredResult(_0x551ec8,_0x186e98){return function(_0x27a9ac){if(_0x27a9ac){var _0x4d33ff=typeof _0x186e98[_0x0122('0x1a')]===_0x0122('0x1b')&&typeof _0x186e98[_0x0122('0x1c')]==='undefined';var _0x271e3f=_0x27a9ac[_0x0122('0x1d')];var _0x1a0d6e=_0x4d33ff?0x0:_0x186e98[_0x0122('0x1a')];var _0x4547cc=_0x4d33ff?_0x27a9ac[_0x0122('0x1d')]:_0x186e98['offset']+_0x186e98[_0x0122('0x1c')];var _0x20f4fb;if(_0x4547cc>=_0x271e3f){_0x4547cc=_0x271e3f;_0x20f4fb=0xc8;}else{_0x20f4fb=0xce;}_0x551ec8[_0x0122('0x17')](_0x20f4fb);return _0x551ec8['set'](_0x0122('0x1e'),_0x1a0d6e+'-'+_0x4547cc+'/'+_0x271e3f)['json'](_0x27a9ac);}return null;};}function patchUpdates(_0xdda6b1){return function(_0x29a508){try{jsonpatch['apply'](_0x29a508,_0xdda6b1,!![]);}catch(_0x132ec0){return BPromise[_0x0122('0x1f')](_0x132ec0);}return _0x29a508[_0x0122('0x20')]();};}function saveUpdates(_0x30a5bd,_0x43ff4c){return function(_0x4d08e6){if(_0x4d08e6){return _0x4d08e6[_0x0122('0x21')](_0x30a5bd)[_0x0122('0x22')](function(_0x2bac93){return _0x2bac93;});}return null;};}function removeEntity(_0x3b65b1,_0x530455){return function(_0x477b87){if(_0x477b87){return _0x477b87[_0x0122('0x23')]()[_0x0122('0x22')](function(){_0x3b65b1[_0x0122('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29150b,_0x3a077c){return function(_0xbe4b7f){if(!_0xbe4b7f){_0x29150b[_0x0122('0x16')](0x194);}return _0xbe4b7f;};}function handleError(_0x600375,_0x89fd93){_0x89fd93=_0x89fd93||0x1f4;return function(_0x590459){logger[_0x0122('0x24')](_0x590459[_0x0122('0x25')]);if(_0x590459[_0x0122('0x26')]){delete _0x590459[_0x0122('0x26')];}_0x600375['status'](_0x89fd93)['send'](_0x590459);};}exports[_0x0122('0x27')]=function(_0x533cc2,_0x1a3708){var _0x20cea1={},_0x562415={},_0x5ba5a7={'count':0x0,'rows':[]};var _0x1e4036=_[_0x0122('0x28')](db['SalesforceConfiguration'][_0x0122('0x29')],function(_0x49207a){return{'name':_0x49207a[_0x0122('0x2a')],'type':_0x49207a[_0x0122('0x2b')][_0x0122('0x2c')]};});_0x562415[_0x0122('0x2d')]=_[_0x0122('0x28')](_0x1e4036,_0x0122('0x26'));_0x562415['query']=_[_0x0122('0x2e')](_0x533cc2[_0x0122('0x2f')]);_0x562415['filters']=_[_0x0122('0x30')](_0x562415[_0x0122('0x2d')],_0x562415[_0x0122('0x2f')]);_0x20cea1[_0x0122('0x31')]=_[_0x0122('0x30')](_0x562415[_0x0122('0x2d')],qs['fields'](_0x533cc2['query'][_0x0122('0x32')]));_0x20cea1[_0x0122('0x31')]=_0x20cea1[_0x0122('0x31')][_0x0122('0x33')]?_0x20cea1[_0x0122('0x31')]:_0x562415[_0x0122('0x2d')];if(!_0x533cc2[_0x0122('0x2f')][_0x0122('0x34')](_0x0122('0x35'))){_0x20cea1['limit']=qs[_0x0122('0x1c')](_0x533cc2[_0x0122('0x2f')][_0x0122('0x1c')]);_0x20cea1[_0x0122('0x1a')]=qs['offset'](_0x533cc2[_0x0122('0x2f')][_0x0122('0x1a')]);}_0x20cea1['order']=qs[_0x0122('0x36')](_0x533cc2[_0x0122('0x2f')][_0x0122('0x36')]);_0x20cea1[_0x0122('0x37')]=qs[_0x0122('0x38')](_[_0x0122('0x39')](_0x533cc2[_0x0122('0x2f')],_0x562415[_0x0122('0x38')]),_0x1e4036);if(_0x533cc2['query'][_0x0122('0x3a')]){_0x20cea1[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x20cea1[_0x0122('0x37')],{'$or':_[_0x0122('0x28')](_0x1e4036,function(_0x38c92a){if(_0x38c92a[_0x0122('0x2b')]!==_0x0122('0x3c')){var _0x31ddc5={};_0x31ddc5[_0x38c92a['name']]={'$like':'%'+_0x533cc2[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x31ddc5;}})});}_0x20cea1=_[_0x0122('0x3b')]({},_0x20cea1,_0x533cc2['options']);var _0x5cb4ee={'where':_0x20cea1[_0x0122('0x37')]};return db[_0x0122('0x3d')][_0x0122('0x1d')](_0x5cb4ee)[_0x0122('0x22')](function(_0x21d32d){_0x5ba5a7['count']=_0x21d32d;if(_0x533cc2[_0x0122('0x2f')][_0x0122('0x3e')]){_0x20cea1[_0x0122('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x20cea1);})[_0x0122('0x22')](function(_0x564822){_0x5ba5a7[_0x0122('0x40')]=_0x564822;return _0x5ba5a7;})[_0x0122('0x22')](respondWithFilteredResult(_0x1a3708,_0x20cea1))[_0x0122('0x41')](handleError(_0x1a3708,null));};exports[_0x0122('0x42')]=function(_0x520062,_0x2496d9){var _0x107cb9={'raw':![],'where':{'id':_0x520062[_0x0122('0x43')]['id']}},_0xa8013c={};_0xa8013c[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x3d')][_0x0122('0x29')]);_0xa8013c[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x520062[_0x0122('0x2f')]);_0xa8013c[_0x0122('0x38')]=_[_0x0122('0x30')](_0xa8013c['model'],_0xa8013c[_0x0122('0x2f')]);_0x107cb9[_0x0122('0x31')]=_[_0x0122('0x30')](_0xa8013c[_0x0122('0x2d')],qs['fields'](_0x520062['query']['fields']));_0x107cb9[_0x0122('0x31')]=_0x107cb9[_0x0122('0x31')][_0x0122('0x33')]?_0x107cb9['attributes']:_0xa8013c[_0x0122('0x2d')];if(_0x520062[_0x0122('0x2f')]['includeAll']){_0x107cb9['include']=[{'all':!![]}];}_0x107cb9=_[_0x0122('0x3b')]({},_0x107cb9,_0x520062[_0x0122('0x44')]);return db[_0x0122('0x3d')][_0x0122('0x45')](_0x107cb9)[_0x0122('0x22')](handleEntityNotFound(_0x2496d9,null))[_0x0122('0x22')](respondWithResult(_0x2496d9,null))[_0x0122('0x41')](handleError(_0x2496d9,null));};exports['create']=function(_0x2a20bd,_0x18513f){return db[_0x0122('0x3d')][_0x0122('0x46')](_0x2a20bd[_0x0122('0x47')],{})[_0x0122('0x22')](respondWithResult(_0x18513f,0xc9))[_0x0122('0x41')](handleError(_0x18513f,null));};exports[_0x0122('0x21')]=function(_0x326e03,_0x58528d){if(_0x326e03[_0x0122('0x47')]['id']){delete _0x326e03[_0x0122('0x47')]['id'];}return db[_0x0122('0x3d')]['find']({'where':{'id':_0x326e03[_0x0122('0x43')]['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x58528d,null))[_0x0122('0x22')](saveUpdates(_0x326e03[_0x0122('0x47')],null))[_0x0122('0x22')](respondWithResult(_0x58528d,null))['catch'](handleError(_0x58528d,null));};exports[_0x0122('0x23')]=function(_0x399f44,_0x2ab92c){return db[_0x0122('0x3d')][_0x0122('0x45')]({'where':{'id':_0x399f44[_0x0122('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ab92c,null))[_0x0122('0x22')](removeEntity(_0x2ab92c,null))['catch'](handleError(_0x2ab92c,null));};exports[_0x0122('0x48')]=function(_0x4e7500,_0x27b5ea,_0x343bfa){var _0x36f54e={};var _0xdc3b58={};var _0x2cd6ae;var _0x474ad4;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4e7500['params']['id']}})['then'](handleEntityNotFound(_0x27b5ea,null))[_0x0122('0x22')](function(_0x1c5925){if(_0x1c5925){_0x2cd6ae=_0x1c5925;_0xdc3b58[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x4a')][_0x0122('0x29')]);_0xdc3b58[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x4e7500[_0x0122('0x2f')]);_0xdc3b58['filters']=_[_0x0122('0x30')](_0xdc3b58['model'],_0xdc3b58[_0x0122('0x2f')]);_0x36f54e[_0x0122('0x31')]=_[_0x0122('0x30')](_0xdc3b58[_0x0122('0x2d')],qs['fields'](_0x4e7500[_0x0122('0x2f')][_0x0122('0x32')]));_0x36f54e[_0x0122('0x31')]=_0x36f54e['attributes']['length']?_0x36f54e[_0x0122('0x31')]:_0xdc3b58[_0x0122('0x2d')];_0x36f54e[_0x0122('0x4b')]=qs[_0x0122('0x36')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x36')]);_0x36f54e['where']=qs['filters'](_[_0x0122('0x39')](_0x4e7500[_0x0122('0x2f')],_0xdc3b58[_0x0122('0x38')]));if(_0x4e7500[_0x0122('0x2f')][_0x0122('0x3a')]){_0x36f54e[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x36f54e[_0x0122('0x37')],{'$or':_['map'](_0x36f54e[_0x0122('0x31')],function(_0x168ecc){var _0x515f90={};_0x515f90[_0x168ecc]={'$like':'%'+_0x4e7500[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x515f90;})});}_0x36f54e=_['merge']({},_0x36f54e,_0x4e7500['options']);return _0x2cd6ae['getFields'](_0x36f54e);}})[_0x0122('0x22')](function(_0x3a14f9){if(_0x3a14f9){_0x474ad4=_0x3a14f9[_0x0122('0x33')];if(!_0x4e7500['query']['hasOwnProperty']('nolimit')){_0x36f54e[_0x0122('0x1c')]=qs[_0x0122('0x1c')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x1c')]);_0x36f54e['offset']=qs[_0x0122('0x1a')](_0x4e7500[_0x0122('0x2f')][_0x0122('0x1a')]);}return _0x2cd6ae[_0x0122('0x48')](_0x36f54e);}})['then'](function(_0x1d6ba8){if(_0x1d6ba8){return _0x1d6ba8?{'count':_0x474ad4,'rows':_0x1d6ba8}:null;}})['then'](respondWithResult(_0x27b5ea,null))['catch'](handleError(_0x27b5ea,null));};exports['getSubjects']=function(_0x4a6a78,_0x1f8227,_0x279838){var _0x31fd48={};var _0x7afefd={};var _0x1b64ee;var _0x3b6fdf;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4a6a78[_0x0122('0x43')]['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x1f8227,null))[_0x0122('0x22')](function(_0x1046b6){if(_0x1046b6){_0x1b64ee=_0x1046b6;_0x7afefd['model']=_['keys'](db[_0x0122('0x4a')][_0x0122('0x29')]);_0x7afefd[_0x0122('0x2f')]=_['keys'](_0x4a6a78['query']);_0x7afefd[_0x0122('0x38')]=_[_0x0122('0x30')](_0x7afefd[_0x0122('0x2d')],_0x7afefd[_0x0122('0x2f')]);_0x31fd48[_0x0122('0x31')]=_['intersection'](_0x7afefd[_0x0122('0x2d')],qs[_0x0122('0x32')](_0x4a6a78[_0x0122('0x2f')]['fields']));_0x31fd48[_0x0122('0x31')]=_0x31fd48['attributes']['length']?_0x31fd48[_0x0122('0x31')]:_0x7afefd[_0x0122('0x2d')];_0x31fd48[_0x0122('0x4b')]=qs[_0x0122('0x36')](_0x4a6a78[_0x0122('0x2f')][_0x0122('0x36')]);_0x31fd48[_0x0122('0x37')]=qs[_0x0122('0x38')](_[_0x0122('0x39')](_0x4a6a78['query'],_0x7afefd[_0x0122('0x38')]));if(_0x4a6a78['query']['filter']){_0x31fd48[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x31fd48[_0x0122('0x37')],{'$or':_['map'](_0x31fd48[_0x0122('0x31')],function(_0x2d129e){var _0x4a6a2a={};_0x4a6a2a[_0x2d129e]={'$like':'%'+_0x4a6a78[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x4a6a2a;})});}_0x31fd48=_['merge']({},_0x31fd48,_0x4a6a78[_0x0122('0x44')]);return _0x1b64ee[_0x0122('0x4c')](_0x31fd48);}})[_0x0122('0x22')](function(_0x510574){if(_0x510574){_0x3b6fdf=_0x510574[_0x0122('0x33')];if(!_0x4a6a78[_0x0122('0x2f')][_0x0122('0x34')]('nolimit')){_0x31fd48[_0x0122('0x1c')]=qs[_0x0122('0x1c')](_0x4a6a78[_0x0122('0x2f')][_0x0122('0x1c')]);_0x31fd48['offset']=qs[_0x0122('0x1a')](_0x4a6a78['query'][_0x0122('0x1a')]);}return _0x1b64ee[_0x0122('0x4c')](_0x31fd48);}})[_0x0122('0x22')](function(_0x183e50){if(_0x183e50){return _0x183e50?{'count':_0x3b6fdf,'rows':_0x183e50}:null;}})[_0x0122('0x22')](respondWithResult(_0x1f8227,null))[_0x0122('0x41')](handleError(_0x1f8227,null));};exports[_0x0122('0x4d')]=function(_0x4af89f,_0x2be0a1,_0x3a7fd8){var _0x14c38e={};var _0x52b8c8={};var _0x378bcc;var _0x19e91c;return db[_0x0122('0x3d')][_0x0122('0x49')]({'where':{'id':_0x4af89f['params']['id']}})[_0x0122('0x22')](handleEntityNotFound(_0x2be0a1,null))['then'](function(_0x31e451){if(_0x31e451){_0x378bcc=_0x31e451;_0x52b8c8[_0x0122('0x2d')]=_[_0x0122('0x2e')](db[_0x0122('0x4a')]['rawAttributes']);_0x52b8c8[_0x0122('0x2f')]=_[_0x0122('0x2e')](_0x4af89f[_0x0122('0x2f')]);_0x52b8c8[_0x0122('0x38')]=_[_0x0122('0x30')](_0x52b8c8[_0x0122('0x2d')],_0x52b8c8[_0x0122('0x2f')]);_0x14c38e[_0x0122('0x31')]=_[_0x0122('0x30')](_0x52b8c8['model'],qs[_0x0122('0x32')](_0x4af89f[_0x0122('0x2f')]['fields']));_0x14c38e['attributes']=_0x14c38e[_0x0122('0x31')]['length']?_0x14c38e[_0x0122('0x31')]:_0x52b8c8['model'];_0x14c38e[_0x0122('0x4b')]=qs['sort'](_0x4af89f[_0x0122('0x2f')][_0x0122('0x36')]);_0x14c38e[_0x0122('0x37')]=qs[_0x0122('0x38')](_['pick'](_0x4af89f[_0x0122('0x2f')],_0x52b8c8[_0x0122('0x38')]));if(_0x4af89f['query']['filter']){_0x14c38e[_0x0122('0x37')]=_[_0x0122('0x3b')](_0x14c38e['where'],{'$or':_[_0x0122('0x28')](_0x14c38e['attributes'],function(_0x4e0780){var _0x53e3c4={};_0x53e3c4[_0x4e0780]={'$like':'%'+_0x4af89f[_0x0122('0x2f')][_0x0122('0x3a')]+'%'};return _0x53e3c4;})});}_0x14c38e=_[_0x0122('0x3b')]({},_0x14c38e,_0x4af89f[_0x0122('0x44')]);return _0x378bcc['getDescriptions'](_0x14c38e);}})[_0x0122('0x22')](function(_0x27a12e){if(_0x27a12e){_0x19e91c=_0x27a12e[_0x0122('0x33')];if(!_0x4af89f[_0x0122('0x2f')][_0x0122('0x34')](_0x0122('0x35'))){_0x14c38e[_0x0122('0x1c')]=qs['limit'](_0x4af89f[_0x0122('0x2f')][_0x0122('0x1c')]);_0x14c38e[_0x0122('0x1a')]=qs[_0x0122('0x1a')](_0x4af89f[_0x0122('0x2f')]['offset']);}return _0x378bcc[_0x0122('0x4d')](_0x14c38e);}})[_0x0122('0x22')](function(_0x387361){if(_0x387361){return _0x387361?{'count':_0x19e91c,'rows':_0x387361}:null;}})[_0x0122('0x22')](respondWithResult(_0x2be0a1,null))['catch'](handleError(_0x2be0a1,null));};
\ No newline at end of file
+var _0x84cc=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','destroy','then','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','catch','show','find','create','body','params','getFields','findOne','nolimit','getSubjects','SalesforceField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox'];(function(_0x4ec32d,_0xc68981){var _0x210f03=function(_0x194566){while(--_0x194566){_0x4ec32d['push'](_0x4ec32d['shift']());}};_0x210f03(++_0xc68981);}(_0x84cc,0x1c6));var _0xc84c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x84cc[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc84c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc84c('0x1'));var jsonpatch=require(_0xc84c('0x2'));var rp=require(_0xc84c('0x3'));var moment=require('moment');var BPromise=require(_0xc84c('0x4'));var Mustache=require(_0xc84c('0x5'));var util=require(_0xc84c('0x6'));var path=require('path');var sox=require(_0xc84c('0x7'));var csv=require(_0xc84c('0x8'));var ejs=require(_0xc84c('0x9'));var fs=require('fs');var fs_extra=require(_0xc84c('0xa'));var _=require(_0xc84c('0xb'));var squel=require(_0xc84c('0xc'));var crypto=require(_0xc84c('0xd'));var jsforce=require(_0xc84c('0xe'));var deskjs=require(_0xc84c('0xf'));var toCsv=require(_0xc84c('0x8'));var querystring=require(_0xc84c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc84c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc84c('0x12'));var hardwareService=require(_0xc84c('0x13'));var logger=require(_0xc84c('0x14'))(_0xc84c('0x15'));var utils=require('../../config/utils');var config=require(_0xc84c('0x16'));var licenseUtil=require(_0xc84c('0x17'));var db=require(_0xc84c('0x18'))['db'];function respondWithStatusCode(_0x25e5e0,_0x10aa98){_0x10aa98=_0x10aa98||0xcc;return function(_0x19a29c){if(_0x19a29c){return _0x25e5e0[_0xc84c('0x19')](_0x10aa98);}return _0x25e5e0[_0xc84c('0x1a')](_0x10aa98)[_0xc84c('0x1b')]();};}function respondWithResult(_0x584e49,_0x59b499){_0x59b499=_0x59b499||0xc8;return function(_0x13ecd5){if(_0x13ecd5){return _0x584e49[_0xc84c('0x1a')](_0x59b499)[_0xc84c('0x1c')](_0x13ecd5);}};}function respondWithFilteredResult(_0x1360fd,_0x3f5fd8){return function(_0x190672){if(_0x190672){var _0x5e2aca=typeof _0x3f5fd8[_0xc84c('0x1d')]===_0xc84c('0x1e')&&typeof _0x3f5fd8[_0xc84c('0x1f')]===_0xc84c('0x1e');var _0x460396=_0x190672[_0xc84c('0x20')];var _0x51c938=_0x5e2aca?0x0:_0x3f5fd8[_0xc84c('0x1d')];var _0x34c30c=_0x5e2aca?_0x190672['count']:_0x3f5fd8[_0xc84c('0x1d')]+_0x3f5fd8[_0xc84c('0x1f')];var _0xefd72;if(_0x34c30c>=_0x460396){_0x34c30c=_0x460396;_0xefd72=0xc8;}else{_0xefd72=0xce;}_0x1360fd[_0xc84c('0x1a')](_0xefd72);return _0x1360fd['set']('Content-Range',_0x51c938+'-'+_0x34c30c+'/'+_0x460396)['json'](_0x190672);}return null;};}function patchUpdates(_0x3ebdba){return function(_0x335d36){try{jsonpatch['apply'](_0x335d36,_0x3ebdba,!![]);}catch(_0x2348f1){return BPromise[_0xc84c('0x21')](_0x2348f1);}return _0x335d36[_0xc84c('0x22')]();};}function saveUpdates(_0x135d89,_0x4dcc3f){return function(_0x46a8a1){if(_0x46a8a1){return _0x46a8a1['update'](_0x135d89)['then'](function(_0x50ae9f){return _0x50ae9f;});}return null;};}function removeEntity(_0x374608,_0x530fc3){return function(_0x82a841){if(_0x82a841){return _0x82a841[_0xc84c('0x23')]()[_0xc84c('0x24')](function(){_0x374608[_0xc84c('0x1a')](0xcc)[_0xc84c('0x1b')]();});}};}function handleEntityNotFound(_0x2dc122,_0x2e00e){return function(_0x239854){if(!_0x239854){_0x2dc122[_0xc84c('0x19')](0x194);}return _0x239854;};}function handleError(_0x25e0f3,_0x2cb5cd){_0x2cb5cd=_0x2cb5cd||0x1f4;return function(_0x21ec14){logger[_0xc84c('0x25')](_0x21ec14['stack']);if(_0x21ec14[_0xc84c('0x26')]){delete _0x21ec14[_0xc84c('0x26')];}_0x25e0f3[_0xc84c('0x1a')](_0x2cb5cd)[_0xc84c('0x27')](_0x21ec14);};}exports[_0xc84c('0x28')]=function(_0x47c63d,_0x4674f0){var _0x64cb0c={},_0xb45743={},_0xa52cc4={'count':0x0,'rows':[]};var _0xe5ab6f=_[_0xc84c('0x29')](db[_0xc84c('0x2a')][_0xc84c('0x2b')],function(_0x48d2b6){return{'name':_0x48d2b6[_0xc84c('0x2c')],'type':_0x48d2b6[_0xc84c('0x2d')]['key']};});_0xb45743['model']=_[_0xc84c('0x29')](_0xe5ab6f,_0xc84c('0x26'));_0xb45743[_0xc84c('0x2e')]=_[_0xc84c('0x2f')](_0x47c63d[_0xc84c('0x2e')]);_0xb45743['filters']=_['intersection'](_0xb45743[_0xc84c('0x30')],_0xb45743['query']);_0x64cb0c['attributes']=_[_0xc84c('0x31')](_0xb45743[_0xc84c('0x30')],qs[_0xc84c('0x32')](_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x32')]));_0x64cb0c[_0xc84c('0x33')]=_0x64cb0c[_0xc84c('0x33')][_0xc84c('0x34')]?_0x64cb0c[_0xc84c('0x33')]:_0xb45743[_0xc84c('0x30')];if(!_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x35')]('nolimit')){_0x64cb0c['limit']=qs['limit'](_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x1f')]);_0x64cb0c[_0xc84c('0x1d')]=qs[_0xc84c('0x1d')](_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x1d')]);}_0x64cb0c[_0xc84c('0x36')]=qs[_0xc84c('0x37')](_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x37')]);_0x64cb0c[_0xc84c('0x38')]=qs[_0xc84c('0x39')](_[_0xc84c('0x3a')](_0x47c63d[_0xc84c('0x2e')],_0xb45743[_0xc84c('0x39')]),_0xe5ab6f);if(_0x47c63d[_0xc84c('0x2e')]['filter']){_0x64cb0c[_0xc84c('0x38')]=_[_0xc84c('0x3b')](_0x64cb0c[_0xc84c('0x38')],{'$or':_[_0xc84c('0x29')](_0xe5ab6f,function(_0x1a82c3){if(_0x1a82c3['type']!=='VIRTUAL'){var _0xb22221={};_0xb22221[_0x1a82c3[_0xc84c('0x26')]]={'$like':'%'+_0x47c63d['query'][_0xc84c('0x3c')]+'%'};return _0xb22221;}})});}_0x64cb0c=_['merge']({},_0x64cb0c,_0x47c63d[_0xc84c('0x3d')]);var _0x250600={'where':_0x64cb0c[_0xc84c('0x38')]};return db['SalesforceConfiguration'][_0xc84c('0x20')](_0x250600)[_0xc84c('0x24')](function(_0x49bea8){_0xa52cc4[_0xc84c('0x20')]=_0x49bea8;if(_0x47c63d[_0xc84c('0x2e')][_0xc84c('0x3e')]){_0x64cb0c[_0xc84c('0x3f')]=[{'all':!![]}];}return db[_0xc84c('0x2a')][_0xc84c('0x40')](_0x64cb0c);})[_0xc84c('0x24')](function(_0x35e0f8){_0xa52cc4['rows']=_0x35e0f8;return _0xa52cc4;})['then'](respondWithFilteredResult(_0x4674f0,_0x64cb0c))[_0xc84c('0x41')](handleError(_0x4674f0,null));};exports[_0xc84c('0x42')]=function(_0x312161,_0x56ed5e){var _0x59dbc3={'raw':![],'where':{'id':_0x312161['params']['id']}},_0x48168f={};_0x48168f[_0xc84c('0x30')]=_[_0xc84c('0x2f')](db[_0xc84c('0x2a')]['rawAttributes']);_0x48168f[_0xc84c('0x2e')]=_[_0xc84c('0x2f')](_0x312161[_0xc84c('0x2e')]);_0x48168f['filters']=_[_0xc84c('0x31')](_0x48168f[_0xc84c('0x30')],_0x48168f[_0xc84c('0x2e')]);_0x59dbc3['attributes']=_[_0xc84c('0x31')](_0x48168f['model'],qs[_0xc84c('0x32')](_0x312161['query']['fields']));_0x59dbc3[_0xc84c('0x33')]=_0x59dbc3[_0xc84c('0x33')][_0xc84c('0x34')]?_0x59dbc3[_0xc84c('0x33')]:_0x48168f[_0xc84c('0x30')];if(_0x312161['query'][_0xc84c('0x3e')]){_0x59dbc3[_0xc84c('0x3f')]=[{'all':!![]}];}_0x59dbc3=_[_0xc84c('0x3b')]({},_0x59dbc3,_0x312161[_0xc84c('0x3d')]);return db[_0xc84c('0x2a')][_0xc84c('0x43')](_0x59dbc3)[_0xc84c('0x24')](handleEntityNotFound(_0x56ed5e,null))[_0xc84c('0x24')](respondWithResult(_0x56ed5e,null))[_0xc84c('0x41')](handleError(_0x56ed5e,null));};exports[_0xc84c('0x44')]=function(_0x1257af,_0x178b76){return db['SalesforceConfiguration']['create'](_0x1257af[_0xc84c('0x45')],{})[_0xc84c('0x24')](respondWithResult(_0x178b76,0xc9))[_0xc84c('0x41')](handleError(_0x178b76,null));};exports['update']=function(_0x5d5596,_0xf661cb){if(_0x5d5596['body']['id']){delete _0x5d5596[_0xc84c('0x45')]['id'];}return db[_0xc84c('0x2a')]['find']({'where':{'id':_0x5d5596[_0xc84c('0x46')]['id']}})[_0xc84c('0x24')](handleEntityNotFound(_0xf661cb,null))['then'](saveUpdates(_0x5d5596[_0xc84c('0x45')],null))[_0xc84c('0x24')](respondWithResult(_0xf661cb,null))[_0xc84c('0x41')](handleError(_0xf661cb,null));};exports[_0xc84c('0x23')]=function(_0x21d0ae,_0x226134){return db['SalesforceConfiguration'][_0xc84c('0x43')]({'where':{'id':_0x21d0ae[_0xc84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x226134,null))[_0xc84c('0x24')](removeEntity(_0x226134,null))[_0xc84c('0x41')](handleError(_0x226134,null));};exports[_0xc84c('0x47')]=function(_0x156db1,_0x36f7f0,_0x41557f){var _0x2feda0={};var _0x6be521={};var _0x22d189;var _0x26f394;return db['SalesforceConfiguration'][_0xc84c('0x48')]({'where':{'id':_0x156db1[_0xc84c('0x46')]['id']}})[_0xc84c('0x24')](handleEntityNotFound(_0x36f7f0,null))['then'](function(_0x400e97){if(_0x400e97){_0x22d189=_0x400e97;_0x6be521[_0xc84c('0x30')]=_['keys'](db['SalesforceField'][_0xc84c('0x2b')]);_0x6be521[_0xc84c('0x2e')]=_[_0xc84c('0x2f')](_0x156db1[_0xc84c('0x2e')]);_0x6be521[_0xc84c('0x39')]=_[_0xc84c('0x31')](_0x6be521['model'],_0x6be521['query']);_0x2feda0[_0xc84c('0x33')]=_[_0xc84c('0x31')](_0x6be521[_0xc84c('0x30')],qs[_0xc84c('0x32')](_0x156db1['query'][_0xc84c('0x32')]));_0x2feda0[_0xc84c('0x33')]=_0x2feda0['attributes'][_0xc84c('0x34')]?_0x2feda0[_0xc84c('0x33')]:_0x6be521[_0xc84c('0x30')];_0x2feda0[_0xc84c('0x36')]=qs[_0xc84c('0x37')](_0x156db1[_0xc84c('0x2e')]['sort']);_0x2feda0['where']=qs[_0xc84c('0x39')](_[_0xc84c('0x3a')](_0x156db1[_0xc84c('0x2e')],_0x6be521[_0xc84c('0x39')]));if(_0x156db1['query'][_0xc84c('0x3c')]){_0x2feda0[_0xc84c('0x38')]=_[_0xc84c('0x3b')](_0x2feda0[_0xc84c('0x38')],{'$or':_[_0xc84c('0x29')](_0x2feda0[_0xc84c('0x33')],function(_0x4a31b7){var _0x277663={};_0x277663[_0x4a31b7]={'$like':'%'+_0x156db1[_0xc84c('0x2e')][_0xc84c('0x3c')]+'%'};return _0x277663;})});}_0x2feda0=_[_0xc84c('0x3b')]({},_0x2feda0,_0x156db1[_0xc84c('0x3d')]);return _0x22d189[_0xc84c('0x47')](_0x2feda0);}})[_0xc84c('0x24')](function(_0x611c95){if(_0x611c95){_0x26f394=_0x611c95[_0xc84c('0x34')];if(!_0x156db1[_0xc84c('0x2e')][_0xc84c('0x35')](_0xc84c('0x49'))){_0x2feda0[_0xc84c('0x1f')]=qs[_0xc84c('0x1f')](_0x156db1[_0xc84c('0x2e')][_0xc84c('0x1f')]);_0x2feda0[_0xc84c('0x1d')]=qs[_0xc84c('0x1d')](_0x156db1['query'][_0xc84c('0x1d')]);}return _0x22d189['getFields'](_0x2feda0);}})[_0xc84c('0x24')](function(_0x2bf4e4){if(_0x2bf4e4){return _0x2bf4e4?{'count':_0x26f394,'rows':_0x2bf4e4}:null;}})['then'](respondWithResult(_0x36f7f0,null))[_0xc84c('0x41')](handleError(_0x36f7f0,null));};exports[_0xc84c('0x4a')]=function(_0x2a82f3,_0x300fe6,_0x4e6e17){var _0x38ff5d={};var _0xa2bcd={};var _0x3024f3;var _0x39008e;return db[_0xc84c('0x2a')][_0xc84c('0x48')]({'where':{'id':_0x2a82f3[_0xc84c('0x46')]['id']}})[_0xc84c('0x24')](handleEntityNotFound(_0x300fe6,null))[_0xc84c('0x24')](function(_0x132d62){if(_0x132d62){_0x3024f3=_0x132d62;_0xa2bcd['model']=_['keys'](db[_0xc84c('0x4b')][_0xc84c('0x2b')]);_0xa2bcd[_0xc84c('0x2e')]=_['keys'](_0x2a82f3[_0xc84c('0x2e')]);_0xa2bcd[_0xc84c('0x39')]=_[_0xc84c('0x31')](_0xa2bcd['model'],_0xa2bcd[_0xc84c('0x2e')]);_0x38ff5d['attributes']=_['intersection'](_0xa2bcd[_0xc84c('0x30')],qs['fields'](_0x2a82f3['query'][_0xc84c('0x32')]));_0x38ff5d[_0xc84c('0x33')]=_0x38ff5d['attributes'][_0xc84c('0x34')]?_0x38ff5d[_0xc84c('0x33')]:_0xa2bcd[_0xc84c('0x30')];_0x38ff5d[_0xc84c('0x36')]=qs['sort'](_0x2a82f3[_0xc84c('0x2e')][_0xc84c('0x37')]);_0x38ff5d['where']=qs['filters'](_['pick'](_0x2a82f3[_0xc84c('0x2e')],_0xa2bcd['filters']));if(_0x2a82f3[_0xc84c('0x2e')]['filter']){_0x38ff5d[_0xc84c('0x38')]=_[_0xc84c('0x3b')](_0x38ff5d[_0xc84c('0x38')],{'$or':_[_0xc84c('0x29')](_0x38ff5d[_0xc84c('0x33')],function(_0x1cf4cf){var _0x499f56={};_0x499f56[_0x1cf4cf]={'$like':'%'+_0x2a82f3[_0xc84c('0x2e')][_0xc84c('0x3c')]+'%'};return _0x499f56;})});}_0x38ff5d=_[_0xc84c('0x3b')]({},_0x38ff5d,_0x2a82f3[_0xc84c('0x3d')]);return _0x3024f3[_0xc84c('0x4a')](_0x38ff5d);}})[_0xc84c('0x24')](function(_0x1fba3d){if(_0x1fba3d){_0x39008e=_0x1fba3d['length'];if(!_0x2a82f3[_0xc84c('0x2e')]['hasOwnProperty'](_0xc84c('0x49'))){_0x38ff5d[_0xc84c('0x1f')]=qs[_0xc84c('0x1f')](_0x2a82f3[_0xc84c('0x2e')][_0xc84c('0x1f')]);_0x38ff5d[_0xc84c('0x1d')]=qs[_0xc84c('0x1d')](_0x2a82f3[_0xc84c('0x2e')][_0xc84c('0x1d')]);}return _0x3024f3[_0xc84c('0x4a')](_0x38ff5d);}})[_0xc84c('0x24')](function(_0x448144){if(_0x448144){return _0x448144?{'count':_0x39008e,'rows':_0x448144}:null;}})[_0xc84c('0x24')](respondWithResult(_0x300fe6,null))[_0xc84c('0x41')](handleError(_0x300fe6,null));};exports['getDescriptions']=function(_0x46f9fe,_0x1a6898,_0x1c0b28){var _0x5df413={};var _0x37ff93={};var _0x246319;var _0x536fee;return db[_0xc84c('0x2a')]['findOne']({'where':{'id':_0x46f9fe[_0xc84c('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a6898,null))[_0xc84c('0x24')](function(_0x2bebc4){if(_0x2bebc4){_0x246319=_0x2bebc4;_0x37ff93[_0xc84c('0x30')]=_[_0xc84c('0x2f')](db[_0xc84c('0x4b')][_0xc84c('0x2b')]);_0x37ff93[_0xc84c('0x2e')]=_['keys'](_0x46f9fe[_0xc84c('0x2e')]);_0x37ff93[_0xc84c('0x39')]=_[_0xc84c('0x31')](_0x37ff93[_0xc84c('0x30')],_0x37ff93['query']);_0x5df413['attributes']=_['intersection'](_0x37ff93[_0xc84c('0x30')],qs[_0xc84c('0x32')](_0x46f9fe['query'][_0xc84c('0x32')]));_0x5df413[_0xc84c('0x33')]=_0x5df413['attributes'][_0xc84c('0x34')]?_0x5df413[_0xc84c('0x33')]:_0x37ff93[_0xc84c('0x30')];_0x5df413[_0xc84c('0x36')]=qs[_0xc84c('0x37')](_0x46f9fe[_0xc84c('0x2e')]['sort']);_0x5df413['where']=qs[_0xc84c('0x39')](_[_0xc84c('0x3a')](_0x46f9fe[_0xc84c('0x2e')],_0x37ff93['filters']));if(_0x46f9fe[_0xc84c('0x2e')][_0xc84c('0x3c')]){_0x5df413[_0xc84c('0x38')]=_[_0xc84c('0x3b')](_0x5df413[_0xc84c('0x38')],{'$or':_[_0xc84c('0x29')](_0x5df413['attributes'],function(_0x2ede0b){var _0x33a1b9={};_0x33a1b9[_0x2ede0b]={'$like':'%'+_0x46f9fe['query'][_0xc84c('0x3c')]+'%'};return _0x33a1b9;})});}_0x5df413=_[_0xc84c('0x3b')]({},_0x5df413,_0x46f9fe[_0xc84c('0x3d')]);return _0x246319[_0xc84c('0x4c')](_0x5df413);}})[_0xc84c('0x24')](function(_0x46e788){if(_0x46e788){_0x536fee=_0x46e788[_0xc84c('0x34')];if(!_0x46f9fe[_0xc84c('0x2e')]['hasOwnProperty'](_0xc84c('0x49'))){_0x5df413[_0xc84c('0x1f')]=qs[_0xc84c('0x1f')](_0x46f9fe[_0xc84c('0x2e')][_0xc84c('0x1f')]);_0x5df413[_0xc84c('0x1d')]=qs[_0xc84c('0x1d')](_0x46f9fe['query'][_0xc84c('0x1d')]);}return _0x246319[_0xc84c('0x4c')](_0x5df413);}})[_0xc84c('0x24')](function(_0x339ec1){if(_0x339ec1){return _0x339ec1?{'count':_0x536fee,'rows':_0x339ec1}:null;}})[_0xc84c('0x24')](respondWithResult(_0x1a6898,null))[_0xc84c('0x41')](handleError(_0x1a6898,null));};
\ No newline at end of file
index 7f5be74..b718e8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d9f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations'];(function(_0x101946,_0x168aca){var _0x4d9f29=function(_0x3daf39){while(--_0x3daf39){_0x101946['push'](_0x101946['shift']());}};_0x4d9f29(++_0x168aca);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0x7d9f[_0x299027];return _0x1bc622;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea38=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x202820,_0x3f5aa4){var _0x22fcda=function(_0x351764){while(--_0x351764){_0x202820['push'](_0x202820['shift']());}};_0x22fcda(++_0x3f5aa4);}(_0xea38,0x19e));var _0x8ea3=function(_0x5264cf,_0x27f100){_0x5264cf=_0x5264cf-0x0;var _0x2324da=_0xea38[_0x5264cf];return _0x2324da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8ea3('0x0'))(_0x8ea3('0x1'));var moment=require(_0x8ea3('0x2'));var BPromise=require(_0x8ea3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ea3('0x4'));var rimraf=require(_0x8ea3('0x5'));var config=require(_0x8ea3('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x434eba,_0x522d06){return _0x434eba['define'](_0x8ea3('0x7'),attributes,{'tableName':_0x8ea3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2b9c80..0bce5d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed0=['jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4dcf15,_0x1cb30f){var _0x512f9e=function(_0x3df96b){while(--_0x3df96b){_0x4dcf15['push'](_0x4dcf15['shift']());}};_0x512f9e(++_0x1cb30f);}(_0xfed0,0xad));var _0x0fed=function(_0x539f2f,_0x263f39){_0x539f2f=_0x539f2f-0x0;var _0x1cd080=_0xfed0[_0x539f2f];return _0x1cd080;};'use strict';var _=require(_0x0fed('0x0'));var util=require(_0x0fed('0x1'));var moment=require(_0x0fed('0x2'));var BPromise=require(_0x0fed('0x3'));var rs=require(_0x0fed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0fed('0x5'));var logger=require(_0x0fed('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fed('0x7'));var client=jayson[_0x0fed('0x8')][_0x0fed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d44d8,_0x109c0b,_0x33b012){return new BPromise(function(_0x327b5b,_0x4c0fc2){return client[_0x0fed('0xa')](_0x1d44d8,_0x33b012)[_0x0fed('0xb')](function(_0xa9e8dd){logger['info'](_0x0fed('0xc'),_0x109c0b,_0x0fed('0xd'));logger[_0x0fed('0xe')](_0x0fed('0xf'),_0x109c0b,_0x0fed('0xd'),JSON[_0x0fed('0x10')](_0xa9e8dd));if(_0xa9e8dd[_0x0fed('0x11')]){if(_0xa9e8dd[_0x0fed('0x11')]['code']===0x1f4){logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0xa9e8dd[_0x0fed('0x11')]['message']);return _0x4c0fc2(_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);}logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);return _0x327b5b(_0xa9e8dd[_0x0fed('0x11')][_0x0fed('0x12')]);}else{logger['info'](_0x0fed('0xc'),_0x109c0b,'request\x20sent');_0x327b5b(_0xa9e8dd['result'][_0x0fed('0x12')]);}})[_0x0fed('0x13')](function(_0x538367){logger[_0x0fed('0x11')](_0x0fed('0xc'),_0x109c0b,_0x538367);_0x4c0fc2(_0x538367);});});}
\ No newline at end of file
+var _0x54e0=['../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','ioredis','../../mysqldb'];(function(_0x2be116,_0x410695){var _0x3fbfde=function(_0xabf95){while(--_0xabf95){_0x2be116['push'](_0x2be116['shift']());}};_0x3fbfde(++_0x410695);}(_0x54e0,0x1b1));var _0x054e=function(_0x36977b,_0x56d819){_0x36977b=_0x36977b-0x0;var _0x2b6e30=_0x54e0[_0x36977b];return _0x2b6e30;};'use strict';var _=require('lodash');var util=require(_0x054e('0x0'));var moment=require(_0x054e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x054e('0x2'));var db=require(_0x054e('0x3'))['db'];var utils=require(_0x054e('0x4'));var logger=require(_0x054e('0x5'))('rpc');var config=require(_0x054e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x054e('0x7')][_0x054e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x295464,_0x26c92c,_0x43a0b3){return new BPromise(function(_0x11440d,_0x1eb36b){return client[_0x054e('0x9')](_0x295464,_0x43a0b3)['then'](function(_0x45e1a1){logger[_0x054e('0xa')](_0x054e('0xb'),_0x26c92c,_0x054e('0xc'));logger['debug'](_0x054e('0xd'),_0x26c92c,'request\x20sent',JSON[_0x054e('0xe')](_0x45e1a1));if(_0x45e1a1[_0x054e('0xf')]){if(_0x45e1a1['error'][_0x054e('0x10')]===0x1f4){logger[_0x054e('0xf')](_0x054e('0xb'),_0x26c92c,_0x45e1a1[_0x054e('0xf')][_0x054e('0x11')]);return _0x1eb36b(_0x45e1a1[_0x054e('0xf')]['message']);}logger[_0x054e('0xf')](_0x054e('0xb'),_0x26c92c,_0x45e1a1[_0x054e('0xf')][_0x054e('0x11')]);return _0x11440d(_0x45e1a1['error'][_0x054e('0x11')]);}else{logger[_0x054e('0xa')](_0x054e('0xb'),_0x26c92c,_0x054e('0xc'));_0x11440d(_0x45e1a1['result']['message']);}})[_0x054e('0x12')](function(_0x246a9d){logger[_0x054e('0xf')](_0x054e('0xb'),_0x26c92c,_0x246a9d);_0x1eb36b(_0x246a9d);});});}
\ No newline at end of file
index eb0eaaf..21cbf96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x442b=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1e688e,_0x24b312){var _0x251a55=function(_0x13f06e){while(--_0x13f06e){_0x1e688e['push'](_0x1e688e['shift']());}};_0x251a55(++_0x24b312);}(_0x442b,0x1a8));var _0xb442=function(_0xea539e,_0x212211){_0xea539e=_0xea539e-0x0;var _0x1100d2=_0x442b[_0xea539e];return _0x1100d2;};'use strict';var multer=require(_0xb442('0x0'));var util=require(_0xb442('0x1'));var path=require(_0xb442('0x2'));var timeout=require(_0xb442('0x3'));var express=require('express');var router=express[_0xb442('0x4')]();var fs_extra=require(_0xb442('0x5'));var auth=require(_0xb442('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb442('0x7'));var controller=require('./intSalesforceField.controller');router[_0xb442('0x8')]('/',auth[_0xb442('0x9')](),controller[_0xb442('0xa')]);router['get'](_0xb442('0xb'),auth[_0xb442('0x9')](),controller[_0xb442('0xc')]);router[_0xb442('0xd')]('/',auth[_0xb442('0x9')](),controller[_0xb442('0xe')]);router[_0xb442('0xf')]('/:id',auth[_0xb442('0x9')](),controller[_0xb442('0x10')]);router[_0xb442('0x11')]('/:id',auth[_0xb442('0x9')](),controller[_0xb442('0x12')]);module[_0xb442('0x13')]=router;
\ No newline at end of file
+var _0x57b3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3a43ba,_0x1c5ef2){var _0x31f102=function(_0x2718e3){while(--_0x2718e3){_0x3a43ba['push'](_0x3a43ba['shift']());}};_0x31f102(++_0x1c5ef2);}(_0x57b3,0x152));var _0x357b=function(_0x5f37d4,_0x41869d){_0x5f37d4=_0x5f37d4-0x0;var _0x32721d=_0x57b3[_0x5f37d4];return _0x32721d;};'use strict';var multer=require('multer');var util=require(_0x357b('0x0'));var path=require('path');var timeout=require(_0x357b('0x1'));var express=require(_0x357b('0x2'));var router=express[_0x357b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x357b('0x4'));var interaction=require(_0x357b('0x5'));var config=require(_0x357b('0x6'));var controller=require(_0x357b('0x7'));router[_0x357b('0x8')]('/',auth[_0x357b('0x9')](),controller[_0x357b('0xa')]);router[_0x357b('0x8')](_0x357b('0xb'),auth[_0x357b('0x9')](),controller['show']);router[_0x357b('0xc')]('/',auth[_0x357b('0x9')](),controller['create']);router[_0x357b('0xd')]('/:id',auth[_0x357b('0x9')](),controller[_0x357b('0xe')]);router[_0x357b('0xf')]('/:id',auth[_0x357b('0x9')](),controller[_0x357b('0x10')]);module[_0x357b('0x11')]=router;
\ No newline at end of file
index 808b762..47203d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41fe=['ENUM','string','variable','customVariable','keyValue','STRING','sequelize','exports'];(function(_0x2c3bcc,_0x4b7aa6){var _0x3ba84f=function(_0x2b9ee3){while(--_0x2b9ee3){_0x2c3bcc['push'](_0x2c3bcc['shift']());}};_0x3ba84f(++_0x4b7aa6);}(_0x41fe,0x66));var _0xe41f=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x41fe[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xe41f('0x0'));module[_0xe41f('0x1')]={'type':{'type':Sequelize[_0xe41f('0x2')](_0xe41f('0x3'),_0xe41f('0x4'),_0xe41f('0x5'),_0xe41f('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe41f('0x7')]},'keyType':{'type':Sequelize[_0xe41f('0x2')](_0xe41f('0x3'),_0xe41f('0x4'),_0xe41f('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd575=['sequelize','string','customVariable','STRING','variable'];(function(_0x41dfa1,_0x3f07ca){var _0x26af73=function(_0x56599a){while(--_0x56599a){_0x41dfa1['push'](_0x41dfa1['shift']());}};_0x26af73(++_0x3f07ca);}(_0xd575,0x113));var _0x5d57=function(_0x151262,_0x3fd888){_0x151262=_0x151262-0x0;var _0x2ec73e=_0xd575[_0x151262];return _0x2ec73e;};'use strict';var Sequelize=require(_0x5d57('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x5d57('0x1'),'variable',_0x5d57('0x2'),'keyValue','picklist'),'defaultValue':_0x5d57('0x1')},'content':{'type':Sequelize[_0x5d57('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x5d57('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5d57('0x3')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x5d57('0x3')]}};
\ No newline at end of file
index c3c614f..fed6a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57de=['lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','update','then','destroy','stack','SalesforceField','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5517b7,_0x2aa839){var _0x43129f=function(_0x266126){while(--_0x266126){_0x5517b7['push'](_0x5517b7['shift']());}};_0x43129f(++_0x2aa839);}(_0x57de,0x1a5));var _0xe57d=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x57de[_0x21de89];return _0x290b7e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe57d('0x0'));var jsonpatch=require(_0xe57d('0x1'));var rp=require(_0xe57d('0x2'));var moment=require(_0xe57d('0x3'));var BPromise=require(_0xe57d('0x4'));var Mustache=require('mustache');var util=require(_0xe57d('0x5'));var path=require(_0xe57d('0x6'));var sox=require(_0xe57d('0x7'));var csv=require(_0xe57d('0x8'));var ejs=require(_0xe57d('0x9'));var fs=require('fs');var fs_extra=require(_0xe57d('0xa'));var _=require(_0xe57d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe57d('0x8'));var querystring=require('querystring');var Papa=require(_0xe57d('0xc'));var Redis=require(_0xe57d('0xd'));var authService=require(_0xe57d('0xe'));var qs=require(_0xe57d('0xf'));var as=require(_0xe57d('0x10'));var hardwareService=require(_0xe57d('0x11'));var logger=require('../../config/logger')(_0xe57d('0x12'));var utils=require(_0xe57d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe57d('0x14'));var db=require(_0xe57d('0x15'))['db'];function respondWithStatusCode(_0xdab65e,_0x5dfeb9){_0x5dfeb9=_0x5dfeb9||0xcc;return function(_0x477a5a){if(_0x477a5a){return _0xdab65e[_0xe57d('0x16')](_0x5dfeb9);}return _0xdab65e[_0xe57d('0x17')](_0x5dfeb9)[_0xe57d('0x18')]();};}function respondWithResult(_0x166e79,_0xe8ce04){_0xe8ce04=_0xe8ce04||0xc8;return function(_0x18c866){if(_0x18c866){return _0x166e79[_0xe57d('0x17')](_0xe8ce04)[_0xe57d('0x19')](_0x18c866);}};}function respondWithFilteredResult(_0x511a8f,_0x616603){return function(_0x5baa0c){if(_0x5baa0c){var _0x2221cd=typeof _0x616603['offset']===_0xe57d('0x1a')&&typeof _0x616603['limit']===_0xe57d('0x1a');var _0x4037f4=_0x5baa0c[_0xe57d('0x1b')];var _0x57adc8=_0x2221cd?0x0:_0x616603[_0xe57d('0x1c')];var _0x24308d=_0x2221cd?_0x5baa0c['count']:_0x616603[_0xe57d('0x1c')]+_0x616603['limit'];var _0x8ee38d;if(_0x24308d>=_0x4037f4){_0x24308d=_0x4037f4;_0x8ee38d=0xc8;}else{_0x8ee38d=0xce;}_0x511a8f['status'](_0x8ee38d);return _0x511a8f[_0xe57d('0x1d')]('Content-Range',_0x57adc8+'-'+_0x24308d+'/'+_0x4037f4)[_0xe57d('0x19')](_0x5baa0c);}return null;};}function patchUpdates(_0x4663f4){return function(_0x292832){try{jsonpatch[_0xe57d('0x1e')](_0x292832,_0x4663f4,!![]);}catch(_0x265a0e){return BPromise[_0xe57d('0x1f')](_0x265a0e);}return _0x292832['save']();};}function saveUpdates(_0x5be81a,_0x201901){return function(_0x284d8c){if(_0x284d8c){return _0x284d8c[_0xe57d('0x20')](_0x5be81a)[_0xe57d('0x21')](function(_0x2e5c33){return _0x2e5c33;});}return null;};}function removeEntity(_0x5df788,_0x4d8851){return function(_0x5d1cbc){if(_0x5d1cbc){return _0x5d1cbc[_0xe57d('0x22')]()['then'](function(){_0x5df788[_0xe57d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdec916,_0x51ea81){return function(_0x321299){if(!_0x321299){_0xdec916[_0xe57d('0x16')](0x194);}return _0x321299;};}function handleError(_0x385da3,_0x322bb9){_0x322bb9=_0x322bb9||0x1f4;return function(_0x2769a8){logger['error'](_0x2769a8[_0xe57d('0x23')]);if(_0x2769a8['name']){delete _0x2769a8['name'];}_0x385da3[_0xe57d('0x17')](_0x322bb9)['send'](_0x2769a8);};}exports['index']=function(_0x1e08f0,_0xc311b5){var _0x80c6ab={},_0x5c27e9={},_0x5f4a80={'count':0x0,'rows':[]};var _0x42e579=_['map'](db[_0xe57d('0x24')][_0xe57d('0x25')],function(_0x2400e6){return{'name':_0x2400e6[_0xe57d('0x26')],'type':_0x2400e6[_0xe57d('0x27')][_0xe57d('0x28')]};});_0x5c27e9[_0xe57d('0x29')]=_[_0xe57d('0x2a')](_0x42e579,_0xe57d('0x2b'));_0x5c27e9[_0xe57d('0x2c')]=_[_0xe57d('0x2d')](_0x1e08f0['query']);_0x5c27e9[_0xe57d('0x2e')]=_['intersection'](_0x5c27e9[_0xe57d('0x29')],_0x5c27e9[_0xe57d('0x2c')]);_0x80c6ab[_0xe57d('0x2f')]=_[_0xe57d('0x30')](_0x5c27e9[_0xe57d('0x29')],qs[_0xe57d('0x31')](_0x1e08f0['query']['fields']));_0x80c6ab[_0xe57d('0x2f')]=_0x80c6ab['attributes'][_0xe57d('0x32')]?_0x80c6ab[_0xe57d('0x2f')]:_0x5c27e9[_0xe57d('0x29')];if(!_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x33')](_0xe57d('0x34'))){_0x80c6ab['limit']=qs[_0xe57d('0x35')](_0x1e08f0[_0xe57d('0x2c')]['limit']);_0x80c6ab[_0xe57d('0x1c')]=qs[_0xe57d('0x1c')](_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x1c')]);}_0x80c6ab[_0xe57d('0x36')]=qs[_0xe57d('0x37')](_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x37')]);_0x80c6ab[_0xe57d('0x38')]=qs[_0xe57d('0x2e')](_[_0xe57d('0x39')](_0x1e08f0[_0xe57d('0x2c')],_0x5c27e9['filters']),_0x42e579);if(_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x3a')]){_0x80c6ab[_0xe57d('0x38')]=_[_0xe57d('0x3b')](_0x80c6ab[_0xe57d('0x38')],{'$or':_[_0xe57d('0x2a')](_0x42e579,function(_0x47c5ba){if(_0x47c5ba['type']!==_0xe57d('0x3c')){var _0x475476={};_0x475476[_0x47c5ba['name']]={'$like':'%'+_0x1e08f0[_0xe57d('0x2c')][_0xe57d('0x3a')]+'%'};return _0x475476;}})});}_0x80c6ab=_[_0xe57d('0x3b')]({},_0x80c6ab,_0x1e08f0[_0xe57d('0x3d')]);var _0x353c5f={'where':_0x80c6ab[_0xe57d('0x38')]};return db[_0xe57d('0x24')][_0xe57d('0x1b')](_0x353c5f)['then'](function(_0x245274){_0x5f4a80[_0xe57d('0x1b')]=_0x245274;if(_0x1e08f0['query'][_0xe57d('0x3e')]){_0x80c6ab['include']=[{'all':!![]}];}return db[_0xe57d('0x24')][_0xe57d('0x3f')](_0x80c6ab);})[_0xe57d('0x21')](function(_0x1a0da8){_0x5f4a80[_0xe57d('0x40')]=_0x1a0da8;return _0x5f4a80;})[_0xe57d('0x21')](respondWithFilteredResult(_0xc311b5,_0x80c6ab))[_0xe57d('0x41')](handleError(_0xc311b5,null));};exports[_0xe57d('0x42')]=function(_0x37cbb8,_0x10f091){var _0x13ab7b={'raw':!![],'where':{'id':_0x37cbb8[_0xe57d('0x43')]['id']}},_0x2d5488={};_0x2d5488[_0xe57d('0x29')]=_[_0xe57d('0x2d')](db[_0xe57d('0x24')][_0xe57d('0x25')]);_0x2d5488[_0xe57d('0x2c')]=_['keys'](_0x37cbb8['query']);_0x2d5488['filters']=_[_0xe57d('0x30')](_0x2d5488[_0xe57d('0x29')],_0x2d5488[_0xe57d('0x2c')]);_0x13ab7b['attributes']=_[_0xe57d('0x30')](_0x2d5488[_0xe57d('0x29')],qs['fields'](_0x37cbb8[_0xe57d('0x2c')][_0xe57d('0x31')]));_0x13ab7b['attributes']=_0x13ab7b[_0xe57d('0x2f')][_0xe57d('0x32')]?_0x13ab7b[_0xe57d('0x2f')]:_0x2d5488['model'];if(_0x37cbb8[_0xe57d('0x2c')][_0xe57d('0x3e')]){_0x13ab7b[_0xe57d('0x44')]=[{'all':!![]}];}_0x13ab7b=_[_0xe57d('0x3b')]({},_0x13ab7b,_0x37cbb8['options']);return db[_0xe57d('0x24')][_0xe57d('0x45')](_0x13ab7b)['then'](handleEntityNotFound(_0x10f091,null))[_0xe57d('0x21')](respondWithResult(_0x10f091,null))[_0xe57d('0x41')](handleError(_0x10f091,null));};exports['create']=function(_0x40e54c,_0x195d3d){return db[_0xe57d('0x24')][_0xe57d('0x46')](_0x40e54c[_0xe57d('0x47')],{})[_0xe57d('0x21')](respondWithResult(_0x195d3d,0xc9))[_0xe57d('0x41')](handleError(_0x195d3d,null));};exports[_0xe57d('0x20')]=function(_0x7852d9,_0x56091c){if(_0x7852d9[_0xe57d('0x47')]['id']){delete _0x7852d9[_0xe57d('0x47')]['id'];}return db[_0xe57d('0x24')]['find']({'where':{'id':_0x7852d9['params']['id']}})[_0xe57d('0x21')](handleEntityNotFound(_0x56091c,null))['then'](saveUpdates(_0x7852d9[_0xe57d('0x47')],null))[_0xe57d('0x21')](respondWithResult(_0x56091c,null))['catch'](handleError(_0x56091c,null));};exports[_0xe57d('0x22')]=function(_0x4cfcfe,_0x24ef29){return db[_0xe57d('0x24')]['find']({'where':{'id':_0x4cfcfe[_0xe57d('0x43')]['id']}})[_0xe57d('0x21')](handleEntityNotFound(_0x24ef29,null))['then'](removeEntity(_0x24ef29,null))[_0xe57d('0x41')](handleError(_0x24ef29,null));};
\ No newline at end of file
+var _0xd4f5=['pick','filter','merge','options','SalesforceField','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','stack','send','index','map','rawAttributes','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x585180,_0x22ebf9){var _0x54a87f=function(_0x4a5c67){while(--_0x4a5c67){_0x585180['push'](_0x585180['shift']());}};_0x54a87f(++_0x22ebf9);}(_0xd4f5,0x1d8));var _0x5d4f=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xd4f5[_0x30b0d8];return _0x459c09;};'use strict';var emlformat=require(_0x5d4f('0x0'));var rimraf=require(_0x5d4f('0x1'));var zipdir=require(_0x5d4f('0x2'));var jsonpatch=require(_0x5d4f('0x3'));var rp=require(_0x5d4f('0x4'));var moment=require(_0x5d4f('0x5'));var BPromise=require(_0x5d4f('0x6'));var Mustache=require(_0x5d4f('0x7'));var util=require(_0x5d4f('0x8'));var path=require('path');var sox=require(_0x5d4f('0x9'));var csv=require(_0x5d4f('0xa'));var ejs=require(_0x5d4f('0xb'));var fs=require('fs');var fs_extra=require(_0x5d4f('0xc'));var _=require(_0x5d4f('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5d4f('0xe'));var deskjs=require(_0x5d4f('0xf'));var toCsv=require(_0x5d4f('0xa'));var querystring=require(_0x5d4f('0x10'));var Papa=require(_0x5d4f('0x11'));var Redis=require(_0x5d4f('0x12'));var authService=require(_0x5d4f('0x13'));var qs=require(_0x5d4f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d4f('0x15'));var logger=require(_0x5d4f('0x16'))(_0x5d4f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d4f('0x18'));var db=require(_0x5d4f('0x19'))['db'];function respondWithStatusCode(_0x1cf5d0,_0x2c1b0b){_0x2c1b0b=_0x2c1b0b||0xcc;return function(_0x4d4a26){if(_0x4d4a26){return _0x1cf5d0[_0x5d4f('0x1a')](_0x2c1b0b);}return _0x1cf5d0[_0x5d4f('0x1b')](_0x2c1b0b)[_0x5d4f('0x1c')]();};}function respondWithResult(_0x1ea2f9,_0x8cbb79){_0x8cbb79=_0x8cbb79||0xc8;return function(_0x54f56e){if(_0x54f56e){return _0x1ea2f9[_0x5d4f('0x1b')](_0x8cbb79)[_0x5d4f('0x1d')](_0x54f56e);}};}function respondWithFilteredResult(_0x5c86b5,_0x379df5){return function(_0x4bca9e){if(_0x4bca9e){var _0x44bd25=typeof _0x379df5[_0x5d4f('0x1e')]===_0x5d4f('0x1f')&&typeof _0x379df5[_0x5d4f('0x20')]===_0x5d4f('0x1f');var _0x5ea551=_0x4bca9e[_0x5d4f('0x21')];var _0x264833=_0x44bd25?0x0:_0x379df5['offset'];var _0x838b44=_0x44bd25?_0x4bca9e[_0x5d4f('0x21')]:_0x379df5[_0x5d4f('0x1e')]+_0x379df5[_0x5d4f('0x20')];var _0x35094f;if(_0x838b44>=_0x5ea551){_0x838b44=_0x5ea551;_0x35094f=0xc8;}else{_0x35094f=0xce;}_0x5c86b5[_0x5d4f('0x1b')](_0x35094f);return _0x5c86b5[_0x5d4f('0x22')]('Content-Range',_0x264833+'-'+_0x838b44+'/'+_0x5ea551)[_0x5d4f('0x1d')](_0x4bca9e);}return null;};}function patchUpdates(_0x642fb8){return function(_0x4265eb){try{jsonpatch[_0x5d4f('0x23')](_0x4265eb,_0x642fb8,!![]);}catch(_0x634a82){return BPromise[_0x5d4f('0x24')](_0x634a82);}return _0x4265eb['save']();};}function saveUpdates(_0x4aec1d,_0x23941c){return function(_0x3a91){if(_0x3a91){return _0x3a91['update'](_0x4aec1d)[_0x5d4f('0x25')](function(_0x151684){return _0x151684;});}return null;};}function removeEntity(_0x51ff02,_0x2737b1){return function(_0x2c5472){if(_0x2c5472){return _0x2c5472[_0x5d4f('0x26')]()[_0x5d4f('0x25')](function(){_0x51ff02[_0x5d4f('0x1b')](0xcc)[_0x5d4f('0x1c')]();});}};}function handleEntityNotFound(_0x33d790,_0x5d43d1){return function(_0x4fdbff){if(!_0x4fdbff){_0x33d790[_0x5d4f('0x1a')](0x194);}return _0x4fdbff;};}function handleError(_0xfc6ae8,_0x529f59){_0x529f59=_0x529f59||0x1f4;return function(_0x2a761f){logger[_0x5d4f('0x27')](_0x2a761f[_0x5d4f('0x28')]);if(_0x2a761f['name']){delete _0x2a761f['name'];}_0xfc6ae8[_0x5d4f('0x1b')](_0x529f59)[_0x5d4f('0x29')](_0x2a761f);};}exports[_0x5d4f('0x2a')]=function(_0x2af330,_0x5ed2a9){var _0x3ff3ac={},_0x1ac372={},_0x36b5e9={'count':0x0,'rows':[]};var _0x11b9d4=_[_0x5d4f('0x2b')](db['SalesforceField'][_0x5d4f('0x2c')],function(_0x57b78c){return{'name':_0x57b78c['fieldName'],'type':_0x57b78c[_0x5d4f('0x2d')][_0x5d4f('0x2e')]};});_0x1ac372[_0x5d4f('0x2f')]=_[_0x5d4f('0x2b')](_0x11b9d4,_0x5d4f('0x30'));_0x1ac372[_0x5d4f('0x31')]=_[_0x5d4f('0x32')](_0x2af330[_0x5d4f('0x31')]);_0x1ac372['filters']=_[_0x5d4f('0x33')](_0x1ac372['model'],_0x1ac372[_0x5d4f('0x31')]);_0x3ff3ac['attributes']=_['intersection'](_0x1ac372[_0x5d4f('0x2f')],qs[_0x5d4f('0x34')](_0x2af330[_0x5d4f('0x31')][_0x5d4f('0x34')]));_0x3ff3ac[_0x5d4f('0x35')]=_0x3ff3ac[_0x5d4f('0x35')]['length']?_0x3ff3ac['attributes']:_0x1ac372[_0x5d4f('0x2f')];if(!_0x2af330['query'][_0x5d4f('0x36')](_0x5d4f('0x37'))){_0x3ff3ac['limit']=qs['limit'](_0x2af330[_0x5d4f('0x31')][_0x5d4f('0x20')]);_0x3ff3ac[_0x5d4f('0x1e')]=qs[_0x5d4f('0x1e')](_0x2af330[_0x5d4f('0x31')][_0x5d4f('0x1e')]);}_0x3ff3ac[_0x5d4f('0x38')]=qs[_0x5d4f('0x39')](_0x2af330[_0x5d4f('0x31')]['sort']);_0x3ff3ac[_0x5d4f('0x3a')]=qs[_0x5d4f('0x3b')](_[_0x5d4f('0x3c')](_0x2af330[_0x5d4f('0x31')],_0x1ac372['filters']),_0x11b9d4);if(_0x2af330[_0x5d4f('0x31')][_0x5d4f('0x3d')]){_0x3ff3ac[_0x5d4f('0x3a')]=_[_0x5d4f('0x3e')](_0x3ff3ac[_0x5d4f('0x3a')],{'$or':_[_0x5d4f('0x2b')](_0x11b9d4,function(_0x47a0ad){if(_0x47a0ad[_0x5d4f('0x2d')]!=='VIRTUAL'){var _0x34a2c7={};_0x34a2c7[_0x47a0ad[_0x5d4f('0x30')]]={'$like':'%'+_0x2af330['query'][_0x5d4f('0x3d')]+'%'};return _0x34a2c7;}})});}_0x3ff3ac=_[_0x5d4f('0x3e')]({},_0x3ff3ac,_0x2af330[_0x5d4f('0x3f')]);var _0x9cabc4={'where':_0x3ff3ac[_0x5d4f('0x3a')]};return db[_0x5d4f('0x40')][_0x5d4f('0x21')](_0x9cabc4)[_0x5d4f('0x25')](function(_0x45aeb4){_0x36b5e9[_0x5d4f('0x21')]=_0x45aeb4;if(_0x2af330[_0x5d4f('0x31')][_0x5d4f('0x41')]){_0x3ff3ac[_0x5d4f('0x42')]=[{'all':!![]}];}return db[_0x5d4f('0x40')][_0x5d4f('0x43')](_0x3ff3ac);})[_0x5d4f('0x25')](function(_0x222b7d){_0x36b5e9[_0x5d4f('0x44')]=_0x222b7d;return _0x36b5e9;})[_0x5d4f('0x25')](respondWithFilteredResult(_0x5ed2a9,_0x3ff3ac))[_0x5d4f('0x45')](handleError(_0x5ed2a9,null));};exports[_0x5d4f('0x46')]=function(_0x17992f,_0x42b9e4){var _0x29d1fc={'raw':!![],'where':{'id':_0x17992f[_0x5d4f('0x47')]['id']}},_0x237223={};_0x237223['model']=_[_0x5d4f('0x32')](db['SalesforceField'][_0x5d4f('0x2c')]);_0x237223['query']=_[_0x5d4f('0x32')](_0x17992f[_0x5d4f('0x31')]);_0x237223[_0x5d4f('0x3b')]=_[_0x5d4f('0x33')](_0x237223[_0x5d4f('0x2f')],_0x237223[_0x5d4f('0x31')]);_0x29d1fc['attributes']=_[_0x5d4f('0x33')](_0x237223['model'],qs[_0x5d4f('0x34')](_0x17992f['query'][_0x5d4f('0x34')]));_0x29d1fc[_0x5d4f('0x35')]=_0x29d1fc['attributes'][_0x5d4f('0x48')]?_0x29d1fc['attributes']:_0x237223[_0x5d4f('0x2f')];if(_0x17992f[_0x5d4f('0x31')]['includeAll']){_0x29d1fc[_0x5d4f('0x42')]=[{'all':!![]}];}_0x29d1fc=_['merge']({},_0x29d1fc,_0x17992f[_0x5d4f('0x3f')]);return db[_0x5d4f('0x40')][_0x5d4f('0x49')](_0x29d1fc)[_0x5d4f('0x25')](handleEntityNotFound(_0x42b9e4,null))[_0x5d4f('0x25')](respondWithResult(_0x42b9e4,null))['catch'](handleError(_0x42b9e4,null));};exports['create']=function(_0x3a3c95,_0x452979){return db['SalesforceField'][_0x5d4f('0x4a')](_0x3a3c95[_0x5d4f('0x4b')],{})['then'](respondWithResult(_0x452979,0xc9))[_0x5d4f('0x45')](handleError(_0x452979,null));};exports['update']=function(_0x46aa28,_0x203a86){if(_0x46aa28['body']['id']){delete _0x46aa28[_0x5d4f('0x4b')]['id'];}return db[_0x5d4f('0x40')][_0x5d4f('0x49')]({'where':{'id':_0x46aa28['params']['id']}})[_0x5d4f('0x25')](handleEntityNotFound(_0x203a86,null))[_0x5d4f('0x25')](saveUpdates(_0x46aa28[_0x5d4f('0x4b')],null))[_0x5d4f('0x25')](respondWithResult(_0x203a86,null))[_0x5d4f('0x45')](handleError(_0x203a86,null));};exports['destroy']=function(_0x1ddca6,_0x258dea){return db[_0x5d4f('0x40')][_0x5d4f('0x49')]({'where':{'id':_0x1ddca6[_0x5d4f('0x47')]['id']}})[_0x5d4f('0x25')](handleEntityNotFound(_0x258dea,null))[_0x5d4f('0x25')](removeEntity(_0x258dea,null))[_0x5d4f('0x45')](handleError(_0x258dea,null));};
\ No newline at end of file
index 7b349a4..2ceb4d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60e0=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceField','int_salesforce_fields'];(function(_0xe6ae55,_0x1bbd86){var _0x4c1419=function(_0x22241b){while(--_0x22241b){_0xe6ae55['push'](_0xe6ae55['shift']());}};_0x4c1419(++_0x1bbd86);}(_0x60e0,0x1f2));var _0x060e=function(_0x1fe4cb,_0x58f173){_0x1fe4cb=_0x1fe4cb-0x0;var _0x1ea0e7=_0x60e0[_0x1fe4cb];return _0x1ea0e7;};'use strict';var _=require(_0x060e('0x0'));var util=require(_0x060e('0x1'));var logger=require(_0x060e('0x2'))('api');var moment=require(_0x060e('0x3'));var BPromise=require(_0x060e('0x4'));var rp=require(_0x060e('0x5'));var fs=require('fs');var path=require(_0x060e('0x6'));var rimraf=require('rimraf');var config=require(_0x060e('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x060e('0x8')]=function(_0x4c8e00,_0x2b6253){return _0x4c8e00[_0x060e('0x9')](_0x060e('0xa'),attributes,{'tableName':_0x060e('0xb'),'paranoid':![],'indexes':[{'name':_0x060e('0xc'),'fields':[_0x060e('0xd'),_0x060e('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x65b0=['FieldId','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','salesforce_unique_index','idField'];(function(_0x26faab,_0x3a15be){var _0x18bac1=function(_0x2ce4d9){while(--_0x2ce4d9){_0x26faab['push'](_0x26faab['shift']());}};_0x18bac1(++_0x3a15be);}(_0x65b0,0x1a5));var _0x065b=function(_0x4e9e82,_0x42a559){_0x4e9e82=_0x4e9e82-0x0;var _0x3ca592=_0x65b0[_0x4e9e82];return _0x3ca592;};'use strict';var _=require('lodash');var util=require(_0x065b('0x0'));var logger=require(_0x065b('0x1'))(_0x065b('0x2'));var moment=require('moment');var BPromise=require(_0x065b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x065b('0x4'));var config=require(_0x065b('0x5'));var attributes=require(_0x065b('0x6'));module[_0x065b('0x7')]=function(_0x461edb,_0x35bec7){return _0x461edb[_0x065b('0x8')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x065b('0x9'),'fields':[_0x065b('0xa'),_0x065b('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c1488ca..156aa95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5302=['ioredis','rpc','../../config/environment','jayson/promise','http','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5302,0x151));var _0x2530=function(_0x1189b5,_0x25084b){_0x1189b5=_0x1189b5-0x0;var _0x4cce46=_0x5302[_0x1189b5];return _0x4cce46;};'use strict';var _=require(_0x2530('0x0'));var util=require(_0x2530('0x1'));var moment=require(_0x2530('0x2'));var BPromise=require(_0x2530('0x3'));var rs=require(_0x2530('0x4'));var fs=require('fs');var Redis=require(_0x2530('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2530('0x6'));var config=require(_0x2530('0x7'));var jayson=require(_0x2530('0x8'));var client=jayson['client'][_0x2530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cb444,_0x25896e,_0x4c272e){return new BPromise(function(_0x1ee8ad,_0x66f824){return client['request'](_0x3cb444,_0x4c272e)['then'](function(_0xca6396){logger['info'](_0x2530('0xa'),_0x25896e,_0x2530('0xb'));logger[_0x2530('0xc')](_0x2530('0xd'),_0x25896e,_0x2530('0xb'),JSON['stringify'](_0xca6396));if(_0xca6396[_0x2530('0xe')]){if(_0xca6396[_0x2530('0xe')][_0x2530('0xf')]===0x1f4){logger['error'](_0x2530('0xa'),_0x25896e,_0xca6396[_0x2530('0xe')][_0x2530('0x10')]);return _0x66f824(_0xca6396[_0x2530('0xe')]['message']);}logger[_0x2530('0xe')](_0x2530('0xa'),_0x25896e,_0xca6396[_0x2530('0xe')]['message']);return _0x1ee8ad(_0xca6396['error'][_0x2530('0x10')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x25896e,_0x2530('0xb'));_0x1ee8ad(_0xca6396[_0x2530('0x11')][_0x2530('0x10')]);}})['catch'](function(_0x43aedc){logger[_0x2530('0xe')](_0x2530('0xa'),_0x25896e,_0x43aedc);_0x66f824(_0x43aedc);});});}
\ No newline at end of file
+var _0x22dc=['bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x22dc,0x10d));var _0xc22d=function(_0xca7a90,_0xa75c57){_0xca7a90=_0xca7a90-0x0;var _0x1e3d6e=_0x22dc[_0xca7a90];return _0x1e3d6e;};'use strict';var _=require(_0xc22d('0x0'));var util=require(_0xc22d('0x1'));var moment=require(_0xc22d('0x2'));var BPromise=require(_0xc22d('0x3'));var rs=require(_0xc22d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc22d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc22d('0x6'))('rpc');var config=require(_0xc22d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc22d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c817e,_0x1091ad,_0x2732af){return new BPromise(function(_0x273282,_0x3f6e2b){return client['request'](_0x4c817e,_0x2732af)['then'](function(_0x4a786a){logger[_0xc22d('0x9')](_0xc22d('0xa'),_0x1091ad,_0xc22d('0xb'));logger['debug'](_0xc22d('0xc'),_0x1091ad,_0xc22d('0xb'),JSON['stringify'](_0x4a786a));if(_0x4a786a[_0xc22d('0xd')]){if(_0x4a786a[_0xc22d('0xd')][_0xc22d('0xe')]===0x1f4){logger[_0xc22d('0xd')](_0xc22d('0xa'),_0x1091ad,_0x4a786a[_0xc22d('0xd')][_0xc22d('0xf')]);return _0x3f6e2b(_0x4a786a['error'][_0xc22d('0xf')]);}logger[_0xc22d('0xd')](_0xc22d('0xa'),_0x1091ad,_0x4a786a[_0xc22d('0xd')]['message']);return _0x273282(_0x4a786a[_0xc22d('0xd')][_0xc22d('0xf')]);}else{logger[_0xc22d('0x9')](_0xc22d('0xa'),_0x1091ad,_0xc22d('0xb'));_0x273282(_0x4a786a[_0xc22d('0x10')][_0xc22d('0xf')]);}})['catch'](function(_0x2d8e61){logger[_0xc22d('0xd')](_0xc22d('0xa'),_0x1091ad,_0x2d8e61);_0x3f6e2b(_0x2d8e61);});});}
\ No newline at end of file
index 219ec2d..14bb577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x220b=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','delete','destroy'];(function(_0x2c3694,_0x350164){var _0x55cb6a=function(_0x395ec1){while(--_0x395ec1){_0x2c3694['push'](_0x2c3694['shift']());}};_0x55cb6a(++_0x350164);}(_0x220b,0x1a2));var _0xb220=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x220b[_0x460150];return _0x340677;};'use strict';var multer=require('multer');var util=require(_0xb220('0x0'));var path=require(_0xb220('0x1'));var timeout=require(_0xb220('0x2'));var express=require(_0xb220('0x3'));var router=express['Router']();var fs_extra=require(_0xb220('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb220('0x5'));var config=require('../../config/environment');var controller=require(_0xb220('0x6'));router[_0xb220('0x7')]('/',auth[_0xb220('0x8')](),controller[_0xb220('0x9')]);router['get'](_0xb220('0xa'),auth[_0xb220('0x8')](),controller['show']);router[_0xb220('0x7')](_0xb220('0xb'),auth[_0xb220('0x8')](),controller[_0xb220('0xc')]);router[_0xb220('0x7')](_0xb220('0xd'),auth[_0xb220('0x8')](),controller[_0xb220('0xe')]);router[_0xb220('0xf')]('/',auth['isAuthenticated'](),controller[_0xb220('0x10')]);router[_0xb220('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0xb220('0x8')](),controller['update']);router[_0xb220('0x11')](_0xb220('0xa'),auth[_0xb220('0x8')](),controller[_0xb220('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x2392=['show','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x521e30,_0x5326aa){var _0x3b9ce1=function(_0x288691){while(--_0x288691){_0x521e30['push'](_0x521e30['shift']());}};_0x3b9ce1(++_0x5326aa);}(_0x2392,0xd0));var _0x2239=function(_0x306aba,_0x29f305){_0x306aba=_0x306aba-0x0;var _0x5a1f58=_0x2392[_0x306aba];return _0x5a1f58;};'use strict';var multer=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var path=require('path');var timeout=require(_0x2239('0x2'));var express=require(_0x2239('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2239('0x4'));var interaction=require(_0x2239('0x5'));var config=require(_0x2239('0x6'));var controller=require(_0x2239('0x7'));router[_0x2239('0x8')]('/',auth[_0x2239('0x9')](),controller[_0x2239('0xa')]);router[_0x2239('0x8')](_0x2239('0xb'),auth[_0x2239('0x9')](),controller[_0x2239('0xc')]);router[_0x2239('0x8')](_0x2239('0xd'),auth['isAuthenticated'](),controller[_0x2239('0xe')]);router[_0x2239('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2239('0xf')]);router[_0x2239('0x10')]('/',auth[_0x2239('0x9')](),controller[_0x2239('0x11')]);router[_0x2239('0x10')](_0x2239('0xd'),auth[_0x2239('0x9')](),controller['addConfiguration']);router[_0x2239('0x12')](_0x2239('0xb'),auth['isAuthenticated'](),controller[_0x2239('0x13')]);router[_0x2239('0x14')](_0x2239('0xb'),auth[_0x2239('0x9')](),controller['destroy']);module[_0x2239('0x15')]=router;
\ No newline at end of file
index c724532..6f1e01b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949b=['sequelize','exports','STRING','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x949b,0x15c));var _0xb949=function(_0x224b38,_0x119066){_0x224b38=_0x224b38-0x0;var _0x157133=_0x949b[_0x224b38];return _0x157133;};'use strict';var Sequelize=require(_0xb949('0x0'));module[_0xb949('0x1')]={'name':{'type':Sequelize[_0xb949('0x2')]},'description':{'type':Sequelize[_0xb949('0x2')]},'username':{'type':Sequelize[_0xb949('0x2')],'unique':_0xb949('0x3')},'password':{'type':Sequelize[_0xb949('0x2')]},'email':{'type':Sequelize[_0xb949('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb949('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x9d0f=['sequelize','STRING','username'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x9d0f,0xa5));var _0xf9d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9d0f[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xf9d0('0x0'));module['exports']={'name':{'type':Sequelize[_0xf9d0('0x1')]},'description':{'type':Sequelize[_0xf9d0('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xf9d0('0x2')},'password':{'type':Sequelize[_0xf9d0('0x1')]},'email':{'type':Sequelize[_0xf9d0('0x1')]},'remoteUri':{'type':Sequelize[_0xf9d0('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf9d0('0x1')],'allowNull':![]}};
\ No newline at end of file
index 48486ac..4bb9f16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec7=['include','findAll','show','params','length','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','category','parent','caused_by','upon_reject','child_incidents','number','resolved_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','assignment_group','description','calendar_duration','notify','sys_class_name','close_notes','parent_incident','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','correlation_id','username','email','serverUrl','remoteUri','slice','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x5412bb,_0x549bbe){var _0xe625b6=function(_0x2e1d03){while(--_0x2e1d03){_0x5412bb['push'](_0x5412bb['shift']());}};_0xe625b6(++_0x549bbe);}(_0x0ec7,0x1d8));var _0x70ec=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x0ec7[_0x37bd26];return _0xe83dc4;};'use strict';var emlformat=require(_0x70ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70ec('0x1'));var jsonpatch=require(_0x70ec('0x2'));var rp=require(_0x70ec('0x3'));var moment=require(_0x70ec('0x4'));var BPromise=require(_0x70ec('0x5'));var Mustache=require(_0x70ec('0x6'));var util=require(_0x70ec('0x7'));var path=require(_0x70ec('0x8'));var sox=require(_0x70ec('0x9'));var csv=require('to-csv');var ejs=require(_0x70ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x70ec('0xc'));var deskjs=require(_0x70ec('0xd'));var toCsv=require(_0x70ec('0xe'));var querystring=require(_0x70ec('0xf'));var Papa=require(_0x70ec('0x10'));var Redis=require(_0x70ec('0x11'));var authService=require(_0x70ec('0x12'));var qs=require(_0x70ec('0x13'));var as=require(_0x70ec('0x14'));var hardwareService=require(_0x70ec('0x15'));var logger=require(_0x70ec('0x16'))(_0x70ec('0x17'));var utils=require('../../config/utils');var config=require(_0x70ec('0x18'));var licenseUtil=require(_0x70ec('0x19'));var db=require(_0x70ec('0x1a'))['db'];var integrations=require(_0x70ec('0x1b'));function respondWithStatusCode(_0x1ff498,_0x342be6){_0x342be6=_0x342be6||0xcc;return function(_0x475afb){if(_0x475afb){return _0x1ff498[_0x70ec('0x1c')](_0x342be6);}return _0x1ff498[_0x70ec('0x1d')](_0x342be6)[_0x70ec('0x1e')]();};}function respondWithResult(_0x1fc47b,_0x3aadf4){_0x3aadf4=_0x3aadf4||0xc8;return function(_0x45c00a){if(_0x45c00a){return _0x1fc47b['status'](_0x3aadf4)[_0x70ec('0x1f')](_0x45c00a);}};}function respondWithFilteredResult(_0xa6952e,_0x1d7196){return function(_0x142804){if(_0x142804){var _0x4882ae=typeof _0x1d7196['offset']===_0x70ec('0x20')&&typeof _0x1d7196['limit']===_0x70ec('0x20');var _0x394704=_0x142804[_0x70ec('0x21')];var _0x5a9d39=_0x4882ae?0x0:_0x1d7196[_0x70ec('0x22')];var _0x55aa01=_0x4882ae?_0x142804[_0x70ec('0x21')]:_0x1d7196[_0x70ec('0x22')]+_0x1d7196[_0x70ec('0x23')];var _0x44be3f;if(_0x55aa01>=_0x394704){_0x55aa01=_0x394704;_0x44be3f=0xc8;}else{_0x44be3f=0xce;}_0xa6952e[_0x70ec('0x1d')](_0x44be3f);return _0xa6952e['set'](_0x70ec('0x24'),_0x5a9d39+'-'+_0x55aa01+'/'+_0x394704)[_0x70ec('0x1f')](_0x142804);}return null;};}function patchUpdates(_0x55e66a){return function(_0x35592d){try{jsonpatch[_0x70ec('0x25')](_0x35592d,_0x55e66a,!![]);}catch(_0x1de658){return BPromise[_0x70ec('0x26')](_0x1de658);}return _0x35592d[_0x70ec('0x27')]();};}function saveUpdates(_0x4dca5a,_0xd4dd27){return function(_0x3ebfe5){if(_0x3ebfe5){return _0x3ebfe5[_0x70ec('0x28')](_0x4dca5a)['then'](function(_0x4766d0){return _0x4766d0;});}return null;};}function removeEntity(_0x438005,_0x5d6d14){return function(_0x49c214){if(_0x49c214){return _0x49c214[_0x70ec('0x29')]()[_0x70ec('0x2a')](function(){_0x438005[_0x70ec('0x1d')](0xcc)[_0x70ec('0x1e')]();});}};}function handleEntityNotFound(_0x1714bb,_0x4df239){return function(_0x279aa2){if(!_0x279aa2){_0x1714bb['sendStatus'](0x194);}return _0x279aa2;};}function handleError(_0x45df14,_0x549c77){_0x549c77=_0x549c77||0x1f4;return function(_0x4a5eae){logger[_0x70ec('0x2b')](_0x4a5eae[_0x70ec('0x2c')]);if(_0x4a5eae[_0x70ec('0x2d')]){delete _0x4a5eae[_0x70ec('0x2d')];}_0x45df14['status'](_0x549c77)['send'](_0x4a5eae);};}exports['index']=function(_0x174837,_0x4f6a40){var _0x54c5c2={},_0x473008={},_0x4fc645={'count':0x0,'rows':[]};var _0x5c9eff=_[_0x70ec('0x2e')](db[_0x70ec('0x2f')][_0x70ec('0x30')],function(_0x4206a8){return{'name':_0x4206a8[_0x70ec('0x31')],'type':_0x4206a8[_0x70ec('0x32')]['key']};});_0x473008[_0x70ec('0x33')]=_[_0x70ec('0x2e')](_0x5c9eff,'name');_0x473008[_0x70ec('0x34')]=_[_0x70ec('0x35')](_0x174837[_0x70ec('0x34')]);_0x473008[_0x70ec('0x36')]=_[_0x70ec('0x37')](_0x473008['model'],_0x473008[_0x70ec('0x34')]);_0x54c5c2[_0x70ec('0x38')]=_[_0x70ec('0x37')](_0x473008[_0x70ec('0x33')],qs[_0x70ec('0x39')](_0x174837[_0x70ec('0x34')]['fields']));_0x54c5c2[_0x70ec('0x38')]=_0x54c5c2[_0x70ec('0x38')]['length']?_0x54c5c2[_0x70ec('0x38')]:_0x473008[_0x70ec('0x33')];if(!_0x174837[_0x70ec('0x34')][_0x70ec('0x3a')](_0x70ec('0x3b'))){_0x54c5c2['limit']=qs[_0x70ec('0x23')](_0x174837[_0x70ec('0x34')]['limit']);_0x54c5c2['offset']=qs['offset'](_0x174837[_0x70ec('0x34')]['offset']);}_0x54c5c2[_0x70ec('0x3c')]=qs['sort'](_0x174837[_0x70ec('0x34')][_0x70ec('0x3d')]);_0x54c5c2['where']=qs[_0x70ec('0x36')](_['pick'](_0x174837['query'],_0x473008['filters']),_0x5c9eff);if(_0x174837[_0x70ec('0x34')][_0x70ec('0x3e')]){_0x54c5c2[_0x70ec('0x3f')]=_[_0x70ec('0x40')](_0x54c5c2['where'],{'$or':_[_0x70ec('0x2e')](_0x5c9eff,function(_0x515125){if(_0x515125[_0x70ec('0x32')]!==_0x70ec('0x41')){var _0xa4a985={};_0xa4a985[_0x515125[_0x70ec('0x2d')]]={'$like':'%'+_0x174837['query'][_0x70ec('0x3e')]+'%'};return _0xa4a985;}})});}_0x54c5c2=_['merge']({},_0x54c5c2,_0x174837[_0x70ec('0x42')]);var _0x3a8eba={'where':_0x54c5c2[_0x70ec('0x3f')]};return db['ServicenowAccount'][_0x70ec('0x21')](_0x3a8eba)[_0x70ec('0x2a')](function(_0x2ffa62){_0x4fc645['count']=_0x2ffa62;if(_0x174837['query'][_0x70ec('0x43')]){_0x54c5c2[_0x70ec('0x44')]=[{'all':!![]}];}return db[_0x70ec('0x2f')][_0x70ec('0x45')](_0x54c5c2);})['then'](function(_0x12d8ad){_0x4fc645['rows']=_0x12d8ad;return _0x4fc645;})[_0x70ec('0x2a')](respondWithFilteredResult(_0x4f6a40,_0x54c5c2))['catch'](handleError(_0x4f6a40,null));};exports[_0x70ec('0x46')]=function(_0x1a2e65,_0x46f2e2){var _0x1a584a={'raw':![],'where':{'id':_0x1a2e65[_0x70ec('0x47')]['id']}},_0x161ef7={};_0x161ef7[_0x70ec('0x33')]=_[_0x70ec('0x35')](db['ServicenowAccount'][_0x70ec('0x30')]);_0x161ef7[_0x70ec('0x34')]=_['keys'](_0x1a2e65[_0x70ec('0x34')]);_0x161ef7['filters']=_[_0x70ec('0x37')](_0x161ef7[_0x70ec('0x33')],_0x161ef7[_0x70ec('0x34')]);_0x1a584a['attributes']=_[_0x70ec('0x37')](_0x161ef7[_0x70ec('0x33')],qs[_0x70ec('0x39')](_0x1a2e65[_0x70ec('0x34')][_0x70ec('0x39')]));_0x1a584a[_0x70ec('0x38')]=_0x1a584a[_0x70ec('0x38')][_0x70ec('0x48')]?_0x1a584a[_0x70ec('0x38')]:_0x161ef7[_0x70ec('0x33')];if(_0x1a2e65[_0x70ec('0x34')][_0x70ec('0x43')]){_0x1a584a[_0x70ec('0x44')]=[{'all':!![]}];}_0x1a584a=_['merge']({},_0x1a584a,_0x1a2e65[_0x70ec('0x42')]);return db[_0x70ec('0x2f')]['find'](_0x1a584a)[_0x70ec('0x2a')](handleEntityNotFound(_0x46f2e2,null))[_0x70ec('0x2a')](respondWithResult(_0x46f2e2,null))[_0x70ec('0x49')](handleError(_0x46f2e2,null));};exports[_0x70ec('0x4a')]=function(_0xfb2a88,_0x2a0b3a){return db['ServicenowAccount']['create'](_0xfb2a88[_0x70ec('0x4b')],{})[_0x70ec('0x2a')](respondWithResult(_0x2a0b3a,0xc9))[_0x70ec('0x49')](handleError(_0x2a0b3a,null));};exports[_0x70ec('0x28')]=function(_0x2da84b,_0x4b775a){if(_0x2da84b[_0x70ec('0x4b')]['id']){delete _0x2da84b[_0x70ec('0x4b')]['id'];}return db['ServicenowAccount'][_0x70ec('0x4c')]({'where':{'id':_0x2da84b[_0x70ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b775a,null))[_0x70ec('0x2a')](saveUpdates(_0x2da84b[_0x70ec('0x4b')],null))[_0x70ec('0x2a')](respondWithResult(_0x4b775a,null))[_0x70ec('0x49')](handleError(_0x4b775a,null));};exports[_0x70ec('0x29')]=function(_0x9dbe17,_0x4a6404){return db[_0x70ec('0x2f')]['find']({'where':{'id':_0x9dbe17[_0x70ec('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a6404,null))[_0x70ec('0x2a')](removeEntity(_0x4a6404,null))[_0x70ec('0x49')](handleError(_0x4a6404,null));};exports[_0x70ec('0x4d')]=function(_0x1b9d45,_0x3407d0,_0x4e44a4){var _0x1d68e3={};var _0xdcfc12={};var _0x3b949f;var _0x213e1f;return db[_0x70ec('0x2f')][_0x70ec('0x4e')]({'where':{'id':_0x1b9d45[_0x70ec('0x47')]['id']}})[_0x70ec('0x2a')](handleEntityNotFound(_0x3407d0,null))['then'](function(_0x3d4b45){if(_0x3d4b45){_0x3b949f=_0x3d4b45;_0xdcfc12[_0x70ec('0x33')]=_[_0x70ec('0x35')](db[_0x70ec('0x4f')][_0x70ec('0x30')]);_0xdcfc12[_0x70ec('0x34')]=_['keys'](_0x1b9d45[_0x70ec('0x34')]);_0xdcfc12[_0x70ec('0x36')]=_[_0x70ec('0x37')](_0xdcfc12[_0x70ec('0x33')],_0xdcfc12[_0x70ec('0x34')]);_0x1d68e3['attributes']=_[_0x70ec('0x37')](_0xdcfc12['model'],qs[_0x70ec('0x39')](_0x1b9d45['query'][_0x70ec('0x39')]));_0x1d68e3[_0x70ec('0x38')]=_0x1d68e3[_0x70ec('0x38')][_0x70ec('0x48')]?_0x1d68e3['attributes']:_0xdcfc12['model'];_0x1d68e3[_0x70ec('0x3c')]=qs[_0x70ec('0x3d')](_0x1b9d45[_0x70ec('0x34')]['sort']);_0x1d68e3[_0x70ec('0x3f')]=qs[_0x70ec('0x36')](_[_0x70ec('0x50')](_0x1b9d45['query'],_0xdcfc12[_0x70ec('0x36')]));if(_0x1b9d45[_0x70ec('0x34')]['filter']){_0x1d68e3['where']=_[_0x70ec('0x40')](_0x1d68e3[_0x70ec('0x3f')],{'$or':_[_0x70ec('0x2e')](_0x1d68e3[_0x70ec('0x38')],function(_0x51ffe4){var _0xd9b3f0={};_0xd9b3f0[_0x51ffe4]={'$like':'%'+_0x1b9d45['query'][_0x70ec('0x3e')]+'%'};return _0xd9b3f0;})});}_0x1d68e3=_[_0x70ec('0x40')]({},_0x1d68e3,_0x1b9d45[_0x70ec('0x42')]);return _0x3b949f[_0x70ec('0x4d')](_0x1d68e3);}})[_0x70ec('0x2a')](function(_0x11047e){if(_0x11047e){_0x213e1f=_0x11047e[_0x70ec('0x48')];if(!_0x1b9d45['query'][_0x70ec('0x3a')](_0x70ec('0x3b'))){_0x1d68e3[_0x70ec('0x23')]=qs[_0x70ec('0x23')](_0x1b9d45['query'][_0x70ec('0x23')]);_0x1d68e3['offset']=qs[_0x70ec('0x22')](_0x1b9d45['query'][_0x70ec('0x22')]);}return _0x3b949f[_0x70ec('0x4d')](_0x1d68e3);}})[_0x70ec('0x2a')](function(_0x67c7e6){if(_0x67c7e6){return _0x67c7e6?{'count':_0x213e1f,'rows':_0x67c7e6}:null;}})[_0x70ec('0x2a')](respondWithResult(_0x3407d0,null))[_0x70ec('0x49')](handleError(_0x3407d0,null));};exports['addConfiguration']=function(_0x4ef462,_0x1884db,_0xaf3914){if(_0x4ef462[_0x70ec('0x4b')]['id']){delete _0x4ef462[_0x70ec('0x4b')]['id'];}return db['ServicenowAccount'][_0x70ec('0x4e')]({'where':{'id':_0x4ef462[_0x70ec('0x47')]['id']}})[_0x70ec('0x2a')](handleEntityNotFound(_0x1884db,null))[_0x70ec('0x2a')](function(_0x4636d9){if(_0x4636d9){_0x4ef462['body'][_0x70ec('0x51')]=_0x4636d9['id'];_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x52')]=integrations[_0x70ec('0x53')](_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x54')],_0x4ef462['body']['type']);_0x4ef462['body']['Descriptions']=integrations[_0x70ec('0x55')](_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x54')],_0x4ef462[_0x70ec('0x4b')][_0x70ec('0x32')]);return db['ServicenowConfiguration'][_0x70ec('0x4a')](_0x4ef462[_0x70ec('0x4b')],{'include':[{'model':db[_0x70ec('0x56')],'as':'Subjects'},{'model':db[_0x70ec('0x56')],'as':'Descriptions'}]});}return null;})[_0x70ec('0x2a')](respondWithResult(_0x1884db,null))[_0x70ec('0x49')](handleError(_0x1884db,null));};exports[_0x70ec('0x57')]=function(_0x5a002f,_0xddd51f,_0x4e89bd){var _0x5caa4c=[_0x70ec('0x58'),_0x70ec('0x59'),_0x70ec('0x5a'),_0x70ec('0x5b'),'close_code','notify','incident_state','severity',_0x70ec('0x5c')];var _0x5f3dc2=[_0x70ec('0x5d'),'made_sla',_0x70ec('0x5e'),'watch_list',_0x70ec('0x5f'),'sys_updated_on',_0x70ec('0x60'),_0x70ec('0x59'),'approval_history',_0x70ec('0x61'),_0x70ec('0x62'),'sys_updated_by',_0x70ec('0x63'),'user_input',_0x70ec('0x64'),'sys_domain',_0x70ec('0x65'),_0x70ec('0x66'),_0x70ec('0x5a'),'order',_0x70ec('0x67'),_0x70ec('0x68'),_0x70ec('0x69'),_0x70ec('0x6a'),_0x70ec('0x6b'),'active','work_notes_list','business_service','priority',_0x70ec('0x6c'),_0x70ec('0x6d'),_0x70ec('0x6e'),_0x70ec('0x6f'),_0x70ec('0x70'),_0x70ec('0x71'),_0x70ec('0x72'),_0x70ec('0x73'),_0x70ec('0x74'),'resolved_at','caller_id',_0x70ec('0x75'),_0x70ec('0x5b'),_0x70ec('0x76'),_0x70ec('0x77'),_0x70ec('0x78'),_0x70ec('0x79'),_0x70ec('0x7a'),'work_start',_0x70ec('0x7b'),'business_stc','additional_assignee_list',_0x70ec('0x7c'),_0x70ec('0x7d'),_0x70ec('0x7e'),_0x70ec('0x7f'),_0x70ec('0x80'),'closed_by','follow_up',_0x70ec('0x81'),'sys_id',_0x70ec('0x82'),_0x70ec('0x83'),'incident_state',_0x70ec('0x84'),_0x70ec('0x85'),_0x70ec('0x86'),_0x70ec('0x87'),_0x70ec('0x88'),_0x70ec('0x89'),_0x70ec('0x8a'),_0x70ec('0x8b'),_0x70ec('0x8c'),'approval',_0x70ec('0x8d'),_0x70ec('0x8e'),_0x70ec('0x8f'),'reopen_count',_0x70ec('0x90'),_0x70ec('0x91'),'upon_approval',_0x70ec('0x92'),'location',_0x70ec('0x5c')];var _0x1292af='';var _0x44044e='';var _0x1e4405=[];var _0x1403e5='';var _0x161a58='';var _0x7ece02=[];var _0x3a66eb='';var _0x13a1fa='';var _0x4407b1={};var _0x9dc9d9='';return db[_0x70ec('0x2f')]['findOne']({'where':{'id':_0x5a002f[_0x70ec('0x47')]['id']},'attributes':['id',_0x70ec('0x93'),'password',_0x70ec('0x94'),'remoteUri',_0x70ec('0x95')]})[_0x70ec('0x2a')](handleEntityNotFound(_0xddd51f,null))[_0x70ec('0x2a')](function(_0x55d8e6){if(_0x55d8e6){_0x9dc9d9=_0x55d8e6[_0x70ec('0x96')];var _0x74e8b0=_0x9dc9d9[_0x70ec('0x97')](-0x1);if(_0x74e8b0==='/'){_0x9dc9d9=_0x9dc9d9['substring'](0x0,_0x9dc9d9['lastIndexOf'](_0x74e8b0));}_0x13a1fa=util[_0x70ec('0x98')](_0x70ec('0x99'),_0x9dc9d9);_0x3a66eb=util['format'](_0x70ec('0x9a'),_0x9dc9d9);_0x4407b1={'user':_0x55d8e6['username'],'pass':_0x55d8e6['password']};var _0x12ab5f={'method':_0x70ec('0x9b'),'uri':_0x13a1fa+_0x70ec('0x9c'),'auth':_0x4407b1,'json':!![]};return rp(_0x12ab5f);}})[_0x70ec('0x2a')](function(_0x36c98e){if(_0x36c98e[_0x70ec('0x9d')]['length']>0x0){_0x1292af=_0x36c98e[_0x70ec('0x9d')];}console[_0x70ec('0x9e')](_0x70ec('0x9f'),_0x1292af);_0x7ece02=[];_0x44044e=Object[_0x70ec('0xa0')]([],_0x1292af);_['remove'](_0x44044e,function(_0x426bef){return!_0x5caa4c[_0x70ec('0xa1')](_0x426bef['name']);});_0x44044e['forEach'](function(_0x3b4f9e){var _0x6e2941=createFieldObject(_0x3a66eb,_0x4407b1,_0x3b4f9e['internalType'],_0x3b4f9e[_0x70ec('0x2d')],_0x3b4f9e[_0x70ec('0xa2')],![]);_0x7ece02[_0x70ec('0xa3')](_0x6e2941);});return Promise[_0x70ec('0xa4')](_0x7ece02);})[_0x70ec('0x2a')](function(_0x1bf7fc){_0x1e4405=_0x1bf7fc;_0x1403e5=Object[_0x70ec('0xa0')]([],_0x1292af);console[_0x70ec('0x9e')](_0x70ec('0xa5'),_0x1292af);_['remove'](_0x1403e5,function(_0x34ad16){return _0x5f3dc2[_0x70ec('0xa1')](_0x34ad16[_0x70ec('0x2d')]);});console[_0x70ec('0x9e')](_0x70ec('0xa6'),_0x1403e5);_0x7ece02=[];_0x1403e5[_0x70ec('0xa7')](function(_0x743769){var _0x4f8cd3=createFieldObject(_0x3a66eb,_0x4407b1,_0x743769[_0x70ec('0xa8')],_0x743769[_0x70ec('0x2d')],_0x743769[_0x70ec('0xa2')],!![]);_0x7ece02[_0x70ec('0xa3')](_0x4f8cd3);});return Promise[_0x70ec('0xa4')](_0x7ece02);})['then'](function(_0x37b2c4){_0x161a58=_0x37b2c4;var _0x5341f5=_0x1e4405[_0x70ec('0xa9')](_0x161a58);return{'count':_0x5341f5[_0x70ec('0x48')],'rows':_0x5341f5};})[_0x70ec('0x2a')](respondWithResult(_0xddd51f,null))[_0x70ec('0x49')](function(_0x5d966a){console['log'](_0x70ec('0xaa')+_0x5d966a);var _0x4f831b=_0x5a002f[_0x70ec('0x34')][_0x70ec('0xab')]?0x1f4:_0x5d966a[_0x70ec('0xac')]||0x1f4;logger[_0x70ec('0x2b')](_0x5d966a['stack']);delete _0x5d966a['name'];if(_0x4f831b===0x191){_0x4f831b=0x190;}_0xddd51f[_0x70ec('0x1d')](_0x4f831b)['send'](_0x5a002f[_0x70ec('0x34')][_0x70ec('0xab')]?{'message':'Wrong\x20credentials','statusCode':_0x5d966a[_0x70ec('0xac')]}:_0x5d966a);});};function createFieldObject(_0x16eee0,_0x3c084b,_0x2449fc,_0xbe6d1b,_0x11e349,_0x28f283){return new Promise(function(_0x186d19,_0x5cbdb0){var _0x32d7e9={'id':_0xbe6d1b,'name':_0x11e349,'custom':_0x28f283};if(_0x2449fc===_0x70ec('0xad')){_0x32d7e9[_0x70ec('0x42')]=[{'name':_0x70ec('0xae'),'value':_0x70ec('0xaf')},{'name':_0x70ec('0xb0'),'value':'false'}];_0x186d19(_0x32d7e9);}else{var _0x2b5904={'method':_0x70ec('0x9b'),'uri':_0x16eee0+_0x70ec('0xb1')+_0xbe6d1b,'auth':_0x3c084b,'json':!![]};return rp(_0x2b5904)[_0x70ec('0x2a')](function(_0x240d36){var _0x523965=[];if(_0x240d36[_0x70ec('0x9d')][_0x70ec('0x48')]>0x0){_0x240d36[_0x70ec('0x9d')]['forEach'](function(_0x359996){if(_0x359996[_0x70ec('0xb2')]==='false'){var _0x537139={'name':_0x359996[_0x70ec('0xa2')],'value':_0x359996[_0x70ec('0xb3')]};_0x523965['push'](_0x537139);}});}_0x32d7e9[_0x70ec('0x42')]=_0x523965;if(_0x32d7e9[_0x70ec('0x42')]['length']>0x0){_0x186d19(_0x32d7e9);}else{if(_0x28f283==![]){_0x186d19();}else{_0x186d19(_0x32d7e9);}}});}});}
\ No newline at end of file
+var _0xe412=['mustache','util','to-csv','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','filters','intersection','attributes','model','fields','query','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','ServicenowAccount','includeAll','include','findAll','catch','params','find','create','body','findOne','ServicenowConfiguration','order','filter','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','closed_at','delivery_plan','active','business_service','priority','rfc','time_worked','expected_start','business_duration','group_list','work_end','resolved_at','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','comments_and_work_notes','due_date','reopen_count','sys_tags','upon_approval','correlation_id','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','username','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','label','all','TCL:\x20_object','includes','internalType','push','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','False','false','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xd0cd54,_0x613e58){var _0x5f3f4f=function(_0x4fb920){while(--_0x4fb920){_0xd0cd54['push'](_0xd0cd54['shift']());}};_0x5f3f4f(++_0x613e58);}(_0xe412,0xaa));var _0x2e41=function(_0x329a05,_0x5d5adb){_0x329a05=_0x329a05-0x0;var _0x15753a=_0xe412[_0x329a05];return _0x15753a;};'use strict';var emlformat=require(_0x2e41('0x0'));var rimraf=require(_0x2e41('0x1'));var zipdir=require(_0x2e41('0x2'));var jsonpatch=require(_0x2e41('0x3'));var rp=require(_0x2e41('0x4'));var moment=require(_0x2e41('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e41('0x6'));var util=require(_0x2e41('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2e41('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e41('0x9'));var squel=require('squel');var crypto=require(_0x2e41('0xa'));var jsforce=require(_0x2e41('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e41('0xc'));var Redis=require('ioredis');var authService=require(_0x2e41('0xd'));var qs=require(_0x2e41('0xe'));var as=require(_0x2e41('0xf'));var hardwareService=require(_0x2e41('0x10'));var logger=require(_0x2e41('0x11'))(_0x2e41('0x12'));var utils=require(_0x2e41('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e41('0x14'))['db'];var integrations=require(_0x2e41('0x15'));function respondWithStatusCode(_0x4335f1,_0x31b40f){_0x31b40f=_0x31b40f||0xcc;return function(_0xdbce02){if(_0xdbce02){return _0x4335f1[_0x2e41('0x16')](_0x31b40f);}return _0x4335f1[_0x2e41('0x17')](_0x31b40f)[_0x2e41('0x18')]();};}function respondWithResult(_0xe9c3ce,_0x47f23d){_0x47f23d=_0x47f23d||0xc8;return function(_0x103436){if(_0x103436){return _0xe9c3ce[_0x2e41('0x17')](_0x47f23d)[_0x2e41('0x19')](_0x103436);}};}function respondWithFilteredResult(_0x29d6d8,_0x3286d1){return function(_0x23823e){if(_0x23823e){var _0x1ac167=typeof _0x3286d1[_0x2e41('0x1a')]===_0x2e41('0x1b')&&typeof _0x3286d1['limit']===_0x2e41('0x1b');var _0x3c38ce=_0x23823e['count'];var _0x161660=_0x1ac167?0x0:_0x3286d1['offset'];var _0x237082=_0x1ac167?_0x23823e[_0x2e41('0x1c')]:_0x3286d1['offset']+_0x3286d1[_0x2e41('0x1d')];var _0x4b8619;if(_0x237082>=_0x3c38ce){_0x237082=_0x3c38ce;_0x4b8619=0xc8;}else{_0x4b8619=0xce;}_0x29d6d8['status'](_0x4b8619);return _0x29d6d8[_0x2e41('0x1e')](_0x2e41('0x1f'),_0x161660+'-'+_0x237082+'/'+_0x3c38ce)['json'](_0x23823e);}return null;};}function patchUpdates(_0x3b336e){return function(_0x44d808){try{jsonpatch[_0x2e41('0x20')](_0x44d808,_0x3b336e,!![]);}catch(_0xfb3b8d){return BPromise[_0x2e41('0x21')](_0xfb3b8d);}return _0x44d808['save']();};}function saveUpdates(_0x200362,_0x18b889){return function(_0x18f04e){if(_0x18f04e){return _0x18f04e['update'](_0x200362)['then'](function(_0x29ada8){return _0x29ada8;});}return null;};}function removeEntity(_0x557261,_0x4ac94a){return function(_0x29599b){if(_0x29599b){return _0x29599b[_0x2e41('0x22')]()[_0x2e41('0x23')](function(){_0x557261['status'](0xcc)[_0x2e41('0x18')]();});}};}function handleEntityNotFound(_0x353bdf,_0x10fa0a){return function(_0x5a2538){if(!_0x5a2538){_0x353bdf[_0x2e41('0x16')](0x194);}return _0x5a2538;};}function handleError(_0x272c10,_0x468a0a){_0x468a0a=_0x468a0a||0x1f4;return function(_0x4192ef){logger[_0x2e41('0x24')](_0x4192ef[_0x2e41('0x25')]);if(_0x4192ef[_0x2e41('0x26')]){delete _0x4192ef['name'];}_0x272c10[_0x2e41('0x17')](_0x468a0a)[_0x2e41('0x27')](_0x4192ef);};}exports[_0x2e41('0x28')]=function(_0x1c85e4,_0x27289a){var _0x36c9fd={},_0xcd8a5f={},_0x1c4152={'count':0x0,'rows':[]};var _0x6a386a=_[_0x2e41('0x29')](db['ServicenowAccount'][_0x2e41('0x2a')],function(_0x49e462){return{'name':_0x49e462[_0x2e41('0x2b')],'type':_0x49e462[_0x2e41('0x2c')]['key']};});_0xcd8a5f['model']=_[_0x2e41('0x29')](_0x6a386a,_0x2e41('0x26'));_0xcd8a5f['query']=_[_0x2e41('0x2d')](_0x1c85e4['query']);_0xcd8a5f[_0x2e41('0x2e')]=_[_0x2e41('0x2f')](_0xcd8a5f['model'],_0xcd8a5f['query']);_0x36c9fd[_0x2e41('0x30')]=_[_0x2e41('0x2f')](_0xcd8a5f[_0x2e41('0x31')],qs[_0x2e41('0x32')](_0x1c85e4[_0x2e41('0x33')][_0x2e41('0x32')]));_0x36c9fd[_0x2e41('0x30')]=_0x36c9fd[_0x2e41('0x30')][_0x2e41('0x34')]?_0x36c9fd['attributes']:_0xcd8a5f[_0x2e41('0x31')];if(!_0x1c85e4[_0x2e41('0x33')][_0x2e41('0x35')](_0x2e41('0x36'))){_0x36c9fd[_0x2e41('0x1d')]=qs[_0x2e41('0x1d')](_0x1c85e4[_0x2e41('0x33')][_0x2e41('0x1d')]);_0x36c9fd[_0x2e41('0x1a')]=qs[_0x2e41('0x1a')](_0x1c85e4[_0x2e41('0x33')][_0x2e41('0x1a')]);}_0x36c9fd['order']=qs[_0x2e41('0x37')](_0x1c85e4[_0x2e41('0x33')][_0x2e41('0x37')]);_0x36c9fd['where']=qs['filters'](_[_0x2e41('0x38')](_0x1c85e4[_0x2e41('0x33')],_0xcd8a5f[_0x2e41('0x2e')]),_0x6a386a);if(_0x1c85e4[_0x2e41('0x33')]['filter']){_0x36c9fd[_0x2e41('0x39')]=_[_0x2e41('0x3a')](_0x36c9fd[_0x2e41('0x39')],{'$or':_[_0x2e41('0x29')](_0x6a386a,function(_0x51b757){if(_0x51b757[_0x2e41('0x2c')]!=='VIRTUAL'){var _0x331d55={};_0x331d55[_0x51b757[_0x2e41('0x26')]]={'$like':'%'+_0x1c85e4['query']['filter']+'%'};return _0x331d55;}})});}_0x36c9fd=_[_0x2e41('0x3a')]({},_0x36c9fd,_0x1c85e4[_0x2e41('0x3b')]);var _0x2d51cf={'where':_0x36c9fd[_0x2e41('0x39')]};return db[_0x2e41('0x3c')]['count'](_0x2d51cf)[_0x2e41('0x23')](function(_0x4bdc6c){_0x1c4152[_0x2e41('0x1c')]=_0x4bdc6c;if(_0x1c85e4['query'][_0x2e41('0x3d')]){_0x36c9fd[_0x2e41('0x3e')]=[{'all':!![]}];}return db[_0x2e41('0x3c')][_0x2e41('0x3f')](_0x36c9fd);})[_0x2e41('0x23')](function(_0xac7f38){_0x1c4152['rows']=_0xac7f38;return _0x1c4152;})['then'](respondWithFilteredResult(_0x27289a,_0x36c9fd))[_0x2e41('0x40')](handleError(_0x27289a,null));};exports['show']=function(_0x463d40,_0x355a1f){var _0x1a3854={'raw':![],'where':{'id':_0x463d40[_0x2e41('0x41')]['id']}},_0x2466dc={};_0x2466dc[_0x2e41('0x31')]=_[_0x2e41('0x2d')](db[_0x2e41('0x3c')][_0x2e41('0x2a')]);_0x2466dc[_0x2e41('0x33')]=_[_0x2e41('0x2d')](_0x463d40[_0x2e41('0x33')]);_0x2466dc['filters']=_[_0x2e41('0x2f')](_0x2466dc[_0x2e41('0x31')],_0x2466dc[_0x2e41('0x33')]);_0x1a3854[_0x2e41('0x30')]=_['intersection'](_0x2466dc['model'],qs[_0x2e41('0x32')](_0x463d40[_0x2e41('0x33')][_0x2e41('0x32')]));_0x1a3854[_0x2e41('0x30')]=_0x1a3854[_0x2e41('0x30')]['length']?_0x1a3854[_0x2e41('0x30')]:_0x2466dc[_0x2e41('0x31')];if(_0x463d40[_0x2e41('0x33')]['includeAll']){_0x1a3854['include']=[{'all':!![]}];}_0x1a3854=_[_0x2e41('0x3a')]({},_0x1a3854,_0x463d40[_0x2e41('0x3b')]);return db[_0x2e41('0x3c')][_0x2e41('0x42')](_0x1a3854)[_0x2e41('0x23')](handleEntityNotFound(_0x355a1f,null))[_0x2e41('0x23')](respondWithResult(_0x355a1f,null))[_0x2e41('0x40')](handleError(_0x355a1f,null));};exports[_0x2e41('0x43')]=function(_0x271809,_0x8e083a){return db[_0x2e41('0x3c')][_0x2e41('0x43')](_0x271809[_0x2e41('0x44')],{})[_0x2e41('0x23')](respondWithResult(_0x8e083a,0xc9))['catch'](handleError(_0x8e083a,null));};exports['update']=function(_0x38fe2a,_0x24c6cc){if(_0x38fe2a['body']['id']){delete _0x38fe2a['body']['id'];}return db[_0x2e41('0x3c')]['find']({'where':{'id':_0x38fe2a['params']['id']}})[_0x2e41('0x23')](handleEntityNotFound(_0x24c6cc,null))[_0x2e41('0x23')](saveUpdates(_0x38fe2a['body'],null))[_0x2e41('0x23')](respondWithResult(_0x24c6cc,null))[_0x2e41('0x40')](handleError(_0x24c6cc,null));};exports[_0x2e41('0x22')]=function(_0x5bac4f,_0x2e0dda){return db['ServicenowAccount'][_0x2e41('0x42')]({'where':{'id':_0x5bac4f[_0x2e41('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e0dda,null))[_0x2e41('0x23')](removeEntity(_0x2e0dda,null))[_0x2e41('0x40')](handleError(_0x2e0dda,null));};exports['getConfigurations']=function(_0x1d60d0,_0x4b8485,_0x4be083){var _0x59b55f={};var _0x1365e9={};var _0x24901f;var _0x946309;return db['ServicenowAccount'][_0x2e41('0x45')]({'where':{'id':_0x1d60d0['params']['id']}})[_0x2e41('0x23')](handleEntityNotFound(_0x4b8485,null))[_0x2e41('0x23')](function(_0x373c07){if(_0x373c07){_0x24901f=_0x373c07;_0x1365e9[_0x2e41('0x31')]=_['keys'](db[_0x2e41('0x46')][_0x2e41('0x2a')]);_0x1365e9[_0x2e41('0x33')]=_[_0x2e41('0x2d')](_0x1d60d0[_0x2e41('0x33')]);_0x1365e9['filters']=_[_0x2e41('0x2f')](_0x1365e9[_0x2e41('0x31')],_0x1365e9[_0x2e41('0x33')]);_0x59b55f[_0x2e41('0x30')]=_[_0x2e41('0x2f')](_0x1365e9[_0x2e41('0x31')],qs[_0x2e41('0x32')](_0x1d60d0[_0x2e41('0x33')][_0x2e41('0x32')]));_0x59b55f[_0x2e41('0x30')]=_0x59b55f[_0x2e41('0x30')][_0x2e41('0x34')]?_0x59b55f[_0x2e41('0x30')]:_0x1365e9[_0x2e41('0x31')];_0x59b55f[_0x2e41('0x47')]=qs[_0x2e41('0x37')](_0x1d60d0[_0x2e41('0x33')][_0x2e41('0x37')]);_0x59b55f['where']=qs[_0x2e41('0x2e')](_[_0x2e41('0x38')](_0x1d60d0[_0x2e41('0x33')],_0x1365e9[_0x2e41('0x2e')]));if(_0x1d60d0[_0x2e41('0x33')][_0x2e41('0x48')]){_0x59b55f[_0x2e41('0x39')]=_[_0x2e41('0x3a')](_0x59b55f[_0x2e41('0x39')],{'$or':_[_0x2e41('0x29')](_0x59b55f[_0x2e41('0x30')],function(_0x2f399a){var _0x546ed1={};_0x546ed1[_0x2f399a]={'$like':'%'+_0x1d60d0[_0x2e41('0x33')]['filter']+'%'};return _0x546ed1;})});}_0x59b55f=_[_0x2e41('0x3a')]({},_0x59b55f,_0x1d60d0[_0x2e41('0x3b')]);return _0x24901f['getConfigurations'](_0x59b55f);}})['then'](function(_0x12ef44){if(_0x12ef44){_0x946309=_0x12ef44[_0x2e41('0x34')];if(!_0x1d60d0[_0x2e41('0x33')]['hasOwnProperty']('nolimit')){_0x59b55f[_0x2e41('0x1d')]=qs['limit'](_0x1d60d0[_0x2e41('0x33')][_0x2e41('0x1d')]);_0x59b55f['offset']=qs['offset'](_0x1d60d0[_0x2e41('0x33')]['offset']);}return _0x24901f['getConfigurations'](_0x59b55f);}})[_0x2e41('0x23')](function(_0xb051b){if(_0xb051b){return _0xb051b?{'count':_0x946309,'rows':_0xb051b}:null;}})[_0x2e41('0x23')](respondWithResult(_0x4b8485,null))['catch'](handleError(_0x4b8485,null));};exports[_0x2e41('0x49')]=function(_0x554e33,_0x3459ff,_0x3e1d99){if(_0x554e33[_0x2e41('0x44')]['id']){delete _0x554e33[_0x2e41('0x44')]['id'];}return db[_0x2e41('0x3c')]['findOne']({'where':{'id':_0x554e33[_0x2e41('0x41')]['id']}})['then'](handleEntityNotFound(_0x3459ff,null))['then'](function(_0x356974){if(_0x356974){_0x554e33['body'][_0x2e41('0x4a')]=_0x356974['id'];_0x554e33[_0x2e41('0x44')][_0x2e41('0x4b')]=integrations[_0x2e41('0x4c')](_0x554e33[_0x2e41('0x44')]['channel'],_0x554e33['body']['type']);_0x554e33[_0x2e41('0x44')][_0x2e41('0x4d')]=integrations[_0x2e41('0x4e')](_0x554e33[_0x2e41('0x44')]['channel'],_0x554e33[_0x2e41('0x44')][_0x2e41('0x2c')]);return db[_0x2e41('0x46')][_0x2e41('0x43')](_0x554e33[_0x2e41('0x44')],{'include':[{'model':db['ServicenowField'],'as':_0x2e41('0x4b')},{'model':db['ServicenowField'],'as':_0x2e41('0x4d')}]});}return null;})['then'](respondWithResult(_0x3459ff,null))[_0x2e41('0x40')](handleError(_0x3459ff,null));};exports[_0x2e41('0x4f')]=function(_0x29abc0,_0x4c9f7e,_0x62ce93){var _0x530d04=[_0x2e41('0x50'),_0x2e41('0x51'),'knowledge',_0x2e41('0x52'),_0x2e41('0x53'),_0x2e41('0x54'),_0x2e41('0x55'),_0x2e41('0x56'),_0x2e41('0x57')];var _0x52dec7=[_0x2e41('0x58'),_0x2e41('0x50'),_0x2e41('0x59'),_0x2e41('0x5a'),_0x2e41('0x5b'),_0x2e41('0x5c'),_0x2e41('0x5d'),_0x2e41('0x51'),_0x2e41('0x5e'),_0x2e41('0x5f'),_0x2e41('0x60'),'sys_updated_by',_0x2e41('0x61'),_0x2e41('0x62'),_0x2e41('0x63'),'sys_domain',_0x2e41('0x64'),_0x2e41('0x65'),_0x2e41('0x66'),_0x2e41('0x47'),'calendar_stc',_0x2e41('0x67'),'cmdb_ci',_0x2e41('0x68'),'impact',_0x2e41('0x69'),'work_notes_list',_0x2e41('0x6a'),_0x2e41('0x6b'),'sys_domain_path',_0x2e41('0x6c'),_0x2e41('0x6d'),_0x2e41('0x6e'),'opened_at',_0x2e41('0x6f'),_0x2e41('0x70'),_0x2e41('0x71'),'reopened_time',_0x2e41('0x72'),'caller_id','approval_set',_0x2e41('0x52'),'work_notes',_0x2e41('0x73'),_0x2e41('0x53'),_0x2e41('0x74'),_0x2e41('0x75'),_0x2e41('0x76'),_0x2e41('0x77'),_0x2e41('0x78'),_0x2e41('0x79'),_0x2e41('0x7a'),_0x2e41('0x7b'),_0x2e41('0x54'),_0x2e41('0x7c'),'close_notes',_0x2e41('0x7d'),'follow_up','parent_incident',_0x2e41('0x7e'),_0x2e41('0x7f'),_0x2e41('0x80'),_0x2e41('0x55'),_0x2e41('0x81'),_0x2e41('0x82'),_0x2e41('0x83'),_0x2e41('0x84'),'activity_due',_0x2e41('0x85'),'severity',_0x2e41('0x86'),_0x2e41('0x87'),'approval',_0x2e41('0x88'),_0x2e41('0x89'),'sys_mod_count',_0x2e41('0x8a'),_0x2e41('0x8b'),'escalation',_0x2e41('0x8c'),_0x2e41('0x8d'),'location','category'];var _0x47b3b6='';var _0x209c2d='';var _0x42624f=[];var _0x5d77ec='';var _0x18185c='';var _0x17588d=[];var _0xaca55='';var _0x4d89bd='';var _0x416d5b={};var _0x28c6aa='';return db[_0x2e41('0x3c')][_0x2e41('0x45')]({'where':{'id':_0x29abc0[_0x2e41('0x41')]['id']},'attributes':['id','username','password',_0x2e41('0x8e'),'remoteUri',_0x2e41('0x8f')]})[_0x2e41('0x23')](handleEntityNotFound(_0x4c9f7e,null))['then'](function(_0x4e7c72){if(_0x4e7c72){_0x28c6aa=_0x4e7c72[_0x2e41('0x90')];var _0x50a43f=_0x28c6aa[_0x2e41('0x91')](-0x1);if(_0x50a43f==='/'){_0x28c6aa=_0x28c6aa[_0x2e41('0x92')](0x0,_0x28c6aa[_0x2e41('0x93')](_0x50a43f));}_0x4d89bd=util['format']('%s/api/now/doc/table/schema/',_0x28c6aa);_0xaca55=util[_0x2e41('0x94')](_0x2e41('0x95'),_0x28c6aa);_0x416d5b={'user':_0x4e7c72[_0x2e41('0x96')],'pass':_0x4e7c72[_0x2e41('0x97')]};var _0x5484b2={'method':_0x2e41('0x98'),'uri':_0x4d89bd+_0x2e41('0x99'),'auth':_0x416d5b,'json':!![]};return rp(_0x5484b2);}})[_0x2e41('0x23')](function(_0x57cda5){if(_0x57cda5[_0x2e41('0x9a')][_0x2e41('0x34')]>0x0){_0x47b3b6=_0x57cda5[_0x2e41('0x9a')];}console[_0x2e41('0x9b')](_0x2e41('0x9c'),_0x47b3b6);_0x17588d=[];_0x209c2d=Object[_0x2e41('0x9d')]([],_0x47b3b6);_[_0x2e41('0x9e')](_0x209c2d,function(_0x102f8a){return!_0x530d04['includes'](_0x102f8a['name']);});_0x209c2d[_0x2e41('0x9f')](function(_0x26171d){var _0x2404f6=createFieldObject(_0xaca55,_0x416d5b,_0x26171d['internalType'],_0x26171d[_0x2e41('0x26')],_0x26171d[_0x2e41('0xa0')],![]);_0x17588d['push'](_0x2404f6);});return Promise[_0x2e41('0xa1')](_0x17588d);})[_0x2e41('0x23')](function(_0x4501f3){_0x42624f=_0x4501f3;_0x5d77ec=Object['assign']([],_0x47b3b6);console[_0x2e41('0x9b')](_0x2e41('0xa2'),_0x47b3b6);_[_0x2e41('0x9e')](_0x5d77ec,function(_0x3d792a){return _0x52dec7[_0x2e41('0xa3')](_0x3d792a[_0x2e41('0x26')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x5d77ec);_0x17588d=[];_0x5d77ec[_0x2e41('0x9f')](function(_0x1b77e5){var _0x2f2de1=createFieldObject(_0xaca55,_0x416d5b,_0x1b77e5[_0x2e41('0xa4')],_0x1b77e5['name'],_0x1b77e5[_0x2e41('0xa0')],!![]);_0x17588d[_0x2e41('0xa5')](_0x2f2de1);});return Promise[_0x2e41('0xa1')](_0x17588d);})['then'](function(_0x2c00e1){_0x18185c=_0x2c00e1;var _0x4c1c10=_0x42624f['concat'](_0x18185c);return{'count':_0x4c1c10[_0x2e41('0x34')],'rows':_0x4c1c10};})[_0x2e41('0x23')](respondWithResult(_0x4c9f7e,null))['catch'](function(_0x41fa6f){console[_0x2e41('0x9b')](_0x2e41('0xa6')+_0x41fa6f);var _0xc84d93=_0x29abc0[_0x2e41('0x33')][_0x2e41('0xa7')]?0x1f4:_0x41fa6f[_0x2e41('0xa8')]||0x1f4;logger[_0x2e41('0x24')](_0x41fa6f[_0x2e41('0x25')]);delete _0x41fa6f[_0x2e41('0x26')];if(_0xc84d93===0x191){_0xc84d93=0x190;}_0x4c9f7e['status'](_0xc84d93)[_0x2e41('0x27')](_0x29abc0[_0x2e41('0x33')][_0x2e41('0xa7')]?{'message':_0x2e41('0xa9'),'statusCode':_0x41fa6f[_0x2e41('0xa8')]}:_0x41fa6f);});};function createFieldObject(_0x101c31,_0x1831fa,_0x206c8d,_0x410082,_0x3f610f,_0x26fde8){return new Promise(function(_0x479fc7,_0x3bc97d){var _0x150750={'id':_0x410082,'name':_0x3f610f,'custom':_0x26fde8};if(_0x206c8d===_0x2e41('0xaa')){_0x150750[_0x2e41('0x3b')]=[{'name':'True','value':_0x2e41('0xab')},{'name':_0x2e41('0xac'),'value':_0x2e41('0xad')}];_0x479fc7(_0x150750);}else{var _0x3309b8={'method':_0x2e41('0x98'),'uri':_0x101c31+'sys_choice?sysparm_query=name=incident^element='+_0x410082,'auth':_0x1831fa,'json':!![]};return rp(_0x3309b8)[_0x2e41('0x23')](function(_0xf1bed3){var _0x507b4f=[];if(_0xf1bed3[_0x2e41('0x9a')][_0x2e41('0x34')]>0x0){_0xf1bed3[_0x2e41('0x9a')][_0x2e41('0x9f')](function(_0x1e3735){if(_0x1e3735[_0x2e41('0xae')]==='false'){var _0x2760bc={'name':_0x1e3735[_0x2e41('0xa0')],'value':_0x1e3735[_0x2e41('0xaf')]};_0x507b4f[_0x2e41('0xa5')](_0x2760bc);}});}_0x150750[_0x2e41('0x3b')]=_0x507b4f;if(_0x150750[_0x2e41('0x3b')]['length']>0x0){_0x479fc7(_0x150750);}else{if(_0x26fde8==![]){_0x479fc7();}else{_0x479fc7(_0x150750);}}});}});}
\ No newline at end of file
index 40760d7..f65538d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['../../config/environment','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x7da7,0x10d));var _0x77da=function(_0x2aee2f,_0xad9887){_0x2aee2f=_0x2aee2f-0x0;var _0x19337f=_0x7da7[_0x2aee2f];return _0x19337f;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x77da('0x7'));module[_0x77da('0x8')]=function(_0x47da81,_0x30afe0){return _0x47da81['define'](_0x77da('0x9'),attributes,{'tableName':_0x77da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3da=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api'];(function(_0x386008,_0x384dab){var _0x31e3ef=function(_0x4ef5d8){while(--_0x4ef5d8){_0x386008['push'](_0x386008['shift']());}};_0x31e3ef(++_0x384dab);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));var integrations=require(_0xae3d('0xb'));module[_0xae3d('0xc')]=function(_0xa54808,_0x476579){return _0xa54808[_0xae3d('0xd')]('ServicenowAccount',attributes,{'tableName':_0xae3d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9ad6a78..6bc8b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x867c=['../../config/environment','jayson/promise','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ServicenowAccount','find','ShowServicenowAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51181e,_0xc4ea19){var _0x5b2483=function(_0x38852a){while(--_0x38852a){_0x51181e['push'](_0x51181e['shift']());}};_0x5b2483(++_0xc4ea19);}(_0x867c,0x88));var _0xc867=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x867c[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xc867('0x0'));var util=require('util');var moment=require(_0xc867('0x1'));var BPromise=require(_0xc867('0x2'));var rs=require(_0xc867('0x3'));var fs=require('fs');var Redis=require(_0xc867('0x4'));var db=require(_0xc867('0x5'))['db'];var utils=require(_0xc867('0x6'));var logger=require(_0xc867('0x7'))('rpc');var config=require(_0xc867('0x8'));var jayson=require(_0xc867('0x9'));var client=jayson['client'][_0xc867('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6acf53,_0x361641,_0x5e067f){return new BPromise(function(_0x49e0c7,_0x4fa052){return client['request'](_0x6acf53,_0x5e067f)[_0xc867('0xb')](function(_0x5cf565){logger[_0xc867('0xc')](_0xc867('0xd'),_0x361641,_0xc867('0xe'));logger[_0xc867('0xf')](_0xc867('0x10'),_0x361641,_0xc867('0xe'),JSON[_0xc867('0x11')](_0x5cf565));if(_0x5cf565[_0xc867('0x12')]){if(_0x5cf565[_0xc867('0x12')][_0xc867('0x13')]===0x1f4){logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);return _0x4fa052(_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);}logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x5cf565[_0xc867('0x12')]['message']);return _0x49e0c7(_0x5cf565[_0xc867('0x12')][_0xc867('0x14')]);}else{logger[_0xc867('0xc')](_0xc867('0xd'),_0x361641,_0xc867('0xe'));_0x49e0c7(_0x5cf565[_0xc867('0x15')][_0xc867('0x14')]);}})[_0xc867('0x16')](function(_0x1bc7f6){logger[_0xc867('0x12')](_0xc867('0xd'),_0x361641,_0x1bc7f6);_0x4fa052(_0x1bc7f6);});});}exports['GetServicenowAccount']=function(_0x218c14){var _0x3f35ac=this;return new Promise(function(_0x1277c6,_0x4a39f5){return db['ServicenowAccount'][_0xc867('0x17')]({'raw':_0x218c14[_0xc867('0x18')]?_0x218c14['options'][_0xc867('0x19')]===undefined?!![]:![]:!![],'where':_0x218c14[_0xc867('0x18')]?_0x218c14[_0xc867('0x18')][_0xc867('0x1a')]||null:null,'attributes':_0x218c14[_0xc867('0x18')]?_0x218c14['options'][_0xc867('0x1b')]||null:null,'limit':_0x218c14['options']?_0x218c14[_0xc867('0x18')][_0xc867('0x1c')]||null:null,'include':_0x218c14[_0xc867('0x18')]?_0x218c14[_0xc867('0x18')][_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x218c14[_0xc867('0x18')]['include'],function(_0x151d43){return{'model':db[_0x151d43[_0xc867('0x1f')]],'as':_0x151d43['as'],'attributes':_0x151d43[_0xc867('0x1b')],'include':_0x151d43[_0xc867('0x1d')]?_['map'](_0x151d43[_0xc867('0x1d')],function(_0x59b030){return{'model':db[_0x59b030[_0xc867('0x1f')]],'as':_0x59b030['as'],'attributes':_0x59b030['attributes'],'include':_0x59b030['include']?_[_0xc867('0x1e')](_0x59b030['include'],function(_0x5a2835){return{'model':db[_0x5a2835[_0xc867('0x1f')]],'as':_0x5a2835['as'],'attributes':_0x5a2835[_0xc867('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc867('0xb')](function(_0x5a2632){logger['info']('GetServicenowAccount',_0x218c14);logger[_0xc867('0xf')](_0xc867('0x20'),_0x218c14,JSON[_0xc867('0x11')](_0x5a2632));_0x1277c6(_0x5a2632);})[_0xc867('0x16')](function(_0x2d2899){logger[_0xc867('0x12')](_0xc867('0x20'),_0x2d2899['message'],_0x218c14);_0x4a39f5(_0x3f35ac['error'](0x1f4,_0x2d2899['message']));});});};exports['ShowServicenowAccount']=function(_0x5e77b3){var _0x4aabbe=this;return new Promise(function(_0x193ce9,_0x1823a9){return db[_0xc867('0x21')][_0xc867('0x22')]({'raw':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3[_0xc867('0x18')][_0xc867('0x19')]===undefined?!![]:![]:!![],'where':_0x5e77b3['options']?_0x5e77b3['options'][_0xc867('0x1a')]||null:null,'attributes':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3['options']['attributes']||null:null,'include':_0x5e77b3[_0xc867('0x18')]?_0x5e77b3[_0xc867('0x18')][_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x5e77b3[_0xc867('0x18')][_0xc867('0x1d')],function(_0xd3ab49){return{'model':db[_0xd3ab49[_0xc867('0x1f')]],'as':_0xd3ab49['as'],'attributes':_0xd3ab49[_0xc867('0x1b')],'include':_0xd3ab49['include']?_[_0xc867('0x1e')](_0xd3ab49[_0xc867('0x1d')],function(_0x22fb4c){return{'model':db[_0x22fb4c[_0xc867('0x1f')]],'as':_0x22fb4c['as'],'attributes':_0x22fb4c[_0xc867('0x1b')],'include':_0x22fb4c[_0xc867('0x1d')]?_[_0xc867('0x1e')](_0x22fb4c[_0xc867('0x1d')],function(_0x265ca4){return{'model':db[_0x265ca4['model']],'as':_0x265ca4['as'],'attributes':_0x265ca4[_0xc867('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x374b93){logger[_0xc867('0xc')](_0xc867('0x23'),_0x5e77b3);logger[_0xc867('0xf')]('ShowServicenowAccount',_0x5e77b3,JSON[_0xc867('0x11')](_0x374b93));_0x193ce9(_0x374b93);})['catch'](function(_0x51a54c){logger['error'](_0xc867('0x23'),_0x51a54c[_0xc867('0x14')],_0x5e77b3);_0x1823a9(_0x4aabbe[_0xc867('0x12')](0x1f4,_0x51a54c[_0xc867('0x14')]));});});};
\ No newline at end of file
+var _0x3158=['limit','include','map','model','then','ShowServicenowAccount','ServicenowAccount','where','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','attributes'];(function(_0x38220a,_0x2e54ba){var _0x2ff3b6=function(_0x55c475){while(--_0x55c475){_0x38220a['push'](_0x38220a['shift']());}};_0x2ff3b6(++_0x2e54ba);}(_0x3158,0x1c2));var _0x8315=function(_0x445f30,_0x200144){_0x445f30=_0x445f30-0x0;var _0x25167c=_0x3158[_0x445f30];return _0x25167c;};'use strict';var _=require(_0x8315('0x0'));var util=require(_0x8315('0x1'));var moment=require('moment');var BPromise=require(_0x8315('0x2'));var rs=require(_0x8315('0x3'));var fs=require('fs');var Redis=require(_0x8315('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8315('0x5'))(_0x8315('0x6'));var config=require(_0x8315('0x7'));var jayson=require(_0x8315('0x8'));var client=jayson[_0x8315('0x9')][_0x8315('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c336c,_0x118539,_0x5c7dc4){return new BPromise(function(_0x28a757,_0x10bcb0){return client[_0x8315('0xb')](_0x5c336c,_0x5c7dc4)['then'](function(_0x538ee7){logger['info'](_0x8315('0xc'),_0x118539,_0x8315('0xd'));logger[_0x8315('0xe')](_0x8315('0xf'),_0x118539,'request\x20sent',JSON['stringify'](_0x538ee7));if(_0x538ee7[_0x8315('0x10')]){if(_0x538ee7[_0x8315('0x10')][_0x8315('0x11')]===0x1f4){logger[_0x8315('0x10')](_0x8315('0xc'),_0x118539,_0x538ee7[_0x8315('0x10')][_0x8315('0x12')]);return _0x10bcb0(_0x538ee7[_0x8315('0x10')]['message']);}logger[_0x8315('0x10')](_0x8315('0xc'),_0x118539,_0x538ee7['error'][_0x8315('0x12')]);return _0x28a757(_0x538ee7[_0x8315('0x10')][_0x8315('0x12')]);}else{logger['info'](_0x8315('0xc'),_0x118539,'request\x20sent');_0x28a757(_0x538ee7[_0x8315('0x13')][_0x8315('0x12')]);}})[_0x8315('0x14')](function(_0x3f030c){logger[_0x8315('0x10')](_0x8315('0xc'),_0x118539,_0x3f030c);_0x10bcb0(_0x3f030c);});});}exports[_0x8315('0x15')]=function(_0x3df440){var _0x144583=this;return new Promise(function(_0x4a99c1,_0x22b0ba){return db['ServicenowAccount'][_0x8315('0x16')]({'raw':_0x3df440[_0x8315('0x17')]?_0x3df440[_0x8315('0x17')][_0x8315('0x18')]===undefined?!![]:![]:!![],'where':_0x3df440['options']?_0x3df440['options']['where']||null:null,'attributes':_0x3df440['options']?_0x3df440[_0x8315('0x17')][_0x8315('0x19')]||null:null,'limit':_0x3df440[_0x8315('0x17')]?_0x3df440[_0x8315('0x17')][_0x8315('0x1a')]||null:null,'include':_0x3df440[_0x8315('0x17')]?_0x3df440['options'][_0x8315('0x1b')]?_[_0x8315('0x1c')](_0x3df440['options']['include'],function(_0x312e1f){return{'model':db[_0x312e1f[_0x8315('0x1d')]],'as':_0x312e1f['as'],'attributes':_0x312e1f[_0x8315('0x19')],'include':_0x312e1f[_0x8315('0x1b')]?_[_0x8315('0x1c')](_0x312e1f[_0x8315('0x1b')],function(_0x18d9cc){return{'model':db[_0x18d9cc[_0x8315('0x1d')]],'as':_0x18d9cc['as'],'attributes':_0x18d9cc[_0x8315('0x19')],'include':_0x18d9cc[_0x8315('0x1b')]?_[_0x8315('0x1c')](_0x18d9cc[_0x8315('0x1b')],function(_0x49fd01){return{'model':db[_0x49fd01[_0x8315('0x1d')]],'as':_0x49fd01['as'],'attributes':_0x49fd01[_0x8315('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8315('0x1e')](function(_0x83cc45){logger['info'](_0x8315('0x15'),_0x3df440);logger[_0x8315('0xe')]('GetServicenowAccount',_0x3df440,JSON['stringify'](_0x83cc45));_0x4a99c1(_0x83cc45);})[_0x8315('0x14')](function(_0x17bf76){logger[_0x8315('0x10')](_0x8315('0x15'),_0x17bf76[_0x8315('0x12')],_0x3df440);_0x22b0ba(_0x144583['error'](0x1f4,_0x17bf76[_0x8315('0x12')]));});});};exports[_0x8315('0x1f')]=function(_0x29d28a){var _0x10b5dc=this;return new Promise(function(_0x22867e,_0x5b7fe3){return db[_0x8315('0x20')]['find']({'raw':_0x29d28a[_0x8315('0x17')]?_0x29d28a['options'][_0x8315('0x18')]===undefined?!![]:![]:!![],'where':_0x29d28a[_0x8315('0x17')]?_0x29d28a['options'][_0x8315('0x21')]||null:null,'attributes':_0x29d28a[_0x8315('0x17')]?_0x29d28a[_0x8315('0x17')][_0x8315('0x19')]||null:null,'include':_0x29d28a[_0x8315('0x17')]?_0x29d28a[_0x8315('0x17')]['include']?_[_0x8315('0x1c')](_0x29d28a['options'][_0x8315('0x1b')],function(_0x2f924a){return{'model':db[_0x2f924a[_0x8315('0x1d')]],'as':_0x2f924a['as'],'attributes':_0x2f924a['attributes'],'include':_0x2f924a[_0x8315('0x1b')]?_['map'](_0x2f924a[_0x8315('0x1b')],function(_0x11901d){return{'model':db[_0x11901d[_0x8315('0x1d')]],'as':_0x11901d['as'],'attributes':_0x11901d[_0x8315('0x19')],'include':_0x11901d[_0x8315('0x1b')]?_[_0x8315('0x1c')](_0x11901d[_0x8315('0x1b')],function(_0xfbb866){return{'model':db[_0xfbb866[_0x8315('0x1d')]],'as':_0xfbb866['as'],'attributes':_0xfbb866[_0x8315('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xced251){logger['info'](_0x8315('0x1f'),_0x29d28a);logger['debug'](_0x8315('0x1f'),_0x29d28a,JSON['stringify'](_0xced251));_0x22867e(_0xced251);})[_0x8315('0x14')](function(_0x219199){logger[_0x8315('0x10')](_0x8315('0x1f'),_0x219199[_0x8315('0x12')],_0x29d28a);_0x5b7fe3(_0x10b5dc['error'](0x1f4,_0x219199[_0x8315('0x12')]));});});};
\ No newline at end of file
index 9964ab6..a4b06b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x716b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','post','create','put','update','delete','exports','multer','util'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0x716b,0xda));var _0xb716=function(_0x166241,_0x227ee2){_0x166241=_0x166241-0x0;var _0x51fd00=_0x716b[_0x166241];return _0x51fd00;};'use strict';var multer=require(_0xb716('0x0'));var util=require(_0xb716('0x1'));var path=require('path');var timeout=require(_0xb716('0x2'));var express=require('express');var router=express[_0xb716('0x3')]();var fs_extra=require(_0xb716('0x4'));var auth=require(_0xb716('0x5'));var interaction=require(_0xb716('0x6'));var config=require(_0xb716('0x7'));var controller=require(_0xb716('0x8'));router[_0xb716('0x9')]('/',auth['isAuthenticated'](),controller[_0xb716('0xa')]);router[_0xb716('0x9')](_0xb716('0xb'),auth[_0xb716('0xc')](),controller['show']);router[_0xb716('0x9')](_0xb716('0xd'),auth[_0xb716('0xc')](),controller[_0xb716('0xe')]);router[_0xb716('0x9')]('/:id/subjects',auth[_0xb716('0xc')](),controller[_0xb716('0xf')]);router[_0xb716('0x9')]('/:id/descriptions',auth[_0xb716('0xc')](),controller['getDescriptions']);router[_0xb716('0x10')]('/',auth[_0xb716('0xc')](),controller[_0xb716('0x11')]);router[_0xb716('0x12')](_0xb716('0xb'),auth['isAuthenticated'](),controller[_0xb716('0x13')]);router[_0xb716('0x14')](_0xb716('0xb'),auth[_0xb716('0xc')](),controller['destroy']);module[_0xb716('0x15')]=router;
\ No newline at end of file
+var _0x0569=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x318454,_0x500328){var _0xafaedd=function(_0xc72a2a){while(--_0xc72a2a){_0x318454['push'](_0x318454['shift']());}};_0xafaedd(++_0x500328);}(_0x0569,0x15a));var _0x9056=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0569[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x9056('0x0'));var util=require(_0x9056('0x1'));var path=require(_0x9056('0x2'));var timeout=require(_0x9056('0x3'));var express=require('express');var router=express[_0x9056('0x4')]();var fs_extra=require(_0x9056('0x5'));var auth=require(_0x9056('0x6'));var interaction=require(_0x9056('0x7'));var config=require(_0x9056('0x8'));var controller=require(_0x9056('0x9'));router[_0x9056('0xa')]('/',auth[_0x9056('0xb')](),controller[_0x9056('0xc')]);router[_0x9056('0xa')](_0x9056('0xd'),auth[_0x9056('0xb')](),controller[_0x9056('0xe')]);router['get']('/:id/fields',auth[_0x9056('0xb')](),controller[_0x9056('0xf')]);router['get'](_0x9056('0x10'),auth['isAuthenticated'](),controller[_0x9056('0x11')]);router[_0x9056('0xa')](_0x9056('0x12'),auth['isAuthenticated'](),controller[_0x9056('0x13')]);router['post']('/',auth[_0x9056('0xb')](),controller['create']);router[_0x9056('0x14')](_0x9056('0xd'),auth['isAuthenticated'](),controller[_0x9056('0x15')]);router[_0x9056('0x16')](_0x9056('0xd'),auth[_0x9056('0xb')](),controller[_0x9056('0x17')]);module[_0x9056('0x18')]=router;
\ No newline at end of file
index fd479b0..d70dbf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd3b=['STRING'];(function(_0x46aa24,_0x1c3f11){var _0x5eef93=function(_0x2894d2){while(--_0x2894d2){_0x46aa24['push'](_0x46aa24['shift']());}};_0x5eef93(++_0x1c3f11);}(_0xbd3b,0x163));var _0xbbd3=function(_0x47195e,_0x347734){_0x47195e=_0x47195e-0x0;var _0x571abb=_0xbd3b[_0x47195e];return _0x571abb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbbd3('0x0')]},'description':{'type':Sequelize[_0xbbd3('0x0')]}};
\ No newline at end of file
+var _0x1184=['STRING','sequelize'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x1184,0xab));var _0x4118=function(_0x1747af,_0x1c32cf){_0x1747af=_0x1747af-0x0;var _0x3546c8=_0x1184[_0x1747af];return _0x3546c8;};'use strict';var Sequelize=require(_0x4118('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4118('0x1')]}};
\ No newline at end of file
index 3428b1d..3453887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d79=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','stack','name','index','rawAttributes','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','ServicenowConfiguration','then','rows','catch','show','keys','intersection','length','includeAll','include','find','create','body','params','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','util','path','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x1d79,0x15a));var _0x91d7=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1d79[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0x91d7('0x0'));var rimraf=require(_0x91d7('0x1'));var zipdir=require(_0x91d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x91d7('0x3'));var path=require(_0x91d7('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x91d7('0x5'));var _=require(_0x91d7('0x6'));var squel=require('squel');var crypto=require(_0x91d7('0x7'));var jsforce=require(_0x91d7('0x8'));var deskjs=require(_0x91d7('0x9'));var toCsv=require(_0x91d7('0xa'));var querystring=require('querystring');var Papa=require(_0x91d7('0xb'));var Redis=require(_0x91d7('0xc'));var authService=require(_0x91d7('0xd'));var qs=require(_0x91d7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91d7('0xf'));var logger=require('../../config/logger')(_0x91d7('0x10'));var utils=require(_0x91d7('0x11'));var config=require(_0x91d7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x91d7('0x13'))['db'];function respondWithStatusCode(_0x40d6a9,_0x10a4c2){_0x10a4c2=_0x10a4c2||0xcc;return function(_0x19db6c){if(_0x19db6c){return _0x40d6a9[_0x91d7('0x14')](_0x10a4c2);}return _0x40d6a9[_0x91d7('0x15')](_0x10a4c2)[_0x91d7('0x16')]();};}function respondWithResult(_0x4fdab2,_0x3b27b6){_0x3b27b6=_0x3b27b6||0xc8;return function(_0x21fe3b){if(_0x21fe3b){return _0x4fdab2[_0x91d7('0x15')](_0x3b27b6)[_0x91d7('0x17')](_0x21fe3b);}};}function respondWithFilteredResult(_0x2c8813,_0x3efbd8){return function(_0x201d20){if(_0x201d20){var _0x24d9eb=typeof _0x3efbd8[_0x91d7('0x18')]===_0x91d7('0x19')&&typeof _0x3efbd8[_0x91d7('0x1a')]===_0x91d7('0x19');var _0x4b43aa=_0x201d20[_0x91d7('0x1b')];var _0x23d284=_0x24d9eb?0x0:_0x3efbd8[_0x91d7('0x18')];var _0x14f134=_0x24d9eb?_0x201d20['count']:_0x3efbd8['offset']+_0x3efbd8['limit'];var _0x9076bf;if(_0x14f134>=_0x4b43aa){_0x14f134=_0x4b43aa;_0x9076bf=0xc8;}else{_0x9076bf=0xce;}_0x2c8813[_0x91d7('0x15')](_0x9076bf);return _0x2c8813['set']('Content-Range',_0x23d284+'-'+_0x14f134+'/'+_0x4b43aa)[_0x91d7('0x17')](_0x201d20);}return null;};}function patchUpdates(_0x35c986){return function(_0x17539e){try{jsonpatch['apply'](_0x17539e,_0x35c986,!![]);}catch(_0x286577){return BPromise[_0x91d7('0x1c')](_0x286577);}return _0x17539e[_0x91d7('0x1d')]();};}function saveUpdates(_0x105d27,_0x25bee9){return function(_0x1142f3){if(_0x1142f3){return _0x1142f3[_0x91d7('0x1e')](_0x105d27)['then'](function(_0x5dd24f){return _0x5dd24f;});}return null;};}function removeEntity(_0x5b1162,_0x92843b){return function(_0x5b734c){if(_0x5b734c){return _0x5b734c[_0x91d7('0x1f')]()['then'](function(){_0x5b1162['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x564383,_0xf35861){return function(_0x1a753a){if(!_0x1a753a){_0x564383[_0x91d7('0x14')](0x194);}return _0x1a753a;};}function handleError(_0x1cb695,_0x45c7fe){_0x45c7fe=_0x45c7fe||0x1f4;return function(_0x4ee741){logger['error'](_0x4ee741[_0x91d7('0x20')]);if(_0x4ee741[_0x91d7('0x21')]){delete _0x4ee741[_0x91d7('0x21')];}_0x1cb695[_0x91d7('0x15')](_0x45c7fe)['send'](_0x4ee741);};}exports[_0x91d7('0x22')]=function(_0x5f454a,_0x251f51){var _0x7d16da={},_0x21c0f0={},_0x40a5e3={'count':0x0,'rows':[]};var _0x2f93a0=_['map'](db['ServicenowConfiguration'][_0x91d7('0x23')],function(_0x168912){return{'name':_0x168912['fieldName'],'type':_0x168912['type'][_0x91d7('0x24')]};});_0x21c0f0[_0x91d7('0x25')]=_[_0x91d7('0x26')](_0x2f93a0,_0x91d7('0x21'));_0x21c0f0[_0x91d7('0x27')]=_['keys'](_0x5f454a[_0x91d7('0x27')]);_0x21c0f0[_0x91d7('0x28')]=_['intersection'](_0x21c0f0[_0x91d7('0x25')],_0x21c0f0[_0x91d7('0x27')]);_0x7d16da[_0x91d7('0x29')]=_['intersection'](_0x21c0f0['model'],qs[_0x91d7('0x2a')](_0x5f454a[_0x91d7('0x27')]['fields']));_0x7d16da['attributes']=_0x7d16da[_0x91d7('0x29')]['length']?_0x7d16da[_0x91d7('0x29')]:_0x21c0f0[_0x91d7('0x25')];if(!_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x7d16da[_0x91d7('0x1a')]=qs['limit'](_0x5f454a[_0x91d7('0x27')][_0x91d7('0x1a')]);_0x7d16da['offset']=qs[_0x91d7('0x18')](_0x5f454a[_0x91d7('0x27')]['offset']);}_0x7d16da[_0x91d7('0x2d')]=qs[_0x91d7('0x2e')](_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x7d16da['where']=qs[_0x91d7('0x28')](_['pick'](_0x5f454a[_0x91d7('0x27')],_0x21c0f0[_0x91d7('0x28')]),_0x2f93a0);if(_0x5f454a['query'][_0x91d7('0x2f')]){_0x7d16da['where']=_['merge'](_0x7d16da[_0x91d7('0x30')],{'$or':_[_0x91d7('0x26')](_0x2f93a0,function(_0x371e6f){if(_0x371e6f[_0x91d7('0x31')]!==_0x91d7('0x32')){var _0x4ef526={};_0x4ef526[_0x371e6f['name']]={'$like':'%'+_0x5f454a[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x4ef526;}})});}_0x7d16da=_[_0x91d7('0x33')]({},_0x7d16da,_0x5f454a[_0x91d7('0x34')]);var _0x1fbfe2={'where':_0x7d16da['where']};return db[_0x91d7('0x35')][_0x91d7('0x1b')](_0x1fbfe2)[_0x91d7('0x36')](function(_0x5939ea){_0x40a5e3[_0x91d7('0x1b')]=_0x5939ea;if(_0x5f454a[_0x91d7('0x27')]['includeAll']){_0x7d16da['include']=[{'all':!![]}];}return db[_0x91d7('0x35')]['findAll'](_0x7d16da);})[_0x91d7('0x36')](function(_0x7df3c4){_0x40a5e3[_0x91d7('0x37')]=_0x7df3c4;return _0x40a5e3;})['then'](respondWithFilteredResult(_0x251f51,_0x7d16da))[_0x91d7('0x38')](handleError(_0x251f51,null));};exports[_0x91d7('0x39')]=function(_0x5bb728,_0xfbc3de){var _0x36cc22={'raw':![],'where':{'id':_0x5bb728['params']['id']}},_0x12c3c4={};_0x12c3c4[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db['ServicenowConfiguration'][_0x91d7('0x23')]);_0x12c3c4['query']=_[_0x91d7('0x3a')](_0x5bb728[_0x91d7('0x27')]);_0x12c3c4[_0x91d7('0x28')]=_['intersection'](_0x12c3c4[_0x91d7('0x25')],_0x12c3c4[_0x91d7('0x27')]);_0x36cc22[_0x91d7('0x29')]=_[_0x91d7('0x3b')](_0x12c3c4[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x5bb728['query'][_0x91d7('0x2a')]));_0x36cc22['attributes']=_0x36cc22['attributes'][_0x91d7('0x3c')]?_0x36cc22[_0x91d7('0x29')]:_0x12c3c4['model'];if(_0x5bb728[_0x91d7('0x27')][_0x91d7('0x3d')]){_0x36cc22[_0x91d7('0x3e')]=[{'all':!![]}];}_0x36cc22=_[_0x91d7('0x33')]({},_0x36cc22,_0x5bb728[_0x91d7('0x34')]);return db[_0x91d7('0x35')][_0x91d7('0x3f')](_0x36cc22)[_0x91d7('0x36')](handleEntityNotFound(_0xfbc3de,null))[_0x91d7('0x36')](respondWithResult(_0xfbc3de,null))[_0x91d7('0x38')](handleError(_0xfbc3de,null));};exports[_0x91d7('0x40')]=function(_0x155ce0,_0x31fb8f){return db[_0x91d7('0x35')][_0x91d7('0x40')](_0x155ce0[_0x91d7('0x41')],{})[_0x91d7('0x36')](respondWithResult(_0x31fb8f,0xc9))[_0x91d7('0x38')](handleError(_0x31fb8f,null));};exports[_0x91d7('0x1e')]=function(_0x1dd10d,_0x2b38b1){if(_0x1dd10d['body']['id']){delete _0x1dd10d[_0x91d7('0x41')]['id'];}return db['ServicenowConfiguration'][_0x91d7('0x3f')]({'where':{'id':_0x1dd10d[_0x91d7('0x42')]['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x2b38b1,null))[_0x91d7('0x36')](saveUpdates(_0x1dd10d[_0x91d7('0x41')],null))['then'](respondWithResult(_0x2b38b1,null))[_0x91d7('0x38')](handleError(_0x2b38b1,null));};exports[_0x91d7('0x1f')]=function(_0x3dfbae,_0xcaa74f){return db[_0x91d7('0x35')]['find']({'where':{'id':_0x3dfbae['params']['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0xcaa74f,null))['then'](removeEntity(_0xcaa74f,null))[_0x91d7('0x38')](handleError(_0xcaa74f,null));};exports['getFields']=function(_0xc4867b,_0x5116c5,_0x4ff77b){var _0x49b092={};var _0x261160={};var _0x277631;var _0xc80189;return db['ServicenowConfiguration'][_0x91d7('0x43')]({'where':{'id':_0xc4867b['params']['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x5116c5,null))['then'](function(_0xd710ba){if(_0xd710ba){_0x277631=_0xd710ba;_0x261160[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db[_0x91d7('0x44')][_0x91d7('0x23')]);_0x261160[_0x91d7('0x27')]=_[_0x91d7('0x3a')](_0xc4867b[_0x91d7('0x27')]);_0x261160[_0x91d7('0x28')]=_['intersection'](_0x261160[_0x91d7('0x25')],_0x261160['query']);_0x49b092[_0x91d7('0x29')]=_[_0x91d7('0x3b')](_0x261160['model'],qs[_0x91d7('0x2a')](_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2a')]));_0x49b092[_0x91d7('0x29')]=_0x49b092[_0x91d7('0x29')]['length']?_0x49b092[_0x91d7('0x29')]:_0x261160['model'];_0x49b092[_0x91d7('0x2d')]=qs[_0x91d7('0x2e')](_0xc4867b[_0x91d7('0x27')]['sort']);_0x49b092[_0x91d7('0x30')]=qs['filters'](_[_0x91d7('0x45')](_0xc4867b[_0x91d7('0x27')],_0x261160[_0x91d7('0x28')]));if(_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x49b092['where']=_[_0x91d7('0x33')](_0x49b092[_0x91d7('0x30')],{'$or':_[_0x91d7('0x26')](_0x49b092[_0x91d7('0x29')],function(_0x1f460e){var _0x333b2f={};_0x333b2f[_0x1f460e]={'$like':'%'+_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x333b2f;})});}_0x49b092=_[_0x91d7('0x33')]({},_0x49b092,_0xc4867b[_0x91d7('0x34')]);return _0x277631['getFields'](_0x49b092);}})[_0x91d7('0x36')](function(_0x34f6f1){if(_0x34f6f1){_0xc80189=_0x34f6f1[_0x91d7('0x3c')];if(!_0xc4867b[_0x91d7('0x27')][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x49b092[_0x91d7('0x1a')]=qs[_0x91d7('0x1a')](_0xc4867b[_0x91d7('0x27')][_0x91d7('0x1a')]);_0x49b092['offset']=qs[_0x91d7('0x18')](_0xc4867b[_0x91d7('0x27')]['offset']);}return _0x277631[_0x91d7('0x46')](_0x49b092);}})[_0x91d7('0x36')](function(_0x42855e){if(_0x42855e){return _0x42855e?{'count':_0xc80189,'rows':_0x42855e}:null;}})[_0x91d7('0x36')](respondWithResult(_0x5116c5,null))[_0x91d7('0x38')](handleError(_0x5116c5,null));};exports[_0x91d7('0x47')]=function(_0x39ecfa,_0x4dad51,_0x52fa90){var _0x732d7d={};var _0x1b5e67={};var _0x3c861c;var _0x41d8dc;return db[_0x91d7('0x35')][_0x91d7('0x43')]({'where':{'id':_0x39ecfa[_0x91d7('0x42')]['id']}})[_0x91d7('0x36')](handleEntityNotFound(_0x4dad51,null))['then'](function(_0xc6ab59){if(_0xc6ab59){_0x3c861c=_0xc6ab59;_0x1b5e67['model']=_[_0x91d7('0x3a')](db[_0x91d7('0x44')]['rawAttributes']);_0x1b5e67[_0x91d7('0x27')]=_[_0x91d7('0x3a')](_0x39ecfa['query']);_0x1b5e67[_0x91d7('0x28')]=_[_0x91d7('0x3b')](_0x1b5e67['model'],_0x1b5e67[_0x91d7('0x27')]);_0x732d7d['attributes']=_['intersection'](_0x1b5e67[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2a')]));_0x732d7d['attributes']=_0x732d7d[_0x91d7('0x29')][_0x91d7('0x3c')]?_0x732d7d[_0x91d7('0x29')]:_0x1b5e67[_0x91d7('0x25')];_0x732d7d['order']=qs[_0x91d7('0x2e')](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x732d7d[_0x91d7('0x30')]=qs[_0x91d7('0x28')](_['pick'](_0x39ecfa[_0x91d7('0x27')],_0x1b5e67[_0x91d7('0x28')]));if(_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x732d7d[_0x91d7('0x30')]=_[_0x91d7('0x33')](_0x732d7d['where'],{'$or':_['map'](_0x732d7d[_0x91d7('0x29')],function(_0x722f16){var _0x66eebb={};_0x66eebb[_0x722f16]={'$like':'%'+_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x2f')]+'%'};return _0x66eebb;})});}_0x732d7d=_['merge']({},_0x732d7d,_0x39ecfa[_0x91d7('0x34')]);return _0x3c861c[_0x91d7('0x47')](_0x732d7d);}})[_0x91d7('0x36')](function(_0x5ccc06){if(_0x5ccc06){_0x41d8dc=_0x5ccc06[_0x91d7('0x3c')];if(!_0x39ecfa['query']['hasOwnProperty']('nolimit')){_0x732d7d[_0x91d7('0x1a')]=qs[_0x91d7('0x1a')](_0x39ecfa['query'][_0x91d7('0x1a')]);_0x732d7d['offset']=qs['offset'](_0x39ecfa[_0x91d7('0x27')][_0x91d7('0x18')]);}return _0x3c861c[_0x91d7('0x47')](_0x732d7d);}})[_0x91d7('0x36')](function(_0x6cbe37){if(_0x6cbe37){return _0x6cbe37?{'count':_0x41d8dc,'rows':_0x6cbe37}:null;}})[_0x91d7('0x36')](respondWithResult(_0x4dad51,null))['catch'](handleError(_0x4dad51,null));};exports[_0x91d7('0x48')]=function(_0x2a4dec,_0x1d9657,_0x3494be){var _0x474889={};var _0x1eb200={};var _0x334564;var _0x28fe5d;return db[_0x91d7('0x35')][_0x91d7('0x43')]({'where':{'id':_0x2a4dec[_0x91d7('0x42')]['id']}})['then'](handleEntityNotFound(_0x1d9657,null))[_0x91d7('0x36')](function(_0x4933b6){if(_0x4933b6){_0x334564=_0x4933b6;_0x1eb200[_0x91d7('0x25')]=_[_0x91d7('0x3a')](db['ServicenowField'][_0x91d7('0x23')]);_0x1eb200['query']=_[_0x91d7('0x3a')](_0x2a4dec[_0x91d7('0x27')]);_0x1eb200['filters']=_[_0x91d7('0x3b')](_0x1eb200[_0x91d7('0x25')],_0x1eb200[_0x91d7('0x27')]);_0x474889[_0x91d7('0x29')]=_['intersection'](_0x1eb200[_0x91d7('0x25')],qs[_0x91d7('0x2a')](_0x2a4dec['query'][_0x91d7('0x2a')]));_0x474889[_0x91d7('0x29')]=_0x474889[_0x91d7('0x29')][_0x91d7('0x3c')]?_0x474889['attributes']:_0x1eb200[_0x91d7('0x25')];_0x474889[_0x91d7('0x2d')]=qs['sort'](_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x2e')]);_0x474889[_0x91d7('0x30')]=qs[_0x91d7('0x28')](_[_0x91d7('0x45')](_0x2a4dec[_0x91d7('0x27')],_0x1eb200[_0x91d7('0x28')]));if(_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x2f')]){_0x474889[_0x91d7('0x30')]=_[_0x91d7('0x33')](_0x474889['where'],{'$or':_[_0x91d7('0x26')](_0x474889[_0x91d7('0x29')],function(_0xe62a){var _0x20378f={};_0x20378f[_0xe62a]={'$like':'%'+_0x2a4dec[_0x91d7('0x27')]['filter']+'%'};return _0x20378f;})});}_0x474889=_[_0x91d7('0x33')]({},_0x474889,_0x2a4dec['options']);return _0x334564[_0x91d7('0x48')](_0x474889);}})['then'](function(_0x545831){if(_0x545831){_0x28fe5d=_0x545831[_0x91d7('0x3c')];if(!_0x2a4dec['query'][_0x91d7('0x2b')](_0x91d7('0x2c'))){_0x474889[_0x91d7('0x1a')]=qs['limit'](_0x2a4dec[_0x91d7('0x27')]['limit']);_0x474889[_0x91d7('0x18')]=qs[_0x91d7('0x18')](_0x2a4dec[_0x91d7('0x27')][_0x91d7('0x18')]);}return _0x334564['getDescriptions'](_0x474889);}})['then'](function(_0x4c2a11){if(_0x4c2a11){return _0x4c2a11?{'count':_0x28fe5d,'rows':_0x4c2a11}:null;}})['then'](respondWithResult(_0x1d9657,null))['catch'](handleError(_0x1d9657,null));};
\ No newline at end of file
+var _0x723c=['type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','findOne','ServicenowField','getFields','nolimit','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','ServicenowConfiguration','fieldName'];(function(_0x10bbb8,_0x19e2eb){var _0x2026a0=function(_0x36420e){while(--_0x36420e){_0x10bbb8['push'](_0x10bbb8['shift']());}};_0x2026a0(++_0x19e2eb);}(_0x723c,0x1ad));var _0xc723=function(_0x20eb5f,_0x21f129){_0x20eb5f=_0x20eb5f-0x0;var _0x1278fc=_0x723c[_0x20eb5f];return _0x1278fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc723('0x0'));var zipdir=require(_0xc723('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc723('0x2'));var moment=require('moment');var BPromise=require(_0xc723('0x3'));var Mustache=require(_0xc723('0x4'));var util=require(_0xc723('0x5'));var path=require(_0xc723('0x6'));var sox=require(_0xc723('0x7'));var csv=require(_0xc723('0x8'));var ejs=require(_0xc723('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc723('0xa'));var squel=require(_0xc723('0xb'));var crypto=require('crypto');var jsforce=require(_0xc723('0xc'));var deskjs=require(_0xc723('0xd'));var toCsv=require(_0xc723('0x8'));var querystring=require(_0xc723('0xe'));var Papa=require(_0xc723('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc723('0x10'));var as=require(_0xc723('0x11'));var hardwareService=require(_0xc723('0x12'));var logger=require(_0xc723('0x13'))('api');var utils=require(_0xc723('0x14'));var config=require(_0xc723('0x15'));var licenseUtil=require(_0xc723('0x16'));var db=require(_0xc723('0x17'))['db'];function respondWithStatusCode(_0x3f4842,_0x5cffb4){_0x5cffb4=_0x5cffb4||0xcc;return function(_0x605b42){if(_0x605b42){return _0x3f4842[_0xc723('0x18')](_0x5cffb4);}return _0x3f4842[_0xc723('0x19')](_0x5cffb4)[_0xc723('0x1a')]();};}function respondWithResult(_0x2c7596,_0x4a3d86){_0x4a3d86=_0x4a3d86||0xc8;return function(_0x2e8be7){if(_0x2e8be7){return _0x2c7596['status'](_0x4a3d86)['json'](_0x2e8be7);}};}function respondWithFilteredResult(_0x1bb1ba,_0x110d83){return function(_0x212a77){if(_0x212a77){var _0x309574=typeof _0x110d83[_0xc723('0x1b')]===_0xc723('0x1c')&&typeof _0x110d83[_0xc723('0x1d')]===_0xc723('0x1c');var _0x5345a4=_0x212a77[_0xc723('0x1e')];var _0x41b4af=_0x309574?0x0:_0x110d83[_0xc723('0x1b')];var _0x100410=_0x309574?_0x212a77['count']:_0x110d83['offset']+_0x110d83[_0xc723('0x1d')];var _0x298470;if(_0x100410>=_0x5345a4){_0x100410=_0x5345a4;_0x298470=0xc8;}else{_0x298470=0xce;}_0x1bb1ba[_0xc723('0x19')](_0x298470);return _0x1bb1ba[_0xc723('0x1f')](_0xc723('0x20'),_0x41b4af+'-'+_0x100410+'/'+_0x5345a4)['json'](_0x212a77);}return null;};}function patchUpdates(_0x341584){return function(_0x23988a){try{jsonpatch[_0xc723('0x21')](_0x23988a,_0x341584,!![]);}catch(_0x172cf0){return BPromise[_0xc723('0x22')](_0x172cf0);}return _0x23988a[_0xc723('0x23')]();};}function saveUpdates(_0x38b980,_0x26b307){return function(_0x1de575){if(_0x1de575){return _0x1de575[_0xc723('0x24')](_0x38b980)[_0xc723('0x25')](function(_0xf77cc5){return _0xf77cc5;});}return null;};}function removeEntity(_0x545309,_0x16ae56){return function(_0x4cd1ee){if(_0x4cd1ee){return _0x4cd1ee[_0xc723('0x26')]()[_0xc723('0x25')](function(){_0x545309[_0xc723('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41fb45,_0x1a4811){return function(_0x4ed3ca){if(!_0x4ed3ca){_0x41fb45['sendStatus'](0x194);}return _0x4ed3ca;};}function handleError(_0x38adbe,_0xddf5bc){_0xddf5bc=_0xddf5bc||0x1f4;return function(_0x128261){logger[_0xc723('0x27')](_0x128261[_0xc723('0x28')]);if(_0x128261[_0xc723('0x29')]){delete _0x128261[_0xc723('0x29')];}_0x38adbe[_0xc723('0x19')](_0xddf5bc)['send'](_0x128261);};}exports['index']=function(_0x2ccef6,_0x3b626d){var _0x1965a9={},_0x49b188={},_0x1d292={'count':0x0,'rows':[]};var _0x278770=_[_0xc723('0x2a')](db[_0xc723('0x2b')]['rawAttributes'],function(_0x14186d){return{'name':_0x14186d[_0xc723('0x2c')],'type':_0x14186d[_0xc723('0x2d')]['key']};});_0x49b188[_0xc723('0x2e')]=_[_0xc723('0x2a')](_0x278770,_0xc723('0x29'));_0x49b188['query']=_[_0xc723('0x2f')](_0x2ccef6['query']);_0x49b188['filters']=_['intersection'](_0x49b188[_0xc723('0x2e')],_0x49b188[_0xc723('0x30')]);_0x1965a9['attributes']=_[_0xc723('0x31')](_0x49b188[_0xc723('0x2e')],qs[_0xc723('0x32')](_0x2ccef6[_0xc723('0x30')][_0xc723('0x32')]));_0x1965a9[_0xc723('0x33')]=_0x1965a9[_0xc723('0x33')][_0xc723('0x34')]?_0x1965a9[_0xc723('0x33')]:_0x49b188[_0xc723('0x2e')];if(!_0x2ccef6[_0xc723('0x30')][_0xc723('0x35')]('nolimit')){_0x1965a9[_0xc723('0x1d')]=qs['limit'](_0x2ccef6['query'][_0xc723('0x1d')]);_0x1965a9['offset']=qs['offset'](_0x2ccef6[_0xc723('0x30')][_0xc723('0x1b')]);}_0x1965a9[_0xc723('0x36')]=qs[_0xc723('0x37')](_0x2ccef6['query'][_0xc723('0x37')]);_0x1965a9[_0xc723('0x38')]=qs[_0xc723('0x39')](_[_0xc723('0x3a')](_0x2ccef6[_0xc723('0x30')],_0x49b188['filters']),_0x278770);if(_0x2ccef6[_0xc723('0x30')][_0xc723('0x3b')]){_0x1965a9[_0xc723('0x38')]=_[_0xc723('0x3c')](_0x1965a9[_0xc723('0x38')],{'$or':_['map'](_0x278770,function(_0x2bb0e4){if(_0x2bb0e4['type']!==_0xc723('0x3d')){var _0x40ef95={};_0x40ef95[_0x2bb0e4[_0xc723('0x29')]]={'$like':'%'+_0x2ccef6[_0xc723('0x30')][_0xc723('0x3b')]+'%'};return _0x40ef95;}})});}_0x1965a9=_['merge']({},_0x1965a9,_0x2ccef6[_0xc723('0x3e')]);var _0x1cdb09={'where':_0x1965a9[_0xc723('0x38')]};return db[_0xc723('0x2b')][_0xc723('0x1e')](_0x1cdb09)[_0xc723('0x25')](function(_0x5cfd20){_0x1d292['count']=_0x5cfd20;if(_0x2ccef6[_0xc723('0x30')][_0xc723('0x3f')]){_0x1965a9[_0xc723('0x40')]=[{'all':!![]}];}return db[_0xc723('0x2b')][_0xc723('0x41')](_0x1965a9);})['then'](function(_0x435b3b){_0x1d292[_0xc723('0x42')]=_0x435b3b;return _0x1d292;})[_0xc723('0x25')](respondWithFilteredResult(_0x3b626d,_0x1965a9))[_0xc723('0x43')](handleError(_0x3b626d,null));};exports[_0xc723('0x44')]=function(_0x38e26d,_0x661e1c){var _0x3c485f={'raw':![],'where':{'id':_0x38e26d[_0xc723('0x45')]['id']}},_0x3fd3ee={};_0x3fd3ee['model']=_['keys'](db['ServicenowConfiguration'][_0xc723('0x46')]);_0x3fd3ee['query']=_[_0xc723('0x2f')](_0x38e26d[_0xc723('0x30')]);_0x3fd3ee[_0xc723('0x39')]=_['intersection'](_0x3fd3ee['model'],_0x3fd3ee['query']);_0x3c485f[_0xc723('0x33')]=_[_0xc723('0x31')](_0x3fd3ee[_0xc723('0x2e')],qs[_0xc723('0x32')](_0x38e26d['query'][_0xc723('0x32')]));_0x3c485f[_0xc723('0x33')]=_0x3c485f[_0xc723('0x33')][_0xc723('0x34')]?_0x3c485f[_0xc723('0x33')]:_0x3fd3ee['model'];if(_0x38e26d[_0xc723('0x30')][_0xc723('0x3f')]){_0x3c485f[_0xc723('0x40')]=[{'all':!![]}];}_0x3c485f=_[_0xc723('0x3c')]({},_0x3c485f,_0x38e26d[_0xc723('0x3e')]);return db[_0xc723('0x2b')][_0xc723('0x47')](_0x3c485f)['then'](handleEntityNotFound(_0x661e1c,null))[_0xc723('0x25')](respondWithResult(_0x661e1c,null))[_0xc723('0x43')](handleError(_0x661e1c,null));};exports[_0xc723('0x48')]=function(_0x5ead61,_0x2397e8){return db[_0xc723('0x2b')][_0xc723('0x48')](_0x5ead61[_0xc723('0x49')],{})[_0xc723('0x25')](respondWithResult(_0x2397e8,0xc9))[_0xc723('0x43')](handleError(_0x2397e8,null));};exports[_0xc723('0x24')]=function(_0x306b59,_0x21b2d3){if(_0x306b59[_0xc723('0x49')]['id']){delete _0x306b59[_0xc723('0x49')]['id'];}return db[_0xc723('0x2b')]['find']({'where':{'id':_0x306b59['params']['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x21b2d3,null))['then'](saveUpdates(_0x306b59[_0xc723('0x49')],null))[_0xc723('0x25')](respondWithResult(_0x21b2d3,null))[_0xc723('0x43')](handleError(_0x21b2d3,null));};exports[_0xc723('0x26')]=function(_0x5ac977,_0x6e30de){return db[_0xc723('0x2b')][_0xc723('0x47')]({'where':{'id':_0x5ac977[_0xc723('0x45')]['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x6e30de,null))[_0xc723('0x25')](removeEntity(_0x6e30de,null))[_0xc723('0x43')](handleError(_0x6e30de,null));};exports['getFields']=function(_0x12ee02,_0x34d371,_0xe865a4){var _0x2a6a4d={};var _0x4627a4={};var _0x1ee759;var _0x5dfb4b;return db[_0xc723('0x2b')][_0xc723('0x4a')]({'where':{'id':_0x12ee02[_0xc723('0x45')]['id']}})['then'](handleEntityNotFound(_0x34d371,null))[_0xc723('0x25')](function(_0x2a242d){if(_0x2a242d){_0x1ee759=_0x2a242d;_0x4627a4[_0xc723('0x2e')]=_[_0xc723('0x2f')](db[_0xc723('0x4b')][_0xc723('0x46')]);_0x4627a4[_0xc723('0x30')]=_[_0xc723('0x2f')](_0x12ee02['query']);_0x4627a4[_0xc723('0x39')]=_[_0xc723('0x31')](_0x4627a4['model'],_0x4627a4[_0xc723('0x30')]);_0x2a6a4d[_0xc723('0x33')]=_[_0xc723('0x31')](_0x4627a4['model'],qs['fields'](_0x12ee02[_0xc723('0x30')][_0xc723('0x32')]));_0x2a6a4d['attributes']=_0x2a6a4d['attributes']['length']?_0x2a6a4d[_0xc723('0x33')]:_0x4627a4['model'];_0x2a6a4d['order']=qs['sort'](_0x12ee02[_0xc723('0x30')][_0xc723('0x37')]);_0x2a6a4d[_0xc723('0x38')]=qs[_0xc723('0x39')](_['pick'](_0x12ee02[_0xc723('0x30')],_0x4627a4[_0xc723('0x39')]));if(_0x12ee02['query']['filter']){_0x2a6a4d[_0xc723('0x38')]=_[_0xc723('0x3c')](_0x2a6a4d[_0xc723('0x38')],{'$or':_[_0xc723('0x2a')](_0x2a6a4d[_0xc723('0x33')],function(_0x5103c6){var _0xfe5696={};_0xfe5696[_0x5103c6]={'$like':'%'+_0x12ee02['query'][_0xc723('0x3b')]+'%'};return _0xfe5696;})});}_0x2a6a4d=_[_0xc723('0x3c')]({},_0x2a6a4d,_0x12ee02['options']);return _0x1ee759['getFields'](_0x2a6a4d);}})[_0xc723('0x25')](function(_0x3ca291){if(_0x3ca291){_0x5dfb4b=_0x3ca291['length'];if(!_0x12ee02['query'][_0xc723('0x35')]('nolimit')){_0x2a6a4d[_0xc723('0x1d')]=qs[_0xc723('0x1d')](_0x12ee02[_0xc723('0x30')][_0xc723('0x1d')]);_0x2a6a4d[_0xc723('0x1b')]=qs[_0xc723('0x1b')](_0x12ee02[_0xc723('0x30')][_0xc723('0x1b')]);}return _0x1ee759[_0xc723('0x4c')](_0x2a6a4d);}})[_0xc723('0x25')](function(_0xac63cb){if(_0xac63cb){return _0xac63cb?{'count':_0x5dfb4b,'rows':_0xac63cb}:null;}})['then'](respondWithResult(_0x34d371,null))[_0xc723('0x43')](handleError(_0x34d371,null));};exports['getSubjects']=function(_0x4fc401,_0x242b73,_0x453313){var _0x5d565b={};var _0x548e16={};var _0x38cc10;var _0x125087;return db[_0xc723('0x2b')][_0xc723('0x4a')]({'where':{'id':_0x4fc401['params']['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x242b73,null))[_0xc723('0x25')](function(_0x253143){if(_0x253143){_0x38cc10=_0x253143;_0x548e16[_0xc723('0x2e')]=_[_0xc723('0x2f')](db[_0xc723('0x4b')][_0xc723('0x46')]);_0x548e16[_0xc723('0x30')]=_[_0xc723('0x2f')](_0x4fc401['query']);_0x548e16[_0xc723('0x39')]=_[_0xc723('0x31')](_0x548e16['model'],_0x548e16[_0xc723('0x30')]);_0x5d565b[_0xc723('0x33')]=_[_0xc723('0x31')](_0x548e16[_0xc723('0x2e')],qs[_0xc723('0x32')](_0x4fc401[_0xc723('0x30')]['fields']));_0x5d565b[_0xc723('0x33')]=_0x5d565b['attributes'][_0xc723('0x34')]?_0x5d565b[_0xc723('0x33')]:_0x548e16[_0xc723('0x2e')];_0x5d565b[_0xc723('0x36')]=qs[_0xc723('0x37')](_0x4fc401[_0xc723('0x30')][_0xc723('0x37')]);_0x5d565b['where']=qs[_0xc723('0x39')](_[_0xc723('0x3a')](_0x4fc401[_0xc723('0x30')],_0x548e16[_0xc723('0x39')]));if(_0x4fc401[_0xc723('0x30')][_0xc723('0x3b')]){_0x5d565b['where']=_[_0xc723('0x3c')](_0x5d565b[_0xc723('0x38')],{'$or':_[_0xc723('0x2a')](_0x5d565b[_0xc723('0x33')],function(_0x5336b4){var _0x5c2773={};_0x5c2773[_0x5336b4]={'$like':'%'+_0x4fc401[_0xc723('0x30')][_0xc723('0x3b')]+'%'};return _0x5c2773;})});}_0x5d565b=_['merge']({},_0x5d565b,_0x4fc401['options']);return _0x38cc10['getSubjects'](_0x5d565b);}})[_0xc723('0x25')](function(_0x3d575d){if(_0x3d575d){_0x125087=_0x3d575d[_0xc723('0x34')];if(!_0x4fc401[_0xc723('0x30')][_0xc723('0x35')](_0xc723('0x4d'))){_0x5d565b['limit']=qs[_0xc723('0x1d')](_0x4fc401['query'][_0xc723('0x1d')]);_0x5d565b[_0xc723('0x1b')]=qs[_0xc723('0x1b')](_0x4fc401[_0xc723('0x30')][_0xc723('0x1b')]);}return _0x38cc10['getSubjects'](_0x5d565b);}})['then'](function(_0x2a6c62){if(_0x2a6c62){return _0x2a6c62?{'count':_0x125087,'rows':_0x2a6c62}:null;}})[_0xc723('0x25')](respondWithResult(_0x242b73,null))[_0xc723('0x43')](handleError(_0x242b73,null));};exports[_0xc723('0x4e')]=function(_0x4721e3,_0x5b5509,_0x5a8607){var _0x2f0f5d={};var _0x440e9c={};var _0x897a91;var _0x3a42ed;return db[_0xc723('0x2b')][_0xc723('0x4a')]({'where':{'id':_0x4721e3[_0xc723('0x45')]['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x5b5509,null))['then'](function(_0x1442d4){if(_0x1442d4){_0x897a91=_0x1442d4;_0x440e9c[_0xc723('0x2e')]=_['keys'](db['ServicenowField'][_0xc723('0x46')]);_0x440e9c[_0xc723('0x30')]=_[_0xc723('0x2f')](_0x4721e3[_0xc723('0x30')]);_0x440e9c[_0xc723('0x39')]=_['intersection'](_0x440e9c[_0xc723('0x2e')],_0x440e9c[_0xc723('0x30')]);_0x2f0f5d[_0xc723('0x33')]=_[_0xc723('0x31')](_0x440e9c[_0xc723('0x2e')],qs[_0xc723('0x32')](_0x4721e3[_0xc723('0x30')][_0xc723('0x32')]));_0x2f0f5d[_0xc723('0x33')]=_0x2f0f5d['attributes'][_0xc723('0x34')]?_0x2f0f5d[_0xc723('0x33')]:_0x440e9c[_0xc723('0x2e')];_0x2f0f5d[_0xc723('0x36')]=qs[_0xc723('0x37')](_0x4721e3[_0xc723('0x30')][_0xc723('0x37')]);_0x2f0f5d[_0xc723('0x38')]=qs[_0xc723('0x39')](_[_0xc723('0x3a')](_0x4721e3[_0xc723('0x30')],_0x440e9c[_0xc723('0x39')]));if(_0x4721e3[_0xc723('0x30')][_0xc723('0x3b')]){_0x2f0f5d['where']=_[_0xc723('0x3c')](_0x2f0f5d[_0xc723('0x38')],{'$or':_[_0xc723('0x2a')](_0x2f0f5d['attributes'],function(_0x1139cc){var _0x54070b={};_0x54070b[_0x1139cc]={'$like':'%'+_0x4721e3['query'][_0xc723('0x3b')]+'%'};return _0x54070b;})});}_0x2f0f5d=_[_0xc723('0x3c')]({},_0x2f0f5d,_0x4721e3[_0xc723('0x3e')]);return _0x897a91['getDescriptions'](_0x2f0f5d);}})['then'](function(_0x57b414){if(_0x57b414){_0x3a42ed=_0x57b414[_0xc723('0x34')];if(!_0x4721e3[_0xc723('0x30')][_0xc723('0x35')](_0xc723('0x4d'))){_0x2f0f5d[_0xc723('0x1d')]=qs[_0xc723('0x1d')](_0x4721e3[_0xc723('0x30')][_0xc723('0x1d')]);_0x2f0f5d['offset']=qs['offset'](_0x4721e3[_0xc723('0x30')][_0xc723('0x1b')]);}return _0x897a91[_0xc723('0x4e')](_0x2f0f5d);}})[_0xc723('0x25')](function(_0x4f19ac){if(_0x4f19ac){return _0x4f19ac?{'count':_0x3a42ed,'rows':_0x4f19ac}:null;}})[_0xc723('0x25')](respondWithResult(_0x5b5509,null))[_0xc723('0x43')](handleError(_0x5b5509,null));};
\ No newline at end of file
index 2cf506a..5f4d9c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d37=['int_servicenow_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration'];(function(_0xb8001f,_0x4acfca){var _0x231af5=function(_0x12a0a3){while(--_0x12a0a3){_0xb8001f['push'](_0xb8001f['shift']());}};_0x231af5(++_0x4acfca);}(_0x8d37,0x1d5));var _0x78d3=function(_0xcdc5c7,_0x42bd73){_0xcdc5c7=_0xcdc5c7-0x0;var _0xf2e401=_0x8d37[_0xcdc5c7];return _0xf2e401;};'use strict';var _=require(_0x78d3('0x0'));var util=require(_0x78d3('0x1'));var logger=require(_0x78d3('0x2'))(_0x78d3('0x3'));var moment=require(_0x78d3('0x4'));var BPromise=require('bluebird');var rp=require(_0x78d3('0x5'));var fs=require('fs');var path=require(_0x78d3('0x6'));var rimraf=require(_0x78d3('0x7'));var config=require(_0x78d3('0x8'));var attributes=require(_0x78d3('0x9'));module[_0x78d3('0xa')]=function(_0xe9d481,_0x24f7b9){return _0xe9d481['define'](_0x78d3('0xb'),attributes,{'tableName':_0x78d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x32d5=['request-promise','rimraf','../../config/environment','exports','define','ServicenowConfiguration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x32d5,0x1aa));var _0x532d=function(_0x32427f,_0x15f216){_0x32427f=_0x32427f-0x0;var _0x18398d=_0x32d5[_0x32427f];return _0x18398d;};'use strict';var _=require(_0x532d('0x0'));var util=require(_0x532d('0x1'));var logger=require(_0x532d('0x2'))(_0x532d('0x3'));var moment=require(_0x532d('0x4'));var BPromise=require(_0x532d('0x5'));var rp=require(_0x532d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x532d('0x7'));var config=require(_0x532d('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x532d('0x9')]=function(_0x2b1142,_0x2995e2){return _0x2b1142[_0x532d('0xa')](_0x532d('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28efef6..a82053c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022a=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x45bb07,_0x395b5c){var _0x143312=function(_0x3f5d14){while(--_0x3f5d14){_0x45bb07['push'](_0x45bb07['shift']());}};_0x143312(++_0x395b5c);}(_0x022a,0xfa));var _0xa022=function(_0x285db,_0x4f4926){_0x285db=_0x285db-0x0;var _0x2ebec6=_0x022a[_0x285db];return _0x2ebec6;};'use strict';var _=require(_0xa022('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa022('0x1'));var rs=require(_0xa022('0x2'));var fs=require('fs');var Redis=require(_0xa022('0x3'));var db=require(_0xa022('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa022('0x5'))(_0xa022('0x6'));var config=require(_0xa022('0x7'));var jayson=require(_0xa022('0x8'));var client=jayson[_0xa022('0x9')][_0xa022('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2271,_0x15088e,_0x3e0d58){return new BPromise(function(_0x4d6227,_0x566608){return client[_0xa022('0xb')](_0x3e2271,_0x3e0d58)[_0xa022('0xc')](function(_0x443481){logger[_0xa022('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15088e,'request\x20sent');logger[_0xa022('0xe')](_0xa022('0xf'),_0x15088e,_0xa022('0x10'),JSON[_0xa022('0x11')](_0x443481));if(_0x443481['error']){if(_0x443481[_0xa022('0x12')]['code']===0x1f4){logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x443481[_0xa022('0x12')]['message']);return _0x566608(_0x443481['error'][_0xa022('0x14')]);}logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x443481['error']['message']);return _0x4d6227(_0x443481[_0xa022('0x12')][_0xa022('0x14')]);}else{logger[_0xa022('0xd')](_0xa022('0x13'),_0x15088e,_0xa022('0x10'));_0x4d6227(_0x443481['result'][_0xa022('0x14')]);}})[_0xa022('0x15')](function(_0x3ac58b){logger[_0xa022('0x12')](_0xa022('0x13'),_0x15088e,_0x3ac58b);_0x566608(_0x3ac58b);});});}
\ No newline at end of file
+var _0x8124=['then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1a428e,_0x10fd4){var _0x48f6f8=function(_0x4af645){while(--_0x4af645){_0x1a428e['push'](_0x1a428e['shift']());}};_0x48f6f8(++_0x10fd4);}(_0x8124,0x79));var _0x4812=function(_0x20c447,_0x5a32b6){_0x20c447=_0x20c447-0x0;var _0x5974df=_0x8124[_0x20c447];return _0x5974df;};'use strict';var _=require(_0x4812('0x0'));var util=require(_0x4812('0x1'));var moment=require('moment');var BPromise=require(_0x4812('0x2'));var rs=require(_0x4812('0x3'));var fs=require('fs');var Redis=require(_0x4812('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4812('0x5'));var logger=require('../../config/logger')(_0x4812('0x6'));var config=require(_0x4812('0x7'));var jayson=require(_0x4812('0x8'));var client=jayson[_0x4812('0x9')][_0x4812('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3aa561,_0x2adac1,_0x15579a){return new BPromise(function(_0x1d545b,_0x5061ae){return client['request'](_0x3aa561,_0x15579a)[_0x4812('0xb')](function(_0x13a707){logger[_0x4812('0xc')](_0x4812('0xd'),_0x2adac1,'request\x20sent');logger[_0x4812('0xe')](_0x4812('0xf'),_0x2adac1,_0x4812('0x10'),JSON[_0x4812('0x11')](_0x13a707));if(_0x13a707[_0x4812('0x12')]){if(_0x13a707['error'][_0x4812('0x13')]===0x1f4){logger[_0x4812('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2adac1,_0x13a707[_0x4812('0x12')][_0x4812('0x14')]);return _0x5061ae(_0x13a707['error'][_0x4812('0x14')]);}logger[_0x4812('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2adac1,_0x13a707[_0x4812('0x12')][_0x4812('0x14')]);return _0x1d545b(_0x13a707[_0x4812('0x12')][_0x4812('0x14')]);}else{logger[_0x4812('0xc')](_0x4812('0xd'),_0x2adac1,_0x4812('0x10'));_0x1d545b(_0x13a707[_0x4812('0x15')][_0x4812('0x14')]);}})['catch'](function(_0x861e04){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x2adac1,_0x861e04);_0x5061ae(_0x861e04);});});}
\ No newline at end of file
index ccf3f9f..d7ee410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6edd=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','post','create','put','update'];(function(_0x220afa,_0xf5f6cc){var _0x1b79d1=function(_0x178a39){while(--_0x178a39){_0x220afa['push'](_0x220afa['shift']());}};_0x1b79d1(++_0xf5f6cc);}(_0x6edd,0x1e3));var _0xd6ed=function(_0x1060c2,_0x4671c4){_0x1060c2=_0x1060c2-0x0;var _0x882b4=_0x6edd[_0x1060c2];return _0x882b4;};'use strict';var multer=require(_0xd6ed('0x0'));var util=require('util');var path=require(_0xd6ed('0x1'));var timeout=require(_0xd6ed('0x2'));var express=require(_0xd6ed('0x3'));var router=express[_0xd6ed('0x4')]();var fs_extra=require(_0xd6ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd6ed('0x6'));var config=require(_0xd6ed('0x7'));var controller=require(_0xd6ed('0x8'));router[_0xd6ed('0x9')]('/',auth['isAuthenticated'](),controller[_0xd6ed('0xa')]);router['get'](_0xd6ed('0xb'),auth[_0xd6ed('0xc')](),controller['show']);router[_0xd6ed('0xd')]('/',auth['isAuthenticated'](),controller[_0xd6ed('0xe')]);router[_0xd6ed('0xf')](_0xd6ed('0xb'),auth[_0xd6ed('0xc')](),controller[_0xd6ed('0x10')]);router[_0xd6ed('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd6ed('0x12')]);module[_0xd6ed('0x13')]=router;
\ No newline at end of file
+var _0x516b=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','multer','path'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x516b,0x64));var _0xb516=function(_0x1ebd19,_0x2ec7e2){_0x1ebd19=_0x1ebd19-0x0;var _0x50e867=_0x516b[_0x1ebd19];return _0x50e867;};'use strict';var multer=require(_0xb516('0x0'));var util=require('util');var path=require(_0xb516('0x1'));var timeout=require('connect-timeout');var express=require(_0xb516('0x2'));var router=express[_0xb516('0x3')]();var fs_extra=require(_0xb516('0x4'));var auth=require(_0xb516('0x5'));var interaction=require(_0xb516('0x6'));var config=require('../../config/environment');var controller=require(_0xb516('0x7'));router[_0xb516('0x8')]('/',auth[_0xb516('0x9')](),controller[_0xb516('0xa')]);router['get'](_0xb516('0xb'),auth[_0xb516('0x9')](),controller[_0xb516('0xc')]);router['post']('/',auth[_0xb516('0x9')](),controller[_0xb516('0xd')]);router[_0xb516('0xe')](_0xb516('0xb'),auth[_0xb516('0x9')](),controller[_0xb516('0xf')]);router['delete'](_0xb516('0xb'),auth[_0xb516('0x9')](),controller['destroy']);module[_0xb516('0x10')]=router;
\ No newline at end of file
index a45c44a..ac940c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda08=['picklist','STRING','ENUM','string','BOOLEAN','variable','customVariable'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xda08,0x1da));var _0x8da0=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xda08[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x8da0('0x0'),_0x8da0('0x1'),'keyValue',_0x8da0('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8da0('0x3')]},'key':{'type':Sequelize[_0x8da0('0x3')]},'keyType':{'type':Sequelize[_0x8da0('0x4')](_0x8da0('0x5'),_0x8da0('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x8da0('0x3')]},'idField':{'type':Sequelize[_0x8da0('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8da0('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8da0('0x3')]}};
\ No newline at end of file
+var _0x0e15=['ENUM','string','variable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x6e8014,_0x57d51d){var _0x47febf=function(_0x985548){while(--_0x985548){_0x6e8014['push'](_0x6e8014['shift']());}};_0x47febf(++_0x57d51d);}(_0x0e15,0xcf));var _0x50e1=function(_0x239a92,_0x488298){_0x239a92=_0x239a92-0x0;var _0x2c8b73=_0x0e15[_0x239a92];return _0x2c8b73;};'use strict';var Sequelize=require('sequelize');module[_0x50e1('0x0')]={'type':{'type':Sequelize[_0x50e1('0x1')](_0x50e1('0x2'),_0x50e1('0x3'),'customVariable',_0x50e1('0x4'),_0x50e1('0x5')),'defaultValue':_0x50e1('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x50e1('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x50e1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x50e1('0x6')]},'idField':{'type':Sequelize[_0x50e1('0x6')]},'nameField':{'type':Sequelize[_0x50e1('0x6')]},'customField':{'type':Sequelize[_0x50e1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x50e1('0x6')]}};
\ No newline at end of file
index 1e45412..be1c508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x855f=['then','destroy','stack','name','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','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','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x855f,0x14c));var _0xf855=function(_0x4002d0,_0x271b0d){_0x4002d0=_0x4002d0-0x0;var _0x344c88=_0x855f[_0x4002d0];return _0x344c88;};'use strict';var emlformat=require(_0xf855('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf855('0x1'));var jsonpatch=require(_0xf855('0x2'));var rp=require(_0xf855('0x3'));var moment=require('moment');var BPromise=require(_0xf855('0x4'));var Mustache=require('mustache');var util=require(_0xf855('0x5'));var path=require('path');var sox=require(_0xf855('0x6'));var csv=require(_0xf855('0x7'));var ejs=require(_0xf855('0x8'));var fs=require('fs');var fs_extra=require(_0xf855('0x9'));var _=require(_0xf855('0xa'));var squel=require(_0xf855('0xb'));var crypto=require(_0xf855('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf855('0xd'));var toCsv=require(_0xf855('0x7'));var querystring=require('querystring');var Papa=require(_0xf855('0xe'));var Redis=require('ioredis');var authService=require(_0xf855('0xf'));var qs=require(_0xf855('0x10'));var as=require(_0xf855('0x11'));var hardwareService=require(_0xf855('0x12'));var logger=require(_0xf855('0x13'))(_0xf855('0x14'));var utils=require(_0xf855('0x15'));var config=require(_0xf855('0x16'));var licenseUtil=require(_0xf855('0x17'));var db=require(_0xf855('0x18'))['db'];function respondWithStatusCode(_0x5a7658,_0x84bac7){_0x84bac7=_0x84bac7||0xcc;return function(_0x376cbd){if(_0x376cbd){return _0x5a7658[_0xf855('0x19')](_0x84bac7);}return _0x5a7658[_0xf855('0x1a')](_0x84bac7)[_0xf855('0x1b')]();};}function respondWithResult(_0x3b0b83,_0x32dd57){_0x32dd57=_0x32dd57||0xc8;return function(_0xae122d){if(_0xae122d){return _0x3b0b83[_0xf855('0x1a')](_0x32dd57)[_0xf855('0x1c')](_0xae122d);}};}function respondWithFilteredResult(_0x1a8d03,_0x324673){return function(_0x41a621){if(_0x41a621){var _0x152406=typeof _0x324673[_0xf855('0x1d')]==='undefined'&&typeof _0x324673[_0xf855('0x1e')]===_0xf855('0x1f');var _0x369364=_0x41a621[_0xf855('0x20')];var _0x41c319=_0x152406?0x0:_0x324673[_0xf855('0x1d')];var _0xeb4175=_0x152406?_0x41a621['count']:_0x324673[_0xf855('0x1d')]+_0x324673[_0xf855('0x1e')];var _0x416c27;if(_0xeb4175>=_0x369364){_0xeb4175=_0x369364;_0x416c27=0xc8;}else{_0x416c27=0xce;}_0x1a8d03[_0xf855('0x1a')](_0x416c27);return _0x1a8d03['set'](_0xf855('0x21'),_0x41c319+'-'+_0xeb4175+'/'+_0x369364)[_0xf855('0x1c')](_0x41a621);}return null;};}function patchUpdates(_0x29fa84){return function(_0x30927c){try{jsonpatch[_0xf855('0x22')](_0x30927c,_0x29fa84,!![]);}catch(_0xd19b41){return BPromise[_0xf855('0x23')](_0xd19b41);}return _0x30927c[_0xf855('0x24')]();};}function saveUpdates(_0x53e802,_0x309d92){return function(_0x249fba){if(_0x249fba){return _0x249fba[_0xf855('0x25')](_0x53e802)[_0xf855('0x26')](function(_0x3bc886){return _0x3bc886;});}return null;};}function removeEntity(_0x4a33a4,_0x472775){return function(_0x1c6e24){if(_0x1c6e24){return _0x1c6e24[_0xf855('0x27')]()['then'](function(){_0x4a33a4[_0xf855('0x1a')](0xcc)[_0xf855('0x1b')]();});}};}function handleEntityNotFound(_0x36db01,_0x1e2958){return function(_0xb41f53){if(!_0xb41f53){_0x36db01['sendStatus'](0x194);}return _0xb41f53;};}function handleError(_0x161498,_0x5cc7c4){_0x5cc7c4=_0x5cc7c4||0x1f4;return function(_0x287318){logger['error'](_0x287318[_0xf855('0x28')]);if(_0x287318[_0xf855('0x29')]){delete _0x287318[_0xf855('0x29')];}_0x161498['status'](_0x5cc7c4)['send'](_0x287318);};}exports['index']=function(_0x375f1a,_0x424a2b){var _0x5da4c4={},_0x40c006={},_0x38dc5f={'count':0x0,'rows':[]};var _0x397e01=_[_0xf855('0x2a')](db[_0xf855('0x2b')][_0xf855('0x2c')],function(_0x15eea7){return{'name':_0x15eea7[_0xf855('0x2d')],'type':_0x15eea7['type']['key']};});_0x40c006[_0xf855('0x2e')]=_[_0xf855('0x2a')](_0x397e01,_0xf855('0x29'));_0x40c006[_0xf855('0x2f')]=_[_0xf855('0x30')](_0x375f1a['query']);_0x40c006[_0xf855('0x31')]=_['intersection'](_0x40c006[_0xf855('0x2e')],_0x40c006['query']);_0x5da4c4['attributes']=_[_0xf855('0x32')](_0x40c006[_0xf855('0x2e')],qs[_0xf855('0x33')](_0x375f1a[_0xf855('0x2f')]['fields']));_0x5da4c4[_0xf855('0x34')]=_0x5da4c4[_0xf855('0x34')][_0xf855('0x35')]?_0x5da4c4[_0xf855('0x34')]:_0x40c006['model'];if(!_0x375f1a['query'][_0xf855('0x36')](_0xf855('0x37'))){_0x5da4c4[_0xf855('0x1e')]=qs[_0xf855('0x1e')](_0x375f1a[_0xf855('0x2f')][_0xf855('0x1e')]);_0x5da4c4[_0xf855('0x1d')]=qs[_0xf855('0x1d')](_0x375f1a[_0xf855('0x2f')]['offset']);}_0x5da4c4['order']=qs[_0xf855('0x38')](_0x375f1a[_0xf855('0x2f')][_0xf855('0x38')]);_0x5da4c4[_0xf855('0x39')]=qs[_0xf855('0x31')](_[_0xf855('0x3a')](_0x375f1a[_0xf855('0x2f')],_0x40c006[_0xf855('0x31')]),_0x397e01);if(_0x375f1a['query'][_0xf855('0x3b')]){_0x5da4c4['where']=_[_0xf855('0x3c')](_0x5da4c4['where'],{'$or':_[_0xf855('0x2a')](_0x397e01,function(_0x59e5a6){if(_0x59e5a6[_0xf855('0x3d')]!==_0xf855('0x3e')){var _0x421ad6={};_0x421ad6[_0x59e5a6[_0xf855('0x29')]]={'$like':'%'+_0x375f1a[_0xf855('0x2f')]['filter']+'%'};return _0x421ad6;}})});}_0x5da4c4=_[_0xf855('0x3c')]({},_0x5da4c4,_0x375f1a[_0xf855('0x3f')]);var _0x5a6c52={'where':_0x5da4c4[_0xf855('0x39')]};return db[_0xf855('0x2b')][_0xf855('0x20')](_0x5a6c52)[_0xf855('0x26')](function(_0x52babb){_0x38dc5f[_0xf855('0x20')]=_0x52babb;if(_0x375f1a['query']['includeAll']){_0x5da4c4['include']=[{'all':!![]}];}return db[_0xf855('0x2b')][_0xf855('0x40')](_0x5da4c4);})[_0xf855('0x26')](function(_0x592839){_0x38dc5f[_0xf855('0x41')]=_0x592839;return _0x38dc5f;})[_0xf855('0x26')](respondWithFilteredResult(_0x424a2b,_0x5da4c4))[_0xf855('0x42')](handleError(_0x424a2b,null));};exports[_0xf855('0x43')]=function(_0x3d0850,_0x2593cc){var _0x2e6e8c={'raw':!![],'where':{'id':_0x3d0850['params']['id']}},_0x23b7d6={};_0x23b7d6[_0xf855('0x2e')]=_['keys'](db[_0xf855('0x2b')][_0xf855('0x2c')]);_0x23b7d6['query']=_[_0xf855('0x30')](_0x3d0850[_0xf855('0x2f')]);_0x23b7d6[_0xf855('0x31')]=_['intersection'](_0x23b7d6['model'],_0x23b7d6[_0xf855('0x2f')]);_0x2e6e8c[_0xf855('0x34')]=_[_0xf855('0x32')](_0x23b7d6[_0xf855('0x2e')],qs['fields'](_0x3d0850[_0xf855('0x2f')][_0xf855('0x33')]));_0x2e6e8c[_0xf855('0x34')]=_0x2e6e8c[_0xf855('0x34')][_0xf855('0x35')]?_0x2e6e8c[_0xf855('0x34')]:_0x23b7d6['model'];if(_0x3d0850[_0xf855('0x2f')][_0xf855('0x44')]){_0x2e6e8c[_0xf855('0x45')]=[{'all':!![]}];}_0x2e6e8c=_[_0xf855('0x3c')]({},_0x2e6e8c,_0x3d0850[_0xf855('0x3f')]);return db[_0xf855('0x2b')][_0xf855('0x46')](_0x2e6e8c)[_0xf855('0x26')](handleEntityNotFound(_0x2593cc,null))[_0xf855('0x26')](respondWithResult(_0x2593cc,null))[_0xf855('0x42')](handleError(_0x2593cc,null));};exports[_0xf855('0x47')]=function(_0x3f6937,_0x53d0f7){return db[_0xf855('0x2b')][_0xf855('0x47')](_0x3f6937[_0xf855('0x48')],{})[_0xf855('0x26')](respondWithResult(_0x53d0f7,0xc9))[_0xf855('0x42')](handleError(_0x53d0f7,null));};exports['update']=function(_0x4a1ba4,_0x27a53e){if(_0x4a1ba4[_0xf855('0x48')]['id']){delete _0x4a1ba4[_0xf855('0x48')]['id'];}return db[_0xf855('0x2b')]['find']({'where':{'id':_0x4a1ba4[_0xf855('0x49')]['id']}})[_0xf855('0x26')](handleEntityNotFound(_0x27a53e,null))[_0xf855('0x26')](saveUpdates(_0x4a1ba4[_0xf855('0x48')],null))['then'](respondWithResult(_0x27a53e,null))[_0xf855('0x42')](handleError(_0x27a53e,null));};exports[_0xf855('0x27')]=function(_0x5c5b0d,_0xb3927d){return db[_0xf855('0x2b')][_0xf855('0x46')]({'where':{'id':_0x5c5b0d[_0xf855('0x49')]['id']}})['then'](handleEntityNotFound(_0xb3927d,null))[_0xf855('0x26')](removeEntity(_0xb3927d,null))[_0xf855('0x42')](handleError(_0xb3927d,null));};
\ No newline at end of file
+var _0x8b1c=['catch','params','rawAttributes','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','stack','name','map','ServicenowField','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','include','findAll','rows'];(function(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0x8b1c,0x12c));var _0xc8b1=function(_0x6fc7d6,_0x480179){_0x6fc7d6=_0x6fc7d6-0x0;var _0x11ff53=_0x8b1c[_0x6fc7d6];return _0x11ff53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8b1('0x0'));var zipdir=require(_0xc8b1('0x1'));var jsonpatch=require(_0xc8b1('0x2'));var rp=require(_0xc8b1('0x3'));var moment=require(_0xc8b1('0x4'));var BPromise=require(_0xc8b1('0x5'));var Mustache=require(_0xc8b1('0x6'));var util=require(_0xc8b1('0x7'));var path=require(_0xc8b1('0x8'));var sox=require(_0xc8b1('0x9'));var csv=require('to-csv');var ejs=require(_0xc8b1('0xa'));var fs=require('fs');var fs_extra=require(_0xc8b1('0xb'));var _=require(_0xc8b1('0xc'));var squel=require(_0xc8b1('0xd'));var crypto=require(_0xc8b1('0xe'));var jsforce=require(_0xc8b1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc8b1('0x10'));var querystring=require('querystring');var Papa=require(_0xc8b1('0x11'));var Redis=require(_0xc8b1('0x12'));var authService=require(_0xc8b1('0x13'));var qs=require(_0xc8b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc8b1('0x15'));var logger=require(_0xc8b1('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc8b1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc8b1('0x18'))['db'];function respondWithStatusCode(_0x239243,_0x443adb){_0x443adb=_0x443adb||0xcc;return function(_0x3645bb){if(_0x3645bb){return _0x239243['sendStatus'](_0x443adb);}return _0x239243[_0xc8b1('0x19')](_0x443adb)['end']();};}function respondWithResult(_0x2af498,_0x317e90){_0x317e90=_0x317e90||0xc8;return function(_0x19a765){if(_0x19a765){return _0x2af498[_0xc8b1('0x19')](_0x317e90)[_0xc8b1('0x1a')](_0x19a765);}};}function respondWithFilteredResult(_0x902575,_0x34e033){return function(_0x29267b){if(_0x29267b){var _0x4cf653=typeof _0x34e033['offset']===_0xc8b1('0x1b')&&typeof _0x34e033[_0xc8b1('0x1c')]===_0xc8b1('0x1b');var _0x42f7bc=_0x29267b[_0xc8b1('0x1d')];var _0x5b8b51=_0x4cf653?0x0:_0x34e033[_0xc8b1('0x1e')];var _0x3b9f64=_0x4cf653?_0x29267b[_0xc8b1('0x1d')]:_0x34e033[_0xc8b1('0x1e')]+_0x34e033[_0xc8b1('0x1c')];var _0x740b2b;if(_0x3b9f64>=_0x42f7bc){_0x3b9f64=_0x42f7bc;_0x740b2b=0xc8;}else{_0x740b2b=0xce;}_0x902575[_0xc8b1('0x19')](_0x740b2b);return _0x902575[_0xc8b1('0x1f')](_0xc8b1('0x20'),_0x5b8b51+'-'+_0x3b9f64+'/'+_0x42f7bc)[_0xc8b1('0x1a')](_0x29267b);}return null;};}function patchUpdates(_0x5bc6d7){return function(_0x5d26ca){try{jsonpatch['apply'](_0x5d26ca,_0x5bc6d7,!![]);}catch(_0x5991bc){return BPromise[_0xc8b1('0x21')](_0x5991bc);}return _0x5d26ca[_0xc8b1('0x22')]();};}function saveUpdates(_0x42e11e,_0x4de715){return function(_0xe05778){if(_0xe05778){return _0xe05778[_0xc8b1('0x23')](_0x42e11e)['then'](function(_0x53ee96){return _0x53ee96;});}return null;};}function removeEntity(_0x150f52,_0x31a1d5){return function(_0x40a0fd){if(_0x40a0fd){return _0x40a0fd[_0xc8b1('0x24')]()[_0xc8b1('0x25')](function(){_0x150f52[_0xc8b1('0x19')](0xcc)[_0xc8b1('0x26')]();});}};}function handleEntityNotFound(_0x4ac9fd,_0x5f04d){return function(_0x4c6bf2){if(!_0x4c6bf2){_0x4ac9fd[_0xc8b1('0x27')](0x194);}return _0x4c6bf2;};}function handleError(_0x3f3e9b,_0x4c6902){_0x4c6902=_0x4c6902||0x1f4;return function(_0x359bd3){logger['error'](_0x359bd3[_0xc8b1('0x28')]);if(_0x359bd3[_0xc8b1('0x29')]){delete _0x359bd3[_0xc8b1('0x29')];}_0x3f3e9b[_0xc8b1('0x19')](_0x4c6902)['send'](_0x359bd3);};}exports['index']=function(_0x12ee36,_0xc789d1){var _0x3cd3dd={},_0x36cf50={},_0x2a04d9={'count':0x0,'rows':[]};var _0xbc765e=_[_0xc8b1('0x2a')](db[_0xc8b1('0x2b')]['rawAttributes'],function(_0x573b0c){return{'name':_0x573b0c[_0xc8b1('0x2c')],'type':_0x573b0c[_0xc8b1('0x2d')][_0xc8b1('0x2e')]};});_0x36cf50[_0xc8b1('0x2f')]=_[_0xc8b1('0x2a')](_0xbc765e,_0xc8b1('0x29'));_0x36cf50[_0xc8b1('0x30')]=_[_0xc8b1('0x31')](_0x12ee36[_0xc8b1('0x30')]);_0x36cf50[_0xc8b1('0x32')]=_['intersection'](_0x36cf50[_0xc8b1('0x2f')],_0x36cf50[_0xc8b1('0x30')]);_0x3cd3dd[_0xc8b1('0x33')]=_[_0xc8b1('0x34')](_0x36cf50[_0xc8b1('0x2f')],qs[_0xc8b1('0x35')](_0x12ee36[_0xc8b1('0x30')][_0xc8b1('0x35')]));_0x3cd3dd[_0xc8b1('0x33')]=_0x3cd3dd[_0xc8b1('0x33')][_0xc8b1('0x36')]?_0x3cd3dd[_0xc8b1('0x33')]:_0x36cf50[_0xc8b1('0x2f')];if(!_0x12ee36[_0xc8b1('0x30')][_0xc8b1('0x37')](_0xc8b1('0x38'))){_0x3cd3dd['limit']=qs[_0xc8b1('0x1c')](_0x12ee36['query'][_0xc8b1('0x1c')]);_0x3cd3dd[_0xc8b1('0x1e')]=qs['offset'](_0x12ee36[_0xc8b1('0x30')][_0xc8b1('0x1e')]);}_0x3cd3dd['order']=qs['sort'](_0x12ee36[_0xc8b1('0x30')][_0xc8b1('0x39')]);_0x3cd3dd[_0xc8b1('0x3a')]=qs[_0xc8b1('0x32')](_['pick'](_0x12ee36['query'],_0x36cf50[_0xc8b1('0x32')]),_0xbc765e);if(_0x12ee36[_0xc8b1('0x30')][_0xc8b1('0x3b')]){_0x3cd3dd[_0xc8b1('0x3a')]=_['merge'](_0x3cd3dd['where'],{'$or':_['map'](_0xbc765e,function(_0x388d2d){if(_0x388d2d[_0xc8b1('0x2d')]!==_0xc8b1('0x3c')){var _0x2881c6={};_0x2881c6[_0x388d2d[_0xc8b1('0x29')]]={'$like':'%'+_0x12ee36['query'][_0xc8b1('0x3b')]+'%'};return _0x2881c6;}})});}_0x3cd3dd=_[_0xc8b1('0x3d')]({},_0x3cd3dd,_0x12ee36['options']);var _0x41d3f2={'where':_0x3cd3dd[_0xc8b1('0x3a')]};return db[_0xc8b1('0x2b')][_0xc8b1('0x1d')](_0x41d3f2)[_0xc8b1('0x25')](function(_0x1b789f){_0x2a04d9[_0xc8b1('0x1d')]=_0x1b789f;if(_0x12ee36[_0xc8b1('0x30')]['includeAll']){_0x3cd3dd[_0xc8b1('0x3e')]=[{'all':!![]}];}return db[_0xc8b1('0x2b')][_0xc8b1('0x3f')](_0x3cd3dd);})[_0xc8b1('0x25')](function(_0x2156d3){_0x2a04d9[_0xc8b1('0x40')]=_0x2156d3;return _0x2a04d9;})[_0xc8b1('0x25')](respondWithFilteredResult(_0xc789d1,_0x3cd3dd))[_0xc8b1('0x41')](handleError(_0xc789d1,null));};exports['show']=function(_0x3fdbee,_0x24757c){var _0x3426f7={'raw':!![],'where':{'id':_0x3fdbee[_0xc8b1('0x42')]['id']}},_0x3bdd70={};_0x3bdd70[_0xc8b1('0x2f')]=_[_0xc8b1('0x31')](db[_0xc8b1('0x2b')][_0xc8b1('0x43')]);_0x3bdd70[_0xc8b1('0x30')]=_[_0xc8b1('0x31')](_0x3fdbee['query']);_0x3bdd70[_0xc8b1('0x32')]=_[_0xc8b1('0x34')](_0x3bdd70[_0xc8b1('0x2f')],_0x3bdd70[_0xc8b1('0x30')]);_0x3426f7[_0xc8b1('0x33')]=_[_0xc8b1('0x34')](_0x3bdd70[_0xc8b1('0x2f')],qs[_0xc8b1('0x35')](_0x3fdbee[_0xc8b1('0x30')]['fields']));_0x3426f7[_0xc8b1('0x33')]=_0x3426f7[_0xc8b1('0x33')]['length']?_0x3426f7[_0xc8b1('0x33')]:_0x3bdd70[_0xc8b1('0x2f')];if(_0x3fdbee[_0xc8b1('0x30')][_0xc8b1('0x44')]){_0x3426f7[_0xc8b1('0x3e')]=[{'all':!![]}];}_0x3426f7=_[_0xc8b1('0x3d')]({},_0x3426f7,_0x3fdbee[_0xc8b1('0x45')]);return db[_0xc8b1('0x2b')][_0xc8b1('0x46')](_0x3426f7)[_0xc8b1('0x25')](handleEntityNotFound(_0x24757c,null))[_0xc8b1('0x25')](respondWithResult(_0x24757c,null))['catch'](handleError(_0x24757c,null));};exports[_0xc8b1('0x47')]=function(_0x2c925e,_0x5966d6){return db[_0xc8b1('0x2b')]['create'](_0x2c925e[_0xc8b1('0x48')],{})[_0xc8b1('0x25')](respondWithResult(_0x5966d6,0xc9))[_0xc8b1('0x41')](handleError(_0x5966d6,null));};exports[_0xc8b1('0x23')]=function(_0x3b5f04,_0x5cc992){if(_0x3b5f04[_0xc8b1('0x48')]['id']){delete _0x3b5f04['body']['id'];}return db[_0xc8b1('0x2b')][_0xc8b1('0x46')]({'where':{'id':_0x3b5f04[_0xc8b1('0x42')]['id']}})[_0xc8b1('0x25')](handleEntityNotFound(_0x5cc992,null))[_0xc8b1('0x25')](saveUpdates(_0x3b5f04[_0xc8b1('0x48')],null))[_0xc8b1('0x25')](respondWithResult(_0x5cc992,null))[_0xc8b1('0x41')](handleError(_0x5cc992,null));};exports['destroy']=function(_0x4dd292,_0x56a322){return db[_0xc8b1('0x2b')]['find']({'where':{'id':_0x4dd292['params']['id']}})['then'](handleEntityNotFound(_0x56a322,null))[_0xc8b1('0x25')](removeEntity(_0x56a322,null))[_0xc8b1('0x41')](handleError(_0x56a322,null));};
\ No newline at end of file
index 2e0b285..4f7d834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc98=['util','moment','bluebird','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash'];(function(_0x120385,_0x54064d){var _0x1ccb0f=function(_0x3a36ea){while(--_0x3a36ea){_0x120385['push'](_0x120385['shift']());}};_0x1ccb0f(++_0x54064d);}(_0xcc98,0x8e));var _0x8cc9=function(_0xf892e4,_0xfe3e6){_0xf892e4=_0xf892e4-0x0;var _0x53d620=_0xcc98[_0xf892e4];return _0x53d620;};'use strict';var _=require(_0x8cc9('0x0'));var util=require(_0x8cc9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8cc9('0x2'));var BPromise=require(_0x8cc9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cc9('0x4'));var rimraf=require(_0x8cc9('0x5'));var config=require(_0x8cc9('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x8cc9('0x7')]=function(_0x1e6ef4,_0x51d2b4){return _0x1e6ef4[_0x8cc9('0x8')](_0x8cc9('0x9'),attributes,{'tableName':_0x8cc9('0xa'),'paranoid':![],'indexes':[{'name':_0x8cc9('0xb'),'fields':[_0x8cc9('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc8c=['idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdc8c,0x9c));var _0xcdc8=function(_0x2ee238,_0x10bb44){_0x2ee238=_0x2ee238-0x0;var _0x498e84=_0xdc8c[_0x2ee238];return _0x498e84;};'use strict';var _=require('lodash');var util=require(_0xcdc8('0x0'));var logger=require(_0xcdc8('0x1'))(_0xcdc8('0x2'));var moment=require(_0xcdc8('0x3'));var BPromise=require(_0xcdc8('0x4'));var rp=require(_0xcdc8('0x5'));var fs=require('fs');var path=require(_0xcdc8('0x6'));var rimraf=require(_0xcdc8('0x7'));var config=require(_0xcdc8('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0xd621be,_0x25e093){return _0xd621be['define'](_0xcdc8('0x9'),attributes,{'tableName':_0xcdc8('0xa'),'paranoid':![],'indexes':[{'name':_0xcdc8('0xb'),'fields':[_0xcdc8('0xc'),_0xcdc8('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7620f07..c1302a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x375efe,_0x27df2d){var _0x1d5db6=function(_0x43e15d){while(--_0x43e15d){_0x375efe['push'](_0x375efe['shift']());}};_0x1d5db6(++_0x27df2d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x309ad1,_0x21d1fe){var _0x23a590=function(_0x181983){while(--_0x181983){_0x309ad1['push'](_0x309ad1['shift']());}};_0x23a590(++_0x21d1fe);}(_0xe706,0xa3));var _0x6e70=function(_0x11e90b,_0x3ec29a){_0x11e90b=_0x11e90b-0x0;var _0x31452e=_0xe706[_0x11e90b];return _0x31452e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index e88dab1..86a1835 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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3eb34a,_0x8ab133){var _0x2e75=function(_0x3a5dd4){while(--_0x3a5dd4){_0x3eb34a['push'](_0x3eb34a['shift']());}};_0x2e75(++_0x8ab133);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2fc65e,_0x1fc73f){var _0x517b02=function(_0x1f1571){while(--_0x1f1571){_0x2fc65e['push'](_0x2fc65e['shift']());}};_0x517b02(++_0x1fc73f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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 9f69668..bd3a173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x371979,_0x2887d8){var _0x4d1778=function(_0x1c638b){while(--_0x1c638b){_0x371979['push'](_0x371979['shift']());}};_0x4d1778(++_0x2887d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x4403a3,_0x33b6fa){var _0x50d53d=function(_0x294701){while(--_0x294701){_0x4403a3['push'](_0x4403a3['shift']());}};_0x50d53d(++_0x33b6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 85621fb..43b9be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb358=['status','json','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','SugarcrmAccount','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filters','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','length','include','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','stringify','Calls','values','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x527a9d,_0x588f28){var _0x28f4dd=function(_0x48d66a){while(--_0x48d66a){_0x527a9d['push'](_0x527a9d['shift']());}};_0x28f4dd(++_0x588f28);}(_0xb358,0x1b5));var _0x8b35=function(_0x181240,_0xa66624){_0x181240=_0x181240-0x0;var _0x1a2fb7=_0xb358[_0x181240];return _0x1a2fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8b35('0x0'));var zipdir=require(_0x8b35('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b35('0x2'));var BPromise=require(_0x8b35('0x3'));var Mustache=require(_0x8b35('0x4'));var util=require(_0x8b35('0x5'));var path=require(_0x8b35('0x6'));var sox=require(_0x8b35('0x7'));var csv=require(_0x8b35('0x8'));var ejs=require(_0x8b35('0x9'));var fs=require('fs');var fs_extra=require(_0x8b35('0xa'));var _=require('lodash');var squel=require(_0x8b35('0xb'));var crypto=require(_0x8b35('0xc'));var jsforce=require(_0x8b35('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8b35('0x8'));var querystring=require(_0x8b35('0xe'));var Papa=require(_0x8b35('0xf'));var Redis=require(_0x8b35('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b35('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8b35('0x12'));var config=require(_0x8b35('0x13'));var licenseUtil=require(_0x8b35('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5fd158,_0x2ae34e){_0x2ae34e=_0x2ae34e||0xcc;return function(_0x2276e4){if(_0x2276e4){return _0x5fd158[_0x8b35('0x15')](_0x2ae34e);}return _0x5fd158['status'](_0x2ae34e)[_0x8b35('0x16')]();};}function respondWithResult(_0x213e0a,_0x18439d){_0x18439d=_0x18439d||0xc8;return function(_0x2c9df2){if(_0x2c9df2){return _0x213e0a[_0x8b35('0x17')](_0x18439d)[_0x8b35('0x18')](_0x2c9df2);}};}function respondWithFilteredResult(_0x4c4539,_0x578450){return function(_0x5e53e7){if(_0x5e53e7){var _0x3b24cf=typeof _0x578450['offset']==='undefined'&&typeof _0x578450[_0x8b35('0x19')]==='undefined';var _0xdb2e64=_0x5e53e7[_0x8b35('0x1a')];var _0x3bc447=_0x3b24cf?0x0:_0x578450['offset'];var _0x277ba6=_0x3b24cf?_0x5e53e7[_0x8b35('0x1a')]:_0x578450['offset']+_0x578450[_0x8b35('0x19')];var _0x200fdb;if(_0x277ba6>=_0xdb2e64){_0x277ba6=_0xdb2e64;_0x200fdb=0xc8;}else{_0x200fdb=0xce;}_0x4c4539['status'](_0x200fdb);return _0x4c4539[_0x8b35('0x1b')](_0x8b35('0x1c'),_0x3bc447+'-'+_0x277ba6+'/'+_0xdb2e64)[_0x8b35('0x18')](_0x5e53e7);}return null;};}function patchUpdates(_0x401d70){return function(_0x5cd63b){try{jsonpatch[_0x8b35('0x1d')](_0x5cd63b,_0x401d70,!![]);}catch(_0x2d280c){return BPromise[_0x8b35('0x1e')](_0x2d280c);}return _0x5cd63b['save']();};}function saveUpdates(_0x111fd7,_0x101b41){return function(_0x3b8bf7){if(_0x3b8bf7){return _0x3b8bf7[_0x8b35('0x1f')](_0x111fd7)[_0x8b35('0x20')](function(_0x57556d){return _0x57556d;});}return null;};}function removeEntity(_0x313848,_0x1ffde2){return function(_0x5b739c){if(_0x5b739c){return _0x5b739c[_0x8b35('0x21')]()[_0x8b35('0x20')](function(){_0x313848[_0x8b35('0x17')](0xcc)[_0x8b35('0x16')]();});}};}function handleEntityNotFound(_0x59c38c,_0x457412){return function(_0x51ee59){if(!_0x51ee59){_0x59c38c[_0x8b35('0x15')](0x194);}return _0x51ee59;};}function handleError(_0x1ac81a,_0x4fb045){_0x4fb045=_0x4fb045||0x1f4;return function(_0x3fa112){logger[_0x8b35('0x22')](_0x3fa112['stack']);if(_0x3fa112[_0x8b35('0x23')]){delete _0x3fa112[_0x8b35('0x23')];}_0x1ac81a[_0x8b35('0x17')](_0x4fb045)[_0x8b35('0x24')](_0x3fa112);};}exports[_0x8b35('0x25')]=function(_0x320052,_0x3232a7){var _0x22bd9b={},_0x53dd49={},_0xb56d53={'count':0x0,'rows':[]};var _0x16057b=_[_0x8b35('0x26')](db[_0x8b35('0x27')]['rawAttributes'],function(_0x36e748){return{'name':_0x36e748['fieldName'],'type':_0x36e748[_0x8b35('0x28')][_0x8b35('0x29')]};});_0x53dd49['model']=_[_0x8b35('0x26')](_0x16057b,_0x8b35('0x23'));_0x53dd49['query']=_[_0x8b35('0x2a')](_0x320052[_0x8b35('0x2b')]);_0x53dd49['filters']=_[_0x8b35('0x2c')](_0x53dd49[_0x8b35('0x2d')],_0x53dd49['query']);_0x22bd9b[_0x8b35('0x2e')]=_[_0x8b35('0x2c')](_0x53dd49[_0x8b35('0x2d')],qs[_0x8b35('0x2f')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x2f')]));_0x22bd9b['attributes']=_0x22bd9b['attributes']['length']?_0x22bd9b['attributes']:_0x53dd49[_0x8b35('0x2d')];if(!_0x320052[_0x8b35('0x2b')][_0x8b35('0x30')]('nolimit')){_0x22bd9b[_0x8b35('0x19')]=qs[_0x8b35('0x19')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x19')]);_0x22bd9b[_0x8b35('0x31')]=qs[_0x8b35('0x31')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x31')]);}_0x22bd9b[_0x8b35('0x32')]=qs[_0x8b35('0x33')](_0x320052[_0x8b35('0x2b')][_0x8b35('0x33')]);_0x22bd9b[_0x8b35('0x34')]=qs['filters'](_[_0x8b35('0x35')](_0x320052[_0x8b35('0x2b')],_0x53dd49[_0x8b35('0x36')]),_0x16057b);if(_0x320052[_0x8b35('0x2b')]['filter']){_0x22bd9b[_0x8b35('0x34')]=_[_0x8b35('0x37')](_0x22bd9b[_0x8b35('0x34')],{'$or':_[_0x8b35('0x26')](_0x16057b,function(_0x5b67a6){if(_0x5b67a6[_0x8b35('0x28')]!=='VIRTUAL'){var _0x1187fd={};_0x1187fd[_0x5b67a6['name']]={'$like':'%'+_0x320052[_0x8b35('0x2b')]['filter']+'%'};return _0x1187fd;}})});}_0x22bd9b=_[_0x8b35('0x37')]({},_0x22bd9b,_0x320052[_0x8b35('0x38')]);var _0x11911d={'where':_0x22bd9b[_0x8b35('0x34')]};return db[_0x8b35('0x27')][_0x8b35('0x1a')](_0x11911d)[_0x8b35('0x20')](function(_0x2037b3){_0xb56d53[_0x8b35('0x1a')]=_0x2037b3;if(_0x320052[_0x8b35('0x2b')][_0x8b35('0x39')]){_0x22bd9b['include']=[{'all':!![]}];}return db[_0x8b35('0x27')][_0x8b35('0x3a')](_0x22bd9b);})[_0x8b35('0x20')](function(_0xcade55){_0xb56d53[_0x8b35('0x3b')]=_0xcade55;return _0xb56d53;})[_0x8b35('0x20')](respondWithFilteredResult(_0x3232a7,_0x22bd9b))[_0x8b35('0x3c')](handleError(_0x3232a7,null));};exports['show']=function(_0x58679b,_0x24101b){var _0x1a1889={'raw':![],'where':{'id':_0x58679b[_0x8b35('0x3d')]['id']}},_0x4a0d0e={};_0x4a0d0e[_0x8b35('0x2d')]=_['keys'](db['SugarcrmAccount'][_0x8b35('0x3e')]);_0x4a0d0e[_0x8b35('0x2b')]=_[_0x8b35('0x2a')](_0x58679b[_0x8b35('0x2b')]);_0x4a0d0e[_0x8b35('0x36')]=_[_0x8b35('0x2c')](_0x4a0d0e[_0x8b35('0x2d')],_0x4a0d0e[_0x8b35('0x2b')]);_0x1a1889['attributes']=_['intersection'](_0x4a0d0e['model'],qs[_0x8b35('0x2f')](_0x58679b[_0x8b35('0x2b')]['fields']));_0x1a1889[_0x8b35('0x2e')]=_0x1a1889['attributes'][_0x8b35('0x3f')]?_0x1a1889[_0x8b35('0x2e')]:_0x4a0d0e[_0x8b35('0x2d')];if(_0x58679b[_0x8b35('0x2b')][_0x8b35('0x39')]){_0x1a1889[_0x8b35('0x40')]=[{'all':!![]}];}_0x1a1889=_[_0x8b35('0x37')]({},_0x1a1889,_0x58679b[_0x8b35('0x38')]);return db[_0x8b35('0x27')]['find'](_0x1a1889)[_0x8b35('0x20')](handleEntityNotFound(_0x24101b,null))['then'](respondWithResult(_0x24101b,null))['catch'](handleError(_0x24101b,null));};exports[_0x8b35('0x41')]=function(_0x48ff7f,_0x49025e){return db[_0x8b35('0x27')][_0x8b35('0x41')](_0x48ff7f[_0x8b35('0x42')],{})[_0x8b35('0x20')](respondWithResult(_0x49025e,0xc9))[_0x8b35('0x3c')](handleError(_0x49025e,null));};exports[_0x8b35('0x1f')]=function(_0x286562,_0x288452){if(_0x286562[_0x8b35('0x42')]['id']){delete _0x286562[_0x8b35('0x42')]['id'];}return db[_0x8b35('0x27')][_0x8b35('0x43')]({'where':{'id':_0x286562['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x288452,null))[_0x8b35('0x20')](saveUpdates(_0x286562[_0x8b35('0x42')],null))['then'](respondWithResult(_0x288452,null))[_0x8b35('0x3c')](handleError(_0x288452,null));};exports[_0x8b35('0x21')]=function(_0x3a4fe0,_0x321d82){return db[_0x8b35('0x27')][_0x8b35('0x43')]({'where':{'id':_0x3a4fe0[_0x8b35('0x3d')]['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x321d82,null))[_0x8b35('0x20')](removeEntity(_0x321d82,null))['catch'](handleError(_0x321d82,null));};exports[_0x8b35('0x44')]=function(_0x5c0d92,_0x2f2eef,_0x5f21b9){var _0xdc18e8={};var _0x5a8a10={};var _0x11ca90;var _0x4b9f5a;return db[_0x8b35('0x27')][_0x8b35('0x45')]({'where':{'id':_0x5c0d92['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x2f2eef,null))['then'](function(_0x1b22db){if(_0x1b22db){_0x11ca90=_0x1b22db;_0x5a8a10['model']=_[_0x8b35('0x2a')](db[_0x8b35('0x46')][_0x8b35('0x3e')]);_0x5a8a10[_0x8b35('0x2b')]=_[_0x8b35('0x2a')](_0x5c0d92[_0x8b35('0x2b')]);_0x5a8a10[_0x8b35('0x36')]=_[_0x8b35('0x2c')](_0x5a8a10[_0x8b35('0x2d')],_0x5a8a10['query']);_0xdc18e8[_0x8b35('0x2e')]=_['intersection'](_0x5a8a10['model'],qs['fields'](_0x5c0d92[_0x8b35('0x2b')]['fields']));_0xdc18e8['attributes']=_0xdc18e8[_0x8b35('0x2e')][_0x8b35('0x3f')]?_0xdc18e8[_0x8b35('0x2e')]:_0x5a8a10[_0x8b35('0x2d')];_0xdc18e8[_0x8b35('0x32')]=qs[_0x8b35('0x33')](_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x33')]);_0xdc18e8[_0x8b35('0x34')]=qs[_0x8b35('0x36')](_[_0x8b35('0x35')](_0x5c0d92['query'],_0x5a8a10['filters']));if(_0x5c0d92[_0x8b35('0x2b')]['filter']){_0xdc18e8['where']=_['merge'](_0xdc18e8[_0x8b35('0x34')],{'$or':_[_0x8b35('0x26')](_0xdc18e8[_0x8b35('0x2e')],function(_0x3ab961){var _0x174e85={};_0x174e85[_0x3ab961]={'$like':'%'+_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x47')]+'%'};return _0x174e85;})});}_0xdc18e8=_[_0x8b35('0x37')]({},_0xdc18e8,_0x5c0d92[_0x8b35('0x38')]);return _0x11ca90[_0x8b35('0x44')](_0xdc18e8);}})[_0x8b35('0x20')](function(_0x54e9c4){if(_0x54e9c4){_0x4b9f5a=_0x54e9c4['length'];if(!_0x5c0d92[_0x8b35('0x2b')][_0x8b35('0x30')](_0x8b35('0x48'))){_0xdc18e8[_0x8b35('0x19')]=qs['limit'](_0x5c0d92['query'][_0x8b35('0x19')]);_0xdc18e8[_0x8b35('0x31')]=qs['offset'](_0x5c0d92['query'][_0x8b35('0x31')]);}return _0x11ca90[_0x8b35('0x44')](_0xdc18e8);}})[_0x8b35('0x20')](function(_0x4502b7){if(_0x4502b7){return _0x4502b7?{'count':_0x4b9f5a,'rows':_0x4502b7}:null;}})[_0x8b35('0x20')](respondWithResult(_0x2f2eef,null))[_0x8b35('0x3c')](handleError(_0x2f2eef,null));};exports[_0x8b35('0x49')]=function(_0x2ed2f6,_0x24462a,_0x1231f3){if(_0x2ed2f6[_0x8b35('0x42')]['id']){delete _0x2ed2f6[_0x8b35('0x42')]['id'];}return db[_0x8b35('0x27')]['findOne']({'where':{'id':_0x2ed2f6['params']['id']}})[_0x8b35('0x20')](handleEntityNotFound(_0x24462a,null))[_0x8b35('0x20')](function(_0x40d1e9){if(_0x40d1e9){_0x2ed2f6['body'][_0x8b35('0x4a')]=_0x40d1e9['id'];_0x2ed2f6['body'][_0x8b35('0x4b')]=integrations[_0x8b35('0x4c')](_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x4d')],_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x28')]);_0x2ed2f6['body'][_0x8b35('0x4e')]=integrations['getDescriptions'](_0x2ed2f6[_0x8b35('0x42')][_0x8b35('0x4d')],_0x2ed2f6['body'][_0x8b35('0x28')]);return db[_0x8b35('0x46')][_0x8b35('0x41')](_0x2ed2f6['body'],{'include':[{'model':db[_0x8b35('0x4f')],'as':_0x8b35('0x4b')},{'model':db[_0x8b35('0x4f')],'as':'Descriptions'}]});}return null;})[_0x8b35('0x20')](respondWithResult(_0x24462a,null))['catch'](handleError(_0x24462a,null));};exports[_0x8b35('0x50')]=function(_0x315c2d,_0x49b7f1,_0x20851b){var _0x4d8266='';var _0x12eb54=['id','name',_0x8b35('0x51'),'created_by',_0x8b35('0x52'),'date_start',_0x8b35('0x53'),_0x8b35('0x54'),_0x8b35('0x55'),'parent_type','parent_name',_0x8b35('0x56')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x315c2d[_0x8b35('0x3d')]['id']},'attributes':['id','username',_0x8b35('0x57'),_0x8b35('0x58')]})[_0x8b35('0x20')](handleEntityNotFound(_0x49b7f1,null))[_0x8b35('0x20')](function(_0x4514a8){if(_0x4514a8){_0x4d8266=_0x4514a8[_0x8b35('0x58')];var _0x53ebba=_0x4d8266[_0x8b35('0x59')](-0x1);if(_0x53ebba==='/'){_0x4d8266=_0x4d8266[_0x8b35('0x5a')](0x0,_0x4d8266[_0x8b35('0x5b')](_0x53ebba));}return rp({'method':_0x8b35('0x5c'),'uri':util['format'](_0x8b35('0x5d'),_0x4d8266,_0x8b35('0x5e')),'json':!![],'form':{'method':_0x8b35('0x5f'),'input_type':_0x8b35('0x60'),'response_type':_0x8b35('0x60'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4514a8[_0x8b35('0x61')],'password':_0x4514a8[_0x8b35('0x57')],'encryption':_0x8b35('0x62')},'application':_0x8b35('0x63')})}});}})['then'](function(_0x5ed099){if(_0x5ed099&&_0x5ed099['name']!==_0x8b35('0x64')&&_0x5ed099['name']!==_0x8b35('0x65')){return rp({'method':_0x8b35('0x5c'),'uri':util[_0x8b35('0x66')](_0x8b35('0x5d'),_0x4d8266,_0x8b35('0x5e')),'json':!![],'form':{'method':_0x8b35('0x67'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8b35('0x68')]({'session':_0x5ed099['id'],'module_name':_0x8b35('0x69')})}})['then'](function(_0x541052){if(_0x541052){var _0x24871f=_[_0x8b35('0x6a')](_0x541052['module_fields']);_[_0x8b35('0x6b')](_0x24871f,function(_0x91e709){return _0x12eb54[_0x8b35('0x6c')](_0x91e709['name']);});return{'count':_0x24871f[_0x8b35('0x3f')],'rows':_[_0x8b35('0x26')](_0x24871f,function(_0x24a463){return{'id':_0x24a463[_0x8b35('0x23')],'name':_0x24a463[_0x8b35('0x6d')],'custom':_['endsWith'](_0x24a463['name'],'_c')?!![]:![],'options':_0x24a463['options']?_[_0x8b35('0x26')](_['values'](_0x24a463[_0x8b35('0x38')]),function(_0x389257){return{'name':_0x389257[_0x8b35('0x6e')],'value':_0x389257[_0x8b35('0x23')]};}):[]};})};}})[_0x8b35('0x20')](respondWithResult(_0x49b7f1,null))[_0x8b35('0x3c')](function(_0x116f85){var _0x5a6771=_0x315c2d['query'][_0x8b35('0x6f')]?0x1f4:_0x116f85[_0x8b35('0x70')]||0x1f4;logger[_0x8b35('0x22')](_0x8b35('0x71'),_0x8b35('0x50'),_0x5a6771,JSON[_0x8b35('0x68')](_0x116f85));delete _0x116f85[_0x8b35('0x23')];if(_0x5a6771===0x191){_0x5a6771=0x190;}_0x49b7f1[_0x8b35('0x17')](_0x5a6771)[_0x8b35('0x24')](_0x315c2d[_0x8b35('0x2b')]['test']?{'message':_0x8b35('0x72'),'statusCode':_0x116f85[_0x8b35('0x70')]}:_0x116f85);});}else{var _0x190b99=0x1f4;_0x49b7f1['status'](_0x190b99)['send']({'message':_0x8b35('0x72'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x9fe4=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','destroy','then','error','name','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','length','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','username','password','remoteUri','substring','lastIndexOf','POST','%s%s','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','format','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x25cd34,_0x574ec4){var _0xb0c643=function(_0x3da882){while(--_0x3da882){_0x25cd34['push'](_0x25cd34['shift']());}};_0xb0c643(++_0x574ec4);}(_0x9fe4,0x1d5));var _0x49fe=function(_0x1ca82d,_0x302bfc){_0x1ca82d=_0x1ca82d-0x0;var _0x5a4576=_0x9fe4[_0x1ca82d];return _0x5a4576;};'use strict';var emlformat=require(_0x49fe('0x0'));var rimraf=require(_0x49fe('0x1'));var zipdir=require(_0x49fe('0x2'));var jsonpatch=require(_0x49fe('0x3'));var rp=require(_0x49fe('0x4'));var moment=require(_0x49fe('0x5'));var BPromise=require(_0x49fe('0x6'));var Mustache=require(_0x49fe('0x7'));var util=require(_0x49fe('0x8'));var path=require(_0x49fe('0x9'));var sox=require(_0x49fe('0xa'));var csv=require(_0x49fe('0xb'));var ejs=require(_0x49fe('0xc'));var fs=require('fs');var fs_extra=require(_0x49fe('0xd'));var _=require(_0x49fe('0xe'));var squel=require(_0x49fe('0xf'));var crypto=require(_0x49fe('0x10'));var jsforce=require(_0x49fe('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x49fe('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x49fe('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x49fe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49fe('0x14'));var logger=require(_0x49fe('0x15'))(_0x49fe('0x16'));var utils=require(_0x49fe('0x17'));var config=require(_0x49fe('0x18'));var licenseUtil=require(_0x49fe('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x10c0c7,_0x377e03){_0x377e03=_0x377e03||0xcc;return function(_0x5cc5f8){if(_0x5cc5f8){return _0x10c0c7[_0x49fe('0x1a')](_0x377e03);}return _0x10c0c7[_0x49fe('0x1b')](_0x377e03)[_0x49fe('0x1c')]();};}function respondWithResult(_0x141ada,_0x3dd301){_0x3dd301=_0x3dd301||0xc8;return function(_0x137598){if(_0x137598){return _0x141ada['status'](_0x3dd301)[_0x49fe('0x1d')](_0x137598);}};}function respondWithFilteredResult(_0x114e7a,_0x336c5f){return function(_0x1c0426){if(_0x1c0426){var _0x1e0aff=typeof _0x336c5f['offset']===_0x49fe('0x1e')&&typeof _0x336c5f[_0x49fe('0x1f')]===_0x49fe('0x1e');var _0x56a8e3=_0x1c0426['count'];var _0x4e8101=_0x1e0aff?0x0:_0x336c5f[_0x49fe('0x20')];var _0xa9c7f3=_0x1e0aff?_0x1c0426[_0x49fe('0x21')]:_0x336c5f[_0x49fe('0x20')]+_0x336c5f[_0x49fe('0x1f')];var _0x17c0c4;if(_0xa9c7f3>=_0x56a8e3){_0xa9c7f3=_0x56a8e3;_0x17c0c4=0xc8;}else{_0x17c0c4=0xce;}_0x114e7a[_0x49fe('0x1b')](_0x17c0c4);return _0x114e7a[_0x49fe('0x22')](_0x49fe('0x23'),_0x4e8101+'-'+_0xa9c7f3+'/'+_0x56a8e3)['json'](_0x1c0426);}return null;};}function patchUpdates(_0xc2808b){return function(_0x8f2b58){try{jsonpatch[_0x49fe('0x24')](_0x8f2b58,_0xc2808b,!![]);}catch(_0x4cb1ad){return BPromise['reject'](_0x4cb1ad);}return _0x8f2b58['save']();};}function saveUpdates(_0x163d92,_0x4f13d6){return function(_0x5365e3){if(_0x5365e3){return _0x5365e3[_0x49fe('0x25')](_0x163d92)['then'](function(_0x537619){return _0x537619;});}return null;};}function removeEntity(_0x29093b,_0x41f42c){return function(_0x7d545){if(_0x7d545){return _0x7d545[_0x49fe('0x26')]()[_0x49fe('0x27')](function(){_0x29093b['status'](0xcc)[_0x49fe('0x1c')]();});}};}function handleEntityNotFound(_0x405efc,_0x172fb9){return function(_0x217f81){if(!_0x217f81){_0x405efc['sendStatus'](0x194);}return _0x217f81;};}function handleError(_0x53e1b9,_0x240bf0){_0x240bf0=_0x240bf0||0x1f4;return function(_0x49dc0d){logger[_0x49fe('0x28')](_0x49dc0d['stack']);if(_0x49dc0d[_0x49fe('0x29')]){delete _0x49dc0d['name'];}_0x53e1b9['status'](_0x240bf0)['send'](_0x49dc0d);};}exports['index']=function(_0x2f49a8,_0x29f836){var _0x2f9f46={},_0x2f8cb6={},_0x153769={'count':0x0,'rows':[]};var _0xe1578e=_[_0x49fe('0x2a')](db[_0x49fe('0x2b')][_0x49fe('0x2c')],function(_0x15f6d2){return{'name':_0x15f6d2[_0x49fe('0x2d')],'type':_0x15f6d2[_0x49fe('0x2e')][_0x49fe('0x2f')]};});_0x2f8cb6[_0x49fe('0x30')]=_[_0x49fe('0x2a')](_0xe1578e,_0x49fe('0x29'));_0x2f8cb6['query']=_['keys'](_0x2f49a8[_0x49fe('0x31')]);_0x2f8cb6['filters']=_[_0x49fe('0x32')](_0x2f8cb6[_0x49fe('0x30')],_0x2f8cb6[_0x49fe('0x31')]);_0x2f9f46[_0x49fe('0x33')]=_[_0x49fe('0x32')](_0x2f8cb6[_0x49fe('0x30')],qs[_0x49fe('0x34')](_0x2f49a8[_0x49fe('0x31')][_0x49fe('0x34')]));_0x2f9f46[_0x49fe('0x33')]=_0x2f9f46[_0x49fe('0x33')]['length']?_0x2f9f46['attributes']:_0x2f8cb6['model'];if(!_0x2f49a8[_0x49fe('0x31')]['hasOwnProperty'](_0x49fe('0x35'))){_0x2f9f46[_0x49fe('0x1f')]=qs[_0x49fe('0x1f')](_0x2f49a8[_0x49fe('0x31')][_0x49fe('0x1f')]);_0x2f9f46[_0x49fe('0x20')]=qs[_0x49fe('0x20')](_0x2f49a8[_0x49fe('0x31')][_0x49fe('0x20')]);}_0x2f9f46[_0x49fe('0x36')]=qs[_0x49fe('0x37')](_0x2f49a8['query']['sort']);_0x2f9f46[_0x49fe('0x38')]=qs[_0x49fe('0x39')](_[_0x49fe('0x3a')](_0x2f49a8['query'],_0x2f8cb6[_0x49fe('0x39')]),_0xe1578e);if(_0x2f49a8[_0x49fe('0x31')]['filter']){_0x2f9f46[_0x49fe('0x38')]=_[_0x49fe('0x3b')](_0x2f9f46[_0x49fe('0x38')],{'$or':_[_0x49fe('0x2a')](_0xe1578e,function(_0x26f128){if(_0x26f128[_0x49fe('0x2e')]!==_0x49fe('0x3c')){var _0x50c0c7={};_0x50c0c7[_0x26f128[_0x49fe('0x29')]]={'$like':'%'+_0x2f49a8[_0x49fe('0x31')][_0x49fe('0x3d')]+'%'};return _0x50c0c7;}})});}_0x2f9f46=_['merge']({},_0x2f9f46,_0x2f49a8[_0x49fe('0x3e')]);var _0x1677f4={'where':_0x2f9f46[_0x49fe('0x38')]};return db[_0x49fe('0x2b')]['count'](_0x1677f4)[_0x49fe('0x27')](function(_0x3eeb5b){_0x153769[_0x49fe('0x21')]=_0x3eeb5b;if(_0x2f49a8['query'][_0x49fe('0x3f')]){_0x2f9f46[_0x49fe('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x2f9f46);})['then'](function(_0x29512b){_0x153769[_0x49fe('0x41')]=_0x29512b;return _0x153769;})[_0x49fe('0x27')](respondWithFilteredResult(_0x29f836,_0x2f9f46))[_0x49fe('0x42')](handleError(_0x29f836,null));};exports[_0x49fe('0x43')]=function(_0x44236e,_0x18f84f){var _0x396227={'raw':![],'where':{'id':_0x44236e['params']['id']}},_0x2d3ebf={};_0x2d3ebf['model']=_['keys'](db[_0x49fe('0x2b')][_0x49fe('0x2c')]);_0x2d3ebf[_0x49fe('0x31')]=_[_0x49fe('0x44')](_0x44236e[_0x49fe('0x31')]);_0x2d3ebf[_0x49fe('0x39')]=_[_0x49fe('0x32')](_0x2d3ebf['model'],_0x2d3ebf[_0x49fe('0x31')]);_0x396227[_0x49fe('0x33')]=_[_0x49fe('0x32')](_0x2d3ebf['model'],qs[_0x49fe('0x34')](_0x44236e[_0x49fe('0x31')][_0x49fe('0x34')]));_0x396227[_0x49fe('0x33')]=_0x396227[_0x49fe('0x33')][_0x49fe('0x45')]?_0x396227['attributes']:_0x2d3ebf['model'];if(_0x44236e[_0x49fe('0x31')][_0x49fe('0x3f')]){_0x396227['include']=[{'all':!![]}];}_0x396227=_[_0x49fe('0x3b')]({},_0x396227,_0x44236e['options']);return db[_0x49fe('0x2b')][_0x49fe('0x46')](_0x396227)[_0x49fe('0x27')](handleEntityNotFound(_0x18f84f,null))[_0x49fe('0x27')](respondWithResult(_0x18f84f,null))['catch'](handleError(_0x18f84f,null));};exports[_0x49fe('0x47')]=function(_0x401455,_0x5a0f3a){return db['SugarcrmAccount'][_0x49fe('0x47')](_0x401455['body'],{})['then'](respondWithResult(_0x5a0f3a,0xc9))['catch'](handleError(_0x5a0f3a,null));};exports[_0x49fe('0x25')]=function(_0x56e11d,_0x2b5fa8){if(_0x56e11d[_0x49fe('0x48')]['id']){delete _0x56e11d[_0x49fe('0x48')]['id'];}return db['SugarcrmAccount'][_0x49fe('0x46')]({'where':{'id':_0x56e11d[_0x49fe('0x49')]['id']}})[_0x49fe('0x27')](handleEntityNotFound(_0x2b5fa8,null))[_0x49fe('0x27')](saveUpdates(_0x56e11d[_0x49fe('0x48')],null))[_0x49fe('0x27')](respondWithResult(_0x2b5fa8,null))[_0x49fe('0x42')](handleError(_0x2b5fa8,null));};exports[_0x49fe('0x26')]=function(_0x567a5a,_0x388e42){return db[_0x49fe('0x2b')]['find']({'where':{'id':_0x567a5a[_0x49fe('0x49')]['id']}})[_0x49fe('0x27')](handleEntityNotFound(_0x388e42,null))[_0x49fe('0x27')](removeEntity(_0x388e42,null))[_0x49fe('0x42')](handleError(_0x388e42,null));};exports[_0x49fe('0x4a')]=function(_0x539688,_0x46f562,_0xb92b1d){var _0xd7ba21={};var _0x321196={};var _0x477e5d;var _0x516f9f;return db[_0x49fe('0x2b')][_0x49fe('0x4b')]({'where':{'id':_0x539688['params']['id']}})[_0x49fe('0x27')](handleEntityNotFound(_0x46f562,null))[_0x49fe('0x27')](function(_0x50257c){if(_0x50257c){_0x477e5d=_0x50257c;_0x321196[_0x49fe('0x30')]=_[_0x49fe('0x44')](db[_0x49fe('0x4c')][_0x49fe('0x2c')]);_0x321196[_0x49fe('0x31')]=_[_0x49fe('0x44')](_0x539688[_0x49fe('0x31')]);_0x321196[_0x49fe('0x39')]=_[_0x49fe('0x32')](_0x321196[_0x49fe('0x30')],_0x321196['query']);_0xd7ba21[_0x49fe('0x33')]=_[_0x49fe('0x32')](_0x321196[_0x49fe('0x30')],qs['fields'](_0x539688[_0x49fe('0x31')][_0x49fe('0x34')]));_0xd7ba21[_0x49fe('0x33')]=_0xd7ba21[_0x49fe('0x33')][_0x49fe('0x45')]?_0xd7ba21[_0x49fe('0x33')]:_0x321196[_0x49fe('0x30')];_0xd7ba21[_0x49fe('0x36')]=qs[_0x49fe('0x37')](_0x539688[_0x49fe('0x31')][_0x49fe('0x37')]);_0xd7ba21[_0x49fe('0x38')]=qs[_0x49fe('0x39')](_[_0x49fe('0x3a')](_0x539688[_0x49fe('0x31')],_0x321196[_0x49fe('0x39')]));if(_0x539688[_0x49fe('0x31')][_0x49fe('0x3d')]){_0xd7ba21[_0x49fe('0x38')]=_[_0x49fe('0x3b')](_0xd7ba21[_0x49fe('0x38')],{'$or':_[_0x49fe('0x2a')](_0xd7ba21[_0x49fe('0x33')],function(_0x106a42){var _0x4494fb={};_0x4494fb[_0x106a42]={'$like':'%'+_0x539688[_0x49fe('0x31')][_0x49fe('0x3d')]+'%'};return _0x4494fb;})});}_0xd7ba21=_[_0x49fe('0x3b')]({},_0xd7ba21,_0x539688['options']);return _0x477e5d['getConfigurations'](_0xd7ba21);}})[_0x49fe('0x27')](function(_0x31ad02){if(_0x31ad02){_0x516f9f=_0x31ad02[_0x49fe('0x45')];if(!_0x539688[_0x49fe('0x31')][_0x49fe('0x4d')]('nolimit')){_0xd7ba21['limit']=qs[_0x49fe('0x1f')](_0x539688['query'][_0x49fe('0x1f')]);_0xd7ba21['offset']=qs['offset'](_0x539688[_0x49fe('0x31')][_0x49fe('0x20')]);}return _0x477e5d[_0x49fe('0x4a')](_0xd7ba21);}})['then'](function(_0x2b6da5){if(_0x2b6da5){return _0x2b6da5?{'count':_0x516f9f,'rows':_0x2b6da5}:null;}})['then'](respondWithResult(_0x46f562,null))[_0x49fe('0x42')](handleError(_0x46f562,null));};exports[_0x49fe('0x4e')]=function(_0x49e650,_0x46ba8b,_0x13d0f9){if(_0x49e650[_0x49fe('0x48')]['id']){delete _0x49e650[_0x49fe('0x48')]['id'];}return db[_0x49fe('0x2b')][_0x49fe('0x4b')]({'where':{'id':_0x49e650[_0x49fe('0x49')]['id']}})[_0x49fe('0x27')](handleEntityNotFound(_0x46ba8b,null))[_0x49fe('0x27')](function(_0x34786f){if(_0x34786f){_0x49e650[_0x49fe('0x48')]['AccountId']=_0x34786f['id'];_0x49e650['body']['Subjects']=integrations[_0x49fe('0x4f')](_0x49e650[_0x49fe('0x48')][_0x49fe('0x50')],_0x49e650[_0x49fe('0x48')][_0x49fe('0x2e')]);_0x49e650[_0x49fe('0x48')][_0x49fe('0x51')]=integrations[_0x49fe('0x52')](_0x49e650[_0x49fe('0x48')][_0x49fe('0x50')],_0x49e650[_0x49fe('0x48')][_0x49fe('0x2e')]);return db[_0x49fe('0x4c')]['create'](_0x49e650[_0x49fe('0x48')],{'include':[{'model':db[_0x49fe('0x53')],'as':_0x49fe('0x54')},{'model':db[_0x49fe('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x46ba8b,null))[_0x49fe('0x42')](handleError(_0x46ba8b,null));};exports[_0x49fe('0x55')]=function(_0x34de17,_0x5b1e8b,_0x4b7590){var _0x4258f3='';var _0x316fbd=['id',_0x49fe('0x29'),_0x49fe('0x56'),'created_by',_0x49fe('0x57'),_0x49fe('0x58'),_0x49fe('0x59'),_0x49fe('0x5a'),_0x49fe('0x5b'),_0x49fe('0x5c'),'parent_name','direction'];return db[_0x49fe('0x2b')][_0x49fe('0x4b')]({'where':{'id':_0x34de17['params']['id']},'attributes':['id',_0x49fe('0x5d'),_0x49fe('0x5e'),_0x49fe('0x5f')]})['then'](handleEntityNotFound(_0x5b1e8b,null))[_0x49fe('0x27')](function(_0xf3631d){if(_0xf3631d){_0x4258f3=_0xf3631d[_0x49fe('0x5f')];var _0x58b584=_0x4258f3['slice'](-0x1);if(_0x58b584==='/'){_0x4258f3=_0x4258f3[_0x49fe('0x60')](0x0,_0x4258f3[_0x49fe('0x61')](_0x58b584));}return rp({'method':_0x49fe('0x62'),'uri':util['format'](_0x49fe('0x63'),_0x4258f3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x49fe('0x64'),'response_type':_0x49fe('0x64'),'rest_data':JSON[_0x49fe('0x65')]({'user_auth':{'user_name':_0xf3631d[_0x49fe('0x5d')],'password':_0xf3631d['password'],'encryption':'PLAIN'},'application':_0x49fe('0x66')})}});}})[_0x49fe('0x27')](function(_0x511645){if(_0x511645&&_0x511645[_0x49fe('0x29')]!=='Invalid\x20Login'&&_0x511645[_0x49fe('0x29')]!==_0x49fe('0x67')){return rp({'method':_0x49fe('0x62'),'uri':util[_0x49fe('0x68')](_0x49fe('0x63'),_0x4258f3,_0x49fe('0x69')),'json':!![],'form':{'method':_0x49fe('0x6a'),'input_type':_0x49fe('0x64'),'response_type':_0x49fe('0x64'),'rest_data':JSON[_0x49fe('0x65')]({'session':_0x511645['id'],'module_name':_0x49fe('0x6b')})}})[_0x49fe('0x27')](function(_0x2634bd){if(_0x2634bd){var _0x3d6c96=_[_0x49fe('0x6c')](_0x2634bd[_0x49fe('0x6d')]);_[_0x49fe('0x6e')](_0x3d6c96,function(_0x5d9e15){return _0x316fbd[_0x49fe('0x6f')](_0x5d9e15[_0x49fe('0x29')]);});return{'count':_0x3d6c96[_0x49fe('0x45')],'rows':_['map'](_0x3d6c96,function(_0x3ced5e){return{'id':_0x3ced5e[_0x49fe('0x29')],'name':_0x3ced5e[_0x49fe('0x70')],'custom':_[_0x49fe('0x71')](_0x3ced5e[_0x49fe('0x29')],'_c')?!![]:![],'options':_0x3ced5e['options']?_['map'](_['values'](_0x3ced5e[_0x49fe('0x3e')]),function(_0xe5c069){return{'name':_0xe5c069[_0x49fe('0x72')],'value':_0xe5c069[_0x49fe('0x29')]};}):[]};})};}})[_0x49fe('0x27')](respondWithResult(_0x5b1e8b,null))[_0x49fe('0x42')](function(_0x49a157){var _0x3932d3=_0x34de17['query'][_0x49fe('0x73')]?0x1f4:_0x49a157[_0x49fe('0x74')]||0x1f4;logger[_0x49fe('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x49fe('0x55'),_0x3932d3,JSON[_0x49fe('0x65')](_0x49a157));delete _0x49a157[_0x49fe('0x29')];if(_0x3932d3===0x191){_0x3932d3=0x190;}_0x5b1e8b['status'](_0x3932d3)['send'](_0x34de17[_0x49fe('0x31')][_0x49fe('0x73')]?{'message':_0x49fe('0x75'),'statusCode':_0x49a157[_0x49fe('0x74')]}:_0x49a157);});}else{var _0x3632d7=0x1f4;_0x5b1e8b['status'](_0x3632d7)[_0x49fe('0x76')]({'message':_0x49fe('0x75'),'statusCode':0x190});}});};
\ No newline at end of file
index 35ae080..5c8bf4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x204c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','int_sugarcrm_accounts','lodash','util','../../config/logger','api'];(function(_0x1ab855,_0x448b59){var _0x46c4ae=function(_0x1a401d){while(--_0x1a401d){_0x1ab855['push'](_0x1ab855['shift']());}};_0x46c4ae(++_0x448b59);}(_0x204c,0xdc));var _0xc204=function(_0x220f3b,_0x34332d){_0x220f3b=_0x220f3b-0x0;var _0x752fb7=_0x204c[_0x220f3b];return _0x752fb7;};'use strict';var _=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var logger=require(_0xc204('0x2'))(_0xc204('0x3'));var moment=require(_0xc204('0x4'));var BPromise=require(_0xc204('0x5'));var rp=require(_0xc204('0x6'));var fs=require('fs');var path=require(_0xc204('0x7'));var rimraf=require(_0xc204('0x8'));var config=require(_0xc204('0x9'));var attributes=require(_0xc204('0xa'));var integrations=require(_0xc204('0xb'));module['exports']=function(_0x33557b,_0x34768a){return _0x33557b[_0xc204('0xc')]('SugarcrmAccount',attributes,{'tableName':_0xc204('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d14=['SugarcrmAccount','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x25a9ed,_0x47f613){var _0x424f3c=function(_0x1b6106){while(--_0x1b6106){_0x25a9ed['push'](_0x25a9ed['shift']());}};_0x424f3c(++_0x47f613);}(_0x7d14,0x6d));var _0x47d1=function(_0x13b1dc,_0x12010f){_0x13b1dc=_0x13b1dc-0x0;var _0x90e83f=_0x7d14[_0x13b1dc];return _0x90e83f;};'use strict';var _=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var logger=require('../../config/logger')(_0x47d1('0x2'));var moment=require(_0x47d1('0x3'));var BPromise=require(_0x47d1('0x4'));var rp=require(_0x47d1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47d1('0x6'));var config=require(_0x47d1('0x7'));var attributes=require(_0x47d1('0x8'));var integrations=require(_0x47d1('0x9'));module[_0x47d1('0xa')]=function(_0x550ee2,_0x533402){return _0x550ee2['define'](_0x47d1('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 39d94c3..e1fa463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6540=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','include','model','map','stringify','catch','ShowSugarcrmAccount','find','where','lodash','moment','bluebird'];(function(_0x5958ae,_0x3f78c9){var _0x3aab8f=function(_0x142bc9){while(--_0x142bc9){_0x5958ae['push'](_0x5958ae['shift']());}};_0x3aab8f(++_0x3f78c9);}(_0x6540,0xa7));var _0x0654=function(_0x53abd0,_0x1f7900){_0x53abd0=_0x53abd0-0x0;var _0x5a0dcd=_0x6540[_0x53abd0];return _0x5a0dcd;};'use strict';var _=require(_0x0654('0x0'));var util=require('util');var moment=require(_0x0654('0x1'));var BPromise=require(_0x0654('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0654('0x3'));var db=require(_0x0654('0x4'))['db'];var utils=require(_0x0654('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0654('0x6'));var jayson=require(_0x0654('0x7'));var client=jayson[_0x0654('0x8')][_0x0654('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4068ac,_0x522723,_0x3b072c){return new BPromise(function(_0xf0c3f6,_0x4a65f3){return client[_0x0654('0xa')](_0x4068ac,_0x3b072c)[_0x0654('0xb')](function(_0x50ccc9){logger[_0x0654('0xc')](_0x0654('0xd'),_0x522723,_0x0654('0xe'));logger[_0x0654('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x522723,'request\x20sent',JSON['stringify'](_0x50ccc9));if(_0x50ccc9[_0x0654('0x10')]){if(_0x50ccc9['error'][_0x0654('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x522723,_0x50ccc9[_0x0654('0x10')][_0x0654('0x12')]);return _0x4a65f3(_0x50ccc9[_0x0654('0x10')]['message']);}logger[_0x0654('0x10')](_0x0654('0xd'),_0x522723,_0x50ccc9[_0x0654('0x10')][_0x0654('0x12')]);return _0xf0c3f6(_0x50ccc9[_0x0654('0x10')]['message']);}else{logger[_0x0654('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x522723,_0x0654('0xe'));_0xf0c3f6(_0x50ccc9[_0x0654('0x13')][_0x0654('0x12')]);}})['catch'](function(_0x4165a4){logger['error'](_0x0654('0xd'),_0x522723,_0x4165a4);_0x4a65f3(_0x4165a4);});});}exports[_0x0654('0x14')]=function(_0x4a26bd){var _0x329d6b=this;return new Promise(function(_0x51f60f,_0x5041d6){return db[_0x0654('0x15')][_0x0654('0x16')]({'raw':_0x4a26bd['options']?_0x4a26bd[_0x0654('0x17')][_0x0654('0x18')]===undefined?!![]:![]:!![],'where':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')]['where']||null:null,'attributes':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')][_0x0654('0x19')]||null:null,'limit':_0x4a26bd[_0x0654('0x17')]?_0x4a26bd[_0x0654('0x17')]['limit']||null:null,'include':_0x4a26bd['options']?_0x4a26bd[_0x0654('0x17')][_0x0654('0x1a')]?_['map'](_0x4a26bd[_0x0654('0x17')][_0x0654('0x1a')],function(_0x7c0ab0){return{'model':db[_0x7c0ab0[_0x0654('0x1b')]],'as':_0x7c0ab0['as'],'attributes':_0x7c0ab0[_0x0654('0x19')],'include':_0x7c0ab0['include']?_[_0x0654('0x1c')](_0x7c0ab0[_0x0654('0x1a')],function(_0x40057e){return{'model':db[_0x40057e[_0x0654('0x1b')]],'as':_0x40057e['as'],'attributes':_0x40057e[_0x0654('0x19')],'include':_0x40057e[_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x40057e['include'],function(_0x3e8bf3){return{'model':db[_0x3e8bf3[_0x0654('0x1b')]],'as':_0x3e8bf3['as'],'attributes':_0x3e8bf3[_0x0654('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0654('0xb')](function(_0x41bde4){logger[_0x0654('0xc')](_0x0654('0x14'),_0x4a26bd);logger[_0x0654('0xf')](_0x0654('0x14'),_0x4a26bd,JSON[_0x0654('0x1d')](_0x41bde4));_0x51f60f(_0x41bde4);})[_0x0654('0x1e')](function(_0x5f0884){logger['error'](_0x0654('0x14'),_0x5f0884['message'],_0x4a26bd);_0x5041d6(_0x329d6b[_0x0654('0x10')](0x1f4,_0x5f0884[_0x0654('0x12')]));});});};exports[_0x0654('0x1f')]=function(_0x200661){var _0x54bf6a=this;return new Promise(function(_0x12da7e,_0x2723d9){return db[_0x0654('0x15')][_0x0654('0x20')]({'raw':_0x200661[_0x0654('0x17')]?_0x200661['options'][_0x0654('0x18')]===undefined?!![]:![]:!![],'where':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x21')]||null:null,'attributes':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x19')]||null:null,'include':_0x200661[_0x0654('0x17')]?_0x200661[_0x0654('0x17')][_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x200661[_0x0654('0x17')][_0x0654('0x1a')],function(_0x490520){return{'model':db[_0x490520[_0x0654('0x1b')]],'as':_0x490520['as'],'attributes':_0x490520['attributes'],'include':_0x490520[_0x0654('0x1a')]?_[_0x0654('0x1c')](_0x490520[_0x0654('0x1a')],function(_0x54086e){return{'model':db[_0x54086e[_0x0654('0x1b')]],'as':_0x54086e['as'],'attributes':_0x54086e['attributes'],'include':_0x54086e['include']?_['map'](_0x54086e[_0x0654('0x1a')],function(_0x5c0ce5){return{'model':db[_0x5c0ce5[_0x0654('0x1b')]],'as':_0x5c0ce5['as'],'attributes':_0x5c0ce5['attributes']};}):[]};}):[]};}):[]:[]})[_0x0654('0xb')](function(_0x1fcb53){logger[_0x0654('0xc')]('ShowSugarcrmAccount',_0x200661);logger[_0x0654('0xf')](_0x0654('0x1f'),_0x200661,JSON[_0x0654('0x1d')](_0x1fcb53));_0x12da7e(_0x1fcb53);})[_0x0654('0x1e')](function(_0x35b52a){logger[_0x0654('0x10')](_0x0654('0x1f'),_0x35b52a[_0x0654('0x12')],_0x200661);_0x2723d9(_0x54bf6a['error'](0x1f4,_0x35b52a[_0x0654('0x12')]));});});};
\ No newline at end of file
+var _0x0bab=['ShowSugarcrmAccount','find','raw','model','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes','limit','include','map','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0bab,0xd0));var _0xb0ba=function(_0x7b9230,_0x2b1da5){_0x7b9230=_0x7b9230-0x0;var _0x338e13=_0x0bab[_0x7b9230];return _0x338e13;};'use strict';var _=require(_0xb0ba('0x0'));var util=require(_0xb0ba('0x1'));var moment=require(_0xb0ba('0x2'));var BPromise=require(_0xb0ba('0x3'));var rs=require(_0xb0ba('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb0ba('0x5'))('rpc');var config=require(_0xb0ba('0x6'));var jayson=require(_0xb0ba('0x7'));var client=jayson[_0xb0ba('0x8')][_0xb0ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ba689,_0x1ed83f,_0x5b5bdf){return new BPromise(function(_0x133cff,_0x31f490){return client[_0xb0ba('0xa')](_0x1ba689,_0x5b5bdf)[_0xb0ba('0xb')](function(_0x1be836){logger[_0xb0ba('0xc')](_0xb0ba('0xd'),_0x1ed83f,_0xb0ba('0xe'));logger[_0xb0ba('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1ed83f,'request\x20sent',JSON[_0xb0ba('0x10')](_0x1be836));if(_0x1be836[_0xb0ba('0x11')]){if(_0x1be836[_0xb0ba('0x11')][_0xb0ba('0x12')]===0x1f4){logger[_0xb0ba('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ed83f,_0x1be836[_0xb0ba('0x11')][_0xb0ba('0x13')]);return _0x31f490(_0x1be836[_0xb0ba('0x11')][_0xb0ba('0x13')]);}logger['error'](_0xb0ba('0xd'),_0x1ed83f,_0x1be836[_0xb0ba('0x11')][_0xb0ba('0x13')]);return _0x133cff(_0x1be836[_0xb0ba('0x11')]['message']);}else{logger['info'](_0xb0ba('0xd'),_0x1ed83f,_0xb0ba('0xe'));_0x133cff(_0x1be836[_0xb0ba('0x14')]['message']);}})['catch'](function(_0x357914){logger[_0xb0ba('0x11')](_0xb0ba('0xd'),_0x1ed83f,_0x357914);_0x31f490(_0x357914);});});}exports[_0xb0ba('0x15')]=function(_0x56f226){var _0x2e2eb4=this;return new Promise(function(_0x22ff27,_0x19bc6f){return db[_0xb0ba('0x16')]['findAll']({'raw':_0x56f226[_0xb0ba('0x17')]?_0x56f226['options']['raw']===undefined?!![]:![]:!![],'where':_0x56f226[_0xb0ba('0x17')]?_0x56f226['options'][_0xb0ba('0x18')]||null:null,'attributes':_0x56f226['options']?_0x56f226['options'][_0xb0ba('0x19')]||null:null,'limit':_0x56f226[_0xb0ba('0x17')]?_0x56f226[_0xb0ba('0x17')][_0xb0ba('0x1a')]||null:null,'include':_0x56f226[_0xb0ba('0x17')]?_0x56f226[_0xb0ba('0x17')][_0xb0ba('0x1b')]?_[_0xb0ba('0x1c')](_0x56f226['options']['include'],function(_0xa29558){return{'model':db[_0xa29558['model']],'as':_0xa29558['as'],'attributes':_0xa29558['attributes'],'include':_0xa29558[_0xb0ba('0x1b')]?_['map'](_0xa29558[_0xb0ba('0x1b')],function(_0x2a31fc){return{'model':db[_0x2a31fc['model']],'as':_0x2a31fc['as'],'attributes':_0x2a31fc['attributes'],'include':_0x2a31fc[_0xb0ba('0x1b')]?_[_0xb0ba('0x1c')](_0x2a31fc[_0xb0ba('0x1b')],function(_0x57389e){return{'model':db[_0x57389e['model']],'as':_0x57389e['as'],'attributes':_0x57389e[_0xb0ba('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb0ba('0xb')](function(_0x38ef4d){logger[_0xb0ba('0xc')](_0xb0ba('0x15'),_0x56f226);logger['debug'](_0xb0ba('0x15'),_0x56f226,JSON[_0xb0ba('0x10')](_0x38ef4d));_0x22ff27(_0x38ef4d);})[_0xb0ba('0x1d')](function(_0x59bc95){logger[_0xb0ba('0x11')](_0xb0ba('0x15'),_0x59bc95['message'],_0x56f226);_0x19bc6f(_0x2e2eb4[_0xb0ba('0x11')](0x1f4,_0x59bc95[_0xb0ba('0x13')]));});});};exports[_0xb0ba('0x1e')]=function(_0x30c955){var _0x2f5262=this;return new Promise(function(_0xc3ede,_0x16a11e){return db[_0xb0ba('0x16')][_0xb0ba('0x1f')]({'raw':_0x30c955[_0xb0ba('0x17')]?_0x30c955['options'][_0xb0ba('0x20')]===undefined?!![]:![]:!![],'where':_0x30c955[_0xb0ba('0x17')]?_0x30c955['options'][_0xb0ba('0x18')]||null:null,'attributes':_0x30c955[_0xb0ba('0x17')]?_0x30c955['options'][_0xb0ba('0x19')]||null:null,'include':_0x30c955[_0xb0ba('0x17')]?_0x30c955[_0xb0ba('0x17')][_0xb0ba('0x1b')]?_[_0xb0ba('0x1c')](_0x30c955[_0xb0ba('0x17')][_0xb0ba('0x1b')],function(_0x1c49e2){return{'model':db[_0x1c49e2[_0xb0ba('0x21')]],'as':_0x1c49e2['as'],'attributes':_0x1c49e2[_0xb0ba('0x19')],'include':_0x1c49e2[_0xb0ba('0x1b')]?_['map'](_0x1c49e2[_0xb0ba('0x1b')],function(_0x26dfbb){return{'model':db[_0x26dfbb[_0xb0ba('0x21')]],'as':_0x26dfbb['as'],'attributes':_0x26dfbb[_0xb0ba('0x19')],'include':_0x26dfbb[_0xb0ba('0x1b')]?_[_0xb0ba('0x1c')](_0x26dfbb['include'],function(_0x44c434){return{'model':db[_0x44c434[_0xb0ba('0x21')]],'as':_0x44c434['as'],'attributes':_0x44c434[_0xb0ba('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb0ba('0xb')](function(_0x4f3c0b){logger['info']('ShowSugarcrmAccount',_0x30c955);logger[_0xb0ba('0xf')](_0xb0ba('0x1e'),_0x30c955,JSON[_0xb0ba('0x10')](_0x4f3c0b));_0xc3ede(_0x4f3c0b);})['catch'](function(_0x6c31e3){logger[_0xb0ba('0x11')](_0xb0ba('0x1e'),_0x6c31e3[_0xb0ba('0x13')],_0x30c955);_0x16a11e(_0x2f5262[_0xb0ba('0x11')](0x1f4,_0x6c31e3['message']));});});};
\ No newline at end of file
index 114e66a..8d5e060 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd72=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put'];(function(_0x352085,_0x1d0f79){var _0x7d4859=function(_0x17dda9){while(--_0x17dda9){_0x352085['push'](_0x352085['shift']());}};_0x7d4859(++_0x1d0f79);}(_0xbd72,0xa9));var _0x2bd7=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xbd72[_0x4fd109];return _0x30f0a6;};'use strict';var multer=require(_0x2bd7('0x0'));var util=require(_0x2bd7('0x1'));var path=require(_0x2bd7('0x2'));var timeout=require(_0x2bd7('0x3'));var express=require(_0x2bd7('0x4'));var router=express[_0x2bd7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2bd7('0x6'));var interaction=require(_0x2bd7('0x7'));var config=require('../../config/environment');var controller=require(_0x2bd7('0x8'));router['get']('/',auth[_0x2bd7('0x9')](),controller[_0x2bd7('0xa')]);router[_0x2bd7('0xb')](_0x2bd7('0xc'),auth[_0x2bd7('0x9')](),controller['show']);router[_0x2bd7('0xb')](_0x2bd7('0xd'),auth[_0x2bd7('0x9')](),controller[_0x2bd7('0xe')]);router[_0x2bd7('0xb')](_0x2bd7('0xf'),auth['isAuthenticated'](),controller[_0x2bd7('0x10')]);router[_0x2bd7('0xb')](_0x2bd7('0x11'),auth[_0x2bd7('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x2bd7('0x12')]);router[_0x2bd7('0x13')](_0x2bd7('0xc'),auth[_0x2bd7('0x9')](),controller['update']);router['delete']('/:id',auth[_0x2bd7('0x9')](),controller['destroy']);module[_0x2bd7('0x14')]=router;
\ No newline at end of file
+var _0x2b02=['../../config/environment','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b2e3f,_0x42141d){var _0x579b5e=function(_0x192751){while(--_0x192751){_0x5b2e3f['push'](_0x5b2e3f['shift']());}};_0x579b5e(++_0x42141d);}(_0x2b02,0xe8));var _0x22b0=function(_0x53f4e6,_0x140ecc){_0x53f4e6=_0x53f4e6-0x0;var _0x2a1f99=_0x2b02[_0x53f4e6];return _0x2a1f99;};'use strict';var multer=require(_0x22b0('0x0'));var util=require(_0x22b0('0x1'));var path=require(_0x22b0('0x2'));var timeout=require('connect-timeout');var express=require(_0x22b0('0x3'));var router=express[_0x22b0('0x4')]();var fs_extra=require(_0x22b0('0x5'));var auth=require(_0x22b0('0x6'));var interaction=require(_0x22b0('0x7'));var config=require(_0x22b0('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x22b0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x22b0('0xa'),auth[_0x22b0('0xb')](),controller[_0x22b0('0xc')]);router[_0x22b0('0x9')](_0x22b0('0xd'),auth[_0x22b0('0xb')](),controller[_0x22b0('0xe')]);router['get'](_0x22b0('0xf'),auth[_0x22b0('0xb')](),controller[_0x22b0('0x10')]);router[_0x22b0('0x9')](_0x22b0('0x11'),auth['isAuthenticated'](),controller[_0x22b0('0x12')]);router[_0x22b0('0x13')]('/',auth[_0x22b0('0xb')](),controller[_0x22b0('0x14')]);router[_0x22b0('0x15')](_0x22b0('0xa'),auth[_0x22b0('0xb')](),controller[_0x22b0('0x16')]);router['delete'](_0x22b0('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x22b0('0x17')]=router;
\ No newline at end of file
index d92976a..e2940a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf895=['exports','STRING'];(function(_0x2706da,_0x3856f5){var _0x3ba87e=function(_0x479a79){while(--_0x479a79){_0x2706da['push'](_0x2706da['shift']());}};_0x3ba87e(++_0x3856f5);}(_0xf895,0x1da));var _0x5f89=function(_0x49415b,_0x490392){_0x49415b=_0x49415b-0x0;var _0x3211b1=_0xf895[_0x49415b];return _0x3211b1;};'use strict';var Sequelize=require('sequelize');module[_0x5f89('0x0')]={'name':{'type':Sequelize[_0x5f89('0x1')]},'description':{'type':Sequelize[_0x5f89('0x1')]}};
\ No newline at end of file
+var _0x97bb=['STRING','sequelize','exports'];(function(_0x4d0621,_0x3c91db){var _0x53282f=function(_0x54a3d4){while(--_0x54a3d4){_0x4d0621['push'](_0x4d0621['shift']());}};_0x53282f(++_0x3c91db);}(_0x97bb,0x1e4));var _0xb97b=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x97bb[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0xb97b('0x0'));module[_0xb97b('0x1')]={'name':{'type':Sequelize[_0xb97b('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4ba1ba2..ab3eb85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dcc=['ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','show','params','include','find','catch','body','getFields','findOne','getSubjects','getDescriptions','SugarcrmField','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6dcc,0x1dd));var _0xc6dc=function(_0x57c972,_0x510be5){_0x57c972=_0x57c972-0x0;var _0x2c5861=_0x6dcc[_0x57c972];return _0x2c5861;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6dc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6dc('0x1'));var rp=require(_0xc6dc('0x2'));var moment=require(_0xc6dc('0x3'));var BPromise=require(_0xc6dc('0x4'));var Mustache=require(_0xc6dc('0x5'));var util=require(_0xc6dc('0x6'));var path=require(_0xc6dc('0x7'));var sox=require(_0xc6dc('0x8'));var csv=require('to-csv');var ejs=require(_0xc6dc('0x9'));var fs=require('fs');var fs_extra=require(_0xc6dc('0xa'));var _=require('lodash');var squel=require(_0xc6dc('0xb'));var crypto=require(_0xc6dc('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc6dc('0xd'));var toCsv=require(_0xc6dc('0xe'));var querystring=require(_0xc6dc('0xf'));var Papa=require(_0xc6dc('0x10'));var Redis=require(_0xc6dc('0x11'));var authService=require(_0xc6dc('0x12'));var qs=require(_0xc6dc('0x13'));var as=require(_0xc6dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6dc('0x15'))(_0xc6dc('0x16'));var utils=require('../../config/utils');var config=require(_0xc6dc('0x17'));var licenseUtil=require(_0xc6dc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x135048,_0x52f07c){_0x52f07c=_0x52f07c||0xcc;return function(_0x27f859){if(_0x27f859){return _0x135048[_0xc6dc('0x19')](_0x52f07c);}return _0x135048[_0xc6dc('0x1a')](_0x52f07c)[_0xc6dc('0x1b')]();};}function respondWithResult(_0x2c769c,_0x228d8a){_0x228d8a=_0x228d8a||0xc8;return function(_0x13620d){if(_0x13620d){return _0x2c769c['status'](_0x228d8a)[_0xc6dc('0x1c')](_0x13620d);}};}function respondWithFilteredResult(_0x2383fc,_0x372bef){return function(_0x1c1ff6){if(_0x1c1ff6){var _0x1567b4=typeof _0x372bef[_0xc6dc('0x1d')]==='undefined'&&typeof _0x372bef['limit']==='undefined';var _0x1216d5=_0x1c1ff6[_0xc6dc('0x1e')];var _0x2e6232=_0x1567b4?0x0:_0x372bef[_0xc6dc('0x1d')];var _0x485fcd=_0x1567b4?_0x1c1ff6[_0xc6dc('0x1e')]:_0x372bef[_0xc6dc('0x1d')]+_0x372bef['limit'];var _0x592081;if(_0x485fcd>=_0x1216d5){_0x485fcd=_0x1216d5;_0x592081=0xc8;}else{_0x592081=0xce;}_0x2383fc[_0xc6dc('0x1a')](_0x592081);return _0x2383fc[_0xc6dc('0x1f')](_0xc6dc('0x20'),_0x2e6232+'-'+_0x485fcd+'/'+_0x1216d5)[_0xc6dc('0x1c')](_0x1c1ff6);}return null;};}function patchUpdates(_0x5cd769){return function(_0x48bb81){try{jsonpatch['apply'](_0x48bb81,_0x5cd769,!![]);}catch(_0x3fc6df){return BPromise['reject'](_0x3fc6df);}return _0x48bb81[_0xc6dc('0x21')]();};}function saveUpdates(_0x2dd6ea,_0x2a3463){return function(_0x23dbb3){if(_0x23dbb3){return _0x23dbb3[_0xc6dc('0x22')](_0x2dd6ea)[_0xc6dc('0x23')](function(_0x468f5c){return _0x468f5c;});}return null;};}function removeEntity(_0x52b529,_0x7c8546){return function(_0x5cb612){if(_0x5cb612){return _0x5cb612[_0xc6dc('0x24')]()['then'](function(){_0x52b529[_0xc6dc('0x1a')](0xcc)[_0xc6dc('0x1b')]();});}};}function handleEntityNotFound(_0x3464aa,_0x5d6e42){return function(_0x5b7e5b){if(!_0x5b7e5b){_0x3464aa['sendStatus'](0x194);}return _0x5b7e5b;};}function handleError(_0x13adad,_0x2b9e45){_0x2b9e45=_0x2b9e45||0x1f4;return function(_0x43251b){logger[_0xc6dc('0x25')](_0x43251b[_0xc6dc('0x26')]);if(_0x43251b[_0xc6dc('0x27')]){delete _0x43251b[_0xc6dc('0x27')];}_0x13adad[_0xc6dc('0x1a')](_0x2b9e45)[_0xc6dc('0x28')](_0x43251b);};}exports[_0xc6dc('0x29')]=function(_0x21e403,_0x17f334){var _0x11aeb8={},_0x4d75b3={},_0x23de14={'count':0x0,'rows':[]};var _0x59a42b=_[_0xc6dc('0x2a')](db['SugarcrmConfiguration'][_0xc6dc('0x2b')],function(_0x4029ed){return{'name':_0x4029ed[_0xc6dc('0x2c')],'type':_0x4029ed[_0xc6dc('0x2d')][_0xc6dc('0x2e')]};});_0x4d75b3[_0xc6dc('0x2f')]=_[_0xc6dc('0x2a')](_0x59a42b,_0xc6dc('0x27'));_0x4d75b3[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x21e403[_0xc6dc('0x30')]);_0x4d75b3[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x4d75b3['model'],_0x4d75b3[_0xc6dc('0x30')]);_0x11aeb8['attributes']=_['intersection'](_0x4d75b3[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x21e403[_0xc6dc('0x30')]['fields']));_0x11aeb8[_0xc6dc('0x35')]=_0x11aeb8[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x11aeb8[_0xc6dc('0x35')]:_0x4d75b3[_0xc6dc('0x2f')];if(!_0x21e403['query'][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x11aeb8[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x21e403['query']['limit']);_0x11aeb8[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}_0x11aeb8[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x11aeb8['where']=qs[_0xc6dc('0x32')](_[_0xc6dc('0x3c')](_0x21e403['query'],_0x4d75b3['filters']),_0x59a42b);if(_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x3d')]){_0x11aeb8[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x11aeb8['where'],{'$or':_[_0xc6dc('0x2a')](_0x59a42b,function(_0x5d33bb){if(_0x5d33bb[_0xc6dc('0x2d')]!==_0xc6dc('0x40')){var _0x52c062={};_0x52c062[_0x5d33bb[_0xc6dc('0x27')]]={'$like':'%'+_0x21e403['query'][_0xc6dc('0x3d')]+'%'};return _0x52c062;}})});}_0x11aeb8=_[_0xc6dc('0x3f')]({},_0x11aeb8,_0x21e403[_0xc6dc('0x41')]);var _0x2c7d04={'where':_0x11aeb8[_0xc6dc('0x3e')]};return db[_0xc6dc('0x42')][_0xc6dc('0x1e')](_0x2c7d04)[_0xc6dc('0x23')](function(_0x320cdd){_0x23de14[_0xc6dc('0x1e')]=_0x320cdd;if(_0x21e403[_0xc6dc('0x30')][_0xc6dc('0x43')]){_0x11aeb8['include']=[{'all':!![]}];}return db[_0xc6dc('0x42')][_0xc6dc('0x44')](_0x11aeb8);})['then'](function(_0x1eff9d){_0x23de14[_0xc6dc('0x45')]=_0x1eff9d;return _0x23de14;})['then'](respondWithFilteredResult(_0x17f334,_0x11aeb8))['catch'](handleError(_0x17f334,null));};exports[_0xc6dc('0x46')]=function(_0x31ecd3,_0x530226){var _0x4ca247={'raw':![],'where':{'id':_0x31ecd3[_0xc6dc('0x47')]['id']}},_0x478d5c={};_0x478d5c['model']=_[_0xc6dc('0x31')](db[_0xc6dc('0x42')][_0xc6dc('0x2b')]);_0x478d5c[_0xc6dc('0x30')]=_['keys'](_0x31ecd3['query']);_0x478d5c['filters']=_[_0xc6dc('0x33')](_0x478d5c[_0xc6dc('0x2f')],_0x478d5c['query']);_0x4ca247['attributes']=_['intersection'](_0x478d5c[_0xc6dc('0x2f')],qs['fields'](_0x31ecd3[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x4ca247[_0xc6dc('0x35')]=_0x4ca247[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x4ca247[_0xc6dc('0x35')]:_0x478d5c[_0xc6dc('0x2f')];if(_0x31ecd3[_0xc6dc('0x30')][_0xc6dc('0x43')]){_0x4ca247[_0xc6dc('0x48')]=[{'all':!![]}];}_0x4ca247=_[_0xc6dc('0x3f')]({},_0x4ca247,_0x31ecd3[_0xc6dc('0x41')]);return db[_0xc6dc('0x42')][_0xc6dc('0x49')](_0x4ca247)[_0xc6dc('0x23')](handleEntityNotFound(_0x530226,null))[_0xc6dc('0x23')](respondWithResult(_0x530226,null))[_0xc6dc('0x4a')](handleError(_0x530226,null));};exports['create']=function(_0x4a6041,_0x59c954){return db[_0xc6dc('0x42')]['create'](_0x4a6041[_0xc6dc('0x4b')],{})[_0xc6dc('0x23')](respondWithResult(_0x59c954,0xc9))[_0xc6dc('0x4a')](handleError(_0x59c954,null));};exports['update']=function(_0x9d4b0b,_0x67672e){if(_0x9d4b0b[_0xc6dc('0x4b')]['id']){delete _0x9d4b0b['body']['id'];}return db[_0xc6dc('0x42')][_0xc6dc('0x49')]({'where':{'id':_0x9d4b0b[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x67672e,null))[_0xc6dc('0x23')](saveUpdates(_0x9d4b0b[_0xc6dc('0x4b')],null))['then'](respondWithResult(_0x67672e,null))[_0xc6dc('0x4a')](handleError(_0x67672e,null));};exports[_0xc6dc('0x24')]=function(_0x1f902b,_0x34c545){return db['SugarcrmConfiguration'][_0xc6dc('0x49')]({'where':{'id':_0x1f902b[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x34c545,null))['then'](removeEntity(_0x34c545,null))[_0xc6dc('0x4a')](handleError(_0x34c545,null));};exports[_0xc6dc('0x4c')]=function(_0x55bfcc,_0x28d2ba,_0x1351fd){var _0x472634={};var _0x5114ec={};var _0x5386e5;var _0x527132;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x55bfcc[_0xc6dc('0x47')]['id']}})['then'](handleEntityNotFound(_0x28d2ba,null))[_0xc6dc('0x23')](function(_0x447b97){if(_0x447b97){_0x5386e5=_0x447b97;_0x5114ec[_0xc6dc('0x2f')]=_[_0xc6dc('0x31')](db['SugarcrmField']['rawAttributes']);_0x5114ec[_0xc6dc('0x30')]=_['keys'](_0x55bfcc[_0xc6dc('0x30')]);_0x5114ec[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x5114ec[_0xc6dc('0x2f')],_0x5114ec[_0xc6dc('0x30')]);_0x472634[_0xc6dc('0x35')]=_[_0xc6dc('0x33')](_0x5114ec[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x55bfcc['query'][_0xc6dc('0x34')]));_0x472634['attributes']=_0x472634[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x472634[_0xc6dc('0x35')]:_0x5114ec['model'];_0x472634['order']=qs[_0xc6dc('0x3b')](_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x472634[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_[_0xc6dc('0x3c')](_0x55bfcc[_0xc6dc('0x30')],_0x5114ec[_0xc6dc('0x32')]));if(_0x55bfcc['query']['filter']){_0x472634[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x472634['where'],{'$or':_[_0xc6dc('0x2a')](_0x472634['attributes'],function(_0x53f10c){var _0x56100b={};_0x56100b[_0x53f10c]={'$like':'%'+_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x3d')]+'%'};return _0x56100b;})});}_0x472634=_['merge']({},_0x472634,_0x55bfcc[_0xc6dc('0x41')]);return _0x5386e5['getFields'](_0x472634);}})[_0xc6dc('0x23')](function(_0x249288){if(_0x249288){_0x527132=_0x249288[_0xc6dc('0x36')];if(!_0x55bfcc[_0xc6dc('0x30')]['hasOwnProperty'](_0xc6dc('0x38'))){_0x472634[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x55bfcc[_0xc6dc('0x30')]['limit']);_0x472634['offset']=qs[_0xc6dc('0x1d')](_0x55bfcc[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x5386e5[_0xc6dc('0x4c')](_0x472634);}})[_0xc6dc('0x23')](function(_0x1b24d4){if(_0x1b24d4){return _0x1b24d4?{'count':_0x527132,'rows':_0x1b24d4}:null;}})[_0xc6dc('0x23')](respondWithResult(_0x28d2ba,null))['catch'](handleError(_0x28d2ba,null));};exports[_0xc6dc('0x4e')]=function(_0x36e04a,_0x45596e,_0xd4ff7){var _0x52e139={};var _0x587833={};var _0x11563c;var _0x41f419;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x36e04a[_0xc6dc('0x47')]['id']}})[_0xc6dc('0x23')](handleEntityNotFound(_0x45596e,null))[_0xc6dc('0x23')](function(_0x51a9cb){if(_0x51a9cb){_0x11563c=_0x51a9cb;_0x587833['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x587833[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x36e04a[_0xc6dc('0x30')]);_0x587833[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x587833['model'],_0x587833['query']);_0x52e139[_0xc6dc('0x35')]=_[_0xc6dc('0x33')](_0x587833['model'],qs['fields'](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x52e139[_0xc6dc('0x35')]=_0x52e139['attributes']['length']?_0x52e139[_0xc6dc('0x35')]:_0x587833['model'];_0x52e139['order']=qs['sort'](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x52e139[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_['pick'](_0x36e04a[_0xc6dc('0x30')],_0x587833[_0xc6dc('0x32')]));if(_0x36e04a['query'][_0xc6dc('0x3d')]){_0x52e139[_0xc6dc('0x3e')]=_[_0xc6dc('0x3f')](_0x52e139[_0xc6dc('0x3e')],{'$or':_['map'](_0x52e139[_0xc6dc('0x35')],function(_0x43052d){var _0x6be5c7={};_0x6be5c7[_0x43052d]={'$like':'%'+_0x36e04a[_0xc6dc('0x30')]['filter']+'%'};return _0x6be5c7;})});}_0x52e139=_[_0xc6dc('0x3f')]({},_0x52e139,_0x36e04a[_0xc6dc('0x41')]);return _0x11563c[_0xc6dc('0x4e')](_0x52e139);}})['then'](function(_0x41fbe5){if(_0x41fbe5){_0x41f419=_0x41fbe5[_0xc6dc('0x36')];if(!_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x52e139[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x36e04a[_0xc6dc('0x30')]['limit']);_0x52e139[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x36e04a[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x11563c[_0xc6dc('0x4e')](_0x52e139);}})['then'](function(_0x59019d){if(_0x59019d){return _0x59019d?{'count':_0x41f419,'rows':_0x59019d}:null;}})[_0xc6dc('0x23')](respondWithResult(_0x45596e,null))[_0xc6dc('0x4a')](handleError(_0x45596e,null));};exports[_0xc6dc('0x4f')]=function(_0x451662,_0xbe53c4,_0x9c99ee){var _0x2585c4={};var _0x5b36a5={};var _0x3039fa;var _0xc5dd02;return db['SugarcrmConfiguration'][_0xc6dc('0x4d')]({'where':{'id':_0x451662[_0xc6dc('0x47')]['id']}})['then'](handleEntityNotFound(_0xbe53c4,null))['then'](function(_0xa57e3){if(_0xa57e3){_0x3039fa=_0xa57e3;_0x5b36a5[_0xc6dc('0x2f')]=_[_0xc6dc('0x31')](db[_0xc6dc('0x50')][_0xc6dc('0x2b')]);_0x5b36a5[_0xc6dc('0x30')]=_[_0xc6dc('0x31')](_0x451662[_0xc6dc('0x30')]);_0x5b36a5[_0xc6dc('0x32')]=_[_0xc6dc('0x33')](_0x5b36a5[_0xc6dc('0x2f')],_0x5b36a5['query']);_0x2585c4[_0xc6dc('0x35')]=_['intersection'](_0x5b36a5[_0xc6dc('0x2f')],qs[_0xc6dc('0x34')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x34')]));_0x2585c4['attributes']=_0x2585c4[_0xc6dc('0x35')][_0xc6dc('0x36')]?_0x2585c4['attributes']:_0x5b36a5[_0xc6dc('0x2f')];_0x2585c4[_0xc6dc('0x3a')]=qs[_0xc6dc('0x3b')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x3b')]);_0x2585c4[_0xc6dc('0x3e')]=qs[_0xc6dc('0x32')](_['pick'](_0x451662['query'],_0x5b36a5[_0xc6dc('0x32')]));if(_0x451662['query'][_0xc6dc('0x3d')]){_0x2585c4['where']=_[_0xc6dc('0x3f')](_0x2585c4['where'],{'$or':_[_0xc6dc('0x2a')](_0x2585c4[_0xc6dc('0x35')],function(_0x4fae13){var _0x5e7c01={};_0x5e7c01[_0x4fae13]={'$like':'%'+_0x451662['query']['filter']+'%'};return _0x5e7c01;})});}_0x2585c4=_['merge']({},_0x2585c4,_0x451662[_0xc6dc('0x41')]);return _0x3039fa[_0xc6dc('0x4f')](_0x2585c4);}})[_0xc6dc('0x23')](function(_0x1b4c29){if(_0x1b4c29){_0xc5dd02=_0x1b4c29[_0xc6dc('0x36')];if(!_0x451662[_0xc6dc('0x30')][_0xc6dc('0x37')](_0xc6dc('0x38'))){_0x2585c4[_0xc6dc('0x39')]=qs[_0xc6dc('0x39')](_0x451662['query'][_0xc6dc('0x39')]);_0x2585c4[_0xc6dc('0x1d')]=qs[_0xc6dc('0x1d')](_0x451662[_0xc6dc('0x30')][_0xc6dc('0x1d')]);}return _0x3039fa[_0xc6dc('0x4f')](_0x2585c4);}})[_0xc6dc('0x23')](function(_0x49ef29){if(_0x49ef29){return _0x49ef29?{'count':_0xc5dd02,'rows':_0x49ef29}:null;}})[_0xc6dc('0x23')](respondWithResult(_0xbe53c4,null))[_0xc6dc('0x4a')](handleError(_0xbe53c4,null));};
\ No newline at end of file
+var _0xfe40=['stack','name','send','index','map','SugarcrmConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','create','body','catch','destroy','getFields','SugarcrmField','hasOwnProperty','nolimit','getSubjects','order','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','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','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error'];(function(_0x407a3e,_0x15acb0){var _0x129fe3=function(_0x124c2f){while(--_0x124c2f){_0x407a3e['push'](_0x407a3e['shift']());}};_0x129fe3(++_0x15acb0);}(_0xfe40,0x1b9));var _0x0fe4=function(_0x121424,_0x45d2a2){_0x121424=_0x121424-0x0;var _0x29d44a=_0xfe40[_0x121424];return _0x29d44a;};'use strict';var emlformat=require(_0x0fe4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fe4('0x1'));var jsonpatch=require(_0x0fe4('0x2'));var rp=require(_0x0fe4('0x3'));var moment=require(_0x0fe4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0fe4('0x5'));var util=require(_0x0fe4('0x6'));var path=require(_0x0fe4('0x7'));var sox=require(_0x0fe4('0x8'));var csv=require('to-csv');var ejs=require(_0x0fe4('0x9'));var fs=require('fs');var fs_extra=require(_0x0fe4('0xa'));var _=require(_0x0fe4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0fe4('0xc'));var deskjs=require(_0x0fe4('0xd'));var toCsv=require(_0x0fe4('0xe'));var querystring=require(_0x0fe4('0xf'));var Papa=require('papaparse');var Redis=require(_0x0fe4('0x10'));var authService=require(_0x0fe4('0x11'));var qs=require(_0x0fe4('0x12'));var as=require(_0x0fe4('0x13'));var hardwareService=require(_0x0fe4('0x14'));var logger=require('../../config/logger')(_0x0fe4('0x15'));var utils=require(_0x0fe4('0x16'));var config=require(_0x0fe4('0x17'));var licenseUtil=require(_0x0fe4('0x18'));var db=require(_0x0fe4('0x19'))['db'];function respondWithStatusCode(_0x3b1d68,_0x513d27){_0x513d27=_0x513d27||0xcc;return function(_0x424951){if(_0x424951){return _0x3b1d68[_0x0fe4('0x1a')](_0x513d27);}return _0x3b1d68[_0x0fe4('0x1b')](_0x513d27)[_0x0fe4('0x1c')]();};}function respondWithResult(_0x2fbb35,_0x12d97f){_0x12d97f=_0x12d97f||0xc8;return function(_0x282949){if(_0x282949){return _0x2fbb35[_0x0fe4('0x1b')](_0x12d97f)['json'](_0x282949);}};}function respondWithFilteredResult(_0x36996f,_0x2ad371){return function(_0x4778b5){if(_0x4778b5){var _0x135e3f=typeof _0x2ad371[_0x0fe4('0x1d')]===_0x0fe4('0x1e')&&typeof _0x2ad371['limit']===_0x0fe4('0x1e');var _0x36e893=_0x4778b5[_0x0fe4('0x1f')];var _0x1e920f=_0x135e3f?0x0:_0x2ad371[_0x0fe4('0x1d')];var _0x3ebd0b=_0x135e3f?_0x4778b5[_0x0fe4('0x1f')]:_0x2ad371[_0x0fe4('0x1d')]+_0x2ad371[_0x0fe4('0x20')];var _0xd8be64;if(_0x3ebd0b>=_0x36e893){_0x3ebd0b=_0x36e893;_0xd8be64=0xc8;}else{_0xd8be64=0xce;}_0x36996f[_0x0fe4('0x1b')](_0xd8be64);return _0x36996f['set'](_0x0fe4('0x21'),_0x1e920f+'-'+_0x3ebd0b+'/'+_0x36e893)['json'](_0x4778b5);}return null;};}function patchUpdates(_0x2f90ac){return function(_0x32a6cd){try{jsonpatch[_0x0fe4('0x22')](_0x32a6cd,_0x2f90ac,!![]);}catch(_0x321d46){return BPromise[_0x0fe4('0x23')](_0x321d46);}return _0x32a6cd['save']();};}function saveUpdates(_0x1ebae2,_0x573bb9){return function(_0x3f7135){if(_0x3f7135){return _0x3f7135[_0x0fe4('0x24')](_0x1ebae2)[_0x0fe4('0x25')](function(_0x4c9f34){return _0x4c9f34;});}return null;};}function removeEntity(_0x322c2e,_0x516f69){return function(_0x35a476){if(_0x35a476){return _0x35a476['destroy']()[_0x0fe4('0x25')](function(){_0x322c2e[_0x0fe4('0x1b')](0xcc)[_0x0fe4('0x1c')]();});}};}function handleEntityNotFound(_0x2661b9,_0x27bf78){return function(_0x4aa831){if(!_0x4aa831){_0x2661b9[_0x0fe4('0x1a')](0x194);}return _0x4aa831;};}function handleError(_0x4bb461,_0x2baffc){_0x2baffc=_0x2baffc||0x1f4;return function(_0x490146){logger[_0x0fe4('0x26')](_0x490146[_0x0fe4('0x27')]);if(_0x490146[_0x0fe4('0x28')]){delete _0x490146[_0x0fe4('0x28')];}_0x4bb461[_0x0fe4('0x1b')](_0x2baffc)[_0x0fe4('0x29')](_0x490146);};}exports[_0x0fe4('0x2a')]=function(_0x52d5d7,_0x3b9fec){var _0x563ea8={},_0x330abc={},_0x1c20fc={'count':0x0,'rows':[]};var _0xcf306c=_[_0x0fe4('0x2b')](db[_0x0fe4('0x2c')]['rawAttributes'],function(_0x2e0165){return{'name':_0x2e0165[_0x0fe4('0x2d')],'type':_0x2e0165['type'][_0x0fe4('0x2e')]};});_0x330abc[_0x0fe4('0x2f')]=_['map'](_0xcf306c,_0x0fe4('0x28'));_0x330abc[_0x0fe4('0x30')]=_[_0x0fe4('0x31')](_0x52d5d7[_0x0fe4('0x30')]);_0x330abc[_0x0fe4('0x32')]=_[_0x0fe4('0x33')](_0x330abc[_0x0fe4('0x2f')],_0x330abc[_0x0fe4('0x30')]);_0x563ea8[_0x0fe4('0x34')]=_['intersection'](_0x330abc[_0x0fe4('0x2f')],qs[_0x0fe4('0x35')](_0x52d5d7[_0x0fe4('0x30')]['fields']));_0x563ea8[_0x0fe4('0x34')]=_0x563ea8['attributes'][_0x0fe4('0x36')]?_0x563ea8[_0x0fe4('0x34')]:_0x330abc[_0x0fe4('0x2f')];if(!_0x52d5d7['query']['hasOwnProperty']('nolimit')){_0x563ea8[_0x0fe4('0x20')]=qs[_0x0fe4('0x20')](_0x52d5d7[_0x0fe4('0x30')][_0x0fe4('0x20')]);_0x563ea8['offset']=qs[_0x0fe4('0x1d')](_0x52d5d7[_0x0fe4('0x30')][_0x0fe4('0x1d')]);}_0x563ea8['order']=qs[_0x0fe4('0x37')](_0x52d5d7['query'][_0x0fe4('0x37')]);_0x563ea8[_0x0fe4('0x38')]=qs[_0x0fe4('0x32')](_[_0x0fe4('0x39')](_0x52d5d7[_0x0fe4('0x30')],_0x330abc[_0x0fe4('0x32')]),_0xcf306c);if(_0x52d5d7[_0x0fe4('0x30')][_0x0fe4('0x3a')]){_0x563ea8[_0x0fe4('0x38')]=_[_0x0fe4('0x3b')](_0x563ea8['where'],{'$or':_[_0x0fe4('0x2b')](_0xcf306c,function(_0x18c6c8){if(_0x18c6c8['type']!==_0x0fe4('0x3c')){var _0x345e64={};_0x345e64[_0x18c6c8[_0x0fe4('0x28')]]={'$like':'%'+_0x52d5d7[_0x0fe4('0x30')][_0x0fe4('0x3a')]+'%'};return _0x345e64;}})});}_0x563ea8=_['merge']({},_0x563ea8,_0x52d5d7[_0x0fe4('0x3d')]);var _0x3389f8={'where':_0x563ea8[_0x0fe4('0x38')]};return db['SugarcrmConfiguration']['count'](_0x3389f8)['then'](function(_0xab020b){_0x1c20fc[_0x0fe4('0x1f')]=_0xab020b;if(_0x52d5d7['query'][_0x0fe4('0x3e')]){_0x563ea8[_0x0fe4('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x0fe4('0x40')](_0x563ea8);})[_0x0fe4('0x25')](function(_0x37e18a){_0x1c20fc['rows']=_0x37e18a;return _0x1c20fc;})[_0x0fe4('0x25')](respondWithFilteredResult(_0x3b9fec,_0x563ea8))['catch'](handleError(_0x3b9fec,null));};exports['show']=function(_0x2b08a9,_0x1f2916){var _0x2fd11e={'raw':![],'where':{'id':_0x2b08a9[_0x0fe4('0x41')]['id']}},_0x8e8892={};_0x8e8892[_0x0fe4('0x2f')]=_[_0x0fe4('0x31')](db[_0x0fe4('0x2c')][_0x0fe4('0x42')]);_0x8e8892[_0x0fe4('0x30')]=_[_0x0fe4('0x31')](_0x2b08a9['query']);_0x8e8892['filters']=_[_0x0fe4('0x33')](_0x8e8892[_0x0fe4('0x2f')],_0x8e8892[_0x0fe4('0x30')]);_0x2fd11e[_0x0fe4('0x34')]=_[_0x0fe4('0x33')](_0x8e8892[_0x0fe4('0x2f')],qs[_0x0fe4('0x35')](_0x2b08a9['query'][_0x0fe4('0x35')]));_0x2fd11e[_0x0fe4('0x34')]=_0x2fd11e[_0x0fe4('0x34')][_0x0fe4('0x36')]?_0x2fd11e['attributes']:_0x8e8892[_0x0fe4('0x2f')];if(_0x2b08a9[_0x0fe4('0x30')]['includeAll']){_0x2fd11e[_0x0fe4('0x3f')]=[{'all':!![]}];}_0x2fd11e=_['merge']({},_0x2fd11e,_0x2b08a9['options']);return db[_0x0fe4('0x2c')][_0x0fe4('0x43')](_0x2fd11e)[_0x0fe4('0x25')](handleEntityNotFound(_0x1f2916,null))[_0x0fe4('0x25')](respondWithResult(_0x1f2916,null))['catch'](handleError(_0x1f2916,null));};exports[_0x0fe4('0x44')]=function(_0x483fff,_0x14f8be){return db[_0x0fe4('0x2c')][_0x0fe4('0x44')](_0x483fff[_0x0fe4('0x45')],{})['then'](respondWithResult(_0x14f8be,0xc9))[_0x0fe4('0x46')](handleError(_0x14f8be,null));};exports[_0x0fe4('0x24')]=function(_0x260102,_0x27f78d){if(_0x260102[_0x0fe4('0x45')]['id']){delete _0x260102[_0x0fe4('0x45')]['id'];}return db[_0x0fe4('0x2c')][_0x0fe4('0x43')]({'where':{'id':_0x260102['params']['id']}})[_0x0fe4('0x25')](handleEntityNotFound(_0x27f78d,null))['then'](saveUpdates(_0x260102[_0x0fe4('0x45')],null))[_0x0fe4('0x25')](respondWithResult(_0x27f78d,null))['catch'](handleError(_0x27f78d,null));};exports[_0x0fe4('0x47')]=function(_0x23aeac,_0x253c04){return db[_0x0fe4('0x2c')][_0x0fe4('0x43')]({'where':{'id':_0x23aeac['params']['id']}})[_0x0fe4('0x25')](handleEntityNotFound(_0x253c04,null))[_0x0fe4('0x25')](removeEntity(_0x253c04,null))[_0x0fe4('0x46')](handleError(_0x253c04,null));};exports[_0x0fe4('0x48')]=function(_0x459a71,_0x3c5ed2,_0x19a739){var _0x13bc73={};var _0x31bf73={};var _0x4af027;var _0x2513d5;return db[_0x0fe4('0x2c')]['findOne']({'where':{'id':_0x459a71[_0x0fe4('0x41')]['id']}})[_0x0fe4('0x25')](handleEntityNotFound(_0x3c5ed2,null))[_0x0fe4('0x25')](function(_0xdbe9a5){if(_0xdbe9a5){_0x4af027=_0xdbe9a5;_0x31bf73[_0x0fe4('0x2f')]=_['keys'](db[_0x0fe4('0x49')]['rawAttributes']);_0x31bf73[_0x0fe4('0x30')]=_['keys'](_0x459a71['query']);_0x31bf73[_0x0fe4('0x32')]=_['intersection'](_0x31bf73[_0x0fe4('0x2f')],_0x31bf73[_0x0fe4('0x30')]);_0x13bc73[_0x0fe4('0x34')]=_[_0x0fe4('0x33')](_0x31bf73[_0x0fe4('0x2f')],qs[_0x0fe4('0x35')](_0x459a71['query'][_0x0fe4('0x35')]));_0x13bc73[_0x0fe4('0x34')]=_0x13bc73['attributes'][_0x0fe4('0x36')]?_0x13bc73[_0x0fe4('0x34')]:_0x31bf73['model'];_0x13bc73['order']=qs[_0x0fe4('0x37')](_0x459a71[_0x0fe4('0x30')][_0x0fe4('0x37')]);_0x13bc73[_0x0fe4('0x38')]=qs[_0x0fe4('0x32')](_[_0x0fe4('0x39')](_0x459a71['query'],_0x31bf73[_0x0fe4('0x32')]));if(_0x459a71['query']['filter']){_0x13bc73['where']=_['merge'](_0x13bc73[_0x0fe4('0x38')],{'$or':_[_0x0fe4('0x2b')](_0x13bc73[_0x0fe4('0x34')],function(_0x3c841f){var _0x5a1580={};_0x5a1580[_0x3c841f]={'$like':'%'+_0x459a71['query'][_0x0fe4('0x3a')]+'%'};return _0x5a1580;})});}_0x13bc73=_['merge']({},_0x13bc73,_0x459a71[_0x0fe4('0x3d')]);return _0x4af027[_0x0fe4('0x48')](_0x13bc73);}})[_0x0fe4('0x25')](function(_0x407c72){if(_0x407c72){_0x2513d5=_0x407c72['length'];if(!_0x459a71[_0x0fe4('0x30')][_0x0fe4('0x4a')](_0x0fe4('0x4b'))){_0x13bc73[_0x0fe4('0x20')]=qs[_0x0fe4('0x20')](_0x459a71[_0x0fe4('0x30')][_0x0fe4('0x20')]);_0x13bc73[_0x0fe4('0x1d')]=qs['offset'](_0x459a71[_0x0fe4('0x30')][_0x0fe4('0x1d')]);}return _0x4af027['getFields'](_0x13bc73);}})[_0x0fe4('0x25')](function(_0x5dbf91){if(_0x5dbf91){return _0x5dbf91?{'count':_0x2513d5,'rows':_0x5dbf91}:null;}})[_0x0fe4('0x25')](respondWithResult(_0x3c5ed2,null))[_0x0fe4('0x46')](handleError(_0x3c5ed2,null));};exports[_0x0fe4('0x4c')]=function(_0x9719f2,_0x1c3e37,_0x6f24e1){var _0x5121c2={};var _0x368c4e={};var _0xd46ce6;var _0x3e5b8b;return db[_0x0fe4('0x2c')]['findOne']({'where':{'id':_0x9719f2[_0x0fe4('0x41')]['id']}})[_0x0fe4('0x25')](handleEntityNotFound(_0x1c3e37,null))[_0x0fe4('0x25')](function(_0x3895b2){if(_0x3895b2){_0xd46ce6=_0x3895b2;_0x368c4e[_0x0fe4('0x2f')]=_[_0x0fe4('0x31')](db[_0x0fe4('0x49')][_0x0fe4('0x42')]);_0x368c4e[_0x0fe4('0x30')]=_[_0x0fe4('0x31')](_0x9719f2[_0x0fe4('0x30')]);_0x368c4e['filters']=_[_0x0fe4('0x33')](_0x368c4e[_0x0fe4('0x2f')],_0x368c4e[_0x0fe4('0x30')]);_0x5121c2['attributes']=_[_0x0fe4('0x33')](_0x368c4e[_0x0fe4('0x2f')],qs[_0x0fe4('0x35')](_0x9719f2[_0x0fe4('0x30')][_0x0fe4('0x35')]));_0x5121c2['attributes']=_0x5121c2['attributes']['length']?_0x5121c2[_0x0fe4('0x34')]:_0x368c4e[_0x0fe4('0x2f')];_0x5121c2[_0x0fe4('0x4d')]=qs[_0x0fe4('0x37')](_0x9719f2[_0x0fe4('0x30')][_0x0fe4('0x37')]);_0x5121c2[_0x0fe4('0x38')]=qs[_0x0fe4('0x32')](_[_0x0fe4('0x39')](_0x9719f2['query'],_0x368c4e[_0x0fe4('0x32')]));if(_0x9719f2[_0x0fe4('0x30')]['filter']){_0x5121c2[_0x0fe4('0x38')]=_[_0x0fe4('0x3b')](_0x5121c2[_0x0fe4('0x38')],{'$or':_[_0x0fe4('0x2b')](_0x5121c2['attributes'],function(_0x50522d){var _0x102c78={};_0x102c78[_0x50522d]={'$like':'%'+_0x9719f2['query'][_0x0fe4('0x3a')]+'%'};return _0x102c78;})});}_0x5121c2=_['merge']({},_0x5121c2,_0x9719f2[_0x0fe4('0x3d')]);return _0xd46ce6[_0x0fe4('0x4c')](_0x5121c2);}})[_0x0fe4('0x25')](function(_0x2e03c0){if(_0x2e03c0){_0x3e5b8b=_0x2e03c0['length'];if(!_0x9719f2['query'][_0x0fe4('0x4a')](_0x0fe4('0x4b'))){_0x5121c2['limit']=qs[_0x0fe4('0x20')](_0x9719f2['query']['limit']);_0x5121c2['offset']=qs[_0x0fe4('0x1d')](_0x9719f2[_0x0fe4('0x30')][_0x0fe4('0x1d')]);}return _0xd46ce6[_0x0fe4('0x4c')](_0x5121c2);}})[_0x0fe4('0x25')](function(_0x17f1fb){if(_0x17f1fb){return _0x17f1fb?{'count':_0x3e5b8b,'rows':_0x17f1fb}:null;}})['then'](respondWithResult(_0x1c3e37,null))['catch'](handleError(_0x1c3e37,null));};exports[_0x0fe4('0x4e')]=function(_0x33cf9e,_0xc31768,_0x2547b9){var _0x28d6dc={};var _0x110c69={};var _0x548b3f;var _0x28421f;return db[_0x0fe4('0x2c')][_0x0fe4('0x4f')]({'where':{'id':_0x33cf9e[_0x0fe4('0x41')]['id']}})['then'](handleEntityNotFound(_0xc31768,null))[_0x0fe4('0x25')](function(_0x142810){if(_0x142810){_0x548b3f=_0x142810;_0x110c69[_0x0fe4('0x2f')]=_[_0x0fe4('0x31')](db['SugarcrmField'][_0x0fe4('0x42')]);_0x110c69[_0x0fe4('0x30')]=_['keys'](_0x33cf9e['query']);_0x110c69[_0x0fe4('0x32')]=_[_0x0fe4('0x33')](_0x110c69['model'],_0x110c69[_0x0fe4('0x30')]);_0x28d6dc[_0x0fe4('0x34')]=_['intersection'](_0x110c69[_0x0fe4('0x2f')],qs[_0x0fe4('0x35')](_0x33cf9e[_0x0fe4('0x30')][_0x0fe4('0x35')]));_0x28d6dc[_0x0fe4('0x34')]=_0x28d6dc['attributes'][_0x0fe4('0x36')]?_0x28d6dc[_0x0fe4('0x34')]:_0x110c69[_0x0fe4('0x2f')];_0x28d6dc['order']=qs[_0x0fe4('0x37')](_0x33cf9e[_0x0fe4('0x30')][_0x0fe4('0x37')]);_0x28d6dc[_0x0fe4('0x38')]=qs['filters'](_[_0x0fe4('0x39')](_0x33cf9e[_0x0fe4('0x30')],_0x110c69[_0x0fe4('0x32')]));if(_0x33cf9e['query'][_0x0fe4('0x3a')]){_0x28d6dc[_0x0fe4('0x38')]=_[_0x0fe4('0x3b')](_0x28d6dc[_0x0fe4('0x38')],{'$or':_[_0x0fe4('0x2b')](_0x28d6dc[_0x0fe4('0x34')],function(_0x14f1e6){var _0x466420={};_0x466420[_0x14f1e6]={'$like':'%'+_0x33cf9e[_0x0fe4('0x30')][_0x0fe4('0x3a')]+'%'};return _0x466420;})});}_0x28d6dc=_['merge']({},_0x28d6dc,_0x33cf9e['options']);return _0x548b3f['getDescriptions'](_0x28d6dc);}})[_0x0fe4('0x25')](function(_0x286405){if(_0x286405){_0x28421f=_0x286405['length'];if(!_0x33cf9e['query']['hasOwnProperty'](_0x0fe4('0x4b'))){_0x28d6dc[_0x0fe4('0x20')]=qs[_0x0fe4('0x20')](_0x33cf9e[_0x0fe4('0x30')][_0x0fe4('0x20')]);_0x28d6dc[_0x0fe4('0x1d')]=qs[_0x0fe4('0x1d')](_0x33cf9e['query']['offset']);}return _0x548b3f['getDescriptions'](_0x28d6dc);}})[_0x0fe4('0x25')](function(_0x59c249){if(_0x59c249){return _0x59c249?{'count':_0x28421f,'rows':_0x59c249}:null;}})[_0x0fe4('0x25')](respondWithResult(_0xc31768,null))[_0x0fe4('0x46')](handleError(_0xc31768,null));};
\ No newline at end of file
index b2775e2..7bba21a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca8a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca8a,0xca));var _0xaca8=function(_0x599659,_0x18f67d){_0x599659=_0x599659-0x0;var _0x23a48c=_0xca8a[_0x599659];return _0x23a48c;};'use strict';var _=require(_0xaca8('0x0'));var util=require(_0xaca8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaca8('0x2'));var BPromise=require(_0xaca8('0x3'));var rp=require(_0xaca8('0x4'));var fs=require('fs');var path=require(_0xaca8('0x5'));var rimraf=require(_0xaca8('0x6'));var config=require(_0xaca8('0x7'));var attributes=require(_0xaca8('0x8'));module['exports']=function(_0x2c9fae,_0xc67782){return _0x2c9fae[_0xaca8('0x9')](_0xaca8('0xa'),attributes,{'tableName':_0xaca8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90ad=['moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','util','../../config/logger'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x90ad,0x6c));var _0xd90a=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x90ad[_0xea8947];return _0x2455e9;};'use strict';var _=require('lodash');var util=require(_0xd90a('0x0'));var logger=require(_0xd90a('0x1'))('api');var moment=require(_0xd90a('0x2'));var BPromise=require(_0xd90a('0x3'));var rp=require(_0xd90a('0x4'));var fs=require('fs');var path=require(_0xd90a('0x5'));var rimraf=require(_0xd90a('0x6'));var config=require('../../config/environment');var attributes=require(_0xd90a('0x7'));module['exports']=function(_0xb7b4ac,_0x16a20c){return _0xb7b4ac[_0xd90a('0x8')](_0xd90a('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b64bfe..83dfc81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45ae=['error','code','message','catch','lodash','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5dcfd2,_0x413a91){var _0x39de1f=function(_0x1e6825){while(--_0x1e6825){_0x5dcfd2['push'](_0x5dcfd2['shift']());}};_0x39de1f(++_0x413a91);}(_0x45ae,0x130));var _0xe45a=function(_0x3cf563,_0x1d7718){_0x3cf563=_0x3cf563-0x0;var _0x225097=_0x45ae[_0x3cf563];return _0x225097;};'use strict';var _=require(_0xe45a('0x0'));var util=require(_0xe45a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe45a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe45a('0x3'))(_0xe45a('0x4'));var config=require(_0xe45a('0x5'));var jayson=require(_0xe45a('0x6'));var client=jayson[_0xe45a('0x7')][_0xe45a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd09acc,_0x402db8,_0x42012e){return new BPromise(function(_0x4f302f,_0x36039e){return client[_0xe45a('0x9')](_0xd09acc,_0x42012e)[_0xe45a('0xa')](function(_0x1d79ef){logger['info'](_0xe45a('0xb'),_0x402db8,'request\x20sent');logger[_0xe45a('0xc')](_0xe45a('0xd'),_0x402db8,_0xe45a('0xe'),JSON[_0xe45a('0xf')](_0x1d79ef));if(_0x1d79ef[_0xe45a('0x10')]){if(_0x1d79ef[_0xe45a('0x10')][_0xe45a('0x11')]===0x1f4){logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x1d79ef['error'][_0xe45a('0x12')]);return _0x36039e(_0x1d79ef[_0xe45a('0x10')]['message']);}logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x1d79ef['error'][_0xe45a('0x12')]);return _0x4f302f(_0x1d79ef[_0xe45a('0x10')][_0xe45a('0x12')]);}else{logger['info'](_0xe45a('0xb'),_0x402db8,_0xe45a('0xe'));_0x4f302f(_0x1d79ef['result']['message']);}})[_0xe45a('0x13')](function(_0x30903a){logger[_0xe45a('0x10')](_0xe45a('0xb'),_0x402db8,_0x30903a);_0x36039e(_0x30903a);});});}
\ No newline at end of file
+var _0x64a7=['../../config/environment','jayson/promise','client','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x29037b,_0x4e2e05){var _0x594c1a=function(_0x25ca8e){while(--_0x25ca8e){_0x29037b['push'](_0x29037b['shift']());}};_0x594c1a(++_0x4e2e05);}(_0x64a7,0x11b));var _0x764a=function(_0x234ddf,_0x18b79e){_0x234ddf=_0x234ddf-0x0;var _0x5cfdb6=_0x64a7[_0x234ddf];return _0x5cfdb6;};'use strict';var _=require('lodash');var util=require(_0x764a('0x0'));var moment=require('moment');var BPromise=require(_0x764a('0x1'));var rs=require(_0x764a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x764a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x764a('0x4'))('rpc');var config=require(_0x764a('0x5'));var jayson=require(_0x764a('0x6'));var client=jayson[_0x764a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa56f49,_0x579adc,_0x123e3c){return new BPromise(function(_0x5ea4ce,_0x3d36cd){return client[_0x764a('0x8')](_0xa56f49,_0x123e3c)[_0x764a('0x9')](function(_0x1f6120){logger['info'](_0x764a('0xa'),_0x579adc,_0x764a('0xb'));logger['debug'](_0x764a('0xc'),_0x579adc,_0x764a('0xb'),JSON['stringify'](_0x1f6120));if(_0x1f6120[_0x764a('0xd')]){if(_0x1f6120[_0x764a('0xd')][_0x764a('0xe')]===0x1f4){logger[_0x764a('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x579adc,_0x1f6120[_0x764a('0xd')][_0x764a('0xf')]);return _0x3d36cd(_0x1f6120[_0x764a('0xd')][_0x764a('0xf')]);}logger[_0x764a('0xd')](_0x764a('0xa'),_0x579adc,_0x1f6120[_0x764a('0xd')][_0x764a('0xf')]);return _0x5ea4ce(_0x1f6120['error'][_0x764a('0xf')]);}else{logger[_0x764a('0x10')](_0x764a('0xa'),_0x579adc,_0x764a('0xb'));_0x5ea4ce(_0x1f6120['result'][_0x764a('0xf')]);}})[_0x764a('0x11')](function(_0x2adf20){logger[_0x764a('0xd')](_0x764a('0xa'),_0x579adc,_0x2adf20);_0x3d36cd(_0x2adf20);});});}
\ No newline at end of file
index 23e3a2a..2e4daca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36dc=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x246058,_0x3345d2){var _0x1f329a=function(_0x21d64d){while(--_0x21d64d){_0x246058['push'](_0x246058['shift']());}};_0x1f329a(++_0x3345d2);}(_0x36dc,0x1b4));var _0xc36d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x36dc[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xc36d('0x0'));var path=require(_0xc36d('0x1'));var timeout=require(_0xc36d('0x2'));var express=require(_0xc36d('0x3'));var router=express['Router']();var fs_extra=require(_0xc36d('0x4'));var auth=require(_0xc36d('0x5'));var interaction=require(_0xc36d('0x6'));var config=require(_0xc36d('0x7'));var controller=require(_0xc36d('0x8'));router[_0xc36d('0x9')]('/',auth[_0xc36d('0xa')](),controller[_0xc36d('0xb')]);router[_0xc36d('0x9')](_0xc36d('0xc'),auth[_0xc36d('0xa')](),controller[_0xc36d('0xd')]);router[_0xc36d('0xe')]('/',auth[_0xc36d('0xa')](),controller[_0xc36d('0xf')]);router['put'](_0xc36d('0xc'),auth[_0xc36d('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc36d('0xa')](),controller['destroy']);module[_0xc36d('0x10')]=router;
\ No newline at end of file
+var _0x369d=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x200aea,_0x42abf0){var _0x235007=function(_0x27a059){while(--_0x27a059){_0x200aea['push'](_0x200aea['shift']());}};_0x235007(++_0x42abf0);}(_0x369d,0x1ee));var _0xd369=function(_0xd88187,_0x2f30ac){_0xd88187=_0xd88187-0x0;var _0x1867a9=_0x369d[_0xd88187];return _0x1867a9;};'use strict';var multer=require(_0xd369('0x0'));var util=require(_0xd369('0x1'));var path=require('path');var timeout=require(_0xd369('0x2'));var express=require(_0xd369('0x3'));var router=express['Router']();var fs_extra=require(_0xd369('0x4'));var auth=require(_0xd369('0x5'));var interaction=require(_0xd369('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xd369('0x7')]('/',auth[_0xd369('0x8')](),controller[_0xd369('0x9')]);router['get'](_0xd369('0xa'),auth[_0xd369('0x8')](),controller[_0xd369('0xb')]);router['post']('/',auth[_0xd369('0x8')](),controller[_0xd369('0xc')]);router[_0xd369('0xd')](_0xd369('0xa'),auth[_0xd369('0x8')](),controller[_0xd369('0xe')]);router['delete'](_0xd369('0xa'),auth[_0xd369('0x8')](),controller[_0xd369('0xf')]);module[_0xd369('0x10')]=router;
\ No newline at end of file
index 54adebe..9c36e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1750=['ENUM','string','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x1750,0x136));var _0x0175=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1750[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0175('0x0'));module[_0x0175('0x1')]={'type':{'type':Sequelize[_0x0175('0x2')](_0x0175('0x3'),'variable','customVariable','keyValue',_0x0175('0x4')),'defaultValue':_0x0175('0x3')},'content':{'type':Sequelize[_0x0175('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0175('0x2')](_0x0175('0x3'),'variable',_0x0175('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0175('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0175('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0175('0x5')]}};
\ No newline at end of file
+var _0xb79f=['picklist','STRING','string','variable','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb79f,0xd7));var _0xfb79=function(_0xd02923,_0x7d3515){_0xd02923=_0xd02923-0x0;var _0x10ff2f=_0xb79f[_0xd02923];return _0x10ff2f;};'use strict';var Sequelize=require(_0xfb79('0x0'));module[_0xfb79('0x1')]={'type':{'type':Sequelize[_0xfb79('0x2')]('string','variable',_0xfb79('0x3'),_0xfb79('0x4'),_0xfb79('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfb79('0x6')]},'key':{'type':Sequelize[_0xfb79('0x6')]},'keyType':{'type':Sequelize[_0xfb79('0x2')](_0xfb79('0x7'),_0xfb79('0x8'),_0xfb79('0x3'))},'keyContent':{'type':Sequelize[_0xfb79('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfb79('0x6')]},'customField':{'type':Sequelize[_0xfb79('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb79('0x6')]}};
\ No newline at end of file
index 3ed67a0..4832ec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb04=['body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','SugarcrmField','catch','show','params','length','merge','find','create'];(function(_0x41adfd,_0x5aeed4){var _0x485071=function(_0x571c6c){while(--_0x571c6c){_0x41adfd['push'](_0x41adfd['shift']());}};_0x485071(++_0x5aeed4);}(_0xeb04,0x165));var _0x4eb0=function(_0x178757,_0xfc6070){_0x178757=_0x178757-0x0;var _0x3b9945=_0xeb04[_0x178757];return _0x3b9945;};'use strict';var emlformat=require(_0x4eb0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4eb0('0x1'));var jsonpatch=require(_0x4eb0('0x2'));var rp=require(_0x4eb0('0x3'));var moment=require('moment');var BPromise=require(_0x4eb0('0x4'));var Mustache=require(_0x4eb0('0x5'));var util=require(_0x4eb0('0x6'));var path=require('path');var sox=require(_0x4eb0('0x7'));var csv=require(_0x4eb0('0x8'));var ejs=require(_0x4eb0('0x9'));var fs=require('fs');var fs_extra=require(_0x4eb0('0xa'));var _=require(_0x4eb0('0xb'));var squel=require(_0x4eb0('0xc'));var crypto=require('crypto');var jsforce=require(_0x4eb0('0xd'));var deskjs=require(_0x4eb0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4eb0('0xf'));var Papa=require('papaparse');var Redis=require(_0x4eb0('0x10'));var authService=require(_0x4eb0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4eb0('0x12'));var hardwareService=require(_0x4eb0('0x13'));var logger=require(_0x4eb0('0x14'))(_0x4eb0('0x15'));var utils=require(_0x4eb0('0x16'));var config=require(_0x4eb0('0x17'));var licenseUtil=require(_0x4eb0('0x18'));var db=require(_0x4eb0('0x19'))['db'];function respondWithStatusCode(_0xd97d9e,_0x535c82){_0x535c82=_0x535c82||0xcc;return function(_0x2e58f1){if(_0x2e58f1){return _0xd97d9e['sendStatus'](_0x535c82);}return _0xd97d9e[_0x4eb0('0x1a')](_0x535c82)[_0x4eb0('0x1b')]();};}function respondWithResult(_0x632130,_0xe144f8){_0xe144f8=_0xe144f8||0xc8;return function(_0x136c02){if(_0x136c02){return _0x632130[_0x4eb0('0x1a')](_0xe144f8)[_0x4eb0('0x1c')](_0x136c02);}};}function respondWithFilteredResult(_0x2c0999,_0x37df8f){return function(_0x967954){if(_0x967954){var _0x10648a=typeof _0x37df8f['offset']===_0x4eb0('0x1d')&&typeof _0x37df8f[_0x4eb0('0x1e')]===_0x4eb0('0x1d');var _0xc7c952=_0x967954[_0x4eb0('0x1f')];var _0x206f9c=_0x10648a?0x0:_0x37df8f[_0x4eb0('0x20')];var _0x3de868=_0x10648a?_0x967954[_0x4eb0('0x1f')]:_0x37df8f[_0x4eb0('0x20')]+_0x37df8f[_0x4eb0('0x1e')];var _0x4dba55;if(_0x3de868>=_0xc7c952){_0x3de868=_0xc7c952;_0x4dba55=0xc8;}else{_0x4dba55=0xce;}_0x2c0999[_0x4eb0('0x1a')](_0x4dba55);return _0x2c0999[_0x4eb0('0x21')]('Content-Range',_0x206f9c+'-'+_0x3de868+'/'+_0xc7c952)['json'](_0x967954);}return null;};}function patchUpdates(_0x359508){return function(_0x20a49a){try{jsonpatch[_0x4eb0('0x22')](_0x20a49a,_0x359508,!![]);}catch(_0x3c3083){return BPromise['reject'](_0x3c3083);}return _0x20a49a['save']();};}function saveUpdates(_0x3bdca1,_0x212b26){return function(_0x3787e9){if(_0x3787e9){return _0x3787e9[_0x4eb0('0x23')](_0x3bdca1)[_0x4eb0('0x24')](function(_0x44d22a){return _0x44d22a;});}return null;};}function removeEntity(_0x21a9ae,_0x16651d){return function(_0x10ce3a){if(_0x10ce3a){return _0x10ce3a['destroy']()[_0x4eb0('0x24')](function(){_0x21a9ae[_0x4eb0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e51e1,_0x14d2e3){return function(_0x81523f){if(!_0x81523f){_0x3e51e1['sendStatus'](0x194);}return _0x81523f;};}function handleError(_0x196eaf,_0x1ab9bf){_0x1ab9bf=_0x1ab9bf||0x1f4;return function(_0x5720db){logger[_0x4eb0('0x25')](_0x5720db[_0x4eb0('0x26')]);if(_0x5720db[_0x4eb0('0x27')]){delete _0x5720db[_0x4eb0('0x27')];}_0x196eaf['status'](_0x1ab9bf)[_0x4eb0('0x28')](_0x5720db);};}exports[_0x4eb0('0x29')]=function(_0x3cb1f1,_0x514db3){var _0x45d46a={},_0x58fb93={},_0x296392={'count':0x0,'rows':[]};var _0x45abdc=_['map'](db['SugarcrmField'][_0x4eb0('0x2a')],function(_0x2da044){return{'name':_0x2da044[_0x4eb0('0x2b')],'type':_0x2da044['type'][_0x4eb0('0x2c')]};});_0x58fb93[_0x4eb0('0x2d')]=_['map'](_0x45abdc,'name');_0x58fb93['query']=_[_0x4eb0('0x2e')](_0x3cb1f1[_0x4eb0('0x2f')]);_0x58fb93[_0x4eb0('0x30')]=_[_0x4eb0('0x31')](_0x58fb93['model'],_0x58fb93[_0x4eb0('0x2f')]);_0x45d46a[_0x4eb0('0x32')]=_[_0x4eb0('0x31')](_0x58fb93[_0x4eb0('0x2d')],qs[_0x4eb0('0x33')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x33')]));_0x45d46a[_0x4eb0('0x32')]=_0x45d46a[_0x4eb0('0x32')]['length']?_0x45d46a[_0x4eb0('0x32')]:_0x58fb93[_0x4eb0('0x2d')];if(!_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x34')](_0x4eb0('0x35'))){_0x45d46a['limit']=qs[_0x4eb0('0x1e')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x1e')]);_0x45d46a[_0x4eb0('0x20')]=qs[_0x4eb0('0x20')](_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x20')]);}_0x45d46a[_0x4eb0('0x36')]=qs[_0x4eb0('0x37')](_0x3cb1f1['query'][_0x4eb0('0x37')]);_0x45d46a['where']=qs[_0x4eb0('0x30')](_['pick'](_0x3cb1f1[_0x4eb0('0x2f')],_0x58fb93[_0x4eb0('0x30')]),_0x45abdc);if(_0x3cb1f1[_0x4eb0('0x2f')]['filter']){_0x45d46a['where']=_['merge'](_0x45d46a[_0x4eb0('0x38')],{'$or':_['map'](_0x45abdc,function(_0x4581e6){if(_0x4581e6['type']!==_0x4eb0('0x39')){var _0x267dc7={};_0x267dc7[_0x4581e6['name']]={'$like':'%'+_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x3a')]+'%'};return _0x267dc7;}})});}_0x45d46a=_['merge']({},_0x45d46a,_0x3cb1f1[_0x4eb0('0x3b')]);var _0x2f7dc3={'where':_0x45d46a[_0x4eb0('0x38')]};return db['SugarcrmField'][_0x4eb0('0x1f')](_0x2f7dc3)[_0x4eb0('0x24')](function(_0x1e7fca){_0x296392[_0x4eb0('0x1f')]=_0x1e7fca;if(_0x3cb1f1[_0x4eb0('0x2f')][_0x4eb0('0x3c')]){_0x45d46a['include']=[{'all':!![]}];}return db[_0x4eb0('0x3d')]['findAll'](_0x45d46a);})['then'](function(_0x4627df){_0x296392['rows']=_0x4627df;return _0x296392;})[_0x4eb0('0x24')](respondWithFilteredResult(_0x514db3,_0x45d46a))[_0x4eb0('0x3e')](handleError(_0x514db3,null));};exports[_0x4eb0('0x3f')]=function(_0x32c6cd,_0xe56fa7){var _0xc03e72={'raw':!![],'where':{'id':_0x32c6cd[_0x4eb0('0x40')]['id']}},_0x3b3fa4={};_0x3b3fa4[_0x4eb0('0x2d')]=_['keys'](db[_0x4eb0('0x3d')][_0x4eb0('0x2a')]);_0x3b3fa4[_0x4eb0('0x2f')]=_['keys'](_0x32c6cd[_0x4eb0('0x2f')]);_0x3b3fa4[_0x4eb0('0x30')]=_[_0x4eb0('0x31')](_0x3b3fa4['model'],_0x3b3fa4[_0x4eb0('0x2f')]);_0xc03e72['attributes']=_[_0x4eb0('0x31')](_0x3b3fa4[_0x4eb0('0x2d')],qs[_0x4eb0('0x33')](_0x32c6cd[_0x4eb0('0x2f')][_0x4eb0('0x33')]));_0xc03e72[_0x4eb0('0x32')]=_0xc03e72[_0x4eb0('0x32')][_0x4eb0('0x41')]?_0xc03e72['attributes']:_0x3b3fa4[_0x4eb0('0x2d')];if(_0x32c6cd[_0x4eb0('0x2f')]['includeAll']){_0xc03e72['include']=[{'all':!![]}];}_0xc03e72=_[_0x4eb0('0x42')]({},_0xc03e72,_0x32c6cd[_0x4eb0('0x3b')]);return db[_0x4eb0('0x3d')][_0x4eb0('0x43')](_0xc03e72)['then'](handleEntityNotFound(_0xe56fa7,null))['then'](respondWithResult(_0xe56fa7,null))[_0x4eb0('0x3e')](handleError(_0xe56fa7,null));};exports[_0x4eb0('0x44')]=function(_0x2559ea,_0xc1f249){return db['SugarcrmField'][_0x4eb0('0x44')](_0x2559ea[_0x4eb0('0x45')],{})[_0x4eb0('0x24')](respondWithResult(_0xc1f249,0xc9))[_0x4eb0('0x3e')](handleError(_0xc1f249,null));};exports[_0x4eb0('0x23')]=function(_0x2388c9,_0x3c99e4){if(_0x2388c9[_0x4eb0('0x45')]['id']){delete _0x2388c9[_0x4eb0('0x45')]['id'];}return db[_0x4eb0('0x3d')][_0x4eb0('0x43')]({'where':{'id':_0x2388c9[_0x4eb0('0x40')]['id']}})[_0x4eb0('0x24')](handleEntityNotFound(_0x3c99e4,null))[_0x4eb0('0x24')](saveUpdates(_0x2388c9[_0x4eb0('0x45')],null))['then'](respondWithResult(_0x3c99e4,null))[_0x4eb0('0x3e')](handleError(_0x3c99e4,null));};exports[_0x4eb0('0x46')]=function(_0x33d809,_0x3e3d99){return db[_0x4eb0('0x3d')][_0x4eb0('0x43')]({'where':{'id':_0x33d809[_0x4eb0('0x40')]['id']}})[_0x4eb0('0x24')](handleEntityNotFound(_0x3e3d99,null))['then'](removeEntity(_0x3e3d99,null))['catch'](handleError(_0x3e3d99,null));};
\ No newline at end of file
+var _0xccb9=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus'];(function(_0xd63bf1,_0x5c13fc){var _0x3ae8b2=function(_0x276f8d){while(--_0x276f8d){_0xd63bf1['push'](_0xd63bf1['shift']());}};_0x3ae8b2(++_0x5c13fc);}(_0xccb9,0x7e));var _0x9ccb=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xccb9[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require(_0x9ccb('0x0'));var rimraf=require(_0x9ccb('0x1'));var zipdir=require(_0x9ccb('0x2'));var jsonpatch=require(_0x9ccb('0x3'));var rp=require(_0x9ccb('0x4'));var moment=require(_0x9ccb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9ccb('0x6'));var util=require(_0x9ccb('0x7'));var path=require(_0x9ccb('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ccb('0x9'));var fs=require('fs');var fs_extra=require(_0x9ccb('0xa'));var _=require(_0x9ccb('0xb'));var squel=require(_0x9ccb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9ccb('0xd'));var toCsv=require(_0x9ccb('0xe'));var querystring=require(_0x9ccb('0xf'));var Papa=require(_0x9ccb('0x10'));var Redis=require(_0x9ccb('0x11'));var authService=require(_0x9ccb('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ccb('0x13'));var logger=require(_0x9ccb('0x14'))(_0x9ccb('0x15'));var utils=require(_0x9ccb('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ec6e,_0x5d6372){_0x5d6372=_0x5d6372||0xcc;return function(_0x3016d4){if(_0x3016d4){return _0x49ec6e[_0x9ccb('0x17')](_0x5d6372);}return _0x49ec6e[_0x9ccb('0x18')](_0x5d6372)['end']();};}function respondWithResult(_0x5e7fba,_0x31b1d5){_0x31b1d5=_0x31b1d5||0xc8;return function(_0xa44ff0){if(_0xa44ff0){return _0x5e7fba[_0x9ccb('0x18')](_0x31b1d5)[_0x9ccb('0x19')](_0xa44ff0);}};}function respondWithFilteredResult(_0x4d08b3,_0x57919d){return function(_0x3606cb){if(_0x3606cb){var _0x3f2edf=typeof _0x57919d[_0x9ccb('0x1a')]===_0x9ccb('0x1b')&&typeof _0x57919d[_0x9ccb('0x1c')]===_0x9ccb('0x1b');var _0x583e16=_0x3606cb['count'];var _0x23b789=_0x3f2edf?0x0:_0x57919d['offset'];var _0x3cafc0=_0x3f2edf?_0x3606cb[_0x9ccb('0x1d')]:_0x57919d['offset']+_0x57919d['limit'];var _0x2b95db;if(_0x3cafc0>=_0x583e16){_0x3cafc0=_0x583e16;_0x2b95db=0xc8;}else{_0x2b95db=0xce;}_0x4d08b3[_0x9ccb('0x18')](_0x2b95db);return _0x4d08b3[_0x9ccb('0x1e')](_0x9ccb('0x1f'),_0x23b789+'-'+_0x3cafc0+'/'+_0x583e16)[_0x9ccb('0x19')](_0x3606cb);}return null;};}function patchUpdates(_0x5c5e5a){return function(_0x4f31e7){try{jsonpatch[_0x9ccb('0x20')](_0x4f31e7,_0x5c5e5a,!![]);}catch(_0x5ba281){return BPromise[_0x9ccb('0x21')](_0x5ba281);}return _0x4f31e7[_0x9ccb('0x22')]();};}function saveUpdates(_0x2e00be,_0x155360){return function(_0x37f836){if(_0x37f836){return _0x37f836[_0x9ccb('0x23')](_0x2e00be)['then'](function(_0x2dda14){return _0x2dda14;});}return null;};}function removeEntity(_0x1c5e7f,_0x106a11){return function(_0x351aad){if(_0x351aad){return _0x351aad[_0x9ccb('0x24')]()[_0x9ccb('0x25')](function(){_0x1c5e7f[_0x9ccb('0x18')](0xcc)[_0x9ccb('0x26')]();});}};}function handleEntityNotFound(_0x4d12eb,_0x56ccad){return function(_0x12e4fb){if(!_0x12e4fb){_0x4d12eb[_0x9ccb('0x17')](0x194);}return _0x12e4fb;};}function handleError(_0x1e5310,_0x28a608){_0x28a608=_0x28a608||0x1f4;return function(_0x10135b){logger[_0x9ccb('0x27')](_0x10135b[_0x9ccb('0x28')]);if(_0x10135b['name']){delete _0x10135b[_0x9ccb('0x29')];}_0x1e5310[_0x9ccb('0x18')](_0x28a608)[_0x9ccb('0x2a')](_0x10135b);};}exports[_0x9ccb('0x2b')]=function(_0x3b370f,_0x424007){var _0x53be24={},_0x311c0b={},_0x8d4df3={'count':0x0,'rows':[]};var _0x3e5fd5=_[_0x9ccb('0x2c')](db[_0x9ccb('0x2d')]['rawAttributes'],function(_0x1d0178){return{'name':_0x1d0178[_0x9ccb('0x2e')],'type':_0x1d0178[_0x9ccb('0x2f')][_0x9ccb('0x30')]};});_0x311c0b[_0x9ccb('0x31')]=_[_0x9ccb('0x2c')](_0x3e5fd5,'name');_0x311c0b[_0x9ccb('0x32')]=_[_0x9ccb('0x33')](_0x3b370f[_0x9ccb('0x32')]);_0x311c0b[_0x9ccb('0x34')]=_[_0x9ccb('0x35')](_0x311c0b[_0x9ccb('0x31')],_0x311c0b[_0x9ccb('0x32')]);_0x53be24[_0x9ccb('0x36')]=_[_0x9ccb('0x35')](_0x311c0b[_0x9ccb('0x31')],qs[_0x9ccb('0x37')](_0x3b370f[_0x9ccb('0x32')]['fields']));_0x53be24[_0x9ccb('0x36')]=_0x53be24['attributes'][_0x9ccb('0x38')]?_0x53be24['attributes']:_0x311c0b['model'];if(!_0x3b370f[_0x9ccb('0x32')][_0x9ccb('0x39')](_0x9ccb('0x3a'))){_0x53be24['limit']=qs['limit'](_0x3b370f[_0x9ccb('0x32')][_0x9ccb('0x1c')]);_0x53be24[_0x9ccb('0x1a')]=qs[_0x9ccb('0x1a')](_0x3b370f[_0x9ccb('0x32')]['offset']);}_0x53be24['order']=qs[_0x9ccb('0x3b')](_0x3b370f[_0x9ccb('0x32')]['sort']);_0x53be24[_0x9ccb('0x3c')]=qs[_0x9ccb('0x34')](_['pick'](_0x3b370f[_0x9ccb('0x32')],_0x311c0b['filters']),_0x3e5fd5);if(_0x3b370f[_0x9ccb('0x32')][_0x9ccb('0x3d')]){_0x53be24[_0x9ccb('0x3c')]=_[_0x9ccb('0x3e')](_0x53be24[_0x9ccb('0x3c')],{'$or':_[_0x9ccb('0x2c')](_0x3e5fd5,function(_0x5760ba){if(_0x5760ba[_0x9ccb('0x2f')]!=='VIRTUAL'){var _0x31d05a={};_0x31d05a[_0x5760ba[_0x9ccb('0x29')]]={'$like':'%'+_0x3b370f[_0x9ccb('0x32')][_0x9ccb('0x3d')]+'%'};return _0x31d05a;}})});}_0x53be24=_[_0x9ccb('0x3e')]({},_0x53be24,_0x3b370f[_0x9ccb('0x3f')]);var _0x309fc5={'where':_0x53be24[_0x9ccb('0x3c')]};return db[_0x9ccb('0x2d')]['count'](_0x309fc5)[_0x9ccb('0x25')](function(_0x4d813f){_0x8d4df3[_0x9ccb('0x1d')]=_0x4d813f;if(_0x3b370f['query']['includeAll']){_0x53be24[_0x9ccb('0x40')]=[{'all':!![]}];}return db['SugarcrmField'][_0x9ccb('0x41')](_0x53be24);})['then'](function(_0x3637dd){_0x8d4df3[_0x9ccb('0x42')]=_0x3637dd;return _0x8d4df3;})[_0x9ccb('0x25')](respondWithFilteredResult(_0x424007,_0x53be24))[_0x9ccb('0x43')](handleError(_0x424007,null));};exports[_0x9ccb('0x44')]=function(_0x2ad688,_0x6d4cbb){var _0x26daf8={'raw':!![],'where':{'id':_0x2ad688[_0x9ccb('0x45')]['id']}},_0x2ce92e={};_0x2ce92e[_0x9ccb('0x31')]=_['keys'](db['SugarcrmField'][_0x9ccb('0x46')]);_0x2ce92e['query']=_[_0x9ccb('0x33')](_0x2ad688['query']);_0x2ce92e[_0x9ccb('0x34')]=_[_0x9ccb('0x35')](_0x2ce92e[_0x9ccb('0x31')],_0x2ce92e[_0x9ccb('0x32')]);_0x26daf8[_0x9ccb('0x36')]=_[_0x9ccb('0x35')](_0x2ce92e[_0x9ccb('0x31')],qs[_0x9ccb('0x37')](_0x2ad688[_0x9ccb('0x32')]['fields']));_0x26daf8['attributes']=_0x26daf8['attributes'][_0x9ccb('0x38')]?_0x26daf8[_0x9ccb('0x36')]:_0x2ce92e['model'];if(_0x2ad688[_0x9ccb('0x32')][_0x9ccb('0x47')]){_0x26daf8[_0x9ccb('0x40')]=[{'all':!![]}];}_0x26daf8=_[_0x9ccb('0x3e')]({},_0x26daf8,_0x2ad688[_0x9ccb('0x3f')]);return db[_0x9ccb('0x2d')][_0x9ccb('0x48')](_0x26daf8)[_0x9ccb('0x25')](handleEntityNotFound(_0x6d4cbb,null))['then'](respondWithResult(_0x6d4cbb,null))[_0x9ccb('0x43')](handleError(_0x6d4cbb,null));};exports[_0x9ccb('0x49')]=function(_0x2fd9ce,_0xe584c){return db[_0x9ccb('0x2d')][_0x9ccb('0x49')](_0x2fd9ce['body'],{})[_0x9ccb('0x25')](respondWithResult(_0xe584c,0xc9))[_0x9ccb('0x43')](handleError(_0xe584c,null));};exports[_0x9ccb('0x23')]=function(_0x509f92,_0x76b24a){if(_0x509f92[_0x9ccb('0x4a')]['id']){delete _0x509f92[_0x9ccb('0x4a')]['id'];}return db[_0x9ccb('0x2d')]['find']({'where':{'id':_0x509f92[_0x9ccb('0x45')]['id']}})['then'](handleEntityNotFound(_0x76b24a,null))['then'](saveUpdates(_0x509f92[_0x9ccb('0x4a')],null))[_0x9ccb('0x25')](respondWithResult(_0x76b24a,null))[_0x9ccb('0x43')](handleError(_0x76b24a,null));};exports[_0x9ccb('0x24')]=function(_0x3b4e7b,_0x35f70b){return db[_0x9ccb('0x2d')][_0x9ccb('0x48')]({'where':{'id':_0x3b4e7b[_0x9ccb('0x45')]['id']}})['then'](handleEntityNotFound(_0x35f70b,null))[_0x9ccb('0x25')](removeEntity(_0x35f70b,null))[_0x9ccb('0x43')](handleError(_0x35f70b,null));};
\ No newline at end of file
index b73f703..176a5b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc68=['int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xf40b02,_0x325ed4){var _0x22b5a2=function(_0x427ebc){while(--_0x427ebc){_0xf40b02['push'](_0xf40b02['shift']());}};_0x22b5a2(++_0x325ed4);}(_0xfc68,0x11b));var _0x8fc6=function(_0x570b19,_0xe4cb1f){_0x570b19=_0x570b19-0x0;var _0x44c8ce=_0xfc68[_0x570b19];return _0x44c8ce;};'use strict';var _=require(_0x8fc6('0x0'));var util=require(_0x8fc6('0x1'));var logger=require(_0x8fc6('0x2'))(_0x8fc6('0x3'));var moment=require(_0x8fc6('0x4'));var BPromise=require('bluebird');var rp=require(_0x8fc6('0x5'));var fs=require('fs');var path=require(_0x8fc6('0x6'));var rimraf=require(_0x8fc6('0x7'));var config=require(_0x8fc6('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x8fc6('0x9')]=function(_0x4023f4,_0x17b4d5){return _0x4023f4[_0x8fc6('0xa')]('SugarcrmField',attributes,{'tableName':_0x8fc6('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x8fc6('0xc'),_0x8fc6('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb83d=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','idField','lodash'];(function(_0xd99444,_0x2008df){var _0x3bd146=function(_0x577dcc){while(--_0x577dcc){_0xd99444['push'](_0xd99444['shift']());}};_0x3bd146(++_0x2008df);}(_0xb83d,0x1cd));var _0xdb83=function(_0x288c7b,_0xe834b5){_0x288c7b=_0x288c7b-0x0;var _0x3e71e0=_0xb83d[_0x288c7b];return _0x3e71e0;};'use strict';var _=require(_0xdb83('0x0'));var util=require(_0xdb83('0x1'));var logger=require('../../config/logger')(_0xdb83('0x2'));var moment=require(_0xdb83('0x3'));var BPromise=require(_0xdb83('0x4'));var rp=require(_0xdb83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb83('0x6'));var config=require(_0xdb83('0x7'));var attributes=require(_0xdb83('0x8'));module[_0xdb83('0x9')]=function(_0x571599,_0x56dd86){return _0x571599[_0xdb83('0xa')](_0xdb83('0xb'),attributes,{'tableName':_0xdb83('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xdb83('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index abdc560..414ab65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9875=['message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','SugarcrmField,\x20%s,\x20%s'];(function(_0x2bfdf4,_0x271b31){var _0x403cb8=function(_0x5eb04f){while(--_0x5eb04f){_0x2bfdf4['push'](_0x2bfdf4['shift']());}};_0x403cb8(++_0x271b31);}(_0x9875,0xc0));var _0x5987=function(_0x1b33c8,_0x351a00){_0x1b33c8=_0x1b33c8-0x0;var _0x3d6775=_0x9875[_0x1b33c8];return _0x3d6775;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5987('0x0'));var fs=require('fs');var Redis=require(_0x5987('0x1'));var db=require(_0x5987('0x2'))['db'];var utils=require(_0x5987('0x3'));var logger=require(_0x5987('0x4'))(_0x5987('0x5'));var config=require(_0x5987('0x6'));var jayson=require(_0x5987('0x7'));var client=jayson[_0x5987('0x8')][_0x5987('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x101691,_0x1a6471,_0x4bf012){return new BPromise(function(_0x1ff742,_0x4b65c6){return client[_0x5987('0xa')](_0x101691,_0x4bf012)[_0x5987('0xb')](function(_0x35e48f){logger[_0x5987('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'));logger[_0x5987('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'),JSON['stringify'](_0x35e48f));if(_0x35e48f[_0x5987('0xf')]){if(_0x35e48f['error'][_0x5987('0x10')]===0x1f4){logger[_0x5987('0xf')](_0x5987('0x11'),_0x1a6471,_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);return _0x4b65c6(_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);}logger['error'](_0x5987('0x11'),_0x1a6471,_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);return _0x1ff742(_0x35e48f[_0x5987('0xf')][_0x5987('0x12')]);}else{logger[_0x5987('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0x5987('0xd'));_0x1ff742(_0x35e48f[_0x5987('0x13')]['message']);}})[_0x5987('0x14')](function(_0xdf645d){logger[_0x5987('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x1a6471,_0xdf645d);_0x4b65c6(_0xdf645d);});});}
\ No newline at end of file
+var _0x4ca8=['rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x87216e,_0x22d300){var _0x347cbc=function(_0x10364e){while(--_0x10364e){_0x87216e['push'](_0x87216e['shift']());}};_0x347cbc(++_0x22d300);}(_0x4ca8,0x82));var _0x84ca=function(_0x57e6dc,_0x101f4c){_0x57e6dc=_0x57e6dc-0x0;var _0x3659d0=_0x4ca8[_0x57e6dc];return _0x3659d0;};'use strict';var _=require(_0x84ca('0x0'));var util=require(_0x84ca('0x1'));var moment=require(_0x84ca('0x2'));var BPromise=require(_0x84ca('0x3'));var rs=require(_0x84ca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84ca('0x5'))['db'];var utils=require(_0x84ca('0x6'));var logger=require(_0x84ca('0x7'))(_0x84ca('0x8'));var config=require(_0x84ca('0x9'));var jayson=require(_0x84ca('0xa'));var client=jayson[_0x84ca('0xb')][_0x84ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40063c,_0x223953,_0x41e246){return new BPromise(function(_0x30e747,_0x580d67){return client['request'](_0x40063c,_0x41e246)['then'](function(_0x4cd7a6){logger[_0x84ca('0xd')](_0x84ca('0xe'),_0x223953,_0x84ca('0xf'));logger[_0x84ca('0x10')](_0x84ca('0x11'),_0x223953,'request\x20sent',JSON['stringify'](_0x4cd7a6));if(_0x4cd7a6[_0x84ca('0x12')]){if(_0x4cd7a6['error'][_0x84ca('0x13')]===0x1f4){logger[_0x84ca('0x12')](_0x84ca('0xe'),_0x223953,_0x4cd7a6[_0x84ca('0x12')]['message']);return _0x580d67(_0x4cd7a6[_0x84ca('0x12')][_0x84ca('0x14')]);}logger[_0x84ca('0x12')](_0x84ca('0xe'),_0x223953,_0x4cd7a6[_0x84ca('0x12')][_0x84ca('0x14')]);return _0x30e747(_0x4cd7a6[_0x84ca('0x12')][_0x84ca('0x14')]);}else{logger[_0x84ca('0xd')](_0x84ca('0xe'),_0x223953,_0x84ca('0xf'));_0x30e747(_0x4cd7a6[_0x84ca('0x15')][_0x84ca('0x14')]);}})[_0x84ca('0x16')](function(_0x970355){logger[_0x84ca('0x12')](_0x84ca('0xe'),_0x223953,_0x970355);_0x580d67(_0x970355);});});}
\ No newline at end of file
index 72e1c54..abbfb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3edb=['fs-extra','../../components/interaction/service','./intVtigerAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3edb,0x1c9));var _0xb3ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3edb[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb3ed('0x0'));var util=require(_0xb3ed('0x1'));var path=require('path');var timeout=require(_0xb3ed('0x2'));var express=require(_0xb3ed('0x3'));var router=express[_0xb3ed('0x4')]();var fs_extra=require(_0xb3ed('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb3ed('0x6'));var config=require('../../config/environment');var controller=require(_0xb3ed('0x7'));router['get']('/',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x9')]);router[_0xb3ed('0xa')]('/:id',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0xb')]);router[_0xb3ed('0xa')](_0xb3ed('0xc'),auth[_0xb3ed('0x8')](),controller[_0xb3ed('0xd')]);router['get'](_0xb3ed('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xb3ed('0xf')]('/',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x10')]);router[_0xb3ed('0xf')](_0xb3ed('0xc'),auth['isAuthenticated'](),controller[_0xb3ed('0x11')]);router['put']('/:id',auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x12')]);router['delete'](_0xb3ed('0x13'),auth[_0xb3ed('0x8')](),controller[_0xb3ed('0x14')]);module[_0xb3ed('0x15')]=router;
\ No newline at end of file
+var _0x2494=['isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','post','/:id/configurations','addConfiguration','put','update','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intVtigerAccount.controller'];(function(_0x5c12f2,_0x5de043){var _0x5e8344=function(_0x445932){while(--_0x445932){_0x5c12f2['push'](_0x5c12f2['shift']());}};_0x5e8344(++_0x5de043);}(_0x2494,0x82));var _0x4249=function(_0x78fb6e,_0x5de57e){_0x78fb6e=_0x78fb6e-0x0;var _0x3ca2f0=_0x2494[_0x78fb6e];return _0x3ca2f0;};'use strict';var multer=require(_0x4249('0x0'));var util=require('util');var path=require(_0x4249('0x1'));var timeout=require(_0x4249('0x2'));var express=require(_0x4249('0x3'));var router=express[_0x4249('0x4')]();var fs_extra=require(_0x4249('0x5'));var auth=require(_0x4249('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4249('0x7'));router['get']('/',auth[_0x4249('0x8')](),controller[_0x4249('0x9')]);router[_0x4249('0xa')]('/:id',auth[_0x4249('0x8')](),controller[_0x4249('0xb')]);router[_0x4249('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x4249('0xc')]);router[_0x4249('0xa')](_0x4249('0xd'),auth[_0x4249('0x8')](),controller[_0x4249('0xe')]);router[_0x4249('0xf')]('/',auth[_0x4249('0x8')](),controller['create']);router['post'](_0x4249('0x10'),auth['isAuthenticated'](),controller[_0x4249('0x11')]);router[_0x4249('0x12')]('/:id',auth[_0x4249('0x8')](),controller[_0x4249('0x13')]);router['delete'](_0x4249('0x14'),auth[_0x4249('0x8')](),controller[_0x4249('0x15')]);module[_0x4249('0x16')]=router;
\ No newline at end of file
index a662bd7..b02fc29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5972=['STRING','HelpDesk','exports'];(function(_0x41b913,_0x5b0927){var _0x253f95=function(_0x116734){while(--_0x116734){_0x41b913['push'](_0x41b913['shift']());}};_0x253f95(++_0x5b0927);}(_0x5972,0x119));var _0x2597=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x5972[_0x2f3794];return _0x1c9fbe;};'use strict';var Sequelize=require('sequelize');module[_0x2597('0x0')]={'name':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2597('0x1')]},'username':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2597('0x1')],'allowNull':![],'defaultValue':_0x2597('0x2')},'remoteUri':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2597('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x06ed=['exports','STRING','HelpDesk','sequelize'];(function(_0x1f4331,_0x2ed5b3){var _0x3ee88a=function(_0x145878){while(--_0x145878){_0x1f4331['push'](_0x1f4331['shift']());}};_0x3ee88a(++_0x2ed5b3);}(_0x06ed,0x15b));var _0xd06e=function(_0x590839,_0xd149d4){_0x590839=_0x590839-0x0;var _0x306097=_0x06ed[_0x590839];return _0x306097;};'use strict';var Sequelize=require(_0xd06e('0x0'));module[_0xd06e('0x1')]={'name':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd06e('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![],'defaultValue':_0xd06e('0x3')},'remoteUri':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xd06e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 0eccbca..93d6aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5139=['papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','find','catch','create','body','findOne','pick','getConfigurations','addConfiguration','Subjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','result','success','describe','sessionName','reference','owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5a240f,_0x1049bd){var _0x1c2664=function(_0x2cdb9){while(--_0x2cdb9){_0x5a240f['push'](_0x5a240f['shift']());}};_0x1c2664(++_0x1049bd);}(_0x5139,0xdc));var _0x9513=function(_0xf1a87d,_0x80b3a9){_0xf1a87d=_0xf1a87d-0x0;var _0x5e9155=_0x5139[_0xf1a87d];return _0x5e9155;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require(_0x9513('0x1'));var zipdir=require(_0x9513('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9513('0x3'));var moment=require(_0x9513('0x4'));var BPromise=require(_0x9513('0x5'));var Mustache=require('mustache');var util=require(_0x9513('0x6'));var path=require(_0x9513('0x7'));var sox=require(_0x9513('0x8'));var csv=require(_0x9513('0x9'));var ejs=require(_0x9513('0xa'));var fs=require('fs');var fs_extra=require(_0x9513('0xb'));var _=require(_0x9513('0xc'));var squel=require(_0x9513('0xd'));var crypto=require(_0x9513('0xe'));var jsforce=require(_0x9513('0xf'));var deskjs=require(_0x9513('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9513('0x11'));var Papa=require(_0x9513('0x12'));var Redis=require('ioredis');var authService=require(_0x9513('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9513('0x14'));var logger=require(_0x9513('0x15'))(_0x9513('0x16'));var utils=require(_0x9513('0x17'));var config=require(_0x9513('0x18'));var licenseUtil=require(_0x9513('0x19'));var db=require(_0x9513('0x1a'))['db'];var integrations=require(_0x9513('0x1b'));function respondWithStatusCode(_0x32f925,_0x3cf108){_0x3cf108=_0x3cf108||0xcc;return function(_0x133bd0){if(_0x133bd0){return _0x32f925[_0x9513('0x1c')](_0x3cf108);}return _0x32f925['status'](_0x3cf108)[_0x9513('0x1d')]();};}function respondWithResult(_0x13bf35,_0x5b6d3d){_0x5b6d3d=_0x5b6d3d||0xc8;return function(_0x1a410e){if(_0x1a410e){return _0x13bf35[_0x9513('0x1e')](_0x5b6d3d)['json'](_0x1a410e);}};}function respondWithFilteredResult(_0xaa8eea,_0x14ff4e){return function(_0x433e69){if(_0x433e69){var _0x2bca96=typeof _0x14ff4e[_0x9513('0x1f')]==='undefined'&&typeof _0x14ff4e['limit']==='undefined';var _0x4cd02b=_0x433e69[_0x9513('0x20')];var _0x418e34=_0x2bca96?0x0:_0x14ff4e[_0x9513('0x1f')];var _0x10212a=_0x2bca96?_0x433e69[_0x9513('0x20')]:_0x14ff4e[_0x9513('0x1f')]+_0x14ff4e['limit'];var _0x491999;if(_0x10212a>=_0x4cd02b){_0x10212a=_0x4cd02b;_0x491999=0xc8;}else{_0x491999=0xce;}_0xaa8eea['status'](_0x491999);return _0xaa8eea['set'](_0x9513('0x21'),_0x418e34+'-'+_0x10212a+'/'+_0x4cd02b)[_0x9513('0x22')](_0x433e69);}return null;};}function patchUpdates(_0x227781){return function(_0x334424){try{jsonpatch['apply'](_0x334424,_0x227781,!![]);}catch(_0x144694){return BPromise['reject'](_0x144694);}return _0x334424[_0x9513('0x23')]();};}function saveUpdates(_0x311c51,_0x9e1bb5){return function(_0x48ae49){if(_0x48ae49){return _0x48ae49[_0x9513('0x24')](_0x311c51)[_0x9513('0x25')](function(_0x2a62f3){return _0x2a62f3;});}return null;};}function removeEntity(_0x53c854,_0x18fd2a){return function(_0x1b50b5){if(_0x1b50b5){return _0x1b50b5[_0x9513('0x26')]()[_0x9513('0x25')](function(){_0x53c854['status'](0xcc)[_0x9513('0x1d')]();});}};}function handleEntityNotFound(_0x4f0cfe,_0x5c00a8){return function(_0x2c03a2){if(!_0x2c03a2){_0x4f0cfe[_0x9513('0x1c')](0x194);}return _0x2c03a2;};}function handleError(_0x547ce0,_0x2fa4e6){_0x2fa4e6=_0x2fa4e6||0x1f4;return function(_0x5c7269){logger[_0x9513('0x27')](_0x5c7269[_0x9513('0x28')]);if(_0x5c7269['name']){delete _0x5c7269[_0x9513('0x29')];}_0x547ce0[_0x9513('0x1e')](_0x2fa4e6)[_0x9513('0x2a')](_0x5c7269);};}exports[_0x9513('0x2b')]=function(_0x222b7d,_0x3b9da8){var _0x390b1b={},_0x451c4d={},_0x387e50={'count':0x0,'rows':[]};var _0x44248b=_[_0x9513('0x2c')](db[_0x9513('0x2d')][_0x9513('0x2e')],function(_0x42a62b){return{'name':_0x42a62b[_0x9513('0x2f')],'type':_0x42a62b[_0x9513('0x30')][_0x9513('0x31')]};});_0x451c4d[_0x9513('0x32')]=_[_0x9513('0x2c')](_0x44248b,_0x9513('0x29'));_0x451c4d['query']=_[_0x9513('0x33')](_0x222b7d['query']);_0x451c4d[_0x9513('0x34')]=_[_0x9513('0x35')](_0x451c4d[_0x9513('0x32')],_0x451c4d[_0x9513('0x36')]);_0x390b1b[_0x9513('0x37')]=_['intersection'](_0x451c4d[_0x9513('0x32')],qs['fields'](_0x222b7d[_0x9513('0x36')][_0x9513('0x38')]));_0x390b1b['attributes']=_0x390b1b['attributes'][_0x9513('0x39')]?_0x390b1b[_0x9513('0x37')]:_0x451c4d['model'];if(!_0x222b7d[_0x9513('0x36')]['hasOwnProperty'](_0x9513('0x3a'))){_0x390b1b[_0x9513('0x3b')]=qs[_0x9513('0x3b')](_0x222b7d[_0x9513('0x36')]['limit']);_0x390b1b['offset']=qs[_0x9513('0x1f')](_0x222b7d['query'][_0x9513('0x1f')]);}_0x390b1b[_0x9513('0x3c')]=qs['sort'](_0x222b7d[_0x9513('0x36')][_0x9513('0x3d')]);_0x390b1b[_0x9513('0x3e')]=qs[_0x9513('0x34')](_['pick'](_0x222b7d[_0x9513('0x36')],_0x451c4d['filters']),_0x44248b);if(_0x222b7d['query'][_0x9513('0x3f')]){_0x390b1b[_0x9513('0x3e')]=_[_0x9513('0x40')](_0x390b1b['where'],{'$or':_['map'](_0x44248b,function(_0x329e6a){if(_0x329e6a[_0x9513('0x30')]!==_0x9513('0x41')){var _0x3cf9e8={};_0x3cf9e8[_0x329e6a[_0x9513('0x29')]]={'$like':'%'+_0x222b7d[_0x9513('0x36')]['filter']+'%'};return _0x3cf9e8;}})});}_0x390b1b=_[_0x9513('0x40')]({},_0x390b1b,_0x222b7d[_0x9513('0x42')]);var _0x500510={'where':_0x390b1b[_0x9513('0x3e')]};return db[_0x9513('0x2d')][_0x9513('0x20')](_0x500510)[_0x9513('0x25')](function(_0x49729e){_0x387e50[_0x9513('0x20')]=_0x49729e;if(_0x222b7d[_0x9513('0x36')][_0x9513('0x43')]){_0x390b1b['include']=[{'all':!![]}];}return db[_0x9513('0x2d')][_0x9513('0x44')](_0x390b1b);})['then'](function(_0x25c416){_0x387e50['rows']=_0x25c416;return _0x387e50;})['then'](respondWithFilteredResult(_0x3b9da8,_0x390b1b))['catch'](handleError(_0x3b9da8,null));};exports[_0x9513('0x45')]=function(_0x1b5f67,_0x428011){var _0x4752aa={'raw':![],'where':{'id':_0x1b5f67[_0x9513('0x46')]['id']}},_0x839d5f={};_0x839d5f[_0x9513('0x32')]=_['keys'](db['VtigerAccount'][_0x9513('0x2e')]);_0x839d5f['query']=_['keys'](_0x1b5f67[_0x9513('0x36')]);_0x839d5f[_0x9513('0x34')]=_[_0x9513('0x35')](_0x839d5f[_0x9513('0x32')],_0x839d5f['query']);_0x4752aa[_0x9513('0x37')]=_['intersection'](_0x839d5f['model'],qs['fields'](_0x1b5f67[_0x9513('0x36')][_0x9513('0x38')]));_0x4752aa[_0x9513('0x37')]=_0x4752aa[_0x9513('0x37')][_0x9513('0x39')]?_0x4752aa['attributes']:_0x839d5f[_0x9513('0x32')];if(_0x1b5f67[_0x9513('0x36')][_0x9513('0x43')]){_0x4752aa['include']=[{'all':!![]}];}_0x4752aa=_[_0x9513('0x40')]({},_0x4752aa,_0x1b5f67[_0x9513('0x42')]);return db['VtigerAccount'][_0x9513('0x47')](_0x4752aa)[_0x9513('0x25')](handleEntityNotFound(_0x428011,null))['then'](respondWithResult(_0x428011,null))[_0x9513('0x48')](handleError(_0x428011,null));};exports[_0x9513('0x49')]=function(_0x113820,_0x21b05b){return db['VtigerAccount'][_0x9513('0x49')](_0x113820[_0x9513('0x4a')],{})[_0x9513('0x25')](respondWithResult(_0x21b05b,0xc9))[_0x9513('0x48')](handleError(_0x21b05b,null));};exports['update']=function(_0x45ad79,_0xa6adc6){if(_0x45ad79['body']['id']){delete _0x45ad79[_0x9513('0x4a')]['id'];}return db[_0x9513('0x2d')][_0x9513('0x47')]({'where':{'id':_0x45ad79['params']['id']}})[_0x9513('0x25')](handleEntityNotFound(_0xa6adc6,null))[_0x9513('0x25')](saveUpdates(_0x45ad79['body'],null))['then'](respondWithResult(_0xa6adc6,null))[_0x9513('0x48')](handleError(_0xa6adc6,null));};exports['destroy']=function(_0x501415,_0x244328){return db[_0x9513('0x2d')][_0x9513('0x47')]({'where':{'id':_0x501415[_0x9513('0x46')]['id']}})[_0x9513('0x25')](handleEntityNotFound(_0x244328,null))[_0x9513('0x25')](removeEntity(_0x244328,null))[_0x9513('0x48')](handleError(_0x244328,null));};exports['getConfigurations']=function(_0x3779ac,_0x476a7a,_0x184245){var _0x5bbfd5={};var _0x37b79a={};var _0x217d40;var _0x22687d;return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x3779ac['params']['id']}})['then'](handleEntityNotFound(_0x476a7a,null))[_0x9513('0x25')](function(_0x27fc5e){if(_0x27fc5e){_0x217d40=_0x27fc5e;_0x37b79a['model']=_[_0x9513('0x33')](db['VtigerConfiguration'][_0x9513('0x2e')]);_0x37b79a['query']=_[_0x9513('0x33')](_0x3779ac[_0x9513('0x36')]);_0x37b79a['filters']=_['intersection'](_0x37b79a[_0x9513('0x32')],_0x37b79a[_0x9513('0x36')]);_0x5bbfd5[_0x9513('0x37')]=_[_0x9513('0x35')](_0x37b79a[_0x9513('0x32')],qs[_0x9513('0x38')](_0x3779ac[_0x9513('0x36')][_0x9513('0x38')]));_0x5bbfd5['attributes']=_0x5bbfd5['attributes'][_0x9513('0x39')]?_0x5bbfd5[_0x9513('0x37')]:_0x37b79a[_0x9513('0x32')];_0x5bbfd5['order']=qs[_0x9513('0x3d')](_0x3779ac[_0x9513('0x36')]['sort']);_0x5bbfd5[_0x9513('0x3e')]=qs[_0x9513('0x34')](_[_0x9513('0x4c')](_0x3779ac['query'],_0x37b79a[_0x9513('0x34')]));if(_0x3779ac[_0x9513('0x36')][_0x9513('0x3f')]){_0x5bbfd5[_0x9513('0x3e')]=_[_0x9513('0x40')](_0x5bbfd5['where'],{'$or':_[_0x9513('0x2c')](_0x5bbfd5[_0x9513('0x37')],function(_0x247132){var _0x41e701={};_0x41e701[_0x247132]={'$like':'%'+_0x3779ac[_0x9513('0x36')][_0x9513('0x3f')]+'%'};return _0x41e701;})});}_0x5bbfd5=_[_0x9513('0x40')]({},_0x5bbfd5,_0x3779ac[_0x9513('0x42')]);return _0x217d40[_0x9513('0x4d')](_0x5bbfd5);}})[_0x9513('0x25')](function(_0x179bae){if(_0x179bae){_0x22687d=_0x179bae[_0x9513('0x39')];if(!_0x3779ac[_0x9513('0x36')]['hasOwnProperty'](_0x9513('0x3a'))){_0x5bbfd5[_0x9513('0x3b')]=qs[_0x9513('0x3b')](_0x3779ac[_0x9513('0x36')]['limit']);_0x5bbfd5['offset']=qs[_0x9513('0x1f')](_0x3779ac[_0x9513('0x36')][_0x9513('0x1f')]);}return _0x217d40['getConfigurations'](_0x5bbfd5);}})[_0x9513('0x25')](function(_0xbc2683){if(_0xbc2683){return _0xbc2683?{'count':_0x22687d,'rows':_0xbc2683}:null;}})[_0x9513('0x25')](respondWithResult(_0x476a7a,null))['catch'](handleError(_0x476a7a,null));};exports[_0x9513('0x4e')]=function(_0x5721c3,_0x55ae18,_0x1fc9c0){if(_0x5721c3[_0x9513('0x4a')]['id']){delete _0x5721c3[_0x9513('0x4a')]['id'];}return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x5721c3[_0x9513('0x46')]['id']}})['then'](handleEntityNotFound(_0x55ae18,null))[_0x9513('0x25')](function(_0x14b3f9){if(_0x14b3f9){_0x5721c3[_0x9513('0x4a')]['AccountId']=_0x14b3f9['id'];_0x5721c3[_0x9513('0x4a')][_0x9513('0x4f')]=integrations['getSubjects'](_0x5721c3[_0x9513('0x4a')][_0x9513('0x50')],_0x5721c3[_0x9513('0x4a')][_0x9513('0x30')]);_0x5721c3[_0x9513('0x4a')]['Descriptions']=integrations[_0x9513('0x51')](_0x5721c3['body'][_0x9513('0x50')],_0x5721c3[_0x9513('0x4a')][_0x9513('0x30')]);return db[_0x9513('0x52')][_0x9513('0x49')](_0x5721c3[_0x9513('0x4a')],{'include':[{'model':db['VtigerField'],'as':_0x9513('0x4f')},{'model':db[_0x9513('0x53')],'as':_0x9513('0x54')}]});}return null;})[_0x9513('0x25')](respondWithResult(_0x55ae18,null))['catch'](handleError(_0x55ae18,null));};var md5=require(_0x9513('0x55'));exports[_0x9513('0x56')]=function(_0x489cdb,_0x25fd8e,_0x584315){var _0xac24f2=null;var _0x206823=null;var _0xc3c3f0=null;var _0x599046=null;var _0x6bb495='';return db[_0x9513('0x2d')][_0x9513('0x4b')]({'where':{'id':_0x489cdb[_0x9513('0x46')]['id']},'attributes':['id',_0x9513('0x29'),_0x9513('0x57'),'description',_0x9513('0x58'),_0x9513('0x59'),_0x9513('0x5a'),_0x9513('0x5b')]})['then'](handleEntityNotFound(_0x25fd8e,null))[_0x9513('0x25')](function(_0x30f3ab){if(_0x30f3ab){_0xac24f2=_0x30f3ab[_0x9513('0x57')];_0x206823=_0x30f3ab['accessKey'];_0xc3c3f0=_0x30f3ab[_0x9513('0x58')];_0x6bb495=_0x30f3ab[_0x9513('0x59')];var _0x8647ba=_0x6bb495[_0x9513('0x5c')](-0x1);if(_0x8647ba==='/'){_0x6bb495=_0x6bb495[_0x9513('0x5d')](0x0,_0x6bb495[_0x9513('0x5e')](_0x8647ba));}_0x599046=util[_0x9513('0x5f')](_0x9513('0x60'),_0x6bb495);var _0x11f628={'method':_0x9513('0x61'),'uri':_0x599046,'qs':{'operation':_0x9513('0x62'),'username':_0x30f3ab[_0x9513('0x57')]},'json':!![]};return rp(_0x11f628);}})['then'](function(_0x2fa24d){if(_0x2fa24d['success']){var _0x358ed3={'method':'POST','uri':_0x599046,'form':{'operation':_0x9513('0x63'),'username':_0xac24f2,'accessKey':md5(_0x2fa24d[_0x9513('0x64')]['token']+_0x206823)},'json':!![]};return rp(_0x358ed3);}})['then'](function(_0x6493e1){if(_0x6493e1[_0x9513('0x65')]){var _0x3776d6={'method':'GET','uri':_0x599046,'qs':{'operation':_0x9513('0x66'),'username':_0xac24f2,'sessionName':_0x6493e1['result'][_0x9513('0x67')],'elementType':_0xc3c3f0},'json':!![]};return rp(_0x3776d6);}})[_0x9513('0x25')](function(_0x55144a){if(_0x55144a[_0x9513('0x65')]){var _0x18597f=['autogenerated',_0x9513('0x68'),_0x9513('0x69')];_[_0x9513('0x6a')](_0x55144a[_0x9513('0x64')][_0x9513('0x38')],function(_0x5c41d4){return _0x18597f['includes'](_0x5c41d4[_0x9513('0x30')][_0x9513('0x29')]);});_[_0x9513('0x6a')](_0x55144a[_0x9513('0x64')]['fields'],function(_0x41b58f){return _0x41b58f[_0x9513('0x6b')]===_0x9513('0x6c');});return{'count':_0x55144a['result']['fields'][_0x9513('0x39')],'rows':_[_0x9513('0x2c')](_0x55144a[_0x9513('0x64')]['fields'],function(_0x1ff183){return{'id':_0x1ff183[_0x9513('0x29')],'name':_0x1ff183[_0x9513('0x6d')],'custom':_['startsWith'](_0x1ff183[_0x9513('0x29')],_0x9513('0x6e'))?!![]:![],'options':_0x1ff183[_0x9513('0x30')][_0x9513('0x29')]===_0x9513('0x6f')&&_0x1ff183[_0x9513('0x30')][_0x9513('0x70')]['length']>0x0?_[_0x9513('0x2c')](_0x1ff183[_0x9513('0x30')]['picklistValues'],function(_0x238133){return{'name':_0x238133['label'],'value':_0x238133[_0x9513('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x25fd8e,null))[_0x9513('0x48')](function(_0x1b88e4){console[_0x9513('0x72')](_0x9513('0x73')+_0x1b88e4);var _0x4dfd36=_0x489cdb[_0x9513('0x36')][_0x9513('0x74')]?0x1f4:_0x1b88e4[_0x9513('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9513('0x56'),_0x4dfd36,JSON['stringify'](_0x1b88e4));delete _0x1b88e4['name'];if(_0x4dfd36===0x191){_0x4dfd36=0x190;}_0x25fd8e[_0x9513('0x1e')](_0x4dfd36)['send'](_0x489cdb[_0x9513('0x36')]['test']?{'message':_0x9513('0x76'),'statusCode':_0x1b88e4['statusCode']}:_0x1b88e4);});};
\ No newline at end of file
+var _0x4904=['send','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','type','VIRTUAL','options','where','VtigerAccount','includeAll','include','findAll','rows','show','filters','find','create','body','catch','params','VtigerConfiguration','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','sessionName','autogenerated','reference','owner','remove','includes','false','picklist','picklistValues','label','value','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','then','error','stack','name'];(function(_0x37c615,_0x2b681a){var _0x290ea7=function(_0x19cf61){while(--_0x19cf61){_0x37c615['push'](_0x37c615['shift']());}};_0x290ea7(++_0x2b681a);}(_0x4904,0x141));var _0x4490=function(_0x490e1b,_0x781f95){_0x490e1b=_0x490e1b-0x0;var _0x363c69=_0x4904[_0x490e1b];return _0x363c69;};'use strict';var emlformat=require(_0x4490('0x0'));var rimraf=require(_0x4490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4490('0x2'));var moment=require(_0x4490('0x3'));var BPromise=require(_0x4490('0x4'));var Mustache=require(_0x4490('0x5'));var util=require(_0x4490('0x6'));var path=require(_0x4490('0x7'));var sox=require(_0x4490('0x8'));var csv=require('to-csv');var ejs=require(_0x4490('0x9'));var fs=require('fs');var fs_extra=require(_0x4490('0xa'));var _=require(_0x4490('0xb'));var squel=require(_0x4490('0xc'));var crypto=require('crypto');var jsforce=require(_0x4490('0xd'));var deskjs=require(_0x4490('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4490('0xf'));var Papa=require(_0x4490('0x10'));var Redis=require(_0x4490('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4490('0x12'));var as=require(_0x4490('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4490('0x14'))(_0x4490('0x15'));var utils=require(_0x4490('0x16'));var config=require(_0x4490('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4490('0x18'))['db'];var integrations=require(_0x4490('0x19'));function respondWithStatusCode(_0x1dcea6,_0x5f0d2a){_0x5f0d2a=_0x5f0d2a||0xcc;return function(_0x26ce30){if(_0x26ce30){return _0x1dcea6[_0x4490('0x1a')](_0x5f0d2a);}return _0x1dcea6[_0x4490('0x1b')](_0x5f0d2a)[_0x4490('0x1c')]();};}function respondWithResult(_0x4db906,_0x30d777){_0x30d777=_0x30d777||0xc8;return function(_0x597984){if(_0x597984){return _0x4db906['status'](_0x30d777)[_0x4490('0x1d')](_0x597984);}};}function respondWithFilteredResult(_0x225283,_0x34cd5f){return function(_0x2623a2){if(_0x2623a2){var _0x422780=typeof _0x34cd5f[_0x4490('0x1e')]===_0x4490('0x1f')&&typeof _0x34cd5f['limit']===_0x4490('0x1f');var _0xae69cb=_0x2623a2['count'];var _0x323454=_0x422780?0x0:_0x34cd5f['offset'];var _0x3f2c86=_0x422780?_0x2623a2[_0x4490('0x20')]:_0x34cd5f[_0x4490('0x1e')]+_0x34cd5f[_0x4490('0x21')];var _0x27d5ad;if(_0x3f2c86>=_0xae69cb){_0x3f2c86=_0xae69cb;_0x27d5ad=0xc8;}else{_0x27d5ad=0xce;}_0x225283[_0x4490('0x1b')](_0x27d5ad);return _0x225283[_0x4490('0x22')]('Content-Range',_0x323454+'-'+_0x3f2c86+'/'+_0xae69cb)[_0x4490('0x1d')](_0x2623a2);}return null;};}function patchUpdates(_0x17b161){return function(_0x10fd7a){try{jsonpatch['apply'](_0x10fd7a,_0x17b161,!![]);}catch(_0x2f72c3){return BPromise[_0x4490('0x23')](_0x2f72c3);}return _0x10fd7a['save']();};}function saveUpdates(_0x2a8a39,_0x201726){return function(_0x2cdbd8){if(_0x2cdbd8){return _0x2cdbd8[_0x4490('0x24')](_0x2a8a39)['then'](function(_0x29209b){return _0x29209b;});}return null;};}function removeEntity(_0xd932c4,_0x12fa66){return function(_0x305c54){if(_0x305c54){return _0x305c54[_0x4490('0x25')]()[_0x4490('0x26')](function(){_0xd932c4[_0x4490('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c15f7,_0x89eb91){return function(_0x53817c){if(!_0x53817c){_0x5c15f7[_0x4490('0x1a')](0x194);}return _0x53817c;};}function handleError(_0xa4385,_0x3b103e){_0x3b103e=_0x3b103e||0x1f4;return function(_0x1fa422){logger[_0x4490('0x27')](_0x1fa422[_0x4490('0x28')]);if(_0x1fa422['name']){delete _0x1fa422[_0x4490('0x29')];}_0xa4385['status'](_0x3b103e)[_0x4490('0x2a')](_0x1fa422);};}exports[_0x4490('0x2b')]=function(_0x6b2880,_0x28fdfb){var _0x22fc30={},_0x2cca5c={},_0x24ef25={'count':0x0,'rows':[]};var _0x2ccb71=_[_0x4490('0x2c')](db['VtigerAccount']['rawAttributes'],function(_0x3e6a62){return{'name':_0x3e6a62[_0x4490('0x2d')],'type':_0x3e6a62['type']['key']};});_0x2cca5c[_0x4490('0x2e')]=_[_0x4490('0x2c')](_0x2ccb71,_0x4490('0x29'));_0x2cca5c[_0x4490('0x2f')]=_[_0x4490('0x30')](_0x6b2880[_0x4490('0x2f')]);_0x2cca5c['filters']=_[_0x4490('0x31')](_0x2cca5c[_0x4490('0x2e')],_0x2cca5c[_0x4490('0x2f')]);_0x22fc30[_0x4490('0x32')]=_[_0x4490('0x31')](_0x2cca5c[_0x4490('0x2e')],qs[_0x4490('0x33')](_0x6b2880[_0x4490('0x2f')][_0x4490('0x33')]));_0x22fc30[_0x4490('0x32')]=_0x22fc30[_0x4490('0x32')][_0x4490('0x34')]?_0x22fc30['attributes']:_0x2cca5c['model'];if(!_0x6b2880['query'][_0x4490('0x35')]('nolimit')){_0x22fc30['limit']=qs[_0x4490('0x21')](_0x6b2880['query'][_0x4490('0x21')]);_0x22fc30[_0x4490('0x1e')]=qs[_0x4490('0x1e')](_0x6b2880['query'][_0x4490('0x1e')]);}_0x22fc30[_0x4490('0x36')]=qs[_0x4490('0x37')](_0x6b2880[_0x4490('0x2f')][_0x4490('0x37')]);_0x22fc30['where']=qs['filters'](_[_0x4490('0x38')](_0x6b2880[_0x4490('0x2f')],_0x2cca5c['filters']),_0x2ccb71);if(_0x6b2880[_0x4490('0x2f')][_0x4490('0x39')]){_0x22fc30['where']=_[_0x4490('0x3a')](_0x22fc30['where'],{'$or':_[_0x4490('0x2c')](_0x2ccb71,function(_0x4870d1){if(_0x4870d1[_0x4490('0x3b')]!==_0x4490('0x3c')){var _0x5412ab={};_0x5412ab[_0x4870d1['name']]={'$like':'%'+_0x6b2880[_0x4490('0x2f')]['filter']+'%'};return _0x5412ab;}})});}_0x22fc30=_[_0x4490('0x3a')]({},_0x22fc30,_0x6b2880[_0x4490('0x3d')]);var _0x2b4df1={'where':_0x22fc30[_0x4490('0x3e')]};return db[_0x4490('0x3f')][_0x4490('0x20')](_0x2b4df1)['then'](function(_0x460d2f){_0x24ef25[_0x4490('0x20')]=_0x460d2f;if(_0x6b2880['query'][_0x4490('0x40')]){_0x22fc30[_0x4490('0x41')]=[{'all':!![]}];}return db[_0x4490('0x3f')][_0x4490('0x42')](_0x22fc30);})[_0x4490('0x26')](function(_0x5574b6){_0x24ef25[_0x4490('0x43')]=_0x5574b6;return _0x24ef25;})['then'](respondWithFilteredResult(_0x28fdfb,_0x22fc30))['catch'](handleError(_0x28fdfb,null));};exports[_0x4490('0x44')]=function(_0x4efa65,_0x3a26f7){var _0x5030e7={'raw':![],'where':{'id':_0x4efa65['params']['id']}},_0x426d11={};_0x426d11[_0x4490('0x2e')]=_['keys'](db[_0x4490('0x3f')]['rawAttributes']);_0x426d11['query']=_[_0x4490('0x30')](_0x4efa65[_0x4490('0x2f')]);_0x426d11[_0x4490('0x45')]=_['intersection'](_0x426d11[_0x4490('0x2e')],_0x426d11[_0x4490('0x2f')]);_0x5030e7[_0x4490('0x32')]=_[_0x4490('0x31')](_0x426d11[_0x4490('0x2e')],qs[_0x4490('0x33')](_0x4efa65[_0x4490('0x2f')][_0x4490('0x33')]));_0x5030e7['attributes']=_0x5030e7[_0x4490('0x32')][_0x4490('0x34')]?_0x5030e7[_0x4490('0x32')]:_0x426d11[_0x4490('0x2e')];if(_0x4efa65[_0x4490('0x2f')][_0x4490('0x40')]){_0x5030e7[_0x4490('0x41')]=[{'all':!![]}];}_0x5030e7=_[_0x4490('0x3a')]({},_0x5030e7,_0x4efa65[_0x4490('0x3d')]);return db['VtigerAccount'][_0x4490('0x46')](_0x5030e7)[_0x4490('0x26')](handleEntityNotFound(_0x3a26f7,null))[_0x4490('0x26')](respondWithResult(_0x3a26f7,null))['catch'](handleError(_0x3a26f7,null));};exports[_0x4490('0x47')]=function(_0x800df9,_0x4f3532){return db[_0x4490('0x3f')][_0x4490('0x47')](_0x800df9[_0x4490('0x48')],{})[_0x4490('0x26')](respondWithResult(_0x4f3532,0xc9))[_0x4490('0x49')](handleError(_0x4f3532,null));};exports[_0x4490('0x24')]=function(_0x142a9,_0x49676d){if(_0x142a9[_0x4490('0x48')]['id']){delete _0x142a9[_0x4490('0x48')]['id'];}return db['VtigerAccount'][_0x4490('0x46')]({'where':{'id':_0x142a9[_0x4490('0x4a')]['id']}})[_0x4490('0x26')](handleEntityNotFound(_0x49676d,null))['then'](saveUpdates(_0x142a9['body'],null))[_0x4490('0x26')](respondWithResult(_0x49676d,null))[_0x4490('0x49')](handleError(_0x49676d,null));};exports['destroy']=function(_0x54b8a9,_0x412395){return db['VtigerAccount'][_0x4490('0x46')]({'where':{'id':_0x54b8a9[_0x4490('0x4a')]['id']}})[_0x4490('0x26')](handleEntityNotFound(_0x412395,null))['then'](removeEntity(_0x412395,null))['catch'](handleError(_0x412395,null));};exports['getConfigurations']=function(_0x501e3d,_0x51db87,_0x373896){var _0x3c975e={};var _0x5bea50={};var _0x4234ef;var _0x37fdb1;return db['VtigerAccount']['findOne']({'where':{'id':_0x501e3d[_0x4490('0x4a')]['id']}})[_0x4490('0x26')](handleEntityNotFound(_0x51db87,null))['then'](function(_0x3cc034){if(_0x3cc034){_0x4234ef=_0x3cc034;_0x5bea50['model']=_[_0x4490('0x30')](db[_0x4490('0x4b')]['rawAttributes']);_0x5bea50['query']=_[_0x4490('0x30')](_0x501e3d[_0x4490('0x2f')]);_0x5bea50[_0x4490('0x45')]=_[_0x4490('0x31')](_0x5bea50['model'],_0x5bea50[_0x4490('0x2f')]);_0x3c975e[_0x4490('0x32')]=_[_0x4490('0x31')](_0x5bea50[_0x4490('0x2e')],qs[_0x4490('0x33')](_0x501e3d['query'][_0x4490('0x33')]));_0x3c975e['attributes']=_0x3c975e[_0x4490('0x32')]['length']?_0x3c975e[_0x4490('0x32')]:_0x5bea50[_0x4490('0x2e')];_0x3c975e[_0x4490('0x36')]=qs[_0x4490('0x37')](_0x501e3d[_0x4490('0x2f')]['sort']);_0x3c975e[_0x4490('0x3e')]=qs[_0x4490('0x45')](_[_0x4490('0x38')](_0x501e3d['query'],_0x5bea50[_0x4490('0x45')]));if(_0x501e3d[_0x4490('0x2f')][_0x4490('0x39')]){_0x3c975e['where']=_['merge'](_0x3c975e[_0x4490('0x3e')],{'$or':_[_0x4490('0x2c')](_0x3c975e['attributes'],function(_0x20575d){var _0x3c7524={};_0x3c7524[_0x20575d]={'$like':'%'+_0x501e3d['query'][_0x4490('0x39')]+'%'};return _0x3c7524;})});}_0x3c975e=_[_0x4490('0x3a')]({},_0x3c975e,_0x501e3d[_0x4490('0x3d')]);return _0x4234ef[_0x4490('0x4c')](_0x3c975e);}})[_0x4490('0x26')](function(_0x293cec){if(_0x293cec){_0x37fdb1=_0x293cec[_0x4490('0x34')];if(!_0x501e3d[_0x4490('0x2f')][_0x4490('0x35')]('nolimit')){_0x3c975e[_0x4490('0x21')]=qs[_0x4490('0x21')](_0x501e3d[_0x4490('0x2f')][_0x4490('0x21')]);_0x3c975e[_0x4490('0x1e')]=qs['offset'](_0x501e3d[_0x4490('0x2f')][_0x4490('0x1e')]);}return _0x4234ef[_0x4490('0x4c')](_0x3c975e);}})['then'](function(_0x3bc8b4){if(_0x3bc8b4){return _0x3bc8b4?{'count':_0x37fdb1,'rows':_0x3bc8b4}:null;}})['then'](respondWithResult(_0x51db87,null))[_0x4490('0x49')](handleError(_0x51db87,null));};exports[_0x4490('0x4d')]=function(_0x22f92b,_0x3fe595,_0x54dd32){if(_0x22f92b[_0x4490('0x48')]['id']){delete _0x22f92b[_0x4490('0x48')]['id'];}return db[_0x4490('0x3f')][_0x4490('0x4e')]({'where':{'id':_0x22f92b[_0x4490('0x4a')]['id']}})[_0x4490('0x26')](handleEntityNotFound(_0x3fe595,null))[_0x4490('0x26')](function(_0x5a7b3e){if(_0x5a7b3e){_0x22f92b[_0x4490('0x48')][_0x4490('0x4f')]=_0x5a7b3e['id'];_0x22f92b[_0x4490('0x48')]['Subjects']=integrations[_0x4490('0x50')](_0x22f92b[_0x4490('0x48')][_0x4490('0x51')],_0x22f92b[_0x4490('0x48')][_0x4490('0x3b')]);_0x22f92b[_0x4490('0x48')][_0x4490('0x52')]=integrations[_0x4490('0x53')](_0x22f92b[_0x4490('0x48')][_0x4490('0x51')],_0x22f92b[_0x4490('0x48')][_0x4490('0x3b')]);return db[_0x4490('0x4b')]['create'](_0x22f92b[_0x4490('0x48')],{'include':[{'model':db[_0x4490('0x54')],'as':_0x4490('0x55')},{'model':db[_0x4490('0x54')],'as':_0x4490('0x52')}]});}return null;})[_0x4490('0x26')](respondWithResult(_0x3fe595,null))[_0x4490('0x49')](handleError(_0x3fe595,null));};var md5=require(_0x4490('0x56'));exports[_0x4490('0x57')]=function(_0x4ed553,_0xa52d22,_0x19a250){var _0x3ad47b=null;var _0x2abde5=null;var _0x11bcf6=null;var _0x180b28=null;var _0xaa35eb='';return db['VtigerAccount'][_0x4490('0x4e')]({'where':{'id':_0x4ed553[_0x4490('0x4a')]['id']},'attributes':['id','name',_0x4490('0x58'),_0x4490('0x59'),_0x4490('0x5a'),_0x4490('0x5b'),'serverUrl','accessKey']})[_0x4490('0x26')](handleEntityNotFound(_0xa52d22,null))[_0x4490('0x26')](function(_0x5a4247){if(_0x5a4247){_0x3ad47b=_0x5a4247[_0x4490('0x58')];_0x2abde5=_0x5a4247[_0x4490('0x5c')];_0x11bcf6=_0x5a4247[_0x4490('0x5a')];_0xaa35eb=_0x5a4247[_0x4490('0x5b')];var _0x547343=_0xaa35eb[_0x4490('0x5d')](-0x1);if(_0x547343==='/'){_0xaa35eb=_0xaa35eb[_0x4490('0x5e')](0x0,_0xaa35eb[_0x4490('0x5f')](_0x547343));}_0x180b28=util[_0x4490('0x60')](_0x4490('0x61'),_0xaa35eb);var _0x364fcf={'method':_0x4490('0x62'),'uri':_0x180b28,'qs':{'operation':_0x4490('0x63'),'username':_0x5a4247[_0x4490('0x58')]},'json':!![]};return rp(_0x364fcf);}})[_0x4490('0x26')](function(_0x2d9449){if(_0x2d9449[_0x4490('0x64')]){var _0x5f2399={'method':_0x4490('0x65'),'uri':_0x180b28,'form':{'operation':_0x4490('0x66'),'username':_0x3ad47b,'accessKey':md5(_0x2d9449[_0x4490('0x67')][_0x4490('0x68')]+_0x2abde5)},'json':!![]};return rp(_0x5f2399);}})[_0x4490('0x26')](function(_0x1ca183){if(_0x1ca183['success']){var _0x46b017={'method':_0x4490('0x62'),'uri':_0x180b28,'qs':{'operation':'describe','username':_0x3ad47b,'sessionName':_0x1ca183[_0x4490('0x67')][_0x4490('0x69')],'elementType':_0x11bcf6},'json':!![]};return rp(_0x46b017);}})[_0x4490('0x26')](function(_0x1d45fd){if(_0x1d45fd['success']){var _0x1bbf9a=[_0x4490('0x6a'),_0x4490('0x6b'),_0x4490('0x6c')];_[_0x4490('0x6d')](_0x1d45fd[_0x4490('0x67')]['fields'],function(_0x4be56a){return _0x1bbf9a[_0x4490('0x6e')](_0x4be56a[_0x4490('0x3b')][_0x4490('0x29')]);});_[_0x4490('0x6d')](_0x1d45fd['result'][_0x4490('0x33')],function(_0x3bd3e1){return _0x3bd3e1['editable']===_0x4490('0x6f');});return{'count':_0x1d45fd['result'][_0x4490('0x33')]['length'],'rows':_[_0x4490('0x2c')](_0x1d45fd[_0x4490('0x67')]['fields'],function(_0x563344){return{'id':_0x563344['name'],'name':_0x563344['label'],'custom':_['startsWith'](_0x563344['name'],'cf_')?!![]:![],'options':_0x563344['type'][_0x4490('0x29')]===_0x4490('0x70')&&_0x563344[_0x4490('0x3b')][_0x4490('0x71')][_0x4490('0x34')]>0x0?_[_0x4490('0x2c')](_0x563344['type'][_0x4490('0x71')],function(_0x1e737d){return{'name':_0x1e737d[_0x4490('0x72')],'value':_0x1e737d[_0x4490('0x73')]};}):[]};})};}})[_0x4490('0x26')](respondWithResult(_0xa52d22,null))[_0x4490('0x49')](function(_0x1bf1f6){console['log'](_0x4490('0x74')+_0x1bf1f6);var _0x2556df=_0x4ed553['query'][_0x4490('0x75')]?0x1f4:_0x1bf1f6[_0x4490('0x76')]||0x1f4;logger[_0x4490('0x27')](_0x4490('0x77'),_0x4490('0x57'),_0x2556df,JSON['stringify'](_0x1bf1f6));delete _0x1bf1f6[_0x4490('0x29')];if(_0x2556df===0x191){_0x2556df=0x190;}_0xa52d22[_0x4490('0x1b')](_0x2556df)['send'](_0x4ed553[_0x4490('0x2f')]['test']?{'message':_0x4490('0x78'),'statusCode':_0x1bf1f6[_0x4490('0x76')]}:_0x1bf1f6);});};
\ No newline at end of file
index 3c56a16..0cad4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92dd=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x4a8c8e,_0x52362f){var _0x3846a7=function(_0x35a8ba){while(--_0x35a8ba){_0x4a8c8e['push'](_0x4a8c8e['shift']());}};_0x3846a7(++_0x52362f);}(_0x92dd,0x10b));var _0xd92d=function(_0x212bd4,_0x429dfd){_0x212bd4=_0x212bd4-0x0;var _0x2c197c=_0x92dd[_0x212bd4];return _0x2c197c;};'use strict';var _=require(_0xd92d('0x0'));var util=require(_0xd92d('0x1'));var logger=require(_0xd92d('0x2'))(_0xd92d('0x3'));var moment=require('moment');var BPromise=require(_0xd92d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd92d('0x5'));var rimraf=require(_0xd92d('0x6'));var config=require(_0xd92d('0x7'));var attributes=require(_0xd92d('0x8'));var integrations=require(_0xd92d('0x9'));module[_0xd92d('0xa')]=function(_0x339b04,_0x4b2296){return _0x339b04[_0xd92d('0xb')](_0xd92d('0xc'),attributes,{'tableName':_0xd92d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0b9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x5b0741,_0x438df7){var _0x3ee9c9=function(_0x4686d5){while(--_0x4686d5){_0x5b0741['push'](_0x5b0741['shift']());}};_0x3ee9c9(++_0x438df7);}(_0xe0b9,0x123));var _0x9e0b=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xe0b9[_0x39e283];return _0x7de89f;};'use strict';var _=require(_0x9e0b('0x0'));var util=require(_0x9e0b('0x1'));var logger=require(_0x9e0b('0x2'))('api');var moment=require(_0x9e0b('0x3'));var BPromise=require(_0x9e0b('0x4'));var rp=require(_0x9e0b('0x5'));var fs=require('fs');var path=require(_0x9e0b('0x6'));var rimraf=require(_0x9e0b('0x7'));var config=require(_0x9e0b('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9e0b('0x9'));module[_0x9e0b('0xa')]=function(_0x43e971,_0x1177b8){return _0x43e971[_0x9e0b('0xb')](_0x9e0b('0xc'),attributes,{'tableName':_0x9e0b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfd98a0..ff68113 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','GetVtigerAccount'];(function(_0x4782f9,_0x674de){var _0x433e89=function(_0x385dcd){while(--_0x385dcd){_0x4782f9['push'](_0x4782f9['shift']());}};_0x433e89(++_0x674de);}(_0xb9be,0xc5));var _0xeb9b=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xb9be[_0x207811];return _0x170d56;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')]({'raw':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6['options']['where']||null:null,'attributes':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['attributes']||null:null,'limit':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1c')]||null:null,'include':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x46df93){return{'model':db[_0x46df93[_0xeb9b('0x1f')]],'as':_0x46df93['as'],'attributes':_0x46df93[_0xeb9b('0x20')],'include':_0x46df93[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x46df93[_0xeb9b('0x1d')],function(_0x434461){return{'model':db[_0x434461['model']],'as':_0x434461['as'],'attributes':_0x434461[_0xeb9b('0x20')],'include':_0x434461['include']?_[_0xeb9b('0x1e')](_0x434461['include'],function(_0x347ec1){return{'model':db[_0x347ec1[_0xeb9b('0x1f')]],'as':_0x347ec1['as'],'attributes':_0x347ec1[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb9b('0xd')](function(_0x52f6c1){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x52f6c1));_0x3cbe3e(_0x52f6c1);})['catch'](function(_0x2a4b51){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x2a4b51['message'],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x2a4b51['message']));});});};exports[_0xeb9b('0x21')]=function(_0x4c1331){var _0x411467=this;return new Promise(function(_0x54c659,_0x27578d){return db['VtigerAccount'][_0xeb9b('0x22')]({'raw':_0x4c1331['options']?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x23')]===undefined?!![]:![]:!![],'where':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x24')]||null:null,'attributes':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x20')]||null:null,'include':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')]['include']?_[_0xeb9b('0x1e')](_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x21ecfd){return{'model':db[_0x21ecfd[_0xeb9b('0x1f')]],'as':_0x21ecfd['as'],'attributes':_0x21ecfd[_0xeb9b('0x20')],'include':_0x21ecfd[_0xeb9b('0x1d')]?_['map'](_0x21ecfd[_0xeb9b('0x1d')],function(_0x2f3179){return{'model':db[_0x2f3179[_0xeb9b('0x1f')]],'as':_0x2f3179['as'],'attributes':_0x2f3179['attributes'],'include':_0x2f3179[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x2f3179[_0xeb9b('0x1d')],function(_0xab9ad5){return{'model':db[_0xab9ad5[_0xeb9b('0x1f')]],'as':_0xab9ad5['as'],'attributes':_0xab9ad5[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d235){logger[_0xeb9b('0xe')]('ShowVtigerAccount',_0x4c1331);logger[_0xeb9b('0x10')](_0xeb9b('0x21'),_0x4c1331,JSON[_0xeb9b('0x11')](_0x24d235));_0x54c659(_0x24d235);})[_0xeb9b('0x17')](function(_0x37c678){logger[_0xeb9b('0x12')](_0xeb9b('0x21'),_0x37c678['message'],_0x4c1331);_0x27578d(_0x411467[_0xeb9b('0x12')](0x1f4,_0x37c678[_0xeb9b('0x16')]));});});};
\ No newline at end of file
+var _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowVtigerAccount','VtigerAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVtigerAccount','findAll'];(function(_0x221ccb,_0x3621b5){var _0x1917fb=function(_0x152804){while(--_0x152804){_0x221ccb['push'](_0x221ccb['shift']());}};_0x1917fb(++_0x3621b5);}(_0xe706,0xa3));var _0x6e70=function(_0x13453e,_0x409732){_0x13453e=_0x13453e-0x0;var _0x19d7ce=_0xe706[_0x13453e];return _0x19d7ce;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['VtigerAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetVtigerAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});};
\ No newline at end of file
index 5bbbb23..925869e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d2=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','post','create','put','delete','destroy','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x92d2,0x9a));var _0x292d=function(_0x21521a,_0x51309e){_0x21521a=_0x21521a-0x0;var _0x3db020=_0x92d2[_0x21521a];return _0x3db020;};'use strict';var multer=require(_0x292d('0x0'));var util=require(_0x292d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x292d('0x2'));var router=express['Router']();var fs_extra=require(_0x292d('0x3'));var auth=require(_0x292d('0x4'));var interaction=require(_0x292d('0x5'));var config=require(_0x292d('0x6'));var controller=require(_0x292d('0x7'));router[_0x292d('0x8')]('/',auth[_0x292d('0x9')](),controller[_0x292d('0xa')]);router[_0x292d('0x8')](_0x292d('0xb'),auth['isAuthenticated'](),controller[_0x292d('0xc')]);router[_0x292d('0x8')](_0x292d('0xd'),auth[_0x292d('0x9')](),controller[_0x292d('0xe')]);router[_0x292d('0x8')]('/:id/subjects',auth[_0x292d('0x9')](),controller['getSubjects']);router[_0x292d('0x8')](_0x292d('0xf'),auth[_0x292d('0x9')](),controller['getDescriptions']);router[_0x292d('0x10')]('/',auth[_0x292d('0x9')](),controller[_0x292d('0x11')]);router[_0x292d('0x12')](_0x292d('0xb'),auth[_0x292d('0x9')](),controller['update']);router[_0x292d('0x13')]('/:id',auth[_0x292d('0x9')](),controller[_0x292d('0x14')]);module[_0x292d('0x15')]=router;
\ No newline at end of file
+var _0xe569=['isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id'];(function(_0x3b9544,_0xc7b9b6){var _0x2ff080=function(_0x3d2929){while(--_0x3d2929){_0x3b9544['push'](_0x3b9544['shift']());}};_0x2ff080(++_0xc7b9b6);}(_0xe569,0x1a5));var _0x9e56=function(_0x2220d7,_0x804d20){_0x2220d7=_0x2220d7-0x0;var _0xe4a29f=_0xe569[_0x2220d7];return _0xe4a29f;};'use strict';var multer=require(_0x9e56('0x0'));var util=require(_0x9e56('0x1'));var path=require(_0x9e56('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e56('0x3')]();var fs_extra=require(_0x9e56('0x4'));var auth=require(_0x9e56('0x5'));var interaction=require(_0x9e56('0x6'));var config=require(_0x9e56('0x7'));var controller=require(_0x9e56('0x8'));router[_0x9e56('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9e56('0x9')](_0x9e56('0xa'),auth[_0x9e56('0xb')](),controller[_0x9e56('0xc')]);router['get'](_0x9e56('0xd'),auth[_0x9e56('0xb')](),controller['getFields']);router[_0x9e56('0x9')](_0x9e56('0xe'),auth[_0x9e56('0xb')](),controller[_0x9e56('0xf')]);router[_0x9e56('0x9')](_0x9e56('0x10'),auth['isAuthenticated'](),controller[_0x9e56('0x11')]);router['post']('/',auth[_0x9e56('0xb')](),controller[_0x9e56('0x12')]);router[_0x9e56('0x13')](_0x9e56('0xa'),auth[_0x9e56('0xb')](),controller[_0x9e56('0x14')]);router[_0x9e56('0x15')]('/:id',auth[_0x9e56('0xb')](),controller[_0x9e56('0x16')]);module[_0x9e56('0x17')]=router;
\ No newline at end of file
index 5253ae3..8807a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd362=['sequelize','exports','STRING'];(function(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xd362,0xf3));var _0x2d36=function(_0x5bf493,_0x3c46bf){_0x5bf493=_0x5bf493-0x0;var _0x5e69b1=_0xd362[_0x5bf493];return _0x5e69b1;};'use strict';var Sequelize=require(_0x2d36('0x0'));module[_0x2d36('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d36('0x2')]}};
\ No newline at end of file
+var _0xbfda=['exports','STRING','sequelize'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xbfda,0x14f));var _0xabfd=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0xbfda[_0x356127];return _0x5d4c75;};'use strict';var Sequelize=require(_0xabfd('0x0'));module[_0xabfd('0x1')]={'name':{'type':Sequelize[_0xabfd('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index b34ef05..bc2226f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x124a=['fields','length','hasOwnProperty','order','sort','where','filter','merge','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','findOne','VtigerField','pick','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','offset','count','set','Content-Range','reject','sendStatus','stack','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes'];(function(_0x204ed6,_0x4cb63f){var _0x4c0f1a=function(_0x53e2ef){while(--_0x53e2ef){_0x204ed6['push'](_0x204ed6['shift']());}};_0x4c0f1a(++_0x4cb63f);}(_0x124a,0x1a6));var _0xa124=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x124a[_0x3b150c];return _0x5cd414;};'use strict';var emlformat=require(_0xa124('0x0'));var rimraf=require(_0xa124('0x1'));var zipdir=require(_0xa124('0x2'));var jsonpatch=require(_0xa124('0x3'));var rp=require('request-promise');var moment=require(_0xa124('0x4'));var BPromise=require(_0xa124('0x5'));var Mustache=require(_0xa124('0x6'));var util=require(_0xa124('0x7'));var path=require('path');var sox=require(_0xa124('0x8'));var csv=require(_0xa124('0x9'));var ejs=require(_0xa124('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa124('0xb'));var squel=require(_0xa124('0xc'));var crypto=require(_0xa124('0xd'));var jsforce=require(_0xa124('0xe'));var deskjs=require(_0xa124('0xf'));var toCsv=require(_0xa124('0x9'));var querystring=require(_0xa124('0x10'));var Papa=require(_0xa124('0x11'));var Redis=require(_0xa124('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa124('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa124('0x14'));var logger=require(_0xa124('0x15'))(_0xa124('0x16'));var utils=require(_0xa124('0x17'));var config=require(_0xa124('0x18'));var licenseUtil=require(_0xa124('0x19'));var db=require(_0xa124('0x1a'))['db'];function respondWithStatusCode(_0x2bdeb8,_0x4ab646){_0x4ab646=_0x4ab646||0xcc;return function(_0x4c8300){if(_0x4c8300){return _0x2bdeb8['sendStatus'](_0x4ab646);}return _0x2bdeb8[_0xa124('0x1b')](_0x4ab646)[_0xa124('0x1c')]();};}function respondWithResult(_0x4e12ed,_0x101bb7){_0x101bb7=_0x101bb7||0xc8;return function(_0x35380d){if(_0x35380d){return _0x4e12ed[_0xa124('0x1b')](_0x101bb7)[_0xa124('0x1d')](_0x35380d);}};}function respondWithFilteredResult(_0x56c3c5,_0x1dc617){return function(_0x135de6){if(_0x135de6){var _0x5c40ab=typeof _0x1dc617['offset']==='undefined'&&typeof _0x1dc617[_0xa124('0x1e')]==='undefined';var _0x4c57b2=_0x135de6['count'];var _0x9f039a=_0x5c40ab?0x0:_0x1dc617[_0xa124('0x1f')];var _0x415b01=_0x5c40ab?_0x135de6[_0xa124('0x20')]:_0x1dc617[_0xa124('0x1f')]+_0x1dc617[_0xa124('0x1e')];var _0x259837;if(_0x415b01>=_0x4c57b2){_0x415b01=_0x4c57b2;_0x259837=0xc8;}else{_0x259837=0xce;}_0x56c3c5['status'](_0x259837);return _0x56c3c5[_0xa124('0x21')](_0xa124('0x22'),_0x9f039a+'-'+_0x415b01+'/'+_0x4c57b2)[_0xa124('0x1d')](_0x135de6);}return null;};}function patchUpdates(_0x169bc1){return function(_0x251603){try{jsonpatch['apply'](_0x251603,_0x169bc1,!![]);}catch(_0x5bd720){return BPromise[_0xa124('0x23')](_0x5bd720);}return _0x251603['save']();};}function saveUpdates(_0x52f34e,_0x29319e){return function(_0x20c5c6){if(_0x20c5c6){return _0x20c5c6['update'](_0x52f34e)['then'](function(_0x2e655b){return _0x2e655b;});}return null;};}function removeEntity(_0x364d1c,_0x5cb067){return function(_0x1d48aa){if(_0x1d48aa){return _0x1d48aa['destroy']()['then'](function(){_0x364d1c[_0xa124('0x1b')](0xcc)[_0xa124('0x1c')]();});}};}function handleEntityNotFound(_0x5b255a,_0xe2db63){return function(_0xae7092){if(!_0xae7092){_0x5b255a[_0xa124('0x24')](0x194);}return _0xae7092;};}function handleError(_0x1fcd3c,_0x31e121){_0x31e121=_0x31e121||0x1f4;return function(_0x36e2c6){logger['error'](_0x36e2c6[_0xa124('0x25')]);if(_0x36e2c6['name']){delete _0x36e2c6['name'];}_0x1fcd3c['status'](_0x31e121)[_0xa124('0x26')](_0x36e2c6);};}exports[_0xa124('0x27')]=function(_0x19ce48,_0x265e07){var _0x3a64af={},_0x1d3d30={},_0x4b15ba={'count':0x0,'rows':[]};var _0x5edbe9=_[_0xa124('0x28')](db[_0xa124('0x29')][_0xa124('0x2a')],function(_0x5a9c75){return{'name':_0x5a9c75[_0xa124('0x2b')],'type':_0x5a9c75[_0xa124('0x2c')]['key']};});_0x1d3d30[_0xa124('0x2d')]=_[_0xa124('0x28')](_0x5edbe9,_0xa124('0x2e'));_0x1d3d30[_0xa124('0x2f')]=_[_0xa124('0x30')](_0x19ce48[_0xa124('0x2f')]);_0x1d3d30[_0xa124('0x31')]=_[_0xa124('0x32')](_0x1d3d30[_0xa124('0x2d')],_0x1d3d30['query']);_0x3a64af[_0xa124('0x33')]=_['intersection'](_0x1d3d30[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x19ce48[_0xa124('0x2f')][_0xa124('0x34')]));_0x3a64af[_0xa124('0x33')]=_0x3a64af[_0xa124('0x33')][_0xa124('0x35')]?_0x3a64af[_0xa124('0x33')]:_0x1d3d30[_0xa124('0x2d')];if(!_0x19ce48[_0xa124('0x2f')][_0xa124('0x36')]('nolimit')){_0x3a64af[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0x19ce48['query']['limit']);_0x3a64af['offset']=qs[_0xa124('0x1f')](_0x19ce48['query'][_0xa124('0x1f')]);}_0x3a64af[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x19ce48[_0xa124('0x2f')][_0xa124('0x38')]);_0x3a64af[_0xa124('0x39')]=qs[_0xa124('0x31')](_['pick'](_0x19ce48[_0xa124('0x2f')],_0x1d3d30[_0xa124('0x31')]),_0x5edbe9);if(_0x19ce48['query'][_0xa124('0x3a')]){_0x3a64af[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x3a64af[_0xa124('0x39')],{'$or':_['map'](_0x5edbe9,function(_0x234a80){if(_0x234a80[_0xa124('0x2c')]!=='VIRTUAL'){var _0x1f8f23={};_0x1f8f23[_0x234a80[_0xa124('0x2e')]]={'$like':'%'+_0x19ce48[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x1f8f23;}})});}_0x3a64af=_[_0xa124('0x3b')]({},_0x3a64af,_0x19ce48['options']);var _0x536996={'where':_0x3a64af[_0xa124('0x39')]};return db[_0xa124('0x29')]['count'](_0x536996)[_0xa124('0x3c')](function(_0x4fcc95){_0x4b15ba['count']=_0x4fcc95;if(_0x19ce48[_0xa124('0x2f')][_0xa124('0x3d')]){_0x3a64af[_0xa124('0x3e')]=[{'all':!![]}];}return db[_0xa124('0x29')][_0xa124('0x3f')](_0x3a64af);})[_0xa124('0x3c')](function(_0x1579aa){_0x4b15ba[_0xa124('0x40')]=_0x1579aa;return _0x4b15ba;})[_0xa124('0x3c')](respondWithFilteredResult(_0x265e07,_0x3a64af))['catch'](handleError(_0x265e07,null));};exports[_0xa124('0x41')]=function(_0x3ad8c9,_0x1ec81f){var _0x334e76={'raw':![],'where':{'id':_0x3ad8c9[_0xa124('0x42')]['id']}},_0x5ad377={};_0x5ad377[_0xa124('0x2d')]=_[_0xa124('0x30')](db[_0xa124('0x29')][_0xa124('0x2a')]);_0x5ad377[_0xa124('0x2f')]=_[_0xa124('0x30')](_0x3ad8c9[_0xa124('0x2f')]);_0x5ad377[_0xa124('0x31')]=_[_0xa124('0x32')](_0x5ad377['model'],_0x5ad377[_0xa124('0x2f')]);_0x334e76[_0xa124('0x33')]=_[_0xa124('0x32')](_0x5ad377[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x3ad8c9[_0xa124('0x2f')]['fields']));_0x334e76[_0xa124('0x33')]=_0x334e76[_0xa124('0x33')][_0xa124('0x35')]?_0x334e76['attributes']:_0x5ad377['model'];if(_0x3ad8c9[_0xa124('0x2f')][_0xa124('0x3d')]){_0x334e76['include']=[{'all':!![]}];}_0x334e76=_['merge']({},_0x334e76,_0x3ad8c9[_0xa124('0x43')]);return db[_0xa124('0x29')]['find'](_0x334e76)['then'](handleEntityNotFound(_0x1ec81f,null))[_0xa124('0x3c')](respondWithResult(_0x1ec81f,null))[_0xa124('0x44')](handleError(_0x1ec81f,null));};exports[_0xa124('0x45')]=function(_0x3327e3,_0x44432c){return db['VtigerConfiguration']['create'](_0x3327e3[_0xa124('0x46')],{})['then'](respondWithResult(_0x44432c,0xc9))[_0xa124('0x44')](handleError(_0x44432c,null));};exports['update']=function(_0x4cf464,_0x39a594){if(_0x4cf464[_0xa124('0x46')]['id']){delete _0x4cf464[_0xa124('0x46')]['id'];}return db[_0xa124('0x29')][_0xa124('0x47')]({'where':{'id':_0x4cf464[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x39a594,null))[_0xa124('0x3c')](saveUpdates(_0x4cf464[_0xa124('0x46')],null))[_0xa124('0x3c')](respondWithResult(_0x39a594,null))[_0xa124('0x44')](handleError(_0x39a594,null));};exports['destroy']=function(_0x3b54b4,_0x4b8e97){return db['VtigerConfiguration'][_0xa124('0x47')]({'where':{'id':_0x3b54b4['params']['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x4b8e97,null))[_0xa124('0x3c')](removeEntity(_0x4b8e97,null))[_0xa124('0x44')](handleError(_0x4b8e97,null));};exports['getFields']=function(_0xcab365,_0x339569,_0x3b8d82){var _0x5519d3={};var _0x1eb90e={};var _0x38c557;var _0x1bd006;return db[_0xa124('0x29')][_0xa124('0x48')]({'where':{'id':_0xcab365['params']['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x339569,null))[_0xa124('0x3c')](function(_0x4bf607){if(_0x4bf607){_0x38c557=_0x4bf607;_0x1eb90e[_0xa124('0x2d')]=_[_0xa124('0x30')](db[_0xa124('0x49')]['rawAttributes']);_0x1eb90e[_0xa124('0x2f')]=_['keys'](_0xcab365[_0xa124('0x2f')]);_0x1eb90e['filters']=_[_0xa124('0x32')](_0x1eb90e[_0xa124('0x2d')],_0x1eb90e[_0xa124('0x2f')]);_0x5519d3[_0xa124('0x33')]=_[_0xa124('0x32')](_0x1eb90e['model'],qs[_0xa124('0x34')](_0xcab365['query'][_0xa124('0x34')]));_0x5519d3[_0xa124('0x33')]=_0x5519d3[_0xa124('0x33')][_0xa124('0x35')]?_0x5519d3[_0xa124('0x33')]:_0x1eb90e[_0xa124('0x2d')];_0x5519d3[_0xa124('0x37')]=qs[_0xa124('0x38')](_0xcab365[_0xa124('0x2f')][_0xa124('0x38')]);_0x5519d3[_0xa124('0x39')]=qs[_0xa124('0x31')](_[_0xa124('0x4a')](_0xcab365[_0xa124('0x2f')],_0x1eb90e['filters']));if(_0xcab365[_0xa124('0x2f')]['filter']){_0x5519d3[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x5519d3[_0xa124('0x39')],{'$or':_[_0xa124('0x28')](_0x5519d3[_0xa124('0x33')],function(_0x133650){var _0x12d952={};_0x12d952[_0x133650]={'$like':'%'+_0xcab365[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x12d952;})});}_0x5519d3=_[_0xa124('0x3b')]({},_0x5519d3,_0xcab365[_0xa124('0x43')]);return _0x38c557[_0xa124('0x4b')](_0x5519d3);}})['then'](function(_0x4a0fd7){if(_0x4a0fd7){_0x1bd006=_0x4a0fd7[_0xa124('0x35')];if(!_0xcab365[_0xa124('0x2f')]['hasOwnProperty'](_0xa124('0x4c'))){_0x5519d3[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0xcab365['query'][_0xa124('0x1e')]);_0x5519d3[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0xcab365[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x38c557['getFields'](_0x5519d3);}})[_0xa124('0x3c')](function(_0xe97116){if(_0xe97116){return _0xe97116?{'count':_0x1bd006,'rows':_0xe97116}:null;}})[_0xa124('0x3c')](respondWithResult(_0x339569,null))['catch'](handleError(_0x339569,null));};exports[_0xa124('0x4d')]=function(_0x144b66,_0x5b4466,_0x100ff0){var _0x2f43f4={};var _0x3540fe={};var _0x3ac944;var _0x578802;return db[_0xa124('0x29')][_0xa124('0x48')]({'where':{'id':_0x144b66[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x5b4466,null))['then'](function(_0x4219b8){if(_0x4219b8){_0x3ac944=_0x4219b8;_0x3540fe[_0xa124('0x2d')]=_['keys'](db[_0xa124('0x49')][_0xa124('0x2a')]);_0x3540fe['query']=_['keys'](_0x144b66['query']);_0x3540fe[_0xa124('0x31')]=_['intersection'](_0x3540fe[_0xa124('0x2d')],_0x3540fe[_0xa124('0x2f')]);_0x2f43f4[_0xa124('0x33')]=_[_0xa124('0x32')](_0x3540fe[_0xa124('0x2d')],qs[_0xa124('0x34')](_0x144b66[_0xa124('0x2f')][_0xa124('0x34')]));_0x2f43f4[_0xa124('0x33')]=_0x2f43f4[_0xa124('0x33')]['length']?_0x2f43f4[_0xa124('0x33')]:_0x3540fe[_0xa124('0x2d')];_0x2f43f4[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x144b66[_0xa124('0x2f')]['sort']);_0x2f43f4['where']=qs[_0xa124('0x31')](_[_0xa124('0x4a')](_0x144b66[_0xa124('0x2f')],_0x3540fe[_0xa124('0x31')]));if(_0x144b66['query'][_0xa124('0x3a')]){_0x2f43f4[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x2f43f4[_0xa124('0x39')],{'$or':_[_0xa124('0x28')](_0x2f43f4[_0xa124('0x33')],function(_0x30b489){var _0x4db605={};_0x4db605[_0x30b489]={'$like':'%'+_0x144b66['query']['filter']+'%'};return _0x4db605;})});}_0x2f43f4=_['merge']({},_0x2f43f4,_0x144b66[_0xa124('0x43')]);return _0x3ac944[_0xa124('0x4d')](_0x2f43f4);}})[_0xa124('0x3c')](function(_0x4c4d05){if(_0x4c4d05){_0x578802=_0x4c4d05[_0xa124('0x35')];if(!_0x144b66['query'][_0xa124('0x36')](_0xa124('0x4c'))){_0x2f43f4['limit']=qs['limit'](_0x144b66[_0xa124('0x2f')][_0xa124('0x1e')]);_0x2f43f4[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0x144b66[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x3ac944[_0xa124('0x4d')](_0x2f43f4);}})[_0xa124('0x3c')](function(_0x1c3bf2){if(_0x1c3bf2){return _0x1c3bf2?{'count':_0x578802,'rows':_0x1c3bf2}:null;}})[_0xa124('0x3c')](respondWithResult(_0x5b4466,null))[_0xa124('0x44')](handleError(_0x5b4466,null));};exports[_0xa124('0x4e')]=function(_0x1d05b3,_0x373d55,_0x187763){var _0x24eb3b={};var _0x59ec1c={};var _0x2c7173;var _0x1130f0;return db['VtigerConfiguration'][_0xa124('0x48')]({'where':{'id':_0x1d05b3[_0xa124('0x42')]['id']}})[_0xa124('0x3c')](handleEntityNotFound(_0x373d55,null))[_0xa124('0x3c')](function(_0x563bf2){if(_0x563bf2){_0x2c7173=_0x563bf2;_0x59ec1c['model']=_['keys'](db[_0xa124('0x49')]['rawAttributes']);_0x59ec1c[_0xa124('0x2f')]=_['keys'](_0x1d05b3[_0xa124('0x2f')]);_0x59ec1c[_0xa124('0x31')]=_[_0xa124('0x32')](_0x59ec1c['model'],_0x59ec1c[_0xa124('0x2f')]);_0x24eb3b[_0xa124('0x33')]=_['intersection'](_0x59ec1c['model'],qs[_0xa124('0x34')](_0x1d05b3[_0xa124('0x2f')][_0xa124('0x34')]));_0x24eb3b[_0xa124('0x33')]=_0x24eb3b[_0xa124('0x33')][_0xa124('0x35')]?_0x24eb3b[_0xa124('0x33')]:_0x59ec1c[_0xa124('0x2d')];_0x24eb3b[_0xa124('0x37')]=qs[_0xa124('0x38')](_0x1d05b3['query'][_0xa124('0x38')]);_0x24eb3b[_0xa124('0x39')]=qs['filters'](_['pick'](_0x1d05b3['query'],_0x59ec1c[_0xa124('0x31')]));if(_0x1d05b3[_0xa124('0x2f')]['filter']){_0x24eb3b[_0xa124('0x39')]=_[_0xa124('0x3b')](_0x24eb3b['where'],{'$or':_[_0xa124('0x28')](_0x24eb3b[_0xa124('0x33')],function(_0x20f799){var _0x265633={};_0x265633[_0x20f799]={'$like':'%'+_0x1d05b3[_0xa124('0x2f')][_0xa124('0x3a')]+'%'};return _0x265633;})});}_0x24eb3b=_[_0xa124('0x3b')]({},_0x24eb3b,_0x1d05b3[_0xa124('0x43')]);return _0x2c7173[_0xa124('0x4e')](_0x24eb3b);}})[_0xa124('0x3c')](function(_0xdf55a){if(_0xdf55a){_0x1130f0=_0xdf55a[_0xa124('0x35')];if(!_0x1d05b3[_0xa124('0x2f')]['hasOwnProperty'](_0xa124('0x4c'))){_0x24eb3b[_0xa124('0x1e')]=qs[_0xa124('0x1e')](_0x1d05b3['query'][_0xa124('0x1e')]);_0x24eb3b[_0xa124('0x1f')]=qs[_0xa124('0x1f')](_0x1d05b3[_0xa124('0x2f')][_0xa124('0x1f')]);}return _0x2c7173[_0xa124('0x4e')](_0x24eb3b);}})[_0xa124('0x3c')](function(_0x37249f){if(_0x37249f){return _0x37249f?{'count':_0x1130f0,'rows':_0x37249f}:null;}})['then'](respondWithResult(_0x373d55,null))[_0xa124('0x44')](handleError(_0x373d55,null));};
\ No newline at end of file
+var _0x599f=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','VtigerConfiguration','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x599f,0x74));var _0xf599=function(_0x114f1b,_0x1ece8a){_0x114f1b=_0x114f1b-0x0;var _0x1aa5e6=_0x599f[_0x114f1b];return _0x1aa5e6;};'use strict';var emlformat=require(_0xf599('0x0'));var rimraf=require(_0xf599('0x1'));var zipdir=require(_0xf599('0x2'));var jsonpatch=require(_0xf599('0x3'));var rp=require(_0xf599('0x4'));var moment=require(_0xf599('0x5'));var BPromise=require(_0xf599('0x6'));var Mustache=require(_0xf599('0x7'));var util=require(_0xf599('0x8'));var path=require(_0xf599('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf599('0xa'));var _=require('lodash');var squel=require(_0xf599('0xb'));var crypto=require(_0xf599('0xc'));var jsforce=require(_0xf599('0xd'));var deskjs=require(_0xf599('0xe'));var toCsv=require(_0xf599('0xf'));var querystring=require(_0xf599('0x10'));var Papa=require(_0xf599('0x11'));var Redis=require(_0xf599('0x12'));var authService=require(_0xf599('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf599('0x14'));var hardwareService=require(_0xf599('0x15'));var logger=require(_0xf599('0x16'))(_0xf599('0x17'));var utils=require(_0xf599('0x18'));var config=require(_0xf599('0x19'));var licenseUtil=require(_0xf599('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34da5c,_0x5644e0){_0x5644e0=_0x5644e0||0xcc;return function(_0x4e2742){if(_0x4e2742){return _0x34da5c['sendStatus'](_0x5644e0);}return _0x34da5c['status'](_0x5644e0)[_0xf599('0x1b')]();};}function respondWithResult(_0x195941,_0x308030){_0x308030=_0x308030||0xc8;return function(_0x5387b3){if(_0x5387b3){return _0x195941['status'](_0x308030)[_0xf599('0x1c')](_0x5387b3);}};}function respondWithFilteredResult(_0x58f810,_0x5d5bc8){return function(_0x1e4124){if(_0x1e4124){var _0x1ead22=typeof _0x5d5bc8['offset']===_0xf599('0x1d')&&typeof _0x5d5bc8[_0xf599('0x1e')]===_0xf599('0x1d');var _0x32865c=_0x1e4124[_0xf599('0x1f')];var _0x21e126=_0x1ead22?0x0:_0x5d5bc8[_0xf599('0x20')];var _0xd1e773=_0x1ead22?_0x1e4124[_0xf599('0x1f')]:_0x5d5bc8['offset']+_0x5d5bc8['limit'];var _0x5724a2;if(_0xd1e773>=_0x32865c){_0xd1e773=_0x32865c;_0x5724a2=0xc8;}else{_0x5724a2=0xce;}_0x58f810[_0xf599('0x21')](_0x5724a2);return _0x58f810[_0xf599('0x22')](_0xf599('0x23'),_0x21e126+'-'+_0xd1e773+'/'+_0x32865c)[_0xf599('0x1c')](_0x1e4124);}return null;};}function patchUpdates(_0x821d48){return function(_0x35c489){try{jsonpatch['apply'](_0x35c489,_0x821d48,!![]);}catch(_0x38e60e){return BPromise[_0xf599('0x24')](_0x38e60e);}return _0x35c489['save']();};}function saveUpdates(_0x4697b5,_0x5f1691){return function(_0x1cd2ee){if(_0x1cd2ee){return _0x1cd2ee[_0xf599('0x25')](_0x4697b5)[_0xf599('0x26')](function(_0x695ebd){return _0x695ebd;});}return null;};}function removeEntity(_0x480641,_0x86866f){return function(_0x55be77){if(_0x55be77){return _0x55be77[_0xf599('0x27')]()['then'](function(){_0x480641[_0xf599('0x21')](0xcc)[_0xf599('0x1b')]();});}};}function handleEntityNotFound(_0x2578e4,_0x37cbc0){return function(_0x5dce55){if(!_0x5dce55){_0x2578e4[_0xf599('0x28')](0x194);}return _0x5dce55;};}function handleError(_0x4f44fd,_0x3329d9){_0x3329d9=_0x3329d9||0x1f4;return function(_0x4c652e){logger[_0xf599('0x29')](_0x4c652e[_0xf599('0x2a')]);if(_0x4c652e[_0xf599('0x2b')]){delete _0x4c652e['name'];}_0x4f44fd[_0xf599('0x21')](_0x3329d9)[_0xf599('0x2c')](_0x4c652e);};}exports['index']=function(_0x29eb12,_0x12fac9){var _0x4b1bdf={},_0x228c23={},_0x4ea078={'count':0x0,'rows':[]};var _0x2165a4=_[_0xf599('0x2d')](db[_0xf599('0x2e')]['rawAttributes'],function(_0x19199d){return{'name':_0x19199d['fieldName'],'type':_0x19199d['type'][_0xf599('0x2f')]};});_0x228c23[_0xf599('0x30')]=_[_0xf599('0x2d')](_0x2165a4,_0xf599('0x2b'));_0x228c23[_0xf599('0x31')]=_[_0xf599('0x32')](_0x29eb12['query']);_0x228c23[_0xf599('0x33')]=_[_0xf599('0x34')](_0x228c23[_0xf599('0x30')],_0x228c23[_0xf599('0x31')]);_0x4b1bdf[_0xf599('0x35')]=_[_0xf599('0x34')](_0x228c23[_0xf599('0x30')],qs[_0xf599('0x36')](_0x29eb12['query'][_0xf599('0x36')]));_0x4b1bdf[_0xf599('0x35')]=_0x4b1bdf[_0xf599('0x35')][_0xf599('0x37')]?_0x4b1bdf[_0xf599('0x35')]:_0x228c23[_0xf599('0x30')];if(!_0x29eb12['query'][_0xf599('0x38')](_0xf599('0x39'))){_0x4b1bdf[_0xf599('0x1e')]=qs[_0xf599('0x1e')](_0x29eb12['query']['limit']);_0x4b1bdf['offset']=qs['offset'](_0x29eb12[_0xf599('0x31')][_0xf599('0x20')]);}_0x4b1bdf[_0xf599('0x3a')]=qs[_0xf599('0x3b')](_0x29eb12[_0xf599('0x31')][_0xf599('0x3b')]);_0x4b1bdf[_0xf599('0x3c')]=qs['filters'](_[_0xf599('0x3d')](_0x29eb12[_0xf599('0x31')],_0x228c23['filters']),_0x2165a4);if(_0x29eb12['query'][_0xf599('0x3e')]){_0x4b1bdf[_0xf599('0x3c')]=_[_0xf599('0x3f')](_0x4b1bdf[_0xf599('0x3c')],{'$or':_[_0xf599('0x2d')](_0x2165a4,function(_0x2564ae){if(_0x2564ae[_0xf599('0x40')]!==_0xf599('0x41')){var _0x58f4df={};_0x58f4df[_0x2564ae[_0xf599('0x2b')]]={'$like':'%'+_0x29eb12['query']['filter']+'%'};return _0x58f4df;}})});}_0x4b1bdf=_[_0xf599('0x3f')]({},_0x4b1bdf,_0x29eb12[_0xf599('0x42')]);var _0x44e109={'where':_0x4b1bdf[_0xf599('0x3c')]};return db[_0xf599('0x2e')][_0xf599('0x1f')](_0x44e109)[_0xf599('0x26')](function(_0x42e1fc){_0x4ea078[_0xf599('0x1f')]=_0x42e1fc;if(_0x29eb12[_0xf599('0x31')][_0xf599('0x43')]){_0x4b1bdf[_0xf599('0x44')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xf599('0x45')](_0x4b1bdf);})[_0xf599('0x26')](function(_0x1f9d71){_0x4ea078[_0xf599('0x46')]=_0x1f9d71;return _0x4ea078;})[_0xf599('0x26')](respondWithFilteredResult(_0x12fac9,_0x4b1bdf))[_0xf599('0x47')](handleError(_0x12fac9,null));};exports[_0xf599('0x48')]=function(_0x2535a6,_0x39fb23){var _0x5889e4={'raw':![],'where':{'id':_0x2535a6['params']['id']}},_0x1d7891={};_0x1d7891[_0xf599('0x30')]=_['keys'](db[_0xf599('0x2e')][_0xf599('0x49')]);_0x1d7891[_0xf599('0x31')]=_['keys'](_0x2535a6[_0xf599('0x31')]);_0x1d7891[_0xf599('0x33')]=_[_0xf599('0x34')](_0x1d7891[_0xf599('0x30')],_0x1d7891['query']);_0x5889e4[_0xf599('0x35')]=_['intersection'](_0x1d7891[_0xf599('0x30')],qs[_0xf599('0x36')](_0x2535a6[_0xf599('0x31')][_0xf599('0x36')]));_0x5889e4['attributes']=_0x5889e4[_0xf599('0x35')][_0xf599('0x37')]?_0x5889e4[_0xf599('0x35')]:_0x1d7891['model'];if(_0x2535a6['query'][_0xf599('0x43')]){_0x5889e4[_0xf599('0x44')]=[{'all':!![]}];}_0x5889e4=_[_0xf599('0x3f')]({},_0x5889e4,_0x2535a6['options']);return db['VtigerConfiguration'][_0xf599('0x4a')](_0x5889e4)[_0xf599('0x26')](handleEntityNotFound(_0x39fb23,null))['then'](respondWithResult(_0x39fb23,null))[_0xf599('0x47')](handleError(_0x39fb23,null));};exports[_0xf599('0x4b')]=function(_0x5317b8,_0x47541e){return db['VtigerConfiguration'][_0xf599('0x4b')](_0x5317b8['body'],{})['then'](respondWithResult(_0x47541e,0xc9))[_0xf599('0x47')](handleError(_0x47541e,null));};exports[_0xf599('0x25')]=function(_0x44505a,_0x26bd39){if(_0x44505a[_0xf599('0x4c')]['id']){delete _0x44505a[_0xf599('0x4c')]['id'];}return db[_0xf599('0x2e')][_0xf599('0x4a')]({'where':{'id':_0x44505a[_0xf599('0x4d')]['id']}})[_0xf599('0x26')](handleEntityNotFound(_0x26bd39,null))[_0xf599('0x26')](saveUpdates(_0x44505a[_0xf599('0x4c')],null))[_0xf599('0x26')](respondWithResult(_0x26bd39,null))[_0xf599('0x47')](handleError(_0x26bd39,null));};exports[_0xf599('0x27')]=function(_0xf3438e,_0x157611){return db[_0xf599('0x2e')][_0xf599('0x4a')]({'where':{'id':_0xf3438e[_0xf599('0x4d')]['id']}})[_0xf599('0x26')](handleEntityNotFound(_0x157611,null))[_0xf599('0x26')](removeEntity(_0x157611,null))['catch'](handleError(_0x157611,null));};exports[_0xf599('0x4e')]=function(_0x4b741c,_0x27f976,_0x2bdf52){var _0x3d302f={};var _0x536e9e={};var _0x4f99c6;var _0x5735c2;return db[_0xf599('0x2e')][_0xf599('0x4f')]({'where':{'id':_0x4b741c[_0xf599('0x4d')]['id']}})['then'](handleEntityNotFound(_0x27f976,null))[_0xf599('0x26')](function(_0x39fb48){if(_0x39fb48){_0x4f99c6=_0x39fb48;_0x536e9e[_0xf599('0x30')]=_[_0xf599('0x32')](db[_0xf599('0x50')][_0xf599('0x49')]);_0x536e9e[_0xf599('0x31')]=_[_0xf599('0x32')](_0x4b741c[_0xf599('0x31')]);_0x536e9e[_0xf599('0x33')]=_['intersection'](_0x536e9e[_0xf599('0x30')],_0x536e9e[_0xf599('0x31')]);_0x3d302f['attributes']=_[_0xf599('0x34')](_0x536e9e[_0xf599('0x30')],qs[_0xf599('0x36')](_0x4b741c['query'][_0xf599('0x36')]));_0x3d302f[_0xf599('0x35')]=_0x3d302f[_0xf599('0x35')][_0xf599('0x37')]?_0x3d302f[_0xf599('0x35')]:_0x536e9e[_0xf599('0x30')];_0x3d302f[_0xf599('0x3a')]=qs[_0xf599('0x3b')](_0x4b741c[_0xf599('0x31')][_0xf599('0x3b')]);_0x3d302f[_0xf599('0x3c')]=qs['filters'](_[_0xf599('0x3d')](_0x4b741c[_0xf599('0x31')],_0x536e9e[_0xf599('0x33')]));if(_0x4b741c['query'][_0xf599('0x3e')]){_0x3d302f['where']=_['merge'](_0x3d302f[_0xf599('0x3c')],{'$or':_[_0xf599('0x2d')](_0x3d302f[_0xf599('0x35')],function(_0x5e4181){var _0x2ba940={};_0x2ba940[_0x5e4181]={'$like':'%'+_0x4b741c[_0xf599('0x31')][_0xf599('0x3e')]+'%'};return _0x2ba940;})});}_0x3d302f=_[_0xf599('0x3f')]({},_0x3d302f,_0x4b741c[_0xf599('0x42')]);return _0x4f99c6[_0xf599('0x4e')](_0x3d302f);}})[_0xf599('0x26')](function(_0x498a10){if(_0x498a10){_0x5735c2=_0x498a10[_0xf599('0x37')];if(!_0x4b741c['query'][_0xf599('0x38')](_0xf599('0x39'))){_0x3d302f[_0xf599('0x1e')]=qs['limit'](_0x4b741c[_0xf599('0x31')][_0xf599('0x1e')]);_0x3d302f[_0xf599('0x20')]=qs['offset'](_0x4b741c[_0xf599('0x31')][_0xf599('0x20')]);}return _0x4f99c6[_0xf599('0x4e')](_0x3d302f);}})[_0xf599('0x26')](function(_0x1081f1){if(_0x1081f1){return _0x1081f1?{'count':_0x5735c2,'rows':_0x1081f1}:null;}})[_0xf599('0x26')](respondWithResult(_0x27f976,null))[_0xf599('0x47')](handleError(_0x27f976,null));};exports[_0xf599('0x51')]=function(_0x23f257,_0x79c5a9,_0x10c847){var _0x3c8dda={};var _0x45b536={};var _0x290dca;var _0x488ac0;return db['VtigerConfiguration'][_0xf599('0x4f')]({'where':{'id':_0x23f257['params']['id']}})['then'](handleEntityNotFound(_0x79c5a9,null))['then'](function(_0x200004){if(_0x200004){_0x290dca=_0x200004;_0x45b536[_0xf599('0x30')]=_[_0xf599('0x32')](db[_0xf599('0x50')][_0xf599('0x49')]);_0x45b536[_0xf599('0x31')]=_[_0xf599('0x32')](_0x23f257[_0xf599('0x31')]);_0x45b536[_0xf599('0x33')]=_['intersection'](_0x45b536[_0xf599('0x30')],_0x45b536[_0xf599('0x31')]);_0x3c8dda[_0xf599('0x35')]=_['intersection'](_0x45b536[_0xf599('0x30')],qs['fields'](_0x23f257[_0xf599('0x31')]['fields']));_0x3c8dda[_0xf599('0x35')]=_0x3c8dda['attributes']['length']?_0x3c8dda['attributes']:_0x45b536['model'];_0x3c8dda['order']=qs[_0xf599('0x3b')](_0x23f257['query']['sort']);_0x3c8dda[_0xf599('0x3c')]=qs[_0xf599('0x33')](_[_0xf599('0x3d')](_0x23f257[_0xf599('0x31')],_0x45b536[_0xf599('0x33')]));if(_0x23f257[_0xf599('0x31')][_0xf599('0x3e')]){_0x3c8dda[_0xf599('0x3c')]=_[_0xf599('0x3f')](_0x3c8dda[_0xf599('0x3c')],{'$or':_[_0xf599('0x2d')](_0x3c8dda['attributes'],function(_0x17c5d8){var _0x176c54={};_0x176c54[_0x17c5d8]={'$like':'%'+_0x23f257[_0xf599('0x31')]['filter']+'%'};return _0x176c54;})});}_0x3c8dda=_[_0xf599('0x3f')]({},_0x3c8dda,_0x23f257[_0xf599('0x42')]);return _0x290dca['getSubjects'](_0x3c8dda);}})['then'](function(_0x55a217){if(_0x55a217){_0x488ac0=_0x55a217['length'];if(!_0x23f257['query'][_0xf599('0x38')](_0xf599('0x39'))){_0x3c8dda[_0xf599('0x1e')]=qs['limit'](_0x23f257['query'][_0xf599('0x1e')]);_0x3c8dda[_0xf599('0x20')]=qs[_0xf599('0x20')](_0x23f257[_0xf599('0x31')][_0xf599('0x20')]);}return _0x290dca[_0xf599('0x51')](_0x3c8dda);}})[_0xf599('0x26')](function(_0x4c79ec){if(_0x4c79ec){return _0x4c79ec?{'count':_0x488ac0,'rows':_0x4c79ec}:null;}})[_0xf599('0x26')](respondWithResult(_0x79c5a9,null))['catch'](handleError(_0x79c5a9,null));};exports[_0xf599('0x52')]=function(_0x3b2bc8,_0x3cdaca,_0x1de168){var _0x3e18c0={};var _0x1cc5f1={};var _0x15b951;var _0x14086;return db[_0xf599('0x2e')][_0xf599('0x4f')]({'where':{'id':_0x3b2bc8[_0xf599('0x4d')]['id']}})[_0xf599('0x26')](handleEntityNotFound(_0x3cdaca,null))[_0xf599('0x26')](function(_0x515a07){if(_0x515a07){_0x15b951=_0x515a07;_0x1cc5f1[_0xf599('0x30')]=_[_0xf599('0x32')](db[_0xf599('0x50')][_0xf599('0x49')]);_0x1cc5f1[_0xf599('0x31')]=_[_0xf599('0x32')](_0x3b2bc8['query']);_0x1cc5f1[_0xf599('0x33')]=_['intersection'](_0x1cc5f1[_0xf599('0x30')],_0x1cc5f1[_0xf599('0x31')]);_0x3e18c0[_0xf599('0x35')]=_['intersection'](_0x1cc5f1[_0xf599('0x30')],qs[_0xf599('0x36')](_0x3b2bc8['query']['fields']));_0x3e18c0[_0xf599('0x35')]=_0x3e18c0['attributes']['length']?_0x3e18c0[_0xf599('0x35')]:_0x1cc5f1['model'];_0x3e18c0['order']=qs['sort'](_0x3b2bc8[_0xf599('0x31')][_0xf599('0x3b')]);_0x3e18c0[_0xf599('0x3c')]=qs['filters'](_[_0xf599('0x3d')](_0x3b2bc8['query'],_0x1cc5f1[_0xf599('0x33')]));if(_0x3b2bc8[_0xf599('0x31')][_0xf599('0x3e')]){_0x3e18c0[_0xf599('0x3c')]=_[_0xf599('0x3f')](_0x3e18c0[_0xf599('0x3c')],{'$or':_[_0xf599('0x2d')](_0x3e18c0[_0xf599('0x35')],function(_0x45f42a){var _0x112565={};_0x112565[_0x45f42a]={'$like':'%'+_0x3b2bc8[_0xf599('0x31')][_0xf599('0x3e')]+'%'};return _0x112565;})});}_0x3e18c0=_[_0xf599('0x3f')]({},_0x3e18c0,_0x3b2bc8[_0xf599('0x42')]);return _0x15b951[_0xf599('0x52')](_0x3e18c0);}})[_0xf599('0x26')](function(_0x20d5e4){if(_0x20d5e4){_0x14086=_0x20d5e4[_0xf599('0x37')];if(!_0x3b2bc8[_0xf599('0x31')][_0xf599('0x38')](_0xf599('0x39'))){_0x3e18c0[_0xf599('0x1e')]=qs[_0xf599('0x1e')](_0x3b2bc8[_0xf599('0x31')][_0xf599('0x1e')]);_0x3e18c0[_0xf599('0x20')]=qs[_0xf599('0x20')](_0x3b2bc8[_0xf599('0x31')][_0xf599('0x20')]);}return _0x15b951[_0xf599('0x52')](_0x3e18c0);}})[_0xf599('0x26')](function(_0x5dbb14){if(_0x5dbb14){return _0x5dbb14?{'count':_0x14086,'rows':_0x5dbb14}:null;}})[_0xf599('0x26')](respondWithResult(_0x3cdaca,null))[_0xf599('0x47')](handleError(_0x3cdaca,null));};
\ No newline at end of file
index 95f7d19..24c1df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d80=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash'];(function(_0x186d1c,_0x5d29e2){var _0x5ca1a1=function(_0x5b3cf2){while(--_0x5b3cf2){_0x186d1c['push'](_0x186d1c['shift']());}};_0x5ca1a1(++_0x5d29e2);}(_0x1d80,0x1af));var _0x01d8=function(_0x271bf7,_0x317f07){_0x271bf7=_0x271bf7-0x0;var _0x153266=_0x1d80[_0x271bf7];return _0x153266;};'use strict';var _=require(_0x01d8('0x0'));var util=require(_0x01d8('0x1'));var logger=require('../../config/logger')(_0x01d8('0x2'));var moment=require(_0x01d8('0x3'));var BPromise=require(_0x01d8('0x4'));var rp=require(_0x01d8('0x5'));var fs=require('fs');var path=require(_0x01d8('0x6'));var rimraf=require(_0x01d8('0x7'));var config=require(_0x01d8('0x8'));var attributes=require(_0x01d8('0x9'));module[_0x01d8('0xa')]=function(_0x254401,_0x51fea1){return _0x254401['define'](_0x01d8('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x950e=['request-promise','path','../../config/environment','define','int_vtiger_configurations','../../config/logger','api','moment'];(function(_0x7b7f5f,_0x2d472b){var _0x35e97f=function(_0x1b7300){while(--_0x1b7300){_0x7b7f5f['push'](_0x7b7f5f['shift']());}};_0x35e97f(++_0x2d472b);}(_0x950e,0x1a5));var _0xe950=function(_0x214185,_0x2d96bf){_0x214185=_0x214185-0x0;var _0x34abeb=_0x950e[_0x214185];return _0x34abeb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe950('0x0'))(_0xe950('0x1'));var moment=require(_0xe950('0x2'));var BPromise=require('bluebird');var rp=require(_0xe950('0x3'));var fs=require('fs');var path=require(_0xe950('0x4'));var rimraf=require('rimraf');var config=require(_0xe950('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0xa85fb5,_0x1aae16){return _0xa85fb5[_0xe950('0x6')]('VtigerConfiguration',attributes,{'tableName':_0xe950('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 136097d..7af107f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf76c=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bb476,_0x495043){var _0x1a548d=function(_0x1655ff){while(--_0x1655ff){_0x2bb476['push'](_0x2bb476['shift']());}};_0x1a548d(++_0x495043);}(_0xf76c,0x1b9));var _0xcf76=function(_0x320e94,_0x4140b1){_0x320e94=_0x320e94-0x0;var _0x1002be=_0xf76c[_0x320e94];return _0x1002be;};'use strict';var _=require(_0xcf76('0x0'));var util=require('util');var moment=require(_0xcf76('0x1'));var BPromise=require(_0xcf76('0x2'));var rs=require(_0xcf76('0x3'));var fs=require('fs');var Redis=require(_0xcf76('0x4'));var db=require(_0xcf76('0x5'))['db'];var utils=require(_0xcf76('0x6'));var logger=require(_0xcf76('0x7'))(_0xcf76('0x8'));var config=require(_0xcf76('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e1a8,_0x5517ad,_0x2e9b86){return new BPromise(function(_0x38f1b7,_0x5698d6){return client[_0xcf76('0xb')](_0x32e1a8,_0x2e9b86)[_0xcf76('0xc')](function(_0x317549){logger[_0xcf76('0xd')](_0xcf76('0xe'),_0x5517ad,_0xcf76('0xf'));logger['debug'](_0xcf76('0x10'),_0x5517ad,_0xcf76('0xf'),JSON[_0xcf76('0x11')](_0x317549));if(_0x317549[_0xcf76('0x12')]){if(_0x317549[_0xcf76('0x12')][_0xcf76('0x13')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x5517ad,_0x317549[_0xcf76('0x12')][_0xcf76('0x14')]);return _0x5698d6(_0x317549[_0xcf76('0x12')][_0xcf76('0x14')]);}logger[_0xcf76('0x12')](_0xcf76('0xe'),_0x5517ad,_0x317549[_0xcf76('0x12')]['message']);return _0x38f1b7(_0x317549['error'][_0xcf76('0x14')]);}else{logger[_0xcf76('0xd')](_0xcf76('0xe'),_0x5517ad,_0xcf76('0xf'));_0x38f1b7(_0x317549[_0xcf76('0x15')][_0xcf76('0x14')]);}})[_0xcf76('0x16')](function(_0x6de17){logger[_0xcf76('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x5517ad,_0x6de17);_0x5698d6(_0x6de17);});});}
\ No newline at end of file
+var _0x7f7d=['code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1dc501,_0x75419e){var _0x4095b3=function(_0x389fe5){while(--_0x389fe5){_0x1dc501['push'](_0x1dc501['shift']());}};_0x4095b3(++_0x75419e);}(_0x7f7d,0x114));var _0xd7f7=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x7f7d[_0xd39959];return _0x1ff69c;};'use strict';var _=require(_0xd7f7('0x0'));var util=require(_0xd7f7('0x1'));var moment=require(_0xd7f7('0x2'));var BPromise=require('bluebird');var rs=require(_0xd7f7('0x3'));var fs=require('fs');var Redis=require(_0xd7f7('0x4'));var db=require(_0xd7f7('0x5'))['db'];var utils=require(_0xd7f7('0x6'));var logger=require(_0xd7f7('0x7'))(_0xd7f7('0x8'));var config=require(_0xd7f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476b69,_0x19e6d7,_0x24f0bd){return new BPromise(function(_0x5cb144,_0x394881){return client[_0xd7f7('0xa')](_0x476b69,_0x24f0bd)[_0xd7f7('0xb')](function(_0x918288){logger[_0xd7f7('0xc')](_0xd7f7('0xd'),_0x19e6d7,'request\x20sent');logger[_0xd7f7('0xe')](_0xd7f7('0xf'),_0x19e6d7,'request\x20sent',JSON[_0xd7f7('0x10')](_0x918288));if(_0x918288[_0xd7f7('0x11')]){if(_0x918288[_0xd7f7('0x11')][_0xd7f7('0x12')]===0x1f4){logger[_0xd7f7('0x11')](_0xd7f7('0xd'),_0x19e6d7,_0x918288[_0xd7f7('0x11')][_0xd7f7('0x13')]);return _0x394881(_0x918288['error'][_0xd7f7('0x13')]);}logger[_0xd7f7('0x11')](_0xd7f7('0xd'),_0x19e6d7,_0x918288[_0xd7f7('0x11')][_0xd7f7('0x13')]);return _0x5cb144(_0x918288[_0xd7f7('0x11')][_0xd7f7('0x13')]);}else{logger[_0xd7f7('0xc')](_0xd7f7('0xd'),_0x19e6d7,'request\x20sent');_0x5cb144(_0x918288[_0xd7f7('0x14')][_0xd7f7('0x13')]);}})['catch'](function(_0x576317){logger['error'](_0xd7f7('0xd'),_0x19e6d7,_0x576317);_0x394881(_0x576317);});});}
\ No newline at end of file
index aaf0196..4abceb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39f4=['destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','get','show','post','create','put','delete','/:id'];(function(_0x52ce0c,_0x153a8a){var _0x17e015=function(_0x5de8a2){while(--_0x5de8a2){_0x52ce0c['push'](_0x52ce0c['shift']());}};_0x17e015(++_0x153a8a);}(_0x39f4,0x11f));var _0x439f=function(_0x3caa64,_0x2e85b1){_0x3caa64=_0x3caa64-0x0;var _0x504cd6=_0x39f4[_0x3caa64];return _0x504cd6;};'use strict';var multer=require(_0x439f('0x0'));var util=require(_0x439f('0x1'));var path=require(_0x439f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x439f('0x3')]();var fs_extra=require(_0x439f('0x4'));var auth=require(_0x439f('0x5'));var interaction=require(_0x439f('0x6'));var config=require(_0x439f('0x7'));var controller=require(_0x439f('0x8'));router['get']('/',auth[_0x439f('0x9')](),controller['index']);router[_0x439f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x439f('0xb')]);router[_0x439f('0xc')]('/',auth[_0x439f('0x9')](),controller[_0x439f('0xd')]);router[_0x439f('0xe')]('/:id',auth[_0x439f('0x9')](),controller['update']);router[_0x439f('0xf')](_0x439f('0x10'),auth['isAuthenticated'](),controller[_0x439f('0x11')]);module[_0x439f('0x12')]=router;
\ No newline at end of file
+var _0x5ff1=['isAuthenticated','index','show','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x142071,_0x500736){var _0x8a949f=function(_0x227cf1){while(--_0x227cf1){_0x142071['push'](_0x142071['shift']());}};_0x8a949f(++_0x500736);}(_0x5ff1,0xf9));var _0x15ff=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x5ff1[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require(_0x15ff('0x0'));var path=require(_0x15ff('0x1'));var timeout=require(_0x15ff('0x2'));var express=require(_0x15ff('0x3'));var router=express[_0x15ff('0x4')]();var fs_extra=require(_0x15ff('0x5'));var auth=require(_0x15ff('0x6'));var interaction=require(_0x15ff('0x7'));var config=require(_0x15ff('0x8'));var controller=require(_0x15ff('0x9'));router[_0x15ff('0xa')]('/',auth[_0x15ff('0xb')](),controller[_0x15ff('0xc')]);router[_0x15ff('0xa')]('/:id',auth[_0x15ff('0xb')](),controller[_0x15ff('0xd')]);router['post']('/',auth[_0x15ff('0xb')](),controller[_0x15ff('0xe')]);router[_0x15ff('0xf')](_0x15ff('0x10'),auth[_0x15ff('0xb')](),controller[_0x15ff('0x11')]);router[_0x15ff('0x12')](_0x15ff('0x10'),auth[_0x15ff('0xb')](),controller['destroy']);module[_0x15ff('0x13')]=router;
\ No newline at end of file
index e9dc8e3..6571c4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d55=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x3d55,0x144));var _0x53d5=function(_0x74dd87,_0x2e91b0){_0x74dd87=_0x74dd87-0x0;var _0x36f969=_0x3d55[_0x74dd87];return _0x36f969;};'use strict';var Sequelize=require(_0x53d5('0x0'));module[_0x53d5('0x1')]={'type':{'type':Sequelize[_0x53d5('0x2')](_0x53d5('0x3'),_0x53d5('0x4'),'customVariable',_0x53d5('0x5'),_0x53d5('0x6')),'defaultValue':_0x53d5('0x3')},'content':{'type':Sequelize[_0x53d5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x53d5('0x2')](_0x53d5('0x3'),_0x53d5('0x4'),_0x53d5('0x8'))},'keyContent':{'type':Sequelize[_0x53d5('0x7')]},'idField':{'type':Sequelize[_0x53d5('0x7')]},'nameField':{'type':Sequelize[_0x53d5('0x7')]},'customField':{'type':Sequelize[_0x53d5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x552d=['STRING','variable','sequelize','exports','ENUM','customVariable','keyValue','picklist','string'];(function(_0x458e76,_0x2c7de3){var _0x30bc9b=function(_0x2bac07){while(--_0x2bac07){_0x458e76['push'](_0x458e76['shift']());}};_0x30bc9b(++_0x2c7de3);}(_0x552d,0x92));var _0xd552=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x552d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xd552('0x0'));module[_0xd552('0x1')]={'type':{'type':Sequelize[_0xd552('0x2')]('string','variable',_0xd552('0x3'),_0xd552('0x4'),_0xd552('0x5')),'defaultValue':_0xd552('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd552('0x7')]},'keyType':{'type':Sequelize[_0xd552('0x2')](_0xd552('0x6'),_0xd552('0x8'),_0xd552('0x3'))},'keyContent':{'type':Sequelize[_0xd552('0x7')]},'idField':{'type':Sequelize[_0xd552('0x7')]},'nameField':{'type':Sequelize[_0xd552('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd552('0x7')]}};
\ No newline at end of file
index 78c47f6..1265ab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ad9=['includeAll','find','create','body','update','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','undefined','limit','offset','set','Content-Range','json','apply','reject','then','destroy','end','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','count','include','findAll','rows','catch','show','keys'];(function(_0x2458f8,_0x14fee4){var _0x14d1a1=function(_0x119831){while(--_0x119831){_0x2458f8['push'](_0x2458f8['shift']());}};_0x14d1a1(++_0x14fee4);}(_0x6ad9,0xed));var _0x96ad=function(_0x18f6a7,_0x589942){_0x18f6a7=_0x18f6a7-0x0;var _0x5ad696=_0x6ad9[_0x18f6a7];return _0x5ad696;};'use strict';var emlformat=require(_0x96ad('0x0'));var rimraf=require(_0x96ad('0x1'));var zipdir=require(_0x96ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96ad('0x3'));var BPromise=require(_0x96ad('0x4'));var Mustache=require(_0x96ad('0x5'));var util=require(_0x96ad('0x6'));var path=require(_0x96ad('0x7'));var sox=require(_0x96ad('0x8'));var csv=require(_0x96ad('0x9'));var ejs=require(_0x96ad('0xa'));var fs=require('fs');var fs_extra=require(_0x96ad('0xb'));var _=require(_0x96ad('0xc'));var squel=require('squel');var crypto=require(_0x96ad('0xd'));var jsforce=require(_0x96ad('0xe'));var deskjs=require(_0x96ad('0xf'));var toCsv=require(_0x96ad('0x9'));var querystring=require(_0x96ad('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x96ad('0x11'));var as=require(_0x96ad('0x12'));var hardwareService=require(_0x96ad('0x13'));var logger=require(_0x96ad('0x14'))(_0x96ad('0x15'));var utils=require(_0x96ad('0x16'));var config=require(_0x96ad('0x17'));var licenseUtil=require(_0x96ad('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d9b20,_0x5eed96){_0x5eed96=_0x5eed96||0xcc;return function(_0x319874){if(_0x319874){return _0x2d9b20[_0x96ad('0x19')](_0x5eed96);}return _0x2d9b20[_0x96ad('0x1a')](_0x5eed96)['end']();};}function respondWithResult(_0x327bcb,_0x34e524){_0x34e524=_0x34e524||0xc8;return function(_0x411d10){if(_0x411d10){return _0x327bcb['status'](_0x34e524)['json'](_0x411d10);}};}function respondWithFilteredResult(_0x1c9979,_0x3471a3){return function(_0x48f13a){if(_0x48f13a){var _0x20f946=typeof _0x3471a3['offset']===_0x96ad('0x1b')&&typeof _0x3471a3[_0x96ad('0x1c')]===_0x96ad('0x1b');var _0x10decf=_0x48f13a['count'];var _0x58b208=_0x20f946?0x0:_0x3471a3[_0x96ad('0x1d')];var _0x322893=_0x20f946?_0x48f13a['count']:_0x3471a3['offset']+_0x3471a3['limit'];var _0x4904bd;if(_0x322893>=_0x10decf){_0x322893=_0x10decf;_0x4904bd=0xc8;}else{_0x4904bd=0xce;}_0x1c9979['status'](_0x4904bd);return _0x1c9979[_0x96ad('0x1e')](_0x96ad('0x1f'),_0x58b208+'-'+_0x322893+'/'+_0x10decf)[_0x96ad('0x20')](_0x48f13a);}return null;};}function patchUpdates(_0x35444a){return function(_0x29ea1a){try{jsonpatch[_0x96ad('0x21')](_0x29ea1a,_0x35444a,!![]);}catch(_0x136a3e){return BPromise[_0x96ad('0x22')](_0x136a3e);}return _0x29ea1a['save']();};}function saveUpdates(_0x4a04bb,_0x31b408){return function(_0xdf5583){if(_0xdf5583){return _0xdf5583['update'](_0x4a04bb)[_0x96ad('0x23')](function(_0x37ca4a){return _0x37ca4a;});}return null;};}function removeEntity(_0x45d64b,_0xf5f96d){return function(_0x24fe85){if(_0x24fe85){return _0x24fe85[_0x96ad('0x24')]()[_0x96ad('0x23')](function(){_0x45d64b[_0x96ad('0x1a')](0xcc)[_0x96ad('0x25')]();});}};}function handleEntityNotFound(_0x35c90e,_0x2bbed5){return function(_0x3addbc){if(!_0x3addbc){_0x35c90e['sendStatus'](0x194);}return _0x3addbc;};}function handleError(_0x5db083,_0x12a2c4){_0x12a2c4=_0x12a2c4||0x1f4;return function(_0x4f8c3b){logger[_0x96ad('0x26')](_0x4f8c3b[_0x96ad('0x27')]);if(_0x4f8c3b[_0x96ad('0x28')]){delete _0x4f8c3b[_0x96ad('0x28')];}_0x5db083['status'](_0x12a2c4)[_0x96ad('0x29')](_0x4f8c3b);};}exports[_0x96ad('0x2a')]=function(_0x1ee061,_0x5caf0d){var _0x4b38ba={},_0x27b58f={},_0x587880={'count':0x0,'rows':[]};var _0x17cc3e=_[_0x96ad('0x2b')](db[_0x96ad('0x2c')][_0x96ad('0x2d')],function(_0x1312db){return{'name':_0x1312db[_0x96ad('0x2e')],'type':_0x1312db[_0x96ad('0x2f')][_0x96ad('0x30')]};});_0x27b58f[_0x96ad('0x31')]=_[_0x96ad('0x2b')](_0x17cc3e,_0x96ad('0x28'));_0x27b58f[_0x96ad('0x32')]=_['keys'](_0x1ee061[_0x96ad('0x32')]);_0x27b58f['filters']=_['intersection'](_0x27b58f[_0x96ad('0x31')],_0x27b58f[_0x96ad('0x32')]);_0x4b38ba[_0x96ad('0x33')]=_[_0x96ad('0x34')](_0x27b58f['model'],qs[_0x96ad('0x35')](_0x1ee061[_0x96ad('0x32')]['fields']));_0x4b38ba['attributes']=_0x4b38ba[_0x96ad('0x33')][_0x96ad('0x36')]?_0x4b38ba['attributes']:_0x27b58f[_0x96ad('0x31')];if(!_0x1ee061[_0x96ad('0x32')][_0x96ad('0x37')](_0x96ad('0x38'))){_0x4b38ba[_0x96ad('0x1c')]=qs['limit'](_0x1ee061['query'][_0x96ad('0x1c')]);_0x4b38ba[_0x96ad('0x1d')]=qs[_0x96ad('0x1d')](_0x1ee061['query'][_0x96ad('0x1d')]);}_0x4b38ba['order']=qs[_0x96ad('0x39')](_0x1ee061[_0x96ad('0x32')][_0x96ad('0x39')]);_0x4b38ba[_0x96ad('0x3a')]=qs[_0x96ad('0x3b')](_[_0x96ad('0x3c')](_0x1ee061[_0x96ad('0x32')],_0x27b58f[_0x96ad('0x3b')]),_0x17cc3e);if(_0x1ee061[_0x96ad('0x32')]['filter']){_0x4b38ba[_0x96ad('0x3a')]=_[_0x96ad('0x3d')](_0x4b38ba[_0x96ad('0x3a')],{'$or':_[_0x96ad('0x2b')](_0x17cc3e,function(_0x4f4d61){if(_0x4f4d61[_0x96ad('0x2f')]!=='VIRTUAL'){var _0x508ef7={};_0x508ef7[_0x4f4d61[_0x96ad('0x28')]]={'$like':'%'+_0x1ee061['query'][_0x96ad('0x3e')]+'%'};return _0x508ef7;}})});}_0x4b38ba=_[_0x96ad('0x3d')]({},_0x4b38ba,_0x1ee061[_0x96ad('0x3f')]);var _0x3a6207={'where':_0x4b38ba['where']};return db[_0x96ad('0x2c')][_0x96ad('0x40')](_0x3a6207)['then'](function(_0x5b1b9c){_0x587880[_0x96ad('0x40')]=_0x5b1b9c;if(_0x1ee061[_0x96ad('0x32')]['includeAll']){_0x4b38ba[_0x96ad('0x41')]=[{'all':!![]}];}return db[_0x96ad('0x2c')][_0x96ad('0x42')](_0x4b38ba);})['then'](function(_0x1ff9aa){_0x587880[_0x96ad('0x43')]=_0x1ff9aa;return _0x587880;})[_0x96ad('0x23')](respondWithFilteredResult(_0x5caf0d,_0x4b38ba))[_0x96ad('0x44')](handleError(_0x5caf0d,null));};exports[_0x96ad('0x45')]=function(_0x1f7a8a,_0x1adaa8){var _0x1ab588={'raw':!![],'where':{'id':_0x1f7a8a['params']['id']}},_0x1ee661={};_0x1ee661['model']=_[_0x96ad('0x46')](db[_0x96ad('0x2c')][_0x96ad('0x2d')]);_0x1ee661[_0x96ad('0x32')]=_[_0x96ad('0x46')](_0x1f7a8a[_0x96ad('0x32')]);_0x1ee661[_0x96ad('0x3b')]=_[_0x96ad('0x34')](_0x1ee661[_0x96ad('0x31')],_0x1ee661[_0x96ad('0x32')]);_0x1ab588['attributes']=_[_0x96ad('0x34')](_0x1ee661['model'],qs['fields'](_0x1f7a8a[_0x96ad('0x32')][_0x96ad('0x35')]));_0x1ab588[_0x96ad('0x33')]=_0x1ab588[_0x96ad('0x33')][_0x96ad('0x36')]?_0x1ab588[_0x96ad('0x33')]:_0x1ee661[_0x96ad('0x31')];if(_0x1f7a8a[_0x96ad('0x32')][_0x96ad('0x47')]){_0x1ab588[_0x96ad('0x41')]=[{'all':!![]}];}_0x1ab588=_[_0x96ad('0x3d')]({},_0x1ab588,_0x1f7a8a[_0x96ad('0x3f')]);return db['VtigerField'][_0x96ad('0x48')](_0x1ab588)[_0x96ad('0x23')](handleEntityNotFound(_0x1adaa8,null))[_0x96ad('0x23')](respondWithResult(_0x1adaa8,null))[_0x96ad('0x44')](handleError(_0x1adaa8,null));};exports[_0x96ad('0x49')]=function(_0x49cc1b,_0x3fc9a1){return db[_0x96ad('0x2c')]['create'](_0x49cc1b[_0x96ad('0x4a')],{})['then'](respondWithResult(_0x3fc9a1,0xc9))[_0x96ad('0x44')](handleError(_0x3fc9a1,null));};exports[_0x96ad('0x4b')]=function(_0x4b449a,_0x328579){if(_0x4b449a[_0x96ad('0x4a')]['id']){delete _0x4b449a[_0x96ad('0x4a')]['id'];}return db[_0x96ad('0x2c')][_0x96ad('0x48')]({'where':{'id':_0x4b449a[_0x96ad('0x4c')]['id']}})['then'](handleEntityNotFound(_0x328579,null))[_0x96ad('0x23')](saveUpdates(_0x4b449a['body'],null))[_0x96ad('0x23')](respondWithResult(_0x328579,null))[_0x96ad('0x44')](handleError(_0x328579,null));};exports[_0x96ad('0x24')]=function(_0x49f2bf,_0x31e934){return db['VtigerField'][_0x96ad('0x48')]({'where':{'id':_0x49f2bf[_0x96ad('0x4c')]['id']}})['then'](handleEntityNotFound(_0x31e934,null))[_0x96ad('0x23')](removeEntity(_0x31e934,null))['catch'](handleError(_0x31e934,null));};
\ No newline at end of file
+var _0x460e=['count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','length','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit'];(function(_0x5ec427,_0x1c69d8){var _0x2ff482=function(_0x42a492){while(--_0x42a492){_0x5ec427['push'](_0x5ec427['shift']());}};_0x2ff482(++_0x1c69d8);}(_0x460e,0x10d));var _0xe460=function(_0xd39959,_0x302d09){_0xd39959=_0xd39959-0x0;var _0x1ff69c=_0x460e[_0xd39959];return _0x1ff69c;};'use strict';var emlformat=require(_0xe460('0x0'));var rimraf=require(_0xe460('0x1'));var zipdir=require(_0xe460('0x2'));var jsonpatch=require(_0xe460('0x3'));var rp=require(_0xe460('0x4'));var moment=require(_0xe460('0x5'));var BPromise=require(_0xe460('0x6'));var Mustache=require(_0xe460('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe460('0x8'));var csv=require(_0xe460('0x9'));var ejs=require(_0xe460('0xa'));var fs=require('fs');var fs_extra=require(_0xe460('0xb'));var _=require(_0xe460('0xc'));var squel=require(_0xe460('0xd'));var crypto=require(_0xe460('0xe'));var jsforce=require(_0xe460('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe460('0x9'));var querystring=require(_0xe460('0x10'));var Papa=require('papaparse');var Redis=require(_0xe460('0x11'));var authService=require(_0xe460('0x12'));var qs=require(_0xe460('0x13'));var as=require(_0xe460('0x14'));var hardwareService=require(_0xe460('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xe460('0x16'));var config=require(_0xe460('0x17'));var licenseUtil=require(_0xe460('0x18'));var db=require(_0xe460('0x19'))['db'];function respondWithStatusCode(_0x4a8fc2,_0x406a5e){_0x406a5e=_0x406a5e||0xcc;return function(_0x36f69a){if(_0x36f69a){return _0x4a8fc2['sendStatus'](_0x406a5e);}return _0x4a8fc2[_0xe460('0x1a')](_0x406a5e)['end']();};}function respondWithResult(_0x511173,_0x11659b){_0x11659b=_0x11659b||0xc8;return function(_0x4eb267){if(_0x4eb267){return _0x511173['status'](_0x11659b)[_0xe460('0x1b')](_0x4eb267);}};}function respondWithFilteredResult(_0x1894cc,_0x5d09e9){return function(_0x3c03a8){if(_0x3c03a8){var _0x420b86=typeof _0x5d09e9[_0xe460('0x1c')]===_0xe460('0x1d')&&typeof _0x5d09e9[_0xe460('0x1e')]===_0xe460('0x1d');var _0x114856=_0x3c03a8[_0xe460('0x1f')];var _0x4c9082=_0x420b86?0x0:_0x5d09e9['offset'];var _0x2bdefe=_0x420b86?_0x3c03a8[_0xe460('0x1f')]:_0x5d09e9[_0xe460('0x1c')]+_0x5d09e9[_0xe460('0x1e')];var _0xf6ccb;if(_0x2bdefe>=_0x114856){_0x2bdefe=_0x114856;_0xf6ccb=0xc8;}else{_0xf6ccb=0xce;}_0x1894cc['status'](_0xf6ccb);return _0x1894cc[_0xe460('0x20')](_0xe460('0x21'),_0x4c9082+'-'+_0x2bdefe+'/'+_0x114856)[_0xe460('0x1b')](_0x3c03a8);}return null;};}function patchUpdates(_0x3988f0){return function(_0x2c11e0){try{jsonpatch[_0xe460('0x22')](_0x2c11e0,_0x3988f0,!![]);}catch(_0x44f401){return BPromise[_0xe460('0x23')](_0x44f401);}return _0x2c11e0[_0xe460('0x24')]();};}function saveUpdates(_0x807fb3,_0xd0364f){return function(_0x2918c5){if(_0x2918c5){return _0x2918c5[_0xe460('0x25')](_0x807fb3)[_0xe460('0x26')](function(_0x5c213d){return _0x5c213d;});}return null;};}function removeEntity(_0x3d11b6,_0x28b9e7){return function(_0x35b68e){if(_0x35b68e){return _0x35b68e[_0xe460('0x27')]()['then'](function(){_0x3d11b6[_0xe460('0x1a')](0xcc)[_0xe460('0x28')]();});}};}function handleEntityNotFound(_0x34ee2d,_0x336a5b){return function(_0x2a8a00){if(!_0x2a8a00){_0x34ee2d['sendStatus'](0x194);}return _0x2a8a00;};}function handleError(_0x3fb855,_0x50b0f9){_0x50b0f9=_0x50b0f9||0x1f4;return function(_0x328ccf){logger['error'](_0x328ccf[_0xe460('0x29')]);if(_0x328ccf['name']){delete _0x328ccf['name'];}_0x3fb855[_0xe460('0x1a')](_0x50b0f9)[_0xe460('0x2a')](_0x328ccf);};}exports[_0xe460('0x2b')]=function(_0x2b0270,_0x3ef0e7){var _0x402b97={},_0x5cf18b={},_0x34062a={'count':0x0,'rows':[]};var _0x14ed2c=_[_0xe460('0x2c')](db[_0xe460('0x2d')][_0xe460('0x2e')],function(_0x3b013c){return{'name':_0x3b013c[_0xe460('0x2f')],'type':_0x3b013c[_0xe460('0x30')][_0xe460('0x31')]};});_0x5cf18b[_0xe460('0x32')]=_[_0xe460('0x2c')](_0x14ed2c,_0xe460('0x33'));_0x5cf18b[_0xe460('0x34')]=_['keys'](_0x2b0270[_0xe460('0x34')]);_0x5cf18b[_0xe460('0x35')]=_[_0xe460('0x36')](_0x5cf18b['model'],_0x5cf18b[_0xe460('0x34')]);_0x402b97['attributes']=_['intersection'](_0x5cf18b[_0xe460('0x32')],qs[_0xe460('0x37')](_0x2b0270[_0xe460('0x34')][_0xe460('0x37')]));_0x402b97[_0xe460('0x38')]=_0x402b97[_0xe460('0x38')]['length']?_0x402b97[_0xe460('0x38')]:_0x5cf18b[_0xe460('0x32')];if(!_0x2b0270['query']['hasOwnProperty'](_0xe460('0x39'))){_0x402b97[_0xe460('0x1e')]=qs[_0xe460('0x1e')](_0x2b0270[_0xe460('0x34')][_0xe460('0x1e')]);_0x402b97[_0xe460('0x1c')]=qs[_0xe460('0x1c')](_0x2b0270[_0xe460('0x34')][_0xe460('0x1c')]);}_0x402b97['order']=qs[_0xe460('0x3a')](_0x2b0270[_0xe460('0x34')]['sort']);_0x402b97[_0xe460('0x3b')]=qs[_0xe460('0x35')](_[_0xe460('0x3c')](_0x2b0270[_0xe460('0x34')],_0x5cf18b[_0xe460('0x35')]),_0x14ed2c);if(_0x2b0270[_0xe460('0x34')][_0xe460('0x3d')]){_0x402b97[_0xe460('0x3b')]=_[_0xe460('0x3e')](_0x402b97[_0xe460('0x3b')],{'$or':_[_0xe460('0x2c')](_0x14ed2c,function(_0x4f3ffc){if(_0x4f3ffc[_0xe460('0x30')]!==_0xe460('0x3f')){var _0x41d7ec={};_0x41d7ec[_0x4f3ffc[_0xe460('0x33')]]={'$like':'%'+_0x2b0270[_0xe460('0x34')][_0xe460('0x3d')]+'%'};return _0x41d7ec;}})});}_0x402b97=_[_0xe460('0x3e')]({},_0x402b97,_0x2b0270[_0xe460('0x40')]);var _0x5f1e7b={'where':_0x402b97[_0xe460('0x3b')]};return db[_0xe460('0x2d')]['count'](_0x5f1e7b)[_0xe460('0x26')](function(_0x3f50a5){_0x34062a[_0xe460('0x1f')]=_0x3f50a5;if(_0x2b0270['query'][_0xe460('0x41')]){_0x402b97['include']=[{'all':!![]}];}return db[_0xe460('0x2d')]['findAll'](_0x402b97);})[_0xe460('0x26')](function(_0x3bb600){_0x34062a[_0xe460('0x42')]=_0x3bb600;return _0x34062a;})['then'](respondWithFilteredResult(_0x3ef0e7,_0x402b97))[_0xe460('0x43')](handleError(_0x3ef0e7,null));};exports[_0xe460('0x44')]=function(_0x1b11f6,_0x173a65){var _0x2c0693={'raw':!![],'where':{'id':_0x1b11f6[_0xe460('0x45')]['id']}},_0xc67701={};_0xc67701['model']=_[_0xe460('0x46')](db[_0xe460('0x2d')][_0xe460('0x2e')]);_0xc67701[_0xe460('0x34')]=_[_0xe460('0x46')](_0x1b11f6[_0xe460('0x34')]);_0xc67701[_0xe460('0x35')]=_[_0xe460('0x36')](_0xc67701[_0xe460('0x32')],_0xc67701[_0xe460('0x34')]);_0x2c0693['attributes']=_[_0xe460('0x36')](_0xc67701[_0xe460('0x32')],qs[_0xe460('0x37')](_0x1b11f6[_0xe460('0x34')][_0xe460('0x37')]));_0x2c0693[_0xe460('0x38')]=_0x2c0693['attributes'][_0xe460('0x47')]?_0x2c0693[_0xe460('0x38')]:_0xc67701[_0xe460('0x32')];if(_0x1b11f6['query'][_0xe460('0x41')]){_0x2c0693['include']=[{'all':!![]}];}_0x2c0693=_[_0xe460('0x3e')]({},_0x2c0693,_0x1b11f6[_0xe460('0x40')]);return db[_0xe460('0x2d')]['find'](_0x2c0693)['then'](handleEntityNotFound(_0x173a65,null))[_0xe460('0x26')](respondWithResult(_0x173a65,null))['catch'](handleError(_0x173a65,null));};exports[_0xe460('0x48')]=function(_0x4f0009,_0x294ba0){return db[_0xe460('0x2d')][_0xe460('0x48')](_0x4f0009[_0xe460('0x49')],{})[_0xe460('0x26')](respondWithResult(_0x294ba0,0xc9))[_0xe460('0x43')](handleError(_0x294ba0,null));};exports[_0xe460('0x25')]=function(_0x337c42,_0x52ab97){if(_0x337c42[_0xe460('0x49')]['id']){delete _0x337c42['body']['id'];}return db[_0xe460('0x2d')][_0xe460('0x4a')]({'where':{'id':_0x337c42[_0xe460('0x45')]['id']}})[_0xe460('0x26')](handleEntityNotFound(_0x52ab97,null))[_0xe460('0x26')](saveUpdates(_0x337c42[_0xe460('0x49')],null))['then'](respondWithResult(_0x52ab97,null))[_0xe460('0x43')](handleError(_0x52ab97,null));};exports[_0xe460('0x27')]=function(_0x1f02e1,_0x541f3d){return db[_0xe460('0x2d')][_0xe460('0x4a')]({'where':{'id':_0x1f02e1[_0xe460('0x45')]['id']}})[_0xe460('0x26')](handleEntityNotFound(_0x541f3d,null))[_0xe460('0x26')](removeEntity(_0x541f3d,null))['catch'](handleError(_0x541f3d,null));};
\ No newline at end of file
index 4baf415..d6b4288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ae7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','idField','FieldId'];(function(_0x86a3dc,_0x1b1e88){var _0x2172bb=function(_0x35658c){while(--_0x35658c){_0x86a3dc['push'](_0x86a3dc['shift']());}};_0x2172bb(++_0x1b1e88);}(_0x4ae7,0x1a4));var _0x74ae=function(_0x21215f,_0x4f7e90){_0x21215f=_0x21215f-0x0;var _0x1356c1=_0x4ae7[_0x21215f];return _0x1356c1;};'use strict';var _=require('lodash');var util=require(_0x74ae('0x0'));var logger=require(_0x74ae('0x1'))(_0x74ae('0x2'));var moment=require(_0x74ae('0x3'));var BPromise=require(_0x74ae('0x4'));var rp=require(_0x74ae('0x5'));var fs=require('fs');var path=require(_0x74ae('0x6'));var rimraf=require(_0x74ae('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x74ae('0x8')]=function(_0x4083e4,_0x863c72){return _0x4083e4[_0x74ae('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x74ae('0xa'),_0x74ae('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d93=['util','../../config/logger','api','moment','bluebird','path','./intVtigerField.attributes','exports','VtigerField','vtiger_unique_index','idField','FieldId','lodash'];(function(_0x1822a2,_0x2b1ebf){var _0xe6310b=function(_0x17d617){while(--_0x17d617){_0x1822a2['push'](_0x1822a2['shift']());}};_0xe6310b(++_0x2b1ebf);}(_0x9d93,0xa8));var _0x39d9=function(_0x15cc19,_0x3eedfd){_0x15cc19=_0x15cc19-0x0;var _0x3cf539=_0x9d93[_0x15cc19];return _0x3cf539;};'use strict';var _=require(_0x39d9('0x0'));var util=require(_0x39d9('0x1'));var logger=require(_0x39d9('0x2'))(_0x39d9('0x3'));var moment=require(_0x39d9('0x4'));var BPromise=require(_0x39d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39d9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x39d9('0x7'));module[_0x39d9('0x8')]=function(_0x3f1605,_0x4ba0ea){return _0x3f1605['define'](_0x39d9('0x9'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x39d9('0xa'),'fields':[_0x39d9('0xb'),_0x39d9('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bbb8431..b4b99fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42e7=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0x42e7,0x1d9));var _0x742e=function(_0x112ccf,_0x2ff84a){_0x112ccf=_0x112ccf-0x0;var _0x84dbc5=_0x42e7[_0x112ccf];return _0x84dbc5;};'use strict';var _=require(_0x742e('0x0'));var util=require(_0x742e('0x1'));var moment=require(_0x742e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x742e('0x3'));var db=require(_0x742e('0x4'))['db'];var utils=require(_0x742e('0x5'));var logger=require(_0x742e('0x6'))(_0x742e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58ce25,_0xcaa126,_0x4c4efc){return new BPromise(function(_0x502676,_0x58dbac){return client[_0x742e('0x8')](_0x58ce25,_0x4c4efc)['then'](function(_0x558360){logger[_0x742e('0x9')](_0x742e('0xa'),_0xcaa126,_0x742e('0xb'));logger[_0x742e('0xc')](_0x742e('0xd'),_0xcaa126,_0x742e('0xb'),JSON[_0x742e('0xe')](_0x558360));if(_0x558360[_0x742e('0xf')]){if(_0x558360[_0x742e('0xf')][_0x742e('0x10')]===0x1f4){logger[_0x742e('0xf')](_0x742e('0xa'),_0xcaa126,_0x558360[_0x742e('0xf')][_0x742e('0x11')]);return _0x58dbac(_0x558360[_0x742e('0xf')][_0x742e('0x11')]);}logger[_0x742e('0xf')]('VtigerField,\x20%s,\x20%s',_0xcaa126,_0x558360[_0x742e('0xf')][_0x742e('0x11')]);return _0x502676(_0x558360['error'][_0x742e('0x11')]);}else{logger[_0x742e('0x9')](_0x742e('0xa'),_0xcaa126,_0x742e('0xb'));_0x502676(_0x558360[_0x742e('0x12')][_0x742e('0x11')]);}})['catch'](function(_0x6b7c21){logger[_0x742e('0xf')](_0x742e('0xa'),_0xcaa126,_0x6b7c21);_0x58dbac(_0x6b7c21);});});}
\ No newline at end of file
+var _0x3fe1=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x62ae1,_0x4d44d5){var _0x15395c=function(_0x5b7035){while(--_0x5b7035){_0x62ae1['push'](_0x62ae1['shift']());}};_0x15395c(++_0x4d44d5);}(_0x3fe1,0xad));var _0x13fe=function(_0x49e812,_0x3274b9){_0x49e812=_0x49e812-0x0;var _0x1564ea=_0x3fe1[_0x49e812];return _0x1564ea;};'use strict';var _=require(_0x13fe('0x0'));var util=require(_0x13fe('0x1'));var moment=require(_0x13fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x13fe('0x3'));var fs=require('fs');var Redis=require(_0x13fe('0x4'));var db=require(_0x13fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x13fe('0x6'))('rpc');var config=require(_0x13fe('0x7'));var jayson=require(_0x13fe('0x8'));var client=jayson[_0x13fe('0x9')][_0x13fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18f1c7,_0x57ffff,_0x4e049d){return new BPromise(function(_0x34f0b9,_0xf94524){return client[_0x13fe('0xb')](_0x18f1c7,_0x4e049d)[_0x13fe('0xc')](function(_0xbb0842){logger[_0x13fe('0xd')](_0x13fe('0xe'),_0x57ffff,'request\x20sent');logger[_0x13fe('0xf')](_0x13fe('0x10'),_0x57ffff,_0x13fe('0x11'),JSON[_0x13fe('0x12')](_0xbb0842));if(_0xbb0842['error']){if(_0xbb0842[_0x13fe('0x13')][_0x13fe('0x14')]===0x1f4){logger[_0x13fe('0x13')]('VtigerField,\x20%s,\x20%s',_0x57ffff,_0xbb0842['error'][_0x13fe('0x15')]);return _0xf94524(_0xbb0842[_0x13fe('0x13')]['message']);}logger['error'](_0x13fe('0xe'),_0x57ffff,_0xbb0842[_0x13fe('0x13')]['message']);return _0x34f0b9(_0xbb0842[_0x13fe('0x13')]['message']);}else{logger['info'](_0x13fe('0xe'),_0x57ffff,_0x13fe('0x11'));_0x34f0b9(_0xbb0842[_0x13fe('0x16')][_0x13fe('0x15')]);}})[_0x13fe('0x17')](function(_0x474f68){logger[_0x13fe('0x13')](_0x13fe('0xe'),_0x57ffff,_0x474f68);_0xf94524(_0x474f68);});});}
\ No newline at end of file
index 05d6f4e..74c4d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2158=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3e4d41,_0x4b63c8){var _0x19ee3c=function(_0x5d68f8){while(--_0x5d68f8){_0x3e4d41['push'](_0x3e4d41['shift']());}};_0x19ee3c(++_0x4b63c8);}(_0x2158,0x10e));var _0x8215=function(_0x30ec38,_0x47093f){_0x30ec38=_0x30ec38-0x0;var _0x52b860=_0x2158[_0x30ec38];return _0x52b860;};'use strict';var multer=require('multer');var util=require(_0x8215('0x0'));var path=require('path');var timeout=require(_0x8215('0x1'));var express=require(_0x8215('0x2'));var router=express[_0x8215('0x3')]();var fs_extra=require(_0x8215('0x4'));var auth=require(_0x8215('0x5'));var interaction=require(_0x8215('0x6'));var config=require(_0x8215('0x7'));var controller=require(_0x8215('0x8'));router[_0x8215('0x9')]('/',auth[_0x8215('0xa')](),controller[_0x8215('0xb')]);router[_0x8215('0x9')](_0x8215('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8215('0xd'),auth[_0x8215('0xa')](),controller[_0x8215('0xe')]);router[_0x8215('0x9')](_0x8215('0xf'),auth[_0x8215('0xa')](),controller[_0x8215('0x10')]);router['post']('/',auth[_0x8215('0xa')](),controller[_0x8215('0x11')]);router[_0x8215('0x12')](_0x8215('0xd'),auth[_0x8215('0xa')](),controller['addConfiguration']);router['put'](_0x8215('0xc'),auth[_0x8215('0xa')](),controller[_0x8215('0x13')]);router[_0x8215('0x14')](_0x8215('0xc'),auth['isAuthenticated'](),controller[_0x8215('0x15')]);module[_0x8215('0x16')]=router;
\ No newline at end of file
+var _0x1173=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x447864,_0x557c22){var _0x257d31=function(_0x5e36cd){while(--_0x5e36cd){_0x447864['push'](_0x447864['shift']());}};_0x257d31(++_0x557c22);}(_0x1173,0x138));var _0x3117=function(_0xb42ec7,_0x4a0132){_0xb42ec7=_0xb42ec7-0x0;var _0x5824d5=_0x1173[_0xb42ec7];return _0x5824d5;};'use strict';var multer=require('multer');var util=require(_0x3117('0x0'));var path=require(_0x3117('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3117('0x2')]();var fs_extra=require(_0x3117('0x3'));var auth=require(_0x3117('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3117('0x5'));var controller=require(_0x3117('0x6'));router[_0x3117('0x7')]('/',auth[_0x3117('0x8')](),controller[_0x3117('0x9')]);router[_0x3117('0x7')](_0x3117('0xa'),auth[_0x3117('0x8')](),controller[_0x3117('0xb')]);router['get'](_0x3117('0xc'),auth[_0x3117('0x8')](),controller[_0x3117('0xd')]);router[_0x3117('0x7')](_0x3117('0xe'),auth['isAuthenticated'](),controller[_0x3117('0xf')]);router[_0x3117('0x10')]('/',auth[_0x3117('0x8')](),controller[_0x3117('0x11')]);router[_0x3117('0x10')](_0x3117('0xc'),auth[_0x3117('0x8')](),controller['addConfiguration']);router[_0x3117('0x12')](_0x3117('0xa'),auth[_0x3117('0x8')](),controller['update']);router[_0x3117('0x13')]('/:id',auth[_0x3117('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5110f7e..db32424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf963=['ENUM','token','integrationTab','sequelize','STRING','remoteUri'];(function(_0x5f2c08,_0x3e2325){var _0x5e8c16=function(_0x4f7e36){while(--_0x4f7e36){_0x5f2c08['push'](_0x5f2c08['shift']());}};_0x5e8c16(++_0x3e2325);}(_0xf963,0x11d));var _0x3f96=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xf963[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x3f96('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3f96('0x1')]},'username':{'type':Sequelize[_0x3f96('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x3f96('0x1')]},'remoteUri':{'type':Sequelize[_0x3f96('0x1')],'unique':_0x3f96('0x2')},'authType':{'type':Sequelize[_0x3f96('0x3')]('password',_0x3f96('0x4')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x3f96('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3f96('0x3')](_0x3f96('0x5'),'newTab'),'defaultValue':_0x3f96('0x5')}};
\ No newline at end of file
+var _0x66fa=['sequelize','exports','STRING','username','remoteUri','token','password','ENUM','integrationTab'];(function(_0x19e848,_0x2b880f){var _0x418a79=function(_0xa0de17){while(--_0xa0de17){_0x19e848['push'](_0x19e848['shift']());}};_0x418a79(++_0x2b880f);}(_0x66fa,0x117));var _0xa66f=function(_0x463282,_0x6682d6){_0x463282=_0x463282-0x0;var _0x684f98=_0x66fa[_0x463282];return _0x684f98;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'password':{'type':Sequelize[_0xa66f('0x2')]},'token':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0xa66f('0x5')),'defaultValue':_0xa66f('0x6')},'serverUrl':{'type':Sequelize[_0xa66f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa66f('0x7')](_0xa66f('0x8'),'newTab'),'defaultValue':_0xa66f('0x8')}};
\ No newline at end of file
index c9f48a1..e46bcbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb574=['slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','toString','base64','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','remove','includes','position','title','system_field_options','custom_field_options','statusCode','stringify','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','ZendeskAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','nolimit','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','ZendeskConfiguration','options','length','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','remoteUri'];(function(_0xf0c448,_0x4bd0cd){var _0x226f4a=function(_0x566c98){while(--_0x566c98){_0xf0c448['push'](_0xf0c448['shift']());}};_0x226f4a(++_0x4bd0cd);}(_0xb574,0x106));var _0x4b57=function(_0x217ac3,_0x5ba162){_0x217ac3=_0x217ac3-0x0;var _0x14d764=_0xb574[_0x217ac3];return _0x14d764;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];var integrations=require(_0x4b57('0x16'));function respondWithStatusCode(_0x43d066,_0xf8a6fc){_0xf8a6fc=_0xf8a6fc||0xcc;return function(_0x607276){if(_0x607276){return _0x43d066[_0x4b57('0x17')](_0xf8a6fc);}return _0x43d066[_0x4b57('0x18')](_0xf8a6fc)[_0x4b57('0x19')]();};}function respondWithResult(_0x31cced,_0x4e15be){_0x4e15be=_0x4e15be||0xc8;return function(_0x4a58dc){if(_0x4a58dc){return _0x31cced[_0x4b57('0x18')](_0x4e15be)[_0x4b57('0x1a')](_0x4a58dc);}};}function respondWithFilteredResult(_0x10b9ff,_0x58d6bd){return function(_0x284640){if(_0x284640){var _0x48bd13=typeof _0x58d6bd[_0x4b57('0x1b')]===_0x4b57('0x1c')&&typeof _0x58d6bd[_0x4b57('0x1d')]===_0x4b57('0x1c');var _0x20cf5e=_0x284640[_0x4b57('0x1e')];var _0x4ede42=_0x48bd13?0x0:_0x58d6bd[_0x4b57('0x1b')];var _0x1a0b72=_0x48bd13?_0x284640[_0x4b57('0x1e')]:_0x58d6bd[_0x4b57('0x1b')]+_0x58d6bd['limit'];var _0xb62450;if(_0x1a0b72>=_0x20cf5e){_0x1a0b72=_0x20cf5e;_0xb62450=0xc8;}else{_0xb62450=0xce;}_0x10b9ff[_0x4b57('0x18')](_0xb62450);return _0x10b9ff[_0x4b57('0x1f')](_0x4b57('0x20'),_0x4ede42+'-'+_0x1a0b72+'/'+_0x20cf5e)[_0x4b57('0x1a')](_0x284640);}return null;};}function patchUpdates(_0x4454c8){return function(_0x4f407d){try{jsonpatch[_0x4b57('0x21')](_0x4f407d,_0x4454c8,!![]);}catch(_0x131fed){return BPromise[_0x4b57('0x22')](_0x131fed);}return _0x4f407d['save']();};}function saveUpdates(_0x380554,_0x4a34b2){return function(_0x286c7d){if(_0x286c7d){return _0x286c7d[_0x4b57('0x23')](_0x380554)['then'](function(_0x271361){return _0x271361;});}return null;};}function removeEntity(_0x368c5f,_0x4d07c9){return function(_0x3e7b96){if(_0x3e7b96){return _0x3e7b96[_0x4b57('0x24')]()[_0x4b57('0x25')](function(){_0x368c5f[_0x4b57('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x156962,_0x51d0c3){return function(_0x131dab){if(!_0x131dab){_0x156962['sendStatus'](0x194);}return _0x131dab;};}function handleError(_0x36ceb1,_0x2dc9d8){_0x2dc9d8=_0x2dc9d8||0x1f4;return function(_0x4af2c8){logger[_0x4b57('0x26')](_0x4af2c8[_0x4b57('0x27')]);if(_0x4af2c8[_0x4b57('0x28')]){delete _0x4af2c8['name'];}_0x36ceb1['status'](_0x2dc9d8)[_0x4b57('0x29')](_0x4af2c8);};}exports['index']=function(_0x1ea0cb,_0x458f70){var _0x874cf7={},_0x3af22f={},_0x249461={'count':0x0,'rows':[]};var _0x2c20d2=_['map'](db[_0x4b57('0x2a')][_0x4b57('0x2b')],function(_0x68be27){return{'name':_0x68be27[_0x4b57('0x2c')],'type':_0x68be27['type'][_0x4b57('0x2d')]};});_0x3af22f[_0x4b57('0x2e')]=_['map'](_0x2c20d2,_0x4b57('0x28'));_0x3af22f[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x1ea0cb[_0x4b57('0x2f')]);_0x3af22f['filters']=_['intersection'](_0x3af22f['model'],_0x3af22f[_0x4b57('0x2f')]);_0x874cf7[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x3af22f[_0x4b57('0x2e')],qs[_0x4b57('0x33')](_0x1ea0cb['query'][_0x4b57('0x33')]));_0x874cf7[_0x4b57('0x31')]=_0x874cf7[_0x4b57('0x31')]['length']?_0x874cf7[_0x4b57('0x31')]:_0x3af22f[_0x4b57('0x2e')];if(!_0x1ea0cb[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x34'))){_0x874cf7[_0x4b57('0x1d')]=qs['limit'](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1d')]);_0x874cf7[_0x4b57('0x1b')]=qs[_0x4b57('0x1b')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x1b')]);}_0x874cf7['order']=qs[_0x4b57('0x35')](_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x35')]);_0x874cf7[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x1ea0cb[_0x4b57('0x2f')],_0x3af22f['filters']),_0x2c20d2);if(_0x1ea0cb['query'][_0x4b57('0x39')]){_0x874cf7[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x874cf7['where'],{'$or':_[_0x4b57('0x3b')](_0x2c20d2,function(_0x1a3c3a){if(_0x1a3c3a[_0x4b57('0x3c')]!==_0x4b57('0x3d')){var _0x5487cc={};_0x5487cc[_0x1a3c3a[_0x4b57('0x28')]]={'$like':'%'+_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x39')]+'%'};return _0x5487cc;}})});}_0x874cf7=_[_0x4b57('0x3a')]({},_0x874cf7,_0x1ea0cb['options']);var _0x5766a6={'where':_0x874cf7['where']};return db[_0x4b57('0x2a')][_0x4b57('0x1e')](_0x5766a6)[_0x4b57('0x25')](function(_0x2e23d3){_0x249461['count']=_0x2e23d3;if(_0x1ea0cb[_0x4b57('0x2f')][_0x4b57('0x3e')]){_0x874cf7[_0x4b57('0x3f')]=[{'all':!![]}];}return db[_0x4b57('0x2a')][_0x4b57('0x40')](_0x874cf7);})[_0x4b57('0x25')](function(_0x2d5a0c){_0x249461[_0x4b57('0x41')]=_0x2d5a0c;return _0x249461;})[_0x4b57('0x25')](respondWithFilteredResult(_0x458f70,_0x874cf7))['catch'](handleError(_0x458f70,null));};exports[_0x4b57('0x42')]=function(_0x3685fd,_0x3c5095){var _0x5b2f50={'raw':![],'where':{'id':_0x3685fd['params']['id']}},_0x44f988={};_0x44f988[_0x4b57('0x2e')]=_[_0x4b57('0x30')](db[_0x4b57('0x2a')][_0x4b57('0x2b')]);_0x44f988[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x3685fd[_0x4b57('0x2f')]);_0x44f988[_0x4b57('0x37')]=_[_0x4b57('0x32')](_0x44f988[_0x4b57('0x2e')],_0x44f988[_0x4b57('0x2f')]);_0x5b2f50[_0x4b57('0x31')]=_[_0x4b57('0x32')](_0x44f988['model'],qs['fields'](_0x3685fd[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x5b2f50[_0x4b57('0x31')]=_0x5b2f50[_0x4b57('0x31')]['length']?_0x5b2f50[_0x4b57('0x31')]:_0x44f988[_0x4b57('0x2e')];if(_0x3685fd['query'][_0x4b57('0x3e')]){_0x5b2f50['include']=[{'all':!![]}];}_0x5b2f50=_[_0x4b57('0x3a')]({},_0x5b2f50,_0x3685fd['options']);return db['ZendeskAccount'][_0x4b57('0x43')](_0x5b2f50)[_0x4b57('0x25')](handleEntityNotFound(_0x3c5095,null))['then'](respondWithResult(_0x3c5095,null))[_0x4b57('0x44')](handleError(_0x3c5095,null));};exports[_0x4b57('0x45')]=function(_0x2732ff,_0x1cf1f3){return db[_0x4b57('0x2a')][_0x4b57('0x45')](_0x2732ff['body'],{})[_0x4b57('0x25')](respondWithResult(_0x1cf1f3,0xc9))[_0x4b57('0x44')](handleError(_0x1cf1f3,null));};exports['update']=function(_0xd529fb,_0x23e852){if(_0xd529fb[_0x4b57('0x46')]['id']){delete _0xd529fb['body']['id'];}return db[_0x4b57('0x2a')]['find']({'where':{'id':_0xd529fb[_0x4b57('0x47')]['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x23e852,null))[_0x4b57('0x25')](saveUpdates(_0xd529fb[_0x4b57('0x46')],null))[_0x4b57('0x25')](respondWithResult(_0x23e852,null))[_0x4b57('0x44')](handleError(_0x23e852,null));};exports[_0x4b57('0x24')]=function(_0x3ec6ba,_0x5ab120){return db[_0x4b57('0x2a')][_0x4b57('0x43')]({'where':{'id':_0x3ec6ba[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ab120,null))[_0x4b57('0x25')](removeEntity(_0x5ab120,null))[_0x4b57('0x44')](handleError(_0x5ab120,null));};exports[_0x4b57('0x48')]=function(_0x488bea,_0x1579d1,_0x3d2336){var _0x343cec={};var _0xb56bf0={};var _0x44494f;var _0xb7c37c;return db[_0x4b57('0x2a')]['findOne']({'where':{'id':_0x488bea['params']['id']}})[_0x4b57('0x25')](handleEntityNotFound(_0x1579d1,null))[_0x4b57('0x25')](function(_0x3b4cbf){if(_0x3b4cbf){_0x44494f=_0x3b4cbf;_0xb56bf0[_0x4b57('0x2e')]=_['keys'](db[_0x4b57('0x49')][_0x4b57('0x2b')]);_0xb56bf0[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x488bea['query']);_0xb56bf0['filters']=_[_0x4b57('0x32')](_0xb56bf0[_0x4b57('0x2e')],_0xb56bf0['query']);_0x343cec['attributes']=_[_0x4b57('0x32')](_0xb56bf0['model'],qs[_0x4b57('0x33')](_0x488bea[_0x4b57('0x2f')][_0x4b57('0x33')]));_0x343cec[_0x4b57('0x31')]=_0x343cec[_0x4b57('0x31')]['length']?_0x343cec['attributes']:_0xb56bf0['model'];_0x343cec['order']=qs[_0x4b57('0x35')](_0x488bea[_0x4b57('0x2f')]['sort']);_0x343cec[_0x4b57('0x36')]=qs[_0x4b57('0x37')](_[_0x4b57('0x38')](_0x488bea[_0x4b57('0x2f')],_0xb56bf0[_0x4b57('0x37')]));if(_0x488bea[_0x4b57('0x2f')][_0x4b57('0x39')]){_0x343cec[_0x4b57('0x36')]=_[_0x4b57('0x3a')](_0x343cec['where'],{'$or':_[_0x4b57('0x3b')](_0x343cec['attributes'],function(_0x10bd32){var _0x2f684b={};_0x2f684b[_0x10bd32]={'$like':'%'+_0x488bea['query'][_0x4b57('0x39')]+'%'};return _0x2f684b;})});}_0x343cec=_[_0x4b57('0x3a')]({},_0x343cec,_0x488bea[_0x4b57('0x4a')]);return _0x44494f[_0x4b57('0x48')](_0x343cec);}})[_0x4b57('0x25')](function(_0xc24706){if(_0xc24706){_0xb7c37c=_0xc24706[_0x4b57('0x4b')];if(!_0x488bea[_0x4b57('0x2f')][_0x4b57('0x4c')](_0x4b57('0x34'))){_0x343cec[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0x488bea['query'][_0x4b57('0x1d')]);_0x343cec[_0x4b57('0x1b')]=qs['offset'](_0x488bea[_0x4b57('0x2f')]['offset']);}return _0x44494f['getConfigurations'](_0x343cec);}})['then'](function(_0x1004ac){if(_0x1004ac){return _0x1004ac?{'count':_0xb7c37c,'rows':_0x1004ac}:null;}})['then'](respondWithResult(_0x1579d1,null))[_0x4b57('0x44')](handleError(_0x1579d1,null));};exports[_0x4b57('0x4d')]=function(_0x5e093a,_0x4cc278,_0x264c9f){if(_0x5e093a[_0x4b57('0x46')]['id']){delete _0x5e093a[_0x4b57('0x46')]['id'];}return db['ZendeskAccount'][_0x4b57('0x4e')]({'where':{'id':_0x5e093a[_0x4b57('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cc278,null))[_0x4b57('0x25')](function(_0x119933){if(_0x119933){_0x5e093a['body'][_0x4b57('0x4f')]=_0x119933['id'];_0x5e093a[_0x4b57('0x46')][_0x4b57('0x50')]=integrations[_0x4b57('0x51')](_0x5e093a[_0x4b57('0x46')][_0x4b57('0x52')],_0x5e093a[_0x4b57('0x46')]['type']);_0x5e093a['body'][_0x4b57('0x53')]=integrations[_0x4b57('0x54')](_0x5e093a['body']['channel'],_0x5e093a[_0x4b57('0x46')][_0x4b57('0x3c')]);return db['ZendeskConfiguration']['create'](_0x5e093a['body'],{'include':[{'model':db[_0x4b57('0x55')],'as':_0x4b57('0x50')},{'model':db[_0x4b57('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x4cc278,null))['catch'](handleError(_0x4cc278,null));};exports[_0x4b57('0x56')]=function(_0x59cd7c,_0x40cabe,_0x502313){var _0x13c680='';return db[_0x4b57('0x2a')][_0x4b57('0x4e')]({'where':{'id':_0x59cd7c[_0x4b57('0x47')]['id']},'attributes':['id','username',_0x4b57('0x57'),'token','authType',_0x4b57('0x58')]})[_0x4b57('0x25')](handleEntityNotFound(_0x40cabe,null))['then'](function(_0xf54f38){if(_0xf54f38){_0x13c680=_0xf54f38[_0x4b57('0x58')];var _0x355b5b=_0x13c680[_0x4b57('0x59')](-0x1);if(_0x355b5b==='/'){_0x13c680=_0x13c680[_0x4b57('0x5a')](0x0,_0x13c680[_0x4b57('0x5b')](_0x355b5b));}var _0x57e9eb={'method':_0x4b57('0x5c'),'uri':util[_0x4b57('0x5d')](_0x4b57('0x5e'),_0x13c680,_0x4b57('0x5f')),'json':!![]};switch(_0xf54f38[_0x4b57('0x60')]){case'password':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util[_0x4b57('0x5d')](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x57')]))[_0x4b57('0x63')](_0x4b57('0x64')))};break;case'token':_0x57e9eb[_0x4b57('0x61')]={'Authorization':util['format'](_0x4b57('0x62'),new Buffer(util[_0x4b57('0x5d')]('%s/token:%s',_0xf54f38['username'],_0xf54f38[_0x4b57('0x65')]))['toString'](_0x4b57('0x64')))};break;default:throw new db[(_0x4b57('0x66'))][(_0x4b57('0x67'))](_0x4b57('0x68'));}return rp(_0x57e9eb);}})[_0x4b57('0x25')](function(_0x489f3c){if(_0x489f3c){var _0x137532=[_0x4b57('0x69'),_0x4b57('0x6a'),'group','assignee'];_[_0x4b57('0x6b')](_0x489f3c[_0x4b57('0x5f')],function(_0x540a0a){return _0x137532[_0x4b57('0x6c')](_0x540a0a[_0x4b57('0x3c')]);});return{'count':_0x489f3c['ticket_fields'][_0x4b57('0x4b')],'rows':_[_0x4b57('0x3b')](_0x489f3c['ticket_fields'],function(_0xdef470){return{'id':_0xdef470['id'],'name':_0xdef470[_0x4b57('0x6d')]>0x7?_0xdef470[_0x4b57('0x6e')]:_0xdef470['type'],'custom':_0xdef470[_0x4b57('0x6d')]>0x7?!![]:![],'options':_0xdef470[_0x4b57('0x6f')]?_0xdef470[_0x4b57('0x6f')]:_0xdef470[_0x4b57('0x70')]?_0xdef470[_0x4b57('0x70')]:[]};})};}})[_0x4b57('0x25')](respondWithResult(_0x40cabe,null))[_0x4b57('0x44')](function(_0x4e4bbd){var _0x183b8c=_0x59cd7c[_0x4b57('0x2f')]['test']?0x1f4:_0x4e4bbd[_0x4b57('0x71')]||0x1f4;logger[_0x4b57('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x4b57('0x56'),_0x183b8c,JSON[_0x4b57('0x72')](_0x4e4bbd));delete _0x4e4bbd[_0x4b57('0x28')];if(_0x183b8c===0x191){_0x183b8c=0x190;}_0x40cabe[_0x4b57('0x18')](_0x183b8c)[_0x4b57('0x29')](_0x59cd7c[_0x4b57('0x2f')][_0x4b57('0x73')]?{'message':_0x4b57('0x74'),'statusCode':_0x4e4bbd[_0x4b57('0x71')]}:_0x4e4bbd);});};
\ No newline at end of file
+var _0x4ded=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','intersection','include','find','create','body','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','username','password','token','authType','remoteUri','substring','format','%s/%s','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','subject','description','group','assignee','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','type','model','query','filters','fields','attributes','length'];(function(_0x28ac81,_0x426299){var _0x4e4902=function(_0x315171){while(--_0x315171){_0x28ac81['push'](_0x28ac81['shift']());}};_0x4e4902(++_0x426299);}(_0x4ded,0x116));var _0xd4de=function(_0x4b46fd,_0x74b0cb){_0x4b46fd=_0x4b46fd-0x0;var _0x1ebbb1=_0x4ded[_0x4b46fd];return _0x1ebbb1;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];var integrations=require(_0xd4de('0x18'));function respondWithStatusCode(_0x2aa09d,_0x3ffc72){_0x3ffc72=_0x3ffc72||0xcc;return function(_0x3af6e0){if(_0x3af6e0){return _0x2aa09d[_0xd4de('0x19')](_0x3ffc72);}return _0x2aa09d[_0xd4de('0x1a')](_0x3ffc72)[_0xd4de('0x1b')]();};}function respondWithResult(_0x37cb9f,_0x691ba9){_0x691ba9=_0x691ba9||0xc8;return function(_0xd0d906){if(_0xd0d906){return _0x37cb9f[_0xd4de('0x1a')](_0x691ba9)[_0xd4de('0x1c')](_0xd0d906);}};}function respondWithFilteredResult(_0x102e5b,_0xa7c18b){return function(_0x325fba){if(_0x325fba){var _0x4b0a95=typeof _0xa7c18b['offset']===_0xd4de('0x1d')&&typeof _0xa7c18b[_0xd4de('0x1e')]===_0xd4de('0x1d');var _0x428aa2=_0x325fba['count'];var _0x4d0df6=_0x4b0a95?0x0:_0xa7c18b[_0xd4de('0x1f')];var _0x54b757=_0x4b0a95?_0x325fba[_0xd4de('0x20')]:_0xa7c18b[_0xd4de('0x1f')]+_0xa7c18b['limit'];var _0xc15081;if(_0x54b757>=_0x428aa2){_0x54b757=_0x428aa2;_0xc15081=0xc8;}else{_0xc15081=0xce;}_0x102e5b['status'](_0xc15081);return _0x102e5b[_0xd4de('0x21')](_0xd4de('0x22'),_0x4d0df6+'-'+_0x54b757+'/'+_0x428aa2)[_0xd4de('0x1c')](_0x325fba);}return null;};}function patchUpdates(_0x8e8712){return function(_0x5368f5){try{jsonpatch[_0xd4de('0x23')](_0x5368f5,_0x8e8712,!![]);}catch(_0x47311c){return BPromise[_0xd4de('0x24')](_0x47311c);}return _0x5368f5[_0xd4de('0x25')]();};}function saveUpdates(_0x1c631a,_0x2d092a){return function(_0x1561fd){if(_0x1561fd){return _0x1561fd[_0xd4de('0x26')](_0x1c631a)[_0xd4de('0x27')](function(_0x413f68){return _0x413f68;});}return null;};}function removeEntity(_0x534b37,_0xad333f){return function(_0x88a0b9){if(_0x88a0b9){return _0x88a0b9[_0xd4de('0x28')]()[_0xd4de('0x27')](function(){_0x534b37[_0xd4de('0x1a')](0xcc)[_0xd4de('0x1b')]();});}};}function handleEntityNotFound(_0xffe1cc,_0x36308c){return function(_0x2aa82a){if(!_0x2aa82a){_0xffe1cc[_0xd4de('0x19')](0x194);}return _0x2aa82a;};}function handleError(_0x2ea712,_0xb2d8a1){_0xb2d8a1=_0xb2d8a1||0x1f4;return function(_0x586126){logger[_0xd4de('0x29')](_0x586126[_0xd4de('0x2a')]);if(_0x586126['name']){delete _0x586126[_0xd4de('0x2b')];}_0x2ea712['status'](_0xb2d8a1)[_0xd4de('0x2c')](_0x586126);};}exports[_0xd4de('0x2d')]=function(_0x15d2b7,_0x4fa53a){var _0xd4de93={},_0x36f2f1={},_0x17f0a={'count':0x0,'rows':[]};var _0x50cb73=_[_0xd4de('0x2e')](db[_0xd4de('0x2f')]['rawAttributes'],function(_0x5103b5){return{'name':_0x5103b5['fieldName'],'type':_0x5103b5[_0xd4de('0x30')]['key']};});_0x36f2f1[_0xd4de('0x31')]=_[_0xd4de('0x2e')](_0x50cb73,_0xd4de('0x2b'));_0x36f2f1[_0xd4de('0x32')]=_['keys'](_0x15d2b7[_0xd4de('0x32')]);_0x36f2f1[_0xd4de('0x33')]=_['intersection'](_0x36f2f1[_0xd4de('0x31')],_0x36f2f1[_0xd4de('0x32')]);_0xd4de93['attributes']=_['intersection'](_0x36f2f1[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x34')]));_0xd4de93['attributes']=_0xd4de93[_0xd4de('0x35')][_0xd4de('0x36')]?_0xd4de93['attributes']:_0x36f2f1[_0xd4de('0x31')];if(!_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x37')](_0xd4de('0x38'))){_0xd4de93[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x15d2b7['query']['limit']);_0xd4de93[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x15d2b7[_0xd4de('0x32')]['offset']);}_0xd4de93[_0xd4de('0x39')]=qs[_0xd4de('0x3a')](_0x15d2b7['query'][_0xd4de('0x3a')]);_0xd4de93[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_[_0xd4de('0x3c')](_0x15d2b7['query'],_0x36f2f1['filters']),_0x50cb73);if(_0x15d2b7[_0xd4de('0x32')]['filter']){_0xd4de93[_0xd4de('0x3b')]=_['merge'](_0xd4de93[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x50cb73,function(_0x21cd77){if(_0x21cd77[_0xd4de('0x30')]!=='VIRTUAL'){var _0x21209d={};_0x21209d[_0x21cd77['name']]={'$like':'%'+_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x3d')]+'%'};return _0x21209d;}})});}_0xd4de93=_[_0xd4de('0x3e')]({},_0xd4de93,_0x15d2b7[_0xd4de('0x3f')]);var _0x349c5f={'where':_0xd4de93[_0xd4de('0x3b')]};return db[_0xd4de('0x2f')]['count'](_0x349c5f)[_0xd4de('0x27')](function(_0x1eb001){_0x17f0a[_0xd4de('0x20')]=_0x1eb001;if(_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x40')]){_0xd4de93['include']=[{'all':!![]}];}return db[_0xd4de('0x2f')][_0xd4de('0x41')](_0xd4de93);})[_0xd4de('0x27')](function(_0x593ee9){_0x17f0a[_0xd4de('0x42')]=_0x593ee9;return _0x17f0a;})[_0xd4de('0x27')](respondWithFilteredResult(_0x4fa53a,_0xd4de93))[_0xd4de('0x43')](handleError(_0x4fa53a,null));};exports['show']=function(_0x3b9026,_0x10a42c){var _0x419c49={'raw':![],'where':{'id':_0x3b9026[_0xd4de('0x44')]['id']}},_0x3f1e22={};_0x3f1e22[_0xd4de('0x31')]=_[_0xd4de('0x45')](db['ZendeskAccount'][_0xd4de('0x46')]);_0x3f1e22[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x3b9026['query']);_0x3f1e22[_0xd4de('0x33')]=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],_0x3f1e22['query']);_0x419c49['attributes']=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],qs['fields'](_0x3b9026[_0xd4de('0x32')][_0xd4de('0x34')]));_0x419c49[_0xd4de('0x35')]=_0x419c49[_0xd4de('0x35')]['length']?_0x419c49[_0xd4de('0x35')]:_0x3f1e22[_0xd4de('0x31')];if(_0x3b9026[_0xd4de('0x32')][_0xd4de('0x40')]){_0x419c49[_0xd4de('0x48')]=[{'all':!![]}];}_0x419c49=_[_0xd4de('0x3e')]({},_0x419c49,_0x3b9026['options']);return db[_0xd4de('0x2f')][_0xd4de('0x49')](_0x419c49)[_0xd4de('0x27')](handleEntityNotFound(_0x10a42c,null))[_0xd4de('0x27')](respondWithResult(_0x10a42c,null))[_0xd4de('0x43')](handleError(_0x10a42c,null));};exports[_0xd4de('0x4a')]=function(_0x40bf55,_0x425a7e){return db[_0xd4de('0x2f')][_0xd4de('0x4a')](_0x40bf55['body'],{})[_0xd4de('0x27')](respondWithResult(_0x425a7e,0xc9))[_0xd4de('0x43')](handleError(_0x425a7e,null));};exports[_0xd4de('0x26')]=function(_0x518bfe,_0x13a900){if(_0x518bfe[_0xd4de('0x4b')]['id']){delete _0x518bfe[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x518bfe[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x13a900,null))[_0xd4de('0x27')](saveUpdates(_0x518bfe[_0xd4de('0x4b')],null))[_0xd4de('0x27')](respondWithResult(_0x13a900,null))['catch'](handleError(_0x13a900,null));};exports[_0xd4de('0x28')]=function(_0x26d032,_0x215f85){return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x26d032['params']['id']}})['then'](handleEntityNotFound(_0x215f85,null))[_0xd4de('0x27')](removeEntity(_0x215f85,null))[_0xd4de('0x43')](handleError(_0x215f85,null));};exports['getConfigurations']=function(_0x48cb7d,_0x2d8589,_0x368081){var _0x377376={};var _0x199440={};var _0x34d772;var _0x15c8cd;return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x48cb7d[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x2d8589,null))[_0xd4de('0x27')](function(_0x2e1780){if(_0x2e1780){_0x34d772=_0x2e1780;_0x199440['model']=_[_0xd4de('0x45')](db[_0xd4de('0x4d')][_0xd4de('0x46')]);_0x199440[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x48cb7d[_0xd4de('0x32')]);_0x199440['filters']=_[_0xd4de('0x47')](_0x199440['model'],_0x199440['query']);_0x377376[_0xd4de('0x35')]=_[_0xd4de('0x47')](_0x199440[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x48cb7d['query'][_0xd4de('0x34')]));_0x377376[_0xd4de('0x35')]=_0x377376[_0xd4de('0x35')][_0xd4de('0x36')]?_0x377376[_0xd4de('0x35')]:_0x199440['model'];_0x377376['order']=qs['sort'](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3a')]);_0x377376[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_['pick'](_0x48cb7d[_0xd4de('0x32')],_0x199440[_0xd4de('0x33')]));if(_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3d')]){_0x377376['where']=_[_0xd4de('0x3e')](_0x377376[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x377376[_0xd4de('0x35')],function(_0x598b60){var _0x4fd7c2={};_0x4fd7c2[_0x598b60]={'$like':'%'+_0x48cb7d['query'][_0xd4de('0x3d')]+'%'};return _0x4fd7c2;})});}_0x377376=_[_0xd4de('0x3e')]({},_0x377376,_0x48cb7d[_0xd4de('0x3f')]);return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x3005c2){if(_0x3005c2){_0x15c8cd=_0x3005c2[_0xd4de('0x36')];if(!_0x48cb7d['query'][_0xd4de('0x37')]('nolimit')){_0x377376[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1e')]);_0x377376[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1f')]);}return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x59f9d9){if(_0x59f9d9){return _0x59f9d9?{'count':_0x15c8cd,'rows':_0x59f9d9}:null;}})[_0xd4de('0x27')](respondWithResult(_0x2d8589,null))[_0xd4de('0x43')](handleError(_0x2d8589,null));};exports['addConfiguration']=function(_0x29c840,_0xb366b0,_0x21f7f7){if(_0x29c840[_0xd4de('0x4b')]['id']){delete _0x29c840[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x29c840[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0xb366b0,null))[_0xd4de('0x27')](function(_0x1e7e93){if(_0x1e7e93){_0x29c840[_0xd4de('0x4b')][_0xd4de('0x4e')]=_0x1e7e93['id'];_0x29c840['body'][_0xd4de('0x4f')]=integrations[_0xd4de('0x50')](_0x29c840[_0xd4de('0x4b')][_0xd4de('0x51')],_0x29c840[_0xd4de('0x4b')][_0xd4de('0x30')]);_0x29c840[_0xd4de('0x4b')][_0xd4de('0x52')]=integrations['getDescriptions'](_0x29c840[_0xd4de('0x4b')]['channel'],_0x29c840['body']['type']);return db[_0xd4de('0x4d')][_0xd4de('0x4a')](_0x29c840['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0xd4de('0x52')}]});}return null;})['then'](respondWithResult(_0xb366b0,null))[_0xd4de('0x43')](handleError(_0xb366b0,null));};exports['getFields']=function(_0x1a0e6c,_0x223b1a,_0x4ee475){var _0x5df891='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x1a0e6c[_0xd4de('0x44')]['id']},'attributes':['id',_0xd4de('0x53'),_0xd4de('0x54'),_0xd4de('0x55'),_0xd4de('0x56'),_0xd4de('0x57')]})['then'](handleEntityNotFound(_0x223b1a,null))['then'](function(_0x53cbd9){if(_0x53cbd9){_0x5df891=_0x53cbd9[_0xd4de('0x57')];var _0x2bb19d=_0x5df891['slice'](-0x1);if(_0x2bb19d==='/'){_0x5df891=_0x5df891[_0xd4de('0x58')](0x0,_0x5df891['lastIndexOf'](_0x2bb19d));}var _0x1bc101={'method':'GET','uri':util[_0xd4de('0x59')](_0xd4de('0x5a'),_0x5df891,'ticket_fields'),'json':!![]};switch(_0x53cbd9[_0xd4de('0x56')]){case'password':_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')]('%s:%s',_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x54')]))[_0xd4de('0x5d')](_0xd4de('0x5e')))};break;case _0xd4de('0x55'):_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')](_0xd4de('0x5f'),_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x55')]))[_0xd4de('0x5d')]('base64'))};break;default:throw new db[(_0xd4de('0x60'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x1bc101);}})[_0xd4de('0x27')](function(_0x595ee){if(_0x595ee){var _0x5f197d=[_0xd4de('0x61'),_0xd4de('0x62'),_0xd4de('0x63'),_0xd4de('0x64')];_['remove'](_0x595ee[_0xd4de('0x65')],function(_0xee18fc){return _0x5f197d[_0xd4de('0x66')](_0xee18fc[_0xd4de('0x30')]);});return{'count':_0x595ee[_0xd4de('0x65')]['length'],'rows':_['map'](_0x595ee['ticket_fields'],function(_0x4a2467){return{'id':_0x4a2467['id'],'name':_0x4a2467[_0xd4de('0x67')]>0x7?_0x4a2467['title']:_0x4a2467[_0xd4de('0x30')],'custom':_0x4a2467['position']>0x7?!![]:![],'options':_0x4a2467[_0xd4de('0x68')]?_0x4a2467[_0xd4de('0x68')]:_0x4a2467[_0xd4de('0x69')]?_0x4a2467[_0xd4de('0x69')]:[]};})};}})[_0xd4de('0x27')](respondWithResult(_0x223b1a,null))[_0xd4de('0x43')](function(_0x15f056){var _0x31b518=_0x1a0e6c['query'][_0xd4de('0x6a')]?0x1f4:_0x15f056[_0xd4de('0x6b')]||0x1f4;logger[_0xd4de('0x29')](_0xd4de('0x6c'),'getFields',_0x31b518,JSON[_0xd4de('0x6d')](_0x15f056));delete _0x15f056[_0xd4de('0x2b')];if(_0x31b518===0x191){_0x31b518=0x190;}_0x223b1a['status'](_0x31b518)[_0xd4de('0x2c')](_0x1a0e6c[_0xd4de('0x32')][_0xd4de('0x6a')]?{'message':_0xd4de('0x6e'),'statusCode':_0x15f056[_0xd4de('0x6b')]}:_0x15f056);});};
\ No newline at end of file
index b3011b8..4e701c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387c=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x29f822,_0x59d977){var _0x2fe6f3=function(_0x355fb6){while(--_0x355fb6){_0x29f822['push'](_0x29f822['shift']());}};_0x2fe6f3(++_0x59d977);}(_0x387c,0x1a4));var _0xc387=function(_0xea6018,_0x4cf082){_0xea6018=_0xea6018-0x0;var _0x57b54d=_0x387c[_0xea6018];return _0x57b54d;};'use strict';var _=require(_0xc387('0x0'));var util=require(_0xc387('0x1'));var logger=require(_0xc387('0x2'))(_0xc387('0x3'));var moment=require('moment');var BPromise=require(_0xc387('0x4'));var rp=require(_0xc387('0x5'));var fs=require('fs');var path=require(_0xc387('0x6'));var rimraf=require(_0xc387('0x7'));var config=require(_0xc387('0x8'));var attributes=require(_0xc387('0x9'));var integrations=require(_0xc387('0xa'));module['exports']=function(_0x4d3a51,_0x23a2ad){return _0x4d3a51[_0xc387('0xb')](_0xc387('0xc'),attributes,{'tableName':_0xc387('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbeb=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xbbeb,0x86));var _0xbbbe=function(_0x19ee96,_0x48b7d5){_0x19ee96=_0x19ee96-0x0;var _0x57aaf0=_0xbbeb[_0x19ee96];return _0x57aaf0;};'use strict';var _=require(_0xbbbe('0x0'));var util=require('util');var logger=require(_0xbbbe('0x1'))(_0xbbbe('0x2'));var moment=require(_0xbbbe('0x3'));var BPromise=require(_0xbbbe('0x4'));var rp=require(_0xbbbe('0x5'));var fs=require('fs');var path=require(_0xbbbe('0x6'));var rimraf=require(_0xbbbe('0x7'));var config=require(_0xbbbe('0x8'));var attributes=require(_0xbbbe('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xbbbe('0xa')]=function(_0x497717,_0x58c4b0){return _0x497717[_0xbbbe('0xb')](_0xbbbe('0xc'),attributes,{'tableName':_0xbbbe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 836bf67..951b8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0efc=['client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','find','raw','ShowZendeskAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0efc,0x1b2));var _0xc0ef=function(_0x9fe3ce,_0x24796e){_0x9fe3ce=_0x9fe3ce-0x0;var _0x7aa9a0=_0x0efc[_0x9fe3ce];return _0x7aa9a0;};'use strict';var _=require(_0xc0ef('0x0'));var util=require(_0xc0ef('0x1'));var moment=require('moment');var BPromise=require(_0xc0ef('0x2'));var rs=require(_0xc0ef('0x3'));var fs=require('fs');var Redis=require(_0xc0ef('0x4'));var db=require(_0xc0ef('0x5'))['db'];var utils=require(_0xc0ef('0x6'));var logger=require(_0xc0ef('0x7'))(_0xc0ef('0x8'));var config=require(_0xc0ef('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc0ef('0xa')][_0xc0ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d237f,_0x154f14,_0x7c5b0e){return new BPromise(function(_0x11b1ce,_0x5b5d09){return client[_0xc0ef('0xc')](_0x5d237f,_0x7c5b0e)[_0xc0ef('0xd')](function(_0x541d80){logger[_0xc0ef('0xe')](_0xc0ef('0xf'),_0x154f14,_0xc0ef('0x10'));logger[_0xc0ef('0x11')](_0xc0ef('0x12'),_0x154f14,'request\x20sent',JSON['stringify'](_0x541d80));if(_0x541d80[_0xc0ef('0x13')]){if(_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x14')]===0x1f4){logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x541d80[_0xc0ef('0x13')]['message']);return _0x5b5d09(_0x541d80['error'][_0xc0ef('0x15')]);}logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x15')]);return _0x11b1ce(_0x541d80[_0xc0ef('0x13')][_0xc0ef('0x15')]);}else{logger[_0xc0ef('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0x154f14,'request\x20sent');_0x11b1ce(_0x541d80[_0xc0ef('0x16')][_0xc0ef('0x15')]);}})['catch'](function(_0x1b1024){logger[_0xc0ef('0x13')](_0xc0ef('0xf'),_0x154f14,_0x1b1024);_0x5b5d09(_0x1b1024);});});}exports[_0xc0ef('0x17')]=function(_0x3c309e){var _0x340989=this;return new Promise(function(_0x9677d5,_0xcb6d50){return db[_0xc0ef('0x18')][_0xc0ef('0x19')]({'raw':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3c309e['options']?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1b')]||null:null,'attributes':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1c')]||null:null,'limit':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1d')]||null:null,'include':_0x3c309e[_0xc0ef('0x1a')]?_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1e')]?_['map'](_0x3c309e[_0xc0ef('0x1a')][_0xc0ef('0x1e')],function(_0x25c619){return{'model':db[_0x25c619[_0xc0ef('0x1f')]],'as':_0x25c619['as'],'attributes':_0x25c619[_0xc0ef('0x1c')],'include':_0x25c619[_0xc0ef('0x1e')]?_['map'](_0x25c619[_0xc0ef('0x1e')],function(_0x369601){return{'model':db[_0x369601[_0xc0ef('0x1f')]],'as':_0x369601['as'],'attributes':_0x369601[_0xc0ef('0x1c')],'include':_0x369601[_0xc0ef('0x1e')]?_[_0xc0ef('0x20')](_0x369601[_0xc0ef('0x1e')],function(_0x210591){return{'model':db[_0x210591['model']],'as':_0x210591['as'],'attributes':_0x210591[_0xc0ef('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0ef('0xd')](function(_0x7a19c){logger[_0xc0ef('0xe')](_0xc0ef('0x17'),_0x3c309e);logger[_0xc0ef('0x11')](_0xc0ef('0x17'),_0x3c309e,JSON['stringify'](_0x7a19c));_0x9677d5(_0x7a19c);})['catch'](function(_0x42b9cf){logger['error'](_0xc0ef('0x17'),_0x42b9cf[_0xc0ef('0x15')],_0x3c309e);_0xcb6d50(_0x340989['error'](0x1f4,_0x42b9cf[_0xc0ef('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x3db5c1){var _0x32f57b=this;return new Promise(function(_0x51991e,_0x1cba92){return db[_0xc0ef('0x18')][_0xc0ef('0x21')]({'raw':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1['options'][_0xc0ef('0x22')]===undefined?!![]:![]:!![],'where':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1[_0xc0ef('0x1a')]['where']||null:null,'attributes':_0x3db5c1['options']?_0x3db5c1[_0xc0ef('0x1a')][_0xc0ef('0x1c')]||null:null,'include':_0x3db5c1[_0xc0ef('0x1a')]?_0x3db5c1[_0xc0ef('0x1a')]['include']?_[_0xc0ef('0x20')](_0x3db5c1['options'][_0xc0ef('0x1e')],function(_0x39a551){return{'model':db[_0x39a551[_0xc0ef('0x1f')]],'as':_0x39a551['as'],'attributes':_0x39a551['attributes'],'include':_0x39a551['include']?_[_0xc0ef('0x20')](_0x39a551['include'],function(_0x200029){return{'model':db[_0x200029[_0xc0ef('0x1f')]],'as':_0x200029['as'],'attributes':_0x200029['attributes'],'include':_0x200029['include']?_['map'](_0x200029[_0xc0ef('0x1e')],function(_0x380077){return{'model':db[_0x380077[_0xc0ef('0x1f')]],'as':_0x380077['as'],'attributes':_0x380077[_0xc0ef('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc0ef('0xd')](function(_0x3b52ed){logger[_0xc0ef('0xe')](_0xc0ef('0x23'),_0x3db5c1);logger[_0xc0ef('0x11')](_0xc0ef('0x23'),_0x3db5c1,JSON['stringify'](_0x3b52ed));_0x51991e(_0x3b52ed);})[_0xc0ef('0x24')](function(_0x8635ff){logger[_0xc0ef('0x13')](_0xc0ef('0x23'),_0x8635ff[_0xc0ef('0x15')],_0x3db5c1);_0x1cba92(_0x32f57b[_0xc0ef('0x13')](0x1f4,_0x8635ff[_0xc0ef('0x15')]));});});};
\ No newline at end of file
+var _0x88f1=['jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','where','attributes','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x3db13a,_0xadef1){var _0x7cb66f=function(_0x3aa7d6){while(--_0x3aa7d6){_0x3db13a['push'](_0x3db13a['shift']());}};_0x7cb66f(++_0xadef1);}(_0x88f1,0x1a4));var _0x188f=function(_0x295495,_0x19ab14){_0x295495=_0x295495-0x0;var _0x38962d=_0x88f1[_0x295495];return _0x38962d;};'use strict';var _=require(_0x188f('0x0'));var util=require(_0x188f('0x1'));var moment=require(_0x188f('0x2'));var BPromise=require(_0x188f('0x3'));var rs=require(_0x188f('0x4'));var fs=require('fs');var Redis=require(_0x188f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x188f('0x6'));var logger=require('../../config/logger')(_0x188f('0x7'));var config=require(_0x188f('0x8'));var jayson=require(_0x188f('0x9'));var client=jayson['client'][_0x188f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb2ed17,_0x3c1169,_0x4c6f1b){return new BPromise(function(_0x1d1347,_0x16995f){return client[_0x188f('0xb')](_0xb2ed17,_0x4c6f1b)[_0x188f('0xc')](function(_0x27ca04){logger[_0x188f('0xd')](_0x188f('0xe'),_0x3c1169,_0x188f('0xf'));logger[_0x188f('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3c1169,_0x188f('0xf'),JSON[_0x188f('0x11')](_0x27ca04));if(_0x27ca04[_0x188f('0x12')]){if(_0x27ca04[_0x188f('0x12')][_0x188f('0x13')]===0x1f4){logger['error'](_0x188f('0xe'),_0x3c1169,_0x27ca04[_0x188f('0x12')][_0x188f('0x14')]);return _0x16995f(_0x27ca04['error'][_0x188f('0x14')]);}logger[_0x188f('0x12')](_0x188f('0xe'),_0x3c1169,_0x27ca04['error'][_0x188f('0x14')]);return _0x1d1347(_0x27ca04[_0x188f('0x12')][_0x188f('0x14')]);}else{logger[_0x188f('0xd')](_0x188f('0xe'),_0x3c1169,_0x188f('0xf'));_0x1d1347(_0x27ca04[_0x188f('0x15')][_0x188f('0x14')]);}})[_0x188f('0x16')](function(_0x54ab14){logger[_0x188f('0x12')](_0x188f('0xe'),_0x3c1169,_0x54ab14);_0x16995f(_0x54ab14);});});}exports[_0x188f('0x17')]=function(_0xcd22ee){var _0xcedd=this;return new Promise(function(_0x5b9ebe,_0x4eb040){return db['ZendeskAccount'][_0x188f('0x18')]({'raw':_0xcd22ee['options']?_0xcd22ee[_0x188f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xcd22ee[_0x188f('0x19')]?_0xcd22ee[_0x188f('0x19')][_0x188f('0x1a')]||null:null,'attributes':_0xcd22ee[_0x188f('0x19')]?_0xcd22ee[_0x188f('0x19')][_0x188f('0x1b')]||null:null,'limit':_0xcd22ee[_0x188f('0x19')]?_0xcd22ee[_0x188f('0x19')]['limit']||null:null,'include':_0xcd22ee[_0x188f('0x19')]?_0xcd22ee['options'][_0x188f('0x1c')]?_[_0x188f('0x1d')](_0xcd22ee['options'][_0x188f('0x1c')],function(_0x56c5b9){return{'model':db[_0x56c5b9[_0x188f('0x1e')]],'as':_0x56c5b9['as'],'attributes':_0x56c5b9[_0x188f('0x1b')],'include':_0x56c5b9[_0x188f('0x1c')]?_['map'](_0x56c5b9['include'],function(_0x2eb10d){return{'model':db[_0x2eb10d[_0x188f('0x1e')]],'as':_0x2eb10d['as'],'attributes':_0x2eb10d[_0x188f('0x1b')],'include':_0x2eb10d[_0x188f('0x1c')]?_[_0x188f('0x1d')](_0x2eb10d[_0x188f('0x1c')],function(_0x2fc088){return{'model':db[_0x2fc088[_0x188f('0x1e')]],'as':_0x2fc088['as'],'attributes':_0x2fc088['attributes']};}):[]};}):[]};}):[]:[]})[_0x188f('0xc')](function(_0x456bd8){logger[_0x188f('0xd')](_0x188f('0x17'),_0xcd22ee);logger[_0x188f('0x10')]('GetZendeskAccount',_0xcd22ee,JSON[_0x188f('0x11')](_0x456bd8));_0x5b9ebe(_0x456bd8);})[_0x188f('0x16')](function(_0x425ee9){logger['error']('GetZendeskAccount',_0x425ee9['message'],_0xcd22ee);_0x4eb040(_0xcedd['error'](0x1f4,_0x425ee9[_0x188f('0x14')]));});});};exports[_0x188f('0x1f')]=function(_0xa86d58){var _0x1db250=this;return new Promise(function(_0x5daf01,_0x11c871){return db['ZendeskAccount'][_0x188f('0x20')]({'raw':_0xa86d58[_0x188f('0x19')]?_0xa86d58[_0x188f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xa86d58['options']?_0xa86d58[_0x188f('0x19')][_0x188f('0x1a')]||null:null,'attributes':_0xa86d58[_0x188f('0x19')]?_0xa86d58[_0x188f('0x19')][_0x188f('0x1b')]||null:null,'include':_0xa86d58[_0x188f('0x19')]?_0xa86d58[_0x188f('0x19')]['include']?_[_0x188f('0x1d')](_0xa86d58['options'][_0x188f('0x1c')],function(_0x48434a){return{'model':db[_0x48434a['model']],'as':_0x48434a['as'],'attributes':_0x48434a['attributes'],'include':_0x48434a[_0x188f('0x1c')]?_['map'](_0x48434a[_0x188f('0x1c')],function(_0x2adce2){return{'model':db[_0x2adce2[_0x188f('0x1e')]],'as':_0x2adce2['as'],'attributes':_0x2adce2[_0x188f('0x1b')],'include':_0x2adce2[_0x188f('0x1c')]?_[_0x188f('0x1d')](_0x2adce2[_0x188f('0x1c')],function(_0xd3618){return{'model':db[_0xd3618[_0x188f('0x1e')]],'as':_0xd3618['as'],'attributes':_0xd3618['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x8c3a9a){logger[_0x188f('0xd')](_0x188f('0x1f'),_0xa86d58);logger[_0x188f('0x10')]('ShowZendeskAccount',_0xa86d58,JSON[_0x188f('0x11')](_0x8c3a9a));_0x5daf01(_0x8c3a9a);})['catch'](function(_0x462e95){logger[_0x188f('0x12')]('ShowZendeskAccount',_0x462e95[_0x188f('0x14')],_0xa86d58);_0x11c871(_0x1db250[_0x188f('0x12')](0x1f4,_0x462e95[_0x188f('0x14')]));});});};
\ No newline at end of file
index ed5a456..3799d67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x4403d5,_0x5ce2a4){var _0x348285=function(_0x56046f){while(--_0x56046f){_0x4403d5['push'](_0x4403d5['shift']());}};_0x348285(++_0x5ce2a4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2630a6,_0x2a1431){_0x2630a6=_0x2630a6-0x0;var _0x46ffce=_0xf4eb[_0x2630a6];return _0x46ffce;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router;
\ No newline at end of file
+var _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x878f,0x173));var _0xf878=function(_0x3bfa91,_0x3f27ef){_0x3bfa91=_0x3bfa91-0x0;var _0x2472df=_0x878f[_0x3bfa91];return _0x2472df;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router;
\ No newline at end of file
index 6ff0983..5d71a59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a1f=['exports','STRING'];(function(_0x2b7bb0,_0x173e08){var _0x113fd6=function(_0x18cfa4){while(--_0x18cfa4){_0x2b7bb0['push'](_0x2b7bb0['shift']());}};_0x113fd6(++_0x173e08);}(_0x9a1f,0x12e));var _0xf9a1=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x9a1f[_0x1b5aea];return _0x15cfc6;};'use strict';var Sequelize=require('sequelize');module[_0xf9a1('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9a1('0x1')]}};
\ No newline at end of file
+var _0x7a30=['STRING','sequelize','exports'];(function(_0x3feba9,_0x41f51f){var _0x10565c=function(_0x1b7f08){while(--_0x1b7f08){_0x3feba9['push'](_0x3feba9['shift']());}};_0x10565c(++_0x41f51f);}(_0x7a30,0x97));var _0x07a3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a30[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x07a3('0x0'));module[_0x07a3('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x07a3('0x2')]}};
\ No newline at end of file
index 09f24ac..2b5eced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x435a=['../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','save','then','destroy','end','error','stack','name','send','ZendeskConfiguration','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','order','merge','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0x435a,0x1d0));var _0xa435=function(_0x1769e5,_0x449f13){_0x1769e5=_0x1769e5-0x0;var _0x153de8=_0x435a[_0x1769e5];return _0x153de8;};'use strict';var emlformat=require(_0xa435('0x0'));var rimraf=require(_0xa435('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa435('0x2'));var rp=require(_0xa435('0x3'));var moment=require(_0xa435('0x4'));var BPromise=require(_0xa435('0x5'));var Mustache=require(_0xa435('0x6'));var util=require(_0xa435('0x7'));var path=require(_0xa435('0x8'));var sox=require(_0xa435('0x9'));var csv=require(_0xa435('0xa'));var ejs=require(_0xa435('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa435('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa435('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa435('0xa'));var querystring=require('querystring');var Papa=require(_0xa435('0xe'));var Redis=require('ioredis');var authService=require(_0xa435('0xf'));var qs=require(_0xa435('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa435('0x11'));var logger=require(_0xa435('0x12'))(_0xa435('0x13'));var utils=require(_0xa435('0x14'));var config=require(_0xa435('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa435('0x16'))['db'];function respondWithStatusCode(_0x33057f,_0x126fa8){_0x126fa8=_0x126fa8||0xcc;return function(_0x3da2e2){if(_0x3da2e2){return _0x33057f[_0xa435('0x17')](_0x126fa8);}return _0x33057f[_0xa435('0x18')](_0x126fa8)['end']();};}function respondWithResult(_0x37b9e7,_0xa894){_0xa894=_0xa894||0xc8;return function(_0x3aa527){if(_0x3aa527){return _0x37b9e7[_0xa435('0x18')](_0xa894)[_0xa435('0x19')](_0x3aa527);}};}function respondWithFilteredResult(_0x3f20b1,_0x3edd11){return function(_0x1cc6f4){if(_0x1cc6f4){var _0x1767dc=typeof _0x3edd11['offset']===_0xa435('0x1a')&&typeof _0x3edd11[_0xa435('0x1b')]===_0xa435('0x1a');var _0x94d907=_0x1cc6f4['count'];var _0x59f8fd=_0x1767dc?0x0:_0x3edd11[_0xa435('0x1c')];var _0x33d02c=_0x1767dc?_0x1cc6f4[_0xa435('0x1d')]:_0x3edd11[_0xa435('0x1c')]+_0x3edd11[_0xa435('0x1b')];var _0x4ba853;if(_0x33d02c>=_0x94d907){_0x33d02c=_0x94d907;_0x4ba853=0xc8;}else{_0x4ba853=0xce;}_0x3f20b1[_0xa435('0x18')](_0x4ba853);return _0x3f20b1[_0xa435('0x1e')](_0xa435('0x1f'),_0x59f8fd+'-'+_0x33d02c+'/'+_0x94d907)['json'](_0x1cc6f4);}return null;};}function patchUpdates(_0x39d11e){return function(_0x2694c6){try{jsonpatch['apply'](_0x2694c6,_0x39d11e,!![]);}catch(_0x56fd86){return BPromise['reject'](_0x56fd86);}return _0x2694c6[_0xa435('0x20')]();};}function saveUpdates(_0x309f48,_0x442b39){return function(_0x33504d){if(_0x33504d){return _0x33504d['update'](_0x309f48)[_0xa435('0x21')](function(_0x76a890){return _0x76a890;});}return null;};}function removeEntity(_0x5017fc,_0x1b3496){return function(_0x433c9d){if(_0x433c9d){return _0x433c9d[_0xa435('0x22')]()[_0xa435('0x21')](function(){_0x5017fc['status'](0xcc)[_0xa435('0x23')]();});}};}function handleEntityNotFound(_0x5c7104,_0x80b96d){return function(_0x1e7c99){if(!_0x1e7c99){_0x5c7104[_0xa435('0x17')](0x194);}return _0x1e7c99;};}function handleError(_0x126c78,_0x3fa82d){_0x3fa82d=_0x3fa82d||0x1f4;return function(_0x5204b1){logger[_0xa435('0x24')](_0x5204b1[_0xa435('0x25')]);if(_0x5204b1['name']){delete _0x5204b1[_0xa435('0x26')];}_0x126c78[_0xa435('0x18')](_0x3fa82d)[_0xa435('0x27')](_0x5204b1);};}exports['index']=function(_0x231c2c,_0x388ced){var _0x1fec47={},_0x3f10c8={},_0x26cb48={'count':0x0,'rows':[]};var _0x3c9682=_['map'](db[_0xa435('0x28')][_0xa435('0x29')],function(_0x2f9493){return{'name':_0x2f9493['fieldName'],'type':_0x2f9493[_0xa435('0x2a')][_0xa435('0x2b')]};});_0x3f10c8[_0xa435('0x2c')]=_[_0xa435('0x2d')](_0x3c9682,'name');_0x3f10c8[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x231c2c['query']);_0x3f10c8[_0xa435('0x30')]=_['intersection'](_0x3f10c8[_0xa435('0x2c')],_0x3f10c8[_0xa435('0x2e')]);_0x1fec47['attributes']=_[_0xa435('0x31')](_0x3f10c8[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x231c2c[_0xa435('0x2e')][_0xa435('0x32')]));_0x1fec47[_0xa435('0x33')]=_0x1fec47[_0xa435('0x33')][_0xa435('0x34')]?_0x1fec47['attributes']:_0x3f10c8['model'];if(!_0x231c2c['query'][_0xa435('0x35')](_0xa435('0x36'))){_0x1fec47[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x231c2c['query'][_0xa435('0x1b')]);_0x1fec47['offset']=qs[_0xa435('0x1c')](_0x231c2c[_0xa435('0x2e')]['offset']);}_0x1fec47['order']=qs[_0xa435('0x37')](_0x231c2c['query'][_0xa435('0x37')]);_0x1fec47[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x231c2c['query'],_0x3f10c8[_0xa435('0x30')]),_0x3c9682);if(_0x231c2c['query'][_0xa435('0x3a')]){_0x1fec47[_0xa435('0x38')]=_['merge'](_0x1fec47[_0xa435('0x38')],{'$or':_['map'](_0x3c9682,function(_0x1b8846){if(_0x1b8846[_0xa435('0x2a')]!=='VIRTUAL'){var _0x11548a={};_0x11548a[_0x1b8846[_0xa435('0x26')]]={'$like':'%'+_0x231c2c[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x11548a;}})});}_0x1fec47=_['merge']({},_0x1fec47,_0x231c2c[_0xa435('0x3b')]);var _0x38fc30={'where':_0x1fec47[_0xa435('0x38')]};return db[_0xa435('0x28')][_0xa435('0x1d')](_0x38fc30)[_0xa435('0x21')](function(_0x1e6cb3){_0x26cb48[_0xa435('0x1d')]=_0x1e6cb3;if(_0x231c2c[_0xa435('0x2e')][_0xa435('0x3c')]){_0x1fec47[_0xa435('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xa435('0x3e')](_0x1fec47);})[_0xa435('0x21')](function(_0x483902){_0x26cb48[_0xa435('0x3f')]=_0x483902;return _0x26cb48;})[_0xa435('0x21')](respondWithFilteredResult(_0x388ced,_0x1fec47))[_0xa435('0x40')](handleError(_0x388ced,null));};exports[_0xa435('0x41')]=function(_0x25a5fb,_0x157097){var _0x25bcd3={'raw':![],'where':{'id':_0x25a5fb[_0xa435('0x42')]['id']}},_0x6b5984={};_0x6b5984[_0xa435('0x2c')]=_[_0xa435('0x2f')](db[_0xa435('0x28')][_0xa435('0x29')]);_0x6b5984[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x25a5fb['query']);_0x6b5984[_0xa435('0x30')]=_['intersection'](_0x6b5984['model'],_0x6b5984[_0xa435('0x2e')]);_0x25bcd3[_0xa435('0x33')]=_['intersection'](_0x6b5984[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x25a5fb[_0xa435('0x2e')][_0xa435('0x32')]));_0x25bcd3['attributes']=_0x25bcd3['attributes']['length']?_0x25bcd3[_0xa435('0x33')]:_0x6b5984[_0xa435('0x2c')];if(_0x25a5fb[_0xa435('0x2e')]['includeAll']){_0x25bcd3['include']=[{'all':!![]}];}_0x25bcd3=_['merge']({},_0x25bcd3,_0x25a5fb[_0xa435('0x3b')]);return db['ZendeskConfiguration'][_0xa435('0x43')](_0x25bcd3)[_0xa435('0x21')](handleEntityNotFound(_0x157097,null))[_0xa435('0x21')](respondWithResult(_0x157097,null))['catch'](handleError(_0x157097,null));};exports[_0xa435('0x44')]=function(_0x23b529,_0x27d7f7){return db[_0xa435('0x28')]['create'](_0x23b529[_0xa435('0x45')],{})[_0xa435('0x21')](respondWithResult(_0x27d7f7,0xc9))['catch'](handleError(_0x27d7f7,null));};exports['update']=function(_0x56c2bc,_0x5ebcdc){if(_0x56c2bc[_0xa435('0x45')]['id']){delete _0x56c2bc[_0xa435('0x45')]['id'];}return db[_0xa435('0x28')]['find']({'where':{'id':_0x56c2bc[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x5ebcdc,null))[_0xa435('0x21')](saveUpdates(_0x56c2bc['body'],null))[_0xa435('0x21')](respondWithResult(_0x5ebcdc,null))['catch'](handleError(_0x5ebcdc,null));};exports[_0xa435('0x22')]=function(_0x56ae62,_0x45e849){return db[_0xa435('0x28')][_0xa435('0x43')]({'where':{'id':_0x56ae62[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x45e849,null))[_0xa435('0x21')](removeEntity(_0x45e849,null))[_0xa435('0x40')](handleError(_0x45e849,null));};exports[_0xa435('0x46')]=function(_0x171231,_0x24ea35,_0x35c65c){var _0x1a51de={};var _0x4510a8={};var _0x2069ea;var _0x1a149;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x171231[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x24ea35,null))[_0xa435('0x21')](function(_0x38b33e){if(_0x38b33e){_0x2069ea=_0x38b33e;_0x4510a8['model']=_[_0xa435('0x2f')](db[_0xa435('0x48')]['rawAttributes']);_0x4510a8[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x171231[_0xa435('0x2e')]);_0x4510a8['filters']=_[_0xa435('0x31')](_0x4510a8[_0xa435('0x2c')],_0x4510a8['query']);_0x1a51de[_0xa435('0x33')]=_['intersection'](_0x4510a8[_0xa435('0x2c')],qs['fields'](_0x171231['query'][_0xa435('0x32')]));_0x1a51de['attributes']=_0x1a51de['attributes'][_0xa435('0x34')]?_0x1a51de[_0xa435('0x33')]:_0x4510a8[_0xa435('0x2c')];_0x1a51de[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x171231[_0xa435('0x2e')][_0xa435('0x37')]);_0x1a51de[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x171231[_0xa435('0x2e')],_0x4510a8['filters']));if(_0x171231[_0xa435('0x2e')]['filter']){_0x1a51de[_0xa435('0x38')]=_['merge'](_0x1a51de['where'],{'$or':_[_0xa435('0x2d')](_0x1a51de[_0xa435('0x33')],function(_0x113b31){var _0x549af9={};_0x549af9[_0x113b31]={'$like':'%'+_0x171231[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x549af9;})});}_0x1a51de=_[_0xa435('0x4a')]({},_0x1a51de,_0x171231[_0xa435('0x3b')]);return _0x2069ea[_0xa435('0x46')](_0x1a51de);}})[_0xa435('0x21')](function(_0x36f0dc){if(_0x36f0dc){_0x1a149=_0x36f0dc[_0xa435('0x34')];if(!_0x171231[_0xa435('0x2e')][_0xa435('0x35')](_0xa435('0x36'))){_0x1a51de[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x171231[_0xa435('0x2e')][_0xa435('0x1b')]);_0x1a51de[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x171231[_0xa435('0x2e')][_0xa435('0x1c')]);}return _0x2069ea[_0xa435('0x46')](_0x1a51de);}})[_0xa435('0x21')](function(_0x21b965){if(_0x21b965){return _0x21b965?{'count':_0x1a149,'rows':_0x21b965}:null;}})[_0xa435('0x21')](respondWithResult(_0x24ea35,null))[_0xa435('0x40')](handleError(_0x24ea35,null));};exports[_0xa435('0x4b')]=function(_0x18c31b,_0x895225,_0x51ae06){var _0x1ad0d4={};var _0x1f70eb={};var _0x5426dc;var _0x4b2d8a;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x18c31b['params']['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x895225,null))[_0xa435('0x21')](function(_0x4a75ff){if(_0x4a75ff){_0x5426dc=_0x4a75ff;_0x1f70eb[_0xa435('0x2c')]=_[_0xa435('0x2f')](db[_0xa435('0x48')]['rawAttributes']);_0x1f70eb[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x18c31b[_0xa435('0x2e')]);_0x1f70eb[_0xa435('0x30')]=_[_0xa435('0x31')](_0x1f70eb[_0xa435('0x2c')],_0x1f70eb[_0xa435('0x2e')]);_0x1ad0d4[_0xa435('0x33')]=_[_0xa435('0x31')](_0x1f70eb['model'],qs[_0xa435('0x32')](_0x18c31b[_0xa435('0x2e')][_0xa435('0x32')]));_0x1ad0d4[_0xa435('0x33')]=_0x1ad0d4['attributes']['length']?_0x1ad0d4[_0xa435('0x33')]:_0x1f70eb[_0xa435('0x2c')];_0x1ad0d4[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x18c31b[_0xa435('0x2e')][_0xa435('0x37')]);_0x1ad0d4[_0xa435('0x38')]=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x18c31b[_0xa435('0x2e')],_0x1f70eb[_0xa435('0x30')]));if(_0x18c31b[_0xa435('0x2e')]['filter']){_0x1ad0d4['where']=_['merge'](_0x1ad0d4[_0xa435('0x38')],{'$or':_['map'](_0x1ad0d4[_0xa435('0x33')],function(_0x47a938){var _0x1f056f={};_0x1f056f[_0x47a938]={'$like':'%'+_0x18c31b[_0xa435('0x2e')]['filter']+'%'};return _0x1f056f;})});}_0x1ad0d4=_[_0xa435('0x4a')]({},_0x1ad0d4,_0x18c31b[_0xa435('0x3b')]);return _0x5426dc[_0xa435('0x4b')](_0x1ad0d4);}})['then'](function(_0x276f3d){if(_0x276f3d){_0x4b2d8a=_0x276f3d[_0xa435('0x34')];if(!_0x18c31b['query'][_0xa435('0x35')](_0xa435('0x36'))){_0x1ad0d4[_0xa435('0x1b')]=qs['limit'](_0x18c31b[_0xa435('0x2e')]['limit']);_0x1ad0d4[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x18c31b[_0xa435('0x2e')]['offset']);}return _0x5426dc[_0xa435('0x4b')](_0x1ad0d4);}})[_0xa435('0x21')](function(_0x14c4de){if(_0x14c4de){return _0x14c4de?{'count':_0x4b2d8a,'rows':_0x14c4de}:null;}})[_0xa435('0x21')](respondWithResult(_0x895225,null))[_0xa435('0x40')](handleError(_0x895225,null));};exports['getDescriptions']=function(_0x524f36,_0x52b523,_0x2cdea7){var _0x3b8b96={};var _0x11d82={};var _0x27df5d;var _0x5f3684;return db[_0xa435('0x28')]['findOne']({'where':{'id':_0x524f36[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x52b523,null))['then'](function(_0x407bbb){if(_0x407bbb){_0x27df5d=_0x407bbb;_0x11d82[_0xa435('0x2c')]=_[_0xa435('0x2f')](db['ZendeskField'][_0xa435('0x29')]);_0x11d82['query']=_[_0xa435('0x2f')](_0x524f36['query']);_0x11d82[_0xa435('0x30')]=_[_0xa435('0x31')](_0x11d82[_0xa435('0x2c')],_0x11d82[_0xa435('0x2e')]);_0x3b8b96[_0xa435('0x33')]=_[_0xa435('0x31')](_0x11d82[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x524f36[_0xa435('0x2e')][_0xa435('0x32')]));_0x3b8b96[_0xa435('0x33')]=_0x3b8b96[_0xa435('0x33')]['length']?_0x3b8b96[_0xa435('0x33')]:_0x11d82[_0xa435('0x2c')];_0x3b8b96[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x524f36[_0xa435('0x2e')][_0xa435('0x37')]);_0x3b8b96[_0xa435('0x38')]=qs['filters'](_[_0xa435('0x39')](_0x524f36[_0xa435('0x2e')],_0x11d82[_0xa435('0x30')]));if(_0x524f36[_0xa435('0x2e')][_0xa435('0x3a')]){_0x3b8b96['where']=_['merge'](_0x3b8b96[_0xa435('0x38')],{'$or':_['map'](_0x3b8b96[_0xa435('0x33')],function(_0x14e67d){var _0x4982b2={};_0x4982b2[_0x14e67d]={'$like':'%'+_0x524f36['query']['filter']+'%'};return _0x4982b2;})});}_0x3b8b96=_['merge']({},_0x3b8b96,_0x524f36[_0xa435('0x3b')]);return _0x27df5d[_0xa435('0x4c')](_0x3b8b96);}})[_0xa435('0x21')](function(_0x1def53){if(_0x1def53){_0x5f3684=_0x1def53['length'];if(!_0x524f36['query']['hasOwnProperty'](_0xa435('0x36'))){_0x3b8b96[_0xa435('0x1b')]=qs[_0xa435('0x1b')](_0x524f36['query'][_0xa435('0x1b')]);_0x3b8b96['offset']=qs[_0xa435('0x1c')](_0x524f36[_0xa435('0x2e')][_0xa435('0x1c')]);}return _0x27df5d['getDescriptions'](_0x3b8b96);}})[_0xa435('0x21')](function(_0x31f9dc){if(_0x31f9dc){return _0x31f9dc?{'count':_0x5f3684,'rows':_0x31f9dc}:null;}})[_0xa435('0x21')](respondWithResult(_0x52b523,null))['catch'](handleError(_0x52b523,null));};exports['getTags']=function(_0x3d8aab,_0x375651,_0x460b8a){var _0x576e32={};var _0xf3113f={};var _0x59eab6;var _0xbbcba3;return db[_0xa435('0x28')][_0xa435('0x47')]({'where':{'id':_0x3d8aab[_0xa435('0x42')]['id']}})['then'](handleEntityNotFound(_0x375651,null))[_0xa435('0x21')](function(_0xd4c984){if(_0xd4c984){_0x59eab6=_0xd4c984;_0xf3113f['model']=_['keys'](db[_0xa435('0x4d')][_0xa435('0x29')]);_0xf3113f[_0xa435('0x2e')]=_[_0xa435('0x2f')](_0x3d8aab['query']);_0xf3113f[_0xa435('0x30')]=_[_0xa435('0x31')](_0xf3113f[_0xa435('0x2c')],_0xf3113f[_0xa435('0x2e')]);_0x576e32[_0xa435('0x33')]=_[_0xa435('0x31')](_0xf3113f[_0xa435('0x2c')],qs[_0xa435('0x32')](_0x3d8aab[_0xa435('0x2e')][_0xa435('0x32')]));_0x576e32[_0xa435('0x33')]=_0x576e32[_0xa435('0x33')]['length']?_0x576e32[_0xa435('0x33')]:_0xf3113f[_0xa435('0x2c')];_0x576e32[_0xa435('0x49')]=qs[_0xa435('0x37')](_0x3d8aab['query'][_0xa435('0x37')]);_0x576e32['where']=qs[_0xa435('0x30')](_[_0xa435('0x39')](_0x3d8aab[_0xa435('0x2e')],_0xf3113f['filters']));if(_0x3d8aab['query'][_0xa435('0x3a')]){_0x576e32['where']=_[_0xa435('0x4a')](_0x576e32['where'],{'$or':_[_0xa435('0x2d')](_0x576e32[_0xa435('0x33')],function(_0x24e94d){var _0x1fcf40={};_0x1fcf40[_0x24e94d]={'$like':'%'+_0x3d8aab[_0xa435('0x2e')][_0xa435('0x3a')]+'%'};return _0x1fcf40;})});}_0x576e32=_['merge']({},_0x576e32,_0x3d8aab[_0xa435('0x3b')]);return _0x59eab6[_0xa435('0x4e')](_0x576e32);}})[_0xa435('0x21')](function(_0x29b161){if(_0x29b161){_0xbbcba3=_0x29b161[_0xa435('0x34')];if(!_0x3d8aab[_0xa435('0x2e')][_0xa435('0x35')](_0xa435('0x36'))){_0x576e32['limit']=qs[_0xa435('0x1b')](_0x3d8aab[_0xa435('0x2e')][_0xa435('0x1b')]);_0x576e32[_0xa435('0x1c')]=qs[_0xa435('0x1c')](_0x3d8aab['query']['offset']);}return _0x59eab6[_0xa435('0x4e')](_0x576e32);}})['then'](function(_0x33f73e){if(_0x33f73e){return _0x33f73e?{'count':_0xbbcba3,'rows':_0x33f73e}:null;}})[_0xa435('0x21')](respondWithResult(_0x375651,null))[_0xa435('0x40')](handleError(_0x375651,null));};exports[_0xa435('0x4f')]=function(_0x345b97,_0x39bd1c,_0x9a0a9f){if(_0x345b97[_0xa435('0x45')]['id']){delete _0x345b97['body']['id'];}return db['ZendeskConfiguration'][_0xa435('0x47')]({'where':{'id':_0x345b97[_0xa435('0x42')]['id']}})[_0xa435('0x21')](handleEntityNotFound(_0x39bd1c,null))[_0xa435('0x21')](function(_0x1aa1d9){if(_0x1aa1d9){return _0x1aa1d9['setTags'](_0x345b97[_0xa435('0x45')][_0xa435('0x50')]||[]);}return null;})[_0xa435('0x21')](respondWithResult(_0x39bd1c,null))[_0xa435('0x40')](handleError(_0x39bd1c,null));};
\ No newline at end of file
+var _0x4b9a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','filter','where','merge','map','VIRTUAL','rows','catch','show','params','includeAll','options','find','create','body','getFields','ZendeskField','pick','getSubjects','getDescriptions','findOne','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','type','key'];(function(_0x1d9916,_0x2ea48c){var _0x1bfa25=function(_0xc59876){while(--_0xc59876){_0x1d9916['push'](_0x1d9916['shift']());}};_0x1bfa25(++_0x2ea48c);}(_0x4b9a,0x7a));var _0xa4b9=function(_0x241893,_0x2581e8){_0x241893=_0x241893-0x0;var _0x3e86e6=_0x4b9a[_0x241893];return _0x3e86e6;};'use strict';var emlformat=require(_0xa4b9('0x0'));var rimraf=require(_0xa4b9('0x1'));var zipdir=require(_0xa4b9('0x2'));var jsonpatch=require(_0xa4b9('0x3'));var rp=require(_0xa4b9('0x4'));var moment=require(_0xa4b9('0x5'));var BPromise=require(_0xa4b9('0x6'));var Mustache=require('mustache');var util=require(_0xa4b9('0x7'));var path=require(_0xa4b9('0x8'));var sox=require(_0xa4b9('0x9'));var csv=require(_0xa4b9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4b9('0xb'));var _=require(_0xa4b9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4b9('0xd'));var deskjs=require(_0xa4b9('0xe'));var toCsv=require(_0xa4b9('0xa'));var querystring=require(_0xa4b9('0xf'));var Papa=require(_0xa4b9('0x10'));var Redis=require(_0xa4b9('0x11'));var authService=require(_0xa4b9('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa4b9('0x13'));var hardwareService=require(_0xa4b9('0x14'));var logger=require(_0xa4b9('0x15'))(_0xa4b9('0x16'));var utils=require(_0xa4b9('0x17'));var config=require(_0xa4b9('0x18'));var licenseUtil=require(_0xa4b9('0x19'));var db=require(_0xa4b9('0x1a'))['db'];function respondWithStatusCode(_0x6780f9,_0x12db29){_0x12db29=_0x12db29||0xcc;return function(_0x1d7d79){if(_0x1d7d79){return _0x6780f9[_0xa4b9('0x1b')](_0x12db29);}return _0x6780f9['status'](_0x12db29)['end']();};}function respondWithResult(_0x51cec5,_0xd374ef){_0xd374ef=_0xd374ef||0xc8;return function(_0xc4dbed){if(_0xc4dbed){return _0x51cec5[_0xa4b9('0x1c')](_0xd374ef)[_0xa4b9('0x1d')](_0xc4dbed);}};}function respondWithFilteredResult(_0x262de5,_0x5d8654){return function(_0x57d1b7){if(_0x57d1b7){var _0x9e5eba=typeof _0x5d8654['offset']==='undefined'&&typeof _0x5d8654[_0xa4b9('0x1e')]===_0xa4b9('0x1f');var _0x1fb442=_0x57d1b7[_0xa4b9('0x20')];var _0x11b272=_0x9e5eba?0x0:_0x5d8654['offset'];var _0x4a69d3=_0x9e5eba?_0x57d1b7['count']:_0x5d8654['offset']+_0x5d8654[_0xa4b9('0x1e')];var _0x2df8a8;if(_0x4a69d3>=_0x1fb442){_0x4a69d3=_0x1fb442;_0x2df8a8=0xc8;}else{_0x2df8a8=0xce;}_0x262de5['status'](_0x2df8a8);return _0x262de5[_0xa4b9('0x21')]('Content-Range',_0x11b272+'-'+_0x4a69d3+'/'+_0x1fb442)[_0xa4b9('0x1d')](_0x57d1b7);}return null;};}function patchUpdates(_0x352f19){return function(_0x2d123c){try{jsonpatch[_0xa4b9('0x22')](_0x2d123c,_0x352f19,!![]);}catch(_0x23eb01){return BPromise[_0xa4b9('0x23')](_0x23eb01);}return _0x2d123c[_0xa4b9('0x24')]();};}function saveUpdates(_0x5e1fee,_0x44db9b){return function(_0x1b1327){if(_0x1b1327){return _0x1b1327[_0xa4b9('0x25')](_0x5e1fee)['then'](function(_0x4ee3b6){return _0x4ee3b6;});}return null;};}function removeEntity(_0x464fb8,_0x449186){return function(_0x4560e7){if(_0x4560e7){return _0x4560e7[_0xa4b9('0x26')]()[_0xa4b9('0x27')](function(){_0x464fb8['status'](0xcc)[_0xa4b9('0x28')]();});}};}function handleEntityNotFound(_0x5a014e,_0xd9020e){return function(_0x3a4e4a){if(!_0x3a4e4a){_0x5a014e[_0xa4b9('0x1b')](0x194);}return _0x3a4e4a;};}function handleError(_0x205b71,_0x394d47){_0x394d47=_0x394d47||0x1f4;return function(_0x1fba90){logger[_0xa4b9('0x29')](_0x1fba90[_0xa4b9('0x2a')]);if(_0x1fba90['name']){delete _0x1fba90[_0xa4b9('0x2b')];}_0x205b71['status'](_0x394d47)[_0xa4b9('0x2c')](_0x1fba90);};}exports[_0xa4b9('0x2d')]=function(_0x2ec76a,_0x2595d5){var _0x393828={},_0x481f56={},_0x30155b={'count':0x0,'rows':[]};var _0x22e704=_['map'](db[_0xa4b9('0x2e')][_0xa4b9('0x2f')],function(_0x599861){return{'name':_0x599861['fieldName'],'type':_0x599861[_0xa4b9('0x30')][_0xa4b9('0x31')]};});_0x481f56[_0xa4b9('0x32')]=_['map'](_0x22e704,'name');_0x481f56[_0xa4b9('0x33')]=_[_0xa4b9('0x34')](_0x2ec76a[_0xa4b9('0x33')]);_0x481f56['filters']=_[_0xa4b9('0x35')](_0x481f56['model'],_0x481f56[_0xa4b9('0x33')]);_0x393828[_0xa4b9('0x36')]=_[_0xa4b9('0x35')](_0x481f56[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x2ec76a[_0xa4b9('0x33')]['fields']));_0x393828[_0xa4b9('0x36')]=_0x393828['attributes'][_0xa4b9('0x38')]?_0x393828[_0xa4b9('0x36')]:_0x481f56['model'];if(!_0x2ec76a[_0xa4b9('0x33')][_0xa4b9('0x39')](_0xa4b9('0x3a'))){_0x393828[_0xa4b9('0x1e')]=qs['limit'](_0x2ec76a['query'][_0xa4b9('0x1e')]);_0x393828['offset']=qs[_0xa4b9('0x3b')](_0x2ec76a[_0xa4b9('0x33')][_0xa4b9('0x3b')]);}_0x393828[_0xa4b9('0x3c')]=qs[_0xa4b9('0x3d')](_0x2ec76a[_0xa4b9('0x33')][_0xa4b9('0x3d')]);_0x393828['where']=qs[_0xa4b9('0x3e')](_['pick'](_0x2ec76a[_0xa4b9('0x33')],_0x481f56[_0xa4b9('0x3e')]),_0x22e704);if(_0x2ec76a[_0xa4b9('0x33')][_0xa4b9('0x3f')]){_0x393828[_0xa4b9('0x40')]=_[_0xa4b9('0x41')](_0x393828[_0xa4b9('0x40')],{'$or':_[_0xa4b9('0x42')](_0x22e704,function(_0x5a4ff5){if(_0x5a4ff5[_0xa4b9('0x30')]!==_0xa4b9('0x43')){var _0x2f1b5d={};_0x2f1b5d[_0x5a4ff5[_0xa4b9('0x2b')]]={'$like':'%'+_0x2ec76a[_0xa4b9('0x33')][_0xa4b9('0x3f')]+'%'};return _0x2f1b5d;}})});}_0x393828=_[_0xa4b9('0x41')]({},_0x393828,_0x2ec76a['options']);var _0x541eb2={'where':_0x393828[_0xa4b9('0x40')]};return db[_0xa4b9('0x2e')][_0xa4b9('0x20')](_0x541eb2)['then'](function(_0x2a0d4){_0x30155b[_0xa4b9('0x20')]=_0x2a0d4;if(_0x2ec76a[_0xa4b9('0x33')]['includeAll']){_0x393828['include']=[{'all':!![]}];}return db[_0xa4b9('0x2e')]['findAll'](_0x393828);})[_0xa4b9('0x27')](function(_0x286eea){_0x30155b[_0xa4b9('0x44')]=_0x286eea;return _0x30155b;})[_0xa4b9('0x27')](respondWithFilteredResult(_0x2595d5,_0x393828))[_0xa4b9('0x45')](handleError(_0x2595d5,null));};exports[_0xa4b9('0x46')]=function(_0x567129,_0x2d28d8){var _0x47eb96={'raw':![],'where':{'id':_0x567129[_0xa4b9('0x47')]['id']}},_0x46079f={};_0x46079f[_0xa4b9('0x32')]=_['keys'](db[_0xa4b9('0x2e')][_0xa4b9('0x2f')]);_0x46079f[_0xa4b9('0x33')]=_[_0xa4b9('0x34')](_0x567129[_0xa4b9('0x33')]);_0x46079f[_0xa4b9('0x3e')]=_[_0xa4b9('0x35')](_0x46079f['model'],_0x46079f[_0xa4b9('0x33')]);_0x47eb96[_0xa4b9('0x36')]=_[_0xa4b9('0x35')](_0x46079f[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x567129[_0xa4b9('0x33')]['fields']));_0x47eb96[_0xa4b9('0x36')]=_0x47eb96[_0xa4b9('0x36')][_0xa4b9('0x38')]?_0x47eb96['attributes']:_0x46079f['model'];if(_0x567129[_0xa4b9('0x33')][_0xa4b9('0x48')]){_0x47eb96['include']=[{'all':!![]}];}_0x47eb96=_[_0xa4b9('0x41')]({},_0x47eb96,_0x567129[_0xa4b9('0x49')]);return db[_0xa4b9('0x2e')][_0xa4b9('0x4a')](_0x47eb96)[_0xa4b9('0x27')](handleEntityNotFound(_0x2d28d8,null))['then'](respondWithResult(_0x2d28d8,null))['catch'](handleError(_0x2d28d8,null));};exports[_0xa4b9('0x4b')]=function(_0x521663,_0x3f90ef){return db['ZendeskConfiguration']['create'](_0x521663[_0xa4b9('0x4c')],{})['then'](respondWithResult(_0x3f90ef,0xc9))[_0xa4b9('0x45')](handleError(_0x3f90ef,null));};exports[_0xa4b9('0x25')]=function(_0x5f0410,_0x4a85c8){if(_0x5f0410[_0xa4b9('0x4c')]['id']){delete _0x5f0410['body']['id'];}return db['ZendeskConfiguration'][_0xa4b9('0x4a')]({'where':{'id':_0x5f0410['params']['id']}})[_0xa4b9('0x27')](handleEntityNotFound(_0x4a85c8,null))[_0xa4b9('0x27')](saveUpdates(_0x5f0410['body'],null))[_0xa4b9('0x27')](respondWithResult(_0x4a85c8,null))['catch'](handleError(_0x4a85c8,null));};exports['destroy']=function(_0x5decb2,_0x3e2094){return db[_0xa4b9('0x2e')][_0xa4b9('0x4a')]({'where':{'id':_0x5decb2[_0xa4b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e2094,null))[_0xa4b9('0x27')](removeEntity(_0x3e2094,null))[_0xa4b9('0x45')](handleError(_0x3e2094,null));};exports[_0xa4b9('0x4d')]=function(_0x1250bd,_0x5cfb9f,_0x384785){var _0x6ba0={};var _0x36d896={};var _0x1a08b7;var _0x3bf91d;return db[_0xa4b9('0x2e')]['findOne']({'where':{'id':_0x1250bd[_0xa4b9('0x47')]['id']}})[_0xa4b9('0x27')](handleEntityNotFound(_0x5cfb9f,null))[_0xa4b9('0x27')](function(_0x181d3f){if(_0x181d3f){_0x1a08b7=_0x181d3f;_0x36d896[_0xa4b9('0x32')]=_['keys'](db[_0xa4b9('0x4e')][_0xa4b9('0x2f')]);_0x36d896[_0xa4b9('0x33')]=_[_0xa4b9('0x34')](_0x1250bd[_0xa4b9('0x33')]);_0x36d896['filters']=_[_0xa4b9('0x35')](_0x36d896['model'],_0x36d896[_0xa4b9('0x33')]);_0x6ba0['attributes']=_[_0xa4b9('0x35')](_0x36d896[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x1250bd[_0xa4b9('0x33')][_0xa4b9('0x37')]));_0x6ba0['attributes']=_0x6ba0['attributes']['length']?_0x6ba0[_0xa4b9('0x36')]:_0x36d896[_0xa4b9('0x32')];_0x6ba0[_0xa4b9('0x3c')]=qs[_0xa4b9('0x3d')](_0x1250bd[_0xa4b9('0x33')][_0xa4b9('0x3d')]);_0x6ba0[_0xa4b9('0x40')]=qs['filters'](_[_0xa4b9('0x4f')](_0x1250bd[_0xa4b9('0x33')],_0x36d896[_0xa4b9('0x3e')]));if(_0x1250bd['query'][_0xa4b9('0x3f')]){_0x6ba0[_0xa4b9('0x40')]=_['merge'](_0x6ba0[_0xa4b9('0x40')],{'$or':_[_0xa4b9('0x42')](_0x6ba0['attributes'],function(_0x4ea065){var _0x484e0b={};_0x484e0b[_0x4ea065]={'$like':'%'+_0x1250bd['query'][_0xa4b9('0x3f')]+'%'};return _0x484e0b;})});}_0x6ba0=_[_0xa4b9('0x41')]({},_0x6ba0,_0x1250bd[_0xa4b9('0x49')]);return _0x1a08b7[_0xa4b9('0x4d')](_0x6ba0);}})[_0xa4b9('0x27')](function(_0x46cea8){if(_0x46cea8){_0x3bf91d=_0x46cea8[_0xa4b9('0x38')];if(!_0x1250bd[_0xa4b9('0x33')]['hasOwnProperty']('nolimit')){_0x6ba0[_0xa4b9('0x1e')]=qs[_0xa4b9('0x1e')](_0x1250bd[_0xa4b9('0x33')][_0xa4b9('0x1e')]);_0x6ba0[_0xa4b9('0x3b')]=qs[_0xa4b9('0x3b')](_0x1250bd['query'][_0xa4b9('0x3b')]);}return _0x1a08b7[_0xa4b9('0x4d')](_0x6ba0);}})[_0xa4b9('0x27')](function(_0x68223f){if(_0x68223f){return _0x68223f?{'count':_0x3bf91d,'rows':_0x68223f}:null;}})['then'](respondWithResult(_0x5cfb9f,null))['catch'](handleError(_0x5cfb9f,null));};exports[_0xa4b9('0x50')]=function(_0x32f4b2,_0x14d111,_0xc704f4){var _0x134c82={};var _0x2acd07={};var _0x1ad84a;var _0x4b0231;return db[_0xa4b9('0x2e')]['findOne']({'where':{'id':_0x32f4b2[_0xa4b9('0x47')]['id']}})[_0xa4b9('0x27')](handleEntityNotFound(_0x14d111,null))[_0xa4b9('0x27')](function(_0x5322c9){if(_0x5322c9){_0x1ad84a=_0x5322c9;_0x2acd07[_0xa4b9('0x32')]=_[_0xa4b9('0x34')](db['ZendeskField'][_0xa4b9('0x2f')]);_0x2acd07[_0xa4b9('0x33')]=_[_0xa4b9('0x34')](_0x32f4b2[_0xa4b9('0x33')]);_0x2acd07[_0xa4b9('0x3e')]=_[_0xa4b9('0x35')](_0x2acd07['model'],_0x2acd07[_0xa4b9('0x33')]);_0x134c82[_0xa4b9('0x36')]=_[_0xa4b9('0x35')](_0x2acd07[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x32f4b2[_0xa4b9('0x33')]['fields']));_0x134c82[_0xa4b9('0x36')]=_0x134c82[_0xa4b9('0x36')][_0xa4b9('0x38')]?_0x134c82[_0xa4b9('0x36')]:_0x2acd07[_0xa4b9('0x32')];_0x134c82['order']=qs[_0xa4b9('0x3d')](_0x32f4b2['query'][_0xa4b9('0x3d')]);_0x134c82[_0xa4b9('0x40')]=qs[_0xa4b9('0x3e')](_[_0xa4b9('0x4f')](_0x32f4b2[_0xa4b9('0x33')],_0x2acd07[_0xa4b9('0x3e')]));if(_0x32f4b2[_0xa4b9('0x33')][_0xa4b9('0x3f')]){_0x134c82['where']=_[_0xa4b9('0x41')](_0x134c82[_0xa4b9('0x40')],{'$or':_[_0xa4b9('0x42')](_0x134c82[_0xa4b9('0x36')],function(_0x3c0a02){var _0x59bdbc={};_0x59bdbc[_0x3c0a02]={'$like':'%'+_0x32f4b2[_0xa4b9('0x33')]['filter']+'%'};return _0x59bdbc;})});}_0x134c82=_[_0xa4b9('0x41')]({},_0x134c82,_0x32f4b2[_0xa4b9('0x49')]);return _0x1ad84a['getSubjects'](_0x134c82);}})[_0xa4b9('0x27')](function(_0x3a6b7c){if(_0x3a6b7c){_0x4b0231=_0x3a6b7c[_0xa4b9('0x38')];if(!_0x32f4b2[_0xa4b9('0x33')][_0xa4b9('0x39')]('nolimit')){_0x134c82[_0xa4b9('0x1e')]=qs[_0xa4b9('0x1e')](_0x32f4b2[_0xa4b9('0x33')][_0xa4b9('0x1e')]);_0x134c82[_0xa4b9('0x3b')]=qs[_0xa4b9('0x3b')](_0x32f4b2[_0xa4b9('0x33')]['offset']);}return _0x1ad84a['getSubjects'](_0x134c82);}})['then'](function(_0x2c48c8){if(_0x2c48c8){return _0x2c48c8?{'count':_0x4b0231,'rows':_0x2c48c8}:null;}})['then'](respondWithResult(_0x14d111,null))[_0xa4b9('0x45')](handleError(_0x14d111,null));};exports[_0xa4b9('0x51')]=function(_0x3f19ea,_0x11dc2e,_0x4a5c75){var _0x1b642c={};var _0x24f6dd={};var _0x4e519f;var _0x7eeaed;return db[_0xa4b9('0x2e')][_0xa4b9('0x52')]({'where':{'id':_0x3f19ea[_0xa4b9('0x47')]['id']}})[_0xa4b9('0x27')](handleEntityNotFound(_0x11dc2e,null))[_0xa4b9('0x27')](function(_0x5f1d7d){if(_0x5f1d7d){_0x4e519f=_0x5f1d7d;_0x24f6dd[_0xa4b9('0x32')]=_['keys'](db[_0xa4b9('0x4e')]['rawAttributes']);_0x24f6dd['query']=_[_0xa4b9('0x34')](_0x3f19ea['query']);_0x24f6dd[_0xa4b9('0x3e')]=_[_0xa4b9('0x35')](_0x24f6dd['model'],_0x24f6dd[_0xa4b9('0x33')]);_0x1b642c[_0xa4b9('0x36')]=_[_0xa4b9('0x35')](_0x24f6dd[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x3f19ea[_0xa4b9('0x33')][_0xa4b9('0x37')]));_0x1b642c[_0xa4b9('0x36')]=_0x1b642c[_0xa4b9('0x36')][_0xa4b9('0x38')]?_0x1b642c['attributes']:_0x24f6dd[_0xa4b9('0x32')];_0x1b642c[_0xa4b9('0x3c')]=qs[_0xa4b9('0x3d')](_0x3f19ea['query']['sort']);_0x1b642c[_0xa4b9('0x40')]=qs[_0xa4b9('0x3e')](_[_0xa4b9('0x4f')](_0x3f19ea[_0xa4b9('0x33')],_0x24f6dd[_0xa4b9('0x3e')]));if(_0x3f19ea[_0xa4b9('0x33')][_0xa4b9('0x3f')]){_0x1b642c[_0xa4b9('0x40')]=_['merge'](_0x1b642c['where'],{'$or':_[_0xa4b9('0x42')](_0x1b642c[_0xa4b9('0x36')],function(_0x504be2){var _0x10a916={};_0x10a916[_0x504be2]={'$like':'%'+_0x3f19ea[_0xa4b9('0x33')][_0xa4b9('0x3f')]+'%'};return _0x10a916;})});}_0x1b642c=_[_0xa4b9('0x41')]({},_0x1b642c,_0x3f19ea[_0xa4b9('0x49')]);return _0x4e519f['getDescriptions'](_0x1b642c);}})[_0xa4b9('0x27')](function(_0x316000){if(_0x316000){_0x7eeaed=_0x316000[_0xa4b9('0x38')];if(!_0x3f19ea['query']['hasOwnProperty'](_0xa4b9('0x3a'))){_0x1b642c[_0xa4b9('0x1e')]=qs[_0xa4b9('0x1e')](_0x3f19ea[_0xa4b9('0x33')][_0xa4b9('0x1e')]);_0x1b642c['offset']=qs[_0xa4b9('0x3b')](_0x3f19ea['query'][_0xa4b9('0x3b')]);}return _0x4e519f[_0xa4b9('0x51')](_0x1b642c);}})[_0xa4b9('0x27')](function(_0x51c8a8){if(_0x51c8a8){return _0x51c8a8?{'count':_0x7eeaed,'rows':_0x51c8a8}:null;}})[_0xa4b9('0x27')](respondWithResult(_0x11dc2e,null))[_0xa4b9('0x45')](handleError(_0x11dc2e,null));};exports[_0xa4b9('0x53')]=function(_0x40d30c,_0x2b1643,_0xf7aca0){var _0x34edd0={};var _0x1b6501={};var _0x935831;var _0x58d1d8;return db[_0xa4b9('0x2e')][_0xa4b9('0x52')]({'where':{'id':_0x40d30c[_0xa4b9('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b1643,null))[_0xa4b9('0x27')](function(_0x584196){if(_0x584196){_0x935831=_0x584196;_0x1b6501[_0xa4b9('0x32')]=_[_0xa4b9('0x34')](db['Tag']['rawAttributes']);_0x1b6501[_0xa4b9('0x33')]=_[_0xa4b9('0x34')](_0x40d30c['query']);_0x1b6501['filters']=_['intersection'](_0x1b6501[_0xa4b9('0x32')],_0x1b6501[_0xa4b9('0x33')]);_0x34edd0['attributes']=_[_0xa4b9('0x35')](_0x1b6501[_0xa4b9('0x32')],qs[_0xa4b9('0x37')](_0x40d30c[_0xa4b9('0x33')][_0xa4b9('0x37')]));_0x34edd0[_0xa4b9('0x36')]=_0x34edd0[_0xa4b9('0x36')]['length']?_0x34edd0[_0xa4b9('0x36')]:_0x1b6501['model'];_0x34edd0[_0xa4b9('0x3c')]=qs['sort'](_0x40d30c['query'][_0xa4b9('0x3d')]);_0x34edd0['where']=qs[_0xa4b9('0x3e')](_[_0xa4b9('0x4f')](_0x40d30c['query'],_0x1b6501[_0xa4b9('0x3e')]));if(_0x40d30c[_0xa4b9('0x33')][_0xa4b9('0x3f')]){_0x34edd0[_0xa4b9('0x40')]=_['merge'](_0x34edd0[_0xa4b9('0x40')],{'$or':_[_0xa4b9('0x42')](_0x34edd0[_0xa4b9('0x36')],function(_0x5b2325){var _0x23359f={};_0x23359f[_0x5b2325]={'$like':'%'+_0x40d30c[_0xa4b9('0x33')][_0xa4b9('0x3f')]+'%'};return _0x23359f;})});}_0x34edd0=_[_0xa4b9('0x41')]({},_0x34edd0,_0x40d30c[_0xa4b9('0x49')]);return _0x935831['getTags'](_0x34edd0);}})[_0xa4b9('0x27')](function(_0x55ff53){if(_0x55ff53){_0x58d1d8=_0x55ff53[_0xa4b9('0x38')];if(!_0x40d30c[_0xa4b9('0x33')][_0xa4b9('0x39')](_0xa4b9('0x3a'))){_0x34edd0[_0xa4b9('0x1e')]=qs[_0xa4b9('0x1e')](_0x40d30c[_0xa4b9('0x33')]['limit']);_0x34edd0[_0xa4b9('0x3b')]=qs[_0xa4b9('0x3b')](_0x40d30c[_0xa4b9('0x33')][_0xa4b9('0x3b')]);}return _0x935831[_0xa4b9('0x53')](_0x34edd0);}})[_0xa4b9('0x27')](function(_0x50d2db){if(_0x50d2db){return _0x50d2db?{'count':_0x58d1d8,'rows':_0x50d2db}:null;}})[_0xa4b9('0x27')](respondWithResult(_0x2b1643,null))[_0xa4b9('0x45')](handleError(_0x2b1643,null));};exports[_0xa4b9('0x54')]=function(_0x43d0e5,_0x2545d2,_0x2c9f1a){if(_0x43d0e5['body']['id']){delete _0x43d0e5[_0xa4b9('0x4c')]['id'];}return db[_0xa4b9('0x2e')][_0xa4b9('0x52')]({'where':{'id':_0x43d0e5[_0xa4b9('0x47')]['id']}})[_0xa4b9('0x27')](handleEntityNotFound(_0x2545d2,null))[_0xa4b9('0x27')](function(_0x24249f){if(_0x24249f){return _0x24249f[_0xa4b9('0x54')](_0x43d0e5['body'][_0xa4b9('0x55')]||[]);}return null;})['then'](respondWithResult(_0x2545d2,null))[_0xa4b9('0x45')](handleError(_0x2545d2,null));};
\ No newline at end of file
index a4e305d..1f533c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ZendeskConfiguration',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x69d3,0xda));var _0x369d=function(_0x3aed0e,_0xcc9d6){_0x3aed0e=_0x3aed0e-0x0;var _0x28585f=_0x69d3[_0x3aed0e];return _0x28585f;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 48baa7c..b5a99c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe251=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x354c38,_0x47de41){var _0x38deb5=function(_0x3a8f8b){while(--_0x3a8f8b){_0x354c38['push'](_0x354c38['shift']());}};_0x38deb5(++_0x47de41);}(_0xe251,0x1e4));var _0x1e25=function(_0x20c993,_0xca841c){_0x20c993=_0x20c993-0x0;var _0x3fc1e2=_0xe251[_0x20c993];return _0x3fc1e2;};'use strict';var _=require(_0x1e25('0x0'));var util=require(_0x1e25('0x1'));var moment=require(_0x1e25('0x2'));var BPromise=require(_0x1e25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e25('0x4'));var db=require(_0x1e25('0x5'))['db'];var utils=require(_0x1e25('0x6'));var logger=require(_0x1e25('0x7'))(_0x1e25('0x8'));var config=require(_0x1e25('0x9'));var jayson=require(_0x1e25('0xa'));var client=jayson[_0x1e25('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3787c0,_0x2a54f0,_0x284378){return new BPromise(function(_0x27afe7,_0x2050df){return client[_0x1e25('0xc')](_0x3787c0,_0x284378)[_0x1e25('0xd')](function(_0x39032e){logger[_0x1e25('0xe')](_0x1e25('0xf'),_0x2a54f0,_0x1e25('0x10'));logger[_0x1e25('0x11')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2a54f0,_0x1e25('0x10'),JSON[_0x1e25('0x12')](_0x39032e));if(_0x39032e[_0x1e25('0x13')]){if(_0x39032e[_0x1e25('0x13')][_0x1e25('0x14')]===0x1f4){logger[_0x1e25('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);return _0x2050df(_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);}logger[_0x1e25('0x13')](_0x1e25('0xf'),_0x2a54f0,_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);return _0x27afe7(_0x39032e[_0x1e25('0x13')][_0x1e25('0x15')]);}else{logger[_0x1e25('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x1e25('0x10'));_0x27afe7(_0x39032e['result'][_0x1e25('0x15')]);}})['catch'](function(_0x218f27){logger[_0x1e25('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2a54f0,_0x218f27);_0x2050df(_0x218f27);});});}
\ No newline at end of file
+var _0x871c=['error','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x871c,0xf7));var _0xc871=function(_0x108b4d,_0x2c595){_0x108b4d=_0x108b4d-0x0;var _0x31bbdb=_0x871c[_0x108b4d];return _0x31bbdb;};'use strict';var _=require(_0xc871('0x0'));var util=require(_0xc871('0x1'));var moment=require('moment');var BPromise=require(_0xc871('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc871('0x3'));var db=require(_0xc871('0x4'))['db'];var utils=require(_0xc871('0x5'));var logger=require(_0xc871('0x6'))(_0xc871('0x7'));var config=require(_0xc871('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc871('0x9')][_0xc871('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31709b,_0x123bc9,_0x273454){return new BPromise(function(_0x3b0e54,_0x374351){return client[_0xc871('0xb')](_0x31709b,_0x273454)[_0xc871('0xc')](function(_0x11fbc7){logger['info'](_0xc871('0xd'),_0x123bc9,_0xc871('0xe'));logger['debug'](_0xc871('0xf'),_0x123bc9,'request\x20sent',JSON[_0xc871('0x10')](_0x11fbc7));if(_0x11fbc7[_0xc871('0x11')]){if(_0x11fbc7[_0xc871('0x11')]['code']===0x1f4){logger[_0xc871('0x11')](_0xc871('0xd'),_0x123bc9,_0x11fbc7[_0xc871('0x11')][_0xc871('0x12')]);return _0x374351(_0x11fbc7[_0xc871('0x11')]['message']);}logger[_0xc871('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x123bc9,_0x11fbc7[_0xc871('0x11')][_0xc871('0x12')]);return _0x3b0e54(_0x11fbc7['error']['message']);}else{logger[_0xc871('0x13')](_0xc871('0xd'),_0x123bc9,_0xc871('0xe'));_0x3b0e54(_0x11fbc7[_0xc871('0x14')][_0xc871('0x12')]);}})[_0xc871('0x15')](function(_0x1572de){logger[_0xc871('0x11')](_0xc871('0xd'),_0x123bc9,_0x1572de);_0x374351(_0x1572de);});});}
\ No newline at end of file
index 640f6bf..0bab105 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc667=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout'];(function(_0x3cf4ec,_0x445104){var _0x3cdfe2=function(_0x17c39e){while(--_0x17c39e){_0x3cf4ec['push'](_0x3cf4ec['shift']());}};_0x3cdfe2(++_0x445104);}(_0xc667,0x89));var _0x7c66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc667[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7c66('0x0'));var util=require(_0x7c66('0x1'));var path=require('path');var timeout=require(_0x7c66('0x2'));var express=require(_0x7c66('0x3'));var router=express[_0x7c66('0x4')]();var fs_extra=require(_0x7c66('0x5'));var auth=require(_0x7c66('0x6'));var interaction=require(_0x7c66('0x7'));var config=require(_0x7c66('0x8'));var controller=require(_0x7c66('0x9'));router[_0x7c66('0xa')]('/',auth[_0x7c66('0xb')](),controller[_0x7c66('0xc')]);router[_0x7c66('0xa')](_0x7c66('0xd'),auth[_0x7c66('0xb')](),controller[_0x7c66('0xe')]);router[_0x7c66('0xf')]('/',auth[_0x7c66('0xb')](),controller['create']);router[_0x7c66('0x10')](_0x7c66('0xd'),auth[_0x7c66('0xb')](),controller[_0x7c66('0x11')]);router[_0x7c66('0x12')](_0x7c66('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x7c66('0x13')]=router;
\ No newline at end of file
+var _0x404b=['util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3fb372,_0x2d9fc4){var _0x4d7b70=function(_0x517dfc){while(--_0x517dfc){_0x3fb372['push'](_0x3fb372['shift']());}};_0x4d7b70(++_0x2d9fc4);}(_0x404b,0x167));var _0xb404=function(_0x300f0c,_0x2488b4){_0x300f0c=_0x300f0c-0x0;var _0x4be494=_0x404b[_0x300f0c];return _0x4be494;};'use strict';var multer=require(_0xb404('0x0'));var util=require(_0xb404('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb404('0x2'));var router=express[_0xb404('0x3')]();var fs_extra=require(_0xb404('0x4'));var auth=require(_0xb404('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb404('0x6'));var controller=require(_0xb404('0x7'));router[_0xb404('0x8')]('/',auth[_0xb404('0x9')](),controller[_0xb404('0xa')]);router[_0xb404('0x8')](_0xb404('0xb'),auth[_0xb404('0x9')](),controller[_0xb404('0xc')]);router[_0xb404('0xd')]('/',auth['isAuthenticated'](),controller[_0xb404('0xe')]);router[_0xb404('0xf')](_0xb404('0xb'),auth[_0xb404('0x9')](),controller[_0xb404('0x10')]);router[_0xb404('0x11')](_0xb404('0xb'),auth[_0xb404('0x9')](),controller[_0xb404('0x12')]);module[_0xb404('0x13')]=router;
\ No newline at end of file
index 7b7b9fe..565db80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa50a=['picklist','string','STRING','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x11908c,_0x547af6){var _0x10cd4e=function(_0x2c0d66){while(--_0x2c0d66){_0x11908c['push'](_0x11908c['shift']());}};_0x10cd4e(++_0x547af6);}(_0xa50a,0x100));var _0xaa50=function(_0x2f48a7,_0x54ea3c){_0x2f48a7=_0x2f48a7-0x0;var _0x3546f6=_0xa50a[_0x2f48a7];return _0x3546f6;};'use strict';var Sequelize=require(_0xaa50('0x0'));module[_0xaa50('0x1')]={'type':{'type':Sequelize[_0xaa50('0x2')]('string',_0xaa50('0x3'),'customVariable',_0xaa50('0x4'),_0xaa50('0x5')),'defaultValue':_0xaa50('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa50('0x7')]},'keyType':{'type':Sequelize[_0xaa50('0x2')]('string',_0xaa50('0x3'),_0xaa50('0x8'))},'keyContent':{'type':Sequelize[_0xaa50('0x7')]},'idField':{'type':Sequelize[_0xaa50('0x7')]},'nameField':{'type':Sequelize[_0xaa50('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5212=['customVariable','sequelize','ENUM','string','STRING','variable'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x5212,0xf7));var _0x2521=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x5212[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x2521('0x0'));module['exports']={'type':{'type':Sequelize[_0x2521('0x1')](_0x2521('0x2'),'variable','customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x2521('0x3')]},'key':{'type':Sequelize[_0x2521('0x3')]},'keyType':{'type':Sequelize[_0x2521('0x1')](_0x2521('0x2'),_0x2521('0x4'),_0x2521('0x5'))},'keyContent':{'type':Sequelize[_0x2521('0x3')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2521('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2521('0x3')]}};
\ No newline at end of file
index 4068b35..1ce3970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc072=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','ZendeskField','create','body','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc072,0x14e));var _0x2c07=function(_0x4e39da,_0x78ecc2){_0x4e39da=_0x4e39da-0x0;var _0x2eca2b=_0xc072[_0x4e39da];return _0x2eca2b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c07('0x0'));var jsonpatch=require(_0x2c07('0x1'));var rp=require(_0x2c07('0x2'));var moment=require('moment');var BPromise=require(_0x2c07('0x3'));var Mustache=require(_0x2c07('0x4'));var util=require('util');var path=require(_0x2c07('0x5'));var sox=require(_0x2c07('0x6'));var csv=require(_0x2c07('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c07('0x8'));var _=require('lodash');var squel=require(_0x2c07('0x9'));var crypto=require(_0x2c07('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c07('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c07('0xc'));var Papa=require(_0x2c07('0xd'));var Redis=require(_0x2c07('0xe'));var authService=require(_0x2c07('0xf'));var qs=require(_0x2c07('0x10'));var as=require(_0x2c07('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c07('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c07('0x13'));var db=require(_0x2c07('0x14'))['db'];function respondWithStatusCode(_0x559ae7,_0x3a87a4){_0x3a87a4=_0x3a87a4||0xcc;return function(_0x2a9a8a){if(_0x2a9a8a){return _0x559ae7['sendStatus'](_0x3a87a4);}return _0x559ae7['status'](_0x3a87a4)['end']();};}function respondWithResult(_0xe6e9d,_0x48b5ca){_0x48b5ca=_0x48b5ca||0xc8;return function(_0x1f323e){if(_0x1f323e){return _0xe6e9d[_0x2c07('0x15')](_0x48b5ca)[_0x2c07('0x16')](_0x1f323e);}};}function respondWithFilteredResult(_0x3acb2a,_0x183cb4){return function(_0x146d74){if(_0x146d74){var _0xd6b472=typeof _0x183cb4[_0x2c07('0x17')]===_0x2c07('0x18')&&typeof _0x183cb4[_0x2c07('0x19')]===_0x2c07('0x18');var _0x2327e2=_0x146d74[_0x2c07('0x1a')];var _0x1de11c=_0xd6b472?0x0:_0x183cb4[_0x2c07('0x17')];var _0x59f9c3=_0xd6b472?_0x146d74[_0x2c07('0x1a')]:_0x183cb4[_0x2c07('0x17')]+_0x183cb4[_0x2c07('0x19')];var _0x39e598;if(_0x59f9c3>=_0x2327e2){_0x59f9c3=_0x2327e2;_0x39e598=0xc8;}else{_0x39e598=0xce;}_0x3acb2a[_0x2c07('0x15')](_0x39e598);return _0x3acb2a[_0x2c07('0x1b')](_0x2c07('0x1c'),_0x1de11c+'-'+_0x59f9c3+'/'+_0x2327e2)[_0x2c07('0x16')](_0x146d74);}return null;};}function patchUpdates(_0xe01103){return function(_0x1b2264){try{jsonpatch[_0x2c07('0x1d')](_0x1b2264,_0xe01103,!![]);}catch(_0x1f7db1){return BPromise[_0x2c07('0x1e')](_0x1f7db1);}return _0x1b2264[_0x2c07('0x1f')]();};}function saveUpdates(_0x6f5d6d,_0xa9159e){return function(_0x529307){if(_0x529307){return _0x529307[_0x2c07('0x20')](_0x6f5d6d)[_0x2c07('0x21')](function(_0x24409c){return _0x24409c;});}return null;};}function removeEntity(_0x5e77ca,_0x587188){return function(_0x57e0bc){if(_0x57e0bc){return _0x57e0bc[_0x2c07('0x22')]()[_0x2c07('0x21')](function(){_0x5e77ca[_0x2c07('0x15')](0xcc)[_0x2c07('0x23')]();});}};}function handleEntityNotFound(_0x4537c7,_0x4738c4){return function(_0x376a6e){if(!_0x376a6e){_0x4537c7[_0x2c07('0x24')](0x194);}return _0x376a6e;};}function handleError(_0x184863,_0x53460a){_0x53460a=_0x53460a||0x1f4;return function(_0x1d2f77){logger[_0x2c07('0x25')](_0x1d2f77['stack']);if(_0x1d2f77[_0x2c07('0x26')]){delete _0x1d2f77[_0x2c07('0x26')];}_0x184863[_0x2c07('0x15')](_0x53460a)['send'](_0x1d2f77);};}exports[_0x2c07('0x27')]=function(_0x11cb39,_0x2abd24){var _0x2507cc={},_0x403e51={},_0x3e9328={'count':0x0,'rows':[]};var _0x527878=_[_0x2c07('0x28')](db['ZendeskField'][_0x2c07('0x29')],function(_0xbcdbe3){return{'name':_0xbcdbe3[_0x2c07('0x2a')],'type':_0xbcdbe3[_0x2c07('0x2b')][_0x2c07('0x2c')]};});_0x403e51['model']=_[_0x2c07('0x28')](_0x527878,_0x2c07('0x26'));_0x403e51[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x11cb39[_0x2c07('0x2d')]);_0x403e51[_0x2c07('0x2f')]=_['intersection'](_0x403e51[_0x2c07('0x30')],_0x403e51['query']);_0x2507cc[_0x2c07('0x31')]=_['intersection'](_0x403e51['model'],qs[_0x2c07('0x32')](_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x2507cc[_0x2c07('0x31')]=_0x2507cc[_0x2c07('0x31')][_0x2c07('0x33')]?_0x2507cc[_0x2c07('0x31')]:_0x403e51['model'];if(!_0x11cb39['query'][_0x2c07('0x34')](_0x2c07('0x35'))){_0x2507cc[_0x2c07('0x19')]=qs[_0x2c07('0x19')](_0x11cb39['query'][_0x2c07('0x19')]);_0x2507cc[_0x2c07('0x17')]=qs[_0x2c07('0x17')](_0x11cb39['query'][_0x2c07('0x17')]);}_0x2507cc[_0x2c07('0x36')]=qs['sort'](_0x11cb39['query'][_0x2c07('0x37')]);_0x2507cc[_0x2c07('0x38')]=qs[_0x2c07('0x2f')](_[_0x2c07('0x39')](_0x11cb39[_0x2c07('0x2d')],_0x403e51[_0x2c07('0x2f')]),_0x527878);if(_0x11cb39['query'][_0x2c07('0x3a')]){_0x2507cc[_0x2c07('0x38')]=_['merge'](_0x2507cc[_0x2c07('0x38')],{'$or':_[_0x2c07('0x28')](_0x527878,function(_0x4b1d61){if(_0x4b1d61[_0x2c07('0x2b')]!=='VIRTUAL'){var _0x592d2a={};_0x592d2a[_0x4b1d61[_0x2c07('0x26')]]={'$like':'%'+_0x11cb39[_0x2c07('0x2d')]['filter']+'%'};return _0x592d2a;}})});}_0x2507cc=_[_0x2c07('0x3b')]({},_0x2507cc,_0x11cb39[_0x2c07('0x3c')]);var _0x2e7f27={'where':_0x2507cc[_0x2c07('0x38')]};return db['ZendeskField'][_0x2c07('0x1a')](_0x2e7f27)[_0x2c07('0x21')](function(_0xac217d){_0x3e9328[_0x2c07('0x1a')]=_0xac217d;if(_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x2507cc['include']=[{'all':!![]}];}return db['ZendeskField'][_0x2c07('0x3e')](_0x2507cc);})[_0x2c07('0x21')](function(_0x372b52){_0x3e9328['rows']=_0x372b52;return _0x3e9328;})[_0x2c07('0x21')](respondWithFilteredResult(_0x2abd24,_0x2507cc))[_0x2c07('0x3f')](handleError(_0x2abd24,null));};exports['show']=function(_0x28fb75,_0x26e312){var _0x27a178={'raw':!![],'where':{'id':_0x28fb75[_0x2c07('0x40')]['id']}},_0x1d5c61={};_0x1d5c61[_0x2c07('0x30')]=_[_0x2c07('0x2e')](db[_0x2c07('0x41')][_0x2c07('0x29')]);_0x1d5c61[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x28fb75['query']);_0x1d5c61[_0x2c07('0x2f')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],_0x1d5c61[_0x2c07('0x2d')]);_0x27a178[_0x2c07('0x31')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],qs[_0x2c07('0x32')](_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x27a178['attributes']=_0x27a178[_0x2c07('0x31')][_0x2c07('0x33')]?_0x27a178[_0x2c07('0x31')]:_0x1d5c61['model'];if(_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x27a178['include']=[{'all':!![]}];}_0x27a178=_[_0x2c07('0x3b')]({},_0x27a178,_0x28fb75[_0x2c07('0x3c')]);return db[_0x2c07('0x41')]['find'](_0x27a178)[_0x2c07('0x21')](handleEntityNotFound(_0x26e312,null))['then'](respondWithResult(_0x26e312,null))[_0x2c07('0x3f')](handleError(_0x26e312,null));};exports[_0x2c07('0x42')]=function(_0x5bd2ba,_0x11841b){return db[_0x2c07('0x41')][_0x2c07('0x42')](_0x5bd2ba[_0x2c07('0x43')],{})['then'](respondWithResult(_0x11841b,0xc9))[_0x2c07('0x3f')](handleError(_0x11841b,null));};exports['update']=function(_0x168d45,_0x353e8f){if(_0x168d45[_0x2c07('0x43')]['id']){delete _0x168d45['body']['id'];}return db[_0x2c07('0x41')]['find']({'where':{'id':_0x168d45[_0x2c07('0x40')]['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x353e8f,null))[_0x2c07('0x21')](saveUpdates(_0x168d45['body'],null))[_0x2c07('0x21')](respondWithResult(_0x353e8f,null))[_0x2c07('0x3f')](handleError(_0x353e8f,null));};exports[_0x2c07('0x22')]=function(_0x2734be,_0x8d8515){return db[_0x2c07('0x41')][_0x2c07('0x44')]({'where':{'id':_0x2734be['params']['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x8d8515,null))[_0x2c07('0x21')](removeEntity(_0x8d8515,null))[_0x2c07('0x3f')](handleError(_0x8d8515,null));};
\ No newline at end of file
+var _0x108a=['intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x2b3cfc,_0x2d751b){var _0x5f2123=function(_0x2cbb03){while(--_0x2cbb03){_0x2b3cfc['push'](_0x2b3cfc['shift']());}};_0x5f2123(++_0x2d751b);}(_0x108a,0xf0));var _0xa108=function(_0x2f31d3,_0x1e3510){_0x2f31d3=_0x2f31d3-0x0;var _0xd48e75=_0x108a[_0x2f31d3];return _0xd48e75;};'use strict';var emlformat=require(_0xa108('0x0'));var rimraf=require(_0xa108('0x1'));var zipdir=require(_0xa108('0x2'));var jsonpatch=require(_0xa108('0x3'));var rp=require('request-promise');var moment=require(_0xa108('0x4'));var BPromise=require(_0xa108('0x5'));var Mustache=require('mustache');var util=require(_0xa108('0x6'));var path=require(_0xa108('0x7'));var sox=require('sox');var csv=require(_0xa108('0x8'));var ejs=require(_0xa108('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa108('0xa'));var squel=require('squel');var crypto=require(_0xa108('0xb'));var jsforce=require(_0xa108('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa108('0x8'));var querystring=require(_0xa108('0xd'));var Papa=require(_0xa108('0xe'));var Redis=require(_0xa108('0xf'));var authService=require(_0xa108('0x10'));var qs=require(_0xa108('0x11'));var as=require(_0xa108('0x12'));var hardwareService=require(_0xa108('0x13'));var logger=require('../../config/logger')(_0xa108('0x14'));var utils=require(_0xa108('0x15'));var config=require(_0xa108('0x16'));var licenseUtil=require(_0xa108('0x17'));var db=require(_0xa108('0x18'))['db'];function respondWithStatusCode(_0x426dcf,_0x305f53){_0x305f53=_0x305f53||0xcc;return function(_0x4be9b0){if(_0x4be9b0){return _0x426dcf[_0xa108('0x19')](_0x305f53);}return _0x426dcf[_0xa108('0x1a')](_0x305f53)[_0xa108('0x1b')]();};}function respondWithResult(_0x58e5b3,_0x2e9309){_0x2e9309=_0x2e9309||0xc8;return function(_0x23ee62){if(_0x23ee62){return _0x58e5b3['status'](_0x2e9309)['json'](_0x23ee62);}};}function respondWithFilteredResult(_0x459477,_0x341a8c){return function(_0x215abe){if(_0x215abe){var _0x14a50b=typeof _0x341a8c[_0xa108('0x1c')]===_0xa108('0x1d')&&typeof _0x341a8c[_0xa108('0x1e')]==='undefined';var _0x4fb92d=_0x215abe[_0xa108('0x1f')];var _0x2fc6d8=_0x14a50b?0x0:_0x341a8c[_0xa108('0x1c')];var _0x5732e0=_0x14a50b?_0x215abe[_0xa108('0x1f')]:_0x341a8c[_0xa108('0x1c')]+_0x341a8c[_0xa108('0x1e')];var _0x346555;if(_0x5732e0>=_0x4fb92d){_0x5732e0=_0x4fb92d;_0x346555=0xc8;}else{_0x346555=0xce;}_0x459477[_0xa108('0x1a')](_0x346555);return _0x459477['set'](_0xa108('0x20'),_0x2fc6d8+'-'+_0x5732e0+'/'+_0x4fb92d)[_0xa108('0x21')](_0x215abe);}return null;};}function patchUpdates(_0x4725a6){return function(_0x425437){try{jsonpatch[_0xa108('0x22')](_0x425437,_0x4725a6,!![]);}catch(_0xbbdc9f){return BPromise[_0xa108('0x23')](_0xbbdc9f);}return _0x425437[_0xa108('0x24')]();};}function saveUpdates(_0x8736ba,_0x37b1a0){return function(_0x4d1692){if(_0x4d1692){return _0x4d1692[_0xa108('0x25')](_0x8736ba)[_0xa108('0x26')](function(_0x491696){return _0x491696;});}return null;};}function removeEntity(_0x5cf97b,_0x5193f6){return function(_0x1d9e94){if(_0x1d9e94){return _0x1d9e94['destroy']()['then'](function(){_0x5cf97b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x561b12,_0x593ab0){return function(_0x14e0b3){if(!_0x14e0b3){_0x561b12['sendStatus'](0x194);}return _0x14e0b3;};}function handleError(_0x356600,_0x1f273f){_0x1f273f=_0x1f273f||0x1f4;return function(_0x28a3ae){logger[_0xa108('0x27')](_0x28a3ae[_0xa108('0x28')]);if(_0x28a3ae[_0xa108('0x29')]){delete _0x28a3ae['name'];}_0x356600['status'](_0x1f273f)[_0xa108('0x2a')](_0x28a3ae);};}exports['index']=function(_0xe41634,_0x3670da){var _0x274e96={},_0x879982={},_0xb8c8db={'count':0x0,'rows':[]};var _0x288048=_[_0xa108('0x2b')](db[_0xa108('0x2c')][_0xa108('0x2d')],function(_0x164f62){return{'name':_0x164f62[_0xa108('0x2e')],'type':_0x164f62[_0xa108('0x2f')][_0xa108('0x30')]};});_0x879982[_0xa108('0x31')]=_[_0xa108('0x2b')](_0x288048,'name');_0x879982[_0xa108('0x32')]=_['keys'](_0xe41634[_0xa108('0x32')]);_0x879982[_0xa108('0x33')]=_[_0xa108('0x34')](_0x879982[_0xa108('0x31')],_0x879982[_0xa108('0x32')]);_0x274e96[_0xa108('0x35')]=_[_0xa108('0x34')](_0x879982['model'],qs[_0xa108('0x36')](_0xe41634['query'][_0xa108('0x36')]));_0x274e96[_0xa108('0x35')]=_0x274e96[_0xa108('0x35')][_0xa108('0x37')]?_0x274e96[_0xa108('0x35')]:_0x879982['model'];if(!_0xe41634[_0xa108('0x32')]['hasOwnProperty'](_0xa108('0x38'))){_0x274e96[_0xa108('0x1e')]=qs[_0xa108('0x1e')](_0xe41634[_0xa108('0x32')][_0xa108('0x1e')]);_0x274e96[_0xa108('0x1c')]=qs['offset'](_0xe41634[_0xa108('0x32')]['offset']);}_0x274e96[_0xa108('0x39')]=qs[_0xa108('0x3a')](_0xe41634[_0xa108('0x32')][_0xa108('0x3a')]);_0x274e96['where']=qs[_0xa108('0x33')](_[_0xa108('0x3b')](_0xe41634[_0xa108('0x32')],_0x879982['filters']),_0x288048);if(_0xe41634[_0xa108('0x32')][_0xa108('0x3c')]){_0x274e96['where']=_[_0xa108('0x3d')](_0x274e96['where'],{'$or':_[_0xa108('0x2b')](_0x288048,function(_0x54c6bd){if(_0x54c6bd[_0xa108('0x2f')]!==_0xa108('0x3e')){var _0x317005={};_0x317005[_0x54c6bd['name']]={'$like':'%'+_0xe41634[_0xa108('0x32')]['filter']+'%'};return _0x317005;}})});}_0x274e96=_['merge']({},_0x274e96,_0xe41634[_0xa108('0x3f')]);var _0x592205={'where':_0x274e96['where']};return db[_0xa108('0x2c')][_0xa108('0x1f')](_0x592205)[_0xa108('0x26')](function(_0x34ee17){_0xb8c8db[_0xa108('0x1f')]=_0x34ee17;if(_0xe41634['query']['includeAll']){_0x274e96['include']=[{'all':!![]}];}return db[_0xa108('0x2c')][_0xa108('0x40')](_0x274e96);})[_0xa108('0x26')](function(_0x5bbcd3){_0xb8c8db['rows']=_0x5bbcd3;return _0xb8c8db;})[_0xa108('0x26')](respondWithFilteredResult(_0x3670da,_0x274e96))[_0xa108('0x41')](handleError(_0x3670da,null));};exports[_0xa108('0x42')]=function(_0x6db366,_0xa9f86d){var _0x1cc025={'raw':!![],'where':{'id':_0x6db366[_0xa108('0x43')]['id']}},_0x46e1f5={};_0x46e1f5[_0xa108('0x31')]=_[_0xa108('0x44')](db[_0xa108('0x2c')][_0xa108('0x2d')]);_0x46e1f5[_0xa108('0x32')]=_['keys'](_0x6db366['query']);_0x46e1f5[_0xa108('0x33')]=_['intersection'](_0x46e1f5[_0xa108('0x31')],_0x46e1f5['query']);_0x1cc025[_0xa108('0x35')]=_[_0xa108('0x34')](_0x46e1f5[_0xa108('0x31')],qs['fields'](_0x6db366['query'][_0xa108('0x36')]));_0x1cc025['attributes']=_0x1cc025[_0xa108('0x35')][_0xa108('0x37')]?_0x1cc025[_0xa108('0x35')]:_0x46e1f5[_0xa108('0x31')];if(_0x6db366['query']['includeAll']){_0x1cc025['include']=[{'all':!![]}];}_0x1cc025=_[_0xa108('0x3d')]({},_0x1cc025,_0x6db366[_0xa108('0x3f')]);return db['ZendeskField'][_0xa108('0x45')](_0x1cc025)['then'](handleEntityNotFound(_0xa9f86d,null))[_0xa108('0x26')](respondWithResult(_0xa9f86d,null))[_0xa108('0x41')](handleError(_0xa9f86d,null));};exports[_0xa108('0x46')]=function(_0x566f0a,_0x30ddf2){return db[_0xa108('0x2c')]['create'](_0x566f0a[_0xa108('0x47')],{})[_0xa108('0x26')](respondWithResult(_0x30ddf2,0xc9))['catch'](handleError(_0x30ddf2,null));};exports['update']=function(_0x14eef8,_0x3707ba){if(_0x14eef8[_0xa108('0x47')]['id']){delete _0x14eef8[_0xa108('0x47')]['id'];}return db[_0xa108('0x2c')][_0xa108('0x45')]({'where':{'id':_0x14eef8['params']['id']}})['then'](handleEntityNotFound(_0x3707ba,null))[_0xa108('0x26')](saveUpdates(_0x14eef8[_0xa108('0x47')],null))[_0xa108('0x26')](respondWithResult(_0x3707ba,null))['catch'](handleError(_0x3707ba,null));};exports[_0xa108('0x48')]=function(_0x165f4d,_0x10eb9c){return db[_0xa108('0x2c')]['find']({'where':{'id':_0x165f4d[_0xa108('0x43')]['id']}})[_0xa108('0x26')](handleEntityNotFound(_0x10eb9c,null))[_0xa108('0x26')](removeEntity(_0x10eb9c,null))[_0xa108('0x41')](handleError(_0x10eb9c,null));};
\ No newline at end of file
index d7b3985..28278b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f4=['path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb3f4,0xa3));var _0x4b3f=function(_0x14658f,_0x1c23a1){_0x14658f=_0x14658f-0x0;var _0x22b456=_0xb3f4[_0x14658f];return _0x22b456;};'use strict';var _=require(_0x4b3f('0x0'));var util=require(_0x4b3f('0x1'));var logger=require(_0x4b3f('0x2'))(_0x4b3f('0x3'));var moment=require(_0x4b3f('0x4'));var BPromise=require(_0x4b3f('0x5'));var rp=require(_0x4b3f('0x6'));var fs=require('fs');var path=require(_0x4b3f('0x7'));var rimraf=require(_0x4b3f('0x8'));var config=require(_0x4b3f('0x9'));var attributes=require(_0x4b3f('0xa'));module[_0x4b3f('0xb')]=function(_0x340cd5,_0x363533){return _0x340cd5[_0x4b3f('0xc')]('ZendeskField',attributes,{'tableName':_0x4b3f('0xd'),'paranoid':![],'indexes':[{'name':_0x4b3f('0xe'),'fields':[_0x4b3f('0xf'),_0x4b3f('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a4a=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8a4a,0x15e));var _0xa8a4=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x8a4a[_0x3da72b];return _0xc64ac4;};'use strict';var _=require(_0xa8a4('0x0'));var util=require(_0xa8a4('0x1'));var logger=require(_0xa8a4('0x2'))(_0xa8a4('0x3'));var moment=require(_0xa8a4('0x4'));var BPromise=require(_0xa8a4('0x5'));var rp=require(_0xa8a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8a4('0x7'));var config=require(_0xa8a4('0x8'));var attributes=require(_0xa8a4('0x9'));module[_0xa8a4('0xa')]=function(_0x41a950,_0x1bdab1){return _0x41a950[_0xa8a4('0xb')](_0xa8a4('0xc'),attributes,{'tableName':_0xa8a4('0xd'),'paranoid':![],'indexes':[{'name':_0xa8a4('0xe'),'fields':['idField',_0xa8a4('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 1fb8022..3726b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7275=['error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x58eafd,_0x264a0a){var _0x192735=function(_0x2ae8fc){while(--_0x2ae8fc){_0x58eafd['push'](_0x58eafd['shift']());}};_0x192735(++_0x264a0a);}(_0x7275,0x193));var _0x5727=function(_0x413f60,_0x1865d0){_0x413f60=_0x413f60-0x0;var _0x519ed2=_0x7275[_0x413f60];return _0x519ed2;};'use strict';var _=require(_0x5727('0x0'));var util=require(_0x5727('0x1'));var moment=require(_0x5727('0x2'));var BPromise=require(_0x5727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5727('0x4'));var db=require(_0x5727('0x5'))['db'];var utils=require(_0x5727('0x6'));var logger=require(_0x5727('0x7'))(_0x5727('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5727('0x9')][_0x5727('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55737a,_0x11a5d0,_0x3bb1c3){return new BPromise(function(_0x4fac67,_0x127b06){return client[_0x5727('0xb')](_0x55737a,_0x3bb1c3)[_0x5727('0xc')](function(_0x1ca0d3){logger['info'](_0x5727('0xd'),_0x11a5d0,_0x5727('0xe'));logger[_0x5727('0xf')](_0x5727('0x10'),_0x11a5d0,_0x5727('0xe'),JSON['stringify'](_0x1ca0d3));if(_0x1ca0d3['error']){if(_0x1ca0d3[_0x5727('0x11')][_0x5727('0x12')]===0x1f4){logger[_0x5727('0x11')](_0x5727('0xd'),_0x11a5d0,_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);return _0x127b06(_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);}logger['error'](_0x5727('0xd'),_0x11a5d0,_0x1ca0d3[_0x5727('0x11')][_0x5727('0x13')]);return _0x4fac67(_0x1ca0d3[_0x5727('0x11')]['message']);}else{logger['info'](_0x5727('0xd'),_0x11a5d0,_0x5727('0xe'));_0x4fac67(_0x1ca0d3[_0x5727('0x14')][_0x5727('0x13')]);}})['catch'](function(_0x509ab1){logger[_0x5727('0x11')](_0x5727('0xd'),_0x11a5d0,_0x509ab1);_0x127b06(_0x509ab1);});});}
\ No newline at end of file
+var _0x2f6c=['../../config/environment','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x427c29,_0x40d8e7){var _0x58cb95=function(_0x5e551d){while(--_0x5e551d){_0x427c29['push'](_0x427c29['shift']());}};_0x58cb95(++_0x40d8e7);}(_0x2f6c,0x11e));var _0xc2f6=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x2f6c[_0x2a5099];return _0x2802f1;};'use strict';var _=require(_0xc2f6('0x0'));var util=require('util');var moment=require(_0xc2f6('0x1'));var BPromise=require(_0xc2f6('0x2'));var rs=require(_0xc2f6('0x3'));var fs=require('fs');var Redis=require(_0xc2f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2f6('0x5'));var logger=require(_0xc2f6('0x6'))(_0xc2f6('0x7'));var config=require(_0xc2f6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc2f6('0x9')][_0xc2f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e4c5d,_0x2fe0b5,_0x2a4db7){return new BPromise(function(_0xa4ddf9,_0x50159a){return client['request'](_0x1e4c5d,_0x2a4db7)[_0xc2f6('0xb')](function(_0x5b9cc5){logger[_0xc2f6('0xc')](_0xc2f6('0xd'),_0x2fe0b5,_0xc2f6('0xe'));logger['debug'](_0xc2f6('0xf'),_0x2fe0b5,_0xc2f6('0xe'),JSON['stringify'](_0x5b9cc5));if(_0x5b9cc5[_0xc2f6('0x10')]){if(_0x5b9cc5[_0xc2f6('0x10')][_0xc2f6('0x11')]===0x1f4){logger[_0xc2f6('0x10')](_0xc2f6('0xd'),_0x2fe0b5,_0x5b9cc5[_0xc2f6('0x10')][_0xc2f6('0x12')]);return _0x50159a(_0x5b9cc5[_0xc2f6('0x10')][_0xc2f6('0x12')]);}logger[_0xc2f6('0x10')](_0xc2f6('0xd'),_0x2fe0b5,_0x5b9cc5[_0xc2f6('0x10')][_0xc2f6('0x12')]);return _0xa4ddf9(_0x5b9cc5[_0xc2f6('0x10')][_0xc2f6('0x12')]);}else{logger[_0xc2f6('0xc')](_0xc2f6('0xd'),_0x2fe0b5,_0xc2f6('0xe'));_0xa4ddf9(_0x5b9cc5[_0xc2f6('0x13')][_0xc2f6('0x12')]);}})[_0xc2f6('0x14')](function(_0x1c9ebe){logger[_0xc2f6('0x10')](_0xc2f6('0xd'),_0x2fe0b5,_0x1c9ebe);_0x50159a(_0x1c9ebe);});});}
\ No newline at end of file
index 68c6e05..e7df6a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b13=['get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create','update','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x737b71,_0x407d82){var _0x1b32f3=function(_0x8d9ed8){while(--_0x8d9ed8){_0x737b71['push'](_0x737b71['shift']());}};_0x1b32f3(++_0x407d82);}(_0x6b13,0xd0));var _0x36b1=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x6b13[_0x5a60ce];return _0x393e5e;};'use strict';var multer=require('multer');var util=require(_0x36b1('0x0'));var path=require(_0x36b1('0x1'));var timeout=require(_0x36b1('0x2'));var express=require('express');var router=express[_0x36b1('0x3')]();var fs_extra=require(_0x36b1('0x4'));var auth=require(_0x36b1('0x5'));var interaction=require(_0x36b1('0x6'));var config=require(_0x36b1('0x7'));var controller=require('./intZohoAccount.controller');router[_0x36b1('0x8')]('/',auth[_0x36b1('0x9')](),controller[_0x36b1('0xa')]);router[_0x36b1('0x8')](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller['show']);router[_0x36b1('0x8')](_0x36b1('0xc'),auth[_0x36b1('0x9')](),controller['getConfigurations']);router[_0x36b1('0x8')](_0x36b1('0xd'),auth[_0x36b1('0x9')](),controller[_0x36b1('0xe')]);router[_0x36b1('0xf')]('/',auth[_0x36b1('0x9')](),controller[_0x36b1('0x10')]);router['post'](_0x36b1('0xc'),auth[_0x36b1('0x9')](),controller['addConfiguration']);router['put'](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller[_0x36b1('0x11')]);router['delete'](_0x36b1('0xb'),auth[_0x36b1('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x2272=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated'];(function(_0x4315f7,_0x5e14ed){var _0x3d7aea=function(_0x5a64ea){while(--_0x5a64ea){_0x4315f7['push'](_0x4315f7['shift']());}};_0x3d7aea(++_0x5e14ed);}(_0x2272,0xf3));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x2227('0x0'));var path=require('path');var timeout=require(_0x2227('0x1'));var express=require(_0x2227('0x2'));var router=express[_0x2227('0x3')]();var fs_extra=require(_0x2227('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2227('0x5'));var config=require(_0x2227('0x6'));var controller=require(_0x2227('0x7'));router[_0x2227('0x8')]('/',auth[_0x2227('0x9')](),controller[_0x2227('0xa')]);router[_0x2227('0x8')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0xc')]);router[_0x2227('0x8')](_0x2227('0xd'),auth[_0x2227('0x9')](),controller[_0x2227('0xe')]);router[_0x2227('0x8')](_0x2227('0xf'),auth[_0x2227('0x9')](),controller['getFields']);router[_0x2227('0x10')]('/',auth[_0x2227('0x9')](),controller[_0x2227('0x11')]);router[_0x2227('0x10')](_0x2227('0xd'),auth[_0x2227('0x9')](),controller[_0x2227('0x12')]);router[_0x2227('0x13')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller[_0x2227('0x14')]);router[_0x2227('0x15')](_0x2227('0xb'),auth[_0x2227('0x9')](),controller['destroy']);module[_0x2227('0x16')]=router;
\ No newline at end of file
index dceec2d..06c2719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['sequelize','exports','STRING'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x34e8,0x12c));var _0x834e=function(_0x5523aa,_0x13e9d0){_0x5523aa=_0x5523aa-0x0;var _0x4bb1a1=_0x34e8[_0x5523aa];return _0x4bb1a1;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}};
\ No newline at end of file
+var _0x84ab=['sequelize','exports','STRING'];(function(_0x2d54b1,_0x5038e3){var _0x37e8a9=function(_0x55f976){while(--_0x55f976){_0x2d54b1['push'](_0x2d54b1['shift']());}};_0x37e8a9(++_0x5038e3);}(_0x84ab,0x12f));var _0xb84a=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x84ab[_0x4d7f3f];return _0x5d67cc;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]},'host':{'type':Sequelize[_0xb84a('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb84a('0x2')]},'clientSecret':{'type':Sequelize[_0xb84a('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb84a('0x2')]},'refreshToken':{'type':Sequelize[_0xb84a('0x2')]}};
\ No newline at end of file
index cb5b765..34b1497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabb2=['../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','error','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','length','catch','create','body','find','params','getConfigurations','findOne','ZohoConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId','serverUrl','code','zoho.eu','com','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x34bab7,_0xedfc66){var _0x8319f7=function(_0x31e9e5){while(--_0x31e9e5){_0x34bab7['push'](_0x34bab7['shift']());}};_0x8319f7(++_0xedfc66);}(_0xabb2,0xeb));var _0x2abb=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0xabb2[_0x34bc6c];return _0x168820;};'use strict';var emlformat=require(_0x2abb('0x0'));var rimraf=require(_0x2abb('0x1'));var zipdir=require(_0x2abb('0x2'));var jsonpatch=require(_0x2abb('0x3'));var rp=require(_0x2abb('0x4'));var moment=require(_0x2abb('0x5'));var BPromise=require(_0x2abb('0x6'));var Mustache=require('mustache');var util=require(_0x2abb('0x7'));var path=require(_0x2abb('0x8'));var sox=require('sox');var csv=require(_0x2abb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2abb('0xa'));var _=require(_0x2abb('0xb'));var squel=require('squel');var crypto=require(_0x2abb('0xc'));var jsforce=require(_0x2abb('0xd'));var deskjs=require(_0x2abb('0xe'));var toCsv=require(_0x2abb('0x9'));var querystring=require('querystring');var Papa=require(_0x2abb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2abb('0x10'));var as=require(_0x2abb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2abb('0x12'))(_0x2abb('0x13'));var utils=require(_0x2abb('0x14'));var config=require(_0x2abb('0x15'));var licenseUtil=require(_0x2abb('0x16'));var db=require(_0x2abb('0x17'))['db'];var integrations=require(_0x2abb('0x18'));function respondWithStatusCode(_0x2e1aa7,_0x467677){_0x467677=_0x467677||0xcc;return function(_0x32dd32){if(_0x32dd32){return _0x2e1aa7[_0x2abb('0x19')](_0x467677);}return _0x2e1aa7['status'](_0x467677)[_0x2abb('0x1a')]();};}function respondWithResult(_0x545ad4,_0x1a73ad){_0x1a73ad=_0x1a73ad||0xc8;return function(_0x31c971){if(_0x31c971){return _0x545ad4[_0x2abb('0x1b')](_0x1a73ad)[_0x2abb('0x1c')](_0x31c971);}};}function respondWithFilteredResult(_0x4e48b3,_0x5087d8){return function(_0x3a219e){if(_0x3a219e){var _0x17647c=typeof _0x5087d8[_0x2abb('0x1d')]===_0x2abb('0x1e')&&typeof _0x5087d8[_0x2abb('0x1f')]==='undefined';var _0x3a6248=_0x3a219e[_0x2abb('0x20')];var _0x3e18dd=_0x17647c?0x0:_0x5087d8[_0x2abb('0x1d')];var _0x2f304e=_0x17647c?_0x3a219e[_0x2abb('0x20')]:_0x5087d8['offset']+_0x5087d8[_0x2abb('0x1f')];var _0x13c9f4;if(_0x2f304e>=_0x3a6248){_0x2f304e=_0x3a6248;_0x13c9f4=0xc8;}else{_0x13c9f4=0xce;}_0x4e48b3[_0x2abb('0x1b')](_0x13c9f4);return _0x4e48b3[_0x2abb('0x21')]('Content-Range',_0x3e18dd+'-'+_0x2f304e+'/'+_0x3a6248)[_0x2abb('0x1c')](_0x3a219e);}return null;};}function patchUpdates(_0xf2d379){return function(_0x26edd8){try{jsonpatch['apply'](_0x26edd8,_0xf2d379,!![]);}catch(_0x1a7df6){return BPromise[_0x2abb('0x22')](_0x1a7df6);}return _0x26edd8[_0x2abb('0x23')]();};}function saveUpdates(_0x7b19f6,_0x69e060){return function(_0x44c3e9){if(_0x44c3e9){return _0x44c3e9[_0x2abb('0x24')](_0x7b19f6)['then'](function(_0x53f52b){return _0x53f52b;});}return null;};}function removeEntity(_0x11681d,_0x35ce1e){return function(_0x5bb2cd){if(_0x5bb2cd){return _0x5bb2cd['destroy']()['then'](function(){_0x11681d[_0x2abb('0x1b')](0xcc)[_0x2abb('0x1a')]();});}};}function handleEntityNotFound(_0x40206f,_0x2e61cc){return function(_0x527aed){if(!_0x527aed){_0x40206f[_0x2abb('0x19')](0x194);}return _0x527aed;};}function handleError(_0x4e62b5,_0x3a4129){_0x3a4129=_0x3a4129||0x1f4;return function(_0x388a2c){logger[_0x2abb('0x25')](_0x388a2c[_0x2abb('0x26')]);if(_0x388a2c[_0x2abb('0x27')]){delete _0x388a2c['name'];}_0x4e62b5[_0x2abb('0x1b')](_0x3a4129)[_0x2abb('0x28')](_0x388a2c);};}exports['index']=function(_0x1c481b,_0x2751c8){var _0x3c01ab={},_0x3b32e1={},_0x143acc={'count':0x0,'rows':[]};var _0x177e1b=_[_0x2abb('0x29')](db[_0x2abb('0x2a')][_0x2abb('0x2b')],function(_0x4273b0){return{'name':_0x4273b0[_0x2abb('0x2c')],'type':_0x4273b0[_0x2abb('0x2d')][_0x2abb('0x2e')]};});_0x3b32e1[_0x2abb('0x2f')]=_['map'](_0x177e1b,_0x2abb('0x27'));_0x3b32e1[_0x2abb('0x30')]=_[_0x2abb('0x31')](_0x1c481b[_0x2abb('0x30')]);_0x3b32e1[_0x2abb('0x32')]=_[_0x2abb('0x33')](_0x3b32e1[_0x2abb('0x2f')],_0x3b32e1['query']);_0x3c01ab[_0x2abb('0x34')]=_['intersection'](_0x3b32e1[_0x2abb('0x2f')],qs[_0x2abb('0x35')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x35')]));_0x3c01ab[_0x2abb('0x34')]=_0x3c01ab[_0x2abb('0x34')]['length']?_0x3c01ab[_0x2abb('0x34')]:_0x3b32e1[_0x2abb('0x2f')];if(!_0x1c481b[_0x2abb('0x30')][_0x2abb('0x36')](_0x2abb('0x37'))){_0x3c01ab[_0x2abb('0x1f')]=qs[_0x2abb('0x1f')](_0x1c481b[_0x2abb('0x30')]['limit']);_0x3c01ab[_0x2abb('0x1d')]=qs[_0x2abb('0x1d')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x1d')]);}_0x3c01ab['order']=qs[_0x2abb('0x38')](_0x1c481b[_0x2abb('0x30')][_0x2abb('0x38')]);_0x3c01ab['where']=qs['filters'](_[_0x2abb('0x39')](_0x1c481b[_0x2abb('0x30')],_0x3b32e1[_0x2abb('0x32')]),_0x177e1b);if(_0x1c481b[_0x2abb('0x30')][_0x2abb('0x3a')]){_0x3c01ab[_0x2abb('0x3b')]=_[_0x2abb('0x3c')](_0x3c01ab[_0x2abb('0x3b')],{'$or':_[_0x2abb('0x29')](_0x177e1b,function(_0x3063ae){if(_0x3063ae['type']!==_0x2abb('0x3d')){var _0x2d6e9e={};_0x2d6e9e[_0x3063ae[_0x2abb('0x27')]]={'$like':'%'+_0x1c481b[_0x2abb('0x30')]['filter']+'%'};return _0x2d6e9e;}})});}_0x3c01ab=_[_0x2abb('0x3c')]({},_0x3c01ab,_0x1c481b[_0x2abb('0x3e')]);var _0x534b31={'where':_0x3c01ab[_0x2abb('0x3b')]};return db['ZohoAccount'][_0x2abb('0x20')](_0x534b31)[_0x2abb('0x3f')](function(_0x11f65a){_0x143acc[_0x2abb('0x20')]=_0x11f65a;if(_0x1c481b[_0x2abb('0x30')][_0x2abb('0x40')]){_0x3c01ab[_0x2abb('0x41')]=[{'all':!![]}];}return db[_0x2abb('0x2a')][_0x2abb('0x42')](_0x3c01ab);})[_0x2abb('0x3f')](function(_0x463f78){_0x143acc[_0x2abb('0x43')]=_0x463f78;return _0x143acc;})[_0x2abb('0x3f')](respondWithFilteredResult(_0x2751c8,_0x3c01ab))['catch'](handleError(_0x2751c8,null));};exports['show']=function(_0x3c40c5,_0x23ad1a){var _0x11c3e3={'raw':![],'where':{'id':_0x3c40c5['params']['id']}},_0x36a695={};_0x36a695[_0x2abb('0x2f')]=_['keys'](db[_0x2abb('0x2a')][_0x2abb('0x2b')]);_0x36a695[_0x2abb('0x30')]=_['keys'](_0x3c40c5[_0x2abb('0x30')]);_0x36a695[_0x2abb('0x32')]=_[_0x2abb('0x33')](_0x36a695['model'],_0x36a695[_0x2abb('0x30')]);_0x11c3e3[_0x2abb('0x34')]=_[_0x2abb('0x33')](_0x36a695[_0x2abb('0x2f')],qs['fields'](_0x3c40c5[_0x2abb('0x30')][_0x2abb('0x35')]));_0x11c3e3['attributes']=_0x11c3e3[_0x2abb('0x34')][_0x2abb('0x44')]?_0x11c3e3[_0x2abb('0x34')]:_0x36a695['model'];if(_0x3c40c5[_0x2abb('0x30')][_0x2abb('0x40')]){_0x11c3e3[_0x2abb('0x41')]=[{'all':!![]}];}_0x11c3e3=_[_0x2abb('0x3c')]({},_0x11c3e3,_0x3c40c5[_0x2abb('0x3e')]);return db['ZohoAccount']['find'](_0x11c3e3)['then'](handleEntityNotFound(_0x23ad1a,null))['then'](respondWithResult(_0x23ad1a,null))[_0x2abb('0x45')](handleError(_0x23ad1a,null));};exports[_0x2abb('0x46')]=function(_0x505fad,_0x5386da){return db[_0x2abb('0x2a')][_0x2abb('0x46')](_0x505fad[_0x2abb('0x47')],{})['then'](respondWithResult(_0x5386da,0xc9))['catch'](handleError(_0x5386da,null));};exports[_0x2abb('0x24')]=function(_0x1bceaf,_0x50a6d0){if(_0x1bceaf[_0x2abb('0x47')]['id']){delete _0x1bceaf[_0x2abb('0x47')]['id'];}return db['ZohoAccount'][_0x2abb('0x48')]({'where':{'id':_0x1bceaf[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0x50a6d0,null))['then'](saveUpdates(_0x1bceaf[_0x2abb('0x47')],null))[_0x2abb('0x3f')](respondWithResult(_0x50a6d0,null))[_0x2abb('0x45')](handleError(_0x50a6d0,null));};exports['destroy']=function(_0xf5cb21,_0x32b416){return db[_0x2abb('0x2a')][_0x2abb('0x48')]({'where':{'id':_0xf5cb21[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0x32b416,null))[_0x2abb('0x3f')](removeEntity(_0x32b416,null))[_0x2abb('0x45')](handleError(_0x32b416,null));};exports[_0x2abb('0x4a')]=function(_0x1213cb,_0xa64e9a,_0x12470a){var _0x93b118={};var _0x2ca629={};var _0xb0ba6b;var _0x1957b8;return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x1213cb[_0x2abb('0x49')]['id']}})[_0x2abb('0x3f')](handleEntityNotFound(_0xa64e9a,null))['then'](function(_0x5604e4){if(_0x5604e4){_0xb0ba6b=_0x5604e4;_0x2ca629[_0x2abb('0x2f')]=_['keys'](db[_0x2abb('0x4c')]['rawAttributes']);_0x2ca629[_0x2abb('0x30')]=_[_0x2abb('0x31')](_0x1213cb[_0x2abb('0x30')]);_0x2ca629['filters']=_[_0x2abb('0x33')](_0x2ca629[_0x2abb('0x2f')],_0x2ca629[_0x2abb('0x30')]);_0x93b118[_0x2abb('0x34')]=_[_0x2abb('0x33')](_0x2ca629['model'],qs[_0x2abb('0x35')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x35')]));_0x93b118[_0x2abb('0x34')]=_0x93b118[_0x2abb('0x34')][_0x2abb('0x44')]?_0x93b118['attributes']:_0x2ca629[_0x2abb('0x2f')];_0x93b118[_0x2abb('0x4d')]=qs[_0x2abb('0x38')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x38')]);_0x93b118[_0x2abb('0x3b')]=qs[_0x2abb('0x32')](_[_0x2abb('0x39')](_0x1213cb['query'],_0x2ca629[_0x2abb('0x32')]));if(_0x1213cb[_0x2abb('0x30')]['filter']){_0x93b118[_0x2abb('0x3b')]=_['merge'](_0x93b118[_0x2abb('0x3b')],{'$or':_[_0x2abb('0x29')](_0x93b118[_0x2abb('0x34')],function(_0x382dcd){var _0x18bda0={};_0x18bda0[_0x382dcd]={'$like':'%'+_0x1213cb[_0x2abb('0x30')]['filter']+'%'};return _0x18bda0;})});}_0x93b118=_['merge']({},_0x93b118,_0x1213cb[_0x2abb('0x3e')]);return _0xb0ba6b[_0x2abb('0x4a')](_0x93b118);}})['then'](function(_0x781b88){if(_0x781b88){_0x1957b8=_0x781b88[_0x2abb('0x44')];if(!_0x1213cb[_0x2abb('0x30')]['hasOwnProperty'](_0x2abb('0x37'))){_0x93b118[_0x2abb('0x1f')]=qs['limit'](_0x1213cb['query'][_0x2abb('0x1f')]);_0x93b118[_0x2abb('0x1d')]=qs[_0x2abb('0x1d')](_0x1213cb[_0x2abb('0x30')][_0x2abb('0x1d')]);}return _0xb0ba6b[_0x2abb('0x4a')](_0x93b118);}})['then'](function(_0x47c23f){if(_0x47c23f){return _0x47c23f?{'count':_0x1957b8,'rows':_0x47c23f}:null;}})[_0x2abb('0x3f')](respondWithResult(_0xa64e9a,null))[_0x2abb('0x45')](handleError(_0xa64e9a,null));};exports['addConfiguration']=function(_0x2285b3,_0x3c5382,_0x5f383f){if(_0x2285b3[_0x2abb('0x47')]['id']){delete _0x2285b3[_0x2abb('0x47')]['id'];}return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x2285b3[_0x2abb('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c5382,null))[_0x2abb('0x3f')](function(_0x4c4de5){if(_0x4c4de5){_0x2285b3[_0x2abb('0x47')][_0x2abb('0x4e')]=_0x4c4de5['id'];_0x2285b3['body'][_0x2abb('0x4f')]=integrations[_0x2abb('0x50')](_0x2285b3[_0x2abb('0x47')][_0x2abb('0x51')],_0x2285b3['body'][_0x2abb('0x2d')]);_0x2285b3[_0x2abb('0x47')][_0x2abb('0x52')]=integrations[_0x2abb('0x53')](_0x2285b3[_0x2abb('0x47')][_0x2abb('0x51')],_0x2285b3[_0x2abb('0x47')]['type']);return db[_0x2abb('0x4c')][_0x2abb('0x46')](_0x2285b3[_0x2abb('0x47')],{'include':[{'model':db['ZohoField'],'as':_0x2abb('0x4f')},{'model':db[_0x2abb('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x3c5382,null))[_0x2abb('0x45')](handleError(_0x3c5382,null));};function getAccessToken(_0x3d1502){return new Promise(function(_0x321b80,_0x1c9166){var _0x34887b;switch(_0x3d1502[_0x2abb('0x55')]){case'US':_0x34887b=_0x2abb('0x56');break;case'AU':_0x34887b='https://accounts.zoho.com.au';break;case'EU':_0x34887b=_0x2abb('0x57');break;case'IN':_0x34887b=_0x2abb('0x58');break;case'CN':_0x34887b=_0x2abb('0x59');break;default:_0x34887b=_0x2abb('0x57');break;}var _0x760374={'method':_0x2abb('0x5a'),'uri':_0x34887b+_0x2abb('0x5b'),'qs':{'refresh_token':_0x3d1502[_0x2abb('0x5c')],'client_id':_0x3d1502['clientId'],'client_secret':_0x3d1502[_0x2abb('0x5d')],'grant_type':_0x2abb('0x5e')},'json':!![]};return rp(_0x760374)[_0x2abb('0x3f')](function(_0x389a54){if(_0x389a54[_0x2abb('0x5f')]){_0x321b80(_0x389a54[_0x2abb('0x5f')]);}else{_0x1c9166(_0x2abb('0x60'));}})['catch'](function(_0x60fbb5){_0x1c9166(_0x60fbb5);});});}exports[_0x2abb('0x61')]=function(_0x44bda7,_0x50e6bb,_0x2a3ae9){var _0x505daa,_0x1d38ad,_0x55cad4,_0x2c8f9c,_0x8bd99d;return db[_0x2abb('0x2a')][_0x2abb('0x4b')]({'where':{'id':_0x44bda7[_0x2abb('0x49')]['id']},'attributes':['id',_0x2abb('0x62'),'zone',_0x2abb('0x63'),_0x2abb('0x5d'),_0x2abb('0x64'),_0x2abb('0x65'),_0x2abb('0x5c')]})['then'](handleEntityNotFound(_0x50e6bb,null))[_0x2abb('0x3f')](function(_0x502a06){_0x8bd99d=_0x502a06;_0x505daa=_0x8bd99d[_0x2abb('0x62')];_0x1d38ad=_0x505daa===_0x2abb('0x66')?'eu':_0x2abb('0x67');_0x55cad4=_0x8bd99d[_0x2abb('0x64')];var _0x49db1e=_0x55cad4['slice'](-0x1);if(_0x49db1e==='/'||_0x49db1e==='\x5c'||_0x49db1e===':'){_0x55cad4=_0x55cad4['substring'](0x0,_0x55cad4['lastIndexOf'](_0x49db1e));}if(!_0x8bd99d[_0x2abb('0x5c')]){throw new Error(_0x2abb('0x68'));}return getAccessToken(_0x8bd99d);})[_0x2abb('0x3f')](function(_0x28d017){if(_0x28d017){return rp({'method':_0x2abb('0x69'),'uri':util[_0x2abb('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1d38ad),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2abb('0x6b')+_0x28d017},'json':!![]});}})[_0x2abb('0x3f')](function(_0x4ec3ff){if(_0x4ec3ff){if(_0x4ec3ff[_0x2abb('0x6c')]&&_0x4ec3ff[_0x2abb('0x6c')][_0x2abb('0x25')]){throw new Error(_0x4ec3ff['response'][_0x2abb('0x25')][_0x2abb('0x6d')]);}var _0x5b80f4=[];var _0x4850fc=[];var _0x2eae8d=[_0x2abb('0x6e'),_0x2abb('0x6f'),_0x2abb('0x70'),'WhoId',_0x2abb('0x71'),_0x2abb('0x72'),_0x2abb('0x73'),_0x2abb('0x74')];_0x4850fc=_[_0x2abb('0x75')](_0x4ec3ff[_0x2abb('0x35')],function(_0x180997){return _0x2eae8d[_0x2abb('0x76')](_0x180997[_0x2abb('0x77')]);});for(var _0x3cc742=0x0;_0x3cc742<_0x4850fc['length'];_0x3cc742++){if(_0x4850fc[_0x3cc742]['system_mandatory']===![]){_0x5b80f4[_0x2abb('0x78')]({'id':_0x4850fc[_0x3cc742]['id'],'name':_0x4850fc[_0x3cc742]['display_label'],'custom':_0x4850fc[_0x3cc742][_0x2abb('0x79')],'options':_0x4850fc[_0x3cc742]['data_type']===_0x2abb('0x7a')&&_0x4850fc[_0x3cc742][_0x2abb('0x7b')][_0x2abb('0x44')]>-0x1?_[_0x2abb('0x29')](_0x4850fc[_0x3cc742][_0x2abb('0x7b')],function(_0x550032){return{'name':_0x550032,'value':_0x550032};}):[]});}}return{'count':_0x5b80f4[_0x2abb('0x44')],'rows':_0x5b80f4};}else{return{'count':0x0,'rows':[]};}})[_0x2abb('0x3f')](respondWithResult(_0x50e6bb,null))[_0x2abb('0x45')](function(_0x1e1119){var _0x366f04=_0x44bda7['query']['test']?0x1f4:_0x1e1119[_0x2abb('0x7c')]||0x1f4;logger['error'](_0x2abb('0x7d'),'getFields',_0x366f04,JSON[_0x2abb('0x7e')](_0x1e1119));delete _0x1e1119[_0x2abb('0x27')];if(_0x366f04===0x191){_0x366f04=0x190;}_0x50e6bb[_0x2abb('0x1b')](_0x366f04)[_0x2abb('0x28')](_0x44bda7[_0x2abb('0x30')][_0x2abb('0x7f')]?{'message':_0x2abb('0x80'),'statusCode':_0x1e1119[_0x2abb('0x7c')]}:_0x1e1119);});};
\ No newline at end of file
+var _0xe584=['reject','save','update','destroy','then','sendStatus','error','stack','name','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','body','findOne','ZohoConfiguration','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','code','zoho.eu','substring','lastIndexOf','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Call_Duration','Call_Type','includes','api_name','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply'];(function(_0x5cfdec,_0x2aac5b){var _0x5670f9=function(_0x481958){while(--_0x481958){_0x5cfdec['push'](_0x5cfdec['shift']());}};_0x5670f9(++_0x2aac5b);}(_0xe584,0x1db));var _0x4e58=function(_0x45862f,_0xf5f0a6){_0x45862f=_0x45862f-0x0;var _0x35b20b=_0xe584[_0x45862f];return _0x35b20b;};'use strict';var emlformat=require(_0x4e58('0x0'));var rimraf=require(_0x4e58('0x1'));var zipdir=require(_0x4e58('0x2'));var jsonpatch=require(_0x4e58('0x3'));var rp=require(_0x4e58('0x4'));var moment=require(_0x4e58('0x5'));var BPromise=require(_0x4e58('0x6'));var Mustache=require(_0x4e58('0x7'));var util=require('util');var path=require(_0x4e58('0x8'));var sox=require(_0x4e58('0x9'));var csv=require(_0x4e58('0xa'));var ejs=require(_0x4e58('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e58('0xc'));var crypto=require(_0x4e58('0xd'));var jsforce=require(_0x4e58('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4e58('0xa'));var querystring=require(_0x4e58('0xf'));var Papa=require(_0x4e58('0x10'));var Redis=require(_0x4e58('0x11'));var authService=require(_0x4e58('0x12'));var qs=require(_0x4e58('0x13'));var as=require(_0x4e58('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4e58('0x15'));var licenseUtil=require(_0x4e58('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4e58('0x17'));function respondWithStatusCode(_0x263f38,_0x4db2aa){_0x4db2aa=_0x4db2aa||0xcc;return function(_0x32e246){if(_0x32e246){return _0x263f38['sendStatus'](_0x4db2aa);}return _0x263f38[_0x4e58('0x18')](_0x4db2aa)[_0x4e58('0x19')]();};}function respondWithResult(_0x26da1a,_0x525eb6){_0x525eb6=_0x525eb6||0xc8;return function(_0x4d514d){if(_0x4d514d){return _0x26da1a[_0x4e58('0x18')](_0x525eb6)[_0x4e58('0x1a')](_0x4d514d);}};}function respondWithFilteredResult(_0xaef9e,_0x52563c){return function(_0x50482c){if(_0x50482c){var _0x2f8e03=typeof _0x52563c[_0x4e58('0x1b')]===_0x4e58('0x1c')&&typeof _0x52563c[_0x4e58('0x1d')]===_0x4e58('0x1c');var _0x3fdc36=_0x50482c[_0x4e58('0x1e')];var _0x3beda0=_0x2f8e03?0x0:_0x52563c['offset'];var _0xf313a8=_0x2f8e03?_0x50482c[_0x4e58('0x1e')]:_0x52563c[_0x4e58('0x1b')]+_0x52563c['limit'];var _0x44c703;if(_0xf313a8>=_0x3fdc36){_0xf313a8=_0x3fdc36;_0x44c703=0xc8;}else{_0x44c703=0xce;}_0xaef9e[_0x4e58('0x18')](_0x44c703);return _0xaef9e[_0x4e58('0x1f')]('Content-Range',_0x3beda0+'-'+_0xf313a8+'/'+_0x3fdc36)[_0x4e58('0x1a')](_0x50482c);}return null;};}function patchUpdates(_0x5bb4c4){return function(_0x39ce27){try{jsonpatch[_0x4e58('0x20')](_0x39ce27,_0x5bb4c4,!![]);}catch(_0x2b75bc){return BPromise[_0x4e58('0x21')](_0x2b75bc);}return _0x39ce27[_0x4e58('0x22')]();};}function saveUpdates(_0x2b7bbf,_0x28f3d5){return function(_0x34b326){if(_0x34b326){return _0x34b326[_0x4e58('0x23')](_0x2b7bbf)['then'](function(_0xd3b6c8){return _0xd3b6c8;});}return null;};}function removeEntity(_0x46e91d,_0x3c9b47){return function(_0x13ca4a){if(_0x13ca4a){return _0x13ca4a[_0x4e58('0x24')]()[_0x4e58('0x25')](function(){_0x46e91d[_0x4e58('0x18')](0xcc)[_0x4e58('0x19')]();});}};}function handleEntityNotFound(_0xad5f30,_0x37165b){return function(_0x3231f3){if(!_0x3231f3){_0xad5f30[_0x4e58('0x26')](0x194);}return _0x3231f3;};}function handleError(_0x14bea6,_0x18c4ac){_0x18c4ac=_0x18c4ac||0x1f4;return function(_0x414981){logger[_0x4e58('0x27')](_0x414981[_0x4e58('0x28')]);if(_0x414981[_0x4e58('0x29')]){delete _0x414981[_0x4e58('0x29')];}_0x14bea6[_0x4e58('0x18')](_0x18c4ac)['send'](_0x414981);};}exports['index']=function(_0x49541c,_0x4a4e09){var _0x59bf2c={},_0xd0cfb={},_0x2ffd9e={'count':0x0,'rows':[]};var _0x7dbb07=_[_0x4e58('0x2a')](db[_0x4e58('0x2b')][_0x4e58('0x2c')],function(_0x39d952){return{'name':_0x39d952[_0x4e58('0x2d')],'type':_0x39d952['type'][_0x4e58('0x2e')]};});_0xd0cfb[_0x4e58('0x2f')]=_[_0x4e58('0x2a')](_0x7dbb07,'name');_0xd0cfb[_0x4e58('0x30')]=_[_0x4e58('0x31')](_0x49541c[_0x4e58('0x30')]);_0xd0cfb[_0x4e58('0x32')]=_[_0x4e58('0x33')](_0xd0cfb[_0x4e58('0x2f')],_0xd0cfb['query']);_0x59bf2c[_0x4e58('0x34')]=_[_0x4e58('0x33')](_0xd0cfb[_0x4e58('0x2f')],qs[_0x4e58('0x35')](_0x49541c['query'][_0x4e58('0x35')]));_0x59bf2c[_0x4e58('0x34')]=_0x59bf2c[_0x4e58('0x34')]['length']?_0x59bf2c[_0x4e58('0x34')]:_0xd0cfb[_0x4e58('0x2f')];if(!_0x49541c[_0x4e58('0x30')][_0x4e58('0x36')](_0x4e58('0x37'))){_0x59bf2c[_0x4e58('0x1d')]=qs[_0x4e58('0x1d')](_0x49541c[_0x4e58('0x30')][_0x4e58('0x1d')]);_0x59bf2c['offset']=qs['offset'](_0x49541c[_0x4e58('0x30')]['offset']);}_0x59bf2c[_0x4e58('0x38')]=qs[_0x4e58('0x39')](_0x49541c[_0x4e58('0x30')][_0x4e58('0x39')]);_0x59bf2c[_0x4e58('0x3a')]=qs[_0x4e58('0x32')](_['pick'](_0x49541c['query'],_0xd0cfb['filters']),_0x7dbb07);if(_0x49541c['query'][_0x4e58('0x3b')]){_0x59bf2c[_0x4e58('0x3a')]=_[_0x4e58('0x3c')](_0x59bf2c[_0x4e58('0x3a')],{'$or':_['map'](_0x7dbb07,function(_0x3658a3){if(_0x3658a3[_0x4e58('0x3d')]!==_0x4e58('0x3e')){var _0x407e36={};_0x407e36[_0x3658a3[_0x4e58('0x29')]]={'$like':'%'+_0x49541c[_0x4e58('0x30')][_0x4e58('0x3b')]+'%'};return _0x407e36;}})});}_0x59bf2c=_[_0x4e58('0x3c')]({},_0x59bf2c,_0x49541c[_0x4e58('0x3f')]);var _0x287dc8={'where':_0x59bf2c[_0x4e58('0x3a')]};return db[_0x4e58('0x2b')][_0x4e58('0x1e')](_0x287dc8)['then'](function(_0x42620b){_0x2ffd9e[_0x4e58('0x1e')]=_0x42620b;if(_0x49541c[_0x4e58('0x30')][_0x4e58('0x40')]){_0x59bf2c[_0x4e58('0x41')]=[{'all':!![]}];}return db[_0x4e58('0x2b')][_0x4e58('0x42')](_0x59bf2c);})[_0x4e58('0x25')](function(_0x2396af){_0x2ffd9e[_0x4e58('0x43')]=_0x2396af;return _0x2ffd9e;})['then'](respondWithFilteredResult(_0x4a4e09,_0x59bf2c))[_0x4e58('0x44')](handleError(_0x4a4e09,null));};exports[_0x4e58('0x45')]=function(_0x50c88b,_0x1d5c16){var _0x45987f={'raw':![],'where':{'id':_0x50c88b[_0x4e58('0x46')]['id']}},_0x2afcc1={};_0x2afcc1['model']=_[_0x4e58('0x31')](db[_0x4e58('0x2b')]['rawAttributes']);_0x2afcc1[_0x4e58('0x30')]=_['keys'](_0x50c88b[_0x4e58('0x30')]);_0x2afcc1[_0x4e58('0x32')]=_['intersection'](_0x2afcc1[_0x4e58('0x2f')],_0x2afcc1['query']);_0x45987f[_0x4e58('0x34')]=_[_0x4e58('0x33')](_0x2afcc1['model'],qs[_0x4e58('0x35')](_0x50c88b[_0x4e58('0x30')][_0x4e58('0x35')]));_0x45987f[_0x4e58('0x34')]=_0x45987f['attributes'][_0x4e58('0x47')]?_0x45987f['attributes']:_0x2afcc1[_0x4e58('0x2f')];if(_0x50c88b[_0x4e58('0x30')][_0x4e58('0x40')]){_0x45987f[_0x4e58('0x41')]=[{'all':!![]}];}_0x45987f=_[_0x4e58('0x3c')]({},_0x45987f,_0x50c88b[_0x4e58('0x3f')]);return db[_0x4e58('0x2b')][_0x4e58('0x48')](_0x45987f)['then'](handleEntityNotFound(_0x1d5c16,null))[_0x4e58('0x25')](respondWithResult(_0x1d5c16,null))[_0x4e58('0x44')](handleError(_0x1d5c16,null));};exports['create']=function(_0x599a4c,_0x4b6b9a){return db[_0x4e58('0x2b')]['create'](_0x599a4c[_0x4e58('0x49')],{})['then'](respondWithResult(_0x4b6b9a,0xc9))[_0x4e58('0x44')](handleError(_0x4b6b9a,null));};exports[_0x4e58('0x23')]=function(_0x51f0bd,_0x1ea86d){if(_0x51f0bd[_0x4e58('0x49')]['id']){delete _0x51f0bd[_0x4e58('0x49')]['id'];}return db['ZohoAccount'][_0x4e58('0x48')]({'where':{'id':_0x51f0bd[_0x4e58('0x46')]['id']}})['then'](handleEntityNotFound(_0x1ea86d,null))[_0x4e58('0x25')](saveUpdates(_0x51f0bd['body'],null))[_0x4e58('0x25')](respondWithResult(_0x1ea86d,null))[_0x4e58('0x44')](handleError(_0x1ea86d,null));};exports[_0x4e58('0x24')]=function(_0x57bd96,_0x54317c){return db['ZohoAccount']['find']({'where':{'id':_0x57bd96[_0x4e58('0x46')]['id']}})['then'](handleEntityNotFound(_0x54317c,null))['then'](removeEntity(_0x54317c,null))[_0x4e58('0x44')](handleError(_0x54317c,null));};exports['getConfigurations']=function(_0x16d31b,_0x42bce3,_0x1a6de3){var _0x3141ae={};var _0x39ba70={};var _0x461c8f;var _0x5338d0;return db['ZohoAccount'][_0x4e58('0x4a')]({'where':{'id':_0x16d31b[_0x4e58('0x46')]['id']}})[_0x4e58('0x25')](handleEntityNotFound(_0x42bce3,null))['then'](function(_0x1dc64d){if(_0x1dc64d){_0x461c8f=_0x1dc64d;_0x39ba70[_0x4e58('0x2f')]=_[_0x4e58('0x31')](db[_0x4e58('0x4b')][_0x4e58('0x2c')]);_0x39ba70['query']=_['keys'](_0x16d31b[_0x4e58('0x30')]);_0x39ba70[_0x4e58('0x32')]=_['intersection'](_0x39ba70[_0x4e58('0x2f')],_0x39ba70[_0x4e58('0x30')]);_0x3141ae[_0x4e58('0x34')]=_['intersection'](_0x39ba70[_0x4e58('0x2f')],qs[_0x4e58('0x35')](_0x16d31b[_0x4e58('0x30')][_0x4e58('0x35')]));_0x3141ae[_0x4e58('0x34')]=_0x3141ae[_0x4e58('0x34')][_0x4e58('0x47')]?_0x3141ae[_0x4e58('0x34')]:_0x39ba70[_0x4e58('0x2f')];_0x3141ae[_0x4e58('0x38')]=qs[_0x4e58('0x39')](_0x16d31b['query'][_0x4e58('0x39')]);_0x3141ae[_0x4e58('0x3a')]=qs[_0x4e58('0x32')](_[_0x4e58('0x4c')](_0x16d31b[_0x4e58('0x30')],_0x39ba70[_0x4e58('0x32')]));if(_0x16d31b['query'][_0x4e58('0x3b')]){_0x3141ae[_0x4e58('0x3a')]=_['merge'](_0x3141ae[_0x4e58('0x3a')],{'$or':_[_0x4e58('0x2a')](_0x3141ae[_0x4e58('0x34')],function(_0x32db56){var _0x4aa781={};_0x4aa781[_0x32db56]={'$like':'%'+_0x16d31b[_0x4e58('0x30')][_0x4e58('0x3b')]+'%'};return _0x4aa781;})});}_0x3141ae=_[_0x4e58('0x3c')]({},_0x3141ae,_0x16d31b[_0x4e58('0x3f')]);return _0x461c8f[_0x4e58('0x4d')](_0x3141ae);}})[_0x4e58('0x25')](function(_0x1c2cac){if(_0x1c2cac){_0x5338d0=_0x1c2cac[_0x4e58('0x47')];if(!_0x16d31b[_0x4e58('0x30')]['hasOwnProperty'](_0x4e58('0x37'))){_0x3141ae[_0x4e58('0x1d')]=qs[_0x4e58('0x1d')](_0x16d31b[_0x4e58('0x30')][_0x4e58('0x1d')]);_0x3141ae[_0x4e58('0x1b')]=qs['offset'](_0x16d31b[_0x4e58('0x30')][_0x4e58('0x1b')]);}return _0x461c8f[_0x4e58('0x4d')](_0x3141ae);}})[_0x4e58('0x25')](function(_0x2131df){if(_0x2131df){return _0x2131df?{'count':_0x5338d0,'rows':_0x2131df}:null;}})[_0x4e58('0x25')](respondWithResult(_0x42bce3,null))['catch'](handleError(_0x42bce3,null));};exports['addConfiguration']=function(_0x3476f2,_0x925ed1,_0x4e5742){if(_0x3476f2[_0x4e58('0x49')]['id']){delete _0x3476f2['body']['id'];}return db[_0x4e58('0x2b')][_0x4e58('0x4a')]({'where':{'id':_0x3476f2[_0x4e58('0x46')]['id']}})[_0x4e58('0x25')](handleEntityNotFound(_0x925ed1,null))[_0x4e58('0x25')](function(_0x15ad7a){if(_0x15ad7a){_0x3476f2[_0x4e58('0x49')][_0x4e58('0x4e')]=_0x15ad7a['id'];_0x3476f2[_0x4e58('0x49')][_0x4e58('0x4f')]=integrations[_0x4e58('0x50')](_0x3476f2[_0x4e58('0x49')][_0x4e58('0x51')],_0x3476f2[_0x4e58('0x49')][_0x4e58('0x3d')]);_0x3476f2[_0x4e58('0x49')][_0x4e58('0x52')]=integrations['getDescriptions'](_0x3476f2[_0x4e58('0x49')][_0x4e58('0x51')],_0x3476f2[_0x4e58('0x49')][_0x4e58('0x3d')]);return db[_0x4e58('0x4b')]['create'](_0x3476f2['body'],{'include':[{'model':db[_0x4e58('0x53')],'as':_0x4e58('0x4f')},{'model':db[_0x4e58('0x53')],'as':_0x4e58('0x52')}]});}return null;})['then'](respondWithResult(_0x925ed1,null))['catch'](handleError(_0x925ed1,null));};function getAccessToken(_0x56726d){return new Promise(function(_0x23d827,_0xc7d59c){var _0x29ca4f;switch(_0x56726d[_0x4e58('0x54')]){case'US':_0x29ca4f=_0x4e58('0x55');break;case'AU':_0x29ca4f=_0x4e58('0x56');break;case'EU':_0x29ca4f=_0x4e58('0x57');break;case'IN':_0x29ca4f=_0x4e58('0x58');break;case'CN':_0x29ca4f='https://accounts.zoho.com.cn';break;default:_0x29ca4f='https://accounts.zoho.eu';break;}var _0x124676={'method':_0x4e58('0x59'),'uri':_0x29ca4f+_0x4e58('0x5a'),'qs':{'refresh_token':_0x56726d['refreshToken'],'client_id':_0x56726d[_0x4e58('0x5b')],'client_secret':_0x56726d[_0x4e58('0x5c')],'grant_type':_0x4e58('0x5d')},'json':!![]};return rp(_0x124676)[_0x4e58('0x25')](function(_0x364c33){if(_0x364c33[_0x4e58('0x5e')]){_0x23d827(_0x364c33[_0x4e58('0x5e')]);}else{_0xc7d59c(_0x4e58('0x5f'));}})['catch'](function(_0x557b8b){_0xc7d59c(_0x557b8b);});});}exports[_0x4e58('0x60')]=function(_0x5026c1,_0x284c91,_0x4fee3b){var _0x40b88c,_0x2fe5d5,_0x309ab4,_0x267551,_0x390929;return db[_0x4e58('0x2b')][_0x4e58('0x4a')]({'where':{'id':_0x5026c1['params']['id']},'attributes':['id','host',_0x4e58('0x54'),'clientId',_0x4e58('0x5c'),_0x4e58('0x61'),_0x4e58('0x62'),'refreshToken']})[_0x4e58('0x25')](handleEntityNotFound(_0x284c91,null))[_0x4e58('0x25')](function(_0x40b338){_0x390929=_0x40b338;_0x40b88c=_0x390929['host'];_0x2fe5d5=_0x40b88c===_0x4e58('0x63')?'eu':'com';_0x309ab4=_0x390929[_0x4e58('0x61')];var _0xe5061e=_0x309ab4['slice'](-0x1);if(_0xe5061e==='/'||_0xe5061e==='\x5c'||_0xe5061e===':'){_0x309ab4=_0x309ab4[_0x4e58('0x64')](0x0,_0x309ab4[_0x4e58('0x65')](_0xe5061e));}if(!_0x390929[_0x4e58('0x66')]){throw new Error(_0x4e58('0x67'));}return getAccessToken(_0x390929);})[_0x4e58('0x25')](function(_0x5c063b){if(_0x5c063b){return rp({'method':_0x4e58('0x68'),'uri':util[_0x4e58('0x69')](_0x4e58('0x6a'),_0x2fe5d5),'qs':{'module':_0x4e58('0x6b')},'headers':{'Authorization':_0x4e58('0x6c')+_0x5c063b},'json':!![]});}})[_0x4e58('0x25')](function(_0x3de8a9){if(_0x3de8a9){if(_0x3de8a9[_0x4e58('0x6d')]&&_0x3de8a9['response'][_0x4e58('0x27')]){throw new Error(_0x3de8a9[_0x4e58('0x6d')][_0x4e58('0x27')]['message']);}var _0x12f2e6=[];var _0x426109=[];var _0x1e747c=[_0x4e58('0x6e'),_0x4e58('0x6f'),'Description','WhoId',_0x4e58('0x70'),'Call_Result','Call_Start_Time',_0x4e58('0x71')];_0x426109=_['remove'](_0x3de8a9[_0x4e58('0x35')],function(_0x4fefee){return _0x1e747c[_0x4e58('0x72')](_0x4fefee[_0x4e58('0x73')]);});for(var _0x4c8cea=0x0;_0x4c8cea<_0x426109[_0x4e58('0x47')];_0x4c8cea++){if(_0x426109[_0x4c8cea]['system_mandatory']===![]){_0x12f2e6[_0x4e58('0x74')]({'id':_0x426109[_0x4c8cea]['id'],'name':_0x426109[_0x4c8cea][_0x4e58('0x75')],'custom':_0x426109[_0x4c8cea][_0x4e58('0x76')],'options':_0x426109[_0x4c8cea][_0x4e58('0x77')]===_0x4e58('0x78')&&_0x426109[_0x4c8cea][_0x4e58('0x79')]['length']>-0x1?_[_0x4e58('0x2a')](_0x426109[_0x4c8cea][_0x4e58('0x79')],function(_0x25fd58){return{'name':_0x25fd58,'value':_0x25fd58};}):[]});}}return{'count':_0x12f2e6[_0x4e58('0x47')],'rows':_0x12f2e6};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x284c91,null))['catch'](function(_0x3bac46){var _0x1a0c9f=_0x5026c1['query'][_0x4e58('0x7a')]?0x1f4:_0x3bac46[_0x4e58('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1a0c9f,JSON[_0x4e58('0x7c')](_0x3bac46));delete _0x3bac46[_0x4e58('0x29')];if(_0x1a0c9f===0x191){_0x1a0c9f=0x190;}_0x284c91[_0x4e58('0x18')](_0x1a0c9f)[_0x4e58('0x7d')](_0x5026c1['query'][_0x4e58('0x7a')]?{'message':_0x4e58('0x7e'),'statusCode':_0x3bac46[_0x4e58('0x7b')]}:_0x3bac46);});};
\ No newline at end of file
index f76ff6e..4e53458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5e8=['changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','parse','refresh_token','refreshToken','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','POST','authorization_code','then','info','catch','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0xf5e8[_0x2b55b5];return _0x103d28;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f5e('0x5'));var fs=require('fs');var path=require(_0x8f5e('0x6'));var rimraf=require('rimraf');var config=require(_0x8f5e('0x7'));var attributes=require(_0x8f5e('0x8'));var integrations=require(_0x8f5e('0x9'));module[_0x8f5e('0xa')]=function(_0x48ed61,_0x49a02f){return _0x48ed61[_0x8f5e('0xb')](_0x8f5e('0xc'),attributes,{'tableName':_0x8f5e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e9aaa,_0x131cfe,_0x444281){if(_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0xf'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x10'))||_0x5e9aaa['changed'](_0x8f5e('0x11'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x12'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x13'))||_0x5e9aaa[_0x8f5e('0xe')](_0x8f5e('0x14'))){var _0x44b8fe,_0x516c04;_0x44b8fe=_0x5e9aaa[_0x8f5e('0x10')];var _0x3d0c37=_0x44b8fe[_0x8f5e('0x15')](-0x1);if(_0x3d0c37==='/'||_0x3d0c37==='\x5c'||_0x3d0c37===':'){_0x44b8fe=_0x44b8fe[_0x8f5e('0x16')](0x0,_0x44b8fe[_0x8f5e('0x17')](_0x3d0c37));}switch(_0x5e9aaa['zone']){case'US':_0x516c04=_0x8f5e('0x18');break;case'AU':_0x516c04=_0x8f5e('0x19');break;case'IN':_0x516c04=_0x8f5e('0x1a');break;case'CN':_0x516c04=_0x8f5e('0x1b');break;default:_0x516c04=_0x8f5e('0x1c');break;}var _0x40dae1={'method':'POST','uri':_0x516c04+_0x8f5e('0x1d'),'form':{'grant_type':'authorization_code','client_id':_0x5e9aaa[_0x8f5e('0x11')],'client_secret':_0x5e9aaa[_0x8f5e('0x12')],'redirect_uri':_0x5e9aaa[_0x8f5e('0x10')],'code':_0x5e9aaa[_0x8f5e('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x40dae1)['then'](function(_0x1c117c){var _0x2625b4=JSON[_0x8f5e('0x1e')](_0x1c117c);if(_0x2625b4[_0x8f5e('0x1f')]){_0x5e9aaa[_0x8f5e('0x20')]=_0x2625b4[_0x8f5e('0x1f')];logger['info'](util[_0x8f5e('0x21')](_0x8f5e('0x22'),_0x5e9aaa[_0x8f5e('0x23')],_0x5e9aaa['id']));}else{logger['error'](util['format'](_0x8f5e('0x24'),_0x5e9aaa['name'],_0x5e9aaa['id']),util[_0x8f5e('0x25')](_0x2625b4,{'showHidden':![],'depth':null}));}return _0x444281(null,_0x131cfe);})['catch'](function(_0x1488f0){logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x5e9aaa[_0x8f5e('0x23')],_0x5e9aaa['id']),util[_0x8f5e('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x444281(_0x1488f0);});}else{return _0x444281(null,_0x131cfe);}},'beforeUpdate':function(_0x3e5347,_0x1a7649,_0x1ee875){if(_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0xf'))||_0x3e5347[_0x8f5e('0xe')]('serverUrl')||_0x3e5347['changed']('clientId')||_0x3e5347['changed']('clientSecret')||_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0x13'))||_0x3e5347[_0x8f5e('0xe')](_0x8f5e('0x14'))){var _0x3f7a06,_0x183360;_0x3f7a06=_0x3e5347[_0x8f5e('0x10')];var _0x326feb=_0x3f7a06['slice'](-0x1);if(_0x326feb==='/'||_0x326feb==='\x5c'||_0x326feb===':'){_0x3f7a06=_0x3f7a06[_0x8f5e('0x16')](0x0,_0x3f7a06['lastIndexOf'](_0x326feb));}switch(_0x3e5347[_0x8f5e('0xf')]){case'US':_0x183360=_0x8f5e('0x18');break;case'AU':_0x183360=_0x8f5e('0x19');break;case'IN':_0x183360=_0x8f5e('0x1a');break;case'CN':_0x183360=_0x8f5e('0x1b');break;default:_0x183360=_0x8f5e('0x1c');break;}var _0x48a8e5={'method':_0x8f5e('0x27'),'uri':_0x183360+_0x8f5e('0x1d'),'form':{'grant_type':_0x8f5e('0x28'),'client_id':_0x3e5347[_0x8f5e('0x11')],'client_secret':_0x3e5347[_0x8f5e('0x12')],'redirect_uri':_0x3e5347['serverUrl'],'code':_0x3e5347['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x48a8e5)[_0x8f5e('0x29')](function(_0x4b1148){var _0x18df49=JSON[_0x8f5e('0x1e')](_0x4b1148);if(_0x18df49[_0x8f5e('0x1f')]){_0x3e5347[_0x8f5e('0x20')]=_0x18df49[_0x8f5e('0x1f')];logger[_0x8f5e('0x2a')](util['format'](_0x8f5e('0x22'),_0x3e5347[_0x8f5e('0x23')],_0x3e5347['id']));}else{logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x3e5347[_0x8f5e('0x23')],_0x3e5347['id']),util[_0x8f5e('0x25')](_0x18df49,{'showHidden':![],'depth':null}));}return _0x1ee875(null,_0x1a7649);})[_0x8f5e('0x2b')](function(_0x4e1984){logger[_0x8f5e('0x26')](util[_0x8f5e('0x21')](_0x8f5e('0x24'),_0x3e5347['name'],_0x3e5347['id']),util[_0x8f5e('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1ee875(_0x4e1984);});}else{return _0x1ee875(null,_0x1a7649);}}}});};
\ No newline at end of file
+var _0x9693=['zone','serverUrl','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','code','application/x-www-form-urlencoded','then','parse','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','substring','https://accounts.zoho.eu','refresh_token','info','catch','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','changed'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x9693,0xe8));var _0x3969=function(_0x5c536c,_0xc80b2b){_0x5c536c=_0x5c536c-0x0;var _0x26dc94=_0x9693[_0x5c536c];return _0x26dc94;};'use strict';var _=require(_0x3969('0x0'));var util=require(_0x3969('0x1'));var logger=require(_0x3969('0x2'))(_0x3969('0x3'));var moment=require(_0x3969('0x4'));var BPromise=require('bluebird');var rp=require(_0x3969('0x5'));var fs=require('fs');var path=require(_0x3969('0x6'));var rimraf=require(_0x3969('0x7'));var config=require(_0x3969('0x8'));var attributes=require(_0x3969('0x9'));var integrations=require(_0x3969('0xa'));module['exports']=function(_0x510690,_0x4169ae){return _0x510690[_0x3969('0xb')](_0x3969('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1dd1c7,_0x48c55c,_0x178727){if(_0x1dd1c7[_0x3969('0xd')](_0x3969('0xe'))||_0x1dd1c7[_0x3969('0xd')](_0x3969('0xf'))||_0x1dd1c7['changed']('clientId')||_0x1dd1c7[_0x3969('0xd')](_0x3969('0x10'))||_0x1dd1c7[_0x3969('0xd')]('code')||_0x1dd1c7[_0x3969('0xd')](_0x3969('0x11'))){var _0x3c1716,_0x313510;_0x3c1716=_0x1dd1c7[_0x3969('0xf')];var _0x7f1361=_0x3c1716[_0x3969('0x12')](-0x1);if(_0x7f1361==='/'||_0x7f1361==='\x5c'||_0x7f1361===':'){_0x3c1716=_0x3c1716['substring'](0x0,_0x3c1716[_0x3969('0x13')](_0x7f1361));}switch(_0x1dd1c7[_0x3969('0xe')]){case'US':_0x313510='https://accounts.zoho.com';break;case'AU':_0x313510=_0x3969('0x14');break;case'IN':_0x313510='https://accounts.zoho.in';break;case'CN':_0x313510=_0x3969('0x15');break;default:_0x313510='https://accounts.zoho.eu';break;}var _0x3bc2bf={'method':_0x3969('0x16'),'uri':_0x313510+_0x3969('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x1dd1c7[_0x3969('0x18')],'client_secret':_0x1dd1c7[_0x3969('0x10')],'redirect_uri':_0x1dd1c7[_0x3969('0xf')],'code':_0x1dd1c7[_0x3969('0x19')]},'headers':{'Content-Type':_0x3969('0x1a')}};return rp(_0x3bc2bf)[_0x3969('0x1b')](function(_0x52f2f1){var _0x57df3d=JSON[_0x3969('0x1c')](_0x52f2f1);if(_0x57df3d['refresh_token']){_0x1dd1c7[_0x3969('0x1d')]=_0x57df3d['refresh_token'];logger['info'](util[_0x3969('0x1e')](_0x3969('0x1f'),_0x1dd1c7['name'],_0x1dd1c7['id']));}else{logger[_0x3969('0x20')](util[_0x3969('0x1e')](_0x3969('0x21'),_0x1dd1c7[_0x3969('0x22')],_0x1dd1c7['id']),util['inspect'](_0x57df3d,{'showHidden':![],'depth':null}));}return _0x178727(null,_0x48c55c);})['catch'](function(_0x5a2234){logger[_0x3969('0x20')](util[_0x3969('0x1e')](_0x3969('0x21'),_0x1dd1c7[_0x3969('0x22')],_0x1dd1c7['id']),util[_0x3969('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x178727(_0x5a2234);});}else{return _0x178727(null,_0x48c55c);}},'beforeUpdate':function(_0x4f9392,_0x211ca8,_0x3ffdc8){if(_0x4f9392[_0x3969('0xd')](_0x3969('0xe'))||_0x4f9392[_0x3969('0xd')](_0x3969('0xf'))||_0x4f9392[_0x3969('0xd')](_0x3969('0x18'))||_0x4f9392[_0x3969('0xd')](_0x3969('0x10'))||_0x4f9392[_0x3969('0xd')](_0x3969('0x19'))||_0x4f9392[_0x3969('0xd')](_0x3969('0x11'))){var _0x3cf47a,_0x35fe60;_0x3cf47a=_0x4f9392[_0x3969('0xf')];var _0x1750c9=_0x3cf47a['slice'](-0x1);if(_0x1750c9==='/'||_0x1750c9==='\x5c'||_0x1750c9===':'){_0x3cf47a=_0x3cf47a[_0x3969('0x24')](0x0,_0x3cf47a[_0x3969('0x13')](_0x1750c9));}switch(_0x4f9392[_0x3969('0xe')]){case'US':_0x35fe60='https://accounts.zoho.com';break;case'AU':_0x35fe60=_0x3969('0x14');break;case'IN':_0x35fe60='https://accounts.zoho.in';break;case'CN':_0x35fe60=_0x3969('0x15');break;default:_0x35fe60=_0x3969('0x25');break;}var _0x2e5260={'method':_0x3969('0x16'),'uri':_0x35fe60+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x4f9392[_0x3969('0x18')],'client_secret':_0x4f9392[_0x3969('0x10')],'redirect_uri':_0x4f9392[_0x3969('0xf')],'code':_0x4f9392[_0x3969('0x19')]},'headers':{'Content-Type':_0x3969('0x1a')}};return rp(_0x2e5260)['then'](function(_0x121606){var _0x4fbfe1=JSON['parse'](_0x121606);if(_0x4fbfe1[_0x3969('0x26')]){_0x4f9392['refreshToken']=_0x4fbfe1[_0x3969('0x26')];logger[_0x3969('0x27')](util[_0x3969('0x1e')](_0x3969('0x1f'),_0x4f9392[_0x3969('0x22')],_0x4f9392['id']));}else{logger[_0x3969('0x20')](util[_0x3969('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4f9392[_0x3969('0x22')],_0x4f9392['id']),util[_0x3969('0x23')](_0x4fbfe1,{'showHidden':![],'depth':null}));}return _0x3ffdc8(null,_0x211ca8);})[_0x3969('0x28')](function(_0x470ff0){logger[_0x3969('0x20')](util[_0x3969('0x1e')](_0x3969('0x21'),_0x4f9392[_0x3969('0x22')],_0x4f9392['id']),util[_0x3969('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ffdc8(_0x470ff0);});}else{return _0x3ffdc8(null,_0x211ca8);}}}});};
\ No newline at end of file
index f95ed9d..a762c3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5713=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoAccount,\x20%s,\x20%s','message','result','GetZohoAccount','ZohoAccount','findAll','options','where','limit','include','model','attributes','map','find','raw','ShowZohoAccount','stringify','catch'];(function(_0x403db1,_0x59018e){var _0x47c48f=function(_0x1b663c){while(--_0x1b663c){_0x403db1['push'](_0x403db1['shift']());}};_0x47c48f(++_0x59018e);}(_0x5713,0x1c7));var _0x3571=function(_0x54493b,_0x5da0bb){_0x54493b=_0x54493b-0x0;var _0x20b87b=_0x5713[_0x54493b];return _0x20b87b;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var moment=require('moment');var BPromise=require(_0x3571('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3571('0x3'));var db=require(_0x3571('0x4'))['db'];var utils=require(_0x3571('0x5'));var logger=require(_0x3571('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3571('0x7'));var client=jayson[_0x3571('0x8')][_0x3571('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432a48,_0x3a6f29,_0x1f8f0f){return new BPromise(function(_0x48b06d,_0x358ba1){return client[_0x3571('0xa')](_0x432a48,_0x1f8f0f)[_0x3571('0xb')](function(_0x288fc8){logger[_0x3571('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x3a6f29,'request\x20sent');logger[_0x3571('0xd')](_0x3571('0xe'),_0x3a6f29,_0x3571('0xf'),JSON['stringify'](_0x288fc8));if(_0x288fc8['error']){if(_0x288fc8['error']['code']===0x1f4){logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x358ba1(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}logger[_0x3571('0x10')](_0x3571('0x11'),_0x3a6f29,_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);return _0x48b06d(_0x288fc8[_0x3571('0x10')][_0x3571('0x12')]);}else{logger[_0x3571('0xc')](_0x3571('0x11'),_0x3a6f29,_0x3571('0xf'));_0x48b06d(_0x288fc8[_0x3571('0x13')]['message']);}})['catch'](function(_0x48c77e){logger[_0x3571('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x3a6f29,_0x48c77e);_0x358ba1(_0x48c77e);});});}exports[_0x3571('0x14')]=function(_0x37881f){var _0x4b745a=this;return new Promise(function(_0x22a418,_0xab19b1){return db[_0x3571('0x15')][_0x3571('0x16')]({'raw':_0x37881f[_0x3571('0x17')]?_0x37881f[_0x3571('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x37881f[_0x3571('0x17')]?_0x37881f['options'][_0x3571('0x18')]||null:null,'attributes':_0x37881f[_0x3571('0x17')]?_0x37881f['options']['attributes']||null:null,'limit':_0x37881f['options']?_0x37881f[_0x3571('0x17')][_0x3571('0x19')]||null:null,'include':_0x37881f[_0x3571('0x17')]?_0x37881f[_0x3571('0x17')][_0x3571('0x1a')]?_['map'](_0x37881f[_0x3571('0x17')][_0x3571('0x1a')],function(_0x17492d){return{'model':db[_0x17492d[_0x3571('0x1b')]],'as':_0x17492d['as'],'attributes':_0x17492d[_0x3571('0x1c')],'include':_0x17492d['include']?_[_0x3571('0x1d')](_0x17492d[_0x3571('0x1a')],function(_0x5c830b){return{'model':db[_0x5c830b[_0x3571('0x1b')]],'as':_0x5c830b['as'],'attributes':_0x5c830b['attributes'],'include':_0x5c830b[_0x3571('0x1a')]?_[_0x3571('0x1d')](_0x5c830b[_0x3571('0x1a')],function(_0x2a06e4){return{'model':db[_0x2a06e4[_0x3571('0x1b')]],'as':_0x2a06e4['as'],'attributes':_0x2a06e4[_0x3571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3571('0xb')](function(_0x4cbaae){logger[_0x3571('0xc')](_0x3571('0x14'),_0x37881f);logger[_0x3571('0xd')]('GetZohoAccount',_0x37881f,JSON['stringify'](_0x4cbaae));_0x22a418(_0x4cbaae);})['catch'](function(_0xa6d91f){logger['error'](_0x3571('0x14'),_0xa6d91f[_0x3571('0x12')],_0x37881f);_0xab19b1(_0x4b745a[_0x3571('0x10')](0x1f4,_0xa6d91f['message']));});});};exports['ShowZohoAccount']=function(_0x7c1c2a){var _0x40eea0=this;return new Promise(function(_0x4cc26c,_0x37de61){return db['ZohoAccount'][_0x3571('0x1e')]({'raw':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x1f')]===undefined?!![]:![]:!![],'where':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x18')]||null:null,'attributes':_0x7c1c2a['options']?_0x7c1c2a[_0x3571('0x17')][_0x3571('0x1c')]||null:null,'include':_0x7c1c2a[_0x3571('0x17')]?_0x7c1c2a[_0x3571('0x17')]['include']?_[_0x3571('0x1d')](_0x7c1c2a['options'][_0x3571('0x1a')],function(_0x16c5a0){return{'model':db[_0x16c5a0[_0x3571('0x1b')]],'as':_0x16c5a0['as'],'attributes':_0x16c5a0[_0x3571('0x1c')],'include':_0x16c5a0[_0x3571('0x1a')]?_['map'](_0x16c5a0['include'],function(_0x525842){return{'model':db[_0x525842['model']],'as':_0x525842['as'],'attributes':_0x525842[_0x3571('0x1c')],'include':_0x525842['include']?_[_0x3571('0x1d')](_0x525842[_0x3571('0x1a')],function(_0xa0d2d3){return{'model':db[_0xa0d2d3[_0x3571('0x1b')]],'as':_0xa0d2d3['as'],'attributes':_0xa0d2d3[_0x3571('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3571('0xb')](function(_0x356eb1){logger['info'](_0x3571('0x20'),_0x7c1c2a);logger[_0x3571('0xd')](_0x3571('0x20'),_0x7c1c2a,JSON[_0x3571('0x21')](_0x356eb1));_0x4cc26c(_0x356eb1);})[_0x3571('0x22')](function(_0x59ecb4){logger[_0x3571('0x10')](_0x3571('0x20'),_0x59ecb4[_0x3571('0x12')],_0x7c1c2a);_0x37de61(_0x40eea0[_0x3571('0x10')](0x1f4,_0x59ecb4[_0x3571('0x12')]));});});};
\ No newline at end of file
+var _0x672a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowZohoAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x262f0d,_0x51e151){var _0x21dc30=function(_0x49857c){while(--_0x49857c){_0x262f0d['push'](_0x262f0d['shift']());}};_0x21dc30(++_0x51e151);}(_0x672a,0x122));var _0xa672=function(_0x4e084e,_0x45e961){_0x4e084e=_0x4e084e-0x0;var _0x1b71ab=_0x672a[_0x4e084e];return _0x1b71ab;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var moment=require(_0xa672('0x2'));var BPromise=require(_0xa672('0x3'));var rs=require(_0xa672('0x4'));var fs=require('fs');var Redis=require(_0xa672('0x5'));var db=require(_0xa672('0x6'))['db'];var utils=require(_0xa672('0x7'));var logger=require(_0xa672('0x8'))(_0xa672('0x9'));var config=require(_0xa672('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa672('0xb')][_0xa672('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a4797,_0x33dd0c,_0x13402c){return new BPromise(function(_0x3f18d8,_0x338516){return client[_0xa672('0xd')](_0x3a4797,_0x13402c)[_0xa672('0xe')](function(_0x370f20){logger[_0xa672('0xf')](_0xa672('0x10'),_0x33dd0c,_0xa672('0x11'));logger[_0xa672('0x12')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x33dd0c,_0xa672('0x11'),JSON[_0xa672('0x13')](_0x370f20));if(_0x370f20['error']){if(_0x370f20[_0xa672('0x14')][_0xa672('0x15')]===0x1f4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x338516(_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);}logger[_0xa672('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x3f18d8(_0x370f20['error']['message']);}else{logger[_0xa672('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,'request\x20sent');_0x3f18d8(_0x370f20['result'][_0xa672('0x16')]);}})['catch'](function(_0x5a98a4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x5a98a4);_0x338516(_0x5a98a4);});});}exports[_0xa672('0x17')]=function(_0xc5eeb3){var _0x929a34=this;return new Promise(function(_0x10dc1c,_0x213861){return db[_0xa672('0x18')][_0xa672('0x19')]({'raw':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3['options'][_0xa672('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1c')]||null:null,'attributes':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['attributes']||null:null,'limit':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1d')]||null:null,'include':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['include']?_[_0xa672('0x1e')](_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1f')],function(_0x47000f){return{'model':db[_0x47000f['model']],'as':_0x47000f['as'],'attributes':_0x47000f['attributes'],'include':_0x47000f[_0xa672('0x1f')]?_['map'](_0x47000f[_0xa672('0x1f')],function(_0x31f755){return{'model':db[_0x31f755[_0xa672('0x20')]],'as':_0x31f755['as'],'attributes':_0x31f755[_0xa672('0x21')],'include':_0x31f755[_0xa672('0x1f')]?_[_0xa672('0x1e')](_0x31f755['include'],function(_0x5388f1){return{'model':db[_0x5388f1[_0xa672('0x20')]],'as':_0x5388f1['as'],'attributes':_0x5388f1[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x5d3d6a){logger[_0xa672('0xf')](_0xa672('0x17'),_0xc5eeb3);logger['debug'](_0xa672('0x17'),_0xc5eeb3,JSON[_0xa672('0x13')](_0x5d3d6a));_0x10dc1c(_0x5d3d6a);})['catch'](function(_0x210c42){logger[_0xa672('0x14')](_0xa672('0x17'),_0x210c42[_0xa672('0x16')],_0xc5eeb3);_0x213861(_0x929a34[_0xa672('0x14')](0x1f4,_0x210c42[_0xa672('0x16')]));});});};exports[_0xa672('0x22')]=function(_0x1250eb){var _0x48ccf3=this;return new Promise(function(_0x89250e,_0x1bae9f){return db[_0xa672('0x18')][_0xa672('0x23')]({'raw':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options'][_0xa672('0x1c')]||null:null,'attributes':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')][_0xa672('0x21')]||null:null,'include':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options']['include']?_['map'](_0x1250eb[_0xa672('0x1a')]['include'],function(_0x1720a9){return{'model':db[_0x1720a9[_0xa672('0x20')]],'as':_0x1720a9['as'],'attributes':_0x1720a9[_0xa672('0x21')],'include':_0x1720a9[_0xa672('0x1f')]?_['map'](_0x1720a9[_0xa672('0x1f')],function(_0x10f785){return{'model':db[_0x10f785[_0xa672('0x20')]],'as':_0x10f785['as'],'attributes':_0x10f785[_0xa672('0x21')],'include':_0x10f785['include']?_['map'](_0x10f785[_0xa672('0x1f')],function(_0x23165c){return{'model':db[_0x23165c[_0xa672('0x20')]],'as':_0x23165c['as'],'attributes':_0x23165c[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x38681b){logger['info'](_0xa672('0x22'),_0x1250eb);logger['debug'](_0xa672('0x22'),_0x1250eb,JSON[_0xa672('0x13')](_0x38681b));_0x89250e(_0x38681b);})[_0xa672('0x24')](function(_0x196cbd){logger[_0xa672('0x14')](_0xa672('0x22'),_0x196cbd['message'],_0x1250eb);_0x1bae9f(_0x48ccf3['error'](0x1f4,_0x196cbd[_0xa672('0x16')]));});});};
\ No newline at end of file
index 94ac9ff..56bdb57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9775=['update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post'];(function(_0x4075fb,_0x3f59e0){var _0x26ffed=function(_0x81ec8){while(--_0x81ec8){_0x4075fb['push'](_0x4075fb['shift']());}};_0x26ffed(++_0x3f59e0);}(_0x9775,0x17e));var _0x5977=function(_0x17d39e,_0x1e8c54){_0x17d39e=_0x17d39e-0x0;var _0x4592fa=_0x9775[_0x17d39e];return _0x4592fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5977('0x0'));var timeout=require(_0x5977('0x1'));var express=require(_0x5977('0x2'));var router=express[_0x5977('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5977('0x4'));var interaction=require(_0x5977('0x5'));var config=require(_0x5977('0x6'));var controller=require(_0x5977('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5977('0x8')]);router[_0x5977('0x9')](_0x5977('0xa'),auth[_0x5977('0xb')](),controller['show']);router[_0x5977('0x9')](_0x5977('0xc'),auth[_0x5977('0xb')](),controller[_0x5977('0xd')]);router[_0x5977('0x9')](_0x5977('0xe'),auth[_0x5977('0xb')](),controller['getSubjects']);router[_0x5977('0x9')](_0x5977('0xf'),auth[_0x5977('0xb')](),controller['getDescriptions']);router[_0x5977('0x10')]('/',auth[_0x5977('0xb')](),controller['create']);router['put'](_0x5977('0xa'),auth[_0x5977('0xb')](),controller[_0x5977('0x11')]);router[_0x5977('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x5977('0x13')]);module[_0x5977('0x14')]=router;
\ No newline at end of file
+var _0xc548=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer'];(function(_0x5d4662,_0x3c7373){var _0x5c4380=function(_0x2fa2a4){while(--_0x2fa2a4){_0x5d4662['push'](_0x5d4662['shift']());}};_0x5c4380(++_0x3c7373);}(_0xc548,0x81));var _0x8c54=function(_0x3571b6,_0x28464b){_0x3571b6=_0x3571b6-0x0;var _0x3071ad=_0xc548[_0x3571b6];return _0x3071ad;};'use strict';var multer=require(_0x8c54('0x0'));var util=require(_0x8c54('0x1'));var path=require(_0x8c54('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c54('0x3'));var router=express[_0x8c54('0x4')]();var fs_extra=require(_0x8c54('0x5'));var auth=require(_0x8c54('0x6'));var interaction=require(_0x8c54('0x7'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x8c54('0x8')]('/',auth['isAuthenticated'](),controller[_0x8c54('0x9')]);router[_0x8c54('0x8')](_0x8c54('0xa'),auth['isAuthenticated'](),controller[_0x8c54('0xb')]);router[_0x8c54('0x8')](_0x8c54('0xc'),auth['isAuthenticated'](),controller[_0x8c54('0xd')]);router[_0x8c54('0x8')](_0x8c54('0xe'),auth[_0x8c54('0xf')](),controller[_0x8c54('0x10')]);router['get'](_0x8c54('0x11'),auth[_0x8c54('0xf')](),controller[_0x8c54('0x12')]);router[_0x8c54('0x13')]('/',auth[_0x8c54('0xf')](),controller[_0x8c54('0x14')]);router[_0x8c54('0x15')](_0x8c54('0xa'),auth[_0x8c54('0xf')](),controller[_0x8c54('0x16')]);router[_0x8c54('0x17')](_0x8c54('0xa'),auth[_0x8c54('0xf')](),controller[_0x8c54('0x18')]);module[_0x8c54('0x19')]=router;
\ No newline at end of file
index 98147cd..614353b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x446e=['sequelize','exports','ENUM','lead','contact','nothing','contact_lead','STRING'];(function(_0x3d67eb,_0x2f578b){var _0x4354f9=function(_0xb5bc1d){while(--_0xb5bc1d){_0x3d67eb['push'](_0x3d67eb['shift']());}};_0x4354f9(++_0x2f578b);}(_0x446e,0x1f0));var _0xe446=function(_0x65ca3d,_0x500095){_0x65ca3d=_0x65ca3d-0x0;var _0x431b89=_0x446e[_0x65ca3d];return _0x431b89;};'use strict';var Sequelize=require(_0xe446('0x0'));module[_0xe446('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xe446('0x2')](_0xe446('0x3'),_0xe446('0x4'),_0xe446('0x5')),'defaultValue':_0xe446('0x3')},'moduleSearch':{'type':Sequelize[_0xe446('0x2')](_0xe446('0x6'),'contact','lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xe446('0x7')]}};
\ No newline at end of file
+var _0x0e0d=['lead','contact_lead','contact','STRING','sequelize','exports','ENUM'];(function(_0x58eb6d,_0x5f188b){var _0x44c155=function(_0x463f32){while(--_0x463f32){_0x58eb6d['push'](_0x58eb6d['shift']());}};_0x44c155(++_0x5f188b);}(_0x0e0d,0x100));var _0xd0e0=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0e0d[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xd0e0('0x0'));module[_0xd0e0('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xd0e0('0x2')]('lead','contact','nothing'),'defaultValue':_0xd0e0('0x3')},'moduleSearch':{'type':Sequelize[_0xd0e0('0x2')](_0xd0e0('0x4'),_0xd0e0('0x5'),_0xd0e0('0x3')),'defaultValue':_0xd0e0('0x4')},'description':{'type':Sequelize[_0xd0e0('0x6')]}};
\ No newline at end of file
index e88b9c0..b815650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9737=['sendStatus','status','offset','undefined','limit','count','set','json','apply','update','destroy','then','end','error','stack','name','send','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getFields','findOne','ZohoField','getSubjects','options','getDescriptions','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xf65a8e,_0x228b00){var _0x37eb5=function(_0x90b233){while(--_0x90b233){_0xf65a8e['push'](_0xf65a8e['shift']());}};_0x37eb5(++_0x228b00);}(_0x9737,0x123));var _0x7973=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9737[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7973('0x0'));var zipdir=require(_0x7973('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7973('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7973('0x3'));var util=require(_0x7973('0x4'));var path=require(_0x7973('0x5'));var sox=require(_0x7973('0x6'));var csv=require(_0x7973('0x7'));var ejs=require(_0x7973('0x8'));var fs=require('fs');var fs_extra=require(_0x7973('0x9'));var _=require(_0x7973('0xa'));var squel=require(_0x7973('0xb'));var crypto=require('crypto');var jsforce=require(_0x7973('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7973('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7973('0xd'));var qs=require(_0x7973('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7973('0xf'))(_0x7973('0x10'));var utils=require(_0x7973('0x11'));var config=require(_0x7973('0x12'));var licenseUtil=require(_0x7973('0x13'));var db=require(_0x7973('0x14'))['db'];function respondWithStatusCode(_0xee212b,_0x5493ee){_0x5493ee=_0x5493ee||0xcc;return function(_0x2c8b9f){if(_0x2c8b9f){return _0xee212b[_0x7973('0x15')](_0x5493ee);}return _0xee212b['status'](_0x5493ee)['end']();};}function respondWithResult(_0x500cc9,_0x2ab2a1){_0x2ab2a1=_0x2ab2a1||0xc8;return function(_0xcef0fa){if(_0xcef0fa){return _0x500cc9[_0x7973('0x16')](_0x2ab2a1)['json'](_0xcef0fa);}};}function respondWithFilteredResult(_0x584fa2,_0x24fe65){return function(_0x4286cf){if(_0x4286cf){var _0x2b1ea=typeof _0x24fe65[_0x7973('0x17')]===_0x7973('0x18')&&typeof _0x24fe65[_0x7973('0x19')]===_0x7973('0x18');var _0x2133f7=_0x4286cf[_0x7973('0x1a')];var _0x16ff92=_0x2b1ea?0x0:_0x24fe65[_0x7973('0x17')];var _0x234067=_0x2b1ea?_0x4286cf[_0x7973('0x1a')]:_0x24fe65['offset']+_0x24fe65['limit'];var _0x13ddf9;if(_0x234067>=_0x2133f7){_0x234067=_0x2133f7;_0x13ddf9=0xc8;}else{_0x13ddf9=0xce;}_0x584fa2[_0x7973('0x16')](_0x13ddf9);return _0x584fa2[_0x7973('0x1b')]('Content-Range',_0x16ff92+'-'+_0x234067+'/'+_0x2133f7)[_0x7973('0x1c')](_0x4286cf);}return null;};}function patchUpdates(_0x1b5be9){return function(_0x1d7cc2){try{jsonpatch[_0x7973('0x1d')](_0x1d7cc2,_0x1b5be9,!![]);}catch(_0x2af6ae){return BPromise['reject'](_0x2af6ae);}return _0x1d7cc2['save']();};}function saveUpdates(_0x4d80cb,_0xd79dfa){return function(_0xa2b51b){if(_0xa2b51b){return _0xa2b51b[_0x7973('0x1e')](_0x4d80cb)['then'](function(_0x17ec4c){return _0x17ec4c;});}return null;};}function removeEntity(_0x1e0148,_0x194124){return function(_0x3226f4){if(_0x3226f4){return _0x3226f4[_0x7973('0x1f')]()[_0x7973('0x20')](function(){_0x1e0148['status'](0xcc)[_0x7973('0x21')]();});}};}function handleEntityNotFound(_0x2c644a,_0xf85799){return function(_0x548091){if(!_0x548091){_0x2c644a['sendStatus'](0x194);}return _0x548091;};}function handleError(_0xeebcc4,_0x294880){_0x294880=_0x294880||0x1f4;return function(_0x5dadd1){logger[_0x7973('0x22')](_0x5dadd1[_0x7973('0x23')]);if(_0x5dadd1['name']){delete _0x5dadd1[_0x7973('0x24')];}_0xeebcc4[_0x7973('0x16')](_0x294880)[_0x7973('0x25')](_0x5dadd1);};}exports[_0x7973('0x26')]=function(_0x1f7635,_0x399c3e){var _0x2f1011={},_0x1026d6={},_0x5a22e6={'count':0x0,'rows':[]};var _0x5872c7=_['map'](db[_0x7973('0x27')][_0x7973('0x28')],function(_0x57b310){return{'name':_0x57b310[_0x7973('0x29')],'type':_0x57b310[_0x7973('0x2a')][_0x7973('0x2b')]};});_0x1026d6[_0x7973('0x2c')]=_[_0x7973('0x2d')](_0x5872c7,'name');_0x1026d6[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x1f7635['query']);_0x1026d6[_0x7973('0x30')]=_[_0x7973('0x31')](_0x1026d6[_0x7973('0x2c')],_0x1026d6[_0x7973('0x2e')]);_0x2f1011['attributes']=_['intersection'](_0x1026d6[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x1f7635[_0x7973('0x2e')][_0x7973('0x32')]));_0x2f1011[_0x7973('0x33')]=_0x2f1011['attributes'][_0x7973('0x34')]?_0x2f1011[_0x7973('0x33')]:_0x1026d6[_0x7973('0x2c')];if(!_0x1f7635['query'][_0x7973('0x35')](_0x7973('0x36'))){_0x2f1011[_0x7973('0x19')]=qs[_0x7973('0x19')](_0x1f7635[_0x7973('0x2e')][_0x7973('0x19')]);_0x2f1011['offset']=qs[_0x7973('0x17')](_0x1f7635['query']['offset']);}_0x2f1011[_0x7973('0x37')]=qs['sort'](_0x1f7635[_0x7973('0x2e')][_0x7973('0x38')]);_0x2f1011[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x1f7635[_0x7973('0x2e')],_0x1026d6[_0x7973('0x30')]),_0x5872c7);if(_0x1f7635['query'][_0x7973('0x3b')]){_0x2f1011[_0x7973('0x39')]=_['merge'](_0x2f1011['where'],{'$or':_[_0x7973('0x2d')](_0x5872c7,function(_0x687625){if(_0x687625['type']!==_0x7973('0x3c')){var _0xcd00e6={};_0xcd00e6[_0x687625[_0x7973('0x24')]]={'$like':'%'+_0x1f7635[_0x7973('0x2e')][_0x7973('0x3b')]+'%'};return _0xcd00e6;}})});}_0x2f1011=_['merge']({},_0x2f1011,_0x1f7635['options']);var _0x28fcf4={'where':_0x2f1011[_0x7973('0x39')]};return db[_0x7973('0x27')]['count'](_0x28fcf4)['then'](function(_0x28a014){_0x5a22e6[_0x7973('0x1a')]=_0x28a014;if(_0x1f7635['query'][_0x7973('0x3d')]){_0x2f1011[_0x7973('0x3e')]=[{'all':!![]}];}return db[_0x7973('0x27')][_0x7973('0x3f')](_0x2f1011);})[_0x7973('0x20')](function(_0x55ac69){_0x5a22e6[_0x7973('0x40')]=_0x55ac69;return _0x5a22e6;})[_0x7973('0x20')](respondWithFilteredResult(_0x399c3e,_0x2f1011))[_0x7973('0x41')](handleError(_0x399c3e,null));};exports[_0x7973('0x42')]=function(_0x2898f3,_0x4935b0){var _0x176bdf={'raw':![],'where':{'id':_0x2898f3[_0x7973('0x43')]['id']}},_0x3ad3b9={};_0x3ad3b9['model']=_[_0x7973('0x2f')](db[_0x7973('0x27')][_0x7973('0x28')]);_0x3ad3b9[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x2898f3[_0x7973('0x2e')]);_0x3ad3b9[_0x7973('0x30')]=_[_0x7973('0x31')](_0x3ad3b9[_0x7973('0x2c')],_0x3ad3b9[_0x7973('0x2e')]);_0x176bdf['attributes']=_[_0x7973('0x31')](_0x3ad3b9['model'],qs[_0x7973('0x32')](_0x2898f3[_0x7973('0x2e')][_0x7973('0x32')]));_0x176bdf['attributes']=_0x176bdf[_0x7973('0x33')][_0x7973('0x34')]?_0x176bdf[_0x7973('0x33')]:_0x3ad3b9['model'];if(_0x2898f3[_0x7973('0x2e')][_0x7973('0x3d')]){_0x176bdf[_0x7973('0x3e')]=[{'all':!![]}];}_0x176bdf=_[_0x7973('0x44')]({},_0x176bdf,_0x2898f3['options']);return db[_0x7973('0x27')][_0x7973('0x45')](_0x176bdf)[_0x7973('0x20')](handleEntityNotFound(_0x4935b0,null))[_0x7973('0x20')](respondWithResult(_0x4935b0,null))[_0x7973('0x41')](handleError(_0x4935b0,null));};exports[_0x7973('0x46')]=function(_0x4af8db,_0x2655b2){return db[_0x7973('0x27')][_0x7973('0x46')](_0x4af8db[_0x7973('0x47')],{})[_0x7973('0x20')](respondWithResult(_0x2655b2,0xc9))['catch'](handleError(_0x2655b2,null));};exports['update']=function(_0x35d310,_0x5bfd44){if(_0x35d310[_0x7973('0x47')]['id']){delete _0x35d310['body']['id'];}return db[_0x7973('0x27')][_0x7973('0x45')]({'where':{'id':_0x35d310['params']['id']}})['then'](handleEntityNotFound(_0x5bfd44,null))[_0x7973('0x20')](saveUpdates(_0x35d310[_0x7973('0x47')],null))[_0x7973('0x20')](respondWithResult(_0x5bfd44,null))[_0x7973('0x41')](handleError(_0x5bfd44,null));};exports[_0x7973('0x1f')]=function(_0x19648b,_0x157180){return db[_0x7973('0x27')]['find']({'where':{'id':_0x19648b[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x157180,null))[_0x7973('0x20')](removeEntity(_0x157180,null))[_0x7973('0x41')](handleError(_0x157180,null));};exports[_0x7973('0x48')]=function(_0x573d96,_0x268f12,_0x26c37c){var _0x1ac495={};var _0x320be2={};var _0x35610e;var _0x42226e;return db[_0x7973('0x27')][_0x7973('0x49')]({'where':{'id':_0x573d96[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x268f12,null))['then'](function(_0x1fc193){if(_0x1fc193){_0x35610e=_0x1fc193;_0x320be2[_0x7973('0x2c')]=_[_0x7973('0x2f')](db[_0x7973('0x4a')][_0x7973('0x28')]);_0x320be2[_0x7973('0x2e')]=_['keys'](_0x573d96[_0x7973('0x2e')]);_0x320be2[_0x7973('0x30')]=_[_0x7973('0x31')](_0x320be2[_0x7973('0x2c')],_0x320be2[_0x7973('0x2e')]);_0x1ac495['attributes']=_[_0x7973('0x31')](_0x320be2[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x573d96['query'][_0x7973('0x32')]));_0x1ac495[_0x7973('0x33')]=_0x1ac495[_0x7973('0x33')][_0x7973('0x34')]?_0x1ac495['attributes']:_0x320be2[_0x7973('0x2c')];_0x1ac495[_0x7973('0x37')]=qs['sort'](_0x573d96[_0x7973('0x2e')]['sort']);_0x1ac495[_0x7973('0x39')]=qs[_0x7973('0x30')](_['pick'](_0x573d96['query'],_0x320be2[_0x7973('0x30')]));if(_0x573d96[_0x7973('0x2e')]['filter']){_0x1ac495[_0x7973('0x39')]=_['merge'](_0x1ac495[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x1ac495['attributes'],function(_0x2d516d){var _0x4cea8c={};_0x4cea8c[_0x2d516d]={'$like':'%'+_0x573d96['query'][_0x7973('0x3b')]+'%'};return _0x4cea8c;})});}_0x1ac495=_[_0x7973('0x44')]({},_0x1ac495,_0x573d96['options']);return _0x35610e['getFields'](_0x1ac495);}})[_0x7973('0x20')](function(_0x289759){if(_0x289759){_0x42226e=_0x289759[_0x7973('0x34')];if(!_0x573d96[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x1ac495['limit']=qs[_0x7973('0x19')](_0x573d96[_0x7973('0x2e')][_0x7973('0x19')]);_0x1ac495[_0x7973('0x17')]=qs[_0x7973('0x17')](_0x573d96[_0x7973('0x2e')][_0x7973('0x17')]);}return _0x35610e[_0x7973('0x48')](_0x1ac495);}})[_0x7973('0x20')](function(_0x4585dd){if(_0x4585dd){return _0x4585dd?{'count':_0x42226e,'rows':_0x4585dd}:null;}})[_0x7973('0x20')](respondWithResult(_0x268f12,null))['catch'](handleError(_0x268f12,null));};exports[_0x7973('0x4b')]=function(_0x449f41,_0xb3581b,_0x58e8a6){var _0x32d1b3={};var _0x3d6dfd={};var _0x2b3f36;var _0x5e8f3b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x449f41[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0xb3581b,null))['then'](function(_0x2220a5){if(_0x2220a5){_0x2b3f36=_0x2220a5;_0x3d6dfd['model']=_[_0x7973('0x2f')](db['ZohoField']['rawAttributes']);_0x3d6dfd[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x449f41[_0x7973('0x2e')]);_0x3d6dfd[_0x7973('0x30')]=_['intersection'](_0x3d6dfd[_0x7973('0x2c')],_0x3d6dfd['query']);_0x32d1b3[_0x7973('0x33')]=_[_0x7973('0x31')](_0x3d6dfd[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x449f41[_0x7973('0x2e')]['fields']));_0x32d1b3[_0x7973('0x33')]=_0x32d1b3['attributes']['length']?_0x32d1b3[_0x7973('0x33')]:_0x3d6dfd[_0x7973('0x2c')];_0x32d1b3[_0x7973('0x37')]=qs[_0x7973('0x38')](_0x449f41[_0x7973('0x2e')][_0x7973('0x38')]);_0x32d1b3[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x449f41['query'],_0x3d6dfd['filters']));if(_0x449f41[_0x7973('0x2e')][_0x7973('0x3b')]){_0x32d1b3[_0x7973('0x39')]=_[_0x7973('0x44')](_0x32d1b3[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x32d1b3['attributes'],function(_0x393de8){var _0x4481fb={};_0x4481fb[_0x393de8]={'$like':'%'+_0x449f41['query'][_0x7973('0x3b')]+'%'};return _0x4481fb;})});}_0x32d1b3=_['merge']({},_0x32d1b3,_0x449f41[_0x7973('0x4c')]);return _0x2b3f36[_0x7973('0x4b')](_0x32d1b3);}})[_0x7973('0x20')](function(_0x10b3c0){if(_0x10b3c0){_0x5e8f3b=_0x10b3c0[_0x7973('0x34')];if(!_0x449f41[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x32d1b3[_0x7973('0x19')]=qs[_0x7973('0x19')](_0x449f41[_0x7973('0x2e')][_0x7973('0x19')]);_0x32d1b3[_0x7973('0x17')]=qs[_0x7973('0x17')](_0x449f41[_0x7973('0x2e')]['offset']);}return _0x2b3f36['getSubjects'](_0x32d1b3);}})[_0x7973('0x20')](function(_0x262956){if(_0x262956){return _0x262956?{'count':_0x5e8f3b,'rows':_0x262956}:null;}})[_0x7973('0x20')](respondWithResult(_0xb3581b,null))[_0x7973('0x41')](handleError(_0xb3581b,null));};exports['getDescriptions']=function(_0x4760f6,_0x5c2da8,_0x587180){var _0x29a92f={};var _0x5eff3f={};var _0x142179;var _0x5df11e;return db[_0x7973('0x27')][_0x7973('0x49')]({'where':{'id':_0x4760f6[_0x7973('0x43')]['id']}})[_0x7973('0x20')](handleEntityNotFound(_0x5c2da8,null))[_0x7973('0x20')](function(_0x8a7c13){if(_0x8a7c13){_0x142179=_0x8a7c13;_0x5eff3f[_0x7973('0x2c')]=_[_0x7973('0x2f')](db[_0x7973('0x4a')]['rawAttributes']);_0x5eff3f[_0x7973('0x2e')]=_[_0x7973('0x2f')](_0x4760f6[_0x7973('0x2e')]);_0x5eff3f['filters']=_[_0x7973('0x31')](_0x5eff3f[_0x7973('0x2c')],_0x5eff3f[_0x7973('0x2e')]);_0x29a92f['attributes']=_['intersection'](_0x5eff3f[_0x7973('0x2c')],qs[_0x7973('0x32')](_0x4760f6[_0x7973('0x2e')][_0x7973('0x32')]));_0x29a92f['attributes']=_0x29a92f[_0x7973('0x33')][_0x7973('0x34')]?_0x29a92f['attributes']:_0x5eff3f[_0x7973('0x2c')];_0x29a92f['order']=qs['sort'](_0x4760f6[_0x7973('0x2e')][_0x7973('0x38')]);_0x29a92f[_0x7973('0x39')]=qs[_0x7973('0x30')](_[_0x7973('0x3a')](_0x4760f6[_0x7973('0x2e')],_0x5eff3f['filters']));if(_0x4760f6[_0x7973('0x2e')][_0x7973('0x3b')]){_0x29a92f[_0x7973('0x39')]=_['merge'](_0x29a92f[_0x7973('0x39')],{'$or':_[_0x7973('0x2d')](_0x29a92f[_0x7973('0x33')],function(_0x12f9cc){var _0x37504c={};_0x37504c[_0x12f9cc]={'$like':'%'+_0x4760f6[_0x7973('0x2e')]['filter']+'%'};return _0x37504c;})});}_0x29a92f=_['merge']({},_0x29a92f,_0x4760f6['options']);return _0x142179['getDescriptions'](_0x29a92f);}})[_0x7973('0x20')](function(_0x542f48){if(_0x542f48){_0x5df11e=_0x542f48[_0x7973('0x34')];if(!_0x4760f6[_0x7973('0x2e')][_0x7973('0x35')](_0x7973('0x36'))){_0x29a92f[_0x7973('0x19')]=qs['limit'](_0x4760f6[_0x7973('0x2e')][_0x7973('0x19')]);_0x29a92f['offset']=qs['offset'](_0x4760f6['query']['offset']);}return _0x142179[_0x7973('0x4d')](_0x29a92f);}})['then'](function(_0x1b9b88){if(_0x1b9b88){return _0x1b9b88?{'count':_0x5df11e,'rows':_0x1b9b88}:null;}})[_0x7973('0x20')](respondWithResult(_0x5c2da8,null))[_0x7973('0x41')](handleError(_0x5c2da8,null));};
\ No newline at end of file
+var _0x3891=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','ZohoConfiguration','includeAll','find','create','body','getFields','ZohoField','getSubjects','getDescriptions','findOne','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x3891,0x196));var _0x1389=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x3891[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1389('0x0'));var jsonpatch=require(_0x1389('0x1'));var rp=require(_0x1389('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1389('0x3'));var util=require(_0x1389('0x4'));var path=require(_0x1389('0x5'));var sox=require(_0x1389('0x6'));var csv=require(_0x1389('0x7'));var ejs=require(_0x1389('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1389('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1389('0xa'));var deskjs=require(_0x1389('0xb'));var toCsv=require(_0x1389('0x7'));var querystring=require(_0x1389('0xc'));var Papa=require(_0x1389('0xd'));var Redis=require(_0x1389('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1389('0xf'));var logger=require(_0x1389('0x10'))(_0x1389('0x11'));var utils=require(_0x1389('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40cf1a,_0x2b5fff){_0x2b5fff=_0x2b5fff||0xcc;return function(_0x452310){if(_0x452310){return _0x40cf1a[_0x1389('0x13')](_0x2b5fff);}return _0x40cf1a['status'](_0x2b5fff)[_0x1389('0x14')]();};}function respondWithResult(_0x9a0bc2,_0x5eb281){_0x5eb281=_0x5eb281||0xc8;return function(_0x25f8d1){if(_0x25f8d1){return _0x9a0bc2['status'](_0x5eb281)['json'](_0x25f8d1);}};}function respondWithFilteredResult(_0x40c645,_0x1b17a5){return function(_0x4166c5){if(_0x4166c5){var _0x412411=typeof _0x1b17a5[_0x1389('0x15')]==='undefined'&&typeof _0x1b17a5[_0x1389('0x16')]==='undefined';var _0x901725=_0x4166c5[_0x1389('0x17')];var _0x4816d0=_0x412411?0x0:_0x1b17a5['offset'];var _0x45dc96=_0x412411?_0x4166c5[_0x1389('0x17')]:_0x1b17a5[_0x1389('0x15')]+_0x1b17a5[_0x1389('0x16')];var _0x20b2ad;if(_0x45dc96>=_0x901725){_0x45dc96=_0x901725;_0x20b2ad=0xc8;}else{_0x20b2ad=0xce;}_0x40c645[_0x1389('0x18')](_0x20b2ad);return _0x40c645['set'](_0x1389('0x19'),_0x4816d0+'-'+_0x45dc96+'/'+_0x901725)[_0x1389('0x1a')](_0x4166c5);}return null;};}function patchUpdates(_0x2099ed){return function(_0xc1ca5){try{jsonpatch[_0x1389('0x1b')](_0xc1ca5,_0x2099ed,!![]);}catch(_0x25426a){return BPromise['reject'](_0x25426a);}return _0xc1ca5[_0x1389('0x1c')]();};}function saveUpdates(_0x488e44,_0x245dc5){return function(_0x1f33ac){if(_0x1f33ac){return _0x1f33ac[_0x1389('0x1d')](_0x488e44)[_0x1389('0x1e')](function(_0x49ea88){return _0x49ea88;});}return null;};}function removeEntity(_0x1019c4,_0x248def){return function(_0x5e78b0){if(_0x5e78b0){return _0x5e78b0[_0x1389('0x1f')]()[_0x1389('0x1e')](function(){_0x1019c4[_0x1389('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x390652,_0x18ae45){return function(_0x60dbee){if(!_0x60dbee){_0x390652[_0x1389('0x13')](0x194);}return _0x60dbee;};}function handleError(_0x37963b,_0x1024de){_0x1024de=_0x1024de||0x1f4;return function(_0x348710){logger[_0x1389('0x20')](_0x348710[_0x1389('0x21')]);if(_0x348710[_0x1389('0x22')]){delete _0x348710[_0x1389('0x22')];}_0x37963b[_0x1389('0x18')](_0x1024de)['send'](_0x348710);};}exports[_0x1389('0x23')]=function(_0x540dd0,_0x3929a8){var _0x420e7e={},_0x453c33={},_0x2583e7={'count':0x0,'rows':[]};var _0x4df1ca=_[_0x1389('0x24')](db['ZohoConfiguration'][_0x1389('0x25')],function(_0x42d82f){return{'name':_0x42d82f[_0x1389('0x26')],'type':_0x42d82f[_0x1389('0x27')]['key']};});_0x453c33[_0x1389('0x28')]=_[_0x1389('0x24')](_0x4df1ca,_0x1389('0x22'));_0x453c33[_0x1389('0x29')]=_[_0x1389('0x2a')](_0x540dd0[_0x1389('0x29')]);_0x453c33[_0x1389('0x2b')]=_[_0x1389('0x2c')](_0x453c33['model'],_0x453c33[_0x1389('0x29')]);_0x420e7e[_0x1389('0x2d')]=_[_0x1389('0x2c')](_0x453c33['model'],qs[_0x1389('0x2e')](_0x540dd0[_0x1389('0x29')]['fields']));_0x420e7e[_0x1389('0x2d')]=_0x420e7e[_0x1389('0x2d')][_0x1389('0x2f')]?_0x420e7e['attributes']:_0x453c33[_0x1389('0x28')];if(!_0x540dd0[_0x1389('0x29')][_0x1389('0x30')](_0x1389('0x31'))){_0x420e7e[_0x1389('0x16')]=qs['limit'](_0x540dd0[_0x1389('0x29')][_0x1389('0x16')]);_0x420e7e[_0x1389('0x15')]=qs['offset'](_0x540dd0['query']['offset']);}_0x420e7e[_0x1389('0x32')]=qs[_0x1389('0x33')](_0x540dd0[_0x1389('0x29')]['sort']);_0x420e7e[_0x1389('0x34')]=qs[_0x1389('0x2b')](_[_0x1389('0x35')](_0x540dd0[_0x1389('0x29')],_0x453c33[_0x1389('0x2b')]),_0x4df1ca);if(_0x540dd0[_0x1389('0x29')][_0x1389('0x36')]){_0x420e7e['where']=_[_0x1389('0x37')](_0x420e7e['where'],{'$or':_[_0x1389('0x24')](_0x4df1ca,function(_0xbad3e0){if(_0xbad3e0[_0x1389('0x27')]!==_0x1389('0x38')){var _0x114170={};_0x114170[_0xbad3e0[_0x1389('0x22')]]={'$like':'%'+_0x540dd0[_0x1389('0x29')][_0x1389('0x36')]+'%'};return _0x114170;}})});}_0x420e7e=_[_0x1389('0x37')]({},_0x420e7e,_0x540dd0[_0x1389('0x39')]);var _0x264bef={'where':_0x420e7e['where']};return db['ZohoConfiguration']['count'](_0x264bef)[_0x1389('0x1e')](function(_0x2cc3d4){_0x2583e7[_0x1389('0x17')]=_0x2cc3d4;if(_0x540dd0['query']['includeAll']){_0x420e7e[_0x1389('0x3a')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x1389('0x3b')](_0x420e7e);})[_0x1389('0x1e')](function(_0x414b44){_0x2583e7[_0x1389('0x3c')]=_0x414b44;return _0x2583e7;})['then'](respondWithFilteredResult(_0x3929a8,_0x420e7e))[_0x1389('0x3d')](handleError(_0x3929a8,null));};exports[_0x1389('0x3e')]=function(_0x4e8509,_0x131341){var _0x686b4c={'raw':![],'where':{'id':_0x4e8509[_0x1389('0x3f')]['id']}},_0x413e90={};_0x413e90[_0x1389('0x28')]=_[_0x1389('0x2a')](db[_0x1389('0x40')][_0x1389('0x25')]);_0x413e90[_0x1389('0x29')]=_['keys'](_0x4e8509[_0x1389('0x29')]);_0x413e90[_0x1389('0x2b')]=_[_0x1389('0x2c')](_0x413e90[_0x1389('0x28')],_0x413e90[_0x1389('0x29')]);_0x686b4c[_0x1389('0x2d')]=_['intersection'](_0x413e90[_0x1389('0x28')],qs['fields'](_0x4e8509['query']['fields']));_0x686b4c[_0x1389('0x2d')]=_0x686b4c[_0x1389('0x2d')]['length']?_0x686b4c[_0x1389('0x2d')]:_0x413e90[_0x1389('0x28')];if(_0x4e8509[_0x1389('0x29')][_0x1389('0x41')]){_0x686b4c[_0x1389('0x3a')]=[{'all':!![]}];}_0x686b4c=_[_0x1389('0x37')]({},_0x686b4c,_0x4e8509['options']);return db[_0x1389('0x40')][_0x1389('0x42')](_0x686b4c)[_0x1389('0x1e')](handleEntityNotFound(_0x131341,null))[_0x1389('0x1e')](respondWithResult(_0x131341,null))[_0x1389('0x3d')](handleError(_0x131341,null));};exports[_0x1389('0x43')]=function(_0x33c314,_0x4e3eff){return db[_0x1389('0x40')][_0x1389('0x43')](_0x33c314[_0x1389('0x44')],{})[_0x1389('0x1e')](respondWithResult(_0x4e3eff,0xc9))[_0x1389('0x3d')](handleError(_0x4e3eff,null));};exports[_0x1389('0x1d')]=function(_0x42ad96,_0x265031){if(_0x42ad96[_0x1389('0x44')]['id']){delete _0x42ad96[_0x1389('0x44')]['id'];}return db['ZohoConfiguration'][_0x1389('0x42')]({'where':{'id':_0x42ad96[_0x1389('0x3f')]['id']}})[_0x1389('0x1e')](handleEntityNotFound(_0x265031,null))[_0x1389('0x1e')](saveUpdates(_0x42ad96[_0x1389('0x44')],null))['then'](respondWithResult(_0x265031,null))['catch'](handleError(_0x265031,null));};exports['destroy']=function(_0x178288,_0x469a40){return db[_0x1389('0x40')][_0x1389('0x42')]({'where':{'id':_0x178288[_0x1389('0x3f')]['id']}})['then'](handleEntityNotFound(_0x469a40,null))[_0x1389('0x1e')](removeEntity(_0x469a40,null))[_0x1389('0x3d')](handleError(_0x469a40,null));};exports[_0x1389('0x45')]=function(_0x17ef1c,_0x121170,_0x4ec4d8){var _0x20fd86={};var _0x29594c={};var _0x3604b5;var _0x2455e2;return db[_0x1389('0x40')]['findOne']({'where':{'id':_0x17ef1c[_0x1389('0x3f')]['id']}})[_0x1389('0x1e')](handleEntityNotFound(_0x121170,null))['then'](function(_0x30a1bd){if(_0x30a1bd){_0x3604b5=_0x30a1bd;_0x29594c[_0x1389('0x28')]=_['keys'](db[_0x1389('0x46')]['rawAttributes']);_0x29594c[_0x1389('0x29')]=_[_0x1389('0x2a')](_0x17ef1c[_0x1389('0x29')]);_0x29594c[_0x1389('0x2b')]=_[_0x1389('0x2c')](_0x29594c[_0x1389('0x28')],_0x29594c[_0x1389('0x29')]);_0x20fd86[_0x1389('0x2d')]=_['intersection'](_0x29594c['model'],qs[_0x1389('0x2e')](_0x17ef1c['query'][_0x1389('0x2e')]));_0x20fd86[_0x1389('0x2d')]=_0x20fd86['attributes']['length']?_0x20fd86['attributes']:_0x29594c[_0x1389('0x28')];_0x20fd86[_0x1389('0x32')]=qs[_0x1389('0x33')](_0x17ef1c[_0x1389('0x29')][_0x1389('0x33')]);_0x20fd86[_0x1389('0x34')]=qs[_0x1389('0x2b')](_[_0x1389('0x35')](_0x17ef1c[_0x1389('0x29')],_0x29594c[_0x1389('0x2b')]));if(_0x17ef1c[_0x1389('0x29')][_0x1389('0x36')]){_0x20fd86[_0x1389('0x34')]=_[_0x1389('0x37')](_0x20fd86[_0x1389('0x34')],{'$or':_[_0x1389('0x24')](_0x20fd86[_0x1389('0x2d')],function(_0x472d84){var _0xd8ae23={};_0xd8ae23[_0x472d84]={'$like':'%'+_0x17ef1c['query'][_0x1389('0x36')]+'%'};return _0xd8ae23;})});}_0x20fd86=_['merge']({},_0x20fd86,_0x17ef1c['options']);return _0x3604b5[_0x1389('0x45')](_0x20fd86);}})[_0x1389('0x1e')](function(_0x3e45e3){if(_0x3e45e3){_0x2455e2=_0x3e45e3['length'];if(!_0x17ef1c['query'][_0x1389('0x30')]('nolimit')){_0x20fd86[_0x1389('0x16')]=qs[_0x1389('0x16')](_0x17ef1c['query'][_0x1389('0x16')]);_0x20fd86[_0x1389('0x15')]=qs['offset'](_0x17ef1c['query'][_0x1389('0x15')]);}return _0x3604b5['getFields'](_0x20fd86);}})[_0x1389('0x1e')](function(_0x3e8595){if(_0x3e8595){return _0x3e8595?{'count':_0x2455e2,'rows':_0x3e8595}:null;}})[_0x1389('0x1e')](respondWithResult(_0x121170,null))['catch'](handleError(_0x121170,null));};exports['getSubjects']=function(_0x491cd5,_0x2d4603,_0x256a42){var _0x51133b={};var _0x57cfbe={};var _0x5ae378;var _0xc72090;return db[_0x1389('0x40')]['findOne']({'where':{'id':_0x491cd5[_0x1389('0x3f')]['id']}})[_0x1389('0x1e')](handleEntityNotFound(_0x2d4603,null))[_0x1389('0x1e')](function(_0x3f3ce8){if(_0x3f3ce8){_0x5ae378=_0x3f3ce8;_0x57cfbe[_0x1389('0x28')]=_[_0x1389('0x2a')](db[_0x1389('0x46')]['rawAttributes']);_0x57cfbe[_0x1389('0x29')]=_['keys'](_0x491cd5[_0x1389('0x29')]);_0x57cfbe[_0x1389('0x2b')]=_[_0x1389('0x2c')](_0x57cfbe[_0x1389('0x28')],_0x57cfbe['query']);_0x51133b[_0x1389('0x2d')]=_[_0x1389('0x2c')](_0x57cfbe[_0x1389('0x28')],qs['fields'](_0x491cd5['query'][_0x1389('0x2e')]));_0x51133b[_0x1389('0x2d')]=_0x51133b[_0x1389('0x2d')][_0x1389('0x2f')]?_0x51133b[_0x1389('0x2d')]:_0x57cfbe['model'];_0x51133b[_0x1389('0x32')]=qs[_0x1389('0x33')](_0x491cd5[_0x1389('0x29')]['sort']);_0x51133b[_0x1389('0x34')]=qs[_0x1389('0x2b')](_[_0x1389('0x35')](_0x491cd5['query'],_0x57cfbe[_0x1389('0x2b')]));if(_0x491cd5[_0x1389('0x29')][_0x1389('0x36')]){_0x51133b['where']=_[_0x1389('0x37')](_0x51133b['where'],{'$or':_[_0x1389('0x24')](_0x51133b[_0x1389('0x2d')],function(_0x42e2d6){var _0x1f3a67={};_0x1f3a67[_0x42e2d6]={'$like':'%'+_0x491cd5[_0x1389('0x29')][_0x1389('0x36')]+'%'};return _0x1f3a67;})});}_0x51133b=_[_0x1389('0x37')]({},_0x51133b,_0x491cd5[_0x1389('0x39')]);return _0x5ae378[_0x1389('0x47')](_0x51133b);}})[_0x1389('0x1e')](function(_0x258700){if(_0x258700){_0xc72090=_0x258700['length'];if(!_0x491cd5['query']['hasOwnProperty'](_0x1389('0x31'))){_0x51133b[_0x1389('0x16')]=qs[_0x1389('0x16')](_0x491cd5['query'][_0x1389('0x16')]);_0x51133b['offset']=qs[_0x1389('0x15')](_0x491cd5['query'][_0x1389('0x15')]);}return _0x5ae378['getSubjects'](_0x51133b);}})[_0x1389('0x1e')](function(_0x15da73){if(_0x15da73){return _0x15da73?{'count':_0xc72090,'rows':_0x15da73}:null;}})[_0x1389('0x1e')](respondWithResult(_0x2d4603,null))['catch'](handleError(_0x2d4603,null));};exports[_0x1389('0x48')]=function(_0x3f5d33,_0x15b4c5,_0x3b3c8d){var _0x5cee8a={};var _0x12a48a={};var _0x5df797;var _0x3d4715;return db[_0x1389('0x40')][_0x1389('0x49')]({'where':{'id':_0x3f5d33[_0x1389('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15b4c5,null))[_0x1389('0x1e')](function(_0x282bc7){if(_0x282bc7){_0x5df797=_0x282bc7;_0x12a48a[_0x1389('0x28')]=_[_0x1389('0x2a')](db['ZohoField'][_0x1389('0x25')]);_0x12a48a[_0x1389('0x29')]=_['keys'](_0x3f5d33[_0x1389('0x29')]);_0x12a48a[_0x1389('0x2b')]=_['intersection'](_0x12a48a[_0x1389('0x28')],_0x12a48a[_0x1389('0x29')]);_0x5cee8a['attributes']=_['intersection'](_0x12a48a[_0x1389('0x28')],qs[_0x1389('0x2e')](_0x3f5d33[_0x1389('0x29')]['fields']));_0x5cee8a['attributes']=_0x5cee8a[_0x1389('0x2d')]['length']?_0x5cee8a['attributes']:_0x12a48a[_0x1389('0x28')];_0x5cee8a[_0x1389('0x32')]=qs[_0x1389('0x33')](_0x3f5d33[_0x1389('0x29')][_0x1389('0x33')]);_0x5cee8a[_0x1389('0x34')]=qs[_0x1389('0x2b')](_[_0x1389('0x35')](_0x3f5d33[_0x1389('0x29')],_0x12a48a['filters']));if(_0x3f5d33[_0x1389('0x29')][_0x1389('0x36')]){_0x5cee8a[_0x1389('0x34')]=_[_0x1389('0x37')](_0x5cee8a['where'],{'$or':_['map'](_0x5cee8a['attributes'],function(_0x8521be){var _0x47fbe2={};_0x47fbe2[_0x8521be]={'$like':'%'+_0x3f5d33['query'][_0x1389('0x36')]+'%'};return _0x47fbe2;})});}_0x5cee8a=_[_0x1389('0x37')]({},_0x5cee8a,_0x3f5d33[_0x1389('0x39')]);return _0x5df797[_0x1389('0x48')](_0x5cee8a);}})['then'](function(_0x515a09){if(_0x515a09){_0x3d4715=_0x515a09[_0x1389('0x2f')];if(!_0x3f5d33[_0x1389('0x29')][_0x1389('0x30')](_0x1389('0x31'))){_0x5cee8a[_0x1389('0x16')]=qs[_0x1389('0x16')](_0x3f5d33['query'][_0x1389('0x16')]);_0x5cee8a[_0x1389('0x15')]=qs['offset'](_0x3f5d33[_0x1389('0x29')][_0x1389('0x15')]);}return _0x5df797[_0x1389('0x48')](_0x5cee8a);}})['then'](function(_0x4fa7d3){if(_0x4fa7d3){return _0x4fa7d3?{'count':_0x3d4715,'rows':_0x4fa7d3}:null;}})[_0x1389('0x1e')](respondWithResult(_0x15b4c5,null))[_0x1389('0x3d')](handleError(_0x15b4c5,null));};
\ No newline at end of file
index d17b666..344d306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe20=['define','ZohoConfiguration','int_zoho_configurations','util','../../config/logger','api','moment','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x3e0e6c,_0x4757cd){var _0xad2be9=function(_0x366658){while(--_0x366658){_0x3e0e6c['push'](_0x3e0e6c['shift']());}};_0xad2be9(++_0x4757cd);}(_0xfe20,0xdf));var _0x0fe2=function(_0x486524,_0x3c066b){_0x486524=_0x486524-0x0;var _0x3ed508=_0xfe20[_0x486524];return _0x3ed508;};'use strict';var _=require('lodash');var util=require(_0x0fe2('0x0'));var logger=require(_0x0fe2('0x1'))(_0x0fe2('0x2'));var moment=require(_0x0fe2('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fe2('0x4'));var config=require(_0x0fe2('0x5'));var attributes=require(_0x0fe2('0x6'));module[_0x0fe2('0x7')]=function(_0x1b58c,_0x2e24cf){return _0x1b58c[_0x0fe2('0x8')](_0x0fe2('0x9'),attributes,{'tableName':_0x0fe2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa510=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','lodash','../../config/logger'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa510,0x1d7));var _0x0a51=function(_0x1ba269,_0x5acce4){_0x1ba269=_0x1ba269-0x0;var _0x34f6c6=_0xa510[_0x1ba269];return _0x34f6c6;};'use strict';var _=require(_0x0a51('0x0'));var util=require('util');var logger=require(_0x0a51('0x1'))(_0x0a51('0x2'));var moment=require(_0x0a51('0x3'));var BPromise=require(_0x0a51('0x4'));var rp=require(_0x0a51('0x5'));var fs=require('fs');var path=require(_0x0a51('0x6'));var rimraf=require(_0x0a51('0x7'));var config=require(_0x0a51('0x8'));var attributes=require(_0x0a51('0x9'));module['exports']=function(_0xbe8940,_0x41d912){return _0xbe8940['define'](_0x0a51('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f610abd..2187be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe949=['../../config/environment','jayson/promise','client','http','request','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe949,0x117));var _0x9e94=function(_0x867a3e,_0x496e41){_0x867a3e=_0x867a3e-0x0;var _0x56c5ae=_0xe949[_0x867a3e];return _0x56c5ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9e94('0x0'));var BPromise=require(_0x9e94('0x1'));var rs=require(_0x9e94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e94('0x3'))['db'];var utils=require(_0x9e94('0x4'));var logger=require(_0x9e94('0x5'))(_0x9e94('0x6'));var config=require(_0x9e94('0x7'));var jayson=require(_0x9e94('0x8'));var client=jayson[_0x9e94('0x9')][_0x9e94('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42277a,_0xaffc5c,_0x57729d){return new BPromise(function(_0x48b362,_0x37d8c1){return client[_0x9e94('0xb')](_0x42277a,_0x57729d)['then'](function(_0x4ee9af){logger['info'](_0x9e94('0xc'),_0xaffc5c,_0x9e94('0xd'));logger[_0x9e94('0xe')](_0x9e94('0xf'),_0xaffc5c,_0x9e94('0xd'),JSON[_0x9e94('0x10')](_0x4ee9af));if(_0x4ee9af[_0x9e94('0x11')]){if(_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x12')]===0x1f4){logger['error'](_0x9e94('0xc'),_0xaffc5c,_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);return _0x37d8c1(_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);}logger[_0x9e94('0x11')](_0x9e94('0xc'),_0xaffc5c,_0x4ee9af[_0x9e94('0x11')][_0x9e94('0x13')]);return _0x48b362(_0x4ee9af[_0x9e94('0x11')]['message']);}else{logger['info'](_0x9e94('0xc'),_0xaffc5c,_0x9e94('0xd'));_0x48b362(_0x4ee9af[_0x9e94('0x14')][_0x9e94('0x13')]);}})[_0x9e94('0x15')](function(_0x12ddf9){logger[_0x9e94('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0xaffc5c,_0x12ddf9);_0x37d8c1(_0x12ddf9);});});}
\ No newline at end of file
+var _0xdabb=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x48e51e,_0xd07468){var _0x1875ae=function(_0x3d4962){while(--_0x3d4962){_0x48e51e['push'](_0x48e51e['shift']());}};_0x1875ae(++_0xd07468);}(_0xdabb,0xa3));var _0xbdab=function(_0x460103,_0x5397b7){_0x460103=_0x460103-0x0;var _0x44499c=_0xdabb[_0x460103];return _0x44499c;};'use strict';var _=require('lodash');var util=require(_0xbdab('0x0'));var moment=require(_0xbdab('0x1'));var BPromise=require(_0xbdab('0x2'));var rs=require(_0xbdab('0x3'));var fs=require('fs');var Redis=require(_0xbdab('0x4'));var db=require(_0xbdab('0x5'))['db'];var utils=require(_0xbdab('0x6'));var logger=require('../../config/logger')(_0xbdab('0x7'));var config=require('../../config/environment');var jayson=require(_0xbdab('0x8'));var client=jayson[_0xbdab('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58c8c2,_0x1c5233,_0x1980bd){return new BPromise(function(_0x1202f0,_0x5612c1){return client['request'](_0x58c8c2,_0x1980bd)[_0xbdab('0xa')](function(_0x4fc82c){logger[_0xbdab('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x1c5233,_0xbdab('0xc'));logger[_0xbdab('0xd')](_0xbdab('0xe'),_0x1c5233,'request\x20sent',JSON[_0xbdab('0xf')](_0x4fc82c));if(_0x4fc82c[_0xbdab('0x10')]){if(_0x4fc82c[_0xbdab('0x10')][_0xbdab('0x11')]===0x1f4){logger[_0xbdab('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x1c5233,_0x4fc82c[_0xbdab('0x10')]['message']);return _0x5612c1(_0x4fc82c[_0xbdab('0x10')][_0xbdab('0x12')]);}logger[_0xbdab('0x10')](_0xbdab('0x13'),_0x1c5233,_0x4fc82c[_0xbdab('0x10')]['message']);return _0x1202f0(_0x4fc82c['error']['message']);}else{logger[_0xbdab('0xb')](_0xbdab('0x13'),_0x1c5233,_0xbdab('0xc'));_0x1202f0(_0x4fc82c[_0xbdab('0x14')][_0xbdab('0x12')]);}})['catch'](function(_0x38d24d){logger[_0xbdab('0x10')](_0xbdab('0x13'),_0x1c5233,_0x38d24d);_0x5612c1(_0x38d24d);});});}
\ No newline at end of file
index addf36c..fd38e9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e4e=['Router','../../components/auth/service','../../config/environment','./intZohoField.controller','isAuthenticated','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38046c,_0x5afd67){var _0x4c77b2=function(_0x17d1a3){while(--_0x17d1a3){_0x38046c['push'](_0x38046c['shift']());}};_0x4c77b2(++_0x5afd67);}(_0x5e4e,0x17c));var _0xe5e4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5e4e[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xe5e4('0x0'));var util=require(_0xe5e4('0x1'));var path=require(_0xe5e4('0x2'));var timeout=require(_0xe5e4('0x3'));var express=require('express');var router=express[_0xe5e4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe5e4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e4('0x6'));var controller=require(_0xe5e4('0x7'));router['get']('/',auth[_0xe5e4('0x8')](),controller['index']);router['get'](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xa')]);router['post']('/',auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xb')]);router[_0xe5e4('0xc')](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller['update']);router[_0xe5e4('0xd')](_0xe5e4('0x9'),auth[_0xe5e4('0x8')](),controller[_0xe5e4('0xe')]);module[_0xe5e4('0xf')]=router;
\ No newline at end of file
+var _0xee9f=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0xee9f,0x77));var _0xfee9=function(_0x5741ae,_0x50be9a){_0x5741ae=_0x5741ae-0x0;var _0x2cea3b=_0xee9f[_0x5741ae];return _0x2cea3b;};'use strict';var multer=require(_0xfee9('0x0'));var util=require(_0xfee9('0x1'));var path=require(_0xfee9('0x2'));var timeout=require(_0xfee9('0x3'));var express=require(_0xfee9('0x4'));var router=express['Router']();var fs_extra=require(_0xfee9('0x5'));var auth=require(_0xfee9('0x6'));var interaction=require(_0xfee9('0x7'));var config=require(_0xfee9('0x8'));var controller=require('./intZohoField.controller');router['get']('/',auth[_0xfee9('0x9')](),controller['index']);router[_0xfee9('0xa')](_0xfee9('0xb'),auth[_0xfee9('0x9')](),controller[_0xfee9('0xc')]);router[_0xfee9('0xd')]('/',auth[_0xfee9('0x9')](),controller[_0xfee9('0xe')]);router[_0xfee9('0xf')](_0xfee9('0xb'),auth['isAuthenticated'](),controller[_0xfee9('0x10')]);router[_0xfee9('0x11')](_0xfee9('0xb'),auth[_0xfee9('0x9')](),controller['destroy']);module[_0xfee9('0x12')]=router;
\ No newline at end of file
index 66a610d..28698e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de9=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x26dd29,_0xc2b1ac){var _0x4431c5=function(_0x360a77){while(--_0x360a77){_0x26dd29['push'](_0x26dd29['shift']());}};_0x4431c5(++_0xc2b1ac);}(_0x4de9,0x79));var _0x94de=function(_0xd8aad0,_0x4da2cd){_0xd8aad0=_0xd8aad0-0x0;var _0x570860=_0x4de9[_0xd8aad0];return _0x570860;};'use strict';var Sequelize=require(_0x94de('0x0'));module[_0x94de('0x1')]={'type':{'type':Sequelize['ENUM'](_0x94de('0x2'),_0x94de('0x3'),'customVariable',_0x94de('0x4'),_0x94de('0x5')),'defaultValue':_0x94de('0x2')},'content':{'type':Sequelize[_0x94de('0x6')]},'key':{'type':Sequelize[_0x94de('0x6')]},'keyType':{'type':Sequelize[_0x94de('0x7')]('string','variable',_0x94de('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x94de('0x6')]},'nameField':{'type':Sequelize[_0x94de('0x6')]},'customField':{'type':Sequelize[_0x94de('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x94de('0x6')]}};
\ No newline at end of file
+var _0x4ee0=['variable','exports','ENUM','string','customVariable','picklist','STRING'];(function(_0x120d51,_0x3fbb18){var _0x26126e=function(_0xd02ff7){while(--_0xd02ff7){_0x120d51['push'](_0x120d51['shift']());}};_0x26126e(++_0x3fbb18);}(_0x4ee0,0x8d));var _0x04ee=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x4ee0[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module[_0x04ee('0x0')]={'type':{'type':Sequelize[_0x04ee('0x1')](_0x04ee('0x2'),'variable',_0x04ee('0x3'),'keyValue',_0x04ee('0x4')),'defaultValue':_0x04ee('0x2')},'content':{'type':Sequelize[_0x04ee('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x04ee('0x2'),_0x04ee('0x6'),_0x04ee('0x3'))},'keyContent':{'type':Sequelize[_0x04ee('0x5')]},'idField':{'type':Sequelize[_0x04ee('0x5')]},'nameField':{'type':Sequelize[_0x04ee('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x04ee('0x5')]}};
\ No newline at end of file
index 0a8864e..791cdf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58d2=['json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','ZohoField','includeAll','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status'];(function(_0xd0de50,_0x2cd601){var _0x4d0c8a=function(_0x45847c){while(--_0x45847c){_0xd0de50['push'](_0xd0de50['shift']());}};_0x4d0c8a(++_0x2cd601);}(_0x58d2,0xcb));var _0x258d=function(_0x40eb1c,_0x5bbf43){_0x40eb1c=_0x40eb1c-0x0;var _0x15ec71=_0x58d2[_0x40eb1c];return _0x15ec71;};'use strict';var emlformat=require(_0x258d('0x0'));var rimraf=require(_0x258d('0x1'));var zipdir=require(_0x258d('0x2'));var jsonpatch=require(_0x258d('0x3'));var rp=require(_0x258d('0x4'));var moment=require(_0x258d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x258d('0x6'));var util=require(_0x258d('0x7'));var path=require('path');var sox=require(_0x258d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x258d('0x9'));var _=require(_0x258d('0xa'));var squel=require(_0x258d('0xb'));var crypto=require(_0x258d('0xc'));var jsforce=require(_0x258d('0xd'));var deskjs=require(_0x258d('0xe'));var toCsv=require(_0x258d('0xf'));var querystring=require(_0x258d('0x10'));var Papa=require(_0x258d('0x11'));var Redis=require('ioredis');var authService=require(_0x258d('0x12'));var qs=require(_0x258d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258d('0x14'));var logger=require(_0x258d('0x15'))(_0x258d('0x16'));var utils=require('../../config/utils');var config=require(_0x258d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x60869c,_0x48966e){_0x48966e=_0x48966e||0xcc;return function(_0x3225e8){if(_0x3225e8){return _0x60869c['sendStatus'](_0x48966e);}return _0x60869c[_0x258d('0x18')](_0x48966e)['end']();};}function respondWithResult(_0x7759f0,_0x2f8e69){_0x2f8e69=_0x2f8e69||0xc8;return function(_0x58dd76){if(_0x58dd76){return _0x7759f0[_0x258d('0x18')](_0x2f8e69)[_0x258d('0x19')](_0x58dd76);}};}function respondWithFilteredResult(_0x2ef99f,_0x184b83){return function(_0x1c6f31){if(_0x1c6f31){var _0x19d952=typeof _0x184b83[_0x258d('0x1a')]==='undefined'&&typeof _0x184b83[_0x258d('0x1b')]===_0x258d('0x1c');var _0x5183af=_0x1c6f31[_0x258d('0x1d')];var _0x8a3ad6=_0x19d952?0x0:_0x184b83[_0x258d('0x1a')];var _0x21f1b6=_0x19d952?_0x1c6f31[_0x258d('0x1d')]:_0x184b83['offset']+_0x184b83['limit'];var _0x543d02;if(_0x21f1b6>=_0x5183af){_0x21f1b6=_0x5183af;_0x543d02=0xc8;}else{_0x543d02=0xce;}_0x2ef99f['status'](_0x543d02);return _0x2ef99f[_0x258d('0x1e')]('Content-Range',_0x8a3ad6+'-'+_0x21f1b6+'/'+_0x5183af)[_0x258d('0x19')](_0x1c6f31);}return null;};}function patchUpdates(_0x318af0){return function(_0x4cb148){try{jsonpatch[_0x258d('0x1f')](_0x4cb148,_0x318af0,!![]);}catch(_0x46266a){return BPromise[_0x258d('0x20')](_0x46266a);}return _0x4cb148[_0x258d('0x21')]();};}function saveUpdates(_0x2dadb9,_0x1fd7aa){return function(_0x1d3945){if(_0x1d3945){return _0x1d3945[_0x258d('0x22')](_0x2dadb9)[_0x258d('0x23')](function(_0x448955){return _0x448955;});}return null;};}function removeEntity(_0x39a242,_0x5929e0){return function(_0x19ded2){if(_0x19ded2){return _0x19ded2[_0x258d('0x24')]()[_0x258d('0x23')](function(){_0x39a242[_0x258d('0x18')](0xcc)[_0x258d('0x25')]();});}};}function handleEntityNotFound(_0x29bbc9,_0x4d0a68){return function(_0x13be62){if(!_0x13be62){_0x29bbc9[_0x258d('0x26')](0x194);}return _0x13be62;};}function handleError(_0x23ba4d,_0x5701b8){_0x5701b8=_0x5701b8||0x1f4;return function(_0x15341d){logger[_0x258d('0x27')](_0x15341d[_0x258d('0x28')]);if(_0x15341d[_0x258d('0x29')]){delete _0x15341d[_0x258d('0x29')];}_0x23ba4d[_0x258d('0x18')](_0x5701b8)[_0x258d('0x2a')](_0x15341d);};}exports[_0x258d('0x2b')]=function(_0x81a125,_0x149c5c){var _0x5cb70c={},_0x3c172b={},_0x4862cb={'count':0x0,'rows':[]};var _0x32d08d=_[_0x258d('0x2c')](db['ZohoField'][_0x258d('0x2d')],function(_0x5e86fd){return{'name':_0x5e86fd[_0x258d('0x2e')],'type':_0x5e86fd[_0x258d('0x2f')][_0x258d('0x30')]};});_0x3c172b['model']=_[_0x258d('0x2c')](_0x32d08d,'name');_0x3c172b[_0x258d('0x31')]=_[_0x258d('0x32')](_0x81a125['query']);_0x3c172b[_0x258d('0x33')]=_[_0x258d('0x34')](_0x3c172b[_0x258d('0x35')],_0x3c172b['query']);_0x5cb70c[_0x258d('0x36')]=_[_0x258d('0x34')](_0x3c172b[_0x258d('0x35')],qs[_0x258d('0x37')](_0x81a125[_0x258d('0x31')][_0x258d('0x37')]));_0x5cb70c[_0x258d('0x36')]=_0x5cb70c[_0x258d('0x36')][_0x258d('0x38')]?_0x5cb70c[_0x258d('0x36')]:_0x3c172b[_0x258d('0x35')];if(!_0x81a125[_0x258d('0x31')][_0x258d('0x39')](_0x258d('0x3a'))){_0x5cb70c['limit']=qs[_0x258d('0x1b')](_0x81a125[_0x258d('0x31')][_0x258d('0x1b')]);_0x5cb70c['offset']=qs['offset'](_0x81a125[_0x258d('0x31')][_0x258d('0x1a')]);}_0x5cb70c[_0x258d('0x3b')]=qs[_0x258d('0x3c')](_0x81a125[_0x258d('0x31')][_0x258d('0x3c')]);_0x5cb70c[_0x258d('0x3d')]=qs[_0x258d('0x33')](_['pick'](_0x81a125[_0x258d('0x31')],_0x3c172b['filters']),_0x32d08d);if(_0x81a125[_0x258d('0x31')]['filter']){_0x5cb70c[_0x258d('0x3d')]=_[_0x258d('0x3e')](_0x5cb70c[_0x258d('0x3d')],{'$or':_[_0x258d('0x2c')](_0x32d08d,function(_0x114c5c){if(_0x114c5c[_0x258d('0x2f')]!==_0x258d('0x3f')){var _0x32bf4b={};_0x32bf4b[_0x114c5c['name']]={'$like':'%'+_0x81a125[_0x258d('0x31')][_0x258d('0x40')]+'%'};return _0x32bf4b;}})});}_0x5cb70c=_['merge']({},_0x5cb70c,_0x81a125[_0x258d('0x41')]);var _0x217b57={'where':_0x5cb70c[_0x258d('0x3d')]};return db[_0x258d('0x42')]['count'](_0x217b57)[_0x258d('0x23')](function(_0x5611fc){_0x4862cb[_0x258d('0x1d')]=_0x5611fc;if(_0x81a125[_0x258d('0x31')][_0x258d('0x43')]){_0x5cb70c['include']=[{'all':!![]}];}return db['ZohoField'][_0x258d('0x44')](_0x5cb70c);})[_0x258d('0x23')](function(_0x37df23){_0x4862cb[_0x258d('0x45')]=_0x37df23;return _0x4862cb;})['then'](respondWithFilteredResult(_0x149c5c,_0x5cb70c))[_0x258d('0x46')](handleError(_0x149c5c,null));};exports[_0x258d('0x47')]=function(_0x57e468,_0x226592){var _0x2b13e2={'raw':!![],'where':{'id':_0x57e468['params']['id']}},_0x49904f={};_0x49904f[_0x258d('0x35')]=_['keys'](db[_0x258d('0x42')][_0x258d('0x2d')]);_0x49904f[_0x258d('0x31')]=_[_0x258d('0x32')](_0x57e468['query']);_0x49904f[_0x258d('0x33')]=_['intersection'](_0x49904f[_0x258d('0x35')],_0x49904f[_0x258d('0x31')]);_0x2b13e2['attributes']=_['intersection'](_0x49904f['model'],qs[_0x258d('0x37')](_0x57e468[_0x258d('0x31')][_0x258d('0x37')]));_0x2b13e2[_0x258d('0x36')]=_0x2b13e2[_0x258d('0x36')][_0x258d('0x38')]?_0x2b13e2[_0x258d('0x36')]:_0x49904f[_0x258d('0x35')];if(_0x57e468[_0x258d('0x31')][_0x258d('0x43')]){_0x2b13e2['include']=[{'all':!![]}];}_0x2b13e2=_[_0x258d('0x3e')]({},_0x2b13e2,_0x57e468['options']);return db[_0x258d('0x42')][_0x258d('0x48')](_0x2b13e2)[_0x258d('0x23')](handleEntityNotFound(_0x226592,null))[_0x258d('0x23')](respondWithResult(_0x226592,null))['catch'](handleError(_0x226592,null));};exports[_0x258d('0x49')]=function(_0x5b6178,_0x51a245){return db[_0x258d('0x42')][_0x258d('0x49')](_0x5b6178['body'],{})['then'](respondWithResult(_0x51a245,0xc9))[_0x258d('0x46')](handleError(_0x51a245,null));};exports[_0x258d('0x22')]=function(_0x4e3f42,_0x43ad5f){if(_0x4e3f42[_0x258d('0x4a')]['id']){delete _0x4e3f42[_0x258d('0x4a')]['id'];}return db[_0x258d('0x42')][_0x258d('0x48')]({'where':{'id':_0x4e3f42[_0x258d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43ad5f,null))['then'](saveUpdates(_0x4e3f42[_0x258d('0x4a')],null))[_0x258d('0x23')](respondWithResult(_0x43ad5f,null))[_0x258d('0x46')](handleError(_0x43ad5f,null));};exports['destroy']=function(_0x4fa40f,_0x2177df){return db[_0x258d('0x42')]['find']({'where':{'id':_0x4fa40f[_0x258d('0x4b')]['id']}})[_0x258d('0x23')](handleEntityNotFound(_0x2177df,null))[_0x258d('0x23')](removeEntity(_0x2177df,null))['catch'](handleError(_0x2177df,null));};
\ No newline at end of file
+var _0xcc97=['undefined','count','apply','reject','save','update','then','destroy','error','send','index','ZohoField','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','name','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x4a22dd,_0x5a8af8){var _0x38186a=function(_0x2e59d5){while(--_0x2e59d5){_0x4a22dd['push'](_0x4a22dd['shift']());}};_0x38186a(++_0x5a8af8);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x5ad853,_0x223735){_0x5ad853=_0x5ad853-0x0;var _0x4332f9=_0xcc97[_0x5ad853];return _0x4332f9;};'use strict';var emlformat=require(_0x7cc9('0x0'));var rimraf=require(_0x7cc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cc9('0x2'));var rp=require(_0x7cc9('0x3'));var moment=require(_0x7cc9('0x4'));var BPromise=require(_0x7cc9('0x5'));var Mustache=require(_0x7cc9('0x6'));var util=require(_0x7cc9('0x7'));var path=require(_0x7cc9('0x8'));var sox=require(_0x7cc9('0x9'));var csv=require(_0x7cc9('0xa'));var ejs=require(_0x7cc9('0xb'));var fs=require('fs');var fs_extra=require(_0x7cc9('0xc'));var _=require('lodash');var squel=require(_0x7cc9('0xd'));var crypto=require(_0x7cc9('0xe'));var jsforce=require(_0x7cc9('0xf'));var deskjs=require(_0x7cc9('0x10'));var toCsv=require(_0x7cc9('0xa'));var querystring=require('querystring');var Papa=require(_0x7cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x7cc9('0x12'));var qs=require(_0x7cc9('0x13'));var as=require(_0x7cc9('0x14'));var hardwareService=require(_0x7cc9('0x15'));var logger=require(_0x7cc9('0x16'))(_0x7cc9('0x17'));var utils=require(_0x7cc9('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7cc9('0x19'))['db'];function respondWithStatusCode(_0x57f9ca,_0x1a2d7c){_0x1a2d7c=_0x1a2d7c||0xcc;return function(_0x48373e){if(_0x48373e){return _0x57f9ca[_0x7cc9('0x1a')](_0x1a2d7c);}return _0x57f9ca[_0x7cc9('0x1b')](_0x1a2d7c)[_0x7cc9('0x1c')]();};}function respondWithResult(_0x5af6eb,_0x3daec7){_0x3daec7=_0x3daec7||0xc8;return function(_0x48694e){if(_0x48694e){return _0x5af6eb['status'](_0x3daec7)[_0x7cc9('0x1d')](_0x48694e);}};}function respondWithFilteredResult(_0x1205a2,_0x37ff7f){return function(_0x43a644){if(_0x43a644){var _0x4f0e10=typeof _0x37ff7f[_0x7cc9('0x1e')]==='undefined'&&typeof _0x37ff7f[_0x7cc9('0x1f')]===_0x7cc9('0x20');var _0xce7e46=_0x43a644[_0x7cc9('0x21')];var _0x317ec4=_0x4f0e10?0x0:_0x37ff7f[_0x7cc9('0x1e')];var _0x50a252=_0x4f0e10?_0x43a644[_0x7cc9('0x21')]:_0x37ff7f[_0x7cc9('0x1e')]+_0x37ff7f[_0x7cc9('0x1f')];var _0x275128;if(_0x50a252>=_0xce7e46){_0x50a252=_0xce7e46;_0x275128=0xc8;}else{_0x275128=0xce;}_0x1205a2['status'](_0x275128);return _0x1205a2['set']('Content-Range',_0x317ec4+'-'+_0x50a252+'/'+_0xce7e46)[_0x7cc9('0x1d')](_0x43a644);}return null;};}function patchUpdates(_0x5926de){return function(_0x2ef126){try{jsonpatch[_0x7cc9('0x22')](_0x2ef126,_0x5926de,!![]);}catch(_0x4a07a0){return BPromise[_0x7cc9('0x23')](_0x4a07a0);}return _0x2ef126[_0x7cc9('0x24')]();};}function saveUpdates(_0x3d5e69,_0x3248dd){return function(_0x9b148e){if(_0x9b148e){return _0x9b148e[_0x7cc9('0x25')](_0x3d5e69)[_0x7cc9('0x26')](function(_0xec018d){return _0xec018d;});}return null;};}function removeEntity(_0x359de8,_0x113e6b){return function(_0xa0eee6){if(_0xa0eee6){return _0xa0eee6[_0x7cc9('0x27')]()[_0x7cc9('0x26')](function(){_0x359de8[_0x7cc9('0x1b')](0xcc)[_0x7cc9('0x1c')]();});}};}function handleEntityNotFound(_0x5ad481,_0x1013c1){return function(_0x47f514){if(!_0x47f514){_0x5ad481[_0x7cc9('0x1a')](0x194);}return _0x47f514;};}function handleError(_0x16db58,_0x473e98){_0x473e98=_0x473e98||0x1f4;return function(_0x4f6d59){logger[_0x7cc9('0x28')](_0x4f6d59['stack']);if(_0x4f6d59['name']){delete _0x4f6d59['name'];}_0x16db58[_0x7cc9('0x1b')](_0x473e98)[_0x7cc9('0x29')](_0x4f6d59);};}exports[_0x7cc9('0x2a')]=function(_0x2273b8,_0x3a7388){var _0x527b75={},_0x5ba534={},_0x5a3f15={'count':0x0,'rows':[]};var _0xe5f171=_['map'](db[_0x7cc9('0x2b')][_0x7cc9('0x2c')],function(_0x43ff29){return{'name':_0x43ff29[_0x7cc9('0x2d')],'type':_0x43ff29[_0x7cc9('0x2e')]['key']};});_0x5ba534['model']=_[_0x7cc9('0x2f')](_0xe5f171,'name');_0x5ba534[_0x7cc9('0x30')]=_['keys'](_0x2273b8[_0x7cc9('0x30')]);_0x5ba534[_0x7cc9('0x31')]=_[_0x7cc9('0x32')](_0x5ba534[_0x7cc9('0x33')],_0x5ba534['query']);_0x527b75[_0x7cc9('0x34')]=_[_0x7cc9('0x32')](_0x5ba534[_0x7cc9('0x33')],qs[_0x7cc9('0x35')](_0x2273b8[_0x7cc9('0x30')]['fields']));_0x527b75['attributes']=_0x527b75[_0x7cc9('0x34')][_0x7cc9('0x36')]?_0x527b75['attributes']:_0x5ba534[_0x7cc9('0x33')];if(!_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x37')](_0x7cc9('0x38'))){_0x527b75[_0x7cc9('0x1f')]=qs[_0x7cc9('0x1f')](_0x2273b8[_0x7cc9('0x30')]['limit']);_0x527b75[_0x7cc9('0x1e')]=qs[_0x7cc9('0x1e')](_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x1e')]);}_0x527b75['order']=qs['sort'](_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x39')]);_0x527b75[_0x7cc9('0x3a')]=qs[_0x7cc9('0x31')](_[_0x7cc9('0x3b')](_0x2273b8[_0x7cc9('0x30')],_0x5ba534[_0x7cc9('0x31')]),_0xe5f171);if(_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x3c')]){_0x527b75[_0x7cc9('0x3a')]=_['merge'](_0x527b75[_0x7cc9('0x3a')],{'$or':_[_0x7cc9('0x2f')](_0xe5f171,function(_0x74e262){if(_0x74e262['type']!==_0x7cc9('0x3d')){var _0x4d5f93={};_0x4d5f93[_0x74e262[_0x7cc9('0x3e')]]={'$like':'%'+_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x3c')]+'%'};return _0x4d5f93;}})});}_0x527b75=_[_0x7cc9('0x3f')]({},_0x527b75,_0x2273b8['options']);var _0x9742a6={'where':_0x527b75[_0x7cc9('0x3a')]};return db['ZohoField']['count'](_0x9742a6)['then'](function(_0x1f8107){_0x5a3f15['count']=_0x1f8107;if(_0x2273b8[_0x7cc9('0x30')][_0x7cc9('0x40')]){_0x527b75[_0x7cc9('0x41')]=[{'all':!![]}];}return db[_0x7cc9('0x2b')][_0x7cc9('0x42')](_0x527b75);})[_0x7cc9('0x26')](function(_0x11f16c){_0x5a3f15[_0x7cc9('0x43')]=_0x11f16c;return _0x5a3f15;})[_0x7cc9('0x26')](respondWithFilteredResult(_0x3a7388,_0x527b75))[_0x7cc9('0x44')](handleError(_0x3a7388,null));};exports[_0x7cc9('0x45')]=function(_0x2aadf1,_0x3c48f0){var _0x1fefde={'raw':!![],'where':{'id':_0x2aadf1[_0x7cc9('0x46')]['id']}},_0x1981a1={};_0x1981a1[_0x7cc9('0x33')]=_['keys'](db[_0x7cc9('0x2b')][_0x7cc9('0x2c')]);_0x1981a1[_0x7cc9('0x30')]=_[_0x7cc9('0x47')](_0x2aadf1[_0x7cc9('0x30')]);_0x1981a1['filters']=_['intersection'](_0x1981a1[_0x7cc9('0x33')],_0x1981a1['query']);_0x1fefde['attributes']=_['intersection'](_0x1981a1[_0x7cc9('0x33')],qs[_0x7cc9('0x35')](_0x2aadf1[_0x7cc9('0x30')][_0x7cc9('0x35')]));_0x1fefde[_0x7cc9('0x34')]=_0x1fefde['attributes']['length']?_0x1fefde[_0x7cc9('0x34')]:_0x1981a1[_0x7cc9('0x33')];if(_0x2aadf1[_0x7cc9('0x30')][_0x7cc9('0x40')]){_0x1fefde[_0x7cc9('0x41')]=[{'all':!![]}];}_0x1fefde=_[_0x7cc9('0x3f')]({},_0x1fefde,_0x2aadf1[_0x7cc9('0x48')]);return db['ZohoField'][_0x7cc9('0x49')](_0x1fefde)['then'](handleEntityNotFound(_0x3c48f0,null))['then'](respondWithResult(_0x3c48f0,null))[_0x7cc9('0x44')](handleError(_0x3c48f0,null));};exports['create']=function(_0x4328a0,_0xddc4ae){return db[_0x7cc9('0x2b')][_0x7cc9('0x4a')](_0x4328a0[_0x7cc9('0x4b')],{})['then'](respondWithResult(_0xddc4ae,0xc9))['catch'](handleError(_0xddc4ae,null));};exports['update']=function(_0x29a143,_0x2f5250){if(_0x29a143[_0x7cc9('0x4b')]['id']){delete _0x29a143['body']['id'];}return db[_0x7cc9('0x2b')][_0x7cc9('0x49')]({'where':{'id':_0x29a143[_0x7cc9('0x46')]['id']}})[_0x7cc9('0x26')](handleEntityNotFound(_0x2f5250,null))[_0x7cc9('0x26')](saveUpdates(_0x29a143['body'],null))[_0x7cc9('0x26')](respondWithResult(_0x2f5250,null))[_0x7cc9('0x44')](handleError(_0x2f5250,null));};exports[_0x7cc9('0x27')]=function(_0x2458c0,_0x5146a7){return db[_0x7cc9('0x2b')][_0x7cc9('0x49')]({'where':{'id':_0x2458c0[_0x7cc9('0x46')]['id']}})['then'](handleEntityNotFound(_0x5146a7,null))['then'](removeEntity(_0x5146a7,null))[_0x7cc9('0x44')](handleError(_0x5146a7,null));};
\ No newline at end of file
index dcfb822..fc62da9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','bluebird','request-promise','path'];(function(_0x5af0bd,_0x5d6806){var _0x2ebe5b=function(_0x442064){while(--_0x442064){_0x5af0bd['push'](_0x5af0bd['shift']());}};_0x2ebe5b(++_0x5d6806);}(_0x71ab,0x64));var _0xb71a=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x71ab[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xd'),_0xb71a('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x8aad,0x146));var _0xd8aa=function(_0x31bc74,_0x3f754f){_0x31bc74=_0x31bc74-0x0;var _0x30adb4=_0x8aad[_0x31bc74];return _0x30adb4;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0f9c014..862cc2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe72c=['../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe72c,0x14b));var _0xce72=function(_0x205b2d,_0x5c4047){_0x205b2d=_0x205b2d-0x0;var _0x8bccfa=_0xe72c[_0x205b2d];return _0x8bccfa;};'use strict';var _=require(_0xce72('0x0'));var util=require(_0xce72('0x1'));var moment=require(_0xce72('0x2'));var BPromise=require('bluebird');var rs=require(_0xce72('0x3'));var fs=require('fs');var Redis=require(_0xce72('0x4'));var db=require(_0xce72('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xce72('0x6'));var jayson=require(_0xce72('0x7'));var client=jayson['client'][_0xce72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18b468,_0x37dcac,_0x1a9cfe){return new BPromise(function(_0x28d627,_0x144017){return client[_0xce72('0x9')](_0x18b468,_0x1a9cfe)[_0xce72('0xa')](function(_0x9c3a35){logger[_0xce72('0xb')](_0xce72('0xc'),_0x37dcac,'request\x20sent');logger['debug'](_0xce72('0xd'),_0x37dcac,_0xce72('0xe'),JSON[_0xce72('0xf')](_0x9c3a35));if(_0x9c3a35['error']){if(_0x9c3a35[_0xce72('0x10')][_0xce72('0x11')]===0x1f4){logger[_0xce72('0x10')](_0xce72('0xc'),_0x37dcac,_0x9c3a35['error'][_0xce72('0x12')]);return _0x144017(_0x9c3a35['error'][_0xce72('0x12')]);}logger[_0xce72('0x10')](_0xce72('0xc'),_0x37dcac,_0x9c3a35['error'][_0xce72('0x12')]);return _0x28d627(_0x9c3a35[_0xce72('0x10')][_0xce72('0x12')]);}else{logger[_0xce72('0xb')](_0xce72('0xc'),_0x37dcac,'request\x20sent');_0x28d627(_0x9c3a35[_0xce72('0x13')][_0xce72('0x12')]);}})[_0xce72('0x14')](function(_0x1861e3){logger['error'](_0xce72('0xc'),_0x37dcac,_0x1861e3);_0x144017(_0x1861e3);});});}
\ No newline at end of file
+var _0x43bf=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x43bf,0x179));var _0xf43b=function(_0x42e33c,_0x361d56){_0x42e33c=_0x42e33c-0x0;var _0x3a41d3=_0x43bf[_0x42e33c];return _0x3a41d3;};'use strict';var _=require(_0xf43b('0x0'));var util=require(_0xf43b('0x1'));var moment=require(_0xf43b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf43b('0x3'));var fs=require('fs');var Redis=require(_0xf43b('0x4'));var db=require(_0xf43b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf43b('0x6'))('rpc');var config=require(_0xf43b('0x7'));var jayson=require(_0xf43b('0x8'));var client=jayson[_0xf43b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4667d7,_0x1e3fb9,_0x312aac){return new BPromise(function(_0x52c481,_0x21b710){return client[_0xf43b('0xa')](_0x4667d7,_0x312aac)[_0xf43b('0xb')](function(_0x3edcd4){logger[_0xf43b('0xc')](_0xf43b('0xd'),_0x1e3fb9,_0xf43b('0xe'));logger[_0xf43b('0xf')](_0xf43b('0x10'),_0x1e3fb9,'request\x20sent',JSON[_0xf43b('0x11')](_0x3edcd4));if(_0x3edcd4['error']){if(_0x3edcd4[_0xf43b('0x12')][_0xf43b('0x13')]===0x1f4){logger[_0xf43b('0x12')](_0xf43b('0xd'),_0x1e3fb9,_0x3edcd4[_0xf43b('0x12')][_0xf43b('0x14')]);return _0x21b710(_0x3edcd4['error'][_0xf43b('0x14')]);}logger[_0xf43b('0x12')]('ZohoField,\x20%s,\x20%s',_0x1e3fb9,_0x3edcd4[_0xf43b('0x12')][_0xf43b('0x14')]);return _0x52c481(_0x3edcd4['error']['message']);}else{logger[_0xf43b('0xc')](_0xf43b('0xd'),_0x1e3fb9,_0xf43b('0xe'));_0x52c481(_0x3edcd4['result'][_0xf43b('0x14')]);}})['catch'](function(_0x5592b5){logger['error'](_0xf43b('0xd'),_0x1e3fb9,_0x5592b5);_0x21b710(_0x5592b5);});});}
\ No newline at end of file
index 0bdce92..be924e2 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(_0x2cbb42,_0x5862e8){var _0x1d4266=function(_0x16d166){while(--_0x16d166){_0x2cbb42['push'](_0x2cbb42['shift']());}};_0x1d4266(++_0x5862e8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x333647,_0x4c5e96){var _0x3dbd6d=function(_0x59c93e){while(--_0x59c93e){_0x333647['push'](_0x333647['shift']());}};_0x3dbd6d(++_0x4c5e96);}(_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 a8be31f..94c0602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0da2=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x289388,_0x4f66f2){var _0x27ac65=function(_0x1d78a1){while(--_0x1d78a1){_0x289388['push'](_0x289388['shift']());}};_0x27ac65(++_0x4f66f2);}(_0x0da2,0x85));var _0x20da=function(_0x257bb3,_0x3f2c30){_0x257bb3=_0x257bb3-0x0;var _0x288002=_0x0da2[_0x257bb3];return _0x288002;};'use strict';var Sequelize=require(_0x20da('0x0'));module[_0x20da('0x1')]={'name':{'type':Sequelize[_0x20da('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x20da('0x2')],'allowNull':![],'unique':_0x20da('0x3')},'main':{'type':Sequelize[_0x20da('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x20da('0x2')]},'path':{'type':Sequelize[_0x20da('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x20da('0x4')]},'active':{'type':Sequelize[_0x20da('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x20da('0x2')]},'logo':{'type':Sequelize[_0x20da('0x2')]},'state':{'type':Sequelize[_0x20da('0x2')],'unique':_0x20da('0x6')},'description':{'type':Sequelize[_0x20da('0x2')]},'title':{'type':Sequelize[_0x20da('0x2')]},'remoteUri':{'type':Sequelize[_0x20da('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0x556d=['INTEGER','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x447ec1,_0x3278e2){var _0x3a0542=function(_0x5e6988){while(--_0x5e6988){_0x447ec1['push'](_0x447ec1['shift']());}};_0x3a0542(++_0x3278e2);}(_0x556d,0x83));var _0xd556=function(_0x11d297,_0x11fe1a){_0x11d297=_0x11d297-0x0;var _0x3c4604=_0x556d[_0x11d297];return _0x3c4604;};'use strict';var Sequelize=require(_0xd556('0x0'));module[_0xd556('0x1')]={'name':{'type':Sequelize[_0xd556('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xd556('0x2')],'allowNull':![],'unique':_0xd556('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xd556('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd556('0x2')]},'size':{'type':Sequelize[_0xd556('0x5')]},'active':{'type':Sequelize[_0xd556('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xd556('0x2')]},'state':{'type':Sequelize['STRING'],'unique':_0xd556('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xd556('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index 11d4ba4..3db76d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0xf61e,0x191));var _0xef61=function(_0x190f06,_0x13f5fd){_0x190f06=_0x190f06-0x0;var _0x3353e8=_0xf61e[_0x190f06];return _0x3353e8;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['Integration']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['Integration'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};
\ No newline at end of file
+var _0x4975=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','Integration','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3615d7,_0x328bb0){var _0x73a72f=function(_0x6eb2f3){while(--_0x6eb2f3){_0x3615d7['push'](_0x3615d7['shift']());}};_0x73a72f(++_0x328bb0);}(_0x4975,0x86));var _0x5497=function(_0x2b25f8,_0x39220c){_0x2b25f8=_0x2b25f8-0x0;var _0x1a8060=_0x4975[_0x2b25f8];return _0x1a8060;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['Integration']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['Integration'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};
\ No newline at end of file
index fbf3e1d..fcef6e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd418=['bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','integrations','util','api','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd418,0xe1));var _0x8d41=function(_0x5f226c,_0x26501a){_0x5f226c=_0x5f226c-0x0;var _0x122026=_0xd418[_0x5f226c];return _0x122026;};'use strict';var _=require('lodash');var util=require(_0x8d41('0x0'));var logger=require('../../config/logger')(_0x8d41('0x1'));var moment=require(_0x8d41('0x2'));var BPromise=require(_0x8d41('0x3'));var rp=require(_0x8d41('0x4'));var fs=require('fs');var path=require(_0x8d41('0x5'));var rimraf=require('rimraf');var config=require(_0x8d41('0x6'));var attributes=require(_0x8d41('0x7'));module[_0x8d41('0x8')]=function(_0xce6bb9,_0x17173c){return _0xce6bb9[_0x8d41('0x9')](_0x8d41('0xa'),attributes,{'tableName':_0x8d41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e50=['./integration.attributes','Integration','integrations','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x484aff,_0x149efa){var _0x11f4e1=function(_0x35370f){while(--_0x35370f){_0x484aff['push'](_0x484aff['shift']());}};_0x11f4e1(++_0x149efa);}(_0x8e50,0x1c5));var _0x08e5=function(_0x196cab,_0x45528d){_0x196cab=_0x196cab-0x0;var _0xabd895=_0x8e50[_0x196cab];return _0xabd895;};'use strict';var _=require('lodash');var util=require(_0x08e5('0x0'));var logger=require('../../config/logger')(_0x08e5('0x1'));var moment=require('moment');var BPromise=require(_0x08e5('0x2'));var rp=require(_0x08e5('0x3'));var fs=require('fs');var path=require(_0x08e5('0x4'));var rimraf=require('rimraf');var config=require(_0x08e5('0x5'));var attributes=require(_0x08e5('0x6'));module['exports']=function(_0xf26b18,_0x4ad1c9){return _0xf26b18['define'](_0x08e5('0x7'),attributes,{'tableName':_0x08e5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d7883f..d8c706d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3fd108,_0x5d911f){var _0x4f943f=function(_0x12abdf){while(--_0x12abdf){_0x3fd108['push'](_0x3fd108['shift']());}};_0x4f943f(++_0x5d911f);}(_0x896e,0x1e9));var _0xe896=function(_0x3ca5d2,_0x22e645){_0x3ca5d2=_0x3ca5d2-0x0;var _0x1c65b7=_0x896e[_0x3ca5d2];return _0x1c65b7;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('Integration,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('Integration,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}
\ No newline at end of file
+var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dc21b,_0x38ac8a){var _0x3838d7=function(_0x1f9fd1){while(--_0x1f9fd1){_0x3dc21b['push'](_0x3dc21b['shift']());}};_0x3838d7(++_0x38ac8a);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x326edf,_0x4b61a9){_0x326edf=_0x326edf-0x0;var _0x2de82d=_0xc6ac[_0x326edf];return _0x2de82d;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}
\ No newline at end of file
index 8bfff17..a41cf69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x39dc02,_0x57da9d){var _0x537af2=function(_0x12b96f){while(--_0x12b96f){_0x39dc02['push'](_0x39dc02['shift']());}};_0x537af2(++_0x57da9d);}(_0x1261,0x144));var _0x1126=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x1261[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router;
\ No newline at end of file
+var _0xd943=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0xd943,0x15d));var _0x3d94=function(_0x5b267c,_0x536df0){_0x5b267c=_0x5b267c-0x0;var _0x2edec5=_0xd943[_0x5b267c];return _0x2edec5;};'use strict';var multer=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var path=require(_0x3d94('0x2'));var timeout=require(_0x3d94('0x3'));var express=require('express');var router=express[_0x3d94('0x4')]();var fs_extra=require(_0x3d94('0x5'));var auth=require(_0x3d94('0x6'));var interaction=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0x3d94('0x9')](),controller['index']);router['get']('/describe',auth[_0x3d94('0x9')](),controller[_0x3d94('0xa')]);router['get']('/:id',auth[_0x3d94('0x9')](),controller[_0x3d94('0xb')]);router[_0x3d94('0xc')]('/',auth['isAuthenticated'](),controller[_0x3d94('0xd')]);router['put'](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller['update']);router[_0x3d94('0xf')](_0x3d94('0xe'),auth[_0x3d94('0x9')](),controller[_0x3d94('0x10')]);module[_0x3d94('0x11')]=router;
\ No newline at end of file
index c78f243..f1cf94c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacd6=['INTEGER','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING','DATE'];(function(_0x381bd2,_0x3b338b){var _0x24570e=function(_0x3881c7){while(--_0x3881c7){_0x381bd2['push'](_0x381bd2['shift']());}};_0x24570e(++_0x3b338b);}(_0xacd6,0x104));var _0x6acd=function(_0x267d8d,_0xe90f65){_0x267d8d=_0x267d8d-0x0;var _0x11a98f=_0xacd6[_0x267d8d];return _0x11a98f;};'use strict';var Sequelize=require(_0x6acd('0x0'));module[_0x6acd('0x1')]={'integration':{'type':Sequelize[_0x6acd('0x2')]},'eventChannel':{'type':Sequelize[_0x6acd('0x2')]},'exitStatus':{'type':Sequelize[_0x6acd('0x2')]},'ticketId':{'type':Sequelize[_0x6acd('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x6acd('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6acd('0x2')]},'calleridname':{'type':Sequelize[_0x6acd('0x2')]},'queue':{'type':Sequelize[_0x6acd('0x2')]},'interface':{'type':Sequelize[_0x6acd('0x2')]},'membername':{'type':Sequelize[_0x6acd('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6acd('0x3')]},'agentconnectAt':{'type':Sequelize[_0x6acd('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6acd('0x3')]},'talktime':{'type':Sequelize[_0x6acd('0x4')]},'agentacw':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6acd('0x4')]},'reason':{'type':Sequelize[_0x6acd('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x6acd('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6acd('0x3')]},'lastevent':{'type':Sequelize[_0x6acd('0x2')]},'channel':{'type':Sequelize[_0x6acd('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6acd('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6acd('0x2')]},'connectedlinename':{'type':Sequelize[_0x6acd('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x6acd('0x2')]},'context':{'type':Sequelize[_0x6acd('0x2')]},'exten':{'type':Sequelize[_0x6acd('0x2')]},'priority':{'type':Sequelize[_0x6acd('0x2')]},'destchannel':{'type':Sequelize[_0x6acd('0x2')]},'destchannelstate':{'type':Sequelize[_0x6acd('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x6acd('0x2')]},'destcalleridnum':{'type':Sequelize[_0x6acd('0x2')]},'destcalleridname':{'type':Sequelize[_0x6acd('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x6acd('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6acd('0x2')]},'destcontext':{'type':Sequelize[_0x6acd('0x2')]},'destexten':{'type':Sequelize[_0x6acd('0x2')]},'destpriority':{'type':Sequelize[_0x6acd('0x2')]},'destuniqueid':{'type':Sequelize[_0x6acd('0x2')]},'messageId':{'type':Sequelize[_0x6acd('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x6acd('0x2')]},'from':{'type':Sequelize[_0x6acd('0x2')]},'to':{'type':Sequelize[_0x6acd('0x2')]},'cc':{'type':Sequelize[_0x6acd('0x2')]},'attachment':{'type':Sequelize[_0x6acd('0x6')]},'html':{'type':Sequelize[_0x6acd('0x6')]},'text':{'type':Sequelize[_0x6acd('0x6')]},'status':{'type':Sequelize[_0x6acd('0x7')](_0x6acd('0x8'),_0x6acd('0x9'),_0x6acd('0xa'),'FAILED')},'url':{'type':Sequelize[_0x6acd('0x2')]},'app':{'type':Sequelize[_0x6acd('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x6acd('0x4')]}};
\ No newline at end of file
+var _0xfd1b=['SENT','SENDING','FAILED','sequelize','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0xfd1b,0x157));var _0xbfd1=function(_0x46d4e3,_0x3fdca5){_0x46d4e3=_0x46d4e3-0x0;var _0x521f43=_0xfd1b[_0x46d4e3];return _0x521f43;};'use strict';var Sequelize=require(_0xbfd1('0x0'));module['exports']={'integration':{'type':Sequelize[_0xbfd1('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xbfd1('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xbfd1('0x1')]},'uniqueid':{'type':Sequelize[_0xbfd1('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbfd1('0x1')]},'queue':{'type':Sequelize[_0xbfd1('0x1')]},'interface':{'type':Sequelize[_0xbfd1('0x1')]},'membername':{'type':Sequelize[_0xbfd1('0x1')]},'agentcalledAt':{'type':Sequelize[_0xbfd1('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xbfd1('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xbfd1('0x3')]},'agentacw':{'type':Sequelize[_0xbfd1('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbfd1('0x3')]},'reason':{'type':Sequelize[_0xbfd1('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xbfd1('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xbfd1('0x2')]},'agentdump':{'type':Sequelize[_0xbfd1('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xbfd1('0x2')]},'lastevent':{'type':Sequelize[_0xbfd1('0x1')]},'channel':{'type':Sequelize[_0xbfd1('0x1')]},'channelstate':{'type':Sequelize[_0xbfd1('0x3')]},'channelstatedesc':{'type':Sequelize[_0xbfd1('0x1')]},'connectedlinenum':{'type':Sequelize[_0xbfd1('0x1')]},'connectedlinename':{'type':Sequelize[_0xbfd1('0x1')]},'language':{'type':Sequelize[_0xbfd1('0x1')]},'accountcode':{'type':Sequelize[_0xbfd1('0x1')]},'context':{'type':Sequelize[_0xbfd1('0x1')]},'exten':{'type':Sequelize[_0xbfd1('0x1')]},'priority':{'type':Sequelize[_0xbfd1('0x1')]},'destchannel':{'type':Sequelize[_0xbfd1('0x1')]},'destchannelstate':{'type':Sequelize[_0xbfd1('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xbfd1('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xbfd1('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xbfd1('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xbfd1('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xbfd1('0x1')]},'destuniqueid':{'type':Sequelize[_0xbfd1('0x1')]},'messageId':{'type':Sequelize[_0xbfd1('0x1')]},'inReplyTo':{'type':Sequelize[_0xbfd1('0x1')]},'subject':{'type':Sequelize[_0xbfd1('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xbfd1('0x1')]},'cc':{'type':Sequelize[_0xbfd1('0x1')]},'attachment':{'type':Sequelize[_0xbfd1('0x5')]},'html':{'type':Sequelize[_0xbfd1('0x5')]},'text':{'type':Sequelize[_0xbfd1('0x5')]},'status':{'type':Sequelize[_0xbfd1('0x6')](_0xbfd1('0x7'),_0xbfd1('0x8'),'RECEIVED',_0xbfd1('0x9'))},'url':{'type':Sequelize[_0xbfd1('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xbfd1('0x3')]}};
\ No newline at end of file
index b1af182..765b406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8734=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','IntegrationReport','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x40d320,_0x44d480){var _0x31f85b=function(_0x45ae06){while(--_0x45ae06){_0x40d320['push'](_0x40d320['shift']());}};_0x31f85b(++_0x44d480);}(_0x8734,0x192));var _0x4873=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0x8734[_0x1678c8];return _0x387aa9;};'use strict';var emlformat=require(_0x4873('0x0'));var rimraf=require(_0x4873('0x1'));var zipdir=require(_0x4873('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4873('0x3'));var BPromise=require(_0x4873('0x4'));var Mustache=require('mustache');var util=require(_0x4873('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4873('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4873('0x7'));var squel=require('squel');var crypto=require(_0x4873('0x8'));var jsforce=require(_0x4873('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4873('0xa'));var Papa=require(_0x4873('0xb'));var Redis=require(_0x4873('0xc'));var authService=require(_0x4873('0xd'));var qs=require(_0x4873('0xe'));var as=require(_0x4873('0xf'));var hardwareService=require(_0x4873('0x10'));var logger=require('../../config/logger')(_0x4873('0x11'));var utils=require(_0x4873('0x12'));var config=require(_0x4873('0x13'));var licenseUtil=require(_0x4873('0x14'));var db=require(_0x4873('0x15'))['db'];function respondWithStatusCode(_0x237270,_0x5cca51){_0x5cca51=_0x5cca51||0xcc;return function(_0x1d9ff1){if(_0x1d9ff1){return _0x237270[_0x4873('0x16')](_0x5cca51);}return _0x237270[_0x4873('0x17')](_0x5cca51)[_0x4873('0x18')]();};}function respondWithResult(_0x539d2b,_0xe949a5){_0xe949a5=_0xe949a5||0xc8;return function(_0x365c7d){if(_0x365c7d){return _0x539d2b[_0x4873('0x17')](_0xe949a5)[_0x4873('0x19')](_0x365c7d);}};}function respondWithFilteredResult(_0x19622c,_0x583a3f){return function(_0x2b2f75){if(_0x2b2f75){var _0x15a93e=typeof _0x583a3f[_0x4873('0x1a')]===_0x4873('0x1b')&&typeof _0x583a3f[_0x4873('0x1c')]===_0x4873('0x1b');var _0x4ad9a2=_0x2b2f75[_0x4873('0x1d')];var _0x31e14b=_0x15a93e?0x0:_0x583a3f[_0x4873('0x1a')];var _0x5d722e=_0x15a93e?_0x2b2f75[_0x4873('0x1d')]:_0x583a3f[_0x4873('0x1a')]+_0x583a3f[_0x4873('0x1c')];var _0xd46348;if(_0x5d722e>=_0x4ad9a2){_0x5d722e=_0x4ad9a2;_0xd46348=0xc8;}else{_0xd46348=0xce;}_0x19622c[_0x4873('0x17')](_0xd46348);return _0x19622c[_0x4873('0x1e')]('Content-Range',_0x31e14b+'-'+_0x5d722e+'/'+_0x4ad9a2)[_0x4873('0x19')](_0x2b2f75);}return null;};}function patchUpdates(_0x76852f){return function(_0x1c86ee){try{jsonpatch[_0x4873('0x1f')](_0x1c86ee,_0x76852f,!![]);}catch(_0x121aa5){return BPromise[_0x4873('0x20')](_0x121aa5);}return _0x1c86ee[_0x4873('0x21')]();};}function saveUpdates(_0x438996,_0x41f780){return function(_0x1458c1){if(_0x1458c1){return _0x1458c1[_0x4873('0x22')](_0x438996)[_0x4873('0x23')](function(_0x308b65){return _0x308b65;});}return null;};}function removeEntity(_0x1a6cbe,_0x58dd2e){return function(_0xfb5f56){if(_0xfb5f56){return _0xfb5f56[_0x4873('0x24')]()['then'](function(){_0x1a6cbe[_0x4873('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e6552,_0x377e1d){return function(_0x2dfe6d){if(!_0x2dfe6d){_0x2e6552[_0x4873('0x16')](0x194);}return _0x2dfe6d;};}function handleError(_0xe175f7,_0x4dfcc1){_0x4dfcc1=_0x4dfcc1||0x1f4;return function(_0x2dd8f6){logger[_0x4873('0x25')](_0x2dd8f6[_0x4873('0x26')]);if(_0x2dd8f6[_0x4873('0x27')]){delete _0x2dd8f6['name'];}_0xe175f7[_0x4873('0x17')](_0x4dfcc1)[_0x4873('0x28')](_0x2dd8f6);};}exports[_0x4873('0x29')]=function(_0x273d96,_0x2a0bde){var _0xa51b32={},_0x4eed3a={},_0x48cc41={'count':0x0,'rows':[]};var _0x503932=_['map'](db[_0x4873('0x2a')]['rawAttributes'],function(_0x580113){return{'name':_0x580113[_0x4873('0x2b')],'type':_0x580113[_0x4873('0x2c')][_0x4873('0x2d')]};});_0x4eed3a[_0x4873('0x2e')]=_[_0x4873('0x2f')](_0x503932,_0x4873('0x27'));_0x4eed3a[_0x4873('0x30')]=_[_0x4873('0x31')](_0x273d96[_0x4873('0x30')]);_0x4eed3a['filters']=_[_0x4873('0x32')](_0x4eed3a[_0x4873('0x2e')],_0x4eed3a['query']);_0xa51b32['attributes']=_[_0x4873('0x32')](_0x4eed3a[_0x4873('0x2e')],qs[_0x4873('0x33')](_0x273d96[_0x4873('0x30')][_0x4873('0x33')]));_0xa51b32[_0x4873('0x34')]=_0xa51b32['attributes'][_0x4873('0x35')]?_0xa51b32['attributes']:_0x4eed3a[_0x4873('0x2e')];if(!_0x273d96[_0x4873('0x30')][_0x4873('0x36')](_0x4873('0x37'))){_0xa51b32[_0x4873('0x1c')]=qs[_0x4873('0x1c')](_0x273d96[_0x4873('0x30')][_0x4873('0x1c')]);_0xa51b32['offset']=qs[_0x4873('0x1a')](_0x273d96[_0x4873('0x30')][_0x4873('0x1a')]);}_0xa51b32[_0x4873('0x38')]=qs[_0x4873('0x39')](_0x273d96['query'][_0x4873('0x39')]);_0xa51b32[_0x4873('0x3a')]=qs[_0x4873('0x3b')](_[_0x4873('0x3c')](_0x273d96[_0x4873('0x30')],_0x4eed3a[_0x4873('0x3b')]),_0x503932);if(_0x273d96['query']['filter']){_0xa51b32[_0x4873('0x3a')]=_[_0x4873('0x3d')](_0xa51b32[_0x4873('0x3a')],{'$or':_['map'](_0x503932,function(_0x297663){if(_0x297663[_0x4873('0x2c')]!==_0x4873('0x3e')){var _0x449c05={};_0x449c05[_0x297663[_0x4873('0x27')]]={'$like':'%'+_0x273d96[_0x4873('0x30')][_0x4873('0x3f')]+'%'};return _0x449c05;}})});}_0xa51b32=_[_0x4873('0x3d')]({},_0xa51b32,_0x273d96[_0x4873('0x40')]);var _0x6f51cc={'where':_0xa51b32[_0x4873('0x3a')]};return db[_0x4873('0x2a')][_0x4873('0x1d')](_0x6f51cc)[_0x4873('0x23')](function(_0x10ea10){_0x48cc41[_0x4873('0x1d')]=_0x10ea10;if(_0x273d96[_0x4873('0x30')][_0x4873('0x41')]){_0xa51b32[_0x4873('0x42')]=[{'all':!![]}];}return db[_0x4873('0x2a')][_0x4873('0x43')](_0xa51b32);})[_0x4873('0x23')](function(_0x39009e){_0x48cc41[_0x4873('0x44')]=_0x39009e;return _0x48cc41;})[_0x4873('0x23')](respondWithFilteredResult(_0x2a0bde,_0xa51b32))[_0x4873('0x45')](handleError(_0x2a0bde,null));};exports[_0x4873('0x46')]=function(_0x1ac337,_0x4d0d38){var _0x405706={'raw':![],'where':{'id':_0x1ac337['params']['id']}},_0x482835={};_0x482835['model']=_['keys'](db['IntegrationReport'][_0x4873('0x47')]);_0x482835[_0x4873('0x30')]=_[_0x4873('0x31')](_0x1ac337['query']);_0x482835[_0x4873('0x3b')]=_[_0x4873('0x32')](_0x482835['model'],_0x482835[_0x4873('0x30')]);_0x405706[_0x4873('0x34')]=_[_0x4873('0x32')](_0x482835[_0x4873('0x2e')],qs['fields'](_0x1ac337[_0x4873('0x30')][_0x4873('0x33')]));_0x405706['attributes']=_0x405706[_0x4873('0x34')][_0x4873('0x35')]?_0x405706[_0x4873('0x34')]:_0x482835[_0x4873('0x2e')];if(_0x1ac337[_0x4873('0x30')][_0x4873('0x41')]){_0x405706[_0x4873('0x42')]=[{'all':!![]}];}_0x405706=_[_0x4873('0x3d')]({},_0x405706,_0x1ac337[_0x4873('0x40')]);return db['IntegrationReport'][_0x4873('0x48')](_0x405706)[_0x4873('0x23')](handleEntityNotFound(_0x4d0d38,null))[_0x4873('0x23')](respondWithResult(_0x4d0d38,null))[_0x4873('0x45')](handleError(_0x4d0d38,null));};exports[_0x4873('0x49')]=function(_0x1ee17b,_0x271456){return db[_0x4873('0x2a')][_0x4873('0x49')](_0x1ee17b['body'],{})[_0x4873('0x23')](respondWithResult(_0x271456,0xc9))['catch'](handleError(_0x271456,null));};exports[_0x4873('0x22')]=function(_0x3d2f55,_0x215031){if(_0x3d2f55[_0x4873('0x4a')]['id']){delete _0x3d2f55[_0x4873('0x4a')]['id'];}return db[_0x4873('0x2a')][_0x4873('0x48')]({'where':{'id':_0x3d2f55[_0x4873('0x4b')]['id']}})[_0x4873('0x23')](handleEntityNotFound(_0x215031,null))[_0x4873('0x23')](saveUpdates(_0x3d2f55[_0x4873('0x4a')],null))[_0x4873('0x23')](respondWithResult(_0x215031,null))['catch'](handleError(_0x215031,null));};exports[_0x4873('0x24')]=function(_0x4de141,_0x30e528){return db['IntegrationReport'][_0x4873('0x48')]({'where':{'id':_0x4de141[_0x4873('0x4b')]['id']}})[_0x4873('0x23')](handleEntityNotFound(_0x30e528,null))[_0x4873('0x23')](removeEntity(_0x30e528,null))[_0x4873('0x45')](handleError(_0x30e528,null));};exports[_0x4873('0x4c')]=function(_0x3bfc97,_0x249ab8){return db[_0x4873('0x2a')][_0x4873('0x4c')]()['then'](respondWithResult(_0x249ab8,null))[_0x4873('0x45')](handleError(_0x249ab8,null));};
\ No newline at end of file
+var _0xc8af=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','create','body','params','find','describe'];(function(_0x4af0e0,_0x5a2a5e){var _0xbefd7e=function(_0x13dda7){while(--_0x13dda7){_0x4af0e0['push'](_0x4af0e0['shift']());}};_0xbefd7e(++_0x5a2a5e);}(_0xc8af,0x1f1));var _0xfc8a=function(_0xb605ce,_0x10574f){_0xb605ce=_0xb605ce-0x0;var _0x5059a5=_0xc8af[_0xb605ce];return _0x5059a5;};'use strict';var emlformat=require(_0xfc8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc8a('0x1'));var jsonpatch=require(_0xfc8a('0x2'));var rp=require(_0xfc8a('0x3'));var moment=require('moment');var BPromise=require(_0xfc8a('0x4'));var Mustache=require(_0xfc8a('0x5'));var util=require(_0xfc8a('0x6'));var path=require('path');var sox=require(_0xfc8a('0x7'));var csv=require(_0xfc8a('0x8'));var ejs=require(_0xfc8a('0x9'));var fs=require('fs');var fs_extra=require(_0xfc8a('0xa'));var _=require('lodash');var squel=require(_0xfc8a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc8a('0xc'));var deskjs=require(_0xfc8a('0xd'));var toCsv=require(_0xfc8a('0x8'));var querystring=require(_0xfc8a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc8a('0xf'));var authService=require(_0xfc8a('0x10'));var qs=require(_0xfc8a('0x11'));var as=require(_0xfc8a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc8a('0x13'))(_0xfc8a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfc8a('0x15'))['db'];function respondWithStatusCode(_0x37a2f1,_0x1eb707){_0x1eb707=_0x1eb707||0xcc;return function(_0x157847){if(_0x157847){return _0x37a2f1[_0xfc8a('0x16')](_0x1eb707);}return _0x37a2f1[_0xfc8a('0x17')](_0x1eb707)[_0xfc8a('0x18')]();};}function respondWithResult(_0x4c1730,_0x86947c){_0x86947c=_0x86947c||0xc8;return function(_0x48d9cd){if(_0x48d9cd){return _0x4c1730['status'](_0x86947c)[_0xfc8a('0x19')](_0x48d9cd);}};}function respondWithFilteredResult(_0x1c3916,_0x81e220){return function(_0x5e6fc3){if(_0x5e6fc3){var _0x1abcd6=typeof _0x81e220[_0xfc8a('0x1a')]===_0xfc8a('0x1b')&&typeof _0x81e220[_0xfc8a('0x1c')]===_0xfc8a('0x1b');var _0x3a7b3b=_0x5e6fc3[_0xfc8a('0x1d')];var _0x33a523=_0x1abcd6?0x0:_0x81e220[_0xfc8a('0x1a')];var _0x4b5a46=_0x1abcd6?_0x5e6fc3[_0xfc8a('0x1d')]:_0x81e220['offset']+_0x81e220[_0xfc8a('0x1c')];var _0x4cd42e;if(_0x4b5a46>=_0x3a7b3b){_0x4b5a46=_0x3a7b3b;_0x4cd42e=0xc8;}else{_0x4cd42e=0xce;}_0x1c3916[_0xfc8a('0x17')](_0x4cd42e);return _0x1c3916['set'](_0xfc8a('0x1e'),_0x33a523+'-'+_0x4b5a46+'/'+_0x3a7b3b)[_0xfc8a('0x19')](_0x5e6fc3);}return null;};}function patchUpdates(_0x54d078){return function(_0x3476db){try{jsonpatch['apply'](_0x3476db,_0x54d078,!![]);}catch(_0x50f06e){return BPromise[_0xfc8a('0x1f')](_0x50f06e);}return _0x3476db[_0xfc8a('0x20')]();};}function saveUpdates(_0x5bd8c0,_0x1c5f65){return function(_0x5794a4){if(_0x5794a4){return _0x5794a4[_0xfc8a('0x21')](_0x5bd8c0)['then'](function(_0x7b0e48){return _0x7b0e48;});}return null;};}function removeEntity(_0x147260,_0xfbdbc1){return function(_0x52d1f7){if(_0x52d1f7){return _0x52d1f7['destroy']()['then'](function(){_0x147260[_0xfc8a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x380506,_0x3cbda4){return function(_0x2a6a42){if(!_0x2a6a42){_0x380506[_0xfc8a('0x16')](0x194);}return _0x2a6a42;};}function handleError(_0x2d9c6b,_0x4687af){_0x4687af=_0x4687af||0x1f4;return function(_0x4255f3){logger[_0xfc8a('0x22')](_0x4255f3[_0xfc8a('0x23')]);if(_0x4255f3[_0xfc8a('0x24')]){delete _0x4255f3[_0xfc8a('0x24')];}_0x2d9c6b[_0xfc8a('0x17')](_0x4687af)['send'](_0x4255f3);};}exports[_0xfc8a('0x25')]=function(_0xbdc5ce,_0x28a34e){var _0x246051={},_0x578490={},_0x548cba={'count':0x0,'rows':[]};var _0x4cd500=_[_0xfc8a('0x26')](db[_0xfc8a('0x27')][_0xfc8a('0x28')],function(_0xfd5d26){return{'name':_0xfd5d26[_0xfc8a('0x29')],'type':_0xfd5d26[_0xfc8a('0x2a')][_0xfc8a('0x2b')]};});_0x578490[_0xfc8a('0x2c')]=_[_0xfc8a('0x26')](_0x4cd500,_0xfc8a('0x24'));_0x578490[_0xfc8a('0x2d')]=_[_0xfc8a('0x2e')](_0xbdc5ce[_0xfc8a('0x2d')]);_0x578490[_0xfc8a('0x2f')]=_[_0xfc8a('0x30')](_0x578490[_0xfc8a('0x2c')],_0x578490[_0xfc8a('0x2d')]);_0x246051[_0xfc8a('0x31')]=_[_0xfc8a('0x30')](_0x578490[_0xfc8a('0x2c')],qs['fields'](_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x32')]));_0x246051['attributes']=_0x246051[_0xfc8a('0x31')][_0xfc8a('0x33')]?_0x246051[_0xfc8a('0x31')]:_0x578490[_0xfc8a('0x2c')];if(!_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x34')](_0xfc8a('0x35'))){_0x246051[_0xfc8a('0x1c')]=qs[_0xfc8a('0x1c')](_0xbdc5ce['query']['limit']);_0x246051[_0xfc8a('0x1a')]=qs[_0xfc8a('0x1a')](_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x1a')]);}_0x246051[_0xfc8a('0x36')]=qs[_0xfc8a('0x37')](_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x37')]);_0x246051[_0xfc8a('0x38')]=qs['filters'](_[_0xfc8a('0x39')](_0xbdc5ce[_0xfc8a('0x2d')],_0x578490[_0xfc8a('0x2f')]),_0x4cd500);if(_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x3a')]){_0x246051['where']=_[_0xfc8a('0x3b')](_0x246051[_0xfc8a('0x38')],{'$or':_[_0xfc8a('0x26')](_0x4cd500,function(_0x580333){if(_0x580333[_0xfc8a('0x2a')]!=='VIRTUAL'){var _0x2afcae={};_0x2afcae[_0x580333[_0xfc8a('0x24')]]={'$like':'%'+_0xbdc5ce[_0xfc8a('0x2d')][_0xfc8a('0x3a')]+'%'};return _0x2afcae;}})});}_0x246051=_[_0xfc8a('0x3b')]({},_0x246051,_0xbdc5ce[_0xfc8a('0x3c')]);var _0x54f480={'where':_0x246051[_0xfc8a('0x38')]};return db[_0xfc8a('0x27')][_0xfc8a('0x1d')](_0x54f480)[_0xfc8a('0x3d')](function(_0x13717b){_0x548cba['count']=_0x13717b;if(_0xbdc5ce['query']['includeAll']){_0x246051[_0xfc8a('0x3e')]=[{'all':!![]}];}return db[_0xfc8a('0x27')][_0xfc8a('0x3f')](_0x246051);})[_0xfc8a('0x3d')](function(_0x196dfe){_0x548cba[_0xfc8a('0x40')]=_0x196dfe;return _0x548cba;})[_0xfc8a('0x3d')](respondWithFilteredResult(_0x28a34e,_0x246051))[_0xfc8a('0x41')](handleError(_0x28a34e,null));};exports['show']=function(_0x591a05,_0x3a5225){var _0x1febef={'raw':![],'where':{'id':_0x591a05['params']['id']}},_0x480f3f={};_0x480f3f[_0xfc8a('0x2c')]=_[_0xfc8a('0x2e')](db['IntegrationReport'][_0xfc8a('0x28')]);_0x480f3f[_0xfc8a('0x2d')]=_[_0xfc8a('0x2e')](_0x591a05[_0xfc8a('0x2d')]);_0x480f3f['filters']=_[_0xfc8a('0x30')](_0x480f3f[_0xfc8a('0x2c')],_0x480f3f[_0xfc8a('0x2d')]);_0x1febef[_0xfc8a('0x31')]=_[_0xfc8a('0x30')](_0x480f3f[_0xfc8a('0x2c')],qs[_0xfc8a('0x32')](_0x591a05[_0xfc8a('0x2d')][_0xfc8a('0x32')]));_0x1febef['attributes']=_0x1febef[_0xfc8a('0x31')][_0xfc8a('0x33')]?_0x1febef[_0xfc8a('0x31')]:_0x480f3f[_0xfc8a('0x2c')];if(_0x591a05[_0xfc8a('0x2d')]['includeAll']){_0x1febef[_0xfc8a('0x3e')]=[{'all':!![]}];}_0x1febef=_['merge']({},_0x1febef,_0x591a05['options']);return db[_0xfc8a('0x27')]['find'](_0x1febef)[_0xfc8a('0x3d')](handleEntityNotFound(_0x3a5225,null))[_0xfc8a('0x3d')](respondWithResult(_0x3a5225,null))['catch'](handleError(_0x3a5225,null));};exports[_0xfc8a('0x42')]=function(_0x507268,_0x53c287){return db[_0xfc8a('0x27')][_0xfc8a('0x42')](_0x507268[_0xfc8a('0x43')],{})[_0xfc8a('0x3d')](respondWithResult(_0x53c287,0xc9))[_0xfc8a('0x41')](handleError(_0x53c287,null));};exports['update']=function(_0x3e93f4,_0x42a511){if(_0x3e93f4['body']['id']){delete _0x3e93f4[_0xfc8a('0x43')]['id'];}return db[_0xfc8a('0x27')]['find']({'where':{'id':_0x3e93f4[_0xfc8a('0x44')]['id']}})[_0xfc8a('0x3d')](handleEntityNotFound(_0x42a511,null))[_0xfc8a('0x3d')](saveUpdates(_0x3e93f4[_0xfc8a('0x43')],null))[_0xfc8a('0x3d')](respondWithResult(_0x42a511,null))[_0xfc8a('0x41')](handleError(_0x42a511,null));};exports['destroy']=function(_0x3d6c8c,_0x11bd00){return db[_0xfc8a('0x27')][_0xfc8a('0x45')]({'where':{'id':_0x3d6c8c[_0xfc8a('0x44')]['id']}})[_0xfc8a('0x3d')](handleEntityNotFound(_0x11bd00,null))[_0xfc8a('0x3d')](removeEntity(_0x11bd00,null))[_0xfc8a('0x41')](handleError(_0x11bd00,null));};exports[_0xfc8a('0x46')]=function(_0x295340,_0x1e8ef2){return db['IntegrationReport'][_0xfc8a('0x46')]()[_0xfc8a('0x3d')](respondWithResult(_0x1e8ef2,null))['catch'](handleError(_0x1e8ef2,null));};
\ No newline at end of file
index 22591be..44590af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4687=['exports','define','IntegrationReport','report_integration','util','../../config/logger','moment','request-promise','path','../../config/environment','./integrationReport.attributes'];(function(_0x554ced,_0x45ff90){var _0x2c90c2=function(_0x58334b){while(--_0x58334b){_0x554ced['push'](_0x554ced['shift']());}};_0x2c90c2(++_0x45ff90);}(_0x4687,0x14e));var _0x7468=function(_0x25bc01,_0x160704){_0x25bc01=_0x25bc01-0x0;var _0x33bcb4=_0x4687[_0x25bc01];return _0x33bcb4;};'use strict';var _=require('lodash');var util=require(_0x7468('0x0'));var logger=require(_0x7468('0x1'))('api');var moment=require(_0x7468('0x2'));var BPromise=require('bluebird');var rp=require(_0x7468('0x3'));var fs=require('fs');var path=require(_0x7468('0x4'));var rimraf=require('rimraf');var config=require(_0x7468('0x5'));var attributes=require(_0x7468('0x6'));module[_0x7468('0x7')]=function(_0x229b2b,_0x21beca){return _0x229b2b[_0x7468('0x8')](_0x7468('0x9'),attributes,{'tableName':_0x7468('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x72f5=['../../config/environment','./integrationReport.attributes','exports','report_integration','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3c4f09,_0x3e6f72){var _0x162dba=function(_0x4e9545){while(--_0x4e9545){_0x3c4f09['push'](_0x3c4f09['shift']());}};_0x162dba(++_0x3e6f72);}(_0x72f5,0x88));var _0x572f=function(_0x6dae4,_0x1aaa6e){_0x6dae4=_0x6dae4-0x0;var _0x459a13=_0x72f5[_0x6dae4];return _0x459a13;};'use strict';var _=require(_0x572f('0x0'));var util=require(_0x572f('0x1'));var logger=require('../../config/logger')(_0x572f('0x2'));var moment=require(_0x572f('0x3'));var BPromise=require(_0x572f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x572f('0x5'));var rimraf=require(_0x572f('0x6'));var config=require(_0x572f('0x7'));var attributes=require(_0x572f('0x8'));module[_0x572f('0x9')]=function(_0x3f9dc5,_0x197551){return _0x3f9dc5['define']('IntegrationReport',attributes,{'tableName':_0x572f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 082c6aa..c5088e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x550bb1,_0x1fda56){var _0x455f8e=function(_0x47f082){while(--_0x47f082){_0x550bb1['push'](_0x550bb1['shift']());}};_0x455f8e(++_0x1fda56);}(_0x2542,0x169));var _0x2254=function(_0x3c5f1a,_0x558e94){_0x3c5f1a=_0x3c5f1a-0x0;var _0x178d7b=_0x2542[_0x3c5f1a];return _0x178d7b;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});}
\ No newline at end of file
+var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x1967,0x173));var _0x7196=function(_0x1fc0af,_0x33bb31){_0x1fc0af=_0x1fc0af-0x0;var _0x54d776=_0x1967[_0x1fc0af];return _0x54d776;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});}
\ No newline at end of file
index 93fdf81..1ec652e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3809=['update','delete','util','path','connect-timeout','Router','fs-extra','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','post','create','addIntervals','put'];(function(_0x100a3e,_0xe7e174){var _0x5ca2d0=function(_0x14cbc8){while(--_0x14cbc8){_0x100a3e['push'](_0x100a3e['shift']());}};_0x5ca2d0(++_0xe7e174);}(_0x3809,0xca));var _0x9380=function(_0x3296c2,_0x252bab){_0x3296c2=_0x3296c2-0x0;var _0x189101=_0x3809[_0x3296c2];return _0x189101;};'use strict';var multer=require('multer');var util=require(_0x9380('0x0'));var path=require(_0x9380('0x1'));var timeout=require(_0x9380('0x2'));var express=require('express');var router=express[_0x9380('0x3')]();var fs_extra=require(_0x9380('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9380('0x5'));var controller=require(_0x9380('0x6'));router[_0x9380('0x7')]('/',auth[_0x9380('0x8')](),controller[_0x9380('0x9')]);router[_0x9380('0x7')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller[_0x9380('0xb')]);router[_0x9380('0x7')](_0x9380('0xc'),auth['isAuthenticated'](),controller[_0x9380('0xd')]);router[_0x9380('0xe')]('/',auth['isAuthenticated'](),controller[_0x9380('0xf')]);router[_0x9380('0xe')]('/:id/sub_intervals',auth[_0x9380('0x8')](),controller['addInterval']);router[_0x9380('0xe')]('/:id/sub_intervals/create_many',auth[_0x9380('0x8')](),controller[_0x9380('0x10')]);router[_0x9380('0x11')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller[_0x9380('0x12')]);router[_0x9380('0x13')](_0x9380('0xa'),auth[_0x9380('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbccd=['isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get'];(function(_0x23734c,_0x3967da){var _0x432eaf=function(_0x400ca5){while(--_0x400ca5){_0x23734c['push'](_0x23734c['shift']());}};_0x432eaf(++_0x3967da);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xbccd[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xdbcc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbcc('0x1'));var express=require(_0xdbcc('0x2'));var router=express[_0xdbcc('0x3')]();var fs_extra=require(_0xdbcc('0x4'));var auth=require(_0xdbcc('0x5'));var interaction=require(_0xdbcc('0x6'));var config=require('../../config/environment');var controller=require(_0xdbcc('0x7'));router[_0xdbcc('0x8')]('/',auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xa')]);router[_0xdbcc('0x8')](_0xdbcc('0xb'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xc')]);router[_0xdbcc('0x8')](_0xdbcc('0xd'),auth[_0xdbcc('0x9')](),controller['getIntervals']);router['post']('/',auth[_0xdbcc('0x9')](),controller['create']);router[_0xdbcc('0xe')](_0xdbcc('0xd'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0xf')]);router[_0xdbcc('0xe')](_0xdbcc('0x10'),auth[_0xdbcc('0x9')](),controller['addIntervals']);router[_0xdbcc('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdbcc('0x12')](_0xdbcc('0xb'),auth[_0xdbcc('0x9')](),controller[_0xdbcc('0x13')]);module[_0xdbcc('0x14')]=router;
\ No newline at end of file
index ff9adcc..57ba8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7f4=['STRING'];(function(_0x340910,_0x281f94){var _0x26c9da=function(_0x1a8717){while(--_0x1a8717){_0x340910['push'](_0x340910['shift']());}};_0x26c9da(++_0x281f94);}(_0xf7f4,0x1d7));var _0x4f7f=function(_0x5b79c6,_0x4f5871){_0x5b79c6=_0x5b79c6-0x0;var _0x2b9850=_0xf7f4[_0x5b79c6];return _0x2b9850;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4f7f('0x0')]},'description':{'type':Sequelize[_0x4f7f('0x0')]},'interval':{'type':Sequelize[_0x4f7f('0x0')],'allowNull':!![]}};
\ No newline at end of file
+var _0xeaa3=['STRING','sequelize','exports'];(function(_0x269e59,_0x4bc998){var _0x772bd8=function(_0x69165e){while(--_0x69165e){_0x269e59['push'](_0x269e59['shift']());}};_0x772bd8(++_0x4bc998);}(_0xeaa3,0x1c3));var _0x3eaa=function(_0x4c27cc,_0x3f9855){_0x4c27cc=_0x4c27cc-0x0;var _0x33eca8=_0xeaa3[_0x4c27cc];return _0x33eca8;};'use strict';var Sequelize=require(_0x3eaa('0x0'));module[_0x3eaa('0x1')]={'name':{'type':Sequelize[_0x3eaa('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3eaa('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 8879011..b4165e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7871=['ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','VIRTUAL','options','Interval','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','IntervalId','getIntervals','order','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','papaparse'];(function(_0x3e575b,_0x1e3273){var _0x2eb74e=function(_0x53535c){while(--_0x53535c){_0x3e575b['push'](_0x3e575b['shift']());}};_0x2eb74e(++_0x1e3273);}(_0x7871,0xa1));var _0x1787=function(_0x5ad92b,_0x431e6d){_0x5ad92b=_0x5ad92b-0x0;var _0x3ea5c5=_0x7871[_0x5ad92b];return _0x3ea5c5;};'use strict';var emlformat=require(_0x1787('0x0'));var rimraf=require(_0x1787('0x1'));var zipdir=require(_0x1787('0x2'));var jsonpatch=require(_0x1787('0x3'));var rp=require('request-promise');var moment=require(_0x1787('0x4'));var BPromise=require(_0x1787('0x5'));var Mustache=require('mustache');var util=require(_0x1787('0x6'));var path=require(_0x1787('0x7'));var sox=require(_0x1787('0x8'));var csv=require(_0x1787('0x9'));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('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1787('0xa'));var Redis=require(_0x1787('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1787('0xc'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1787('0xd'))(_0x1787('0xe'));var utils=require(_0x1787('0xf'));var config=require(_0x1787('0x10'));var licenseUtil=require(_0x1787('0x11'));var db=require(_0x1787('0x12'))['db'];var extensions=require(_0x1787('0x13'));function respondWithStatusCode(_0x4546ed,_0x3a32f1){_0x3a32f1=_0x3a32f1||0xcc;return function(_0x1688b8){if(_0x1688b8){return _0x4546ed[_0x1787('0x14')](_0x3a32f1);}return _0x4546ed[_0x1787('0x15')](_0x3a32f1)[_0x1787('0x16')]();};}function respondWithResult(_0x31ab73,_0x4d41ca){_0x4d41ca=_0x4d41ca||0xc8;return function(_0x38282d){if(_0x38282d){return _0x31ab73[_0x1787('0x15')](_0x4d41ca)[_0x1787('0x17')](_0x38282d);}};}function respondWithFilteredResult(_0x1b0343,_0x2432a4){return function(_0x35684e){if(_0x35684e){var _0x51dca4=typeof _0x2432a4[_0x1787('0x18')]===_0x1787('0x19')&&typeof _0x2432a4['limit']===_0x1787('0x19');var _0x4fa5d9=_0x35684e[_0x1787('0x1a')];var _0x3066aa=_0x51dca4?0x0:_0x2432a4[_0x1787('0x18')];var _0x5253f4=_0x51dca4?_0x35684e['count']:_0x2432a4['offset']+_0x2432a4['limit'];var _0x2eb3b3;if(_0x5253f4>=_0x4fa5d9){_0x5253f4=_0x4fa5d9;_0x2eb3b3=0xc8;}else{_0x2eb3b3=0xce;}_0x1b0343[_0x1787('0x15')](_0x2eb3b3);return _0x1b0343[_0x1787('0x1b')](_0x1787('0x1c'),_0x3066aa+'-'+_0x5253f4+'/'+_0x4fa5d9)[_0x1787('0x17')](_0x35684e);}return null;};}function patchUpdates(_0x324dd1){return function(_0x157e2a){try{jsonpatch[_0x1787('0x1d')](_0x157e2a,_0x324dd1,!![]);}catch(_0x12ee92){return BPromise['reject'](_0x12ee92);}return _0x157e2a['save']();};}function saveUpdates(_0x4c03ca,_0x3782e6){return function(_0x49146a){if(_0x49146a){return _0x49146a[_0x1787('0x1e')](_0x4c03ca)[_0x1787('0x1f')](function(_0x492e44){return _0x492e44;});}return null;};}function removeEntity(_0x13c917,_0x5cbcfa){return function(_0x3df794){if(_0x3df794){return _0x3df794[_0x1787('0x20')]()[_0x1787('0x1f')](function(){var _0x1c1903=_0x3df794[_0x1787('0x21')]({'plain':!![]});var _0xf8e78f=_0x1787('0x22');return db[_0x1787('0x23')][_0x1787('0x20')]({'where':{'type':_0xf8e78f,'resourceId':_0x1c1903['id']}})[_0x1787('0x1f')](function(){return _0x3df794;});})[_0x1787('0x1f')](function(){_0x13c917[_0x1787('0x15')](0xcc)[_0x1787('0x16')]();});}};}function handleEntityNotFound(_0x26be28,_0xcb1178){return function(_0xa2a59e){if(!_0xa2a59e){_0x26be28['sendStatus'](0x194);}return _0xa2a59e;};}function handleError(_0x12b4d3,_0x3bdb73){_0x3bdb73=_0x3bdb73||0x1f4;return function(_0x50e8ea){logger[_0x1787('0x24')](_0x50e8ea['stack']);if(_0x50e8ea['name']){delete _0x50e8ea[_0x1787('0x25')];}_0x12b4d3['status'](_0x3bdb73)[_0x1787('0x26')](_0x50e8ea);};}exports[_0x1787('0x27')]=function(_0x8a3d71,_0x23995a){var _0x2a5493={},_0x4bef13={},_0x124735={'count':0x0,'rows':[]};var _0x173819=_['map'](db['Interval'][_0x1787('0x28')],function(_0x527262){return{'name':_0x527262[_0x1787('0x29')],'type':_0x527262[_0x1787('0x2a')][_0x1787('0x2b')]};});_0x4bef13['model']=_[_0x1787('0x2c')](_0x173819,_0x1787('0x25'));_0x4bef13[_0x1787('0x2d')]=_[_0x1787('0x2e')](_0x8a3d71[_0x1787('0x2d')]);_0x4bef13['filters']=_[_0x1787('0x2f')](_0x4bef13['model'],_0x4bef13['query']);_0x2a5493[_0x1787('0x30')]=_[_0x1787('0x2f')](_0x4bef13['model'],qs[_0x1787('0x31')](_0x8a3d71[_0x1787('0x2d')]['fields']));_0x2a5493[_0x1787('0x30')]=_0x2a5493[_0x1787('0x30')][_0x1787('0x32')]?_0x2a5493[_0x1787('0x30')]:_0x4bef13[_0x1787('0x33')];if(!_0x8a3d71[_0x1787('0x2d')][_0x1787('0x34')](_0x1787('0x35'))){_0x2a5493[_0x1787('0x36')]=qs[_0x1787('0x36')](_0x8a3d71['query'][_0x1787('0x36')]);_0x2a5493['offset']=qs[_0x1787('0x18')](_0x8a3d71[_0x1787('0x2d')][_0x1787('0x18')]);}_0x2a5493['order']=qs['sort'](_0x8a3d71[_0x1787('0x2d')][_0x1787('0x37')]);_0x2a5493['where']=qs[_0x1787('0x38')](_[_0x1787('0x39')](_0x8a3d71[_0x1787('0x2d')],_0x4bef13['filters']),_0x173819);if(_0x8a3d71[_0x1787('0x2d')][_0x1787('0x3a')]){_0x2a5493[_0x1787('0x3b')]=_[_0x1787('0x3c')](_0x2a5493['where'],{'$or':_['map'](_0x173819,function(_0xe8d0fa){if(_0xe8d0fa[_0x1787('0x2a')]!==_0x1787('0x3d')){var _0x488768={};_0x488768[_0xe8d0fa[_0x1787('0x25')]]={'$like':'%'+_0x8a3d71[_0x1787('0x2d')]['filter']+'%'};return _0x488768;}})});}_0x2a5493=_[_0x1787('0x3c')]({},_0x2a5493,_0x8a3d71[_0x1787('0x3e')]);var _0x714ea1={'where':_0x2a5493[_0x1787('0x3b')]};return db[_0x1787('0x3f')][_0x1787('0x1a')](_0x714ea1)[_0x1787('0x1f')](function(_0x83758b){_0x124735[_0x1787('0x1a')]=_0x83758b;if(_0x8a3d71[_0x1787('0x2d')]['includeAll']){_0x2a5493[_0x1787('0x40')]=[{'all':!![]}];}return db[_0x1787('0x3f')][_0x1787('0x41')](_0x2a5493);})[_0x1787('0x1f')](function(_0x365006){_0x124735[_0x1787('0x42')]=_0x365006;return _0x124735;})['then'](respondWithFilteredResult(_0x23995a,_0x2a5493))[_0x1787('0x43')](handleError(_0x23995a,null));};exports['show']=function(_0x24c6d4,_0x1ddf73){var _0x545c9a={'raw':!![],'where':{'id':_0x24c6d4['params']['id']}},_0x49cf44={};_0x49cf44[_0x1787('0x33')]=_[_0x1787('0x2e')](db[_0x1787('0x3f')][_0x1787('0x28')]);_0x49cf44['query']=_['keys'](_0x24c6d4[_0x1787('0x2d')]);_0x49cf44['filters']=_['intersection'](_0x49cf44[_0x1787('0x33')],_0x49cf44[_0x1787('0x2d')]);_0x545c9a['attributes']=_[_0x1787('0x2f')](_0x49cf44[_0x1787('0x33')],qs[_0x1787('0x31')](_0x24c6d4[_0x1787('0x2d')][_0x1787('0x31')]));_0x545c9a[_0x1787('0x30')]=_0x545c9a[_0x1787('0x30')]['length']?_0x545c9a[_0x1787('0x30')]:_0x49cf44[_0x1787('0x33')];if(_0x24c6d4['query'][_0x1787('0x44')]){_0x545c9a[_0x1787('0x40')]=[{'all':!![]}];}_0x545c9a=_[_0x1787('0x3c')]({},_0x545c9a,_0x24c6d4['options']);return db[_0x1787('0x3f')][_0x1787('0x45')](_0x545c9a)['then'](handleEntityNotFound(_0x1ddf73,null))[_0x1787('0x1f')](respondWithResult(_0x1ddf73,null))['catch'](handleError(_0x1ddf73,null));};exports[_0x1787('0x46')]=function(_0x484e01,_0x426664){return db[_0x1787('0x3f')][_0x1787('0x46')](_0x484e01[_0x1787('0x47')],{})[_0x1787('0x1f')](function(_0x35ca57){var _0x20bdac=_0x484e01[_0x1787('0x48')][_0x1787('0x21')]({'plain':!![]});if(!_0x20bdac)throw new Error(_0x1787('0x49'));if(_0x20bdac['role']===_0x1787('0x48')){var _0x5ef7b9=_0x35ca57[_0x1787('0x21')]({'plain':!![]});var _0x156405=_0x1787('0x22');return db[_0x1787('0x4a')]['find']({'where':{'name':_0x156405,'userProfileId':_0x20bdac[_0x1787('0x4b')]},'raw':!![]})['then'](function(_0x3bdbf2){if(_0x3bdbf2&&_0x3bdbf2[_0x1787('0x4c')]===0x0){return db[_0x1787('0x23')][_0x1787('0x46')]({'name':_0x5ef7b9[_0x1787('0x25')],'resourceId':_0x5ef7b9['id'],'type':_0x3bdbf2['name'],'sectionId':_0x3bdbf2['id']},{})['then'](function(){return _0x35ca57;});}else{return _0x35ca57;}})['catch'](function(_0x3f6a50){logger['error'](_0x1787('0x4d'),_0x3f6a50);throw _0x3f6a50;});}return _0x35ca57;})[_0x1787('0x1f')](respondWithResult(_0x426664,0xc9))['catch'](handleError(_0x426664,null));};exports[_0x1787('0x1e')]=function(_0x294c22,_0x2aff5c){if(_0x294c22[_0x1787('0x47')]['id']){delete _0x294c22[_0x1787('0x47')]['id'];}return db[_0x1787('0x3f')][_0x1787('0x45')]({'where':{'id':_0x294c22['params']['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x2aff5c,null))[_0x1787('0x1f')](saveUpdates(_0x294c22['body'],null))[_0x1787('0x1f')](respondWithResult(_0x2aff5c,null))[_0x1787('0x43')](handleError(_0x2aff5c,null));};exports[_0x1787('0x20')]=function(_0x3ded06,_0x5cc6c6){return db[_0x1787('0x3f')]['find']({'where':{'id':_0x3ded06[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x5cc6c6,null))[_0x1787('0x1f')](removeEntity(_0x5cc6c6,null))['catch'](handleError(_0x5cc6c6,null));};exports['addInterval']=function(_0x4ea1a2,_0x268d10,_0x2c13c2){if(_0x4ea1a2[_0x1787('0x47')]['id']){delete _0x4ea1a2[_0x1787('0x47')]['id'];}return db[_0x1787('0x3f')][_0x1787('0x45')]({'where':{'id':_0x4ea1a2[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x268d10,null))[_0x1787('0x1f')](function(_0x321b00){if(_0x321b00){_0x4ea1a2[_0x1787('0x47')][_0x1787('0x4f')]=_0x321b00['id'];return db[_0x1787('0x3f')][_0x1787('0x46')](_0x4ea1a2[_0x1787('0x47')]);}})['then'](respondWithResult(_0x268d10,null))['catch'](handleError(_0x268d10,null));};exports[_0x1787('0x50')]=function(_0x2a6c6b,_0x2d5603,_0x2c1447){var _0x354ba6={};var _0x18a8da={};var _0x4f5fbb;var _0x3e2e1a;return db[_0x1787('0x3f')]['findOne']({'where':{'id':_0x2a6c6b[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x2d5603,null))[_0x1787('0x1f')](function(_0x3aedb7){if(_0x3aedb7){_0x4f5fbb=_0x3aedb7;_0x18a8da[_0x1787('0x33')]=_[_0x1787('0x2e')](db[_0x1787('0x3f')]['rawAttributes']);_0x18a8da[_0x1787('0x2d')]=_[_0x1787('0x2e')](_0x2a6c6b[_0x1787('0x2d')]);_0x18a8da[_0x1787('0x38')]=_['intersection'](_0x18a8da[_0x1787('0x33')],_0x18a8da['query']);_0x354ba6[_0x1787('0x30')]=_[_0x1787('0x2f')](_0x18a8da[_0x1787('0x33')],qs['fields'](_0x2a6c6b[_0x1787('0x2d')]['fields']));_0x354ba6[_0x1787('0x30')]=_0x354ba6['attributes'][_0x1787('0x32')]?_0x354ba6[_0x1787('0x30')]:_0x18a8da['model'];_0x354ba6[_0x1787('0x51')]=qs[_0x1787('0x37')](_0x2a6c6b[_0x1787('0x2d')]['sort']);_0x354ba6[_0x1787('0x3b')]=qs['filters'](_[_0x1787('0x39')](_0x2a6c6b[_0x1787('0x2d')],_0x18a8da[_0x1787('0x38')]));if(_0x2a6c6b[_0x1787('0x2d')][_0x1787('0x3a')]){_0x354ba6[_0x1787('0x3b')]=_['merge'](_0x354ba6[_0x1787('0x3b')],{'$or':_['map'](_0x354ba6[_0x1787('0x30')],function(_0x541a53){var _0x266627={};_0x266627[_0x541a53]={'$like':'%'+_0x2a6c6b[_0x1787('0x2d')][_0x1787('0x3a')]+'%'};return _0x266627;})});}_0x354ba6=_[_0x1787('0x3c')]({},_0x354ba6,_0x2a6c6b[_0x1787('0x3e')]);return _0x4f5fbb[_0x1787('0x50')](_0x354ba6);}})[_0x1787('0x1f')](function(_0x172533){if(_0x172533){_0x3e2e1a=_0x172533[_0x1787('0x32')];if(!_0x2a6c6b['query'][_0x1787('0x34')](_0x1787('0x35'))){_0x354ba6[_0x1787('0x36')]=qs[_0x1787('0x36')](_0x2a6c6b['query'][_0x1787('0x36')]);_0x354ba6[_0x1787('0x18')]=qs['offset'](_0x2a6c6b[_0x1787('0x2d')]['offset']);}return _0x4f5fbb[_0x1787('0x50')](_0x354ba6);}})[_0x1787('0x1f')](function(_0x4e910c){if(_0x4e910c){return _0x4e910c?{'count':_0x3e2e1a,'rows':_0x4e910c}:null;}})[_0x1787('0x1f')](respondWithResult(_0x2d5603,null))[_0x1787('0x43')](handleError(_0x2d5603,null));};exports['addIntervals']=function(_0xd5d9d4,_0x24ef1f,_0x3454d3){return db[_0x1787('0x3f')][_0x1787('0x52')]({'where':{'id':_0xd5d9d4[_0x1787('0x4e')]['id']}})[_0x1787('0x1f')](handleEntityNotFound(_0x24ef1f,null))[_0x1787('0x1f')](function(_0x38d583){if(_0x38d583){return db[_0x1787('0x53')][_0x1787('0x54')](function(_0x35c47d){return db[_0x1787('0x3f')][_0x1787('0x20')]({'where':{'IntervalId':_0xd5d9d4[_0x1787('0x4e')]['id']},'transaction':_0x35c47d})[_0x1787('0x1f')](function(_0x23e90d){var _0x59e6c5=_[_0x1787('0x2c')](_0xd5d9d4[_0x1787('0x47')],function(_0x2c8a37){delete _0x2c8a37['id'];_0x2c8a37[_0x1787('0x4f')]=_0xd5d9d4[_0x1787('0x4e')]['id'];return _0x2c8a37;});return db[_0x1787('0x3f')][_0x1787('0x55')](_0x59e6c5,{'transaction':_0x35c47d});});})[_0x1787('0x1f')](function(){return db[_0x1787('0x3f')][_0x1787('0x41')]({'where':{'IntervalId':_0xd5d9d4[_0x1787('0x4e')]['id']}});});}})[_0x1787('0x1f')](respondWithResult(_0x24ef1f,null))[_0x1787('0x43')](handleError(_0x24ef1f,null));};
\ No newline at end of file
+var _0x73f4=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','findOne','pick','filter','getIntervals','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','get','Intervals','UserProfileResource','sendStatus','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find'];(function(_0x48279f,_0x126110){var _0x480985=function(_0x1c47b4){while(--_0x1c47b4){_0x48279f['push'](_0x48279f['shift']());}};_0x480985(++_0x126110);}(_0x73f4,0x124));var _0x473f=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x73f4[_0x209fcd];return _0x501d5e;};'use strict';var emlformat=require(_0x473f('0x0'));var rimraf=require(_0x473f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x473f('0x2'));var moment=require(_0x473f('0x3'));var BPromise=require(_0x473f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x473f('0x5'));var sox=require(_0x473f('0x6'));var csv=require('to-csv');var ejs=require(_0x473f('0x7'));var fs=require('fs');var fs_extra=require(_0x473f('0x8'));var _=require('lodash');var squel=require(_0x473f('0x9'));var crypto=require('crypto');var jsforce=require(_0x473f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x473f('0xb'));var querystring=require(_0x473f('0xc'));var Papa=require(_0x473f('0xd'));var Redis=require(_0x473f('0xe'));var authService=require(_0x473f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x473f('0x10'));var hardwareService=require(_0x473f('0x11'));var logger=require(_0x473f('0x12'))(_0x473f('0x13'));var utils=require(_0x473f('0x14'));var config=require(_0x473f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x473f('0x16'))['db'];var extensions=require(_0x473f('0x17'));function respondWithStatusCode(_0x6ffc1d,_0x5ecd53){_0x5ecd53=_0x5ecd53||0xcc;return function(_0x53f997){if(_0x53f997){return _0x6ffc1d['sendStatus'](_0x5ecd53);}return _0x6ffc1d['status'](_0x5ecd53)[_0x473f('0x18')]();};}function respondWithResult(_0x76fc0b,_0x2bfc42){_0x2bfc42=_0x2bfc42||0xc8;return function(_0x5729ce){if(_0x5729ce){return _0x76fc0b[_0x473f('0x19')](_0x2bfc42)['json'](_0x5729ce);}};}function respondWithFilteredResult(_0x363d27,_0x162975){return function(_0x4209ef){if(_0x4209ef){var _0x2291b6=typeof _0x162975[_0x473f('0x1a')]===_0x473f('0x1b')&&typeof _0x162975[_0x473f('0x1c')]===_0x473f('0x1b');var _0x1ca2d4=_0x4209ef[_0x473f('0x1d')];var _0x264bd1=_0x2291b6?0x0:_0x162975['offset'];var _0x54e489=_0x2291b6?_0x4209ef['count']:_0x162975[_0x473f('0x1a')]+_0x162975[_0x473f('0x1c')];var _0x2ee5d6;if(_0x54e489>=_0x1ca2d4){_0x54e489=_0x1ca2d4;_0x2ee5d6=0xc8;}else{_0x2ee5d6=0xce;}_0x363d27['status'](_0x2ee5d6);return _0x363d27['set'](_0x473f('0x1e'),_0x264bd1+'-'+_0x54e489+'/'+_0x1ca2d4)[_0x473f('0x1f')](_0x4209ef);}return null;};}function patchUpdates(_0x4506e6){return function(_0xb7e19b){try{jsonpatch['apply'](_0xb7e19b,_0x4506e6,!![]);}catch(_0x274390){return BPromise[_0x473f('0x20')](_0x274390);}return _0xb7e19b[_0x473f('0x21')]();};}function saveUpdates(_0x16788b,_0x43d062){return function(_0x47d635){if(_0x47d635){return _0x47d635[_0x473f('0x22')](_0x16788b)['then'](function(_0x182e94){return _0x182e94;});}return null;};}function removeEntity(_0x319a03,_0x55f99f){return function(_0x24e37e){if(_0x24e37e){return _0x24e37e[_0x473f('0x23')]()[_0x473f('0x24')](function(){var _0x27f412=_0x24e37e[_0x473f('0x25')]({'plain':!![]});var _0x22f52c=_0x473f('0x26');return db[_0x473f('0x27')][_0x473f('0x23')]({'where':{'type':_0x22f52c,'resourceId':_0x27f412['id']}})['then'](function(){return _0x24e37e;});})[_0x473f('0x24')](function(){_0x319a03[_0x473f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f6bb,_0x37ea68){return function(_0x2a1cf6){if(!_0x2a1cf6){_0x21f6bb[_0x473f('0x28')](0x194);}return _0x2a1cf6;};}function handleError(_0x68a0c3,_0x544bca){_0x544bca=_0x544bca||0x1f4;return function(_0x333f7b){logger[_0x473f('0x29')](_0x333f7b['stack']);if(_0x333f7b['name']){delete _0x333f7b[_0x473f('0x2a')];}_0x68a0c3[_0x473f('0x19')](_0x544bca)[_0x473f('0x2b')](_0x333f7b);};}exports[_0x473f('0x2c')]=function(_0x3aeada,_0x46b5bc){var _0x1136ad={},_0x4ced33={},_0x305308={'count':0x0,'rows':[]};var _0x2d5b1d=_[_0x473f('0x2d')](db[_0x473f('0x2e')][_0x473f('0x2f')],function(_0x4aeb96){return{'name':_0x4aeb96[_0x473f('0x30')],'type':_0x4aeb96[_0x473f('0x31')][_0x473f('0x32')]};});_0x4ced33[_0x473f('0x33')]=_[_0x473f('0x2d')](_0x2d5b1d,'name');_0x4ced33['query']=_[_0x473f('0x34')](_0x3aeada[_0x473f('0x35')]);_0x4ced33[_0x473f('0x36')]=_[_0x473f('0x37')](_0x4ced33['model'],_0x4ced33['query']);_0x1136ad[_0x473f('0x38')]=_[_0x473f('0x37')](_0x4ced33[_0x473f('0x33')],qs[_0x473f('0x39')](_0x3aeada[_0x473f('0x35')][_0x473f('0x39')]));_0x1136ad['attributes']=_0x1136ad[_0x473f('0x38')][_0x473f('0x3a')]?_0x1136ad[_0x473f('0x38')]:_0x4ced33[_0x473f('0x33')];if(!_0x3aeada[_0x473f('0x35')]['hasOwnProperty']('nolimit')){_0x1136ad[_0x473f('0x1c')]=qs['limit'](_0x3aeada[_0x473f('0x35')][_0x473f('0x1c')]);_0x1136ad['offset']=qs[_0x473f('0x1a')](_0x3aeada['query']['offset']);}_0x1136ad[_0x473f('0x3b')]=qs[_0x473f('0x3c')](_0x3aeada[_0x473f('0x35')]['sort']);_0x1136ad['where']=qs['filters'](_['pick'](_0x3aeada[_0x473f('0x35')],_0x4ced33[_0x473f('0x36')]),_0x2d5b1d);if(_0x3aeada['query']['filter']){_0x1136ad[_0x473f('0x3d')]=_['merge'](_0x1136ad[_0x473f('0x3d')],{'$or':_[_0x473f('0x2d')](_0x2d5b1d,function(_0x533f58){if(_0x533f58[_0x473f('0x31')]!==_0x473f('0x3e')){var _0x29bc68={};_0x29bc68[_0x533f58[_0x473f('0x2a')]]={'$like':'%'+_0x3aeada[_0x473f('0x35')]['filter']+'%'};return _0x29bc68;}})});}_0x1136ad=_[_0x473f('0x3f')]({},_0x1136ad,_0x3aeada[_0x473f('0x40')]);var _0x38071f={'where':_0x1136ad[_0x473f('0x3d')]};return db[_0x473f('0x2e')][_0x473f('0x1d')](_0x38071f)[_0x473f('0x24')](function(_0x14dc4e){_0x305308[_0x473f('0x1d')]=_0x14dc4e;if(_0x3aeada[_0x473f('0x35')][_0x473f('0x41')]){_0x1136ad[_0x473f('0x42')]=[{'all':!![]}];}return db['Interval'][_0x473f('0x43')](_0x1136ad);})[_0x473f('0x24')](function(_0x3b441a){_0x305308['rows']=_0x3b441a;return _0x305308;})['then'](respondWithFilteredResult(_0x46b5bc,_0x1136ad))[_0x473f('0x44')](handleError(_0x46b5bc,null));};exports[_0x473f('0x45')]=function(_0x46f365,_0x24180a){var _0xc29e90={'raw':!![],'where':{'id':_0x46f365[_0x473f('0x46')]['id']}},_0x56c7b7={};_0x56c7b7['model']=_[_0x473f('0x34')](db[_0x473f('0x2e')][_0x473f('0x2f')]);_0x56c7b7[_0x473f('0x35')]=_[_0x473f('0x34')](_0x46f365[_0x473f('0x35')]);_0x56c7b7['filters']=_[_0x473f('0x37')](_0x56c7b7[_0x473f('0x33')],_0x56c7b7[_0x473f('0x35')]);_0xc29e90[_0x473f('0x38')]=_[_0x473f('0x37')](_0x56c7b7[_0x473f('0x33')],qs[_0x473f('0x39')](_0x46f365[_0x473f('0x35')][_0x473f('0x39')]));_0xc29e90['attributes']=_0xc29e90[_0x473f('0x38')][_0x473f('0x3a')]?_0xc29e90[_0x473f('0x38')]:_0x56c7b7['model'];if(_0x46f365[_0x473f('0x35')][_0x473f('0x41')]){_0xc29e90[_0x473f('0x42')]=[{'all':!![]}];}_0xc29e90=_[_0x473f('0x3f')]({},_0xc29e90,_0x46f365[_0x473f('0x40')]);return db[_0x473f('0x2e')][_0x473f('0x47')](_0xc29e90)[_0x473f('0x24')](handleEntityNotFound(_0x24180a,null))[_0x473f('0x24')](respondWithResult(_0x24180a,null))[_0x473f('0x44')](handleError(_0x24180a,null));};exports[_0x473f('0x48')]=function(_0x50db4b,_0x615a85){return db['Interval']['create'](_0x50db4b['body'],{})[_0x473f('0x24')](function(_0x5aca93){var _0x2d7a22=_0x50db4b[_0x473f('0x49')][_0x473f('0x25')]({'plain':!![]});if(!_0x2d7a22)throw new Error(_0x473f('0x4a'));if(_0x2d7a22[_0x473f('0x4b')]===_0x473f('0x49')){var _0x164353=_0x5aca93[_0x473f('0x25')]({'plain':!![]});var _0x5c913d=_0x473f('0x26');return db['UserProfileSection'][_0x473f('0x47')]({'where':{'name':_0x5c913d,'userProfileId':_0x2d7a22[_0x473f('0x4c')]},'raw':!![]})['then'](function(_0x4cccdb){if(_0x4cccdb&&_0x4cccdb[_0x473f('0x4d')]===0x0){return db['UserProfileResource'][_0x473f('0x48')]({'name':_0x164353[_0x473f('0x2a')],'resourceId':_0x164353['id'],'type':_0x4cccdb[_0x473f('0x2a')],'sectionId':_0x4cccdb['id']},{})[_0x473f('0x24')](function(){return _0x5aca93;});}else{return _0x5aca93;}})['catch'](function(_0x1e893b){logger[_0x473f('0x29')](_0x473f('0x4e'),_0x1e893b);throw _0x1e893b;});}return _0x5aca93;})['then'](respondWithResult(_0x615a85,0xc9))[_0x473f('0x44')](handleError(_0x615a85,null));};exports[_0x473f('0x22')]=function(_0x53abc7,_0x2b562e){if(_0x53abc7[_0x473f('0x4f')]['id']){delete _0x53abc7['body']['id'];}return db['Interval'][_0x473f('0x47')]({'where':{'id':_0x53abc7[_0x473f('0x46')]['id']}})[_0x473f('0x24')](handleEntityNotFound(_0x2b562e,null))[_0x473f('0x24')](saveUpdates(_0x53abc7[_0x473f('0x4f')],null))[_0x473f('0x24')](respondWithResult(_0x2b562e,null))['catch'](handleError(_0x2b562e,null));};exports[_0x473f('0x23')]=function(_0x1f8942,_0x2cf73f){return db[_0x473f('0x2e')][_0x473f('0x47')]({'where':{'id':_0x1f8942[_0x473f('0x46')]['id']}})[_0x473f('0x24')](handleEntityNotFound(_0x2cf73f,null))[_0x473f('0x24')](removeEntity(_0x2cf73f,null))['catch'](handleError(_0x2cf73f,null));};exports['addInterval']=function(_0x5ce247,_0x58d4dd,_0x18e3a6){if(_0x5ce247['body']['id']){delete _0x5ce247[_0x473f('0x4f')]['id'];}return db['Interval']['find']({'where':{'id':_0x5ce247[_0x473f('0x46')]['id']}})[_0x473f('0x24')](handleEntityNotFound(_0x58d4dd,null))[_0x473f('0x24')](function(_0x30b4ed){if(_0x30b4ed){_0x5ce247[_0x473f('0x4f')][_0x473f('0x50')]=_0x30b4ed['id'];return db['Interval'][_0x473f('0x48')](_0x5ce247['body']);}})[_0x473f('0x24')](respondWithResult(_0x58d4dd,null))[_0x473f('0x44')](handleError(_0x58d4dd,null));};exports['getIntervals']=function(_0x374372,_0x172a00,_0x23e976){var _0x476f1a={};var _0x165bf6={};var _0x51493c;var _0x155f40;return db[_0x473f('0x2e')][_0x473f('0x51')]({'where':{'id':_0x374372['params']['id']}})[_0x473f('0x24')](handleEntityNotFound(_0x172a00,null))[_0x473f('0x24')](function(_0x505b93){if(_0x505b93){_0x51493c=_0x505b93;_0x165bf6[_0x473f('0x33')]=_[_0x473f('0x34')](db[_0x473f('0x2e')][_0x473f('0x2f')]);_0x165bf6[_0x473f('0x35')]=_['keys'](_0x374372[_0x473f('0x35')]);_0x165bf6[_0x473f('0x36')]=_[_0x473f('0x37')](_0x165bf6['model'],_0x165bf6[_0x473f('0x35')]);_0x476f1a['attributes']=_[_0x473f('0x37')](_0x165bf6['model'],qs[_0x473f('0x39')](_0x374372['query'][_0x473f('0x39')]));_0x476f1a['attributes']=_0x476f1a[_0x473f('0x38')]['length']?_0x476f1a[_0x473f('0x38')]:_0x165bf6[_0x473f('0x33')];_0x476f1a['order']=qs[_0x473f('0x3c')](_0x374372[_0x473f('0x35')]['sort']);_0x476f1a[_0x473f('0x3d')]=qs[_0x473f('0x36')](_[_0x473f('0x52')](_0x374372[_0x473f('0x35')],_0x165bf6[_0x473f('0x36')]));if(_0x374372[_0x473f('0x35')][_0x473f('0x53')]){_0x476f1a[_0x473f('0x3d')]=_[_0x473f('0x3f')](_0x476f1a[_0x473f('0x3d')],{'$or':_[_0x473f('0x2d')](_0x476f1a[_0x473f('0x38')],function(_0x45a6fa){var _0x46aaba={};_0x46aaba[_0x45a6fa]={'$like':'%'+_0x374372[_0x473f('0x35')][_0x473f('0x53')]+'%'};return _0x46aaba;})});}_0x476f1a=_[_0x473f('0x3f')]({},_0x476f1a,_0x374372[_0x473f('0x40')]);return _0x51493c[_0x473f('0x54')](_0x476f1a);}})[_0x473f('0x24')](function(_0x26797c){if(_0x26797c){_0x155f40=_0x26797c[_0x473f('0x3a')];if(!_0x374372[_0x473f('0x35')][_0x473f('0x55')](_0x473f('0x56'))){_0x476f1a[_0x473f('0x1c')]=qs[_0x473f('0x1c')](_0x374372[_0x473f('0x35')][_0x473f('0x1c')]);_0x476f1a[_0x473f('0x1a')]=qs[_0x473f('0x1a')](_0x374372[_0x473f('0x35')]['offset']);}return _0x51493c['getIntervals'](_0x476f1a);}})['then'](function(_0x233876){if(_0x233876){return _0x233876?{'count':_0x155f40,'rows':_0x233876}:null;}})[_0x473f('0x24')](respondWithResult(_0x172a00,null))[_0x473f('0x44')](handleError(_0x172a00,null));};exports[_0x473f('0x57')]=function(_0x4ebb2c,_0x32d23d,_0x29151e){return db['Interval'][_0x473f('0x51')]({'where':{'id':_0x4ebb2c[_0x473f('0x46')]['id']}})[_0x473f('0x24')](handleEntityNotFound(_0x32d23d,null))[_0x473f('0x24')](function(_0x282498){if(_0x282498){return db[_0x473f('0x58')][_0x473f('0x59')](function(_0x3a9d8f){return db[_0x473f('0x2e')][_0x473f('0x23')]({'where':{'IntervalId':_0x4ebb2c['params']['id']},'transaction':_0x3a9d8f})[_0x473f('0x24')](function(_0x3a2876){var _0x4ee8ee=_[_0x473f('0x2d')](_0x4ebb2c[_0x473f('0x4f')],function(_0x34e495){delete _0x34e495['id'];_0x34e495[_0x473f('0x50')]=_0x4ebb2c[_0x473f('0x46')]['id'];return _0x34e495;});return db['Interval'][_0x473f('0x5a')](_0x4ee8ee,{'transaction':_0x3a9d8f});});})['then'](function(){return db[_0x473f('0x2e')][_0x473f('0x43')]({'where':{'IntervalId':_0x4ebb2c[_0x473f('0x46')]['id']}});});}})['then'](respondWithResult(_0x32d23d,null))['catch'](handleError(_0x32d23d,null));};
\ No newline at end of file
index fdd40c4..78ef5f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5232=['path','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x21860b,_0x41febf){var _0x4ff351=function(_0xf8c13f){while(--_0xf8c13f){_0x21860b['push'](_0x21860b['shift']());}};_0x4ff351(++_0x41febf);}(_0x5232,0x1c9));var _0x2523=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x5232[_0x29d6e6];return _0xc75ff0;};'use strict';var _=require(_0x2523('0x0'));var util=require(_0x2523('0x1'));var logger=require(_0x2523('0x2'))(_0x2523('0x3'));var moment=require(_0x2523('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2523('0x5'));var rimraf=require(_0x2523('0x6'));var config=require('../../config/environment');var attributes=require(_0x2523('0x7'));var extensions=require(_0x2523('0x8'));module[_0x2523('0x9')]=function(_0x45ae69,_0x3ab139){return _0x45ae69[_0x2523('0xa')](_0x2523('0xb'),attributes,{'tableName':_0x2523('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x251973,_0x39dca8){extensions[_0x2523('0xd')](_0x45ae69,_0x251973);},'afterBulkCreate':function(_0x30f2cd,_0x55e5bb,_0x1e6087){_0x1e6087();extensions[_0x2523('0xd')](_0x45ae69,_0x30f2cd[0x0]);},'afterUpdate':function(_0xb076a8,_0x2f6bf5){extensions[_0x2523('0xd')](_0x45ae69,_0xb076a8);},'afterDestroy':function(_0x3ea8fa,_0x5856d2){extensions[_0x2523('0xd')](_0x45ae69,_0x3ea8fa);}}});};
\ No newline at end of file
+var _0xae7d=['../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./interval.attributes'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xae7d,0xad));var _0xdae7=function(_0x47d795,_0x1cc414){_0x47d795=_0x47d795-0x0;var _0x5b6a62=_0xae7d[_0x47d795];return _0x5b6a62;};'use strict';var _=require(_0xdae7('0x0'));var util=require('util');var logger=require(_0xdae7('0x1'))('api');var moment=require(_0xdae7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdae7('0x3'));var rimraf=require(_0xdae7('0x4'));var config=require(_0xdae7('0x5'));var attributes=require(_0xdae7('0x6'));var extensions=require(_0xdae7('0x7'));module['exports']=function(_0x3e605b,_0x144a8e){return _0x3e605b[_0xdae7('0x8')](_0xdae7('0x9'),attributes,{'tableName':_0xdae7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x188efd,_0x24e0a){extensions[_0xdae7('0xb')](_0x3e605b,_0x188efd);},'afterBulkCreate':function(_0x544a1e,_0x2e2b87,_0x33e39d){_0x33e39d();extensions['rewrite'](_0x3e605b,_0x544a1e[0x0]);},'afterUpdate':function(_0x39d962,_0x30232c){extensions[_0xdae7('0xb')](_0x3e605b,_0x39d962);},'afterDestroy':function(_0x1a08a8,_0x76304b){extensions[_0xdae7('0xb')](_0x3e605b,_0x1a08a8);}}});};
\ No newline at end of file
index de56df4..e5d7107 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(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x3474ac,_0x22d0f7){var _0x5345ec=function(_0x45056e){while(--_0x45056e){_0x3474ac['push'](_0x3474ac['shift']());}};_0x5345ec(++_0x22d0f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 dcc504f..edcd019 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router;
\ No newline at end of file
+var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x4a509f,_0xe14c8d){var _0x15d990=function(_0x424bd1){while(--_0x424bd1){_0x4a509f['push'](_0x4a509f['shift']());}};_0x15d990(++_0xe14c8d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x181fba,_0x3e23f4){_0x181fba=_0x181fba-0x0;var _0x509d8d=_0x5f2f[_0x181fba];return _0x509d8d;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
index eb6ed07..b6d2bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ac=['application/json','request','setEncoding','data','end','json','parse','status','api.jira','openIssue','body','headers','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue'];(function(_0xeedbcc,_0x42f007){var _0x4a9b38=function(_0x3ad27b){while(--_0x3ad27b){_0xeedbcc['push'](_0xeedbcc['shift']());}};_0x4a9b38(++_0x42f007);}(_0x02ac,0xff));var _0xc02a=function(_0x1f5e05,_0x522d89){_0x1f5e05=_0x1f5e05-0x0;var _0x5d42c8=_0x02ac[_0x1f5e05];return _0x5d42c8;};'use strict';var BPromise=require(_0xc02a('0x0'));var https=require(_0xc02a('0x1'));var logger=require(_0xc02a('0x2'))(_0xc02a('0x3'));var USERNAME=_0xc02a('0x4');var PASSWORD=_0xc02a('0x5');function openIssue(_0x3311f3,_0x2570d6){var _0x33aa74={'fields':{'project':{'key':_0x3311f3[_0xc02a('0x6')]||_0xc02a('0x7')},'summary':(_0x3311f3[_0xc02a('0x8')]||_0xc02a('0x9'))+_0xc02a('0xa')+_0x3311f3['ip'],'description':_0x3311f3[_0xc02a('0xb')]||JSON[_0xc02a('0xc')](_0x3311f3),'issuetype':{'name':_0x3311f3[_0xc02a('0xd')]||_0xc02a('0xe')}}};_0x33aa74[_0xc02a('0xf')]['customfield_11500']=_0x3311f3[_0xc02a('0x10')];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x11')]=_0x3311f3[_0xc02a('0x12')];_0x33aa74[_0xc02a('0xf')]['customfield_11502']=_0x3311f3[_0xc02a('0x13')];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x14')]=_0x3311f3[_0xc02a('0x15')];_0x33aa74['fields'][_0xc02a('0x16')]=_0x3311f3['reason'];_0x33aa74[_0xc02a('0xf')][_0xc02a('0x17')]=_0x3311f3['ip'];var _0x27b5d8={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xc02a('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xc02a('0x19'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x3cd259=JSON['stringify'](_0x33aa74);var _0x2d04b6=https[_0xc02a('0x1a')](_0x27b5d8,function(_0x2ddf04){_0x2ddf04[_0xc02a('0x1b')]('utf8');var _0x5c07f0='';_0x2ddf04['on'](_0xc02a('0x1c'),function(_0x7c49d){_0x5c07f0+=_0x7c49d;});_0x2ddf04['on'](_0xc02a('0x1d'),function(){if(_0x2570d6){return _0x2570d6['status'](_0x2ddf04['statusCode'])[_0xc02a('0x1e')](JSON[_0xc02a('0x1f')](_0x5c07f0));}});});_0x2d04b6['on']('error',function(_0x588c4d){if(_0x2570d6){return _0x2570d6[_0xc02a('0x20')](0x1f4)[_0xc02a('0x1e')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xc02a('0x21')}]});}});_0x2d04b6['write'](_0x3cd259);_0x2d04b6[_0xc02a('0x1d')]();}exports[_0xc02a('0x22')]=openIssue;exports['send']=function(_0x394161,_0x29e021){_0x394161[_0xc02a('0x23')]['ip']=_0x394161[_0xc02a('0x24')]['x-forwarded-for']||_0x394161['connection'][_0xc02a('0x25')]||_0x394161[_0xc02a('0x26')]['remoteAddress']||_0x394161[_0xc02a('0x27')][_0xc02a('0x26')][_0xc02a('0x25')];return openIssue(_0x394161['body'],_0x29e021);};
\ No newline at end of file
+var _0x228c=['api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','email','customfield_11501','customfield_11502','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','base64','setEncoding','data','end','parse','error','status','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','https'];(function(_0xf27e05,_0x52af08){var _0x216124=function(_0x3320d1){while(--_0x3320d1){_0xf27e05['push'](_0xf27e05['shift']());}};_0x216124(++_0x52af08);}(_0x228c,0x125));var _0xc228=function(_0x227ee6,_0xb0a179){_0x227ee6=_0x227ee6-0x0;var _0x17371d=_0x228c[_0x227ee6];return _0x17371d;};'use strict';var BPromise=require('bluebird');var https=require(_0xc228('0x0'));var logger=require('../../config/logger')(_0xc228('0x1'));var USERNAME=_0xc228('0x2');var PASSWORD=_0xc228('0x3');function openIssue(_0x1c1b57,_0x39a0e7){var _0x5006d5={'fields':{'project':{'key':_0x1c1b57[_0xc228('0x4')]||_0xc228('0x5')},'summary':(_0x1c1b57[_0xc228('0x6')]||'Report')+_0xc228('0x7')+_0x1c1b57['ip'],'description':_0x1c1b57[_0xc228('0x8')]||JSON[_0xc228('0x9')](_0x1c1b57),'issuetype':{'name':_0x1c1b57[_0xc228('0xa')]||_0xc228('0xb')}}};_0x5006d5[_0xc228('0xc')]['customfield_11500']=_0x1c1b57[_0xc228('0xd')];_0x5006d5['fields'][_0xc228('0xe')]=_0x1c1b57['oldToken'];_0x5006d5[_0xc228('0xc')][_0xc228('0xf')]=_0x1c1b57[_0xc228('0x10')];_0x5006d5[_0xc228('0xc')]['customfield_11503']=_0x1c1b57[_0xc228('0x11')];_0x5006d5['fields'][_0xc228('0x12')]=_0x1c1b57[_0xc228('0x13')];_0x5006d5['fields'][_0xc228('0x14')]=_0x1c1b57['ip'];var _0x447f35={'host':_0xc228('0x15'),'port':0x1bb,'path':_0xc228('0x16'),'method':_0xc228('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xc228('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xc228('0x19'))}};var _0x10130a=JSON['stringify'](_0x5006d5);var _0x4a7c82=https['request'](_0x447f35,function(_0x1d1094){_0x1d1094[_0xc228('0x1a')]('utf8');var _0x1cd54a='';_0x1d1094['on'](_0xc228('0x1b'),function(_0x2deada){_0x1cd54a+=_0x2deada;});_0x1d1094['on'](_0xc228('0x1c'),function(){if(_0x39a0e7){return _0x39a0e7['status'](_0x1d1094['statusCode'])['json'](JSON[_0xc228('0x1d')](_0x1cd54a));}});});_0x4a7c82['on'](_0xc228('0x1e'),function(_0x8693c4){if(_0x39a0e7){return _0x39a0e7[_0xc228('0x1f')](0x1f4)[_0xc228('0x20')]({'errors':[{'message':_0xc228('0x21'),'type':_0xc228('0x22')}]});}});_0x4a7c82['write'](_0x10130a);_0x4a7c82[_0xc228('0x1c')]();}exports['openIssue']=openIssue;exports[_0xc228('0x23')]=function(_0x5e8a37,_0x2a5a9d){_0x5e8a37[_0xc228('0x24')]['ip']=_0x5e8a37[_0xc228('0x25')][_0xc228('0x26')]||_0x5e8a37[_0xc228('0x27')][_0xc228('0x28')]||_0x5e8a37[_0xc228('0x29')]['remoteAddress']||_0x5e8a37[_0xc228('0x27')][_0xc228('0x29')]['remoteAddress'];return openIssue(_0x5e8a37[_0xc228('0x24')],_0x2a5a9d);};
\ No newline at end of file
index 3209821..322e0df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports','multer','util','path'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0xf109,0xce));var _0x9f10=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf109[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var path=require(_0x9f10('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9f10('0x3'));var auth=require(_0x9f10('0x4'));var interaction=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var controller=require(_0x9f10('0x7'));router[_0x9f10('0x8')]('/',auth[_0x9f10('0x9')](),controller[_0x9f10('0xa')]);router[_0x9f10('0x8')](_0x9f10('0xb'),auth[_0x9f10('0x9')](),controller['describe']);router[_0x9f10('0x8')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller[_0x9f10('0xd')]);router[_0x9f10('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f10('0xf')]);router[_0x9f10('0x10')](_0x9f10('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9f10('0x11')](_0x9f10('0xc'),auth[_0x9f10('0x9')](),controller['destroy']);module[_0x9f10('0x12')]=router;
\ No newline at end of file
+var _0x0713=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x4cc142,_0x703e0){var _0x5f1eaa=function(_0x22f1cc){while(--_0x22f1cc){_0x4cc142['push'](_0x4cc142['shift']());}};_0x5f1eaa(++_0x703e0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')](_0x3071('0xd'),auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);module['exports']=router;
\ No newline at end of file
index 50ba5a7..7228b4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x7a54,0x106));var _0x47a5=function(_0x161f9f,_0x311f5d){_0x161f9f=_0x161f9f-0x0;var _0x5d9d6c=_0x7a54[_0x161f9f];return _0x5d9d6c;};'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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x6a2d7d,_0x306c79){_0x6a2d7d=_0x6a2d7d-0x0;var _0x1c13ee=_0x7a54[_0x6a2d7d];return _0x1c13ee;};'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 450bb7e..7479400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc474=['fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','JscriptyAnswerReport','rawAttributes'];(function(_0x49e7ca,_0xa937c7){var _0x50c225=function(_0x2cbde2){while(--_0x2cbde2){_0x49e7ca['push'](_0x49e7ca['shift']());}};_0x50c225(++_0xa937c7);}(_0xc474,0xfc));var _0x4c47=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xc474[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0x4c47('0x0'));var rimraf=require(_0x4c47('0x1'));var zipdir=require(_0x4c47('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c47('0x3'));var moment=require(_0x4c47('0x4'));var BPromise=require(_0x4c47('0x5'));var Mustache=require(_0x4c47('0x6'));var util=require(_0x4c47('0x7'));var path=require(_0x4c47('0x8'));var sox=require(_0x4c47('0x9'));var csv=require(_0x4c47('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c47('0xb'));var squel=require(_0x4c47('0xc'));var crypto=require(_0x4c47('0xd'));var jsforce=require(_0x4c47('0xe'));var deskjs=require(_0x4c47('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4c47('0x10'));var Papa=require(_0x4c47('0x11'));var Redis=require('ioredis');var authService=require(_0x4c47('0x12'));var qs=require(_0x4c47('0x13'));var as=require(_0x4c47('0x14'));var hardwareService=require(_0x4c47('0x15'));var logger=require('../../config/logger')(_0x4c47('0x16'));var utils=require('../../config/utils');var config=require(_0x4c47('0x17'));var licenseUtil=require(_0x4c47('0x18'));var db=require(_0x4c47('0x19'))['db'];function respondWithStatusCode(_0x496e7b,_0x429553){_0x429553=_0x429553||0xcc;return function(_0x16a4fd){if(_0x16a4fd){return _0x496e7b['sendStatus'](_0x429553);}return _0x496e7b[_0x4c47('0x1a')](_0x429553)['end']();};}function respondWithResult(_0x3d1b6a,_0x121f9e){_0x121f9e=_0x121f9e||0xc8;return function(_0x25d4dc){if(_0x25d4dc){return _0x3d1b6a[_0x4c47('0x1a')](_0x121f9e)['json'](_0x25d4dc);}};}function respondWithFilteredResult(_0xb53c24,_0x78f26b){return function(_0x16c7a9){if(_0x16c7a9){var _0xd162cc=typeof _0x78f26b['offset']==='undefined'&&typeof _0x78f26b['limit']===_0x4c47('0x1b');var _0x92a444=_0x16c7a9[_0x4c47('0x1c')];var _0x5727cf=_0xd162cc?0x0:_0x78f26b[_0x4c47('0x1d')];var _0x254dfc=_0xd162cc?_0x16c7a9[_0x4c47('0x1c')]:_0x78f26b[_0x4c47('0x1d')]+_0x78f26b['limit'];var _0x4cc984;if(_0x254dfc>=_0x92a444){_0x254dfc=_0x92a444;_0x4cc984=0xc8;}else{_0x4cc984=0xce;}_0xb53c24['status'](_0x4cc984);return _0xb53c24[_0x4c47('0x1e')](_0x4c47('0x1f'),_0x5727cf+'-'+_0x254dfc+'/'+_0x92a444)[_0x4c47('0x20')](_0x16c7a9);}return null;};}function patchUpdates(_0x3b156f){return function(_0x52de60){try{jsonpatch[_0x4c47('0x21')](_0x52de60,_0x3b156f,!![]);}catch(_0x27b61a){return BPromise[_0x4c47('0x22')](_0x27b61a);}return _0x52de60[_0x4c47('0x23')]();};}function saveUpdates(_0x20950c,_0x40a984){return function(_0x4d56eb){if(_0x4d56eb){return _0x4d56eb['update'](_0x20950c)['then'](function(_0x1a575a){return _0x1a575a;});}return null;};}function removeEntity(_0x275a10,_0x4d110d){return function(_0x3037a2){if(_0x3037a2){return _0x3037a2['destroy']()[_0x4c47('0x24')](function(){_0x275a10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592469,_0x3bacc9){return function(_0x3bd199){if(!_0x3bd199){_0x592469[_0x4c47('0x25')](0x194);}return _0x3bd199;};}function handleError(_0x4eff26,_0x33f440){_0x33f440=_0x33f440||0x1f4;return function(_0x2c0367){logger[_0x4c47('0x26')](_0x2c0367[_0x4c47('0x27')]);if(_0x2c0367[_0x4c47('0x28')]){delete _0x2c0367[_0x4c47('0x28')];}_0x4eff26[_0x4c47('0x1a')](_0x33f440)[_0x4c47('0x29')](_0x2c0367);};}exports['index']=function(_0x36e82b,_0x344a7d){var _0x590b56={},_0x491638={},_0x3b977d={'count':0x0,'rows':[]};var _0x56c130=_['map'](db[_0x4c47('0x2a')][_0x4c47('0x2b')],function(_0x12462a){return{'name':_0x12462a[_0x4c47('0x2c')],'type':_0x12462a[_0x4c47('0x2d')]['key']};});_0x491638[_0x4c47('0x2e')]=_['map'](_0x56c130,_0x4c47('0x28'));_0x491638[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x36e82b['query']);_0x491638['filters']=_['intersection'](_0x491638['model'],_0x491638[_0x4c47('0x2f')]);_0x590b56[_0x4c47('0x31')]=_[_0x4c47('0x32')](_0x491638['model'],qs[_0x4c47('0x33')](_0x36e82b['query'][_0x4c47('0x33')]));_0x590b56[_0x4c47('0x31')]=_0x590b56[_0x4c47('0x31')][_0x4c47('0x34')]?_0x590b56[_0x4c47('0x31')]:_0x491638[_0x4c47('0x2e')];if(!_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x35')]('nolimit')){_0x590b56[_0x4c47('0x36')]=qs[_0x4c47('0x36')](_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x36')]);_0x590b56['offset']=qs['offset'](_0x36e82b['query'][_0x4c47('0x1d')]);}_0x590b56[_0x4c47('0x37')]=qs[_0x4c47('0x38')](_0x36e82b['query']['sort']);_0x590b56['where']=qs['filters'](_[_0x4c47('0x39')](_0x36e82b[_0x4c47('0x2f')],_0x491638[_0x4c47('0x3a')]),_0x56c130);if(_0x36e82b[_0x4c47('0x2f')][_0x4c47('0x3b')]){_0x590b56['where']=_[_0x4c47('0x3c')](_0x590b56[_0x4c47('0x3d')],{'$or':_['map'](_0x56c130,function(_0x1c309b){if(_0x1c309b[_0x4c47('0x2d')]!==_0x4c47('0x3e')){var _0x418098={};_0x418098[_0x1c309b[_0x4c47('0x28')]]={'$like':'%'+_0x36e82b['query'][_0x4c47('0x3b')]+'%'};return _0x418098;}})});}_0x590b56=_[_0x4c47('0x3c')]({},_0x590b56,_0x36e82b[_0x4c47('0x3f')]);var _0x291666={'where':_0x590b56[_0x4c47('0x3d')]};return db['JscriptyAnswerReport'][_0x4c47('0x1c')](_0x291666)[_0x4c47('0x24')](function(_0x5a7135){_0x3b977d[_0x4c47('0x1c')]=_0x5a7135;if(_0x36e82b['query'][_0x4c47('0x40')]){_0x590b56[_0x4c47('0x41')]=[{'all':!![]}];}return db[_0x4c47('0x2a')]['findAll'](_0x590b56);})['then'](function(_0x164105){_0x3b977d[_0x4c47('0x42')]=_0x164105;return _0x3b977d;})[_0x4c47('0x24')](respondWithFilteredResult(_0x344a7d,_0x590b56))['catch'](handleError(_0x344a7d,null));};exports[_0x4c47('0x43')]=function(_0x10669d,_0x40057e){var _0x5a0b1f={'raw':!![],'where':{'id':_0x10669d[_0x4c47('0x44')]['id']}},_0x274596={};_0x274596[_0x4c47('0x2e')]=_[_0x4c47('0x30')](db[_0x4c47('0x2a')][_0x4c47('0x2b')]);_0x274596[_0x4c47('0x2f')]=_[_0x4c47('0x30')](_0x10669d[_0x4c47('0x2f')]);_0x274596[_0x4c47('0x3a')]=_['intersection'](_0x274596[_0x4c47('0x2e')],_0x274596[_0x4c47('0x2f')]);_0x5a0b1f['attributes']=_['intersection'](_0x274596[_0x4c47('0x2e')],qs[_0x4c47('0x33')](_0x10669d['query'][_0x4c47('0x33')]));_0x5a0b1f[_0x4c47('0x31')]=_0x5a0b1f[_0x4c47('0x31')][_0x4c47('0x34')]?_0x5a0b1f[_0x4c47('0x31')]:_0x274596['model'];if(_0x10669d['query'][_0x4c47('0x40')]){_0x5a0b1f[_0x4c47('0x41')]=[{'all':!![]}];}_0x5a0b1f=_[_0x4c47('0x3c')]({},_0x5a0b1f,_0x10669d[_0x4c47('0x3f')]);return db[_0x4c47('0x2a')][_0x4c47('0x45')](_0x5a0b1f)[_0x4c47('0x24')](handleEntityNotFound(_0x40057e,null))['then'](respondWithResult(_0x40057e,null))[_0x4c47('0x46')](handleError(_0x40057e,null));};exports['create']=function(_0x40bbec,_0x460fef){return db[_0x4c47('0x2a')]['create'](_0x40bbec[_0x4c47('0x47')],{})[_0x4c47('0x24')](respondWithResult(_0x460fef,0xc9))[_0x4c47('0x46')](handleError(_0x460fef,null));};exports['update']=function(_0x125b18,_0x4ccb67){if(_0x125b18[_0x4c47('0x47')]['id']){delete _0x125b18['body']['id'];}return db[_0x4c47('0x2a')]['find']({'where':{'id':_0x125b18[_0x4c47('0x44')]['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x4ccb67,null))[_0x4c47('0x24')](saveUpdates(_0x125b18[_0x4c47('0x47')],null))['then'](respondWithResult(_0x4ccb67,null))['catch'](handleError(_0x4ccb67,null));};exports[_0x4c47('0x48')]=function(_0x48ba62,_0x419ee3){return db[_0x4c47('0x2a')][_0x4c47('0x45')]({'where':{'id':_0x48ba62['params']['id']}})[_0x4c47('0x24')](handleEntityNotFound(_0x419ee3,null))[_0x4c47('0x24')](removeEntity(_0x419ee3,null))['catch'](handleError(_0x419ee3,null));};exports['describe']=function(_0x59d746,_0x479332){return db[_0x4c47('0x2a')][_0x4c47('0x49')]()[_0x4c47('0x24')](respondWithResult(_0x479332,null))[_0x4c47('0x46')](handleError(_0x479332,null));};
\ No newline at end of file
+var _0xc03e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x16a515,_0x4cf81e){var _0x219658=function(_0x197844){while(--_0x197844){_0x16a515['push'](_0x16a515['shift']());}};_0x219658(++_0x4cf81e);}(_0xc03e,0x15a));var _0xec03=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0xc03e[_0x2ab3d9];return _0x210a54;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={},_0x12b5c9={},_0x35a9eb={'count':0x0,'rows':[]};var _0x872f98=_[_0xec03('0x2c')](db[_0xec03('0x2d')][_0xec03('0x2e')],function(_0x28753c){return{'name':_0x28753c['fieldName'],'type':_0x28753c[_0xec03('0x2f')][_0xec03('0x30')]};});_0x12b5c9[_0xec03('0x31')]=_[_0xec03('0x2c')](_0x872f98,_0xec03('0x29'));_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x49f9ab[_0xec03('0x32')]);_0x12b5c9[_0xec03('0x34')]=_['intersection'](_0x12b5c9['model'],_0x12b5c9['query']);_0x2063ba[_0xec03('0x35')]=_[_0xec03('0x36')](_0x12b5c9[_0xec03('0x31')],qs[_0xec03('0x37')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba['attributes'][_0xec03('0x38')]?_0x2063ba[_0xec03('0x35')]:_0x12b5c9[_0xec03('0x31')];if(!_0x49f9ab[_0xec03('0x32')][_0xec03('0x39')](_0xec03('0x3a'))){_0x2063ba[_0xec03('0x20')]=qs[_0xec03('0x20')](_0x49f9ab[_0xec03('0x32')][_0xec03('0x20')]);_0x2063ba[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x49f9ab['query'][_0xec03('0x1d')]);}_0x2063ba[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_0x49f9ab['query'][_0xec03('0x3c')]);_0x2063ba[_0xec03('0x3d')]=qs[_0xec03('0x34')](_[_0xec03('0x3e')](_0x49f9ab[_0xec03('0x32')],_0x12b5c9[_0xec03('0x34')]),_0x872f98);if(_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]){_0x2063ba[_0xec03('0x3d')]=_[_0xec03('0x40')](_0x2063ba[_0xec03('0x3d')],{'$or':_['map'](_0x872f98,function(_0x25286a){if(_0x25286a[_0xec03('0x2f')]!==_0xec03('0x41')){var _0x3d6d70={};_0x3d6d70[_0x25286a[_0xec03('0x29')]]={'$like':'%'+_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]+'%'};return _0x3d6d70;}})});}_0x2063ba=_[_0xec03('0x40')]({},_0x2063ba,_0x49f9ab['options']);var _0x454e91={'where':_0x2063ba['where']};return db['JscriptyAnswerReport'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2063ba);})['then'](function(_0x494fec){_0x35a9eb[_0xec03('0x43')]=_0x494fec;return _0x35a9eb;})[_0xec03('0x26')](respondWithFilteredResult(_0x530251,_0x2063ba))[_0xec03('0x44')](handleError(_0x530251,null));};exports['show']=function(_0x1b1aea,_0x3f2522){var _0xe03df3={'raw':!![],'where':{'id':_0x1b1aea[_0xec03('0x45')]['id']}},_0x14a429={};_0x14a429[_0xec03('0x31')]=_[_0xec03('0x33')](db[_0xec03('0x2d')][_0xec03('0x2e')]);_0x14a429['query']=_[_0xec03('0x33')](_0x1b1aea[_0xec03('0x32')]);_0x14a429[_0xec03('0x34')]=_[_0xec03('0x36')](_0x14a429['model'],_0x14a429[_0xec03('0x32')]);_0xe03df3[_0xec03('0x35')]=_[_0xec03('0x36')](_0x14a429[_0xec03('0x31')],qs[_0xec03('0x37')](_0x1b1aea[_0xec03('0x32')]['fields']));_0xe03df3['attributes']=_0xe03df3[_0xec03('0x35')][_0xec03('0x38')]?_0xe03df3[_0xec03('0x35')]:_0x14a429[_0xec03('0x31')];if(_0x1b1aea[_0xec03('0x32')]['includeAll']){_0xe03df3['include']=[{'all':!![]}];}_0xe03df3=_[_0xec03('0x40')]({},_0xe03df3,_0x1b1aea['options']);return db[_0xec03('0x2d')][_0xec03('0x46')](_0xe03df3)[_0xec03('0x26')](handleEntityNotFound(_0x3f2522,null))[_0xec03('0x26')](respondWithResult(_0x3f2522,null))['catch'](handleError(_0x3f2522,null));};exports[_0xec03('0x47')]=function(_0x14a61c,_0x3c7e18){return db[_0xec03('0x2d')]['create'](_0x14a61c[_0xec03('0x48')],{})['then'](respondWithResult(_0x3c7e18,0xc9))[_0xec03('0x44')](handleError(_0x3c7e18,null));};exports[_0xec03('0x25')]=function(_0xdb9a99,_0x1c6b87){if(_0xdb9a99[_0xec03('0x48')]['id']){delete _0xdb9a99[_0xec03('0x48')]['id'];}return db[_0xec03('0x2d')]['find']({'where':{'id':_0xdb9a99[_0xec03('0x45')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x26')](saveUpdates(_0xdb9a99[_0xec03('0x48')],null))['then'](respondWithResult(_0x1c6b87,null))[_0xec03('0x44')](handleError(_0x1c6b87,null));};exports['destroy']=function(_0xe0e874,_0x3825f9){return db[_0xec03('0x2d')][_0xec03('0x46')]({'where':{'id':_0xe0e874['params']['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x3825f9,null))[_0xec03('0x26')](removeEntity(_0x3825f9,null))[_0xec03('0x44')](handleError(_0x3825f9,null));};exports[_0xec03('0x49')]=function(_0x32a5af,_0x5b1339){return db[_0xec03('0x2d')][_0xec03('0x49')]()[_0xec03('0x26')](respondWithResult(_0x5b1339,null))['catch'](handleError(_0x5b1339,null));};
\ No newline at end of file
index 40ce6dc..a746fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2d1=['bluebird','request-promise','path','rimraf','exports','define','report_jscripty_answers','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa2d1,0x19f));var _0x1a2d=function(_0x3f48e0,_0x453a44){_0x3f48e0=_0x3f48e0-0x0;var _0x2333e1=_0xa2d1[_0x3f48e0];return _0x2333e1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1a2d('0x0'));var BPromise=require(_0x1a2d('0x1'));var rp=require(_0x1a2d('0x2'));var fs=require('fs');var path=require(_0x1a2d('0x3'));var rimraf=require(_0x1a2d('0x4'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x1a2d('0x5')]=function(_0x47a2fe,_0x39e59d){return _0x47a2fe[_0x1a2d('0x6')]('JscriptyAnswerReport',attributes,{'tableName':_0x1a2d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45e6=['../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x787e06,_0x854aee){var _0x3fae7a=function(_0xb29c4e){while(--_0xb29c4e){_0x787e06['push'](_0x787e06['shift']());}};_0x3fae7a(++_0x854aee);}(_0x45e6,0x18d));var _0x645e=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x45e6[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0x645e('0x0'));var util=require(_0x645e('0x1'));var logger=require(_0x645e('0x2'))(_0x645e('0x3'));var moment=require(_0x645e('0x4'));var BPromise=require(_0x645e('0x5'));var rp=require(_0x645e('0x6'));var fs=require('fs');var path=require(_0x645e('0x7'));var rimraf=require(_0x645e('0x8'));var config=require(_0x645e('0x9'));var attributes=require(_0x645e('0xa'));module[_0x645e('0xb')]=function(_0x1a35da,_0x275a87){return _0x1a35da['define'](_0x645e('0xc'),attributes,{'tableName':_0x645e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b2342d7..bb9890a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x121d=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x121d,0x121));var _0xd121=function(_0x584e75,_0xa30874){_0x584e75=_0x584e75-0x0;var _0x4cfb39=_0x121d[_0x584e75];return _0x4cfb39;};'use strict';var _=require('lodash');var util=require(_0xd121('0x0'));var moment=require(_0xd121('0x1'));var BPromise=require(_0xd121('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd121('0x3'));var db=require(_0xd121('0x4'))['db'];var utils=require(_0xd121('0x5'));var logger=require(_0xd121('0x6'))('rpc');var config=require(_0xd121('0x7'));var jayson=require(_0xd121('0x8'));var client=jayson[_0xd121('0x9')][_0xd121('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24c828,_0x431cd0,_0x1ceeb4){return new BPromise(function(_0x29bd3a,_0xafb0e2){return client['request'](_0x24c828,_0x1ceeb4)[_0xd121('0xb')](function(_0x4236b9){logger['info'](_0xd121('0xc'),_0x431cd0,_0xd121('0xd'));logger[_0xd121('0xe')](_0xd121('0xf'),_0x431cd0,'request\x20sent',JSON[_0xd121('0x10')](_0x4236b9));if(_0x4236b9['error']){if(_0x4236b9[_0xd121('0x11')]['code']===0x1f4){logger[_0xd121('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x431cd0,_0x4236b9['error'][_0xd121('0x12')]);return _0xafb0e2(_0x4236b9['error'][_0xd121('0x12')]);}logger[_0xd121('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x431cd0,_0x4236b9[_0xd121('0x11')]['message']);return _0x29bd3a(_0x4236b9[_0xd121('0x11')][_0xd121('0x12')]);}else{logger['info'](_0xd121('0xc'),_0x431cd0,_0xd121('0xd'));_0x29bd3a(_0x4236b9[_0xd121('0x13')][_0xd121('0x12')]);}})[_0xd121('0x14')](function(_0x58fc3e){logger['error'](_0xd121('0xc'),_0x431cd0,_0x58fc3e);_0xafb0e2(_0x58fc3e);});});}
\ No newline at end of file
+var _0xcd11=['client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x57a863,_0x2e067b){var _0x5caaca=function(_0x3dfd8b){while(--_0x3dfd8b){_0x57a863['push'](_0x57a863['shift']());}};_0x5caaca(++_0x2e067b);}(_0xcd11,0x161));var _0x1cd1=function(_0x30462d,_0x54b9da){_0x30462d=_0x30462d-0x0;var _0x2fdcd2=_0xcd11[_0x30462d];return _0x2fdcd2;};'use strict';var _=require('lodash');var util=require(_0x1cd1('0x0'));var moment=require(_0x1cd1('0x1'));var BPromise=require(_0x1cd1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cd1('0x3'));var db=require(_0x1cd1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1cd1('0x5'))('rpc');var config=require(_0x1cd1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1cd1('0x7')][_0x1cd1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3de451,_0xe4d0f2,_0x38e6fb){return new BPromise(function(_0x1a2831,_0x124623){return client[_0x1cd1('0x9')](_0x3de451,_0x38e6fb)[_0x1cd1('0xa')](function(_0x16f3e8){logger[_0x1cd1('0xb')](_0x1cd1('0xc'),_0xe4d0f2,'request\x20sent');logger[_0x1cd1('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0xe4d0f2,_0x1cd1('0xe'),JSON['stringify'](_0x16f3e8));if(_0x16f3e8['error']){if(_0x16f3e8[_0x1cd1('0xf')]['code']===0x1f4){logger[_0x1cd1('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe4d0f2,_0x16f3e8['error'][_0x1cd1('0x10')]);return _0x124623(_0x16f3e8[_0x1cd1('0xf')][_0x1cd1('0x10')]);}logger[_0x1cd1('0xf')](_0x1cd1('0xc'),_0xe4d0f2,_0x16f3e8[_0x1cd1('0xf')][_0x1cd1('0x10')]);return _0x1a2831(_0x16f3e8[_0x1cd1('0xf')][_0x1cd1('0x10')]);}else{logger[_0x1cd1('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xe4d0f2,_0x1cd1('0xe'));_0x1a2831(_0x16f3e8['result'][_0x1cd1('0x10')]);}})[_0x1cd1('0x11')](function(_0x2d0ab9){logger['error'](_0x1cd1('0xc'),_0xe4d0f2,_0x2d0ab9);_0x124623(_0x2d0ab9);});});}
\ No newline at end of file
index 88ea2f7..f991109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3ba=['isAuthenticated','/:id/answers','/:id/summary','getSummary','post','create','/:id/clone','clone','/:id','update','destroy','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id/sessions'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xf3ba,0x74));var _0xaf3b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf3ba[_0x40bffc];return _0x3007e9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf3b('0x0'));var timeout=require('connect-timeout');var express=require(_0xaf3b('0x1'));var router=express[_0xaf3b('0x2')]();var fs_extra=require(_0xaf3b('0x3'));var auth=require(_0xaf3b('0x4'));var interaction=require(_0xaf3b('0x5'));var config=require(_0xaf3b('0x6'));var controller=require('./jscriptyProject.controller');router[_0xaf3b('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf3b('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xaf3b('0x7')](_0xaf3b('0x9'),auth[_0xaf3b('0xa')](),controller['getSessions']);router[_0xaf3b('0x7')](_0xaf3b('0xb'),auth[_0xaf3b('0xa')](),controller['getAnswers']);router[_0xaf3b('0x7')](_0xaf3b('0xc'),auth[_0xaf3b('0xa')](),timeout('30s'),controller[_0xaf3b('0xd')]);router[_0xaf3b('0xe')]('/',auth[_0xaf3b('0xa')](),controller[_0xaf3b('0xf')]);router['post'](_0xaf3b('0x10'),auth[_0xaf3b('0xa')](),controller[_0xaf3b('0x11')]);router['put'](_0xaf3b('0x12'),auth['isAuthenticated'](),controller[_0xaf3b('0x13')]);router['delete'](_0xaf3b('0x12'),auth['isAuthenticated'](),controller[_0xaf3b('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x8e3c=['isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id'];(function(_0x5ebfda,_0xc1f562){var _0xaf64af=function(_0x3c29b8){while(--_0x3c29b8){_0x5ebfda['push'](_0x5ebfda['shift']());}};_0xaf64af(++_0xc1f562);}(_0x8e3c,0xa4));var _0xc8e3=function(_0x4adc4e,_0x39da2c){_0x4adc4e=_0x4adc4e-0x0;var _0x4d171e=_0x8e3c[_0x4adc4e];return _0x4d171e;};'use strict';var multer=require(_0xc8e3('0x0'));var util=require(_0xc8e3('0x1'));var path=require(_0xc8e3('0x2'));var timeout=require(_0xc8e3('0x3'));var express=require(_0xc8e3('0x4'));var router=express[_0xc8e3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc8e3('0x6'));var config=require(_0xc8e3('0x7'));var controller=require(_0xc8e3('0x8'));router[_0xc8e3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8e3('0xa'),auth[_0xc8e3('0xb')](),controller['show']);router[_0xc8e3('0x9')]('/:id/sessions',auth[_0xc8e3('0xb')](),controller[_0xc8e3('0xc')]);router[_0xc8e3('0x9')](_0xc8e3('0xd'),auth[_0xc8e3('0xb')](),controller[_0xc8e3('0xe')]);router[_0xc8e3('0x9')](_0xc8e3('0xf'),auth[_0xc8e3('0xb')](),timeout(_0xc8e3('0x10')),controller[_0xc8e3('0x11')]);router[_0xc8e3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc8e3('0x12')](_0xc8e3('0x13'),auth['isAuthenticated'](),controller[_0xc8e3('0x14')]);router[_0xc8e3('0x15')](_0xc8e3('0xa'),auth[_0xc8e3('0xb')](),controller[_0xc8e3('0x16')]);router[_0xc8e3('0x17')](_0xc8e3('0xa'),auth[_0xc8e3('0xb')](),controller['destroy']);module[_0xc8e3('0x18')]=router;
\ No newline at end of file
index c5db7fe..024d821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29fd=['TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING'];(function(_0x542e58,_0x35f835){var _0x3c8779=function(_0x582976){while(--_0x582976){_0x542e58['push'](_0x542e58['shift']());}};_0x3c8779(++_0x35f835);}(_0x29fd,0xfb));var _0xd29f=function(_0x430929,_0x7d809e){_0x430929=_0x430929-0x0;var _0x512eb4=_0x29fd[_0x430929];return _0x512eb4;};'use strict';var Sequelize=require(_0xd29f('0x0'));var _=require(_0xd29f('0x1'));var util=require(_0xd29f('0x2'));module[_0xd29f('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xd29f('0x4')]},'formData':{'type':Sequelize[_0xd29f('0x5')](_0xd29f('0x6')),'set':function(_0x2f36af){if(_[_0xd29f('0x7')](_0x2f36af)){this[_0xd29f('0x8')](_0xd29f('0x9'),JSON[_0xd29f('0xa')](_0x2f36af));}else if(_[_0xd29f('0xb')](_0x2f36af)){this[_0xd29f('0x8')]('formData',_0x2f36af);}else{this['setDataValue']('formData',util['format'](_0xd29f('0xc'),this[_0xd29f('0xd')]('name')||'',this[_0xd29f('0xd')](_0xd29f('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd29f('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd29f('0xf')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4b8b=['getDataValue','name','BOOLEAN','exports','STRING','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x5999de,_0xe37f33){var _0x319bb8=function(_0x3dfe20){while(--_0x3dfe20){_0x5999de['push'](_0x5999de['shift']());}};_0x319bb8(++_0xe37f33);}(_0x4b8b,0x114));var _0xb4b8=function(_0x273c83,_0x2b2100){_0x273c83=_0x273c83-0x0;var _0x1ade28=_0x4b8b[_0x273c83];return _0x1ade28;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module[_0xb4b8('0x0')]={'name':{'type':Sequelize[_0xb4b8('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xb4b8('0x1')]},'formData':{'type':Sequelize['TEXT'](_0xb4b8('0x2')),'set':function(_0x52efdb){if(_[_0xb4b8('0x3')](_0x52efdb)){this[_0xb4b8('0x4')](_0xb4b8('0x5'),JSON[_0xb4b8('0x6')](_0x52efdb));}else if(_[_0xb4b8('0x7')](_0x52efdb)){this[_0xb4b8('0x4')](_0xb4b8('0x5'),_0x52efdb);}else{this[_0xb4b8('0x4')]('formData',util[_0xb4b8('0x8')](_0xb4b8('0x9'),this[_0xb4b8('0xa')](_0xb4b8('0xb'))||'',this[_0xb4b8('0xa')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xb4b8('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xb4b8('0xc')],'defaultValue':![]}};
\ No newline at end of file
index 4d7324f..295e002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13b6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','userProfileId','findOne','JscriptySessionReport','ProjectId','rows','hasOwnProperty','fromCharCode','apply','indexOf','toString','replace','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','JscriptyProject','includeAll','include','findAll','catch','params','find','create','body','user'];(function(_0x44ceee,_0x2a5e28){var _0x1a065c=function(_0x24ec16){while(--_0x24ec16){_0x44ceee['push'](_0x44ceee['shift']());}};_0x1a065c(++_0x2a5e28);}(_0x13b6,0x97));var _0x613b=function(_0x2e5c51,_0x2d646b){_0x2e5c51=_0x2e5c51-0x0;var _0xa23db3=_0x13b6[_0x2e5c51];return _0xa23db3;};'use strict';var emlformat=require(_0x613b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x613b('0x1'));var jsonpatch=require(_0x613b('0x2'));var rp=require(_0x613b('0x3'));var moment=require(_0x613b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x613b('0x5'));var util=require(_0x613b('0x6'));var path=require(_0x613b('0x7'));var sox=require('sox');var csv=require(_0x613b('0x8'));var ejs=require(_0x613b('0x9'));var fs=require('fs');var fs_extra=require(_0x613b('0xa'));var _=require('lodash');var squel=require(_0x613b('0xb'));var crypto=require('crypto');var jsforce=require(_0x613b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x613b('0xd'));var Papa=require(_0x613b('0xe'));var Redis=require(_0x613b('0xf'));var authService=require(_0x613b('0x10'));var qs=require(_0x613b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x613b('0x12'))('api');var utils=require(_0x613b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x613b('0x14'))['db'];function respondWithStatusCode(_0x408b5f,_0x1567cd){_0x1567cd=_0x1567cd||0xcc;return function(_0x4afa45){if(_0x4afa45){return _0x408b5f[_0x613b('0x15')](_0x1567cd);}return _0x408b5f[_0x613b('0x16')](_0x1567cd)[_0x613b('0x17')]();};}function respondWithResult(_0x1b9d4b,_0x297031){_0x297031=_0x297031||0xc8;return function(_0x3516ed){if(_0x3516ed){return _0x1b9d4b[_0x613b('0x16')](_0x297031)[_0x613b('0x18')](_0x3516ed);}};}function respondWithFilteredResult(_0x37df51,_0xde7e24){return function(_0x52c088){if(_0x52c088){var _0xa74b30=typeof _0xde7e24[_0x613b('0x19')]===_0x613b('0x1a')&&typeof _0xde7e24['limit']==='undefined';var _0x41a912=_0x52c088['count'];var _0x27949c=_0xa74b30?0x0:_0xde7e24['offset'];var _0x46c9c4=_0xa74b30?_0x52c088[_0x613b('0x1b')]:_0xde7e24[_0x613b('0x19')]+_0xde7e24[_0x613b('0x1c')];var _0x22fee9;if(_0x46c9c4>=_0x41a912){_0x46c9c4=_0x41a912;_0x22fee9=0xc8;}else{_0x22fee9=0xce;}_0x37df51[_0x613b('0x16')](_0x22fee9);return _0x37df51[_0x613b('0x1d')]('Content-Range',_0x27949c+'-'+_0x46c9c4+'/'+_0x41a912)[_0x613b('0x18')](_0x52c088);}return null;};}function patchUpdates(_0x2628e8){return function(_0x4877d6){try{jsonpatch['apply'](_0x4877d6,_0x2628e8,!![]);}catch(_0x22b5ec){return BPromise[_0x613b('0x1e')](_0x22b5ec);}return _0x4877d6[_0x613b('0x1f')]();};}function saveUpdates(_0x425ebb,_0x1df68a){return function(_0x4d9728){if(_0x4d9728){return _0x4d9728[_0x613b('0x20')](_0x425ebb)['then'](function(_0x295420){return _0x295420;});}return null;};}function removeEntity(_0x3f8dc0,_0x3a17a1){return function(_0x101ec7){if(_0x101ec7){return _0x101ec7['destroy']()[_0x613b('0x21')](function(){var _0x4eb354=_0x101ec7[_0x613b('0x22')]({'plain':!![]});var _0x4ad958=_0x613b('0x23');return db[_0x613b('0x24')][_0x613b('0x25')]({'where':{'type':_0x4ad958,'resourceId':_0x4eb354['id']}})[_0x613b('0x21')](function(){return _0x101ec7;});})[_0x613b('0x21')](function(){_0x3f8dc0[_0x613b('0x16')](0xcc)[_0x613b('0x17')]();});}};}function handleEntityNotFound(_0x374547,_0x2d7191){return function(_0x63f8c3){if(!_0x63f8c3){_0x374547[_0x613b('0x15')](0x194);}return _0x63f8c3;};}function handleError(_0x367c1a,_0x4f6bdf){_0x4f6bdf=_0x4f6bdf||0x1f4;return function(_0x46529a){logger[_0x613b('0x26')](_0x46529a[_0x613b('0x27')]);if(_0x46529a[_0x613b('0x28')]){delete _0x46529a[_0x613b('0x28')];}_0x367c1a[_0x613b('0x16')](_0x4f6bdf)[_0x613b('0x29')](_0x46529a);};}exports['index']=function(_0x228f39,_0x169baf){var _0x56561f={},_0x3af1ff={},_0x4f2df9={'count':0x0,'rows':[]};var _0x3ed316=_[_0x613b('0x2a')](db['JscriptyProject'][_0x613b('0x2b')],function(_0x37294f){return{'name':_0x37294f[_0x613b('0x2c')],'type':_0x37294f[_0x613b('0x2d')][_0x613b('0x2e')]};});_0x3af1ff[_0x613b('0x2f')]=_[_0x613b('0x2a')](_0x3ed316,_0x613b('0x28'));_0x3af1ff[_0x613b('0x30')]=_[_0x613b('0x31')](_0x228f39[_0x613b('0x30')]);_0x3af1ff[_0x613b('0x32')]=_[_0x613b('0x33')](_0x3af1ff['model'],_0x3af1ff[_0x613b('0x30')]);_0x56561f[_0x613b('0x34')]=_[_0x613b('0x33')](_0x3af1ff[_0x613b('0x2f')],qs['fields'](_0x228f39['query'][_0x613b('0x35')]));_0x56561f[_0x613b('0x34')]=_0x56561f[_0x613b('0x34')][_0x613b('0x36')]?_0x56561f[_0x613b('0x34')]:_0x3af1ff[_0x613b('0x2f')];if(!_0x228f39[_0x613b('0x30')]['hasOwnProperty'](_0x613b('0x37'))){_0x56561f[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x228f39[_0x613b('0x30')][_0x613b('0x1c')]);_0x56561f[_0x613b('0x19')]=qs[_0x613b('0x19')](_0x228f39[_0x613b('0x30')][_0x613b('0x19')]);}_0x56561f[_0x613b('0x38')]=qs[_0x613b('0x39')](_0x228f39[_0x613b('0x30')][_0x613b('0x39')]);_0x56561f[_0x613b('0x3a')]=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x228f39[_0x613b('0x30')],_0x3af1ff[_0x613b('0x32')]),_0x3ed316);if(_0x228f39['query'][_0x613b('0x3c')]){_0x56561f[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0x56561f[_0x613b('0x3a')],{'$or':_[_0x613b('0x2a')](_0x3ed316,function(_0x127500){if(_0x127500[_0x613b('0x2d')]!==_0x613b('0x3e')){var _0x18d31e={};_0x18d31e[_0x127500[_0x613b('0x28')]]={'$like':'%'+_0x228f39[_0x613b('0x30')]['filter']+'%'};return _0x18d31e;}})});}_0x56561f=_[_0x613b('0x3d')]({},_0x56561f,_0x228f39['options']);var _0x5ea015={'where':_0x56561f[_0x613b('0x3a')]};return db[_0x613b('0x3f')][_0x613b('0x1b')](_0x5ea015)[_0x613b('0x21')](function(_0x48bca8){_0x4f2df9[_0x613b('0x1b')]=_0x48bca8;if(_0x228f39['query'][_0x613b('0x40')]){_0x56561f[_0x613b('0x41')]=[{'all':!![]}];}return db['JscriptyProject'][_0x613b('0x42')](_0x56561f);})['then'](function(_0x48a4fb){_0x4f2df9['rows']=_0x48a4fb;return _0x4f2df9;})['then'](respondWithFilteredResult(_0x169baf,_0x56561f))[_0x613b('0x43')](handleError(_0x169baf,null));};exports['show']=function(_0x385c1c,_0x389868){var _0x57d5fa={'raw':![],'where':{'id':_0x385c1c[_0x613b('0x44')]['id']}},_0x392a2d={};_0x392a2d[_0x613b('0x2f')]=_[_0x613b('0x31')](db['JscriptyProject']['rawAttributes']);_0x392a2d[_0x613b('0x30')]=_[_0x613b('0x31')](_0x385c1c[_0x613b('0x30')]);_0x392a2d['filters']=_['intersection'](_0x392a2d[_0x613b('0x2f')],_0x392a2d[_0x613b('0x30')]);_0x57d5fa[_0x613b('0x34')]=_['intersection'](_0x392a2d['model'],qs[_0x613b('0x35')](_0x385c1c[_0x613b('0x30')][_0x613b('0x35')]));_0x57d5fa[_0x613b('0x34')]=_0x57d5fa[_0x613b('0x34')][_0x613b('0x36')]?_0x57d5fa[_0x613b('0x34')]:_0x392a2d[_0x613b('0x2f')];if(_0x385c1c[_0x613b('0x30')][_0x613b('0x40')]){_0x57d5fa[_0x613b('0x41')]=[{'all':!![]}];}_0x57d5fa=_[_0x613b('0x3d')]({},_0x57d5fa,_0x385c1c['options']);return db[_0x613b('0x3f')][_0x613b('0x45')](_0x57d5fa)[_0x613b('0x21')](handleEntityNotFound(_0x389868,null))[_0x613b('0x21')](respondWithResult(_0x389868,null))[_0x613b('0x43')](handleError(_0x389868,null));};exports['create']=function(_0x1e6226,_0x2d3995){return db[_0x613b('0x3f')][_0x613b('0x46')](_0x1e6226[_0x613b('0x47')],{})[_0x613b('0x21')](function(_0x5f6d6){var _0xd7c1d3=_0x1e6226[_0x613b('0x48')][_0x613b('0x22')]({'plain':!![]});if(!_0xd7c1d3)throw new Error(_0x613b('0x49'));if(_0xd7c1d3[_0x613b('0x4a')]===_0x613b('0x48')){var _0x77daf3=_0x5f6d6[_0x613b('0x22')]({'plain':!![]});var _0x1a08ba=_0x613b('0x23');return db[_0x613b('0x4b')][_0x613b('0x45')]({'where':{'name':_0x1a08ba,'userProfileId':_0xd7c1d3['userProfileId']},'raw':!![]})[_0x613b('0x21')](function(_0x24c4af){if(_0x24c4af&&_0x24c4af[_0x613b('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x77daf3[_0x613b('0x28')],'resourceId':_0x77daf3['id'],'type':_0x24c4af[_0x613b('0x28')],'sectionId':_0x24c4af['id']},{})[_0x613b('0x21')](function(){return _0x5f6d6;});}else{return _0x5f6d6;}})['catch'](function(_0x23116e){logger[_0x613b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23116e);throw _0x23116e;});}return _0x5f6d6;})[_0x613b('0x21')](respondWithResult(_0x2d3995,0xc9))[_0x613b('0x43')](handleError(_0x2d3995,null));};exports[_0x613b('0x4d')]=function(_0x337ed8,_0x3cf476){var _0x1eb1de={'where':{'id':_0x337ed8[_0x613b('0x44')]['id']}},_0x5ef07a={};_0x5ef07a[_0x613b('0x2f')]=_['keys'](db['JscriptyProject'][_0x613b('0x2b')]);_0x1eb1de['attributes']=_['intersection'](_0x5ef07a[_0x613b('0x2f')],qs[_0x613b('0x35')](_0x337ed8[_0x613b('0x30')][_0x613b('0x35')]));_0x1eb1de['attributes']=_0x1eb1de[_0x613b('0x34')][_0x613b('0x36')]?_0x1eb1de[_0x613b('0x34')]:_0x5ef07a['model'];if(_0x337ed8['query'][_0x613b('0x40')]){_0x1eb1de['include']=[{'all':!![]}];}_0x1eb1de=_['merge']({},_0x1eb1de,_0x337ed8[_0x613b('0x4e')]);return db['JscriptyProject'][_0x613b('0x45')](_0x1eb1de)[_0x613b('0x21')](handleEntityNotFound(_0x3cf476,null))[_0x613b('0x21')](function(_0x6a2d01){if(_0x6a2d01){var _0x522bd3=_0x6a2d01['get']({'plain':!![]});_0x522bd3=qs[_0x613b('0x4f')](_0x522bd3,['id',_0x613b('0x50'),_0x613b('0x51')]);_0x337ed8[_0x613b('0x47')]=_[_0x613b('0x4f')](_0x337ed8[_0x613b('0x47')],['id',_0x613b('0x50'),_0x613b('0x51')]);return db[_0x613b('0x3f')][_0x613b('0x46')](_[_0x613b('0x3d')](_0x522bd3,_0x337ed8[_0x613b('0x47')]),{'include':_0x337ed8[_0x613b('0x30')][_0x613b('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x135c48){var _0x340804=_0x337ed8[_0x613b('0x48')]['get']({'plain':!![]});if(!_0x340804)throw new Error(_0x613b('0x49'));if(_0x340804[_0x613b('0x4a')]===_0x613b('0x48')){var _0x9dfe7d=_0x135c48[_0x613b('0x22')]({'plain':!![]});var _0x35f06c=_0x613b('0x23');return db[_0x613b('0x4b')]['find']({'where':{'name':_0x35f06c,'userProfileId':_0x340804[_0x613b('0x52')]},'raw':!![]})[_0x613b('0x21')](function(_0x5c04cd){if(_0x5c04cd&&_0x5c04cd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x9dfe7d['name'],'resourceId':_0x9dfe7d['id'],'type':_0x5c04cd[_0x613b('0x28')],'sectionId':_0x5c04cd['id']},{})[_0x613b('0x21')](function(){return _0x135c48;});}else{return _0x135c48;}})[_0x613b('0x43')](function(_0x108318){logger[_0x613b('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x108318);throw _0x108318;});}return _0x135c48;});}})['then'](respondWithResult(_0x3cf476,0xc9))['catch'](handleError(_0x3cf476,null));};exports[_0x613b('0x20')]=function(_0x16f1e2,_0x172e88){if(_0x16f1e2[_0x613b('0x47')]['id']){delete _0x16f1e2['body']['id'];}return db[_0x613b('0x3f')][_0x613b('0x45')]({'where':{'id':_0x16f1e2[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x172e88,null))[_0x613b('0x21')](saveUpdates(_0x16f1e2['body'],null))[_0x613b('0x21')](respondWithResult(_0x172e88,null))[_0x613b('0x43')](handleError(_0x172e88,null));};exports[_0x613b('0x25')]=function(_0x191d72,_0x477e24){return db[_0x613b('0x3f')][_0x613b('0x45')]({'where':{'id':_0x191d72[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x477e24,null))[_0x613b('0x21')](removeEntity(_0x477e24,null))[_0x613b('0x43')](handleError(_0x477e24,null));};exports['getSessions']=function(_0x279e27,_0x3ee588,_0x3d58d3){var _0x5e8c5f={'raw':!![],'where':{}};var _0x52159f={};var _0x12f606={'count':0x0,'rows':[]};return db[_0x613b('0x3f')][_0x613b('0x53')]({'where':{'id':_0x279e27[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x3ee588,null))[_0x613b('0x21')](function(_0x350fd2){if(_0x350fd2){_0x52159f[_0x613b('0x2f')]=_['keys'](db[_0x613b('0x54')][_0x613b('0x2b')]);_0x52159f[_0x613b('0x30')]=_[_0x613b('0x31')](_0x279e27[_0x613b('0x30')]);_0x52159f[_0x613b('0x32')]=_['intersection'](_0x52159f[_0x613b('0x2f')],_0x52159f['query']);_0x5e8c5f[_0x613b('0x34')]=_['intersection'](_0x52159f[_0x613b('0x2f')],qs['fields'](_0x279e27[_0x613b('0x30')][_0x613b('0x35')]));_0x5e8c5f['attributes']=_0x5e8c5f[_0x613b('0x34')]['length']?_0x5e8c5f[_0x613b('0x34')]:_0x52159f[_0x613b('0x2f')];if(!_0x279e27[_0x613b('0x30')]['hasOwnProperty']('nolimit')){_0x5e8c5f[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x279e27['query'][_0x613b('0x1c')]);_0x5e8c5f['offset']=qs[_0x613b('0x19')](_0x279e27[_0x613b('0x30')][_0x613b('0x19')]);}_0x5e8c5f[_0x613b('0x38')]=qs['sort'](_0x279e27[_0x613b('0x30')]['sort']);_0x5e8c5f['where']=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x279e27[_0x613b('0x30')],_0x52159f[_0x613b('0x32')]));_0x5e8c5f[_0x613b('0x3a')][_0x613b('0x55')]=_0x350fd2['id'];if(_0x279e27['query'][_0x613b('0x3c')]){_0x5e8c5f[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0x5e8c5f['where'],{'$or':_['map'](_0x5e8c5f[_0x613b('0x34')],function(_0x331851){var _0x4e4ae2={};_0x4e4ae2[_0x331851]={'$like':'%'+_0x279e27[_0x613b('0x30')][_0x613b('0x3c')]+'%'};return _0x4e4ae2;})});}_0x5e8c5f=_['merge']({},_0x5e8c5f,_0x279e27[_0x613b('0x4e')]);return db[_0x613b('0x54')][_0x613b('0x1b')]({'where':_0x5e8c5f[_0x613b('0x3a')]})['then'](function(_0x2a111a){_0x12f606[_0x613b('0x1b')]=_0x2a111a;if(_0x279e27[_0x613b('0x30')][_0x613b('0x40')]){_0x5e8c5f[_0x613b('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x613b('0x42')](_0x5e8c5f);})[_0x613b('0x21')](function(_0x3c332c){_0x12f606[_0x613b('0x56')]=_0x3c332c;return _0x12f606;});}})[_0x613b('0x21')](respondWithFilteredResult(_0x3ee588,_0x5e8c5f))[_0x613b('0x43')](handleError(_0x3ee588,null));};exports['getAnswers']=function(_0x1f4c2d,_0x54874f,_0x5b9b4e){var _0xedd980={'raw':!![],'where':{}};var _0x471a07={};var _0x325492={'count':0x0,'rows':[]};return db[_0x613b('0x3f')][_0x613b('0x53')]({'where':{'id':_0x1f4c2d[_0x613b('0x44')]['id']}})[_0x613b('0x21')](handleEntityNotFound(_0x54874f,null))[_0x613b('0x21')](function(_0xe68aa0){if(_0xe68aa0){_0x471a07[_0x613b('0x2f')]=_['keys'](db['JscriptyAnswerReport'][_0x613b('0x2b')]);_0x471a07[_0x613b('0x30')]=_['keys'](_0x1f4c2d['query']);_0x471a07[_0x613b('0x32')]=_[_0x613b('0x33')](_0x471a07[_0x613b('0x2f')],_0x471a07[_0x613b('0x30')]);_0xedd980['attributes']=_[_0x613b('0x33')](_0x471a07[_0x613b('0x2f')],qs['fields'](_0x1f4c2d['query'][_0x613b('0x35')]));_0xedd980[_0x613b('0x34')]=_0xedd980[_0x613b('0x34')]['length']?_0xedd980[_0x613b('0x34')]:_0x471a07['model'];if(!_0x1f4c2d[_0x613b('0x30')][_0x613b('0x57')](_0x613b('0x37'))){_0xedd980[_0x613b('0x1c')]=qs[_0x613b('0x1c')](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x1c')]);_0xedd980['offset']=qs[_0x613b('0x19')](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x19')]);}_0xedd980[_0x613b('0x38')]=qs['sort'](_0x1f4c2d[_0x613b('0x30')][_0x613b('0x39')]);_0xedd980['where']=qs[_0x613b('0x32')](_[_0x613b('0x3b')](_0x1f4c2d[_0x613b('0x30')],_0x471a07[_0x613b('0x32')]));_0xedd980['where'][_0x613b('0x55')]=_0xe68aa0['id'];if(_0x1f4c2d[_0x613b('0x30')]['filter']){_0xedd980[_0x613b('0x3a')]=_[_0x613b('0x3d')](_0xedd980[_0x613b('0x3a')],{'$or':_[_0x613b('0x2a')](_0xedd980[_0x613b('0x34')],function(_0x33df3f){var _0x27095d={};_0x27095d[_0x33df3f]={'$like':'%'+_0x1f4c2d[_0x613b('0x30')][_0x613b('0x3c')]+'%'};return _0x27095d;})});}_0xedd980=_[_0x613b('0x3d')]({},_0xedd980,_0x1f4c2d[_0x613b('0x4e')]);return db['JscriptyAnswerReport'][_0x613b('0x1b')]({'where':_0xedd980[_0x613b('0x3a')]})['then'](function(_0x304f92){_0x325492[_0x613b('0x1b')]=_0x304f92;if(_0x1f4c2d[_0x613b('0x30')][_0x613b('0x40')]){_0xedd980['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x613b('0x42')](_0xedd980);})[_0x613b('0x21')](function(_0x4a5881){_0x325492[_0x613b('0x56')]=_0x4a5881;return _0x325492;});}})[_0x613b('0x21')](respondWithFilteredResult(_0x54874f,_0xedd980))['catch'](handleError(_0x54874f,null));};function char(_0x40e2b6){return'number'===typeof _0x40e2b6?String[_0x613b('0x58')][_0x613b('0x59')](null,arguments):_0x40e2b6;}function needsEncapsulation(_0x6b80c4){return!!_0x6b80c4&&(_0x6b80c4['toString']()[_0x613b('0x5a')](char(0xd))>=0x0||_0x6b80c4[_0x613b('0x5b')]()[_0x613b('0x5a')](char(0xa))>=0x0||_0x6b80c4['toString']()[_0x613b('0x5a')](char(0x2c))>=0x0||_0x6b80c4[_0x613b('0x5b')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x531dcb){var _0x504a3b=char(0x22),_0x110d2b='\x5c'+char(0x22),_0x2ab1dc=_0x531dcb[_0x613b('0x5b')]()[_0x613b('0x5c')](new RegExp(_0x504a3b,'g'),_0x110d2b);return _0x504a3b+_0x2ab1dc+_0x504a3b;}exports['getSummary']=function(_0x3e6ce2,_0xdee76c,_0x57215f){var _0x4f1eaf,_0x47342e;var _0x2496c1={'where':{'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id']}};if(_0x3e6ce2[_0x613b('0x30')]['startTime']){_0x2496c1[_0x613b('0x3a')][_0x613b('0x5d')]=JSON[_0x613b('0x5e')](_0x3e6ce2['query'][_0x613b('0x5f')]);}return db[_0x613b('0x54')][_0x613b('0x42')](_0x2496c1)[_0x613b('0x21')](handleEntityNotFound(_0xdee76c,null))['then'](function(_0x1e7bcf){if(_0x1e7bcf){_0x4f1eaf=_0x1e7bcf;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x613b('0x2a')](_0x4f1eaf,'id')},'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id']},'order':_0x613b('0x60')});}})['then'](handleEntityNotFound(_0xdee76c,null))['then'](function(_0x32b661){if(_0x32b661){_0x47342e=_0x32b661;var _0x41f51f={};for(var _0x3520c0=0x0,_0xa548ef=_0x47342e[_0x613b('0x36')];_0x3520c0<_0xa548ef;_0x3520c0++){if(!_0x41f51f[_0x613b('0x57')](_0x47342e[_0x3520c0][_0x613b('0x61')])){_0x41f51f[_0x47342e[_0x3520c0]['questionId']]=needsEncapsulation(_0x47342e[_0x3520c0]['question'])?encapsulate(_0x47342e[_0x3520c0][_0x613b('0x62')]):_0x47342e[_0x3520c0][_0x613b('0x62')];}}var _0x2cc9e8=[],_0x4c6aa8={};for(var _0x35ab20=0x0,_0x4db62d=_0x4f1eaf['length'];_0x35ab20<_0x4db62d;_0x35ab20++){_0x4c6aa8={'ProjectId':_0x3e6ce2[_0x613b('0x44')]['id'],'SessionId':_0x4f1eaf[_0x35ab20]['id'],'StartTime':moment(_0x4f1eaf[_0x35ab20][_0x613b('0x5d')])[_0x613b('0x63')](_0x613b('0x64'))};for(var _0x273781=0x0,_0xb40bf=_0x47342e[_0x613b('0x36')];_0x273781<_0xb40bf;_0x273781++){if(_0x47342e[_0x273781][_0x613b('0x65')]==_0x4f1eaf[_0x35ab20]['id']&&_0x41f51f['hasOwnProperty'](_0x47342e[_0x273781][_0x613b('0x61')])){_0x4c6aa8[_0x41f51f[_0x47342e[_0x273781][_0x613b('0x61')]]]=_0x47342e[_0x273781][_0x613b('0x66')];}}for(var _0x19f46b in _0x41f51f){if(!_0x4c6aa8[_0x613b('0x57')](_0x41f51f[_0x19f46b])){_0x4c6aa8[_0x41f51f[_0x19f46b]]=null;}}_0x2cc9e8[_0x613b('0x67')](_0x4c6aa8);}return _0x2cc9e8;}})[_0x613b('0x21')](function(_0x57f907){if(!_['isEmpty'](_0x57f907)){var _0x15d682=toCsv(_0x57f907);var _0x3f0280=Date[_0x613b('0x68')]();fs[_0x613b('0x69')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280),_0x15d682);_0xdee76c[_0x613b('0x6a')]('Content-disposition',_0x613b('0x6b')+util[_0x613b('0x63')](_0x613b('0x6c'),_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280));_0xdee76c[_0x613b('0x6a')](_0x613b('0x6d'),'text/csv');return _0xdee76c[_0x613b('0x6e')](util[_0x613b('0x63')](_0x613b('0x6f'),_0x3e6ce2[_0x613b('0x44')]['id'],_0x3f0280));}else{return _0xdee76c[_0x613b('0x15')](0xcc);}})[_0x613b('0x43')](handleError(_0xdee76c,null));};
\ No newline at end of file
+var _0x13ae=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','Projects','UserProfileResource','destroy','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','JscriptyProject','findAll','rows','catch','includeAll','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','request-promise','moment','util','sox','to-csv','ejs'];(function(_0x4d575e,_0xd00d24){var _0x10ddf1=function(_0xc70e21){while(--_0xc70e21){_0x4d575e['push'](_0x4d575e['shift']());}};_0x10ddf1(++_0xd00d24);}(_0x13ae,0xe6));var _0xe13a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x13ae[_0x2be8c2];return _0x97f531;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe13a('0x0'));var moment=require(_0xe13a('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe13a('0x2'));var path=require('path');var sox=require(_0xe13a('0x3'));var csv=require(_0xe13a('0x4'));var ejs=require(_0xe13a('0x5'));var fs=require('fs');var fs_extra=require(_0xe13a('0x6'));var _=require(_0xe13a('0x7'));var squel=require(_0xe13a('0x8'));var crypto=require(_0xe13a('0x9'));var jsforce=require(_0xe13a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13a('0xb'));var Papa=require(_0xe13a('0xc'));var Redis=require(_0xe13a('0xd'));var authService=require(_0xe13a('0xe'));var qs=require(_0xe13a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe13a('0x10'));var logger=require(_0xe13a('0x11'))(_0xe13a('0x12'));var utils=require(_0xe13a('0x13'));var config=require(_0xe13a('0x14'));var licenseUtil=require(_0xe13a('0x15'));var db=require(_0xe13a('0x16'))['db'];function respondWithStatusCode(_0x5e715,_0x54ea66){_0x54ea66=_0x54ea66||0xcc;return function(_0x2ab471){if(_0x2ab471){return _0x5e715[_0xe13a('0x17')](_0x54ea66);}return _0x5e715[_0xe13a('0x18')](_0x54ea66)[_0xe13a('0x19')]();};}function respondWithResult(_0x12f6f9,_0x19dc18){_0x19dc18=_0x19dc18||0xc8;return function(_0x462d0e){if(_0x462d0e){return _0x12f6f9['status'](_0x19dc18)['json'](_0x462d0e);}};}function respondWithFilteredResult(_0x463c25,_0x2fca0f){return function(_0x128986){if(_0x128986){var _0x20d162=typeof _0x2fca0f[_0xe13a('0x1a')]===_0xe13a('0x1b')&&typeof _0x2fca0f[_0xe13a('0x1c')]===_0xe13a('0x1b');var _0x165195=_0x128986[_0xe13a('0x1d')];var _0xc6f6d3=_0x20d162?0x0:_0x2fca0f['offset'];var _0x3c8f4f=_0x20d162?_0x128986[_0xe13a('0x1d')]:_0x2fca0f['offset']+_0x2fca0f[_0xe13a('0x1c')];var _0x12a8b9;if(_0x3c8f4f>=_0x165195){_0x3c8f4f=_0x165195;_0x12a8b9=0xc8;}else{_0x12a8b9=0xce;}_0x463c25['status'](_0x12a8b9);return _0x463c25[_0xe13a('0x1e')](_0xe13a('0x1f'),_0xc6f6d3+'-'+_0x3c8f4f+'/'+_0x165195)[_0xe13a('0x20')](_0x128986);}return null;};}function patchUpdates(_0x4489bd){return function(_0xeff2be){try{jsonpatch[_0xe13a('0x21')](_0xeff2be,_0x4489bd,!![]);}catch(_0x2c88bd){return BPromise[_0xe13a('0x22')](_0x2c88bd);}return _0xeff2be['save']();};}function saveUpdates(_0x5e8dea,_0x192240){return function(_0x48cdb8){if(_0x48cdb8){return _0x48cdb8[_0xe13a('0x23')](_0x5e8dea)[_0xe13a('0x24')](function(_0x3a5d29){return _0x3a5d29;});}return null;};}function removeEntity(_0x1d303c,_0x810633){return function(_0xd26093){if(_0xd26093){return _0xd26093['destroy']()[_0xe13a('0x24')](function(){var _0x4c3eea=_0xd26093['get']({'plain':!![]});var _0x3ed1f7=_0xe13a('0x25');return db[_0xe13a('0x26')][_0xe13a('0x27')]({'where':{'type':_0x3ed1f7,'resourceId':_0x4c3eea['id']}})[_0xe13a('0x24')](function(){return _0xd26093;});})[_0xe13a('0x24')](function(){_0x1d303c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x562360,_0x43b85e){return function(_0x1cb395){if(!_0x1cb395){_0x562360[_0xe13a('0x17')](0x194);}return _0x1cb395;};}function handleError(_0x2cad12,_0x4fcdf1){_0x4fcdf1=_0x4fcdf1||0x1f4;return function(_0x502bff){logger[_0xe13a('0x28')](_0x502bff[_0xe13a('0x29')]);if(_0x502bff[_0xe13a('0x2a')]){delete _0x502bff['name'];}_0x2cad12[_0xe13a('0x18')](_0x4fcdf1)['send'](_0x502bff);};}exports[_0xe13a('0x2b')]=function(_0xcf583b,_0xd1fdb5){var _0x3b24f3={},_0x425208={},_0xed408c={'count':0x0,'rows':[]};var _0x48ec1d=_['map'](db['JscriptyProject'][_0xe13a('0x2c')],function(_0x1a09db){return{'name':_0x1a09db['fieldName'],'type':_0x1a09db[_0xe13a('0x2d')][_0xe13a('0x2e')]};});_0x425208[_0xe13a('0x2f')]=_['map'](_0x48ec1d,_0xe13a('0x2a'));_0x425208[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0xcf583b[_0xe13a('0x30')]);_0x425208[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],_0x425208[_0xe13a('0x30')]);_0x3b24f3[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x35')]));_0x3b24f3[_0xe13a('0x34')]=_0x3b24f3[_0xe13a('0x34')][_0xe13a('0x36')]?_0x3b24f3[_0xe13a('0x34')]:_0x425208['model'];if(!_0xcf583b[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x3b24f3[_0xe13a('0x1c')]=qs['limit'](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x1c')]);_0x3b24f3[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0xcf583b['query'][_0xe13a('0x1a')]);}_0x3b24f3[_0xe13a('0x39')]=qs['sort'](_0xcf583b['query'][_0xe13a('0x3a')]);_0x3b24f3[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0xcf583b[_0xe13a('0x30')],_0x425208[_0xe13a('0x32')]),_0x48ec1d);if(_0xcf583b[_0xe13a('0x30')][_0xe13a('0x3d')]){_0x3b24f3['where']=_['merge'](_0x3b24f3[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x48ec1d,function(_0x3d24ad){if(_0x3d24ad[_0xe13a('0x2d')]!==_0xe13a('0x3f')){var _0x3a0872={};_0x3a0872[_0x3d24ad[_0xe13a('0x2a')]]={'$like':'%'+_0xcf583b['query'][_0xe13a('0x3d')]+'%'};return _0x3a0872;}})});}_0x3b24f3=_[_0xe13a('0x40')]({},_0x3b24f3,_0xcf583b[_0xe13a('0x41')]);var _0x37c3c1={'where':_0x3b24f3[_0xe13a('0x3b')]};return db['JscriptyProject'][_0xe13a('0x1d')](_0x37c3c1)[_0xe13a('0x24')](function(_0x348216){_0xed408c[_0xe13a('0x1d')]=_0x348216;if(_0xcf583b[_0xe13a('0x30')]['includeAll']){_0x3b24f3[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x43')][_0xe13a('0x44')](_0x3b24f3);})['then'](function(_0x3c047b){_0xed408c[_0xe13a('0x45')]=_0x3c047b;return _0xed408c;})[_0xe13a('0x24')](respondWithFilteredResult(_0xd1fdb5,_0x3b24f3))[_0xe13a('0x46')](handleError(_0xd1fdb5,null));};exports['show']=function(_0x55e93f,_0x196d76){var _0xed7258={'raw':![],'where':{'id':_0x55e93f['params']['id']}},_0x3d87ba={};_0x3d87ba['model']=_[_0xe13a('0x31')](db[_0xe13a('0x43')][_0xe13a('0x2c')]);_0x3d87ba[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x55e93f['query']);_0x3d87ba[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],_0x3d87ba[_0xe13a('0x30')]);_0xed7258[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0x55e93f[_0xe13a('0x30')]['fields']));_0xed7258['attributes']=_0xed7258[_0xe13a('0x34')][_0xe13a('0x36')]?_0xed7258['attributes']:_0x3d87ba['model'];if(_0x55e93f[_0xe13a('0x30')][_0xe13a('0x47')]){_0xed7258[_0xe13a('0x42')]=[{'all':!![]}];}_0xed7258=_[_0xe13a('0x40')]({},_0xed7258,_0x55e93f[_0xe13a('0x41')]);return db[_0xe13a('0x43')]['find'](_0xed7258)[_0xe13a('0x24')](handleEntityNotFound(_0x196d76,null))[_0xe13a('0x24')](respondWithResult(_0x196d76,null))[_0xe13a('0x46')](handleError(_0x196d76,null));};exports[_0xe13a('0x48')]=function(_0x569da6,_0x55e08e){return db['JscriptyProject'][_0xe13a('0x48')](_0x569da6['body'],{})[_0xe13a('0x24')](function(_0x2faab8){var _0x6b2656=_0x569da6[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x6b2656)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b2656[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x198210=_0x2faab8[_0xe13a('0x4a')]({'plain':!![]});var _0x523e2e=_0xe13a('0x25');return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x523e2e,'userProfileId':_0x6b2656[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0xfa0d2f){if(_0xfa0d2f&&_0xfa0d2f[_0xe13a('0x4f')]===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x198210[_0xe13a('0x2a')],'resourceId':_0x198210['id'],'type':_0xfa0d2f['name'],'sectionId':_0xfa0d2f['id']},{})[_0xe13a('0x24')](function(){return _0x2faab8;});}else{return _0x2faab8;}})[_0xe13a('0x46')](function(_0x4fffdf){logger['error'](_0xe13a('0x50'),_0x4fffdf);throw _0x4fffdf;});}return _0x2faab8;})[_0xe13a('0x24')](respondWithResult(_0x55e08e,0xc9))[_0xe13a('0x46')](handleError(_0x55e08e,null));};exports['clone']=function(_0x2d0911,_0x1abc1b){var _0x384a0a={'where':{'id':_0x2d0911[_0xe13a('0x51')]['id']}},_0x5d187c={};_0x5d187c[_0xe13a('0x2f')]=_['keys'](db[_0xe13a('0x43')]['rawAttributes']);_0x384a0a[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5d187c['model'],qs[_0xe13a('0x35')](_0x2d0911[_0xe13a('0x30')]['fields']));_0x384a0a[_0xe13a('0x34')]=_0x384a0a[_0xe13a('0x34')][_0xe13a('0x36')]?_0x384a0a[_0xe13a('0x34')]:_0x5d187c[_0xe13a('0x2f')];if(_0x2d0911[_0xe13a('0x30')]['includeAll']){_0x384a0a[_0xe13a('0x42')]=[{'all':!![]}];}_0x384a0a=_[_0xe13a('0x40')]({},_0x384a0a,_0x2d0911[_0xe13a('0x41')]);return db[_0xe13a('0x43')][_0xe13a('0x4d')](_0x384a0a)[_0xe13a('0x24')](handleEntityNotFound(_0x1abc1b,null))[_0xe13a('0x24')](function(_0x3c8bd0){if(_0x3c8bd0){var _0x54b139=_0x3c8bd0[_0xe13a('0x4a')]({'plain':!![]});_0x54b139=qs[_0xe13a('0x52')](_0x54b139,['id','createdAt',_0xe13a('0x53')]);_0x2d0911[_0xe13a('0x54')]=_[_0xe13a('0x52')](_0x2d0911['body'],['id',_0xe13a('0x55'),_0xe13a('0x53')]);return db[_0xe13a('0x43')][_0xe13a('0x48')](_['merge'](_0x54b139,_0x2d0911['body']),{'include':_0x2d0911['query'][_0xe13a('0x47')]?[{'all':!![]}]:undefined})[_0xe13a('0x24')](function(_0x7bed88){var _0x4f4dd5=_0x2d0911[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x4f4dd5)throw new Error(_0xe13a('0x56'));if(_0x4f4dd5[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x622dcb=_0x7bed88[_0xe13a('0x4a')]({'plain':!![]});var _0x48f11d='Projects';return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x48f11d,'userProfileId':_0x4f4dd5[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0x3dddb2){if(_0x3dddb2&&_0x3dddb2['autoAssociation']===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x622dcb[_0xe13a('0x2a')],'resourceId':_0x622dcb['id'],'type':_0x3dddb2[_0xe13a('0x2a')],'sectionId':_0x3dddb2['id']},{})['then'](function(){return _0x7bed88;});}else{return _0x7bed88;}})[_0xe13a('0x46')](function(_0x1e01b4){logger[_0xe13a('0x28')](_0xe13a('0x50'),_0x1e01b4);throw _0x1e01b4;});}return _0x7bed88;});}})[_0xe13a('0x24')](respondWithResult(_0x1abc1b,0xc9))[_0xe13a('0x46')](handleError(_0x1abc1b,null));};exports[_0xe13a('0x23')]=function(_0x471fa9,_0x14f69f){if(_0x471fa9[_0xe13a('0x54')]['id']){delete _0x471fa9[_0xe13a('0x54')]['id'];}return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x471fa9[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14f69f,null))[_0xe13a('0x24')](saveUpdates(_0x471fa9[_0xe13a('0x54')],null))[_0xe13a('0x24')](respondWithResult(_0x14f69f,null))[_0xe13a('0x46')](handleError(_0x14f69f,null));};exports[_0xe13a('0x27')]=function(_0x2db05f,_0x14dacb){return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x2db05f[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14dacb,null))[_0xe13a('0x24')](removeEntity(_0x14dacb,null))[_0xe13a('0x46')](handleError(_0x14dacb,null));};exports[_0xe13a('0x57')]=function(_0x3add63,_0x3a2675,_0x47bff7){var _0x1cafed={'raw':!![],'where':{}};var _0x5f94f0={};var _0x32042b={'count':0x0,'rows':[]};return db[_0xe13a('0x43')][_0xe13a('0x58')]({'where':{'id':_0x3add63[_0xe13a('0x51')]['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x3a2675,null))['then'](function(_0xf74ff3){if(_0xf74ff3){_0x5f94f0[_0xe13a('0x2f')]=_[_0xe13a('0x31')](db['JscriptySessionReport'][_0xe13a('0x2c')]);_0x5f94f0['query']=_[_0xe13a('0x31')](_0x3add63[_0xe13a('0x30')]);_0x5f94f0['filters']=_[_0xe13a('0x33')](_0x5f94f0['model'],_0x5f94f0[_0xe13a('0x30')]);_0x1cafed[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5f94f0['model'],qs[_0xe13a('0x35')](_0x3add63[_0xe13a('0x30')][_0xe13a('0x35')]));_0x1cafed['attributes']=_0x1cafed['attributes']['length']?_0x1cafed['attributes']:_0x5f94f0[_0xe13a('0x2f')];if(!_0x3add63[_0xe13a('0x30')]['hasOwnProperty'](_0xe13a('0x38'))){_0x1cafed[_0xe13a('0x1c')]=qs['limit'](_0x3add63[_0xe13a('0x30')]['limit']);_0x1cafed[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3add63['query'][_0xe13a('0x1a')]);}_0x1cafed[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3add63['query']['sort']);_0x1cafed[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3add63['query'],_0x5f94f0['filters']));_0x1cafed[_0xe13a('0x3b')][_0xe13a('0x59')]=_0xf74ff3['id'];if(_0x3add63['query'][_0xe13a('0x3d')]){_0x1cafed[_0xe13a('0x3b')]=_['merge'](_0x1cafed[_0xe13a('0x3b')],{'$or':_['map'](_0x1cafed[_0xe13a('0x34')],function(_0x179abe){var _0x23d92e={};_0x23d92e[_0x179abe]={'$like':'%'+_0x3add63['query']['filter']+'%'};return _0x23d92e;})});}_0x1cafed=_[_0xe13a('0x40')]({},_0x1cafed,_0x3add63[_0xe13a('0x41')]);return db[_0xe13a('0x5a')][_0xe13a('0x1d')]({'where':_0x1cafed[_0xe13a('0x3b')]})['then'](function(_0x17e8d7){_0x32042b[_0xe13a('0x1d')]=_0x17e8d7;if(_0x3add63[_0xe13a('0x30')]['includeAll']){_0x1cafed[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x5a')]['findAll'](_0x1cafed);})['then'](function(_0x510641){_0x32042b[_0xe13a('0x45')]=_0x510641;return _0x32042b;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x3a2675,_0x1cafed))[_0xe13a('0x46')](handleError(_0x3a2675,null));};exports[_0xe13a('0x5b')]=function(_0x3a1b9f,_0x59a1b8,_0x4ef9b9){var _0x1996e9={'raw':!![],'where':{}};var _0x2661f6={};var _0x13291c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3a1b9f['params']['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x59a1b8,null))[_0xe13a('0x24')](function(_0x22f34a){if(_0x22f34a){_0x2661f6['model']=_[_0xe13a('0x31')](db[_0xe13a('0x5c')][_0xe13a('0x2c')]);_0x2661f6[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x3a1b9f[_0xe13a('0x30')]);_0x2661f6[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],_0x2661f6[_0xe13a('0x30')]);_0x1996e9[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],qs['fields'](_0x3a1b9f[_0xe13a('0x30')]['fields']));_0x1996e9[_0xe13a('0x34')]=_0x1996e9[_0xe13a('0x34')][_0xe13a('0x36')]?_0x1996e9['attributes']:_0x2661f6['model'];if(!_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x1996e9['limit']=qs[_0xe13a('0x1c')](_0x3a1b9f['query']['limit']);_0x1996e9[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3a1b9f['query'][_0xe13a('0x1a')]);}_0x1996e9[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3a1b9f['query'][_0xe13a('0x3a')]);_0x1996e9[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3a1b9f['query'],_0x2661f6[_0xe13a('0x32')]));_0x1996e9[_0xe13a('0x3b')][_0xe13a('0x59')]=_0x22f34a['id'];if(_0x3a1b9f['query'][_0xe13a('0x3d')]){_0x1996e9[_0xe13a('0x3b')]=_['merge'](_0x1996e9[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x1996e9[_0xe13a('0x34')],function(_0x16c7ef){var _0x4ad55e={};_0x4ad55e[_0x16c7ef]={'$like':'%'+_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x3d')]+'%'};return _0x4ad55e;})});}_0x1996e9=_['merge']({},_0x1996e9,_0x3a1b9f[_0xe13a('0x41')]);return db[_0xe13a('0x5c')]['count']({'where':_0x1996e9[_0xe13a('0x3b')]})['then'](function(_0x414768){_0x13291c['count']=_0x414768;if(_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x47')]){_0x1996e9['include']=[{'all':!![]}];}return db[_0xe13a('0x5c')][_0xe13a('0x44')](_0x1996e9);})['then'](function(_0x2d5c77){_0x13291c[_0xe13a('0x45')]=_0x2d5c77;return _0x13291c;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x59a1b8,_0x1996e9))[_0xe13a('0x46')](handleError(_0x59a1b8,null));};function char(_0x15fe68){return _0xe13a('0x5d')===typeof _0x15fe68?String[_0xe13a('0x5e')][_0xe13a('0x21')](null,arguments):_0x15fe68;}function needsEncapsulation(_0x324b6e){return!!_0x324b6e&&(_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0xd))>=0x0||_0x324b6e[_0xe13a('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x2c))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x22))>=0x0);}function encapsulate(_0x4e29ed){var _0x6cf593=char(0x22),_0x3f6669='\x5c'+char(0x22),_0x38ffa4=_0x4e29ed[_0xe13a('0x5f')]()[_0xe13a('0x61')](new RegExp(_0x6cf593,'g'),_0x3f6669);return _0x6cf593+_0x38ffa4+_0x6cf593;}exports[_0xe13a('0x62')]=function(_0x42fc9f,_0x3e3b69,_0x4e9c37){var _0x83e460,_0x4848cf;var _0x2c02aa={'where':{'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']}};if(_0x42fc9f['query'][_0xe13a('0x63')]){_0x2c02aa[_0xe13a('0x3b')][_0xe13a('0x64')]=JSON[_0xe13a('0x65')](_0x42fc9f[_0xe13a('0x30')][_0xe13a('0x63')]);}return db[_0xe13a('0x5a')][_0xe13a('0x44')](_0x2c02aa)['then'](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0x3ae5f5){if(_0x3ae5f5){_0x83e460=_0x3ae5f5;return db[_0xe13a('0x66')][_0xe13a('0x44')]({'where':{'SessionId':{'$in':_[_0xe13a('0x3e')](_0x83e460,'id')},'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']},'order':_0xe13a('0x67')});}})[_0xe13a('0x24')](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0xf906cf){if(_0xf906cf){_0x4848cf=_0xf906cf;var _0x45947e={};for(var _0x149937=0x0,_0x492d80=_0x4848cf['length'];_0x149937<_0x492d80;_0x149937++){if(!_0x45947e['hasOwnProperty'](_0x4848cf[_0x149937][_0xe13a('0x68')])){_0x45947e[_0x4848cf[_0x149937][_0xe13a('0x68')]]=needsEncapsulation(_0x4848cf[_0x149937][_0xe13a('0x69')])?encapsulate(_0x4848cf[_0x149937][_0xe13a('0x69')]):_0x4848cf[_0x149937][_0xe13a('0x69')];}}var _0x2ab79a=[],_0x1cd5c4={};for(var _0xe9e2cf=0x0,_0x178c60=_0x83e460[_0xe13a('0x36')];_0xe9e2cf<_0x178c60;_0xe9e2cf++){_0x1cd5c4={'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id'],'SessionId':_0x83e460[_0xe9e2cf]['id'],'StartTime':moment(_0x83e460[_0xe9e2cf]['starttime'])[_0xe13a('0x6a')](_0xe13a('0x6b'))};for(var _0xdfb32c=0x0,_0x16f36c=_0x4848cf['length'];_0xdfb32c<_0x16f36c;_0xdfb32c++){if(_0x4848cf[_0xdfb32c][_0xe13a('0x6c')]==_0x83e460[_0xe9e2cf]['id']&&_0x45947e[_0xe13a('0x37')](_0x4848cf[_0xdfb32c]['questionId'])){_0x1cd5c4[_0x45947e[_0x4848cf[_0xdfb32c]['questionId']]]=_0x4848cf[_0xdfb32c][_0xe13a('0x6d')];}}for(var _0x5635bd in _0x45947e){if(!_0x1cd5c4['hasOwnProperty'](_0x45947e[_0x5635bd])){_0x1cd5c4[_0x45947e[_0x5635bd]]=null;}}_0x2ab79a[_0xe13a('0x6e')](_0x1cd5c4);}return _0x2ab79a;}})[_0xe13a('0x24')](function(_0x1c82bf){if(!_['isEmpty'](_0x1c82bf)){var _0x43aaa6=toCsv(_0x1c82bf);var _0x5165e7=Date[_0xe13a('0x6f')]();fs['writeFileSync'](util[_0xe13a('0x6a')](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7),_0x43aaa6);_0x3e3b69['setHeader'](_0xe13a('0x71'),_0xe13a('0x72')+util[_0xe13a('0x6a')](_0xe13a('0x73'),_0x42fc9f['params']['id'],_0x5165e7));_0x3e3b69['setHeader'](_0xe13a('0x74'),_0xe13a('0x75'));return _0x3e3b69['download'](util['format'](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7));}else{return _0x3e3b69['sendStatus'](0xcc);}})[_0xe13a('0x46')](handleError(_0x3e3b69,null));};
\ No newline at end of file
index 7bce1e1..928378c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd493=['bluebird','rimraf','../../config/environment','define','JscriptyProject','lodash','../../config/logger','api'];(function(_0x271731,_0x416f84){var _0x26fe9f=function(_0x56f95a){while(--_0x56f95a){_0x271731['push'](_0x271731['shift']());}};_0x26fe9f(++_0x416f84);}(_0xd493,0x1bd));var _0x3d49=function(_0x58d26b,_0xf54d6e){_0x58d26b=_0x58d26b-0x0;var _0x3fbbe1=_0xd493[_0x58d26b];return _0x3fbbe1;};'use strict';var _=require(_0x3d49('0x0'));var util=require('util');var logger=require(_0x3d49('0x1'))(_0x3d49('0x2'));var moment=require('moment');var BPromise=require(_0x3d49('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d49('0x4'));var config=require(_0x3d49('0x5'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1550e0,_0x1316f4){return _0x1550e0[_0x3d49('0x6')](_0x3d49('0x7'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f63=['JscriptyProject','jscripty_projects','lodash','util','api','moment','bluebird','path','rimraf','exports'];(function(_0x564c20,_0x579563){var _0x108246=function(_0x5b6381){while(--_0x5b6381){_0x564c20['push'](_0x564c20['shift']());}};_0x108246(++_0x579563);}(_0x1f63,0x7a));var _0x31f6=function(_0x388a51,_0x4bb93a){_0x388a51=_0x388a51-0x0;var _0x1d8b52=_0x1f63[_0x388a51];return _0x1d8b52;};'use strict';var _=require(_0x31f6('0x0'));var util=require(_0x31f6('0x1'));var logger=require('../../config/logger')(_0x31f6('0x2'));var moment=require(_0x31f6('0x3'));var BPromise=require(_0x31f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31f6('0x5'));var rimraf=require(_0x31f6('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x31f6('0x7')]=function(_0x11250b,_0xe8437e){return _0x11250b['define'](_0x31f6('0x8'),attributes,{'tableName':_0x31f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97b57a0..cad821c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5558fb,_0xe6bb5e){var _0x11368d=function(_0x4f0cd6){while(--_0x4f0cd6){_0x5558fb['push'](_0x5558fb['shift']());}};_0x11368d(++_0xe6bb5e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1d6879,_0x23c6a4){_0x1d6879=_0x1d6879-0x0;var _0x4a3a0d=_0xf4eb[_0x1d6879];return _0x4a3a0d;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
+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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x5ecaa6,_0x48525b){_0x5ecaa6=_0x5ecaa6-0x0;var _0x47d637=_0xac4a[_0x5ecaa6];return _0x47d637;};'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
index fb97652..850ae74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf104=['/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','show','create','put'];(function(_0x215de2,_0x4b0c1f){var _0x14a8d1=function(_0x39adf0){while(--_0x39adf0){_0x215de2['push'](_0x215de2['shift']());}};_0x14a8d1(++_0x4b0c1f);}(_0xf104,0x19d));var _0x4f10=function(_0x50913c,_0x1476fb){_0x50913c=_0x50913c-0x0;var _0x26cab=_0xf104[_0x50913c];return _0x26cab;};'use strict';var multer=require(_0x4f10('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f10('0x1'));var express=require(_0x4f10('0x2'));var router=express['Router']();var fs_extra=require(_0x4f10('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f10('0x4'));router[_0x4f10('0x5')]('/',auth['isAuthenticated'](),controller[_0x4f10('0x6')]);router[_0x4f10('0x5')](_0x4f10('0x7'),auth[_0x4f10('0x8')](),controller['describe']);router['get']('/:id',auth[_0x4f10('0x8')](),controller[_0x4f10('0x9')]);router['post']('/',auth[_0x4f10('0x8')](),controller[_0x4f10('0xa')]);router[_0x4f10('0xb')](_0x4f10('0xc'),auth[_0x4f10('0x8')](),controller[_0x4f10('0xd')]);router[_0x4f10('0xe')](_0x4f10('0xc'),auth[_0x4f10('0x8')](),controller[_0x4f10('0xf')]);module[_0x4f10('0x10')]=router;
\ No newline at end of file
+var _0xf3fd=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','describe','/:id','show','create','update','delete','exports'];(function(_0x570c5e,_0x38e19c){var _0xc8b27d=function(_0x4d1867){while(--_0x4d1867){_0x570c5e['push'](_0x570c5e['shift']());}};_0xc8b27d(++_0x38e19c);}(_0xf3fd,0x6c));var _0xdf3f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf3fd[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xdf3f('0x0'));var path=require('path');var timeout=require(_0xdf3f('0x1'));var express=require(_0xdf3f('0x2'));var router=express[_0xdf3f('0x3')]();var fs_extra=require(_0xdf3f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdf3f('0x5'));var config=require(_0xdf3f('0x6'));var controller=require(_0xdf3f('0x7'));router[_0xdf3f('0x8')]('/',auth[_0xdf3f('0x9')](),controller[_0xdf3f('0xa')]);router[_0xdf3f('0x8')]('/describe',auth[_0xdf3f('0x9')](),controller[_0xdf3f('0xb')]);router[_0xdf3f('0x8')](_0xdf3f('0xc'),auth['isAuthenticated'](),controller[_0xdf3f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdf3f('0xe')]);router['put'](_0xdf3f('0xc'),auth[_0xdf3f('0x9')](),controller[_0xdf3f('0xf')]);router[_0xdf3f('0x10')]('/:id',auth[_0xdf3f('0x9')](),controller['destroy']);module[_0xdf3f('0x11')]=router;
\ No newline at end of file
index b069859..156f1b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0x18ae2c,_0x3a0477){_0x18ae2c=_0x18ae2c-0x0;var _0x121fe3=_0x7a54[_0x18ae2c];return _0x121fe3;};'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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0xa74951,_0x5d49c1){_0xa74951=_0xa74951-0x0;var _0x2a92ff=_0x7a54[_0xa74951];return _0x2a92ff;};'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 d1b92b1..77286bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42a4=['type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','JscriptyQuestionReport'];(function(_0x1ad4d7,_0x2a0e06){var _0x8d319f=function(_0x44af61){while(--_0x44af61){_0x1ad4d7['push'](_0x1ad4d7['shift']());}};_0x8d319f(++_0x2a0e06);}(_0x42a4,0xb3));var _0x442a=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x42a4[_0x5c846d];return _0xd064e4;};'use strict';var emlformat=require(_0x442a('0x0'));var rimraf=require(_0x442a('0x1'));var zipdir=require(_0x442a('0x2'));var jsonpatch=require(_0x442a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x442a('0x4'));var Mustache=require(_0x442a('0x5'));var util=require(_0x442a('0x6'));var path=require(_0x442a('0x7'));var sox=require(_0x442a('0x8'));var csv=require(_0x442a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x442a('0xa'));var _=require(_0x442a('0xb'));var squel=require(_0x442a('0xc'));var crypto=require(_0x442a('0xd'));var jsforce=require(_0x442a('0xe'));var deskjs=require(_0x442a('0xf'));var toCsv=require(_0x442a('0x9'));var querystring=require('querystring');var Papa=require(_0x442a('0x10'));var Redis=require(_0x442a('0x11'));var authService=require(_0x442a('0x12'));var qs=require(_0x442a('0x13'));var as=require(_0x442a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x442a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x442a('0x16'));var licenseUtil=require(_0x442a('0x17'));var db=require(_0x442a('0x18'))['db'];function respondWithStatusCode(_0x250108,_0x3a0812){_0x3a0812=_0x3a0812||0xcc;return function(_0x17b031){if(_0x17b031){return _0x250108[_0x442a('0x19')](_0x3a0812);}return _0x250108[_0x442a('0x1a')](_0x3a0812)[_0x442a('0x1b')]();};}function respondWithResult(_0x53dbed,_0x5ee57c){_0x5ee57c=_0x5ee57c||0xc8;return function(_0x20a73b){if(_0x20a73b){return _0x53dbed['status'](_0x5ee57c)[_0x442a('0x1c')](_0x20a73b);}};}function respondWithFilteredResult(_0x1159b3,_0x4bd9f8){return function(_0x2b3065){if(_0x2b3065){var _0x16cdd4=typeof _0x4bd9f8[_0x442a('0x1d')]===_0x442a('0x1e')&&typeof _0x4bd9f8[_0x442a('0x1f')]===_0x442a('0x1e');var _0x58c2bd=_0x2b3065[_0x442a('0x20')];var _0x598249=_0x16cdd4?0x0:_0x4bd9f8['offset'];var _0xdc763e=_0x16cdd4?_0x2b3065[_0x442a('0x20')]:_0x4bd9f8[_0x442a('0x1d')]+_0x4bd9f8[_0x442a('0x1f')];var _0xee7d16;if(_0xdc763e>=_0x58c2bd){_0xdc763e=_0x58c2bd;_0xee7d16=0xc8;}else{_0xee7d16=0xce;}_0x1159b3[_0x442a('0x1a')](_0xee7d16);return _0x1159b3[_0x442a('0x21')](_0x442a('0x22'),_0x598249+'-'+_0xdc763e+'/'+_0x58c2bd)['json'](_0x2b3065);}return null;};}function patchUpdates(_0x183862){return function(_0x5ca2ad){try{jsonpatch[_0x442a('0x23')](_0x5ca2ad,_0x183862,!![]);}catch(_0x4c36f7){return BPromise['reject'](_0x4c36f7);}return _0x5ca2ad[_0x442a('0x24')]();};}function saveUpdates(_0x3a87a3,_0x1f2cf2){return function(_0x443324){if(_0x443324){return _0x443324[_0x442a('0x25')](_0x3a87a3)[_0x442a('0x26')](function(_0x1a12c7){return _0x1a12c7;});}return null;};}function removeEntity(_0x6347f2,_0x1b6459){return function(_0x853897){if(_0x853897){return _0x853897[_0x442a('0x27')]()[_0x442a('0x26')](function(){_0x6347f2[_0x442a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c123a,_0x2ea035){return function(_0x31ac6a){if(!_0x31ac6a){_0x2c123a[_0x442a('0x19')](0x194);}return _0x31ac6a;};}function handleError(_0x2b7eea,_0x26f9b9){_0x26f9b9=_0x26f9b9||0x1f4;return function(_0x3cc8c6){logger[_0x442a('0x28')](_0x3cc8c6['stack']);if(_0x3cc8c6[_0x442a('0x29')]){delete _0x3cc8c6['name'];}_0x2b7eea['status'](_0x26f9b9)[_0x442a('0x2a')](_0x3cc8c6);};}exports[_0x442a('0x2b')]=function(_0x2890b5,_0x481077){var _0x455687={},_0x1fcd79={},_0x463051={'count':0x0,'rows':[]};var _0x5dd647=_[_0x442a('0x2c')](db[_0x442a('0x2d')]['rawAttributes'],function(_0x138897){return{'name':_0x138897['fieldName'],'type':_0x138897[_0x442a('0x2e')]['key']};});_0x1fcd79[_0x442a('0x2f')]=_[_0x442a('0x2c')](_0x5dd647,_0x442a('0x29'));_0x1fcd79[_0x442a('0x30')]=_[_0x442a('0x31')](_0x2890b5['query']);_0x1fcd79[_0x442a('0x32')]=_['intersection'](_0x1fcd79[_0x442a('0x2f')],_0x1fcd79[_0x442a('0x30')]);_0x455687[_0x442a('0x33')]=_[_0x442a('0x34')](_0x1fcd79[_0x442a('0x2f')],qs[_0x442a('0x35')](_0x2890b5['query']['fields']));_0x455687[_0x442a('0x33')]=_0x455687[_0x442a('0x33')]['length']?_0x455687[_0x442a('0x33')]:_0x1fcd79[_0x442a('0x2f')];if(!_0x2890b5[_0x442a('0x30')][_0x442a('0x36')](_0x442a('0x37'))){_0x455687[_0x442a('0x1f')]=qs[_0x442a('0x1f')](_0x2890b5[_0x442a('0x30')][_0x442a('0x1f')]);_0x455687[_0x442a('0x1d')]=qs[_0x442a('0x1d')](_0x2890b5[_0x442a('0x30')]['offset']);}_0x455687[_0x442a('0x38')]=qs['sort'](_0x2890b5[_0x442a('0x30')][_0x442a('0x39')]);_0x455687[_0x442a('0x3a')]=qs[_0x442a('0x32')](_[_0x442a('0x3b')](_0x2890b5[_0x442a('0x30')],_0x1fcd79[_0x442a('0x32')]),_0x5dd647);if(_0x2890b5[_0x442a('0x30')][_0x442a('0x3c')]){_0x455687[_0x442a('0x3a')]=_[_0x442a('0x3d')](_0x455687[_0x442a('0x3a')],{'$or':_[_0x442a('0x2c')](_0x5dd647,function(_0x458a67){if(_0x458a67[_0x442a('0x2e')]!==_0x442a('0x3e')){var _0xf11904={};_0xf11904[_0x458a67[_0x442a('0x29')]]={'$like':'%'+_0x2890b5['query'][_0x442a('0x3c')]+'%'};return _0xf11904;}})});}_0x455687=_[_0x442a('0x3d')]({},_0x455687,_0x2890b5[_0x442a('0x3f')]);var _0x54e154={'where':_0x455687[_0x442a('0x3a')]};return db[_0x442a('0x2d')][_0x442a('0x20')](_0x54e154)[_0x442a('0x26')](function(_0x2ef5c6){_0x463051['count']=_0x2ef5c6;if(_0x2890b5[_0x442a('0x30')]['includeAll']){_0x455687[_0x442a('0x40')]=[{'all':!![]}];}return db[_0x442a('0x2d')][_0x442a('0x41')](_0x455687);})[_0x442a('0x26')](function(_0x258218){_0x463051['rows']=_0x258218;return _0x463051;})['then'](respondWithFilteredResult(_0x481077,_0x455687))[_0x442a('0x42')](handleError(_0x481077,null));};exports[_0x442a('0x43')]=function(_0x46c250,_0x4254ee){var _0x279c4e={'raw':!![],'where':{'id':_0x46c250[_0x442a('0x44')]['id']}},_0x51b03f={};_0x51b03f['model']=_[_0x442a('0x31')](db['JscriptyQuestionReport']['rawAttributes']);_0x51b03f['query']=_['keys'](_0x46c250[_0x442a('0x30')]);_0x51b03f['filters']=_[_0x442a('0x34')](_0x51b03f['model'],_0x51b03f[_0x442a('0x30')]);_0x279c4e[_0x442a('0x33')]=_[_0x442a('0x34')](_0x51b03f['model'],qs[_0x442a('0x35')](_0x46c250[_0x442a('0x30')][_0x442a('0x35')]));_0x279c4e[_0x442a('0x33')]=_0x279c4e['attributes'][_0x442a('0x45')]?_0x279c4e[_0x442a('0x33')]:_0x51b03f[_0x442a('0x2f')];if(_0x46c250[_0x442a('0x30')][_0x442a('0x46')]){_0x279c4e['include']=[{'all':!![]}];}_0x279c4e=_['merge']({},_0x279c4e,_0x46c250[_0x442a('0x3f')]);return db['JscriptyQuestionReport']['find'](_0x279c4e)[_0x442a('0x26')](handleEntityNotFound(_0x4254ee,null))[_0x442a('0x26')](respondWithResult(_0x4254ee,null))['catch'](handleError(_0x4254ee,null));};exports[_0x442a('0x47')]=function(_0x32c3a2,_0x554a37){return db['JscriptyQuestionReport']['create'](_0x32c3a2[_0x442a('0x48')],{})['then'](respondWithResult(_0x554a37,0xc9))[_0x442a('0x42')](handleError(_0x554a37,null));};exports[_0x442a('0x25')]=function(_0x3fe2ec,_0x26274a){if(_0x3fe2ec['body']['id']){delete _0x3fe2ec[_0x442a('0x48')]['id'];}return db[_0x442a('0x2d')][_0x442a('0x49')]({'where':{'id':_0x3fe2ec[_0x442a('0x44')]['id']}})[_0x442a('0x26')](handleEntityNotFound(_0x26274a,null))[_0x442a('0x26')](saveUpdates(_0x3fe2ec['body'],null))[_0x442a('0x26')](respondWithResult(_0x26274a,null))[_0x442a('0x42')](handleError(_0x26274a,null));};exports[_0x442a('0x27')]=function(_0x1b9629,_0x3d205e){return db['JscriptyQuestionReport'][_0x442a('0x49')]({'where':{'id':_0x1b9629[_0x442a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d205e,null))[_0x442a('0x26')](removeEntity(_0x3d205e,null))['catch'](handleError(_0x3d205e,null));};exports['describe']=function(_0x1f5fb4,_0x56a459){return db[_0x442a('0x2d')][_0x442a('0x4a')]()[_0x442a('0x26')](respondWithResult(_0x56a459,null))[_0x442a('0x42')](handleError(_0x56a459,null));};
\ No newline at end of file
+var _0x6d19=['count','set','Content-Range','apply','save','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','params','include','merge','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','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/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x18ef4a,_0x52a9e5){var _0x38a37f=function(_0x468a77){while(--_0x468a77){_0x18ef4a['push'](_0x18ef4a['shift']());}};_0x38a37f(++_0x52a9e5);}(_0x6d19,0x1ae));var _0x96d1=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0x6d19[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require(_0x96d1('0x0'));var rimraf=require(_0x96d1('0x1'));var zipdir=require(_0x96d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96d1('0x3'));var moment=require(_0x96d1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96d1('0x5'));var path=require(_0x96d1('0x6'));var sox=require(_0x96d1('0x7'));var csv=require(_0x96d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96d1('0x9'));var _=require(_0x96d1('0xa'));var squel=require(_0x96d1('0xb'));var crypto=require(_0x96d1('0xc'));var jsforce=require(_0x96d1('0xd'));var deskjs=require(_0x96d1('0xe'));var toCsv=require(_0x96d1('0x8'));var querystring=require(_0x96d1('0xf'));var Papa=require(_0x96d1('0x10'));var Redis=require(_0x96d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x96d1('0x12'));var as=require(_0x96d1('0x13'));var hardwareService=require(_0x96d1('0x14'));var logger=require(_0x96d1('0x15'))('api');var utils=require(_0x96d1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x96d1('0x17'));var db=require(_0x96d1('0x18'))['db'];function respondWithStatusCode(_0x12272d,_0x310e69){_0x310e69=_0x310e69||0xcc;return function(_0x37beca){if(_0x37beca){return _0x12272d[_0x96d1('0x19')](_0x310e69);}return _0x12272d[_0x96d1('0x1a')](_0x310e69)[_0x96d1('0x1b')]();};}function respondWithResult(_0x53b6d9,_0x499bc8){_0x499bc8=_0x499bc8||0xc8;return function(_0x47d7db){if(_0x47d7db){return _0x53b6d9[_0x96d1('0x1a')](_0x499bc8)[_0x96d1('0x1c')](_0x47d7db);}};}function respondWithFilteredResult(_0x1d928b,_0xab21a0){return function(_0x11372a){if(_0x11372a){var _0x265042=typeof _0xab21a0[_0x96d1('0x1d')]===_0x96d1('0x1e')&&typeof _0xab21a0[_0x96d1('0x1f')]===_0x96d1('0x1e');var _0x1ce4f5=_0x11372a['count'];var _0x44af1f=_0x265042?0x0:_0xab21a0['offset'];var _0x53b9a6=_0x265042?_0x11372a[_0x96d1('0x20')]:_0xab21a0[_0x96d1('0x1d')]+_0xab21a0[_0x96d1('0x1f')];var _0x11ad80;if(_0x53b9a6>=_0x1ce4f5){_0x53b9a6=_0x1ce4f5;_0x11ad80=0xc8;}else{_0x11ad80=0xce;}_0x1d928b[_0x96d1('0x1a')](_0x11ad80);return _0x1d928b[_0x96d1('0x21')](_0x96d1('0x22'),_0x44af1f+'-'+_0x53b9a6+'/'+_0x1ce4f5)['json'](_0x11372a);}return null;};}function patchUpdates(_0x4ba0e5){return function(_0x48710d){try{jsonpatch[_0x96d1('0x23')](_0x48710d,_0x4ba0e5,!![]);}catch(_0x239452){return BPromise['reject'](_0x239452);}return _0x48710d[_0x96d1('0x24')]();};}function saveUpdates(_0x2a94ad,_0x5e2eef){return function(_0x17d2b1){if(_0x17d2b1){return _0x17d2b1['update'](_0x2a94ad)[_0x96d1('0x25')](function(_0x437d92){return _0x437d92;});}return null;};}function removeEntity(_0x31d6ff,_0x385641){return function(_0x223e20){if(_0x223e20){return _0x223e20['destroy']()[_0x96d1('0x25')](function(){_0x31d6ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24449d,_0x1b8821){return function(_0x147fcc){if(!_0x147fcc){_0x24449d['sendStatus'](0x194);}return _0x147fcc;};}function handleError(_0x113516,_0xfea1ae){_0xfea1ae=_0xfea1ae||0x1f4;return function(_0x223e96){logger[_0x96d1('0x26')](_0x223e96[_0x96d1('0x27')]);if(_0x223e96[_0x96d1('0x28')]){delete _0x223e96[_0x96d1('0x28')];}_0x113516[_0x96d1('0x1a')](_0xfea1ae)[_0x96d1('0x29')](_0x223e96);};}exports[_0x96d1('0x2a')]=function(_0x416da1,_0x4afaeb){var _0x4543ba={},_0x4f3318={},_0x4732c6={'count':0x0,'rows':[]};var _0x530337=_['map'](db[_0x96d1('0x2b')][_0x96d1('0x2c')],function(_0x14cb72){return{'name':_0x14cb72[_0x96d1('0x2d')],'type':_0x14cb72[_0x96d1('0x2e')][_0x96d1('0x2f')]};});_0x4f3318[_0x96d1('0x30')]=_[_0x96d1('0x31')](_0x530337,'name');_0x4f3318['query']=_[_0x96d1('0x32')](_0x416da1[_0x96d1('0x33')]);_0x4f3318[_0x96d1('0x34')]=_['intersection'](_0x4f3318[_0x96d1('0x30')],_0x4f3318[_0x96d1('0x33')]);_0x4543ba[_0x96d1('0x35')]=_[_0x96d1('0x36')](_0x4f3318[_0x96d1('0x30')],qs[_0x96d1('0x37')](_0x416da1['query'][_0x96d1('0x37')]));_0x4543ba[_0x96d1('0x35')]=_0x4543ba[_0x96d1('0x35')][_0x96d1('0x38')]?_0x4543ba['attributes']:_0x4f3318[_0x96d1('0x30')];if(!_0x416da1[_0x96d1('0x33')][_0x96d1('0x39')]('nolimit')){_0x4543ba[_0x96d1('0x1f')]=qs['limit'](_0x416da1[_0x96d1('0x33')][_0x96d1('0x1f')]);_0x4543ba[_0x96d1('0x1d')]=qs[_0x96d1('0x1d')](_0x416da1[_0x96d1('0x33')]['offset']);}_0x4543ba[_0x96d1('0x3a')]=qs[_0x96d1('0x3b')](_0x416da1[_0x96d1('0x33')][_0x96d1('0x3b')]);_0x4543ba['where']=qs['filters'](_[_0x96d1('0x3c')](_0x416da1[_0x96d1('0x33')],_0x4f3318[_0x96d1('0x34')]),_0x530337);if(_0x416da1[_0x96d1('0x33')][_0x96d1('0x3d')]){_0x4543ba[_0x96d1('0x3e')]=_['merge'](_0x4543ba['where'],{'$or':_[_0x96d1('0x31')](_0x530337,function(_0x122b02){if(_0x122b02[_0x96d1('0x2e')]!==_0x96d1('0x3f')){var _0x28ec97={};_0x28ec97[_0x122b02[_0x96d1('0x28')]]={'$like':'%'+_0x416da1[_0x96d1('0x33')][_0x96d1('0x3d')]+'%'};return _0x28ec97;}})});}_0x4543ba=_['merge']({},_0x4543ba,_0x416da1[_0x96d1('0x40')]);var _0x29cfc4={'where':_0x4543ba[_0x96d1('0x3e')]};return db[_0x96d1('0x2b')]['count'](_0x29cfc4)['then'](function(_0x11a077){_0x4732c6[_0x96d1('0x20')]=_0x11a077;if(_0x416da1['query'][_0x96d1('0x41')]){_0x4543ba['include']=[{'all':!![]}];}return db[_0x96d1('0x2b')][_0x96d1('0x42')](_0x4543ba);})[_0x96d1('0x25')](function(_0x21528b){_0x4732c6[_0x96d1('0x43')]=_0x21528b;return _0x4732c6;})[_0x96d1('0x25')](respondWithFilteredResult(_0x4afaeb,_0x4543ba))['catch'](handleError(_0x4afaeb,null));};exports['show']=function(_0x529a58,_0x3a3bbd){var _0x156a34={'raw':!![],'where':{'id':_0x529a58[_0x96d1('0x44')]['id']}},_0x267164={};_0x267164[_0x96d1('0x30')]=_['keys'](db[_0x96d1('0x2b')]['rawAttributes']);_0x267164['query']=_[_0x96d1('0x32')](_0x529a58['query']);_0x267164[_0x96d1('0x34')]=_[_0x96d1('0x36')](_0x267164[_0x96d1('0x30')],_0x267164[_0x96d1('0x33')]);_0x156a34[_0x96d1('0x35')]=_[_0x96d1('0x36')](_0x267164[_0x96d1('0x30')],qs[_0x96d1('0x37')](_0x529a58['query'][_0x96d1('0x37')]));_0x156a34[_0x96d1('0x35')]=_0x156a34[_0x96d1('0x35')]['length']?_0x156a34[_0x96d1('0x35')]:_0x267164[_0x96d1('0x30')];if(_0x529a58['query']['includeAll']){_0x156a34[_0x96d1('0x45')]=[{'all':!![]}];}_0x156a34=_[_0x96d1('0x46')]({},_0x156a34,_0x529a58[_0x96d1('0x40')]);return db[_0x96d1('0x2b')][_0x96d1('0x47')](_0x156a34)['then'](handleEntityNotFound(_0x3a3bbd,null))[_0x96d1('0x25')](respondWithResult(_0x3a3bbd,null))[_0x96d1('0x48')](handleError(_0x3a3bbd,null));};exports['create']=function(_0x48897d,_0x56af95){return db[_0x96d1('0x2b')][_0x96d1('0x49')](_0x48897d[_0x96d1('0x4a')],{})['then'](respondWithResult(_0x56af95,0xc9))[_0x96d1('0x48')](handleError(_0x56af95,null));};exports['update']=function(_0x10fc26,_0x44c419){if(_0x10fc26[_0x96d1('0x4a')]['id']){delete _0x10fc26[_0x96d1('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0x96d1('0x47')]({'where':{'id':_0x10fc26['params']['id']}})[_0x96d1('0x25')](handleEntityNotFound(_0x44c419,null))[_0x96d1('0x25')](saveUpdates(_0x10fc26[_0x96d1('0x4a')],null))['then'](respondWithResult(_0x44c419,null))[_0x96d1('0x48')](handleError(_0x44c419,null));};exports[_0x96d1('0x4b')]=function(_0x1a3602,_0x4602a5){return db[_0x96d1('0x2b')]['find']({'where':{'id':_0x1a3602['params']['id']}})['then'](handleEntityNotFound(_0x4602a5,null))[_0x96d1('0x25')](removeEntity(_0x4602a5,null))[_0x96d1('0x48')](handleError(_0x4602a5,null));};exports[_0x96d1('0x4c')]=function(_0x23a379,_0x6c20c5){return db[_0x96d1('0x2b')][_0x96d1('0x4c')]()['then'](respondWithResult(_0x6c20c5,null))[_0x96d1('0x48')](handleError(_0x6c20c5,null));};
\ No newline at end of file
index 537094c..61feceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eea=['exports','define','JscriptyQuestionReport','../../config/logger','api','moment','bluebird','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0xebe7f3,_0x1ee7e6){var _0x592902=function(_0x9570bb){while(--_0x9570bb){_0xebe7f3['push'](_0xebe7f3['shift']());}};_0x592902(++_0x1ee7e6);}(_0x2eea,0xb7));var _0xa2ee=function(_0xc9bd00,_0x28d3dc){_0xc9bd00=_0xc9bd00-0x0;var _0x374392=_0x2eea[_0xc9bd00];return _0x374392;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2ee('0x0'))(_0xa2ee('0x1'));var moment=require(_0xa2ee('0x2'));var BPromise=require(_0xa2ee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa2ee('0x4'));var attributes=require(_0xa2ee('0x5'));module[_0xa2ee('0x6')]=function(_0x31ae69,_0x56e5a2){return _0x31ae69[_0xa2ee('0x7')](_0xa2ee('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde13=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment'];(function(_0x2e2ca1,_0x13ad4a){var _0x3b1852=function(_0x4079ce){while(--_0x4079ce){_0x2e2ca1['push'](_0x2e2ca1['shift']());}};_0x3b1852(++_0x13ad4a);}(_0xde13,0x1f4));var _0x3de1=function(_0x5d626c,_0x28a80e){_0x5d626c=_0x5d626c-0x0;var _0x36313e=_0xde13[_0x5d626c];return _0x36313e;};'use strict';var _=require('lodash');var util=require(_0x3de1('0x0'));var logger=require(_0x3de1('0x1'))(_0x3de1('0x2'));var moment=require(_0x3de1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3de1('0x4'));var rimraf=require(_0x3de1('0x5'));var config=require(_0x3de1('0x6'));var attributes=require(_0x3de1('0x7'));module[_0x3de1('0x8')]=function(_0x5c1033,_0x2d433c){return _0x5c1033[_0x3de1('0x9')](_0x3de1('0xa'),attributes,{'tableName':_0x3de1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc10eee..b3708ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x585e=['info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/environment','client','http','request','then'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x585e,0x186));var _0xe585=function(_0x5bcafe,_0x5709ce){_0x5bcafe=_0x5bcafe-0x0;var _0x2a3d1e=_0x585e[_0x5bcafe];return _0x2a3d1e;};'use strict';var _=require(_0xe585('0x0'));var util=require('util');var moment=require(_0xe585('0x1'));var BPromise=require('bluebird');var rs=require(_0xe585('0x2'));var fs=require('fs');var Redis=require(_0xe585('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe585('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe585('0x5')][_0xe585('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2437ba,_0x2bbe97,_0x1c084d){return new BPromise(function(_0x10a345,_0x3e8b5d){return client[_0xe585('0x7')](_0x2437ba,_0x1c084d)[_0xe585('0x8')](function(_0x35e790){logger[_0xe585('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2bbe97,'request\x20sent');logger[_0xe585('0xa')](_0xe585('0xb'),_0x2bbe97,'request\x20sent',JSON[_0xe585('0xc')](_0x35e790));if(_0x35e790['error']){if(_0x35e790[_0xe585('0xd')][_0xe585('0xe')]===0x1f4){logger[_0xe585('0xd')](_0xe585('0xf'),_0x2bbe97,_0x35e790[_0xe585('0xd')][_0xe585('0x10')]);return _0x3e8b5d(_0x35e790[_0xe585('0xd')]['message']);}logger['error'](_0xe585('0xf'),_0x2bbe97,_0x35e790[_0xe585('0xd')][_0xe585('0x10')]);return _0x10a345(_0x35e790['error'][_0xe585('0x10')]);}else{logger[_0xe585('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2bbe97,'request\x20sent');_0x10a345(_0x35e790[_0xe585('0x11')]['message']);}})[_0xe585('0x12')](function(_0x4b0fa5){logger[_0xe585('0xd')](_0xe585('0xf'),_0x2bbe97,_0x4b0fa5);_0x3e8b5d(_0x4b0fa5);});});}
\ No newline at end of file
+var _0x900f=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1384dd,_0x1eebcc){var _0x3b4a3f=function(_0x147044){while(--_0x147044){_0x1384dd['push'](_0x1384dd['shift']());}};_0x3b4a3f(++_0x1eebcc);}(_0x900f,0x18a));var _0xf900=function(_0x92bc95,_0x2dbcc0){_0x92bc95=_0x92bc95-0x0;var _0x1d671e=_0x900f[_0x92bc95];return _0x1d671e;};'use strict';var _=require(_0xf900('0x0'));var util=require(_0xf900('0x1'));var moment=require('moment');var BPromise=require(_0xf900('0x2'));var rs=require(_0xf900('0x3'));var fs=require('fs');var Redis=require(_0xf900('0x4'));var db=require(_0xf900('0x5'))['db'];var utils=require(_0xf900('0x6'));var logger=require(_0xf900('0x7'))('rpc');var config=require(_0xf900('0x8'));var jayson=require(_0xf900('0x9'));var client=jayson[_0xf900('0xa')][_0xf900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f01ff,_0x56fcd4,_0x44153a){return new BPromise(function(_0x4cfc6d,_0x4cbf6b){return client[_0xf900('0xc')](_0x1f01ff,_0x44153a)[_0xf900('0xd')](function(_0x4bdc30){logger[_0xf900('0xe')](_0xf900('0xf'),_0x56fcd4,_0xf900('0x10'));logger['debug'](_0xf900('0x11'),_0x56fcd4,_0xf900('0x10'),JSON[_0xf900('0x12')](_0x4bdc30));if(_0x4bdc30[_0xf900('0x13')]){if(_0x4bdc30['error'][_0xf900('0x14')]===0x1f4){logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30['error'][_0xf900('0x15')]);return _0x4cbf6b(_0x4bdc30[_0xf900('0x13')]['message']);}logger[_0xf900('0x13')](_0xf900('0xf'),_0x56fcd4,_0x4bdc30[_0xf900('0x13')]['message']);return _0x4cfc6d(_0x4bdc30[_0xf900('0x13')][_0xf900('0x15')]);}else{logger[_0xf900('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x56fcd4,_0xf900('0x10'));_0x4cfc6d(_0x4bdc30[_0xf900('0x16')][_0xf900('0x15')]);}})[_0xf900('0x17')](function(_0xc96578){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x56fcd4,_0xc96578);_0x4cbf6b(_0xc96578);});});}
\ No newline at end of file
index 81cbb22..a08d034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb16a=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions','getQuestions','/:id','update'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xb16a,0x1a6));var _0xab16=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb16a[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xab16('0x0'));var util=require(_0xab16('0x1'));var path=require(_0xab16('0x2'));var timeout=require(_0xab16('0x3'));var express=require('express');var router=express[_0xab16('0x4')]();var fs_extra=require(_0xab16('0x5'));var auth=require(_0xab16('0x6'));var interaction=require(_0xab16('0x7'));var config=require(_0xab16('0x8'));var controller=require(_0xab16('0x9'));router[_0xab16('0xa')]('/',auth[_0xab16('0xb')](),controller[_0xab16('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xab16('0xd')]);router[_0xab16('0xa')]('/:id',auth[_0xab16('0xb')](),controller[_0xab16('0xe')]);router[_0xab16('0xa')](_0xab16('0xf'),auth['isAuthenticated'](),controller[_0xab16('0x10')]);router['post']('/',auth[_0xab16('0xb')](),controller['create']);router['put'](_0xab16('0x11'),auth[_0xab16('0xb')](),controller[_0xab16('0x12')]);router[_0xab16('0x13')](_0xab16('0x11'),auth[_0xab16('0xb')](),controller['destroy']);module[_0xab16('0x14')]=router;
\ No newline at end of file
+var _0x2303=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create'];(function(_0x5a2892,_0x38be72){var _0x4f9902=function(_0x38a0a2){while(--_0x38a0a2){_0x5a2892['push'](_0x5a2892['shift']());}};_0x4f9902(++_0x38be72);}(_0x2303,0x7c));var _0x3230=function(_0x37c6cb,_0x2ab8f2){_0x37c6cb=_0x37c6cb-0x0;var _0x183a78=_0x2303[_0x37c6cb];return _0x183a78;};'use strict';var multer=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var path=require(_0x3230('0x2'));var timeout=require(_0x3230('0x3'));var express=require(_0x3230('0x4'));var router=express[_0x3230('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3230('0x6'));var interaction=require(_0x3230('0x7'));var config=require(_0x3230('0x8'));var controller=require(_0x3230('0x9'));router[_0x3230('0xa')]('/',auth[_0x3230('0xb')](),controller[_0x3230('0xc')]);router[_0x3230('0xa')](_0x3230('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x3230('0xa')](_0x3230('0xe'),auth[_0x3230('0xb')](),controller[_0x3230('0xf')]);router['get'](_0x3230('0x10'),auth['isAuthenticated'](),controller[_0x3230('0x11')]);router[_0x3230('0x12')]('/',auth[_0x3230('0xb')](),controller[_0x3230('0x13')]);router['put'](_0x3230('0xe'),auth[_0x3230('0xb')](),controller[_0x3230('0x14')]);router[_0x3230('0x15')](_0x3230('0xe'),auth[_0x3230('0xb')](),controller[_0x3230('0x16')]);module[_0x3230('0x17')]=router;
\ No newline at end of file
index bb9e56d..e354a51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cfd=['exports','DATE','setDataValue','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize'];(function(_0x1e267a,_0x3ab894){var _0x4f8c89=function(_0x2a1124){while(--_0x2a1124){_0x1e267a['push'](_0x1e267a['shift']());}};_0x4f8c89(++_0x3ab894);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0xd2cf('0x0'));module[_0xd2cf('0x1')]={'starttime':{'type':Sequelize[_0xd2cf('0x2')],'set':function(_0x5f1272){this[_0xd2cf('0x3')](_0xd2cf('0x4'),_0x5f1272);this['setDataValue']('endtime',moment()['format'](_0xd2cf('0x5')));}},'endtime':{'type':Sequelize[_0xd2cf('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xd2cf('0x6')]},'queue':{'type':Sequelize[_0xd2cf('0x6')]},'uniqueid':{'type':Sequelize[_0xd2cf('0x6')]},'calleridname':{'type':Sequelize[_0xd2cf('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb35d=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x360543,_0x315aac){var _0x39b131=function(_0x23e991){while(--_0x23e991){_0x360543['push'](_0x360543['shift']());}};_0x39b131(++_0x315aac);}(_0xb35d,0x14b));var _0xdb35=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xb35d[_0x409353];return _0x4f4b59;};'use strict';var moment=require(_0xdb35('0x0'));var Sequelize=require(_0xdb35('0x1'));module[_0xdb35('0x2')]={'starttime':{'type':Sequelize[_0xdb35('0x3')],'set':function(_0x526e79){this[_0xdb35('0x4')](_0xdb35('0x5'),_0x526e79);this[_0xdb35('0x4')]('endtime',moment()[_0xdb35('0x6')](_0xdb35('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xdb35('0x8')]},'projectname':{'type':Sequelize[_0xdb35('0x8')]},'queue':{'type':Sequelize[_0xdb35('0x8')]},'uniqueid':{'type':Sequelize[_0xdb35('0x8')]},'calleridname':{'type':Sequelize[_0xdb35('0x8')]},'calleridnum':{'type':Sequelize[_0xdb35('0x8')]},'completed':{'type':Sequelize[_0xdb35('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 2f4118e..5eb9ac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bc4=['merge','JscriptySessionReport','includeAll','include','catch','show','params','options','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','order','SessionId','findAll','rows','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bc4,0x14d));var _0x43bc=function(_0x3fb5a8,_0x57d3f6){_0x3fb5a8=_0x3fb5a8-0x0;var _0x519841=_0x3bc4[_0x3fb5a8];return _0x519841;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43bc('0x0'));var zipdir=require(_0x43bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43bc('0x2'));var moment=require(_0x43bc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x43bc('0x4'));var util=require(_0x43bc('0x5'));var path=require(_0x43bc('0x6'));var sox=require(_0x43bc('0x7'));var csv=require(_0x43bc('0x8'));var ejs=require(_0x43bc('0x9'));var fs=require('fs');var fs_extra=require(_0x43bc('0xa'));var _=require(_0x43bc('0xb'));var squel=require(_0x43bc('0xc'));var crypto=require(_0x43bc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x43bc('0xe'));var toCsv=require(_0x43bc('0x8'));var querystring=require(_0x43bc('0xf'));var Papa=require(_0x43bc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43bc('0x11'));var as=require(_0x43bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43bc('0x13'))(_0x43bc('0x14'));var utils=require(_0x43bc('0x15'));var config=require(_0x43bc('0x16'));var licenseUtil=require(_0x43bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f54ec,_0x56b236){_0x56b236=_0x56b236||0xcc;return function(_0x47a2c3){if(_0x47a2c3){return _0x4f54ec['sendStatus'](_0x56b236);}return _0x4f54ec[_0x43bc('0x18')](_0x56b236)[_0x43bc('0x19')]();};}function respondWithResult(_0x4899d3,_0xf87a65){_0xf87a65=_0xf87a65||0xc8;return function(_0x2dc91c){if(_0x2dc91c){return _0x4899d3[_0x43bc('0x18')](_0xf87a65)[_0x43bc('0x1a')](_0x2dc91c);}};}function respondWithFilteredResult(_0x20f4c5,_0x410060){return function(_0x45e590){if(_0x45e590){var _0x16047c=typeof _0x410060[_0x43bc('0x1b')]===_0x43bc('0x1c')&&typeof _0x410060[_0x43bc('0x1d')]===_0x43bc('0x1c');var _0x403187=_0x45e590[_0x43bc('0x1e')];var _0x5b03df=_0x16047c?0x0:_0x410060[_0x43bc('0x1b')];var _0x3043bf=_0x16047c?_0x45e590[_0x43bc('0x1e')]:_0x410060[_0x43bc('0x1b')]+_0x410060[_0x43bc('0x1d')];var _0xf753bb;if(_0x3043bf>=_0x403187){_0x3043bf=_0x403187;_0xf753bb=0xc8;}else{_0xf753bb=0xce;}_0x20f4c5[_0x43bc('0x18')](_0xf753bb);return _0x20f4c5['set']('Content-Range',_0x5b03df+'-'+_0x3043bf+'/'+_0x403187)['json'](_0x45e590);}return null;};}function patchUpdates(_0xbe011e){return function(_0x356d3a){try{jsonpatch[_0x43bc('0x1f')](_0x356d3a,_0xbe011e,!![]);}catch(_0xe8e491){return BPromise[_0x43bc('0x20')](_0xe8e491);}return _0x356d3a[_0x43bc('0x21')]();};}function saveUpdates(_0x3f52d2,_0x2d734e){return function(_0x4b5678){if(_0x4b5678){return _0x4b5678[_0x43bc('0x22')](_0x3f52d2)[_0x43bc('0x23')](function(_0x5ad479){return _0x5ad479;});}return null;};}function removeEntity(_0x41e019,_0x55c9c0){return function(_0x15e264){if(_0x15e264){return _0x15e264[_0x43bc('0x24')]()['then'](function(){_0x41e019[_0x43bc('0x18')](0xcc)[_0x43bc('0x19')]();});}};}function handleEntityNotFound(_0x4c907a,_0x4cfb16){return function(_0x575168){if(!_0x575168){_0x4c907a[_0x43bc('0x25')](0x194);}return _0x575168;};}function handleError(_0x50eb1f,_0x938966){_0x938966=_0x938966||0x1f4;return function(_0x34679a){logger['error'](_0x34679a[_0x43bc('0x26')]);if(_0x34679a[_0x43bc('0x27')]){delete _0x34679a[_0x43bc('0x27')];}_0x50eb1f['status'](_0x938966)[_0x43bc('0x28')](_0x34679a);};}exports[_0x43bc('0x29')]=function(_0x30b97b,_0x228004){var _0x11aacd={},_0x36c808={},_0x50a21e={'count':0x0,'rows':[]};var _0x19e9ae=_['map'](db['JscriptySessionReport'][_0x43bc('0x2a')],function(_0xc7eeb7){return{'name':_0xc7eeb7['fieldName'],'type':_0xc7eeb7[_0x43bc('0x2b')][_0x43bc('0x2c')]};});_0x36c808[_0x43bc('0x2d')]=_['map'](_0x19e9ae,'name');_0x36c808[_0x43bc('0x2e')]=_[_0x43bc('0x2f')](_0x30b97b[_0x43bc('0x2e')]);_0x36c808['filters']=_[_0x43bc('0x30')](_0x36c808[_0x43bc('0x2d')],_0x36c808[_0x43bc('0x2e')]);_0x11aacd[_0x43bc('0x31')]=_['intersection'](_0x36c808['model'],qs[_0x43bc('0x32')](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x11aacd['attributes']=_0x11aacd[_0x43bc('0x31')][_0x43bc('0x33')]?_0x11aacd[_0x43bc('0x31')]:_0x36c808[_0x43bc('0x2d')];if(!_0x30b97b[_0x43bc('0x2e')]['hasOwnProperty']('nolimit')){_0x11aacd[_0x43bc('0x1d')]=qs[_0x43bc('0x1d')](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x1d')]);_0x11aacd[_0x43bc('0x1b')]=qs['offset'](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x1b')]);}_0x11aacd['order']=qs['sort'](_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x34')]);_0x11aacd[_0x43bc('0x35')]=qs[_0x43bc('0x36')](_[_0x43bc('0x37')](_0x30b97b[_0x43bc('0x2e')],_0x36c808[_0x43bc('0x36')]),_0x19e9ae);if(_0x30b97b['query'][_0x43bc('0x38')]){_0x11aacd[_0x43bc('0x35')]=_[_0x43bc('0x39')](_0x11aacd[_0x43bc('0x35')],{'$or':_['map'](_0x19e9ae,function(_0x51a3b1){if(_0x51a3b1[_0x43bc('0x2b')]!=='VIRTUAL'){var _0x259304={};_0x259304[_0x51a3b1[_0x43bc('0x27')]]={'$like':'%'+_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x38')]+'%'};return _0x259304;}})});}_0x11aacd=_[_0x43bc('0x39')]({},_0x11aacd,_0x30b97b['options']);var _0x22b7c7={'where':_0x11aacd[_0x43bc('0x35')]};return db[_0x43bc('0x3a')][_0x43bc('0x1e')](_0x22b7c7)['then'](function(_0x5466e4){_0x50a21e[_0x43bc('0x1e')]=_0x5466e4;if(_0x30b97b[_0x43bc('0x2e')][_0x43bc('0x3b')]){_0x11aacd[_0x43bc('0x3c')]=[{'all':!![]}];}return db[_0x43bc('0x3a')]['findAll'](_0x11aacd);})[_0x43bc('0x23')](function(_0x216a05){_0x50a21e['rows']=_0x216a05;return _0x50a21e;})[_0x43bc('0x23')](respondWithFilteredResult(_0x228004,_0x11aacd))[_0x43bc('0x3d')](handleError(_0x228004,null));};exports[_0x43bc('0x3e')]=function(_0x28b6ec,_0x426784){var _0x51131e={'raw':!![],'where':{'id':_0x28b6ec[_0x43bc('0x3f')]['id']}},_0x409073={};_0x409073[_0x43bc('0x2d')]=_[_0x43bc('0x2f')](db[_0x43bc('0x3a')][_0x43bc('0x2a')]);_0x409073[_0x43bc('0x2e')]=_['keys'](_0x28b6ec[_0x43bc('0x2e')]);_0x409073[_0x43bc('0x36')]=_['intersection'](_0x409073[_0x43bc('0x2d')],_0x409073[_0x43bc('0x2e')]);_0x51131e[_0x43bc('0x31')]=_[_0x43bc('0x30')](_0x409073[_0x43bc('0x2d')],qs[_0x43bc('0x32')](_0x28b6ec[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x51131e['attributes']=_0x51131e[_0x43bc('0x31')]['length']?_0x51131e[_0x43bc('0x31')]:_0x409073[_0x43bc('0x2d')];if(_0x28b6ec[_0x43bc('0x2e')][_0x43bc('0x3b')]){_0x51131e[_0x43bc('0x3c')]=[{'all':!![]}];}_0x51131e=_['merge']({},_0x51131e,_0x28b6ec[_0x43bc('0x40')]);return db[_0x43bc('0x3a')][_0x43bc('0x41')](_0x51131e)['then'](handleEntityNotFound(_0x426784,null))[_0x43bc('0x23')](respondWithResult(_0x426784,null))['catch'](handleError(_0x426784,null));};exports[_0x43bc('0x42')]=function(_0x2b6d49,_0x246838){return db[_0x43bc('0x3a')]['create'](_0x2b6d49[_0x43bc('0x43')],{})[_0x43bc('0x23')](respondWithResult(_0x246838,0xc9))[_0x43bc('0x3d')](handleError(_0x246838,null));};exports[_0x43bc('0x22')]=function(_0x54c154,_0x27edc2){if(_0x54c154['body']['id']){delete _0x54c154[_0x43bc('0x43')]['id'];}return db[_0x43bc('0x3a')]['find']({'where':{'id':_0x54c154['params']['id']}})['then'](handleEntityNotFound(_0x27edc2,null))[_0x43bc('0x23')](saveUpdates(_0x54c154[_0x43bc('0x43')],null))[_0x43bc('0x23')](respondWithResult(_0x27edc2,null))[_0x43bc('0x3d')](handleError(_0x27edc2,null));};exports[_0x43bc('0x24')]=function(_0x379fc3,_0x3e47cc){return db[_0x43bc('0x3a')][_0x43bc('0x41')]({'where':{'id':_0x379fc3['params']['id']}})[_0x43bc('0x23')](handleEntityNotFound(_0x3e47cc,null))[_0x43bc('0x23')](removeEntity(_0x3e47cc,null))[_0x43bc('0x3d')](handleError(_0x3e47cc,null));};exports[_0x43bc('0x44')]=function(_0x548c97,_0x330ac1){return db[_0x43bc('0x3a')][_0x43bc('0x44')]()[_0x43bc('0x23')](respondWithResult(_0x330ac1,null))[_0x43bc('0x3d')](handleError(_0x330ac1,null));};exports[_0x43bc('0x45')]=function(_0x5a9bff,_0x5b4bbd,_0x5d1db3){var _0x5adc3b={'raw':!![],'where':{}};var _0x3e3720={};var _0x4b82ff={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x43bc('0x46')]({'where':{'id':_0x5a9bff[_0x43bc('0x3f')]['id']}})[_0x43bc('0x23')](handleEntityNotFound(_0x5b4bbd,null))[_0x43bc('0x23')](function(_0xc246cc){if(_0xc246cc){_0x3e3720['model']=_[_0x43bc('0x2f')](db[_0x43bc('0x47')][_0x43bc('0x2a')]);_0x3e3720['query']=_[_0x43bc('0x2f')](_0x5a9bff['query']);_0x3e3720[_0x43bc('0x36')]=_[_0x43bc('0x30')](_0x3e3720['model'],_0x3e3720[_0x43bc('0x2e')]);_0x5adc3b[_0x43bc('0x31')]=_['intersection'](_0x3e3720[_0x43bc('0x2d')],qs['fields'](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x32')]));_0x5adc3b['attributes']=_0x5adc3b['attributes'][_0x43bc('0x33')]?_0x5adc3b[_0x43bc('0x31')]:_0x3e3720[_0x43bc('0x2d')];if(!_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x48')](_0x43bc('0x49'))){_0x5adc3b['limit']=qs[_0x43bc('0x1d')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x1d')]);_0x5adc3b[_0x43bc('0x1b')]=qs[_0x43bc('0x1b')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x1b')]);}_0x5adc3b[_0x43bc('0x4a')]=qs[_0x43bc('0x34')](_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x34')]);_0x5adc3b['where']=qs['filters'](_[_0x43bc('0x37')](_0x5a9bff['query'],_0x3e3720[_0x43bc('0x36')]));_0x5adc3b[_0x43bc('0x35')][_0x43bc('0x4b')]=_0xc246cc['id'];if(_0x5a9bff[_0x43bc('0x2e')][_0x43bc('0x38')]){_0x5adc3b[_0x43bc('0x35')]=_[_0x43bc('0x39')](_0x5adc3b[_0x43bc('0x35')],{'$or':_['map'](_0x5adc3b[_0x43bc('0x31')],function(_0x5b4b70){var _0x1b04e8={};_0x1b04e8[_0x5b4b70]={'$like':'%'+_0x5a9bff['query'][_0x43bc('0x38')]+'%'};return _0x1b04e8;})});}_0x5adc3b=_['merge']({},_0x5adc3b,_0x5a9bff[_0x43bc('0x40')]);return db[_0x43bc('0x47')]['count']({'where':_0x5adc3b[_0x43bc('0x35')]})[_0x43bc('0x23')](function(_0x45bc71){_0x4b82ff[_0x43bc('0x1e')]=_0x45bc71;if(_0x5a9bff['query'][_0x43bc('0x3b')]){_0x5adc3b[_0x43bc('0x3c')]=[{'all':!![]}];}return db[_0x43bc('0x47')][_0x43bc('0x4c')](_0x5adc3b);})[_0x43bc('0x23')](function(_0x113698){_0x4b82ff[_0x43bc('0x4d')]=_0x113698;return _0x4b82ff;});}})[_0x43bc('0x23')](respondWithFilteredResult(_0x5b4bbd,_0x5adc3b))['catch'](handleError(_0x5b4bbd,null));};
\ No newline at end of file
+var _0xfb1a=['reject','save','update','then','destroy','stack','name','send','index','map','JscriptySessionReport','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','create','find','body','params','findOne','JscriptyQuestionReport','pick','rows','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x50d957,_0x10459e){var _0x3bf6e7=function(_0x1e9f79){while(--_0x1e9f79){_0x50d957['push'](_0x50d957['shift']());}};_0x3bf6e7(++_0x10459e);}(_0xfb1a,0x76));var _0xafb1=function(_0x1ca094,_0x23e3b8){_0x1ca094=_0x1ca094-0x0;var _0x269dcd=_0xfb1a[_0x1ca094];return _0x269dcd;};'use strict';var emlformat=require(_0xafb1('0x0'));var rimraf=require(_0xafb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xafb1('0x2'));var rp=require('request-promise');var moment=require(_0xafb1('0x3'));var BPromise=require(_0xafb1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xafb1('0x5'));var csv=require(_0xafb1('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafb1('0x7'));var _=require(_0xafb1('0x8'));var squel=require('squel');var crypto=require(_0xafb1('0x9'));var jsforce=require(_0xafb1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xafb1('0x6'));var querystring=require('querystring');var Papa=require(_0xafb1('0xb'));var Redis=require(_0xafb1('0xc'));var authService=require(_0xafb1('0xd'));var qs=require(_0xafb1('0xe'));var as=require(_0xafb1('0xf'));var hardwareService=require(_0xafb1('0x10'));var logger=require(_0xafb1('0x11'))(_0xafb1('0x12'));var utils=require('../../config/utils');var config=require(_0xafb1('0x13'));var licenseUtil=require(_0xafb1('0x14'));var db=require(_0xafb1('0x15'))['db'];function respondWithStatusCode(_0x11d9cf,_0x5a4bbb){_0x5a4bbb=_0x5a4bbb||0xcc;return function(_0x45490b){if(_0x45490b){return _0x11d9cf['sendStatus'](_0x5a4bbb);}return _0x11d9cf['status'](_0x5a4bbb)[_0xafb1('0x16')]();};}function respondWithResult(_0x20aaf2,_0x96cdc0){_0x96cdc0=_0x96cdc0||0xc8;return function(_0x3af8c4){if(_0x3af8c4){return _0x20aaf2[_0xafb1('0x17')](_0x96cdc0)[_0xafb1('0x18')](_0x3af8c4);}};}function respondWithFilteredResult(_0x1c6d76,_0x539686){return function(_0x2298dc){if(_0x2298dc){var _0x2031d7=typeof _0x539686[_0xafb1('0x19')]===_0xafb1('0x1a')&&typeof _0x539686[_0xafb1('0x1b')]===_0xafb1('0x1a');var _0x2a03cb=_0x2298dc['count'];var _0x3fca31=_0x2031d7?0x0:_0x539686[_0xafb1('0x19')];var _0x37cd20=_0x2031d7?_0x2298dc[_0xafb1('0x1c')]:_0x539686[_0xafb1('0x19')]+_0x539686[_0xafb1('0x1b')];var _0x3ac393;if(_0x37cd20>=_0x2a03cb){_0x37cd20=_0x2a03cb;_0x3ac393=0xc8;}else{_0x3ac393=0xce;}_0x1c6d76[_0xafb1('0x17')](_0x3ac393);return _0x1c6d76[_0xafb1('0x1d')](_0xafb1('0x1e'),_0x3fca31+'-'+_0x37cd20+'/'+_0x2a03cb)[_0xafb1('0x18')](_0x2298dc);}return null;};}function patchUpdates(_0x26a20c){return function(_0x5e0bc3){try{jsonpatch[_0xafb1('0x1f')](_0x5e0bc3,_0x26a20c,!![]);}catch(_0x4b7a6b){return BPromise[_0xafb1('0x20')](_0x4b7a6b);}return _0x5e0bc3[_0xafb1('0x21')]();};}function saveUpdates(_0x26ae59,_0x195adf){return function(_0x448e7f){if(_0x448e7f){return _0x448e7f[_0xafb1('0x22')](_0x26ae59)[_0xafb1('0x23')](function(_0x7ac94e){return _0x7ac94e;});}return null;};}function removeEntity(_0x11271f,_0x50d69e){return function(_0x317514){if(_0x317514){return _0x317514[_0xafb1('0x24')]()[_0xafb1('0x23')](function(){_0x11271f[_0xafb1('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cbf3,_0x1eb979){return function(_0x2dadff){if(!_0x2dadff){_0x41cbf3['sendStatus'](0x194);}return _0x2dadff;};}function handleError(_0x23a1e5,_0x3b1d3f){_0x3b1d3f=_0x3b1d3f||0x1f4;return function(_0x5ea407){logger['error'](_0x5ea407[_0xafb1('0x25')]);if(_0x5ea407[_0xafb1('0x26')]){delete _0x5ea407['name'];}_0x23a1e5['status'](_0x3b1d3f)[_0xafb1('0x27')](_0x5ea407);};}exports[_0xafb1('0x28')]=function(_0x1be001,_0x2c5b2e){var _0x47f063={},_0x144d5e={},_0x1d9215={'count':0x0,'rows':[]};var _0x4e86e5=_[_0xafb1('0x29')](db[_0xafb1('0x2a')]['rawAttributes'],function(_0x111ebc){return{'name':_0x111ebc[_0xafb1('0x2b')],'type':_0x111ebc[_0xafb1('0x2c')]['key']};});_0x144d5e[_0xafb1('0x2d')]=_[_0xafb1('0x29')](_0x4e86e5,'name');_0x144d5e[_0xafb1('0x2e')]=_[_0xafb1('0x2f')](_0x1be001['query']);_0x144d5e['filters']=_[_0xafb1('0x30')](_0x144d5e[_0xafb1('0x2d')],_0x144d5e[_0xafb1('0x2e')]);_0x47f063['attributes']=_[_0xafb1('0x30')](_0x144d5e[_0xafb1('0x2d')],qs[_0xafb1('0x31')](_0x1be001['query'][_0xafb1('0x31')]));_0x47f063[_0xafb1('0x32')]=_0x47f063[_0xafb1('0x32')][_0xafb1('0x33')]?_0x47f063[_0xafb1('0x32')]:_0x144d5e['model'];if(!_0x1be001[_0xafb1('0x2e')][_0xafb1('0x34')](_0xafb1('0x35'))){_0x47f063[_0xafb1('0x1b')]=qs[_0xafb1('0x1b')](_0x1be001[_0xafb1('0x2e')]['limit']);_0x47f063[_0xafb1('0x19')]=qs[_0xafb1('0x19')](_0x1be001[_0xafb1('0x2e')][_0xafb1('0x19')]);}_0x47f063[_0xafb1('0x36')]=qs[_0xafb1('0x37')](_0x1be001[_0xafb1('0x2e')][_0xafb1('0x37')]);_0x47f063[_0xafb1('0x38')]=qs[_0xafb1('0x39')](_['pick'](_0x1be001[_0xafb1('0x2e')],_0x144d5e[_0xafb1('0x39')]),_0x4e86e5);if(_0x1be001[_0xafb1('0x2e')][_0xafb1('0x3a')]){_0x47f063[_0xafb1('0x38')]=_[_0xafb1('0x3b')](_0x47f063[_0xafb1('0x38')],{'$or':_['map'](_0x4e86e5,function(_0x529cad){if(_0x529cad['type']!==_0xafb1('0x3c')){var _0xc76149={};_0xc76149[_0x529cad[_0xafb1('0x26')]]={'$like':'%'+_0x1be001[_0xafb1('0x2e')][_0xafb1('0x3a')]+'%'};return _0xc76149;}})});}_0x47f063=_['merge']({},_0x47f063,_0x1be001[_0xafb1('0x3d')]);var _0x3e915b={'where':_0x47f063['where']};return db[_0xafb1('0x2a')][_0xafb1('0x1c')](_0x3e915b)[_0xafb1('0x23')](function(_0xb3d048){_0x1d9215['count']=_0xb3d048;if(_0x1be001['query'][_0xafb1('0x3e')]){_0x47f063[_0xafb1('0x3f')]=[{'all':!![]}];}return db[_0xafb1('0x2a')][_0xafb1('0x40')](_0x47f063);})[_0xafb1('0x23')](function(_0x244755){_0x1d9215['rows']=_0x244755;return _0x1d9215;})[_0xafb1('0x23')](respondWithFilteredResult(_0x2c5b2e,_0x47f063))[_0xafb1('0x41')](handleError(_0x2c5b2e,null));};exports['show']=function(_0x387e5b,_0x1919ef){var _0x29abb2={'raw':!![],'where':{'id':_0x387e5b['params']['id']}},_0x24c296={};_0x24c296['model']=_[_0xafb1('0x2f')](db[_0xafb1('0x2a')][_0xafb1('0x42')]);_0x24c296[_0xafb1('0x2e')]=_[_0xafb1('0x2f')](_0x387e5b[_0xafb1('0x2e')]);_0x24c296[_0xafb1('0x39')]=_[_0xafb1('0x30')](_0x24c296['model'],_0x24c296[_0xafb1('0x2e')]);_0x29abb2[_0xafb1('0x32')]=_['intersection'](_0x24c296[_0xafb1('0x2d')],qs[_0xafb1('0x31')](_0x387e5b[_0xafb1('0x2e')][_0xafb1('0x31')]));_0x29abb2[_0xafb1('0x32')]=_0x29abb2[_0xafb1('0x32')][_0xafb1('0x33')]?_0x29abb2[_0xafb1('0x32')]:_0x24c296[_0xafb1('0x2d')];if(_0x387e5b[_0xafb1('0x2e')][_0xafb1('0x3e')]){_0x29abb2[_0xafb1('0x3f')]=[{'all':!![]}];}_0x29abb2=_['merge']({},_0x29abb2,_0x387e5b[_0xafb1('0x3d')]);return db[_0xafb1('0x2a')]['find'](_0x29abb2)[_0xafb1('0x23')](handleEntityNotFound(_0x1919ef,null))[_0xafb1('0x23')](respondWithResult(_0x1919ef,null))[_0xafb1('0x41')](handleError(_0x1919ef,null));};exports['create']=function(_0x3d61bf,_0x80d53c){return db[_0xafb1('0x2a')][_0xafb1('0x43')](_0x3d61bf['body'],{})[_0xafb1('0x23')](respondWithResult(_0x80d53c,0xc9))[_0xafb1('0x41')](handleError(_0x80d53c,null));};exports[_0xafb1('0x22')]=function(_0xe2d7fe,_0x17f095){if(_0xe2d7fe['body']['id']){delete _0xe2d7fe['body']['id'];}return db[_0xafb1('0x2a')][_0xafb1('0x44')]({'where':{'id':_0xe2d7fe['params']['id']}})[_0xafb1('0x23')](handleEntityNotFound(_0x17f095,null))[_0xafb1('0x23')](saveUpdates(_0xe2d7fe[_0xafb1('0x45')],null))['then'](respondWithResult(_0x17f095,null))[_0xafb1('0x41')](handleError(_0x17f095,null));};exports[_0xafb1('0x24')]=function(_0x5794ef,_0x4a43a0){return db[_0xafb1('0x2a')]['find']({'where':{'id':_0x5794ef[_0xafb1('0x46')]['id']}})[_0xafb1('0x23')](handleEntityNotFound(_0x4a43a0,null))[_0xafb1('0x23')](removeEntity(_0x4a43a0,null))['catch'](handleError(_0x4a43a0,null));};exports['describe']=function(_0x35e2dc,_0x4156a1){return db[_0xafb1('0x2a')]['describe']()['then'](respondWithResult(_0x4156a1,null))[_0xafb1('0x41')](handleError(_0x4156a1,null));};exports['getQuestions']=function(_0x533701,_0x292ccd,_0x5820ba){var _0x417750={'raw':!![],'where':{}};var _0x567667={};var _0x2edb47={'count':0x0,'rows':[]};return db[_0xafb1('0x2a')][_0xafb1('0x47')]({'where':{'id':_0x533701[_0xafb1('0x46')]['id']}})['then'](handleEntityNotFound(_0x292ccd,null))[_0xafb1('0x23')](function(_0xe0cbc9){if(_0xe0cbc9){_0x567667['model']=_[_0xafb1('0x2f')](db[_0xafb1('0x48')]['rawAttributes']);_0x567667['query']=_[_0xafb1('0x2f')](_0x533701[_0xafb1('0x2e')]);_0x567667['filters']=_[_0xafb1('0x30')](_0x567667[_0xafb1('0x2d')],_0x567667['query']);_0x417750[_0xafb1('0x32')]=_['intersection'](_0x567667[_0xafb1('0x2d')],qs[_0xafb1('0x31')](_0x533701[_0xafb1('0x2e')][_0xafb1('0x31')]));_0x417750[_0xafb1('0x32')]=_0x417750[_0xafb1('0x32')]['length']?_0x417750[_0xafb1('0x32')]:_0x567667[_0xafb1('0x2d')];if(!_0x533701['query'][_0xafb1('0x34')](_0xafb1('0x35'))){_0x417750['limit']=qs[_0xafb1('0x1b')](_0x533701[_0xafb1('0x2e')][_0xafb1('0x1b')]);_0x417750[_0xafb1('0x19')]=qs[_0xafb1('0x19')](_0x533701[_0xafb1('0x2e')][_0xafb1('0x19')]);}_0x417750['order']=qs[_0xafb1('0x37')](_0x533701['query'][_0xafb1('0x37')]);_0x417750['where']=qs[_0xafb1('0x39')](_[_0xafb1('0x49')](_0x533701[_0xafb1('0x2e')],_0x567667[_0xafb1('0x39')]));_0x417750[_0xafb1('0x38')]['SessionId']=_0xe0cbc9['id'];if(_0x533701[_0xafb1('0x2e')][_0xafb1('0x3a')]){_0x417750[_0xafb1('0x38')]=_['merge'](_0x417750['where'],{'$or':_[_0xafb1('0x29')](_0x417750[_0xafb1('0x32')],function(_0x46baf0){var _0xdccbd6={};_0xdccbd6[_0x46baf0]={'$like':'%'+_0x533701[_0xafb1('0x2e')][_0xafb1('0x3a')]+'%'};return _0xdccbd6;})});}_0x417750=_['merge']({},_0x417750,_0x533701[_0xafb1('0x3d')]);return db['JscriptyQuestionReport'][_0xafb1('0x1c')]({'where':_0x417750[_0xafb1('0x38')]})['then'](function(_0x9652e8){_0x2edb47['count']=_0x9652e8;if(_0x533701[_0xafb1('0x2e')][_0xafb1('0x3e')]){_0x417750[_0xafb1('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xafb1('0x40')](_0x417750);})['then'](function(_0x2c6ee6){_0x2edb47[_0xafb1('0x4a')]=_0x2c6ee6;return _0x2edb47;});}})[_0xafb1('0x23')](respondWithFilteredResult(_0x292ccd,_0x417750))['catch'](handleError(_0x292ccd,null));};
\ No newline at end of file
index b60fe58..8e6a53a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x307aa4,_0x16ae7e){var _0x32f0ea=function(_0x97a029){while(--_0x97a029){_0x307aa4['push'](_0x307aa4['shift']());}};_0x32f0ea(++_0x16ae7e);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x180967,_0x1a467d){_0x180967=_0x180967-0x0;var _0x2e9b69=_0xaa3f[_0x180967];return _0x2e9b69;};'use strict';var _=require(_0xfaa3('0x0'));var util=require(_0xfaa3('0x1'));var logger=require(_0xfaa3('0x2'))(_0xfaa3('0x3'));var moment=require(_0xfaa3('0x4'));var BPromise=require(_0xfaa3('0x5'));var rp=require(_0xfaa3('0x6'));var fs=require('fs');var path=require(_0xfaa3('0x7'));var rimraf=require(_0xfaa3('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0xfaa3('0x9')]=function(_0x4bac92,_0x3d09aa){return _0x4bac92[_0xfaa3('0xa')](_0xfaa3('0xb'),attributes,{'tableName':_0xfaa3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6ac=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2937cc,_0x3a636b){_0x2937cc=_0x2937cc-0x0;var _0x2e2762=_0xc6ac[_0x2937cc];return _0x2e2762;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ca0731..7bdf00e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x49cd59,_0x431e4f){var _0x478595=function(_0x2af4e1){while(--_0x2af4e1){_0x49cd59['push'](_0x49cd59['shift']());}};_0x478595(++_0x431e4f);}(_0xafc4,0x69));var _0x4afc=function(_0xbc086a,_0x556c9a){_0xbc086a=_0xbc086a-0x0;var _0x577e6c=_0xafc4[_0xbc086a];return _0x577e6c;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}
\ No newline at end of file
+var _0x6455=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0xae2ff2,_0x243a37){var _0x4983d6=function(_0x25c9c2){while(--_0x25c9c2){_0xae2ff2['push'](_0xae2ff2['shift']());}};_0x4983d6(++_0x243a37);}(_0x6455,0x97));var _0x5645=function(_0x380d81,_0x430fd6){_0x380d81=_0x380d81-0x0;var _0x5ed8c=_0x6455[_0x380d81];return _0x5ed8c;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});}
\ No newline at end of file
index 5ecd121..e07af7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3d0=['../../components/interaction/service','get','index','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3c372f,_0x31d36a){var _0x2fc84e=function(_0x32612d){while(--_0x32612d){_0x3c372f['push'](_0x3c372f['shift']());}};_0x2fc84e(++_0x31d36a);}(_0xf3d0,0x18e));var _0x0f3d=function(_0x248cb2,_0x52fdbb){_0x248cb2=_0x248cb2-0x0;var _0x5c7dcb=_0xf3d0[_0x248cb2];return _0x5c7dcb;};'use strict';var multer=require(_0x0f3d('0x0'));var util=require(_0x0f3d('0x1'));var path=require('path');var timeout=require(_0x0f3d('0x2'));var express=require(_0x0f3d('0x3'));var router=express[_0x0f3d('0x4')]();var fs_extra=require(_0x0f3d('0x5'));var auth=require(_0x0f3d('0x6'));var interaction=require(_0x0f3d('0x7'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x0f3d('0x8')]('/',controller[_0x0f3d('0x9')]);router[_0x0f3d('0xa')](_0x0f3d('0xb'),auth[_0x0f3d('0xc')](),controller[_0x0f3d('0xd')]);module[_0x0f3d('0xe')]=router;
\ No newline at end of file
+var _0x97ed=['index','put','isAuthenticated','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x504001,_0x309c6c){var _0x3337b8=function(_0x3bac4d){while(--_0x3bac4d){_0x504001['push'](_0x504001['shift']());}};_0x3337b8(++_0x309c6c);}(_0x97ed,0x1e7));var _0xd97e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x97ed[_0x4ff09b];return _0x3f5c2e;};'use strict';var multer=require(_0xd97e('0x0'));var util=require(_0xd97e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd97e('0x2'));var router=express[_0xd97e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd97e('0x4'));var interaction=require(_0xd97e('0x5'));var config=require(_0xd97e('0x6'));var controller=require(_0xd97e('0x7'));router['get']('/',controller[_0xd97e('0x8')]);router[_0xd97e('0x9')]('/:id',auth[_0xd97e('0xa')](),controller['update']);module['exports']=router;
\ No newline at end of file
index 9e5fd34..2ec75fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0b0=['sequelize','TEXT','STRING','INTEGER'];(function(_0xdea60c,_0x36a0a2){var _0x2643a4=function(_0x437ae9){while(--_0x437ae9){_0xdea60c['push'](_0xdea60c['shift']());}};_0x2643a4(++_0x36a0a2);}(_0xa0b0,0x174));var _0x0a0b=function(_0xe7b05e,_0x582b5d){_0xe7b05e=_0xe7b05e-0x0;var _0x2846ca=_0xa0b0[_0xe7b05e];return _0x2846ca;};'use strict';var Sequelize=require(_0x0a0b('0x0'));module['exports']={'license':{'type':Sequelize[_0x0a0b('0x1')]},'data1':{'type':Sequelize[_0x0a0b('0x2')]},'data2':{'type':Sequelize[_0x0a0b('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x0a0b('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4234=['STRING','INTEGER','sequelize'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x4234,0xa1));var _0x4423=function(_0x5aa698,_0x52e287){_0x5aa698=_0x5aa698-0x0;var _0x2a463d=_0x4234[_0x5aa698];return _0x2a463d;};'use strict';var Sequelize=require(_0x4423('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4423('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x4423('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 8299f50..b4d066a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x304a70,_0x31fbed){var _0x2c8044=function(_0x1e6486){while(--_0x1e6486){_0x304a70['push'](_0x304a70['shift']());}};_0x2c8044(++_0x31fbed);}(_0x4975,0x86));var _0x5497=function(_0x15ff6b,_0x1bab56){_0x15ff6b=_0x15ff6b-0x0;var _0x1852c8=_0x4975[_0x15ff6b];return _0x1852c8;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));};
\ No newline at end of file
+var _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4e1150,_0x2d47d2){var _0x51c478=function(_0xac4ef8){while(--_0xac4ef8){_0x4e1150['push'](_0x4e1150['shift']());}};_0x51c478(++_0x2d47d2);}(_0xabce,0x103));var _0xeabc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xabce[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));};
\ No newline at end of file
index 757a8ca..8161cf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85c7=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','License','lodash','util'];(function(_0x6f813e,_0x573957){var _0x24df11=function(_0x28c86f){while(--_0x28c86f){_0x6f813e['push'](_0x6f813e['shift']());}};_0x24df11(++_0x573957);}(_0x85c7,0x172));var _0x785c=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x85c7[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x785c('0x0'));var util=require(_0x785c('0x1'));var logger=require(_0x785c('0x2'))(_0x785c('0x3'));var moment=require(_0x785c('0x4'));var BPromise=require(_0x785c('0x5'));var rp=require(_0x785c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x785c('0x7'));var config=require(_0x785c('0x8'));var attributes=require('./license.attributes');module[_0x785c('0x9')]=function(_0x3962d5,_0x5f27dd){return _0x3962d5[_0x785c('0xa')](_0x785c('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8921=['../../config/environment','./license.attributes','exports','define','License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x2e61fb,_0x3eb1d2){var _0x5647b8=function(_0x3ee916){while(--_0x3ee916){_0x2e61fb['push'](_0x2e61fb['shift']());}};_0x5647b8(++_0x3eb1d2);}(_0x8921,0x110));var _0x1892=function(_0xee8ead,_0xefc212){_0xee8ead=_0xee8ead-0x0;var _0x1a8f21=_0x8921[_0xee8ead];return _0x1a8f21;};'use strict';var _=require(_0x1892('0x0'));var util=require(_0x1892('0x1'));var logger=require(_0x1892('0x2'))(_0x1892('0x3'));var moment=require(_0x1892('0x4'));var BPromise=require(_0x1892('0x5'));var rp=require(_0x1892('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1892('0x7'));var config=require(_0x1892('0x8'));var attributes=require(_0x1892('0x9'));module[_0x1892('0xa')]=function(_0x461817,_0x528e33){return _0x461817[_0x1892('0xb')](_0x1892('0xc'),attributes,{'tableName':_0x1892('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8ca2464..20d1c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd2e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','randomstring'];(function(_0x3c2753,_0x1455c7){var _0x30e10a=function(_0x28d1d2){while(--_0x28d1d2){_0x3c2753['push'](_0x3c2753['shift']());}};_0x30e10a(++_0x1455c7);}(_0xcd2e,0x8a));var _0xecd2=function(_0x4defd6,_0x37bbd3){_0x4defd6=_0x4defd6-0x0;var _0x4c9276=_0xcd2e[_0x4defd6];return _0x4c9276;};'use strict';var _=require('lodash');var util=require(_0xecd2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xecd2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecd2('0x2'))['db'];var utils=require(_0xecd2('0x3'));var logger=require(_0xecd2('0x4'))(_0xecd2('0x5'));var config=require(_0xecd2('0x6'));var jayson=require(_0xecd2('0x7'));var client=jayson[_0xecd2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e57af,_0x30d655,_0x1d3f98){return new BPromise(function(_0x5af2d5,_0x4712c5){return client[_0xecd2('0x9')](_0x1e57af,_0x1d3f98)[_0xecd2('0xa')](function(_0x185308){logger[_0xecd2('0xb')](_0xecd2('0xc'),_0x30d655,_0xecd2('0xd'));logger[_0xecd2('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x30d655,_0xecd2('0xd'),JSON['stringify'](_0x185308));if(_0x185308[_0xecd2('0xf')]){if(_0x185308[_0xecd2('0xf')][_0xecd2('0x10')]===0x1f4){logger[_0xecd2('0xf')](_0xecd2('0xc'),_0x30d655,_0x185308[_0xecd2('0xf')][_0xecd2('0x11')]);return _0x4712c5(_0x185308['error'][_0xecd2('0x11')]);}logger['error'](_0xecd2('0xc'),_0x30d655,_0x185308[_0xecd2('0xf')]['message']);return _0x5af2d5(_0x185308['error'][_0xecd2('0x11')]);}else{logger[_0xecd2('0xb')]('License,\x20%s,\x20%s',_0x30d655,_0xecd2('0xd'));_0x5af2d5(_0x185308[_0xecd2('0x12')][_0xecd2('0x11')]);}})[_0xecd2('0x13')](function(_0x3fa295){logger[_0xecd2('0xf')](_0xecd2('0xc'),_0x30d655,_0x3fa295);_0x4712c5(_0x3fa295);});});}
\ No newline at end of file
+var _0x21c0=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','License,\x20%s,\x20%s','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2a7fa0,_0x5b0ecc){var _0x580fc4=function(_0x483753){while(--_0x483753){_0x2a7fa0['push'](_0x2a7fa0['shift']());}};_0x580fc4(++_0x5b0ecc);}(_0x21c0,0x137));var _0x021c=function(_0x43aab7,_0x5315b5){_0x43aab7=_0x43aab7-0x0;var _0x3d9756=_0x21c0[_0x43aab7];return _0x3d9756;};'use strict';var _=require(_0x021c('0x0'));var util=require('util');var moment=require(_0x021c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x021c('0x2'));var db=require(_0x021c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x021c('0x4'))(_0x021c('0x5'));var config=require(_0x021c('0x6'));var jayson=require(_0x021c('0x7'));var client=jayson[_0x021c('0x8')][_0x021c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7969,_0x139716,_0x2de24e){return new BPromise(function(_0x5df4f7,_0x5b8cd2){return client[_0x021c('0xa')](_0x2e7969,_0x2de24e)['then'](function(_0x27a4ce){logger[_0x021c('0xb')]('License,\x20%s,\x20%s',_0x139716,_0x021c('0xc'));logger[_0x021c('0xd')](_0x021c('0xe'),_0x139716,_0x021c('0xc'),JSON[_0x021c('0xf')](_0x27a4ce));if(_0x27a4ce[_0x021c('0x10')]){if(_0x27a4ce[_0x021c('0x10')]['code']===0x1f4){logger[_0x021c('0x10')]('License,\x20%s,\x20%s',_0x139716,_0x27a4ce['error']['message']);return _0x5b8cd2(_0x27a4ce[_0x021c('0x10')][_0x021c('0x11')]);}logger[_0x021c('0x10')]('License,\x20%s,\x20%s',_0x139716,_0x27a4ce[_0x021c('0x10')][_0x021c('0x11')]);return _0x5df4f7(_0x27a4ce['error'][_0x021c('0x11')]);}else{logger['info'](_0x021c('0x12'),_0x139716,'request\x20sent');_0x5df4f7(_0x27a4ce['result']['message']);}})['catch'](function(_0x4f48ac){logger[_0x021c('0x10')](_0x021c('0x12'),_0x139716,_0x4f48ac);_0x5b8cd2(_0x4f48ac);});});}
\ No newline at end of file
index fa10e76..cb8bd40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59cf=['multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','/:id/dispositions','addDisposition','create','addImap','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','put','update','delete','removeDispositions','removeImap','removeSmtp','/:id/users','removeAgents','exports'];(function(_0x389b92,_0x5badc1){var _0x2e355c=function(_0x51bbbf){while(--_0x51bbbf){_0x389b92['push'](_0x389b92['shift']());}};_0x2e355c(++_0x5badc1);}(_0x59cf,0x157));var _0xf59c=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x59cf[_0x2ac4af];return _0x3a36df;};'use strict';var multer=require(_0xf59c('0x0'));var util=require(_0xf59c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf59c('0x2'));var router=express[_0xf59c('0x3')]();var fs_extra=require(_0xf59c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf59c('0x5'));var config=require(_0xf59c('0x6'));var controller=require(_0xf59c('0x7'));router[_0xf59c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf59c('0x9')]);router[_0xf59c('0x8')](_0xf59c('0xa'),auth[_0xf59c('0xb')](),controller[_0xf59c('0xc')]);router[_0xf59c('0x8')](_0xf59c('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xf59c('0x8')]('/:id/dispositions',auth[_0xf59c('0xb')](),controller[_0xf59c('0xe')]);router['get'](_0xf59c('0xf'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x10')]);router[_0xf59c('0x8')](_0xf59c('0x11'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x12')]);router[_0xf59c('0x8')](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x14')]);router['get'](_0xf59c('0x15'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x16')]);router[_0xf59c('0x8')]('/:id/applications',auth[_0xf59c('0xb')](),controller[_0xf59c('0x17')]);router[_0xf59c('0x8')](_0xf59c('0x18'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x19')]);router['get'](_0xf59c('0x1a'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x1b')]);router[_0xf59c('0x8')]('/:id/users',auth[_0xf59c('0xb')](),controller[_0xf59c('0x1c')]);router[_0xf59c('0x1d')](_0xf59c('0x1e'),auth['isAuthenticated'](),controller[_0xf59c('0x1f')]);router[_0xf59c('0x1d')](_0xf59c('0xf'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0xf59c('0xb')](),controller[_0xf59c('0x20')]);router['post'](_0xf59c('0x11'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x21')]);router['post'](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x22')]);router['post'](_0xf59c('0x15'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x23')]);router[_0xf59c('0x1d')](_0xf59c('0x24'),auth['isAuthenticated'](),controller[_0xf59c('0x25')]);router['post'](_0xf59c('0x26'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x27')]);router[_0xf59c('0x1d')]('/:id/users',auth[_0xf59c('0xb')](),controller['addAgents']);router[_0xf59c('0x28')](_0xf59c('0xd'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x29')]);router[_0xf59c('0x2a')](_0xf59c('0x1e'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2b')]);router[_0xf59c('0x2a')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0xf59c('0x2a')](_0xf59c('0x11'),auth['isAuthenticated'](),controller[_0xf59c('0x2c')]);router[_0xf59c('0x2a')](_0xf59c('0x13'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2d')]);router['delete'](_0xf59c('0xd'),auth[_0xf59c('0xb')](),controller['destroy']);router['delete'](_0xf59c('0x2e'),auth[_0xf59c('0xb')](),controller[_0xf59c('0x2f')]);module[_0xf59c('0x30')]=router;
\ No newline at end of file
+var _0xd6f6=['/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','addDisposition','post','addAnswer','create','/:id/in_servers','addSmtp','addInteraction','addApplications','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeImap','/:id','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index'];(function(_0x361d72,_0x3baf46){var _0x1741b7=function(_0x5dd9ee){while(--_0x5dd9ee){_0x361d72['push'](_0x361d72['shift']());}};_0x1741b7(++_0x3baf46);}(_0xd6f6,0xb8));var _0x6d6f=function(_0x1a62d4,_0x3517af){_0x1a62d4=_0x1a62d4-0x0;var _0x5ee8b1=_0xd6f6[_0x1a62d4];return _0x5ee8b1;};'use strict';var multer=require(_0x6d6f('0x0'));var util=require(_0x6d6f('0x1'));var path=require(_0x6d6f('0x2'));var timeout=require(_0x6d6f('0x3'));var express=require(_0x6d6f('0x4'));var router=express[_0x6d6f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d6f('0x6'));var config=require(_0x6d6f('0x7'));var controller=require(_0x6d6f('0x8'));router[_0x6d6f('0x9')]('/',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0xb')]);router['get'](_0x6d6f('0xc'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0xd')]);router[_0x6d6f('0x9')]('/:id',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0xe')]);router[_0x6d6f('0x9')](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x10')]);router[_0x6d6f('0x9')](_0x6d6f('0x11'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x12')]);router[_0x6d6f('0x9')]('/:id/in_servers',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x13')]);router[_0x6d6f('0x9')](_0x6d6f('0x14'),auth['isAuthenticated'](),controller[_0x6d6f('0x15')]);router[_0x6d6f('0x9')](_0x6d6f('0x16'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x17')]);router[_0x6d6f('0x9')](_0x6d6f('0x18'),auth['isAuthenticated'](),controller[_0x6d6f('0x19')]);router['get'](_0x6d6f('0x1a'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x1b')]);router[_0x6d6f('0x9')](_0x6d6f('0x1c'),auth['isAuthenticated'](),controller['verifySmtp']);router[_0x6d6f('0x9')](_0x6d6f('0x1d'),auth['isAuthenticated'](),controller[_0x6d6f('0x1e')]);router['post'](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x1f')]);router[_0x6d6f('0x20')](_0x6d6f('0x11'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x21')]);router['post']('/',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x22')]);router[_0x6d6f('0x20')](_0x6d6f('0x23'),auth[_0x6d6f('0xa')](),controller['addImap']);router[_0x6d6f('0x20')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6d6f('0x24')]);router['post']('/:id/interactions',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x25')]);router[_0x6d6f('0x20')](_0x6d6f('0x18'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x26')]);router['post'](_0x6d6f('0x27'),auth['isAuthenticated'](),controller[_0x6d6f('0x28')]);router[_0x6d6f('0x20')]('/:id/users',auth[_0x6d6f('0xa')](),controller['addAgents']);router[_0x6d6f('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x6d6f('0x2a')]);router[_0x6d6f('0x2b')](_0x6d6f('0xf'),auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x2c')]);router[_0x6d6f('0x2b')]('/:id/canned_answers',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x2d')]);router[_0x6d6f('0x2b')]('/:id/in_servers',auth[_0x6d6f('0xa')](),controller[_0x6d6f('0x2e')]);router[_0x6d6f('0x2b')](_0x6d6f('0x14'),auth[_0x6d6f('0xa')](),controller['removeSmtp']);router[_0x6d6f('0x2b')](_0x6d6f('0x2f'),auth[_0x6d6f('0xa')](),controller['destroy']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x6d6f('0x30')]);module['exports']=router;
\ No newline at end of file
index 75f2240..fbbe975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b1f=['BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0x5e6515,_0x2954b1){var _0xd33ce2=function(_0x5ce7ea){while(--_0x5ce7ea){_0x5e6515['push'](_0x5e6515['shift']());}};_0xd33ce2(++_0x2954b1);}(_0x4b1f,0x195));var _0xf4b1=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x4b1f[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0xf4b1('0x0'));module[_0xf4b1('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xf4b1('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf4b1('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xf4b1('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf4b1('0x4')]},'markAsUnread':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xf4b1('0x5')](0x2)[_0xf4b1('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf4b1('0x4')],'defaultValue':function(){return _0xf4b1('0x7');}},'notificationSound':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf4b1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf4b1('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf4b1('0x3')],'defaultValue':![],'comment':_0xf4b1('0x8'),'set':function(_0x10a08c){if(!_0x10a08c)this[_0xf4b1('0x9')](_0xf4b1('0xa'),null);this[_0xf4b1('0x9')](_0xf4b1('0xb'),_0x10a08c);}}};
\ No newline at end of file
+var _0xe644=['INTEGER','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x4e4061,_0x26503b){var _0x371dbd=function(_0x31a31f){while(--_0x31a31f){_0x4e4061['push'](_0x4e4061['shift']());}};_0x371dbd(++_0x26503b);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e64('0x0'));module[_0x4e64('0x1')]={'description':{'type':Sequelize[_0x4e64('0x2')]},'name':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x4e64('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4e64('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x4e64('0x4')]},'markAsUnread':{'type':Sequelize[_0x4e64('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4e64('0x2')],'allowNull':![],'defaultValue':_0x4e64('0x5')},'fontSize':{'type':Sequelize[_0x4e64('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4e64('0x4')],'defaultValue':function(){return _0x4e64('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4e64('0x6')],'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[_0x4e64('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4e64('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4e64('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x4e64('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4e64('0x3')],'defaultValue':![],'comment':_0x4e64('0x9'),'set':function(_0x4ae2b3){if(!_0x4ae2b3)this[_0x4e64('0xa')](_0x4e64('0xb'),null);this['setDataValue'](_0x4e64('0xc'),_0x4ae2b3);}}};
\ No newline at end of file
index 8b2a5c6..82a245a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00da=['removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','inlineCss','CmList','List','updatedAt','DESC','from','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','CmContact','defaults','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','emit','userMailAccount:remove','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','fs-extra','squel','jsforce','to-csv','papaparse','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','MailAccount','findAll','rows','catch','show','params','MailServerOut','Smtp','length','merge','find','body','Imap','describe','addDisposition','MailAccountId','Disposition','create','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers'];(function(_0x21c6b8,_0x16d6f6){var _0x39d474=function(_0x27dbf5){while(--_0x27dbf5){_0x21c6b8['push'](_0x21c6b8['shift']());}};_0x39d474(++_0x16d6f6);}(_0x00da,0x1cf));var _0xa00d=function(_0x48a3c2,_0x208531){_0x48a3c2=_0x48a3c2-0x0;var _0x28e359=_0x00da[_0x48a3c2];return _0x28e359;};'use strict';var emlformat=require(_0xa00d('0x0'));var rimraf=require(_0xa00d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa00d('0x2'));var rp=require(_0xa00d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa00d('0x4'));var util=require('util');var path=require(_0xa00d('0x5'));var sox=require(_0xa00d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa00d('0x7'));var _=require('lodash');var squel=require(_0xa00d('0x8'));var crypto=require('crypto');var jsforce=require(_0xa00d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa00d('0xa'));var querystring=require('querystring');var Papa=require(_0xa00d('0xb'));var htmlToText=require('html-to-text');var juice=require(_0xa00d('0xc'));var Redis=require(_0xa00d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xa00d('0xe'));var as=require(_0xa00d('0xf'));var hardwareService=require(_0xa00d('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xa00d('0x11'));var config=require(_0xa00d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa00d('0x13'))['db'];config[_0xa00d('0x14')]=_['defaults'](config[_0xa00d('0x14')],{'host':_0xa00d('0x15'),'port':0x18eb});var socket=require(_0xa00d('0x16'))(new Redis(config['redis']));require(_0xa00d('0x17'))[_0xa00d('0x18')](socket);var jayson=require(_0xa00d('0x19'));var client=jayson[_0xa00d('0x1a')][_0xa00d('0x1b')]({'port':0x232b});function respondWithRpcPromise(_0x5c083a,_0xd9a8a9,_0x2fa44d,_0x3b14e7){return new BPromise(function(_0x1c24d7,_0x5ec176){var _0x543198=_0x3b14e7||client;return _0x543198[_0xa00d('0x1c')](_0x5c083a,_0x2fa44d)['then'](function(_0x157588){logger[_0xa00d('0x1d')](_0xa00d('0x1e'),_0xd9a8a9,_0xa00d('0x1f'));logger['debug'](_0xa00d('0x20'),_0xd9a8a9,'request\x20sent',JSON['stringify'](_0x157588));if(_0x157588[_0xa00d('0x21')]){if(_0x157588[_0xa00d('0x21')][_0xa00d('0x22')]===0x1f4){logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x157588[_0xa00d('0x21')]['message']);return _0x5ec176(_0x157588[_0xa00d('0x21')][_0xa00d('0x23')]);}logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x157588[_0xa00d('0x21')][_0xa00d('0x23')]);return _0x1c24d7(_0x157588['error'][_0xa00d('0x23')]);}else{logger[_0xa00d('0x1d')](_0xa00d('0x1e'),_0xd9a8a9,'request\x20sent');_0x1c24d7(_0x157588[_0xa00d('0x24')][_0xa00d('0x23')]);}})['catch'](function(_0x4c6147){logger[_0xa00d('0x21')](_0xa00d('0x1e'),_0xd9a8a9,_0x4c6147);_0x5ec176(_0x4c6147);});});}function respondWithStatusCode(_0x53db02,_0xc4857d){_0xc4857d=_0xc4857d||0xcc;return function(_0x38206a){if(_0x38206a){return _0x53db02[_0xa00d('0x25')](_0xc4857d);}return _0x53db02['status'](_0xc4857d)[_0xa00d('0x26')]();};}function respondWithResult(_0x392631,_0x435597){_0x435597=_0x435597||0xc8;return function(_0x42b24b){if(_0x42b24b){return _0x392631[_0xa00d('0x27')](_0x435597)['json'](_0x42b24b);}};}function respondWithFilteredResult(_0x21ca1f,_0x309686){return function(_0x2a2138){if(_0x2a2138){var _0x1e93d2=typeof _0x309686[_0xa00d('0x28')]===_0xa00d('0x29')&&typeof _0x309686[_0xa00d('0x2a')]==='undefined';var _0x324426=_0x2a2138[_0xa00d('0x2b')];var _0x8bda2b=_0x1e93d2?0x0:_0x309686[_0xa00d('0x28')];var _0x5e09dc=_0x1e93d2?_0x2a2138['count']:_0x309686[_0xa00d('0x28')]+_0x309686[_0xa00d('0x2a')];var _0x53cc26;if(_0x5e09dc>=_0x324426){_0x5e09dc=_0x324426;_0x53cc26=0xc8;}else{_0x53cc26=0xce;}_0x21ca1f[_0xa00d('0x27')](_0x53cc26);return _0x21ca1f['set'](_0xa00d('0x2c'),_0x8bda2b+'-'+_0x5e09dc+'/'+_0x324426)[_0xa00d('0x2d')](_0x2a2138);}return null;};}function patchUpdates(_0x4a66b0){return function(_0x1e0a64){try{jsonpatch[_0xa00d('0x2e')](_0x1e0a64,_0x4a66b0,!![]);}catch(_0x237282){return BPromise['reject'](_0x237282);}return _0x1e0a64[_0xa00d('0x2f')]();};}function saveUpdates(_0x412747,_0x2a6a4b){return function(_0x390659){if(_0x390659){return _0x390659[_0xa00d('0x30')](_0x412747)[_0xa00d('0x31')](function(_0x5fbd4e){return _0x5fbd4e;});}return null;};}function removeEntity(_0x2d3948,_0x4ce8bb){return function(_0x4901f3){if(_0x4901f3){return _0x4901f3[_0xa00d('0x32')]()[_0xa00d('0x31')](function(){var _0x64557d=_0x4901f3[_0xa00d('0x33')]({'plain':!![]});var _0x1bfa29=_0xa00d('0x34');return db[_0xa00d('0x35')][_0xa00d('0x32')]({'where':{'type':_0x1bfa29,'resourceId':_0x64557d['id']}})[_0xa00d('0x31')](function(){return _0x4901f3;});})[_0xa00d('0x31')](function(){_0x2d3948[_0xa00d('0x27')](0xcc)[_0xa00d('0x26')]();});}};}function handleEntityNotFound(_0x327743,_0x474e74){return function(_0x13ad82){if(!_0x13ad82){_0x327743[_0xa00d('0x25')](0x194);}return _0x13ad82;};}function handleError(_0xe5725e,_0x154311){_0x154311=_0x154311||0x1f4;return function(_0x5425f7){logger['error'](_0x5425f7[_0xa00d('0x36')]);if(_0x5425f7[_0xa00d('0x37')]){delete _0x5425f7[_0xa00d('0x37')];}_0xe5725e[_0xa00d('0x27')](_0x154311)[_0xa00d('0x38')](_0x5425f7);};}exports[_0xa00d('0x39')]=function(_0x536877,_0x24929f){var _0x359fe2={'include':[{'model':db[_0xa00d('0x3a')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xa00d('0x3b')],'as':_0xa00d('0x3c')}]},_0x36e7dc={},_0x336ea3={'count':0x0,'rows':[]};var _0x1ca056=_[_0xa00d('0x3d')](db['MailAccount'][_0xa00d('0x3e')],function(_0x29ba4a){return{'name':_0x29ba4a[_0xa00d('0x3f')],'type':_0x29ba4a[_0xa00d('0x40')][_0xa00d('0x41')]};});_0x36e7dc[_0xa00d('0x42')]=_[_0xa00d('0x3d')](_0x1ca056,_0xa00d('0x37'));_0x36e7dc[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x536877[_0xa00d('0x43')]);_0x36e7dc[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x36e7dc[_0xa00d('0x42')],_0x36e7dc['query']);_0x359fe2[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x36e7dc['model'],qs[_0xa00d('0x48')](_0x536877[_0xa00d('0x43')][_0xa00d('0x48')]));_0x359fe2[_0xa00d('0x47')]=_0x359fe2['attributes']['length']?_0x359fe2[_0xa00d('0x47')]:_0x36e7dc[_0xa00d('0x42')];if(!_0x536877[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x359fe2[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x536877['query']['limit']);_0x359fe2[_0xa00d('0x28')]=qs['offset'](_0x536877['query'][_0xa00d('0x28')]);}_0x359fe2['order']=qs[_0xa00d('0x4b')](_0x536877[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x359fe2[_0xa00d('0x4c')]=qs['filters'](_['pick'](_0x536877[_0xa00d('0x43')],_0x36e7dc[_0xa00d('0x45')]),_0x1ca056);if(_0x536877['query'][_0xa00d('0x4d')]){_0x359fe2[_0xa00d('0x4c')]=_['merge'](_0x359fe2['where'],{'$or':_[_0xa00d('0x3d')](_0x1ca056,function(_0x1c7013){if(_0x1c7013['type']!=='VIRTUAL'){var _0x1ab56e={};_0x1ab56e[_0x1c7013['name']]={'$like':'%'+_0x536877[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x1ab56e;}})});}_0x359fe2=_['merge']({},_0x359fe2,_0x536877[_0xa00d('0x4e')]);var _0x390caf={'where':_0x359fe2['where']};return db['MailAccount']['count'](_0x390caf)[_0xa00d('0x31')](function(_0x33a9fa){_0x336ea3[_0xa00d('0x2b')]=_0x33a9fa;if(_0x536877[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x359fe2[_0xa00d('0x50')]=[{'all':!![]}];}return db[_0xa00d('0x51')][_0xa00d('0x52')](_0x359fe2);})[_0xa00d('0x31')](function(_0x2fe804){_0x336ea3[_0xa00d('0x53')]=_0x2fe804;return _0x336ea3;})['then'](respondWithFilteredResult(_0x24929f,_0x359fe2))[_0xa00d('0x54')](handleError(_0x24929f,null));};exports[_0xa00d('0x55')]=function(_0x2ebc9f,_0x2bc0a5){var _0x3a08d8={'raw':![],'where':{'id':_0x2ebc9f[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x3a')],'as':'Imap'},{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58')},{'model':db[_0xa00d('0x3b')],'as':_0xa00d('0x3c')}]},_0x4b1b62={};_0x4b1b62[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x51')][_0xa00d('0x3e')]);_0x4b1b62[_0xa00d('0x43')]=_['keys'](_0x2ebc9f[_0xa00d('0x43')]);_0x4b1b62[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x4b1b62['model'],_0x4b1b62[_0xa00d('0x43')]);_0x3a08d8[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x4b1b62[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x2ebc9f[_0xa00d('0x43')][_0xa00d('0x48')]));_0x3a08d8['attributes']=_0x3a08d8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x3a08d8[_0xa00d('0x47')]:_0x4b1b62[_0xa00d('0x42')];if(_0x2ebc9f[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x3a08d8[_0xa00d('0x50')]=[{'all':!![]}];}_0x3a08d8=_[_0xa00d('0x5a')]({},_0x3a08d8,_0x2ebc9f[_0xa00d('0x4e')]);return db[_0xa00d('0x51')][_0xa00d('0x5b')](_0x3a08d8)[_0xa00d('0x31')](handleEntityNotFound(_0x2bc0a5,null))[_0xa00d('0x31')](respondWithResult(_0x2bc0a5,null))[_0xa00d('0x54')](handleError(_0x2bc0a5,null));};exports[_0xa00d('0x30')]=function(_0x5991cf,_0xb9fce0){if(_0x5991cf[_0xa00d('0x5c')]['id']){delete _0x5991cf[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')]['find']({'where':{'id':_0x5991cf[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x3a')],'as':_0xa00d('0x5d')},{'model':db[_0xa00d('0x57')],'as':'Smtp'},{'model':db['Pause'],'as':_0xa00d('0x3c')}]})[_0xa00d('0x31')](handleEntityNotFound(_0xb9fce0,null))[_0xa00d('0x31')](saveUpdates(_0x5991cf[_0xa00d('0x5c')],null))['then'](function(_0x5e596e){if(_0x5e596e&&_0x5991cf['body'][_0xa00d('0x5d')]){return db['MailServerIn'][_0xa00d('0x30')](_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x5d')],{'where':{'MailAccountId':_0x5e596e['id']}})[_0xa00d('0x31')](function(){return _0x5e596e;});}return _0x5e596e;})['then'](function(_0x2b90c7){if(_0x2b90c7&&_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x58')]){return db[_0xa00d('0x57')][_0xa00d('0x30')](_0x5991cf[_0xa00d('0x5c')][_0xa00d('0x58')],{'where':{'MailAccountId':_0x2b90c7['id']}})[_0xa00d('0x31')](function(){return _0x2b90c7;});}return _0x2b90c7;})[_0xa00d('0x31')](respondWithResult(_0xb9fce0,null))[_0xa00d('0x54')](handleError(_0xb9fce0,null));};exports[_0xa00d('0x5e')]=function(_0x4a3fd2,_0x3de5c5){return db[_0xa00d('0x51')][_0xa00d('0x5e')]()[_0xa00d('0x31')](respondWithResult(_0x3de5c5,null))[_0xa00d('0x54')](handleError(_0x3de5c5,null));};exports[_0xa00d('0x5f')]=function(_0x2cf218,_0x2b868e,_0x9a61a7){if(_0x2cf218[_0xa00d('0x5c')]['id']){delete _0x2cf218[_0xa00d('0x5c')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x2cf218[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x2b868e,null))['then'](function(_0x2e35f3){if(_0x2e35f3){_0x2cf218[_0xa00d('0x5c')][_0xa00d('0x60')]=_0x2e35f3['id'];return db[_0xa00d('0x61')][_0xa00d('0x62')](_0x2cf218[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x2b868e,null))[_0xa00d('0x54')](handleError(_0x2b868e,null));};exports['getDispositions']=function(_0x108941,_0x2c3d1a,_0x524fd3){var _0x134fc8={'raw':![],'where':{}};var _0xf281e3={};var _0x31ad83={'count':0x0,'rows':[]};return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x108941[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x2c3d1a,null))[_0xa00d('0x31')](function(_0x38e122){if(_0x38e122){_0xf281e3[_0xa00d('0x42')]=_[_0xa00d('0x44')](db['Disposition'][_0xa00d('0x3e')]);_0xf281e3[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x108941[_0xa00d('0x43')]);_0xf281e3['filters']=_['intersection'](_0xf281e3[_0xa00d('0x42')],_0xf281e3[_0xa00d('0x43')]);_0x134fc8[_0xa00d('0x47')]=_['intersection'](_0xf281e3[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x108941[_0xa00d('0x43')][_0xa00d('0x48')]));_0x134fc8[_0xa00d('0x47')]=_0x134fc8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x134fc8[_0xa00d('0x47')]:_0xf281e3[_0xa00d('0x42')];if(!_0x108941[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x134fc8[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x108941[_0xa00d('0x43')][_0xa00d('0x2a')]);_0x134fc8['offset']=qs[_0xa00d('0x28')](_0x108941['query'][_0xa00d('0x28')]);}_0x134fc8[_0xa00d('0x64')]=qs['sort'](_0x108941['query']['sort']);_0x134fc8[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x108941['query'],_0xf281e3[_0xa00d('0x45')]));_0x134fc8[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x38e122['id'];if(_0x108941[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x134fc8['where']=_['merge'](_0x134fc8[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x134fc8['attributes'],function(_0x2066ca){var _0x17f1aa={};_0x17f1aa[_0x2066ca]={'$like':'%'+_0x108941[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x17f1aa;})});}_0x134fc8=_[_0xa00d('0x5a')]({},_0x134fc8,_0x108941[_0xa00d('0x4e')]);return db['Disposition'][_0xa00d('0x2b')]({'where':_0x134fc8[_0xa00d('0x4c')]})[_0xa00d('0x31')](function(_0xcffcea){_0x31ad83['count']=_0xcffcea;if(_0x108941[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x134fc8['include']=[{'all':!![]}];}return db[_0xa00d('0x61')][_0xa00d('0x52')](_0x134fc8);})[_0xa00d('0x31')](function(_0x5ab7da){_0x31ad83[_0xa00d('0x53')]=_0x5ab7da;return _0x31ad83;});}})[_0xa00d('0x31')](respondWithFilteredResult(_0x2c3d1a,_0x134fc8))['catch'](handleError(_0x2c3d1a,null));};exports[_0xa00d('0x66')]=function(_0x547481,_0x1e737a,_0x234517){return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x547481[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x1e737a,null))[_0xa00d('0x31')](function(_0x56d4a8){if(_0x56d4a8){return _0x56d4a8[_0xa00d('0x66')](_0x547481[_0xa00d('0x43')][_0xa00d('0x67')]);}})[_0xa00d('0x31')](respondWithStatusCode(_0x1e737a,null))[_0xa00d('0x54')](handleError(_0x1e737a,null));};exports[_0xa00d('0x68')]=function(_0x3e6e68,_0x279bf7,_0x344c81){if(_0x3e6e68['body']['id']){delete _0x3e6e68['body']['id'];}return db['MailAccount'][_0xa00d('0x5b')]({'where':{'id':_0x3e6e68['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x279bf7,null))[_0xa00d('0x31')](function(_0xc8415){if(_0xc8415){_0x3e6e68['body'][_0xa00d('0x60')]=_0xc8415['id'];return db[_0xa00d('0x69')]['create'](_0x3e6e68[_0xa00d('0x5c')]);}})['then'](respondWithResult(_0x279bf7,null))[_0xa00d('0x54')](handleError(_0x279bf7,null));};exports[_0xa00d('0x6a')]=function(_0x532203,_0x1cb1c1,_0xbf7447){var _0x1b0ee0={'raw':![],'where':{}};var _0x28c2ef={};var _0xafd4e4={'count':0x0,'rows':[]};return db['MailAccount'][_0xa00d('0x63')]({'where':{'id':_0x532203[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x1cb1c1,null))[_0xa00d('0x31')](function(_0x2bb10e){if(_0x2bb10e){_0x28c2ef[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x69')][_0xa00d('0x3e')]);_0x28c2ef[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x532203[_0xa00d('0x43')]);_0x28c2ef['filters']=_[_0xa00d('0x46')](_0x28c2ef['model'],_0x28c2ef[_0xa00d('0x43')]);_0x1b0ee0['attributes']=_[_0xa00d('0x46')](_0x28c2ef['model'],qs[_0xa00d('0x48')](_0x532203[_0xa00d('0x43')][_0xa00d('0x48')]));_0x1b0ee0[_0xa00d('0x47')]=_0x1b0ee0['attributes'][_0xa00d('0x59')]?_0x1b0ee0[_0xa00d('0x47')]:_0x28c2ef[_0xa00d('0x42')];if(!_0x532203['query'][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x1b0ee0[_0xa00d('0x2a')]=qs['limit'](_0x532203[_0xa00d('0x43')][_0xa00d('0x2a')]);_0x1b0ee0[_0xa00d('0x28')]=qs[_0xa00d('0x28')](_0x532203[_0xa00d('0x43')][_0xa00d('0x28')]);}_0x1b0ee0['order']=qs[_0xa00d('0x4b')](_0x532203[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x1b0ee0[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x532203[_0xa00d('0x43')],_0x28c2ef[_0xa00d('0x45')]));_0x1b0ee0[_0xa00d('0x4c')]['MailAccountId']=_0x2bb10e['id'];if(_0x532203['query'][_0xa00d('0x4d')]){_0x1b0ee0[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x1b0ee0['where'],{'$or':_['map'](_0x1b0ee0[_0xa00d('0x47')],function(_0x157c0e){var _0x2bc35c={};_0x2bc35c[_0x157c0e]={'$like':'%'+_0x532203['query'][_0xa00d('0x4d')]+'%'};return _0x2bc35c;})});}_0x1b0ee0=_['merge']({},_0x1b0ee0,_0x532203['options']);return db[_0xa00d('0x69')][_0xa00d('0x2b')]({'where':_0x1b0ee0['where']})[_0xa00d('0x31')](function(_0x10548d){_0xafd4e4[_0xa00d('0x2b')]=_0x10548d;if(_0x532203[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x1b0ee0[_0xa00d('0x50')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1b0ee0);})[_0xa00d('0x31')](function(_0x3232dc){_0xafd4e4[_0xa00d('0x53')]=_0x3232dc;return _0xafd4e4;});}})['then'](respondWithFilteredResult(_0x1cb1c1,_0x1b0ee0))[_0xa00d('0x54')](handleError(_0x1cb1c1,null));};exports[_0xa00d('0x6b')]=function(_0x308ed7,_0x3d619e,_0x41ecfc){return db['MailAccount']['find']({'where':{'id':_0x308ed7[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d619e,null))[_0xa00d('0x31')](function(_0x3028bd){if(_0x3028bd){return _0x3028bd[_0xa00d('0x6b')](_0x308ed7[_0xa00d('0x43')][_0xa00d('0x67')]);}})[_0xa00d('0x31')](respondWithStatusCode(_0x3d619e,null))['catch'](handleError(_0x3d619e,null));};exports[_0xa00d('0x62')]=function(_0x23b255,_0x4fe6d8){var _0x2d1a7b={'name':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x37')],'key':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x41')],'email':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6c')],'ListId':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6d')],'active':!_[_0xa00d('0x6e')](_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6f')])?_0x23b255[_0xa00d('0x5c')][_0xa00d('0x6f')]:!![],'description':_0x23b255[_0xa00d('0x5c')][_0xa00d('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xa00d('0x6e')](_0x23b255[_0xa00d('0x5c')][_0xa00d('0x71')])){if(_0x23b255['body'][_0xa00d('0x72')]){_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x73')]=_0x2d1a7b[_0xa00d('0x58')]['user']=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x74')];_0x2d1a7b['Imap'][_0xa00d('0x75')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x76')]=_0x23b255[_0xa00d('0x5c')]['cpassword'];}else{_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x77')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x77')]=![];}_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x78')]=_0x23b255[_0xa00d('0x5c')]['Imap'][_0xa00d('0x78')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x79')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x5d')][_0xa00d('0x79')];_0x2d1a7b['Smtp']['host']=_0x23b255['body'][_0xa00d('0x58')][_0xa00d('0x78')];_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x79')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x58')][_0xa00d('0x79')];}else{_0x2d1a7b[_0xa00d('0x5d')]['service']=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x7a')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x71')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x73')]=_0x2d1a7b['Smtp'][_0xa00d('0x73')]=_0x23b255[_0xa00d('0x5c')][_0xa00d('0x74')];_0x2d1a7b[_0xa00d('0x5d')][_0xa00d('0x75')]=_0x2d1a7b[_0xa00d('0x58')][_0xa00d('0x76')]=_0x23b255[_0xa00d('0x5c')]['cpassword'];}return db[_0xa00d('0x51')]['create'](_0x2d1a7b,{'include':[{'model':db['MailServerOut'],'as':_0xa00d('0x58')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xa00d('0x31')](function(_0x2f6cd4){var _0x4dd7f3=_0x23b255[_0xa00d('0x73')]['get']({'plain':!![]});if(!_0x4dd7f3)throw new Error(_0xa00d('0x7b'));if(_0x4dd7f3[_0xa00d('0x7c')]==='user'){var _0x3e1d94=_0x2f6cd4[_0xa00d('0x33')]({'plain':!![]});return db[_0xa00d('0x7d')][_0xa00d('0x5b')]({'where':{'name':_0xa00d('0x34'),'userProfileId':_0x4dd7f3[_0xa00d('0x7e')]},'raw':!![]})[_0xa00d('0x31')](function(_0x465d80){if(_0x465d80&&_0x465d80[_0xa00d('0x7f')]===0x0){return db[_0xa00d('0x35')][_0xa00d('0x62')]({'name':_0x3e1d94[_0xa00d('0x37')],'resourceId':_0x3e1d94['id'],'type':_0x465d80['name'],'sectionId':_0x465d80['id']},{})[_0xa00d('0x31')](function(){return _0x2f6cd4;});}else{return _0x2f6cd4;}})[_0xa00d('0x54')](function(_0x23acfa){logger['error'](_0xa00d('0x80'),_0x23acfa);throw _0x23acfa;});}return _0x2f6cd4;})['then'](respondWithResult(_0x4fe6d8,0xc9))[_0xa00d('0x54')](handleError(_0x4fe6d8,null));};exports[_0xa00d('0x81')]=function(_0x2d5bd0,_0x467024,_0x485460){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x2d5bd0['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x467024,null))[_0xa00d('0x31')](function(_0x488648){if(_0x488648){return _0x488648[_0xa00d('0x81')]();}return null;})[_0xa00d('0x31')](respondWithResult(_0x467024,null))[_0xa00d('0x54')](handleError(_0x467024,null));};exports[_0xa00d('0x82')]=function(_0x297b15,_0x311899,_0x1f083b){if(_0x297b15[_0xa00d('0x5c')]['id']){delete _0x297b15[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x297b15['params']['id']}})['then'](handleEntityNotFound(_0x311899,null))[_0xa00d('0x31')](function(_0x28c527){if(_0x28c527){_0x297b15[_0xa00d('0x5c')][_0xa00d('0x60')]=_0x28c527['id'];return db[_0xa00d('0x3a')]['create'](_0x297b15[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x311899,null))['catch'](handleError(_0x311899,null));};exports[_0xa00d('0x83')]=function(_0x26f8e8,_0x18f103,_0x28cd57){return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x26f8e8[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x18f103,null))[_0xa00d('0x31')](function(_0x3ca973){if(_0x3ca973){return _0x3ca973['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x18f103,null))[_0xa00d('0x54')](handleError(_0x18f103,null));};exports[_0xa00d('0x84')]=function(_0x4a0abc,_0x42d98d,_0x24518d){return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x4a0abc[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x42d98d,null))[_0xa00d('0x31')](function(_0x3bec72){if(_0x3bec72){return _0x3bec72['getSmtp']();}return null;})[_0xa00d('0x31')](respondWithResult(_0x42d98d,null))[_0xa00d('0x54')](handleError(_0x42d98d,null));};exports['addSmtp']=function(_0x2a3261,_0x5cd575,_0x4e074e){if(_0x2a3261[_0xa00d('0x5c')]['id']){delete _0x2a3261[_0xa00d('0x5c')]['id'];}return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x2a3261[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cd575,null))[_0xa00d('0x31')](function(_0x584d53){if(_0x584d53){_0x2a3261[_0xa00d('0x5c')]['MailAccountId']=_0x584d53['id'];return db['MailServerOut'][_0xa00d('0x62')](_0x2a3261[_0xa00d('0x5c')]);}})[_0xa00d('0x31')](respondWithResult(_0x5cd575,null))[_0xa00d('0x54')](handleError(_0x5cd575,null));};exports[_0xa00d('0x85')]=function(_0x32ec85,_0x10bd0c,_0x581817){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x32ec85[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x10bd0c,null))[_0xa00d('0x31')](function(_0x477037){if(_0x477037){return _0x477037[_0xa00d('0x86')](null);}return null;})[_0xa00d('0x31')](respondWithStatusCode(_0x10bd0c,null))[_0xa00d('0x54')](handleError(_0x10bd0c,null));};exports[_0xa00d('0x87')]=function(_0x562fc9,_0x4dee55,_0x107f49){return db[_0xa00d('0x88')][_0xa00d('0x5b')]({'where':{'id':_0x562fc9['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x4dee55,null))[_0xa00d('0x31')](function(_0x26f385){if(_0x26f385){return _0x26f385[_0xa00d('0x87')](_0x562fc9[_0xa00d('0x5c')][_0xa00d('0x67')],_[_0xa00d('0x89')](_0x562fc9['body'],[_0xa00d('0x67'),'id'])||{});}})[_0xa00d('0x31')](respondWithResult(_0x4dee55,null))[_0xa00d('0x54')](handleError(_0x4dee55,null));};exports['getInteractions']=function(_0x1c99f8,_0x594a1c,_0xe61f5b){var _0x21bae8={'raw':![],'where':{}};var _0x44434f={};var _0x296e04={'count':0x0,'rows':[]};return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x1c99f8[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x594a1c,null))[_0xa00d('0x31')](function(_0x21f2df){if(_0x21f2df){_0x44434f['model']=_[_0xa00d('0x44')](db[_0xa00d('0x88')]['rawAttributes']);_0x44434f[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x1c99f8[_0xa00d('0x43')]);_0x44434f[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x44434f[_0xa00d('0x42')],_0x44434f[_0xa00d('0x43')]);_0x21bae8['attributes']=_[_0xa00d('0x46')](_0x44434f[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x1c99f8[_0xa00d('0x43')]['fields']));_0x21bae8['attributes']=_0x21bae8[_0xa00d('0x47')][_0xa00d('0x59')]?_0x21bae8[_0xa00d('0x47')]:_0x44434f[_0xa00d('0x42')];if(!_0x1c99f8[_0xa00d('0x43')]['hasOwnProperty'](_0xa00d('0x4a'))){_0x21bae8['limit']=qs[_0xa00d('0x2a')](_0x1c99f8['query'][_0xa00d('0x2a')]);_0x21bae8[_0xa00d('0x28')]=qs[_0xa00d('0x28')](_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x28')]);}_0x21bae8[_0xa00d('0x64')]=qs[_0xa00d('0x4b')](_0x1c99f8['query'][_0xa00d('0x4b')]);_0x21bae8[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x1c99f8[_0xa00d('0x43')],_0x44434f[_0xa00d('0x45')]));_0x21bae8[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x21f2df['id'];if(_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x21bae8[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x21bae8[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x21bae8['attributes'],function(_0x396ba7){var _0x414c29={};_0x414c29[_0x396ba7]={'$like':'%'+_0x1c99f8['query'][_0xa00d('0x4d')]+'%'};return _0x414c29;})});}_0x21bae8=_['merge']({},_0x21bae8,_0x1c99f8[_0xa00d('0x4e')]);return db['MailInteraction'][_0xa00d('0x2b')]({'where':_0x21bae8[_0xa00d('0x4c')]})['then'](function(_0x55aa4a){_0x296e04[_0xa00d('0x2b')]=_0x55aa4a;if(_0x1c99f8[_0xa00d('0x43')]['includeAll']){_0x21bae8[_0xa00d('0x50')]=[{'model':db['CmContact'],'as':_0xa00d('0x8a'),'required':![]},{'model':db[_0xa00d('0x8b')],'as':_0xa00d('0x8c'),'attributes':[_0xa00d('0x37'),_0xa00d('0x8d'),_0xa00d('0x8e')],'required':![]},{'model':db['Tag'],'as':_0xa00d('0x8f'),'attributes':['id',_0xa00d('0x37'),_0xa00d('0x90')],'where':_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x91')]?{'id':_0x1c99f8[_0xa00d('0x43')][_0xa00d('0x91')]}:undefined,'required':_0x1c99f8['query'][_0xa00d('0x91')]?!![]:![]}];}return db[_0xa00d('0x88')]['findAll'](_0x21bae8);})[_0xa00d('0x31')](function(_0x5e4ba6){_0x296e04['rows']=_0x5e4ba6;return _0x296e04;});}})['then'](respondWithFilteredResult(_0x594a1c,_0x21bae8))[_0xa00d('0x54')](handleError(_0x594a1c,null));};exports[_0xa00d('0x92')]=function addApplications(_0x17d35e,_0x6a00c1){var _0x1a002e=_0x17d35e[_0xa00d('0x56')]['id'];var _0x1e8a11=_0x17d35e[_0xa00d('0x5c')];var _0x291227=0xc8;var _0x229eff=null;return db['sequelize'][_0xa00d('0x93')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x21e983){return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x1a002e},'transaction':_0x21e983})['then'](function(_0x8ddb44){if(_0x8ddb44){return db[_0xa00d('0x94')]['destroy']({'where':{'MailAccountId':_0x1a002e},'transaction':_0x21e983})[_0xa00d('0x31')](function(){var _0x443277=_[_0xa00d('0x3d')](_0x1e8a11,function(_0x55348c){_0x55348c[_0xa00d('0x60')]=_0x1a002e;return _0x55348c;});return db[_0xa00d('0x94')][_0xa00d('0x95')](_0x443277,{'transaction':_0x21e983});});}else{_0x291227=0x194;_0x229eff=[];}});})['then'](function(){if(_0x291227!==0x194){return db[_0xa00d('0x94')][_0xa00d('0x96')]({'where':{'MailAccountId':_0x1a002e},'order':_0xa00d('0x97')})['then'](function(_0x3d45b7){_0x229eff=_0x3d45b7;});}})['catch'](function(_0x4afa3a){_0x291227=0x1f4;logger[_0xa00d('0x21')](_0x4afa3a['stack']);if(_0x4afa3a['name']){delete _0x4afa3a[_0xa00d('0x37')];}_0x229eff=_0x4afa3a;})[_0xa00d('0x98')](function(){if(_0x229eff===null){_0x6a00c1['sendStatus'](_0x291227);}else{if(_0x291227===0x1f4){_0x6a00c1[_0xa00d('0x27')](_0x291227)[_0xa00d('0x38')](_0x229eff);}else{_0x6a00c1[_0xa00d('0x27')](_0x291227)[_0xa00d('0x2d')](_0x229eff);}}});};exports[_0xa00d('0x99')]=function(_0x37e544,_0x3bce3f,_0x2302e8){var _0x5c8de3={};var _0x56da2e={};var _0x170645;var _0x1ba9d5;return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x37e544[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x3bce3f,null))[_0xa00d('0x31')](function(_0x3c701b){if(_0x3c701b){_0x170645=_0x3c701b;_0x56da2e[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x94')]['rawAttributes']);_0x56da2e[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x37e544[_0xa00d('0x43')]);_0x56da2e[_0xa00d('0x45')]=_['intersection'](_0x56da2e[_0xa00d('0x42')],_0x56da2e[_0xa00d('0x43')]);_0x5c8de3[_0xa00d('0x47')]=_['intersection'](_0x56da2e[_0xa00d('0x42')],qs['fields'](_0x37e544['query'][_0xa00d('0x48')]));_0x5c8de3['attributes']=_0x5c8de3['attributes'][_0xa00d('0x59')]?_0x5c8de3[_0xa00d('0x47')]:_0x56da2e[_0xa00d('0x42')];_0x5c8de3['order']=qs['sort'](_0x37e544[_0xa00d('0x43')]['sort']);_0x5c8de3[_0xa00d('0x4c')]=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x37e544['query'],_0x56da2e[_0xa00d('0x45')]));if(_0x37e544[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x5c8de3[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x5c8de3['where'],{'$or':_['map'](_0x5c8de3[_0xa00d('0x47')],function(_0x10eeff){var _0x25fb73={};_0x25fb73[_0x10eeff]={'$like':'%'+_0x37e544[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x25fb73;})});}_0x5c8de3=_['merge']({},_0x5c8de3,_0x37e544[_0xa00d('0x4e')]);return _0x170645[_0xa00d('0x99')](_0x5c8de3);}})[_0xa00d('0x31')](function(_0x468c8c){if(_0x468c8c){_0x1ba9d5=_0x468c8c[_0xa00d('0x59')];if(!_0x37e544[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x5c8de3[_0xa00d('0x2a')]=qs[_0xa00d('0x2a')](_0x37e544['query'][_0xa00d('0x2a')]);_0x5c8de3[_0xa00d('0x28')]=qs['offset'](_0x37e544['query'][_0xa00d('0x28')]);}return _0x170645[_0xa00d('0x99')](_0x5c8de3);}})['then'](function(_0xd1f415){if(_0xd1f415){return _0xd1f415?{'count':_0x1ba9d5,'rows':_0xd1f415}:null;}})[_0xa00d('0x31')](respondWithResult(_0x3bce3f,null))[_0xa00d('0x54')](handleError(_0x3bce3f,null));};exports['getMessages']=function(_0x122bbf,_0xacf4f0,_0x297264){var _0x123609={'raw':!![],'where':{}};var _0x4751df={};var _0x2c1050={'count':0x0,'rows':[]};return db[_0xa00d('0x51')]['findOne']({'where':{'id':_0x122bbf[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0xacf4f0,null))['then'](function(_0x2fcff5){if(_0x2fcff5){_0x4751df[_0xa00d('0x42')]=_[_0xa00d('0x44')](db[_0xa00d('0x9a')][_0xa00d('0x3e')]);_0x4751df['query']=_['keys'](_0x122bbf['query']);_0x4751df[_0xa00d('0x45')]=_[_0xa00d('0x46')](_0x4751df['model'],_0x4751df[_0xa00d('0x43')]);_0x123609['attributes']=_[_0xa00d('0x46')](_0x4751df[_0xa00d('0x42')],qs[_0xa00d('0x48')](_0x122bbf[_0xa00d('0x43')][_0xa00d('0x48')]));_0x123609[_0xa00d('0x47')]=_0x123609[_0xa00d('0x47')][_0xa00d('0x59')]?_0x123609['attributes']:_0x4751df[_0xa00d('0x42')];if(!_0x122bbf[_0xa00d('0x43')][_0xa00d('0x49')](_0xa00d('0x4a'))){_0x123609[_0xa00d('0x2a')]=qs['limit'](_0x122bbf['query'][_0xa00d('0x2a')]);_0x123609[_0xa00d('0x28')]=qs['offset'](_0x122bbf['query']['offset']);}_0x123609[_0xa00d('0x64')]=qs[_0xa00d('0x4b')](_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4b')]);_0x123609['where']=qs[_0xa00d('0x45')](_[_0xa00d('0x65')](_0x122bbf[_0xa00d('0x43')],_0x4751df[_0xa00d('0x45')]));_0x123609[_0xa00d('0x4c')][_0xa00d('0x60')]=_0x2fcff5['id'];if(_0x122bbf[_0xa00d('0x43')]['filter']){_0x123609[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x123609[_0xa00d('0x4c')],{'$or':_['map'](_0x123609[_0xa00d('0x47')],function(_0x366056){var _0x3dee3c={};_0x3dee3c[_0x366056]={'$like':'%'+_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4d')]+'%'};return _0x3dee3c;})});}if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x9b')]){var _0x4dd608=_0x122bbf[_0xa00d('0x43')]['$gte'][_0xa00d('0x9c')](',');var _0x316c23={};_0x316c23[_0x4dd608[0x0]]={'$gte':moment(_0x4dd608[0x1])[_0xa00d('0x9d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x123609[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x123609['where'],_0x316c23);}_0x123609=_['merge']({},_0x123609,_0x122bbf[_0xa00d('0x4e')]);return db['MailMessage'][_0xa00d('0x2b')]({'where':_0x123609['where']})[_0xa00d('0x31')](function(_0x3494ce){_0x2c1050['count']=_0x3494ce;if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x4f')]){_0x123609[_0xa00d('0x50')]=[{'all':!![]}];}return db[_0xa00d('0x9a')][_0xa00d('0x52')](_0x123609);})[_0xa00d('0x31')](function(_0x998e98){if(_0x122bbf[_0xa00d('0x43')][_0xa00d('0x9e')]==='true'){for(var _0x4cebd1=0x0;_0x4cebd1<_0x998e98[_0xa00d('0x59')];_0x4cebd1++){_0x998e98[_0x4cebd1]['body']=juice(_0x998e98[_0x4cebd1][_0xa00d('0x5c')]);}}_0x2c1050[_0xa00d('0x53')]=_0x998e98;return _0x2c1050;});}})[_0xa00d('0x31')](respondWithFilteredResult(_0xacf4f0,_0x123609))['catch'](handleError(_0xacf4f0,null));};exports[_0xa00d('0x38')]=function(_0xcf188,_0x3585d5,_0x4f205d){var _0x5a96d3,_0x3775de={},_0x25a4a5;if(_0xcf188['body']['to']){_0x25a4a5=_0xcf188['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0xa00d('0x5b')]({'where':{'id':_0xcf188[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x9f')],'as':_0xa00d('0xa0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x25a4a5},'limit':0x1,'order':[[_0xa00d('0xa1'),_0xa00d('0xa2')]]}]},{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58'),'raw':!![]}]})[_0xa00d('0x31')](handleEntityNotFound(_0x3585d5,null))['then'](function(_0x5a61a6){if(_0x5a61a6){_0x5a96d3=_0x5a61a6;if(_0x5a61a6[_0xa00d('0x58')]){if(_['isNil'](_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')])){_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')]=util['format']('%s\x20<%s>',_0x5a61a6['name'],_0x5a61a6[_0xa00d('0x6c')]||_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x73')]);}if(_0xcf188['body']['attachments']&&_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0xa00d('0x59')]){for(var _0x37dc3b=0x0;_0x37dc3b<_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0xa00d('0x59')];_0x37dc3b+=0x1){_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa4')][_0x37dc3b]={'filename':_0xcf188['body'][_0xa00d('0xa4')][_0x37dc3b]['name'],'path':path['join'](config[_0xa00d('0xa5')],_0xa00d('0xa6'),_0xcf188['body']['attachments'][_0x37dc3b][_0xa00d('0xa7')])};}}var _0x330326={'tls':{'rejectUnauthorized':![]}};if(_[_0xa00d('0x6e')](_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x7a')])){if(_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x77')]){_0x330326[_0xa00d('0xa8')]={'user':_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x73')],'pass':_0x5a61a6[_0xa00d('0x58')]['pass']};}_0x330326[_0xa00d('0x78')]=_0x5a61a6['Smtp'][_0xa00d('0x78')];_0x330326['port']=_0x5a61a6[_0xa00d('0x58')]['port'];_0x330326[_0xa00d('0xa9')]=_0x5a61a6[_0xa00d('0x58')][_0xa00d('0xa9')];}else{_0x330326[_0xa00d('0x7a')]=_0x5a61a6['Smtp'][_0xa00d('0x7a')];_0x330326['auth']={'user':_0x5a61a6[_0xa00d('0x58')]['user'],'pass':_0x5a61a6[_0xa00d('0x58')][_0xa00d('0x76')]};}return respondWithRpcPromise(_0xa00d('0xaa'),_0xa00d('0xab'),{'account':_0x330326,'message':_0xcf188[_0xa00d('0x5c')]});}else{throw new Error(_0xa00d('0xac'));}}})[_0xa00d('0x31')](function(_0x50d117){if(_0x50d117){_0x3775de=_0x50d117;if(_0x5a96d3[_0xa00d('0xa0')]){if(_0x5a96d3['List'][_0xa00d('0xad')][_0xa00d('0x59')]){return _0x5a96d3['List'][_0xa00d('0xad')][0x0];}else{return db[_0xa00d('0xae')][_0xa00d('0x62')](_[_0xa00d('0xaf')](_0xcf188[_0xa00d('0x5c')],{'firstName':_0xcf188['body']['to'],'email':_0xcf188['body']['to'],'phone':_0xcf188[_0xa00d('0x5c')]['to'],'ListId':_0x5a96d3[_0xa00d('0x6d')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xa00d('0x31')](function(_0xd0ddff){if(_0xd0ddff){var _0x352b82={'UserId':_0xcf188[_0xa00d('0x73')]['id'],'ContactId':_0xd0ddff['id'],'MailAccountId':_0x5a96d3['id'],'inReplyTo':_0x3775de[_0xa00d('0xb0')],'to':_0xcf188[_0xa00d('0x5c')][_0xa00d('0xa3')],'cc':_0xcf188['body']['cc'],'subject':_0xcf188['body'][_0xa00d('0xb1')],'attach':_0xcf188[_0xa00d('0x5c')][_0xa00d('0xb2')],'firstMsgDirection':_0xa00d('0xb3'),'lastMsgAt':moment()['format'](_0xa00d('0xb4')),'lastMsgDirection':'out','Messages':[_['merge'](_0xcf188[_0xa00d('0x5c')],{'messageId':_0x3775de[_0xa00d('0xb0')],'sentAt':moment()[_0xa00d('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5a96d3['id'],'UserId':_0xcf188['user']['id'],'ContactId':_0xd0ddff['id']})]};if(_0xcf188['body'][_0xa00d('0xb5')]){_0x352b82=_['merge'](_0x352b82,_0xcf188['body'][_0xa00d('0xb5')]);}return db['MailInteraction'][_0xa00d('0x62')](_0x352b82,{'include':[{'model':db[_0xa00d('0x9a')],'as':_0xa00d('0xb6')}]});}})[_0xa00d('0x31')](respondWithResult(_0x3585d5,null))[_0xa00d('0x54')](handleError(_0x3585d5,null));};exports['verifySmtp']=function(_0x54fd47,_0x4e9438,_0x12f996){return db[_0xa00d('0x51')][_0xa00d('0x5b')]({'where':{'id':_0x54fd47[_0xa00d('0x56')]['id']},'include':[{'model':db[_0xa00d('0x57')],'as':_0xa00d('0x58'),'raw':!![]}]})[_0xa00d('0x31')](handleEntityNotFound(_0x4e9438,null))[_0xa00d('0x31')](function(_0x5d96c9){if(_0x5d96c9&&_0x5d96c9[_0xa00d('0x58')]){var _0x27f5cc={'id':_0x5d96c9['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d96c9['Smtp']['service']){_0x27f5cc[_0xa00d('0x7a')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x7a')];}else{_0x27f5cc['host']=_0x5d96c9['Smtp'][_0xa00d('0x78')];_0x27f5cc[_0xa00d('0x79')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x79')];_0x27f5cc[_0xa00d('0xa9')]=_0x5d96c9[_0xa00d('0x58')][_0xa00d('0xa9')];}if(_0x5d96c9[_0xa00d('0x58')]['authentication']){_0x27f5cc['auth']={'user':_0x5d96c9['Smtp'][_0xa00d('0x73')],'pass':_0x5d96c9[_0xa00d('0x58')][_0xa00d('0x76')]};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x27f5cc});}})[_0xa00d('0x31')](respondWithResult(_0x4e9438,null))['catch'](handleError(_0x4e9438,null));};exports[_0xa00d('0x32')]=function(_0x4e8c47,_0x45c489){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x4e8c47[_0xa00d('0x56')]['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x45c489,null))[_0xa00d('0x31')](function(_0x3c5b27){if(_0x3c5b27&&_0x3c5b27['service']){throw new db[(_0xa00d('0xb7'))]['ValidationError'](_0xa00d('0xb8'));}return _0x3c5b27;})['then'](removeEntity(_0x45c489,null))['catch'](handleError(_0x45c489,null));};exports['addAgents']=function(_0x47ebb8,_0xcfe1d8,_0x2a39e5){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x47ebb8['params']['id']}})['then'](handleEntityNotFound(_0xcfe1d8,null))[_0xa00d('0x31')](function(_0x398b3d){if(_0x398b3d){return _0x398b3d[_0xa00d('0xb9')](_0x47ebb8[_0xa00d('0x5c')]['ids'],_['omit'](_0x47ebb8[_0xa00d('0x5c')],['ids','id'])||{})[_0xa00d('0xba')](function(_0x4308cc){for(var _0x1dfa67=0x0;_0x1dfa67<_0x47ebb8[_0xa00d('0x5c')][_0xa00d('0x67')][_0xa00d('0x59')];_0x1dfa67+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x47ebb8[_0xa00d('0x5c')][_0xa00d('0x67')][_0x1dfa67]),'MailAccountId':Number(_0x47ebb8[_0xa00d('0x56')]['id'])});}return _0x4308cc;});}})[_0xa00d('0x31')](respondWithResult(_0xcfe1d8,null))[_0xa00d('0x54')](handleError(_0xcfe1d8,null));};exports[_0xa00d('0xbb')]=function(_0x3e25de,_0x4e4c5e,_0xa94e07){return db[_0xa00d('0x51')]['find']({'where':{'id':_0x3e25de[_0xa00d('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e4c5e,null))['then'](function(_0x496bc6){if(_0x496bc6){return _0x496bc6[_0xa00d('0xbb')](_0x3e25de['query'][_0xa00d('0x67')])[_0xa00d('0x31')](function(){if(_['isArray'](_0x3e25de['query'][_0xa00d('0x67')])){for(var _0x76afa7=0x0;_0x76afa7<_0x3e25de[_0xa00d('0x43')]['ids'][_0xa00d('0x59')];_0x76afa7+=0x1){socket[_0xa00d('0xbc')](_0xa00d('0xbd'),{'UserId':Number(_0x3e25de[_0xa00d('0x43')][_0xa00d('0x67')][_0x76afa7]),'MailAccountId':Number(_0x3e25de[_0xa00d('0x56')]['id'])});}}else{socket[_0xa00d('0xbc')](_0xa00d('0xbd'),{'UserId':Number(_0x3e25de['query'][_0xa00d('0x67')]),'MailAccountId':Number(_0x3e25de['params']['id'])});}});}})[_0xa00d('0x31')](respondWithStatusCode(_0x4e4c5e,null))['catch'](handleError(_0x4e4c5e,null));};exports['getAgents']=function(_0x264260,_0x46d732,_0x5201e0){var _0x406237={};var _0x500002={};var _0x115ace;var _0x3810d8;return db[_0xa00d('0x51')][_0xa00d('0x63')]({'where':{'id':_0x264260['params']['id']}})[_0xa00d('0x31')](handleEntityNotFound(_0x46d732,null))['then'](function(_0x33b6e4){if(_0x33b6e4){_0x115ace=_0x33b6e4;_0x500002['model']=_[_0xa00d('0x44')](db[_0xa00d('0x8b')][_0xa00d('0x3e')]);_0x500002[_0xa00d('0x43')]=_[_0xa00d('0x44')](_0x264260[_0xa00d('0x43')]);_0x500002['filters']=_[_0xa00d('0x46')](_0x500002[_0xa00d('0x42')],_0x500002[_0xa00d('0x43')]);_0x406237[_0xa00d('0x47')]=_[_0xa00d('0x46')](_0x500002[_0xa00d('0x42')],qs['fields'](_0x264260[_0xa00d('0x43')]['fields']));_0x406237[_0xa00d('0x47')]=_0x406237[_0xa00d('0x47')]['length']?_0x406237[_0xa00d('0x47')]:_0x500002[_0xa00d('0x42')];_0x406237['order']=qs[_0xa00d('0x4b')](_0x264260[_0xa00d('0x43')]['sort']);_0x406237[_0xa00d('0x4c')]=qs['filters'](_[_0xa00d('0x65')](_0x264260[_0xa00d('0x43')],_0x500002[_0xa00d('0x45')]));if(_0x264260[_0xa00d('0x43')][_0xa00d('0x4d')]){_0x406237[_0xa00d('0x4c')]=_[_0xa00d('0x5a')](_0x406237[_0xa00d('0x4c')],{'$or':_[_0xa00d('0x3d')](_0x406237[_0xa00d('0x47')],function(_0x49df84){var _0x3b43ef={};_0x3b43ef[_0x49df84]={'$like':'%'+_0x264260['query'][_0xa00d('0x4d')]+'%'};return _0x3b43ef;})});}_0x406237=_[_0xa00d('0x5a')]({},_0x406237,_0x264260['options']);return _0x115ace['getAgents'](_0x406237);}})['then'](function(_0x1c091b){if(_0x1c091b){_0x3810d8=_0x1c091b[_0xa00d('0x59')];if(!_0x264260[_0xa00d('0x43')][_0xa00d('0x49')]('nolimit')){_0x406237['limit']=qs[_0xa00d('0x2a')](_0x264260['query'][_0xa00d('0x2a')]);_0x406237[_0xa00d('0x28')]=qs['offset'](_0x264260[_0xa00d('0x43')]['offset']);}return _0x115ace['getAgents'](_0x406237);}})['then'](function(_0x169ee8){if(_0x169ee8){return _0x169ee8?{'count':_0x3810d8,'rows':_0x169ee8}:null;}})[_0xa00d('0x31')](respondWithResult(_0x46d732,null))[_0xa00d('0x54')](handleError(_0x46d732,null));};
\ No newline at end of file
+var _0x11a9=['authentication','host','port','service','password','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','ids','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','updatedAt','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','List\x20not\x20found','Contacts','messageId','attach','out','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','destroy','get','MailAccounts','name','send','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','MailServerIn','rawAttributes','include','body','find','params','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','CannedAnswer','hasOwnProperty','removeAnswers','key','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','pass','cpassword'];(function(_0xa69409,_0x4eea03){var _0x43779b=function(_0xdb9654){while(--_0xdb9654){_0xa69409['push'](_0xa69409['shift']());}};_0x43779b(++_0x4eea03);}(_0x11a9,0x11b));var _0x911a=function(_0x557801,_0x3cdcb0){_0x557801=_0x557801-0x0;var _0x5047be=_0x11a9[_0x557801];return _0x5047be;};'use strict';var emlformat=require(_0x911a('0x0'));var rimraf=require(_0x911a('0x1'));var zipdir=require(_0x911a('0x2'));var jsonpatch=require(_0x911a('0x3'));var rp=require(_0x911a('0x4'));var moment=require(_0x911a('0x5'));var BPromise=require(_0x911a('0x6'));var Mustache=require(_0x911a('0x7'));var util=require(_0x911a('0x8'));var path=require(_0x911a('0x9'));var sox=require(_0x911a('0xa'));var csv=require(_0x911a('0xb'));var ejs=require(_0x911a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x911a('0xd'));var squel=require('squel');var crypto=require(_0x911a('0xe'));var jsforce=require(_0x911a('0xf'));var deskjs=require(_0x911a('0x10'));var toCsv=require(_0x911a('0xb'));var querystring=require(_0x911a('0x11'));var Papa=require(_0x911a('0x12'));var htmlToText=require(_0x911a('0x13'));var juice=require(_0x911a('0x14'));var Redis=require(_0x911a('0x15'));var authService=require(_0x911a('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0x911a('0x17'));var hardwareService=require(_0x911a('0x18'));var logger=require(_0x911a('0x19'))(_0x911a('0x1a'));var utils=require('../../config/utils');var config=require(_0x911a('0x1b'));var licenseUtil=require(_0x911a('0x1c'));var db=require('../../mysqldb')['db'];config[_0x911a('0x1d')]=_[_0x911a('0x1e')](config['redis'],{'host':_0x911a('0x1f'),'port':0x18eb});var socket=require(_0x911a('0x20'))(new Redis(config['redis']));require('./mailAccount.socket')[_0x911a('0x21')](socket);var jayson=require(_0x911a('0x22'));var client=jayson[_0x911a('0x23')][_0x911a('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x4c95b7,_0x262a72,_0x10c29b,_0x2e8b05){return new BPromise(function(_0x1fed3a,_0x1ff7d3){var _0x4970df=_0x2e8b05||client;return _0x4970df['request'](_0x4c95b7,_0x10c29b)[_0x911a('0x25')](function(_0x24f106){logger[_0x911a('0x26')]('MailAccount,\x20%s,\x20%s',_0x262a72,_0x911a('0x27'));logger[_0x911a('0x28')](_0x911a('0x29'),_0x262a72,_0x911a('0x27'),JSON['stringify'](_0x24f106));if(_0x24f106['error']){if(_0x24f106[_0x911a('0x2a')][_0x911a('0x2b')]===0x1f4){logger[_0x911a('0x2a')](_0x911a('0x2c'),_0x262a72,_0x24f106[_0x911a('0x2a')][_0x911a('0x2d')]);return _0x1ff7d3(_0x24f106['error'][_0x911a('0x2d')]);}logger[_0x911a('0x2a')]('MailAccount,\x20%s,\x20%s',_0x262a72,_0x24f106[_0x911a('0x2a')]['message']);return _0x1fed3a(_0x24f106[_0x911a('0x2a')][_0x911a('0x2d')]);}else{logger[_0x911a('0x26')](_0x911a('0x2c'),_0x262a72,_0x911a('0x27'));_0x1fed3a(_0x24f106[_0x911a('0x2e')]['message']);}})[_0x911a('0x2f')](function(_0x1ec162){logger[_0x911a('0x2a')](_0x911a('0x2c'),_0x262a72,_0x1ec162);_0x1ff7d3(_0x1ec162);});});}function respondWithStatusCode(_0x1f2c22,_0x5e3910){_0x5e3910=_0x5e3910||0xcc;return function(_0x1d172f){if(_0x1d172f){return _0x1f2c22[_0x911a('0x30')](_0x5e3910);}return _0x1f2c22['status'](_0x5e3910)[_0x911a('0x31')]();};}function respondWithResult(_0x1afc3e,_0x4b7cda){_0x4b7cda=_0x4b7cda||0xc8;return function(_0x41ff99){if(_0x41ff99){return _0x1afc3e['status'](_0x4b7cda)[_0x911a('0x32')](_0x41ff99);}};}function respondWithFilteredResult(_0x35676e,_0x406b62){return function(_0x28d8e4){if(_0x28d8e4){var _0x226f2d=typeof _0x406b62[_0x911a('0x33')]===_0x911a('0x34')&&typeof _0x406b62[_0x911a('0x35')]===_0x911a('0x34');var _0x4a407e=_0x28d8e4['count'];var _0x344652=_0x226f2d?0x0:_0x406b62[_0x911a('0x33')];var _0x2e5474=_0x226f2d?_0x28d8e4[_0x911a('0x36')]:_0x406b62[_0x911a('0x33')]+_0x406b62[_0x911a('0x35')];var _0x22a8de;if(_0x2e5474>=_0x4a407e){_0x2e5474=_0x4a407e;_0x22a8de=0xc8;}else{_0x22a8de=0xce;}_0x35676e[_0x911a('0x37')](_0x22a8de);return _0x35676e[_0x911a('0x38')]('Content-Range',_0x344652+'-'+_0x2e5474+'/'+_0x4a407e)['json'](_0x28d8e4);}return null;};}function patchUpdates(_0x41dccc){return function(_0xc4f99a){try{jsonpatch['apply'](_0xc4f99a,_0x41dccc,!![]);}catch(_0x1f1fa3){return BPromise[_0x911a('0x39')](_0x1f1fa3);}return _0xc4f99a[_0x911a('0x3a')]();};}function saveUpdates(_0x4d221d,_0x27d8e2){return function(_0x23ef15){if(_0x23ef15){return _0x23ef15['update'](_0x4d221d)['then'](function(_0x4b547a){return _0x4b547a;});}return null;};}function removeEntity(_0x41bdde,_0x1f4d31){return function(_0x16c205){if(_0x16c205){return _0x16c205[_0x911a('0x3b')]()[_0x911a('0x25')](function(){var _0x39ee75=_0x16c205[_0x911a('0x3c')]({'plain':!![]});var _0x5391e4=_0x911a('0x3d');return db['UserProfileResource'][_0x911a('0x3b')]({'where':{'type':_0x5391e4,'resourceId':_0x39ee75['id']}})[_0x911a('0x25')](function(){return _0x16c205;});})[_0x911a('0x25')](function(){_0x41bdde[_0x911a('0x37')](0xcc)[_0x911a('0x31')]();});}};}function handleEntityNotFound(_0xccfced,_0x5e5003){return function(_0x1187b3){if(!_0x1187b3){_0xccfced[_0x911a('0x30')](0x194);}return _0x1187b3;};}function handleError(_0x20188d,_0x30e710){_0x30e710=_0x30e710||0x1f4;return function(_0x4b8e37){logger[_0x911a('0x2a')](_0x4b8e37['stack']);if(_0x4b8e37[_0x911a('0x3e')]){delete _0x4b8e37[_0x911a('0x3e')];}_0x20188d[_0x911a('0x37')](_0x30e710)[_0x911a('0x3f')](_0x4b8e37);};}exports['index']=function(_0x1dfa6b,_0x44b0a7){var _0x2a2793={'include':[{'model':db['MailServerIn'],'as':_0x911a('0x40')},{'model':db[_0x911a('0x41')],'as':_0x911a('0x42')},{'model':db[_0x911a('0x43')],'as':_0x911a('0x44')}]},_0x4d9de7={},_0x545e36={'count':0x0,'rows':[]};var _0x3060ea=_[_0x911a('0x45')](db[_0x911a('0x46')]['rawAttributes'],function(_0x5e38bd){return{'name':_0x5e38bd['fieldName'],'type':_0x5e38bd['type']['key']};});_0x4d9de7['model']=_[_0x911a('0x45')](_0x3060ea,_0x911a('0x3e'));_0x4d9de7[_0x911a('0x47')]=_[_0x911a('0x48')](_0x1dfa6b[_0x911a('0x47')]);_0x4d9de7['filters']=_[_0x911a('0x49')](_0x4d9de7[_0x911a('0x4a')],_0x4d9de7[_0x911a('0x47')]);_0x2a2793[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x4d9de7[_0x911a('0x4a')],qs[_0x911a('0x4c')](_0x1dfa6b[_0x911a('0x47')][_0x911a('0x4c')]));_0x2a2793['attributes']=_0x2a2793[_0x911a('0x4b')][_0x911a('0x4d')]?_0x2a2793['attributes']:_0x4d9de7['model'];if(!_0x1dfa6b[_0x911a('0x47')]['hasOwnProperty'](_0x911a('0x4e'))){_0x2a2793[_0x911a('0x35')]=qs[_0x911a('0x35')](_0x1dfa6b[_0x911a('0x47')][_0x911a('0x35')]);_0x2a2793[_0x911a('0x33')]=qs[_0x911a('0x33')](_0x1dfa6b[_0x911a('0x47')]['offset']);}_0x2a2793[_0x911a('0x4f')]=qs['sort'](_0x1dfa6b['query'][_0x911a('0x50')]);_0x2a2793['where']=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x1dfa6b['query'],_0x4d9de7['filters']),_0x3060ea);if(_0x1dfa6b[_0x911a('0x47')][_0x911a('0x53')]){_0x2a2793[_0x911a('0x54')]=_[_0x911a('0x55')](_0x2a2793[_0x911a('0x54')],{'$or':_[_0x911a('0x45')](_0x3060ea,function(_0xb65fa0){if(_0xb65fa0[_0x911a('0x56')]!==_0x911a('0x57')){var _0x59b90e={};_0x59b90e[_0xb65fa0[_0x911a('0x3e')]]={'$like':'%'+_0x1dfa6b[_0x911a('0x47')][_0x911a('0x53')]+'%'};return _0x59b90e;}})});}_0x2a2793=_[_0x911a('0x55')]({},_0x2a2793,_0x1dfa6b[_0x911a('0x58')]);var _0x2fd354={'where':_0x2a2793[_0x911a('0x54')]};return db[_0x911a('0x46')][_0x911a('0x36')](_0x2fd354)['then'](function(_0x721641){_0x545e36[_0x911a('0x36')]=_0x721641;if(_0x1dfa6b[_0x911a('0x47')][_0x911a('0x59')]){_0x2a2793['include']=[{'all':!![]}];}return db[_0x911a('0x46')][_0x911a('0x5a')](_0x2a2793);})['then'](function(_0x2a423e){_0x545e36[_0x911a('0x5b')]=_0x2a423e;return _0x545e36;})['then'](respondWithFilteredResult(_0x44b0a7,_0x2a2793))['catch'](handleError(_0x44b0a7,null));};exports[_0x911a('0x5c')]=function(_0x39b6da,_0x8af4be){var _0x54ced2={'raw':![],'where':{'id':_0x39b6da['params']['id']},'include':[{'model':db[_0x911a('0x5d')],'as':_0x911a('0x40')},{'model':db[_0x911a('0x41')],'as':_0x911a('0x42')},{'model':db[_0x911a('0x43')],'as':'mandatoryDispositionPause'}]},_0x4318d2={};_0x4318d2[_0x911a('0x4a')]=_[_0x911a('0x48')](db['MailAccount'][_0x911a('0x5e')]);_0x4318d2['query']=_[_0x911a('0x48')](_0x39b6da['query']);_0x4318d2[_0x911a('0x51')]=_[_0x911a('0x49')](_0x4318d2['model'],_0x4318d2[_0x911a('0x47')]);_0x54ced2[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x4318d2['model'],qs[_0x911a('0x4c')](_0x39b6da[_0x911a('0x47')][_0x911a('0x4c')]));_0x54ced2['attributes']=_0x54ced2[_0x911a('0x4b')][_0x911a('0x4d')]?_0x54ced2[_0x911a('0x4b')]:_0x4318d2['model'];if(_0x39b6da[_0x911a('0x47')][_0x911a('0x59')]){_0x54ced2[_0x911a('0x5f')]=[{'all':!![]}];}_0x54ced2=_[_0x911a('0x55')]({},_0x54ced2,_0x39b6da['options']);return db[_0x911a('0x46')]['find'](_0x54ced2)[_0x911a('0x25')](handleEntityNotFound(_0x8af4be,null))[_0x911a('0x25')](respondWithResult(_0x8af4be,null))[_0x911a('0x2f')](handleError(_0x8af4be,null));};exports['update']=function(_0x4c7eb6,_0x22860a){if(_0x4c7eb6[_0x911a('0x60')]['id']){delete _0x4c7eb6[_0x911a('0x60')]['id'];}return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x4c7eb6[_0x911a('0x62')]['id']},'include':[{'model':db[_0x911a('0x5d')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x911a('0x42')},{'model':db[_0x911a('0x43')],'as':_0x911a('0x44')}]})[_0x911a('0x25')](handleEntityNotFound(_0x22860a,null))[_0x911a('0x25')](saveUpdates(_0x4c7eb6[_0x911a('0x60')],null))[_0x911a('0x25')](function(_0x58b227){if(_0x58b227&&_0x4c7eb6[_0x911a('0x60')][_0x911a('0x40')]){return db['MailServerIn'][_0x911a('0x63')](_0x4c7eb6[_0x911a('0x60')]['Imap'],{'where':{'MailAccountId':_0x58b227['id']}})[_0x911a('0x25')](function(){return _0x58b227;});}return _0x58b227;})[_0x911a('0x25')](function(_0x23448e){if(_0x23448e&&_0x4c7eb6['body']['Smtp']){return db[_0x911a('0x41')]['update'](_0x4c7eb6['body'][_0x911a('0x42')],{'where':{'MailAccountId':_0x23448e['id']}})[_0x911a('0x25')](function(){return _0x23448e;});}return _0x23448e;})[_0x911a('0x25')](respondWithResult(_0x22860a,null))['catch'](handleError(_0x22860a,null));};exports[_0x911a('0x64')]=function(_0x3695c7,_0xcb7892){return db[_0x911a('0x46')]['describe']()['then'](respondWithResult(_0xcb7892,null))[_0x911a('0x2f')](handleError(_0xcb7892,null));};exports[_0x911a('0x65')]=function(_0x1a3d19,_0x3ec31d,_0x4346f6){if(_0x1a3d19[_0x911a('0x60')]['id']){delete _0x1a3d19[_0x911a('0x60')]['id'];}return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x1a3d19[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x3ec31d,null))['then'](function(_0x5c461d){if(_0x5c461d){_0x1a3d19[_0x911a('0x60')][_0x911a('0x66')]=_0x5c461d['id'];return db[_0x911a('0x67')][_0x911a('0x68')](_0x1a3d19['body']);}})[_0x911a('0x25')](respondWithResult(_0x3ec31d,null))['catch'](handleError(_0x3ec31d,null));};exports[_0x911a('0x69')]=function(_0x1580ab,_0x2b9a52,_0x4c77e5){var _0x17dc50={'raw':![],'where':{}};var _0x138697={};var _0xd98dbc={'count':0x0,'rows':[]};return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x1580ab[_0x911a('0x62')]['id']}})['then'](handleEntityNotFound(_0x2b9a52,null))['then'](function(_0x3c5211){if(_0x3c5211){_0x138697[_0x911a('0x4a')]=_['keys'](db[_0x911a('0x67')]['rawAttributes']);_0x138697[_0x911a('0x47')]=_['keys'](_0x1580ab[_0x911a('0x47')]);_0x138697['filters']=_[_0x911a('0x49')](_0x138697[_0x911a('0x4a')],_0x138697[_0x911a('0x47')]);_0x17dc50[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x138697[_0x911a('0x4a')],qs[_0x911a('0x4c')](_0x1580ab['query'][_0x911a('0x4c')]));_0x17dc50[_0x911a('0x4b')]=_0x17dc50['attributes'][_0x911a('0x4d')]?_0x17dc50[_0x911a('0x4b')]:_0x138697[_0x911a('0x4a')];if(!_0x1580ab[_0x911a('0x47')]['hasOwnProperty'](_0x911a('0x4e'))){_0x17dc50[_0x911a('0x35')]=qs['limit'](_0x1580ab[_0x911a('0x47')][_0x911a('0x35')]);_0x17dc50['offset']=qs[_0x911a('0x33')](_0x1580ab[_0x911a('0x47')][_0x911a('0x33')]);}_0x17dc50[_0x911a('0x4f')]=qs[_0x911a('0x50')](_0x1580ab[_0x911a('0x47')]['sort']);_0x17dc50['where']=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x1580ab[_0x911a('0x47')],_0x138697[_0x911a('0x51')]));_0x17dc50['where'][_0x911a('0x66')]=_0x3c5211['id'];if(_0x1580ab[_0x911a('0x47')][_0x911a('0x53')]){_0x17dc50[_0x911a('0x54')]=_[_0x911a('0x55')](_0x17dc50[_0x911a('0x54')],{'$or':_[_0x911a('0x45')](_0x17dc50['attributes'],function(_0x16e48a){var _0x617057={};_0x617057[_0x16e48a]={'$like':'%'+_0x1580ab[_0x911a('0x47')][_0x911a('0x53')]+'%'};return _0x617057;})});}_0x17dc50=_['merge']({},_0x17dc50,_0x1580ab[_0x911a('0x58')]);return db['Disposition'][_0x911a('0x36')]({'where':_0x17dc50[_0x911a('0x54')]})[_0x911a('0x25')](function(_0x3d1e4e){_0xd98dbc[_0x911a('0x36')]=_0x3d1e4e;if(_0x1580ab[_0x911a('0x47')][_0x911a('0x59')]){_0x17dc50[_0x911a('0x5f')]=[{'all':!![]}];}return db[_0x911a('0x67')]['findAll'](_0x17dc50);})[_0x911a('0x25')](function(_0x5fa1d6){_0xd98dbc[_0x911a('0x5b')]=_0x5fa1d6;return _0xd98dbc;});}})[_0x911a('0x25')](respondWithFilteredResult(_0x2b9a52,_0x17dc50))[_0x911a('0x2f')](handleError(_0x2b9a52,null));};exports[_0x911a('0x6b')]=function(_0x2bbf96,_0x185be8,_0x2e4989){return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x2bbf96['params']['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x185be8,null))[_0x911a('0x25')](function(_0x1bec88){if(_0x1bec88){return _0x1bec88['removeDispositions'](_0x2bbf96[_0x911a('0x47')]['ids']);}})[_0x911a('0x25')](respondWithStatusCode(_0x185be8,null))[_0x911a('0x2f')](handleError(_0x185be8,null));};exports['addAnswer']=function(_0x325fe1,_0x7d2d31,_0x494c14){if(_0x325fe1[_0x911a('0x60')]['id']){delete _0x325fe1[_0x911a('0x60')]['id'];}return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x325fe1[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x7d2d31,null))[_0x911a('0x25')](function(_0x4bc588){if(_0x4bc588){_0x325fe1[_0x911a('0x60')][_0x911a('0x66')]=_0x4bc588['id'];return db[_0x911a('0x6c')][_0x911a('0x68')](_0x325fe1[_0x911a('0x60')]);}})[_0x911a('0x25')](respondWithResult(_0x7d2d31,null))[_0x911a('0x2f')](handleError(_0x7d2d31,null));};exports['getAnswers']=function(_0x3461d3,_0x4a6cf6,_0x1f8d52){var _0x358741={'raw':![],'where':{}};var _0xf4333a={};var _0xc8c3e3={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x3461d3[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x4a6cf6,null))[_0x911a('0x25')](function(_0xef2082){if(_0xef2082){_0xf4333a['model']=_[_0x911a('0x48')](db['CannedAnswer'][_0x911a('0x5e')]);_0xf4333a['query']=_[_0x911a('0x48')](_0x3461d3['query']);_0xf4333a[_0x911a('0x51')]=_[_0x911a('0x49')](_0xf4333a[_0x911a('0x4a')],_0xf4333a[_0x911a('0x47')]);_0x358741[_0x911a('0x4b')]=_['intersection'](_0xf4333a['model'],qs[_0x911a('0x4c')](_0x3461d3[_0x911a('0x47')][_0x911a('0x4c')]));_0x358741[_0x911a('0x4b')]=_0x358741[_0x911a('0x4b')][_0x911a('0x4d')]?_0x358741['attributes']:_0xf4333a[_0x911a('0x4a')];if(!_0x3461d3[_0x911a('0x47')][_0x911a('0x6d')](_0x911a('0x4e'))){_0x358741[_0x911a('0x35')]=qs['limit'](_0x3461d3[_0x911a('0x47')][_0x911a('0x35')]);_0x358741['offset']=qs[_0x911a('0x33')](_0x3461d3[_0x911a('0x47')][_0x911a('0x33')]);}_0x358741[_0x911a('0x4f')]=qs[_0x911a('0x50')](_0x3461d3[_0x911a('0x47')][_0x911a('0x50')]);_0x358741[_0x911a('0x54')]=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x3461d3[_0x911a('0x47')],_0xf4333a[_0x911a('0x51')]));_0x358741['where']['MailAccountId']=_0xef2082['id'];if(_0x3461d3['query'][_0x911a('0x53')]){_0x358741[_0x911a('0x54')]=_['merge'](_0x358741[_0x911a('0x54')],{'$or':_[_0x911a('0x45')](_0x358741[_0x911a('0x4b')],function(_0x16b3bf){var _0x26995f={};_0x26995f[_0x16b3bf]={'$like':'%'+_0x3461d3[_0x911a('0x47')][_0x911a('0x53')]+'%'};return _0x26995f;})});}_0x358741=_[_0x911a('0x55')]({},_0x358741,_0x3461d3[_0x911a('0x58')]);return db[_0x911a('0x6c')][_0x911a('0x36')]({'where':_0x358741[_0x911a('0x54')]})['then'](function(_0x541ea7){_0xc8c3e3[_0x911a('0x36')]=_0x541ea7;if(_0x3461d3[_0x911a('0x47')]['includeAll']){_0x358741[_0x911a('0x5f')]=[{'all':!![]}];}return db[_0x911a('0x6c')][_0x911a('0x5a')](_0x358741);})[_0x911a('0x25')](function(_0x5d923e){_0xc8c3e3[_0x911a('0x5b')]=_0x5d923e;return _0xc8c3e3;});}})[_0x911a('0x25')](respondWithFilteredResult(_0x4a6cf6,_0x358741))[_0x911a('0x2f')](handleError(_0x4a6cf6,null));};exports[_0x911a('0x6e')]=function(_0x43388d,_0x2274df,_0xea3c7d){return db['MailAccount'][_0x911a('0x61')]({'where':{'id':_0x43388d[_0x911a('0x62')]['id']}})['then'](handleEntityNotFound(_0x2274df,null))[_0x911a('0x25')](function(_0x4ce036){if(_0x4ce036){return _0x4ce036[_0x911a('0x6e')](_0x43388d[_0x911a('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x2274df,null))[_0x911a('0x2f')](handleError(_0x2274df,null));};exports[_0x911a('0x68')]=function(_0x5b3110,_0x40dfe3){var _0x521f08={'name':_0x5b3110[_0x911a('0x60')][_0x911a('0x3e')],'key':_0x5b3110[_0x911a('0x60')][_0x911a('0x6f')],'email':_0x5b3110[_0x911a('0x60')][_0x911a('0x70')],'ListId':_0x5b3110[_0x911a('0x60')][_0x911a('0x71')],'active':!_[_0x911a('0x72')](_0x5b3110[_0x911a('0x60')][_0x911a('0x73')])?_0x5b3110[_0x911a('0x60')][_0x911a('0x73')]:!![],'description':_0x5b3110[_0x911a('0x60')][_0x911a('0x74')]||null,'Imap':{},'Smtp':{}};if(_[_0x911a('0x72')](_0x5b3110[_0x911a('0x60')][_0x911a('0x75')])){if(_0x5b3110['body'][_0x911a('0x76')]){_0x521f08[_0x911a('0x40')][_0x911a('0x77')]=_0x521f08['Smtp'][_0x911a('0x77')]=_0x5b3110[_0x911a('0x60')][_0x911a('0x78')];_0x521f08[_0x911a('0x40')]['password']=_0x521f08['Smtp'][_0x911a('0x79')]=_0x5b3110[_0x911a('0x60')][_0x911a('0x7a')];}else{_0x521f08[_0x911a('0x40')][_0x911a('0x7b')]=_0x521f08[_0x911a('0x42')][_0x911a('0x7b')]=![];}_0x521f08[_0x911a('0x40')][_0x911a('0x7c')]=_0x5b3110[_0x911a('0x60')][_0x911a('0x40')][_0x911a('0x7c')];_0x521f08[_0x911a('0x40')][_0x911a('0x7d')]=_0x5b3110[_0x911a('0x60')]['Imap'][_0x911a('0x7d')];_0x521f08[_0x911a('0x42')]['host']=_0x5b3110[_0x911a('0x60')][_0x911a('0x42')][_0x911a('0x7c')];_0x521f08['Smtp'][_0x911a('0x7d')]=_0x5b3110['body'][_0x911a('0x42')]['port'];}else{_0x521f08['Imap']['service']=_0x521f08[_0x911a('0x42')][_0x911a('0x7e')]=_0x5b3110[_0x911a('0x60')][_0x911a('0x75')];_0x521f08['Imap'][_0x911a('0x77')]=_0x521f08[_0x911a('0x42')]['user']=_0x5b3110[_0x911a('0x60')][_0x911a('0x78')];_0x521f08[_0x911a('0x40')][_0x911a('0x7f')]=_0x521f08[_0x911a('0x42')]['pass']=_0x5b3110[_0x911a('0x60')][_0x911a('0x7a')];}return db[_0x911a('0x46')][_0x911a('0x68')](_0x521f08,{'include':[{'model':db[_0x911a('0x41')],'as':_0x911a('0x42')},{'model':db['MailServerIn'],'as':_0x911a('0x40')}]})['then'](function(_0x114943){var _0x46f819=_0x5b3110['user']['get']({'plain':!![]});if(!_0x46f819)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46f819[_0x911a('0x80')]==='user'){var _0x411d46=_0x114943['get']({'plain':!![]});return db[_0x911a('0x81')][_0x911a('0x61')]({'where':{'name':'MailAccounts','userProfileId':_0x46f819[_0x911a('0x82')]},'raw':!![]})[_0x911a('0x25')](function(_0xe6b297){if(_0xe6b297&&_0xe6b297[_0x911a('0x83')]===0x0){return db[_0x911a('0x84')]['create']({'name':_0x411d46['name'],'resourceId':_0x411d46['id'],'type':_0xe6b297[_0x911a('0x3e')],'sectionId':_0xe6b297['id']},{})['then'](function(){return _0x114943;});}else{return _0x114943;}})[_0x911a('0x2f')](function(_0x4721f1){logger[_0x911a('0x2a')](_0x911a('0x85'),_0x4721f1);throw _0x4721f1;});}return _0x114943;})[_0x911a('0x25')](respondWithResult(_0x40dfe3,0xc9))['catch'](handleError(_0x40dfe3,null));};exports[_0x911a('0x86')]=function(_0x43d405,_0x2fa1c8,_0x3af769){return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x43d405[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x2fa1c8,null))[_0x911a('0x25')](function(_0x26613b){if(_0x26613b){return _0x26613b[_0x911a('0x86')]();}return null;})['then'](respondWithResult(_0x2fa1c8,null))[_0x911a('0x2f')](handleError(_0x2fa1c8,null));};exports[_0x911a('0x87')]=function(_0x28bfc8,_0x2b1c6e,_0x1cc7d4){if(_0x28bfc8['body']['id']){delete _0x28bfc8[_0x911a('0x60')]['id'];}return db['MailAccount'][_0x911a('0x61')]({'where':{'id':_0x28bfc8['params']['id']}})['then'](handleEntityNotFound(_0x2b1c6e,null))[_0x911a('0x25')](function(_0x18b5a9){if(_0x18b5a9){_0x28bfc8[_0x911a('0x60')][_0x911a('0x66')]=_0x18b5a9['id'];return db[_0x911a('0x5d')][_0x911a('0x68')](_0x28bfc8[_0x911a('0x60')]);}})[_0x911a('0x25')](respondWithResult(_0x2b1c6e,null))[_0x911a('0x2f')](handleError(_0x2b1c6e,null));};exports[_0x911a('0x88')]=function(_0x545b85,_0x43c9b7,_0x2e44ef){return db['MailAccount'][_0x911a('0x6a')]({'where':{'id':_0x545b85[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x43c9b7,null))[_0x911a('0x25')](function(_0x495b32){if(_0x495b32){return _0x495b32[_0x911a('0x89')](null);}return null;})[_0x911a('0x25')](respondWithStatusCode(_0x43c9b7,null))['catch'](handleError(_0x43c9b7,null));};exports[_0x911a('0x8a')]=function(_0x4943a4,_0x5e12a,_0x20b930){return db[_0x911a('0x46')]['findOne']({'where':{'id':_0x4943a4['params']['id']}})['then'](handleEntityNotFound(_0x5e12a,null))[_0x911a('0x25')](function(_0x1d6adb){if(_0x1d6adb){return _0x1d6adb[_0x911a('0x8a')]();}return null;})[_0x911a('0x25')](respondWithResult(_0x5e12a,null))['catch'](handleError(_0x5e12a,null));};exports[_0x911a('0x8b')]=function(_0x5bec23,_0x5c6406,_0x593ab9){if(_0x5bec23['body']['id']){delete _0x5bec23[_0x911a('0x60')]['id'];}return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x5bec23[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x5c6406,null))[_0x911a('0x25')](function(_0x4f5624){if(_0x4f5624){_0x5bec23[_0x911a('0x60')][_0x911a('0x66')]=_0x4f5624['id'];return db['MailServerOut'][_0x911a('0x68')](_0x5bec23[_0x911a('0x60')]);}})['then'](respondWithResult(_0x5c6406,null))[_0x911a('0x2f')](handleError(_0x5c6406,null));};exports[_0x911a('0x8c')]=function(_0x21e56a,_0x57b78f,_0xbebc2a){return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x21e56a[_0x911a('0x62')]['id']}})['then'](handleEntityNotFound(_0x57b78f,null))[_0x911a('0x25')](function(_0x1090d7){if(_0x1090d7){return _0x1090d7[_0x911a('0x8d')](null);}return null;})[_0x911a('0x25')](respondWithStatusCode(_0x57b78f,null))['catch'](handleError(_0x57b78f,null));};exports[_0x911a('0x8e')]=function(_0x3332f8,_0x5d3876,_0x525d4c){return db[_0x911a('0x8f')][_0x911a('0x61')]({'where':{'id':_0x3332f8['params']['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x5d3876,null))[_0x911a('0x25')](function(_0x26ca23){if(_0x26ca23){return _0x26ca23[_0x911a('0x8e')](_0x3332f8[_0x911a('0x60')][_0x911a('0x90')],_[_0x911a('0x91')](_0x3332f8[_0x911a('0x60')],[_0x911a('0x90'),'id'])||{});}})[_0x911a('0x25')](respondWithResult(_0x5d3876,null))[_0x911a('0x2f')](handleError(_0x5d3876,null));};exports[_0x911a('0x92')]=function(_0x21da16,_0x4aa3f8,_0x4bd5ba){var _0x3b4324={'raw':![],'where':{}};var _0x2335f2={};var _0x2edb3d={'count':0x0,'rows':[]};return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x21da16[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x4aa3f8,null))['then'](function(_0x18041a){if(_0x18041a){_0x2335f2[_0x911a('0x4a')]=_[_0x911a('0x48')](db[_0x911a('0x8f')][_0x911a('0x5e')]);_0x2335f2[_0x911a('0x47')]=_['keys'](_0x21da16['query']);_0x2335f2[_0x911a('0x51')]=_[_0x911a('0x49')](_0x2335f2[_0x911a('0x4a')],_0x2335f2['query']);_0x3b4324['attributes']=_[_0x911a('0x49')](_0x2335f2[_0x911a('0x4a')],qs['fields'](_0x21da16[_0x911a('0x47')][_0x911a('0x4c')]));_0x3b4324[_0x911a('0x4b')]=_0x3b4324[_0x911a('0x4b')][_0x911a('0x4d')]?_0x3b4324[_0x911a('0x4b')]:_0x2335f2['model'];if(!_0x21da16['query'][_0x911a('0x6d')](_0x911a('0x4e'))){_0x3b4324['limit']=qs[_0x911a('0x35')](_0x21da16[_0x911a('0x47')][_0x911a('0x35')]);_0x3b4324[_0x911a('0x33')]=qs['offset'](_0x21da16['query'][_0x911a('0x33')]);}_0x3b4324[_0x911a('0x4f')]=qs[_0x911a('0x50')](_0x21da16[_0x911a('0x47')][_0x911a('0x50')]);_0x3b4324['where']=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x21da16[_0x911a('0x47')],_0x2335f2[_0x911a('0x51')]));_0x3b4324[_0x911a('0x54')][_0x911a('0x66')]=_0x18041a['id'];if(_0x21da16[_0x911a('0x47')][_0x911a('0x53')]){_0x3b4324[_0x911a('0x54')]=_[_0x911a('0x55')](_0x3b4324['where'],{'$or':_['map'](_0x3b4324[_0x911a('0x4b')],function(_0x576b27){var _0x50bb2f={};_0x50bb2f[_0x576b27]={'$like':'%'+_0x21da16[_0x911a('0x47')][_0x911a('0x53')]+'%'};return _0x50bb2f;})});}_0x3b4324=_[_0x911a('0x55')]({},_0x3b4324,_0x21da16[_0x911a('0x58')]);return db[_0x911a('0x8f')]['count']({'where':_0x3b4324['where']})[_0x911a('0x25')](function(_0x3e0309){_0x2edb3d[_0x911a('0x36')]=_0x3e0309;if(_0x21da16[_0x911a('0x47')][_0x911a('0x59')]){_0x3b4324[_0x911a('0x5f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0x911a('0x93'),'attributes':[_0x911a('0x3e'),_0x911a('0x94'),_0x911a('0x95')],'required':![]},{'model':db['Tag'],'as':_0x911a('0x96'),'attributes':['id',_0x911a('0x3e'),_0x911a('0x97')],'where':_0x21da16[_0x911a('0x47')][_0x911a('0x98')]?{'id':_0x21da16['query']['tag']}:undefined,'required':_0x21da16[_0x911a('0x47')][_0x911a('0x98')]?!![]:![]}];}return db[_0x911a('0x8f')]['findAll'](_0x3b4324);})[_0x911a('0x25')](function(_0xb2d496){_0x2edb3d[_0x911a('0x5b')]=_0xb2d496;return _0x2edb3d;});}})[_0x911a('0x25')](respondWithFilteredResult(_0x4aa3f8,_0x3b4324))[_0x911a('0x2f')](handleError(_0x4aa3f8,null));};exports['addApplications']=function addApplications(_0x564989,_0xb242ca){var _0x1a892f=_0x564989[_0x911a('0x62')]['id'];var _0x5ab55a=_0x564989['body'];var _0x5df736=0xc8;var _0x47d26d=null;return db[_0x911a('0x99')][_0x911a('0x9a')]({'isolationLevel':db['sequelize'][_0x911a('0x9b')][_0x911a('0x9c')][_0x911a('0x9d')]},function(_0x244ad0){return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x1a892f},'transaction':_0x244ad0})[_0x911a('0x25')](function(_0x38fde5){if(_0x38fde5){return db['MailApplication'][_0x911a('0x3b')]({'where':{'MailAccountId':_0x1a892f},'transaction':_0x244ad0})[_0x911a('0x25')](function(){var _0xc3ebd=_[_0x911a('0x45')](_0x5ab55a,function(_0xbe9ca4){_0xbe9ca4[_0x911a('0x66')]=_0x1a892f;return _0xbe9ca4;});return db[_0x911a('0x9e')][_0x911a('0x9f')](_0xc3ebd,{'transaction':_0x244ad0});});}else{_0x5df736=0x194;_0x47d26d=[];}});})[_0x911a('0x25')](function(){if(_0x5df736!==0x194){return db[_0x911a('0x9e')][_0x911a('0xa0')]({'where':{'MailAccountId':_0x1a892f},'order':_0x911a('0xa1')})[_0x911a('0x25')](function(_0x275515){_0x47d26d=_0x275515;});}})[_0x911a('0x2f')](function(_0x2bd3f9){_0x5df736=0x1f4;logger['error'](_0x2bd3f9[_0x911a('0xa2')]);if(_0x2bd3f9[_0x911a('0x3e')]){delete _0x2bd3f9[_0x911a('0x3e')];}_0x47d26d=_0x2bd3f9;})[_0x911a('0xa3')](function(){if(_0x47d26d===null){_0xb242ca[_0x911a('0x30')](_0x5df736);}else{if(_0x5df736===0x1f4){_0xb242ca[_0x911a('0x37')](_0x5df736)[_0x911a('0x3f')](_0x47d26d);}else{_0xb242ca[_0x911a('0x37')](_0x5df736)[_0x911a('0x32')](_0x47d26d);}}});};exports[_0x911a('0xa4')]=function(_0x42d904,_0x2a4a,_0x488397){var _0x4ecc2f={};var _0x2ba5cd={};var _0x2d836a;var _0x2edd4f;return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x42d904[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x2a4a,null))[_0x911a('0x25')](function(_0x159b56){if(_0x159b56){_0x2d836a=_0x159b56;_0x2ba5cd['model']=_['keys'](db[_0x911a('0x9e')][_0x911a('0x5e')]);_0x2ba5cd[_0x911a('0x47')]=_[_0x911a('0x48')](_0x42d904[_0x911a('0x47')]);_0x2ba5cd['filters']=_[_0x911a('0x49')](_0x2ba5cd[_0x911a('0x4a')],_0x2ba5cd[_0x911a('0x47')]);_0x4ecc2f[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x2ba5cd['model'],qs[_0x911a('0x4c')](_0x42d904[_0x911a('0x47')][_0x911a('0x4c')]));_0x4ecc2f[_0x911a('0x4b')]=_0x4ecc2f[_0x911a('0x4b')][_0x911a('0x4d')]?_0x4ecc2f[_0x911a('0x4b')]:_0x2ba5cd[_0x911a('0x4a')];_0x4ecc2f['order']=qs['sort'](_0x42d904[_0x911a('0x47')][_0x911a('0x50')]);_0x4ecc2f[_0x911a('0x54')]=qs['filters'](_['pick'](_0x42d904[_0x911a('0x47')],_0x2ba5cd[_0x911a('0x51')]));if(_0x42d904[_0x911a('0x47')]['filter']){_0x4ecc2f[_0x911a('0x54')]=_[_0x911a('0x55')](_0x4ecc2f[_0x911a('0x54')],{'$or':_['map'](_0x4ecc2f[_0x911a('0x4b')],function(_0x17e84c){var _0x52b055={};_0x52b055[_0x17e84c]={'$like':'%'+_0x42d904['query']['filter']+'%'};return _0x52b055;})});}_0x4ecc2f=_[_0x911a('0x55')]({},_0x4ecc2f,_0x42d904[_0x911a('0x58')]);return _0x2d836a[_0x911a('0xa4')](_0x4ecc2f);}})[_0x911a('0x25')](function(_0x84021c){if(_0x84021c){_0x2edd4f=_0x84021c[_0x911a('0x4d')];if(!_0x42d904['query'][_0x911a('0x6d')]('nolimit')){_0x4ecc2f[_0x911a('0x35')]=qs['limit'](_0x42d904[_0x911a('0x47')]['limit']);_0x4ecc2f[_0x911a('0x33')]=qs[_0x911a('0x33')](_0x42d904[_0x911a('0x47')][_0x911a('0x33')]);}return _0x2d836a[_0x911a('0xa4')](_0x4ecc2f);}})[_0x911a('0x25')](function(_0xdd8676){if(_0xdd8676){return _0xdd8676?{'count':_0x2edd4f,'rows':_0xdd8676}:null;}})[_0x911a('0x25')](respondWithResult(_0x2a4a,null))['catch'](handleError(_0x2a4a,null));};exports[_0x911a('0xa5')]=function(_0x49c37b,_0x4da564,_0x455ad7){var _0x1aa0c4={'raw':!![],'where':{}};var _0x5bf4c9={};var _0x2d46a5={'count':0x0,'rows':[]};return db[_0x911a('0x46')][_0x911a('0x6a')]({'where':{'id':_0x49c37b[_0x911a('0x62')]['id']}})['then'](handleEntityNotFound(_0x4da564,null))['then'](function(_0x2fc64a){if(_0x2fc64a){_0x5bf4c9[_0x911a('0x4a')]=_['keys'](db[_0x911a('0xa6')]['rawAttributes']);_0x5bf4c9[_0x911a('0x47')]=_['keys'](_0x49c37b[_0x911a('0x47')]);_0x5bf4c9[_0x911a('0x51')]=_[_0x911a('0x49')](_0x5bf4c9[_0x911a('0x4a')],_0x5bf4c9[_0x911a('0x47')]);_0x1aa0c4[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x5bf4c9[_0x911a('0x4a')],qs[_0x911a('0x4c')](_0x49c37b[_0x911a('0x47')]['fields']));_0x1aa0c4[_0x911a('0x4b')]=_0x1aa0c4[_0x911a('0x4b')][_0x911a('0x4d')]?_0x1aa0c4[_0x911a('0x4b')]:_0x5bf4c9[_0x911a('0x4a')];if(!_0x49c37b['query'][_0x911a('0x6d')](_0x911a('0x4e'))){_0x1aa0c4[_0x911a('0x35')]=qs['limit'](_0x49c37b['query'][_0x911a('0x35')]);_0x1aa0c4['offset']=qs[_0x911a('0x33')](_0x49c37b[_0x911a('0x47')][_0x911a('0x33')]);}_0x1aa0c4[_0x911a('0x4f')]=qs[_0x911a('0x50')](_0x49c37b[_0x911a('0x47')]['sort']);_0x1aa0c4[_0x911a('0x54')]=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x49c37b['query'],_0x5bf4c9[_0x911a('0x51')]));_0x1aa0c4[_0x911a('0x54')][_0x911a('0x66')]=_0x2fc64a['id'];if(_0x49c37b[_0x911a('0x47')][_0x911a('0x53')]){_0x1aa0c4[_0x911a('0x54')]=_[_0x911a('0x55')](_0x1aa0c4[_0x911a('0x54')],{'$or':_[_0x911a('0x45')](_0x1aa0c4['attributes'],function(_0x3b03e5){var _0x3f2809={};_0x3f2809[_0x3b03e5]={'$like':'%'+_0x49c37b['query'][_0x911a('0x53')]+'%'};return _0x3f2809;})});}if(_0x49c37b[_0x911a('0x47')][_0x911a('0xa7')]){var _0x3a4d25=_0x49c37b[_0x911a('0x47')][_0x911a('0xa7')][_0x911a('0xa8')](',');var _0x40813b={};_0x40813b[_0x3a4d25[0x0]]={'$gte':moment(_0x3a4d25[0x1])[_0x911a('0xa9')](_0x911a('0xaa'))};_0x1aa0c4[_0x911a('0x54')]=_[_0x911a('0x55')](_0x1aa0c4['where'],_0x40813b);}_0x1aa0c4=_['merge']({},_0x1aa0c4,_0x49c37b[_0x911a('0x58')]);return db[_0x911a('0xa6')][_0x911a('0x36')]({'where':_0x1aa0c4[_0x911a('0x54')]})[_0x911a('0x25')](function(_0x331e6c){_0x2d46a5[_0x911a('0x36')]=_0x331e6c;if(_0x49c37b[_0x911a('0x47')]['includeAll']){_0x1aa0c4[_0x911a('0x5f')]=[{'all':!![]}];}return db[_0x911a('0xa6')][_0x911a('0x5a')](_0x1aa0c4);})['then'](function(_0x178fab){if(_0x49c37b[_0x911a('0x47')][_0x911a('0xab')]===_0x911a('0xac')){for(var _0x2ab666=0x0;_0x2ab666<_0x178fab[_0x911a('0x4d')];_0x2ab666++){_0x178fab[_0x2ab666][_0x911a('0x60')]=juice(_0x178fab[_0x2ab666][_0x911a('0x60')]);}}_0x2d46a5[_0x911a('0x5b')]=_0x178fab;return _0x2d46a5;});}})[_0x911a('0x25')](respondWithFilteredResult(_0x4da564,_0x1aa0c4))['catch'](handleError(_0x4da564,null));};exports[_0x911a('0x3f')]=function(_0x35a5ba,_0x4f7d38,_0x38da6e){var _0x469f33,_0x48e30d={},_0x379669;if(_0x35a5ba[_0x911a('0x60')]['to']){_0x379669=_0x35a5ba[_0x911a('0x60')]['to'][_0x911a('0xa8')](',')[0x0];}return db[_0x911a('0x46')]['find']({'where':{'id':_0x35a5ba[_0x911a('0x62')]['id']},'include':[{'model':db[_0x911a('0xad')],'as':_0x911a('0xae'),'include':[{'model':db[_0x911a('0xaf')],'as':'Contacts','where':{'email':_0x379669},'limit':0x1,'order':[[_0x911a('0xb0'),'DESC']]}]},{'model':db[_0x911a('0x41')],'as':_0x911a('0x42'),'raw':!![]}]})[_0x911a('0x25')](handleEntityNotFound(_0x4f7d38,null))[_0x911a('0x25')](function(_0x53a6ee){if(_0x53a6ee){_0x469f33=_0x53a6ee;if(_0x53a6ee[_0x911a('0x42')]){if(_[_0x911a('0x72')](_0x35a5ba[_0x911a('0x60')]['from'])){_0x35a5ba[_0x911a('0x60')][_0x911a('0xb1')]=util[_0x911a('0xa9')](_0x911a('0xb2'),_0x53a6ee['name'],_0x53a6ee[_0x911a('0x70')]||_0x53a6ee[_0x911a('0x42')][_0x911a('0x77')]);}if(_0x35a5ba['body'][_0x911a('0xb3')]&&_0x35a5ba[_0x911a('0x60')][_0x911a('0xb3')][_0x911a('0x4d')]){for(var _0xe643ba=0x0;_0xe643ba<_0x35a5ba['body'][_0x911a('0xb3')][_0x911a('0x4d')];_0xe643ba+=0x1){_0x35a5ba[_0x911a('0x60')][_0x911a('0xb3')][_0xe643ba]={'filename':_0x35a5ba[_0x911a('0x60')][_0x911a('0xb3')][_0xe643ba]['name'],'path':path[_0x911a('0xb4')](config[_0x911a('0xb5')],_0x911a('0xb6'),_0x35a5ba['body'][_0x911a('0xb3')][_0xe643ba][_0x911a('0xb7')])};}}var _0x49be4d={'tls':{'rejectUnauthorized':![]}};if(_[_0x911a('0x72')](_0x53a6ee[_0x911a('0x42')][_0x911a('0x7e')])){if(_0x53a6ee[_0x911a('0x42')]['authentication']){_0x49be4d[_0x911a('0xb8')]={'user':_0x53a6ee[_0x911a('0x42')]['user'],'pass':_0x53a6ee[_0x911a('0x42')][_0x911a('0x79')]};}_0x49be4d['host']=_0x53a6ee[_0x911a('0x42')]['host'];_0x49be4d[_0x911a('0x7d')]=_0x53a6ee[_0x911a('0x42')][_0x911a('0x7d')];_0x49be4d['secure']=_0x53a6ee[_0x911a('0x42')][_0x911a('0xb9')];}else{_0x49be4d[_0x911a('0x7e')]=_0x53a6ee[_0x911a('0x42')][_0x911a('0x7e')];_0x49be4d[_0x911a('0xb8')]={'user':_0x53a6ee[_0x911a('0x42')]['user'],'pass':_0x53a6ee[_0x911a('0x42')][_0x911a('0x79')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x49be4d,'message':_0x35a5ba['body']});}else{throw new Error(_0x911a('0xba'));}}})[_0x911a('0x25')](function(_0x2b0ac3){if(_0x2b0ac3){_0x48e30d=_0x2b0ac3;if(_0x469f33[_0x911a('0xae')]){if(_0x469f33['List'][_0x911a('0xbb')][_0x911a('0x4d')]){return _0x469f33[_0x911a('0xae')][_0x911a('0xbb')][0x0];}else{return db[_0x911a('0xaf')]['create'](_[_0x911a('0x1e')](_0x35a5ba['body'],{'firstName':_0x35a5ba[_0x911a('0x60')]['to'],'email':_0x35a5ba[_0x911a('0x60')]['to'],'phone':_0x35a5ba[_0x911a('0x60')]['to'],'ListId':_0x469f33['ListId']}));}}else{throw new Error(_0x911a('0xba'));}}})['then'](function(_0x438983){if(_0x438983){var _0x402456={'UserId':_0x35a5ba['user']['id'],'ContactId':_0x438983['id'],'MailAccountId':_0x469f33['id'],'inReplyTo':_0x48e30d[_0x911a('0xbc')],'to':_0x35a5ba['body'][_0x911a('0xb1')],'cc':_0x35a5ba[_0x911a('0x60')]['cc'],'subject':_0x35a5ba[_0x911a('0x60')]['subject'],'attach':_0x35a5ba['body'][_0x911a('0xbd')],'firstMsgDirection':_0x911a('0xbe'),'lastMsgAt':moment()[_0x911a('0xa9')](_0x911a('0xaa')),'lastMsgDirection':'out','Messages':[_[_0x911a('0x55')](_0x35a5ba[_0x911a('0x60')],{'messageId':_0x48e30d['messageId'],'sentAt':moment()['format'](_0x911a('0xaa')),'read':!![],'MailAccountId':_0x469f33['id'],'UserId':_0x35a5ba[_0x911a('0x77')]['id'],'ContactId':_0x438983['id']})]};if(_0x35a5ba[_0x911a('0x60')]['Interaction']){_0x402456=_['merge'](_0x402456,_0x35a5ba['body']['Interaction']);}return db[_0x911a('0x8f')][_0x911a('0x68')](_0x402456,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})['then'](respondWithResult(_0x4f7d38,null))[_0x911a('0x2f')](handleError(_0x4f7d38,null));};exports['verifySmtp']=function(_0x37a9bb,_0x518d7a,_0x13a540){return db[_0x911a('0x46')]['find']({'where':{'id':_0x37a9bb[_0x911a('0x62')]['id']},'include':[{'model':db[_0x911a('0x41')],'as':_0x911a('0x42'),'raw':!![]}]})[_0x911a('0x25')](handleEntityNotFound(_0x518d7a,null))[_0x911a('0x25')](function(_0x2465af){if(_0x2465af&&_0x2465af['Smtp']){var _0x285efe={'id':_0x2465af['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2465af[_0x911a('0x42')][_0x911a('0x7e')]){_0x285efe['service']=_0x2465af['Smtp']['service'];}else{_0x285efe[_0x911a('0x7c')]=_0x2465af[_0x911a('0x42')][_0x911a('0x7c')];_0x285efe[_0x911a('0x7d')]=_0x2465af[_0x911a('0x42')][_0x911a('0x7d')];_0x285efe[_0x911a('0xb9')]=_0x2465af[_0x911a('0x42')][_0x911a('0xb9')];}if(_0x2465af[_0x911a('0x42')][_0x911a('0x7b')]){_0x285efe['auth']={'user':_0x2465af[_0x911a('0x42')][_0x911a('0x77')],'pass':_0x2465af[_0x911a('0x42')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x911a('0xbf'),{'account':_0x285efe});}})[_0x911a('0x25')](respondWithResult(_0x518d7a,null))[_0x911a('0x2f')](handleError(_0x518d7a,null));};exports['destroy']=function(_0x4c00a9,_0x18aca2){return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x4c00a9[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x18aca2,null))['then'](function(_0x166cd2){if(_0x166cd2&&_0x166cd2[_0x911a('0x7e')]){throw new db[(_0x911a('0xc0'))][(_0x911a('0xc1'))](_0x911a('0xc2'));}return _0x166cd2;})['then'](removeEntity(_0x18aca2,null))[_0x911a('0x2f')](handleError(_0x18aca2,null));};exports[_0x911a('0xc3')]=function(_0x53af4a,_0xfa08dd,_0x41138f){return db['MailAccount'][_0x911a('0x61')]({'where':{'id':_0x53af4a[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0xfa08dd,null))[_0x911a('0x25')](function(_0x44ffa0){if(_0x44ffa0){return _0x44ffa0[_0x911a('0xc3')](_0x53af4a['body']['ids'],_[_0x911a('0x91')](_0x53af4a[_0x911a('0x60')],['ids','id'])||{})[_0x911a('0xc4')](function(_0x2814a0){for(var _0x39d6a9=0x0;_0x39d6a9<_0x53af4a['body'][_0x911a('0x90')][_0x911a('0x4d')];_0x39d6a9+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x53af4a[_0x911a('0x60')][_0x911a('0x90')][_0x39d6a9]),'MailAccountId':Number(_0x53af4a[_0x911a('0x62')]['id'])});}return _0x2814a0;});}})[_0x911a('0x25')](respondWithResult(_0xfa08dd,null))['catch'](handleError(_0xfa08dd,null));};exports[_0x911a('0xc5')]=function(_0x249887,_0x44e1f2,_0x333ee3){return db[_0x911a('0x46')][_0x911a('0x61')]({'where':{'id':_0x249887['params']['id']}})['then'](handleEntityNotFound(_0x44e1f2,null))[_0x911a('0x25')](function(_0x2f1e17){if(_0x2f1e17){return _0x2f1e17[_0x911a('0xc5')](_0x249887[_0x911a('0x47')]['ids'])['then'](function(){if(_[_0x911a('0xc6')](_0x249887[_0x911a('0x47')][_0x911a('0x90')])){for(var _0x2ba23a=0x0;_0x2ba23a<_0x249887[_0x911a('0x47')][_0x911a('0x90')][_0x911a('0x4d')];_0x2ba23a+=0x1){socket[_0x911a('0xc7')](_0x911a('0xc8'),{'UserId':Number(_0x249887[_0x911a('0x47')][_0x911a('0x90')][_0x2ba23a]),'MailAccountId':Number(_0x249887[_0x911a('0x62')]['id'])});}}else{socket[_0x911a('0xc7')](_0x911a('0xc8'),{'UserId':Number(_0x249887[_0x911a('0x47')][_0x911a('0x90')]),'MailAccountId':Number(_0x249887[_0x911a('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x44e1f2,null))[_0x911a('0x2f')](handleError(_0x44e1f2,null));};exports[_0x911a('0xc9')]=function(_0x31d319,_0x25d946,_0x458e22){var _0x479c3c={};var _0x5c287e={};var _0x59541c;var _0x3a2148;return db['MailAccount'][_0x911a('0x6a')]({'where':{'id':_0x31d319[_0x911a('0x62')]['id']}})[_0x911a('0x25')](handleEntityNotFound(_0x25d946,null))[_0x911a('0x25')](function(_0x23f348){if(_0x23f348){_0x59541c=_0x23f348;_0x5c287e[_0x911a('0x4a')]=_[_0x911a('0x48')](db[_0x911a('0xca')][_0x911a('0x5e')]);_0x5c287e[_0x911a('0x47')]=_[_0x911a('0x48')](_0x31d319[_0x911a('0x47')]);_0x5c287e['filters']=_[_0x911a('0x49')](_0x5c287e[_0x911a('0x4a')],_0x5c287e['query']);_0x479c3c[_0x911a('0x4b')]=_[_0x911a('0x49')](_0x5c287e[_0x911a('0x4a')],qs['fields'](_0x31d319[_0x911a('0x47')][_0x911a('0x4c')]));_0x479c3c['attributes']=_0x479c3c[_0x911a('0x4b')][_0x911a('0x4d')]?_0x479c3c[_0x911a('0x4b')]:_0x5c287e['model'];_0x479c3c[_0x911a('0x4f')]=qs[_0x911a('0x50')](_0x31d319[_0x911a('0x47')]['sort']);_0x479c3c[_0x911a('0x54')]=qs[_0x911a('0x51')](_[_0x911a('0x52')](_0x31d319[_0x911a('0x47')],_0x5c287e[_0x911a('0x51')]));if(_0x31d319[_0x911a('0x47')][_0x911a('0x53')]){_0x479c3c['where']=_['merge'](_0x479c3c[_0x911a('0x54')],{'$or':_[_0x911a('0x45')](_0x479c3c['attributes'],function(_0x142c5c){var _0x6dedd2={};_0x6dedd2[_0x142c5c]={'$like':'%'+_0x31d319[_0x911a('0x47')][_0x911a('0x53')]+'%'};return _0x6dedd2;})});}_0x479c3c=_[_0x911a('0x55')]({},_0x479c3c,_0x31d319[_0x911a('0x58')]);return _0x59541c['getAgents'](_0x479c3c);}})[_0x911a('0x25')](function(_0x1745d7){if(_0x1745d7){_0x3a2148=_0x1745d7[_0x911a('0x4d')];if(!_0x31d319[_0x911a('0x47')][_0x911a('0x6d')](_0x911a('0x4e'))){_0x479c3c[_0x911a('0x35')]=qs[_0x911a('0x35')](_0x31d319[_0x911a('0x47')][_0x911a('0x35')]);_0x479c3c['offset']=qs['offset'](_0x31d319[_0x911a('0x47')][_0x911a('0x33')]);}return _0x59541c['getAgents'](_0x479c3c);}})[_0x911a('0x25')](function(_0x5adc41){if(_0x5adc41){return _0x5adc41?{'count':_0x3a2148,'rows':_0x5adc41}:null;}})[_0x911a('0x25')](respondWithResult(_0x25d946,null))[_0x911a('0x2f')](handleError(_0x25d946,null));};
\ No newline at end of file
index a63644f..99ea5e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b3=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners','save'];(function(_0x10caa5,_0x5ade72){var _0x1d939c=function(_0x460f90){while(--_0x460f90){_0x10caa5['push'](_0x10caa5['shift']());}};_0x1d939c(++_0x5ade72);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x19ac10,_0x54ee13){_0x19ac10=_0x19ac10-0x0;var _0xdf3f6d=_0xe3b3[_0x19ac10];return _0xdf3f6d;};'use strict';var EventEmitter=require(_0x3e3b('0x0'));var MailAccount=require(_0x3e3b('0x1'))['db'][_0x3e3b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3e3b('0x3')](0x0);var events={'afterCreate':_0x3e3b('0x4'),'afterUpdate':_0x3e3b('0x5'),'afterDestroy':_0x3e3b('0x6')};function emitEvent(_0x4d1684){return function(_0xcfab31,_0x2011b1,_0x5e3212){MailAccountEvents[_0x3e3b('0x7')](_0x4d1684+':'+_0xcfab31['id'],_0xcfab31);MailAccountEvents[_0x3e3b('0x7')](_0x4d1684,_0xcfab31);_0x5e3212(null);};}for(var e in events){if(events[_0x3e3b('0x8')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3e3b('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0x7d5d=['exports','../../mysqldb','MailAccount','update','remove','emit','hasOwnProperty'];(function(_0x1d8f1a,_0x417d9a){var _0x19388c=function(_0x38bb83){while(--_0x38bb83){_0x1d8f1a['push'](_0x1d8f1a['shift']());}};_0x19388c(++_0x417d9a);}(_0x7d5d,0x1dd));var _0xd7d5=function(_0x40afe8,_0x30271d){_0x40afe8=_0x40afe8-0x0;var _0x484427=_0x7d5d[_0x40afe8];return _0x484427;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xd7d5('0x0'))['db'][_0xd7d5('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd7d5('0x2'),'afterDestroy':_0xd7d5('0x3')};function emitEvent(_0x2948ca){return function(_0x5ce3bf,_0x236433,_0x26fd7b){MailAccountEvents[_0xd7d5('0x4')](_0x2948ca+':'+_0x5ce3bf['id'],_0x5ce3bf);MailAccountEvents[_0xd7d5('0x4')](_0x2948ca,_0x5ce3bf);_0x26fd7b(null);};}for(var e in events){if(events[_0xd7d5('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xd7d5('0x6')]=MailAccountEvents;
\ No newline at end of file
index 4b94c29..638570c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ddb=['define','MailAccount','lodash','util','api','bluebird','rimraf','../../config/environment','./mailAccount.attributes','exports'];(function(_0x29fc2c,_0x4ff86a){var _0x1adbc8=function(_0x596f87){while(--_0x596f87){_0x29fc2c['push'](_0x29fc2c['shift']());}};_0x1adbc8(++_0x4ff86a);}(_0x1ddb,0xe8));var _0xb1dd=function(_0x31adf9,_0x511868){_0x31adf9=_0x31adf9-0x0;var _0x4412b5=_0x1ddb[_0x31adf9];return _0x4412b5;};'use strict';var _=require(_0xb1dd('0x0'));var util=require(_0xb1dd('0x1'));var logger=require('../../config/logger')(_0xb1dd('0x2'));var moment=require('moment');var BPromise=require(_0xb1dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb1dd('0x4'));var config=require(_0xb1dd('0x5'));var attributes=require(_0xb1dd('0x6'));module[_0xb1dd('0x7')]=function(_0x33d166,_0x2bec7e){return _0x33d166[_0xb1dd('0x8')](_0xb1dd('0x9'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b77=['exports','MailAccount','mail_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x27b2a2,_0x45409b){var _0x5c6de6=function(_0x1d70e9){while(--_0x1d70e9){_0x27b2a2['push'](_0x27b2a2['shift']());}};_0x5c6de6(++_0x45409b);}(_0x5b77,0xab));var _0x75b7=function(_0x218add,_0x5441b){_0x218add=_0x218add-0x0;var _0x5f0467=_0x5b77[_0x218add];return _0x5f0467;};'use strict';var _=require(_0x75b7('0x0'));var util=require(_0x75b7('0x1'));var logger=require('../../config/logger')(_0x75b7('0x2'));var moment=require('moment');var BPromise=require(_0x75b7('0x3'));var rp=require(_0x75b7('0x4'));var fs=require('fs');var path=require(_0x75b7('0x5'));var rimraf=require(_0x75b7('0x6'));var config=require(_0x75b7('0x7'));var attributes=require(_0x75b7('0x8'));module[_0x75b7('0x9')]=function(_0x2e813d,_0x132de6){return _0x2e813d['define'](_0x75b7('0xa'),attributes,{'tableName':_0x75b7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b15cc9..e588d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd833=['originChannel','ChatOfflineMessageId','Attachments','UserId','name','agent','waitForTheAssignedAgent','Start','startRouting','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','attributes','include','map','model','ShowMailAccount','MailAccount','find','debug','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originTo','originCc','bcc','ChatWebsiteId'];(function(_0x217ea1,_0x18b281){var _0x1c9ea6=function(_0x451b84){while(--_0x451b84){_0x217ea1['push'](_0x217ea1['shift']());}};_0x1c9ea6(++_0x18b281);}(_0xd833,0x138));var _0x3d83=function(_0x1234cd,_0x3a11e3){_0x1234cd=_0x1234cd-0x0;var _0x5e83b2=_0xd833[_0x1234cd];return _0x5e83b2;};'use strict';var _=require('lodash');var util=require(_0x3d83('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3d83('0x1'));var fs=require('fs');var Redis=require(_0x3d83('0x2'));var db=require(_0x3d83('0x3'))['db'];var utils=require(_0x3d83('0x4'));var logger=require(_0x3d83('0x5'))('rpc');var config=require(_0x3d83('0x6'));var jayson=require(_0x3d83('0x7'));var client=jayson[_0x3d83('0x8')][_0x3d83('0x9')]({'port':0x232c});config[_0x3d83('0xa')]=_[_0x3d83('0xb')](config[_0x3d83('0xa')],{'host':_0x3d83('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d83('0xa')]));require(_0x3d83('0xd'))[_0x3d83('0xe')](socket);function respondWithRpcPromise(_0x2dfb9,_0x3da717,_0x24f454){return new BPromise(function(_0x101f3a,_0x406359){return client['request'](_0x2dfb9,_0x24f454)[_0x3d83('0xf')](function(_0x5989f1){logger[_0x3d83('0x10')](_0x3d83('0x11'),_0x3da717,_0x3d83('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x3da717,_0x3d83('0x12'),JSON[_0x3d83('0x13')](_0x5989f1));if(_0x5989f1[_0x3d83('0x14')]){if(_0x5989f1['error'][_0x3d83('0x15')]===0x1f4){logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x5989f1[_0x3d83('0x14')][_0x3d83('0x16')]);return _0x406359(_0x5989f1[_0x3d83('0x14')][_0x3d83('0x16')]);}logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x5989f1[_0x3d83('0x14')]['message']);return _0x101f3a(_0x5989f1['error'][_0x3d83('0x16')]);}else{logger[_0x3d83('0x10')](_0x3d83('0x11'),_0x3da717,_0x3d83('0x12'));_0x101f3a(_0x5989f1['result'][_0x3d83('0x16')]);}})[_0x3d83('0x17')](function(_0x3190b2){logger[_0x3d83('0x14')](_0x3d83('0x11'),_0x3da717,_0x3190b2);_0x406359(_0x3190b2);});});}exports[_0x3d83('0x18')]=function(_0x2060d1){var _0x1e1337=this;return new Promise(function(_0x2b2a34,_0x154001){return db['MailAccount'][_0x3d83('0x19')]({'raw':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1['options'][_0x3d83('0x1b')]===undefined?!![]:![]:!![],'where':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')]['where']||null:null,'attributes':_0x2060d1['options']?_0x2060d1['options'][_0x3d83('0x1c')]||null:null,'limit':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')]['limit']||null:null,'include':_0x2060d1[_0x3d83('0x1a')]?_0x2060d1[_0x3d83('0x1a')][_0x3d83('0x1d')]?_[_0x3d83('0x1e')](_0x2060d1[_0x3d83('0x1a')][_0x3d83('0x1d')],function(_0x22476d){return{'model':db[_0x22476d['model']],'as':_0x22476d['as'],'attributes':_0x22476d['attributes'],'include':_0x22476d[_0x3d83('0x1d')]?_['map'](_0x22476d['include'],function(_0x584d60){return{'model':db[_0x584d60['model']],'as':_0x584d60['as'],'attributes':_0x584d60[_0x3d83('0x1c')],'include':_0x584d60['include']?_[_0x3d83('0x1e')](_0x584d60[_0x3d83('0x1d')],function(_0x4d0dc1){return{'model':db[_0x4d0dc1[_0x3d83('0x1f')]],'as':_0x4d0dc1['as'],'attributes':_0x4d0dc1[_0x3d83('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28ae14){logger[_0x3d83('0x10')](_0x3d83('0x18'),_0x2060d1);logger['debug'](_0x3d83('0x18'),_0x2060d1,JSON[_0x3d83('0x13')](_0x28ae14));_0x2b2a34(_0x28ae14);})[_0x3d83('0x17')](function(_0x3e623c){logger['error'](_0x3d83('0x18'),_0x3e623c[_0x3d83('0x16')],_0x2060d1);_0x154001(_0x1e1337[_0x3d83('0x14')](0x1f4,_0x3e623c[_0x3d83('0x16')]));});});};exports[_0x3d83('0x20')]=function(_0x5f485f){var _0x37cd94=this;return new Promise(function(_0x1e6e4b,_0x9f5b93){return db[_0x3d83('0x21')][_0x3d83('0x22')]({'raw':_0x5f485f['options']?_0x5f485f[_0x3d83('0x1a')][_0x3d83('0x1b')]===undefined?!![]:![]:!![],'where':_0x5f485f['options']?_0x5f485f['options']['where']||null:null,'attributes':_0x5f485f['options']?_0x5f485f[_0x3d83('0x1a')][_0x3d83('0x1c')]||null:null,'include':_0x5f485f['options']?_0x5f485f['options'][_0x3d83('0x1d')]?_['map'](_0x5f485f[_0x3d83('0x1a')]['include'],function(_0x4f357c){return{'model':db[_0x4f357c['model']],'as':_0x4f357c['as'],'attributes':_0x4f357c[_0x3d83('0x1c')],'include':_0x4f357c[_0x3d83('0x1d')]?_['map'](_0x4f357c[_0x3d83('0x1d')],function(_0x1f3c36){return{'model':db[_0x1f3c36[_0x3d83('0x1f')]],'as':_0x1f3c36['as'],'attributes':_0x1f3c36['attributes'],'include':_0x1f3c36[_0x3d83('0x1d')]?_['map'](_0x1f3c36['include'],function(_0x469d6c){return{'model':db[_0x469d6c[_0x3d83('0x1f')]],'as':_0x469d6c['as'],'attributes':_0x469d6c[_0x3d83('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3d83('0xf')](function(_0x2bf54f){logger[_0x3d83('0x10')]('ShowMailAccount',_0x5f485f);logger[_0x3d83('0x23')](_0x3d83('0x20'),_0x5f485f,JSON[_0x3d83('0x13')](_0x2bf54f));_0x1e6e4b(_0x2bf54f);})[_0x3d83('0x17')](function(_0x3876de){logger['error'](_0x3d83('0x20'),_0x3876de[_0x3d83('0x16')],_0x5f485f);_0x9f5b93(_0x37cd94[_0x3d83('0x14')](0x1f4,_0x3876de[_0x3d83('0x16')]));});});};exports[_0x3d83('0x24')]=function(_0x273deb){var _0x3af764=this;return new Promise(function(_0x23be39,_0x2172a3){var _0xc253ab={'body':_0x273deb[_0x3d83('0x25')],'channel':_0x3d83('0x26')};var _0x5c7522=_[_0x3d83('0x27')](_[_0x3d83('0x28')](db[_0x3d83('0x29')]['rawAttributes']),[_0x3d83('0x2a'),_0x3d83('0x2b'),_0x3d83('0x2c'),'ListId']);var _0x533566=![];if(_0x273deb['body']['id']){delete _0x273deb[_0x3d83('0x25')]['id'];}if(_[_0x3d83('0x2d')](_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')])){return _0x2172a3(_0x3af764['error'](0x1f4,_0x3d83('0x2f')));}if(_[_0x3d83('0x2d')](_0x273deb[_0x3d83('0x25')][_0x3d83('0x25')])||_0x273deb[_0x3d83('0x25')]['body']===''){return _0x2172a3(_0x3af764['error'](0x1f4,_0x3d83('0x30')));}if(_['isNil'](_0x273deb[_0x3d83('0x25')][_0x3d83('0x31')])){return _0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,_0x3d83('0x32')+_0x5c7522));}if(!_[_0x3d83('0x33')](_0x5c7522,_0x273deb[_0x3d83('0x25')]['mapKey'])){return _0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c7522));}var _0x2e8d3d={};_0x2e8d3d[_0x273deb[_0x3d83('0x25')][_0x3d83('0x31')]]=_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')];return db[_0x3d83('0x21')][_0x3d83('0x22')]({'where':{'id':_0x273deb[_0x3d83('0x34')]['id']},'include':[{'model':db[_0x3d83('0x35')],'as':_0x3d83('0x36'),'include':[{'model':db[_0x3d83('0x29')],'as':_0x3d83('0x37'),'where':_0x2e8d3d,'limit':0x1,'order':[[_0x3d83('0x2b'),'DESC']]}]},{'model':db[_0x3d83('0x38')],'as':_0x3d83('0x39')},{'model':db[_0x3d83('0x3a')],'as':_0x3d83('0x3b')}]})[_0x3d83('0xf')](function(_0x1ba538){if(_0x1ba538&&_0x1ba538[_0x3d83('0x36')]){var _0x175c08=_0x1ba538[_0x3d83('0x3c')]({'plain':!![]});_0xc253ab['account']=_['omit'](_0x175c08,[_0x3d83('0x39'),_0x3d83('0x36')]);_0xc253ab[_0x3d83('0x3d')]=_0x175c08[_0x3d83('0x39')];_0xc253ab[_0x3d83('0x3e')]=_0x175c08[_0x3d83('0x36')];_0xc253ab[_0x3d83('0x3d')]=_[_0x3d83('0x3f')](_0xc253ab[_0x3d83('0x3d')],[_0x3d83('0x40')],[_0x3d83('0x41')]);if(_0xc253ab[_0x3d83('0x34')]&&_0xc253ab[_0x3d83('0x34')][_0x3d83('0x42')]){_0xc253ab[_0x3d83('0x3d')][_0x3d83('0x43')]({'id':0x0,'priority':_0xc253ab[_0x3d83('0x3d')][_0x3d83('0x44')]+0x1,'app':_0x3d83('0x45'),'appdata':'autoclose','interval':_0x3d83('0x46')});}if(_0xc253ab['account'][_0x3d83('0x39')]){delete _0xc253ab[_0x3d83('0x34')][_0x3d83('0x39')];}if(_0xc253ab[_0x3d83('0x34')][_0x3d83('0x36')]){delete _0xc253ab['account'][_0x3d83('0x36')];}if(_0x175c08[_0x3d83('0x36')][_0x3d83('0x37')][_0x3d83('0x44')]){return _0x175c08[_0x3d83('0x36')][_0x3d83('0x37')][0x0];}var _0x5828c5=_[_0x3d83('0xb')](_0x273deb[_0x3d83('0x25')],{'firstName':_0x273deb[_0x3d83('0x25')]['from'],'ListId':_0x175c08['ListId']});_0x5828c5[_0x273deb[_0x3d83('0x25')]['mapKey']]=_0x273deb[_0x3d83('0x25')][_0x3d83('0x2e')];return db[_0x3d83('0x29')][_0x3d83('0x47')](_0x5828c5);}else{throw new Error(_0x3d83('0x48'));}})[_0x3d83('0xf')](function(_0x1a4fb8){_0xc253ab[_0x3d83('0x49')]=_0x1a4fb8;if(_0x1a4fb8){if(!_0x273deb['body']['message'][_0x3d83('0x4a')]){_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['messageId']=rs[_0x3d83('0x4b')]()+'\x20'+_0x273deb['body'][_0x3d83('0x16')]['from'];}var _0x216f61={'ContactId':_0x1a4fb8['id'],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id'],'inReplyTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'to':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x2e')],'cc':_0x273deb[_0x3d83('0x25')]['message']['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x4d')],'lastMsgAt':moment()[_0x3d83('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x3d83('0x4f')][_0x3d83('0x22')]({'where':{'closed':![],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x3d83('0x50'),'attributes':[_0x3d83('0x4a')],'where':{'messageId':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x51')]}}]})[_0x3d83('0xf')](function(_0x4b238e){if(_0x4b238e){return[_0x4b238e,![]];}return db[_0x3d83('0x4f')][_0x3d83('0x47')](_0x216f61)['then'](function(_0x19e018){return[_0x19e018,!![]];});});}else{throw new Error(_0x3d83('0x52'));}})[_0x3d83('0x53')](function(_0x3c120a,_0x5e36b6){if(_0x3c120a){_0x533566=_0x5e36b6;if(!_0x5e36b6){return _0x3c120a[_0x3d83('0x54')]({'inReplyTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'to':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x2e')],'cc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x3c120a[_0x3d83('0x4d')]?_0x3c120a[_0x3d83('0x4d')]:_0x273deb[_0x3d83('0x25')]['message']['attach'],'substatus':null,'substatusAt':moment()['format'](_0x3d83('0x55')),'lastMsgAt':moment()[_0x3d83('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x3c120a;}}})[_0x3d83('0xf')](function(_0x1e580f){_0xc253ab['interaction']=_0x1e580f[_0x3d83('0x3c')]({'plain':!![]});_0xc253ab[_0x3d83('0x56')][_0x3d83('0x57')]=_0x533566;return db['MailMessage'][_0x3d83('0x47')]({'body':_0x273deb[_0x3d83('0x25')]['body'],'MailAccountId':_0x273deb[_0x3d83('0x34')]['id'],'MailInteractionId':_0x1e580f['id'],'direction':'in','ContactId':_0xc253ab[_0x3d83('0x49')]['id'],'messageId':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4a')],'from':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['from'],'to':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['to'],'cc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')]['cc'],'subject':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x4c')],'attach':_0x273deb[_0x3d83('0x25')]['message'][_0x3d83('0x4d')],'Attachments':_0x273deb['body'][_0x3d83('0x16')]['attachments'],'originTo':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x58')],'originCc':_0x273deb['body'][_0x3d83('0x16')][_0x3d83('0x59')],'bcc':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x5a')],'ChatWebsiteId':_0x273deb['body']['message'][_0x3d83('0x5b')]||null,'originChannel':_0x273deb[_0x3d83('0x25')][_0x3d83('0x16')][_0x3d83('0x5c')]||'Email','ChatOfflineMessageId':_0x273deb[_0x3d83('0x25')]['message'][_0x3d83('0x5d')]||null},{'include':[{'model':db['Attachment'],'as':_0x3d83('0x5e')}]});})[_0x3d83('0xf')](function(_0x2f0290){_0xc253ab['message']=_0x2f0290;if(_0xc253ab[_0x3d83('0x56')][_0x3d83('0x5f')]){return db['User'][_0x3d83('0x22')]({'attributes':['id',_0x3d83('0x60')],'where':{'id':_0xc253ab[_0x3d83('0x56')][_0x3d83('0x5f')]}})[_0x3d83('0xf')](function(_0x33e84f){if(_0x33e84f){_0xc253ab[_0x3d83('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d83('0x61'),'appdata':_0x33e84f[_0x3d83('0x60')]+','+(_0xc253ab['account'][_0x3d83('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d83('0x63'),_0x3d83('0x64'),_0xc253ab);});}return respondWithRpcPromise(_0x3d83('0x63'),_0x3d83('0x64'),_0xc253ab);})[_0x3d83('0xf')](function(_0x3476d5){_0x23be39(_0x3476d5);})[_0x3d83('0x17')](function(_0x5d7e63){_0x2172a3(_0x3af764[_0x3d83('0x14')](0x1f4,_0x5d7e63[_0x3d83('0x16')]));});});};
\ No newline at end of file
+var _0x9465=['catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','include','model','find','where','ShowMailAccount','NotifyMailAccount','mail','difference','keys','CmContact','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','Applications','Smtp','get','omit','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','create','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code','MailAccount,\x20%s,\x20%s','message'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9465,0xb4));var _0x5946=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9465[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x5946('0x0'));var util=require(_0x5946('0x1'));var moment=require('moment');var BPromise=require(_0x5946('0x2'));var rs=require(_0x5946('0x3'));var fs=require('fs');var Redis=require(_0x5946('0x4'));var db=require(_0x5946('0x5'))['db'];var utils=require(_0x5946('0x6'));var logger=require(_0x5946('0x7'))(_0x5946('0x8'));var config=require('../../config/environment');var jayson=require(_0x5946('0x9'));var client=jayson[_0x5946('0xa')][_0x5946('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0x5946('0xc')],{'host':_0x5946('0xd'),'port':0x18eb});var socket=require(_0x5946('0xe'))(new Redis(config[_0x5946('0xc')]));require(_0x5946('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d338c,_0x33c5b0,_0x35cb12){return new BPromise(function(_0x59ea9c,_0x2e53b6){return client[_0x5946('0x10')](_0x5d338c,_0x35cb12)[_0x5946('0x11')](function(_0x3bc178){logger[_0x5946('0x12')]('MailAccount,\x20%s,\x20%s',_0x33c5b0,_0x5946('0x13'));logger[_0x5946('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x33c5b0,'request\x20sent',JSON[_0x5946('0x15')](_0x3bc178));if(_0x3bc178[_0x5946('0x16')]){if(_0x3bc178[_0x5946('0x16')][_0x5946('0x17')]===0x1f4){logger[_0x5946('0x16')](_0x5946('0x18'),_0x33c5b0,_0x3bc178[_0x5946('0x16')][_0x5946('0x19')]);return _0x2e53b6(_0x3bc178[_0x5946('0x16')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x33c5b0,_0x3bc178['error'][_0x5946('0x19')]);return _0x59ea9c(_0x3bc178[_0x5946('0x16')][_0x5946('0x19')]);}else{logger['info'](_0x5946('0x18'),_0x33c5b0,_0x5946('0x13'));_0x59ea9c(_0x3bc178['result'][_0x5946('0x19')]);}})[_0x5946('0x1a')](function(_0x2df7b9){logger[_0x5946('0x16')](_0x5946('0x18'),_0x33c5b0,_0x2df7b9);_0x2e53b6(_0x2df7b9);});});}exports[_0x5946('0x1b')]=function(_0x3c38cf){var _0x5dbff9=this;return new Promise(function(_0x5d12a0,_0x517ebd){return db[_0x5946('0x1c')][_0x5946('0x1d')]({'raw':_0x3c38cf[_0x5946('0x1e')]?_0x3c38cf['options'][_0x5946('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c38cf[_0x5946('0x1e')]?_0x3c38cf[_0x5946('0x1e')]['where']||null:null,'attributes':_0x3c38cf[_0x5946('0x1e')]?_0x3c38cf[_0x5946('0x1e')][_0x5946('0x20')]||null:null,'limit':_0x3c38cf[_0x5946('0x1e')]?_0x3c38cf['options'][_0x5946('0x21')]||null:null,'include':_0x3c38cf[_0x5946('0x1e')]?_0x3c38cf[_0x5946('0x1e')]['include']?_[_0x5946('0x22')](_0x3c38cf[_0x5946('0x1e')][_0x5946('0x23')],function(_0x2c088a){return{'model':db[_0x2c088a['model']],'as':_0x2c088a['as'],'attributes':_0x2c088a['attributes'],'include':_0x2c088a[_0x5946('0x23')]?_[_0x5946('0x22')](_0x2c088a[_0x5946('0x23')],function(_0x523db0){return{'model':db[_0x523db0[_0x5946('0x24')]],'as':_0x523db0['as'],'attributes':_0x523db0['attributes'],'include':_0x523db0[_0x5946('0x23')]?_[_0x5946('0x22')](_0x523db0[_0x5946('0x23')],function(_0x54bda8){return{'model':db[_0x54bda8['model']],'as':_0x54bda8['as'],'attributes':_0x54bda8[_0x5946('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5946('0x11')](function(_0x1596cc){logger[_0x5946('0x12')]('GetMailAccount',_0x3c38cf);logger['debug'](_0x5946('0x1b'),_0x3c38cf,JSON['stringify'](_0x1596cc));_0x5d12a0(_0x1596cc);})[_0x5946('0x1a')](function(_0x405a10){logger['error'](_0x5946('0x1b'),_0x405a10[_0x5946('0x19')],_0x3c38cf);_0x517ebd(_0x5dbff9['error'](0x1f4,_0x405a10['message']));});});};exports['ShowMailAccount']=function(_0x59a1c3){var _0x39c3f0=this;return new Promise(function(_0x46e47a,_0x118ca5){return db[_0x5946('0x1c')][_0x5946('0x25')]({'raw':_0x59a1c3[_0x5946('0x1e')]?_0x59a1c3[_0x5946('0x1e')][_0x5946('0x1f')]===undefined?!![]:![]:!![],'where':_0x59a1c3[_0x5946('0x1e')]?_0x59a1c3[_0x5946('0x1e')][_0x5946('0x26')]||null:null,'attributes':_0x59a1c3['options']?_0x59a1c3[_0x5946('0x1e')][_0x5946('0x20')]||null:null,'include':_0x59a1c3[_0x5946('0x1e')]?_0x59a1c3[_0x5946('0x1e')][_0x5946('0x23')]?_['map'](_0x59a1c3[_0x5946('0x1e')]['include'],function(_0x27c5c0){return{'model':db[_0x27c5c0[_0x5946('0x24')]],'as':_0x27c5c0['as'],'attributes':_0x27c5c0[_0x5946('0x20')],'include':_0x27c5c0[_0x5946('0x23')]?_[_0x5946('0x22')](_0x27c5c0[_0x5946('0x23')],function(_0x161073){return{'model':db[_0x161073['model']],'as':_0x161073['as'],'attributes':_0x161073[_0x5946('0x20')],'include':_0x161073[_0x5946('0x23')]?_[_0x5946('0x22')](_0x161073['include'],function(_0x36142c){return{'model':db[_0x36142c[_0x5946('0x24')]],'as':_0x36142c['as'],'attributes':_0x36142c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5946('0x11')](function(_0x36480b){logger[_0x5946('0x12')](_0x5946('0x27'),_0x59a1c3);logger[_0x5946('0x14')](_0x5946('0x27'),_0x59a1c3,JSON[_0x5946('0x15')](_0x36480b));_0x46e47a(_0x36480b);})[_0x5946('0x1a')](function(_0x17cd93){logger[_0x5946('0x16')](_0x5946('0x27'),_0x17cd93[_0x5946('0x19')],_0x59a1c3);_0x118ca5(_0x39c3f0[_0x5946('0x16')](0x1f4,_0x17cd93[_0x5946('0x19')]));});});};exports[_0x5946('0x28')]=function(_0x4a8eb7){var _0x4ffe51=this;return new Promise(function(_0x2e3506,_0x132142){var _0x5562a1={'body':_0x4a8eb7['body'],'channel':_0x5946('0x29')};var _0x2b9f57=_[_0x5946('0x2a')](_[_0x5946('0x2b')](db[_0x5946('0x2c')]['rawAttributes']),['createdAt',_0x5946('0x2d'),'CompanyId',_0x5946('0x2e')]);var _0x476caf=![];if(_0x4a8eb7[_0x5946('0x2f')]['id']){delete _0x4a8eb7[_0x5946('0x2f')]['id'];}if(_[_0x5946('0x30')](_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x31')])){return _0x132142(_0x4ffe51['error'](0x1f4,_0x5946('0x32')));}if(_['isNil'](_0x4a8eb7['body'][_0x5946('0x2f')])||_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x2f')]===''){return _0x132142(_0x4ffe51['error'](0x1f4,_0x5946('0x33')));}if(_[_0x5946('0x30')](_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x34')])){return _0x132142(_0x4ffe51['error'](0x1f4,_0x5946('0x35')+_0x2b9f57));}if(!_[_0x5946('0x36')](_0x2b9f57,_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x34')])){return _0x132142(_0x4ffe51[_0x5946('0x16')](0x1f4,_0x5946('0x37')+_0x2b9f57));}var _0x4be9b9={};_0x4be9b9[_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x34')]]=_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x31')];return db[_0x5946('0x1c')][_0x5946('0x25')]({'where':{'id':_0x4a8eb7[_0x5946('0x38')]['id']},'include':[{'model':db[_0x5946('0x39')],'as':_0x5946('0x3a'),'include':[{'model':db['CmContact'],'as':_0x5946('0x3b'),'where':_0x4be9b9,'limit':0x1,'order':[[_0x5946('0x2d'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x5946('0x3c')},{'model':db['MailServerOut'],'as':_0x5946('0x3d')}]})[_0x5946('0x11')](function(_0x23b14e){if(_0x23b14e&&_0x23b14e[_0x5946('0x3a')]){var _0x43232d=_0x23b14e[_0x5946('0x3e')]({'plain':!![]});_0x5562a1[_0x5946('0x38')]=_[_0x5946('0x3f')](_0x43232d,['Applications',_0x5946('0x3a')]);_0x5562a1[_0x5946('0x40')]=_0x43232d[_0x5946('0x3c')];_0x5562a1['list']=_0x43232d[_0x5946('0x3a')];_0x5562a1[_0x5946('0x40')]=_[_0x5946('0x41')](_0x5562a1[_0x5946('0x40')],[_0x5946('0x42')],['asc']);if(_0x5562a1['account']&&_0x5562a1['account'][_0x5946('0x43')]){_0x5562a1[_0x5946('0x40')][_0x5946('0x44')]({'id':0x0,'priority':_0x5562a1[_0x5946('0x40')][_0x5946('0x45')]+0x1,'app':_0x5946('0x46'),'appdata':'autoclose','interval':_0x5946('0x47')});}if(_0x5562a1['account'][_0x5946('0x3c')]){delete _0x5562a1['account'][_0x5946('0x3c')];}if(_0x5562a1['account'][_0x5946('0x3a')]){delete _0x5562a1[_0x5946('0x38')][_0x5946('0x3a')];}if(_0x43232d[_0x5946('0x3a')][_0x5946('0x3b')][_0x5946('0x45')]){return _0x43232d[_0x5946('0x3a')][_0x5946('0x3b')][0x0];}var _0x11fb0b=_[_0x5946('0x48')](_0x4a8eb7[_0x5946('0x2f')],{'firstName':_0x4a8eb7['body'][_0x5946('0x31')],'ListId':_0x43232d[_0x5946('0x2e')]});_0x11fb0b[_0x4a8eb7[_0x5946('0x2f')]['mapKey']]=_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x31')];return db['CmContact'][_0x5946('0x49')](_0x11fb0b);}else{throw new Error('List\x20not\x20found');}})[_0x5946('0x11')](function(_0x215d03){_0x5562a1['contact']=_0x215d03;if(_0x215d03){if(!_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')]['messageId']){_0x4a8eb7['body'][_0x5946('0x19')][_0x5946('0x4a')]=rs['generate']()+'\x20'+_0x4a8eb7['body'][_0x5946('0x19')][_0x5946('0x31')];}var _0x34e212={'ContactId':_0x215d03['id'],'MailAccountId':_0x4a8eb7['account']['id'],'inReplyTo':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x4a')],'to':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')]['from'],'cc':_0x4a8eb7['body']['message']['cc'],'subject':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x4b')],'attach':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x4c')],'lastMsgAt':moment()[_0x5946('0x4d')](_0x5946('0x4e')),'lastMsgDirection':'in'};return db[_0x5946('0x4f')][_0x5946('0x25')]({'where':{'closed':![],'MailAccountId':_0x4a8eb7[_0x5946('0x38')]['id']},'include':[{'model':db[_0x5946('0x50')],'as':_0x5946('0x51'),'attributes':[_0x5946('0x4a')],'where':{'messageId':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x52')]}}]})[_0x5946('0x11')](function(_0x3c3672){if(_0x3c3672){return[_0x3c3672,![]];}return db[_0x5946('0x4f')][_0x5946('0x49')](_0x34e212)[_0x5946('0x11')](function(_0x537a98){return[_0x537a98,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x5946('0x53')](function(_0x23262a,_0x149161){if(_0x23262a){_0x476caf=_0x149161;if(!_0x149161){return _0x23262a[_0x5946('0x54')]({'inReplyTo':_0x4a8eb7['body'][_0x5946('0x19')][_0x5946('0x4a')],'to':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x31')],'cc':_0x4a8eb7[_0x5946('0x2f')]['message']['cc'],'subject':_0x4a8eb7[_0x5946('0x2f')]['message'][_0x5946('0x4b')],'attach':_0x23262a[_0x5946('0x4c')]?_0x23262a[_0x5946('0x4c')]:_0x4a8eb7[_0x5946('0x2f')]['message'][_0x5946('0x4c')],'substatus':null,'substatusAt':moment()[_0x5946('0x4d')](_0x5946('0x4e')),'lastMsgAt':moment()[_0x5946('0x4d')](_0x5946('0x4e')),'lastMsgDirection':'in'});}else{return _0x23262a;}}})['then'](function(_0x3fd2ba){_0x5562a1[_0x5946('0x55')]=_0x3fd2ba['get']({'plain':!![]});_0x5562a1[_0x5946('0x55')][_0x5946('0x56')]=_0x476caf;return db[_0x5946('0x50')][_0x5946('0x49')]({'body':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x2f')],'MailAccountId':_0x4a8eb7[_0x5946('0x38')]['id'],'MailInteractionId':_0x3fd2ba['id'],'direction':'in','ContactId':_0x5562a1[_0x5946('0x57')]['id'],'messageId':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x4a')],'from':_0x4a8eb7[_0x5946('0x2f')]['message'][_0x5946('0x31')],'to':_0x4a8eb7[_0x5946('0x2f')]['message']['to'],'cc':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')]['cc'],'subject':_0x4a8eb7['body']['message'][_0x5946('0x4b')],'attach':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')]['attach'],'Attachments':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x58')],'originTo':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x59')],'originCc':_0x4a8eb7['body'][_0x5946('0x19')][_0x5946('0x5a')],'bcc':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x5b')],'ChatWebsiteId':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')][_0x5946('0x5c')]||null,'originChannel':_0x4a8eb7['body'][_0x5946('0x19')][_0x5946('0x5d')]||_0x5946('0x5e'),'ChatOfflineMessageId':_0x4a8eb7[_0x5946('0x2f')][_0x5946('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x5946('0x5f')}]});})['then'](function(_0x22dd1a){_0x5562a1['message']=_0x22dd1a;if(_0x5562a1['interaction'][_0x5946('0x60')]){return db[_0x5946('0x61')][_0x5946('0x25')]({'attributes':['id',_0x5946('0x62')],'where':{'id':_0x5562a1[_0x5946('0x55')][_0x5946('0x60')]}})['then'](function(_0x3be98a){if(_0x3be98a){_0x5562a1[_0x5946('0x40')][_0x5946('0x63')]({'id':0x0,'priority':0x0,'app':_0x5946('0x64'),'appdata':_0x3be98a[_0x5946('0x62')]+','+(_0x5562a1[_0x5946('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x5946('0x65'),_0x5946('0x66'),_0x5562a1);});}return respondWithRpcPromise(_0x5946('0x65'),_0x5946('0x66'),_0x5562a1);})[_0x5946('0x11')](function(_0x1e5bdb){_0x2e3506(_0x1e5bdb);})['catch'](function(_0x3f3dfb){_0x132142(_0x4ffe51[_0x5946('0x16')](0x1f4,_0x3f3dfb[_0x5946('0x19')]));});});};
\ No newline at end of file
index 54c5261..4a77b6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ef=['register','length','mailAccount:','./mailAccount.events','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95ef,0x12a));var _0xf95e=function(_0x49a694,_0x4772be){_0x49a694=_0x49a694-0x0;var _0x528a6f=_0x95ef[_0x49a694];return _0x528a6f;};'use strict';var MailAccountEvents=require(_0xf95e('0x0'));var events=['save','remove','update'];function createListener(_0x56dd04,_0x596a11){return function(_0x239cac){_0x596a11[_0xf95e('0x1')](_0x56dd04,_0x239cac);};}function removeListener(_0x679e2a,_0x57ca06){return function(){MailAccountEvents['removeListener'](_0x679e2a,_0x57ca06);};}exports[_0xf95e('0x2')]=function(_0x3e77b4){for(var _0x39457d=0x0,_0x1e492a=events[_0xf95e('0x3')];_0x39457d<_0x1e492a;_0x39457d++){var _0x5dff1f=events[_0x39457d];var _0x538cd1=createListener(_0xf95e('0x4')+_0x5dff1f,_0x3e77b4);MailAccountEvents['on'](_0x5dff1f,_0x538cd1);}};
\ No newline at end of file
+var _0xbdcc=['mailAccount:','./mailAccount.events','remove','update','emit','removeListener','register'];(function(_0x274aba,_0x42f61c){var _0x433f64=function(_0x33f2a4){while(--_0x33f2a4){_0x274aba['push'](_0x274aba['shift']());}};_0x433f64(++_0x42f61c);}(_0xbdcc,0x143));var _0xcbdc=function(_0x11ce95,_0x5eab48){_0x11ce95=_0x11ce95-0x0;var _0x22efda=_0xbdcc[_0x11ce95];return _0x22efda;};'use strict';var MailAccountEvents=require(_0xcbdc('0x0'));var events=['save',_0xcbdc('0x1'),_0xcbdc('0x2')];function createListener(_0x11dab0,_0x1d2711){return function(_0xdbf03f){_0x1d2711[_0xcbdc('0x3')](_0x11dab0,_0xdbf03f);};}function removeListener(_0x6ca54d,_0x461768){return function(){MailAccountEvents[_0xcbdc('0x4')](_0x6ca54d,_0x461768);};}exports[_0xcbdc('0x5')]=function(_0x3b9732){for(var _0x47040b=0x0,_0x9b3657=events['length'];_0x47040b<_0x9b3657;_0x47040b++){var _0x29e915=events[_0x47040b];var _0x518f01=createListener(_0xcbdc('0x6')+_0x29e915,_0x3b9732);MailAccountEvents['on'](_0x29e915,_0x518f01);}};
\ No newline at end of file
index b9d9c93..ef148d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cea=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4cea,0xed));var _0xa4ce=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4cea[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xa4ce('0x0'));var util=require(_0xa4ce('0x1'));var path=require('path');var timeout=require(_0xa4ce('0x2'));var express=require(_0xa4ce('0x3'));var router=express[_0xa4ce('0x4')]();var fs_extra=require(_0xa4ce('0x5'));var auth=require(_0xa4ce('0x6'));var interaction=require(_0xa4ce('0x7'));var config=require('../../config/environment');var controller=require(_0xa4ce('0x8'));router[_0xa4ce('0x9')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0xc')]);router[_0xa4ce('0xd')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0xe')]);router[_0xa4ce('0xf')](_0xa4ce('0xa'),auth[_0xa4ce('0xb')](),controller[_0xa4ce('0x10')]);module[_0xa4ce('0x11')]=router;
\ No newline at end of file
+var _0x653a=['destroy','exports','multer','util','connect-timeout','fs-extra','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete'];(function(_0xa3ced0,_0x298c99){var _0x5c36af=function(_0xd6f738){while(--_0xd6f738){_0xa3ced0['push'](_0xa3ced0['shift']());}};_0x5c36af(++_0x298c99);}(_0x653a,0x136));var _0xa653=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x653a[_0x3c04ef];return _0x6a3a69;};'use strict';var multer=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var path=require('path');var timeout=require(_0xa653('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa653('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa653('0x4'));router[_0xa653('0x5')](_0xa653('0x6'),auth[_0xa653('0x7')](),controller[_0xa653('0x8')]);router[_0xa653('0x9')](_0xa653('0x6'),auth[_0xa653('0x7')](),controller[_0xa653('0xa')]);router[_0xa653('0xb')](_0xa653('0x6'),auth[_0xa653('0x7')](),controller[_0xa653('0xc')]);module[_0xa653('0xd')]=router;
\ No newline at end of file
index 01ff01e..856d12c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9695=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0xf13ca6,_0x5735ea){var _0x4a4387=function(_0x103f67){while(--_0x103f67){_0xf13ca6['push'](_0xf13ca6['shift']());}};_0x4a4387(++_0x5735ea);}(_0x9695,0x1b5));var _0x5969=function(_0x2a8b5a,_0x1988d0){_0x2a8b5a=_0x2a8b5a-0x0;var _0x21fa39=_0x9695[_0x2a8b5a];return _0x21fa39;};'use strict';var Sequelize=require(_0x5969('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5969('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5969('0x2')},'appdata':{'type':Sequelize[_0x5969('0x3')]()},'description':{'type':Sequelize[_0x5969('0x4')]},'interval':{'type':Sequelize[_0x5969('0x4')],'defaultValue':_0x5969('0x5')}};
\ No newline at end of file
+var _0x3db6=['TEXT','STRING','*,*,*,*','sequelize','noop'];(function(_0x2b0757,_0x3d8707){var _0x32ca61=function(_0x7348dd){while(--_0x7348dd){_0x2b0757['push'](_0x2b0757['shift']());}};_0x32ca61(++_0x3d8707);}(_0x3db6,0x1ca));var _0x63db=function(_0x1ba347,_0x2f65e2){_0x1ba347=_0x1ba347-0x0;var _0x45c4d1=_0x3db6[_0x1ba347];return _0x45c4d1;};'use strict';var Sequelize=require(_0x63db('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x63db('0x1')},'appdata':{'type':Sequelize[_0x63db('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x63db('0x3')],'defaultValue':_0x63db('0x4')}};
\ No newline at end of file
index bca2bff..1e0e6f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x58c554,_0x53d40d){var _0x56489f=function(_0x1e5840){while(--_0x1e5840){_0x58c554['push'](_0x58c554['shift']());}};_0x56489f(++_0x53d40d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));};
\ No newline at end of file
+var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x2a408c,_0x343b60){var _0x3eb33c=function(_0x3bee00){while(--_0x3bee00){_0x2a408c['push'](_0x2a408c['shift']());}};_0x3eb33c(++_0x343b60);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20cc29,_0x30a46d){_0x20cc29=_0x20cc29-0x0;var _0x28d513=_0xcb91[_0x20cc29];return _0x28d513;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));};
\ No newline at end of file
index 4b237b4..5594776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x539b=['request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x50a634,_0x16fc3b){var _0x30b238=function(_0x2d19c2){while(--_0x2d19c2){_0x50a634['push'](_0x50a634['shift']());}};_0x30b238(++_0x16fc3b);}(_0x539b,0x99));var _0xb539=function(_0x36c189,_0x3822be){_0x36c189=_0x36c189-0x0;var _0x21f4b4=_0x539b[_0x36c189];return _0x21f4b4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb539('0x0'));var moment=require(_0xb539('0x1'));var BPromise=require(_0xb539('0x2'));var rp=require(_0xb539('0x3'));var fs=require('fs');var path=require(_0xb539('0x4'));var rimraf=require('rimraf');var config=require(_0xb539('0x5'));var attributes=require(_0xb539('0x6'));module[_0xb539('0x7')]=function(_0x42ca29,_0x6603e3){return _0x42ca29[_0xb539('0x8')](_0xb539('0x9'),attributes,{'tableName':_0xb539('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb539('0xb')});};
\ No newline at end of file
+var _0x9c19=['moment','request-promise','rimraf','./mailApplication.attributes','exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x40edbb,_0x4b8e85){var _0x1c34e1=function(_0x4cb6dc){while(--_0x4cb6dc){_0x40edbb['push'](_0x40edbb['shift']());}};_0x1c34e1(++_0x4b8e85);}(_0x9c19,0x170));var _0x99c1=function(_0x483657,_0x4c9172){_0x483657=_0x483657-0x0;var _0xe9877c=_0x9c19[_0x483657];return _0xe9877c;};'use strict';var _=require(_0x99c1('0x0'));var util=require(_0x99c1('0x1'));var logger=require(_0x99c1('0x2'))(_0x99c1('0x3'));var moment=require(_0x99c1('0x4'));var BPromise=require('bluebird');var rp=require(_0x99c1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x99c1('0x7'));module[_0x99c1('0x8')]=function(_0x39b7c3,_0x4c4f4c){return _0x39b7c3['define']('MailApplication',attributes,{'tableName':_0x99c1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99c1('0xa'),'collate':_0x99c1('0xb')});};
\ No newline at end of file
index 4e3cc61..3d23d4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe240=['result','catch','UpdateMailApplication','update','options','raw','attributes','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x10aa96,_0x45815b){var _0x529cfc=function(_0x657e04){while(--_0x657e04){_0x10aa96['push'](_0x10aa96['shift']());}};_0x529cfc(++_0x45815b);}(_0xe240,0xa3));var _0x0e24=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe240[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0e24('0x0'));var util=require('util');var moment=require(_0x0e24('0x1'));var BPromise=require('bluebird');var rs=require(_0x0e24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e24('0x3'))['db'];var utils=require(_0x0e24('0x4'));var logger=require(_0x0e24('0x5'))(_0x0e24('0x6'));var config=require(_0x0e24('0x7'));var jayson=require(_0x0e24('0x8'));var client=jayson['client'][_0x0e24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfbc0df,_0x12eadc,_0x5005b9){return new BPromise(function(_0x11cebb,_0x440fdd){return client['request'](_0xfbc0df,_0x5005b9)[_0x0e24('0xa')](function(_0x1d824f){logger[_0x0e24('0xb')](_0x0e24('0xc'),_0x12eadc,_0x0e24('0xd'));logger[_0x0e24('0xe')](_0x0e24('0xf'),_0x12eadc,_0x0e24('0xd'),JSON[_0x0e24('0x10')](_0x1d824f));if(_0x1d824f['error']){if(_0x1d824f[_0x0e24('0x11')]['code']===0x1f4){logger[_0x0e24('0x11')]('MailApplication,\x20%s,\x20%s',_0x12eadc,_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);return _0x440fdd(_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);}logger[_0x0e24('0x11')](_0x0e24('0xc'),_0x12eadc,_0x1d824f[_0x0e24('0x11')][_0x0e24('0x12')]);return _0x11cebb(_0x1d824f[_0x0e24('0x11')]['message']);}else{logger[_0x0e24('0xb')](_0x0e24('0xc'),_0x12eadc,_0x0e24('0xd'));_0x11cebb(_0x1d824f[_0x0e24('0x13')]['message']);}})[_0x0e24('0x14')](function(_0x3196df){logger['error'](_0x0e24('0xc'),_0x12eadc,_0x3196df);_0x440fdd(_0x3196df);});});}exports[_0x0e24('0x15')]=function(_0x4222fe){var _0x2adb79=this;return new Promise(function(_0x1d99f1,_0x27ed3b){return db['MailApplication'][_0x0e24('0x16')](_0x4222fe['body'],{'raw':_0x4222fe[_0x0e24('0x17')]?_0x4222fe[_0x0e24('0x17')][_0x0e24('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4222fe[_0x0e24('0x17')]?_0x4222fe['options']['where']||null:null,'attributes':_0x4222fe[_0x0e24('0x17')]?_0x4222fe['options'][_0x0e24('0x19')]||null:null,'limit':_0x4222fe['options']?_0x4222fe[_0x0e24('0x17')]['limit']||null:null})[_0x0e24('0xa')](function(_0x36f007){logger['info'](_0x0e24('0x15'),_0x4222fe);logger['debug'](_0x0e24('0x15'),_0x4222fe,JSON[_0x0e24('0x10')](_0x36f007));_0x1d99f1(_0x36f007);})[_0x0e24('0x14')](function(_0x25f9a6){logger[_0x0e24('0x11')](_0x0e24('0x15'),_0x25f9a6[_0x0e24('0x12')],_0x4222fe);_0x27ed3b(_0x2adb79[_0x0e24('0x11')](0x1f4,_0x25f9a6[_0x0e24('0x12')]));});});};
\ No newline at end of file
+var _0x9e8d=['MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','debug','lodash','moment','randomstring','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x9e8d,0x197));var _0xd9e8=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x9e8d[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xd9e8('0x0'));var util=require('util');var moment=require(_0xd9e8('0x1'));var BPromise=require('bluebird');var rs=require(_0xd9e8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9e8('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd9e8('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd9e8('0x5')][_0xd9e8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x36d953,_0x28f22f,_0x1f7fbf){return new BPromise(function(_0x13e234,_0x197937){return client[_0xd9e8('0x7')](_0x36d953,_0x1f7fbf)[_0xd9e8('0x8')](function(_0x921de0){logger['info'](_0xd9e8('0x9'),_0x28f22f,_0xd9e8('0xa'));logger['debug'](_0xd9e8('0xb'),_0x28f22f,_0xd9e8('0xa'),JSON[_0xd9e8('0xc')](_0x921de0));if(_0x921de0[_0xd9e8('0xd')]){if(_0x921de0[_0xd9e8('0xd')][_0xd9e8('0xe')]===0x1f4){logger[_0xd9e8('0xd')](_0xd9e8('0x9'),_0x28f22f,_0x921de0[_0xd9e8('0xd')][_0xd9e8('0xf')]);return _0x197937(_0x921de0[_0xd9e8('0xd')][_0xd9e8('0xf')]);}logger[_0xd9e8('0xd')](_0xd9e8('0x9'),_0x28f22f,_0x921de0[_0xd9e8('0xd')][_0xd9e8('0xf')]);return _0x13e234(_0x921de0[_0xd9e8('0xd')][_0xd9e8('0xf')]);}else{logger[_0xd9e8('0x10')](_0xd9e8('0x9'),_0x28f22f,_0xd9e8('0xa'));_0x13e234(_0x921de0['result']['message']);}})[_0xd9e8('0x11')](function(_0x2ecc09){logger[_0xd9e8('0xd')]('MailApplication,\x20%s,\x20%s',_0x28f22f,_0x2ecc09);_0x197937(_0x2ecc09);});});}exports[_0xd9e8('0x12')]=function(_0x5c7700){var _0x5c5ac2=this;return new Promise(function(_0x4db180,_0x5b8046){return db[_0xd9e8('0x13')][_0xd9e8('0x14')](_0x5c7700[_0xd9e8('0x15')],{'raw':_0x5c7700[_0xd9e8('0x16')]?_0x5c7700[_0xd9e8('0x16')][_0xd9e8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c7700[_0xd9e8('0x16')]?_0x5c7700[_0xd9e8('0x16')][_0xd9e8('0x18')]||null:null,'attributes':_0x5c7700[_0xd9e8('0x16')]?_0x5c7700['options']['attributes']||null:null,'limit':_0x5c7700[_0xd9e8('0x16')]?_0x5c7700[_0xd9e8('0x16')]['limit']||null:null})[_0xd9e8('0x8')](function(_0x4e7e68){logger[_0xd9e8('0x10')](_0xd9e8('0x12'),_0x5c7700);logger[_0xd9e8('0x19')]('UpdateMailApplication',_0x5c7700,JSON['stringify'](_0x4e7e68));_0x4db180(_0x4e7e68);})[_0xd9e8('0x11')](function(_0x1ab777){logger['error'](_0xd9e8('0x12'),_0x1ab777['message'],_0x5c7700);_0x5b8046(_0x5c5ac2['error'](0x1f4,_0x1ab777['message']));});});};
\ No newline at end of file
index 2dc3dbb..9423f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6042=['mailinteraction:addtags','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','mail'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6042,0x7d));var _0x2604=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6042[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x2604('0x0'));var router=express[_0x2604('0x1')]();var auth=require(_0x2604('0x2'));var interaction=require(_0x2604('0x3'));var controller=require(_0x2604('0x4'));router['get']('/',auth[_0x2604('0x5')](),controller[_0x2604('0x6')]);router['get'](_0x2604('0x7'),auth[_0x2604('0x5')](),controller[_0x2604('0x8')]);router[_0x2604('0x9')](_0x2604('0xa'),auth[_0x2604('0x5')](),controller[_0x2604('0xb')]);router[_0x2604('0x9')](_0x2604('0xc'),auth[_0x2604('0x5')](),controller[_0x2604('0xd')]);router[_0x2604('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x2604('0xe')]);router[_0x2604('0xf')]('/',auth[_0x2604('0x5')](),controller['create']);router[_0x2604('0xf')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2604('0x10')]);router[_0x2604('0xf')](_0x2604('0x11'),auth[_0x2604('0x5')](),interaction[_0x2604('0x12')](_0x2604('0x13'),_0x2604('0x14')),controller[_0x2604('0x15')]);router[_0x2604('0x16')](_0x2604('0xa'),auth[_0x2604('0x5')](),interaction[_0x2604('0x12')](_0x2604('0x13'),_0x2604('0x17')),controller['update']);router[_0x2604('0x18')](_0x2604('0xa'),auth[_0x2604('0x5')](),interaction['tracked'](_0x2604('0x13'),_0x2604('0x19')),controller[_0x2604('0x1a')]);router['delete'](_0x2604('0x11'),auth[_0x2604('0x5')](),controller[_0x2604('0x1b')]);module[_0x2604('0x1c')]=router;
\ No newline at end of file
+var _0x7ce9=['Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','getMessages','download','post','create','/:id/messages','tracked','mail','mailinteraction:update','delete','mailinteraction:destroy','/:id/tags'];(function(_0x249f91,_0x5ce306){var _0x5bbf70=function(_0x1d1370){while(--_0x1d1370){_0x249f91['push'](_0x249f91['shift']());}};_0x5bbf70(++_0x5ce306);}(_0x7ce9,0x17c));var _0x97ce=function(_0x36da00,_0x5b533b){_0x36da00=_0x36da00-0x0;var _0x4b72c5=_0x7ce9[_0x36da00];return _0x4b72c5;};'use strict';var express=require('express');var router=express[_0x97ce('0x0')]();var auth=require(_0x97ce('0x1'));var interaction=require(_0x97ce('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth[_0x97ce('0x3')](),controller[_0x97ce('0x4')]);router[_0x97ce('0x5')](_0x97ce('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x97ce('0x5')](_0x97ce('0x7'),auth[_0x97ce('0x3')](),controller['show']);router['get']('/:id/messages',auth[_0x97ce('0x3')](),controller[_0x97ce('0x8')]);router[_0x97ce('0x5')]('/:id/download',auth['isAuthenticated'](),controller[_0x97ce('0x9')]);router[_0x97ce('0xa')]('/',auth[_0x97ce('0x3')](),controller[_0x97ce('0xb')]);router['post'](_0x97ce('0xc'),auth[_0x97ce('0x3')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x97ce('0xd')](_0x97ce('0xe'),'mailinteraction:addtags'),controller['addTags']);router['put'](_0x97ce('0x7'),auth[_0x97ce('0x3')](),interaction['tracked'](_0x97ce('0xe'),_0x97ce('0xf')),controller['update']);router[_0x97ce('0x10')](_0x97ce('0x7'),auth['isAuthenticated'](),interaction[_0x97ce('0xd')](_0x97ce('0xe'),_0x97ce('0x11')),controller['destroy']);router[_0x97ce('0x10')](_0x97ce('0x12'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 7ab6ef9..6686121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff39=['ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x11b1b3,_0x467ad5){var _0x521a55=function(_0x56d106){while(--_0x56d106){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x521a55(++_0x467ad5);}(_0xff39,0xba));var _0x9ff3=function(_0xe86041,_0x2fbd7b){_0xe86041=_0xe86041-0x0;var _0x1230a9=_0xff39[_0xe86041];return _0x1230a9;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x9ff3('0x0'));module[_0x9ff3('0x1')]={'closed':{'type':Sequelize[_0x9ff3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ff3('0x3')]},'disposition':{'type':Sequelize[_0x9ff3('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9ff3('0x4')]},'note':{'type':Sequelize[_0x9ff3('0x4')]},'inReplyTo':{'type':Sequelize[_0x9ff3('0x4')](0x1fe)},'to':{'type':Sequelize[_0x9ff3('0x4')]},'cc':{'type':Sequelize[_0x9ff3('0x5')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x9ff3('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x9ff3('0x3')]},'substatus':{'type':Sequelize[_0x9ff3('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9ff3('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9ff3('0x6')]('in',_0x9ff3('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xf2c0=['DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','long'];(function(_0x374937,_0x590b55){var _0x6d4936=function(_0xcb5246){while(--_0xcb5246){_0x374937['push'](_0x374937['shift']());}};_0x6d4936(++_0x590b55);}(_0xf2c0,0xc0));var _0x0f2c=function(_0x17aac3,_0x5d6f27){_0x17aac3=_0x17aac3-0x0;var _0x450397=_0xf2c0[_0x17aac3];return _0x450397;};'use strict';var Sequelize=require(_0x0f2c('0x0'));var iconv=require(_0x0f2c('0x1'));module[_0x0f2c('0x2')]={'closed':{'type':Sequelize[_0x0f2c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0f2c('0x4')]},'secondDisposition':{'type':Sequelize[_0x0f2c('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0f2c('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x0f2c('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x0f2c('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x0f2c('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f2c('0x6')]},'substatus':{'type':Sequelize[_0x0f2c('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0f2c('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x0f2c('0x7')]('in',_0x0f2c('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f2c('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x0f2c('0x7')]('in',_0x0f2c('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0f2c('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 6d09450..3864832 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13c3=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','end','Tag','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','start','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','Sequelize','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.MailAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','create','body','describe','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','options','inlineCss','setTags','spread','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','get','mkdirSync','headers','Bcc','basename','build','message%d.eml','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','limit','Content-Range','json','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','select','field','color','from','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x13c3,0x164));var _0x313c=function(_0x1986fd,_0x50ecff){_0x1986fd=_0x1986fd-0x0;var _0x2dd9a4=_0x13c3[_0x1986fd];return _0x2dd9a4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x313c('0x0'));var moment=require(_0x313c('0x1'));var BPromise=require(_0x313c('0x2'));var util=require(_0x313c('0x3'));var path=require(_0x313c('0x4'));var fs=require('fs');var _=require(_0x313c('0x5'));var squel=require(_0x313c('0x6'));var juice=require(_0x313c('0x7'));var Redis=require('ioredis');var qs=require(_0x313c('0x8'));var as=require(_0x313c('0x9'));var logger=require(_0x313c('0xa'))(_0x313c('0xb'));var config=require('../../config/environment');var db=require(_0x313c('0xc'))['db'];var htmlEntities=require(_0x313c('0xd'));config[_0x313c('0xe')]=_[_0x313c('0xf')](config[_0x313c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x313c('0x10'))(new Redis(config[_0x313c('0xe')]));require(_0x313c('0x11'))[_0x313c('0x12')](socket);function respondWithStatusCode(_0x19b63f,_0x280667){_0x280667=_0x280667||0xcc;return function(_0x547ce4){if(_0x547ce4){return _0x19b63f[_0x313c('0x13')](_0x280667);}return _0x19b63f[_0x313c('0x14')](_0x280667)['end']();};}function respondWithResult(_0x5da43e,_0x6778c1){_0x6778c1=_0x6778c1||0xc8;return function(_0x44c7e8){if(_0x44c7e8){return _0x5da43e[_0x313c('0x14')](_0x6778c1)['json'](_0x44c7e8);}};}function respondWithFilteredResult(_0x313330,_0x3675af){return function(_0x2ce04f){if(_0x2ce04f){var _0x145de1=typeof _0x3675af[_0x313c('0x15')]==='undefined'&&typeof _0x3675af[_0x313c('0x16')]==='undefined';var _0x5e34d9=_0x2ce04f['count'];var _0x55aeb1=_0x145de1?0x0:_0x3675af['offset'];var _0x39ceef=_0x145de1?_0x2ce04f['count']:_0x3675af[_0x313c('0x15')]+_0x3675af[_0x313c('0x16')];var _0x2dc539;if(_0x39ceef>=_0x5e34d9){_0x39ceef=_0x5e34d9;_0x2dc539=0xc8;}else{_0x2dc539=0xce;}_0x313330[_0x313c('0x14')](_0x2dc539);return _0x313330['set'](_0x313c('0x17'),_0x55aeb1+'-'+_0x39ceef+'/'+_0x5e34d9)[_0x313c('0x18')](_0x2ce04f);}return null;};}function saveUpdates(_0x4c7d04){return function(_0x2b171b){if(_0x2b171b){return _0x2b171b[_0x313c('0x19')](_0x4c7d04)[_0x313c('0x1a')](function(_0x8ffc6a){return _0x8ffc6a;});}return null;};}function removeEntity(_0x1c9238){return function(_0x114f6a){if(_0x114f6a){return _0x114f6a[_0x313c('0x1b')]()['then'](function(){_0x1c9238[_0x313c('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x758699){return function(_0x500845){if(!_0x500845){_0x758699['sendStatus'](0x194);}return _0x500845;};}function handleError(_0x553f7f,_0x128572){_0x128572=_0x128572||0x1f4;return function(_0x18a6cb){logger[_0x313c('0x1c')](_0x18a6cb[_0x313c('0x1d')]);if(_0x18a6cb[_0x313c('0x1e')]){delete _0x18a6cb[_0x313c('0x1e')];}_0x553f7f[_0x313c('0x14')](_0x128572)[_0x313c('0x1f')](_0x18a6cb);};}function getInteractionUsers(_0x2db025,_0x45f162){return new BPromise(function(_0x327a2f,_0x1fd8c5){try{if(_0x45f162[_0x2db025['id']]){_0x2db025[_0x313c('0x20')]=_[_0x313c('0x21')](_0x45f162[_0x2db025['id']],function(_0x3d84b6){return{'id':_0x3d84b6['id'],'fullname':_0x3d84b6[_0x313c('0x22')]};});}}catch(_0x30a33c){_0x1fd8c5(_0x30a33c);}_0x327a2f(_0x2db025);});}function getInteractionTags(_0x32243f,_0x536c06){return new BPromise(function(_0x533087,_0x272880){try{if(_0x32243f[_0x313c('0x23')]){_0x32243f[_0x313c('0x24')]=[];_0x32243f[_0x313c('0x23')][_0x313c('0x25')](',')[_0x313c('0x26')](function(_0x1e9fc7){_0x32243f[_0x313c('0x24')][_0x313c('0x27')](_0x536c06[_0x1e9fc7]);});}delete _0x32243f[_0x313c('0x23')];}catch(_0x2c6372){_0x272880(_0x2c6372);}_0x533087(_0x32243f);});}function getLastMessageText(_0x313441){return new BPromise(function(_0x298500,_0x12b425){return db[_0x313c('0x28')][_0x313c('0x29')]({'where':{'$and':[{'MailInteractionId':_0x313441['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x313c('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x313c('0x2b')],'order':_0x313c('0x2c'),'raw':!![]})[_0x313c('0x1a')](function(_0x4e8c2f){if(_0x4e8c2f&&_0x4e8c2f[_0x313c('0x2b')]){_0x313441[_0x313c('0x2d')]=_[_0x313c('0x2e')](_0x4e8c2f['plainBody']);}_0x298500(_0x313441);})['catch'](function(_0x59ede7){_0x12b425(_0x59ede7);});});}function updateMailInteraction(_0x299448,_0x408693,_0x3c68fc,_0x529662){return new BPromise(function(_0x513cd7,_0x1c5862){return getInteractionUsers(_0x299448,_0x3c68fc)[_0x313c('0x1a')](function(_0x24270b){return getInteractionTags(_0x24270b,_0x408693);})[_0x313c('0x1a')](function(_0x3d41ed){if(_0x529662){_0x513cd7(getLastMessageText(_0x3d41ed));}else{_0x513cd7(_0x3d41ed);}})[_0x313c('0x2f')](function(_0x585683){_0x1c5862(_0x585683);});});}exports[_0x313c('0x30')]=function(_0xfa6c22,_0x4553ec){var _0xea8c02={},_0x5beb34={},_0x500aef={'count':0x0,'rows':[]};var _0x9f7e4=_[_0x313c('0x21')](db[_0x313c('0x31')][_0x313c('0x32')],function(_0x1fad27){return{'name':_0x1fad27[_0x313c('0x33')],'type':_0x1fad27[_0x313c('0x34')]['key']};});_0x5beb34[_0x313c('0x35')]=_[_0x313c('0x21')](_0x9f7e4,_0x313c('0x1e'));_0x5beb34[_0x313c('0x36')]=_[_0x313c('0x37')](_0xfa6c22[_0x313c('0x36')]);_0x5beb34[_0x313c('0x38')]=_[_0x313c('0x39')](_0x5beb34[_0x313c('0x35')],_0x5beb34[_0x313c('0x36')]);_0xea8c02['attributes']=_[_0x313c('0x39')](_0x5beb34['model'],qs[_0x313c('0x3a')](_0xfa6c22['query'][_0x313c('0x3a')]));_0xea8c02[_0x313c('0x3b')]=_0xea8c02[_0x313c('0x3b')][_0x313c('0x3c')]?_0xea8c02[_0x313c('0x3b')]:_0x5beb34[_0x313c('0x35')];if(!_0xfa6c22[_0x313c('0x36')][_0x313c('0x3d')]('nolimit')){_0xea8c02[_0x313c('0x16')]=qs[_0x313c('0x16')](_0xfa6c22[_0x313c('0x36')][_0x313c('0x16')]);_0xea8c02[_0x313c('0x15')]=qs['offset'](_0xfa6c22['query'][_0x313c('0x15')]);}_0xea8c02['order']=qs[_0x313c('0x3e')](_0xfa6c22[_0x313c('0x36')][_0x313c('0x3e')]);_0xea8c02['where']=qs[_0x313c('0x38')](_[_0x313c('0x3f')](_0xfa6c22[_0x313c('0x36')],_0x5beb34['filters']),_0x9f7e4);var _0x8082dd=[];var _0x3832d9=squel[_0x313c('0x40')]()[_0x313c('0x41')]('id')[_0x313c('0x41')](_0x313c('0x1e'))[_0x313c('0x41')](_0x313c('0x42'))[_0x313c('0x43')]('tools_tags');var _0x15a83c=squel['select']()[_0x313c('0x41')](_0x313c('0x44'))[_0x313c('0x41')]('u.fullname')[_0x313c('0x41')](_0x313c('0x45'))['from'](_0x313c('0x46'),'ui')[_0x313c('0x47')](_0x313c('0x48'),'u','u.id\x20=\x20ui.UserId');var _0x54f289=squel[_0x313c('0x40')]()[_0x313c('0x43')](_0x313c('0x49'),'i')[_0x313c('0x47')](_0x313c('0x4a'),'c',_0x313c('0x4b'))['left_join'](_0x313c('0x48'),'o',_0x313c('0x4c'))['left_join'](_0x313c('0x4d'),'a',_0x313c('0x4e'))['left_join'](_0x313c('0x4f'),'me','me.MailInteractionId\x20=\x20i.id')[_0x313c('0x47')](_0x313c('0x50'),'it',_0x313c('0x51'))[_0x313c('0x47')]('tools_tags','t',_0x313c('0x52'));var _0x104160=squel['expr']();var _0x330962=[];var _0x48079c=squel[_0x313c('0x53')]();var _0x3646ac;if(_0xfa6c22['query'][_0x313c('0x54')]){_0x3646ac=as['parseSearch'](_0xfa6c22[_0x313c('0x36')][_0x313c('0x54')]);var _0xa9621c=_0x3646ac[_0x313c('0x55')];for(var _0x32e265=0x0;_0x32e265<_0x3646ac[_0x313c('0x56')][_0x313c('0x3c')];_0x32e265++){var _0x230a35=_0x3646ac[_0x313c('0x56')][_0x32e265];var _0x792460='i';var _0xd0d23e=_['find'](_0x9f7e4,['name',_0x230a35['field']]);if(!_0xd0d23e){switch(_0x230a35[_0x313c('0x41')]){case _0x313c('0x57'):if(_0x230a35[_0x313c('0x58')]==0x1){_0x54f289['having']('`'+_0x230a35[_0x313c('0x41')]+_0x313c('0x59'));}else{_0x54f289['having']('`'+_0x230a35[_0x313c('0x41')]+_0x313c('0x5a'));}break;case _0x313c('0x5b'):if(_0x230a35[_0x313c('0x5c')]===_0x313c('0x5d')){if(_0x230a35[_0x313c('0x58')][_0x313c('0x25')]('\x20')[_0x313c('0x3c')]>0x1){_0x104160[_0xa9621c](_0x313c('0x5e'),qs['getFullTextValue'](_0x230a35['value']),null);}else{var _0x1514cf='%'+_0x230a35[_0x313c('0x58')]+'%';_0x104160[_0xa9621c](_0x313c('0x5f'),_0x1514cf,_0x1514cf,_0x1514cf);}}else{_0xd0d23e=_[_0x313c('0x60')](_0x9f7e4,[_0x313c('0x1e'),_0x313c('0x61')]);_0x230a35[_0x313c('0x41')]=_0x313c('0x61');_0x1294cf=as['buildExpression'](_0x792460,_0xd0d23e['type'],_0x230a35);_0x104160[_0xa9621c](_0x1294cf[_0x313c('0x62')],_0x1294cf['value']['start'],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);}break;case _0x313c('0x64'):var _0x3cba31=_0x230a35[_0x313c('0x58')][_0x313c('0x25')](',')[_0x313c('0x21')](function(_0x25572d){return Number(_0x25572d);});_0x3cba31['forEach'](function(_0xbdc215){_0x48079c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbdc215+',%');});_0x330962=_[_0x313c('0x65')](_0x330962,_0x3cba31);break;case'User':if(_0x230a35[_0x313c('0x5c')]==='$substring'){_0x104160[_0xa9621c](_0x313c('0x66'),'%'+_0x230a35[_0x313c('0x58')]+'%',null);}else{_0xd0d23e=_[_0x313c('0x60')](_0x9f7e4,[_0x313c('0x1e'),_0x313c('0x67')]);_0x230a35[_0x313c('0x41')]=_0x313c('0x67');_0x1294cf=as[_0x313c('0x68')](_0x792460,_0xd0d23e[_0x313c('0x34')],_0x230a35);_0x104160[_0xa9621c](_0x1294cf['text'],_0x1294cf['value'][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')]['end']);}break;case _0x313c('0x2b'):_0x1294cf=as[_0x313c('0x68')]('me',null,_0x230a35);_0x104160[_0xa9621c](_0x1294cf['text'],_0x1294cf[_0x313c('0x58')][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);break;}}else{var _0x1294cf=as[_0x313c('0x68')](_0x792460,_0xd0d23e['type'],_0x230a35);_0x104160[_0xa9621c](_0x1294cf[_0x313c('0x62')],_0x1294cf['value'][_0x313c('0x69')],_0x1294cf[_0x313c('0x58')][_0x313c('0x63')]);}}}else{var _0x2c47d2=_(_0xfa6c22['query'])['keys']()[_0x313c('0x21')](function(_0xe02a7){return _[_0x313c('0x6a')](_0x9f7e4,[_0x313c('0x1e'),_0xe02a7])?_0xe02a7:undefined;})[_0x313c('0x6b')]()[_0x313c('0x58')]();if(!_[_0x313c('0x6c')](_0x2c47d2)){_0x2c47d2[_0x313c('0x26')](function(_0x88afcb){if(_0x88afcb===_0x313c('0x6d')){_0x54f289[_0x313c('0x6e')](_0x313c('0x6f'),[][_0x313c('0x70')](_0xfa6c22[_0x313c('0x36')][_0x88afcb]));}else if(_0x88afcb===_0x313c('0x71')){var _0x4e82eb=JSON[_0x313c('0x72')](_0xfa6c22['query'][_0x88afcb])[_0x313c('0x73')];var _0x2989a3=JSON[_0x313c('0x72')](_0xfa6c22[_0x313c('0x36')][_0x88afcb])['$lte'];_0x54f289[_0x313c('0x6e')](_0x313c('0x74'),_0x4e82eb,_0x2989a3);}else{if(_0xfa6c22[_0x313c('0x36')][_0x88afcb]===_0x313c('0x75')){_0x54f289[_0x313c('0x6e')]('i.'+_0x88afcb+_0x313c('0x76'));}else{_0x54f289[_0x313c('0x6e')]('i.'+_0x88afcb+_0x313c('0x77'),_0xfa6c22['query'][_0x88afcb]);}}});}if(_0xfa6c22[_0x313c('0x36')][_0x313c('0x78')]){if(_0xfa6c22['query'][_0x313c('0x78')]==0x1){_0x54f289[_0x313c('0x79')](_0x313c('0x7a'));}else{_0x54f289[_0x313c('0x79')](_0x313c('0x7b'));}}if(_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]){_0x330962=_[_0x313c('0x7d')](_0xfa6c22['query'][_0x313c('0x7c')])?_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]:new Array(_0xfa6c22[_0x313c('0x36')][_0x313c('0x7c')]);_0x330962[_0x313c('0x26')](function(_0x1540c3){_0x48079c['or'](_0x313c('0x7e'),'%,'+_0x1540c3+',%');});}if(_0xfa6c22['query'][_0x313c('0x7f')]){var _0x9e9289=_0xfa6c22[_0x313c('0x36')][_0x313c('0x7f')][_0x313c('0x80')]('\x5c','\x5c\x5c')[_0x313c('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x9e9289)){_0x104160['or'](_0x313c('0x81'),_0x9e9289+'%');}else if(qs[_0x313c('0x82')](_0x9e9289)){_0x104160['or'](_0x313c('0x83'),_0x9e9289+'%');}else{_0x104160['or'](_0x313c('0x84'),qs[_0x313c('0x85')](_0x9e9289))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x313c('0x85')](_0x9e9289));}}}_0x54f289[_0x313c('0x6e')](_0x104160);_0x54f289['group'](_0x313c('0x86'));var _0x47c071={'type':db[_0x313c('0x87')]['QueryTypes'][_0x313c('0x88')],'raw':!![]};var _0x210334=_0x54f289[_0x313c('0x89')]();_0x210334[_0x313c('0x41')](_0x313c('0x86'));_0x210334[_0x313c('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x313c('0x57'));if(_0xea8c02[_0x313c('0x8a')]){_0xea8c02['order'][_0x313c('0x26')](function(_0x1a0f6d){var _0x2b363a=_0x1a0f6d[0x0]===_0x313c('0x8b')?_0x1a0f6d[0x0]:'i.'+_0x1a0f6d[0x0];_0x54f289[_0x313c('0x8a')](_0x2b363a,_0x1a0f6d[0x1]===_0x313c('0x8c')?![]:!![]);});}if(!_['isEmpty'](_0x330962)){_0x54f289['having'](_0x48079c);_0x210334['where'](_0x313c('0x8d'),_0x330962);}BPromise['resolve']()['then'](function(){if(!_0x3646ac){if(_0xfa6c22['query']['MailAccountId'])return;_0x210334['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x54f289['where'](_0x313c('0x8e'));return;}if(_0xfa6c22['user'][_0x313c('0x8f')]!==_0x313c('0x90'))return;return _0xfa6c22[_0x313c('0x91')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x313c('0x1a')](function(_0x3d17c6){if(_[_0x313c('0x6c')](_0x3d17c6)){_0x210334[_0x313c('0x6e')]('i.MailAccountId\x20IS\x20NULL');_0x54f289[_0x313c('0x6e')](_0x313c('0x92'));}else{_0x210334[_0x313c('0x6e')](_0x313c('0x6f'),_[_0x313c('0x21')](_0x3d17c6,'id'));_0x54f289[_0x313c('0x6e')](_0x313c('0x6f'),_[_0x313c('0x21')](_0x3d17c6,'id'));}});})[_0x313c('0x1a')](function(){if(_0xfa6c22['user'][_0x313c('0x8f')]==='agent'&&!_0x3646ac&&!_0xfa6c22['query']['MailAccountId'])return[];return db[_0x313c('0x93')][_0x313c('0x36')](_0x210334[_0x313c('0x94')](),_0x47c071);})[_0x313c('0x1a')](function(_0x1d906d){_0x500aef[_0x313c('0x95')]=_0x1d906d[_0x313c('0x3c')];if(_0x500aef[_0x313c('0x95')]===0x0)return[];return db[_0x313c('0x93')]['query'](_0x3832d9[_0x313c('0x94')](),_0x47c071)[_0x313c('0x1a')](function(_0x25cc06){_0x8082dd=_[_0x313c('0x96')](_0x25cc06,'id');_0x47c071=_[_0x313c('0x97')](_0x47c071,{'model':db[_0x313c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfa6c22['query'][_0x313c('0x3a')]){_0xea8c02['attributes'][_0x313c('0x26')](function(_0x1b5b65){_0x54f289['field']('i.'+_0x1b5b65);});}else{_0x54f289[_0x313c('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x313c('0x57'));_0x54f289[_0x313c('0x41')](_0x313c('0x98'),_0x313c('0x99'));_0x54f289['field']('a.mandatoryDisposition','Account.mandatoryDisposition');_0x54f289[_0x313c('0x41')]('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',_0x313c('0x8b'));_0x54f289[_0x313c('0x41')](_0x313c('0x86'));_0x54f289[_0x313c('0x41')](_0x313c('0x9a'));_0x54f289[_0x313c('0x41')](_0x313c('0x9b'));_0x54f289['field'](_0x313c('0x9c'));_0x54f289[_0x313c('0x41')](_0x313c('0x9d'));_0x54f289[_0x313c('0x41')](_0x313c('0x9e'));_0x54f289[_0x313c('0x41')](_0x313c('0x9f'));_0x54f289['field'](_0x313c('0xa0'));_0x54f289[_0x313c('0x41')](_0x313c('0xa1'));_0x54f289[_0x313c('0x41')](_0x313c('0xa2'));_0x54f289[_0x313c('0x41')](_0x313c('0xa3'));_0x54f289['field']('i.thirdDisposition');_0x54f289[_0x313c('0x41')]('i.substatus');_0x54f289['field'](_0x313c('0xa4'));_0x54f289[_0x313c('0x41')](_0x313c('0xa5'));_0x54f289[_0x313c('0x41')](_0x313c('0xa6'));_0x54f289[_0x313c('0x41')](_0x313c('0xa7'));_0x54f289[_0x313c('0x41')]('c.firstName',_0x313c('0xa8'));_0x54f289[_0x313c('0x41')](_0x313c('0xa9'),_0x313c('0xaa'));_0x54f289[_0x313c('0x41')](_0x313c('0xab'),'Contact.email');_0x54f289[_0x313c('0x41')]('c.phone','Contact.phone');_0x54f289[_0x313c('0x41')](_0x313c('0xac'),_0x313c('0xad'));_0x54f289[_0x313c('0x41')](_0x313c('0xae'),_0x313c('0xaf'));_0x54f289[_0x313c('0x41')](_0x313c('0xb0'),_0x313c('0xb1'));_0x54f289[_0x313c('0x41')]('o.internal',_0x313c('0xb2'));_0x54f289[_0x313c('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x313c('0x23'));}if(_0xea8c02[_0x313c('0x16')])_0x54f289['limit'](_0xea8c02[_0x313c('0x16')]);if(_0xea8c02['offset'])_0x54f289[_0x313c('0x15')](_0xea8c02[_0x313c('0x15')]);return db[_0x313c('0x93')]['query'](_0x54f289['toString'](),_0x47c071);})[_0x313c('0x1a')](function(_0x3a0aa6){if(_0x3a0aa6[_0x313c('0x3c')]>0x0)_0x15a83c[_0x313c('0x6e')](_0x313c('0xb3'),_['map'](_0x3a0aa6,'id'));return db[_0x313c('0x93')][_0x313c('0x36')](_0x15a83c['toString'](),_0x47c071)['then'](function(_0xe94981){var _0x1fe429=_[_0x313c('0xb4')](_0xe94981,_0x313c('0xb5'));var _0x123d97=[];return db[_0x313c('0xb6')][_0x313c('0x29')]({'attributes':[_0x313c('0xb7')],'raw':!![]})[_0x313c('0x1a')](function(_0x7692c7){var _0x353762=_0x7692c7[_0x313c('0xb7')];_0x3a0aa6[_0x313c('0x26')](function(_0x4545a3){_0x123d97[_0x313c('0x27')](updateMailInteraction(_0x4545a3,_0x8082dd,_0x1fe429,_0x353762));});return BPromise[_0x313c('0xb8')](_0x123d97);});});});})['then'](function(_0x3e4bcf){_0x500aef[_0x313c('0xb9')]=_0x3e4bcf;return _0x500aef;})[_0x313c('0x1a')](respondWithFilteredResult(_0x4553ec,_0xea8c02))[_0x313c('0x2f')](handleError(_0x4553ec,null));};exports[_0x313c('0xba')]=function(_0x256685,_0xb9961){var _0x172f18={'raw':![],'where':{'id':_0x256685[_0x313c('0xbb')]['id']}},_0x5872f7={};_0x5872f7['model']=_['keys'](db[_0x313c('0x31')][_0x313c('0x32')]);_0x5872f7[_0x313c('0x36')]=_[_0x313c('0x37')](_0x256685[_0x313c('0x36')]);_0x5872f7[_0x313c('0x38')]=_['intersection'](_0x5872f7[_0x313c('0x35')],_0x5872f7[_0x313c('0x36')]);_0x172f18[_0x313c('0x3b')]=_[_0x313c('0x39')](_0x5872f7[_0x313c('0x35')],qs[_0x313c('0x3a')](_0x256685[_0x313c('0x36')][_0x313c('0x3a')]));_0x172f18[_0x313c('0x3b')]=_0x172f18[_0x313c('0x3b')][_0x313c('0x3c')]?_0x172f18[_0x313c('0x3b')]:_0x5872f7['model'];if(_0x256685[_0x313c('0x36')][_0x313c('0xbc')]){_0x172f18[_0x313c('0xbd')]=[{'all':!![]}];}_0x172f18=_[_0x313c('0x97')]({},_0x172f18,_0x256685['options']);return db['MailInteraction']['find'](_0x172f18)[_0x313c('0x1a')](handleEntityNotFound(_0xb9961,null))[_0x313c('0x1a')](respondWithResult(_0xb9961,null))[_0x313c('0x2f')](handleError(_0xb9961,null));};exports[_0x313c('0xbe')]=function(_0x2115a5,_0x541436){return db[_0x313c('0x31')][_0x313c('0xbe')](_0x2115a5[_0x313c('0xbf')],{})[_0x313c('0x1a')](respondWithResult(_0x541436,0xc9))[_0x313c('0x2f')](handleError(_0x541436,null));};exports[_0x313c('0x19')]=function(_0x404ae1,_0x2655a9){if(_0x404ae1[_0x313c('0xbf')]['id']){delete _0x404ae1['body']['id'];}return db['MailInteraction']['find']({'where':{'id':_0x404ae1['params']['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0x2655a9,null))[_0x313c('0x1a')](saveUpdates(_0x404ae1[_0x313c('0xbf')],null))['then'](respondWithResult(_0x2655a9,null))[_0x313c('0x2f')](handleError(_0x2655a9,null));};exports['destroy']=function(_0x34c8f9,_0xfdc034){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x34c8f9[_0x313c('0xbb')]['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0xfdc034,null))[_0x313c('0x1a')](removeEntity(_0xfdc034,null))['catch'](handleError(_0xfdc034,null));};exports[_0x313c('0xc0')]=function(_0x113ba9,_0xf6e037){return db[_0x313c('0x31')][_0x313c('0xc0')]()['then'](respondWithResult(_0xf6e037,null))['catch'](handleError(_0xf6e037,null));};exports['addMessage']=function(_0x11ce0d,_0x42fd6a){return db[_0x313c('0x28')][_0x313c('0x60')]({'where':{'id':_0x11ce0d[_0x313c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x42fd6a,null))[_0x313c('0x1a')](function(_0x1df743){if(_0x1df743){return _0x1df743['addMessage'](_0x11ce0d[_0x313c('0xbf')][_0x313c('0xc1')],_[_0x313c('0xc2')](_0x11ce0d[_0x313c('0xbf')],[_0x313c('0xc1'),'id'])||{});}})[_0x313c('0x1a')](respondWithResult(_0x42fd6a,null))[_0x313c('0x2f')](handleError(_0x42fd6a,null));};exports[_0x313c('0xc3')]=function(_0x2ef0a5,_0x2e4985){var _0xa82270={'raw':![],'where':{}};var _0x4a009a={};var _0x1f1c76={'count':0x0,'rows':[]};return db[_0x313c('0x31')]['findOne']({'where':{'id':_0x2ef0a5['params']['id']}})['then'](handleEntityNotFound(_0x2e4985,null))['then'](function(_0x321386){if(_0x321386){_0x4a009a[_0x313c('0x35')]=_[_0x313c('0x37')](db[_0x313c('0x28')][_0x313c('0x32')]);_0x4a009a[_0x313c('0x36')]=_['keys'](_0x2ef0a5[_0x313c('0x36')]);_0x4a009a['filters']=_['intersection'](_0x4a009a[_0x313c('0x35')],_0x4a009a['query']);_0xa82270[_0x313c('0x3b')]=_[_0x313c('0x39')](_0x4a009a[_0x313c('0x35')],qs['fields'](_0x2ef0a5[_0x313c('0x36')][_0x313c('0x3a')]));_0xa82270[_0x313c('0x3b')]=_0xa82270['attributes'][_0x313c('0x3c')]?_0xa82270[_0x313c('0x3b')]:_0x4a009a[_0x313c('0x35')];if(!_0x2ef0a5[_0x313c('0x36')][_0x313c('0x3d')](_0x313c('0xc4'))){_0xa82270[_0x313c('0x16')]=qs[_0x313c('0x16')](_0x2ef0a5[_0x313c('0x36')]['limit']);_0xa82270['offset']=qs[_0x313c('0x15')](_0x2ef0a5['query'][_0x313c('0x15')]);}_0xa82270[_0x313c('0x8a')]=qs[_0x313c('0x3e')](_0x2ef0a5['query'][_0x313c('0x3e')]);_0xa82270[_0x313c('0x6e')]=qs[_0x313c('0x38')](_[_0x313c('0x3f')](_0x2ef0a5[_0x313c('0x36')],_0x4a009a[_0x313c('0x38')]));_0xa82270[_0x313c('0x6e')][_0x313c('0xb5')]=_0x321386['id'];if(_0x2ef0a5['query']['filter']){_0xa82270[_0x313c('0x6e')]=_['merge'](_0xa82270['where'],{'$or':_[_0x313c('0x21')](_0xa82270['attributes'],function(_0xbeab8d){var _0x5ccf0f={};_0x5ccf0f[_0xbeab8d]={'$like':'%'+_0x2ef0a5[_0x313c('0x36')][_0x313c('0x7f')]+'%'};return _0x5ccf0f;})});}if(_0x2ef0a5['query'][_0x313c('0x73')]){var _0x22027f=_0x2ef0a5['query']['$gte']['split'](',');var _0x3eb176={};_0x3eb176[_0x22027f[0x0]]={'$gte':moment(_0x22027f[0x1])['format'](_0x313c('0xc5'))};_0xa82270[_0x313c('0x6e')]=_[_0x313c('0x97')](_0xa82270[_0x313c('0x6e')],_0x3eb176);}_0xa82270=_['merge']({},_0xa82270,_0x2ef0a5[_0x313c('0xc6')]);return db[_0x313c('0x28')][_0x313c('0x95')]({'where':_0xa82270[_0x313c('0x6e')]})[_0x313c('0x1a')](function(_0x668211){_0x1f1c76['count']=_0x668211;if(_0x2ef0a5['query']['includeAll']){_0xa82270[_0x313c('0xbd')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0xa82270);})[_0x313c('0x1a')](function(_0x12dd35){if(_0x2ef0a5['query'][_0x313c('0xc7')]==='true'){for(var _0x5a06b2=0x0;_0x5a06b2<_0x12dd35['length'];_0x5a06b2++){_0x12dd35[_0x5a06b2][_0x313c('0xbf')]=juice(_0x12dd35[_0x5a06b2][_0x313c('0xbf')]);}}_0x1f1c76['rows']=_0x12dd35;return _0x1f1c76;});}})[_0x313c('0x1a')](respondWithFilteredResult(_0x2e4985,_0xa82270))['catch'](handleError(_0x2e4985,null));};exports['addTags']=function(_0x4a046d,_0x527b13){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x4a046d[_0x313c('0xbb')]['id']}})[_0x313c('0x1a')](handleEntityNotFound(_0x527b13,null))['then'](function(_0xa23f22){if(_0xa23f22){return _0xa23f22[_0x313c('0xc8')](_0x4a046d['body'][_0x313c('0xc1')],_['omit'](_0x4a046d[_0x313c('0xbf')],['ids','id'])||{})[_0x313c('0xc9')](function(){return db[_0x313c('0x64')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x4a046d['body'][_0x313c('0xc1')]}});})['then'](function(_0x195c44){socket[_0x313c('0xca')]('mailInteractionTags:save',{'id':Number(_0x4a046d[_0x313c('0xbb')]['id']),'tags':_0x195c44||[]});return{'id':Number(_0x4a046d[_0x313c('0xbb')]['id']),'tags':_0x195c44||[]};});}})[_0x313c('0x1a')](respondWithResult(_0x527b13,null))[_0x313c('0x2f')](handleError(_0x527b13,null));};exports[_0x313c('0xcb')]=function(_0x332bb1,_0x1a163d){return db[_0x313c('0x31')][_0x313c('0x60')]({'where':{'id':_0x332bb1[_0x313c('0xbb')]['id']}})['then'](handleEntityNotFound(_0x1a163d,null))[_0x313c('0x1a')](function(_0x5183c0){if(_0x5183c0){return _0x5183c0[_0x313c('0xcb')](_0x332bb1[_0x313c('0x36')][_0x313c('0xc1')]);}})[_0x313c('0x1a')](respondWithStatusCode(_0x1a163d,null))[_0x313c('0x2f')](handleError(_0x1a163d,null));};exports[_0x313c('0xcc')]=function(_0x38f76f,_0x466188){var _0x57f5f9=moment()[_0x313c('0xcd')]()['toString']();var _0x5a9e46=path['join'](config[_0x313c('0xce')],_0x313c('0xcf'),_0x313c('0xd0'),_0x313c('0xd1'));var _0x3a79ec=path[_0x313c('0xd2')](config[_0x313c('0xce')],'server',_0x313c('0xd0'),_0x313c('0xd3'));var _0x493f40=path[_0x313c('0xd2')](_0x5a9e46,_0x57f5f9);var _0x2b76b=util[_0x313c('0xd4')](_0x313c('0xd5'),_0x38f76f['params']['id'],_0x57f5f9);var _0x52440d=path[_0x313c('0xd2')](_0x5a9e46,_0x2b76b);var _0x42996d=[];if(_0x38f76f[_0x313c('0x36')][_0x313c('0xd3')]){_0x42996d['push']({'model':db['Attachment'],'as':_0x313c('0xd6'),'raw':!![]});}var _0x492eec=[{'model':db[_0x313c('0x28')],'as':_0x313c('0xd7'),'attributes':['id',_0x313c('0xbf'),_0x313c('0x43'),'to','cc',_0x313c('0xd8'),_0x313c('0xd9'),_0x313c('0x71')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x42996d}];return db[_0x313c('0x31')]['find']({'where':{'id':_0x38f76f[_0x313c('0xbb')]['id']},'include':_0x492eec})['then'](handleEntityNotFound(_0x466188,null))['then'](function(_0x261d51){if(_0x261d51&&_0x261d51[_0x313c('0xd7')]){var _0x10658f=_0x261d51[_0x313c('0xda')]({'plain':!![]});fs[_0x313c('0xdb')](_0x493f40);return BPromise['each'](_0x10658f[_0x313c('0xd7')],function(_0x1948af,_0x126642){var _0x2665cc={'from':_0x1948af[_0x313c('0x43')],'to':_0x1948af['to'],'subject':_0x1948af[_0x313c('0xd9')],'html':htmlEntities['decode'](_0x1948af['body']),'headers':{'Date':moment(_0x1948af[_0x313c('0x71')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1948af['cc']){_0x2665cc[_0x313c('0xdc')]['Cc']=_0x1948af['cc'];}if(_0x1948af['bcc']){_0x2665cc['headers'][_0x313c('0xdd')]=_0x1948af[_0x313c('0xd8')];}return new BPromise(function(_0x47ff99,_0x3ee22e){if(_0x1948af[_0x313c('0xd6')]){for(var _0x1a6361=0x0;_0x1a6361<_0x1948af['Attachments'][_0x313c('0x3c')];_0x1a6361++){var _0x27daf3=_0x1948af[_0x313c('0xd6')][_0x1a6361];var _0x33b05e=path['join'](_0x3a79ec,_0x27daf3[_0x313c('0xde')]);if(fs['existsSync'](_0x33b05e)){_0x2665cc[_0x313c('0xd3')][_0x313c('0x27')]({'name':_0x27daf3[_0x313c('0x1e')],'contentType':_0x27daf3[_0x313c('0x34')],'data':fs['readFileSync'](_0x33b05e)});}}}emlformat[_0x313c('0xdf')](_0x2665cc,function(_0x1105cc,_0x3824c9){if(_0x1105cc)return _0x3ee22e(_0x1105cc);fs['writeFileSync'](path[_0x313c('0xd2')](_0x493f40,util['format'](_0x313c('0xe0'),_0x126642)),_0x3824c9);return _0x47ff99(_0x3824c9);});});})['then'](function(){return new BPromise(function(_0x1ac681,_0x22a271){zipdir(_0x493f40,{'saveTo':_0x52440d},function(_0x457aef,_0x4e8236){if(_0x457aef)return _0x22a271(_0x457aef);return _0x1ac681(_0x4e8236);});})['then'](function(){return new BPromise(function(_0x3fe9ff,_0x3b29d0){rimraf(_0x493f40,function(_0x537c1c){if(_0x537c1c)_0x3b29d0(_0x537c1c);return _0x3fe9ff();});});})[_0x313c('0x1a')](function(){return _0x466188['download'](_0x52440d,_0x2b76b,function(_0x35a1c6){if(!_0x35a1c6)fs['unlinkSync'](_0x52440d);});});});}else{return _0x466188['sendStatus'](0xc8);}})[_0x313c('0x2f')](handleError(_0x466188,null));};
\ No newline at end of file
+var _0xd324=['$gte','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','i.MailAccountId\x20IS\x20NOT\x20NULL','user','agent','i.MailAccountId\x20IS\x20NULL','role','sequelize','toString','merge','MailInteraction','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','enableEmailPreview','all','rows','show','includeAll','include','create','update','body','params','describe','addMessage','omit','ids','getMessages','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','destroy','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','createdAt','parse'];(function(_0x213af6,_0x27a0a6){var _0x2a3702=function(_0x41cc64){while(--_0x41cc64){_0x213af6['push'](_0x213af6['shift']());}};_0x2a3702(++_0x27a0a6);}(_0xd324,0x15f));var _0x4d32=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0xd324[_0xa388a2];return _0x7ce7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d32('0x0'));var zipdir=require(_0x4d32('0x1'));var moment=require(_0x4d32('0x2'));var BPromise=require(_0x4d32('0x3'));var util=require(_0x4d32('0x4'));var path=require(_0x4d32('0x5'));var fs=require('fs');var _=require(_0x4d32('0x6'));var squel=require(_0x4d32('0x7'));var juice=require('juice');var Redis=require(_0x4d32('0x8'));var qs=require(_0x4d32('0x9'));var as=require(_0x4d32('0xa'));var logger=require(_0x4d32('0xb'))(_0x4d32('0xc'));var config=require(_0x4d32('0xd'));var db=require(_0x4d32('0xe'))['db'];var htmlEntities=require(_0x4d32('0xf'));config['redis']=_[_0x4d32('0x10')](config['redis'],{'host':_0x4d32('0x11'),'port':0x18eb});var socket=require(_0x4d32('0x12'))(new Redis(config[_0x4d32('0x13')]));require(_0x4d32('0x14'))[_0x4d32('0x15')](socket);function respondWithStatusCode(_0x2c9ce8,_0x4d204f){_0x4d204f=_0x4d204f||0xcc;return function(_0x3bbe7a){if(_0x3bbe7a){return _0x2c9ce8[_0x4d32('0x16')](_0x4d204f);}return _0x2c9ce8[_0x4d32('0x17')](_0x4d204f)[_0x4d32('0x18')]();};}function respondWithResult(_0x22100c,_0x37f281){_0x37f281=_0x37f281||0xc8;return function(_0xeb4b75){if(_0xeb4b75){return _0x22100c[_0x4d32('0x17')](_0x37f281)['json'](_0xeb4b75);}};}function respondWithFilteredResult(_0x3e0a21,_0xdc6ef5){return function(_0x1613c9){if(_0x1613c9){var _0x55b85e=typeof _0xdc6ef5[_0x4d32('0x19')]==='undefined'&&typeof _0xdc6ef5[_0x4d32('0x1a')]===_0x4d32('0x1b');var _0xe2f399=_0x1613c9[_0x4d32('0x1c')];var _0x2f465d=_0x55b85e?0x0:_0xdc6ef5[_0x4d32('0x19')];var _0x400027=_0x55b85e?_0x1613c9[_0x4d32('0x1c')]:_0xdc6ef5[_0x4d32('0x19')]+_0xdc6ef5['limit'];var _0x1d9570;if(_0x400027>=_0xe2f399){_0x400027=_0xe2f399;_0x1d9570=0xc8;}else{_0x1d9570=0xce;}_0x3e0a21[_0x4d32('0x17')](_0x1d9570);return _0x3e0a21[_0x4d32('0x1d')]('Content-Range',_0x2f465d+'-'+_0x400027+'/'+_0xe2f399)['json'](_0x1613c9);}return null;};}function saveUpdates(_0x57fd46){return function(_0x184055){if(_0x184055){return _0x184055['update'](_0x57fd46)['then'](function(_0x52ac09){return _0x52ac09;});}return null;};}function removeEntity(_0x243e45){return function(_0x4235d7){if(_0x4235d7){return _0x4235d7[_0x4d32('0x1e')]()['then'](function(){_0x243e45['status'](0xcc)[_0x4d32('0x18')]();});}};}function handleEntityNotFound(_0x3ba1ea){return function(_0xda0dd2){if(!_0xda0dd2){_0x3ba1ea['sendStatus'](0x194);}return _0xda0dd2;};}function handleError(_0x4c1904,_0x47065e){_0x47065e=_0x47065e||0x1f4;return function(_0x2d0af0){logger[_0x4d32('0x1f')](_0x2d0af0[_0x4d32('0x20')]);if(_0x2d0af0[_0x4d32('0x21')]){delete _0x2d0af0[_0x4d32('0x21')];}_0x4c1904[_0x4d32('0x17')](_0x47065e)[_0x4d32('0x22')](_0x2d0af0);};}function getInteractionUsers(_0x20ebe4,_0x5239e9){return new BPromise(function(_0x134814,_0x522fdd){try{if(_0x5239e9[_0x20ebe4['id']]){_0x20ebe4[_0x4d32('0x23')]=_['map'](_0x5239e9[_0x20ebe4['id']],function(_0x18adc0){return{'id':_0x18adc0['id'],'fullname':_0x18adc0['fullname']};});}}catch(_0x1ac0dd){_0x522fdd(_0x1ac0dd);}_0x134814(_0x20ebe4);});}function getInteractionTags(_0x48673e,_0x42732a){return new BPromise(function(_0x4a919c,_0x4c2878){try{if(_0x48673e[_0x4d32('0x24')]){_0x48673e[_0x4d32('0x25')]=[];_0x48673e[_0x4d32('0x24')][_0x4d32('0x26')](',')[_0x4d32('0x27')](function(_0x5397e6){_0x48673e['Tags'][_0x4d32('0x28')](_0x42732a[_0x5397e6]);});}delete _0x48673e['TagIds'];}catch(_0x110ff6){_0x4c2878(_0x110ff6);}_0x4a919c(_0x48673e);});}function getLastMessageText(_0xf168ce){return new BPromise(function(_0x4d281a,_0x5a4782){return db[_0x4d32('0x29')][_0x4d32('0x2a')]({'where':{'$and':[{'MailInteractionId':_0xf168ce['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4d32('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x4d32('0x2c')],'order':_0x4d32('0x2d'),'raw':!![]})[_0x4d32('0x2e')](function(_0x4b62d2){if(_0x4b62d2&&_0x4b62d2[_0x4d32('0x2c')]){_0xf168ce[_0x4d32('0x2f')]=_[_0x4d32('0x30')](_0x4b62d2['plainBody']);}_0x4d281a(_0xf168ce);})[_0x4d32('0x31')](function(_0x26b76c){_0x5a4782(_0x26b76c);});});}function updateMailInteraction(_0x2488d3,_0x5894bd,_0xdb263c,_0x2f0a00){return new BPromise(function(_0x986467,_0x3cf75f){return getInteractionUsers(_0x2488d3,_0xdb263c)['then'](function(_0xd895e7){return getInteractionTags(_0xd895e7,_0x5894bd);})[_0x4d32('0x2e')](function(_0x2fc508){if(_0x2f0a00){_0x986467(getLastMessageText(_0x2fc508));}else{_0x986467(_0x2fc508);}})['catch'](function(_0x1b82ea){_0x3cf75f(_0x1b82ea);});});}exports[_0x4d32('0x32')]=function(_0x31c8d3,_0x396ff6){var _0x5173d9={},_0x321de8={},_0xa7c370={'count':0x0,'rows':[]};var _0x451824=_[_0x4d32('0x33')](db['MailInteraction'][_0x4d32('0x34')],function(_0x19aa42){return{'name':_0x19aa42[_0x4d32('0x35')],'type':_0x19aa42[_0x4d32('0x36')][_0x4d32('0x37')]};});_0x321de8[_0x4d32('0x38')]=_[_0x4d32('0x33')](_0x451824,'name');_0x321de8['query']=_[_0x4d32('0x39')](_0x31c8d3[_0x4d32('0x3a')]);_0x321de8[_0x4d32('0x3b')]=_[_0x4d32('0x3c')](_0x321de8[_0x4d32('0x38')],_0x321de8[_0x4d32('0x3a')]);_0x5173d9['attributes']=_[_0x4d32('0x3c')](_0x321de8['model'],qs[_0x4d32('0x3d')](_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x3d')]));_0x5173d9['attributes']=_0x5173d9['attributes'][_0x4d32('0x3e')]?_0x5173d9[_0x4d32('0x3f')]:_0x321de8[_0x4d32('0x38')];if(!_0x31c8d3[_0x4d32('0x3a')]['hasOwnProperty'](_0x4d32('0x40'))){_0x5173d9['limit']=qs[_0x4d32('0x1a')](_0x31c8d3['query'][_0x4d32('0x1a')]);_0x5173d9[_0x4d32('0x19')]=qs[_0x4d32('0x19')](_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x19')]);}_0x5173d9[_0x4d32('0x41')]=qs[_0x4d32('0x42')](_0x31c8d3['query'][_0x4d32('0x42')]);_0x5173d9[_0x4d32('0x43')]=qs[_0x4d32('0x3b')](_[_0x4d32('0x44')](_0x31c8d3[_0x4d32('0x3a')],_0x321de8[_0x4d32('0x3b')]),_0x451824);var _0x22073d=[];var _0xcb5970=squel[_0x4d32('0x45')]()[_0x4d32('0x46')]('id')[_0x4d32('0x46')](_0x4d32('0x21'))[_0x4d32('0x46')](_0x4d32('0x47'))[_0x4d32('0x48')](_0x4d32('0x49'));var _0x327cf6=squel['select']()['field'](_0x4d32('0x4a'))[_0x4d32('0x46')](_0x4d32('0x4b'))['field'](_0x4d32('0x4c'))[_0x4d32('0x48')](_0x4d32('0x4d'),'ui')[_0x4d32('0x4e')](_0x4d32('0x4f'),'u',_0x4d32('0x50'));var _0x5d4658=squel[_0x4d32('0x45')]()[_0x4d32('0x48')](_0x4d32('0x51'),'i')[_0x4d32('0x4e')](_0x4d32('0x52'),'c',_0x4d32('0x53'))['left_join']('users','o',_0x4d32('0x54'))[_0x4d32('0x4e')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')[_0x4d32('0x4e')](_0x4d32('0x55'),'me',_0x4d32('0x56'))[_0x4d32('0x4e')]('mail_interaction_has_tags','it',_0x4d32('0x57'))['left_join'](_0x4d32('0x49'),'t',_0x4d32('0x58'));var _0x4d6e39=squel[_0x4d32('0x59')]();var _0x145f34=[];var _0x265cff=squel[_0x4d32('0x59')]();var _0x353843;if(_0x31c8d3['query'][_0x4d32('0x5a')]){_0x353843=as[_0x4d32('0x5b')](_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x5a')]);var _0x34ebfa=_0x353843[_0x4d32('0x5c')];for(var _0x244565=0x0;_0x244565<_0x353843[_0x4d32('0x5d')][_0x4d32('0x3e')];_0x244565++){var _0x407387=_0x353843[_0x4d32('0x5d')][_0x244565];var _0x2a96a6='i';var _0x1fa93d=_[_0x4d32('0x5e')](_0x451824,['name',_0x407387[_0x4d32('0x46')]]);if(!_0x1fa93d){switch(_0x407387[_0x4d32('0x46')]){case'unreadMessages':if(_0x407387[_0x4d32('0x5f')]==0x1){_0x5d4658['having']('`'+_0x407387['field']+'`\x20=\x200');}else{_0x5d4658['having']('`'+_0x407387[_0x4d32('0x46')]+_0x4d32('0x60'));}break;case _0x4d32('0x61'):if(_0x407387[_0x4d32('0x62')]===_0x4d32('0x63')){if(_0x407387[_0x4d32('0x5f')][_0x4d32('0x26')]('\x20')[_0x4d32('0x3e')]>0x1){_0x4d6e39[_0x34ebfa](_0x4d32('0x64'),qs['getFullTextValue'](_0x407387[_0x4d32('0x5f')]),null);}else{var _0x506720='%'+_0x407387[_0x4d32('0x5f')]+'%';_0x4d6e39[_0x34ebfa](_0x4d32('0x65'),_0x506720,_0x506720,_0x506720);}}else{_0x1fa93d=_[_0x4d32('0x5e')](_0x451824,[_0x4d32('0x21'),_0x4d32('0x66')]);_0x407387[_0x4d32('0x46')]='ContactId';_0x159921=as[_0x4d32('0x67')](_0x2a96a6,_0x1fa93d[_0x4d32('0x36')],_0x407387);_0x4d6e39[_0x34ebfa](_0x159921[_0x4d32('0x68')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x69')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x18')]);}break;case _0x4d32('0x6a'):var _0x3d2428=_0x407387[_0x4d32('0x5f')][_0x4d32('0x26')](',')['map'](function(_0x320460){return Number(_0x320460);});_0x3d2428[_0x4d32('0x27')](function(_0x3fbe9e){_0x265cff['or'](_0x4d32('0x6b'),'%,'+_0x3fbe9e+',%');});_0x145f34=_[_0x4d32('0x6c')](_0x145f34,_0x3d2428);break;case'User':if(_0x407387[_0x4d32('0x62')]===_0x4d32('0x63')){_0x4d6e39[_0x34ebfa](_0x4d32('0x6d'),'%'+_0x407387[_0x4d32('0x5f')]+'%',null);}else{_0x1fa93d=_['find'](_0x451824,[_0x4d32('0x21'),_0x4d32('0x6e')]);_0x407387[_0x4d32('0x46')]=_0x4d32('0x6e');_0x159921=as[_0x4d32('0x67')](_0x2a96a6,_0x1fa93d[_0x4d32('0x36')],_0x407387);_0x4d6e39[_0x34ebfa](_0x159921[_0x4d32('0x68')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x69')],_0x159921[_0x4d32('0x5f')]['end']);}break;case _0x4d32('0x2c'):_0x159921=as['buildExpression']('me',null,_0x407387);_0x4d6e39[_0x34ebfa](_0x159921[_0x4d32('0x68')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x69')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x18')]);break;}}else{var _0x159921=as[_0x4d32('0x67')](_0x2a96a6,_0x1fa93d[_0x4d32('0x36')],_0x407387);_0x4d6e39[_0x34ebfa](_0x159921[_0x4d32('0x68')],_0x159921[_0x4d32('0x5f')][_0x4d32('0x69')],_0x159921['value'][_0x4d32('0x18')]);}}}else{var _0x12c91e=_(_0x31c8d3[_0x4d32('0x3a')])[_0x4d32('0x39')]()[_0x4d32('0x33')](function(_0x2f1255){return _[_0x4d32('0x6f')](_0x451824,[_0x4d32('0x21'),_0x2f1255])?_0x2f1255:undefined;})['compact']()[_0x4d32('0x5f')]();if(!_[_0x4d32('0x70')](_0x12c91e)){_0x12c91e[_0x4d32('0x27')](function(_0x4df9dc){if(_0x4df9dc===_0x4d32('0x71')){_0x5d4658[_0x4d32('0x43')](_0x4d32('0x72'),[]['concat'](_0x31c8d3[_0x4d32('0x3a')][_0x4df9dc]));}else if(_0x4df9dc===_0x4d32('0x73')){var _0x518127=JSON[_0x4d32('0x74')](_0x31c8d3[_0x4d32('0x3a')][_0x4df9dc])[_0x4d32('0x75')];var _0x34e7bd=JSON['parse'](_0x31c8d3[_0x4d32('0x3a')][_0x4df9dc])['$lte'];_0x5d4658[_0x4d32('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x518127,_0x34e7bd);}else{if(_0x31c8d3[_0x4d32('0x3a')][_0x4df9dc]==='null'){_0x5d4658[_0x4d32('0x43')]('i.'+_0x4df9dc+_0x4d32('0x76'));}else{_0x5d4658['where']('i.'+_0x4df9dc+_0x4d32('0x77'),_0x31c8d3[_0x4d32('0x3a')][_0x4df9dc]);}}});}if(_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x78')]){if(_0x31c8d3[_0x4d32('0x3a')]['read']==0x1){_0x5d4658[_0x4d32('0x79')](_0x4d32('0x7a'));}else{_0x5d4658[_0x4d32('0x79')](_0x4d32('0x7b'));}}if(_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x7c')]){_0x145f34=_['isArray'](_0x31c8d3['query'][_0x4d32('0x7c')])?_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x7c')]:new Array(_0x31c8d3['query'][_0x4d32('0x7c')]);_0x145f34[_0x4d32('0x27')](function(_0x2e0204){_0x265cff['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2e0204+',%');});}if(_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x7d')]){var _0x43ca26=_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x7d')][_0x4d32('0x7e')]('\x5c','\x5c\x5c')[_0x4d32('0x7e')](/'/g,'\x27\x27');if(qs[_0x4d32('0x7f')](_0x43ca26)){_0x4d6e39['or'](_0x4d32('0x80'),_0x43ca26+'%');}else if(qs['isEmail'](_0x43ca26)){_0x4d6e39['or'](_0x4d32('0x81'),_0x43ca26+'%');}else{_0x4d6e39['or'](_0x4d32('0x82'),qs[_0x4d32('0x83')](_0x43ca26))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4d32('0x83')](_0x43ca26));}}}_0x5d4658[_0x4d32('0x43')](_0x4d6e39);_0x5d4658['group']('i.id');var _0x3a29c1={'type':db[_0x4d32('0x84')][_0x4d32('0x85')][_0x4d32('0x86')],'raw':!![]};var _0x3e570c=_0x5d4658[_0x4d32('0x87')]();_0x3e570c['field']('i.id');_0x3e570c[_0x4d32('0x46')](_0x4d32('0x88'),_0x4d32('0x89'));if(_0x5173d9[_0x4d32('0x41')]){_0x5173d9[_0x4d32('0x41')][_0x4d32('0x27')](function(_0x12766e){var _0x5e5b58=_0x12766e[0x0]==='contactName'?_0x12766e[0x0]:'i.'+_0x12766e[0x0];_0x5d4658[_0x4d32('0x41')](_0x5e5b58,_0x12766e[0x1]===_0x4d32('0x8a')?![]:!![]);});}if(!_[_0x4d32('0x70')](_0x145f34)){_0x5d4658[_0x4d32('0x79')](_0x265cff);_0x3e570c[_0x4d32('0x43')]('t.id\x20IN\x20?',_0x145f34);}BPromise['resolve']()['then'](function(){if(!_0x353843){if(_0x31c8d3[_0x4d32('0x3a')]['MailAccountId'])return;_0x3e570c[_0x4d32('0x43')](_0x4d32('0x8b'));_0x5d4658[_0x4d32('0x43')](_0x4d32('0x8b'));return;}if(_0x31c8d3[_0x4d32('0x8c')]['role']!==_0x4d32('0x8d'))return;return _0x31c8d3[_0x4d32('0x8c')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x4d32('0x2e')](function(_0x4e220e){if(_[_0x4d32('0x70')](_0x4e220e)){_0x3e570c[_0x4d32('0x43')](_0x4d32('0x8e'));_0x5d4658['where'](_0x4d32('0x8e'));}else{_0x3e570c['where'](_0x4d32('0x72'),_[_0x4d32('0x33')](_0x4e220e,'id'));_0x5d4658[_0x4d32('0x43')](_0x4d32('0x72'),_[_0x4d32('0x33')](_0x4e220e,'id'));}});})['then'](function(){if(_0x31c8d3[_0x4d32('0x8c')][_0x4d32('0x8f')]===_0x4d32('0x8d')&&!_0x353843&&!_0x31c8d3[_0x4d32('0x3a')][_0x4d32('0x71')])return[];return db[_0x4d32('0x90')]['query'](_0x3e570c[_0x4d32('0x91')](),_0x3a29c1);})[_0x4d32('0x2e')](function(_0x8632df){_0xa7c370[_0x4d32('0x1c')]=_0x8632df[_0x4d32('0x3e')];if(_0xa7c370['count']===0x0)return[];return db[_0x4d32('0x90')][_0x4d32('0x3a')](_0xcb5970[_0x4d32('0x91')](),_0x3a29c1)[_0x4d32('0x2e')](function(_0x4cbcd1){_0x22073d=_['keyBy'](_0x4cbcd1,'id');_0x3a29c1=_[_0x4d32('0x92')](_0x3a29c1,{'model':db[_0x4d32('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31c8d3['query'][_0x4d32('0x3d')]){_0x5173d9[_0x4d32('0x3f')]['forEach'](function(_0x2a296e){_0x5d4658[_0x4d32('0x46')]('i.'+_0x2a296e);});}else{_0x5d4658[_0x4d32('0x46')](_0x4d32('0x88'),_0x4d32('0x89'));_0x5d4658['field'](_0x4d32('0x94'),_0x4d32('0x95'));_0x5d4658[_0x4d32('0x46')]('a.mandatoryDisposition',_0x4d32('0x96'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0x97'),_0x4d32('0x98'));_0x5d4658[_0x4d32('0x46')]('i.id');_0x5d4658[_0x4d32('0x46')]('i.createdAt');_0x5d4658[_0x4d32('0x46')](_0x4d32('0x99'));_0x5d4658['field']('i.closed');_0x5d4658[_0x4d32('0x46')](_0x4d32('0x9a'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0x9b'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0x9c'));_0x5d4658['field'](_0x4d32('0x9d'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0x9e'));_0x5d4658['field'](_0x4d32('0x9f'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xa0'));_0x5d4658[_0x4d32('0x46')]('i.thirdDisposition');_0x5d4658['field'](_0x4d32('0xa1'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xa2'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xa3'));_0x5d4658['field'](_0x4d32('0xa4'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xa5'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xa6'),_0x4d32('0xa7'));_0x5d4658[_0x4d32('0x46')]('c.lastName',_0x4d32('0xa8'));_0x5d4658[_0x4d32('0x46')]('c.email',_0x4d32('0xa9'));_0x5d4658[_0x4d32('0x46')]('c.phone',_0x4d32('0xaa'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xab'),_0x4d32('0xac'));_0x5d4658[_0x4d32('0x46')](_0x4d32('0xad'),_0x4d32('0xae'));_0x5d4658['field'](_0x4d32('0xaf'),'Owner.fullname');_0x5d4658['field']('o.internal','Owner.internal');_0x5d4658['field'](_0x4d32('0xb0'),_0x4d32('0x24'));}if(_0x5173d9[_0x4d32('0x1a')])_0x5d4658[_0x4d32('0x1a')](_0x5173d9[_0x4d32('0x1a')]);if(_0x5173d9[_0x4d32('0x19')])_0x5d4658[_0x4d32('0x19')](_0x5173d9[_0x4d32('0x19')]);return db[_0x4d32('0x90')][_0x4d32('0x3a')](_0x5d4658[_0x4d32('0x91')](),_0x3a29c1);})['then'](function(_0x46bd1d){if(_0x46bd1d[_0x4d32('0x3e')]>0x0)_0x327cf6[_0x4d32('0x43')](_0x4d32('0xb1'),_[_0x4d32('0x33')](_0x46bd1d,'id'));return db[_0x4d32('0x90')][_0x4d32('0x3a')](_0x327cf6[_0x4d32('0x91')](),_0x3a29c1)[_0x4d32('0x2e')](function(_0x604515){var _0x48bb5a=_[_0x4d32('0xb2')](_0x604515,_0x4d32('0xb3'));var _0x302830=[];return db['Setting']['findOne']({'attributes':[_0x4d32('0xb4')],'raw':!![]})[_0x4d32('0x2e')](function(_0x436163){var _0x3df076=_0x436163[_0x4d32('0xb4')];_0x46bd1d[_0x4d32('0x27')](function(_0x2e150e){_0x302830[_0x4d32('0x28')](updateMailInteraction(_0x2e150e,_0x22073d,_0x48bb5a,_0x3df076));});return BPromise[_0x4d32('0xb5')](_0x302830);});});});})[_0x4d32('0x2e')](function(_0x1c80d2){_0xa7c370[_0x4d32('0xb6')]=_0x1c80d2;return _0xa7c370;})[_0x4d32('0x2e')](respondWithFilteredResult(_0x396ff6,_0x5173d9))[_0x4d32('0x31')](handleError(_0x396ff6,null));};exports[_0x4d32('0xb7')]=function(_0x187e2a,_0x269de7){var _0x21f800={'raw':![],'where':{'id':_0x187e2a['params']['id']}},_0x5df14f={};_0x5df14f[_0x4d32('0x38')]=_[_0x4d32('0x39')](db[_0x4d32('0x93')][_0x4d32('0x34')]);_0x5df14f[_0x4d32('0x3a')]=_['keys'](_0x187e2a['query']);_0x5df14f[_0x4d32('0x3b')]=_['intersection'](_0x5df14f[_0x4d32('0x38')],_0x5df14f[_0x4d32('0x3a')]);_0x21f800['attributes']=_['intersection'](_0x5df14f[_0x4d32('0x38')],qs['fields'](_0x187e2a[_0x4d32('0x3a')][_0x4d32('0x3d')]));_0x21f800[_0x4d32('0x3f')]=_0x21f800[_0x4d32('0x3f')][_0x4d32('0x3e')]?_0x21f800['attributes']:_0x5df14f[_0x4d32('0x38')];if(_0x187e2a['query'][_0x4d32('0xb8')]){_0x21f800[_0x4d32('0xb9')]=[{'all':!![]}];}_0x21f800=_['merge']({},_0x21f800,_0x187e2a['options']);return db[_0x4d32('0x93')][_0x4d32('0x5e')](_0x21f800)['then'](handleEntityNotFound(_0x269de7,null))[_0x4d32('0x2e')](respondWithResult(_0x269de7,null))[_0x4d32('0x31')](handleError(_0x269de7,null));};exports[_0x4d32('0xba')]=function(_0x4118fb,_0x1cb704){return db['MailInteraction'][_0x4d32('0xba')](_0x4118fb['body'],{})[_0x4d32('0x2e')](respondWithResult(_0x1cb704,0xc9))[_0x4d32('0x31')](handleError(_0x1cb704,null));};exports[_0x4d32('0xbb')]=function(_0x5a472d,_0x245d36){if(_0x5a472d[_0x4d32('0xbc')]['id']){delete _0x5a472d['body']['id'];}return db['MailInteraction'][_0x4d32('0x5e')]({'where':{'id':_0x5a472d[_0x4d32('0xbd')]['id']}})['then'](handleEntityNotFound(_0x245d36,null))[_0x4d32('0x2e')](saveUpdates(_0x5a472d[_0x4d32('0xbc')],null))['then'](respondWithResult(_0x245d36,null))[_0x4d32('0x31')](handleError(_0x245d36,null));};exports['destroy']=function(_0x3b83d5,_0x3cf294){return db[_0x4d32('0x93')][_0x4d32('0x5e')]({'where':{'id':_0x3b83d5[_0x4d32('0xbd')]['id']}})['then'](handleEntityNotFound(_0x3cf294,null))[_0x4d32('0x2e')](removeEntity(_0x3cf294,null))[_0x4d32('0x31')](handleError(_0x3cf294,null));};exports['describe']=function(_0x2e64a9,_0x51d730){return db[_0x4d32('0x93')][_0x4d32('0xbe')]()[_0x4d32('0x2e')](respondWithResult(_0x51d730,null))[_0x4d32('0x31')](handleError(_0x51d730,null));};exports[_0x4d32('0xbf')]=function(_0x3df402,_0x567d97){return db['MailMessage'][_0x4d32('0x5e')]({'where':{'id':_0x3df402['params']['id']}})[_0x4d32('0x2e')](handleEntityNotFound(_0x567d97,null))[_0x4d32('0x2e')](function(_0x57e1aa){if(_0x57e1aa){return _0x57e1aa['addMessage'](_0x3df402[_0x4d32('0xbc')]['ids'],_[_0x4d32('0xc0')](_0x3df402[_0x4d32('0xbc')],[_0x4d32('0xc1'),'id'])||{});}})['then'](respondWithResult(_0x567d97,null))[_0x4d32('0x31')](handleError(_0x567d97,null));};exports[_0x4d32('0xc2')]=function(_0x236682,_0x595681){var _0x3fabcf={'raw':![],'where':{}};var _0x186118={};var _0xececc0={'count':0x0,'rows':[]};return db[_0x4d32('0x93')]['findOne']({'where':{'id':_0x236682[_0x4d32('0xbd')]['id']}})[_0x4d32('0x2e')](handleEntityNotFound(_0x595681,null))[_0x4d32('0x2e')](function(_0x33a205){if(_0x33a205){_0x186118[_0x4d32('0x38')]=_[_0x4d32('0x39')](db['MailMessage'][_0x4d32('0x34')]);_0x186118[_0x4d32('0x3a')]=_[_0x4d32('0x39')](_0x236682[_0x4d32('0x3a')]);_0x186118['filters']=_[_0x4d32('0x3c')](_0x186118[_0x4d32('0x38')],_0x186118['query']);_0x3fabcf[_0x4d32('0x3f')]=_[_0x4d32('0x3c')](_0x186118[_0x4d32('0x38')],qs[_0x4d32('0x3d')](_0x236682[_0x4d32('0x3a')][_0x4d32('0x3d')]));_0x3fabcf[_0x4d32('0x3f')]=_0x3fabcf[_0x4d32('0x3f')][_0x4d32('0x3e')]?_0x3fabcf[_0x4d32('0x3f')]:_0x186118[_0x4d32('0x38')];if(!_0x236682[_0x4d32('0x3a')][_0x4d32('0xc3')]('nolimit')){_0x3fabcf[_0x4d32('0x1a')]=qs[_0x4d32('0x1a')](_0x236682['query']['limit']);_0x3fabcf[_0x4d32('0x19')]=qs[_0x4d32('0x19')](_0x236682[_0x4d32('0x3a')][_0x4d32('0x19')]);}_0x3fabcf[_0x4d32('0x41')]=qs[_0x4d32('0x42')](_0x236682[_0x4d32('0x3a')]['sort']);_0x3fabcf[_0x4d32('0x43')]=qs[_0x4d32('0x3b')](_['pick'](_0x236682['query'],_0x186118[_0x4d32('0x3b')]));_0x3fabcf['where']['MailInteractionId']=_0x33a205['id'];if(_0x236682[_0x4d32('0x3a')]['filter']){_0x3fabcf[_0x4d32('0x43')]=_[_0x4d32('0x92')](_0x3fabcf[_0x4d32('0x43')],{'$or':_[_0x4d32('0x33')](_0x3fabcf['attributes'],function(_0x23c912){var _0x1cd46d={};_0x1cd46d[_0x23c912]={'$like':'%'+_0x236682['query'][_0x4d32('0x7d')]+'%'};return _0x1cd46d;})});}if(_0x236682[_0x4d32('0x3a')][_0x4d32('0x75')]){var _0x49065f=_0x236682[_0x4d32('0x3a')][_0x4d32('0x75')][_0x4d32('0x26')](',');var _0x95d20b={};_0x95d20b[_0x49065f[0x0]]={'$gte':moment(_0x49065f[0x1])[_0x4d32('0xc4')](_0x4d32('0xc5'))};_0x3fabcf[_0x4d32('0x43')]=_[_0x4d32('0x92')](_0x3fabcf[_0x4d32('0x43')],_0x95d20b);}_0x3fabcf=_[_0x4d32('0x92')]({},_0x3fabcf,_0x236682[_0x4d32('0xc6')]);return db['MailMessage']['count']({'where':_0x3fabcf[_0x4d32('0x43')]})[_0x4d32('0x2e')](function(_0x4368b0){_0xececc0[_0x4d32('0x1c')]=_0x4368b0;if(_0x236682[_0x4d32('0x3a')][_0x4d32('0xb8')]){_0x3fabcf[_0x4d32('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0x4d32('0xc7')](_0x3fabcf);})[_0x4d32('0x2e')](function(_0x4eda94){if(_0x236682[_0x4d32('0x3a')][_0x4d32('0xc8')]===_0x4d32('0xc9')){for(var _0x3ddeaf=0x0;_0x3ddeaf<_0x4eda94['length'];_0x3ddeaf++){_0x4eda94[_0x3ddeaf][_0x4d32('0xbc')]=juice(_0x4eda94[_0x3ddeaf]['body']);}}_0xececc0[_0x4d32('0xb6')]=_0x4eda94;return _0xececc0;});}})[_0x4d32('0x2e')](respondWithFilteredResult(_0x595681,_0x3fabcf))[_0x4d32('0x31')](handleError(_0x595681,null));};exports[_0x4d32('0xca')]=function(_0x355d37,_0x12222e){return db[_0x4d32('0x93')]['find']({'where':{'id':_0x355d37['params']['id']}})[_0x4d32('0x2e')](handleEntityNotFound(_0x12222e,null))[_0x4d32('0x2e')](function(_0x15eec7){if(_0x15eec7){return _0x15eec7[_0x4d32('0xcb')](_0x355d37[_0x4d32('0xbc')]['ids'],_[_0x4d32('0xc0')](_0x355d37[_0x4d32('0xbc')],[_0x4d32('0xc1'),'id'])||{})[_0x4d32('0xcc')](function(){return db['Tag'][_0x4d32('0xc7')]({'attributes':['id',_0x4d32('0x21'),_0x4d32('0x47')],'where':{'id':_0x355d37[_0x4d32('0xbc')][_0x4d32('0xc1')]}});})['then'](function(_0x4170b8){socket[_0x4d32('0xcd')](_0x4d32('0xce'),{'id':Number(_0x355d37[_0x4d32('0xbd')]['id']),'tags':_0x4170b8||[]});return{'id':Number(_0x355d37[_0x4d32('0xbd')]['id']),'tags':_0x4170b8||[]};});}})[_0x4d32('0x2e')](respondWithResult(_0x12222e,null))[_0x4d32('0x31')](handleError(_0x12222e,null));};exports[_0x4d32('0xcf')]=function(_0x5cdd68,_0x19aca3){return db[_0x4d32('0x93')][_0x4d32('0x5e')]({'where':{'id':_0x5cdd68[_0x4d32('0xbd')]['id']}})['then'](handleEntityNotFound(_0x19aca3,null))[_0x4d32('0x2e')](function(_0x5c5a91){if(_0x5c5a91){return _0x5c5a91[_0x4d32('0xcf')](_0x5cdd68[_0x4d32('0x3a')][_0x4d32('0xc1')]);}})[_0x4d32('0x2e')](respondWithStatusCode(_0x19aca3,null))[_0x4d32('0x31')](handleError(_0x19aca3,null));};exports['download']=function(_0x4c8a79,_0x4312ad){var _0x453dc1=moment()[_0x4d32('0xd0')]()['toString']();var _0x30a54a=path[_0x4d32('0xd1')](config[_0x4d32('0xd2')],_0x4d32('0xd3'),'files','tmp');var _0x1388fe=path[_0x4d32('0xd1')](config[_0x4d32('0xd2')],_0x4d32('0xd3'),_0x4d32('0xd4'),_0x4d32('0xd5'));var _0x51ce52=path[_0x4d32('0xd1')](_0x30a54a,_0x453dc1);var _0x201411=util[_0x4d32('0xc4')](_0x4d32('0xd6'),_0x4c8a79[_0x4d32('0xbd')]['id'],_0x453dc1);var _0x2138b7=path[_0x4d32('0xd1')](_0x30a54a,_0x201411);var _0x28741b=[];if(_0x4c8a79['query']['attachments']){_0x28741b[_0x4d32('0x28')]({'model':db[_0x4d32('0xd7')],'as':_0x4d32('0xd8'),'raw':!![]});}var _0x58a24e=[{'model':db['MailMessage'],'as':_0x4d32('0xd9'),'attributes':['id','body',_0x4d32('0x48'),'to','cc',_0x4d32('0xda'),'subject','createdAt'],'where':{'secret':![]},'order':qs[_0x4d32('0x42')]('id'),'include':_0x28741b}];return db[_0x4d32('0x93')]['find']({'where':{'id':_0x4c8a79['params']['id']},'include':_0x58a24e})[_0x4d32('0x2e')](handleEntityNotFound(_0x4312ad,null))[_0x4d32('0x2e')](function(_0x38a2e6){if(_0x38a2e6&&_0x38a2e6[_0x4d32('0xd9')]){var _0x3bcdf7=_0x38a2e6[_0x4d32('0xdb')]({'plain':!![]});fs[_0x4d32('0xdc')](_0x51ce52);return BPromise[_0x4d32('0xdd')](_0x3bcdf7[_0x4d32('0xd9')],function(_0x2f87b1,_0x468bcb){var _0x9b78fa={'from':_0x2f87b1[_0x4d32('0x48')],'to':_0x2f87b1['to'],'subject':_0x2f87b1[_0x4d32('0xde')],'html':htmlEntities[_0x4d32('0xdf')](_0x2f87b1[_0x4d32('0xbc')]),'headers':{'Date':moment(_0x2f87b1[_0x4d32('0x73')])[_0x4d32('0xc4')](_0x4d32('0xe0'))},'attachments':[]};if(_0x2f87b1['cc']){_0x9b78fa[_0x4d32('0xe1')]['Cc']=_0x2f87b1['cc'];}if(_0x2f87b1[_0x4d32('0xda')]){_0x9b78fa[_0x4d32('0xe1')]['Bcc']=_0x2f87b1[_0x4d32('0xda')];}return new BPromise(function(_0x411251,_0x15fbbf){if(_0x2f87b1[_0x4d32('0xd8')]){for(var _0x679490=0x0;_0x679490<_0x2f87b1['Attachments'][_0x4d32('0x3e')];_0x679490++){var _0x1c7e72=_0x2f87b1['Attachments'][_0x679490];var _0x554c53=path[_0x4d32('0xd1')](_0x1388fe,_0x1c7e72[_0x4d32('0xe2')]);if(fs[_0x4d32('0xe3')](_0x554c53)){_0x9b78fa[_0x4d32('0xd5')][_0x4d32('0x28')]({'name':_0x1c7e72[_0x4d32('0x21')],'contentType':_0x1c7e72[_0x4d32('0x36')],'data':fs[_0x4d32('0xe4')](_0x554c53)});}}}emlformat[_0x4d32('0xe5')](_0x9b78fa,function(_0x256710,_0x53fe08){if(_0x256710)return _0x15fbbf(_0x256710);fs[_0x4d32('0xe6')](path[_0x4d32('0xd1')](_0x51ce52,util[_0x4d32('0xc4')](_0x4d32('0xe7'),_0x468bcb)),_0x53fe08);return _0x411251(_0x53fe08);});});})[_0x4d32('0x2e')](function(){return new BPromise(function(_0x106baf,_0x175ee2){zipdir(_0x51ce52,{'saveTo':_0x2138b7},function(_0x3b7a58,_0x50215d){if(_0x3b7a58)return _0x175ee2(_0x3b7a58);return _0x106baf(_0x50215d);});})['then'](function(){return new BPromise(function(_0x52a7a8,_0x382d41){rimraf(_0x51ce52,function(_0x124421){if(_0x124421)_0x382d41(_0x124421);return _0x52a7a8();});});})[_0x4d32('0x2e')](function(){return _0x4312ad[_0x4d32('0xe8')](_0x2138b7,_0x201411,function(_0x48f7f6){if(!_0x48f7f6)fs[_0x4d32('0xe9')](_0x2138b7);});});});}else{return _0x4312ad[_0x4d32('0x16')](0xc8);}})['catch'](handleError(_0x4312ad,null));};
\ No newline at end of file
index 3cc53e9..bc4f43e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28db=['length','emit','catch','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','getUsers','then','setDataValue','unreadMessages'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x28db,0xd7));var _0xb28d=function(_0x4ae745,_0x5a2e11){_0x4ae745=_0x4ae745-0x0;var _0x15a0bb=_0x28db[_0x4ae745];return _0x15a0bb;};'use strict';var EventEmitter=require(_0xb28d('0x0'));var MailInteraction=require(_0xb28d('0x1'))['db'][_0xb28d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xb28d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb28d('0x4')](0x0);var events={'afterCreate':_0xb28d('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5225dd){return function(_0x30a6a9,_0x44f222,_0x500282){_0x30a6a9[_0xb28d('0x6')]({'attributes':['id'],'raw':!![]})[_0xb28d('0x7')](function(_0x71bb13){_0x30a6a9[_0xb28d('0x8')]('Users',_0x71bb13['map'](function(_0x3a7d85){return{'id':_0x3a7d85['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x30a6a9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb28d('0x7')](function(_0x1cafad){_0x30a6a9[_0xb28d('0x8')](_0xb28d('0x9'),_0x1cafad[_0xb28d('0xa')]);MailInteractionEvents[_0xb28d('0xb')](_0x5225dd+':'+_0x30a6a9['id'],_0x30a6a9);MailInteractionEvents[_0xb28d('0xb')](_0x5225dd,_0x30a6a9);_0x500282(null);})[_0xb28d('0xc')](_0x500282(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xb28d('0xd')](e,emitEvent(event));}}module[_0xb28d('0xe')]=MailInteractionEvents;
\ No newline at end of file
+var _0x1881=['emit','catch','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0x1881,0x124));var _0x1188=function(_0x19e89d,_0x4793ce){_0x19e89d=_0x19e89d-0x0;var _0x48aeed=_0x1881[_0x19e89d];return _0x48aeed;};'use strict';var EventEmitter=require(_0x1188('0x0'));var MailInteraction=require(_0x1188('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x1188('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x1188('0x3')](0x0);var events={'afterCreate':_0x1188('0x4'),'afterUpdate':_0x1188('0x5'),'afterDestroy':_0x1188('0x6')};function emitEvent(_0x1bf61){return function(_0x205f5c,_0x329bbb,_0x298326){_0x205f5c[_0x1188('0x7')]({'attributes':['id'],'raw':!![]})[_0x1188('0x8')](function(_0x3260c5){_0x205f5c[_0x1188('0x9')](_0x1188('0xa'),_0x3260c5['map'](function(_0x2d477a){return{'id':_0x2d477a['id']};}));return MailMessage[_0x1188('0xb')]({'where':{'MailInteractionId':_0x205f5c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1188('0x8')](function(_0x106669){_0x205f5c['setDataValue'](_0x1188('0xc'),_0x106669[_0x1188('0xd')]);MailInteractionEvents['emit'](_0x1bf61+':'+_0x205f5c['id'],_0x205f5c);MailInteractionEvents[_0x1188('0xe')](_0x1bf61,_0x205f5c);_0x298326(null);})[_0x1188('0xf')](_0x298326(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x1188('0x10')]=MailInteractionEvents;
\ No newline at end of file
index 6ba227a..a91b880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c43=['get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','util','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','changed','closed','closedAt','models'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4c43,0xd6));var _0x34c4=function(_0x9d3ac3,_0x23f2e0){_0x9d3ac3=_0x9d3ac3-0x0;var _0x30e910=_0x4c43[_0x9d3ac3];return _0x30e910;};'use strict';var _=require('lodash');var util=require(_0x34c4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x34c4('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34c4('0x2'));var rimraf=require(_0x34c4('0x3'));var config=require(_0x34c4('0x4'));var attributes=require(_0x34c4('0x5'));module[_0x34c4('0x6')]=function(_0x1e98c2,_0x554fed){return _0x1e98c2[_0x34c4('0x7')](_0x34c4('0x8'),attributes,{'tableName':_0x34c4('0x9'),'paranoid':![],'indexes':[{'name':_0x34c4('0xa'),'fields':['subject','to'],'type':_0x34c4('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51c7fc,_0xc9297e,_0x3f84e2){if(_0x51c7fc[_0x34c4('0xc')]){_0x51c7fc[_0x34c4('0xd')]=moment()[_0x34c4('0xe')](_0x34c4('0xf'));}if(_0x51c7fc['closed']){_0x51c7fc['closedAt']=moment()['format'](_0x34c4('0xf'));}_0x3f84e2(null,_0xc9297e);},'beforeUpdate':function(_0x38f36a,_0x4fb46c,_0x35035b){if(_0x38f36a[_0x34c4('0x10')](_0x34c4('0xc'))){_0x38f36a['substatusAt']=_0x38f36a[_0x34c4('0xc')]?moment()['format'](_0x34c4('0xf')):null;}if(_0x38f36a[_0x34c4('0x10')](_0x34c4('0x11'))){_0x38f36a[_0x34c4('0x12')]=moment()[_0x34c4('0xe')](_0x34c4('0xf'));_0x38f36a[_0x34c4('0xc')]=null;_0x38f36a[_0x34c4('0xd')]=null;}_0x35035b(null,_0x38f36a);},'afterUpdate':function(_0x4e1130,_0x2dfd6b,_0x7cb25){var _0x5aca49=_0x1e98c2[_0x34c4('0x13')];var _0x56bffc=_0x4e1130[_0x34c4('0x14')]({'plain':!![]});if(_0x56bffc[_0x34c4('0x11')]){return _0x5aca49[_0x34c4('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x56bffc['id']}})[_0x34c4('0x16')](function(){_0x7cb25();})[_0x34c4('0x17')](function(_0x2daf2f){_0x7cb25(_0x2daf2f);});}else{_0x7cb25();}}},'charset':_0x34c4('0x18'),'collate':_0x34c4('0x19')});};
\ No newline at end of file
+var _0xfa5e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','models','get','MailMessage','update','then','catch'];(function(_0x405a60,_0x2894e5){var _0x33161c=function(_0x342ea4){while(--_0x342ea4){_0x405a60['push'](_0x405a60['shift']());}};_0x33161c(++_0x2894e5);}(_0xfa5e,0x91));var _0xefa5=function(_0x48a69d,_0x24119e){_0x48a69d=_0x48a69d-0x0;var _0x25096a=_0xfa5e[_0x48a69d];return _0x25096a;};'use strict';var _=require(_0xefa5('0x0'));var util=require(_0xefa5('0x1'));var logger=require(_0xefa5('0x2'))(_0xefa5('0x3'));var moment=require(_0xefa5('0x4'));var BPromise=require(_0xefa5('0x5'));var rp=require(_0xefa5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefa5('0x7'));var config=require(_0xefa5('0x8'));var attributes=require(_0xefa5('0x9'));module[_0xefa5('0xa')]=function(_0x16d957,_0x1a80b4){return _0x16d957[_0xefa5('0xb')](_0xefa5('0xc'),attributes,{'tableName':_0xefa5('0xd'),'paranoid':![],'indexes':[{'name':_0xefa5('0xe'),'fields':[_0xefa5('0xf'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38a533,_0x759088,_0x461820){if(_0x38a533[_0xefa5('0x10')]){_0x38a533[_0xefa5('0x11')]=moment()[_0xefa5('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x38a533[_0xefa5('0x13')]){_0x38a533[_0xefa5('0x14')]=moment()['format'](_0xefa5('0x15'));}_0x461820(null,_0x759088);},'beforeUpdate':function(_0x22c226,_0xe1de3e,_0x33ee9c){if(_0x22c226['changed']('substatus')){_0x22c226['substatusAt']=_0x22c226[_0xefa5('0x10')]?moment()[_0xefa5('0x12')](_0xefa5('0x15')):null;}if(_0x22c226[_0xefa5('0x16')](_0xefa5('0x13'))){_0x22c226[_0xefa5('0x14')]=moment()[_0xefa5('0x12')](_0xefa5('0x15'));_0x22c226[_0xefa5('0x10')]=null;_0x22c226[_0xefa5('0x11')]=null;}_0x33ee9c(null,_0x22c226);},'afterUpdate':function(_0x51efb7,_0x1eb9b6,_0x2993bb){var _0x394857=_0x16d957[_0xefa5('0x17')];var _0xaa7c2f=_0x51efb7[_0xefa5('0x18')]({'plain':!![]});if(_0xaa7c2f[_0xefa5('0x13')]){return _0x394857[_0xefa5('0x19')][_0xefa5('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0xaa7c2f['id']}})[_0xefa5('0x1b')](function(){_0x2993bb();})[_0xefa5('0x1c')](function(_0x2875e5){_0x2993bb(_0x2875e5);});}else{_0x2993bb();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 6aea37e..e31ea8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d0=['message','info','MailInteraction','update','body','options','raw','where','limit','then','UpdateMailInteraction','catch','AddTagsToMailInteraction','find','ids','omit','AddTags','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x190bdd,_0x1f9a69){var _0x4b08ff=function(_0x58e1d0){while(--_0x58e1d0){_0x190bdd['push'](_0x190bdd['shift']());}};_0x4b08ff(++_0x1f9a69);}(_0xd2d0,0x80));var _0x0d2d=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd2d0[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0d2d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d2d('0x1'));var db=require(_0x0d2d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d2d('0x3'))(_0x0d2d('0x4'));var config=require(_0x0d2d('0x5'));var jayson=require(_0x0d2d('0x6'));var client=jayson[_0x0d2d('0x7')]['http']({'port':0x232a});config[_0x0d2d('0x8')]=_[_0x0d2d('0x9')](config['redis'],{'host':_0x0d2d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d2d('0x8')]));require(_0x0d2d('0xb'))[_0x0d2d('0xc')](socket);function respondWithRpcPromise(_0x459390,_0x41c4cf,_0x343c14){return new BPromise(function(_0x336dd4,_0x7dcc5e){return client[_0x0d2d('0xd')](_0x459390,_0x343c14)['then'](function(_0x54d451){logger['info'](_0x0d2d('0xe'),_0x41c4cf,_0x0d2d('0xf'));logger[_0x0d2d('0x10')](_0x0d2d('0x11'),_0x41c4cf,_0x0d2d('0xf'),JSON[_0x0d2d('0x12')](_0x54d451));if(_0x54d451[_0x0d2d('0x13')]){if(_0x54d451['error']['code']===0x1f4){logger[_0x0d2d('0x13')](_0x0d2d('0xe'),_0x41c4cf,_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);return _0x7dcc5e(_0x54d451['error'][_0x0d2d('0x14')]);}logger['error'](_0x0d2d('0xe'),_0x41c4cf,_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);return _0x336dd4(_0x54d451[_0x0d2d('0x13')][_0x0d2d('0x14')]);}else{logger[_0x0d2d('0x15')](_0x0d2d('0xe'),_0x41c4cf,_0x0d2d('0xf'));_0x336dd4(_0x54d451['result']['message']);}})['catch'](function(_0x2ab016){logger[_0x0d2d('0x13')]('MailInteraction,\x20%s,\x20%s',_0x41c4cf,_0x2ab016);_0x7dcc5e(_0x2ab016);});});}exports['UpdateMailInteraction']=function(_0x1bc278){var _0x3ad219=this;return new Promise(function(_0x516978,_0x320cc8){return db[_0x0d2d('0x16')][_0x0d2d('0x17')](_0x1bc278[_0x0d2d('0x18')],{'raw':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1b')]||null:null,'attributes':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')]['attributes']||null:null,'limit':_0x1bc278[_0x0d2d('0x19')]?_0x1bc278[_0x0d2d('0x19')][_0x0d2d('0x1c')]||null:null})[_0x0d2d('0x1d')](function(_0x335caf){logger['info'](_0x0d2d('0x1e'),_0x1bc278);logger[_0x0d2d('0x10')](_0x0d2d('0x1e'),_0x1bc278,JSON[_0x0d2d('0x12')](_0x335caf));_0x516978(_0x335caf);})[_0x0d2d('0x1f')](function(_0xf09fd4){logger[_0x0d2d('0x13')](_0x0d2d('0x1e'),_0xf09fd4[_0x0d2d('0x14')],_0x1bc278);_0x320cc8(_0x3ad219['error'](0x1f4,_0xf09fd4[_0x0d2d('0x14')]));});});};exports[_0x0d2d('0x20')]=function(_0x40e574){return new Promise(function(_0x28185c,_0x8788e0){return db[_0x0d2d('0x16')][_0x0d2d('0x21')]({'where':_0x40e574[_0x0d2d('0x19')]?_0x40e574[_0x0d2d('0x19')]['where']||null:null})['then'](function(_0xd3e526){if(_0xd3e526){return _0xd3e526['addTags'](_0x40e574[_0x0d2d('0x18')][_0x0d2d('0x22')],_[_0x0d2d('0x23')](_0x40e574[_0x0d2d('0x18')],[_0x0d2d('0x22'),'id'])||{});}})['spread'](function(_0x22acc7){logger[_0x0d2d('0x15')](_0x0d2d('0x24'),_0x40e574);logger[_0x0d2d('0x10')](_0x0d2d('0x24'),_0x40e574,JSON[_0x0d2d('0x12')](_0x22acc7));_0x28185c(_0x22acc7);})['catch'](function(_0x1a5105){logger[_0x0d2d('0x13')](_0x0d2d('0x24'),_0x1a5105[_0x0d2d('0x14')],_0x40e574);_0x8788e0(_this[_0x0d2d('0x13')](0x1f4,_0x1a5105[_0x0d2d('0x14')]));});});};
\ No newline at end of file
+var _0x4e47=['find','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','MailInteraction','update','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction'];(function(_0x28ebbc,_0x2b8681){var _0x9270bf=function(_0xa2ec0a){while(--_0xa2ec0a){_0x28ebbc['push'](_0x28ebbc['shift']());}};_0x9270bf(++_0x2b8681);}(_0x4e47,0x17f));var _0x74e4=function(_0x3eee49,_0x3a12b5){_0x3eee49=_0x3eee49-0x0;var _0x30fe98=_0x4e47[_0x3eee49];return _0x30fe98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74e4('0x0'));var BPromise=require(_0x74e4('0x1'));var rs=require(_0x74e4('0x2'));var fs=require('fs');var Redis=require(_0x74e4('0x3'));var db=require(_0x74e4('0x4'))['db'];var utils=require(_0x74e4('0x5'));var logger=require(_0x74e4('0x6'))(_0x74e4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74e4('0x8'));var client=jayson[_0x74e4('0x9')]['http']({'port':0x232a});config[_0x74e4('0xa')]=_[_0x74e4('0xb')](config[_0x74e4('0xa')],{'host':_0x74e4('0xc'),'port':0x18eb});var socket=require(_0x74e4('0xd'))(new Redis(config['redis']));require(_0x74e4('0xe'))[_0x74e4('0xf')](socket);function respondWithRpcPromise(_0x258940,_0x3525f8,_0xf13e3a){return new BPromise(function(_0x53567c,_0x46d9a7){return client[_0x74e4('0x10')](_0x258940,_0xf13e3a)['then'](function(_0x2f6d36){logger['info'](_0x74e4('0x11'),_0x3525f8,_0x74e4('0x12'));logger[_0x74e4('0x13')](_0x74e4('0x14'),_0x3525f8,_0x74e4('0x12'),JSON[_0x74e4('0x15')](_0x2f6d36));if(_0x2f6d36[_0x74e4('0x16')]){if(_0x2f6d36[_0x74e4('0x16')][_0x74e4('0x17')]===0x1f4){logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x2f6d36['error']['message']);return _0x46d9a7(_0x2f6d36['error']['message']);}logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x2f6d36[_0x74e4('0x16')]['message']);return _0x53567c(_0x2f6d36[_0x74e4('0x16')][_0x74e4('0x18')]);}else{logger[_0x74e4('0x19')](_0x74e4('0x11'),_0x3525f8,_0x74e4('0x12'));_0x53567c(_0x2f6d36[_0x74e4('0x1a')][_0x74e4('0x18')]);}})[_0x74e4('0x1b')](function(_0x4c9d2d){logger[_0x74e4('0x16')](_0x74e4('0x11'),_0x3525f8,_0x4c9d2d);_0x46d9a7(_0x4c9d2d);});});}exports['UpdateMailInteraction']=function(_0x4eb613){var _0x4aebb0=this;return new Promise(function(_0x34f532,_0x35c41a){return db[_0x74e4('0x1c')][_0x74e4('0x1d')](_0x4eb613[_0x74e4('0x1e')],{'raw':_0x4eb613[_0x74e4('0x1f')]?_0x4eb613[_0x74e4('0x1f')][_0x74e4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eb613[_0x74e4('0x1f')]?_0x4eb613['options'][_0x74e4('0x21')]||null:null,'attributes':_0x4eb613[_0x74e4('0x1f')]?_0x4eb613[_0x74e4('0x1f')]['attributes']||null:null,'limit':_0x4eb613[_0x74e4('0x1f')]?_0x4eb613['options'][_0x74e4('0x22')]||null:null})['then'](function(_0x143549){logger[_0x74e4('0x19')](_0x74e4('0x23'),_0x4eb613);logger['debug'](_0x74e4('0x23'),_0x4eb613,JSON['stringify'](_0x143549));_0x34f532(_0x143549);})[_0x74e4('0x1b')](function(_0xc4ae99){logger[_0x74e4('0x16')](_0x74e4('0x23'),_0xc4ae99[_0x74e4('0x18')],_0x4eb613);_0x35c41a(_0x4aebb0['error'](0x1f4,_0xc4ae99[_0x74e4('0x18')]));});});};exports[_0x74e4('0x24')]=function(_0x1dd270){return new Promise(function(_0x68ad72,_0x4a0b02){return db[_0x74e4('0x1c')][_0x74e4('0x25')]({'where':_0x1dd270[_0x74e4('0x1f')]?_0x1dd270[_0x74e4('0x1f')][_0x74e4('0x21')]||null:null})['then'](function(_0x4e7a6c){if(_0x4e7a6c){return _0x4e7a6c[_0x74e4('0x26')](_0x1dd270[_0x74e4('0x1e')][_0x74e4('0x27')],_[_0x74e4('0x28')](_0x1dd270[_0x74e4('0x1e')],[_0x74e4('0x27'),'id'])||{});}})['spread'](function(_0x557383){logger[_0x74e4('0x19')]('AddTags',_0x1dd270);logger['debug'](_0x74e4('0x29'),_0x1dd270,JSON[_0x74e4('0x15')](_0x557383));_0x68ad72(_0x557383);})[_0x74e4('0x1b')](function(_0x4ba391){logger[_0x74e4('0x16')](_0x74e4('0x29'),_0x4ba391['message'],_0x1dd270);_0x4a0b02(_this[_0x74e4('0x16')](0x1f4,_0x4ba391[_0x74e4('0x18')]));});});};
\ No newline at end of file
index 094a968..75ac7e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14d4=['mailInteraction:','./mailInteraction.events','save','remove','update','removeListener','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14d4,0xfd));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require(_0x414d('0x0'));var events=[_0x414d('0x1'),_0x414d('0x2'),_0x414d('0x3')];function createListener(_0x24194d,_0x1c6818){return function(_0x478069){_0x1c6818['emit'](_0x24194d,_0x478069);};}function removeListener(_0x536ff2,_0x36335c){return function(){MailInteractionEvents[_0x414d('0x4')](_0x536ff2,_0x36335c);};}exports['register']=function(_0x2aa1fd){for(var _0x4e93c7=0x0,_0x2622ee=events[_0x414d('0x5')];_0x4e93c7<_0x2622ee;_0x4e93c7++){var _0xd481ab=events[_0x4e93c7];var _0x5b262b=createListener(_0x414d('0x6')+_0xd481ab,_0x2aa1fd);MailInteractionEvents['on'](_0xd481ab,_0x5b262b);}};
\ No newline at end of file
+var _0x1ec2=['save','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x1f1e93,_0x3beb0f){var _0x1a770c=function(_0x560c2a){while(--_0x560c2a){_0x1f1e93['push'](_0x1f1e93['shift']());}};_0x1a770c(++_0x3beb0f);}(_0x1ec2,0x125));var _0x21ec=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x1ec2[_0x110c3d];return _0x226d67;};'use strict';var MailInteractionEvents=require(_0x21ec('0x0'));var events=[_0x21ec('0x1'),'remove','update'];function createListener(_0x3358e1,_0x3f89cf){return function(_0x240e7f){_0x3f89cf[_0x21ec('0x2')](_0x3358e1,_0x240e7f);};}function removeListener(_0x5828bf,_0x59ce9f){return function(){MailInteractionEvents[_0x21ec('0x3')](_0x5828bf,_0x59ce9f);};}exports[_0x21ec('0x4')]=function(_0xe03352){for(var _0x79ff42=0x0,_0x5be7df=events[_0x21ec('0x5')];_0x79ff42<_0x5be7df;_0x79ff42++){var _0x16be4d=events[_0x79ff42];var _0x2e2f40=createListener(_0x21ec('0x6')+_0x16be4d,_0xe03352);MailInteractionEvents['on'](_0x16be4d,_0x2e2f40);}};
\ No newline at end of file
index b0353a2..1f6d403 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x515d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x515d,0x104));var _0xd515=function(_0x490605,_0xccbe84){_0x490605=_0x490605-0x0;var _0x56a9b7=_0x515d[_0x490605];return _0x56a9b7;};'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['download']);router[_0xd515('0x11')]('/',auth[_0xd515('0xc')](),interaction[_0xd515('0x12')](_0xd515('0x13'),'mailmessage:create'),controller[_0xd515('0x14')]);router[_0xd515('0x15')](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x16')]);router[_0xd515('0x15')](_0xd515('0x17'),auth[_0xd515('0xc')](),controller[_0xd515('0x18')]);router[_0xd515('0x15')](_0xd515('0x19'),auth[_0xd515('0xc')](),controller[_0xd515('0x1a')]);router['delete'](_0xd515('0xe'),auth[_0xd515('0xc')](),controller[_0xd515('0x1b')]);module[_0xd515('0x1c')]=router;
\ No newline at end of file
+var _0xfaf3=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','put','/:id','accept','/:id/reject','delete'];(function(_0x24dd75,_0x5a631c){var _0x23c218=function(_0x4b07e5){while(--_0x4b07e5){_0x24dd75['push'](_0x24dd75['shift']());}};_0x23c218(++_0x5a631c);}(_0xfaf3,0x93));var _0x3faf=function(_0x330d8f,_0x1fdc41){_0x330d8f=_0x330d8f-0x0;var _0x22e133=_0xfaf3[_0x330d8f];return _0x22e133;};'use strict';var multer=require(_0x3faf('0x0'));var util=require('util');var path=require(_0x3faf('0x1'));var timeout=require(_0x3faf('0x2'));var express=require(_0x3faf('0x3'));var router=express[_0x3faf('0x4')]();var fs_extra=require(_0x3faf('0x5'));var auth=require(_0x3faf('0x6'));var interaction=require(_0x3faf('0x7'));var config=require(_0x3faf('0x8'));var controller=require(_0x3faf('0x9'));router[_0x3faf('0xa')]('/',auth[_0x3faf('0xb')](),controller[_0x3faf('0xc')]);router[_0x3faf('0xa')](_0x3faf('0xd'),auth[_0x3faf('0xb')](),controller[_0x3faf('0xe')]);router[_0x3faf('0xa')]('/:id',auth[_0x3faf('0xb')](),controller[_0x3faf('0xf')]);router[_0x3faf('0xa')](_0x3faf('0x10'),auth[_0x3faf('0xb')](),controller['download']);router[_0x3faf('0x11')]('/',auth[_0x3faf('0xb')](),interaction[_0x3faf('0x12')](_0x3faf('0x13'),_0x3faf('0x14')),controller[_0x3faf('0x15')]);router[_0x3faf('0x16')](_0x3faf('0x17'),auth[_0x3faf('0xb')](),controller['update']);router[_0x3faf('0x16')]('/:id/accept',auth[_0x3faf('0xb')](),controller[_0x3faf('0x18')]);router['put'](_0x3faf('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x3faf('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x3faf('0x1b')]);module[_0x3faf('0x1c')]=router;
\ No newline at end of file
index a23c29c..b6334a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f8a=['DATE','Chat','lodash','exports','long','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x23a766,_0x2eab2c){var _0x439cd4=function(_0x4b2913){while(--_0x4b2913){_0x23a766['push'](_0x23a766['shift']());}};_0x439cd4(++_0x2eab2c);}(_0x5f8a,0x156));var _0xa5f8=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x5f8a[_0xb875ee];return _0x4c7f3a;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa5f8('0x0'));module[_0xa5f8('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa5f8('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xa5f8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa5f8('0x4')]('in',_0xa5f8('0x5')),'defaultValue':_0xa5f8('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa5f8('0x6')](0x1fe)},'from':{'type':Sequelize[_0xa5f8('0x6')]},'to':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'cc':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xa5f8('0x7')]},'sentAt':{'type':Sequelize[_0xa5f8('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xa5f8('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'originCc':{'type':Sequelize[_0xa5f8('0x7')](_0xa5f8('0x2'))},'originChannel':{'type':Sequelize[_0xa5f8('0x4')]('Email',_0xa5f8('0x9')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0xb528=['INTEGER','Email','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0xb528,0x18e));var _0x8b52=function(_0x103f27,_0x4c807b){_0x103f27=_0x103f27-0x0;var _0x993590=_0xb528[_0x103f27];return _0x993590;};'use strict';var Sequelize=require(_0x8b52('0x0'));var _=require('lodash');module[_0x8b52('0x1')]={'body':{'type':Sequelize[_0x8b52('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8b52('0x2')](_0x8b52('0x3'))},'read':{'type':Sequelize[_0x8b52('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8b52('0x5')]('in','out'),'defaultValue':_0x8b52('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8b52('0x7')](0x1fe)},'from':{'type':Sequelize[_0x8b52('0x7')]},'to':{'type':Sequelize[_0x8b52('0x2')](_0x8b52('0x8'))},'cc':{'type':Sequelize[_0x8b52('0x2')]('long')},'bcc':{'type':Sequelize[_0x8b52('0x2')](_0x8b52('0x8'))},'subject':{'type':Sequelize[_0x8b52('0x2')]},'sentAt':{'type':Sequelize[_0x8b52('0x9')]},'attach':{'type':Sequelize[_0x8b52('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8b52('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8b52('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x8b52('0x8'))},'originCc':{'type':Sequelize[_0x8b52('0x2')](_0x8b52('0x8'))},'originChannel':{'type':Sequelize[_0x8b52('0x5')](_0x8b52('0xb'),'Chat'),'defaultValue':_0x8b52('0xb'),'allowNull':![]}};
\ No newline at end of file
index 757458b..23c554f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3072=['sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','body','describe','create','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','defaults','ListId','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','User','reject','fromString','download','files','server','message-%s.eml','createdAt','Attachment','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','writeFileSync','eml-format','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','result','json','offset','limit','undefined','count','set','Content-Range','update','destroy','status','stack','name','send','index','map','MailMessage','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4bc16c,_0xdb80f0){var _0x1707ea=function(_0x3a5235){while(--_0x3a5235){_0x4bc16c['push'](_0x4bc16c['shift']());}};_0x1707ea(++_0xdb80f0);}(_0x3072,0x64));var _0x2307=function(_0x4b6aba,_0x10ade8){_0x4b6aba=_0x4b6aba-0x0;var _0x428c1d=_0x3072[_0x4b6aba];return _0x428c1d;};'use strict';var emlformat=require(_0x2307('0x0'));var moment=require('moment');var BPromise=require(_0x2307('0x1'));var util=require(_0x2307('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x2307('0x3'));var Redis=require(_0x2307('0x4'));var htmlToText=require('html-to-text');var qs=require(_0x2307('0x5'));var logger=require('../../config/logger')('api');var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x2307('0x6'));var db=require(_0x2307('0x7'))['db'];config[_0x2307('0x8')]=_['defaults'](config[_0x2307('0x8')],{'host':_0x2307('0x9'),'port':0x18eb});var socket=require(_0x2307('0xa'))(new Redis(config[_0x2307('0x8')]));var htmlEntities=require(_0x2307('0xb'));require(_0x2307('0xc'))[_0x2307('0xd')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2307('0xe')][_0x2307('0xf')]({'port':0x232c});var client9003=jayson[_0x2307('0xe')]['http']({'port':0x232b});var client9002=jayson['client'][_0x2307('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x214dae,_0x483297,_0x12a9c1,_0x5241d7){return new BPromise(function(_0x3dd7bc,_0x42acf5){var _0x22d23e=_0x5241d7||client;return _0x22d23e['request'](_0x214dae,_0x12a9c1)[_0x2307('0x10')](function(_0x181c17){logger['info']('MailMessage,\x20%s,\x20%s',_0x483297,_0x2307('0x11'));logger['debug'](_0x2307('0x12'),_0x483297,_0x2307('0x11'),JSON[_0x2307('0x13')](_0x181c17));if(_0x181c17[_0x2307('0x14')]){if(_0x181c17[_0x2307('0x14')]['code']===0x1f4){logger[_0x2307('0x14')](_0x2307('0x15'),_0x483297,_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);return _0x42acf5(_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);}logger[_0x2307('0x14')]('MailMessage,\x20%s,\x20%s',_0x483297,_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);return _0x3dd7bc(_0x181c17[_0x2307('0x14')][_0x2307('0x16')]);}else{logger['info'](_0x2307('0x15'),_0x483297,_0x2307('0x11'));_0x3dd7bc(_0x181c17[_0x2307('0x17')][_0x2307('0x16')]);}})['catch'](function(_0x2ed821){logger[_0x2307('0x14')]('MailMessage,\x20%s,\x20%s',_0x483297,_0x2ed821);_0x42acf5(_0x2ed821);});});}function respondWithResult(_0x241f4a,_0x3d8451){_0x3d8451=_0x3d8451||0xc8;return function(_0x429f63){if(_0x429f63){return _0x241f4a['status'](_0x3d8451)[_0x2307('0x18')](_0x429f63);}};}function respondWithFilteredResult(_0x3deddd,_0x2151f0){return function(_0x351aec){if(_0x351aec){var _0x57e126=typeof _0x2151f0[_0x2307('0x19')]==='undefined'&&typeof _0x2151f0[_0x2307('0x1a')]===_0x2307('0x1b');var _0x5c5279=_0x351aec['count'];var _0x16a552=_0x57e126?0x0:_0x2151f0[_0x2307('0x19')];var _0x53e62e=_0x57e126?_0x351aec[_0x2307('0x1c')]:_0x2151f0[_0x2307('0x19')]+_0x2151f0[_0x2307('0x1a')];var _0x4c0724;if(_0x53e62e>=_0x5c5279){_0x53e62e=_0x5c5279;_0x4c0724=0xc8;}else{_0x4c0724=0xce;}_0x3deddd['status'](_0x4c0724);return _0x3deddd[_0x2307('0x1d')](_0x2307('0x1e'),_0x16a552+'-'+_0x53e62e+'/'+_0x5c5279)[_0x2307('0x18')](_0x351aec);}return null;};}function saveUpdates(_0x2488f8){return function(_0x3e5c71){if(_0x3e5c71){return _0x3e5c71[_0x2307('0x1f')](_0x2488f8)[_0x2307('0x10')](function(_0x43a18c){return _0x43a18c;});}return null;};}function removeEntity(_0x11213e){return function(_0x2a16d4){if(_0x2a16d4){return _0x2a16d4[_0x2307('0x20')]()[_0x2307('0x10')](function(){_0x11213e[_0x2307('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502e54){return function(_0x5a3588){if(!_0x5a3588){_0x502e54['sendStatus'](0x194);}return _0x5a3588;};}function handleError(_0xce1360,_0x292bd3){_0x292bd3=_0x292bd3||0x1f4;return function(_0x389122){logger[_0x2307('0x14')](_0x389122[_0x2307('0x22')]);if(_0x389122[_0x2307('0x23')]){delete _0x389122['name'];}_0xce1360['status'](_0x292bd3)[_0x2307('0x24')](_0x389122);};}exports[_0x2307('0x25')]=function(_0x3aba27,_0x272494){var _0x3f8476={},_0x24f1e1={},_0xc5e810={'count':0x0,'rows':[]};var _0x119a05=_[_0x2307('0x26')](db[_0x2307('0x27')]['rawAttributes'],function(_0x6c1f8c){return{'name':_0x6c1f8c['fieldName'],'type':_0x6c1f8c['type']['key']};});_0x24f1e1[_0x2307('0x28')]=_[_0x2307('0x26')](_0x119a05,_0x2307('0x23'));_0x24f1e1[_0x2307('0x29')]=_[_0x2307('0x2a')](_0x3aba27[_0x2307('0x29')]);_0x24f1e1[_0x2307('0x2b')]=_['intersection'](_0x24f1e1['model'],_0x24f1e1[_0x2307('0x29')]);_0x3f8476[_0x2307('0x2c')]=_[_0x2307('0x2d')](_0x24f1e1['model'],qs[_0x2307('0x2e')](_0x3aba27['query'][_0x2307('0x2e')]));_0x3f8476[_0x2307('0x2c')]=_0x3f8476[_0x2307('0x2c')][_0x2307('0x2f')]?_0x3f8476[_0x2307('0x2c')]:_0x24f1e1['model'];if(!_0x3aba27['query'][_0x2307('0x30')](_0x2307('0x31'))){_0x3f8476[_0x2307('0x1a')]=qs['limit'](_0x3aba27[_0x2307('0x29')]['limit']);_0x3f8476[_0x2307('0x19')]=qs[_0x2307('0x19')](_0x3aba27['query'][_0x2307('0x19')]);}_0x3f8476[_0x2307('0x32')]=qs[_0x2307('0x33')](_0x3aba27[_0x2307('0x29')][_0x2307('0x33')]);_0x3f8476[_0x2307('0x34')]=qs[_0x2307('0x2b')](_['pick'](_0x3aba27[_0x2307('0x29')],_0x24f1e1[_0x2307('0x2b')]),_0x119a05);if(_0x3aba27[_0x2307('0x29')][_0x2307('0x35')]){_0x3f8476[_0x2307('0x34')]=_[_0x2307('0x36')](_0x3f8476[_0x2307('0x34')],{'$or':_['map'](_0x119a05,function(_0x426ca9){if(_0x426ca9[_0x2307('0x37')]!==_0x2307('0x38')){var _0x5d6b46={};_0x5d6b46[_0x426ca9[_0x2307('0x23')]]={'$like':'%'+_0x3aba27['query'][_0x2307('0x35')]+'%'};return _0x5d6b46;}})});}_0x3f8476=_[_0x2307('0x36')]({},_0x3f8476,_0x3aba27[_0x2307('0x39')]);var _0x1d612d={'where':_0x3f8476[_0x2307('0x34')]};return db['MailMessage']['count'](_0x1d612d)['then'](function(_0x816828){_0xc5e810[_0x2307('0x1c')]=_0x816828;if(_0x3aba27[_0x2307('0x29')][_0x2307('0x3a')]){_0x3f8476[_0x2307('0x3b')]=[{'all':!![]}];}return db[_0x2307('0x27')][_0x2307('0x3c')](_0x3f8476);})['then'](function(_0x7cd1dd){_0xc5e810['rows']=_0x7cd1dd;return _0xc5e810;})[_0x2307('0x10')](respondWithFilteredResult(_0x272494,_0x3f8476))['catch'](handleError(_0x272494,null));};exports[_0x2307('0x3d')]=function(_0x2be19a,_0xfe5284){var _0xa8ce0e={'raw':!![],'where':{'id':_0x2be19a[_0x2307('0x3e')]['id']}},_0x3607c1={};_0x3607c1[_0x2307('0x28')]=_['keys'](db['MailMessage'][_0x2307('0x3f')]);_0x3607c1[_0x2307('0x29')]=_['keys'](_0x2be19a[_0x2307('0x29')]);_0x3607c1[_0x2307('0x2b')]=_[_0x2307('0x2d')](_0x3607c1[_0x2307('0x28')],_0x3607c1[_0x2307('0x29')]);_0xa8ce0e[_0x2307('0x2c')]=_[_0x2307('0x2d')](_0x3607c1['model'],qs[_0x2307('0x2e')](_0x2be19a['query'][_0x2307('0x2e')]));_0xa8ce0e[_0x2307('0x2c')]=_0xa8ce0e[_0x2307('0x2c')][_0x2307('0x2f')]?_0xa8ce0e['attributes']:_0x3607c1['model'];if(_0x2be19a[_0x2307('0x29')]['includeAll']){_0xa8ce0e[_0x2307('0x3b')]=[{'all':!![]}];}_0xa8ce0e=_[_0x2307('0x36')]({},_0xa8ce0e,_0x2be19a['options']);return db[_0x2307('0x27')][_0x2307('0x40')](_0xa8ce0e)['then'](handleEntityNotFound(_0xfe5284,null))[_0x2307('0x10')](respondWithResult(_0xfe5284,null))[_0x2307('0x41')](handleError(_0xfe5284,null));};exports[_0x2307('0x1f')]=function(_0x5ebdab,_0x2e5483){if(_0x5ebdab[_0x2307('0x42')]['id']){delete _0x5ebdab['body']['id'];}return db[_0x2307('0x27')]['find']({'where':{'id':_0x5ebdab[_0x2307('0x3e')]['id']}})[_0x2307('0x10')](handleEntityNotFound(_0x2e5483,null))[_0x2307('0x10')](saveUpdates(_0x5ebdab['body'],null))[_0x2307('0x10')](respondWithResult(_0x2e5483,null))[_0x2307('0x41')](handleError(_0x2e5483,null));};exports[_0x2307('0x20')]=function(_0x121436,_0x192715){return db['MailMessage'][_0x2307('0x40')]({'where':{'id':_0x121436[_0x2307('0x3e')]['id']}})[_0x2307('0x10')](handleEntityNotFound(_0x192715,null))[_0x2307('0x10')](removeEntity(_0x192715,null))[_0x2307('0x41')](handleError(_0x192715,null));};exports[_0x2307('0x43')]=function(_0x3061e0,_0x33df8f){return db[_0x2307('0x27')][_0x2307('0x43')]()['then'](respondWithResult(_0x33df8f,null))['catch'](handleError(_0x33df8f,null));};exports[_0x2307('0x44')]=function(_0x2f5067,_0x2f6cde){return db[_0x2307('0x27')][_0x2307('0x44')](_0x2f5067['body'])[_0x2307('0x10')](function(_0x428f10){if(_0x428f10){if(_0x428f10['direction']==='out'&&!_0x428f10[_0x2307('0x45')]){var _0x39db30,_0x57fb33,_0x497ae0;if(_0x2f5067['body']['to']){_0x57fb33=_0x2f5067[_0x2307('0x42')]['to'][_0x2307('0x46')](',')[0x0];}return db[_0x2307('0x47')][_0x2307('0x48')]({'where':{'id':_0x428f10['MailAccountId']},'include':[{'model':db[_0x2307('0x49')],'as':_0x2307('0x4a'),'include':[{'model':db[_0x2307('0x4b')],'as':_0x2307('0x4c'),'where':{'email':_0x57fb33},'limit':0x1,'order':[[_0x2307('0x4d'),_0x2307('0x4e')]]}]},{'model':db[_0x2307('0x4f')],'as':_0x2307('0x50'),'raw':!![]}]})['then'](function(_0x5b7e13){_0x39db30=_0x5b7e13;if(_0x39db30&&_0x39db30[_0x2307('0x50')]){var _0x2b6c7e={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x39db30[_0x2307('0x50')][_0x2307('0x51')])){_0x2b6c7e[_0x2307('0x52')]=_0x39db30[_0x2307('0x50')]['host'];_0x2b6c7e[_0x2307('0x53')]=_0x39db30['Smtp'][_0x2307('0x53')];_0x2b6c7e[_0x2307('0x54')]=_0x39db30[_0x2307('0x50')][_0x2307('0x54')];if(_0x39db30[_0x2307('0x50')][_0x2307('0x55')]){_0x2b6c7e[_0x2307('0x56')]={'user':_0x39db30[_0x2307('0x50')]['user'],'pass':_0x39db30['Smtp']['pass']};}}else{_0x2b6c7e[_0x2307('0x51')]=_0x39db30[_0x2307('0x50')][_0x2307('0x51')];_0x2b6c7e[_0x2307('0x56')]={'user':_0x39db30[_0x2307('0x50')][_0x2307('0x57')],'pass':_0x39db30[_0x2307('0x50')][_0x2307('0x58')]};_0x2b6c7e['secure']=_0x39db30[_0x2307('0x50')][_0x2307('0x54')];}if(_0x2f5067['body'][_0x2307('0x59')]&&_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x2307('0x2f')]){for(var _0x3c2d13=0x0;_0x3c2d13<_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x2307('0x2f')];_0x3c2d13+=0x1){_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13]={'filename':_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13][_0x2307('0x23')],'path':path[_0x2307('0x5a')](config[_0x2307('0x5b')],_0x2307('0x5c'),_0x2f5067[_0x2307('0x42')][_0x2307('0x59')][_0x3c2d13][_0x2307('0x5d')])};}}_0x497ae0={'account':_0x2b6c7e,'message':_0x2f5067['body']};return;}})[_0x2307('0x10')](function(){if(_0x39db30[_0x2307('0x4a')]){if(_0x39db30[_0x2307('0x4a')][_0x2307('0x4c')]['length']){return _0x39db30[_0x2307('0x4a')]['Contacts'][0x0];}else{return db[_0x2307('0x4b')][_0x2307('0x44')](_[_0x2307('0x5e')](_0x2f5067['body'],{'firstName':_0x2f5067['body']['to'],'email':_0x2f5067[_0x2307('0x42')]['to'],'phone':_0x2f5067['body']['to'],'ListId':_0x39db30[_0x2307('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x497ae0){return respondWithRpcPromise(_0x2307('0x60'),_0x2307('0x61'),_0x497ae0,client9003)['then'](function(_0x42bf26){return _0x428f10['update']({'read':!![],'messageId':_0x42bf26[_0x2307('0x62')],'sentAt':moment()['format'](_0x2307('0x63'))});})[_0x2307('0x41')](function(_0x532eae){logger[_0x2307('0x14')]('%s',JSON[_0x2307('0x13')](_0x532eae));return _0x428f10;});}return _0x428f10;});}return _0x428f10;}})[_0x2307('0x10')](respondWithResult(_0x2f6cde,0xc9))[_0x2307('0x41')](handleError(_0x2f6cde,null));};exports[_0x2307('0x64')]=function(_0x2e4557,_0x2e4c61){var _0x284e0b={'agent':{},'channel':_0x2307('0x65')};if(_0x2e4557[_0x2307('0x42')]['id']){delete _0x2e4557[_0x2307('0x42')]['id'];}_0x2e4557[_0x2307('0x42')][_0x2307('0x66')]=!![];_0x2e4557[_0x2307('0x42')][_0x2307('0x67')]=moment()[_0x2307('0x68')](_0x2307('0x63'));_0x2e4557[_0x2307('0x42')][_0x2307('0x69')]=_0x2e4557[_0x2307('0x42')]['UserId']||_0x2e4557[_0x2307('0x57')]['id'];_0x284e0b[_0x2307('0x6a')]['id']=_0x2e4557[_0x2307('0x42')]['UserId'];return db[_0x2307('0x27')]['find']({'where':{'id':_0x2e4557[_0x2307('0x3e')]['id'],'UserId':null}})[_0x2307('0x10')](handleEntityNotFound(_0x2e4c61,null))[_0x2307('0x10')](saveUpdates(_0x2e4557[_0x2307('0x42')],null))[_0x2307('0x10')](function(_0x4d0166){if(_0x4d0166){_0x284e0b[_0x2307('0x16')]=_0x4d0166[_0x2307('0x6b')]({'plain':!![]});return db[_0x2307('0x6c')][_0x2307('0x40')]({'where':{'id':_0x4d0166[_0x2307('0x6d')]}});}return null;})[_0x2307('0x10')](handleEntityNotFound(_0x2e4c61,null))[_0x2307('0x10')](function(_0x5e1c58){if(_0x5e1c58){return _0x5e1c58[_0x2307('0x1f')]({'UserId':_0x2e4557[_0x2307('0x42')]['UserId'],'read1stAt':_['isNil'](_0x5e1c58[_0x2307('0x6e')])?moment()[_0x2307('0x68')](_0x2307('0x63')):undefined});}return null;})[_0x2307('0x10')](function(_0x51474c){if(_0x51474c){_0x284e0b[_0x2307('0x6f')]=_0x51474c[_0x2307('0x6b')]({'plain':!![]});interaction_log[_0x2307('0x70')](_0x2307('0x71'),_0x2e4557[_0x2307('0x57')]['id'],_0x2e4557[_0x2307('0x57')][_0x2307('0x23')],_0x2e4557[_0x2307('0x57')]['role'],_0x284e0b[_0x2307('0x6f')]['id'],_0x2e4557['body']?JSON[_0x2307('0x13')](_0x2e4557['body']):'null');return respondWithRpcPromise(_0x2307('0x72'),'acceptMessage',_0x284e0b);}return null;})[_0x2307('0x10')](function(_0x1c0a05){var _0x31cae5=_0x2307('0x73')+_0x1c0a05[_0x2307('0x16')]['ContactId'];return db['sequelize'][_0x2307('0x29')](_0x31cae5,{'type':db['Sequelize'][_0x2307('0x74')]['SELECT'],'raw':!![]})[_0x2307('0x10')](function(_0x4b5fb8){return _0x4b5fb8;});})[_0x2307('0x10')](function(_0x57818e){if(_0x57818e){_0x284e0b[_0x2307('0x16')][_0x2307('0x75')]=_0x57818e[0x0];if(!_0x2e4557['body'][_0x2307('0x69')])return;return db['User'][_0x2307('0x40')]({'where':{'id':_0x2e4557[_0x2307('0x42')][_0x2307('0x69')],'role':_0x2307('0x6a')},'attributes':['id',_0x2307('0x23'),_0x2307('0x76'),_0x2307('0x77'),_0x2307('0x78')],'raw':!![]});}return null;})[_0x2307('0x10')](function(_0x4f15d2){if(!_0x4f15d2)return null;_0x284e0b['message']['agent']=_0x4f15d2;return _0x284e0b;})[_0x2307('0x10')](function(_0xed1078){if(_0xed1078){if(_0x2e4557[_0x2307('0x42')]['manual']){_0x284e0b[_0x2307('0x16')][_0x2307('0x79')]=util[_0x2307('0x68')](_0x2307('0x7a'),_0x2e4557[_0x2307('0x57')]['name']);_0x284e0b['message'][_0x2307('0x7b')]=_0x284e0b[_0x2307('0x7b')];_0x284e0b[_0x2307('0x16')][_0x2307('0x7c')]=_0x284e0b[_0x2307('0x7b')];_0x284e0b[_0x2307('0x16')]['event']=_0x2307('0x64');_0x284e0b[_0x2307('0x16')][_0x2307('0x42')]=htmlToText['fromString'](_0x284e0b[_0x2307('0x16')][_0x2307('0x42')]);return respondWithRpcPromise(_0x2307('0x7d'),_0x2307('0x7d'),{'event':_0x2307('0x7e'),'message':_0x284e0b[_0x2307('0x16')]},client9002)[_0x2307('0x10')](function(){return _0x284e0b;});}return _0x284e0b;}return null;})[_0x2307('0x10')](respondWithResult(_0x2e4c61,null))[_0x2307('0x41')](handleError(_0x2e4c61,null));};exports['reject']=function(_0x55eba6,_0x1cffa2){var _0x472bad={'agent':{},'channel':_0x2307('0x65')};if(_0x55eba6[_0x2307('0x42')]['id']){delete _0x55eba6[_0x2307('0x42')]['id'];}_0x55eba6['body'][_0x2307('0x69')]=_0x55eba6[_0x2307('0x42')]['UserId']||_0x55eba6[_0x2307('0x57')]['id'];_0x472bad[_0x2307('0x6a')]['id']=_0x55eba6['body'][_0x2307('0x69')];return db['MailMessage'][_0x2307('0x40')]({'where':{'id':_0x55eba6[_0x2307('0x3e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1cffa2,null))[_0x2307('0x10')](function(_0x1a0e98){if(_0x1a0e98){_0x472bad[_0x2307('0x16')]=_0x1a0e98['get']({'plain':!![]});return db[_0x2307('0x6c')][_0x2307('0x40')]({'where':{'id':_0x1a0e98[_0x2307('0x6d')]}});}return null;})[_0x2307('0x10')](handleEntityNotFound(_0x1cffa2,null))['then'](function(_0x25e3db){if(_0x25e3db){_0x472bad['interaction']=_0x25e3db[_0x2307('0x6b')]({'plain':!![]});interaction_log[_0x2307('0x70')](_0x2307('0x7f'),_0x55eba6[_0x2307('0x57')]['id'],_0x55eba6[_0x2307('0x57')][_0x2307('0x23')],_0x55eba6['user'][_0x2307('0x80')],_0x472bad[_0x2307('0x6f')]['id'],_0x55eba6[_0x2307('0x42')]?JSON[_0x2307('0x13')](_0x55eba6['body']):_0x2307('0x81'));return respondWithRpcPromise(_0x2307('0x82'),_0x2307('0x83'),_0x472bad);}return null;})['then'](function(_0x3007ee){var _0x4d0b02=_0x2307('0x73')+_0x3007ee[_0x2307('0x16')][_0x2307('0x84')];return db[_0x2307('0x85')][_0x2307('0x29')](_0x4d0b02,{'type':db['Sequelize'][_0x2307('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x3aa93e){return _0x3aa93e;});})[_0x2307('0x10')](function(_0x21fdaa){if(_0x21fdaa){_0x472bad[_0x2307('0x16')][_0x2307('0x75')]=_0x21fdaa[0x0];if(!_0x55eba6[_0x2307('0x42')][_0x2307('0x69')])return;return db[_0x2307('0x86')][_0x2307('0x40')]({'where':{'id':_0x55eba6[_0x2307('0x42')][_0x2307('0x69')],'role':'agent'},'attributes':['id',_0x2307('0x23'),'fullname',_0x2307('0x77'),_0x2307('0x78')],'raw':!![]});}return null;})[_0x2307('0x10')](function(_0x19c0ee){if(!_0x19c0ee)return null;_0x472bad[_0x2307('0x16')]['agent']=_0x19c0ee;return _0x472bad;})[_0x2307('0x10')](function(_0x5840f4){if(_0x5840f4){_0x5840f4[_0x2307('0x16')][_0x2307('0x79')]=util['format'](_0x2307('0x7a'),_0x55eba6['user']['name']);_0x5840f4[_0x2307('0x16')][_0x2307('0x7b')]=_0x472bad['channel'];_0x5840f4[_0x2307('0x16')]['motionChannel']=_0x472bad[_0x2307('0x7b')];_0x5840f4[_0x2307('0x16')]['event']=_0x2307('0x87');_0x5840f4['message'][_0x2307('0x42')]=htmlToText[_0x2307('0x88')](_0x472bad[_0x2307('0x16')]['body']);respondWithRpcPromise(_0x2307('0x7d'),_0x2307('0x7d'),{'event':'rejectmessage','message':_0x5840f4[_0x2307('0x16')]},client9002);return _0x472bad;}return null;})[_0x2307('0x10')](respondWithResult(_0x1cffa2,null))[_0x2307('0x41')](handleError(_0x1cffa2,null));};exports[_0x2307('0x89')]=function(_0x189448,_0x3132ca){var _0x4d04e3=moment()['unix']()['toString']();var _0x201bb4=path['join'](config[_0x2307('0x5b')],'server',_0x2307('0x8a'),'tmp');var _0x2ba794=path[_0x2307('0x5a')](config[_0x2307('0x5b')],_0x2307('0x8b'),_0x2307('0x8a'),_0x2307('0x59'));var _0x514018=util['format'](_0x2307('0x8c'),_0x4d04e3);return db[_0x2307('0x27')]['find']({'where':{'id':_0x189448[_0x2307('0x3e')]['id']},'attributes':['id',_0x2307('0x42'),'from','to','cc','bcc','subject',_0x2307('0x8d')],'include':_0x189448['query'][_0x2307('0x59')]?[{'model':db[_0x2307('0x8e')],'as':'Attachments'}]:undefined})[_0x2307('0x10')](handleEntityNotFound(_0x3132ca,null))[_0x2307('0x10')](function(_0xd6f030){if(_0xd6f030){var _0x29f848=_0xd6f030;var _0x42d62e={'from':_0x29f848['from'],'to':_0x29f848['to'],'subject':_0x29f848[_0x2307('0x8f')],'html':htmlEntities['decode'](_0x29f848['body']),'headers':{'Date':moment(_0x29f848['createdAt'])[_0x2307('0x68')](_0x2307('0x90'))},'attachments':[]};if(_0xd6f030['cc']){_0x42d62e[_0x2307('0x91')]['Cc']=_0xd6f030['cc'];}if(_0xd6f030['bcc']){_0x42d62e[_0x2307('0x91')][_0x2307('0x92')]=_0xd6f030['bcc'];}return new BPromise(function(_0x221df3,_0x56238b){if(_0xd6f030[_0x2307('0x93')]){for(var _0x29a803=0x0;_0x29a803<_0xd6f030[_0x2307('0x93')][_0x2307('0x2f')];_0x29a803++){var _0xdf56b4=_0xd6f030[_0x2307('0x93')][_0x29a803];var _0x4440c2=path[_0x2307('0x5a')](_0x2ba794,_0xdf56b4[_0x2307('0x5d')]);if(fs[_0x2307('0x94')](_0x4440c2)){_0x42d62e[_0x2307('0x59')][_0x2307('0x95')]({'name':_0xdf56b4[_0x2307('0x23')],'contentType':_0xdf56b4[_0x2307('0x37')],'data':fs['readFileSync'](_0x4440c2)});}}}emlformat['build'](_0x42d62e,function(_0x5a2d80,_0x3351e6){if(_0x5a2d80)return _0x56238b(_0x5a2d80);fs[_0x2307('0x96')](path[_0x2307('0x5a')](_0x201bb4,_0x514018),_0x3351e6);return _0x221df3(_0x3351e6);});});}})[_0x2307('0x10')](function(_0x2bf94a){if(_0x2bf94a){return _0x3132ca[_0x2307('0x89')](path['join'](_0x201bb4,_0x514018),_0x514018,function(_0x570a77){if(!_0x570a77)fs['unlinkSync'](path[_0x2307('0x5a')](_0x201bb4,_0x514018));});}})[_0x2307('0x41')](handleError(_0x3132ca,null));};
\ No newline at end of file
+var _0x18fb=['socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','then','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','status','json','offset','undefined','count','limit','set','Content-Range','destroy','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','find','update','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','pass','attachments','join','basename','List\x20not\x20found','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','format','UserId','agent','MailInteractionId','read1stAt','interaction','get','info','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','channel','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','SIP/%s','motionChannel','event','EventManager','rejectmessage','download','toString','root','server','files','tmp','message-%s.eml','from','createdAt','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','Attachments','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x280341,_0x24b7d5){var _0x5194c0=function(_0x2581d4){while(--_0x2581d4){_0x280341['push'](_0x280341['shift']());}};_0x5194c0(++_0x24b7d5);}(_0x18fb,0x135));var _0xb18f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18fb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb18f('0x0'));var moment=require(_0xb18f('0x1'));var BPromise=require(_0xb18f('0x2'));var util=require(_0xb18f('0x3'));var path=require(_0xb18f('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xb18f('0x5'));var htmlToText=require(_0xb18f('0x6'));var qs=require(_0xb18f('0x7'));var logger=require(_0xb18f('0x8'))('api');var interaction_log=require(_0xb18f('0x8'))(_0xb18f('0x9'));var config=require(_0xb18f('0xa'));var db=require(_0xb18f('0xb'))['db'];config[_0xb18f('0xc')]=_[_0xb18f('0xd')](config[_0xb18f('0xc')],{'host':_0xb18f('0xe'),'port':0x18eb});var socket=require(_0xb18f('0xf'))(new Redis(config[_0xb18f('0xc')]));var htmlEntities=require('html-entities');require(_0xb18f('0x10'))[_0xb18f('0x11')](socket);var jayson=require(_0xb18f('0x12'));var client=jayson[_0xb18f('0x13')][_0xb18f('0x14')]({'port':0x232c});var client9003=jayson[_0xb18f('0x13')][_0xb18f('0x14')]({'port':0x232b});var client9002=jayson['client'][_0xb18f('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x3dec4b,_0x1aa405,_0x29505e,_0x3de90c){return new BPromise(function(_0x549e81,_0x2c16f6){var _0x1e1b0f=_0x3de90c||client;return _0x1e1b0f['request'](_0x3dec4b,_0x29505e)[_0xb18f('0x15')](function(_0x2a2d72){logger['info']('MailMessage,\x20%s,\x20%s',_0x1aa405,_0xb18f('0x16'));logger['debug'](_0xb18f('0x17'),_0x1aa405,_0xb18f('0x16'),JSON[_0xb18f('0x18')](_0x2a2d72));if(_0x2a2d72[_0xb18f('0x19')]){if(_0x2a2d72[_0xb18f('0x19')][_0xb18f('0x1a')]===0x1f4){logger[_0xb18f('0x19')]('MailMessage,\x20%s,\x20%s',_0x1aa405,_0x2a2d72[_0xb18f('0x19')][_0xb18f('0x1b')]);return _0x2c16f6(_0x2a2d72[_0xb18f('0x19')][_0xb18f('0x1b')]);}logger[_0xb18f('0x19')](_0xb18f('0x1c'),_0x1aa405,_0x2a2d72[_0xb18f('0x19')][_0xb18f('0x1b')]);return _0x549e81(_0x2a2d72[_0xb18f('0x19')][_0xb18f('0x1b')]);}else{logger['info'](_0xb18f('0x1c'),_0x1aa405,_0xb18f('0x16'));_0x549e81(_0x2a2d72[_0xb18f('0x1d')][_0xb18f('0x1b')]);}})['catch'](function(_0x21f980){logger[_0xb18f('0x19')]('MailMessage,\x20%s,\x20%s',_0x1aa405,_0x21f980);_0x2c16f6(_0x21f980);});});}function respondWithResult(_0x3e2c44,_0x69308){_0x69308=_0x69308||0xc8;return function(_0x1e777a){if(_0x1e777a){return _0x3e2c44[_0xb18f('0x1e')](_0x69308)[_0xb18f('0x1f')](_0x1e777a);}};}function respondWithFilteredResult(_0x2fce68,_0x3ea7fd){return function(_0x2fcc33){if(_0x2fcc33){var _0x4edcc7=typeof _0x3ea7fd[_0xb18f('0x20')]==='undefined'&&typeof _0x3ea7fd['limit']===_0xb18f('0x21');var _0x3812e3=_0x2fcc33['count'];var _0x39bad6=_0x4edcc7?0x0:_0x3ea7fd[_0xb18f('0x20')];var _0x4df409=_0x4edcc7?_0x2fcc33[_0xb18f('0x22')]:_0x3ea7fd[_0xb18f('0x20')]+_0x3ea7fd[_0xb18f('0x23')];var _0x57c750;if(_0x4df409>=_0x3812e3){_0x4df409=_0x3812e3;_0x57c750=0xc8;}else{_0x57c750=0xce;}_0x2fce68[_0xb18f('0x1e')](_0x57c750);return _0x2fce68[_0xb18f('0x24')](_0xb18f('0x25'),_0x39bad6+'-'+_0x4df409+'/'+_0x3812e3)[_0xb18f('0x1f')](_0x2fcc33);}return null;};}function saveUpdates(_0x32a50f){return function(_0x20f02e){if(_0x20f02e){return _0x20f02e['update'](_0x32a50f)[_0xb18f('0x15')](function(_0x2f9045){return _0x2f9045;});}return null;};}function removeEntity(_0x4e34b1){return function(_0x4ae446){if(_0x4ae446){return _0x4ae446[_0xb18f('0x26')]()['then'](function(){_0x4e34b1[_0xb18f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e63f){return function(_0x815c6){if(!_0x815c6){_0x47e63f[_0xb18f('0x27')](0x194);}return _0x815c6;};}function handleError(_0x503ae8,_0x7ffe07){_0x7ffe07=_0x7ffe07||0x1f4;return function(_0x584116){logger[_0xb18f('0x19')](_0x584116[_0xb18f('0x28')]);if(_0x584116['name']){delete _0x584116[_0xb18f('0x29')];}_0x503ae8[_0xb18f('0x1e')](_0x7ffe07)['send'](_0x584116);};}exports[_0xb18f('0x2a')]=function(_0x3a977c,_0x2ac643){var _0x56cbd5={},_0x1a5f72={},_0x244114={'count':0x0,'rows':[]};var _0x11bb78=_[_0xb18f('0x2b')](db[_0xb18f('0x2c')][_0xb18f('0x2d')],function(_0x29e437){return{'name':_0x29e437[_0xb18f('0x2e')],'type':_0x29e437[_0xb18f('0x2f')][_0xb18f('0x30')]};});_0x1a5f72[_0xb18f('0x31')]=_['map'](_0x11bb78,_0xb18f('0x29'));_0x1a5f72[_0xb18f('0x32')]=_[_0xb18f('0x33')](_0x3a977c[_0xb18f('0x32')]);_0x1a5f72[_0xb18f('0x34')]=_[_0xb18f('0x35')](_0x1a5f72['model'],_0x1a5f72['query']);_0x56cbd5[_0xb18f('0x36')]=_[_0xb18f('0x35')](_0x1a5f72[_0xb18f('0x31')],qs[_0xb18f('0x37')](_0x3a977c[_0xb18f('0x32')]['fields']));_0x56cbd5[_0xb18f('0x36')]=_0x56cbd5[_0xb18f('0x36')][_0xb18f('0x38')]?_0x56cbd5[_0xb18f('0x36')]:_0x1a5f72[_0xb18f('0x31')];if(!_0x3a977c['query']['hasOwnProperty'](_0xb18f('0x39'))){_0x56cbd5[_0xb18f('0x23')]=qs['limit'](_0x3a977c[_0xb18f('0x32')][_0xb18f('0x23')]);_0x56cbd5[_0xb18f('0x20')]=qs[_0xb18f('0x20')](_0x3a977c[_0xb18f('0x32')]['offset']);}_0x56cbd5[_0xb18f('0x3a')]=qs[_0xb18f('0x3b')](_0x3a977c[_0xb18f('0x32')][_0xb18f('0x3b')]);_0x56cbd5[_0xb18f('0x3c')]=qs[_0xb18f('0x34')](_['pick'](_0x3a977c['query'],_0x1a5f72[_0xb18f('0x34')]),_0x11bb78);if(_0x3a977c[_0xb18f('0x32')][_0xb18f('0x3d')]){_0x56cbd5[_0xb18f('0x3c')]=_['merge'](_0x56cbd5[_0xb18f('0x3c')],{'$or':_[_0xb18f('0x2b')](_0x11bb78,function(_0x4c713a){if(_0x4c713a[_0xb18f('0x2f')]!==_0xb18f('0x3e')){var _0x2032c9={};_0x2032c9[_0x4c713a[_0xb18f('0x29')]]={'$like':'%'+_0x3a977c[_0xb18f('0x32')][_0xb18f('0x3d')]+'%'};return _0x2032c9;}})});}_0x56cbd5=_[_0xb18f('0x3f')]({},_0x56cbd5,_0x3a977c[_0xb18f('0x40')]);var _0x3f361e={'where':_0x56cbd5['where']};return db[_0xb18f('0x2c')][_0xb18f('0x22')](_0x3f361e)[_0xb18f('0x15')](function(_0x3db261){_0x244114[_0xb18f('0x22')]=_0x3db261;if(_0x3a977c[_0xb18f('0x32')][_0xb18f('0x41')]){_0x56cbd5[_0xb18f('0x42')]=[{'all':!![]}];}return db['MailMessage'][_0xb18f('0x43')](_0x56cbd5);})[_0xb18f('0x15')](function(_0x197561){_0x244114['rows']=_0x197561;return _0x244114;})[_0xb18f('0x15')](respondWithFilteredResult(_0x2ac643,_0x56cbd5))[_0xb18f('0x44')](handleError(_0x2ac643,null));};exports['show']=function(_0x1a896c,_0x414e6a){var _0x899d53={'raw':!![],'where':{'id':_0x1a896c[_0xb18f('0x45')]['id']}},_0x36fccb={};_0x36fccb[_0xb18f('0x31')]=_[_0xb18f('0x33')](db[_0xb18f('0x2c')][_0xb18f('0x2d')]);_0x36fccb[_0xb18f('0x32')]=_[_0xb18f('0x33')](_0x1a896c[_0xb18f('0x32')]);_0x36fccb[_0xb18f('0x34')]=_['intersection'](_0x36fccb[_0xb18f('0x31')],_0x36fccb[_0xb18f('0x32')]);_0x899d53[_0xb18f('0x36')]=_[_0xb18f('0x35')](_0x36fccb['model'],qs[_0xb18f('0x37')](_0x1a896c['query']['fields']));_0x899d53[_0xb18f('0x36')]=_0x899d53[_0xb18f('0x36')][_0xb18f('0x38')]?_0x899d53['attributes']:_0x36fccb[_0xb18f('0x31')];if(_0x1a896c[_0xb18f('0x32')][_0xb18f('0x41')]){_0x899d53[_0xb18f('0x42')]=[{'all':!![]}];}_0x899d53=_[_0xb18f('0x3f')]({},_0x899d53,_0x1a896c[_0xb18f('0x40')]);return db[_0xb18f('0x2c')][_0xb18f('0x46')](_0x899d53)['then'](handleEntityNotFound(_0x414e6a,null))[_0xb18f('0x15')](respondWithResult(_0x414e6a,null))[_0xb18f('0x44')](handleError(_0x414e6a,null));};exports[_0xb18f('0x47')]=function(_0x26cd87,_0x141a4f){if(_0x26cd87[_0xb18f('0x48')]['id']){delete _0x26cd87[_0xb18f('0x48')]['id'];}return db[_0xb18f('0x2c')][_0xb18f('0x46')]({'where':{'id':_0x26cd87[_0xb18f('0x45')]['id']}})[_0xb18f('0x15')](handleEntityNotFound(_0x141a4f,null))[_0xb18f('0x15')](saveUpdates(_0x26cd87[_0xb18f('0x48')],null))[_0xb18f('0x15')](respondWithResult(_0x141a4f,null))[_0xb18f('0x44')](handleError(_0x141a4f,null));};exports[_0xb18f('0x26')]=function(_0x22e242,_0x33aabd){return db['MailMessage'][_0xb18f('0x46')]({'where':{'id':_0x22e242[_0xb18f('0x45')]['id']}})['then'](handleEntityNotFound(_0x33aabd,null))[_0xb18f('0x15')](removeEntity(_0x33aabd,null))['catch'](handleError(_0x33aabd,null));};exports[_0xb18f('0x49')]=function(_0x5aeed9,_0x39a947){return db['MailMessage']['describe']()[_0xb18f('0x15')](respondWithResult(_0x39a947,null))[_0xb18f('0x44')](handleError(_0x39a947,null));};exports[_0xb18f('0x4a')]=function(_0x27a4a6,_0x3bcf3b){return db[_0xb18f('0x2c')][_0xb18f('0x4a')](_0x27a4a6[_0xb18f('0x48')])[_0xb18f('0x15')](function(_0x16c0a8){if(_0x16c0a8){if(_0x16c0a8[_0xb18f('0x4b')]===_0xb18f('0x4c')&&!_0x16c0a8['secret']){var _0x17b092,_0x1df699,_0x3c514d;if(_0x27a4a6[_0xb18f('0x48')]['to']){_0x1df699=_0x27a4a6[_0xb18f('0x48')]['to'][_0xb18f('0x4d')](',')[0x0];}return db[_0xb18f('0x4e')][_0xb18f('0x4f')]({'where':{'id':_0x16c0a8[_0xb18f('0x50')]},'include':[{'model':db[_0xb18f('0x51')],'as':_0xb18f('0x52'),'include':[{'model':db[_0xb18f('0x53')],'as':_0xb18f('0x54'),'where':{'email':_0x1df699},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xb18f('0x55')],'as':'Smtp','raw':!![]}]})['then'](function(_0xbd208d){_0x17b092=_0xbd208d;if(_0x17b092&&_0x17b092[_0xb18f('0x56')]){var _0x52869f={'tls':{'rejectUnauthorized':![]}};if(_[_0xb18f('0x57')](_0x17b092['Smtp'][_0xb18f('0x58')])){_0x52869f[_0xb18f('0x59')]=_0x17b092[_0xb18f('0x56')][_0xb18f('0x59')];_0x52869f[_0xb18f('0x5a')]=_0x17b092[_0xb18f('0x56')]['port'];_0x52869f[_0xb18f('0x5b')]=_0x17b092[_0xb18f('0x56')][_0xb18f('0x5b')];if(_0x17b092['Smtp'][_0xb18f('0x5c')]){_0x52869f['auth']={'user':_0x17b092[_0xb18f('0x56')][_0xb18f('0x5d')],'pass':_0x17b092[_0xb18f('0x56')][_0xb18f('0x5e')]};}}else{_0x52869f[_0xb18f('0x58')]=_0x17b092[_0xb18f('0x56')][_0xb18f('0x58')];_0x52869f['auth']={'user':_0x17b092[_0xb18f('0x56')]['user'],'pass':_0x17b092['Smtp'][_0xb18f('0x5e')]};_0x52869f['secure']=_0x17b092[_0xb18f('0x56')][_0xb18f('0x5b')];}if(_0x27a4a6[_0xb18f('0x48')][_0xb18f('0x5f')]&&_0x27a4a6[_0xb18f('0x48')][_0xb18f('0x5f')][_0xb18f('0x38')]){for(var _0x47e069=0x0;_0x47e069<_0x27a4a6['body'][_0xb18f('0x5f')][_0xb18f('0x38')];_0x47e069+=0x1){_0x27a4a6[_0xb18f('0x48')][_0xb18f('0x5f')][_0x47e069]={'filename':_0x27a4a6[_0xb18f('0x48')][_0xb18f('0x5f')][_0x47e069]['name'],'path':path[_0xb18f('0x60')](config['root'],'server/files/attachments',_0x27a4a6['body'][_0xb18f('0x5f')][_0x47e069][_0xb18f('0x61')])};}}_0x3c514d={'account':_0x52869f,'message':_0x27a4a6[_0xb18f('0x48')]};return;}})[_0xb18f('0x15')](function(){if(_0x17b092['List']){if(_0x17b092[_0xb18f('0x52')][_0xb18f('0x54')][_0xb18f('0x38')]){return _0x17b092['List'][_0xb18f('0x54')][0x0];}else{return db['CmContact'][_0xb18f('0x4a')](_[_0xb18f('0xd')](_0x27a4a6[_0xb18f('0x48')],{'firstName':_0x27a4a6['body']['to'],'email':_0x27a4a6[_0xb18f('0x48')]['to'],'phone':_0x27a4a6[_0xb18f('0x48')]['to'],'ListId':_0x17b092['ListId']}));}}else{throw new Error(_0xb18f('0x62'));}})['then'](function(){if(_0x3c514d){return respondWithRpcPromise(_0xb18f('0x63'),_0xb18f('0x64'),_0x3c514d,client9003)[_0xb18f('0x15')](function(_0x25a641){return _0x16c0a8[_0xb18f('0x47')]({'read':!![],'messageId':_0x25a641['messageId'],'sentAt':moment()['format'](_0xb18f('0x65'))});})['catch'](function(_0x4b88fb){logger[_0xb18f('0x19')]('%s',JSON[_0xb18f('0x18')](_0x4b88fb));return _0x16c0a8;});}return _0x16c0a8;});}return _0x16c0a8;}})['then'](respondWithResult(_0x3bcf3b,0xc9))[_0xb18f('0x44')](handleError(_0x3bcf3b,null));};exports[_0xb18f('0x66')]=function(_0x13a2c0,_0x298ba9){var _0x88614a={'agent':{},'channel':_0xb18f('0x67')};if(_0x13a2c0[_0xb18f('0x48')]['id']){delete _0x13a2c0['body']['id'];}_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x68')]=!![];_0x13a2c0[_0xb18f('0x48')]['readAt']=moment()[_0xb18f('0x69')]('YYYY-MM-DD\x20HH:mm:ss');_0x13a2c0[_0xb18f('0x48')]['UserId']=_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x6a')]||_0x13a2c0[_0xb18f('0x5d')]['id'];_0x88614a[_0xb18f('0x6b')]['id']=_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x6a')];return db[_0xb18f('0x2c')][_0xb18f('0x46')]({'where':{'id':_0x13a2c0[_0xb18f('0x45')]['id'],'UserId':null}})[_0xb18f('0x15')](handleEntityNotFound(_0x298ba9,null))[_0xb18f('0x15')](saveUpdates(_0x13a2c0['body'],null))['then'](function(_0x13c515){if(_0x13c515){_0x88614a[_0xb18f('0x1b')]=_0x13c515['get']({'plain':!![]});return db['MailInteraction'][_0xb18f('0x46')]({'where':{'id':_0x13c515[_0xb18f('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x298ba9,null))[_0xb18f('0x15')](function(_0x3c79a0){if(_0x3c79a0){return _0x3c79a0['update']({'UserId':_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x6a')],'read1stAt':_[_0xb18f('0x57')](_0x3c79a0[_0xb18f('0x6d')])?moment()[_0xb18f('0x69')](_0xb18f('0x65')):undefined});}return null;})[_0xb18f('0x15')](function(_0x14f638){if(_0x14f638){_0x88614a[_0xb18f('0x6e')]=_0x14f638[_0xb18f('0x6f')]({'plain':!![]});interaction_log[_0xb18f('0x70')](_0xb18f('0x71'),_0x13a2c0['user']['id'],_0x13a2c0['user']['name'],_0x13a2c0[_0xb18f('0x5d')]['role'],_0x88614a['interaction']['id'],_0x13a2c0[_0xb18f('0x48')]?JSON[_0xb18f('0x18')](_0x13a2c0[_0xb18f('0x48')]):'null');return respondWithRpcPromise(_0xb18f('0x72'),'acceptMessage',_0x88614a);}return null;})[_0xb18f('0x15')](function(_0xa67a7d){var _0x4f53d5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa67a7d['message'][_0xb18f('0x73')];return db[_0xb18f('0x74')][_0xb18f('0x32')](_0x4f53d5,{'type':db[_0xb18f('0x75')][_0xb18f('0x76')][_0xb18f('0x77')],'raw':!![]})[_0xb18f('0x15')](function(_0x418043){return _0x418043;});})[_0xb18f('0x15')](function(_0x450487){if(_0x450487){_0x88614a[_0xb18f('0x1b')][_0xb18f('0x78')]=_0x450487[0x0];if(!_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x6a')])return;return db['User'][_0xb18f('0x46')]({'where':{'id':_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x6a')],'role':_0xb18f('0x6b')},'attributes':['id',_0xb18f('0x29'),'fullname',_0xb18f('0x79'),_0xb18f('0x7a')],'raw':!![]});}return null;})['then'](function(_0x2023a7){if(!_0x2023a7)return null;_0x88614a[_0xb18f('0x1b')][_0xb18f('0x6b')]=_0x2023a7;return _0x88614a;})[_0xb18f('0x15')](function(_0x2f8889){if(_0x2f8889){if(_0x13a2c0[_0xb18f('0x48')][_0xb18f('0x7b')]){_0x88614a[_0xb18f('0x1b')][_0xb18f('0x7c')]=util[_0xb18f('0x69')]('SIP/%s',_0x13a2c0[_0xb18f('0x5d')]['name']);_0x88614a[_0xb18f('0x1b')][_0xb18f('0x7d')]=_0x88614a[_0xb18f('0x7d')];_0x88614a[_0xb18f('0x1b')]['motionChannel']=_0x88614a[_0xb18f('0x7d')];_0x88614a['message']['event']=_0xb18f('0x66');_0x88614a[_0xb18f('0x1b')][_0xb18f('0x48')]=htmlToText[_0xb18f('0x7e')](_0x88614a[_0xb18f('0x1b')][_0xb18f('0x48')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xb18f('0x7f'),'message':_0x88614a[_0xb18f('0x1b')]},client9002)[_0xb18f('0x15')](function(){return _0x88614a;});}return _0x88614a;}return null;})[_0xb18f('0x15')](respondWithResult(_0x298ba9,null))[_0xb18f('0x44')](handleError(_0x298ba9,null));};exports[_0xb18f('0x80')]=function(_0x395c32,_0x10a32a){var _0x388dbc={'agent':{},'channel':_0xb18f('0x67')};if(_0x395c32[_0xb18f('0x48')]['id']){delete _0x395c32[_0xb18f('0x48')]['id'];}_0x395c32['body']['UserId']=_0x395c32[_0xb18f('0x48')]['UserId']||_0x395c32[_0xb18f('0x5d')]['id'];_0x388dbc[_0xb18f('0x6b')]['id']=_0x395c32[_0xb18f('0x48')][_0xb18f('0x6a')];return db[_0xb18f('0x2c')]['find']({'where':{'id':_0x395c32['params']['id'],'UserId':null}})[_0xb18f('0x15')](handleEntityNotFound(_0x10a32a,null))[_0xb18f('0x15')](function(_0x3c367e){if(_0x3c367e){_0x388dbc[_0xb18f('0x1b')]=_0x3c367e['get']({'plain':!![]});return db['MailInteraction'][_0xb18f('0x46')]({'where':{'id':_0x3c367e[_0xb18f('0x6c')]}});}return null;})['then'](handleEntityNotFound(_0x10a32a,null))[_0xb18f('0x15')](function(_0x22bef1){if(_0x22bef1){_0x388dbc[_0xb18f('0x6e')]=_0x22bef1[_0xb18f('0x6f')]({'plain':!![]});interaction_log[_0xb18f('0x70')](_0xb18f('0x81'),_0x395c32[_0xb18f('0x5d')]['id'],_0x395c32[_0xb18f('0x5d')][_0xb18f('0x29')],_0x395c32['user'][_0xb18f('0x82')],_0x388dbc[_0xb18f('0x6e')]['id'],_0x395c32[_0xb18f('0x48')]?JSON[_0xb18f('0x18')](_0x395c32[_0xb18f('0x48')]):_0xb18f('0x83'));return respondWithRpcPromise(_0xb18f('0x84'),_0xb18f('0x85'),_0x388dbc);}return null;})[_0xb18f('0x15')](function(_0x308f23){var _0x261f40=_0xb18f('0x86')+_0x308f23[_0xb18f('0x1b')]['ContactId'];return db[_0xb18f('0x74')][_0xb18f('0x32')](_0x261f40,{'type':db['Sequelize'][_0xb18f('0x76')][_0xb18f('0x77')],'raw':!![]})['then'](function(_0x5ad39e){return _0x5ad39e;});})['then'](function(_0x57b97d){if(_0x57b97d){_0x388dbc[_0xb18f('0x1b')][_0xb18f('0x78')]=_0x57b97d[0x0];if(!_0x395c32[_0xb18f('0x48')][_0xb18f('0x6a')])return;return db[_0xb18f('0x87')][_0xb18f('0x46')]({'where':{'id':_0x395c32[_0xb18f('0x48')]['UserId'],'role':_0xb18f('0x6b')},'attributes':['id',_0xb18f('0x29'),_0xb18f('0x88'),_0xb18f('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0x5d98e2){if(!_0x5d98e2)return null;_0x388dbc[_0xb18f('0x1b')]['agent']=_0x5d98e2;return _0x388dbc;})['then'](function(_0x330562){if(_0x330562){_0x330562[_0xb18f('0x1b')][_0xb18f('0x7c')]=util[_0xb18f('0x69')](_0xb18f('0x89'),_0x395c32[_0xb18f('0x5d')][_0xb18f('0x29')]);_0x330562['message'][_0xb18f('0x7d')]=_0x388dbc[_0xb18f('0x7d')];_0x330562[_0xb18f('0x1b')][_0xb18f('0x8a')]=_0x388dbc[_0xb18f('0x7d')];_0x330562[_0xb18f('0x1b')][_0xb18f('0x8b')]=_0xb18f('0x80');_0x330562[_0xb18f('0x1b')][_0xb18f('0x48')]=htmlToText['fromString'](_0x388dbc[_0xb18f('0x1b')]['body']);respondWithRpcPromise(_0xb18f('0x8c'),_0xb18f('0x8c'),{'event':_0xb18f('0x8d'),'message':_0x330562['message']},client9002);return _0x388dbc;}return null;})['then'](respondWithResult(_0x10a32a,null))['catch'](handleError(_0x10a32a,null));};exports[_0xb18f('0x8e')]=function(_0x43924c,_0x3cc0cb){var _0x2e5b78=moment()['unix']()[_0xb18f('0x8f')]();var _0xe31c25=path['join'](config[_0xb18f('0x90')],_0xb18f('0x91'),_0xb18f('0x92'),_0xb18f('0x93'));var _0x1a3443=path[_0xb18f('0x60')](config['root'],'server',_0xb18f('0x92'),_0xb18f('0x5f'));var _0x19d0d6=util[_0xb18f('0x69')](_0xb18f('0x94'),_0x2e5b78);return db[_0xb18f('0x2c')][_0xb18f('0x46')]({'where':{'id':_0x43924c['params']['id']},'attributes':['id',_0xb18f('0x48'),_0xb18f('0x95'),'to','cc','bcc','subject',_0xb18f('0x96')],'include':_0x43924c['query'][_0xb18f('0x5f')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})['then'](handleEntityNotFound(_0x3cc0cb,null))[_0xb18f('0x15')](function(_0x442a47){if(_0x442a47){var _0x1ca530=_0x442a47;var _0x131ff1={'from':_0x1ca530[_0xb18f('0x95')],'to':_0x1ca530['to'],'subject':_0x1ca530[_0xb18f('0x97')],'html':htmlEntities['decode'](_0x1ca530[_0xb18f('0x48')]),'headers':{'Date':moment(_0x1ca530[_0xb18f('0x96')])[_0xb18f('0x69')](_0xb18f('0x98'))},'attachments':[]};if(_0x442a47['cc']){_0x131ff1['headers']['Cc']=_0x442a47['cc'];}if(_0x442a47[_0xb18f('0x99')]){_0x131ff1[_0xb18f('0x9a')][_0xb18f('0x9b')]=_0x442a47[_0xb18f('0x99')];}return new BPromise(function(_0x31297c,_0xb2521){if(_0x442a47[_0xb18f('0x9c')]){for(var _0x2bc338=0x0;_0x2bc338<_0x442a47['Attachments'][_0xb18f('0x38')];_0x2bc338++){var _0x3e71b9=_0x442a47[_0xb18f('0x9c')][_0x2bc338];var _0x2c9fdf=path['join'](_0x1a3443,_0x3e71b9[_0xb18f('0x61')]);if(fs[_0xb18f('0x9d')](_0x2c9fdf)){_0x131ff1[_0xb18f('0x5f')][_0xb18f('0x9e')]({'name':_0x3e71b9[_0xb18f('0x29')],'contentType':_0x3e71b9['type'],'data':fs['readFileSync'](_0x2c9fdf)});}}}emlformat[_0xb18f('0x9f')](_0x131ff1,function(_0x1bca4b,_0x3570e4){if(_0x1bca4b)return _0xb2521(_0x1bca4b);fs[_0xb18f('0xa0')](path[_0xb18f('0x60')](_0xe31c25,_0x19d0d6),_0x3570e4);return _0x31297c(_0x3570e4);});});}})[_0xb18f('0x15')](function(_0x29f886){if(_0x29f886){return _0x3cc0cb[_0xb18f('0x8e')](path[_0xb18f('0x60')](_0xe31c25,_0x19d0d6),_0x19d0d6,function(_0x598e9b){if(!_0x598e9b)fs[_0xb18f('0xa1')](path[_0xb18f('0x60')](_0xe31c25,_0x19d0d6));});}})[_0xb18f('0x44')](handleError(_0x3cc0cb,null));};
\ No newline at end of file
index 550b8a1..1e4e3d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4345=['setMaxListeners','remove','emit','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x3e2dce,_0x57430d){var _0x66a34a=function(_0x2010ac){while(--_0x2010ac){_0x3e2dce['push'](_0x3e2dce['shift']());}};_0x66a34a(++_0x57430d);}(_0x4345,0x1b5));var _0x5434=function(_0x3bc5c8,_0x16e06d){_0x3bc5c8=_0x3bc5c8-0x0;var _0x40819f=_0x4345[_0x3bc5c8];return _0x40819f;};'use strict';var EventEmitter=require(_0x5434('0x0'));var MailMessage=require(_0x5434('0x1'))['db'][_0x5434('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5434('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5434('0x4')};function emitEvent(_0x42e275){return function(_0x24ce10,_0x391049,_0x133911){MailMessageEvents[_0x5434('0x5')](_0x42e275+':'+_0x24ce10['id'],_0x24ce10);MailMessageEvents[_0x5434('0x5')](_0x42e275,_0x24ce10);_0x133911(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5434('0x6')](e,emitEvent(event));}}module[_0x5434('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0x2020=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0x2020,0x10e));var _0x0202=function(_0x50f90d,_0x3238d6){_0x50f90d=_0x50f90d-0x0;var _0x56ff5e=_0x2020[_0x50f90d];return _0x56ff5e;};'use strict';var EventEmitter=require(_0x0202('0x0'));var MailMessage=require(_0x0202('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x0202('0x2')](0x0);var events={'afterCreate':_0x0202('0x3'),'afterUpdate':_0x0202('0x4'),'afterDestroy':_0x0202('0x5')};function emitEvent(_0x4eb2dc){return function(_0x48bdb2,_0x1e08ea,_0x18b03c){MailMessageEvents[_0x0202('0x6')](_0x4eb2dc+':'+_0x48bdb2['id'],_0x48bdb2);MailMessageEvents[_0x0202('0x6')](_0x4eb2dc,_0x48bdb2);_0x18b03c(null);};}for(var e in events){if(events[_0x0202('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x0202('0x8')]=MailMessageEvents;
\ No newline at end of file
index ea5a94d..1a5be2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e39=['define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','html-to-text','./mailMessage.attributes'];(function(_0x2b7442,_0x561591){var _0x56e035=function(_0x42e09d){while(--_0x42e09d){_0x2b7442['push'](_0x2b7442['shift']());}};_0x56e035(++_0x561591);}(_0x5e39,0x1a7));var _0x95e3=function(_0x1315b9,_0x1131ca){_0x1315b9=_0x1315b9-0x0;var _0x4d81aa=_0x5e39[_0x1315b9];return _0x4d81aa;};'use strict';var _=require('lodash');var util=require(_0x95e3('0x0'));var logger=require(_0x95e3('0x1'))('api');var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var rp=require('request-promise');var htmlToText=require(_0x95e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95e3('0x5'));module['exports']=function(_0x10df07,_0x3c4b96){return _0x10df07[_0x95e3('0x6')](_0x95e3('0x7'),attributes,{'tableName':_0x95e3('0x8'),'paranoid':![],'indexes':[{'name':_0x95e3('0x9'),'fields':[_0x95e3('0x9')]},{'name':_0x95e3('0xa'),'fields':['plainBody',_0x95e3('0xb')],'type':_0x95e3('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4f5e93,_0x1d959d,_0x405ef1){if(_0x4f5e93[_0x95e3('0xd')]){_0x4f5e93[_0x95e3('0xe')]=htmlToText[_0x95e3('0xf')](_0x4f5e93[_0x95e3('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x405ef1(null,_0x1d959d);},'afterCreate':function(_0x4ed943,_0xab6b5,_0x1127a2){var _0x4be03e=_0x10df07[_0x95e3('0x10')];var _0x38477b=_0x4ed943[_0x95e3('0x11')]({'plain':!![]});if(_0x38477b[_0x95e3('0x12')][_0x95e3('0x13')]()==='in'||_0x38477b[_0x95e3('0x12')]['toLowerCase']()===_0x95e3('0x14')&&!_0x38477b[_0x95e3('0x15')]&&!_[_0x95e3('0x16')](_0x38477b[_0x95e3('0x17')])){_0x4be03e[_0x95e3('0x18')][_0x95e3('0x19')]({'where':{'id':_0x38477b[_0x95e3('0x1a')]}})[_0x95e3('0x1b')](function(_0x5b9d3e){if(_0x5b9d3e){_0x5b9d3e[_0x95e3('0x1c')]({'lastMsgAt':_0x38477b[_0x95e3('0x1d')],'lastMsgDirection':_0x38477b[_0x95e3('0x12')][_0x95e3('0x13')]()});}})[_0x95e3('0x1e')](function(_0x2b26d4){console[_0x95e3('0x1f')](_0x2b26d4);});}_0x1127a2();}},'charset':'utf8mb4','collate':_0x95e3('0x20')});};
\ No newline at end of file
+var _0xe1fe=['request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','UserId','MailInteraction','then','createdAt','catch','error','util','../../config/logger','moment','bluebird'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0xe1fe,0x6c));var _0xee1f=function(_0x4f1192,_0x5daa59){_0x4f1192=_0x4f1192-0x0;var _0x566911=_0xe1fe[_0x4f1192];return _0x566911;};'use strict';var _=require('lodash');var util=require(_0xee1f('0x0'));var logger=require(_0xee1f('0x1'))('api');var moment=require(_0xee1f('0x2'));var BPromise=require(_0xee1f('0x3'));var rp=require(_0xee1f('0x4'));var htmlToText=require(_0xee1f('0x5'));var fs=require('fs');var path=require(_0xee1f('0x6'));var rimraf=require(_0xee1f('0x7'));var config=require(_0xee1f('0x8'));var attributes=require(_0xee1f('0x9'));module[_0xee1f('0xa')]=function(_0x62dcca,_0x567971){return _0x62dcca[_0xee1f('0xb')]('MailMessage',attributes,{'tableName':_0xee1f('0xc'),'paranoid':![],'indexes':[{'name':_0xee1f('0xd'),'fields':['messageId']},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':_0xee1f('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1ce9cf,_0x1e1e15,_0x1189ce){if(_0x1ce9cf[_0xee1f('0xf')]){_0x1ce9cf['plainBody']=htmlToText[_0xee1f('0x10')](_0x1ce9cf[_0xee1f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1189ce(null,_0x1e1e15);},'afterCreate':function(_0x6be310,_0x259d08,_0x2b1f1e){var _0x4458b=_0x62dcca[_0xee1f('0x11')];var _0x45aea3=_0x6be310[_0xee1f('0x12')]({'plain':!![]});if(_0x45aea3['direction']['toLowerCase']()==='in'||_0x45aea3[_0xee1f('0x13')][_0xee1f('0x14')]()===_0xee1f('0x15')&&!_0x45aea3['secret']&&!_['isNil'](_0x45aea3[_0xee1f('0x16')])){_0x4458b[_0xee1f('0x17')]['findOne']({'where':{'id':_0x45aea3['MailInteractionId']}})[_0xee1f('0x18')](function(_0x4f4d44){if(_0x4f4d44){_0x4f4d44['update']({'lastMsgAt':_0x45aea3[_0xee1f('0x19')],'lastMsgDirection':_0x45aea3[_0xee1f('0x13')]['toLowerCase']()});}})[_0xee1f('0x1a')](function(_0x549122){console[_0xee1f('0x1b')](_0x549122);});}_0x2b1f1e();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d546148..be0ba00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['catch','CreateMailMessage','MailMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x455afa,_0x235bfc){var _0x46ee43=function(_0x26de4a){while(--_0x26de4a){_0x455afa['push'](_0x455afa['shift']());}};_0x46ee43(++_0x235bfc);}(_0x5fdc,0x127));var _0xc5fd=function(_0x4f6402,_0xad4423){_0x4f6402=_0x4f6402-0x0;var _0x302983=_0x5fdc[_0x4f6402];return _0x302983;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});config[_0xc5fd('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc5fd('0xf'))(new Redis(config[_0xc5fd('0xe')]));require(_0xc5fd('0x10'))[_0xc5fd('0x11')](socket);function respondWithRpcPromise(_0x4e6d35,_0x4e1e94,_0x3442dd){return new BPromise(function(_0x1edeec,_0x39a95a){return client[_0xc5fd('0x12')](_0x4e6d35,_0x3442dd)[_0xc5fd('0x13')](function(_0x368c80){logger['info'](_0xc5fd('0x14'),_0x4e1e94,'request\x20sent');logger['debug'](_0xc5fd('0x15'),_0x4e1e94,_0xc5fd('0x16'),JSON[_0xc5fd('0x17')](_0x368c80));if(_0x368c80[_0xc5fd('0x18')]){if(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x19')]===0x1f4){logger[_0xc5fd('0x18')](_0xc5fd('0x14'),_0x4e1e94,_0x368c80['error'][_0xc5fd('0x1a')]);return _0x39a95a(_0x368c80[_0xc5fd('0x18')][_0xc5fd('0x1a')]);}logger[_0xc5fd('0x18')]('MailMessage,\x20%s,\x20%s',_0x4e1e94,_0x368c80['error']['message']);return _0x1edeec(_0x368c80['error']['message']);}else{logger[_0xc5fd('0x1b')](_0xc5fd('0x14'),_0x4e1e94,_0xc5fd('0x16'));_0x1edeec(_0x368c80[_0xc5fd('0x1c')][_0xc5fd('0x1a')]);}})[_0xc5fd('0x1d')](function(_0xfd14c7){logger['error'](_0xc5fd('0x14'),_0x4e1e94,_0xfd14c7);_0x39a95a(_0xfd14c7);});});}exports[_0xc5fd('0x1e')]=function(_0x32eac2){var _0x9c12e4=this;return new Promise(function(_0x3b3093,_0x48024e){return db[_0xc5fd('0x1f')][_0xc5fd('0x20')](_0x32eac2[_0xc5fd('0x21')],{'raw':_0x32eac2[_0xc5fd('0x22')]?_0x32eac2['options']['raw']===undefined?!![]:![]:!![]})[_0xc5fd('0x13')](function(_0x2ab935){logger[_0xc5fd('0x1b')](_0xc5fd('0x1e'),_0x32eac2);logger[_0xc5fd('0x23')](_0xc5fd('0x1e'),_0x32eac2,JSON['stringify'](_0x2ab935));_0x3b3093(_0x2ab935);})[_0xc5fd('0x1d')](function(_0x2701f7){logger[_0xc5fd('0x18')](_0xc5fd('0x1e'),_0x2701f7[_0xc5fd('0x1a')],_0x32eac2);_0x48024e(_0x9c12e4[_0xc5fd('0x18')](0x1f4,_0x2701f7[_0xc5fd('0x1a')]));});});};
\ No newline at end of file
+var _0xfff0=['rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','create','body','options','CreateMailMessage','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x415639,_0x5242d1){var _0x42d9cd=function(_0x45e6d5){while(--_0x45e6d5){_0x415639['push'](_0x415639['shift']());}};_0x42d9cd(++_0x5242d1);}(_0xfff0,0x139));var _0x0fff=function(_0x46a2ea,_0x37708f){_0x46a2ea=_0x46a2ea-0x0;var _0x222aac=_0xfff0[_0x46a2ea];return _0x222aac;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});config[_0x0fff('0xa')]=_['defaults'](config[_0x0fff('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fff('0xb'))(new Redis(config['redis']));require(_0x0fff('0xc'))[_0x0fff('0xd')](socket);function respondWithRpcPromise(_0x4cc3f3,_0x227d28,_0x377b2f){return new BPromise(function(_0x1de923,_0x289e01){return client[_0x0fff('0xe')](_0x4cc3f3,_0x377b2f)[_0x0fff('0xf')](function(_0x363c0d){logger[_0x0fff('0x10')](_0x0fff('0x11'),_0x227d28,_0x0fff('0x12'));logger[_0x0fff('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x227d28,_0x0fff('0x12'),JSON['stringify'](_0x363c0d));if(_0x363c0d[_0x0fff('0x14')]){if(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x15')]===0x1f4){logger[_0x0fff('0x14')]('MailMessage,\x20%s,\x20%s',_0x227d28,_0x363c0d['error'][_0x0fff('0x16')]);return _0x289e01(_0x363c0d['error']['message']);}logger['error'](_0x0fff('0x11'),_0x227d28,_0x363c0d[_0x0fff('0x14')]['message']);return _0x1de923(_0x363c0d[_0x0fff('0x14')][_0x0fff('0x16')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x227d28,'request\x20sent');_0x1de923(_0x363c0d[_0x0fff('0x17')][_0x0fff('0x16')]);}})[_0x0fff('0x18')](function(_0x3762dc){logger[_0x0fff('0x14')](_0x0fff('0x11'),_0x227d28,_0x3762dc);_0x289e01(_0x3762dc);});});}exports['CreateMailMessage']=function(_0x44a54a){var _0x136520=this;return new Promise(function(_0x48e6f9,_0x49d211){return db['MailMessage'][_0x0fff('0x19')](_0x44a54a[_0x0fff('0x1a')],{'raw':_0x44a54a[_0x0fff('0x1b')]?_0x44a54a[_0x0fff('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0fff('0xf')](function(_0x2f8665){logger[_0x0fff('0x10')](_0x0fff('0x1c'),_0x44a54a);logger[_0x0fff('0x13')](_0x0fff('0x1c'),_0x44a54a,JSON['stringify'](_0x2f8665));_0x48e6f9(_0x2f8665);})[_0x0fff('0x18')](function(_0x29f702){logger[_0x0fff('0x14')](_0x0fff('0x1c'),_0x29f702[_0x0fff('0x16')],_0x44a54a);_0x49d211(_0x136520[_0x0fff('0x14')](0x1f4,_0x29f702['message']));});});};
\ No newline at end of file
index 8939384..ef0bd4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f0a=['length','mailMessage:','remove','register'];(function(_0xc0eeb2,_0x350fd5){var _0x3ce561=function(_0x18f5cd){while(--_0x18f5cd){_0xc0eeb2['push'](_0xc0eeb2['shift']());}};_0x3ce561(++_0x350fd5);}(_0x3f0a,0x19a));var _0xa3f0=function(_0x5dcf1f,_0x2b1a7d){_0x5dcf1f=_0x5dcf1f-0x0;var _0x1878c8=_0x3f0a[_0x5dcf1f];return _0x1878c8;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xa3f0('0x0'),'update'];function createListener(_0x51454d,_0x5a7ca7){return function(_0x51a26a){_0x5a7ca7['emit'](_0x51454d,_0x51a26a);};}function removeListener(_0x4073d7,_0x22bd74){return function(){MailMessageEvents['removeListener'](_0x4073d7,_0x22bd74);};}exports[_0xa3f0('0x1')]=function(_0x517775){for(var _0x417bda=0x0,_0x3632ba=events[_0xa3f0('0x2')];_0x417bda<_0x3632ba;_0x417bda++){var _0x1b3b55=events[_0x417bda];var _0x2b1d06=createListener(_0xa3f0('0x3')+_0x1b3b55,_0x517775);MailMessageEvents['on'](_0x1b3b55,_0x2b1d06);}};
\ No newline at end of file
+var _0xf7b3=['removeListener','register','length','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x2f0162,_0x561c38){var _0x4becec=function(_0xea2491){while(--_0xea2491){_0x2f0162['push'](_0x2f0162['shift']());}};_0x4becec(++_0x561c38);}(_0xf7b3,0x112));var _0x3f7b=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xf7b3[_0x2fb87c];return _0x43038b;};'use strict';var MailMessageEvents=require(_0x3f7b('0x0'));var events=[_0x3f7b('0x1'),_0x3f7b('0x2'),_0x3f7b('0x3')];function createListener(_0x73a1f5,_0x375e94){return function(_0x54a6e2){_0x375e94[_0x3f7b('0x4')](_0x73a1f5,_0x54a6e2);};}function removeListener(_0x47d79b,_0x41888b){return function(){MailMessageEvents[_0x3f7b('0x5')](_0x47d79b,_0x41888b);};}exports[_0x3f7b('0x6')]=function(_0x926cef){for(var _0x157f4d=0x0,_0x33a6c7=events[_0x3f7b('0x7')];_0x157f4d<_0x33a6c7;_0x157f4d++){var _0x3745c7=events[_0x157f4d];var _0x5680e2=createListener(_0x3f7b('0x8')+_0x3745c7,_0x926cef);MailMessageEvents['on'](_0x3745c7,_0x5680e2);}};
\ No newline at end of file
index 1061c09..a53cbec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e82=['getMembers','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','addAgents','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members'];(function(_0x3207ae,_0x31234d){var _0xbd7e59=function(_0x31573a){while(--_0x31573a){_0x3207ae['push'](_0x3207ae['shift']());}};_0xbd7e59(++_0x31234d);}(_0x9e82,0xae));var _0x29e8=function(_0x306cb2,_0x4b15e9){_0x306cb2=_0x306cb2-0x0;var _0x5e3086=_0x9e82[_0x306cb2];return _0x5e3086;};'use strict';var multer=require(_0x29e8('0x0'));var util=require(_0x29e8('0x1'));var path=require(_0x29e8('0x2'));var timeout=require(_0x29e8('0x3'));var express=require(_0x29e8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x29e8('0x5'));var interaction=require(_0x29e8('0x6'));var config=require(_0x29e8('0x7'));var controller=require(_0x29e8('0x8'));router[_0x29e8('0x9')]('/',auth[_0x29e8('0xa')](),controller['index']);router[_0x29e8('0x9')](_0x29e8('0xb'),auth[_0x29e8('0xa')](),controller[_0x29e8('0xc')]);router['get'](_0x29e8('0xd'),auth[_0x29e8('0xa')](),controller['show']);router[_0x29e8('0x9')](_0x29e8('0xe'),auth[_0x29e8('0xa')](),controller[_0x29e8('0xf')]);router[_0x29e8('0x9')](_0x29e8('0x10'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x11')]);router[_0x29e8('0x9')]('/:id/users',auth[_0x29e8('0xa')](),controller[_0x29e8('0x12')]);router['post']('/',auth[_0x29e8('0xa')](),controller[_0x29e8('0x13')]);router[_0x29e8('0x14')](_0x29e8('0x10'),auth['isAuthenticated'](),controller[_0x29e8('0x15')]);router['post'](_0x29e8('0x16'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x17')]);router['put'](_0x29e8('0xd'),auth[_0x29e8('0xa')](),controller[_0x29e8('0x18')]);router[_0x29e8('0x19')](_0x29e8('0xd'),auth['isAuthenticated'](),controller[_0x29e8('0x1a')]);router[_0x29e8('0x19')]('/:id/teams',auth[_0x29e8('0xa')](),controller['removeTeams']);router['delete'](_0x29e8('0x16'),auth[_0x29e8('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x0667=['/:id/users','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams'];(function(_0x47891a,_0x27a0c0){var _0x369247=function(_0x41ff48){while(--_0x41ff48){_0x47891a['push'](_0x47891a['shift']());}};_0x369247(++_0x27a0c0);}(_0x0667,0xde));var _0x7066=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0667[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x7066('0x0'));var util=require('util');var path=require(_0x7066('0x1'));var timeout=require('connect-timeout');var express=require(_0x7066('0x2'));var router=express[_0x7066('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7066('0x4'));var interaction=require(_0x7066('0x5'));var config=require(_0x7066('0x6'));var controller=require(_0x7066('0x7'));router[_0x7066('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7066('0x8')](_0x7066('0x9'),auth[_0x7066('0xa')](),controller['describe']);router[_0x7066('0x8')](_0x7066('0xb'),auth[_0x7066('0xa')](),controller[_0x7066('0xc')]);router['get'](_0x7066('0xd'),auth[_0x7066('0xa')](),controller[_0x7066('0xe')]);router[_0x7066('0x8')](_0x7066('0xf'),auth[_0x7066('0xa')](),controller[_0x7066('0x10')]);router[_0x7066('0x8')]('/:id/users',auth[_0x7066('0xa')](),controller[_0x7066('0x11')]);router[_0x7066('0x12')]('/',auth[_0x7066('0xa')](),controller[_0x7066('0x13')]);router[_0x7066('0x12')](_0x7066('0xf'),auth[_0x7066('0xa')](),controller[_0x7066('0x14')]);router[_0x7066('0x12')](_0x7066('0x15'),auth[_0x7066('0xa')](),controller['addAgents']);router[_0x7066('0x16')](_0x7066('0xb'),auth[_0x7066('0xa')](),controller[_0x7066('0x17')]);router[_0x7066('0x18')]('/:id',auth[_0x7066('0xa')](),controller[_0x7066('0x19')]);router[_0x7066('0x18')](_0x7066('0xf'),auth[_0x7066('0xa')](),controller['removeTeams']);router[_0x7066('0x18')](_0x7066('0x15'),auth[_0x7066('0xa')](),controller['removeAgents']);module[_0x7066('0x1a')]=router;
\ No newline at end of file
index 3840369..739e79b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae6f=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xae6f,0x15f));var _0xfae6=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xae6f[_0x12fc8d];return _0x3f9d04;};'use strict';var Sequelize=require(_0xfae6('0x0'));module[_0xfae6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xfae6('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfae6('0x3')]},'timeout':{'type':Sequelize[_0xfae6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfae6('0x5')](_0xfae6('0x6'),_0xfae6('0x7'),_0xfae6('0x8'))}};
\ No newline at end of file
+var _0x1d7f=['STRING','INTEGER','ENUM','rrmemory','roundrobin','exports','name'];(function(_0x390b04,_0x1fcd8a){var _0x11e021=function(_0x26db22){while(--_0x26db22){_0x390b04['push'](_0x390b04['shift']());}};_0x11e021(++_0x1fcd8a);}(_0x1d7f,0x116));var _0xf1d7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1d7f[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0xf1d7('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf1d7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf1d7('0x2')]},'timeout':{'type':Sequelize[_0xf1d7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf1d7('0x4')](_0xf1d7('0x5'),'beepall',_0xf1d7('0x6'))}};
\ No newline at end of file
index f499f1d..37b8761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6027=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserMailQueue','rawAttributes','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','all','compact','value','removeAgents','forEach','userMailQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','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/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','create','body','user','get','role','UserProfileSection','find'];(function(_0x45ec55,_0x430053){var _0x47691d=function(_0x44d640){while(--_0x44d640){_0x45ec55['push'](_0x45ec55['shift']());}};_0x47691d(++_0x430053);}(_0x6027,0xc5));var _0x7602=function(_0x336df4,_0x52c1dc){_0x336df4=_0x336df4-0x0;var _0x580d8c=_0x6027[_0x336df4];return _0x580d8c;};'use strict';var emlformat=require(_0x7602('0x0'));var rimraf=require(_0x7602('0x1'));var zipdir=require(_0x7602('0x2'));var jsonpatch=require(_0x7602('0x3'));var rp=require(_0x7602('0x4'));var moment=require(_0x7602('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7602('0x6'));var path=require('path');var sox=require(_0x7602('0x7'));var csv=require('to-csv');var ejs=require(_0x7602('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7602('0x9'));var squel=require(_0x7602('0xa'));var crypto=require('crypto');var jsforce=require(_0x7602('0xb'));var deskjs=require(_0x7602('0xc'));var toCsv=require(_0x7602('0xd'));var querystring=require(_0x7602('0xe'));var Papa=require(_0x7602('0xf'));var Redis=require(_0x7602('0x10'));var authService=require(_0x7602('0x11'));var qs=require(_0x7602('0x12'));var as=require(_0x7602('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7602('0x14'))(_0x7602('0x15'));var utils=require(_0x7602('0x16'));var config=require(_0x7602('0x17'));var licenseUtil=require(_0x7602('0x18'));var db=require(_0x7602('0x19'))['db'];config[_0x7602('0x1a')]=_[_0x7602('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7602('0x1c'))(new Redis(config['redis']));require(_0x7602('0x1d'))['register'](socket);function respondWithStatusCode(_0x77c4c4,_0x1cbbb9){_0x1cbbb9=_0x1cbbb9||0xcc;return function(_0x648cf9){if(_0x648cf9){return _0x77c4c4[_0x7602('0x1e')](_0x1cbbb9);}return _0x77c4c4[_0x7602('0x1f')](_0x1cbbb9)[_0x7602('0x20')]();};}function respondWithResult(_0x120274,_0x15a23a){_0x15a23a=_0x15a23a||0xc8;return function(_0x2c2367){if(_0x2c2367){return _0x120274[_0x7602('0x1f')](_0x15a23a)[_0x7602('0x21')](_0x2c2367);}};}function respondWithFilteredResult(_0xd810cd,_0x5506a6){return function(_0x591506){if(_0x591506){var _0xc7db17=typeof _0x5506a6['offset']===_0x7602('0x22')&&typeof _0x5506a6[_0x7602('0x23')]===_0x7602('0x22');var _0x168dab=_0x591506[_0x7602('0x24')];var _0x5739c9=_0xc7db17?0x0:_0x5506a6[_0x7602('0x25')];var _0xdc4e64=_0xc7db17?_0x591506['count']:_0x5506a6['offset']+_0x5506a6[_0x7602('0x23')];var _0x12f59d;if(_0xdc4e64>=_0x168dab){_0xdc4e64=_0x168dab;_0x12f59d=0xc8;}else{_0x12f59d=0xce;}_0xd810cd[_0x7602('0x1f')](_0x12f59d);return _0xd810cd[_0x7602('0x26')](_0x7602('0x27'),_0x5739c9+'-'+_0xdc4e64+'/'+_0x168dab)[_0x7602('0x21')](_0x591506);}return null;};}function patchUpdates(_0x3b5067){return function(_0x49eb46){try{jsonpatch[_0x7602('0x28')](_0x49eb46,_0x3b5067,!![]);}catch(_0x2ce8eb){return BPromise[_0x7602('0x29')](_0x2ce8eb);}return _0x49eb46['save']();};}function saveUpdates(_0x3d7d62,_0x164b2b){return function(_0x42fb91){if(_0x42fb91){return _0x42fb91['update'](_0x3d7d62)[_0x7602('0x2a')](function(_0x36bbe9){return _0x36bbe9;});}return null;};}function removeEntity(_0x520965,_0x47feb3){return function(_0x187983){if(_0x187983){return _0x187983[_0x7602('0x2b')]()[_0x7602('0x2a')](function(){var _0x186615=_0x187983['get']({'plain':!![]});var _0x546a78=_0x7602('0x2c');return db[_0x7602('0x2d')]['destroy']({'where':{'type':_0x546a78,'resourceId':_0x186615['id']}})[_0x7602('0x2a')](function(){return _0x187983;});})[_0x7602('0x2a')](function(){_0x520965[_0x7602('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b06c4,_0x2efde5){return function(_0xd5d7c8){if(!_0xd5d7c8){_0x5b06c4[_0x7602('0x1e')](0x194);}return _0xd5d7c8;};}function handleError(_0x3f16e5,_0x41e1fd){_0x41e1fd=_0x41e1fd||0x1f4;return function(_0x4baf22){logger[_0x7602('0x2e')](_0x4baf22[_0x7602('0x2f')]);if(_0x4baf22[_0x7602('0x30')]){delete _0x4baf22[_0x7602('0x30')];}_0x3f16e5[_0x7602('0x1f')](_0x41e1fd)[_0x7602('0x31')](_0x4baf22);};}exports[_0x7602('0x32')]=function(_0x35e554,_0x20c68f){var _0x45d892={},_0x39ac36={},_0x3dcf70={'count':0x0,'rows':[]};var _0x57c81d=_[_0x7602('0x33')](db[_0x7602('0x34')]['rawAttributes'],function(_0x21d205){return{'name':_0x21d205['fieldName'],'type':_0x21d205['type'][_0x7602('0x35')]};});_0x39ac36[_0x7602('0x36')]=_['map'](_0x57c81d,_0x7602('0x30'));_0x39ac36[_0x7602('0x37')]=_[_0x7602('0x38')](_0x35e554[_0x7602('0x37')]);_0x39ac36[_0x7602('0x39')]=_[_0x7602('0x3a')](_0x39ac36['model'],_0x39ac36[_0x7602('0x37')]);_0x45d892[_0x7602('0x3b')]=_['intersection'](_0x39ac36[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x35e554['query'][_0x7602('0x3c')]));_0x45d892[_0x7602('0x3b')]=_0x45d892[_0x7602('0x3b')][_0x7602('0x3d')]?_0x45d892[_0x7602('0x3b')]:_0x39ac36[_0x7602('0x36')];if(!_0x35e554['query'][_0x7602('0x3e')](_0x7602('0x3f'))){_0x45d892['limit']=qs[_0x7602('0x23')](_0x35e554[_0x7602('0x37')]['limit']);_0x45d892['offset']=qs[_0x7602('0x25')](_0x35e554[_0x7602('0x37')][_0x7602('0x25')]);}_0x45d892[_0x7602('0x40')]=qs[_0x7602('0x41')](_0x35e554[_0x7602('0x37')][_0x7602('0x41')]);_0x45d892['where']=qs[_0x7602('0x39')](_[_0x7602('0x42')](_0x35e554[_0x7602('0x37')],_0x39ac36[_0x7602('0x39')]),_0x57c81d);if(_0x35e554[_0x7602('0x37')][_0x7602('0x43')]){_0x45d892['where']=_['merge'](_0x45d892[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x57c81d,function(_0x306d77){if(_0x306d77[_0x7602('0x45')]!==_0x7602('0x46')){var _0x4d378e={};_0x4d378e[_0x306d77[_0x7602('0x30')]]={'$like':'%'+_0x35e554[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x4d378e;}})});}_0x45d892=_['merge']({},_0x45d892,_0x35e554[_0x7602('0x47')]);var _0x27b19f={'where':_0x45d892[_0x7602('0x44')]};return db[_0x7602('0x34')]['count'](_0x27b19f)[_0x7602('0x2a')](function(_0x178626){_0x3dcf70['count']=_0x178626;if(_0x35e554[_0x7602('0x37')][_0x7602('0x48')]){_0x45d892['include']=[{'all':!![]}];}return db[_0x7602('0x34')][_0x7602('0x49')](_0x45d892);})[_0x7602('0x2a')](function(_0x53462a){_0x3dcf70[_0x7602('0x4a')]=_0x53462a;return _0x3dcf70;})['then'](respondWithFilteredResult(_0x20c68f,_0x45d892))[_0x7602('0x4b')](handleError(_0x20c68f,null));};exports[_0x7602('0x4c')]=function(_0x4651ad,_0x510dc4){var _0xd96acc={'raw':!![],'where':{'id':_0x4651ad[_0x7602('0x4d')]['id']}},_0x1344db={};_0x1344db[_0x7602('0x36')]=_[_0x7602('0x38')](db[_0x7602('0x34')]['rawAttributes']);_0x1344db['query']=_[_0x7602('0x38')](_0x4651ad[_0x7602('0x37')]);_0x1344db[_0x7602('0x39')]=_[_0x7602('0x3a')](_0x1344db[_0x7602('0x36')],_0x1344db[_0x7602('0x37')]);_0xd96acc[_0x7602('0x3b')]=_[_0x7602('0x3a')](_0x1344db[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x4651ad[_0x7602('0x37')][_0x7602('0x3c')]));_0xd96acc[_0x7602('0x3b')]=_0xd96acc[_0x7602('0x3b')][_0x7602('0x3d')]?_0xd96acc[_0x7602('0x3b')]:_0x1344db[_0x7602('0x36')];if(_0x4651ad[_0x7602('0x37')][_0x7602('0x48')]){_0xd96acc[_0x7602('0x4e')]=[{'all':!![]}];}_0xd96acc=_[_0x7602('0x4f')]({},_0xd96acc,_0x4651ad[_0x7602('0x47')]);return db[_0x7602('0x34')]['find'](_0xd96acc)[_0x7602('0x2a')](handleEntityNotFound(_0x510dc4,null))[_0x7602('0x2a')](respondWithResult(_0x510dc4,null))[_0x7602('0x4b')](handleError(_0x510dc4,null));};exports[_0x7602('0x50')]=function(_0x28b59f,_0x30c96a){return db['MailQueue'][_0x7602('0x50')](_0x28b59f[_0x7602('0x51')],{})[_0x7602('0x2a')](function(_0x1f7928){var _0x4824bb=_0x28b59f[_0x7602('0x52')][_0x7602('0x53')]({'plain':!![]});if(!_0x4824bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4824bb[_0x7602('0x54')]===_0x7602('0x52')){var _0x59028d=_0x1f7928[_0x7602('0x53')]({'plain':!![]});var _0x4ea15a=_0x7602('0x2c');return db[_0x7602('0x55')][_0x7602('0x56')]({'where':{'name':_0x4ea15a,'userProfileId':_0x4824bb[_0x7602('0x57')]},'raw':!![]})[_0x7602('0x2a')](function(_0x50abaf){if(_0x50abaf&&_0x50abaf['autoAssociation']===0x0){return db[_0x7602('0x2d')][_0x7602('0x50')]({'name':_0x59028d[_0x7602('0x30')],'resourceId':_0x59028d['id'],'type':_0x50abaf['name'],'sectionId':_0x50abaf['id']},{})[_0x7602('0x2a')](function(){return _0x1f7928;});}else{return _0x1f7928;}})[_0x7602('0x4b')](function(_0x24a44c){logger['error'](_0x7602('0x58'),_0x24a44c);throw _0x24a44c;});}return _0x1f7928;})[_0x7602('0x2a')](respondWithResult(_0x30c96a,0xc9))[_0x7602('0x4b')](handleError(_0x30c96a,null));};exports[_0x7602('0x59')]=function(_0x355c70,_0x16be38){if(_0x355c70[_0x7602('0x51')]['id']){delete _0x355c70[_0x7602('0x51')]['id'];}return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x355c70[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x16be38,null))['then'](saveUpdates(_0x355c70[_0x7602('0x51')],null))[_0x7602('0x2a')](respondWithResult(_0x16be38,null))[_0x7602('0x4b')](handleError(_0x16be38,null));};exports['destroy']=function(_0x47dd3e,_0x325202){return db[_0x7602('0x34')]['find']({'where':{'id':_0x47dd3e[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x325202,null))[_0x7602('0x2a')](removeEntity(_0x325202,null))[_0x7602('0x4b')](handleError(_0x325202,null));};exports[_0x7602('0x5a')]=function(_0x1ee9ee,_0x7cce2d){return db[_0x7602('0x34')][_0x7602('0x5a')]()['then'](respondWithResult(_0x7cce2d,null))[_0x7602('0x4b')](handleError(_0x7cce2d,null));};exports[_0x7602('0x5b')]=function(_0x45c04e,_0x2b9ebd,_0xcf8106){var _0x476cf2={'raw':!![],'where':{}},_0xab255d={},_0x57ab91;return db[_0x7602('0x34')][_0x7602('0x5c')]({'where':{'id':_0x45c04e[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x2b9ebd,null))[_0x7602('0x2a')](function(_0x2b3318){if(_0x2b3318){_0x57ab91=_0x2b3318[_0x7602('0x53')]({'plain':!![]});_0xab255d['model']=_[_0x7602('0x38')](db[_0x7602('0x5d')][_0x7602('0x5e')]);_0xab255d[_0x7602('0x37')]=_[_0x7602('0x38')](_0x45c04e[_0x7602('0x37')]);_0xab255d[_0x7602('0x39')]=_[_0x7602('0x3a')](_0xab255d[_0x7602('0x36')],_0xab255d[_0x7602('0x37')]);_0x476cf2[_0x7602('0x3b')]=_[_0x7602('0x3a')](_0xab255d[_0x7602('0x36')],qs[_0x7602('0x3c')](_0x45c04e[_0x7602('0x37')][_0x7602('0x3c')]));_0x476cf2[_0x7602('0x3b')]=_0x476cf2[_0x7602('0x3b')][_0x7602('0x3d')]?_0x476cf2['attributes']:_0xab255d[_0x7602('0x36')];if(!_0x45c04e[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x476cf2[_0x7602('0x23')]=qs[_0x7602('0x23')](_0x45c04e['query'][_0x7602('0x23')]);_0x476cf2[_0x7602('0x25')]=qs[_0x7602('0x25')](_0x45c04e[_0x7602('0x37')][_0x7602('0x25')]);}_0x476cf2[_0x7602('0x40')]=qs[_0x7602('0x41')](_0x45c04e[_0x7602('0x37')][_0x7602('0x41')]);_0x476cf2[_0x7602('0x44')]=qs[_0x7602('0x39')](_[_0x7602('0x42')](_0x45c04e['query'],_0xab255d['filters']));_0x476cf2[_0x7602('0x44')][_0x7602('0x5f')]=_0x2b3318['id'];if(_0x45c04e[_0x7602('0x37')]['filter']){_0x476cf2[_0x7602('0x44')]=_[_0x7602('0x4f')](_0x476cf2[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x476cf2[_0x7602('0x3b')],function(_0x230261){var _0x303397={};_0x303397[_0x230261]={'$like':'%'+_0x45c04e['query'][_0x7602('0x43')]+'%'};return _0x303397;})});}_0x476cf2=_[_0x7602('0x4f')]({},_0x476cf2,_0x45c04e[_0x7602('0x47')]);return db[_0x7602('0x5d')][_0x7602('0x49')](_0x476cf2);}})[_0x7602('0x2a')](function(_0x1ee0fb){if(_0x1ee0fb){return db[_0x7602('0x60')]['findAndCountAll']({'where':{'id':_[_0x7602('0x33')](_0x1ee0fb,_0x7602('0x61')),'role':_0x7602('0x62')},'attributes':['id',_0x7602('0x30'),_0x7602('0x63'),_0x7602('0x64'),_0x7602('0x65')]});}})['then'](function(_0x130c64){if(_0x130c64){return{'count':_0x130c64[_0x7602('0x24')],'rows':_[_0x7602('0x33')](_0x130c64[_0x7602('0x4a')],function(_0x4ffaec){return{'membername':_0x4ffaec['name'],'UserId':_0x4ffaec['id'],'queue_name':_0x57ab91[_0x7602('0x30')],'MailQueueId':_0x57ab91['id'],'interface':util['format'](_0x7602('0x66'),_0x7602('0x67'),_0x4ffaec[_0x7602('0x30')]),'penalty':0x0,'paused':_0x4ffaec['mailPause'],'createdAt':_0x4ffaec['createdAt'],'updatedAt':_0x4ffaec['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7602('0x2a')](respondWithFilteredResult(_0x2b9ebd,_0x476cf2))[_0x7602('0x4b')](handleError(_0x2b9ebd,null));};exports[_0x7602('0x68')]=function(_0x16eccc,_0x121706,_0x2836fd){var _0x441ea7={};var _0x5c6680={};var _0x48374d;var _0x3d8e0f;return db[_0x7602('0x34')][_0x7602('0x5c')]({'where':{'id':_0x16eccc[_0x7602('0x4d')]['id']}})['then'](handleEntityNotFound(_0x121706,null))[_0x7602('0x2a')](function(_0x5be405){if(_0x5be405){_0x48374d=_0x5be405;_0x5c6680[_0x7602('0x36')]=_['keys'](db[_0x7602('0x69')][_0x7602('0x5e')]);_0x5c6680[_0x7602('0x37')]=_['keys'](_0x16eccc[_0x7602('0x37')]);_0x5c6680[_0x7602('0x39')]=_['intersection'](_0x5c6680[_0x7602('0x36')],_0x5c6680[_0x7602('0x37')]);_0x441ea7[_0x7602('0x3b')]=_['intersection'](_0x5c6680['model'],qs[_0x7602('0x3c')](_0x16eccc[_0x7602('0x37')][_0x7602('0x3c')]));_0x441ea7[_0x7602('0x3b')]=_0x441ea7['attributes'][_0x7602('0x3d')]?_0x441ea7[_0x7602('0x3b')]:_0x5c6680[_0x7602('0x36')];_0x441ea7['order']=qs[_0x7602('0x41')](_0x16eccc[_0x7602('0x37')][_0x7602('0x41')]);_0x441ea7[_0x7602('0x44')]=qs['filters'](_[_0x7602('0x42')](_0x16eccc['query'],_0x5c6680[_0x7602('0x39')]));if(_0x16eccc[_0x7602('0x37')][_0x7602('0x43')]){_0x441ea7[_0x7602('0x44')]=_[_0x7602('0x4f')](_0x441ea7[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x441ea7['attributes'],function(_0xf55e78){var _0x521e47={};_0x521e47[_0xf55e78]={'$like':'%'+_0x16eccc[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x521e47;})});}_0x441ea7=_['merge']({},_0x441ea7,_0x16eccc[_0x7602('0x47')]);return _0x48374d[_0x7602('0x68')](_0x441ea7);}})[_0x7602('0x2a')](function(_0x2cf2eb){if(_0x2cf2eb){_0x3d8e0f=_0x2cf2eb['length'];if(!_0x16eccc[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x441ea7['limit']=qs[_0x7602('0x23')](_0x16eccc['query'][_0x7602('0x23')]);_0x441ea7['offset']=qs[_0x7602('0x25')](_0x16eccc[_0x7602('0x37')][_0x7602('0x25')]);}return _0x48374d['getTeams'](_0x441ea7);}})['then'](function(_0x4d08e4){if(_0x4d08e4){return _0x4d08e4?{'count':_0x3d8e0f,'rows':_0x4d08e4}:null;}})[_0x7602('0x2a')](respondWithResult(_0x121706,null))[_0x7602('0x4b')](handleError(_0x121706,null));};exports[_0x7602('0x6a')]=function(_0x323620,_0x331ab0,_0x62c4c5){var _0x45220f=_0x323620[_0x7602('0x51')][_0x7602('0x6b')];return db['Team'][_0x7602('0x49')]({'where':{'id':_0x45220f},'attributes':['id'],'include':[{'model':db[_0x7602('0x60')],'as':_0x7602('0x6c'),'attributes':['id',_0x7602('0x30'),_0x7602('0x6d'),_0x7602('0x6e'),_0x7602('0x6f')],'raw':!![]}]})[_0x7602('0x2a')](function(_0x55982d){if(_0x55982d){var _0x204065=_['flatMap'](_0x55982d,function(_0x10b98c){var _0x389b6d=_0x10b98c[_0x7602('0x53')]({'plain':!![]});return _0x389b6d[_0x7602('0x6c')];});return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x323620[_0x7602('0x4d')]['id']}})['then'](function(_0x5e503c){return db['sequelize'][_0x7602('0x70')](function(_0x29c102){return _0x5e503c[_0x7602('0x6a')](_0x45220f,{'transaction':_0x29c102})[_0x7602('0x2a')](function(){return BPromise[_0x7602('0x71')](_0x204065,function(_0x368f0f){return db[_0x7602('0x5d')][_0x7602('0x72')]({'where':{'UserId':_0x368f0f['id'],'MailQueueId':_0x323620[_0x7602('0x4d')]['id']},'transaction':_0x29c102});});})['then'](function(){_0x204065['forEach'](function(_0x27afdd){socket[_0x7602('0x73')](_0x7602('0x74'),{'UserId':_0x27afdd['id'],'MailQueueId':_0x5e503c['id']});});});});});}})[_0x7602('0x2a')](respondWithStatusCode(_0x331ab0,null))[_0x7602('0x4b')](handleError(_0x331ab0,null));};exports[_0x7602('0x75')]=function(_0x5b7e6f,_0x42d9e3,_0x2eb440){return db[_0x7602('0x69')]['findAll']({'where':{'id':_0x5b7e6f[_0x7602('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7602('0x60')],'as':_0x7602('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x7602('0x2a')](handleEntityNotFound(_0x42d9e3,null))[_0x7602('0x2a')](function(_0x298c4b){var _0x2a9fed=_[_0x7602('0x33')](_0x298c4b,'id');var _0x4f6d51=[];var _0x5608f9=[];var _0x1ffe20=squel[_0x7602('0x76')]();_0x1ffe20[_0x7602('0x77')](_0x7602('0x78'))[_0x7602('0x79')]('team_has_mail_queues','tq')[_0x7602('0x7a')]('user_has_teams','ut',_0x7602('0x7b'))['where'](_0x7602('0x7c'),_0x5b7e6f[_0x7602('0x4d')]['id']);for(var _0x1aa7e3=0x0;_0x1aa7e3<_0x298c4b[_0x7602('0x3d')];_0x1aa7e3+=0x1){let _0x2cefcb=_0x298c4b[_0x1aa7e3];for(var _0xb257df=0x0;_0xb257df<_0x2cefcb['Agents']['length'];_0xb257df+=0x1){let _0x469912=_0x2cefcb[_0x7602('0x6c')][_0xb257df];var _0x867bb1=_0x1ffe20[_0x7602('0x7d')]();_0x867bb1[_0x7602('0x44')]('ut.UserId\x20=\x20?',_0x469912['id']);_0x5608f9[_0x7602('0x7e')](db[_0x7602('0x7f')][_0x7602('0x37')](_0x867bb1[_0x7602('0x80')](),{'type':db['sequelize'][_0x7602('0x81')][_0x7602('0x82')]})[_0x7602('0x2a')](function(_0x457293){if(_0x457293[_0x7602('0x3d')]===0x1){return _0x469912['id'];}else{var _0x54d5e1=_[_0x7602('0x83')](_[_0x7602('0x33')](_0x457293,'TeamId'),function(_0x4dc265){return _['includes'](_0x2a9fed,_0x4dc265);});if(_0x54d5e1){return _0x469912['id'];}}}));}}return BPromise[_0x7602('0x84')](_0x5608f9)[_0x7602('0x2a')](function(_0x48eb99){_0x4f6d51=_(_0x4f6d51)['union'](_0x48eb99)[_0x7602('0x85')]()[_0x7602('0x86')]();return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0x5b7e6f['params']['id']}})[_0x7602('0x2a')](function(_0x26215){return db[_0x7602('0x7f')]['transaction'](function(_0x443e92){return _0x26215[_0x7602('0x75')](_0x5b7e6f[_0x7602('0x37')][_0x7602('0x6b')],{'transaction':_0x443e92})[_0x7602('0x2a')](function(){if(!_['isEmpty'](_0x4f6d51)){return _0x26215[_0x7602('0x87')](_0x4f6d51,{'transaction':_0x443e92});}})['then'](function(){_0x4f6d51[_0x7602('0x88')](function(_0x553cc0){socket['emit'](_0x7602('0x89'),{'UserId':_0x553cc0,'MailQueueId':_0x26215['id']});});});});});});})[_0x7602('0x2a')](respondWithStatusCode(_0x42d9e3,null))[_0x7602('0x4b')](handleError(_0x42d9e3,null));};exports['addAgents']=function(_0x1fe6df,_0x12af6,_0x109fc8){return db['MailQueue']['find']({'where':{'id':_0x1fe6df[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x12af6,null))['then'](function(_0x212c48){if(_0x212c48){return _0x212c48[_0x7602('0x8a')](_0x1fe6df[_0x7602('0x51')][_0x7602('0x6b')],_[_0x7602('0x8b')](_0x1fe6df[_0x7602('0x51')],['ids','id'])||{})['spread'](function(_0x43004c){for(var _0x70ae38=0x0;_0x70ae38<_0x1fe6df[_0x7602('0x51')]['ids'][_0x7602('0x3d')];_0x70ae38+=0x1){socket[_0x7602('0x73')](_0x7602('0x74'),{'UserId':Number(_0x1fe6df[_0x7602('0x51')]['ids'][_0x70ae38]),'MailQueueId':Number(_0x1fe6df[_0x7602('0x4d')]['id'])});}return _0x43004c;});}})[_0x7602('0x2a')](respondWithResult(_0x12af6,null))[_0x7602('0x4b')](handleError(_0x12af6,null));};exports[_0x7602('0x87')]=function(_0xb9a276,_0x426c0d,_0x478a2e){return db[_0x7602('0x34')][_0x7602('0x56')]({'where':{'id':_0xb9a276[_0x7602('0x4d')]['id']}})[_0x7602('0x2a')](handleEntityNotFound(_0x426c0d,null))[_0x7602('0x2a')](function(_0x47803b){if(_0x47803b){return _0x47803b['removeAgents'](_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')])['then'](function(){if(_[_0x7602('0x8c')](_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')])){for(var _0x268df3=0x0;_0x268df3<_0xb9a276['query']['ids']['length'];_0x268df3+=0x1){socket[_0x7602('0x73')](_0x7602('0x89'),{'UserId':Number(_0xb9a276[_0x7602('0x37')][_0x7602('0x6b')][_0x268df3]),'MailQueueId':Number(_0xb9a276['params']['id'])});}}else{socket[_0x7602('0x73')]('userMailQueue:remove',{'UserId':Number(_0xb9a276[_0x7602('0x37')]['ids']),'MailQueueId':Number(_0xb9a276[_0x7602('0x4d')]['id'])});}});}})[_0x7602('0x2a')](respondWithStatusCode(_0x426c0d,null))[_0x7602('0x4b')](handleError(_0x426c0d,null));};exports[_0x7602('0x8d')]=function(_0x3f1e76,_0x12048e,_0x32e144){var _0x45baa1={};var _0x302317={};var _0x3deb8c;var _0x31842d;return db[_0x7602('0x34')]['findOne']({'where':{'id':_0x3f1e76[_0x7602('0x4d')]['id']}})['then'](handleEntityNotFound(_0x12048e,null))[_0x7602('0x2a')](function(_0x322703){if(_0x322703){_0x3deb8c=_0x322703;_0x302317['model']=_['keys'](db[_0x7602('0x60')][_0x7602('0x5e')]);_0x302317['query']=_[_0x7602('0x38')](_0x3f1e76['query']);_0x302317[_0x7602('0x39')]=_['intersection'](_0x302317[_0x7602('0x36')],_0x302317[_0x7602('0x37')]);_0x45baa1[_0x7602('0x3b')]=_['intersection'](_0x302317['model'],qs['fields'](_0x3f1e76[_0x7602('0x37')][_0x7602('0x3c')]));_0x45baa1[_0x7602('0x3b')]=_0x45baa1['attributes']['length']?_0x45baa1[_0x7602('0x3b')]:_0x302317[_0x7602('0x36')];_0x45baa1[_0x7602('0x40')]=qs['sort'](_0x3f1e76[_0x7602('0x37')][_0x7602('0x41')]);_0x45baa1[_0x7602('0x44')]=qs['filters'](_[_0x7602('0x42')](_0x3f1e76[_0x7602('0x37')],_0x302317[_0x7602('0x39')]));if(_0x3f1e76[_0x7602('0x37')][_0x7602('0x43')]){_0x45baa1[_0x7602('0x44')]=_['merge'](_0x45baa1[_0x7602('0x44')],{'$or':_[_0x7602('0x33')](_0x45baa1['attributes'],function(_0x3a597d){var _0x198943={};_0x198943[_0x3a597d]={'$like':'%'+_0x3f1e76[_0x7602('0x37')][_0x7602('0x43')]+'%'};return _0x198943;})});}_0x45baa1=_[_0x7602('0x4f')]({},_0x45baa1,_0x3f1e76[_0x7602('0x47')]);return _0x3deb8c[_0x7602('0x8d')](_0x45baa1);}})[_0x7602('0x2a')](function(_0x99bb33){if(_0x99bb33){_0x31842d=_0x99bb33[_0x7602('0x3d')];if(!_0x3f1e76[_0x7602('0x37')][_0x7602('0x3e')](_0x7602('0x3f'))){_0x45baa1['limit']=qs['limit'](_0x3f1e76['query']['limit']);_0x45baa1[_0x7602('0x25')]=qs[_0x7602('0x25')](_0x3f1e76[_0x7602('0x37')][_0x7602('0x25')]);}return _0x3deb8c['getAgents'](_0x45baa1);}})['then'](function(_0x5d1daa){if(_0x5d1daa){return _0x5d1daa?{'count':_0x31842d,'rows':_0x5d1daa}:null;}})[_0x7602('0x2a')](respondWithResult(_0x12048e,null))['catch'](handleError(_0x12048e,null));};
\ No newline at end of file
+var _0x27ba=['from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','./mailQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','MailQueue','findAll','rows','catch','params','keys','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','pick','UserMailQueue','findAndCountAll','agent','updatedAt','createdAt','format','mailPause','getTeams','Team','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0x52fdc2,_0x1ff233){var _0xc4380e=function(_0x7dc792){while(--_0x7dc792){_0x52fdc2['push'](_0x52fdc2['shift']());}};_0xc4380e(++_0x1ff233);}(_0x27ba,0xaf));var _0xa27b=function(_0xbf2512,_0x476653){_0xbf2512=_0xbf2512-0x0;var _0x3a3a06=_0x27ba[_0xbf2512];return _0x3a3a06;};'use strict';var emlformat=require(_0xa27b('0x0'));var rimraf=require(_0xa27b('0x1'));var zipdir=require(_0xa27b('0x2'));var jsonpatch=require(_0xa27b('0x3'));var rp=require(_0xa27b('0x4'));var moment=require(_0xa27b('0x5'));var BPromise=require(_0xa27b('0x6'));var Mustache=require(_0xa27b('0x7'));var util=require(_0xa27b('0x8'));var path=require(_0xa27b('0x9'));var sox=require(_0xa27b('0xa'));var csv=require(_0xa27b('0xb'));var ejs=require(_0xa27b('0xc'));var fs=require('fs');var fs_extra=require(_0xa27b('0xd'));var _=require(_0xa27b('0xe'));var squel=require(_0xa27b('0xf'));var crypto=require(_0xa27b('0x10'));var jsforce=require(_0xa27b('0x11'));var deskjs=require(_0xa27b('0x12'));var toCsv=require('to-csv');var querystring=require(_0xa27b('0x13'));var Papa=require(_0xa27b('0x14'));var Redis=require(_0xa27b('0x15'));var authService=require(_0xa27b('0x16'));var qs=require(_0xa27b('0x17'));var as=require(_0xa27b('0x18'));var hardwareService=require(_0xa27b('0x19'));var logger=require(_0xa27b('0x1a'))(_0xa27b('0x1b'));var utils=require('../../config/utils');var config=require(_0xa27b('0x1c'));var licenseUtil=require(_0xa27b('0x1d'));var db=require(_0xa27b('0x1e'))['db'];config[_0xa27b('0x1f')]=_[_0xa27b('0x20')](config[_0xa27b('0x1f')],{'host':_0xa27b('0x21'),'port':0x18eb});var socket=require(_0xa27b('0x22'))(new Redis(config['redis']));require(_0xa27b('0x23'))[_0xa27b('0x24')](socket);function respondWithStatusCode(_0x469e62,_0x583130){_0x583130=_0x583130||0xcc;return function(_0x2b05cc){if(_0x2b05cc){return _0x469e62[_0xa27b('0x25')](_0x583130);}return _0x469e62['status'](_0x583130)[_0xa27b('0x26')]();};}function respondWithResult(_0x1d5de1,_0xf203ba){_0xf203ba=_0xf203ba||0xc8;return function(_0x5bba2a){if(_0x5bba2a){return _0x1d5de1[_0xa27b('0x27')](_0xf203ba)[_0xa27b('0x28')](_0x5bba2a);}};}function respondWithFilteredResult(_0x1e9444,_0x3799e9){return function(_0x99eb9e){if(_0x99eb9e){var _0xd7acde=typeof _0x3799e9[_0xa27b('0x29')]===_0xa27b('0x2a')&&typeof _0x3799e9[_0xa27b('0x2b')]==='undefined';var _0x283b9e=_0x99eb9e[_0xa27b('0x2c')];var _0x5aa603=_0xd7acde?0x0:_0x3799e9[_0xa27b('0x29')];var _0x3cce05=_0xd7acde?_0x99eb9e[_0xa27b('0x2c')]:_0x3799e9[_0xa27b('0x29')]+_0x3799e9[_0xa27b('0x2b')];var _0x2105d3;if(_0x3cce05>=_0x283b9e){_0x3cce05=_0x283b9e;_0x2105d3=0xc8;}else{_0x2105d3=0xce;}_0x1e9444['status'](_0x2105d3);return _0x1e9444['set'](_0xa27b('0x2d'),_0x5aa603+'-'+_0x3cce05+'/'+_0x283b9e)[_0xa27b('0x28')](_0x99eb9e);}return null;};}function patchUpdates(_0x23a3b8){return function(_0x423e15){try{jsonpatch['apply'](_0x423e15,_0x23a3b8,!![]);}catch(_0xbaa33c){return BPromise[_0xa27b('0x2e')](_0xbaa33c);}return _0x423e15[_0xa27b('0x2f')]();};}function saveUpdates(_0x3a4e83,_0x387157){return function(_0x22a4a6){if(_0x22a4a6){return _0x22a4a6[_0xa27b('0x30')](_0x3a4e83)[_0xa27b('0x31')](function(_0x397cc4){return _0x397cc4;});}return null;};}function removeEntity(_0x3b642d,_0x3c2c83){return function(_0x22f3d3){if(_0x22f3d3){return _0x22f3d3[_0xa27b('0x32')]()['then'](function(){var _0x2d2804=_0x22f3d3[_0xa27b('0x33')]({'plain':!![]});var _0x12b314=_0xa27b('0x34');return db[_0xa27b('0x35')][_0xa27b('0x32')]({'where':{'type':_0x12b314,'resourceId':_0x2d2804['id']}})['then'](function(){return _0x22f3d3;});})[_0xa27b('0x31')](function(){_0x3b642d[_0xa27b('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e21e,_0x32b070){return function(_0x2a2f40){if(!_0x2a2f40){_0x20e21e[_0xa27b('0x25')](0x194);}return _0x2a2f40;};}function handleError(_0x17950c,_0xe460b2){_0xe460b2=_0xe460b2||0x1f4;return function(_0x4525fe){logger['error'](_0x4525fe['stack']);if(_0x4525fe[_0xa27b('0x36')]){delete _0x4525fe[_0xa27b('0x36')];}_0x17950c[_0xa27b('0x27')](_0xe460b2)[_0xa27b('0x37')](_0x4525fe);};}exports['index']=function(_0xab1013,_0x5c3e4c){var _0x4e62ca={},_0x18d2c0={},_0x4aeeb3={'count':0x0,'rows':[]};var _0x3d4ac3=_[_0xa27b('0x38')](db['MailQueue'][_0xa27b('0x39')],function(_0x33f990){return{'name':_0x33f990[_0xa27b('0x3a')],'type':_0x33f990['type'][_0xa27b('0x3b')]};});_0x18d2c0[_0xa27b('0x3c')]=_[_0xa27b('0x38')](_0x3d4ac3,_0xa27b('0x36'));_0x18d2c0[_0xa27b('0x3d')]=_['keys'](_0xab1013['query']);_0x18d2c0[_0xa27b('0x3e')]=_[_0xa27b('0x3f')](_0x18d2c0[_0xa27b('0x3c')],_0x18d2c0[_0xa27b('0x3d')]);_0x4e62ca[_0xa27b('0x40')]=_[_0xa27b('0x3f')](_0x18d2c0[_0xa27b('0x3c')],qs[_0xa27b('0x41')](_0xab1013['query'][_0xa27b('0x41')]));_0x4e62ca['attributes']=_0x4e62ca[_0xa27b('0x40')][_0xa27b('0x42')]?_0x4e62ca['attributes']:_0x18d2c0[_0xa27b('0x3c')];if(!_0xab1013['query'][_0xa27b('0x43')](_0xa27b('0x44'))){_0x4e62ca[_0xa27b('0x2b')]=qs['limit'](_0xab1013[_0xa27b('0x3d')][_0xa27b('0x2b')]);_0x4e62ca[_0xa27b('0x29')]=qs[_0xa27b('0x29')](_0xab1013[_0xa27b('0x3d')]['offset']);}_0x4e62ca[_0xa27b('0x45')]=qs['sort'](_0xab1013['query'][_0xa27b('0x46')]);_0x4e62ca['where']=qs['filters'](_['pick'](_0xab1013[_0xa27b('0x3d')],_0x18d2c0[_0xa27b('0x3e')]),_0x3d4ac3);if(_0xab1013[_0xa27b('0x3d')]['filter']){_0x4e62ca[_0xa27b('0x47')]=_['merge'](_0x4e62ca[_0xa27b('0x47')],{'$or':_['map'](_0x3d4ac3,function(_0x392760){if(_0x392760[_0xa27b('0x48')]!==_0xa27b('0x49')){var _0x4a75df={};_0x4a75df[_0x392760[_0xa27b('0x36')]]={'$like':'%'+_0xab1013[_0xa27b('0x3d')][_0xa27b('0x4a')]+'%'};return _0x4a75df;}})});}_0x4e62ca=_[_0xa27b('0x4b')]({},_0x4e62ca,_0xab1013[_0xa27b('0x4c')]);var _0x15e77e={'where':_0x4e62ca['where']};return db[_0xa27b('0x4d')][_0xa27b('0x2c')](_0x15e77e)[_0xa27b('0x31')](function(_0x2f6f64){_0x4aeeb3[_0xa27b('0x2c')]=_0x2f6f64;if(_0xab1013[_0xa27b('0x3d')]['includeAll']){_0x4e62ca['include']=[{'all':!![]}];}return db[_0xa27b('0x4d')][_0xa27b('0x4e')](_0x4e62ca);})[_0xa27b('0x31')](function(_0x114eec){_0x4aeeb3[_0xa27b('0x4f')]=_0x114eec;return _0x4aeeb3;})[_0xa27b('0x31')](respondWithFilteredResult(_0x5c3e4c,_0x4e62ca))[_0xa27b('0x50')](handleError(_0x5c3e4c,null));};exports['show']=function(_0x59e9f9,_0x2c1145){var _0x4f2ddd={'raw':!![],'where':{'id':_0x59e9f9[_0xa27b('0x51')]['id']}},_0x5ff88f={};_0x5ff88f[_0xa27b('0x3c')]=_[_0xa27b('0x52')](db['MailQueue']['rawAttributes']);_0x5ff88f[_0xa27b('0x3d')]=_['keys'](_0x59e9f9[_0xa27b('0x3d')]);_0x5ff88f[_0xa27b('0x3e')]=_[_0xa27b('0x3f')](_0x5ff88f[_0xa27b('0x3c')],_0x5ff88f['query']);_0x4f2ddd[_0xa27b('0x40')]=_[_0xa27b('0x3f')](_0x5ff88f[_0xa27b('0x3c')],qs[_0xa27b('0x41')](_0x59e9f9['query'][_0xa27b('0x41')]));_0x4f2ddd[_0xa27b('0x40')]=_0x4f2ddd[_0xa27b('0x40')][_0xa27b('0x42')]?_0x4f2ddd[_0xa27b('0x40')]:_0x5ff88f['model'];if(_0x59e9f9[_0xa27b('0x3d')][_0xa27b('0x53')]){_0x4f2ddd['include']=[{'all':!![]}];}_0x4f2ddd=_[_0xa27b('0x4b')]({},_0x4f2ddd,_0x59e9f9['options']);return db[_0xa27b('0x4d')][_0xa27b('0x54')](_0x4f2ddd)[_0xa27b('0x31')](handleEntityNotFound(_0x2c1145,null))[_0xa27b('0x31')](respondWithResult(_0x2c1145,null))[_0xa27b('0x50')](handleError(_0x2c1145,null));};exports[_0xa27b('0x55')]=function(_0x55fc63,_0x387fac){return db[_0xa27b('0x4d')][_0xa27b('0x55')](_0x55fc63['body'],{})[_0xa27b('0x31')](function(_0x410cc5){var _0x41437e=_0x55fc63['user']['get']({'plain':!![]});if(!_0x41437e)throw new Error(_0xa27b('0x56'));if(_0x41437e[_0xa27b('0x57')]===_0xa27b('0x58')){var _0x141cb6=_0x410cc5[_0xa27b('0x33')]({'plain':!![]});var _0x518278=_0xa27b('0x34');return db[_0xa27b('0x59')][_0xa27b('0x54')]({'where':{'name':_0x518278,'userProfileId':_0x41437e['userProfileId']},'raw':!![]})[_0xa27b('0x31')](function(_0x115441){if(_0x115441&&_0x115441[_0xa27b('0x5a')]===0x0){return db[_0xa27b('0x35')][_0xa27b('0x55')]({'name':_0x141cb6[_0xa27b('0x36')],'resourceId':_0x141cb6['id'],'type':_0x115441[_0xa27b('0x36')],'sectionId':_0x115441['id']},{})[_0xa27b('0x31')](function(){return _0x410cc5;});}else{return _0x410cc5;}})[_0xa27b('0x50')](function(_0x1f693c){logger[_0xa27b('0x5b')](_0xa27b('0x5c'),_0x1f693c);throw _0x1f693c;});}return _0x410cc5;})[_0xa27b('0x31')](respondWithResult(_0x387fac,0xc9))[_0xa27b('0x50')](handleError(_0x387fac,null));};exports[_0xa27b('0x30')]=function(_0x20b632,_0x3e6bba){if(_0x20b632[_0xa27b('0x5d')]['id']){delete _0x20b632[_0xa27b('0x5d')]['id'];}return db[_0xa27b('0x4d')][_0xa27b('0x54')]({'where':{'id':_0x20b632[_0xa27b('0x51')]['id']}})['then'](handleEntityNotFound(_0x3e6bba,null))['then'](saveUpdates(_0x20b632[_0xa27b('0x5d')],null))[_0xa27b('0x31')](respondWithResult(_0x3e6bba,null))[_0xa27b('0x50')](handleError(_0x3e6bba,null));};exports['destroy']=function(_0x1e2b21,_0x175ddd){return db['MailQueue'][_0xa27b('0x54')]({'where':{'id':_0x1e2b21[_0xa27b('0x51')]['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x175ddd,null))['then'](removeEntity(_0x175ddd,null))[_0xa27b('0x50')](handleError(_0x175ddd,null));};exports['describe']=function(_0x8ed5c9,_0x304960){return db['MailQueue'][_0xa27b('0x5e')]()[_0xa27b('0x31')](respondWithResult(_0x304960,null))['catch'](handleError(_0x304960,null));};exports[_0xa27b('0x5f')]=function(_0x4c24ff,_0x4e7ffc,_0x4b1915){var _0x24904f={'raw':!![],'where':{}},_0x509190={},_0x3e95b5;return db['MailQueue'][_0xa27b('0x60')]({'where':{'id':_0x4c24ff[_0xa27b('0x51')]['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x4e7ffc,null))[_0xa27b('0x31')](function(_0x20f5d7){if(_0x20f5d7){_0x3e95b5=_0x20f5d7[_0xa27b('0x33')]({'plain':!![]});_0x509190['model']=_[_0xa27b('0x52')](db['UserMailQueue']['rawAttributes']);_0x509190[_0xa27b('0x3d')]=_['keys'](_0x4c24ff[_0xa27b('0x3d')]);_0x509190['filters']=_[_0xa27b('0x3f')](_0x509190[_0xa27b('0x3c')],_0x509190[_0xa27b('0x3d')]);_0x24904f[_0xa27b('0x40')]=_[_0xa27b('0x3f')](_0x509190['model'],qs['fields'](_0x4c24ff[_0xa27b('0x3d')]['fields']));_0x24904f[_0xa27b('0x40')]=_0x24904f[_0xa27b('0x40')]['length']?_0x24904f[_0xa27b('0x40')]:_0x509190[_0xa27b('0x3c')];if(!_0x4c24ff[_0xa27b('0x3d')]['hasOwnProperty']('nolimit')){_0x24904f[_0xa27b('0x2b')]=qs['limit'](_0x4c24ff[_0xa27b('0x3d')][_0xa27b('0x2b')]);_0x24904f[_0xa27b('0x29')]=qs[_0xa27b('0x29')](_0x4c24ff[_0xa27b('0x3d')]['offset']);}_0x24904f[_0xa27b('0x45')]=qs['sort'](_0x4c24ff[_0xa27b('0x3d')]['sort']);_0x24904f['where']=qs[_0xa27b('0x3e')](_[_0xa27b('0x61')](_0x4c24ff['query'],_0x509190['filters']));_0x24904f[_0xa27b('0x47')]['MailQueueId']=_0x20f5d7['id'];if(_0x4c24ff[_0xa27b('0x3d')]['filter']){_0x24904f[_0xa27b('0x47')]=_[_0xa27b('0x4b')](_0x24904f[_0xa27b('0x47')],{'$or':_['map'](_0x24904f[_0xa27b('0x40')],function(_0x23a388){var _0x42e459={};_0x42e459[_0x23a388]={'$like':'%'+_0x4c24ff['query'][_0xa27b('0x4a')]+'%'};return _0x42e459;})});}_0x24904f=_['merge']({},_0x24904f,_0x4c24ff[_0xa27b('0x4c')]);return db[_0xa27b('0x62')]['findAll'](_0x24904f);}})[_0xa27b('0x31')](function(_0x29aeb5){if(_0x29aeb5){return db['User'][_0xa27b('0x63')]({'where':{'id':_[_0xa27b('0x38')](_0x29aeb5,'UserId'),'role':_0xa27b('0x64')},'attributes':['id',_0xa27b('0x36'),'mailPause',_0xa27b('0x65'),_0xa27b('0x66')]});}})[_0xa27b('0x31')](function(_0x49d180){if(_0x49d180){return{'count':_0x49d180['count'],'rows':_[_0xa27b('0x38')](_0x49d180[_0xa27b('0x4f')],function(_0x5bfab4){return{'membername':_0x5bfab4['name'],'UserId':_0x5bfab4['id'],'queue_name':_0x3e95b5[_0xa27b('0x36')],'MailQueueId':_0x3e95b5['id'],'interface':util[_0xa27b('0x67')]('%s/%s','SIP',_0x5bfab4['name']),'penalty':0x0,'paused':_0x5bfab4[_0xa27b('0x68')],'createdAt':_0x5bfab4[_0xa27b('0x66')],'updatedAt':_0x5bfab4[_0xa27b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa27b('0x31')](respondWithFilteredResult(_0x4e7ffc,_0x24904f))[_0xa27b('0x50')](handleError(_0x4e7ffc,null));};exports[_0xa27b('0x69')]=function(_0x3ea29a,_0x448af0,_0x583def){var _0x3008b0={};var _0xdebc88={};var _0x69610f;var _0x1d7b60;return db['MailQueue'][_0xa27b('0x60')]({'where':{'id':_0x3ea29a['params']['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x448af0,null))[_0xa27b('0x31')](function(_0x4cba53){if(_0x4cba53){_0x69610f=_0x4cba53;_0xdebc88[_0xa27b('0x3c')]=_[_0xa27b('0x52')](db[_0xa27b('0x6a')][_0xa27b('0x39')]);_0xdebc88[_0xa27b('0x3d')]=_[_0xa27b('0x52')](_0x3ea29a[_0xa27b('0x3d')]);_0xdebc88[_0xa27b('0x3e')]=_['intersection'](_0xdebc88[_0xa27b('0x3c')],_0xdebc88[_0xa27b('0x3d')]);_0x3008b0[_0xa27b('0x40')]=_['intersection'](_0xdebc88[_0xa27b('0x3c')],qs[_0xa27b('0x41')](_0x3ea29a[_0xa27b('0x3d')][_0xa27b('0x41')]));_0x3008b0[_0xa27b('0x40')]=_0x3008b0[_0xa27b('0x40')]['length']?_0x3008b0[_0xa27b('0x40')]:_0xdebc88['model'];_0x3008b0[_0xa27b('0x45')]=qs[_0xa27b('0x46')](_0x3ea29a[_0xa27b('0x3d')]['sort']);_0x3008b0[_0xa27b('0x47')]=qs['filters'](_[_0xa27b('0x61')](_0x3ea29a[_0xa27b('0x3d')],_0xdebc88['filters']));if(_0x3ea29a[_0xa27b('0x3d')][_0xa27b('0x4a')]){_0x3008b0[_0xa27b('0x47')]=_['merge'](_0x3008b0[_0xa27b('0x47')],{'$or':_[_0xa27b('0x38')](_0x3008b0[_0xa27b('0x40')],function(_0x17b4ab){var _0xe1df00={};_0xe1df00[_0x17b4ab]={'$like':'%'+_0x3ea29a[_0xa27b('0x3d')]['filter']+'%'};return _0xe1df00;})});}_0x3008b0=_['merge']({},_0x3008b0,_0x3ea29a['options']);return _0x69610f['getTeams'](_0x3008b0);}})[_0xa27b('0x31')](function(_0x1ccf2a){if(_0x1ccf2a){_0x1d7b60=_0x1ccf2a[_0xa27b('0x42')];if(!_0x3ea29a[_0xa27b('0x3d')][_0xa27b('0x43')](_0xa27b('0x44'))){_0x3008b0[_0xa27b('0x2b')]=qs[_0xa27b('0x2b')](_0x3ea29a[_0xa27b('0x3d')][_0xa27b('0x2b')]);_0x3008b0['offset']=qs[_0xa27b('0x29')](_0x3ea29a[_0xa27b('0x3d')][_0xa27b('0x29')]);}return _0x69610f[_0xa27b('0x69')](_0x3008b0);}})['then'](function(_0x14d7ea){if(_0x14d7ea){return _0x14d7ea?{'count':_0x1d7b60,'rows':_0x14d7ea}:null;}})[_0xa27b('0x31')](respondWithResult(_0x448af0,null))[_0xa27b('0x50')](handleError(_0x448af0,null));};exports[_0xa27b('0x6b')]=function(_0x25bfe1,_0x29328d,_0x22fbe0){var _0x15aa09=_0x25bfe1['body'][_0xa27b('0x6c')];return db[_0xa27b('0x6a')][_0xa27b('0x4e')]({'where':{'id':_0x15aa09},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa27b('0x36'),_0xa27b('0x6d'),_0xa27b('0x6e'),'interface'],'raw':!![]}]})[_0xa27b('0x31')](function(_0x44733b){if(_0x44733b){var _0x204b22=_[_0xa27b('0x6f')](_0x44733b,function(_0x1755c8){var _0x8b04e9=_0x1755c8[_0xa27b('0x33')]({'plain':!![]});return _0x8b04e9[_0xa27b('0x70')];});return db['MailQueue'][_0xa27b('0x54')]({'where':{'id':_0x25bfe1[_0xa27b('0x51')]['id']}})[_0xa27b('0x31')](function(_0x35f8a5){return db[_0xa27b('0x71')]['transaction'](function(_0x3423e3){return _0x35f8a5['addTeams'](_0x15aa09,{'transaction':_0x3423e3})['then'](function(){return BPromise[_0xa27b('0x72')](_0x204b22,function(_0x5beebe){return db[_0xa27b('0x62')][_0xa27b('0x73')]({'where':{'UserId':_0x5beebe['id'],'MailQueueId':_0x25bfe1[_0xa27b('0x51')]['id']},'transaction':_0x3423e3});});})['then'](function(){_0x204b22[_0xa27b('0x74')](function(_0x2329fe){socket[_0xa27b('0x75')](_0xa27b('0x76'),{'UserId':_0x2329fe['id'],'MailQueueId':_0x35f8a5['id']});});});});});}})[_0xa27b('0x31')](respondWithStatusCode(_0x29328d,null))[_0xa27b('0x50')](handleError(_0x29328d,null));};exports[_0xa27b('0x77')]=function(_0x344f64,_0x1133eb,_0x926501){return db[_0xa27b('0x6a')][_0xa27b('0x4e')]({'where':{'id':_0x344f64[_0xa27b('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa27b('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1133eb,null))['then'](function(_0x33413a){var _0x2402e7=_[_0xa27b('0x38')](_0x33413a,'id');var _0x4c8085=[];var _0xb0fc97=[];var _0x53ab65=squel[_0xa27b('0x78')]();_0x53ab65[_0xa27b('0x79')](_0xa27b('0x7a'))[_0xa27b('0x7b')]('team_has_mail_queues','tq')[_0xa27b('0x7c')](_0xa27b('0x7d'),'ut',_0xa27b('0x7e'))[_0xa27b('0x47')](_0xa27b('0x7f'),_0x344f64['params']['id']);for(var _0x338ccb=0x0;_0x338ccb<_0x33413a[_0xa27b('0x42')];_0x338ccb+=0x1){let _0x2ba5c2=_0x33413a[_0x338ccb];for(var _0xc25e7e=0x0;_0xc25e7e<_0x2ba5c2['Agents'][_0xa27b('0x42')];_0xc25e7e+=0x1){let _0x3d12bf=_0x2ba5c2[_0xa27b('0x70')][_0xc25e7e];var _0x2c2565=_0x53ab65[_0xa27b('0x80')]();_0x2c2565['where'](_0xa27b('0x81'),_0x3d12bf['id']);_0xb0fc97[_0xa27b('0x82')](db[_0xa27b('0x71')][_0xa27b('0x3d')](_0x2c2565[_0xa27b('0x83')](),{'type':db[_0xa27b('0x71')][_0xa27b('0x84')][_0xa27b('0x85')]})['then'](function(_0xaba1a6){if(_0xaba1a6[_0xa27b('0x42')]===0x1){return _0x3d12bf['id'];}else{var _0x5ec2e3=_['every'](_[_0xa27b('0x38')](_0xaba1a6,_0xa27b('0x86')),function(_0x5991b1){return _[_0xa27b('0x87')](_0x2402e7,_0x5991b1);});if(_0x5ec2e3){return _0x3d12bf['id'];}}}));}}return BPromise['all'](_0xb0fc97)[_0xa27b('0x31')](function(_0x1e80dd){_0x4c8085=_(_0x4c8085)[_0xa27b('0x88')](_0x1e80dd)[_0xa27b('0x89')]()[_0xa27b('0x8a')]();return db[_0xa27b('0x4d')]['find']({'where':{'id':_0x344f64['params']['id']}})['then'](function(_0x3032c1){return db[_0xa27b('0x71')][_0xa27b('0x8b')](function(_0x268c4f){return _0x3032c1['removeTeams'](_0x344f64[_0xa27b('0x3d')][_0xa27b('0x6c')],{'transaction':_0x268c4f})[_0xa27b('0x31')](function(){if(!_[_0xa27b('0x8c')](_0x4c8085)){return _0x3032c1[_0xa27b('0x8d')](_0x4c8085,{'transaction':_0x268c4f});}})['then'](function(){_0x4c8085[_0xa27b('0x74')](function(_0xcbccf0){socket['emit'](_0xa27b('0x8e'),{'UserId':_0xcbccf0,'MailQueueId':_0x3032c1['id']});});});});});});})[_0xa27b('0x31')](respondWithStatusCode(_0x1133eb,null))['catch'](handleError(_0x1133eb,null));};exports[_0xa27b('0x8f')]=function(_0x40bc6e,_0x536aaf,_0x35eae8){return db[_0xa27b('0x4d')][_0xa27b('0x54')]({'where':{'id':_0x40bc6e[_0xa27b('0x51')]['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x536aaf,null))[_0xa27b('0x31')](function(_0x1bd381){if(_0x1bd381){return _0x1bd381[_0xa27b('0x8f')](_0x40bc6e['body'][_0xa27b('0x6c')],_[_0xa27b('0x90')](_0x40bc6e[_0xa27b('0x5d')],[_0xa27b('0x6c'),'id'])||{})[_0xa27b('0x91')](function(_0x329c00){for(var _0x5de003=0x0;_0x5de003<_0x40bc6e[_0xa27b('0x5d')][_0xa27b('0x6c')][_0xa27b('0x42')];_0x5de003+=0x1){socket[_0xa27b('0x75')](_0xa27b('0x76'),{'UserId':Number(_0x40bc6e[_0xa27b('0x5d')]['ids'][_0x5de003]),'MailQueueId':Number(_0x40bc6e[_0xa27b('0x51')]['id'])});}return _0x329c00;});}})[_0xa27b('0x31')](respondWithResult(_0x536aaf,null))[_0xa27b('0x50')](handleError(_0x536aaf,null));};exports['removeAgents']=function(_0x36566d,_0x42ebc7,_0x7d60dc){return db[_0xa27b('0x4d')][_0xa27b('0x54')]({'where':{'id':_0x36566d['params']['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x42ebc7,null))[_0xa27b('0x31')](function(_0x50c48c){if(_0x50c48c){return _0x50c48c[_0xa27b('0x8d')](_0x36566d[_0xa27b('0x3d')][_0xa27b('0x6c')])['then'](function(){if(_[_0xa27b('0x92')](_0x36566d['query'][_0xa27b('0x6c')])){for(var _0x1d9c62=0x0;_0x1d9c62<_0x36566d['query'][_0xa27b('0x6c')]['length'];_0x1d9c62+=0x1){socket[_0xa27b('0x75')](_0xa27b('0x8e'),{'UserId':Number(_0x36566d[_0xa27b('0x3d')][_0xa27b('0x6c')][_0x1d9c62]),'MailQueueId':Number(_0x36566d[_0xa27b('0x51')]['id'])});}}else{socket[_0xa27b('0x75')](_0xa27b('0x8e'),{'UserId':Number(_0x36566d['query'][_0xa27b('0x6c')]),'MailQueueId':Number(_0x36566d[_0xa27b('0x51')]['id'])});}});}})[_0xa27b('0x31')](respondWithStatusCode(_0x42ebc7,null))['catch'](handleError(_0x42ebc7,null));};exports[_0xa27b('0x93')]=function(_0x3907fe,_0x549b17,_0x503da0){var _0x1fab5a={};var _0x5663bb={};var _0x34078b;var _0x2f55d4;return db[_0xa27b('0x4d')][_0xa27b('0x60')]({'where':{'id':_0x3907fe[_0xa27b('0x51')]['id']}})[_0xa27b('0x31')](handleEntityNotFound(_0x549b17,null))[_0xa27b('0x31')](function(_0x579991){if(_0x579991){_0x34078b=_0x579991;_0x5663bb['model']=_[_0xa27b('0x52')](db[_0xa27b('0x94')][_0xa27b('0x39')]);_0x5663bb['query']=_[_0xa27b('0x52')](_0x3907fe['query']);_0x5663bb[_0xa27b('0x3e')]=_[_0xa27b('0x3f')](_0x5663bb['model'],_0x5663bb[_0xa27b('0x3d')]);_0x1fab5a[_0xa27b('0x40')]=_[_0xa27b('0x3f')](_0x5663bb[_0xa27b('0x3c')],qs[_0xa27b('0x41')](_0x3907fe['query'][_0xa27b('0x41')]));_0x1fab5a['attributes']=_0x1fab5a[_0xa27b('0x40')][_0xa27b('0x42')]?_0x1fab5a[_0xa27b('0x40')]:_0x5663bb[_0xa27b('0x3c')];_0x1fab5a[_0xa27b('0x45')]=qs[_0xa27b('0x46')](_0x3907fe['query'][_0xa27b('0x46')]);_0x1fab5a[_0xa27b('0x47')]=qs['filters'](_[_0xa27b('0x61')](_0x3907fe[_0xa27b('0x3d')],_0x5663bb[_0xa27b('0x3e')]));if(_0x3907fe[_0xa27b('0x3d')]['filter']){_0x1fab5a['where']=_[_0xa27b('0x4b')](_0x1fab5a[_0xa27b('0x47')],{'$or':_['map'](_0x1fab5a['attributes'],function(_0x2d957a){var _0x5b2d85={};_0x5b2d85[_0x2d957a]={'$like':'%'+_0x3907fe['query'][_0xa27b('0x4a')]+'%'};return _0x5b2d85;})});}_0x1fab5a=_[_0xa27b('0x4b')]({},_0x1fab5a,_0x3907fe[_0xa27b('0x4c')]);return _0x34078b[_0xa27b('0x93')](_0x1fab5a);}})[_0xa27b('0x31')](function(_0x2b1c22){if(_0x2b1c22){_0x2f55d4=_0x2b1c22[_0xa27b('0x42')];if(!_0x3907fe[_0xa27b('0x3d')][_0xa27b('0x43')](_0xa27b('0x44'))){_0x1fab5a[_0xa27b('0x2b')]=qs[_0xa27b('0x2b')](_0x3907fe[_0xa27b('0x3d')][_0xa27b('0x2b')]);_0x1fab5a[_0xa27b('0x29')]=qs[_0xa27b('0x29')](_0x3907fe[_0xa27b('0x3d')][_0xa27b('0x29')]);}return _0x34078b[_0xa27b('0x93')](_0x1fab5a);}})['then'](function(_0x54d9f9){if(_0x54d9f9){return _0x54d9f9?{'count':_0x2f55d4,'rows':_0x54d9f9}:null;}})[_0xa27b('0x31')](respondWithResult(_0x549b17,null))[_0xa27b('0x50')](handleError(_0x549b17,null));};
\ No newline at end of file
index 642dd4e..b47cac5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c06=['emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x54d4c9,_0x359152){var _0x383b16=function(_0x2bcc7d){while(--_0x2bcc7d){_0x54d4c9['push'](_0x54d4c9['shift']());}};_0x383b16(++_0x359152);}(_0x2c06,0x111));var _0x62c0=function(_0x350a25,_0x4d36e0){_0x350a25=_0x350a25-0x0;var _0xdae393=_0x2c06[_0x350a25];return _0xdae393;};'use strict';var EventEmitter=require(_0x62c0('0x0'));var MailQueue=require(_0x62c0('0x1'))['db'][_0x62c0('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x62c0('0x3')](0x0);var events={'afterCreate':_0x62c0('0x4'),'afterUpdate':_0x62c0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4b1c76){return function(_0x8a1608,_0x16ea82,_0x331d9d){MailQueueEvents[_0x62c0('0x6')](_0x4b1c76+':'+_0x8a1608['id'],_0x8a1608);MailQueueEvents[_0x62c0('0x6')](_0x4b1c76,_0x8a1608);_0x331d9d(null);};}for(var e in events){if(events[_0x62c0('0x7')](e)){var event=events[e];MailQueue[_0x62c0('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x819a=['MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xc5da07,_0x4cd1ce){var _0x1afaf4=function(_0x19cf5f){while(--_0x19cf5f){_0xc5da07['push'](_0xc5da07['shift']());}};_0x1afaf4(++_0x4cd1ce);}(_0x819a,0xbd));var _0xa819=function(_0x38323b,_0x5f79df){_0x38323b=_0x38323b-0x0;var _0x2b9af5=_0x819a[_0x38323b];return _0x2b9af5;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xa819('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa819('0x1')](0x0);var events={'afterCreate':_0xa819('0x2'),'afterUpdate':_0xa819('0x3'),'afterDestroy':_0xa819('0x4')};function emitEvent(_0x34ac1f){return function(_0x4f15cb,_0x18e38a,_0x5be599){MailQueueEvents[_0xa819('0x5')](_0x34ac1f+':'+_0x4f15cb['id'],_0x4f15cb);MailQueueEvents['emit'](_0x34ac1f,_0x4f15cb);_0x5be599(null);};}for(var e in events){if(events[_0xa819('0x6')](e)){var event=events[e];MailQueue[_0xa819('0x7')](e,emitEvent(event));}}module[_0xa819('0x8')]=MailQueueEvents;
\ No newline at end of file
index 639c5d9..c11cc37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcef=['lodash','util','../../config/logger','bluebird','request-promise','exports','define','MailQueue','mail_queues'];(function(_0x291d3f,_0x3ef99f){var _0x242080=function(_0x257705){while(--_0x257705){_0x291d3f['push'](_0x291d3f['shift']());}};_0x242080(++_0x3ef99f);}(_0xfcef,0xf3));var _0xffce=function(_0x4a507c,_0x243283){_0x4a507c=_0x4a507c-0x0;var _0xd678ce=_0xfcef[_0x4a507c];return _0xd678ce;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var logger=require(_0xffce('0x2'))('api');var moment=require('moment');var BPromise=require(_0xffce('0x3'));var rp=require(_0xffce('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xffce('0x5')]=function(_0x42f7e9,_0x3f9a82){return _0x42f7e9[_0xffce('0x6')](_0xffce('0x7'),attributes,{'tableName':_0xffce('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb025=['util','api','moment','bluebird','path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x43fa0f,_0x36a035){var _0x5716c8=function(_0x4d82a0){while(--_0x4d82a0){_0x43fa0f['push'](_0x43fa0f['shift']());}};_0x5716c8(++_0x36a035);}(_0xb025,0xfb));var _0x5b02=function(_0x591794,_0x1942e3){_0x591794=_0x591794-0x0;var _0x15713e=_0xb025[_0x591794];return _0x15713e;};'use strict';var _=require(_0x5b02('0x0'));var util=require(_0x5b02('0x1'));var logger=require('../../config/logger')(_0x5b02('0x2'));var moment=require(_0x5b02('0x3'));var BPromise=require(_0x5b02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b02('0x5'));var rimraf=require('rimraf');var config=require(_0x5b02('0x6'));var attributes=require(_0x5b02('0x7'));module[_0x5b02('0x8')]=function(_0x46169f,_0x2f619a){return _0x46169f[_0x5b02('0x9')](_0x5b02('0xa'),attributes,{'tableName':_0x5b02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6b674f..eff23df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0d=['client','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9e0d,0x9b));var _0xd9e0=function(_0x2b5479,_0x314d74){_0x2b5479=_0x2b5479-0x0;var _0x5382a9=_0x9e0d[_0x2b5479];return _0x5382a9;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require(_0xd9e0('0x3'));var rs=require(_0xd9e0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd9e0('0x5'));var logger=require(_0xd9e0('0x6'))(_0xd9e0('0x7'));var config=require(_0xd9e0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9e0('0x9')][_0xd9e0('0xa')]({'port':0x232a});config[_0xd9e0('0xb')]=_[_0xd9e0('0xc')](config[_0xd9e0('0xb')],{'host':_0xd9e0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd9e0('0xb')]));require(_0xd9e0('0xe'))[_0xd9e0('0xf')](socket);function respondWithRpcPromise(_0x52e142,_0x59fc82,_0x2dd5f7){return new BPromise(function(_0x5341fc,_0x3c2dff){return client[_0xd9e0('0x10')](_0x52e142,_0x2dd5f7)[_0xd9e0('0x11')](function(_0x1a1f68){logger[_0xd9e0('0x12')](_0xd9e0('0x13'),_0x59fc82,_0xd9e0('0x14'));logger['debug'](_0xd9e0('0x15'),_0x59fc82,_0xd9e0('0x14'),JSON[_0xd9e0('0x16')](_0x1a1f68));if(_0x1a1f68[_0xd9e0('0x17')]){if(_0x1a1f68['error'][_0xd9e0('0x18')]===0x1f4){logger[_0xd9e0('0x17')](_0xd9e0('0x13'),_0x59fc82,_0x1a1f68['error'][_0xd9e0('0x19')]);return _0x3c2dff(_0x1a1f68[_0xd9e0('0x17')][_0xd9e0('0x19')]);}logger[_0xd9e0('0x17')](_0xd9e0('0x13'),_0x59fc82,_0x1a1f68['error'][_0xd9e0('0x19')]);return _0x5341fc(_0x1a1f68[_0xd9e0('0x17')][_0xd9e0('0x19')]);}else{logger['info'](_0xd9e0('0x13'),_0x59fc82,_0xd9e0('0x14'));_0x5341fc(_0x1a1f68[_0xd9e0('0x1a')]['message']);}})[_0xd9e0('0x1b')](function(_0x1cff33){logger[_0xd9e0('0x17')]('MailQueue,\x20%s,\x20%s',_0x59fc82,_0x1cff33);_0x3c2dff(_0x1cff33);});});}exports[_0xd9e0('0x1c')]=function(_0x25bd77){var _0x1a66e0=this;return new Promise(function(_0x53ff39,_0x3748f8){return db['MailQueue'][_0xd9e0('0x1d')]({'raw':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77['options'][_0xd9e0('0x20')]||null:null,'attributes':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x21')]||null:null,'limit':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x22')]||null:null,'include':_0x25bd77[_0xd9e0('0x1e')]?_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x25bd77[_0xd9e0('0x1e')][_0xd9e0('0x23')],function(_0x142f2b){return{'model':db[_0x142f2b[_0xd9e0('0x25')]],'as':_0x142f2b['as'],'attributes':_0x142f2b[_0xd9e0('0x21')],'include':_0x142f2b[_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x142f2b['include'],function(_0x2930e9){return{'model':db[_0x2930e9['model']],'as':_0x2930e9['as'],'attributes':_0x2930e9[_0xd9e0('0x21')],'include':_0x2930e9[_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x2930e9[_0xd9e0('0x23')],function(_0x5ec31d){return{'model':db[_0x5ec31d[_0xd9e0('0x25')]],'as':_0x5ec31d['as'],'attributes':_0x5ec31d['attributes']};}):[]};}):[]};}):[]:[]})[_0xd9e0('0x11')](function(_0x2152de){logger[_0xd9e0('0x12')](_0xd9e0('0x1c'),_0x25bd77);logger[_0xd9e0('0x26')](_0xd9e0('0x1c'),_0x25bd77,JSON[_0xd9e0('0x16')](_0x2152de));_0x53ff39(_0x2152de);})[_0xd9e0('0x1b')](function(_0x3481df){logger[_0xd9e0('0x17')]('GetMailQueue',_0x3481df[_0xd9e0('0x19')],_0x25bd77);_0x3748f8(_0x1a66e0['error'](0x1f4,_0x3481df[_0xd9e0('0x19')]));});});};exports[_0xd9e0('0x27')]=function(_0x302ea2){var _0x2dd01e=this;return new Promise(function(_0x532ee5,_0x5291af){return db['MailQueue'][_0xd9e0('0x28')]({'raw':_0x302ea2['options']?_0x302ea2['options'][_0xd9e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')]['where']||null:null,'attributes':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x21')]||null:null,'include':_0x302ea2[_0xd9e0('0x1e')]?_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x23')]?_[_0xd9e0('0x24')](_0x302ea2[_0xd9e0('0x1e')][_0xd9e0('0x23')],function(_0x1f631f){return{'model':db[_0x1f631f[_0xd9e0('0x25')]],'as':_0x1f631f['as'],'attributes':_0x1f631f[_0xd9e0('0x21')],'include':_0x1f631f['include']?_[_0xd9e0('0x24')](_0x1f631f[_0xd9e0('0x23')],function(_0x530695){return{'model':db[_0x530695['model']],'as':_0x530695['as'],'attributes':_0x530695[_0xd9e0('0x21')],'include':_0x530695['include']?_[_0xd9e0('0x24')](_0x530695[_0xd9e0('0x23')],function(_0x425d15){return{'model':db[_0x425d15['model']],'as':_0x425d15['as'],'attributes':_0x425d15[_0xd9e0('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a9721){logger['info'](_0xd9e0('0x27'),_0x302ea2);logger[_0xd9e0('0x26')](_0xd9e0('0x27'),_0x302ea2,JSON[_0xd9e0('0x16')](_0x1a9721));_0x532ee5(_0x1a9721);})[_0xd9e0('0x1b')](function(_0x3ffbf6){logger[_0xd9e0('0x17')](_0xd9e0('0x27'),_0x3ffbf6['message'],_0x302ea2);_0x5291af(_0x2dd01e[_0xd9e0('0x17')](0x1f4,_0x3ffbf6['message']));});});};
\ No newline at end of file
+var _0xb3cd=['message','result','GetMailQueue','options','attributes','limit','include','map','model','ShowMailQueue','MailQueue','raw','where','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x286b9b,_0x1b806f){var _0x343262=function(_0x4ade46){while(--_0x4ade46){_0x286b9b['push'](_0x286b9b['shift']());}};_0x343262(++_0x1b806f);}(_0xb3cd,0xae));var _0xdb3c=function(_0x3ed091,_0x3491d4){_0x3ed091=_0x3ed091-0x0;var _0x49f07c=_0xb3cd[_0x3ed091];return _0x49f07c;};'use strict';var _=require('lodash');var util=require(_0xdb3c('0x0'));var moment=require(_0xdb3c('0x1'));var BPromise=require(_0xdb3c('0x2'));var rs=require(_0xdb3c('0x3'));var fs=require('fs');var Redis=require(_0xdb3c('0x4'));var db=require(_0xdb3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb3c('0x6'))(_0xdb3c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdb3c('0x8')][_0xdb3c('0x9')]({'port':0x232a});config[_0xdb3c('0xa')]=_[_0xdb3c('0xb')](config['redis'],{'host':_0xdb3c('0xc'),'port':0x18eb});var socket=require(_0xdb3c('0xd'))(new Redis(config[_0xdb3c('0xa')]));require(_0xdb3c('0xe'))[_0xdb3c('0xf')](socket);function respondWithRpcPromise(_0x42c644,_0x133f03,_0x3da93c){return new BPromise(function(_0xf57a98,_0x44f24c){return client[_0xdb3c('0x10')](_0x42c644,_0x3da93c)[_0xdb3c('0x11')](function(_0x234055){logger[_0xdb3c('0x12')](_0xdb3c('0x13'),_0x133f03,_0xdb3c('0x14'));logger[_0xdb3c('0x15')](_0xdb3c('0x16'),_0x133f03,_0xdb3c('0x14'),JSON[_0xdb3c('0x17')](_0x234055));if(_0x234055[_0xdb3c('0x18')]){if(_0x234055['error'][_0xdb3c('0x19')]===0x1f4){logger[_0xdb3c('0x18')]('MailQueue,\x20%s,\x20%s',_0x133f03,_0x234055[_0xdb3c('0x18')][_0xdb3c('0x1a')]);return _0x44f24c(_0x234055[_0xdb3c('0x18')]['message']);}logger[_0xdb3c('0x18')](_0xdb3c('0x13'),_0x133f03,_0x234055[_0xdb3c('0x18')][_0xdb3c('0x1a')]);return _0xf57a98(_0x234055[_0xdb3c('0x18')][_0xdb3c('0x1a')]);}else{logger[_0xdb3c('0x12')](_0xdb3c('0x13'),_0x133f03,'request\x20sent');_0xf57a98(_0x234055[_0xdb3c('0x1b')][_0xdb3c('0x1a')]);}})['catch'](function(_0x3dd503){logger[_0xdb3c('0x18')](_0xdb3c('0x13'),_0x133f03,_0x3dd503);_0x44f24c(_0x3dd503);});});}exports[_0xdb3c('0x1c')]=function(_0x2987f4){var _0x51dfee=this;return new Promise(function(_0x4eb41a,_0x4b1aed){return db['MailQueue']['findAll']({'raw':_0x2987f4['options']?_0x2987f4[_0xdb3c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2987f4[_0xdb3c('0x1d')]?_0x2987f4[_0xdb3c('0x1d')]['where']||null:null,'attributes':_0x2987f4[_0xdb3c('0x1d')]?_0x2987f4[_0xdb3c('0x1d')][_0xdb3c('0x1e')]||null:null,'limit':_0x2987f4[_0xdb3c('0x1d')]?_0x2987f4[_0xdb3c('0x1d')][_0xdb3c('0x1f')]||null:null,'include':_0x2987f4[_0xdb3c('0x1d')]?_0x2987f4[_0xdb3c('0x1d')][_0xdb3c('0x20')]?_[_0xdb3c('0x21')](_0x2987f4['options']['include'],function(_0x4c728e){return{'model':db[_0x4c728e[_0xdb3c('0x22')]],'as':_0x4c728e['as'],'attributes':_0x4c728e['attributes'],'include':_0x4c728e[_0xdb3c('0x20')]?_[_0xdb3c('0x21')](_0x4c728e[_0xdb3c('0x20')],function(_0x207a07){return{'model':db[_0x207a07[_0xdb3c('0x22')]],'as':_0x207a07['as'],'attributes':_0x207a07[_0xdb3c('0x1e')],'include':_0x207a07['include']?_[_0xdb3c('0x21')](_0x207a07[_0xdb3c('0x20')],function(_0x5d539d){return{'model':db[_0x5d539d['model']],'as':_0x5d539d['as'],'attributes':_0x5d539d['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb3c('0x11')](function(_0x469ce6){logger['info'](_0xdb3c('0x1c'),_0x2987f4);logger[_0xdb3c('0x15')](_0xdb3c('0x1c'),_0x2987f4,JSON[_0xdb3c('0x17')](_0x469ce6));_0x4eb41a(_0x469ce6);})['catch'](function(_0x3c8fed){logger['error'](_0xdb3c('0x1c'),_0x3c8fed[_0xdb3c('0x1a')],_0x2987f4);_0x4b1aed(_0x51dfee[_0xdb3c('0x18')](0x1f4,_0x3c8fed['message']));});});};exports[_0xdb3c('0x23')]=function(_0x396e54){var _0x4c85b9=this;return new Promise(function(_0x1aea6f,_0x5e83bc){return db[_0xdb3c('0x24')]['find']({'raw':_0x396e54['options']?_0x396e54['options'][_0xdb3c('0x25')]===undefined?!![]:![]:!![],'where':_0x396e54[_0xdb3c('0x1d')]?_0x396e54[_0xdb3c('0x1d')][_0xdb3c('0x26')]||null:null,'attributes':_0x396e54[_0xdb3c('0x1d')]?_0x396e54[_0xdb3c('0x1d')][_0xdb3c('0x1e')]||null:null,'include':_0x396e54[_0xdb3c('0x1d')]?_0x396e54[_0xdb3c('0x1d')]['include']?_[_0xdb3c('0x21')](_0x396e54[_0xdb3c('0x1d')][_0xdb3c('0x20')],function(_0xa78eaf){return{'model':db[_0xa78eaf[_0xdb3c('0x22')]],'as':_0xa78eaf['as'],'attributes':_0xa78eaf[_0xdb3c('0x1e')],'include':_0xa78eaf[_0xdb3c('0x20')]?_[_0xdb3c('0x21')](_0xa78eaf[_0xdb3c('0x20')],function(_0x475ea2){return{'model':db[_0x475ea2[_0xdb3c('0x22')]],'as':_0x475ea2['as'],'attributes':_0x475ea2[_0xdb3c('0x1e')],'include':_0x475ea2[_0xdb3c('0x20')]?_[_0xdb3c('0x21')](_0x475ea2[_0xdb3c('0x20')],function(_0x13d03a){return{'model':db[_0x13d03a['model']],'as':_0x13d03a['as'],'attributes':_0x13d03a[_0xdb3c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdb3c('0x11')](function(_0x274f19){logger[_0xdb3c('0x12')]('ShowMailQueue',_0x396e54);logger['debug']('ShowMailQueue',_0x396e54,JSON[_0xdb3c('0x17')](_0x274f19));_0x1aea6f(_0x274f19);})[_0xdb3c('0x27')](function(_0x3ab1ee){logger[_0xdb3c('0x18')](_0xdb3c('0x23'),_0x3ab1ee[_0xdb3c('0x1a')],_0x396e54);_0x5e83bc(_0x4c85b9[_0xdb3c('0x18')](0x1f4,_0x3ab1ee[_0xdb3c('0x1a')]));});});};
\ No newline at end of file
index 004dfbd..876d793 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f58=['emit','removeListener','register','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x571fff,_0x335410){var _0x399acb=function(_0x324737){while(--_0x324737){_0x571fff['push'](_0x571fff['shift']());}};_0x399acb(++_0x335410);}(_0x0f58,0x164));var _0x80f5=function(_0x5a07a2,_0x32f99c){_0x5a07a2=_0x5a07a2-0x0;var _0x2238fe=_0x0f58[_0x5a07a2];return _0x2238fe;};'use strict';var MailQueueEvents=require(_0x80f5('0x0'));var events=[_0x80f5('0x1'),_0x80f5('0x2'),_0x80f5('0x3')];function createListener(_0xfce845,_0x5b64d7){return function(_0xabad8b){_0x5b64d7[_0x80f5('0x4')](_0xfce845,_0xabad8b);};}function removeListener(_0x14bc8c,_0x54a59c){return function(){MailQueueEvents[_0x80f5('0x5')](_0x14bc8c,_0x54a59c);};}exports[_0x80f5('0x6')]=function(_0x105437){for(var _0x418af5=0x0,_0x2bec6d=events['length'];_0x418af5<_0x2bec6d;_0x418af5++){var _0x1e981f=events[_0x418af5];var _0x5b232a=createListener(_0x80f5('0x7')+_0x1e981f,_0x105437);MailQueueEvents['on'](_0x1e981f,_0x5b232a);}};
\ No newline at end of file
+var _0x1202=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x16cadd,_0x468c99){var _0x2477ab=function(_0x820af7){while(--_0x820af7){_0x16cadd['push'](_0x16cadd['shift']());}};_0x2477ab(++_0x468c99);}(_0x1202,0x11c));var _0x2120=function(_0x4e9ec3,_0xab9d7e){_0x4e9ec3=_0x4e9ec3-0x0;var _0x1d813b=_0x1202[_0x4e9ec3];return _0x1d813b;};'use strict';var MailQueueEvents=require(_0x2120('0x0'));var events=[_0x2120('0x1'),_0x2120('0x2'),_0x2120('0x3')];function createListener(_0x2b5f39,_0x1a8138){return function(_0x161989){_0x1a8138[_0x2120('0x4')](_0x2b5f39,_0x161989);};}function removeListener(_0x19d3ef,_0x2d7d21){return function(){MailQueueEvents[_0x2120('0x5')](_0x19d3ef,_0x2d7d21);};}exports[_0x2120('0x6')]=function(_0x375e59){for(var _0x21fb51=0x0,_0x1dced7=events[_0x2120('0x7')];_0x21fb51<_0x1dced7;_0x21fb51++){var _0x33d472=events[_0x21fb51];var _0xc1aed=createListener(_0x2120('0x8')+_0x33d472,_0x375e59);MailQueueEvents['on'](_0x33d472,_0xc1aed);}};
\ No newline at end of file
index 2658496..2aba0cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8fc=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer','util'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0xa8fc,0x1b6));var _0xca8f=function(_0x53a325,_0x53bb14){_0x53a325=_0x53a325-0x0;var _0x4b5fdc=_0xa8fc[_0x53a325];return _0x4b5fdc;};'use strict';var multer=require(_0xca8f('0x0'));var util=require(_0xca8f('0x1'));var path=require('path');var timeout=require(_0xca8f('0x2'));var express=require(_0xca8f('0x3'));var router=express['Router']();var fs_extra=require(_0xca8f('0x4'));var auth=require(_0xca8f('0x5'));var interaction=require(_0xca8f('0x6'));var config=require('../../config/environment');var controller=require(_0xca8f('0x7'));router['get']('/',auth[_0xca8f('0x8')](),controller[_0xca8f('0x9')]);router[_0xca8f('0xa')](_0xca8f('0xb'),auth[_0xca8f('0x8')](),controller[_0xca8f('0xc')]);router[_0xca8f('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xca8f('0xd')]('/',auth[_0xca8f('0x8')](),controller[_0xca8f('0xe')]);router['put'](_0xca8f('0xf'),auth['isAuthenticated'](),controller[_0xca8f('0x10')]);router[_0xca8f('0x11')]('/:id',auth[_0xca8f('0x8')](),controller[_0xca8f('0x12')]);module[_0xca8f('0x13')]=router;
\ No newline at end of file
+var _0x32a3=['fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/:id','isAuthenticated','post','create','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x32a3,0x1a5));var _0x332a=function(_0x2f5468,_0x31aa94){_0x2f5468=_0x2f5468-0x0;var _0x597236=_0x32a3[_0x2f5468];return _0x597236;};'use strict';var multer=require('multer');var util=require(_0x332a('0x0'));var path=require('path');var timeout=require(_0x332a('0x1'));var express=require(_0x332a('0x2'));var router=express[_0x332a('0x3')]();var fs_extra=require(_0x332a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x332a('0x5'));var config=require(_0x332a('0x6'));var controller=require(_0x332a('0x7'));router[_0x332a('0x8')]('/',auth['isAuthenticated'](),controller[_0x332a('0x9')]);router[_0x332a('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x332a('0x8')](_0x332a('0xa'),auth[_0x332a('0xb')](),controller['show']);router[_0x332a('0xc')]('/',auth['isAuthenticated'](),controller[_0x332a('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x332a('0xe')]);router[_0x332a('0xf')](_0x332a('0xa'),auth[_0x332a('0xb')](),controller['destroy']);module[_0x332a('0x10')]=router;
\ No newline at end of file
index 4231996..b878ffa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x444a=['DATE','STRING','moment','exports'];(function(_0x18fe9a,_0x18b3a6){var _0x4b5bfc=function(_0xb22428){while(--_0xb22428){_0x18fe9a['push'](_0x18fe9a['shift']());}};_0x4b5bfc(++_0x18b3a6);}(_0x444a,0xa2));var _0xa444=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0x444a[_0x529296];return _0x1796bf;};'use strict';var moment=require(_0xa444('0x0'));var Sequelize=require('sequelize');module[_0xa444('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa444('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa444('0x3')]}};
\ No newline at end of file
+var _0xf1ad=['DATE','moment','STRING'];(function(_0x38eb67,_0x48661f){var _0x4e477e=function(_0x15f0e5){while(--_0x15f0e5){_0x38eb67['push'](_0x38eb67['shift']());}};_0x4e477e(++_0x48661f);}(_0xf1ad,0xe2));var _0xdf1a=function(_0x570803,_0x4374fd){_0x570803=_0x570803-0x0;var _0x458832=_0xf1ad[_0x570803];return _0x458832;};'use strict';var moment=require(_0xdf1a('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xdf1a('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xdf1a('0x1')]},'joinAt':{'type':Sequelize[_0xdf1a('0x2')]},'leaveAt':{'type':Sequelize[_0xdf1a('0x2')]},'acceptAt':{'type':Sequelize[_0xdf1a('0x2')]},'exitAt':{'type':Sequelize[_0xdf1a('0x2')]},'reason':{'type':Sequelize[_0xdf1a('0x1')]}};
\ No newline at end of file
index 42ac292..eeaf786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','MailQueueReport','fieldName','type','key','model','query','keys'];(function(_0x5e87a3,_0x58c1d1){var _0x69c6ab=function(_0x287844){while(--_0x287844){_0x5e87a3['push'](_0x5e87a3['shift']());}};_0x69c6ab(++_0x58c1d1);}(_0xadb5,0xad));var _0x5adb=function(_0x4f9217,_0x1523d6){_0x4f9217=_0x4f9217-0x0;var _0x46f014=_0xadb5[_0x4f9217];return _0x46f014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['MailQueueReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['MailQueueReport'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};exports['describe']=function(_0x36b847,_0x3a5703){return db[_0x5adb('0x2a')][_0x5adb('0x49')]()['then'](respondWithResult(_0x3a5703,null))[_0x5adb('0x42')](handleError(_0x3a5703,null));};
\ No newline at end of file
+var _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3b5ad9,_0x223867){var _0x611ae9=function(_0x1c5e28){while(--_0x1c5e28){_0x3b5ad9['push'](_0x3b5ad9['shift']());}};_0x611ae9(++_0x223867);}(_0xba34,0x119));var _0x4ba3=function(_0x181c61,_0x7a17f0){_0x181c61=_0x181c61-0x0;var _0x1618d6=_0xba34[_0x181c61];return _0x1618d6;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['MailQueueReport']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));};
\ No newline at end of file
index d18bb72..657059b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ec=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','api','moment'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0x90ec,0x159));var _0xc90e=function(_0x2438be,_0x111462){_0x2438be=_0x2438be-0x0;var _0x3f22ba=_0x90ec[_0x2438be];return _0x3f22ba;};'use strict';var _=require(_0xc90e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc90e('0x1'));var moment=require(_0xc90e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc90e('0x3'));var rimraf=require(_0xc90e('0x4'));var config=require(_0xc90e('0x5'));var attributes=require(_0xc90e('0x6'));module[_0xc90e('0x7')]=function(_0x17a201,_0x35301a){return _0x17a201[_0xc90e('0x8')](_0xc90e('0x9'),attributes,{'tableName':_0xc90e('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc90e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x282a=['moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api'];(function(_0x39d9ec,_0x4ed6e5){var _0x499ff0=function(_0x565eaf){while(--_0x565eaf){_0x39d9ec['push'](_0x39d9ec['shift']());}};_0x499ff0(++_0x4ed6e5);}(_0x282a,0xf9));var _0xa282=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x282a[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xa282('0x0'));var util=require(_0xa282('0x1'));var logger=require('../../config/logger')(_0xa282('0x2'));var moment=require(_0xa282('0x3'));var BPromise=require(_0xa282('0x4'));var rp=require(_0xa282('0x5'));var fs=require('fs');var path=require(_0xa282('0x6'));var rimraf=require('rimraf');var config=require(_0xa282('0x7'));var attributes=require(_0xa282('0x8'));module[_0xa282('0x9')]=function(_0x651ee4,_0x1e9409){return _0x651ee4[_0xa282('0xa')](_0xa282('0xb'),attributes,{'tableName':_0xa282('0xc'),'paranoid':![],'indexes':[{'name':_0xa282('0xd'),'fields':[_0xa282('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 52b1c34..c460c13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x424f06,_0x38261c){var _0x59412f=function(_0x269ca0){while(--_0x269ca0){_0x424f06['push'](_0x424f06['shift']());}};_0x59412f(++_0x38261c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc4aa[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
+var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x125eca,_0x1cb29c){var _0xda13e3=function(_0x6383fd){while(--_0x6383fd){_0x125eca['push'](_0x125eca['shift']());}};_0xda13e3(++_0x1cb29c);}(_0x7a54,0x106));var _0x47a5=function(_0x37c3a3,_0x38c983){_0x37c3a3=_0x37c3a3-0x0;var _0x5f5d23=_0x7a54[_0x37c3a3];return _0x5f5d23;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 1653197..1974957 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(_0x20845d,_0x3a062d){var _0x191f03=function(_0x58a941){while(--_0x58a941){_0x20845d['push'](_0x20845d['shift']());}};_0x191f03(++_0x3a062d);}(_0xe706,0xa3));var _0x6e70=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe706[_0x581249];return _0x284bae;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x574590,_0x26d703){var _0x546d3d=function(_0x1d6720){while(--_0x1d6720){_0x574590['push'](_0x574590['shift']());}};_0x546d3d(++_0x26d703);}(_0xe706,0xa3));var _0x6e70=function(_0x1cd5b1,_0x58dd23){_0x1cd5b1=_0x1cd5b1-0x0;var _0x25b4c7=_0xe706[_0x1cd5b1];return _0x25b4c7;};'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 46445ef..725b265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['STRING','INTEGER','INBOX','sequelize','exports'];(function(_0x29ee6b,_0x3e6bc9){var _0x301a35=function(_0x2ccc54){while(--_0x2ccc54){_0x29ee6b['push'](_0x29ee6b['shift']());}};_0x301a35(++_0x3e6bc9);}(_0x4fc2,0x111));var _0x24fc=function(_0x5ae5f7,_0x57076b){_0x5ae5f7=_0x5ae5f7-0x0;var _0x190b76=_0x4fc2[_0x5ae5f7];return _0x190b76;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'description':{'type':Sequelize[_0x24fc('0x2')]},'host':{'type':Sequelize[_0x24fc('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x24fc('0x2')]},'password':{'type':Sequelize[_0x24fc('0x2')]},'port':{'type':Sequelize[_0x24fc('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x24fc('0x2')],'defaultValue':_0x24fc('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x24fc('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x24fc('0x2')]}};
\ No newline at end of file
+var _0xbf6e=['INBOX','STRING','BOOLEAN','INTEGER'];(function(_0xd57701,_0x721c02){var _0x17d9e7=function(_0x3957c3){while(--_0x3957c3){_0xd57701['push'](_0xd57701['shift']());}};_0x17d9e7(++_0x721c02);}(_0xbf6e,0x149));var _0xebf6=function(_0x21c63e,_0x3f7309){_0x21c63e=_0x21c63e-0x0;var _0x55d6b6=_0xbf6e[_0x21c63e];return _0x55d6b6;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0xebf6('0x0')]},'host':{'type':Sequelize[_0xebf6('0x0')]},'authentication':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xebf6('0x0')]},'password':{'type':Sequelize[_0xebf6('0x0')]},'port':{'type':Sequelize[_0xebf6('0x2')]},'tls':{'type':Sequelize[_0xebf6('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xebf6('0x3')},'connTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xebf6('0x2')],'defaultValue':0x5},'service':{'type':Sequelize[_0xebf6('0x0')]}};
\ No newline at end of file
index 4d6c6ba..14b6a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3b6=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xb3b6,0xa3));var _0x6b3b=function(_0x4c4225,_0x6d3cd0){_0x4c4225=_0x4c4225-0x0;var _0x305576=_0xb3b6[_0x4c4225];return _0x305576;};'use strict';var _=require(_0x6b3b('0x0'));var util=require('util');var logger=require(_0x6b3b('0x1'))(_0x6b3b('0x2'));var moment=require('moment');var BPromise=require(_0x6b3b('0x3'));var rp=require(_0x6b3b('0x4'));var fs=require('fs');var path=require(_0x6b3b('0x5'));var rimraf=require(_0x6b3b('0x6'));var config=require(_0x6b3b('0x7'));var attributes=require(_0x6b3b('0x8'));module[_0x6b3b('0x9')]=function(_0x26e1be,_0x53208b){return _0x26e1be[_0x6b3b('0xa')](_0x6b3b('0xb'),attributes,{'tableName':_0x6b3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7789=['./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x2e7ceb,_0x5a6130){var _0x99068e=function(_0x1d5b60){while(--_0x1d5b60){_0x2e7ceb['push'](_0x2e7ceb['shift']());}};_0x99068e(++_0x5a6130);}(_0x7789,0xc2));var _0x9778=function(_0x29a24d,_0x298931){_0x29a24d=_0x29a24d-0x0;var _0x217868=_0x7789[_0x29a24d];return _0x217868;};'use strict';var _=require(_0x9778('0x0'));var util=require(_0x9778('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9778('0x2'));var rp=require(_0x9778('0x3'));var fs=require('fs');var path=require(_0x9778('0x4'));var rimraf=require(_0x9778('0x5'));var config=require('../../config/environment');var attributes=require(_0x9778('0x6'));module['exports']=function(_0x39196e,_0x336cf7){return _0x39196e[_0x9778('0x7')](_0x9778('0x8'),attributes,{'tableName':_0x9778('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07fe5e4..8817114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20fa=['MailServerIn','options','attributes','limit','include','map','then','debug','lodash','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x20fa,0x166));var _0xa20f=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0x20fa[_0x1283d4];return _0x433643;};'use strict';var _=require(_0xa20f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa20f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa20f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa20f('0x3'));var logger=require('../../config/logger')(_0xa20f('0x4'));var config=require('../../config/environment');var jayson=require(_0xa20f('0x5'));var client=jayson['client'][_0xa20f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3363ac,_0x1eb7b5,_0x43f923){return new BPromise(function(_0x4f0a09,_0x50c320){return client[_0xa20f('0x7')](_0x3363ac,_0x43f923)['then'](function(_0x2fd0f6){logger[_0xa20f('0x8')](_0xa20f('0x9'),_0x1eb7b5,_0xa20f('0xa'));logger['debug'](_0xa20f('0xb'),_0x1eb7b5,'request\x20sent',JSON[_0xa20f('0xc')](_0x2fd0f6));if(_0x2fd0f6['error']){if(_0x2fd0f6['error']['code']===0x1f4){logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);return _0x50c320(_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);}logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);return _0x4f0a09(_0x2fd0f6[_0xa20f('0xd')][_0xa20f('0xe')]);}else{logger[_0xa20f('0x8')](_0xa20f('0x9'),_0x1eb7b5,'request\x20sent');_0x4f0a09(_0x2fd0f6['result']['message']);}})[_0xa20f('0xf')](function(_0x500ee1){logger[_0xa20f('0xd')](_0xa20f('0x9'),_0x1eb7b5,_0x500ee1);_0x50c320(_0x500ee1);});});}exports[_0xa20f('0x10')]=function(_0x267d47){var _0x121011=this;return new Promise(function(_0x3e4e33,_0x1753a2){return db[_0xa20f('0x11')]['findAll']({'raw':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x267d47['options']?_0x267d47[_0xa20f('0x12')]['where']||null:null,'attributes':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')][_0xa20f('0x13')]||null:null,'limit':_0x267d47['options']?_0x267d47[_0xa20f('0x12')][_0xa20f('0x14')]||null:null,'include':_0x267d47[_0xa20f('0x12')]?_0x267d47[_0xa20f('0x12')]['include']?_['map'](_0x267d47[_0xa20f('0x12')]['include'],function(_0x428c2f){return{'model':db[_0x428c2f['model']],'as':_0x428c2f['as'],'attributes':_0x428c2f['attributes'],'include':_0x428c2f[_0xa20f('0x15')]?_[_0xa20f('0x16')](_0x428c2f[_0xa20f('0x15')],function(_0x254668){return{'model':db[_0x254668['model']],'as':_0x254668['as'],'attributes':_0x254668[_0xa20f('0x13')],'include':_0x254668[_0xa20f('0x15')]?_[_0xa20f('0x16')](_0x254668[_0xa20f('0x15')],function(_0x4ee42c){return{'model':db[_0x4ee42c['model']],'as':_0x4ee42c['as'],'attributes':_0x4ee42c[_0xa20f('0x13')]};}):[]};}):[]};}):[]:[]})[_0xa20f('0x17')](function(_0x41d90d){logger[_0xa20f('0x8')](_0xa20f('0x10'),_0x267d47);logger[_0xa20f('0x18')](_0xa20f('0x10'),_0x267d47,JSON[_0xa20f('0xc')](_0x41d90d));_0x3e4e33(_0x41d90d);})['catch'](function(_0x3d3b55){logger['error'](_0xa20f('0x10'),_0x3d3b55[_0xa20f('0xe')],_0x267d47);_0x1753a2(_0x121011['error'](0x1f4,_0x3d3b55[_0xa20f('0xe')]));});});};
\ No newline at end of file
+var _0x49d7=['result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','map','model','then','debug','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xb3254a,_0x4520ee){var _0x35e30b=function(_0x4131f9){while(--_0x4131f9){_0xb3254a['push'](_0xb3254a['shift']());}};_0x35e30b(++_0x4520ee);}(_0x49d7,0xfe));var _0x749d=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x49d7[_0x21bfab];return _0x4db318;};'use strict';var _=require(_0x749d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x749d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x749d('0x2'))['db'];var utils=require(_0x749d('0x3'));var logger=require(_0x749d('0x4'))(_0x749d('0x5'));var config=require('../../config/environment');var jayson=require(_0x749d('0x6'));var client=jayson[_0x749d('0x7')][_0x749d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e1386,_0x5408ff,_0x5b1df8){return new BPromise(function(_0x2a04ec,_0x3c9971){return client['request'](_0x4e1386,_0x5b1df8)['then'](function(_0x206d31){logger[_0x749d('0x9')](_0x749d('0xa'),_0x5408ff,_0x749d('0xb'));logger['debug'](_0x749d('0xc'),_0x5408ff,_0x749d('0xb'),JSON['stringify'](_0x206d31));if(_0x206d31[_0x749d('0xd')]){if(_0x206d31[_0x749d('0xd')][_0x749d('0xe')]===0x1f4){logger[_0x749d('0xd')](_0x749d('0xa'),_0x5408ff,_0x206d31[_0x749d('0xd')][_0x749d('0xf')]);return _0x3c9971(_0x206d31[_0x749d('0xd')][_0x749d('0xf')]);}logger[_0x749d('0xd')](_0x749d('0xa'),_0x5408ff,_0x206d31[_0x749d('0xd')][_0x749d('0xf')]);return _0x2a04ec(_0x206d31[_0x749d('0xd')][_0x749d('0xf')]);}else{logger[_0x749d('0x9')](_0x749d('0xa'),_0x5408ff,_0x749d('0xb'));_0x2a04ec(_0x206d31[_0x749d('0x10')][_0x749d('0xf')]);}})[_0x749d('0x11')](function(_0x4cec56){logger[_0x749d('0xd')](_0x749d('0xa'),_0x5408ff,_0x4cec56);_0x3c9971(_0x4cec56);});});}exports[_0x749d('0x12')]=function(_0x84a61a){var _0x581c36=this;return new Promise(function(_0x227102,_0x32d271){return db[_0x749d('0x13')][_0x749d('0x14')]({'raw':_0x84a61a['options']?_0x84a61a[_0x749d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x84a61a[_0x749d('0x15')]?_0x84a61a[_0x749d('0x15')][_0x749d('0x16')]||null:null,'attributes':_0x84a61a[_0x749d('0x15')]?_0x84a61a[_0x749d('0x15')][_0x749d('0x17')]||null:null,'limit':_0x84a61a[_0x749d('0x15')]?_0x84a61a[_0x749d('0x15')][_0x749d('0x18')]||null:null,'include':_0x84a61a['options']?_0x84a61a[_0x749d('0x15')][_0x749d('0x19')]?_[_0x749d('0x1a')](_0x84a61a[_0x749d('0x15')]['include'],function(_0x42dddb){return{'model':db[_0x42dddb[_0x749d('0x1b')]],'as':_0x42dddb['as'],'attributes':_0x42dddb['attributes'],'include':_0x42dddb[_0x749d('0x19')]?_['map'](_0x42dddb[_0x749d('0x19')],function(_0x128d6e){return{'model':db[_0x128d6e[_0x749d('0x1b')]],'as':_0x128d6e['as'],'attributes':_0x128d6e[_0x749d('0x17')],'include':_0x128d6e[_0x749d('0x19')]?_[_0x749d('0x1a')](_0x128d6e[_0x749d('0x19')],function(_0x37547c){return{'model':db[_0x37547c[_0x749d('0x1b')]],'as':_0x37547c['as'],'attributes':_0x37547c[_0x749d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x749d('0x1c')](function(_0x373458){logger[_0x749d('0x9')]('GetMailServerIn',_0x84a61a);logger[_0x749d('0x1d')](_0x749d('0x12'),_0x84a61a,JSON['stringify'](_0x373458));_0x227102(_0x373458);})['catch'](function(_0xbe21ce){logger['error'](_0x749d('0x12'),_0xbe21ce[_0x749d('0xf')],_0x84a61a);_0x32d271(_0x581c36[_0x749d('0xd')](0x1f4,_0xbe21ce[_0x749d('0xf')]));});});};
\ No newline at end of file
index cd169a4..a31d3f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x3ac0c2,_0x38c62a){_0x3ac0c2=_0x3ac0c2-0x0;var _0x4b1ddb=_0x7a54[_0x3ac0c2];return _0x4b1ddb;};'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 18596fd..8a1bde2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fb4=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x1037b2,_0x2dc6cf){var _0x1d3c61=function(_0x303918){while(--_0x303918){_0x1037b2['push'](_0x1037b2['shift']());}};_0x1d3c61(++_0x2dc6cf);}(_0x3fb4,0x97));var _0x43fb=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x3fb4[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0x43fb('0x0'));module[_0x43fb('0x1')]={'description':{'type':Sequelize[_0x43fb('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x43fb('0x2')]},'pass':{'type':Sequelize[_0x43fb('0x2')]},'port':{'type':Sequelize[_0x43fb('0x3')]},'secure':{'type':Sequelize[_0x43fb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x43fb('0x2')]},'authentication':{'type':Sequelize[_0x43fb('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x382e=['sequelize','exports','STRING','BOOLEAN'];(function(_0x54afd2,_0x32138b){var _0x118383=function(_0x21d87a){while(--_0x21d87a){_0x54afd2['push'](_0x54afd2['shift']());}};_0x118383(++_0x32138b);}(_0x382e,0x16c));var _0xe382=function(_0x381c2c,_0x518577){_0x381c2c=_0x381c2c-0x0;var _0x378484=_0x382e[_0x381c2c];return _0x378484;};'use strict';var Sequelize=require(_0xe382('0x0'));module[_0xe382('0x1')]={'description':{'type':Sequelize[_0xe382('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe382('0x2')]},'pass':{'type':Sequelize[_0xe382('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xe382('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe382('0x2')]},'authentication':{'type':Sequelize[_0xe382('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index a0a3291..335596e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['MailServerOut','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index'];(function(_0x5f14e5,_0x3e2192){var _0x253474=function(_0x311d78){while(--_0x311d78){_0x5f14e5['push'](_0x5f14e5['shift']());}};_0x253474(++_0x3e2192);}(_0x47c5,0xb0));var _0x547c=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x47c5[_0x589248];return _0x486750;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x547c('0x5'));var util=require('util');var path=require(_0x547c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0x7'));var _=require(_0x547c('0x8'));var squel=require(_0x547c('0x9'));var crypto=require(_0x547c('0xa'));var jsforce=require(_0x547c('0xb'));var deskjs=require(_0x547c('0xc'));var toCsv=require(_0x547c('0xd'));var querystring=require(_0x547c('0xe'));var Papa=require(_0x547c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x547c('0x10'));var as=require(_0x547c('0x11'));var hardwareService=require(_0x547c('0x12'));var logger=require(_0x547c('0x13'))(_0x547c('0x14'));var utils=require('../../config/utils');var config=require(_0x547c('0x15'));var licenseUtil=require(_0x547c('0x16'));var db=require(_0x547c('0x17'))['db'];function respondWithStatusCode(_0x182de8,_0x1c50ff){_0x1c50ff=_0x1c50ff||0xcc;return function(_0x574d1f){if(_0x574d1f){return _0x182de8['sendStatus'](_0x1c50ff);}return _0x182de8[_0x547c('0x18')](_0x1c50ff)[_0x547c('0x19')]();};}function respondWithResult(_0x37f24a,_0x31aede){_0x31aede=_0x31aede||0xc8;return function(_0x50d340){if(_0x50d340){return _0x37f24a['status'](_0x31aede)[_0x547c('0x1a')](_0x50d340);}};}function respondWithFilteredResult(_0x4c41f2,_0x28f6fc){return function(_0x2eab37){if(_0x2eab37){var _0x3e6cb0=typeof _0x28f6fc[_0x547c('0x1b')]===_0x547c('0x1c')&&typeof _0x28f6fc[_0x547c('0x1d')]===_0x547c('0x1c');var _0x3278a3=_0x2eab37[_0x547c('0x1e')];var _0x2a5242=_0x3e6cb0?0x0:_0x28f6fc['offset'];var _0x390353=_0x3e6cb0?_0x2eab37['count']:_0x28f6fc[_0x547c('0x1b')]+_0x28f6fc[_0x547c('0x1d')];var _0x3fd845;if(_0x390353>=_0x3278a3){_0x390353=_0x3278a3;_0x3fd845=0xc8;}else{_0x3fd845=0xce;}_0x4c41f2[_0x547c('0x18')](_0x3fd845);return _0x4c41f2[_0x547c('0x1f')]('Content-Range',_0x2a5242+'-'+_0x390353+'/'+_0x3278a3)[_0x547c('0x1a')](_0x2eab37);}return null;};}function patchUpdates(_0xa54fa4){return function(_0x1e4bcd){try{jsonpatch['apply'](_0x1e4bcd,_0xa54fa4,!![]);}catch(_0x5ecaa1){return BPromise[_0x547c('0x20')](_0x5ecaa1);}return _0x1e4bcd[_0x547c('0x21')]();};}function saveUpdates(_0x335342,_0x1d1633){return function(_0x24c407){if(_0x24c407){return _0x24c407[_0x547c('0x22')](_0x335342)[_0x547c('0x23')](function(_0x1afa71){return _0x1afa71;});}return null;};}function removeEntity(_0x467c10,_0x67c0e7){return function(_0x524939){if(_0x524939){return _0x524939[_0x547c('0x24')]()[_0x547c('0x23')](function(){_0x467c10[_0x547c('0x18')](0xcc)[_0x547c('0x19')]();});}};}function handleEntityNotFound(_0x5d0fc1,_0x2fd39b){return function(_0x5bc390){if(!_0x5bc390){_0x5d0fc1[_0x547c('0x25')](0x194);}return _0x5bc390;};}function handleError(_0x3ad52c,_0x5cfa0e){_0x5cfa0e=_0x5cfa0e||0x1f4;return function(_0x14a9f3){logger[_0x547c('0x26')](_0x14a9f3[_0x547c('0x27')]);if(_0x14a9f3['name']){delete _0x14a9f3[_0x547c('0x28')];}_0x3ad52c[_0x547c('0x18')](_0x5cfa0e)[_0x547c('0x29')](_0x14a9f3);};}exports[_0x547c('0x2a')]=function(_0x4af085,_0x54bd5f){var _0x425481={},_0x404067={},_0x37adf8={'count':0x0,'rows':[]};var _0x29d51e=_['map'](db[_0x547c('0x2b')]['rawAttributes'],function(_0x2eafec){return{'name':_0x2eafec['fieldName'],'type':_0x2eafec[_0x547c('0x2c')][_0x547c('0x2d')]};});_0x404067['model']=_[_0x547c('0x2e')](_0x29d51e,_0x547c('0x28'));_0x404067[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x4af085[_0x547c('0x2f')]);_0x404067[_0x547c('0x31')]=_['intersection'](_0x404067[_0x547c('0x32')],_0x404067[_0x547c('0x2f')]);_0x425481[_0x547c('0x33')]=_[_0x547c('0x34')](_0x404067[_0x547c('0x32')],qs[_0x547c('0x35')](_0x4af085[_0x547c('0x2f')][_0x547c('0x35')]));_0x425481[_0x547c('0x33')]=_0x425481[_0x547c('0x33')][_0x547c('0x36')]?_0x425481[_0x547c('0x33')]:_0x404067[_0x547c('0x32')];if(!_0x4af085[_0x547c('0x2f')][_0x547c('0x37')](_0x547c('0x38'))){_0x425481[_0x547c('0x1d')]=qs[_0x547c('0x1d')](_0x4af085[_0x547c('0x2f')][_0x547c('0x1d')]);_0x425481['offset']=qs[_0x547c('0x1b')](_0x4af085[_0x547c('0x2f')][_0x547c('0x1b')]);}_0x425481[_0x547c('0x39')]=qs[_0x547c('0x3a')](_0x4af085[_0x547c('0x2f')][_0x547c('0x3a')]);_0x425481[_0x547c('0x3b')]=qs[_0x547c('0x31')](_[_0x547c('0x3c')](_0x4af085[_0x547c('0x2f')],_0x404067[_0x547c('0x31')]),_0x29d51e);if(_0x4af085['query']['filter']){_0x425481['where']=_[_0x547c('0x3d')](_0x425481[_0x547c('0x3b')],{'$or':_[_0x547c('0x2e')](_0x29d51e,function(_0x389b2c){if(_0x389b2c[_0x547c('0x2c')]!==_0x547c('0x3e')){var _0x44f7c5={};_0x44f7c5[_0x389b2c[_0x547c('0x28')]]={'$like':'%'+_0x4af085[_0x547c('0x2f')]['filter']+'%'};return _0x44f7c5;}})});}_0x425481=_[_0x547c('0x3d')]({},_0x425481,_0x4af085[_0x547c('0x3f')]);var _0x50b41b={'where':_0x425481[_0x547c('0x3b')]};return db[_0x547c('0x2b')][_0x547c('0x1e')](_0x50b41b)[_0x547c('0x23')](function(_0x28b3e2){_0x37adf8['count']=_0x28b3e2;if(_0x4af085[_0x547c('0x2f')][_0x547c('0x40')]){_0x425481[_0x547c('0x41')]=[{'all':!![]}];}return db[_0x547c('0x2b')][_0x547c('0x42')](_0x425481);})[_0x547c('0x23')](function(_0x5b643c){_0x37adf8[_0x547c('0x43')]=_0x5b643c;return _0x37adf8;})[_0x547c('0x23')](respondWithFilteredResult(_0x54bd5f,_0x425481))[_0x547c('0x44')](handleError(_0x54bd5f,null));};exports['show']=function(_0x1dec49,_0x1c8cbd){var _0x38db01={'raw':!![],'where':{'id':_0x1dec49[_0x547c('0x45')]['id']}},_0x5730b4={};_0x5730b4[_0x547c('0x32')]=_[_0x547c('0x30')](db[_0x547c('0x2b')]['rawAttributes']);_0x5730b4[_0x547c('0x2f')]=_[_0x547c('0x30')](_0x1dec49[_0x547c('0x2f')]);_0x5730b4[_0x547c('0x31')]=_[_0x547c('0x34')](_0x5730b4[_0x547c('0x32')],_0x5730b4[_0x547c('0x2f')]);_0x38db01[_0x547c('0x33')]=_[_0x547c('0x34')](_0x5730b4[_0x547c('0x32')],qs[_0x547c('0x35')](_0x1dec49[_0x547c('0x2f')][_0x547c('0x35')]));_0x38db01[_0x547c('0x33')]=_0x38db01[_0x547c('0x33')]['length']?_0x38db01[_0x547c('0x33')]:_0x5730b4[_0x547c('0x32')];if(_0x1dec49['query']['includeAll']){_0x38db01[_0x547c('0x41')]=[{'all':!![]}];}_0x38db01=_['merge']({},_0x38db01,_0x1dec49[_0x547c('0x3f')]);return db[_0x547c('0x2b')][_0x547c('0x46')](_0x38db01)['then'](handleEntityNotFound(_0x1c8cbd,null))[_0x547c('0x23')](respondWithResult(_0x1c8cbd,null))[_0x547c('0x44')](handleError(_0x1c8cbd,null));};exports['create']=function(_0x27bc09,_0xfe0a25){return db[_0x547c('0x2b')][_0x547c('0x47')](_0x27bc09[_0x547c('0x48')],{})[_0x547c('0x23')](respondWithResult(_0xfe0a25,0xc9))['catch'](handleError(_0xfe0a25,null));};exports[_0x547c('0x22')]=function(_0x1f5435,_0x23dbd7){if(_0x1f5435[_0x547c('0x48')]['id']){delete _0x1f5435[_0x547c('0x48')]['id'];}return db[_0x547c('0x2b')][_0x547c('0x46')]({'where':{'id':_0x1f5435[_0x547c('0x45')]['id']}})[_0x547c('0x23')](handleEntityNotFound(_0x23dbd7,null))['then'](saveUpdates(_0x1f5435[_0x547c('0x48')],null))[_0x547c('0x23')](respondWithResult(_0x23dbd7,null))[_0x547c('0x44')](handleError(_0x23dbd7,null));};exports['destroy']=function(_0x52aa71,_0x1cc9da){return db['MailServerOut'][_0x547c('0x46')]({'where':{'id':_0x52aa71[_0x547c('0x45')]['id']}})[_0x547c('0x23')](handleEntityNotFound(_0x1cc9da,null))['then'](removeEntity(_0x1cc9da,null))[_0x547c('0x44')](handleError(_0x1cc9da,null));};
\ No newline at end of file
+var _0x6a19=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../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','then','error','stack','name','map','MailServerOut','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','create','body','update','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x6a19,0x8c));var _0x96a1=function(_0x4f4bd1,_0x1ec09a){_0x4f4bd1=_0x4f4bd1-0x0;var _0x23eed9=_0x6a19[_0x4f4bd1];return _0x23eed9;};'use strict';var emlformat=require(_0x96a1('0x0'));var rimraf=require(_0x96a1('0x1'));var zipdir=require(_0x96a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96a1('0x3'));var moment=require(_0x96a1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x96a1('0x5'));var util=require(_0x96a1('0x6'));var path=require(_0x96a1('0x7'));var sox=require(_0x96a1('0x8'));var csv=require(_0x96a1('0x9'));var ejs=require(_0x96a1('0xa'));var fs=require('fs');var fs_extra=require(_0x96a1('0xb'));var _=require('lodash');var squel=require(_0x96a1('0xc'));var crypto=require(_0x96a1('0xd'));var jsforce=require(_0x96a1('0xe'));var deskjs=require(_0x96a1('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96a1('0x10'));var Redis=require(_0x96a1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x96a1('0x12'));var as=require(_0x96a1('0x13'));var hardwareService=require(_0x96a1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x96a1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x96a1('0x16'));var db=require(_0x96a1('0x17'))['db'];function respondWithStatusCode(_0x176f9b,_0x58b66f){_0x58b66f=_0x58b66f||0xcc;return function(_0x376767){if(_0x376767){return _0x176f9b[_0x96a1('0x18')](_0x58b66f);}return _0x176f9b[_0x96a1('0x19')](_0x58b66f)[_0x96a1('0x1a')]();};}function respondWithResult(_0x3eb7e7,_0x43e3ce){_0x43e3ce=_0x43e3ce||0xc8;return function(_0x192858){if(_0x192858){return _0x3eb7e7['status'](_0x43e3ce)[_0x96a1('0x1b')](_0x192858);}};}function respondWithFilteredResult(_0x42269d,_0x299643){return function(_0x380e02){if(_0x380e02){var _0x2ba491=typeof _0x299643[_0x96a1('0x1c')]===_0x96a1('0x1d')&&typeof _0x299643[_0x96a1('0x1e')]===_0x96a1('0x1d');var _0x29ad2e=_0x380e02['count'];var _0x26a1b6=_0x2ba491?0x0:_0x299643['offset'];var _0x2fe0b0=_0x2ba491?_0x380e02[_0x96a1('0x1f')]:_0x299643[_0x96a1('0x1c')]+_0x299643[_0x96a1('0x1e')];var _0x2ca28f;if(_0x2fe0b0>=_0x29ad2e){_0x2fe0b0=_0x29ad2e;_0x2ca28f=0xc8;}else{_0x2ca28f=0xce;}_0x42269d[_0x96a1('0x19')](_0x2ca28f);return _0x42269d[_0x96a1('0x20')](_0x96a1('0x21'),_0x26a1b6+'-'+_0x2fe0b0+'/'+_0x29ad2e)[_0x96a1('0x1b')](_0x380e02);}return null;};}function patchUpdates(_0x3d493e){return function(_0x5d173a){try{jsonpatch[_0x96a1('0x22')](_0x5d173a,_0x3d493e,!![]);}catch(_0x187b78){return BPromise[_0x96a1('0x23')](_0x187b78);}return _0x5d173a[_0x96a1('0x24')]();};}function saveUpdates(_0x3ed25b,_0x5c8553){return function(_0x21c1eb){if(_0x21c1eb){return _0x21c1eb['update'](_0x3ed25b)['then'](function(_0x248a55){return _0x248a55;});}return null;};}function removeEntity(_0x2d4ebf,_0x273b23){return function(_0x37c693){if(_0x37c693){return _0x37c693['destroy']()[_0x96a1('0x25')](function(){_0x2d4ebf[_0x96a1('0x19')](0xcc)[_0x96a1('0x1a')]();});}};}function handleEntityNotFound(_0x5535af,_0x2db08f){return function(_0x524c49){if(!_0x524c49){_0x5535af[_0x96a1('0x18')](0x194);}return _0x524c49;};}function handleError(_0x387831,_0x5022b2){_0x5022b2=_0x5022b2||0x1f4;return function(_0x1840ca){logger[_0x96a1('0x26')](_0x1840ca[_0x96a1('0x27')]);if(_0x1840ca[_0x96a1('0x28')]){delete _0x1840ca[_0x96a1('0x28')];}_0x387831['status'](_0x5022b2)['send'](_0x1840ca);};}exports['index']=function(_0x1ae071,_0x29c942){var _0x4bd61a={},_0x2793e0={},_0x105667={'count':0x0,'rows':[]};var _0x13d136=_[_0x96a1('0x29')](db[_0x96a1('0x2a')][_0x96a1('0x2b')],function(_0x20c2ed){return{'name':_0x20c2ed['fieldName'],'type':_0x20c2ed[_0x96a1('0x2c')][_0x96a1('0x2d')]};});_0x2793e0[_0x96a1('0x2e')]=_[_0x96a1('0x29')](_0x13d136,_0x96a1('0x28'));_0x2793e0[_0x96a1('0x2f')]=_[_0x96a1('0x30')](_0x1ae071[_0x96a1('0x2f')]);_0x2793e0['filters']=_[_0x96a1('0x31')](_0x2793e0['model'],_0x2793e0['query']);_0x4bd61a[_0x96a1('0x32')]=_[_0x96a1('0x31')](_0x2793e0[_0x96a1('0x2e')],qs[_0x96a1('0x33')](_0x1ae071['query']['fields']));_0x4bd61a['attributes']=_0x4bd61a[_0x96a1('0x32')][_0x96a1('0x34')]?_0x4bd61a['attributes']:_0x2793e0[_0x96a1('0x2e')];if(!_0x1ae071[_0x96a1('0x2f')]['hasOwnProperty'](_0x96a1('0x35'))){_0x4bd61a[_0x96a1('0x1e')]=qs[_0x96a1('0x1e')](_0x1ae071[_0x96a1('0x2f')][_0x96a1('0x1e')]);_0x4bd61a[_0x96a1('0x1c')]=qs[_0x96a1('0x1c')](_0x1ae071[_0x96a1('0x2f')][_0x96a1('0x1c')]);}_0x4bd61a['order']=qs['sort'](_0x1ae071[_0x96a1('0x2f')][_0x96a1('0x36')]);_0x4bd61a[_0x96a1('0x37')]=qs[_0x96a1('0x38')](_[_0x96a1('0x39')](_0x1ae071[_0x96a1('0x2f')],_0x2793e0[_0x96a1('0x38')]),_0x13d136);if(_0x1ae071['query'][_0x96a1('0x3a')]){_0x4bd61a[_0x96a1('0x37')]=_['merge'](_0x4bd61a['where'],{'$or':_['map'](_0x13d136,function(_0x3d5670){if(_0x3d5670[_0x96a1('0x2c')]!==_0x96a1('0x3b')){var _0x54f602={};_0x54f602[_0x3d5670[_0x96a1('0x28')]]={'$like':'%'+_0x1ae071[_0x96a1('0x2f')][_0x96a1('0x3a')]+'%'};return _0x54f602;}})});}_0x4bd61a=_[_0x96a1('0x3c')]({},_0x4bd61a,_0x1ae071[_0x96a1('0x3d')]);var _0x25909d={'where':_0x4bd61a['where']};return db['MailServerOut']['count'](_0x25909d)[_0x96a1('0x25')](function(_0x1c0e51){_0x105667[_0x96a1('0x1f')]=_0x1c0e51;if(_0x1ae071[_0x96a1('0x2f')]['includeAll']){_0x4bd61a['include']=[{'all':!![]}];}return db[_0x96a1('0x2a')][_0x96a1('0x3e')](_0x4bd61a);})[_0x96a1('0x25')](function(_0x40f4f3){_0x105667[_0x96a1('0x3f')]=_0x40f4f3;return _0x105667;})[_0x96a1('0x25')](respondWithFilteredResult(_0x29c942,_0x4bd61a))[_0x96a1('0x40')](handleError(_0x29c942,null));};exports[_0x96a1('0x41')]=function(_0x1be9e9,_0x40cb88){var _0x56a9ca={'raw':!![],'where':{'id':_0x1be9e9[_0x96a1('0x42')]['id']}},_0x392651={};_0x392651['model']=_['keys'](db[_0x96a1('0x2a')][_0x96a1('0x2b')]);_0x392651['query']=_[_0x96a1('0x30')](_0x1be9e9[_0x96a1('0x2f')]);_0x392651[_0x96a1('0x38')]=_[_0x96a1('0x31')](_0x392651['model'],_0x392651[_0x96a1('0x2f')]);_0x56a9ca['attributes']=_[_0x96a1('0x31')](_0x392651[_0x96a1('0x2e')],qs['fields'](_0x1be9e9[_0x96a1('0x2f')][_0x96a1('0x33')]));_0x56a9ca[_0x96a1('0x32')]=_0x56a9ca[_0x96a1('0x32')][_0x96a1('0x34')]?_0x56a9ca[_0x96a1('0x32')]:_0x392651[_0x96a1('0x2e')];if(_0x1be9e9['query'][_0x96a1('0x43')]){_0x56a9ca['include']=[{'all':!![]}];}_0x56a9ca=_[_0x96a1('0x3c')]({},_0x56a9ca,_0x1be9e9[_0x96a1('0x3d')]);return db[_0x96a1('0x2a')]['find'](_0x56a9ca)[_0x96a1('0x25')](handleEntityNotFound(_0x40cb88,null))[_0x96a1('0x25')](respondWithResult(_0x40cb88,null))['catch'](handleError(_0x40cb88,null));};exports[_0x96a1('0x44')]=function(_0x51ac7f,_0x4ea659){return db[_0x96a1('0x2a')][_0x96a1('0x44')](_0x51ac7f[_0x96a1('0x45')],{})[_0x96a1('0x25')](respondWithResult(_0x4ea659,0xc9))[_0x96a1('0x40')](handleError(_0x4ea659,null));};exports[_0x96a1('0x46')]=function(_0xa59456,_0x300f83){if(_0xa59456['body']['id']){delete _0xa59456[_0x96a1('0x45')]['id'];}return db[_0x96a1('0x2a')][_0x96a1('0x47')]({'where':{'id':_0xa59456[_0x96a1('0x42')]['id']}})[_0x96a1('0x25')](handleEntityNotFound(_0x300f83,null))[_0x96a1('0x25')](saveUpdates(_0xa59456['body'],null))[_0x96a1('0x25')](respondWithResult(_0x300f83,null))[_0x96a1('0x40')](handleError(_0x300f83,null));};exports[_0x96a1('0x48')]=function(_0xf053c,_0x280aee){return db[_0x96a1('0x2a')][_0x96a1('0x47')]({'where':{'id':_0xf053c['params']['id']}})[_0x96a1('0x25')](handleEntityNotFound(_0x280aee,null))[_0x96a1('0x25')](removeEntity(_0x280aee,null))['catch'](handleError(_0x280aee,null));};
\ No newline at end of file
index 072e2ba..42d53c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaed=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xaaed,0x189));var _0xdaae=function(_0x19a928,_0x3d0493){_0x19a928=_0x19a928-0x0;var _0x282442=_0xaaed[_0x19a928];return _0x282442;};'use strict';var _=require(_0xdaae('0x0'));var util=require(_0xdaae('0x1'));var logger=require(_0xdaae('0x2'))(_0xdaae('0x3'));var moment=require(_0xdaae('0x4'));var BPromise=require(_0xdaae('0x5'));var rp=require(_0xdaae('0x6'));var fs=require('fs');var path=require(_0xdaae('0x7'));var rimraf=require(_0xdaae('0x8'));var config=require(_0xdaae('0x9'));var attributes=require(_0xdaae('0xa'));module[_0xdaae('0xb')]=function(_0x14dac4,_0x339828){return _0x14dac4[_0xdaae('0xc')](_0xdaae('0xd'),attributes,{'tableName':_0xdaae('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56bc=['request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash','util','api','moment','bluebird'];(function(_0x21043c,_0x58c556){var _0x2bf8c9=function(_0x59340d){while(--_0x59340d){_0x21043c['push'](_0x21043c['shift']());}};_0x2bf8c9(++_0x58c556);}(_0x56bc,0x18e));var _0xc56b=function(_0x15d63a,_0x2159ba){_0x15d63a=_0x15d63a-0x0;var _0x47e122=_0x56bc[_0x15d63a];return _0x47e122;};'use strict';var _=require(_0xc56b('0x0'));var util=require(_0xc56b('0x1'));var logger=require('../../config/logger')(_0xc56b('0x2'));var moment=require(_0xc56b('0x3'));var BPromise=require(_0xc56b('0x4'));var rp=require(_0xc56b('0x5'));var fs=require('fs');var path=require(_0xc56b('0x6'));var rimraf=require(_0xc56b('0x7'));var config=require(_0xc56b('0x8'));var attributes=require(_0xc56b('0x9'));module['exports']=function(_0x5517aa,_0x3d6447){return _0x5517aa[_0xc56b('0xa')](_0xc56b('0xb'),attributes,{'tableName':_0xc56b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c4e0b8..f267852 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x59db37,_0x14464c){var _0x3a4d97=function(_0x3e1094){while(--_0x3e1094){_0x59db37['push'](_0x59db37['shift']());}};_0x3a4d97(++_0x14464c);}(_0x2ef3,0xba));var _0x32ef=function(_0x48f6ef,_0x39d187){_0x48f6ef=_0x48f6ef-0x0;var _0x3d8db4=_0x2ef3[_0x48f6ef];return _0x3d8db4;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4ad364,_0x34d600){var _0x1ace8f=function(_0x4f4503){while(--_0x4f4503){_0x4ad364['push'](_0x4ad364['shift']());}};_0x1ace8f(++_0x34d600);}(_0xadb5,0xad));var _0x5adb=function(_0x152f96,_0x3ed9ef){_0x152f96=_0x152f96-0x0;var _0x562f6a=_0xadb5[_0x152f96];return _0x562f6a;};'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']('MailServerOut,\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
index 9e2f6e5..92579f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5248=['../../components/auth/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','destroy','exports','multer','connect-timeout','Router','fs-extra'];(function(_0x5f76e3,_0x977880){var _0x4a5558=function(_0x1340d4){while(--_0x1340d4){_0x5f76e3['push'](_0x5f76e3['shift']());}};_0x4a5558(++_0x977880);}(_0x5248,0x84));var _0x8524=function(_0x22c0d4,_0x416c7d){_0x22c0d4=_0x22c0d4-0x0;var _0xacede6=_0x5248[_0x22c0d4];return _0xacede6;};'use strict';var multer=require(_0x8524('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8524('0x1'));var express=require('express');var router=express[_0x8524('0x2')]();var fs_extra=require(_0x8524('0x3'));var auth=require(_0x8524('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8524('0x5'));var controller=require(_0x8524('0x6'));router['get']('/',auth[_0x8524('0x7')](),controller[_0x8524('0x8')]);router[_0x8524('0x9')](_0x8524('0xa'),auth['isAuthenticated'](),controller[_0x8524('0xb')]);router[_0x8524('0x9')](_0x8524('0xc'),auth[_0x8524('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x8524('0xd')]);router[_0x8524('0xe')](_0x8524('0xc'),auth[_0x8524('0x7')](),controller['update']);router['delete'](_0x8524('0xc'),auth[_0x8524('0x7')](),controller[_0x8524('0xf')]);module[_0x8524('0x10')]=router;
\ No newline at end of file
+var _0x96bd=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/:id'];(function(_0x3c4fb2,_0x29cca3){var _0x27c56b=function(_0x2ad590){while(--_0x2ad590){_0x3c4fb2['push'](_0x3c4fb2['shift']());}};_0x27c56b(++_0x29cca3);}(_0x96bd,0x1e7));var _0xd96b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x96bd[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xd96b('0x0'));var util=require(_0xd96b('0x1'));var path=require(_0xd96b('0x2'));var timeout=require(_0xd96b('0x3'));var express=require(_0xd96b('0x4'));var router=express[_0xd96b('0x5')]();var fs_extra=require(_0xd96b('0x6'));var auth=require(_0xd96b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd96b('0x8'));var controller=require(_0xd96b('0x9'));router[_0xd96b('0xa')]('/',auth[_0xd96b('0xb')](),controller['index']);router[_0xd96b('0xa')]('/describe',auth[_0xd96b('0xb')](),controller['describe']);router['get'](_0xd96b('0xc'),auth[_0xd96b('0xb')](),controller[_0xd96b('0xd')]);router['post']('/',auth[_0xd96b('0xb')](),controller[_0xd96b('0xe')]);router[_0xd96b('0xf')](_0xd96b('0xc'),auth[_0xd96b('0xb')](),controller[_0xd96b('0x10')]);router[_0xd96b('0x11')](_0xd96b('0xc'),auth[_0xd96b('0xb')](),controller[_0xd96b('0x12')]);module[_0xd96b('0x13')]=router;
\ No newline at end of file
index 90d9221..90820d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','sequelize','exports'];(function(_0x5ddf23,_0x319603){var _0x24b5f5=function(_0x59efb2){while(--_0x59efb2){_0x5ddf23['push'](_0x5ddf23['shift']());}};_0x24b5f5(++_0x319603);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1396,_0xaaebad){_0x1c1396=_0x1c1396-0x0;var _0x5f0b85=_0x7a54[_0x1c1396];return _0x5f0b85;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'name':{'type':Sequelize[_0x47a5('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x9fe7=['exports','name','sequelize'];(function(_0x31e94f,_0x42ecd6){var _0x1b8494=function(_0x5da15c){while(--_0x5da15c){_0x31e94f['push'](_0x31e94f['shift']());}};_0x1b8494(++_0x42ecd6);}(_0x9fe7,0x1df));var _0x79fe=function(_0x28c5d1,_0x2688b9){_0x28c5d1=_0x28c5d1-0x0;var _0x19309f=_0x9fe7[_0x28c5d1];return _0x19309f;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x79fe('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4f3b110..c0cb40a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5c4=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','MailSubstatus','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x58a48a,_0x925cbb){var _0x2c98df=function(_0x596248){while(--_0x596248){_0x58a48a['push'](_0x58a48a['shift']());}};_0x2c98df(++_0x925cbb);}(_0xd5c4,0x10a));var _0x4d5c=function(_0x48280d,_0x2cf7d1){_0x48280d=_0x48280d-0x0;var _0x45d0ed=_0xd5c4[_0x48280d];return _0x45d0ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4d5c('0x0'));var jsonpatch=require(_0x4d5c('0x1'));var rp=require(_0x4d5c('0x2'));var moment=require(_0x4d5c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4d5c('0x4'));var path=require(_0x4d5c('0x5'));var sox=require('sox');var csv=require(_0x4d5c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d5c('0x7'));var squel=require('squel');var crypto=require(_0x4d5c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x4d5c('0x9'));var toCsv=require(_0x4d5c('0x6'));var querystring=require('querystring');var Papa=require(_0x4d5c('0xa'));var Redis=require(_0x4d5c('0xb'));var authService=require(_0x4d5c('0xc'));var qs=require(_0x4d5c('0xd'));var as=require(_0x4d5c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5c('0xf'))(_0x4d5c('0x10'));var utils=require(_0x4d5c('0x11'));var config=require(_0x4d5c('0x12'));var licenseUtil=require(_0x4d5c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4068e7,_0x484ed4){_0x484ed4=_0x484ed4||0xcc;return function(_0x251347){if(_0x251347){return _0x4068e7[_0x4d5c('0x14')](_0x484ed4);}return _0x4068e7[_0x4d5c('0x15')](_0x484ed4)[_0x4d5c('0x16')]();};}function respondWithResult(_0x1befdf,_0x3ae226){_0x3ae226=_0x3ae226||0xc8;return function(_0x30fc0f){if(_0x30fc0f){return _0x1befdf['status'](_0x3ae226)['json'](_0x30fc0f);}};}function respondWithFilteredResult(_0x4f07bb,_0x58fff2){return function(_0xba830f){if(_0xba830f){var _0x33fa4d=typeof _0x58fff2[_0x4d5c('0x17')]===_0x4d5c('0x18')&&typeof _0x58fff2[_0x4d5c('0x19')]===_0x4d5c('0x18');var _0xaad82e=_0xba830f[_0x4d5c('0x1a')];var _0x27c0f0=_0x33fa4d?0x0:_0x58fff2[_0x4d5c('0x17')];var _0x2bb886=_0x33fa4d?_0xba830f['count']:_0x58fff2['offset']+_0x58fff2[_0x4d5c('0x19')];var _0x377e9e;if(_0x2bb886>=_0xaad82e){_0x2bb886=_0xaad82e;_0x377e9e=0xc8;}else{_0x377e9e=0xce;}_0x4f07bb[_0x4d5c('0x15')](_0x377e9e);return _0x4f07bb[_0x4d5c('0x1b')]('Content-Range',_0x27c0f0+'-'+_0x2bb886+'/'+_0xaad82e)[_0x4d5c('0x1c')](_0xba830f);}return null;};}function patchUpdates(_0x17ef6b){return function(_0x2fca7e){try{jsonpatch['apply'](_0x2fca7e,_0x17ef6b,!![]);}catch(_0x171c2a){return BPromise[_0x4d5c('0x1d')](_0x171c2a);}return _0x2fca7e['save']();};}function saveUpdates(_0x139241,_0x987754){return function(_0x59fd7a){if(_0x59fd7a){return _0x59fd7a[_0x4d5c('0x1e')](_0x139241)[_0x4d5c('0x1f')](function(_0x5dff7e){return _0x5dff7e;});}return null;};}function removeEntity(_0x39d5e1,_0x5be400){return function(_0x51b934){if(_0x51b934){return _0x51b934['destroy']()[_0x4d5c('0x1f')](function(){_0x39d5e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x446549,_0x22202e){return function(_0x27e914){if(!_0x27e914){_0x446549[_0x4d5c('0x14')](0x194);}return _0x27e914;};}function handleError(_0x360fb3,_0x21f46e){_0x21f46e=_0x21f46e||0x1f4;return function(_0x5013d0){logger[_0x4d5c('0x20')](_0x5013d0[_0x4d5c('0x21')]);if(_0x5013d0[_0x4d5c('0x22')]){delete _0x5013d0[_0x4d5c('0x22')];}_0x360fb3['status'](_0x21f46e)[_0x4d5c('0x23')](_0x5013d0);};}exports[_0x4d5c('0x24')]=function(_0xb383f4,_0x1ddc01){var _0x3e7262={},_0x11ee59={},_0x521dd8={'count':0x0,'rows':[]};var _0x572b14=_[_0x4d5c('0x25')](db['MailSubstatus'][_0x4d5c('0x26')],function(_0x4d9583){return{'name':_0x4d9583['fieldName'],'type':_0x4d9583[_0x4d5c('0x27')][_0x4d5c('0x28')]};});_0x11ee59[_0x4d5c('0x29')]=_[_0x4d5c('0x25')](_0x572b14,'name');_0x11ee59[_0x4d5c('0x2a')]=_[_0x4d5c('0x2b')](_0xb383f4['query']);_0x11ee59['filters']=_[_0x4d5c('0x2c')](_0x11ee59[_0x4d5c('0x29')],_0x11ee59[_0x4d5c('0x2a')]);_0x3e7262['attributes']=_['intersection'](_0x11ee59[_0x4d5c('0x29')],qs[_0x4d5c('0x2d')](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x2d')]));_0x3e7262[_0x4d5c('0x2e')]=_0x3e7262[_0x4d5c('0x2e')][_0x4d5c('0x2f')]?_0x3e7262['attributes']:_0x11ee59[_0x4d5c('0x29')];if(!_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x30')](_0x4d5c('0x31'))){_0x3e7262['limit']=qs['limit'](_0xb383f4['query'][_0x4d5c('0x19')]);_0x3e7262['offset']=qs[_0x4d5c('0x17')](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x17')]);}_0x3e7262['order']=qs['sort'](_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x32')]);_0x3e7262['where']=qs[_0x4d5c('0x33')](_[_0x4d5c('0x34')](_0xb383f4['query'],_0x11ee59[_0x4d5c('0x33')]),_0x572b14);if(_0xb383f4['query'][_0x4d5c('0x35')]){_0x3e7262[_0x4d5c('0x36')]=_[_0x4d5c('0x37')](_0x3e7262[_0x4d5c('0x36')],{'$or':_[_0x4d5c('0x25')](_0x572b14,function(_0x4facc6){if(_0x4facc6[_0x4d5c('0x27')]!=='VIRTUAL'){var _0x188767={};_0x188767[_0x4facc6['name']]={'$like':'%'+_0xb383f4[_0x4d5c('0x2a')][_0x4d5c('0x35')]+'%'};return _0x188767;}})});}_0x3e7262=_[_0x4d5c('0x37')]({},_0x3e7262,_0xb383f4[_0x4d5c('0x38')]);var _0x235355={'where':_0x3e7262[_0x4d5c('0x36')]};return db[_0x4d5c('0x39')][_0x4d5c('0x1a')](_0x235355)[_0x4d5c('0x1f')](function(_0xe413fb){_0x521dd8['count']=_0xe413fb;if(_0xb383f4['query'][_0x4d5c('0x3a')]){_0x3e7262[_0x4d5c('0x3b')]=[{'all':!![]}];}return db[_0x4d5c('0x39')][_0x4d5c('0x3c')](_0x3e7262);})[_0x4d5c('0x1f')](function(_0x8f6919){_0x521dd8[_0x4d5c('0x3d')]=_0x8f6919;return _0x521dd8;})[_0x4d5c('0x1f')](respondWithFilteredResult(_0x1ddc01,_0x3e7262))['catch'](handleError(_0x1ddc01,null));};exports[_0x4d5c('0x3e')]=function(_0x59874a,_0x21cdc5){var _0x586154={'raw':!![],'where':{'id':_0x59874a[_0x4d5c('0x3f')]['id']}},_0x2220c1={};_0x2220c1[_0x4d5c('0x29')]=_[_0x4d5c('0x2b')](db['MailSubstatus']['rawAttributes']);_0x2220c1[_0x4d5c('0x2a')]=_['keys'](_0x59874a[_0x4d5c('0x2a')]);_0x2220c1[_0x4d5c('0x33')]=_[_0x4d5c('0x2c')](_0x2220c1[_0x4d5c('0x29')],_0x2220c1['query']);_0x586154[_0x4d5c('0x2e')]=_[_0x4d5c('0x2c')](_0x2220c1[_0x4d5c('0x29')],qs[_0x4d5c('0x2d')](_0x59874a[_0x4d5c('0x2a')][_0x4d5c('0x2d')]));_0x586154['attributes']=_0x586154[_0x4d5c('0x2e')][_0x4d5c('0x2f')]?_0x586154[_0x4d5c('0x2e')]:_0x2220c1[_0x4d5c('0x29')];if(_0x59874a[_0x4d5c('0x2a')]['includeAll']){_0x586154[_0x4d5c('0x3b')]=[{'all':!![]}];}_0x586154=_[_0x4d5c('0x37')]({},_0x586154,_0x59874a[_0x4d5c('0x38')]);return db[_0x4d5c('0x39')][_0x4d5c('0x40')](_0x586154)[_0x4d5c('0x1f')](handleEntityNotFound(_0x21cdc5,null))[_0x4d5c('0x1f')](respondWithResult(_0x21cdc5,null))[_0x4d5c('0x41')](handleError(_0x21cdc5,null));};exports[_0x4d5c('0x42')]=function(_0x172e71,_0x2781e3){return db[_0x4d5c('0x39')][_0x4d5c('0x42')](_0x172e71['body'],{})[_0x4d5c('0x1f')](respondWithResult(_0x2781e3,0xc9))['catch'](handleError(_0x2781e3,null));};exports[_0x4d5c('0x1e')]=function(_0x2908c0,_0x3ff168){if(_0x2908c0[_0x4d5c('0x43')]['id']){delete _0x2908c0[_0x4d5c('0x43')]['id'];}return db[_0x4d5c('0x39')][_0x4d5c('0x40')]({'where':{'id':_0x2908c0['params']['id']}})[_0x4d5c('0x1f')](handleEntityNotFound(_0x3ff168,null))[_0x4d5c('0x1f')](saveUpdates(_0x2908c0[_0x4d5c('0x43')],null))[_0x4d5c('0x1f')](respondWithResult(_0x3ff168,null))['catch'](handleError(_0x3ff168,null));};exports[_0x4d5c('0x44')]=function(_0x139e0c,_0x1781d7){return db[_0x4d5c('0x39')][_0x4d5c('0x40')]({'where':{'id':_0x139e0c[_0x4d5c('0x3f')]['id']}})[_0x4d5c('0x1f')](handleEntityNotFound(_0x1781d7,null))[_0x4d5c('0x1f')](removeEntity(_0x1781d7,null))['catch'](handleError(_0x1781d7,null));};exports[_0x4d5c('0x45')]=function(_0x5af21c,_0x199fcb){return db['MailSubstatus']['describe']()[_0x4d5c('0x1f')](respondWithResult(_0x199fcb,null))[_0x4d5c('0x41')](handleError(_0x199fcb,null));};
\ No newline at end of file
+var _0x2ec8=['options','includeAll','include','findAll','rows','show','params','rawAttributes','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5c3ded,_0x11b900){var _0x53794f=function(_0x14e080){while(--_0x14e080){_0x5c3ded['push'](_0x5c3ded['shift']());}};_0x53794f(++_0x11b900);}(_0x2ec8,0x185));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82ec('0x0'));var zipdir=require(_0x82ec('0x1'));var jsonpatch=require(_0x82ec('0x2'));var rp=require('request-promise');var moment=require(_0x82ec('0x3'));var BPromise=require(_0x82ec('0x4'));var Mustache=require(_0x82ec('0x5'));var util=require(_0x82ec('0x6'));var path=require(_0x82ec('0x7'));var sox=require(_0x82ec('0x8'));var csv=require(_0x82ec('0x9'));var ejs=require(_0x82ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82ec('0xb'));var squel=require(_0x82ec('0xc'));var crypto=require(_0x82ec('0xd'));var jsforce=require(_0x82ec('0xe'));var deskjs=require(_0x82ec('0xf'));var toCsv=require(_0x82ec('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x82ec('0x10'));var authService=require(_0x82ec('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82ec('0x12'));var hardwareService=require(_0x82ec('0x13'));var logger=require('../../config/logger')(_0x82ec('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x82ec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9ca9,_0x6af199){_0x6af199=_0x6af199||0xcc;return function(_0x362cfb){if(_0x362cfb){return _0x5e9ca9[_0x82ec('0x16')](_0x6af199);}return _0x5e9ca9[_0x82ec('0x17')](_0x6af199)[_0x82ec('0x18')]();};}function respondWithResult(_0x5e3d9c,_0x115c7b){_0x115c7b=_0x115c7b||0xc8;return function(_0x2d0f4a){if(_0x2d0f4a){return _0x5e3d9c[_0x82ec('0x17')](_0x115c7b)[_0x82ec('0x19')](_0x2d0f4a);}};}function respondWithFilteredResult(_0x4de539,_0x1eb5c6){return function(_0x4c0536){if(_0x4c0536){var _0x34ad34=typeof _0x1eb5c6[_0x82ec('0x1a')]===_0x82ec('0x1b')&&typeof _0x1eb5c6[_0x82ec('0x1c')]==='undefined';var _0x3effa1=_0x4c0536[_0x82ec('0x1d')];var _0x25d53f=_0x34ad34?0x0:_0x1eb5c6[_0x82ec('0x1a')];var _0x276821=_0x34ad34?_0x4c0536[_0x82ec('0x1d')]:_0x1eb5c6[_0x82ec('0x1a')]+_0x1eb5c6['limit'];var _0x5cb8c8;if(_0x276821>=_0x3effa1){_0x276821=_0x3effa1;_0x5cb8c8=0xc8;}else{_0x5cb8c8=0xce;}_0x4de539[_0x82ec('0x17')](_0x5cb8c8);return _0x4de539[_0x82ec('0x1e')](_0x82ec('0x1f'),_0x25d53f+'-'+_0x276821+'/'+_0x3effa1)[_0x82ec('0x19')](_0x4c0536);}return null;};}function patchUpdates(_0x109a0f){return function(_0x175abf){try{jsonpatch[_0x82ec('0x20')](_0x175abf,_0x109a0f,!![]);}catch(_0x5d9620){return BPromise[_0x82ec('0x21')](_0x5d9620);}return _0x175abf[_0x82ec('0x22')]();};}function saveUpdates(_0x612c7e,_0x48766f){return function(_0x2a1831){if(_0x2a1831){return _0x2a1831[_0x82ec('0x23')](_0x612c7e)[_0x82ec('0x24')](function(_0x13168a){return _0x13168a;});}return null;};}function removeEntity(_0x551fe0,_0x11b604){return function(_0x5ecc88){if(_0x5ecc88){return _0x5ecc88[_0x82ec('0x25')]()['then'](function(){_0x551fe0['status'](0xcc)[_0x82ec('0x18')]();});}};}function handleEntityNotFound(_0x239579,_0x4f486a){return function(_0x16f9ff){if(!_0x16f9ff){_0x239579['sendStatus'](0x194);}return _0x16f9ff;};}function handleError(_0x5a2228,_0xf4c1fa){_0xf4c1fa=_0xf4c1fa||0x1f4;return function(_0x571320){logger[_0x82ec('0x26')](_0x571320[_0x82ec('0x27')]);if(_0x571320[_0x82ec('0x28')]){delete _0x571320['name'];}_0x5a2228[_0x82ec('0x17')](_0xf4c1fa)[_0x82ec('0x29')](_0x571320);};}exports[_0x82ec('0x2a')]=function(_0x515f57,_0x163492){var _0x4e76c2={},_0x46294c={},_0x377554={'count':0x0,'rows':[]};var _0x33b28e=_[_0x82ec('0x2b')](db[_0x82ec('0x2c')]['rawAttributes'],function(_0x254ca0){return{'name':_0x254ca0['fieldName'],'type':_0x254ca0[_0x82ec('0x2d')]['key']};});_0x46294c[_0x82ec('0x2e')]=_[_0x82ec('0x2b')](_0x33b28e,_0x82ec('0x28'));_0x46294c[_0x82ec('0x2f')]=_['keys'](_0x515f57[_0x82ec('0x2f')]);_0x46294c[_0x82ec('0x30')]=_[_0x82ec('0x31')](_0x46294c[_0x82ec('0x2e')],_0x46294c[_0x82ec('0x2f')]);_0x4e76c2[_0x82ec('0x32')]=_[_0x82ec('0x31')](_0x46294c['model'],qs['fields'](_0x515f57[_0x82ec('0x2f')][_0x82ec('0x33')]));_0x4e76c2[_0x82ec('0x32')]=_0x4e76c2['attributes'][_0x82ec('0x34')]?_0x4e76c2[_0x82ec('0x32')]:_0x46294c[_0x82ec('0x2e')];if(!_0x515f57[_0x82ec('0x2f')]['hasOwnProperty'](_0x82ec('0x35'))){_0x4e76c2[_0x82ec('0x1c')]=qs['limit'](_0x515f57['query'][_0x82ec('0x1c')]);_0x4e76c2[_0x82ec('0x1a')]=qs[_0x82ec('0x1a')](_0x515f57[_0x82ec('0x2f')][_0x82ec('0x1a')]);}_0x4e76c2[_0x82ec('0x36')]=qs[_0x82ec('0x37')](_0x515f57[_0x82ec('0x2f')][_0x82ec('0x37')]);_0x4e76c2[_0x82ec('0x38')]=qs[_0x82ec('0x30')](_[_0x82ec('0x39')](_0x515f57['query'],_0x46294c[_0x82ec('0x30')]),_0x33b28e);if(_0x515f57[_0x82ec('0x2f')][_0x82ec('0x3a')]){_0x4e76c2['where']=_[_0x82ec('0x3b')](_0x4e76c2[_0x82ec('0x38')],{'$or':_[_0x82ec('0x2b')](_0x33b28e,function(_0x4da59e){if(_0x4da59e[_0x82ec('0x2d')]!==_0x82ec('0x3c')){var _0x103809={};_0x103809[_0x4da59e['name']]={'$like':'%'+_0x515f57[_0x82ec('0x2f')][_0x82ec('0x3a')]+'%'};return _0x103809;}})});}_0x4e76c2=_['merge']({},_0x4e76c2,_0x515f57[_0x82ec('0x3d')]);var _0x4b0e65={'where':_0x4e76c2[_0x82ec('0x38')]};return db[_0x82ec('0x2c')]['count'](_0x4b0e65)[_0x82ec('0x24')](function(_0xfe9e52){_0x377554[_0x82ec('0x1d')]=_0xfe9e52;if(_0x515f57[_0x82ec('0x2f')][_0x82ec('0x3e')]){_0x4e76c2[_0x82ec('0x3f')]=[{'all':!![]}];}return db[_0x82ec('0x2c')][_0x82ec('0x40')](_0x4e76c2);})[_0x82ec('0x24')](function(_0x53bc62){_0x377554[_0x82ec('0x41')]=_0x53bc62;return _0x377554;})['then'](respondWithFilteredResult(_0x163492,_0x4e76c2))['catch'](handleError(_0x163492,null));};exports[_0x82ec('0x42')]=function(_0x41e6a1,_0x4ab839){var _0x57e773={'raw':!![],'where':{'id':_0x41e6a1[_0x82ec('0x43')]['id']}},_0x48e5c5={};_0x48e5c5[_0x82ec('0x2e')]=_['keys'](db[_0x82ec('0x2c')][_0x82ec('0x44')]);_0x48e5c5['query']=_[_0x82ec('0x45')](_0x41e6a1[_0x82ec('0x2f')]);_0x48e5c5[_0x82ec('0x30')]=_['intersection'](_0x48e5c5['model'],_0x48e5c5[_0x82ec('0x2f')]);_0x57e773[_0x82ec('0x32')]=_[_0x82ec('0x31')](_0x48e5c5[_0x82ec('0x2e')],qs[_0x82ec('0x33')](_0x41e6a1[_0x82ec('0x2f')]['fields']));_0x57e773[_0x82ec('0x32')]=_0x57e773[_0x82ec('0x32')][_0x82ec('0x34')]?_0x57e773['attributes']:_0x48e5c5[_0x82ec('0x2e')];if(_0x41e6a1[_0x82ec('0x2f')][_0x82ec('0x3e')]){_0x57e773[_0x82ec('0x3f')]=[{'all':!![]}];}_0x57e773=_[_0x82ec('0x3b')]({},_0x57e773,_0x41e6a1[_0x82ec('0x3d')]);return db[_0x82ec('0x2c')][_0x82ec('0x46')](_0x57e773)['then'](handleEntityNotFound(_0x4ab839,null))[_0x82ec('0x24')](respondWithResult(_0x4ab839,null))[_0x82ec('0x47')](handleError(_0x4ab839,null));};exports['create']=function(_0x5361c,_0x432de1){return db[_0x82ec('0x2c')][_0x82ec('0x48')](_0x5361c[_0x82ec('0x49')],{})[_0x82ec('0x24')](respondWithResult(_0x432de1,0xc9))[_0x82ec('0x47')](handleError(_0x432de1,null));};exports[_0x82ec('0x23')]=function(_0x5a2072,_0x45edd0){if(_0x5a2072[_0x82ec('0x49')]['id']){delete _0x5a2072[_0x82ec('0x49')]['id'];}return db[_0x82ec('0x2c')][_0x82ec('0x46')]({'where':{'id':_0x5a2072[_0x82ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x45edd0,null))[_0x82ec('0x24')](saveUpdates(_0x5a2072['body'],null))[_0x82ec('0x24')](respondWithResult(_0x45edd0,null))[_0x82ec('0x47')](handleError(_0x45edd0,null));};exports['destroy']=function(_0x28e4ed,_0x195348){return db[_0x82ec('0x2c')][_0x82ec('0x46')]({'where':{'id':_0x28e4ed[_0x82ec('0x43')]['id']}})[_0x82ec('0x24')](handleEntityNotFound(_0x195348,null))[_0x82ec('0x24')](removeEntity(_0x195348,null))[_0x82ec('0x47')](handleError(_0x195348,null));};exports[_0x82ec('0x4a')]=function(_0x15d5cd,_0x296f8a){return db[_0x82ec('0x2c')][_0x82ec('0x4a')]()['then'](respondWithResult(_0x296f8a,null))[_0x82ec('0x47')](handleError(_0x296f8a,null));};
\ No newline at end of file
index bdacd70..fe2408c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d0=['bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','../../config/logger','api','moment'];(function(_0x47b50b,_0x3210df){var _0x408532=function(_0x25c0c1){while(--_0x25c0c1){_0x47b50b['push'](_0x47b50b['shift']());}};_0x408532(++_0x3210df);}(_0x36d0,0x171));var _0x036d=function(_0x4fc40f,_0x1a66b8){_0x4fc40f=_0x4fc40f-0x0;var _0x1ec033=_0x36d0[_0x4fc40f];return _0x1ec033;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x036d('0x0'))(_0x036d('0x1'));var moment=require(_0x036d('0x2'));var BPromise=require(_0x036d('0x3'));var rp=require(_0x036d('0x4'));var fs=require('fs');var path=require(_0x036d('0x5'));var rimraf=require(_0x036d('0x6'));var config=require(_0x036d('0x7'));var attributes=require(_0x036d('0x8'));module[_0x036d('0x9')]=function(_0x7e08b4,_0x49b74e){return _0x7e08b4[_0x036d('0xa')]('MailSubstatus',attributes,{'tableName':_0x036d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3008=['path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','lodash','util','bluebird','request-promise'];(function(_0x227901,_0x1d8fca){var _0x5a55e4=function(_0x528862){while(--_0x528862){_0x227901['push'](_0x227901['shift']());}};_0x5a55e4(++_0x1d8fca);}(_0x3008,0x150));var _0x8300=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x3008[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x8300('0x0'));var util=require(_0x8300('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8300('0x2'));var rp=require(_0x8300('0x3'));var fs=require('fs');var path=require(_0x8300('0x4'));var rimraf=require(_0x8300('0x5'));var config=require(_0x8300('0x6'));var attributes=require(_0x8300('0x7'));module['exports']=function(_0x55125e,_0x26a937){return _0x55125e[_0x8300('0x8')](_0x8300('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f5a91f3..33adfbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab5d=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','MailSubstatus,\x20%s,\x20%s','result','util'];(function(_0x32f87c,_0x319327){var _0x1518e4=function(_0x37a649){while(--_0x37a649){_0x32f87c['push'](_0x32f87c['shift']());}};_0x1518e4(++_0x319327);}(_0xab5d,0x71));var _0xdab5=function(_0x12b181,_0x52dff9){_0x12b181=_0x12b181-0x0;var _0x3cb8cd=_0xab5d[_0x12b181];return _0x3cb8cd;};'use strict';var _=require('lodash');var util=require(_0xdab5('0x0'));var moment=require(_0xdab5('0x1'));var BPromise=require('bluebird');var rs=require(_0xdab5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdab5('0x3'))['db'];var utils=require(_0xdab5('0x4'));var logger=require(_0xdab5('0x5'))(_0xdab5('0x6'));var config=require(_0xdab5('0x7'));var jayson=require(_0xdab5('0x8'));var client=jayson[_0xdab5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476b1f,_0x4e7256,_0x46f331){return new BPromise(function(_0x169def,_0x8cca32){return client['request'](_0x476b1f,_0x46f331)['then'](function(_0x3ed97f){logger[_0xdab5('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0xdab5('0xb'));logger[_0xdab5('0xc')](_0xdab5('0xd'),_0x4e7256,_0xdab5('0xb'),JSON[_0xdab5('0xe')](_0x3ed97f));if(_0x3ed97f[_0xdab5('0xf')]){if(_0x3ed97f[_0xdab5('0xf')]['code']===0x1f4){logger[_0xdab5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);return _0x8cca32(_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);}logger[_0xdab5('0xf')](_0xdab5('0x11'),_0x4e7256,_0x3ed97f[_0xdab5('0xf')]['message']);return _0x169def(_0x3ed97f[_0xdab5('0xf')][_0xdab5('0x10')]);}else{logger[_0xdab5('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0xdab5('0xb'));_0x169def(_0x3ed97f[_0xdab5('0x12')]['message']);}})['catch'](function(_0x7ae1c8){logger[_0xdab5('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x4e7256,_0x7ae1c8);_0x8cca32(_0x7ae1c8);});});}
\ No newline at end of file
+var _0x33cf=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x14afda,_0x512394){var _0x1923af=function(_0x6919df){while(--_0x6919df){_0x14afda['push'](_0x14afda['shift']());}};_0x1923af(++_0x512394);}(_0x33cf,0x10c));var _0xf33c=function(_0x5c38f4,_0x3247db){_0x5c38f4=_0x5c38f4-0x0;var _0x4360f0=_0x33cf[_0x5c38f4];return _0x4360f0;};'use strict';var _=require(_0xf33c('0x0'));var util=require('util');var moment=require(_0xf33c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf33c('0x2'));var fs=require('fs');var Redis=require(_0xf33c('0x3'));var db=require(_0xf33c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf33c('0x5'));var config=require(_0xf33c('0x6'));var jayson=require(_0xf33c('0x7'));var client=jayson[_0xf33c('0x8')][_0xf33c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22d67f,_0x9158de,_0x499b8b){return new BPromise(function(_0x300939,_0x55803d){return client[_0xf33c('0xa')](_0x22d67f,_0x499b8b)[_0xf33c('0xb')](function(_0x1fe577){logger[_0xf33c('0xc')](_0xf33c('0xd'),_0x9158de,_0xf33c('0xe'));logger['debug'](_0xf33c('0xf'),_0x9158de,_0xf33c('0xe'),JSON[_0xf33c('0x10')](_0x1fe577));if(_0x1fe577[_0xf33c('0x11')]){if(_0x1fe577['error']['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x9158de,_0x1fe577['error'][_0xf33c('0x12')]);return _0x55803d(_0x1fe577[_0xf33c('0x11')][_0xf33c('0x12')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x9158de,_0x1fe577[_0xf33c('0x11')][_0xf33c('0x12')]);return _0x300939(_0x1fe577['error']['message']);}else{logger[_0xf33c('0xc')](_0xf33c('0xd'),_0x9158de,_0xf33c('0xe'));_0x300939(_0x1fe577[_0xf33c('0x13')]['message']);}})['catch'](function(_0x151639){logger[_0xf33c('0x11')](_0xf33c('0xd'),_0x9158de,_0x151639);_0x55803d(_0x151639);});});}
\ No newline at end of file
index 3bc04ac..6e81cff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10ac=['destroy','exports','util','path','connect-timeout','Router','fs-extra','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id'];(function(_0x41deb2,_0x365783){var _0x572115=function(_0x380fca){while(--_0x380fca){_0x41deb2['push'](_0x41deb2['shift']());}};_0x572115(++_0x365783);}(_0x10ac,0x9a));var _0xc10a=function(_0x146dd7,_0x4d877d){_0x146dd7=_0x146dd7-0x0;var _0x2af0bb=_0x10ac[_0x146dd7];return _0x2af0bb;};'use strict';var multer=require('multer');var util=require(_0xc10a('0x0'));var path=require(_0xc10a('0x1'));var timeout=require(_0xc10a('0x2'));var express=require('express');var router=express[_0xc10a('0x3')]();var fs_extra=require(_0xc10a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc10a('0x5'));router[_0xc10a('0x6')]('/',auth[_0xc10a('0x7')](),controller[_0xc10a('0x8')]);router[_0xc10a('0x6')](_0xc10a('0x9'),auth[_0xc10a('0x7')](),controller[_0xc10a('0xa')]);router[_0xc10a('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xc10a('0xb')]);router[_0xc10a('0xc')]('/',auth[_0xc10a('0x7')](),controller[_0xc10a('0xd')]);router[_0xc10a('0xe')]('/:id',auth[_0xc10a('0x7')](),controller[_0xc10a('0xf')]);router['delete'](_0xc10a('0x10'),auth['isAuthenticated'](),controller[_0xc10a('0x11')]);module[_0xc10a('0x12')]=router;
\ No newline at end of file
+var _0xe320=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x4823ad,_0x4377b3){var _0x501806=function(_0x35ab2b){while(--_0x35ab2b){_0x4823ad['push'](_0x4823ad['shift']());}};_0x501806(++_0x4377b3);}(_0xe320,0x180));var _0x0e32=function(_0xc12cb3,_0x2e0d1e){_0xc12cb3=_0xc12cb3-0x0;var _0x3eed15=_0xe320[_0xc12cb3];return _0x3eed15;};'use strict';var multer=require(_0x0e32('0x0'));var util=require(_0x0e32('0x1'));var path=require(_0x0e32('0x2'));var timeout=require(_0x0e32('0x3'));var express=require(_0x0e32('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0e32('0x5'));var interaction=require(_0x0e32('0x6'));var config=require(_0x0e32('0x7'));var controller=require(_0x0e32('0x8'));router['get']('/',auth[_0x0e32('0x9')](),controller[_0x0e32('0xa')]);router[_0x0e32('0xb')](_0x0e32('0xc'),auth['isAuthenticated'](),controller[_0x0e32('0xd')]);router['get'](_0x0e32('0xe'),auth[_0x0e32('0x9')](),controller['show']);router['post']('/',auth[_0x0e32('0x9')](),controller[_0x0e32('0xf')]);router[_0x0e32('0x10')](_0x0e32('0xe'),auth[_0x0e32('0x9')](),controller[_0x0e32('0x11')]);router[_0x0e32('0x12')](_0x0e32('0xe'),auth['isAuthenticated'](),controller[_0x0e32('0x13')]);module[_0x0e32('0x14')]=router;
\ No newline at end of file
index 3c12f6c..accb3e3 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(_0x1369a2,_0x55cbed){var _0x4d1891=function(_0x5c26e6){while(--_0x5c26e6){_0x1369a2['push'](_0x1369a2['shift']());}};_0x4d1891(++_0x55cbed);}(_0xaa88,0x137));var _0x8aa8=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xaa88[_0x3e32a8];return _0x2997b0;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x20f3a3,_0xe879a){var _0x4ecd05=function(_0x353942){while(--_0x353942){_0x20f3a3['push'](_0x20f3a3['shift']());}};_0x4ecd05(++_0xe879a);}(_0x008c,0x188));var _0xc008=function(_0x49f30d,_0x50300a){_0x49f30d=_0x49f30d-0x0;var _0x2c75fa=_0x008c[_0x49f30d];return _0x2c75fa;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
index b6f9b56..7f9f20d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd122=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','attributes','length','find','catch','create','body','rimraf','zip-dir','util','sox'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xd122,0x120));var _0x2d12=function(_0x2d4f2f,_0x250960){_0x2d4f2f=_0x2d4f2f-0x0;var _0xa6ee1a=_0xd122[_0x2d4f2f];return _0xa6ee1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d12('0x0'));var zipdir=require(_0x2d12('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d12('0x2'));var path=require('path');var sox=require(_0x2d12('0x3'));var csv=require('to-csv');var ejs=require(_0x2d12('0x4'));var fs=require('fs');var fs_extra=require(_0x2d12('0x5'));var _=require(_0x2d12('0x6'));var squel=require(_0x2d12('0x7'));var crypto=require(_0x2d12('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2d12('0x9'));var toCsv=require(_0x2d12('0xa'));var querystring=require(_0x2d12('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d12('0xc'));var qs=require(_0x2d12('0xd'));var as=require(_0x2d12('0xe'));var hardwareService=require(_0x2d12('0xf'));var logger=require(_0x2d12('0x10'))(_0x2d12('0x11'));var utils=require(_0x2d12('0x12'));var config=require(_0x2d12('0x13'));var licenseUtil=require(_0x2d12('0x14'));var db=require(_0x2d12('0x15'))['db'];function respondWithStatusCode(_0x548758,_0x4b728a){_0x4b728a=_0x4b728a||0xcc;return function(_0x1c28e3){if(_0x1c28e3){return _0x548758[_0x2d12('0x16')](_0x4b728a);}return _0x548758[_0x2d12('0x17')](_0x4b728a)[_0x2d12('0x18')]();};}function respondWithResult(_0x5900aa,_0x290b65){_0x290b65=_0x290b65||0xc8;return function(_0x48c45d){if(_0x48c45d){return _0x5900aa[_0x2d12('0x17')](_0x290b65)['json'](_0x48c45d);}};}function respondWithFilteredResult(_0x54b160,_0x13eef9){return function(_0x11de53){if(_0x11de53){var _0xbfbd7c=typeof _0x13eef9['offset']===_0x2d12('0x19')&&typeof _0x13eef9['limit']===_0x2d12('0x19');var _0x5053f9=_0x11de53[_0x2d12('0x1a')];var _0x106bc5=_0xbfbd7c?0x0:_0x13eef9[_0x2d12('0x1b')];var _0x57577e=_0xbfbd7c?_0x11de53['count']:_0x13eef9['offset']+_0x13eef9[_0x2d12('0x1c')];var _0x20361b;if(_0x57577e>=_0x5053f9){_0x57577e=_0x5053f9;_0x20361b=0xc8;}else{_0x20361b=0xce;}_0x54b160[_0x2d12('0x17')](_0x20361b);return _0x54b160[_0x2d12('0x1d')]('Content-Range',_0x106bc5+'-'+_0x57577e+'/'+_0x5053f9)[_0x2d12('0x1e')](_0x11de53);}return null;};}function patchUpdates(_0x234175){return function(_0x14f885){try{jsonpatch[_0x2d12('0x1f')](_0x14f885,_0x234175,!![]);}catch(_0x4ed6c2){return BPromise['reject'](_0x4ed6c2);}return _0x14f885[_0x2d12('0x20')]();};}function saveUpdates(_0xdf02a0,_0x47db66){return function(_0x2f852c){if(_0x2f852c){return _0x2f852c[_0x2d12('0x21')](_0xdf02a0)[_0x2d12('0x22')](function(_0x1df0e6){return _0x1df0e6;});}return null;};}function removeEntity(_0x1e3db9,_0x33dc41){return function(_0x2b1b82){if(_0x2b1b82){return _0x2b1b82[_0x2d12('0x23')]()[_0x2d12('0x22')](function(){_0x1e3db9[_0x2d12('0x17')](0xcc)[_0x2d12('0x18')]();});}};}function handleEntityNotFound(_0x118f97,_0x4516be){return function(_0x21af9b){if(!_0x21af9b){_0x118f97[_0x2d12('0x16')](0x194);}return _0x21af9b;};}function handleError(_0x22f4a1,_0x29bca7){_0x29bca7=_0x29bca7||0x1f4;return function(_0x50c0c3){logger[_0x2d12('0x24')](_0x50c0c3[_0x2d12('0x25')]);if(_0x50c0c3[_0x2d12('0x26')]){delete _0x50c0c3[_0x2d12('0x26')];}_0x22f4a1[_0x2d12('0x17')](_0x29bca7)[_0x2d12('0x27')](_0x50c0c3);};}exports[_0x2d12('0x28')]=function(_0x83009f,_0x2aa262){var _0x5db9f4={},_0x2f8b29={},_0x5bda79={'count':0x0,'rows':[]};var _0xbb1c05=_[_0x2d12('0x29')](db[_0x2d12('0x2a')][_0x2d12('0x2b')],function(_0x1a12dd){return{'name':_0x1a12dd[_0x2d12('0x2c')],'type':_0x1a12dd[_0x2d12('0x2d')][_0x2d12('0x2e')]};});_0x2f8b29[_0x2d12('0x2f')]=_[_0x2d12('0x29')](_0xbb1c05,'name');_0x2f8b29[_0x2d12('0x30')]=_[_0x2d12('0x31')](_0x83009f[_0x2d12('0x30')]);_0x2f8b29[_0x2d12('0x32')]=_[_0x2d12('0x33')](_0x2f8b29[_0x2d12('0x2f')],_0x2f8b29[_0x2d12('0x30')]);_0x5db9f4['attributes']=_[_0x2d12('0x33')](_0x2f8b29['model'],qs[_0x2d12('0x34')](_0x83009f[_0x2d12('0x30')][_0x2d12('0x34')]));_0x5db9f4['attributes']=_0x5db9f4['attributes']['length']?_0x5db9f4['attributes']:_0x2f8b29['model'];if(!_0x83009f['query'][_0x2d12('0x35')](_0x2d12('0x36'))){_0x5db9f4[_0x2d12('0x1c')]=qs['limit'](_0x83009f['query'][_0x2d12('0x1c')]);_0x5db9f4[_0x2d12('0x1b')]=qs[_0x2d12('0x1b')](_0x83009f[_0x2d12('0x30')][_0x2d12('0x1b')]);}_0x5db9f4[_0x2d12('0x37')]=qs[_0x2d12('0x38')](_0x83009f[_0x2d12('0x30')]['sort']);_0x5db9f4[_0x2d12('0x39')]=qs[_0x2d12('0x32')](_['pick'](_0x83009f[_0x2d12('0x30')],_0x2f8b29[_0x2d12('0x32')]),_0xbb1c05);if(_0x83009f[_0x2d12('0x30')][_0x2d12('0x3a')]){_0x5db9f4[_0x2d12('0x39')]=_[_0x2d12('0x3b')](_0x5db9f4[_0x2d12('0x39')],{'$or':_[_0x2d12('0x29')](_0xbb1c05,function(_0x567e73){if(_0x567e73[_0x2d12('0x2d')]!=='VIRTUAL'){var _0x4a82b7={};_0x4a82b7[_0x567e73[_0x2d12('0x26')]]={'$like':'%'+_0x83009f['query']['filter']+'%'};return _0x4a82b7;}})});}_0x5db9f4=_[_0x2d12('0x3b')]({},_0x5db9f4,_0x83009f[_0x2d12('0x3c')]);var _0x493915={'where':_0x5db9f4[_0x2d12('0x39')]};return db[_0x2d12('0x2a')][_0x2d12('0x1a')](_0x493915)[_0x2d12('0x22')](function(_0x153521){_0x5bda79[_0x2d12('0x1a')]=_0x153521;if(_0x83009f[_0x2d12('0x30')][_0x2d12('0x3d')]){_0x5db9f4[_0x2d12('0x3e')]=[{'all':!![]}];}return db[_0x2d12('0x2a')][_0x2d12('0x3f')](_0x5db9f4);})[_0x2d12('0x22')](function(_0x183fce){_0x5bda79[_0x2d12('0x40')]=_0x183fce;return _0x5bda79;})['then'](respondWithFilteredResult(_0x2aa262,_0x5db9f4))['catch'](handleError(_0x2aa262,null));};exports[_0x2d12('0x41')]=function(_0xba53c7,_0x2d85e7){var _0x2774e6={'raw':!![],'where':{'id':_0xba53c7[_0x2d12('0x42')]['id']}},_0x3b1c06={};_0x3b1c06[_0x2d12('0x2f')]=_[_0x2d12('0x31')](db[_0x2d12('0x2a')]['rawAttributes']);_0x3b1c06[_0x2d12('0x30')]=_['keys'](_0xba53c7[_0x2d12('0x30')]);_0x3b1c06[_0x2d12('0x32')]=_[_0x2d12('0x33')](_0x3b1c06['model'],_0x3b1c06[_0x2d12('0x30')]);_0x2774e6[_0x2d12('0x43')]=_[_0x2d12('0x33')](_0x3b1c06[_0x2d12('0x2f')],qs[_0x2d12('0x34')](_0xba53c7['query'][_0x2d12('0x34')]));_0x2774e6[_0x2d12('0x43')]=_0x2774e6[_0x2d12('0x43')][_0x2d12('0x44')]?_0x2774e6[_0x2d12('0x43')]:_0x3b1c06[_0x2d12('0x2f')];if(_0xba53c7[_0x2d12('0x30')][_0x2d12('0x3d')]){_0x2774e6[_0x2d12('0x3e')]=[{'all':!![]}];}_0x2774e6=_[_0x2d12('0x3b')]({},_0x2774e6,_0xba53c7[_0x2d12('0x3c')]);return db['MailTransferReport'][_0x2d12('0x45')](_0x2774e6)[_0x2d12('0x22')](handleEntityNotFound(_0x2d85e7,null))['then'](respondWithResult(_0x2d85e7,null))[_0x2d12('0x46')](handleError(_0x2d85e7,null));};exports[_0x2d12('0x47')]=function(_0x359db8,_0x1ef762){return db[_0x2d12('0x2a')]['create'](_0x359db8[_0x2d12('0x48')],{})[_0x2d12('0x22')](respondWithResult(_0x1ef762,0xc9))[_0x2d12('0x46')](handleError(_0x1ef762,null));};exports[_0x2d12('0x21')]=function(_0x2d749a,_0x163f3a){if(_0x2d749a[_0x2d12('0x48')]['id']){delete _0x2d749a[_0x2d12('0x48')]['id'];}return db[_0x2d12('0x2a')][_0x2d12('0x45')]({'where':{'id':_0x2d749a['params']['id']}})[_0x2d12('0x22')](handleEntityNotFound(_0x163f3a,null))[_0x2d12('0x22')](saveUpdates(_0x2d749a[_0x2d12('0x48')],null))[_0x2d12('0x22')](respondWithResult(_0x163f3a,null))[_0x2d12('0x46')](handleError(_0x163f3a,null));};exports[_0x2d12('0x23')]=function(_0x3e3cf3,_0x379388){return db[_0x2d12('0x2a')][_0x2d12('0x45')]({'where':{'id':_0x3e3cf3['params']['id']}})[_0x2d12('0x22')](handleEntityNotFound(_0x379388,null))['then'](removeEntity(_0x379388,null))['catch'](handleError(_0x379388,null));};exports['describe']=function(_0x1d88b8,_0x5842c9){return db[_0x2d12('0x2a')]['describe']()[_0x2d12('0x22')](respondWithResult(_0x5842c9,null))[_0x2d12('0x46')](handleError(_0x5842c9,null));};
\ No newline at end of file
+var _0xd4b6=['end','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','pick','filter','where','merge','options','include','rows','show','params','includeAll','find','create','body','catch','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','json','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4b6,0xb9));var _0x6d4b=function(_0x450aa8,_0xa58ab3){_0x450aa8=_0x450aa8-0x0;var _0x584ce7=_0xd4b6[_0x450aa8];return _0x584ce7;};'use strict';var emlformat=require(_0x6d4b('0x0'));var rimraf=require(_0x6d4b('0x1'));var zipdir=require(_0x6d4b('0x2'));var jsonpatch=require(_0x6d4b('0x3'));var rp=require(_0x6d4b('0x4'));var moment=require(_0x6d4b('0x5'));var BPromise=require(_0x6d4b('0x6'));var Mustache=require(_0x6d4b('0x7'));var util=require(_0x6d4b('0x8'));var path=require('path');var sox=require(_0x6d4b('0x9'));var csv=require(_0x6d4b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d4b('0xb'));var _=require(_0x6d4b('0xc'));var squel=require(_0x6d4b('0xd'));var crypto=require('crypto');var jsforce=require(_0x6d4b('0xe'));var deskjs=require(_0x6d4b('0xf'));var toCsv=require(_0x6d4b('0xa'));var querystring=require(_0x6d4b('0x10'));var Papa=require('papaparse');var Redis=require(_0x6d4b('0x11'));var authService=require(_0x6d4b('0x12'));var qs=require(_0x6d4b('0x13'));var as=require(_0x6d4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d4b('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6d4b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf8550,_0x45bf86){_0x45bf86=_0x45bf86||0xcc;return function(_0x1b773b){if(_0x1b773b){return _0xf8550[_0x6d4b('0x17')](_0x45bf86);}return _0xf8550[_0x6d4b('0x18')](_0x45bf86)['end']();};}function respondWithResult(_0x62c916,_0x52505d){_0x52505d=_0x52505d||0xc8;return function(_0x4c5a4a){if(_0x4c5a4a){return _0x62c916[_0x6d4b('0x18')](_0x52505d)[_0x6d4b('0x19')](_0x4c5a4a);}};}function respondWithFilteredResult(_0x55ab2d,_0x5f2797){return function(_0x5137d3){if(_0x5137d3){var _0x5402d8=typeof _0x5f2797['offset']===_0x6d4b('0x1a')&&typeof _0x5f2797[_0x6d4b('0x1b')]===_0x6d4b('0x1a');var _0x58b767=_0x5137d3[_0x6d4b('0x1c')];var _0x3859ae=_0x5402d8?0x0:_0x5f2797['offset'];var _0x8fc6ba=_0x5402d8?_0x5137d3['count']:_0x5f2797['offset']+_0x5f2797['limit'];var _0x4ae156;if(_0x8fc6ba>=_0x58b767){_0x8fc6ba=_0x58b767;_0x4ae156=0xc8;}else{_0x4ae156=0xce;}_0x55ab2d[_0x6d4b('0x18')](_0x4ae156);return _0x55ab2d[_0x6d4b('0x1d')](_0x6d4b('0x1e'),_0x3859ae+'-'+_0x8fc6ba+'/'+_0x58b767)[_0x6d4b('0x19')](_0x5137d3);}return null;};}function patchUpdates(_0x23b2dc){return function(_0x25f577){try{jsonpatch['apply'](_0x25f577,_0x23b2dc,!![]);}catch(_0x1da71d){return BPromise[_0x6d4b('0x1f')](_0x1da71d);}return _0x25f577[_0x6d4b('0x20')]();};}function saveUpdates(_0x2e4556,_0x8e4554){return function(_0x41eb0d){if(_0x41eb0d){return _0x41eb0d['update'](_0x2e4556)[_0x6d4b('0x21')](function(_0x2d667d){return _0x2d667d;});}return null;};}function removeEntity(_0x1d0477,_0x4a370d){return function(_0x574b4f){if(_0x574b4f){return _0x574b4f['destroy']()[_0x6d4b('0x21')](function(){_0x1d0477['status'](0xcc)[_0x6d4b('0x22')]();});}};}function handleEntityNotFound(_0x482cc2,_0x50d77b){return function(_0x1fc793){if(!_0x1fc793){_0x482cc2[_0x6d4b('0x17')](0x194);}return _0x1fc793;};}function handleError(_0x3c38b8,_0x46a638){_0x46a638=_0x46a638||0x1f4;return function(_0x270041){logger[_0x6d4b('0x23')](_0x270041['stack']);if(_0x270041[_0x6d4b('0x24')]){delete _0x270041[_0x6d4b('0x24')];}_0x3c38b8[_0x6d4b('0x18')](_0x46a638)[_0x6d4b('0x25')](_0x270041);};}exports[_0x6d4b('0x26')]=function(_0x163306,_0x18659c){var _0x2c7274={},_0x73585b={},_0xbbd352={'count':0x0,'rows':[]};var _0x96c69d=_[_0x6d4b('0x27')](db[_0x6d4b('0x28')][_0x6d4b('0x29')],function(_0x39acc4){return{'name':_0x39acc4[_0x6d4b('0x2a')],'type':_0x39acc4[_0x6d4b('0x2b')][_0x6d4b('0x2c')]};});_0x73585b[_0x6d4b('0x2d')]=_[_0x6d4b('0x27')](_0x96c69d,_0x6d4b('0x24'));_0x73585b[_0x6d4b('0x2e')]=_[_0x6d4b('0x2f')](_0x163306[_0x6d4b('0x2e')]);_0x73585b[_0x6d4b('0x30')]=_[_0x6d4b('0x31')](_0x73585b[_0x6d4b('0x2d')],_0x73585b[_0x6d4b('0x2e')]);_0x2c7274[_0x6d4b('0x32')]=_['intersection'](_0x73585b[_0x6d4b('0x2d')],qs[_0x6d4b('0x33')](_0x163306[_0x6d4b('0x2e')][_0x6d4b('0x33')]));_0x2c7274[_0x6d4b('0x32')]=_0x2c7274[_0x6d4b('0x32')][_0x6d4b('0x34')]?_0x2c7274[_0x6d4b('0x32')]:_0x73585b[_0x6d4b('0x2d')];if(!_0x163306[_0x6d4b('0x2e')]['hasOwnProperty'](_0x6d4b('0x35'))){_0x2c7274[_0x6d4b('0x1b')]=qs[_0x6d4b('0x1b')](_0x163306[_0x6d4b('0x2e')][_0x6d4b('0x1b')]);_0x2c7274[_0x6d4b('0x36')]=qs[_0x6d4b('0x36')](_0x163306['query'][_0x6d4b('0x36')]);}_0x2c7274['order']=qs[_0x6d4b('0x37')](_0x163306[_0x6d4b('0x2e')][_0x6d4b('0x37')]);_0x2c7274['where']=qs[_0x6d4b('0x30')](_[_0x6d4b('0x38')](_0x163306[_0x6d4b('0x2e')],_0x73585b['filters']),_0x96c69d);if(_0x163306[_0x6d4b('0x2e')][_0x6d4b('0x39')]){_0x2c7274[_0x6d4b('0x3a')]=_[_0x6d4b('0x3b')](_0x2c7274['where'],{'$or':_[_0x6d4b('0x27')](_0x96c69d,function(_0x582956){if(_0x582956[_0x6d4b('0x2b')]!=='VIRTUAL'){var _0x40dfc8={};_0x40dfc8[_0x582956[_0x6d4b('0x24')]]={'$like':'%'+_0x163306[_0x6d4b('0x2e')][_0x6d4b('0x39')]+'%'};return _0x40dfc8;}})});}_0x2c7274=_['merge']({},_0x2c7274,_0x163306[_0x6d4b('0x3c')]);var _0x2f2697={'where':_0x2c7274['where']};return db['MailTransferReport'][_0x6d4b('0x1c')](_0x2f2697)[_0x6d4b('0x21')](function(_0x5367c6){_0xbbd352['count']=_0x5367c6;if(_0x163306['query']['includeAll']){_0x2c7274[_0x6d4b('0x3d')]=[{'all':!![]}];}return db[_0x6d4b('0x28')]['findAll'](_0x2c7274);})[_0x6d4b('0x21')](function(_0x2ef381){_0xbbd352[_0x6d4b('0x3e')]=_0x2ef381;return _0xbbd352;})[_0x6d4b('0x21')](respondWithFilteredResult(_0x18659c,_0x2c7274))['catch'](handleError(_0x18659c,null));};exports[_0x6d4b('0x3f')]=function(_0x39f41c,_0x333c33){var _0x2a5e06={'raw':!![],'where':{'id':_0x39f41c[_0x6d4b('0x40')]['id']}},_0x30d1ce={};_0x30d1ce['model']=_[_0x6d4b('0x2f')](db[_0x6d4b('0x28')][_0x6d4b('0x29')]);_0x30d1ce[_0x6d4b('0x2e')]=_[_0x6d4b('0x2f')](_0x39f41c[_0x6d4b('0x2e')]);_0x30d1ce[_0x6d4b('0x30')]=_[_0x6d4b('0x31')](_0x30d1ce['model'],_0x30d1ce[_0x6d4b('0x2e')]);_0x2a5e06[_0x6d4b('0x32')]=_['intersection'](_0x30d1ce['model'],qs[_0x6d4b('0x33')](_0x39f41c[_0x6d4b('0x2e')][_0x6d4b('0x33')]));_0x2a5e06['attributes']=_0x2a5e06[_0x6d4b('0x32')][_0x6d4b('0x34')]?_0x2a5e06[_0x6d4b('0x32')]:_0x30d1ce[_0x6d4b('0x2d')];if(_0x39f41c['query'][_0x6d4b('0x41')]){_0x2a5e06[_0x6d4b('0x3d')]=[{'all':!![]}];}_0x2a5e06=_[_0x6d4b('0x3b')]({},_0x2a5e06,_0x39f41c['options']);return db[_0x6d4b('0x28')][_0x6d4b('0x42')](_0x2a5e06)[_0x6d4b('0x21')](handleEntityNotFound(_0x333c33,null))['then'](respondWithResult(_0x333c33,null))['catch'](handleError(_0x333c33,null));};exports[_0x6d4b('0x43')]=function(_0x137b35,_0x3e87a0){return db[_0x6d4b('0x28')][_0x6d4b('0x43')](_0x137b35[_0x6d4b('0x44')],{})[_0x6d4b('0x21')](respondWithResult(_0x3e87a0,0xc9))[_0x6d4b('0x45')](handleError(_0x3e87a0,null));};exports[_0x6d4b('0x46')]=function(_0x2ca304,_0x423556){if(_0x2ca304[_0x6d4b('0x44')]['id']){delete _0x2ca304[_0x6d4b('0x44')]['id'];}return db[_0x6d4b('0x28')][_0x6d4b('0x42')]({'where':{'id':_0x2ca304[_0x6d4b('0x40')]['id']}})['then'](handleEntityNotFound(_0x423556,null))[_0x6d4b('0x21')](saveUpdates(_0x2ca304[_0x6d4b('0x44')],null))[_0x6d4b('0x21')](respondWithResult(_0x423556,null))['catch'](handleError(_0x423556,null));};exports[_0x6d4b('0x47')]=function(_0x1797ca,_0x4403bd){return db['MailTransferReport'][_0x6d4b('0x42')]({'where':{'id':_0x1797ca[_0x6d4b('0x40')]['id']}})['then'](handleEntityNotFound(_0x4403bd,null))['then'](removeEntity(_0x4403bd,null))['catch'](handleError(_0x4403bd,null));};exports[_0x6d4b('0x48')]=function(_0x22a125,_0x3c8a12){return db[_0x6d4b('0x28')][_0x6d4b('0x48')]()[_0x6d4b('0x21')](respondWithResult(_0x3c8a12,null))['catch'](handleError(_0x3c8a12,null));};
\ No newline at end of file
index a85d2c9..06f3330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59cf=['exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','path','rimraf','../../config/environment'];(function(_0xcb1100,_0x2354a7){var _0xb144de=function(_0x3bc9ee){while(--_0x3bc9ee){_0xcb1100['push'](_0xcb1100['shift']());}};_0xb144de(++_0x2354a7);}(_0x59cf,0x158));var _0xf59c=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x59cf[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0xf59c('0x0'));var util=require(_0xf59c('0x1'));var logger=require(_0xf59c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf59c('0x3'));var rimraf=require(_0xf59c('0x4'));var config=require(_0xf59c('0x5'));var attributes=require('./mailTransferReport.attributes');module[_0xf59c('0x6')]=function(_0x584078,_0x13e2de){return _0x584078[_0xf59c('0x7')]('MailTransferReport',attributes,{'tableName':_0xf59c('0x8'),'paranoid':![],'indexes':[{'name':_0xf59c('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2dde=['path','../../config/environment','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x134697,_0x339836){var _0x4e7369=function(_0x6d0a73){while(--_0x6d0a73){_0x134697['push'](_0x134697['shift']());}};_0x4e7369(++_0x339836);}(_0x2dde,0x19a));var _0xe2dd=function(_0x3a4b9d,_0x26b92a){_0x3a4b9d=_0x3a4b9d-0x0;var _0x4ab7dd=_0x2dde[_0x3a4b9d];return _0x4ab7dd;};'use strict';var _=require(_0xe2dd('0x0'));var util=require(_0xe2dd('0x1'));var logger=require(_0xe2dd('0x2'))(_0xe2dd('0x3'));var moment=require(_0xe2dd('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2dd('0x5'));var fs=require('fs');var path=require(_0xe2dd('0x6'));var rimraf=require('rimraf');var config=require(_0xe2dd('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xe2dd('0x8')]=function(_0x35a460,_0x1fffc1){return _0x35a460[_0xe2dd('0x9')](_0xe2dd('0xa'),attributes,{'tableName':_0xe2dd('0xb'),'paranoid':![],'indexes':[{'name':_0xe2dd('0xc'),'fields':[_0xe2dd('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0550f83..75612e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a1e=['http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5797f0,_0x3955c0){var _0x506bce=function(_0x108eff){while(--_0x108eff){_0x5797f0['push'](_0x5797f0['shift']());}};_0x506bce(++_0x3955c0);}(_0x5a1e,0x69));var _0xe5a1=function(_0xbabce1,_0x36f0ca){_0xbabce1=_0xbabce1-0x0;var _0x438df0=_0x5a1e[_0xbabce1];return _0x438df0;};'use strict';var _=require(_0xe5a1('0x0'));var util=require('util');var moment=require(_0xe5a1('0x1'));var BPromise=require('bluebird');var rs=require(_0xe5a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5a1('0x3'))['db'];var utils=require(_0xe5a1('0x4'));var logger=require(_0xe5a1('0x5'))('rpc');var config=require(_0xe5a1('0x6'));var jayson=require(_0xe5a1('0x7'));var client=jayson[_0xe5a1('0x8')][_0xe5a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x331841,_0x1ab35e,_0x21a9e3){return new BPromise(function(_0x3bb0d,_0x8e39f){return client[_0xe5a1('0xa')](_0x331841,_0x21a9e3)[_0xe5a1('0xb')](function(_0x140c87){logger[_0xe5a1('0xc')](_0xe5a1('0xd'),_0x1ab35e,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1ab35e,_0xe5a1('0xe'),JSON['stringify'](_0x140c87));if(_0x140c87[_0xe5a1('0xf')]){if(_0x140c87['error'][_0xe5a1('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1ab35e,_0x140c87[_0xe5a1('0xf')][_0xe5a1('0x11')]);return _0x8e39f(_0x140c87[_0xe5a1('0xf')][_0xe5a1('0x11')]);}logger['error'](_0xe5a1('0xd'),_0x1ab35e,_0x140c87['error'][_0xe5a1('0x11')]);return _0x3bb0d(_0x140c87['error'][_0xe5a1('0x11')]);}else{logger['info'](_0xe5a1('0xd'),_0x1ab35e,_0xe5a1('0xe'));_0x3bb0d(_0x140c87[_0xe5a1('0x12')][_0xe5a1('0x11')]);}})['catch'](function(_0x3c66ea){logger[_0xe5a1('0xf')](_0xe5a1('0xd'),_0x1ab35e,_0x3c66ea);_0x8e39f(_0x3c66ea);});});}
\ No newline at end of file
+var _0x1be6=['then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request'];(function(_0x1ceda8,_0xdaf79d){var _0x35668c=function(_0x2ecc2b){while(--_0x2ecc2b){_0x1ceda8['push'](_0x1ceda8['shift']());}};_0x35668c(++_0xdaf79d);}(_0x1be6,0x8f));var _0x61be=function(_0x30a915,_0x24ed01){_0x30a915=_0x30a915-0x0;var _0xdd54fa=_0x1be6[_0x30a915];return _0xdd54fa;};'use strict';var _=require(_0x61be('0x0'));var util=require(_0x61be('0x1'));var moment=require(_0x61be('0x2'));var BPromise=require(_0x61be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61be('0x4'));var db=require(_0x61be('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x61be('0x6'));var config=require(_0x61be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x61be('0x8')][_0x61be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56ce88,_0x14f929,_0x57733a){return new BPromise(function(_0x1f5cb3,_0xbb88c1){return client[_0x61be('0xa')](_0x56ce88,_0x57733a)[_0x61be('0xb')](function(_0x56ab67){logger[_0x61be('0xc')](_0x61be('0xd'),_0x14f929,_0x61be('0xe'));logger[_0x61be('0xf')](_0x61be('0x10'),_0x14f929,_0x61be('0xe'),JSON['stringify'](_0x56ab67));if(_0x56ab67['error']){if(_0x56ab67[_0x61be('0x11')][_0x61be('0x12')]===0x1f4){logger[_0x61be('0x11')](_0x61be('0xd'),_0x14f929,_0x56ab67[_0x61be('0x11')][_0x61be('0x13')]);return _0xbb88c1(_0x56ab67['error']['message']);}logger[_0x61be('0x11')](_0x61be('0xd'),_0x14f929,_0x56ab67[_0x61be('0x11')]['message']);return _0x1f5cb3(_0x56ab67[_0x61be('0x11')][_0x61be('0x13')]);}else{logger[_0x61be('0xc')](_0x61be('0xd'),_0x14f929,_0x61be('0xe'));_0x1f5cb3(_0x56ab67[_0x61be('0x14')][_0x61be('0x13')]);}})[_0x61be('0x15')](function(_0x574a11){logger[_0x61be('0x11')](_0x61be('0xd'),_0x14f929,_0x574a11);_0xbb88c1(_0x574a11);});});}
\ No newline at end of file
index fd01dca..cdbb779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb85b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','destroy','exports'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0xb85b,0x88));var _0xbb85=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xb85b[_0x46e363];return _0x3fb059;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbb85('0x0'));var timeout=require(_0xbb85('0x1'));var express=require(_0xbb85('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb85('0x3'));var interaction=require(_0xbb85('0x4'));var config=require(_0xbb85('0x5'));var controller=require(_0xbb85('0x6'));router[_0xbb85('0x7')]('/',auth[_0xbb85('0x8')](),controller[_0xbb85('0x9')]);router[_0xbb85('0x7')](_0xbb85('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller['show']);router[_0xbb85('0xc')]('/',auth[_0xbb85('0x8')](),controller[_0xbb85('0xd')]);router['put'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller[_0xbb85('0xe')]);router['delete'](_0xbb85('0xb'),auth[_0xbb85('0x8')](),controller[_0xbb85('0xf')]);module[_0xbb85('0x10')]=router;
\ No newline at end of file
+var _0x05d0=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x05d0,0x1d3));var _0x005d=function(_0xf29643,_0x405aa6){_0xf29643=_0xf29643-0x0;var _0x2dd9cf=_0x05d0[_0xf29643];return _0x2dd9cf;};'use strict';var multer=require(_0x005d('0x0'));var util=require(_0x005d('0x1'));var path=require(_0x005d('0x2'));var timeout=require(_0x005d('0x3'));var express=require(_0x005d('0x4'));var router=express['Router']();var fs_extra=require(_0x005d('0x5'));var auth=require(_0x005d('0x6'));var interaction=require(_0x005d('0x7'));var config=require(_0x005d('0x8'));var controller=require(_0x005d('0x9'));router[_0x005d('0xa')]('/',auth['isAuthenticated'](),controller[_0x005d('0xb')]);router[_0x005d('0xa')](_0x005d('0xc'),auth[_0x005d('0xd')](),controller[_0x005d('0xe')]);router[_0x005d('0xa')](_0x005d('0xf'),auth[_0x005d('0xd')](),controller[_0x005d('0x10')]);router[_0x005d('0x11')]('/',auth['isAuthenticated'](),controller[_0x005d('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x005d('0x13')]);router[_0x005d('0x14')](_0x005d('0xf'),auth[_0x005d('0xd')](),controller[_0x005d('0x15')]);module[_0x005d('0x16')]=router;
\ No newline at end of file
index 90abdea..298aa53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94dc=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','exports','STRING'];(function(_0xc81e7a,_0x32893f){var _0x505c78=function(_0x44781f){while(--_0x44781f){_0xc81e7a['push'](_0xc81e7a['shift']());}};_0x505c78(++_0x32893f);}(_0x94dc,0xb1));var _0xc94d=function(_0x21141e,_0x1fab14){_0x21141e=_0x21141e-0x0;var _0x277ce5=_0x94dc[_0x21141e];return _0x277ce5;};'use strict';var Sequelize=require(_0xc94d('0x0'));var moment=require('moment');module[_0xc94d('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc94d('0x2')]},'interface':{'type':Sequelize[_0xc94d('0x2')]},'type':{'type':Sequelize[_0xc94d('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xc94d('0x3')},'duration':{'type':Sequelize[_0xc94d('0x4')]},'enterAt':{'type':Sequelize[_0xc94d('0x5')]},'exitAt':{'type':Sequelize[_0xc94d('0x5')],'set':function(_0x3c0601){var _0x344188=moment(_0x3c0601);var _0xb7275c=moment(this['getDataValue'](_0xc94d('0x6')));var _0xbe5904=_0x344188[_0xc94d('0x7')](_0xb7275c,_0xc94d('0x8'));this[_0xc94d('0x9')]('exitAt',_0x3c0601);this[_0xc94d('0x9')](_0xc94d('0xa'),_0xbe5904||null);}},'data1':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xb')},'data2':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0xc94d('0xd')},'data4':{'type':Sequelize[_0xc94d('0x2')],'comment':_0xc94d('0xe')},'data5':{'type':Sequelize[_0xc94d('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xc94d('0x2')]}};
\ No newline at end of file
+var _0xc997=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x1f4435,_0x18e6dc){var _0x2b4dc4=function(_0xd6d584){while(--_0xd6d584){_0x1f4435['push'](_0x1f4435['shift']());}};_0x2b4dc4(++_0x18e6dc);}(_0xc997,0x1ac));var _0x7c99=function(_0x564c18,_0x114836){_0x564c18=_0x564c18-0x0;var _0x165ac8=_0xc997[_0x564c18];return _0x165ac8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7c99('0x0'));module[_0x7c99('0x1')]={'channel':{'type':Sequelize[_0x7c99('0x2')]},'membername':{'type':Sequelize[_0x7c99('0x2')]},'interface':{'type':Sequelize[_0x7c99('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x7c99('0x3'),'comment':_0x7c99('0x4')},'duration':{'type':Sequelize[_0x7c99('0x5')]},'enterAt':{'type':Sequelize[_0x7c99('0x6')]},'exitAt':{'type':Sequelize[_0x7c99('0x6')],'set':function(_0x404ffb){var _0x1a21e1=moment(_0x404ffb);var _0x36955c=moment(this['getDataValue'](_0x7c99('0x7')));var _0x33fd86=_0x1a21e1[_0x7c99('0x8')](_0x36955c,'seconds');this[_0x7c99('0x9')](_0x7c99('0xa'),_0x404ffb);this['setDataValue'](_0x7c99('0xb'),_0x33fd86||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7c99('0xc')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x7c99('0x2')],'comment':_0x7c99('0xd')},'data4':{'type':Sequelize[_0x7c99('0x2')],'comment':_0x7c99('0xe')},'data5':{'type':Sequelize[_0x7c99('0x2')],'comment':_0x7c99('0xf')},'role':{'type':Sequelize[_0x7c99('0x2')]},'internal':{'type':Sequelize[_0x7c99('0x5')]},'uniqueid':{'type':Sequelize[_0x7c99('0x2')]}};
\ No newline at end of file
index 2287506..f89d7c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x34e8,0x12c));var _0x834e=function(_0x141054,_0x2fcf1e){_0x141054=_0x141054-0x0;var _0x46f273=_0x34e8[_0x141054];return _0x46f273;};'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
+var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ca,0x126));var _0xa55c=function(_0x3108d9,_0xf08d6){_0x3108d9=_0x3108d9-0x0;var _0x1455e6=_0x55ca[_0x3108d9];return _0x1455e6;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
index 355a726..f4bf48a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd663=['membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','membername_interface'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xd663,0xf0));var _0x3d66=function(_0x467dd0,_0x45fc18){_0x467dd0=_0x467dd0-0x0;var _0x5d6e36=_0xd663[_0x467dd0];return _0x5d6e36;};'use strict';var _=require(_0x3d66('0x0'));var util=require(_0x3d66('0x1'));var logger=require(_0x3d66('0x2'))('api');var moment=require(_0x3d66('0x3'));var BPromise=require(_0x3d66('0x4'));var rp=require(_0x3d66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d66('0x6'));var config=require(_0x3d66('0x7'));var attributes=require(_0x3d66('0x8'));module['exports']=function(_0x3e0562,_0x1b8315){return _0x3e0562[_0x3d66('0x9')](_0x3d66('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x3d66('0xb'),'fields':[_0x3d66('0xc'),_0x3d66('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5398=['membername','interface','util','../../config/logger','api','moment','bluebird','request-promise','path','./memberReport.attributes','exports','define','MemberReport','membername_interface'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x5398,0xe2));var _0x8539=function(_0x42ecb5,_0x20b4d2){_0x42ecb5=_0x42ecb5-0x0;var _0x487442=_0x5398[_0x42ecb5];return _0x487442;};'use strict';var _=require('lodash');var util=require(_0x8539('0x0'));var logger=require(_0x8539('0x1'))(_0x8539('0x2'));var moment=require(_0x8539('0x3'));var BPromise=require(_0x8539('0x4'));var rp=require(_0x8539('0x5'));var fs=require('fs');var path=require(_0x8539('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8539('0x7'));module[_0x8539('0x8')]=function(_0x14ddc9,_0xcca1c0){return _0x14ddc9[_0x8539('0x9')](_0x8539('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x8539('0xb'),'fields':[_0x8539('0xc'),_0x8539('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 45f963f..1c6af3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6011=['code','message','result','GetMemberReport','MemberReport','options','raw','where','attributes','limit','map','model','include','debug','stringify','catch','create','body','CreateMemberReport','update','UpdateMemberReport','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','error'];(function(_0x29beb4,_0x3e9f4c){var _0x1770e0=function(_0x2d2a30){while(--_0x2d2a30){_0x29beb4['push'](_0x29beb4['shift']());}};_0x1770e0(++_0x3e9f4c);}(_0x6011,0x196));var _0x1601=function(_0xf02bd6,_0x247382){_0xf02bd6=_0xf02bd6-0x0;var _0x224799=_0x6011[_0xf02bd6];return _0x224799;};'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(_0x1601('0x0'));var db=require(_0x1601('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x1601('0x2'))(_0x1601('0x3'));var config=require(_0x1601('0x4'));var jayson=require(_0x1601('0x5'));var client=jayson[_0x1601('0x6')][_0x1601('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x277bfc,_0x1e7cf6,_0x18e06c){return new BPromise(function(_0x99dee1,_0x55b751){return client[_0x1601('0x8')](_0x277bfc,_0x18e06c)[_0x1601('0x9')](function(_0x1e3488){logger[_0x1601('0xa')](_0x1601('0xb'),_0x1e7cf6,'request\x20sent');logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1e7cf6,_0x1601('0xc'),JSON['stringify'](_0x1e3488));if(_0x1e3488[_0x1601('0xd')]){if(_0x1e3488[_0x1601('0xd')][_0x1601('0xe')]===0x1f4){logger[_0x1601('0xd')](_0x1601('0xb'),_0x1e7cf6,_0x1e3488[_0x1601('0xd')][_0x1601('0xf')]);return _0x55b751(_0x1e3488[_0x1601('0xd')]['message']);}logger[_0x1601('0xd')]('MemberReport,\x20%s,\x20%s',_0x1e7cf6,_0x1e3488[_0x1601('0xd')]['message']);return _0x99dee1(_0x1e3488[_0x1601('0xd')][_0x1601('0xf')]);}else{logger['info'](_0x1601('0xb'),_0x1e7cf6,_0x1601('0xc'));_0x99dee1(_0x1e3488[_0x1601('0x10')]['message']);}})['catch'](function(_0x24c0ab){logger[_0x1601('0xd')](_0x1601('0xb'),_0x1e7cf6,_0x24c0ab);_0x55b751(_0x24c0ab);});});}exports[_0x1601('0x11')]=function(_0x1d8563){var _0x302350=this;return new Promise(function(_0x23b992,_0x3ae0c6){return db[_0x1601('0x12')]['findAll']({'raw':_0x1d8563['options']?_0x1d8563[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![],'where':_0x1d8563[_0x1601('0x13')]?_0x1d8563['options'][_0x1601('0x15')]||null:null,'attributes':_0x1d8563[_0x1601('0x13')]?_0x1d8563[_0x1601('0x13')][_0x1601('0x16')]||null:null,'limit':_0x1d8563[_0x1601('0x13')]?_0x1d8563['options'][_0x1601('0x17')]||null:null,'include':_0x1d8563[_0x1601('0x13')]?_0x1d8563[_0x1601('0x13')]['include']?_[_0x1601('0x18')](_0x1d8563[_0x1601('0x13')]['include'],function(_0x2b01da){return{'model':db[_0x2b01da[_0x1601('0x19')]],'as':_0x2b01da['as'],'attributes':_0x2b01da['attributes'],'include':_0x2b01da['include']?_[_0x1601('0x18')](_0x2b01da[_0x1601('0x1a')],function(_0x34d021){return{'model':db[_0x34d021['model']],'as':_0x34d021['as'],'attributes':_0x34d021[_0x1601('0x16')],'include':_0x34d021[_0x1601('0x1a')]?_[_0x1601('0x18')](_0x34d021[_0x1601('0x1a')],function(_0x296c34){return{'model':db[_0x296c34['model']],'as':_0x296c34['as'],'attributes':_0x296c34['attributes']};}):[]};}):[]};}):[]:[]})[_0x1601('0x9')](function(_0x1aef35){logger[_0x1601('0xa')]('GetMemberReport',_0x1d8563);logger[_0x1601('0x1b')]('GetMemberReport',_0x1d8563,JSON[_0x1601('0x1c')](_0x1aef35));_0x23b992(_0x1aef35);})[_0x1601('0x1d')](function(_0x389f0f){logger['error'](_0x1601('0x11'),_0x389f0f[_0x1601('0xf')],_0x1d8563);_0x3ae0c6(_0x302350[_0x1601('0xd')](0x1f4,_0x389f0f[_0x1601('0xf')]));});});};exports['CreateMemberReport']=function(_0x32740e){var _0x3ef6a7=this;return new Promise(function(_0x2a4ef9,_0x224a1c){return db[_0x1601('0x12')][_0x1601('0x1e')](_0x32740e[_0x1601('0x1f')],{'raw':_0x32740e[_0x1601('0x13')]?_0x32740e[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![]})[_0x1601('0x9')](function(_0x46050f){logger[_0x1601('0xa')]('CreateMemberReport',_0x32740e);logger[_0x1601('0x1b')](_0x1601('0x20'),_0x32740e,JSON[_0x1601('0x1c')](_0x46050f));_0x2a4ef9(_0x46050f);})[_0x1601('0x1d')](function(_0x3a350d){logger['error'](_0x1601('0x20'),_0x3a350d[_0x1601('0xf')],_0x32740e);_0x224a1c(_0x3ef6a7['error'](0x1f4,_0x3a350d[_0x1601('0xf')]));});});};exports['UpdateMemberReport']=function(_0x3a92d9){var _0x39e89f=this;return new Promise(function(_0x4b2f6c,_0x7a11dd){return db[_0x1601('0x12')][_0x1601('0x21')](_0x3a92d9[_0x1601('0x1f')],{'raw':_0x3a92d9[_0x1601('0x13')]?_0x3a92d9[_0x1601('0x13')][_0x1601('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a92d9['options']?_0x3a92d9[_0x1601('0x13')][_0x1601('0x15')]||null:null,'attributes':_0x3a92d9['options']?_0x3a92d9['options'][_0x1601('0x16')]||null:null,'limit':_0x3a92d9[_0x1601('0x13')]?_0x3a92d9[_0x1601('0x13')][_0x1601('0x17')]||null:null})[_0x1601('0x9')](function(_0x2a585b){logger[_0x1601('0xa')]('UpdateMemberReport',_0x3a92d9);logger[_0x1601('0x1b')](_0x1601('0x22'),_0x3a92d9,JSON['stringify'](_0x2a585b));_0x4b2f6c(_0x2a585b);})['catch'](function(_0x3f0522){logger['error']('UpdateMemberReport',_0x3f0522['message'],_0x3a92d9);_0x7a11dd(_0x39e89f[_0x1601('0xd')](0x1f4,_0x3f0522[_0x1601('0xf')]));});});};
\ No newline at end of file
+var _0xe5e3=['http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','raw','limit','include','map','attributes','model','stringify','CreateMemberReport','body','update','where','UpdateMemberReport','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2ee19b,_0x3fd95b){var _0x5586cf=function(_0x53dd6c){while(--_0x53dd6c){_0x2ee19b['push'](_0x2ee19b['shift']());}};_0x5586cf(++_0x3fd95b);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x489e9d,_0x4d525d){_0x489e9d=_0x489e9d-0x0;var _0x49fc64=_0xe5e3[_0x489e9d];return _0x49fc64;};'use strict';var _=require('lodash');var util=require(_0x3e5e('0x0'));var moment=require(_0x3e5e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e5e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e5e('0x3'));var logger=require(_0x3e5e('0x4'))('rpc');var config=require(_0x3e5e('0x5'));var jayson=require(_0x3e5e('0x6'));var client=jayson['client'][_0x3e5e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x56d1d8,_0x2f5735,_0x4971da){return new BPromise(function(_0x309cac,_0x1260c0){return client[_0x3e5e('0x8')](_0x56d1d8,_0x4971da)[_0x3e5e('0x9')](function(_0x2d6513){logger[_0x3e5e('0xa')](_0x3e5e('0xb'),_0x2f5735,_0x3e5e('0xc'));logger[_0x3e5e('0xd')](_0x3e5e('0xe'),_0x2f5735,_0x3e5e('0xc'),JSON['stringify'](_0x2d6513));if(_0x2d6513[_0x3e5e('0xf')]){if(_0x2d6513[_0x3e5e('0xf')][_0x3e5e('0x10')]===0x1f4){logger[_0x3e5e('0xf')](_0x3e5e('0xb'),_0x2f5735,_0x2d6513[_0x3e5e('0xf')][_0x3e5e('0x11')]);return _0x1260c0(_0x2d6513[_0x3e5e('0xf')][_0x3e5e('0x11')]);}logger[_0x3e5e('0xf')](_0x3e5e('0xb'),_0x2f5735,_0x2d6513[_0x3e5e('0xf')][_0x3e5e('0x11')]);return _0x309cac(_0x2d6513[_0x3e5e('0xf')]['message']);}else{logger[_0x3e5e('0xa')](_0x3e5e('0xb'),_0x2f5735,'request\x20sent');_0x309cac(_0x2d6513['result'][_0x3e5e('0x11')]);}})[_0x3e5e('0x12')](function(_0x1b9a8a){logger[_0x3e5e('0xf')](_0x3e5e('0xb'),_0x2f5735,_0x1b9a8a);_0x1260c0(_0x1b9a8a);});});}exports[_0x3e5e('0x13')]=function(_0xcba431){var _0x5d84b7=this;return new Promise(function(_0x229977,_0x859854){return db[_0x3e5e('0x14')][_0x3e5e('0x15')]({'raw':_0xcba431[_0x3e5e('0x16')]?_0xcba431[_0x3e5e('0x16')][_0x3e5e('0x17')]===undefined?!![]:![]:!![],'where':_0xcba431['options']?_0xcba431['options']['where']||null:null,'attributes':_0xcba431[_0x3e5e('0x16')]?_0xcba431[_0x3e5e('0x16')]['attributes']||null:null,'limit':_0xcba431['options']?_0xcba431[_0x3e5e('0x16')][_0x3e5e('0x18')]||null:null,'include':_0xcba431[_0x3e5e('0x16')]?_0xcba431[_0x3e5e('0x16')][_0x3e5e('0x19')]?_[_0x3e5e('0x1a')](_0xcba431[_0x3e5e('0x16')][_0x3e5e('0x19')],function(_0x457db9){return{'model':db[_0x457db9['model']],'as':_0x457db9['as'],'attributes':_0x457db9[_0x3e5e('0x1b')],'include':_0x457db9[_0x3e5e('0x19')]?_[_0x3e5e('0x1a')](_0x457db9[_0x3e5e('0x19')],function(_0x4c4067){return{'model':db[_0x4c4067[_0x3e5e('0x1c')]],'as':_0x4c4067['as'],'attributes':_0x4c4067[_0x3e5e('0x1b')],'include':_0x4c4067[_0x3e5e('0x19')]?_[_0x3e5e('0x1a')](_0x4c4067[_0x3e5e('0x19')],function(_0x37a02c){return{'model':db[_0x37a02c[_0x3e5e('0x1c')]],'as':_0x37a02c['as'],'attributes':_0x37a02c[_0x3e5e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a018f){logger[_0x3e5e('0xa')](_0x3e5e('0x13'),_0xcba431);logger[_0x3e5e('0xd')]('GetMemberReport',_0xcba431,JSON[_0x3e5e('0x1d')](_0x5a018f));_0x229977(_0x5a018f);})['catch'](function(_0x412b2c){logger[_0x3e5e('0xf')](_0x3e5e('0x13'),_0x412b2c[_0x3e5e('0x11')],_0xcba431);_0x859854(_0x5d84b7[_0x3e5e('0xf')](0x1f4,_0x412b2c[_0x3e5e('0x11')]));});});};exports[_0x3e5e('0x1e')]=function(_0x166097){var _0x7a1216=this;return new Promise(function(_0x37fac5,_0x32bb84){return db[_0x3e5e('0x14')]['create'](_0x166097[_0x3e5e('0x1f')],{'raw':_0x166097[_0x3e5e('0x16')]?_0x166097[_0x3e5e('0x16')][_0x3e5e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x203ac2){logger[_0x3e5e('0xa')]('CreateMemberReport',_0x166097);logger[_0x3e5e('0xd')](_0x3e5e('0x1e'),_0x166097,JSON[_0x3e5e('0x1d')](_0x203ac2));_0x37fac5(_0x203ac2);})[_0x3e5e('0x12')](function(_0x585703){logger[_0x3e5e('0xf')](_0x3e5e('0x1e'),_0x585703[_0x3e5e('0x11')],_0x166097);_0x32bb84(_0x7a1216[_0x3e5e('0xf')](0x1f4,_0x585703[_0x3e5e('0x11')]));});});};exports['UpdateMemberReport']=function(_0x5774a9){var _0x1a0871=this;return new Promise(function(_0x2ff13d,_0x469e5f){return db['MemberReport'][_0x3e5e('0x20')](_0x5774a9[_0x3e5e('0x1f')],{'raw':_0x5774a9[_0x3e5e('0x16')]?_0x5774a9['options'][_0x3e5e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5774a9[_0x3e5e('0x16')]?_0x5774a9['options'][_0x3e5e('0x21')]||null:null,'attributes':_0x5774a9[_0x3e5e('0x16')]?_0x5774a9[_0x3e5e('0x16')][_0x3e5e('0x1b')]||null:null,'limit':_0x5774a9[_0x3e5e('0x16')]?_0x5774a9[_0x3e5e('0x16')][_0x3e5e('0x18')]||null:null})[_0x3e5e('0x9')](function(_0x2412ed){logger['info'](_0x3e5e('0x22'),_0x5774a9);logger['debug'](_0x3e5e('0x22'),_0x5774a9,JSON[_0x3e5e('0x1d')](_0x2412ed));_0x2ff13d(_0x2412ed);})[_0x3e5e('0x12')](function(_0x54c832){logger['error'](_0x3e5e('0x22'),_0x54c832['message'],_0x5774a9);_0x469e5f(_0x1a0871[_0x3e5e('0xf')](0x1f4,_0x54c832[_0x3e5e('0x11')]));});});};
\ No newline at end of file
index 4b9ba35..75b5f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x164f=['../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x484225,_0x10e811){var _0x17dbf9=function(_0x5e6950){while(--_0x5e6950){_0x484225['push'](_0x484225['shift']());}};_0x17dbf9(++_0x10e811);}(_0x164f,0x186));var _0xf164=function(_0x515108,_0x303eb8){_0x515108=_0x515108-0x0;var _0x3d5145=_0x164f[_0x515108];return _0x3d5145;};'use strict';var multer=require('multer');var util=require(_0xf164('0x0'));var path=require(_0xf164('0x1'));var timeout=require(_0xf164('0x2'));var express=require(_0xf164('0x3'));var router=express[_0xf164('0x4')]();var fs_extra=require(_0xf164('0x5'));var auth=require(_0xf164('0x6'));var interaction=require(_0xf164('0x7'));var config=require('../../config/environment');var controller=require(_0xf164('0x8'));router[_0xf164('0x9')]('/',controller[_0xf164('0xa')]);module[_0xf164('0xb')]=router;
\ No newline at end of file
+var _0xc7e7=['../../config/environment','./migration.controller','index','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3730c6,_0x5625ed){var _0xc7cded=function(_0x2ed98a){while(--_0x2ed98a){_0x3730c6['push'](_0x3730c6['shift']());}};_0xc7cded(++_0x5625ed);}(_0xc7e7,0x13a));var _0x7c7e=function(_0x1932f1,_0x482b40){_0x1932f1=_0x1932f1-0x0;var _0x2a92a5=_0xc7e7[_0x1932f1];return _0x2a92a5;};'use strict';var multer=require('multer');var util=require(_0x7c7e('0x0'));var path=require(_0x7c7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c7e('0x2'));var router=express[_0x7c7e('0x3')]();var fs_extra=require(_0x7c7e('0x4'));var auth=require(_0x7c7e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7c7e('0x6'));var controller=require(_0x7c7e('0x7'));router['get']('/',controller[_0x7c7e('0x8')]);module[_0x7c7e('0x9')]=router;
\ No newline at end of file
index 93afb94..c7ffe7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8810=['exports','version','sequelize'];(function(_0x1327f7,_0x15950c){var _0x328b8f=function(_0x47bfbc){while(--_0x47bfbc){_0x1327f7['push'](_0x1327f7['shift']());}};_0x328b8f(++_0x15950c);}(_0x8810,0x19a));var _0x0881=function(_0x254f7c,_0x3e7aae){_0x254f7c=_0x254f7c-0x0;var _0x418615=_0x8810[_0x254f7c];return _0x418615;};'use strict';var Sequelize=require(_0x0881('0x0'));module[_0x0881('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x0881('0x2')}};
\ No newline at end of file
+var _0x4550=['exports','STRING','version','sequelize'];(function(_0x103f6a,_0x1f18ee){var _0x333422=function(_0x2ff34a){while(--_0x2ff34a){_0x103f6a['push'](_0x103f6a['shift']());}};_0x333422(++_0x1f18ee);}(_0x4550,0x11f));var _0x0455=function(_0x2ed176,_0x1d3e64){_0x2ed176=_0x2ed176-0x0;var _0x10f61a=_0x4550[_0x2ed176];return _0x10f61a;};'use strict';var Sequelize=require(_0x0455('0x0'));module[_0x0455('0x1')]={'version':{'type':Sequelize[_0x0455('0x2')],'unique':_0x0455('0x3')}};
\ No newline at end of file
index 8e836d9..7d41d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32a5=['index','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Migration','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','error','name'];(function(_0x577beb,_0x196407){var _0x3cac54=function(_0x2fcdaf){while(--_0x2fcdaf){_0x577beb['push'](_0x577beb['shift']());}};_0x3cac54(++_0x196407);}(_0x32a5,0xe8));var _0x532a=function(_0x13d7ff,_0x598d69){_0x13d7ff=_0x13d7ff-0x0;var _0x567dc3=_0x32a5[_0x13d7ff];return _0x567dc3;};'use strict';var emlformat=require(_0x532a('0x0'));var rimraf=require(_0x532a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x532a('0x2'));var rp=require(_0x532a('0x3'));var moment=require('moment');var BPromise=require(_0x532a('0x4'));var Mustache=require(_0x532a('0x5'));var util=require(_0x532a('0x6'));var path=require(_0x532a('0x7'));var sox=require('sox');var csv=require(_0x532a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x532a('0x9'));var _=require(_0x532a('0xa'));var squel=require(_0x532a('0xb'));var crypto=require(_0x532a('0xc'));var jsforce=require(_0x532a('0xd'));var deskjs=require(_0x532a('0xe'));var toCsv=require(_0x532a('0x8'));var querystring=require(_0x532a('0xf'));var Papa=require(_0x532a('0x10'));var Redis=require(_0x532a('0x11'));var authService=require(_0x532a('0x12'));var qs=require(_0x532a('0x13'));var as=require(_0x532a('0x14'));var hardwareService=require(_0x532a('0x15'));var logger=require(_0x532a('0x16'))('api');var utils=require(_0x532a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x532a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45e52a,_0x336590){_0x336590=_0x336590||0xcc;return function(_0x19d2ed){if(_0x19d2ed){return _0x45e52a[_0x532a('0x19')](_0x336590);}return _0x45e52a[_0x532a('0x1a')](_0x336590)[_0x532a('0x1b')]();};}function respondWithResult(_0x20714e,_0x4e0db0){_0x4e0db0=_0x4e0db0||0xc8;return function(_0x434336){if(_0x434336){return _0x20714e[_0x532a('0x1a')](_0x4e0db0)[_0x532a('0x1c')](_0x434336);}};}function respondWithFilteredResult(_0x2bf449,_0x41da44){return function(_0x2ea76b){if(_0x2ea76b){var _0x3db89c=typeof _0x41da44[_0x532a('0x1d')]==='undefined'&&typeof _0x41da44[_0x532a('0x1e')]===_0x532a('0x1f');var _0x345ae9=_0x2ea76b[_0x532a('0x20')];var _0x2b4dd6=_0x3db89c?0x0:_0x41da44['offset'];var _0x292ff0=_0x3db89c?_0x2ea76b['count']:_0x41da44[_0x532a('0x1d')]+_0x41da44[_0x532a('0x1e')];var _0x148e70;if(_0x292ff0>=_0x345ae9){_0x292ff0=_0x345ae9;_0x148e70=0xc8;}else{_0x148e70=0xce;}_0x2bf449[_0x532a('0x1a')](_0x148e70);return _0x2bf449[_0x532a('0x21')](_0x532a('0x22'),_0x2b4dd6+'-'+_0x292ff0+'/'+_0x345ae9)[_0x532a('0x1c')](_0x2ea76b);}return null;};}function patchUpdates(_0x5b927c){return function(_0x4c7084){try{jsonpatch[_0x532a('0x23')](_0x4c7084,_0x5b927c,!![]);}catch(_0x532b9e){return BPromise['reject'](_0x532b9e);}return _0x4c7084[_0x532a('0x24')]();};}function saveUpdates(_0x509de1,_0x2093c8){return function(_0x5a27e6){if(_0x5a27e6){return _0x5a27e6['update'](_0x509de1)[_0x532a('0x25')](function(_0x225c00){return _0x225c00;});}return null;};}function removeEntity(_0x3a7794,_0x54cd04){return function(_0x3355b3){if(_0x3355b3){return _0x3355b3['destroy']()[_0x532a('0x25')](function(){_0x3a7794[_0x532a('0x1a')](0xcc)[_0x532a('0x1b')]();});}};}function handleEntityNotFound(_0x8f0634,_0x2d12e6){return function(_0x3d67be){if(!_0x3d67be){_0x8f0634[_0x532a('0x19')](0x194);}return _0x3d67be;};}function handleError(_0x4975cf,_0x4258e3){_0x4258e3=_0x4258e3||0x1f4;return function(_0x2a73a9){logger[_0x532a('0x26')](_0x2a73a9['stack']);if(_0x2a73a9[_0x532a('0x27')]){delete _0x2a73a9[_0x532a('0x27')];}_0x4975cf[_0x532a('0x1a')](_0x4258e3)['send'](_0x2a73a9);};}exports[_0x532a('0x28')]=function(_0x426ba1,_0x233048){var _0xe9c0b9={},_0x47e133={},_0x598b46={'count':0x0,'rows':[]};var _0x252ce0=_['map'](db['Migration']['rawAttributes'],function(_0x1ab660){return{'name':_0x1ab660['fieldName'],'type':_0x1ab660[_0x532a('0x29')][_0x532a('0x2a')]};});_0x47e133[_0x532a('0x2b')]=_[_0x532a('0x2c')](_0x252ce0,_0x532a('0x27'));_0x47e133[_0x532a('0x2d')]=_[_0x532a('0x2e')](_0x426ba1[_0x532a('0x2d')]);_0x47e133['filters']=_[_0x532a('0x2f')](_0x47e133['model'],_0x47e133[_0x532a('0x2d')]);_0xe9c0b9[_0x532a('0x30')]=_[_0x532a('0x2f')](_0x47e133[_0x532a('0x2b')],qs[_0x532a('0x31')](_0x426ba1[_0x532a('0x2d')][_0x532a('0x31')]));_0xe9c0b9[_0x532a('0x30')]=_0xe9c0b9['attributes'][_0x532a('0x32')]?_0xe9c0b9[_0x532a('0x30')]:_0x47e133['model'];if(!_0x426ba1[_0x532a('0x2d')][_0x532a('0x33')](_0x532a('0x34'))){_0xe9c0b9[_0x532a('0x1e')]=qs[_0x532a('0x1e')](_0x426ba1[_0x532a('0x2d')][_0x532a('0x1e')]);_0xe9c0b9[_0x532a('0x1d')]=qs['offset'](_0x426ba1[_0x532a('0x2d')][_0x532a('0x1d')]);}_0xe9c0b9[_0x532a('0x35')]=qs[_0x532a('0x36')](_0x426ba1['query']['sort']);_0xe9c0b9[_0x532a('0x37')]=qs[_0x532a('0x38')](_[_0x532a('0x39')](_0x426ba1[_0x532a('0x2d')],_0x47e133['filters']),_0x252ce0);if(_0x426ba1[_0x532a('0x2d')][_0x532a('0x3a')]){_0xe9c0b9[_0x532a('0x37')]=_[_0x532a('0x3b')](_0xe9c0b9[_0x532a('0x37')],{'$or':_[_0x532a('0x2c')](_0x252ce0,function(_0x314c52){if(_0x314c52[_0x532a('0x29')]!==_0x532a('0x3c')){var _0x3baa6c={};_0x3baa6c[_0x314c52[_0x532a('0x27')]]={'$like':'%'+_0x426ba1[_0x532a('0x2d')][_0x532a('0x3a')]+'%'};return _0x3baa6c;}})});}_0xe9c0b9=_[_0x532a('0x3b')]({},_0xe9c0b9,_0x426ba1[_0x532a('0x3d')]);var _0x126d2e={'where':_0xe9c0b9['where']};return db[_0x532a('0x3e')][_0x532a('0x20')](_0x126d2e)[_0x532a('0x25')](function(_0x5d503e){_0x598b46[_0x532a('0x20')]=_0x5d503e;if(_0x426ba1[_0x532a('0x2d')][_0x532a('0x3f')]){_0xe9c0b9[_0x532a('0x40')]=[{'all':!![]}];}return db[_0x532a('0x3e')][_0x532a('0x41')](_0xe9c0b9);})['then'](function(_0xc42f20){_0x598b46[_0x532a('0x42')]=_0xc42f20;return _0x598b46;})[_0x532a('0x25')](respondWithFilteredResult(_0x233048,_0xe9c0b9))[_0x532a('0x43')](handleError(_0x233048,null));};
\ No newline at end of file
+var _0x89ce=['undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x3131e3,_0x3aed82){var _0x1d9748=function(_0x4af7c6){while(--_0x4af7c6){_0x3131e3['push'](_0x3131e3['shift']());}};_0x1d9748(++_0x3aed82);}(_0x89ce,0x133));var _0xe89c=function(_0x338a81,_0x486dda){_0x338a81=_0x338a81-0x0;var _0x1d25da=_0x89ce[_0x338a81];return _0x1d25da;};'use strict';var emlformat=require(_0xe89c('0x0'));var rimraf=require(_0xe89c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe89c('0x2'));var rp=require(_0xe89c('0x3'));var moment=require(_0xe89c('0x4'));var BPromise=require(_0xe89c('0x5'));var Mustache=require(_0xe89c('0x6'));var util=require(_0xe89c('0x7'));var path=require(_0xe89c('0x8'));var sox=require(_0xe89c('0x9'));var csv=require(_0xe89c('0xa'));var ejs=require(_0xe89c('0xb'));var fs=require('fs');var fs_extra=require(_0xe89c('0xc'));var _=require(_0xe89c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe89c('0xe'));var toCsv=require(_0xe89c('0xa'));var querystring=require(_0xe89c('0xf'));var Papa=require(_0xe89c('0x10'));var Redis=require('ioredis');var authService=require(_0xe89c('0x11'));var qs=require(_0xe89c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe89c('0x13'));var logger=require(_0xe89c('0x14'))('api');var utils=require(_0xe89c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe89c('0x16'));var db=require(_0xe89c('0x17'))['db'];function respondWithStatusCode(_0x911158,_0x7622e0){_0x7622e0=_0x7622e0||0xcc;return function(_0x41c32e){if(_0x41c32e){return _0x911158[_0xe89c('0x18')](_0x7622e0);}return _0x911158[_0xe89c('0x19')](_0x7622e0)[_0xe89c('0x1a')]();};}function respondWithResult(_0x5c3a2f,_0x4f25e6){_0x4f25e6=_0x4f25e6||0xc8;return function(_0x367125){if(_0x367125){return _0x5c3a2f[_0xe89c('0x19')](_0x4f25e6)['json'](_0x367125);}};}function respondWithFilteredResult(_0x5479f9,_0x4e2fad){return function(_0x243406){if(_0x243406){var _0x16b40d=typeof _0x4e2fad[_0xe89c('0x1b')]===_0xe89c('0x1c')&&typeof _0x4e2fad[_0xe89c('0x1d')]===_0xe89c('0x1c');var _0x165766=_0x243406[_0xe89c('0x1e')];var _0x5cd388=_0x16b40d?0x0:_0x4e2fad[_0xe89c('0x1b')];var _0x226369=_0x16b40d?_0x243406['count']:_0x4e2fad['offset']+_0x4e2fad[_0xe89c('0x1d')];var _0x3b39bc;if(_0x226369>=_0x165766){_0x226369=_0x165766;_0x3b39bc=0xc8;}else{_0x3b39bc=0xce;}_0x5479f9[_0xe89c('0x19')](_0x3b39bc);return _0x5479f9[_0xe89c('0x1f')](_0xe89c('0x20'),_0x5cd388+'-'+_0x226369+'/'+_0x165766)['json'](_0x243406);}return null;};}function patchUpdates(_0x37b78c){return function(_0x5beec9){try{jsonpatch[_0xe89c('0x21')](_0x5beec9,_0x37b78c,!![]);}catch(_0xdf72c){return BPromise[_0xe89c('0x22')](_0xdf72c);}return _0x5beec9[_0xe89c('0x23')]();};}function saveUpdates(_0x219e3d,_0x2ba138){return function(_0x4bd481){if(_0x4bd481){return _0x4bd481['update'](_0x219e3d)['then'](function(_0x328b9b){return _0x328b9b;});}return null;};}function removeEntity(_0x3b4909,_0x43e338){return function(_0x16dfcd){if(_0x16dfcd){return _0x16dfcd[_0xe89c('0x24')]()[_0xe89c('0x25')](function(){_0x3b4909[_0xe89c('0x19')](0xcc)[_0xe89c('0x1a')]();});}};}function handleEntityNotFound(_0x47daa6,_0x3f421f){return function(_0x273088){if(!_0x273088){_0x47daa6[_0xe89c('0x18')](0x194);}return _0x273088;};}function handleError(_0x17df79,_0x810d14){_0x810d14=_0x810d14||0x1f4;return function(_0xbbfbda){logger[_0xe89c('0x26')](_0xbbfbda[_0xe89c('0x27')]);if(_0xbbfbda[_0xe89c('0x28')]){delete _0xbbfbda[_0xe89c('0x28')];}_0x17df79[_0xe89c('0x19')](_0x810d14)[_0xe89c('0x29')](_0xbbfbda);};}exports[_0xe89c('0x2a')]=function(_0x4deec1,_0x3da3b7){var _0xd5236b={},_0x4af59f={},_0x520cc4={'count':0x0,'rows':[]};var _0x5eeeba=_[_0xe89c('0x2b')](db[_0xe89c('0x2c')][_0xe89c('0x2d')],function(_0x156c7b){return{'name':_0x156c7b[_0xe89c('0x2e')],'type':_0x156c7b['type'][_0xe89c('0x2f')]};});_0x4af59f[_0xe89c('0x30')]=_[_0xe89c('0x2b')](_0x5eeeba,_0xe89c('0x28'));_0x4af59f['query']=_[_0xe89c('0x31')](_0x4deec1[_0xe89c('0x32')]);_0x4af59f[_0xe89c('0x33')]=_[_0xe89c('0x34')](_0x4af59f['model'],_0x4af59f[_0xe89c('0x32')]);_0xd5236b['attributes']=_[_0xe89c('0x34')](_0x4af59f['model'],qs[_0xe89c('0x35')](_0x4deec1[_0xe89c('0x32')][_0xe89c('0x35')]));_0xd5236b[_0xe89c('0x36')]=_0xd5236b[_0xe89c('0x36')][_0xe89c('0x37')]?_0xd5236b[_0xe89c('0x36')]:_0x4af59f[_0xe89c('0x30')];if(!_0x4deec1[_0xe89c('0x32')]['hasOwnProperty'](_0xe89c('0x38'))){_0xd5236b[_0xe89c('0x1d')]=qs[_0xe89c('0x1d')](_0x4deec1[_0xe89c('0x32')]['limit']);_0xd5236b[_0xe89c('0x1b')]=qs[_0xe89c('0x1b')](_0x4deec1['query'][_0xe89c('0x1b')]);}_0xd5236b[_0xe89c('0x39')]=qs[_0xe89c('0x3a')](_0x4deec1[_0xe89c('0x32')][_0xe89c('0x3a')]);_0xd5236b[_0xe89c('0x3b')]=qs[_0xe89c('0x33')](_['pick'](_0x4deec1[_0xe89c('0x32')],_0x4af59f['filters']),_0x5eeeba);if(_0x4deec1[_0xe89c('0x32')][_0xe89c('0x3c')]){_0xd5236b['where']=_[_0xe89c('0x3d')](_0xd5236b[_0xe89c('0x3b')],{'$or':_[_0xe89c('0x2b')](_0x5eeeba,function(_0x28a769){if(_0x28a769[_0xe89c('0x3e')]!==_0xe89c('0x3f')){var _0x29fd5b={};_0x29fd5b[_0x28a769['name']]={'$like':'%'+_0x4deec1[_0xe89c('0x32')][_0xe89c('0x3c')]+'%'};return _0x29fd5b;}})});}_0xd5236b=_[_0xe89c('0x3d')]({},_0xd5236b,_0x4deec1['options']);var _0x351947={'where':_0xd5236b['where']};return db[_0xe89c('0x2c')][_0xe89c('0x1e')](_0x351947)[_0xe89c('0x25')](function(_0x11efa1){_0x520cc4[_0xe89c('0x1e')]=_0x11efa1;if(_0x4deec1[_0xe89c('0x32')]['includeAll']){_0xd5236b[_0xe89c('0x40')]=[{'all':!![]}];}return db[_0xe89c('0x2c')][_0xe89c('0x41')](_0xd5236b);})[_0xe89c('0x25')](function(_0x34ed9d){_0x520cc4[_0xe89c('0x42')]=_0x34ed9d;return _0x520cc4;})[_0xe89c('0x25')](respondWithFilteredResult(_0x3da3b7,_0xd5236b))['catch'](handleError(_0x3da3b7,null));};
\ No newline at end of file
index 8a8b26c..fc2e1bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207d=['../../config/environment','exports','define','Migration','migrations','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x207d,0x65));var _0xd207=function(_0x3f14d2,_0x21e949){_0x3f14d2=_0x3f14d2-0x0;var _0x1b88f5=_0x207d[_0x3f14d2];return _0x1b88f5;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require(_0xd207('0x1'))(_0xd207('0x2'));var moment=require(_0xd207('0x3'));var BPromise=require(_0xd207('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd207('0x5'));var rimraf=require(_0xd207('0x6'));var config=require(_0xd207('0x7'));var attributes=require('./migration.attributes');module[_0xd207('0x8')]=function(_0x29a525,_0x3efc36){return _0x29a525[_0xd207('0x9')](_0xd207('0xa'),attributes,{'tableName':_0xd207('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdf90=['migrations','util','../../config/logger','api','moment','bluebird','../../config/environment','./migration.attributes','exports'];(function(_0x4801b7,_0x61b585){var _0x1ad923=function(_0x4b9d96){while(--_0x4b9d96){_0x4801b7['push'](_0x4801b7['shift']());}};_0x1ad923(++_0x61b585);}(_0xdf90,0x160));var _0x0df9=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0xdf90[_0x1ae491];return _0x4958a5;};'use strict';var _=require('lodash');var util=require(_0x0df9('0x0'));var logger=require(_0x0df9('0x1'))(_0x0df9('0x2'));var moment=require(_0x0df9('0x3'));var BPromise=require(_0x0df9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0df9('0x5'));var attributes=require(_0x0df9('0x6'));module[_0x0df9('0x7')]=function(_0x3eff89,_0x3539db){return _0x3eff89['define']('Migration',attributes,{'tableName':_0x0df9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eaed663..d847251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb74d=['request\x20sent','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb74d,0x16e));var _0xdb74=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xb74d[_0x46a671];return _0x526d75;};'use strict';var _=require(_0xdb74('0x0'));var util=require('util');var moment=require(_0xdb74('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb74('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb74('0x3'))['db'];var utils=require(_0xdb74('0x4'));var logger=require(_0xdb74('0x5'))('rpc');var config=require(_0xdb74('0x6'));var jayson=require(_0xdb74('0x7'));var client=jayson[_0xdb74('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5183ae,_0xfc6f47,_0x4bf15e){return new BPromise(function(_0x3e44b7,_0x2655f3){return client['request'](_0x5183ae,_0x4bf15e)[_0xdb74('0x9')](function(_0x5370df){logger[_0xdb74('0xa')](_0xdb74('0xb'),_0xfc6f47,'request\x20sent');logger[_0xdb74('0xc')](_0xdb74('0xd'),_0xfc6f47,_0xdb74('0xe'),JSON['stringify'](_0x5370df));if(_0x5370df['error']){if(_0x5370df[_0xdb74('0xf')][_0xdb74('0x10')]===0x1f4){logger[_0xdb74('0xf')](_0xdb74('0xb'),_0xfc6f47,_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);return _0x2655f3(_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);}logger[_0xdb74('0xf')](_0xdb74('0xb'),_0xfc6f47,_0x5370df[_0xdb74('0xf')][_0xdb74('0x11')]);return _0x3e44b7(_0x5370df[_0xdb74('0xf')]['message']);}else{logger[_0xdb74('0xa')](_0xdb74('0xb'),_0xfc6f47,_0xdb74('0xe'));_0x3e44b7(_0x5370df[_0xdb74('0x12')]['message']);}})['catch'](function(_0xc9548c){logger[_0xdb74('0xf')]('Migration,\x20%s,\x20%s',_0xfc6f47,_0xc9548c);_0x2655f3(_0xc9548c);});});}
\ No newline at end of file
+var _0xa74d=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xa74d,0x1cf));var _0xda74=function(_0xd56523,_0x3a5fdc){_0xd56523=_0xd56523-0x0;var _0x5b05ce=_0xa74d[_0xd56523];return _0x5b05ce;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113f2,_0x3fa4e7,_0x5da443){return new BPromise(function(_0x23d5f5,_0x517251){return client['request'](_0x2113f2,_0x5da443)[_0xda74('0xc')](function(_0x411790){logger['info'](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));logger[_0xda74('0xf')](_0xda74('0x10'),_0x3fa4e7,_0xda74('0xe'),JSON[_0xda74('0x11')](_0x411790));if(_0x411790[_0xda74('0x12')]){if(_0x411790[_0xda74('0x12')]['code']===0x1f4){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')]['message']);return _0x517251(_0x411790[_0xda74('0x12')][_0xda74('0x13')]);}logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')][_0xda74('0x13')]);return _0x23d5f5(_0x411790[_0xda74('0x12')]['message']);}else{logger[_0xda74('0x14')](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));_0x23d5f5(_0x411790[_0xda74('0x15')][_0xda74('0x13')]);}})['catch'](function(_0x1535d3){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x1535d3);_0x517251(_0x1535d3);});});}
\ No newline at end of file
index b0c2f9b..eff7d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8be3=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','create','put','update'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0x8be3,0xd1));var _0x38be=function(_0xfb790d,_0x1793fe){_0xfb790d=_0xfb790d-0x0;var _0x23a1b9=_0x8be3[_0xfb790d];return _0x23a1b9;};'use strict';var multer=require('multer');var util=require(_0x38be('0x0'));var path=require(_0x38be('0x1'));var timeout=require(_0x38be('0x2'));var express=require('express');var router=express[_0x38be('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x38be('0x4'));var interaction=require(_0x38be('0x5'));var config=require(_0x38be('0x6'));var controller=require(_0x38be('0x7'));router[_0x38be('0x8')]('/',auth['isAuthenticated'](),controller[_0x38be('0x9')]);router[_0x38be('0x8')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['show']);router['post']('/',auth[_0x38be('0xb')](),controller[_0x38be('0xc')]);router[_0x38be('0xd')](_0x38be('0xa'),auth[_0x38be('0xb')](),controller[_0x38be('0xe')]);router['delete'](_0x38be('0xa'),auth[_0x38be('0xb')](),controller['destroy']);module[_0x38be('0xf')]=router;
\ No newline at end of file
+var _0x8e20=['../../components/interaction/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x258cd4,_0x4064e8){var _0x976fc1=function(_0x5e1faf){while(--_0x5e1faf){_0x258cd4['push'](_0x258cd4['shift']());}};_0x976fc1(++_0x4064e8);}(_0x8e20,0x1af));var _0x08e2=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x8e20[_0x39caaa];return _0x9b9c7d;};'use strict';var multer=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var path=require(_0x08e2('0x2'));var timeout=require('connect-timeout');var express=require(_0x08e2('0x3'));var router=express[_0x08e2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x08e2('0x5'));var interaction=require(_0x08e2('0x6'));var config=require(_0x08e2('0x7'));var controller=require(_0x08e2('0x8'));router[_0x08e2('0x9')]('/',auth['isAuthenticated'](),controller[_0x08e2('0xa')]);router[_0x08e2('0x9')]('/:id',auth[_0x08e2('0xb')](),controller[_0x08e2('0xc')]);router[_0x08e2('0xd')]('/',auth[_0x08e2('0xb')](),controller[_0x08e2('0xe')]);router[_0x08e2('0xf')]('/:id',auth[_0x08e2('0xb')](),controller['update']);router['delete'](_0x08e2('0x10'),auth[_0x08e2('0xb')](),controller[_0x08e2('0x11')]);module[_0x08e2('0x12')]=router;
\ No newline at end of file
index 1be9870..b8352bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ff=['exports','ENUM','externip','turn','STRING','sequelize'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0xd4ff,0x149));var _0xfd4f=function(_0x162224,_0x138f58){_0x162224=_0x162224-0x0;var _0x4e449d=_0xd4ff[_0x162224];return _0x4e449d;};'use strict';var Sequelize=require(_0xfd4f('0x0'));module[_0xfd4f('0x1')]={'type':{'type':Sequelize[_0xfd4f('0x2')]('localnet',_0xfd4f('0x3'),'stun',_0xfd4f('0x4'))},'value':{'type':Sequelize[_0xfd4f('0x5')]},'username':{'type':Sequelize[_0xfd4f('0x5')]},'password':{'type':Sequelize[_0xfd4f('0x5')]}};
\ No newline at end of file
+var _0x485b=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x197388,_0x2c35db){var _0x2e21e1=function(_0x1d5dc1){while(--_0x1d5dc1){_0x197388['push'](_0x197388['shift']());}};_0x2e21e1(++_0x2c35db);}(_0x485b,0x14c));var _0xb485=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x485b[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0xb485('0x0'));module[_0xb485('0x1')]={'type':{'type':Sequelize[_0xb485('0x2')]('localnet',_0xb485('0x3'),_0xb485('0x4'),_0xb485('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb485('0x6')]},'password':{'type':Sequelize[_0xb485('0x6')]}};
\ No newline at end of file
index ecbe8cc..d3ceaf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb67d=['send','index','Network','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','params','length','include','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','Reload','server/files/templates/network.ejs','format','update','sequelize','find','TURN','/etc/asterisk/turn_xcally.conf','toLowerCase','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','offset','count','limit','apply','reject','destroy','name'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0xb67d,0x1ef));var _0xdb67=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb67d[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xdb67('0x0'));var rimraf=require(_0xdb67('0x1'));var zipdir=require(_0xdb67('0x2'));var jsonpatch=require(_0xdb67('0x3'));var rp=require(_0xdb67('0x4'));var moment=require(_0xdb67('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdb67('0x6'));var util=require(_0xdb67('0x7'));var path=require(_0xdb67('0x8'));var sox=require(_0xdb67('0x9'));var csv=require(_0xdb67('0xa'));var ejs=require(_0xdb67('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb67('0xc'));var squel=require(_0xdb67('0xd'));var crypto=require(_0xdb67('0xe'));var jsforce=require(_0xdb67('0xf'));var deskjs=require(_0xdb67('0x10'));var toCsv=require(_0xdb67('0xa'));var querystring=require(_0xdb67('0x11'));var Papa=require(_0xdb67('0x12'));var Redis=require(_0xdb67('0x13'));var authService=require(_0xdb67('0x14'));var qs=require(_0xdb67('0x15'));var as=require(_0xdb67('0x16'));var hardwareService=require(_0xdb67('0x17'));var logger=require(_0xdb67('0x18'))(_0xdb67('0x19'));var utils=require(_0xdb67('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xdb67('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdb67('0x1c'));var client=jayson[_0xdb67('0x1d')][_0xdb67('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x537e98,_0x559db3,_0x307455,_0x25db9b){return new BPromise(function(_0x50146b,_0x5c6ec5){var _0xf8b702=_0x25db9b||client;return _0xf8b702[_0xdb67('0x1f')](_0x537e98,_0x307455)[_0xdb67('0x20')](function(_0x5246b4){logger[_0xdb67('0x21')]('Network,\x20%s,\x20%s',_0x559db3,_0xdb67('0x22'));logger[_0xdb67('0x23')](_0xdb67('0x24'),_0x559db3,_0xdb67('0x22'),JSON[_0xdb67('0x25')](_0x5246b4));if(_0x5246b4[_0xdb67('0x26')]){if(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x27')]===0x1f4){logger[_0xdb67('0x26')](_0xdb67('0x28'),_0x559db3,_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);return _0x5c6ec5(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);}logger['error'](_0xdb67('0x28'),_0x559db3,_0x5246b4['error'][_0xdb67('0x29')]);return _0x50146b(_0x5246b4[_0xdb67('0x26')][_0xdb67('0x29')]);}else{logger[_0xdb67('0x21')](_0xdb67('0x28'),_0x559db3,_0xdb67('0x22'));_0x50146b(_0x5246b4['result']['message']);}})[_0xdb67('0x2a')](function(_0x5579a3){logger[_0xdb67('0x26')](_0xdb67('0x28'),_0x559db3,_0x5579a3);_0x5c6ec5(_0x5579a3);});});}function respondWithStatusCode(_0x574841,_0x4cc1f8){_0x4cc1f8=_0x4cc1f8||0xcc;return function(_0x12a621){if(_0x12a621){return _0x574841[_0xdb67('0x2b')](_0x4cc1f8);}return _0x574841[_0xdb67('0x2c')](_0x4cc1f8)[_0xdb67('0x2d')]();};}function respondWithResult(_0x4423a5,_0x543cde){_0x543cde=_0x543cde||0xc8;return function(_0xea509f){if(_0xea509f){return _0x4423a5['status'](_0x543cde)[_0xdb67('0x2e')](_0xea509f);}};}function respondWithFilteredResult(_0x1c79b8,_0x31f4c7){return function(_0x4e258e){if(_0x4e258e){var _0x46e287=typeof _0x31f4c7['offset']===_0xdb67('0x2f')&&typeof _0x31f4c7['limit']===_0xdb67('0x2f');var _0x2005c8=_0x4e258e['count'];var _0x46e82d=_0x46e287?0x0:_0x31f4c7[_0xdb67('0x30')];var _0x4382b3=_0x46e287?_0x4e258e[_0xdb67('0x31')]:_0x31f4c7['offset']+_0x31f4c7[_0xdb67('0x32')];var _0x96870f;if(_0x4382b3>=_0x2005c8){_0x4382b3=_0x2005c8;_0x96870f=0xc8;}else{_0x96870f=0xce;}_0x1c79b8[_0xdb67('0x2c')](_0x96870f);return _0x1c79b8['set']('Content-Range',_0x46e82d+'-'+_0x4382b3+'/'+_0x2005c8)['json'](_0x4e258e);}return null;};}function patchUpdates(_0x110c76){return function(_0x2d9533){try{jsonpatch[_0xdb67('0x33')](_0x2d9533,_0x110c76,!![]);}catch(_0xee3e2e){return BPromise[_0xdb67('0x34')](_0xee3e2e);}return _0x2d9533['save']();};}function saveUpdates(_0x42b83b,_0x53900d){return function(_0x16e60b){if(_0x16e60b){return _0x16e60b['update'](_0x42b83b)[_0xdb67('0x20')](function(_0x1fe95d){return _0x1fe95d;});}return null;};}function removeEntity(_0x1fbb99,_0x4042b9){return function(_0x2b4fae){if(_0x2b4fae){return _0x2b4fae[_0xdb67('0x35')]()[_0xdb67('0x20')](function(){_0x1fbb99['status'](0xcc)[_0xdb67('0x2d')]();});}};}function handleEntityNotFound(_0x40cf5e,_0x4cac8d){return function(_0xef72c1){if(!_0xef72c1){_0x40cf5e[_0xdb67('0x2b')](0x194);}return _0xef72c1;};}function handleError(_0x28b15d,_0x443dcf){_0x443dcf=_0x443dcf||0x1f4;return function(_0x2bf3be){logger[_0xdb67('0x26')](_0x2bf3be['stack']);if(_0x2bf3be['name']){delete _0x2bf3be[_0xdb67('0x36')];}_0x28b15d['status'](_0x443dcf)[_0xdb67('0x37')](_0x2bf3be);};}exports[_0xdb67('0x38')]=function(_0x23b6c6,_0x8f4073){var _0x4ab325={},_0xa49ae1={},_0x3429fa={'count':0x0,'rows':[]};var _0x4e4f73=_['map'](db[_0xdb67('0x39')][_0xdb67('0x3a')],function(_0x12a3e5){return{'name':_0x12a3e5[_0xdb67('0x3b')],'type':_0x12a3e5[_0xdb67('0x3c')][_0xdb67('0x3d')]};});_0xa49ae1[_0xdb67('0x3e')]=_['map'](_0x4e4f73,_0xdb67('0x36'));_0xa49ae1[_0xdb67('0x3f')]=_[_0xdb67('0x40')](_0x23b6c6[_0xdb67('0x3f')]);_0xa49ae1[_0xdb67('0x41')]=_[_0xdb67('0x42')](_0xa49ae1['model'],_0xa49ae1[_0xdb67('0x3f')]);_0x4ab325[_0xdb67('0x43')]=_[_0xdb67('0x42')](_0xa49ae1['model'],qs[_0xdb67('0x44')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x44')]));_0x4ab325[_0xdb67('0x43')]=_0x4ab325['attributes']['length']?_0x4ab325[_0xdb67('0x43')]:_0xa49ae1[_0xdb67('0x3e')];if(!_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x45')](_0xdb67('0x46'))){_0x4ab325[_0xdb67('0x32')]=qs[_0xdb67('0x32')](_0x23b6c6['query']['limit']);_0x4ab325['offset']=qs[_0xdb67('0x30')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x30')]);}_0x4ab325[_0xdb67('0x47')]=qs[_0xdb67('0x48')](_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x48')]);_0x4ab325[_0xdb67('0x49')]=qs[_0xdb67('0x41')](_[_0xdb67('0x4a')](_0x23b6c6[_0xdb67('0x3f')],_0xa49ae1[_0xdb67('0x41')]),_0x4e4f73);if(_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x4b')]){_0x4ab325[_0xdb67('0x49')]=_[_0xdb67('0x4c')](_0x4ab325[_0xdb67('0x49')],{'$or':_[_0xdb67('0x4d')](_0x4e4f73,function(_0x248911){if(_0x248911[_0xdb67('0x3c')]!==_0xdb67('0x4e')){var _0x14d3d8={};_0x14d3d8[_0x248911['name']]={'$like':'%'+_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x4b')]+'%'};return _0x14d3d8;}})});}_0x4ab325=_[_0xdb67('0x4c')]({},_0x4ab325,_0x23b6c6[_0xdb67('0x4f')]);var _0x2cc722={'where':_0x4ab325[_0xdb67('0x49')]};return db[_0xdb67('0x39')][_0xdb67('0x31')](_0x2cc722)[_0xdb67('0x20')](function(_0x5536a8){_0x3429fa[_0xdb67('0x31')]=_0x5536a8;if(_0x23b6c6[_0xdb67('0x3f')][_0xdb67('0x50')]){_0x4ab325['include']=[{'all':!![]}];}return db['Network'][_0xdb67('0x51')](_0x4ab325);})[_0xdb67('0x20')](function(_0x303f7a){_0x3429fa['rows']=_0x303f7a;return _0x3429fa;})[_0xdb67('0x20')](respondWithFilteredResult(_0x8f4073,_0x4ab325))['catch'](handleError(_0x8f4073,null));};exports['show']=function(_0x15c8d9,_0x1961f5){var _0x387fd5={'raw':!![],'where':{'id':_0x15c8d9[_0xdb67('0x52')]['id']}},_0x51f1ce={};_0x51f1ce[_0xdb67('0x3e')]=_['keys'](db['Network'][_0xdb67('0x3a')]);_0x51f1ce[_0xdb67('0x3f')]=_[_0xdb67('0x40')](_0x15c8d9[_0xdb67('0x3f')]);_0x51f1ce[_0xdb67('0x41')]=_[_0xdb67('0x42')](_0x51f1ce[_0xdb67('0x3e')],_0x51f1ce[_0xdb67('0x3f')]);_0x387fd5['attributes']=_[_0xdb67('0x42')](_0x51f1ce['model'],qs[_0xdb67('0x44')](_0x15c8d9[_0xdb67('0x3f')][_0xdb67('0x44')]));_0x387fd5['attributes']=_0x387fd5['attributes'][_0xdb67('0x53')]?_0x387fd5[_0xdb67('0x43')]:_0x51f1ce[_0xdb67('0x3e')];if(_0x15c8d9[_0xdb67('0x3f')][_0xdb67('0x50')]){_0x387fd5[_0xdb67('0x54')]=[{'all':!![]}];}_0x387fd5=_[_0xdb67('0x4c')]({},_0x387fd5,_0x15c8d9[_0xdb67('0x4f')]);return db['Network']['find'](_0x387fd5)[_0xdb67('0x20')](handleEntityNotFound(_0x1961f5,null))[_0xdb67('0x20')](respondWithResult(_0x1961f5,null))['catch'](handleError(_0x1961f5,null));};exports[_0xdb67('0x55')]=function(_0x32b168,_0x5ecc33,_0x51389b){var _0x1b39ab;return db['sequelize'][_0xdb67('0x56')](function(_0x7b08a){return db['Network'][_0xdb67('0x55')](_0x32b168[_0xdb67('0x57')],{'raw':!![]})[_0xdb67('0x20')](function(_0x3e9cda){_0x1b39ab=_0x3e9cda;return db['Network']['findAll']({'where':{'type':_0x32b168['body'][_0xdb67('0x3c')]},'raw':!![]});})[_0xdb67('0x20')](function(_0x5419bb){if(_0x1b39ab['type'][_0xdb67('0x58')]()==_0xdb67('0x59')){var _0x354b2d=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),_0xdb67('0x5e'));var _0x1c4ec5=ejs[_0xdb67('0x5f')](_0x354b2d,{'networks':_0x5419bb||[]});fs[_0xdb67('0x60')](_0xdb67('0x61'),_0x1c4ec5);return respondWithRpcPromise('Reload',_0xdb67('0x55'),{'module':_0xdb67('0x62')});}else if(_0x1b39ab['type'][_0xdb67('0x58')]()=='TURN'){var _0x359483=fs[_0xdb67('0x5a')](path['join'](config[_0xdb67('0x5c')],_0xdb67('0x63')),_0xdb67('0x5e'));var _0x3bf91e=ejs[_0xdb67('0x5f')](_0x359483,{'networks':_0x5419bb||[]});fs[_0xdb67('0x60')]('/etc/asterisk/turn_xcally.conf',_0x3bf91e);return respondWithRpcPromise(_0xdb67('0x64'),'create',{'module':'res_stun_monitor.so'});}else{var _0x3d5355=fs['readFileSync'](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x29dae0=ejs['render'](_0x3d5355,{'networks':_0x5419bb||[]});fs['writeFileSync'](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x32b168[_0xdb67('0x57')]['type']['toLowerCase']()),_0x29dae0);return respondWithRpcPromise(_0xdb67('0x64'),_0xdb67('0x55'),{'module':'chan_sip.so'});}return null;})[_0xdb67('0x20')](function(){return _0x1b39ab;});})[_0xdb67('0x20')](respondWithResult(_0x5ecc33,0xc9))[_0xdb67('0x2a')](handleError(_0x5ecc33,null));};exports[_0xdb67('0x67')]=function(_0x2ec787,_0x365408,_0x62eb5d){var _0x29219;return db[_0xdb67('0x68')][_0xdb67('0x56')](function(_0x475757){return db[_0xdb67('0x39')][_0xdb67('0x69')]({'where':{'id':_0x2ec787[_0xdb67('0x52')]['id']}})[_0xdb67('0x20')](handleEntityNotFound(_0x365408,null))[_0xdb67('0x20')](saveUpdates(_0x2ec787[_0xdb67('0x57')],null))[_0xdb67('0x20')](function(_0x50403c){if(_0x50403c){_0x29219=_0x50403c;return db['Network'][_0xdb67('0x51')]({'where':{'type':_0x29219[_0xdb67('0x3c')]},'raw':!![]});}return null;})[_0xdb67('0x20')](function(_0x43f1ba){if(_0x29219[_0xdb67('0x3c')][_0xdb67('0x58')]()==_0xdb67('0x59')){var _0x1d798f=fs['readFileSync'](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),'utf8');var _0x220e17=ejs[_0xdb67('0x5f')](_0x1d798f,{'networks':_0x43f1ba||[]});fs[_0xdb67('0x60')]('/etc/asterisk/stun_xcally.conf',_0x220e17);return respondWithRpcPromise(_0xdb67('0x64'),'update',{'module':'res_stun_monitor.so'});}else if(_0x29219['type'][_0xdb67('0x58')]()==_0xdb67('0x6a')){var _0x189df2=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xdb67('0x5e'));var _0x5a9687=ejs[_0xdb67('0x5f')](_0x189df2,{'networks':_0x43f1ba||[]});fs['writeFileSync'](_0xdb67('0x6b'),_0x5a9687);return respondWithRpcPromise(_0xdb67('0x64'),_0xdb67('0x67'),{'module':_0xdb67('0x62')});}else{var _0x1f8d6c=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x4bc538=ejs[_0xdb67('0x5f')](_0x1f8d6c,{'networks':_0x43f1ba||[]});fs['writeFileSync'](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ec787[_0xdb67('0x57')][_0xdb67('0x3c')][_0xdb67('0x6c')]()),_0x4bc538);return respondWithRpcPromise(_0xdb67('0x64'),'update',{'module':_0xdb67('0x6d')});}return null;})[_0xdb67('0x20')](function(_0x369612){if(_0x369612){return _0x29219;}return null;});})['then'](respondWithResult(_0x365408,null))['catch'](handleError(_0x365408,null));};exports[_0xdb67('0x35')]=function(_0x593f00,_0x316bc3,_0x452cf5){var _0xc2d876;return db['Network'][_0xdb67('0x69')]({'where':{'id':_0x593f00['params']['id']}})['then'](function(_0x19b092){_0xc2d876=_0x19b092;return _0x19b092;})[_0xdb67('0x20')](handleEntityNotFound(_0x316bc3,null))['then'](removeEntity(_0x316bc3,null))[_0xdb67('0x20')](function(){if(_0xc2d876){return db[_0xdb67('0x39')][_0xdb67('0x51')]({'where':{'type':_0xc2d876[_0xdb67('0x3c')]},'raw':!![]});}})[_0xdb67('0x20')](function(_0x432f40){if(_0xc2d876[_0xdb67('0x3c')]['toUpperCase']()==_0xdb67('0x59')){var _0x215e57=fs['readFileSync'](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x5d')),_0xdb67('0x5e'));var _0x226c60=ejs[_0xdb67('0x5f')](_0x215e57,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')]('/etc/asterisk/stun_xcally.conf',_0x226c60);return respondWithRpcPromise('Reload',_0xdb67('0x35'),{'module':_0xdb67('0x62')});}else if(_0xc2d876[_0xdb67('0x3c')][_0xdb67('0x58')]()==_0xdb67('0x6a')){var _0xba30ba=fs['readFileSync'](path[_0xdb67('0x5b')](config['root'],_0xdb67('0x63')),_0xdb67('0x5e'));var _0x38f525=ejs['render'](_0xba30ba,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')](_0xdb67('0x6b'),_0x38f525);return respondWithRpcPromise(_0xdb67('0x64'),'destroy',{'module':_0xdb67('0x62')});}else{var _0x1f82fd=fs[_0xdb67('0x5a')](path[_0xdb67('0x5b')](config[_0xdb67('0x5c')],_0xdb67('0x65')),_0xdb67('0x5e'));var _0x2afac0=ejs[_0xdb67('0x5f')](_0x1f82fd,{'networks':_0x432f40||[]});fs[_0xdb67('0x60')](util[_0xdb67('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x593f00['body'][_0xdb67('0x3c')]['toLowerCase']()),_0x2afac0);return respondWithRpcPromise('Reload',_0xdb67('0x35'),{'module':_0xdb67('0x6d')});}return null;})[_0xdb67('0x2a')](handleError(_0x316bc3,null));};
\ No newline at end of file
+var _0x553b=['includeAll','find','create','sequelize','transaction','body','toUpperCase','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','Reload','root','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','STUN','/etc/asterisk/turn_xcally.conf','format','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','count','set','apply','reject','save','destroy','end','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x553b,0xfb));var _0xb553=function(_0x3795d6,_0x536b5d){_0x3795d6=_0x3795d6-0x0;var _0x4ac76e=_0x553b[_0x3795d6];return _0x4ac76e;};'use strict';var emlformat=require(_0xb553('0x0'));var rimraf=require(_0xb553('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb553('0x2'));var rp=require('request-promise');var moment=require(_0xb553('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb553('0x4'));var util=require(_0xb553('0x5'));var path=require(_0xb553('0x6'));var sox=require(_0xb553('0x7'));var csv=require(_0xb553('0x8'));var ejs=require(_0xb553('0x9'));var fs=require('fs');var fs_extra=require(_0xb553('0xa'));var _=require(_0xb553('0xb'));var squel=require(_0xb553('0xc'));var crypto=require('crypto');var jsforce=require(_0xb553('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb553('0x8'));var querystring=require(_0xb553('0xe'));var Papa=require(_0xb553('0xf'));var Redis=require(_0xb553('0x10'));var authService=require(_0xb553('0x11'));var qs=require(_0xb553('0x12'));var as=require(_0xb553('0x13'));var hardwareService=require(_0xb553('0x14'));var logger=require(_0xb553('0x15'))(_0xb553('0x16'));var utils=require(_0xb553('0x17'));var config=require(_0xb553('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xb553('0x19'));var client=jayson[_0xb553('0x1a')][_0xb553('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x45cf9a,_0x22b488,_0x5895d5,_0x5d1308){return new BPromise(function(_0x22b80e,_0x49a942){var _0x5f3ac5=_0x5d1308||client;return _0x5f3ac5[_0xb553('0x1c')](_0x45cf9a,_0x5895d5)[_0xb553('0x1d')](function(_0x50f6cf){logger[_0xb553('0x1e')](_0xb553('0x1f'),_0x22b488,'request\x20sent');logger[_0xb553('0x20')](_0xb553('0x21'),_0x22b488,_0xb553('0x22'),JSON['stringify'](_0x50f6cf));if(_0x50f6cf['error']){if(_0x50f6cf[_0xb553('0x23')][_0xb553('0x24')]===0x1f4){logger[_0xb553('0x23')]('Network,\x20%s,\x20%s',_0x22b488,_0x50f6cf[_0xb553('0x23')]['message']);return _0x49a942(_0x50f6cf[_0xb553('0x23')][_0xb553('0x25')]);}logger[_0xb553('0x23')](_0xb553('0x1f'),_0x22b488,_0x50f6cf[_0xb553('0x23')]['message']);return _0x22b80e(_0x50f6cf[_0xb553('0x23')][_0xb553('0x25')]);}else{logger[_0xb553('0x1e')]('Network,\x20%s,\x20%s',_0x22b488,_0xb553('0x22'));_0x22b80e(_0x50f6cf[_0xb553('0x26')][_0xb553('0x25')]);}})[_0xb553('0x27')](function(_0x49edc1){logger[_0xb553('0x23')](_0xb553('0x1f'),_0x22b488,_0x49edc1);_0x49a942(_0x49edc1);});});}function respondWithStatusCode(_0x25f7de,_0x463b0e){_0x463b0e=_0x463b0e||0xcc;return function(_0x4ff12c){if(_0x4ff12c){return _0x25f7de['sendStatus'](_0x463b0e);}return _0x25f7de[_0xb553('0x28')](_0x463b0e)['end']();};}function respondWithResult(_0x385f00,_0x52641e){_0x52641e=_0x52641e||0xc8;return function(_0x526cda){if(_0x526cda){return _0x385f00[_0xb553('0x28')](_0x52641e)[_0xb553('0x29')](_0x526cda);}};}function respondWithFilteredResult(_0x16b3d2,_0x2761b2){return function(_0x34c3a9){if(_0x34c3a9){var _0x481519=typeof _0x2761b2[_0xb553('0x2a')]===_0xb553('0x2b')&&typeof _0x2761b2['limit']===_0xb553('0x2b');var _0x401b0f=_0x34c3a9[_0xb553('0x2c')];var _0x5393f4=_0x481519?0x0:_0x2761b2[_0xb553('0x2a')];var _0x2a38b5=_0x481519?_0x34c3a9['count']:_0x2761b2[_0xb553('0x2a')]+_0x2761b2['limit'];var _0x134138;if(_0x2a38b5>=_0x401b0f){_0x2a38b5=_0x401b0f;_0x134138=0xc8;}else{_0x134138=0xce;}_0x16b3d2['status'](_0x134138);return _0x16b3d2[_0xb553('0x2d')]('Content-Range',_0x5393f4+'-'+_0x2a38b5+'/'+_0x401b0f)[_0xb553('0x29')](_0x34c3a9);}return null;};}function patchUpdates(_0x44a1e1){return function(_0xdc80b2){try{jsonpatch[_0xb553('0x2e')](_0xdc80b2,_0x44a1e1,!![]);}catch(_0xe45259){return BPromise[_0xb553('0x2f')](_0xe45259);}return _0xdc80b2[_0xb553('0x30')]();};}function saveUpdates(_0x4da1aa,_0x32abb0){return function(_0x53c1b0){if(_0x53c1b0){return _0x53c1b0['update'](_0x4da1aa)['then'](function(_0x3e7b55){return _0x3e7b55;});}return null;};}function removeEntity(_0x369ae5,_0x128398){return function(_0x5edd4a){if(_0x5edd4a){return _0x5edd4a[_0xb553('0x31')]()[_0xb553('0x1d')](function(){_0x369ae5[_0xb553('0x28')](0xcc)[_0xb553('0x32')]();});}};}function handleEntityNotFound(_0x1c61f3,_0x446b27){return function(_0x4f8830){if(!_0x4f8830){_0x1c61f3['sendStatus'](0x194);}return _0x4f8830;};}function handleError(_0x44a4bd,_0x5b465e){_0x5b465e=_0x5b465e||0x1f4;return function(_0x26a9e6){logger[_0xb553('0x23')](_0x26a9e6[_0xb553('0x33')]);if(_0x26a9e6[_0xb553('0x34')]){delete _0x26a9e6[_0xb553('0x34')];}_0x44a4bd[_0xb553('0x28')](_0x5b465e)[_0xb553('0x35')](_0x26a9e6);};}exports[_0xb553('0x36')]=function(_0x35fcaa,_0x76dccb){var _0x4f631e={},_0x4494d6={},_0x345c55={'count':0x0,'rows':[]};var _0x2832d6=_[_0xb553('0x37')](db[_0xb553('0x38')][_0xb553('0x39')],function(_0x5dfb16){return{'name':_0x5dfb16[_0xb553('0x3a')],'type':_0x5dfb16[_0xb553('0x3b')][_0xb553('0x3c')]};});_0x4494d6[_0xb553('0x3d')]=_['map'](_0x2832d6,_0xb553('0x34'));_0x4494d6[_0xb553('0x3e')]=_['keys'](_0x35fcaa[_0xb553('0x3e')]);_0x4494d6[_0xb553('0x3f')]=_['intersection'](_0x4494d6[_0xb553('0x3d')],_0x4494d6[_0xb553('0x3e')]);_0x4f631e[_0xb553('0x40')]=_[_0xb553('0x41')](_0x4494d6[_0xb553('0x3d')],qs['fields'](_0x35fcaa[_0xb553('0x3e')][_0xb553('0x42')]));_0x4f631e[_0xb553('0x40')]=_0x4f631e[_0xb553('0x40')]['length']?_0x4f631e[_0xb553('0x40')]:_0x4494d6[_0xb553('0x3d')];if(!_0x35fcaa[_0xb553('0x3e')][_0xb553('0x43')](_0xb553('0x44'))){_0x4f631e[_0xb553('0x45')]=qs[_0xb553('0x45')](_0x35fcaa[_0xb553('0x3e')][_0xb553('0x45')]);_0x4f631e['offset']=qs[_0xb553('0x2a')](_0x35fcaa[_0xb553('0x3e')][_0xb553('0x2a')]);}_0x4f631e[_0xb553('0x46')]=qs[_0xb553('0x47')](_0x35fcaa[_0xb553('0x3e')][_0xb553('0x47')]);_0x4f631e['where']=qs['filters'](_[_0xb553('0x48')](_0x35fcaa[_0xb553('0x3e')],_0x4494d6['filters']),_0x2832d6);if(_0x35fcaa[_0xb553('0x3e')][_0xb553('0x49')]){_0x4f631e[_0xb553('0x4a')]=_[_0xb553('0x4b')](_0x4f631e['where'],{'$or':_[_0xb553('0x37')](_0x2832d6,function(_0x56b184){if(_0x56b184[_0xb553('0x3b')]!==_0xb553('0x4c')){var _0x538c41={};_0x538c41[_0x56b184[_0xb553('0x34')]]={'$like':'%'+_0x35fcaa['query'][_0xb553('0x49')]+'%'};return _0x538c41;}})});}_0x4f631e=_[_0xb553('0x4b')]({},_0x4f631e,_0x35fcaa[_0xb553('0x4d')]);var _0xecb544={'where':_0x4f631e[_0xb553('0x4a')]};return db[_0xb553('0x38')]['count'](_0xecb544)[_0xb553('0x1d')](function(_0x3bdd99){_0x345c55['count']=_0x3bdd99;if(_0x35fcaa['query']['includeAll']){_0x4f631e[_0xb553('0x4e')]=[{'all':!![]}];}return db[_0xb553('0x38')][_0xb553('0x4f')](_0x4f631e);})[_0xb553('0x1d')](function(_0x446585){_0x345c55[_0xb553('0x50')]=_0x446585;return _0x345c55;})['then'](respondWithFilteredResult(_0x76dccb,_0x4f631e))[_0xb553('0x27')](handleError(_0x76dccb,null));};exports[_0xb553('0x51')]=function(_0x4e1819,_0x3b6440){var _0x3d55a3={'raw':!![],'where':{'id':_0x4e1819[_0xb553('0x52')]['id']}},_0x351658={};_0x351658[_0xb553('0x3d')]=_[_0xb553('0x53')](db[_0xb553('0x38')][_0xb553('0x39')]);_0x351658['query']=_[_0xb553('0x53')](_0x4e1819[_0xb553('0x3e')]);_0x351658['filters']=_[_0xb553('0x41')](_0x351658['model'],_0x351658[_0xb553('0x3e')]);_0x3d55a3[_0xb553('0x40')]=_[_0xb553('0x41')](_0x351658['model'],qs[_0xb553('0x42')](_0x4e1819[_0xb553('0x3e')][_0xb553('0x42')]));_0x3d55a3['attributes']=_0x3d55a3['attributes'][_0xb553('0x54')]?_0x3d55a3['attributes']:_0x351658[_0xb553('0x3d')];if(_0x4e1819['query'][_0xb553('0x55')]){_0x3d55a3['include']=[{'all':!![]}];}_0x3d55a3=_[_0xb553('0x4b')]({},_0x3d55a3,_0x4e1819[_0xb553('0x4d')]);return db['Network'][_0xb553('0x56')](_0x3d55a3)[_0xb553('0x1d')](handleEntityNotFound(_0x3b6440,null))[_0xb553('0x1d')](respondWithResult(_0x3b6440,null))[_0xb553('0x27')](handleError(_0x3b6440,null));};exports[_0xb553('0x57')]=function(_0xc67154,_0x40c30c,_0x4d1817){var _0x47705b;return db[_0xb553('0x58')][_0xb553('0x59')](function(_0x2b176e){return db[_0xb553('0x38')]['create'](_0xc67154[_0xb553('0x5a')],{'raw':!![]})[_0xb553('0x1d')](function(_0x4ea1f2){_0x47705b=_0x4ea1f2;return db[_0xb553('0x38')][_0xb553('0x4f')]({'where':{'type':_0xc67154['body'][_0xb553('0x3b')]},'raw':!![]});})['then'](function(_0xbfdde8){if(_0x47705b[_0xb553('0x3b')][_0xb553('0x5b')]()=='STUN'){var _0xb27078=fs['readFileSync'](path[_0xb553('0x5c')](config['root'],_0xb553('0x5d')),_0xb553('0x5e'));var _0x46d71f=ejs[_0xb553('0x5f')](_0xb27078,{'networks':_0xbfdde8||[]});fs[_0xb553('0x60')](_0xb553('0x61'),_0x46d71f);return respondWithRpcPromise('Reload','create',{'module':_0xb553('0x62')});}else if(_0x47705b['type'][_0xb553('0x5b')]()==_0xb553('0x63')){var _0x101d0b=fs[_0xb553('0x64')](path[_0xb553('0x5c')](config['root'],_0xb553('0x65')),_0xb553('0x5e'));var _0x4c1344=ejs['render'](_0x101d0b,{'networks':_0xbfdde8||[]});fs[_0xb553('0x60')]('/etc/asterisk/turn_xcally.conf',_0x4c1344);return respondWithRpcPromise(_0xb553('0x66'),_0xb553('0x57'),{'module':_0xb553('0x62')});}else{var _0x9f4073=fs[_0xb553('0x64')](path[_0xb553('0x5c')](config[_0xb553('0x67')],_0xb553('0x68')),_0xb553('0x5e'));var _0x2ea8fe=ejs[_0xb553('0x5f')](_0x9f4073,{'networks':_0xbfdde8||[]});fs['writeFileSync'](util['format'](_0xb553('0x69'),_0xc67154[_0xb553('0x5a')][_0xb553('0x3b')][_0xb553('0x6a')]()),_0x2ea8fe);return respondWithRpcPromise('Reload',_0xb553('0x57'),{'module':_0xb553('0x6b')});}return null;})[_0xb553('0x1d')](function(){return _0x47705b;});})[_0xb553('0x1d')](respondWithResult(_0x40c30c,0xc9))[_0xb553('0x27')](handleError(_0x40c30c,null));};exports[_0xb553('0x6c')]=function(_0x4a4c47,_0x25f1ad,_0x2eee30){var _0x2a0dc3;return db['sequelize'][_0xb553('0x59')](function(_0x15fda9){return db[_0xb553('0x38')][_0xb553('0x56')]({'where':{'id':_0x4a4c47[_0xb553('0x52')]['id']}})[_0xb553('0x1d')](handleEntityNotFound(_0x25f1ad,null))[_0xb553('0x1d')](saveUpdates(_0x4a4c47['body'],null))[_0xb553('0x1d')](function(_0x5db1b0){if(_0x5db1b0){_0x2a0dc3=_0x5db1b0;return db['Network']['findAll']({'where':{'type':_0x2a0dc3['type']},'raw':!![]});}return null;})[_0xb553('0x1d')](function(_0x48a8cd){if(_0x2a0dc3[_0xb553('0x3b')][_0xb553('0x5b')]()==_0xb553('0x6d')){var _0x281a35=fs[_0xb553('0x64')](path['join'](config[_0xb553('0x67')],'server/files/templates/stun_multiple.ejs'),_0xb553('0x5e'));var _0x417320=ejs['render'](_0x281a35,{'networks':_0x48a8cd||[]});fs[_0xb553('0x60')](_0xb553('0x61'),_0x417320);return respondWithRpcPromise(_0xb553('0x66'),'update',{'module':_0xb553('0x62')});}else if(_0x2a0dc3['type'][_0xb553('0x5b')]()==_0xb553('0x63')){var _0x2e6d52=fs[_0xb553('0x64')](path[_0xb553('0x5c')](config[_0xb553('0x67')],_0xb553('0x65')),'utf8');var _0x4b9cc2=ejs[_0xb553('0x5f')](_0x2e6d52,{'networks':_0x48a8cd||[]});fs['writeFileSync'](_0xb553('0x6e'),_0x4b9cc2);return respondWithRpcPromise(_0xb553('0x66'),_0xb553('0x6c'),{'module':_0xb553('0x62')});}else{var _0x1a0605=fs[_0xb553('0x64')](path['join'](config[_0xb553('0x67')],_0xb553('0x68')),'utf8');var _0x98a21=ejs[_0xb553('0x5f')](_0x1a0605,{'networks':_0x48a8cd||[]});fs[_0xb553('0x60')](util[_0xb553('0x6f')](_0xb553('0x69'),_0x4a4c47[_0xb553('0x5a')][_0xb553('0x3b')][_0xb553('0x6a')]()),_0x98a21);return respondWithRpcPromise(_0xb553('0x66'),_0xb553('0x6c'),{'module':_0xb553('0x6b')});}return null;})[_0xb553('0x1d')](function(_0x203b87){if(_0x203b87){return _0x2a0dc3;}return null;});})['then'](respondWithResult(_0x25f1ad,null))[_0xb553('0x27')](handleError(_0x25f1ad,null));};exports[_0xb553('0x31')]=function(_0x342119,_0x1c11a3,_0x51846a){var _0x1386ea;return db['Network'][_0xb553('0x56')]({'where':{'id':_0x342119[_0xb553('0x52')]['id']}})[_0xb553('0x1d')](function(_0x50d31e){_0x1386ea=_0x50d31e;return _0x50d31e;})[_0xb553('0x1d')](handleEntityNotFound(_0x1c11a3,null))[_0xb553('0x1d')](removeEntity(_0x1c11a3,null))['then'](function(){if(_0x1386ea){return db[_0xb553('0x38')]['findAll']({'where':{'type':_0x1386ea['type']},'raw':!![]});}})[_0xb553('0x1d')](function(_0x2e5d24){if(_0x1386ea[_0xb553('0x3b')]['toUpperCase']()==_0xb553('0x6d')){var _0x318b9f=fs[_0xb553('0x64')](path['join'](config[_0xb553('0x67')],_0xb553('0x5d')),_0xb553('0x5e'));var _0x3970a=ejs[_0xb553('0x5f')](_0x318b9f,{'networks':_0x2e5d24||[]});fs[_0xb553('0x60')](_0xb553('0x61'),_0x3970a);return respondWithRpcPromise(_0xb553('0x66'),_0xb553('0x31'),{'module':_0xb553('0x62')});}else if(_0x1386ea['type'][_0xb553('0x5b')]()==_0xb553('0x63')){var _0x36d1a8=fs[_0xb553('0x64')](path[_0xb553('0x5c')](config['root'],_0xb553('0x65')),_0xb553('0x5e'));var _0x5283bb=ejs[_0xb553('0x5f')](_0x36d1a8,{'networks':_0x2e5d24||[]});fs[_0xb553('0x60')](_0xb553('0x6e'),_0x5283bb);return respondWithRpcPromise('Reload','destroy',{'module':_0xb553('0x62')});}else{var _0x424cb6=fs['readFileSync'](path[_0xb553('0x5c')](config['root'],_0xb553('0x68')),_0xb553('0x5e'));var _0x2bb0df=ejs[_0xb553('0x5f')](_0x424cb6,{'networks':_0x2e5d24||[]});fs[_0xb553('0x60')](util[_0xb553('0x6f')](_0xb553('0x69'),_0x342119[_0xb553('0x5a')][_0xb553('0x3b')]['toLowerCase']()),_0x2bb0df);return respondWithRpcPromise(_0xb553('0x66'),_0xb553('0x31'),{'module':_0xb553('0x6b')});}return null;})[_0xb553('0x27')](handleError(_0x1c11a3,null));};
\ No newline at end of file
index ed00f2b..b8ca05a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24cf=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','Network','../../config/logger'];(function(_0x4a08f5,_0x29f8b0){var _0x4f2cd6=function(_0x2716f8){while(--_0x2716f8){_0x4a08f5['push'](_0x4a08f5['shift']());}};_0x4f2cd6(++_0x29f8b0);}(_0x24cf,0x1d5));var _0xf24c=function(_0x4d9d1e,_0x1a7f59){_0x4d9d1e=_0x4d9d1e-0x0;var _0x535684=_0x24cf[_0x4d9d1e];return _0x535684;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf24c('0x0'))(_0xf24c('0x1'));var moment=require(_0xf24c('0x2'));var BPromise=require(_0xf24c('0x3'));var rp=require(_0xf24c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf24c('0x5'));var config=require(_0xf24c('0x6'));var attributes=require(_0xf24c('0x7'));module[_0xf24c('0x8')]=function(_0x5c4ebc,_0x4983e2){return _0x5c4ebc['define'](_0xf24c('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3667=['network','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./network.attributes','exports','Network'];(function(_0x47d342,_0x151297){var _0x2ba198=function(_0x11a47d){while(--_0x11a47d){_0x47d342['push'](_0x47d342['shift']());}};_0x2ba198(++_0x151297);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var moment=require(_0x7366('0x4'));var BPromise=require('bluebird');var rp=require(_0x7366('0x5'));var fs=require('fs');var path=require(_0x7366('0x6'));var rimraf=require('rimraf');var config=require(_0x7366('0x7'));var attributes=require(_0x7366('0x8'));module[_0x7366('0x9')]=function(_0x1c0cf4,_0x101e3d){return _0x1c0cf4['define'](_0x7366('0xa'),attributes,{'tableName':_0x7366('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5310dff..13c8bc2 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(_0xc8f868,_0x56aec0){var _0x14f5cf=function(_0x5a0d5d){while(--_0x5a0d5d){_0xc8f868['push'](_0xc8f868['shift']());}};_0x14f5cf(++_0x56aec0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x5001d5,_0x235b0f){_0x5001d5=_0x5001d5-0x0;var _0x37cd80=_0x7a54[_0x5001d5];return _0x37cd80;};'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 648ad76..d289c92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3508=['/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x3508,0xe5));var _0x8350=function(_0x569ea3,_0x114b8e){_0x569ea3=_0x569ea3-0x0;var _0x10ef56=_0x3508[_0x569ea3];return _0x10ef56;};'use strict';var multer=require('multer');var util=require(_0x8350('0x0'));var path=require(_0x8350('0x1'));var timeout=require(_0x8350('0x2'));var express=require(_0x8350('0x3'));var router=express[_0x8350('0x4')]();var fs_extra=require(_0x8350('0x5'));var auth=require(_0x8350('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x8350('0x7')]('/',auth[_0x8350('0x8')](),controller[_0x8350('0x9')]);router[_0x8350('0x7')](_0x8350('0xa'),auth['isAuthenticated'](),controller[_0x8350('0xb')]);router[_0x8350('0x7')](_0x8350('0xc'),auth[_0x8350('0x8')](),controller[_0x8350('0xd')]);router['get'](_0x8350('0xe'),auth[_0x8350('0x8')](),controller[_0x8350('0xf')]);router['get'](_0x8350('0x10'),auth[_0x8350('0x8')](),controller['getAnswers']);router[_0x8350('0x7')](_0x8350('0x11'),auth[_0x8350('0x8')](),controller[_0x8350('0x12')]);router[_0x8350('0x7')]('/:id/interactions',auth[_0x8350('0x8')](),controller[_0x8350('0x13')]);router['get'](_0x8350('0x14'),auth[_0x8350('0x8')](),controller['getAgents']);router[_0x8350('0x15')]('/',auth['isAuthenticated'](),controller[_0x8350('0x16')]);router[_0x8350('0x15')](_0x8350('0xe'),auth['isAuthenticated'](),controller[_0x8350('0x17')]);router[_0x8350('0x15')](_0x8350('0x10'),auth[_0x8350('0x8')](),controller[_0x8350('0x18')]);router[_0x8350('0x15')](_0x8350('0x19'),controller[_0x8350('0x1a')]);router['post'](_0x8350('0x11'),auth['isAuthenticated'](),controller[_0x8350('0x1b')]);router[_0x8350('0x15')](_0x8350('0x14'),auth[_0x8350('0x8')](),controller['addAgents']);router['post'](_0x8350('0x1c'),auth['isAuthenticated'](),controller[_0x8350('0x1d')]);router['put'](_0x8350('0xc'),auth[_0x8350('0x8')](),controller['update']);router[_0x8350('0x1e')](_0x8350('0xc'),auth[_0x8350('0x8')](),controller['destroy']);router[_0x8350('0x1e')](_0x8350('0xe'),auth['isAuthenticated'](),controller[_0x8350('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x8350('0x8')](),controller[_0x8350('0x20')]);router[_0x8350('0x1e')](_0x8350('0x14'),auth[_0x8350('0x8')](),controller[_0x8350('0x21')]);module[_0x8350('0x22')]=router;
\ No newline at end of file
+var _0x3c35=['/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','put','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/users','getAgents','create','post'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x3c35,0x16a));var _0x53c3=function(_0x4b8268,_0x29486a){_0x4b8268=_0x4b8268-0x0;var _0x1d41c6=_0x3c35[_0x4b8268];return _0x1d41c6;};'use strict';var multer=require(_0x53c3('0x0'));var util=require(_0x53c3('0x1'));var path=require(_0x53c3('0x2'));var timeout=require(_0x53c3('0x3'));var express=require('express');var router=express[_0x53c3('0x4')]();var fs_extra=require(_0x53c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x53c3('0x6'));var config=require(_0x53c3('0x7'));var controller=require(_0x53c3('0x8'));router[_0x53c3('0x9')]('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0xb')]);router[_0x53c3('0x9')]('/describe',auth[_0x53c3('0xa')](),controller[_0x53c3('0xc')]);router[_0x53c3('0x9')](_0x53c3('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth[_0x53c3('0xa')](),controller[_0x53c3('0xe')]);router[_0x53c3('0x9')](_0x53c3('0xf'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x10')]);router[_0x53c3('0x9')](_0x53c3('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0x53c3('0x9')](_0x53c3('0x12'),auth[_0x53c3('0xa')](),controller['getInteractions']);router[_0x53c3('0x9')](_0x53c3('0x13'),auth['isAuthenticated'](),controller[_0x53c3('0x14')]);router['post']('/',auth[_0x53c3('0xa')](),controller[_0x53c3('0x15')]);router[_0x53c3('0x16')](_0x53c3('0x17'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x18')]);router[_0x53c3('0x16')]('/:id/canned_answers',auth[_0x53c3('0xa')](),controller[_0x53c3('0x19')]);router['post'](_0x53c3('0x1a'),controller[_0x53c3('0x1b')]);router[_0x53c3('0x16')](_0x53c3('0x11'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x1c')]);router[_0x53c3('0x16')](_0x53c3('0x13'),auth['isAuthenticated'](),controller['addAgents']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x53c3('0x1d')]);router[_0x53c3('0x1e')](_0x53c3('0xd'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x1f')]);router[_0x53c3('0x20')](_0x53c3('0xd'),auth[_0x53c3('0xa')](),controller['destroy']);router['delete'](_0x53c3('0x17'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x53c3('0x20')](_0x53c3('0xf'),auth[_0x53c3('0xa')](),controller[_0x53c3('0x21')]);router[_0x53c3('0x20')]('/:id/users',auth[_0x53c3('0xa')](),controller[_0x53c3('0x22')]);module['exports']=router;
\ No newline at end of file
index 82d4b56..2bb3ed2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x997a=['generate','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x51e22f,_0x335f66){var _0x3cdbb1=function(_0x1e3da9){while(--_0x1e3da9){_0x51e22f['push'](_0x51e22f['shift']());}};_0x3cdbb1(++_0x335f66);}(_0x997a,0x1b5));var _0xa997=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x997a[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xa997('0x0'));var rs=require(_0xa997('0x1'));module[_0xa997('0x2')]={'name':{'type':Sequelize[_0xa997('0x3')],'unique':_0xa997('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xa997('0x3')]},'token':{'type':Sequelize[_0xa997('0x3')],'defaultValue':function(){return rs[_0xa997('0x5')]();}},'replyUri':{'type':Sequelize[_0xa997('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'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['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa997('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa997('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xa997('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa997('0x8')],'defaultValue':![],'comment':_0xa997('0x9'),'set':function(_0x335951){if(!_0x335951)this[_0xa997('0xa')](_0xa997('0xb'),null);this[_0xa997('0xa')](_0xa997('0xc'),_0x335951);}}};
\ No newline at end of file
+var _0x49ae=['name','STRING','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x5aee7a,_0x41bcda){var _0x3e37ed=function(_0x4ce703){while(--_0x4ce703){_0x5aee7a['push'](_0x5aee7a['shift']());}};_0x3e37ed(++_0x41bcda);}(_0x49ae,0x1a2));var _0xe49a=function(_0x25d26c,_0x3b98e6){_0x25d26c=_0x25d26c-0x0;var _0x54b976=_0x49ae[_0x25d26c];return _0x54b976;};'use strict';var Sequelize=require(_0xe49a('0x0'));var rs=require(_0xe49a('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe49a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe49a('0x3')]},'token':{'type':Sequelize[_0xe49a('0x3')],'defaultValue':function(){return rs[_0xe49a('0x4')]();}},'replyUri':{'type':Sequelize[_0xe49a('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe49a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe49a('0x5')],'defaultValue':function(){return _0xe49a('0x6');}},'notificationSound':{'type':Sequelize[_0xe49a('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe49a('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe49a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xe49a('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe49a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe49a('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe49a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe49a('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe49a('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x530978){if(!_0x530978)this[_0xe49a('0x9')](_0xe49a('0xa'),null);this[_0xe49a('0x9')](_0xe49a('0xb'),_0x530978);}}};
\ No newline at end of file
index 9a4094a..597c7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea47=['Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','applications','list','orderBy','priority','account','Applications','ListId','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','hasOwnProperty','Contact','Owner','fullname','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','count','findAll','params','Pause','rawAttributes','includeAll','include','find','create','user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','Disposition','getDispositions','findOne','order','OpenchannelAccountId','rows','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','CmContact'];(function(_0x1ac621,_0x862fe4){var _0xe9ea98=function(_0x2ffcda){while(--_0x2ffcda){_0x1ac621['push'](_0x1ac621['shift']());}};_0xe9ea98(++_0x862fe4);}(_0xea47,0x10b));var _0x7ea4=function(_0x4a26bc,_0x304433){_0x4a26bc=_0x4a26bc-0x0;var _0x26004b=_0xea47[_0x4a26bc];return _0x26004b;};'use strict';var emlformat=require(_0x7ea4('0x0'));var rimraf=require(_0x7ea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ea4('0x2'));var rp=require(_0x7ea4('0x3'));var moment=require('moment');var BPromise=require(_0x7ea4('0x4'));var Mustache=require(_0x7ea4('0x5'));var util=require('util');var path=require(_0x7ea4('0x6'));var sox=require(_0x7ea4('0x7'));var csv=require('to-csv');var ejs=require(_0x7ea4('0x8'));var fs=require('fs');var fs_extra=require(_0x7ea4('0x9'));var _=require(_0x7ea4('0xa'));var squel=require(_0x7ea4('0xb'));var crypto=require('crypto');var jsforce=require(_0x7ea4('0xc'));var deskjs=require(_0x7ea4('0xd'));var toCsv=require(_0x7ea4('0xe'));var querystring=require(_0x7ea4('0xf'));var Papa=require(_0x7ea4('0x10'));var Redis=require(_0x7ea4('0x11'));var authService=require(_0x7ea4('0x12'));var qs=require(_0x7ea4('0x13'));var as=require(_0x7ea4('0x14'));var hardwareService=require(_0x7ea4('0x15'));var logger=require(_0x7ea4('0x16'))(_0x7ea4('0x17'));var utils=require(_0x7ea4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7ea4('0x19'));var db=require(_0x7ea4('0x1a'))['db'];config['redis']=_[_0x7ea4('0x1b')](config[_0x7ea4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ea4('0x1d'))(new Redis(config['redis']));require(_0x7ea4('0x1e'))[_0x7ea4('0x1f')](socket);var jayson=require(_0x7ea4('0x20'));var client=jayson[_0x7ea4('0x21')][_0x7ea4('0x22')]({'port':0x232c});var client9002=jayson['client'][_0x7ea4('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x8d9e76,_0x1e1e64,_0x57ecb9,_0x40f458){return new BPromise(function(_0x60d643,_0x4d19e7){var _0x25e7ba=_0x40f458||client;return _0x25e7ba[_0x7ea4('0x23')](_0x8d9e76,_0x57ecb9)[_0x7ea4('0x24')](function(_0x46c14e){logger[_0x7ea4('0x25')](_0x7ea4('0x26'),_0x1e1e64,'request\x20sent');logger[_0x7ea4('0x27')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1e1e64,_0x7ea4('0x28'),JSON[_0x7ea4('0x29')](_0x46c14e));if(_0x46c14e[_0x7ea4('0x2a')]){if(_0x46c14e['error'][_0x7ea4('0x2b')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1e1e64,_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);return _0x4d19e7(_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);}logger[_0x7ea4('0x2a')](_0x7ea4('0x26'),_0x1e1e64,_0x46c14e['error'][_0x7ea4('0x2c')]);return _0x60d643(_0x46c14e[_0x7ea4('0x2a')][_0x7ea4('0x2c')]);}else{logger[_0x7ea4('0x25')](_0x7ea4('0x26'),_0x1e1e64,_0x7ea4('0x28'));_0x60d643(_0x46c14e['result'][_0x7ea4('0x2c')]);}})[_0x7ea4('0x2d')](function(_0x1685d6){logger[_0x7ea4('0x2a')](_0x7ea4('0x26'),_0x1e1e64,_0x1685d6);_0x4d19e7(_0x1685d6);});});}function respondWithStatusCode(_0xa3b97,_0x30208a){_0x30208a=_0x30208a||0xcc;return function(_0x172cf6){if(_0x172cf6){return _0xa3b97[_0x7ea4('0x2e')](_0x30208a);}return _0xa3b97[_0x7ea4('0x2f')](_0x30208a)[_0x7ea4('0x30')]();};}function respondWithResult(_0x2d576e,_0x2cdeb7){_0x2cdeb7=_0x2cdeb7||0xc8;return function(_0x253d1a){if(_0x253d1a){return _0x2d576e[_0x7ea4('0x2f')](_0x2cdeb7)[_0x7ea4('0x31')](_0x253d1a);}};}function respondWithFilteredResult(_0x1fe932,_0x4a06f2){return function(_0x284587){if(_0x284587){var _0x5357b8=typeof _0x4a06f2[_0x7ea4('0x32')]===_0x7ea4('0x33')&&typeof _0x4a06f2[_0x7ea4('0x34')]==='undefined';var _0x1f1f98=_0x284587['count'];var _0x2edc54=_0x5357b8?0x0:_0x4a06f2[_0x7ea4('0x32')];var _0x332a29=_0x5357b8?_0x284587['count']:_0x4a06f2[_0x7ea4('0x32')]+_0x4a06f2[_0x7ea4('0x34')];var _0x49230e;if(_0x332a29>=_0x1f1f98){_0x332a29=_0x1f1f98;_0x49230e=0xc8;}else{_0x49230e=0xce;}_0x1fe932[_0x7ea4('0x2f')](_0x49230e);return _0x1fe932[_0x7ea4('0x35')](_0x7ea4('0x36'),_0x2edc54+'-'+_0x332a29+'/'+_0x1f1f98)[_0x7ea4('0x31')](_0x284587);}return null;};}function patchUpdates(_0x3cbea1){return function(_0x5c0dd0){try{jsonpatch[_0x7ea4('0x37')](_0x5c0dd0,_0x3cbea1,!![]);}catch(_0x435836){return BPromise[_0x7ea4('0x38')](_0x435836);}return _0x5c0dd0[_0x7ea4('0x39')]();};}function saveUpdates(_0x29a223,_0x4a4778){return function(_0x4f7300){if(_0x4f7300){return _0x4f7300['update'](_0x29a223)[_0x7ea4('0x24')](function(_0x5c98b3){return _0x5c98b3;});}return null;};}function removeEntity(_0x8c3001,_0x3c9411){return function(_0x9c5d7d){if(_0x9c5d7d){return _0x9c5d7d['destroy']()[_0x7ea4('0x24')](function(){var _0x5d51ec=_0x9c5d7d[_0x7ea4('0x3a')]({'plain':!![]});var _0x27b3e1='OpenchannelAccounts';return db[_0x7ea4('0x3b')][_0x7ea4('0x3c')]({'where':{'type':_0x27b3e1,'resourceId':_0x5d51ec['id']}})[_0x7ea4('0x24')](function(){return _0x9c5d7d;});})[_0x7ea4('0x24')](function(){_0x8c3001[_0x7ea4('0x2f')](0xcc)[_0x7ea4('0x30')]();});}};}function handleEntityNotFound(_0x4d0092,_0x3d7a3f){return function(_0x44fca6){if(!_0x44fca6){_0x4d0092[_0x7ea4('0x2e')](0x194);}return _0x44fca6;};}function handleError(_0x4aafe8,_0x3790e1){_0x3790e1=_0x3790e1||0x1f4;return function(_0x4ed37d){logger[_0x7ea4('0x2a')](_0x4ed37d[_0x7ea4('0x3d')]);if(_0x4ed37d[_0x7ea4('0x3e')]){delete _0x4ed37d[_0x7ea4('0x3e')];}_0x4aafe8['status'](_0x3790e1)[_0x7ea4('0x3f')](_0x4ed37d);};}exports['index']=function(_0x4544ca,_0x4f1dc7){var _0x572eb1={'include':[{'model':db['Pause'],'as':_0x7ea4('0x40')}]},_0x5925e6={},_0x5760aa={'count':0x0,'rows':[]};var _0x217057=_[_0x7ea4('0x41')](db[_0x7ea4('0x42')]['rawAttributes'],function(_0x4f540e){return{'name':_0x4f540e['fieldName'],'type':_0x4f540e[_0x7ea4('0x43')][_0x7ea4('0x44')]};});_0x5925e6[_0x7ea4('0x45')]=_['map'](_0x217057,_0x7ea4('0x3e'));_0x5925e6['query']=_[_0x7ea4('0x46')](_0x4544ca[_0x7ea4('0x47')]);_0x5925e6['filters']=_[_0x7ea4('0x48')](_0x5925e6[_0x7ea4('0x45')],_0x5925e6[_0x7ea4('0x47')]);_0x572eb1[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x5925e6['model'],qs[_0x7ea4('0x4a')](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x572eb1[_0x7ea4('0x49')]=_0x572eb1[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x572eb1[_0x7ea4('0x49')]:_0x5925e6[_0x7ea4('0x45')];if(!_0x4544ca['query']['hasOwnProperty'](_0x7ea4('0x4c'))){_0x572eb1[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x572eb1['offset']=qs['offset'](_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x32')]);}_0x572eb1['order']=qs[_0x7ea4('0x4d')](_0x4544ca['query'][_0x7ea4('0x4d')]);_0x572eb1[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_['pick'](_0x4544ca['query'],_0x5925e6[_0x7ea4('0x4f')]),_0x217057);if(_0x4544ca[_0x7ea4('0x47')]['filter']){_0x572eb1[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x572eb1[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x217057,function(_0x404938){if(_0x404938[_0x7ea4('0x43')]!==_0x7ea4('0x51')){var _0x3d28cb={};_0x3d28cb[_0x404938[_0x7ea4('0x3e')]]={'$like':'%'+_0x4544ca[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x3d28cb;}})});}_0x572eb1=_[_0x7ea4('0x50')]({},_0x572eb1,_0x4544ca[_0x7ea4('0x53')]);var _0x3f0875={'where':_0x572eb1[_0x7ea4('0x4e')]};return db['OpenchannelAccount']['count'](_0x3f0875)[_0x7ea4('0x24')](function(_0x3953ad){_0x5760aa[_0x7ea4('0x54')]=_0x3953ad;if(_0x4544ca[_0x7ea4('0x47')]['includeAll']){_0x572eb1['include']=[{'all':!![]}];}return db[_0x7ea4('0x42')][_0x7ea4('0x55')](_0x572eb1);})[_0x7ea4('0x24')](function(_0x4a7125){_0x5760aa['rows']=_0x4a7125;return _0x5760aa;})[_0x7ea4('0x24')](respondWithFilteredResult(_0x4f1dc7,_0x572eb1))['catch'](handleError(_0x4f1dc7,null));};exports['show']=function(_0x3b0b65,_0x5332e1){var _0x76bfff={'raw':![],'where':{'id':_0x3b0b65[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x57')],'as':'mandatoryDispositionPause'}]},_0x1cc1c8={};_0x1cc1c8[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x42')][_0x7ea4('0x58')]);_0x1cc1c8['query']=_[_0x7ea4('0x46')](_0x3b0b65[_0x7ea4('0x47')]);_0x1cc1c8[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x1cc1c8['model'],_0x1cc1c8[_0x7ea4('0x47')]);_0x76bfff[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x1cc1c8['model'],qs[_0x7ea4('0x4a')](_0x3b0b65[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x76bfff['attributes']=_0x76bfff[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x76bfff[_0x7ea4('0x49')]:_0x1cc1c8[_0x7ea4('0x45')];if(_0x3b0b65[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x76bfff[_0x7ea4('0x5a')]=[{'all':!![]}];}_0x76bfff=_[_0x7ea4('0x50')]({},_0x76bfff,_0x3b0b65[_0x7ea4('0x53')]);return db['OpenchannelAccount'][_0x7ea4('0x5b')](_0x76bfff)[_0x7ea4('0x24')](handleEntityNotFound(_0x5332e1,null))[_0x7ea4('0x24')](respondWithResult(_0x5332e1,null))[_0x7ea4('0x2d')](handleError(_0x5332e1,null));};exports[_0x7ea4('0x5c')]=function(_0x592fc6,_0x4b3582){return db['OpenchannelAccount']['create'](_0x592fc6['body'],{})['then'](function(_0x37b67d){var _0x1fa351=_0x592fc6[_0x7ea4('0x5d')][_0x7ea4('0x3a')]({'plain':!![]});if(!_0x1fa351)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fa351[_0x7ea4('0x5e')]===_0x7ea4('0x5d')){var _0x4a9fd3=_0x37b67d[_0x7ea4('0x3a')]({'plain':!![]});var _0x3fe908=_0x7ea4('0x5f');return db['UserProfileSection'][_0x7ea4('0x5b')]({'where':{'name':_0x3fe908,'userProfileId':_0x1fa351[_0x7ea4('0x60')]},'raw':!![]})[_0x7ea4('0x24')](function(_0xf8b556){if(_0xf8b556&&_0xf8b556[_0x7ea4('0x61')]===0x0){return db[_0x7ea4('0x3b')][_0x7ea4('0x5c')]({'name':_0x4a9fd3['name'],'resourceId':_0x4a9fd3['id'],'type':_0xf8b556['name'],'sectionId':_0xf8b556['id']},{})[_0x7ea4('0x24')](function(){return _0x37b67d;});}else{return _0x37b67d;}})[_0x7ea4('0x2d')](function(_0x1ad08e){logger[_0x7ea4('0x2a')](_0x7ea4('0x62'),_0x1ad08e);throw _0x1ad08e;});}return _0x37b67d;})[_0x7ea4('0x24')](respondWithResult(_0x4b3582,0xc9))[_0x7ea4('0x2d')](handleError(_0x4b3582,null));};exports[_0x7ea4('0x63')]=function(_0x2241c7,_0x280c8e){if(_0x2241c7[_0x7ea4('0x64')]['id']){delete _0x2241c7[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x2241c7[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x57')],'as':_0x7ea4('0x40')}]})[_0x7ea4('0x24')](handleEntityNotFound(_0x280c8e,null))['then'](saveUpdates(_0x2241c7[_0x7ea4('0x64')],null))['then'](respondWithResult(_0x280c8e,null))[_0x7ea4('0x2d')](handleError(_0x280c8e,null));};exports[_0x7ea4('0x3c')]=function(_0x4f1317,_0x23c9a4){return db['OpenchannelAccount']['find']({'where':{'id':_0x4f1317[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x23c9a4,null))[_0x7ea4('0x24')](removeEntity(_0x23c9a4,null))[_0x7ea4('0x2d')](handleError(_0x23c9a4,null));};exports[_0x7ea4('0x65')]=function(_0x19bf84,_0x5dc1ee){return db[_0x7ea4('0x42')][_0x7ea4('0x65')]()[_0x7ea4('0x24')](respondWithResult(_0x5dc1ee,null))[_0x7ea4('0x2d')](handleError(_0x5dc1ee,null));};exports[_0x7ea4('0x66')]=function(_0x410d90,_0x5f4311,_0x2c7af8){if(_0x410d90[_0x7ea4('0x64')]['id']){delete _0x410d90[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x410d90[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x5f4311,null))[_0x7ea4('0x24')](function(_0x3c412a){if(_0x3c412a){_0x410d90[_0x7ea4('0x64')]['OpenchannelAccountId']=_0x3c412a['id'];return db[_0x7ea4('0x67')][_0x7ea4('0x5c')](_0x410d90['body']);}})[_0x7ea4('0x24')](respondWithResult(_0x5f4311,null))['catch'](handleError(_0x5f4311,null));};exports[_0x7ea4('0x68')]=function(_0x37e407,_0x329ebb,_0x9980da){var _0x16e276={'raw':![],'where':{}};var _0x10ce8a={};var _0x206fd4={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x37e407[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x329ebb,null))['then'](function(_0x4a06da){if(_0x4a06da){_0x10ce8a[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db['Disposition'][_0x7ea4('0x58')]);_0x10ce8a[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x37e407[_0x7ea4('0x47')]);_0x10ce8a['filters']=_['intersection'](_0x10ce8a[_0x7ea4('0x45')],_0x10ce8a[_0x7ea4('0x47')]);_0x16e276[_0x7ea4('0x49')]=_['intersection'](_0x10ce8a[_0x7ea4('0x45')],qs[_0x7ea4('0x4a')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x16e276[_0x7ea4('0x49')]=_0x16e276[_0x7ea4('0x49')]['length']?_0x16e276[_0x7ea4('0x49')]:_0x10ce8a[_0x7ea4('0x45')];if(!_0x37e407[_0x7ea4('0x47')]['hasOwnProperty'](_0x7ea4('0x4c'))){_0x16e276[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x16e276[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x32')]);}_0x16e276[_0x7ea4('0x6a')]=qs['sort'](_0x37e407[_0x7ea4('0x47')]['sort']);_0x16e276[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_['pick'](_0x37e407[_0x7ea4('0x47')],_0x10ce8a[_0x7ea4('0x4f')]));_0x16e276[_0x7ea4('0x4e')][_0x7ea4('0x6b')]=_0x4a06da['id'];if(_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x16e276[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x16e276[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x16e276[_0x7ea4('0x49')],function(_0x53e82e){var _0x2894d9={};_0x2894d9[_0x53e82e]={'$like':'%'+_0x37e407[_0x7ea4('0x47')]['filter']+'%'};return _0x2894d9;})});}_0x16e276=_['merge']({},_0x16e276,_0x37e407[_0x7ea4('0x53')]);return db[_0x7ea4('0x67')][_0x7ea4('0x54')]({'where':_0x16e276[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0x183f06){_0x206fd4[_0x7ea4('0x54')]=_0x183f06;if(_0x37e407[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x16e276[_0x7ea4('0x5a')]=[{'all':!![]}];}return db[_0x7ea4('0x67')][_0x7ea4('0x55')](_0x16e276);})[_0x7ea4('0x24')](function(_0x2b8960){_0x206fd4[_0x7ea4('0x6c')]=_0x2b8960;return _0x206fd4;});}})[_0x7ea4('0x24')](respondWithFilteredResult(_0x329ebb,_0x16e276))[_0x7ea4('0x2d')](handleError(_0x329ebb,null));};exports[_0x7ea4('0x6d')]=function(_0x1ff06c,_0x3f8e48,_0x544b14){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x1ff06c['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x3f8e48,null))['then'](function(_0x9706ea){if(_0x9706ea){return _0x9706ea['removeDispositions'](_0x1ff06c[_0x7ea4('0x47')][_0x7ea4('0x6e')]);}})[_0x7ea4('0x24')](respondWithStatusCode(_0x3f8e48,null))[_0x7ea4('0x2d')](handleError(_0x3f8e48,null));};exports['addAnswer']=function(_0x563d3c,_0x2cef3a,_0x5b17a2){if(_0x563d3c[_0x7ea4('0x64')]['id']){delete _0x563d3c[_0x7ea4('0x64')]['id'];}return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x563d3c[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x2cef3a,null))[_0x7ea4('0x24')](function(_0x278b5b){if(_0x278b5b){_0x563d3c['body']['OpenchannelAccountId']=_0x278b5b['id'];return db[_0x7ea4('0x6f')][_0x7ea4('0x5c')](_0x563d3c[_0x7ea4('0x64')]);}})[_0x7ea4('0x24')](respondWithResult(_0x2cef3a,null))[_0x7ea4('0x2d')](handleError(_0x2cef3a,null));};exports[_0x7ea4('0x70')]=function(_0x5b2294,_0x3d9f97,_0x5939fc){var _0x11ecaa={'raw':![],'where':{}};var _0x2fe56={};var _0x2bad23={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x5b2294[_0x7ea4('0x56')]['id']}})['then'](handleEntityNotFound(_0x3d9f97,null))[_0x7ea4('0x24')](function(_0x4fb370){if(_0x4fb370){_0x2fe56['model']=_[_0x7ea4('0x46')](db[_0x7ea4('0x6f')][_0x7ea4('0x58')]);_0x2fe56[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x5b2294[_0x7ea4('0x47')]);_0x2fe56[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x2fe56[_0x7ea4('0x45')],_0x2fe56[_0x7ea4('0x47')]);_0x11ecaa[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x2fe56[_0x7ea4('0x45')],qs['fields'](_0x5b2294['query']['fields']));_0x11ecaa[_0x7ea4('0x49')]=_0x11ecaa[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x11ecaa['attributes']:_0x2fe56[_0x7ea4('0x45')];if(!_0x5b2294[_0x7ea4('0x47')]['hasOwnProperty'](_0x7ea4('0x4c'))){_0x11ecaa[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x5b2294[_0x7ea4('0x47')]['limit']);_0x11ecaa[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x5b2294[_0x7ea4('0x47')]['offset']);}_0x11ecaa[_0x7ea4('0x6a')]=qs[_0x7ea4('0x4d')](_0x5b2294[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x11ecaa[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_[_0x7ea4('0x71')](_0x5b2294['query'],_0x2fe56[_0x7ea4('0x4f')]));_0x11ecaa['where'][_0x7ea4('0x6b')]=_0x4fb370['id'];if(_0x5b2294[_0x7ea4('0x47')]['filter']){_0x11ecaa[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x11ecaa[_0x7ea4('0x4e')],{'$or':_[_0x7ea4('0x41')](_0x11ecaa[_0x7ea4('0x49')],function(_0x3207a1){var _0x8f4b5c={};_0x8f4b5c[_0x3207a1]={'$like':'%'+_0x5b2294[_0x7ea4('0x47')]['filter']+'%'};return _0x8f4b5c;})});}_0x11ecaa=_[_0x7ea4('0x50')]({},_0x11ecaa,_0x5b2294[_0x7ea4('0x53')]);return db[_0x7ea4('0x6f')][_0x7ea4('0x54')]({'where':_0x11ecaa[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0xb5f448){_0x2bad23[_0x7ea4('0x54')]=_0xb5f448;if(_0x5b2294[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x11ecaa[_0x7ea4('0x5a')]=[{'all':!![]}];}return db[_0x7ea4('0x6f')]['findAll'](_0x11ecaa);})['then'](function(_0x167c3b){_0x2bad23[_0x7ea4('0x6c')]=_0x167c3b;return _0x2bad23;});}})['then'](respondWithFilteredResult(_0x3d9f97,_0x11ecaa))['catch'](handleError(_0x3d9f97,null));};exports['removeAnswers']=function(_0x4fa2ac,_0x4fe7fc,_0x27278d){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x4fa2ac['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x4fe7fc,null))[_0x7ea4('0x24')](function(_0x5895cf){if(_0x5895cf){return _0x5895cf[_0x7ea4('0x72')](_0x4fa2ac[_0x7ea4('0x47')]['ids']);}})[_0x7ea4('0x24')](respondWithStatusCode(_0x4fe7fc,null))[_0x7ea4('0x2d')](handleError(_0x4fe7fc,null));};exports[_0x7ea4('0x73')]=function(_0x5527da,_0x3cc481,_0x1c993b){var _0x28b7cf={'body':_0x5527da[_0x7ea4('0x64')],'channel':'openchannel'};var _0x3cae68=[];var _0x206fa3=[];var _0x29b279={};var _0x1fa7cc=![];return db[_0x7ea4('0x74')]['describe']()[_0x7ea4('0x24')](function(_0x157b04){if(!_0x157b04){throw new db[(_0x7ea4('0x75'))]['ValidationError'](_0x7ea4('0x76'));}_0x3cae68=_[_0x7ea4('0x77')](_[_0x7ea4('0x46')](_0x157b04),[_0x7ea4('0x78'),_0x7ea4('0x79')]);_0x206fa3=_[_0x7ea4('0x77')](_[_0x7ea4('0x46')](_0x157b04),[_0x7ea4('0x78'),_0x7ea4('0x79'),_0x7ea4('0x7a'),'ListId']);if(_0x5527da[_0x7ea4('0x64')]['id']){delete _0x5527da[_0x7ea4('0x64')]['id'];}if(_[_0x7ea4('0x7b')](_0x5527da['body'][_0x7ea4('0x7c')])){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x7e'));}if(_['isNil'](_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x64')])||_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x64')]===''){throw new db['Sequelize']['ValidationError'](_0x7ea4('0x7f'));}if(_[_0x7ea4('0x7b')](_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')])){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x81')+_0x206fa3);}if(!_[_0x7ea4('0x82')](_0x206fa3,_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')])){throw new db['Sequelize'][(_0x7ea4('0x7d'))](_0x7ea4('0x83')+_0x206fa3);}_0x29b279[_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x80')]]=_0x5527da['body'][_0x7ea4('0x7c')];})['then'](function(){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x5527da[_0x7ea4('0x56')]['id']},'include':[{'model':db[_0x7ea4('0x84')],'as':_0x7ea4('0x85'),'include':[{'model':db['CmContact'],'as':_0x7ea4('0x86'),'where':_0x29b279,'limit':0x1,'order':[['updatedAt',_0x7ea4('0x87')]]}]},{'model':db[_0x7ea4('0x88')],'as':'Applications'}]});})[_0x7ea4('0x24')](handleEntityNotFound(_0x3cc481,null))[_0x7ea4('0x24')](function(_0xaa3b3d){if(_0xaa3b3d&&_0xaa3b3d[_0x7ea4('0x85')]){_0x28b7cf['account']=_0xaa3b3d;_0x28b7cf[_0x7ea4('0x89')]=_0xaa3b3d['Applications'];_0x28b7cf[_0x7ea4('0x8a')]=_0xaa3b3d[_0x7ea4('0x85')];_0x28b7cf['applications']=_[_0x7ea4('0x8b')](_0x28b7cf[_0x7ea4('0x89')],[_0x7ea4('0x8c')],['asc']);if(_0x28b7cf[_0x7ea4('0x8d')]['Applications']){delete _0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x8e')];}if(_0x28b7cf['account'][_0x7ea4('0x85')]&&_0x28b7cf[_0x7ea4('0x8d')]['List'][_0x7ea4('0x86')][_0x7ea4('0x4b')]){return _0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x85')][_0x7ea4('0x86')][0x0];}var _0x47ef0b=_[_0x7ea4('0x1b')](_0x5527da['body'],{'firstName':_0x5527da[_0x7ea4('0x64')]['from'],'ListId':_0xaa3b3d[_0x7ea4('0x8f')]});_0x47ef0b[_0x5527da['body'][_0x7ea4('0x80')]]=_0x5527da['body'][_0x7ea4('0x7c')];return db[_0x7ea4('0x74')][_0x7ea4('0x5c')](_0x47ef0b,{'fields':_0x3cae68,'raw':!![]});}})[_0x7ea4('0x24')](handleEntityNotFound(_0x3cc481,null))['then'](function(_0x39b2d7){_0x28b7cf['contact']=_0x39b2d7;if(_0x39b2d7){var _0x148698={'ContactId':_0x39b2d7['id'],'OpenchannelAccountId':_0x5527da['params']['id'],'from':(_0x39b2d7[_0x7ea4('0x90')]||'')+'\x20'+(_0x39b2d7[_0x7ea4('0x91')]||'')};var _0x185535={'OpenchannelAccountId':_0x5527da['params']['id'],'closed':![]};if(_0x5527da[_0x7ea4('0x64')]['threadId']){_0x185535[_0x7ea4('0x92')]=_0x5527da['body']['threadId'];return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':_0x185535})[_0x7ea4('0x24')](function(_0x10854c){if(_0x10854c){return[_0x10854c,![]];}_0x148698[_0x7ea4('0x92')]=_0x5527da[_0x7ea4('0x64')]['threadId'];_0x148698['externalUrl']=_0x5527da['body'][_0x7ea4('0x94')];return db[_0x7ea4('0x93')][_0x7ea4('0x5c')](_0x148698)[_0x7ea4('0x24')](function(_0x4ef6d5){return[_0x4ef6d5,!![]];});});}else{_0x185535['threadId']=null;}_0x185535[_0x7ea4('0x95')]=_0x39b2d7['id'];return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':_0x185535})[_0x7ea4('0x24')](function(_0x9b5019){if(_0x9b5019){return[_0x9b5019,![]];}return db[_0x7ea4('0x93')][_0x7ea4('0x5c')](_0x148698)[_0x7ea4('0x24')](function(_0x4c5826){return[_0x4c5826,!![]];});});}})['spread'](function(_0x32312a,_0x23516b){if(_0x32312a){_0x1fa7cc=_0x23516b;if(!_0x23516b){var _0x2e476a={'from':(_0x28b7cf[_0x7ea4('0x96')][_0x7ea4('0x90')]||'')+'\x20'+(_0x28b7cf[_0x7ea4('0x96')]['lastName']||'')};if(_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x92')]&&_0x5527da['body'][_0x7ea4('0x97')]&&_0x5527da['body'][_0x7ea4('0x92')]!=_0x5527da[_0x7ea4('0x64')][_0x7ea4('0x97')]){_0x2e476a[_0x7ea4('0x92')]=_0x5527da[_0x7ea4('0x64')]['messageId'];}return _0x32312a[_0x7ea4('0x63')](_0x2e476a);}else{return _0x32312a;}}})[_0x7ea4('0x24')](function(_0x10eee8){_0x28b7cf[_0x7ea4('0x98')]=_0x10eee8[_0x7ea4('0x3a')]({'plain':!![]});_0x28b7cf[_0x7ea4('0x98')]['created']=_0x1fa7cc;if(_0x28b7cf['interaction'][_0x7ea4('0x99')]){if(_0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0x9a')]){_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0x9b')]({'id':0x0,'priority':_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0x4b')]+0x1,'app':_0x7ea4('0x9c'),'appdata':_0x7ea4('0x9d'),'interval':_0x7ea4('0x9e')});}}return db[_0x7ea4('0x9f')][_0x7ea4('0x5c')]({'body':_0x5527da['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x5527da[_0x7ea4('0x56')]['id'],'OpenchannelInteractionId':_0x10eee8['id'],'direction':'in','ContactId':_0x28b7cf[_0x7ea4('0x96')]['id'],'AttachmentId':_0x5527da[_0x7ea4('0x64')][_0x7ea4('0xa0')]});})[_0x7ea4('0x24')](function(_0x4faccf){_0x28b7cf[_0x7ea4('0x2c')]=_0x4faccf;if(_0x28b7cf['interaction'][_0x7ea4('0xa1')]){return db[_0x7ea4('0xa2')][_0x7ea4('0x5b')]({'attributes':['id',_0x7ea4('0x3e')],'where':{'id':_0x28b7cf[_0x7ea4('0x98')][_0x7ea4('0xa1')]}})[_0x7ea4('0x24')](function(_0x2900c7){if(_0x2900c7){_0x28b7cf[_0x7ea4('0x89')][_0x7ea4('0xa3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2900c7[_0x7ea4('0x3e')]+','+(_0x28b7cf[_0x7ea4('0x8d')][_0x7ea4('0xa4')]||0xa),'interval':_0x7ea4('0x9e')});_0x28b7cf[_0x7ea4('0xa5')]=![];}return respondWithRpcPromise(_0x7ea4('0xa6'),'startRouting',_0x28b7cf);});}return respondWithRpcPromise(_0x7ea4('0xa6'),_0x7ea4('0xa7'),_0x28b7cf);})[_0x7ea4('0x24')](function(_0x3aa3a2){respondWithRpcPromise(_0x7ea4('0xa8'),_0x7ea4('0xa8'),{'event':_0x7ea4('0x73'),'message':_0x3aa3a2},client9002);return _0x3aa3a2;})[_0x7ea4('0x24')](respondWithResult(_0x3cc481,null))[_0x7ea4('0x2d')](handleError(_0x3cc481,null));};exports[_0x7ea4('0xa9')]=function(_0x1693d9,_0x2dd452,_0x24d3af){return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x1693d9['params']['id']}})['then'](handleEntityNotFound(_0x2dd452,null))[_0x7ea4('0x24')](function(_0x21092c){if(_0x21092c){return db[_0x7ea4('0xaa')][_0x7ea4('0xab')](function(_0x530ba6){return db[_0x7ea4('0x88')]['destroy']({'where':{'OpenchannelAccountId':_0x1693d9[_0x7ea4('0x56')]['id']},'transaction':_0x530ba6})[_0x7ea4('0x24')](function(_0x5e8987){var _0x3b65c2=_[_0x7ea4('0x41')](_0x1693d9[_0x7ea4('0x64')],function(_0x390dd1){_0x390dd1[_0x7ea4('0x6b')]=_0x1693d9[_0x7ea4('0x56')]['id'];return _0x390dd1;});return db[_0x7ea4('0x88')]['bulkCreate'](_0x3b65c2,{'transaction':_0x530ba6});});})[_0x7ea4('0x24')](function(){return db[_0x7ea4('0x88')][_0x7ea4('0xac')]({'where':{'OpenchannelAccountId':_0x1693d9[_0x7ea4('0x56')]['id']},'order':'priority'});});}})[_0x7ea4('0x24')](respondWithResult(_0x2dd452,null))[_0x7ea4('0x2d')](handleError(_0x2dd452,null));};exports[_0x7ea4('0xad')]=function(_0x351c42,_0x3a8c80,_0x2e812b){var _0x4598a9={};var _0x54d70c={};var _0x36426f;var _0x3f84e1;return db[_0x7ea4('0x42')]['findOne']({'where':{'id':_0x351c42[_0x7ea4('0x56')]['id']}})['then'](handleEntityNotFound(_0x3a8c80,null))['then'](function(_0xd26d09){if(_0xd26d09){_0x36426f=_0xd26d09;_0x54d70c[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x88')][_0x7ea4('0x58')]);_0x54d70c[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x351c42[_0x7ea4('0x47')]);_0x54d70c[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x54d70c[_0x7ea4('0x45')],_0x54d70c['query']);_0x4598a9[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x54d70c['model'],qs[_0x7ea4('0x4a')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x4598a9[_0x7ea4('0x49')]=_0x4598a9[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x4598a9[_0x7ea4('0x49')]:_0x54d70c[_0x7ea4('0x45')];_0x4598a9[_0x7ea4('0x6a')]=qs[_0x7ea4('0x4d')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x4598a9[_0x7ea4('0x4e')]=qs['filters'](_['pick'](_0x351c42[_0x7ea4('0x47')],_0x54d70c[_0x7ea4('0x4f')]));if(_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x4598a9[_0x7ea4('0x4e')]=_['merge'](_0x4598a9['where'],{'$or':_[_0x7ea4('0x41')](_0x4598a9[_0x7ea4('0x49')],function(_0x4b4157){var _0x24cc68={};_0x24cc68[_0x4b4157]={'$like':'%'+_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x24cc68;})});}_0x4598a9=_[_0x7ea4('0x50')]({},_0x4598a9,_0x351c42[_0x7ea4('0x53')]);return _0x36426f[_0x7ea4('0xad')](_0x4598a9);}})[_0x7ea4('0x24')](function(_0x56e7d2){if(_0x56e7d2){_0x3f84e1=_0x56e7d2['length'];if(!_0x351c42[_0x7ea4('0x47')][_0x7ea4('0xae')]('nolimit')){_0x4598a9[_0x7ea4('0x34')]=qs['limit'](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x4598a9['offset']=qs[_0x7ea4('0x32')](_0x351c42[_0x7ea4('0x47')][_0x7ea4('0x32')]);}return _0x36426f[_0x7ea4('0xad')](_0x4598a9);}})['then'](function(_0x3bf1dc){if(_0x3bf1dc){return _0x3bf1dc?{'count':_0x3f84e1,'rows':_0x3bf1dc}:null;}})[_0x7ea4('0x24')](respondWithResult(_0x3a8c80,null))[_0x7ea4('0x2d')](handleError(_0x3a8c80,null));};exports['getInteractions']=function(_0x12872c,_0x5a2c85,_0x4c4d00){var _0x4856c3={'raw':![],'where':{}};var _0x20824f={};var _0x29a51b={'count':0x0,'rows':[]};return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x12872c['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x5a2c85,null))[_0x7ea4('0x24')](function(_0x1c6daa){if(_0x1c6daa){_0x20824f[_0x7ea4('0x45')]=_[_0x7ea4('0x46')](db[_0x7ea4('0x93')][_0x7ea4('0x58')]);_0x20824f[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x12872c['query']);_0x20824f['filters']=_['intersection'](_0x20824f[_0x7ea4('0x45')],_0x20824f['query']);_0x4856c3[_0x7ea4('0x49')]=_[_0x7ea4('0x48')](_0x20824f['model'],qs[_0x7ea4('0x4a')](_0x12872c['query']['fields']));_0x4856c3[_0x7ea4('0x49')]=_0x4856c3['attributes'][_0x7ea4('0x4b')]?_0x4856c3[_0x7ea4('0x49')]:_0x20824f[_0x7ea4('0x45')];if(!_0x12872c['query']['hasOwnProperty'](_0x7ea4('0x4c'))){_0x4856c3['limit']=qs[_0x7ea4('0x34')](_0x12872c[_0x7ea4('0x47')]['limit']);_0x4856c3['offset']=qs[_0x7ea4('0x32')](_0x12872c[_0x7ea4('0x47')]['offset']);}_0x4856c3['order']=qs[_0x7ea4('0x4d')](_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x4856c3[_0x7ea4('0x4e')]=qs[_0x7ea4('0x4f')](_[_0x7ea4('0x71')](_0x12872c[_0x7ea4('0x47')],_0x20824f[_0x7ea4('0x4f')]));_0x4856c3[_0x7ea4('0x4e')][_0x7ea4('0x6b')]=_0x1c6daa['id'];if(_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x52')]){_0x4856c3[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x4856c3['where'],{'$or':_['map'](_0x4856c3[_0x7ea4('0x49')],function(_0x4d6be5){var _0x5e8756={};_0x5e8756[_0x4d6be5]={'$like':'%'+_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x52')]+'%'};return _0x5e8756;})});}_0x4856c3=_[_0x7ea4('0x50')]({},_0x4856c3,_0x12872c[_0x7ea4('0x53')]);return db[_0x7ea4('0x93')][_0x7ea4('0x54')]({'where':_0x4856c3[_0x7ea4('0x4e')]})[_0x7ea4('0x24')](function(_0x157c08){_0x29a51b[_0x7ea4('0x54')]=_0x157c08;if(_0x12872c[_0x7ea4('0x47')][_0x7ea4('0x59')]){_0x4856c3[_0x7ea4('0x5a')]=[{'model':db[_0x7ea4('0x74')],'as':_0x7ea4('0xaf'),'required':![]},{'model':db[_0x7ea4('0xa2')],'as':_0x7ea4('0xb0'),'attributes':[_0x7ea4('0x3e'),_0x7ea4('0xb1'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x7ea4('0xb2'),'attributes':['id',_0x7ea4('0x3e'),_0x7ea4('0xb3')],'where':_0x12872c[_0x7ea4('0x47')]['tag']?{'id':_0x12872c[_0x7ea4('0x47')][_0x7ea4('0xb4')]}:undefined,'required':_0x12872c['query']['tag']?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0x4856c3);})[_0x7ea4('0x24')](function(_0x557a7d){_0x29a51b['rows']=_0x557a7d;return _0x29a51b;});}})[_0x7ea4('0x24')](respondWithFilteredResult(_0x5a2c85,_0x4856c3))[_0x7ea4('0x2d')](handleError(_0x5a2c85,null));};exports[_0x7ea4('0xb5')]=function(_0x2ede83,_0x491cf1,_0x4a6551){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x2ede83['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x491cf1,null))[_0x7ea4('0x24')](function(_0x153206){if(_0x153206){return _0x153206[_0x7ea4('0xb5')](_0x2ede83['body'][_0x7ea4('0x6e')],_['omit'](_0x2ede83['body'],[_0x7ea4('0x6e'),'id'])||{})[_0x7ea4('0xb6')](function(_0x1d9be4){for(var _0x89c3f4=0x0;_0x89c3f4<_0x2ede83['body'][_0x7ea4('0x6e')]['length'];_0x89c3f4+=0x1){socket[_0x7ea4('0xb7')](_0x7ea4('0xb8'),{'UserId':Number(_0x2ede83[_0x7ea4('0x64')][_0x7ea4('0x6e')][_0x89c3f4]),'OpenchannelAccountId':Number(_0x2ede83[_0x7ea4('0x56')]['id'])});}return _0x1d9be4;});}})[_0x7ea4('0x24')](respondWithResult(_0x491cf1,null))['catch'](handleError(_0x491cf1,null));};exports[_0x7ea4('0xb9')]=function(_0x412876,_0xe77e86,_0x371624){return db['OpenchannelAccount'][_0x7ea4('0x5b')]({'where':{'id':_0x412876[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0xe77e86,null))[_0x7ea4('0x24')](function(_0x2b674d){if(_0x2b674d){return _0x2b674d[_0x7ea4('0xb9')](_0x412876[_0x7ea4('0x47')]['ids'])[_0x7ea4('0x24')](function(){if(_[_0x7ea4('0xba')](_0x412876['query'][_0x7ea4('0x6e')])){for(var _0x1e1cb5=0x0;_0x1e1cb5<_0x412876['query'][_0x7ea4('0x6e')][_0x7ea4('0x4b')];_0x1e1cb5+=0x1){socket[_0x7ea4('0xb7')](_0x7ea4('0xbb'),{'UserId':Number(_0x412876[_0x7ea4('0x47')][_0x7ea4('0x6e')][_0x1e1cb5]),'OpenchannelAccountId':Number(_0x412876['params']['id'])});}}else{socket[_0x7ea4('0xb7')]('userOpenchannelAccount:remove',{'UserId':Number(_0x412876[_0x7ea4('0x47')][_0x7ea4('0x6e')]),'OpenchannelAccountId':Number(_0x412876[_0x7ea4('0x56')]['id'])});}});}})[_0x7ea4('0x24')](respondWithStatusCode(_0xe77e86,null))[_0x7ea4('0x2d')](handleError(_0xe77e86,null));};exports[_0x7ea4('0xbc')]=function(_0x52e197,_0x4e7a76,_0x2f0830){var _0x5ef2bc={};var _0x27d164={};var _0x3b0412;var _0x1c4a40;return db['OpenchannelAccount'][_0x7ea4('0x69')]({'where':{'id':_0x52e197[_0x7ea4('0x56')]['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x4e7a76,null))['then'](function(_0x1d4287){if(_0x1d4287){_0x3b0412=_0x1d4287;_0x27d164[_0x7ea4('0x45')]=_['keys'](db['User']['rawAttributes']);_0x27d164[_0x7ea4('0x47')]=_[_0x7ea4('0x46')](_0x52e197[_0x7ea4('0x47')]);_0x27d164[_0x7ea4('0x4f')]=_[_0x7ea4('0x48')](_0x27d164['model'],_0x27d164[_0x7ea4('0x47')]);_0x5ef2bc[_0x7ea4('0x49')]=_['intersection'](_0x27d164[_0x7ea4('0x45')],qs['fields'](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x4a')]));_0x5ef2bc[_0x7ea4('0x49')]=_0x5ef2bc[_0x7ea4('0x49')][_0x7ea4('0x4b')]?_0x5ef2bc['attributes']:_0x27d164[_0x7ea4('0x45')];_0x5ef2bc['order']=qs[_0x7ea4('0x4d')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x4d')]);_0x5ef2bc[_0x7ea4('0x4e')]=qs['filters'](_[_0x7ea4('0x71')](_0x52e197[_0x7ea4('0x47')],_0x27d164['filters']));if(_0x52e197[_0x7ea4('0x47')]['filter']){_0x5ef2bc[_0x7ea4('0x4e')]=_[_0x7ea4('0x50')](_0x5ef2bc['where'],{'$or':_[_0x7ea4('0x41')](_0x5ef2bc[_0x7ea4('0x49')],function(_0x426ea8){var _0x3e2df4={};_0x3e2df4[_0x426ea8]={'$like':'%'+_0x52e197[_0x7ea4('0x47')]['filter']+'%'};return _0x3e2df4;})});}_0x5ef2bc=_[_0x7ea4('0x50')]({},_0x5ef2bc,_0x52e197['options']);return _0x3b0412[_0x7ea4('0xbc')](_0x5ef2bc);}})['then'](function(_0x3d8c73){if(_0x3d8c73){_0x1c4a40=_0x3d8c73['length'];if(!_0x52e197['query'][_0x7ea4('0xae')]('nolimit')){_0x5ef2bc[_0x7ea4('0x34')]=qs[_0x7ea4('0x34')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x34')]);_0x5ef2bc[_0x7ea4('0x32')]=qs[_0x7ea4('0x32')](_0x52e197[_0x7ea4('0x47')][_0x7ea4('0x32')]);}return _0x3b0412['getAgents'](_0x5ef2bc);}})[_0x7ea4('0x24')](function(_0x3f1542){if(_0x3f1542){return _0x3f1542?{'count':_0x1c4a40,'rows':_0x3f1542}:null;}})[_0x7ea4('0x24')](respondWithResult(_0x4e7a76,null))['catch'](handleError(_0x4e7a76,null));};exports['send']=function(_0x76bf0,_0x31a769,_0x528d11){var _0x31070b,_0x1327fa,_0xb7c013;if(_['isNil'](_0x76bf0[_0x7ea4('0x64')][_0x7ea4('0x64')])||_0x76bf0[_0x7ea4('0x64')][_0x7ea4('0x64')]===''){throw new db[(_0x7ea4('0x75'))][(_0x7ea4('0x7d'))](_0x7ea4('0x7f'));}if(_[_0x7ea4('0x7b')](_0x76bf0['body']['to'])){}_0x31070b=_0x76bf0[_0x7ea4('0x64')]['to'];return db[_0x7ea4('0x42')][_0x7ea4('0x69')]({'where':{'id':_0x76bf0['params']['id']}})[_0x7ea4('0x24')](handleEntityNotFound(_0x31a769,null))['then'](function(_0x44dc94){if(_0x44dc94){return db[_0x7ea4('0x42')][_0x7ea4('0x5b')]({'where':{'id':_0x44dc94['id']},'include':[{'model':db[_0x7ea4('0x84')],'as':_0x7ea4('0x85'),'include':[{'model':db[_0x7ea4('0x74')],'as':_0x7ea4('0x86'),'where':{[_0x44dc94[_0x7ea4('0x80')]]:_0x31070b},'limit':0x1,'order':[[_0x7ea4('0x79'),_0x7ea4('0x87')]]}]}]})['then'](handleEntityNotFound(_0x31a769,null))['then'](function(_0x2af801){if(_0x2af801&&_0x2af801[_0x7ea4('0x85')]){_0x1327fa=_0x2af801[_0x7ea4('0x3a')]({'plain':!![]});if(_0x1327fa[_0x7ea4('0x85')]&&_0x1327fa[_0x7ea4('0x85')][_0x7ea4('0x86')][_0x7ea4('0x4b')]){return _0x1327fa[_0x7ea4('0x85')][_0x7ea4('0x86')][0x0];}return db['CmContact'][_0x7ea4('0x5c')](_[_0x7ea4('0x1b')](_0x76bf0[_0x7ea4('0x64')],{'firstName':_0x31070b,[_0x2af801['mapKey']]:_0x31070b,'phone':_0x31070b,'ListId':_0x1327fa[_0x7ea4('0x8f')]}));}})['then'](handleEntityNotFound(_0x31a769,null))['then'](function(_0x37d769){if(_0x37d769){_0xb7c013=_0x37d769;return db[_0x7ea4('0x93')][_0x7ea4('0x5b')]({'where':{'ContactId':_0xb7c013['id'],'closed':![],'OpenchannelAccountId':_0x1327fa['id']}})[_0x7ea4('0x24')](function(_0x4b6fc7){if(_0x4b6fc7){return[_0x4b6fc7,![]];}return db[_0x7ea4('0x93')][_0x7ea4('0x5c')]({'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id'],'OpenchannelAccountId':_0x1327fa['id'],'lastMsgDirection':_0x7ea4('0xbd'),'Messages':[_['merge'](_0x76bf0[_0x7ea4('0x64')],{'read':![],'body':_0x76bf0['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x1327fa['id'],'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x7ea4('0xbe')}]})['then'](function(_0x5377d7){return[_0x5377d7,!![]];});});}})['spread'](function(_0x5bdda9,_0x29507a){if(_0x29507a){return _0x5bdda9;}return db['OpenchannelMessage'][_0x7ea4('0x5c')](_[_0x7ea4('0x50')](_0x76bf0[_0x7ea4('0x64')],{'read':![],'body':_0x76bf0['body'][_0x7ea4('0x64')],'OpenchannelAccountId':_0x1327fa['id'],'OpenchannelInteractionId':_0x5bdda9['id'],'UserId':_0x76bf0[_0x7ea4('0x5d')]['id'],'ContactId':_0xb7c013['id']}))['then'](function(_0x116835){_0x5bdda9[_0x7ea4('0xbf')]['Messages']=[];_0x5bdda9[_0x7ea4('0xbf')][_0x7ea4('0xbe')]['push'](_0x116835[_0x7ea4('0xbf')]);return _0x5bdda9;});});}})[_0x7ea4('0x24')](respondWithResult(_0x31a769,null))[_0x7ea4('0x2d')](handleError(_0x31a769,null));};
\ No newline at end of file
+var _0xfdd8=['mapKey','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','priority','ListId','firstName','lastName','threadId','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','bulkCreate','findAndCountAll','rawAttributes','getApplications','getInteractions','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','getAgents','send','get','out','Messages','dataValues','push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','count','json','apply','reject','save','destroy','OpenchannelAccounts','UserProfileResource','end','sendStatus','stack','name','index','mandatoryDispositionPause','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','findAll','rows','show','params','Pause','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','isNil','from'];(function(_0x5e80a1,_0x5558fa){var _0x2290fc=function(_0x28f829){while(--_0x28f829){_0x5e80a1['push'](_0x5e80a1['shift']());}};_0x2290fc(++_0x5558fa);}(_0xfdd8,0xf2));var _0x8fdd=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfdd8[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x8fdd('0x0'));var rimraf=require(_0x8fdd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8fdd('0x2'));var rp=require(_0x8fdd('0x3'));var moment=require(_0x8fdd('0x4'));var BPromise=require(_0x8fdd('0x5'));var Mustache=require(_0x8fdd('0x6'));var util=require(_0x8fdd('0x7'));var path=require(_0x8fdd('0x8'));var sox=require(_0x8fdd('0x9'));var csv=require(_0x8fdd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fdd('0xb'));var _=require(_0x8fdd('0xc'));var squel=require(_0x8fdd('0xd'));var crypto=require(_0x8fdd('0xe'));var jsforce=require(_0x8fdd('0xf'));var deskjs=require(_0x8fdd('0x10'));var toCsv=require(_0x8fdd('0xa'));var querystring=require('querystring');var Papa=require(_0x8fdd('0x11'));var Redis=require(_0x8fdd('0x12'));var authService=require(_0x8fdd('0x13'));var qs=require(_0x8fdd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fdd('0x15'));var logger=require(_0x8fdd('0x16'))('api');var utils=require(_0x8fdd('0x17'));var config=require(_0x8fdd('0x18'));var licenseUtil=require(_0x8fdd('0x19'));var db=require(_0x8fdd('0x1a'))['db'];config[_0x8fdd('0x1b')]=_[_0x8fdd('0x1c')](config[_0x8fdd('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8fdd('0x1b')]));require(_0x8fdd('0x1d'))[_0x8fdd('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8fdd('0x1f')][_0x8fdd('0x20')]({'port':0x232c});var client9002=jayson[_0x8fdd('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa11b0e,_0x48ba50,_0x1f9a2a,_0x533e84){return new BPromise(function(_0x5c616e,_0x130120){var _0x599b35=_0x533e84||client;return _0x599b35[_0x8fdd('0x21')](_0xa11b0e,_0x1f9a2a)[_0x8fdd('0x22')](function(_0x1a0865){logger[_0x8fdd('0x23')](_0x8fdd('0x24'),_0x48ba50,_0x8fdd('0x25'));logger[_0x8fdd('0x26')](_0x8fdd('0x27'),_0x48ba50,_0x8fdd('0x25'),JSON[_0x8fdd('0x28')](_0x1a0865));if(_0x1a0865[_0x8fdd('0x29')]){if(_0x1a0865[_0x8fdd('0x29')][_0x8fdd('0x2a')]===0x1f4){logger[_0x8fdd('0x29')](_0x8fdd('0x24'),_0x48ba50,_0x1a0865[_0x8fdd('0x29')][_0x8fdd('0x2b')]);return _0x130120(_0x1a0865['error']['message']);}logger[_0x8fdd('0x29')](_0x8fdd('0x24'),_0x48ba50,_0x1a0865[_0x8fdd('0x29')][_0x8fdd('0x2b')]);return _0x5c616e(_0x1a0865[_0x8fdd('0x29')][_0x8fdd('0x2b')]);}else{logger[_0x8fdd('0x23')](_0x8fdd('0x24'),_0x48ba50,'request\x20sent');_0x5c616e(_0x1a0865[_0x8fdd('0x2c')][_0x8fdd('0x2b')]);}})[_0x8fdd('0x2d')](function(_0x298310){logger[_0x8fdd('0x29')](_0x8fdd('0x24'),_0x48ba50,_0x298310);_0x130120(_0x298310);});});}function respondWithStatusCode(_0xe87667,_0x4d9b2c){_0x4d9b2c=_0x4d9b2c||0xcc;return function(_0x3bbe74){if(_0x3bbe74){return _0xe87667['sendStatus'](_0x4d9b2c);}return _0xe87667[_0x8fdd('0x2e')](_0x4d9b2c)['end']();};}function respondWithResult(_0x35450d,_0x3d695d){_0x3d695d=_0x3d695d||0xc8;return function(_0x439bc4){if(_0x439bc4){return _0x35450d[_0x8fdd('0x2e')](_0x3d695d)['json'](_0x439bc4);}};}function respondWithFilteredResult(_0x129a04,_0x525e00){return function(_0x28b1d2){if(_0x28b1d2){var _0x312aa1=typeof _0x525e00[_0x8fdd('0x2f')]===_0x8fdd('0x30')&&typeof _0x525e00['limit']===_0x8fdd('0x30');var _0x2c215d=_0x28b1d2[_0x8fdd('0x31')];var _0x321286=_0x312aa1?0x0:_0x525e00[_0x8fdd('0x2f')];var _0x101c7b=_0x312aa1?_0x28b1d2[_0x8fdd('0x31')]:_0x525e00[_0x8fdd('0x2f')]+_0x525e00['limit'];var _0x50d05d;if(_0x101c7b>=_0x2c215d){_0x101c7b=_0x2c215d;_0x50d05d=0xc8;}else{_0x50d05d=0xce;}_0x129a04['status'](_0x50d05d);return _0x129a04['set']('Content-Range',_0x321286+'-'+_0x101c7b+'/'+_0x2c215d)[_0x8fdd('0x32')](_0x28b1d2);}return null;};}function patchUpdates(_0x105f88){return function(_0x10b3c6){try{jsonpatch[_0x8fdd('0x33')](_0x10b3c6,_0x105f88,!![]);}catch(_0x28b3bf){return BPromise[_0x8fdd('0x34')](_0x28b3bf);}return _0x10b3c6[_0x8fdd('0x35')]();};}function saveUpdates(_0x1962df,_0x1fc398){return function(_0x3423d8){if(_0x3423d8){return _0x3423d8['update'](_0x1962df)[_0x8fdd('0x22')](function(_0x53a779){return _0x53a779;});}return null;};}function removeEntity(_0x5808c8,_0x2674aa){return function(_0x816fe4){if(_0x816fe4){return _0x816fe4[_0x8fdd('0x36')]()[_0x8fdd('0x22')](function(){var _0xee751c=_0x816fe4['get']({'plain':!![]});var _0x3a81d9=_0x8fdd('0x37');return db[_0x8fdd('0x38')]['destroy']({'where':{'type':_0x3a81d9,'resourceId':_0xee751c['id']}})['then'](function(){return _0x816fe4;});})[_0x8fdd('0x22')](function(){_0x5808c8[_0x8fdd('0x2e')](0xcc)[_0x8fdd('0x39')]();});}};}function handleEntityNotFound(_0x1e747d,_0x407973){return function(_0x4b4a8c){if(!_0x4b4a8c){_0x1e747d[_0x8fdd('0x3a')](0x194);}return _0x4b4a8c;};}function handleError(_0x67faf9,_0x2a0f6a){_0x2a0f6a=_0x2a0f6a||0x1f4;return function(_0x24ce96){logger[_0x8fdd('0x29')](_0x24ce96[_0x8fdd('0x3b')]);if(_0x24ce96[_0x8fdd('0x3c')]){delete _0x24ce96['name'];}_0x67faf9[_0x8fdd('0x2e')](_0x2a0f6a)['send'](_0x24ce96);};}exports[_0x8fdd('0x3d')]=function(_0x1c72b8,_0x2ab5d7){var _0x15e50b={'include':[{'model':db['Pause'],'as':_0x8fdd('0x3e')}]},_0xddecdc={},_0x3981be={'count':0x0,'rows':[]};var _0x2123a9=_[_0x8fdd('0x3f')](db['OpenchannelAccount']['rawAttributes'],function(_0x1db69f){return{'name':_0x1db69f[_0x8fdd('0x40')],'type':_0x1db69f[_0x8fdd('0x41')][_0x8fdd('0x42')]};});_0xddecdc['model']=_['map'](_0x2123a9,_0x8fdd('0x3c'));_0xddecdc[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x1c72b8['query']);_0xddecdc[_0x8fdd('0x45')]=_[_0x8fdd('0x46')](_0xddecdc[_0x8fdd('0x47')],_0xddecdc['query']);_0x15e50b[_0x8fdd('0x48')]=_[_0x8fdd('0x46')](_0xddecdc['model'],qs['fields'](_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x49')]));_0x15e50b[_0x8fdd('0x48')]=_0x15e50b['attributes'][_0x8fdd('0x4a')]?_0x15e50b[_0x8fdd('0x48')]:_0xddecdc[_0x8fdd('0x47')];if(!_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x4b')]('nolimit')){_0x15e50b[_0x8fdd('0x4c')]=qs[_0x8fdd('0x4c')](_0x1c72b8[_0x8fdd('0x43')]['limit']);_0x15e50b['offset']=qs[_0x8fdd('0x2f')](_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}_0x15e50b['order']=qs[_0x8fdd('0x4d')](_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x4d')]);_0x15e50b[_0x8fdd('0x4e')]=qs[_0x8fdd('0x45')](_[_0x8fdd('0x4f')](_0x1c72b8[_0x8fdd('0x43')],_0xddecdc['filters']),_0x2123a9);if(_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x50')]){_0x15e50b['where']=_[_0x8fdd('0x51')](_0x15e50b['where'],{'$or':_[_0x8fdd('0x3f')](_0x2123a9,function(_0x774156){if(_0x774156[_0x8fdd('0x41')]!==_0x8fdd('0x52')){var _0x1a66f1={};_0x1a66f1[_0x774156[_0x8fdd('0x3c')]]={'$like':'%'+_0x1c72b8[_0x8fdd('0x43')]['filter']+'%'};return _0x1a66f1;}})});}_0x15e50b=_[_0x8fdd('0x51')]({},_0x15e50b,_0x1c72b8[_0x8fdd('0x53')]);var _0x76e9f0={'where':_0x15e50b[_0x8fdd('0x4e')]};return db[_0x8fdd('0x54')][_0x8fdd('0x31')](_0x76e9f0)[_0x8fdd('0x22')](function(_0x5a9e51){_0x3981be[_0x8fdd('0x31')]=_0x5a9e51;if(_0x1c72b8[_0x8fdd('0x43')][_0x8fdd('0x55')]){_0x15e50b[_0x8fdd('0x56')]=[{'all':!![]}];}return db[_0x8fdd('0x54')][_0x8fdd('0x57')](_0x15e50b);})[_0x8fdd('0x22')](function(_0x4b4d99){_0x3981be[_0x8fdd('0x58')]=_0x4b4d99;return _0x3981be;})[_0x8fdd('0x22')](respondWithFilteredResult(_0x2ab5d7,_0x15e50b))[_0x8fdd('0x2d')](handleError(_0x2ab5d7,null));};exports[_0x8fdd('0x59')]=function(_0x4bdd19,_0x4f6a49){var _0x41b18a={'raw':![],'where':{'id':_0x4bdd19[_0x8fdd('0x5a')]['id']},'include':[{'model':db[_0x8fdd('0x5b')],'as':_0x8fdd('0x3e')}]},_0x201d74={};_0x201d74[_0x8fdd('0x47')]=_['keys'](db['OpenchannelAccount']['rawAttributes']);_0x201d74[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x4bdd19['query']);_0x201d74['filters']=_[_0x8fdd('0x46')](_0x201d74['model'],_0x201d74[_0x8fdd('0x43')]);_0x41b18a[_0x8fdd('0x48')]=_[_0x8fdd('0x46')](_0x201d74[_0x8fdd('0x47')],qs[_0x8fdd('0x49')](_0x4bdd19['query'][_0x8fdd('0x49')]));_0x41b18a['attributes']=_0x41b18a[_0x8fdd('0x48')][_0x8fdd('0x4a')]?_0x41b18a[_0x8fdd('0x48')]:_0x201d74[_0x8fdd('0x47')];if(_0x4bdd19[_0x8fdd('0x43')][_0x8fdd('0x55')]){_0x41b18a['include']=[{'all':!![]}];}_0x41b18a=_['merge']({},_0x41b18a,_0x4bdd19['options']);return db[_0x8fdd('0x54')][_0x8fdd('0x5c')](_0x41b18a)[_0x8fdd('0x22')](handleEntityNotFound(_0x4f6a49,null))[_0x8fdd('0x22')](respondWithResult(_0x4f6a49,null))[_0x8fdd('0x2d')](handleError(_0x4f6a49,null));};exports[_0x8fdd('0x5d')]=function(_0x2b5668,_0x6c0aa8){return db[_0x8fdd('0x54')]['create'](_0x2b5668['body'],{})['then'](function(_0x1e723b){var _0x414221=_0x2b5668[_0x8fdd('0x5e')]['get']({'plain':!![]});if(!_0x414221)throw new Error(_0x8fdd('0x5f'));if(_0x414221[_0x8fdd('0x60')]===_0x8fdd('0x5e')){var _0x4e116c=_0x1e723b['get']({'plain':!![]});var _0x41c2a4=_0x8fdd('0x37');return db[_0x8fdd('0x61')]['find']({'where':{'name':_0x41c2a4,'userProfileId':_0x414221[_0x8fdd('0x62')]},'raw':!![]})[_0x8fdd('0x22')](function(_0x2056c1){if(_0x2056c1&&_0x2056c1[_0x8fdd('0x63')]===0x0){return db['UserProfileResource'][_0x8fdd('0x5d')]({'name':_0x4e116c[_0x8fdd('0x3c')],'resourceId':_0x4e116c['id'],'type':_0x2056c1[_0x8fdd('0x3c')],'sectionId':_0x2056c1['id']},{})[_0x8fdd('0x22')](function(){return _0x1e723b;});}else{return _0x1e723b;}})[_0x8fdd('0x2d')](function(_0x54a3bd){logger[_0x8fdd('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54a3bd);throw _0x54a3bd;});}return _0x1e723b;})['then'](respondWithResult(_0x6c0aa8,0xc9))[_0x8fdd('0x2d')](handleError(_0x6c0aa8,null));};exports[_0x8fdd('0x64')]=function(_0x5df9c7,_0x30fd28){if(_0x5df9c7[_0x8fdd('0x65')]['id']){delete _0x5df9c7['body']['id'];}return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x5df9c7['params']['id']},'include':[{'model':db['Pause'],'as':_0x8fdd('0x3e')}]})[_0x8fdd('0x22')](handleEntityNotFound(_0x30fd28,null))[_0x8fdd('0x22')](saveUpdates(_0x5df9c7[_0x8fdd('0x65')],null))['then'](respondWithResult(_0x30fd28,null))[_0x8fdd('0x2d')](handleError(_0x30fd28,null));};exports[_0x8fdd('0x36')]=function(_0x44ea6c,_0x4b3c25){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x44ea6c[_0x8fdd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b3c25,null))[_0x8fdd('0x22')](removeEntity(_0x4b3c25,null))['catch'](handleError(_0x4b3c25,null));};exports['describe']=function(_0x293a68,_0x467ab0){return db[_0x8fdd('0x54')][_0x8fdd('0x66')]()[_0x8fdd('0x22')](respondWithResult(_0x467ab0,null))[_0x8fdd('0x2d')](handleError(_0x467ab0,null));};exports[_0x8fdd('0x67')]=function(_0xb6b027,_0x1cf18c,_0x3cf86d){if(_0xb6b027['body']['id']){delete _0xb6b027[_0x8fdd('0x65')]['id'];}return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0xb6b027['params']['id']}})['then'](handleEntityNotFound(_0x1cf18c,null))['then'](function(_0x3f30ca){if(_0x3f30ca){_0xb6b027[_0x8fdd('0x65')][_0x8fdd('0x68')]=_0x3f30ca['id'];return db['Disposition'][_0x8fdd('0x5d')](_0xb6b027[_0x8fdd('0x65')]);}})[_0x8fdd('0x22')](respondWithResult(_0x1cf18c,null))['catch'](handleError(_0x1cf18c,null));};exports[_0x8fdd('0x69')]=function(_0x1c3de0,_0x431e4e,_0xc8d1c5){var _0x29ab8b={'raw':![],'where':{}};var _0x1cf288={};var _0x448c69={'count':0x0,'rows':[]};return db[_0x8fdd('0x54')][_0x8fdd('0x6a')]({'where':{'id':_0x1c3de0[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x431e4e,null))[_0x8fdd('0x22')](function(_0x2cada8){if(_0x2cada8){_0x1cf288['model']=_[_0x8fdd('0x44')](db[_0x8fdd('0x6b')]['rawAttributes']);_0x1cf288[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x1c3de0[_0x8fdd('0x43')]);_0x1cf288[_0x8fdd('0x45')]=_[_0x8fdd('0x46')](_0x1cf288[_0x8fdd('0x47')],_0x1cf288['query']);_0x29ab8b[_0x8fdd('0x48')]=_[_0x8fdd('0x46')](_0x1cf288[_0x8fdd('0x47')],qs[_0x8fdd('0x49')](_0x1c3de0[_0x8fdd('0x43')][_0x8fdd('0x49')]));_0x29ab8b[_0x8fdd('0x48')]=_0x29ab8b['attributes'][_0x8fdd('0x4a')]?_0x29ab8b[_0x8fdd('0x48')]:_0x1cf288[_0x8fdd('0x47')];if(!_0x1c3de0['query']['hasOwnProperty'](_0x8fdd('0x6c'))){_0x29ab8b[_0x8fdd('0x4c')]=qs[_0x8fdd('0x4c')](_0x1c3de0['query'][_0x8fdd('0x4c')]);_0x29ab8b[_0x8fdd('0x2f')]=qs['offset'](_0x1c3de0[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}_0x29ab8b[_0x8fdd('0x6d')]=qs[_0x8fdd('0x4d')](_0x1c3de0[_0x8fdd('0x43')][_0x8fdd('0x4d')]);_0x29ab8b[_0x8fdd('0x4e')]=qs[_0x8fdd('0x45')](_['pick'](_0x1c3de0[_0x8fdd('0x43')],_0x1cf288[_0x8fdd('0x45')]));_0x29ab8b[_0x8fdd('0x4e')][_0x8fdd('0x68')]=_0x2cada8['id'];if(_0x1c3de0[_0x8fdd('0x43')]['filter']){_0x29ab8b['where']=_['merge'](_0x29ab8b['where'],{'$or':_['map'](_0x29ab8b[_0x8fdd('0x48')],function(_0x3d99bd){var _0xf71e6={};_0xf71e6[_0x3d99bd]={'$like':'%'+_0x1c3de0[_0x8fdd('0x43')][_0x8fdd('0x50')]+'%'};return _0xf71e6;})});}_0x29ab8b=_[_0x8fdd('0x51')]({},_0x29ab8b,_0x1c3de0[_0x8fdd('0x53')]);return db['Disposition']['count']({'where':_0x29ab8b[_0x8fdd('0x4e')]})[_0x8fdd('0x22')](function(_0x46d7ae){_0x448c69[_0x8fdd('0x31')]=_0x46d7ae;if(_0x1c3de0[_0x8fdd('0x43')][_0x8fdd('0x55')]){_0x29ab8b[_0x8fdd('0x56')]=[{'all':!![]}];}return db[_0x8fdd('0x6b')][_0x8fdd('0x57')](_0x29ab8b);})[_0x8fdd('0x22')](function(_0x53ed76){_0x448c69[_0x8fdd('0x58')]=_0x53ed76;return _0x448c69;});}})[_0x8fdd('0x22')](respondWithFilteredResult(_0x431e4e,_0x29ab8b))['catch'](handleError(_0x431e4e,null));};exports[_0x8fdd('0x6e')]=function(_0x13957c,_0x3697cc,_0x47b6e3){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x13957c[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x3697cc,null))['then'](function(_0x236a3c){if(_0x236a3c){return _0x236a3c[_0x8fdd('0x6e')](_0x13957c[_0x8fdd('0x43')][_0x8fdd('0x6f')]);}})[_0x8fdd('0x22')](respondWithStatusCode(_0x3697cc,null))['catch'](handleError(_0x3697cc,null));};exports[_0x8fdd('0x70')]=function(_0x231205,_0x4b9633,_0x11c599){if(_0x231205[_0x8fdd('0x65')]['id']){delete _0x231205['body']['id'];}return db[_0x8fdd('0x54')]['find']({'where':{'id':_0x231205[_0x8fdd('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b9633,null))[_0x8fdd('0x22')](function(_0x13b0c2){if(_0x13b0c2){_0x231205[_0x8fdd('0x65')]['OpenchannelAccountId']=_0x13b0c2['id'];return db[_0x8fdd('0x71')][_0x8fdd('0x5d')](_0x231205[_0x8fdd('0x65')]);}})[_0x8fdd('0x22')](respondWithResult(_0x4b9633,null))[_0x8fdd('0x2d')](handleError(_0x4b9633,null));};exports['getAnswers']=function(_0x297b80,_0x495684,_0x59194c){var _0x55ebc6={'raw':![],'where':{}};var _0x566b5f={};var _0x45a80f={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x297b80[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x495684,null))[_0x8fdd('0x22')](function(_0x283735){if(_0x283735){_0x566b5f[_0x8fdd('0x47')]=_['keys'](db[_0x8fdd('0x71')]['rawAttributes']);_0x566b5f[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x297b80['query']);_0x566b5f[_0x8fdd('0x45')]=_[_0x8fdd('0x46')](_0x566b5f[_0x8fdd('0x47')],_0x566b5f[_0x8fdd('0x43')]);_0x55ebc6[_0x8fdd('0x48')]=_['intersection'](_0x566b5f[_0x8fdd('0x47')],qs[_0x8fdd('0x49')](_0x297b80['query'][_0x8fdd('0x49')]));_0x55ebc6[_0x8fdd('0x48')]=_0x55ebc6[_0x8fdd('0x48')][_0x8fdd('0x4a')]?_0x55ebc6[_0x8fdd('0x48')]:_0x566b5f['model'];if(!_0x297b80[_0x8fdd('0x43')]['hasOwnProperty'](_0x8fdd('0x6c'))){_0x55ebc6[_0x8fdd('0x4c')]=qs[_0x8fdd('0x4c')](_0x297b80['query']['limit']);_0x55ebc6[_0x8fdd('0x2f')]=qs[_0x8fdd('0x2f')](_0x297b80[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}_0x55ebc6[_0x8fdd('0x6d')]=qs[_0x8fdd('0x4d')](_0x297b80[_0x8fdd('0x43')][_0x8fdd('0x4d')]);_0x55ebc6[_0x8fdd('0x4e')]=qs[_0x8fdd('0x45')](_[_0x8fdd('0x4f')](_0x297b80[_0x8fdd('0x43')],_0x566b5f[_0x8fdd('0x45')]));_0x55ebc6['where'][_0x8fdd('0x68')]=_0x283735['id'];if(_0x297b80[_0x8fdd('0x43')][_0x8fdd('0x50')]){_0x55ebc6[_0x8fdd('0x4e')]=_[_0x8fdd('0x51')](_0x55ebc6[_0x8fdd('0x4e')],{'$or':_[_0x8fdd('0x3f')](_0x55ebc6[_0x8fdd('0x48')],function(_0x3e8bd0){var _0x2f6caa={};_0x2f6caa[_0x3e8bd0]={'$like':'%'+_0x297b80[_0x8fdd('0x43')][_0x8fdd('0x50')]+'%'};return _0x2f6caa;})});}_0x55ebc6=_['merge']({},_0x55ebc6,_0x297b80[_0x8fdd('0x53')]);return db[_0x8fdd('0x71')][_0x8fdd('0x31')]({'where':_0x55ebc6['where']})[_0x8fdd('0x22')](function(_0x80df2c){_0x45a80f['count']=_0x80df2c;if(_0x297b80[_0x8fdd('0x43')][_0x8fdd('0x55')]){_0x55ebc6[_0x8fdd('0x56')]=[{'all':!![]}];}return db[_0x8fdd('0x71')][_0x8fdd('0x57')](_0x55ebc6);})[_0x8fdd('0x22')](function(_0x49b531){_0x45a80f[_0x8fdd('0x58')]=_0x49b531;return _0x45a80f;});}})['then'](respondWithFilteredResult(_0x495684,_0x55ebc6))[_0x8fdd('0x2d')](handleError(_0x495684,null));};exports['removeAnswers']=function(_0xe0dac,_0x1a684d,_0x142382){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0xe0dac[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x1a684d,null))[_0x8fdd('0x22')](function(_0x40a370){if(_0x40a370){return _0x40a370[_0x8fdd('0x72')](_0xe0dac['query']['ids']);}})['then'](respondWithStatusCode(_0x1a684d,null))[_0x8fdd('0x2d')](handleError(_0x1a684d,null));};exports[_0x8fdd('0x73')]=function(_0x1eba44,_0x274e6e,_0x10fef6){var _0x4a4d1b={'body':_0x1eba44[_0x8fdd('0x65')],'channel':'openchannel'};var _0x22e372=[];var _0x2d2c61=[];var _0x1f6691={};var _0x43cdf1=![];return db[_0x8fdd('0x74')]['describe']()[_0x8fdd('0x22')](function(_0x2f369d){if(!_0x2f369d){throw new db[(_0x8fdd('0x75'))][(_0x8fdd('0x76'))](_0x8fdd('0x77'));}_0x22e372=_[_0x8fdd('0x78')](_[_0x8fdd('0x44')](_0x2f369d),['createdAt',_0x8fdd('0x79')]);_0x2d2c61=_[_0x8fdd('0x78')](_['keys'](_0x2f369d),['createdAt',_0x8fdd('0x79'),'CompanyId','ListId']);if(_0x1eba44[_0x8fdd('0x65')]['id']){delete _0x1eba44[_0x8fdd('0x65')]['id'];}if(_[_0x8fdd('0x7a')](_0x1eba44['body'][_0x8fdd('0x7b')])){throw new db[(_0x8fdd('0x75'))][(_0x8fdd('0x76'))]('from\x20is\x20mandatory');}if(_[_0x8fdd('0x7a')](_0x1eba44[_0x8fdd('0x65')][_0x8fdd('0x65')])||_0x1eba44['body'][_0x8fdd('0x65')]===''){throw new db[(_0x8fdd('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8fdd('0x7a')](_0x1eba44[_0x8fdd('0x65')][_0x8fdd('0x7c')])){throw new db[(_0x8fdd('0x75'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d2c61);}if(!_[_0x8fdd('0x7d')](_0x2d2c61,_0x1eba44[_0x8fdd('0x65')]['mapKey'])){throw new db[(_0x8fdd('0x75'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d2c61);}_0x1f6691[_0x1eba44[_0x8fdd('0x65')]['mapKey']]=_0x1eba44['body'][_0x8fdd('0x7b')];})['then'](function(){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x1eba44['params']['id']},'include':[{'model':db[_0x8fdd('0x7e')],'as':_0x8fdd('0x7f'),'include':[{'model':db[_0x8fdd('0x74')],'as':_0x8fdd('0x80'),'where':_0x1f6691,'limit':0x1,'order':[['updatedAt',_0x8fdd('0x81')]]}]},{'model':db[_0x8fdd('0x82')],'as':_0x8fdd('0x83')}]});})[_0x8fdd('0x22')](handleEntityNotFound(_0x274e6e,null))[_0x8fdd('0x22')](function(_0x2babe0){if(_0x2babe0&&_0x2babe0[_0x8fdd('0x7f')]){_0x4a4d1b[_0x8fdd('0x84')]=_0x2babe0;_0x4a4d1b[_0x8fdd('0x85')]=_0x2babe0['Applications'];_0x4a4d1b[_0x8fdd('0x86')]=_0x2babe0['List'];_0x4a4d1b[_0x8fdd('0x85')]=_['orderBy'](_0x4a4d1b[_0x8fdd('0x85')],[_0x8fdd('0x87')],['asc']);if(_0x4a4d1b[_0x8fdd('0x84')]['Applications']){delete _0x4a4d1b[_0x8fdd('0x84')][_0x8fdd('0x83')];}if(_0x4a4d1b[_0x8fdd('0x84')][_0x8fdd('0x7f')]&&_0x4a4d1b[_0x8fdd('0x84')][_0x8fdd('0x7f')][_0x8fdd('0x80')][_0x8fdd('0x4a')]){return _0x4a4d1b[_0x8fdd('0x84')]['List'][_0x8fdd('0x80')][0x0];}var _0x3efedc=_['defaults'](_0x1eba44[_0x8fdd('0x65')],{'firstName':_0x1eba44['body']['from'],'ListId':_0x2babe0[_0x8fdd('0x88')]});_0x3efedc[_0x1eba44['body'][_0x8fdd('0x7c')]]=_0x1eba44[_0x8fdd('0x65')]['from'];return db['CmContact'][_0x8fdd('0x5d')](_0x3efedc,{'fields':_0x22e372,'raw':!![]});}})[_0x8fdd('0x22')](handleEntityNotFound(_0x274e6e,null))[_0x8fdd('0x22')](function(_0xffe0){_0x4a4d1b['contact']=_0xffe0;if(_0xffe0){var _0x39ab82={'ContactId':_0xffe0['id'],'OpenchannelAccountId':_0x1eba44['params']['id'],'from':(_0xffe0[_0x8fdd('0x89')]||'')+'\x20'+(_0xffe0[_0x8fdd('0x8a')]||'')};var _0x22fcb0={'OpenchannelAccountId':_0x1eba44[_0x8fdd('0x5a')]['id'],'closed':![]};if(_0x1eba44['body'][_0x8fdd('0x8b')]){_0x22fcb0[_0x8fdd('0x8b')]=_0x1eba44['body'][_0x8fdd('0x8b')];return db[_0x8fdd('0x8c')][_0x8fdd('0x5c')]({'where':_0x22fcb0})[_0x8fdd('0x22')](function(_0x54f4bb){if(_0x54f4bb){return[_0x54f4bb,![]];}_0x39ab82[_0x8fdd('0x8b')]=_0x1eba44['body'][_0x8fdd('0x8b')];_0x39ab82['externalUrl']=_0x1eba44[_0x8fdd('0x65')]['externalUrl'];return db[_0x8fdd('0x8c')][_0x8fdd('0x5d')](_0x39ab82)[_0x8fdd('0x22')](function(_0x5a33e0){return[_0x5a33e0,!![]];});});}else{_0x22fcb0[_0x8fdd('0x8b')]=null;}_0x22fcb0[_0x8fdd('0x8d')]=_0xffe0['id'];return db[_0x8fdd('0x8c')]['find']({'where':_0x22fcb0})[_0x8fdd('0x22')](function(_0x308b8b){if(_0x308b8b){return[_0x308b8b,![]];}return db[_0x8fdd('0x8c')][_0x8fdd('0x5d')](_0x39ab82)[_0x8fdd('0x22')](function(_0x34519b){return[_0x34519b,!![]];});});}})[_0x8fdd('0x8e')](function(_0x3883a2,_0x547501){if(_0x3883a2){_0x43cdf1=_0x547501;if(!_0x547501){var _0x3c17c2={'from':(_0x4a4d1b['contact'][_0x8fdd('0x89')]||'')+'\x20'+(_0x4a4d1b[_0x8fdd('0x8f')]['lastName']||'')};if(_0x1eba44[_0x8fdd('0x65')][_0x8fdd('0x8b')]&&_0x1eba44['body'][_0x8fdd('0x90')]&&_0x1eba44['body'][_0x8fdd('0x8b')]!=_0x1eba44[_0x8fdd('0x65')][_0x8fdd('0x90')]){_0x3c17c2[_0x8fdd('0x8b')]=_0x1eba44['body'][_0x8fdd('0x90')];}return _0x3883a2['update'](_0x3c17c2);}else{return _0x3883a2;}}})[_0x8fdd('0x22')](function(_0x327e61){_0x4a4d1b[_0x8fdd('0x91')]=_0x327e61['get']({'plain':!![]});_0x4a4d1b[_0x8fdd('0x91')]['created']=_0x43cdf1;if(_0x4a4d1b[_0x8fdd('0x91')][_0x8fdd('0x92')]){if(_0x4a4d1b[_0x8fdd('0x84')]['autoclose']){_0x4a4d1b[_0x8fdd('0x85')]['push']({'id':0x0,'priority':_0x4a4d1b[_0x8fdd('0x85')][_0x8fdd('0x4a')]+0x1,'app':_0x8fdd('0x93'),'appdata':_0x8fdd('0x94'),'interval':_0x8fdd('0x95')});}}return db[_0x8fdd('0x96')]['create']({'body':_0x1eba44[_0x8fdd('0x65')][_0x8fdd('0x65')],'OpenchannelAccountId':_0x1eba44[_0x8fdd('0x5a')]['id'],'OpenchannelInteractionId':_0x327e61['id'],'direction':'in','ContactId':_0x4a4d1b[_0x8fdd('0x8f')]['id'],'AttachmentId':_0x1eba44['body']['AttachmentId']});})[_0x8fdd('0x22')](function(_0x2c3914){_0x4a4d1b[_0x8fdd('0x2b')]=_0x2c3914;if(_0x4a4d1b[_0x8fdd('0x91')][_0x8fdd('0x97')]){return db[_0x8fdd('0x98')][_0x8fdd('0x5c')]({'attributes':['id',_0x8fdd('0x3c')],'where':{'id':_0x4a4d1b[_0x8fdd('0x91')][_0x8fdd('0x97')]}})[_0x8fdd('0x22')](function(_0x2edc6b){if(_0x2edc6b){_0x4a4d1b[_0x8fdd('0x85')][_0x8fdd('0x99')]({'id':0x0,'priority':0x0,'app':_0x8fdd('0x9a'),'appdata':_0x2edc6b[_0x8fdd('0x3c')]+','+(_0x4a4d1b[_0x8fdd('0x84')][_0x8fdd('0x9b')]||0xa),'interval':_0x8fdd('0x95')});_0x4a4d1b[_0x8fdd('0x9c')]=![];}return respondWithRpcPromise('Start','startRouting',_0x4a4d1b);});}return respondWithRpcPromise(_0x8fdd('0x9d'),'startRouting',_0x4a4d1b);})['then'](function(_0x2eb67d){respondWithRpcPromise('EventManager',_0x8fdd('0x9e'),{'event':'notify','message':_0x2eb67d},client9002);return _0x2eb67d;})[_0x8fdd('0x22')](respondWithResult(_0x274e6e,null))[_0x8fdd('0x2d')](handleError(_0x274e6e,null));};exports['addApplications']=function(_0x278c07,_0x143e46,_0x5d934a){return db[_0x8fdd('0x54')]['findOne']({'where':{'id':_0x278c07['params']['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x143e46,null))[_0x8fdd('0x22')](function(_0x30798e){if(_0x30798e){return db['sequelize']['transaction'](function(_0x4ce6bf){return db[_0x8fdd('0x82')][_0x8fdd('0x36')]({'where':{'OpenchannelAccountId':_0x278c07[_0x8fdd('0x5a')]['id']},'transaction':_0x4ce6bf})[_0x8fdd('0x22')](function(_0xeaa763){var _0x23db28=_[_0x8fdd('0x3f')](_0x278c07[_0x8fdd('0x65')],function(_0x148f8d){_0x148f8d['OpenchannelAccountId']=_0x278c07['params']['id'];return _0x148f8d;});return db[_0x8fdd('0x82')][_0x8fdd('0x9f')](_0x23db28,{'transaction':_0x4ce6bf});});})[_0x8fdd('0x22')](function(){return db[_0x8fdd('0x82')][_0x8fdd('0xa0')]({'where':{'OpenchannelAccountId':_0x278c07[_0x8fdd('0x5a')]['id']},'order':_0x8fdd('0x87')});});}})[_0x8fdd('0x22')](respondWithResult(_0x143e46,null))[_0x8fdd('0x2d')](handleError(_0x143e46,null));};exports['getApplications']=function(_0x37589d,_0x3f20a6,_0x55e967){var _0x44afbc={};var _0x183732={};var _0x128938;var _0x4a3706;return db['OpenchannelAccount'][_0x8fdd('0x6a')]({'where':{'id':_0x37589d[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x3f20a6,null))[_0x8fdd('0x22')](function(_0x5129fb){if(_0x5129fb){_0x128938=_0x5129fb;_0x183732['model']=_[_0x8fdd('0x44')](db[_0x8fdd('0x82')][_0x8fdd('0xa1')]);_0x183732[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x37589d[_0x8fdd('0x43')]);_0x183732[_0x8fdd('0x45')]=_[_0x8fdd('0x46')](_0x183732['model'],_0x183732['query']);_0x44afbc[_0x8fdd('0x48')]=_[_0x8fdd('0x46')](_0x183732['model'],qs['fields'](_0x37589d['query'][_0x8fdd('0x49')]));_0x44afbc[_0x8fdd('0x48')]=_0x44afbc[_0x8fdd('0x48')]['length']?_0x44afbc[_0x8fdd('0x48')]:_0x183732[_0x8fdd('0x47')];_0x44afbc[_0x8fdd('0x6d')]=qs['sort'](_0x37589d[_0x8fdd('0x43')][_0x8fdd('0x4d')]);_0x44afbc['where']=qs[_0x8fdd('0x45')](_[_0x8fdd('0x4f')](_0x37589d[_0x8fdd('0x43')],_0x183732[_0x8fdd('0x45')]));if(_0x37589d[_0x8fdd('0x43')][_0x8fdd('0x50')]){_0x44afbc[_0x8fdd('0x4e')]=_['merge'](_0x44afbc[_0x8fdd('0x4e')],{'$or':_[_0x8fdd('0x3f')](_0x44afbc[_0x8fdd('0x48')],function(_0x5507a4){var _0x1c327a={};_0x1c327a[_0x5507a4]={'$like':'%'+_0x37589d[_0x8fdd('0x43')][_0x8fdd('0x50')]+'%'};return _0x1c327a;})});}_0x44afbc=_[_0x8fdd('0x51')]({},_0x44afbc,_0x37589d['options']);return _0x128938[_0x8fdd('0xa2')](_0x44afbc);}})[_0x8fdd('0x22')](function(_0x5d8218){if(_0x5d8218){_0x4a3706=_0x5d8218[_0x8fdd('0x4a')];if(!_0x37589d[_0x8fdd('0x43')]['hasOwnProperty'](_0x8fdd('0x6c'))){_0x44afbc['limit']=qs[_0x8fdd('0x4c')](_0x37589d[_0x8fdd('0x43')][_0x8fdd('0x4c')]);_0x44afbc['offset']=qs[_0x8fdd('0x2f')](_0x37589d[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}return _0x128938['getApplications'](_0x44afbc);}})[_0x8fdd('0x22')](function(_0x18c130){if(_0x18c130){return _0x18c130?{'count':_0x4a3706,'rows':_0x18c130}:null;}})[_0x8fdd('0x22')](respondWithResult(_0x3f20a6,null))[_0x8fdd('0x2d')](handleError(_0x3f20a6,null));};exports[_0x8fdd('0xa3')]=function(_0x313297,_0x5ab323,_0x216fcd){var _0x1a5ec5={'raw':![],'where':{}};var _0x4020c2={};var _0xcdb760={'count':0x0,'rows':[]};return db[_0x8fdd('0x54')][_0x8fdd('0x6a')]({'where':{'id':_0x313297['params']['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x5ab323,null))[_0x8fdd('0x22')](function(_0xc0548e){if(_0xc0548e){_0x4020c2[_0x8fdd('0x47')]=_[_0x8fdd('0x44')](db[_0x8fdd('0x8c')][_0x8fdd('0xa1')]);_0x4020c2[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x313297[_0x8fdd('0x43')]);_0x4020c2[_0x8fdd('0x45')]=_[_0x8fdd('0x46')](_0x4020c2[_0x8fdd('0x47')],_0x4020c2[_0x8fdd('0x43')]);_0x1a5ec5[_0x8fdd('0x48')]=_['intersection'](_0x4020c2[_0x8fdd('0x47')],qs[_0x8fdd('0x49')](_0x313297['query'][_0x8fdd('0x49')]));_0x1a5ec5[_0x8fdd('0x48')]=_0x1a5ec5['attributes'][_0x8fdd('0x4a')]?_0x1a5ec5['attributes']:_0x4020c2[_0x8fdd('0x47')];if(!_0x313297[_0x8fdd('0x43')]['hasOwnProperty'](_0x8fdd('0x6c'))){_0x1a5ec5[_0x8fdd('0x4c')]=qs['limit'](_0x313297[_0x8fdd('0x43')][_0x8fdd('0x4c')]);_0x1a5ec5[_0x8fdd('0x2f')]=qs[_0x8fdd('0x2f')](_0x313297[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}_0x1a5ec5[_0x8fdd('0x6d')]=qs['sort'](_0x313297[_0x8fdd('0x43')][_0x8fdd('0x4d')]);_0x1a5ec5[_0x8fdd('0x4e')]=qs[_0x8fdd('0x45')](_['pick'](_0x313297['query'],_0x4020c2[_0x8fdd('0x45')]));_0x1a5ec5[_0x8fdd('0x4e')][_0x8fdd('0x68')]=_0xc0548e['id'];if(_0x313297[_0x8fdd('0x43')]['filter']){_0x1a5ec5['where']=_[_0x8fdd('0x51')](_0x1a5ec5['where'],{'$or':_['map'](_0x1a5ec5['attributes'],function(_0x202484){var _0x5b7e56={};_0x5b7e56[_0x202484]={'$like':'%'+_0x313297[_0x8fdd('0x43')][_0x8fdd('0x50')]+'%'};return _0x5b7e56;})});}_0x1a5ec5=_[_0x8fdd('0x51')]({},_0x1a5ec5,_0x313297[_0x8fdd('0x53')]);return db[_0x8fdd('0x8c')][_0x8fdd('0x31')]({'where':_0x1a5ec5[_0x8fdd('0x4e')]})[_0x8fdd('0x22')](function(_0x13a5ec){_0xcdb760['count']=_0x13a5ec;if(_0x313297[_0x8fdd('0x43')]['includeAll']){_0x1a5ec5['include']=[{'model':db[_0x8fdd('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x8fdd('0x3c'),_0x8fdd('0xa4'),_0x8fdd('0xa5')],'required':![]},{'model':db[_0x8fdd('0xa6')],'as':_0x8fdd('0xa7'),'attributes':['id',_0x8fdd('0x3c'),_0x8fdd('0xa8')],'where':_0x313297[_0x8fdd('0x43')][_0x8fdd('0xa9')]?{'id':_0x313297[_0x8fdd('0x43')]['tag']}:undefined,'required':_0x313297[_0x8fdd('0x43')][_0x8fdd('0xa9')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x8fdd('0x57')](_0x1a5ec5);})[_0x8fdd('0x22')](function(_0x9fd788){_0xcdb760[_0x8fdd('0x58')]=_0x9fd788;return _0xcdb760;});}})[_0x8fdd('0x22')](respondWithFilteredResult(_0x5ab323,_0x1a5ec5))[_0x8fdd('0x2d')](handleError(_0x5ab323,null));};exports[_0x8fdd('0xaa')]=function(_0xa9559,_0x241723,_0x2cc982){return db['OpenchannelAccount']['find']({'where':{'id':_0xa9559[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x241723,null))[_0x8fdd('0x22')](function(_0x4569f2){if(_0x4569f2){return _0x4569f2[_0x8fdd('0xaa')](_0xa9559[_0x8fdd('0x65')]['ids'],_[_0x8fdd('0xab')](_0xa9559[_0x8fdd('0x65')],[_0x8fdd('0x6f'),'id'])||{})[_0x8fdd('0x8e')](function(_0x2b0008){for(var _0xc95862=0x0;_0xc95862<_0xa9559[_0x8fdd('0x65')][_0x8fdd('0x6f')][_0x8fdd('0x4a')];_0xc95862+=0x1){socket[_0x8fdd('0xac')](_0x8fdd('0xad'),{'UserId':Number(_0xa9559[_0x8fdd('0x65')][_0x8fdd('0x6f')][_0xc95862]),'OpenchannelAccountId':Number(_0xa9559[_0x8fdd('0x5a')]['id'])});}return _0x2b0008;});}})['then'](respondWithResult(_0x241723,null))[_0x8fdd('0x2d')](handleError(_0x241723,null));};exports['removeAgents']=function(_0x2ba915,_0x27e54a,_0x4feeec){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x2ba915[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x27e54a,null))[_0x8fdd('0x22')](function(_0x4c8b43){if(_0x4c8b43){return _0x4c8b43['removeAgents'](_0x2ba915[_0x8fdd('0x43')]['ids'])[_0x8fdd('0x22')](function(){if(_[_0x8fdd('0xae')](_0x2ba915[_0x8fdd('0x43')][_0x8fdd('0x6f')])){for(var _0x49f725=0x0;_0x49f725<_0x2ba915[_0x8fdd('0x43')][_0x8fdd('0x6f')][_0x8fdd('0x4a')];_0x49f725+=0x1){socket[_0x8fdd('0xac')]('userOpenchannelAccount:remove',{'UserId':Number(_0x2ba915[_0x8fdd('0x43')][_0x8fdd('0x6f')][_0x49f725]),'OpenchannelAccountId':Number(_0x2ba915[_0x8fdd('0x5a')]['id'])});}}else{socket[_0x8fdd('0xac')](_0x8fdd('0xaf'),{'UserId':Number(_0x2ba915['query'][_0x8fdd('0x6f')]),'OpenchannelAccountId':Number(_0x2ba915[_0x8fdd('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x27e54a,null))['catch'](handleError(_0x27e54a,null));};exports[_0x8fdd('0xb0')]=function(_0x587969,_0x40d512,_0x243414){var _0x48ccdf={};var _0x367ed5={};var _0x3d4ca9;var _0x2ca2a1;return db[_0x8fdd('0x54')][_0x8fdd('0x6a')]({'where':{'id':_0x587969[_0x8fdd('0x5a')]['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x40d512,null))[_0x8fdd('0x22')](function(_0x19e181){if(_0x19e181){_0x3d4ca9=_0x19e181;_0x367ed5['model']=_[_0x8fdd('0x44')](db[_0x8fdd('0x98')][_0x8fdd('0xa1')]);_0x367ed5[_0x8fdd('0x43')]=_[_0x8fdd('0x44')](_0x587969[_0x8fdd('0x43')]);_0x367ed5[_0x8fdd('0x45')]=_['intersection'](_0x367ed5[_0x8fdd('0x47')],_0x367ed5[_0x8fdd('0x43')]);_0x48ccdf[_0x8fdd('0x48')]=_[_0x8fdd('0x46')](_0x367ed5['model'],qs[_0x8fdd('0x49')](_0x587969['query']['fields']));_0x48ccdf['attributes']=_0x48ccdf[_0x8fdd('0x48')]['length']?_0x48ccdf[_0x8fdd('0x48')]:_0x367ed5['model'];_0x48ccdf['order']=qs[_0x8fdd('0x4d')](_0x587969[_0x8fdd('0x43')]['sort']);_0x48ccdf[_0x8fdd('0x4e')]=qs[_0x8fdd('0x45')](_[_0x8fdd('0x4f')](_0x587969['query'],_0x367ed5[_0x8fdd('0x45')]));if(_0x587969[_0x8fdd('0x43')]['filter']){_0x48ccdf['where']=_[_0x8fdd('0x51')](_0x48ccdf[_0x8fdd('0x4e')],{'$or':_[_0x8fdd('0x3f')](_0x48ccdf[_0x8fdd('0x48')],function(_0x55df41){var _0x2a557c={};_0x2a557c[_0x55df41]={'$like':'%'+_0x587969['query']['filter']+'%'};return _0x2a557c;})});}_0x48ccdf=_[_0x8fdd('0x51')]({},_0x48ccdf,_0x587969[_0x8fdd('0x53')]);return _0x3d4ca9[_0x8fdd('0xb0')](_0x48ccdf);}})[_0x8fdd('0x22')](function(_0x3a4511){if(_0x3a4511){_0x2ca2a1=_0x3a4511[_0x8fdd('0x4a')];if(!_0x587969[_0x8fdd('0x43')][_0x8fdd('0x4b')](_0x8fdd('0x6c'))){_0x48ccdf[_0x8fdd('0x4c')]=qs[_0x8fdd('0x4c')](_0x587969['query'][_0x8fdd('0x4c')]);_0x48ccdf[_0x8fdd('0x2f')]=qs[_0x8fdd('0x2f')](_0x587969[_0x8fdd('0x43')][_0x8fdd('0x2f')]);}return _0x3d4ca9[_0x8fdd('0xb0')](_0x48ccdf);}})[_0x8fdd('0x22')](function(_0x3ac586){if(_0x3ac586){return _0x3ac586?{'count':_0x2ca2a1,'rows':_0x3ac586}:null;}})[_0x8fdd('0x22')](respondWithResult(_0x40d512,null))[_0x8fdd('0x2d')](handleError(_0x40d512,null));};exports[_0x8fdd('0xb1')]=function(_0x150e5a,_0x3018e2,_0x4bfc94){var _0x4e78b7,_0xfcf27a,_0xea017;if(_[_0x8fdd('0x7a')](_0x150e5a[_0x8fdd('0x65')][_0x8fdd('0x65')])||_0x150e5a[_0x8fdd('0x65')][_0x8fdd('0x65')]===''){throw new db[(_0x8fdd('0x75'))][(_0x8fdd('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8fdd('0x7a')](_0x150e5a[_0x8fdd('0x65')]['to'])){}_0x4e78b7=_0x150e5a[_0x8fdd('0x65')]['to'];return db[_0x8fdd('0x54')][_0x8fdd('0x6a')]({'where':{'id':_0x150e5a['params']['id']}})[_0x8fdd('0x22')](handleEntityNotFound(_0x3018e2,null))[_0x8fdd('0x22')](function(_0x1c12f2){if(_0x1c12f2){return db[_0x8fdd('0x54')][_0x8fdd('0x5c')]({'where':{'id':_0x1c12f2['id']},'include':[{'model':db[_0x8fdd('0x7e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8fdd('0x80'),'where':{[_0x1c12f2['mapKey']]:_0x4e78b7},'limit':0x1,'order':[[_0x8fdd('0x79'),_0x8fdd('0x81')]]}]}]})[_0x8fdd('0x22')](handleEntityNotFound(_0x3018e2,null))[_0x8fdd('0x22')](function(_0x45c208){if(_0x45c208&&_0x45c208[_0x8fdd('0x7f')]){_0xfcf27a=_0x45c208[_0x8fdd('0xb2')]({'plain':!![]});if(_0xfcf27a[_0x8fdd('0x7f')]&&_0xfcf27a[_0x8fdd('0x7f')][_0x8fdd('0x80')][_0x8fdd('0x4a')]){return _0xfcf27a[_0x8fdd('0x7f')][_0x8fdd('0x80')][0x0];}return db[_0x8fdd('0x74')]['create'](_[_0x8fdd('0x1c')](_0x150e5a['body'],{'firstName':_0x4e78b7,[_0x45c208[_0x8fdd('0x7c')]]:_0x4e78b7,'phone':_0x4e78b7,'ListId':_0xfcf27a[_0x8fdd('0x88')]}));}})[_0x8fdd('0x22')](handleEntityNotFound(_0x3018e2,null))[_0x8fdd('0x22')](function(_0x52ba50){if(_0x52ba50){_0xea017=_0x52ba50;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0xea017['id'],'closed':![],'OpenchannelAccountId':_0xfcf27a['id']}})['then'](function(_0x30cab9){if(_0x30cab9){return[_0x30cab9,![]];}return db[_0x8fdd('0x8c')][_0x8fdd('0x5d')]({'UserId':_0x150e5a['user']['id'],'ContactId':_0xea017['id'],'OpenchannelAccountId':_0xfcf27a['id'],'lastMsgDirection':_0x8fdd('0xb3'),'Messages':[_[_0x8fdd('0x51')](_0x150e5a[_0x8fdd('0x65')],{'read':![],'body':_0x150e5a[_0x8fdd('0x65')][_0x8fdd('0x65')],'OpenchannelAccountId':_0xfcf27a['id'],'UserId':_0x150e5a[_0x8fdd('0x5e')]['id'],'ContactId':_0xea017['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x8fdd('0xb4')}]})[_0x8fdd('0x22')](function(_0x58076c){return[_0x58076c,!![]];});});}})[_0x8fdd('0x8e')](function(_0x1d3ec1,_0x5d9585){if(_0x5d9585){return _0x1d3ec1;}return db[_0x8fdd('0x96')][_0x8fdd('0x5d')](_['merge'](_0x150e5a[_0x8fdd('0x65')],{'read':![],'body':_0x150e5a[_0x8fdd('0x65')][_0x8fdd('0x65')],'OpenchannelAccountId':_0xfcf27a['id'],'OpenchannelInteractionId':_0x1d3ec1['id'],'UserId':_0x150e5a[_0x8fdd('0x5e')]['id'],'ContactId':_0xea017['id']}))['then'](function(_0x2822b4){_0x1d3ec1['dataValues'][_0x8fdd('0xb4')]=[];_0x1d3ec1[_0x8fdd('0xb5')]['Messages'][_0x8fdd('0xb6')](_0x2822b4['dataValues']);return _0x1d3ec1;});});}})[_0x8fdd('0x22')](respondWithResult(_0x3018e2,null))[_0x8fdd('0x2d')](handleError(_0x3018e2,null));};
\ No newline at end of file
index cc753ff..46ba5c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4483,0x1a3));var _0x3448=function(_0x13495e,_0x3f5193){_0x13495e=_0x13495e-0x0;var _0x429cfe=_0x4483[_0x13495e];return _0x429cfe;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5479ca,_0x3c6d69){var _0x944e31=function(_0x2aa2c5){while(--_0x2aa2c5){_0x5479ca['push'](_0x5479ca['shift']());}};_0x944e31(++_0x3c6d69);}(_0x99e9,0xb4));var _0x999e=function(_0x46ab02,_0x46f430){_0x46ab02=_0x46ab02-0x0;var _0x39d9a4=_0x99e9[_0x46ab02];return _0x39d9a4;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index 3de5fe7..df8426d 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(_0x3c6ed7,_0x18fa72){var _0x355be8=function(_0xb1aa0f){while(--_0xb1aa0f){_0x3c6ed7['push'](_0x3c6ed7['shift']());}};_0x355be8(++_0x18fa72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x278f82,_0x3b8d9f){var _0x2a3463=function(_0x4df5c9){while(--_0x4df5c9){_0x278f82['push'](_0x278f82['shift']());}};_0x2a3463(++_0x3b8d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 d13aa91..ade73a1 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(_0x2dd4ac,_0x5b170d){var _0x4d3ece=function(_0x433033){while(--_0x433033){_0x2dd4ac['push'](_0x2dd4ac['shift']());}};_0x4d3ece(++_0x5b170d);}(_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 _0xa902=['client','http','redis','./openchannelAccount.socket','register','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x45d31c,_0xd0b936){var _0x33c23a=function(_0xe014b0){while(--_0xe014b0){_0x45d31c['push'](_0x45d31c['shift']());}};_0x33c23a(++_0xd0b936);}(_0xa902,0x8d));var _0x2a90=function(_0x28331f,_0x207486){_0x28331f=_0x28331f-0x0;var _0x1e0243=_0xa902[_0x28331f];return _0x1e0243;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});config[_0x2a90('0xb')]=_['defaults'](config[_0x2a90('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2a90('0xb')]));require(_0x2a90('0xc'))[_0x2a90('0xd')](socket);function respondWithRpcPromise(_0x2b0a20,_0x18a60e,_0x56550f){return new BPromise(function(_0x361571,_0x3dadc2){return client[_0x2a90('0xe')](_0x2b0a20,_0x56550f)[_0x2a90('0xf')](function(_0x541e22){logger[_0x2a90('0x10')]('OpenchannelAccount,\x20%s,\x20%s',_0x18a60e,_0x2a90('0x11'));logger['debug'](_0x2a90('0x12'),_0x18a60e,'request\x20sent',JSON[_0x2a90('0x13')](_0x541e22));if(_0x541e22[_0x2a90('0x14')]){if(_0x541e22[_0x2a90('0x14')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x18a60e,_0x541e22[_0x2a90('0x14')][_0x2a90('0x15')]);return _0x3dadc2(_0x541e22['error'][_0x2a90('0x15')]);}logger[_0x2a90('0x14')](_0x2a90('0x16'),_0x18a60e,_0x541e22[_0x2a90('0x14')][_0x2a90('0x15')]);return _0x361571(_0x541e22[_0x2a90('0x14')][_0x2a90('0x15')]);}else{logger[_0x2a90('0x10')](_0x2a90('0x16'),_0x18a60e,'request\x20sent');_0x361571(_0x541e22[_0x2a90('0x17')][_0x2a90('0x15')]);}})[_0x2a90('0x18')](function(_0x52622c){logger[_0x2a90('0x14')](_0x2a90('0x16'),_0x18a60e,_0x52622c);_0x3dadc2(_0x52622c);});});}
\ No newline at end of file
index 49c8341..85da176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3360=['register','length','openchannelAccount:','./openchannelAccount.events','save','removeListener'];(function(_0x272437,_0x1a4588){var _0x32cf67=function(_0x386550){while(--_0x386550){_0x272437['push'](_0x272437['shift']());}};_0x32cf67(++_0x1a4588);}(_0x3360,0x1d7));var _0x0336=function(_0x272cd2,_0x3a8322){_0x272cd2=_0x272cd2-0x0;var _0x13bd2c=_0x3360[_0x272cd2];return _0x13bd2c;};'use strict';var OpenchannelAccountEvents=require(_0x0336('0x0'));var events=[_0x0336('0x1'),'remove','update'];function createListener(_0x5882e7,_0x12fd21){return function(_0x56bf8b){_0x12fd21['emit'](_0x5882e7,_0x56bf8b);};}function removeListener(_0x472555,_0xeb42d1){return function(){OpenchannelAccountEvents[_0x0336('0x2')](_0x472555,_0xeb42d1);};}exports[_0x0336('0x3')]=function(_0x340a8a){for(var _0x4aed6a=0x0,_0x4890e5=events[_0x0336('0x4')];_0x4aed6a<_0x4890e5;_0x4aed6a++){var _0x36a973=events[_0x4aed6a];var _0x310327=createListener(_0x0336('0x5')+_0x36a973,_0x340a8a);OpenchannelAccountEvents['on'](_0x36a973,_0x310327);}};
\ No newline at end of file
+var _0x63bb=['./openchannelAccount.events','save','remove','update','removeListener','register','length','openchannelAccount:'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x63bb,0xf8));var _0xb63b=function(_0x5f0e14,_0x373cbb){_0x5f0e14=_0x5f0e14-0x0;var _0x3ed494=_0x63bb[_0x5f0e14];return _0x3ed494;};'use strict';var OpenchannelAccountEvents=require(_0xb63b('0x0'));var events=[_0xb63b('0x1'),_0xb63b('0x2'),_0xb63b('0x3')];function createListener(_0x2b0db5,_0x2ad279){return function(_0x3540f2){_0x2ad279['emit'](_0x2b0db5,_0x3540f2);};}function removeListener(_0x48a423,_0x246da0){return function(){OpenchannelAccountEvents[_0xb63b('0x4')](_0x48a423,_0x246da0);};}exports[_0xb63b('0x5')]=function(_0x22be29){for(var _0x4fc464=0x0,_0x3eb1be=events[_0xb63b('0x6')];_0x4fc464<_0x3eb1be;_0x4fc464++){var _0x2aa873=events[_0x4fc464];var _0x544988=createListener(_0xb63b('0x7')+_0x2aa873,_0x22be29);OpenchannelAccountEvents['on'](_0x2aa873,_0x544988);}};
\ No newline at end of file
index dbfd66b..3757513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47ab=['./openchannelApplication.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x839b28,_0x3e887f){var _0x11e2e5=function(_0xdb42a0){while(--_0xdb42a0){_0x839b28['push'](_0x839b28['shift']());}};_0x11e2e5(++_0x3e887f);}(_0x47ab,0x19b));var _0xb47a=function(_0x5598f1,_0x44aaf2){_0x5598f1=_0x5598f1-0x0;var _0x137d9a=_0x47ab[_0x5598f1];return _0x137d9a;};'use strict';var multer=require(_0xb47a('0x0'));var util=require(_0xb47a('0x1'));var path=require('path');var timeout=require(_0xb47a('0x2'));var express=require('express');var router=express[_0xb47a('0x3')]();var fs_extra=require(_0xb47a('0x4'));var auth=require(_0xb47a('0x5'));var interaction=require(_0xb47a('0x6'));var config=require('../../config/environment');var controller=require(_0xb47a('0x7'));router[_0xb47a('0x8')]('/',auth[_0xb47a('0x9')](),controller['index']);router[_0xb47a('0x8')](_0xb47a('0xa'),auth[_0xb47a('0x9')](),controller[_0xb47a('0xb')]);router[_0xb47a('0xc')]('/',auth[_0xb47a('0x9')](),controller[_0xb47a('0xd')]);router[_0xb47a('0xe')]('/:id',auth[_0xb47a('0x9')](),controller[_0xb47a('0xf')]);router[_0xb47a('0x10')](_0xb47a('0xa'),auth[_0xb47a('0x9')](),controller[_0xb47a('0x11')]);module[_0xb47a('0x12')]=router;
\ No newline at end of file
+var _0x8c14=['update','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','/:id','isAuthenticated','post','create','put'];(function(_0x156da9,_0x15a41b){var _0x4759ca=function(_0x28df82){while(--_0x28df82){_0x156da9['push'](_0x156da9['shift']());}};_0x4759ca(++_0x15a41b);}(_0x8c14,0xad));var _0x48c1=function(_0x2e1a38,_0x1470d8){_0x2e1a38=_0x2e1a38-0x0;var _0x253cf6=_0x8c14[_0x2e1a38];return _0x253cf6;};'use strict';var multer=require(_0x48c1('0x0'));var util=require(_0x48c1('0x1'));var path=require(_0x48c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x48c1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x48c1('0x4'));var config=require(_0x48c1('0x5'));var controller=require(_0x48c1('0x6'));router[_0x48c1('0x7')]('/',auth['isAuthenticated'](),controller[_0x48c1('0x8')]);router[_0x48c1('0x7')](_0x48c1('0x9'),auth[_0x48c1('0xa')](),controller['show']);router[_0x48c1('0xb')]('/',auth['isAuthenticated'](),controller[_0x48c1('0xc')]);router[_0x48c1('0xd')]('/:id',auth[_0x48c1('0xa')](),controller[_0x48c1('0xe')]);router['delete'](_0x48c1('0x9'),auth[_0x48c1('0xa')](),controller[_0x48c1('0xf')]);module[_0x48c1('0x10')]=router;
\ No newline at end of file
index cb46ab8..eccf054 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb7b=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x13f035,_0x121a24){var _0x5e5717=function(_0x1df90e){while(--_0x1df90e){_0x13f035['push'](_0x13f035['shift']());}};_0x5e5717(++_0x121a24);}(_0xbb7b,0xc0));var _0xbbb7=function(_0x4fba1b,_0x28eb4c){_0x4fba1b=_0x4fba1b-0x0;var _0x3ea35a=_0xbb7b[_0x4fba1b];return _0x3ea35a;};'use strict';var Sequelize=require('sequelize');module[_0xbbb7('0x0')]={'priority':{'type':Sequelize[_0xbbb7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':![],'defaultValue':_0xbbb7('0x3')},'appdata':{'type':Sequelize[_0xbbb7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':_0xbbb7('0x5')}};
\ No newline at end of file
+var _0x3d62=['STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0x2a12e3,_0x30c6c6){var _0x53dc20=function(_0x2ada81){while(--_0x2ada81){_0x2a12e3['push'](_0x2a12e3['shift']());}};_0x53dc20(++_0x30c6c6);}(_0x3d62,0xa8));var _0x23d6=function(_0x38ff73,_0x4e13db){_0x38ff73=_0x38ff73-0x0;var _0x3fea5d=_0x3d62[_0x38ff73];return _0x3fea5d;};'use strict';var Sequelize=require(_0x23d6('0x0'));module[_0x23d6('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x23d6('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x23d6('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x23d6('0x2')],'defaultValue':_0x23d6('0x4')}};
\ No newline at end of file
index ed21bc7..f9c3c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04ff=['send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name'];(function(_0x382189,_0x4c38a9){var _0x36f350=function(_0x13e6a9){while(--_0x13e6a9){_0x382189['push'](_0x382189['shift']());}};_0x36f350(++_0x4c38a9);}(_0x04ff,0x115));var _0xf04f=function(_0x455556,_0x2e71de){_0x455556=_0x455556-0x0;var _0x52c6b8=_0x04ff[_0x455556];return _0x52c6b8;};'use strict';var emlformat=require(_0xf04f('0x0'));var rimraf=require(_0xf04f('0x1'));var zipdir=require(_0xf04f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf04f('0x3'));var moment=require(_0xf04f('0x4'));var BPromise=require(_0xf04f('0x5'));var Mustache=require(_0xf04f('0x6'));var util=require(_0xf04f('0x7'));var path=require(_0xf04f('0x8'));var sox=require('sox');var csv=require(_0xf04f('0x9'));var ejs=require(_0xf04f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf04f('0xb'));var squel=require(_0xf04f('0xc'));var crypto=require(_0xf04f('0xd'));var jsforce=require(_0xf04f('0xe'));var deskjs=require(_0xf04f('0xf'));var toCsv=require(_0xf04f('0x9'));var querystring=require(_0xf04f('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf04f('0x11'));var qs=require(_0xf04f('0x12'));var as=require(_0xf04f('0x13'));var hardwareService=require(_0xf04f('0x14'));var logger=require(_0xf04f('0x15'))(_0xf04f('0x16'));var utils=require('../../config/utils');var config=require(_0xf04f('0x17'));var licenseUtil=require(_0xf04f('0x18'));var db=require(_0xf04f('0x19'))['db'];function respondWithStatusCode(_0x43e3c2,_0x25f3a9){_0x25f3a9=_0x25f3a9||0xcc;return function(_0x1d0067){if(_0x1d0067){return _0x43e3c2[_0xf04f('0x1a')](_0x25f3a9);}return _0x43e3c2[_0xf04f('0x1b')](_0x25f3a9)[_0xf04f('0x1c')]();};}function respondWithResult(_0x58638c,_0x441f0c){_0x441f0c=_0x441f0c||0xc8;return function(_0x22dfc5){if(_0x22dfc5){return _0x58638c[_0xf04f('0x1b')](_0x441f0c)[_0xf04f('0x1d')](_0x22dfc5);}};}function respondWithFilteredResult(_0x1d9d89,_0x1bc9bf){return function(_0x18834f){if(_0x18834f){var _0x4aa96e=typeof _0x1bc9bf[_0xf04f('0x1e')]===_0xf04f('0x1f')&&typeof _0x1bc9bf[_0xf04f('0x20')]===_0xf04f('0x1f');var _0x2afebf=_0x18834f[_0xf04f('0x21')];var _0xc3e206=_0x4aa96e?0x0:_0x1bc9bf[_0xf04f('0x1e')];var _0x4d5234=_0x4aa96e?_0x18834f[_0xf04f('0x21')]:_0x1bc9bf['offset']+_0x1bc9bf[_0xf04f('0x20')];var _0x2efd48;if(_0x4d5234>=_0x2afebf){_0x4d5234=_0x2afebf;_0x2efd48=0xc8;}else{_0x2efd48=0xce;}_0x1d9d89[_0xf04f('0x1b')](_0x2efd48);return _0x1d9d89[_0xf04f('0x22')](_0xf04f('0x23'),_0xc3e206+'-'+_0x4d5234+'/'+_0x2afebf)[_0xf04f('0x1d')](_0x18834f);}return null;};}function patchUpdates(_0x4f6f19){return function(_0x151a0f){try{jsonpatch[_0xf04f('0x24')](_0x151a0f,_0x4f6f19,!![]);}catch(_0x22d2a8){return BPromise['reject'](_0x22d2a8);}return _0x151a0f[_0xf04f('0x25')]();};}function saveUpdates(_0x12ca05,_0x46d9d2){return function(_0x174ba4){if(_0x174ba4){return _0x174ba4[_0xf04f('0x26')](_0x12ca05)[_0xf04f('0x27')](function(_0xdbc164){return _0xdbc164;});}return null;};}function removeEntity(_0x59c8c3,_0x12721f){return function(_0x3d505b){if(_0x3d505b){return _0x3d505b['destroy']()[_0xf04f('0x27')](function(){_0x59c8c3[_0xf04f('0x1b')](0xcc)[_0xf04f('0x1c')]();});}};}function handleEntityNotFound(_0x3bee6f,_0x3a1ed3){return function(_0x36bdf7){if(!_0x36bdf7){_0x3bee6f[_0xf04f('0x1a')](0x194);}return _0x36bdf7;};}function handleError(_0x50c457,_0x3c879f){_0x3c879f=_0x3c879f||0x1f4;return function(_0x49f577){logger[_0xf04f('0x28')](_0x49f577[_0xf04f('0x29')]);if(_0x49f577[_0xf04f('0x2a')]){delete _0x49f577[_0xf04f('0x2a')];}_0x50c457[_0xf04f('0x1b')](_0x3c879f)[_0xf04f('0x2b')](_0x49f577);};}exports[_0xf04f('0x2c')]=function(_0x44d697,_0x213e63){var _0x243cd5={},_0xad5e2b={},_0x4f4479={'count':0x0,'rows':[]};var _0x56f77b=_[_0xf04f('0x2d')](db[_0xf04f('0x2e')][_0xf04f('0x2f')],function(_0x192d28){return{'name':_0x192d28[_0xf04f('0x30')],'type':_0x192d28[_0xf04f('0x31')][_0xf04f('0x32')]};});_0xad5e2b[_0xf04f('0x33')]=_['map'](_0x56f77b,_0xf04f('0x2a'));_0xad5e2b[_0xf04f('0x34')]=_[_0xf04f('0x35')](_0x44d697[_0xf04f('0x34')]);_0xad5e2b[_0xf04f('0x36')]=_[_0xf04f('0x37')](_0xad5e2b[_0xf04f('0x33')],_0xad5e2b[_0xf04f('0x34')]);_0x243cd5[_0xf04f('0x38')]=_['intersection'](_0xad5e2b[_0xf04f('0x33')],qs[_0xf04f('0x39')](_0x44d697[_0xf04f('0x34')]['fields']));_0x243cd5[_0xf04f('0x38')]=_0x243cd5['attributes'][_0xf04f('0x3a')]?_0x243cd5[_0xf04f('0x38')]:_0xad5e2b[_0xf04f('0x33')];if(!_0x44d697[_0xf04f('0x34')][_0xf04f('0x3b')](_0xf04f('0x3c'))){_0x243cd5[_0xf04f('0x20')]=qs[_0xf04f('0x20')](_0x44d697[_0xf04f('0x34')][_0xf04f('0x20')]);_0x243cd5[_0xf04f('0x1e')]=qs[_0xf04f('0x1e')](_0x44d697['query']['offset']);}_0x243cd5[_0xf04f('0x3d')]=qs['sort'](_0x44d697[_0xf04f('0x34')][_0xf04f('0x3e')]);_0x243cd5[_0xf04f('0x3f')]=qs[_0xf04f('0x36')](_[_0xf04f('0x40')](_0x44d697[_0xf04f('0x34')],_0xad5e2b[_0xf04f('0x36')]),_0x56f77b);if(_0x44d697[_0xf04f('0x34')]['filter']){_0x243cd5['where']=_[_0xf04f('0x41')](_0x243cd5[_0xf04f('0x3f')],{'$or':_[_0xf04f('0x2d')](_0x56f77b,function(_0x5814d3){if(_0x5814d3[_0xf04f('0x31')]!==_0xf04f('0x42')){var _0x3e2c5a={};_0x3e2c5a[_0x5814d3['name']]={'$like':'%'+_0x44d697[_0xf04f('0x34')][_0xf04f('0x43')]+'%'};return _0x3e2c5a;}})});}_0x243cd5=_[_0xf04f('0x41')]({},_0x243cd5,_0x44d697[_0xf04f('0x44')]);var _0x57ec00={'where':_0x243cd5[_0xf04f('0x3f')]};return db[_0xf04f('0x2e')][_0xf04f('0x21')](_0x57ec00)['then'](function(_0x5137f9){_0x4f4479[_0xf04f('0x21')]=_0x5137f9;if(_0x44d697[_0xf04f('0x34')][_0xf04f('0x45')]){_0x243cd5['include']=[{'all':!![]}];}return db[_0xf04f('0x2e')][_0xf04f('0x46')](_0x243cd5);})[_0xf04f('0x27')](function(_0x1fb05d){_0x4f4479[_0xf04f('0x47')]=_0x1fb05d;return _0x4f4479;})['then'](respondWithFilteredResult(_0x213e63,_0x243cd5))[_0xf04f('0x48')](handleError(_0x213e63,null));};exports[_0xf04f('0x49')]=function(_0x307ab5,_0x3119bd){var _0x3c2750={'raw':!![],'where':{'id':_0x307ab5[_0xf04f('0x4a')]['id']}},_0x5f13d6={};_0x5f13d6[_0xf04f('0x33')]=_[_0xf04f('0x35')](db['OpenchannelApplication'][_0xf04f('0x2f')]);_0x5f13d6[_0xf04f('0x34')]=_['keys'](_0x307ab5[_0xf04f('0x34')]);_0x5f13d6[_0xf04f('0x36')]=_[_0xf04f('0x37')](_0x5f13d6['model'],_0x5f13d6[_0xf04f('0x34')]);_0x3c2750['attributes']=_[_0xf04f('0x37')](_0x5f13d6[_0xf04f('0x33')],qs[_0xf04f('0x39')](_0x307ab5[_0xf04f('0x34')][_0xf04f('0x39')]));_0x3c2750['attributes']=_0x3c2750['attributes'][_0xf04f('0x3a')]?_0x3c2750[_0xf04f('0x38')]:_0x5f13d6[_0xf04f('0x33')];if(_0x307ab5[_0xf04f('0x34')][_0xf04f('0x45')]){_0x3c2750[_0xf04f('0x4b')]=[{'all':!![]}];}_0x3c2750=_[_0xf04f('0x41')]({},_0x3c2750,_0x307ab5[_0xf04f('0x44')]);return db['OpenchannelApplication'][_0xf04f('0x4c')](_0x3c2750)[_0xf04f('0x27')](handleEntityNotFound(_0x3119bd,null))[_0xf04f('0x27')](respondWithResult(_0x3119bd,null))[_0xf04f('0x48')](handleError(_0x3119bd,null));};exports[_0xf04f('0x4d')]=function(_0x2a3960,_0x458ac4){return db['OpenchannelApplication'][_0xf04f('0x4d')](_0x2a3960[_0xf04f('0x4e')],{})['then'](respondWithResult(_0x458ac4,0xc9))[_0xf04f('0x48')](handleError(_0x458ac4,null));};exports[_0xf04f('0x26')]=function(_0x2208c1,_0x42b4b0){if(_0x2208c1[_0xf04f('0x4e')]['id']){delete _0x2208c1[_0xf04f('0x4e')]['id'];}return db[_0xf04f('0x2e')][_0xf04f('0x4c')]({'where':{'id':_0x2208c1[_0xf04f('0x4a')]['id']}})[_0xf04f('0x27')](handleEntityNotFound(_0x42b4b0,null))[_0xf04f('0x27')](saveUpdates(_0x2208c1['body'],null))[_0xf04f('0x27')](respondWithResult(_0x42b4b0,null))[_0xf04f('0x48')](handleError(_0x42b4b0,null));};exports[_0xf04f('0x4f')]=function(_0x25d417,_0xfb01c1){return db[_0xf04f('0x2e')][_0xf04f('0x4c')]({'where':{'id':_0x25d417[_0xf04f('0x4a')]['id']}})[_0xf04f('0x27')](handleEntityNotFound(_0xfb01c1,null))['then'](removeEntity(_0xfb01c1,null))[_0xf04f('0x48')](handleError(_0xfb01c1,null));};
\ No newline at end of file
+var _0xb7c7=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','update','destroy','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','then','includeAll','include','findAll','catch','show','find','create','body','params','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3d241d,_0x229e60){var _0x2601d5=function(_0x24b7af){while(--_0x24b7af){_0x3d241d['push'](_0x3d241d['shift']());}};_0x2601d5(++_0x229e60);}(_0xb7c7,0x1ee));var _0x7b7c=function(_0x25c988,_0xce8221){_0x25c988=_0x25c988-0x0;var _0x45fcc2=_0xb7c7[_0x25c988];return _0x45fcc2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7c('0x1'));var rp=require(_0x7b7c('0x2'));var moment=require(_0x7b7c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7b7c('0x4'));var sox=require(_0x7b7c('0x5'));var csv=require(_0x7b7c('0x6'));var ejs=require(_0x7b7c('0x7'));var fs=require('fs');var fs_extra=require(_0x7b7c('0x8'));var _=require(_0x7b7c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b7c('0xa'));var toCsv=require(_0x7b7c('0x6'));var querystring=require(_0x7b7c('0xb'));var Papa=require(_0x7b7c('0xc'));var Redis=require(_0x7b7c('0xd'));var authService=require(_0x7b7c('0xe'));var qs=require(_0x7b7c('0xf'));var as=require(_0x7b7c('0x10'));var hardwareService=require(_0x7b7c('0x11'));var logger=require(_0x7b7c('0x12'))(_0x7b7c('0x13'));var utils=require(_0x7b7c('0x14'));var config=require(_0x7b7c('0x15'));var licenseUtil=require(_0x7b7c('0x16'));var db=require(_0x7b7c('0x17'))['db'];function respondWithStatusCode(_0x5a4487,_0x4a2b30){_0x4a2b30=_0x4a2b30||0xcc;return function(_0x29515b){if(_0x29515b){return _0x5a4487['sendStatus'](_0x4a2b30);}return _0x5a4487[_0x7b7c('0x18')](_0x4a2b30)[_0x7b7c('0x19')]();};}function respondWithResult(_0x2420d0,_0x2fbdda){_0x2fbdda=_0x2fbdda||0xc8;return function(_0xfead81){if(_0xfead81){return _0x2420d0['status'](_0x2fbdda)[_0x7b7c('0x1a')](_0xfead81);}};}function respondWithFilteredResult(_0x33b975,_0x5118fd){return function(_0x40cb72){if(_0x40cb72){var _0x241b6e=typeof _0x5118fd[_0x7b7c('0x1b')]===_0x7b7c('0x1c')&&typeof _0x5118fd[_0x7b7c('0x1d')]===_0x7b7c('0x1c');var _0x209f60=_0x40cb72['count'];var _0x44ebdf=_0x241b6e?0x0:_0x5118fd['offset'];var _0x1f854e=_0x241b6e?_0x40cb72['count']:_0x5118fd[_0x7b7c('0x1b')]+_0x5118fd[_0x7b7c('0x1d')];var _0x48ca80;if(_0x1f854e>=_0x209f60){_0x1f854e=_0x209f60;_0x48ca80=0xc8;}else{_0x48ca80=0xce;}_0x33b975['status'](_0x48ca80);return _0x33b975[_0x7b7c('0x1e')]('Content-Range',_0x44ebdf+'-'+_0x1f854e+'/'+_0x209f60)[_0x7b7c('0x1a')](_0x40cb72);}return null;};}function patchUpdates(_0x336753){return function(_0x4c9143){try{jsonpatch[_0x7b7c('0x1f')](_0x4c9143,_0x336753,!![]);}catch(_0x22e0a7){return BPromise[_0x7b7c('0x20')](_0x22e0a7);}return _0x4c9143['save']();};}function saveUpdates(_0x475ef5,_0x43916f){return function(_0x40dc64){if(_0x40dc64){return _0x40dc64[_0x7b7c('0x21')](_0x475ef5)['then'](function(_0x36ea8d){return _0x36ea8d;});}return null;};}function removeEntity(_0x50c02d,_0x136329){return function(_0x4d0e19){if(_0x4d0e19){return _0x4d0e19[_0x7b7c('0x22')]()['then'](function(){_0x50c02d[_0x7b7c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f67e3,_0x169271){return function(_0x40ca2d){if(!_0x40ca2d){_0x2f67e3[_0x7b7c('0x23')](0x194);}return _0x40ca2d;};}function handleError(_0x3822bc,_0xe24854){_0xe24854=_0xe24854||0x1f4;return function(_0x429c28){logger[_0x7b7c('0x24')](_0x429c28[_0x7b7c('0x25')]);if(_0x429c28['name']){delete _0x429c28[_0x7b7c('0x26')];}_0x3822bc[_0x7b7c('0x18')](_0xe24854)['send'](_0x429c28);};}exports[_0x7b7c('0x27')]=function(_0xfa996,_0x1a4dd7){var _0x1bbc60={},_0x434f98={},_0x11528f={'count':0x0,'rows':[]};var _0x1199cc=_[_0x7b7c('0x28')](db[_0x7b7c('0x29')][_0x7b7c('0x2a')],function(_0x587177){return{'name':_0x587177[_0x7b7c('0x2b')],'type':_0x587177[_0x7b7c('0x2c')][_0x7b7c('0x2d')]};});_0x434f98[_0x7b7c('0x2e')]=_[_0x7b7c('0x28')](_0x1199cc,_0x7b7c('0x26'));_0x434f98[_0x7b7c('0x2f')]=_[_0x7b7c('0x30')](_0xfa996[_0x7b7c('0x2f')]);_0x434f98[_0x7b7c('0x31')]=_[_0x7b7c('0x32')](_0x434f98[_0x7b7c('0x2e')],_0x434f98[_0x7b7c('0x2f')]);_0x1bbc60[_0x7b7c('0x33')]=_['intersection'](_0x434f98[_0x7b7c('0x2e')],qs[_0x7b7c('0x34')](_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x34')]));_0x1bbc60['attributes']=_0x1bbc60[_0x7b7c('0x33')]['length']?_0x1bbc60[_0x7b7c('0x33')]:_0x434f98['model'];if(!_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x35')](_0x7b7c('0x36'))){_0x1bbc60['limit']=qs[_0x7b7c('0x1d')](_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x1d')]);_0x1bbc60[_0x7b7c('0x1b')]=qs['offset'](_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x1b')]);}_0x1bbc60['order']=qs[_0x7b7c('0x37')](_0xfa996[_0x7b7c('0x2f')]['sort']);_0x1bbc60[_0x7b7c('0x38')]=qs[_0x7b7c('0x31')](_['pick'](_0xfa996[_0x7b7c('0x2f')],_0x434f98['filters']),_0x1199cc);if(_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x39')]){_0x1bbc60[_0x7b7c('0x38')]=_[_0x7b7c('0x3a')](_0x1bbc60[_0x7b7c('0x38')],{'$or':_[_0x7b7c('0x28')](_0x1199cc,function(_0x5307da){if(_0x5307da[_0x7b7c('0x2c')]!==_0x7b7c('0x3b')){var _0x3d5838={};_0x3d5838[_0x5307da[_0x7b7c('0x26')]]={'$like':'%'+_0xfa996['query']['filter']+'%'};return _0x3d5838;}})});}_0x1bbc60=_[_0x7b7c('0x3a')]({},_0x1bbc60,_0xfa996[_0x7b7c('0x3c')]);var _0x149d09={'where':_0x1bbc60[_0x7b7c('0x38')]};return db[_0x7b7c('0x29')][_0x7b7c('0x3d')](_0x149d09)[_0x7b7c('0x3e')](function(_0xa595df){_0x11528f[_0x7b7c('0x3d')]=_0xa595df;if(_0xfa996[_0x7b7c('0x2f')][_0x7b7c('0x3f')]){_0x1bbc60[_0x7b7c('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x7b7c('0x41')](_0x1bbc60);})[_0x7b7c('0x3e')](function(_0x5f5152){_0x11528f['rows']=_0x5f5152;return _0x11528f;})['then'](respondWithFilteredResult(_0x1a4dd7,_0x1bbc60))[_0x7b7c('0x42')](handleError(_0x1a4dd7,null));};exports[_0x7b7c('0x43')]=function(_0x312e71,_0x5a0c90){var _0x333174={'raw':!![],'where':{'id':_0x312e71['params']['id']}},_0x19adc7={};_0x19adc7[_0x7b7c('0x2e')]=_[_0x7b7c('0x30')](db[_0x7b7c('0x29')][_0x7b7c('0x2a')]);_0x19adc7[_0x7b7c('0x2f')]=_[_0x7b7c('0x30')](_0x312e71[_0x7b7c('0x2f')]);_0x19adc7[_0x7b7c('0x31')]=_[_0x7b7c('0x32')](_0x19adc7[_0x7b7c('0x2e')],_0x19adc7['query']);_0x333174[_0x7b7c('0x33')]=_['intersection'](_0x19adc7[_0x7b7c('0x2e')],qs['fields'](_0x312e71[_0x7b7c('0x2f')][_0x7b7c('0x34')]));_0x333174[_0x7b7c('0x33')]=_0x333174['attributes']['length']?_0x333174[_0x7b7c('0x33')]:_0x19adc7[_0x7b7c('0x2e')];if(_0x312e71[_0x7b7c('0x2f')][_0x7b7c('0x3f')]){_0x333174[_0x7b7c('0x40')]=[{'all':!![]}];}_0x333174=_['merge']({},_0x333174,_0x312e71[_0x7b7c('0x3c')]);return db[_0x7b7c('0x29')][_0x7b7c('0x44')](_0x333174)[_0x7b7c('0x3e')](handleEntityNotFound(_0x5a0c90,null))['then'](respondWithResult(_0x5a0c90,null))[_0x7b7c('0x42')](handleError(_0x5a0c90,null));};exports[_0x7b7c('0x45')]=function(_0x5b80c0,_0x21fb36){return db[_0x7b7c('0x29')][_0x7b7c('0x45')](_0x5b80c0['body'],{})[_0x7b7c('0x3e')](respondWithResult(_0x21fb36,0xc9))[_0x7b7c('0x42')](handleError(_0x21fb36,null));};exports[_0x7b7c('0x21')]=function(_0x41a4e6,_0x394372){if(_0x41a4e6[_0x7b7c('0x46')]['id']){delete _0x41a4e6[_0x7b7c('0x46')]['id'];}return db[_0x7b7c('0x29')]['find']({'where':{'id':_0x41a4e6[_0x7b7c('0x47')]['id']}})['then'](handleEntityNotFound(_0x394372,null))[_0x7b7c('0x3e')](saveUpdates(_0x41a4e6[_0x7b7c('0x46')],null))[_0x7b7c('0x3e')](respondWithResult(_0x394372,null))[_0x7b7c('0x42')](handleError(_0x394372,null));};exports[_0x7b7c('0x22')]=function(_0x56b69c,_0x286481){return db[_0x7b7c('0x29')][_0x7b7c('0x44')]({'where':{'id':_0x56b69c[_0x7b7c('0x47')]['id']}})[_0x7b7c('0x3e')](handleEntityNotFound(_0x286481,null))[_0x7b7c('0x3e')](removeEntity(_0x286481,null))[_0x7b7c('0x42')](handleError(_0x286481,null));};
\ No newline at end of file
index 64c75bb..da09075 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ebb=['./openchannelApplication.attributes','define','openchannel_applications','utf8mb4','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x1fa722,_0x6d53ef){var _0x57eab2=function(_0x1b1b24){while(--_0x1b1b24){_0x1fa722['push'](_0x1fa722['shift']());}};_0x57eab2(++_0x6d53ef);}(_0x4ebb,0x9a));var _0xb4eb=function(_0x272cfd,_0x589216){_0x272cfd=_0x272cfd-0x0;var _0x2c283d=_0x4ebb[_0x272cfd];return _0x2c283d;};'use strict';var _=require(_0xb4eb('0x0'));var util=require(_0xb4eb('0x1'));var logger=require(_0xb4eb('0x2'))('api');var moment=require(_0xb4eb('0x3'));var BPromise=require('bluebird');var rp=require(_0xb4eb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4eb('0x5'));var config=require('../../config/environment');var attributes=require(_0xb4eb('0x6'));module['exports']=function(_0x59da56,_0x2e4e78){return _0x59da56[_0xb4eb('0x7')]('OpenchannelApplication',attributes,{'tableName':_0xb4eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4eb('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0eec=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x0eec,0x111));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require(_0xc0ee('0x1'));var logger=require(_0xc0ee('0x2'))(_0xc0ee('0x3'));var moment=require('moment');var BPromise=require(_0xc0ee('0x4'));var rp=require(_0xc0ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x405206,_0x554eaf){return _0x405206[_0xc0ee('0x8')](_0xc0ee('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc0ee('0xa')});};
\ No newline at end of file
index 2f94dcb..2a9f34f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ed5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x292037,_0x442f7c){var _0x4bd506=function(_0x2c73ce){while(--_0x2c73ce){_0x292037['push'](_0x292037['shift']());}};_0x4bd506(++_0x442f7c);}(_0x8ed5,0xa1));var _0x58ed=function(_0x570d76,_0x2c471c){_0x570d76=_0x570d76-0x0;var _0x11b012=_0x8ed5[_0x570d76];return _0x11b012;};'use strict';var _=require(_0x58ed('0x0'));var util=require(_0x58ed('0x1'));var moment=require(_0x58ed('0x2'));var BPromise=require(_0x58ed('0x3'));var rs=require(_0x58ed('0x4'));var fs=require('fs');var Redis=require(_0x58ed('0x5'));var db=require(_0x58ed('0x6'))['db'];var utils=require(_0x58ed('0x7'));var logger=require(_0x58ed('0x8'))(_0x58ed('0x9'));var config=require(_0x58ed('0xa'));var jayson=require(_0x58ed('0xb'));var client=jayson[_0x58ed('0xc')][_0x58ed('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d856c,_0x455226,_0x263253){return new BPromise(function(_0x4a5497,_0x1ebe34){return client[_0x58ed('0xe')](_0x4d856c,_0x263253)['then'](function(_0x5ab89e){logger['info'](_0x58ed('0xf'),_0x455226,'request\x20sent');logger[_0x58ed('0x10')](_0x58ed('0x11'),_0x455226,_0x58ed('0x12'),JSON[_0x58ed('0x13')](_0x5ab89e));if(_0x5ab89e['error']){if(_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x15')]===0x1f4){logger['error'](_0x58ed('0xf'),_0x455226,_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x16')]);return _0x1ebe34(_0x5ab89e[_0x58ed('0x14')][_0x58ed('0x16')]);}logger[_0x58ed('0x14')](_0x58ed('0xf'),_0x455226,_0x5ab89e['error'][_0x58ed('0x16')]);return _0x4a5497(_0x5ab89e[_0x58ed('0x14')]['message']);}else{logger[_0x58ed('0x17')]('OpenchannelApplication,\x20%s,\x20%s',_0x455226,_0x58ed('0x12'));_0x4a5497(_0x5ab89e[_0x58ed('0x18')][_0x58ed('0x16')]);}})[_0x58ed('0x19')](function(_0x5742b8){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x455226,_0x5742b8);_0x1ebe34(_0x5742b8);});});}exports[_0x58ed('0x1a')]=function(_0xbd0a19){var _0x14a85e=this;return new Promise(function(_0x484b09,_0x386ba6){return db['OpenchannelApplication']['update'](_0xbd0a19[_0x58ed('0x1b')],{'raw':_0xbd0a19[_0x58ed('0x1c')]?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbd0a19['options']?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1e')]||null:null,'attributes':_0xbd0a19['options']?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x1f')]||null:null,'limit':_0xbd0a19[_0x58ed('0x1c')]?_0xbd0a19[_0x58ed('0x1c')][_0x58ed('0x20')]||null:null})['then'](function(_0x3f69e4){logger[_0x58ed('0x17')](_0x58ed('0x1a'),_0xbd0a19);logger[_0x58ed('0x10')](_0x58ed('0x1a'),_0xbd0a19,JSON[_0x58ed('0x13')](_0x3f69e4));_0x484b09(_0x3f69e4);})[_0x58ed('0x19')](function(_0x7f723a){logger[_0x58ed('0x14')](_0x58ed('0x1a'),_0x7f723a['message'],_0xbd0a19);_0x386ba6(_0x14a85e['error'](0x1f4,_0x7f723a['message']));});});};
\ No newline at end of file
+var _0x1cb5=['options','where','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request','then','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','info','UpdateOpenchannelApplication','OpenchannelApplication','update','body'];(function(_0x460fd9,_0x4b4b97){var _0x424e18=function(_0x4a4942){while(--_0x4a4942){_0x460fd9['push'](_0x460fd9['shift']());}};_0x424e18(++_0x4b4b97);}(_0x1cb5,0x71));var _0x51cb=function(_0x72c6a,_0x474d91){_0x72c6a=_0x72c6a-0x0;var _0x22e84a=_0x1cb5[_0x72c6a];return _0x22e84a;};'use strict';var _=require(_0x51cb('0x0'));var util=require('util');var moment=require(_0x51cb('0x1'));var BPromise=require(_0x51cb('0x2'));var rs=require(_0x51cb('0x3'));var fs=require('fs');var Redis=require(_0x51cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51cb('0x5'));var logger=require(_0x51cb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x51cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x210d82,_0x2a19c4,_0xf736e7){return new BPromise(function(_0x3dfbac,_0x50e407){return client[_0x51cb('0x8')](_0x210d82,_0xf736e7)[_0x51cb('0x9')](function(_0x224e4d){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x2a19c4,_0x51cb('0xa'));logger['debug'](_0x51cb('0xb'),_0x2a19c4,_0x51cb('0xa'),JSON[_0x51cb('0xc')](_0x224e4d));if(_0x224e4d[_0x51cb('0xd')]){if(_0x224e4d[_0x51cb('0xd')][_0x51cb('0xe')]===0x1f4){logger[_0x51cb('0xd')](_0x51cb('0xf'),_0x2a19c4,_0x224e4d[_0x51cb('0xd')][_0x51cb('0x10')]);return _0x50e407(_0x224e4d[_0x51cb('0xd')][_0x51cb('0x10')]);}logger[_0x51cb('0xd')](_0x51cb('0xf'),_0x2a19c4,_0x224e4d[_0x51cb('0xd')]['message']);return _0x3dfbac(_0x224e4d[_0x51cb('0xd')][_0x51cb('0x10')]);}else{logger[_0x51cb('0x11')](_0x51cb('0xf'),_0x2a19c4,_0x51cb('0xa'));_0x3dfbac(_0x224e4d['result'][_0x51cb('0x10')]);}})['catch'](function(_0x6a5442){logger[_0x51cb('0xd')](_0x51cb('0xf'),_0x2a19c4,_0x6a5442);_0x50e407(_0x6a5442);});});}exports[_0x51cb('0x12')]=function(_0x776226){var _0x1efa98=this;return new Promise(function(_0x3630be,_0x2aee0b){return db[_0x51cb('0x13')][_0x51cb('0x14')](_0x776226[_0x51cb('0x15')],{'raw':_0x776226[_0x51cb('0x16')]?_0x776226[_0x51cb('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x776226[_0x51cb('0x16')]?_0x776226[_0x51cb('0x16')][_0x51cb('0x17')]||null:null,'attributes':_0x776226[_0x51cb('0x16')]?_0x776226[_0x51cb('0x16')][_0x51cb('0x18')]||null:null,'limit':_0x776226[_0x51cb('0x16')]?_0x776226[_0x51cb('0x16')][_0x51cb('0x19')]||null:null})[_0x51cb('0x9')](function(_0x418b9b){logger[_0x51cb('0x11')]('UpdateOpenchannelApplication',_0x776226);logger['debug'](_0x51cb('0x12'),_0x776226,JSON[_0x51cb('0xc')](_0x418b9b));_0x3630be(_0x418b9b);})[_0x51cb('0x1a')](function(_0xb6a2bf){logger[_0x51cb('0xd')](_0x51cb('0x12'),_0xb6a2bf[_0x51cb('0x10')],_0x776226);_0x2aee0b(_0x1efa98[_0x51cb('0xd')](0x1f4,_0xb6a2bf[_0x51cb('0x10')]));});});};
\ No newline at end of file
index a801a51..fa242a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe50b=['addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','openchannelinteraction:destroy','delete','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe50b,0x103));var _0xbe50=function(_0x173003,_0x51bfb4){_0x173003=_0x173003-0x0;var _0x593b55=_0xe50b[_0x173003];return _0x593b55;};'use strict';var multer=require(_0xbe50('0x0'));var util=require(_0xbe50('0x1'));var path=require('path');var timeout=require(_0xbe50('0x2'));var express=require(_0xbe50('0x3'));var router=express[_0xbe50('0x4')]();var fs_extra=require(_0xbe50('0x5'));var auth=require(_0xbe50('0x6'));var interaction=require(_0xbe50('0x7'));var config=require(_0xbe50('0x8'));var controller=require(_0xbe50('0x9'));router[_0xbe50('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbe50('0xa')]('/describe',auth[_0xbe50('0xb')](),controller[_0xbe50('0xc')]);router[_0xbe50('0xa')](_0xbe50('0xd'),auth['isAuthenticated'](),controller[_0xbe50('0xe')]);router[_0xbe50('0xa')](_0xbe50('0xf'),auth[_0xbe50('0xb')](),controller[_0xbe50('0x10')]);router['get'](_0xbe50('0x11'),auth['isAuthenticated'](),controller['download']);router[_0xbe50('0x12')]('/',auth[_0xbe50('0xb')](),controller[_0xbe50('0x13')]);router[_0xbe50('0x12')](_0xbe50('0xf'),auth[_0xbe50('0xb')](),controller[_0xbe50('0x14')]);router[_0xbe50('0x12')](_0xbe50('0x15'),auth[_0xbe50('0xb')](),interaction[_0xbe50('0x16')](_0xbe50('0x17'),_0xbe50('0x18')),controller[_0xbe50('0x19')]);router[_0xbe50('0x1a')](_0xbe50('0xd'),auth['isAuthenticated'](),interaction['tracked']('openchannel','openchannelinteraction:update'),controller[_0xbe50('0x1b')]);router['delete'](_0xbe50('0xd'),auth['isAuthenticated'](),interaction[_0xbe50('0x16')](_0xbe50('0x17'),_0xbe50('0x1c')),controller['destroy']);router[_0xbe50('0x1d')]('/:id/tags',auth[_0xbe50('0xb')](),controller[_0xbe50('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xf553=['download','create','addMessage','post','/:id/tags','tracked','openchannel','addTags','put','/:id','openchannelinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','/describe','isAuthenticated','show','/:id/messages','/:id/download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf553,0x1a3));var _0x3f55=function(_0x32b30c,_0x2d5ec8){_0x32b30c=_0x32b30c-0x0;var _0xcfc212=_0xf553[_0x32b30c];return _0xcfc212;};'use strict';var multer=require(_0x3f55('0x0'));var util=require(_0x3f55('0x1'));var path=require(_0x3f55('0x2'));var timeout=require(_0x3f55('0x3'));var express=require(_0x3f55('0x4'));var router=express[_0x3f55('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3f55('0x6'));var interaction=require(_0x3f55('0x7'));var config=require('../../config/environment');var controller=require(_0x3f55('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3f55('0x9')](_0x3f55('0xa'),auth[_0x3f55('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3f55('0xb')](),controller[_0x3f55('0xc')]);router[_0x3f55('0x9')](_0x3f55('0xd'),auth[_0x3f55('0xb')](),controller['getMessages']);router[_0x3f55('0x9')](_0x3f55('0xe'),auth[_0x3f55('0xb')](),controller[_0x3f55('0xf')]);router['post']('/',auth[_0x3f55('0xb')](),controller[_0x3f55('0x10')]);router['post']('/:id/messages',auth[_0x3f55('0xb')](),controller[_0x3f55('0x11')]);router[_0x3f55('0x12')](_0x3f55('0x13'),auth[_0x3f55('0xb')](),interaction[_0x3f55('0x14')](_0x3f55('0x15'),'openchannelinteraction:addtags'),controller[_0x3f55('0x16')]);router[_0x3f55('0x17')](_0x3f55('0x18'),auth[_0x3f55('0xb')](),interaction['tracked'](_0x3f55('0x15'),_0x3f55('0x19')),controller[_0x3f55('0x1a')]);router[_0x3f55('0x1b')]('/:id',auth[_0x3f55('0xb')](),interaction[_0x3f55('0x14')](_0x3f55('0x15'),'openchannelinteraction:destroy'),controller[_0x3f55('0x1c')]);router[_0x3f55('0x1b')](_0x3f55('0x13'),auth[_0x3f55('0xb')](),controller[_0x3f55('0x1d')]);module[_0x3f55('0x1e')]=router;
\ No newline at end of file
index 1de4e60..4cfc6fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ff7=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x21d383,_0x71056d){var _0x3ea4a5=function(_0x233120){while(--_0x233120){_0x21d383['push'](_0x21d383['shift']());}};_0x3ea4a5(++_0x71056d);}(_0x9ff7,0x8c));var _0x79ff=function(_0x1306dd,_0x51547f){_0x1306dd=_0x1306dd-0x0;var _0x550bd9=_0x9ff7[_0x1306dd];return _0x550bd9;};'use strict';var Sequelize=require(_0x79ff('0x0'));module[_0x79ff('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x79ff('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x79ff('0x3')]},'thirdDisposition':{'type':Sequelize[_0x79ff('0x3')]},'note':{'type':Sequelize[_0x79ff('0x3')]},'read1stAt':{'type':Sequelize[_0x79ff('0x2')]},'threadId':{'type':Sequelize[_0x79ff('0x3')]},'externalUrl':{'type':Sequelize[_0x79ff('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x79ff('0x4')]('in',_0x79ff('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5183=['DATE','ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x5183,0x13e));var _0x3518=function(_0x10021c,_0x7ea77e){_0x10021c=_0x10021c-0x0;var _0x428fff=_0x5183[_0x10021c];return _0x428fff;};'use strict';var Sequelize=require(_0x3518('0x0'));module[_0x3518('0x1')]={'closed':{'type':Sequelize[_0x3518('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3518('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3518('0x3')]},'note':{'type':Sequelize[_0x3518('0x3')]},'read1stAt':{'type':Sequelize[_0x3518('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x3518('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3518('0x5')]('in',_0x3518('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 2622556..641cb1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37f5=['get','mkdirSync','Openchannel','Account','Owner','N.A.','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','destroy','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','select','field','color','u.id','ui.OpenchannelInteractionId','left_join','users','from','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','OpenchannelAccountId','createdAt','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','order','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','options','create','body','describe','addMessage','OpenchannelMessage','findOne','nolimit','pick','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','omit','spread','openchannelInteractionTags:save','removeTags','download','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount'];(function(_0x296609,_0x5a31c5){var _0x1f565d=function(_0x57b321){while(--_0x57b321){_0x296609['push'](_0x296609['shift']());}};_0x1f565d(++_0x5a31c5);}(_0x37f5,0x1ec));var _0x537f=function(_0x1fba88,_0x377f23){_0x1fba88=_0x1fba88-0x0;var _0x3f0fee=_0x37f5[_0x1fba88];return _0x3f0fee;};'use strict';var emlformat=require(_0x537f('0x0'));var rimraf=require(_0x537f('0x1'));var zipdir=require(_0x537f('0x2'));var jsonpatch=require(_0x537f('0x3'));var rp=require('request-promise');var moment=require(_0x537f('0x4'));var BPromise=require(_0x537f('0x5'));var Mustache=require('mustache');var util=require(_0x537f('0x6'));var path=require(_0x537f('0x7'));var sox=require(_0x537f('0x8'));var csv=require(_0x537f('0x9'));var ejs=require(_0x537f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x537f('0xb'));var squel=require(_0x537f('0xc'));var crypto=require(_0x537f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x537f('0xe'));var toCsv=require(_0x537f('0x9'));var querystring=require('querystring');var Papa=require(_0x537f('0xf'));var Redis=require(_0x537f('0x10'));var authService=require(_0x537f('0x11'));var qs=require(_0x537f('0x12'));var as=require(_0x537f('0x13'));var pdf=require(_0x537f('0x14'));var hardwareService=require(_0x537f('0x15'));var logger=require(_0x537f('0x16'))(_0x537f('0x17'));var utils=require(_0x537f('0x18'));var config=require(_0x537f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x537f('0x1a'))['db'];config[_0x537f('0x1b')]=_[_0x537f('0x1c')](config[_0x537f('0x1b')],{'host':_0x537f('0x1d'),'port':0x18eb});var socket=require(_0x537f('0x1e'))(new Redis(config[_0x537f('0x1b')]));require(_0x537f('0x1f'))[_0x537f('0x20')](socket);function respondWithStatusCode(_0x473d03,_0x39c4a2){_0x39c4a2=_0x39c4a2||0xcc;return function(_0x3b97aa){if(_0x3b97aa){return _0x473d03[_0x537f('0x21')](_0x39c4a2);}return _0x473d03['status'](_0x39c4a2)[_0x537f('0x22')]();};}function respondWithResult(_0x3aec3a,_0x495d10){_0x495d10=_0x495d10||0xc8;return function(_0x17ef4a){if(_0x17ef4a){return _0x3aec3a['status'](_0x495d10)['json'](_0x17ef4a);}};}function respondWithFilteredResult(_0x8fc040,_0xbc36bc){return function(_0x3dc4e3){if(_0x3dc4e3){var _0x23f042=typeof _0xbc36bc[_0x537f('0x23')]===_0x537f('0x24')&&typeof _0xbc36bc[_0x537f('0x25')]===_0x537f('0x24');var _0x5cceda=_0x3dc4e3['count'];var _0x896aad=_0x23f042?0x0:_0xbc36bc['offset'];var _0x5731c4=_0x23f042?_0x3dc4e3[_0x537f('0x26')]:_0xbc36bc[_0x537f('0x23')]+_0xbc36bc[_0x537f('0x25')];var _0x3d1ea6;if(_0x5731c4>=_0x5cceda){_0x5731c4=_0x5cceda;_0x3d1ea6=0xc8;}else{_0x3d1ea6=0xce;}_0x8fc040[_0x537f('0x27')](_0x3d1ea6);return _0x8fc040[_0x537f('0x28')](_0x537f('0x29'),_0x896aad+'-'+_0x5731c4+'/'+_0x5cceda)['json'](_0x3dc4e3);}return null;};}function patchUpdates(_0x29f0bd){return function(_0x5171a5){try{jsonpatch['apply'](_0x5171a5,_0x29f0bd,!![]);}catch(_0x596675){return BPromise[_0x537f('0x2a')](_0x596675);}return _0x5171a5[_0x537f('0x2b')]();};}function saveUpdates(_0x20c5f6,_0x3e5dc6){return function(_0x59da85){if(_0x59da85){return _0x59da85[_0x537f('0x2c')](_0x20c5f6)['then'](function(_0x455f92){return _0x455f92;});}return null;};}function removeEntity(_0x378af0,_0xce7743){return function(_0xc4ab2d){if(_0xc4ab2d){return _0xc4ab2d[_0x537f('0x2d')]()[_0x537f('0x2e')](function(){_0x378af0[_0x537f('0x27')](0xcc)[_0x537f('0x22')]();});}};}function handleEntityNotFound(_0xda995d,_0x38af47){return function(_0x5e5b8f){if(!_0x5e5b8f){_0xda995d[_0x537f('0x21')](0x194);}return _0x5e5b8f;};}function handleError(_0x4ed111,_0x456e2f){_0x456e2f=_0x456e2f||0x1f4;return function(_0x5c9136){logger[_0x537f('0x2f')](_0x5c9136[_0x537f('0x30')]);if(_0x5c9136['name']){delete _0x5c9136[_0x537f('0x31')];}_0x4ed111['status'](_0x456e2f)['send'](_0x5c9136);};}function getInteractionUsers(_0x3909b4,_0x47d196){return new BPromise(function(_0x3aa159,_0x5e6c24){try{if(_0x47d196[_0x3909b4['id']]){_0x3909b4[_0x537f('0x32')]=_[_0x537f('0x33')](_0x47d196[_0x3909b4['id']],function(_0x2fe504){return{'id':_0x2fe504['id'],'fullname':_0x2fe504[_0x537f('0x34')]};});}}catch(_0x4a65c8){_0x5e6c24(_0x4a65c8);}_0x3aa159(_0x3909b4);});}function getInteractionTags(_0x2e15bc,_0x5aa721){return new BPromise(function(_0x1a5d50,_0x4bae2a){try{if(_0x2e15bc[_0x537f('0x35')]){_0x2e15bc[_0x537f('0x36')]=[];_0x2e15bc[_0x537f('0x35')][_0x537f('0x37')](',')[_0x537f('0x38')](function(_0x5c4899){_0x2e15bc[_0x537f('0x36')][_0x537f('0x39')](_0x5aa721[_0x5c4899]);});}delete _0x2e15bc[_0x537f('0x35')];}catch(_0x4ecf7a){_0x4bae2a(_0x4ecf7a);}_0x1a5d50(_0x2e15bc);});}function updateOpenchannelInteraction(_0x4b5f25,_0x47ee8c,_0xe5b1f9){return new BPromise(function(_0x2b4063,_0x244767){return getInteractionUsers(_0x4b5f25,_0xe5b1f9)[_0x537f('0x2e')](function(_0x4ebbbb){return getInteractionTags(_0x4ebbbb,_0x47ee8c);})[_0x537f('0x2e')](function(_0x3d9b24){_0x2b4063(_0x3d9b24);})[_0x537f('0x3a')](function(_0x16cb41){_0x244767(_0x16cb41);});});}exports[_0x537f('0x3b')]=function(_0x1c399d,_0x45fae8){var _0x1c4e0e={},_0x557e48={},_0x31f35b={'count':0x0,'rows':[]};var _0x21b5b1=_[_0x537f('0x33')](db[_0x537f('0x3c')]['rawAttributes'],function(_0x15e08b){return{'name':_0x15e08b['fieldName'],'type':_0x15e08b[_0x537f('0x3d')]['key']};});_0x557e48[_0x537f('0x3e')]=_[_0x537f('0x33')](_0x21b5b1,_0x537f('0x31'));_0x557e48[_0x537f('0x3f')]=_[_0x537f('0x40')](_0x1c399d['query']);_0x557e48[_0x537f('0x41')]=_[_0x537f('0x42')](_0x557e48[_0x537f('0x3e')],_0x557e48[_0x537f('0x3f')]);_0x1c4e0e[_0x537f('0x43')]=_['intersection'](_0x557e48['model'],qs['fields'](_0x1c399d[_0x537f('0x3f')][_0x537f('0x44')]));_0x1c4e0e['attributes']=_0x1c4e0e[_0x537f('0x43')][_0x537f('0x45')]?_0x1c4e0e[_0x537f('0x43')]:_0x557e48['model'];if(!_0x1c399d[_0x537f('0x3f')][_0x537f('0x46')]('nolimit')){_0x1c4e0e[_0x537f('0x25')]=qs[_0x537f('0x25')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x25')]);_0x1c4e0e[_0x537f('0x23')]=qs[_0x537f('0x23')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x23')]);}_0x1c4e0e['order']=qs[_0x537f('0x47')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x47')]);_0x1c4e0e[_0x537f('0x48')]=qs['filters'](_['pick'](_0x1c399d[_0x537f('0x3f')],_0x557e48[_0x537f('0x41')]),_0x21b5b1);var _0x68d9d8=[];var _0x16e102=squel[_0x537f('0x49')]()['field']('id')[_0x537f('0x4a')](_0x537f('0x31'))[_0x537f('0x4a')](_0x537f('0x4b'))['from']('tools_tags');var _0x1a5020=squel['select']()[_0x537f('0x4a')](_0x537f('0x4c'))[_0x537f('0x4a')]('u.fullname')[_0x537f('0x4a')](_0x537f('0x4d'))['from']('user_has_openchannel_interactions','ui')[_0x537f('0x4e')](_0x537f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x152f4f=squel['select']()[_0x537f('0x50')](_0x537f('0x51'),'i')['left_join'](_0x537f('0x52'),'c',_0x537f('0x53'))[_0x537f('0x4e')](_0x537f('0x4f'),'o',_0x537f('0x54'))[_0x537f('0x4e')](_0x537f('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x537f('0x4e')](_0x537f('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x537f('0x4e')](_0x537f('0x57'),'it',_0x537f('0x58'))[_0x537f('0x4e')](_0x537f('0x59'),'t',_0x537f('0x5a'));var _0x91746=squel[_0x537f('0x5b')]();var _0x439bc7=[];var _0x44c58a=squel[_0x537f('0x5b')]();var _0x8b75e4;if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x5c')]){_0x8b75e4=as[_0x537f('0x5d')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x5c')]);var _0x5db526=_0x8b75e4['sqlOperator'];for(var _0x17f331=0x0;_0x17f331<_0x8b75e4[_0x537f('0x5e')][_0x537f('0x45')];_0x17f331++){var _0x1c0671=_0x8b75e4[_0x537f('0x5e')][_0x17f331];var _0x5166cd='i';var _0x36c611=_[_0x537f('0x5f')](_0x21b5b1,[_0x537f('0x31'),_0x1c0671['field']]);if(!_0x36c611){switch(_0x1c0671[_0x537f('0x4a')]){case'unreadMessages':if(_0x1c0671[_0x537f('0x60')]==0x1){_0x152f4f[_0x537f('0x61')]('`'+_0x1c0671[_0x537f('0x4a')]+'`\x20=\x200');}else{_0x152f4f['having']('`'+_0x1c0671[_0x537f('0x4a')]+_0x537f('0x62'));}break;case _0x537f('0x63'):if(_0x1c0671[_0x537f('0x64')]===_0x537f('0x65')){if(_0x1c0671[_0x537f('0x60')]['split']('\x20')['length']>0x1){_0x91746[_0x5db526](_0x537f('0x66'),qs[_0x537f('0x67')](_0x1c0671[_0x537f('0x60')]),null);}else{var _0x5d95c5='%'+_0x1c0671['value']+'%';_0x91746[_0x5db526](_0x537f('0x68'),_0x5d95c5,_0x5d95c5,_0x5d95c5);}}else{_0x36c611=_['find'](_0x21b5b1,[_0x537f('0x31'),_0x537f('0x69')]);_0x1c0671[_0x537f('0x4a')]=_0x537f('0x69');_0x52ba6b=as[_0x537f('0x6a')](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b[_0x537f('0x60')]['start'],_0x52ba6b['value']['end']);}break;case _0x537f('0x6c'):var _0x2e4890=_0x1c0671[_0x537f('0x60')]['split'](',')[_0x537f('0x33')](function(_0xbdb82e){return Number(_0xbdb82e);});_0x2e4890[_0x537f('0x38')](function(_0x457b69){_0x44c58a['or'](_0x537f('0x6d'),'%,'+_0x457b69+',%');});_0x439bc7=_[_0x537f('0x6e')](_0x439bc7,_0x2e4890);break;case _0x537f('0x6f'):if(_0x1c0671[_0x537f('0x64')]==='$substring'){_0x91746[_0x5db526](_0x537f('0x70'),'%'+_0x1c0671[_0x537f('0x60')]+'%',null);}else{_0x36c611=_[_0x537f('0x5f')](_0x21b5b1,[_0x537f('0x31'),'UserId']);_0x1c0671[_0x537f('0x4a')]=_0x537f('0x71');_0x52ba6b=as['buildExpression'](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b['value']['start'],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);}break;case'body':_0x52ba6b=as[_0x537f('0x6a')]('me',null,_0x1c0671);_0x91746[_0x5db526](_0x52ba6b[_0x537f('0x6b')],_0x52ba6b[_0x537f('0x60')][_0x537f('0x72')],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);break;}}else{var _0x52ba6b=as[_0x537f('0x6a')](_0x5166cd,_0x36c611[_0x537f('0x3d')],_0x1c0671);_0x91746[_0x5db526](_0x52ba6b['text'],_0x52ba6b[_0x537f('0x60')]['start'],_0x52ba6b[_0x537f('0x60')][_0x537f('0x22')]);}}}else{var _0x2ac30b=_(_0x1c399d[_0x537f('0x3f')])['keys']()[_0x537f('0x33')](function(_0x321e92){return _['some'](_0x21b5b1,[_0x537f('0x31'),_0x321e92])?_0x321e92:undefined;})[_0x537f('0x73')]()[_0x537f('0x60')]();if(!_['isEmpty'](_0x2ac30b)){_0x2ac30b[_0x537f('0x38')](function(_0x4a19e1){if(_0x4a19e1===_0x537f('0x74')){_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x1c399d[_0x537f('0x3f')][_0x4a19e1]));}else if(_0x4a19e1===_0x537f('0x75')){var _0x143566=JSON['parse'](_0x1c399d[_0x537f('0x3f')][_0x4a19e1])['$gte'];var _0x32e599=JSON['parse'](_0x1c399d['query'][_0x4a19e1])['$lte'];_0x152f4f[_0x537f('0x48')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x143566,_0x32e599);}else{if(_0x1c399d[_0x537f('0x3f')][_0x4a19e1]===_0x537f('0x76')){_0x152f4f[_0x537f('0x48')]('i.'+_0x4a19e1+_0x537f('0x77'));}else{_0x152f4f['where']('i.'+_0x4a19e1+_0x537f('0x78'),_0x1c399d['query'][_0x4a19e1]);}}});}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x79')]){if(_0x1c399d[_0x537f('0x3f')]['read']==0x1){_0x152f4f['having'](_0x537f('0x7a'));}else{_0x152f4f['having'](_0x537f('0x7b'));}}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')]){_0x439bc7=_[_0x537f('0x7d')](_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')])?_0x1c399d[_0x537f('0x3f')][_0x537f('0x7c')]:new Array(_0x1c399d[_0x537f('0x3f')]['tag']);_0x439bc7[_0x537f('0x38')](function(_0x3ca4de){_0x44c58a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3ca4de+',%');});}if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x7e')]){var _0xca8990=_0x1c399d['query'][_0x537f('0x7e')][_0x537f('0x7f')]('\x5c','\x5c\x5c')[_0x537f('0x7f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xca8990)){_0x91746['or'](_0x537f('0x80'),_0xca8990+'%');}else{_0x91746['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x537f('0x67')](_0xca8990))['or']('i.from\x20LIKE\x20?',_0xca8990+'%')['or'](_0x537f('0x81'),_0xca8990+'%');}}}_0x152f4f[_0x537f('0x48')](_0x91746);_0x152f4f[_0x537f('0x82')](_0x537f('0x83'));var _0x22db33={'type':db[_0x537f('0x84')]['QueryTypes'][_0x537f('0x85')],'raw':!![]};var _0x546892=_0x152f4f['clone']();_0x546892[_0x537f('0x4a')](_0x537f('0x83'));_0x546892['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1c4e0e[_0x537f('0x86')]){_0x1c4e0e[_0x537f('0x86')][_0x537f('0x38')](function(_0x30f8ec){var _0x3cd24a=_0x30f8ec[0x0]==='contactName'?_0x30f8ec[0x0]:'i.'+_0x30f8ec[0x0];_0x152f4f['order'](_0x3cd24a,_0x30f8ec[0x1]==='DESC'?![]:!![]);});}if(!_[_0x537f('0x87')](_0x439bc7)){_0x152f4f['having'](_0x44c58a);_0x546892[_0x537f('0x48')](_0x537f('0x88'),_0x439bc7);}BPromise[_0x537f('0x89')]()[_0x537f('0x2e')](function(){if(!_0x8b75e4){if(_0x1c399d[_0x537f('0x3f')]['OpenchannelAccountId'])return;_0x546892['where'](_0x537f('0x8a'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1c399d[_0x537f('0x8b')]['role']!==_0x537f('0x8c'))return;return _0x1c399d[_0x537f('0x8b')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x540e71){if(_[_0x537f('0x87')](_0x540e71)){_0x546892['where'](_0x537f('0x8d'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x546892[_0x537f('0x48')](_0x537f('0x8e'),_[_0x537f('0x33')](_0x540e71,'id'));_0x152f4f[_0x537f('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x537f('0x33')](_0x540e71,'id'));}});})[_0x537f('0x2e')](function(){if(_0x1c399d[_0x537f('0x8b')]['role']===_0x537f('0x8c')&&!_0x8b75e4&&!_0x1c399d[_0x537f('0x3f')][_0x537f('0x74')])return[];return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x546892[_0x537f('0x90')](),_0x22db33);})[_0x537f('0x2e')](function(_0x58286b){_0x31f35b[_0x537f('0x26')]=_0x58286b[_0x537f('0x45')];if(_0x31f35b[_0x537f('0x26')]===0x0)return[];return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x16e102[_0x537f('0x90')](),_0x22db33)[_0x537f('0x2e')](function(_0x2f54ec){_0x68d9d8=_[_0x537f('0x91')](_0x2f54ec,'id');_0x22db33=_['merge'](_0x22db33,{'model':db[_0x537f('0x3c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1c399d[_0x537f('0x3f')][_0x537f('0x44')]){_0x1c4e0e['attributes'][_0x537f('0x38')](function(_0x113a0e){_0x152f4f['field']('i.'+_0x113a0e);});}else{_0x152f4f['field'](_0x537f('0x92'),_0x537f('0x93'));_0x152f4f['field'](_0x537f('0x94'),_0x537f('0x95'));_0x152f4f[_0x537f('0x4a')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x152f4f['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','contactName');_0x152f4f['field'](_0x537f('0x96'));_0x152f4f[_0x537f('0x4a')](_0x537f('0x97'),_0x537f('0x98'));_0x152f4f[_0x537f('0x4a')](_0x537f('0x99'),_0x537f('0x9a'));_0x152f4f['field'](_0x537f('0x9b'),'Contact.email');_0x152f4f['field'](_0x537f('0x9c'),'Contact.phone');_0x152f4f[_0x537f('0x4a')](_0x537f('0x9d'),_0x537f('0x9e'));_0x152f4f[_0x537f('0x4a')]('c.fax',_0x537f('0x9f'));_0x152f4f['field'](_0x537f('0xa0'),_0x537f('0xa1'));_0x152f4f[_0x537f('0x4a')](_0x537f('0xa2'),_0x537f('0xa3'));_0x152f4f[_0x537f('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x537f('0x35'));}if(_0x1c4e0e['limit'])_0x152f4f[_0x537f('0x25')](_0x1c4e0e[_0x537f('0x25')]);if(_0x1c4e0e[_0x537f('0x23')])_0x152f4f['offset'](_0x1c4e0e[_0x537f('0x23')]);return db[_0x537f('0x8f')][_0x537f('0x3f')](_0x152f4f[_0x537f('0x90')](),_0x22db33);})[_0x537f('0x2e')](function(_0x253400){if(_0x253400[_0x537f('0x45')]>0x0)_0x1a5020['where'](_0x537f('0xa4'),_[_0x537f('0x33')](_0x253400,'id'));return db['sequelize'][_0x537f('0x3f')](_0x1a5020[_0x537f('0x90')](),_0x22db33)['then'](function(_0x1c4ad9){var _0x3668dc=_[_0x537f('0xa5')](_0x1c4ad9,_0x537f('0xa6'));var _0x414563=[];_0x253400['forEach'](function(_0x2bd662){_0x414563[_0x537f('0x39')](updateOpenchannelInteraction(_0x2bd662,_0x68d9d8,_0x3668dc));});return BPromise[_0x537f('0xa7')](_0x414563);});});})[_0x537f('0x2e')](function(_0x579cc0){_0x31f35b[_0x537f('0xa8')]=_0x579cc0;return _0x31f35b;})[_0x537f('0x2e')](respondWithFilteredResult(_0x45fae8,_0x1c4e0e))[_0x537f('0x3a')](handleError(_0x45fae8,null));};exports[_0x537f('0xa9')]=function(_0x53a34a,_0x108afc){var _0x4e17c6={};if(_0x53a34a[_0x537f('0x3f')]['type']&&_0x53a34a[_0x537f('0x3f')]['type']===_0x537f('0x50')){_0x4e17c6[_0x537f('0x50')]=_0x53a34a[_0x537f('0xaa')]['id'];}else{_0x4e17c6['id']=_0x53a34a[_0x537f('0xaa')]['id'];}var _0x10013b={'raw':![],'where':_0x4e17c6},_0xf398bb={};_0xf398bb[_0x537f('0x3e')]=_[_0x537f('0x40')](db[_0x537f('0x3c')]['rawAttributes']);_0xf398bb[_0x537f('0x3f')]=_['keys'](_0x53a34a[_0x537f('0x3f')]);_0xf398bb[_0x537f('0x41')]=_[_0x537f('0x42')](_0xf398bb[_0x537f('0x3e')],_0xf398bb[_0x537f('0x3f')]);_0x10013b[_0x537f('0x43')]=_[_0x537f('0x42')](_0xf398bb['model'],qs['fields'](_0x53a34a[_0x537f('0x3f')][_0x537f('0x44')]));_0x10013b['attributes']=_0x10013b[_0x537f('0x43')][_0x537f('0x45')]?_0x10013b[_0x537f('0x43')]:_0xf398bb[_0x537f('0x3e')];if(_0x53a34a[_0x537f('0x3f')][_0x537f('0xab')]){_0x10013b[_0x537f('0xac')]=[{'all':!![]}];}_0x10013b=_['merge']({},_0x10013b,_0x53a34a[_0x537f('0xad')]);return db[_0x537f('0x3c')][_0x537f('0x5f')](_0x10013b)[_0x537f('0x2e')](handleEntityNotFound(_0x108afc,null))[_0x537f('0x2e')](respondWithResult(_0x108afc,null))[_0x537f('0x3a')](handleError(_0x108afc,null));};exports[_0x537f('0xae')]=function(_0x48c2ac,_0xc30485){return db[_0x537f('0x3c')][_0x537f('0xae')](_0x48c2ac[_0x537f('0xaf')],{})['then'](respondWithResult(_0xc30485,0xc9))[_0x537f('0x3a')](handleError(_0xc30485,null));};exports[_0x537f('0x2c')]=function(_0x4ff04c,_0x39e4a0){if(_0x4ff04c[_0x537f('0xaf')]['id']){delete _0x4ff04c[_0x537f('0xaf')]['id'];}return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x4ff04c[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x39e4a0,null))[_0x537f('0x2e')](saveUpdates(_0x4ff04c['body'],null))['then'](respondWithResult(_0x39e4a0,null))['catch'](handleError(_0x39e4a0,null));};exports['destroy']=function(_0x236590,_0x35e59b){return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x236590[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x35e59b,null))[_0x537f('0x2e')](removeEntity(_0x35e59b,null))[_0x537f('0x3a')](handleError(_0x35e59b,null));};exports[_0x537f('0xb0')]=function(_0x44419f,_0x5a3e07){return db[_0x537f('0x3c')]['describe']()[_0x537f('0x2e')](respondWithResult(_0x5a3e07,null))[_0x537f('0x3a')](handleError(_0x5a3e07,null));};exports[_0x537f('0xb1')]=function(_0x52ebfa,_0x7fecb6,_0x191432){return db[_0x537f('0xb2')][_0x537f('0x5f')]({'where':{'id':_0x52ebfa[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x7fecb6,null))[_0x537f('0x2e')](function(_0x44a679){if(_0x44a679){return _0x44a679['addMessage'](_0x52ebfa[_0x537f('0xaf')]['ids'],_['omit'](_0x52ebfa[_0x537f('0xaf')],['ids','id'])||{});}})[_0x537f('0x2e')](respondWithResult(_0x7fecb6,null))[_0x537f('0x3a')](handleError(_0x7fecb6,null));};exports['getMessages']=function(_0x21d2fc,_0xeb349b,_0x202f01){var _0x22bc0d={'raw':![],'where':{}};var _0x409496={};var _0x5189e1={'count':0x0,'rows':[]};return db[_0x537f('0x3c')][_0x537f('0xb3')]({'where':{'id':_0x21d2fc['params']['id']}})['then'](handleEntityNotFound(_0xeb349b,null))['then'](function(_0x585c3f){if(_0x585c3f){_0x409496[_0x537f('0x3e')]=_[_0x537f('0x40')](db['OpenchannelMessage']['rawAttributes']);_0x409496['query']=_[_0x537f('0x40')](_0x21d2fc[_0x537f('0x3f')]);_0x409496['filters']=_['intersection'](_0x409496[_0x537f('0x3e')],_0x409496['query']);_0x22bc0d['attributes']=_[_0x537f('0x42')](_0x409496['model'],qs[_0x537f('0x44')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x44')]));_0x22bc0d['attributes']=_0x22bc0d[_0x537f('0x43')]['length']?_0x22bc0d[_0x537f('0x43')]:_0x409496['model'];if(!_0x21d2fc[_0x537f('0x3f')][_0x537f('0x46')](_0x537f('0xb4'))){_0x22bc0d[_0x537f('0x25')]=qs[_0x537f('0x25')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x25')]);_0x22bc0d[_0x537f('0x23')]=qs[_0x537f('0x23')](_0x21d2fc[_0x537f('0x3f')][_0x537f('0x23')]);}_0x22bc0d[_0x537f('0x86')]=qs[_0x537f('0x47')](_0x21d2fc[_0x537f('0x3f')]['sort']);_0x22bc0d['where']=qs[_0x537f('0x41')](_[_0x537f('0xb5')](_0x21d2fc[_0x537f('0x3f')],_0x409496[_0x537f('0x41')]));_0x22bc0d['where'][_0x537f('0xa6')]=_0x585c3f['id'];if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0x7e')]){_0x22bc0d['where']=_[_0x537f('0xb6')](_0x22bc0d[_0x537f('0x48')],{'$or':_[_0x537f('0x33')](_0x22bc0d[_0x537f('0x43')],function(_0x559209){var _0xd484e9={};_0xd484e9[_0x559209]={'$like':'%'+_0x21d2fc[_0x537f('0x3f')][_0x537f('0x7e')]+'%'};return _0xd484e9;})});}if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0xb7')]){var _0x56ca3c=_0x21d2fc[_0x537f('0x3f')][_0x537f('0xb7')][_0x537f('0x37')](',');var _0x3aa6bc={};_0x3aa6bc[_0x56ca3c[0x0]]={'$gte':moment(_0x56ca3c[0x1])[_0x537f('0xb8')](_0x537f('0xb9'))};_0x22bc0d['where']=_[_0x537f('0xb6')](_0x22bc0d[_0x537f('0x48')],_0x3aa6bc);}_0x22bc0d=_['merge']({},_0x22bc0d,_0x21d2fc[_0x537f('0xad')]);return db['OpenchannelMessage'][_0x537f('0x26')]({'where':_0x22bc0d[_0x537f('0x48')]})[_0x537f('0x2e')](function(_0x10c39e){_0x5189e1[_0x537f('0x26')]=_0x10c39e;if(_0x21d2fc[_0x537f('0x3f')][_0x537f('0xab')]){_0x22bc0d[_0x537f('0xac')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x537f('0xba')](_0x22bc0d);})[_0x537f('0x2e')](function(_0x2710f2){_0x5189e1[_0x537f('0xa8')]=_0x2710f2;return _0x5189e1;});}})[_0x537f('0x2e')](respondWithFilteredResult(_0xeb349b,_0x22bc0d))[_0x537f('0x3a')](handleError(_0xeb349b,null));};exports[_0x537f('0xbb')]=function(_0x2c2966,_0x1a2369,_0x25e99c){return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0x2c2966[_0x537f('0xaa')]['id']}})[_0x537f('0x2e')](handleEntityNotFound(_0x1a2369,null))['then'](function(_0x33692a){if(_0x33692a){return _0x33692a[_0x537f('0xbc')](_0x2c2966[_0x537f('0xaf')][_0x537f('0xbd')],_[_0x537f('0xbe')](_0x2c2966[_0x537f('0xaf')],[_0x537f('0xbd'),'id'])||{})[_0x537f('0xbf')](function(){return db[_0x537f('0x6c')][_0x537f('0xba')]({'attributes':['id',_0x537f('0x31'),'color'],'where':{'id':_0x2c2966[_0x537f('0xaf')][_0x537f('0xbd')]}});})[_0x537f('0x2e')](function(_0x333258){socket['emit'](_0x537f('0xc0'),{'id':Number(_0x2c2966[_0x537f('0xaa')]['id']),'tags':_0x333258||[]});return{'id':Number(_0x2c2966[_0x537f('0xaa')]['id']),'tags':_0x333258||[]};});}})[_0x537f('0x2e')](respondWithResult(_0x1a2369,null))[_0x537f('0x3a')](handleError(_0x1a2369,null));};exports[_0x537f('0xc1')]=function(_0x573bd7,_0x512bbf,_0x3681d2){return db[_0x537f('0x3c')]['find']({'where':{'id':_0x573bd7[_0x537f('0xaa')]['id']}})['then'](handleEntityNotFound(_0x512bbf,null))[_0x537f('0x2e')](function(_0x40d087){if(_0x40d087){return _0x40d087['removeTags'](_0x573bd7[_0x537f('0x3f')][_0x537f('0xbd')]);}})[_0x537f('0x2e')](respondWithStatusCode(_0x512bbf,null))[_0x537f('0x3a')](handleError(_0x512bbf,null));};exports[_0x537f('0xc2')]=function(_0xcec428,_0xd952d0){var _0x57b329=moment()['unix']()[_0x537f('0x90')]();var _0x7f843a=path[_0x537f('0xc3')](config[_0x537f('0xc4')],'server',_0x537f('0xc5'),_0x537f('0xc6'));var _0x767b60=path[_0x537f('0xc3')](config[_0x537f('0xc4')],_0x537f('0xc7'),'files',_0x537f('0xc8'));var _0x3842cf=path[_0x537f('0xc3')](_0x7f843a,_0x57b329);var _0x4dc2b8=util[_0x537f('0xb8')](_0x537f('0xc9'),_0xcec428['params']['id'],_0x57b329);var _0x2643eb=path[_0x537f('0xc3')](_0x7f843a,_0x4dc2b8);var _0x5d17e0=[];_0x5d17e0['push']({'model':db[_0x537f('0x6f')],'as':_0x537f('0x6f'),'attributes':['id',_0x537f('0x34')],'raw':!![]});_0x5d17e0[_0x537f('0x39')]({'model':db[_0x537f('0xca')],'as':_0x537f('0x63'),'attributes':['id',_0x537f('0xcb'),_0x537f('0xcc')],'raw':!![]});if(_0xcec428[_0x537f('0x3f')]['attachments']){_0x5d17e0[_0x537f('0x39')]({'model':db['Attachment'],'as':_0x537f('0xcd'),'raw':!![]});}var _0x1a4e93=[{'model':db[_0x537f('0xb2')],'as':_0x537f('0xce'),'attributes':['id',_0x537f('0xaf'),_0x537f('0x75'),_0x537f('0xcf'),_0x537f('0xd0'),'read'],'include':_0x5d17e0}];_0x1a4e93['push']({'model':db[_0x537f('0xd1')],'as':'Account','attributes':['id',_0x537f('0x31')]});_0x1a4e93[_0x537f('0x39')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x537f('0x3c')][_0x537f('0x5f')]({'where':{'id':_0xcec428[_0x537f('0xaa')]['id']},'include':_0x1a4e93})[_0x537f('0x2e')](handleEntityNotFound(_0xd952d0,null))[_0x537f('0x2e')](function(_0x9afe9e){if(_0x9afe9e){var _0x41d732=_0x9afe9e[_0x537f('0xd2')]({'plain':!![]});fs[_0x537f('0xd3')](_0x3842cf);var _0x52a2d4={'channel':_0x537f('0xd4'),'account':_0x41d732[_0x537f('0xd5')]['name'],'agent':_0x41d732[_0x537f('0xd6')]?_0x41d732[_0x537f('0xd6')][_0x537f('0x34')]:_0x537f('0xd7'),'createdAt':moment(_0x41d732['createdAt'])[_0x537f('0xb8')](_0x537f('0xb9'))[_0x537f('0x90')](),'closedAt':_0x41d732['closed']?moment(_0x41d732[_0x537f('0xd8')])[_0x537f('0xb8')](_0x537f('0xb9'))[_0x537f('0x90')]():'','disposition':_0x41d732[_0x537f('0xd9')],'visibility':_0x41d732[_0x537f('0xda')]?_0x537f('0xdb'):_0x537f('0xdc'),'messages':_(_0x41d732[_0x537f('0xce')])[_0x537f('0x7e')]({'secret':![]})[_0x537f('0x33')](function(_0x13b42d){if(_0x13b42d[_0x537f('0xcd')]){var _0x3bd7fa=path[_0x537f('0xc3')](_0x767b60,_0x13b42d[_0x537f('0xcd')][_0x537f('0xdd')]);if(fs[_0x537f('0xde')](_0x3bd7fa)){fs['createReadStream'](_0x3bd7fa)[_0x537f('0xdf')](fs[_0x537f('0xe0')](path[_0x537f('0xc3')](_0x3842cf,_0x13b42d[_0x537f('0xcd')]['basename'])));}}return{'date':moment(_0x13b42d[_0x537f('0x75')])[_0x537f('0xb8')](_0x537f('0xb9'))['toString'](),'sender':_0x13b42d[_0x537f('0xcf')]===_0x537f('0xe1')?_0x13b42d['User']?_0x13b42d[_0x537f('0x6f')][_0x537f('0x34')]:_0x537f('0xe2'):_0x13b42d[_0x537f('0x63')][_0x537f('0xcb')]+(_0x13b42d[_0x537f('0x63')]['lastName']?'\x20'+_0x13b42d['Contact'][_0x537f('0xcc')]:''),'body':_0x13b42d[_0x537f('0xcd')]?_0x13b42d[_0x537f('0xcd')][_0x537f('0xdd')]:_0x13b42d[_0x537f('0xaf')],'direction':_0x13b42d[_0x537f('0xcf')]===_0x537f('0xe1')?'A':'C','secret':_0x13b42d[_0x537f('0xd0')],'read':_0x13b42d[_0x537f('0x79')],'attachment':_0x13b42d[_0x537f('0xcd')]};})[_0x537f('0x60')]()};return ejs[_0x537f('0xe3')](path[_0x537f('0xc3')](config['root'],_0x537f('0xc7'),_0x537f('0xe4'),_0x537f('0xe5')),{'interaction':_0x52a2d4})[_0x537f('0x2e')](function(_0x51b806){var _0x422e4a=path[_0x537f('0xc3')](_0x3842cf,_0x537f('0xe6')+_0x41d732['id']+'-'+_0x57b329+_0x537f('0xe7'));var _0x3d9339={'path':_0x422e4a,'channel':_0x537f('0xd4'),'interactionId':_0x41d732['id']};return pdf['createPdfFromHTML'](_0x51b806,_0x3d9339);})['then'](function(){return new BPromise(function(_0x2d9202,_0x5b6dd2){zipdir(_0x3842cf,{'saveTo':_0x2643eb},function(_0x47ecb5,_0x58f616){if(_0x47ecb5)return _0x5b6dd2(_0x47ecb5);return _0x2d9202(_0x58f616);});})['then'](function(){return new BPromise(function(_0x2b12bc,_0x44c7e6){rimraf(_0x3842cf,function(_0x2e19a6){if(_0x2e19a6)_0x44c7e6(_0x2e19a6);return _0x2b12bc();});});})[_0x537f('0x2e')](function(){return _0xd952d0[_0x537f('0xc2')](_0x2643eb,_0x4dc2b8,function(_0x46a037){if(_0x46a037){console[_0x537f('0xe8')](_0x537f('0xe9'),_0x46a037);}else{fs['unlinkSync'](_0x2643eb);}});});});}else{return _0xd952d0['sendStatus'](0xc8);}})[_0x537f('0x3a')](handleError(_0xd952d0,null));};
\ No newline at end of file
+var _0x3888=['addTags','omit','emit','openchannelInteractionTags:save','unix','root','files','tmp','server','attachments','join','lastName','Attachment','Messages','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','closed','basename','createReadStream','pipe','createWriteStream','out','System','firstName','direction','renderFile','views','transcript-','Openchannel','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','fullname','forEach','push','TagIds','catch','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','field','color','tools_tags','select','u.id','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','split','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','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','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','count','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','toString','all','rows','show','params','OpenchannelInteraction','includeAll','include','options','create','describe','addMessage','ids','getMessages','OpenchannelMessage','hasOwnProperty','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x469c6d,_0x4de8c5){var _0x5befe5=function(_0x3b8bed){while(--_0x3b8bed){_0x469c6d['push'](_0x469c6d['shift']());}};_0x5befe5(++_0x4de8c5);}(_0x3888,0x1ed));var _0x8388=function(_0x33fa0a,_0x4f9bf1){_0x33fa0a=_0x33fa0a-0x0;var _0x4d5308=_0x3888[_0x33fa0a];return _0x4d5308;};'use strict';var emlformat=require(_0x8388('0x0'));var rimraf=require(_0x8388('0x1'));var zipdir=require(_0x8388('0x2'));var jsonpatch=require(_0x8388('0x3'));var rp=require(_0x8388('0x4'));var moment=require(_0x8388('0x5'));var BPromise=require(_0x8388('0x6'));var Mustache=require('mustache');var util=require(_0x8388('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8388('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8388('0x9'));var _=require(_0x8388('0xa'));var squel=require(_0x8388('0xb'));var crypto=require(_0x8388('0xc'));var jsforce=require(_0x8388('0xd'));var deskjs=require(_0x8388('0xe'));var toCsv=require(_0x8388('0x8'));var querystring=require(_0x8388('0xf'));var Papa=require(_0x8388('0x10'));var Redis=require(_0x8388('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8388('0x12'));var as=require(_0x8388('0x13'));var pdf=require(_0x8388('0x14'));var hardwareService=require(_0x8388('0x15'));var logger=require(_0x8388('0x16'))(_0x8388('0x17'));var utils=require(_0x8388('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8388('0x19'));var db=require('../../mysqldb')['db'];config[_0x8388('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8388('0x1b'))(new Redis(config[_0x8388('0x1a')]));require(_0x8388('0x1c'))[_0x8388('0x1d')](socket);function respondWithStatusCode(_0x468636,_0x491119){_0x491119=_0x491119||0xcc;return function(_0x449f0c){if(_0x449f0c){return _0x468636[_0x8388('0x1e')](_0x491119);}return _0x468636[_0x8388('0x1f')](_0x491119)[_0x8388('0x20')]();};}function respondWithResult(_0xe694ce,_0x26eda4){_0x26eda4=_0x26eda4||0xc8;return function(_0x65c6d6){if(_0x65c6d6){return _0xe694ce[_0x8388('0x1f')](_0x26eda4)['json'](_0x65c6d6);}};}function respondWithFilteredResult(_0x389a69,_0x815fbe){return function(_0x40bf95){if(_0x40bf95){var _0x4e5d72=typeof _0x815fbe[_0x8388('0x21')]===_0x8388('0x22')&&typeof _0x815fbe[_0x8388('0x23')]==='undefined';var _0x2fc74d=_0x40bf95['count'];var _0x3250b3=_0x4e5d72?0x0:_0x815fbe['offset'];var _0x30ec36=_0x4e5d72?_0x40bf95['count']:_0x815fbe[_0x8388('0x21')]+_0x815fbe[_0x8388('0x23')];var _0x1e7261;if(_0x30ec36>=_0x2fc74d){_0x30ec36=_0x2fc74d;_0x1e7261=0xc8;}else{_0x1e7261=0xce;}_0x389a69[_0x8388('0x1f')](_0x1e7261);return _0x389a69[_0x8388('0x24')](_0x8388('0x25'),_0x3250b3+'-'+_0x30ec36+'/'+_0x2fc74d)['json'](_0x40bf95);}return null;};}function patchUpdates(_0x357d60){return function(_0x53b771){try{jsonpatch[_0x8388('0x26')](_0x53b771,_0x357d60,!![]);}catch(_0x47fb5e){return BPromise[_0x8388('0x27')](_0x47fb5e);}return _0x53b771['save']();};}function saveUpdates(_0x182e86,_0x37681e){return function(_0x1d69e8){if(_0x1d69e8){return _0x1d69e8[_0x8388('0x28')](_0x182e86)[_0x8388('0x29')](function(_0x448e04){return _0x448e04;});}return null;};}function removeEntity(_0x5e3200,_0x4861f6){return function(_0x206484){if(_0x206484){return _0x206484[_0x8388('0x2a')]()[_0x8388('0x29')](function(){_0x5e3200[_0x8388('0x1f')](0xcc)[_0x8388('0x20')]();});}};}function handleEntityNotFound(_0x39e72f,_0x2bb04d){return function(_0x44c6e6){if(!_0x44c6e6){_0x39e72f[_0x8388('0x1e')](0x194);}return _0x44c6e6;};}function handleError(_0xd37888,_0x404414){_0x404414=_0x404414||0x1f4;return function(_0x36ab9a){logger[_0x8388('0x2b')](_0x36ab9a[_0x8388('0x2c')]);if(_0x36ab9a[_0x8388('0x2d')]){delete _0x36ab9a[_0x8388('0x2d')];}_0xd37888['status'](_0x404414)['send'](_0x36ab9a);};}function getInteractionUsers(_0x4043d0,_0x35c5ac){return new BPromise(function(_0x22b141,_0x1e1574){try{if(_0x35c5ac[_0x4043d0['id']]){_0x4043d0['Users']=_[_0x8388('0x2e')](_0x35c5ac[_0x4043d0['id']],function(_0x4be11e){return{'id':_0x4be11e['id'],'fullname':_0x4be11e[_0x8388('0x2f')]};});}}catch(_0xde2561){_0x1e1574(_0xde2561);}_0x22b141(_0x4043d0);});}function getInteractionTags(_0xefa68b,_0x2c10ac){return new BPromise(function(_0xc0bc8c,_0x3ab387){try{if(_0xefa68b['TagIds']){_0xefa68b['Tags']=[];_0xefa68b['TagIds']['split'](',')[_0x8388('0x30')](function(_0x44435e){_0xefa68b['Tags'][_0x8388('0x31')](_0x2c10ac[_0x44435e]);});}delete _0xefa68b[_0x8388('0x32')];}catch(_0x5d34c3){_0x3ab387(_0x5d34c3);}_0xc0bc8c(_0xefa68b);});}function updateOpenchannelInteraction(_0x26635e,_0x326559,_0x50d7e3){return new BPromise(function(_0x1cf9fc,_0x2c46fd){return getInteractionUsers(_0x26635e,_0x50d7e3)['then'](function(_0x48b534){return getInteractionTags(_0x48b534,_0x326559);})[_0x8388('0x29')](function(_0x18833d){_0x1cf9fc(_0x18833d);})[_0x8388('0x33')](function(_0x5effef){_0x2c46fd(_0x5effef);});});}exports['index']=function(_0x44fcef,_0x10d81c){var _0x5e5dec={},_0x129fff={},_0xe2bd8b={'count':0x0,'rows':[]};var _0x9fce08=_['map'](db['OpenchannelInteraction'][_0x8388('0x34')],function(_0x3f0ac0){return{'name':_0x3f0ac0[_0x8388('0x35')],'type':_0x3f0ac0['type'][_0x8388('0x36')]};});_0x129fff[_0x8388('0x37')]=_[_0x8388('0x2e')](_0x9fce08,_0x8388('0x2d'));_0x129fff[_0x8388('0x38')]=_[_0x8388('0x39')](_0x44fcef[_0x8388('0x38')]);_0x129fff[_0x8388('0x3a')]=_[_0x8388('0x3b')](_0x129fff['model'],_0x129fff[_0x8388('0x38')]);_0x5e5dec[_0x8388('0x3c')]=_[_0x8388('0x3b')](_0x129fff['model'],qs[_0x8388('0x3d')](_0x44fcef[_0x8388('0x38')][_0x8388('0x3d')]));_0x5e5dec[_0x8388('0x3c')]=_0x5e5dec['attributes'][_0x8388('0x3e')]?_0x5e5dec[_0x8388('0x3c')]:_0x129fff[_0x8388('0x37')];if(!_0x44fcef[_0x8388('0x38')]['hasOwnProperty'](_0x8388('0x3f'))){_0x5e5dec[_0x8388('0x23')]=qs['limit'](_0x44fcef[_0x8388('0x38')][_0x8388('0x23')]);_0x5e5dec[_0x8388('0x21')]=qs[_0x8388('0x21')](_0x44fcef[_0x8388('0x38')]['offset']);}_0x5e5dec['order']=qs[_0x8388('0x40')](_0x44fcef[_0x8388('0x38')][_0x8388('0x40')]);_0x5e5dec[_0x8388('0x41')]=qs[_0x8388('0x3a')](_[_0x8388('0x42')](_0x44fcef['query'],_0x129fff[_0x8388('0x3a')]),_0x9fce08);var _0x46a3c9=[];var _0x3b26d9=squel['select']()[_0x8388('0x43')]('id')[_0x8388('0x43')](_0x8388('0x2d'))[_0x8388('0x43')](_0x8388('0x44'))['from'](_0x8388('0x45'));var _0xf11e37=squel[_0x8388('0x46')]()[_0x8388('0x43')](_0x8388('0x47'))[_0x8388('0x43')]('u.fullname')[_0x8388('0x43')]('ui.OpenchannelInteractionId')[_0x8388('0x48')](_0x8388('0x49'),'ui')[_0x8388('0x4a')](_0x8388('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x187da9=squel[_0x8388('0x46')]()['from'](_0x8388('0x4c'),'i')[_0x8388('0x4a')](_0x8388('0x4d'),'c',_0x8388('0x4e'))['left_join']('users','o',_0x8388('0x4f'))[_0x8388('0x4a')](_0x8388('0x50'),'a',_0x8388('0x51'))[_0x8388('0x4a')]('openchannel_messages','me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x8388('0x4a')](_0x8388('0x52'),'it',_0x8388('0x53'))['left_join'](_0x8388('0x45'),'t',_0x8388('0x54'));var _0x21a357=squel[_0x8388('0x55')]();var _0x15e271=[];var _0x444c51=squel[_0x8388('0x55')]();var _0xa7157d;if(_0x44fcef[_0x8388('0x38')][_0x8388('0x56')]){_0xa7157d=as[_0x8388('0x57')](_0x44fcef[_0x8388('0x38')][_0x8388('0x56')]);var _0x3f92cf=_0xa7157d[_0x8388('0x58')];for(var _0x462528=0x0;_0x462528<_0xa7157d[_0x8388('0x59')][_0x8388('0x3e')];_0x462528++){var _0x4dd25b=_0xa7157d['conditions'][_0x462528];var _0x23f4df='i';var _0x399785=_[_0x8388('0x5a')](_0x9fce08,[_0x8388('0x2d'),_0x4dd25b['field']]);if(!_0x399785){switch(_0x4dd25b[_0x8388('0x43')]){case _0x8388('0x5b'):if(_0x4dd25b[_0x8388('0x5c')]==0x1){_0x187da9[_0x8388('0x5d')]('`'+_0x4dd25b[_0x8388('0x43')]+'`\x20=\x200');}else{_0x187da9['having']('`'+_0x4dd25b['field']+_0x8388('0x5e'));}break;case _0x8388('0x5f'):if(_0x4dd25b[_0x8388('0x60')]==='$substring'){if(_0x4dd25b[_0x8388('0x5c')]['split']('\x20')[_0x8388('0x3e')]>0x1){_0x21a357[_0x3f92cf](_0x8388('0x61'),qs[_0x8388('0x62')](_0x4dd25b[_0x8388('0x5c')]),null);}else{var _0x55d9b0='%'+_0x4dd25b[_0x8388('0x5c')]+'%';_0x21a357[_0x3f92cf](_0x8388('0x63'),_0x55d9b0,_0x55d9b0,_0x55d9b0);}}else{_0x399785=_[_0x8388('0x5a')](_0x9fce08,[_0x8388('0x2d'),_0x8388('0x64')]);_0x4dd25b[_0x8388('0x43')]=_0x8388('0x64');_0x2ee399=as[_0x8388('0x65')](_0x23f4df,_0x399785['type'],_0x4dd25b);_0x21a357[_0x3f92cf](_0x2ee399[_0x8388('0x66')],_0x2ee399['value'][_0x8388('0x67')],_0x2ee399[_0x8388('0x5c')][_0x8388('0x20')]);}break;case _0x8388('0x68'):var _0x59fefe=_0x4dd25b[_0x8388('0x5c')][_0x8388('0x69')](',')[_0x8388('0x2e')](function(_0x40201c){return Number(_0x40201c);});_0x59fefe[_0x8388('0x30')](function(_0x39fd){_0x444c51['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x39fd+',%');});_0x15e271=_[_0x8388('0x6a')](_0x15e271,_0x59fefe);break;case _0x8388('0x6b'):if(_0x4dd25b['operator']===_0x8388('0x6c')){_0x21a357[_0x3f92cf](_0x8388('0x6d'),'%'+_0x4dd25b['value']+'%',null);}else{_0x399785=_[_0x8388('0x5a')](_0x9fce08,[_0x8388('0x2d'),_0x8388('0x6e')]);_0x4dd25b[_0x8388('0x43')]=_0x8388('0x6e');_0x2ee399=as[_0x8388('0x65')](_0x23f4df,_0x399785[_0x8388('0x6f')],_0x4dd25b);_0x21a357[_0x3f92cf](_0x2ee399['text'],_0x2ee399[_0x8388('0x5c')][_0x8388('0x67')],_0x2ee399['value'][_0x8388('0x20')]);}break;case _0x8388('0x70'):_0x2ee399=as[_0x8388('0x65')]('me',null,_0x4dd25b);_0x21a357[_0x3f92cf](_0x2ee399[_0x8388('0x66')],_0x2ee399[_0x8388('0x5c')][_0x8388('0x67')],_0x2ee399['value'][_0x8388('0x20')]);break;}}else{var _0x2ee399=as[_0x8388('0x65')](_0x23f4df,_0x399785['type'],_0x4dd25b);_0x21a357[_0x3f92cf](_0x2ee399[_0x8388('0x66')],_0x2ee399[_0x8388('0x5c')][_0x8388('0x67')],_0x2ee399[_0x8388('0x5c')][_0x8388('0x20')]);}}}else{var _0x38c613=_(_0x44fcef[_0x8388('0x38')])[_0x8388('0x39')]()[_0x8388('0x2e')](function(_0x267239){return _['some'](_0x9fce08,['name',_0x267239])?_0x267239:undefined;})[_0x8388('0x71')]()[_0x8388('0x5c')]();if(!_[_0x8388('0x72')](_0x38c613)){_0x38c613['forEach'](function(_0x5921ca){if(_0x5921ca===_0x8388('0x73')){_0x187da9['where'](_0x8388('0x74'),[][_0x8388('0x75')](_0x44fcef[_0x8388('0x38')][_0x5921ca]));}else if(_0x5921ca===_0x8388('0x76')){var _0xcd0c55=JSON[_0x8388('0x77')](_0x44fcef[_0x8388('0x38')][_0x5921ca])[_0x8388('0x78')];var _0x142994=JSON[_0x8388('0x77')](_0x44fcef[_0x8388('0x38')][_0x5921ca])[_0x8388('0x79')];_0x187da9[_0x8388('0x41')](_0x8388('0x7a'),_0xcd0c55,_0x142994);}else{if(_0x44fcef['query'][_0x5921ca]===_0x8388('0x7b')){_0x187da9['where']('i.'+_0x5921ca+_0x8388('0x7c'));}else{_0x187da9[_0x8388('0x41')]('i.'+_0x5921ca+_0x8388('0x7d'),_0x44fcef[_0x8388('0x38')][_0x5921ca]);}}});}if(_0x44fcef['query']['read']){if(_0x44fcef[_0x8388('0x38')]['read']==0x1){_0x187da9[_0x8388('0x5d')](_0x8388('0x7e'));}else{_0x187da9['having']('`unreadMessages`\x20>\x200');}}if(_0x44fcef[_0x8388('0x38')]['tag']){_0x15e271=_[_0x8388('0x7f')](_0x44fcef[_0x8388('0x38')][_0x8388('0x80')])?_0x44fcef[_0x8388('0x38')]['tag']:new Array(_0x44fcef[_0x8388('0x38')][_0x8388('0x80')]);_0x15e271['forEach'](function(_0x4c07d8){_0x444c51['or'](_0x8388('0x81'),'%,'+_0x4c07d8+',%');});}if(_0x44fcef[_0x8388('0x38')]['filter']){var _0xc97467=_0x44fcef[_0x8388('0x38')][_0x8388('0x82')][_0x8388('0x83')]('\x5c','\x5c\x5c')[_0x8388('0x83')](/'/g,'\x27\x27');if(qs[_0x8388('0x84')](_0xc97467)){_0x21a357['or'](_0x8388('0x85'),_0xc97467+'%');}else{_0x21a357['or'](_0x8388('0x86'),qs[_0x8388('0x62')](_0xc97467))['or']('i.from\x20LIKE\x20?',_0xc97467+'%')['or'](_0x8388('0x87'),_0xc97467+'%');}}}_0x187da9[_0x8388('0x41')](_0x21a357);_0x187da9['group'](_0x8388('0x88'));var _0x4dd6dd={'type':db[_0x8388('0x89')][_0x8388('0x8a')][_0x8388('0x8b')],'raw':!![]};var _0x263988=_0x187da9[_0x8388('0x8c')]();_0x263988[_0x8388('0x43')](_0x8388('0x88'));_0x263988[_0x8388('0x43')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8388('0x5b'));if(_0x5e5dec[_0x8388('0x8d')]){_0x5e5dec[_0x8388('0x8d')]['forEach'](function(_0x120861){var _0x7b8f6e=_0x120861[0x0]===_0x8388('0x8e')?_0x120861[0x0]:'i.'+_0x120861[0x0];_0x187da9[_0x8388('0x8d')](_0x7b8f6e,_0x120861[0x1]===_0x8388('0x8f')?![]:!![]);});}if(!_[_0x8388('0x72')](_0x15e271)){_0x187da9[_0x8388('0x5d')](_0x444c51);_0x263988[_0x8388('0x41')](_0x8388('0x90'),_0x15e271);}BPromise[_0x8388('0x91')]()[_0x8388('0x29')](function(){if(!_0xa7157d){if(_0x44fcef[_0x8388('0x38')][_0x8388('0x73')])return;_0x263988[_0x8388('0x41')](_0x8388('0x92'));_0x187da9[_0x8388('0x41')](_0x8388('0x92'));return;}if(_0x44fcef[_0x8388('0x93')][_0x8388('0x94')]!==_0x8388('0x95'))return;return _0x44fcef[_0x8388('0x93')][_0x8388('0x96')]({'attributes':['id'],'raw':!![]})[_0x8388('0x29')](function(_0x405092){if(_[_0x8388('0x72')](_0x405092)){_0x263988[_0x8388('0x41')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x187da9[_0x8388('0x41')](_0x8388('0x97'));}else{_0x263988[_0x8388('0x41')](_0x8388('0x74'),_[_0x8388('0x2e')](_0x405092,'id'));_0x187da9[_0x8388('0x41')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x405092,'id'));}});})[_0x8388('0x29')](function(){if(_0x44fcef[_0x8388('0x93')][_0x8388('0x94')]===_0x8388('0x95')&&!_0xa7157d&&!_0x44fcef['query'][_0x8388('0x73')])return[];return db[_0x8388('0x98')][_0x8388('0x38')](_0x263988['toString'](),_0x4dd6dd);})['then'](function(_0x23ae83){_0xe2bd8b['count']=_0x23ae83[_0x8388('0x3e')];if(_0xe2bd8b[_0x8388('0x99')]===0x0)return[];return db['sequelize'][_0x8388('0x38')](_0x3b26d9['toString'](),_0x4dd6dd)[_0x8388('0x29')](function(_0x2f5bd9){_0x46a3c9=_[_0x8388('0x9a')](_0x2f5bd9,'id');_0x4dd6dd=_[_0x8388('0x9b')](_0x4dd6dd,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x44fcef[_0x8388('0x38')][_0x8388('0x3d')]){_0x5e5dec['attributes'][_0x8388('0x30')](function(_0x590f14){_0x187da9[_0x8388('0x43')]('i.'+_0x590f14);});}else{_0x187da9[_0x8388('0x43')](_0x8388('0x9c'),_0x8388('0x5b'));_0x187da9['field'](_0x8388('0x9d'),_0x8388('0x9e'));_0x187da9['field'](_0x8388('0x9f'),_0x8388('0xa0'));_0x187da9[_0x8388('0x43')](_0x8388('0xa1'),_0x8388('0x8e'));_0x187da9[_0x8388('0x43')](_0x8388('0xa2'));_0x187da9['field'](_0x8388('0xa3'),_0x8388('0xa4'));_0x187da9[_0x8388('0x43')](_0x8388('0xa5'),'Contact.lastName');_0x187da9[_0x8388('0x43')](_0x8388('0xa6'),'Contact.email');_0x187da9['field'](_0x8388('0xa7'),_0x8388('0xa8'));_0x187da9[_0x8388('0x43')]('c.mobile',_0x8388('0xa9'));_0x187da9[_0x8388('0x43')](_0x8388('0xaa'),'Contact.fax');_0x187da9['field'](_0x8388('0xab'),_0x8388('0xac'));_0x187da9[_0x8388('0x43')](_0x8388('0xad'),_0x8388('0xae'));_0x187da9['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8388('0x32'));}if(_0x5e5dec[_0x8388('0x23')])_0x187da9[_0x8388('0x23')](_0x5e5dec['limit']);if(_0x5e5dec[_0x8388('0x21')])_0x187da9['offset'](_0x5e5dec[_0x8388('0x21')]);return db[_0x8388('0x98')][_0x8388('0x38')](_0x187da9[_0x8388('0xaf')](),_0x4dd6dd);})['then'](function(_0x157b7a){if(_0x157b7a['length']>0x0)_0xf11e37[_0x8388('0x41')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x8388('0x2e')](_0x157b7a,'id'));return db[_0x8388('0x98')][_0x8388('0x38')](_0xf11e37[_0x8388('0xaf')](),_0x4dd6dd)['then'](function(_0x4df215){var _0x4104d5=_['groupBy'](_0x4df215,'OpenchannelInteractionId');var _0x5cf3e7=[];_0x157b7a[_0x8388('0x30')](function(_0xa69c9b){_0x5cf3e7[_0x8388('0x31')](updateOpenchannelInteraction(_0xa69c9b,_0x46a3c9,_0x4104d5));});return BPromise[_0x8388('0xb0')](_0x5cf3e7);});});})[_0x8388('0x29')](function(_0x1f2bc9){_0xe2bd8b[_0x8388('0xb1')]=_0x1f2bc9;return _0xe2bd8b;})[_0x8388('0x29')](respondWithFilteredResult(_0x10d81c,_0x5e5dec))[_0x8388('0x33')](handleError(_0x10d81c,null));};exports[_0x8388('0xb2')]=function(_0x3ed4ed,_0x2e8a92){var _0xf38175={};if(_0x3ed4ed[_0x8388('0x38')]['type']&&_0x3ed4ed[_0x8388('0x38')][_0x8388('0x6f')]===_0x8388('0x48')){_0xf38175[_0x8388('0x48')]=_0x3ed4ed[_0x8388('0xb3')]['id'];}else{_0xf38175['id']=_0x3ed4ed[_0x8388('0xb3')]['id'];}var _0x2430df={'raw':![],'where':_0xf38175},_0x396bc9={};_0x396bc9[_0x8388('0x37')]=_[_0x8388('0x39')](db[_0x8388('0xb4')]['rawAttributes']);_0x396bc9['query']=_[_0x8388('0x39')](_0x3ed4ed['query']);_0x396bc9[_0x8388('0x3a')]=_[_0x8388('0x3b')](_0x396bc9[_0x8388('0x37')],_0x396bc9['query']);_0x2430df[_0x8388('0x3c')]=_[_0x8388('0x3b')](_0x396bc9[_0x8388('0x37')],qs[_0x8388('0x3d')](_0x3ed4ed[_0x8388('0x38')][_0x8388('0x3d')]));_0x2430df[_0x8388('0x3c')]=_0x2430df[_0x8388('0x3c')][_0x8388('0x3e')]?_0x2430df['attributes']:_0x396bc9[_0x8388('0x37')];if(_0x3ed4ed[_0x8388('0x38')][_0x8388('0xb5')]){_0x2430df[_0x8388('0xb6')]=[{'all':!![]}];}_0x2430df=_[_0x8388('0x9b')]({},_0x2430df,_0x3ed4ed[_0x8388('0xb7')]);return db['OpenchannelInteraction'][_0x8388('0x5a')](_0x2430df)[_0x8388('0x29')](handleEntityNotFound(_0x2e8a92,null))[_0x8388('0x29')](respondWithResult(_0x2e8a92,null))[_0x8388('0x33')](handleError(_0x2e8a92,null));};exports[_0x8388('0xb8')]=function(_0x5b6b20,_0x14804c){return db[_0x8388('0xb4')][_0x8388('0xb8')](_0x5b6b20['body'],{})[_0x8388('0x29')](respondWithResult(_0x14804c,0xc9))[_0x8388('0x33')](handleError(_0x14804c,null));};exports[_0x8388('0x28')]=function(_0x38d8ce,_0xdd049){if(_0x38d8ce[_0x8388('0x70')]['id']){delete _0x38d8ce['body']['id'];}return db['OpenchannelInteraction'][_0x8388('0x5a')]({'where':{'id':_0x38d8ce[_0x8388('0xb3')]['id']}})[_0x8388('0x29')](handleEntityNotFound(_0xdd049,null))[_0x8388('0x29')](saveUpdates(_0x38d8ce[_0x8388('0x70')],null))['then'](respondWithResult(_0xdd049,null))['catch'](handleError(_0xdd049,null));};exports['destroy']=function(_0x207b8d,_0x3e4cc4){return db[_0x8388('0xb4')]['find']({'where':{'id':_0x207b8d[_0x8388('0xb3')]['id']}})[_0x8388('0x29')](handleEntityNotFound(_0x3e4cc4,null))[_0x8388('0x29')](removeEntity(_0x3e4cc4,null))['catch'](handleError(_0x3e4cc4,null));};exports[_0x8388('0xb9')]=function(_0x337825,_0x5ab16b){return db[_0x8388('0xb4')][_0x8388('0xb9')]()[_0x8388('0x29')](respondWithResult(_0x5ab16b,null))[_0x8388('0x33')](handleError(_0x5ab16b,null));};exports['addMessage']=function(_0x353aa8,_0x41546a,_0x106180){return db['OpenchannelMessage']['find']({'where':{'id':_0x353aa8[_0x8388('0xb3')]['id']}})[_0x8388('0x29')](handleEntityNotFound(_0x41546a,null))[_0x8388('0x29')](function(_0x361a10){if(_0x361a10){return _0x361a10[_0x8388('0xba')](_0x353aa8[_0x8388('0x70')][_0x8388('0xbb')],_['omit'](_0x353aa8['body'],[_0x8388('0xbb'),'id'])||{});}})[_0x8388('0x29')](respondWithResult(_0x41546a,null))[_0x8388('0x33')](handleError(_0x41546a,null));};exports[_0x8388('0xbc')]=function(_0x141cfb,_0x296181,_0x5dc5bb){var _0x48ba21={'raw':![],'where':{}};var _0x56a9a={};var _0xb9562e={'count':0x0,'rows':[]};return db[_0x8388('0xb4')]['findOne']({'where':{'id':_0x141cfb['params']['id']}})['then'](handleEntityNotFound(_0x296181,null))['then'](function(_0x3b4fee){if(_0x3b4fee){_0x56a9a[_0x8388('0x37')]=_[_0x8388('0x39')](db[_0x8388('0xbd')][_0x8388('0x34')]);_0x56a9a[_0x8388('0x38')]=_[_0x8388('0x39')](_0x141cfb[_0x8388('0x38')]);_0x56a9a['filters']=_[_0x8388('0x3b')](_0x56a9a[_0x8388('0x37')],_0x56a9a['query']);_0x48ba21[_0x8388('0x3c')]=_[_0x8388('0x3b')](_0x56a9a['model'],qs['fields'](_0x141cfb[_0x8388('0x38')][_0x8388('0x3d')]));_0x48ba21[_0x8388('0x3c')]=_0x48ba21[_0x8388('0x3c')][_0x8388('0x3e')]?_0x48ba21['attributes']:_0x56a9a[_0x8388('0x37')];if(!_0x141cfb[_0x8388('0x38')][_0x8388('0xbe')]('nolimit')){_0x48ba21[_0x8388('0x23')]=qs[_0x8388('0x23')](_0x141cfb['query'][_0x8388('0x23')]);_0x48ba21['offset']=qs[_0x8388('0x21')](_0x141cfb[_0x8388('0x38')][_0x8388('0x21')]);}_0x48ba21[_0x8388('0x8d')]=qs[_0x8388('0x40')](_0x141cfb[_0x8388('0x38')][_0x8388('0x40')]);_0x48ba21[_0x8388('0x41')]=qs['filters'](_[_0x8388('0x42')](_0x141cfb[_0x8388('0x38')],_0x56a9a[_0x8388('0x3a')]));_0x48ba21[_0x8388('0x41')][_0x8388('0xbf')]=_0x3b4fee['id'];if(_0x141cfb['query'][_0x8388('0x82')]){_0x48ba21[_0x8388('0x41')]=_['merge'](_0x48ba21[_0x8388('0x41')],{'$or':_[_0x8388('0x2e')](_0x48ba21[_0x8388('0x3c')],function(_0x35da2e){var _0x8d4ba={};_0x8d4ba[_0x35da2e]={'$like':'%'+_0x141cfb[_0x8388('0x38')][_0x8388('0x82')]+'%'};return _0x8d4ba;})});}if(_0x141cfb['query'][_0x8388('0x78')]){var _0x39bf9a=_0x141cfb[_0x8388('0x38')][_0x8388('0x78')]['split'](',');var _0x18f412={};_0x18f412[_0x39bf9a[0x0]]={'$gte':moment(_0x39bf9a[0x1])[_0x8388('0xc0')](_0x8388('0xc1'))};_0x48ba21[_0x8388('0x41')]=_[_0x8388('0x9b')](_0x48ba21[_0x8388('0x41')],_0x18f412);}_0x48ba21=_['merge']({},_0x48ba21,_0x141cfb['options']);return db[_0x8388('0xbd')]['count']({'where':_0x48ba21[_0x8388('0x41')]})[_0x8388('0x29')](function(_0x256b3a){_0xb9562e[_0x8388('0x99')]=_0x256b3a;if(_0x141cfb[_0x8388('0x38')][_0x8388('0xb5')]){_0x48ba21[_0x8388('0xb6')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x48ba21);})['then'](function(_0x397c05){_0xb9562e['rows']=_0x397c05;return _0xb9562e;});}})[_0x8388('0x29')](respondWithFilteredResult(_0x296181,_0x48ba21))[_0x8388('0x33')](handleError(_0x296181,null));};exports[_0x8388('0xc2')]=function(_0x486cbf,_0x9cb8df,_0x4556ac){return db[_0x8388('0xb4')][_0x8388('0x5a')]({'where':{'id':_0x486cbf['params']['id']}})[_0x8388('0x29')](handleEntityNotFound(_0x9cb8df,null))[_0x8388('0x29')](function(_0x5ba649){if(_0x5ba649){return _0x5ba649['setTags'](_0x486cbf[_0x8388('0x70')][_0x8388('0xbb')],_[_0x8388('0xc3')](_0x486cbf[_0x8388('0x70')],[_0x8388('0xbb'),'id'])||{})['spread'](function(){return db[_0x8388('0x68')]['findAll']({'attributes':['id',_0x8388('0x2d'),_0x8388('0x44')],'where':{'id':_0x486cbf[_0x8388('0x70')]['ids']}});})['then'](function(_0x183e6c){socket[_0x8388('0xc4')](_0x8388('0xc5'),{'id':Number(_0x486cbf[_0x8388('0xb3')]['id']),'tags':_0x183e6c||[]});return{'id':Number(_0x486cbf[_0x8388('0xb3')]['id']),'tags':_0x183e6c||[]};});}})['then'](respondWithResult(_0x9cb8df,null))[_0x8388('0x33')](handleError(_0x9cb8df,null));};exports['removeTags']=function(_0x34e60d,_0x278828,_0x35296a){return db[_0x8388('0xb4')][_0x8388('0x5a')]({'where':{'id':_0x34e60d[_0x8388('0xb3')]['id']}})[_0x8388('0x29')](handleEntityNotFound(_0x278828,null))[_0x8388('0x29')](function(_0x17f172){if(_0x17f172){return _0x17f172['removeTags'](_0x34e60d[_0x8388('0x38')][_0x8388('0xbb')]);}})['then'](respondWithStatusCode(_0x278828,null))[_0x8388('0x33')](handleError(_0x278828,null));};exports['download']=function(_0x51975a,_0x2f614c){var _0x571f0b=moment()[_0x8388('0xc6')]()['toString']();var _0x451251=path['join'](config[_0x8388('0xc7')],'server',_0x8388('0xc8'),_0x8388('0xc9'));var _0x2d375d=path['join'](config['root'],_0x8388('0xca'),'files',_0x8388('0xcb'));var _0x3a8341=path[_0x8388('0xcc')](_0x451251,_0x571f0b);var _0x150fad=util[_0x8388('0xc0')]('transcript-%d-%s.zip',_0x51975a['params']['id'],_0x571f0b);var _0x14fa88=path[_0x8388('0xcc')](_0x451251,_0x150fad);var _0x13e3a7=[];_0x13e3a7[_0x8388('0x31')]({'model':db[_0x8388('0x6b')],'as':_0x8388('0x6b'),'attributes':['id',_0x8388('0x2f')],'raw':!![]});_0x13e3a7[_0x8388('0x31')]({'model':db['CmContact'],'as':_0x8388('0x5f'),'attributes':['id','firstName',_0x8388('0xcd')],'raw':!![]});if(_0x51975a[_0x8388('0x38')]['attachments']){_0x13e3a7[_0x8388('0x31')]({'model':db[_0x8388('0xce')],'as':_0x8388('0xce'),'raw':!![]});}var _0x5239a9=[{'model':db[_0x8388('0xbd')],'as':_0x8388('0xcf'),'attributes':['id',_0x8388('0x70'),_0x8388('0x76'),'direction',_0x8388('0xd0'),_0x8388('0xd1')],'include':_0x13e3a7}];_0x5239a9[_0x8388('0x31')]({'model':db[_0x8388('0xd2')],'as':_0x8388('0xd3'),'attributes':['id',_0x8388('0x2d')]});_0x5239a9[_0x8388('0x31')]({'model':db['User'],'as':_0x8388('0xd4'),'attributes':['id',_0x8388('0x2f')]});return db[_0x8388('0xb4')][_0x8388('0x5a')]({'where':{'id':_0x51975a['params']['id']},'include':_0x5239a9})['then'](handleEntityNotFound(_0x2f614c,null))[_0x8388('0x29')](function(_0x51897e){if(_0x51897e){var _0x3eb947=_0x51897e[_0x8388('0xd5')]({'plain':!![]});fs[_0x8388('0xd6')](_0x3a8341);var _0x4ba32d={'channel':'Openchannel','account':_0x3eb947['Account'][_0x8388('0x2d')],'agent':_0x3eb947[_0x8388('0xd4')]?_0x3eb947['Owner'][_0x8388('0x2f')]:'N.A.','createdAt':moment(_0x3eb947[_0x8388('0x76')])['format'](_0x8388('0xc1'))['toString'](),'closedAt':_0x3eb947[_0x8388('0xd7')]?moment(_0x3eb947['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x8388('0xaf')]():'','disposition':_0x3eb947['disposition'],'visibility':_0x3eb947['threadId']?'Public':'Private','messages':_(_0x3eb947[_0x8388('0xcf')])[_0x8388('0x82')]({'secret':![]})[_0x8388('0x2e')](function(_0x8f7a4){if(_0x8f7a4[_0x8388('0xce')]){var _0x358ad3=path[_0x8388('0xcc')](_0x2d375d,_0x8f7a4['Attachment'][_0x8388('0xd8')]);if(fs['existsSync'](_0x358ad3)){fs[_0x8388('0xd9')](_0x358ad3)[_0x8388('0xda')](fs[_0x8388('0xdb')](path[_0x8388('0xcc')](_0x3a8341,_0x8f7a4[_0x8388('0xce')][_0x8388('0xd8')])));}}return{'date':moment(_0x8f7a4['createdAt'])[_0x8388('0xc0')](_0x8388('0xc1'))[_0x8388('0xaf')](),'sender':_0x8f7a4['direction']===_0x8388('0xdc')?_0x8f7a4[_0x8388('0x6b')]?_0x8f7a4['User'][_0x8388('0x2f')]:_0x8388('0xdd'):_0x8f7a4['Contact'][_0x8388('0xde')]+(_0x8f7a4['Contact']['lastName']?'\x20'+_0x8f7a4['Contact'][_0x8388('0xcd')]:''),'body':_0x8f7a4[_0x8388('0xce')]?_0x8f7a4['Attachment'][_0x8388('0xd8')]:_0x8f7a4[_0x8388('0x70')],'direction':_0x8f7a4[_0x8388('0xdf')]==='out'?'A':'C','secret':_0x8f7a4['secret'],'read':_0x8f7a4[_0x8388('0xd1')],'attachment':_0x8f7a4[_0x8388('0xce')]};})[_0x8388('0x5c')]()};return ejs[_0x8388('0xe0')](path[_0x8388('0xcc')](config[_0x8388('0xc7')],_0x8388('0xca'),_0x8388('0xe1'),'downloadInteraction.ejs'),{'interaction':_0x4ba32d})[_0x8388('0x29')](function(_0x2630ac){var _0x6b7c39=path[_0x8388('0xcc')](_0x3a8341,_0x8388('0xe2')+_0x3eb947['id']+'-'+_0x571f0b+'.pdf');var _0x27261a={'path':_0x6b7c39,'channel':_0x8388('0xe3'),'interactionId':_0x3eb947['id']};return pdf['createPdfFromHTML'](_0x2630ac,_0x27261a);})[_0x8388('0x29')](function(){return new BPromise(function(_0x46ebbc,_0x27792b){zipdir(_0x3a8341,{'saveTo':_0x14fa88},function(_0x729f55,_0x3d4738){if(_0x729f55)return _0x27792b(_0x729f55);return _0x46ebbc(_0x3d4738);});})['then'](function(){return new BPromise(function(_0x48014c,_0x1c22f6){rimraf(_0x3a8341,function(_0x2f0952){if(_0x2f0952)_0x1c22f6(_0x2f0952);return _0x48014c();});});})[_0x8388('0x29')](function(){return _0x2f614c[_0x8388('0xe4')](_0x14fa88,_0x150fad,function(_0x100b8a){if(_0x100b8a){console['log']('err',_0x100b8a);}else{fs['unlinkSync'](_0x14fa88);}});});});}else{return _0x2f614c[_0x8388('0x1e')](0xc8);}})[_0x8388('0x33')](handleError(_0x2f614c,null));};
\ No newline at end of file
index e3948dc..9a3030a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a39=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x6a39,0xbb));var _0x96a3=function(_0x105b20,_0x388d13){_0x105b20=_0x105b20-0x0;var _0x357455=_0x6a39[_0x105b20];return _0x357455;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x96a3('0x0'))['db'][_0x96a3('0x1')];var OpenchannelMessage=require(_0x96a3('0x0'))['db'][_0x96a3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x96a3('0x3')](0x0);var events={'afterCreate':_0x96a3('0x4'),'afterUpdate':_0x96a3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4384f9){return function(_0x439692,_0x3b97aa,_0x2e25d1){_0x439692['getUsers']({'attributes':['id'],'raw':!![]})[_0x96a3('0x6')](function(_0x2a6f7a){_0x439692[_0x96a3('0x7')]('Users',_0x2a6f7a[_0x96a3('0x8')](function(_0x2f92ef){return{'id':_0x2f92ef['id']};}));return OpenchannelMessage[_0x96a3('0x9')]({'where':{'OpenchannelInteractionId':_0x439692['id'],'direction':'in','read':![]},'raw':!![]});})[_0x96a3('0x6')](function(_0x3dc7a2){_0x439692[_0x96a3('0x7')](_0x96a3('0xa'),_0x3dc7a2[_0x96a3('0xb')]);OpenchannelInteractionEvents['emit'](_0x4384f9+':'+_0x439692['id'],_0x439692);OpenchannelInteractionEvents[_0x96a3('0xc')](_0x4384f9,_0x439692);_0x2e25d1(null);})[_0x96a3('0xd')](_0x2e25d1(null));};}for(var e in events){if(events[_0x96a3('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x96a3('0xf')](e,emitEvent(event));}}module[_0x96a3('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x90c4=['remove','getUsers','then','setDataValue','Users','length','emit','catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x5f5da6,_0x5c7662){var _0x5aea8f=function(_0x4d2de6){while(--_0x4d2de6){_0x5f5da6['push'](_0x5f5da6['shift']());}};_0x5aea8f(++_0x5c7662);}(_0x90c4,0x9f));var _0x490c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x90c4[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x490c('0x0'));var OpenchannelInteraction=require(_0x490c('0x1'))['db'][_0x490c('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x490c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x490c('0x4')](0x0);var events={'afterCreate':_0x490c('0x5'),'afterUpdate':'update','afterDestroy':_0x490c('0x6')};function emitEvent(_0x268934){return function(_0x53a91c,_0x2bb417,_0x40c70f){_0x53a91c[_0x490c('0x7')]({'attributes':['id'],'raw':!![]})[_0x490c('0x8')](function(_0x4ab32b){_0x53a91c[_0x490c('0x9')](_0x490c('0xa'),_0x4ab32b['map'](function(_0x4d85c4){return{'id':_0x4d85c4['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x53a91c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5aa693){_0x53a91c[_0x490c('0x9')]('unreadMessages',_0x5aa693[_0x490c('0xb')]);OpenchannelInteractionEvents[_0x490c('0xc')](_0x268934+':'+_0x53a91c['id'],_0x53a91c);OpenchannelInteractionEvents['emit'](_0x268934,_0x53a91c);_0x40c70f(null);})[_0x490c('0xd')](_0x40c70f(null));};}for(var e in events){if(events[_0x490c('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 14919ae..99d1998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fb2=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0x53f132,_0x441cf9){var _0x18925d=function(_0x1ba5d8){while(--_0x1ba5d8){_0x53f132['push'](_0x53f132['shift']());}};_0x18925d(++_0x441cf9);}(_0x5fb2,0xad));var _0x25fb=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0x5fb2[_0x5b734b];return _0x2a15a3;};'use strict';var _=require(_0x25fb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x25fb('0x1'));var BPromise=require(_0x25fb('0x2'));var rp=require(_0x25fb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25fb('0x4'));var config=require(_0x25fb('0x5'));var attributes=require(_0x25fb('0x6'));module['exports']=function(_0x7e549f,_0x135a73){return _0x7e549f[_0x25fb('0x7')](_0x25fb('0x8'),attributes,{'tableName':_0x25fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x25fb('0xa'),'hooks':{'beforeUpdate':function(_0x2fd92a,_0xadcb49,_0x18c790){if(_0x2fd92a[_0x25fb('0xb')](_0x25fb('0xc'))){_0x2fd92a[_0x25fb('0xd')]=moment()['format'](_0x25fb('0xe'));}_0x18c790(null,_0x2fd92a);}}});};
\ No newline at end of file
+var _0xd0e0=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions'];(function(_0x549876,_0x66473f){var _0x242552=function(_0x368dfb){while(--_0x368dfb){_0x549876['push'](_0x549876['shift']());}};_0x242552(++_0x66473f);}(_0xd0e0,0x103));var _0x0d0e=function(_0x33aa3e,_0x45ebd1){_0x33aa3e=_0x33aa3e-0x0;var _0x5206b4=_0xd0e0[_0x33aa3e];return _0x5206b4;};'use strict';var _=require(_0x0d0e('0x0'));var util=require(_0x0d0e('0x1'));var logger=require('../../config/logger')(_0x0d0e('0x2'));var moment=require(_0x0d0e('0x3'));var BPromise=require(_0x0d0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0d0e('0x5'));var config=require(_0x0d0e('0x6'));var attributes=require(_0x0d0e('0x7'));module[_0x0d0e('0x8')]=function(_0x4bb668,_0xe30070){return _0x4bb668[_0x0d0e('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x0d0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x17b60f,_0x4c8d9e,_0x299a8f){if(_0x17b60f[_0x0d0e('0xb')](_0x0d0e('0xc'))){_0x17b60f[_0x0d0e('0xd')]=moment()['format'](_0x0d0e('0xe'));}_0x299a8f(null,_0x17b60f);}}});};
\ No newline at end of file
index c0fddb6..380a5cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5e5=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','info','request\x20sent','debug','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','where','attributes','limit','then','addTags','ids','omit','spread','AddTags'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0xc5e5,0x19a));var _0x5c5e=function(_0x48ab1b,_0x4ddf0f){_0x48ab1b=_0x48ab1b-0x0;var _0x580213=_0xc5e5[_0x48ab1b];return _0x580213;};'use strict';var _=require(_0x5c5e('0x0'));var util=require(_0x5c5e('0x1'));var moment=require('moment');var BPromise=require(_0x5c5e('0x2'));var rs=require(_0x5c5e('0x3'));var fs=require('fs');var Redis=require(_0x5c5e('0x4'));var db=require(_0x5c5e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c5e('0x6'))(_0x5c5e('0x7'));var config=require(_0x5c5e('0x8'));var jayson=require(_0x5c5e('0x9'));var client=jayson[_0x5c5e('0xa')][_0x5c5e('0xb')]({'port':0x232a});config[_0x5c5e('0xc')]=_[_0x5c5e('0xd')](config[_0x5c5e('0xc')],{'host':_0x5c5e('0xe'),'port':0x18eb});var socket=require(_0x5c5e('0xf'))(new Redis(config[_0x5c5e('0xc')]));require(_0x5c5e('0x10'))['register'](socket);function respondWithRpcPromise(_0x18f2ea,_0x1988ca,_0x1466ce){return new BPromise(function(_0x3d1798,_0x338fe2){return client[_0x5c5e('0x11')](_0x18f2ea,_0x1466ce)['then'](function(_0x2d0907){logger[_0x5c5e('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1988ca,_0x5c5e('0x13'));logger[_0x5c5e('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1988ca,_0x5c5e('0x13'),JSON[_0x5c5e('0x15')](_0x2d0907));if(_0x2d0907[_0x5c5e('0x16')]){if(_0x2d0907[_0x5c5e('0x16')][_0x5c5e('0x17')]===0x1f4){logger[_0x5c5e('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1988ca,_0x2d0907[_0x5c5e('0x16')]['message']);return _0x338fe2(_0x2d0907['error'][_0x5c5e('0x18')]);}logger[_0x5c5e('0x16')](_0x5c5e('0x19'),_0x1988ca,_0x2d0907[_0x5c5e('0x16')]['message']);return _0x3d1798(_0x2d0907['error'][_0x5c5e('0x18')]);}else{logger[_0x5c5e('0x12')](_0x5c5e('0x19'),_0x1988ca,_0x5c5e('0x13'));_0x3d1798(_0x2d0907[_0x5c5e('0x1a')][_0x5c5e('0x18')]);}})[_0x5c5e('0x1b')](function(_0x1808c3){logger[_0x5c5e('0x16')](_0x5c5e('0x19'),_0x1988ca,_0x1808c3);_0x338fe2(_0x1808c3);});});}exports[_0x5c5e('0x1c')]=function(_0x33eb80){var _0x16be2f=this;return new Promise(function(_0x1bbf5c,_0x4cbc13){return db[_0x5c5e('0x1d')]['update'](_0x33eb80[_0x5c5e('0x1e')],{'raw':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80[_0x5c5e('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80[_0x5c5e('0x1f')][_0x5c5e('0x20')]||null:null,'attributes':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80['options'][_0x5c5e('0x21')]||null:null,'limit':_0x33eb80[_0x5c5e('0x1f')]?_0x33eb80['options'][_0x5c5e('0x22')]||null:null})[_0x5c5e('0x23')](function(_0x3b99d9){logger[_0x5c5e('0x12')](_0x5c5e('0x1c'),_0x33eb80);logger['debug'](_0x5c5e('0x1c'),_0x33eb80,JSON[_0x5c5e('0x15')](_0x3b99d9));_0x1bbf5c(_0x3b99d9);})[_0x5c5e('0x1b')](function(_0x1834b4){logger[_0x5c5e('0x16')](_0x5c5e('0x1c'),_0x1834b4[_0x5c5e('0x18')],_0x33eb80);_0x4cbc13(_0x16be2f[_0x5c5e('0x16')](0x1f4,_0x1834b4[_0x5c5e('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5c0120){return new Promise(function(_0xd77c9b,_0x581b0b){return db[_0x5c5e('0x1d')]['find']({'where':_0x5c0120[_0x5c5e('0x1f')]?_0x5c0120[_0x5c5e('0x1f')][_0x5c5e('0x20')]||null:null})[_0x5c5e('0x23')](function(_0xba4dc3){if(_0xba4dc3){return _0xba4dc3[_0x5c5e('0x24')](_0x5c0120[_0x5c5e('0x1e')][_0x5c5e('0x25')],_[_0x5c5e('0x26')](_0x5c0120[_0x5c5e('0x1e')],[_0x5c5e('0x25'),'id'])||{});}})[_0x5c5e('0x27')](function(_0x1b6142){logger['info']('AddTags',_0x5c0120);logger['debug'](_0x5c5e('0x28'),_0x5c0120,JSON['stringify'](_0x1b6142));_0xd77c9b(_0x1b6142);})[_0x5c5e('0x1b')](function(_0x34c3f3){logger[_0x5c5e('0x16')](_0x5c5e('0x28'),_0x34c3f3['message'],_0x5c0120);_0x581b0b(_this[_0x5c5e('0x16')](0x1f4,_0x34c3f3[_0x5c5e('0x18')]));});});};
\ No newline at end of file
+var _0x7dab=['rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3617f9,_0x3ca449){var _0x1a3af3=function(_0x159f94){while(--_0x159f94){_0x3617f9['push'](_0x3617f9['shift']());}};_0x1a3af3(++_0x3ca449);}(_0x7dab,0x7b));var _0xb7da=function(_0x5964b2,_0x47a75a){_0x5964b2=_0x5964b2-0x0;var _0x49efe5=_0x7dab[_0x5964b2];return _0x49efe5;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var moment=require('moment');var BPromise=require(_0xb7da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7da('0x3'));var db=require(_0xb7da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7da('0x5'))(_0xb7da('0x6'));var config=require(_0xb7da('0x7'));var jayson=require(_0xb7da('0x8'));var client=jayson[_0xb7da('0x9')]['http']({'port':0x232a});config[_0xb7da('0xa')]=_['defaults'](config[_0xb7da('0xa')],{'host':_0xb7da('0xb'),'port':0x18eb});var socket=require(_0xb7da('0xc'))(new Redis(config['redis']));require(_0xb7da('0xd'))[_0xb7da('0xe')](socket);function respondWithRpcPromise(_0xdce119,_0x3348eb,_0x33066e){return new BPromise(function(_0x114a28,_0x5621c2){return client[_0xb7da('0xf')](_0xdce119,_0x33066e)['then'](function(_0x5a2f1e){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x3348eb,'request\x20sent');logger[_0xb7da('0x10')](_0xb7da('0x11'),_0x3348eb,_0xb7da('0x12'),JSON[_0xb7da('0x13')](_0x5a2f1e));if(_0x5a2f1e[_0xb7da('0x14')]){if(_0x5a2f1e[_0xb7da('0x14')][_0xb7da('0x15')]===0x1f4){logger[_0xb7da('0x14')](_0xb7da('0x16'),_0x3348eb,_0x5a2f1e[_0xb7da('0x14')]['message']);return _0x5621c2(_0x5a2f1e['error'][_0xb7da('0x17')]);}logger['error'](_0xb7da('0x16'),_0x3348eb,_0x5a2f1e['error'][_0xb7da('0x17')]);return _0x114a28(_0x5a2f1e[_0xb7da('0x14')][_0xb7da('0x17')]);}else{logger[_0xb7da('0x18')](_0xb7da('0x16'),_0x3348eb,'request\x20sent');_0x114a28(_0x5a2f1e[_0xb7da('0x19')][_0xb7da('0x17')]);}})[_0xb7da('0x1a')](function(_0x3d6c25){logger[_0xb7da('0x14')](_0xb7da('0x16'),_0x3348eb,_0x3d6c25);_0x5621c2(_0x3d6c25);});});}exports[_0xb7da('0x1b')]=function(_0x32382a){var _0x12fa2e=this;return new Promise(function(_0x38d635,_0x47bfdc){return db[_0xb7da('0x1c')][_0xb7da('0x1d')](_0x32382a[_0xb7da('0x1e')],{'raw':_0x32382a[_0xb7da('0x1f')]?_0x32382a['options'][_0xb7da('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32382a[_0xb7da('0x1f')]?_0x32382a[_0xb7da('0x1f')][_0xb7da('0x21')]||null:null,'attributes':_0x32382a[_0xb7da('0x1f')]?_0x32382a['options'][_0xb7da('0x22')]||null:null,'limit':_0x32382a[_0xb7da('0x1f')]?_0x32382a[_0xb7da('0x1f')][_0xb7da('0x23')]||null:null})[_0xb7da('0x24')](function(_0x3a0e2f){logger[_0xb7da('0x18')](_0xb7da('0x1b'),_0x32382a);logger['debug'](_0xb7da('0x1b'),_0x32382a,JSON[_0xb7da('0x13')](_0x3a0e2f));_0x38d635(_0x3a0e2f);})[_0xb7da('0x1a')](function(_0x56fb0d){logger[_0xb7da('0x14')](_0xb7da('0x1b'),_0x56fb0d[_0xb7da('0x17')],_0x32382a);_0x47bfdc(_0x12fa2e[_0xb7da('0x14')](0x1f4,_0x56fb0d[_0xb7da('0x17')]));});});};exports[_0xb7da('0x25')]=function(_0x27bead){return new Promise(function(_0x5c40c3,_0xc5e410){return db[_0xb7da('0x1c')][_0xb7da('0x26')]({'where':_0x27bead[_0xb7da('0x1f')]?_0x27bead[_0xb7da('0x1f')]['where']||null:null})[_0xb7da('0x24')](function(_0x3eb8cd){if(_0x3eb8cd){return _0x3eb8cd['addTags'](_0x27bead[_0xb7da('0x1e')][_0xb7da('0x27')],_[_0xb7da('0x28')](_0x27bead[_0xb7da('0x1e')],['ids','id'])||{});}})[_0xb7da('0x29')](function(_0x44c943){logger['info'](_0xb7da('0x2a'),_0x27bead);logger[_0xb7da('0x10')](_0xb7da('0x2a'),_0x27bead,JSON['stringify'](_0x44c943));_0x5c40c3(_0x44c943);})['catch'](function(_0x391051){logger[_0xb7da('0x14')](_0xb7da('0x2a'),_0x391051[_0xb7da('0x17')],_0x27bead);_0xc5e410(_this[_0xb7da('0x14')](0x1f4,_0x391051[_0xb7da('0x17')]));});});};
\ No newline at end of file
index 22cf231..d1f190f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc665=['save','emit','removeListener','register','length','./openchannelInteraction.events'];(function(_0x5ded3e,_0x18011d){var _0x505b3e=function(_0x31c8c5){while(--_0x31c8c5){_0x5ded3e['push'](_0x5ded3e['shift']());}};_0x505b3e(++_0x18011d);}(_0xc665,0x1df));var _0x5c66=function(_0x48084f,_0x2d1e50){_0x48084f=_0x48084f-0x0;var _0x215480=_0xc665[_0x48084f];return _0x215480;};'use strict';var OpenchannelInteractionEvents=require(_0x5c66('0x0'));var events=[_0x5c66('0x1'),'remove','update'];function createListener(_0x34c05f,_0x19a1cd){return function(_0x3f5820){_0x19a1cd[_0x5c66('0x2')](_0x34c05f,_0x3f5820);};}function removeListener(_0x4865b9,_0x27a024){return function(){OpenchannelInteractionEvents[_0x5c66('0x3')](_0x4865b9,_0x27a024);};}exports[_0x5c66('0x4')]=function(_0x3933e5){for(var _0x5ba9e7=0x0,_0x4b1ac4=events[_0x5c66('0x5')];_0x5ba9e7<_0x4b1ac4;_0x5ba9e7++){var _0x355019=events[_0x5ba9e7];var _0x2048ed=createListener('openchannelInteraction:'+_0x355019,_0x3933e5);OpenchannelInteractionEvents['on'](_0x355019,_0x2048ed);}};
\ No newline at end of file
+var _0x978f=['register','length','./openchannelInteraction.events','save','remove'];(function(_0x2736b6,_0x32b9a9){var _0x193c59=function(_0x1efd73){while(--_0x1efd73){_0x2736b6['push'](_0x2736b6['shift']());}};_0x193c59(++_0x32b9a9);}(_0x978f,0x1b5));var _0xf978=function(_0x5b31ba,_0x592f84){_0x5b31ba=_0x5b31ba-0x0;var _0x334a42=_0x978f[_0x5b31ba];return _0x334a42;};'use strict';var OpenchannelInteractionEvents=require(_0xf978('0x0'));var events=[_0xf978('0x1'),_0xf978('0x2'),'update'];function createListener(_0x7646c7,_0x53bcf1){return function(_0x3cccdd){_0x53bcf1['emit'](_0x7646c7,_0x3cccdd);};}function removeListener(_0x3eac0b,_0x3ae8a3){return function(){OpenchannelInteractionEvents['removeListener'](_0x3eac0b,_0x3ae8a3);};}exports[_0xf978('0x3')]=function(_0x3b5d74){for(var _0x5d67a8=0x0,_0x19500c=events[_0xf978('0x4')];_0x5d67a8<_0x19500c;_0x5d67a8++){var _0x4ac709=events[_0x5d67a8];var _0x90ce26=createListener('openchannelInteraction:'+_0x4ac709,_0x3b5d74);OpenchannelInteractionEvents['on'](_0x4ac709,_0x90ce26);}};
\ No newline at end of file
index 7b0c7dd..ce1ea09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x439501,_0x3047a2){var _0x850956=function(_0x1b11ca){while(--_0x1b11ca){_0x439501['push'](_0x439501['shift']());}};_0x850956(++_0x3047a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0xd3a813,_0x23ab32){_0xd3a813=_0xd3a813-0x0;var _0xbd6e95=_0x70e0[_0xd3a813];return _0xbd6e95;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router;
\ No newline at end of file
index 4d0ff3a..39c1199 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3495=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x3e2b4e,_0x5cba62){var _0xa545e9=function(_0x4c3c1a){while(--_0x4c3c1a){_0x3e2b4e['push'](_0x3e2b4e['shift']());}};_0xa545e9(++_0x5cba62);}(_0x3495,0x1de));var _0x5349=function(_0x17c0cc,_0x5eba4e){_0x17c0cc=_0x17c0cc-0x0;var _0xbd3d8a=_0x3495[_0x17c0cc];return _0xbd3d8a;};'use strict';var Sequelize=require(_0x5349('0x0'));module[_0x5349('0x1')]={'body':{'type':Sequelize[_0x5349('0x2')](_0x5349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5349('0x5')]('in',_0x5349('0x6')),'defaultValue':_0x5349('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x5349('0x7')]},'providerResponse':{'type':Sequelize[_0x5349('0x2')]}};
\ No newline at end of file
+var _0x71f4=['ENUM','out','STRING','TEXT','medium','BOOLEAN'];(function(_0x59fa34,_0x55af6e){var _0x40e36d=function(_0x78c8c5){while(--_0x78c8c5){_0x59fa34['push'](_0x59fa34['shift']());}};_0x40e36d(++_0x55af6e);}(_0x71f4,0xf9));var _0x471f=function(_0x9950ef,_0x128f28){_0x9950ef=_0x9950ef-0x0;var _0x263633=_0x71f4[_0x9950ef];return _0x263633;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x471f('0x0')](_0x471f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x471f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x471f('0x3')]('in','out'),'defaultValue':_0x471f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x471f('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 3bbddcd..e155062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d0c=['count','includeAll','include','findAll','rows','show','params','length','find','create','body','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','fullname','internal','manual','channel','motionChannel','accept','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','contact','User','email','SIP/%s','rejectmessage','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','keys','query','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','type','options'];(function(_0x1639be,_0x4ac980){var _0x4af3e1=function(_0x1a24cb){while(--_0x1a24cb){_0x1639be['push'](_0x1639be['shift']());}};_0x4af3e1(++_0x4ac980);}(_0x9d0c,0xb9));var _0xc9d0=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x9d0c[_0x1bc762];return _0x40f70c;};'use strict';var emlformat=require(_0xc9d0('0x0'));var rimraf=require(_0xc9d0('0x1'));var zipdir=require(_0xc9d0('0x2'));var jsonpatch=require(_0xc9d0('0x3'));var rp=require('request-promise');var moment=require(_0xc9d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9d0('0x5'));var util=require(_0xc9d0('0x6'));var path=require(_0xc9d0('0x7'));var sox=require(_0xc9d0('0x8'));var csv=require(_0xc9d0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d0('0xa'));var _=require(_0xc9d0('0xb'));var squel=require(_0xc9d0('0xc'));var crypto=require(_0xc9d0('0xd'));var jsforce=require(_0xc9d0('0xe'));var deskjs=require(_0xc9d0('0xf'));var toCsv=require(_0xc9d0('0x9'));var querystring=require(_0xc9d0('0x10'));var Papa=require(_0xc9d0('0x11'));var Redis=require(_0xc9d0('0x12'));var authService=require(_0xc9d0('0x13'));var qs=require(_0xc9d0('0x14'));var as=require(_0xc9d0('0x15'));var hardwareService=require(_0xc9d0('0x16'));var logger=require(_0xc9d0('0x17'))(_0xc9d0('0x18'));var utils=require(_0xc9d0('0x19'));var config=require(_0xc9d0('0x1a'));var licenseUtil=require(_0xc9d0('0x1b'));var db=require(_0xc9d0('0x1c'))['db'];config[_0xc9d0('0x1d')]=_[_0xc9d0('0x1e')](config[_0xc9d0('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc9d0('0x1d')]));require(_0xc9d0('0x1f'))[_0xc9d0('0x20')](socket);var jayson=require(_0xc9d0('0x21'));var client=jayson[_0xc9d0('0x22')][_0xc9d0('0x23')]({'port':0x232c});var client9002=jayson[_0xc9d0('0x22')][_0xc9d0('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x18eb1e,_0x31f48f,_0x1a29f6,_0x34c2c0){return new BPromise(function(_0x2e4b16,_0x214d63){var _0x539744=_0x34c2c0||client;return _0x539744[_0xc9d0('0x24')](_0x18eb1e,_0x1a29f6)['then'](function(_0x582e18){logger[_0xc9d0('0x25')](_0xc9d0('0x26'),_0x31f48f,'request\x20sent');logger[_0xc9d0('0x27')](_0xc9d0('0x28'),_0x31f48f,_0xc9d0('0x29'),JSON[_0xc9d0('0x2a')](_0x582e18));if(_0x582e18[_0xc9d0('0x2b')]){if(_0x582e18[_0xc9d0('0x2b')]['code']===0x1f4){logger[_0xc9d0('0x2b')](_0xc9d0('0x26'),_0x31f48f,_0x582e18['error']['message']);return _0x214d63(_0x582e18['error']['message']);}logger['error'](_0xc9d0('0x26'),_0x31f48f,_0x582e18[_0xc9d0('0x2b')][_0xc9d0('0x2c')]);return _0x2e4b16(_0x582e18[_0xc9d0('0x2b')]['message']);}else{logger[_0xc9d0('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x31f48f,_0xc9d0('0x29'));_0x2e4b16(_0x582e18[_0xc9d0('0x2d')]['message']);}})[_0xc9d0('0x2e')](function(_0xda2fd5){logger['error'](_0xc9d0('0x26'),_0x31f48f,_0xda2fd5);_0x214d63(_0xda2fd5);});});}function respondWithStatusCode(_0x3436db,_0x11d833){_0x11d833=_0x11d833||0xcc;return function(_0x1321a7){if(_0x1321a7){return _0x3436db[_0xc9d0('0x2f')](_0x11d833);}return _0x3436db[_0xc9d0('0x30')](_0x11d833)[_0xc9d0('0x31')]();};}function respondWithResult(_0x4987c1,_0x2c5fe8){_0x2c5fe8=_0x2c5fe8||0xc8;return function(_0x1ff8ef){if(_0x1ff8ef){return _0x4987c1[_0xc9d0('0x30')](_0x2c5fe8)[_0xc9d0('0x32')](_0x1ff8ef);}};}function respondWithFilteredResult(_0x3fe4ad,_0x132d66){return function(_0x3d4b80){if(_0x3d4b80){var _0x11f3ea=typeof _0x132d66[_0xc9d0('0x33')]===_0xc9d0('0x34')&&typeof _0x132d66[_0xc9d0('0x35')]===_0xc9d0('0x34');var _0x399adf=_0x3d4b80['count'];var _0xcdac5d=_0x11f3ea?0x0:_0x132d66[_0xc9d0('0x33')];var _0x7859bc=_0x11f3ea?_0x3d4b80['count']:_0x132d66[_0xc9d0('0x33')]+_0x132d66['limit'];var _0x53e60a;if(_0x7859bc>=_0x399adf){_0x7859bc=_0x399adf;_0x53e60a=0xc8;}else{_0x53e60a=0xce;}_0x3fe4ad['status'](_0x53e60a);return _0x3fe4ad[_0xc9d0('0x36')](_0xc9d0('0x37'),_0xcdac5d+'-'+_0x7859bc+'/'+_0x399adf)[_0xc9d0('0x32')](_0x3d4b80);}return null;};}function patchUpdates(_0x4baae8){return function(_0x3398f4){try{jsonpatch[_0xc9d0('0x38')](_0x3398f4,_0x4baae8,!![]);}catch(_0x1a07bf){return BPromise[_0xc9d0('0x39')](_0x1a07bf);}return _0x3398f4[_0xc9d0('0x3a')]();};}function saveUpdates(_0x2c5e29,_0xf22308){return function(_0x22a73c){if(_0x22a73c){return _0x22a73c[_0xc9d0('0x3b')](_0x2c5e29)['then'](function(_0x5638cf){return _0x5638cf;});}return null;};}function removeEntity(_0x509391,_0x59d515){return function(_0x18ac04){if(_0x18ac04){return _0x18ac04[_0xc9d0('0x3c')]()[_0xc9d0('0x3d')](function(){_0x509391['status'](0xcc)[_0xc9d0('0x31')]();});}};}function handleEntityNotFound(_0x50642c,_0x3a18d2){return function(_0x552297){if(!_0x552297){_0x50642c['sendStatus'](0x194);}return _0x552297;};}function handleError(_0x9fb9d7,_0x87e30b){_0x87e30b=_0x87e30b||0x1f4;return function(_0x527da2){logger['error'](_0x527da2[_0xc9d0('0x3e')]);if(_0x527da2[_0xc9d0('0x3f')]){delete _0x527da2['name'];}_0x9fb9d7[_0xc9d0('0x30')](_0x87e30b)['send'](_0x527da2);};}exports[_0xc9d0('0x40')]=function(_0x1bacf6,_0x492257){var _0x5e60dd={},_0x1b53ae={},_0x3e8651={'count':0x0,'rows':[]};var _0x4100ea=_[_0xc9d0('0x41')](db[_0xc9d0('0x42')][_0xc9d0('0x43')],function(_0x344782){return{'name':_0x344782[_0xc9d0('0x44')],'type':_0x344782['type']['key']};});_0x1b53ae['model']=_[_0xc9d0('0x41')](_0x4100ea,'name');_0x1b53ae['query']=_[_0xc9d0('0x45')](_0x1bacf6[_0xc9d0('0x46')]);_0x1b53ae['filters']=_[_0xc9d0('0x47')](_0x1b53ae[_0xc9d0('0x48')],_0x1b53ae[_0xc9d0('0x46')]);_0x5e60dd[_0xc9d0('0x49')]=_[_0xc9d0('0x47')](_0x1b53ae[_0xc9d0('0x48')],qs[_0xc9d0('0x4a')](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x4a')]));_0x5e60dd[_0xc9d0('0x49')]=_0x5e60dd[_0xc9d0('0x49')]['length']?_0x5e60dd['attributes']:_0x1b53ae[_0xc9d0('0x48')];if(!_0x1bacf6['query']['hasOwnProperty'](_0xc9d0('0x4b'))){_0x5e60dd[_0xc9d0('0x35')]=qs['limit'](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x35')]);_0x5e60dd[_0xc9d0('0x33')]=qs[_0xc9d0('0x33')](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x33')]);}_0x5e60dd[_0xc9d0('0x4c')]=qs['sort'](_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x4d')]);_0x5e60dd[_0xc9d0('0x4e')]=qs[_0xc9d0('0x4f')](_[_0xc9d0('0x50')](_0x1bacf6[_0xc9d0('0x46')],_0x1b53ae[_0xc9d0('0x4f')]),_0x4100ea);if(_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x51')]){_0x5e60dd[_0xc9d0('0x4e')]=_[_0xc9d0('0x52')](_0x5e60dd[_0xc9d0('0x4e')],{'$or':_[_0xc9d0('0x41')](_0x4100ea,function(_0x5ea6f3){if(_0x5ea6f3[_0xc9d0('0x53')]!=='VIRTUAL'){var _0x52fd1f={};_0x52fd1f[_0x5ea6f3[_0xc9d0('0x3f')]]={'$like':'%'+_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x51')]+'%'};return _0x52fd1f;}})});}_0x5e60dd=_[_0xc9d0('0x52')]({},_0x5e60dd,_0x1bacf6[_0xc9d0('0x54')]);var _0x2053ef={'where':_0x5e60dd[_0xc9d0('0x4e')]};return db['OpenchannelMessage'][_0xc9d0('0x55')](_0x2053ef)[_0xc9d0('0x3d')](function(_0x2c60dc){_0x3e8651[_0xc9d0('0x55')]=_0x2c60dc;if(_0x1bacf6[_0xc9d0('0x46')][_0xc9d0('0x56')]){_0x5e60dd[_0xc9d0('0x57')]=[{'all':!![]}];}return db[_0xc9d0('0x42')][_0xc9d0('0x58')](_0x5e60dd);})['then'](function(_0xcc7231){_0x3e8651[_0xc9d0('0x59')]=_0xcc7231;return _0x3e8651;})[_0xc9d0('0x3d')](respondWithFilteredResult(_0x492257,_0x5e60dd))['catch'](handleError(_0x492257,null));};exports[_0xc9d0('0x5a')]=function(_0xdc1fd5,_0x5749cf){var _0x326b63={'raw':!![],'where':{'id':_0xdc1fd5[_0xc9d0('0x5b')]['id']}},_0x1c4a52={};_0x1c4a52[_0xc9d0('0x48')]=_[_0xc9d0('0x45')](db[_0xc9d0('0x42')][_0xc9d0('0x43')]);_0x1c4a52[_0xc9d0('0x46')]=_['keys'](_0xdc1fd5[_0xc9d0('0x46')]);_0x1c4a52[_0xc9d0('0x4f')]=_[_0xc9d0('0x47')](_0x1c4a52[_0xc9d0('0x48')],_0x1c4a52[_0xc9d0('0x46')]);_0x326b63[_0xc9d0('0x49')]=_[_0xc9d0('0x47')](_0x1c4a52[_0xc9d0('0x48')],qs[_0xc9d0('0x4a')](_0xdc1fd5['query'][_0xc9d0('0x4a')]));_0x326b63[_0xc9d0('0x49')]=_0x326b63[_0xc9d0('0x49')][_0xc9d0('0x5c')]?_0x326b63[_0xc9d0('0x49')]:_0x1c4a52[_0xc9d0('0x48')];if(_0xdc1fd5['query']['includeAll']){_0x326b63[_0xc9d0('0x57')]=[{'all':!![]}];}_0x326b63=_['merge']({},_0x326b63,_0xdc1fd5[_0xc9d0('0x54')]);return db[_0xc9d0('0x42')][_0xc9d0('0x5d')](_0x326b63)[_0xc9d0('0x3d')](handleEntityNotFound(_0x5749cf,null))[_0xc9d0('0x3d')](respondWithResult(_0x5749cf,null))[_0xc9d0('0x2e')](handleError(_0x5749cf,null));};exports[_0xc9d0('0x5e')]=function(_0x4b18c2,_0x444134){return db['OpenchannelMessage']['create'](_0x4b18c2[_0xc9d0('0x5f')],{})[_0xc9d0('0x3d')](respondWithResult(_0x444134,0xc9))['catch'](handleError(_0x444134,null));};exports[_0xc9d0('0x3b')]=function(_0x5bf894,_0x5fa7c9){if(_0x5bf894[_0xc9d0('0x5f')]['id']){delete _0x5bf894['body']['id'];}return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0x5bf894[_0xc9d0('0x5b')]['id']}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x5fa7c9,null))[_0xc9d0('0x3d')](saveUpdates(_0x5bf894[_0xc9d0('0x5f')],null))[_0xc9d0('0x3d')](respondWithResult(_0x5fa7c9,null))[_0xc9d0('0x2e')](handleError(_0x5fa7c9,null));};exports[_0xc9d0('0x3c')]=function(_0xf71798,_0x1cb4aa){return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0xf71798[_0xc9d0('0x5b')]['id']}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x1cb4aa,null))[_0xc9d0('0x3d')](removeEntity(_0x1cb4aa,null))['catch'](handleError(_0x1cb4aa,null));};exports[_0xc9d0('0x60')]=function(_0x166ec7,_0x481c5a){return db[_0xc9d0('0x42')]['describe']()['then'](respondWithResult(_0x481c5a,null))['catch'](handleError(_0x481c5a,null));};var interaction_log=require(_0xc9d0('0x17'))(_0xc9d0('0x61'));exports['accept']=function(_0x4aedda,_0x47f568,_0x47cbad){var _0x15b4f1={'agent':{},'channel':_0xc9d0('0x62')};if(_0x4aedda[_0xc9d0('0x5f')]['id']){delete _0x4aedda[_0xc9d0('0x5f')]['id'];}_0x4aedda['body']['read']=!![];_0x4aedda['body'][_0xc9d0('0x63')]=moment()[_0xc9d0('0x64')](_0xc9d0('0x65'));_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')]=_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')]||_0x4aedda[_0xc9d0('0x67')]['id'];_0x15b4f1[_0xc9d0('0x68')]['id']=_0x4aedda['body'][_0xc9d0('0x66')];return db[_0xc9d0('0x42')]['find']({'where':{'id':_0x4aedda[_0xc9d0('0x5b')]['id'],'UserId':null}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x47f568,null))[_0xc9d0('0x3d')](saveUpdates(_0x4aedda[_0xc9d0('0x5f')],null))[_0xc9d0('0x3d')](function(_0x504e76){if(_0x504e76){_0x15b4f1[_0xc9d0('0x2c')]=_0x504e76['get']({'plain':!![]});return db[_0xc9d0('0x69')][_0xc9d0('0x5d')]({'where':{'id':_0x504e76['OpenchannelInteractionId']}});}return null;})[_0xc9d0('0x3d')](handleEntityNotFound(_0x47f568,null))[_0xc9d0('0x3d')](function(_0x472470){if(_0x472470){return _0x472470['update']({'UserId':_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x66')],'read1stAt':_[_0xc9d0('0x6a')](_0x472470[_0xc9d0('0x6b')])?moment()[_0xc9d0('0x64')](_0xc9d0('0x65')):undefined});}return null;})[_0xc9d0('0x3d')](function(_0x5de3f2){if(_0x5de3f2){_0x15b4f1[_0xc9d0('0x6c')]=_0x5de3f2[_0xc9d0('0x6d')]({'plain':!![]});interaction_log[_0xc9d0('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4aedda[_0xc9d0('0x67')]['id'],_0x4aedda[_0xc9d0('0x67')][_0xc9d0('0x3f')],_0x4aedda['user'][_0xc9d0('0x6e')],_0x15b4f1[_0xc9d0('0x6c')]['id'],_0x4aedda[_0xc9d0('0x5f')]?JSON[_0xc9d0('0x2a')](_0x4aedda[_0xc9d0('0x5f')]):_0xc9d0('0x6f'));return respondWithRpcPromise(_0xc9d0('0x70'),_0xc9d0('0x71'),_0x15b4f1);}return null;})[_0xc9d0('0x3d')](function(_0x196c1c){var _0x4725db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x196c1c[_0xc9d0('0x2c')][_0xc9d0('0x72')];return db[_0xc9d0('0x73')][_0xc9d0('0x46')](_0x4725db,{'type':db['Sequelize']['QueryTypes'][_0xc9d0('0x74')],'raw':!![]})['then'](function(_0x2c1d29){return _0x2c1d29;});})[_0xc9d0('0x3d')](function(_0x5db40e){if(_0x5db40e){_0x15b4f1[_0xc9d0('0x2c')]['contact']=_0x5db40e[0x0];if(!_0x4aedda['body'][_0xc9d0('0x66')])return;return db['User']['find']({'where':{'id':_0x4aedda['body'][_0xc9d0('0x66')],'role':_0xc9d0('0x68')},'attributes':['id',_0xc9d0('0x3f'),_0xc9d0('0x75'),'email',_0xc9d0('0x76')],'raw':!![]});}return null;})[_0xc9d0('0x3d')](function(_0xb6e446){if(!_0xb6e446)return null;_0x15b4f1[_0xc9d0('0x2c')]['agent']=_0xb6e446;return _0x15b4f1;})[_0xc9d0('0x3d')](function(_0x152e9e){if(_0x152e9e){if(_0x4aedda[_0xc9d0('0x5f')][_0xc9d0('0x77')]){_0x15b4f1[_0xc9d0('0x2c')]['interface']=util[_0xc9d0('0x64')]('SIP/%s',_0x4aedda[_0xc9d0('0x67')]['name']);_0x15b4f1[_0xc9d0('0x2c')][_0xc9d0('0x78')]=_0x15b4f1['channel'];_0x15b4f1[_0xc9d0('0x2c')][_0xc9d0('0x79')]=_0x15b4f1[_0xc9d0('0x78')];_0x15b4f1[_0xc9d0('0x2c')]['event']=_0xc9d0('0x7a');return respondWithRpcPromise(_0xc9d0('0x7b'),_0xc9d0('0x7b'),{'event':_0xc9d0('0x7c'),'message':_0x15b4f1[_0xc9d0('0x2c')]},client9002)[_0xc9d0('0x3d')](function(){return _0x15b4f1;});}return _0x15b4f1;}return null;})['then'](respondWithResult(_0x47f568,null))[_0xc9d0('0x2e')](handleError(_0x47f568,null));};var interaction_log=require('../../config/logger')(_0xc9d0('0x61'));exports[_0xc9d0('0x39')]=function(_0x312c99,_0x41e551,_0x1806a2){var _0x3037eb={'agent':{},'channel':_0xc9d0('0x62')};if(_0x312c99[_0xc9d0('0x5f')]['id']){delete _0x312c99[_0xc9d0('0x5f')]['id'];}_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')]=_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')]||_0x312c99[_0xc9d0('0x67')]['id'];_0x3037eb['agent']['id']=_0x312c99[_0xc9d0('0x5f')][_0xc9d0('0x66')];return db[_0xc9d0('0x42')][_0xc9d0('0x5d')]({'where':{'id':_0x312c99[_0xc9d0('0x5b')]['id'],'UserId':null}})[_0xc9d0('0x3d')](handleEntityNotFound(_0x41e551,null))[_0xc9d0('0x3d')](function(_0x149791){if(_0x149791){_0x3037eb[_0xc9d0('0x2c')]=_0x149791[_0xc9d0('0x6d')]({'plain':!![]});return db[_0xc9d0('0x69')]['find']({'where':{'id':_0x149791[_0xc9d0('0x7d')]}});}return null;})[_0xc9d0('0x3d')](handleEntityNotFound(_0x41e551,null))['then'](function(_0x1749c4){if(_0x1749c4){_0x3037eb['interaction']=_0x1749c4[_0xc9d0('0x6d')]({'plain':!![]});interaction_log[_0xc9d0('0x25')](_0xc9d0('0x7e'),_0x312c99[_0xc9d0('0x67')]['id'],_0x312c99[_0xc9d0('0x67')]['name'],_0x312c99['user'][_0xc9d0('0x6e')],_0x3037eb[_0xc9d0('0x6c')]['id'],_0x312c99['body']?JSON[_0xc9d0('0x2a')](_0x312c99[_0xc9d0('0x5f')]):_0xc9d0('0x6f'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x3037eb);}return null;})[_0xc9d0('0x3d')](function(_0x383083){var _0x5a658b=_0xc9d0('0x7f')+_0x383083[_0xc9d0('0x2c')][_0xc9d0('0x72')];return db[_0xc9d0('0x73')][_0xc9d0('0x46')](_0x5a658b,{'type':db[_0xc9d0('0x80')][_0xc9d0('0x81')][_0xc9d0('0x74')],'raw':!![]})[_0xc9d0('0x3d')](function(_0x5d4a32){return _0x5d4a32;});})[_0xc9d0('0x3d')](function(_0xa14d9a){if(_0xa14d9a){_0x3037eb[_0xc9d0('0x2c')][_0xc9d0('0x82')]=_0xa14d9a[0x0];if(!_0x312c99[_0xc9d0('0x5f')]['UserId'])return;return db[_0xc9d0('0x83')][_0xc9d0('0x5d')]({'where':{'id':_0x312c99['body'][_0xc9d0('0x66')],'role':_0xc9d0('0x68')},'attributes':['id',_0xc9d0('0x3f'),_0xc9d0('0x75'),_0xc9d0('0x84'),_0xc9d0('0x76')],'raw':!![]});}return null;})[_0xc9d0('0x3d')](function(_0x11993d){if(!_0x11993d)return null;_0x3037eb['message'][_0xc9d0('0x68')]=_0x11993d;return _0x3037eb;})['then'](function(_0x333de9){if(_0x333de9){_0x333de9[_0xc9d0('0x2c')]['interface']=util[_0xc9d0('0x64')](_0xc9d0('0x85'),_0x312c99[_0xc9d0('0x67')][_0xc9d0('0x3f')]);_0x333de9['message']['channel']=_0x3037eb[_0xc9d0('0x78')];_0x333de9['message'][_0xc9d0('0x79')]=_0x3037eb[_0xc9d0('0x78')];_0x333de9[_0xc9d0('0x2c')]['event']=_0xc9d0('0x39');respondWithRpcPromise(_0xc9d0('0x7b'),'EventManager',{'event':_0xc9d0('0x86'),'message':_0x333de9['message']},client9002);return _0x3037eb;}return null;})[_0xc9d0('0x3d')](respondWithResult(_0x41e551,null))['catch'](handleError(_0x41e551,null));};
\ No newline at end of file
+var _0xe2ef=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','fields','merge','find','create','body','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','fullname','email','SIP/%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xe2ef,0x194));var _0xfe2e=function(_0x2f6349,_0x473275){_0x2f6349=_0x2f6349-0x0;var _0x298043=_0xe2ef[_0x2f6349];return _0x298043;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2e('0x0'));var zipdir=require(_0xfe2e('0x1'));var jsonpatch=require(_0xfe2e('0x2'));var rp=require(_0xfe2e('0x3'));var moment=require('moment');var BPromise=require(_0xfe2e('0x4'));var Mustache=require(_0xfe2e('0x5'));var util=require(_0xfe2e('0x6'));var path=require(_0xfe2e('0x7'));var sox=require(_0xfe2e('0x8'));var csv=require(_0xfe2e('0x9'));var ejs=require(_0xfe2e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2e('0xb'));var squel=require(_0xfe2e('0xc'));var crypto=require(_0xfe2e('0xd'));var jsforce=require(_0xfe2e('0xe'));var deskjs=require(_0xfe2e('0xf'));var toCsv=require(_0xfe2e('0x9'));var querystring=require(_0xfe2e('0x10'));var Papa=require(_0xfe2e('0x11'));var Redis=require(_0xfe2e('0x12'));var authService=require(_0xfe2e('0x13'));var qs=require(_0xfe2e('0x14'));var as=require(_0xfe2e('0x15'));var hardwareService=require(_0xfe2e('0x16'));var logger=require(_0xfe2e('0x17'))('api');var utils=require(_0xfe2e('0x18'));var config=require(_0xfe2e('0x19'));var licenseUtil=require(_0xfe2e('0x1a'));var db=require(_0xfe2e('0x1b'))['db'];config[_0xfe2e('0x1c')]=_[_0xfe2e('0x1d')](config[_0xfe2e('0x1c')],{'host':_0xfe2e('0x1e'),'port':0x18eb});var socket=require(_0xfe2e('0x1f'))(new Redis(config[_0xfe2e('0x1c')]));require(_0xfe2e('0x20'))[_0xfe2e('0x21')](socket);var jayson=require(_0xfe2e('0x22'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0xfe2e('0x23')]({'port':0x232a});function respondWithRpcPromise(_0xd09a96,_0x3a7d49,_0x2e71a3,_0x5e0bd5){return new BPromise(function(_0x38aecb,_0x358d4d){var _0x135245=_0x5e0bd5||client;return _0x135245[_0xfe2e('0x24')](_0xd09a96,_0x2e71a3)[_0xfe2e('0x25')](function(_0x1a869e){logger[_0xfe2e('0x26')](_0xfe2e('0x27'),_0x3a7d49,_0xfe2e('0x28'));logger[_0xfe2e('0x29')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3a7d49,_0xfe2e('0x28'),JSON['stringify'](_0x1a869e));if(_0x1a869e[_0xfe2e('0x2a')]){if(_0x1a869e['error'][_0xfe2e('0x2b')]===0x1f4){logger[_0xfe2e('0x2a')](_0xfe2e('0x27'),_0x3a7d49,_0x1a869e[_0xfe2e('0x2a')][_0xfe2e('0x2c')]);return _0x358d4d(_0x1a869e[_0xfe2e('0x2a')]['message']);}logger[_0xfe2e('0x2a')](_0xfe2e('0x27'),_0x3a7d49,_0x1a869e['error'][_0xfe2e('0x2c')]);return _0x38aecb(_0x1a869e[_0xfe2e('0x2a')][_0xfe2e('0x2c')]);}else{logger['info'](_0xfe2e('0x27'),_0x3a7d49,_0xfe2e('0x28'));_0x38aecb(_0x1a869e[_0xfe2e('0x2d')][_0xfe2e('0x2c')]);}})[_0xfe2e('0x2e')](function(_0x5f39dc){logger['error'](_0xfe2e('0x27'),_0x3a7d49,_0x5f39dc);_0x358d4d(_0x5f39dc);});});}function respondWithStatusCode(_0x9e7c4f,_0x5e6555){_0x5e6555=_0x5e6555||0xcc;return function(_0x339e70){if(_0x339e70){return _0x9e7c4f[_0xfe2e('0x2f')](_0x5e6555);}return _0x9e7c4f[_0xfe2e('0x30')](_0x5e6555)[_0xfe2e('0x31')]();};}function respondWithResult(_0x55393d,_0x4a9d60){_0x4a9d60=_0x4a9d60||0xc8;return function(_0x1f9b0c){if(_0x1f9b0c){return _0x55393d['status'](_0x4a9d60)['json'](_0x1f9b0c);}};}function respondWithFilteredResult(_0x4737e4,_0x1c7f55){return function(_0xe4c817){if(_0xe4c817){var _0x2e1fb3=typeof _0x1c7f55[_0xfe2e('0x32')]==='undefined'&&typeof _0x1c7f55[_0xfe2e('0x33')]===_0xfe2e('0x34');var _0x5523bb=_0xe4c817[_0xfe2e('0x35')];var _0x3bc47d=_0x2e1fb3?0x0:_0x1c7f55[_0xfe2e('0x32')];var _0x13abd8=_0x2e1fb3?_0xe4c817[_0xfe2e('0x35')]:_0x1c7f55[_0xfe2e('0x32')]+_0x1c7f55['limit'];var _0x29c6c5;if(_0x13abd8>=_0x5523bb){_0x13abd8=_0x5523bb;_0x29c6c5=0xc8;}else{_0x29c6c5=0xce;}_0x4737e4['status'](_0x29c6c5);return _0x4737e4[_0xfe2e('0x36')](_0xfe2e('0x37'),_0x3bc47d+'-'+_0x13abd8+'/'+_0x5523bb)[_0xfe2e('0x38')](_0xe4c817);}return null;};}function patchUpdates(_0x563c9a){return function(_0x107ee0){try{jsonpatch[_0xfe2e('0x39')](_0x107ee0,_0x563c9a,!![]);}catch(_0x3b3207){return BPromise[_0xfe2e('0x3a')](_0x3b3207);}return _0x107ee0[_0xfe2e('0x3b')]();};}function saveUpdates(_0x4f6dfd,_0x28a030){return function(_0x2cd8ea){if(_0x2cd8ea){return _0x2cd8ea[_0xfe2e('0x3c')](_0x4f6dfd)[_0xfe2e('0x25')](function(_0x270594){return _0x270594;});}return null;};}function removeEntity(_0x182524,_0x785f60){return function(_0x2062df){if(_0x2062df){return _0x2062df[_0xfe2e('0x3d')]()[_0xfe2e('0x25')](function(){_0x182524[_0xfe2e('0x30')](0xcc)[_0xfe2e('0x31')]();});}};}function handleEntityNotFound(_0x5dd2a6,_0x1616a0){return function(_0x103dca){if(!_0x103dca){_0x5dd2a6['sendStatus'](0x194);}return _0x103dca;};}function handleError(_0x2dc0b5,_0x4f8a34){_0x4f8a34=_0x4f8a34||0x1f4;return function(_0x2a8ef9){logger[_0xfe2e('0x2a')](_0x2a8ef9[_0xfe2e('0x3e')]);if(_0x2a8ef9[_0xfe2e('0x3f')]){delete _0x2a8ef9[_0xfe2e('0x3f')];}_0x2dc0b5[_0xfe2e('0x30')](_0x4f8a34)[_0xfe2e('0x40')](_0x2a8ef9);};}exports[_0xfe2e('0x41')]=function(_0x49064c,_0x43ea98){var _0x2383ac={},_0x5b5e59={},_0x158f7b={'count':0x0,'rows':[]};var _0x463a9a=_[_0xfe2e('0x42')](db[_0xfe2e('0x43')][_0xfe2e('0x44')],function(_0x5232c7){return{'name':_0x5232c7['fieldName'],'type':_0x5232c7[_0xfe2e('0x45')][_0xfe2e('0x46')]};});_0x5b5e59[_0xfe2e('0x47')]=_['map'](_0x463a9a,'name');_0x5b5e59['query']=_['keys'](_0x49064c[_0xfe2e('0x48')]);_0x5b5e59[_0xfe2e('0x49')]=_[_0xfe2e('0x4a')](_0x5b5e59[_0xfe2e('0x47')],_0x5b5e59[_0xfe2e('0x48')]);_0x2383ac[_0xfe2e('0x4b')]=_[_0xfe2e('0x4a')](_0x5b5e59[_0xfe2e('0x47')],qs['fields'](_0x49064c['query']['fields']));_0x2383ac[_0xfe2e('0x4b')]=_0x2383ac[_0xfe2e('0x4b')][_0xfe2e('0x4c')]?_0x2383ac[_0xfe2e('0x4b')]:_0x5b5e59[_0xfe2e('0x47')];if(!_0x49064c['query'][_0xfe2e('0x4d')](_0xfe2e('0x4e'))){_0x2383ac[_0xfe2e('0x33')]=qs[_0xfe2e('0x33')](_0x49064c['query'][_0xfe2e('0x33')]);_0x2383ac[_0xfe2e('0x32')]=qs[_0xfe2e('0x32')](_0x49064c[_0xfe2e('0x48')]['offset']);}_0x2383ac[_0xfe2e('0x4f')]=qs[_0xfe2e('0x50')](_0x49064c[_0xfe2e('0x48')][_0xfe2e('0x50')]);_0x2383ac[_0xfe2e('0x51')]=qs[_0xfe2e('0x49')](_[_0xfe2e('0x52')](_0x49064c['query'],_0x5b5e59[_0xfe2e('0x49')]),_0x463a9a);if(_0x49064c[_0xfe2e('0x48')][_0xfe2e('0x53')]){_0x2383ac[_0xfe2e('0x51')]=_['merge'](_0x2383ac[_0xfe2e('0x51')],{'$or':_[_0xfe2e('0x42')](_0x463a9a,function(_0x2eac3c){if(_0x2eac3c['type']!==_0xfe2e('0x54')){var _0x36c978={};_0x36c978[_0x2eac3c['name']]={'$like':'%'+_0x49064c[_0xfe2e('0x48')][_0xfe2e('0x53')]+'%'};return _0x36c978;}})});}_0x2383ac=_['merge']({},_0x2383ac,_0x49064c[_0xfe2e('0x55')]);var _0x4e44eb={'where':_0x2383ac[_0xfe2e('0x51')]};return db[_0xfe2e('0x43')][_0xfe2e('0x35')](_0x4e44eb)[_0xfe2e('0x25')](function(_0x1b4e2e){_0x158f7b[_0xfe2e('0x35')]=_0x1b4e2e;if(_0x49064c[_0xfe2e('0x48')][_0xfe2e('0x56')]){_0x2383ac[_0xfe2e('0x57')]=[{'all':!![]}];}return db[_0xfe2e('0x43')]['findAll'](_0x2383ac);})[_0xfe2e('0x25')](function(_0x28f942){_0x158f7b[_0xfe2e('0x58')]=_0x28f942;return _0x158f7b;})[_0xfe2e('0x25')](respondWithFilteredResult(_0x43ea98,_0x2383ac))['catch'](handleError(_0x43ea98,null));};exports[_0xfe2e('0x59')]=function(_0x3548e3,_0x33cc82){var _0x3a31bd={'raw':!![],'where':{'id':_0x3548e3[_0xfe2e('0x5a')]['id']}},_0x4d8614={};_0x4d8614[_0xfe2e('0x47')]=_[_0xfe2e('0x5b')](db['OpenchannelMessage'][_0xfe2e('0x44')]);_0x4d8614[_0xfe2e('0x48')]=_[_0xfe2e('0x5b')](_0x3548e3['query']);_0x4d8614['filters']=_[_0xfe2e('0x4a')](_0x4d8614[_0xfe2e('0x47')],_0x4d8614[_0xfe2e('0x48')]);_0x3a31bd[_0xfe2e('0x4b')]=_[_0xfe2e('0x4a')](_0x4d8614['model'],qs[_0xfe2e('0x5c')](_0x3548e3[_0xfe2e('0x48')][_0xfe2e('0x5c')]));_0x3a31bd[_0xfe2e('0x4b')]=_0x3a31bd[_0xfe2e('0x4b')][_0xfe2e('0x4c')]?_0x3a31bd[_0xfe2e('0x4b')]:_0x4d8614[_0xfe2e('0x47')];if(_0x3548e3[_0xfe2e('0x48')][_0xfe2e('0x56')]){_0x3a31bd[_0xfe2e('0x57')]=[{'all':!![]}];}_0x3a31bd=_[_0xfe2e('0x5d')]({},_0x3a31bd,_0x3548e3['options']);return db[_0xfe2e('0x43')][_0xfe2e('0x5e')](_0x3a31bd)[_0xfe2e('0x25')](handleEntityNotFound(_0x33cc82,null))[_0xfe2e('0x25')](respondWithResult(_0x33cc82,null))[_0xfe2e('0x2e')](handleError(_0x33cc82,null));};exports[_0xfe2e('0x5f')]=function(_0xe875b1,_0x5e833c){return db[_0xfe2e('0x43')]['create'](_0xe875b1[_0xfe2e('0x60')],{})[_0xfe2e('0x25')](respondWithResult(_0x5e833c,0xc9))[_0xfe2e('0x2e')](handleError(_0x5e833c,null));};exports[_0xfe2e('0x3c')]=function(_0x9c9d36,_0x82af23){if(_0x9c9d36[_0xfe2e('0x60')]['id']){delete _0x9c9d36[_0xfe2e('0x60')]['id'];}return db['OpenchannelMessage'][_0xfe2e('0x5e')]({'where':{'id':_0x9c9d36['params']['id']}})[_0xfe2e('0x25')](handleEntityNotFound(_0x82af23,null))['then'](saveUpdates(_0x9c9d36[_0xfe2e('0x60')],null))['then'](respondWithResult(_0x82af23,null))[_0xfe2e('0x2e')](handleError(_0x82af23,null));};exports[_0xfe2e('0x3d')]=function(_0x1ad4af,_0x3d7d1a){return db[_0xfe2e('0x43')][_0xfe2e('0x5e')]({'where':{'id':_0x1ad4af[_0xfe2e('0x5a')]['id']}})[_0xfe2e('0x25')](handleEntityNotFound(_0x3d7d1a,null))[_0xfe2e('0x25')](removeEntity(_0x3d7d1a,null))[_0xfe2e('0x2e')](handleError(_0x3d7d1a,null));};exports[_0xfe2e('0x61')]=function(_0x5eeaf8,_0x2744fa){return db[_0xfe2e('0x43')]['describe']()[_0xfe2e('0x25')](respondWithResult(_0x2744fa,null))['catch'](handleError(_0x2744fa,null));};var interaction_log=require(_0xfe2e('0x17'))(_0xfe2e('0x62'));exports[_0xfe2e('0x63')]=function(_0x4b05d4,_0xb760f2,_0x3ad0da){var _0x35a60d={'agent':{},'channel':'openchannel'};if(_0x4b05d4[_0xfe2e('0x60')]['id']){delete _0x4b05d4['body']['id'];}_0x4b05d4[_0xfe2e('0x60')][_0xfe2e('0x64')]=!![];_0x4b05d4[_0xfe2e('0x60')]['readAt']=moment()[_0xfe2e('0x65')](_0xfe2e('0x66'));_0x4b05d4[_0xfe2e('0x60')]['UserId']=_0x4b05d4['body'][_0xfe2e('0x67')]||_0x4b05d4[_0xfe2e('0x68')]['id'];_0x35a60d[_0xfe2e('0x69')]['id']=_0x4b05d4[_0xfe2e('0x60')][_0xfe2e('0x67')];return db[_0xfe2e('0x43')]['find']({'where':{'id':_0x4b05d4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xb760f2,null))[_0xfe2e('0x25')](saveUpdates(_0x4b05d4[_0xfe2e('0x60')],null))[_0xfe2e('0x25')](function(_0x380dd6){if(_0x380dd6){_0x35a60d[_0xfe2e('0x2c')]=_0x380dd6[_0xfe2e('0x6a')]({'plain':!![]});return db['OpenchannelInteraction'][_0xfe2e('0x5e')]({'where':{'id':_0x380dd6[_0xfe2e('0x6b')]}});}return null;})[_0xfe2e('0x25')](handleEntityNotFound(_0xb760f2,null))[_0xfe2e('0x25')](function(_0x3b1978){if(_0x3b1978){return _0x3b1978[_0xfe2e('0x3c')]({'UserId':_0x4b05d4['body']['UserId'],'read1stAt':_['isNil'](_0x3b1978[_0xfe2e('0x6c')])?moment()[_0xfe2e('0x65')](_0xfe2e('0x66')):undefined});}return null;})[_0xfe2e('0x25')](function(_0x3036d6){if(_0x3036d6){_0x35a60d['interaction']=_0x3036d6['get']({'plain':!![]});interaction_log['info'](_0xfe2e('0x6d'),_0x4b05d4[_0xfe2e('0x68')]['id'],_0x4b05d4[_0xfe2e('0x68')]['name'],_0x4b05d4['user']['role'],_0x35a60d[_0xfe2e('0x6e')]['id'],_0x4b05d4[_0xfe2e('0x60')]?JSON[_0xfe2e('0x6f')](_0x4b05d4[_0xfe2e('0x60')]):_0xfe2e('0x70'));return respondWithRpcPromise(_0xfe2e('0x71'),_0xfe2e('0x72'),_0x35a60d);}return null;})[_0xfe2e('0x25')](function(_0x3329b8){var _0x4c758f=_0xfe2e('0x73')+_0x3329b8[_0xfe2e('0x2c')][_0xfe2e('0x74')];return db['sequelize'][_0xfe2e('0x48')](_0x4c758f,{'type':db[_0xfe2e('0x75')][_0xfe2e('0x76')][_0xfe2e('0x77')],'raw':!![]})[_0xfe2e('0x25')](function(_0x34cadc){return _0x34cadc;});})[_0xfe2e('0x25')](function(_0x1f0d32){if(_0x1f0d32){_0x35a60d['message'][_0xfe2e('0x78')]=_0x1f0d32[0x0];if(!_0x4b05d4['body'][_0xfe2e('0x67')])return;return db[_0xfe2e('0x79')]['find']({'where':{'id':_0x4b05d4[_0xfe2e('0x60')][_0xfe2e('0x67')],'role':_0xfe2e('0x69')},'attributes':['id','name','fullname','email',_0xfe2e('0x7a')],'raw':!![]});}return null;})[_0xfe2e('0x25')](function(_0x1f0802){if(!_0x1f0802)return null;_0x35a60d[_0xfe2e('0x2c')][_0xfe2e('0x69')]=_0x1f0802;return _0x35a60d;})[_0xfe2e('0x25')](function(_0xda3383){if(_0xda3383){if(_0x4b05d4['body'][_0xfe2e('0x7b')]){_0x35a60d[_0xfe2e('0x2c')][_0xfe2e('0x7c')]=util[_0xfe2e('0x65')]('SIP/%s',_0x4b05d4[_0xfe2e('0x68')][_0xfe2e('0x3f')]);_0x35a60d[_0xfe2e('0x2c')][_0xfe2e('0x7d')]=_0x35a60d[_0xfe2e('0x7d')];_0x35a60d[_0xfe2e('0x2c')][_0xfe2e('0x7e')]=_0x35a60d[_0xfe2e('0x7d')];_0x35a60d[_0xfe2e('0x2c')]['event']=_0xfe2e('0x63');return respondWithRpcPromise(_0xfe2e('0x7f'),'EventManager',{'event':_0xfe2e('0x80'),'message':_0x35a60d[_0xfe2e('0x2c')]},client9002)[_0xfe2e('0x25')](function(){return _0x35a60d;});}return _0x35a60d;}return null;})['then'](respondWithResult(_0xb760f2,null))[_0xfe2e('0x2e')](handleError(_0xb760f2,null));};var interaction_log=require(_0xfe2e('0x17'))(_0xfe2e('0x62'));exports[_0xfe2e('0x3a')]=function(_0x3c8584,_0x2255fe,_0x49dd34){var _0xd369ac={'agent':{},'channel':'openchannel'};if(_0x3c8584['body']['id']){delete _0x3c8584[_0xfe2e('0x60')]['id'];}_0x3c8584[_0xfe2e('0x60')][_0xfe2e('0x67')]=_0x3c8584['body'][_0xfe2e('0x67')]||_0x3c8584['user']['id'];_0xd369ac['agent']['id']=_0x3c8584[_0xfe2e('0x60')]['UserId'];return db[_0xfe2e('0x43')][_0xfe2e('0x5e')]({'where':{'id':_0x3c8584[_0xfe2e('0x5a')]['id'],'UserId':null}})[_0xfe2e('0x25')](handleEntityNotFound(_0x2255fe,null))[_0xfe2e('0x25')](function(_0x206df6){if(_0x206df6){_0xd369ac[_0xfe2e('0x2c')]=_0x206df6[_0xfe2e('0x6a')]({'plain':!![]});return db[_0xfe2e('0x81')][_0xfe2e('0x5e')]({'where':{'id':_0x206df6[_0xfe2e('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x2255fe,null))['then'](function(_0x48d0f1){if(_0x48d0f1){_0xd369ac['interaction']=_0x48d0f1[_0xfe2e('0x6a')]({'plain':!![]});interaction_log[_0xfe2e('0x26')](_0xfe2e('0x82'),_0x3c8584[_0xfe2e('0x68')]['id'],_0x3c8584[_0xfe2e('0x68')][_0xfe2e('0x3f')],_0x3c8584['user'][_0xfe2e('0x83')],_0xd369ac[_0xfe2e('0x6e')]['id'],_0x3c8584[_0xfe2e('0x60')]?JSON[_0xfe2e('0x6f')](_0x3c8584[_0xfe2e('0x60')]):'null');return respondWithRpcPromise(_0xfe2e('0x84'),_0xfe2e('0x85'),_0xd369ac);}return null;})[_0xfe2e('0x25')](function(_0x216b04){var _0x44e332='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x216b04['message'][_0xfe2e('0x74')];return db[_0xfe2e('0x86')][_0xfe2e('0x48')](_0x44e332,{'type':db[_0xfe2e('0x75')][_0xfe2e('0x76')][_0xfe2e('0x77')],'raw':!![]})['then'](function(_0x3954fb){return _0x3954fb;});})[_0xfe2e('0x25')](function(_0xff4616){if(_0xff4616){_0xd369ac['message'][_0xfe2e('0x78')]=_0xff4616[0x0];if(!_0x3c8584[_0xfe2e('0x60')][_0xfe2e('0x67')])return;return db[_0xfe2e('0x79')][_0xfe2e('0x5e')]({'where':{'id':_0x3c8584[_0xfe2e('0x60')][_0xfe2e('0x67')],'role':_0xfe2e('0x69')},'attributes':['id','name',_0xfe2e('0x87'),_0xfe2e('0x88'),_0xfe2e('0x7a')],'raw':!![]});}return null;})[_0xfe2e('0x25')](function(_0x26d4f1){if(!_0x26d4f1)return null;_0xd369ac[_0xfe2e('0x2c')][_0xfe2e('0x69')]=_0x26d4f1;return _0xd369ac;})[_0xfe2e('0x25')](function(_0x4ffc79){if(_0x4ffc79){_0x4ffc79[_0xfe2e('0x2c')][_0xfe2e('0x7c')]=util[_0xfe2e('0x65')](_0xfe2e('0x89'),_0x3c8584['user'][_0xfe2e('0x3f')]);_0x4ffc79[_0xfe2e('0x2c')][_0xfe2e('0x7d')]=_0xd369ac[_0xfe2e('0x7d')];_0x4ffc79[_0xfe2e('0x2c')][_0xfe2e('0x7e')]=_0xd369ac[_0xfe2e('0x7d')];_0x4ffc79[_0xfe2e('0x2c')]['event']=_0xfe2e('0x3a');respondWithRpcPromise(_0xfe2e('0x7f'),_0xfe2e('0x7f'),{'event':'rejectmessage','message':_0x4ffc79[_0xfe2e('0x2c')]},client9002);return _0xd369ac;}return null;})['then'](respondWithResult(_0x2255fe,null))['catch'](handleError(_0x2255fe,null));};
\ No newline at end of file
index 16976b0..6165d94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d11=['emit','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x1846ef,_0xee69c9){var _0x21cfcc=function(_0xfd80f2){while(--_0xfd80f2){_0x1846ef['push'](_0x1846ef['shift']());}};_0x21cfcc(++_0xee69c9);}(_0x9d11,0x13b));var _0x19d1=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x9d11[_0x37ae26];return _0x1b1902;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x19d1('0x0'))['db'][_0x19d1('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x19d1('0x2')](0x0);var events={'afterCreate':_0x19d1('0x3'),'afterUpdate':'update','afterDestroy':_0x19d1('0x4')};function emitEvent(_0x2e7abd){return function(_0x3fc25f,_0x18a2ff,_0x1bb239){OpenchannelMessageEvents[_0x19d1('0x5')](_0x2e7abd+':'+_0x3fc25f['id'],_0x3fc25f);OpenchannelMessageEvents['emit'](_0x2e7abd,_0x3fc25f);_0x1bb239(null);};}for(var e in events){if(events[_0x19d1('0x6')](e)){var event=events[e];OpenchannelMessage[_0x19d1('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x67c6=['save','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage','setMaxListeners'];(function(_0x31d276,_0x1b1915){var _0x4e41c5=function(_0x553583){while(--_0x553583){_0x31d276['push'](_0x31d276['shift']());}};_0x4e41c5(++_0x1b1915);}(_0x67c6,0x147));var _0x667c=function(_0x4232f6,_0x224caf){_0x4232f6=_0x4232f6-0x0;var _0x5f295f=_0x67c6[_0x4232f6];return _0x5f295f;};'use strict';var EventEmitter=require(_0x667c('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x667c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x667c('0x2')](0x0);var events={'afterCreate':_0x667c('0x3'),'afterUpdate':_0x667c('0x4'),'afterDestroy':_0x667c('0x5')};function emitEvent(_0xa73eda){return function(_0x2814f9,_0x1cae98,_0x29bbc7){OpenchannelMessageEvents[_0x667c('0x6')](_0xa73eda+':'+_0x2814f9['id'],_0x2814f9);OpenchannelMessageEvents[_0x667c('0x6')](_0xa73eda,_0x2814f9);_0x29bbc7(null);};}for(var e in events){if(events[_0x667c('0x7')](e)){var event=events[e];OpenchannelMessage[_0x667c('0x8')](e,emitEvent(event));}}module[_0x667c('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
index 26fe41c..c8ca7be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['fti_openchannel_messages','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages'];(function(_0x300473,_0x1c0f1a){var _0x4ee785=function(_0xd66e75){while(--_0xd66e75){_0x300473['push'](_0x300473['shift']());}};_0x4ee785(++_0x1c0f1a);}(_0x14a0,0x8e));var _0x014a=function(_0x24e7c0,_0x2bbaf9){_0x24e7c0=_0x24e7c0-0x0;var _0x1f20c9=_0x14a0[_0x24e7c0];return _0x1f20c9;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var logger=require(_0x014a('0x1'))(_0x014a('0x2'));var moment=require(_0x014a('0x3'));var BPromise=require(_0x014a('0x4'));var rp=require(_0x014a('0x5'));var fs=require('fs');var path=require(_0x014a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x014a('0x7'));module[_0x014a('0x8')]=function(_0x38a22c,_0x5ec84d){return _0x38a22c['define'](_0x014a('0x9'),attributes,{'tableName':_0x014a('0xa'),'paranoid':![],'indexes':[{'name':_0x014a('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2519e3,_0x4f5506,_0x490ea2){var _0x5aa52f=_0x38a22c['models'];var _0x330469=_0x2519e3['get']({'plain':!![]});if(_0x330469[_0x014a('0xc')][_0x014a('0xd')]()==='in'||_0x330469['direction'][_0x014a('0xd')]()===_0x014a('0xe')&&!_0x330469[_0x014a('0xf')]&&!_[_0x014a('0x10')](_0x330469[_0x014a('0x11')])){_0x5aa52f[_0x014a('0x12')][_0x014a('0x13')]({'where':{'id':_0x330469[_0x014a('0x14')]}})[_0x014a('0x15')](function(_0x71535d){if(_0x71535d){_0x71535d[_0x014a('0x16')]({'lastMsgAt':_0x330469[_0x014a('0x17')],'lastMsgDirection':_0x330469['direction'][_0x014a('0xd')]()});}})[_0x014a('0x18')](function(_0x59f207){console[_0x014a('0x19')](_0x59f207);});}if(_0x330469[_0x014a('0xc')]==='out'&&!_0x330469[_0x014a('0xf')]){var _0x17e4be;_0x5aa52f[_0x014a('0x1a')][_0x014a('0x1b')]()[_0x014a('0x15')](function(_0x12d339){return _0x5aa52f[_0x014a('0x1c')][_0x014a('0x1d')]({'where':{'id':_0x330469[_0x014a('0x1e')]},'include':[{'model':_0x5aa52f[_0x014a('0x12')],'as':_0x014a('0x1f'),'where':{'id':_0x330469[_0x014a('0x14')]},'limit':0x1,'include':[{'model':_0x5aa52f[_0x014a('0x1a')],'as':_0x014a('0x20'),'attributes':_['keys'](_0x12d339)}]}]});})[_0x014a('0x15')](function(_0x109a9c){_0x17e4be=_0x109a9c[_0x014a('0x21')]({'plain':!![]});if(_0x17e4be&&_0x17e4be[_0x014a('0x22')]){logger[_0x014a('0x23')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x26')](_0x014a('0x27'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x17e4be[_0x014a('0x1f')]&&_0x17e4be['Interactions'][_0x014a('0x28')]){_0x330469[_0x014a('0x29')]=_[_0x014a('0x2a')](_0x17e4be[_0x014a('0x1f')][0x0],_0x014a('0x20'));_0x330469[_0x014a('0x20')]=_0x17e4be[_0x014a('0x1f')][0x0][_0x014a('0x20')];}var _0x4f5506={'method':'POST','uri':encodeURI(_0x17e4be[_0x014a('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4f5506['method']){case _0x014a('0x2b'):_0x4f5506['qs']=_0x330469;break;case _0x014a('0x2c'):_0x4f5506['body']=_0x330469;break;}return rp(_0x4f5506)['then'](function(_0x9a901f){logger[_0x014a('0x23')](_0x014a('0x24'),'afterCreate',util[_0x014a('0x26')](_0x014a('0x2d'),_0x330469['id'],_0x17e4be['replyUri']));if(_0x9a901f[_0x014a('0x2e')][_0x014a('0x2f')]&&_0x9a901f['body']['threadId']!=_0x330469[_0x014a('0x29')][_0x014a('0x2f')]){return _0x5aa52f[_0x014a('0x12')][_0x014a('0x16')]({'threadId':_0x9a901f['body'][_0x014a('0x2f')]},{'logging':!![],'where':{'id':_0x330469[_0x014a('0x29')]['id']}});}else{return;}})[_0x014a('0x15')](function(){return _0x2519e3[_0x014a('0x16')]({'read':!![]});})[_0x014a('0x18')](function(_0x1eb007){logger[_0x014a('0x19')](_0x014a('0x24'),_0x014a('0x25'),util[_0x014a('0x30')](_0x1eb007,{'showHidden':![],'depth':null}));_0x490ea2();});}else{_0x490ea2();}})[_0x014a('0x31')](function(){_0x490ea2();});}else{_0x490ea2();}}},'charset':'utf8mb4','collate':_0x014a('0x32')});};
\ No newline at end of file
+var _0x7708=['update','createdAt','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','api','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then'];(function(_0x51170e,_0x2f406b){var _0x3beeeb=function(_0xd14308){while(--_0xd14308){_0x51170e['push'](_0x51170e['shift']());}};_0x3beeeb(++_0x2f406b);}(_0x7708,0x188));var _0x8770=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x7708[_0x515afd];return _0x536d53;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[{'name':_0x8770('0x9'),'fields':[_0x8770('0xa')],'type':_0x8770('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fc512,_0x396322,_0x2ca830){var _0x3f357a=_0x50bab7['models'];var _0x390af0=_0x4fc512[_0x8770('0xc')]({'plain':!![]});if(_0x390af0[_0x8770('0xd')][_0x8770('0xe')]()==='in'||_0x390af0['direction'][_0x8770('0xe')]()===_0x8770('0xf')&&!_0x390af0[_0x8770('0x10')]&&!_['isNil'](_0x390af0[_0x8770('0x11')])){_0x3f357a[_0x8770('0x12')][_0x8770('0x13')]({'where':{'id':_0x390af0[_0x8770('0x14')]}})[_0x8770('0x15')](function(_0x12a06f){if(_0x12a06f){_0x12a06f[_0x8770('0x16')]({'lastMsgAt':_0x390af0[_0x8770('0x17')],'lastMsgDirection':_0x390af0['direction'][_0x8770('0xe')]()});}})[_0x8770('0x18')](function(_0x5dd4e7){console[_0x8770('0x19')](_0x5dd4e7);});}if(_0x390af0['direction']===_0x8770('0xf')&&!_0x390af0['secret']){var _0x5b4716;_0x3f357a['CmContact'][_0x8770('0x1a')]()[_0x8770('0x15')](function(_0x17b634){return _0x3f357a[_0x8770('0x1b')]['find']({'where':{'id':_0x390af0['OpenchannelAccountId']},'include':[{'model':_0x3f357a[_0x8770('0x12')],'as':_0x8770('0x1c'),'where':{'id':_0x390af0[_0x8770('0x14')]},'limit':0x1,'include':[{'model':_0x3f357a[_0x8770('0x1d')],'as':_0x8770('0x1e'),'attributes':_['keys'](_0x17b634)}]}]});})[_0x8770('0x15')](function(_0x1234dd){_0x5b4716=_0x1234dd[_0x8770('0xc')]({'plain':!![]});if(_0x5b4716&&_0x5b4716[_0x8770('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x22'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0x5b4716[_0x8770('0x1c')]&&_0x5b4716[_0x8770('0x1c')]['length']){_0x390af0[_0x8770('0x23')]=_[_0x8770('0x24')](_0x5b4716[_0x8770('0x1c')][0x0],_0x8770('0x1e'));_0x390af0['Contact']=_0x5b4716[_0x8770('0x1c')][0x0]['Contact'];}var _0x396322={'method':_0x8770('0x25'),'uri':encodeURI(_0x5b4716[_0x8770('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x396322[_0x8770('0x26')]){case _0x8770('0x27'):_0x396322['qs']=_0x390af0;break;case _0x8770('0x25'):_0x396322[_0x8770('0xa')]=_0x390af0;break;}return rp(_0x396322)[_0x8770('0x15')](function(_0xb3f4aa){logger[_0x8770('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x29'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0xb3f4aa[_0x8770('0xa')][_0x8770('0x2a')]&&_0xb3f4aa['body']['threadId']!=_0x390af0[_0x8770('0x23')][_0x8770('0x2a')]){return _0x3f357a[_0x8770('0x12')][_0x8770('0x16')]({'threadId':_0xb3f4aa[_0x8770('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x390af0['Interaction']['id']}});}else{return;}})[_0x8770('0x15')](function(){return _0x4fc512[_0x8770('0x16')]({'read':!![]});})[_0x8770('0x18')](function(_0x2c2c77){logger['error'](_0x8770('0x2b'),'afterCreate',util['inspect'](_0x2c2c77,{'showHidden':![],'depth':null}));_0x2ca830();});}else{_0x2ca830();}})[_0x8770('0x2c')](function(){_0x2ca830();});}else{_0x2ca830();}}},'charset':'utf8mb4','collate':_0x8770('0x2d')});};
\ No newline at end of file
index e66a1fc..be0eecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x419a55,_0x46d4a4){var _0xad4cc3=function(_0x50dee4){while(--_0x50dee4){_0x419a55['push'](_0x419a55['shift']());}};_0xad4cc3(++_0x46d4a4);}(_0x7a54,0x106));var _0x47a5=function(_0x5d85c6,_0x5beaf2){_0x5d85c6=_0x5d85c6-0x0;var _0x5f253d=_0x7a54[_0x5d85c6];return _0x5f253d;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});};
\ No newline at end of file
+var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x4030d4,_0x336ab2){var _0x342e02=function(_0x3a61b7){while(--_0x3a61b7){_0x4030d4['push'](_0x4030d4['shift']());}};_0x342e02(++_0x336ab2);}(_0xdb28,0x106));var _0x8db2=function(_0x21b683,_0x37a67a){_0x21b683=_0x21b683-0x0;var _0x2371a4=_0xdb28[_0x21b683];return _0x2371a4;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
index b1757e6..ba7172e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b8a=['./openchannelMessage.events','save','remove','update'];(function(_0x397d50,_0x57fe53){var _0x4051dc=function(_0x456d40){while(--_0x456d40){_0x397d50['push'](_0x397d50['shift']());}};_0x4051dc(++_0x57fe53);}(_0x1b8a,0xc8));var _0xa1b8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1b8a[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelMessageEvents=require(_0xa1b8('0x0'));var events=[_0xa1b8('0x1'),_0xa1b8('0x2'),_0xa1b8('0x3')];function createListener(_0x328dbb,_0x50f4e3){return function(_0x290396){_0x50f4e3['emit'](_0x328dbb,_0x290396);};}function removeListener(_0x572a88,_0x3c1d36){return function(){OpenchannelMessageEvents['removeListener'](_0x572a88,_0x3c1d36);};}exports['register']=function(_0x1e9ba4){for(var _0xde0955=0x0,_0x6de2b5=events['length'];_0xde0955<_0x6de2b5;_0xde0955++){var _0x23ce85=events[_0xde0955];var _0x5aad6c=createListener('openchannelMessage:'+_0x23ce85,_0x1e9ba4);OpenchannelMessageEvents['on'](_0x23ce85,_0x5aad6c);}};
\ No newline at end of file
+var _0xe469=['./openchannelMessage.events','save','remove','update','emit'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe469,0x1d6));var _0x9e46=function(_0x2b29ab,_0x201845){_0x2b29ab=_0x2b29ab-0x0;var _0x16e64b=_0xe469[_0x2b29ab];return _0x16e64b;};'use strict';var OpenchannelMessageEvents=require(_0x9e46('0x0'));var events=[_0x9e46('0x1'),_0x9e46('0x2'),_0x9e46('0x3')];function createListener(_0x521d2b,_0x1fb2fd){return function(_0x3ef21e){_0x1fb2fd[_0x9e46('0x4')](_0x521d2b,_0x3ef21e);};}function removeListener(_0x4bbf89,_0x2d2c93){return function(){OpenchannelMessageEvents['removeListener'](_0x4bbf89,_0x2d2c93);};}exports['register']=function(_0x577af8){for(var _0x1be16e=0x0,_0x278971=events['length'];_0x1be16e<_0x278971;_0x1be16e++){var _0x5c3eaa=events[_0x1be16e];var _0x130488=createListener('openchannelMessage:'+_0x5c3eaa,_0x577af8);OpenchannelMessageEvents['on'](_0x5c3eaa,_0x130488);}};
\ No newline at end of file
index 3c5e9ed..25a4e2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe20d=['removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','addAgents','put','delete','/:id','removeTeams'];(function(_0x5af0ec,_0x134201){var _0x3f8da9=function(_0x5aaf40){while(--_0x5aaf40){_0x5af0ec['push'](_0x5af0ec['shift']());}};_0x3f8da9(++_0x134201);}(_0xe20d,0x17a));var _0xde20=function(_0xca6715,_0x1948d8){_0xca6715=_0xca6715-0x0;var _0x391cfc=_0xe20d[_0xca6715];return _0x391cfc;};'use strict';var multer=require(_0xde20('0x0'));var util=require(_0xde20('0x1'));var path=require(_0xde20('0x2'));var timeout=require(_0xde20('0x3'));var express=require(_0xde20('0x4'));var router=express[_0xde20('0x5')]();var fs_extra=require(_0xde20('0x6'));var auth=require(_0xde20('0x7'));var interaction=require(_0xde20('0x8'));var config=require('../../config/environment');var controller=require(_0xde20('0x9'));router[_0xde20('0xa')]('/',auth['isAuthenticated'](),controller[_0xde20('0xb')]);router[_0xde20('0xa')](_0xde20('0xc'),auth[_0xde20('0xd')](),controller[_0xde20('0xe')]);router[_0xde20('0xa')]('/:id',auth[_0xde20('0xd')](),controller[_0xde20('0xf')]);router[_0xde20('0xa')](_0xde20('0x10'),auth[_0xde20('0xd')](),controller[_0xde20('0x11')]);router[_0xde20('0xa')](_0xde20('0x12'),auth[_0xde20('0xd')](),controller[_0xde20('0x13')]);router[_0xde20('0xa')](_0xde20('0x14'),auth['isAuthenticated'](),controller[_0xde20('0x15')]);router['post']('/',auth[_0xde20('0xd')](),controller['create']);router['post'](_0xde20('0x12'),auth[_0xde20('0xd')](),controller[_0xde20('0x16')]);router['post'](_0xde20('0x14'),auth['isAuthenticated'](),controller[_0xde20('0x17')]);router[_0xde20('0x18')]('/:id',auth[_0xde20('0xd')](),controller['update']);router[_0xde20('0x19')](_0xde20('0x1a'),auth[_0xde20('0xd')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xde20('0xd')](),controller[_0xde20('0x1b')]);router['delete'](_0xde20('0x14'),auth[_0xde20('0xd')](),controller[_0xde20('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x00e7=['/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','put','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4babbf,_0x24e85d){var _0x3d7e96=function(_0x21fe9a){while(--_0x21fe9a){_0x4babbf['push'](_0x4babbf['shift']());}};_0x3d7e96(++_0x24e85d);}(_0x00e7,0x124));var _0x700e=function(_0x429370,_0x46ff4c){_0x429370=_0x429370-0x0;var _0x41a3ad=_0x00e7[_0x429370];return _0x41a3ad;};'use strict';var multer=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var path=require(_0x700e('0x2'));var timeout=require(_0x700e('0x3'));var express=require(_0x700e('0x4'));var router=express['Router']();var fs_extra=require(_0x700e('0x5'));var auth=require(_0x700e('0x6'));var interaction=require(_0x700e('0x7'));var config=require(_0x700e('0x8'));var controller=require(_0x700e('0x9'));router[_0x700e('0xa')]('/',auth[_0x700e('0xb')](),controller['index']);router[_0x700e('0xa')](_0x700e('0xc'),auth['isAuthenticated'](),controller[_0x700e('0xd')]);router[_0x700e('0xa')](_0x700e('0xe'),auth['isAuthenticated'](),controller[_0x700e('0xf')]);router['get'](_0x700e('0x10'),auth[_0x700e('0xb')](),controller[_0x700e('0x11')]);router['get'](_0x700e('0x12'),auth['isAuthenticated'](),controller['getTeams']);router[_0x700e('0xa')](_0x700e('0x13'),auth[_0x700e('0xb')](),controller[_0x700e('0x14')]);router[_0x700e('0x15')]('/',auth[_0x700e('0xb')](),controller[_0x700e('0x16')]);router[_0x700e('0x15')]('/:id/teams',auth[_0x700e('0xb')](),controller['addTeams']);router[_0x700e('0x15')](_0x700e('0x13'),auth[_0x700e('0xb')](),controller['addAgents']);router[_0x700e('0x17')](_0x700e('0xe'),auth[_0x700e('0xb')](),controller['update']);router[_0x700e('0x18')](_0x700e('0xe'),auth['isAuthenticated'](),controller[_0x700e('0x19')]);router['delete'](_0x700e('0x12'),auth['isAuthenticated'](),controller[_0x700e('0x1a')]);router[_0x700e('0x18')](_0x700e('0x13'),auth[_0x700e('0xb')](),controller['removeAgents']);module[_0x700e('0x1b')]=router;
\ No newline at end of file
index 94eda9a..ce7fe8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13ef=['INTEGER','ENUM','beepall','sequelize','exports','STRING','name'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x13ef,0x168));var _0xf13e=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x13ef[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0xf13e('0x0'));module[_0xf13e('0x1')]={'name':{'type':Sequelize[_0xf13e('0x2')],'unique':_0xf13e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf13e('0x2')]},'timeout':{'type':Sequelize[_0xf13e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf13e('0x5')]('rrmemory',_0xf13e('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xcba5=['rrmemory','roundrobin','exports','STRING','ENUM'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xcba5,0x106));var _0x5cba=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcba5[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x5cba('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5cba('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5cba('0x2')](_0x5cba('0x3'),'beepall',_0x5cba('0x4'))}};
\ No newline at end of file
index a1087f1..49ac169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f03=['userOpenchannelQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','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','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','OpenchannelQueues','stack','name','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','include','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','findAll','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','transaction','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread'];(function(_0x5b734b,_0x486a7f){var _0x2a15a3=function(_0x187239){while(--_0x187239){_0x5b734b['push'](_0x5b734b['shift']());}};_0x2a15a3(++_0x486a7f);}(_0x8f03,0x124));var _0x38f0=function(_0x2fba2b,_0x4977bf){_0x2fba2b=_0x2fba2b-0x0;var _0x438896=_0x8f03[_0x2fba2b];return _0x438896;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x38f0('0x0'));var zipdir=require(_0x38f0('0x1'));var jsonpatch=require(_0x38f0('0x2'));var rp=require(_0x38f0('0x3'));var moment=require(_0x38f0('0x4'));var BPromise=require(_0x38f0('0x5'));var Mustache=require(_0x38f0('0x6'));var util=require(_0x38f0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x38f0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38f0('0x9'));var _=require(_0x38f0('0xa'));var squel=require(_0x38f0('0xb'));var crypto=require('crypto');var jsforce=require(_0x38f0('0xc'));var deskjs=require(_0x38f0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x38f0('0xe'));var Papa=require(_0x38f0('0xf'));var Redis=require(_0x38f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38f0('0x11'));var as=require(_0x38f0('0x12'));var hardwareService=require(_0x38f0('0x13'));var logger=require(_0x38f0('0x14'))(_0x38f0('0x15'));var utils=require(_0x38f0('0x16'));var config=require(_0x38f0('0x17'));var licenseUtil=require(_0x38f0('0x18'));var db=require(_0x38f0('0x19'))['db'];config[_0x38f0('0x1a')]=_[_0x38f0('0x1b')](config['redis'],{'host':_0x38f0('0x1c'),'port':0x18eb});var socket=require(_0x38f0('0x1d'))(new Redis(config[_0x38f0('0x1a')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0xdea5e5,_0x15b715){_0x15b715=_0x15b715||0xcc;return function(_0x13fde8){if(_0x13fde8){return _0xdea5e5[_0x38f0('0x1e')](_0x15b715);}return _0xdea5e5[_0x38f0('0x1f')](_0x15b715)[_0x38f0('0x20')]();};}function respondWithResult(_0x4ce43a,_0x5e0d50){_0x5e0d50=_0x5e0d50||0xc8;return function(_0x2ccd26){if(_0x2ccd26){return _0x4ce43a[_0x38f0('0x1f')](_0x5e0d50)['json'](_0x2ccd26);}};}function respondWithFilteredResult(_0x5d3daf,_0x4aed1e){return function(_0x2055cf){if(_0x2055cf){var _0x2b91e8=typeof _0x4aed1e['offset']===_0x38f0('0x21')&&typeof _0x4aed1e[_0x38f0('0x22')]===_0x38f0('0x21');var _0x6ff536=_0x2055cf[_0x38f0('0x23')];var _0x33106a=_0x2b91e8?0x0:_0x4aed1e[_0x38f0('0x24')];var _0x1c59fd=_0x2b91e8?_0x2055cf[_0x38f0('0x23')]:_0x4aed1e[_0x38f0('0x24')]+_0x4aed1e[_0x38f0('0x22')];var _0x55c10c;if(_0x1c59fd>=_0x6ff536){_0x1c59fd=_0x6ff536;_0x55c10c=0xc8;}else{_0x55c10c=0xce;}_0x5d3daf[_0x38f0('0x1f')](_0x55c10c);return _0x5d3daf[_0x38f0('0x25')](_0x38f0('0x26'),_0x33106a+'-'+_0x1c59fd+'/'+_0x6ff536)[_0x38f0('0x27')](_0x2055cf);}return null;};}function patchUpdates(_0x55b8af){return function(_0x57b26e){try{jsonpatch[_0x38f0('0x28')](_0x57b26e,_0x55b8af,!![]);}catch(_0x1a17f8){return BPromise[_0x38f0('0x29')](_0x1a17f8);}return _0x57b26e[_0x38f0('0x2a')]();};}function saveUpdates(_0x400e42,_0x16bd37){return function(_0x5f07c5){if(_0x5f07c5){return _0x5f07c5[_0x38f0('0x2b')](_0x400e42)[_0x38f0('0x2c')](function(_0x1e96b5){return _0x1e96b5;});}return null;};}function removeEntity(_0x116e96,_0x264234){return function(_0x4290c6){if(_0x4290c6){return _0x4290c6[_0x38f0('0x2d')]()['then'](function(){var _0x4de5b4=_0x4290c6[_0x38f0('0x2e')]({'plain':!![]});var _0x16de72=_0x38f0('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x16de72,'resourceId':_0x4de5b4['id']}})[_0x38f0('0x2c')](function(){return _0x4290c6;});})[_0x38f0('0x2c')](function(){_0x116e96[_0x38f0('0x1f')](0xcc)[_0x38f0('0x20')]();});}};}function handleEntityNotFound(_0x399899,_0x25a1c5){return function(_0x16797b){if(!_0x16797b){_0x399899[_0x38f0('0x1e')](0x194);}return _0x16797b;};}function handleError(_0x680731,_0x4dadca){_0x4dadca=_0x4dadca||0x1f4;return function(_0x32917d){logger['error'](_0x32917d[_0x38f0('0x30')]);if(_0x32917d[_0x38f0('0x31')]){delete _0x32917d[_0x38f0('0x31')];}_0x680731[_0x38f0('0x1f')](_0x4dadca)['send'](_0x32917d);};}exports[_0x38f0('0x32')]=function(_0x44ce49,_0x3f1d91){var _0x5a005e={},_0x32abea={},_0x508817={'count':0x0,'rows':[]};var _0x26292d=_['map'](db[_0x38f0('0x33')][_0x38f0('0x34')],function(_0x56e451){return{'name':_0x56e451[_0x38f0('0x35')],'type':_0x56e451[_0x38f0('0x36')][_0x38f0('0x37')]};});_0x32abea[_0x38f0('0x38')]=_['map'](_0x26292d,'name');_0x32abea[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x44ce49['query']);_0x32abea[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x32abea[_0x38f0('0x38')],_0x32abea[_0x38f0('0x39')]);_0x5a005e[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x32abea[_0x38f0('0x38')],qs[_0x38f0('0x3e')](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x3e')]));_0x5a005e[_0x38f0('0x3d')]=_0x5a005e[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x5a005e[_0x38f0('0x3d')]:_0x32abea[_0x38f0('0x38')];if(!_0x44ce49['query'][_0x38f0('0x40')](_0x38f0('0x41'))){_0x5a005e['limit']=qs[_0x38f0('0x22')](_0x44ce49[_0x38f0('0x39')]['limit']);_0x5a005e[_0x38f0('0x24')]=qs['offset'](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x24')]);}_0x5a005e[_0x38f0('0x42')]=qs['sort'](_0x44ce49[_0x38f0('0x39')][_0x38f0('0x43')]);_0x5a005e[_0x38f0('0x44')]=qs[_0x38f0('0x3b')](_[_0x38f0('0x45')](_0x44ce49[_0x38f0('0x39')],_0x32abea[_0x38f0('0x3b')]),_0x26292d);if(_0x44ce49[_0x38f0('0x39')]['filter']){_0x5a005e[_0x38f0('0x44')]=_[_0x38f0('0x46')](_0x5a005e[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x26292d,function(_0x33fe94){if(_0x33fe94[_0x38f0('0x36')]!=='VIRTUAL'){var _0x4f3982={};_0x4f3982[_0x33fe94[_0x38f0('0x31')]]={'$like':'%'+_0x44ce49[_0x38f0('0x39')][_0x38f0('0x48')]+'%'};return _0x4f3982;}})});}_0x5a005e=_[_0x38f0('0x46')]({},_0x5a005e,_0x44ce49[_0x38f0('0x49')]);var _0xab25dd={'where':_0x5a005e['where']};return db[_0x38f0('0x33')][_0x38f0('0x23')](_0xab25dd)[_0x38f0('0x2c')](function(_0x20058a){_0x508817[_0x38f0('0x23')]=_0x20058a;if(_0x44ce49[_0x38f0('0x39')]['includeAll']){_0x5a005e[_0x38f0('0x4a')]=[{'all':!![]}];}return db[_0x38f0('0x33')]['findAll'](_0x5a005e);})[_0x38f0('0x2c')](function(_0x2d578c){_0x508817[_0x38f0('0x4b')]=_0x2d578c;return _0x508817;})[_0x38f0('0x2c')](respondWithFilteredResult(_0x3f1d91,_0x5a005e))[_0x38f0('0x4c')](handleError(_0x3f1d91,null));};exports[_0x38f0('0x4d')]=function(_0x48f768,_0xb715a9){var _0x14fdd1={'raw':!![],'where':{'id':_0x48f768[_0x38f0('0x4e')]['id']}},_0x29f6a8={};_0x29f6a8[_0x38f0('0x38')]=_['keys'](db['OpenchannelQueue'][_0x38f0('0x34')]);_0x29f6a8[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x48f768['query']);_0x29f6a8[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x29f6a8['model'],_0x29f6a8[_0x38f0('0x39')]);_0x14fdd1[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x29f6a8['model'],qs[_0x38f0('0x3e')](_0x48f768[_0x38f0('0x39')]['fields']));_0x14fdd1['attributes']=_0x14fdd1[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x14fdd1[_0x38f0('0x3d')]:_0x29f6a8[_0x38f0('0x38')];if(_0x48f768['query'][_0x38f0('0x4f')]){_0x14fdd1[_0x38f0('0x4a')]=[{'all':!![]}];}_0x14fdd1=_[_0x38f0('0x46')]({},_0x14fdd1,_0x48f768[_0x38f0('0x49')]);return db[_0x38f0('0x33')]['find'](_0x14fdd1)[_0x38f0('0x2c')](handleEntityNotFound(_0xb715a9,null))[_0x38f0('0x2c')](respondWithResult(_0xb715a9,null))[_0x38f0('0x4c')](handleError(_0xb715a9,null));};exports[_0x38f0('0x50')]=function(_0x58986b,_0x72916e){return db[_0x38f0('0x33')][_0x38f0('0x50')](_0x58986b[_0x38f0('0x51')],{})[_0x38f0('0x2c')](function(_0x5990f9){var _0x1555a1=_0x58986b['user'][_0x38f0('0x2e')]({'plain':!![]});if(!_0x1555a1)throw new Error(_0x38f0('0x52'));if(_0x1555a1['role']===_0x38f0('0x53')){var _0x450203=_0x5990f9[_0x38f0('0x2e')]({'plain':!![]});var _0x3fa35e=_0x38f0('0x2f');return db[_0x38f0('0x54')][_0x38f0('0x55')]({'where':{'name':_0x3fa35e,'userProfileId':_0x1555a1[_0x38f0('0x56')]},'raw':!![]})[_0x38f0('0x2c')](function(_0xf4d171){if(_0xf4d171&&_0xf4d171[_0x38f0('0x57')]===0x0){return db['UserProfileResource'][_0x38f0('0x50')]({'name':_0x450203['name'],'resourceId':_0x450203['id'],'type':_0xf4d171[_0x38f0('0x31')],'sectionId':_0xf4d171['id']},{})['then'](function(){return _0x5990f9;});}else{return _0x5990f9;}})[_0x38f0('0x4c')](function(_0x52a384){logger[_0x38f0('0x58')](_0x38f0('0x59'),_0x52a384);throw _0x52a384;});}return _0x5990f9;})[_0x38f0('0x2c')](respondWithResult(_0x72916e,0xc9))['catch'](handleError(_0x72916e,null));};exports[_0x38f0('0x2b')]=function(_0x47ed19,_0x3dd883){if(_0x47ed19[_0x38f0('0x51')]['id']){delete _0x47ed19[_0x38f0('0x51')]['id'];}return db[_0x38f0('0x33')]['find']({'where':{'id':_0x47ed19[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x3dd883,null))[_0x38f0('0x2c')](saveUpdates(_0x47ed19['body'],null))[_0x38f0('0x2c')](respondWithResult(_0x3dd883,null))[_0x38f0('0x4c')](handleError(_0x3dd883,null));};exports[_0x38f0('0x2d')]=function(_0x3619ba,_0x4a5b65){return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x3619ba[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x4a5b65,null))[_0x38f0('0x2c')](removeEntity(_0x4a5b65,null))['catch'](handleError(_0x4a5b65,null));};exports[_0x38f0('0x5a')]=function(_0x358cf1,_0x32106f){return db[_0x38f0('0x33')]['describe']()['then'](respondWithResult(_0x32106f,null))[_0x38f0('0x4c')](handleError(_0x32106f,null));};exports[_0x38f0('0x5b')]=function(_0x19aa9c,_0x105b49,_0x513770){var _0x3dcb9d={'raw':!![],'where':{}},_0x4d8c87={},_0x53eb0b;return db[_0x38f0('0x33')][_0x38f0('0x5c')]({'where':{'id':_0x19aa9c[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x105b49,null))['then'](function(_0x4a00e6){if(_0x4a00e6){_0x53eb0b=_0x4a00e6[_0x38f0('0x2e')]({'plain':!![]});_0x4d8c87['model']=_[_0x38f0('0x3a')](db[_0x38f0('0x5d')][_0x38f0('0x34')]);_0x4d8c87['query']=_[_0x38f0('0x3a')](_0x19aa9c[_0x38f0('0x39')]);_0x4d8c87['filters']=_[_0x38f0('0x3c')](_0x4d8c87[_0x38f0('0x38')],_0x4d8c87[_0x38f0('0x39')]);_0x3dcb9d[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x4d8c87[_0x38f0('0x38')],qs['fields'](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x3e')]));_0x3dcb9d[_0x38f0('0x3d')]=_0x3dcb9d[_0x38f0('0x3d')][_0x38f0('0x3f')]?_0x3dcb9d[_0x38f0('0x3d')]:_0x4d8c87[_0x38f0('0x38')];if(!_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x40')]('nolimit')){_0x3dcb9d[_0x38f0('0x22')]=qs[_0x38f0('0x22')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x22')]);_0x3dcb9d[_0x38f0('0x24')]=qs[_0x38f0('0x24')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x24')]);}_0x3dcb9d['order']=qs[_0x38f0('0x43')](_0x19aa9c[_0x38f0('0x39')][_0x38f0('0x43')]);_0x3dcb9d[_0x38f0('0x44')]=qs['filters'](_[_0x38f0('0x45')](_0x19aa9c[_0x38f0('0x39')],_0x4d8c87[_0x38f0('0x3b')]));_0x3dcb9d['where']['OpenchannelQueueId']=_0x4a00e6['id'];if(_0x19aa9c[_0x38f0('0x39')]['filter']){_0x3dcb9d['where']=_[_0x38f0('0x46')](_0x3dcb9d[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x3dcb9d['attributes'],function(_0x5f3c49){var _0xfdfb1a={};_0xfdfb1a[_0x5f3c49]={'$like':'%'+_0x19aa9c[_0x38f0('0x39')]['filter']+'%'};return _0xfdfb1a;})});}_0x3dcb9d=_[_0x38f0('0x46')]({},_0x3dcb9d,_0x19aa9c['options']);return db[_0x38f0('0x5d')][_0x38f0('0x5e')](_0x3dcb9d);}})['then'](function(_0x5368c1){if(_0x5368c1){return db[_0x38f0('0x5f')][_0x38f0('0x60')]({'where':{'id':_[_0x38f0('0x47')](_0x5368c1,_0x38f0('0x61')),'role':'agent'},'attributes':['id',_0x38f0('0x31'),_0x38f0('0x62'),_0x38f0('0x63'),_0x38f0('0x64')]});}})[_0x38f0('0x2c')](function(_0x4c6f90){if(_0x4c6f90){return{'count':_0x4c6f90[_0x38f0('0x23')],'rows':_[_0x38f0('0x47')](_0x4c6f90['rows'],function(_0x372ec2){return{'membername':_0x372ec2[_0x38f0('0x31')],'UserId':_0x372ec2['id'],'queue_name':_0x53eb0b['name'],'OpenchannelQueueId':_0x53eb0b['id'],'interface':util['format']('%s/%s',_0x38f0('0x65'),_0x372ec2[_0x38f0('0x31')]),'penalty':0x0,'paused':_0x372ec2[_0x38f0('0x62')],'createdAt':_0x372ec2[_0x38f0('0x64')],'updatedAt':_0x372ec2[_0x38f0('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x105b49,_0x3dcb9d))['catch'](handleError(_0x105b49,null));};exports['getTeams']=function(_0x58b076,_0x4c3a26,_0x3bddb5){var _0x12cd48={};var _0x1d5754={};var _0x27b230;var _0xce901c;return db['OpenchannelQueue'][_0x38f0('0x5c')]({'where':{'id':_0x58b076[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x4c3a26,null))[_0x38f0('0x2c')](function(_0x39f249){if(_0x39f249){_0x27b230=_0x39f249;_0x1d5754[_0x38f0('0x38')]=_['keys'](db[_0x38f0('0x66')][_0x38f0('0x34')]);_0x1d5754[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x58b076['query']);_0x1d5754[_0x38f0('0x3b')]=_[_0x38f0('0x3c')](_0x1d5754['model'],_0x1d5754[_0x38f0('0x39')]);_0x12cd48[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x1d5754['model'],qs[_0x38f0('0x3e')](_0x58b076[_0x38f0('0x39')]['fields']));_0x12cd48['attributes']=_0x12cd48['attributes'][_0x38f0('0x3f')]?_0x12cd48[_0x38f0('0x3d')]:_0x1d5754[_0x38f0('0x38')];_0x12cd48[_0x38f0('0x42')]=qs[_0x38f0('0x43')](_0x58b076[_0x38f0('0x39')][_0x38f0('0x43')]);_0x12cd48['where']=qs[_0x38f0('0x3b')](_[_0x38f0('0x45')](_0x58b076[_0x38f0('0x39')],_0x1d5754[_0x38f0('0x3b')]));if(_0x58b076[_0x38f0('0x39')][_0x38f0('0x48')]){_0x12cd48['where']=_[_0x38f0('0x46')](_0x12cd48[_0x38f0('0x44')],{'$or':_[_0x38f0('0x47')](_0x12cd48[_0x38f0('0x3d')],function(_0x516ea4){var _0x1ff0ac={};_0x1ff0ac[_0x516ea4]={'$like':'%'+_0x58b076[_0x38f0('0x39')]['filter']+'%'};return _0x1ff0ac;})});}_0x12cd48=_[_0x38f0('0x46')]({},_0x12cd48,_0x58b076[_0x38f0('0x49')]);return _0x27b230['getTeams'](_0x12cd48);}})[_0x38f0('0x2c')](function(_0xe274f8){if(_0xe274f8){_0xce901c=_0xe274f8[_0x38f0('0x3f')];if(!_0x58b076[_0x38f0('0x39')][_0x38f0('0x40')](_0x38f0('0x41'))){_0x12cd48['limit']=qs[_0x38f0('0x22')](_0x58b076[_0x38f0('0x39')][_0x38f0('0x22')]);_0x12cd48[_0x38f0('0x24')]=qs['offset'](_0x58b076['query'][_0x38f0('0x24')]);}return _0x27b230[_0x38f0('0x67')](_0x12cd48);}})[_0x38f0('0x2c')](function(_0x316a68){if(_0x316a68){return _0x316a68?{'count':_0xce901c,'rows':_0x316a68}:null;}})['then'](respondWithResult(_0x4c3a26,null))['catch'](handleError(_0x4c3a26,null));};exports[_0x38f0('0x68')]=function(_0x85d8ba,_0x2b52e5,_0x19c905){var _0x36c9be=_0x85d8ba['body'][_0x38f0('0x69')];return db['Team']['findAll']({'where':{'id':_0x36c9be},'attributes':['id'],'include':[{'model':db[_0x38f0('0x5f')],'as':_0x38f0('0x6a'),'attributes':['id','name',_0x38f0('0x6b'),_0x38f0('0x6c'),_0x38f0('0x6d')],'raw':!![]}]})[_0x38f0('0x2c')](function(_0x48cfbf){if(_0x48cfbf){var _0x58c8bd=_['flatMap'](_0x48cfbf,function(_0x5de2b5){var _0xb3bbbe=_0x5de2b5['get']({'plain':!![]});return _0xb3bbbe[_0x38f0('0x6a')];});return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x85d8ba[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](function(_0x2027d7){return db[_0x38f0('0x6e')]['transaction'](function(_0x4efa7d){return _0x2027d7[_0x38f0('0x68')](_0x36c9be,{'transaction':_0x4efa7d})[_0x38f0('0x2c')](function(){return BPromise[_0x38f0('0x6f')](_0x58c8bd,function(_0x2af217){return db['UserOpenchannelQueue'][_0x38f0('0x70')]({'where':{'UserId':_0x2af217['id'],'OpenchannelQueueId':_0x85d8ba['params']['id']},'transaction':_0x4efa7d});});})[_0x38f0('0x2c')](function(){_0x58c8bd[_0x38f0('0x71')](function(_0x20de89){socket[_0x38f0('0x72')]('userOpenchannelQueue:save',{'UserId':_0x20de89['id'],'OpenchannelQueueId':_0x2027d7['id']});});});});});}})[_0x38f0('0x2c')](respondWithStatusCode(_0x2b52e5,null))[_0x38f0('0x4c')](handleError(_0x2b52e5,null));};exports[_0x38f0('0x73')]=function(_0x8e9a39,_0x286d6e,_0x48b5a5){return db['Team']['findAll']({'where':{'id':_0x8e9a39[_0x38f0('0x39')][_0x38f0('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x38f0('0x2c')](handleEntityNotFound(_0x286d6e,null))[_0x38f0('0x2c')](function(_0x515a27){var _0x1dd519=_[_0x38f0('0x47')](_0x515a27,'id');var _0x478a41=[];var _0x18cf64=[];var _0x445517=squel[_0x38f0('0x74')]();_0x445517[_0x38f0('0x75')](_0x38f0('0x76'))[_0x38f0('0x77')](_0x38f0('0x78'),'tq')[_0x38f0('0x79')](_0x38f0('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x38f0('0x44')](_0x38f0('0x7b'),_0x8e9a39[_0x38f0('0x4e')]['id']);for(var _0xcd7f5a=0x0;_0xcd7f5a<_0x515a27[_0x38f0('0x3f')];_0xcd7f5a+=0x1){let _0x2b36fa=_0x515a27[_0xcd7f5a];for(var _0x351a4d=0x0;_0x351a4d<_0x2b36fa['Agents'][_0x38f0('0x3f')];_0x351a4d+=0x1){let _0x24be82=_0x2b36fa['Agents'][_0x351a4d];var _0x3f4b43=_0x445517[_0x38f0('0x7c')]();_0x3f4b43[_0x38f0('0x44')](_0x38f0('0x7d'),_0x24be82['id']);_0x18cf64[_0x38f0('0x7e')](db['sequelize'][_0x38f0('0x39')](_0x3f4b43[_0x38f0('0x7f')](),{'type':db[_0x38f0('0x6e')][_0x38f0('0x80')][_0x38f0('0x81')]})[_0x38f0('0x2c')](function(_0x33347f){if(_0x33347f[_0x38f0('0x3f')]===0x1){return _0x24be82['id'];}else{var _0x3cb1ab=_[_0x38f0('0x82')](_['map'](_0x33347f,_0x38f0('0x83')),function(_0x6dbab5){return _['includes'](_0x1dd519,_0x6dbab5);});if(_0x3cb1ab){return _0x24be82['id'];}}}));}}return BPromise[_0x38f0('0x84')](_0x18cf64)[_0x38f0('0x2c')](function(_0x48050b){_0x478a41=_(_0x478a41)[_0x38f0('0x85')](_0x48050b)['compact']()['value']();return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x8e9a39[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](function(_0x55ed92){return db[_0x38f0('0x6e')][_0x38f0('0x86')](function(_0x316f08){return _0x55ed92[_0x38f0('0x73')](_0x8e9a39[_0x38f0('0x39')]['ids'],{'transaction':_0x316f08})[_0x38f0('0x2c')](function(){if(!_[_0x38f0('0x87')](_0x478a41)){return _0x55ed92['removeAgents'](_0x478a41,{'transaction':_0x316f08});}})[_0x38f0('0x2c')](function(){_0x478a41[_0x38f0('0x71')](function(_0x2920d6){socket['emit'](_0x38f0('0x88'),{'UserId':_0x2920d6,'OpenchannelQueueId':_0x55ed92['id']});});});});});});})['then'](respondWithStatusCode(_0x286d6e,null))[_0x38f0('0x4c')](handleError(_0x286d6e,null));};exports[_0x38f0('0x89')]=function(_0x30d318,_0x432d8d,_0x39d1be){return db[_0x38f0('0x33')][_0x38f0('0x55')]({'where':{'id':_0x30d318[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x432d8d,null))[_0x38f0('0x2c')](function(_0x5cf3f1){if(_0x5cf3f1){return _0x5cf3f1[_0x38f0('0x89')](_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')],_[_0x38f0('0x8a')](_0x30d318[_0x38f0('0x51')],[_0x38f0('0x69'),'id'])||{})[_0x38f0('0x8b')](function(_0x4a6723){for(var _0x584866=0x0;_0x584866<_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')][_0x38f0('0x3f')];_0x584866+=0x1){socket['emit'](_0x38f0('0x8c'),{'UserId':Number(_0x30d318[_0x38f0('0x51')][_0x38f0('0x69')][_0x584866]),'OpenchannelQueueId':Number(_0x30d318[_0x38f0('0x4e')]['id'])});}return _0x4a6723;});}})[_0x38f0('0x2c')](respondWithResult(_0x432d8d,null))[_0x38f0('0x4c')](handleError(_0x432d8d,null));};exports['removeAgents']=function(_0x32657a,_0x74d07f,_0xa34c0b){return db['OpenchannelQueue'][_0x38f0('0x55')]({'where':{'id':_0x32657a[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x74d07f,null))[_0x38f0('0x2c')](function(_0x1adc93){if(_0x1adc93){return _0x1adc93[_0x38f0('0x8d')](_0x32657a[_0x38f0('0x39')]['ids'])[_0x38f0('0x2c')](function(){if(_[_0x38f0('0x8e')](_0x32657a['query'][_0x38f0('0x69')])){for(var _0x2e7236=0x0;_0x2e7236<_0x32657a[_0x38f0('0x39')][_0x38f0('0x69')][_0x38f0('0x3f')];_0x2e7236+=0x1){socket[_0x38f0('0x72')](_0x38f0('0x88'),{'UserId':Number(_0x32657a[_0x38f0('0x39')]['ids'][_0x2e7236]),'OpenchannelQueueId':Number(_0x32657a['params']['id'])});}}else{socket[_0x38f0('0x72')](_0x38f0('0x88'),{'UserId':Number(_0x32657a[_0x38f0('0x39')][_0x38f0('0x69')]),'OpenchannelQueueId':Number(_0x32657a[_0x38f0('0x4e')]['id'])});}});}})[_0x38f0('0x2c')](respondWithStatusCode(_0x74d07f,null))['catch'](handleError(_0x74d07f,null));};exports[_0x38f0('0x8f')]=function(_0x2f6cca,_0x2f1915,_0x4daa9a){var _0x2a0769={};var _0x5b08be={};var _0x59e04f;var _0x58f4da;return db[_0x38f0('0x33')][_0x38f0('0x5c')]({'where':{'id':_0x2f6cca[_0x38f0('0x4e')]['id']}})[_0x38f0('0x2c')](handleEntityNotFound(_0x2f1915,null))['then'](function(_0x1f6f84){if(_0x1f6f84){_0x59e04f=_0x1f6f84;_0x5b08be[_0x38f0('0x38')]=_[_0x38f0('0x3a')](db[_0x38f0('0x5f')][_0x38f0('0x34')]);_0x5b08be[_0x38f0('0x39')]=_[_0x38f0('0x3a')](_0x2f6cca[_0x38f0('0x39')]);_0x5b08be['filters']=_['intersection'](_0x5b08be[_0x38f0('0x38')],_0x5b08be[_0x38f0('0x39')]);_0x2a0769[_0x38f0('0x3d')]=_[_0x38f0('0x3c')](_0x5b08be['model'],qs[_0x38f0('0x3e')](_0x2f6cca[_0x38f0('0x39')]['fields']));_0x2a0769[_0x38f0('0x3d')]=_0x2a0769['attributes']['length']?_0x2a0769[_0x38f0('0x3d')]:_0x5b08be[_0x38f0('0x38')];_0x2a0769[_0x38f0('0x42')]=qs[_0x38f0('0x43')](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x43')]);_0x2a0769[_0x38f0('0x44')]=qs['filters'](_[_0x38f0('0x45')](_0x2f6cca[_0x38f0('0x39')],_0x5b08be[_0x38f0('0x3b')]));if(_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x48')]){_0x2a0769[_0x38f0('0x44')]=_[_0x38f0('0x46')](_0x2a0769[_0x38f0('0x44')],{'$or':_['map'](_0x2a0769[_0x38f0('0x3d')],function(_0x4fa6e2){var _0x147756={};_0x147756[_0x4fa6e2]={'$like':'%'+_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x48')]+'%'};return _0x147756;})});}_0x2a0769=_[_0x38f0('0x46')]({},_0x2a0769,_0x2f6cca[_0x38f0('0x49')]);return _0x59e04f[_0x38f0('0x8f')](_0x2a0769);}})[_0x38f0('0x2c')](function(_0x598f10){if(_0x598f10){_0x58f4da=_0x598f10[_0x38f0('0x3f')];if(!_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x40')](_0x38f0('0x41'))){_0x2a0769['limit']=qs['limit'](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x22')]);_0x2a0769[_0x38f0('0x24')]=qs[_0x38f0('0x24')](_0x2f6cca[_0x38f0('0x39')][_0x38f0('0x24')]);}return _0x59e04f['getAgents'](_0x2a0769);}})[_0x38f0('0x2c')](function(_0x38575f){if(_0x38575f){return _0x38575f?{'count':_0x58f4da,'rows':_0x38575f}:null;}})[_0x38f0('0x2c')](respondWithResult(_0x2f1915,null))[_0x38f0('0x4c')](handleError(_0x2f1915,null));};
\ No newline at end of file
+var _0x4752=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','transaction','each','UserOpenchannelQueue','findOrCreate','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','SELECT','every','TeamId','includes','all','compact','sequelize','removeTeams','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','emit','userOpenchannelQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x3c6e97,_0x84132a){var _0x27707e=function(_0x3b78ca){while(--_0x3b78ca){_0x3c6e97['push'](_0x3c6e97['shift']());}};_0x27707e(++_0x84132a);}(_0x4752,0x152));var _0x2475=function(_0x425746,_0x301914){_0x425746=_0x425746-0x0;var _0x408ebc=_0x4752[_0x425746];return _0x408ebc;};'use strict';var emlformat=require(_0x2475('0x0'));var rimraf=require(_0x2475('0x1'));var zipdir=require(_0x2475('0x2'));var jsonpatch=require(_0x2475('0x3'));var rp=require('request-promise');var moment=require(_0x2475('0x4'));var BPromise=require(_0x2475('0x5'));var Mustache=require('mustache');var util=require(_0x2475('0x6'));var path=require(_0x2475('0x7'));var sox=require(_0x2475('0x8'));var csv=require(_0x2475('0x9'));var ejs=require(_0x2475('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2475('0xb'));var squel=require(_0x2475('0xc'));var crypto=require('crypto');var jsforce=require(_0x2475('0xd'));var deskjs=require(_0x2475('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2475('0xf'));var Papa=require(_0x2475('0x10'));var Redis=require(_0x2475('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2475('0x12'));var as=require(_0x2475('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2475('0x14'))(_0x2475('0x15'));var utils=require(_0x2475('0x16'));var config=require(_0x2475('0x17'));var licenseUtil=require(_0x2475('0x18'));var db=require(_0x2475('0x19'))['db'];config[_0x2475('0x1a')]=_[_0x2475('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2475('0x1c'))(new Redis(config[_0x2475('0x1a')]));require(_0x2475('0x1d'))['register'](socket);function respondWithStatusCode(_0x4f244d,_0x1f6fd5){_0x1f6fd5=_0x1f6fd5||0xcc;return function(_0x52d4ae){if(_0x52d4ae){return _0x4f244d[_0x2475('0x1e')](_0x1f6fd5);}return _0x4f244d[_0x2475('0x1f')](_0x1f6fd5)[_0x2475('0x20')]();};}function respondWithResult(_0x38ee42,_0x3cb240){_0x3cb240=_0x3cb240||0xc8;return function(_0x20b13b){if(_0x20b13b){return _0x38ee42['status'](_0x3cb240)[_0x2475('0x21')](_0x20b13b);}};}function respondWithFilteredResult(_0x4af1ea,_0x3fa4f8){return function(_0x40eb8b){if(_0x40eb8b){var _0x165f84=typeof _0x3fa4f8[_0x2475('0x22')]===_0x2475('0x23')&&typeof _0x3fa4f8[_0x2475('0x24')]===_0x2475('0x23');var _0x599a41=_0x40eb8b['count'];var _0x49ca25=_0x165f84?0x0:_0x3fa4f8[_0x2475('0x22')];var _0x4cadcd=_0x165f84?_0x40eb8b[_0x2475('0x25')]:_0x3fa4f8['offset']+_0x3fa4f8[_0x2475('0x24')];var _0x3f1c7b;if(_0x4cadcd>=_0x599a41){_0x4cadcd=_0x599a41;_0x3f1c7b=0xc8;}else{_0x3f1c7b=0xce;}_0x4af1ea['status'](_0x3f1c7b);return _0x4af1ea[_0x2475('0x26')]('Content-Range',_0x49ca25+'-'+_0x4cadcd+'/'+_0x599a41)[_0x2475('0x21')](_0x40eb8b);}return null;};}function patchUpdates(_0x3e95f3){return function(_0x343b7b){try{jsonpatch[_0x2475('0x27')](_0x343b7b,_0x3e95f3,!![]);}catch(_0x39bdf8){return BPromise['reject'](_0x39bdf8);}return _0x343b7b[_0x2475('0x28')]();};}function saveUpdates(_0x391933,_0x4aa289){return function(_0x2fba40){if(_0x2fba40){return _0x2fba40[_0x2475('0x29')](_0x391933)[_0x2475('0x2a')](function(_0x26f2b8){return _0x26f2b8;});}return null;};}function removeEntity(_0x317d47,_0x175db8){return function(_0x2bb3d4){if(_0x2bb3d4){return _0x2bb3d4[_0x2475('0x2b')]()[_0x2475('0x2a')](function(){var _0x26dd52=_0x2bb3d4[_0x2475('0x2c')]({'plain':!![]});var _0x4adc0c=_0x2475('0x2d');return db[_0x2475('0x2e')][_0x2475('0x2b')]({'where':{'type':_0x4adc0c,'resourceId':_0x26dd52['id']}})['then'](function(){return _0x2bb3d4;});})[_0x2475('0x2a')](function(){_0x317d47[_0x2475('0x1f')](0xcc)[_0x2475('0x20')]();});}};}function handleEntityNotFound(_0xe3068a,_0x23547b){return function(_0x238ba9){if(!_0x238ba9){_0xe3068a[_0x2475('0x1e')](0x194);}return _0x238ba9;};}function handleError(_0x49f675,_0x14fb7d){_0x14fb7d=_0x14fb7d||0x1f4;return function(_0x5ee6d6){logger[_0x2475('0x2f')](_0x5ee6d6[_0x2475('0x30')]);if(_0x5ee6d6[_0x2475('0x31')]){delete _0x5ee6d6[_0x2475('0x31')];}_0x49f675[_0x2475('0x1f')](_0x14fb7d)[_0x2475('0x32')](_0x5ee6d6);};}exports[_0x2475('0x33')]=function(_0x4c0f4b,_0x4d0d58){var _0x395656={},_0x57938b={},_0x4fd82={'count':0x0,'rows':[]};var _0x2b160e=_[_0x2475('0x34')](db[_0x2475('0x35')][_0x2475('0x36')],function(_0x5c5bd0){return{'name':_0x5c5bd0[_0x2475('0x37')],'type':_0x5c5bd0[_0x2475('0x38')][_0x2475('0x39')]};});_0x57938b[_0x2475('0x3a')]=_[_0x2475('0x34')](_0x2b160e,_0x2475('0x31'));_0x57938b[_0x2475('0x3b')]=_[_0x2475('0x3c')](_0x4c0f4b[_0x2475('0x3b')]);_0x57938b['filters']=_[_0x2475('0x3d')](_0x57938b[_0x2475('0x3a')],_0x57938b[_0x2475('0x3b')]);_0x395656[_0x2475('0x3e')]=_[_0x2475('0x3d')](_0x57938b[_0x2475('0x3a')],qs['fields'](_0x4c0f4b['query'][_0x2475('0x3f')]));_0x395656[_0x2475('0x3e')]=_0x395656['attributes'][_0x2475('0x40')]?_0x395656[_0x2475('0x3e')]:_0x57938b['model'];if(!_0x4c0f4b['query'][_0x2475('0x41')](_0x2475('0x42'))){_0x395656[_0x2475('0x24')]=qs['limit'](_0x4c0f4b[_0x2475('0x3b')][_0x2475('0x24')]);_0x395656[_0x2475('0x22')]=qs[_0x2475('0x22')](_0x4c0f4b['query']['offset']);}_0x395656[_0x2475('0x43')]=qs[_0x2475('0x44')](_0x4c0f4b[_0x2475('0x3b')]['sort']);_0x395656[_0x2475('0x45')]=qs[_0x2475('0x46')](_[_0x2475('0x47')](_0x4c0f4b[_0x2475('0x3b')],_0x57938b[_0x2475('0x46')]),_0x2b160e);if(_0x4c0f4b[_0x2475('0x3b')][_0x2475('0x48')]){_0x395656[_0x2475('0x45')]=_['merge'](_0x395656[_0x2475('0x45')],{'$or':_[_0x2475('0x34')](_0x2b160e,function(_0x13622e){if(_0x13622e[_0x2475('0x38')]!==_0x2475('0x49')){var _0x43310b={};_0x43310b[_0x13622e['name']]={'$like':'%'+_0x4c0f4b[_0x2475('0x3b')][_0x2475('0x48')]+'%'};return _0x43310b;}})});}_0x395656=_[_0x2475('0x4a')]({},_0x395656,_0x4c0f4b[_0x2475('0x4b')]);var _0x41d17b={'where':_0x395656[_0x2475('0x45')]};return db[_0x2475('0x35')][_0x2475('0x25')](_0x41d17b)[_0x2475('0x2a')](function(_0x2002ad){_0x4fd82[_0x2475('0x25')]=_0x2002ad;if(_0x4c0f4b[_0x2475('0x3b')][_0x2475('0x4c')]){_0x395656[_0x2475('0x4d')]=[{'all':!![]}];}return db[_0x2475('0x35')]['findAll'](_0x395656);})['then'](function(_0x5a5e3b){_0x4fd82[_0x2475('0x4e')]=_0x5a5e3b;return _0x4fd82;})['then'](respondWithFilteredResult(_0x4d0d58,_0x395656))[_0x2475('0x4f')](handleError(_0x4d0d58,null));};exports[_0x2475('0x50')]=function(_0x4b49f7,_0x3d0646){var _0xb5b582={'raw':!![],'where':{'id':_0x4b49f7[_0x2475('0x51')]['id']}},_0x5a2042={};_0x5a2042['model']=_[_0x2475('0x3c')](db['OpenchannelQueue'][_0x2475('0x36')]);_0x5a2042['query']=_['keys'](_0x4b49f7[_0x2475('0x3b')]);_0x5a2042[_0x2475('0x46')]=_[_0x2475('0x3d')](_0x5a2042[_0x2475('0x3a')],_0x5a2042[_0x2475('0x3b')]);_0xb5b582[_0x2475('0x3e')]=_[_0x2475('0x3d')](_0x5a2042[_0x2475('0x3a')],qs[_0x2475('0x3f')](_0x4b49f7[_0x2475('0x3b')][_0x2475('0x3f')]));_0xb5b582['attributes']=_0xb5b582[_0x2475('0x3e')][_0x2475('0x40')]?_0xb5b582['attributes']:_0x5a2042[_0x2475('0x3a')];if(_0x4b49f7[_0x2475('0x3b')]['includeAll']){_0xb5b582[_0x2475('0x4d')]=[{'all':!![]}];}_0xb5b582=_[_0x2475('0x4a')]({},_0xb5b582,_0x4b49f7[_0x2475('0x4b')]);return db[_0x2475('0x35')][_0x2475('0x52')](_0xb5b582)[_0x2475('0x2a')](handleEntityNotFound(_0x3d0646,null))[_0x2475('0x2a')](respondWithResult(_0x3d0646,null))[_0x2475('0x4f')](handleError(_0x3d0646,null));};exports[_0x2475('0x53')]=function(_0x18c9d1,_0x4aad69){return db[_0x2475('0x35')]['create'](_0x18c9d1[_0x2475('0x54')],{})[_0x2475('0x2a')](function(_0x242869){var _0x560f5a=_0x18c9d1[_0x2475('0x55')][_0x2475('0x2c')]({'plain':!![]});if(!_0x560f5a)throw new Error(_0x2475('0x56'));if(_0x560f5a[_0x2475('0x57')]===_0x2475('0x55')){var _0x16d971=_0x242869['get']({'plain':!![]});var _0x20430b=_0x2475('0x2d');return db[_0x2475('0x58')][_0x2475('0x52')]({'where':{'name':_0x20430b,'userProfileId':_0x560f5a[_0x2475('0x59')]},'raw':!![]})[_0x2475('0x2a')](function(_0x4f3c01){if(_0x4f3c01&&_0x4f3c01[_0x2475('0x5a')]===0x0){return db[_0x2475('0x2e')][_0x2475('0x53')]({'name':_0x16d971['name'],'resourceId':_0x16d971['id'],'type':_0x4f3c01[_0x2475('0x31')],'sectionId':_0x4f3c01['id']},{})[_0x2475('0x2a')](function(){return _0x242869;});}else{return _0x242869;}})[_0x2475('0x4f')](function(_0x30bb8d){logger[_0x2475('0x2f')](_0x2475('0x5b'),_0x30bb8d);throw _0x30bb8d;});}return _0x242869;})['then'](respondWithResult(_0x4aad69,0xc9))['catch'](handleError(_0x4aad69,null));};exports[_0x2475('0x29')]=function(_0x3fb5cc,_0x314427){if(_0x3fb5cc[_0x2475('0x54')]['id']){delete _0x3fb5cc[_0x2475('0x54')]['id'];}return db[_0x2475('0x35')][_0x2475('0x52')]({'where':{'id':_0x3fb5cc['params']['id']}})[_0x2475('0x2a')](handleEntityNotFound(_0x314427,null))[_0x2475('0x2a')](saveUpdates(_0x3fb5cc[_0x2475('0x54')],null))[_0x2475('0x2a')](respondWithResult(_0x314427,null))[_0x2475('0x4f')](handleError(_0x314427,null));};exports[_0x2475('0x2b')]=function(_0x12220d,_0x25f2ae){return db[_0x2475('0x35')][_0x2475('0x52')]({'where':{'id':_0x12220d[_0x2475('0x51')]['id']}})['then'](handleEntityNotFound(_0x25f2ae,null))[_0x2475('0x2a')](removeEntity(_0x25f2ae,null))['catch'](handleError(_0x25f2ae,null));};exports[_0x2475('0x5c')]=function(_0x5b7f8e,_0x3f984){return db[_0x2475('0x35')][_0x2475('0x5c')]()[_0x2475('0x2a')](respondWithResult(_0x3f984,null))[_0x2475('0x4f')](handleError(_0x3f984,null));};exports[_0x2475('0x5d')]=function(_0x41ad66,_0x3ba7dd,_0x316d48){var _0x28fa6f={'raw':!![],'where':{}},_0x41b8ba={},_0xd57f42;return db[_0x2475('0x35')][_0x2475('0x5e')]({'where':{'id':_0x41ad66['params']['id']}})[_0x2475('0x2a')](handleEntityNotFound(_0x3ba7dd,null))[_0x2475('0x2a')](function(_0x5e7bb5){if(_0x5e7bb5){_0xd57f42=_0x5e7bb5[_0x2475('0x2c')]({'plain':!![]});_0x41b8ba[_0x2475('0x3a')]=_['keys'](db['UserOpenchannelQueue']['rawAttributes']);_0x41b8ba[_0x2475('0x3b')]=_[_0x2475('0x3c')](_0x41ad66['query']);_0x41b8ba[_0x2475('0x46')]=_['intersection'](_0x41b8ba[_0x2475('0x3a')],_0x41b8ba['query']);_0x28fa6f['attributes']=_[_0x2475('0x3d')](_0x41b8ba[_0x2475('0x3a')],qs[_0x2475('0x3f')](_0x41ad66[_0x2475('0x3b')][_0x2475('0x3f')]));_0x28fa6f['attributes']=_0x28fa6f[_0x2475('0x3e')][_0x2475('0x40')]?_0x28fa6f[_0x2475('0x3e')]:_0x41b8ba[_0x2475('0x3a')];if(!_0x41ad66[_0x2475('0x3b')][_0x2475('0x41')](_0x2475('0x42'))){_0x28fa6f[_0x2475('0x24')]=qs[_0x2475('0x24')](_0x41ad66[_0x2475('0x3b')][_0x2475('0x24')]);_0x28fa6f[_0x2475('0x22')]=qs[_0x2475('0x22')](_0x41ad66[_0x2475('0x3b')][_0x2475('0x22')]);}_0x28fa6f[_0x2475('0x43')]=qs['sort'](_0x41ad66[_0x2475('0x3b')][_0x2475('0x44')]);_0x28fa6f[_0x2475('0x45')]=qs[_0x2475('0x46')](_[_0x2475('0x47')](_0x41ad66[_0x2475('0x3b')],_0x41b8ba[_0x2475('0x46')]));_0x28fa6f[_0x2475('0x45')]['OpenchannelQueueId']=_0x5e7bb5['id'];if(_0x41ad66[_0x2475('0x3b')][_0x2475('0x48')]){_0x28fa6f[_0x2475('0x45')]=_['merge'](_0x28fa6f[_0x2475('0x45')],{'$or':_[_0x2475('0x34')](_0x28fa6f['attributes'],function(_0x17bccf){var _0x5b5c67={};_0x5b5c67[_0x17bccf]={'$like':'%'+_0x41ad66['query'][_0x2475('0x48')]+'%'};return _0x5b5c67;})});}_0x28fa6f=_[_0x2475('0x4a')]({},_0x28fa6f,_0x41ad66['options']);return db['UserOpenchannelQueue'][_0x2475('0x5f')](_0x28fa6f);}})[_0x2475('0x2a')](function(_0x20e2f5){if(_0x20e2f5){return db[_0x2475('0x60')][_0x2475('0x61')]({'where':{'id':_[_0x2475('0x34')](_0x20e2f5,_0x2475('0x62')),'role':_0x2475('0x63')},'attributes':['id',_0x2475('0x31'),_0x2475('0x64'),_0x2475('0x65'),'createdAt']});}})['then'](function(_0x13bae7){if(_0x13bae7){return{'count':_0x13bae7[_0x2475('0x25')],'rows':_['map'](_0x13bae7['rows'],function(_0xe0856a){return{'membername':_0xe0856a[_0x2475('0x31')],'UserId':_0xe0856a['id'],'queue_name':_0xd57f42['name'],'OpenchannelQueueId':_0xd57f42['id'],'interface':util[_0x2475('0x66')](_0x2475('0x67'),_0x2475('0x68'),_0xe0856a[_0x2475('0x31')]),'penalty':0x0,'paused':_0xe0856a[_0x2475('0x64')],'createdAt':_0xe0856a[_0x2475('0x69')],'updatedAt':_0xe0856a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2475('0x2a')](respondWithFilteredResult(_0x3ba7dd,_0x28fa6f))[_0x2475('0x4f')](handleError(_0x3ba7dd,null));};exports['getTeams']=function(_0x51578f,_0x3971c1,_0x54cf5b){var _0x2bb97a={};var _0x4f3882={};var _0x3f1066;var _0x410242;return db[_0x2475('0x35')]['findOne']({'where':{'id':_0x51578f[_0x2475('0x51')]['id']}})[_0x2475('0x2a')](handleEntityNotFound(_0x3971c1,null))[_0x2475('0x2a')](function(_0x2ab700){if(_0x2ab700){_0x3f1066=_0x2ab700;_0x4f3882[_0x2475('0x3a')]=_['keys'](db[_0x2475('0x6a')]['rawAttributes']);_0x4f3882[_0x2475('0x3b')]=_['keys'](_0x51578f[_0x2475('0x3b')]);_0x4f3882[_0x2475('0x46')]=_[_0x2475('0x3d')](_0x4f3882[_0x2475('0x3a')],_0x4f3882[_0x2475('0x3b')]);_0x2bb97a[_0x2475('0x3e')]=_[_0x2475('0x3d')](_0x4f3882[_0x2475('0x3a')],qs[_0x2475('0x3f')](_0x51578f[_0x2475('0x3b')]['fields']));_0x2bb97a['attributes']=_0x2bb97a[_0x2475('0x3e')][_0x2475('0x40')]?_0x2bb97a['attributes']:_0x4f3882['model'];_0x2bb97a[_0x2475('0x43')]=qs['sort'](_0x51578f['query']['sort']);_0x2bb97a[_0x2475('0x45')]=qs['filters'](_[_0x2475('0x47')](_0x51578f['query'],_0x4f3882['filters']));if(_0x51578f['query'][_0x2475('0x48')]){_0x2bb97a[_0x2475('0x45')]=_[_0x2475('0x4a')](_0x2bb97a['where'],{'$or':_['map'](_0x2bb97a['attributes'],function(_0x483e9f){var _0x3f6b94={};_0x3f6b94[_0x483e9f]={'$like':'%'+_0x51578f['query'][_0x2475('0x48')]+'%'};return _0x3f6b94;})});}_0x2bb97a=_[_0x2475('0x4a')]({},_0x2bb97a,_0x51578f[_0x2475('0x4b')]);return _0x3f1066[_0x2475('0x6b')](_0x2bb97a);}})[_0x2475('0x2a')](function(_0x32042a){if(_0x32042a){_0x410242=_0x32042a['length'];if(!_0x51578f[_0x2475('0x3b')][_0x2475('0x41')](_0x2475('0x42'))){_0x2bb97a[_0x2475('0x24')]=qs[_0x2475('0x24')](_0x51578f['query'][_0x2475('0x24')]);_0x2bb97a[_0x2475('0x22')]=qs[_0x2475('0x22')](_0x51578f[_0x2475('0x3b')]['offset']);}return _0x3f1066[_0x2475('0x6b')](_0x2bb97a);}})[_0x2475('0x2a')](function(_0x47c4d1){if(_0x47c4d1){return _0x47c4d1?{'count':_0x410242,'rows':_0x47c4d1}:null;}})[_0x2475('0x2a')](respondWithResult(_0x3971c1,null))['catch'](handleError(_0x3971c1,null));};exports[_0x2475('0x6c')]=function(_0x487e2a,_0x29bc39,_0x54100f){var _0x537a7b=_0x487e2a[_0x2475('0x54')][_0x2475('0x6d')];return db[_0x2475('0x6a')][_0x2475('0x5f')]({'where':{'id':_0x537a7b},'attributes':['id'],'include':[{'model':db[_0x2475('0x60')],'as':_0x2475('0x6e'),'attributes':['id','name',_0x2475('0x6f'),_0x2475('0x70'),'interface'],'raw':!![]}]})['then'](function(_0x491fda){if(_0x491fda){var _0x24fc33=_['flatMap'](_0x491fda,function(_0x256a43){var _0x210853=_0x256a43['get']({'plain':!![]});return _0x210853['Agents'];});return db[_0x2475('0x35')][_0x2475('0x52')]({'where':{'id':_0x487e2a['params']['id']}})[_0x2475('0x2a')](function(_0x48344e){return db['sequelize'][_0x2475('0x71')](function(_0x2d259a){return _0x48344e[_0x2475('0x6c')](_0x537a7b,{'transaction':_0x2d259a})[_0x2475('0x2a')](function(){return BPromise[_0x2475('0x72')](_0x24fc33,function(_0x4042b9){return db[_0x2475('0x73')][_0x2475('0x74')]({'where':{'UserId':_0x4042b9['id'],'OpenchannelQueueId':_0x487e2a[_0x2475('0x51')]['id']},'transaction':_0x2d259a});});})[_0x2475('0x2a')](function(){_0x24fc33['forEach'](function(_0x1a4f42){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x1a4f42['id'],'OpenchannelQueueId':_0x48344e['id']});});});});});}})[_0x2475('0x2a')](respondWithStatusCode(_0x29bc39,null))[_0x2475('0x4f')](handleError(_0x29bc39,null));};exports['removeTeams']=function(_0x31365b,_0x16ed8c,_0x3d766f){return db[_0x2475('0x6a')][_0x2475('0x5f')]({'where':{'id':_0x31365b[_0x2475('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2475('0x60')],'as':_0x2475('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x2475('0x2a')](handleEntityNotFound(_0x16ed8c,null))['then'](function(_0x179942){var _0x42cc15=_['map'](_0x179942,'id');var _0x681b98=[];var _0x40abc9=[];var _0x1765d=squel['select']();_0x1765d[_0x2475('0x75')](_0x2475('0x76'))[_0x2475('0x77')](_0x2475('0x78'),'tq')['join'](_0x2475('0x79'),'ut',_0x2475('0x7a'))[_0x2475('0x45')]('OpenchannelQueueId\x20=\x20?',_0x31365b['params']['id']);for(var _0xd669d3=0x0;_0xd669d3<_0x179942[_0x2475('0x40')];_0xd669d3+=0x1){let _0x5225c8=_0x179942[_0xd669d3];for(var _0x1f7f4a=0x0;_0x1f7f4a<_0x5225c8['Agents'][_0x2475('0x40')];_0x1f7f4a+=0x1){let _0x3f9ad8=_0x5225c8[_0x2475('0x6e')][_0x1f7f4a];var _0x31e2b1=_0x1765d[_0x2475('0x7b')]();_0x31e2b1[_0x2475('0x45')]('ut.UserId\x20=\x20?',_0x3f9ad8['id']);_0x40abc9[_0x2475('0x7c')](db['sequelize']['query'](_0x31e2b1['toString'](),{'type':db['sequelize']['QueryTypes'][_0x2475('0x7d')]})['then'](function(_0x4857d6){if(_0x4857d6['length']===0x1){return _0x3f9ad8['id'];}else{var _0x3b388b=_[_0x2475('0x7e')](_[_0x2475('0x34')](_0x4857d6,_0x2475('0x7f')),function(_0xd62790){return _[_0x2475('0x80')](_0x42cc15,_0xd62790);});if(_0x3b388b){return _0x3f9ad8['id'];}}}));}}return BPromise[_0x2475('0x81')](_0x40abc9)[_0x2475('0x2a')](function(_0x5711cc){_0x681b98=_(_0x681b98)['union'](_0x5711cc)[_0x2475('0x82')]()['value']();return db[_0x2475('0x35')][_0x2475('0x52')]({'where':{'id':_0x31365b[_0x2475('0x51')]['id']}})[_0x2475('0x2a')](function(_0x2deda8){return db[_0x2475('0x83')][_0x2475('0x71')](function(_0x1b65ba){return _0x2deda8[_0x2475('0x84')](_0x31365b[_0x2475('0x3b')][_0x2475('0x6d')],{'transaction':_0x1b65ba})[_0x2475('0x2a')](function(){if(!_['isEmpty'](_0x681b98)){return _0x2deda8[_0x2475('0x85')](_0x681b98,{'transaction':_0x1b65ba});}})[_0x2475('0x2a')](function(){_0x681b98[_0x2475('0x86')](function(_0x1147c3){socket['emit'](_0x2475('0x87'),{'UserId':_0x1147c3,'OpenchannelQueueId':_0x2deda8['id']});});});});});});})[_0x2475('0x2a')](respondWithStatusCode(_0x16ed8c,null))[_0x2475('0x4f')](handleError(_0x16ed8c,null));};exports[_0x2475('0x88')]=function(_0x5c4f29,_0x44e3fc,_0x30b063){return db[_0x2475('0x35')][_0x2475('0x52')]({'where':{'id':_0x5c4f29[_0x2475('0x51')]['id']}})['then'](handleEntityNotFound(_0x44e3fc,null))[_0x2475('0x2a')](function(_0x33f1d2){if(_0x33f1d2){return _0x33f1d2['addAgents'](_0x5c4f29[_0x2475('0x54')][_0x2475('0x6d')],_[_0x2475('0x89')](_0x5c4f29[_0x2475('0x54')],[_0x2475('0x6d'),'id'])||{})[_0x2475('0x8a')](function(_0x20ce38){for(var _0xf7926e=0x0;_0xf7926e<_0x5c4f29[_0x2475('0x54')][_0x2475('0x6d')][_0x2475('0x40')];_0xf7926e+=0x1){socket[_0x2475('0x8b')](_0x2475('0x8c'),{'UserId':Number(_0x5c4f29[_0x2475('0x54')][_0x2475('0x6d')][_0xf7926e]),'OpenchannelQueueId':Number(_0x5c4f29['params']['id'])});}return _0x20ce38;});}})[_0x2475('0x2a')](respondWithResult(_0x44e3fc,null))[_0x2475('0x4f')](handleError(_0x44e3fc,null));};exports[_0x2475('0x85')]=function(_0x31c28d,_0x23e2d2,_0x5164a8){return db[_0x2475('0x35')]['find']({'where':{'id':_0x31c28d[_0x2475('0x51')]['id']}})[_0x2475('0x2a')](handleEntityNotFound(_0x23e2d2,null))[_0x2475('0x2a')](function(_0x190191){if(_0x190191){return _0x190191[_0x2475('0x85')](_0x31c28d['query'][_0x2475('0x6d')])[_0x2475('0x2a')](function(){if(_[_0x2475('0x8d')](_0x31c28d['query'][_0x2475('0x6d')])){for(var _0x3bae18=0x0;_0x3bae18<_0x31c28d[_0x2475('0x3b')]['ids']['length'];_0x3bae18+=0x1){socket[_0x2475('0x8b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x31c28d[_0x2475('0x3b')][_0x2475('0x6d')][_0x3bae18]),'OpenchannelQueueId':Number(_0x31c28d[_0x2475('0x51')]['id'])});}}else{socket[_0x2475('0x8b')](_0x2475('0x87'),{'UserId':Number(_0x31c28d[_0x2475('0x3b')][_0x2475('0x6d')]),'OpenchannelQueueId':Number(_0x31c28d['params']['id'])});}});}})[_0x2475('0x2a')](respondWithStatusCode(_0x23e2d2,null))[_0x2475('0x4f')](handleError(_0x23e2d2,null));};exports[_0x2475('0x8e')]=function(_0x222192,_0x15e450,_0x2a8685){var _0x2f6f12={};var _0x2aa486={};var _0x91526d;var _0x149f3a;return db[_0x2475('0x35')][_0x2475('0x5e')]({'where':{'id':_0x222192['params']['id']}})[_0x2475('0x2a')](handleEntityNotFound(_0x15e450,null))[_0x2475('0x2a')](function(_0x4fd2a6){if(_0x4fd2a6){_0x91526d=_0x4fd2a6;_0x2aa486[_0x2475('0x3a')]=_[_0x2475('0x3c')](db[_0x2475('0x60')][_0x2475('0x36')]);_0x2aa486[_0x2475('0x3b')]=_['keys'](_0x222192[_0x2475('0x3b')]);_0x2aa486[_0x2475('0x46')]=_[_0x2475('0x3d')](_0x2aa486['model'],_0x2aa486[_0x2475('0x3b')]);_0x2f6f12[_0x2475('0x3e')]=_[_0x2475('0x3d')](_0x2aa486[_0x2475('0x3a')],qs[_0x2475('0x3f')](_0x222192[_0x2475('0x3b')]['fields']));_0x2f6f12[_0x2475('0x3e')]=_0x2f6f12[_0x2475('0x3e')][_0x2475('0x40')]?_0x2f6f12[_0x2475('0x3e')]:_0x2aa486[_0x2475('0x3a')];_0x2f6f12['order']=qs[_0x2475('0x44')](_0x222192[_0x2475('0x3b')]['sort']);_0x2f6f12[_0x2475('0x45')]=qs['filters'](_[_0x2475('0x47')](_0x222192[_0x2475('0x3b')],_0x2aa486[_0x2475('0x46')]));if(_0x222192[_0x2475('0x3b')]['filter']){_0x2f6f12[_0x2475('0x45')]=_[_0x2475('0x4a')](_0x2f6f12[_0x2475('0x45')],{'$or':_['map'](_0x2f6f12['attributes'],function(_0x484124){var _0x4b2f4d={};_0x4b2f4d[_0x484124]={'$like':'%'+_0x222192[_0x2475('0x3b')]['filter']+'%'};return _0x4b2f4d;})});}_0x2f6f12=_[_0x2475('0x4a')]({},_0x2f6f12,_0x222192[_0x2475('0x4b')]);return _0x91526d[_0x2475('0x8e')](_0x2f6f12);}})['then'](function(_0x17afc7){if(_0x17afc7){_0x149f3a=_0x17afc7[_0x2475('0x40')];if(!_0x222192[_0x2475('0x3b')][_0x2475('0x41')](_0x2475('0x42'))){_0x2f6f12[_0x2475('0x24')]=qs[_0x2475('0x24')](_0x222192['query'][_0x2475('0x24')]);_0x2f6f12[_0x2475('0x22')]=qs[_0x2475('0x22')](_0x222192[_0x2475('0x3b')][_0x2475('0x22')]);}return _0x91526d['getAgents'](_0x2f6f12);}})['then'](function(_0x1d5e79){if(_0x1d5e79){return _0x1d5e79?{'count':_0x149f3a,'rows':_0x1d5e79}:null;}})[_0x2475('0x2a')](respondWithResult(_0x15e450,null))[_0x2475('0x4f')](handleError(_0x15e450,null));};
\ No newline at end of file
index 800c9d5..5b05a06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5176=['emit','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','remove'];(function(_0x56cc19,_0x2fd3a3){var _0x19cf03=function(_0x2e70ed){while(--_0x2e70ed){_0x56cc19['push'](_0x56cc19['shift']());}};_0x19cf03(++_0x2fd3a3);}(_0x5176,0x1ae));var _0x6517=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5176[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x6517('0x0'))['db'][_0x6517('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6517('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6517('0x3')};function emitEvent(_0x4aef45){return function(_0x321772,_0x26cb2a,_0x28ccba){OpenchannelQueueEvents[_0x6517('0x4')](_0x4aef45+':'+_0x321772['id'],_0x321772);OpenchannelQueueEvents[_0x6517('0x4')](_0x4aef45,_0x321772);_0x28ccba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x6517('0x5')](e,emitEvent(event));}}module[_0x6517('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0xc731=['events','OpenchannelQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc731,0x70));var _0x1c73=function(_0xa9b6a9,_0x255c78){_0xa9b6a9=_0xa9b6a9-0x0;var _0x3a5f3b=_0xc731[_0xa9b6a9];return _0x3a5f3b;};'use strict';var EventEmitter=require(_0x1c73('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x1c73('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1c73('0x2'),'afterUpdate':_0x1c73('0x3'),'afterDestroy':'remove'};function emitEvent(_0x407a1d){return function(_0x3f16ff,_0x4f776e,_0x321e3b){OpenchannelQueueEvents[_0x1c73('0x4')](_0x407a1d+':'+_0x3f16ff['id'],_0x3f16ff);OpenchannelQueueEvents['emit'](_0x407a1d,_0x3f16ff);_0x321e3b(null);};}for(var e in events){if(events[_0x1c73('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1c73('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index a7635ec..c1a9bb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17aa=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x17aa,0x120));var _0xa17a=function(_0x94eb91,_0x58aa9e){_0x94eb91=_0x94eb91-0x0;var _0x20eaa0=_0x17aa[_0x94eb91];return _0x20eaa0;};'use strict';var _=require(_0xa17a('0x0'));var util=require(_0xa17a('0x1'));var logger=require(_0xa17a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa17a('0x3'));var rp=require(_0xa17a('0x4'));var fs=require('fs');var path=require(_0xa17a('0x5'));var rimraf=require(_0xa17a('0x6'));var config=require(_0xa17a('0x7'));var attributes=require(_0xa17a('0x8'));module['exports']=function(_0x3a2e07,_0x205a7a){return _0x3a2e07[_0xa17a('0x9')](_0xa17a('0xa'),attributes,{'tableName':_0xa17a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x59d6=['exports','OpenchannelQueue','openchannel_queues','util','api','moment','request-promise','../../config/environment','./openchannelQueue.attributes'];(function(_0xce255a,_0x26e6b0){var _0x3400cd=function(_0x1788e5){while(--_0x1788e5){_0xce255a['push'](_0xce255a['shift']());}};_0x3400cd(++_0x26e6b0);}(_0x59d6,0x1bc));var _0x659d=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x59d6[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x659d('0x0'));var logger=require('../../config/logger')(_0x659d('0x1'));var moment=require(_0x659d('0x2'));var BPromise=require('bluebird');var rp=require(_0x659d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x659d('0x4'));var attributes=require(_0x659d('0x5'));module[_0x659d('0x6')]=function(_0x1416e7,_0x429267){return _0x1416e7['define'](_0x659d('0x7'),attributes,{'tableName':_0x659d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b4ecf8a..e02b652 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf78a=['defaults','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf78a,0xe0));var _0xaf78=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0xf78a[_0x4ab3fb];return _0x34fe1e;};'use strict';var _=require(_0xaf78('0x0'));var util=require(_0xaf78('0x1'));var moment=require(_0xaf78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf78('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf78('0x4'));var logger=require(_0xaf78('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaf78('0x6'));var client=jayson[_0xaf78('0x7')][_0xaf78('0x8')]({'port':0x232a});config[_0xaf78('0x9')]=_[_0xaf78('0xa')](config['redis'],{'host':_0xaf78('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf78('0x9')]));require(_0xaf78('0xc'))[_0xaf78('0xd')](socket);function respondWithRpcPromise(_0x524706,_0x33f2ea,_0x55d0ca){return new BPromise(function(_0x22b14e,_0x48faf8){return client[_0xaf78('0xe')](_0x524706,_0x55d0ca)[_0xaf78('0xf')](function(_0x27ea23){logger[_0xaf78('0x10')](_0xaf78('0x11'),_0x33f2ea,'request\x20sent');logger[_0xaf78('0x12')](_0xaf78('0x13'),_0x33f2ea,_0xaf78('0x14'),JSON[_0xaf78('0x15')](_0x27ea23));if(_0x27ea23[_0xaf78('0x16')]){if(_0x27ea23[_0xaf78('0x16')][_0xaf78('0x17')]===0x1f4){logger['error'](_0xaf78('0x11'),_0x33f2ea,_0x27ea23['error'][_0xaf78('0x18')]);return _0x48faf8(_0x27ea23[_0xaf78('0x16')][_0xaf78('0x18')]);}logger[_0xaf78('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x33f2ea,_0x27ea23['error'][_0xaf78('0x18')]);return _0x22b14e(_0x27ea23['error']['message']);}else{logger[_0xaf78('0x10')](_0xaf78('0x11'),_0x33f2ea,_0xaf78('0x14'));_0x22b14e(_0x27ea23[_0xaf78('0x19')][_0xaf78('0x18')]);}})[_0xaf78('0x1a')](function(_0x2fb155){logger[_0xaf78('0x16')](_0xaf78('0x11'),_0x33f2ea,_0x2fb155);_0x48faf8(_0x2fb155);});});}exports[_0xaf78('0x1b')]=function(_0x2eae57){var _0x69c728=this;return new Promise(function(_0x1b2516,_0x5e5ce9){return db[_0xaf78('0x1c')]['findAll']({'raw':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x1e')]===undefined?!![]:![]:!![],'where':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x1f')]||null:null,'attributes':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x20')]||null:null,'limit':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57['options'][_0xaf78('0x21')]||null:null,'include':_0x2eae57[_0xaf78('0x1d')]?_0x2eae57[_0xaf78('0x1d')][_0xaf78('0x22')]?_[_0xaf78('0x23')](_0x2eae57['options'][_0xaf78('0x22')],function(_0x497bc7){return{'model':db[_0x497bc7[_0xaf78('0x24')]],'as':_0x497bc7['as'],'attributes':_0x497bc7[_0xaf78('0x20')],'include':_0x497bc7['include']?_[_0xaf78('0x23')](_0x497bc7[_0xaf78('0x22')],function(_0xfbff2c){return{'model':db[_0xfbff2c[_0xaf78('0x24')]],'as':_0xfbff2c['as'],'attributes':_0xfbff2c[_0xaf78('0x20')],'include':_0xfbff2c['include']?_[_0xaf78('0x23')](_0xfbff2c[_0xaf78('0x22')],function(_0x30dc7f){return{'model':db[_0x30dc7f[_0xaf78('0x24')]],'as':_0x30dc7f['as'],'attributes':_0x30dc7f[_0xaf78('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1affe1){logger[_0xaf78('0x10')](_0xaf78('0x1b'),_0x2eae57);logger[_0xaf78('0x12')](_0xaf78('0x1b'),_0x2eae57,JSON['stringify'](_0x1affe1));_0x1b2516(_0x1affe1);})[_0xaf78('0x1a')](function(_0x32e70c){logger['error'](_0xaf78('0x1b'),_0x32e70c['message'],_0x2eae57);_0x5e5ce9(_0x69c728['error'](0x1f4,_0x32e70c[_0xaf78('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x401bdc){var _0x4c9fcc=this;return new Promise(function(_0x401ab7,_0x4deb78){return db[_0xaf78('0x1c')][_0xaf78('0x25')]({'raw':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc['options'][_0xaf78('0x1e')]===undefined?!![]:![]:!![],'where':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc[_0xaf78('0x1d')]['where']||null:null,'attributes':_0x401bdc[_0xaf78('0x1d')]?_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x20')]||null:null,'include':_0x401bdc['options']?_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x22')]?_[_0xaf78('0x23')](_0x401bdc[_0xaf78('0x1d')][_0xaf78('0x22')],function(_0x12aca2){return{'model':db[_0x12aca2[_0xaf78('0x24')]],'as':_0x12aca2['as'],'attributes':_0x12aca2['attributes'],'include':_0x12aca2['include']?_['map'](_0x12aca2[_0xaf78('0x22')],function(_0xd13743){return{'model':db[_0xd13743['model']],'as':_0xd13743['as'],'attributes':_0xd13743['attributes'],'include':_0xd13743[_0xaf78('0x22')]?_[_0xaf78('0x23')](_0xd13743[_0xaf78('0x22')],function(_0x2a13be){return{'model':db[_0x2a13be[_0xaf78('0x24')]],'as':_0x2a13be['as'],'attributes':_0x2a13be[_0xaf78('0x20')]};}):[]};}):[]};}):[]:[]})[_0xaf78('0xf')](function(_0x17fa31){logger[_0xaf78('0x10')](_0xaf78('0x26'),_0x401bdc);logger[_0xaf78('0x12')]('ShowOpenchannelQueue',_0x401bdc,JSON[_0xaf78('0x15')](_0x17fa31));_0x401ab7(_0x17fa31);})[_0xaf78('0x1a')](function(_0x3c0463){logger[_0xaf78('0x16')]('ShowOpenchannelQueue',_0x3c0463['message'],_0x401bdc);_0x4deb78(_0x4c9fcc[_0xaf78('0x16')](0x1f4,_0x3c0463[_0xaf78('0x18')]));});});};
\ No newline at end of file
+var _0x73b2=['attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','debug','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where'];(function(_0x3a2f45,_0x628b19){var _0x25b26c=function(_0x2efe55){while(--_0x2efe55){_0x3a2f45['push'](_0x3a2f45['shift']());}};_0x25b26c(++_0x628b19);}(_0x73b2,0x79));var _0x273b=function(_0x58af71,_0xecaf36){_0x58af71=_0x58af71-0x0;var _0x5398e6=_0x73b2[_0x58af71];return _0x5398e6;};'use strict';var _=require('lodash');var util=require(_0x273b('0x0'));var moment=require(_0x273b('0x1'));var BPromise=require(_0x273b('0x2'));var rs=require(_0x273b('0x3'));var fs=require('fs');var Redis=require(_0x273b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x273b('0x5'));var logger=require(_0x273b('0x6'))('rpc');var config=require(_0x273b('0x7'));var jayson=require(_0x273b('0x8'));var client=jayson[_0x273b('0x9')]['http']({'port':0x232a});config[_0x273b('0xa')]=_[_0x273b('0xb')](config[_0x273b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x273b('0xc'))(new Redis(config[_0x273b('0xa')]));require(_0x273b('0xd'))[_0x273b('0xe')](socket);function respondWithRpcPromise(_0x2c18d3,_0x19ba59,_0x345b5f){return new BPromise(function(_0x38ed79,_0x183276){return client['request'](_0x2c18d3,_0x345b5f)[_0x273b('0xf')](function(_0x185dee){logger[_0x273b('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x19ba59,_0x273b('0x11'));logger[_0x273b('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x19ba59,_0x273b('0x11'),JSON['stringify'](_0x185dee));if(_0x185dee['error']){if(_0x185dee[_0x273b('0x13')][_0x273b('0x14')]===0x1f4){logger['error'](_0x273b('0x15'),_0x19ba59,_0x185dee[_0x273b('0x13')][_0x273b('0x16')]);return _0x183276(_0x185dee[_0x273b('0x13')][_0x273b('0x16')]);}logger['error'](_0x273b('0x15'),_0x19ba59,_0x185dee[_0x273b('0x13')]['message']);return _0x38ed79(_0x185dee['error'][_0x273b('0x16')]);}else{logger[_0x273b('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x19ba59,'request\x20sent');_0x38ed79(_0x185dee[_0x273b('0x17')]['message']);}})[_0x273b('0x18')](function(_0x1ae18d){logger[_0x273b('0x13')](_0x273b('0x15'),_0x19ba59,_0x1ae18d);_0x183276(_0x1ae18d);});});}exports[_0x273b('0x19')]=function(_0x2f02e2){var _0x382048=this;return new Promise(function(_0x21e052,_0x5478de){return db[_0x273b('0x1a')][_0x273b('0x1b')]({'raw':_0x2f02e2[_0x273b('0x1c')]?_0x2f02e2[_0x273b('0x1c')][_0x273b('0x1d')]===undefined?!![]:![]:!![],'where':_0x2f02e2[_0x273b('0x1c')]?_0x2f02e2[_0x273b('0x1c')][_0x273b('0x1e')]||null:null,'attributes':_0x2f02e2[_0x273b('0x1c')]?_0x2f02e2[_0x273b('0x1c')][_0x273b('0x1f')]||null:null,'limit':_0x2f02e2['options']?_0x2f02e2['options'][_0x273b('0x20')]||null:null,'include':_0x2f02e2['options']?_0x2f02e2[_0x273b('0x1c')][_0x273b('0x21')]?_[_0x273b('0x22')](_0x2f02e2['options']['include'],function(_0x5bf9bb){return{'model':db[_0x5bf9bb[_0x273b('0x23')]],'as':_0x5bf9bb['as'],'attributes':_0x5bf9bb[_0x273b('0x1f')],'include':_0x5bf9bb['include']?_[_0x273b('0x22')](_0x5bf9bb[_0x273b('0x21')],function(_0x12b9c0){return{'model':db[_0x12b9c0[_0x273b('0x23')]],'as':_0x12b9c0['as'],'attributes':_0x12b9c0[_0x273b('0x1f')],'include':_0x12b9c0[_0x273b('0x21')]?_[_0x273b('0x22')](_0x12b9c0['include'],function(_0x5b3ea1){return{'model':db[_0x5b3ea1['model']],'as':_0x5b3ea1['as'],'attributes':_0x5b3ea1[_0x273b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x273b('0xf')](function(_0x4a831d){logger['info'](_0x273b('0x19'),_0x2f02e2);logger[_0x273b('0x12')]('GetOpenchannelQueue',_0x2f02e2,JSON[_0x273b('0x24')](_0x4a831d));_0x21e052(_0x4a831d);})['catch'](function(_0x3f65ac){logger[_0x273b('0x13')](_0x273b('0x19'),_0x3f65ac[_0x273b('0x16')],_0x2f02e2);_0x5478de(_0x382048[_0x273b('0x13')](0x1f4,_0x3f65ac[_0x273b('0x16')]));});});};exports[_0x273b('0x25')]=function(_0x4f38bc){var _0x441211=this;return new Promise(function(_0x5d1bb4,_0x50b69a){return db[_0x273b('0x1a')]['find']({'raw':_0x4f38bc['options']?_0x4f38bc[_0x273b('0x1c')][_0x273b('0x1d')]===undefined?!![]:![]:!![],'where':_0x4f38bc[_0x273b('0x1c')]?_0x4f38bc['options'][_0x273b('0x1e')]||null:null,'attributes':_0x4f38bc['options']?_0x4f38bc[_0x273b('0x1c')]['attributes']||null:null,'include':_0x4f38bc[_0x273b('0x1c')]?_0x4f38bc['options'][_0x273b('0x21')]?_[_0x273b('0x22')](_0x4f38bc[_0x273b('0x1c')][_0x273b('0x21')],function(_0xe3761c){return{'model':db[_0xe3761c[_0x273b('0x23')]],'as':_0xe3761c['as'],'attributes':_0xe3761c[_0x273b('0x1f')],'include':_0xe3761c[_0x273b('0x21')]?_[_0x273b('0x22')](_0xe3761c['include'],function(_0x2b8b7b){return{'model':db[_0x2b8b7b[_0x273b('0x23')]],'as':_0x2b8b7b['as'],'attributes':_0x2b8b7b[_0x273b('0x1f')],'include':_0x2b8b7b['include']?_[_0x273b('0x22')](_0x2b8b7b[_0x273b('0x21')],function(_0x5ec499){return{'model':db[_0x5ec499['model']],'as':_0x5ec499['as'],'attributes':_0x5ec499['attributes']};}):[]};}):[]};}):[]:[]})[_0x273b('0xf')](function(_0x5d0ecf){logger['info']('ShowOpenchannelQueue',_0x4f38bc);logger[_0x273b('0x12')]('ShowOpenchannelQueue',_0x4f38bc,JSON[_0x273b('0x24')](_0x5d0ecf));_0x5d1bb4(_0x5d0ecf);})[_0x273b('0x18')](function(_0x8a8adf){logger['error'](_0x273b('0x25'),_0x8a8adf[_0x273b('0x16')],_0x4f38bc);_0x50b69a(_0x441211[_0x273b('0x13')](0x1f4,_0x8a8adf['message']));});});};
\ No newline at end of file
index 0e4865c..18e556c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f83=['length','./openchannelQueue.events','update','removeListener','register'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x7f83,0xd3));var _0x37f8=function(_0x46692f,_0x5c9d8a){_0x46692f=_0x46692f-0x0;var _0x4abf0a=_0x7f83[_0x46692f];return _0x4abf0a;};'use strict';var OpenchannelQueueEvents=require(_0x37f8('0x0'));var events=['save','remove',_0x37f8('0x1')];function createListener(_0x2e0112,_0x3ff66c){return function(_0x415e6e){_0x3ff66c['emit'](_0x2e0112,_0x415e6e);};}function removeListener(_0x37f4d5,_0x5dabdf){return function(){OpenchannelQueueEvents[_0x37f8('0x2')](_0x37f4d5,_0x5dabdf);};}exports[_0x37f8('0x3')]=function(_0x105ac4){for(var _0x264242=0x0,_0x5133b1=events[_0x37f8('0x4')];_0x264242<_0x5133b1;_0x264242++){var _0x2dcb13=events[_0x264242];var _0x169122=createListener('openchannelQueue:'+_0x2dcb13,_0x105ac4);OpenchannelQueueEvents['on'](_0x2dcb13,_0x169122);}};
\ No newline at end of file
+var _0x96e8=['register','openchannelQueue:','update','emit','removeListener'];(function(_0x414a70,_0x57b4ec){var _0x3deec3=function(_0x3f755b){while(--_0x3f755b){_0x414a70['push'](_0x414a70['shift']());}};_0x3deec3(++_0x57b4ec);}(_0x96e8,0x160));var _0x896e=function(_0x56de16,_0x46a8fe){_0x56de16=_0x56de16-0x0;var _0x3776db=_0x96e8[_0x56de16];return _0x3776db;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save','remove',_0x896e('0x0')];function createListener(_0x495757,_0xbf345){return function(_0x23bbf5){_0xbf345[_0x896e('0x1')](_0x495757,_0x23bbf5);};}function removeListener(_0x23f56e,_0x559389){return function(){OpenchannelQueueEvents[_0x896e('0x2')](_0x23f56e,_0x559389);};}exports[_0x896e('0x3')]=function(_0xcbef87){for(var _0x3585ad=0x0,_0x60b524=events['length'];_0x3585ad<_0x60b524;_0x3585ad++){var _0x5e557a=events[_0x3585ad];var _0x807fcc=createListener(_0x896e('0x4')+_0x5e557a,_0xcbef87);OpenchannelQueueEvents['on'](_0x5e557a,_0x807fcc);}};
\ No newline at end of file
index 13dfa01..7cdce1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f40=['update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','show','post','put','/:id'];(function(_0x33ebf5,_0x258ec6){var _0x66957b=function(_0x49739a){while(--_0x49739a){_0x33ebf5['push'](_0x33ebf5['shift']());}};_0x66957b(++_0x258ec6);}(_0x0f40,0x6f));var _0x00f4=function(_0x2c32fb,_0x45b9a8){_0x2c32fb=_0x2c32fb-0x0;var _0x1f2836=_0x0f40[_0x2c32fb];return _0x1f2836;};'use strict';var multer=require(_0x00f4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x00f4('0x1'));var router=express[_0x00f4('0x2')]();var fs_extra=require(_0x00f4('0x3'));var auth=require(_0x00f4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x00f4('0x5'));var controller=require(_0x00f4('0x6'));router['get']('/',auth[_0x00f4('0x7')](),controller['index']);router[_0x00f4('0x8')](_0x00f4('0x9'),auth[_0x00f4('0x7')](),controller[_0x00f4('0xa')]);router['get']('/:id',auth[_0x00f4('0x7')](),controller[_0x00f4('0xb')]);router[_0x00f4('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x00f4('0xd')](_0x00f4('0xe'),auth[_0x00f4('0x7')](),controller[_0x00f4('0xf')]);router['delete'](_0x00f4('0xe'),auth[_0x00f4('0x7')](),controller[_0x00f4('0x10')]);module[_0x00f4('0x11')]=router;
\ No newline at end of file
+var _0x6967=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x346376,_0x4b3bfb){var _0x27ebcc=function(_0x32741b){while(--_0x32741b){_0x346376['push'](_0x346376['shift']());}};_0x27ebcc(++_0x4b3bfb);}(_0x6967,0x10b));var _0x7696=function(_0x254ed6,_0x1bfc9b){_0x254ed6=_0x254ed6-0x0;var _0x29dea5=_0x6967[_0x254ed6];return _0x29dea5;};'use strict';var multer=require('multer');var util=require(_0x7696('0x0'));var path=require('path');var timeout=require(_0x7696('0x1'));var express=require(_0x7696('0x2'));var router=express[_0x7696('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7696('0x4'));var interaction=require(_0x7696('0x5'));var config=require(_0x7696('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x7696('0x7')]('/',auth[_0x7696('0x8')](),controller[_0x7696('0x9')]);router[_0x7696('0x7')](_0x7696('0xa'),auth['isAuthenticated'](),controller[_0x7696('0xb')]);router[_0x7696('0x7')](_0x7696('0xc'),auth[_0x7696('0x8')](),controller[_0x7696('0xd')]);router[_0x7696('0xe')]('/',auth[_0x7696('0x8')](),controller[_0x7696('0xf')]);router[_0x7696('0x10')](_0x7696('0xc'),auth[_0x7696('0x8')](),controller[_0x7696('0x11')]);router[_0x7696('0x12')](_0x7696('0xc'),auth[_0x7696('0x8')](),controller[_0x7696('0x13')]);module[_0x7696('0x14')]=router;
\ No newline at end of file
index e76e1e5..6e64d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c40=['DATE','sequelize','exports','STRING'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x2c40,0xfd));var _0x02c4=function(_0x41c394,_0x32e672){_0x41c394=_0x41c394-0x0;var _0x521e71=_0x2c40[_0x41c394];return _0x521e71;};'use strict';var moment=require('moment');var Sequelize=require(_0x02c4('0x0'));module[_0x02c4('0x1')]={'uniqueid':{'type':Sequelize[_0x02c4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x02c4('0x2')]},'joinAt':{'type':Sequelize[_0x02c4('0x3')]},'leaveAt':{'type':Sequelize[_0x02c4('0x3')]},'acceptAt':{'type':Sequelize[_0x02c4('0x3')]},'exitAt':{'type':Sequelize[_0x02c4('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x742e=['STRING','DATE','moment','sequelize'];(function(_0x3ca20e,_0x1a104f){var _0x4b850a=function(_0x32286a){while(--_0x32286a){_0x3ca20e['push'](_0x3ca20e['shift']());}};_0x4b850a(++_0x1a104f);}(_0x742e,0xa2));var _0xe742=function(_0x53b90a,_0x47cc17){_0x53b90a=_0x53b90a-0x0;var _0x900430=_0x742e[_0x53b90a];return _0x900430;};'use strict';var moment=require(_0xe742('0x0'));var Sequelize=require(_0xe742('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe742('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe742('0x2')]},'joinAt':{'type':Sequelize[_0xe742('0x3')]},'leaveAt':{'type':Sequelize[_0xe742('0x3')]},'acceptAt':{'type':Sequelize[_0xe742('0x3')]},'exitAt':{'type':Sequelize[_0xe742('0x3')]},'reason':{'type':Sequelize[_0xe742('0x2')]}};
\ No newline at end of file
index 612607f..f53255a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x646c=['count','Content-Range','json','reject','update','then','destroy','error','stack','name','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x646c,0x16d));var _0xc646=function(_0x223461,_0x2bca70){_0x223461=_0x223461-0x0;var _0x4dbe0a=_0x646c[_0x223461];return _0x4dbe0a;};'use strict';var emlformat=require(_0xc646('0x0'));var rimraf=require(_0xc646('0x1'));var zipdir=require(_0xc646('0x2'));var jsonpatch=require(_0xc646('0x3'));var rp=require(_0xc646('0x4'));var moment=require(_0xc646('0x5'));var BPromise=require(_0xc646('0x6'));var Mustache=require(_0xc646('0x7'));var util=require(_0xc646('0x8'));var path=require(_0xc646('0x9'));var sox=require(_0xc646('0xa'));var csv=require(_0xc646('0xb'));var ejs=require(_0xc646('0xc'));var fs=require('fs');var fs_extra=require(_0xc646('0xd'));var _=require(_0xc646('0xe'));var squel=require(_0xc646('0xf'));var crypto=require(_0xc646('0x10'));var jsforce=require(_0xc646('0x11'));var deskjs=require(_0xc646('0x12'));var toCsv=require(_0xc646('0xb'));var querystring=require(_0xc646('0x13'));var Papa=require(_0xc646('0x14'));var Redis=require('ioredis');var authService=require(_0xc646('0x15'));var qs=require(_0xc646('0x16'));var as=require(_0xc646('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc646('0x18'))(_0xc646('0x19'));var utils=require(_0xc646('0x1a'));var config=require(_0xc646('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xc646('0x1c'))['db'];function respondWithStatusCode(_0x4d30de,_0x13a9fd){_0x13a9fd=_0x13a9fd||0xcc;return function(_0x4b8416){if(_0x4b8416){return _0x4d30de[_0xc646('0x1d')](_0x13a9fd);}return _0x4d30de[_0xc646('0x1e')](_0x13a9fd)[_0xc646('0x1f')]();};}function respondWithResult(_0x3d69bd,_0x20bec1){_0x20bec1=_0x20bec1||0xc8;return function(_0x5d8f0d){if(_0x5d8f0d){return _0x3d69bd[_0xc646('0x1e')](_0x20bec1)['json'](_0x5d8f0d);}};}function respondWithFilteredResult(_0x1c2db5,_0x359791){return function(_0x34247e){if(_0x34247e){var _0x28a762=typeof _0x359791[_0xc646('0x20')]===_0xc646('0x21')&&typeof _0x359791[_0xc646('0x22')]===_0xc646('0x21');var _0x2cc4d9=_0x34247e['count'];var _0x455fe3=_0x28a762?0x0:_0x359791[_0xc646('0x20')];var _0x5296b5=_0x28a762?_0x34247e[_0xc646('0x23')]:_0x359791['offset']+_0x359791[_0xc646('0x22')];var _0x5bc5f4;if(_0x5296b5>=_0x2cc4d9){_0x5296b5=_0x2cc4d9;_0x5bc5f4=0xc8;}else{_0x5bc5f4=0xce;}_0x1c2db5['status'](_0x5bc5f4);return _0x1c2db5['set'](_0xc646('0x24'),_0x455fe3+'-'+_0x5296b5+'/'+_0x2cc4d9)[_0xc646('0x25')](_0x34247e);}return null;};}function patchUpdates(_0x1dd4bb){return function(_0x957eca){try{jsonpatch['apply'](_0x957eca,_0x1dd4bb,!![]);}catch(_0x3b9393){return BPromise[_0xc646('0x26')](_0x3b9393);}return _0x957eca['save']();};}function saveUpdates(_0x259444,_0x4602d1){return function(_0x5ba3f3){if(_0x5ba3f3){return _0x5ba3f3[_0xc646('0x27')](_0x259444)[_0xc646('0x28')](function(_0x5c1ebb){return _0x5c1ebb;});}return null;};}function removeEntity(_0x45f708,_0x489432){return function(_0x18ea75){if(_0x18ea75){return _0x18ea75[_0xc646('0x29')]()['then'](function(){_0x45f708['status'](0xcc)[_0xc646('0x1f')]();});}};}function handleEntityNotFound(_0x5b9f7f,_0x394e13){return function(_0x4f5a75){if(!_0x4f5a75){_0x5b9f7f[_0xc646('0x1d')](0x194);}return _0x4f5a75;};}function handleError(_0x368f6e,_0xe55016){_0xe55016=_0xe55016||0x1f4;return function(_0xe2be32){logger[_0xc646('0x2a')](_0xe2be32[_0xc646('0x2b')]);if(_0xe2be32[_0xc646('0x2c')]){delete _0xe2be32[_0xc646('0x2c')];}_0x368f6e[_0xc646('0x1e')](_0xe55016)['send'](_0xe2be32);};}exports['index']=function(_0x17c300,_0x3edd6f){var _0x42c95e={},_0xe93d3={},_0x45edf7={'count':0x0,'rows':[]};var _0x420a36=_[_0xc646('0x2d')](db[_0xc646('0x2e')][_0xc646('0x2f')],function(_0x4bf298){return{'name':_0x4bf298[_0xc646('0x30')],'type':_0x4bf298[_0xc646('0x31')][_0xc646('0x32')]};});_0xe93d3[_0xc646('0x33')]=_[_0xc646('0x2d')](_0x420a36,_0xc646('0x2c'));_0xe93d3[_0xc646('0x34')]=_[_0xc646('0x35')](_0x17c300[_0xc646('0x34')]);_0xe93d3[_0xc646('0x36')]=_['intersection'](_0xe93d3['model'],_0xe93d3['query']);_0x42c95e[_0xc646('0x37')]=_[_0xc646('0x38')](_0xe93d3[_0xc646('0x33')],qs['fields'](_0x17c300[_0xc646('0x34')]['fields']));_0x42c95e['attributes']=_0x42c95e[_0xc646('0x37')][_0xc646('0x39')]?_0x42c95e[_0xc646('0x37')]:_0xe93d3['model'];if(!_0x17c300[_0xc646('0x34')][_0xc646('0x3a')](_0xc646('0x3b'))){_0x42c95e[_0xc646('0x22')]=qs[_0xc646('0x22')](_0x17c300[_0xc646('0x34')]['limit']);_0x42c95e[_0xc646('0x20')]=qs[_0xc646('0x20')](_0x17c300[_0xc646('0x34')]['offset']);}_0x42c95e[_0xc646('0x3c')]=qs['sort'](_0x17c300[_0xc646('0x34')][_0xc646('0x3d')]);_0x42c95e[_0xc646('0x3e')]=qs['filters'](_[_0xc646('0x3f')](_0x17c300['query'],_0xe93d3[_0xc646('0x36')]),_0x420a36);if(_0x17c300[_0xc646('0x34')][_0xc646('0x40')]){_0x42c95e[_0xc646('0x3e')]=_[_0xc646('0x41')](_0x42c95e['where'],{'$or':_['map'](_0x420a36,function(_0x1f75aa){if(_0x1f75aa[_0xc646('0x31')]!==_0xc646('0x42')){var _0x527bbc={};_0x527bbc[_0x1f75aa[_0xc646('0x2c')]]={'$like':'%'+_0x17c300[_0xc646('0x34')][_0xc646('0x40')]+'%'};return _0x527bbc;}})});}_0x42c95e=_[_0xc646('0x41')]({},_0x42c95e,_0x17c300['options']);var _0x2fe433={'where':_0x42c95e[_0xc646('0x3e')]};return db['OpenchannelQueueReport'][_0xc646('0x23')](_0x2fe433)[_0xc646('0x28')](function(_0x157bec){_0x45edf7[_0xc646('0x23')]=_0x157bec;if(_0x17c300[_0xc646('0x34')][_0xc646('0x43')]){_0x42c95e[_0xc646('0x44')]=[{'all':!![]}];}return db[_0xc646('0x2e')][_0xc646('0x45')](_0x42c95e);})[_0xc646('0x28')](function(_0x34de38){_0x45edf7[_0xc646('0x46')]=_0x34de38;return _0x45edf7;})[_0xc646('0x28')](respondWithFilteredResult(_0x3edd6f,_0x42c95e))[_0xc646('0x47')](handleError(_0x3edd6f,null));};exports[_0xc646('0x48')]=function(_0x78db09,_0x3544f1){var _0xc1d1e1={'raw':!![],'where':{'id':_0x78db09['params']['id']}},_0x1f03ea={};_0x1f03ea[_0xc646('0x33')]=_[_0xc646('0x35')](db[_0xc646('0x2e')]['rawAttributes']);_0x1f03ea[_0xc646('0x34')]=_[_0xc646('0x35')](_0x78db09[_0xc646('0x34')]);_0x1f03ea['filters']=_[_0xc646('0x38')](_0x1f03ea['model'],_0x1f03ea[_0xc646('0x34')]);_0xc1d1e1[_0xc646('0x37')]=_[_0xc646('0x38')](_0x1f03ea['model'],qs[_0xc646('0x49')](_0x78db09[_0xc646('0x34')][_0xc646('0x49')]));_0xc1d1e1['attributes']=_0xc1d1e1[_0xc646('0x37')][_0xc646('0x39')]?_0xc1d1e1[_0xc646('0x37')]:_0x1f03ea[_0xc646('0x33')];if(_0x78db09['query'][_0xc646('0x43')]){_0xc1d1e1[_0xc646('0x44')]=[{'all':!![]}];}_0xc1d1e1=_[_0xc646('0x41')]({},_0xc1d1e1,_0x78db09[_0xc646('0x4a')]);return db[_0xc646('0x2e')][_0xc646('0x4b')](_0xc1d1e1)['then'](handleEntityNotFound(_0x3544f1,null))[_0xc646('0x28')](respondWithResult(_0x3544f1,null))[_0xc646('0x47')](handleError(_0x3544f1,null));};exports[_0xc646('0x4c')]=function(_0x4507f9,_0x485641){return db[_0xc646('0x2e')][_0xc646('0x4c')](_0x4507f9['body'],{})[_0xc646('0x28')](respondWithResult(_0x485641,0xc9))[_0xc646('0x47')](handleError(_0x485641,null));};exports['update']=function(_0x3fe20f,_0x4adb57){if(_0x3fe20f[_0xc646('0x4d')]['id']){delete _0x3fe20f[_0xc646('0x4d')]['id'];}return db['OpenchannelQueueReport'][_0xc646('0x4b')]({'where':{'id':_0x3fe20f[_0xc646('0x4e')]['id']}})[_0xc646('0x28')](handleEntityNotFound(_0x4adb57,null))['then'](saveUpdates(_0x3fe20f['body'],null))[_0xc646('0x28')](respondWithResult(_0x4adb57,null))[_0xc646('0x47')](handleError(_0x4adb57,null));};exports[_0xc646('0x29')]=function(_0x31ad32,_0x59eaa0){return db['OpenchannelQueueReport'][_0xc646('0x4b')]({'where':{'id':_0x31ad32['params']['id']}})[_0xc646('0x28')](handleEntityNotFound(_0x59eaa0,null))['then'](removeEntity(_0x59eaa0,null))['catch'](handleError(_0x59eaa0,null));};exports[_0xc646('0x4f')]=function(_0x4ff523,_0x492770){return db[_0xc646('0x2e')][_0xc646('0x4f')]()['then'](respondWithResult(_0x492770,null))[_0xc646('0x47')](handleError(_0x492770,null));};
\ No newline at end of file
+var _0xb23e=['pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','findAll','catch','fields','include','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','nolimit','order','sort','where'];(function(_0x4178af,_0x388652){var _0x20f4b1=function(_0x504188){while(--_0x504188){_0x4178af['push'](_0x4178af['shift']());}};_0x20f4b1(++_0x388652);}(_0xb23e,0x12b));var _0xeb23=function(_0x38843b,_0x3b413c){_0x38843b=_0x38843b-0x0;var _0x27defd=_0xb23e[_0x38843b];return _0x27defd;};'use strict';var emlformat=require(_0xeb23('0x0'));var rimraf=require(_0xeb23('0x1'));var zipdir=require(_0xeb23('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeb23('0x3'));var BPromise=require(_0xeb23('0x4'));var Mustache=require(_0xeb23('0x5'));var util=require(_0xeb23('0x6'));var path=require(_0xeb23('0x7'));var sox=require(_0xeb23('0x8'));var csv=require('to-csv');var ejs=require(_0xeb23('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb23('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeb23('0xb'));var deskjs=require(_0xeb23('0xc'));var toCsv=require(_0xeb23('0xd'));var querystring=require(_0xeb23('0xe'));var Papa=require(_0xeb23('0xf'));var Redis=require(_0xeb23('0x10'));var authService=require(_0xeb23('0x11'));var qs=require(_0xeb23('0x12'));var as=require(_0xeb23('0x13'));var hardwareService=require(_0xeb23('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xeb23('0x15'));var config=require(_0xeb23('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb23('0x17'))['db'];function respondWithStatusCode(_0x2c0c94,_0x10f2c3){_0x10f2c3=_0x10f2c3||0xcc;return function(_0xad595d){if(_0xad595d){return _0x2c0c94[_0xeb23('0x18')](_0x10f2c3);}return _0x2c0c94[_0xeb23('0x19')](_0x10f2c3)['end']();};}function respondWithResult(_0x1210dc,_0x360613){_0x360613=_0x360613||0xc8;return function(_0x36972a){if(_0x36972a){return _0x1210dc[_0xeb23('0x19')](_0x360613)[_0xeb23('0x1a')](_0x36972a);}};}function respondWithFilteredResult(_0x186495,_0x12d503){return function(_0x27a6b9){if(_0x27a6b9){var _0x3ba577=typeof _0x12d503[_0xeb23('0x1b')]===_0xeb23('0x1c')&&typeof _0x12d503[_0xeb23('0x1d')]==='undefined';var _0xdad965=_0x27a6b9['count'];var _0x477ecd=_0x3ba577?0x0:_0x12d503['offset'];var _0x210d76=_0x3ba577?_0x27a6b9[_0xeb23('0x1e')]:_0x12d503[_0xeb23('0x1b')]+_0x12d503[_0xeb23('0x1d')];var _0x4a3eb5;if(_0x210d76>=_0xdad965){_0x210d76=_0xdad965;_0x4a3eb5=0xc8;}else{_0x4a3eb5=0xce;}_0x186495[_0xeb23('0x19')](_0x4a3eb5);return _0x186495[_0xeb23('0x1f')](_0xeb23('0x20'),_0x477ecd+'-'+_0x210d76+'/'+_0xdad965)[_0xeb23('0x1a')](_0x27a6b9);}return null;};}function patchUpdates(_0x4fd41c){return function(_0x1a37c1){try{jsonpatch[_0xeb23('0x21')](_0x1a37c1,_0x4fd41c,!![]);}catch(_0x631cc0){return BPromise[_0xeb23('0x22')](_0x631cc0);}return _0x1a37c1['save']();};}function saveUpdates(_0x1b966b,_0x3db7a0){return function(_0x871c2a){if(_0x871c2a){return _0x871c2a[_0xeb23('0x23')](_0x1b966b)[_0xeb23('0x24')](function(_0x1d16ce){return _0x1d16ce;});}return null;};}function removeEntity(_0x23df28,_0x2c9606){return function(_0x2f1613){if(_0x2f1613){return _0x2f1613[_0xeb23('0x25')]()[_0xeb23('0x24')](function(){_0x23df28[_0xeb23('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x263445,_0x5b043a){return function(_0x163fee){if(!_0x163fee){_0x263445[_0xeb23('0x18')](0x194);}return _0x163fee;};}function handleError(_0x576731,_0x5b4728){_0x5b4728=_0x5b4728||0x1f4;return function(_0x892da7){logger['error'](_0x892da7['stack']);if(_0x892da7[_0xeb23('0x26')]){delete _0x892da7['name'];}_0x576731['status'](_0x5b4728)[_0xeb23('0x27')](_0x892da7);};}exports[_0xeb23('0x28')]=function(_0x4cf451,_0xfe3c02){var _0x4332dc={},_0x20d162={},_0x46c1d7={'count':0x0,'rows':[]};var _0x5dd1e4=_['map'](db['OpenchannelQueueReport'][_0xeb23('0x29')],function(_0x5c6b7d){return{'name':_0x5c6b7d[_0xeb23('0x2a')],'type':_0x5c6b7d[_0xeb23('0x2b')][_0xeb23('0x2c')]};});_0x20d162['model']=_[_0xeb23('0x2d')](_0x5dd1e4,_0xeb23('0x26'));_0x20d162[_0xeb23('0x2e')]=_[_0xeb23('0x2f')](_0x4cf451[_0xeb23('0x2e')]);_0x20d162[_0xeb23('0x30')]=_[_0xeb23('0x31')](_0x20d162[_0xeb23('0x32')],_0x20d162[_0xeb23('0x2e')]);_0x4332dc[_0xeb23('0x33')]=_[_0xeb23('0x31')](_0x20d162[_0xeb23('0x32')],qs['fields'](_0x4cf451[_0xeb23('0x2e')]['fields']));_0x4332dc['attributes']=_0x4332dc['attributes']['length']?_0x4332dc[_0xeb23('0x33')]:_0x20d162[_0xeb23('0x32')];if(!_0x4cf451[_0xeb23('0x2e')]['hasOwnProperty'](_0xeb23('0x34'))){_0x4332dc[_0xeb23('0x1d')]=qs[_0xeb23('0x1d')](_0x4cf451['query'][_0xeb23('0x1d')]);_0x4332dc[_0xeb23('0x1b')]=qs['offset'](_0x4cf451['query'][_0xeb23('0x1b')]);}_0x4332dc[_0xeb23('0x35')]=qs['sort'](_0x4cf451[_0xeb23('0x2e')][_0xeb23('0x36')]);_0x4332dc[_0xeb23('0x37')]=qs['filters'](_[_0xeb23('0x38')](_0x4cf451[_0xeb23('0x2e')],_0x20d162['filters']),_0x5dd1e4);if(_0x4cf451[_0xeb23('0x2e')][_0xeb23('0x39')]){_0x4332dc[_0xeb23('0x37')]=_[_0xeb23('0x3a')](_0x4332dc['where'],{'$or':_['map'](_0x5dd1e4,function(_0xc623e3){if(_0xc623e3['type']!==_0xeb23('0x3b')){var _0x1935d9={};_0x1935d9[_0xc623e3['name']]={'$like':'%'+_0x4cf451[_0xeb23('0x2e')][_0xeb23('0x39')]+'%'};return _0x1935d9;}})});}_0x4332dc=_[_0xeb23('0x3a')]({},_0x4332dc,_0x4cf451[_0xeb23('0x3c')]);var _0x2be66c={'where':_0x4332dc['where']};return db[_0xeb23('0x3d')]['count'](_0x2be66c)[_0xeb23('0x24')](function(_0x2d3cfd){_0x46c1d7[_0xeb23('0x1e')]=_0x2d3cfd;if(_0x4cf451[_0xeb23('0x2e')][_0xeb23('0x3e')]){_0x4332dc['include']=[{'all':!![]}];}return db[_0xeb23('0x3d')][_0xeb23('0x3f')](_0x4332dc);})[_0xeb23('0x24')](function(_0x1b07e9){_0x46c1d7['rows']=_0x1b07e9;return _0x46c1d7;})[_0xeb23('0x24')](respondWithFilteredResult(_0xfe3c02,_0x4332dc))[_0xeb23('0x40')](handleError(_0xfe3c02,null));};exports['show']=function(_0x2cb586,_0x3e20f4){var _0x538f4d={'raw':!![],'where':{'id':_0x2cb586['params']['id']}},_0x1e6268={};_0x1e6268['model']=_[_0xeb23('0x2f')](db[_0xeb23('0x3d')][_0xeb23('0x29')]);_0x1e6268[_0xeb23('0x2e')]=_[_0xeb23('0x2f')](_0x2cb586[_0xeb23('0x2e')]);_0x1e6268[_0xeb23('0x30')]=_[_0xeb23('0x31')](_0x1e6268[_0xeb23('0x32')],_0x1e6268['query']);_0x538f4d[_0xeb23('0x33')]=_[_0xeb23('0x31')](_0x1e6268[_0xeb23('0x32')],qs[_0xeb23('0x41')](_0x2cb586[_0xeb23('0x2e')][_0xeb23('0x41')]));_0x538f4d[_0xeb23('0x33')]=_0x538f4d[_0xeb23('0x33')]['length']?_0x538f4d[_0xeb23('0x33')]:_0x1e6268[_0xeb23('0x32')];if(_0x2cb586['query'][_0xeb23('0x3e')]){_0x538f4d[_0xeb23('0x42')]=[{'all':!![]}];}_0x538f4d=_[_0xeb23('0x3a')]({},_0x538f4d,_0x2cb586[_0xeb23('0x3c')]);return db[_0xeb23('0x3d')]['find'](_0x538f4d)['then'](handleEntityNotFound(_0x3e20f4,null))[_0xeb23('0x24')](respondWithResult(_0x3e20f4,null))[_0xeb23('0x40')](handleError(_0x3e20f4,null));};exports[_0xeb23('0x43')]=function(_0x2ec394,_0x3acee9){return db[_0xeb23('0x3d')]['create'](_0x2ec394[_0xeb23('0x44')],{})[_0xeb23('0x24')](respondWithResult(_0x3acee9,0xc9))[_0xeb23('0x40')](handleError(_0x3acee9,null));};exports[_0xeb23('0x23')]=function(_0x1eeb21,_0x30d4a1){if(_0x1eeb21[_0xeb23('0x44')]['id']){delete _0x1eeb21[_0xeb23('0x44')]['id'];}return db[_0xeb23('0x3d')]['find']({'where':{'id':_0x1eeb21[_0xeb23('0x45')]['id']}})[_0xeb23('0x24')](handleEntityNotFound(_0x30d4a1,null))[_0xeb23('0x24')](saveUpdates(_0x1eeb21[_0xeb23('0x44')],null))[_0xeb23('0x24')](respondWithResult(_0x30d4a1,null))[_0xeb23('0x40')](handleError(_0x30d4a1,null));};exports['destroy']=function(_0x439ce4,_0x19dfb9){return db[_0xeb23('0x3d')]['find']({'where':{'id':_0x439ce4[_0xeb23('0x45')]['id']}})[_0xeb23('0x24')](handleEntityNotFound(_0x19dfb9,null))[_0xeb23('0x24')](removeEntity(_0x19dfb9,null))[_0xeb23('0x40')](handleError(_0x19dfb9,null));};exports[_0xeb23('0x46')]=function(_0x2bc6dd,_0x22105c){return db[_0xeb23('0x3d')][_0xeb23('0x46')]()[_0xeb23('0x24')](respondWithResult(_0x22105c,null))[_0xeb23('0x40')](handleError(_0x22105c,null));};
\ No newline at end of file
index 40fd78d..223aa25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x34503b,_0x54b357){var _0x54ab9a=function(_0x27f1ed){while(--_0x27f1ed){_0x34503b['push'](_0x34503b['shift']());}};_0x54ab9a(++_0x54b357);}(_0x5fc3,0xa8));var _0x35fc=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0x5fc3[_0x43f881];return _0x365c14;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x38c347,_0x32fe80){var _0x4bbf35=function(_0x437a76){while(--_0x437a76){_0x38c347['push'](_0x38c347['shift']());}};_0x4bbf35(++_0x32fe80);}(_0x1261,0x144));var _0x1126=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x1261[_0x3c4062];return _0x3f5bf3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 439a9a2..881a043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','debug','catch','UpdateOpenchannelQueueReport','body','attributes','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3342('0x0'));var BPromise=require(_0x3342('0x1'));var rs=require(_0x3342('0x2'));var fs=require('fs');var Redis=require(_0x3342('0x3'));var db=require(_0x3342('0x4'))['db'];var utils=require(_0x3342('0x5'));var logger=require(_0x3342('0x6'))(_0x3342('0x7'));var config=require(_0x3342('0x8'));var jayson=require(_0x3342('0x9'));var client=jayson[_0x3342('0xa')][_0x3342('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29c40c,_0x420d4b,_0x76422d){return new BPromise(function(_0xce08ab,_0x305d13){return client[_0x3342('0xc')](_0x29c40c,_0x76422d)[_0x3342('0xd')](function(_0x4ae4f3){logger['info'](_0x3342('0xe'),_0x420d4b,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x420d4b,'request\x20sent',JSON[_0x3342('0xf')](_0x4ae4f3));if(_0x4ae4f3[_0x3342('0x10')]){if(_0x4ae4f3['error'][_0x3342('0x11')]===0x1f4){logger['error'](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')]['message']);return _0x305d13(_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);}logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x4ae4f3[_0x3342('0x10')][_0x3342('0x12')]);return _0xce08ab(_0x4ae4f3[_0x3342('0x10')]['message']);}else{logger[_0x3342('0x13')](_0x3342('0xe'),_0x420d4b,'request\x20sent');_0xce08ab(_0x4ae4f3[_0x3342('0x14')][_0x3342('0x12')]);}})['catch'](function(_0x554f9c){logger[_0x3342('0x10')](_0x3342('0xe'),_0x420d4b,_0x554f9c);_0x305d13(_0x554f9c);});});}exports[_0x3342('0x15')]=function(_0x2075cb){var _0x12947a=this;return new Promise(function(_0x156c24,_0x45a3ca){return db[_0x3342('0x16')][_0x3342('0x17')](_0x2075cb['body'],{'raw':_0x2075cb[_0x3342('0x18')]?_0x2075cb[_0x3342('0x18')][_0x3342('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cb86f){logger[_0x3342('0x13')]('CreateOpenchannelQueueReport',_0x2075cb);logger[_0x3342('0x1a')](_0x3342('0x15'),_0x2075cb,JSON['stringify'](_0x3cb86f));_0x156c24(_0x3cb86f);})[_0x3342('0x1b')](function(_0x5a0658){logger[_0x3342('0x10')](_0x3342('0x15'),_0x5a0658[_0x3342('0x12')],_0x2075cb);_0x45a3ca(_0x12947a[_0x3342('0x10')](0x1f4,_0x5a0658[_0x3342('0x12')]));});});};exports[_0x3342('0x1c')]=function(_0x26eb87){var _0x2d8622=this;return new Promise(function(_0x5d4f14,_0x30ffc9){return db['OpenchannelQueueReport']['update'](_0x26eb87[_0x3342('0x1d')],{'raw':_0x26eb87['options']?_0x26eb87['options'][_0x3342('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26eb87['options']?_0x26eb87[_0x3342('0x18')]['where']||null:null,'attributes':_0x26eb87['options']?_0x26eb87['options'][_0x3342('0x1e')]||null:null,'limit':_0x26eb87[_0x3342('0x18')]?_0x26eb87[_0x3342('0x18')]['limit']||null:null})[_0x3342('0xd')](function(_0x1275e2){logger[_0x3342('0x13')](_0x3342('0x1c'),_0x26eb87);logger['debug'](_0x3342('0x1c'),_0x26eb87,JSON[_0x3342('0xf')](_0x1275e2));_0x5d4f14(_0x1275e2);})[_0x3342('0x1b')](function(_0x301114){logger[_0x3342('0x10')](_0x3342('0x1c'),_0x301114[_0x3342('0x12')],_0x26eb87);_0x30ffc9(_0x2d8622['error'](0x1f4,_0x301114[_0x3342('0x12')]));});});};
\ No newline at end of file
+var _0xc2da=['request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelQueueReport','create','body','options','stringify','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','attributes','limit','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc2da,0x124));var _0xac2d=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0xc2da[_0x2e067a];return _0xc64976;};'use strict';var _=require(_0xac2d('0x0'));var util=require('util');var moment=require(_0xac2d('0x1'));var BPromise=require('bluebird');var rs=require(_0xac2d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac2d('0x3'))['db'];var utils=require(_0xac2d('0x4'));var logger=require(_0xac2d('0x5'))(_0xac2d('0x6'));var config=require(_0xac2d('0x7'));var jayson=require(_0xac2d('0x8'));var client=jayson[_0xac2d('0x9')][_0xac2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0a36,_0x3ef58a,_0x41d5ae){return new BPromise(function(_0x515055,_0x5cbc87){return client[_0xac2d('0xb')](_0x2b0a36,_0x41d5ae)['then'](function(_0x4271fa){logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));logger[_0xac2d('0xf')](_0xac2d('0x10'),_0x3ef58a,'request\x20sent',JSON['stringify'](_0x4271fa));if(_0x4271fa[_0xac2d('0x11')]){if(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x12')]===0x1f4){logger[_0xac2d('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x5cbc87(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}logger[_0xac2d('0x11')](_0xac2d('0xd'),_0x3ef58a,_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);return _0x515055(_0x4271fa[_0xac2d('0x11')][_0xac2d('0x13')]);}else{logger[_0xac2d('0xc')](_0xac2d('0xd'),_0x3ef58a,_0xac2d('0xe'));_0x515055(_0x4271fa[_0xac2d('0x14')][_0xac2d('0x13')]);}})['catch'](function(_0x3170ae){logger[_0xac2d('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3ef58a,_0x3170ae);_0x5cbc87(_0x3170ae);});});}exports[_0xac2d('0x15')]=function(_0xed956b){var _0x1d8e9f=this;return new Promise(function(_0x4d34fa,_0x45c12b){return db['OpenchannelQueueReport'][_0xac2d('0x16')](_0xed956b[_0xac2d('0x17')],{'raw':_0xed956b['options']?_0xed956b[_0xac2d('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x510e85){logger['info'](_0xac2d('0x15'),_0xed956b);logger[_0xac2d('0xf')](_0xac2d('0x15'),_0xed956b,JSON[_0xac2d('0x19')](_0x510e85));_0x4d34fa(_0x510e85);})[_0xac2d('0x1a')](function(_0x391911){logger[_0xac2d('0x11')](_0xac2d('0x15'),_0x391911[_0xac2d('0x13')],_0xed956b);_0x45c12b(_0x1d8e9f[_0xac2d('0x11')](0x1f4,_0x391911[_0xac2d('0x13')]));});});};exports[_0xac2d('0x1b')]=function(_0x1df55b){var _0xa8a259=this;return new Promise(function(_0x3edde3,_0x8d0e32){return db[_0xac2d('0x1c')][_0xac2d('0x1d')](_0x1df55b[_0xac2d('0x17')],{'raw':_0x1df55b['options']?_0x1df55b[_0xac2d('0x18')][_0xac2d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1df55b[_0xac2d('0x18')]?_0x1df55b[_0xac2d('0x18')]['where']||null:null,'attributes':_0x1df55b['options']?_0x1df55b[_0xac2d('0x18')][_0xac2d('0x1f')]||null:null,'limit':_0x1df55b[_0xac2d('0x18')]?_0x1df55b[_0xac2d('0x18')][_0xac2d('0x20')]||null:null})[_0xac2d('0x21')](function(_0x104af8){logger[_0xac2d('0xc')](_0xac2d('0x1b'),_0x1df55b);logger['debug']('UpdateOpenchannelQueueReport',_0x1df55b,JSON[_0xac2d('0x19')](_0x104af8));_0x3edde3(_0x104af8);})[_0xac2d('0x1a')](function(_0x3f1094){logger[_0xac2d('0x11')](_0xac2d('0x1b'),_0x3f1094['message'],_0x1df55b);_0x8d0e32(_0xa8a259[_0xac2d('0x11')](0x1f4,_0x3f1094[_0xac2d('0x13')]));});});};
\ No newline at end of file
index e76efbd..7f2c410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44b2=['delete','/:id','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x44b2,0x121));var _0x244b=function(_0xcf2b8e,_0xcb1818){_0xcf2b8e=_0xcf2b8e-0x0;var _0x1e6133=_0x44b2[_0xcf2b8e];return _0x1e6133;};'use strict';var multer=require(_0x244b('0x0'));var util=require(_0x244b('0x1'));var path=require(_0x244b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x244b('0x3'));var config=require(_0x244b('0x4'));var controller=require(_0x244b('0x5'));router[_0x244b('0x6')]('/',auth[_0x244b('0x7')](),controller[_0x244b('0x8')]);router[_0x244b('0x6')](_0x244b('0x9'),auth[_0x244b('0x7')](),controller[_0x244b('0xa')]);router[_0x244b('0x6')]('/:id',auth[_0x244b('0x7')](),controller[_0x244b('0xb')]);router[_0x244b('0xc')]('/',auth[_0x244b('0x7')](),controller[_0x244b('0xd')]);router[_0x244b('0xe')]('/:id',auth[_0x244b('0x7')](),controller['update']);router[_0x244b('0xf')](_0x244b('0x10'),auth['isAuthenticated'](),controller[_0x244b('0x11')]);module[_0x244b('0x12')]=router;
\ No newline at end of file
+var _0x5665=['isAuthenticated','/describe','/:id','show','post','create','update','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0xafd799,_0x4f8539){var _0x3fa9ed=function(_0x139725){while(--_0x139725){_0xafd799['push'](_0xafd799['shift']());}};_0x3fa9ed(++_0x4f8539);}(_0x5665,0xc3));var _0x5566=function(_0x123a65,_0x59ca5b){_0x123a65=_0x123a65-0x0;var _0x37d2ed=_0x5665[_0x123a65];return _0x37d2ed;};'use strict';var multer=require(_0x5566('0x0'));var util=require(_0x5566('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5566('0x2'));var router=express[_0x5566('0x3')]();var fs_extra=require(_0x5566('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5566('0x5'));var config=require(_0x5566('0x6'));var controller=require(_0x5566('0x7'));router[_0x5566('0x8')]('/',auth[_0x5566('0x9')](),controller['index']);router[_0x5566('0x8')](_0x5566('0xa'),auth[_0x5566('0x9')](),controller['describe']);router['get'](_0x5566('0xb'),auth[_0x5566('0x9')](),controller[_0x5566('0xc')]);router[_0x5566('0xd')]('/',auth[_0x5566('0x9')](),controller[_0x5566('0xe')]);router['put'](_0x5566('0xb'),auth['isAuthenticated'](),controller[_0x5566('0xf')]);router['delete'](_0x5566('0xb'),auth[_0x5566('0x9')](),controller[_0x5566('0x10')]);module['exports']=router;
\ No newline at end of file
index fe8e1e7..f0c27e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4e98f5,_0x1dc38e){_0x4e98f5=_0x4e98f5-0x0;var _0x341f26=_0x9bde[_0x4e98f5];return _0x341f26;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index 6e2fde4..5056320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f27=['undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end'];(function(_0x526211,_0x49b917){var _0x20dbf6=function(_0x1f8ee0){while(--_0x1f8ee0){_0x526211['push'](_0x526211['shift']());}};_0x20dbf6(++_0x49b917);}(_0x6f27,0x76));var _0x76f2=function(_0x2573f7,_0x1200bc){_0x2573f7=_0x2573f7-0x0;var _0x57740d=_0x6f27[_0x2573f7];return _0x57740d;};'use strict';var emlformat=require(_0x76f2('0x0'));var rimraf=require(_0x76f2('0x1'));var zipdir=require(_0x76f2('0x2'));var jsonpatch=require(_0x76f2('0x3'));var rp=require(_0x76f2('0x4'));var moment=require(_0x76f2('0x5'));var BPromise=require(_0x76f2('0x6'));var Mustache=require(_0x76f2('0x7'));var util=require('util');var path=require(_0x76f2('0x8'));var sox=require('sox');var csv=require(_0x76f2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76f2('0xa'));var squel=require(_0x76f2('0xb'));var crypto=require('crypto');var jsforce=require(_0x76f2('0xc'));var deskjs=require(_0x76f2('0xd'));var toCsv=require(_0x76f2('0x9'));var querystring=require('querystring');var Papa=require(_0x76f2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x76f2('0xf'));var as=require(_0x76f2('0x10'));var hardwareService=require(_0x76f2('0x11'));var logger=require(_0x76f2('0x12'))(_0x76f2('0x13'));var utils=require(_0x76f2('0x14'));var config=require(_0x76f2('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24d53c,_0x37c518){_0x37c518=_0x37c518||0xcc;return function(_0x38b4ee){if(_0x38b4ee){return _0x24d53c['sendStatus'](_0x37c518);}return _0x24d53c[_0x76f2('0x16')](_0x37c518)[_0x76f2('0x17')]();};}function respondWithResult(_0x4686ce,_0x3fb65e){_0x3fb65e=_0x3fb65e||0xc8;return function(_0x1e80e9){if(_0x1e80e9){return _0x4686ce[_0x76f2('0x16')](_0x3fb65e)['json'](_0x1e80e9);}};}function respondWithFilteredResult(_0x380eda,_0x5947e1){return function(_0x39ae18){if(_0x39ae18){var _0x5ed5c9=typeof _0x5947e1['offset']===_0x76f2('0x18')&&typeof _0x5947e1[_0x76f2('0x19')]===_0x76f2('0x18');var _0x37e7ce=_0x39ae18[_0x76f2('0x1a')];var _0x32bcb5=_0x5ed5c9?0x0:_0x5947e1[_0x76f2('0x1b')];var _0xce32fd=_0x5ed5c9?_0x39ae18[_0x76f2('0x1a')]:_0x5947e1[_0x76f2('0x1b')]+_0x5947e1[_0x76f2('0x19')];var _0xbf0f95;if(_0xce32fd>=_0x37e7ce){_0xce32fd=_0x37e7ce;_0xbf0f95=0xc8;}else{_0xbf0f95=0xce;}_0x380eda[_0x76f2('0x16')](_0xbf0f95);return _0x380eda[_0x76f2('0x1c')](_0x76f2('0x1d'),_0x32bcb5+'-'+_0xce32fd+'/'+_0x37e7ce)[_0x76f2('0x1e')](_0x39ae18);}return null;};}function patchUpdates(_0x4e7853){return function(_0x166fe6){try{jsonpatch[_0x76f2('0x1f')](_0x166fe6,_0x4e7853,!![]);}catch(_0x4ef114){return BPromise[_0x76f2('0x20')](_0x4ef114);}return _0x166fe6[_0x76f2('0x21')]();};}function saveUpdates(_0x358d62,_0x3b2f8c){return function(_0x3b8281){if(_0x3b8281){return _0x3b8281['update'](_0x358d62)[_0x76f2('0x22')](function(_0x2bfb04){return _0x2bfb04;});}return null;};}function removeEntity(_0x1e7d82,_0x30d690){return function(_0xda0e7b){if(_0xda0e7b){return _0xda0e7b['destroy']()['then'](function(){_0x1e7d82[_0x76f2('0x16')](0xcc)[_0x76f2('0x17')]();});}};}function handleEntityNotFound(_0x5ba02d,_0x9ca391){return function(_0x314254){if(!_0x314254){_0x5ba02d[_0x76f2('0x23')](0x194);}return _0x314254;};}function handleError(_0x547cc3,_0x1103d5){_0x1103d5=_0x1103d5||0x1f4;return function(_0x253a72){logger['error'](_0x253a72[_0x76f2('0x24')]);if(_0x253a72[_0x76f2('0x25')]){delete _0x253a72[_0x76f2('0x25')];}_0x547cc3['status'](_0x1103d5)[_0x76f2('0x26')](_0x253a72);};}exports['index']=function(_0x34c68b,_0x42c190){var _0x3a374f={},_0x4ae67b={},_0x3bb773={'count':0x0,'rows':[]};var _0x45e149=_[_0x76f2('0x27')](db[_0x76f2('0x28')][_0x76f2('0x29')],function(_0x28e329){return{'name':_0x28e329[_0x76f2('0x2a')],'type':_0x28e329['type'][_0x76f2('0x2b')]};});_0x4ae67b[_0x76f2('0x2c')]=_[_0x76f2('0x27')](_0x45e149,'name');_0x4ae67b[_0x76f2('0x2d')]=_[_0x76f2('0x2e')](_0x34c68b[_0x76f2('0x2d')]);_0x4ae67b[_0x76f2('0x2f')]=_['intersection'](_0x4ae67b[_0x76f2('0x2c')],_0x4ae67b[_0x76f2('0x2d')]);_0x3a374f[_0x76f2('0x30')]=_['intersection'](_0x4ae67b[_0x76f2('0x2c')],qs['fields'](_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x31')]));_0x3a374f[_0x76f2('0x30')]=_0x3a374f[_0x76f2('0x30')][_0x76f2('0x32')]?_0x3a374f[_0x76f2('0x30')]:_0x4ae67b[_0x76f2('0x2c')];if(!_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x33')]('nolimit')){_0x3a374f[_0x76f2('0x19')]=qs[_0x76f2('0x19')](_0x34c68b[_0x76f2('0x2d')]['limit']);_0x3a374f['offset']=qs[_0x76f2('0x1b')](_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x1b')]);}_0x3a374f[_0x76f2('0x34')]=qs[_0x76f2('0x35')](_0x34c68b['query'][_0x76f2('0x35')]);_0x3a374f[_0x76f2('0x36')]=qs[_0x76f2('0x2f')](_['pick'](_0x34c68b[_0x76f2('0x2d')],_0x4ae67b[_0x76f2('0x2f')]),_0x45e149);if(_0x34c68b['query'][_0x76f2('0x37')]){_0x3a374f['where']=_[_0x76f2('0x38')](_0x3a374f['where'],{'$or':_[_0x76f2('0x27')](_0x45e149,function(_0x32d759){if(_0x32d759[_0x76f2('0x39')]!==_0x76f2('0x3a')){var _0x3f698b={};_0x3f698b[_0x32d759['name']]={'$like':'%'+_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x37')]+'%'};return _0x3f698b;}})});}_0x3a374f=_[_0x76f2('0x38')]({},_0x3a374f,_0x34c68b[_0x76f2('0x3b')]);var _0x2f851d={'where':_0x3a374f[_0x76f2('0x36')]};return db[_0x76f2('0x28')]['count'](_0x2f851d)[_0x76f2('0x22')](function(_0x4b6fb2){_0x3bb773[_0x76f2('0x1a')]=_0x4b6fb2;if(_0x34c68b[_0x76f2('0x2d')][_0x76f2('0x3c')]){_0x3a374f[_0x76f2('0x3d')]=[{'all':!![]}];}return db[_0x76f2('0x28')][_0x76f2('0x3e')](_0x3a374f);})['then'](function(_0x218c8b){_0x3bb773['rows']=_0x218c8b;return _0x3bb773;})[_0x76f2('0x22')](respondWithFilteredResult(_0x42c190,_0x3a374f))[_0x76f2('0x3f')](handleError(_0x42c190,null));};exports[_0x76f2('0x40')]=function(_0x17b425,_0x18a005){var _0x59506a={'raw':!![],'where':{'id':_0x17b425[_0x76f2('0x41')]['id']}},_0x1c3c4a={};_0x1c3c4a[_0x76f2('0x2c')]=_[_0x76f2('0x2e')](db[_0x76f2('0x28')][_0x76f2('0x29')]);_0x1c3c4a['query']=_[_0x76f2('0x2e')](_0x17b425[_0x76f2('0x2d')]);_0x1c3c4a[_0x76f2('0x2f')]=_[_0x76f2('0x42')](_0x1c3c4a[_0x76f2('0x2c')],_0x1c3c4a['query']);_0x59506a[_0x76f2('0x30')]=_[_0x76f2('0x42')](_0x1c3c4a['model'],qs[_0x76f2('0x31')](_0x17b425['query'][_0x76f2('0x31')]));_0x59506a[_0x76f2('0x30')]=_0x59506a['attributes'][_0x76f2('0x32')]?_0x59506a['attributes']:_0x1c3c4a[_0x76f2('0x2c')];if(_0x17b425[_0x76f2('0x2d')]['includeAll']){_0x59506a[_0x76f2('0x3d')]=[{'all':!![]}];}_0x59506a=_[_0x76f2('0x38')]({},_0x59506a,_0x17b425[_0x76f2('0x3b')]);return db[_0x76f2('0x28')][_0x76f2('0x43')](_0x59506a)[_0x76f2('0x22')](handleEntityNotFound(_0x18a005,null))[_0x76f2('0x22')](respondWithResult(_0x18a005,null))[_0x76f2('0x3f')](handleError(_0x18a005,null));};exports[_0x76f2('0x44')]=function(_0x1e179d,_0x2ef10b){return db[_0x76f2('0x28')][_0x76f2('0x44')](_0x1e179d['body'],{})['then'](respondWithResult(_0x2ef10b,0xc9))[_0x76f2('0x3f')](handleError(_0x2ef10b,null));};exports['update']=function(_0x49799f,_0x4ae8ce){if(_0x49799f[_0x76f2('0x45')]['id']){delete _0x49799f['body']['id'];}return db[_0x76f2('0x28')][_0x76f2('0x43')]({'where':{'id':_0x49799f[_0x76f2('0x41')]['id']}})[_0x76f2('0x22')](handleEntityNotFound(_0x4ae8ce,null))['then'](saveUpdates(_0x49799f[_0x76f2('0x45')],null))['then'](respondWithResult(_0x4ae8ce,null))['catch'](handleError(_0x4ae8ce,null));};exports['destroy']=function(_0x45a8e0,_0x4f273b){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x45a8e0[_0x76f2('0x41')]['id']}})[_0x76f2('0x22')](handleEntityNotFound(_0x4f273b,null))[_0x76f2('0x22')](removeEntity(_0x4f273b,null))['catch'](handleError(_0x4f273b,null));};exports['describe']=function(_0x58b5bf,_0x4d0be6){return db[_0x76f2('0x28')][_0x76f2('0x46')]()['then'](respondWithResult(_0x4d0be6,null))[_0x76f2('0x3f')](handleError(_0x4d0be6,null));};
\ No newline at end of file
+var _0xa966=['sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy'];(function(_0x28321a,_0x5555a1){var _0x5eb326=function(_0x1315a1){while(--_0x1315a1){_0x28321a['push'](_0x28321a['shift']());}};_0x5eb326(++_0x5555a1);}(_0xa966,0x71));var _0x6a96=function(_0x55891a,_0x49cdf2){_0x55891a=_0x55891a-0x0;var _0x49f23e=_0xa966[_0x55891a];return _0x49f23e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6a96('0x0'));var jsonpatch=require(_0x6a96('0x1'));var rp=require(_0x6a96('0x2'));var moment=require(_0x6a96('0x3'));var BPromise=require(_0x6a96('0x4'));var Mustache=require(_0x6a96('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6a96('0x6'));var csv=require(_0x6a96('0x7'));var ejs=require(_0x6a96('0x8'));var fs=require('fs');var fs_extra=require(_0x6a96('0x9'));var _=require(_0x6a96('0xa'));var squel=require(_0x6a96('0xb'));var crypto=require(_0x6a96('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6a96('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6a96('0xd'));var authService=require(_0x6a96('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a96('0xf'));var hardwareService=require(_0x6a96('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x6a96('0x11'));var config=require(_0x6a96('0x12'));var licenseUtil=require(_0x6a96('0x13'));var db=require(_0x6a96('0x14'))['db'];function respondWithStatusCode(_0x2de254,_0x23efef){_0x23efef=_0x23efef||0xcc;return function(_0x24c555){if(_0x24c555){return _0x2de254['sendStatus'](_0x23efef);}return _0x2de254[_0x6a96('0x15')](_0x23efef)[_0x6a96('0x16')]();};}function respondWithResult(_0x5ec211,_0x3b502d){_0x3b502d=_0x3b502d||0xc8;return function(_0x331c82){if(_0x331c82){return _0x5ec211[_0x6a96('0x15')](_0x3b502d)[_0x6a96('0x17')](_0x331c82);}};}function respondWithFilteredResult(_0x2f629f,_0x55829b){return function(_0x21fef7){if(_0x21fef7){var _0x338ab0=typeof _0x55829b[_0x6a96('0x18')]===_0x6a96('0x19')&&typeof _0x55829b['limit']==='undefined';var _0x317837=_0x21fef7['count'];var _0x3dac3f=_0x338ab0?0x0:_0x55829b[_0x6a96('0x18')];var _0x20fa70=_0x338ab0?_0x21fef7[_0x6a96('0x1a')]:_0x55829b['offset']+_0x55829b[_0x6a96('0x1b')];var _0x15d90d;if(_0x20fa70>=_0x317837){_0x20fa70=_0x317837;_0x15d90d=0xc8;}else{_0x15d90d=0xce;}_0x2f629f[_0x6a96('0x15')](_0x15d90d);return _0x2f629f['set'](_0x6a96('0x1c'),_0x3dac3f+'-'+_0x20fa70+'/'+_0x317837)[_0x6a96('0x17')](_0x21fef7);}return null;};}function patchUpdates(_0x4950ab){return function(_0x524890){try{jsonpatch[_0x6a96('0x1d')](_0x524890,_0x4950ab,!![]);}catch(_0x4b9ac5){return BPromise['reject'](_0x4b9ac5);}return _0x524890[_0x6a96('0x1e')]();};}function saveUpdates(_0x53b1e9,_0xca8fa2){return function(_0x23ec3b){if(_0x23ec3b){return _0x23ec3b[_0x6a96('0x1f')](_0x53b1e9)['then'](function(_0x79567d){return _0x79567d;});}return null;};}function removeEntity(_0x3765aa,_0x12fa8a){return function(_0x2f78fa){if(_0x2f78fa){return _0x2f78fa[_0x6a96('0x20')]()['then'](function(){_0x3765aa[_0x6a96('0x15')](0xcc)[_0x6a96('0x16')]();});}};}function handleEntityNotFound(_0x318839,_0x3c93b0){return function(_0x1370d1){if(!_0x1370d1){_0x318839[_0x6a96('0x21')](0x194);}return _0x1370d1;};}function handleError(_0x2c6080,_0xb7e8b5){_0xb7e8b5=_0xb7e8b5||0x1f4;return function(_0xf35533){logger[_0x6a96('0x22')](_0xf35533[_0x6a96('0x23')]);if(_0xf35533[_0x6a96('0x24')]){delete _0xf35533[_0x6a96('0x24')];}_0x2c6080[_0x6a96('0x15')](_0xb7e8b5)[_0x6a96('0x25')](_0xf35533);};}exports[_0x6a96('0x26')]=function(_0xa31d43,_0x393522){var _0x1f8e03={},_0x3c230a={},_0x2df03c={'count':0x0,'rows':[]};var _0x1853f6=_[_0x6a96('0x27')](db[_0x6a96('0x28')][_0x6a96('0x29')],function(_0xf93da3){return{'name':_0xf93da3[_0x6a96('0x2a')],'type':_0xf93da3[_0x6a96('0x2b')]['key']};});_0x3c230a[_0x6a96('0x2c')]=_['map'](_0x1853f6,_0x6a96('0x24'));_0x3c230a[_0x6a96('0x2d')]=_[_0x6a96('0x2e')](_0xa31d43[_0x6a96('0x2d')]);_0x3c230a[_0x6a96('0x2f')]=_[_0x6a96('0x30')](_0x3c230a[_0x6a96('0x2c')],_0x3c230a['query']);_0x1f8e03[_0x6a96('0x31')]=_[_0x6a96('0x30')](_0x3c230a[_0x6a96('0x2c')],qs[_0x6a96('0x32')](_0xa31d43[_0x6a96('0x2d')][_0x6a96('0x32')]));_0x1f8e03['attributes']=_0x1f8e03[_0x6a96('0x31')][_0x6a96('0x33')]?_0x1f8e03[_0x6a96('0x31')]:_0x3c230a[_0x6a96('0x2c')];if(!_0xa31d43[_0x6a96('0x2d')][_0x6a96('0x34')](_0x6a96('0x35'))){_0x1f8e03['limit']=qs['limit'](_0xa31d43['query']['limit']);_0x1f8e03[_0x6a96('0x18')]=qs[_0x6a96('0x18')](_0xa31d43['query']['offset']);}_0x1f8e03[_0x6a96('0x36')]=qs['sort'](_0xa31d43[_0x6a96('0x2d')][_0x6a96('0x37')]);_0x1f8e03[_0x6a96('0x38')]=qs['filters'](_[_0x6a96('0x39')](_0xa31d43[_0x6a96('0x2d')],_0x3c230a[_0x6a96('0x2f')]),_0x1853f6);if(_0xa31d43['query'][_0x6a96('0x3a')]){_0x1f8e03['where']=_[_0x6a96('0x3b')](_0x1f8e03['where'],{'$or':_['map'](_0x1853f6,function(_0x3cc2a1){if(_0x3cc2a1[_0x6a96('0x2b')]!==_0x6a96('0x3c')){var _0x1873d3={};_0x1873d3[_0x3cc2a1['name']]={'$like':'%'+_0xa31d43[_0x6a96('0x2d')][_0x6a96('0x3a')]+'%'};return _0x1873d3;}})});}_0x1f8e03=_[_0x6a96('0x3b')]({},_0x1f8e03,_0xa31d43[_0x6a96('0x3d')]);var _0x46f7b7={'where':_0x1f8e03[_0x6a96('0x38')]};return db[_0x6a96('0x28')][_0x6a96('0x1a')](_0x46f7b7)[_0x6a96('0x3e')](function(_0x349f2e){_0x2df03c['count']=_0x349f2e;if(_0xa31d43[_0x6a96('0x2d')][_0x6a96('0x3f')]){_0x1f8e03[_0x6a96('0x40')]=[{'all':!![]}];}return db[_0x6a96('0x28')][_0x6a96('0x41')](_0x1f8e03);})['then'](function(_0x269525){_0x2df03c[_0x6a96('0x42')]=_0x269525;return _0x2df03c;})['then'](respondWithFilteredResult(_0x393522,_0x1f8e03))[_0x6a96('0x43')](handleError(_0x393522,null));};exports['show']=function(_0x47205d,_0x457138){var _0x4e6cdc={'raw':!![],'where':{'id':_0x47205d[_0x6a96('0x44')]['id']}},_0x1a2380={};_0x1a2380[_0x6a96('0x2c')]=_['keys'](db['OpenchannelTransferReport']['rawAttributes']);_0x1a2380[_0x6a96('0x2d')]=_['keys'](_0x47205d[_0x6a96('0x2d')]);_0x1a2380[_0x6a96('0x2f')]=_[_0x6a96('0x30')](_0x1a2380[_0x6a96('0x2c')],_0x1a2380[_0x6a96('0x2d')]);_0x4e6cdc['attributes']=_[_0x6a96('0x30')](_0x1a2380[_0x6a96('0x2c')],qs['fields'](_0x47205d[_0x6a96('0x2d')][_0x6a96('0x32')]));_0x4e6cdc[_0x6a96('0x31')]=_0x4e6cdc[_0x6a96('0x31')][_0x6a96('0x33')]?_0x4e6cdc[_0x6a96('0x31')]:_0x1a2380[_0x6a96('0x2c')];if(_0x47205d['query'][_0x6a96('0x3f')]){_0x4e6cdc[_0x6a96('0x40')]=[{'all':!![]}];}_0x4e6cdc=_[_0x6a96('0x3b')]({},_0x4e6cdc,_0x47205d[_0x6a96('0x3d')]);return db[_0x6a96('0x28')][_0x6a96('0x45')](_0x4e6cdc)[_0x6a96('0x3e')](handleEntityNotFound(_0x457138,null))['then'](respondWithResult(_0x457138,null))[_0x6a96('0x43')](handleError(_0x457138,null));};exports[_0x6a96('0x46')]=function(_0x1e5b12,_0x57b957){return db[_0x6a96('0x28')][_0x6a96('0x46')](_0x1e5b12[_0x6a96('0x47')],{})[_0x6a96('0x3e')](respondWithResult(_0x57b957,0xc9))[_0x6a96('0x43')](handleError(_0x57b957,null));};exports[_0x6a96('0x1f')]=function(_0x49caac,_0x5117b1){if(_0x49caac[_0x6a96('0x47')]['id']){delete _0x49caac[_0x6a96('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x6a96('0x45')]({'where':{'id':_0x49caac[_0x6a96('0x44')]['id']}})[_0x6a96('0x3e')](handleEntityNotFound(_0x5117b1,null))['then'](saveUpdates(_0x49caac[_0x6a96('0x47')],null))['then'](respondWithResult(_0x5117b1,null))[_0x6a96('0x43')](handleError(_0x5117b1,null));};exports[_0x6a96('0x20')]=function(_0x33a1ba,_0x8e0931){return db[_0x6a96('0x28')][_0x6a96('0x45')]({'where':{'id':_0x33a1ba[_0x6a96('0x44')]['id']}})[_0x6a96('0x3e')](handleEntityNotFound(_0x8e0931,null))[_0x6a96('0x3e')](removeEntity(_0x8e0931,null))[_0x6a96('0x43')](handleError(_0x8e0931,null));};exports[_0x6a96('0x48')]=function(_0x36e5df,_0x311695){return db['OpenchannelTransferReport'][_0x6a96('0x48')]()[_0x6a96('0x3e')](respondWithResult(_0x311695,null))[_0x6a96('0x43')](handleError(_0x311695,null));};
\ No newline at end of file
index c82ffa9..785819a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6030=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6030,0x175));var _0x0603=function(_0x1a6c31,_0x14a78e){_0x1a6c31=_0x1a6c31-0x0;var _0x15315f=_0x6030[_0x1a6c31];return _0x15315f;};'use strict';var _=require(_0x0603('0x0'));var util=require(_0x0603('0x1'));var logger=require(_0x0603('0x2'))(_0x0603('0x3'));var moment=require(_0x0603('0x4'));var BPromise=require(_0x0603('0x5'));var rp=require(_0x0603('0x6'));var fs=require('fs');var path=require(_0x0603('0x7'));var rimraf=require(_0x0603('0x8'));var config=require(_0x0603('0x9'));var attributes=require(_0x0603('0xa'));module[_0x0603('0xb')]=function(_0x5af364,_0x3b5705){return _0x5af364[_0x0603('0xc')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xccd2=['report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0xccd2,0x1a2));var _0x2ccd=function(_0x337b73,_0x127be3){_0x337b73=_0x337b73-0x0;var _0x3d49f7=_0xccd2[_0x337b73];return _0x3d49f7;};'use strict';var _=require('lodash');var util=require(_0x2ccd('0x0'));var logger=require(_0x2ccd('0x1'))(_0x2ccd('0x2'));var moment=require(_0x2ccd('0x3'));var BPromise=require(_0x2ccd('0x4'));var rp=require(_0x2ccd('0x5'));var fs=require('fs');var path=require(_0x2ccd('0x6'));var rimraf=require(_0x2ccd('0x7'));var config=require(_0x2ccd('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x2ccd('0x9')]=function(_0x47d923,_0x50d84a){return _0x47d923[_0x2ccd('0xa')]('OpenchannelTransferReport',attributes,{'tableName':_0x2ccd('0xb'),'paranoid':![],'indexes':[{'name':_0x2ccd('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index e854c38..7daf7d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa751=['rpc','jayson/promise','client','http','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x45bcd1,_0x2754d0){var _0x48708c=function(_0x36351f){while(--_0x36351f){_0x45bcd1['push'](_0x45bcd1['shift']());}};_0x48708c(++_0x2754d0);}(_0xa751,0x175));var _0x1a75=function(_0x447f53,_0x12cb4f){_0x447f53=_0x447f53-0x0;var _0x1c8c28=_0xa751[_0x447f53];return _0x1c8c28;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2af95b,_0x1ec106,_0x692ac0){return new BPromise(function(_0x4537f6,_0x5d6faa){return client['request'](_0x2af95b,_0x692ac0)['then'](function(_0x41aa8f){logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));logger[_0x1a75('0xe')](_0x1a75('0xf'),_0x1ec106,_0x1a75('0xd'),JSON[_0x1a75('0x10')](_0x41aa8f));if(_0x41aa8f['error']){if(_0x41aa8f['error']['code']===0x1f4){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f[_0x1a75('0x11')][_0x1a75('0x12')]);return _0x5d6faa(_0x41aa8f['error']['message']);}logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f['error'][_0x1a75('0x12')]);return _0x4537f6(_0x41aa8f[_0x1a75('0x11')]['message']);}else{logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));_0x4537f6(_0x41aa8f['result']['message']);}})['catch'](function(_0x471b90){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x471b90);_0x5d6faa(_0x471b90);});});}
\ No newline at end of file
+var _0x3fa4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash','randomstring'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x3fa4,0xf0));var _0x43fa=function(_0xb144b0,_0x3cdb98){_0xb144b0=_0xb144b0-0x0;var _0x184798=_0x3fa4[_0xb144b0];return _0x184798;};'use strict';var _=require(_0x43fa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43fa('0x1'));var fs=require('fs');var Redis=require(_0x43fa('0x2'));var db=require(_0x43fa('0x3'))['db'];var utils=require(_0x43fa('0x4'));var logger=require(_0x43fa('0x5'))(_0x43fa('0x6'));var config=require(_0x43fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x43fa('0x8')][_0x43fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df71c,_0x584209,_0x3dc891){return new BPromise(function(_0x46adc7,_0x1dc401){return client['request'](_0x6df71c,_0x3dc891)[_0x43fa('0xa')](function(_0x36d40d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x43fa('0xb'));logger[_0x43fa('0xc')](_0x43fa('0xd'),_0x584209,_0x43fa('0xb'),JSON[_0x43fa('0xe')](_0x36d40d));if(_0x36d40d['error']){if(_0x36d40d[_0x43fa('0xf')][_0x43fa('0x10')]===0x1f4){logger[_0x43fa('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x36d40d[_0x43fa('0xf')][_0x43fa('0x11')]);return _0x1dc401(_0x36d40d[_0x43fa('0xf')]['message']);}logger[_0x43fa('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x584209,_0x36d40d['error']['message']);return _0x46adc7(_0x36d40d[_0x43fa('0xf')]['message']);}else{logger[_0x43fa('0x12')](_0x43fa('0x13'),_0x584209,'request\x20sent');_0x46adc7(_0x36d40d[_0x43fa('0x14')][_0x43fa('0x11')]);}})[_0x43fa('0x15')](function(_0x2439d4){logger[_0x43fa('0xf')](_0x43fa('0x13'),_0x584209,_0x2439d4);_0x1dc401(_0x2439d4);});});}
\ No newline at end of file
index d1192d1..9fba101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa062=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','update'];(function(_0x1589ed,_0x4d6c42){var _0x39b189=function(_0x207363){while(--_0x207363){_0x1589ed['push'](_0x1589ed['shift']());}};_0x39b189(++_0x4d6c42);}(_0xa062,0x101));var _0x2a06=function(_0x35a4aa,_0x49f770){_0x35a4aa=_0x35a4aa-0x0;var _0x4ec141=_0xa062[_0x35a4aa];return _0x4ec141;};'use strict';var multer=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var path=require(_0x2a06('0x2'));var timeout=require('connect-timeout');var express=require(_0x2a06('0x3'));var router=express[_0x2a06('0x4')]();var fs_extra=require(_0x2a06('0x5'));var auth=require(_0x2a06('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a06('0x7'));var controller=require('./pause.controller');router['get']('/',auth[_0x2a06('0x8')](),controller[_0x2a06('0x9')]);router[_0x2a06('0xa')](_0x2a06('0xb'),auth[_0x2a06('0x8')](),controller[_0x2a06('0xc')]);router['post']('/',auth[_0x2a06('0x8')](),controller[_0x2a06('0xd')]);router['put'](_0x2a06('0xb'),auth[_0x2a06('0x8')](),controller[_0x2a06('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2a06('0xf')]=router;
\ No newline at end of file
+var _0x1dab=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x1dab,0x143));var _0xb1da=function(_0x3d197f,_0x3186d3){_0x3d197f=_0x3d197f-0x0;var _0x37c656=_0x1dab[_0x3d197f];return _0x37c656;};'use strict';var multer=require(_0xb1da('0x0'));var util=require(_0xb1da('0x1'));var path=require('path');var timeout=require(_0xb1da('0x2'));var express=require(_0xb1da('0x3'));var router=express[_0xb1da('0x4')]();var fs_extra=require(_0xb1da('0x5'));var auth=require(_0xb1da('0x6'));var interaction=require(_0xb1da('0x7'));var config=require(_0xb1da('0x8'));var controller=require('./pause.controller');router[_0xb1da('0x9')]('/',auth[_0xb1da('0xa')](),controller['index']);router[_0xb1da('0x9')](_0xb1da('0xb'),auth[_0xb1da('0xa')](),controller[_0xb1da('0xc')]);router[_0xb1da('0xd')]('/',auth['isAuthenticated'](),controller[_0xb1da('0xe')]);router['put'](_0xb1da('0xb'),auth[_0xb1da('0xa')](),controller[_0xb1da('0xf')]);router[_0xb1da('0x10')](_0xb1da('0xb'),auth[_0xb1da('0xa')](),controller[_0xb1da('0x11')]);module[_0xb1da('0x12')]=router;
\ No newline at end of file
index f2c6e30..9ca27d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58c=['exports','STRING','name','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb58c,0x127));var _0xcb58=function(_0x5401e2,_0xb8e801){_0x5401e2=_0x5401e2-0x0;var _0x557f0f=_0xb58c[_0x5401e2];return _0x557f0f;};'use strict';var Sequelize=require(_0xcb58('0x0'));module[_0xcb58('0x1')]={'name':{'type':Sequelize[_0xcb58('0x2')],'unique':_0xcb58('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xcb58('0x2')]}};
\ No newline at end of file
+var _0x475f=['name','sequelize'];(function(_0x2f152e,_0x267bab){var _0x4a70c6=function(_0x3fd825){while(--_0x3fd825){_0x2f152e['push'](_0x2f152e['shift']());}};_0x4a70c6(++_0x267bab);}(_0x475f,0x155));var _0xf475=function(_0xa4ba65,_0x16dbd4){_0xa4ba65=_0xa4ba65-0x0;var _0x415129=_0x475f[_0xa4ba65];return _0x415129;};'use strict';var Sequelize=require(_0xf475('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf475('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6093340..2208a92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9290=['fs-extra','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','send','map','Pause','rawAttributes','type','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','query','sort','where','pick','merge','options','includeAll','include','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv'];(function(_0x5bff9e,_0x39ea3a){var _0x7f42ef=function(_0x58a923){while(--_0x58a923){_0x5bff9e['push'](_0x5bff9e['shift']());}};_0x7f42ef(++_0x39ea3a);}(_0x9290,0x1c1));var _0x0929=function(_0x29d623,_0x1a5c9c){_0x29d623=_0x29d623-0x0;var _0x242e59=_0x9290[_0x29d623];return _0x242e59;};'use strict';var emlformat=require(_0x0929('0x0'));var rimraf=require(_0x0929('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0929('0x2'));var rp=require(_0x0929('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0929('0x4'));var util=require('util');var path=require(_0x0929('0x5'));var sox=require('sox');var csv=require(_0x0929('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0929('0x7'));var _=require(_0x0929('0x8'));var squel=require('squel');var crypto=require(_0x0929('0x9'));var jsforce=require(_0x0929('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0929('0x6'));var querystring=require(_0x0929('0xb'));var Papa=require(_0x0929('0xc'));var Redis=require(_0x0929('0xd'));var authService=require(_0x0929('0xe'));var qs=require(_0x0929('0xf'));var as=require(_0x0929('0x10'));var hardwareService=require(_0x0929('0x11'));var logger=require(_0x0929('0x12'))(_0x0929('0x13'));var utils=require(_0x0929('0x14'));var config=require(_0x0929('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0929('0x16'))['db'];function respondWithStatusCode(_0x582ce4,_0xffe2cb){_0xffe2cb=_0xffe2cb||0xcc;return function(_0x537d21){if(_0x537d21){return _0x582ce4[_0x0929('0x17')](_0xffe2cb);}return _0x582ce4[_0x0929('0x18')](_0xffe2cb)[_0x0929('0x19')]();};}function respondWithResult(_0x359caf,_0x464fff){_0x464fff=_0x464fff||0xc8;return function(_0x27bf73){if(_0x27bf73){return _0x359caf['status'](_0x464fff)[_0x0929('0x1a')](_0x27bf73);}};}function respondWithFilteredResult(_0x3332e9,_0x39921b){return function(_0x514aef){if(_0x514aef){var _0x28233f=typeof _0x39921b[_0x0929('0x1b')]===_0x0929('0x1c')&&typeof _0x39921b[_0x0929('0x1d')]===_0x0929('0x1c');var _0x141164=_0x514aef[_0x0929('0x1e')];var _0x5a50b9=_0x28233f?0x0:_0x39921b[_0x0929('0x1b')];var _0x4f9ae9=_0x28233f?_0x514aef[_0x0929('0x1e')]:_0x39921b[_0x0929('0x1b')]+_0x39921b[_0x0929('0x1d')];var _0x525869;if(_0x4f9ae9>=_0x141164){_0x4f9ae9=_0x141164;_0x525869=0xc8;}else{_0x525869=0xce;}_0x3332e9['status'](_0x525869);return _0x3332e9[_0x0929('0x1f')](_0x0929('0x20'),_0x5a50b9+'-'+_0x4f9ae9+'/'+_0x141164)[_0x0929('0x1a')](_0x514aef);}return null;};}function patchUpdates(_0x37f9ef){return function(_0x40ff2a){try{jsonpatch['apply'](_0x40ff2a,_0x37f9ef,!![]);}catch(_0x3c5ec3){return BPromise['reject'](_0x3c5ec3);}return _0x40ff2a[_0x0929('0x21')]();};}function saveUpdates(_0x4cdf38,_0x4ccadc){return function(_0xfe65df){if(_0xfe65df){return _0xfe65df[_0x0929('0x22')](_0x4cdf38)[_0x0929('0x23')](function(_0x55fb52){return _0x55fb52;});}return null;};}function removeEntity(_0x563c02,_0x47f185){return function(_0x1acdd0){if(_0x1acdd0){return _0x1acdd0[_0x0929('0x24')]()[_0x0929('0x23')](function(){var _0x2e368c=_0x1acdd0[_0x0929('0x25')]({'plain':!![]});var _0x4f9049=_0x0929('0x26');return db[_0x0929('0x27')]['destroy']({'where':{'type':_0x4f9049,'resourceId':_0x2e368c['id']}})['then'](function(){return _0x1acdd0;});})[_0x0929('0x23')](function(){_0x563c02[_0x0929('0x18')](0xcc)[_0x0929('0x19')]();});}};}function handleEntityNotFound(_0x130ed2,_0x3c5203){return function(_0x33993f){if(!_0x33993f){_0x130ed2[_0x0929('0x17')](0x194);}return _0x33993f;};}function handleError(_0x5c6cff,_0x32f33d){_0x32f33d=_0x32f33d||0x1f4;return function(_0x24a97c){logger['error'](_0x24a97c[_0x0929('0x28')]);if(_0x24a97c[_0x0929('0x29')]){delete _0x24a97c[_0x0929('0x29')];}_0x5c6cff[_0x0929('0x18')](_0x32f33d)[_0x0929('0x2a')](_0x24a97c);};}exports['index']=function(_0x2ba363,_0x52464e){var _0xbf0e1e={},_0x2dbea0={},_0x457497={'count':0x0,'rows':[]};var _0x3d7d6a=_[_0x0929('0x2b')](db[_0x0929('0x2c')][_0x0929('0x2d')],function(_0xf460dc){return{'name':_0xf460dc['fieldName'],'type':_0xf460dc[_0x0929('0x2e')]['key']};});_0x2dbea0['model']=_[_0x0929('0x2b')](_0x3d7d6a,_0x0929('0x29'));_0x2dbea0['query']=_['keys'](_0x2ba363['query']);_0x2dbea0[_0x0929('0x2f')]=_[_0x0929('0x30')](_0x2dbea0[_0x0929('0x31')],_0x2dbea0['query']);_0xbf0e1e[_0x0929('0x32')]=_['intersection'](_0x2dbea0[_0x0929('0x31')],qs['fields'](_0x2ba363['query'][_0x0929('0x33')]));_0xbf0e1e[_0x0929('0x32')]=_0xbf0e1e['attributes'][_0x0929('0x34')]?_0xbf0e1e['attributes']:_0x2dbea0['model'];if(!_0x2ba363['query'][_0x0929('0x35')](_0x0929('0x36'))){_0xbf0e1e[_0x0929('0x1d')]=qs[_0x0929('0x1d')](_0x2ba363['query']['limit']);_0xbf0e1e['offset']=qs[_0x0929('0x1b')](_0x2ba363[_0x0929('0x37')][_0x0929('0x1b')]);}_0xbf0e1e['order']=qs[_0x0929('0x38')](_0x2ba363[_0x0929('0x37')][_0x0929('0x38')]);_0xbf0e1e[_0x0929('0x39')]=qs['filters'](_[_0x0929('0x3a')](_0x2ba363['query'],_0x2dbea0[_0x0929('0x2f')]),_0x3d7d6a);if(_0x2ba363[_0x0929('0x37')]['filter']){_0xbf0e1e[_0x0929('0x39')]=_[_0x0929('0x3b')](_0xbf0e1e[_0x0929('0x39')],{'$or':_[_0x0929('0x2b')](_0x3d7d6a,function(_0x2453dc){if(_0x2453dc[_0x0929('0x2e')]!=='VIRTUAL'){var _0x472f94={};_0x472f94[_0x2453dc[_0x0929('0x29')]]={'$like':'%'+_0x2ba363[_0x0929('0x37')]['filter']+'%'};return _0x472f94;}})});}_0xbf0e1e=_['merge']({},_0xbf0e1e,_0x2ba363[_0x0929('0x3c')]);var _0x55db0a={'where':_0xbf0e1e[_0x0929('0x39')]};return db[_0x0929('0x2c')][_0x0929('0x1e')](_0x55db0a)[_0x0929('0x23')](function(_0xfb47d3){_0x457497[_0x0929('0x1e')]=_0xfb47d3;if(_0x2ba363[_0x0929('0x37')][_0x0929('0x3d')]){_0xbf0e1e[_0x0929('0x3e')]=[{'all':!![]}];}return db['Pause']['findAll'](_0xbf0e1e);})[_0x0929('0x23')](function(_0x2ad196){_0x457497[_0x0929('0x3f')]=_0x2ad196;return _0x457497;})[_0x0929('0x23')](respondWithFilteredResult(_0x52464e,_0xbf0e1e))[_0x0929('0x40')](handleError(_0x52464e,null));};exports[_0x0929('0x41')]=function(_0x44e079,_0x4d12f9){var _0x43c71b={'raw':!![],'where':{'id':_0x44e079['params']['id']}},_0x20da88={};_0x20da88['model']=_[_0x0929('0x42')](db[_0x0929('0x2c')]['rawAttributes']);_0x20da88['query']=_[_0x0929('0x42')](_0x44e079['query']);_0x20da88[_0x0929('0x2f')]=_[_0x0929('0x30')](_0x20da88[_0x0929('0x31')],_0x20da88[_0x0929('0x37')]);_0x43c71b[_0x0929('0x32')]=_[_0x0929('0x30')](_0x20da88['model'],qs[_0x0929('0x33')](_0x44e079['query']['fields']));_0x43c71b[_0x0929('0x32')]=_0x43c71b[_0x0929('0x32')]['length']?_0x43c71b[_0x0929('0x32')]:_0x20da88[_0x0929('0x31')];if(_0x44e079['query'][_0x0929('0x3d')]){_0x43c71b[_0x0929('0x3e')]=[{'all':!![]}];}_0x43c71b=_[_0x0929('0x3b')]({},_0x43c71b,_0x44e079[_0x0929('0x3c')]);return db[_0x0929('0x2c')]['find'](_0x43c71b)['then'](handleEntityNotFound(_0x4d12f9,null))[_0x0929('0x23')](respondWithResult(_0x4d12f9,null))['catch'](handleError(_0x4d12f9,null));};exports['create']=function(_0x224cb1,_0x58abd3){return db[_0x0929('0x2c')][_0x0929('0x43')](_0x224cb1[_0x0929('0x44')],{})['then'](function(_0x5cabe4){var _0x559a72=_0x224cb1[_0x0929('0x45')][_0x0929('0x25')]({'plain':!![]});if(!_0x559a72)throw new Error(_0x0929('0x46'));if(_0x559a72[_0x0929('0x47')]==='user'){var _0x4787e3=_0x5cabe4['get']({'plain':!![]});var _0x55703f=_0x0929('0x26');return db[_0x0929('0x48')][_0x0929('0x49')]({'where':{'name':_0x55703f,'userProfileId':_0x559a72['userProfileId']},'raw':!![]})['then'](function(_0x19034c){if(_0x19034c&&_0x19034c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4787e3[_0x0929('0x29')],'resourceId':_0x4787e3['id'],'type':_0x19034c[_0x0929('0x29')],'sectionId':_0x19034c['id']},{})[_0x0929('0x23')](function(){return _0x5cabe4;});}else{return _0x5cabe4;}})[_0x0929('0x40')](function(_0x476bd1){logger['error'](_0x0929('0x4a'),_0x476bd1);throw _0x476bd1;});}return _0x5cabe4;})[_0x0929('0x23')](respondWithResult(_0x58abd3,0xc9))[_0x0929('0x40')](handleError(_0x58abd3,null));};exports[_0x0929('0x22')]=function(_0x523c00,_0x47c9e7){if(_0x523c00[_0x0929('0x44')]['id']){delete _0x523c00[_0x0929('0x44')]['id'];}return db[_0x0929('0x2c')][_0x0929('0x49')]({'where':{'id':_0x523c00['params']['id']}})[_0x0929('0x23')](handleEntityNotFound(_0x47c9e7,null))[_0x0929('0x23')](saveUpdates(_0x523c00[_0x0929('0x44')],null))['then'](respondWithResult(_0x47c9e7,null))[_0x0929('0x40')](handleError(_0x47c9e7,null));};exports[_0x0929('0x24')]=function(_0x201ce2,_0x40c6fd){return db[_0x0929('0x2c')][_0x0929('0x49')]({'where':{'id':_0x201ce2[_0x0929('0x4b')]['id']}})[_0x0929('0x23')](handleEntityNotFound(_0x40c6fd,null))[_0x0929('0x23')](removeEntity(_0x40c6fd,null))[_0x0929('0x40')](handleError(_0x40c6fd,null));};
\ No newline at end of file
+var _0xe0e1=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','get','Pauses','error','send','index','map','Pause','rawAttributes','fieldName','type','name','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xe0e1,0x147));var _0x1e0e=function(_0x4bbf5a,_0x193fea){_0x4bbf5a=_0x4bbf5a-0x0;var _0x5b6ed7=_0xe0e1[_0x4bbf5a];return _0x5b6ed7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e0e('0x0'));var zipdir=require(_0x1e0e('0x1'));var jsonpatch=require(_0x1e0e('0x2'));var rp=require(_0x1e0e('0x3'));var moment=require(_0x1e0e('0x4'));var BPromise=require(_0x1e0e('0x5'));var Mustache=require(_0x1e0e('0x6'));var util=require(_0x1e0e('0x7'));var path=require(_0x1e0e('0x8'));var sox=require(_0x1e0e('0x9'));var csv=require(_0x1e0e('0xa'));var ejs=require(_0x1e0e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e0e('0xc'));var squel=require(_0x1e0e('0xd'));var crypto=require(_0x1e0e('0xe'));var jsforce=require(_0x1e0e('0xf'));var deskjs=require(_0x1e0e('0x10'));var toCsv=require(_0x1e0e('0xa'));var querystring=require(_0x1e0e('0x11'));var Papa=require(_0x1e0e('0x12'));var Redis=require(_0x1e0e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1e0e('0x14'));var as=require(_0x1e0e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e0e('0x16'))(_0x1e0e('0x17'));var utils=require(_0x1e0e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1e0e('0x19'));var db=require(_0x1e0e('0x1a'))['db'];function respondWithStatusCode(_0x24a240,_0xf31846){_0xf31846=_0xf31846||0xcc;return function(_0x2ba143){if(_0x2ba143){return _0x24a240[_0x1e0e('0x1b')](_0xf31846);}return _0x24a240[_0x1e0e('0x1c')](_0xf31846)[_0x1e0e('0x1d')]();};}function respondWithResult(_0x367595,_0x19f99e){_0x19f99e=_0x19f99e||0xc8;return function(_0x3dcc95){if(_0x3dcc95){return _0x367595[_0x1e0e('0x1c')](_0x19f99e)[_0x1e0e('0x1e')](_0x3dcc95);}};}function respondWithFilteredResult(_0x29172f,_0x525bfc){return function(_0x4e9885){if(_0x4e9885){var _0x1dbaae=typeof _0x525bfc['offset']===_0x1e0e('0x1f')&&typeof _0x525bfc[_0x1e0e('0x20')]==='undefined';var _0x1546ac=_0x4e9885[_0x1e0e('0x21')];var _0x306c05=_0x1dbaae?0x0:_0x525bfc[_0x1e0e('0x22')];var _0x5e457f=_0x1dbaae?_0x4e9885[_0x1e0e('0x21')]:_0x525bfc[_0x1e0e('0x22')]+_0x525bfc['limit'];var _0x68bacc;if(_0x5e457f>=_0x1546ac){_0x5e457f=_0x1546ac;_0x68bacc=0xc8;}else{_0x68bacc=0xce;}_0x29172f[_0x1e0e('0x1c')](_0x68bacc);return _0x29172f['set']('Content-Range',_0x306c05+'-'+_0x5e457f+'/'+_0x1546ac)[_0x1e0e('0x1e')](_0x4e9885);}return null;};}function patchUpdates(_0x307beb){return function(_0x22a95c){try{jsonpatch[_0x1e0e('0x23')](_0x22a95c,_0x307beb,!![]);}catch(_0x59e46f){return BPromise[_0x1e0e('0x24')](_0x59e46f);}return _0x22a95c[_0x1e0e('0x25')]();};}function saveUpdates(_0x2cc596,_0x3f2d66){return function(_0x15ae2d){if(_0x15ae2d){return _0x15ae2d[_0x1e0e('0x26')](_0x2cc596)[_0x1e0e('0x27')](function(_0x3121a1){return _0x3121a1;});}return null;};}function removeEntity(_0x4b26ec,_0x42518e){return function(_0x52e5bd){if(_0x52e5bd){return _0x52e5bd['destroy']()['then'](function(){var _0x515aa3=_0x52e5bd[_0x1e0e('0x28')]({'plain':!![]});var _0x1a1a29=_0x1e0e('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a1a29,'resourceId':_0x515aa3['id']}})[_0x1e0e('0x27')](function(){return _0x52e5bd;});})['then'](function(){_0x4b26ec[_0x1e0e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ce5f0,_0x5e38dd){return function(_0x3b581d){if(!_0x3b581d){_0x3ce5f0['sendStatus'](0x194);}return _0x3b581d;};}function handleError(_0x556a22,_0x34664d){_0x34664d=_0x34664d||0x1f4;return function(_0x44983d){logger[_0x1e0e('0x2a')](_0x44983d['stack']);if(_0x44983d['name']){delete _0x44983d['name'];}_0x556a22[_0x1e0e('0x1c')](_0x34664d)[_0x1e0e('0x2b')](_0x44983d);};}exports[_0x1e0e('0x2c')]=function(_0x5e0360,_0x1a8ef4){var _0x5ad06b={},_0x4c96b8={},_0x404e0b={'count':0x0,'rows':[]};var _0x310c97=_[_0x1e0e('0x2d')](db[_0x1e0e('0x2e')][_0x1e0e('0x2f')],function(_0x1c4db0){return{'name':_0x1c4db0[_0x1e0e('0x30')],'type':_0x1c4db0[_0x1e0e('0x31')]['key']};});_0x4c96b8['model']=_[_0x1e0e('0x2d')](_0x310c97,_0x1e0e('0x32'));_0x4c96b8['query']=_[_0x1e0e('0x33')](_0x5e0360[_0x1e0e('0x34')]);_0x4c96b8[_0x1e0e('0x35')]=_[_0x1e0e('0x36')](_0x4c96b8['model'],_0x4c96b8[_0x1e0e('0x34')]);_0x5ad06b[_0x1e0e('0x37')]=_[_0x1e0e('0x36')](_0x4c96b8[_0x1e0e('0x38')],qs['fields'](_0x5e0360['query'][_0x1e0e('0x39')]));_0x5ad06b[_0x1e0e('0x37')]=_0x5ad06b[_0x1e0e('0x37')][_0x1e0e('0x3a')]?_0x5ad06b[_0x1e0e('0x37')]:_0x4c96b8[_0x1e0e('0x38')];if(!_0x5e0360['query']['hasOwnProperty'](_0x1e0e('0x3b'))){_0x5ad06b[_0x1e0e('0x20')]=qs[_0x1e0e('0x20')](_0x5e0360[_0x1e0e('0x34')][_0x1e0e('0x20')]);_0x5ad06b['offset']=qs[_0x1e0e('0x22')](_0x5e0360[_0x1e0e('0x34')]['offset']);}_0x5ad06b[_0x1e0e('0x3c')]=qs[_0x1e0e('0x3d')](_0x5e0360[_0x1e0e('0x34')]['sort']);_0x5ad06b[_0x1e0e('0x3e')]=qs[_0x1e0e('0x35')](_[_0x1e0e('0x3f')](_0x5e0360['query'],_0x4c96b8[_0x1e0e('0x35')]),_0x310c97);if(_0x5e0360[_0x1e0e('0x34')][_0x1e0e('0x40')]){_0x5ad06b['where']=_[_0x1e0e('0x41')](_0x5ad06b[_0x1e0e('0x3e')],{'$or':_[_0x1e0e('0x2d')](_0x310c97,function(_0x4b2ead){if(_0x4b2ead[_0x1e0e('0x31')]!==_0x1e0e('0x42')){var _0x332f11={};_0x332f11[_0x4b2ead[_0x1e0e('0x32')]]={'$like':'%'+_0x5e0360[_0x1e0e('0x34')][_0x1e0e('0x40')]+'%'};return _0x332f11;}})});}_0x5ad06b=_[_0x1e0e('0x41')]({},_0x5ad06b,_0x5e0360[_0x1e0e('0x43')]);var _0x2f294b={'where':_0x5ad06b['where']};return db['Pause']['count'](_0x2f294b)[_0x1e0e('0x27')](function(_0x40eaa4){_0x404e0b['count']=_0x40eaa4;if(_0x5e0360[_0x1e0e('0x34')][_0x1e0e('0x44')]){_0x5ad06b[_0x1e0e('0x45')]=[{'all':!![]}];}return db[_0x1e0e('0x2e')][_0x1e0e('0x46')](_0x5ad06b);})['then'](function(_0x565141){_0x404e0b[_0x1e0e('0x47')]=_0x565141;return _0x404e0b;})[_0x1e0e('0x27')](respondWithFilteredResult(_0x1a8ef4,_0x5ad06b))['catch'](handleError(_0x1a8ef4,null));};exports[_0x1e0e('0x48')]=function(_0x2382b6,_0x2e4e32){var _0x1b7338={'raw':!![],'where':{'id':_0x2382b6[_0x1e0e('0x49')]['id']}},_0x5387c8={};_0x5387c8[_0x1e0e('0x38')]=_['keys'](db[_0x1e0e('0x2e')]['rawAttributes']);_0x5387c8[_0x1e0e('0x34')]=_[_0x1e0e('0x33')](_0x2382b6[_0x1e0e('0x34')]);_0x5387c8[_0x1e0e('0x35')]=_['intersection'](_0x5387c8[_0x1e0e('0x38')],_0x5387c8[_0x1e0e('0x34')]);_0x1b7338[_0x1e0e('0x37')]=_[_0x1e0e('0x36')](_0x5387c8[_0x1e0e('0x38')],qs[_0x1e0e('0x39')](_0x2382b6['query']['fields']));_0x1b7338[_0x1e0e('0x37')]=_0x1b7338[_0x1e0e('0x37')][_0x1e0e('0x3a')]?_0x1b7338[_0x1e0e('0x37')]:_0x5387c8['model'];if(_0x2382b6['query']['includeAll']){_0x1b7338[_0x1e0e('0x45')]=[{'all':!![]}];}_0x1b7338=_['merge']({},_0x1b7338,_0x2382b6[_0x1e0e('0x43')]);return db['Pause'][_0x1e0e('0x4a')](_0x1b7338)[_0x1e0e('0x27')](handleEntityNotFound(_0x2e4e32,null))[_0x1e0e('0x27')](respondWithResult(_0x2e4e32,null))[_0x1e0e('0x4b')](handleError(_0x2e4e32,null));};exports[_0x1e0e('0x4c')]=function(_0x3db943,_0x2c0e8a){return db[_0x1e0e('0x2e')]['create'](_0x3db943[_0x1e0e('0x4d')],{})[_0x1e0e('0x27')](function(_0x30204e){var _0x435e2b=_0x3db943[_0x1e0e('0x4e')][_0x1e0e('0x28')]({'plain':!![]});if(!_0x435e2b)throw new Error(_0x1e0e('0x4f'));if(_0x435e2b['role']===_0x1e0e('0x4e')){var _0x47cbbc=_0x30204e[_0x1e0e('0x28')]({'plain':!![]});var _0x10a3c6=_0x1e0e('0x29');return db[_0x1e0e('0x50')][_0x1e0e('0x4a')]({'where':{'name':_0x10a3c6,'userProfileId':_0x435e2b[_0x1e0e('0x51')]},'raw':!![]})[_0x1e0e('0x27')](function(_0x91a3e7){if(_0x91a3e7&&_0x91a3e7['autoAssociation']===0x0){return db[_0x1e0e('0x52')][_0x1e0e('0x4c')]({'name':_0x47cbbc[_0x1e0e('0x32')],'resourceId':_0x47cbbc['id'],'type':_0x91a3e7[_0x1e0e('0x32')],'sectionId':_0x91a3e7['id']},{})['then'](function(){return _0x30204e;});}else{return _0x30204e;}})[_0x1e0e('0x4b')](function(_0x316637){logger[_0x1e0e('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x316637);throw _0x316637;});}return _0x30204e;})[_0x1e0e('0x27')](respondWithResult(_0x2c0e8a,0xc9))[_0x1e0e('0x4b')](handleError(_0x2c0e8a,null));};exports[_0x1e0e('0x26')]=function(_0x198610,_0x5f2341){if(_0x198610[_0x1e0e('0x4d')]['id']){delete _0x198610['body']['id'];}return db[_0x1e0e('0x2e')][_0x1e0e('0x4a')]({'where':{'id':_0x198610[_0x1e0e('0x49')]['id']}})[_0x1e0e('0x27')](handleEntityNotFound(_0x5f2341,null))['then'](saveUpdates(_0x198610[_0x1e0e('0x4d')],null))[_0x1e0e('0x27')](respondWithResult(_0x5f2341,null))[_0x1e0e('0x4b')](handleError(_0x5f2341,null));};exports[_0x1e0e('0x53')]=function(_0x920b2b,_0x145d29){return db[_0x1e0e('0x2e')]['find']({'where':{'id':_0x920b2b[_0x1e0e('0x49')]['id']}})[_0x1e0e('0x27')](handleEntityNotFound(_0x145d29,null))['then'](removeEntity(_0x145d29,null))[_0x1e0e('0x4b')](handleError(_0x145d29,null));};
\ No newline at end of file
index ec43a03..52efe32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5c7917,_0x2e9363){var _0x34378d=function(_0x4089fd){while(--_0x4089fd){_0x5c7917['push'](_0x5c7917['shift']());}};_0x34378d(++_0x2e9363);}(_0x1cb9,0x14e));var _0x91cb=function(_0x40bcc9,_0x3ad95f){_0x40bcc9=_0x40bcc9-0x0;var _0x181174=_0x1cb9[_0x40bcc9];return _0x181174;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91d65e0..32f2bb3 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(_0x52a28a,_0x48704d){var _0x294c4c=function(_0x5e19b3){while(--_0x5e19b3){_0x52a28a['push'](_0x52a28a['shift']());}};_0x294c4c(++_0x48704d);}(_0x7a54,0x106));var _0x47a5=function(_0x3fae86,_0x37f59a){_0x3fae86=_0x3fae86-0x0;var _0x179075=_0x7a54[_0x3fae86];return _0x179075;};'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(_0x4a60a3,_0x212684){var _0x2e77a1=function(_0x293c48){while(--_0x293c48){_0x4a60a3['push'](_0x4a60a3['shift']());}};_0x2e77a1(++_0x212684);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xb10b[_0x1ac6ec];return _0x48a489;};'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 a81d415..ab7e8a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['file','upload','post','webhookPost','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/webhook','/:id','isAuthenticated','/:id/download','download','diskStorage','root','originalname','replace','format','%s-%s%s','extname','now','single'];(function(_0x776428,_0x9695e7){var _0x36fef9=function(_0x16148f){while(--_0x16148f){_0x776428['push'](_0x776428['shift']());}};_0x36fef9(++_0x9695e7);}(_0x207c,0x1e8));var _0xc207=function(_0x48eecb,_0x4cc6cd){_0x48eecb=_0x48eecb-0x0;var _0x21caa9=_0x207c[_0x48eecb];return _0x21caa9;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),controller['webhookGet']);router[_0xc207('0x9')](_0xc207('0xb'),auth[_0xc207('0xc')](),controller['show']);router[_0xc207('0x9')](_0xc207('0xd'),auth[_0xc207('0xc')](),controller[_0xc207('0xe')]);var upload=multer({'storage':multer[_0xc207('0xf')]({'destination':function(_0x347549,_0x487d95,_0x574425){_0x574425(null,path['join'](config[_0xc207('0x10')],'server/files/plugins'));},'filename':function(_0x2741f3,_0x2782ce,_0x59d401){_0x2782ce[_0xc207('0x11')]=_0x2782ce[_0xc207('0x11')][_0xc207('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59d401(null,util[_0xc207('0x13')](_0xc207('0x14'),path['basename'](_0x2782ce[_0xc207('0x11')],path[_0xc207('0x15')](_0x2782ce[_0xc207('0x11')])),Date[_0xc207('0x16')](),path['extname'](_0x2782ce['originalname'])));}})});router['post']('/',upload[_0xc207('0x17')](_0xc207('0x18')),controller[_0xc207('0x19')]);router[_0xc207('0x1a')]('/webhook',controller[_0xc207('0x1b')]);router[_0xc207('0x1c')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x1d')]);router['delete'](_0xc207('0xb'),auth[_0xc207('0xc')](),controller[_0xc207('0x1e')]);module[_0xc207('0x1f')]=router;
\ No newline at end of file
+var _0xfd28=['webhookPost','put','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/:id','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','/webhook'];(function(_0x172515,_0x505275){var _0x2fa961=function(_0x55c44f){while(--_0x55c44f){_0x172515['push'](_0x172515['shift']());}};_0x2fa961(++_0x505275);}(_0xfd28,0x148));var _0x8fd2=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xfd28[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/webhook',controller['webhookGet']);router[_0x8fd2('0x7')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['show']);router[_0x8fd2('0x7')]('/:id/download',auth[_0x8fd2('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x8fd2('0xb')]({'destination':function(_0x4fdf0b,_0x1ca2a1,_0x5244ed){_0x5244ed(null,path[_0x8fd2('0xc')](config['root'],_0x8fd2('0xd')));},'filename':function(_0x207298,_0xfd78d,_0xa6d7ca){_0xfd78d[_0x8fd2('0xe')]=_0xfd78d[_0x8fd2('0xe')][_0x8fd2('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa6d7ca(null,util[_0x8fd2('0x10')](_0x8fd2('0x11'),path[_0x8fd2('0x12')](_0xfd78d[_0x8fd2('0xe')],path[_0x8fd2('0x13')](_0xfd78d[_0x8fd2('0xe')])),Date[_0x8fd2('0x14')](),path[_0x8fd2('0x13')](_0xfd78d['originalname'])));}})});router[_0x8fd2('0x15')]('/',upload['single']('file'),controller['upload']);router[_0x8fd2('0x15')](_0x8fd2('0x16'),controller[_0x8fd2('0x17')]);router[_0x8fd2('0x18')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x19')]);router[_0x8fd2('0x1a')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['delete']);module['exports']=router;
\ No newline at end of file
index 7e55bcb..6d9c183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x260d=['ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','sequelize','exports','STRING'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0x260d,0x169));var _0xd260=function(_0x18ea41,_0x3985a8){_0x18ea41=_0x18ea41-0x0;var _0x5f2f90=_0x260d[_0x18ea41];return _0x5f2f90;};'use strict';var Sequelize=require(_0xd260('0x0'));module[_0xd260('0x1')]={'name':{'type':Sequelize[_0xd260('0x2')]},'type':{'type':Sequelize[_0xd260('0x3')](_0xd260('0x4'),_0xd260('0x5'))},'description':{'type':Sequelize[_0xd260('0x6')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xd260('0x2')],'comment':_0xd260('0x7')},'active':{'type':Sequelize[_0xd260('0x8')],'defaultValue':0x0,'comment':_0xd260('0x9')},'sidebar':{'type':Sequelize[_0xd260('0x3')](_0xd260('0xa'),_0xd260('0xb'),_0xd260('0xc'),'never'),'defaultValue':'always','comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xd260('0x2')]},'adminUrl':{'type':Sequelize[_0xd260('0x2')]},'agentUrl':{'type':Sequelize[_0xd260('0x2')]},'scriptName':{'type':Sequelize[_0xd260('0x2')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x70a0=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x70a0,0x7a));var _0x070a=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x70a0[_0x576170];return _0x397c70;};'use strict';var Sequelize=require(_0x070a('0x0'));module['exports']={'name':{'type':Sequelize[_0x070a('0x1')]},'type':{'type':Sequelize[_0x070a('0x2')](_0x070a('0x3'),_0x070a('0x4'))},'description':{'type':Sequelize[_0x070a('0x5')]},'version':{'type':Sequelize[_0x070a('0x5')]},'path':{'type':Sequelize[_0x070a('0x1')],'comment':_0x070a('0x6')},'active':{'type':Sequelize[_0x070a('0x7')],'defaultValue':0x0,'comment':_0x070a('0x8')},'sidebar':{'type':Sequelize['ENUM'](_0x070a('0x9'),'agentOnly','always','never'),'defaultValue':'always','comment':_0x070a('0xa')},'icon':{'type':Sequelize[_0x070a('0x1')]},'adminUrl':{'type':Sequelize[_0x070a('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x070a('0x1')]},'scriptPath':{'type':Sequelize[_0x070a('0x1')]}};
\ No newline at end of file
index 29a1840..3de7a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c36=['then','destroy','get','Plugins','UserProfileResource','stack','name','index','map','Plugin','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','catch','params','rawAttributes','includeAll','find','download','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','send','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','reject','save','update'];(function(_0x5c4632,_0x3db302){var _0x3347ac=function(_0x392128){while(--_0x392128){_0x5c4632['push'](_0x5c4632['shift']());}};_0x3347ac(++_0x3db302);}(_0x3c36,0x7f));var _0x63c3=function(_0x36626d,_0x33482d){_0x36626d=_0x36626d-0x0;var _0x4346a5=_0x3c36[_0x36626d];return _0x4346a5;};'use strict';var emlformat=require(_0x63c3('0x0'));var rimraf=require(_0x63c3('0x1'));var zipdir=require(_0x63c3('0x2'));var jsonpatch=require(_0x63c3('0x3'));var rp=require(_0x63c3('0x4'));var moment=require(_0x63c3('0x5'));var BPromise=require(_0x63c3('0x6'));var Mustache=require(_0x63c3('0x7'));var util=require(_0x63c3('0x8'));var path=require(_0x63c3('0x9'));var sox=require('sox');var csv=require(_0x63c3('0xa'));var ejs=require(_0x63c3('0xb'));var fs=require('fs');var fs_extra=require(_0x63c3('0xc'));var _=require(_0x63c3('0xd'));var squel=require(_0x63c3('0xe'));var crypto=require(_0x63c3('0xf'));var jsforce=require(_0x63c3('0x10'));var deskjs=require(_0x63c3('0x11'));var toCsv=require('to-csv');var querystring=require(_0x63c3('0x12'));var Papa=require(_0x63c3('0x13'));var extract=require(_0x63c3('0x14'));var rimraf=require(_0x63c3('0x1'));var archiver=require(_0x63c3('0x15'));var Redis=require(_0x63c3('0x16'));var authService=require(_0x63c3('0x17'));var qs=require(_0x63c3('0x18'));var as=require(_0x63c3('0x19'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x63c3('0x1a'))(_0x63c3('0x1b'));var utils=require(_0x63c3('0x1c'));var config=require(_0x63c3('0x1d'));var licenseUtil=require(_0x63c3('0x1e'));var db=require('../../mysqldb')['db'];config[_0x63c3('0x1f')]=_[_0x63c3('0x20')](config['redis'],{'host':_0x63c3('0x21'),'port':0x18eb});var socket=require(_0x63c3('0x22'))(new Redis(config['redis']));require('./plugin.socket')[_0x63c3('0x23')](socket);function respondWithStatusCode(_0x5a2583,_0x387403){_0x387403=_0x387403||0xcc;return function(_0x2369a8){if(_0x2369a8){return _0x5a2583[_0x63c3('0x24')](_0x387403);}return _0x5a2583[_0x63c3('0x25')](_0x387403)[_0x63c3('0x26')]();};}function respondWithResult(_0x2b2b06,_0x361a43){_0x361a43=_0x361a43||0xc8;return function(_0x7a19de){if(_0x7a19de){return _0x2b2b06['status'](_0x361a43)[_0x63c3('0x27')](_0x7a19de);}};}function respondWithFilteredResult(_0x38d987,_0x2ba6a2){return function(_0x1af8a9){if(_0x1af8a9){var _0x26cec9=typeof _0x2ba6a2[_0x63c3('0x28')]==='undefined'&&typeof _0x2ba6a2[_0x63c3('0x29')]==='undefined';var _0x1491b3=_0x1af8a9[_0x63c3('0x2a')];var _0x57da77=_0x26cec9?0x0:_0x2ba6a2[_0x63c3('0x28')];var _0x8fb0cc=_0x26cec9?_0x1af8a9[_0x63c3('0x2a')]:_0x2ba6a2[_0x63c3('0x28')]+_0x2ba6a2['limit'];var _0x7e48ac;if(_0x8fb0cc>=_0x1491b3){_0x8fb0cc=_0x1491b3;_0x7e48ac=0xc8;}else{_0x7e48ac=0xce;}_0x38d987['status'](_0x7e48ac);return _0x38d987[_0x63c3('0x2b')]('Content-Range',_0x57da77+'-'+_0x8fb0cc+'/'+_0x1491b3)[_0x63c3('0x27')](_0x1af8a9);}return null;};}function patchUpdates(_0x2facc6){return function(_0x4834ea){try{jsonpatch['apply'](_0x4834ea,_0x2facc6,!![]);}catch(_0x4666c6){return BPromise[_0x63c3('0x2c')](_0x4666c6);}return _0x4834ea[_0x63c3('0x2d')]();};}function saveUpdates(_0x31195b,_0x41f2a4){return function(_0x11a563){if(_0x11a563){return _0x11a563[_0x63c3('0x2e')](_0x31195b)[_0x63c3('0x2f')](function(_0x334daf){return _0x334daf;});}return null;};}function removeEntity(_0x2f69e8,_0x434842){return function(_0x3f4885){if(_0x3f4885){return _0x3f4885[_0x63c3('0x30')]()[_0x63c3('0x2f')](function(){var _0x16cdb7=_0x3f4885[_0x63c3('0x31')]({'plain':!![]});var _0x442405=_0x63c3('0x32');return db[_0x63c3('0x33')][_0x63c3('0x30')]({'where':{'type':_0x442405,'resourceId':_0x16cdb7['id']}})[_0x63c3('0x2f')](function(){return _0x3f4885;});})[_0x63c3('0x2f')](function(){_0x2f69e8[_0x63c3('0x25')](0xcc)[_0x63c3('0x26')]();});}};}function handleEntityNotFound(_0x533a4a,_0x5ef55b){return function(_0x5944cf){if(!_0x5944cf){_0x533a4a[_0x63c3('0x24')](0x194);}return _0x5944cf;};}function handleError(_0x3ebf10,_0x508cf4){_0x508cf4=_0x508cf4||0x1f4;return function(_0x40b262){logger['error'](_0x40b262[_0x63c3('0x34')]);if(_0x40b262[_0x63c3('0x35')]){delete _0x40b262[_0x63c3('0x35')];}_0x3ebf10[_0x63c3('0x25')](_0x508cf4)['send'](_0x40b262);};}exports[_0x63c3('0x36')]=function(_0x537024,_0x259493){var _0x10751a={},_0x509c3b={},_0x3e89cf={'count':0x0,'rows':[]};var _0xa4d33f=_[_0x63c3('0x37')](db[_0x63c3('0x38')]['rawAttributes'],function(_0x55353e){return{'name':_0x55353e['fieldName'],'type':_0x55353e[_0x63c3('0x39')][_0x63c3('0x3a')]};});_0x509c3b[_0x63c3('0x3b')]=_[_0x63c3('0x37')](_0xa4d33f,'name');_0x509c3b['query']=_[_0x63c3('0x3c')](_0x537024[_0x63c3('0x3d')]);_0x509c3b['filters']=_[_0x63c3('0x3e')](_0x509c3b['model'],_0x509c3b['query']);_0x10751a[_0x63c3('0x3f')]=_[_0x63c3('0x3e')](_0x509c3b['model'],qs['fields'](_0x537024[_0x63c3('0x3d')][_0x63c3('0x40')]));_0x10751a['attributes']=_0x10751a[_0x63c3('0x3f')][_0x63c3('0x41')]?_0x10751a['attributes']:_0x509c3b[_0x63c3('0x3b')];if(!_0x537024[_0x63c3('0x3d')]['hasOwnProperty'](_0x63c3('0x42'))){_0x10751a[_0x63c3('0x29')]=qs[_0x63c3('0x29')](_0x537024[_0x63c3('0x3d')][_0x63c3('0x29')]);_0x10751a[_0x63c3('0x28')]=qs[_0x63c3('0x28')](_0x537024[_0x63c3('0x3d')][_0x63c3('0x28')]);}_0x10751a['order']=qs[_0x63c3('0x43')](_0x537024[_0x63c3('0x3d')]['sort']);_0x10751a[_0x63c3('0x44')]=qs[_0x63c3('0x45')](_[_0x63c3('0x46')](_0x537024['query'],_0x509c3b['filters']),_0xa4d33f);if(_0x537024[_0x63c3('0x3d')][_0x63c3('0x47')]){_0x10751a[_0x63c3('0x44')]=_[_0x63c3('0x48')](_0x10751a[_0x63c3('0x44')],{'$or':_[_0x63c3('0x37')](_0xa4d33f,function(_0x5bb8cd){if(_0x5bb8cd[_0x63c3('0x39')]!==_0x63c3('0x49')){var _0x1f3338={};_0x1f3338[_0x5bb8cd[_0x63c3('0x35')]]={'$like':'%'+_0x537024[_0x63c3('0x3d')][_0x63c3('0x47')]+'%'};return _0x1f3338;}})});}_0x10751a=_['merge']({},_0x10751a,_0x537024[_0x63c3('0x4a')]);var _0x5b0c07={'where':_0x10751a[_0x63c3('0x44')]};return db[_0x63c3('0x38')][_0x63c3('0x2a')](_0x5b0c07)['then'](function(_0x129686){_0x3e89cf[_0x63c3('0x2a')]=_0x129686;if(_0x537024[_0x63c3('0x3d')]['includeAll']){_0x10751a['include']=[{'all':!![]}];}return db[_0x63c3('0x38')][_0x63c3('0x4b')](_0x10751a);})['then'](function(_0x260ab7){_0x3e89cf['rows']=_0x260ab7;return _0x3e89cf;})[_0x63c3('0x2f')](respondWithFilteredResult(_0x259493,_0x10751a))[_0x63c3('0x4c')](handleError(_0x259493,null));};exports['show']=function(_0xfc14eb,_0x3da667){var _0x1c7b93={'raw':!![],'where':{'id':_0xfc14eb[_0x63c3('0x4d')]['id']}},_0x533a0a={};_0x533a0a[_0x63c3('0x3b')]=_[_0x63c3('0x3c')](db[_0x63c3('0x38')][_0x63c3('0x4e')]);_0x533a0a['query']=_[_0x63c3('0x3c')](_0xfc14eb[_0x63c3('0x3d')]);_0x533a0a[_0x63c3('0x45')]=_['intersection'](_0x533a0a['model'],_0x533a0a[_0x63c3('0x3d')]);_0x1c7b93[_0x63c3('0x3f')]=_[_0x63c3('0x3e')](_0x533a0a[_0x63c3('0x3b')],qs[_0x63c3('0x40')](_0xfc14eb['query'][_0x63c3('0x40')]));_0x1c7b93['attributes']=_0x1c7b93[_0x63c3('0x3f')][_0x63c3('0x41')]?_0x1c7b93[_0x63c3('0x3f')]:_0x533a0a[_0x63c3('0x3b')];if(_0xfc14eb[_0x63c3('0x3d')][_0x63c3('0x4f')]){_0x1c7b93['include']=[{'all':!![]}];}_0x1c7b93=_['merge']({},_0x1c7b93,_0xfc14eb[_0x63c3('0x4a')]);return db['Plugin'][_0x63c3('0x50')](_0x1c7b93)[_0x63c3('0x2f')](handleEntityNotFound(_0x3da667,null))[_0x63c3('0x2f')](respondWithResult(_0x3da667,null))[_0x63c3('0x4c')](handleError(_0x3da667,null));};exports[_0x63c3('0x51')]=function(_0x42dc5a,_0x2d3b9a,_0xaed956){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x42dc5a[_0x63c3('0x4d')]['id']},'attributes':[_0x63c3('0x35'),_0x63c3('0x9')],'raw':!![]})[_0x63c3('0x2f')](handleEntityNotFound(_0x2d3b9a,null))[_0x63c3('0x2f')](function(_0x2bdb0a){if(_0x2bdb0a){var _0x553cf9=path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),util[_0x63c3('0x55')](_0x63c3('0x56'),path[_0x63c3('0x57')](_0x2bdb0a['path'])));var _0x58c56d=fs['createWriteStream'](_0x553cf9);var _0x18ccc6=archiver(_0x63c3('0x58'),{'zlib':{'level':0x9}});_0x18ccc6['on'](_0x63c3('0x59'),function(_0x2bd26d){if(_0x2bd26d[_0x63c3('0x5a')]===_0x63c3('0x5b')){logger[_0x63c3('0x5c')](_0x2bd26d);}else{throw new db['Sequelize'][(_0x63c3('0x5d'))](_0x63c3('0x5e'));}});_0x18ccc6['on']('error',function(_0x37b83d){throw new db[(_0x63c3('0x5f'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x18ccc6[_0x63c3('0x60')](_0x58c56d);_0x18ccc6[_0x63c3('0x61')](_0x63c3('0x62'),{'cwd':path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),path[_0x63c3('0x63')](_0x2bdb0a[_0x63c3('0x9')])),'ignore':[path[_0x63c3('0x52')](path[_0x63c3('0x57')](_0x2bdb0a[_0x63c3('0x9')]),'node_modules/**/*'),path['join'](path['basename'](_0x2bdb0a[_0x63c3('0x9')]),'attachments/**/*')],'nodir':!![]})[_0x63c3('0x64')]();_0x58c56d['on'](_0x63c3('0x65'),function(){if(!fs[_0x63c3('0x66')](_0x553cf9)){throw new db[(_0x63c3('0x5f'))]['Error'](_0x63c3('0x67'));}return _0x2d3b9a[_0x63c3('0x51')](_0x553cf9,util[_0x63c3('0x55')](_0x63c3('0x56'),path[_0x63c3('0x57')](_0x2bdb0a[_0x63c3('0x9')])),function(_0xa5c0ef){if(_0xa5c0ef){throw new db['Sequelize'][(_0x63c3('0x5d'))](_0x63c3('0x68'));}fs[_0x63c3('0x69')](_0x553cf9);logger[_0x63c3('0x6a')](_0x63c3('0x6b'));logger[_0x63c3('0x6a')](_0x63c3('0x6c'));});});}return null;})['catch'](handleError(_0x2d3b9a,null));};exports[_0x63c3('0x6d')]=function(_0x5579a5,_0x59f648,_0x1eb85f){var _0x2412b3=path[_0x63c3('0x57')](_0x5579a5[_0x63c3('0x6e')][_0x63c3('0x6f')],path[_0x63c3('0x70')](_0x5579a5['file'][_0x63c3('0x6f')]));var _0x2e3a76=path[_0x63c3('0x52')](config[_0x63c3('0x53')],_0x63c3('0x54'),_0x5579a5[_0x63c3('0x6e')]['filename']);var _0x4f4964=path['join'](config['root'],_0x63c3('0x54'),_0x2412b3);logger[_0x63c3('0x6a')]('Plugin\x20upload\x20filepath:\x20%s',_0x2e3a76);logger[_0x63c3('0x6a')](_0x63c3('0x71'),_0x4f4964);try{fs[_0x63c3('0x72')](_0x2e3a76,parseInt(_0x63c3('0x73'),0x8));extract(_0x2e3a76,{'dir':_0x4f4964},function(_0x46f5b9){if(_0x46f5b9){logger[_0x63c3('0x5c')](_0x46f5b9);handleError(_0x46f5b9,!![]);};var _0x506bc9=fs[_0x63c3('0x74')](_0x4f4964);if(_0x506bc9[_0x63c3('0x41')]>0x1){removeReferences(_0x2e3a76,_0x4f4964);logger['error'](_0x63c3('0x75'));return _0x1eb85f(new Error(_0x63c3('0x75')));}var _0x2ceab6=fs[_0x63c3('0x76')](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0]));if(_0x2ceab6[_0x63c3('0x77')]()){removeReferences(_0x2e3a76,_0x4f4964);logger[_0x63c3('0x5c')](_0x63c3('0x75'));return _0x1eb85f(new Error('Invalid\x20plugin\x20structure'));}if(_0x2ceab6[_0x63c3('0x78')]()){var _0xd554f8=fs['readdirSync'](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0]));if(_0xd554f8['length']===0x0){removeReferences(_0x2e3a76,_0x4f4964);logger[_0x63c3('0x5c')](_0x63c3('0x75'));return _0x1eb85f(new Error(_0x63c3('0x75')));}var _0x4c3543=_0xd554f8[_0x63c3('0x79')](function(_0x15e88a){return _0x15e88a===_0x63c3('0x7a');});if(!_0x4c3543){return _0x1eb85f(new Error('Plugin\x20manifest\x20missing'));}var _0x22c92c=fs['readFileSync'](path[_0x63c3('0x52')](_0x4f4964,_0x506bc9[0x0],'manifest.json'));var _0x389414=JSON[_0x63c3('0x7b')](_0x22c92c);if('undefined'==typeof _0x389414[_0x63c3('0x35')]){return _0x1eb85f(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x39')]){return _0x1eb85f(new Error(_0x63c3('0x7d')));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x7e')]){return _0x1eb85f(new Error(_0x63c3('0x7f')));}if('undefined'==typeof _0x389414['parameters']){return _0x1eb85f(new Error(_0x63c3('0x80')));}if(_0x389414[_0x63c3('0x39')]===_0x63c3('0x81')){if('undefined'==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]){return _0x1eb85f(new Error(_0x63c3('0x84')));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]['admin']&&'undefined'==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]['agent']){return _0x1eb85f(new Error(_0x63c3('0x85')));}}else if(_0x389414[_0x63c3('0x39')]===_0x63c3('0x86')){if(_0x63c3('0x7c')==typeof _0x389414['parameters'][_0x63c3('0x87')]){return _0x1eb85f(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x63c3('0x7c')==typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x88')]){return _0x1eb85f(new Error(_0x63c3('0x89')));}}else{return _0x1eb85f(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x3b3dbd=_0x389414[_0x63c3('0x35')];var _0x17e191=_0x389414[_0x63c3('0x8a')];var _0x4b9f04=_0x389414[_0x63c3('0x39')];var _0x5e0784=_0x389414[_0x63c3('0x8b')]?_0x389414[_0x63c3('0x8b')]:_0x63c3('0x8c');var _0x18a443=_0x389414['icon']?_0x389414[_0x63c3('0x8d')]:_0x63c3('0x8e');var _0x2fbc4b='';var _0x52e66f='';var _0x143fd1='';var _0x306750='';var _0x83ed62=_0x389414[_0x63c3('0x7e')];if(_0x4b9f04===_0x63c3('0x81')){if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')]){var _0x2126aa=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x2126aa)){_0x2fbc4b=path[_0x63c3('0x52')](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x2126aa);}else{_0x2fbc4b=_0x2126aa;}}else{logger[_0x63c3('0x6a')](_0x63c3('0x92'));}if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')]){var _0x341c81=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x341c81)){_0x52e66f=path['join'](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x341c81);}else{_0x52e66f=_0x341c81;}}else{logger[_0x63c3('0x6a')](_0x63c3('0x94'));}}else if(_0x4b9f04===_0x63c3('0x86')){_0x143fd1=_0x389414['parameters'][_0x63c3('0x87')];_0x306750=_0x389414[_0x63c3('0x82')][_0x63c3('0x88')];if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')]){if(_0x63c3('0x7c')!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')]){var _0x2126aa=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x8f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2126aa)){_0x2fbc4b=path[_0x63c3('0x52')](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x2126aa);}else{_0x2fbc4b=_0x2126aa;}}if('undefined'!=typeof _0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')]){var _0x341c81=_0x389414[_0x63c3('0x82')][_0x63c3('0x83')][_0x63c3('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x63c3('0x90')](_0x341c81)){_0x52e66f=path['join'](_0x63c3('0x91'),_0x2412b3,_0x506bc9[0x0],_0x341c81);}else{_0x52e66f=_0x341c81;}}}}var _0x3e4d9b={'name':_0x3b3dbd,'description':_0x17e191,'path':path[_0x63c3('0x52')](_0x2412b3,_0x506bc9[0x0]),'type':_0x4b9f04,'sidebar':_0x5e0784,'icon':_0x18a443,'adminUrl':_0x2fbc4b,'agentUrl':_0x52e66f,'scriptName':_0x143fd1,'scriptPath':_0x306750,'version':_0x83ed62};removeReferences(_0x2e3a76,null);return db[_0x63c3('0x38')][_0x63c3('0x95')](_0x3e4d9b)[_0x63c3('0x2f')](function(_0x2dfb6a){var _0x331669={'role':_0x5579a5['body']['role'],'userProfileId':_0x5579a5[_0x63c3('0x96')][_0x63c3('0x97')]};if(!_0x331669)throw new Error(_0x63c3('0x98'));if(_0x331669[_0x63c3('0x99')]===_0x63c3('0x9a')){var _0x2e0900=_0x2dfb6a[_0x63c3('0x31')]({'plain':!![]});return db[_0x63c3('0x9b')][_0x63c3('0x50')]({'where':{'name':_0x63c3('0x32'),'userProfileId':_0x331669[_0x63c3('0x97')]},'raw':!![]})[_0x63c3('0x2f')](function(_0x461a51){if(_0x461a51&&_0x461a51[_0x63c3('0x9c')]===0x0){return db[_0x63c3('0x33')][_0x63c3('0x95')]({'name':_0x2e0900[_0x63c3('0x35')],'resourceId':_0x2e0900['id'],'type':_0x461a51[_0x63c3('0x35')],'sectionId':_0x461a51['id']},{})[_0x63c3('0x2f')](function(){return _0x2dfb6a;});}else{return _0x2dfb6a;}})[_0x63c3('0x4c')](function(_0x142e44){logger[_0x63c3('0x5c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x142e44);throw _0x142e44;});}return _0x2dfb6a;})[_0x63c3('0x2f')](respondWithResult(_0x59f648,null))['catch'](handleError(_0x59f648,null));}});}catch(_0xf7c7d8){_0x59f648['status'](0x1f4)[_0x63c3('0x9d')](_0xf7c7d8);}};function removeReferences(_0x47346a,_0xb769b){try{if(_0x47346a){fs[_0x63c3('0x69')](_0x47346a);logger[_0x63c3('0x6a')]('Zip\x20archive\x20removed');}if(_0xb769b){rimraf(_0xb769b,function(){});logger['info'](_0x63c3('0x9e'));}}catch(_0x41eb35){logger[_0x63c3('0x5c')](_0x41eb35);}}exports[_0x63c3('0x2e')]=function(_0x22d76f,_0x3d96e7,_0x45fde6){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x22d76f[_0x63c3('0x4d')]['id']}})[_0x63c3('0x2f')](handleEntityNotFound(_0x3d96e7,null))['then'](saveUpdates(_0x22d76f['body'],null))[_0x63c3('0x2f')](respondWithResult(_0x3d96e7,null))[_0x63c3('0x4c')](handleError(_0x3d96e7,null));};exports['delete']=function(_0x251c3e,_0x5a0a8e,_0x3c7423){return db[_0x63c3('0x38')][_0x63c3('0x50')]({'where':{'id':_0x251c3e['params']['id']}})[_0x63c3('0x2f')](function(_0xfe4763){if(_0xfe4763){return _0xfe4763[_0x63c3('0x30')]();}})[_0x63c3('0x2f')](function(_0x55f8fb){rimraf(path[_0x63c3('0x52')](config[_0x63c3('0x53')],'server/files/plugins',path[_0x63c3('0x63')](_0x55f8fb['path'])),function(){});return _0x55f8fb;})['then'](handleEntityNotFound(_0x5a0a8e,null))[_0x63c3('0x2f')](respondWithStatusCode(_0x5a0a8e,null))[_0x63c3('0x4c')](handleError(_0x5a0a8e,null));};exports[_0x63c3('0x9f')]=function(_0xfeb4c7,_0x3dcd11,_0x4bd685){return BPromise[_0x63c3('0xa0')]()[_0x63c3('0x2f')](function(){if(!_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')]){throw new Error(_0x63c3('0xa2'));}var _0x94ec9f=_0xfeb4c7['query'][_0x63c3('0xa3')]?_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa3')]+':'+_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')]:_0x63c3('0xa4')+_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa1')];var _0x27a49a=_0xfeb4c7['query'][_0x63c3('0x27')]?_0xfeb4c7[_0x63c3('0x3d')]['json']:!![];var _0x2c0b3f=_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa5')]?_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0xa5')]:null;var _0x15dbed={'method':_0xfeb4c7[_0x63c3('0xa6')],'uri':util[_0x63c3('0x55')](_0x63c3('0xa7'),_0x94ec9f,_0xfeb4c7['query'][_0x63c3('0x9')]),'json':_0x27a49a,'resolveWithFullResponse':!![],'encoding':_0x2c0b3f,'qs':_0xfeb4c7['query']};if(_0xfeb4c7[_0x63c3('0xa8')]){_0x15dbed[_0x63c3('0xa8')]=_0xfeb4c7['headers'];if(_0x15dbed[_0x63c3('0xa8')][_0x63c3('0xa9')]){delete _0x15dbed[_0x63c3('0xa8')][_0x63c3('0xa9')];}}if(_0x15dbed['headers'][_0x63c3('0xaa')]){delete _0x15dbed['headers'][_0x63c3('0xaa')];}return rp(_0x15dbed);})[_0x63c3('0x2f')](function(_0x5bc972){if(_0x5bc972){_0x3dcd11[_0x63c3('0x2b')](_0x5bc972[_0x63c3('0xa8')]);logger[_0x63c3('0x6a')](_0x5bc972[_0x63c3('0x96')]);if(_['endsWith'](_0xfeb4c7[_0x63c3('0x3d')][_0x63c3('0x9')],'download')&&_0x5bc972['statusCode']==0x1f4){return _0x3dcd11[_0x63c3('0x24')](_0x5bc972[_0x63c3('0xab')]);}else{return _0x3dcd11['status'](_0x5bc972[_0x63c3('0xab')])[_0x63c3('0x9d')](_0x5bc972[_0x63c3('0x96')]);}}else{return _0x3dcd11[_0x63c3('0x24')](0xc8);}})[_0x63c3('0x4c')](handleError(_0x3dcd11,null));};exports[_0x63c3('0xac')]=function(_0x27602c,_0x3b724f,_0xee3145){return BPromise[_0x63c3('0xa0')]()['then'](function(){if(!_0x27602c[_0x63c3('0x3d')][_0x63c3('0x9')]){throw new Error(_0x63c3('0xad'));}if(!_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')]){throw new Error(_0x63c3('0xa2'));}var _0x491c38=_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa3')]?_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa3')]+':'+_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')]:'http://localhost:'+_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa1')];var _0x343a87=_0x27602c[_0x63c3('0x3d')][_0x63c3('0x27')]?_0x27602c[_0x63c3('0x3d')]['json']:!![];var _0x2b24f7=_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa5')]?_0x27602c[_0x63c3('0x3d')][_0x63c3('0xa5')]:null;var _0x56d238={'method':_0x27602c['method'],'uri':util[_0x63c3('0x55')](_0x63c3('0xa7'),_0x491c38,_0x27602c['query']['path']),'json':_0x343a87,'resolveWithFullResponse':!![],'encoding':_0x2b24f7,'body':_0x27602c[_0x63c3('0x96')]};if(_0x27602c['headers']){_0x56d238[_0x63c3('0xa8')]=_0x27602c[_0x63c3('0xa8')];if(_0x56d238[_0x63c3('0xa8')][_0x63c3('0xa9')]){delete _0x56d238[_0x63c3('0xa8')]['content-length'];}}if(_0x56d238[_0x63c3('0xa8')][_0x63c3('0xaa')]){delete _0x56d238[_0x63c3('0xa8')][_0x63c3('0xaa')];}return rp(_0x56d238);})[_0x63c3('0x2f')](function(_0x1dfc0c){if(_0x1dfc0c){_0x3b724f['set'](_0x1dfc0c[_0x63c3('0xa8')]);logger[_0x63c3('0x6a')](_0x1dfc0c[_0x63c3('0x96')]);return _0x3b724f[_0x63c3('0x25')](_0x1dfc0c[_0x63c3('0xab')])[_0x63c3('0x9d')](_0x1dfc0c[_0x63c3('0x96')]);}else{return _0x3b724f[_0x63c3('0x24')](0xc8);}})[_0x63c3('0x4c')](handleError(_0x3b724f,null));};
\ No newline at end of file
+var _0x8dfe=['Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','admin','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','type','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','set','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','content-type','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','Plugins','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','show','params','fields','length','find','catch','download','join','server/files/plugins','%s.zip','basename','createWriteStream','warning','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','root','dirname','node_modules/**/*','finalize','close','Error','Plugin\x20not\x20found','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json'];(function(_0x4c5214,_0x17089b){var _0x4f38e3=function(_0x2c2c14){while(--_0x2c2c14){_0x4c5214['push'](_0x4c5214['shift']());}};_0x4f38e3(++_0x17089b);}(_0x8dfe,0xee));var _0xe8df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8dfe[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xe8df('0x0'));var rimraf=require(_0xe8df('0x1'));var zipdir=require(_0xe8df('0x2'));var jsonpatch=require(_0xe8df('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe8df('0x4'));var Mustache=require(_0xe8df('0x5'));var util=require(_0xe8df('0x6'));var path=require(_0xe8df('0x7'));var sox=require(_0xe8df('0x8'));var csv=require(_0xe8df('0x9'));var ejs=require(_0xe8df('0xa'));var fs=require('fs');var fs_extra=require(_0xe8df('0xb'));var _=require(_0xe8df('0xc'));var squel=require(_0xe8df('0xd'));var crypto=require(_0xe8df('0xe'));var jsforce=require(_0xe8df('0xf'));var deskjs=require(_0xe8df('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe8df('0x11'));var Papa=require(_0xe8df('0x12'));var extract=require(_0xe8df('0x13'));var rimraf=require('rimraf');var archiver=require(_0xe8df('0x14'));var Redis=require('ioredis');var authService=require(_0xe8df('0x15'));var qs=require(_0xe8df('0x16'));var as=require(_0xe8df('0x17'));var hardwareService=require(_0xe8df('0x18'));var logger=require(_0xe8df('0x19'))('api');var utils=require(_0xe8df('0x1a'));var config=require(_0xe8df('0x1b'));var licenseUtil=require(_0xe8df('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe8df('0x1d')](config[_0xe8df('0x1e')],{'host':_0xe8df('0x1f'),'port':0x18eb});var socket=require(_0xe8df('0x20'))(new Redis(config[_0xe8df('0x1e')]));require(_0xe8df('0x21'))[_0xe8df('0x22')](socket);function respondWithStatusCode(_0x422759,_0x5b4c53){_0x5b4c53=_0x5b4c53||0xcc;return function(_0x131ae6){if(_0x131ae6){return _0x422759[_0xe8df('0x23')](_0x5b4c53);}return _0x422759['status'](_0x5b4c53)[_0xe8df('0x24')]();};}function respondWithResult(_0x101406,_0x45b326){_0x45b326=_0x45b326||0xc8;return function(_0x168813){if(_0x168813){return _0x101406[_0xe8df('0x25')](_0x45b326)['json'](_0x168813);}};}function respondWithFilteredResult(_0x3d3cb6,_0x109bee){return function(_0x15122d){if(_0x15122d){var _0x41d515=typeof _0x109bee[_0xe8df('0x26')]===_0xe8df('0x27')&&typeof _0x109bee[_0xe8df('0x28')]===_0xe8df('0x27');var _0x57c427=_0x15122d[_0xe8df('0x29')];var _0x476e00=_0x41d515?0x0:_0x109bee[_0xe8df('0x26')];var _0x5ea2e=_0x41d515?_0x15122d[_0xe8df('0x29')]:_0x109bee['offset']+_0x109bee[_0xe8df('0x28')];var _0x3be0a9;if(_0x5ea2e>=_0x57c427){_0x5ea2e=_0x57c427;_0x3be0a9=0xc8;}else{_0x3be0a9=0xce;}_0x3d3cb6[_0xe8df('0x25')](_0x3be0a9);return _0x3d3cb6['set'](_0xe8df('0x2a'),_0x476e00+'-'+_0x5ea2e+'/'+_0x57c427)[_0xe8df('0x2b')](_0x15122d);}return null;};}function patchUpdates(_0x528e0a){return function(_0x4b1cf6){try{jsonpatch[_0xe8df('0x2c')](_0x4b1cf6,_0x528e0a,!![]);}catch(_0xfd18a3){return BPromise[_0xe8df('0x2d')](_0xfd18a3);}return _0x4b1cf6['save']();};}function saveUpdates(_0x19a78e,_0x4be4df){return function(_0x5858b8){if(_0x5858b8){return _0x5858b8[_0xe8df('0x2e')](_0x19a78e)[_0xe8df('0x2f')](function(_0x40910b){return _0x40910b;});}return null;};}function removeEntity(_0x1e2150,_0x527247){return function(_0x205084){if(_0x205084){return _0x205084[_0xe8df('0x30')]()[_0xe8df('0x2f')](function(){var _0x223f62=_0x205084[_0xe8df('0x31')]({'plain':!![]});var _0x144c1c=_0xe8df('0x32');return db['UserProfileResource']['destroy']({'where':{'type':_0x144c1c,'resourceId':_0x223f62['id']}})[_0xe8df('0x2f')](function(){return _0x205084;});})[_0xe8df('0x2f')](function(){_0x1e2150['status'](0xcc)[_0xe8df('0x24')]();});}};}function handleEntityNotFound(_0xa43a40,_0xbce48f){return function(_0x1eb74f){if(!_0x1eb74f){_0xa43a40[_0xe8df('0x23')](0x194);}return _0x1eb74f;};}function handleError(_0x3cb589,_0x472269){_0x472269=_0x472269||0x1f4;return function(_0x2fa239){logger['error'](_0x2fa239[_0xe8df('0x33')]);if(_0x2fa239[_0xe8df('0x34')]){delete _0x2fa239[_0xe8df('0x34')];}_0x3cb589[_0xe8df('0x25')](_0x472269)[_0xe8df('0x35')](_0x2fa239);};}exports['index']=function(_0x45a9ee,_0x1ae488){var _0x314e6a={},_0x5d97c7={},_0x1078ed={'count':0x0,'rows':[]};var _0x56be89=_[_0xe8df('0x36')](db['Plugin'][_0xe8df('0x37')],function(_0x34dd16){return{'name':_0x34dd16[_0xe8df('0x38')],'type':_0x34dd16['type'][_0xe8df('0x39')]};});_0x5d97c7[_0xe8df('0x3a')]=_[_0xe8df('0x36')](_0x56be89,_0xe8df('0x34'));_0x5d97c7[_0xe8df('0x3b')]=_[_0xe8df('0x3c')](_0x45a9ee[_0xe8df('0x3b')]);_0x5d97c7[_0xe8df('0x3d')]=_[_0xe8df('0x3e')](_0x5d97c7[_0xe8df('0x3a')],_0x5d97c7[_0xe8df('0x3b')]);_0x314e6a['attributes']=_[_0xe8df('0x3e')](_0x5d97c7['model'],qs['fields'](_0x45a9ee[_0xe8df('0x3b')]['fields']));_0x314e6a['attributes']=_0x314e6a['attributes']['length']?_0x314e6a[_0xe8df('0x3f')]:_0x5d97c7['model'];if(!_0x45a9ee['query'][_0xe8df('0x40')](_0xe8df('0x41'))){_0x314e6a[_0xe8df('0x28')]=qs[_0xe8df('0x28')](_0x45a9ee['query']['limit']);_0x314e6a[_0xe8df('0x26')]=qs['offset'](_0x45a9ee[_0xe8df('0x3b')][_0xe8df('0x26')]);}_0x314e6a['order']=qs[_0xe8df('0x42')](_0x45a9ee[_0xe8df('0x3b')][_0xe8df('0x42')]);_0x314e6a[_0xe8df('0x43')]=qs[_0xe8df('0x3d')](_[_0xe8df('0x44')](_0x45a9ee[_0xe8df('0x3b')],_0x5d97c7[_0xe8df('0x3d')]),_0x56be89);if(_0x45a9ee[_0xe8df('0x3b')][_0xe8df('0x45')]){_0x314e6a[_0xe8df('0x43')]=_[_0xe8df('0x46')](_0x314e6a[_0xe8df('0x43')],{'$or':_[_0xe8df('0x36')](_0x56be89,function(_0x5dea11){if(_0x5dea11['type']!==_0xe8df('0x47')){var _0x33f5b1={};_0x33f5b1[_0x5dea11[_0xe8df('0x34')]]={'$like':'%'+_0x45a9ee[_0xe8df('0x3b')]['filter']+'%'};return _0x33f5b1;}})});}_0x314e6a=_[_0xe8df('0x46')]({},_0x314e6a,_0x45a9ee[_0xe8df('0x48')]);var _0x1764e7={'where':_0x314e6a['where']};return db[_0xe8df('0x49')][_0xe8df('0x29')](_0x1764e7)[_0xe8df('0x2f')](function(_0x33e9d3){_0x1078ed[_0xe8df('0x29')]=_0x33e9d3;if(_0x45a9ee[_0xe8df('0x3b')][_0xe8df('0x4a')]){_0x314e6a[_0xe8df('0x4b')]=[{'all':!![]}];}return db[_0xe8df('0x49')][_0xe8df('0x4c')](_0x314e6a);})[_0xe8df('0x2f')](function(_0x483f83){_0x1078ed[_0xe8df('0x4d')]=_0x483f83;return _0x1078ed;})[_0xe8df('0x2f')](respondWithFilteredResult(_0x1ae488,_0x314e6a))['catch'](handleError(_0x1ae488,null));};exports[_0xe8df('0x4e')]=function(_0x12a134,_0x42ec4d){var _0x17b8ad={'raw':!![],'where':{'id':_0x12a134[_0xe8df('0x4f')]['id']}},_0x10f1e6={};_0x10f1e6[_0xe8df('0x3a')]=_[_0xe8df('0x3c')](db[_0xe8df('0x49')]['rawAttributes']);_0x10f1e6[_0xe8df('0x3b')]=_[_0xe8df('0x3c')](_0x12a134[_0xe8df('0x3b')]);_0x10f1e6['filters']=_['intersection'](_0x10f1e6[_0xe8df('0x3a')],_0x10f1e6['query']);_0x17b8ad[_0xe8df('0x3f')]=_[_0xe8df('0x3e')](_0x10f1e6[_0xe8df('0x3a')],qs[_0xe8df('0x50')](_0x12a134[_0xe8df('0x3b')][_0xe8df('0x50')]));_0x17b8ad[_0xe8df('0x3f')]=_0x17b8ad[_0xe8df('0x3f')][_0xe8df('0x51')]?_0x17b8ad[_0xe8df('0x3f')]:_0x10f1e6[_0xe8df('0x3a')];if(_0x12a134[_0xe8df('0x3b')]['includeAll']){_0x17b8ad[_0xe8df('0x4b')]=[{'all':!![]}];}_0x17b8ad=_[_0xe8df('0x46')]({},_0x17b8ad,_0x12a134[_0xe8df('0x48')]);return db[_0xe8df('0x49')][_0xe8df('0x52')](_0x17b8ad)[_0xe8df('0x2f')](handleEntityNotFound(_0x42ec4d,null))[_0xe8df('0x2f')](respondWithResult(_0x42ec4d,null))[_0xe8df('0x53')](handleError(_0x42ec4d,null));};exports[_0xe8df('0x54')]=function(_0x43de39,_0x473f50,_0x2bd28c){return db[_0xe8df('0x49')][_0xe8df('0x52')]({'where':{'id':_0x43de39[_0xe8df('0x4f')]['id']},'attributes':[_0xe8df('0x34'),_0xe8df('0x7')],'raw':!![]})[_0xe8df('0x2f')](handleEntityNotFound(_0x473f50,null))[_0xe8df('0x2f')](function(_0x36fc98){if(_0x36fc98){var _0x589a19=path[_0xe8df('0x55')](config['root'],_0xe8df('0x56'),util['format'](_0xe8df('0x57'),path[_0xe8df('0x58')](_0x36fc98[_0xe8df('0x7')])));var _0x1dbf51=fs[_0xe8df('0x59')](_0x589a19);var _0xd3ce8a=archiver('zip',{'zlib':{'level':0x9}});_0xd3ce8a['on'](_0xe8df('0x5a'),function(_0x1d10eb){if(_0x1d10eb[_0xe8df('0x5b')]===_0xe8df('0x5c')){logger[_0xe8df('0x5d')](_0x1d10eb);}else{throw new db[(_0xe8df('0x5e'))]['Error'](_0xe8df('0x5f'));}});_0xd3ce8a['on'](_0xe8df('0x5d'),function(_0x5903e9){throw new db[(_0xe8df('0x5e'))]['Error'](_0xe8df('0x5f'));});_0xd3ce8a[_0xe8df('0x60')](_0x1dbf51);_0xd3ce8a['glob'](_0xe8df('0x61'),{'cwd':path[_0xe8df('0x55')](config[_0xe8df('0x62')],_0xe8df('0x56'),path[_0xe8df('0x63')](_0x36fc98['path'])),'ignore':[path['join'](path['basename'](_0x36fc98[_0xe8df('0x7')]),_0xe8df('0x64')),path[_0xe8df('0x55')](path[_0xe8df('0x58')](_0x36fc98[_0xe8df('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xe8df('0x65')]();_0x1dbf51['on'](_0xe8df('0x66'),function(){if(!fs['existsSync'](_0x589a19)){throw new db[(_0xe8df('0x5e'))][(_0xe8df('0x67'))](_0xe8df('0x68'));}return _0x473f50[_0xe8df('0x54')](_0x589a19,util[_0xe8df('0x69')]('%s.zip',path[_0xe8df('0x58')](_0x36fc98[_0xe8df('0x7')])),function(_0xb2b35d){if(_0xb2b35d){throw new db[(_0xe8df('0x5e'))][(_0xe8df('0x67'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xe8df('0x6a')](_0x589a19);logger[_0xe8df('0x6b')](_0xe8df('0x6c'));logger['info'](_0xe8df('0x6d'));});});}return null;})['catch'](handleError(_0x473f50,null));};exports[_0xe8df('0x6e')]=function(_0x3a5954,_0x39e093,_0x39e3fe){var _0x5942d6=path[_0xe8df('0x58')](_0x3a5954['file'][_0xe8df('0x6f')],path[_0xe8df('0x70')](_0x3a5954[_0xe8df('0x71')][_0xe8df('0x6f')]));var _0x242077=path[_0xe8df('0x55')](config['root'],_0xe8df('0x56'),_0x3a5954[_0xe8df('0x71')][_0xe8df('0x6f')]);var _0xee6fcf=path[_0xe8df('0x55')](config[_0xe8df('0x62')],'server/files/plugins',_0x5942d6);logger['info'](_0xe8df('0x72'),_0x242077);logger[_0xe8df('0x6b')](_0xe8df('0x73'),_0xee6fcf);try{fs[_0xe8df('0x74')](_0x242077,parseInt('0777',0x8));extract(_0x242077,{'dir':_0xee6fcf},function(_0x18d796){if(_0x18d796){logger[_0xe8df('0x5d')](_0x18d796);handleError(_0x18d796,!![]);};var _0x9bc73c=fs[_0xe8df('0x75')](_0xee6fcf);if(_0x9bc73c[_0xe8df('0x51')]>0x1){removeReferences(_0x242077,_0xee6fcf);logger['error'](_0xe8df('0x76'));return _0x39e3fe(new Error('Invalid\x20plugin\x20structure'));}var _0x4a4293=fs[_0xe8df('0x77')](path[_0xe8df('0x55')](_0xee6fcf,_0x9bc73c[0x0]));if(_0x4a4293[_0xe8df('0x78')]()){removeReferences(_0x242077,_0xee6fcf);logger[_0xe8df('0x5d')](_0xe8df('0x76'));return _0x39e3fe(new Error(_0xe8df('0x76')));}if(_0x4a4293[_0xe8df('0x79')]()){var _0x12f29a=fs[_0xe8df('0x75')](path['join'](_0xee6fcf,_0x9bc73c[0x0]));if(_0x12f29a[_0xe8df('0x51')]===0x0){removeReferences(_0x242077,_0xee6fcf);logger['error']('Invalid\x20plugin\x20structure');return _0x39e3fe(new Error(_0xe8df('0x76')));}var _0x356bbc=_0x12f29a[_0xe8df('0x7a')](function(_0x2881f5){return _0x2881f5===_0xe8df('0x7b');});if(!_0x356bbc){return _0x39e3fe(new Error(_0xe8df('0x7c')));}var _0x38a81f=fs[_0xe8df('0x7d')](path[_0xe8df('0x55')](_0xee6fcf,_0x9bc73c[0x0],_0xe8df('0x7b')));var _0x36368c=JSON[_0xe8df('0x7e')](_0x38a81f);if('undefined'==typeof _0x36368c[_0xe8df('0x34')]){return _0x39e3fe(new Error(_0xe8df('0x7f')));}if(_0xe8df('0x27')==typeof _0x36368c['type']){return _0x39e3fe(new Error(_0xe8df('0x80')));}if(_0xe8df('0x27')==typeof _0x36368c[_0xe8df('0x81')]){return _0x39e3fe(new Error(_0xe8df('0x82')));}if(_0xe8df('0x27')==typeof _0x36368c['parameters']){return _0x39e3fe(new Error(_0xe8df('0x83')));}if(_0x36368c['type']===_0xe8df('0x84')){if(_0xe8df('0x27')==typeof _0x36368c[_0xe8df('0x85')]['views']){return _0x39e3fe(new Error(_0xe8df('0x86')));}if(_0xe8df('0x27')==typeof _0x36368c[_0xe8df('0x85')]['views'][_0xe8df('0x87')]&&_0xe8df('0x27')==typeof _0x36368c['parameters'][_0xe8df('0x88')][_0xe8df('0x89')]){return _0x39e3fe(new Error(_0xe8df('0x8a')));}}else if(_0x36368c[_0xe8df('0x8b')]===_0xe8df('0x8c')){if(_0xe8df('0x27')==typeof _0x36368c[_0xe8df('0x85')][_0xe8df('0x8d')]){return _0x39e3fe(new Error(_0xe8df('0x8e')));}if(_0xe8df('0x27')==typeof _0x36368c[_0xe8df('0x85')]['scriptPath']){return _0x39e3fe(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x39e3fe(new Error(_0xe8df('0x8f')));}var _0x4567d2=_0x36368c[_0xe8df('0x34')];var _0x4d4420=_0x36368c[_0xe8df('0x90')];var _0x8b4db6=_0x36368c['type'];var _0x56b7c1=_0x36368c[_0xe8df('0x91')]?_0x36368c['sidebar']:_0xe8df('0x92');var _0x4a6fdf=_0x36368c[_0xe8df('0x93')]?_0x36368c['icon']:_0xe8df('0x94');var _0x17da15='';var _0x4854d3='';var _0x1bc00b='';var _0x4eacef='';var _0x170dc8=_0x36368c[_0xe8df('0x81')];if(_0x8b4db6===_0xe8df('0x84')){if(_0xe8df('0x27')!=typeof _0x36368c[_0xe8df('0x85')][_0xe8df('0x88')][_0xe8df('0x87')]){var _0x1d6f21=_0x36368c[_0xe8df('0x85')][_0xe8df('0x88')][_0xe8df('0x87')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1d6f21)){_0x17da15=path[_0xe8df('0x55')](_0xe8df('0x95'),_0x5942d6,_0x9bc73c[0x0],_0x1d6f21);}else{_0x17da15=_0x1d6f21;}}else{logger[_0xe8df('0x6b')](_0xe8df('0x96'));}if('undefined'!=typeof _0x36368c[_0xe8df('0x85')][_0xe8df('0x88')][_0xe8df('0x89')]){var _0x3fc094=_0x36368c[_0xe8df('0x85')][_0xe8df('0x88')][_0xe8df('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xe8df('0x97')](_0x3fc094)){_0x4854d3=path[_0xe8df('0x55')](_0xe8df('0x95'),_0x5942d6,_0x9bc73c[0x0],_0x3fc094);}else{_0x4854d3=_0x3fc094;}}else{logger[_0xe8df('0x6b')](_0xe8df('0x98'));}}else if(_0x8b4db6==='script'){_0x1bc00b=_0x36368c['parameters'][_0xe8df('0x8d')];_0x4eacef=_0x36368c['parameters'][_0xe8df('0x99')];if(_0xe8df('0x27')!=typeof _0x36368c[_0xe8df('0x85')]['views']){if(_0xe8df('0x27')!=typeof _0x36368c[_0xe8df('0x85')]['views'][_0xe8df('0x87')]){var _0x1d6f21=_0x36368c['parameters'][_0xe8df('0x88')][_0xe8df('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xe8df('0x97')](_0x1d6f21)){_0x17da15=path[_0xe8df('0x55')](_0xe8df('0x95'),_0x5942d6,_0x9bc73c[0x0],_0x1d6f21);}else{_0x17da15=_0x1d6f21;}}if(_0xe8df('0x27')!=typeof _0x36368c[_0xe8df('0x85')][_0xe8df('0x88')]['agent']){var _0x3fc094=_0x36368c[_0xe8df('0x85')][_0xe8df('0x88')][_0xe8df('0x89')];if(!/^(f|ht)tps?:\/\//i[_0xe8df('0x97')](_0x3fc094)){_0x4854d3=path['join']('plugins',_0x5942d6,_0x9bc73c[0x0],_0x3fc094);}else{_0x4854d3=_0x3fc094;}}}}var _0x1959c3={'name':_0x4567d2,'description':_0x4d4420,'path':path[_0xe8df('0x55')](_0x5942d6,_0x9bc73c[0x0]),'type':_0x8b4db6,'sidebar':_0x56b7c1,'icon':_0x4a6fdf,'adminUrl':_0x17da15,'agentUrl':_0x4854d3,'scriptName':_0x1bc00b,'scriptPath':_0x4eacef,'version':_0x170dc8};removeReferences(_0x242077,null);return db[_0xe8df('0x49')][_0xe8df('0x9a')](_0x1959c3)[_0xe8df('0x2f')](function(_0x93afb){var _0x23c958={'role':_0x3a5954[_0xe8df('0x9b')][_0xe8df('0x9c')],'userProfileId':_0x3a5954[_0xe8df('0x9b')][_0xe8df('0x9d')]};if(!_0x23c958)throw new Error(_0xe8df('0x9e'));if(_0x23c958[_0xe8df('0x9c')]==='user'){var _0x4a3cc7=_0x93afb[_0xe8df('0x31')]({'plain':!![]});return db[_0xe8df('0x9f')]['find']({'where':{'name':'Plugins','userProfileId':_0x23c958[_0xe8df('0x9d')]},'raw':!![]})['then'](function(_0x218321){if(_0x218321&&_0x218321['autoAssociation']===0x0){return db[_0xe8df('0xa0')][_0xe8df('0x9a')]({'name':_0x4a3cc7[_0xe8df('0x34')],'resourceId':_0x4a3cc7['id'],'type':_0x218321[_0xe8df('0x34')],'sectionId':_0x218321['id']},{})['then'](function(){return _0x93afb;});}else{return _0x93afb;}})['catch'](function(_0x27ecb1){logger[_0xe8df('0x5d')](_0xe8df('0xa1'),_0x27ecb1);throw _0x27ecb1;});}return _0x93afb;})[_0xe8df('0x2f')](respondWithResult(_0x39e093,null))[_0xe8df('0x53')](handleError(_0x39e093,null));}});}catch(_0x126b5b){_0x39e093[_0xe8df('0x25')](0x1f4)[_0xe8df('0x35')](_0x126b5b);}};function removeReferences(_0x228670,_0x516d57){try{if(_0x228670){fs[_0xe8df('0x6a')](_0x228670);logger[_0xe8df('0x6b')](_0xe8df('0xa2'));}if(_0x516d57){rimraf(_0x516d57,function(){});logger[_0xe8df('0x6b')]('Extracted\x20folder\x20removed');}}catch(_0x5b30bf){logger[_0xe8df('0x5d')](_0x5b30bf);}}exports[_0xe8df('0x2e')]=function(_0x17d5fe,_0x543117,_0x5b214d){return db['Plugin']['find']({'where':{'id':_0x17d5fe[_0xe8df('0x4f')]['id']}})[_0xe8df('0x2f')](handleEntityNotFound(_0x543117,null))[_0xe8df('0x2f')](saveUpdates(_0x17d5fe['body'],null))['then'](respondWithResult(_0x543117,null))[_0xe8df('0x53')](handleError(_0x543117,null));};exports[_0xe8df('0xa3')]=function(_0x5bb604,_0x57a062,_0xf40636){return db['Plugin'][_0xe8df('0x52')]({'where':{'id':_0x5bb604['params']['id']}})['then'](function(_0x416aa9){if(_0x416aa9){return _0x416aa9[_0xe8df('0x30')]();}})[_0xe8df('0x2f')](function(_0x533592){rimraf(path[_0xe8df('0x55')](config[_0xe8df('0x62')],_0xe8df('0x56'),path[_0xe8df('0x63')](_0x533592[_0xe8df('0x7')])),function(){});return _0x533592;})['then'](handleEntityNotFound(_0x57a062,null))[_0xe8df('0x2f')](respondWithStatusCode(_0x57a062,null))[_0xe8df('0x53')](handleError(_0x57a062,null));};exports[_0xe8df('0xa4')]=function(_0xcc3b2a,_0x1d0f8c,_0x534e96){return BPromise[_0xe8df('0xa5')]()[_0xe8df('0x2f')](function(){if(!_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0x7')]){throw new Error(_0xe8df('0xa6'));}if(!_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0xa7')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3542c8=_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0xa8')]?_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0xa8')]+':'+_0xcc3b2a['query'][_0xe8df('0xa7')]:_0xe8df('0xa9')+_0xcc3b2a[_0xe8df('0x3b')]['port'];var _0x4516cd=_0xcc3b2a['query'][_0xe8df('0x2b')]?_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0x2b')]:!![];var _0x54ad74=_0xcc3b2a['query']['encoding']?_0xcc3b2a['query'][_0xe8df('0xaa')]:null;var _0xb8c653={'method':_0xcc3b2a[_0xe8df('0xab')],'uri':util[_0xe8df('0x69')](_0xe8df('0xac'),_0x3542c8,_0xcc3b2a[_0xe8df('0x3b')][_0xe8df('0x7')]),'json':_0x4516cd,'resolveWithFullResponse':!![],'encoding':_0x54ad74,'qs':_0xcc3b2a[_0xe8df('0x3b')]};if(_0xcc3b2a[_0xe8df('0xad')]){_0xb8c653[_0xe8df('0xad')]=_0xcc3b2a[_0xe8df('0xad')];if(_0xb8c653['headers'][_0xe8df('0xae')]){delete _0xb8c653[_0xe8df('0xad')][_0xe8df('0xae')];}}if(_0xb8c653[_0xe8df('0xad')]['content-type']){delete _0xb8c653[_0xe8df('0xad')]['content-type'];}return rp(_0xb8c653);})[_0xe8df('0x2f')](function(_0x2d1afe){if(_0x2d1afe){_0x1d0f8c[_0xe8df('0xaf')](_0x2d1afe[_0xe8df('0xad')]);logger[_0xe8df('0x6b')](_0x2d1afe[_0xe8df('0x9b')]);if(_[_0xe8df('0xb0')](_0xcc3b2a['query'][_0xe8df('0x7')],'download')&&_0x2d1afe[_0xe8df('0xb1')]==0x1f4){return _0x1d0f8c[_0xe8df('0x23')](_0x2d1afe['statusCode']);}else{return _0x1d0f8c['status'](_0x2d1afe[_0xe8df('0xb1')])[_0xe8df('0x35')](_0x2d1afe[_0xe8df('0x9b')]);}}else{return _0x1d0f8c[_0xe8df('0x23')](0xc8);}})[_0xe8df('0x53')](handleError(_0x1d0f8c,null));};exports[_0xe8df('0xb2')]=function(_0xc74c74,_0x44a7d1,_0x2d3eb4){return BPromise['resolve']()['then'](function(){if(!_0xc74c74[_0xe8df('0x3b')][_0xe8df('0x7')]){throw new Error(_0xe8df('0xa6'));}if(!_0xc74c74[_0xe8df('0x3b')][_0xe8df('0xa7')]){throw new Error(_0xe8df('0xb3'));}var _0x1ba1f0=_0xc74c74[_0xe8df('0x3b')]['hostname']?_0xc74c74[_0xe8df('0x3b')][_0xe8df('0xa8')]+':'+_0xc74c74[_0xe8df('0x3b')][_0xe8df('0xa7')]:_0xe8df('0xa9')+_0xc74c74['query'][_0xe8df('0xa7')];var _0x2e269c=_0xc74c74[_0xe8df('0x3b')]['json']?_0xc74c74[_0xe8df('0x3b')][_0xe8df('0x2b')]:!![];var _0x16ef49=_0xc74c74['query'][_0xe8df('0xaa')]?_0xc74c74[_0xe8df('0x3b')][_0xe8df('0xaa')]:null;var _0xfbca8a={'method':_0xc74c74[_0xe8df('0xab')],'uri':util[_0xe8df('0x69')](_0xe8df('0xac'),_0x1ba1f0,_0xc74c74[_0xe8df('0x3b')][_0xe8df('0x7')]),'json':_0x2e269c,'resolveWithFullResponse':!![],'encoding':_0x16ef49,'body':_0xc74c74[_0xe8df('0x9b')]};if(_0xc74c74[_0xe8df('0xad')]){_0xfbca8a[_0xe8df('0xad')]=_0xc74c74[_0xe8df('0xad')];if(_0xfbca8a[_0xe8df('0xad')][_0xe8df('0xae')]){delete _0xfbca8a[_0xe8df('0xad')][_0xe8df('0xae')];}}if(_0xfbca8a[_0xe8df('0xad')][_0xe8df('0xb4')]){delete _0xfbca8a[_0xe8df('0xad')][_0xe8df('0xb4')];}return rp(_0xfbca8a);})['then'](function(_0x394a1a){if(_0x394a1a){_0x44a7d1[_0xe8df('0xaf')](_0x394a1a[_0xe8df('0xad')]);logger[_0xe8df('0x6b')](_0x394a1a[_0xe8df('0x9b')]);return _0x44a7d1[_0xe8df('0x25')](_0x394a1a[_0xe8df('0xb1')])[_0xe8df('0x35')](_0x394a1a[_0xe8df('0x9b')]);}else{return _0x44a7d1[_0xe8df('0x23')](0xc8);}})[_0xe8df('0x53')](handleError(_0x44a7d1,null));};
\ No newline at end of file
index a2fcb68..1f948f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1d3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x3c2675,_0x22b065){var _0x37abd5=function(_0x50f0c3){while(--_0x50f0c3){_0x3c2675['push'](_0x3c2675['shift']());}};_0x37abd5(++_0x22b065);}(_0xe1d3,0x159));var _0x3e1d=function(_0x18114f,_0xb27b19){_0x18114f=_0x18114f-0x0;var _0x2dd623=_0xe1d3[_0x18114f];return _0x2dd623;};'use strict';var EventEmitter=require(_0x3e1d('0x0'));var Plugin=require(_0x3e1d('0x1'))['db'][_0x3e1d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x3e1d('0x3')](0x0);var events={'afterCreate':_0x3e1d('0x4'),'afterUpdate':'update','afterDestroy':_0x3e1d('0x5')};function emitEvent(_0x4a0768){return function(_0x23f59b,_0x38df15,_0x4f6337){PluginEvents['emit'](_0x4a0768+':'+_0x23f59b['id'],_0x23f59b);PluginEvents[_0x3e1d('0x6')](_0x4a0768,_0x23f59b);_0x4f6337(null);};}for(var e in events){if(events[_0x3e1d('0x7')](e)){var event=events[e];Plugin[_0x3e1d('0x8')](e,emitEvent(event));}}module[_0x3e1d('0x9')]=PluginEvents;
\ No newline at end of file
+var _0x598a=['../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x334e03,_0x459b6f){var _0x38fcfa=function(_0x2cffe3){while(--_0x2cffe3){_0x334e03['push'](_0x334e03['shift']());}};_0x38fcfa(++_0x459b6f);}(_0x598a,0xfb));var _0xa598=function(_0x4f043e,_0x12e246){_0x4f043e=_0x4f043e-0x0;var _0x406fb2=_0x598a[_0x4f043e];return _0x406fb2;};'use strict';var EventEmitter=require(_0xa598('0x0'));var Plugin=require(_0xa598('0x1'))['db'][_0xa598('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xa598('0x3')](0x0);var events={'afterCreate':_0xa598('0x4'),'afterUpdate':'update','afterDestroy':_0xa598('0x5')};function emitEvent(_0x5e795e){return function(_0x4958fc,_0x4a1f8d,_0x1821a6){PluginEvents[_0xa598('0x6')](_0x5e795e+':'+_0x4958fc['id'],_0x4958fc);PluginEvents[_0xa598('0x6')](_0x5e795e,_0x4958fc);_0x1821a6(null);};}for(var e in events){if(events[_0xa598('0x7')](e)){var event=events[e];Plugin[_0xa598('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 9f0e2f3..7493108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x885f=['path','rimraf','../../config/environment','exports','define','Plugin','plugins','../../config/logger','api','bluebird','request-promise'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x885f,0x8b));var _0xf885=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0x885f[_0x1ebd10];return _0x1004d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf885('0x0'))(_0xf885('0x1'));var moment=require('moment');var BPromise=require(_0xf885('0x2'));var rp=require(_0xf885('0x3'));var fs=require('fs');var path=require(_0xf885('0x4'));var rimraf=require(_0xf885('0x5'));var config=require(_0xf885('0x6'));var attributes=require('./plugin.attributes');module[_0xf885('0x7')]=function(_0x42bfad,_0x2fd5e1){return _0x42bfad[_0xf885('0x8')](_0xf885('0x9'),attributes,{'tableName':_0xf885('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfaa=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','plugins','util'];(function(_0x43134c,_0x429046){var _0x402213=function(_0x2d6745){while(--_0x2d6745){_0x43134c['push'](_0x43134c['shift']());}};_0x402213(++_0x429046);}(_0xcfaa,0x104));var _0xacfa=function(_0x29ca5a,_0x17415d){_0x29ca5a=_0x29ca5a-0x0;var _0x311cbb=_0xcfaa[_0x29ca5a];return _0x311cbb;};'use strict';var _=require('lodash');var util=require(_0xacfa('0x0'));var logger=require(_0xacfa('0x1'))(_0xacfa('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacfa('0x3'));var fs=require('fs');var path=require(_0xacfa('0x4'));var rimraf=require(_0xacfa('0x5'));var config=require(_0xacfa('0x6'));var attributes=require('./plugin.attributes');module['exports']=function(_0x52e6b1,_0xbbfec3){return _0x52e6b1[_0xacfa('0x7')]('Plugin',attributes,{'tableName':_0xacfa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e17eb3d..c6e23f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ad3=['options','raw','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Plugin,\x20%s,\x20%s','result','CreatePlugin','create','body'];(function(_0x1c31f9,_0xa3879f){var _0x47ef68=function(_0x4d1e16){while(--_0x4d1e16){_0x1c31f9['push'](_0x1c31f9['shift']());}};_0x47ef68(++_0xa3879f);}(_0x2ad3,0x94));var _0x32ad=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2ad3[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x32ad('0x0'));var util=require(_0x32ad('0x1'));var moment=require(_0x32ad('0x2'));var BPromise=require(_0x32ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32ad('0x4'));var db=require(_0x32ad('0x5'))['db'];var utils=require(_0x32ad('0x6'));var logger=require(_0x32ad('0x7'))(_0x32ad('0x8'));var config=require(_0x32ad('0x9'));var jayson=require(_0x32ad('0xa'));var client=jayson[_0x32ad('0xb')][_0x32ad('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x32ad('0xd')],{'host':_0x32ad('0xe'),'port':0x18eb});var socket=require(_0x32ad('0xf'))(new Redis(config['redis']));require(_0x32ad('0x10'))[_0x32ad('0x11')](socket);function respondWithRpcPromise(_0x10f81f,_0x9e7396,_0xde3a8b){return new BPromise(function(_0x462a25,_0x4bb077){return client[_0x32ad('0x12')](_0x10f81f,_0xde3a8b)[_0x32ad('0x13')](function(_0x1dcc5a){logger[_0x32ad('0x14')]('Plugin,\x20%s,\x20%s',_0x9e7396,_0x32ad('0x15'));logger['debug'](_0x32ad('0x16'),_0x9e7396,_0x32ad('0x15'),JSON[_0x32ad('0x17')](_0x1dcc5a));if(_0x1dcc5a[_0x32ad('0x18')]){if(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x19')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x9e7396,_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);return _0x4bb077(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);}logger[_0x32ad('0x18')](_0x32ad('0x1b'),_0x9e7396,_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);return _0x462a25(_0x1dcc5a[_0x32ad('0x18')][_0x32ad('0x1a')]);}else{logger[_0x32ad('0x14')](_0x32ad('0x1b'),_0x9e7396,_0x32ad('0x15'));_0x462a25(_0x1dcc5a[_0x32ad('0x1c')][_0x32ad('0x1a')]);}})['catch'](function(_0x29bb){logger[_0x32ad('0x18')](_0x32ad('0x1b'),_0x9e7396,_0x29bb);_0x4bb077(_0x29bb);});});}exports[_0x32ad('0x1d')]=function(_0x5606bf){var _0x27a67d=this;return new Promise(function(_0x194e77,_0x5f1529){return db['Plugin'][_0x32ad('0x1e')](_0x5606bf[_0x32ad('0x1f')],{'raw':_0x5606bf[_0x32ad('0x20')]?_0x5606bf[_0x32ad('0x20')][_0x32ad('0x21')]===undefined?!![]:![]:!![]})[_0x32ad('0x13')](function(_0x4eef08){logger['info'](_0x32ad('0x1d'),_0x5606bf);logger[_0x32ad('0x22')](_0x32ad('0x1d'),_0x5606bf,JSON[_0x32ad('0x17')](_0x4eef08));_0x194e77(_0x4eef08);})[_0x32ad('0x23')](function(_0x23f2e9){logger['error'](_0x32ad('0x1d'),_0x23f2e9[_0x32ad('0x1a')],_0x5606bf);_0x5f1529(_0x27a67d['error'](0x1f4,_0x23f2e9[_0x32ad('0x1a')]));});});};
\ No newline at end of file
+var _0xc7e8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreatePlugin','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc7e8,0xc2));var _0x8c7e=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xc7e8[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require(_0x8c7e('0x0'));var util=require(_0x8c7e('0x1'));var moment=require(_0x8c7e('0x2'));var BPromise=require(_0x8c7e('0x3'));var rs=require(_0x8c7e('0x4'));var fs=require('fs');var Redis=require(_0x8c7e('0x5'));var db=require(_0x8c7e('0x6'))['db'];var utils=require(_0x8c7e('0x7'));var logger=require(_0x8c7e('0x8'))('rpc');var config=require(_0x8c7e('0x9'));var jayson=require(_0x8c7e('0xa'));var client=jayson[_0x8c7e('0xb')][_0x8c7e('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x8c7e('0xd'),'port':0x18eb});var socket=require(_0x8c7e('0xe'))(new Redis(config[_0x8c7e('0xf')]));require(_0x8c7e('0x10'))[_0x8c7e('0x11')](socket);function respondWithRpcPromise(_0x1f977f,_0x3d7618,_0x3744b5){return new BPromise(function(_0x40f401,_0x3adbe8){return client[_0x8c7e('0x12')](_0x1f977f,_0x3744b5)['then'](function(_0x580527){logger[_0x8c7e('0x13')](_0x8c7e('0x14'),_0x3d7618,_0x8c7e('0x15'));logger[_0x8c7e('0x16')](_0x8c7e('0x17'),_0x3d7618,_0x8c7e('0x15'),JSON[_0x8c7e('0x18')](_0x580527));if(_0x580527[_0x8c7e('0x19')]){if(_0x580527[_0x8c7e('0x19')]['code']===0x1f4){logger[_0x8c7e('0x19')](_0x8c7e('0x14'),_0x3d7618,_0x580527[_0x8c7e('0x19')][_0x8c7e('0x1a')]);return _0x3adbe8(_0x580527[_0x8c7e('0x19')][_0x8c7e('0x1a')]);}logger[_0x8c7e('0x19')](_0x8c7e('0x14'),_0x3d7618,_0x580527['error'][_0x8c7e('0x1a')]);return _0x40f401(_0x580527['error']['message']);}else{logger['info'](_0x8c7e('0x14'),_0x3d7618,_0x8c7e('0x15'));_0x40f401(_0x580527['result'][_0x8c7e('0x1a')]);}})[_0x8c7e('0x1b')](function(_0x2394da){logger[_0x8c7e('0x19')](_0x8c7e('0x14'),_0x3d7618,_0x2394da);_0x3adbe8(_0x2394da);});});}exports[_0x8c7e('0x1c')]=function(_0x29b55b){var _0xed3e8a=this;return new Promise(function(_0x46c949,_0x744017){return db['Plugin']['create'](_0x29b55b[_0x8c7e('0x1d')],{'raw':_0x29b55b[_0x8c7e('0x1e')]?_0x29b55b[_0x8c7e('0x1e')][_0x8c7e('0x1f')]===undefined?!![]:![]:!![]})[_0x8c7e('0x20')](function(_0x3f9473){logger[_0x8c7e('0x13')](_0x8c7e('0x1c'),_0x29b55b);logger[_0x8c7e('0x16')]('CreatePlugin',_0x29b55b,JSON['stringify'](_0x3f9473));_0x46c949(_0x3f9473);})[_0x8c7e('0x1b')](function(_0x2e0197){logger[_0x8c7e('0x19')]('CreatePlugin',_0x2e0197[_0x8c7e('0x1a')],_0x29b55b);_0x744017(_0xed3e8a[_0x8c7e('0x19')](0x1f4,_0x2e0197[_0x8c7e('0x1a')]));});});};
\ No newline at end of file
index 00542a7..ba28839 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6569=['remove','update','emit','removeListener','register','length','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6569,0x1d6));var _0x9656=function(_0x20b7f4,_0x294e69){_0x20b7f4=_0x20b7f4-0x0;var _0x1f204e=_0x6569[_0x20b7f4];return _0x1f204e;};'use strict';var PluginEvents=require(_0x9656('0x0'));var events=[_0x9656('0x1'),_0x9656('0x2'),_0x9656('0x3')];function createListener(_0x5b1c99,_0x23d8f7){return function(_0x3cddee){_0x23d8f7[_0x9656('0x4')](_0x5b1c99,_0x3cddee);};}function removeListener(_0xccfe03,_0x4aa40f){return function(){PluginEvents[_0x9656('0x5')](_0xccfe03,_0x4aa40f);};}exports[_0x9656('0x6')]=function(_0xb2c897){for(var _0x49cdec=0x0,_0xb15712=events[_0x9656('0x7')];_0x49cdec<_0xb15712;_0x49cdec++){var _0x18a6e9=events[_0x49cdec];var _0x5cc38f=createListener('plugin:'+_0x18a6e9,_0xb2c897);PluginEvents['on'](_0x18a6e9,_0x5cc38f);}};
\ No newline at end of file
+var _0xeff1=['update','emit','removeListener','register','length','plugin:','./plugin.events'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xeff1,0x99));var _0x1eff=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0xeff1[_0x2bb3f6];return _0x62b339;};'use strict';var PluginEvents=require(_0x1eff('0x0'));var events=['save','remove',_0x1eff('0x1')];function createListener(_0x55e069,_0x558a0e){return function(_0x26b625){_0x558a0e[_0x1eff('0x2')](_0x55e069,_0x26b625);};}function removeListener(_0x3fab21,_0x3459e3){return function(){PluginEvents[_0x1eff('0x3')](_0x3fab21,_0x3459e3);};}exports[_0x1eff('0x4')]=function(_0x88ec7e){for(var _0x3ff367=0x0,_0x55d070=events[_0x1eff('0x5')];_0x3ff367<_0x55d070;_0x3ff367++){var _0x151ab7=events[_0x3ff367];var _0x52c2f0=createListener(_0x1eff('0x6')+_0x151ab7,_0x88ec7e);PluginEvents['on'](_0x151ab7,_0x52c2f0);}};
\ No newline at end of file
index d438a11..ba17438 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(_0x16b1ef,_0x4239b8){var _0x43fc47=function(_0x5907b7){while(--_0x5907b7){_0x16b1ef['push'](_0x16b1ef['shift']());}};_0x43fc47(++_0x4239b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0xd5e4d4,_0x50c61a){var _0x35181=function(_0x5799f0){while(--_0x5799f0){_0xd5e4d4['push'](_0xd5e4d4['shift']());}};_0x35181(++_0x50c61a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 8cd3b41..13b7619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x222f=['dump','send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','stack','name','status','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','describe','params','body','join','../../files/plugins','script','chdir','dirname','start'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x222f,0x1a4));var _0xf222=function(_0x5de390,_0x3b9908){_0x5de390=_0x5de390-0x0;var _0x12bf75=_0x222f[_0x5de390];return _0x12bf75;};'use strict';var _=require(_0xf222('0x0'));var pm2=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));var path=require('path');var exec=require('child_process')[_0xf222('0x4')];var BPromise=require(_0xf222('0x5'));function handleEntityNotFound(_0x307791,_0x7b187d){return function(_0x59a619){if(!_0x59a619){_0x307791[_0xf222('0x6')](0x194);;}return _0x59a619;};}function respondWithResult(_0x54a758,_0x112e6d){_0x112e6d=_0x112e6d||0xc8;return function(_0x26f129){if(_0x26f129){return _0x54a758['status'](_0x112e6d)[_0xf222('0x7')](_0x26f129);}return null;};}function handleError(_0x302d7a,_0x4aceb4){_0x4aceb4=_0x4aceb4||0x1f4;return function(_0x31c027){logger[_0xf222('0x8')](_0x31c027[_0xf222('0x9')]);if(_0x31c027[_0xf222('0xa')]){delete _0x31c027[_0xf222('0xa')];}_0x302d7a[_0xf222('0xb')](_0x4aceb4)['send'](_0x31c027);};}function execChildProcess(){return new BPromise(function(_0x2e29ad,_0x405080){exec(_0xf222('0xc'),function(_0x182bc3,_0x48f740,_0x3c9b96){logger[_0xf222('0xd')](_0x48f740);logger[_0xf222('0xd')](_0x3c9b96);if(_0x182bc3){logger[_0xf222('0x8')](_0x182bc3);return _0x405080(_0x182bc3);}return _0x2e29ad(_0x48f740);});});}exports[_0xf222('0xe')]=function(_0x334017,_0x11fca0){return pm2[_0xf222('0xf')]()['then'](function(_0x5b8f97){if(_0x5b8f97){var _0x1feb86=_[_0xf222('0x10')](_0x5b8f97,function(_0x4c2314){return _0x4c2314[_0xf222('0xa')]===_0xf222('0x11')||_0x4c2314[_0xf222('0xa')]===_0xf222('0x12');});return{'rows':_0x1feb86,'count':_0x1feb86[_0xf222('0x13')]};}return null;})[_0xf222('0x14')](respondWithResult(_0x11fca0,null))[_0xf222('0x15')](handleError(_0x11fca0,null));};exports['show']=function(_0x1efa9f,_0x823314){return pm2[_0xf222('0x16')](_0x1efa9f[_0xf222('0x17')]['id'])[_0xf222('0x14')](respondWithResult(_0x823314,null))[_0xf222('0x14')](handleEntityNotFound(_0x823314,null))[_0xf222('0x15')](handleError(_0x823314,null));};exports['create']=function(_0xf26a16,_0x1bdd0a){if(_0xf26a16[_0xf222('0x18')][_0xf222('0xa')]&&_0xf26a16['body']['script']){var _0x398ff4=path[_0xf222('0x19')](__dirname,_0xf222('0x1a'),_0xf26a16[_0xf222('0x18')][_0xf222('0x1b')]);var _0x151a89=process['cwd']();process[_0xf222('0x1c')](path[_0xf222('0x1d')](_0x398ff4));return execChildProcess()[_0xf222('0x14')](function(_0x12d443){process[_0xf222('0x1c')](_0x151a89);return pm2[_0xf222('0x1e')]({'name':_0xf26a16[_0xf222('0x18')][_0xf222('0xa')],'script':_0x398ff4});})['then'](function(_0x145e2e){pm2[_0xf222('0x1f')]();return _0x145e2e[0x0];})[_0xf222('0x14')](respondWithResult(_0x1bdd0a,0xc9))[_0xf222('0x15')](handleError(_0x1bdd0a,null));}else{return _0x1bdd0a[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x21')});}};exports[_0xf222('0x22')]=function(_0x15bf4e,_0x2ec2e9){if(_0x15bf4e[_0xf222('0x18')]['id']){delete _0x15bf4e['body']['id'];}var _0x14b2b1={'online':_0xf222('0x23'),'stopped':_0xf222('0x24')};if(_0x14b2b1[_0xf222('0x25')](_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')])){return pm2[_0x14b2b1[_0x15bf4e[_0xf222('0x18')][_0xf222('0xb')]]](_0x15bf4e[_0xf222('0x17')]['id'])['then'](respondWithResult(_0x2ec2e9,0xc8))[_0xf222('0x15')](handleError(_0x2ec2e9,null));}else{return _0x2ec2e9[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':'Unknown\x20status'});}};exports[_0xf222('0x26')]=function(_0x5d5963,_0x40c7e7){if(_0x5d5963[_0xf222('0x18')]['id']){delete _0x5d5963[_0xf222('0x18')]['id'];}if(_0x5d5963[_0xf222('0x17')]['id']){return pm2[_0xf222('0x27')](_0x5d5963[_0xf222('0x17')]['id'])[_0xf222('0x14')](function(_0x5075ad){pm2['dump']();return _0x5075ad[0x0];})[_0xf222('0x14')](respondWithResult(_0x40c7e7,null))[_0xf222('0x15')](handleError(_0x40c7e7,null));}else{return _0x40c7e7[_0xf222('0xb')](0x1f4)[_0xf222('0x20')]({'message':_0xf222('0x28')});}};
\ No newline at end of file
+var _0xee5b=['exec','bluebird','sendStatus','error','stack','name','send','npm\x20install','info','index','list','then','reject','motion2','length','catch','show','describe','params','create','body','script','join','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/logger','api','child_process'];(function(_0x2fe27a,_0x286478){var _0x248e34=function(_0x344fc4){while(--_0x344fc4){_0x2fe27a['push'](_0x2fe27a['shift']());}};_0x248e34(++_0x286478);}(_0xee5b,0x1f4));var _0xbee5=function(_0x20847f,_0x46d1ce){_0x20847f=_0x20847f-0x0;var _0x48e413=_0xee5b[_0x20847f];return _0x48e413;};'use strict';var _=require(_0xbee5('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var path=require('path');var exec=require(_0xbee5('0x3'))[_0xbee5('0x4')];var BPromise=require(_0xbee5('0x5'));function handleEntityNotFound(_0x210159,_0x4bd202){return function(_0x5200b1){if(!_0x5200b1){_0x210159[_0xbee5('0x6')](0x194);;}return _0x5200b1;};}function respondWithResult(_0x2c0bde,_0xab6e4d){_0xab6e4d=_0xab6e4d||0xc8;return function(_0x804ab8){if(_0x804ab8){return _0x2c0bde['status'](_0xab6e4d)['json'](_0x804ab8);}return null;};}function handleError(_0x53d5b9,_0x5baf5c){_0x5baf5c=_0x5baf5c||0x1f4;return function(_0x5536bd){logger[_0xbee5('0x7')](_0x5536bd[_0xbee5('0x8')]);if(_0x5536bd[_0xbee5('0x9')]){delete _0x5536bd[_0xbee5('0x9')];}_0x53d5b9['status'](_0x5baf5c)[_0xbee5('0xa')](_0x5536bd);};}function execChildProcess(){return new BPromise(function(_0x305921,_0x9b3d3b){exec(_0xbee5('0xb'),function(_0x16377d,_0x1509c7,_0x105e16){logger[_0xbee5('0xc')](_0x1509c7);logger[_0xbee5('0xc')](_0x105e16);if(_0x16377d){logger['error'](_0x16377d);return _0x9b3d3b(_0x16377d);}return _0x305921(_0x1509c7);});});}exports[_0xbee5('0xd')]=function(_0x532a78,_0x183877){return pm2[_0xbee5('0xe')]()[_0xbee5('0xf')](function(_0x593ecb){if(_0x593ecb){var _0x5092f2=_[_0xbee5('0x10')](_0x593ecb,function(_0x4cf5a8){return _0x4cf5a8[_0xbee5('0x9')]==='express'||_0x4cf5a8[_0xbee5('0x9')]===_0xbee5('0x11');});return{'rows':_0x5092f2,'count':_0x5092f2[_0xbee5('0x12')]};}return null;})['then'](respondWithResult(_0x183877,null))[_0xbee5('0x13')](handleError(_0x183877,null));};exports[_0xbee5('0x14')]=function(_0x5a0ae5,_0x254dd3){return pm2[_0xbee5('0x15')](_0x5a0ae5[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x254dd3,null))[_0xbee5('0xf')](handleEntityNotFound(_0x254dd3,null))[_0xbee5('0x13')](handleError(_0x254dd3,null));};exports[_0xbee5('0x17')]=function(_0xa50ec9,_0x20cf52){if(_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')]&&_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x19')]){var _0x40a06=path[_0xbee5('0x1a')](__dirname,'../../files/plugins',_0xa50ec9['body'][_0xbee5('0x19')]);var _0x48bfb5=process[_0xbee5('0x1b')]();process[_0xbee5('0x1c')](path[_0xbee5('0x1d')](_0x40a06));return execChildProcess()[_0xbee5('0xf')](function(_0x3f23c5){process[_0xbee5('0x1c')](_0x48bfb5);return pm2[_0xbee5('0x1e')]({'name':_0xa50ec9[_0xbee5('0x18')][_0xbee5('0x9')],'script':_0x40a06});})['then'](function(_0x5b43b3){pm2['dump']();return _0x5b43b3[0x0];})['then'](respondWithResult(_0x20cf52,0xc9))['catch'](handleError(_0x20cf52,null));}else{return _0x20cf52[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x20')});}};exports[_0xbee5('0x21')]=function(_0x169042,_0x20e7e8){if(_0x169042[_0xbee5('0x18')]['id']){delete _0x169042['body']['id'];}var _0x36b50f={'online':_0xbee5('0x22'),'stopped':_0xbee5('0x23')};if(_0x36b50f[_0xbee5('0x24')](_0x169042[_0xbee5('0x18')]['status'])){return pm2[_0x36b50f[_0x169042[_0xbee5('0x18')][_0xbee5('0x1f')]]](_0x169042[_0xbee5('0x16')]['id'])[_0xbee5('0xf')](respondWithResult(_0x20e7e8,0xc8))[_0xbee5('0x13')](handleError(_0x20e7e8,null));}else{return _0x20e7e8[_0xbee5('0x1f')](0x1f4)[_0xbee5('0xa')]({'message':_0xbee5('0x25')});}};exports[_0xbee5('0x26')]=function(_0x59c2e4,_0x22df5f){if(_0x59c2e4['body']['id']){delete _0x59c2e4[_0xbee5('0x18')]['id'];}if(_0x59c2e4['params']['id']){return pm2[_0xbee5('0x27')](_0x59c2e4['params']['id'])[_0xbee5('0xf')](function(_0x5c1109){pm2[_0xbee5('0x28')]();return _0x5c1109[0x0];})[_0xbee5('0xf')](respondWithResult(_0x22df5f,null))[_0xbee5('0x13')](handleError(_0x22df5f,null));}else{return _0x22df5f[_0xbee5('0x1f')](0x1f4)['send']({'message':_0xbee5('0x29')});}};
\ No newline at end of file
index 9128d24..615fa4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x090a=['get','getQueues','express','Router','./realtime.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x090a,0x133));var _0xa090=function(_0x34ce72,_0x19ce31){_0x34ce72=_0x34ce72-0x0;var _0x4a3fe8=_0x090a[_0x34ce72];return _0x4a3fe8;};'use strict';var express=require(_0xa090('0x0'));var router=express[_0xa090('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa090('0x2'));router[_0xa090('0x3')]('/queues',auth['isAuthenticated'](),controller[_0xa090('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x9df6=['get','/queues','isAuthenticated','getQueues','Router','../../components/auth/service'];(function(_0x189f53,_0x39069a){var _0x595e5b=function(_0x46de38){while(--_0x46de38){_0x189f53['push'](_0x189f53['shift']());}};_0x595e5b(++_0x39069a);}(_0x9df6,0xe2));var _0x69df=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x9df6[_0x43d11d];return _0x38cd08;};'use strict';var express=require('express');var router=express[_0x69df('0x0')]();var auth=require(_0x69df('0x1'));var controller=require('./realtime.controller');router[_0x69df('0x2')](_0x69df('0x3'),auth[_0x69df('0x4')](),controller[_0x69df('0x5')]);module['exports']=router;
\ No newline at end of file
index 3f4702c..537770b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79f=['loggedInDb','talking','busy','outbound','merge','pick','filter','queue','length','some','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','QueueId','chat','sms','openchannel','fax','whatsapp','resolve','query','channel','includes','toLowerCase','Invalid\x20channel','fieldName','key','getOptions','user','role','userProfileId','QueueCampaigns','type','UserProfile','findAndCountAll','count','rows','catch','util','jayson/promise','../../components/parsers/qs','api','../../mysqldb','http','client','undefined','limit','offset','set','Content-Range','json','error','stack','name','send','request','then','result','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','paused','voice','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents'];(function(_0x46050b,_0x4fb433){var _0x51e7d4=function(_0x7db0da){while(--_0x7db0da){_0x46050b['push'](_0x46050b['shift']());}};_0x51e7d4(++_0x4fb433);}(_0xe79f,0xf0));var _0xfe79=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe79f[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xfe79('0x0'));var _=require('lodash');var jayson=require(_0xfe79('0x1'));var qs=require(_0xfe79('0x2'));var logger=require('../../config/logger')(_0xfe79('0x3'));var db=require(_0xfe79('0x4'))['db'];var amiClient=jayson['client'][_0xfe79('0x5')]({'port':0x232a});var routingClient=jayson[_0xfe79('0x6')][_0xfe79('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x788b61,_0x591fa0){return function(_0x1f3553){if(_0x1f3553){var _0x38e009=typeof _0x591fa0['offset']===_0xfe79('0x7')&&typeof _0x591fa0[_0xfe79('0x8')]===_0xfe79('0x7');var _0x5e70bf=_0x1f3553['count'];var _0x49ad37=_0x38e009?0x0:_0x591fa0[_0xfe79('0x9')];var _0x55179d=_0x38e009?_0x1f3553['count']:_0x591fa0[_0xfe79('0x9')]+_0x591fa0[_0xfe79('0x8')];var _0x561c0e;if(_0x55179d>=_0x5e70bf){_0x55179d=_0x5e70bf;_0x561c0e=0xc8;}else{_0x561c0e=0xce;}_0x788b61['status'](_0x561c0e);return _0x788b61[_0xfe79('0xa')](_0xfe79('0xb'),_0x49ad37+'-'+_0x55179d+'/'+_0x5e70bf)[_0xfe79('0xc')](_0x1f3553);}return null;};}function handleError(_0x217bcc,_0x40b872){_0x40b872=_0x40b872||0x1f4;return function(_0x2f39d8){logger[_0xfe79('0xd')](_0x2f39d8[_0xfe79('0xe')]);if(_0x2f39d8[_0xfe79('0xf')]){delete _0x2f39d8[_0xfe79('0xf')];}_0x217bcc['status'](_0x40b872)[_0xfe79('0x10')](_0x2f39d8);};}function getRealtimeAgents(){return new Promise(function(_0x5e84ab,_0x82850b){return amiClient[_0xfe79('0x11')]('Agents',{})[_0xfe79('0x12')](function(_0x44f816){if(_0x44f816[_0xfe79('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x3dc4b1=_0x44f816[_0xfe79('0x13')];return routingClient['request']('Agents',{})[_0xfe79('0x12')](function(_0x4efe69){if(_0x4efe69[_0xfe79('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x1524fe=_0x4efe69[_0xfe79('0x13')];return _0x5e84ab(_['merge']({},_0x3dc4b1,_0x1524fe));});})['catch'](function(_0x291ab2){_0x82850b(_0x291ab2);});});}function getRealtimeQueues(_0x4da236,_0x2b9201){return new Promise(function(_0xa09cdb,_0x41b243){var _0x5d26c9=_0x2b9201==='voice'?amiClient:routingClient;return _0x5d26c9[_0xfe79('0x11')](_[_0xfe79('0x14')](_0x2b9201)+_0xfe79('0x15'),_0x4da236)['then'](function(_0xbe3a6e){if(_0xbe3a6e[_0xfe79('0xd')])throw new Error(util['format'](_0xfe79('0x16'),_0x2b9201));return _0xa09cdb(_0xbe3a6e[_0xfe79('0x13')]);})['catch'](function(_0x49e2b2){_0x41b243(_0x49e2b2);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x3969af,_0x27b22b){return amiClient[_0xfe79('0x11')](_0xfe79('0x17'),{})[_0xfe79('0x12')](function(_0x18d2fe){if(_0x18d2fe[_0xfe79('0xd')])throw new Error(_0xfe79('0x18'));return _0x3969af(_0x18d2fe[_0xfe79('0x13')]);})['catch'](function(_0x4e87a9){_0x27b22b(_0x4e87a9);});});}function initializeQueues(_0x5e5180,_0x124b63,_0x5183c5,_0x32e319){var _0x5b0e0a=[_0xfe79('0x19'),_0xfe79('0x1a'),'waiting','talking',_0xfe79('0x1b')];if(_0x5183c5===_0xfe79('0x1c')&&_0x32e319==='outbound'){_0x5b0e0a[_0xfe79('0x1d')](_0xfe79('0x1e'),_0xfe79('0x1f'),_0xfe79('0x20'),_0xfe79('0x21'),_0xfe79('0x22'),_0xfe79('0x23'),'startPredictive',_0xfe79('0x24'),_0xfe79('0x25'),_0xfe79('0x26'),'erlangAbandonmentRate',_0xfe79('0x27'),'dialPredictiveInterval',_0xfe79('0x28'),_0xfe79('0x29'),_0xfe79('0x2a'),'predictiveIntervalTotalCalls',_0xfe79('0x2b'),_0xfe79('0x2c'),_0xfe79('0x2d'),_0xfe79('0x2e'),_0xfe79('0x2f'));}return _0x5e5180[_0xfe79('0x30')](function(_0x53f217){var _0x35fc78=_0x53f217[_0xfe79('0x31')]({'plain':!![]});_0x35fc78[_0xfe79('0x32')]=[];_0x35fc78[_0xfe79('0x1b')]=0x0;_0x35fc78[_0xfe79('0x33')]=0x0;_0x35fc78[_0xfe79('0x19')]=0x0;_0x35fc78[_0xfe79('0x1a')]=0x0;_0x35fc78['waiting']=0x0;if(_0x5183c5===_0xfe79('0x1c')){_0x35fc78[_0xfe79('0x34')]=0x0;_0x35fc78[_0xfe79('0x35')]=0x0;if(_0x32e319===_0xfe79('0x36')){_0x35fc78[_0xfe79('0x1e')]=0x0;_0x35fc78[_0xfe79('0x1f')]=0x0;}}var _0x2e793e=_['find'](_0x124b63,['id',_0x35fc78['id']]);if(_0x2e793e)_[_0xfe79('0x37')](_0x35fc78,_[_0xfe79('0x38')](_0x2e793e,_0x5b0e0a));return _0x35fc78;});}function updateAgentVoiceStatus(_0x293184,_0xd98b6c,_0x51dc0e){var _0x43cdc2=_[_0xfe79('0x39')](_0x51dc0e,[_0xfe79('0x3a'),_0xd98b6c['name']]);if(_0x43cdc2[_0xfe79('0x3b')]===0x0)return _0x293184[_0xfe79('0x35')]=!![];if(_[_0xfe79('0x3c')](_0x43cdc2,['connectedlinenum',_0x293184['internal'][_0xfe79('0x3d')]()]))return _0x293184[_0xfe79('0x34')]=!![];if(!_0x293184[_0xfe79('0x34')])return _0x293184[_0xfe79('0x35')]=!![];}function getVoiceQueueAgents(_0x16f9c1,_0x435868,_0xc8d591,_0x36301f){var _0xb4daad=_[_0xfe79('0x3e')](_0x435868,['id',_0x16f9c1['id']]);if(!_0xb4daad)return _0x16f9c1;return _0xb4daad[_0xfe79('0x3f')]({'raw':!![]})[_0xfe79('0x12')](function(_0x139f77){for(var _0x32e98c=0x0;_0x32e98c<_0x139f77[_0xfe79('0x3b')];_0x32e98c++){var _0x5ccd77=_[_0xfe79('0x3e')](_0xc8d591,['id',_0x139f77[_0x32e98c][_0xfe79('0x40')]]);if(!_0x5ccd77){_0x5ccd77={'id':_0x139f77[_0x32e98c][_0xfe79('0x40')],'name':_0x139f77[_0x32e98c][_0xfe79('0x40')],'accountcode':'','online':![]};}var _0x509658={'id':_0x5ccd77['id'],'name':_0x5ccd77[_0xfe79('0xf')],'internal':_0x5ccd77[_0xfe79('0x41')],'online':Boolean(_0x5ccd77[_0xfe79('0x42')]),'paused':Boolean(_0x139f77[_0x32e98c][_0xfe79('0x1b')])};if(_0x5ccd77[_0xfe79('0x43')]===_0xfe79('0x34'))updateAgentVoiceStatus(_0x509658,_0x16f9c1,_0x36301f);if(_0x509658['online'])_0x16f9c1[_0xfe79('0x33')]++;if(_0x509658[_0xfe79('0x35')])_0x16f9c1[_0xfe79('0x35')]++;if(_0x509658['paused']&&!_0x509658['busy']&&!_0x509658['talking'])_0x16f9c1['paused']++;_0x16f9c1[_0xfe79('0x32')][_0xfe79('0x1d')](_0x509658);}return _0x16f9c1;});}function getQueueAgents(_0x5458b1,_0x269d5f,_0x1b36ad){var _0x5a80cc=_0xfe79('0x44')+_[_0xfe79('0x14')](_0x1b36ad)+_0xfe79('0x45');var _0x2a8d7f=_0x1b36ad+_0xfe79('0x46');return db[_0x5a80cc][_0xfe79('0x47')]({'where':{[_[_0xfe79('0x14')](_0x1b36ad)+_0xfe79('0x48')]:_0x5458b1['id']},'raw':!![]})[_0xfe79('0x12')](function(_0x17d0bb){for(var _0x28e388=0x0;_0x28e388<_0x17d0bb[_0xfe79('0x3b')];_0x28e388++){var _0x583ac1=_[_0xfe79('0x3e')](_0x269d5f,['id',_0x17d0bb[_0x28e388][_0xfe79('0x40')]]);if(!_0x583ac1){_0x583ac1={'id':_0x17d0bb[_0x28e388][_0xfe79('0x40')],'name':_0x17d0bb[_0x28e388][_0xfe79('0x40')],'online':![],['pauseField']:![]};}var _0x4d5232={'id':_0x583ac1['id'],'name':_0x583ac1['name'],'online':Boolean(_0x583ac1['online']),'paused':Boolean(_0x583ac1[_0x2a8d7f])};if(_0x4d5232[_0xfe79('0x42')])_0x5458b1['loggedInDb']++;_0x5458b1[_0xfe79('0x32')][_0xfe79('0x1d')](_0x4d5232);}return _0x5458b1;});}exports['getQueues']=function(_0x1ba220,_0x1dbebb){var _0xad71be=['mail',_0xfe79('0x49'),_0xfe79('0x4a'),_0xfe79('0x4b'),_0xfe79('0x4c'),_0xfe79('0x4d'),'voice'];var _0x5e645b={'count':0x0,'rows':[]},_0x300765={},_0x16e86a,_0x38482a,_0xba8aa3,_0xe81a38,_0x57a57f;Promise[_0xfe79('0x4e')]()[_0xfe79('0x12')](function(){if(_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')]){if(!_[_0xfe79('0x51')](_0xad71be,_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')][_0xfe79('0x52')]()))throw new Error(_0xfe79('0x53'));_0x16e86a=_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x50')]['toLowerCase']();}var _0x6d6e93=_[_0xfe79('0x14')](_0x16e86a)+_0xfe79('0x45');var _0x373663=_[_0xfe79('0x30')](db[_0x6d6e93]['rawAttributes'],function(_0x5cf9b9){return{'name':_0x5cf9b9[_0xfe79('0x54')],'type':_0x5cf9b9['type'][_0xfe79('0x55')]};});_0x300765=qs[_0xfe79('0x56')](_0x373663,_0x1ba220);if(_0x1ba220[_0xfe79('0x57')][_0xfe79('0x58')]===_0xfe79('0x57')){var _0x7155f7={'params':{'id':_0x1ba220[_0xfe79('0x57')][_0xfe79('0x59')]},'query':{'section':_0x16e86a===_0xfe79('0x1c')&&_0x1ba220['query']['type']===_0xfe79('0x36')?_0xfe79('0x5a'):_[_0xfe79('0x14')](_0x16e86a)+_0xfe79('0x15'),'type':_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x5b')],'nolimit':!![],'sort':_0xfe79('0xf'),'filter':_0x1ba220[_0xfe79('0x4f')][_0xfe79('0x39')]}};return db[_0xfe79('0x5c')]['getResources'](_0x7155f7);}return db[_0x6d6e93][_0xfe79('0x5d')](_0x300765);})[_0xfe79('0x12')](function(_0x257c41){_0x5e645b[_0xfe79('0x5e')]=_0x257c41[_0xfe79('0x5e')];_0x38482a=_0x257c41[_0xfe79('0x5f')];return getRealtimeQueues(_0x1ba220,_0x16e86a);})['then'](function(_0x5768d4){_0xe81a38=_0x5768d4[_0xfe79('0x5f')];return getRealtimeAgents();})[_0xfe79('0x12')](function(_0x24e5e9){_0xba8aa3=_0x24e5e9['rows'];if(_0x16e86a!=_0xfe79('0x1c'))return;return getRealtimeVoiceQueueChannels();})[_0xfe79('0x12')](function(_0x51ad83){_0x57a57f=_0x51ad83?_0x51ad83['rows']:[];return initializeQueues(_0x38482a,_0xe81a38,_0x16e86a,_0x1ba220[_0xfe79('0x4f')]['type']);})[_0xfe79('0x12')](function(_0x836ef2){var _0x5edfd7=_0x836ef2[_0xfe79('0x30')](function(_0xcaff58){if(_0x16e86a===_0xfe79('0x1c'))return getVoiceQueueAgents(_0xcaff58,_0x38482a,_0xba8aa3,_0x57a57f);else return getQueueAgents(_0xcaff58,_0xba8aa3,_0x16e86a);});return Promise['all'](_0x5edfd7);})[_0xfe79('0x12')](function(_0x17e526){_0x5e645b['rows']=_0x17e526;return _0x5e645b;})['then'](respondWithFilteredResult(_0x1dbebb,_0x300765))[_0xfe79('0x60')](handleError(_0x1dbebb,null));};
\ No newline at end of file
+var _0x0a0b=['result','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','request','startCase','Queues','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','loggedIn','talking','paused','push','pTalking','originated','message','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','agents','loggedInDb','waiting','outbound','find','pick','filter','queue','busy','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','voiceStatus','Queue','Pause','online','getQueues','chat','sms','openchannel','fax','query','channel','Invalid\x20channel','rawAttributes','fieldName','type','key','user','userProfileId','QueueCampaigns','UserProfile','findAndCountAll','rows','util','lodash','jayson/promise','../../components/parsers/qs','api','http','client','undefined','offset','count','limit','status','set','Content-Range','error','stack','name','send','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x0a0b,0x158));var _0xb0a0=function(_0x43f2c8,_0x4aec6d){_0x43f2c8=_0x43f2c8-0x0;var _0x5e0de5=_0x0a0b[_0x43f2c8];return _0x5e0de5;};'use strict';var util=require(_0xb0a0('0x0'));var _=require(_0xb0a0('0x1'));var jayson=require(_0xb0a0('0x2'));var qs=require(_0xb0a0('0x3'));var logger=require('../../config/logger')(_0xb0a0('0x4'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0xb0a0('0x5')]({'port':0x232a});var routingClient=jayson[_0xb0a0('0x6')]['http']({'port':0x232c});function respondWithFilteredResult(_0x4d94c3,_0xed246a){return function(_0x223a8b){if(_0x223a8b){var _0x142d8e=typeof _0xed246a['offset']===_0xb0a0('0x7')&&typeof _0xed246a['limit']===_0xb0a0('0x7');var _0x463722=_0x223a8b['count'];var _0x439f85=_0x142d8e?0x0:_0xed246a[_0xb0a0('0x8')];var _0x43352=_0x142d8e?_0x223a8b[_0xb0a0('0x9')]:_0xed246a[_0xb0a0('0x8')]+_0xed246a[_0xb0a0('0xa')];var _0x2be0ac;if(_0x43352>=_0x463722){_0x43352=_0x463722;_0x2be0ac=0xc8;}else{_0x2be0ac=0xce;}_0x4d94c3[_0xb0a0('0xb')](_0x2be0ac);return _0x4d94c3[_0xb0a0('0xc')](_0xb0a0('0xd'),_0x439f85+'-'+_0x43352+'/'+_0x463722)['json'](_0x223a8b);}return null;};}function handleError(_0x67a22a,_0x10b893){_0x10b893=_0x10b893||0x1f4;return function(_0x572013){logger[_0xb0a0('0xe')](_0x572013[_0xb0a0('0xf')]);if(_0x572013['name']){delete _0x572013[_0xb0a0('0x10')];}_0x67a22a[_0xb0a0('0xb')](_0x10b893)[_0xb0a0('0x11')](_0x572013);};}function getRealtimeAgents(){return new Promise(function(_0x39398a,_0x4e8d0c){return amiClient['request'](_0xb0a0('0x12'),{})['then'](function(_0x3bcb84){if(_0x3bcb84['error'])throw new Error(_0xb0a0('0x13'));var _0xc7bbb6=_0x3bcb84[_0xb0a0('0x14')];return routingClient['request'](_0xb0a0('0x12'),{})[_0xb0a0('0x15')](function(_0xecef83){if(_0xecef83[_0xb0a0('0xe')])throw new Error(_0xb0a0('0x16'));var _0x30bec7=_0xecef83[_0xb0a0('0x14')];return _0x39398a(_[_0xb0a0('0x17')]({},_0xc7bbb6,_0x30bec7));});})['catch'](function(_0x287d7b){_0x4e8d0c(_0x287d7b);});});}function getRealtimeQueues(_0x439c7c,_0x296dcc){return new Promise(function(_0x230889,_0x47339b){var _0x4e9c7b=_0x296dcc===_0xb0a0('0x18')?amiClient:routingClient;return _0x4e9c7b[_0xb0a0('0x19')](_[_0xb0a0('0x1a')](_0x296dcc)+_0xb0a0('0x1b'),_0x439c7c)[_0xb0a0('0x15')](function(_0xca1fe7){if(_0xca1fe7['error'])throw new Error(util['format'](_0xb0a0('0x1c'),_0x296dcc));return _0x230889(_0xca1fe7['result']);})['catch'](function(_0x1124f4){_0x47339b(_0x1124f4);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x15652d,_0xd9c997){return amiClient[_0xb0a0('0x19')](_0xb0a0('0x1d'),{})[_0xb0a0('0x15')](function(_0xf50ae1){if(_0xf50ae1[_0xb0a0('0xe')])throw new Error(_0xb0a0('0x1e'));return _0x15652d(_0xf50ae1[_0xb0a0('0x14')]);})[_0xb0a0('0x1f')](function(_0x28a385){_0xd9c997(_0x28a385);});});}function initializeQueues(_0x42bc19,_0x458a7b,_0x5707a8,_0xb90605){var _0x1224bf=[_0xb0a0('0x20'),'available','waiting',_0xb0a0('0x21'),_0xb0a0('0x22')];if(_0x5707a8===_0xb0a0('0x18')&&_0xb90605==='outbound'){_0x1224bf[_0xb0a0('0x23')](_0xb0a0('0x24'),_0xb0a0('0x25'),_0xb0a0('0x26'),'dialActive',_0xb0a0('0x27'),_0xb0a0('0x28'),_0xb0a0('0x29'),'startProgressive','erlangCalls',_0xb0a0('0x2a'),_0xb0a0('0x2b'),_0xb0a0('0x2c'),'dialPredictiveInterval',_0xb0a0('0x2d'),_0xb0a0('0x2e'),_0xb0a0('0x2f'),_0xb0a0('0x30'),_0xb0a0('0x31'),'predictiveIntervalDroppedCallsTimeout',_0xb0a0('0x32'),'predictiveIntervalAvgHoldtime',_0xb0a0('0x33'));}return _0x42bc19[_0xb0a0('0x34')](function(_0x3f65a7){var _0x46442c=_0x3f65a7['get']({'plain':!![]});_0x46442c[_0xb0a0('0x35')]=[];_0x46442c[_0xb0a0('0x22')]=0x0;_0x46442c[_0xb0a0('0x36')]=0x0;_0x46442c[_0xb0a0('0x20')]=0x0;_0x46442c['available']=0x0;_0x46442c[_0xb0a0('0x37')]=0x0;if(_0x5707a8===_0xb0a0('0x18')){_0x46442c[_0xb0a0('0x21')]=0x0;_0x46442c['busy']=0x0;if(_0xb90605===_0xb0a0('0x38')){_0x46442c[_0xb0a0('0x24')]=0x0;_0x46442c[_0xb0a0('0x25')]=0x0;}}var _0xd49956=_[_0xb0a0('0x39')](_0x458a7b,['id',_0x46442c['id']]);if(_0xd49956)_[_0xb0a0('0x17')](_0x46442c,_[_0xb0a0('0x3a')](_0xd49956,_0x1224bf));return _0x46442c;});}function updateAgentVoiceStatus(_0x2f6e19,_0x29a5fe,_0x38ab22){var _0x3ab763=_[_0xb0a0('0x3b')](_0x38ab22,[_0xb0a0('0x3c'),_0x29a5fe[_0xb0a0('0x10')]]);if(_0x3ab763['length']===0x0)return _0x2f6e19[_0xb0a0('0x3d')]=!![];if(_[_0xb0a0('0x3e')](_0x3ab763,[_0xb0a0('0x3f'),_0x2f6e19[_0xb0a0('0x40')][_0xb0a0('0x41')]()]))return _0x2f6e19['talking']=!![];if(!_0x2f6e19['talking'])return _0x2f6e19[_0xb0a0('0x3d')]=!![];}function getVoiceQueueAgents(_0x4fb2c7,_0xbb61e9,_0x126650,_0x51def1){var _0x14fbfc=_['find'](_0xbb61e9,['id',_0x4fb2c7['id']]);if(!_0x14fbfc)return _0x4fb2c7;return _0x14fbfc[_0xb0a0('0x42')]({'raw':!![]})[_0xb0a0('0x15')](function(_0x105179){for(var _0x41e398=0x0;_0x41e398<_0x105179['length'];_0x41e398++){var _0x102216=_[_0xb0a0('0x39')](_0x126650,['id',_0x105179[_0x41e398][_0xb0a0('0x43')]]);if(!_0x102216){_0x102216={'id':_0x105179[_0x41e398]['UserId'],'name':_0x105179[_0x41e398][_0xb0a0('0x43')],'accountcode':'','online':![]};}var _0x10266f={'id':_0x102216['id'],'name':_0x102216[_0xb0a0('0x10')],'internal':_0x102216[_0xb0a0('0x44')],'online':Boolean(_0x102216['online']),'paused':Boolean(_0x105179[_0x41e398][_0xb0a0('0x22')])};if(_0x102216[_0xb0a0('0x45')]===_0xb0a0('0x21'))updateAgentVoiceStatus(_0x10266f,_0x4fb2c7,_0x51def1);if(_0x10266f['online'])_0x4fb2c7[_0xb0a0('0x36')]++;if(_0x10266f[_0xb0a0('0x3d')])_0x4fb2c7[_0xb0a0('0x3d')]++;if(_0x10266f[_0xb0a0('0x22')]&&!_0x10266f[_0xb0a0('0x3d')]&&!_0x10266f['talking'])_0x4fb2c7[_0xb0a0('0x22')]++;_0x4fb2c7[_0xb0a0('0x35')][_0xb0a0('0x23')](_0x10266f);}return _0x4fb2c7;});}function getQueueAgents(_0x13e9ee,_0x26eee1,_0x2785ec){var _0x4cb313='User'+_[_0xb0a0('0x1a')](_0x2785ec)+_0xb0a0('0x46');var _0x2c5dc9=_0x2785ec+_0xb0a0('0x47');return db[_0x4cb313]['findAll']({'where':{[_[_0xb0a0('0x1a')](_0x2785ec)+'QueueId']:_0x13e9ee['id']},'raw':!![]})[_0xb0a0('0x15')](function(_0x1ed34e){for(var _0x12ed84=0x0;_0x12ed84<_0x1ed34e['length'];_0x12ed84++){var _0x543358=_[_0xb0a0('0x39')](_0x26eee1,['id',_0x1ed34e[_0x12ed84][_0xb0a0('0x43')]]);if(!_0x543358){_0x543358={'id':_0x1ed34e[_0x12ed84]['UserId'],'name':_0x1ed34e[_0x12ed84][_0xb0a0('0x43')],'online':![],['pauseField']:![]};}var _0x33a1a9={'id':_0x543358['id'],'name':_0x543358['name'],'online':Boolean(_0x543358[_0xb0a0('0x48')]),'paused':Boolean(_0x543358[_0x2c5dc9])};if(_0x33a1a9['online'])_0x13e9ee[_0xb0a0('0x36')]++;_0x13e9ee[_0xb0a0('0x35')]['push'](_0x33a1a9);}return _0x13e9ee;});}exports[_0xb0a0('0x49')]=function(_0x5f0127,_0x55ee1f){var _0x409cbb=['mail',_0xb0a0('0x4a'),_0xb0a0('0x4b'),_0xb0a0('0x4c'),_0xb0a0('0x4d'),'whatsapp','voice'];var _0x445e1d={'count':0x0,'rows':[]},_0x5b6e1b={},_0x352893,_0x2538b7,_0x230b0c,_0x27d274,_0x35f074;Promise['resolve']()[_0xb0a0('0x15')](function(){if(_0x5f0127[_0xb0a0('0x4e')][_0xb0a0('0x4f')]){if(!_['includes'](_0x409cbb,_0x5f0127['query'][_0xb0a0('0x4f')]['toLowerCase']()))throw new Error(_0xb0a0('0x50'));_0x352893=_0x5f0127[_0xb0a0('0x4e')][_0xb0a0('0x4f')]['toLowerCase']();}var _0x3abc19=_['startCase'](_0x352893)+_0xb0a0('0x46');var _0x8b8aac=_[_0xb0a0('0x34')](db[_0x3abc19][_0xb0a0('0x51')],function(_0x329a34){return{'name':_0x329a34[_0xb0a0('0x52')],'type':_0x329a34[_0xb0a0('0x53')][_0xb0a0('0x54')]};});_0x5b6e1b=qs['getOptions'](_0x8b8aac,_0x5f0127);if(_0x5f0127['user']['role']==='user'){var _0x561f0f={'params':{'id':_0x5f0127[_0xb0a0('0x55')][_0xb0a0('0x56')]},'query':{'section':_0x352893==='voice'&&_0x5f0127[_0xb0a0('0x4e')]['type']==='outbound'?_0xb0a0('0x57'):_[_0xb0a0('0x1a')](_0x352893)+_0xb0a0('0x1b'),'type':_0x5f0127[_0xb0a0('0x4e')][_0xb0a0('0x53')],'nolimit':!![],'sort':_0xb0a0('0x10'),'filter':_0x5f0127[_0xb0a0('0x4e')][_0xb0a0('0x3b')]}};return db[_0xb0a0('0x58')]['getResources'](_0x561f0f);}return db[_0x3abc19][_0xb0a0('0x59')](_0x5b6e1b);})[_0xb0a0('0x15')](function(_0x33764f){_0x445e1d[_0xb0a0('0x9')]=_0x33764f[_0xb0a0('0x9')];_0x2538b7=_0x33764f[_0xb0a0('0x5a')];return getRealtimeQueues(_0x5f0127,_0x352893);})['then'](function(_0x2c421d){_0x27d274=_0x2c421d[_0xb0a0('0x5a')];return getRealtimeAgents();})['then'](function(_0x6a0b0f){_0x230b0c=_0x6a0b0f['rows'];if(_0x352893!=_0xb0a0('0x18'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2cc267){_0x35f074=_0x2cc267?_0x2cc267[_0xb0a0('0x5a')]:[];return initializeQueues(_0x2538b7,_0x27d274,_0x352893,_0x5f0127['query']['type']);})[_0xb0a0('0x15')](function(_0x23234c){var _0x5bb8e2=_0x23234c[_0xb0a0('0x34')](function(_0x44a6c0){if(_0x352893===_0xb0a0('0x18'))return getVoiceQueueAgents(_0x44a6c0,_0x2538b7,_0x230b0c,_0x35f074);else return getQueueAgents(_0x44a6c0,_0x230b0c,_0x352893);});return Promise['all'](_0x5bb8e2);})[_0xb0a0('0x15')](function(_0x5b6805){_0x445e1d[_0xb0a0('0x5a')]=_0x5b6805;return _0x445e1d;})['then'](respondWithFilteredResult(_0x55ee1f,_0x5b6e1b))[_0xb0a0('0x1f')](handleError(_0x55ee1f,null));};
\ No newline at end of file
index 71747c5..2711e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x278474,_0x4bb2ee){var _0x2e207f=function(_0x2780d9){while(--_0x2780d9){_0x278474['push'](_0x278474['shift']());}};_0x2e207f(++_0x4bb2ee);}(_0xedd9,0xfc));var _0x9edd=function(_0xad885c,_0x3fd8bb){_0xad885c=_0xad885c-0x0;var _0x3d3d45=_0xedd9[_0xad885c];return _0x3d3d45;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5a837c,_0x52fa87){var _0x45711e=function(_0x55c063){while(--_0x55c063){_0x5a837c['push'](_0x5a837c['shift']());}};_0x45711e(++_0x52fa87);}(_0xedd9,0xfc));var _0x9edd=function(_0x94dcd7,_0x384623){_0x94dcd7=_0x94dcd7-0x0;var _0x154155=_0xedd9[_0x94dcd7];return _0x154155;};'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 527976f..18bb0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['INTEGER','DATE','STRING','sequelize','exports'];(function(_0x274341,_0x5b2806){var _0x3c599b=function(_0x2a6434){while(--_0x2a6434){_0x274341['push'](_0x274341['shift']());}};_0x3c599b(++_0x5b2806);}(_0xf072,0x1cf));var _0x2f07=function(_0x4a7a9,_0x3d85d8){_0x4a7a9=_0x4a7a9-0x0;var _0x1f4e07=_0xf072[_0x4a7a9];return _0x1f4e07;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'state':{'type':Sequelize[_0x2f07('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2f07('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2f07('0x3')]},'responsetime':{'type':Sequelize[_0x2f07('0x3')]},'ringtime':{'type':Sequelize[_0x2f07('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2f07('0x4')]},'membername':{'type':Sequelize[_0x2f07('0x4')]}};
\ No newline at end of file
+var _0x5f6f=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2cb0a4,_0xac7d22){var _0x31e540=function(_0x15da92){while(--_0x15da92){_0x2cb0a4['push'](_0x2cb0a4['shift']());}};_0x31e540(++_0xac7d22);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x45e8e4,_0x56c8c1){_0x45e8e4=_0x45e8e4-0x0;var _0x4fcfb8=_0x5f6f[_0x45e8e4];return _0x4fcfb8;};'use strict';var Sequelize=require(_0xf5f6('0x0'));module[_0xf5f6('0x1')]={'state':{'type':Sequelize[_0xf5f6('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xf5f6('0x3')]},'scheduledat':{'type':Sequelize[_0xf5f6('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf5f6('0x4')]},'responsetime':{'type':Sequelize[_0xf5f6('0x4')]},'ringtime':{'type':Sequelize[_0xf5f6('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xf5f6('0x3')]},'membername':{'type':Sequelize[_0xf5f6('0x3')]}};
\ No newline at end of file
index bbc14c1..2b53109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68aa=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview'];(function(_0xb79d48,_0x21c0fb){var _0x543ac3=function(_0xeb08e3){while(--_0xeb08e3){_0xb79d48['push'](_0xb79d48['shift']());}};_0x543ac3(++_0x21c0fb);}(_0x68aa,0x8d));var _0xa68a=function(_0x187aa1,_0x1f5358){_0x187aa1=_0x187aa1-0x0;var _0x309658=_0x68aa[_0x187aa1];return _0x309658;};'use strict';var _=require(_0xa68a('0x0'));var util=require(_0xa68a('0x1'));var logger=require(_0xa68a('0x2'))(_0xa68a('0x3'));var moment=require(_0xa68a('0x4'));var BPromise=require(_0xa68a('0x5'));var rp=require(_0xa68a('0x6'));var fs=require('fs');var path=require(_0xa68a('0x7'));var rimraf=require('rimraf');var config=require(_0xa68a('0x8'));var attributes=require(_0xa68a('0x9'));module[_0xa68a('0xa')]=function(_0x1a4f05,_0x307388){return _0x1a4f05[_0xa68a('0xb')](_0xa68a('0xc'),attributes,{'tableName':_0xa68a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x080f=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0x080f,0x8e));var _0xf080=function(_0x1d8c17,_0x3cbb26){_0x1d8c17=_0x1d8c17-0x0;var _0x18d834=_0x080f[_0x1d8c17];return _0x18d834;};'use strict';var _=require(_0xf080('0x0'));var util=require(_0xf080('0x1'));var logger=require(_0xf080('0x2'))('api');var moment=require(_0xf080('0x3'));var BPromise=require(_0xf080('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf080('0x5'));var rimraf=require(_0xf080('0x6'));var config=require(_0xf080('0x7'));var attributes=require(_0xf080('0x8'));module['exports']=function(_0x5ee2fe,_0x4b6296){return _0x5ee2fe[_0xf080('0x9')](_0xf080('0xa'),attributes,{'tableName':_0xf080('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a026e3a..d6df03e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0c5=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','util','moment','bluebird'];(function(_0x11ef01,_0x31a929){var _0xa6b94c=function(_0x885c9e){while(--_0x885c9e){_0x11ef01['push'](_0x11ef01['shift']());}};_0xa6b94c(++_0x31a929);}(_0xc0c5,0x1d9));var _0x5c0c=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0xc0c5[_0x7a112];return _0x136dc5;};'use strict';var _=require('lodash');var util=require(_0x5c0c('0x0'));var moment=require(_0x5c0c('0x1'));var BPromise=require(_0x5c0c('0x2'));var rs=require(_0x5c0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5c0c('0x4'));var logger=require(_0x5c0c('0x5'))(_0x5c0c('0x6'));var config=require('../../config/environment');var jayson=require(_0x5c0c('0x7'));var client=jayson[_0x5c0c('0x8')][_0x5c0c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116c9a,_0x5204fb,_0x3b4051){return new BPromise(function(_0x560196,_0x14dda0){return client[_0x5c0c('0xa')](_0x116c9a,_0x3b4051)[_0x5c0c('0xb')](function(_0x3d4fdb){logger[_0x5c0c('0xc')](_0x5c0c('0xd'),_0x5204fb,_0x5c0c('0xe'));logger[_0x5c0c('0xf')](_0x5c0c('0x10'),_0x5204fb,'request\x20sent',JSON[_0x5c0c('0x11')](_0x3d4fdb));if(_0x3d4fdb[_0x5c0c('0x12')]){if(_0x3d4fdb[_0x5c0c('0x12')][_0x5c0c('0x13')]===0x1f4){logger[_0x5c0c('0x12')](_0x5c0c('0xd'),_0x5204fb,_0x3d4fdb['error'][_0x5c0c('0x14')]);return _0x14dda0(_0x3d4fdb[_0x5c0c('0x12')]['message']);}logger[_0x5c0c('0x12')](_0x5c0c('0xd'),_0x5204fb,_0x3d4fdb['error']['message']);return _0x560196(_0x3d4fdb['error'][_0x5c0c('0x14')]);}else{logger[_0x5c0c('0xc')](_0x5c0c('0xd'),_0x5204fb,_0x5c0c('0xe'));_0x560196(_0x3d4fdb[_0x5c0c('0x15')][_0x5c0c('0x14')]);}})[_0x5c0c('0x16')](function(_0x4ba6aa){logger['error'](_0x5c0c('0xd'),_0x5204fb,_0x4ba6aa);_0x14dda0(_0x4ba6aa);});});}exports[_0x5c0c('0x17')]=function(_0x145e06){var _0x5a8df1=this;return new Promise(function(_0x536aaf,_0x5b81ea){return db[_0x5c0c('0x18')][_0x5c0c('0x19')](_0x145e06[_0x5c0c('0x1a')],{'raw':_0x145e06[_0x5c0c('0x1b')]?_0x145e06[_0x5c0c('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x5c0c('0xb')](function(_0x11ec5a){logger[_0x5c0c('0xc')](_0x5c0c('0x17'),_0x145e06);logger[_0x5c0c('0xf')](_0x5c0c('0x17'),_0x145e06,JSON[_0x5c0c('0x11')](_0x11ec5a));_0x536aaf(_0x11ec5a);})[_0x5c0c('0x16')](function(_0x5726dd){logger[_0x5c0c('0x12')](_0x5c0c('0x17'),_0x5726dd[_0x5c0c('0x14')],_0x145e06);_0x5b81ea(_0x5a8df1[_0x5c0c('0x12')](0x1f4,_0x5726dd[_0x5c0c('0x14')]));});});};
\ No newline at end of file
+var _0xcd63=['ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ReportAgentPreview','create','body','options','then','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x38ea13,_0x33f24d){var _0x5f3d26=function(_0x583b47){while(--_0x583b47){_0x38ea13['push'](_0x38ea13['shift']());}};_0x5f3d26(++_0x33f24d);}(_0xcd63,0xe4));var _0x3cd6=function(_0x849478,_0x339811){_0x849478=_0x849478-0x0;var _0x10f9df=_0xcd63[_0x849478];return _0x10f9df;};'use strict';var _=require(_0x3cd6('0x0'));var util=require(_0x3cd6('0x1'));var moment=require(_0x3cd6('0x2'));var BPromise=require(_0x3cd6('0x3'));var rs=require(_0x3cd6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3cd6('0x5'))['db'];var utils=require(_0x3cd6('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3cd6('0x7'));var jayson=require(_0x3cd6('0x8'));var client=jayson[_0x3cd6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1085f9,_0x2d5750,_0x30e470){return new BPromise(function(_0x366350,_0x4ee634){return client[_0x3cd6('0xa')](_0x1085f9,_0x30e470)['then'](function(_0x4188e6){logger[_0x3cd6('0xb')](_0x3cd6('0xc'),_0x2d5750,_0x3cd6('0xd'));logger[_0x3cd6('0xe')](_0x3cd6('0xf'),_0x2d5750,_0x3cd6('0xd'),JSON[_0x3cd6('0x10')](_0x4188e6));if(_0x4188e6['error']){if(_0x4188e6['error']['code']===0x1f4){logger[_0x3cd6('0x11')](_0x3cd6('0xc'),_0x2d5750,_0x4188e6[_0x3cd6('0x11')][_0x3cd6('0x12')]);return _0x4ee634(_0x4188e6[_0x3cd6('0x11')][_0x3cd6('0x12')]);}logger[_0x3cd6('0x11')](_0x3cd6('0xc'),_0x2d5750,_0x4188e6[_0x3cd6('0x11')][_0x3cd6('0x12')]);return _0x366350(_0x4188e6['error']['message']);}else{logger[_0x3cd6('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x2d5750,_0x3cd6('0xd'));_0x366350(_0x4188e6[_0x3cd6('0x13')]['message']);}})[_0x3cd6('0x14')](function(_0x4ba5cd){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2d5750,_0x4ba5cd);_0x4ee634(_0x4ba5cd);});});}exports['CreateReportAgentPreview']=function(_0x4f39c2){var _0x4d411e=this;return new Promise(function(_0x47a60f,_0x337244){return db[_0x3cd6('0x15')][_0x3cd6('0x16')](_0x4f39c2[_0x3cd6('0x17')],{'raw':_0x4f39c2['options']?_0x4f39c2[_0x3cd6('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3cd6('0x19')](function(_0x540fd1){logger['info'](_0x3cd6('0x1a'),_0x4f39c2);logger[_0x3cd6('0xe')](_0x3cd6('0x1a'),_0x4f39c2,JSON[_0x3cd6('0x10')](_0x540fd1));_0x47a60f(_0x540fd1);})['catch'](function(_0xd787cc){logger[_0x3cd6('0x11')](_0x3cd6('0x1a'),_0xd787cc[_0x3cd6('0x12')],_0x4f39c2);_0x337244(_0x4d411e[_0x3cd6('0x11')](0x1f4,_0xd787cc[_0x3cd6('0x12')]));});});};
\ No newline at end of file
index 1d8e6ab..49a2eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a2=['showMailQueues','post','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','agentNotify','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','put','/voice/queues/:id','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id'];(function(_0x4cf7b1,_0x5386b8){var _0xe7c159=function(_0x13bd87){while(--_0x13bd87){_0x4cf7b1['push'](_0x4cf7b1['shift']());}};_0xe7c159(++_0x5386b8);}(_0x29a2,0x18d));var _0x229a=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x29a2[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0x229a('0x0'));var path=require('path');var express=require(_0x229a('0x1'));var router=express[_0x229a('0x2')]();var auth=require(_0x229a('0x3'));var controller=require(_0x229a('0x4'));router[_0x229a('0x5')](_0x229a('0x6'),auth['isAuthenticated'](),controller[_0x229a('0x7')]);router[_0x229a('0x5')](_0x229a('0x8'),auth[_0x229a('0x9')](),controller[_0x229a('0xa')]);router[_0x229a('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x229a('0x9')](),controller[_0x229a('0xb')]);router['get'](_0x229a('0xc'),auth[_0x229a('0x9')](),controller[_0x229a('0xd')]);router[_0x229a('0x5')]('/chat/queues',auth[_0x229a('0x9')](),controller[_0x229a('0xe')]);router[_0x229a('0x5')]('/mail/queues',auth[_0x229a('0x9')](),controller[_0x229a('0xf')]);router[_0x229a('0x5')](_0x229a('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x229a('0x5')](_0x229a('0x11'),auth[_0x229a('0x9')](),controller['openchannelQueues']);router[_0x229a('0x5')](_0x229a('0x12'),auth['isAuthenticated'](),controller[_0x229a('0x13')]);router['get']('/whatsapp/queues',auth[_0x229a('0x9')](),controller[_0x229a('0x14')]);router['get'](_0x229a('0x15'),auth[_0x229a('0x9')](),controller['faxQueues']);router['get']('/voice/queues/preview/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x16')]);router[_0x229a('0x5')](_0x229a('0x17'),auth['isAuthenticated'](),controller[_0x229a('0x18')]);router[_0x229a('0x5')](_0x229a('0x19'),auth[_0x229a('0x9')](),controller[_0x229a('0x1a')]);router[_0x229a('0x5')](_0x229a('0x1b'),auth[_0x229a('0x9')](),controller['voiceQueuesChannelHangup']);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x229a('0x9')](),controller[_0x229a('0x1c')]);router[_0x229a('0x5')]('/voice/queues/:id',auth[_0x229a('0x9')](),controller['showVoiceQueues']);router[_0x229a('0x1d')](_0x229a('0x1e'),auth[_0x229a('0x9')](),controller['updateVoiceQueue']);router[_0x229a('0x5')](_0x229a('0x1f'),auth['isAuthenticated'](),controller[_0x229a('0x20')]);router[_0x229a('0x5')](_0x229a('0x21'),auth[_0x229a('0x9')](),controller[_0x229a('0x22')]);router[_0x229a('0x5')](_0x229a('0x23'),auth[_0x229a('0x9')](),controller[_0x229a('0x24')]);router[_0x229a('0x1d')]('/agents/:id/capacity',auth[_0x229a('0x9')](),controller[_0x229a('0x25')]);router[_0x229a('0x5')](_0x229a('0x26'),auth[_0x229a('0x9')](),controller[_0x229a('0x27')]);router[_0x229a('0x5')](_0x229a('0x28'),auth[_0x229a('0x9')](),controller[_0x229a('0x29')]);router[_0x229a('0x5')]('/campaigns',auth[_0x229a('0x9')](),controller[_0x229a('0x2a')]);router['get'](_0x229a('0x2b'),auth['isAuthenticated'](),controller[_0x229a('0x2c')]);router[_0x229a('0x5')]('/chat/queues/waitinginteractions',auth[_0x229a('0x9')](),controller[_0x229a('0x2d')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x229a('0x5')](_0x229a('0x2e'),auth[_0x229a('0x9')](),controller[_0x229a('0x2f')]);router['get'](_0x229a('0x30'),auth[_0x229a('0x9')](),controller[_0x229a('0x31')]);router[_0x229a('0x5')](_0x229a('0x32'),auth[_0x229a('0x9')](),controller[_0x229a('0x33')]);router[_0x229a('0x5')](_0x229a('0x34'),auth[_0x229a('0x9')](),controller[_0x229a('0x35')]);router[_0x229a('0x5')]('/fax/queues/waitinginteractions',auth[_0x229a('0x9')](),controller[_0x229a('0x36')]);router['post'](_0x229a('0x37'),auth[_0x229a('0x9')](),controller[_0x229a('0x38')](_0x229a('0x39')));router['get'](_0x229a('0x3a'),auth[_0x229a('0x9')](),controller[_0x229a('0x3b')]);router[_0x229a('0x3c')](_0x229a('0x3d'),auth[_0x229a('0x9')](),controller['queueNotify'](_0x229a('0x3e')));router[_0x229a('0x5')](_0x229a('0x3f'),auth[_0x229a('0x9')](),controller['showChatQueues']);router[_0x229a('0x3c')](_0x229a('0x40'),auth['isAuthenticated'](),controller[_0x229a('0x38')](_0x229a('0x41')));router[_0x229a('0x5')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x229a('0x42')]);router[_0x229a('0x3c')](_0x229a('0x43'),auth[_0x229a('0x9')](),controller['queueNotify']('openchannel'));router[_0x229a('0x5')](_0x229a('0x44'),auth[_0x229a('0x9')](),controller['showOpenchannelQueues']);router[_0x229a('0x3c')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x229a('0x38')]('sms'));router[_0x229a('0x3c')](_0x229a('0x45'),auth[_0x229a('0x9')](),controller[_0x229a('0x38')](_0x229a('0x46')));router['get'](_0x229a('0x47'),auth[_0x229a('0x9')](),controller[_0x229a('0x48')]);router[_0x229a('0x5')]('/whatsapp/queues/:id',auth[_0x229a('0x9')](),controller[_0x229a('0x49')]);router[_0x229a('0x3c')](_0x229a('0x4a'),auth[_0x229a('0x9')](),controller[_0x229a('0x4b')]);module['exports']=router;
\ No newline at end of file
+var _0x5923=['voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/telephones','telephones','/trunks','trunks','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','queueNotify','openchannel','/openchannel/queues/:id','sms','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x5923,0x1d7));var _0x3592=function(_0x5322e3,_0x20d04c){_0x5322e3=_0x5322e3-0x0;var _0x31b51b=_0x5923[_0x5322e3];return _0x31b51b;};'use strict';var multer=require(_0x3592('0x0'));var util=require(_0x3592('0x1'));var path=require(_0x3592('0x2'));var express=require(_0x3592('0x3'));var router=express[_0x3592('0x4')]();var auth=require(_0x3592('0x5'));var controller=require(_0x3592('0x6'));router[_0x3592('0x7')]('/voice/channels',auth[_0x3592('0x8')](),controller[_0x3592('0x9')]);router[_0x3592('0x7')](_0x3592('0xa'),auth['isAuthenticated'](),controller[_0x3592('0xb')]);router[_0x3592('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x3592('0xc')]);router['get'](_0x3592('0xd'),auth[_0x3592('0x8')](),controller[_0x3592('0xe')]);router[_0x3592('0x7')](_0x3592('0xf'),auth[_0x3592('0x8')](),controller[_0x3592('0x10')]);router[_0x3592('0x7')](_0x3592('0x11'),auth[_0x3592('0x8')](),controller['mailQueues']);router['get'](_0x3592('0x12'),auth[_0x3592('0x8')](),controller[_0x3592('0x13')]);router[_0x3592('0x7')]('/openchannel/queues',auth[_0x3592('0x8')](),controller[_0x3592('0x14')]);router[_0x3592('0x7')](_0x3592('0x15'),auth[_0x3592('0x8')](),controller[_0x3592('0x16')]);router['get'](_0x3592('0x17'),auth[_0x3592('0x8')](),controller[_0x3592('0x18')]);router[_0x3592('0x7')]('/fax/queues',auth[_0x3592('0x8')](),controller[_0x3592('0x19')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x3592('0x1a')]);router['get'](_0x3592('0x1b'),auth['isAuthenticated'](),controller[_0x3592('0x1c')]);router[_0x3592('0x7')](_0x3592('0x1d'),auth[_0x3592('0x8')](),controller[_0x3592('0x1e')]);router[_0x3592('0x7')](_0x3592('0x1f'),auth['isAuthenticated'](),controller[_0x3592('0x20')]);router[_0x3592('0x7')](_0x3592('0x21'),auth[_0x3592('0x8')](),controller[_0x3592('0x22')]);router[_0x3592('0x7')]('/voice/queues/:id',auth[_0x3592('0x8')](),controller[_0x3592('0x23')]);router[_0x3592('0x24')](_0x3592('0x25'),auth[_0x3592('0x8')](),controller[_0x3592('0x26')]);router[_0x3592('0x7')](_0x3592('0x27'),auth[_0x3592('0x8')](),controller['outbound']);router[_0x3592('0x7')](_0x3592('0x28'),auth[_0x3592('0x8')](),controller[_0x3592('0x29')]);router['get']('/agents',auth[_0x3592('0x8')](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x3592('0x8')](),controller['agentCapacity']);router[_0x3592('0x7')](_0x3592('0x2a'),auth[_0x3592('0x8')](),controller[_0x3592('0x2b')]);router[_0x3592('0x7')](_0x3592('0x2c'),auth['isAuthenticated'](),controller[_0x3592('0x2d')]);router[_0x3592('0x7')]('/campaigns',auth[_0x3592('0x8')](),controller[_0x3592('0x2e')]);router[_0x3592('0x7')]('/fax/accounts',auth[_0x3592('0x8')](),controller[_0x3592('0x2f')]);router[_0x3592('0x7')](_0x3592('0x30'),auth[_0x3592('0x8')](),controller[_0x3592('0x31')]);router[_0x3592('0x7')]('/mail/queues/waitinginteractions',auth[_0x3592('0x8')](),controller[_0x3592('0x32')]);router[_0x3592('0x7')](_0x3592('0x33'),auth[_0x3592('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x3592('0x7')](_0x3592('0x34'),auth['isAuthenticated'](),controller[_0x3592('0x35')]);router[_0x3592('0x7')]('/sms/queues/waitinginteractions',auth[_0x3592('0x8')](),controller[_0x3592('0x36')]);router[_0x3592('0x7')](_0x3592('0x37'),auth[_0x3592('0x8')](),controller[_0x3592('0x38')]);router[_0x3592('0x7')](_0x3592('0x39'),auth[_0x3592('0x8')](),controller[_0x3592('0x3a')]);router[_0x3592('0x3b')]('/mail/queues/:id/notify',auth[_0x3592('0x8')](),controller['queueNotify'](_0x3592('0x3c')));router[_0x3592('0x7')](_0x3592('0x3d'),auth['isAuthenticated'](),controller[_0x3592('0x3e')]);router[_0x3592('0x3b')](_0x3592('0x3f'),auth[_0x3592('0x8')](),controller['queueNotify'](_0x3592('0x40')));router['get'](_0x3592('0x41'),auth[_0x3592('0x8')](),controller['showChatQueues']);router[_0x3592('0x3b')](_0x3592('0x42'),auth['isAuthenticated'](),controller['queueNotify']('fax'));router[_0x3592('0x7')](_0x3592('0x43'),auth[_0x3592('0x8')](),controller[_0x3592('0x44')]);router[_0x3592('0x3b')](_0x3592('0x45'),auth[_0x3592('0x8')](),controller[_0x3592('0x46')](_0x3592('0x47')));router[_0x3592('0x7')](_0x3592('0x48'),auth[_0x3592('0x8')](),controller['showOpenchannelQueues']);router[_0x3592('0x3b')]('/sms/queues/:id/notify',auth[_0x3592('0x8')](),controller[_0x3592('0x46')](_0x3592('0x49')));router[_0x3592('0x3b')]('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router['get'](_0x3592('0x4a'),auth[_0x3592('0x8')](),controller['showSmsQueues']);router[_0x3592('0x7')](_0x3592('0x4b'),auth[_0x3592('0x8')](),controller[_0x3592('0x4c')]);router['post'](_0x3592('0x4d'),auth['isAuthenticated'](),controller[_0x3592('0x4e')]);module[_0x3592('0x4f')]=router;
\ No newline at end of file
index d71e3dc..30fd206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0xa630,0xbe));var _0x0a63=function(_0x109409,_0x531e67){_0x109409=_0x109409-0x0;var _0x841581=_0xa630[_0x109409];return _0x841581;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));};
\ No newline at end of file
+var _0x814b=['whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','create','Start','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','User','Agent\x20not\x20found','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','catch','status','json','sendStatus','stack','name','send','isNil','rows','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','query','params','voiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues'];(function(_0x1eb047,_0x46089e){var _0x2ec643=function(_0x2b64cb){while(--_0x2b64cb){_0x1eb047['push'](_0x1eb047['shift']());}};_0x2ec643(++_0x46089e);}(_0x814b,0x1a2));var _0xb814=function(_0x27d958,_0x29ef87){_0x27d958=_0x27d958-0x0;var _0x53e63e=_0x814b[_0x27d958];return _0x53e63e;};'use strict';var BPromise=require(_0xb814('0x0'));var moment=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var db=require(_0xb814('0x4'))['db'];var logger=require(_0xb814('0x5'))('api');var jayson=require(_0xb814('0x6'));var amiClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232a});var mailClient=jayson[_0xb814('0x7')][_0xb814('0x8')]({'port':0x232b});var routingClient=jayson[_0xb814('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){var _0x186d5a=_0x5c8539?_0x5c8539:amiClient;return _0x186d5a[_0xb814('0x9')](_0x3b0829,_0x2e6272)[_0xb814('0xa')](function(_0x21d4a5){if(_0x21d4a5[_0xb814('0xb')]){if(_0x21d4a5[_0xb814('0xb')][_0xb814('0xc')]===0x1f4){return _0x2913a6(_0x21d4a5[_0xb814('0xb')][_0xb814('0xd')]);}return _0x271af9(_0x21d4a5['error'][_0xb814('0xd')]);}else{_0x271af9(_0x21d4a5['result']);}})[_0xb814('0xe')](function(_0x15d6ef){_0x2913a6(_0x15d6ef);});});}function respondWithResult(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xc8;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0xf')](_0x2cc46b)[_0xb814('0x10')](_0x2ce718);}return _0x35b10d[_0xb814('0x11')](0x194);};}function handleError(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0x1f4;return function(_0x3f4881){logger[_0xb814('0xb')](_0x3f4881[_0xb814('0x12')]);if(_0x3f4881[_0xb814('0x13')]){delete _0x3f4881[_0xb814('0x13')];}_0xa0a2e5[_0xb814('0xf')](_0x2ab627)[_0xb814('0x14')](_0x3f4881);};}function findById(_0x265a83){return function(_0x125ce2){if(!_[_0xb814('0x15')](_0x265a83)&&!_[_0xb814('0x15')](_0x125ce2)&&!_['isNil'](_0x125ce2[_0xb814('0x16')])){return _['find'](_0x125ce2[_0xb814('0x16')],function(_0xfac75b){return _0xfac75b['id']==_0x265a83;});}return null;};}exports['voiceChannels']=function(_0x4b55a7,_0x55d63c){return respondWithRpcPromise(_0xb814('0x17'),_0x4b55a7['query'])['then'](respondWithResult(_0x55d63c,null))[_0xb814('0xe')](handleError(_0x55d63c,null));};exports[_0xb814('0x18')]=function(_0x25b6b6,_0x4e139e){return respondWithRpcPromise(_0xb814('0x19'),_['merge'](_0x25b6b6[_0xb814('0x1a')],_0x25b6b6[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4e139e,null))[_0xb814('0xe')](handleError(_0x4e139e,null));};exports[_0xb814('0x1c')]=function(_0x2bd039,_0x1f5d40){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xb814('0x1d')](_0x2bd039['query'],_0x2bd039[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1f5d40,null))[_0xb814('0xe')](handleError(_0x1f5d40,null));};exports[_0xb814('0x1e')]=function(_0x1c8a2e,_0xb9e57d){return respondWithRpcPromise(_0xb814('0x1f'),_0x1c8a2e['query'])[_0xb814('0xa')](respondWithResult(_0xb9e57d,null))[_0xb814('0xe')](handleError(_0xb9e57d,null));};exports[_0xb814('0x20')]=function(_0x349394,_0x32ed56){return respondWithRpcPromise(_0xb814('0x1f'),_0x349394[_0xb814('0x1a')])[_0xb814('0xa')](findById(_0x349394['params']['id']))[_0xb814('0xa')](respondWithResult(_0x32ed56,null))[_0xb814('0xe')](handleError(_0x32ed56,null));};exports['updateVoiceQueue']=function(_0x9008b2,_0x37d24d){return respondWithRpcPromise(_0xb814('0x21'),_['merge'](_0x9008b2[_0xb814('0x22')],_0x9008b2[_0xb814('0x1b')]))['then'](respondWithResult(_0x37d24d,null))[_0xb814('0xe')](handleError(_0x37d24d,null));};exports['voiceQueuesPreview']=function(_0x6efe9a,_0x5f3e9b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xb814('0x1d')](_0x6efe9a['query'],_0x6efe9a[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x5f3e9b,null))[_0xb814('0xe')](handleError(_0x5f3e9b,null));};exports['voiceQueuesChannels']=function(_0x51d5ae,_0x26d3a9){return respondWithRpcPromise(_0xb814('0x23'),_0x51d5ae['query'])[_0xb814('0xa')](respondWithResult(_0x26d3a9,null))[_0xb814('0xe')](handleError(_0x26d3a9,null));};exports[_0xb814('0x24')]=function(_0x217b7e,_0x1b78de){return respondWithRpcPromise(_0xb814('0x25'),_[_0xb814('0x1d')](_0x217b7e['query'],_0x217b7e[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x1b78de,null))[_0xb814('0xe')](handleError(_0x1b78de,null));};exports[_0xb814('0x26')]=function(_0x14100d,_0x4ff31a){return respondWithRpcPromise(_0xb814('0x27'),_['merge'](_0x14100d[_0xb814('0x1a')],_0x14100d[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ff31a,null))['catch'](handleError(_0x4ff31a,null));};exports[_0xb814('0x28')]=function(_0xbdb3e9,_0x4ea6f8){return respondWithRpcPromise(_0xb814('0x29'),_[_0xb814('0x1d')](_0xbdb3e9[_0xb814('0x1a')],_0xbdb3e9[_0xb814('0x1b')]))[_0xb814('0xa')](respondWithResult(_0x4ea6f8,null))[_0xb814('0xe')](handleError(_0x4ea6f8,null));};exports['outbound']=function(_0xa6ce87,_0x4e4684){return respondWithRpcPromise(_0xb814('0x2a'),_0xa6ce87['query'])[_0xb814('0xa')](respondWithResult(_0x4e4684,null))['catch'](handleError(_0x4e4684,null));};exports[_0xb814('0x2b')]=function(_0x26675a,_0x54a7fb){return respondWithRpcPromise('OutboundChannels',_0x26675a['query'])['then'](respondWithResult(_0x54a7fb,null))[_0xb814('0xe')](handleError(_0x54a7fb,null));};exports[_0xb814('0x2c')]=function(_0x38cdc2,_0x42c2ed){var _0x51cdba;return respondWithRpcPromise('Agents',_0x38cdc2[_0xb814('0x1a')])['then'](function(_0x2a93da){_0x51cdba=_0x2a93da;return respondWithRpcPromise(_0xb814('0x2d'),_0x38cdc2[_0xb814('0x1a')],routingClient);})[_0xb814('0xa')](function(_0x42653f){return _[_0xb814('0x1d')]({},_0x42653f,_0x51cdba);})[_0xb814('0xa')](respondWithResult(_0x42c2ed,null))[_0xb814('0xe')](handleError(_0x42c2ed,null));};exports[_0xb814('0x2e')]=function(_0x4b6ff8,_0x544d36){if(_0x4b6ff8['body']&&_0x4b6ff8[_0xb814('0x22')]['interaction']&&_0x4b6ff8[_0xb814('0x2f')]&&_0x4b6ff8['user'][_0xb814('0x13')]){for(var _0x44ff56 in _0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')]){if(_0x4b6ff8['body'][_0xb814('0x30')][_0xb814('0x31')](_0x44ff56)){db[_0xb814('0x32')][_0xb814('0x33')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]&&_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')]?{'$notIn':_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56]}:{'$ne':null}}})['then'](function(_0x4a5e84){var _0xe751c3=moment()[_0xb814('0x35')](_0xb814('0x36'));for(var _0x2bf906=0x0,_0x43f1b=_0x4a5e84[_0xb814('0x34')];_0x2bf906<_0x43f1b;_0x2bf906+=0x1){_0x4a5e84[_0x2bf906][_0xb814('0x37')]({'exitAt':_0xe751c3});}});for(var _0x40af85=0x0;_0x40af85<_0x4b6ff8[_0xb814('0x22')][_0xb814('0x30')][_0x44ff56][_0xb814('0x34')];_0x40af85+=0x1){db['MemberReport'][_0xb814('0x38')]({'where':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')]['name'],'type':_0xb814('0x39'),'uniqueid':_0x4b6ff8['body'][_0xb814('0x30')][_0x44ff56][_0x40af85],'exitAt':null},'defaults':{'channel':_0x44ff56,'membername':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')],'interface':_[_0xb814('0x15')](_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3a')])?util[_0xb814('0x35')](_0xb814('0x3b'),_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x13')]):_0x4b6ff8['user']['interface'],'type':_0xb814('0x39'),'enterAt':moment()[_0xb814('0x35')](_0xb814('0x36')),'role':_0xb814('0x3c'),'internal':_0x4b6ff8[_0xb814('0x2f')][_0xb814('0x3d')],'uniqueid':_0x4b6ff8[_0xb814('0x22')]['interaction'][_0x44ff56][_0x40af85]}});}}}}return respondWithRpcPromise(_0xb814('0x3e'),{'id':_0x4b6ff8[_0xb814('0x1b')]['id'],'capacity':_0x4b6ff8[_0xb814('0x22')]['capacity']},routingClient)[_0xb814('0xa')](respondWithResult(_0x544d36,null))['catch'](handleError(_0x544d36,null));};exports[_0xb814('0x3f')]=function(_0x5dc28e,_0x403872){return respondWithRpcPromise(_0xb814('0x40'),_0x5dc28e['query'])[_0xb814('0xa')](respondWithResult(_0x403872,null))[_0xb814('0xe')](handleError(_0x403872,null));};exports[_0xb814('0x41')]=function(_0x5209d1,_0x3da050){return respondWithRpcPromise('Trunks',_0x5209d1[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x3da050,null))['catch'](handleError(_0x3da050,null));};exports[_0xb814('0x42')]=function(_0x4a3f84,_0x539be7){return respondWithRpcPromise(_0xb814('0x43'),_0x4a3f84[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0x539be7,null))['catch'](handleError(_0x539be7,null));};exports[_0xb814('0x44')]=function(_0x538b0f,_0xf88d23){return respondWithRpcPromise(_0xb814('0x45'),_0x538b0f['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0xf88d23,null))['catch'](handleError(_0xf88d23,null));};exports[_0xb814('0x46')]=function(_0x1656ed,_0xb2bd82){return respondWithRpcPromise(_0xb814('0x45'),_0x1656ed[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x1656ed[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0xb2bd82,null))['catch'](handleError(_0xb2bd82,null));};exports[_0xb814('0x47')]=function(_0x5441c5,_0x5d71d5){return respondWithRpcPromise(_0xb814('0x48'),_0x5441c5[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x5d71d5,null))[_0xb814('0xe')](handleError(_0x5d71d5,null));};exports['showMailQueues']=function(_0x48362c,_0x2114ca){return respondWithRpcPromise('MailQueues',_0x48362c[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x48362c[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x2114ca,null))[_0xb814('0xe')](handleError(_0x2114ca,null));};exports['mailAccounts']=function(_0x2ef77d,_0x1e9196){return respondWithRpcPromise(_0xb814('0x49'),_0x2ef77d[_0xb814('0x1a')],mailClient)[_0xb814('0xa')](respondWithResult(_0x1e9196,null))[_0xb814('0xe')](handleError(_0x1e9196,null));};exports[_0xb814('0x4a')]=function(_0x113350,_0x46014f){return respondWithRpcPromise('OpenchannelQueues',_0x113350[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x46014f,null))[_0xb814('0xe')](handleError(_0x46014f,null));};exports[_0xb814('0x4b')]=function(_0x3b35a8,_0x3d4843){return respondWithRpcPromise('OpenchannelQueues',_0x3b35a8[_0xb814('0x1a')],routingClient)['then'](findById(_0x3b35a8[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x3d4843,null))[_0xb814('0xe')](handleError(_0x3d4843,null));};exports['smsQueues']=function(_0x150e73,_0x579351){return respondWithRpcPromise(_0xb814('0x4c'),_0x150e73['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x579351,null))[_0xb814('0xe')](handleError(_0x579351,null));};exports[_0xb814('0x4d')]=function(_0x1b024f,_0x3377d4){return respondWithRpcPromise(_0xb814('0x4c'),_0x1b024f[_0xb814('0x1a')],routingClient)['then'](findById(_0x1b024f[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3377d4,null))[_0xb814('0xe')](handleError(_0x3377d4,null));};exports[_0xb814('0x4e')]=function(_0x1b989d,_0x3dcaeb){return respondWithRpcPromise(_0xb814('0x4f'),_0x1b989d[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x3dcaeb,null))[_0xb814('0xe')](handleError(_0x3dcaeb,null));};exports[_0xb814('0x50')]=function(_0x4a49ba,_0x3bb2b4){return respondWithRpcPromise(_0xb814('0x4f'),_0x4a49ba[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](findById(_0x4a49ba[_0xb814('0x1b')]['id']))['then'](respondWithResult(_0x3bb2b4,null))[_0xb814('0xe')](handleError(_0x3bb2b4,null));};exports['faxQueues']=function(_0x24594a,_0x16f8f2){return respondWithRpcPromise(_0xb814('0x51'),_0x24594a[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x16f8f2,null))[_0xb814('0xe')](handleError(_0x16f8f2,null));};exports['showFaxQueues']=function(_0x506bf2,_0x5d064b){return respondWithRpcPromise(_0xb814('0x51'),_0x506bf2['query'],routingClient)[_0xb814('0xa')](findById(_0x506bf2[_0xb814('0x1b')]['id']))[_0xb814('0xa')](respondWithResult(_0x5d064b,null))['catch'](handleError(_0x5d064b,null));};exports[_0xb814('0x52')]=function(_0x3e5ce8,_0xee204){return respondWithRpcPromise('FaxAccounts',_0x3e5ce8[_0xb814('0x1a')])[_0xb814('0xa')](respondWithResult(_0xee204,null))[_0xb814('0xe')](handleError(_0xee204,null));};exports[_0xb814('0x53')]=function(_0x555be0,_0x5dedd7){return respondWithRpcPromise(_0xb814('0x54'),_0x555be0[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5dedd7,null))[_0xb814('0xe')](handleError(_0x5dedd7,null));};exports[_0xb814('0x55')]=function(_0xe5fc12,_0x34a0b3){return respondWithRpcPromise(_0xb814('0x56'),_0xe5fc12[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x34a0b3,null))[_0xb814('0xe')](handleError(_0x34a0b3,null));};exports[_0xb814('0x57')]=function(_0x3ef474,_0x21fc41){return respondWithRpcPromise(_0xb814('0x58'),_0x3ef474['query'],routingClient)[_0xb814('0xa')](respondWithResult(_0x21fc41,null))[_0xb814('0xe')](handleError(_0x21fc41,null));};exports[_0xb814('0x59')]=function(_0x357b90,_0xec821a){return respondWithRpcPromise(_0xb814('0x58'),_0x357b90['query'],routingClient)[_0xb814('0xa')](function(_0x52e1fc){if(_0x357b90[_0xb814('0x1a')][_0xb814('0x5a')]!==undefined){var _0x3c5a58=_(_0x52e1fc[_0xb814('0x16')])[_0xb814('0x5b')]([_0x357b90['query']['type'],_0x357b90[_0xb814('0x1b')]['id']])[_0xb814('0x5c')](_0xb814('0x5d'))[_0xb814('0x5e')]()['value']();return _0x52e1fc[_0xb814('0x16')]['filter'](function(_0x39073c){return _0x3c5a58[_0xb814('0x5f')](_0x39073c['queue_id'])>-0x1;});}else{return _0x52e1fc['rows'][_0xb814('0x5b')](function(_0x52e17a){return _0x52e17a[_0xb814('0x5d')]===parseInt(_0x357b90[_0xb814('0x1b')]['id']);});}})[_0xb814('0xa')](respondWithResult(_0xec821a,null))[_0xb814('0xe')](handleError(_0xec821a,null));};exports[_0xb814('0x60')]=function(_0x420bde,_0x40fe4a){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x420bde[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x40fe4a,null))[_0xb814('0xe')](handleError(_0x40fe4a,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2838cb,_0x43ee60){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2838cb[_0xb814('0x1a')],routingClient)['then'](respondWithResult(_0x43ee60,null))[_0xb814('0xe')](handleError(_0x43ee60,null));};exports[_0xb814('0x61')]=function(_0x4e15c2,_0x5a0c4a){return respondWithRpcPromise(_0xb814('0x62'),_0x4e15c2[_0xb814('0x1a')],routingClient)[_0xb814('0xa')](respondWithResult(_0x5a0c4a,null))[_0xb814('0xe')](handleError(_0x5a0c4a,null));};exports[_0xb814('0x63')]=function(_0x4394da){return function(_0x2b12a9,_0x314600){var _0x8cb107,_0x34f49c;var _0x53e705=_['capitalize'](_0x4394da);var _0x5bee4d=_0x4394da==='chat'?'Website':_0xb814('0x64');return db[_0x53e705+_0xb814('0x65')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x2b12a9['params']['id']}})[_0xb814('0xa')](function(_0x1fb1ea){if(_[_0xb814('0x15')](_0x1fb1ea)){throw new Error(_0x53e705+_0xb814('0x67'));}_0x8cb107=_0x1fb1ea;return db[_0x53e705+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x2b12a9[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x53e705+'Interaction'],'as':_0xb814('0x6a')},{'model':db[_0x53e705+_0x5bee4d],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x30faa0){if(_['isNil'](_0x30faa0)){throw new Error(_0x53e705+_0xb814('0x6b'));}_0x34f49c=_0x30faa0;return _0x30faa0[_0xb814('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3037f2={'uniqueid':_0x4394da+'.'+_0x34f49c['id']+'.'+_0x34f49c[_0xb814('0x6a')]['id'],'FromUserId':_0x2b12a9['user']['id'],'type':'queue'};_0x3037f2[_0x53e705+_0xb814('0x6d')]=_0x34f49c['id'];_0x3037f2[_0x53e705+'InteractionId']=_0x34f49c[_0xb814('0x6a')]['id'];_0x3037f2[_0xb814('0x6e')+_0x53e705+_0x5bee4d+'Id']=_0x34f49c['Account']['id'];_0x3037f2['To'+_0x53e705+_0xb814('0x6f')]=_0x8cb107['id'];return db[_0x53e705+'TransferReport'][_0xb814('0x70')](_0x3037f2);})['then'](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x4394da,'interaction':_0x34f49c[_0xb814('0x6a')],'message':_0x34f49c,'account':_0x34f49c[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x72'),'appdata':_0x8cb107[_0xb814('0x13')]+','+(_0x34f49c[_0xb814('0x64')][_0xb814('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x314600,null))[_0xb814('0xe')](handleError(_0x314600,null));};};exports['agentNotify']=function(_0x511e03,_0x2d0061){var _0x8fbda1,_0x25d42d;if(_['isNil'](_0x511e03[_0xb814('0x22')]['channel'])){throw new Error(_0xb814('0x74'));}var _0x19d508=_0x511e03[_0xb814('0x22')][_0xb814('0x75')];var _0x4c8a00=_[_0xb814('0x76')](_0x19d508);var _0xc0ff3c=_0x19d508===_0xb814('0x77')?'Website':_0xb814('0x64');return db[_0xb814('0x78')][_0xb814('0x66')]({'raw':!![],'where':{'id':_0x511e03['params']['id'],'role':_0xb814('0x3c')}})[_0xb814('0xa')](function(_0x9dc06b){if(_[_0xb814('0x15')](_0x9dc06b)){throw new Error(_0xb814('0x79'));}_0x8fbda1=_0x9dc06b;return db[_0x4c8a00+_0xb814('0x68')][_0xb814('0x66')]({'where':{'id':_0x511e03[_0xb814('0x22')][_0xb814('0x69')]},'include':[{'model':db[_0x4c8a00+_0xb814('0x6a')],'as':_0xb814('0x6a')},{'model':db[_0x4c8a00+_0xc0ff3c],'as':_0xb814('0x64')}]});})[_0xb814('0xa')](function(_0x5b8d2e){if(_['isNil'](_0x5b8d2e)){throw new Error(_0x4c8a00+_0xb814('0x6b'));}_0x25d42d=_0x5b8d2e;return _0x5b8d2e['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xb814('0xa')](function(){var _0x3949fd={'uniqueid':_0x19d508+'.'+_0x25d42d['id']+'.'+_0x25d42d[_0xb814('0x6a')]['id'],'FromUserId':_0x511e03[_0xb814('0x2f')]['id'],'type':_0xb814('0x72'),'ToUserId':_0x8fbda1['id']};_0x3949fd[_0x4c8a00+_0xb814('0x6d')]=_0x25d42d['id'];_0x3949fd[_0x4c8a00+_0xb814('0x7a')]=_0x25d42d['Interaction']['id'];_0x3949fd['From'+_0x4c8a00+_0xc0ff3c+'Id']=_0x25d42d[_0xb814('0x64')]['id'];return db[_0x4c8a00+'TransferReport'][_0xb814('0x70')](_0x3949fd);})[_0xb814('0xa')](function(){return respondWithRpcPromise(_0xb814('0x71'),{'channel':_0x19d508,'interaction':_0x25d42d['Interaction'],'message':_0x25d42d,'account':_0x25d42d[_0xb814('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xb814('0x3c'),'appdata':_0x8fbda1[_0xb814('0x13')]+','+(_0x25d42d[_0xb814('0x64')][_0xb814('0x7b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb814('0xa')](respondWithResult(_0x2d0061,null))[_0xb814('0xe')](handleError(_0x2d0061,null));};
\ No newline at end of file
index 4208915..a04abea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ba=['get','/:id','isAuthenticated','show','run','post','create','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','index'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x57ba,0x1df));var _0xa57b=function(_0x112654,_0x60b3ce){_0x112654=_0x112654-0x0;var _0x515e85=_0x57ba[_0x112654];return _0x515e85;};'use strict';var multer=require('multer');var util=require(_0xa57b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa57b('0x1'));var router=express['Router']();var fs_extra=require(_0xa57b('0x2'));var auth=require(_0xa57b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa57b('0x4'));var controller=require(_0xa57b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xa57b('0x6')]);router[_0xa57b('0x7')](_0xa57b('0x8'),auth[_0xa57b('0x9')](),controller[_0xa57b('0xa')]);router[_0xa57b('0x7')]('/:id/run',auth[_0xa57b('0x9')](),controller[_0xa57b('0xb')]);router[_0xa57b('0xc')]('/',auth['isAuthenticated'](),controller[_0xa57b('0xd')]);router['put'](_0xa57b('0x8'),auth[_0xa57b('0x9')](),controller[_0xa57b('0xe')]);router[_0xa57b('0xf')](_0xa57b('0x8'),auth['isAuthenticated'](),controller[_0xa57b('0x10')]);module[_0xa57b('0x11')]=router;
\ No newline at end of file
+var _0x3bd1=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/run','run','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x3bd1,0x1ed));var _0x13bd=function(_0x345a33,_0x584099){_0x345a33=_0x345a33-0x0;var _0x273a5b=_0x3bd1[_0x345a33];return _0x273a5b;};'use strict';var multer=require(_0x13bd('0x0'));var util=require(_0x13bd('0x1'));var path=require(_0x13bd('0x2'));var timeout=require(_0x13bd('0x3'));var express=require(_0x13bd('0x4'));var router=express['Router']();var fs_extra=require(_0x13bd('0x5'));var auth=require(_0x13bd('0x6'));var interaction=require(_0x13bd('0x7'));var config=require(_0x13bd('0x8'));var controller=require('./schedule.controller');router[_0x13bd('0x9')]('/',auth[_0x13bd('0xa')](),controller[_0x13bd('0xb')]);router[_0x13bd('0x9')](_0x13bd('0xc'),auth[_0x13bd('0xa')](),controller['show']);router[_0x13bd('0x9')](_0x13bd('0xd'),auth[_0x13bd('0xa')](),controller[_0x13bd('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x13bd('0xf')]);router[_0x13bd('0x10')](_0x13bd('0xc'),auth[_0x13bd('0xa')](),controller[_0x13bd('0x11')]);router[_0x13bd('0x12')](_0x13bd('0xc'),auth[_0x13bd('0xa')](),controller[_0x13bd('0x13')]);module['exports']=router;
\ No newline at end of file
index f7059ca..cd457d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeee=['ENUM','quarters','months','weeks','days','minutes','csv','xlsx','custom','default','TEXT','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','INTEGER'];(function(_0x532b00,_0x4a0f5){var _0x19fef5=function(_0x165b5){while(--_0x165b5){_0x532b00['push'](_0x532b00['shift']());}};_0x19fef5(++_0x4a0f5);}(_0xaeee,0x1ec));var _0xeaee=function(_0x2e7764,_0x2b5511){_0x2e7764=_0x2e7764-0x0;var _0x16fd09=_0xaeee[_0x2e7764];return _0x16fd09;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeaee('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xeaee('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeaee('0x1')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xeaee('0x2')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xeaee('0x3')]('years',_0xeaee('0x4'),_0xeaee('0x5'),_0xeaee('0x6'),_0xeaee('0x7'),'hours',_0xeaee('0x8')),'allowNull':![],'defaultValue':_0xeaee('0x7')},'output':{'type':Sequelize[_0xeaee('0x3')](_0xeaee('0x9'),'pdf',_0xeaee('0xa')),'allowNull':![],'defaultValue':_0xeaee('0x9')},'type':{'type':Sequelize[_0xeaee('0x3')](_0xeaee('0xb'),_0xeaee('0xc')),'allowNull':![],'defaultValue':_0xeaee('0xb')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xeaee('0x0')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xeaee('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xeaee('0xe')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x35e9=['csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','years','quarters','months','weeks','days','minutes','ENUM','pdf','xlsx'];(function(_0x14e390,_0x56f605){var _0x1b2725=function(_0xed063f){while(--_0xed063f){_0x14e390['push'](_0x14e390['shift']());}};_0x1b2725(++_0x56f605);}(_0x35e9,0xc9));var _0x935e=function(_0x377b4c,_0x1ae421){_0x377b4c=_0x377b4c-0x0;var _0x47c9d4=_0x35e9[_0x377b4c];return _0x47c9d4;};'use strict';var Sequelize=require(_0x935e('0x0'));module[_0x935e('0x1')]={'name':{'type':Sequelize[_0x935e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x935e('0x2')]},'active':{'type':Sequelize[_0x935e('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x935e('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x935e('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x935e('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x935e('0x6'),_0x935e('0x7'),_0x935e('0x8'),_0x935e('0x9'),_0x935e('0xa'),'hours',_0x935e('0xb')),'allowNull':![],'defaultValue':_0x935e('0xa')},'output':{'type':Sequelize[_0x935e('0xc')]('csv',_0x935e('0xd'),_0x935e('0xe')),'allowNull':![],'defaultValue':_0x935e('0xf')},'type':{'type':Sequelize[_0x935e('0xc')]('custom','default'),'allowNull':![],'defaultValue':_0x935e('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x935e('0x11')]},'bcc':{'type':Sequelize[_0x935e('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x935e('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 120e735..806d965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d9e=['../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','map','Schedule','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x37f32d,_0x4b8438){var _0x41ca9f=function(_0xda289a){while(--_0xda289a){_0x37f32d['push'](_0x37f32d['shift']());}};_0x41ca9f(++_0x4b8438);}(_0x0d9e,0x193));var _0xe0d9=function(_0x392b33,_0x24abc7){_0x392b33=_0x392b33-0x0;var _0x1c6771=_0x0d9e[_0x392b33];return _0x1c6771;};'use strict';var emlformat=require(_0xe0d9('0x0'));var rimraf=require(_0xe0d9('0x1'));var zipdir=require(_0xe0d9('0x2'));var jsonpatch=require(_0xe0d9('0x3'));var rp=require('request-promise');var moment=require(_0xe0d9('0x4'));var BPromise=require(_0xe0d9('0x5'));var Mustache=require(_0xe0d9('0x6'));var util=require(_0xe0d9('0x7'));var path=require('path');var sox=require(_0xe0d9('0x8'));var csv=require(_0xe0d9('0x9'));var ejs=require(_0xe0d9('0xa'));var fs=require('fs');var fs_extra=require(_0xe0d9('0xb'));var _=require(_0xe0d9('0xc'));var squel=require(_0xe0d9('0xd'));var crypto=require(_0xe0d9('0xe'));var jsforce=require(_0xe0d9('0xf'));var deskjs=require(_0xe0d9('0x10'));var toCsv=require(_0xe0d9('0x9'));var querystring=require(_0xe0d9('0x11'));var Papa=require('papaparse');var Redis=require(_0xe0d9('0x12'));var authService=require(_0xe0d9('0x13'));var qs=require(_0xe0d9('0x14'));var as=require(_0xe0d9('0x15'));var hardwareService=require(_0xe0d9('0x16'));var logger=require(_0xe0d9('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0d9('0x18'));var db=require(_0xe0d9('0x19'))['db'];function respondWithStatusCode(_0x77ea96,_0x6ce65f){_0x6ce65f=_0x6ce65f||0xcc;return function(_0x30dcd1){if(_0x30dcd1){return _0x77ea96[_0xe0d9('0x1a')](_0x6ce65f);}return _0x77ea96[_0xe0d9('0x1b')](_0x6ce65f)[_0xe0d9('0x1c')]();};}function respondWithResult(_0x38cf48,_0xb80b95){_0xb80b95=_0xb80b95||0xc8;return function(_0x3f94bf){if(_0x3f94bf){return _0x38cf48['status'](_0xb80b95)[_0xe0d9('0x1d')](_0x3f94bf);}};}function respondWithFilteredResult(_0x3a74d9,_0x4d57e6){return function(_0x2063e0){if(_0x2063e0){var _0x18f19c=typeof _0x4d57e6[_0xe0d9('0x1e')]===_0xe0d9('0x1f')&&typeof _0x4d57e6[_0xe0d9('0x20')]===_0xe0d9('0x1f');var _0x1969e8=_0x2063e0['count'];var _0x5aa3b8=_0x18f19c?0x0:_0x4d57e6['offset'];var _0x525835=_0x18f19c?_0x2063e0[_0xe0d9('0x21')]:_0x4d57e6['offset']+_0x4d57e6[_0xe0d9('0x20')];var _0xf8ee04;if(_0x525835>=_0x1969e8){_0x525835=_0x1969e8;_0xf8ee04=0xc8;}else{_0xf8ee04=0xce;}_0x3a74d9[_0xe0d9('0x1b')](_0xf8ee04);return _0x3a74d9['set'](_0xe0d9('0x22'),_0x5aa3b8+'-'+_0x525835+'/'+_0x1969e8)['json'](_0x2063e0);}return null;};}function patchUpdates(_0x264627){return function(_0x36e435){try{jsonpatch[_0xe0d9('0x23')](_0x36e435,_0x264627,!![]);}catch(_0x337597){return BPromise[_0xe0d9('0x24')](_0x337597);}return _0x36e435[_0xe0d9('0x25')]();};}function saveUpdates(_0x215263,_0x485dbf){return function(_0x18f936){if(_0x18f936){return _0x18f936['update'](_0x215263)['then'](function(_0x3d0a31){return _0x3d0a31;});}return null;};}function removeEntity(_0x2d656c,_0x169755){return function(_0x15e7d0){if(_0x15e7d0){return _0x15e7d0[_0xe0d9('0x26')]()[_0xe0d9('0x27')](function(){var _0x78bf19=_0x15e7d0[_0xe0d9('0x28')]({'plain':!![]});var _0x3d258a=_0xe0d9('0x29');return db[_0xe0d9('0x2a')][_0xe0d9('0x26')]({'where':{'type':_0x3d258a,'resourceId':_0x78bf19['id']}})[_0xe0d9('0x27')](function(){return _0x15e7d0;});})['then'](function(){_0x2d656c[_0xe0d9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8d63,_0xcfe04a){return function(_0x25b2ce){if(!_0x25b2ce){_0x5d8d63[_0xe0d9('0x1a')](0x194);}return _0x25b2ce;};}function handleError(_0x4b86e8,_0x1d86a0){_0x1d86a0=_0x1d86a0||0x1f4;return function(_0x5d99fd){logger[_0xe0d9('0x2b')](_0x5d99fd[_0xe0d9('0x2c')]);if(_0x5d99fd[_0xe0d9('0x2d')]){delete _0x5d99fd['name'];}_0x4b86e8[_0xe0d9('0x1b')](_0x1d86a0)['send'](_0x5d99fd);};}exports['index']=function(_0x30945c,_0x3a731d){var _0x381e49={},_0x56fe97={},_0x42d2b7={'count':0x0,'rows':[]};var _0x447e11=_[_0xe0d9('0x2e')](db[_0xe0d9('0x2f')][_0xe0d9('0x30')],function(_0x19cff8){return{'name':_0x19cff8['fieldName'],'type':_0x19cff8['type'][_0xe0d9('0x31')]};});_0x56fe97['model']=_['map'](_0x447e11,'name');_0x56fe97[_0xe0d9('0x32')]=_[_0xe0d9('0x33')](_0x30945c['query']);_0x56fe97[_0xe0d9('0x34')]=_[_0xe0d9('0x35')](_0x56fe97[_0xe0d9('0x36')],_0x56fe97['query']);_0x381e49[_0xe0d9('0x37')]=_[_0xe0d9('0x35')](_0x56fe97['model'],qs[_0xe0d9('0x38')](_0x30945c[_0xe0d9('0x32')]['fields']));_0x381e49['attributes']=_0x381e49[_0xe0d9('0x37')][_0xe0d9('0x39')]?_0x381e49[_0xe0d9('0x37')]:_0x56fe97['model'];if(!_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x3a')]('nolimit')){_0x381e49['limit']=qs[_0xe0d9('0x20')](_0x30945c['query'][_0xe0d9('0x20')]);_0x381e49[_0xe0d9('0x1e')]=qs[_0xe0d9('0x1e')](_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x1e')]);}_0x381e49[_0xe0d9('0x3b')]=qs[_0xe0d9('0x3c')](_0x30945c[_0xe0d9('0x32')]['sort']);_0x381e49[_0xe0d9('0x3d')]=qs[_0xe0d9('0x34')](_[_0xe0d9('0x3e')](_0x30945c[_0xe0d9('0x32')],_0x56fe97[_0xe0d9('0x34')]),_0x447e11);if(_0x30945c['query']['filter']){_0x381e49[_0xe0d9('0x3d')]=_[_0xe0d9('0x3f')](_0x381e49[_0xe0d9('0x3d')],{'$or':_[_0xe0d9('0x2e')](_0x447e11,function(_0xb7eec2){if(_0xb7eec2[_0xe0d9('0x40')]!==_0xe0d9('0x41')){var _0x5571b0={};_0x5571b0[_0xb7eec2[_0xe0d9('0x2d')]]={'$like':'%'+_0x30945c[_0xe0d9('0x32')]['filter']+'%'};return _0x5571b0;}})});}_0x381e49=_[_0xe0d9('0x3f')]({},_0x381e49,_0x30945c['options']);var _0x1cab24={'where':_0x381e49[_0xe0d9('0x3d')]};return db['Schedule']['count'](_0x1cab24)[_0xe0d9('0x27')](function(_0xb8387d){_0x42d2b7[_0xe0d9('0x21')]=_0xb8387d;if(_0x30945c[_0xe0d9('0x32')][_0xe0d9('0x42')]){_0x381e49[_0xe0d9('0x43')]=[{'all':!![]}];}return db[_0xe0d9('0x2f')]['findAll'](_0x381e49);})['then'](function(_0x163440){_0x42d2b7[_0xe0d9('0x44')]=_0x163440;return _0x42d2b7;})['then'](respondWithFilteredResult(_0x3a731d,_0x381e49))[_0xe0d9('0x45')](handleError(_0x3a731d,null));};exports[_0xe0d9('0x46')]=function(_0x242736,_0x384584){var _0x4d1040={'raw':![],'where':{'id':_0x242736[_0xe0d9('0x47')]['id']}},_0x4964d9={};_0x4964d9[_0xe0d9('0x36')]=_[_0xe0d9('0x33')](db['Schedule'][_0xe0d9('0x30')]);_0x4964d9[_0xe0d9('0x32')]=_[_0xe0d9('0x33')](_0x242736[_0xe0d9('0x32')]);_0x4964d9[_0xe0d9('0x34')]=_['intersection'](_0x4964d9[_0xe0d9('0x36')],_0x4964d9[_0xe0d9('0x32')]);_0x4d1040['attributes']=_[_0xe0d9('0x35')](_0x4964d9[_0xe0d9('0x36')],qs[_0xe0d9('0x38')](_0x242736[_0xe0d9('0x32')][_0xe0d9('0x38')]));_0x4d1040[_0xe0d9('0x37')]=_0x4d1040[_0xe0d9('0x37')][_0xe0d9('0x39')]?_0x4d1040['attributes']:_0x4964d9[_0xe0d9('0x36')];if(_0x242736[_0xe0d9('0x32')][_0xe0d9('0x42')]){_0x4d1040[_0xe0d9('0x43')]=[{'all':!![]}];}_0x4d1040=_[_0xe0d9('0x3f')]({},_0x4d1040,_0x242736[_0xe0d9('0x48')]);return db['Schedule']['find'](_0x4d1040)[_0xe0d9('0x27')](handleEntityNotFound(_0x384584,null))[_0xe0d9('0x27')](respondWithResult(_0x384584,null))[_0xe0d9('0x45')](handleError(_0x384584,null));};exports['create']=function(_0x15f88d,_0x513e4d){return db[_0xe0d9('0x2f')][_0xe0d9('0x49')](_0x15f88d[_0xe0d9('0x4a')],{})[_0xe0d9('0x27')](function(_0x1076b8){var _0x550f8a=_0x15f88d[_0xe0d9('0x4b')]['get']({'plain':!![]});if(!_0x550f8a)throw new Error(_0xe0d9('0x4c'));if(_0x550f8a['role']===_0xe0d9('0x4b')){var _0xf332d0=_0x1076b8[_0xe0d9('0x28')]({'plain':!![]});var _0x38e292=_0xe0d9('0x29');return db[_0xe0d9('0x4d')][_0xe0d9('0x4e')]({'where':{'name':_0x38e292,'userProfileId':_0x550f8a[_0xe0d9('0x4f')]},'raw':!![]})[_0xe0d9('0x27')](function(_0x2bc8b3){if(_0x2bc8b3&&_0x2bc8b3[_0xe0d9('0x50')]===0x0){return db['UserProfileResource'][_0xe0d9('0x49')]({'name':_0xf332d0[_0xe0d9('0x2d')],'resourceId':_0xf332d0['id'],'type':_0x2bc8b3[_0xe0d9('0x2d')],'sectionId':_0x2bc8b3['id']},{})[_0xe0d9('0x27')](function(){return _0x1076b8;});}else{return _0x1076b8;}})[_0xe0d9('0x45')](function(_0x3f8286){logger[_0xe0d9('0x2b')](_0xe0d9('0x51'),_0x3f8286);throw _0x3f8286;});}return _0x1076b8;})[_0xe0d9('0x27')](respondWithResult(_0x513e4d,0xc9))['catch'](handleError(_0x513e4d,null));};exports[_0xe0d9('0x52')]=function(_0xb6de01,_0x10c87b){if(_0xb6de01[_0xe0d9('0x4a')]['id']){delete _0xb6de01[_0xe0d9('0x4a')]['id'];}return db[_0xe0d9('0x2f')][_0xe0d9('0x4e')]({'where':{'id':_0xb6de01[_0xe0d9('0x47')]['id']}})[_0xe0d9('0x27')](handleEntityNotFound(_0x10c87b,null))[_0xe0d9('0x27')](saveUpdates(_0xb6de01[_0xe0d9('0x4a')],null))[_0xe0d9('0x27')](respondWithResult(_0x10c87b,null))[_0xe0d9('0x45')](handleError(_0x10c87b,null));};exports['destroy']=function(_0x2d08e,_0x4635fc){return db['Schedule'][_0xe0d9('0x4e')]({'where':{'id':_0x2d08e['params']['id']}})['then'](handleEntityNotFound(_0x4635fc,null))[_0xe0d9('0x27')](removeEntity(_0x4635fc,null))['catch'](handleError(_0x4635fc,null));};exports['run']=function(_0x25fe49,_0x206740,_0x1f564d){var _0x116f2c=require(_0xe0d9('0x53'));return db[_0xe0d9('0x2f')]['find']({'where':{'id':_0x25fe49['params']['id']},'raw':!![]})[_0xe0d9('0x27')](handleEntityNotFound(_0x206740,null))[_0xe0d9('0x27')](function(){_0x116f2c[_0xe0d9('0x54')](_0x25fe49[_0xe0d9('0x47')]['id']);})['then'](respondWithStatusCode(_0x206740,null))[_0xe0d9('0x45')](handleError(_0x206740,null));};
\ No newline at end of file
+var _0x202a=['user','role','UserProfileSection','userProfileId','body','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','Scheduler','error','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Schedule','rows','catch','show','params','find','create'];(function(_0x3d6d95,_0x95d623){var _0xdddc98=function(_0x51641b){while(--_0x51641b){_0x3d6d95['push'](_0x3d6d95['shift']());}};_0xdddc98(++_0x95d623);}(_0x202a,0xb1));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa202('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa202('0x1'));var jsonpatch=require(_0xa202('0x2'));var rp=require(_0xa202('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa202('0x4'));var path=require(_0xa202('0x5'));var sox=require(_0xa202('0x6'));var csv=require(_0xa202('0x7'));var ejs=require(_0xa202('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa202('0x9'));var squel=require(_0xa202('0xa'));var crypto=require(_0xa202('0xb'));var jsforce=require(_0xa202('0xc'));var deskjs=require(_0xa202('0xd'));var toCsv=require(_0xa202('0x7'));var querystring=require(_0xa202('0xe'));var Papa=require(_0xa202('0xf'));var Redis=require(_0xa202('0x10'));var authService=require(_0xa202('0x11'));var qs=require(_0xa202('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa202('0x13'));var logger=require(_0xa202('0x14'))(_0xa202('0x15'));var utils=require(_0xa202('0x16'));var config=require(_0xa202('0x17'));var licenseUtil=require(_0xa202('0x18'));var db=require(_0xa202('0x19'))['db'];function respondWithStatusCode(_0x37f395,_0x173bf3){_0x173bf3=_0x173bf3||0xcc;return function(_0x5988fa){if(_0x5988fa){return _0x37f395[_0xa202('0x1a')](_0x173bf3);}return _0x37f395['status'](_0x173bf3)[_0xa202('0x1b')]();};}function respondWithResult(_0x3ee563,_0x2feeca){_0x2feeca=_0x2feeca||0xc8;return function(_0x40f046){if(_0x40f046){return _0x3ee563[_0xa202('0x1c')](_0x2feeca)[_0xa202('0x1d')](_0x40f046);}};}function respondWithFilteredResult(_0x48dbcb,_0x58fafa){return function(_0x232ebb){if(_0x232ebb){var _0x405a2c=typeof _0x58fafa[_0xa202('0x1e')]===_0xa202('0x1f')&&typeof _0x58fafa['limit']===_0xa202('0x1f');var _0x1d260e=_0x232ebb['count'];var _0x457b9c=_0x405a2c?0x0:_0x58fafa[_0xa202('0x1e')];var _0x40a4d9=_0x405a2c?_0x232ebb[_0xa202('0x20')]:_0x58fafa[_0xa202('0x1e')]+_0x58fafa['limit'];var _0x672de8;if(_0x40a4d9>=_0x1d260e){_0x40a4d9=_0x1d260e;_0x672de8=0xc8;}else{_0x672de8=0xce;}_0x48dbcb['status'](_0x672de8);return _0x48dbcb[_0xa202('0x21')](_0xa202('0x22'),_0x457b9c+'-'+_0x40a4d9+'/'+_0x1d260e)[_0xa202('0x1d')](_0x232ebb);}return null;};}function patchUpdates(_0x5ba571){return function(_0x240191){try{jsonpatch[_0xa202('0x23')](_0x240191,_0x5ba571,!![]);}catch(_0x11c4f9){return BPromise['reject'](_0x11c4f9);}return _0x240191[_0xa202('0x24')]();};}function saveUpdates(_0x3be991,_0x1d0170){return function(_0x51ceef){if(_0x51ceef){return _0x51ceef[_0xa202('0x25')](_0x3be991)['then'](function(_0x585ae9){return _0x585ae9;});}return null;};}function removeEntity(_0x27e6fd,_0x338423){return function(_0x40827b){if(_0x40827b){return _0x40827b[_0xa202('0x26')]()[_0xa202('0x27')](function(){var _0x4b59cf=_0x40827b[_0xa202('0x28')]({'plain':!![]});var _0xe3a923=_0xa202('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0xe3a923,'resourceId':_0x4b59cf['id']}})[_0xa202('0x27')](function(){return _0x40827b;});})[_0xa202('0x27')](function(){_0x27e6fd[_0xa202('0x1c')](0xcc)[_0xa202('0x1b')]();});}};}function handleEntityNotFound(_0x948df5,_0x1d90b1){return function(_0x1ee4af){if(!_0x1ee4af){_0x948df5[_0xa202('0x1a')](0x194);}return _0x1ee4af;};}function handleError(_0x3f7a4c,_0x54f5cd){_0x54f5cd=_0x54f5cd||0x1f4;return function(_0x147d85){logger[_0xa202('0x2a')](_0x147d85['stack']);if(_0x147d85['name']){delete _0x147d85['name'];}_0x3f7a4c[_0xa202('0x1c')](_0x54f5cd)[_0xa202('0x2b')](_0x147d85);};}exports['index']=function(_0xcedb71,_0x14f222){var _0x28f21d={},_0x4daa51={},_0x44642b={'count':0x0,'rows':[]};var _0x58c9f9=_[_0xa202('0x2c')](db['Schedule'][_0xa202('0x2d')],function(_0x2ec9a0){return{'name':_0x2ec9a0[_0xa202('0x2e')],'type':_0x2ec9a0[_0xa202('0x2f')][_0xa202('0x30')]};});_0x4daa51[_0xa202('0x31')]=_['map'](_0x58c9f9,_0xa202('0x32'));_0x4daa51[_0xa202('0x33')]=_[_0xa202('0x34')](_0xcedb71[_0xa202('0x33')]);_0x4daa51[_0xa202('0x35')]=_[_0xa202('0x36')](_0x4daa51[_0xa202('0x31')],_0x4daa51['query']);_0x28f21d['attributes']=_[_0xa202('0x36')](_0x4daa51[_0xa202('0x31')],qs[_0xa202('0x37')](_0xcedb71[_0xa202('0x33')][_0xa202('0x37')]));_0x28f21d[_0xa202('0x38')]=_0x28f21d[_0xa202('0x38')][_0xa202('0x39')]?_0x28f21d[_0xa202('0x38')]:_0x4daa51[_0xa202('0x31')];if(!_0xcedb71[_0xa202('0x33')][_0xa202('0x3a')](_0xa202('0x3b'))){_0x28f21d[_0xa202('0x3c')]=qs[_0xa202('0x3c')](_0xcedb71[_0xa202('0x33')][_0xa202('0x3c')]);_0x28f21d[_0xa202('0x1e')]=qs['offset'](_0xcedb71[_0xa202('0x33')][_0xa202('0x1e')]);}_0x28f21d[_0xa202('0x3d')]=qs[_0xa202('0x3e')](_0xcedb71['query'][_0xa202('0x3e')]);_0x28f21d[_0xa202('0x3f')]=qs[_0xa202('0x35')](_[_0xa202('0x40')](_0xcedb71[_0xa202('0x33')],_0x4daa51[_0xa202('0x35')]),_0x58c9f9);if(_0xcedb71[_0xa202('0x33')][_0xa202('0x41')]){_0x28f21d['where']=_[_0xa202('0x42')](_0x28f21d['where'],{'$or':_[_0xa202('0x2c')](_0x58c9f9,function(_0x302133){if(_0x302133[_0xa202('0x2f')]!==_0xa202('0x43')){var _0x16f507={};_0x16f507[_0x302133[_0xa202('0x32')]]={'$like':'%'+_0xcedb71[_0xa202('0x33')][_0xa202('0x41')]+'%'};return _0x16f507;}})});}_0x28f21d=_[_0xa202('0x42')]({},_0x28f21d,_0xcedb71[_0xa202('0x44')]);var _0x32ca7a={'where':_0x28f21d[_0xa202('0x3f')]};return db['Schedule'][_0xa202('0x20')](_0x32ca7a)[_0xa202('0x27')](function(_0x47d6e9){_0x44642b[_0xa202('0x20')]=_0x47d6e9;if(_0xcedb71[_0xa202('0x33')][_0xa202('0x45')]){_0x28f21d[_0xa202('0x46')]=[{'all':!![]}];}return db[_0xa202('0x47')]['findAll'](_0x28f21d);})['then'](function(_0x47511b){_0x44642b[_0xa202('0x48')]=_0x47511b;return _0x44642b;})[_0xa202('0x27')](respondWithFilteredResult(_0x14f222,_0x28f21d))[_0xa202('0x49')](handleError(_0x14f222,null));};exports[_0xa202('0x4a')]=function(_0x26d20f,_0x2433f9){var _0x3da437={'raw':![],'where':{'id':_0x26d20f[_0xa202('0x4b')]['id']}},_0xda8db3={};_0xda8db3['model']=_['keys'](db[_0xa202('0x47')]['rawAttributes']);_0xda8db3[_0xa202('0x33')]=_[_0xa202('0x34')](_0x26d20f[_0xa202('0x33')]);_0xda8db3['filters']=_[_0xa202('0x36')](_0xda8db3[_0xa202('0x31')],_0xda8db3[_0xa202('0x33')]);_0x3da437[_0xa202('0x38')]=_[_0xa202('0x36')](_0xda8db3[_0xa202('0x31')],qs[_0xa202('0x37')](_0x26d20f[_0xa202('0x33')][_0xa202('0x37')]));_0x3da437[_0xa202('0x38')]=_0x3da437[_0xa202('0x38')][_0xa202('0x39')]?_0x3da437[_0xa202('0x38')]:_0xda8db3[_0xa202('0x31')];if(_0x26d20f['query'][_0xa202('0x45')]){_0x3da437[_0xa202('0x46')]=[{'all':!![]}];}_0x3da437=_['merge']({},_0x3da437,_0x26d20f[_0xa202('0x44')]);return db[_0xa202('0x47')][_0xa202('0x4c')](_0x3da437)[_0xa202('0x27')](handleEntityNotFound(_0x2433f9,null))[_0xa202('0x27')](respondWithResult(_0x2433f9,null))[_0xa202('0x49')](handleError(_0x2433f9,null));};exports[_0xa202('0x4d')]=function(_0x8b936a,_0x59fdf6){return db['Schedule'][_0xa202('0x4d')](_0x8b936a['body'],{})['then'](function(_0x29b981){var _0x368cc0=_0x8b936a[_0xa202('0x4e')][_0xa202('0x28')]({'plain':!![]});if(!_0x368cc0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x368cc0[_0xa202('0x4f')]===_0xa202('0x4e')){var _0x4604e6=_0x29b981[_0xa202('0x28')]({'plain':!![]});var _0x55c950=_0xa202('0x29');return db[_0xa202('0x50')][_0xa202('0x4c')]({'where':{'name':_0x55c950,'userProfileId':_0x368cc0[_0xa202('0x51')]},'raw':!![]})['then'](function(_0x226d34){if(_0x226d34&&_0x226d34['autoAssociation']===0x0){return db['UserProfileResource'][_0xa202('0x4d')]({'name':_0x4604e6[_0xa202('0x32')],'resourceId':_0x4604e6['id'],'type':_0x226d34[_0xa202('0x32')],'sectionId':_0x226d34['id']},{})[_0xa202('0x27')](function(){return _0x29b981;});}else{return _0x29b981;}})['catch'](function(_0x134b8e){logger[_0xa202('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x134b8e);throw _0x134b8e;});}return _0x29b981;})[_0xa202('0x27')](respondWithResult(_0x59fdf6,0xc9))[_0xa202('0x49')](handleError(_0x59fdf6,null));};exports[_0xa202('0x25')]=function(_0x30cb05,_0x383248){if(_0x30cb05[_0xa202('0x52')]['id']){delete _0x30cb05[_0xa202('0x52')]['id'];}return db[_0xa202('0x47')][_0xa202('0x4c')]({'where':{'id':_0x30cb05[_0xa202('0x4b')]['id']}})[_0xa202('0x27')](handleEntityNotFound(_0x383248,null))['then'](saveUpdates(_0x30cb05['body'],null))[_0xa202('0x27')](respondWithResult(_0x383248,null))['catch'](handleError(_0x383248,null));};exports[_0xa202('0x26')]=function(_0xde1f8a,_0x51dd8d){return db[_0xa202('0x47')][_0xa202('0x4c')]({'where':{'id':_0xde1f8a[_0xa202('0x4b')]['id']}})[_0xa202('0x27')](handleEntityNotFound(_0x51dd8d,null))[_0xa202('0x27')](removeEntity(_0x51dd8d,null))[_0xa202('0x49')](handleError(_0x51dd8d,null));};exports[_0xa202('0x53')]=function(_0x3db665,_0x22ba57,_0x368ecd){var _0x1fa7f8=require(_0xa202('0x54'));return db[_0xa202('0x47')][_0xa202('0x4c')]({'where':{'id':_0x3db665[_0xa202('0x4b')]['id']},'raw':!![]})[_0xa202('0x27')](handleEntityNotFound(_0x22ba57,null))[_0xa202('0x27')](function(){_0x1fa7f8['run'](_0x3db665[_0xa202('0x4b')]['id']);})[_0xa202('0x27')](respondWithStatusCode(_0x22ba57,null))[_0xa202('0x49')](handleError(_0x22ba57,null));};
\ No newline at end of file
index eafab14..1e52e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfab=['exports','define','Schedule','tools_schedules','lodash','util','api','moment','path','rimraf','../../config/environment'];(function(_0x285af7,_0x1d36d0){var _0x1b4be2=function(_0x388654){while(--_0x388654){_0x285af7['push'](_0x285af7['shift']());}};_0x1b4be2(++_0x1d36d0);}(_0xbfab,0x12d));var _0xbbfa=function(_0x3ab353,_0x5d5283){_0x3ab353=_0x3ab353-0x0;var _0x1e2285=_0xbfab[_0x3ab353];return _0x1e2285;};'use strict';var _=require(_0xbbfa('0x0'));var util=require(_0xbbfa('0x1'));var logger=require('../../config/logger')(_0xbbfa('0x2'));var moment=require(_0xbbfa('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbfa('0x4'));var rimraf=require(_0xbbfa('0x5'));var config=require(_0xbbfa('0x6'));var attributes=require('./schedule.attributes');module[_0xbbfa('0x7')]=function(_0x3d7224,_0x591c16){return _0x3d7224[_0xbbfa('0x8')](_0xbbfa('0x9'),attributes,{'tableName':_0xbbfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8992=['Schedule','lodash','util','api','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x500324,_0x2d8314){var _0x41e58b=function(_0x5cd125){while(--_0x5cd125){_0x500324['push'](_0x500324['shift']());}};_0x41e58b(++_0x2d8314);}(_0x8992,0x182));var _0x2899=function(_0x2ab84c,_0x30ac94){_0x2ab84c=_0x2ab84c-0x0;var _0x2e85b0=_0x8992[_0x2ab84c];return _0x2e85b0;};'use strict';var _=require(_0x2899('0x0'));var util=require(_0x2899('0x1'));var logger=require('../../config/logger')(_0x2899('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2899('0x3'));var fs=require('fs');var path=require(_0x2899('0x4'));var rimraf=require(_0x2899('0x5'));var config=require(_0x2899('0x6'));var attributes=require(_0x2899('0x7'));module[_0x2899('0x8')]=function(_0x443b2a,_0x1da1f0){return _0x443b2a[_0x2899('0x9')](_0x2899('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c58dd3..6c90df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6035=['Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x6035,0x14b));var _0x5603=function(_0x515e2b,_0xb4a2b5){_0x515e2b=_0x515e2b-0x0;var _0xc74bef=_0x6035[_0x515e2b];return _0xc74bef;};'use strict';var _=require(_0x5603('0x0'));var util=require('util');var moment=require(_0x5603('0x1'));var BPromise=require('bluebird');var rs=require(_0x5603('0x2'));var fs=require('fs');var Redis=require(_0x5603('0x3'));var db=require(_0x5603('0x4'))['db'];var utils=require(_0x5603('0x5'));var logger=require(_0x5603('0x6'))(_0x5603('0x7'));var config=require('../../config/environment');var jayson=require(_0x5603('0x8'));var client=jayson[_0x5603('0x9')][_0x5603('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b2bd,_0x4debcb,_0x4af19f){return new BPromise(function(_0x55cd38,_0x251dde){return client[_0x5603('0xb')](_0x36b2bd,_0x4af19f)[_0x5603('0xc')](function(_0x4d372e){logger[_0x5603('0xd')](_0x5603('0xe'),_0x4debcb,_0x5603('0xf'));logger[_0x5603('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4debcb,_0x5603('0xf'),JSON[_0x5603('0x11')](_0x4d372e));if(_0x4d372e['error']){if(_0x4d372e[_0x5603('0x12')][_0x5603('0x13')]===0x1f4){logger[_0x5603('0x12')]('Schedule,\x20%s,\x20%s',_0x4debcb,_0x4d372e[_0x5603('0x12')]['message']);return _0x251dde(_0x4d372e['error'][_0x5603('0x14')]);}logger[_0x5603('0x12')](_0x5603('0xe'),_0x4debcb,_0x4d372e[_0x5603('0x12')][_0x5603('0x14')]);return _0x55cd38(_0x4d372e['error'][_0x5603('0x14')]);}else{logger['info'](_0x5603('0xe'),_0x4debcb,_0x5603('0xf'));_0x55cd38(_0x4d372e[_0x5603('0x15')][_0x5603('0x14')]);}})[_0x5603('0x16')](function(_0x1192a2){logger[_0x5603('0x12')](_0x5603('0xe'),_0x4debcb,_0x1192a2);_0x251dde(_0x1192a2);});});}
\ No newline at end of file
+var _0xc63e=['result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x4c06a3,_0x1e6b6f){var _0x7ff53c=function(_0x559eff){while(--_0x559eff){_0x4c06a3['push'](_0x4c06a3['shift']());}};_0x7ff53c(++_0x1e6b6f);}(_0xc63e,0xc7));var _0xec63=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xc63e[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0xec63('0x0'));var util=require(_0xec63('0x1'));var moment=require('moment');var BPromise=require(_0xec63('0x2'));var rs=require(_0xec63('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xec63('0x4'))['db'];var utils=require(_0xec63('0x5'));var logger=require(_0xec63('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xec63('0x7'));var client=jayson[_0xec63('0x8')][_0xec63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a3529,_0x20fd7d,_0x2240fd){return new BPromise(function(_0x4dd061,_0x4905ca){return client['request'](_0x3a3529,_0x2240fd)[_0xec63('0xa')](function(_0x17abad){logger['info'](_0xec63('0xb'),_0x20fd7d,_0xec63('0xc'));logger[_0xec63('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x20fd7d,_0xec63('0xc'),JSON['stringify'](_0x17abad));if(_0x17abad[_0xec63('0xe')]){if(_0x17abad[_0xec63('0xe')][_0xec63('0xf')]===0x1f4){logger[_0xec63('0xe')]('Schedule,\x20%s,\x20%s',_0x20fd7d,_0x17abad[_0xec63('0xe')][_0xec63('0x10')]);return _0x4905ca(_0x17abad['error'][_0xec63('0x10')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x20fd7d,_0x17abad[_0xec63('0xe')][_0xec63('0x10')]);return _0x4dd061(_0x17abad['error'][_0xec63('0x10')]);}else{logger['info'](_0xec63('0xb'),_0x20fd7d,_0xec63('0xc'));_0x4dd061(_0x17abad[_0xec63('0x11')]['message']);}})['catch'](function(_0xaf396a){logger[_0xec63('0xe')](_0xec63('0xb'),_0x20fd7d,_0xaf396a);_0x4905ca(_0xaf396a);});});}
\ No newline at end of file
index 231dbd9..ead5357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd0a=['show','/:id/download','download','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index'];(function(_0xdd8c4,_0x5aa244){var _0x353e7e=function(_0x2039b7){while(--_0x2039b7){_0xdd8c4['push'](_0xdd8c4['shift']());}};_0x353e7e(++_0x5aa244);}(_0xfd0a,0xe6));var _0xafd0=function(_0x1c4782,_0x1e01ba){_0x1c4782=_0x1c4782-0x0;var _0x254980=_0xfd0a[_0x1c4782];return _0x254980;};'use strict';var multer=require('multer');var util=require(_0xafd0('0x0'));var path=require(_0xafd0('0x1'));var timeout=require(_0xafd0('0x2'));var express=require(_0xafd0('0x3'));var router=express[_0xafd0('0x4')]();var fs_extra=require(_0xafd0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xafd0('0x6'));var config=require(_0xafd0('0x7'));var controller=require(_0xafd0('0x8'));router[_0xafd0('0x9')]('/',auth[_0xafd0('0xa')](),controller[_0xafd0('0xb')]);router[_0xafd0('0x9')]('/describe',auth[_0xafd0('0xa')](),controller['describe']);router['get']('/:id',auth[_0xafd0('0xa')](),controller[_0xafd0('0xc')]);router[_0xafd0('0x9')](_0xafd0('0xd'),auth[_0xafd0('0xa')](),controller[_0xafd0('0xe')]);router['post']('/',auth[_0xafd0('0xa')](),controller[_0xafd0('0xf')]);router[_0xafd0('0x10')]('/:id',auth[_0xafd0('0xa')](),controller[_0xafd0('0x11')]);router[_0xafd0('0x12')](_0xafd0('0x13'),auth['isAuthenticated'](),controller[_0xafd0('0x14')]);module[_0xafd0('0x15')]=router;
\ No newline at end of file
+var _0x32f4=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x32f4,0xd0));var _0x432f=function(_0x34d545,_0x376905){_0x34d545=_0x34d545-0x0;var _0x58b9b8=_0x32f4[_0x34d545];return _0x58b9b8;};'use strict';var multer=require(_0x432f('0x0'));var util=require('util');var path=require(_0x432f('0x1'));var timeout=require(_0x432f('0x2'));var express=require('express');var router=express[_0x432f('0x3')]();var fs_extra=require(_0x432f('0x4'));var auth=require(_0x432f('0x5'));var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller[_0x432f('0xb')]);router[_0x432f('0x9')](_0x432f('0xc'),auth[_0x432f('0xa')](),controller[_0x432f('0xd')]);router['get'](_0x432f('0xe'),auth[_0x432f('0xa')](),controller['show']);router['get'](_0x432f('0xf'),auth['isAuthenticated'](),controller[_0x432f('0x10')]);router[_0x432f('0x11')]('/',auth[_0x432f('0xa')](),controller[_0x432f('0x12')]);router[_0x432f('0x13')](_0x432f('0xe'),auth[_0x432f('0xa')](),controller[_0x432f('0x14')]);router[_0x432f('0x15')](_0x432f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x432f('0x16')]=router;
\ No newline at end of file
index 2cd9d9b..5cc5f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','toString','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','path','exports'];(function(_0x2ea73f,_0x3e4181){var _0x5ded6a=function(_0x559637){while(--_0x559637){_0x2ea73f['push'](_0x2ea73f['shift']());}};_0x5ded6a(++_0x3e4181);}(_0x36ee,0xe8));var _0xe36e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x36ee[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0xe36e('0x0'));var config=require('../../config/environment');module[_0xe36e('0x1')]={'format':{'type':Sequelize[_0xe36e('0x2')],'get':function(){return this[_0xe36e('0x3')](_0xe36e('0x4'))?path[_0xe36e('0x5')](this[_0xe36e('0x3')](_0xe36e('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xe36e('0x6')]},'channel':{'type':Sequelize[_0xe36e('0x6')]},'value':{'type':Sequelize[_0xe36e('0x6')],'set':function(_0x21be0b){var _0x1aa596=_0x21be0b['replace'](/\\/g,'/');this[_0xe36e('0x7')]('value',_0x1aa596);}},'rating':{'type':Sequelize[_0xe36e('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe36e('0x8')],'set':function(_0x46f239){this['setDataValue'](_0xe36e('0x9'),moment()['subtract'](_0x46f239,'ms'));this[_0xe36e('0x7')](_0xe36e('0xa'),moment());this[_0xe36e('0x7')](_0xe36e('0xb'),_0x46f239);}},'startedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x9')))[_0xe36e('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xe36e('0xe')]();}},'closedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0xa')))['format'](_0xe36e('0xf'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x10')))[_0xe36e('0xd')](_0xe36e('0xf'))[_0xe36e('0xe')]();}},'updatedAt':{'type':Sequelize[_0xe36e('0xc')],'get':function(){return moment(this[_0xe36e('0x3')](_0xe36e('0x11')))[_0xe36e('0xd')](_0xe36e('0xf'))['toString']();}}};
\ No newline at end of file
+var _0x793b=['value','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue'];(function(_0x4a93bb,_0x495404){var _0x208468=function(_0x1d82b7){while(--_0x1d82b7){_0x4a93bb['push'](_0x4a93bb['shift']());}};_0x208468(++_0x495404);}(_0x793b,0x189));var _0xb793=function(_0x36a08,_0x1fe46a){_0x36a08=_0x36a08-0x0;var _0x38c6bc=_0x793b[_0x36a08];return _0x38c6bc;};'use strict';var Sequelize=require(_0xb793('0x0'));var moment=require(_0xb793('0x1'));var path=require(_0xb793('0x2'));var config=require(_0xb793('0x3'));module[_0xb793('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb793('0x5')](_0xb793('0x6'))?path['extname'](this['getDataValue'](_0xb793('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb793('0x7')]},'channel':{'type':Sequelize[_0xb793('0x7')]},'value':{'type':Sequelize[_0xb793('0x7')],'set':function(_0x39f110){var _0x42d0c7=_0x39f110[_0xb793('0x8')](/\\/g,'/');this[_0xb793('0x9')](_0xb793('0x6'),_0x42d0c7);}},'rating':{'type':Sequelize[_0xb793('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb793('0xa')],'set':function(_0x22c9ea){this[_0xb793('0x9')](_0xb793('0xb'),moment()['subtract'](_0x22c9ea,'ms'));this[_0xb793('0x9')](_0xb793('0xc'),moment());this['setDataValue']('duration',_0x22c9ea);}},'startedAt':{'type':Sequelize[_0xb793('0xd')],'get':function(){return moment(this[_0xb793('0x5')]('startedAt'))[_0xb793('0xe')](_0xb793('0xf'))['toString']();}},'closedAt':{'type':Sequelize[_0xb793('0xd')],'get':function(){return moment(this[_0xb793('0x5')](_0xb793('0xc')))[_0xb793('0xe')](_0xb793('0xf'))[_0xb793('0x10')]();}},'createdAt':{'type':Sequelize[_0xb793('0xd')],'get':function(){return moment(this['getDataValue'](_0xb793('0x11')))['format']('MM-DD-YYYY\x20HH:mm')[_0xb793('0x10')]();}},'updatedAt':{'type':Sequelize[_0xb793('0xd')],'get':function(){return moment(this[_0xb793('0x5')](_0xb793('0x12')))[_0xb793('0xe')](_0xb793('0xf'))[_0xb793('0x10')]();}}};
\ No newline at end of file
index 96cf444..3df18b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['include','findAll','catch','show','fields','length','includeAll','find','create','body','duration','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xc2c1b0,_0x29309e){var _0x1d9013=function(_0x2e9946){while(--_0x2e9946){_0xc2c1b0['push'](_0xc2c1b0['shift']());}};_0x1d9013(++_0x29309e);}(_0xe14b,0x93));var _0xbe14=function(_0x517ae1,_0x176156){_0x517ae1=_0x517ae1-0x0;var _0x35d589=_0xe14b[_0x517ae1];return _0x35d589;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){_0x3d3608['status'](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x5fa043,_0x1ee9c1){return function(_0x39cc81){if(!_0x39cc81){_0x5fa043[_0xbe14('0x16')](0x194);}return _0x39cc81;};}function handleError(_0x2703f5,_0x55d001){_0x55d001=_0x55d001||0x1f4;return function(_0x1822e0){logger[_0xbe14('0x23')](_0x1822e0[_0xbe14('0x24')]);if(_0x1822e0[_0xbe14('0x25')]){delete _0x1822e0['name'];}_0x2703f5[_0xbe14('0x17')](_0x55d001)[_0xbe14('0x26')](_0x1822e0);};}exports['index']=function(_0x3c3613,_0x3b3e84){var _0x1c7cc7={},_0x19252f={},_0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x27')](db[_0xbe14('0x28')][_0xbe14('0x29')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x2a')],'type':_0x16a159[_0xbe14('0x2b')][_0xbe14('0x2c')]};});_0x19252f[_0xbe14('0x2d')]=_[_0xbe14('0x2e')](_[_0xbe14('0x27')](_0x36d4b2,_0xbe14('0x25')),[_0xbe14('0x2f')]);_0x19252f[_0xbe14('0x30')]=_[_0xbe14('0x31')](_0x3c3613['query']);_0x19252f[_0xbe14('0x32')]=_['intersection'](_0x19252f['model'],_0x19252f[_0xbe14('0x30')]);_0x1c7cc7['attributes']=_[_0xbe14('0x33')](_0x19252f[_0xbe14('0x2d')],qs['fields'](_0x3c3613['query']['fields']));_0x1c7cc7[_0xbe14('0x34')]=_0x1c7cc7[_0xbe14('0x34')]['length']?_0x1c7cc7[_0xbe14('0x34')]:_0x19252f[_0xbe14('0x2d')];if(!_0x3c3613[_0xbe14('0x30')][_0xbe14('0x35')](_0xbe14('0x36'))){_0x1c7cc7['limit']=qs['limit'](_0x3c3613[_0xbe14('0x30')]['limit']);_0x1c7cc7['offset']=qs['offset'](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x1c')]);}_0x1c7cc7[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x3c3613[_0xbe14('0x30')][_0xbe14('0x38')]);_0x1c7cc7[_0xbe14('0x39')]=qs[_0xbe14('0x32')](_[_0xbe14('0x3a')](_0x3c3613[_0xbe14('0x30')],_0x19252f[_0xbe14('0x32')]),_0x36d4b2);if(_0x3c3613[_0xbe14('0x30')]['filter']){_0x1c7cc7['where']=_[_0xbe14('0x3b')](_0x1c7cc7[_0xbe14('0x39')],{'$or':_[_0xbe14('0x27')](_0x36d4b2,function(_0x520e09){if(_0x520e09[_0xbe14('0x2b')]!==_0xbe14('0x3c')){var _0xeda70e={};_0xeda70e[_0x520e09[_0xbe14('0x25')]]={'$like':'%'+_0x3c3613[_0xbe14('0x30')][_0xbe14('0x3d')]+'%'};return _0xeda70e;}})});}_0x1c7cc7=_[_0xbe14('0x3b')]({},_0x1c7cc7,_0x3c3613[_0xbe14('0x3e')]);var _0x1b2608={'where':_0x1c7cc7['where']};return db[_0xbe14('0x28')][_0xbe14('0x1b')](_0x1b2608)[_0xbe14('0x22')](function(_0x1b3118){_0x34d648[_0xbe14('0x1b')]=_0x1b3118;if(_0x3c3613[_0xbe14('0x30')]['includeAll']){_0x1c7cc7[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x28')][_0xbe14('0x40')](_0x1c7cc7);})[_0xbe14('0x22')](function(_0x5cf713){_0x34d648['rows']=_0x5cf713;return _0x34d648;})[_0xbe14('0x22')](respondWithFilteredResult(_0x3b3e84,_0x1c7cc7))[_0xbe14('0x41')](handleError(_0x3b3e84,null));};exports[_0xbe14('0x42')]=function(_0x51c859,_0x5d5318){var _0x6b6aa8={'raw':![],'where':{'id':_0x51c859['params']['id']}},_0x59ae4d={};_0x59ae4d[_0xbe14('0x2d')]=_[_0xbe14('0x31')](db[_0xbe14('0x28')]['rawAttributes']);_0x59ae4d['query']=_['keys'](_0x51c859[_0xbe14('0x30')]);_0x59ae4d[_0xbe14('0x32')]=_[_0xbe14('0x33')](_0x59ae4d['model'],_0x59ae4d[_0xbe14('0x30')]);_0x6b6aa8[_0xbe14('0x34')]=_[_0xbe14('0x33')](_0x59ae4d[_0xbe14('0x2d')],qs['fields'](_0x51c859['query'][_0xbe14('0x43')]));_0x6b6aa8[_0xbe14('0x34')]=_0x6b6aa8[_0xbe14('0x34')][_0xbe14('0x44')]?_0x6b6aa8[_0xbe14('0x34')]:_0x59ae4d['model'];if(_0x51c859['query'][_0xbe14('0x45')]){_0x6b6aa8[_0xbe14('0x3f')]=[{'all':!![]}];}_0x6b6aa8=_[_0xbe14('0x3b')]({},_0x6b6aa8,_0x51c859[_0xbe14('0x3e')]);return db['ScreenRecording'][_0xbe14('0x46')](_0x6b6aa8)[_0xbe14('0x22')](handleEntityNotFound(_0x5d5318,null))['then'](respondWithResult(_0x5d5318,null))[_0xbe14('0x41')](handleError(_0x5d5318,null));};exports[_0xbe14('0x47')]=function(_0x2d6ee8,_0x36c20c){return db['ScreenRecording']['create'](_0x2d6ee8[_0xbe14('0x48')],{})[_0xbe14('0x22')](respondWithResult(_0x36c20c,0xc9))['catch'](handleError(_0x36c20c,null));};exports['update']=function(_0xca8cdb,_0x5d3726){if(_0xca8cdb[_0xbe14('0x48')]['id']){delete _0xca8cdb[_0xbe14('0x48')]['id'];}delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x49')];delete _0xca8cdb[_0xbe14('0x48')]['createdAt'];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4a')];delete _0xca8cdb[_0xbe14('0x48')][_0xbe14('0x4b')];return db[_0xbe14('0x28')]['find']({'where':{'id':_0xca8cdb[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x5d3726,null))[_0xbe14('0x22')](saveUpdates(_0xca8cdb[_0xbe14('0x48')],null))[_0xbe14('0x22')](respondWithResult(_0x5d3726,null))[_0xbe14('0x41')](handleError(_0x5d3726,null));};exports['describe']=function(_0x5aeea9,_0x3a49f7){return db[_0xbe14('0x28')][_0xbe14('0x4d')]()['then'](respondWithResult(_0x3a49f7,null))['catch'](handleError(_0x3a49f7,null));};exports[_0xbe14('0x4e')]=function(_0x134878,_0x50d78f,_0x339a86){var _0x32496a=require('../../components/encryptor');var _0x28f995=![];var _0x4a40d2={};if(_0x134878[_0xbe14('0x30')][_0xbe14('0x2b')]&&_0x134878[_0xbe14('0x30')]['type']===_0xbe14('0x4f')){_0x4a40d2[_0xbe14('0x4f')]=_0x134878['params']['id'];}else{_0x4a40d2['id']=_0x134878[_0xbe14('0x4c')]['id'];}return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':_0x4a40d2,'attributes':['id',_0xbe14('0x4b')],'raw':!![]})[_0xbe14('0x22')](handleEntityNotFound(_0x50d78f,null))['then'](function(_0x42a346){if(_0x42a346){var _0x34cd66=path[_0xbe14('0x50')](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x42a346[_0xbe14('0x4b')]);var _0x1dd6c7=util['format'](_0xbe14('0x53'),_0x34cd66);if(fs[_0xbe14('0x54')](_0x1dd6c7)){_0x28f995=!![];return _0x32496a[_0xbe14('0x55')](_0x1dd6c7,_0x34cd66,config[_0xbe14('0x56')][_0xbe14('0x57')])[_0xbe14('0x22')](function(){return _0x42a346;});}return _0x42a346;}})[_0xbe14('0x22')](function(_0x32df3c){if(_0x32df3c){var _0x285b6e=path[_0xbe14('0x50')](config[_0xbe14('0x51')],'server/files/screen_recordings',_0x32df3c['value']);if(!fs['existsSync'](_0x285b6e)){throw new db[(_0xbe14('0x58'))][(_0xbe14('0x59'))](_0xbe14('0x5a'));}if(_0x32df3c[_0xbe14('0x5b')]){return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,_0x32df3c[_0xbe14('0x5b')]+path[_0xbe14('0x5c')](_0x285b6e),function(){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}else{return _0x50d78f[_0xbe14('0x4e')](_0x285b6e,function(_0x451b0b){if(_0x28f995){fs[_0xbe14('0x5d')](_0x285b6e);}});}}})[_0xbe14('0x41')](function(_0x2088e4){if(_0x2088e4[_0xbe14('0x5e')]===_0xbe14('0x5a')){_0x50d78f[_0xbe14('0x17')](0x194)[_0xbe14('0x26')](_0xbe14('0x5f'));}else{return handleError(_0x50d78f,null);}});};exports[_0xbe14('0x60')]=function(_0x1a945b,_0x5f394c){return db[_0xbe14('0x28')][_0xbe14('0x46')]({'where':{'id':_0x1a945b[_0xbe14('0x4c')]['id']}})[_0xbe14('0x22')](function(_0x3ee6b7){if(_[_0xbe14('0x61')](_0x3ee6b7)){throw new ReferenceError(_0xbe14('0x62'));}return _0x3ee6b7;})[_0xbe14('0x22')](function(_0x23cb36){var _0x100d43=path['join'](config[_0xbe14('0x51')],_0xbe14('0x52'),_0x23cb36[_0xbe14('0x4b')]);logger[_0xbe14('0x63')](_0xbe14('0x64'),_0x100d43);if(!_['isNil'](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs['unlinkSync'](_0x100d43);}_0x100d43=_0x100d43+_0xbe14('0x67');if(!_[_0xbe14('0x61')](_0x23cb36[_0xbe14('0x4b')])&&fs[_0xbe14('0x54')](_0x100d43)){logger[_0xbe14('0x63')](_0xbe14('0x65')+_0x100d43+_0xbe14('0x66'));fs[_0xbe14('0x68')](_0x100d43);}return _0x23cb36;})['then'](function(_0x1bb588){if(!_0x1bb588)throw new InternalError();return _0x1bb588[_0xbe14('0x60')]();})[_0xbe14('0x22')](function(){_0x5f394c[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();})[_0xbe14('0x41')](handleError(_0x5f394c,null));};
\ No newline at end of file
+var _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x22f8c7,_0x265436){var _0x4e5fd1=function(_0x51d769){while(--_0x51d769){_0x22f8c7['push'](_0x22f8c7['shift']());}};_0x4e5fd1(++_0x265436);}(_0x8958,0x93));var _0x8895=function(_0x5b2763,_0x45372a){_0x5b2763=_0x5b2763-0x0;var _0x4ffc7f=_0x8958[_0x5b2763];return _0x4ffc7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));};
\ No newline at end of file
index 0c2cc8b..48d5828 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a8a=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','ScreenRecording','lodash'];(function(_0x35cde7,_0x6b3daa){var _0x3bd434=function(_0x5b0c22){while(--_0x5b0c22){_0x35cde7['push'](_0x35cde7['shift']());}};_0x3bd434(++_0x6b3daa);}(_0x6a8a,0x13a));var _0xa6a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a8a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6a8('0x0'));var util=require(_0xa6a8('0x1'));var logger=require(_0xa6a8('0x2'))('api');var moment=require(_0xa6a8('0x3'));var BPromise=require(_0xa6a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6a8('0x5'));var rimraf=require(_0xa6a8('0x6'));var config=require(_0xa6a8('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2c0805,_0x1af277){return _0x2c0805['define'](_0xa6a8('0x8'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3f1=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','screen_recordings','interactionid','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc3f1,0x197));var _0x1c3f=function(_0x4c2ed7,_0x483a27){_0x4c2ed7=_0x4c2ed7-0x0;var _0x1309a0=_0xc3f1[_0x4c2ed7];return _0x1309a0;};'use strict';var _=require(_0x1c3f('0x0'));var util=require(_0x1c3f('0x1'));var logger=require(_0x1c3f('0x2'))('api');var moment=require(_0x1c3f('0x3'));var BPromise=require(_0x1c3f('0x4'));var rp=require(_0x1c3f('0x5'));var fs=require('fs');var path=require(_0x1c3f('0x6'));var rimraf=require(_0x1c3f('0x7'));var config=require('../../config/environment');var attributes=require(_0x1c3f('0x8'));module[_0x1c3f('0x9')]=function(_0x3b5c8d,_0x14f4ff){return _0x3b5c8d['define']('ScreenRecording',attributes,{'tableName':_0x1c3f('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x1c3f('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index adc2233..5b36c3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4c9=['info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2566ee,_0x201011){var _0x2b7260=function(_0x3096ab){while(--_0x3096ab){_0x2566ee['push'](_0x2566ee['shift']());}};_0x2b7260(++_0x201011);}(_0xc4c9,0x11f));var _0x9c4c=function(_0x1b49de,_0x1bfacc){_0x1b49de=_0x1b49de-0x0;var _0x2763ae=_0xc4c9[_0x1b49de];return _0x2763ae;};'use strict';var _=require(_0x9c4c('0x0'));var util=require(_0x9c4c('0x1'));var moment=require('moment');var BPromise=require(_0x9c4c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c4c('0x3'))['db'];var utils=require(_0x9c4c('0x4'));var logger=require(_0x9c4c('0x5'))(_0x9c4c('0x6'));var config=require(_0x9c4c('0x7'));var jayson=require(_0x9c4c('0x8'));var client=jayson[_0x9c4c('0x9')][_0x9c4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21a0f1,_0x2ff1b7,_0x3a8c41){return new BPromise(function(_0x22c891,_0x2eab2b){return client[_0x9c4c('0xb')](_0x21a0f1,_0x3a8c41)[_0x9c4c('0xc')](function(_0x1071ce){logger[_0x9c4c('0xd')](_0x9c4c('0xe'),_0x2ff1b7,'request\x20sent');logger['debug'](_0x9c4c('0xf'),_0x2ff1b7,_0x9c4c('0x10'),JSON['stringify'](_0x1071ce));if(_0x1071ce['error']){if(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x12')]===0x1f4){logger['error'](_0x9c4c('0xe'),_0x2ff1b7,_0x1071ce['error'][_0x9c4c('0x13')]);return _0x2eab2b(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x13')]);}logger[_0x9c4c('0x11')](_0x9c4c('0xe'),_0x2ff1b7,_0x1071ce['error']['message']);return _0x22c891(_0x1071ce[_0x9c4c('0x11')][_0x9c4c('0x13')]);}else{logger[_0x9c4c('0xd')](_0x9c4c('0xe'),_0x2ff1b7,'request\x20sent');_0x22c891(_0x1071ce['result'][_0x9c4c('0x13')]);}})['catch'](function(_0x4cadd1){logger[_0x9c4c('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x2ff1b7,_0x4cadd1);_0x2eab2b(_0x4cadd1);});});}
\ No newline at end of file
+var _0x0381=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent'];(function(_0x24252f,_0xc37add){var _0x2f00b7=function(_0x2b4889){while(--_0x2b4889){_0x24252f['push'](_0x24252f['shift']());}};_0x2f00b7(++_0xc37add);}(_0x0381,0x13d));var _0x1038=function(_0x3c562d,_0x4e51b6){_0x3c562d=_0x3c562d-0x0;var _0x512bf1=_0x0381[_0x3c562d];return _0x512bf1;};'use strict';var _=require(_0x1038('0x0'));var util=require(_0x1038('0x1'));var moment=require('moment');var BPromise=require(_0x1038('0x2'));var rs=require(_0x1038('0x3'));var fs=require('fs');var Redis=require(_0x1038('0x4'));var db=require(_0x1038('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1038('0x6'))('rpc');var config=require(_0x1038('0x7'));var jayson=require(_0x1038('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3027fe,_0x13acd9,_0x2dee7d){return new BPromise(function(_0x1d227e,_0x28a312){return client[_0x1038('0x9')](_0x3027fe,_0x2dee7d)[_0x1038('0xa')](function(_0x5a9bef){logger[_0x1038('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x13acd9,_0x1038('0xc'));logger[_0x1038('0xd')](_0x1038('0xe'),_0x13acd9,_0x1038('0xc'),JSON[_0x1038('0xf')](_0x5a9bef));if(_0x5a9bef['error']){if(_0x5a9bef[_0x1038('0x10')][_0x1038('0x11')]===0x1f4){logger[_0x1038('0x10')](_0x1038('0x12'),_0x13acd9,_0x5a9bef[_0x1038('0x10')][_0x1038('0x13')]);return _0x28a312(_0x5a9bef[_0x1038('0x10')][_0x1038('0x13')]);}logger['error'](_0x1038('0x12'),_0x13acd9,_0x5a9bef['error'][_0x1038('0x13')]);return _0x1d227e(_0x5a9bef[_0x1038('0x10')][_0x1038('0x13')]);}else{logger[_0x1038('0xb')](_0x1038('0x12'),_0x13acd9,_0x1038('0xc'));_0x1d227e(_0x5a9bef[_0x1038('0x14')][_0x1038('0x13')]);}})[_0x1038('0x15')](function(_0x12d5f2){logger['error'](_0x1038('0x12'),_0x13acd9,_0x12d5f2);_0x28a312(_0x12d5f2);});});}
\ No newline at end of file
index 86da598..2b2ed94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee80=['extname','single','file','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','logo','originalname','post','diskStorage','join','root','server/files/images/logos/','format','%s%s','logologin'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xee80,0x10b));var _0x0ee8=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xee80[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require('multer');var util=require(_0x0ee8('0x0'));var path=require('path');var timeout=require(_0x0ee8('0x1'));var express=require(_0x0ee8('0x2'));var router=express[_0x0ee8('0x3')]();var fs_extra=require(_0x0ee8('0x4'));var auth=require(_0x0ee8('0x5'));var interaction=require(_0x0ee8('0x6'));var config=require(_0x0ee8('0x7'));var controller=require(_0x0ee8('0x8'));router[_0x0ee8('0x9')]('/',auth[_0x0ee8('0xa')](),controller[_0x0ee8('0xb')]);router[_0x0ee8('0x9')](_0x0ee8('0xc'),controller[_0x0ee8('0xd')]);router[_0x0ee8('0x9')](_0x0ee8('0xe'),controller['show']);router[_0x0ee8('0x9')](_0x0ee8('0xf'),controller[_0x0ee8('0x10')]);router[_0x0ee8('0x9')](_0x0ee8('0x11'),controller[_0x0ee8('0x12')]);router[_0x0ee8('0x9')](_0x0ee8('0x13'),controller[_0x0ee8('0x14')]);router[_0x0ee8('0x9')](_0x0ee8('0x15'),controller['getPreferred']);router[_0x0ee8('0x9')](_0x0ee8('0x16'),controller[_0x0ee8('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29c754,_0x4fdd12,_0x8c75e3){_0x8c75e3(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x49630b,_0x24508e,_0x431874){_0x431874(null,util['format']('%s%s',_0x0ee8('0x18'),path['extname'](_0x24508e[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x0ee8('0x1b')]({'destination':function(_0x26ad28,_0x3dfe39,_0x273d00){_0x273d00(null,path[_0x0ee8('0x1c')](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x5218b0,_0x3dfb85,_0x4787cc){_0x4787cc(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x21'),path[_0x0ee8('0x22')](_0x3dfb85[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x11'),upload[_0x0ee8('0x23')](_0x0ee8('0x24')),controller[_0x0ee8('0x25')]);var upload=multer({'storage':multer[_0x0ee8('0x1b')]({'destination':function(_0xe2cb30,_0x5effdb,_0x5617e9){_0x5617e9(null,path['join'](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x495518,_0xb515f9,_0x14eada){_0x14eada(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x26'),path['extname'](_0xb515f9['originalname'])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x15'),upload[_0x0ee8('0x23')]('file'),controller[_0x0ee8('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x472105,_0x382cd9,_0x24165b){_0x24165b(null,path[_0x0ee8('0x1c')](config[_0x0ee8('0x1d')],_0x0ee8('0x1e')));},'filename':function(_0x3b3fdd,_0x1aa119,_0x50b5e6){_0x50b5e6(null,util[_0x0ee8('0x1f')](_0x0ee8('0x20'),_0x0ee8('0x28'),path[_0x0ee8('0x22')](_0x1aa119[_0x0ee8('0x19')])));}})});router[_0x0ee8('0x1a')](_0x0ee8('0x16'),upload['single'](_0x0ee8('0x24')),controller[_0x0ee8('0x29')]);router[_0x0ee8('0x2a')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x2e6a=['extname','/:id/logo_login','addLogoLogin','preferred','post','addPreferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./setting.controller','get','isAuthenticated','getDate','/:id','show','/:id/logo','getLogo','getLogoLogin','/:id/gdpr','gdpr','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','format','logo','originalname','single','file','addLogo','%s%s'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x2e6a,0x8d));var _0xa2e6=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x2e6a[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0xa2e6('0x0'));var util=require(_0xa2e6('0x1'));var path=require(_0xa2e6('0x2'));var timeout=require(_0xa2e6('0x3'));var express=require('express');var router=express[_0xa2e6('0x4')]();var fs_extra=require(_0xa2e6('0x5'));var auth=require(_0xa2e6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa2e6('0x7'));router[_0xa2e6('0x8')]('/',auth[_0xa2e6('0x9')](),controller['index']);router['get']('/now',controller[_0xa2e6('0xa')]);router[_0xa2e6('0x8')](_0xa2e6('0xb'),controller[_0xa2e6('0xc')]);router[_0xa2e6('0x8')](_0xa2e6('0xd'),controller[_0xa2e6('0xe')]);router[_0xa2e6('0x8')]('/:id/logo_login',controller[_0xa2e6('0xf')]);router['get'](_0xa2e6('0x10'),controller[_0xa2e6('0x11')]);router[_0xa2e6('0x8')]('/:id/preferred',controller[_0xa2e6('0x12')]);router['get']('/:id/favicon',controller[_0xa2e6('0x13')]);var upload=multer({'storage':multer[_0xa2e6('0x14')]({'destination':function(_0x825b74,_0x335013,_0x4db2e6){_0x4db2e6(null,path[_0xa2e6('0x15')](config[_0xa2e6('0x16')],_0xa2e6('0x17')));},'filename':function(_0x2314aa,_0x721671,_0x2bc60a){_0x2bc60a(null,util[_0xa2e6('0x18')]('%s%s',_0xa2e6('0x19'),path['extname'](_0x721671[_0xa2e6('0x1a')])));}})});router['post']('/:id/logo',upload[_0xa2e6('0x1b')](_0xa2e6('0x1c')),controller[_0xa2e6('0x1d')]);var upload=multer({'storage':multer[_0xa2e6('0x14')]({'destination':function(_0x222c66,_0xf30acd,_0x856372){_0x856372(null,path[_0xa2e6('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x562ffe,_0x584a00,_0x39b65e){_0x39b65e(null,util[_0xa2e6('0x18')](_0xa2e6('0x1e'),'logologin',path[_0xa2e6('0x1f')](_0x584a00['originalname'])));}})});router['post'](_0xa2e6('0x20'),upload['single']('file'),controller[_0xa2e6('0x21')]);var upload=multer({'storage':multer[_0xa2e6('0x14')]({'destination':function(_0x74ff7c,_0x155036,_0xfdb6e7){_0xfdb6e7(null,path[_0xa2e6('0x15')](config['root'],_0xa2e6('0x17')));},'filename':function(_0x10b6cd,_0x408560,_0x456fe8){_0x456fe8(null,util[_0xa2e6('0x18')](_0xa2e6('0x1e'),_0xa2e6('0x22'),path[_0xa2e6('0x1f')](_0x408560['originalname'])));}})});router[_0xa2e6('0x23')]('/:id/preferred',upload['single'](_0xa2e6('0x1c')),controller[_0xa2e6('0x24')]);var upload=multer({'storage':multer[_0xa2e6('0x14')]({'destination':function(_0x50b70c,_0x5abd99,_0x44c2cb){_0x44c2cb(null,path['join'](config[_0xa2e6('0x16')],_0xa2e6('0x17')));},'filename':function(_0x1c9fb8,_0x3bc4ea,_0x2df7a2){_0x2df7a2(null,util[_0xa2e6('0x18')](_0xa2e6('0x1e'),_0xa2e6('0x25'),path[_0xa2e6('0x1f')](_0x3bc4ea[_0xa2e6('0x1a')])));}})});router['post'](_0xa2e6('0x26'),upload['single']('file'),controller[_0xa2e6('0x27')]);router[_0xa2e6('0x28')](_0xa2e6('0xb'),auth[_0xa2e6('0x9')](),controller[_0xa2e6('0x29')]);module[_0xa2e6('0x2a')]=router;
\ No newline at end of file
index e7088e5..2d193b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bed=['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','UNSIGNED'];(function(_0x1257e6,_0x40323a){var _0x5ec19f=function(_0x411d4b){while(--_0x411d4b){_0x1257e6['push'](_0x1257e6['shift']());}};_0x5ec19f(++_0x40323a);}(_0x3bed,0x11e));var _0xd3be=function(_0x39bdb2,_0x3344fd){_0x39bdb2=_0x39bdb2-0x0;var _0xf47719=_0x3bed[_0x39bdb2];return _0xf47719;};'use strict';var Sequelize=require(_0xd3be('0x0'));module[_0xd3be('0x1')]={'min_internal':{'type':Sequelize[_0xd3be('0x2')](0xb),'unique':_0xd3be('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xd3be('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xd3be('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xd3be('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xd3be('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xd3be('0x5')]},'turnaddr':{'type':Sequelize[_0xd3be('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xd3be('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xd3be('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x8')},'enableEmailPreview':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xd3be('0x5')],'defaultValue':_0xd3be('0x9')},'chatTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xd3be('0x5')]},'defaultPreferred':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xd3be('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xd3be('0x5')]},'defaultFavicon':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xd3be('0x2')]},'transcribeRegion':{'type':Sequelize[_0xd3be('0x5')]},'sentiment':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xd3be('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xd3be('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xd3be('0x2')](0x2)[_0xd3be('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xd3be('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0xd3be('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2879=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','min_mailbox','INTEGER','STRING','BOOLEAN'];(function(_0x4dfb7f,_0x5cf01f){var _0x144125=function(_0xbeb532){while(--_0xbeb532){_0x4dfb7f['push'](_0x4dfb7f['shift']());}};_0x144125(++_0x5cf01f);}(_0x2879,0x107));var _0x9287=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2879[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x9287('0x0'));module[_0x9287('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x9287('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x9287('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x9287('0x4')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x9287('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x9287('0x5')]},'defaultLogo':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x9287('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x9287('0x5')]},'turnaddr':{'type':Sequelize[_0x9287('0x5')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x9287('0x5')]},'pageTitle':{'type':Sequelize[_0x9287('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x9287('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x9287('0x4')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x9287('0x5')],'defaultValue':_0x9287('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x9287('0x5')],'defaultValue':_0x9287('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x9287('0x5')]},'defaultPreferred':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x9287('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x9287('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x9287('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x9287('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x9287('0x5')]},'sentiment':{'type':Sequelize[_0x9287('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x9287('0x4')]},'sentimentRegion':{'type':Sequelize[_0x9287('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x9287('0x4')](0x2)[_0x9287('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x9287('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x9287('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x9287('0x4')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'viewHelpSection':{'type':Sequelize[_0x9287('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index 2e6d2f5..5b08e75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1603=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','update','body','addLogo','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','default','upperFirst','custom','join','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','gdpr','addPreferred','server/files/images/logos','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','limit','count','set','apply','reject','save','destroy','sendStatus','stack','name','send','map','Setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1603,0x1b4));var _0x3160=function(_0x35dfae,_0xeb8092){_0x35dfae=_0x35dfae-0x0;var _0x28de7a=_0x1603[_0x35dfae];return _0x28de7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3160('0x0'));var zipdir=require(_0x3160('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3160('0x2'));var moment=require(_0x3160('0x3'));var BPromise=require(_0x3160('0x4'));var Mustache=require('mustache');var util=require(_0x3160('0x5'));var path=require('path');var sox=require(_0x3160('0x6'));var csv=require(_0x3160('0x7'));var ejs=require(_0x3160('0x8'));var fs=require('fs');var fs_extra=require(_0x3160('0x9'));var _=require(_0x3160('0xa'));var squel=require(_0x3160('0xb'));var crypto=require(_0x3160('0xc'));var jsforce=require(_0x3160('0xd'));var deskjs=require(_0x3160('0xe'));var toCsv=require(_0x3160('0x7'));var querystring=require(_0x3160('0xf'));var Papa=require(_0x3160('0x10'));var Redis=require(_0x3160('0x11'));var authService=require(_0x3160('0x12'));var qs=require(_0x3160('0x13'));var as=require(_0x3160('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3160('0x15'))(_0x3160('0x16'));var utils=require(_0x3160('0x17'));var config=require(_0x3160('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x3160('0x19'));var client=jayson[_0x3160('0x1a')][_0x3160('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ca22f,_0x3cd44a,_0x528e0e,_0x20b3b0){return new BPromise(function(_0x269325,_0x41ef02){var _0x31ab91=_0x20b3b0||client;return _0x31ab91['request'](_0x5ca22f,_0x528e0e)[_0x3160('0x1c')](function(_0x5eb8b1){logger[_0x3160('0x1d')](_0x3160('0x1e'),_0x3cd44a,_0x3160('0x1f'));logger[_0x3160('0x20')](_0x3160('0x21'),_0x3cd44a,_0x3160('0x1f'),JSON[_0x3160('0x22')](_0x5eb8b1));if(_0x5eb8b1['error']){if(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x24')]===0x1f4){logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);return _0x41ef02(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);}logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);return _0x269325(_0x5eb8b1[_0x3160('0x23')][_0x3160('0x25')]);}else{logger[_0x3160('0x1d')](_0x3160('0x1e'),_0x3cd44a,_0x3160('0x1f'));_0x269325(_0x5eb8b1['result'][_0x3160('0x25')]);}})[_0x3160('0x26')](function(_0x3a08ab){logger[_0x3160('0x23')](_0x3160('0x1e'),_0x3cd44a,_0x3a08ab);_0x41ef02(_0x3a08ab);});});}function respondWithStatusCode(_0x2821a0,_0xcb69bb){_0xcb69bb=_0xcb69bb||0xcc;return function(_0x227a38){if(_0x227a38){return _0x2821a0['sendStatus'](_0xcb69bb);}return _0x2821a0[_0x3160('0x27')](_0xcb69bb)[_0x3160('0x28')]();};}function respondWithResult(_0xe6dd7c,_0x6c4eeb){_0x6c4eeb=_0x6c4eeb||0xc8;return function(_0x36d175){if(_0x36d175){return _0xe6dd7c[_0x3160('0x27')](_0x6c4eeb)[_0x3160('0x29')](_0x36d175);}};}function respondWithFilteredResult(_0x28a69d,_0x570be0){return function(_0x1cf464){if(_0x1cf464){var _0x34343c=typeof _0x570be0[_0x3160('0x2a')]==='undefined'&&typeof _0x570be0[_0x3160('0x2b')]==='undefined';var _0xd20ef2=_0x1cf464[_0x3160('0x2c')];var _0x16eaee=_0x34343c?0x0:_0x570be0[_0x3160('0x2a')];var _0x521390=_0x34343c?_0x1cf464[_0x3160('0x2c')]:_0x570be0[_0x3160('0x2a')]+_0x570be0[_0x3160('0x2b')];var _0x27cd30;if(_0x521390>=_0xd20ef2){_0x521390=_0xd20ef2;_0x27cd30=0xc8;}else{_0x27cd30=0xce;}_0x28a69d[_0x3160('0x27')](_0x27cd30);return _0x28a69d[_0x3160('0x2d')]('Content-Range',_0x16eaee+'-'+_0x521390+'/'+_0xd20ef2)['json'](_0x1cf464);}return null;};}function patchUpdates(_0x2cc935){return function(_0x284838){try{jsonpatch[_0x3160('0x2e')](_0x284838,_0x2cc935,!![]);}catch(_0x3d8e2d){return BPromise[_0x3160('0x2f')](_0x3d8e2d);}return _0x284838[_0x3160('0x30')]();};}function saveUpdates(_0x73ba78,_0x42e04b){return function(_0x1b288e){if(_0x1b288e){return _0x1b288e['update'](_0x73ba78)['then'](function(_0x32a70c){return _0x32a70c;});}return null;};}function removeEntity(_0x45058e,_0x31bc8f){return function(_0x152721){if(_0x152721){return _0x152721[_0x3160('0x31')]()[_0x3160('0x1c')](function(){_0x45058e[_0x3160('0x27')](0xcc)[_0x3160('0x28')]();});}};}function handleEntityNotFound(_0x6c6eb5,_0x197d15){return function(_0x35f594){if(!_0x35f594){_0x6c6eb5[_0x3160('0x32')](0x194);}return _0x35f594;};}function handleError(_0x52fda8,_0x42f72d){_0x42f72d=_0x42f72d||0x1f4;return function(_0x255c29){logger[_0x3160('0x23')](_0x255c29[_0x3160('0x33')]);if(_0x255c29[_0x3160('0x34')]){delete _0x255c29[_0x3160('0x34')];}_0x52fda8['status'](_0x42f72d)[_0x3160('0x35')](_0x255c29);};}exports['index']=function(_0xd9b80a,_0x1b086a){var _0x10ee5f={},_0x563d44={},_0x27be57={'count':0x0,'rows':[]};var _0x11154b=_[_0x3160('0x36')](db[_0x3160('0x37')][_0x3160('0x38')],function(_0x29efdd){return{'name':_0x29efdd[_0x3160('0x39')],'type':_0x29efdd[_0x3160('0x3a')][_0x3160('0x3b')]};});_0x563d44[_0x3160('0x3c')]=_['map'](_0x11154b,_0x3160('0x34'));_0x563d44[_0x3160('0x3d')]=_[_0x3160('0x3e')](_0xd9b80a[_0x3160('0x3d')]);_0x563d44[_0x3160('0x3f')]=_[_0x3160('0x40')](_0x563d44[_0x3160('0x3c')],_0x563d44['query']);_0x10ee5f[_0x3160('0x41')]=_[_0x3160('0x40')](_0x563d44[_0x3160('0x3c')],qs[_0x3160('0x42')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x42')]));_0x10ee5f['attributes']=_0x10ee5f[_0x3160('0x41')]['length']?_0x10ee5f['attributes']:_0x563d44[_0x3160('0x3c')];if(!_0xd9b80a[_0x3160('0x3d')][_0x3160('0x43')]('nolimit')){_0x10ee5f[_0x3160('0x2b')]=qs[_0x3160('0x2b')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x2b')]);_0x10ee5f['offset']=qs[_0x3160('0x2a')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x2a')]);}_0x10ee5f[_0x3160('0x44')]=qs[_0x3160('0x45')](_0xd9b80a[_0x3160('0x3d')][_0x3160('0x45')]);_0x10ee5f[_0x3160('0x46')]=qs[_0x3160('0x3f')](_['pick'](_0xd9b80a[_0x3160('0x3d')],_0x563d44[_0x3160('0x3f')]),_0x11154b);if(_0xd9b80a['query'][_0x3160('0x47')]){_0x10ee5f[_0x3160('0x46')]=_['merge'](_0x10ee5f[_0x3160('0x46')],{'$or':_[_0x3160('0x36')](_0x11154b,function(_0x49aa50){if(_0x49aa50['type']!==_0x3160('0x48')){var _0x51e2e6={};_0x51e2e6[_0x49aa50[_0x3160('0x34')]]={'$like':'%'+_0xd9b80a[_0x3160('0x3d')][_0x3160('0x47')]+'%'};return _0x51e2e6;}})});}_0x10ee5f=_[_0x3160('0x49')]({},_0x10ee5f,_0xd9b80a[_0x3160('0x4a')]);var _0xd060de={'where':_0x10ee5f[_0x3160('0x46')]};return db[_0x3160('0x37')][_0x3160('0x2c')](_0xd060de)[_0x3160('0x1c')](function(_0x2f6e1f){_0x27be57[_0x3160('0x2c')]=_0x2f6e1f;if(_0xd9b80a[_0x3160('0x3d')][_0x3160('0x4b')]){_0x10ee5f[_0x3160('0x4c')]=[{'all':!![]}];}return db[_0x3160('0x37')][_0x3160('0x4d')](_0x10ee5f);})[_0x3160('0x1c')](function(_0x4a8cec){_0x27be57[_0x3160('0x4e')]=_0x4a8cec;return _0x27be57;})[_0x3160('0x1c')](respondWithFilteredResult(_0x1b086a,_0x10ee5f))[_0x3160('0x26')](handleError(_0x1b086a,null));};exports[_0x3160('0x4f')]=function(_0x457dcf,_0x16d172){var _0x599c33={'raw':![],'where':{'id':_0x457dcf[_0x3160('0x50')]['id']}},_0x329e0a={};_0x329e0a['model']=_[_0x3160('0x3e')](db[_0x3160('0x37')]['rawAttributes']);_0x329e0a[_0x3160('0x3d')]=_[_0x3160('0x3e')](_0x457dcf['query']);_0x329e0a[_0x3160('0x3f')]=_[_0x3160('0x40')](_0x329e0a[_0x3160('0x3c')],_0x329e0a['query']);_0x599c33[_0x3160('0x41')]=_[_0x3160('0x40')](_0x329e0a[_0x3160('0x3c')],qs['fields'](_0x457dcf[_0x3160('0x3d')][_0x3160('0x42')]));_0x599c33[_0x3160('0x41')]=_0x599c33[_0x3160('0x41')]['length']?_0x599c33['attributes']:_0x329e0a['model'];if(_0x457dcf[_0x3160('0x3d')][_0x3160('0x4b')]){_0x599c33[_0x3160('0x4c')]=[{'all':!![]}];}_0x599c33=_[_0x3160('0x49')]({},_0x599c33,_0x457dcf['options']);return db['Setting'][_0x3160('0x51')](_0x599c33)['then'](handleEntityNotFound(_0x16d172,null))[_0x3160('0x1c')](respondWithResult(_0x16d172,null))[_0x3160('0x26')](handleError(_0x16d172,null));};exports[_0x3160('0x52')]=function(_0x925e3c,_0x54e4fa){if(_0x925e3c[_0x3160('0x53')]['id']){delete _0x925e3c[_0x3160('0x53')]['id'];}return db[_0x3160('0x37')]['find']({'where':{'id':_0x925e3c[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x54e4fa,null))[_0x3160('0x1c')](saveUpdates(_0x925e3c[_0x3160('0x53')],null))[_0x3160('0x1c')](respondWithResult(_0x54e4fa,null))[_0x3160('0x26')](handleError(_0x54e4fa,null));};exports[_0x3160('0x54')]=function(_0x5c55c5,_0x6fe46a,_0x42e6b3){if(_0x5c55c5[_0x3160('0x55')]&&_0x5c55c5[_0x3160('0x55')]['filename']){_0x5c55c5[_0x3160('0x53')][_0x3160('0x56')]=_0x5c55c5[_0x3160('0x55')][_0x3160('0x57')];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x5c55c5[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x6fe46a,null))['then'](saveUpdates(_0x5c55c5[_0x3160('0x53')],null))[_0x3160('0x1c')](respondWithResult(_0x6fe46a,null))['catch'](handleError(_0x6fe46a,null));};exports[_0x3160('0x58')]=function(_0x31e03c,_0x236b34,_0x536a6c){if(_0x31e03c[_0x3160('0x55')]&&_0x31e03c[_0x3160('0x55')][_0x3160('0x57')]){_0x31e03c[_0x3160('0x53')][_0x3160('0x59')]=_0x31e03c['file'][_0x3160('0x57')];}return db[_0x3160('0x37')]['find']({'where':{'id':_0x31e03c[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x236b34,null))[_0x3160('0x1c')](saveUpdates(_0x31e03c[_0x3160('0x53')],null))['then'](respondWithResult(_0x236b34,null))['catch'](handleError(_0x236b34,null));};var utilLicense=require(_0x3160('0x5a'));exports['getLogo']=function(_0x3fda2b,_0x40eefe,_0x17d809){var _0x4a2771='server/files/images/logos';var _0x50bca9={'custom':![]};return utilLicense[_0x3160('0x5b')]()['then'](function(_0x26dda5){if(_0x26dda5){_0x50bca9=_0x26dda5;}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x3fda2b['params']['id']},'attributes':[_0x3160('0x56'),_0x3160('0x59'),'preferred',_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x40eefe,null))[_0x3160('0x1c')](function(_0x13fda5){if(_0x13fda5){var _0x31e448=_0x13fda5[_0x3160('0x56')]&&fs[_0x3160('0x61')](path['join'](config[_0x3160('0x62')],_0x4a2771,_[_0x3160('0x63')](_0x13fda5[_0x3160('0x56')])))?path['join'](config['root'],_0x4a2771,_['toLower'](_0x13fda5[_0x3160('0x56')])):path['join'](config[_0x3160('0x62')],_0x4a2771,_[_0x3160('0x63')]('default_logo.svg'));var _0x44a112=_0x3160('0x64')+_[_0x3160('0x65')]('logo');if(_0x13fda5[_0x44a112]||!_0x50bca9[_0x3160('0x66')]){_0x31e448=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x4a2771,_['toLower'](_0x3160('0x68')));}if(!fs['existsSync'](_0x31e448)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x56'))+_0x3160('0x6b'));}return _0x40eefe[_0x3160('0x6c')](_0x31e448);}})[_0x3160('0x26')](handleError(_0x40eefe,null));};var utilLicense=require(_0x3160('0x5a'));exports[_0x3160('0x6d')]=function(_0x345a10,_0x5c4414,_0x539834){var _0x30e8fc='server/files/images/logos';var _0x70bd50={'custom':![]};return utilLicense[_0x3160('0x5b')]()[_0x3160('0x1c')](function(_0x56ed26){if(_0x56ed26){_0x70bd50=_0x56ed26;}return db[_0x3160('0x37')]['find']({'where':{'id':_0x345a10[_0x3160('0x50')]['id']},'attributes':[_0x3160('0x56'),'loginLogo',_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x5c4414,null))[_0x3160('0x1c')](function(_0x32b0b7){if(_0x32b0b7){var _0x4bf92d=_0x32b0b7[_0x3160('0x59')]&&fs[_0x3160('0x61')](path['join'](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')](_0x32b0b7['loginLogo'])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_['toLower'](_0x32b0b7[_0x3160('0x59')])):path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')]('default_loginLogo.svg'));var _0x1fa2d5=_0x3160('0x64')+_[_0x3160('0x65')](_0x3160('0x59'));if(_0x32b0b7[_0x1fa2d5]||!_0x70bd50[_0x3160('0x66')]){_0x4bf92d=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x30e8fc,_[_0x3160('0x63')](_0x3160('0x6f')));}if(!fs[_0x3160('0x61')](_0x4bf92d)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x59'))+_0x3160('0x6b'));}return _0x5c4414['download'](_0x4bf92d);}})['catch'](handleError(_0x5c4414,null));};exports[_0x3160('0x70')]=function(_0x5e2d04,_0x88b83e){return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x5e2d04['params']['id']},'attributes':['securePassword']})[_0x3160('0x1c')](respondWithResult(_0x88b83e,null))[_0x3160('0x26')](handleError(_0x88b83e,null));};exports[_0x3160('0x71')]=function(_0x496e9b,_0x44b9b5,_0x3d436e){if(_0x496e9b[_0x3160('0x55')]&&_0x496e9b[_0x3160('0x55')][_0x3160('0x57')]){_0x496e9b[_0x3160('0x53')][_0x3160('0x6e')]=_0x496e9b[_0x3160('0x55')]['filename'];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x496e9b[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x44b9b5,null))['then'](saveUpdates(_0x496e9b['body'],null))[_0x3160('0x1c')](respondWithResult(_0x44b9b5,null))[_0x3160('0x26')](handleError(_0x44b9b5,null));};var utilLicense=require(_0x3160('0x5a'));exports['getPreferred']=function(_0x2e181a,_0xa50990,_0x2b54e4){var _0x2231c6=_0x3160('0x72');var _0xf8540a={'custom':![]};return utilLicense[_0x3160('0x5b')]()['then'](function(_0x1f6ea8){if(_0x1f6ea8){_0xf8540a=_0x1f6ea8;}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x2e181a['params']['id']},'attributes':[_0x3160('0x56'),_0x3160('0x59'),_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0xa50990,null))[_0x3160('0x1c')](function(_0x54b130){if(_0x54b130){var _0x37137a=_0x54b130['preferred']&&fs[_0x3160('0x61')](path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x54b130[_0x3160('0x6e')])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x54b130[_0x3160('0x6e')])):path['join'](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x3160('0x73')));var _0x3c6ef9='default'+_[_0x3160('0x65')](_0x3160('0x6e'));if(_0x54b130[_0x3c6ef9]||!_0xf8540a[_0x3160('0x66')]||!_0xf8540a[_0x3160('0x6e')]){_0x37137a=path[_0x3160('0x67')](config[_0x3160('0x62')],_0x2231c6,_[_0x3160('0x63')](_0x3160('0x73')));}if(!fs[_0x3160('0x61')](_0x37137a)){throw new db['Sequelize'][(_0x3160('0x6a'))](_[_0x3160('0x65')](_0x3160('0x6e'))+_0x3160('0x6b'));}return _0xa50990[_0x3160('0x6c')](_0x37137a);}})[_0x3160('0x26')](handleError(_0xa50990,null));};exports[_0x3160('0x74')]=function(_0x1c85f9,_0x98607c,_0x54d74a){if(_0x1c85f9[_0x3160('0x55')]&&_0x1c85f9[_0x3160('0x55')][_0x3160('0x57')]){_0x1c85f9['body']['favicon']=_0x1c85f9[_0x3160('0x55')]['filename'];}return db[_0x3160('0x37')][_0x3160('0x51')]({'where':{'id':_0x1c85f9[_0x3160('0x50')]['id']}})[_0x3160('0x1c')](handleEntityNotFound(_0x98607c,null))['then'](saveUpdates(_0x1c85f9[_0x3160('0x53')],null))['then'](respondWithResult(_0x98607c,null))['catch'](handleError(_0x98607c,null));};var utilLicense=require(_0x3160('0x5a'));exports['getFavicon']=function(_0x285c91,_0x579a12,_0x1fc1de){var _0x839fae=_0x3160('0x72');var _0x352312={'custom':![]};return utilLicense[_0x3160('0x5b')]()[_0x3160('0x1c')](function(_0x3c87e7){if(_0x3c87e7){_0x352312=_0x3c87e7;}return db['Setting']['find']({'where':{'id':_0x285c91['params']['id']},'attributes':[_0x3160('0x56'),'loginLogo',_0x3160('0x6e'),_0x3160('0x5c'),_0x3160('0x5d'),_0x3160('0x5e'),_0x3160('0x5f'),_0x3160('0x60')],'raw':!![]});})[_0x3160('0x1c')](handleEntityNotFound(_0x579a12,null))[_0x3160('0x1c')](function(_0x4e187d){if(_0x4e187d){var _0x38b164=_0x4e187d['favicon']&&fs[_0x3160('0x61')](path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x4e187d[_0x3160('0x5c')])))?path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x4e187d[_0x3160('0x5c')])):path[_0x3160('0x67')](config[_0x3160('0x62')],_0x839fae,_[_0x3160('0x63')](_0x3160('0x75')));var _0x68588b=_0x3160('0x64')+_['upperFirst'](_0x3160('0x5c'));if(_0x4e187d[_0x68588b]||!_0x352312[_0x3160('0x66')]){_0x38b164=path['join'](config['root'],_0x839fae,_[_0x3160('0x63')](_0x3160('0x75')));}if(!fs[_0x3160('0x61')](_0x38b164)){throw new db[(_0x3160('0x69'))][(_0x3160('0x6a'))](_[_0x3160('0x65')]('favicon')+_0x3160('0x6b'));}return _0x579a12[_0x3160('0x6c')](_0x38b164);}})[_0x3160('0x26')](handleError(_0x579a12,null));};exports[_0x3160('0x76')]=function(_0x50961c,_0x1d6cb2){var _0x3c32ef={'offset':moment()[_0x3160('0x77')]()};_0x3c32ef[_0x3160('0x78')]=moment()[_0x3160('0x77')](_0x3c32ef[_0x3160('0x2a')])[_0x3160('0x79')](_0x3160('0x7a'));return _0x1d6cb2[_0x3160('0x27')](0xc8)[_0x3160('0x35')](_0x3c32ef);};
\ No newline at end of file
+var _0x71c8=['Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','name','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','rows','catch','params','merge','options','find','update','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','loginLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','default_preferred.png','addFavicon','getFavicon','getLicense','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','then','info'];(function(_0x3f78a0,_0x1c0f1f){var _0x3cb70c=function(_0x101503){while(--_0x101503){_0x3f78a0['push'](_0x3f78a0['shift']());}};_0x3cb70c(++_0x1c0f1f);}(_0x71c8,0x149));var _0x871c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71c8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x871c('0x0'));var rimraf=require(_0x871c('0x1'));var zipdir=require(_0x871c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x871c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x871c('0x4'));var util=require('util');var path=require(_0x871c('0x5'));var sox=require(_0x871c('0x6'));var csv=require(_0x871c('0x7'));var ejs=require(_0x871c('0x8'));var fs=require('fs');var fs_extra=require(_0x871c('0x9'));var _=require('lodash');var squel=require(_0x871c('0xa'));var crypto=require('crypto');var jsforce=require(_0x871c('0xb'));var deskjs=require(_0x871c('0xc'));var toCsv=require(_0x871c('0x7'));var querystring=require(_0x871c('0xd'));var Papa=require(_0x871c('0xe'));var Redis=require(_0x871c('0xf'));var authService=require(_0x871c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x871c('0x11'));var hardwareService=require(_0x871c('0x12'));var logger=require(_0x871c('0x13'))(_0x871c('0x14'));var utils=require(_0x871c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x871c('0x16'));var db=require(_0x871c('0x17'))['db'];var jayson=require(_0x871c('0x18'));var client=jayson[_0x871c('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x253f61,_0x482cd2,_0x2d52a7,_0x1dd476){return new BPromise(function(_0x42eafc,_0x46a9b0){var _0x2a43b7=_0x1dd476||client;return _0x2a43b7['request'](_0x253f61,_0x2d52a7)[_0x871c('0x1a')](function(_0xa02784){logger[_0x871c('0x1b')](_0x871c('0x1c'),_0x482cd2,_0x871c('0x1d'));logger[_0x871c('0x1e')](_0x871c('0x1f'),_0x482cd2,_0x871c('0x1d'),JSON[_0x871c('0x20')](_0xa02784));if(_0xa02784[_0x871c('0x21')]){if(_0xa02784['error'][_0x871c('0x22')]===0x1f4){logger[_0x871c('0x21')](_0x871c('0x1c'),_0x482cd2,_0xa02784[_0x871c('0x21')][_0x871c('0x23')]);return _0x46a9b0(_0xa02784[_0x871c('0x21')]['message']);}logger[_0x871c('0x21')](_0x871c('0x1c'),_0x482cd2,_0xa02784['error'][_0x871c('0x23')]);return _0x42eafc(_0xa02784[_0x871c('0x21')][_0x871c('0x23')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x482cd2,_0x871c('0x1d'));_0x42eafc(_0xa02784[_0x871c('0x24')][_0x871c('0x23')]);}})['catch'](function(_0x2aeef6){logger['error']('Setting,\x20%s,\x20%s',_0x482cd2,_0x2aeef6);_0x46a9b0(_0x2aeef6);});});}function respondWithStatusCode(_0x8de45a,_0x86ffb5){_0x86ffb5=_0x86ffb5||0xcc;return function(_0x2cc6c0){if(_0x2cc6c0){return _0x8de45a[_0x871c('0x25')](_0x86ffb5);}return _0x8de45a[_0x871c('0x26')](_0x86ffb5)[_0x871c('0x27')]();};}function respondWithResult(_0x191459,_0x572655){_0x572655=_0x572655||0xc8;return function(_0x5734a4){if(_0x5734a4){return _0x191459[_0x871c('0x26')](_0x572655)[_0x871c('0x28')](_0x5734a4);}};}function respondWithFilteredResult(_0x105e2f,_0x55c132){return function(_0x52b636){if(_0x52b636){var _0x1002f9=typeof _0x55c132['offset']===_0x871c('0x29')&&typeof _0x55c132[_0x871c('0x2a')]===_0x871c('0x29');var _0x368b2b=_0x52b636[_0x871c('0x2b')];var _0x588126=_0x1002f9?0x0:_0x55c132[_0x871c('0x2c')];var _0x235563=_0x1002f9?_0x52b636[_0x871c('0x2b')]:_0x55c132[_0x871c('0x2c')]+_0x55c132[_0x871c('0x2a')];var _0x1fadb3;if(_0x235563>=_0x368b2b){_0x235563=_0x368b2b;_0x1fadb3=0xc8;}else{_0x1fadb3=0xce;}_0x105e2f[_0x871c('0x26')](_0x1fadb3);return _0x105e2f['set'](_0x871c('0x2d'),_0x588126+'-'+_0x235563+'/'+_0x368b2b)[_0x871c('0x28')](_0x52b636);}return null;};}function patchUpdates(_0x5a5f0c){return function(_0x587e8b){try{jsonpatch[_0x871c('0x2e')](_0x587e8b,_0x5a5f0c,!![]);}catch(_0x2cf8fc){return BPromise[_0x871c('0x2f')](_0x2cf8fc);}return _0x587e8b[_0x871c('0x30')]();};}function saveUpdates(_0x44721e,_0x2adee2){return function(_0x3e787d){if(_0x3e787d){return _0x3e787d['update'](_0x44721e)['then'](function(_0x4ff139){return _0x4ff139;});}return null;};}function removeEntity(_0xc638a9,_0x324170){return function(_0x279e10){if(_0x279e10){return _0x279e10['destroy']()[_0x871c('0x1a')](function(){_0xc638a9[_0x871c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1526f9,_0x24e1ff){return function(_0x1f86b3){if(!_0x1f86b3){_0x1526f9[_0x871c('0x25')](0x194);}return _0x1f86b3;};}function handleError(_0x5a0ad0,_0x35f033){_0x35f033=_0x35f033||0x1f4;return function(_0x16eeaf){logger[_0x871c('0x21')](_0x16eeaf['stack']);if(_0x16eeaf[_0x871c('0x31')]){delete _0x16eeaf[_0x871c('0x31')];}_0x5a0ad0[_0x871c('0x26')](_0x35f033)['send'](_0x16eeaf);};}exports['index']=function(_0x2a152b,_0x3951c9){var _0x3e9419={},_0x57e461={},_0x32762d={'count':0x0,'rows':[]};var _0x3f921c=_[_0x871c('0x32')](db[_0x871c('0x33')][_0x871c('0x34')],function(_0x18ba31){return{'name':_0x18ba31[_0x871c('0x35')],'type':_0x18ba31[_0x871c('0x36')][_0x871c('0x37')]};});_0x57e461[_0x871c('0x38')]=_[_0x871c('0x32')](_0x3f921c,'name');_0x57e461[_0x871c('0x39')]=_[_0x871c('0x3a')](_0x2a152b[_0x871c('0x39')]);_0x57e461[_0x871c('0x3b')]=_[_0x871c('0x3c')](_0x57e461[_0x871c('0x38')],_0x57e461[_0x871c('0x39')]);_0x3e9419['attributes']=_[_0x871c('0x3c')](_0x57e461[_0x871c('0x38')],qs[_0x871c('0x3d')](_0x2a152b[_0x871c('0x39')][_0x871c('0x3d')]));_0x3e9419['attributes']=_0x3e9419[_0x871c('0x3e')][_0x871c('0x3f')]?_0x3e9419[_0x871c('0x3e')]:_0x57e461[_0x871c('0x38')];if(!_0x2a152b[_0x871c('0x39')][_0x871c('0x40')](_0x871c('0x41'))){_0x3e9419[_0x871c('0x2a')]=qs[_0x871c('0x2a')](_0x2a152b[_0x871c('0x39')][_0x871c('0x2a')]);_0x3e9419[_0x871c('0x2c')]=qs[_0x871c('0x2c')](_0x2a152b[_0x871c('0x39')]['offset']);}_0x3e9419[_0x871c('0x42')]=qs[_0x871c('0x43')](_0x2a152b[_0x871c('0x39')][_0x871c('0x43')]);_0x3e9419[_0x871c('0x44')]=qs[_0x871c('0x3b')](_[_0x871c('0x45')](_0x2a152b[_0x871c('0x39')],_0x57e461[_0x871c('0x3b')]),_0x3f921c);if(_0x2a152b[_0x871c('0x39')][_0x871c('0x46')]){_0x3e9419[_0x871c('0x44')]=_['merge'](_0x3e9419['where'],{'$or':_[_0x871c('0x32')](_0x3f921c,function(_0x17ea5f){if(_0x17ea5f[_0x871c('0x36')]!=='VIRTUAL'){var _0x28b1f2={};_0x28b1f2[_0x17ea5f[_0x871c('0x31')]]={'$like':'%'+_0x2a152b[_0x871c('0x39')][_0x871c('0x46')]+'%'};return _0x28b1f2;}})});}_0x3e9419=_['merge']({},_0x3e9419,_0x2a152b['options']);var _0x3a4c95={'where':_0x3e9419[_0x871c('0x44')]};return db[_0x871c('0x33')][_0x871c('0x2b')](_0x3a4c95)['then'](function(_0x2b1e50){_0x32762d[_0x871c('0x2b')]=_0x2b1e50;if(_0x2a152b[_0x871c('0x39')][_0x871c('0x47')]){_0x3e9419[_0x871c('0x48')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x3e9419);})[_0x871c('0x1a')](function(_0x37d0f1){_0x32762d[_0x871c('0x49')]=_0x37d0f1;return _0x32762d;})[_0x871c('0x1a')](respondWithFilteredResult(_0x3951c9,_0x3e9419))[_0x871c('0x4a')](handleError(_0x3951c9,null));};exports['show']=function(_0x3f04e2,_0x18d661){var _0x3c951c={'raw':![],'where':{'id':_0x3f04e2[_0x871c('0x4b')]['id']}},_0x2ba734={};_0x2ba734[_0x871c('0x38')]=_[_0x871c('0x3a')](db[_0x871c('0x33')]['rawAttributes']);_0x2ba734[_0x871c('0x39')]=_[_0x871c('0x3a')](_0x3f04e2['query']);_0x2ba734['filters']=_[_0x871c('0x3c')](_0x2ba734[_0x871c('0x38')],_0x2ba734['query']);_0x3c951c['attributes']=_[_0x871c('0x3c')](_0x2ba734['model'],qs[_0x871c('0x3d')](_0x3f04e2['query']['fields']));_0x3c951c[_0x871c('0x3e')]=_0x3c951c[_0x871c('0x3e')][_0x871c('0x3f')]?_0x3c951c[_0x871c('0x3e')]:_0x2ba734[_0x871c('0x38')];if(_0x3f04e2['query'][_0x871c('0x47')]){_0x3c951c[_0x871c('0x48')]=[{'all':!![]}];}_0x3c951c=_[_0x871c('0x4c')]({},_0x3c951c,_0x3f04e2[_0x871c('0x4d')]);return db[_0x871c('0x33')][_0x871c('0x4e')](_0x3c951c)[_0x871c('0x1a')](handleEntityNotFound(_0x18d661,null))[_0x871c('0x1a')](respondWithResult(_0x18d661,null))['catch'](handleError(_0x18d661,null));};exports[_0x871c('0x4f')]=function(_0x531c1a,_0x242b48){if(_0x531c1a[_0x871c('0x50')]['id']){delete _0x531c1a[_0x871c('0x50')]['id'];}return db[_0x871c('0x33')]['find']({'where':{'id':_0x531c1a[_0x871c('0x4b')]['id']}})[_0x871c('0x1a')](handleEntityNotFound(_0x242b48,null))[_0x871c('0x1a')](saveUpdates(_0x531c1a[_0x871c('0x50')],null))[_0x871c('0x1a')](respondWithResult(_0x242b48,null))['catch'](handleError(_0x242b48,null));};exports[_0x871c('0x51')]=function(_0x5a4571,_0x3ec95f,_0x18121a){if(_0x5a4571['file']&&_0x5a4571[_0x871c('0x52')][_0x871c('0x53')]){_0x5a4571[_0x871c('0x50')][_0x871c('0x54')]=_0x5a4571[_0x871c('0x52')][_0x871c('0x53')];}return db[_0x871c('0x33')][_0x871c('0x4e')]({'where':{'id':_0x5a4571[_0x871c('0x4b')]['id']}})[_0x871c('0x1a')](handleEntityNotFound(_0x3ec95f,null))[_0x871c('0x1a')](saveUpdates(_0x5a4571[_0x871c('0x50')],null))[_0x871c('0x1a')](respondWithResult(_0x3ec95f,null))[_0x871c('0x4a')](handleError(_0x3ec95f,null));};exports[_0x871c('0x55')]=function(_0x13436d,_0x21b3d7,_0x2c233e){if(_0x13436d['file']&&_0x13436d['file'][_0x871c('0x53')]){_0x13436d['body']['loginLogo']=_0x13436d[_0x871c('0x52')][_0x871c('0x53')];}return db[_0x871c('0x33')][_0x871c('0x4e')]({'where':{'id':_0x13436d[_0x871c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x21b3d7,null))['then'](saveUpdates(_0x13436d[_0x871c('0x50')],null))[_0x871c('0x1a')](respondWithResult(_0x21b3d7,null))[_0x871c('0x4a')](handleError(_0x21b3d7,null));};var utilLicense=require(_0x871c('0x16'));exports[_0x871c('0x56')]=function(_0x48ab83,_0xf400b0,_0x78be05){var _0x473e53=_0x871c('0x57');var _0x22df52={'custom':![]};return utilLicense['getLicense']()[_0x871c('0x1a')](function(_0x267353){if(_0x267353){_0x22df52=_0x267353;}return db[_0x871c('0x33')][_0x871c('0x4e')]({'where':{'id':_0x48ab83[_0x871c('0x4b')]['id']},'attributes':[_0x871c('0x54'),_0x871c('0x58'),_0x871c('0x59'),_0x871c('0x5a'),_0x871c('0x5b'),_0x871c('0x5c'),_0x871c('0x5d'),_0x871c('0x5e')],'raw':!![]});})[_0x871c('0x1a')](handleEntityNotFound(_0xf400b0,null))[_0x871c('0x1a')](function(_0x1fd5dc){if(_0x1fd5dc){var _0x420851=_0x1fd5dc[_0x871c('0x54')]&&fs[_0x871c('0x5f')](path[_0x871c('0x60')](config[_0x871c('0x61')],_0x473e53,_[_0x871c('0x62')](_0x1fd5dc[_0x871c('0x54')])))?path[_0x871c('0x60')](config[_0x871c('0x61')],_0x473e53,_[_0x871c('0x62')](_0x1fd5dc[_0x871c('0x54')])):path[_0x871c('0x60')](config['root'],_0x473e53,_[_0x871c('0x62')]('default_logo.svg'));var _0x336a7c='default'+_[_0x871c('0x63')](_0x871c('0x54'));if(_0x1fd5dc[_0x336a7c]||!_0x22df52[_0x871c('0x64')]){_0x420851=path['join'](config['root'],_0x473e53,_[_0x871c('0x62')]('default_logo.svg'));}if(!fs[_0x871c('0x5f')](_0x420851)){throw new db[(_0x871c('0x65'))][(_0x871c('0x66'))](_[_0x871c('0x63')](_0x871c('0x54'))+_0x871c('0x67'));}return _0xf400b0[_0x871c('0x68')](_0x420851);}})['catch'](handleError(_0xf400b0,null));};var utilLicense=require(_0x871c('0x16'));exports['getLogoLogin']=function(_0x20a962,_0x56e622,_0x1aa115){var _0x185707=_0x871c('0x57');var _0x1de1c8={'custom':![]};return utilLicense['getLicense']()[_0x871c('0x1a')](function(_0x5e0c84){if(_0x5e0c84){_0x1de1c8=_0x5e0c84;}return db[_0x871c('0x33')]['find']({'where':{'id':_0x20a962[_0x871c('0x4b')]['id']},'attributes':[_0x871c('0x54'),'loginLogo',_0x871c('0x59'),'favicon','defaultLogo',_0x871c('0x5c'),_0x871c('0x5d'),_0x871c('0x5e')],'raw':!![]});})[_0x871c('0x1a')](handleEntityNotFound(_0x56e622,null))['then'](function(_0x4c0a0e){if(_0x4c0a0e){var _0x58a580=_0x4c0a0e[_0x871c('0x58')]&&fs[_0x871c('0x5f')](path[_0x871c('0x60')](config[_0x871c('0x61')],_0x185707,_[_0x871c('0x62')](_0x4c0a0e[_0x871c('0x58')])))?path[_0x871c('0x60')](config[_0x871c('0x61')],_0x185707,_[_0x871c('0x62')](_0x4c0a0e[_0x871c('0x58')])):path[_0x871c('0x60')](config[_0x871c('0x61')],_0x185707,_[_0x871c('0x62')](_0x871c('0x69')));var _0x1a3c2f=_0x871c('0x6a')+_[_0x871c('0x63')]('loginLogo');if(_0x4c0a0e[_0x1a3c2f]||!_0x1de1c8[_0x871c('0x64')]){_0x58a580=path['join'](config[_0x871c('0x61')],_0x185707,_[_0x871c('0x62')](_0x871c('0x69')));}if(!fs[_0x871c('0x5f')](_0x58a580)){throw new db['Sequelize'][(_0x871c('0x66'))](_[_0x871c('0x63')](_0x871c('0x58'))+_0x871c('0x67'));}return _0x56e622[_0x871c('0x68')](_0x58a580);}})[_0x871c('0x4a')](handleError(_0x56e622,null));};exports[_0x871c('0x6b')]=function(_0x58db29,_0x5399f1){return db[_0x871c('0x33')]['find']({'where':{'id':_0x58db29['params']['id']},'attributes':[_0x871c('0x6c')]})[_0x871c('0x1a')](respondWithResult(_0x5399f1,null))[_0x871c('0x4a')](handleError(_0x5399f1,null));};exports[_0x871c('0x6d')]=function(_0x378f5f,_0x590441,_0x184ef9){if(_0x378f5f[_0x871c('0x52')]&&_0x378f5f[_0x871c('0x52')][_0x871c('0x53')]){_0x378f5f[_0x871c('0x50')][_0x871c('0x59')]=_0x378f5f[_0x871c('0x52')][_0x871c('0x53')];}return db[_0x871c('0x33')][_0x871c('0x4e')]({'where':{'id':_0x378f5f[_0x871c('0x4b')]['id']}})[_0x871c('0x1a')](handleEntityNotFound(_0x590441,null))[_0x871c('0x1a')](saveUpdates(_0x378f5f[_0x871c('0x50')],null))[_0x871c('0x1a')](respondWithResult(_0x590441,null))[_0x871c('0x4a')](handleError(_0x590441,null));};var utilLicense=require(_0x871c('0x16'));exports['getPreferred']=function(_0x2845d9,_0x3377c9,_0x16c776){var _0x588e46=_0x871c('0x57');var _0x593ae8={'custom':![]};return utilLicense['getLicense']()[_0x871c('0x1a')](function(_0x243b99){if(_0x243b99){_0x593ae8=_0x243b99;}return db['Setting'][_0x871c('0x4e')]({'where':{'id':_0x2845d9[_0x871c('0x4b')]['id']},'attributes':[_0x871c('0x54'),'loginLogo','preferred','favicon',_0x871c('0x5b'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x871c('0x1a')](handleEntityNotFound(_0x3377c9,null))[_0x871c('0x1a')](function(_0x1f4662){if(_0x1f4662){var _0x4fb04c=_0x1f4662['preferred']&&fs[_0x871c('0x5f')](path[_0x871c('0x60')](config[_0x871c('0x61')],_0x588e46,_[_0x871c('0x62')](_0x1f4662[_0x871c('0x59')])))?path[_0x871c('0x60')](config[_0x871c('0x61')],_0x588e46,_[_0x871c('0x62')](_0x1f4662['preferred'])):path[_0x871c('0x60')](config[_0x871c('0x61')],_0x588e46,_[_0x871c('0x62')](_0x871c('0x6e')));var _0x714b01='default'+_[_0x871c('0x63')]('preferred');if(_0x1f4662[_0x714b01]||!_0x593ae8[_0x871c('0x64')]||!_0x593ae8[_0x871c('0x59')]){_0x4fb04c=path[_0x871c('0x60')](config[_0x871c('0x61')],_0x588e46,_[_0x871c('0x62')](_0x871c('0x6e')));}if(!fs[_0x871c('0x5f')](_0x4fb04c)){throw new db[(_0x871c('0x65'))][(_0x871c('0x66'))](_[_0x871c('0x63')]('preferred')+_0x871c('0x67'));}return _0x3377c9[_0x871c('0x68')](_0x4fb04c);}})[_0x871c('0x4a')](handleError(_0x3377c9,null));};exports[_0x871c('0x6f')]=function(_0x8dad8,_0x48f76b,_0x18d86b){if(_0x8dad8[_0x871c('0x52')]&&_0x8dad8[_0x871c('0x52')][_0x871c('0x53')]){_0x8dad8[_0x871c('0x50')][_0x871c('0x5a')]=_0x8dad8[_0x871c('0x52')][_0x871c('0x53')];}return db[_0x871c('0x33')][_0x871c('0x4e')]({'where':{'id':_0x8dad8[_0x871c('0x4b')]['id']}})[_0x871c('0x1a')](handleEntityNotFound(_0x48f76b,null))[_0x871c('0x1a')](saveUpdates(_0x8dad8[_0x871c('0x50')],null))[_0x871c('0x1a')](respondWithResult(_0x48f76b,null))[_0x871c('0x4a')](handleError(_0x48f76b,null));};var utilLicense=require(_0x871c('0x16'));exports[_0x871c('0x70')]=function(_0x4533e7,_0xee85c4,_0x530629){var _0x122425='server/files/images/logos';var _0x36eb0={'custom':![]};return utilLicense[_0x871c('0x71')]()[_0x871c('0x1a')](function(_0x4e976e){if(_0x4e976e){_0x36eb0=_0x4e976e;}return db['Setting'][_0x871c('0x4e')]({'where':{'id':_0x4533e7['params']['id']},'attributes':[_0x871c('0x54'),_0x871c('0x58'),_0x871c('0x59'),_0x871c('0x5a'),'defaultLogo',_0x871c('0x5c'),_0x871c('0x5d'),_0x871c('0x5e')],'raw':!![]});})[_0x871c('0x1a')](handleEntityNotFound(_0xee85c4,null))[_0x871c('0x1a')](function(_0x5550d8){if(_0x5550d8){var _0x25f795=_0x5550d8[_0x871c('0x5a')]&&fs[_0x871c('0x5f')](path[_0x871c('0x60')](config[_0x871c('0x61')],_0x122425,_[_0x871c('0x62')](_0x5550d8['favicon'])))?path[_0x871c('0x60')](config['root'],_0x122425,_['toLower'](_0x5550d8[_0x871c('0x5a')])):path[_0x871c('0x60')](config[_0x871c('0x61')],_0x122425,_[_0x871c('0x62')]('default_favicon.ico'));var _0x5d10b7=_0x871c('0x6a')+_['upperFirst'](_0x871c('0x5a'));if(_0x5550d8[_0x5d10b7]||!_0x36eb0['custom']){_0x25f795=path[_0x871c('0x60')](config[_0x871c('0x61')],_0x122425,_[_0x871c('0x62')]('default_favicon.ico'));}if(!fs['existsSync'](_0x25f795)){throw new db[(_0x871c('0x65'))][(_0x871c('0x66'))](_['upperFirst'](_0x871c('0x5a'))+_0x871c('0x67'));}return _0xee85c4['download'](_0x25f795);}})[_0x871c('0x4a')](handleError(_0xee85c4,null));};exports[_0x871c('0x72')]=function(_0x23d5e6,_0x2a5fed){var _0x15a879={'offset':moment()[_0x871c('0x73')]()};_0x15a879[_0x871c('0x74')]=moment()[_0x871c('0x73')](_0x15a879[_0x871c('0x2c')])[_0x871c('0x75')](_0x871c('0x76'));return _0x2a5fed[_0x871c('0x26')](0xc8)['send'](_0x15a879);};
\ No newline at end of file
index 36d3184..cc562d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x55ca,0x126));var _0xa55c=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0x55ca[_0xec74fe];return _0x50bda2;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x2dbcef,_0x1cfecb){var _0x5a90ea=function(_0x189054){while(--_0x189054){_0x2dbcef['push'](_0x2dbcef['shift']());}};_0x5a90ea(++_0x1cfecb);}(_0x008c,0x188));var _0xc008=function(_0x28e714,_0x1ca825){_0x28e714=_0x28e714-0x0;var _0x2c3bf2=_0x008c[_0x28e714];return _0x2c3bf2;};'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')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e540112..0e8aa41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4063=['stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x313a00,_0x107929){var _0x46d07b=function(_0x452b30){while(--_0x452b30){_0x313a00['push'](_0x313a00['shift']());}};_0x46d07b(++_0x107929);}(_0x4063,0x1be));var _0x3406=function(_0x14405c,_0x12b9b9){_0x14405c=_0x14405c-0x0;var _0x5d54ba=_0x4063[_0x14405c];return _0x5d54ba;};'use strict';var _=require(_0x3406('0x0'));var util=require(_0x3406('0x1'));var moment=require(_0x3406('0x2'));var BPromise=require(_0x3406('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3406('0x4'));var db=require(_0x3406('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3406('0x6'));var config=require(_0x3406('0x7'));var jayson=require(_0x3406('0x8'));var client=jayson[_0x3406('0x9')][_0x3406('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13bc06,_0x39b0b4,_0x14717a){return new BPromise(function(_0x449acb,_0x231f19){return client[_0x3406('0xb')](_0x13bc06,_0x14717a)[_0x3406('0xc')](function(_0x4cdbeb){logger[_0x3406('0xd')]('Setting,\x20%s,\x20%s',_0x39b0b4,_0x3406('0xe'));logger['debug'](_0x3406('0xf'),_0x39b0b4,_0x3406('0xe'),JSON[_0x3406('0x10')](_0x4cdbeb));if(_0x4cdbeb[_0x3406('0x11')]){if(_0x4cdbeb[_0x3406('0x11')][_0x3406('0x12')]===0x1f4){logger[_0x3406('0x11')](_0x3406('0x13'),_0x39b0b4,_0x4cdbeb['error'][_0x3406('0x14')]);return _0x231f19(_0x4cdbeb[_0x3406('0x11')][_0x3406('0x14')]);}logger[_0x3406('0x11')](_0x3406('0x13'),_0x39b0b4,_0x4cdbeb[_0x3406('0x11')][_0x3406('0x14')]);return _0x449acb(_0x4cdbeb['error'][_0x3406('0x14')]);}else{logger[_0x3406('0xd')](_0x3406('0x13'),_0x39b0b4,'request\x20sent');_0x449acb(_0x4cdbeb[_0x3406('0x15')][_0x3406('0x14')]);}})[_0x3406('0x16')](function(_0x4b65be){logger['error'](_0x3406('0x13'),_0x39b0b4,_0x4b65be);_0x231f19(_0x4b65be);});});}exports[_0x3406('0x17')]=function(_0x309c16){var _0x296096=this;return new Promise(function(_0x4badf2,_0x5cec1d){return db[_0x3406('0x18')]['find']({'raw':_0x309c16[_0x3406('0x19')]?_0x309c16[_0x3406('0x19')][_0x3406('0x1a')]===undefined?!![]:![]:!![],'where':_0x309c16['options']?_0x309c16[_0x3406('0x19')][_0x3406('0x1b')]||null:null,'attributes':_0x309c16[_0x3406('0x19')]?_0x309c16[_0x3406('0x19')][_0x3406('0x1c')]||null:null,'include':_0x309c16['options']?_0x309c16[_0x3406('0x19')]['include']?_[_0x3406('0x1d')](_0x309c16['options'][_0x3406('0x1e')],function(_0x2ee8ac){return{'model':db[_0x2ee8ac['model']],'as':_0x2ee8ac['as'],'attributes':_0x2ee8ac['attributes'],'include':_0x2ee8ac['include']?_[_0x3406('0x1d')](_0x2ee8ac['include'],function(_0x5da6f4){return{'model':db[_0x5da6f4[_0x3406('0x1f')]],'as':_0x5da6f4['as'],'attributes':_0x5da6f4[_0x3406('0x1c')],'include':_0x5da6f4[_0x3406('0x1e')]?_[_0x3406('0x1d')](_0x5da6f4[_0x3406('0x1e')],function(_0x24aced){return{'model':db[_0x24aced[_0x3406('0x1f')]],'as':_0x24aced['as'],'attributes':_0x24aced[_0x3406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3406('0xc')](function(_0x48067c){logger[_0x3406('0xd')](_0x3406('0x17'),_0x309c16);logger[_0x3406('0x20')](_0x3406('0x17'),_0x309c16,JSON[_0x3406('0x10')](_0x48067c));_0x4badf2(_0x48067c);})[_0x3406('0x16')](function(_0x5c109d){logger[_0x3406('0x11')](_0x3406('0x17'),_0x5c109d[_0x3406('0x14')],_0x309c16);_0x5cec1d(_0x296096[_0x3406('0x11')](0x1f4,_0x5c109d[_0x3406('0x14')]));});});};
\ No newline at end of file
+var _0xb6ac=['include','map','model','ShowSetting','catch','lodash','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Setting','find','options','raw','where','attributes'];(function(_0x2dcd41,_0x32c0bc){var _0x24511e=function(_0x4789e5){while(--_0x4789e5){_0x2dcd41['push'](_0x2dcd41['shift']());}};_0x24511e(++_0x32c0bc);}(_0xb6ac,0x1e5));var _0xcb6a=function(_0x3a88df,_0xeb183){_0x3a88df=_0x3a88df-0x0;var _0xe8ff6f=_0xb6ac[_0x3a88df];return _0xe8ff6f;};'use strict';var _=require(_0xcb6a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcb6a('0x1'));var fs=require('fs');var Redis=require(_0xcb6a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb6a('0x3'))(_0xcb6a('0x4'));var config=require(_0xcb6a('0x5'));var jayson=require(_0xcb6a('0x6'));var client=jayson['client'][_0xcb6a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c5a29,_0x34896c,_0x38de66){return new BPromise(function(_0x146dee,_0x3ca6d7){return client[_0xcb6a('0x8')](_0x1c5a29,_0x38de66)[_0xcb6a('0x9')](function(_0x50948e){logger[_0xcb6a('0xa')](_0xcb6a('0xb'),_0x34896c,_0xcb6a('0xc'));logger[_0xcb6a('0xd')]('Setting,\x20%s,\x20%s,\x20%s',_0x34896c,_0xcb6a('0xc'),JSON[_0xcb6a('0xe')](_0x50948e));if(_0x50948e[_0xcb6a('0xf')]){if(_0x50948e['error'][_0xcb6a('0x10')]===0x1f4){logger[_0xcb6a('0xf')](_0xcb6a('0xb'),_0x34896c,_0x50948e[_0xcb6a('0xf')]['message']);return _0x3ca6d7(_0x50948e[_0xcb6a('0xf')][_0xcb6a('0x11')]);}logger[_0xcb6a('0xf')](_0xcb6a('0xb'),_0x34896c,_0x50948e[_0xcb6a('0xf')][_0xcb6a('0x11')]);return _0x146dee(_0x50948e['error'][_0xcb6a('0x11')]);}else{logger[_0xcb6a('0xa')](_0xcb6a('0xb'),_0x34896c,_0xcb6a('0xc'));_0x146dee(_0x50948e[_0xcb6a('0x12')]['message']);}})['catch'](function(_0x3a79e8){logger[_0xcb6a('0xf')]('Setting,\x20%s,\x20%s',_0x34896c,_0x3a79e8);_0x3ca6d7(_0x3a79e8);});});}exports['ShowSetting']=function(_0x2b4c35){var _0xe38de3=this;return new Promise(function(_0x5ecb51,_0x3ea3e1){return db[_0xcb6a('0x13')][_0xcb6a('0x14')]({'raw':_0x2b4c35[_0xcb6a('0x15')]?_0x2b4c35['options'][_0xcb6a('0x16')]===undefined?!![]:![]:!![],'where':_0x2b4c35[_0xcb6a('0x15')]?_0x2b4c35[_0xcb6a('0x15')][_0xcb6a('0x17')]||null:null,'attributes':_0x2b4c35[_0xcb6a('0x15')]?_0x2b4c35[_0xcb6a('0x15')][_0xcb6a('0x18')]||null:null,'include':_0x2b4c35[_0xcb6a('0x15')]?_0x2b4c35['options'][_0xcb6a('0x19')]?_[_0xcb6a('0x1a')](_0x2b4c35[_0xcb6a('0x15')][_0xcb6a('0x19')],function(_0x5a74b2){return{'model':db[_0x5a74b2['model']],'as':_0x5a74b2['as'],'attributes':_0x5a74b2['attributes'],'include':_0x5a74b2['include']?_[_0xcb6a('0x1a')](_0x5a74b2[_0xcb6a('0x19')],function(_0x24bdce){return{'model':db[_0x24bdce['model']],'as':_0x24bdce['as'],'attributes':_0x24bdce[_0xcb6a('0x18')],'include':_0x24bdce[_0xcb6a('0x19')]?_[_0xcb6a('0x1a')](_0x24bdce[_0xcb6a('0x19')],function(_0x1d5484){return{'model':db[_0x1d5484[_0xcb6a('0x1b')]],'as':_0x1d5484['as'],'attributes':_0x1d5484['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb6a('0x9')](function(_0x5d1860){logger[_0xcb6a('0xa')](_0xcb6a('0x1c'),_0x2b4c35);logger[_0xcb6a('0xd')](_0xcb6a('0x1c'),_0x2b4c35,JSON[_0xcb6a('0xe')](_0x5d1860));_0x5ecb51(_0x5d1860);})[_0xcb6a('0x1d')](function(_0x3e649e){logger[_0xcb6a('0xf')](_0xcb6a('0x1c'),_0x3e649e[_0xcb6a('0x11')],_0x2b4c35);_0x3ea3e1(_0xe38de3[_0xcb6a('0xf')](0x1f4,_0x3e649e['message']));});});};
\ No newline at end of file
index 59fcd85..9aa55d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addApplications','status','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users'];(function(_0x2b84d5,_0x428914){var _0x51452a=function(_0x3ddc9c){while(--_0x3ddc9c){_0x2b84d5['push'](_0x2b84d5['shift']());}};_0x51452a(++_0x428914);}(_0x5fab,0x177));var _0xb5fa=function(_0x3a196b,_0x1a03c4){_0x3a196b=_0x3a196b-0x0;var _0x192dd8=_0x5fab[_0x3a196b];return _0x192dd8;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['get']('/:id/dispositions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0xa')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['getApplications']);router[_0xb5fa('0xa')](_0xb5fa('0x14'),auth['isAuthenticated'](),controller[_0xb5fa('0x15')]);router['get'](_0xb5fa('0x16'),controller[_0xb5fa('0x17')]);router[_0xb5fa('0xa')](_0xb5fa('0x18'),auth[_0xb5fa('0xb')](),controller['getAgents']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x19')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1b'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xb5fa('0x1a')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1c')]);router[_0xb5fa('0x1a')](_0xb5fa('0x1d'),controller[_0xb5fa('0x1e')]);router[_0xb5fa('0x1a')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x1f')]);router[_0xb5fa('0x1a')]('/:id/send',auth[_0xb5fa('0xb')](),controller['send']);router[_0xb5fa('0x1a')]('/:id/status',controller[_0xb5fa('0x20')]);router[_0xb5fa('0x1a')]('/:id/users',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x21')]);router[_0xb5fa('0x22')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x23')]);router[_0xb5fa('0x24')]('/:id',auth[_0xb5fa('0xb')](),controller['destroy']);router[_0xb5fa('0x24')](_0xb5fa('0x1b'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x25')]);router[_0xb5fa('0x24')](_0xb5fa('0x11'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xb5fa('0x27')]=router;
\ No newline at end of file
+var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x57fe35,_0x383a80){var _0x4538a0=function(_0x4bd5ce){while(--_0x4bd5ce){_0x57fe35['push'](_0x57fe35['shift']());}};_0x4538a0(++_0x383a80);}(_0x53ec,0x192));var _0xc53e=function(_0x370723,_0x179030){_0x370723=_0x370723-0x0;var _0x4f82bb=_0x53ec[_0x370723];return _0x4f82bb;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router;
\ No newline at end of file
index bd6becf..93bf826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67b5=['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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','csc','intelepeer','BOOLEAN'];(function(_0x58fff4,_0xfc3641){var _0x4949b2=function(_0x1462c1){while(--_0x1462c1){_0x58fff4['push'](_0x58fff4['shift']());}};_0x4949b2(++_0xfc3641);}(_0x67b5,0x11f));var _0x567b=function(_0x2633d7,_0x3ddb04){_0x2633d7=_0x2633d7-0x0;var _0x559b29=_0x67b5[_0x2633d7];return _0x559b29;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x567b('0x0'));module[_0x567b('0x1')]={'name':{'type':Sequelize[_0x567b('0x2')],'unique':_0x567b('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x567b('0x2')],'defaultValue':function(){return rs[_0x567b('0x4')]();}},'phone':{'type':Sequelize[_0x567b('0x2')]},'type':{'type':Sequelize[_0x567b('0x5')](_0x567b('0x6'),_0x567b('0x7'),'connectel',_0x567b('0x8'),_0x567b('0x9'),'clickatell','bandwidth',_0x567b('0xa'),'infobip',_0x567b('0xb'))},'accountSid':{'type':Sequelize[_0x567b('0x2')]},'authId':{'type':Sequelize[_0x567b('0x2')]},'authToken':{'type':Sequelize[_0x567b('0x2')]},'smsMethod':{'type':Sequelize[_0x567b('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x567b('0x2')]},'password':{'type':Sequelize[_0x567b('0x2')]},'apiKey':{'type':Sequelize[_0x567b('0x2')]},'applicationId':{'type':Sequelize[_0x567b('0x2')]},'accountId':{'type':Sequelize[_0x567b('0x2')]},'senderString':{'type':Sequelize[_0x567b('0x2')]},'deliveryReport':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x567b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x567b('0xd')],'defaultValue':function(){return _0x567b('0xe');}},'notificationSound':{'type':Sequelize[_0x567b('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x567b('0xf')],'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[_0x567b('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x567b('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x567b('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x567b('0xf')],'comment':_0x567b('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x567b('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4b3e3c){if(!_0x4b3e3c)this[_0x567b('0x11')](_0x567b('0x12'),null);this[_0x567b('0x11')](_0x567b('0x13'),_0x4b3e3c);}}};
\ No newline at end of file
+var _0xef4d=['setDataValue','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','csc','intelepeer','BOOLEAN','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'];(function(_0x563316,_0x36d467){var _0x5a3c88=function(_0x3908cf){while(--_0x3908cf){_0x563316['push'](_0x563316['shift']());}};_0x5a3c88(++_0x36d467);}(_0xef4d,0x17c));var _0xdef4=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xef4d[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'name':{'type':Sequelize[_0xdef4('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xdef4('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xdef4('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xdef4('0x2')],'defaultValue':function(){return rs[_0xdef4('0x3')]();}},'phone':{'type':Sequelize[_0xdef4('0x2')]},'type':{'type':Sequelize[_0xdef4('0x4')](_0xdef4('0x5'),_0xdef4('0x6'),_0xdef4('0x7'),_0xdef4('0x8'),'plivo',_0xdef4('0x9'),'bandwidth',_0xdef4('0xa'),'infobip',_0xdef4('0xb'))},'accountSid':{'type':Sequelize[_0xdef4('0x2')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xdef4('0x2')]},'smsMethod':{'type':Sequelize[_0xdef4('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xdef4('0x2')]},'password':{'type':Sequelize[_0xdef4('0x2')]},'apiKey':{'type':Sequelize[_0xdef4('0x2')]},'applicationId':{'type':Sequelize[_0xdef4('0x2')]},'accountId':{'type':Sequelize[_0xdef4('0x2')]},'senderString':{'type':Sequelize[_0xdef4('0x2')]},'deliveryReport':{'type':Sequelize[_0xdef4('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xdef4('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdef4('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdef4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdef4('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdef4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdef4('0xe')],'comment':_0xdef4('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xdef4('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x66be47){if(!_0x66be47)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xdef4('0x10')](_0xdef4('0x11'),_0x66be47);}}};
\ No newline at end of file
index 2e9c8e4..4344938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bfc=['userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','SmsAccounts','stack','name','mandatoryDispositionPause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SmsAccount','includeAll','show','params','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rawAttributes','include','findAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','sms','SmsApplication','applications','Applications','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','csc','originatingAddress','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','push','close','*,*,*,*','SmsMessage','ContactId','User','UserId','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','bulkCreate','findAndCountAll','priority','getApplications','Contact','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','results','DELIVERED','redif','groupName','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','emit'];(function(_0x3b3a20,_0x23aefc){var _0x4daacf=function(_0x319afa){while(--_0x319afa){_0x3b3a20['push'](_0x3b3a20['shift']());}};_0x4daacf(++_0x23aefc);}(_0x2bfc,0x1be));var _0xc2bf=function(_0x274d4b,_0x128681){_0x274d4b=_0x274d4b-0x0;var _0x1a1f03=_0x2bfc[_0x274d4b];return _0x1a1f03;};'use strict';var emlformat=require(_0xc2bf('0x0'));var rimraf=require(_0xc2bf('0x1'));var zipdir=require(_0xc2bf('0x2'));var jsonpatch=require(_0xc2bf('0x3'));var rp=require('request-promise');var moment=require(_0xc2bf('0x4'));var BPromise=require(_0xc2bf('0x5'));var Mustache=require(_0xc2bf('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc2bf('0x7'));var csv=require(_0xc2bf('0x8'));var ejs=require(_0xc2bf('0x9'));var fs=require('fs');var fs_extra=require(_0xc2bf('0xa'));var _=require(_0xc2bf('0xb'));var squel=require(_0xc2bf('0xc'));var crypto=require('crypto');var jsforce=require(_0xc2bf('0xd'));var deskjs=require(_0xc2bf('0xe'));var toCsv=require(_0xc2bf('0x8'));var querystring=require(_0xc2bf('0xf'));var Papa=require(_0xc2bf('0x10'));var Redis=require(_0xc2bf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc2bf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc2bf('0x13'))(_0xc2bf('0x14'));var utils=require(_0xc2bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc2bf('0x16'));var db=require('../../mysqldb')['db'];config[_0xc2bf('0x17')]=_[_0xc2bf('0x18')](config[_0xc2bf('0x17')],{'host':_0xc2bf('0x19'),'port':0x18eb});var socket=require(_0xc2bf('0x1a'))(new Redis(config[_0xc2bf('0x17')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xc2bf('0x1b'));var client=jayson[_0xc2bf('0x1c')][_0xc2bf('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x27c9e6,_0x55e3c1,_0x5069d2,_0x4b8a65){return new BPromise(function(_0x1277b6,_0x3e99c6){var _0x2dba6e=_0x4b8a65||client;return _0x2dba6e[_0xc2bf('0x1e')](_0x27c9e6,_0x5069d2)[_0xc2bf('0x1f')](function(_0xf1a550){logger[_0xc2bf('0x20')](_0xc2bf('0x21'),_0x55e3c1,_0xc2bf('0x22'));logger[_0xc2bf('0x23')](_0xc2bf('0x24'),_0x55e3c1,_0xc2bf('0x22'),JSON['stringify'](_0xf1a550));if(_0xf1a550[_0xc2bf('0x25')]){if(_0xf1a550[_0xc2bf('0x25')][_0xc2bf('0x26')]===0x1f4){logger[_0xc2bf('0x25')](_0xc2bf('0x21'),_0x55e3c1,_0xf1a550[_0xc2bf('0x25')]['message']);return _0x3e99c6(_0xf1a550['error'][_0xc2bf('0x27')]);}logger[_0xc2bf('0x25')]('SmsAccount,\x20%s,\x20%s',_0x55e3c1,_0xf1a550['error'][_0xc2bf('0x27')]);return _0x1277b6(_0xf1a550[_0xc2bf('0x25')][_0xc2bf('0x27')]);}else{logger[_0xc2bf('0x20')](_0xc2bf('0x21'),_0x55e3c1,_0xc2bf('0x22'));_0x1277b6(_0xf1a550['result'][_0xc2bf('0x27')]);}})[_0xc2bf('0x28')](function(_0x49e68c){logger[_0xc2bf('0x25')](_0xc2bf('0x21'),_0x55e3c1,_0x49e68c);_0x3e99c6(_0x49e68c);});});}function respondWithStatusCode(_0x57f523,_0xb9ebcd){_0xb9ebcd=_0xb9ebcd||0xcc;return function(_0x53b564){if(_0x53b564){return _0x57f523[_0xc2bf('0x29')](_0xb9ebcd);}return _0x57f523[_0xc2bf('0x2a')](_0xb9ebcd)[_0xc2bf('0x2b')]();};}function respondWithResult(_0x461d7c,_0x4aa892){_0x4aa892=_0x4aa892||0xc8;return function(_0x1b7012){if(_0x1b7012){return _0x461d7c[_0xc2bf('0x2a')](_0x4aa892)[_0xc2bf('0x2c')](_0x1b7012);}};}function respondWithFilteredResult(_0x55de9e,_0x82280a){return function(_0x4a4a00){if(_0x4a4a00){var _0x15315a=typeof _0x82280a[_0xc2bf('0x2d')]===_0xc2bf('0x2e')&&typeof _0x82280a[_0xc2bf('0x2f')]===_0xc2bf('0x2e');var _0x506ee4=_0x4a4a00['count'];var _0x51feb6=_0x15315a?0x0:_0x82280a[_0xc2bf('0x2d')];var _0x348991=_0x15315a?_0x4a4a00[_0xc2bf('0x30')]:_0x82280a[_0xc2bf('0x2d')]+_0x82280a[_0xc2bf('0x2f')];var _0x658b9a;if(_0x348991>=_0x506ee4){_0x348991=_0x506ee4;_0x658b9a=0xc8;}else{_0x658b9a=0xce;}_0x55de9e['status'](_0x658b9a);return _0x55de9e[_0xc2bf('0x31')](_0xc2bf('0x32'),_0x51feb6+'-'+_0x348991+'/'+_0x506ee4)['json'](_0x4a4a00);}return null;};}function patchUpdates(_0x4e6378){return function(_0x2626dc){try{jsonpatch['apply'](_0x2626dc,_0x4e6378,!![]);}catch(_0x2b12d3){return BPromise[_0xc2bf('0x33')](_0x2b12d3);}return _0x2626dc[_0xc2bf('0x34')]();};}function saveUpdates(_0x352148,_0x4c63c3){return function(_0x8855a2){if(_0x8855a2){return _0x8855a2[_0xc2bf('0x35')](_0x352148)[_0xc2bf('0x1f')](function(_0x23a84e){return _0x23a84e;});}return null;};}function removeEntity(_0x105d8f,_0x5c8996){return function(_0x2f63c1){if(_0x2f63c1){return _0x2f63c1[_0xc2bf('0x36')]()[_0xc2bf('0x1f')](function(){var _0x2555c1=_0x2f63c1[_0xc2bf('0x37')]({'plain':!![]});var _0x128aad=_0xc2bf('0x38');return db['UserProfileResource'][_0xc2bf('0x36')]({'where':{'type':_0x128aad,'resourceId':_0x2555c1['id']}})[_0xc2bf('0x1f')](function(){return _0x2f63c1;});})[_0xc2bf('0x1f')](function(){_0x105d8f['status'](0xcc)[_0xc2bf('0x2b')]();});}};}function handleEntityNotFound(_0xc9c86,_0xc72c86){return function(_0x30775e){if(!_0x30775e){_0xc9c86[_0xc2bf('0x29')](0x194);}return _0x30775e;};}function handleError(_0x1128ec,_0x31eff8){_0x31eff8=_0x31eff8||0x1f4;return function(_0x51ad9c){logger[_0xc2bf('0x25')](_0x51ad9c[_0xc2bf('0x39')]);if(_0x51ad9c[_0xc2bf('0x3a')]){delete _0x51ad9c[_0xc2bf('0x3a')];}_0x1128ec[_0xc2bf('0x2a')](_0x31eff8)['send'](_0x51ad9c);};}exports['index']=function(_0x4adafa,_0x298791){var _0x34d86a={'include':[{'model':db['Pause'],'as':_0xc2bf('0x3b')}]},_0x3a7320={},_0x1f8d5b={'count':0x0,'rows':[]};var _0x46acee=_[_0xc2bf('0x3c')](db['SmsAccount']['rawAttributes'],function(_0x1c257c){return{'name':_0x1c257c[_0xc2bf('0x3d')],'type':_0x1c257c[_0xc2bf('0x3e')]['key']};});_0x3a7320[_0xc2bf('0x3f')]=_['map'](_0x46acee,_0xc2bf('0x3a'));_0x3a7320[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x4adafa[_0xc2bf('0x40')]);_0x3a7320[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x3a7320['model'],_0x3a7320[_0xc2bf('0x40')]);_0x34d86a[_0xc2bf('0x44')]=_['intersection'](_0x3a7320[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x34d86a[_0xc2bf('0x44')]=_0x34d86a[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x34d86a[_0xc2bf('0x44')]:_0x3a7320['model'];if(!_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x34d86a[_0xc2bf('0x2f')]=qs[_0xc2bf('0x2f')](_0x4adafa['query'][_0xc2bf('0x2f')]);_0x34d86a[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x4adafa[_0xc2bf('0x40')]['offset']);}_0x34d86a[_0xc2bf('0x49')]=qs['sort'](_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x34d86a[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x4adafa[_0xc2bf('0x40')],_0x3a7320['filters']),_0x46acee);if(_0x4adafa['query']['filter']){_0x34d86a['where']=_[_0xc2bf('0x4d')](_0x34d86a['where'],{'$or':_[_0xc2bf('0x3c')](_0x46acee,function(_0x4ff986){if(_0x4ff986['type']!==_0xc2bf('0x4e')){var _0x437655={};_0x437655[_0x4ff986[_0xc2bf('0x3a')]]={'$like':'%'+_0x4adafa[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x437655;}})});}_0x34d86a=_['merge']({},_0x34d86a,_0x4adafa[_0xc2bf('0x50')]);var _0x524714={'where':_0x34d86a[_0xc2bf('0x4b')]};return db[_0xc2bf('0x51')]['count'](_0x524714)[_0xc2bf('0x1f')](function(_0x2e5dc0){_0x1f8d5b[_0xc2bf('0x30')]=_0x2e5dc0;if(_0x4adafa['query'][_0xc2bf('0x52')]){_0x34d86a['include']=[{'all':!![]}];}return db[_0xc2bf('0x51')]['findAll'](_0x34d86a);})[_0xc2bf('0x1f')](function(_0x17e64d){_0x1f8d5b['rows']=_0x17e64d;return _0x1f8d5b;})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x298791,_0x34d86a))[_0xc2bf('0x28')](handleError(_0x298791,null));};exports[_0xc2bf('0x53')]=function(_0x4fa5b8,_0x230393){var _0x39727b={'raw':![],'where':{'id':_0x4fa5b8[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0x55')],'as':_0xc2bf('0x3b')}]},_0x345b82={};_0x345b82[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x51')]['rawAttributes']);_0x345b82[_0xc2bf('0x40')]=_['keys'](_0x4fa5b8[_0xc2bf('0x40')]);_0x345b82[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x345b82[_0xc2bf('0x3f')],_0x345b82[_0xc2bf('0x40')]);_0x39727b[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x345b82[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4fa5b8[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x39727b[_0xc2bf('0x44')]=_0x39727b[_0xc2bf('0x44')]['length']?_0x39727b[_0xc2bf('0x44')]:_0x345b82[_0xc2bf('0x3f')];if(_0x4fa5b8['query'][_0xc2bf('0x52')]){_0x39727b['include']=[{'all':!![]}];}_0x39727b=_['merge']({},_0x39727b,_0x4fa5b8['options']);return db[_0xc2bf('0x51')]['find'](_0x39727b)[_0xc2bf('0x1f')](handleEntityNotFound(_0x230393,null))['then'](respondWithResult(_0x230393,null))[_0xc2bf('0x28')](handleError(_0x230393,null));};exports[_0xc2bf('0x56')]=function(_0x86c536,_0xdb5e79){return db[_0xc2bf('0x51')][_0xc2bf('0x56')](_0x86c536[_0xc2bf('0x57')],{})[_0xc2bf('0x1f')](function(_0x2b67f9){var _0x556d8a=_0x86c536[_0xc2bf('0x58')]['get']({'plain':!![]});if(!_0x556d8a)throw new Error(_0xc2bf('0x59'));if(_0x556d8a['role']===_0xc2bf('0x58')){var _0x5d37e2=_0x2b67f9[_0xc2bf('0x37')]({'plain':!![]});var _0x228bc8=_0xc2bf('0x38');return db[_0xc2bf('0x5a')][_0xc2bf('0x5b')]({'where':{'name':_0x228bc8,'userProfileId':_0x556d8a[_0xc2bf('0x5c')]},'raw':!![]})[_0xc2bf('0x1f')](function(_0x543e0d){if(_0x543e0d&&_0x543e0d[_0xc2bf('0x5d')]===0x0){return db[_0xc2bf('0x5e')]['create']({'name':_0x5d37e2[_0xc2bf('0x3a')],'resourceId':_0x5d37e2['id'],'type':_0x543e0d[_0xc2bf('0x3a')],'sectionId':_0x543e0d['id']},{})[_0xc2bf('0x1f')](function(){return _0x2b67f9;});}else{return _0x2b67f9;}})[_0xc2bf('0x28')](function(_0x443c46){logger[_0xc2bf('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x443c46);throw _0x443c46;});}return _0x2b67f9;})[_0xc2bf('0x1f')](respondWithResult(_0xdb5e79,0xc9))[_0xc2bf('0x28')](handleError(_0xdb5e79,null));};exports['update']=function(_0x37e699,_0x40f69b){if(_0x37e699[_0xc2bf('0x57')]['id']){delete _0x37e699[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x37e699[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0x55')],'as':_0xc2bf('0x3b')}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x40f69b,null))[_0xc2bf('0x1f')](saveUpdates(_0x37e699[_0xc2bf('0x57')],null))[_0xc2bf('0x1f')](respondWithResult(_0x40f69b,null))[_0xc2bf('0x28')](handleError(_0x40f69b,null));};exports['destroy']=function(_0x663e54,_0x32c497){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x663e54['params']['id']}})['then'](handleEntityNotFound(_0x32c497,null))[_0xc2bf('0x1f')](removeEntity(_0x32c497,null))[_0xc2bf('0x28')](handleError(_0x32c497,null));};exports[_0xc2bf('0x5f')]=function(_0x1d185e,_0xcff3){return db[_0xc2bf('0x51')][_0xc2bf('0x5f')]()[_0xc2bf('0x1f')](respondWithResult(_0xcff3,null))['catch'](handleError(_0xcff3,null));};exports[_0xc2bf('0x60')]=function(_0x19797f,_0x4debf6,_0x161021){if(_0x19797f[_0xc2bf('0x57')]['id']){delete _0x19797f[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x19797f[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x4debf6,null))[_0xc2bf('0x1f')](function(_0x45b399){if(_0x45b399){_0x19797f[_0xc2bf('0x57')][_0xc2bf('0x61')]=_0x45b399['id'];return db[_0xc2bf('0x62')]['create'](_0x19797f[_0xc2bf('0x57')]);}})[_0xc2bf('0x1f')](respondWithResult(_0x4debf6,null))[_0xc2bf('0x28')](handleError(_0x4debf6,null));};exports[_0xc2bf('0x63')]=function(_0x2914a0,_0x42d9b1,_0x10681b){var _0x10c468={'raw':![],'where':{}};var _0x28603b={};var _0x2faea6={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x2914a0[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x42d9b1,null))[_0xc2bf('0x1f')](function(_0x170b33){if(_0x170b33){_0x28603b[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x62')][_0xc2bf('0x65')]);_0x28603b['query']=_[_0xc2bf('0x41')](_0x2914a0[_0xc2bf('0x40')]);_0x28603b['filters']=_['intersection'](_0x28603b['model'],_0x28603b[_0xc2bf('0x40')]);_0x10c468[_0xc2bf('0x44')]=_['intersection'](_0x28603b[_0xc2bf('0x3f')],qs['fields'](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x10c468[_0xc2bf('0x44')]=_0x10c468['attributes']['length']?_0x10c468['attributes']:_0x28603b[_0xc2bf('0x3f')];if(!_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x10c468[_0xc2bf('0x2f')]=qs['limit'](_0x2914a0[_0xc2bf('0x40')]['limit']);_0x10c468[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}_0x10c468[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x10c468[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x2914a0[_0xc2bf('0x40')],_0x28603b[_0xc2bf('0x42')]));_0x10c468[_0xc2bf('0x4b')]['SmsAccountId']=_0x170b33['id'];if(_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4f')]){_0x10c468['where']=_[_0xc2bf('0x4d')](_0x10c468[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x10c468[_0xc2bf('0x44')],function(_0x4c15ed){var _0x169aef={};_0x169aef[_0x4c15ed]={'$like':'%'+_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x169aef;})});}_0x10c468=_[_0xc2bf('0x4d')]({},_0x10c468,_0x2914a0['options']);return db[_0xc2bf('0x62')][_0xc2bf('0x30')]({'where':_0x10c468['where']})['then'](function(_0x2c4bae){_0x2faea6[_0xc2bf('0x30')]=_0x2c4bae;if(_0x2914a0[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x10c468[_0xc2bf('0x66')]=[{'all':!![]}];}return db[_0xc2bf('0x62')][_0xc2bf('0x67')](_0x10c468);})['then'](function(_0x164933){_0x2faea6[_0xc2bf('0x68')]=_0x164933;return _0x2faea6;});}})['then'](respondWithFilteredResult(_0x42d9b1,_0x10c468))[_0xc2bf('0x28')](handleError(_0x42d9b1,null));};exports['removeDispositions']=function(_0x5a4233,_0x328cdd,_0x4795e2){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x5a4233[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x328cdd,null))[_0xc2bf('0x1f')](function(_0x28d7ca){if(_0x28d7ca){return _0x28d7ca[_0xc2bf('0x69')](_0x5a4233[_0xc2bf('0x40')][_0xc2bf('0x6a')]);}})[_0xc2bf('0x1f')](respondWithStatusCode(_0x328cdd,null))[_0xc2bf('0x28')](handleError(_0x328cdd,null));};exports[_0xc2bf('0x6b')]=function(_0x3a6bb6,_0xebeba2,_0x8bc73d){if(_0x3a6bb6[_0xc2bf('0x57')]['id']){delete _0x3a6bb6[_0xc2bf('0x57')]['id'];}return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x3a6bb6['params']['id']}})['then'](handleEntityNotFound(_0xebeba2,null))[_0xc2bf('0x1f')](function(_0x5ada47){if(_0x5ada47){_0x3a6bb6[_0xc2bf('0x57')]['SmsAccountId']=_0x5ada47['id'];return db['CannedAnswer'][_0xc2bf('0x56')](_0x3a6bb6[_0xc2bf('0x57')]);}})[_0xc2bf('0x1f')](respondWithResult(_0xebeba2,null))[_0xc2bf('0x28')](handleError(_0xebeba2,null));};exports[_0xc2bf('0x6c')]=function(_0x4c73a8,_0x2cd19c,_0x446020){var _0x41c7f3={'raw':![],'where':{}};var _0x4cf173={};var _0x3975bd={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x4c73a8[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x2cd19c,null))['then'](function(_0x4e385a){if(_0x4e385a){_0x4cf173[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x6d')][_0xc2bf('0x65')]);_0x4cf173['query']=_[_0xc2bf('0x41')](_0x4c73a8[_0xc2bf('0x40')]);_0x4cf173[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x4cf173[_0xc2bf('0x3f')],_0x4cf173[_0xc2bf('0x40')]);_0x41c7f3[_0xc2bf('0x44')]=_['intersection'](_0x4cf173[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x41c7f3[_0xc2bf('0x44')]=_0x41c7f3[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x41c7f3[_0xc2bf('0x44')]:_0x4cf173[_0xc2bf('0x3f')];if(!_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x41c7f3['limit']=qs[_0xc2bf('0x2f')](_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x41c7f3[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x4c73a8[_0xc2bf('0x40')]['offset']);}_0x41c7f3[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x4c73a8['query'][_0xc2bf('0x4a')]);_0x41c7f3['where']=qs['filters'](_['pick'](_0x4c73a8[_0xc2bf('0x40')],_0x4cf173[_0xc2bf('0x42')]));_0x41c7f3[_0xc2bf('0x4b')][_0xc2bf('0x61')]=_0x4e385a['id'];if(_0x4c73a8[_0xc2bf('0x40')]['filter']){_0x41c7f3[_0xc2bf('0x4b')]=_[_0xc2bf('0x4d')](_0x41c7f3[_0xc2bf('0x4b')],{'$or':_['map'](_0x41c7f3[_0xc2bf('0x44')],function(_0xe1f55c){var _0x99cb04={};_0x99cb04[_0xe1f55c]={'$like':'%'+_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x99cb04;})});}_0x41c7f3=_[_0xc2bf('0x4d')]({},_0x41c7f3,_0x4c73a8['options']);return db[_0xc2bf('0x6d')][_0xc2bf('0x30')]({'where':_0x41c7f3[_0xc2bf('0x4b')]})[_0xc2bf('0x1f')](function(_0x3d0734){_0x3975bd[_0xc2bf('0x30')]=_0x3d0734;if(_0x4c73a8[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x41c7f3['include']=[{'all':!![]}];}return db[_0xc2bf('0x6d')]['findAll'](_0x41c7f3);})[_0xc2bf('0x1f')](function(_0x233110){_0x3975bd[_0xc2bf('0x68')]=_0x233110;return _0x3975bd;});}})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x2cd19c,_0x41c7f3))[_0xc2bf('0x28')](handleError(_0x2cd19c,null));};exports[_0xc2bf('0x6e')]=function(_0x418f5f,_0xf1fd80,_0x32bc7f){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x418f5f['params']['id']}})['then'](handleEntityNotFound(_0xf1fd80,null))[_0xc2bf('0x1f')](function(_0x4620e7){if(_0x4620e7){return _0x4620e7[_0xc2bf('0x6e')](_0x418f5f[_0xc2bf('0x40')]['ids']);}})[_0xc2bf('0x1f')](respondWithStatusCode(_0xf1fd80,null))[_0xc2bf('0x28')](handleError(_0xf1fd80,null));};exports[_0xc2bf('0x6f')]=function(_0x458e59,_0x24fcf0,_0x2e1aeb){var _0x174499={'channel':_0xc2bf('0x70')};var _0x4321ad=[];var _0x1b79bb=[];var _0x2d3dee={};return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x458e59['params']['id']},'include':[{'model':db[_0xc2bf('0x71')],'as':'Applications'}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x24fcf0,null))[_0xc2bf('0x1f')](function(_0x37fbd9){_0x174499['account']=_0x37fbd9;_0x174499[_0xc2bf('0x72')]=_['orderBy'](_0x37fbd9[_0xc2bf('0x73')],['priority'],[_0xc2bf('0x74')]);if(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x73')]){delete _0x174499[_0xc2bf('0x75')][_0xc2bf('0x73')];}return db[_0xc2bf('0x76')][_0xc2bf('0x5f')]();})[_0xc2bf('0x1f')](function(_0x54c87c){if(!_0x54c87c){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x79'));}_0x4321ad=_[_0xc2bf('0x7a')](_[_0xc2bf('0x41')](_0x54c87c),['createdAt',_0xc2bf('0x7b')]);_0x1b79bb=_['difference'](_[_0xc2bf('0x41')](_0x54c87c),[_0xc2bf('0x7c'),'updatedAt',_0xc2bf('0x7d'),_0xc2bf('0x7e')]);_0x174499[_0xc2bf('0x57')]={'mapKey':_0xc2bf('0x7f')};if(_0x174499[_0xc2bf('0x75')]['type']){switch(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x3e')]){case _0xc2bf('0x80'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59['body'][_0xc2bf('0x81')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59['body'][_0xc2bf('0x82')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x84')];break;case _0xc2bf('0x85'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]='+'+_0x458e59['body'][_0xc2bf('0x87')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x88')];break;case _0xc2bf('0x89'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59['body'][_0xc2bf('0x86')];_0x174499[_0xc2bf('0x57')]['body']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x27')];break;case _0xc2bf('0x8a'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x86')];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59['body'][_0xc2bf('0x57')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8b')];break;case _0xc2bf('0x8c'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x81')];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8d')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x8e')];break;case _0xc2bf('0x8f'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]='+'+_0x458e59[_0xc2bf('0x57')]['results'][0x0]['from'];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59['body']['results'][0x0][_0xc2bf('0x88')];_0x174499['body']['messageId']=_0x458e59['body']['results'][0x0]['messageId'];break;case _0xc2bf('0x90'):_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x91')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')]['segmentedMessage'][_0xc2bf('0x27')];break;case _0xc2bf('0x92'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x93')];_0x174499[_0xc2bf('0x57')][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x88')];_0x174499[_0xc2bf('0x57')]['messageId']=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x94')];break;case _0xc2bf('0x95'):_0x174499['body'][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id'];_0x174499['body'][_0xc2bf('0x86')]=_0x458e59[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')][_0xc2bf('0x86')];_0x174499['body']['body']=_0x458e59['body'][0x0][_0xc2bf('0x27')]['text'];break;case _0xc2bf('0x96'):_0x174499[_0xc2bf('0x57')]['from']=_0x458e59[_0xc2bf('0x57')]['from'];_0x174499['body'][_0xc2bf('0x57')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x27')];_0x174499['body'][_0xc2bf('0x83')]=_0x458e59[_0xc2bf('0x57')][_0xc2bf('0x97')];break;}}if(_0x174499[_0xc2bf('0x57')]['id']){delete _0x174499[_0xc2bf('0x57')]['id'];}if(_['isNil'](_0x174499[_0xc2bf('0x57')]['from'])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x98'));}if(_[_0xc2bf('0x99')](_0x174499['body']['body'])||_0x174499[_0xc2bf('0x57')]['body']===''){throw new db['Sequelize'][(_0xc2bf('0x78'))](_0xc2bf('0x9a'));}if(_[_0xc2bf('0x99')](_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')])){throw new db['Sequelize'][(_0xc2bf('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b79bb);}if(!_[_0xc2bf('0x9c')](_0x1b79bb,_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x9d')+_0x1b79bb);}_0x2d3dee[_0x174499['body'][_0xc2bf('0x9b')]]=_0x174499[_0xc2bf('0x57')]['from'];return db['CmList']['find']({'where':{'id':_0x174499[_0xc2bf('0x75')]['ListId']},'include':[{'model':db[_0xc2bf('0x76')],'as':_0xc2bf('0x9e'),'where':_0x2d3dee,'limit':0x1,'order':[['updatedAt',_0xc2bf('0x9f')]]}]});})[_0xc2bf('0x1f')](handleEntityNotFound(_0x24fcf0,null))['then'](function(_0x447b08){if(_0x447b08){_0x174499[_0xc2bf('0xa0')]=_[_0xc2bf('0xa1')](_0x447b08,[_0xc2bf('0x9e')]);if(_0x447b08[_0xc2bf('0x9e')][_0xc2bf('0x46')]){return _0x447b08[_0xc2bf('0x9e')][0x0];}var _0x4351ba=_['defaults'](_0x174499[_0xc2bf('0x57')],{'firstName':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'ListId':_0x447b08['id']});_0x4351ba[_0x174499[_0xc2bf('0x57')][_0xc2bf('0x9b')]]=_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')];return db[_0xc2bf('0x76')][_0xc2bf('0x56')](_0x4351ba,{'fields':_0x4321ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x24fcf0,null))[_0xc2bf('0x1f')](function(_0x5eff3c){if(_0x5eff3c){_0x174499[_0xc2bf('0xa2')]=_0x5eff3c;var _0x55c256={'ContactId':_0x5eff3c['id'],'phone':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id']};var _0x146905={'ContactId':_0x5eff3c['id'],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id'],'closed':![]};return db[_0xc2bf('0xa3')][_0xc2bf('0x5b')]({'where':_0x146905})[_0xc2bf('0x1f')](function(_0xfd4bc4){if(_0xfd4bc4){return[_0xfd4bc4,![]];}return db[_0xc2bf('0xa3')][_0xc2bf('0x56')](_0x55c256)['then'](function(_0x38b612){return[_0x38b612,!![]];});});}})[_0xc2bf('0xa4')](function(_0x3a39aa,_0x127423){_0x174499[_0xc2bf('0xa5')]=_0x3a39aa[_0xc2bf('0x37')]({'plain':!![]});_0x174499[_0xc2bf('0xa5')][_0xc2bf('0xa6')]=![];if(_0x127423){if(_0x174499[_0xc2bf('0x75')]['autoclose']){_0x174499[_0xc2bf('0x72')][_0xc2bf('0xa7')]({'id':0x0,'priority':_0x174499['applications']['length']+0x1,'app':_0xc2bf('0xa8'),'appdata':'unmanaged','interval':_0xc2bf('0xa9')});}_0x174499[_0xc2bf('0xa5')]['created']=!![];}return db[_0xc2bf('0xaa')][_0xc2bf('0x56')]({'phone':_0x174499[_0xc2bf('0x57')][_0xc2bf('0x86')],'messageId':_0x174499[_0xc2bf('0x57')]['messageId'],'body':_0x174499[_0xc2bf('0x57')]['body'],'SmsAccountId':_0x458e59[_0xc2bf('0x54')]['id'],'SmsInteractionId':_0x3a39aa['id'],'direction':'in','ContactId':_0x3a39aa[_0xc2bf('0xab')],'AttachmentId':_0x174499['body']['AttachmentId']});})[_0xc2bf('0x1f')](function(_0x93baca){_0x174499['message']=_0x93baca;if(_0x174499[_0xc2bf('0xa5')]['UserId']){return db[_0xc2bf('0xac')]['find']({'attributes':['id',_0xc2bf('0x3a')],'where':{'id':_0x174499[_0xc2bf('0xa5')][_0xc2bf('0xad')]}})['then'](function(_0x217fd9){if(_0x217fd9){_0x174499['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x217fd9[_0xc2bf('0x3a')]+','+(_0x174499[_0xc2bf('0x75')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc2bf('0xae'),_0xc2bf('0xaf'),_0x174499);});}return respondWithRpcPromise(_0xc2bf('0xae'),_0xc2bf('0xaf'),_0x174499);})[_0xc2bf('0x1f')](function(_0x29c12d){if(_0x29c12d){var _0x77b662=0xc8;var _0x24725c=_0xc2bf('0xb0');logger[_0xc2bf('0x20')](_0xc2bf('0x24'),_0x24725c,_0x77b662,'entity\x20found');logger['debug'](_0xc2bf('0xb1'),_0x24725c,_0x77b662,'entity\x20found',JSON['stringify'](_0x29c12d));if(_0x174499[_0xc2bf('0x75')][_0xc2bf('0x3e')]===_0xc2bf('0x80')){return _0x24fcf0[_0xc2bf('0x2a')](_0x77b662)[_0xc2bf('0x31')](_0xc2bf('0xb2'),'text/xml')['send'](_0xc2bf('0xb3'));}else{return _0x24fcf0[_0xc2bf('0x2a')](_0x77b662)[_0xc2bf('0x2c')](_0x29c12d);}}})[_0xc2bf('0x28')](handleError(_0x24fcf0,null));};exports[_0xc2bf('0xb4')]=function(_0x41219f,_0x139ac8,_0x57d6fa){return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x41219f['params']['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x139ac8,null))[_0xc2bf('0x1f')](function(_0x5e74be){if(_0x5e74be){return db['sequelize'][_0xc2bf('0xb5')](function(_0x59cf26){return db[_0xc2bf('0x71')][_0xc2bf('0x36')]({'where':{'SmsAccountId':_0x41219f[_0xc2bf('0x54')]['id']},'transaction':_0x59cf26})['then'](function(_0x384b8a){var _0x4af615=_[_0xc2bf('0x3c')](_0x41219f[_0xc2bf('0x57')],function(_0x44a903){_0x44a903[_0xc2bf('0x61')]=_0x41219f[_0xc2bf('0x54')]['id'];return _0x44a903;});return db[_0xc2bf('0x71')][_0xc2bf('0xb6')](_0x4af615,{'transaction':_0x59cf26});});})[_0xc2bf('0x1f')](function(){return db['SmsApplication'][_0xc2bf('0xb7')]({'where':{'SmsAccountId':_0x41219f[_0xc2bf('0x54')]['id']},'order':_0xc2bf('0xb8')});});}})[_0xc2bf('0x1f')](respondWithResult(_0x139ac8,null))['catch'](handleError(_0x139ac8,null));};exports[_0xc2bf('0xb9')]=function(_0x42b2d4,_0x545d61,_0x3029c7){var _0x5ac8cf={};var _0x2bf18f={};var _0x3fbfe3;var _0x5c7f03;return db[_0xc2bf('0x51')]['findOne']({'where':{'id':_0x42b2d4[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x545d61,null))['then'](function(_0x212e4d){if(_0x212e4d){_0x3fbfe3=_0x212e4d;_0x2bf18f[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0x71')][_0xc2bf('0x65')]);_0x2bf18f[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x42b2d4[_0xc2bf('0x40')]);_0x2bf18f[_0xc2bf('0x42')]=_[_0xc2bf('0x43')](_0x2bf18f[_0xc2bf('0x3f')],_0x2bf18f[_0xc2bf('0x40')]);_0x5ac8cf[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x2bf18f['model'],qs['fields'](_0x42b2d4[_0xc2bf('0x40')]['fields']));_0x5ac8cf[_0xc2bf('0x44')]=_0x5ac8cf[_0xc2bf('0x44')]['length']?_0x5ac8cf[_0xc2bf('0x44')]:_0x2bf18f[_0xc2bf('0x3f')];_0x5ac8cf[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x42b2d4['query'][_0xc2bf('0x4a')]);_0x5ac8cf[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x42b2d4[_0xc2bf('0x40')],_0x2bf18f[_0xc2bf('0x42')]));if(_0x42b2d4['query'][_0xc2bf('0x4f')]){_0x5ac8cf['where']=_['merge'](_0x5ac8cf['where'],{'$or':_[_0xc2bf('0x3c')](_0x5ac8cf['attributes'],function(_0x14a696){var _0x567a93={};_0x567a93[_0x14a696]={'$like':'%'+_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x4f')]+'%'};return _0x567a93;})});}_0x5ac8cf=_[_0xc2bf('0x4d')]({},_0x5ac8cf,_0x42b2d4['options']);return _0x3fbfe3[_0xc2bf('0xb9')](_0x5ac8cf);}})[_0xc2bf('0x1f')](function(_0x56d0ab){if(_0x56d0ab){_0x5c7f03=_0x56d0ab[_0xc2bf('0x46')];if(!_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x5ac8cf['limit']=qs['limit'](_0x42b2d4[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x5ac8cf['offset']=qs[_0xc2bf('0x2d')](_0x42b2d4[_0xc2bf('0x40')]['offset']);}return _0x3fbfe3[_0xc2bf('0xb9')](_0x5ac8cf);}})[_0xc2bf('0x1f')](function(_0x2b2725){if(_0x2b2725){return _0x2b2725?{'count':_0x5c7f03,'rows':_0x2b2725}:null;}})[_0xc2bf('0x1f')](respondWithResult(_0x545d61,null))[_0xc2bf('0x28')](handleError(_0x545d61,null));};exports['getInteractions']=function(_0x202e36,_0x5a9828,_0x51a0f9){var _0x436e4c={'raw':![],'where':{}};var _0x1cb91e={};var _0x55b76a={'count':0x0,'rows':[]};return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x202e36[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x5a9828,null))[_0xc2bf('0x1f')](function(_0x58d7d7){if(_0x58d7d7){_0x1cb91e[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0xa3')][_0xc2bf('0x65')]);_0x1cb91e['query']=_[_0xc2bf('0x41')](_0x202e36[_0xc2bf('0x40')]);_0x1cb91e[_0xc2bf('0x42')]=_['intersection'](_0x1cb91e[_0xc2bf('0x3f')],_0x1cb91e[_0xc2bf('0x40')]);_0x436e4c['attributes']=_['intersection'](_0x1cb91e[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x202e36['query'][_0xc2bf('0x45')]));_0x436e4c['attributes']=_0x436e4c[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x436e4c['attributes']:_0x1cb91e[_0xc2bf('0x3f')];if(!_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x47')](_0xc2bf('0x48'))){_0x436e4c[_0xc2bf('0x2f')]=qs[_0xc2bf('0x2f')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x2f')]);_0x436e4c[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}_0x436e4c[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x436e4c[_0xc2bf('0x4b')]=qs['filters'](_['pick'](_0x202e36[_0xc2bf('0x40')],_0x1cb91e['filters']));_0x436e4c[_0xc2bf('0x4b')][_0xc2bf('0x61')]=_0x58d7d7['id'];if(_0x202e36[_0xc2bf('0x40')]['filter']){_0x436e4c[_0xc2bf('0x4b')]=_[_0xc2bf('0x4d')](_0x436e4c[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x436e4c[_0xc2bf('0x44')],function(_0x169fd3){var _0x4ba362={};_0x4ba362[_0x169fd3]={'$like':'%'+_0x202e36['query'][_0xc2bf('0x4f')]+'%'};return _0x4ba362;})});}_0x436e4c=_[_0xc2bf('0x4d')]({},_0x436e4c,_0x202e36[_0xc2bf('0x50')]);return db[_0xc2bf('0xa3')][_0xc2bf('0x30')]({'where':_0x436e4c[_0xc2bf('0x4b')]})[_0xc2bf('0x1f')](function(_0x54e01f){_0x55b76a[_0xc2bf('0x30')]=_0x54e01f;if(_0x202e36[_0xc2bf('0x40')][_0xc2bf('0x52')]){_0x436e4c[_0xc2bf('0x66')]=[{'model':db['CmContact'],'as':_0xc2bf('0xba'),'required':![]},{'model':db[_0xc2bf('0xac')],'as':_0xc2bf('0xbb'),'attributes':[_0xc2bf('0x3a'),_0xc2bf('0xbc'),_0xc2bf('0xbd')],'required':![]},{'model':db[_0xc2bf('0xbe')],'as':_0xc2bf('0xbf'),'attributes':['id',_0xc2bf('0x3a'),_0xc2bf('0xc0')],'where':_0x202e36['query'][_0xc2bf('0xc1')]?{'id':_0x202e36[_0xc2bf('0x40')]['tag']}:undefined,'required':_0x202e36['query'][_0xc2bf('0xc1')]?!![]:![]}];}return db[_0xc2bf('0xa3')][_0xc2bf('0x67')](_0x436e4c);})['then'](function(_0x5a4762){_0x55b76a[_0xc2bf('0x68')]=_0x5a4762;return _0x55b76a;});}})[_0xc2bf('0x1f')](respondWithFilteredResult(_0x5a9828,_0x436e4c))[_0xc2bf('0x28')](handleError(_0x5a9828,null));};exports['send']=function(_0x5f1471,_0x347126,_0xadb7e9){var _0x3ec6f5,_0x313b4e,_0x36baba;if(_[_0xc2bf('0x99')](_0x5f1471[_0xc2bf('0x57')][_0xc2bf('0x57')])||_0x5f1471[_0xc2bf('0x57')]['body']===''){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0x9a'));}if(_[_0xc2bf('0x99')](_0x5f1471[_0xc2bf('0x57')]['to'])){throw new db[(_0xc2bf('0x77'))][(_0xc2bf('0x78'))](_0xc2bf('0xc2'));}_0x3ec6f5=_0x5f1471[_0xc2bf('0x57')]['to'];return db['SmsAccount'][_0xc2bf('0x5b')]({'where':{'id':_0x5f1471[_0xc2bf('0x54')]['id']},'include':[{'model':db[_0xc2bf('0xc3')],'as':_0xc2bf('0xc4'),'include':[{'model':db[_0xc2bf('0x76')],'as':'Contacts','where':{'mobile':_0x3ec6f5},'limit':0x1,'order':[['updatedAt',_0xc2bf('0x9f')]]}]}]})[_0xc2bf('0x1f')](handleEntityNotFound(_0x347126,null))[_0xc2bf('0x1f')](function(_0x5ac61a){if(_0x5ac61a&&_0x5ac61a[_0xc2bf('0xc4')]){_0x313b4e=_0x5ac61a[_0xc2bf('0x37')]({'plain':!![]});if(_0x313b4e['List']&&_0x313b4e[_0xc2bf('0xc4')][_0xc2bf('0x9e')][_0xc2bf('0x46')]){return _0x313b4e[_0xc2bf('0xc4')][_0xc2bf('0x9e')][0x0];}return db[_0xc2bf('0x76')]['create'](_[_0xc2bf('0x18')](_0x5f1471['body'],{'firstName':_0x3ec6f5,'mobile':_0x3ec6f5,'phone':_0x3ec6f5,'ListId':_0x313b4e[_0xc2bf('0x7e')]}));}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x347126,null))[_0xc2bf('0x1f')](function(_0x328237){if(_0x328237){_0x36baba=_0x328237;return db['SmsInteraction'][_0xc2bf('0x5b')]({'where':{'ContactId':_0x36baba['id'],'closed':![],'SmsAccountId':_0x313b4e['id']}})[_0xc2bf('0x1f')](function(_0x2c48f4){if(_0x2c48f4){return[_0x2c48f4,![]];}return db['SmsInteraction'][_0xc2bf('0x56')]({'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id'],'SmsAccountId':_0x313b4e['id'],'phone':_0x3ec6f5,'firstMsgDirection':_0xc2bf('0xc5'),'Messages':[_['merge'](_0x5f1471[_0xc2bf('0x57')],{'read':![],'body':_0x5f1471[_0xc2bf('0x57')][_0xc2bf('0x57')],'phone':_0x3ec6f5,'SmsAccountId':_0x313b4e['id'],'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xc2bf('0xc6')}]})['then'](function(_0x5ebf7b){return[_0x5ebf7b,!![]];});});}})[_0xc2bf('0xa4')](function(_0x23f91,_0x73acce){if(_0x73acce){return _0x23f91;}return db[_0xc2bf('0xaa')][_0xc2bf('0x56')](_[_0xc2bf('0x4d')](_0x5f1471[_0xc2bf('0x57')],{'read':![],'body':_0x5f1471['body'][_0xc2bf('0x57')],'phone':_0x3ec6f5,'SmsAccountId':_0x313b4e['id'],'SmsInteractionId':_0x23f91['id'],'UserId':_0x5f1471[_0xc2bf('0x58')]['id'],'ContactId':_0x36baba['id']}))['then'](function(_0xbbfb9d){_0x23f91['dataValues'][_0xc2bf('0xc6')]=[];_0x23f91[_0xc2bf('0xc7')][_0xc2bf('0xc6')][_0xc2bf('0xa7')](_0xbbfb9d[_0xc2bf('0xc7')]);return _0x23f91;});})[_0xc2bf('0x1f')](respondWithResult(_0x347126,null))[_0xc2bf('0x28')](handleError(_0x347126,null));};exports[_0xc2bf('0x2a')]=function(_0x580986,_0xb84e5e,_0x5a144b){if(_0x580986[_0xc2bf('0x57')]['id']){delete _0x580986[_0xc2bf('0x57')]['id'];}var _0x653708,_0x421346,_0x26f84c;return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x580986[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0xb84e5e,null))[_0xc2bf('0x1f')](function(_0x179df6){if(_0x179df6){_0x26f84c=_0x179df6;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xc2bf('0x2a'),_0xc2bf('0xc8'),_0x179df6[_0xc2bf('0x3e')],util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));switch(_0x179df6['type']){case _0xc2bf('0x85'):if(_0x580986[_0xc2bf('0x57')][_0xc2bf('0xca')]&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')]){_0x421346=_0x580986['body'][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0xca')]}});}break;case'connectel':if(_0x580986['body'][_0xc2bf('0xcb')]&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcc')]){_0x421346=_0x580986[_0xc2bf('0x57')]['statusInt'];return db[_0xc2bf('0xaa')]['find']({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcb')]}});}break;case _0xc2bf('0x8a'):if(_0x580986['body'][_0xc2bf('0x8b')]&&_0x580986['body'][_0xc2bf('0xcd')]){_0x421346=_0x580986[_0xc2bf('0x57')][_0xc2bf('0xcd')];return db['SmsMessage'][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0x8b')]}});}break;case'infobip':var _0x1eff80=_0x580986['body'][_0xc2bf('0xce')][0x0];if(_0x1eff80[_0xc2bf('0x83')]&&_0x1eff80['status']['groupName']===_0xc2bf('0xcf')){_0x421346=_0x1eff80[_0xc2bf('0x2a')]['groupName'];return db['SmsMessage']['find']({'where':{'messageId':_0x1eff80[_0xc2bf('0x83')]}});}break;case _0xc2bf('0x92'):if(_0x580986[_0xc2bf('0x57')]['messageId']&&_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')]){_0x421346=_0x580986['body'][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][_0xc2bf('0x83')]}});}break;case _0xc2bf('0x95'):if(_0x580986[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id']){_0x421346=_0x580986['body'][0x0][_0xc2bf('0x3e')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986[_0xc2bf('0x57')][0x0][_0xc2bf('0x27')]['id']}});}break;case _0xc2bf('0x96'):if(_0x580986[_0xc2bf('0x57')][_0xc2bf('0xd0')]&&_0x580986[_0xc2bf('0x57')]['status']){_0x421346=_0x580986[_0xc2bf('0x57')][_0xc2bf('0x2a')];return db[_0xc2bf('0xaa')][_0xc2bf('0x5b')]({'where':{'messageId':_0x580986['body'][_0xc2bf('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0xb84e5e,null))[_0xc2bf('0x1f')](function(_0x2aabfd){if(_0x2aabfd){_0x653708=_0x2aabfd;switch(_0x26f84c[_0xc2bf('0x3e')]){case _0xc2bf('0x85'):if(_0x421346==='DELIVERED'){return _0x653708['update']({'read':!![]});}else{logger['error'](_0xc2bf('0x24'),_0xc2bf('0x2a'),'skebby',util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x89'):if(_0x421346==='1'){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x85'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x8a'):if(!_0x580986[_0xc2bf('0x57')]['error_code']&&_0x421346>=0xc8&&_0x421346<=0xce){return _0x653708['update']({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x8a'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x8f'):var _0x429175=_0x580986[_0xc2bf('0x57')]['results'][0x0];if(_0x429175[_0xc2bf('0x2a')][_0xc2bf('0xd1')]===_0xc2bf('0xcf')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger['error'](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x8f'),util[_0xc2bf('0xc9')](_0x580986['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x421346==_0xc2bf('0xd2')||_0x421346=='RECEIVED_BY_RECIPIENT'){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x92'),util[_0xc2bf('0xc9')](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case _0xc2bf('0x95'):if(_0x421346==_0xc2bf('0xd3')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),'status',_0xc2bf('0x95'),util['inspect'](_0x580986[_0xc2bf('0x57')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x421346===_0xc2bf('0xd4')||_0x421346===_0xc2bf('0xd5')){return _0x653708[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),'status',_0xc2bf('0x96'),util['inspect'](_0x580986['body'],{'showHidden':![],'depth':null}));}break;}return _0x653708;}})[_0xc2bf('0x1f')](respondWithResult(_0xb84e5e,null))[_0xc2bf('0x28')](handleError(_0xb84e5e,null));};exports[_0xc2bf('0xd6')]=function(_0x7ecf7,_0x163885,_0x2767be){var _0x5b44a6,_0x28f2bd,_0x58752d;return db['SmsAccount'][_0xc2bf('0x5b')]({'where':{'id':_0x7ecf7[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x163885,null))['then'](function(_0x39dbfe){if(_0x39dbfe){_0x58752d=_0x39dbfe;logger['debug'](_0xc2bf('0x24'),'status',_0xc2bf('0xc8'),_0x39dbfe[_0xc2bf('0x3e')],util[_0xc2bf('0xc9')](_0x7ecf7[_0xc2bf('0x40')],{'showHidden':![],'depth':null}));switch(_0x39dbfe[_0xc2bf('0x3e')]){case _0xc2bf('0x90'):if(_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd7')]&&_0x7ecf7[_0xc2bf('0x40')]['state']){_0x28f2bd=_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd8')];return db[_0xc2bf('0xaa')]['find']({'where':{'messageId':_0x7ecf7[_0xc2bf('0x40')][_0xc2bf('0xd7')]}});}break;}}})['then'](handleEntityNotFound(_0x163885,null))['then'](function(_0x35a0d0){if(_0x35a0d0){_0x5b44a6=_0x35a0d0;switch(_0x58752d['type']){case _0xc2bf('0x90'):if(_0x28f2bd==='2'||_0x28f2bd==='6'){return _0x5b44a6[_0xc2bf('0x35')]({'read':!![]});}else{logger[_0xc2bf('0x25')](_0xc2bf('0x24'),_0xc2bf('0x2a'),_0xc2bf('0x90'),util[_0xc2bf('0xc9')](_0x7ecf7[_0xc2bf('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x5b44a6;}})['then'](respondWithResult(_0x163885,null))[_0xc2bf('0x28')](handleError(_0x163885,null));};exports['addAgents']=function(_0x199f05,_0x17be6d,_0x150966){return db[_0xc2bf('0x51')][_0xc2bf('0x5b')]({'where':{'id':_0x199f05[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x17be6d,null))['then'](function(_0x281c04){if(_0x281c04){return _0x281c04[_0xc2bf('0xd9')](_0x199f05['body'][_0xc2bf('0x6a')],_[_0xc2bf('0xa1')](_0x199f05['body'],[_0xc2bf('0x6a'),'id'])||{})[_0xc2bf('0xa4')](function(_0x22230c){for(var _0x1c643c=0x0;_0x1c643c<_0x199f05[_0xc2bf('0x57')]['ids'][_0xc2bf('0x46')];_0x1c643c+=0x1){socket['emit'](_0xc2bf('0xda'),{'UserId':Number(_0x199f05[_0xc2bf('0x57')][_0xc2bf('0x6a')][_0x1c643c]),'SmsAccountId':Number(_0x199f05['params']['id'])});}return _0x22230c;});}})[_0xc2bf('0x1f')](respondWithResult(_0x17be6d,null))[_0xc2bf('0x28')](handleError(_0x17be6d,null));};exports['removeAgents']=function(_0x28d74b,_0x5dd92b,_0x3dcab5){return db[_0xc2bf('0x51')]['find']({'where':{'id':_0x28d74b[_0xc2bf('0x54')]['id']}})[_0xc2bf('0x1f')](handleEntityNotFound(_0x5dd92b,null))[_0xc2bf('0x1f')](function(_0x5823b9){if(_0x5823b9){return _0x5823b9['removeAgents'](_0x28d74b[_0xc2bf('0x40')]['ids'])['then'](function(){if(_['isArray'](_0x28d74b[_0xc2bf('0x40')]['ids'])){for(var _0x4232d9=0x0;_0x4232d9<_0x28d74b['query'][_0xc2bf('0x6a')][_0xc2bf('0x46')];_0x4232d9+=0x1){socket[_0xc2bf('0xdb')](_0xc2bf('0xdc'),{'UserId':Number(_0x28d74b[_0xc2bf('0x40')][_0xc2bf('0x6a')][_0x4232d9]),'SmsAccountId':Number(_0x28d74b['params']['id'])});}}else{socket[_0xc2bf('0xdb')](_0xc2bf('0xdc'),{'UserId':Number(_0x28d74b[_0xc2bf('0x40')][_0xc2bf('0x6a')]),'SmsAccountId':Number(_0x28d74b[_0xc2bf('0x54')]['id'])});}});}})[_0xc2bf('0x1f')](respondWithStatusCode(_0x5dd92b,null))['catch'](handleError(_0x5dd92b,null));};exports['getAgents']=function(_0x567010,_0x3b33fa,_0x2bf176){var _0x2a9f75={};var _0x1d4b03={};var _0x1e85cf;var _0x1430fe;return db[_0xc2bf('0x51')][_0xc2bf('0x64')]({'where':{'id':_0x567010[_0xc2bf('0x54')]['id']}})['then'](handleEntityNotFound(_0x3b33fa,null))['then'](function(_0x14b99a){if(_0x14b99a){_0x1e85cf=_0x14b99a;_0x1d4b03[_0xc2bf('0x3f')]=_[_0xc2bf('0x41')](db[_0xc2bf('0xac')]['rawAttributes']);_0x1d4b03[_0xc2bf('0x40')]=_[_0xc2bf('0x41')](_0x567010[_0xc2bf('0x40')]);_0x1d4b03['filters']=_[_0xc2bf('0x43')](_0x1d4b03[_0xc2bf('0x3f')],_0x1d4b03[_0xc2bf('0x40')]);_0x2a9f75[_0xc2bf('0x44')]=_[_0xc2bf('0x43')](_0x1d4b03[_0xc2bf('0x3f')],qs[_0xc2bf('0x45')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x45')]));_0x2a9f75[_0xc2bf('0x44')]=_0x2a9f75[_0xc2bf('0x44')][_0xc2bf('0x46')]?_0x2a9f75[_0xc2bf('0x44')]:_0x1d4b03[_0xc2bf('0x3f')];_0x2a9f75[_0xc2bf('0x49')]=qs[_0xc2bf('0x4a')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x4a')]);_0x2a9f75[_0xc2bf('0x4b')]=qs[_0xc2bf('0x42')](_[_0xc2bf('0x4c')](_0x567010['query'],_0x1d4b03[_0xc2bf('0x42')]));if(_0x567010['query'][_0xc2bf('0x4f')]){_0x2a9f75[_0xc2bf('0x4b')]=_['merge'](_0x2a9f75[_0xc2bf('0x4b')],{'$or':_[_0xc2bf('0x3c')](_0x2a9f75[_0xc2bf('0x44')],function(_0x59971d){var _0x1dc0ad={};_0x1dc0ad[_0x59971d]={'$like':'%'+_0x567010['query']['filter']+'%'};return _0x1dc0ad;})});}_0x2a9f75=_[_0xc2bf('0x4d')]({},_0x2a9f75,_0x567010[_0xc2bf('0x50')]);return _0x1e85cf[_0xc2bf('0xdd')](_0x2a9f75);}})[_0xc2bf('0x1f')](function(_0x3cbec1){if(_0x3cbec1){_0x1430fe=_0x3cbec1[_0xc2bf('0x46')];if(!_0x567010[_0xc2bf('0x40')]['hasOwnProperty']('nolimit')){_0x2a9f75['limit']=qs['limit'](_0x567010['query'][_0xc2bf('0x2f')]);_0x2a9f75[_0xc2bf('0x2d')]=qs[_0xc2bf('0x2d')](_0x567010[_0xc2bf('0x40')][_0xc2bf('0x2d')]);}return _0x1e85cf[_0xc2bf('0xdd')](_0x2a9f75);}})[_0xc2bf('0x1f')](function(_0x3ef8df){if(_0x3ef8df){return _0x3ef8df?{'count':_0x1430fe,'rows':_0x3ef8df}:null;}})[_0xc2bf('0x1f')](respondWithResult(_0x3b33fa,null))[_0xc2bf('0x28')](handleError(_0x3b33fa,null));};
\ No newline at end of file
+var _0x631d=['statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','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','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','map','SmsAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','mandatoryDispositionPause','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','find','autoAssociation','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','SmsApplication','Applications','orderBy','asc','account','CmContact','ValidationError','difference','updatedAt','CompanyId','twilio','from','From','Body','MessageSid','connectel','clicksend','message_id','Text','messageId','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','bandwidth','intelepeer','refid','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','CmList','ListId','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','push','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','transaction','bulkCreate','priority','getApplications','getInteractions','include','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','redif','inspect','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD'];(function(_0x4d0b15,_0x457831){var _0x479024=function(_0x192ae8){while(--_0x192ae8){_0x4d0b15['push'](_0x4d0b15['shift']());}};_0x479024(++_0x457831);}(_0x631d,0xed));var _0xd631=function(_0x10a26a,_0xe95601){_0x10a26a=_0x10a26a-0x0;var _0x2308d9=_0x631d[_0x10a26a];return _0x2308d9;};'use strict';var emlformat=require(_0xd631('0x0'));var rimraf=require(_0xd631('0x1'));var zipdir=require(_0xd631('0x2'));var jsonpatch=require(_0xd631('0x3'));var rp=require(_0xd631('0x4'));var moment=require(_0xd631('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd631('0x6'));var util=require(_0xd631('0x7'));var path=require(_0xd631('0x8'));var sox=require(_0xd631('0x9'));var csv=require(_0xd631('0xa'));var ejs=require(_0xd631('0xb'));var fs=require('fs');var fs_extra=require(_0xd631('0xc'));var _=require(_0xd631('0xd'));var squel=require(_0xd631('0xe'));var crypto=require(_0xd631('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd631('0x10'));var toCsv=require(_0xd631('0xa'));var querystring=require(_0xd631('0x11'));var Papa=require(_0xd631('0x12'));var Redis=require('ioredis');var authService=require(_0xd631('0x13'));var qs=require(_0xd631('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd631('0x15'));var logger=require('../../config/logger')(_0xd631('0x16'));var utils=require('../../config/utils');var config=require(_0xd631('0x17'));var licenseUtil=require(_0xd631('0x18'));var db=require(_0xd631('0x19'))['db'];config[_0xd631('0x1a')]=_[_0xd631('0x1b')](config['redis'],{'host':_0xd631('0x1c'),'port':0x18eb});var socket=require(_0xd631('0x1d'))(new Redis(config['redis']));require(_0xd631('0x1e'))[_0xd631('0x1f')](socket);var jayson=require(_0xd631('0x20'));var client=jayson[_0xd631('0x21')][_0xd631('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x54c998,_0xf3c662,_0x2ec787,_0x1303fd){return new BPromise(function(_0x5648e5,_0x443875){var _0x2f153b=_0x1303fd||client;return _0x2f153b[_0xd631('0x23')](_0x54c998,_0x2ec787)['then'](function(_0x5b687f){logger[_0xd631('0x24')](_0xd631('0x25'),_0xf3c662,_0xd631('0x26'));logger[_0xd631('0x27')](_0xd631('0x28'),_0xf3c662,_0xd631('0x26'),JSON['stringify'](_0x5b687f));if(_0x5b687f[_0xd631('0x29')]){if(_0x5b687f[_0xd631('0x29')]['code']===0x1f4){logger['error'](_0xd631('0x25'),_0xf3c662,_0x5b687f[_0xd631('0x29')][_0xd631('0x2a')]);return _0x443875(_0x5b687f[_0xd631('0x29')][_0xd631('0x2a')]);}logger[_0xd631('0x29')](_0xd631('0x25'),_0xf3c662,_0x5b687f[_0xd631('0x29')][_0xd631('0x2a')]);return _0x5648e5(_0x5b687f['error'][_0xd631('0x2a')]);}else{logger['info'](_0xd631('0x25'),_0xf3c662,_0xd631('0x26'));_0x5648e5(_0x5b687f[_0xd631('0x2b')][_0xd631('0x2a')]);}})[_0xd631('0x2c')](function(_0x5d6bd9){logger['error'](_0xd631('0x25'),_0xf3c662,_0x5d6bd9);_0x443875(_0x5d6bd9);});});}function respondWithStatusCode(_0x8ec199,_0x4cfae){_0x4cfae=_0x4cfae||0xcc;return function(_0x343be4){if(_0x343be4){return _0x8ec199[_0xd631('0x2d')](_0x4cfae);}return _0x8ec199['status'](_0x4cfae)[_0xd631('0x2e')]();};}function respondWithResult(_0x3a54a8,_0x4863e3){_0x4863e3=_0x4863e3||0xc8;return function(_0x993250){if(_0x993250){return _0x3a54a8[_0xd631('0x2f')](_0x4863e3)[_0xd631('0x30')](_0x993250);}};}function respondWithFilteredResult(_0x577a5e,_0x437858){return function(_0x4a92a1){if(_0x4a92a1){var _0x3ae72f=typeof _0x437858[_0xd631('0x31')]==='undefined'&&typeof _0x437858[_0xd631('0x32')]===_0xd631('0x33');var _0x217919=_0x4a92a1['count'];var _0x4cde2e=_0x3ae72f?0x0:_0x437858[_0xd631('0x31')];var _0x1cd8b2=_0x3ae72f?_0x4a92a1[_0xd631('0x34')]:_0x437858[_0xd631('0x31')]+_0x437858[_0xd631('0x32')];var _0x325aed;if(_0x1cd8b2>=_0x217919){_0x1cd8b2=_0x217919;_0x325aed=0xc8;}else{_0x325aed=0xce;}_0x577a5e[_0xd631('0x2f')](_0x325aed);return _0x577a5e[_0xd631('0x35')](_0xd631('0x36'),_0x4cde2e+'-'+_0x1cd8b2+'/'+_0x217919)['json'](_0x4a92a1);}return null;};}function patchUpdates(_0x43c00b){return function(_0x2e8883){try{jsonpatch['apply'](_0x2e8883,_0x43c00b,!![]);}catch(_0x53088b){return BPromise[_0xd631('0x37')](_0x53088b);}return _0x2e8883[_0xd631('0x38')]();};}function saveUpdates(_0x1341db,_0x2f610f){return function(_0x5231b4){if(_0x5231b4){return _0x5231b4[_0xd631('0x39')](_0x1341db)[_0xd631('0x3a')](function(_0x110a7f){return _0x110a7f;});}return null;};}function removeEntity(_0x3c7858,_0x344552){return function(_0x11323d){if(_0x11323d){return _0x11323d[_0xd631('0x3b')]()[_0xd631('0x3a')](function(){var _0x325e07=_0x11323d[_0xd631('0x3c')]({'plain':!![]});var _0xe67a4e='SmsAccounts';return db[_0xd631('0x3d')][_0xd631('0x3b')]({'where':{'type':_0xe67a4e,'resourceId':_0x325e07['id']}})['then'](function(){return _0x11323d;});})[_0xd631('0x3a')](function(){_0x3c7858[_0xd631('0x2f')](0xcc)[_0xd631('0x2e')]();});}};}function handleEntityNotFound(_0x2237b8,_0x26fa2e){return function(_0x947baa){if(!_0x947baa){_0x2237b8['sendStatus'](0x194);}return _0x947baa;};}function handleError(_0x17199d,_0x27f910){_0x27f910=_0x27f910||0x1f4;return function(_0x56a331){logger[_0xd631('0x29')](_0x56a331['stack']);if(_0x56a331[_0xd631('0x3e')]){delete _0x56a331[_0xd631('0x3e')];}_0x17199d[_0xd631('0x2f')](_0x27f910)[_0xd631('0x3f')](_0x56a331);};}exports[_0xd631('0x40')]=function(_0x14cf8a,_0x167048){var _0xba8737={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1ea0a9={},_0x24cc3e={'count':0x0,'rows':[]};var _0x551685=_[_0xd631('0x41')](db[_0xd631('0x42')][_0xd631('0x43')],function(_0x11ab34){return{'name':_0x11ab34[_0xd631('0x44')],'type':_0x11ab34[_0xd631('0x45')]['key']};});_0x1ea0a9['model']=_[_0xd631('0x41')](_0x551685,_0xd631('0x3e'));_0x1ea0a9[_0xd631('0x46')]=_[_0xd631('0x47')](_0x14cf8a['query']);_0x1ea0a9[_0xd631('0x48')]=_[_0xd631('0x49')](_0x1ea0a9[_0xd631('0x4a')],_0x1ea0a9[_0xd631('0x46')]);_0xba8737[_0xd631('0x4b')]=_[_0xd631('0x49')](_0x1ea0a9[_0xd631('0x4a')],qs['fields'](_0x14cf8a['query']['fields']));_0xba8737[_0xd631('0x4b')]=_0xba8737[_0xd631('0x4b')][_0xd631('0x4c')]?_0xba8737[_0xd631('0x4b')]:_0x1ea0a9[_0xd631('0x4a')];if(!_0x14cf8a['query'][_0xd631('0x4d')]('nolimit')){_0xba8737[_0xd631('0x32')]=qs['limit'](_0x14cf8a[_0xd631('0x46')][_0xd631('0x32')]);_0xba8737[_0xd631('0x31')]=qs[_0xd631('0x31')](_0x14cf8a[_0xd631('0x46')][_0xd631('0x31')]);}_0xba8737['order']=qs[_0xd631('0x4e')](_0x14cf8a['query']['sort']);_0xba8737[_0xd631('0x4f')]=qs['filters'](_[_0xd631('0x50')](_0x14cf8a[_0xd631('0x46')],_0x1ea0a9['filters']),_0x551685);if(_0x14cf8a[_0xd631('0x46')][_0xd631('0x51')]){_0xba8737[_0xd631('0x4f')]=_[_0xd631('0x52')](_0xba8737[_0xd631('0x4f')],{'$or':_[_0xd631('0x41')](_0x551685,function(_0x36cde0){if(_0x36cde0[_0xd631('0x45')]!==_0xd631('0x53')){var _0x13cc2d={};_0x13cc2d[_0x36cde0['name']]={'$like':'%'+_0x14cf8a[_0xd631('0x46')][_0xd631('0x51')]+'%'};return _0x13cc2d;}})});}_0xba8737=_[_0xd631('0x52')]({},_0xba8737,_0x14cf8a[_0xd631('0x54')]);var _0x51e462={'where':_0xba8737[_0xd631('0x4f')]};return db[_0xd631('0x42')][_0xd631('0x34')](_0x51e462)[_0xd631('0x3a')](function(_0x5e742c){_0x24cc3e[_0xd631('0x34')]=_0x5e742c;if(_0x14cf8a[_0xd631('0x46')]['includeAll']){_0xba8737['include']=[{'all':!![]}];}return db[_0xd631('0x42')][_0xd631('0x55')](_0xba8737);})[_0xd631('0x3a')](function(_0x51fea6){_0x24cc3e[_0xd631('0x56')]=_0x51fea6;return _0x24cc3e;})[_0xd631('0x3a')](respondWithFilteredResult(_0x167048,_0xba8737))[_0xd631('0x2c')](handleError(_0x167048,null));};exports[_0xd631('0x57')]=function(_0x521f1b,_0x4c8547){var _0x4c4951={'raw':![],'where':{'id':_0x521f1b['params']['id']},'include':[{'model':db['Pause'],'as':_0xd631('0x58')}]},_0x4e548d={};_0x4e548d[_0xd631('0x4a')]=_[_0xd631('0x47')](db[_0xd631('0x42')]['rawAttributes']);_0x4e548d['query']=_['keys'](_0x521f1b[_0xd631('0x46')]);_0x4e548d['filters']=_[_0xd631('0x49')](_0x4e548d[_0xd631('0x4a')],_0x4e548d[_0xd631('0x46')]);_0x4c4951[_0xd631('0x4b')]=_[_0xd631('0x49')](_0x4e548d['model'],qs['fields'](_0x521f1b[_0xd631('0x46')][_0xd631('0x59')]));_0x4c4951['attributes']=_0x4c4951['attributes'][_0xd631('0x4c')]?_0x4c4951[_0xd631('0x4b')]:_0x4e548d['model'];if(_0x521f1b[_0xd631('0x46')][_0xd631('0x5a')]){_0x4c4951['include']=[{'all':!![]}];}_0x4c4951=_[_0xd631('0x52')]({},_0x4c4951,_0x521f1b['options']);return db[_0xd631('0x42')]['find'](_0x4c4951)[_0xd631('0x3a')](handleEntityNotFound(_0x4c8547,null))[_0xd631('0x3a')](respondWithResult(_0x4c8547,null))['catch'](handleError(_0x4c8547,null));};exports[_0xd631('0x5b')]=function(_0x1f6e10,_0x15935b){return db[_0xd631('0x42')][_0xd631('0x5b')](_0x1f6e10[_0xd631('0x5c')],{})[_0xd631('0x3a')](function(_0xd9b8ce){var _0x45ed25=_0x1f6e10[_0xd631('0x5d')][_0xd631('0x3c')]({'plain':!![]});if(!_0x45ed25)throw new Error(_0xd631('0x5e'));if(_0x45ed25[_0xd631('0x5f')]===_0xd631('0x5d')){var _0x597c3a=_0xd9b8ce[_0xd631('0x3c')]({'plain':!![]});var _0x4a197a=_0xd631('0x60');return db[_0xd631('0x61')][_0xd631('0x62')]({'where':{'name':_0x4a197a,'userProfileId':_0x45ed25['userProfileId']},'raw':!![]})[_0xd631('0x3a')](function(_0x85f947){if(_0x85f947&&_0x85f947[_0xd631('0x63')]===0x0){return db[_0xd631('0x3d')][_0xd631('0x5b')]({'name':_0x597c3a[_0xd631('0x3e')],'resourceId':_0x597c3a['id'],'type':_0x85f947[_0xd631('0x3e')],'sectionId':_0x85f947['id']},{})['then'](function(){return _0xd9b8ce;});}else{return _0xd9b8ce;}})['catch'](function(_0x40cebf){logger[_0xd631('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40cebf);throw _0x40cebf;});}return _0xd9b8ce;})[_0xd631('0x3a')](respondWithResult(_0x15935b,0xc9))[_0xd631('0x2c')](handleError(_0x15935b,null));};exports[_0xd631('0x39')]=function(_0x4ef928,_0xd7b014){if(_0x4ef928[_0xd631('0x5c')]['id']){delete _0x4ef928[_0xd631('0x5c')]['id'];}return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x4ef928[_0xd631('0x64')]['id']},'include':[{'model':db['Pause'],'as':_0xd631('0x58')}]})['then'](handleEntityNotFound(_0xd7b014,null))[_0xd631('0x3a')](saveUpdates(_0x4ef928['body'],null))['then'](respondWithResult(_0xd7b014,null))[_0xd631('0x2c')](handleError(_0xd7b014,null));};exports[_0xd631('0x3b')]=function(_0x584334,_0x8d9d96){return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x584334[_0xd631('0x64')]['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x8d9d96,null))[_0xd631('0x3a')](removeEntity(_0x8d9d96,null))[_0xd631('0x2c')](handleError(_0x8d9d96,null));};exports[_0xd631('0x65')]=function(_0x4480bc,_0x23ba37){return db[_0xd631('0x42')][_0xd631('0x65')]()['then'](respondWithResult(_0x23ba37,null))[_0xd631('0x2c')](handleError(_0x23ba37,null));};exports[_0xd631('0x66')]=function(_0x4fef53,_0x58bfdc,_0x31cabc){if(_0x4fef53['body']['id']){delete _0x4fef53[_0xd631('0x5c')]['id'];}return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x4fef53[_0xd631('0x64')]['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x58bfdc,null))[_0xd631('0x3a')](function(_0x1f2ea4){if(_0x1f2ea4){_0x4fef53[_0xd631('0x5c')][_0xd631('0x67')]=_0x1f2ea4['id'];return db[_0xd631('0x68')][_0xd631('0x5b')](_0x4fef53[_0xd631('0x5c')]);}})[_0xd631('0x3a')](respondWithResult(_0x58bfdc,null))[_0xd631('0x2c')](handleError(_0x58bfdc,null));};exports[_0xd631('0x69')]=function(_0x2ebd3b,_0x4f1cbe,_0x4ce54f){var _0x1e029a={'raw':![],'where':{}};var _0x36b979={};var _0x23800d={'count':0x0,'rows':[]};return db['SmsAccount'][_0xd631('0x6a')]({'where':{'id':_0x2ebd3b[_0xd631('0x64')]['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x4f1cbe,null))[_0xd631('0x3a')](function(_0x852b50){if(_0x852b50){_0x36b979[_0xd631('0x4a')]=_['keys'](db[_0xd631('0x68')][_0xd631('0x43')]);_0x36b979['query']=_[_0xd631('0x47')](_0x2ebd3b[_0xd631('0x46')]);_0x36b979[_0xd631('0x48')]=_[_0xd631('0x49')](_0x36b979[_0xd631('0x4a')],_0x36b979[_0xd631('0x46')]);_0x1e029a[_0xd631('0x4b')]=_['intersection'](_0x36b979[_0xd631('0x4a')],qs['fields'](_0x2ebd3b['query'][_0xd631('0x59')]));_0x1e029a[_0xd631('0x4b')]=_0x1e029a[_0xd631('0x4b')][_0xd631('0x4c')]?_0x1e029a[_0xd631('0x4b')]:_0x36b979['model'];if(!_0x2ebd3b[_0xd631('0x46')][_0xd631('0x4d')](_0xd631('0x6b'))){_0x1e029a['limit']=qs['limit'](_0x2ebd3b[_0xd631('0x46')][_0xd631('0x32')]);_0x1e029a[_0xd631('0x31')]=qs[_0xd631('0x31')](_0x2ebd3b[_0xd631('0x46')][_0xd631('0x31')]);}_0x1e029a[_0xd631('0x6c')]=qs[_0xd631('0x4e')](_0x2ebd3b[_0xd631('0x46')]['sort']);_0x1e029a[_0xd631('0x4f')]=qs[_0xd631('0x48')](_[_0xd631('0x50')](_0x2ebd3b['query'],_0x36b979['filters']));_0x1e029a[_0xd631('0x4f')][_0xd631('0x67')]=_0x852b50['id'];if(_0x2ebd3b['query'][_0xd631('0x51')]){_0x1e029a[_0xd631('0x4f')]=_[_0xd631('0x52')](_0x1e029a[_0xd631('0x4f')],{'$or':_[_0xd631('0x41')](_0x1e029a[_0xd631('0x4b')],function(_0x2e5597){var _0x5b7b39={};_0x5b7b39[_0x2e5597]={'$like':'%'+_0x2ebd3b[_0xd631('0x46')][_0xd631('0x51')]+'%'};return _0x5b7b39;})});}_0x1e029a=_[_0xd631('0x52')]({},_0x1e029a,_0x2ebd3b[_0xd631('0x54')]);return db[_0xd631('0x68')][_0xd631('0x34')]({'where':_0x1e029a[_0xd631('0x4f')]})[_0xd631('0x3a')](function(_0x4352f4){_0x23800d[_0xd631('0x34')]=_0x4352f4;if(_0x2ebd3b['query'][_0xd631('0x5a')]){_0x1e029a['include']=[{'all':!![]}];}return db[_0xd631('0x68')][_0xd631('0x55')](_0x1e029a);})[_0xd631('0x3a')](function(_0x1ce8b8){_0x23800d[_0xd631('0x56')]=_0x1ce8b8;return _0x23800d;});}})[_0xd631('0x3a')](respondWithFilteredResult(_0x4f1cbe,_0x1e029a))['catch'](handleError(_0x4f1cbe,null));};exports[_0xd631('0x6d')]=function(_0x5dfe1b,_0x4fd80e,_0x5a673c){return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x5dfe1b[_0xd631('0x64')]['id']}})['then'](handleEntityNotFound(_0x4fd80e,null))[_0xd631('0x3a')](function(_0x18ba1e){if(_0x18ba1e){return _0x18ba1e[_0xd631('0x6d')](_0x5dfe1b[_0xd631('0x46')]['ids']);}})[_0xd631('0x3a')](respondWithStatusCode(_0x4fd80e,null))['catch'](handleError(_0x4fd80e,null));};exports[_0xd631('0x6e')]=function(_0x3f609e,_0x18cebc,_0x4e0322){if(_0x3f609e[_0xd631('0x5c')]['id']){delete _0x3f609e['body']['id'];}return db['SmsAccount'][_0xd631('0x62')]({'where':{'id':_0x3f609e[_0xd631('0x64')]['id']}})['then'](handleEntityNotFound(_0x18cebc,null))['then'](function(_0x38cd51){if(_0x38cd51){_0x3f609e[_0xd631('0x5c')][_0xd631('0x67')]=_0x38cd51['id'];return db[_0xd631('0x6f')][_0xd631('0x5b')](_0x3f609e[_0xd631('0x5c')]);}})[_0xd631('0x3a')](respondWithResult(_0x18cebc,null))['catch'](handleError(_0x18cebc,null));};exports[_0xd631('0x70')]=function(_0x3ff66a,_0x19f928,_0x276791){var _0x524867={'raw':![],'where':{}};var _0x57684c={};var _0x8777eb={'count':0x0,'rows':[]};return db[_0xd631('0x42')][_0xd631('0x6a')]({'where':{'id':_0x3ff66a[_0xd631('0x64')]['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x19f928,null))['then'](function(_0x33ee95){if(_0x33ee95){_0x57684c[_0xd631('0x4a')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x57684c[_0xd631('0x46')]=_[_0xd631('0x47')](_0x3ff66a[_0xd631('0x46')]);_0x57684c[_0xd631('0x48')]=_[_0xd631('0x49')](_0x57684c[_0xd631('0x4a')],_0x57684c[_0xd631('0x46')]);_0x524867['attributes']=_['intersection'](_0x57684c[_0xd631('0x4a')],qs[_0xd631('0x59')](_0x3ff66a[_0xd631('0x46')][_0xd631('0x59')]));_0x524867[_0xd631('0x4b')]=_0x524867[_0xd631('0x4b')][_0xd631('0x4c')]?_0x524867[_0xd631('0x4b')]:_0x57684c['model'];if(!_0x3ff66a['query'][_0xd631('0x4d')](_0xd631('0x6b'))){_0x524867[_0xd631('0x32')]=qs[_0xd631('0x32')](_0x3ff66a[_0xd631('0x46')][_0xd631('0x32')]);_0x524867['offset']=qs['offset'](_0x3ff66a[_0xd631('0x46')]['offset']);}_0x524867[_0xd631('0x6c')]=qs['sort'](_0x3ff66a[_0xd631('0x46')][_0xd631('0x4e')]);_0x524867[_0xd631('0x4f')]=qs[_0xd631('0x48')](_[_0xd631('0x50')](_0x3ff66a[_0xd631('0x46')],_0x57684c[_0xd631('0x48')]));_0x524867[_0xd631('0x4f')][_0xd631('0x67')]=_0x33ee95['id'];if(_0x3ff66a[_0xd631('0x46')][_0xd631('0x51')]){_0x524867[_0xd631('0x4f')]=_['merge'](_0x524867['where'],{'$or':_[_0xd631('0x41')](_0x524867['attributes'],function(_0x3d6a5c){var _0x1729e9={};_0x1729e9[_0x3d6a5c]={'$like':'%'+_0x3ff66a[_0xd631('0x46')]['filter']+'%'};return _0x1729e9;})});}_0x524867=_[_0xd631('0x52')]({},_0x524867,_0x3ff66a[_0xd631('0x54')]);return db[_0xd631('0x6f')][_0xd631('0x34')]({'where':_0x524867[_0xd631('0x4f')]})[_0xd631('0x3a')](function(_0x34f106){_0x8777eb[_0xd631('0x34')]=_0x34f106;if(_0x3ff66a['query'][_0xd631('0x5a')]){_0x524867['include']=[{'all':!![]}];}return db[_0xd631('0x6f')]['findAll'](_0x524867);})[_0xd631('0x3a')](function(_0x41628f){_0x8777eb['rows']=_0x41628f;return _0x8777eb;});}})['then'](respondWithFilteredResult(_0x19f928,_0x524867))[_0xd631('0x2c')](handleError(_0x19f928,null));};exports[_0xd631('0x71')]=function(_0x57d4fd,_0x32ce2a,_0x41c061){return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x57d4fd['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x32ce2a,null))[_0xd631('0x3a')](function(_0x1e4ecb){if(_0x1e4ecb){return _0x1e4ecb[_0xd631('0x71')](_0x57d4fd[_0xd631('0x46')][_0xd631('0x72')]);}})[_0xd631('0x3a')](respondWithStatusCode(_0x32ce2a,null))[_0xd631('0x2c')](handleError(_0x32ce2a,null));};exports[_0xd631('0x73')]=function(_0x27f5cb,_0x27b886,_0x5292f9){var _0x483fb7={'channel':'sms'};var _0x240b7a=[];var _0x172266=[];var _0x44242b={};return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x27f5cb[_0xd631('0x64')]['id']},'include':[{'model':db[_0xd631('0x74')],'as':_0xd631('0x75')}]})[_0xd631('0x3a')](handleEntityNotFound(_0x27b886,null))[_0xd631('0x3a')](function(_0x16fc36){_0x483fb7['account']=_0x16fc36;_0x483fb7['applications']=_[_0xd631('0x76')](_0x16fc36[_0xd631('0x75')],['priority'],[_0xd631('0x77')]);if(_0x483fb7[_0xd631('0x78')][_0xd631('0x75')]){delete _0x483fb7[_0xd631('0x78')][_0xd631('0x75')];}return db[_0xd631('0x79')][_0xd631('0x65')]();})[_0xd631('0x3a')](function(_0x1fc6f5){if(!_0x1fc6f5){throw new db['Sequelize'][(_0xd631('0x7a'))]('no\x20available\x20attributes');}_0x240b7a=_[_0xd631('0x7b')](_['keys'](_0x1fc6f5),['createdAt','updatedAt']);_0x172266=_['difference'](_[_0xd631('0x47')](_0x1fc6f5),['createdAt',_0xd631('0x7c'),_0xd631('0x7d'),'ListId']);_0x483fb7[_0xd631('0x5c')]={'mapKey':'mobile'};if(_0x483fb7[_0xd631('0x78')][_0xd631('0x45')]){switch(_0x483fb7[_0xd631('0x78')][_0xd631('0x45')]){case _0xd631('0x7e'):_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x80')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x81')];_0x483fb7['body']['messageId']=_0x27f5cb['body'][_0xd631('0x82')];break;case'skebby':_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]='+'+_0x27f5cb[_0xd631('0x5c')]['sender'];_0x483fb7['body'][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')]['text'];break;case _0xd631('0x83'):_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb['body'][_0xd631('0x7f')];_0x483fb7[_0xd631('0x5c')]['body']=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x2a')];break;case _0xd631('0x84'):_0x483fb7[_0xd631('0x5c')]['from']=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x7f')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x5c')];_0x483fb7[_0xd631('0x5c')]['messageId']=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x85')];break;case'plivo':_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb['body'][_0xd631('0x80')];_0x483fb7['body'][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x86')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x87')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x88')];break;case _0xd631('0x89'):_0x483fb7[_0xd631('0x5c')]['from']='+'+_0x27f5cb[_0xd631('0x5c')]['results'][0x0][_0xd631('0x7f')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x8a')][0x0][_0xd631('0x8b')];_0x483fb7['body']['messageId']=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x8a')][0x0][_0xd631('0x87')];break;case _0xd631('0x8c'):_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb['body'][_0xd631('0x8d')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x8e')]['message'];break;case _0xd631('0x8f'):_0x483fb7[_0xd631('0x5c')]['from']=_0x27f5cb[_0xd631('0x5c')]['fromNumber'];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb['body'][_0xd631('0x8b')];_0x483fb7['body'][_0xd631('0x87')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x90')];break;case _0xd631('0x91'):_0x483fb7['body']['messageId']=_0x27f5cb[_0xd631('0x5c')][0x0][_0xd631('0x2a')]['id'];_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb[_0xd631('0x5c')][0x0]['message'][_0xd631('0x7f')];_0x483fb7['body'][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][0x0]['message'][_0xd631('0x8b')];break;case _0xd631('0x92'):_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')]=_0x27f5cb['body'][_0xd631('0x7f')];_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')]=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x2a')];_0x483fb7[_0xd631('0x5c')]['messageId']=_0x27f5cb[_0xd631('0x5c')][_0xd631('0x93')];break;}}if(_0x483fb7['body']['id']){delete _0x483fb7['body']['id'];}if(_[_0xd631('0x94')](_0x483fb7['body'][_0xd631('0x7f')])){throw new db['Sequelize'][(_0xd631('0x7a'))](_0xd631('0x95'));}if(_['isNil'](_0x483fb7['body']['body'])||_0x483fb7[_0xd631('0x5c')]['body']===''){throw new db[(_0xd631('0x96'))][(_0xd631('0x7a'))](_0xd631('0x97'));}if(_[_0xd631('0x94')](_0x483fb7['body'][_0xd631('0x98')])){throw new db[(_0xd631('0x96'))]['ValidationError'](_0xd631('0x99')+_0x172266);}if(!_[_0xd631('0x9a')](_0x172266,_0x483fb7[_0xd631('0x5c')][_0xd631('0x98')])){throw new db[(_0xd631('0x96'))][(_0xd631('0x7a'))](_0xd631('0x9b')+_0x172266);}_0x44242b[_0x483fb7['body'][_0xd631('0x98')]]=_0x483fb7['body'][_0xd631('0x7f')];return db[_0xd631('0x9c')][_0xd631('0x62')]({'where':{'id':_0x483fb7[_0xd631('0x78')][_0xd631('0x9d')]},'include':[{'model':db['CmContact'],'as':_0xd631('0x9e'),'where':_0x44242b,'limit':0x1,'order':[[_0xd631('0x7c'),'DESC']]}]});})[_0xd631('0x3a')](handleEntityNotFound(_0x27b886,null))[_0xd631('0x3a')](function(_0x2c6c8b){if(_0x2c6c8b){_0x483fb7[_0xd631('0x9f')]=_[_0xd631('0xa0')](_0x2c6c8b,[_0xd631('0x9e')]);if(_0x2c6c8b[_0xd631('0x9e')][_0xd631('0x4c')]){return _0x2c6c8b[_0xd631('0x9e')][0x0];}var _0x42062f=_[_0xd631('0x1b')](_0x483fb7[_0xd631('0x5c')],{'firstName':_0x483fb7['body'][_0xd631('0x7f')],'ListId':_0x2c6c8b['id']});_0x42062f[_0x483fb7[_0xd631('0x5c')]['mapKey']]=_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')];return db[_0xd631('0x79')][_0xd631('0x5b')](_0x42062f,{'fields':_0x240b7a,'raw':!![]});}})[_0xd631('0x3a')](handleEntityNotFound(_0x27b886,null))['then'](function(_0x58f6fa){if(_0x58f6fa){_0x483fb7[_0xd631('0xa1')]=_0x58f6fa;var _0x2463a4={'ContactId':_0x58f6fa['id'],'phone':_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')],'SmsAccountId':_0x27f5cb[_0xd631('0x64')]['id']};var _0x514eeb={'ContactId':_0x58f6fa['id'],'SmsAccountId':_0x27f5cb['params']['id'],'closed':![]};return db[_0xd631('0xa2')][_0xd631('0x62')]({'where':_0x514eeb})['then'](function(_0x47dab5){if(_0x47dab5){return[_0x47dab5,![]];}return db['SmsInteraction'][_0xd631('0x5b')](_0x2463a4)[_0xd631('0x3a')](function(_0x170a28){return[_0x170a28,!![]];});});}})[_0xd631('0xa3')](function(_0x11642d,_0x482b89){_0x483fb7[_0xd631('0xa4')]=_0x11642d[_0xd631('0x3c')]({'plain':!![]});_0x483fb7['interaction'][_0xd631('0xa5')]=![];if(_0x482b89){if(_0x483fb7['account'][_0xd631('0xa6')]){_0x483fb7[_0xd631('0xa7')][_0xd631('0xa8')]({'id':0x0,'priority':_0x483fb7[_0xd631('0xa7')][_0xd631('0x4c')]+0x1,'app':'close','appdata':_0xd631('0xa9'),'interval':_0xd631('0xaa')});}_0x483fb7[_0xd631('0xa4')][_0xd631('0xa5')]=!![];}return db['SmsMessage'][_0xd631('0x5b')]({'phone':_0x483fb7[_0xd631('0x5c')][_0xd631('0x7f')],'messageId':_0x483fb7[_0xd631('0x5c')][_0xd631('0x87')],'body':_0x483fb7[_0xd631('0x5c')][_0xd631('0x5c')],'SmsAccountId':_0x27f5cb[_0xd631('0x64')]['id'],'SmsInteractionId':_0x11642d['id'],'direction':'in','ContactId':_0x11642d['ContactId'],'AttachmentId':_0x483fb7[_0xd631('0x5c')][_0xd631('0xab')]});})[_0xd631('0x3a')](function(_0x3b31de){_0x483fb7[_0xd631('0x2a')]=_0x3b31de;if(_0x483fb7[_0xd631('0xa4')]['UserId']){return db[_0xd631('0xac')][_0xd631('0x62')]({'attributes':['id','name'],'where':{'id':_0x483fb7[_0xd631('0xa4')][_0xd631('0xad')]}})[_0xd631('0x3a')](function(_0x1d2d18){if(_0x1d2d18){_0x483fb7['applications'][_0xd631('0xae')]({'id':0x0,'priority':0x0,'app':_0xd631('0xaf'),'appdata':_0x1d2d18['name']+','+(_0x483fb7[_0xd631('0x78')][_0xd631('0xb0')]||0xa),'interval':_0xd631('0xaa')});}return respondWithRpcPromise(_0xd631('0xb1'),_0xd631('0xb2'),_0x483fb7);});}return respondWithRpcPromise(_0xd631('0xb1'),_0xd631('0xb2'),_0x483fb7);})[_0xd631('0x3a')](function(_0x1806cf){if(_0x1806cf){var _0x5c3550=0xc8;var _0x203ea9='receiveMessage';logger[_0xd631('0x24')](_0xd631('0x28'),_0x203ea9,_0x5c3550,_0xd631('0xb3'));logger[_0xd631('0x27')](_0xd631('0xb4'),_0x203ea9,_0x5c3550,_0xd631('0xb3'),JSON['stringify'](_0x1806cf));if(_0x483fb7['account'][_0xd631('0x45')]===_0xd631('0x7e')){return _0x27b886[_0xd631('0x2f')](_0x5c3550)[_0xd631('0x35')](_0xd631('0xb5'),_0xd631('0xb6'))['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x27b886[_0xd631('0x2f')](_0x5c3550)[_0xd631('0x30')](_0x1806cf);}}})['catch'](handleError(_0x27b886,null));};exports[_0xd631('0xb7')]=function(_0x6a023a,_0x41d9c3,_0x4dbae3){return db[_0xd631('0x42')][_0xd631('0x6a')]({'where':{'id':_0x6a023a['params']['id']}})['then'](handleEntityNotFound(_0x41d9c3,null))[_0xd631('0x3a')](function(_0x5801db){if(_0x5801db){return db['sequelize'][_0xd631('0xb8')](function(_0x2f9773){return db[_0xd631('0x74')][_0xd631('0x3b')]({'where':{'SmsAccountId':_0x6a023a[_0xd631('0x64')]['id']},'transaction':_0x2f9773})[_0xd631('0x3a')](function(_0x483ed1){var _0x1360d5=_[_0xd631('0x41')](_0x6a023a['body'],function(_0x4ba53d){_0x4ba53d[_0xd631('0x67')]=_0x6a023a[_0xd631('0x64')]['id'];return _0x4ba53d;});return db[_0xd631('0x74')][_0xd631('0xb9')](_0x1360d5,{'transaction':_0x2f9773});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x6a023a[_0xd631('0x64')]['id']},'order':_0xd631('0xba')});});}})['then'](respondWithResult(_0x41d9c3,null))[_0xd631('0x2c')](handleError(_0x41d9c3,null));};exports['getApplications']=function(_0x5d8e5f,_0x39f879,_0x35e7c7){var _0x2c57a7={};var _0x51288e={};var _0x2d32cd;var _0x485e79;return db[_0xd631('0x42')][_0xd631('0x6a')]({'where':{'id':_0x5d8e5f['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x39f879,null))[_0xd631('0x3a')](function(_0x4919eb){if(_0x4919eb){_0x2d32cd=_0x4919eb;_0x51288e[_0xd631('0x4a')]=_[_0xd631('0x47')](db[_0xd631('0x74')][_0xd631('0x43')]);_0x51288e[_0xd631('0x46')]=_['keys'](_0x5d8e5f[_0xd631('0x46')]);_0x51288e[_0xd631('0x48')]=_[_0xd631('0x49')](_0x51288e['model'],_0x51288e[_0xd631('0x46')]);_0x2c57a7[_0xd631('0x4b')]=_['intersection'](_0x51288e['model'],qs[_0xd631('0x59')](_0x5d8e5f[_0xd631('0x46')][_0xd631('0x59')]));_0x2c57a7[_0xd631('0x4b')]=_0x2c57a7[_0xd631('0x4b')]['length']?_0x2c57a7[_0xd631('0x4b')]:_0x51288e[_0xd631('0x4a')];_0x2c57a7[_0xd631('0x6c')]=qs[_0xd631('0x4e')](_0x5d8e5f['query'][_0xd631('0x4e')]);_0x2c57a7[_0xd631('0x4f')]=qs[_0xd631('0x48')](_[_0xd631('0x50')](_0x5d8e5f[_0xd631('0x46')],_0x51288e[_0xd631('0x48')]));if(_0x5d8e5f['query'][_0xd631('0x51')]){_0x2c57a7[_0xd631('0x4f')]=_['merge'](_0x2c57a7['where'],{'$or':_['map'](_0x2c57a7[_0xd631('0x4b')],function(_0xa030f4){var _0x652398={};_0x652398[_0xa030f4]={'$like':'%'+_0x5d8e5f[_0xd631('0x46')][_0xd631('0x51')]+'%'};return _0x652398;})});}_0x2c57a7=_['merge']({},_0x2c57a7,_0x5d8e5f[_0xd631('0x54')]);return _0x2d32cd[_0xd631('0xbb')](_0x2c57a7);}})[_0xd631('0x3a')](function(_0x3370b7){if(_0x3370b7){_0x485e79=_0x3370b7['length'];if(!_0x5d8e5f[_0xd631('0x46')]['hasOwnProperty'](_0xd631('0x6b'))){_0x2c57a7['limit']=qs[_0xd631('0x32')](_0x5d8e5f[_0xd631('0x46')][_0xd631('0x32')]);_0x2c57a7[_0xd631('0x31')]=qs[_0xd631('0x31')](_0x5d8e5f[_0xd631('0x46')]['offset']);}return _0x2d32cd[_0xd631('0xbb')](_0x2c57a7);}})[_0xd631('0x3a')](function(_0x20fa8d){if(_0x20fa8d){return _0x20fa8d?{'count':_0x485e79,'rows':_0x20fa8d}:null;}})['then'](respondWithResult(_0x39f879,null))[_0xd631('0x2c')](handleError(_0x39f879,null));};exports[_0xd631('0xbc')]=function(_0x561b62,_0x4343b7,_0x56d2a2){var _0x568a5a={'raw':![],'where':{}};var _0xbc485e={};var _0x5c66e3={'count':0x0,'rows':[]};return db[_0xd631('0x42')]['findOne']({'where':{'id':_0x561b62['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x4343b7,null))[_0xd631('0x3a')](function(_0x1a7fb9){if(_0x1a7fb9){_0xbc485e[_0xd631('0x4a')]=_[_0xd631('0x47')](db[_0xd631('0xa2')][_0xd631('0x43')]);_0xbc485e['query']=_['keys'](_0x561b62[_0xd631('0x46')]);_0xbc485e[_0xd631('0x48')]=_['intersection'](_0xbc485e[_0xd631('0x4a')],_0xbc485e[_0xd631('0x46')]);_0x568a5a[_0xd631('0x4b')]=_[_0xd631('0x49')](_0xbc485e[_0xd631('0x4a')],qs[_0xd631('0x59')](_0x561b62['query'][_0xd631('0x59')]));_0x568a5a['attributes']=_0x568a5a[_0xd631('0x4b')][_0xd631('0x4c')]?_0x568a5a[_0xd631('0x4b')]:_0xbc485e[_0xd631('0x4a')];if(!_0x561b62[_0xd631('0x46')][_0xd631('0x4d')](_0xd631('0x6b'))){_0x568a5a[_0xd631('0x32')]=qs['limit'](_0x561b62[_0xd631('0x46')][_0xd631('0x32')]);_0x568a5a[_0xd631('0x31')]=qs[_0xd631('0x31')](_0x561b62[_0xd631('0x46')][_0xd631('0x31')]);}_0x568a5a[_0xd631('0x6c')]=qs[_0xd631('0x4e')](_0x561b62[_0xd631('0x46')][_0xd631('0x4e')]);_0x568a5a['where']=qs[_0xd631('0x48')](_[_0xd631('0x50')](_0x561b62[_0xd631('0x46')],_0xbc485e[_0xd631('0x48')]));_0x568a5a[_0xd631('0x4f')][_0xd631('0x67')]=_0x1a7fb9['id'];if(_0x561b62[_0xd631('0x46')][_0xd631('0x51')]){_0x568a5a[_0xd631('0x4f')]=_[_0xd631('0x52')](_0x568a5a[_0xd631('0x4f')],{'$or':_['map'](_0x568a5a[_0xd631('0x4b')],function(_0x3c00da){var _0x4a3993={};_0x4a3993[_0x3c00da]={'$like':'%'+_0x561b62[_0xd631('0x46')][_0xd631('0x51')]+'%'};return _0x4a3993;})});}_0x568a5a=_[_0xd631('0x52')]({},_0x568a5a,_0x561b62['options']);return db[_0xd631('0xa2')][_0xd631('0x34')]({'where':_0x568a5a[_0xd631('0x4f')]})[_0xd631('0x3a')](function(_0x15b2c8){_0x5c66e3[_0xd631('0x34')]=_0x15b2c8;if(_0x561b62[_0xd631('0x46')][_0xd631('0x5a')]){_0x568a5a[_0xd631('0xbd')]=[{'model':db[_0xd631('0x79')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xd631('0x3e'),_0xd631('0xbe'),_0xd631('0xbf')],'required':![]},{'model':db['Tag'],'as':_0xd631('0xc0'),'attributes':['id',_0xd631('0x3e'),_0xd631('0xc1')],'where':_0x561b62[_0xd631('0x46')][_0xd631('0xc2')]?{'id':_0x561b62[_0xd631('0x46')][_0xd631('0xc2')]}:undefined,'required':_0x561b62[_0xd631('0x46')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0xd631('0x55')](_0x568a5a);})[_0xd631('0x3a')](function(_0x24d31c){_0x5c66e3[_0xd631('0x56')]=_0x24d31c;return _0x5c66e3;});}})['then'](respondWithFilteredResult(_0x4343b7,_0x568a5a))['catch'](handleError(_0x4343b7,null));};exports[_0xd631('0x3f')]=function(_0x14d629,_0xdf4ef4,_0x353f21){var _0x105368,_0x26f6b7,_0x32d8b6;if(_[_0xd631('0x94')](_0x14d629[_0xd631('0x5c')]['body'])||_0x14d629[_0xd631('0x5c')][_0xd631('0x5c')]===''){throw new db[(_0xd631('0x96'))]['ValidationError'](_0xd631('0x97'));}if(_[_0xd631('0x94')](_0x14d629['body']['to'])){throw new db[(_0xd631('0x96'))][(_0xd631('0x7a'))](_0xd631('0xc3'));}_0x105368=_0x14d629['body']['to'];return db['SmsAccount'][_0xd631('0x62')]({'where':{'id':_0x14d629[_0xd631('0x64')]['id']},'include':[{'model':db[_0xd631('0x9c')],'as':_0xd631('0xc4'),'include':[{'model':db[_0xd631('0x79')],'as':'Contacts','where':{'mobile':_0x105368},'limit':0x1,'order':[[_0xd631('0x7c'),_0xd631('0xc5')]]}]}]})[_0xd631('0x3a')](handleEntityNotFound(_0xdf4ef4,null))[_0xd631('0x3a')](function(_0x19e32e){if(_0x19e32e&&_0x19e32e[_0xd631('0xc4')]){_0x26f6b7=_0x19e32e[_0xd631('0x3c')]({'plain':!![]});if(_0x26f6b7[_0xd631('0xc4')]&&_0x26f6b7[_0xd631('0xc4')][_0xd631('0x9e')][_0xd631('0x4c')]){return _0x26f6b7[_0xd631('0xc4')][_0xd631('0x9e')][0x0];}return db[_0xd631('0x79')][_0xd631('0x5b')](_[_0xd631('0x1b')](_0x14d629[_0xd631('0x5c')],{'firstName':_0x105368,'mobile':_0x105368,'phone':_0x105368,'ListId':_0x26f6b7[_0xd631('0x9d')]}));}})[_0xd631('0x3a')](handleEntityNotFound(_0xdf4ef4,null))[_0xd631('0x3a')](function(_0x707184){if(_0x707184){_0x32d8b6=_0x707184;return db[_0xd631('0xa2')][_0xd631('0x62')]({'where':{'ContactId':_0x32d8b6['id'],'closed':![],'SmsAccountId':_0x26f6b7['id']}})[_0xd631('0x3a')](function(_0x5d9824){if(_0x5d9824){return[_0x5d9824,![]];}return db['SmsInteraction'][_0xd631('0x5b')]({'UserId':_0x14d629[_0xd631('0x5d')]['id'],'ContactId':_0x32d8b6['id'],'SmsAccountId':_0x26f6b7['id'],'phone':_0x105368,'firstMsgDirection':_0xd631('0xc6'),'Messages':[_['merge'](_0x14d629[_0xd631('0x5c')],{'read':![],'body':_0x14d629[_0xd631('0x5c')][_0xd631('0x5c')],'phone':_0x105368,'SmsAccountId':_0x26f6b7['id'],'UserId':_0x14d629['user']['id'],'ContactId':_0x32d8b6['id']})]},{'include':[{'model':db[_0xd631('0xc7')],'as':_0xd631('0xc8')}]})[_0xd631('0x3a')](function(_0x58e579){return[_0x58e579,!![]];});});}})[_0xd631('0xa3')](function(_0x1f483a,_0x40b1fb){if(_0x40b1fb){return _0x1f483a;}return db[_0xd631('0xc7')]['create'](_[_0xd631('0x52')](_0x14d629[_0xd631('0x5c')],{'read':![],'body':_0x14d629[_0xd631('0x5c')][_0xd631('0x5c')],'phone':_0x105368,'SmsAccountId':_0x26f6b7['id'],'SmsInteractionId':_0x1f483a['id'],'UserId':_0x14d629['user']['id'],'ContactId':_0x32d8b6['id']}))[_0xd631('0x3a')](function(_0x2ca523){_0x1f483a[_0xd631('0xc9')][_0xd631('0xc8')]=[];_0x1f483a['dataValues']['Messages']['push'](_0x2ca523[_0xd631('0xc9')]);return _0x1f483a;});})['then'](respondWithResult(_0xdf4ef4,null))[_0xd631('0x2c')](handleError(_0xdf4ef4,null));};exports[_0xd631('0x2f')]=function(_0x19962b,_0x35795d,_0x5e70f8){if(_0x19962b[_0xd631('0x5c')]['id']){delete _0x19962b['body']['id'];}var _0x36ffe9,_0x16e000,_0x550bb4;return db[_0xd631('0x42')]['find']({'where':{'id':_0x19962b['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x35795d,null))[_0xd631('0x3a')](function(_0x12ef2a){if(_0x12ef2a){_0x550bb4=_0x12ef2a;logger[_0xd631('0x27')](_0xd631('0x28'),_0xd631('0x2f'),_0xd631('0xca'),_0x12ef2a[_0xd631('0x45')],util['inspect'](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));switch(_0x12ef2a[_0xd631('0x45')]){case _0xd631('0xcb'):if(_0x19962b[_0xd631('0x5c')][_0xd631('0xcc')]&&_0x19962b[_0xd631('0x5c')][_0xd631('0x2f')]){_0x16e000=_0x19962b['body']['status'];return db[_0xd631('0xc7')][_0xd631('0x62')]({'where':{'messageId':_0x19962b[_0xd631('0x5c')][_0xd631('0xcc')]}});}break;case'connectel':if(_0x19962b['body'][_0xd631('0xcd')]&&_0x19962b['body'][_0xd631('0xce')]){_0x16e000=_0x19962b[_0xd631('0x5c')]['statusInt'];return db[_0xd631('0xc7')][_0xd631('0x62')]({'where':{'messageId':_0x19962b[_0xd631('0x5c')][_0xd631('0xcd')]}});}break;case _0xd631('0x84'):if(_0x19962b[_0xd631('0x5c')]['message_id']&&_0x19962b['body'][_0xd631('0xcf')]){_0x16e000=_0x19962b[_0xd631('0x5c')][_0xd631('0xcf')];return db['SmsMessage'][_0xd631('0x62')]({'where':{'messageId':_0x19962b[_0xd631('0x5c')][_0xd631('0x85')]}});}break;case _0xd631('0x89'):var _0x1dc851=_0x19962b[_0xd631('0x5c')][_0xd631('0x8a')][0x0];if(_0x1dc851[_0xd631('0x87')]&&_0x1dc851[_0xd631('0x2f')][_0xd631('0xd0')]==='DELIVERED'){_0x16e000=_0x1dc851[_0xd631('0x2f')][_0xd631('0xd0')];return db[_0xd631('0xc7')][_0xd631('0x62')]({'where':{'messageId':_0x1dc851['messageId']}});}break;case _0xd631('0x8f'):if(_0x19962b['body']['messageId']&&_0x19962b['body'][_0xd631('0x2f')]){_0x16e000=_0x19962b[_0xd631('0x5c')][_0xd631('0x2f')];return db[_0xd631('0xc7')]['find']({'where':{'messageId':_0x19962b[_0xd631('0x5c')][_0xd631('0x87')]}});}break;case _0xd631('0x91'):if(_0x19962b[_0xd631('0x5c')][0x0][_0xd631('0x2a')]['id']){_0x16e000=_0x19962b['body'][0x0]['type'];return db[_0xd631('0xc7')][_0xd631('0x62')]({'where':{'messageId':_0x19962b['body'][0x0][_0xd631('0x2a')]['id']}});}break;case _0xd631('0x92'):if(_0x19962b[_0xd631('0x5c')][_0xd631('0xd1')]&&_0x19962b['body'][_0xd631('0x2f')]){_0x16e000=_0x19962b[_0xd631('0x5c')][_0xd631('0x2f')];return db['SmsMessage'][_0xd631('0x62')]({'where':{'messageId':_0x19962b[_0xd631('0x5c')][_0xd631('0xd1')]}});}break;}}})[_0xd631('0x3a')](handleEntityNotFound(_0x35795d,null))['then'](function(_0x1d1b65){if(_0x1d1b65){_0x36ffe9=_0x1d1b65;switch(_0x550bb4[_0xd631('0x45')]){case _0xd631('0xcb'):if(_0x16e000==='DELIVERED'){return _0x36ffe9[_0xd631('0x39')]({'read':!![]});}else{logger[_0xd631('0x29')](_0xd631('0x28'),_0xd631('0x2f'),'skebby',util[_0xd631('0xd2')](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x16e000==='1'){return _0x36ffe9[_0xd631('0x39')]({'read':!![]});}else{logger[_0xd631('0x29')](_0xd631('0x28'),_0xd631('0x2f'),_0xd631('0xcb'),util['inspect'](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x19962b[_0xd631('0x5c')][_0xd631('0xd3')]&&_0x16e000>=0xc8&&_0x16e000<=0xce){return _0x36ffe9[_0xd631('0x39')]({'read':!![]});}else{logger[_0xd631('0x29')](_0xd631('0x28'),_0xd631('0x2f'),_0xd631('0x84'),util[_0xd631('0xd2')](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd631('0x89'):var _0x34cee4=_0x19962b[_0xd631('0x5c')][_0xd631('0x8a')][0x0];if(_0x34cee4[_0xd631('0x2f')][_0xd631('0xd0')]===_0xd631('0xd4')){return _0x36ffe9[_0xd631('0x39')]({'read':!![]});}else{logger['error'](_0xd631('0x28'),'status',_0xd631('0x89'),util[_0xd631('0xd2')](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x16e000==_0xd631('0xd5')||_0x16e000==_0xd631('0xd6')){return _0x36ffe9[_0xd631('0x39')]({'read':!![]});}else{logger[_0xd631('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd631('0x8f'),util['inspect'](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xd631('0x91'):if(_0x16e000==_0xd631('0xd7')){return _0x36ffe9['update']({'read':!![]});}else{logger[_0xd631('0x29')](_0xd631('0x28'),'status',_0xd631('0x91'),util[_0xd631('0xd2')](_0x19962b['body'],{'showHidden':![],'depth':null}));}break;case _0xd631('0x92'):if(_0x16e000==='DELIVRD'||_0x16e000===_0xd631('0xd8')){return _0x36ffe9['update']({'read':!![]});}else{logger['error'](_0xd631('0x28'),_0xd631('0x2f'),_0xd631('0x92'),util[_0xd631('0xd2')](_0x19962b[_0xd631('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x36ffe9;}})[_0xd631('0x3a')](respondWithResult(_0x35795d,null))[_0xd631('0x2c')](handleError(_0x35795d,null));};exports[_0xd631('0xd9')]=function(_0x2b3027,_0x4b693a,_0x36c91b){var _0x29bd37,_0x36d014,_0x8e77b;return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x2b3027['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x4b693a,null))[_0xd631('0x3a')](function(_0x420e50){if(_0x420e50){_0x8e77b=_0x420e50;logger[_0xd631('0x27')](_0xd631('0x28'),_0xd631('0x2f'),_0xd631('0xca'),_0x420e50['type'],util['inspect'](_0x2b3027[_0xd631('0x46')],{'showHidden':![],'depth':null}));switch(_0x420e50[_0xd631('0x45')]){case _0xd631('0x8c'):if(_0x2b3027[_0xd631('0x46')][_0xd631('0xda')]&&_0x2b3027[_0xd631('0x46')][_0xd631('0xdb')]){_0x36d014=_0x2b3027['query'][_0xd631('0xdb')];return db[_0xd631('0xc7')]['find']({'where':{'messageId':_0x2b3027[_0xd631('0x46')][_0xd631('0xda')]}});}break;}}})[_0xd631('0x3a')](handleEntityNotFound(_0x4b693a,null))['then'](function(_0x44efe3){if(_0x44efe3){_0x29bd37=_0x44efe3;switch(_0x8e77b[_0xd631('0x45')]){case _0xd631('0x8c'):if(_0x36d014==='2'||_0x36d014==='6'){return _0x29bd37['update']({'read':!![]});}else{logger[_0xd631('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd631('0x8c'),util[_0xd631('0xd2')](_0x2b3027[_0xd631('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x29bd37;}})[_0xd631('0x3a')](respondWithResult(_0x4b693a,null))[_0xd631('0x2c')](handleError(_0x4b693a,null));};exports[_0xd631('0xdc')]=function(_0x4b5695,_0x4480e0,_0x1aa882){return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x4b5695[_0xd631('0x64')]['id']}})['then'](handleEntityNotFound(_0x4480e0,null))[_0xd631('0x3a')](function(_0x1e2847){if(_0x1e2847){return _0x1e2847[_0xd631('0xdc')](_0x4b5695[_0xd631('0x5c')][_0xd631('0x72')],_[_0xd631('0xa0')](_0x4b5695[_0xd631('0x5c')],['ids','id'])||{})[_0xd631('0xa3')](function(_0xbd80c4){for(var _0x5d57c0=0x0;_0x5d57c0<_0x4b5695[_0xd631('0x5c')][_0xd631('0x72')][_0xd631('0x4c')];_0x5d57c0+=0x1){socket[_0xd631('0xdd')](_0xd631('0xde'),{'UserId':Number(_0x4b5695['body'][_0xd631('0x72')][_0x5d57c0]),'SmsAccountId':Number(_0x4b5695['params']['id'])});}return _0xbd80c4;});}})[_0xd631('0x3a')](respondWithResult(_0x4480e0,null))[_0xd631('0x2c')](handleError(_0x4480e0,null));};exports[_0xd631('0xdf')]=function(_0x54ebae,_0x45d3be,_0x37dac6){return db[_0xd631('0x42')][_0xd631('0x62')]({'where':{'id':_0x54ebae[_0xd631('0x64')]['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x45d3be,null))[_0xd631('0x3a')](function(_0x49a9da){if(_0x49a9da){return _0x49a9da[_0xd631('0xdf')](_0x54ebae[_0xd631('0x46')][_0xd631('0x72')])[_0xd631('0x3a')](function(){if(_[_0xd631('0xe0')](_0x54ebae[_0xd631('0x46')]['ids'])){for(var _0x49280c=0x0;_0x49280c<_0x54ebae[_0xd631('0x46')]['ids']['length'];_0x49280c+=0x1){socket[_0xd631('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x54ebae['query'][_0xd631('0x72')][_0x49280c]),'SmsAccountId':Number(_0x54ebae[_0xd631('0x64')]['id'])});}}else{socket[_0xd631('0xdd')](_0xd631('0xe1'),{'UserId':Number(_0x54ebae[_0xd631('0x46')][_0xd631('0x72')]),'SmsAccountId':Number(_0x54ebae[_0xd631('0x64')]['id'])});}});}})[_0xd631('0x3a')](respondWithStatusCode(_0x45d3be,null))[_0xd631('0x2c')](handleError(_0x45d3be,null));};exports[_0xd631('0xe2')]=function(_0x2d9b6b,_0x1cef33,_0x35f571){var _0x1ed4e0={};var _0x59fe32={};var _0x107735;var _0x1df87a;return db['SmsAccount'][_0xd631('0x6a')]({'where':{'id':_0x2d9b6b['params']['id']}})[_0xd631('0x3a')](handleEntityNotFound(_0x1cef33,null))[_0xd631('0x3a')](function(_0x401a91){if(_0x401a91){_0x107735=_0x401a91;_0x59fe32['model']=_['keys'](db[_0xd631('0xac')]['rawAttributes']);_0x59fe32[_0xd631('0x46')]=_['keys'](_0x2d9b6b[_0xd631('0x46')]);_0x59fe32[_0xd631('0x48')]=_['intersection'](_0x59fe32['model'],_0x59fe32[_0xd631('0x46')]);_0x1ed4e0[_0xd631('0x4b')]=_[_0xd631('0x49')](_0x59fe32[_0xd631('0x4a')],qs['fields'](_0x2d9b6b[_0xd631('0x46')][_0xd631('0x59')]));_0x1ed4e0['attributes']=_0x1ed4e0['attributes']['length']?_0x1ed4e0[_0xd631('0x4b')]:_0x59fe32[_0xd631('0x4a')];_0x1ed4e0['order']=qs['sort'](_0x2d9b6b[_0xd631('0x46')]['sort']);_0x1ed4e0['where']=qs['filters'](_[_0xd631('0x50')](_0x2d9b6b['query'],_0x59fe32[_0xd631('0x48')]));if(_0x2d9b6b[_0xd631('0x46')][_0xd631('0x51')]){_0x1ed4e0[_0xd631('0x4f')]=_[_0xd631('0x52')](_0x1ed4e0[_0xd631('0x4f')],{'$or':_['map'](_0x1ed4e0[_0xd631('0x4b')],function(_0x39c99d){var _0x1fe640={};_0x1fe640[_0x39c99d]={'$like':'%'+_0x2d9b6b['query'][_0xd631('0x51')]+'%'};return _0x1fe640;})});}_0x1ed4e0=_[_0xd631('0x52')]({},_0x1ed4e0,_0x2d9b6b[_0xd631('0x54')]);return _0x107735[_0xd631('0xe2')](_0x1ed4e0);}})[_0xd631('0x3a')](function(_0x11a82b){if(_0x11a82b){_0x1df87a=_0x11a82b['length'];if(!_0x2d9b6b['query'][_0xd631('0x4d')](_0xd631('0x6b'))){_0x1ed4e0['limit']=qs['limit'](_0x2d9b6b[_0xd631('0x46')][_0xd631('0x32')]);_0x1ed4e0[_0xd631('0x31')]=qs['offset'](_0x2d9b6b[_0xd631('0x46')]['offset']);}return _0x107735['getAgents'](_0x1ed4e0);}})[_0xd631('0x3a')](function(_0x115a68){if(_0x115a68){return _0x115a68?{'count':_0x1df87a,'rows':_0x115a68}:null;}})[_0xd631('0x3a')](respondWithResult(_0x1cef33,null))[_0xd631('0x2c')](handleError(_0x1cef33,null));};
\ No newline at end of file
index 7019028..b695991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdfe=['hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xc1a10f,_0x4b706a){var _0x2ff748=function(_0x3bb82d){while(--_0x3bb82d){_0xc1a10f['push'](_0xc1a10f['shift']());}};_0x2ff748(++_0x4b706a);}(_0xcdfe,0x14a));var _0xecdf=function(_0x3f80e2,_0x2afef){_0x3f80e2=_0x3f80e2-0x0;var _0x10b68b=_0xcdfe[_0x3f80e2];return _0x10b68b;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xecdf('0x0'))['db'][_0xecdf('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xecdf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xecdf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40bed5){return function(_0xd24d6,_0x422bc7,_0xef8192){SmsAccountEvents[_0xecdf('0x4')](_0x40bed5+':'+_0xd24d6['id'],_0xd24d6);SmsAccountEvents[_0xecdf('0x4')](_0x40bed5,_0xd24d6);_0xef8192(null);};}for(var e in events){if(events[_0xecdf('0x5')](e)){var event=events[e];SmsAccount[_0xecdf('0x6')](e,emitEvent(event));}}module[_0xecdf('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0xdd51=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x1669c4,_0x4f217a){var _0x5dee11=function(_0x462b48){while(--_0x462b48){_0x1669c4['push'](_0x1669c4['shift']());}};_0x5dee11(++_0x4f217a);}(_0xdd51,0xc1));var _0x1dd5=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xdd51[_0x279d37];return _0x530173;};'use strict';var EventEmitter=require(_0x1dd5('0x0'));var SmsAccount=require(_0x1dd5('0x1'))['db'][_0x1dd5('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1dd5('0x3')](0x0);var events={'afterCreate':_0x1dd5('0x4'),'afterUpdate':_0x1dd5('0x5'),'afterDestroy':_0x1dd5('0x6')};function emitEvent(_0x11351d){return function(_0x19cd23,_0x324b90,_0x4543c0){SmsAccountEvents[_0x1dd5('0x7')](_0x11351d+':'+_0x19cd23['id'],_0x19cd23);SmsAccountEvents[_0x1dd5('0x7')](_0x11351d,_0x19cd23);_0x4543c0(null);};}for(var e in events){if(events[_0x1dd5('0x8')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x1dd5('0x9')]=SmsAccountEvents;
\ No newline at end of file
index f312b67..7fa6237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9eb=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1ff089,_0x686322){var _0x278a2a=function(_0x33a830){while(--_0x33a830){_0x1ff089['push'](_0x1ff089['shift']());}};_0x278a2a(++_0x686322);}(_0xf9eb,0x149));var _0xbf9e=function(_0x5e0ee9,_0xe94ee1){_0x5e0ee9=_0x5e0ee9-0x0;var _0x1bab98=_0xf9eb[_0x5e0ee9];return _0x1bab98;};'use strict';var _=require(_0xbf9e('0x0'));var util=require(_0xbf9e('0x1'));var logger=require(_0xbf9e('0x2'))(_0xbf9e('0x3'));var moment=require('moment');var BPromise=require(_0xbf9e('0x4'));var rp=require(_0xbf9e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbf9e('0x6'));var config=require(_0xbf9e('0x7'));var attributes=require(_0xbf9e('0x8'));module['exports']=function(_0xb51fb6,_0x58f762){return _0xb51fb6[_0xbf9e('0x9')](_0xbf9e('0xa'),attributes,{'tableName':_0xbf9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf573=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','lodash','util'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xf573,0x174));var _0x3f57=function(_0x2502bf,_0x59f569){_0x2502bf=_0x2502bf-0x0;var _0x516d40=_0xf573[_0x2502bf];return _0x516d40;};'use strict';var _=require(_0x3f57('0x0'));var util=require(_0x3f57('0x1'));var logger=require(_0x3f57('0x2'))(_0x3f57('0x3'));var moment=require(_0x3f57('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f57('0x5'));var fs=require('fs');var path=require(_0x3f57('0x6'));var rimraf=require(_0x3f57('0x7'));var config=require(_0x3f57('0x8'));var attributes=require(_0x3f57('0x9'));module['exports']=function(_0x800630,_0x3a5c81){return _0x800630[_0x3f57('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 95b8d90..d5ad6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9158=['http','redis','defaults','socket.io-emitter','register','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0xd8c72f,_0x29b075){var _0x23fd0e=function(_0x11a655){while(--_0x11a655){_0xd8c72f['push'](_0xd8c72f['shift']());}};_0x23fd0e(++_0x29b075);}(_0x9158,0xf3));var _0x8915=function(_0x4cb280,_0x2accb5){_0x4cb280=_0x4cb280-0x0;var _0x3f10df=_0x9158[_0x4cb280];return _0x3f10df;};'use strict';var _=require(_0x8915('0x0'));var util=require('util');var moment=require(_0x8915('0x1'));var BPromise=require(_0x8915('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8915('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8915('0x4'));var logger=require(_0x8915('0x5'))(_0x8915('0x6'));var config=require(_0x8915('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8915('0x8')][_0x8915('0x9')]({'port':0x232a});config[_0x8915('0xa')]=_[_0x8915('0xb')](config[_0x8915('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8915('0xc'))(new Redis(config[_0x8915('0xa')]));require('./smsAccount.socket')[_0x8915('0xd')](socket);function respondWithRpcPromise(_0x278393,_0x3c9ac8,_0x4eee54){return new BPromise(function(_0x49d452,_0x3ccf08){return client[_0x8915('0xe')](_0x278393,_0x4eee54)[_0x8915('0xf')](function(_0x7d9a55){logger[_0x8915('0x10')]('SmsAccount,\x20%s,\x20%s',_0x3c9ac8,'request\x20sent');logger[_0x8915('0x11')](_0x8915('0x12'),_0x3c9ac8,'request\x20sent',JSON[_0x8915('0x13')](_0x7d9a55));if(_0x7d9a55[_0x8915('0x14')]){if(_0x7d9a55[_0x8915('0x14')]['code']===0x1f4){logger[_0x8915('0x14')](_0x8915('0x15'),_0x3c9ac8,_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);return _0x3ccf08(_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);}logger[_0x8915('0x14')]('SmsAccount,\x20%s,\x20%s',_0x3c9ac8,_0x7d9a55[_0x8915('0x14')][_0x8915('0x16')]);return _0x49d452(_0x7d9a55['error'][_0x8915('0x16')]);}else{logger[_0x8915('0x10')](_0x8915('0x15'),_0x3c9ac8,_0x8915('0x17'));_0x49d452(_0x7d9a55[_0x8915('0x18')]['message']);}})[_0x8915('0x19')](function(_0x578714){logger[_0x8915('0x14')](_0x8915('0x15'),_0x3c9ac8,_0x578714);_0x3ccf08(_0x578714);});});}exports['ShowSmsAccount']=function(_0x45d6cc){var _0x42c0f8=this;return new Promise(function(_0x1f4892,_0x3a86fc){return db[_0x8915('0x1a')][_0x8915('0x1b')]({'raw':_0x45d6cc['options']?_0x45d6cc[_0x8915('0x1c')][_0x8915('0x1d')]===undefined?!![]:![]:!![],'where':_0x45d6cc['options']?_0x45d6cc[_0x8915('0x1c')][_0x8915('0x1e')]||null:null,'attributes':_0x45d6cc[_0x8915('0x1c')]?_0x45d6cc['options'][_0x8915('0x1f')]||null:null,'include':_0x45d6cc[_0x8915('0x1c')]?_0x45d6cc[_0x8915('0x1c')]['include']?_['map'](_0x45d6cc[_0x8915('0x1c')][_0x8915('0x20')],function(_0x1bb76f){return{'model':db[_0x1bb76f['model']],'as':_0x1bb76f['as'],'attributes':_0x1bb76f[_0x8915('0x1f')],'include':_0x1bb76f['include']?_['map'](_0x1bb76f['include'],function(_0x1ae57e){return{'model':db[_0x1ae57e[_0x8915('0x21')]],'as':_0x1ae57e['as'],'attributes':_0x1ae57e[_0x8915('0x1f')],'include':_0x1ae57e[_0x8915('0x20')]?_[_0x8915('0x22')](_0x1ae57e['include'],function(_0x5277ef){return{'model':db[_0x5277ef['model']],'as':_0x5277ef['as'],'attributes':_0x5277ef[_0x8915('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8915('0xf')](function(_0x307ede){logger[_0x8915('0x10')]('ShowSmsAccount',_0x45d6cc);logger[_0x8915('0x11')](_0x8915('0x23'),_0x45d6cc,JSON[_0x8915('0x13')](_0x307ede));_0x1f4892(_0x307ede);})[_0x8915('0x19')](function(_0x23a2e1){logger[_0x8915('0x14')](_0x8915('0x23'),_0x23a2e1[_0x8915('0x16')],_0x45d6cc);_0x3a86fc(_0x42c0f8[_0x8915('0x14')](0x1f4,_0x23a2e1['message']));});});};
\ No newline at end of file
+var _0x048b=['defaults','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','raw','options','where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x1233d1,_0x15cf04){var _0x56ee5e=function(_0x470ed9){while(--_0x470ed9){_0x1233d1['push'](_0x1233d1['shift']());}};_0x56ee5e(++_0x15cf04);}(_0x048b,0x139));var _0xb048=function(_0x2e1080,_0x5ee033){_0x2e1080=_0x2e1080-0x0;var _0x557017=_0x048b[_0x2e1080];return _0x557017;};'use strict';var _=require('lodash');var util=require(_0xb048('0x0'));var moment=require(_0xb048('0x1'));var BPromise=require(_0xb048('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb048('0x3'));var db=require(_0xb048('0x4'))['db'];var utils=require(_0xb048('0x5'));var logger=require('../../config/logger')(_0xb048('0x6'));var config=require('../../config/environment');var jayson=require(_0xb048('0x7'));var client=jayson[_0xb048('0x8')][_0xb048('0x9')]({'port':0x232a});config[_0xb048('0xa')]=_[_0xb048('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb048('0xa')]));require(_0xb048('0xc'))[_0xb048('0xd')](socket);function respondWithRpcPromise(_0x44442a,_0x205ac6,_0x4767d4){return new BPromise(function(_0x2cadeb,_0x47c300){return client[_0xb048('0xe')](_0x44442a,_0x4767d4)[_0xb048('0xf')](function(_0x5ee7db){logger['info'](_0xb048('0x10'),_0x205ac6,'request\x20sent');logger[_0xb048('0x11')](_0xb048('0x12'),_0x205ac6,'request\x20sent',JSON[_0xb048('0x13')](_0x5ee7db));if(_0x5ee7db[_0xb048('0x14')]){if(_0x5ee7db[_0xb048('0x14')][_0xb048('0x15')]===0x1f4){logger[_0xb048('0x14')]('SmsAccount,\x20%s,\x20%s',_0x205ac6,_0x5ee7db[_0xb048('0x14')][_0xb048('0x16')]);return _0x47c300(_0x5ee7db[_0xb048('0x14')][_0xb048('0x16')]);}logger[_0xb048('0x14')]('SmsAccount,\x20%s,\x20%s',_0x205ac6,_0x5ee7db[_0xb048('0x14')][_0xb048('0x16')]);return _0x2cadeb(_0x5ee7db[_0xb048('0x14')][_0xb048('0x16')]);}else{logger[_0xb048('0x17')](_0xb048('0x10'),_0x205ac6,_0xb048('0x18'));_0x2cadeb(_0x5ee7db[_0xb048('0x19')]['message']);}})[_0xb048('0x1a')](function(_0xc3c3c1){logger[_0xb048('0x14')]('SmsAccount,\x20%s,\x20%s',_0x205ac6,_0xc3c3c1);_0x47c300(_0xc3c3c1);});});}exports[_0xb048('0x1b')]=function(_0x156707){var _0x41752e=this;return new Promise(function(_0x1a17a0,_0x308ba8){return db[_0xb048('0x1c')]['find']({'raw':_0x156707['options']?_0x156707['options'][_0xb048('0x1d')]===undefined?!![]:![]:!![],'where':_0x156707[_0xb048('0x1e')]?_0x156707[_0xb048('0x1e')][_0xb048('0x1f')]||null:null,'attributes':_0x156707[_0xb048('0x1e')]?_0x156707['options'][_0xb048('0x20')]||null:null,'include':_0x156707[_0xb048('0x1e')]?_0x156707[_0xb048('0x1e')][_0xb048('0x21')]?_[_0xb048('0x22')](_0x156707[_0xb048('0x1e')][_0xb048('0x21')],function(_0x4f93ec){return{'model':db[_0x4f93ec[_0xb048('0x23')]],'as':_0x4f93ec['as'],'attributes':_0x4f93ec[_0xb048('0x20')],'include':_0x4f93ec[_0xb048('0x21')]?_[_0xb048('0x22')](_0x4f93ec[_0xb048('0x21')],function(_0x4aa3a4){return{'model':db[_0x4aa3a4[_0xb048('0x23')]],'as':_0x4aa3a4['as'],'attributes':_0x4aa3a4[_0xb048('0x20')],'include':_0x4aa3a4[_0xb048('0x21')]?_['map'](_0x4aa3a4[_0xb048('0x21')],function(_0x57b892){return{'model':db[_0x57b892[_0xb048('0x23')]],'as':_0x57b892['as'],'attributes':_0x57b892[_0xb048('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb048('0xf')](function(_0x54b150){logger[_0xb048('0x17')](_0xb048('0x1b'),_0x156707);logger[_0xb048('0x11')](_0xb048('0x1b'),_0x156707,JSON['stringify'](_0x54b150));_0x1a17a0(_0x54b150);})[_0xb048('0x1a')](function(_0xdd57b3){logger[_0xb048('0x14')]('ShowSmsAccount',_0xdd57b3[_0xb048('0x16')],_0x156707);_0x308ba8(_0x41752e[_0xb048('0x14')](0x1f4,_0xdd57b3[_0xb048('0x16')]));});});};
\ No newline at end of file
index 1db1435..ea5e54c 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 5794b46..a7cf64b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x5da61f,_0x20d5e8){var _0x516b83=function(_0x129111){while(--_0x129111){_0x5da61f['push'](_0x5da61f['shift']());}};_0x516b83(++_0x20d5e8);}(_0x008c,0x188));var _0xc008=function(_0x1e1ecf,_0x175529){_0x1e1ecf=_0x1e1ecf-0x0;var _0x52be90=_0x008c[_0x1e1ecf];return _0x52be90;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
+var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26a490,_0x1d54cf){var _0x4f14c1=function(_0x47922f){while(--_0x47922f){_0x26a490['push'](_0x26a490['shift']());}};_0x4f14c1(++_0x1d54cf);}(_0x34e8,0x12c));var _0x834e=function(_0x462da3,_0x36d8e5){_0x462da3=_0x462da3-0x0;var _0x35200a=_0x34e8[_0x462da3];return _0x35200a;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router;
\ No newline at end of file
index a1433d6..218eabe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a13=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x192cbe,_0x3b4b43){var _0x4ce395=function(_0x5388ae){while(--_0x5388ae){_0x192cbe['push'](_0x192cbe['shift']());}};_0x4ce395(++_0x3b4b43);}(_0x5a13,0x105));var _0x35a1=function(_0x1a9a83,_0x2b0735){_0x1a9a83=_0x1a9a83-0x0;var _0x280732=_0x5a13[_0x1a9a83];return _0x280732;};'use strict';var Sequelize=require(_0x35a1('0x0'));module[_0x35a1('0x1')]={'priority':{'type':Sequelize[_0x35a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x35a1('0x3')],'allowNull':![],'defaultValue':_0x35a1('0x4')},'appdata':{'type':Sequelize[_0x35a1('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x35a1('0x3')],'defaultValue':_0x35a1('0x6')}};
\ No newline at end of file
+var _0x347a=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x306f2e,_0xb1545d){var _0xccd247=function(_0x176f65){while(--_0x176f65){_0x306f2e['push'](_0x306f2e['shift']());}};_0xccd247(++_0xb1545d);}(_0x347a,0x113));var _0xa347=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x347a[_0x119b3e];return _0x1169ae;};'use strict';var Sequelize=require(_0xa347('0x0'));module[_0xa347('0x1')]={'priority':{'type':Sequelize[_0xa347('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa347('0x3')],'allowNull':![],'defaultValue':_0xa347('0x4')},'appdata':{'type':Sequelize[_0xa347('0x5')]()},'description':{'type':Sequelize[_0xa347('0x3')]},'interval':{'type':Sequelize[_0xa347('0x3')],'defaultValue':_0xa347('0x6')}};
\ No newline at end of file
index 964682c..34d14ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae8=['undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x5ae8,0xc7));var _0x85ae=function(_0x49ab20,_0x204482){_0x49ab20=_0x49ab20-0x0;var _0x3c10b4=_0x5ae8[_0x49ab20];return _0x3c10b4;};'use strict';var emlformat=require(_0x85ae('0x0'));var rimraf=require(_0x85ae('0x1'));var zipdir=require(_0x85ae('0x2'));var jsonpatch=require(_0x85ae('0x3'));var rp=require(_0x85ae('0x4'));var moment=require(_0x85ae('0x5'));var BPromise=require(_0x85ae('0x6'));var Mustache=require('mustache');var util=require(_0x85ae('0x7'));var path=require(_0x85ae('0x8'));var sox=require('sox');var csv=require(_0x85ae('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x85ae('0xa'));var _=require(_0x85ae('0xb'));var squel=require(_0x85ae('0xc'));var crypto=require(_0x85ae('0xd'));var jsforce=require(_0x85ae('0xe'));var deskjs=require(_0x85ae('0xf'));var toCsv=require(_0x85ae('0x9'));var querystring=require(_0x85ae('0x10'));var Papa=require(_0x85ae('0x11'));var Redis=require(_0x85ae('0x12'));var authService=require(_0x85ae('0x13'));var qs=require(_0x85ae('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85ae('0x15'));var logger=require(_0x85ae('0x16'))(_0x85ae('0x17'));var utils=require(_0x85ae('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x85ae('0x19'));var db=require(_0x85ae('0x1a'))['db'];function respondWithStatusCode(_0x10d156,_0x460673){_0x460673=_0x460673||0xcc;return function(_0x326a90){if(_0x326a90){return _0x10d156[_0x85ae('0x1b')](_0x460673);}return _0x10d156[_0x85ae('0x1c')](_0x460673)[_0x85ae('0x1d')]();};}function respondWithResult(_0x255ad7,_0x58ad88){_0x58ad88=_0x58ad88||0xc8;return function(_0x5aab31){if(_0x5aab31){return _0x255ad7['status'](_0x58ad88)[_0x85ae('0x1e')](_0x5aab31);}};}function respondWithFilteredResult(_0x15e15d,_0x397fd1){return function(_0x27167f){if(_0x27167f){var _0x497ba3=typeof _0x397fd1[_0x85ae('0x1f')]===_0x85ae('0x20')&&typeof _0x397fd1[_0x85ae('0x21')]==='undefined';var _0x40dd34=_0x27167f[_0x85ae('0x22')];var _0xaba82d=_0x497ba3?0x0:_0x397fd1[_0x85ae('0x1f')];var _0x3a19d0=_0x497ba3?_0x27167f[_0x85ae('0x22')]:_0x397fd1[_0x85ae('0x1f')]+_0x397fd1[_0x85ae('0x21')];var _0x514cbb;if(_0x3a19d0>=_0x40dd34){_0x3a19d0=_0x40dd34;_0x514cbb=0xc8;}else{_0x514cbb=0xce;}_0x15e15d['status'](_0x514cbb);return _0x15e15d[_0x85ae('0x23')](_0x85ae('0x24'),_0xaba82d+'-'+_0x3a19d0+'/'+_0x40dd34)['json'](_0x27167f);}return null;};}function patchUpdates(_0x10cb9a){return function(_0x519d83){try{jsonpatch[_0x85ae('0x25')](_0x519d83,_0x10cb9a,!![]);}catch(_0x451490){return BPromise[_0x85ae('0x26')](_0x451490);}return _0x519d83['save']();};}function saveUpdates(_0x45798b,_0xd130fb){return function(_0x47de3f){if(_0x47de3f){return _0x47de3f[_0x85ae('0x27')](_0x45798b)[_0x85ae('0x28')](function(_0x190e59){return _0x190e59;});}return null;};}function removeEntity(_0x5aec36,_0x32d2f2){return function(_0x540a91){if(_0x540a91){return _0x540a91[_0x85ae('0x29')]()['then'](function(){_0x5aec36[_0x85ae('0x1c')](0xcc)[_0x85ae('0x1d')]();});}};}function handleEntityNotFound(_0x902179,_0xdeacaf){return function(_0x49eb3d){if(!_0x49eb3d){_0x902179[_0x85ae('0x1b')](0x194);}return _0x49eb3d;};}function handleError(_0x4e2e26,_0x19097d){_0x19097d=_0x19097d||0x1f4;return function(_0x20fa3a){logger[_0x85ae('0x2a')](_0x20fa3a[_0x85ae('0x2b')]);if(_0x20fa3a[_0x85ae('0x2c')]){delete _0x20fa3a[_0x85ae('0x2c')];}_0x4e2e26[_0x85ae('0x1c')](_0x19097d)[_0x85ae('0x2d')](_0x20fa3a);};}exports[_0x85ae('0x2e')]=function(_0x537b81,_0x21535c){var _0xe0c528={},_0xcc87fe={},_0x203230={'count':0x0,'rows':[]};var _0x5d1e8a=_[_0x85ae('0x2f')](db[_0x85ae('0x30')]['rawAttributes'],function(_0xf8fb18){return{'name':_0xf8fb18['fieldName'],'type':_0xf8fb18['type'][_0x85ae('0x31')]};});_0xcc87fe[_0x85ae('0x32')]=_['map'](_0x5d1e8a,_0x85ae('0x2c'));_0xcc87fe[_0x85ae('0x33')]=_['keys'](_0x537b81[_0x85ae('0x33')]);_0xcc87fe['filters']=_[_0x85ae('0x34')](_0xcc87fe[_0x85ae('0x32')],_0xcc87fe['query']);_0xe0c528[_0x85ae('0x35')]=_[_0x85ae('0x34')](_0xcc87fe[_0x85ae('0x32')],qs[_0x85ae('0x36')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x36')]));_0xe0c528[_0x85ae('0x35')]=_0xe0c528['attributes'][_0x85ae('0x37')]?_0xe0c528[_0x85ae('0x35')]:_0xcc87fe['model'];if(!_0x537b81[_0x85ae('0x33')]['hasOwnProperty']('nolimit')){_0xe0c528[_0x85ae('0x21')]=qs[_0x85ae('0x21')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x21')]);_0xe0c528[_0x85ae('0x1f')]=qs[_0x85ae('0x1f')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x1f')]);}_0xe0c528[_0x85ae('0x38')]=qs[_0x85ae('0x39')](_0x537b81[_0x85ae('0x33')][_0x85ae('0x39')]);_0xe0c528[_0x85ae('0x3a')]=qs[_0x85ae('0x3b')](_[_0x85ae('0x3c')](_0x537b81[_0x85ae('0x33')],_0xcc87fe[_0x85ae('0x3b')]),_0x5d1e8a);if(_0x537b81[_0x85ae('0x33')][_0x85ae('0x3d')]){_0xe0c528['where']=_['merge'](_0xe0c528[_0x85ae('0x3a')],{'$or':_[_0x85ae('0x2f')](_0x5d1e8a,function(_0x3e06d4){if(_0x3e06d4[_0x85ae('0x3e')]!==_0x85ae('0x3f')){var _0x4e1144={};_0x4e1144[_0x3e06d4['name']]={'$like':'%'+_0x537b81[_0x85ae('0x33')][_0x85ae('0x3d')]+'%'};return _0x4e1144;}})});}_0xe0c528=_[_0x85ae('0x40')]({},_0xe0c528,_0x537b81[_0x85ae('0x41')]);var _0x3a0e64={'where':_0xe0c528['where']};return db['SmsApplication'][_0x85ae('0x22')](_0x3a0e64)[_0x85ae('0x28')](function(_0x4e4fc0){_0x203230['count']=_0x4e4fc0;if(_0x537b81[_0x85ae('0x33')]['includeAll']){_0xe0c528[_0x85ae('0x42')]=[{'all':!![]}];}return db[_0x85ae('0x30')][_0x85ae('0x43')](_0xe0c528);})[_0x85ae('0x28')](function(_0x356ddc){_0x203230[_0x85ae('0x44')]=_0x356ddc;return _0x203230;})[_0x85ae('0x28')](respondWithFilteredResult(_0x21535c,_0xe0c528))[_0x85ae('0x45')](handleError(_0x21535c,null));};exports['show']=function(_0x9fe81a,_0x216efd){var _0x12ce0c={'raw':!![],'where':{'id':_0x9fe81a[_0x85ae('0x46')]['id']}},_0x2c4202={};_0x2c4202['model']=_[_0x85ae('0x47')](db[_0x85ae('0x30')][_0x85ae('0x48')]);_0x2c4202['query']=_[_0x85ae('0x47')](_0x9fe81a[_0x85ae('0x33')]);_0x2c4202[_0x85ae('0x3b')]=_[_0x85ae('0x34')](_0x2c4202['model'],_0x2c4202[_0x85ae('0x33')]);_0x12ce0c[_0x85ae('0x35')]=_[_0x85ae('0x34')](_0x2c4202['model'],qs[_0x85ae('0x36')](_0x9fe81a[_0x85ae('0x33')][_0x85ae('0x36')]));_0x12ce0c[_0x85ae('0x35')]=_0x12ce0c[_0x85ae('0x35')]['length']?_0x12ce0c[_0x85ae('0x35')]:_0x2c4202[_0x85ae('0x32')];if(_0x9fe81a[_0x85ae('0x33')][_0x85ae('0x49')]){_0x12ce0c[_0x85ae('0x42')]=[{'all':!![]}];}_0x12ce0c=_[_0x85ae('0x40')]({},_0x12ce0c,_0x9fe81a['options']);return db['SmsApplication'][_0x85ae('0x4a')](_0x12ce0c)[_0x85ae('0x28')](handleEntityNotFound(_0x216efd,null))[_0x85ae('0x28')](respondWithResult(_0x216efd,null))[_0x85ae('0x45')](handleError(_0x216efd,null));};exports[_0x85ae('0x4b')]=function(_0x1c1b09,_0x47be6e){return db[_0x85ae('0x30')][_0x85ae('0x4b')](_0x1c1b09['body'],{})['then'](respondWithResult(_0x47be6e,0xc9))[_0x85ae('0x45')](handleError(_0x47be6e,null));};exports[_0x85ae('0x27')]=function(_0x3a919d,_0x3b1bff){if(_0x3a919d[_0x85ae('0x4c')]['id']){delete _0x3a919d['body']['id'];}return db[_0x85ae('0x30')][_0x85ae('0x4a')]({'where':{'id':_0x3a919d[_0x85ae('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b1bff,null))[_0x85ae('0x28')](saveUpdates(_0x3a919d['body'],null))[_0x85ae('0x28')](respondWithResult(_0x3b1bff,null))[_0x85ae('0x45')](handleError(_0x3b1bff,null));};exports[_0x85ae('0x29')]=function(_0x47be9f,_0xb37d8f){return db[_0x85ae('0x30')][_0x85ae('0x4a')]({'where':{'id':_0x47be9f['params']['id']}})[_0x85ae('0x28')](handleEntityNotFound(_0xb37d8f,null))[_0x85ae('0x28')](removeEntity(_0xb37d8f,null))[_0x85ae('0x45')](handleError(_0xb37d8f,null));};
\ No newline at end of file
+var _0x86ee=['request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','fieldName','type','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','rawAttributes','intersection','length','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir'];(function(_0x5e3978,_0x1f026e){var _0x579040=function(_0x148e43){while(--_0x148e43){_0x5e3978['push'](_0x5e3978['shift']());}};_0x579040(++_0x1f026e);}(_0x86ee,0x1cb));var _0xe86e=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x86ee[_0x179b53];return _0x38a146;};'use strict';var emlformat=require(_0xe86e('0x0'));var rimraf=require(_0xe86e('0x1'));var zipdir=require(_0xe86e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe86e('0x3'));var moment=require('moment');var BPromise=require(_0xe86e('0x4'));var Mustache=require(_0xe86e('0x5'));var util=require(_0xe86e('0x6'));var path=require(_0xe86e('0x7'));var sox=require(_0xe86e('0x8'));var csv=require(_0xe86e('0x9'));var ejs=require(_0xe86e('0xa'));var fs=require('fs');var fs_extra=require(_0xe86e('0xb'));var _=require('lodash');var squel=require(_0xe86e('0xc'));var crypto=require(_0xe86e('0xd'));var jsforce=require(_0xe86e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe86e('0xf'));var Papa=require(_0xe86e('0x10'));var Redis=require(_0xe86e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe86e('0x12'));var as=require(_0xe86e('0x13'));var hardwareService=require(_0xe86e('0x14'));var logger=require(_0xe86e('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe86e('0x16'));var db=require(_0xe86e('0x17'))['db'];function respondWithStatusCode(_0x457416,_0xc83db){_0xc83db=_0xc83db||0xcc;return function(_0x2d03eb){if(_0x2d03eb){return _0x457416[_0xe86e('0x18')](_0xc83db);}return _0x457416[_0xe86e('0x19')](_0xc83db)[_0xe86e('0x1a')]();};}function respondWithResult(_0x52dece,_0x256c7c){_0x256c7c=_0x256c7c||0xc8;return function(_0x145e83){if(_0x145e83){return _0x52dece[_0xe86e('0x19')](_0x256c7c)[_0xe86e('0x1b')](_0x145e83);}};}function respondWithFilteredResult(_0x398e58,_0x483714){return function(_0x235174){if(_0x235174){var _0x18d27c=typeof _0x483714[_0xe86e('0x1c')]===_0xe86e('0x1d')&&typeof _0x483714['limit']===_0xe86e('0x1d');var _0x13e994=_0x235174[_0xe86e('0x1e')];var _0x37c9cb=_0x18d27c?0x0:_0x483714[_0xe86e('0x1c')];var _0x50c9ab=_0x18d27c?_0x235174[_0xe86e('0x1e')]:_0x483714[_0xe86e('0x1c')]+_0x483714[_0xe86e('0x1f')];var _0x3cf266;if(_0x50c9ab>=_0x13e994){_0x50c9ab=_0x13e994;_0x3cf266=0xc8;}else{_0x3cf266=0xce;}_0x398e58[_0xe86e('0x19')](_0x3cf266);return _0x398e58[_0xe86e('0x20')](_0xe86e('0x21'),_0x37c9cb+'-'+_0x50c9ab+'/'+_0x13e994)[_0xe86e('0x1b')](_0x235174);}return null;};}function patchUpdates(_0x512d31){return function(_0x5b5f41){try{jsonpatch[_0xe86e('0x22')](_0x5b5f41,_0x512d31,!![]);}catch(_0x131b9c){return BPromise['reject'](_0x131b9c);}return _0x5b5f41[_0xe86e('0x23')]();};}function saveUpdates(_0xdde96d,_0x2c46ba){return function(_0x5d78d4){if(_0x5d78d4){return _0x5d78d4[_0xe86e('0x24')](_0xdde96d)[_0xe86e('0x25')](function(_0x592a09){return _0x592a09;});}return null;};}function removeEntity(_0x4bff60,_0x5e33db){return function(_0x5e7929){if(_0x5e7929){return _0x5e7929[_0xe86e('0x26')]()['then'](function(){_0x4bff60[_0xe86e('0x19')](0xcc)[_0xe86e('0x1a')]();});}};}function handleEntityNotFound(_0x55c44c,_0xe8184f){return function(_0x5cb90d){if(!_0x5cb90d){_0x55c44c[_0xe86e('0x18')](0x194);}return _0x5cb90d;};}function handleError(_0x57d6e5,_0x447cec){_0x447cec=_0x447cec||0x1f4;return function(_0x4ebf96){logger[_0xe86e('0x27')](_0x4ebf96[_0xe86e('0x28')]);if(_0x4ebf96[_0xe86e('0x29')]){delete _0x4ebf96[_0xe86e('0x29')];}_0x57d6e5['status'](_0x447cec)[_0xe86e('0x2a')](_0x4ebf96);};}exports[_0xe86e('0x2b')]=function(_0x38ac07,_0x3f3926){var _0x10ede0={},_0x2e107e={},_0x39fb4e={'count':0x0,'rows':[]};var _0x21097a=_[_0xe86e('0x2c')](db[_0xe86e('0x2d')]['rawAttributes'],function(_0x4d43a3){return{'name':_0x4d43a3[_0xe86e('0x2e')],'type':_0x4d43a3[_0xe86e('0x2f')]['key']};});_0x2e107e['model']=_[_0xe86e('0x2c')](_0x21097a,'name');_0x2e107e['query']=_['keys'](_0x38ac07[_0xe86e('0x30')]);_0x2e107e[_0xe86e('0x31')]=_['intersection'](_0x2e107e[_0xe86e('0x32')],_0x2e107e[_0xe86e('0x30')]);_0x10ede0[_0xe86e('0x33')]=_['intersection'](_0x2e107e['model'],qs[_0xe86e('0x34')](_0x38ac07[_0xe86e('0x30')][_0xe86e('0x34')]));_0x10ede0[_0xe86e('0x33')]=_0x10ede0[_0xe86e('0x33')]['length']?_0x10ede0[_0xe86e('0x33')]:_0x2e107e[_0xe86e('0x32')];if(!_0x38ac07[_0xe86e('0x30')][_0xe86e('0x35')](_0xe86e('0x36'))){_0x10ede0['limit']=qs['limit'](_0x38ac07[_0xe86e('0x30')][_0xe86e('0x1f')]);_0x10ede0[_0xe86e('0x1c')]=qs[_0xe86e('0x1c')](_0x38ac07[_0xe86e('0x30')]['offset']);}_0x10ede0[_0xe86e('0x37')]=qs[_0xe86e('0x38')](_0x38ac07[_0xe86e('0x30')][_0xe86e('0x38')]);_0x10ede0[_0xe86e('0x39')]=qs[_0xe86e('0x31')](_[_0xe86e('0x3a')](_0x38ac07[_0xe86e('0x30')],_0x2e107e[_0xe86e('0x31')]),_0x21097a);if(_0x38ac07[_0xe86e('0x30')][_0xe86e('0x3b')]){_0x10ede0['where']=_[_0xe86e('0x3c')](_0x10ede0[_0xe86e('0x39')],{'$or':_[_0xe86e('0x2c')](_0x21097a,function(_0x94a70a){if(_0x94a70a[_0xe86e('0x2f')]!==_0xe86e('0x3d')){var _0x4e932e={};_0x4e932e[_0x94a70a[_0xe86e('0x29')]]={'$like':'%'+_0x38ac07[_0xe86e('0x30')][_0xe86e('0x3b')]+'%'};return _0x4e932e;}})});}_0x10ede0=_[_0xe86e('0x3c')]({},_0x10ede0,_0x38ac07[_0xe86e('0x3e')]);var _0x1404bc={'where':_0x10ede0['where']};return db['SmsApplication'][_0xe86e('0x1e')](_0x1404bc)[_0xe86e('0x25')](function(_0x530eec){_0x39fb4e['count']=_0x530eec;if(_0x38ac07[_0xe86e('0x30')]['includeAll']){_0x10ede0[_0xe86e('0x3f')]=[{'all':!![]}];}return db[_0xe86e('0x2d')][_0xe86e('0x40')](_0x10ede0);})['then'](function(_0x30f65c){_0x39fb4e[_0xe86e('0x41')]=_0x30f65c;return _0x39fb4e;})['then'](respondWithFilteredResult(_0x3f3926,_0x10ede0))['catch'](handleError(_0x3f3926,null));};exports[_0xe86e('0x42')]=function(_0x3fe989,_0x4cc10c){var _0x13f006={'raw':!![],'where':{'id':_0x3fe989[_0xe86e('0x43')]['id']}},_0x465367={};_0x465367['model']=_[_0xe86e('0x44')](db[_0xe86e('0x2d')][_0xe86e('0x45')]);_0x465367[_0xe86e('0x30')]=_[_0xe86e('0x44')](_0x3fe989[_0xe86e('0x30')]);_0x465367['filters']=_[_0xe86e('0x46')](_0x465367['model'],_0x465367[_0xe86e('0x30')]);_0x13f006[_0xe86e('0x33')]=_[_0xe86e('0x46')](_0x465367[_0xe86e('0x32')],qs[_0xe86e('0x34')](_0x3fe989[_0xe86e('0x30')][_0xe86e('0x34')]));_0x13f006[_0xe86e('0x33')]=_0x13f006[_0xe86e('0x33')][_0xe86e('0x47')]?_0x13f006[_0xe86e('0x33')]:_0x465367['model'];if(_0x3fe989[_0xe86e('0x30')][_0xe86e('0x48')]){_0x13f006['include']=[{'all':!![]}];}_0x13f006=_[_0xe86e('0x3c')]({},_0x13f006,_0x3fe989[_0xe86e('0x3e')]);return db[_0xe86e('0x2d')]['find'](_0x13f006)[_0xe86e('0x25')](handleEntityNotFound(_0x4cc10c,null))[_0xe86e('0x25')](respondWithResult(_0x4cc10c,null))[_0xe86e('0x49')](handleError(_0x4cc10c,null));};exports['create']=function(_0x318c1b,_0x209979){return db[_0xe86e('0x2d')][_0xe86e('0x4a')](_0x318c1b[_0xe86e('0x4b')],{})[_0xe86e('0x25')](respondWithResult(_0x209979,0xc9))[_0xe86e('0x49')](handleError(_0x209979,null));};exports['update']=function(_0x53618d,_0x593da9){if(_0x53618d[_0xe86e('0x4b')]['id']){delete _0x53618d['body']['id'];}return db['SmsApplication'][_0xe86e('0x4c')]({'where':{'id':_0x53618d[_0xe86e('0x43')]['id']}})[_0xe86e('0x25')](handleEntityNotFound(_0x593da9,null))[_0xe86e('0x25')](saveUpdates(_0x53618d[_0xe86e('0x4b')],null))['then'](respondWithResult(_0x593da9,null))[_0xe86e('0x49')](handleError(_0x593da9,null));};exports['destroy']=function(_0x4fb624,_0x5dfd6a){return db[_0xe86e('0x2d')]['find']({'where':{'id':_0x4fb624[_0xe86e('0x43')]['id']}})[_0xe86e('0x25')](handleEntityNotFound(_0x5dfd6a,null))[_0xe86e('0x25')](removeEntity(_0x5dfd6a,null))[_0xe86e('0x49')](handleError(_0x5dfd6a,null));};
\ No newline at end of file
index 294725e..37f2e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1022ac,_0x55ad8b){var _0x451d24=function(_0x142604){while(--_0x142604){_0x1022ac['push'](_0x1022ac['shift']());}};_0x451d24(++_0x55ad8b);}(_0x853c,0x1a1));var _0xc853=function(_0x9836bf,_0x8bfc0f){_0x9836bf=_0x9836bf-0x0;var _0x284080=_0x853c[_0x9836bf];return _0x284080;};'use strict';var _=require(_0xc853('0x0'));var util=require('util');var logger=require(_0xc853('0x1'))(_0xc853('0x2'));var moment=require(_0xc853('0x3'));var BPromise=require(_0xc853('0x4'));var rp=require(_0xc853('0x5'));var fs=require('fs');var path=require(_0xc853('0x6'));var rimraf=require(_0xc853('0x7'));var config=require(_0xc853('0x8'));var attributes=require(_0xc853('0x9'));module[_0xc853('0xa')]=function(_0x257e3a,_0x4f1dd0){return _0x257e3a[_0xc853('0xb')]('SmsApplication',attributes,{'tableName':_0xc853('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc853('0xd'),'collate':_0xc853('0xe')});};
\ No newline at end of file
+var _0x7df2=['request-promise','path','rimraf','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x15e1f8,_0x22e6ab){var _0x5d4054=function(_0x5fe9b3){while(--_0x5fe9b3){_0x15e1f8['push'](_0x15e1f8['shift']());}};_0x5d4054(++_0x22e6ab);}(_0x7df2,0x119));var _0x27df=function(_0x259631,_0xe98ed){_0x259631=_0x259631-0x0;var _0x2332bd=_0x7df2[_0x259631];return _0x2332bd;};'use strict';var _=require(_0x27df('0x0'));var util=require(_0x27df('0x1'));var logger=require('../../config/logger')(_0x27df('0x2'));var moment=require(_0x27df('0x3'));var BPromise=require(_0x27df('0x4'));var rp=require(_0x27df('0x5'));var fs=require('fs');var path=require(_0x27df('0x6'));var rimraf=require(_0x27df('0x7'));var config=require('../../config/environment');var attributes=require(_0x27df('0x8'));module['exports']=function(_0x42896e,_0x3a3ec3){return _0x42896e[_0x27df('0x9')](_0x27df('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27df('0xb'),'collate':_0x27df('0xc')});};
\ No newline at end of file
index 533b797..ae049ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c8d=['request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0x58879c,_0x5a05a4){var _0x1d51e7=function(_0x2c473b){while(--_0x2c473b){_0x58879c['push'](_0x58879c['shift']());}};_0x1d51e7(++_0x5a05a4);}(_0x0c8d,0x79));var _0xd0c8=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0c8d[_0x1da527];return _0x40fc7c;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d1c1,_0x5f0027,_0x415439){return new BPromise(function(_0x34e3d5,_0x2f6200){return client[_0xd0c8('0x8')](_0x16d1c1,_0x415439)[_0xd0c8('0x9')](function(_0x5678f9){logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));logger[_0xd0c8('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5f0027,'request\x20sent',JSON[_0xd0c8('0xe')](_0x5678f9));if(_0x5678f9[_0xd0c8('0xf')]){if(_0x5678f9['error']['code']===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5f0027,_0x5678f9['error'][_0xd0c8('0x10')]);return _0x2f6200(_0x5678f9[_0xd0c8('0xf')]['message']);}logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);return _0x34e3d5(_0x5678f9[_0xd0c8('0xf')][_0xd0c8('0x10')]);}else{logger[_0xd0c8('0xa')](_0xd0c8('0xb'),_0x5f0027,_0xd0c8('0xc'));_0x34e3d5(_0x5678f9[_0xd0c8('0x11')][_0xd0c8('0x10')]);}})[_0xd0c8('0x12')](function(_0x58c3e0){logger[_0xd0c8('0xf')](_0xd0c8('0xb'),_0x5f0027,_0x58c3e0);_0x2f6200(_0x58c3e0);});});}
\ No newline at end of file
+var _0x4e7b=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','SmsApplication,\x20%s,\x20%s'];(function(_0x94d0c4,_0x143e16){var _0x129f23=function(_0x30e377){while(--_0x30e377){_0x94d0c4['push'](_0x94d0c4['shift']());}};_0x129f23(++_0x143e16);}(_0x4e7b,0xf3));var _0xb4e7=function(_0x38f52f,_0x16945f){_0x38f52f=_0x38f52f-0x0;var _0x113bbd=_0x4e7b[_0x38f52f];return _0x113bbd;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var moment=require('moment');var BPromise=require(_0xb4e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4e7('0x3'));var db=require(_0xb4e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4e7('0x5'))(_0xb4e7('0x6'));var config=require('../../config/environment');var jayson=require(_0xb4e7('0x7'));var client=jayson[_0xb4e7('0x8')][_0xb4e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dcf05,_0x315c27,_0x490b1b){return new BPromise(function(_0x366595,_0x3e621e){return client['request'](_0x1dcf05,_0x490b1b)[_0xb4e7('0xa')](function(_0x472973){logger[_0xb4e7('0xb')]('SmsApplication,\x20%s,\x20%s',_0x315c27,_0xb4e7('0xc'));logger[_0xb4e7('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x315c27,'request\x20sent',JSON['stringify'](_0x472973));if(_0x472973['error']){if(_0x472973[_0xb4e7('0xe')][_0xb4e7('0xf')]===0x1f4){logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x3e621e(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}logger[_0xb4e7('0xe')](_0xb4e7('0x10'),_0x315c27,_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);return _0x366595(_0x472973[_0xb4e7('0xe')][_0xb4e7('0x11')]);}else{logger['info'](_0xb4e7('0x10'),_0x315c27,_0xb4e7('0xc'));_0x366595(_0x472973[_0xb4e7('0x12')][_0xb4e7('0x11')]);}})[_0xb4e7('0x13')](function(_0x3078a0){logger['error']('SmsApplication,\x20%s,\x20%s',_0x315c27,_0x3078a0);_0x3e621e(_0x3078a0);});});}
\ No newline at end of file
index 0f20f51..d688553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x18a298,_0x5c8ea0){var _0x2ba08c=function(_0x4bd3c2){while(--_0x4bd3c2){_0x18a298['push'](_0x18a298['shift']());}};_0x2ba08c(++_0x5c8ea0);}(_0x955f,0x1eb));var _0xf955=function(_0x3b15d2,_0x5cd824){_0x3b15d2=_0x3b15d2-0x0;var _0x2fd235=_0x955f[_0x3b15d2];return _0x2fd235;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router;
\ No newline at end of file
+var _0xb10b=['smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','post','create','addMessage','tracked','sms'];(function(_0x149e50,_0x545d51){var _0x50708f=function(_0x9de1fb){while(--_0x9de1fb){_0x149e50['push'](_0x149e50['shift']());}};_0x50708f(++_0x545d51);}(_0xb10b,0x12a));var _0xbb10=function(_0x42322d,_0x5567b8){_0x42322d=_0x42322d-0x0;var _0x409906=_0xb10b[_0x42322d];return _0x409906;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['download']);router[_0xbb10('0x11')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x12')]);router[_0xbb10('0x11')](_0xbb10('0xf'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router[_0xbb10('0x11')]('/:id/tags',auth[_0xbb10('0xb')](),interaction[_0xbb10('0x14')](_0xbb10('0x15'),_0xbb10('0x16')),controller[_0xbb10('0x17')]);router[_0xbb10('0x18')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),interaction[_0xbb10('0x14')](_0xbb10('0x15'),'smsinteraction:update'),controller[_0xbb10('0x19')]);router[_0xbb10('0x1a')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),interaction[_0xbb10('0x14')](_0xbb10('0x15'),_0xbb10('0x1b')),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1a')](_0xbb10('0x1d'),auth['isAuthenticated'](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
index 806dbd4..47605b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e02=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3987cf,_0x3ebe4d){var _0x1202e8=function(_0x108ebc){while(--_0x108ebc){_0x3987cf['push'](_0x3987cf['shift']());}};_0x1202e8(++_0x3ebe4d);}(_0x7e02,0x71));var _0x27e0=function(_0x19921b,_0x5c0c2d){_0x19921b=_0x19921b-0x0;var _0x273545=_0x7e02[_0x19921b];return _0x273545;};'use strict';var Sequelize=require(_0x27e0('0x0'));var moment=require(_0x27e0('0x1'));module[_0x27e0('0x2')]={'closed':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x27e0('0x4')]},'disposition':{'type':Sequelize[_0x27e0('0x5')]},'secondDisposition':{'type':Sequelize[_0x27e0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x27e0('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x27e0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa381=['BOOLEAN','sequelize','moment','DATE','STRING','ENUM'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa381,0x79));var _0x1a38=function(_0x2d580b,_0x2b11f3){_0x2d580b=_0x2d580b-0x0;var _0x7c1374=_0xa381[_0x2d580b];return _0x7c1374;};'use strict';var Sequelize=require(_0x1a38('0x0'));var moment=require(_0x1a38('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1a38('0x2')]},'disposition':{'type':Sequelize[_0x1a38('0x3')]},'secondDisposition':{'type':Sequelize[_0x1a38('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1a38('0x3')]},'phone':{'type':Sequelize[_0x1a38('0x3')]},'read1stAt':{'type':Sequelize[_0x1a38('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1a38('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1a38('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1a38('0x5')],'defaultValue':![]}};
\ No newline at end of file
index e5de74e..3c0e673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe39c=['i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','isEmpty','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','unreadMessages','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','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','include','create','destroy','describe','addMessage','ids','omit','SmsMessage','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','emit','removeTags','unix','root','server','files','transcript-%d-%s.zip','fullname','direction','secret','SmsAccount','mkdirSync','Sms','Account','Owner','N.A.','closed','disposition','Messages','System','lastName','out','renderFile','join','views','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','error','stack','name','send','Users','map','TagIds','Tags','forEach','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','nolimit','order','sort','pick','field','color','tools_tags','u.id','u.fullname','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','start','some','compact','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x596de1,_0x41fa07){var _0x3b3ce9=function(_0x46978c){while(--_0x46978c){_0x596de1['push'](_0x596de1['shift']());}};_0x3b3ce9(++_0x41fa07);}(_0xe39c,0x135));var _0xce39=function(_0x248e36,_0x5e293d){_0x248e36=_0x248e36-0x0;var _0x5616dd=_0xe39c[_0x248e36];return _0x5616dd;};'use strict';var emlformat=require(_0xce39('0x0'));var rimraf=require(_0xce39('0x1'));var zipdir=require(_0xce39('0x2'));var jsonpatch=require(_0xce39('0x3'));var rp=require(_0xce39('0x4'));var moment=require(_0xce39('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xce39('0x6'));var util=require(_0xce39('0x7'));var path=require(_0xce39('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce39('0x9'));var fs=require('fs');var fs_extra=require(_0xce39('0xa'));var _=require(_0xce39('0xb'));var squel=require(_0xce39('0xc'));var crypto=require(_0xce39('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xce39('0xe'));var toCsv=require('to-csv');var querystring=require(_0xce39('0xf'));var Papa=require(_0xce39('0x10'));var Redis=require(_0xce39('0x11'));var authService=require(_0xce39('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xce39('0x13'));var pdf=require(_0xce39('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce39('0x15'));var utils=require('../../config/utils');var config=require(_0xce39('0x16'));var licenseUtil=require(_0xce39('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xce39('0x18')](config[_0xce39('0x19')],{'host':_0xce39('0x1a'),'port':0x18eb});var socket=require(_0xce39('0x1b'))(new Redis(config['redis']));require(_0xce39('0x1c'))[_0xce39('0x1d')](socket);function respondWithStatusCode(_0x21cf3b,_0x26b3bb){_0x26b3bb=_0x26b3bb||0xcc;return function(_0x4edf59){if(_0x4edf59){return _0x21cf3b[_0xce39('0x1e')](_0x26b3bb);}return _0x21cf3b[_0xce39('0x1f')](_0x26b3bb)['end']();};}function respondWithResult(_0x2e47c0,_0x275d3b){_0x275d3b=_0x275d3b||0xc8;return function(_0x603eb9){if(_0x603eb9){return _0x2e47c0[_0xce39('0x1f')](_0x275d3b)[_0xce39('0x20')](_0x603eb9);}};}function respondWithFilteredResult(_0x27a111,_0xb55615){return function(_0x2dd216){if(_0x2dd216){var _0x4eac1d=typeof _0xb55615[_0xce39('0x21')]===_0xce39('0x22')&&typeof _0xb55615[_0xce39('0x23')]===_0xce39('0x22');var _0x92a9e5=_0x2dd216[_0xce39('0x24')];var _0x13d41b=_0x4eac1d?0x0:_0xb55615['offset'];var _0x5ec5bb=_0x4eac1d?_0x2dd216['count']:_0xb55615[_0xce39('0x21')]+_0xb55615[_0xce39('0x23')];var _0x384972;if(_0x5ec5bb>=_0x92a9e5){_0x5ec5bb=_0x92a9e5;_0x384972=0xc8;}else{_0x384972=0xce;}_0x27a111[_0xce39('0x1f')](_0x384972);return _0x27a111['set'](_0xce39('0x25'),_0x13d41b+'-'+_0x5ec5bb+'/'+_0x92a9e5)['json'](_0x2dd216);}return null;};}function patchUpdates(_0x4fb69a){return function(_0x38539b){try{jsonpatch['apply'](_0x38539b,_0x4fb69a,!![]);}catch(_0xaf0b00){return BPromise['reject'](_0xaf0b00);}return _0x38539b[_0xce39('0x26')]();};}function saveUpdates(_0x1ef0b1,_0x410f85){return function(_0x2d55d6){if(_0x2d55d6){return _0x2d55d6[_0xce39('0x27')](_0x1ef0b1)[_0xce39('0x28')](function(_0x7ad2d9){return _0x7ad2d9;});}return null;};}function removeEntity(_0x238746,_0x844f49){return function(_0x47353c){if(_0x47353c){return _0x47353c['destroy']()[_0xce39('0x28')](function(){_0x238746[_0xce39('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a8328,_0x51aeb2){return function(_0x10d04c){if(!_0x10d04c){_0x1a8328[_0xce39('0x1e')](0x194);}return _0x10d04c;};}function handleError(_0x5902c3,_0x581bd7){_0x581bd7=_0x581bd7||0x1f4;return function(_0x297111){logger[_0xce39('0x29')](_0x297111[_0xce39('0x2a')]);if(_0x297111[_0xce39('0x2b')]){delete _0x297111['name'];}_0x5902c3[_0xce39('0x1f')](_0x581bd7)[_0xce39('0x2c')](_0x297111);};}function getInteractionUsers(_0x5eb3fa,_0x4f1688){return new BPromise(function(_0x202ee7,_0x3fa9f3){try{if(_0x4f1688[_0x5eb3fa['id']]){_0x5eb3fa[_0xce39('0x2d')]=_[_0xce39('0x2e')](_0x4f1688[_0x5eb3fa['id']],function(_0x4fadd1){return{'id':_0x4fadd1['id'],'fullname':_0x4fadd1['fullname']};});}}catch(_0x21b0a7){_0x3fa9f3(_0x21b0a7);}_0x202ee7(_0x5eb3fa);});}function getInteractionTags(_0x5ce9d6,_0x181f4b){return new BPromise(function(_0xa5b119,_0x4bb63e){try{if(_0x5ce9d6[_0xce39('0x2f')]){_0x5ce9d6[_0xce39('0x30')]=[];_0x5ce9d6['TagIds']['split'](',')[_0xce39('0x31')](function(_0x1eaec4){_0x5ce9d6['Tags']['push'](_0x181f4b[_0x1eaec4]);});}delete _0x5ce9d6[_0xce39('0x2f')];}catch(_0x39bb3d){_0x4bb63e(_0x39bb3d);}_0xa5b119(_0x5ce9d6);});}function updateSmsInteraction(_0x30e000,_0x3cb8de,_0x14d6a5){return new BPromise(function(_0x2220b4,_0x6bfb6b){return getInteractionUsers(_0x30e000,_0x14d6a5)[_0xce39('0x28')](function(_0xafbdae){return getInteractionTags(_0xafbdae,_0x3cb8de);})[_0xce39('0x28')](function(_0x4264bf){_0x2220b4(_0x4264bf);})[_0xce39('0x32')](function(_0x397d0f){_0x6bfb6b(_0x397d0f);});});}exports[_0xce39('0x33')]=function(_0x4dd19e,_0x397a3b){var _0x8b2c59={},_0x3de43d={},_0x40f956={'count':0x0,'rows':[]};var _0x297517=_[_0xce39('0x2e')](db[_0xce39('0x34')][_0xce39('0x35')],function(_0x1f6cf9){return{'name':_0x1f6cf9[_0xce39('0x36')],'type':_0x1f6cf9[_0xce39('0x37')][_0xce39('0x38')]};});_0x3de43d[_0xce39('0x39')]=_[_0xce39('0x2e')](_0x297517,'name');_0x3de43d['query']=_[_0xce39('0x3a')](_0x4dd19e['query']);_0x3de43d[_0xce39('0x3b')]=_[_0xce39('0x3c')](_0x3de43d[_0xce39('0x39')],_0x3de43d['query']);_0x8b2c59[_0xce39('0x3d')]=_[_0xce39('0x3c')](_0x3de43d['model'],qs[_0xce39('0x3e')](_0x4dd19e[_0xce39('0x3f')]['fields']));_0x8b2c59[_0xce39('0x3d')]=_0x8b2c59[_0xce39('0x3d')][_0xce39('0x40')]?_0x8b2c59[_0xce39('0x3d')]:_0x3de43d[_0xce39('0x39')];if(!_0x4dd19e[_0xce39('0x3f')]['hasOwnProperty'](_0xce39('0x41'))){_0x8b2c59[_0xce39('0x23')]=qs['limit'](_0x4dd19e['query'][_0xce39('0x23')]);_0x8b2c59[_0xce39('0x21')]=qs['offset'](_0x4dd19e[_0xce39('0x3f')][_0xce39('0x21')]);}_0x8b2c59[_0xce39('0x42')]=qs['sort'](_0x4dd19e['query'][_0xce39('0x43')]);_0x8b2c59['where']=qs[_0xce39('0x3b')](_[_0xce39('0x44')](_0x4dd19e[_0xce39('0x3f')],_0x3de43d[_0xce39('0x3b')]),_0x297517);var _0x325e25=[];var _0x4b6252=squel['select']()[_0xce39('0x45')]('id')[_0xce39('0x45')](_0xce39('0x2b'))[_0xce39('0x45')](_0xce39('0x46'))['from'](_0xce39('0x47'));var _0x39c1e5=squel['select']()[_0xce39('0x45')](_0xce39('0x48'))[_0xce39('0x45')](_0xce39('0x49'))[_0xce39('0x45')]('ui.SmsInteractionId')[_0xce39('0x4a')](_0xce39('0x4b'),'ui')[_0xce39('0x4c')](_0xce39('0x4d'),'u',_0xce39('0x4e'));var _0x15d9a7=squel[_0xce39('0x4f')]()[_0xce39('0x4a')](_0xce39('0x50'),'i')['left_join'](_0xce39('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xce39('0x4c')](_0xce39('0x4d'),'o',_0xce39('0x52'))[_0xce39('0x4c')]('sms_accounts','a',_0xce39('0x53'))['left_join'](_0xce39('0x54'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xce39('0x4c')](_0xce39('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xce39('0x4c')](_0xce39('0x47'),'t',_0xce39('0x56'));var _0x4e9b73=squel[_0xce39('0x57')]();var _0x419cb1=[];var _0xb757f=squel[_0xce39('0x57')]();var _0x55c05c;if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x58')]){_0x55c05c=as[_0xce39('0x59')](_0x4dd19e['query'][_0xce39('0x58')]);var _0x1a53b7=_0x55c05c[_0xce39('0x5a')];for(var _0x453145=0x0;_0x453145<_0x55c05c['conditions'][_0xce39('0x40')];_0x453145++){var _0x3467de=_0x55c05c['conditions'][_0x453145];var _0x222309='i';var _0x413221=_[_0xce39('0x5b')](_0x297517,['name',_0x3467de[_0xce39('0x45')]]);if(!_0x413221){switch(_0x3467de['field']){case'unreadMessages':if(_0x3467de['value']==0x1){_0x15d9a7['having']('`'+_0x3467de[_0xce39('0x45')]+_0xce39('0x5c'));}else{_0x15d9a7['having']('`'+_0x3467de['field']+_0xce39('0x5d'));}break;case _0xce39('0x5e'):if(_0x3467de[_0xce39('0x5f')]===_0xce39('0x60')){if(_0x3467de['value'][_0xce39('0x61')]('\x20')['length']>0x1){_0x4e9b73[_0x1a53b7](_0xce39('0x62'),qs[_0xce39('0x63')](_0x3467de[_0xce39('0x64')]),null);}else{var _0x1e1957='%'+_0x3467de[_0xce39('0x64')]+'%';_0x4e9b73[_0x1a53b7](_0xce39('0x65'),_0x1e1957,_0x1e1957,_0x1e1957);}}else{_0x413221=_[_0xce39('0x5b')](_0x297517,['name',_0xce39('0x66')]);_0x3467de[_0xce39('0x45')]=_0xce39('0x66');_0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff[_0xce39('0x64')]['start'],_0x5714ff['value'][_0xce39('0x69')]);}break;case _0xce39('0x6a'):var _0x5ad082=_0x3467de[_0xce39('0x64')][_0xce39('0x61')](',')[_0xce39('0x2e')](function(_0x12e62e){return Number(_0x12e62e);});_0x5ad082[_0xce39('0x31')](function(_0x65c06e){_0xb757f['or'](_0xce39('0x6b'),'%,'+_0x65c06e+',%');});_0x419cb1=_[_0xce39('0x6c')](_0x419cb1,_0x5ad082);break;case _0xce39('0x6d'):if(_0x3467de[_0xce39('0x5f')]===_0xce39('0x60')){_0x4e9b73[_0x1a53b7](_0xce39('0x6e'),'%'+_0x3467de['value']+'%',null);}else{_0x413221=_[_0xce39('0x5b')](_0x297517,[_0xce39('0x2b'),'UserId']);_0x3467de['field']='UserId';_0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff['value']['start'],_0x5714ff['value'][_0xce39('0x69')]);}break;case _0xce39('0x6f'):_0x5714ff=as[_0xce39('0x67')]('me',null,_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff[_0xce39('0x68')],_0x5714ff[_0xce39('0x64')][_0xce39('0x70')],_0x5714ff[_0xce39('0x64')][_0xce39('0x69')]);break;}}else{var _0x5714ff=as[_0xce39('0x67')](_0x222309,_0x413221[_0xce39('0x37')],_0x3467de);_0x4e9b73[_0x1a53b7](_0x5714ff['text'],_0x5714ff['value']['start'],_0x5714ff['value'][_0xce39('0x69')]);}}}else{var _0x45cdd0=_(_0x4dd19e[_0xce39('0x3f')])[_0xce39('0x3a')]()[_0xce39('0x2e')](function(_0x1580e3){return _[_0xce39('0x71')](_0x297517,['name',_0x1580e3])?_0x1580e3:undefined;})[_0xce39('0x72')]()[_0xce39('0x64')]();if(!_['isEmpty'](_0x45cdd0)){_0x45cdd0[_0xce39('0x31')](function(_0x333e81){if(_0x333e81===_0xce39('0x73')){_0x15d9a7[_0xce39('0x74')](_0xce39('0x75'),[][_0xce39('0x76')](_0x4dd19e['query'][_0x333e81]));}else if(_0x333e81===_0xce39('0x77')){var _0x29aad4=JSON[_0xce39('0x78')](_0x4dd19e['query'][_0x333e81])[_0xce39('0x79')];var _0x59733f=JSON[_0xce39('0x78')](_0x4dd19e[_0xce39('0x3f')][_0x333e81])[_0xce39('0x7a')];_0x15d9a7[_0xce39('0x74')](_0xce39('0x7b'),_0x29aad4,_0x59733f);}else{if(_0x4dd19e[_0xce39('0x3f')][_0x333e81]==='null'){_0x15d9a7[_0xce39('0x74')]('i.'+_0x333e81+_0xce39('0x7c'));}else{_0x15d9a7[_0xce39('0x74')]('i.'+_0x333e81+_0xce39('0x7d'),_0x4dd19e[_0xce39('0x3f')][_0x333e81]);}}});}if(_0x4dd19e['query'][_0xce39('0x7e')]){if(_0x4dd19e['query']['read']==0x1){_0x15d9a7[_0xce39('0x7f')](_0xce39('0x80'));}else{_0x15d9a7[_0xce39('0x7f')]('`unreadMessages`\x20>\x200');}}if(_0x4dd19e[_0xce39('0x3f')]['tag']){_0x419cb1=_[_0xce39('0x81')](_0x4dd19e[_0xce39('0x3f')]['tag'])?_0x4dd19e[_0xce39('0x3f')][_0xce39('0x82')]:new Array(_0x4dd19e['query'][_0xce39('0x82')]);_0x419cb1[_0xce39('0x31')](function(_0x438831){_0xb757f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x438831+',%');});}if(_0x4dd19e['query'][_0xce39('0x83')]){var _0x345f10=_0x4dd19e[_0xce39('0x3f')][_0xce39('0x83')][_0xce39('0x84')]('\x5c','\x5c\x5c')[_0xce39('0x84')](/'/g,'\x27\x27');if(qs[_0xce39('0x85')](_0x345f10)){_0x4e9b73['or'](_0xce39('0x86'),_0x345f10+'%')['or'](_0xce39('0x87'),_0x345f10+'%');}else{_0x4e9b73['or'](_0xce39('0x88'),qs[_0xce39('0x63')](_0x345f10))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x345f10+'%');}}}_0x15d9a7['where'](_0x4e9b73);_0x15d9a7[_0xce39('0x89')](_0xce39('0x8a'));var _0x453a3b={'type':db[_0xce39('0x8b')]['QueryTypes'][_0xce39('0x8c')],'raw':!![]};var _0x34ae66=_0x15d9a7['clone']();_0x34ae66[_0xce39('0x45')]('i.id');_0x34ae66[_0xce39('0x45')](_0xce39('0x8d'),'unreadMessages');if(_0x8b2c59['order']){_0x8b2c59[_0xce39('0x42')][_0xce39('0x31')](function(_0x36034a){var _0x26392f=_0x36034a[0x0]===_0xce39('0x8e')?_0x36034a[0x0]:'i.'+_0x36034a[0x0];_0x15d9a7['order'](_0x26392f,_0x36034a[0x1]===_0xce39('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x419cb1)){_0x15d9a7[_0xce39('0x7f')](_0xb757f);_0x34ae66['where'](_0xce39('0x90'),_0x419cb1);}BPromise['resolve']()[_0xce39('0x28')](function(){if(!_0x55c05c){if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x73')])return;_0x34ae66[_0xce39('0x74')](_0xce39('0x91'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x91'));return;}if(_0x4dd19e[_0xce39('0x92')][_0xce39('0x93')]!==_0xce39('0x94'))return;return _0x4dd19e['user'][_0xce39('0x95')]({'attributes':['id'],'raw':!![]})[_0xce39('0x28')](function(_0x2aa87c){if(_[_0xce39('0x96')](_0x2aa87c)){_0x34ae66[_0xce39('0x74')](_0xce39('0x97'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x97'));}else{_0x34ae66['where'](_0xce39('0x75'),_['map'](_0x2aa87c,'id'));_0x15d9a7[_0xce39('0x74')](_0xce39('0x75'),_[_0xce39('0x2e')](_0x2aa87c,'id'));}});})[_0xce39('0x28')](function(){if(_0x4dd19e[_0xce39('0x92')]['role']===_0xce39('0x94')&&!_0x55c05c&&!_0x4dd19e[_0xce39('0x3f')][_0xce39('0x73')])return[];return db[_0xce39('0x98')][_0xce39('0x3f')](_0x34ae66[_0xce39('0x99')](),_0x453a3b);})[_0xce39('0x28')](function(_0x56867b){_0x40f956[_0xce39('0x24')]=_0x56867b[_0xce39('0x40')];if(_0x40f956[_0xce39('0x24')]===0x0)return[];return db[_0xce39('0x98')][_0xce39('0x3f')](_0x4b6252['toString'](),_0x453a3b)['then'](function(_0x12fb86){_0x325e25=_['keyBy'](_0x12fb86,'id');_0x453a3b=_[_0xce39('0x9a')](_0x453a3b,{'model':db[_0xce39('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4dd19e[_0xce39('0x3f')][_0xce39('0x3e')]){_0x8b2c59[_0xce39('0x3d')]['forEach'](function(_0x3dfd87){_0x15d9a7[_0xce39('0x45')]('i.'+_0x3dfd87);});}else{_0x15d9a7[_0xce39('0x45')](_0xce39('0x8d'),_0xce39('0x9b'));_0x15d9a7['field'](_0xce39('0x9c'),_0xce39('0x9d'));_0x15d9a7[_0xce39('0x45')](_0xce39('0x9e'),_0xce39('0x9f'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa0'),_0xce39('0x8e'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa1'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa2'),_0xce39('0xa3'));_0x15d9a7['field']('c.lastName',_0xce39('0xa4'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa5'),_0xce39('0xa6'));_0x15d9a7[_0xce39('0x45')](_0xce39('0xa7'),'Contact.phone');_0x15d9a7[_0xce39('0x45')](_0xce39('0xa8'),'Contact.mobile');_0x15d9a7[_0xce39('0x45')](_0xce39('0xa9'),_0xce39('0xaa'));_0x15d9a7[_0xce39('0x45')]('o.fullname',_0xce39('0xab'));_0x15d9a7[_0xce39('0x45')]('o.internal','Owner.internal');_0x15d9a7[_0xce39('0x45')](_0xce39('0xac'),_0xce39('0x2f'));}if(_0x8b2c59[_0xce39('0x23')])_0x15d9a7[_0xce39('0x23')](_0x8b2c59['limit']);if(_0x8b2c59[_0xce39('0x21')])_0x15d9a7['offset'](_0x8b2c59['offset']);return db[_0xce39('0x98')]['query'](_0x15d9a7[_0xce39('0x99')](),_0x453a3b);})[_0xce39('0x28')](function(_0x1bec9d){if(_0x1bec9d['length']>0x0)_0x39c1e5[_0xce39('0x74')]('ui.SmsInteractionId\x20IN\x20?',_[_0xce39('0x2e')](_0x1bec9d,'id'));return db['sequelize'][_0xce39('0x3f')](_0x39c1e5[_0xce39('0x99')](),_0x453a3b)[_0xce39('0x28')](function(_0x5240cf){var _0x20bdaf=_[_0xce39('0xad')](_0x5240cf,'SmsInteractionId');var _0xe68e56=[];_0x1bec9d[_0xce39('0x31')](function(_0x445612){_0xe68e56[_0xce39('0xae')](updateSmsInteraction(_0x445612,_0x325e25,_0x20bdaf));});return BPromise[_0xce39('0xaf')](_0xe68e56);});});})[_0xce39('0x28')](function(_0x563ea4){_0x40f956[_0xce39('0xb0')]=_0x563ea4;return _0x40f956;})[_0xce39('0x28')](respondWithFilteredResult(_0x397a3b,_0x8b2c59))[_0xce39('0x32')](handleError(_0x397a3b,null));};exports[_0xce39('0xb1')]=function(_0x3d7448,_0x47eae4){var _0x43adf9={'raw':![],'where':{'id':_0x3d7448[_0xce39('0xb2')]['id']}},_0x475a5d={};_0x475a5d[_0xce39('0x39')]=_[_0xce39('0x3a')](db[_0xce39('0x34')][_0xce39('0x35')]);_0x475a5d[_0xce39('0x3f')]=_[_0xce39('0x3a')](_0x3d7448[_0xce39('0x3f')]);_0x475a5d[_0xce39('0x3b')]=_[_0xce39('0x3c')](_0x475a5d['model'],_0x475a5d[_0xce39('0x3f')]);_0x43adf9[_0xce39('0x3d')]=_['intersection'](_0x475a5d['model'],qs['fields'](_0x3d7448[_0xce39('0x3f')][_0xce39('0x3e')]));_0x43adf9[_0xce39('0x3d')]=_0x43adf9[_0xce39('0x3d')]['length']?_0x43adf9['attributes']:_0x475a5d[_0xce39('0x39')];if(_0x3d7448['query']['includeAll']){_0x43adf9[_0xce39('0xb3')]=[{'all':!![]}];}_0x43adf9=_[_0xce39('0x9a')]({},_0x43adf9,_0x3d7448['options']);return db[_0xce39('0x34')][_0xce39('0x5b')](_0x43adf9)['then'](handleEntityNotFound(_0x47eae4,null))[_0xce39('0x28')](respondWithResult(_0x47eae4,null))['catch'](handleError(_0x47eae4,null));};exports[_0xce39('0xb4')]=function(_0x180738,_0x477f19){return db[_0xce39('0x34')]['create'](_0x180738[_0xce39('0x6f')],{})[_0xce39('0x28')](respondWithResult(_0x477f19,0xc9))[_0xce39('0x32')](handleError(_0x477f19,null));};exports[_0xce39('0x27')]=function(_0x28d97e,_0x45cd87){if(_0x28d97e[_0xce39('0x6f')]['id']){delete _0x28d97e[_0xce39('0x6f')]['id'];}return db['SmsInteraction'][_0xce39('0x5b')]({'where':{'id':_0x28d97e[_0xce39('0xb2')]['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x45cd87,null))['then'](saveUpdates(_0x28d97e[_0xce39('0x6f')],null))['then'](respondWithResult(_0x45cd87,null))['catch'](handleError(_0x45cd87,null));};exports[_0xce39('0xb5')]=function(_0x2ae1b1,_0x2bc930){return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0x2ae1b1['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x2bc930,null))[_0xce39('0x28')](removeEntity(_0x2bc930,null))[_0xce39('0x32')](handleError(_0x2bc930,null));};exports[_0xce39('0xb6')]=function(_0x3813a4,_0x29c0c6){return db[_0xce39('0x34')]['describe']()['then'](respondWithResult(_0x29c0c6,null))['catch'](handleError(_0x29c0c6,null));};exports[_0xce39('0xb7')]=function(_0x5e3fbf,_0x377e4e,_0x5b41d9){return db['SmsMessage'][_0xce39('0x5b')]({'where':{'id':_0x5e3fbf['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x377e4e,null))['then'](function(_0x64c9cc){if(_0x64c9cc){return _0x64c9cc[_0xce39('0xb7')](_0x5e3fbf['body'][_0xce39('0xb8')],_[_0xce39('0xb9')](_0x5e3fbf[_0xce39('0x6f')],[_0xce39('0xb8'),'id'])||{});}})[_0xce39('0x28')](respondWithResult(_0x377e4e,null))['catch'](handleError(_0x377e4e,null));};exports['getMessages']=function(_0x535b6f,_0x49fa7d,_0x2e41de){var _0x42317b={'raw':![],'where':{}};var _0x460b37={};var _0x1aabec={'count':0x0,'rows':[]};return db[_0xce39('0x34')]['findOne']({'where':{'id':_0x535b6f[_0xce39('0xb2')]['id']}})['then'](handleEntityNotFound(_0x49fa7d,null))[_0xce39('0x28')](function(_0x1fd2ba){if(_0x1fd2ba){_0x460b37[_0xce39('0x39')]=_[_0xce39('0x3a')](db[_0xce39('0xba')]['rawAttributes']);_0x460b37['query']=_[_0xce39('0x3a')](_0x535b6f[_0xce39('0x3f')]);_0x460b37['filters']=_[_0xce39('0x3c')](_0x460b37[_0xce39('0x39')],_0x460b37['query']);_0x42317b['attributes']=_[_0xce39('0x3c')](_0x460b37[_0xce39('0x39')],qs[_0xce39('0x3e')](_0x535b6f[_0xce39('0x3f')]['fields']));_0x42317b['attributes']=_0x42317b['attributes'][_0xce39('0x40')]?_0x42317b[_0xce39('0x3d')]:_0x460b37[_0xce39('0x39')];if(!_0x535b6f['query']['hasOwnProperty'](_0xce39('0x41'))){_0x42317b[_0xce39('0x23')]=qs[_0xce39('0x23')](_0x535b6f[_0xce39('0x3f')]['limit']);_0x42317b[_0xce39('0x21')]=qs['offset'](_0x535b6f[_0xce39('0x3f')]['offset']);}_0x42317b[_0xce39('0x42')]=qs[_0xce39('0x43')](_0x535b6f[_0xce39('0x3f')][_0xce39('0x43')]);_0x42317b[_0xce39('0x74')]=qs['filters'](_[_0xce39('0x44')](_0x535b6f['query'],_0x460b37[_0xce39('0x3b')]));_0x42317b[_0xce39('0x74')][_0xce39('0xbb')]=_0x1fd2ba['id'];if(_0x535b6f[_0xce39('0x3f')]['filter']){_0x42317b[_0xce39('0x74')]=_[_0xce39('0x9a')](_0x42317b[_0xce39('0x74')],{'$or':_[_0xce39('0x2e')](_0x42317b['attributes'],function(_0x241c2e){var _0x37aeb9={};_0x37aeb9[_0x241c2e]={'$like':'%'+_0x535b6f['query'][_0xce39('0x83')]+'%'};return _0x37aeb9;})});}if(_0x535b6f[_0xce39('0x3f')][_0xce39('0x79')]){var _0x5a4508=_0x535b6f[_0xce39('0x3f')][_0xce39('0x79')][_0xce39('0x61')](',');var _0x1565c0={};_0x1565c0[_0x5a4508[0x0]]={'$gte':moment(_0x5a4508[0x1])[_0xce39('0xbc')](_0xce39('0xbd'))};_0x42317b[_0xce39('0x74')]=_[_0xce39('0x9a')](_0x42317b[_0xce39('0x74')],_0x1565c0);}_0x42317b=_['merge']({},_0x42317b,_0x535b6f['options']);return db[_0xce39('0xba')][_0xce39('0x24')]({'where':_0x42317b[_0xce39('0x74')]})['then'](function(_0x181923){_0x1aabec[_0xce39('0x24')]=_0x181923;if(_0x535b6f[_0xce39('0x3f')][_0xce39('0xbe')]){_0x42317b[_0xce39('0xb3')]=[{'all':!![]}];}return db[_0xce39('0xba')]['findAll'](_0x42317b);})[_0xce39('0x28')](function(_0x492a09){_0x1aabec[_0xce39('0xb0')]=_0x492a09;return _0x1aabec;});}})[_0xce39('0x28')](respondWithFilteredResult(_0x49fa7d,_0x42317b))[_0xce39('0x32')](handleError(_0x49fa7d,null));};exports[_0xce39('0xbf')]=function(_0x3e6b3e,_0x3d5d34,_0x1d4ed2){return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0x3e6b3e['params']['id']}})['then'](handleEntityNotFound(_0x3d5d34,null))[_0xce39('0x28')](function(_0x1b9fc4){if(_0x1b9fc4){return _0x1b9fc4[_0xce39('0xc0')](_0x3e6b3e[_0xce39('0x6f')]['ids'],_[_0xce39('0xb9')](_0x3e6b3e[_0xce39('0x6f')],[_0xce39('0xb8'),'id'])||{})['spread'](function(){return db[_0xce39('0x6a')]['findAll']({'attributes':['id','name',_0xce39('0x46')],'where':{'id':_0x3e6b3e['body']['ids']}});})['then'](function(_0x4016c6){socket[_0xce39('0xc1')]('smsInteractionTags:save',{'id':Number(_0x3e6b3e[_0xce39('0xb2')]['id']),'tags':_0x4016c6||[]});return{'id':Number(_0x3e6b3e[_0xce39('0xb2')]['id']),'tags':_0x4016c6||[]};});}})[_0xce39('0x28')](respondWithResult(_0x3d5d34,null))['catch'](handleError(_0x3d5d34,null));};exports[_0xce39('0xc2')]=function(_0x5315c9,_0x3edc38,_0x2f6cd9){return db['SmsInteraction'][_0xce39('0x5b')]({'where':{'id':_0x5315c9['params']['id']}})[_0xce39('0x28')](handleEntityNotFound(_0x3edc38,null))[_0xce39('0x28')](function(_0x3210a7){if(_0x3210a7){return _0x3210a7[_0xce39('0xc2')](_0x5315c9[_0xce39('0x3f')][_0xce39('0xb8')]);}})[_0xce39('0x28')](respondWithStatusCode(_0x3edc38,null))[_0xce39('0x32')](handleError(_0x3edc38,null));};exports['download']=function(_0xf4ad2,_0x302f7e){var _0x462688=moment()[_0xce39('0xc3')]()[_0xce39('0x99')]();var _0x2e9637=path['join'](config[_0xce39('0xc4')],_0xce39('0xc5'),_0xce39('0xc6'),'tmp');var _0x182ae5=path['join'](config[_0xce39('0xc4')],'server',_0xce39('0xc6'),'attachments');var _0x5c35b5=path['join'](_0x2e9637,_0x462688);var _0x16dea8=util[_0xce39('0xbc')](_0xce39('0xc7'),_0xf4ad2[_0xce39('0xb2')]['id'],_0x462688);var _0x250c67=path['join'](_0x2e9637,_0x16dea8);var _0x2c6170=[];_0x2c6170['push']({'model':db['User'],'as':_0xce39('0x6d'),'attributes':['id',_0xce39('0xc8')],'raw':!![]});_0x2c6170[_0xce39('0xae')]({'model':db['CmContact'],'as':_0xce39('0x5e'),'attributes':['id','firstName','lastName'],'raw':!![]});var _0x169491=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id','body',_0xce39('0x77'),_0xce39('0xc9'),_0xce39('0xca'),_0xce39('0x7e')],'include':_0x2c6170}];_0x169491['push']({'model':db[_0xce39('0xcb')],'as':'Account','attributes':['id','name']});_0x169491[_0xce39('0xae')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0xce39('0x34')][_0xce39('0x5b')]({'where':{'id':_0xf4ad2[_0xce39('0xb2')]['id']},'include':_0x169491})[_0xce39('0x28')](handleEntityNotFound(_0x302f7e,null))[_0xce39('0x28')](function(_0xf743a3){if(_0xf743a3){var _0x372ac9=_0xf743a3['get']({'plain':!![]});fs[_0xce39('0xcc')](_0x5c35b5);var _0x4362a5={'channel':_0xce39('0xcd'),'account':_0x372ac9[_0xce39('0xce')]['name'],'agent':_0x372ac9[_0xce39('0xcf')]?_0x372ac9[_0xce39('0xcf')][_0xce39('0xc8')]:_0xce39('0xd0'),'createdAt':moment(_0x372ac9[_0xce39('0x77')])[_0xce39('0xbc')](_0xce39('0xbd'))[_0xce39('0x99')](),'closedAt':_0x372ac9[_0xce39('0xd1')]?moment(_0x372ac9['closedAt'])[_0xce39('0xbc')](_0xce39('0xbd'))['toString']():'','disposition':_0x372ac9[_0xce39('0xd2')],'messages':_(_0x372ac9[_0xce39('0xd3')])['filter']({'secret':![]})[_0xce39('0x2e')](function(_0x468b5a){return{'date':moment(_0x468b5a['createdAt'])[_0xce39('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x468b5a[_0xce39('0xc9')]==='out'?_0x468b5a['User']?_0x468b5a[_0xce39('0x6d')][_0xce39('0xc8')]:_0xce39('0xd4'):_0x468b5a[_0xce39('0x5e')]['firstName']+(_0x468b5a['Contact'][_0xce39('0xd5')]?'\x20'+_0x468b5a[_0xce39('0x5e')][_0xce39('0xd5')]:''),'body':_0x468b5a[_0xce39('0x6f')],'direction':_0x468b5a[_0xce39('0xc9')]===_0xce39('0xd6')?'A':'C','secret':_0x468b5a[_0xce39('0xca')],'read':_0x468b5a[_0xce39('0x7e')]};})[_0xce39('0x64')]()};return ejs[_0xce39('0xd7')](path[_0xce39('0xd8')](config[_0xce39('0xc4')],_0xce39('0xc5'),_0xce39('0xd9'),'downloadInteraction.ejs'),{'interaction':_0x4362a5})[_0xce39('0x28')](function(_0x22683e){var _0x442a8c=path[_0xce39('0xd8')](_0x5c35b5,'transcript-'+_0x372ac9['id']+'-'+_0x462688+'.pdf');var _0x2b0279={'path':_0x442a8c,'channel':_0xce39('0xcd'),'interactionId':_0x372ac9['id']};return pdf[_0xce39('0xda')](_0x22683e,_0x2b0279);})[_0xce39('0x28')](function(){return new BPromise(function(_0x3e73f5,_0x50b185){zipdir(_0x5c35b5,{'saveTo':_0x250c67},function(_0x2b382b,_0x5f2bc7){if(_0x2b382b)return _0x50b185(_0x2b382b);return _0x3e73f5(_0x5f2bc7);});})[_0xce39('0x28')](function(){return new BPromise(function(_0x56c273,_0x255a4e){rimraf(_0x5c35b5,function(_0x5d8270){if(_0x5d8270)_0x255a4e(_0x5d8270);return _0x56c273();});});})[_0xce39('0x28')](function(){return _0x302f7e[_0xce39('0xdb')](_0x250c67,_0x16dea8,function(_0x3a0d28){if(_0x3a0d28){console['log'](_0xce39('0xdc'),_0x3a0d28);}else{fs[_0xce39('0xdd')](_0x250c67);}});});});}else{return _0x302f7e[_0xce39('0x1e')](0xc8);}})['catch'](handleError(_0x302f7e,null));};
\ No newline at end of file
+var _0x17ae=['having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','some','compact','SmsAccountId','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','clone','i.id','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','agent','sequelize','toString','count','keyBy','merge','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','contactName','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.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','rawAttributes','create','body','destroy','describe','addMessage','SmsMessage','ids','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','User','CmContact','firstName','lastName','direction','secret','Account','Owner','get','mkdirSync','Sms','closedAt','disposition','Messages','System','out','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','Users','map','fullname','Tags','push','TagIds','catch','index','SmsInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value'];(function(_0x4083da,_0x7aee27){var _0x46dfcc=function(_0x4daa29){while(--_0x4daa29){_0x4083da['push'](_0x4083da['shift']());}};_0x46dfcc(++_0x7aee27);}(_0x17ae,0x8c));var _0xe17a=function(_0x7c1897,_0x4b6b96){_0x7c1897=_0x7c1897-0x0;var _0x566005=_0x17ae[_0x7c1897];return _0x566005;};'use strict';var emlformat=require(_0xe17a('0x0'));var rimraf=require(_0xe17a('0x1'));var zipdir=require(_0xe17a('0x2'));var jsonpatch=require(_0xe17a('0x3'));var rp=require('request-promise');var moment=require(_0xe17a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe17a('0x5'));var util=require('util');var path=require('path');var sox=require(_0xe17a('0x6'));var csv=require(_0xe17a('0x7'));var ejs=require(_0xe17a('0x8'));var fs=require('fs');var fs_extra=require(_0xe17a('0x9'));var _=require('lodash');var squel=require(_0xe17a('0xa'));var crypto=require(_0xe17a('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe17a('0x7'));var querystring=require(_0xe17a('0xc'));var Papa=require(_0xe17a('0xd'));var Redis=require(_0xe17a('0xe'));var authService=require(_0xe17a('0xf'));var qs=require(_0xe17a('0x10'));var as=require(_0xe17a('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe17a('0x12'));var logger=require(_0xe17a('0x13'))(_0xe17a('0x14'));var utils=require(_0xe17a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe17a('0x16'));var db=require(_0xe17a('0x17'))['db'];config[_0xe17a('0x18')]=_[_0xe17a('0x19')](config[_0xe17a('0x18')],{'host':_0xe17a('0x1a'),'port':0x18eb});var socket=require(_0xe17a('0x1b'))(new Redis(config[_0xe17a('0x18')]));require(_0xe17a('0x1c'))[_0xe17a('0x1d')](socket);function respondWithStatusCode(_0x53ef5f,_0x5d0a0a){_0x5d0a0a=_0x5d0a0a||0xcc;return function(_0x52833b){if(_0x52833b){return _0x53ef5f[_0xe17a('0x1e')](_0x5d0a0a);}return _0x53ef5f[_0xe17a('0x1f')](_0x5d0a0a)[_0xe17a('0x20')]();};}function respondWithResult(_0x2f92cb,_0x443227){_0x443227=_0x443227||0xc8;return function(_0x1910b7){if(_0x1910b7){return _0x2f92cb[_0xe17a('0x1f')](_0x443227)[_0xe17a('0x21')](_0x1910b7);}};}function respondWithFilteredResult(_0x595857,_0x1ed651){return function(_0x380027){if(_0x380027){var _0x268920=typeof _0x1ed651['offset']===_0xe17a('0x22')&&typeof _0x1ed651[_0xe17a('0x23')]===_0xe17a('0x22');var _0x3d209a=_0x380027['count'];var _0x292ebe=_0x268920?0x0:_0x1ed651[_0xe17a('0x24')];var _0x30b740=_0x268920?_0x380027['count']:_0x1ed651[_0xe17a('0x24')]+_0x1ed651[_0xe17a('0x23')];var _0x1416a9;if(_0x30b740>=_0x3d209a){_0x30b740=_0x3d209a;_0x1416a9=0xc8;}else{_0x1416a9=0xce;}_0x595857[_0xe17a('0x1f')](_0x1416a9);return _0x595857[_0xe17a('0x25')](_0xe17a('0x26'),_0x292ebe+'-'+_0x30b740+'/'+_0x3d209a)[_0xe17a('0x21')](_0x380027);}return null;};}function patchUpdates(_0xc487b2){return function(_0x545e4a){try{jsonpatch[_0xe17a('0x27')](_0x545e4a,_0xc487b2,!![]);}catch(_0x25cead){return BPromise['reject'](_0x25cead);}return _0x545e4a[_0xe17a('0x28')]();};}function saveUpdates(_0x4e5186,_0x2aa666){return function(_0x1855fb){if(_0x1855fb){return _0x1855fb[_0xe17a('0x29')](_0x4e5186)[_0xe17a('0x2a')](function(_0x2734be){return _0x2734be;});}return null;};}function removeEntity(_0x77d70f,_0x5da221){return function(_0x4c5759){if(_0x4c5759){return _0x4c5759['destroy']()[_0xe17a('0x2a')](function(){_0x77d70f[_0xe17a('0x1f')](0xcc)[_0xe17a('0x20')]();});}};}function handleEntityNotFound(_0x580a10,_0x341aad){return function(_0x785650){if(!_0x785650){_0x580a10[_0xe17a('0x1e')](0x194);}return _0x785650;};}function handleError(_0x3011b4,_0x19cf53){_0x19cf53=_0x19cf53||0x1f4;return function(_0xd682f){logger[_0xe17a('0x2b')](_0xd682f[_0xe17a('0x2c')]);if(_0xd682f[_0xe17a('0x2d')]){delete _0xd682f[_0xe17a('0x2d')];}_0x3011b4[_0xe17a('0x1f')](_0x19cf53)[_0xe17a('0x2e')](_0xd682f);};}function getInteractionUsers(_0x42775b,_0x37f15a){return new BPromise(function(_0x142d56,_0x163696){try{if(_0x37f15a[_0x42775b['id']]){_0x42775b[_0xe17a('0x2f')]=_[_0xe17a('0x30')](_0x37f15a[_0x42775b['id']],function(_0x24c87e){return{'id':_0x24c87e['id'],'fullname':_0x24c87e[_0xe17a('0x31')]};});}}catch(_0x5495c5){_0x163696(_0x5495c5);}_0x142d56(_0x42775b);});}function getInteractionTags(_0x55dd4a,_0x1b33c8){return new BPromise(function(_0x216423,_0x25b17d){try{if(_0x55dd4a['TagIds']){_0x55dd4a['Tags']=[];_0x55dd4a['TagIds']['split'](',')['forEach'](function(_0x4069ab){_0x55dd4a[_0xe17a('0x32')][_0xe17a('0x33')](_0x1b33c8[_0x4069ab]);});}delete _0x55dd4a[_0xe17a('0x34')];}catch(_0x56582f){_0x25b17d(_0x56582f);}_0x216423(_0x55dd4a);});}function updateSmsInteraction(_0x1a3074,_0x57a30a,_0x4cd756){return new BPromise(function(_0x5d9ee5,_0x46dff0){return getInteractionUsers(_0x1a3074,_0x4cd756)[_0xe17a('0x2a')](function(_0x470a9f){return getInteractionTags(_0x470a9f,_0x57a30a);})['then'](function(_0x1ef2ce){_0x5d9ee5(_0x1ef2ce);})[_0xe17a('0x35')](function(_0x1e5977){_0x46dff0(_0x1e5977);});});}exports[_0xe17a('0x36')]=function(_0x7473cf,_0xa66daa){var _0x1f2e39={},_0x555634={},_0x70fb14={'count':0x0,'rows':[]};var _0x3d2303=_[_0xe17a('0x30')](db[_0xe17a('0x37')]['rawAttributes'],function(_0x31e072){return{'name':_0x31e072[_0xe17a('0x38')],'type':_0x31e072[_0xe17a('0x39')][_0xe17a('0x3a')]};});_0x555634[_0xe17a('0x3b')]=_['map'](_0x3d2303,_0xe17a('0x2d'));_0x555634[_0xe17a('0x3c')]=_[_0xe17a('0x3d')](_0x7473cf[_0xe17a('0x3c')]);_0x555634[_0xe17a('0x3e')]=_[_0xe17a('0x3f')](_0x555634[_0xe17a('0x3b')],_0x555634[_0xe17a('0x3c')]);_0x1f2e39['attributes']=_['intersection'](_0x555634['model'],qs[_0xe17a('0x40')](_0x7473cf['query'][_0xe17a('0x40')]));_0x1f2e39[_0xe17a('0x41')]=_0x1f2e39[_0xe17a('0x41')][_0xe17a('0x42')]?_0x1f2e39[_0xe17a('0x41')]:_0x555634[_0xe17a('0x3b')];if(!_0x7473cf['query'][_0xe17a('0x43')](_0xe17a('0x44'))){_0x1f2e39[_0xe17a('0x23')]=qs['limit'](_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x23')]);_0x1f2e39['offset']=qs[_0xe17a('0x24')](_0x7473cf['query'][_0xe17a('0x24')]);}_0x1f2e39[_0xe17a('0x45')]=qs[_0xe17a('0x46')](_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x46')]);_0x1f2e39[_0xe17a('0x47')]=qs[_0xe17a('0x3e')](_[_0xe17a('0x48')](_0x7473cf[_0xe17a('0x3c')],_0x555634[_0xe17a('0x3e')]),_0x3d2303);var _0x3ff781=[];var _0x1ff5da=squel[_0xe17a('0x49')]()[_0xe17a('0x4a')]('id')[_0xe17a('0x4a')]('name')['field'](_0xe17a('0x4b'))[_0xe17a('0x4c')](_0xe17a('0x4d'));var _0x1de9e1=squel['select']()[_0xe17a('0x4a')](_0xe17a('0x4e'))[_0xe17a('0x4a')]('u.fullname')[_0xe17a('0x4a')](_0xe17a('0x4f'))[_0xe17a('0x4c')](_0xe17a('0x50'),'ui')[_0xe17a('0x51')](_0xe17a('0x52'),'u',_0xe17a('0x53'));var _0x4a8c57=squel['select']()[_0xe17a('0x4c')](_0xe17a('0x54'),'i')['left_join'](_0xe17a('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe17a('0x51')](_0xe17a('0x52'),'o',_0xe17a('0x56'))[_0xe17a('0x51')](_0xe17a('0x57'),'a',_0xe17a('0x58'))[_0xe17a('0x51')](_0xe17a('0x59'),'me',_0xe17a('0x5a'))['left_join'](_0xe17a('0x5b'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0xe17a('0x4d'),'t',_0xe17a('0x5c'));var _0x525efd=squel['expr']();var _0x35dcba=[];var _0x4d67a1=squel[_0xe17a('0x5d')]();var _0x1ae864;if(_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x5e')]){_0x1ae864=as[_0xe17a('0x5f')](_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x5e')]);var _0x4e6e9d=_0x1ae864[_0xe17a('0x60')];for(var _0x4e38d3=0x0;_0x4e38d3<_0x1ae864[_0xe17a('0x61')][_0xe17a('0x42')];_0x4e38d3++){var _0x4d4c96=_0x1ae864[_0xe17a('0x61')][_0x4e38d3];var _0x697709='i';var _0x2cce7c=_[_0xe17a('0x62')](_0x3d2303,['name',_0x4d4c96['field']]);if(!_0x2cce7c){switch(_0x4d4c96[_0xe17a('0x4a')]){case _0xe17a('0x63'):if(_0x4d4c96[_0xe17a('0x64')]==0x1){_0x4a8c57[_0xe17a('0x65')]('`'+_0x4d4c96[_0xe17a('0x4a')]+_0xe17a('0x66'));}else{_0x4a8c57['having']('`'+_0x4d4c96[_0xe17a('0x4a')]+_0xe17a('0x67'));}break;case _0xe17a('0x68'):if(_0x4d4c96[_0xe17a('0x69')]==='$substring'){if(_0x4d4c96[_0xe17a('0x64')]['split']('\x20')['length']>0x1){_0x525efd[_0x4e6e9d](_0xe17a('0x6a'),qs[_0xe17a('0x6b')](_0x4d4c96['value']),null);}else{var _0x51265e='%'+_0x4d4c96['value']+'%';_0x525efd[_0x4e6e9d](_0xe17a('0x6c'),_0x51265e,_0x51265e,_0x51265e);}}else{_0x2cce7c=_['find'](_0x3d2303,[_0xe17a('0x2d'),_0xe17a('0x6d')]);_0x4d4c96['field']=_0xe17a('0x6d');_0x5d59a5=as['buildExpression'](_0x697709,_0x2cce7c[_0xe17a('0x39')],_0x4d4c96);_0x525efd[_0x4e6e9d](_0x5d59a5['text'],_0x5d59a5['value'][_0xe17a('0x6e')],_0x5d59a5[_0xe17a('0x64')][_0xe17a('0x20')]);}break;case'Tag':var _0xba0859=_0x4d4c96[_0xe17a('0x64')][_0xe17a('0x6f')](',')[_0xe17a('0x30')](function(_0x275752){return Number(_0x275752);});_0xba0859[_0xe17a('0x70')](function(_0x26ad75){_0x4d67a1['or'](_0xe17a('0x71'),'%,'+_0x26ad75+',%');});_0x35dcba=_[_0xe17a('0x72')](_0x35dcba,_0xba0859);break;case'User':if(_0x4d4c96[_0xe17a('0x69')]==='$substring'){_0x525efd[_0x4e6e9d](_0xe17a('0x73'),'%'+_0x4d4c96[_0xe17a('0x64')]+'%',null);}else{_0x2cce7c=_[_0xe17a('0x62')](_0x3d2303,[_0xe17a('0x2d'),_0xe17a('0x74')]);_0x4d4c96[_0xe17a('0x4a')]='UserId';_0x5d59a5=as[_0xe17a('0x75')](_0x697709,_0x2cce7c[_0xe17a('0x39')],_0x4d4c96);_0x525efd[_0x4e6e9d](_0x5d59a5['text'],_0x5d59a5[_0xe17a('0x64')][_0xe17a('0x6e')],_0x5d59a5[_0xe17a('0x64')][_0xe17a('0x20')]);}break;case'body':_0x5d59a5=as[_0xe17a('0x75')]('me',null,_0x4d4c96);_0x525efd[_0x4e6e9d](_0x5d59a5[_0xe17a('0x76')],_0x5d59a5[_0xe17a('0x64')][_0xe17a('0x6e')],_0x5d59a5[_0xe17a('0x64')][_0xe17a('0x20')]);break;}}else{var _0x5d59a5=as[_0xe17a('0x75')](_0x697709,_0x2cce7c[_0xe17a('0x39')],_0x4d4c96);_0x525efd[_0x4e6e9d](_0x5d59a5[_0xe17a('0x76')],_0x5d59a5[_0xe17a('0x64')]['start'],_0x5d59a5['value'][_0xe17a('0x20')]);}}}else{var _0x43e8c7=_(_0x7473cf['query'])[_0xe17a('0x3d')]()['map'](function(_0x138e66){return _[_0xe17a('0x77')](_0x3d2303,[_0xe17a('0x2d'),_0x138e66])?_0x138e66:undefined;})[_0xe17a('0x78')]()['value']();if(!_['isEmpty'](_0x43e8c7)){_0x43e8c7[_0xe17a('0x70')](function(_0x35e0db){if(_0x35e0db===_0xe17a('0x79')){_0x4a8c57[_0xe17a('0x47')]('i.SmsAccountId\x20IN\x20?',[][_0xe17a('0x7a')](_0x7473cf[_0xe17a('0x3c')][_0x35e0db]));}else if(_0x35e0db==='createdAt'){var _0x352a57=JSON[_0xe17a('0x7b')](_0x7473cf[_0xe17a('0x3c')][_0x35e0db])['$gte'];var _0x422ee5=JSON[_0xe17a('0x7b')](_0x7473cf[_0xe17a('0x3c')][_0x35e0db])['$lte'];_0x4a8c57[_0xe17a('0x47')](_0xe17a('0x7c'),_0x352a57,_0x422ee5);}else{if(_0x7473cf[_0xe17a('0x3c')][_0x35e0db]===_0xe17a('0x7d')){_0x4a8c57[_0xe17a('0x47')]('i.'+_0x35e0db+_0xe17a('0x7e'));}else{_0x4a8c57[_0xe17a('0x47')]('i.'+_0x35e0db+_0xe17a('0x7f'),_0x7473cf[_0xe17a('0x3c')][_0x35e0db]);}}});}if(_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x80')]){if(_0x7473cf[_0xe17a('0x3c')]['read']==0x1){_0x4a8c57['having'](_0xe17a('0x81'));}else{_0x4a8c57[_0xe17a('0x65')](_0xe17a('0x82'));}}if(_0x7473cf['query'][_0xe17a('0x83')]){_0x35dcba=_[_0xe17a('0x84')](_0x7473cf[_0xe17a('0x3c')]['tag'])?_0x7473cf['query'][_0xe17a('0x83')]:new Array(_0x7473cf['query']['tag']);_0x35dcba[_0xe17a('0x70')](function(_0x4c1c35){_0x4d67a1['or'](_0xe17a('0x71'),'%,'+_0x4c1c35+',%');});}if(_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x85')]){var _0x4c01cf=_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x85')]['replace']('\x5c','\x5c\x5c')[_0xe17a('0x86')](/'/g,'\x27\x27');if(qs[_0xe17a('0x87')](_0x4c01cf)){_0x525efd['or'](_0xe17a('0x88'),_0x4c01cf+'%')['or'](_0xe17a('0x89'),_0x4c01cf+'%');}else{_0x525efd['or'](_0xe17a('0x8a'),qs[_0xe17a('0x6b')](_0x4c01cf))['or'](_0xe17a('0x8b'),_0x4c01cf+'%');}}}_0x4a8c57[_0xe17a('0x47')](_0x525efd);_0x4a8c57[_0xe17a('0x8c')]('i.id');var _0x558e8f={'type':db['Sequelize']['QueryTypes'][_0xe17a('0x8d')],'raw':!![]};var _0x2acf12=_0x4a8c57[_0xe17a('0x8e')]();_0x2acf12['field'](_0xe17a('0x8f'));_0x2acf12['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe17a('0x63'));if(_0x1f2e39[_0xe17a('0x45')]){_0x1f2e39[_0xe17a('0x45')][_0xe17a('0x70')](function(_0x58afb9){var _0x4642ba=_0x58afb9[0x0]==='contactName'?_0x58afb9[0x0]:'i.'+_0x58afb9[0x0];_0x4a8c57[_0xe17a('0x45')](_0x4642ba,_0x58afb9[0x1]===_0xe17a('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x35dcba)){_0x4a8c57[_0xe17a('0x65')](_0x4d67a1);_0x2acf12[_0xe17a('0x47')](_0xe17a('0x91'),_0x35dcba);}BPromise[_0xe17a('0x92')]()['then'](function(){if(!_0x1ae864){if(_0x7473cf['query'][_0xe17a('0x79')])return;_0x2acf12[_0xe17a('0x47')](_0xe17a('0x93'));_0x4a8c57[_0xe17a('0x47')](_0xe17a('0x93'));return;}if(_0x7473cf['user']['role']!=='agent')return;return _0x7473cf[_0xe17a('0x94')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xe17a('0x2a')](function(_0x2be17f){if(_['isEmpty'](_0x2be17f)){_0x2acf12[_0xe17a('0x47')](_0xe17a('0x95'));_0x4a8c57[_0xe17a('0x47')](_0xe17a('0x95'));}else{_0x2acf12[_0xe17a('0x47')]('i.SmsAccountId\x20IN\x20?',_[_0xe17a('0x30')](_0x2be17f,'id'));_0x4a8c57[_0xe17a('0x47')](_0xe17a('0x96'),_[_0xe17a('0x30')](_0x2be17f,'id'));}});})[_0xe17a('0x2a')](function(){if(_0x7473cf[_0xe17a('0x94')]['role']===_0xe17a('0x97')&&!_0x1ae864&&!_0x7473cf[_0xe17a('0x3c')][_0xe17a('0x79')])return[];return db[_0xe17a('0x98')][_0xe17a('0x3c')](_0x2acf12[_0xe17a('0x99')](),_0x558e8f);})[_0xe17a('0x2a')](function(_0x3f7fa8){_0x70fb14[_0xe17a('0x9a')]=_0x3f7fa8[_0xe17a('0x42')];if(_0x70fb14[_0xe17a('0x9a')]===0x0)return[];return db[_0xe17a('0x98')]['query'](_0x1ff5da['toString'](),_0x558e8f)[_0xe17a('0x2a')](function(_0x570ea3){_0x3ff781=_[_0xe17a('0x9b')](_0x570ea3,'id');_0x558e8f=_[_0xe17a('0x9c')](_0x558e8f,{'model':db[_0xe17a('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7473cf['query'][_0xe17a('0x40')]){_0x1f2e39[_0xe17a('0x41')]['forEach'](function(_0x5899d2){_0x4a8c57['field']('i.'+_0x5899d2);});}else{_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0x9d'),'unreadMessages');_0x4a8c57[_0xe17a('0x4a')]('a.key',_0xe17a('0x9e'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0x9f'),_0xe17a('0xa0'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xa1'),_0xe17a('0xa2'));_0x4a8c57['field'](_0xe17a('0xa3'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xa4'),_0xe17a('0xa5'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xa6'),'Contact.lastName');_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xa7'),_0xe17a('0xa8'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xa9'),_0xe17a('0xaa'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xab'),_0xe17a('0xac'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xad'),_0xe17a('0xae'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xaf'),_0xe17a('0xb0'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xb1'),_0xe17a('0xb2'));_0x4a8c57[_0xe17a('0x4a')](_0xe17a('0xb3'),_0xe17a('0x34'));}if(_0x1f2e39['limit'])_0x4a8c57[_0xe17a('0x23')](_0x1f2e39[_0xe17a('0x23')]);if(_0x1f2e39[_0xe17a('0x24')])_0x4a8c57[_0xe17a('0x24')](_0x1f2e39[_0xe17a('0x24')]);return db[_0xe17a('0x98')]['query'](_0x4a8c57['toString'](),_0x558e8f);})['then'](function(_0x496444){if(_0x496444[_0xe17a('0x42')]>0x0)_0x1de9e1[_0xe17a('0x47')](_0xe17a('0xb4'),_['map'](_0x496444,'id'));return db[_0xe17a('0x98')][_0xe17a('0x3c')](_0x1de9e1[_0xe17a('0x99')](),_0x558e8f)[_0xe17a('0x2a')](function(_0x1f1d99){var _0x9f4d32=_[_0xe17a('0xb5')](_0x1f1d99,_0xe17a('0xb6'));var _0x214031=[];_0x496444[_0xe17a('0x70')](function(_0x556363){_0x214031[_0xe17a('0x33')](updateSmsInteraction(_0x556363,_0x3ff781,_0x9f4d32));});return BPromise[_0xe17a('0xb7')](_0x214031);});});})[_0xe17a('0x2a')](function(_0x4f9d86){_0x70fb14[_0xe17a('0xb8')]=_0x4f9d86;return _0x70fb14;})[_0xe17a('0x2a')](respondWithFilteredResult(_0xa66daa,_0x1f2e39))[_0xe17a('0x35')](handleError(_0xa66daa,null));};exports[_0xe17a('0xb9')]=function(_0x46a958,_0xeb8a4b){var _0x9e4255={'raw':![],'where':{'id':_0x46a958[_0xe17a('0xba')]['id']}},_0x116c66={};_0x116c66[_0xe17a('0x3b')]=_[_0xe17a('0x3d')](db[_0xe17a('0x37')][_0xe17a('0xbb')]);_0x116c66[_0xe17a('0x3c')]=_[_0xe17a('0x3d')](_0x46a958[_0xe17a('0x3c')]);_0x116c66[_0xe17a('0x3e')]=_[_0xe17a('0x3f')](_0x116c66[_0xe17a('0x3b')],_0x116c66[_0xe17a('0x3c')]);_0x9e4255[_0xe17a('0x41')]=_[_0xe17a('0x3f')](_0x116c66[_0xe17a('0x3b')],qs['fields'](_0x46a958[_0xe17a('0x3c')][_0xe17a('0x40')]));_0x9e4255[_0xe17a('0x41')]=_0x9e4255[_0xe17a('0x41')]['length']?_0x9e4255[_0xe17a('0x41')]:_0x116c66[_0xe17a('0x3b')];if(_0x46a958[_0xe17a('0x3c')]['includeAll']){_0x9e4255['include']=[{'all':!![]}];}_0x9e4255=_[_0xe17a('0x9c')]({},_0x9e4255,_0x46a958['options']);return db[_0xe17a('0x37')]['find'](_0x9e4255)[_0xe17a('0x2a')](handleEntityNotFound(_0xeb8a4b,null))[_0xe17a('0x2a')](respondWithResult(_0xeb8a4b,null))['catch'](handleError(_0xeb8a4b,null));};exports[_0xe17a('0xbc')]=function(_0x3aa26c,_0x2675dc){return db['SmsInteraction'][_0xe17a('0xbc')](_0x3aa26c['body'],{})[_0xe17a('0x2a')](respondWithResult(_0x2675dc,0xc9))[_0xe17a('0x35')](handleError(_0x2675dc,null));};exports[_0xe17a('0x29')]=function(_0x2ca1f3,_0x25e8c8){if(_0x2ca1f3[_0xe17a('0xbd')]['id']){delete _0x2ca1f3['body']['id'];}return db[_0xe17a('0x37')][_0xe17a('0x62')]({'where':{'id':_0x2ca1f3[_0xe17a('0xba')]['id']}})[_0xe17a('0x2a')](handleEntityNotFound(_0x25e8c8,null))['then'](saveUpdates(_0x2ca1f3[_0xe17a('0xbd')],null))[_0xe17a('0x2a')](respondWithResult(_0x25e8c8,null))[_0xe17a('0x35')](handleError(_0x25e8c8,null));};exports[_0xe17a('0xbe')]=function(_0xf21476,_0x1a360e){return db['SmsInteraction']['find']({'where':{'id':_0xf21476[_0xe17a('0xba')]['id']}})[_0xe17a('0x2a')](handleEntityNotFound(_0x1a360e,null))[_0xe17a('0x2a')](removeEntity(_0x1a360e,null))[_0xe17a('0x35')](handleError(_0x1a360e,null));};exports[_0xe17a('0xbf')]=function(_0x5043e3,_0x4febc1){return db[_0xe17a('0x37')][_0xe17a('0xbf')]()[_0xe17a('0x2a')](respondWithResult(_0x4febc1,null))[_0xe17a('0x35')](handleError(_0x4febc1,null));};exports[_0xe17a('0xc0')]=function(_0x4c4df7,_0x41fc37,_0x4f3724){return db[_0xe17a('0xc1')][_0xe17a('0x62')]({'where':{'id':_0x4c4df7[_0xe17a('0xba')]['id']}})['then'](handleEntityNotFound(_0x41fc37,null))[_0xe17a('0x2a')](function(_0x2c32dc){if(_0x2c32dc){return _0x2c32dc[_0xe17a('0xc0')](_0x4c4df7[_0xe17a('0xbd')][_0xe17a('0xc2')],_['omit'](_0x4c4df7[_0xe17a('0xbd')],[_0xe17a('0xc2'),'id'])||{});}})[_0xe17a('0x2a')](respondWithResult(_0x41fc37,null))['catch'](handleError(_0x41fc37,null));};exports[_0xe17a('0xc3')]=function(_0x1fbc81,_0x437518,_0x5e379d){var _0x49c219={'raw':![],'where':{}};var _0x2c8a1c={};var _0x440563={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xe17a('0xc4')]({'where':{'id':_0x1fbc81[_0xe17a('0xba')]['id']}})[_0xe17a('0x2a')](handleEntityNotFound(_0x437518,null))['then'](function(_0x29a46c){if(_0x29a46c){_0x2c8a1c['model']=_[_0xe17a('0x3d')](db[_0xe17a('0xc1')][_0xe17a('0xbb')]);_0x2c8a1c[_0xe17a('0x3c')]=_[_0xe17a('0x3d')](_0x1fbc81['query']);_0x2c8a1c[_0xe17a('0x3e')]=_[_0xe17a('0x3f')](_0x2c8a1c[_0xe17a('0x3b')],_0x2c8a1c[_0xe17a('0x3c')]);_0x49c219[_0xe17a('0x41')]=_['intersection'](_0x2c8a1c['model'],qs[_0xe17a('0x40')](_0x1fbc81[_0xe17a('0x3c')][_0xe17a('0x40')]));_0x49c219[_0xe17a('0x41')]=_0x49c219['attributes'][_0xe17a('0x42')]?_0x49c219['attributes']:_0x2c8a1c[_0xe17a('0x3b')];if(!_0x1fbc81[_0xe17a('0x3c')][_0xe17a('0x43')]('nolimit')){_0x49c219[_0xe17a('0x23')]=qs[_0xe17a('0x23')](_0x1fbc81[_0xe17a('0x3c')][_0xe17a('0x23')]);_0x49c219[_0xe17a('0x24')]=qs['offset'](_0x1fbc81[_0xe17a('0x3c')]['offset']);}_0x49c219[_0xe17a('0x45')]=qs['sort'](_0x1fbc81[_0xe17a('0x3c')]['sort']);_0x49c219[_0xe17a('0x47')]=qs[_0xe17a('0x3e')](_[_0xe17a('0x48')](_0x1fbc81['query'],_0x2c8a1c[_0xe17a('0x3e')]));_0x49c219[_0xe17a('0x47')][_0xe17a('0xb6')]=_0x29a46c['id'];if(_0x1fbc81[_0xe17a('0x3c')][_0xe17a('0x85')]){_0x49c219[_0xe17a('0x47')]=_[_0xe17a('0x9c')](_0x49c219[_0xe17a('0x47')],{'$or':_[_0xe17a('0x30')](_0x49c219[_0xe17a('0x41')],function(_0x1d6320){var _0x471695={};_0x471695[_0x1d6320]={'$like':'%'+_0x1fbc81['query'][_0xe17a('0x85')]+'%'};return _0x471695;})});}if(_0x1fbc81[_0xe17a('0x3c')]['$gte']){var _0xb5a93c=_0x1fbc81[_0xe17a('0x3c')][_0xe17a('0xc5')][_0xe17a('0x6f')](',');var _0x50ccca={};_0x50ccca[_0xb5a93c[0x0]]={'$gte':moment(_0xb5a93c[0x1])[_0xe17a('0xc6')](_0xe17a('0xc7'))};_0x49c219[_0xe17a('0x47')]=_['merge'](_0x49c219[_0xe17a('0x47')],_0x50ccca);}_0x49c219=_[_0xe17a('0x9c')]({},_0x49c219,_0x1fbc81[_0xe17a('0xc8')]);return db[_0xe17a('0xc1')]['count']({'where':_0x49c219[_0xe17a('0x47')]})[_0xe17a('0x2a')](function(_0x2c19ae){_0x440563[_0xe17a('0x9a')]=_0x2c19ae;if(_0x1fbc81['query']['includeAll']){_0x49c219[_0xe17a('0xc9')]=[{'all':!![]}];}return db[_0xe17a('0xc1')][_0xe17a('0xca')](_0x49c219);})[_0xe17a('0x2a')](function(_0x625769){_0x440563[_0xe17a('0xb8')]=_0x625769;return _0x440563;});}})[_0xe17a('0x2a')](respondWithFilteredResult(_0x437518,_0x49c219))[_0xe17a('0x35')](handleError(_0x437518,null));};exports[_0xe17a('0xcb')]=function(_0x120c1d,_0x4a0ebf,_0x4d23d6){return db[_0xe17a('0x37')][_0xe17a('0x62')]({'where':{'id':_0x120c1d[_0xe17a('0xba')]['id']}})[_0xe17a('0x2a')](handleEntityNotFound(_0x4a0ebf,null))[_0xe17a('0x2a')](function(_0x442546){if(_0x442546){return _0x442546[_0xe17a('0xcc')](_0x120c1d[_0xe17a('0xbd')]['ids'],_['omit'](_0x120c1d[_0xe17a('0xbd')],[_0xe17a('0xc2'),'id'])||{})[_0xe17a('0xcd')](function(){return db[_0xe17a('0xce')][_0xe17a('0xca')]({'attributes':['id',_0xe17a('0x2d'),'color'],'where':{'id':_0x120c1d[_0xe17a('0xbd')][_0xe17a('0xc2')]}});})[_0xe17a('0x2a')](function(_0x9d172f){socket[_0xe17a('0xcf')](_0xe17a('0xd0'),{'id':Number(_0x120c1d[_0xe17a('0xba')]['id']),'tags':_0x9d172f||[]});return{'id':Number(_0x120c1d[_0xe17a('0xba')]['id']),'tags':_0x9d172f||[]};});}})[_0xe17a('0x2a')](respondWithResult(_0x4a0ebf,null))[_0xe17a('0x35')](handleError(_0x4a0ebf,null));};exports[_0xe17a('0xd1')]=function(_0x48c012,_0x30e128,_0x1b6051){return db[_0xe17a('0x37')][_0xe17a('0x62')]({'where':{'id':_0x48c012['params']['id']}})['then'](handleEntityNotFound(_0x30e128,null))[_0xe17a('0x2a')](function(_0x5a39e3){if(_0x5a39e3){return _0x5a39e3[_0xe17a('0xd1')](_0x48c012[_0xe17a('0x3c')][_0xe17a('0xc2')]);}})[_0xe17a('0x2a')](respondWithStatusCode(_0x30e128,null))[_0xe17a('0x35')](handleError(_0x30e128,null));};exports[_0xe17a('0xd2')]=function(_0x17cc4d,_0x2506cd){var _0xe3d699=moment()[_0xe17a('0xd3')]()[_0xe17a('0x99')]();var _0x20d8ea=path[_0xe17a('0xd4')](config['root'],'server',_0xe17a('0xd5'),_0xe17a('0xd6'));var _0x316df6=path[_0xe17a('0xd4')](config[_0xe17a('0xd7')],_0xe17a('0xd8'),_0xe17a('0xd5'),_0xe17a('0xd9'));var _0x24f658=path['join'](_0x20d8ea,_0xe3d699);var _0x35ad4c=util['format'](_0xe17a('0xda'),_0x17cc4d[_0xe17a('0xba')]['id'],_0xe3d699);var _0x239de5=path[_0xe17a('0xd4')](_0x20d8ea,_0x35ad4c);var _0x1a8daa=[];_0x1a8daa[_0xe17a('0x33')]({'model':db[_0xe17a('0xdb')],'as':'User','attributes':['id',_0xe17a('0x31')],'raw':!![]});_0x1a8daa[_0xe17a('0x33')]({'model':db[_0xe17a('0xdc')],'as':_0xe17a('0x68'),'attributes':['id',_0xe17a('0xdd'),_0xe17a('0xde')],'raw':!![]});var _0x18461d=[{'model':db[_0xe17a('0xc1')],'as':'Messages','attributes':['id',_0xe17a('0xbd'),'createdAt',_0xe17a('0xdf'),_0xe17a('0xe0'),_0xe17a('0x80')],'include':_0x1a8daa}];_0x18461d[_0xe17a('0x33')]({'model':db['SmsAccount'],'as':_0xe17a('0xe1'),'attributes':['id',_0xe17a('0x2d')]});_0x18461d[_0xe17a('0x33')]({'model':db[_0xe17a('0xdb')],'as':_0xe17a('0xe2'),'attributes':['id',_0xe17a('0x31')]});return db['SmsInteraction'][_0xe17a('0x62')]({'where':{'id':_0x17cc4d[_0xe17a('0xba')]['id']},'include':_0x18461d})[_0xe17a('0x2a')](handleEntityNotFound(_0x2506cd,null))[_0xe17a('0x2a')](function(_0x38dc24){if(_0x38dc24){var _0x1b9412=_0x38dc24[_0xe17a('0xe3')]({'plain':!![]});fs[_0xe17a('0xe4')](_0x24f658);var _0x18dbae={'channel':_0xe17a('0xe5'),'account':_0x1b9412[_0xe17a('0xe1')][_0xe17a('0x2d')],'agent':_0x1b9412[_0xe17a('0xe2')]?_0x1b9412['Owner']['fullname']:'N.A.','createdAt':moment(_0x1b9412['createdAt'])[_0xe17a('0xc6')](_0xe17a('0xc7'))['toString'](),'closedAt':_0x1b9412['closed']?moment(_0x1b9412[_0xe17a('0xe6')])[_0xe17a('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe17a('0x99')]():'','disposition':_0x1b9412[_0xe17a('0xe7')],'messages':_(_0x1b9412[_0xe17a('0xe8')])[_0xe17a('0x85')]({'secret':![]})[_0xe17a('0x30')](function(_0x5784ce){return{'date':moment(_0x5784ce['createdAt'])[_0xe17a('0xc6')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe17a('0x99')](),'sender':_0x5784ce[_0xe17a('0xdf')]==='out'?_0x5784ce[_0xe17a('0xdb')]?_0x5784ce['User']['fullname']:_0xe17a('0xe9'):_0x5784ce['Contact'][_0xe17a('0xdd')]+(_0x5784ce[_0xe17a('0x68')][_0xe17a('0xde')]?'\x20'+_0x5784ce[_0xe17a('0x68')][_0xe17a('0xde')]:''),'body':_0x5784ce[_0xe17a('0xbd')],'direction':_0x5784ce[_0xe17a('0xdf')]===_0xe17a('0xea')?'A':'C','secret':_0x5784ce[_0xe17a('0xe0')],'read':_0x5784ce['read']};})['value']()};return ejs['renderFile'](path[_0xe17a('0xd4')](config[_0xe17a('0xd7')],_0xe17a('0xd8'),_0xe17a('0xeb'),_0xe17a('0xec')),{'interaction':_0x18dbae})[_0xe17a('0x2a')](function(_0x359af9){var _0x4ab34a=path['join'](_0x24f658,'transcript-'+_0x1b9412['id']+'-'+_0xe3d699+_0xe17a('0xed'));var _0x2c7da8={'path':_0x4ab34a,'channel':_0xe17a('0xe5'),'interactionId':_0x1b9412['id']};return pdf[_0xe17a('0xee')](_0x359af9,_0x2c7da8);})[_0xe17a('0x2a')](function(){return new BPromise(function(_0x152739,_0x43335d){zipdir(_0x24f658,{'saveTo':_0x239de5},function(_0x39a0f2,_0x4830ae){if(_0x39a0f2)return _0x43335d(_0x39a0f2);return _0x152739(_0x4830ae);});})[_0xe17a('0x2a')](function(){return new BPromise(function(_0x1b3209,_0x29fd8e){rimraf(_0x24f658,function(_0x568152){if(_0x568152)_0x29fd8e(_0x568152);return _0x1b3209();});});})[_0xe17a('0x2a')](function(){return _0x2506cd['download'](_0x239de5,_0x35ad4c,function(_0x28387f){if(_0x28387f){console[_0xe17a('0xef')](_0xe17a('0xf0'),_0x28387f);}else{fs['unlinkSync'](_0x239de5);}});});});}else{return _0x2506cd[_0xe17a('0x1e')](0xc8);}})[_0xe17a('0x35')](handleError(_0x2506cd,null));};
\ No newline at end of file
index 08c5279..1bf39d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x8c318b,_0x309481){var _0x3c000a=function(_0x33db55){while(--_0x33db55){_0x8c318b['push'](_0x8c318b['shift']());}};_0x3c000a(++_0x309481);}(_0xdb28,0x106));var _0x8db2=function(_0x4001fe,_0x3c3cfe){_0x4001fe=_0x4001fe-0x0;var _0x1381e6=_0xdb28[_0x4001fe];return _0x1381e6;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x430c=['setMaxListeners','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','events','../../mysqldb','SmsMessage'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x430c,0x1a1));var _0xc430=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0x430c[_0x3b0c9d];return _0xcfc8d7;};'use strict';var EventEmitter=require(_0xc430('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require(_0xc430('0x1'))['db'][_0xc430('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc430('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x47d8b9){return function(_0x338a82,_0x2408f5,_0x50b256){_0x338a82[_0xc430('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x212354){_0x338a82[_0xc430('0x5')](_0xc430('0x6'),_0x212354[_0xc430('0x7')](function(_0x2e23f8){return{'id':_0x2e23f8['id']};}));return SmsMessage[_0xc430('0x8')]({'where':{'SmsInteractionId':_0x338a82['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc430('0x9')](function(_0x115814){_0x338a82[_0xc430('0x5')]('unreadMessages',_0x115814[_0xc430('0xa')]);SmsInteractionEvents[_0xc430('0xb')](_0x47d8b9+':'+_0x338a82['id'],_0x338a82);SmsInteractionEvents['emit'](_0x47d8b9,_0x338a82);_0x50b256(null);})[_0xc430('0xc')](_0x50b256(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xc430('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index 4f86561..05838a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fbf=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1fbf,0x175));var _0xf1fb=function(_0x145fe6,_0xdc1e17){_0x145fe6=_0x145fe6-0x0;var _0x2b113a=_0x1fbf[_0x145fe6];return _0x2b113a;};'use strict';var _=require(_0xf1fb('0x0'));var util=require(_0xf1fb('0x1'));var logger=require(_0xf1fb('0x2'))(_0xf1fb('0x3'));var moment=require('moment');var BPromise=require(_0xf1fb('0x4'));var rp=require(_0xf1fb('0x5'));var fs=require('fs');var path=require(_0xf1fb('0x6'));var rimraf=require(_0xf1fb('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1fb('0x8'));module[_0xf1fb('0x9')]=function(_0x365c91,_0x1aa3ee){return _0x365c91[_0xf1fb('0xa')](_0xf1fb('0xb'),attributes,{'tableName':_0xf1fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11e303,_0x11ae97,_0x1964e3){if(_0x11e303[_0xf1fb('0xd')](_0xf1fb('0xe'))){_0x11e303[_0xf1fb('0xf')]=moment()['format'](_0xf1fb('0x10'));}_0x1964e3(null,_0x11e303);}}});};
\ No newline at end of file
+var _0xe601=['request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x133e05,_0x28eb8d){var _0x30d761=function(_0x487c64){while(--_0x487c64){_0x133e05['push'](_0x133e05['shift']());}};_0x30d761(++_0x28eb8d);}(_0xe601,0x12e));var _0x1e60=function(_0x4dec5b,_0x566566){_0x4dec5b=_0x4dec5b-0x0;var _0x18e683=_0xe601[_0x4dec5b];return _0x18e683;};'use strict';var _=require(_0x1e60('0x0'));var util=require(_0x1e60('0x1'));var logger=require('../../config/logger')(_0x1e60('0x2'));var moment=require(_0x1e60('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e60('0x4'));var fs=require('fs');var path=require(_0x1e60('0x5'));var rimraf=require(_0x1e60('0x6'));var config=require(_0x1e60('0x7'));var attributes=require(_0x1e60('0x8'));module[_0x1e60('0x9')]=function(_0x5cb4b3,_0x50215c){return _0x5cb4b3[_0x1e60('0xa')](_0x1e60('0xb'),attributes,{'tableName':_0x1e60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xea652a,_0x42cdc9,_0x319d32){if(_0xea652a[_0x1e60('0xd')](_0x1e60('0xe'))){_0xea652a['closedAt']=moment()[_0x1e60('0xf')](_0x1e60('0x10'));}_0x319d32(null,_0xea652a);}}});};
\ No newline at end of file
index ae7f558..784a48f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03c6=['find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToSmsInteraction'];(function(_0x26cbc7,_0x280e84){var _0x53c271=function(_0x3270b5){while(--_0x3270b5){_0x26cbc7['push'](_0x26cbc7['shift']());}};_0x53c271(++_0x280e84);}(_0x03c6,0x7e));var _0x603c=function(_0x3d68ab,_0x263121){_0x3d68ab=_0x3d68ab-0x0;var _0x5c6fae=_0x03c6[_0x3d68ab];return _0x5c6fae;};'use strict';var _=require(_0x603c('0x0'));var util=require('util');var moment=require(_0x603c('0x1'));var BPromise=require(_0x603c('0x2'));var rs=require(_0x603c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x603c('0x4'))['db'];var utils=require(_0x603c('0x5'));var logger=require(_0x603c('0x6'))(_0x603c('0x7'));var config=require('../../config/environment');var jayson=require(_0x603c('0x8'));var client=jayson['client'][_0x603c('0x9')]({'port':0x232a});config['redis']=_[_0x603c('0xa')](config[_0x603c('0xb')],{'host':_0x603c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3f8422,_0x58d7e8,_0x500619){return new BPromise(function(_0x1ba619,_0x439c5e){return client['request'](_0x3f8422,_0x500619)[_0x603c('0xd')](function(_0x274242){logger['info'](_0x603c('0xe'),_0x58d7e8,_0x603c('0xf'));logger[_0x603c('0x10')](_0x603c('0x11'),_0x58d7e8,_0x603c('0xf'),JSON['stringify'](_0x274242));if(_0x274242[_0x603c('0x12')]){if(_0x274242[_0x603c('0x12')][_0x603c('0x13')]===0x1f4){logger['error'](_0x603c('0xe'),_0x58d7e8,_0x274242['error'][_0x603c('0x14')]);return _0x439c5e(_0x274242[_0x603c('0x12')][_0x603c('0x14')]);}logger[_0x603c('0x12')](_0x603c('0xe'),_0x58d7e8,_0x274242[_0x603c('0x12')][_0x603c('0x14')]);return _0x1ba619(_0x274242[_0x603c('0x12')][_0x603c('0x14')]);}else{logger[_0x603c('0x15')](_0x603c('0xe'),_0x58d7e8,_0x603c('0xf'));_0x1ba619(_0x274242[_0x603c('0x16')][_0x603c('0x14')]);}})[_0x603c('0x17')](function(_0x14b102){logger[_0x603c('0x12')](_0x603c('0xe'),_0x58d7e8,_0x14b102);_0x439c5e(_0x14b102);});});}exports[_0x603c('0x18')]=function(_0x592408){var _0x56a2b2=this;return new Promise(function(_0x3d9ec8,_0x1b5d43){return db[_0x603c('0x19')][_0x603c('0x1a')](_0x592408[_0x603c('0x1b')],{'raw':_0x592408[_0x603c('0x1c')]?_0x592408['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592408[_0x603c('0x1c')]?_0x592408[_0x603c('0x1c')][_0x603c('0x1d')]||null:null,'attributes':_0x592408['options']?_0x592408[_0x603c('0x1c')][_0x603c('0x1e')]||null:null,'limit':_0x592408[_0x603c('0x1c')]?_0x592408['options'][_0x603c('0x1f')]||null:null})['then'](function(_0x256fd9){logger[_0x603c('0x15')](_0x603c('0x18'),_0x592408);logger[_0x603c('0x10')](_0x603c('0x18'),_0x592408,JSON[_0x603c('0x20')](_0x256fd9));_0x3d9ec8(_0x256fd9);})[_0x603c('0x17')](function(_0x43efc3){logger[_0x603c('0x12')]('UpdateSmsInteraction',_0x43efc3[_0x603c('0x14')],_0x592408);_0x1b5d43(_0x56a2b2[_0x603c('0x12')](0x1f4,_0x43efc3[_0x603c('0x14')]));});});};exports[_0x603c('0x21')]=function(_0x4b8de7){return new Promise(function(_0x4edc0b,_0x3c4a3c){return db[_0x603c('0x19')][_0x603c('0x22')]({'where':_0x4b8de7['options']?_0x4b8de7['options'][_0x603c('0x1d')]||null:null})[_0x603c('0xd')](function(_0x3801d4){if(_0x3801d4){return _0x3801d4[_0x603c('0x23')](_0x4b8de7['body'][_0x603c('0x24')],_[_0x603c('0x25')](_0x4b8de7[_0x603c('0x1b')],[_0x603c('0x24'),'id'])||{});}})[_0x603c('0x26')](function(_0x1063ef){logger[_0x603c('0x15')](_0x603c('0x27'),_0x4b8de7);logger['debug'](_0x603c('0x27'),_0x4b8de7,JSON[_0x603c('0x20')](_0x1063ef));_0x4edc0b(_0x1063ef);})['catch'](function(_0x56f35d){logger['error'](_0x603c('0x27'),_0x56f35d[_0x603c('0x14')],_0x4b8de7);_0x3c4a3c(_this[_0x603c('0x12')](0x1f4,_0x56f35d[_0x603c('0x14')]));});});};
\ No newline at end of file
+var _0xaf92=['message','catch','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1277aa,_0x23a31b){var _0x2ce6be=function(_0x2fa63f){while(--_0x2fa63f){_0x1277aa['push'](_0x1277aa['shift']());}};_0x2ce6be(++_0x23a31b);}(_0xaf92,0x12f));var _0x2af9=function(_0x2715e7,_0x524fe0){_0x2715e7=_0x2715e7-0x0;var _0x327f9c=_0xaf92[_0x2715e7];return _0x327f9c;};'use strict';var _=require('lodash');var util=require(_0x2af9('0x0'));var moment=require(_0x2af9('0x1'));var BPromise=require(_0x2af9('0x2'));var rs=require(_0x2af9('0x3'));var fs=require('fs');var Redis=require(_0x2af9('0x4'));var db=require(_0x2af9('0x5'))['db'];var utils=require(_0x2af9('0x6'));var logger=require(_0x2af9('0x7'))(_0x2af9('0x8'));var config=require(_0x2af9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2af9('0xa')][_0x2af9('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2af9('0xc')],{'host':_0x2af9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2af9('0xc')]));require(_0x2af9('0xe'))['register'](socket);function respondWithRpcPromise(_0x1ffae5,_0x32d0e7,_0x13842d){return new BPromise(function(_0x865d2f,_0x1ab470){return client[_0x2af9('0xf')](_0x1ffae5,_0x13842d)[_0x2af9('0x10')](function(_0x56a3c9){logger[_0x2af9('0x11')](_0x2af9('0x12'),_0x32d0e7,_0x2af9('0x13'));logger[_0x2af9('0x14')](_0x2af9('0x15'),_0x32d0e7,'request\x20sent',JSON[_0x2af9('0x16')](_0x56a3c9));if(_0x56a3c9['error']){if(_0x56a3c9[_0x2af9('0x17')][_0x2af9('0x18')]===0x1f4){logger[_0x2af9('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x32d0e7,_0x56a3c9['error'][_0x2af9('0x19')]);return _0x1ab470(_0x56a3c9[_0x2af9('0x17')][_0x2af9('0x19')]);}logger[_0x2af9('0x17')](_0x2af9('0x12'),_0x32d0e7,_0x56a3c9[_0x2af9('0x17')][_0x2af9('0x19')]);return _0x865d2f(_0x56a3c9[_0x2af9('0x17')][_0x2af9('0x19')]);}else{logger[_0x2af9('0x11')](_0x2af9('0x12'),_0x32d0e7,_0x2af9('0x13'));_0x865d2f(_0x56a3c9['result'][_0x2af9('0x19')]);}})[_0x2af9('0x1a')](function(_0x57c498){logger[_0x2af9('0x17')](_0x2af9('0x12'),_0x32d0e7,_0x57c498);_0x1ab470(_0x57c498);});});}exports['UpdateSmsInteraction']=function(_0x1ebfa8){var _0x5d5757=this;return new Promise(function(_0x9d7655,_0x396c95){return db['SmsInteraction'][_0x2af9('0x1b')](_0x1ebfa8[_0x2af9('0x1c')],{'raw':_0x1ebfa8['options']?_0x1ebfa8[_0x2af9('0x1d')][_0x2af9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ebfa8[_0x2af9('0x1d')]?_0x1ebfa8['options'][_0x2af9('0x1f')]||null:null,'attributes':_0x1ebfa8['options']?_0x1ebfa8[_0x2af9('0x1d')][_0x2af9('0x20')]||null:null,'limit':_0x1ebfa8[_0x2af9('0x1d')]?_0x1ebfa8[_0x2af9('0x1d')][_0x2af9('0x21')]||null:null})['then'](function(_0x6579e1){logger[_0x2af9('0x11')]('UpdateSmsInteraction',_0x1ebfa8);logger['debug'](_0x2af9('0x22'),_0x1ebfa8,JSON[_0x2af9('0x16')](_0x6579e1));_0x9d7655(_0x6579e1);})[_0x2af9('0x1a')](function(_0x2564d4){logger[_0x2af9('0x17')](_0x2af9('0x22'),_0x2564d4['message'],_0x1ebfa8);_0x396c95(_0x5d5757['error'](0x1f4,_0x2564d4[_0x2af9('0x19')]));});});};exports[_0x2af9('0x23')]=function(_0x456384){return new Promise(function(_0x117c3f,_0x1aee2f){return db[_0x2af9('0x24')]['find']({'where':_0x456384[_0x2af9('0x1d')]?_0x456384['options']['where']||null:null})[_0x2af9('0x10')](function(_0x35b486){if(_0x35b486){return _0x35b486[_0x2af9('0x25')](_0x456384[_0x2af9('0x1c')][_0x2af9('0x26')],_['omit'](_0x456384['body'],[_0x2af9('0x26'),'id'])||{});}})[_0x2af9('0x27')](function(_0x1a41b2){logger[_0x2af9('0x11')]('AddTags',_0x456384);logger['debug'](_0x2af9('0x28'),_0x456384,JSON['stringify'](_0x1a41b2));_0x117c3f(_0x1a41b2);})[_0x2af9('0x1a')](function(_0x263d8a){logger[_0x2af9('0x17')](_0x2af9('0x28'),_0x263d8a[_0x2af9('0x19')],_0x456384);_0x1aee2f(_this[_0x2af9('0x17')](0x1f4,_0x263d8a[_0x2af9('0x19')]));});});};
\ No newline at end of file
index 7de7ed4..d1269cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4de=['update','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe4de,0x195));var _0xee4d=function(_0x312b38,_0x1cfe9f){_0x312b38=_0x312b38-0x0;var _0x8d8abb=_0xe4de[_0x312b38];return _0x8d8abb;};'use strict';var SmsInteractionEvents=require(_0xee4d('0x0'));var events=[_0xee4d('0x1'),_0xee4d('0x2'),_0xee4d('0x3')];function createListener(_0x56f131,_0x2c5d89){return function(_0x5012ae){_0x2c5d89['emit'](_0x56f131,_0x5012ae);};}function removeListener(_0x47dc50,_0x20235b){return function(){SmsInteractionEvents[_0xee4d('0x4')](_0x47dc50,_0x20235b);};}exports[_0xee4d('0x5')]=function(_0x3131b1){for(var _0x15dfab=0x0,_0x253632=events[_0xee4d('0x6')];_0x15dfab<_0x253632;_0x15dfab++){var _0x1b8605=events[_0x15dfab];var _0x384d20=createListener(_0xee4d('0x7')+_0x1b8605,_0x3131b1);SmsInteractionEvents['on'](_0x1b8605,_0x384d20);}};
\ No newline at end of file
+var _0x0d36=['remove','update','emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save'];(function(_0x389e06,_0x462e5d){var _0x167301=function(_0x53c4a9){while(--_0x53c4a9){_0x389e06['push'](_0x389e06['shift']());}};_0x167301(++_0x462e5d);}(_0x0d36,0x10c));var _0x60d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d36[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x60d3('0x0'));var events=[_0x60d3('0x1'),_0x60d3('0x2'),_0x60d3('0x3')];function createListener(_0x157618,_0x38bcdf){return function(_0x27839b){_0x38bcdf[_0x60d3('0x4')](_0x157618,_0x27839b);};}function removeListener(_0xeae705,_0x3ae17d){return function(){SmsInteractionEvents[_0x60d3('0x5')](_0xeae705,_0x3ae17d);};}exports[_0x60d3('0x6')]=function(_0x116841){for(var _0x1b8d55=0x0,_0x9d07a3=events[_0x60d3('0x7')];_0x1b8d55<_0x9d07a3;_0x1b8d55++){var _0x42be68=events[_0x1b8d55];var _0x56682f=createListener(_0x60d3('0x8')+_0x42be68,_0x116841);SmsInteractionEvents['on'](_0x42be68,_0x56682f);}};
\ No newline at end of file
index 8e70d1a..27d8833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae9e=['/:id','show','post','tracked','smsmessage:create','create','/:id/status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xae9e,0xbd));var _0xeae9=function(_0x391ca6,_0x4dd56a){_0x391ca6=_0x391ca6-0x0;var _0x4630ec=_0xae9e[_0x391ca6];return _0x4630ec;};'use strict';var multer=require('multer');var util=require(_0xeae9('0x0'));var path=require(_0xeae9('0x1'));var timeout=require(_0xeae9('0x2'));var express=require('express');var router=express[_0xeae9('0x3')]();var fs_extra=require(_0xeae9('0x4'));var auth=require(_0xeae9('0x5'));var interaction=require(_0xeae9('0x6'));var config=require(_0xeae9('0x7'));var controller=require(_0xeae9('0x8'));router[_0xeae9('0x9')]('/',auth[_0xeae9('0xa')](),controller[_0xeae9('0xb')]);router['get'](_0xeae9('0xc'),auth['isAuthenticated'](),controller[_0xeae9('0xd')]);router['get'](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller[_0xeae9('0xf')]);router[_0xeae9('0x10')]('/',auth['isAuthenticated'](),interaction[_0xeae9('0x11')]('sms',_0xeae9('0x12')),controller[_0xeae9('0x13')]);router[_0xeae9('0x10')](_0xeae9('0x14'),controller['status']);router[_0xeae9('0x15')](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller['update']);router[_0xeae9('0x15')](_0xeae9('0x16'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x17')]);router[_0xeae9('0x15')](_0xeae9('0x18'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x19')]);router[_0xeae9('0x1a')](_0xeae9('0xe'),auth[_0xeae9('0xa')](),controller[_0xeae9('0x1b')]);module[_0xeae9('0x1c')]=router;
\ No newline at end of file
+var _0x5420=['../../config/environment','./smsMessage.controller','get','isAuthenticated','describe','/:id','tracked','smsmessage:create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x5420,0x1ba));var _0x0542=function(_0x557d9a,_0x5dd9ec){_0x557d9a=_0x557d9a-0x0;var _0x5e3e8d=_0x5420[_0x557d9a];return _0x5e3e8d;};'use strict';var multer=require(_0x0542('0x0'));var util=require('util');var path=require(_0x0542('0x1'));var timeout=require(_0x0542('0x2'));var express=require(_0x0542('0x3'));var router=express[_0x0542('0x4')]();var fs_extra=require(_0x0542('0x5'));var auth=require(_0x0542('0x6'));var interaction=require(_0x0542('0x7'));var config=require(_0x0542('0x8'));var controller=require(_0x0542('0x9'));router[_0x0542('0xa')]('/',auth[_0x0542('0xb')](),controller['index']);router[_0x0542('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x0542('0xc')]);router[_0x0542('0xa')](_0x0542('0xd'),auth[_0x0542('0xb')](),controller['show']);router['post']('/',auth[_0x0542('0xb')](),interaction[_0x0542('0xe')]('sms',_0x0542('0xf')),controller['create']);router['post'](_0x0542('0x10'),controller[_0x0542('0x11')]);router[_0x0542('0x12')]('/:id',auth[_0x0542('0xb')](),controller[_0x0542('0x13')]);router[_0x0542('0x12')](_0x0542('0x14'),auth[_0x0542('0xb')](),controller['accept']);router[_0x0542('0x12')](_0x0542('0x15'),auth[_0x0542('0xb')](),controller[_0x0542('0x16')]);router[_0x0542('0x17')](_0x0542('0xd'),auth[_0x0542('0xb')](),controller[_0x0542('0x18')]);module['exports']=router;
\ No newline at end of file
index 1a47a94..b3e8d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4cd=['sequelize','TEXT','medium','out','STRING','BOOLEAN'];(function(_0x2f8177,_0x5c54a5){var _0x4a8623=function(_0x47bcd1){while(--_0x47bcd1){_0x2f8177['push'](_0x2f8177['shift']());}};_0x4a8623(++_0x5c54a5);}(_0xe4cd,0x84));var _0xde4c=function(_0x403eda,_0x23d26b){_0x403eda=_0x403eda-0x0;var _0x7bdd17=_0xe4cd[_0x403eda];return _0x7bdd17;};'use strict';var Sequelize=require(_0xde4c('0x0'));module['exports']={'body':{'type':Sequelize[_0xde4c('0x1')](_0xde4c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xde4c('0x3')),'defaultValue':_0xde4c('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xde4c('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xde4c('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xde4c('0x4')]},'providerResponse':{'type':Sequelize[_0xde4c('0x1')]}};
\ No newline at end of file
+var _0xce39=['STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x518d5e,_0x17b17d){var _0x146f16=function(_0xaa6782){while(--_0xaa6782){_0x518d5e['push'](_0x518d5e['shift']());}};_0x146f16(++_0x17b17d);}(_0xce39,0x198));var _0x9ce3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xce39[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9ce3('0x0'));module[_0x9ce3('0x1')]={'body':{'type':Sequelize[_0x9ce3('0x2')](_0x9ce3('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9ce3('0x4')]('in',_0x9ce3('0x5')),'defaultValue':_0x9ce3('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x9ce3('0x6')]},'readAt':{'type':Sequelize[_0x9ce3('0x7')]},'secret':{'type':Sequelize[_0x9ce3('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9ce3('0x6')]},'providerResponse':{'type':Sequelize[_0x9ce3('0x2')]}};
\ No newline at end of file
index 690dc5e..00a8519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b1=['fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','internal','manual','interface','channel','event','EventManager','acceptmessage','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','fullname','SIP/%s','motionChannel','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','delivered','Status','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','name','send','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x129f74,_0x3d64d8){var _0x1cf683=function(_0x232179){while(--_0x232179){_0x129f74['push'](_0x129f74['shift']());}};_0x1cf683(++_0x3d64d8);}(_0x29b1,0x16d));var _0x129b=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x29b1[_0x1da04e];return _0xdd8c41;};'use strict';var emlformat=require(_0x129b('0x0'));var rimraf=require(_0x129b('0x1'));var zipdir=require(_0x129b('0x2'));var jsonpatch=require(_0x129b('0x3'));var rp=require(_0x129b('0x4'));var moment=require('moment');var BPromise=require(_0x129b('0x5'));var Mustache=require(_0x129b('0x6'));var util=require(_0x129b('0x7'));var path=require(_0x129b('0x8'));var sox=require(_0x129b('0x9'));var csv=require(_0x129b('0xa'));var ejs=require(_0x129b('0xb'));var fs=require('fs');var fs_extra=require(_0x129b('0xc'));var _=require('lodash');var squel=require(_0x129b('0xd'));var crypto=require('crypto');var jsforce=require(_0x129b('0xe'));var deskjs=require(_0x129b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x129b('0x10'));var Papa=require(_0x129b('0x11'));var Redis=require('ioredis');var authService=require(_0x129b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x129b('0x13'));var hardwareService=require(_0x129b('0x14'));var logger=require(_0x129b('0x15'))('api');var utils=require(_0x129b('0x16'));var config=require(_0x129b('0x17'));var licenseUtil=require(_0x129b('0x18'));var db=require(_0x129b('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x129b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x129b('0x1b')]));require(_0x129b('0x1c'))[_0x129b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x129b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x129b('0x1e')][_0x129b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x17fff2,_0x50d62b,_0x46a6a4,_0x453ba2){return new BPromise(function(_0x1364f8,_0x2ba58c){var _0x30785a=_0x453ba2||client;return _0x30785a[_0x129b('0x20')](_0x17fff2,_0x46a6a4)[_0x129b('0x21')](function(_0x169d4c){logger[_0x129b('0x22')](_0x129b('0x23'),_0x50d62b,_0x129b('0x24'));logger[_0x129b('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x50d62b,_0x129b('0x24'),JSON[_0x129b('0x26')](_0x169d4c));if(_0x169d4c[_0x129b('0x27')]){if(_0x169d4c[_0x129b('0x27')][_0x129b('0x28')]===0x1f4){logger[_0x129b('0x27')](_0x129b('0x23'),_0x50d62b,_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);return _0x2ba58c(_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);}logger[_0x129b('0x27')]('SmsMessage,\x20%s,\x20%s',_0x50d62b,_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);return _0x1364f8(_0x169d4c[_0x129b('0x27')][_0x129b('0x29')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x50d62b,_0x129b('0x24'));_0x1364f8(_0x169d4c['result'][_0x129b('0x29')]);}})[_0x129b('0x2a')](function(_0x4c733d){logger['error'](_0x129b('0x23'),_0x50d62b,_0x4c733d);_0x2ba58c(_0x4c733d);});});}function respondWithStatusCode(_0x1c6d9f,_0x2c7243){_0x2c7243=_0x2c7243||0xcc;return function(_0x10288e){if(_0x10288e){return _0x1c6d9f[_0x129b('0x2b')](_0x2c7243);}return _0x1c6d9f[_0x129b('0x2c')](_0x2c7243)[_0x129b('0x2d')]();};}function respondWithResult(_0x3fec4b,_0x4aaa74){_0x4aaa74=_0x4aaa74||0xc8;return function(_0x275ff0){if(_0x275ff0){return _0x3fec4b[_0x129b('0x2c')](_0x4aaa74)['json'](_0x275ff0);}};}function respondWithFilteredResult(_0x3a852a,_0x519053){return function(_0x4179e1){if(_0x4179e1){var _0x4d1017=typeof _0x519053[_0x129b('0x2e')]===_0x129b('0x2f')&&typeof _0x519053[_0x129b('0x30')]===_0x129b('0x2f');var _0x917382=_0x4179e1[_0x129b('0x31')];var _0x296461=_0x4d1017?0x0:_0x519053[_0x129b('0x2e')];var _0x371e89=_0x4d1017?_0x4179e1['count']:_0x519053[_0x129b('0x2e')]+_0x519053[_0x129b('0x30')];var _0x480338;if(_0x371e89>=_0x917382){_0x371e89=_0x917382;_0x480338=0xc8;}else{_0x480338=0xce;}_0x3a852a[_0x129b('0x2c')](_0x480338);return _0x3a852a[_0x129b('0x32')](_0x129b('0x33'),_0x296461+'-'+_0x371e89+'/'+_0x917382)['json'](_0x4179e1);}return null;};}function patchUpdates(_0x17e5ed){return function(_0xf2d43){try{jsonpatch['apply'](_0xf2d43,_0x17e5ed,!![]);}catch(_0x5a1229){return BPromise[_0x129b('0x34')](_0x5a1229);}return _0xf2d43['save']();};}function saveUpdates(_0x333b32,_0x4eb857){return function(_0x15b01c){if(_0x15b01c){return _0x15b01c[_0x129b('0x35')](_0x333b32)['then'](function(_0x4249a8){return _0x4249a8;});}return null;};}function removeEntity(_0x141d8f,_0x3e80a9){return function(_0x5bd0f6){if(_0x5bd0f6){return _0x5bd0f6[_0x129b('0x36')]()[_0x129b('0x21')](function(){_0x141d8f[_0x129b('0x2c')](0xcc)[_0x129b('0x2d')]();});}};}function handleEntityNotFound(_0x5a6c3e,_0x55937f){return function(_0x49189e){if(!_0x49189e){_0x5a6c3e[_0x129b('0x2b')](0x194);}return _0x49189e;};}function handleError(_0x52e037,_0x39e68d){_0x39e68d=_0x39e68d||0x1f4;return function(_0x1bc5ea){logger[_0x129b('0x27')](_0x1bc5ea['stack']);if(_0x1bc5ea['name']){delete _0x1bc5ea[_0x129b('0x37')];}_0x52e037[_0x129b('0x2c')](_0x39e68d)[_0x129b('0x38')](_0x1bc5ea);};}exports['index']=function(_0x25569f,_0x2588e3){var _0x536aa3={},_0xf2da76={},_0x158cfb={'count':0x0,'rows':[]};var _0x4e5410=_['map'](db[_0x129b('0x39')][_0x129b('0x3a')],function(_0x2a81e8){return{'name':_0x2a81e8[_0x129b('0x3b')],'type':_0x2a81e8[_0x129b('0x3c')][_0x129b('0x3d')]};});_0xf2da76[_0x129b('0x3e')]=_['map'](_0x4e5410,'name');_0xf2da76[_0x129b('0x3f')]=_['keys'](_0x25569f[_0x129b('0x3f')]);_0xf2da76[_0x129b('0x40')]=_[_0x129b('0x41')](_0xf2da76[_0x129b('0x3e')],_0xf2da76[_0x129b('0x3f')]);_0x536aa3[_0x129b('0x42')]=_['intersection'](_0xf2da76['model'],qs[_0x129b('0x43')](_0x25569f['query'][_0x129b('0x43')]));_0x536aa3[_0x129b('0x42')]=_0x536aa3[_0x129b('0x42')][_0x129b('0x44')]?_0x536aa3['attributes']:_0xf2da76['model'];if(!_0x25569f['query'][_0x129b('0x45')]('nolimit')){_0x536aa3[_0x129b('0x30')]=qs['limit'](_0x25569f[_0x129b('0x3f')]['limit']);_0x536aa3[_0x129b('0x2e')]=qs[_0x129b('0x2e')](_0x25569f[_0x129b('0x3f')][_0x129b('0x2e')]);}_0x536aa3[_0x129b('0x46')]=qs[_0x129b('0x47')](_0x25569f['query']['sort']);_0x536aa3['where']=qs[_0x129b('0x40')](_[_0x129b('0x48')](_0x25569f[_0x129b('0x3f')],_0xf2da76['filters']),_0x4e5410);if(_0x25569f['query'][_0x129b('0x49')]){_0x536aa3[_0x129b('0x4a')]=_[_0x129b('0x4b')](_0x536aa3[_0x129b('0x4a')],{'$or':_[_0x129b('0x4c')](_0x4e5410,function(_0x123562){if(_0x123562['type']!==_0x129b('0x4d')){var _0x6cc4cb={};_0x6cc4cb[_0x123562['name']]={'$like':'%'+_0x25569f[_0x129b('0x3f')][_0x129b('0x49')]+'%'};return _0x6cc4cb;}})});}_0x536aa3=_[_0x129b('0x4b')]({},_0x536aa3,_0x25569f[_0x129b('0x4e')]);var _0xa70a30={'where':_0x536aa3[_0x129b('0x4a')]};return db[_0x129b('0x39')][_0x129b('0x31')](_0xa70a30)[_0x129b('0x21')](function(_0x336f72){_0x158cfb[_0x129b('0x31')]=_0x336f72;if(_0x25569f[_0x129b('0x3f')][_0x129b('0x4f')]){_0x536aa3[_0x129b('0x50')]=[{'all':!![]}];}return db[_0x129b('0x39')][_0x129b('0x51')](_0x536aa3);})[_0x129b('0x21')](function(_0x38bd1a){_0x158cfb[_0x129b('0x52')]=_0x38bd1a;return _0x158cfb;})[_0x129b('0x21')](respondWithFilteredResult(_0x2588e3,_0x536aa3))['catch'](handleError(_0x2588e3,null));};exports[_0x129b('0x53')]=function(_0x128d59,_0x37dcfd){var _0x27a469={'raw':!![],'where':{'id':_0x128d59['params']['id']}},_0x56a8ff={};_0x56a8ff[_0x129b('0x3e')]=_[_0x129b('0x54')](db[_0x129b('0x39')]['rawAttributes']);_0x56a8ff['query']=_[_0x129b('0x54')](_0x128d59[_0x129b('0x3f')]);_0x56a8ff['filters']=_[_0x129b('0x41')](_0x56a8ff[_0x129b('0x3e')],_0x56a8ff[_0x129b('0x3f')]);_0x27a469['attributes']=_[_0x129b('0x41')](_0x56a8ff[_0x129b('0x3e')],qs[_0x129b('0x43')](_0x128d59[_0x129b('0x3f')]['fields']));_0x27a469['attributes']=_0x27a469[_0x129b('0x42')][_0x129b('0x44')]?_0x27a469[_0x129b('0x42')]:_0x56a8ff[_0x129b('0x3e')];if(_0x128d59[_0x129b('0x3f')]['includeAll']){_0x27a469[_0x129b('0x50')]=[{'all':!![]}];}_0x27a469=_[_0x129b('0x4b')]({},_0x27a469,_0x128d59[_0x129b('0x4e')]);return db[_0x129b('0x39')][_0x129b('0x55')](_0x27a469)[_0x129b('0x21')](handleEntityNotFound(_0x37dcfd,null))[_0x129b('0x21')](respondWithResult(_0x37dcfd,null))[_0x129b('0x2a')](handleError(_0x37dcfd,null));};exports[_0x129b('0x56')]=function(_0x11fae9,_0x131cd4){return db[_0x129b('0x39')][_0x129b('0x56')](_0x11fae9[_0x129b('0x57')],{})[_0x129b('0x21')](respondWithResult(_0x131cd4,0xc9))[_0x129b('0x2a')](handleError(_0x131cd4,null));};exports[_0x129b('0x35')]=function(_0x59f400,_0x2cd9fd){if(_0x59f400[_0x129b('0x57')]['id']){delete _0x59f400[_0x129b('0x57')]['id'];}return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x59f400[_0x129b('0x58')]['id']}})[_0x129b('0x21')](handleEntityNotFound(_0x2cd9fd,null))[_0x129b('0x21')](saveUpdates(_0x59f400['body'],null))[_0x129b('0x21')](respondWithResult(_0x2cd9fd,null))['catch'](handleError(_0x2cd9fd,null));};exports[_0x129b('0x36')]=function(_0x56fa31,_0x484442){return db['SmsMessage'][_0x129b('0x55')]({'where':{'id':_0x56fa31['params']['id']}})[_0x129b('0x21')](handleEntityNotFound(_0x484442,null))[_0x129b('0x21')](removeEntity(_0x484442,null))[_0x129b('0x2a')](handleError(_0x484442,null));};exports[_0x129b('0x59')]=function(_0x255571,_0x502086){return db[_0x129b('0x39')][_0x129b('0x59')]()[_0x129b('0x21')](respondWithResult(_0x502086,null))[_0x129b('0x2a')](handleError(_0x502086,null));};var interaction_log=require('../../config/logger')(_0x129b('0x5a'));exports[_0x129b('0x5b')]=function(_0x4638be,_0x508745,_0x52ece3){var _0x3fe7ac={'agent':{},'channel':_0x129b('0x5c')};if(_0x4638be[_0x129b('0x57')]['id']){delete _0x4638be[_0x129b('0x57')]['id'];}_0x4638be[_0x129b('0x57')][_0x129b('0x5d')]=!![];_0x4638be['body'][_0x129b('0x5e')]=moment()[_0x129b('0x5f')](_0x129b('0x60'));_0x4638be[_0x129b('0x57')]['UserId']=_0x4638be[_0x129b('0x57')][_0x129b('0x61')]||_0x4638be[_0x129b('0x62')]['id'];_0x3fe7ac[_0x129b('0x63')]['id']=_0x4638be[_0x129b('0x57')][_0x129b('0x61')];return db['SmsMessage'][_0x129b('0x55')]({'where':{'id':_0x4638be['params']['id'],'UserId':null}})[_0x129b('0x21')](handleEntityNotFound(_0x508745,null))['then'](saveUpdates(_0x4638be[_0x129b('0x57')],null))[_0x129b('0x21')](function(_0x3ee493){if(_0x3ee493){_0x3fe7ac['message']=_0x3ee493[_0x129b('0x64')]({'plain':!![]});return db[_0x129b('0x65')][_0x129b('0x55')]({'where':{'id':_0x3ee493['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x508745,null))[_0x129b('0x21')](function(_0x2a263f){if(_0x2a263f){return _0x2a263f['update']({'UserId':_0x4638be[_0x129b('0x57')][_0x129b('0x61')],'read1stAt':_[_0x129b('0x66')](_0x2a263f['read1stAt'])?moment()[_0x129b('0x5f')](_0x129b('0x60')):undefined});}return null;})[_0x129b('0x21')](function(_0x593579){if(_0x593579){_0x3fe7ac[_0x129b('0x67')]=_0x593579[_0x129b('0x64')]({'plain':!![]});interaction_log[_0x129b('0x22')](_0x129b('0x68'),_0x4638be[_0x129b('0x62')]['id'],_0x4638be['user'][_0x129b('0x37')],_0x4638be['user'][_0x129b('0x69')],_0x3fe7ac['interaction']['id'],_0x4638be[_0x129b('0x57')]?JSON[_0x129b('0x26')](_0x4638be[_0x129b('0x57')]):_0x129b('0x6a'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3fe7ac);}return null;})['then'](function(_0x24fc30){var _0xb8601f=_0x129b('0x6b')+_0x24fc30['message'][_0x129b('0x6c')];return db[_0x129b('0x6d')][_0x129b('0x3f')](_0xb8601f,{'type':db[_0x129b('0x6e')][_0x129b('0x6f')][_0x129b('0x70')],'raw':!![]})[_0x129b('0x21')](function(_0x51f823){return _0x51f823;});})['then'](function(_0x7d58f3){if(_0x7d58f3){_0x3fe7ac[_0x129b('0x29')]['contact']=_0x7d58f3[0x0];if(!_0x4638be[_0x129b('0x57')][_0x129b('0x61')])return;return db[_0x129b('0x71')][_0x129b('0x55')]({'where':{'id':_0x4638be[_0x129b('0x57')][_0x129b('0x61')],'role':_0x129b('0x63')},'attributes':['id',_0x129b('0x37'),'fullname','email',_0x129b('0x72')],'raw':!![]});}return null;})['then'](function(_0x36379c){if(!_0x36379c)return null;_0x3fe7ac['message'][_0x129b('0x63')]=_0x36379c;return _0x3fe7ac;})[_0x129b('0x21')](function(_0x29aa1c){if(_0x29aa1c){if(_0x4638be[_0x129b('0x57')][_0x129b('0x73')]){_0x3fe7ac[_0x129b('0x29')][_0x129b('0x74')]=util[_0x129b('0x5f')]('SIP/%s',_0x4638be[_0x129b('0x62')][_0x129b('0x37')]);_0x3fe7ac[_0x129b('0x29')][_0x129b('0x75')]=_0x3fe7ac[_0x129b('0x75')];_0x3fe7ac['message']['motionChannel']=_0x3fe7ac['channel'];_0x3fe7ac[_0x129b('0x29')][_0x129b('0x76')]=_0x129b('0x5b');return respondWithRpcPromise(_0x129b('0x77'),_0x129b('0x77'),{'event':_0x129b('0x78'),'message':_0x3fe7ac[_0x129b('0x29')]},client9002)[_0x129b('0x21')](function(){return _0x3fe7ac;});}return _0x3fe7ac;}return null;})[_0x129b('0x21')](respondWithResult(_0x508745,null))[_0x129b('0x2a')](handleError(_0x508745,null));};var interaction_log=require(_0x129b('0x15'))(_0x129b('0x5a'));exports['reject']=function(_0x51778b,_0x1c4169,_0x5465e5){var _0x5ea7d3={'agent':{},'channel':'sms'};if(_0x51778b[_0x129b('0x57')]['id']){delete _0x51778b[_0x129b('0x57')]['id'];}_0x51778b['body'][_0x129b('0x61')]=_0x51778b[_0x129b('0x57')][_0x129b('0x61')]||_0x51778b[_0x129b('0x62')]['id'];_0x5ea7d3[_0x129b('0x63')]['id']=_0x51778b[_0x129b('0x57')][_0x129b('0x61')];return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x51778b['params']['id'],'UserId':null}})[_0x129b('0x21')](handleEntityNotFound(_0x1c4169,null))[_0x129b('0x21')](function(_0x549cbe){if(_0x549cbe){_0x5ea7d3[_0x129b('0x29')]=_0x549cbe[_0x129b('0x64')]({'plain':!![]});return db[_0x129b('0x65')][_0x129b('0x55')]({'where':{'id':_0x549cbe[_0x129b('0x79')]}});}return null;})[_0x129b('0x21')](handleEntityNotFound(_0x1c4169,null))['then'](function(_0x2c2908){if(_0x2c2908){_0x5ea7d3[_0x129b('0x67')]=_0x2c2908[_0x129b('0x64')]({'plain':!![]});interaction_log['info'](_0x129b('0x7a'),_0x51778b['user']['id'],_0x51778b[_0x129b('0x62')][_0x129b('0x37')],_0x51778b[_0x129b('0x62')][_0x129b('0x69')],_0x5ea7d3['interaction']['id'],_0x51778b[_0x129b('0x57')]?JSON[_0x129b('0x26')](_0x51778b[_0x129b('0x57')]):_0x129b('0x6a'));return respondWithRpcPromise(_0x129b('0x7b'),_0x129b('0x7c'),_0x5ea7d3);}return null;})[_0x129b('0x21')](function(_0x143c29){var _0x4b6219=_0x129b('0x6b')+_0x143c29['message'][_0x129b('0x6c')];return db[_0x129b('0x6d')]['query'](_0x4b6219,{'type':db[_0x129b('0x6e')][_0x129b('0x6f')][_0x129b('0x70')],'raw':!![]})[_0x129b('0x21')](function(_0x8a417e){return _0x8a417e;});})[_0x129b('0x21')](function(_0x2af88a){if(_0x2af88a){_0x5ea7d3[_0x129b('0x29')][_0x129b('0x7d')]=_0x2af88a[0x0];if(!_0x51778b[_0x129b('0x57')][_0x129b('0x61')])return;return db[_0x129b('0x71')][_0x129b('0x55')]({'where':{'id':_0x51778b[_0x129b('0x57')][_0x129b('0x61')],'role':_0x129b('0x63')},'attributes':['id',_0x129b('0x37'),_0x129b('0x7e'),'email',_0x129b('0x72')],'raw':!![]});}return null;})['then'](function(_0x49c53c){if(!_0x49c53c)return null;_0x5ea7d3[_0x129b('0x29')][_0x129b('0x63')]=_0x49c53c;return _0x5ea7d3;})[_0x129b('0x21')](function(_0xecf1dd){if(_0xecf1dd){_0xecf1dd[_0x129b('0x29')][_0x129b('0x74')]=util[_0x129b('0x5f')](_0x129b('0x7f'),_0x51778b[_0x129b('0x62')]['name']);_0xecf1dd[_0x129b('0x29')][_0x129b('0x75')]=_0x5ea7d3['channel'];_0xecf1dd[_0x129b('0x29')][_0x129b('0x80')]=_0x5ea7d3[_0x129b('0x75')];_0xecf1dd[_0x129b('0x29')][_0x129b('0x76')]=_0x129b('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':_0x129b('0x81'),'message':_0xecf1dd[_0x129b('0x29')]},client9002);return _0x5ea7d3;}return null;})[_0x129b('0x21')](respondWithResult(_0x1c4169,null))['catch'](handleError(_0x1c4169,null));};exports['status']=function(_0x539104,_0x37e6a6,_0x5ef869){if(_0x539104[_0x129b('0x57')]['id']){delete _0x539104[_0x129b('0x57')]['id'];}var _0x361e00;return db[_0x129b('0x39')][_0x129b('0x55')]({'where':{'id':_0x539104[_0x129b('0x58')]['id']}})['then'](handleEntityNotFound(_0x37e6a6,null))[_0x129b('0x21')](function(_0x114160){if(_0x114160){_0x361e00=_0x114160;return db[_0x129b('0x82')][_0x129b('0x55')]({'where':{'id':_0x114160[_0x129b('0x83')]}});}})[_0x129b('0x21')](handleEntityNotFound(_0x37e6a6,null))['then'](function(_0x5a90d1){if(_0x5a90d1){logger[_0x129b('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x129b('0x2c'),'received\x20delivery\x20report\x20from',_0x5a90d1[_0x129b('0x3c')],util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));switch(_0x5a90d1[_0x129b('0x3c')]){case _0x129b('0x85'):if(_0x539104[_0x129b('0x57')]['MessageSid']&&_0x539104['body'][_0x129b('0x86')]===_0x361e00[_0x129b('0x87')]){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger[_0x129b('0x27')](_0x129b('0x88'),_0x129b('0x2c'),_0x129b('0x85'),util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x129b('0x89'):if(_0x539104['body'][_0x129b('0x8a')]&&_0x539104[_0x129b('0x57')][_0x129b('0x8a')]===_0x361e00[_0x129b('0x87')]&&_['indexOf'](['sent',_0x129b('0x8b')],_0x539104['body'][_0x129b('0x8c')])>=0x0){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger[_0x129b('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x129b('0x2c'),'plivio',util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;case _0x129b('0x8d'):var _0x2a77f6=_0x539104[_0x129b('0x57')]['results'][0x0];if(_0x2a77f6[_0x129b('0x2c')][_0x129b('0x8e')]===_0x129b('0x8f')){return _0x361e00[_0x129b('0x35')]({'read':!![]});}else{logger['error'](_0x129b('0x88'),'status',_0x129b('0x8d'),util[_0x129b('0x84')](_0x539104[_0x129b('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x361e00;}})[_0x129b('0x21')](respondWithResult(_0x37e6a6,null))[_0x129b('0x2a')](handleError(_0x37e6a6,null));};
\ No newline at end of file
+var _0xdf62=['User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','null','contact','email','reject','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','params','SmsMessage','rawAttributes','merge','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x535591,_0x50a974){var _0xb45690=function(_0x30ec11){while(--_0x30ec11){_0x535591['push'](_0x535591['shift']());}};_0xb45690(++_0x50a974);}(_0xdf62,0x151));var _0x2df6=function(_0x40af5a,_0x30582d){_0x40af5a=_0x40af5a-0x0;var _0x497edf=_0xdf62[_0x40af5a];return _0x497edf;};'use strict';var emlformat=require(_0x2df6('0x0'));var rimraf=require(_0x2df6('0x1'));var zipdir=require(_0x2df6('0x2'));var jsonpatch=require(_0x2df6('0x3'));var rp=require(_0x2df6('0x4'));var moment=require(_0x2df6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2df6('0x6'));var path=require(_0x2df6('0x7'));var sox=require(_0x2df6('0x8'));var csv=require(_0x2df6('0x9'));var ejs=require(_0x2df6('0xa'));var fs=require('fs');var fs_extra=require(_0x2df6('0xb'));var _=require(_0x2df6('0xc'));var squel=require('squel');var crypto=require(_0x2df6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2df6('0xe'));var toCsv=require(_0x2df6('0x9'));var querystring=require(_0x2df6('0xf'));var Papa=require(_0x2df6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2df6('0x11'));var as=require(_0x2df6('0x12'));var hardwareService=require(_0x2df6('0x13'));var logger=require(_0x2df6('0x14'))('api');var utils=require(_0x2df6('0x15'));var config=require(_0x2df6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2df6('0x17'))['db'];config[_0x2df6('0x18')]=_[_0x2df6('0x19')](config[_0x2df6('0x18')],{'host':_0x2df6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2df6('0x18')]));require(_0x2df6('0x1b'))[_0x2df6('0x1c')](socket);var jayson=require(_0x2df6('0x1d'));var client=jayson[_0x2df6('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x2df6('0x1e')][_0x2df6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2cb57c,_0x3cee69,_0x42aea0,_0x496547){return new BPromise(function(_0x1be726,_0x207189){var _0x407fc5=_0x496547||client;return _0x407fc5[_0x2df6('0x20')](_0x2cb57c,_0x42aea0)[_0x2df6('0x21')](function(_0x568f45){logger[_0x2df6('0x22')](_0x2df6('0x23'),_0x3cee69,_0x2df6('0x24'));logger[_0x2df6('0x25')](_0x2df6('0x26'),_0x3cee69,_0x2df6('0x24'),JSON[_0x2df6('0x27')](_0x568f45));if(_0x568f45['error']){if(_0x568f45[_0x2df6('0x28')][_0x2df6('0x29')]===0x1f4){logger[_0x2df6('0x28')]('SmsMessage,\x20%s,\x20%s',_0x3cee69,_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);return _0x207189(_0x568f45[_0x2df6('0x28')]['message']);}logger[_0x2df6('0x28')](_0x2df6('0x23'),_0x3cee69,_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);return _0x1be726(_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);}else{logger[_0x2df6('0x22')](_0x2df6('0x23'),_0x3cee69,_0x2df6('0x24'));_0x1be726(_0x568f45[_0x2df6('0x2b')][_0x2df6('0x2a')]);}})[_0x2df6('0x2c')](function(_0x5b597f){logger['error'](_0x2df6('0x23'),_0x3cee69,_0x5b597f);_0x207189(_0x5b597f);});});}function respondWithStatusCode(_0x3f3d95,_0x1a017b){_0x1a017b=_0x1a017b||0xcc;return function(_0x50af3b){if(_0x50af3b){return _0x3f3d95[_0x2df6('0x2d')](_0x1a017b);}return _0x3f3d95[_0x2df6('0x2e')](_0x1a017b)['end']();};}function respondWithResult(_0x453549,_0x480735){_0x480735=_0x480735||0xc8;return function(_0x97891b){if(_0x97891b){return _0x453549['status'](_0x480735)[_0x2df6('0x2f')](_0x97891b);}};}function respondWithFilteredResult(_0x5b0a98,_0x6f25e5){return function(_0x432363){if(_0x432363){var _0x32e693=typeof _0x6f25e5[_0x2df6('0x30')]==='undefined'&&typeof _0x6f25e5[_0x2df6('0x31')]==='undefined';var _0x596e08=_0x432363[_0x2df6('0x32')];var _0x10cb77=_0x32e693?0x0:_0x6f25e5[_0x2df6('0x30')];var _0x5e0d31=_0x32e693?_0x432363[_0x2df6('0x32')]:_0x6f25e5[_0x2df6('0x30')]+_0x6f25e5[_0x2df6('0x31')];var _0x3b4727;if(_0x5e0d31>=_0x596e08){_0x5e0d31=_0x596e08;_0x3b4727=0xc8;}else{_0x3b4727=0xce;}_0x5b0a98[_0x2df6('0x2e')](_0x3b4727);return _0x5b0a98[_0x2df6('0x33')](_0x2df6('0x34'),_0x10cb77+'-'+_0x5e0d31+'/'+_0x596e08)['json'](_0x432363);}return null;};}function patchUpdates(_0x240045){return function(_0x391918){try{jsonpatch[_0x2df6('0x35')](_0x391918,_0x240045,!![]);}catch(_0xadb1d9){return BPromise['reject'](_0xadb1d9);}return _0x391918[_0x2df6('0x36')]();};}function saveUpdates(_0x485610,_0x5cb066){return function(_0x38f523){if(_0x38f523){return _0x38f523[_0x2df6('0x37')](_0x485610)[_0x2df6('0x21')](function(_0x880bbe){return _0x880bbe;});}return null;};}function removeEntity(_0x52f913,_0x1f29b1){return function(_0x8cf54b){if(_0x8cf54b){return _0x8cf54b[_0x2df6('0x38')]()[_0x2df6('0x21')](function(){_0x52f913[_0x2df6('0x2e')](0xcc)[_0x2df6('0x39')]();});}};}function handleEntityNotFound(_0x5a2ae5,_0xb50c95){return function(_0xa7f7dd){if(!_0xa7f7dd){_0x5a2ae5['sendStatus'](0x194);}return _0xa7f7dd;};}function handleError(_0x303cc3,_0x3835b3){_0x3835b3=_0x3835b3||0x1f4;return function(_0x2e7b71){logger[_0x2df6('0x28')](_0x2e7b71[_0x2df6('0x3a')]);if(_0x2e7b71[_0x2df6('0x3b')]){delete _0x2e7b71['name'];}_0x303cc3[_0x2df6('0x2e')](_0x3835b3)[_0x2df6('0x3c')](_0x2e7b71);};}exports[_0x2df6('0x3d')]=function(_0x20f627,_0x392d46){var _0x3dabfd={},_0x5f16c3={},_0x53c32d={'count':0x0,'rows':[]};var _0x2334c9=_['map'](db['SmsMessage']['rawAttributes'],function(_0x25163d){return{'name':_0x25163d[_0x2df6('0x3e')],'type':_0x25163d['type'][_0x2df6('0x3f')]};});_0x5f16c3[_0x2df6('0x40')]=_[_0x2df6('0x41')](_0x2334c9,_0x2df6('0x3b'));_0x5f16c3[_0x2df6('0x42')]=_[_0x2df6('0x43')](_0x20f627['query']);_0x5f16c3['filters']=_['intersection'](_0x5f16c3[_0x2df6('0x40')],_0x5f16c3[_0x2df6('0x42')]);_0x3dabfd['attributes']=_[_0x2df6('0x44')](_0x5f16c3[_0x2df6('0x40')],qs[_0x2df6('0x45')](_0x20f627['query'][_0x2df6('0x45')]));_0x3dabfd[_0x2df6('0x46')]=_0x3dabfd[_0x2df6('0x46')][_0x2df6('0x47')]?_0x3dabfd['attributes']:_0x5f16c3[_0x2df6('0x40')];if(!_0x20f627[_0x2df6('0x42')][_0x2df6('0x48')](_0x2df6('0x49'))){_0x3dabfd[_0x2df6('0x31')]=qs['limit'](_0x20f627[_0x2df6('0x42')][_0x2df6('0x31')]);_0x3dabfd[_0x2df6('0x30')]=qs['offset'](_0x20f627[_0x2df6('0x42')][_0x2df6('0x30')]);}_0x3dabfd['order']=qs[_0x2df6('0x4a')](_0x20f627[_0x2df6('0x42')][_0x2df6('0x4a')]);_0x3dabfd[_0x2df6('0x4b')]=qs[_0x2df6('0x4c')](_[_0x2df6('0x4d')](_0x20f627[_0x2df6('0x42')],_0x5f16c3[_0x2df6('0x4c')]),_0x2334c9);if(_0x20f627['query'][_0x2df6('0x4e')]){_0x3dabfd['where']=_['merge'](_0x3dabfd[_0x2df6('0x4b')],{'$or':_[_0x2df6('0x41')](_0x2334c9,function(_0x41ad7f){if(_0x41ad7f[_0x2df6('0x4f')]!==_0x2df6('0x50')){var _0x47d2ef={};_0x47d2ef[_0x41ad7f['name']]={'$like':'%'+_0x20f627[_0x2df6('0x42')]['filter']+'%'};return _0x47d2ef;}})});}_0x3dabfd=_['merge']({},_0x3dabfd,_0x20f627['options']);var _0x20c032={'where':_0x3dabfd[_0x2df6('0x4b')]};return db['SmsMessage'][_0x2df6('0x32')](_0x20c032)[_0x2df6('0x21')](function(_0x5af9f8){_0x53c32d['count']=_0x5af9f8;if(_0x20f627[_0x2df6('0x42')][_0x2df6('0x51')]){_0x3dabfd[_0x2df6('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0x2df6('0x53')](_0x3dabfd);})[_0x2df6('0x21')](function(_0x16bcce){_0x53c32d[_0x2df6('0x54')]=_0x16bcce;return _0x53c32d;})[_0x2df6('0x21')](respondWithFilteredResult(_0x392d46,_0x3dabfd))['catch'](handleError(_0x392d46,null));};exports[_0x2df6('0x55')]=function(_0x5933af,_0x428db0){var _0x192ad7={'raw':!![],'where':{'id':_0x5933af[_0x2df6('0x56')]['id']}},_0xcd49ce={};_0xcd49ce[_0x2df6('0x40')]=_['keys'](db[_0x2df6('0x57')][_0x2df6('0x58')]);_0xcd49ce[_0x2df6('0x42')]=_[_0x2df6('0x43')](_0x5933af['query']);_0xcd49ce['filters']=_[_0x2df6('0x44')](_0xcd49ce[_0x2df6('0x40')],_0xcd49ce[_0x2df6('0x42')]);_0x192ad7[_0x2df6('0x46')]=_[_0x2df6('0x44')](_0xcd49ce['model'],qs['fields'](_0x5933af[_0x2df6('0x42')][_0x2df6('0x45')]));_0x192ad7['attributes']=_0x192ad7['attributes']['length']?_0x192ad7['attributes']:_0xcd49ce['model'];if(_0x5933af[_0x2df6('0x42')]['includeAll']){_0x192ad7[_0x2df6('0x52')]=[{'all':!![]}];}_0x192ad7=_[_0x2df6('0x59')]({},_0x192ad7,_0x5933af[_0x2df6('0x5a')]);return db[_0x2df6('0x57')][_0x2df6('0x5b')](_0x192ad7)[_0x2df6('0x21')](handleEntityNotFound(_0x428db0,null))[_0x2df6('0x21')](respondWithResult(_0x428db0,null))[_0x2df6('0x2c')](handleError(_0x428db0,null));};exports[_0x2df6('0x5c')]=function(_0x5d2f50,_0x1d59c4){return db[_0x2df6('0x57')][_0x2df6('0x5c')](_0x5d2f50[_0x2df6('0x5d')],{})['then'](respondWithResult(_0x1d59c4,0xc9))['catch'](handleError(_0x1d59c4,null));};exports['update']=function(_0x22005b,_0x45a633){if(_0x22005b[_0x2df6('0x5d')]['id']){delete _0x22005b['body']['id'];}return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x22005b[_0x2df6('0x56')]['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x45a633,null))[_0x2df6('0x21')](saveUpdates(_0x22005b[_0x2df6('0x5d')],null))[_0x2df6('0x21')](respondWithResult(_0x45a633,null))[_0x2df6('0x2c')](handleError(_0x45a633,null));};exports[_0x2df6('0x38')]=function(_0x2d67f4,_0x4da05d){return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x2d67f4[_0x2df6('0x56')]['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x4da05d,null))[_0x2df6('0x21')](removeEntity(_0x4da05d,null))['catch'](handleError(_0x4da05d,null));};exports['describe']=function(_0xfcf4d8,_0x326a20){return db[_0x2df6('0x57')][_0x2df6('0x5e')]()[_0x2df6('0x21')](respondWithResult(_0x326a20,null))[_0x2df6('0x2c')](handleError(_0x326a20,null));};var interaction_log=require(_0x2df6('0x14'))(_0x2df6('0x5f'));exports[_0x2df6('0x60')]=function(_0x2a3fb1,_0x387399,_0x3de4fe){var _0x42c4f9={'agent':{},'channel':_0x2df6('0x61')};if(_0x2a3fb1[_0x2df6('0x5d')]['id']){delete _0x2a3fb1[_0x2df6('0x5d')]['id'];}_0x2a3fb1['body'][_0x2df6('0x62')]=!![];_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x63')]=moment()[_0x2df6('0x64')](_0x2df6('0x65'));_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')]=_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')]||_0x2a3fb1[_0x2df6('0x67')]['id'];_0x42c4f9[_0x2df6('0x68')]['id']=_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')];return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x2a3fb1['params']['id'],'UserId':null}})[_0x2df6('0x21')](handleEntityNotFound(_0x387399,null))['then'](saveUpdates(_0x2a3fb1[_0x2df6('0x5d')],null))[_0x2df6('0x21')](function(_0x2b29c7){if(_0x2b29c7){_0x42c4f9[_0x2df6('0x2a')]=_0x2b29c7[_0x2df6('0x69')]({'plain':!![]});return db[_0x2df6('0x6a')][_0x2df6('0x5b')]({'where':{'id':_0x2b29c7[_0x2df6('0x6b')]}});}return null;})[_0x2df6('0x21')](handleEntityNotFound(_0x387399,null))[_0x2df6('0x21')](function(_0xf5aa49){if(_0xf5aa49){return _0xf5aa49['update']({'UserId':_0x2a3fb1['body'][_0x2df6('0x66')],'read1stAt':_[_0x2df6('0x6c')](_0xf5aa49['read1stAt'])?moment()[_0x2df6('0x64')](_0x2df6('0x65')):undefined});}return null;})[_0x2df6('0x21')](function(_0x310015){if(_0x310015){_0x42c4f9[_0x2df6('0x6d')]=_0x310015['get']({'plain':!![]});interaction_log[_0x2df6('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a3fb1[_0x2df6('0x67')]['id'],_0x2a3fb1[_0x2df6('0x67')][_0x2df6('0x3b')],_0x2a3fb1[_0x2df6('0x67')][_0x2df6('0x6e')],_0x42c4f9[_0x2df6('0x6d')]['id'],_0x2a3fb1[_0x2df6('0x5d')]?JSON['stringify'](_0x2a3fb1['body']):'null');return respondWithRpcPromise(_0x2df6('0x6f'),_0x2df6('0x70'),_0x42c4f9);}return null;})['then'](function(_0x47bb6d){var _0x12fee0=_0x2df6('0x71')+_0x47bb6d[_0x2df6('0x2a')][_0x2df6('0x72')];return db[_0x2df6('0x73')][_0x2df6('0x42')](_0x12fee0,{'type':db[_0x2df6('0x74')][_0x2df6('0x75')][_0x2df6('0x76')],'raw':!![]})['then'](function(_0x387b97){return _0x387b97;});})[_0x2df6('0x21')](function(_0x2750f0){if(_0x2750f0){_0x42c4f9[_0x2df6('0x2a')]['contact']=_0x2750f0[0x0];if(!_0x2a3fb1[_0x2df6('0x5d')]['UserId'])return;return db[_0x2df6('0x77')]['find']({'where':{'id':_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')],'role':_0x2df6('0x68')},'attributes':['id',_0x2df6('0x3b'),_0x2df6('0x78'),'email',_0x2df6('0x79')],'raw':!![]});}return null;})['then'](function(_0x36ec0a){if(!_0x36ec0a)return null;_0x42c4f9[_0x2df6('0x2a')]['agent']=_0x36ec0a;return _0x42c4f9;})[_0x2df6('0x21')](function(_0x49a920){if(_0x49a920){if(_0x2a3fb1['body'][_0x2df6('0x7a')]){_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7b')]=util[_0x2df6('0x64')](_0x2df6('0x7c'),_0x2a3fb1['user'][_0x2df6('0x3b')]);_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7d')]=_0x42c4f9[_0x2df6('0x7d')];_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7e')]=_0x42c4f9[_0x2df6('0x7d')];_0x42c4f9['message'][_0x2df6('0x7f')]=_0x2df6('0x60');return respondWithRpcPromise(_0x2df6('0x80'),_0x2df6('0x80'),{'event':'acceptmessage','message':_0x42c4f9[_0x2df6('0x2a')]},client9002)[_0x2df6('0x21')](function(){return _0x42c4f9;});}return _0x42c4f9;}return null;})[_0x2df6('0x21')](respondWithResult(_0x387399,null))['catch'](handleError(_0x387399,null));};var interaction_log=require(_0x2df6('0x14'))('sms-interactions');exports['reject']=function(_0x440df6,_0x2d4ccc,_0x383310){var _0x1bf46f={'agent':{},'channel':_0x2df6('0x61')};if(_0x440df6[_0x2df6('0x5d')]['id']){delete _0x440df6[_0x2df6('0x5d')]['id'];}_0x440df6['body'][_0x2df6('0x66')]=_0x440df6[_0x2df6('0x5d')][_0x2df6('0x66')]||_0x440df6[_0x2df6('0x67')]['id'];_0x1bf46f[_0x2df6('0x68')]['id']=_0x440df6[_0x2df6('0x5d')]['UserId'];return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x440df6[_0x2df6('0x56')]['id'],'UserId':null}})[_0x2df6('0x21')](handleEntityNotFound(_0x2d4ccc,null))[_0x2df6('0x21')](function(_0x5a0b3c){if(_0x5a0b3c){_0x1bf46f[_0x2df6('0x2a')]=_0x5a0b3c['get']({'plain':!![]});return db['SmsInteraction'][_0x2df6('0x5b')]({'where':{'id':_0x5a0b3c['SmsInteractionId']}});}return null;})[_0x2df6('0x21')](handleEntityNotFound(_0x2d4ccc,null))[_0x2df6('0x21')](function(_0x1f50c7){if(_0x1f50c7){_0x1bf46f[_0x2df6('0x6d')]=_0x1f50c7[_0x2df6('0x69')]({'plain':!![]});interaction_log[_0x2df6('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x440df6[_0x2df6('0x67')]['id'],_0x440df6['user']['name'],_0x440df6[_0x2df6('0x67')]['role'],_0x1bf46f[_0x2df6('0x6d')]['id'],_0x440df6['body']?JSON[_0x2df6('0x27')](_0x440df6[_0x2df6('0x5d')]):_0x2df6('0x81'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1bf46f);}return null;})[_0x2df6('0x21')](function(_0x13169f){var _0x366d63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13169f[_0x2df6('0x2a')][_0x2df6('0x72')];return db[_0x2df6('0x73')][_0x2df6('0x42')](_0x366d63,{'type':db[_0x2df6('0x74')][_0x2df6('0x75')][_0x2df6('0x76')],'raw':!![]})[_0x2df6('0x21')](function(_0xe72303){return _0xe72303;});})['then'](function(_0x331ead){if(_0x331ead){_0x1bf46f[_0x2df6('0x2a')][_0x2df6('0x82')]=_0x331ead[0x0];if(!_0x440df6[_0x2df6('0x5d')][_0x2df6('0x66')])return;return db[_0x2df6('0x77')][_0x2df6('0x5b')]({'where':{'id':_0x440df6['body'][_0x2df6('0x66')],'role':'agent'},'attributes':['id',_0x2df6('0x3b'),_0x2df6('0x78'),_0x2df6('0x83'),_0x2df6('0x79')],'raw':!![]});}return null;})[_0x2df6('0x21')](function(_0x36881c){if(!_0x36881c)return null;_0x1bf46f[_0x2df6('0x2a')][_0x2df6('0x68')]=_0x36881c;return _0x1bf46f;})[_0x2df6('0x21')](function(_0xb30064){if(_0xb30064){_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7b')]=util[_0x2df6('0x64')](_0x2df6('0x7c'),_0x440df6[_0x2df6('0x67')][_0x2df6('0x3b')]);_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7d')]=_0x1bf46f[_0x2df6('0x7d')];_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7e')]=_0x1bf46f['channel'];_0xb30064[_0x2df6('0x2a')]['event']=_0x2df6('0x84');respondWithRpcPromise(_0x2df6('0x80'),'EventManager',{'event':'rejectmessage','message':_0xb30064[_0x2df6('0x2a')]},client9002);return _0x1bf46f;}return null;})[_0x2df6('0x21')](respondWithResult(_0x2d4ccc,null))['catch'](handleError(_0x2d4ccc,null));};exports['status']=function(_0x385521,_0x1e116b,_0x2c3dbd){if(_0x385521['body']['id']){delete _0x385521[_0x2df6('0x5d')]['id'];}var _0x481235;return db['SmsMessage'][_0x2df6('0x5b')]({'where':{'id':_0x385521['params']['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x1e116b,null))[_0x2df6('0x21')](function(_0x3dbe98){if(_0x3dbe98){_0x481235=_0x3dbe98;return db[_0x2df6('0x85')][_0x2df6('0x5b')]({'where':{'id':_0x3dbe98[_0x2df6('0x86')]}});}})['then'](handleEntityNotFound(_0x1e116b,null))[_0x2df6('0x21')](function(_0x3f81c4){if(_0x3f81c4){logger[_0x2df6('0x25')](_0x2df6('0x26'),_0x2df6('0x2e'),_0x2df6('0x87'),_0x3f81c4[_0x2df6('0x4f')],util['inspect'](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));switch(_0x3f81c4[_0x2df6('0x4f')]){case _0x2df6('0x88'):if(_0x385521[_0x2df6('0x5d')]['MessageSid']&&_0x385521[_0x2df6('0x5d')][_0x2df6('0x89')]===_0x481235['messageId']){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error'](_0x2df6('0x8a'),_0x2df6('0x2e'),_0x2df6('0x88'),util[_0x2df6('0x8b')](_0x385521['body'],{'showHidden':![],'depth':null}));}break;case _0x2df6('0x8c'):if(_0x385521[_0x2df6('0x5d')][_0x2df6('0x8d')]&&_0x385521['body'][_0x2df6('0x8d')]===_0x481235[_0x2df6('0x8e')]&&_[_0x2df6('0x8f')]([_0x2df6('0x90'),_0x2df6('0x91')],_0x385521[_0x2df6('0x5d')][_0x2df6('0x92')])>=0x0){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error'](_0x2df6('0x8a'),_0x2df6('0x2e'),_0x2df6('0x93'),util[_0x2df6('0x8b')](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x2df6('0x94'):var _0x4688f7=_0x385521['body'][_0x2df6('0x95')][0x0];if(_0x4688f7['status'][_0x2df6('0x96')]===_0x2df6('0x97')){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2df6('0x94'),util[_0x2df6('0x8b')](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x481235;}})[_0x2df6('0x21')](respondWithResult(_0x1e116b,null))[_0x2df6('0x2c')](handleError(_0x1e116b,null));};
\ No newline at end of file
index 415a63c..cc46f97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7da=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3cfe5b,_0x2e919c){var _0x3bdb2a=function(_0x296e62){while(--_0x296e62){_0x3cfe5b['push'](_0x3cfe5b['shift']());}};_0x3bdb2a(++_0x2e919c);}(_0xf7da,0x155));var _0xaf7d=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf7da[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0xaf7d('0x0'));var SmsMessage=require(_0xaf7d('0x1'))['db'][_0xaf7d('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xaf7d('0x3')](0x0);var events={'afterCreate':_0xaf7d('0x4'),'afterUpdate':_0xaf7d('0x5'),'afterDestroy':_0xaf7d('0x6')};function emitEvent(_0xcf83d2){return function(_0x1e4f06,_0x587387,_0x136b89){SmsMessageEvents[_0xaf7d('0x7')](_0xcf83d2+':'+_0x1e4f06['id'],_0x1e4f06);SmsMessageEvents[_0xaf7d('0x7')](_0xcf83d2,_0x1e4f06);_0x136b89(null);};}for(var e in events){if(events[_0xaf7d('0x8')](e)){var event=events[e];SmsMessage[_0xaf7d('0x9')](e,emitEvent(event));}}module[_0xaf7d('0xa')]=SmsMessageEvents;
\ No newline at end of file
+var _0xc984=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x13789a,_0x1de639){var _0x5d9136=function(_0x2277c9){while(--_0x2277c9){_0x13789a['push'](_0x13789a['shift']());}};_0x5d9136(++_0x1de639);}(_0xc984,0x1bb));var _0x4c98=function(_0x23fbd7,_0x209056){_0x23fbd7=_0x23fbd7-0x0;var _0x5ba3a4=_0xc984[_0x23fbd7];return _0x5ba3a4;};'use strict';var EventEmitter=require(_0x4c98('0x0'));var SmsMessage=require(_0x4c98('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4c98('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4c98('0x3')};function emitEvent(_0x38b193){return function(_0x288510,_0x20052e,_0x2d8f1e){SmsMessageEvents[_0x4c98('0x4')](_0x38b193+':'+_0x288510['id'],_0x288510);SmsMessageEvents[_0x4c98('0x4')](_0x38b193,_0x288510);_0x2d8f1e(null);};}for(var e in events){if(events[_0x4c98('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x4c98('0x6')]=SmsMessageEvents;
\ No newline at end of file
index ad7ca53..f461d7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79d8=['secret','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','head','clickSend','plivo','authId','token','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','login','sender','text','keys','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','base64','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out'];(function(_0x5d7990,_0x17786f){var _0xbd01f0=function(_0x1ba6c9){while(--_0x1ba6c9){_0x5d7990['push'](_0x5d7990['shift']());}};_0xbd01f0(++_0x17786f);}(_0x79d8,0x67));var _0x879d=function(_0x5c2be2,_0x50f808){_0x5c2be2=_0x5c2be2-0x0;var _0x1394a3=_0x79d8[_0x5c2be2];return _0x1394a3;};'use strict';var _=require(_0x879d('0x0'));var util=require(_0x879d('0x1'));var logger=require(_0x879d('0x2'))(_0x879d('0x3'));var moment=require('moment');var BPromise=require(_0x879d('0x4'));var rp=require(_0x879d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879d('0x6'));var config=require(_0x879d('0x7'));var attributes=require(_0x879d('0x8'));module['exports']=function(_0x2d578e,_0x46ed21){return _0x2d578e[_0x879d('0x9')](_0x879d('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x879d('0xb'),'fields':[_0x879d('0xb')]},{'name':_0x879d('0xc'),'fields':[_0x879d('0xd')],'type':_0x879d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d0900,_0x1cc5bf,_0x4920b5){var _0x5d93f2=_0x2d578e[_0x879d('0xf')];var _0x35bbff=_0x5d0900[_0x879d('0x10')]({'plain':!![]});if(_0x35bbff['direction'][_0x879d('0x11')]()==='in'||_0x35bbff[_0x879d('0x12')]['toLowerCase']()===_0x879d('0x13')&&!_0x35bbff[_0x879d('0x14')]&&!_['isNil'](_0x35bbff[_0x879d('0x15')])){_0x5d93f2['SmsInteraction'][_0x879d('0x16')]({'where':{'id':_0x35bbff[_0x879d('0x17')]}})[_0x879d('0x18')](function(_0x24e775){if(_0x24e775){_0x24e775[_0x879d('0x19')]({'lastMsgAt':_0x35bbff[_0x879d('0x1a')],'lastMsgDirection':_0x35bbff['direction']['toLowerCase']()});}})[_0x879d('0x1b')](function(_0x175dfe){console['error'](_0x175dfe);});}if(_0x35bbff['direction']===_0x879d('0x13')&&!_0x35bbff[_0x879d('0x14')]){var _0x3a7259;_0x5d93f2[_0x879d('0x1c')][_0x879d('0x1d')]({'where':{'id':_0x35bbff[_0x879d('0x1e')]},'raw':!![]})[_0x879d('0x18')](function(_0x50539d){_0x3a7259=_0x50539d;if(_0x3a7259&&_0x3a7259['type']){switch(_0x3a7259[_0x879d('0x1f')]){case'twilio':var _0x16e170=require('twilio');if(_0x3a7259[_0x879d('0x20')]&&_0x3a7259[_0x879d('0x21')]&&_0x3a7259[_0x879d('0x22')]){var _0x2dba72=new _0x16e170(_0x3a7259[_0x879d('0x20')],_0x3a7259[_0x879d('0x21')]);_0x2dba72[_0x879d('0x23')]['create']({'body':_0x35bbff[_0x879d('0xd')],'to':_0x35bbff[_0x879d('0x22')],'from':_0x3a7259[_0x879d('0x22')],'statusCallback':_0x3a7259[_0x879d('0x24')]+_0x879d('0x25')+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259['token']})[_0x879d('0x18')](function(_0x4a0559){if(_0x4a0559[_0x879d('0x27')]){return _0x5d0900[_0x879d('0x19')]({'messageId':_0x4a0559[_0x879d('0x27')]});}})['catch'](function(_0x39d838){logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x2b'),util['inspect'](_0x39d838,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),_0x879d('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x879d('0x2c'):var _0x1b3b96=_0x879d('0x2d');if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x481e90={'recipient':[_0x35bbff['phone']],'message':_0x35bbff[_0x879d('0xd')],'message_type':_0x3a7259[_0x879d('0x30')]};if(_0x3a7259[_0x879d('0x30')]&&_0x3a7259[_0x879d('0x30')]!=='SI'){_0x481e90['sender']=_0x3a7259[_0x879d('0x22')];}var _0xe8c394={'url':_0x1b3b96+_0x879d('0x31')+_0x3a7259['username']+_0x879d('0x32')+_0x3a7259[_0x879d('0x2f')],'method':_0x879d('0x33')};rp(_0xe8c394)['then'](function(_0x1a1230){var _0x215f2a=_0x1a1230[_0x879d('0x34')](';');var _0x8430c1={'user_key':_0x215f2a[0x0],'session_key':_0x215f2a[0x1]};_0xe8c394={'url':_0x1b3b96+_0x879d('0x35'),'method':_0x879d('0x36'),'headers':{'user_key':_0x8430c1[_0x879d('0x37')],'Session_key':_0x8430c1[_0x879d('0x38')]},'json':!![],'body':_0x481e90};return rp(_0xe8c394);})[_0x879d('0x18')](function(_0x284881){if(_0x284881[_0x879d('0x39')]>=0x1){var _0x3eee95={'messageId':_0x284881[_0x879d('0x3a')]};if(_0x3a7259[_0x879d('0x30')]!=='GP'||!_0x3a7259['deliveryReport']){_0x3eee95[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x3eee95);}else{return logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x2c'),util['inspect'](_0x284881,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x1f867d){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x2c'),util[_0x879d('0x3c')](_0x1f867d,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x2c'),_0x879d('0x3d'));}break;case _0x879d('0x3e'):if(_0x3a7259[_0x879d('0x21')]){var _0x4a006e={'recipient':_0x35bbff[_0x879d('0x22')],'message':_0x35bbff[_0x879d('0xd')],'sender':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')],'authorization':_0x3a7259['authToken']};var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x40'),'body':_0x4a006e,'json':!![]};rp(_0x1cc5bf)['then'](function(_0x422d98){var _0x50f255={'messageId':_0x422d98['requestid']};if(!_0x3a7259[_0x879d('0x41')]){_0x50f255['read']=!![];}return _0x5d0900[_0x879d('0x19')](_0x50f255);})[_0x879d('0x1b')](function(_0x29b88a){logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x3e'),util[_0x879d('0x3c')](_0x29b88a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),'afterCreate',_0x879d('0x3e'),_0x879d('0x42'));}break;case _0x879d('0x43'):if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x4a006e={'messages':[{'source':_0x879d('0x44'),'to':_0x35bbff['phone'],'body':_0x35bbff[_0x879d('0xd')],'from':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')]}]};var _0x227377=util[_0x879d('0x45')](_0x879d('0x46'),_0x3a7259[_0x879d('0x2e')],_0x3a7259['password']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x47'),'body':_0x4a006e,'headers':{'Authorization':util[_0x879d('0x45')](_0x879d('0x48'),new Buffer(_0x227377)[_0x879d('0x49')]('base64'))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x2fccc5){if(_0x2fccc5[_0x879d('0x4a')]>=0xc8&&_0x2fccc5[_0x879d('0x4a')]<=0xce){if(_0x2fccc5[_0x879d('0x4b')]&&_0x2fccc5[_0x879d('0x4b')]['queued_count']>0x0){var _0x2d6480=_[_0x879d('0x4c')](_0x2fccc5['data'][_0x879d('0x23')]);var _0x5563e9={'messageId':_0x2d6480['message_id']};if(!_0x3a7259[_0x879d('0x41')]){_0x5563e9[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x5563e9);}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x4d'),util['inspect'](_0x2fccc5,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x4d'),util[_0x879d('0x3c')](_0x2fccc5,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x75ce30){logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'clickSend',util[_0x879d('0x3c')](_0x75ce30,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x4d'),_0x879d('0x3d'));}break;case _0x879d('0x4e'):if(_0x3a7259[_0x879d('0x4f')]&&_0x3a7259[_0x879d('0x21')]){var _0x4a006e={'dst':_0x35bbff['phone'],'text':_0x35bbff[_0x879d('0xd')],'src':_0x3a7259[_0x879d('0x3f')]||_0x3a7259[_0x879d('0x22')],'url':_0x3a7259[_0x879d('0x24')]+_0x879d('0x25')+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259[_0x879d('0x50')]};var _0x227377=util['format'](_0x879d('0x46'),_0x3a7259[_0x879d('0x4f')],_0x3a7259['authToken']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':util[_0x879d('0x45')](_0x879d('0x51'),_0x3a7259['authId']),'body':_0x4a006e,'headers':{'Authorization':util['format'](_0x879d('0x48'),new Buffer(_0x227377)['toString']('base64'))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x2acc3c){var _0x1743a5={'messageId':_0x2acc3c['message_uuid'][0x0]};return _0x5d0900[_0x879d('0x19')](_0x1743a5);})[_0x879d('0x1b')](function(_0x484116){logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x4e'),util['inspect'](_0x484116,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'plivo',_0x879d('0x52'));}break;case _0x879d('0x53'):if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){if(_0x3a7259[_0x879d('0x54')]){var _0x3d28f2={'method':'POST','uri':_0x3a7259[_0x879d('0x54')]+_0x879d('0x55'),'body':{'username':_0x3a7259[_0x879d('0x2e')],'password':_0x3a7259[_0x879d('0x2f')]},'json':!![]};return rp(_0x3d28f2)['then'](function(_0x24d834){var _0x161c62={'method':'POST','uri':_0x3a7259[_0x879d('0x54')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3a7259[_0x879d('0x22')],'destinations':[{'to':_0x35bbff[_0x879d('0x22')]}],'text':_0x35bbff[_0x879d('0xd')],'notifyUrl':_0x3a7259[_0x879d('0x24')]+'/api/sms/messages/'+_0x35bbff['id']+_0x879d('0x26')+_0x3a7259['token'],'notifyContentType':_0x879d('0x56'),'callbackData':_0x3a7259[_0x879d('0x22')]+';'+_0x35bbff['body']}]},'headers':{'Authorization':_0x879d('0x57')+_0x24d834['token']},'json':!![]};return rp(_0x161c62)[_0x879d('0x18')](function(_0xa97563){if(_0xa97563['messages']){var _0x57f5f5={'messageId':_0xa97563[_0x879d('0x23')][0x0][_0x879d('0xb')]};if(!_0x3a7259[_0x879d('0x41')]){_0x57f5f5[_0x879d('0x3b')]=!![];}return _0x5d0900['update'](_0x57f5f5);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),_0x879d('0x53'),util[_0x879d('0x3c')](_0xa97563,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x225239){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate',_0x879d('0x53'),util[_0x879d('0x3c')](_0x225239,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'infobip',_0x879d('0x58'));}}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x53'),_0x879d('0x3d'));}break;case'csc':var _0x4c2d9a=require(_0x879d('0x59'));if(_0x3a7259['apiKey']){var _0x5cc25a={};_0x5cc25a[_0x879d('0x5a')]=_0x3a7259[_0x879d('0x2e')];_0x5cc25a[_0x879d('0x22')]=_0x35bbff[_0x879d('0x22')];_0x5cc25a[_0x879d('0x5b')]=_0x3a7259['phone'];_0x5cc25a[_0x879d('0x5c')]=_0x35bbff[_0x879d('0xd')];_0x5cc25a['timestamp']=+new Date();var _0x519b73='';var _0x43483f='';var _0x5296ea=Object[_0x879d('0x5d')](_0x5cc25a);_0x5296ea['sort']();for(var _0x1678f2=0x0;_0x1678f2<_0x5296ea[_0x879d('0x5e')];_0x1678f2++){if(_0x519b73!=''){_0x519b73+='&';}_0x519b73+=_0x5296ea[_0x1678f2]+'='+encodeURIComponent(_0x5cc25a[_0x5296ea[_0x1678f2]]);_0x43483f+=_0x5cc25a[_0x5296ea[_0x1678f2]];}_0x43483f+=_0x3a7259[_0x879d('0x5f')];_0x43483f=_0x4c2d9a[_0x879d('0x60')](_0x879d('0x61'))[_0x879d('0x19')](_0x43483f)[_0x879d('0x62')](_0x879d('0x63'));if(_0x519b73!==''){_0x519b73+='&';}_0x519b73+=_0x879d('0x64')+_0x43483f;var _0xe8c394={'method':_0x879d('0x33'),'uri':_0x3a7259['baseUrl']+_0x879d('0x65')+_0x519b73,'json':!![]};return rp(_0xe8c394)[_0x879d('0x18')](function(_0x40d1e7){var _0x1dc3a9=Object[_0x879d('0x5d')](_0x40d1e7);if(_0x40d1e7[_0x1dc3a9[0x0]]['error']&&parseInt(_0x40d1e7[_0x1dc3a9[0x0]]['error'])===0x0){var _0x11f9da={'messageId':_0x40d1e7[_0x1dc3a9[0x0]]['id_sms']};if(!_0x3a7259[_0x879d('0x41')]){_0x11f9da['read']=!![];}return _0x5d0900[_0x879d('0x19')](_0x11f9da);}else{return logger[_0x879d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'csc',util[_0x879d('0x3c')](_0x40d1e7['error'],{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x2f5d22){return logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),'csc',util['inspect'](_0x2f5d22,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x66'),_0x879d('0x67'));}break;case _0x879d('0x68'):if(_0x3a7259[_0x879d('0x5f')]){var _0x3a711a={'method':_0x879d('0x36'),'uri':_0x879d('0x69'),'headers':{'Authorization':_0x3a7259[_0x879d('0x5f')]},'body':{'content':_0x35bbff[_0x879d('0xd')],'to':[_0x35bbff[_0x879d('0x22')]],'from':_0x3a7259[_0x879d('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x3a711a)[_0x879d('0x18')](function(_0x2f74d7){if(!_0x2f74d7[_0x879d('0x28')]){var _0x26b8d9={'messageId':_0x2f74d7['messages'][0x0][_0x879d('0x6a')]};if(!_0x3a7259[_0x879d('0x41')]){_0x26b8d9[_0x879d('0x3b')]=!![];}return _0x5d0900[_0x879d('0x19')](_0x26b8d9);}else{return logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x68'),util[_0x879d('0x3c')](_0x2f74d7['error'],{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x1844d3){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x879d('0x2a'),'clickatell',util[_0x879d('0x3c')](_0x1844d3,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x68'),_0x879d('0x67'));}break;case'bandwidth':if(_0x3a7259[_0x879d('0x2e')]&&_0x3a7259[_0x879d('0x2f')]){var _0x227377=util[_0x879d('0x45')]('%s:%s',_0x3a7259['username'],_0x3a7259['password']);var _0x1cc5bf={'method':_0x879d('0x36'),'uri':_0x879d('0x6b')+_0x3a7259[_0x879d('0x6c')]+'/messages','body':{'to':[_0x35bbff['phone']],'text':_0x35bbff[_0x879d('0xd')],'from':_0x3a7259[_0x879d('0x22')],'applicationId':_0x3a7259[_0x879d('0x6d')]},'headers':{'Authorization':util[_0x879d('0x45')](_0x879d('0x48'),new Buffer(_0x227377)[_0x879d('0x49')](_0x879d('0x6e')))},'json':!![]};rp(_0x1cc5bf)[_0x879d('0x18')](function(_0x81642e){if(_0x81642e['id']){var _0x3f3277={'messageId':_0x81642e['id']};return _0x5d0900[_0x879d('0x19')](_0x3f3277);}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x6f'),util[_0x879d('0x3c')](_0x81642e,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x4f0bcf){logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate','bandwidth',util[_0x879d('0x3c')](_0x4f0bcf,{'showHidden':![],'depth':null}));});}else{logger[_0x879d('0x28')](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x6f'),_0x879d('0x3d'));}break;case _0x879d('0x70'):if(_0x3a7259[_0x879d('0x5f')]){var _0x156b59={};var _0xe8c394={'method':'POST','uri':_0x879d('0x71'),'headers':{'Authorization':_0x879d('0x72')+_0x3a7259[_0x879d('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x3a7259[_0x879d('0x22')],'to':_0x35bbff[_0x879d('0x22')],'text':_0x35bbff[_0x879d('0xd')]},'json':!![]};return rp(_0xe8c394)[_0x879d('0x18')](function(_0x61471){if(_0x61471[_0x879d('0x73')]==0xca){_0x156b59['message']=_0x61471;var _0x38b13a={'method':_0x879d('0x36'),'uri':_0x879d('0x74'),'headers':{'Authorization':_0x879d('0x72')+_0x3a7259[_0x879d('0x5f')],'Content-Type':_0x879d('0x56')},'body':{'refid':_0x156b59[_0x879d('0x75')][_0x879d('0x76')]},'json':!![]};return rp(_0x38b13a)[_0x879d('0x18')](function(_0xa548ac){_0x156b59['status']=_0xa548ac;var _0x266859={'messageId':_0x156b59[_0x879d('0x75')][_0x879d('0x76')],'read':!![]};return _0x5d0900[_0x879d('0x19')](_0x266859);});}else{return logger['error'](_0x879d('0x29'),_0x879d('0x2a'),_0x879d('0x70'),util[_0x879d('0x3c')](_0x61471,{'showHidden':![],'depth':null}));}})[_0x879d('0x1b')](function(_0x111c78){return logger[_0x879d('0x28')](_0x879d('0x29'),'afterCreate','intelepeer',util[_0x879d('0x3c')](_0x111c78,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x879d('0x70'),_0x879d('0x77'));}break;}}})[_0x879d('0x78')](function(){_0x4920b5();});}else{_0x4920b5();}}},'charset':_0x879d('0x79'),'collate':_0x879d('0x7a')});};
\ No newline at end of file
+var _0xfdb5=['http_code','data','queued_count','head','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','token','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','length','md5','digest','hex','/external/get/send.php?','id_sms','clickatell','uuid','UTF-8','Missing\x20parameters:\x20apiKey','accountId','/messages','base64','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','SmsAccount','SmsAccountId','then','type','twilio','phone','accountSid','messages','create','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','authToken','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','format','Basic\x20%s','toString'];(function(_0x2f6233,_0x90172){var _0x1c9c36=function(_0x3ac680){while(--_0x3ac680){_0x2f6233['push'](_0x2f6233['shift']());}};_0x1c9c36(++_0x90172);}(_0xfdb5,0x12f));var _0x5fdb=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xfdb5[_0x476bf4];return _0x788ffe;};'use strict';var _=require(_0x5fdb('0x0'));var util=require(_0x5fdb('0x1'));var logger=require(_0x5fdb('0x2'))('api');var moment=require(_0x5fdb('0x3'));var BPromise=require(_0x5fdb('0x4'));var rp=require(_0x5fdb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5fdb('0x6'));var attributes=require('./smsMessage.attributes');module[_0x5fdb('0x7')]=function(_0x4a2149,_0x1b0148){return _0x4a2149[_0x5fdb('0x8')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x5fdb('0x9')]},{'name':_0x5fdb('0xa'),'fields':[_0x5fdb('0xb')],'type':_0x5fdb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4034fd,_0x879edf,_0x23a66a){var _0x5259e7=_0x4a2149[_0x5fdb('0xd')];var _0x579419=_0x4034fd[_0x5fdb('0xe')]({'plain':!![]});if(_0x579419[_0x5fdb('0xf')][_0x5fdb('0x10')]()==='in'||_0x579419['direction'][_0x5fdb('0x10')]()==='out'&&!_0x579419[_0x5fdb('0x11')]&&!_[_0x5fdb('0x12')](_0x579419['UserId'])){_0x5259e7[_0x5fdb('0x13')][_0x5fdb('0x14')]({'where':{'id':_0x579419[_0x5fdb('0x15')]}})['then'](function(_0x3d15a2){if(_0x3d15a2){_0x3d15a2[_0x5fdb('0x16')]({'lastMsgAt':_0x579419[_0x5fdb('0x17')],'lastMsgDirection':_0x579419[_0x5fdb('0xf')][_0x5fdb('0x10')]()});}})[_0x5fdb('0x18')](function(_0x58ae27){console['error'](_0x58ae27);});}if(_0x579419[_0x5fdb('0xf')]==='out'&&!_0x579419[_0x5fdb('0x11')]){var _0x148223;_0x5259e7[_0x5fdb('0x19')]['find']({'where':{'id':_0x579419[_0x5fdb('0x1a')]},'raw':!![]})[_0x5fdb('0x1b')](function(_0xf27e5d){_0x148223=_0xf27e5d;if(_0x148223&&_0x148223[_0x5fdb('0x1c')]){switch(_0x148223[_0x5fdb('0x1c')]){case _0x5fdb('0x1d'):var _0x4d5683=require(_0x5fdb('0x1d'));if(_0x148223['accountSid']&&_0x148223['authToken']&&_0x148223[_0x5fdb('0x1e')]){var _0x2ab3a4=new _0x4d5683(_0x148223[_0x5fdb('0x1f')],_0x148223['authToken']);_0x2ab3a4[_0x5fdb('0x20')][_0x5fdb('0x21')]({'body':_0x579419['body'],'to':_0x579419[_0x5fdb('0x1e')],'from':_0x148223[_0x5fdb('0x1e')],'statusCallback':_0x148223['remote']+'/api/sms/messages/'+_0x579419['id']+'/status?token='+_0x148223['token']})[_0x5fdb('0x1b')](function(_0x573132){if(_0x573132['sid']){return _0x4034fd[_0x5fdb('0x16')]({'messageId':_0x573132[_0x5fdb('0x22')]});}})[_0x5fdb('0x18')](function(_0x49e795){logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x1d'),util['inspect'](_0x49e795,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5fdb('0x25'),_0x5fdb('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x5fdb('0x26'):var _0x55ad0c=_0x5fdb('0x27');if(_0x148223[_0x5fdb('0x28')]&&_0x148223['password']){var _0x57e93a={'recipient':[_0x579419[_0x5fdb('0x1e')]],'message':_0x579419[_0x5fdb('0xb')],'message_type':_0x148223[_0x5fdb('0x29')]};if(_0x148223[_0x5fdb('0x29')]&&_0x148223[_0x5fdb('0x29')]!=='SI'){_0x57e93a['sender']=_0x148223['phone'];}var _0x100954={'url':_0x55ad0c+_0x5fdb('0x2a')+_0x148223[_0x5fdb('0x28')]+_0x5fdb('0x2b')+_0x148223[_0x5fdb('0x2c')],'method':_0x5fdb('0x2d')};rp(_0x100954)[_0x5fdb('0x1b')](function(_0x3f10fc){var _0xe2cebc=_0x3f10fc[_0x5fdb('0x2e')](';');var _0x185bfa={'user_key':_0xe2cebc[0x0],'session_key':_0xe2cebc[0x1]};_0x100954={'url':_0x55ad0c+_0x5fdb('0x2f'),'method':_0x5fdb('0x30'),'headers':{'user_key':_0x185bfa[_0x5fdb('0x31')],'Session_key':_0x185bfa[_0x5fdb('0x32')]},'json':!![],'body':_0x57e93a};return rp(_0x100954);})['then'](function(_0x40408d){if(_0x40408d[_0x5fdb('0x33')]>=0x1){var _0x2464ee={'messageId':_0x40408d[_0x5fdb('0x34')]};if(_0x148223[_0x5fdb('0x29')]!=='GP'||!_0x148223[_0x5fdb('0x35')]){_0x2464ee[_0x5fdb('0x36')]=!![];}return _0x4034fd[_0x5fdb('0x16')](_0x2464ee);}else{return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),'afterCreate',_0x5fdb('0x26'),util[_0x5fdb('0x37')](_0x40408d,{'showHidden':![],'depth':null}));}})[_0x5fdb('0x18')](function(_0x3078f0){return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),'afterCreate','skebby',util[_0x5fdb('0x37')](_0x3078f0,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x26'),_0x5fdb('0x38'));}break;case _0x5fdb('0x39'):if(_0x148223['authToken']){var _0x3263d0={'recipient':_0x579419[_0x5fdb('0x1e')],'message':_0x579419[_0x5fdb('0xb')],'sender':_0x148223[_0x5fdb('0x3a')]||_0x148223[_0x5fdb('0x1e')],'authorization':_0x148223[_0x5fdb('0x3b')]};var _0x879edf={'method':_0x5fdb('0x30'),'uri':_0x5fdb('0x3c'),'body':_0x3263d0,'json':!![]};rp(_0x879edf)['then'](function(_0x594619){var _0x537c74={'messageId':_0x594619[_0x5fdb('0x3d')]};if(!_0x148223['deliveryReport']){_0x537c74[_0x5fdb('0x36')]=!![];}return _0x4034fd[_0x5fdb('0x16')](_0x537c74);})[_0x5fdb('0x18')](function(_0x3eef4e){logger['error'](_0x5fdb('0x24'),'afterCreate',_0x5fdb('0x39'),util['inspect'](_0x3eef4e,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x39'),_0x5fdb('0x3e'));}break;case'clicksend':if(_0x148223[_0x5fdb('0x28')]&&_0x148223[_0x5fdb('0x2c')]){var _0x3263d0={'messages':[{'source':'xCALLY\x20Motion','to':_0x579419['phone'],'body':_0x579419[_0x5fdb('0xb')],'from':_0x148223[_0x5fdb('0x3a')]||_0x148223['phone']}]};var _0x289c58=util[_0x5fdb('0x3f')]('%s:%s',_0x148223['username'],_0x148223['password']);var _0x879edf={'method':_0x5fdb('0x30'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x3263d0,'headers':{'Authorization':util[_0x5fdb('0x3f')](_0x5fdb('0x40'),new Buffer(_0x289c58)[_0x5fdb('0x41')]('base64'))},'json':!![]};rp(_0x879edf)[_0x5fdb('0x1b')](function(_0x296552){if(_0x296552[_0x5fdb('0x42')]>=0xc8&&_0x296552['http_code']<=0xce){if(_0x296552[_0x5fdb('0x43')]&&_0x296552[_0x5fdb('0x43')][_0x5fdb('0x44')]>0x0){var _0x441898=_[_0x5fdb('0x45')](_0x296552[_0x5fdb('0x43')]['messages']);var _0x15b6aa={'messageId':_0x441898[_0x5fdb('0x46')]};if(!_0x148223[_0x5fdb('0x35')]){_0x15b6aa[_0x5fdb('0x36')]=!![];}return _0x4034fd['update'](_0x15b6aa);}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),'afterCreate',_0x5fdb('0x47'),util['inspect'](_0x296552,{'showHidden':![],'depth':null}));}}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x47'),util[_0x5fdb('0x37')](_0x296552,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2076a4){logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x47'),util['inspect'](_0x2076a4,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x47'),_0x5fdb('0x38'));}break;case _0x5fdb('0x48'):if(_0x148223[_0x5fdb('0x49')]&&_0x148223[_0x5fdb('0x3b')]){var _0x3263d0={'dst':_0x579419[_0x5fdb('0x1e')],'text':_0x579419['body'],'src':_0x148223[_0x5fdb('0x3a')]||_0x148223[_0x5fdb('0x1e')],'url':_0x148223[_0x5fdb('0x4a')]+_0x5fdb('0x4b')+_0x579419['id']+'/status?token='+_0x148223[_0x5fdb('0x4c')]};var _0x289c58=util[_0x5fdb('0x3f')](_0x5fdb('0x4d'),_0x148223[_0x5fdb('0x49')],_0x148223[_0x5fdb('0x3b')]);var _0x879edf={'method':'POST','uri':util[_0x5fdb('0x3f')](_0x5fdb('0x4e'),_0x148223[_0x5fdb('0x49')]),'body':_0x3263d0,'headers':{'Authorization':util[_0x5fdb('0x3f')](_0x5fdb('0x40'),new Buffer(_0x289c58)['toString']('base64'))},'json':!![]};rp(_0x879edf)[_0x5fdb('0x1b')](function(_0x5b0c0b){var _0x3a4621={'messageId':_0x5b0c0b[_0x5fdb('0x4f')][0x0]};return _0x4034fd[_0x5fdb('0x16')](_0x3a4621);})[_0x5fdb('0x18')](function(_0x29d96d){logger['error'](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x48'),util[_0x5fdb('0x37')](_0x29d96d,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),'plivo',_0x5fdb('0x50'));}break;case _0x5fdb('0x51'):if(_0x148223[_0x5fdb('0x28')]&&_0x148223['password']){if(_0x148223[_0x5fdb('0x52')]){var _0x5bd090={'method':_0x5fdb('0x30'),'uri':_0x148223[_0x5fdb('0x52')]+_0x5fdb('0x53'),'body':{'username':_0x148223['username'],'password':_0x148223['password']},'json':!![]};return rp(_0x5bd090)[_0x5fdb('0x1b')](function(_0x5c978c){var _0x3d56f1={'method':_0x5fdb('0x30'),'uri':_0x148223[_0x5fdb('0x52')]+_0x5fdb('0x54'),'body':{'messages':[{'from':_0x148223[_0x5fdb('0x1e')],'destinations':[{'to':_0x579419[_0x5fdb('0x1e')]}],'text':_0x579419[_0x5fdb('0xb')],'notifyUrl':_0x148223[_0x5fdb('0x4a')]+_0x5fdb('0x4b')+_0x579419['id']+'/status?token='+_0x148223[_0x5fdb('0x4c')],'notifyContentType':_0x5fdb('0x55'),'callbackData':_0x148223['phone']+';'+_0x579419['body']}]},'headers':{'Authorization':_0x5fdb('0x56')+_0x5c978c['token']},'json':!![]};return rp(_0x3d56f1)[_0x5fdb('0x1b')](function(_0x131990){if(_0x131990['messages']){var _0x52f781={'messageId':_0x131990[_0x5fdb('0x20')][0x0]['messageId']};if(!_0x148223['deliveryReport']){_0x52f781[_0x5fdb('0x36')]=!![];}return _0x4034fd[_0x5fdb('0x16')](_0x52f781);}else{return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x51'),util[_0x5fdb('0x37')](_0x131990,{'showHidden':![],'depth':null}));}});})[_0x5fdb('0x18')](function(_0x1902e7){return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),'infobip',util[_0x5fdb('0x37')](_0x1902e7,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),'infobip',_0x5fdb('0x57'));}}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x51'),_0x5fdb('0x38'));}break;case _0x5fdb('0x58'):var _0x1d6731=require(_0x5fdb('0x59'));if(_0x148223[_0x5fdb('0x5a')]){var _0x1a9274={};_0x1a9274[_0x5fdb('0x5b')]=_0x148223[_0x5fdb('0x28')];_0x1a9274[_0x5fdb('0x1e')]=_0x579419[_0x5fdb('0x1e')];_0x1a9274[_0x5fdb('0x5c')]=_0x148223[_0x5fdb('0x1e')];_0x1a9274[_0x5fdb('0x5d')]=_0x579419[_0x5fdb('0xb')];_0x1a9274[_0x5fdb('0x5e')]=+new Date();var _0xb20ee4='';var _0x3332a0='';var _0x516b6e=Object[_0x5fdb('0x5f')](_0x1a9274);_0x516b6e[_0x5fdb('0x60')]();for(var _0x17566d=0x0;_0x17566d<_0x516b6e[_0x5fdb('0x61')];_0x17566d++){if(_0xb20ee4!=''){_0xb20ee4+='&';}_0xb20ee4+=_0x516b6e[_0x17566d]+'='+encodeURIComponent(_0x1a9274[_0x516b6e[_0x17566d]]);_0x3332a0+=_0x1a9274[_0x516b6e[_0x17566d]];}_0x3332a0+=_0x148223[_0x5fdb('0x5a')];_0x3332a0=_0x1d6731['createHash'](_0x5fdb('0x62'))[_0x5fdb('0x16')](_0x3332a0)[_0x5fdb('0x63')](_0x5fdb('0x64'));if(_0xb20ee4!==''){_0xb20ee4+='&';}_0xb20ee4+='signature='+_0x3332a0;var _0x100954={'method':_0x5fdb('0x2d'),'uri':_0x148223[_0x5fdb('0x52')]+_0x5fdb('0x65')+_0xb20ee4,'json':!![]};return rp(_0x100954)[_0x5fdb('0x1b')](function(_0x858a22){var _0x4b9f88=Object['keys'](_0x858a22);if(_0x858a22[_0x4b9f88[0x0]][_0x5fdb('0x23')]&&parseInt(_0x858a22[_0x4b9f88[0x0]][_0x5fdb('0x23')])===0x0){var _0x4fd2f2={'messageId':_0x858a22[_0x4b9f88[0x0]][_0x5fdb('0x66')]};if(!_0x148223['deliveryReport']){_0x4fd2f2['read']=!![];}return _0x4034fd[_0x5fdb('0x16')](_0x4fd2f2);}else{return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x58'),util[_0x5fdb('0x37')](_0x858a22[_0x5fdb('0x23')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2bc17f){return logger['error'](_0x5fdb('0x24'),_0x5fdb('0x25'),'csc',util['inspect'](_0x2bc17f,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x58'),'Missing\x20parameters:\x20apiKey');}break;case _0x5fdb('0x67'):if(_0x148223[_0x5fdb('0x5a')]){var _0x2f81d0={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x148223[_0x5fdb('0x5a')]},'body':{'content':_0x579419[_0x5fdb('0xb')],'to':[_0x579419['phone']],'from':_0x148223['phone'],'binary':![],'clientMessageId':_0x5fdb('0x68'),'charset':_0x5fdb('0x69')},'json':!![]};rp(_0x2f81d0)['then'](function(_0x17e39f){if(!_0x17e39f[_0x5fdb('0x23')]){var _0x228dca={'messageId':_0x17e39f['messages'][0x0]['apiMessageId']};if(!_0x148223['deliveryReport']){_0x228dca[_0x5fdb('0x36')]=!![];}return _0x4034fd[_0x5fdb('0x16')](_0x228dca);}else{return logger[_0x5fdb('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5fdb('0x25'),'clickatell',util[_0x5fdb('0x37')](_0x17e39f[_0x5fdb('0x23')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2efd69){return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x67'),util[_0x5fdb('0x37')](_0x2efd69,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),'clickatell',_0x5fdb('0x6a'));}break;case'bandwidth':if(_0x148223[_0x5fdb('0x28')]&&_0x148223['password']){var _0x289c58=util[_0x5fdb('0x3f')](_0x5fdb('0x4d'),_0x148223[_0x5fdb('0x28')],_0x148223[_0x5fdb('0x2c')]);var _0x879edf={'method':_0x5fdb('0x30'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x148223[_0x5fdb('0x6b')]+_0x5fdb('0x6c'),'body':{'to':[_0x579419['phone']],'text':_0x579419[_0x5fdb('0xb')],'from':_0x148223[_0x5fdb('0x1e')],'applicationId':_0x148223['applicationId']},'headers':{'Authorization':util[_0x5fdb('0x3f')](_0x5fdb('0x40'),new Buffer(_0x289c58)[_0x5fdb('0x41')](_0x5fdb('0x6d')))},'json':!![]};rp(_0x879edf)['then'](function(_0x382a7d){if(_0x382a7d['id']){var _0x5ce2b6={'messageId':_0x382a7d['id']};return _0x4034fd['update'](_0x5ce2b6);}else{logger['error'](_0x5fdb('0x24'),_0x5fdb('0x25'),'bandwidth',util[_0x5fdb('0x37')](_0x382a7d,{'showHidden':![],'depth':null}));}})[_0x5fdb('0x18')](function(_0xae4b3){logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x6e'),util[_0x5fdb('0x37')](_0xae4b3,{'showHidden':![],'depth':null}));});}else{logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x148223[_0x5fdb('0x5a')]){var _0x590086={};var _0x100954={'method':'POST','uri':_0x5fdb('0x6f'),'headers':{'Authorization':_0x5fdb('0x70')+_0x148223['apiKey'],'Content-Type':_0x5fdb('0x55')},'body':{'from':_0x148223[_0x5fdb('0x1e')],'to':_0x579419[_0x5fdb('0x1e')],'text':_0x579419[_0x5fdb('0xb')]},'json':!![]};return rp(_0x100954)['then'](function(_0x49de47){if(_0x49de47[_0x5fdb('0x71')]==0xca){_0x590086[_0x5fdb('0x72')]=_0x49de47;var _0x5ed306={'method':_0x5fdb('0x30'),'uri':_0x5fdb('0x73'),'headers':{'Authorization':_0x5fdb('0x70')+_0x148223['apiKey'],'Content-Type':_0x5fdb('0x55')},'body':{'refid':_0x590086[_0x5fdb('0x72')]['refid']},'json':!![]};return rp(_0x5ed306)['then'](function(_0x30e0d1){_0x590086[_0x5fdb('0x74')]=_0x30e0d1;var _0x3ba326={'messageId':_0x590086[_0x5fdb('0x72')][_0x5fdb('0x75')],'read':!![]};return _0x4034fd['update'](_0x3ba326);});}else{return logger['error'](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x76'),util[_0x5fdb('0x37')](_0x49de47,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5dc054){return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),'intelepeer',util[_0x5fdb('0x37')](_0x5dc054,{'showHidden':![],'depth':null}));});}else{return logger[_0x5fdb('0x23')](_0x5fdb('0x24'),_0x5fdb('0x25'),_0x5fdb('0x76'),_0x5fdb('0x77'));}break;}}})[_0x5fdb('0x78')](function(){_0x23a66a();});}else{_0x23a66a();}}},'charset':_0x5fdb('0x79'),'collate':_0x5fdb('0x7a')});};
\ No newline at end of file
index e98c2bf..bc06b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4497=['register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsMessage','create','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x4bc45c,_0x24e56b){var _0x2a69b3=function(_0x4b2673){while(--_0x4b2673){_0x4bc45c['push'](_0x4bc45c['shift']());}};_0x2a69b3(++_0x24e56b);}(_0x4497,0x9f));var _0x7449=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0x4497[_0x595013];return _0x2a29e3;};'use strict';var _=require(_0x7449('0x0'));var util=require(_0x7449('0x1'));var moment=require(_0x7449('0x2'));var BPromise=require(_0x7449('0x3'));var rs=require(_0x7449('0x4'));var fs=require('fs');var Redis=require(_0x7449('0x5'));var db=require(_0x7449('0x6'))['db'];var utils=require(_0x7449('0x7'));var logger=require(_0x7449('0x8'))(_0x7449('0x9'));var config=require(_0x7449('0xa'));var jayson=require(_0x7449('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7449('0xc')],{'host':_0x7449('0xd'),'port':0x18eb});var socket=require(_0x7449('0xe'))(new Redis(config[_0x7449('0xc')]));require(_0x7449('0xf'))[_0x7449('0x10')](socket);function respondWithRpcPromise(_0x57a152,_0x26aa38,_0x9b7d1e){return new BPromise(function(_0x227522,_0x22d184){return client[_0x7449('0x11')](_0x57a152,_0x9b7d1e)['then'](function(_0x5c0bb0){logger[_0x7449('0x12')](_0x7449('0x13'),_0x26aa38,_0x7449('0x14'));logger[_0x7449('0x15')](_0x7449('0x16'),_0x26aa38,_0x7449('0x14'),JSON['stringify'](_0x5c0bb0));if(_0x5c0bb0[_0x7449('0x17')]){if(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x18')]===0x1f4){logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);return _0x22d184(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);}logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x5c0bb0['error'][_0x7449('0x19')]);return _0x227522(_0x5c0bb0[_0x7449('0x17')][_0x7449('0x19')]);}else{logger[_0x7449('0x12')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,'request\x20sent');_0x227522(_0x5c0bb0[_0x7449('0x1a')]['message']);}})[_0x7449('0x1b')](function(_0x25ef17){logger[_0x7449('0x17')]('SmsMessage,\x20%s,\x20%s',_0x26aa38,_0x25ef17);_0x22d184(_0x25ef17);});});}exports[_0x7449('0x1c')]=function(_0x316f52){var _0xf782b=this;return new Promise(function(_0x221455,_0x350207){return db['SmsMessage'][_0x7449('0x1d')](_0x316f52[_0x7449('0x1e')],{'raw':_0x316f52[_0x7449('0x1f')]?_0x316f52[_0x7449('0x1f')][_0x7449('0x20')]===undefined?!![]:![]:!![]})[_0x7449('0x21')](function(_0x28483a){logger[_0x7449('0x12')](_0x7449('0x1c'),_0x316f52);logger['debug']('CreateSmsMessage',_0x316f52,JSON[_0x7449('0x22')](_0x28483a));_0x221455(_0x28483a);})[_0x7449('0x1b')](function(_0x1e02fa){logger[_0x7449('0x17')](_0x7449('0x1c'),_0x1e02fa[_0x7449('0x19')],_0x316f52);_0x350207(_0xf782b[_0x7449('0x17')](0x1f4,_0x1e02fa['message']));});});};
\ No newline at end of file
+var _0x6326=['CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsMessage.socket','register','then','info','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result'];(function(_0x3c0548,_0x443b2d){var _0x1281c3=function(_0x284e01){while(--_0x284e01){_0x3c0548['push'](_0x3c0548['shift']());}};_0x1281c3(++_0x443b2d);}(_0x6326,0x17b));var _0x6632=function(_0x30355a,_0x1c691a){_0x30355a=_0x30355a-0x0;var _0x35d744=_0x6326[_0x30355a];return _0x35d744;};'use strict';var _=require(_0x6632('0x0'));var util=require(_0x6632('0x1'));var moment=require('moment');var BPromise=require(_0x6632('0x2'));var rs=require(_0x6632('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6632('0x4'))['db'];var utils=require(_0x6632('0x5'));var logger=require(_0x6632('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6632('0x7'));var client=jayson[_0x6632('0x8')][_0x6632('0x9')]({'port':0x232a});config[_0x6632('0xa')]=_[_0x6632('0xb')](config[_0x6632('0xa')],{'host':_0x6632('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6632('0xa')]));require(_0x6632('0xd'))[_0x6632('0xe')](socket);function respondWithRpcPromise(_0x9db067,_0x4f2125,_0x3b0cfb){return new BPromise(function(_0x4db143,_0x31cd58){return client['request'](_0x9db067,_0x3b0cfb)[_0x6632('0xf')](function(_0x1ba44c){logger[_0x6632('0x10')]('SmsMessage,\x20%s,\x20%s',_0x4f2125,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4f2125,_0x6632('0x11'),JSON[_0x6632('0x12')](_0x1ba44c));if(_0x1ba44c[_0x6632('0x13')]){if(_0x1ba44c['error'][_0x6632('0x14')]===0x1f4){logger[_0x6632('0x13')](_0x6632('0x15'),_0x4f2125,_0x1ba44c[_0x6632('0x13')][_0x6632('0x16')]);return _0x31cd58(_0x1ba44c[_0x6632('0x13')][_0x6632('0x16')]);}logger[_0x6632('0x13')](_0x6632('0x15'),_0x4f2125,_0x1ba44c['error'][_0x6632('0x16')]);return _0x4db143(_0x1ba44c['error'][_0x6632('0x16')]);}else{logger[_0x6632('0x10')](_0x6632('0x15'),_0x4f2125,_0x6632('0x11'));_0x4db143(_0x1ba44c[_0x6632('0x17')][_0x6632('0x16')]);}})['catch'](function(_0x17888a){logger['error']('SmsMessage,\x20%s,\x20%s',_0x4f2125,_0x17888a);_0x31cd58(_0x17888a);});});}exports[_0x6632('0x18')]=function(_0xc2fc68){var _0xd2fc25=this;return new Promise(function(_0x56f428,_0x14081f){return db[_0x6632('0x19')][_0x6632('0x1a')](_0xc2fc68[_0x6632('0x1b')],{'raw':_0xc2fc68[_0x6632('0x1c')]?_0xc2fc68[_0x6632('0x1c')][_0x6632('0x1d')]===undefined?!![]:![]:!![]})[_0x6632('0xf')](function(_0x54a0b7){logger[_0x6632('0x10')]('CreateSmsMessage',_0xc2fc68);logger[_0x6632('0x1e')](_0x6632('0x18'),_0xc2fc68,JSON[_0x6632('0x12')](_0x54a0b7));_0x56f428(_0x54a0b7);})['catch'](function(_0x224954){logger[_0x6632('0x13')](_0x6632('0x18'),_0x224954[_0x6632('0x16')],_0xc2fc68);_0x14081f(_0xd2fc25[_0x6632('0x13')](0x1f4,_0x224954[_0x6632('0x16')]));});});};
\ No newline at end of file
index 07b2949..7061655 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ae=['remove','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x3253a7,_0x35b175){var _0x5cfd78=function(_0x168cab){while(--_0x168cab){_0x3253a7['push'](_0x3253a7['shift']());}};_0x5cfd78(++_0x35b175);}(_0x38ae,0x1c6));var _0xe38a=function(_0x49155d,_0x2bb881){_0x49155d=_0x49155d-0x0;var _0x4c5f0f=_0x38ae[_0x49155d];return _0x4c5f0f;};'use strict';var SmsMessageEvents=require(_0xe38a('0x0'));var events=['save',_0xe38a('0x1'),'update'];function createListener(_0x2b708a,_0x70dc53){return function(_0x3a5118){_0x70dc53[_0xe38a('0x2')](_0x2b708a,_0x3a5118);};}function removeListener(_0x3defed,_0x57fba8){return function(){SmsMessageEvents[_0xe38a('0x3')](_0x3defed,_0x57fba8);};}exports[_0xe38a('0x4')]=function(_0x427c2c){for(var _0x498a80=0x0,_0x47bde9=events[_0xe38a('0x5')];_0x498a80<_0x47bde9;_0x498a80++){var _0x5c3351=events[_0x498a80];var _0x4c0959=createListener(_0xe38a('0x6')+_0x5c3351,_0x427c2c);SmsMessageEvents['on'](_0x5c3351,_0x4c0959);}};
\ No newline at end of file
+var _0xeb5c=['smsMessage:','./smsMessage.events','remove','update'];(function(_0x1bc8ba,_0x51c8cc){var _0x32746a=function(_0xa08bc4){while(--_0xa08bc4){_0x1bc8ba['push'](_0x1bc8ba['shift']());}};_0x32746a(++_0x51c8cc);}(_0xeb5c,0xf5));var _0xceb5=function(_0xb8f90b,_0x25f537){_0xb8f90b=_0xb8f90b-0x0;var _0x4e2af4=_0xeb5c[_0xb8f90b];return _0x4e2af4;};'use strict';var SmsMessageEvents=require(_0xceb5('0x0'));var events=['save',_0xceb5('0x1'),_0xceb5('0x2')];function createListener(_0x2e87ff,_0x376435){return function(_0x300a41){_0x376435['emit'](_0x2e87ff,_0x300a41);};}function removeListener(_0xa0d5b8,_0x55a20c){return function(){SmsMessageEvents['removeListener'](_0xa0d5b8,_0x55a20c);};}exports['register']=function(_0x20630a){for(var _0x3b4954=0x0,_0x41de84=events['length'];_0x3b4954<_0x41de84;_0x3b4954++){var _0x420deb=events[_0x3b4954];var _0x18b3fd=createListener(_0xceb5('0x3')+_0x420deb,_0x20630a);SmsMessageEvents['on'](_0x420deb,_0x18b3fd);}};
\ No newline at end of file
index fe3b8c8..add3952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa8=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','/:id/teams','removeTeams','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3aa8,0x102));var _0x83aa=function(_0x8906d5,_0x17f950){_0x8906d5=_0x8906d5-0x0;var _0x40d085=_0x3aa8[_0x8906d5];return _0x40d085;};'use strict';var multer=require('multer');var util=require(_0x83aa('0x0'));var path=require(_0x83aa('0x1'));var timeout=require(_0x83aa('0x2'));var express=require('express');var router=express[_0x83aa('0x3')]();var fs_extra=require(_0x83aa('0x4'));var auth=require(_0x83aa('0x5'));var interaction=require(_0x83aa('0x6'));var config=require(_0x83aa('0x7'));var controller=require(_0x83aa('0x8'));router[_0x83aa('0x9')]('/',auth[_0x83aa('0xa')](),controller['index']);router[_0x83aa('0x9')](_0x83aa('0xb'),auth[_0x83aa('0xa')](),controller[_0x83aa('0xc')]);router['get'](_0x83aa('0xd'),auth['isAuthenticated'](),controller[_0x83aa('0xe')]);router['get'](_0x83aa('0xf'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x10')]);router[_0x83aa('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x83aa('0x11')]);router[_0x83aa('0x9')](_0x83aa('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x83aa('0xa')](),controller[_0x83aa('0x13')]);router[_0x83aa('0x14')]('/:id/teams',auth[_0x83aa('0xa')](),controller[_0x83aa('0x15')]);router[_0x83aa('0x14')](_0x83aa('0x12'),auth['isAuthenticated'](),controller[_0x83aa('0x16')]);router[_0x83aa('0x17')](_0x83aa('0xd'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x18')]);router[_0x83aa('0x19')]('/:id',auth[_0x83aa('0xa')](),controller[_0x83aa('0x1a')]);router[_0x83aa('0x19')](_0x83aa('0x1b'),auth[_0x83aa('0xa')](),controller[_0x83aa('0x1c')]);router[_0x83aa('0x19')](_0x83aa('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xc715=['update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put'];(function(_0x209511,_0x231622){var _0x39b937=function(_0x4005a3){while(--_0x4005a3){_0x209511['push'](_0x209511['shift']());}};_0x39b937(++_0x231622);}(_0xc715,0x1d6));var _0x5c71=function(_0x5c6469,_0x54afe8){_0x5c6469=_0x5c6469-0x0;var _0x4a85d0=_0xc715[_0x5c6469];return _0x4a85d0;};'use strict';var multer=require(_0x5c71('0x0'));var util=require(_0x5c71('0x1'));var path=require(_0x5c71('0x2'));var timeout=require(_0x5c71('0x3'));var express=require(_0x5c71('0x4'));var router=express[_0x5c71('0x5')]();var fs_extra=require(_0x5c71('0x6'));var auth=require(_0x5c71('0x7'));var interaction=require(_0x5c71('0x8'));var config=require(_0x5c71('0x9'));var controller=require('./smsQueue.controller');router[_0x5c71('0xa')]('/',auth['isAuthenticated'](),controller[_0x5c71('0xb')]);router[_0x5c71('0xa')](_0x5c71('0xc'),auth[_0x5c71('0xd')](),controller[_0x5c71('0xe')]);router[_0x5c71('0xa')](_0x5c71('0xf'),auth[_0x5c71('0xd')](),controller[_0x5c71('0x10')]);router[_0x5c71('0xa')](_0x5c71('0x11'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x5c71('0x12'),auth[_0x5c71('0xd')](),controller[_0x5c71('0x13')]);router[_0x5c71('0xa')](_0x5c71('0x14'),auth['isAuthenticated'](),controller[_0x5c71('0x15')]);router[_0x5c71('0x16')]('/',auth['isAuthenticated'](),controller[_0x5c71('0x17')]);router[_0x5c71('0x16')](_0x5c71('0x12'),auth[_0x5c71('0xd')](),controller['addTeams']);router['post'](_0x5c71('0x14'),auth[_0x5c71('0xd')](),controller[_0x5c71('0x18')]);router[_0x5c71('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x5c71('0x1a')]);router[_0x5c71('0x1b')](_0x5c71('0xf'),auth['isAuthenticated'](),controller[_0x5c71('0x1c')]);router[_0x5c71('0x1b')](_0x5c71('0x12'),auth[_0x5c71('0xd')](),controller[_0x5c71('0x1d')]);router['delete']('/:id/users',auth[_0x5c71('0xd')](),controller['removeAgents']);module[_0x5c71('0x1e')]=router;
\ No newline at end of file
index 1b21edc..fc30727 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e1e=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x71d604,_0x3edc06){var _0x1ae5a5=function(_0x1eb704){while(--_0x1eb704){_0x71d604['push'](_0x71d604['shift']());}};_0x1ae5a5(++_0x3edc06);}(_0x1e1e,0xb8));var _0xe1e1=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0x1e1e[_0x4664db];return _0x5615b4;};'use strict';var Sequelize=require(_0xe1e1('0x0'));module[_0xe1e1('0x1')]={'name':{'type':Sequelize[_0xe1e1('0x2')],'unique':_0xe1e1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe1e1('0x2')]},'timeout':{'type':Sequelize[_0xe1e1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe1e1('0x5'),'beepall',_0xe1e1('0x6'))}};
\ No newline at end of file
+var _0x1bb8=['beepall','roundrobin','sequelize','STRING','name','ENUM','rrmemory'];(function(_0x190001,_0x24f401){var _0x1e6909=function(_0x39c458){while(--_0x39c458){_0x190001['push'](_0x190001['shift']());}};_0x1e6909(++_0x24f401);}(_0x1bb8,0x1f3));var _0x81bb=function(_0x5afb87,_0x409d73){_0x5afb87=_0x5afb87-0x0;var _0x28c459=_0x1bb8[_0x5afb87];return _0x28c459;};'use strict';var Sequelize=require(_0x81bb('0x0'));module['exports']={'name':{'type':Sequelize[_0x81bb('0x1')],'unique':_0x81bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x81bb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81bb('0x3')](_0x81bb('0x4'),_0x81bb('0x5'),_0x81bb('0x6'))}};
\ No newline at end of file
index 22c5a5d..9641ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe596=['getTeams','Team','addTeams','online','voicePause','interface','Agents','sequelize','transaction','findOrCreate','userSmsQueue:save','removeTeams','select','tq.TeamId','team_has_sms_queues','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','ids','removeAgents','forEach','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','stack','name','send','index','SmsQueue','rawAttributes','fieldName','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','SmsQueueId','filter','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP'];(function(_0x4fb7ea,_0x54c72d){var _0x263966=function(_0x470510){while(--_0x470510){_0x4fb7ea['push'](_0x4fb7ea['shift']());}};_0x263966(++_0x54c72d);}(_0xe596,0xb1));var _0x6e59=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xe596[_0x12fc8d];return _0x3f9d04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6e59('0x0'));var zipdir=require(_0x6e59('0x1'));var jsonpatch=require(_0x6e59('0x2'));var rp=require('request-promise');var moment=require(_0x6e59('0x3'));var BPromise=require(_0x6e59('0x4'));var Mustache=require(_0x6e59('0x5'));var util=require(_0x6e59('0x6'));var path=require(_0x6e59('0x7'));var sox=require(_0x6e59('0x8'));var csv=require(_0x6e59('0x9'));var ejs=require(_0x6e59('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e59('0xb'));var squel=require(_0x6e59('0xc'));var crypto=require('crypto');var jsforce=require(_0x6e59('0xd'));var deskjs=require(_0x6e59('0xe'));var toCsv=require(_0x6e59('0x9'));var querystring=require(_0x6e59('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e59('0x10'));var authService=require(_0x6e59('0x11'));var qs=require(_0x6e59('0x12'));var as=require(_0x6e59('0x13'));var hardwareService=require(_0x6e59('0x14'));var logger=require(_0x6e59('0x15'))(_0x6e59('0x16'));var utils=require('../../config/utils');var config=require(_0x6e59('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e59('0x18'))['db'];config['redis']=_[_0x6e59('0x19')](config[_0x6e59('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x6e59('0x1b'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0xadb8a3,_0x2fc274){_0x2fc274=_0x2fc274||0xcc;return function(_0x2d642d){if(_0x2d642d){return _0xadb8a3['sendStatus'](_0x2fc274);}return _0xadb8a3[_0x6e59('0x1c')](_0x2fc274)[_0x6e59('0x1d')]();};}function respondWithResult(_0x2bd39d,_0x410dbc){_0x410dbc=_0x410dbc||0xc8;return function(_0x46e3c2){if(_0x46e3c2){return _0x2bd39d[_0x6e59('0x1c')](_0x410dbc)['json'](_0x46e3c2);}};}function respondWithFilteredResult(_0x50f1d7,_0x5f0357){return function(_0x41859e){if(_0x41859e){var _0x56e011=typeof _0x5f0357[_0x6e59('0x1e')]==='undefined'&&typeof _0x5f0357[_0x6e59('0x1f')]===_0x6e59('0x20');var _0x132ece=_0x41859e[_0x6e59('0x21')];var _0x3083c6=_0x56e011?0x0:_0x5f0357['offset'];var _0x1fc6ed=_0x56e011?_0x41859e[_0x6e59('0x21')]:_0x5f0357['offset']+_0x5f0357['limit'];var _0x36ff11;if(_0x1fc6ed>=_0x132ece){_0x1fc6ed=_0x132ece;_0x36ff11=0xc8;}else{_0x36ff11=0xce;}_0x50f1d7[_0x6e59('0x1c')](_0x36ff11);return _0x50f1d7[_0x6e59('0x22')]('Content-Range',_0x3083c6+'-'+_0x1fc6ed+'/'+_0x132ece)[_0x6e59('0x23')](_0x41859e);}return null;};}function patchUpdates(_0x1405c0){return function(_0xb7edd2){try{jsonpatch[_0x6e59('0x24')](_0xb7edd2,_0x1405c0,!![]);}catch(_0x40c67c){return BPromise[_0x6e59('0x25')](_0x40c67c);}return _0xb7edd2[_0x6e59('0x26')]();};}function saveUpdates(_0x3ae530,_0x4c470d){return function(_0x5d6696){if(_0x5d6696){return _0x5d6696[_0x6e59('0x27')](_0x3ae530)[_0x6e59('0x28')](function(_0x29f934){return _0x29f934;});}return null;};}function removeEntity(_0x1e2df0,_0x2347ae){return function(_0x291913){if(_0x291913){return _0x291913[_0x6e59('0x29')]()[_0x6e59('0x28')](function(){var _0x5c70c9=_0x291913[_0x6e59('0x2a')]({'plain':!![]});var _0x599bfb=_0x6e59('0x2b');return db[_0x6e59('0x2c')][_0x6e59('0x29')]({'where':{'type':_0x599bfb,'resourceId':_0x5c70c9['id']}})[_0x6e59('0x28')](function(){return _0x291913;});})[_0x6e59('0x28')](function(){_0x1e2df0[_0x6e59('0x1c')](0xcc)[_0x6e59('0x1d')]();});}};}function handleEntityNotFound(_0x33277b,_0x44f5bc){return function(_0x3aef74){if(!_0x3aef74){_0x33277b['sendStatus'](0x194);}return _0x3aef74;};}function handleError(_0x4e8fa8,_0x34ca23){_0x34ca23=_0x34ca23||0x1f4;return function(_0xab6637){logger['error'](_0xab6637[_0x6e59('0x2d')]);if(_0xab6637[_0x6e59('0x2e')]){delete _0xab6637[_0x6e59('0x2e')];}_0x4e8fa8[_0x6e59('0x1c')](_0x34ca23)[_0x6e59('0x2f')](_0xab6637);};}exports[_0x6e59('0x30')]=function(_0x5edf39,_0x5f33e2){var _0x404650={},_0x1a0e16={},_0x54f235={'count':0x0,'rows':[]};var _0x379f56=_['map'](db[_0x6e59('0x31')][_0x6e59('0x32')],function(_0x39172b){return{'name':_0x39172b[_0x6e59('0x33')],'type':_0x39172b['type']['key']};});_0x1a0e16[_0x6e59('0x34')]=_[_0x6e59('0x35')](_0x379f56,_0x6e59('0x2e'));_0x1a0e16['query']=_[_0x6e59('0x36')](_0x5edf39[_0x6e59('0x37')]);_0x1a0e16['filters']=_[_0x6e59('0x38')](_0x1a0e16[_0x6e59('0x34')],_0x1a0e16[_0x6e59('0x37')]);_0x404650['attributes']=_['intersection'](_0x1a0e16[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x39')]));_0x404650['attributes']=_0x404650[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x404650[_0x6e59('0x3a')]:_0x1a0e16[_0x6e59('0x34')];if(!_0x5edf39[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x404650[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x1f')]);_0x404650['offset']=qs[_0x6e59('0x1e')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x1e')]);}_0x404650[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x5edf39[_0x6e59('0x37')][_0x6e59('0x3f')]);_0x404650[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x5edf39['query'],_0x1a0e16[_0x6e59('0x41')]),_0x379f56);if(_0x5edf39[_0x6e59('0x37')]['filter']){_0x404650[_0x6e59('0x40')]=_[_0x6e59('0x43')](_0x404650['where'],{'$or':_['map'](_0x379f56,function(_0x4a6eb5){if(_0x4a6eb5[_0x6e59('0x44')]!==_0x6e59('0x45')){var _0x53388e={};_0x53388e[_0x4a6eb5['name']]={'$like':'%'+_0x5edf39['query']['filter']+'%'};return _0x53388e;}})});}_0x404650=_['merge']({},_0x404650,_0x5edf39['options']);var _0x2e9f39={'where':_0x404650[_0x6e59('0x40')]};return db[_0x6e59('0x31')][_0x6e59('0x21')](_0x2e9f39)[_0x6e59('0x28')](function(_0x418a0f){_0x54f235[_0x6e59('0x21')]=_0x418a0f;if(_0x5edf39[_0x6e59('0x37')]['includeAll']){_0x404650[_0x6e59('0x46')]=[{'all':!![]}];}return db[_0x6e59('0x31')][_0x6e59('0x47')](_0x404650);})[_0x6e59('0x28')](function(_0x6e862a){_0x54f235['rows']=_0x6e862a;return _0x54f235;})['then'](respondWithFilteredResult(_0x5f33e2,_0x404650))[_0x6e59('0x48')](handleError(_0x5f33e2,null));};exports[_0x6e59('0x49')]=function(_0x41a378,_0x569aed){var _0x32dd1e={'raw':!![],'where':{'id':_0x41a378[_0x6e59('0x4a')]['id']}},_0x1a123b={};_0x1a123b[_0x6e59('0x34')]=_[_0x6e59('0x36')](db[_0x6e59('0x31')][_0x6e59('0x32')]);_0x1a123b[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x41a378[_0x6e59('0x37')]);_0x1a123b[_0x6e59('0x41')]=_[_0x6e59('0x38')](_0x1a123b[_0x6e59('0x34')],_0x1a123b[_0x6e59('0x37')]);_0x32dd1e[_0x6e59('0x3a')]=_['intersection'](_0x1a123b[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x41a378[_0x6e59('0x37')][_0x6e59('0x39')]));_0x32dd1e[_0x6e59('0x3a')]=_0x32dd1e[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x32dd1e[_0x6e59('0x3a')]:_0x1a123b['model'];if(_0x41a378[_0x6e59('0x37')][_0x6e59('0x4b')]){_0x32dd1e['include']=[{'all':!![]}];}_0x32dd1e=_['merge']({},_0x32dd1e,_0x41a378[_0x6e59('0x4c')]);return db[_0x6e59('0x31')][_0x6e59('0x4d')](_0x32dd1e)[_0x6e59('0x28')](handleEntityNotFound(_0x569aed,null))[_0x6e59('0x28')](respondWithResult(_0x569aed,null))[_0x6e59('0x48')](handleError(_0x569aed,null));};exports['create']=function(_0x54faab,_0x243ef9){return db[_0x6e59('0x31')]['create'](_0x54faab['body'],{})[_0x6e59('0x28')](function(_0x507bc3){var _0x3e7e25=_0x54faab[_0x6e59('0x4e')][_0x6e59('0x2a')]({'plain':!![]});if(!_0x3e7e25)throw new Error(_0x6e59('0x4f'));if(_0x3e7e25['role']==='user'){var _0x503030=_0x507bc3[_0x6e59('0x2a')]({'plain':!![]});var _0x4d2fba='SmsQueues';return db[_0x6e59('0x50')][_0x6e59('0x4d')]({'where':{'name':_0x4d2fba,'userProfileId':_0x3e7e25[_0x6e59('0x51')]},'raw':!![]})[_0x6e59('0x28')](function(_0xf0cbc2){if(_0xf0cbc2&&_0xf0cbc2[_0x6e59('0x52')]===0x0){return db[_0x6e59('0x2c')][_0x6e59('0x53')]({'name':_0x503030[_0x6e59('0x2e')],'resourceId':_0x503030['id'],'type':_0xf0cbc2[_0x6e59('0x2e')],'sectionId':_0xf0cbc2['id']},{})[_0x6e59('0x28')](function(){return _0x507bc3;});}else{return _0x507bc3;}})[_0x6e59('0x48')](function(_0x18c60a){logger[_0x6e59('0x54')](_0x6e59('0x55'),_0x18c60a);throw _0x18c60a;});}return _0x507bc3;})['then'](respondWithResult(_0x243ef9,0xc9))[_0x6e59('0x48')](handleError(_0x243ef9,null));};exports[_0x6e59('0x27')]=function(_0x3f55d4,_0x41031f){if(_0x3f55d4[_0x6e59('0x56')]['id']){delete _0x3f55d4[_0x6e59('0x56')]['id'];}return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x3f55d4['params']['id']}})['then'](handleEntityNotFound(_0x41031f,null))['then'](saveUpdates(_0x3f55d4['body'],null))[_0x6e59('0x28')](respondWithResult(_0x41031f,null))['catch'](handleError(_0x41031f,null));};exports[_0x6e59('0x29')]=function(_0x546ae9,_0x30f7dc){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x546ae9[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x30f7dc,null))[_0x6e59('0x28')](removeEntity(_0x30f7dc,null))[_0x6e59('0x48')](handleError(_0x30f7dc,null));};exports['describe']=function(_0x4cdd8b,_0x169b9b){return db['SmsQueue'][_0x6e59('0x57')]()[_0x6e59('0x28')](respondWithResult(_0x169b9b,null))['catch'](handleError(_0x169b9b,null));};exports['getMembers']=function(_0x446ff2,_0x55ac54,_0x9d2b6d){var _0x226537={'raw':!![],'where':{}},_0x183e21={},_0x55471d;return db['SmsQueue'][_0x6e59('0x58')]({'where':{'id':_0x446ff2[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x55ac54,null))['then'](function(_0x4a6cf3){if(_0x4a6cf3){_0x55471d=_0x4a6cf3[_0x6e59('0x2a')]({'plain':!![]});_0x183e21[_0x6e59('0x34')]=_['keys'](db['UserSmsQueue'][_0x6e59('0x32')]);_0x183e21[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x446ff2[_0x6e59('0x37')]);_0x183e21['filters']=_[_0x6e59('0x38')](_0x183e21['model'],_0x183e21['query']);_0x226537[_0x6e59('0x3a')]=_['intersection'](_0x183e21[_0x6e59('0x34')],qs[_0x6e59('0x39')](_0x446ff2[_0x6e59('0x37')][_0x6e59('0x39')]));_0x226537[_0x6e59('0x3a')]=_0x226537['attributes'][_0x6e59('0x3b')]?_0x226537[_0x6e59('0x3a')]:_0x183e21['model'];if(!_0x446ff2[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x226537[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x446ff2[_0x6e59('0x37')][_0x6e59('0x1f')]);_0x226537[_0x6e59('0x1e')]=qs['offset'](_0x446ff2[_0x6e59('0x37')]['offset']);}_0x226537[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x446ff2[_0x6e59('0x37')]['sort']);_0x226537['where']=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x446ff2[_0x6e59('0x37')],_0x183e21[_0x6e59('0x41')]));_0x226537[_0x6e59('0x40')][_0x6e59('0x59')]=_0x4a6cf3['id'];if(_0x446ff2[_0x6e59('0x37')]['filter']){_0x226537[_0x6e59('0x40')]=_['merge'](_0x226537[_0x6e59('0x40')],{'$or':_[_0x6e59('0x35')](_0x226537[_0x6e59('0x3a')],function(_0x11e411){var _0x3718fd={};_0x3718fd[_0x11e411]={'$like':'%'+_0x446ff2[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x3718fd;})});}_0x226537=_[_0x6e59('0x43')]({},_0x226537,_0x446ff2[_0x6e59('0x4c')]);return db[_0x6e59('0x5b')][_0x6e59('0x47')](_0x226537);}})[_0x6e59('0x28')](function(_0x3ccf57){if(_0x3ccf57){return db[_0x6e59('0x5c')][_0x6e59('0x5d')]({'where':{'id':_[_0x6e59('0x35')](_0x3ccf57,_0x6e59('0x5e')),'role':_0x6e59('0x5f')},'attributes':['id',_0x6e59('0x2e'),_0x6e59('0x60'),_0x6e59('0x61'),_0x6e59('0x62')]});}})[_0x6e59('0x28')](function(_0x3f2d39){if(_0x3f2d39){return{'count':_0x3f2d39[_0x6e59('0x21')],'rows':_['map'](_0x3f2d39[_0x6e59('0x63')],function(_0x4806c4){return{'membername':_0x4806c4[_0x6e59('0x2e')],'UserId':_0x4806c4['id'],'queue_name':_0x55471d[_0x6e59('0x2e')],'SmsQueueId':_0x55471d['id'],'interface':util[_0x6e59('0x64')](_0x6e59('0x65'),_0x6e59('0x66'),_0x4806c4[_0x6e59('0x2e')]),'penalty':0x0,'paused':_0x4806c4[_0x6e59('0x60')],'createdAt':_0x4806c4['createdAt'],'updatedAt':_0x4806c4[_0x6e59('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6e59('0x28')](respondWithFilteredResult(_0x55ac54,_0x226537))[_0x6e59('0x48')](handleError(_0x55ac54,null));};exports[_0x6e59('0x67')]=function(_0x16feb4,_0x1ac7e6,_0x26f515){var _0x476d59={};var _0xc39855={};var _0x2125ec;var _0x35c43d;return db[_0x6e59('0x31')][_0x6e59('0x58')]({'where':{'id':_0x16feb4[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x1ac7e6,null))[_0x6e59('0x28')](function(_0x3c5b89){if(_0x3c5b89){_0x2125ec=_0x3c5b89;_0xc39855[_0x6e59('0x34')]=_[_0x6e59('0x36')](db[_0x6e59('0x68')][_0x6e59('0x32')]);_0xc39855[_0x6e59('0x37')]=_['keys'](_0x16feb4['query']);_0xc39855['filters']=_['intersection'](_0xc39855[_0x6e59('0x34')],_0xc39855['query']);_0x476d59[_0x6e59('0x3a')]=_[_0x6e59('0x38')](_0xc39855[_0x6e59('0x34')],qs['fields'](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x39')]));_0x476d59[_0x6e59('0x3a')]=_0x476d59[_0x6e59('0x3a')]['length']?_0x476d59[_0x6e59('0x3a')]:_0xc39855[_0x6e59('0x34')];_0x476d59[_0x6e59('0x3e')]=qs['sort'](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x3f')]);_0x476d59[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x16feb4[_0x6e59('0x37')],_0xc39855[_0x6e59('0x41')]));if(_0x16feb4[_0x6e59('0x37')][_0x6e59('0x5a')]){_0x476d59['where']=_[_0x6e59('0x43')](_0x476d59['where'],{'$or':_[_0x6e59('0x35')](_0x476d59[_0x6e59('0x3a')],function(_0x3e1244){var _0x2f1df9={};_0x2f1df9[_0x3e1244]={'$like':'%'+_0x16feb4[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x2f1df9;})});}_0x476d59=_[_0x6e59('0x43')]({},_0x476d59,_0x16feb4[_0x6e59('0x4c')]);return _0x2125ec[_0x6e59('0x67')](_0x476d59);}})['then'](function(_0x488826){if(_0x488826){_0x35c43d=_0x488826[_0x6e59('0x3b')];if(!_0x16feb4[_0x6e59('0x37')][_0x6e59('0x3c')](_0x6e59('0x3d'))){_0x476d59[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x16feb4['query'][_0x6e59('0x1f')]);_0x476d59['offset']=qs[_0x6e59('0x1e')](_0x16feb4[_0x6e59('0x37')][_0x6e59('0x1e')]);}return _0x2125ec[_0x6e59('0x67')](_0x476d59);}})['then'](function(_0x52bc91){if(_0x52bc91){return _0x52bc91?{'count':_0x35c43d,'rows':_0x52bc91}:null;}})['then'](respondWithResult(_0x1ac7e6,null))['catch'](handleError(_0x1ac7e6,null));};exports[_0x6e59('0x69')]=function(_0x521a7a,_0x50055d,_0x3dc39a){var _0x38483e=_0x521a7a[_0x6e59('0x56')]['ids'];return db[_0x6e59('0x68')][_0x6e59('0x47')]({'where':{'id':_0x38483e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x6e59('0x6a'),_0x6e59('0x6b'),_0x6e59('0x6c')],'raw':!![]}]})[_0x6e59('0x28')](function(_0x3a5506){if(_0x3a5506){var _0x43cd0c=_['flatMap'](_0x3a5506,function(_0x5795f1){var _0x4c11d1=_0x5795f1['get']({'plain':!![]});return _0x4c11d1[_0x6e59('0x6d')];});return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x521a7a[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](function(_0x5deb3f){return db[_0x6e59('0x6e')][_0x6e59('0x6f')](function(_0x51f255){return _0x5deb3f[_0x6e59('0x69')](_0x38483e,{'transaction':_0x51f255})[_0x6e59('0x28')](function(){return BPromise['each'](_0x43cd0c,function(_0x259ca6){return db[_0x6e59('0x5b')][_0x6e59('0x70')]({'where':{'UserId':_0x259ca6['id'],'SmsQueueId':_0x521a7a[_0x6e59('0x4a')]['id']},'transaction':_0x51f255});});})[_0x6e59('0x28')](function(){_0x43cd0c['forEach'](function(_0x26878b){socket['emit'](_0x6e59('0x71'),{'UserId':_0x26878b['id'],'SmsQueueId':_0x5deb3f['id']});});});});});}})['then'](respondWithStatusCode(_0x50055d,null))['catch'](handleError(_0x50055d,null));};exports[_0x6e59('0x72')]=function(_0x43610d,_0x51d5af,_0x50e46a){return db[_0x6e59('0x68')][_0x6e59('0x47')]({'where':{'id':_0x43610d[_0x6e59('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6e59('0x5c')],'as':_0x6e59('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x6e59('0x28')](handleEntityNotFound(_0x51d5af,null))[_0x6e59('0x28')](function(_0x20a0b2){var _0x4bd953=_[_0x6e59('0x35')](_0x20a0b2,'id');var _0x1d7b5b=[];var _0x301112=[];var _0x16f95c=squel[_0x6e59('0x73')]();_0x16f95c['field'](_0x6e59('0x74'))['from'](_0x6e59('0x75'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6e59('0x40')](_0x6e59('0x76'),_0x43610d[_0x6e59('0x4a')]['id']);for(var _0x2d4ca3=0x0;_0x2d4ca3<_0x20a0b2['length'];_0x2d4ca3+=0x1){let _0x532fa8=_0x20a0b2[_0x2d4ca3];for(var _0x2d44e1=0x0;_0x2d44e1<_0x532fa8['Agents'][_0x6e59('0x3b')];_0x2d44e1+=0x1){let _0x47ea7f=_0x532fa8[_0x6e59('0x6d')][_0x2d44e1];var _0x2e33be=_0x16f95c[_0x6e59('0x77')]();_0x2e33be[_0x6e59('0x40')](_0x6e59('0x78'),_0x47ea7f['id']);_0x301112['push'](db[_0x6e59('0x6e')][_0x6e59('0x37')](_0x2e33be[_0x6e59('0x79')](),{'type':db[_0x6e59('0x6e')]['QueryTypes'][_0x6e59('0x7a')]})['then'](function(_0x32878c){if(_0x32878c[_0x6e59('0x3b')]===0x1){return _0x47ea7f['id'];}else{var _0x16b645=_[_0x6e59('0x7b')](_[_0x6e59('0x35')](_0x32878c,_0x6e59('0x7c')),function(_0x4ce5b5){return _[_0x6e59('0x7d')](_0x4bd953,_0x4ce5b5);});if(_0x16b645){return _0x47ea7f['id'];}}}));}}return BPromise[_0x6e59('0x7e')](_0x301112)['then'](function(_0x2e2efe){_0x1d7b5b=_(_0x1d7b5b)[_0x6e59('0x7f')](_0x2e2efe)[_0x6e59('0x80')]()[_0x6e59('0x81')]();return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x43610d['params']['id']}})[_0x6e59('0x28')](function(_0x25e2ed){return db[_0x6e59('0x6e')]['transaction'](function(_0x4fd32e){return _0x25e2ed[_0x6e59('0x72')](_0x43610d[_0x6e59('0x37')][_0x6e59('0x82')],{'transaction':_0x4fd32e})[_0x6e59('0x28')](function(){if(!_['isEmpty'](_0x1d7b5b)){return _0x25e2ed[_0x6e59('0x83')](_0x1d7b5b,{'transaction':_0x4fd32e});}})[_0x6e59('0x28')](function(){_0x1d7b5b[_0x6e59('0x84')](function(_0x148b91){socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':_0x148b91,'SmsQueueId':_0x25e2ed['id']});});});});});});})['then'](respondWithStatusCode(_0x51d5af,null))[_0x6e59('0x48')](handleError(_0x51d5af,null));};exports[_0x6e59('0x87')]=function(_0x207b11,_0x31e59d,_0x5c4f68){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x207b11[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x31e59d,null))['then'](function(_0x4e95cd){if(_0x4e95cd){return _0x4e95cd[_0x6e59('0x87')](_0x207b11[_0x6e59('0x56')][_0x6e59('0x82')],_[_0x6e59('0x88')](_0x207b11['body'],['ids','id'])||{})[_0x6e59('0x89')](function(_0x5b1539){for(var _0x4a2484=0x0;_0x4a2484<_0x207b11[_0x6e59('0x56')]['ids'][_0x6e59('0x3b')];_0x4a2484+=0x1){socket[_0x6e59('0x85')](_0x6e59('0x71'),{'UserId':Number(_0x207b11[_0x6e59('0x56')][_0x6e59('0x82')][_0x4a2484]),'SmsQueueId':Number(_0x207b11[_0x6e59('0x4a')]['id'])});}return _0x5b1539;});}})[_0x6e59('0x28')](respondWithResult(_0x31e59d,null))[_0x6e59('0x48')](handleError(_0x31e59d,null));};exports[_0x6e59('0x83')]=function(_0x56da71,_0x4be0fa,_0x482f64){return db[_0x6e59('0x31')][_0x6e59('0x4d')]({'where':{'id':_0x56da71[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x4be0fa,null))['then'](function(_0x38ba59){if(_0x38ba59){return _0x38ba59[_0x6e59('0x83')](_0x56da71[_0x6e59('0x37')]['ids'])[_0x6e59('0x28')](function(){if(_[_0x6e59('0x8a')](_0x56da71['query']['ids'])){for(var _0xd50fbd=0x0;_0xd50fbd<_0x56da71[_0x6e59('0x37')]['ids'][_0x6e59('0x3b')];_0xd50fbd+=0x1){socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':Number(_0x56da71['query'][_0x6e59('0x82')][_0xd50fbd]),'SmsQueueId':Number(_0x56da71[_0x6e59('0x4a')]['id'])});}}else{socket[_0x6e59('0x85')](_0x6e59('0x86'),{'UserId':Number(_0x56da71[_0x6e59('0x37')][_0x6e59('0x82')]),'SmsQueueId':Number(_0x56da71[_0x6e59('0x4a')]['id'])});}});}})[_0x6e59('0x28')](respondWithStatusCode(_0x4be0fa,null))[_0x6e59('0x48')](handleError(_0x4be0fa,null));};exports[_0x6e59('0x8b')]=function(_0x350440,_0x433f54,_0x27cd29){var _0x4116a3={};var _0x440934={};var _0x3787db;var _0x1860c6;return db[_0x6e59('0x31')][_0x6e59('0x58')]({'where':{'id':_0x350440[_0x6e59('0x4a')]['id']}})[_0x6e59('0x28')](handleEntityNotFound(_0x433f54,null))[_0x6e59('0x28')](function(_0x50ff14){if(_0x50ff14){_0x3787db=_0x50ff14;_0x440934[_0x6e59('0x34')]=_[_0x6e59('0x36')](db['User'][_0x6e59('0x32')]);_0x440934[_0x6e59('0x37')]=_[_0x6e59('0x36')](_0x350440[_0x6e59('0x37')]);_0x440934['filters']=_['intersection'](_0x440934[_0x6e59('0x34')],_0x440934[_0x6e59('0x37')]);_0x4116a3['attributes']=_[_0x6e59('0x38')](_0x440934[_0x6e59('0x34')],qs['fields'](_0x350440['query'][_0x6e59('0x39')]));_0x4116a3[_0x6e59('0x3a')]=_0x4116a3[_0x6e59('0x3a')][_0x6e59('0x3b')]?_0x4116a3[_0x6e59('0x3a')]:_0x440934[_0x6e59('0x34')];_0x4116a3[_0x6e59('0x3e')]=qs[_0x6e59('0x3f')](_0x350440['query']['sort']);_0x4116a3[_0x6e59('0x40')]=qs[_0x6e59('0x41')](_[_0x6e59('0x42')](_0x350440[_0x6e59('0x37')],_0x440934['filters']));if(_0x350440['query']['filter']){_0x4116a3[_0x6e59('0x40')]=_[_0x6e59('0x43')](_0x4116a3[_0x6e59('0x40')],{'$or':_['map'](_0x4116a3[_0x6e59('0x3a')],function(_0x47f3e4){var _0x4a246d={};_0x4a246d[_0x47f3e4]={'$like':'%'+_0x350440[_0x6e59('0x37')][_0x6e59('0x5a')]+'%'};return _0x4a246d;})});}_0x4116a3=_[_0x6e59('0x43')]({},_0x4116a3,_0x350440['options']);return _0x3787db[_0x6e59('0x8b')](_0x4116a3);}})[_0x6e59('0x28')](function(_0x1c4392){if(_0x1c4392){_0x1860c6=_0x1c4392[_0x6e59('0x3b')];if(!_0x350440[_0x6e59('0x37')]['hasOwnProperty'](_0x6e59('0x3d'))){_0x4116a3[_0x6e59('0x1f')]=qs[_0x6e59('0x1f')](_0x350440['query'][_0x6e59('0x1f')]);_0x4116a3[_0x6e59('0x1e')]=qs['offset'](_0x350440['query']['offset']);}return _0x3787db[_0x6e59('0x8b')](_0x4116a3);}})['then'](function(_0x320de7){if(_0x320de7){return _0x320de7?{'count':_0x1860c6,'rows':_0x320de7}:null;}})['then'](respondWithResult(_0x433f54,null))['catch'](handleError(_0x433f54,null));};
\ No newline at end of file
+var _0x62ff=['get','role','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','findAll','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','addAgents','removeAgents','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','SmsQueues','UserProfileResource','destroy','then','sendStatus','error','stack','name','send','index','map','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','SmsQueue','rows','catch','show','params','rawAttributes','find','create','body','user'];(function(_0x5309b2,_0x307920){var _0x3542ab=function(_0x29f6fa){while(--_0x29f6fa){_0x5309b2['push'](_0x5309b2['shift']());}};_0x3542ab(++_0x307920);}(_0x62ff,0x1e5));var _0xf62f=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x62ff[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xf62f('0x0'));var rimraf=require(_0xf62f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf62f('0x2'));var rp=require(_0xf62f('0x3'));var moment=require(_0xf62f('0x4'));var BPromise=require(_0xf62f('0x5'));var Mustache=require(_0xf62f('0x6'));var util=require(_0xf62f('0x7'));var path=require(_0xf62f('0x8'));var sox=require('sox');var csv=require(_0xf62f('0x9'));var ejs=require(_0xf62f('0xa'));var fs=require('fs');var fs_extra=require(_0xf62f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf62f('0xc'));var jsforce=require(_0xf62f('0xd'));var deskjs=require(_0xf62f('0xe'));var toCsv=require(_0xf62f('0x9'));var querystring=require(_0xf62f('0xf'));var Papa=require(_0xf62f('0x10'));var Redis=require('ioredis');var authService=require(_0xf62f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf62f('0x12'));var hardwareService=require(_0xf62f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf62f('0x14'));var config=require(_0xf62f('0x15'));var licenseUtil=require(_0xf62f('0x16'));var db=require(_0xf62f('0x17'))['db'];config[_0xf62f('0x18')]=_[_0xf62f('0x19')](config[_0xf62f('0x18')],{'host':_0xf62f('0x1a'),'port':0x18eb});var socket=require(_0xf62f('0x1b'))(new Redis(config['redis']));require(_0xf62f('0x1c'))[_0xf62f('0x1d')](socket);function respondWithStatusCode(_0x172faf,_0x16f57b){_0x16f57b=_0x16f57b||0xcc;return function(_0x4f9723){if(_0x4f9723){return _0x172faf['sendStatus'](_0x16f57b);}return _0x172faf['status'](_0x16f57b)[_0xf62f('0x1e')]();};}function respondWithResult(_0x5cd973,_0x1badba){_0x1badba=_0x1badba||0xc8;return function(_0x1b8a4c){if(_0x1b8a4c){return _0x5cd973[_0xf62f('0x1f')](_0x1badba)[_0xf62f('0x20')](_0x1b8a4c);}};}function respondWithFilteredResult(_0x4ac698,_0x4adc55){return function(_0x379534){if(_0x379534){var _0x462b66=typeof _0x4adc55['offset']===_0xf62f('0x21')&&typeof _0x4adc55[_0xf62f('0x22')]===_0xf62f('0x21');var _0x1f0073=_0x379534[_0xf62f('0x23')];var _0x233009=_0x462b66?0x0:_0x4adc55[_0xf62f('0x24')];var _0x6e3326=_0x462b66?_0x379534[_0xf62f('0x23')]:_0x4adc55[_0xf62f('0x24')]+_0x4adc55[_0xf62f('0x22')];var _0x542399;if(_0x6e3326>=_0x1f0073){_0x6e3326=_0x1f0073;_0x542399=0xc8;}else{_0x542399=0xce;}_0x4ac698['status'](_0x542399);return _0x4ac698['set'](_0xf62f('0x25'),_0x233009+'-'+_0x6e3326+'/'+_0x1f0073)[_0xf62f('0x20')](_0x379534);}return null;};}function patchUpdates(_0x5791a7){return function(_0x1aaa98){try{jsonpatch[_0xf62f('0x26')](_0x1aaa98,_0x5791a7,!![]);}catch(_0xa85e09){return BPromise[_0xf62f('0x27')](_0xa85e09);}return _0x1aaa98['save']();};}function saveUpdates(_0x193d6f,_0x483ac4){return function(_0x5f224f){if(_0x5f224f){return _0x5f224f[_0xf62f('0x28')](_0x193d6f)['then'](function(_0x512985){return _0x512985;});}return null;};}function removeEntity(_0x319097,_0x1fa792){return function(_0x4c9624){if(_0x4c9624){return _0x4c9624['destroy']()['then'](function(){var _0x2e1f26=_0x4c9624['get']({'plain':!![]});var _0x3c8d64=_0xf62f('0x29');return db[_0xf62f('0x2a')][_0xf62f('0x2b')]({'where':{'type':_0x3c8d64,'resourceId':_0x2e1f26['id']}})[_0xf62f('0x2c')](function(){return _0x4c9624;});})[_0xf62f('0x2c')](function(){_0x319097[_0xf62f('0x1f')](0xcc)[_0xf62f('0x1e')]();});}};}function handleEntityNotFound(_0x31c28b,_0x37da66){return function(_0x1b2f33){if(!_0x1b2f33){_0x31c28b[_0xf62f('0x2d')](0x194);}return _0x1b2f33;};}function handleError(_0x6d874d,_0x477d58){_0x477d58=_0x477d58||0x1f4;return function(_0x503aa5){logger[_0xf62f('0x2e')](_0x503aa5[_0xf62f('0x2f')]);if(_0x503aa5[_0xf62f('0x30')]){delete _0x503aa5[_0xf62f('0x30')];}_0x6d874d['status'](_0x477d58)[_0xf62f('0x31')](_0x503aa5);};}exports[_0xf62f('0x32')]=function(_0x250f64,_0x10ab86){var _0x529d6b={},_0x567da2={},_0xd7e5b8={'count':0x0,'rows':[]};var _0x10e00f=_[_0xf62f('0x33')](db['SmsQueue']['rawAttributes'],function(_0x9c9b79){return{'name':_0x9c9b79[_0xf62f('0x34')],'type':_0x9c9b79[_0xf62f('0x35')]['key']};});_0x567da2['model']=_[_0xf62f('0x33')](_0x10e00f,_0xf62f('0x30'));_0x567da2['query']=_[_0xf62f('0x36')](_0x250f64[_0xf62f('0x37')]);_0x567da2[_0xf62f('0x38')]=_[_0xf62f('0x39')](_0x567da2[_0xf62f('0x3a')],_0x567da2[_0xf62f('0x37')]);_0x529d6b['attributes']=_[_0xf62f('0x39')](_0x567da2[_0xf62f('0x3a')],qs[_0xf62f('0x3b')](_0x250f64[_0xf62f('0x37')]['fields']));_0x529d6b[_0xf62f('0x3c')]=_0x529d6b[_0xf62f('0x3c')][_0xf62f('0x3d')]?_0x529d6b[_0xf62f('0x3c')]:_0x567da2[_0xf62f('0x3a')];if(!_0x250f64[_0xf62f('0x37')]['hasOwnProperty'](_0xf62f('0x3e'))){_0x529d6b[_0xf62f('0x22')]=qs[_0xf62f('0x22')](_0x250f64[_0xf62f('0x37')][_0xf62f('0x22')]);_0x529d6b[_0xf62f('0x24')]=qs['offset'](_0x250f64['query'][_0xf62f('0x24')]);}_0x529d6b[_0xf62f('0x3f')]=qs['sort'](_0x250f64[_0xf62f('0x37')][_0xf62f('0x40')]);_0x529d6b[_0xf62f('0x41')]=qs[_0xf62f('0x38')](_[_0xf62f('0x42')](_0x250f64[_0xf62f('0x37')],_0x567da2[_0xf62f('0x38')]),_0x10e00f);if(_0x250f64[_0xf62f('0x37')][_0xf62f('0x43')]){_0x529d6b['where']=_['merge'](_0x529d6b[_0xf62f('0x41')],{'$or':_['map'](_0x10e00f,function(_0x523f4e){if(_0x523f4e[_0xf62f('0x35')]!==_0xf62f('0x44')){var _0x132c0d={};_0x132c0d[_0x523f4e[_0xf62f('0x30')]]={'$like':'%'+_0x250f64[_0xf62f('0x37')]['filter']+'%'};return _0x132c0d;}})});}_0x529d6b=_[_0xf62f('0x45')]({},_0x529d6b,_0x250f64[_0xf62f('0x46')]);var _0x5dda0f={'where':_0x529d6b[_0xf62f('0x41')]};return db['SmsQueue'][_0xf62f('0x23')](_0x5dda0f)[_0xf62f('0x2c')](function(_0x4d7057){_0xd7e5b8[_0xf62f('0x23')]=_0x4d7057;if(_0x250f64[_0xf62f('0x37')][_0xf62f('0x47')]){_0x529d6b[_0xf62f('0x48')]=[{'all':!![]}];}return db[_0xf62f('0x49')]['findAll'](_0x529d6b);})[_0xf62f('0x2c')](function(_0x42b135){_0xd7e5b8[_0xf62f('0x4a')]=_0x42b135;return _0xd7e5b8;})['then'](respondWithFilteredResult(_0x10ab86,_0x529d6b))[_0xf62f('0x4b')](handleError(_0x10ab86,null));};exports[_0xf62f('0x4c')]=function(_0x192db2,_0x162c4d){var _0xc704cd={'raw':!![],'where':{'id':_0x192db2[_0xf62f('0x4d')]['id']}},_0x4e2c70={};_0x4e2c70[_0xf62f('0x3a')]=_[_0xf62f('0x36')](db[_0xf62f('0x49')][_0xf62f('0x4e')]);_0x4e2c70[_0xf62f('0x37')]=_[_0xf62f('0x36')](_0x192db2['query']);_0x4e2c70[_0xf62f('0x38')]=_[_0xf62f('0x39')](_0x4e2c70[_0xf62f('0x3a')],_0x4e2c70[_0xf62f('0x37')]);_0xc704cd[_0xf62f('0x3c')]=_[_0xf62f('0x39')](_0x4e2c70['model'],qs[_0xf62f('0x3b')](_0x192db2[_0xf62f('0x37')][_0xf62f('0x3b')]));_0xc704cd[_0xf62f('0x3c')]=_0xc704cd[_0xf62f('0x3c')][_0xf62f('0x3d')]?_0xc704cd[_0xf62f('0x3c')]:_0x4e2c70[_0xf62f('0x3a')];if(_0x192db2[_0xf62f('0x37')][_0xf62f('0x47')]){_0xc704cd[_0xf62f('0x48')]=[{'all':!![]}];}_0xc704cd=_['merge']({},_0xc704cd,_0x192db2[_0xf62f('0x46')]);return db[_0xf62f('0x49')][_0xf62f('0x4f')](_0xc704cd)[_0xf62f('0x2c')](handleEntityNotFound(_0x162c4d,null))[_0xf62f('0x2c')](respondWithResult(_0x162c4d,null))[_0xf62f('0x4b')](handleError(_0x162c4d,null));};exports['create']=function(_0xcf6a68,_0x1fc29f){return db[_0xf62f('0x49')][_0xf62f('0x50')](_0xcf6a68[_0xf62f('0x51')],{})[_0xf62f('0x2c')](function(_0x58e366){var _0x16eafc=_0xcf6a68[_0xf62f('0x52')][_0xf62f('0x53')]({'plain':!![]});if(!_0x16eafc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16eafc[_0xf62f('0x54')]===_0xf62f('0x52')){var _0x180236=_0x58e366['get']({'plain':!![]});var _0xf28ca7='SmsQueues';return db[_0xf62f('0x55')][_0xf62f('0x4f')]({'where':{'name':_0xf28ca7,'userProfileId':_0x16eafc[_0xf62f('0x56')]},'raw':!![]})[_0xf62f('0x2c')](function(_0x394112){if(_0x394112&&_0x394112[_0xf62f('0x57')]===0x0){return db[_0xf62f('0x2a')]['create']({'name':_0x180236[_0xf62f('0x30')],'resourceId':_0x180236['id'],'type':_0x394112[_0xf62f('0x30')],'sectionId':_0x394112['id']},{})[_0xf62f('0x2c')](function(){return _0x58e366;});}else{return _0x58e366;}})[_0xf62f('0x4b')](function(_0x53df90){logger[_0xf62f('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53df90);throw _0x53df90;});}return _0x58e366;})[_0xf62f('0x2c')](respondWithResult(_0x1fc29f,0xc9))[_0xf62f('0x4b')](handleError(_0x1fc29f,null));};exports[_0xf62f('0x28')]=function(_0x515a87,_0x409882){if(_0x515a87[_0xf62f('0x51')]['id']){delete _0x515a87[_0xf62f('0x51')]['id'];}return db[_0xf62f('0x49')]['find']({'where':{'id':_0x515a87['params']['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x409882,null))[_0xf62f('0x2c')](saveUpdates(_0x515a87[_0xf62f('0x51')],null))[_0xf62f('0x2c')](respondWithResult(_0x409882,null))[_0xf62f('0x4b')](handleError(_0x409882,null));};exports[_0xf62f('0x2b')]=function(_0x22d403,_0x56604a){return db[_0xf62f('0x49')][_0xf62f('0x4f')]({'where':{'id':_0x22d403[_0xf62f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x56604a,null))[_0xf62f('0x2c')](removeEntity(_0x56604a,null))[_0xf62f('0x4b')](handleError(_0x56604a,null));};exports[_0xf62f('0x58')]=function(_0x36e574,_0x1d861d){return db[_0xf62f('0x49')]['describe']()[_0xf62f('0x2c')](respondWithResult(_0x1d861d,null))['catch'](handleError(_0x1d861d,null));};exports['getMembers']=function(_0x413fa6,_0x460b98,_0x5c4259){var _0x8148b1={'raw':!![],'where':{}},_0x33c10b={},_0x14937d;return db[_0xf62f('0x49')][_0xf62f('0x59')]({'where':{'id':_0x413fa6['params']['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x460b98,null))[_0xf62f('0x2c')](function(_0x32c9e9){if(_0x32c9e9){_0x14937d=_0x32c9e9[_0xf62f('0x53')]({'plain':!![]});_0x33c10b['model']=_['keys'](db[_0xf62f('0x5a')][_0xf62f('0x4e')]);_0x33c10b[_0xf62f('0x37')]=_[_0xf62f('0x36')](_0x413fa6[_0xf62f('0x37')]);_0x33c10b['filters']=_[_0xf62f('0x39')](_0x33c10b['model'],_0x33c10b[_0xf62f('0x37')]);_0x8148b1[_0xf62f('0x3c')]=_[_0xf62f('0x39')](_0x33c10b[_0xf62f('0x3a')],qs[_0xf62f('0x3b')](_0x413fa6[_0xf62f('0x37')][_0xf62f('0x3b')]));_0x8148b1['attributes']=_0x8148b1[_0xf62f('0x3c')]['length']?_0x8148b1[_0xf62f('0x3c')]:_0x33c10b[_0xf62f('0x3a')];if(!_0x413fa6['query'][_0xf62f('0x5b')](_0xf62f('0x3e'))){_0x8148b1[_0xf62f('0x22')]=qs['limit'](_0x413fa6[_0xf62f('0x37')]['limit']);_0x8148b1['offset']=qs[_0xf62f('0x24')](_0x413fa6['query'][_0xf62f('0x24')]);}_0x8148b1['order']=qs[_0xf62f('0x40')](_0x413fa6[_0xf62f('0x37')][_0xf62f('0x40')]);_0x8148b1['where']=qs[_0xf62f('0x38')](_[_0xf62f('0x42')](_0x413fa6['query'],_0x33c10b[_0xf62f('0x38')]));_0x8148b1[_0xf62f('0x41')][_0xf62f('0x5c')]=_0x32c9e9['id'];if(_0x413fa6[_0xf62f('0x37')][_0xf62f('0x43')]){_0x8148b1[_0xf62f('0x41')]=_[_0xf62f('0x45')](_0x8148b1[_0xf62f('0x41')],{'$or':_[_0xf62f('0x33')](_0x8148b1[_0xf62f('0x3c')],function(_0x3bf07d){var _0x1d870e={};_0x1d870e[_0x3bf07d]={'$like':'%'+_0x413fa6[_0xf62f('0x37')]['filter']+'%'};return _0x1d870e;})});}_0x8148b1=_[_0xf62f('0x45')]({},_0x8148b1,_0x413fa6[_0xf62f('0x46')]);return db[_0xf62f('0x5a')][_0xf62f('0x5d')](_0x8148b1);}})['then'](function(_0x4c9a2a){if(_0x4c9a2a){return db[_0xf62f('0x5e')]['findAndCountAll']({'where':{'id':_[_0xf62f('0x33')](_0x4c9a2a,_0xf62f('0x5f')),'role':_0xf62f('0x60')},'attributes':['id',_0xf62f('0x30'),'smsPause',_0xf62f('0x61'),_0xf62f('0x62')]});}})['then'](function(_0x12010b){if(_0x12010b){return{'count':_0x12010b['count'],'rows':_['map'](_0x12010b['rows'],function(_0xc206cd){return{'membername':_0xc206cd[_0xf62f('0x30')],'UserId':_0xc206cd['id'],'queue_name':_0x14937d[_0xf62f('0x30')],'SmsQueueId':_0x14937d['id'],'interface':util['format'](_0xf62f('0x63'),_0xf62f('0x64'),_0xc206cd[_0xf62f('0x30')]),'penalty':0x0,'paused':_0xc206cd['smsPause'],'createdAt':_0xc206cd['createdAt'],'updatedAt':_0xc206cd[_0xf62f('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf62f('0x2c')](respondWithFilteredResult(_0x460b98,_0x8148b1))[_0xf62f('0x4b')](handleError(_0x460b98,null));};exports[_0xf62f('0x65')]=function(_0x4348c0,_0x536bd9,_0x55034b){var _0x50ee86={};var _0x357172={};var _0x250616;var _0x5264d7;return db[_0xf62f('0x49')][_0xf62f('0x59')]({'where':{'id':_0x4348c0['params']['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x536bd9,null))['then'](function(_0x445d8a){if(_0x445d8a){_0x250616=_0x445d8a;_0x357172[_0xf62f('0x3a')]=_[_0xf62f('0x36')](db['Team'][_0xf62f('0x4e')]);_0x357172[_0xf62f('0x37')]=_[_0xf62f('0x36')](_0x4348c0[_0xf62f('0x37')]);_0x357172[_0xf62f('0x38')]=_['intersection'](_0x357172['model'],_0x357172[_0xf62f('0x37')]);_0x50ee86['attributes']=_['intersection'](_0x357172[_0xf62f('0x3a')],qs[_0xf62f('0x3b')](_0x4348c0[_0xf62f('0x37')][_0xf62f('0x3b')]));_0x50ee86[_0xf62f('0x3c')]=_0x50ee86[_0xf62f('0x3c')]['length']?_0x50ee86[_0xf62f('0x3c')]:_0x357172[_0xf62f('0x3a')];_0x50ee86[_0xf62f('0x3f')]=qs[_0xf62f('0x40')](_0x4348c0['query']['sort']);_0x50ee86[_0xf62f('0x41')]=qs['filters'](_[_0xf62f('0x42')](_0x4348c0[_0xf62f('0x37')],_0x357172['filters']));if(_0x4348c0[_0xf62f('0x37')][_0xf62f('0x43')]){_0x50ee86['where']=_[_0xf62f('0x45')](_0x50ee86[_0xf62f('0x41')],{'$or':_[_0xf62f('0x33')](_0x50ee86['attributes'],function(_0x7cf301){var _0x278f9e={};_0x278f9e[_0x7cf301]={'$like':'%'+_0x4348c0[_0xf62f('0x37')][_0xf62f('0x43')]+'%'};return _0x278f9e;})});}_0x50ee86=_['merge']({},_0x50ee86,_0x4348c0[_0xf62f('0x46')]);return _0x250616['getTeams'](_0x50ee86);}})[_0xf62f('0x2c')](function(_0x2bfda0){if(_0x2bfda0){_0x5264d7=_0x2bfda0['length'];if(!_0x4348c0[_0xf62f('0x37')]['hasOwnProperty']('nolimit')){_0x50ee86[_0xf62f('0x22')]=qs['limit'](_0x4348c0['query'][_0xf62f('0x22')]);_0x50ee86['offset']=qs[_0xf62f('0x24')](_0x4348c0[_0xf62f('0x37')][_0xf62f('0x24')]);}return _0x250616['getTeams'](_0x50ee86);}})[_0xf62f('0x2c')](function(_0xabfd85){if(_0xabfd85){return _0xabfd85?{'count':_0x5264d7,'rows':_0xabfd85}:null;}})[_0xf62f('0x2c')](respondWithResult(_0x536bd9,null))[_0xf62f('0x4b')](handleError(_0x536bd9,null));};exports[_0xf62f('0x66')]=function(_0x294528,_0x5b9a2d,_0x39b37d){var _0x1c087f=_0x294528[_0xf62f('0x51')]['ids'];return db[_0xf62f('0x67')][_0xf62f('0x5d')]({'where':{'id':_0x1c087f},'attributes':['id'],'include':[{'model':db[_0xf62f('0x5e')],'as':_0xf62f('0x68'),'attributes':['id',_0xf62f('0x30'),_0xf62f('0x69'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x179a64){if(_0x179a64){var _0x157246=_[_0xf62f('0x6a')](_0x179a64,function(_0x4865eb){var _0x231354=_0x4865eb[_0xf62f('0x53')]({'plain':!![]});return _0x231354['Agents'];});return db[_0xf62f('0x49')][_0xf62f('0x4f')]({'where':{'id':_0x294528[_0xf62f('0x4d')]['id']}})['then'](function(_0xbed3d2){return db[_0xf62f('0x6b')][_0xf62f('0x6c')](function(_0x4bda67){return _0xbed3d2[_0xf62f('0x66')](_0x1c087f,{'transaction':_0x4bda67})[_0xf62f('0x2c')](function(){return BPromise[_0xf62f('0x6d')](_0x157246,function(_0x2761ac){return db[_0xf62f('0x5a')][_0xf62f('0x6e')]({'where':{'UserId':_0x2761ac['id'],'SmsQueueId':_0x294528[_0xf62f('0x4d')]['id']},'transaction':_0x4bda67});});})['then'](function(){_0x157246[_0xf62f('0x6f')](function(_0x573b63){socket[_0xf62f('0x70')](_0xf62f('0x71'),{'UserId':_0x573b63['id'],'SmsQueueId':_0xbed3d2['id']});});});});});}})[_0xf62f('0x2c')](respondWithStatusCode(_0x5b9a2d,null))['catch'](handleError(_0x5b9a2d,null));};exports[_0xf62f('0x72')]=function(_0x1d63b4,_0x454f2e,_0x63311){return db[_0xf62f('0x67')]['findAll']({'where':{'id':_0x1d63b4[_0xf62f('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf62f('0x5e')],'as':_0xf62f('0x68'),'attributes':['id'],'raw':!![]}]})[_0xf62f('0x2c')](handleEntityNotFound(_0x454f2e,null))[_0xf62f('0x2c')](function(_0x69b997){var _0x365257=_[_0xf62f('0x33')](_0x69b997,'id');var _0x3486a6=[];var _0x5634b5=[];var _0x2404f5=squel[_0xf62f('0x73')]();_0x2404f5[_0xf62f('0x74')](_0xf62f('0x75'))[_0xf62f('0x76')](_0xf62f('0x77'),'tq')[_0xf62f('0x78')](_0xf62f('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf62f('0x41')](_0xf62f('0x7a'),_0x1d63b4[_0xf62f('0x4d')]['id']);for(var _0x55a8ea=0x0;_0x55a8ea<_0x69b997[_0xf62f('0x3d')];_0x55a8ea+=0x1){let _0x58145e=_0x69b997[_0x55a8ea];for(var _0x53c8ba=0x0;_0x53c8ba<_0x58145e[_0xf62f('0x68')][_0xf62f('0x3d')];_0x53c8ba+=0x1){let _0x22ee66=_0x58145e[_0xf62f('0x68')][_0x53c8ba];var _0x599b1e=_0x2404f5['clone']();_0x599b1e[_0xf62f('0x41')](_0xf62f('0x7b'),_0x22ee66['id']);_0x5634b5[_0xf62f('0x7c')](db[_0xf62f('0x6b')][_0xf62f('0x37')](_0x599b1e[_0xf62f('0x7d')](),{'type':db['sequelize'][_0xf62f('0x7e')][_0xf62f('0x7f')]})[_0xf62f('0x2c')](function(_0x280cc8){if(_0x280cc8[_0xf62f('0x3d')]===0x1){return _0x22ee66['id'];}else{var _0x5c9742=_[_0xf62f('0x80')](_[_0xf62f('0x33')](_0x280cc8,_0xf62f('0x81')),function(_0x48d608){return _[_0xf62f('0x82')](_0x365257,_0x48d608);});if(_0x5c9742){return _0x22ee66['id'];}}}));}}return BPromise[_0xf62f('0x83')](_0x5634b5)[_0xf62f('0x2c')](function(_0x508e47){_0x3486a6=_(_0x3486a6)[_0xf62f('0x84')](_0x508e47)[_0xf62f('0x85')]()[_0xf62f('0x86')]();return db['SmsQueue']['find']({'where':{'id':_0x1d63b4[_0xf62f('0x4d')]['id']}})[_0xf62f('0x2c')](function(_0x5483e1){return db[_0xf62f('0x6b')][_0xf62f('0x6c')](function(_0xb593b){return _0x5483e1[_0xf62f('0x72')](_0x1d63b4[_0xf62f('0x37')][_0xf62f('0x87')],{'transaction':_0xb593b})['then'](function(){if(!_[_0xf62f('0x88')](_0x3486a6)){return _0x5483e1['removeAgents'](_0x3486a6,{'transaction':_0xb593b});}})[_0xf62f('0x2c')](function(){_0x3486a6[_0xf62f('0x6f')](function(_0x37bc75){socket[_0xf62f('0x70')]('userSmsQueue:remove',{'UserId':_0x37bc75,'SmsQueueId':_0x5483e1['id']});});});});});});})['then'](respondWithStatusCode(_0x454f2e,null))[_0xf62f('0x4b')](handleError(_0x454f2e,null));};exports[_0xf62f('0x89')]=function(_0x2246ed,_0x5b5bda,_0x52065b){return db[_0xf62f('0x49')][_0xf62f('0x4f')]({'where':{'id':_0x2246ed[_0xf62f('0x4d')]['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x5b5bda,null))['then'](function(_0x229326){if(_0x229326){return _0x229326[_0xf62f('0x89')](_0x2246ed['body'][_0xf62f('0x87')],_['omit'](_0x2246ed[_0xf62f('0x51')],[_0xf62f('0x87'),'id'])||{})['spread'](function(_0x4a7734){for(var _0xf34599=0x0;_0xf34599<_0x2246ed[_0xf62f('0x51')][_0xf62f('0x87')]['length'];_0xf34599+=0x1){socket[_0xf62f('0x70')](_0xf62f('0x71'),{'UserId':Number(_0x2246ed[_0xf62f('0x51')][_0xf62f('0x87')][_0xf34599]),'SmsQueueId':Number(_0x2246ed[_0xf62f('0x4d')]['id'])});}return _0x4a7734;});}})[_0xf62f('0x2c')](respondWithResult(_0x5b5bda,null))['catch'](handleError(_0x5b5bda,null));};exports['removeAgents']=function(_0x105fbb,_0x26331c,_0x551d9f){return db[_0xf62f('0x49')][_0xf62f('0x4f')]({'where':{'id':_0x105fbb[_0xf62f('0x4d')]['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x26331c,null))[_0xf62f('0x2c')](function(_0x111d66){if(_0x111d66){return _0x111d66[_0xf62f('0x8a')](_0x105fbb[_0xf62f('0x37')][_0xf62f('0x87')])[_0xf62f('0x2c')](function(){if(_[_0xf62f('0x8b')](_0x105fbb[_0xf62f('0x37')]['ids'])){for(var _0x46fa33=0x0;_0x46fa33<_0x105fbb[_0xf62f('0x37')][_0xf62f('0x87')][_0xf62f('0x3d')];_0x46fa33+=0x1){socket[_0xf62f('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x105fbb[_0xf62f('0x37')][_0xf62f('0x87')][_0x46fa33]),'SmsQueueId':Number(_0x105fbb[_0xf62f('0x4d')]['id'])});}}else{socket['emit'](_0xf62f('0x8c'),{'UserId':Number(_0x105fbb[_0xf62f('0x37')]['ids']),'SmsQueueId':Number(_0x105fbb[_0xf62f('0x4d')]['id'])});}});}})[_0xf62f('0x2c')](respondWithStatusCode(_0x26331c,null))[_0xf62f('0x4b')](handleError(_0x26331c,null));};exports[_0xf62f('0x8d')]=function(_0x20cb22,_0x5287cb,_0xc5297){var _0x4b484f={};var _0x2e414e={};var _0x534e30;var _0x149a6a;return db[_0xf62f('0x49')][_0xf62f('0x59')]({'where':{'id':_0x20cb22[_0xf62f('0x4d')]['id']}})[_0xf62f('0x2c')](handleEntityNotFound(_0x5287cb,null))[_0xf62f('0x2c')](function(_0x55ee69){if(_0x55ee69){_0x534e30=_0x55ee69;_0x2e414e[_0xf62f('0x3a')]=_[_0xf62f('0x36')](db['User']['rawAttributes']);_0x2e414e['query']=_[_0xf62f('0x36')](_0x20cb22['query']);_0x2e414e['filters']=_[_0xf62f('0x39')](_0x2e414e['model'],_0x2e414e['query']);_0x4b484f['attributes']=_[_0xf62f('0x39')](_0x2e414e[_0xf62f('0x3a')],qs[_0xf62f('0x3b')](_0x20cb22[_0xf62f('0x37')][_0xf62f('0x3b')]));_0x4b484f[_0xf62f('0x3c')]=_0x4b484f[_0xf62f('0x3c')][_0xf62f('0x3d')]?_0x4b484f[_0xf62f('0x3c')]:_0x2e414e[_0xf62f('0x3a')];_0x4b484f[_0xf62f('0x3f')]=qs[_0xf62f('0x40')](_0x20cb22['query']['sort']);_0x4b484f[_0xf62f('0x41')]=qs[_0xf62f('0x38')](_['pick'](_0x20cb22[_0xf62f('0x37')],_0x2e414e[_0xf62f('0x38')]));if(_0x20cb22[_0xf62f('0x37')]['filter']){_0x4b484f[_0xf62f('0x41')]=_['merge'](_0x4b484f[_0xf62f('0x41')],{'$or':_[_0xf62f('0x33')](_0x4b484f[_0xf62f('0x3c')],function(_0x2f57f9){var _0x48380d={};_0x48380d[_0x2f57f9]={'$like':'%'+_0x20cb22['query'][_0xf62f('0x43')]+'%'};return _0x48380d;})});}_0x4b484f=_[_0xf62f('0x45')]({},_0x4b484f,_0x20cb22[_0xf62f('0x46')]);return _0x534e30[_0xf62f('0x8d')](_0x4b484f);}})[_0xf62f('0x2c')](function(_0x44dd0e){if(_0x44dd0e){_0x149a6a=_0x44dd0e['length'];if(!_0x20cb22['query'][_0xf62f('0x5b')](_0xf62f('0x3e'))){_0x4b484f[_0xf62f('0x22')]=qs[_0xf62f('0x22')](_0x20cb22[_0xf62f('0x37')]['limit']);_0x4b484f[_0xf62f('0x24')]=qs['offset'](_0x20cb22[_0xf62f('0x37')][_0xf62f('0x24')]);}return _0x534e30[_0xf62f('0x8d')](_0x4b484f);}})[_0xf62f('0x2c')](function(_0x56c88c){if(_0x56c88c){return _0x56c88c?{'count':_0x149a6a,'rows':_0x56c88c}:null;}})['then'](respondWithResult(_0x5287cb,null))[_0xf62f('0x4b')](handleError(_0x5287cb,null));};
\ No newline at end of file
index 0dd7e26..cda36f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafd3=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3f99e1,_0x43cbc3){var _0x5d299f=function(_0x14f910){while(--_0x14f910){_0x3f99e1['push'](_0x3f99e1['shift']());}};_0x5d299f(++_0x43cbc3);}(_0xafd3,0x95));var _0x3afd=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xafd3[_0x5beda8];return _0x2aa042;};'use strict';var EventEmitter=require(_0x3afd('0x0'));var SmsQueue=require(_0x3afd('0x1'))['db'][_0x3afd('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3afd('0x3')](0x0);var events={'afterCreate':_0x3afd('0x4'),'afterUpdate':_0x3afd('0x5'),'afterDestroy':_0x3afd('0x6')};function emitEvent(_0x4c2b83){return function(_0x3e72ba,_0x2cf230,_0x477408){SmsQueueEvents[_0x3afd('0x7')](_0x4c2b83+':'+_0x3e72ba['id'],_0x3e72ba);SmsQueueEvents[_0x3afd('0x7')](_0x4c2b83,_0x3e72ba);_0x477408(null);};}for(var e in events){if(events[_0x3afd('0x8')](e)){var event=events[e];SmsQueue[_0x3afd('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0xc7d6=['hasOwnProperty','hook','events','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x21171a,_0x125ebd){var _0x4acd86=function(_0x3d4c97){while(--_0x3d4c97){_0x21171a['push'](_0x21171a['shift']());}};_0x4acd86(++_0x125ebd);}(_0xc7d6,0xb2));var _0x6c7d=function(_0x1e09a0,_0x2a9991){_0x1e09a0=_0x1e09a0-0x0;var _0x2cabf1=_0xc7d6[_0x1e09a0];return _0x2cabf1;};'use strict';var EventEmitter=require(_0x6c7d('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x6c7d('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6c7d('0x2')](0x0);var events={'afterCreate':_0x6c7d('0x3'),'afterUpdate':_0x6c7d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3150c5){return function(_0x150ac3,_0x22d0d9,_0x3396bb){SmsQueueEvents[_0x6c7d('0x5')](_0x3150c5+':'+_0x150ac3['id'],_0x150ac3);SmsQueueEvents[_0x6c7d('0x5')](_0x3150c5,_0x150ac3);_0x3396bb(null);};}for(var e in events){if(events[_0x6c7d('0x6')](e)){var event=events[e];SmsQueue[_0x6c7d('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index 07f1a58..20d7b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcbc=['util','bluebird','rimraf','./smsQueue.attributes','define','SmsQueue','sms_queues'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbcbc,0xa1));var _0xcbcb=function(_0x2340e4,_0x36c3aa){_0x2340e4=_0x2340e4-0x0;var _0x4070b5=_0xbcbc[_0x2340e4];return _0x4070b5;};'use strict';var _=require('lodash');var util=require(_0xcbcb('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcbcb('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcbcb('0x2'));var config=require('../../config/environment');var attributes=require(_0xcbcb('0x3'));module['exports']=function(_0x453a57,_0x4ddc0d){return _0x453a57[_0xcbcb('0x4')](_0xcbcb('0x5'),attributes,{'tableName':_0xcbcb('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x951b=['moment','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','../../config/logger','api'];(function(_0x4a5f89,_0x101c01){var _0x3ffb4d=function(_0x3ffd3f){while(--_0x3ffd3f){_0x4a5f89['push'](_0x4a5f89['shift']());}};_0x3ffb4d(++_0x101c01);}(_0x951b,0x17c));var _0xb951=function(_0x4fdf03,_0x2d2d14){_0x4fdf03=_0x4fdf03-0x0;var _0x426360=_0x951b[_0x4fdf03];return _0x426360;};'use strict';var _=require(_0xb951('0x0'));var util=require(_0xb951('0x1'));var logger=require(_0xb951('0x2'))(_0xb951('0x3'));var moment=require(_0xb951('0x4'));var BPromise=require('bluebird');var rp=require(_0xb951('0x5'));var fs=require('fs');var path=require(_0xb951('0x6'));var rimraf=require(_0xb951('0x7'));var config=require('../../config/environment');var attributes=require(_0xb951('0x8'));module[_0xb951('0x9')]=function(_0xb8b686,_0x579c80){return _0xb8b686[_0xb951('0xa')](_0xb951('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 18ab854..43d2482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe53f=['message','info','result','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x390b5f,_0x4b8174){var _0x1c0901=function(_0x3d6e9f){while(--_0x3d6e9f){_0x390b5f['push'](_0x390b5f['shift']());}};_0x1c0901(++_0x4b8174);}(_0xe53f,0x1cd));var _0xfe53=function(_0x3e5e70,_0x14eb27){_0x3e5e70=_0x3e5e70-0x0;var _0x2e61b3=_0xe53f[_0x3e5e70];return _0x2e61b3;};'use strict';var _=require(_0xfe53('0x0'));var util=require(_0xfe53('0x1'));var moment=require('moment');var BPromise=require(_0xfe53('0x2'));var rs=require(_0xfe53('0x3'));var fs=require('fs');var Redis=require(_0xfe53('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfe53('0x5'));var config=require('../../config/environment');var jayson=require(_0xfe53('0x6'));var client=jayson[_0xfe53('0x7')]['http']({'port':0x232a});config[_0xfe53('0x8')]=_[_0xfe53('0x9')](config[_0xfe53('0x8')],{'host':_0xfe53('0xa'),'port':0x18eb});var socket=require(_0xfe53('0xb'))(new Redis(config[_0xfe53('0x8')]));require('./smsQueue.socket')[_0xfe53('0xc')](socket);function respondWithRpcPromise(_0xcb6040,_0x1f7b25,_0x168d53){return new BPromise(function(_0x37cc7c,_0xd29716){return client['request'](_0xcb6040,_0x168d53)[_0xfe53('0xd')](function(_0x3c065d){logger['info'](_0xfe53('0xe'),_0x1f7b25,_0xfe53('0xf'));logger[_0xfe53('0x10')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1f7b25,_0xfe53('0xf'),JSON[_0xfe53('0x11')](_0x3c065d));if(_0x3c065d[_0xfe53('0x12')]){if(_0x3c065d['error'][_0xfe53('0x13')]===0x1f4){logger['error'](_0xfe53('0xe'),_0x1f7b25,_0x3c065d[_0xfe53('0x12')]['message']);return _0xd29716(_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);}logger[_0xfe53('0x12')](_0xfe53('0xe'),_0x1f7b25,_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);return _0x37cc7c(_0x3c065d[_0xfe53('0x12')][_0xfe53('0x14')]);}else{logger[_0xfe53('0x15')](_0xfe53('0xe'),_0x1f7b25,'request\x20sent');_0x37cc7c(_0x3c065d[_0xfe53('0x16')][_0xfe53('0x14')]);}})[_0xfe53('0x17')](function(_0x53c149){logger[_0xfe53('0x12')](_0xfe53('0xe'),_0x1f7b25,_0x53c149);_0xd29716(_0x53c149);});});}exports['GetSmsQueue']=function(_0x13573d){var _0x2d478e=this;return new Promise(function(_0x53af0d,_0x3723e7){return db['SmsQueue'][_0xfe53('0x18')]({'raw':_0x13573d['options']?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1a')]===undefined?!![]:![]:!![],'where':_0x13573d[_0xfe53('0x19')]?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1b')]||null:null,'attributes':_0x13573d['options']?_0x13573d['options'][_0xfe53('0x1c')]||null:null,'limit':_0x13573d['options']?_0x13573d[_0xfe53('0x19')][_0xfe53('0x1d')]||null:null,'include':_0x13573d[_0xfe53('0x19')]?_0x13573d[_0xfe53('0x19')]['include']?_[_0xfe53('0x1e')](_0x13573d[_0xfe53('0x19')][_0xfe53('0x1f')],function(_0x3ef24c){return{'model':db[_0x3ef24c[_0xfe53('0x20')]],'as':_0x3ef24c['as'],'attributes':_0x3ef24c[_0xfe53('0x1c')],'include':_0x3ef24c[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x3ef24c['include'],function(_0x148530){return{'model':db[_0x148530['model']],'as':_0x148530['as'],'attributes':_0x148530['attributes'],'include':_0x148530[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x148530['include'],function(_0xc9457a){return{'model':db[_0xc9457a[_0xfe53('0x20')]],'as':_0xc9457a['as'],'attributes':_0xc9457a[_0xfe53('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe53('0xd')](function(_0x1b5045){logger[_0xfe53('0x15')](_0xfe53('0x21'),_0x13573d);logger[_0xfe53('0x10')](_0xfe53('0x21'),_0x13573d,JSON['stringify'](_0x1b5045));_0x53af0d(_0x1b5045);})[_0xfe53('0x17')](function(_0x52d4c2){logger['error'](_0xfe53('0x21'),_0x52d4c2[_0xfe53('0x14')],_0x13573d);_0x3723e7(_0x2d478e[_0xfe53('0x12')](0x1f4,_0x52d4c2[_0xfe53('0x14')]));});});};exports[_0xfe53('0x22')]=function(_0x5c72e3){var _0x5c607e=this;return new Promise(function(_0x53d973,_0x3fad55){return db[_0xfe53('0x23')][_0xfe53('0x24')]({'raw':_0x5c72e3[_0xfe53('0x19')]?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c72e3['options']?_0x5c72e3['options'][_0xfe53('0x1b')]||null:null,'attributes':_0x5c72e3[_0xfe53('0x19')]?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1c')]||null:null,'include':_0x5c72e3['options']?_0x5c72e3[_0xfe53('0x19')][_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x5c72e3[_0xfe53('0x19')]['include'],function(_0x4c935a){return{'model':db[_0x4c935a[_0xfe53('0x20')]],'as':_0x4c935a['as'],'attributes':_0x4c935a['attributes'],'include':_0x4c935a[_0xfe53('0x1f')]?_[_0xfe53('0x1e')](_0x4c935a['include'],function(_0x5cab78){return{'model':db[_0x5cab78['model']],'as':_0x5cab78['as'],'attributes':_0x5cab78[_0xfe53('0x1c')],'include':_0x5cab78['include']?_[_0xfe53('0x1e')](_0x5cab78[_0xfe53('0x1f')],function(_0x27492a){return{'model':db[_0x27492a[_0xfe53('0x20')]],'as':_0x27492a['as'],'attributes':_0x27492a['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe53('0xd')](function(_0x137e8c){logger['info'](_0xfe53('0x22'),_0x5c72e3);logger['debug']('ShowSmsQueue',_0x5c72e3,JSON[_0xfe53('0x11')](_0x137e8c));_0x53d973(_0x137e8c);})['catch'](function(_0x225b46){logger[_0xfe53('0x12')](_0xfe53('0x22'),_0x225b46[_0xfe53('0x14')],_0x5c72e3);_0x3fad55(_0x5c607e[_0xfe53('0x12')](0x1f4,_0x225b46[_0xfe53('0x14')]));});});};
\ No newline at end of file
+var _0xa7f8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','limit','include','model','map','attributes','ShowSmsQueue','find','raw','where','lodash'];(function(_0x3df355,_0x42621f){var _0x2b23ba=function(_0x1429fa){while(--_0x1429fa){_0x3df355['push'](_0x3df355['shift']());}};_0x2b23ba(++_0x42621f);}(_0xa7f8,0xcc));var _0x8a7f=function(_0x54d52c,_0x55b8d9){_0x54d52c=_0x54d52c-0x0;var _0x28f99e=_0xa7f8[_0x54d52c];return _0x28f99e;};'use strict';var _=require(_0x8a7f('0x0'));var util=require('util');var moment=require(_0x8a7f('0x1'));var BPromise=require(_0x8a7f('0x2'));var rs=require(_0x8a7f('0x3'));var fs=require('fs');var Redis=require(_0x8a7f('0x4'));var db=require(_0x8a7f('0x5'))['db'];var utils=require(_0x8a7f('0x6'));var logger=require(_0x8a7f('0x7'))(_0x8a7f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a7f('0x9')]['http']({'port':0x232a});config[_0x8a7f('0xa')]=_[_0x8a7f('0xb')](config['redis'],{'host':_0x8a7f('0xc'),'port':0x18eb});var socket=require(_0x8a7f('0xd'))(new Redis(config[_0x8a7f('0xa')]));require(_0x8a7f('0xe'))[_0x8a7f('0xf')](socket);function respondWithRpcPromise(_0xe1d01f,_0x59dbd6,_0x4628d4){return new BPromise(function(_0x3c8574,_0x17df5e){return client[_0x8a7f('0x10')](_0xe1d01f,_0x4628d4)[_0x8a7f('0x11')](function(_0x1509f5){logger[_0x8a7f('0x12')](_0x8a7f('0x13'),_0x59dbd6,_0x8a7f('0x14'));logger[_0x8a7f('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x59dbd6,_0x8a7f('0x14'),JSON[_0x8a7f('0x16')](_0x1509f5));if(_0x1509f5[_0x8a7f('0x17')]){if(_0x1509f5['error'][_0x8a7f('0x18')]===0x1f4){logger[_0x8a7f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x59dbd6,_0x1509f5[_0x8a7f('0x17')]['message']);return _0x17df5e(_0x1509f5[_0x8a7f('0x17')][_0x8a7f('0x19')]);}logger['error'](_0x8a7f('0x13'),_0x59dbd6,_0x1509f5[_0x8a7f('0x17')][_0x8a7f('0x19')]);return _0x3c8574(_0x1509f5[_0x8a7f('0x17')][_0x8a7f('0x19')]);}else{logger[_0x8a7f('0x12')](_0x8a7f('0x13'),_0x59dbd6,'request\x20sent');_0x3c8574(_0x1509f5[_0x8a7f('0x1a')]['message']);}})[_0x8a7f('0x1b')](function(_0xe2dba5){logger[_0x8a7f('0x17')](_0x8a7f('0x13'),_0x59dbd6,_0xe2dba5);_0x17df5e(_0xe2dba5);});});}exports[_0x8a7f('0x1c')]=function(_0x58d199){var _0x42918a=this;return new Promise(function(_0xd844fd,_0x10a67e){return db[_0x8a7f('0x1d')][_0x8a7f('0x1e')]({'raw':_0x58d199[_0x8a7f('0x1f')]?_0x58d199[_0x8a7f('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x58d199[_0x8a7f('0x1f')]?_0x58d199[_0x8a7f('0x1f')]['where']||null:null,'attributes':_0x58d199['options']?_0x58d199[_0x8a7f('0x1f')]['attributes']||null:null,'limit':_0x58d199['options']?_0x58d199[_0x8a7f('0x1f')][_0x8a7f('0x20')]||null:null,'include':_0x58d199[_0x8a7f('0x1f')]?_0x58d199[_0x8a7f('0x1f')][_0x8a7f('0x21')]?_['map'](_0x58d199[_0x8a7f('0x1f')]['include'],function(_0x3b750c){return{'model':db[_0x3b750c[_0x8a7f('0x22')]],'as':_0x3b750c['as'],'attributes':_0x3b750c['attributes'],'include':_0x3b750c[_0x8a7f('0x21')]?_[_0x8a7f('0x23')](_0x3b750c['include'],function(_0x1d1f10){return{'model':db[_0x1d1f10[_0x8a7f('0x22')]],'as':_0x1d1f10['as'],'attributes':_0x1d1f10[_0x8a7f('0x24')],'include':_0x1d1f10['include']?_[_0x8a7f('0x23')](_0x1d1f10[_0x8a7f('0x21')],function(_0x2b9c52){return{'model':db[_0x2b9c52[_0x8a7f('0x22')]],'as':_0x2b9c52['as'],'attributes':_0x2b9c52[_0x8a7f('0x24')]};}):[]};}):[]};}):[]:[]})[_0x8a7f('0x11')](function(_0x3135e5){logger[_0x8a7f('0x12')](_0x8a7f('0x1c'),_0x58d199);logger[_0x8a7f('0x15')]('GetSmsQueue',_0x58d199,JSON['stringify'](_0x3135e5));_0xd844fd(_0x3135e5);})[_0x8a7f('0x1b')](function(_0x2d798f){logger[_0x8a7f('0x17')]('GetSmsQueue',_0x2d798f['message'],_0x58d199);_0x10a67e(_0x42918a['error'](0x1f4,_0x2d798f['message']));});});};exports[_0x8a7f('0x25')]=function(_0x13b229){var _0x1c160b=this;return new Promise(function(_0x485787,_0x5b1bd8){return db[_0x8a7f('0x1d')][_0x8a7f('0x26')]({'raw':_0x13b229[_0x8a7f('0x1f')]?_0x13b229[_0x8a7f('0x1f')][_0x8a7f('0x27')]===undefined?!![]:![]:!![],'where':_0x13b229['options']?_0x13b229[_0x8a7f('0x1f')][_0x8a7f('0x28')]||null:null,'attributes':_0x13b229[_0x8a7f('0x1f')]?_0x13b229[_0x8a7f('0x1f')]['attributes']||null:null,'include':_0x13b229[_0x8a7f('0x1f')]?_0x13b229[_0x8a7f('0x1f')]['include']?_[_0x8a7f('0x23')](_0x13b229['options'][_0x8a7f('0x21')],function(_0x5630c4){return{'model':db[_0x5630c4['model']],'as':_0x5630c4['as'],'attributes':_0x5630c4['attributes'],'include':_0x5630c4[_0x8a7f('0x21')]?_[_0x8a7f('0x23')](_0x5630c4['include'],function(_0xbdbaa4){return{'model':db[_0xbdbaa4[_0x8a7f('0x22')]],'as':_0xbdbaa4['as'],'attributes':_0xbdbaa4[_0x8a7f('0x24')],'include':_0xbdbaa4['include']?_[_0x8a7f('0x23')](_0xbdbaa4[_0x8a7f('0x21')],function(_0x10caba){return{'model':db[_0x10caba[_0x8a7f('0x22')]],'as':_0x10caba['as'],'attributes':_0x10caba[_0x8a7f('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38b498){logger[_0x8a7f('0x12')](_0x8a7f('0x25'),_0x13b229);logger[_0x8a7f('0x15')]('ShowSmsQueue',_0x13b229,JSON[_0x8a7f('0x16')](_0x38b498));_0x485787(_0x38b498);})[_0x8a7f('0x1b')](function(_0x2127d5){logger['error'](_0x8a7f('0x25'),_0x2127d5[_0x8a7f('0x19')],_0x13b229);_0x5b1bd8(_0x1c160b[_0x8a7f('0x17')](0x1f4,_0x2127d5[_0x8a7f('0x19')]));});});};
\ No newline at end of file
index bf48566..6a45d73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b16=['emit','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x253b0a,_0x1990ca){var _0x3948f7=function(_0x2292af){while(--_0x2292af){_0x253b0a['push'](_0x253b0a['shift']());}};_0x3948f7(++_0x1990ca);}(_0x4b16,0x1f4));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var SmsQueueEvents=require(_0x64b1('0x0'));var events=[_0x64b1('0x1'),_0x64b1('0x2'),_0x64b1('0x3')];function createListener(_0x436fe2,_0xa494ab){return function(_0x4b27c6){_0xa494ab[_0x64b1('0x4')](_0x436fe2,_0x4b27c6);};}function removeListener(_0x969def,_0xddc6b5){return function(){SmsQueueEvents['removeListener'](_0x969def,_0xddc6b5);};}exports[_0x64b1('0x5')]=function(_0x56c138){for(var _0x5c5704=0x0,_0x130341=events[_0x64b1('0x6')];_0x5c5704<_0x130341;_0x5c5704++){var _0x349691=events[_0x5c5704];var _0x471e07=createListener(_0x64b1('0x7')+_0x349691,_0x56c138);SmsQueueEvents['on'](_0x349691,_0x471e07);}};
\ No newline at end of file
+var _0xe531=['remove','update','removeListener','register','smsQueue:','./smsQueue.events'];(function(_0x4c86c5,_0x10110d){var _0x23ec89=function(_0x52cf7b){while(--_0x52cf7b){_0x4c86c5['push'](_0x4c86c5['shift']());}};_0x23ec89(++_0x10110d);}(_0xe531,0x191));var _0x1e53=function(_0x10b967,_0xb32c4d){_0x10b967=_0x10b967-0x0;var _0x264da2=_0xe531[_0x10b967];return _0x264da2;};'use strict';var SmsQueueEvents=require(_0x1e53('0x0'));var events=['save',_0x1e53('0x1'),_0x1e53('0x2')];function createListener(_0x1f1288,_0x384b8a){return function(_0x414d8b){_0x384b8a['emit'](_0x1f1288,_0x414d8b);};}function removeListener(_0x523a00,_0x4e4e33){return function(){SmsQueueEvents[_0x1e53('0x3')](_0x523a00,_0x4e4e33);};}exports[_0x1e53('0x4')]=function(_0x2cc719){for(var _0x53ff11=0x0,_0x2202b3=events['length'];_0x53ff11<_0x2202b3;_0x53ff11++){var _0x263483=events[_0x53ff11];var _0x18bc8d=createListener(_0x1e53('0x5')+_0x263483,_0x2cc719);SmsQueueEvents['on'](_0x263483,_0x18bc8d);}};
\ No newline at end of file
index 1605a90..55e6578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa267=['create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','/describe','describe','/:id','post','isAuthenticated'];(function(_0x5b118a,_0x43938b){var _0x535740=function(_0x229b8c){while(--_0x229b8c){_0x5b118a['push'](_0x5b118a['shift']());}};_0x535740(++_0x43938b);}(_0xa267,0xcb));var _0x7a26=function(_0x5544f6,_0x33a3e8){_0x5544f6=_0x5544f6-0x0;var _0x526f8c=_0xa267[_0x5544f6];return _0x526f8c;};'use strict';var multer=require(_0x7a26('0x0'));var util=require(_0x7a26('0x1'));var path=require(_0x7a26('0x2'));var timeout=require('connect-timeout');var express=require(_0x7a26('0x3'));var router=express[_0x7a26('0x4')]();var fs_extra=require(_0x7a26('0x5'));var auth=require(_0x7a26('0x6'));var interaction=require(_0x7a26('0x7'));var config=require(_0x7a26('0x8'));var controller=require(_0x7a26('0x9'));router[_0x7a26('0xa')]('/',auth['isAuthenticated'](),controller[_0x7a26('0xb')]);router[_0x7a26('0xa')](_0x7a26('0xc'),auth['isAuthenticated'](),controller[_0x7a26('0xd')]);router[_0x7a26('0xa')](_0x7a26('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x7a26('0xf')]('/',auth[_0x7a26('0x10')](),controller[_0x7a26('0x11')]);router[_0x7a26('0x12')](_0x7a26('0xe'),auth[_0x7a26('0x10')](),controller[_0x7a26('0x13')]);router[_0x7a26('0x14')]('/:id',auth[_0x7a26('0x10')](),controller['destroy']);module[_0x7a26('0x15')]=router;
\ No newline at end of file
+var _0x73c5=['index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get'];(function(_0x2bec0b,_0x2cd6e8){var _0x2c2c84=function(_0x5a1dc8){while(--_0x5a1dc8){_0x2bec0b['push'](_0x2bec0b['shift']());}};_0x2c2c84(++_0x2cd6e8);}(_0x73c5,0x197));var _0x573c=function(_0x2b4588,_0x2c6f59){_0x2b4588=_0x2b4588-0x0;var _0x39a4b8=_0x73c5[_0x2b4588];return _0x39a4b8;};'use strict';var multer=require('multer');var util=require(_0x573c('0x0'));var path=require(_0x573c('0x1'));var timeout=require(_0x573c('0x2'));var express=require(_0x573c('0x3'));var router=express[_0x573c('0x4')]();var fs_extra=require(_0x573c('0x5'));var auth=require(_0x573c('0x6'));var interaction=require(_0x573c('0x7'));var config=require(_0x573c('0x8'));var controller=require(_0x573c('0x9'));router[_0x573c('0xa')]('/',auth['isAuthenticated'](),controller[_0x573c('0xb')]);router['get']('/describe',auth[_0x573c('0xc')](),controller[_0x573c('0xd')]);router[_0x573c('0xa')](_0x573c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x573c('0xf')]('/',auth[_0x573c('0xc')](),controller[_0x573c('0x10')]);router[_0x573c('0x11')](_0x573c('0xe'),auth['isAuthenticated'](),controller[_0x573c('0x12')]);router[_0x573c('0x13')](_0x573c('0xe'),auth[_0x573c('0xc')](),controller[_0x573c('0x14')]);module[_0x573c('0x15')]=router;
\ No newline at end of file
index 93eb28c..f2a3666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c42=['exports','STRING','DATE','moment','sequelize'];(function(_0x31236c,_0x34f702){var _0x12eb2f=function(_0x6bb9a){while(--_0x6bb9a){_0x31236c['push'](_0x31236c['shift']());}};_0x12eb2f(++_0x34f702);}(_0x6c42,0x189));var _0x26c4=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6c42[_0x297fd3];return _0x2af381;};'use strict';var moment=require(_0x26c4('0x0'));var Sequelize=require(_0x26c4('0x1'));module[_0x26c4('0x2')]={'uniqueid':{'type':Sequelize[_0x26c4('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x26c4('0x3')]},'joinAt':{'type':Sequelize[_0x26c4('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x26c4('0x4')]},'exitAt':{'type':Sequelize[_0x26c4('0x4')]},'reason':{'type':Sequelize[_0x26c4('0x3')]}};
\ No newline at end of file
+var _0xe95c=['DATE','moment','sequelize','STRING'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0xe95c,0x1a5));var _0xce95=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe95c[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xce95('0x0'));var Sequelize=require(_0xce95('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xce95('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xce95('0x3')]},'acceptAt':{'type':Sequelize[_0xce95('0x3')]},'exitAt':{'type':Sequelize[_0xce95('0x3')]},'reason':{'type':Sequelize[_0xce95('0x2')]}};
\ No newline at end of file
index 1e5f87f..7ba8370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b53=['ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b53,0x8e));var _0x39b5=function(_0x117a14,_0x1a1724){_0x117a14=_0x117a14-0x0;var _0x2c3f5e=_0x9b53[_0x117a14];return _0x2c3f5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39b5('0x0'));var zipdir=require(_0x39b5('0x1'));var jsonpatch=require(_0x39b5('0x2'));var rp=require(_0x39b5('0x3'));var moment=require('moment');var BPromise=require(_0x39b5('0x4'));var Mustache=require(_0x39b5('0x5'));var util=require('util');var path=require(_0x39b5('0x6'));var sox=require(_0x39b5('0x7'));var csv=require('to-csv');var ejs=require(_0x39b5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39b5('0x9'));var squel=require('squel');var crypto=require(_0x39b5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x39b5('0xb'));var toCsv=require(_0x39b5('0xc'));var querystring=require(_0x39b5('0xd'));var Papa=require(_0x39b5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x39b5('0xf'));var hardwareService=require(_0x39b5('0x10'));var logger=require(_0x39b5('0x11'))(_0x39b5('0x12'));var utils=require(_0x39b5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x39b5('0x14'));var db=require(_0x39b5('0x15'))['db'];function respondWithStatusCode(_0x27be3d,_0x26ce7f){_0x26ce7f=_0x26ce7f||0xcc;return function(_0xe34abd){if(_0xe34abd){return _0x27be3d[_0x39b5('0x16')](_0x26ce7f);}return _0x27be3d[_0x39b5('0x17')](_0x26ce7f)['end']();};}function respondWithResult(_0x2ab9c6,_0x205fdd){_0x205fdd=_0x205fdd||0xc8;return function(_0x4c8d65){if(_0x4c8d65){return _0x2ab9c6[_0x39b5('0x17')](_0x205fdd)[_0x39b5('0x18')](_0x4c8d65);}};}function respondWithFilteredResult(_0x197abf,_0x3d8991){return function(_0x3f426f){if(_0x3f426f){var _0x21129e=typeof _0x3d8991[_0x39b5('0x19')]===_0x39b5('0x1a')&&typeof _0x3d8991[_0x39b5('0x1b')]===_0x39b5('0x1a');var _0x3cb1c6=_0x3f426f[_0x39b5('0x1c')];var _0x5e09db=_0x21129e?0x0:_0x3d8991[_0x39b5('0x19')];var _0x4822ef=_0x21129e?_0x3f426f[_0x39b5('0x1c')]:_0x3d8991[_0x39b5('0x19')]+_0x3d8991[_0x39b5('0x1b')];var _0x4ac5e1;if(_0x4822ef>=_0x3cb1c6){_0x4822ef=_0x3cb1c6;_0x4ac5e1=0xc8;}else{_0x4ac5e1=0xce;}_0x197abf[_0x39b5('0x17')](_0x4ac5e1);return _0x197abf['set'](_0x39b5('0x1d'),_0x5e09db+'-'+_0x4822ef+'/'+_0x3cb1c6)[_0x39b5('0x18')](_0x3f426f);}return null;};}function patchUpdates(_0x23c23c){return function(_0x3d5430){try{jsonpatch[_0x39b5('0x1e')](_0x3d5430,_0x23c23c,!![]);}catch(_0x25622d){return BPromise[_0x39b5('0x1f')](_0x25622d);}return _0x3d5430[_0x39b5('0x20')]();};}function saveUpdates(_0x54ea42,_0x105091){return function(_0x56bc56){if(_0x56bc56){return _0x56bc56[_0x39b5('0x21')](_0x54ea42)[_0x39b5('0x22')](function(_0x7493f1){return _0x7493f1;});}return null;};}function removeEntity(_0x173b15,_0x2d9dc5){return function(_0x3753d7){if(_0x3753d7){return _0x3753d7['destroy']()[_0x39b5('0x22')](function(){_0x173b15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56fa52,_0x2d45a6){return function(_0x2fbbb3){if(!_0x2fbbb3){_0x56fa52['sendStatus'](0x194);}return _0x2fbbb3;};}function handleError(_0x1d3bf2,_0xab2a08){_0xab2a08=_0xab2a08||0x1f4;return function(_0x521e7c){logger[_0x39b5('0x23')](_0x521e7c[_0x39b5('0x24')]);if(_0x521e7c['name']){delete _0x521e7c[_0x39b5('0x25')];}_0x1d3bf2[_0x39b5('0x17')](_0xab2a08)[_0x39b5('0x26')](_0x521e7c);};}exports[_0x39b5('0x27')]=function(_0x31b64e,_0x1b97c1){var _0x9de0c4={},_0x34a9f8={},_0x3d05c1={'count':0x0,'rows':[]};var _0x2c924f=_[_0x39b5('0x28')](db[_0x39b5('0x29')][_0x39b5('0x2a')],function(_0xfbba76){return{'name':_0xfbba76[_0x39b5('0x2b')],'type':_0xfbba76['type'][_0x39b5('0x2c')]};});_0x34a9f8[_0x39b5('0x2d')]=_['map'](_0x2c924f,_0x39b5('0x25'));_0x34a9f8[_0x39b5('0x2e')]=_['keys'](_0x31b64e[_0x39b5('0x2e')]);_0x34a9f8[_0x39b5('0x2f')]=_[_0x39b5('0x30')](_0x34a9f8['model'],_0x34a9f8[_0x39b5('0x2e')]);_0x9de0c4[_0x39b5('0x31')]=_[_0x39b5('0x30')](_0x34a9f8[_0x39b5('0x2d')],qs[_0x39b5('0x32')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x32')]));_0x9de0c4[_0x39b5('0x31')]=_0x9de0c4[_0x39b5('0x31')][_0x39b5('0x33')]?_0x9de0c4['attributes']:_0x34a9f8[_0x39b5('0x2d')];if(!_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x34')](_0x39b5('0x35'))){_0x9de0c4[_0x39b5('0x1b')]=qs[_0x39b5('0x1b')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x1b')]);_0x9de0c4[_0x39b5('0x19')]=qs[_0x39b5('0x19')](_0x31b64e['query'][_0x39b5('0x19')]);}_0x9de0c4[_0x39b5('0x36')]=qs[_0x39b5('0x37')](_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x37')]);_0x9de0c4[_0x39b5('0x38')]=qs[_0x39b5('0x2f')](_[_0x39b5('0x39')](_0x31b64e[_0x39b5('0x2e')],_0x34a9f8[_0x39b5('0x2f')]),_0x2c924f);if(_0x31b64e['query'][_0x39b5('0x3a')]){_0x9de0c4[_0x39b5('0x38')]=_[_0x39b5('0x3b')](_0x9de0c4[_0x39b5('0x38')],{'$or':_[_0x39b5('0x28')](_0x2c924f,function(_0x4657d7){if(_0x4657d7[_0x39b5('0x3c')]!==_0x39b5('0x3d')){var _0x13b6b7={};_0x13b6b7[_0x4657d7['name']]={'$like':'%'+_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x3a')]+'%'};return _0x13b6b7;}})});}_0x9de0c4=_[_0x39b5('0x3b')]({},_0x9de0c4,_0x31b64e[_0x39b5('0x3e')]);var _0x54261b={'where':_0x9de0c4[_0x39b5('0x38')]};return db[_0x39b5('0x29')][_0x39b5('0x1c')](_0x54261b)[_0x39b5('0x22')](function(_0xd7240){_0x3d05c1[_0x39b5('0x1c')]=_0xd7240;if(_0x31b64e[_0x39b5('0x2e')][_0x39b5('0x3f')]){_0x9de0c4[_0x39b5('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x39b5('0x41')](_0x9de0c4);})[_0x39b5('0x22')](function(_0x8095db){_0x3d05c1['rows']=_0x8095db;return _0x3d05c1;})[_0x39b5('0x22')](respondWithFilteredResult(_0x1b97c1,_0x9de0c4))[_0x39b5('0x42')](handleError(_0x1b97c1,null));};exports[_0x39b5('0x43')]=function(_0x7aadad,_0x1150d1){var _0x156336={'raw':!![],'where':{'id':_0x7aadad['params']['id']}},_0x2d8fa9={};_0x2d8fa9[_0x39b5('0x2d')]=_[_0x39b5('0x44')](db['SmsQueueReport'][_0x39b5('0x2a')]);_0x2d8fa9[_0x39b5('0x2e')]=_[_0x39b5('0x44')](_0x7aadad[_0x39b5('0x2e')]);_0x2d8fa9['filters']=_['intersection'](_0x2d8fa9[_0x39b5('0x2d')],_0x2d8fa9[_0x39b5('0x2e')]);_0x156336[_0x39b5('0x31')]=_[_0x39b5('0x30')](_0x2d8fa9[_0x39b5('0x2d')],qs['fields'](_0x7aadad['query']['fields']));_0x156336['attributes']=_0x156336[_0x39b5('0x31')]['length']?_0x156336['attributes']:_0x2d8fa9[_0x39b5('0x2d')];if(_0x7aadad[_0x39b5('0x2e')][_0x39b5('0x3f')]){_0x156336[_0x39b5('0x40')]=[{'all':!![]}];}_0x156336=_[_0x39b5('0x3b')]({},_0x156336,_0x7aadad[_0x39b5('0x3e')]);return db['SmsQueueReport'][_0x39b5('0x45')](_0x156336)[_0x39b5('0x22')](handleEntityNotFound(_0x1150d1,null))[_0x39b5('0x22')](respondWithResult(_0x1150d1,null))[_0x39b5('0x42')](handleError(_0x1150d1,null));};exports['create']=function(_0x537206,_0x1ead23){return db[_0x39b5('0x29')][_0x39b5('0x46')](_0x537206[_0x39b5('0x47')],{})[_0x39b5('0x22')](respondWithResult(_0x1ead23,0xc9))['catch'](handleError(_0x1ead23,null));};exports['update']=function(_0x56080b,_0xaf931c){if(_0x56080b[_0x39b5('0x47')]['id']){delete _0x56080b[_0x39b5('0x47')]['id'];}return db[_0x39b5('0x29')][_0x39b5('0x45')]({'where':{'id':_0x56080b[_0x39b5('0x48')]['id']}})[_0x39b5('0x22')](handleEntityNotFound(_0xaf931c,null))[_0x39b5('0x22')](saveUpdates(_0x56080b['body'],null))[_0x39b5('0x22')](respondWithResult(_0xaf931c,null))[_0x39b5('0x42')](handleError(_0xaf931c,null));};exports[_0x39b5('0x49')]=function(_0x143511,_0x39a112){return db['SmsQueueReport']['find']({'where':{'id':_0x143511[_0x39b5('0x48')]['id']}})[_0x39b5('0x22')](handleEntityNotFound(_0x39a112,null))[_0x39b5('0x22')](removeEntity(_0x39a112,null))[_0x39b5('0x42')](handleError(_0x39a112,null));};exports[_0x39b5('0x4a')]=function(_0x531c1d,_0x53c124){return db[_0x39b5('0x29')]['describe']()[_0x39b5('0x22')](respondWithResult(_0x53c124,null))[_0x39b5('0x42')](handleError(_0x53c124,null));};
\ No newline at end of file
+var _0xcb87=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','update','destroy','then','sendStatus','error','name','send','index','map','SmsQueueReport','type','model','query','keys','filters','intersection'];(function(_0x552056,_0x1cd1ac){var _0x3ffce3=function(_0x2082c2){while(--_0x2082c2){_0x552056['push'](_0x552056['shift']());}};_0x3ffce3(++_0x1cd1ac);}(_0xcb87,0xf3));var _0x7cb8=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0xcb87[_0x43e4b3];return _0x10c655;};'use strict';var emlformat=require(_0x7cb8('0x0'));var rimraf=require(_0x7cb8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7cb8('0x2'));var rp=require(_0x7cb8('0x3'));var moment=require('moment');var BPromise=require(_0x7cb8('0x4'));var Mustache=require('mustache');var util=require(_0x7cb8('0x5'));var path=require(_0x7cb8('0x6'));var sox=require(_0x7cb8('0x7'));var csv=require(_0x7cb8('0x8'));var ejs=require(_0x7cb8('0x9'));var fs=require('fs');var fs_extra=require(_0x7cb8('0xa'));var _=require('lodash');var squel=require(_0x7cb8('0xb'));var crypto=require(_0x7cb8('0xc'));var jsforce=require(_0x7cb8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7cb8('0x8'));var querystring=require(_0x7cb8('0xe'));var Papa=require(_0x7cb8('0xf'));var Redis=require(_0x7cb8('0x10'));var authService=require(_0x7cb8('0x11'));var qs=require(_0x7cb8('0x12'));var as=require(_0x7cb8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cb8('0x14'))(_0x7cb8('0x15'));var utils=require(_0x7cb8('0x16'));var config=require(_0x7cb8('0x17'));var licenseUtil=require(_0x7cb8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x357d9f,_0x1fcc33){_0x1fcc33=_0x1fcc33||0xcc;return function(_0x4ad24d){if(_0x4ad24d){return _0x357d9f['sendStatus'](_0x1fcc33);}return _0x357d9f[_0x7cb8('0x19')](_0x1fcc33)[_0x7cb8('0x1a')]();};}function respondWithResult(_0x27cdd2,_0x1949e1){_0x1949e1=_0x1949e1||0xc8;return function(_0x3644ab){if(_0x3644ab){return _0x27cdd2[_0x7cb8('0x19')](_0x1949e1)[_0x7cb8('0x1b')](_0x3644ab);}};}function respondWithFilteredResult(_0x3af11d,_0x4fe94a){return function(_0x75c608){if(_0x75c608){var _0x4ec081=typeof _0x4fe94a[_0x7cb8('0x1c')]===_0x7cb8('0x1d')&&typeof _0x4fe94a['limit']===_0x7cb8('0x1d');var _0x58f24d=_0x75c608[_0x7cb8('0x1e')];var _0xbb0131=_0x4ec081?0x0:_0x4fe94a[_0x7cb8('0x1c')];var _0x3fafff=_0x4ec081?_0x75c608['count']:_0x4fe94a['offset']+_0x4fe94a[_0x7cb8('0x1f')];var _0x560343;if(_0x3fafff>=_0x58f24d){_0x3fafff=_0x58f24d;_0x560343=0xc8;}else{_0x560343=0xce;}_0x3af11d[_0x7cb8('0x19')](_0x560343);return _0x3af11d[_0x7cb8('0x20')]('Content-Range',_0xbb0131+'-'+_0x3fafff+'/'+_0x58f24d)[_0x7cb8('0x1b')](_0x75c608);}return null;};}function patchUpdates(_0x5bdf45){return function(_0x3553a4){try{jsonpatch['apply'](_0x3553a4,_0x5bdf45,!![]);}catch(_0x318a7e){return BPromise['reject'](_0x318a7e);}return _0x3553a4['save']();};}function saveUpdates(_0x135505,_0x290553){return function(_0x4f220c){if(_0x4f220c){return _0x4f220c[_0x7cb8('0x21')](_0x135505)['then'](function(_0x21681a){return _0x21681a;});}return null;};}function removeEntity(_0x444fab,_0x301566){return function(_0x4a2ae1){if(_0x4a2ae1){return _0x4a2ae1[_0x7cb8('0x22')]()[_0x7cb8('0x23')](function(){_0x444fab[_0x7cb8('0x19')](0xcc)[_0x7cb8('0x1a')]();});}};}function handleEntityNotFound(_0x4ee000,_0x2f0f2b){return function(_0x11c909){if(!_0x11c909){_0x4ee000[_0x7cb8('0x24')](0x194);}return _0x11c909;};}function handleError(_0x5db4a6,_0x294baf){_0x294baf=_0x294baf||0x1f4;return function(_0x610e10){logger[_0x7cb8('0x25')](_0x610e10['stack']);if(_0x610e10[_0x7cb8('0x26')]){delete _0x610e10[_0x7cb8('0x26')];}_0x5db4a6[_0x7cb8('0x19')](_0x294baf)[_0x7cb8('0x27')](_0x610e10);};}exports[_0x7cb8('0x28')]=function(_0x23e74a,_0x2578d7){var _0xedf368={},_0x585692={},_0x3c23fb={'count':0x0,'rows':[]};var _0x4264f9=_[_0x7cb8('0x29')](db[_0x7cb8('0x2a')]['rawAttributes'],function(_0x4bd7d6){return{'name':_0x4bd7d6['fieldName'],'type':_0x4bd7d6[_0x7cb8('0x2b')]['key']};});_0x585692[_0x7cb8('0x2c')]=_[_0x7cb8('0x29')](_0x4264f9,_0x7cb8('0x26'));_0x585692[_0x7cb8('0x2d')]=_[_0x7cb8('0x2e')](_0x23e74a[_0x7cb8('0x2d')]);_0x585692[_0x7cb8('0x2f')]=_['intersection'](_0x585692[_0x7cb8('0x2c')],_0x585692[_0x7cb8('0x2d')]);_0xedf368['attributes']=_[_0x7cb8('0x30')](_0x585692['model'],qs[_0x7cb8('0x31')](_0x23e74a[_0x7cb8('0x2d')][_0x7cb8('0x31')]));_0xedf368[_0x7cb8('0x32')]=_0xedf368['attributes'][_0x7cb8('0x33')]?_0xedf368[_0x7cb8('0x32')]:_0x585692[_0x7cb8('0x2c')];if(!_0x23e74a[_0x7cb8('0x2d')][_0x7cb8('0x34')](_0x7cb8('0x35'))){_0xedf368[_0x7cb8('0x1f')]=qs['limit'](_0x23e74a[_0x7cb8('0x2d')][_0x7cb8('0x1f')]);_0xedf368[_0x7cb8('0x1c')]=qs[_0x7cb8('0x1c')](_0x23e74a[_0x7cb8('0x2d')]['offset']);}_0xedf368[_0x7cb8('0x36')]=qs[_0x7cb8('0x37')](_0x23e74a['query']['sort']);_0xedf368[_0x7cb8('0x38')]=qs['filters'](_[_0x7cb8('0x39')](_0x23e74a['query'],_0x585692[_0x7cb8('0x2f')]),_0x4264f9);if(_0x23e74a['query'][_0x7cb8('0x3a')]){_0xedf368[_0x7cb8('0x38')]=_[_0x7cb8('0x3b')](_0xedf368[_0x7cb8('0x38')],{'$or':_[_0x7cb8('0x29')](_0x4264f9,function(_0x4190f0){if(_0x4190f0[_0x7cb8('0x2b')]!==_0x7cb8('0x3c')){var _0x15e8b5={};_0x15e8b5[_0x4190f0['name']]={'$like':'%'+_0x23e74a[_0x7cb8('0x2d')]['filter']+'%'};return _0x15e8b5;}})});}_0xedf368=_[_0x7cb8('0x3b')]({},_0xedf368,_0x23e74a[_0x7cb8('0x3d')]);var _0x55d46f={'where':_0xedf368['where']};return db[_0x7cb8('0x2a')][_0x7cb8('0x1e')](_0x55d46f)['then'](function(_0x5917c9){_0x3c23fb[_0x7cb8('0x1e')]=_0x5917c9;if(_0x23e74a[_0x7cb8('0x2d')]['includeAll']){_0xedf368[_0x7cb8('0x3e')]=[{'all':!![]}];}return db[_0x7cb8('0x2a')][_0x7cb8('0x3f')](_0xedf368);})[_0x7cb8('0x23')](function(_0x3b6297){_0x3c23fb[_0x7cb8('0x40')]=_0x3b6297;return _0x3c23fb;})[_0x7cb8('0x23')](respondWithFilteredResult(_0x2578d7,_0xedf368))[_0x7cb8('0x41')](handleError(_0x2578d7,null));};exports[_0x7cb8('0x42')]=function(_0xd3900d,_0x517710){var _0x1ea79d={'raw':!![],'where':{'id':_0xd3900d['params']['id']}},_0x129f88={};_0x129f88[_0x7cb8('0x2c')]=_[_0x7cb8('0x2e')](db[_0x7cb8('0x2a')]['rawAttributes']);_0x129f88[_0x7cb8('0x2d')]=_[_0x7cb8('0x2e')](_0xd3900d[_0x7cb8('0x2d')]);_0x129f88[_0x7cb8('0x2f')]=_[_0x7cb8('0x30')](_0x129f88[_0x7cb8('0x2c')],_0x129f88[_0x7cb8('0x2d')]);_0x1ea79d[_0x7cb8('0x32')]=_[_0x7cb8('0x30')](_0x129f88[_0x7cb8('0x2c')],qs['fields'](_0xd3900d[_0x7cb8('0x2d')][_0x7cb8('0x31')]));_0x1ea79d['attributes']=_0x1ea79d[_0x7cb8('0x32')]['length']?_0x1ea79d[_0x7cb8('0x32')]:_0x129f88['model'];if(_0xd3900d[_0x7cb8('0x2d')][_0x7cb8('0x43')]){_0x1ea79d['include']=[{'all':!![]}];}_0x1ea79d=_[_0x7cb8('0x3b')]({},_0x1ea79d,_0xd3900d[_0x7cb8('0x3d')]);return db[_0x7cb8('0x2a')]['find'](_0x1ea79d)[_0x7cb8('0x23')](handleEntityNotFound(_0x517710,null))['then'](respondWithResult(_0x517710,null))['catch'](handleError(_0x517710,null));};exports[_0x7cb8('0x44')]=function(_0x2253f6,_0x39ac31){return db[_0x7cb8('0x2a')][_0x7cb8('0x44')](_0x2253f6[_0x7cb8('0x45')],{})[_0x7cb8('0x23')](respondWithResult(_0x39ac31,0xc9))[_0x7cb8('0x41')](handleError(_0x39ac31,null));};exports[_0x7cb8('0x21')]=function(_0x56bb9c,_0x13fad2){if(_0x56bb9c['body']['id']){delete _0x56bb9c['body']['id'];}return db[_0x7cb8('0x2a')]['find']({'where':{'id':_0x56bb9c[_0x7cb8('0x46')]['id']}})[_0x7cb8('0x23')](handleEntityNotFound(_0x13fad2,null))['then'](saveUpdates(_0x56bb9c[_0x7cb8('0x45')],null))[_0x7cb8('0x23')](respondWithResult(_0x13fad2,null))[_0x7cb8('0x41')](handleError(_0x13fad2,null));};exports['destroy']=function(_0x10eadc,_0x112c94){return db['SmsQueueReport'][_0x7cb8('0x47')]({'where':{'id':_0x10eadc[_0x7cb8('0x46')]['id']}})[_0x7cb8('0x23')](handleEntityNotFound(_0x112c94,null))['then'](removeEntity(_0x112c94,null))[_0x7cb8('0x41')](handleError(_0x112c94,null));};exports[_0x7cb8('0x48')]=function(_0x4249d0,_0x53708d){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x53708d,null))[_0x7cb8('0x41')](handleError(_0x53708d,null));};
\ No newline at end of file
index c7972fe..891f6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x2b5773,_0x2d7385){var _0x2bb36d=function(_0x2aefcd){while(--_0x2aefcd){_0x2b5773['push'](_0x2b5773['shift']());}};_0x2bb36d(++_0x2d7385);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x448c67,_0x413a69){var _0x399b08=function(_0x205a0d){while(--_0x205a0d){_0x448c67['push'](_0x448c67['shift']());}};_0x399b08(++_0x413a69);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 8703bf1..9e224a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbfd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsQueueReport','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbfd,0xa4));var _0xdbbf=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbbfd[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xdbbf('0x0'));var util=require('util');var moment=require(_0xdbbf('0x1'));var BPromise=require(_0xdbbf('0x2'));var rs=require(_0xdbbf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbbf('0x4'))['db'];var utils=require(_0xdbbf('0x5'));var logger=require(_0xdbbf('0x6'))(_0xdbbf('0x7'));var config=require(_0xdbbf('0x8'));var jayson=require(_0xdbbf('0x9'));var client=jayson[_0xdbbf('0xa')][_0xdbbf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4caee5,_0x4e37e0,_0x390b38){return new BPromise(function(_0x52c106,_0x296b3a){return client['request'](_0x4caee5,_0x390b38)[_0xdbbf('0xc')](function(_0x35994b){logger[_0xdbbf('0xd')](_0xdbbf('0xe'),_0x4e37e0,_0xdbbf('0xf'));logger[_0xdbbf('0x10')](_0xdbbf('0x11'),_0x4e37e0,_0xdbbf('0xf'),JSON[_0xdbbf('0x12')](_0x35994b));if(_0x35994b[_0xdbbf('0x13')]){if(_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x14')]===0x1f4){logger['error'](_0xdbbf('0xe'),_0x4e37e0,_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);return _0x296b3a(_0x35994b['error'][_0xdbbf('0x15')]);}logger['error'](_0xdbbf('0xe'),_0x4e37e0,_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);return _0x52c106(_0x35994b[_0xdbbf('0x13')][_0xdbbf('0x15')]);}else{logger['info'](_0xdbbf('0xe'),_0x4e37e0,_0xdbbf('0xf'));_0x52c106(_0x35994b[_0xdbbf('0x16')]['message']);}})[_0xdbbf('0x17')](function(_0x25e832){logger[_0xdbbf('0x13')](_0xdbbf('0xe'),_0x4e37e0,_0x25e832);_0x296b3a(_0x25e832);});});}exports['CreateSmsQueueReport']=function(_0x301c37){var _0x4f5897=this;return new Promise(function(_0x31a464,_0x8c9762){return db[_0xdbbf('0x18')]['create'](_0x301c37['body'],{'raw':_0x301c37[_0xdbbf('0x19')]?_0x301c37[_0xdbbf('0x19')][_0xdbbf('0x1a')]===undefined?!![]:![]:!![]})[_0xdbbf('0xc')](function(_0x1512ca){logger[_0xdbbf('0xd')](_0xdbbf('0x1b'),_0x301c37);logger[_0xdbbf('0x10')]('CreateSmsQueueReport',_0x301c37,JSON[_0xdbbf('0x12')](_0x1512ca));_0x31a464(_0x1512ca);})[_0xdbbf('0x17')](function(_0x8cfee9){logger[_0xdbbf('0x13')](_0xdbbf('0x1b'),_0x8cfee9['message'],_0x301c37);_0x8c9762(_0x4f5897[_0xdbbf('0x13')](0x1f4,_0x8cfee9[_0xdbbf('0x15')]));});});};exports[_0xdbbf('0x1c')]=function(_0x27cb42){var _0x227df9=this;return new Promise(function(_0x5d35f0,_0x174a1d){return db[_0xdbbf('0x18')][_0xdbbf('0x1d')](_0x27cb42[_0xdbbf('0x1e')],{'raw':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27cb42['options']?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x1f')]||null:null,'attributes':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42['options'][_0xdbbf('0x20')]||null:null,'limit':_0x27cb42[_0xdbbf('0x19')]?_0x27cb42[_0xdbbf('0x19')][_0xdbbf('0x21')]||null:null})[_0xdbbf('0xc')](function(_0x29ade0){logger[_0xdbbf('0xd')]('UpdateSmsQueueReport',_0x27cb42);logger[_0xdbbf('0x10')](_0xdbbf('0x1c'),_0x27cb42,JSON['stringify'](_0x29ade0));_0x5d35f0(_0x29ade0);})[_0xdbbf('0x17')](function(_0x2ca6df){logger[_0xdbbf('0x13')](_0xdbbf('0x1c'),_0x2ca6df[_0xdbbf('0x15')],_0x27cb42);_0x174a1d(_0x227df9[_0xdbbf('0x13')](0x1f4,_0x2ca6df[_0xdbbf('0x15')]));});});};
\ No newline at end of file
+var _0x4bb0=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x4bb0,0xc2));var _0x04bb=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0x4bb0[_0x402c8f];return _0x11e809;};'use strict';var _=require(_0x04bb('0x0'));var util=require('util');var moment=require(_0x04bb('0x1'));var BPromise=require(_0x04bb('0x2'));var rs=require(_0x04bb('0x3'));var fs=require('fs');var Redis=require(_0x04bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x04bb('0x5'));var logger=require(_0x04bb('0x6'))(_0x04bb('0x7'));var config=require(_0x04bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04bb('0x9')][_0x04bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54ffb8,_0x626b45,_0x2e6de8){return new BPromise(function(_0x5953d0,_0x519a35){return client[_0x04bb('0xb')](_0x54ffb8,_0x2e6de8)[_0x04bb('0xc')](function(_0x259b1f){logger[_0x04bb('0xd')](_0x04bb('0xe'),_0x626b45,_0x04bb('0xf'));logger[_0x04bb('0x10')](_0x04bb('0x11'),_0x626b45,_0x04bb('0xf'),JSON['stringify'](_0x259b1f));if(_0x259b1f[_0x04bb('0x12')]){if(_0x259b1f[_0x04bb('0x12')][_0x04bb('0x13')]===0x1f4){logger[_0x04bb('0x12')](_0x04bb('0xe'),_0x626b45,_0x259b1f[_0x04bb('0x12')]['message']);return _0x519a35(_0x259b1f[_0x04bb('0x12')][_0x04bb('0x14')]);}logger[_0x04bb('0x12')](_0x04bb('0xe'),_0x626b45,_0x259b1f[_0x04bb('0x12')][_0x04bb('0x14')]);return _0x5953d0(_0x259b1f[_0x04bb('0x12')]['message']);}else{logger['info'](_0x04bb('0xe'),_0x626b45,_0x04bb('0xf'));_0x5953d0(_0x259b1f[_0x04bb('0x15')][_0x04bb('0x14')]);}})[_0x04bb('0x16')](function(_0x458aaa){logger[_0x04bb('0x12')](_0x04bb('0xe'),_0x626b45,_0x458aaa);_0x519a35(_0x458aaa);});});}exports[_0x04bb('0x17')]=function(_0xb74fb6){var _0x55c08b=this;return new Promise(function(_0x488993,_0x299ca2){return db[_0x04bb('0x18')][_0x04bb('0x19')](_0xb74fb6[_0x04bb('0x1a')],{'raw':_0xb74fb6[_0x04bb('0x1b')]?_0xb74fb6[_0x04bb('0x1b')][_0x04bb('0x1c')]===undefined?!![]:![]:!![]})[_0x04bb('0xc')](function(_0x39e70f){logger['info'](_0x04bb('0x17'),_0xb74fb6);logger['debug'](_0x04bb('0x17'),_0xb74fb6,JSON['stringify'](_0x39e70f));_0x488993(_0x39e70f);})[_0x04bb('0x16')](function(_0x1253f0){logger[_0x04bb('0x12')](_0x04bb('0x17'),_0x1253f0[_0x04bb('0x14')],_0xb74fb6);_0x299ca2(_0x55c08b[_0x04bb('0x12')](0x1f4,_0x1253f0[_0x04bb('0x14')]));});});};exports[_0x04bb('0x1d')]=function(_0x2601b2){var _0x54a362=this;return new Promise(function(_0xd65f,_0x404f74){return db['SmsQueueReport'][_0x04bb('0x1e')](_0x2601b2['body'],{'raw':_0x2601b2[_0x04bb('0x1b')]?_0x2601b2[_0x04bb('0x1b')][_0x04bb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2601b2['options']?_0x2601b2[_0x04bb('0x1b')]['where']||null:null,'attributes':_0x2601b2[_0x04bb('0x1b')]?_0x2601b2[_0x04bb('0x1b')][_0x04bb('0x1f')]||null:null,'limit':_0x2601b2[_0x04bb('0x1b')]?_0x2601b2[_0x04bb('0x1b')][_0x04bb('0x20')]||null:null})[_0x04bb('0xc')](function(_0x8a8be6){logger[_0x04bb('0xd')](_0x04bb('0x1d'),_0x2601b2);logger[_0x04bb('0x10')](_0x04bb('0x1d'),_0x2601b2,JSON['stringify'](_0x8a8be6));_0xd65f(_0x8a8be6);})[_0x04bb('0x16')](function(_0x1b076b){logger[_0x04bb('0x12')]('UpdateSmsQueueReport',_0x1b076b['message'],_0x2601b2);_0x404f74(_0x54a362[_0x04bb('0x12')](0x1f4,_0x1b076b[_0x04bb('0x14')]));});});};
\ No newline at end of file
index f5103d8..965a762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x1b30c4,_0x5cd2d9){var _0x1a180a=function(_0x4b2cf9){while(--_0x4b2cf9){_0x1b30c4['push'](_0x1b30c4['shift']());}};_0x1a180a(++_0x5cd2d9);}(_0xdc97,0x13b));var _0x7dc9=function(_0xb85339,_0x6ca1a4){_0xb85339=_0xb85339-0x0;var _0x2085d4=_0xdc97[_0xb85339];return _0x2085d4;};'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
+var _0x202c=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x202c,0x178));var _0xc202=function(_0x504dd8,_0x1396f2){_0x504dd8=_0x504dd8-0x0;var _0x54db75=_0x202c[_0x504dd8];return _0x54db75;};'use strict';var multer=require(_0xc202('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc202('0x1'));var express=require(_0xc202('0x2'));var router=express[_0xc202('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc202('0x4'));var interaction=require(_0xc202('0x5'));var config=require(_0xc202('0x6'));var controller=require(_0xc202('0x7'));router['get']('/',auth[_0xc202('0x8')](),controller[_0xc202('0x9')]);router['get'](_0xc202('0xa'),auth['isAuthenticated'](),controller[_0xc202('0xb')]);router[_0xc202('0xc')](_0xc202('0xd'),auth[_0xc202('0x8')](),controller[_0xc202('0xe')]);router[_0xc202('0xf')]('/',auth[_0xc202('0x8')](),controller[_0xc202('0x10')]);router[_0xc202('0x11')](_0xc202('0xd'),auth[_0xc202('0x8')](),controller[_0xc202('0x12')]);router[_0xc202('0x13')]('/:id',auth[_0xc202('0x8')](),controller[_0xc202('0x14')]);module[_0xc202('0x15')]=router;
\ No newline at end of file
index cb96c0b..6127e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x470168,_0x4af4bf){var _0x5c1ae9=function(_0x1e1204){while(--_0x1e1204){_0x470168['push'](_0x470168['shift']());}};_0x5c1ae9(++_0x4af4bf);}(_0x70e0,0x17b));var _0x070e=function(_0x4c8a89,_0x145406){_0x4c8a89=_0x4c8a89-0x0;var _0x354907=_0x70e0[_0x4c8a89];return _0x354907;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b2483,_0x4cd936){_0x5b2483=_0x5b2483-0x0;var _0x5b670b=_0x9bde[_0x5b2483];return _0x5b670b;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index 55f94be..7caad36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf528=['sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','keys','SmsTransferReport','includeAll','find','create','body','update','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x4bbda3,_0x6e262d){var _0x48eb61=function(_0x251680){while(--_0x251680){_0x4bbda3['push'](_0x4bbda3['shift']());}};_0x48eb61(++_0x6e262d);}(_0xf528,0x1ca));var _0x8f52=function(_0x26bf86,_0x3bea03){_0x26bf86=_0x26bf86-0x0;var _0xbdf743=_0xf528[_0x26bf86];return _0xbdf743;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8f52('0x0'));var jsonpatch=require(_0x8f52('0x1'));var rp=require(_0x8f52('0x2'));var moment=require(_0x8f52('0x3'));var BPromise=require(_0x8f52('0x4'));var Mustache=require(_0x8f52('0x5'));var util=require(_0x8f52('0x6'));var path=require(_0x8f52('0x7'));var sox=require(_0x8f52('0x8'));var csv=require(_0x8f52('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f52('0xa'));var _=require('lodash');var squel=require(_0x8f52('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f52('0xc'));var deskjs=require(_0x8f52('0xd'));var toCsv=require(_0x8f52('0x9'));var querystring=require(_0x8f52('0xe'));var Papa=require(_0x8f52('0xf'));var Redis=require(_0x8f52('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8f52('0x11'));var as=require(_0x8f52('0x12'));var hardwareService=require(_0x8f52('0x13'));var logger=require(_0x8f52('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8f52('0x15'));var db=require(_0x8f52('0x16'))['db'];function respondWithStatusCode(_0x220fb9,_0x261363){_0x261363=_0x261363||0xcc;return function(_0x59c007){if(_0x59c007){return _0x220fb9[_0x8f52('0x17')](_0x261363);}return _0x220fb9['status'](_0x261363)[_0x8f52('0x18')]();};}function respondWithResult(_0x3dab8c,_0x5d2041){_0x5d2041=_0x5d2041||0xc8;return function(_0x369957){if(_0x369957){return _0x3dab8c[_0x8f52('0x19')](_0x5d2041)[_0x8f52('0x1a')](_0x369957);}};}function respondWithFilteredResult(_0x1b8fef,_0x2b381c){return function(_0x42cc8c){if(_0x42cc8c){var _0x274cbb=typeof _0x2b381c[_0x8f52('0x1b')]===_0x8f52('0x1c')&&typeof _0x2b381c[_0x8f52('0x1d')]===_0x8f52('0x1c');var _0xddc8a6=_0x42cc8c[_0x8f52('0x1e')];var _0x43d530=_0x274cbb?0x0:_0x2b381c[_0x8f52('0x1b')];var _0xf79f11=_0x274cbb?_0x42cc8c[_0x8f52('0x1e')]:_0x2b381c['offset']+_0x2b381c[_0x8f52('0x1d')];var _0x51fb8f;if(_0xf79f11>=_0xddc8a6){_0xf79f11=_0xddc8a6;_0x51fb8f=0xc8;}else{_0x51fb8f=0xce;}_0x1b8fef[_0x8f52('0x19')](_0x51fb8f);return _0x1b8fef[_0x8f52('0x1f')]('Content-Range',_0x43d530+'-'+_0xf79f11+'/'+_0xddc8a6)['json'](_0x42cc8c);}return null;};}function patchUpdates(_0x532f9d){return function(_0x4ce1ef){try{jsonpatch[_0x8f52('0x20')](_0x4ce1ef,_0x532f9d,!![]);}catch(_0x2dbdad){return BPromise[_0x8f52('0x21')](_0x2dbdad);}return _0x4ce1ef['save']();};}function saveUpdates(_0x189060,_0x4fa636){return function(_0x47b10c){if(_0x47b10c){return _0x47b10c['update'](_0x189060)[_0x8f52('0x22')](function(_0x187ed3){return _0x187ed3;});}return null;};}function removeEntity(_0x5aa0ee,_0x1e2e9b){return function(_0x496cdd){if(_0x496cdd){return _0x496cdd[_0x8f52('0x23')]()['then'](function(){_0x5aa0ee[_0x8f52('0x19')](0xcc)[_0x8f52('0x18')]();});}};}function handleEntityNotFound(_0x4f8bba,_0x119aa2){return function(_0x566d2f){if(!_0x566d2f){_0x4f8bba[_0x8f52('0x17')](0x194);}return _0x566d2f;};}function handleError(_0x13af16,_0x50bc6a){_0x50bc6a=_0x50bc6a||0x1f4;return function(_0x3e5b42){logger[_0x8f52('0x24')](_0x3e5b42['stack']);if(_0x3e5b42[_0x8f52('0x25')]){delete _0x3e5b42[_0x8f52('0x25')];}_0x13af16[_0x8f52('0x19')](_0x50bc6a)[_0x8f52('0x26')](_0x3e5b42);};}exports[_0x8f52('0x27')]=function(_0x95e04a,_0x130d46){var _0x1c1737={},_0x172d7e={},_0x411a6b={'count':0x0,'rows':[]};var _0x45210e=_[_0x8f52('0x28')](db['SmsTransferReport'][_0x8f52('0x29')],function(_0x54bef9){return{'name':_0x54bef9['fieldName'],'type':_0x54bef9[_0x8f52('0x2a')][_0x8f52('0x2b')]};});_0x172d7e[_0x8f52('0x2c')]=_[_0x8f52('0x28')](_0x45210e,_0x8f52('0x25'));_0x172d7e[_0x8f52('0x2d')]=_['keys'](_0x95e04a[_0x8f52('0x2d')]);_0x172d7e[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x172d7e['model'],_0x172d7e[_0x8f52('0x2d')]);_0x1c1737[_0x8f52('0x30')]=_[_0x8f52('0x2f')](_0x172d7e['model'],qs['fields'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x1c1737[_0x8f52('0x30')]=_0x1c1737[_0x8f52('0x30')][_0x8f52('0x32')]?_0x1c1737['attributes']:_0x172d7e[_0x8f52('0x2c')];if(!_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x33')]('nolimit')){_0x1c1737[_0x8f52('0x1d')]=qs['limit'](_0x95e04a[_0x8f52('0x2d')]['limit']);_0x1c1737[_0x8f52('0x1b')]=qs[_0x8f52('0x1b')](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x1b')]);}_0x1c1737[_0x8f52('0x34')]=qs['sort'](_0x95e04a[_0x8f52('0x2d')][_0x8f52('0x35')]);_0x1c1737[_0x8f52('0x36')]=qs['filters'](_[_0x8f52('0x37')](_0x95e04a[_0x8f52('0x2d')],_0x172d7e['filters']),_0x45210e);if(_0x95e04a[_0x8f52('0x2d')]['filter']){_0x1c1737[_0x8f52('0x36')]=_['merge'](_0x1c1737[_0x8f52('0x36')],{'$or':_[_0x8f52('0x28')](_0x45210e,function(_0x4ca1fc){if(_0x4ca1fc[_0x8f52('0x2a')]!==_0x8f52('0x38')){var _0x1ed29f={};_0x1ed29f[_0x4ca1fc[_0x8f52('0x25')]]={'$like':'%'+_0x95e04a['query']['filter']+'%'};return _0x1ed29f;}})});}_0x1c1737=_[_0x8f52('0x39')]({},_0x1c1737,_0x95e04a[_0x8f52('0x3a')]);var _0x42dbba={'where':_0x1c1737[_0x8f52('0x36')]};return db['SmsTransferReport'][_0x8f52('0x1e')](_0x42dbba)[_0x8f52('0x22')](function(_0x5c725d){_0x411a6b['count']=_0x5c725d;if(_0x95e04a[_0x8f52('0x2d')]['includeAll']){_0x1c1737[_0x8f52('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x8f52('0x3c')](_0x1c1737);})['then'](function(_0xc1a8ea){_0x411a6b[_0x8f52('0x3d')]=_0xc1a8ea;return _0x411a6b;})['then'](respondWithFilteredResult(_0x130d46,_0x1c1737))[_0x8f52('0x3e')](handleError(_0x130d46,null));};exports[_0x8f52('0x3f')]=function(_0x195672,_0x1dc439){var _0x4775cc={'raw':!![],'where':{'id':_0x195672[_0x8f52('0x40')]['id']}},_0x5a80da={};_0x5a80da['model']=_[_0x8f52('0x41')](db[_0x8f52('0x42')]['rawAttributes']);_0x5a80da[_0x8f52('0x2d')]=_[_0x8f52('0x41')](_0x195672[_0x8f52('0x2d')]);_0x5a80da[_0x8f52('0x2e')]=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],_0x5a80da[_0x8f52('0x2d')]);_0x4775cc['attributes']=_[_0x8f52('0x2f')](_0x5a80da[_0x8f52('0x2c')],qs[_0x8f52('0x31')](_0x195672[_0x8f52('0x2d')][_0x8f52('0x31')]));_0x4775cc[_0x8f52('0x30')]=_0x4775cc[_0x8f52('0x30')]['length']?_0x4775cc[_0x8f52('0x30')]:_0x5a80da['model'];if(_0x195672[_0x8f52('0x2d')][_0x8f52('0x43')]){_0x4775cc[_0x8f52('0x3b')]=[{'all':!![]}];}_0x4775cc=_[_0x8f52('0x39')]({},_0x4775cc,_0x195672['options']);return db['SmsTransferReport'][_0x8f52('0x44')](_0x4775cc)[_0x8f52('0x22')](handleEntityNotFound(_0x1dc439,null))[_0x8f52('0x22')](respondWithResult(_0x1dc439,null))[_0x8f52('0x3e')](handleError(_0x1dc439,null));};exports['create']=function(_0xa17c25,_0x41eb7e){return db[_0x8f52('0x42')][_0x8f52('0x45')](_0xa17c25[_0x8f52('0x46')],{})['then'](respondWithResult(_0x41eb7e,0xc9))[_0x8f52('0x3e')](handleError(_0x41eb7e,null));};exports[_0x8f52('0x47')]=function(_0x18a521,_0x1a6d1d){if(_0x18a521['body']['id']){delete _0x18a521['body']['id'];}return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x18a521[_0x8f52('0x40')]['id']}})[_0x8f52('0x22')](handleEntityNotFound(_0x1a6d1d,null))[_0x8f52('0x22')](saveUpdates(_0x18a521[_0x8f52('0x46')],null))[_0x8f52('0x22')](respondWithResult(_0x1a6d1d,null))[_0x8f52('0x3e')](handleError(_0x1a6d1d,null));};exports[_0x8f52('0x23')]=function(_0x21e062,_0x19acf8){return db[_0x8f52('0x42')][_0x8f52('0x44')]({'where':{'id':_0x21e062[_0x8f52('0x40')]['id']}})['then'](handleEntityNotFound(_0x19acf8,null))[_0x8f52('0x22')](removeEntity(_0x19acf8,null))[_0x8f52('0x3e')](handleError(_0x19acf8,null));};exports[_0x8f52('0x48')]=function(_0xe303e0,_0x360734){return db[_0x8f52('0x42')]['describe']()['then'](respondWithResult(_0x360734,null))['catch'](handleError(_0x360734,null));};
\ No newline at end of file
+var _0xb32e=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','sort','where','pick','VIRTUAL','options','SmsTransferReport','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3d0203,_0x577b53){var _0xb2b875=function(_0x31dcb8){while(--_0x31dcb8){_0x3d0203['push'](_0x3d0203['shift']());}};_0xb2b875(++_0x577b53);}(_0xb32e,0x14f));var _0xeb32=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb32e[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xeb32('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeb32('0x1'));var jsonpatch=require(_0xeb32('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb32('0x3'));var util=require(_0xeb32('0x4'));var path=require(_0xeb32('0x5'));var sox=require(_0xeb32('0x6'));var csv=require(_0xeb32('0x7'));var ejs=require(_0xeb32('0x8'));var fs=require('fs');var fs_extra=require(_0xeb32('0x9'));var _=require(_0xeb32('0xa'));var squel=require(_0xeb32('0xb'));var crypto=require(_0xeb32('0xc'));var jsforce=require(_0xeb32('0xd'));var deskjs=require(_0xeb32('0xe'));var toCsv=require(_0xeb32('0x7'));var querystring=require('querystring');var Papa=require(_0xeb32('0xf'));var Redis=require(_0xeb32('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeb32('0x11'));var as=require(_0xeb32('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb32('0x13'))('api');var utils=require(_0xeb32('0x14'));var config=require(_0xeb32('0x15'));var licenseUtil=require(_0xeb32('0x16'));var db=require(_0xeb32('0x17'))['db'];function respondWithStatusCode(_0x489d27,_0x34f8cb){_0x34f8cb=_0x34f8cb||0xcc;return function(_0x1b4ef8){if(_0x1b4ef8){return _0x489d27[_0xeb32('0x18')](_0x34f8cb);}return _0x489d27[_0xeb32('0x19')](_0x34f8cb)[_0xeb32('0x1a')]();};}function respondWithResult(_0xbbdebc,_0x1a6432){_0x1a6432=_0x1a6432||0xc8;return function(_0x4efebb){if(_0x4efebb){return _0xbbdebc[_0xeb32('0x19')](_0x1a6432)['json'](_0x4efebb);}};}function respondWithFilteredResult(_0x5ac09d,_0x1a5f26){return function(_0x14e8b0){if(_0x14e8b0){var _0x1d0197=typeof _0x1a5f26[_0xeb32('0x1b')]==='undefined'&&typeof _0x1a5f26[_0xeb32('0x1c')]==='undefined';var _0x57eb1d=_0x14e8b0[_0xeb32('0x1d')];var _0x43b532=_0x1d0197?0x0:_0x1a5f26[_0xeb32('0x1b')];var _0x3445dd=_0x1d0197?_0x14e8b0[_0xeb32('0x1d')]:_0x1a5f26['offset']+_0x1a5f26['limit'];var _0x1249d2;if(_0x3445dd>=_0x57eb1d){_0x3445dd=_0x57eb1d;_0x1249d2=0xc8;}else{_0x1249d2=0xce;}_0x5ac09d[_0xeb32('0x19')](_0x1249d2);return _0x5ac09d[_0xeb32('0x1e')](_0xeb32('0x1f'),_0x43b532+'-'+_0x3445dd+'/'+_0x57eb1d)['json'](_0x14e8b0);}return null;};}function patchUpdates(_0x18392e){return function(_0x3bccd0){try{jsonpatch[_0xeb32('0x20')](_0x3bccd0,_0x18392e,!![]);}catch(_0x55e903){return BPromise['reject'](_0x55e903);}return _0x3bccd0['save']();};}function saveUpdates(_0xcd50d2,_0x1c5e1a){return function(_0x36ff78){if(_0x36ff78){return _0x36ff78[_0xeb32('0x21')](_0xcd50d2)[_0xeb32('0x22')](function(_0x48eddc){return _0x48eddc;});}return null;};}function removeEntity(_0x18f7d7,_0x2e4088){return function(_0x1b1ace){if(_0x1b1ace){return _0x1b1ace[_0xeb32('0x23')]()['then'](function(){_0x18f7d7[_0xeb32('0x19')](0xcc)[_0xeb32('0x1a')]();});}};}function handleEntityNotFound(_0x47b720,_0x34a0a4){return function(_0x170837){if(!_0x170837){_0x47b720[_0xeb32('0x18')](0x194);}return _0x170837;};}function handleError(_0x4c5ab3,_0x4c36e1){_0x4c36e1=_0x4c36e1||0x1f4;return function(_0x553e46){logger[_0xeb32('0x24')](_0x553e46[_0xeb32('0x25')]);if(_0x553e46[_0xeb32('0x26')]){delete _0x553e46[_0xeb32('0x26')];}_0x4c5ab3[_0xeb32('0x19')](_0x4c36e1)[_0xeb32('0x27')](_0x553e46);};}exports[_0xeb32('0x28')]=function(_0x38afb3,_0x4fa5b1){var _0xd04605={},_0x308b97={},_0x5396e0={'count':0x0,'rows':[]};var _0x48280a=_[_0xeb32('0x29')](db['SmsTransferReport'][_0xeb32('0x2a')],function(_0x5a7d39){return{'name':_0x5a7d39[_0xeb32('0x2b')],'type':_0x5a7d39[_0xeb32('0x2c')][_0xeb32('0x2d')]};});_0x308b97[_0xeb32('0x2e')]=_[_0xeb32('0x29')](_0x48280a,'name');_0x308b97['query']=_[_0xeb32('0x2f')](_0x38afb3['query']);_0x308b97[_0xeb32('0x30')]=_[_0xeb32('0x31')](_0x308b97['model'],_0x308b97[_0xeb32('0x32')]);_0xd04605['attributes']=_[_0xeb32('0x31')](_0x308b97[_0xeb32('0x2e')],qs[_0xeb32('0x33')](_0x38afb3[_0xeb32('0x32')][_0xeb32('0x33')]));_0xd04605['attributes']=_0xd04605[_0xeb32('0x34')][_0xeb32('0x35')]?_0xd04605['attributes']:_0x308b97['model'];if(!_0x38afb3[_0xeb32('0x32')]['hasOwnProperty']('nolimit')){_0xd04605[_0xeb32('0x1c')]=qs['limit'](_0x38afb3[_0xeb32('0x32')][_0xeb32('0x1c')]);_0xd04605[_0xeb32('0x1b')]=qs[_0xeb32('0x1b')](_0x38afb3['query'][_0xeb32('0x1b')]);}_0xd04605['order']=qs['sort'](_0x38afb3[_0xeb32('0x32')][_0xeb32('0x36')]);_0xd04605[_0xeb32('0x37')]=qs['filters'](_[_0xeb32('0x38')](_0x38afb3[_0xeb32('0x32')],_0x308b97[_0xeb32('0x30')]),_0x48280a);if(_0x38afb3['query']['filter']){_0xd04605[_0xeb32('0x37')]=_['merge'](_0xd04605['where'],{'$or':_[_0xeb32('0x29')](_0x48280a,function(_0x2f7ace){if(_0x2f7ace[_0xeb32('0x2c')]!==_0xeb32('0x39')){var _0x5ecb10={};_0x5ecb10[_0x2f7ace['name']]={'$like':'%'+_0x38afb3[_0xeb32('0x32')]['filter']+'%'};return _0x5ecb10;}})});}_0xd04605=_['merge']({},_0xd04605,_0x38afb3[_0xeb32('0x3a')]);var _0x11d647={'where':_0xd04605[_0xeb32('0x37')]};return db[_0xeb32('0x3b')][_0xeb32('0x1d')](_0x11d647)[_0xeb32('0x22')](function(_0x54c7b6){_0x5396e0['count']=_0x54c7b6;if(_0x38afb3['query'][_0xeb32('0x3c')]){_0xd04605['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xeb32('0x3d')](_0xd04605);})[_0xeb32('0x22')](function(_0x12bf89){_0x5396e0['rows']=_0x12bf89;return _0x5396e0;})['then'](respondWithFilteredResult(_0x4fa5b1,_0xd04605))[_0xeb32('0x3e')](handleError(_0x4fa5b1,null));};exports[_0xeb32('0x3f')]=function(_0x3218e9,_0x5421e2){var _0x373b29={'raw':!![],'where':{'id':_0x3218e9[_0xeb32('0x40')]['id']}},_0x214ffa={};_0x214ffa[_0xeb32('0x2e')]=_[_0xeb32('0x2f')](db[_0xeb32('0x3b')]['rawAttributes']);_0x214ffa['query']=_[_0xeb32('0x2f')](_0x3218e9[_0xeb32('0x32')]);_0x214ffa[_0xeb32('0x30')]=_['intersection'](_0x214ffa[_0xeb32('0x2e')],_0x214ffa[_0xeb32('0x32')]);_0x373b29[_0xeb32('0x34')]=_[_0xeb32('0x31')](_0x214ffa[_0xeb32('0x2e')],qs[_0xeb32('0x33')](_0x3218e9['query']['fields']));_0x373b29[_0xeb32('0x34')]=_0x373b29[_0xeb32('0x34')]['length']?_0x373b29['attributes']:_0x214ffa['model'];if(_0x3218e9['query']['includeAll']){_0x373b29[_0xeb32('0x41')]=[{'all':!![]}];}_0x373b29=_['merge']({},_0x373b29,_0x3218e9[_0xeb32('0x3a')]);return db['SmsTransferReport'][_0xeb32('0x42')](_0x373b29)[_0xeb32('0x22')](handleEntityNotFound(_0x5421e2,null))[_0xeb32('0x22')](respondWithResult(_0x5421e2,null))[_0xeb32('0x3e')](handleError(_0x5421e2,null));};exports[_0xeb32('0x43')]=function(_0xdef349,_0x5342e4){return db[_0xeb32('0x3b')][_0xeb32('0x43')](_0xdef349[_0xeb32('0x44')],{})[_0xeb32('0x22')](respondWithResult(_0x5342e4,0xc9))[_0xeb32('0x3e')](handleError(_0x5342e4,null));};exports['update']=function(_0x350f34,_0x15c41d){if(_0x350f34[_0xeb32('0x44')]['id']){delete _0x350f34[_0xeb32('0x44')]['id'];}return db['SmsTransferReport'][_0xeb32('0x42')]({'where':{'id':_0x350f34[_0xeb32('0x40')]['id']}})[_0xeb32('0x22')](handleEntityNotFound(_0x15c41d,null))[_0xeb32('0x22')](saveUpdates(_0x350f34[_0xeb32('0x44')],null))[_0xeb32('0x22')](respondWithResult(_0x15c41d,null))[_0xeb32('0x3e')](handleError(_0x15c41d,null));};exports[_0xeb32('0x23')]=function(_0x18fc3f,_0xf754ac){return db[_0xeb32('0x3b')][_0xeb32('0x42')]({'where':{'id':_0x18fc3f[_0xeb32('0x40')]['id']}})['then'](handleEntityNotFound(_0xf754ac,null))['then'](removeEntity(_0xf754ac,null))[_0xeb32('0x3e')](handleError(_0xf754ac,null));};exports[_0xeb32('0x45')]=function(_0x4b99d7,_0x2c4e92){return db[_0xeb32('0x3b')][_0xeb32('0x45')]()[_0xeb32('0x22')](respondWithResult(_0x2c4e92,null))[_0xeb32('0x3e')](handleError(_0x2c4e92,null));};
\ No newline at end of file
index fdf72b1..33a3477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee81=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsTransferReport'];(function(_0x2ea680,_0x99a563){var _0x317396=function(_0x40c50d){while(--_0x40c50d){_0x2ea680['push'](_0x2ea680['shift']());}};_0x317396(++_0x99a563);}(_0xee81,0x15e));var _0x1ee8=function(_0x15f362,_0x120fe4){_0x15f362=_0x15f362-0x0;var _0x3d789a=_0xee81[_0x15f362];return _0x3d789a;};'use strict';var _=require(_0x1ee8('0x0'));var util=require(_0x1ee8('0x1'));var logger=require(_0x1ee8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1ee8('0x3'));var rp=require(_0x1ee8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ee8('0x5'));var config=require(_0x1ee8('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x1ee8('0x7')]=function(_0xd6987,_0x1f303b){return _0xd6987[_0x1ee8('0x8')](_0x1ee8('0x9'),attributes,{'tableName':_0x1ee8('0xa'),'paranoid':![],'indexes':[{'name':_0x1ee8('0xb'),'fields':[_0x1ee8('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5df9=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x4ce631,_0xe97018){var _0x512bae=function(_0x3092a3){while(--_0x3092a3){_0x4ce631['push'](_0x4ce631['shift']());}};_0x512bae(++_0xe97018);}(_0x5df9,0xea));var _0x95df=function(_0x20d1fb,_0x102b3d){_0x20d1fb=_0x20d1fb-0x0;var _0x37afc2=_0x5df9[_0x20d1fb];return _0x37afc2;};'use strict';var _=require('lodash');var util=require(_0x95df('0x0'));var logger=require(_0x95df('0x1'))(_0x95df('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x95df('0x3'));var fs=require('fs');var path=require(_0x95df('0x4'));var rimraf=require('rimraf');var config=require(_0x95df('0x5'));var attributes=require(_0x95df('0x6'));module[_0x95df('0x7')]=function(_0x2658ce,_0x49414f){return _0x2658ce[_0x95df('0x8')](_0x95df('0x9'),attributes,{'tableName':_0x95df('0xa'),'paranoid':![],'indexes':[{'name':_0x95df('0xb'),'fields':[_0x95df('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index acb3fdf..f501768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe009=['client','http','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b747b,_0x3e3ad5){var _0x4361e0=function(_0x357074){while(--_0x357074){_0x1b747b['push'](_0x1b747b['shift']());}};_0x4361e0(++_0x3e3ad5);}(_0xe009,0x122));var _0x9e00=function(_0x43808a,_0x4b09f6){_0x43808a=_0x43808a-0x0;var _0x52fbc8=_0xe009[_0x43808a];return _0x52fbc8;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402bb0,_0x22417d,_0x1eb956){return new BPromise(function(_0x5da6a4,_0x292a51){return client['request'](_0x402bb0,_0x1eb956)['then'](function(_0x531c9b){logger[_0x9e00('0xc')](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));logger['debug'](_0x9e00('0xf'),_0x22417d,_0x9e00('0xe'),JSON[_0x9e00('0x10')](_0x531c9b));if(_0x531c9b['error']){if(_0x531c9b[_0x9e00('0x11')]['code']===0x1f4){logger['error'](_0x9e00('0xd'),_0x22417d,_0x531c9b['error'][_0x9e00('0x12')]);return _0x292a51(_0x531c9b[_0x9e00('0x11')][_0x9e00('0x12')]);}logger[_0x9e00('0x11')](_0x9e00('0xd'),_0x22417d,_0x531c9b[_0x9e00('0x11')]['message']);return _0x5da6a4(_0x531c9b['error'][_0x9e00('0x12')]);}else{logger['info'](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));_0x5da6a4(_0x531c9b[_0x9e00('0x13')][_0x9e00('0x12')]);}})['catch'](function(_0x4f9007){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x22417d,_0x4f9007);_0x292a51(_0x4f9007);});});}
\ No newline at end of file
+var _0x383d=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20d35f,_0x48b86d){var _0x668ec9=function(_0x5bfc12){while(--_0x5bfc12){_0x20d35f['push'](_0x20d35f['shift']());}};_0x668ec9(++_0x48b86d);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd383('0x0'));var BPromise=require(_0xd383('0x1'));var rs=require(_0xd383('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd383('0x3'))['db'];var utils=require(_0xd383('0x4'));var logger=require(_0xd383('0x5'))(_0xd383('0x6'));var config=require(_0xd383('0x7'));var jayson=require(_0xd383('0x8'));var client=jayson['client'][_0xd383('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ba82,_0x9922e9,_0x470d8d){return new BPromise(function(_0xffa778,_0x5d4e0f){return client['request'](_0x30ba82,_0x470d8d)[_0xd383('0xa')](function(_0xb3ff62){logger['info'](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));logger[_0xd383('0xd')](_0xd383('0xe'),_0x9922e9,_0xd383('0xc'),JSON[_0xd383('0xf')](_0xb3ff62));if(_0xb3ff62['error']){if(_0xb3ff62[_0xd383('0x10')][_0xd383('0x11')]===0x1f4){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0xb3ff62['error'][_0xd383('0x12')]);return _0x5d4e0f(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}logger[_0xd383('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x9922e9,_0xb3ff62[_0xd383('0x10')]['message']);return _0xffa778(_0xb3ff62[_0xd383('0x10')][_0xd383('0x12')]);}else{logger[_0xd383('0x13')](_0xd383('0xb'),_0x9922e9,_0xd383('0xc'));_0xffa778(_0xb3ff62[_0xd383('0x14')]['message']);}})['catch'](function(_0x3905c1){logger[_0xd383('0x10')](_0xd383('0xb'),_0x9922e9,_0x3905c1);_0x5d4e0f(_0x3905c1);});});}
\ No newline at end of file
index 6342adb..2ec77cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c7a=['../../config/environment','./sound.controller','isAuthenticated','index','get','show','download','root','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','post','file','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c86e8,_0x19ef82){var _0x1747b9=function(_0x14610){while(--_0x14610){_0x2c86e8['push'](_0x2c86e8['shift']());}};_0x1747b9(++_0x19ef82);}(_0x4c7a,0x1e5));var _0xa4c7=function(_0x5c6220,_0x5e94e6){_0x5c6220=_0x5c6220-0x0;var _0x16a51e=_0x4c7a[_0x5c6220];return _0x16a51e;};'use strict';var multer=require(_0xa4c7('0x0'));var util=require(_0xa4c7('0x1'));var path=require(_0xa4c7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4c7('0x3'));var router=express[_0xa4c7('0x4')]();var fs_extra=require(_0xa4c7('0x5'));var auth=require(_0xa4c7('0x6'));var interaction=require(_0xa4c7('0x7'));var config=require(_0xa4c7('0x8'));var controller=require(_0xa4c7('0x9'));router['get']('/',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xb')]);router[_0xa4c7('0xc')]('/:id',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xd')]);router[_0xa4c7('0xc')]('/:id/download',auth[_0xa4c7('0xa')](),controller[_0xa4c7('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x56b214,_0x400d88,_0x45f452){_0x45f452(null,path['join'](config[_0xa4c7('0xf')],_0xa4c7('0x10')));},'filename':function(_0x20b23b,_0x485837,_0x4296f3){_0x485837['originalname']=_0x485837['originalname'][_0xa4c7('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4296f3(null,util[_0xa4c7('0x12')](_0xa4c7('0x13'),path[_0xa4c7('0x14')](_0x485837[_0xa4c7('0x15')],path['extname'](_0x485837[_0xa4c7('0x15')])),Date['now'](),path['extname'](_0x485837['originalname'])));}})});router[_0xa4c7('0x16')]('/',upload['single'](_0xa4c7('0x17')),controller['create']);router[_0xa4c7('0x18')](_0xa4c7('0x19'),auth[_0xa4c7('0xa')](),controller[_0xa4c7('0x1a')]);router[_0xa4c7('0x1b')](_0xa4c7('0x19'),auth[_0xa4c7('0xa')](),controller[_0xa4c7('0x1b')]);module[_0xa4c7('0x1c')]=router;
\ No newline at end of file
+var _0xdc9d=['exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','show','isAuthenticated','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','single','file','put','update','delete'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0xdc9d,0x118));var _0xddc9=function(_0x2e15f1,_0x19cab1){_0x2e15f1=_0x2e15f1-0x0;var _0xae54bc=_0xdc9d[_0x2e15f1];return _0xae54bc;};'use strict';var multer=require('multer');var util=require(_0xddc9('0x0'));var path=require(_0xddc9('0x1'));var timeout=require('connect-timeout');var express=require(_0xddc9('0x2'));var router=express[_0xddc9('0x3')]();var fs_extra=require(_0xddc9('0x4'));var auth=require(_0xddc9('0x5'));var interaction=require(_0xddc9('0x6'));var config=require(_0xddc9('0x7'));var controller=require(_0xddc9('0x8'));router[_0xddc9('0x9')]('/',auth['isAuthenticated'](),controller[_0xddc9('0xa')]);router[_0xddc9('0x9')](_0xddc9('0xb'),auth['isAuthenticated'](),controller[_0xddc9('0xc')]);router[_0xddc9('0x9')]('/:id/download',auth[_0xddc9('0xd')](),controller['download']);var upload=multer({'storage':multer[_0xddc9('0xe')]({'destination':function(_0x93c9f9,_0x262412,_0x2f5a08){_0x2f5a08(null,path[_0xddc9('0xf')](config[_0xddc9('0x10')],_0xddc9('0x11')));},'filename':function(_0x559eb5,_0x44f44a,_0x5dbf0a){_0x44f44a[_0xddc9('0x12')]=_0x44f44a[_0xddc9('0x12')][_0xddc9('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5dbf0a(null,util[_0xddc9('0x14')]('%s-%s%s',path[_0xddc9('0x15')](_0x44f44a[_0xddc9('0x12')],path[_0xddc9('0x16')](_0x44f44a[_0xddc9('0x12')])),Date[_0xddc9('0x17')](),path[_0xddc9('0x16')](_0x44f44a[_0xddc9('0x12')])));}})});router[_0xddc9('0x18')]('/',upload[_0xddc9('0x19')](_0xddc9('0x1a')),controller['create']);router[_0xddc9('0x1b')]('/:id',auth[_0xddc9('0xd')](),controller[_0xddc9('0x1c')]);router[_0xddc9('0x1d')](_0xddc9('0xb'),auth[_0xddc9('0xd')](),controller[_0xddc9('0x1d')]);module[_0xddc9('0x1e')]=router;
\ No newline at end of file
index bfb1b55..cd8c1cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8037=['FLOAT','BIGINT','INTEGER','sequelize','name','STRING'];(function(_0xe9b9b5,_0x820cf2){var _0x581105=function(_0x1f4046){while(--_0x1f4046){_0xe9b9b5['push'](_0xe9b9b5['shift']());}};_0x581105(++_0x820cf2);}(_0x8037,0x195));var _0x7803=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8037[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x7803('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7803('0x1'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x7803('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x7803('0x3')]},'original_sampleCount':{'type':Sequelize[_0x7803('0x4')]},'original_channelCount':{'type':Sequelize[_0x7803('0x5')]},'original_bitRate':{'type':Sequelize[_0x7803('0x4')]},'original_sampleRate':{'type':Sequelize[_0x7803('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x7803('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x7803('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x7803('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x7803('0x5')]}};
\ No newline at end of file
+var _0xbae6=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports','name'];(function(_0x224cf7,_0x2af09d){var _0x590fb9=function(_0x1bf8f1){while(--_0x1bf8f1){_0x224cf7['push'](_0x224cf7['shift']());}};_0x590fb9(++_0x2af09d);}(_0xbae6,0xc8));var _0x6bae=function(_0xbede53,_0x449891){_0xbede53=_0xbede53-0x0;var _0x189791=_0xbae6[_0xbede53];return _0x189791;};'use strict';var Sequelize=require(_0x6bae('0x0'));module[_0x6bae('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6bae('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x6bae('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x6bae('0x3')]},'original_format':{'type':Sequelize[_0x6bae('0x3')]},'original_duration':{'type':Sequelize[_0x6bae('0x4')]},'original_sampleCount':{'type':Sequelize[_0x6bae('0x5')]},'original_channelCount':{'type':Sequelize[_0x6bae('0x6')]},'original_bitRate':{'type':Sequelize[_0x6bae('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x6bae('0x3')]},'converted_duration':{'type':Sequelize[_0x6bae('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6bae('0x5')]},'converted_channelCount':{'type':Sequelize[_0x6bae('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x6bae('0x6')]}};
\ No newline at end of file
index 7f1a26b..088676b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x733b=['description','delete','%s.%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Sounds','UserProfileResource','status','error','name','send','index','map','Sound','rawAttributes','fieldName','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','download','save_name','converted_format','existsSync','join','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','create','basename','file','extname','originalname','filename','substring','wav','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','bitRate','converted_sampleRate','role','body','userProfileId','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update'];(function(_0x48033c,_0x2aa81b){var _0x17d8d0=function(_0x2bb8b2){while(--_0x2bb8b2){_0x48033c['push'](_0x48033c['shift']());}};_0x17d8d0(++_0x2aa81b);}(_0x733b,0xfd));var _0xb733=function(_0x3a7852,_0x155437){_0x3a7852=_0x3a7852-0x0;var _0x44145a=_0x733b[_0x3a7852];return _0x44145a;};'use strict';var emlformat=require(_0xb733('0x0'));var rimraf=require(_0xb733('0x1'));var zipdir=require(_0xb733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb733('0x3'));var moment=require(_0xb733('0x4'));var BPromise=require(_0xb733('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb733('0x6'));var sox=require('sox');var csv=require(_0xb733('0x7'));var ejs=require(_0xb733('0x8'));var fs=require('fs');var fs_extra=require(_0xb733('0x9'));var _=require(_0xb733('0xa'));var squel=require(_0xb733('0xb'));var crypto=require('crypto');var jsforce=require(_0xb733('0xc'));var deskjs=require(_0xb733('0xd'));var toCsv=require(_0xb733('0x7'));var querystring=require(_0xb733('0xe'));var Papa=require('papaparse');var Redis=require(_0xb733('0xf'));var authService=require(_0xb733('0x10'));var qs=require(_0xb733('0x11'));var as=require(_0xb733('0x12'));var hardwareService=require(_0xb733('0x13'));var logger=require(_0xb733('0x14'))(_0xb733('0x15'));var utils=require(_0xb733('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb733('0x17'))['db'];function respondWithStatusCode(_0x3466a5,_0x217eb7){_0x217eb7=_0x217eb7||0xcc;return function(_0x5a188d){if(_0x5a188d){return _0x3466a5[_0xb733('0x18')](_0x217eb7);}return _0x3466a5['status'](_0x217eb7)[_0xb733('0x19')]();};}function respondWithResult(_0x24db35,_0x571bf0){_0x571bf0=_0x571bf0||0xc8;return function(_0x4d53d2){if(_0x4d53d2){return _0x24db35['status'](_0x571bf0)['json'](_0x4d53d2);}};}function respondWithFilteredResult(_0x5c5deb,_0x48d428){return function(_0x4ee6f3){if(_0x4ee6f3){var _0x2369dc=typeof _0x48d428[_0xb733('0x1a')]==='undefined'&&typeof _0x48d428['limit']===_0xb733('0x1b');var _0x844ac6=_0x4ee6f3[_0xb733('0x1c')];var _0x5a0e64=_0x2369dc?0x0:_0x48d428[_0xb733('0x1a')];var _0x5eb5c9=_0x2369dc?_0x4ee6f3['count']:_0x48d428[_0xb733('0x1a')]+_0x48d428[_0xb733('0x1d')];var _0x3d532d;if(_0x5eb5c9>=_0x844ac6){_0x5eb5c9=_0x844ac6;_0x3d532d=0xc8;}else{_0x3d532d=0xce;}_0x5c5deb['status'](_0x3d532d);return _0x5c5deb[_0xb733('0x1e')](_0xb733('0x1f'),_0x5a0e64+'-'+_0x5eb5c9+'/'+_0x844ac6)[_0xb733('0x20')](_0x4ee6f3);}return null;};}function patchUpdates(_0x180dd6){return function(_0x981f35){try{jsonpatch[_0xb733('0x21')](_0x981f35,_0x180dd6,!![]);}catch(_0x1b20ae){return BPromise[_0xb733('0x22')](_0x1b20ae);}return _0x981f35[_0xb733('0x23')]();};}function saveUpdates(_0x3ea659,_0x4c200b){return function(_0x428505){if(_0x428505){return _0x428505['update'](_0x3ea659)[_0xb733('0x24')](function(_0x6782b5){return _0x6782b5;});}return null;};}function removeEntity(_0x434a73,_0x183022){return function(_0x1338e7){if(_0x1338e7){return _0x1338e7[_0xb733('0x25')]()[_0xb733('0x24')](function(){var _0x4e7a5f=_0x1338e7[_0xb733('0x26')]({'plain':!![]});var _0x547815=_0xb733('0x27');return db[_0xb733('0x28')]['destroy']({'where':{'type':_0x547815,'resourceId':_0x4e7a5f['id']}})[_0xb733('0x24')](function(){return _0x1338e7;});})[_0xb733('0x24')](function(){_0x434a73[_0xb733('0x29')](0xcc)[_0xb733('0x19')]();});}};}function handleEntityNotFound(_0x4592ae,_0x37fb5c){return function(_0x146641){if(!_0x146641){_0x4592ae[_0xb733('0x18')](0x194);}return _0x146641;};}function handleError(_0x3b5f79,_0x13935c){_0x13935c=_0x13935c||0x1f4;return function(_0x3da316){logger[_0xb733('0x2a')](_0x3da316['stack']);if(_0x3da316[_0xb733('0x2b')]){delete _0x3da316['name'];}_0x3b5f79[_0xb733('0x29')](_0x13935c)[_0xb733('0x2c')](_0x3da316);};}exports[_0xb733('0x2d')]=function(_0x2bfb21,_0x908b78){var _0xbaf8c3={},_0x55b7c3={},_0x5ea3f6={'count':0x0,'rows':[]};var _0x370e49=_[_0xb733('0x2e')](db[_0xb733('0x2f')][_0xb733('0x30')],function(_0x18b7b5){return{'name':_0x18b7b5[_0xb733('0x31')],'type':_0x18b7b5['type']['key']};});_0x55b7c3['model']=_['map'](_0x370e49,_0xb733('0x2b'));_0x55b7c3['query']=_['keys'](_0x2bfb21['query']);_0x55b7c3['filters']=_['intersection'](_0x55b7c3[_0xb733('0x32')],_0x55b7c3[_0xb733('0x33')]);_0xbaf8c3[_0xb733('0x34')]=_[_0xb733('0x35')](_0x55b7c3[_0xb733('0x32')],qs[_0xb733('0x36')](_0x2bfb21['query'][_0xb733('0x36')]));_0xbaf8c3['attributes']=_0xbaf8c3[_0xb733('0x34')][_0xb733('0x37')]?_0xbaf8c3[_0xb733('0x34')]:_0x55b7c3[_0xb733('0x32')];if(!_0x2bfb21[_0xb733('0x33')][_0xb733('0x38')](_0xb733('0x39'))){_0xbaf8c3[_0xb733('0x1d')]=qs[_0xb733('0x1d')](_0x2bfb21[_0xb733('0x33')][_0xb733('0x1d')]);_0xbaf8c3[_0xb733('0x1a')]=qs[_0xb733('0x1a')](_0x2bfb21[_0xb733('0x33')][_0xb733('0x1a')]);}_0xbaf8c3[_0xb733('0x3a')]=qs['sort'](_0x2bfb21[_0xb733('0x33')]['sort']);_0xbaf8c3[_0xb733('0x3b')]=qs[_0xb733('0x3c')](_[_0xb733('0x3d')](_0x2bfb21[_0xb733('0x33')],_0x55b7c3['filters']),_0x370e49);if(_0x2bfb21['query'][_0xb733('0x3e')]){_0xbaf8c3[_0xb733('0x3b')]=_[_0xb733('0x3f')](_0xbaf8c3['where'],{'$or':_[_0xb733('0x2e')](_0x370e49,function(_0xde0bf2){if(_0xde0bf2['type']!==_0xb733('0x40')){var _0x83e71a={};_0x83e71a[_0xde0bf2[_0xb733('0x2b')]]={'$like':'%'+_0x2bfb21[_0xb733('0x33')][_0xb733('0x3e')]+'%'};return _0x83e71a;}})});}_0xbaf8c3=_[_0xb733('0x3f')]({},_0xbaf8c3,_0x2bfb21[_0xb733('0x41')]);var _0x8df7f8={'where':_0xbaf8c3[_0xb733('0x3b')]};return db[_0xb733('0x2f')][_0xb733('0x1c')](_0x8df7f8)['then'](function(_0xd87e1e){_0x5ea3f6[_0xb733('0x1c')]=_0xd87e1e;if(_0x2bfb21['query'][_0xb733('0x42')]){_0xbaf8c3[_0xb733('0x43')]=[{'all':!![]}];}return db[_0xb733('0x2f')][_0xb733('0x44')](_0xbaf8c3);})['then'](function(_0x87a151){_0x5ea3f6[_0xb733('0x45')]=_0x87a151;return _0x5ea3f6;})[_0xb733('0x24')](respondWithFilteredResult(_0x908b78,_0xbaf8c3))[_0xb733('0x46')](handleError(_0x908b78,null));};exports['show']=function(_0x209556,_0xc50bbe){var _0x2124a7={'raw':!![],'where':{'id':_0x209556[_0xb733('0x47')]['id']}},_0x1caa22={};_0x1caa22[_0xb733('0x32')]=_[_0xb733('0x48')](db[_0xb733('0x2f')]['rawAttributes']);_0x1caa22['query']=_[_0xb733('0x48')](_0x209556[_0xb733('0x33')]);_0x1caa22[_0xb733('0x3c')]=_[_0xb733('0x35')](_0x1caa22[_0xb733('0x32')],_0x1caa22['query']);_0x2124a7[_0xb733('0x34')]=_[_0xb733('0x35')](_0x1caa22[_0xb733('0x32')],qs[_0xb733('0x36')](_0x209556[_0xb733('0x33')][_0xb733('0x36')]));_0x2124a7[_0xb733('0x34')]=_0x2124a7[_0xb733('0x34')][_0xb733('0x37')]?_0x2124a7[_0xb733('0x34')]:_0x1caa22[_0xb733('0x32')];if(_0x209556[_0xb733('0x33')][_0xb733('0x42')]){_0x2124a7[_0xb733('0x43')]=[{'all':!![]}];}_0x2124a7=_['merge']({},_0x2124a7,_0x209556[_0xb733('0x41')]);return db[_0xb733('0x2f')][_0xb733('0x49')](_0x2124a7)[_0xb733('0x24')](handleEntityNotFound(_0xc50bbe,null))[_0xb733('0x24')](respondWithResult(_0xc50bbe,null))[_0xb733('0x46')](handleError(_0xc50bbe,null));};exports[_0xb733('0x4a')]=function(_0x5cb58c,_0x27e46a,_0x3132d3){return db[_0xb733('0x2f')][_0xb733('0x49')]({'where':{'id':_0x5cb58c[_0xb733('0x47')]['id']},'attributes':[_0xb733('0x2b'),_0xb733('0x4b'),_0xb733('0x4c')],'raw':!![]})[_0xb733('0x24')](handleEntityNotFound(_0x27e46a,null))[_0xb733('0x24')](function(_0x580843){if(_0x580843){if(!fs[_0xb733('0x4d')](path[_0xb733('0x4e')](config['root'],'server/files/sounds/converted',_0x580843[_0xb733('0x4b')]+'.'+_0x580843[_0xb733('0x4c')]))){throw new db[(_0xb733('0x4f'))][(_0xb733('0x50'))](_0xb733('0x51'));}return _0x27e46a['download'](path[_0xb733('0x4e')](config['root'],_0xb733('0x52'),util[_0xb733('0x53')]('%s.%s',_0x580843['save_name'],_0x580843[_0xb733('0x4c')])),util[_0xb733('0x53')]('%s.%s',_0x580843['name'],_0x580843[_0xb733('0x4c')]));}return null;})[_0xb733('0x46')](handleError(_0x27e46a,null));};exports[_0xb733('0x54')]=function(_0x3ff2ea,_0x292e90,_0x47713c){var _0x42f919={'name':path[_0xb733('0x55')](_0x3ff2ea[_0xb733('0x56')]['originalname'],path[_0xb733('0x57')](_0x3ff2ea['file'][_0xb733('0x58')])),'save_name':path[_0xb733('0x55')](_0x3ff2ea[_0xb733('0x56')][_0xb733('0x59')],path[_0xb733('0x57')](_0x3ff2ea['file'][_0xb733('0x59')])),'original_format':path[_0xb733('0x57')](_0x3ff2ea['file']['originalname'])[_0xb733('0x5a')](0x1),'converted_format':_0xb733('0x5b')};var _0xf2f2d7=path['join'](config[_0xb733('0x5c')],_0xb733('0x5d'),_0x3ff2ea['file'][_0xb733('0x59')]);var _0x1db30b=path[_0xb733('0x4e')](config[_0xb733('0x5c')],_0xb733('0x52'),util[_0xb733('0x53')]('%s.%s',path[_0xb733('0x55')](_0x3ff2ea['file'][_0xb733('0x59')],path[_0xb733('0x57')](_0x3ff2ea[_0xb733('0x56')][_0xb733('0x59')])),_0x42f919[_0xb733('0x4c')]));logger[_0xb733('0x5e')](_0xb733('0x5f'),_0xf2f2d7);logger[_0xb733('0x5e')](_0xb733('0x60'),_0x1db30b);try{fs[_0xb733('0x61')](_0xf2f2d7,parseInt(_0xb733('0x62'),0x8));var _0x3b0a9d=sox['transcode'](_0xf2f2d7,_0x1db30b,{'sampleRate':0x1f40,'format':_0xb733('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3b0a9d['on']('error',function(_0x339285){fs[_0xb733('0x63')](_0xf2f2d7);_0x292e90[_0xb733('0x29')](0x1f4)['send'](_0x339285);});_0x3b0a9d['on'](_0xb733('0x64'),function(_0x3af95e){_0x42f919[_0xb733('0x65')]=isNaN(_0x3af95e[_0xb733('0x66')])?null:_0x3af95e['duration']*0x3e8;_0x42f919['original_sampleCount']=isNaN(_0x3af95e[_0xb733('0x67')])?null:_0x3af95e[_0xb733('0x67')];_0x42f919[_0xb733('0x68')]=isNaN(_0x3af95e['channelCount'])?null:_0x3af95e[_0xb733('0x69')];_0x42f919[_0xb733('0x6a')]=isNaN(_0x3af95e['bitRate'])?null:_0x3af95e['bitRate'];_0x42f919['original_sampleRate']=isNaN(_0x3af95e[_0xb733('0x6b')])?null:_0x3af95e[_0xb733('0x6b')];});_0x3b0a9d['on'](_0xb733('0x6c'),function(_0x22cb64){_0x42f919[_0xb733('0x6d')]=isNaN(_0x22cb64[_0xb733('0x66')])?null:_0x22cb64['duration']*0x3e8;_0x42f919[_0xb733('0x6e')]=isNaN(_0x22cb64[_0xb733('0x67')])?null:_0x22cb64[_0xb733('0x67')];_0x42f919['converted_channelCount']=isNaN(_0x22cb64[_0xb733('0x69')])?null:_0x22cb64['channelCount'];_0x42f919[_0xb733('0x6f')]=isNaN(_0x22cb64['bitRate'])?null:_0x22cb64[_0xb733('0x70')];_0x42f919[_0xb733('0x71')]=isNaN(_0x22cb64['sampleRate'])?null:_0x22cb64[_0xb733('0x6b')];});_0x3b0a9d['on']('end',function(){fs[_0xb733('0x61')](_0x1db30b,parseInt(_0xb733('0x62'),0x8));return db[_0xb733('0x2f')][_0xb733('0x54')](_0x42f919)[_0xb733('0x24')](function(_0x3d7a75){var _0xdfbbd4={'role':_0x3ff2ea['body'][_0xb733('0x72')],'userProfileId':_0x3ff2ea[_0xb733('0x73')][_0xb733('0x74')]};if(!_0xdfbbd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdfbbd4[_0xb733('0x72')]===_0xb733('0x75')){var _0x24ec0f=_0x3d7a75['get']({'plain':!![]});return db[_0xb733('0x76')][_0xb733('0x49')]({'where':{'name':'Sounds','userProfileId':_0xdfbbd4[_0xb733('0x74')]},'raw':!![]})[_0xb733('0x24')](function(_0x2e10c3){if(_0x2e10c3&&_0x2e10c3['autoAssociation']===0x0){return db[_0xb733('0x28')]['create']({'name':_0x24ec0f[_0xb733('0x2b')],'resourceId':_0x24ec0f['id'],'type':_0x2e10c3[_0xb733('0x2b')],'sectionId':_0x2e10c3['id']},{})[_0xb733('0x24')](function(){return _0x3d7a75;});}else{return _0x3d7a75;}})['catch'](function(_0x330d4e){logger[_0xb733('0x2a')](_0xb733('0x77'),_0x330d4e);throw _0x330d4e;});}return _0x3d7a75;})[_0xb733('0x24')](respondWithResult(_0x292e90,null))[_0xb733('0x46')](handleError(_0x292e90,null));});_0x3b0a9d[_0xb733('0x78')]();}catch(_0x16ecba){_0x292e90[_0xb733('0x29')](0x1f4)['send'](_0x16ecba);}};exports[_0xb733('0x79')]=function(_0x24600b,_0x2c438a,_0x1f6cbb){return db[_0xb733('0x2f')][_0xb733('0x49')]({'where':{'id':_0x24600b[_0xb733('0x47')]['id']}})[_0xb733('0x24')](handleEntityNotFound(_0x2c438a,null))[_0xb733('0x24')](saveUpdates(_[_0xb733('0x3d')](_0x24600b[_0xb733('0x73')],['name',_0xb733('0x7a')]),null))[_0xb733('0x24')](respondWithResult(_0x2c438a,null))[_0xb733('0x46')](handleError(_0x2c438a,null));};exports[_0xb733('0x7b')]=function(_0x2d97aa,_0x2fd84c,_0x32687c){return db['Sound'][_0xb733('0x49')]({'where':{'id':_0x2d97aa[_0xb733('0x47')]['id']}})['then'](function(_0x3b0063){if(_0x3b0063){return _0x3b0063[_0xb733('0x25')]();}})[_0xb733('0x24')](function(_0x1f774e){var _0x5c4d17=path[_0xb733('0x4e')](config['root'],'server/files/sounds/original',util['format']('%s.%s',_0x1f774e['save_name'],_0x1f774e['original_format']));var _0x5eabd7=path[_0xb733('0x4e')](config[_0xb733('0x5c')],'server/files/sounds/converted',util['format'](_0xb733('0x7c'),_0x1f774e[_0xb733('0x4b')],_0x1f774e[_0xb733('0x4c')]));fs[_0xb733('0x63')](_0x5c4d17);fs[_0xb733('0x63')](_0x5eabd7);return _0x1f774e;})[_0xb733('0x24')](function(_0x131545){if(_0x131545){return _0x2fd84c[_0xb733('0x29')](0xcc)[_0xb733('0x19')]();}})[_0xb733('0x24')](handleEntityNotFound(_0x2fd84c,null))['catch'](handleError(_0x2fd84c,null));};
\ No newline at end of file
+var _0xf7f1=['filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','0777','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','get','Sounds','UserProfileResource','destroy','then','sendStatus','error','stack','send','index','map','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','Sound','include','findAll','catch','show','params','includeAll','find','save_name','converted_format','existsSync','join','root','Sequelize','download','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname'];(function(_0x383c01,_0x4252b7){var _0x2ac55f=function(_0x44721e){while(--_0x44721e){_0x383c01['push'](_0x383c01['shift']());}};_0x2ac55f(++_0x4252b7);}(_0xf7f1,0xa1));var _0x1f7f=function(_0x59f4fb,_0x117f98){_0x59f4fb=_0x59f4fb-0x0;var _0x509391=_0xf7f1[_0x59f4fb];return _0x509391;};'use strict';var emlformat=require(_0x1f7f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1f7f('0x1'));var jsonpatch=require(_0x1f7f('0x2'));var rp=require(_0x1f7f('0x3'));var moment=require(_0x1f7f('0x4'));var BPromise=require(_0x1f7f('0x5'));var Mustache=require(_0x1f7f('0x6'));var util=require(_0x1f7f('0x7'));var path=require(_0x1f7f('0x8'));var sox=require('sox');var csv=require(_0x1f7f('0x9'));var ejs=require(_0x1f7f('0xa'));var fs=require('fs');var fs_extra=require(_0x1f7f('0xb'));var _=require(_0x1f7f('0xc'));var squel=require(_0x1f7f('0xd'));var crypto=require(_0x1f7f('0xe'));var jsforce=require(_0x1f7f('0xf'));var deskjs=require(_0x1f7f('0x10'));var toCsv=require(_0x1f7f('0x9'));var querystring=require('querystring');var Papa=require(_0x1f7f('0x11'));var Redis=require(_0x1f7f('0x12'));var authService=require(_0x1f7f('0x13'));var qs=require(_0x1f7f('0x14'));var as=require(_0x1f7f('0x15'));var hardwareService=require(_0x1f7f('0x16'));var logger=require('../../config/logger')(_0x1f7f('0x17'));var utils=require(_0x1f7f('0x18'));var config=require(_0x1f7f('0x19'));var licenseUtil=require(_0x1f7f('0x1a'));var db=require(_0x1f7f('0x1b'))['db'];function respondWithStatusCode(_0x20dc49,_0x505597){_0x505597=_0x505597||0xcc;return function(_0x11839){if(_0x11839){return _0x20dc49['sendStatus'](_0x505597);}return _0x20dc49[_0x1f7f('0x1c')](_0x505597)[_0x1f7f('0x1d')]();};}function respondWithResult(_0x2bb168,_0x3f96a3){_0x3f96a3=_0x3f96a3||0xc8;return function(_0x5dbbf9){if(_0x5dbbf9){return _0x2bb168[_0x1f7f('0x1c')](_0x3f96a3)[_0x1f7f('0x1e')](_0x5dbbf9);}};}function respondWithFilteredResult(_0x1f251e,_0x2c42c6){return function(_0x10c808){if(_0x10c808){var _0x267c5f=typeof _0x2c42c6[_0x1f7f('0x1f')]===_0x1f7f('0x20')&&typeof _0x2c42c6[_0x1f7f('0x21')]==='undefined';var _0x54db2c=_0x10c808['count'];var _0x4900f1=_0x267c5f?0x0:_0x2c42c6[_0x1f7f('0x1f')];var _0x83e222=_0x267c5f?_0x10c808[_0x1f7f('0x22')]:_0x2c42c6[_0x1f7f('0x1f')]+_0x2c42c6[_0x1f7f('0x21')];var _0x54846d;if(_0x83e222>=_0x54db2c){_0x83e222=_0x54db2c;_0x54846d=0xc8;}else{_0x54846d=0xce;}_0x1f251e[_0x1f7f('0x1c')](_0x54846d);return _0x1f251e['set'](_0x1f7f('0x23'),_0x4900f1+'-'+_0x83e222+'/'+_0x54db2c)[_0x1f7f('0x1e')](_0x10c808);}return null;};}function patchUpdates(_0xd1e8db){return function(_0x3fda00){try{jsonpatch['apply'](_0x3fda00,_0xd1e8db,!![]);}catch(_0x2aed4c){return BPromise[_0x1f7f('0x24')](_0x2aed4c);}return _0x3fda00[_0x1f7f('0x25')]();};}function saveUpdates(_0x3acc8c,_0xa610bc){return function(_0x5d621e){if(_0x5d621e){return _0x5d621e[_0x1f7f('0x26')](_0x3acc8c)['then'](function(_0x2c5578){return _0x2c5578;});}return null;};}function removeEntity(_0x4c7e68,_0xae227d){return function(_0x296e04){if(_0x296e04){return _0x296e04['destroy']()['then'](function(){var _0x54f7cc=_0x296e04[_0x1f7f('0x27')]({'plain':!![]});var _0x11e7b0=_0x1f7f('0x28');return db[_0x1f7f('0x29')][_0x1f7f('0x2a')]({'where':{'type':_0x11e7b0,'resourceId':_0x54f7cc['id']}})[_0x1f7f('0x2b')](function(){return _0x296e04;});})[_0x1f7f('0x2b')](function(){_0x4c7e68['status'](0xcc)[_0x1f7f('0x1d')]();});}};}function handleEntityNotFound(_0x5b04ef,_0x49d5f5){return function(_0x137448){if(!_0x137448){_0x5b04ef[_0x1f7f('0x2c')](0x194);}return _0x137448;};}function handleError(_0x348ff2,_0x30ea9c){_0x30ea9c=_0x30ea9c||0x1f4;return function(_0x45d7f5){logger[_0x1f7f('0x2d')](_0x45d7f5[_0x1f7f('0x2e')]);if(_0x45d7f5['name']){delete _0x45d7f5['name'];}_0x348ff2['status'](_0x30ea9c)[_0x1f7f('0x2f')](_0x45d7f5);};}exports[_0x1f7f('0x30')]=function(_0x4501a6,_0x2c908b){var _0x10f2a5={},_0x34a943={},_0x148aa2={'count':0x0,'rows':[]};var _0x2dcf7d=_[_0x1f7f('0x31')](db['Sound'][_0x1f7f('0x32')],function(_0x4165bc){return{'name':_0x4165bc['fieldName'],'type':_0x4165bc['type'][_0x1f7f('0x33')]};});_0x34a943[_0x1f7f('0x34')]=_['map'](_0x2dcf7d,_0x1f7f('0x35'));_0x34a943[_0x1f7f('0x36')]=_[_0x1f7f('0x37')](_0x4501a6[_0x1f7f('0x36')]);_0x34a943[_0x1f7f('0x38')]=_[_0x1f7f('0x39')](_0x34a943['model'],_0x34a943[_0x1f7f('0x36')]);_0x10f2a5[_0x1f7f('0x3a')]=_[_0x1f7f('0x39')](_0x34a943[_0x1f7f('0x34')],qs[_0x1f7f('0x3b')](_0x4501a6[_0x1f7f('0x36')]['fields']));_0x10f2a5[_0x1f7f('0x3a')]=_0x10f2a5[_0x1f7f('0x3a')][_0x1f7f('0x3c')]?_0x10f2a5[_0x1f7f('0x3a')]:_0x34a943[_0x1f7f('0x34')];if(!_0x4501a6['query'][_0x1f7f('0x3d')]('nolimit')){_0x10f2a5[_0x1f7f('0x21')]=qs[_0x1f7f('0x21')](_0x4501a6[_0x1f7f('0x36')]['limit']);_0x10f2a5[_0x1f7f('0x1f')]=qs[_0x1f7f('0x1f')](_0x4501a6[_0x1f7f('0x36')][_0x1f7f('0x1f')]);}_0x10f2a5[_0x1f7f('0x3e')]=qs[_0x1f7f('0x3f')](_0x4501a6[_0x1f7f('0x36')][_0x1f7f('0x3f')]);_0x10f2a5[_0x1f7f('0x40')]=qs['filters'](_[_0x1f7f('0x41')](_0x4501a6[_0x1f7f('0x36')],_0x34a943[_0x1f7f('0x38')]),_0x2dcf7d);if(_0x4501a6[_0x1f7f('0x36')][_0x1f7f('0x42')]){_0x10f2a5[_0x1f7f('0x40')]=_[_0x1f7f('0x43')](_0x10f2a5['where'],{'$or':_['map'](_0x2dcf7d,function(_0x2273e3){if(_0x2273e3[_0x1f7f('0x44')]!=='VIRTUAL'){var _0x1a63c0={};_0x1a63c0[_0x2273e3[_0x1f7f('0x35')]]={'$like':'%'+_0x4501a6[_0x1f7f('0x36')]['filter']+'%'};return _0x1a63c0;}})});}_0x10f2a5=_[_0x1f7f('0x43')]({},_0x10f2a5,_0x4501a6[_0x1f7f('0x45')]);var _0x1086f8={'where':_0x10f2a5['where']};return db[_0x1f7f('0x46')][_0x1f7f('0x22')](_0x1086f8)[_0x1f7f('0x2b')](function(_0x1df8eb){_0x148aa2[_0x1f7f('0x22')]=_0x1df8eb;if(_0x4501a6[_0x1f7f('0x36')]['includeAll']){_0x10f2a5[_0x1f7f('0x47')]=[{'all':!![]}];}return db[_0x1f7f('0x46')][_0x1f7f('0x48')](_0x10f2a5);})[_0x1f7f('0x2b')](function(_0x360a08){_0x148aa2['rows']=_0x360a08;return _0x148aa2;})[_0x1f7f('0x2b')](respondWithFilteredResult(_0x2c908b,_0x10f2a5))[_0x1f7f('0x49')](handleError(_0x2c908b,null));};exports[_0x1f7f('0x4a')]=function(_0x22ad45,_0x3bdd4d){var _0x3fe0f1={'raw':!![],'where':{'id':_0x22ad45[_0x1f7f('0x4b')]['id']}},_0x5b730c={};_0x5b730c[_0x1f7f('0x34')]=_[_0x1f7f('0x37')](db['Sound'][_0x1f7f('0x32')]);_0x5b730c[_0x1f7f('0x36')]=_[_0x1f7f('0x37')](_0x22ad45[_0x1f7f('0x36')]);_0x5b730c[_0x1f7f('0x38')]=_[_0x1f7f('0x39')](_0x5b730c[_0x1f7f('0x34')],_0x5b730c[_0x1f7f('0x36')]);_0x3fe0f1['attributes']=_[_0x1f7f('0x39')](_0x5b730c[_0x1f7f('0x34')],qs[_0x1f7f('0x3b')](_0x22ad45[_0x1f7f('0x36')][_0x1f7f('0x3b')]));_0x3fe0f1[_0x1f7f('0x3a')]=_0x3fe0f1[_0x1f7f('0x3a')][_0x1f7f('0x3c')]?_0x3fe0f1[_0x1f7f('0x3a')]:_0x5b730c[_0x1f7f('0x34')];if(_0x22ad45['query'][_0x1f7f('0x4c')]){_0x3fe0f1[_0x1f7f('0x47')]=[{'all':!![]}];}_0x3fe0f1=_[_0x1f7f('0x43')]({},_0x3fe0f1,_0x22ad45[_0x1f7f('0x45')]);return db[_0x1f7f('0x46')][_0x1f7f('0x4d')](_0x3fe0f1)[_0x1f7f('0x2b')](handleEntityNotFound(_0x3bdd4d,null))[_0x1f7f('0x2b')](respondWithResult(_0x3bdd4d,null))[_0x1f7f('0x49')](handleError(_0x3bdd4d,null));};exports['download']=function(_0x27948e,_0xa4707,_0x45fab0){return db[_0x1f7f('0x46')][_0x1f7f('0x4d')]({'where':{'id':_0x27948e[_0x1f7f('0x4b')]['id']},'attributes':['name',_0x1f7f('0x4e'),_0x1f7f('0x4f')],'raw':!![]})[_0x1f7f('0x2b')](handleEntityNotFound(_0xa4707,null))[_0x1f7f('0x2b')](function(_0x3e00c8){if(_0x3e00c8){if(!fs[_0x1f7f('0x50')](path[_0x1f7f('0x51')](config[_0x1f7f('0x52')],'server/files/sounds/converted',_0x3e00c8[_0x1f7f('0x4e')]+'.'+_0x3e00c8[_0x1f7f('0x4f')]))){throw new db[(_0x1f7f('0x53'))]['ValidationError']('Sound\x20not\x20found');}return _0xa4707[_0x1f7f('0x54')](path[_0x1f7f('0x51')](config['root'],_0x1f7f('0x55'),util[_0x1f7f('0x56')](_0x1f7f('0x57'),_0x3e00c8[_0x1f7f('0x4e')],_0x3e00c8[_0x1f7f('0x4f')])),util[_0x1f7f('0x56')](_0x1f7f('0x57'),_0x3e00c8[_0x1f7f('0x35')],_0x3e00c8[_0x1f7f('0x4f')]));}return null;})[_0x1f7f('0x49')](handleError(_0xa4707,null));};exports[_0x1f7f('0x58')]=function(_0x58777f,_0x3c69be,_0x27eb72){var _0x56d725={'name':path[_0x1f7f('0x59')](_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5b')],path[_0x1f7f('0x5c')](_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5b')])),'save_name':path[_0x1f7f('0x59')](_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5d')],path[_0x1f7f('0x5c')](_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5d')])),'original_format':path[_0x1f7f('0x5c')](_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5b')])[_0x1f7f('0x5e')](0x1),'converted_format':_0x1f7f('0x5f')};var _0x3441c2=path['join'](config[_0x1f7f('0x52')],_0x1f7f('0x60'),_0x58777f[_0x1f7f('0x5a')][_0x1f7f('0x5d')]);var _0x529942=path['join'](config[_0x1f7f('0x52')],_0x1f7f('0x55'),util[_0x1f7f('0x56')](_0x1f7f('0x57'),path[_0x1f7f('0x59')](_0x58777f['file']['filename'],path['extname'](_0x58777f[_0x1f7f('0x5a')]['filename'])),_0x56d725[_0x1f7f('0x4f')]));logger[_0x1f7f('0x61')]('Sound\x20upload\x20filepath:\x20%s',_0x3441c2);logger[_0x1f7f('0x61')](_0x1f7f('0x62'),_0x529942);try{fs[_0x1f7f('0x63')](_0x3441c2,parseInt('0777',0x8));var _0x5188f3=sox[_0x1f7f('0x64')](_0x3441c2,_0x529942,{'sampleRate':0x1f40,'format':_0x1f7f('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5188f3['on'](_0x1f7f('0x2d'),function(_0x3d396b){fs[_0x1f7f('0x65')](_0x3441c2);_0x3c69be[_0x1f7f('0x1c')](0x1f4)[_0x1f7f('0x2f')](_0x3d396b);});_0x5188f3['on'](_0x1f7f('0x66'),function(_0x37fe86){_0x56d725[_0x1f7f('0x67')]=isNaN(_0x37fe86[_0x1f7f('0x68')])?null:_0x37fe86[_0x1f7f('0x68')]*0x3e8;_0x56d725[_0x1f7f('0x69')]=isNaN(_0x37fe86[_0x1f7f('0x6a')])?null:_0x37fe86[_0x1f7f('0x6a')];_0x56d725[_0x1f7f('0x6b')]=isNaN(_0x37fe86[_0x1f7f('0x6c')])?null:_0x37fe86['channelCount'];_0x56d725['original_bitRate']=isNaN(_0x37fe86[_0x1f7f('0x6d')])?null:_0x37fe86[_0x1f7f('0x6d')];_0x56d725[_0x1f7f('0x6e')]=isNaN(_0x37fe86[_0x1f7f('0x6f')])?null:_0x37fe86[_0x1f7f('0x6f')];});_0x5188f3['on'](_0x1f7f('0x70'),function(_0x1bb12c){_0x56d725['converted_duration']=isNaN(_0x1bb12c[_0x1f7f('0x68')])?null:_0x1bb12c[_0x1f7f('0x68')]*0x3e8;_0x56d725[_0x1f7f('0x71')]=isNaN(_0x1bb12c[_0x1f7f('0x6a')])?null:_0x1bb12c['sampleCount'];_0x56d725[_0x1f7f('0x72')]=isNaN(_0x1bb12c['channelCount'])?null:_0x1bb12c[_0x1f7f('0x6c')];_0x56d725[_0x1f7f('0x73')]=isNaN(_0x1bb12c[_0x1f7f('0x6d')])?null:_0x1bb12c[_0x1f7f('0x6d')];_0x56d725['converted_sampleRate']=isNaN(_0x1bb12c[_0x1f7f('0x6f')])?null:_0x1bb12c[_0x1f7f('0x6f')];});_0x5188f3['on'](_0x1f7f('0x1d'),function(){fs['chmodSync'](_0x529942,parseInt(_0x1f7f('0x74'),0x8));return db[_0x1f7f('0x46')]['create'](_0x56d725)['then'](function(_0x244a07){var _0x2b7cb3={'role':_0x58777f[_0x1f7f('0x75')][_0x1f7f('0x76')],'userProfileId':_0x58777f['body']['userProfileId']};if(!_0x2b7cb3)throw new Error(_0x1f7f('0x77'));if(_0x2b7cb3[_0x1f7f('0x76')]==='user'){var _0x16712b=_0x244a07[_0x1f7f('0x27')]({'plain':!![]});return db[_0x1f7f('0x78')][_0x1f7f('0x4d')]({'where':{'name':_0x1f7f('0x28'),'userProfileId':_0x2b7cb3[_0x1f7f('0x79')]},'raw':!![]})[_0x1f7f('0x2b')](function(_0x415ded){if(_0x415ded&&_0x415ded[_0x1f7f('0x7a')]===0x0){return db[_0x1f7f('0x29')]['create']({'name':_0x16712b['name'],'resourceId':_0x16712b['id'],'type':_0x415ded['name'],'sectionId':_0x415ded['id']},{})[_0x1f7f('0x2b')](function(){return _0x244a07;});}else{return _0x244a07;}})[_0x1f7f('0x49')](function(_0x170949){logger[_0x1f7f('0x2d')](_0x1f7f('0x7b'),_0x170949);throw _0x170949;});}return _0x244a07;})['then'](respondWithResult(_0x3c69be,null))[_0x1f7f('0x49')](handleError(_0x3c69be,null));});_0x5188f3[_0x1f7f('0x7c')]();}catch(_0x22ca54){_0x3c69be[_0x1f7f('0x1c')](0x1f4)[_0x1f7f('0x2f')](_0x22ca54);}};exports[_0x1f7f('0x26')]=function(_0x188594,_0x3d09b9,_0x4117fe){return db[_0x1f7f('0x46')]['find']({'where':{'id':_0x188594[_0x1f7f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d09b9,null))['then'](saveUpdates(_['pick'](_0x188594['body'],['name','description']),null))['then'](respondWithResult(_0x3d09b9,null))[_0x1f7f('0x49')](handleError(_0x3d09b9,null));};exports[_0x1f7f('0x7d')]=function(_0x469757,_0x15c1b2,_0x410e1a){return db['Sound']['find']({'where':{'id':_0x469757[_0x1f7f('0x4b')]['id']}})[_0x1f7f('0x2b')](function(_0x7390e){if(_0x7390e){return _0x7390e[_0x1f7f('0x2a')]();}})[_0x1f7f('0x2b')](function(_0x5d7daf){var _0x1bcbdd=path[_0x1f7f('0x51')](config['root'],_0x1f7f('0x60'),util['format'](_0x1f7f('0x57'),_0x5d7daf['save_name'],_0x5d7daf[_0x1f7f('0x7e')]));var _0xe84605=path[_0x1f7f('0x51')](config['root'],_0x1f7f('0x55'),util[_0x1f7f('0x56')](_0x1f7f('0x57'),_0x5d7daf[_0x1f7f('0x4e')],_0x5d7daf[_0x1f7f('0x4f')]));fs[_0x1f7f('0x65')](_0x1bcbdd);fs[_0x1f7f('0x65')](_0xe84605);return _0x5d7daf;})['then'](function(_0x46bede){if(_0x46bede){return _0x15c1b2[_0x1f7f('0x1c')](0xcc)[_0x1f7f('0x1d')]();}})[_0x1f7f('0x2b')](handleEntityNotFound(_0x15c1b2,null))[_0x1f7f('0x49')](handleError(_0x15c1b2,null));};
\ No newline at end of file
index def18dc..e271c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2151=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound','tools_sounds','lodash','util','../../config/logger'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x2151,0xed));var _0x1215=function(_0x147430,_0x73ef01){_0x147430=_0x147430-0x0;var _0x39f81d=_0x2151[_0x147430];return _0x39f81d;};'use strict';var _=require(_0x1215('0x0'));var util=require(_0x1215('0x1'));var logger=require(_0x1215('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1215('0x3'));var rp=require(_0x1215('0x4'));var fs=require('fs');var path=require(_0x1215('0x5'));var rimraf=require(_0x1215('0x6'));var config=require(_0x1215('0x7'));var attributes=require('./sound.attributes');module[_0x1215('0x8')]=function(_0x18b7ce,_0x11b2b8){return _0x18b7ce[_0x1215('0x9')](_0x1215('0xa'),attributes,{'tableName':_0x1215('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ad3=['moment','bluebird','rimraf','./sound.attributes','exports','Sound','lodash'];(function(_0x2e9f69,_0x181087){var _0x7227bc=function(_0x3fca8e){while(--_0x3fca8e){_0x2e9f69['push'](_0x2e9f69['shift']());}};_0x7227bc(++_0x181087);}(_0x3ad3,0x1d4));var _0x33ad=function(_0x1d9af4,_0x1f9e60){_0x1d9af4=_0x1d9af4-0x0;var _0x5ce2e7=_0x3ad3[_0x1d9af4];return _0x5ce2e7;};'use strict';var _=require(_0x33ad('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x33ad('0x1'));var BPromise=require(_0x33ad('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x33ad('0x3'));var config=require('../../config/environment');var attributes=require(_0x33ad('0x4'));module[_0x33ad('0x5')]=function(_0x491ddf,_0x30d950){return _0x491ddf['define'](_0x33ad('0x6'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bc91274..7857494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e07=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','util','moment','ioredis'];(function(_0x562177,_0x140ad7){var _0x5805bd=function(_0x3c7a8){while(--_0x3c7a8){_0x562177['push'](_0x562177['shift']());}};_0x5805bd(++_0x140ad7);}(_0x6e07,0x15d));var _0x76e0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6e07[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x76e0('0x0'));var moment=require(_0x76e0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76e0('0x2'));var db=require(_0x76e0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76e0('0x4'))(_0x76e0('0x5'));var config=require(_0x76e0('0x6'));var jayson=require(_0x76e0('0x7'));var client=jayson[_0x76e0('0x8')][_0x76e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fa06d,_0x549127,_0x48a9ed){return new BPromise(function(_0x20821f,_0x10ade8){return client[_0x76e0('0xa')](_0x2fa06d,_0x48a9ed)[_0x76e0('0xb')](function(_0x1bf3b9){logger[_0x76e0('0xc')](_0x76e0('0xd'),_0x549127,_0x76e0('0xe'));logger[_0x76e0('0xf')](_0x76e0('0x10'),_0x549127,_0x76e0('0xe'),JSON[_0x76e0('0x11')](_0x1bf3b9));if(_0x1bf3b9['error']){if(_0x1bf3b9['error'][_0x76e0('0x12')]===0x1f4){logger[_0x76e0('0x13')](_0x76e0('0xd'),_0x549127,_0x1bf3b9['error'][_0x76e0('0x14')]);return _0x10ade8(_0x1bf3b9[_0x76e0('0x13')]['message']);}logger[_0x76e0('0x13')](_0x76e0('0xd'),_0x549127,_0x1bf3b9[_0x76e0('0x13')]['message']);return _0x20821f(_0x1bf3b9[_0x76e0('0x13')][_0x76e0('0x14')]);}else{logger[_0x76e0('0xc')]('Sound,\x20%s,\x20%s',_0x549127,_0x76e0('0xe'));_0x20821f(_0x1bf3b9['result'][_0x76e0('0x14')]);}})[_0x76e0('0x15')](function(_0xdc7834){logger['error']('Sound,\x20%s,\x20%s',_0x549127,_0xdc7834);_0x10ade8(_0xdc7834);});});}exports[_0x76e0('0x16')]=function(_0x46c41a){var _0x12cc30=this;return new Promise(function(_0x19159f,_0x3bf761){return db[_0x76e0('0x17')][_0x76e0('0x18')]({'raw':_0x46c41a['options']?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1a')]===undefined?!![]:![]:!![],'where':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1b')]||null:null,'attributes':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1c')]||null:null,'include':_0x46c41a[_0x76e0('0x19')]?_0x46c41a[_0x76e0('0x19')][_0x76e0('0x1d')]?_[_0x76e0('0x1e')](_0x46c41a['options'][_0x76e0('0x1d')],function(_0x29b532){return{'model':db[_0x29b532[_0x76e0('0x1f')]],'as':_0x29b532['as'],'attributes':_0x29b532['attributes'],'include':_0x29b532[_0x76e0('0x1d')]?_['map'](_0x29b532['include'],function(_0x573293){return{'model':db[_0x573293[_0x76e0('0x1f')]],'as':_0x573293['as'],'attributes':_0x573293['attributes'],'include':_0x573293[_0x76e0('0x1d')]?_['map'](_0x573293[_0x76e0('0x1d')],function(_0x140b53){return{'model':db[_0x140b53[_0x76e0('0x1f')]],'as':_0x140b53['as'],'attributes':_0x140b53[_0x76e0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x76e0('0xb')](function(_0x511e53){logger['info'](_0x76e0('0x16'),_0x46c41a);logger[_0x76e0('0xf')]('ShowSound',_0x46c41a,JSON['stringify'](_0x511e53));_0x19159f(_0x511e53);})[_0x76e0('0x15')](function(_0x284a10){logger['error'](_0x76e0('0x16'),_0x284a10[_0x76e0('0x14')],_0x46c41a);_0x3bf761(_0x12cc30[_0x76e0('0x13')](0x1f4,_0x284a10[_0x76e0('0x14')]));});});};
\ No newline at end of file
+var _0xcfa7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','result','catch','ShowSound','Sound','find','options','where','attributes','include','map','model','debug','lodash','util','bluebird','randomstring','ioredis'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0xcfa7,0x1c2));var _0x7cfa=function(_0xd0c424,_0x1e772f){_0xd0c424=_0xd0c424-0x0;var _0x54c786=_0xcfa7[_0xd0c424];return _0x54c786;};'use strict';var _=require(_0x7cfa('0x0'));var util=require(_0x7cfa('0x1'));var moment=require('moment');var BPromise=require(_0x7cfa('0x2'));var rs=require(_0x7cfa('0x3'));var fs=require('fs');var Redis=require(_0x7cfa('0x4'));var db=require(_0x7cfa('0x5'))['db'];var utils=require(_0x7cfa('0x6'));var logger=require(_0x7cfa('0x7'))(_0x7cfa('0x8'));var config=require(_0x7cfa('0x9'));var jayson=require(_0x7cfa('0xa'));var client=jayson[_0x7cfa('0xb')][_0x7cfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4afcea,_0xed1be,_0x50c60c){return new BPromise(function(_0x1633af,_0x5ce058){return client[_0x7cfa('0xd')](_0x4afcea,_0x50c60c)[_0x7cfa('0xe')](function(_0x199b4e){logger['info']('Sound,\x20%s,\x20%s',_0xed1be,_0x7cfa('0xf'));logger['debug'](_0x7cfa('0x10'),_0xed1be,_0x7cfa('0xf'),JSON[_0x7cfa('0x11')](_0x199b4e));if(_0x199b4e[_0x7cfa('0x12')]){if(_0x199b4e[_0x7cfa('0x12')][_0x7cfa('0x13')]===0x1f4){logger[_0x7cfa('0x12')](_0x7cfa('0x14'),_0xed1be,_0x199b4e[_0x7cfa('0x12')][_0x7cfa('0x15')]);return _0x5ce058(_0x199b4e['error'][_0x7cfa('0x15')]);}logger['error'](_0x7cfa('0x14'),_0xed1be,_0x199b4e[_0x7cfa('0x12')][_0x7cfa('0x15')]);return _0x1633af(_0x199b4e[_0x7cfa('0x12')]['message']);}else{logger[_0x7cfa('0x16')]('Sound,\x20%s,\x20%s',_0xed1be,_0x7cfa('0xf'));_0x1633af(_0x199b4e[_0x7cfa('0x17')]['message']);}})[_0x7cfa('0x18')](function(_0x263521){logger[_0x7cfa('0x12')](_0x7cfa('0x14'),_0xed1be,_0x263521);_0x5ce058(_0x263521);});});}exports[_0x7cfa('0x19')]=function(_0x1d369f){var _0x24cdfb=this;return new Promise(function(_0x5b783e,_0x161a84){return db[_0x7cfa('0x1a')][_0x7cfa('0x1b')]({'raw':_0x1d369f[_0x7cfa('0x1c')]?_0x1d369f[_0x7cfa('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1d369f[_0x7cfa('0x1c')]?_0x1d369f[_0x7cfa('0x1c')][_0x7cfa('0x1d')]||null:null,'attributes':_0x1d369f[_0x7cfa('0x1c')]?_0x1d369f[_0x7cfa('0x1c')][_0x7cfa('0x1e')]||null:null,'include':_0x1d369f[_0x7cfa('0x1c')]?_0x1d369f[_0x7cfa('0x1c')][_0x7cfa('0x1f')]?_[_0x7cfa('0x20')](_0x1d369f[_0x7cfa('0x1c')][_0x7cfa('0x1f')],function(_0x8444e2){return{'model':db[_0x8444e2[_0x7cfa('0x21')]],'as':_0x8444e2['as'],'attributes':_0x8444e2[_0x7cfa('0x1e')],'include':_0x8444e2[_0x7cfa('0x1f')]?_['map'](_0x8444e2[_0x7cfa('0x1f')],function(_0x464a7a){return{'model':db[_0x464a7a[_0x7cfa('0x21')]],'as':_0x464a7a['as'],'attributes':_0x464a7a[_0x7cfa('0x1e')],'include':_0x464a7a[_0x7cfa('0x1f')]?_[_0x7cfa('0x20')](_0x464a7a[_0x7cfa('0x1f')],function(_0x48f9a7){return{'model':db[_0x48f9a7[_0x7cfa('0x21')]],'as':_0x48f9a7['as'],'attributes':_0x48f9a7[_0x7cfa('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7cfa('0xe')](function(_0x366aa7){logger[_0x7cfa('0x16')](_0x7cfa('0x19'),_0x1d369f);logger[_0x7cfa('0x22')](_0x7cfa('0x19'),_0x1d369f,JSON['stringify'](_0x366aa7));_0x5b783e(_0x366aa7);})['catch'](function(_0x9d164e){logger[_0x7cfa('0x12')](_0x7cfa('0x19'),_0x9d164e[_0x7cfa('0x15')],_0x1d369f);_0x161a84(_0x24cdfb['error'](0x1f4,_0x9d164e[_0x7cfa('0x15')]));});});};
\ No newline at end of file
index f938257..580bf76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update','delete','destroy'];(function(_0x99fb50,_0x5354ad){var _0x180a41=function(_0x2e4646){while(--_0x2e4646){_0x99fb50['push'](_0x99fb50['shift']());}};_0x180a41(++_0x5354ad);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'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('./squareMessage.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0xb')]('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router['put']('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0x9'),auth['isAuthenticated'](),controller[_0x65f6('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xb10b=['./squareMessage.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x269dc8,_0x5c9c08){var _0x1f54f4=function(_0x83a660){while(--_0x83a660){_0x269dc8['push'](_0x269dc8['shift']());}};_0x1f54f4(++_0x5c9c08);}(_0xb10b,0x12a));var _0xbb10=function(_0x29b4d5,_0x5b94c7){_0x29b4d5=_0x29b4d5-0x0;var _0x241d61=_0xb10b[_0x29b4d5];return _0x241d61;};'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('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router;
\ No newline at end of file
index 5589780..80483eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fd7=['STRING','medium','ENUM','out','TEXT','sequelize','exports'];(function(_0x336f98,_0x3aa428){var _0x97f6bf=function(_0x151702){while(--_0x151702){_0x336f98['push'](_0x336f98['shift']());}};_0x97f6bf(++_0x3aa428);}(_0x6fd7,0x14e));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x76fd('0x0'));module[_0x76fd('0x1')]={'uniqueid':{'type':Sequelize[_0x76fd('0x2')]},'body':{'type':Sequelize['TEXT'](_0x76fd('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x76fd('0x4')]('in',_0x76fd('0x5')),'defaultValue':_0x76fd('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x76fd('0x2')]},'providerResponse':{'type':Sequelize[_0x76fd('0x6')]}};
\ No newline at end of file
+var _0x187e=['exports','STRING','medium','ENUM','out','TEXT'];(function(_0x45fa30,_0x33bea9){var _0xd86041=function(_0x4910f5){while(--_0x4910f5){_0x45fa30['push'](_0x45fa30['shift']());}};_0xd86041(++_0x33bea9);}(_0x187e,0x180));var _0xe187=function(_0x58f2d2,_0x2c308d){_0x58f2d2=_0x58f2d2-0x0;var _0x528e77=_0x187e[_0x58f2d2];return _0x528e77;};'use strict';var Sequelize=require('sequelize');module[_0xe187('0x0')]={'uniqueid':{'type':Sequelize[_0xe187('0x1')]},'body':{'type':Sequelize['TEXT'](_0xe187('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xe187('0x3')]('in',_0xe187('0x4')),'defaultValue':_0xe187('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe187('0x1')]},'providerResponse':{'type':Sequelize[_0xe187('0x5')]}};
\ No newline at end of file
index 4529b6c..5299ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1921=['show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','reject','save','update','destroy','then','sendStatus','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','options','include','rows','catch'];(function(_0x2d4093,_0x32e7d2){var _0x336afe=function(_0x4297c7){while(--_0x4297c7){_0x2d4093['push'](_0x2d4093['shift']());}};_0x336afe(++_0x32e7d2);}(_0x1921,0xe4));var _0x1192=function(_0x2d2a86,_0x296463){_0x2d2a86=_0x2d2a86-0x0;var _0x55f309=_0x1921[_0x2d2a86];return _0x55f309;};'use strict';var emlformat=require(_0x1192('0x0'));var rimraf=require(_0x1192('0x1'));var zipdir=require(_0x1192('0x2'));var jsonpatch=require(_0x1192('0x3'));var rp=require(_0x1192('0x4'));var moment=require(_0x1192('0x5'));var BPromise=require(_0x1192('0x6'));var Mustache=require('mustache');var util=require(_0x1192('0x7'));var path=require(_0x1192('0x8'));var sox=require('sox');var csv=require(_0x1192('0x9'));var ejs=require(_0x1192('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1192('0xb'));var squel=require(_0x1192('0xc'));var crypto=require(_0x1192('0xd'));var jsforce=require(_0x1192('0xe'));var deskjs=require(_0x1192('0xf'));var toCsv=require(_0x1192('0x9'));var querystring=require(_0x1192('0x10'));var Papa=require(_0x1192('0x11'));var Redis=require(_0x1192('0x12'));var authService=require(_0x1192('0x13'));var qs=require(_0x1192('0x14'));var as=require(_0x1192('0x15'));var hardwareService=require(_0x1192('0x16'));var logger=require(_0x1192('0x17'))(_0x1192('0x18'));var utils=require(_0x1192('0x19'));var config=require(_0x1192('0x1a'));var licenseUtil=require(_0x1192('0x1b'));var db=require(_0x1192('0x1c'))['db'];function respondWithStatusCode(_0x1cb238,_0x33a825){_0x33a825=_0x33a825||0xcc;return function(_0x5e8978){if(_0x5e8978){return _0x1cb238['sendStatus'](_0x33a825);}return _0x1cb238[_0x1192('0x1d')](_0x33a825)[_0x1192('0x1e')]();};}function respondWithResult(_0x315fde,_0xcbaa57){_0xcbaa57=_0xcbaa57||0xc8;return function(_0x2dc344){if(_0x2dc344){return _0x315fde[_0x1192('0x1d')](_0xcbaa57)['json'](_0x2dc344);}};}function respondWithFilteredResult(_0x16f20,_0x6213a6){return function(_0xcb2bd1){if(_0xcb2bd1){var _0x50e6a7=typeof _0x6213a6[_0x1192('0x1f')]===_0x1192('0x20')&&typeof _0x6213a6['limit']===_0x1192('0x20');var _0x129233=_0xcb2bd1[_0x1192('0x21')];var _0x5c82ed=_0x50e6a7?0x0:_0x6213a6[_0x1192('0x1f')];var _0x5bbb5e=_0x50e6a7?_0xcb2bd1[_0x1192('0x21')]:_0x6213a6[_0x1192('0x1f')]+_0x6213a6[_0x1192('0x22')];var _0x24a1c0;if(_0x5bbb5e>=_0x129233){_0x5bbb5e=_0x129233;_0x24a1c0=0xc8;}else{_0x24a1c0=0xce;}_0x16f20[_0x1192('0x1d')](_0x24a1c0);return _0x16f20[_0x1192('0x23')]('Content-Range',_0x5c82ed+'-'+_0x5bbb5e+'/'+_0x129233)['json'](_0xcb2bd1);}return null;};}function patchUpdates(_0xcdd009){return function(_0xce5428){try{jsonpatch['apply'](_0xce5428,_0xcdd009,!![]);}catch(_0x5864a7){return BPromise[_0x1192('0x24')](_0x5864a7);}return _0xce5428[_0x1192('0x25')]();};}function saveUpdates(_0x1bedaa,_0x1a2850){return function(_0x3fb08c){if(_0x3fb08c){return _0x3fb08c[_0x1192('0x26')](_0x1bedaa)['then'](function(_0xeb3f3a){return _0xeb3f3a;});}return null;};}function removeEntity(_0x2c9778,_0x52db19){return function(_0x5bd5aa){if(_0x5bd5aa){return _0x5bd5aa[_0x1192('0x27')]()[_0x1192('0x28')](function(){_0x2c9778['status'](0xcc)[_0x1192('0x1e')]();});}};}function handleEntityNotFound(_0x5aba18,_0x338ec1){return function(_0x559314){if(!_0x559314){_0x5aba18[_0x1192('0x29')](0x194);}return _0x559314;};}function handleError(_0x468b45,_0x492224){_0x492224=_0x492224||0x1f4;return function(_0x11514d){logger['error'](_0x11514d['stack']);if(_0x11514d[_0x1192('0x2a')]){delete _0x11514d[_0x1192('0x2a')];}_0x468b45[_0x1192('0x1d')](_0x492224)[_0x1192('0x2b')](_0x11514d);};}exports[_0x1192('0x2c')]=function(_0x199b7e,_0x54247c){var _0x5d855e={},_0x30a3e1={},_0xf663f6={'count':0x0,'rows':[]};var _0x2ce9ae=_[_0x1192('0x2d')](db[_0x1192('0x2e')][_0x1192('0x2f')],function(_0xde08e0){return{'name':_0xde08e0[_0x1192('0x30')],'type':_0xde08e0[_0x1192('0x31')][_0x1192('0x32')]};});_0x30a3e1['model']=_[_0x1192('0x2d')](_0x2ce9ae,_0x1192('0x2a'));_0x30a3e1['query']=_['keys'](_0x199b7e['query']);_0x30a3e1[_0x1192('0x33')]=_[_0x1192('0x34')](_0x30a3e1[_0x1192('0x35')],_0x30a3e1[_0x1192('0x36')]);_0x5d855e['attributes']=_[_0x1192('0x34')](_0x30a3e1[_0x1192('0x35')],qs[_0x1192('0x37')](_0x199b7e[_0x1192('0x36')][_0x1192('0x37')]));_0x5d855e[_0x1192('0x38')]=_0x5d855e[_0x1192('0x38')][_0x1192('0x39')]?_0x5d855e[_0x1192('0x38')]:_0x30a3e1[_0x1192('0x35')];if(!_0x199b7e[_0x1192('0x36')][_0x1192('0x3a')](_0x1192('0x3b'))){_0x5d855e[_0x1192('0x22')]=qs['limit'](_0x199b7e['query'][_0x1192('0x22')]);_0x5d855e['offset']=qs[_0x1192('0x1f')](_0x199b7e[_0x1192('0x36')][_0x1192('0x1f')]);}_0x5d855e[_0x1192('0x3c')]=qs['sort'](_0x199b7e[_0x1192('0x36')]['sort']);_0x5d855e[_0x1192('0x3d')]=qs['filters'](_[_0x1192('0x3e')](_0x199b7e[_0x1192('0x36')],_0x30a3e1[_0x1192('0x33')]),_0x2ce9ae);if(_0x199b7e[_0x1192('0x36')]['filter']){_0x5d855e[_0x1192('0x3d')]=_[_0x1192('0x3f')](_0x5d855e[_0x1192('0x3d')],{'$or':_[_0x1192('0x2d')](_0x2ce9ae,function(_0x570916){if(_0x570916['type']!=='VIRTUAL'){var _0xa4db15={};_0xa4db15[_0x570916[_0x1192('0x2a')]]={'$like':'%'+_0x199b7e[_0x1192('0x36')]['filter']+'%'};return _0xa4db15;}})});}_0x5d855e=_[_0x1192('0x3f')]({},_0x5d855e,_0x199b7e[_0x1192('0x40')]);var _0x345d1f={'where':_0x5d855e[_0x1192('0x3d')]};return db[_0x1192('0x2e')][_0x1192('0x21')](_0x345d1f)[_0x1192('0x28')](function(_0x4307e7){_0xf663f6[_0x1192('0x21')]=_0x4307e7;if(_0x199b7e[_0x1192('0x36')]['includeAll']){_0x5d855e[_0x1192('0x41')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x5d855e);})['then'](function(_0x4848b1){_0xf663f6[_0x1192('0x42')]=_0x4848b1;return _0xf663f6;})['then'](respondWithFilteredResult(_0x54247c,_0x5d855e))[_0x1192('0x43')](handleError(_0x54247c,null));};exports[_0x1192('0x44')]=function(_0x3e4453,_0x20b79a){var _0x4ec3cc={'raw':!![],'where':{'id':_0x3e4453[_0x1192('0x45')]['id']}},_0x47494f={};_0x47494f[_0x1192('0x35')]=_[_0x1192('0x46')](db[_0x1192('0x2e')][_0x1192('0x2f')]);_0x47494f[_0x1192('0x36')]=_['keys'](_0x3e4453[_0x1192('0x36')]);_0x47494f[_0x1192('0x33')]=_['intersection'](_0x47494f[_0x1192('0x35')],_0x47494f[_0x1192('0x36')]);_0x4ec3cc['attributes']=_[_0x1192('0x34')](_0x47494f[_0x1192('0x35')],qs[_0x1192('0x37')](_0x3e4453[_0x1192('0x36')][_0x1192('0x37')]));_0x4ec3cc[_0x1192('0x38')]=_0x4ec3cc[_0x1192('0x38')][_0x1192('0x39')]?_0x4ec3cc[_0x1192('0x38')]:_0x47494f['model'];if(_0x3e4453[_0x1192('0x36')]['includeAll']){_0x4ec3cc['include']=[{'all':!![]}];}_0x4ec3cc=_['merge']({},_0x4ec3cc,_0x3e4453[_0x1192('0x40')]);return db[_0x1192('0x2e')][_0x1192('0x47')](_0x4ec3cc)[_0x1192('0x28')](handleEntityNotFound(_0x20b79a,null))[_0x1192('0x28')](respondWithResult(_0x20b79a,null))['catch'](handleError(_0x20b79a,null));};exports['create']=function(_0xd4fff4,_0x561a49){return db['SquareMessage'][_0x1192('0x48')](_0xd4fff4[_0x1192('0x49')],{})[_0x1192('0x28')](respondWithResult(_0x561a49,0xc9))[_0x1192('0x43')](handleError(_0x561a49,null));};exports[_0x1192('0x26')]=function(_0x356548,_0x33a31e){if(_0x356548[_0x1192('0x49')]['id']){delete _0x356548[_0x1192('0x49')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x356548['params']['id']}})[_0x1192('0x28')](handleEntityNotFound(_0x33a31e,null))['then'](saveUpdates(_0x356548[_0x1192('0x49')],null))[_0x1192('0x28')](respondWithResult(_0x33a31e,null))[_0x1192('0x43')](handleError(_0x33a31e,null));};exports[_0x1192('0x27')]=function(_0x432b49,_0x42030e){return db[_0x1192('0x2e')]['find']({'where':{'id':_0x432b49[_0x1192('0x45')]['id']}})['then'](handleEntityNotFound(_0x42030e,null))[_0x1192('0x28')](removeEntity(_0x42030e,null))[_0x1192('0x43')](handleError(_0x42030e,null));};
\ No newline at end of file
+var _0xa7fa=['save','update','then','destroy','error','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x4d3ee1,_0x59ed3e){var _0xbb1dfa=function(_0x29d406){while(--_0x29d406){_0x4d3ee1['push'](_0x4d3ee1['shift']());}};_0xbb1dfa(++_0x59ed3e);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaa7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa7f('0x1'));var rp=require(_0xaa7f('0x2'));var moment=require(_0xaa7f('0x3'));var BPromise=require(_0xaa7f('0x4'));var Mustache=require('mustache');var util=require(_0xaa7f('0x5'));var path=require(_0xaa7f('0x6'));var sox=require(_0xaa7f('0x7'));var csv=require(_0xaa7f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaa7f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa7f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaa7f('0xb'));var toCsv=require(_0xaa7f('0x8'));var querystring=require(_0xaa7f('0xc'));var Papa=require(_0xaa7f('0xd'));var Redis=require('ioredis');var authService=require(_0xaa7f('0xe'));var qs=require(_0xaa7f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa7f('0x10'));var logger=require(_0xaa7f('0x11'))(_0xaa7f('0x12'));var utils=require(_0xaa7f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa7f('0x14'))['db'];function respondWithStatusCode(_0x7e736,_0x2d03f3){_0x2d03f3=_0x2d03f3||0xcc;return function(_0x8c42d8){if(_0x8c42d8){return _0x7e736[_0xaa7f('0x15')](_0x2d03f3);}return _0x7e736[_0xaa7f('0x16')](_0x2d03f3)[_0xaa7f('0x17')]();};}function respondWithResult(_0x347929,_0x992494){_0x992494=_0x992494||0xc8;return function(_0x4dfb46){if(_0x4dfb46){return _0x347929[_0xaa7f('0x16')](_0x992494)['json'](_0x4dfb46);}};}function respondWithFilteredResult(_0x3c1615,_0x6ba90d){return function(_0x470c74){if(_0x470c74){var _0x48844f=typeof _0x6ba90d[_0xaa7f('0x18')]===_0xaa7f('0x19')&&typeof _0x6ba90d[_0xaa7f('0x1a')]===_0xaa7f('0x19');var _0x207aff=_0x470c74[_0xaa7f('0x1b')];var _0x2c17c4=_0x48844f?0x0:_0x6ba90d['offset'];var _0x90863a=_0x48844f?_0x470c74[_0xaa7f('0x1b')]:_0x6ba90d[_0xaa7f('0x18')]+_0x6ba90d[_0xaa7f('0x1a')];var _0x4d1119;if(_0x90863a>=_0x207aff){_0x90863a=_0x207aff;_0x4d1119=0xc8;}else{_0x4d1119=0xce;}_0x3c1615['status'](_0x4d1119);return _0x3c1615[_0xaa7f('0x1c')]('Content-Range',_0x2c17c4+'-'+_0x90863a+'/'+_0x207aff)[_0xaa7f('0x1d')](_0x470c74);}return null;};}function patchUpdates(_0x21e870){return function(_0x4eac0b){try{jsonpatch[_0xaa7f('0x1e')](_0x4eac0b,_0x21e870,!![]);}catch(_0x489b56){return BPromise[_0xaa7f('0x1f')](_0x489b56);}return _0x4eac0b[_0xaa7f('0x20')]();};}function saveUpdates(_0x3e203b,_0x516d7e){return function(_0x1436f7){if(_0x1436f7){return _0x1436f7[_0xaa7f('0x21')](_0x3e203b)[_0xaa7f('0x22')](function(_0x3900df){return _0x3900df;});}return null;};}function removeEntity(_0x55363c,_0x5e3d5e){return function(_0x28d627){if(_0x28d627){return _0x28d627[_0xaa7f('0x23')]()[_0xaa7f('0x22')](function(){_0x55363c[_0xaa7f('0x16')](0xcc)[_0xaa7f('0x17')]();});}};}function handleEntityNotFound(_0x1bd627,_0x4b33d3){return function(_0x5442e2){if(!_0x5442e2){_0x1bd627['sendStatus'](0x194);}return _0x5442e2;};}function handleError(_0x40d7f4,_0x4fb956){_0x4fb956=_0x4fb956||0x1f4;return function(_0xbff8a0){logger[_0xaa7f('0x24')](_0xbff8a0['stack']);if(_0xbff8a0[_0xaa7f('0x25')]){delete _0xbff8a0['name'];}_0x40d7f4[_0xaa7f('0x16')](_0x4fb956)[_0xaa7f('0x26')](_0xbff8a0);};}exports[_0xaa7f('0x27')]=function(_0xfcf172,_0x223321){var _0x4983a3={},_0x1541e1={},_0x3e0223={'count':0x0,'rows':[]};var _0x35034b=_['map'](db[_0xaa7f('0x28')][_0xaa7f('0x29')],function(_0x2b2ce2){return{'name':_0x2b2ce2[_0xaa7f('0x2a')],'type':_0x2b2ce2[_0xaa7f('0x2b')][_0xaa7f('0x2c')]};});_0x1541e1['model']=_[_0xaa7f('0x2d')](_0x35034b,_0xaa7f('0x25'));_0x1541e1['query']=_[_0xaa7f('0x2e')](_0xfcf172[_0xaa7f('0x2f')]);_0x1541e1[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x1541e1[_0xaa7f('0x32')],_0x1541e1[_0xaa7f('0x2f')]);_0x4983a3[_0xaa7f('0x33')]=_[_0xaa7f('0x31')](_0x1541e1[_0xaa7f('0x32')],qs[_0xaa7f('0x34')](_0xfcf172[_0xaa7f('0x2f')][_0xaa7f('0x34')]));_0x4983a3[_0xaa7f('0x33')]=_0x4983a3[_0xaa7f('0x33')][_0xaa7f('0x35')]?_0x4983a3['attributes']:_0x1541e1[_0xaa7f('0x32')];if(!_0xfcf172['query'][_0xaa7f('0x36')](_0xaa7f('0x37'))){_0x4983a3['limit']=qs[_0xaa7f('0x1a')](_0xfcf172[_0xaa7f('0x2f')]['limit']);_0x4983a3[_0xaa7f('0x18')]=qs[_0xaa7f('0x18')](_0xfcf172['query']['offset']);}_0x4983a3[_0xaa7f('0x38')]=qs[_0xaa7f('0x39')](_0xfcf172[_0xaa7f('0x2f')][_0xaa7f('0x39')]);_0x4983a3[_0xaa7f('0x3a')]=qs['filters'](_['pick'](_0xfcf172[_0xaa7f('0x2f')],_0x1541e1[_0xaa7f('0x30')]),_0x35034b);if(_0xfcf172[_0xaa7f('0x2f')][_0xaa7f('0x3b')]){_0x4983a3[_0xaa7f('0x3a')]=_[_0xaa7f('0x3c')](_0x4983a3[_0xaa7f('0x3a')],{'$or':_['map'](_0x35034b,function(_0x384555){if(_0x384555[_0xaa7f('0x2b')]!==_0xaa7f('0x3d')){var _0x109084={};_0x109084[_0x384555[_0xaa7f('0x25')]]={'$like':'%'+_0xfcf172[_0xaa7f('0x2f')][_0xaa7f('0x3b')]+'%'};return _0x109084;}})});}_0x4983a3=_[_0xaa7f('0x3c')]({},_0x4983a3,_0xfcf172[_0xaa7f('0x3e')]);var _0x2ad879={'where':_0x4983a3[_0xaa7f('0x3a')]};return db[_0xaa7f('0x28')][_0xaa7f('0x1b')](_0x2ad879)[_0xaa7f('0x22')](function(_0x47a079){_0x3e0223[_0xaa7f('0x1b')]=_0x47a079;if(_0xfcf172[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x4983a3[_0xaa7f('0x40')]=[{'all':!![]}];}return db[_0xaa7f('0x28')][_0xaa7f('0x41')](_0x4983a3);})[_0xaa7f('0x22')](function(_0x3713d5){_0x3e0223['rows']=_0x3713d5;return _0x3e0223;})[_0xaa7f('0x22')](respondWithFilteredResult(_0x223321,_0x4983a3))[_0xaa7f('0x42')](handleError(_0x223321,null));};exports[_0xaa7f('0x43')]=function(_0x243d40,_0x4bc35e){var _0x4cf01c={'raw':!![],'where':{'id':_0x243d40['params']['id']}},_0x132cee={};_0x132cee['model']=_['keys'](db['SquareMessage'][_0xaa7f('0x29')]);_0x132cee[_0xaa7f('0x2f')]=_[_0xaa7f('0x2e')](_0x243d40[_0xaa7f('0x2f')]);_0x132cee[_0xaa7f('0x30')]=_[_0xaa7f('0x31')](_0x132cee[_0xaa7f('0x32')],_0x132cee[_0xaa7f('0x2f')]);_0x4cf01c['attributes']=_[_0xaa7f('0x31')](_0x132cee['model'],qs['fields'](_0x243d40['query'][_0xaa7f('0x34')]));_0x4cf01c[_0xaa7f('0x33')]=_0x4cf01c[_0xaa7f('0x33')][_0xaa7f('0x35')]?_0x4cf01c[_0xaa7f('0x33')]:_0x132cee['model'];if(_0x243d40[_0xaa7f('0x2f')][_0xaa7f('0x3f')]){_0x4cf01c[_0xaa7f('0x40')]=[{'all':!![]}];}_0x4cf01c=_['merge']({},_0x4cf01c,_0x243d40[_0xaa7f('0x3e')]);return db[_0xaa7f('0x28')][_0xaa7f('0x44')](_0x4cf01c)['then'](handleEntityNotFound(_0x4bc35e,null))[_0xaa7f('0x22')](respondWithResult(_0x4bc35e,null))[_0xaa7f('0x42')](handleError(_0x4bc35e,null));};exports[_0xaa7f('0x45')]=function(_0x35566c,_0x12b9b2){return db['SquareMessage'][_0xaa7f('0x45')](_0x35566c[_0xaa7f('0x46')],{})['then'](respondWithResult(_0x12b9b2,0xc9))[_0xaa7f('0x42')](handleError(_0x12b9b2,null));};exports[_0xaa7f('0x21')]=function(_0x38313f,_0x406f7f){if(_0x38313f[_0xaa7f('0x46')]['id']){delete _0x38313f[_0xaa7f('0x46')]['id'];}return db[_0xaa7f('0x28')][_0xaa7f('0x44')]({'where':{'id':_0x38313f['params']['id']}})['then'](handleEntityNotFound(_0x406f7f,null))[_0xaa7f('0x22')](saveUpdates(_0x38313f[_0xaa7f('0x46')],null))[_0xaa7f('0x22')](respondWithResult(_0x406f7f,null))[_0xaa7f('0x42')](handleError(_0x406f7f,null));};exports[_0xaa7f('0x23')]=function(_0x515619,_0x495949){return db['SquareMessage'][_0xaa7f('0x44')]({'where':{'id':_0x515619['params']['id']}})['then'](handleEntityNotFound(_0x495949,null))[_0xaa7f('0x22')](removeEntity(_0x495949,null))[_0xaa7f('0x42')](handleError(_0x495949,null));};
\ No newline at end of file
index 89c0c3f..2336fef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa07=['define','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports'];(function(_0x6be6ad,_0x3f9208){var _0x3b0654=function(_0x2b7ca3){while(--_0x2b7ca3){_0x6be6ad['push'](_0x6be6ad['shift']());}};_0x3b0654(++_0x3f9208);}(_0xaa07,0x1f1));var _0x7aa0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xaa07[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7aa0('0x0'));var util=require(_0x7aa0('0x1'));var logger=require(_0x7aa0('0x2'))(_0x7aa0('0x3'));var moment=require('moment');var BPromise=require(_0x7aa0('0x4'));var rp=require(_0x7aa0('0x5'));var fs=require('fs');var path=require(_0x7aa0('0x6'));var rimraf=require('rimraf');var config=require(_0x7aa0('0x7'));var attributes=require(_0x7aa0('0x8'));module[_0x7aa0('0x9')]=function(_0xf56c66,_0x10c6d4){return _0xf56c66[_0x7aa0('0xa')](_0x7aa0('0xb'),attributes,{'tableName':_0x7aa0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f1d=['../../config/environment','define','square_messages','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5f1d,0x85));var _0xd5f1=function(_0x307daf,_0x55fa81){_0x307daf=_0x307daf-0x0;var _0x4bb763=_0x5f1d[_0x307daf];return _0x4bb763;};'use strict';var _=require('lodash');var util=require(_0xd5f1('0x0'));var logger=require(_0xd5f1('0x1'))(_0xd5f1('0x2'));var moment=require(_0xd5f1('0x3'));var BPromise=require(_0xd5f1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5f1('0x5'));var rimraf=require(_0xd5f1('0x6'));var config=require(_0xd5f1('0x7'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x5191f6,_0x488b5a){return _0x5191f6[_0xd5f1('0x8')]('SquareMessage',attributes,{'tableName':_0xd5f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf448f2..f4be241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12a9=['then','info','SquareMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12a9,0x13b));var _0x912a=function(_0x2571b7,_0x23eddc){_0x2571b7=_0x2571b7-0x0;var _0x47c076=_0x12a9[_0x2571b7];return _0x47c076;};'use strict';var _=require(_0x912a('0x0'));var util=require(_0x912a('0x1'));var moment=require(_0x912a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x912a('0x3'));var db=require(_0x912a('0x4'))['db'];var utils=require(_0x912a('0x5'));var logger=require('../../config/logger')(_0x912a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x912a('0x7')][_0x912a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cbf68,_0x4b2535,_0x1a5ba9){return new BPromise(function(_0x29e1c8,_0x5acf1e){return client[_0x912a('0x9')](_0x2cbf68,_0x1a5ba9)[_0x912a('0xa')](function(_0x5cc9fc){logger[_0x912a('0xb')](_0x912a('0xc'),_0x4b2535,'request\x20sent');logger[_0x912a('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4b2535,_0x912a('0xe'),JSON['stringify'](_0x5cc9fc));if(_0x5cc9fc[_0x912a('0xf')]){if(_0x5cc9fc[_0x912a('0xf')][_0x912a('0x10')]===0x1f4){logger[_0x912a('0xf')](_0x912a('0xc'),_0x4b2535,_0x5cc9fc['error'][_0x912a('0x11')]);return _0x5acf1e(_0x5cc9fc['error'][_0x912a('0x11')]);}logger['error'](_0x912a('0xc'),_0x4b2535,_0x5cc9fc[_0x912a('0xf')][_0x912a('0x11')]);return _0x29e1c8(_0x5cc9fc[_0x912a('0xf')][_0x912a('0x11')]);}else{logger[_0x912a('0xb')]('SquareMessage,\x20%s,\x20%s',_0x4b2535,_0x912a('0xe'));_0x29e1c8(_0x5cc9fc[_0x912a('0x12')][_0x912a('0x11')]);}})[_0x912a('0x13')](function(_0x47e328){logger[_0x912a('0xf')]('SquareMessage,\x20%s,\x20%s',_0x4b2535,_0x47e328);_0x5acf1e(_0x47e328);});});}exports[_0x912a('0x14')]=function(_0x2edffd){var _0x3a90fd=this;return new Promise(function(_0x2ae398,_0x3e0cd3){return db[_0x912a('0x15')]['create'](_0x2edffd[_0x912a('0x16')],{'raw':_0x2edffd[_0x912a('0x17')]?_0x2edffd[_0x912a('0x17')][_0x912a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1d1343){logger[_0x912a('0xb')](_0x912a('0x14'),_0x2edffd);logger[_0x912a('0xd')](_0x912a('0x14'),_0x2edffd,JSON['stringify'](_0x1d1343));_0x2ae398(_0x1d1343);})[_0x912a('0x13')](function(_0x4b4cb6){logger['error'](_0x912a('0x14'),_0x4b4cb6[_0x912a('0x11')],_0x2edffd);_0x3e0cd3(_0x3a90fd[_0x912a('0xf')](0x1f4,_0x4b4cb6['message']));});});};
\ No newline at end of file
+var _0x6eaf=['message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','info','stringify','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x35d794,_0x124a61){var _0x1a5447=function(_0x33dca7){while(--_0x33dca7){_0x35d794['push'](_0x35d794['shift']());}};_0x1a5447(++_0x124a61);}(_0x6eaf,0xfe));var _0xf6ea=function(_0x30d6eb,_0x44d3a4){_0x30d6eb=_0x30d6eb-0x0;var _0x2a6079=_0x6eaf[_0x30d6eb];return _0x2a6079;};'use strict';var _=require('lodash');var util=require(_0xf6ea('0x0'));var moment=require(_0xf6ea('0x1'));var BPromise=require(_0xf6ea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6ea('0x3'));var db=require(_0xf6ea('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6ea('0x5'));var config=require('../../config/environment');var jayson=require(_0xf6ea('0x6'));var client=jayson[_0xf6ea('0x7')][_0xf6ea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65b126,_0x292aa7,_0x55c1ec){return new BPromise(function(_0x5d236b,_0x5b85df){return client[_0xf6ea('0x9')](_0x65b126,_0x55c1ec)['then'](function(_0x5471fc){logger['info']('SquareMessage,\x20%s,\x20%s',_0x292aa7,_0xf6ea('0xa'));logger[_0xf6ea('0xb')](_0xf6ea('0xc'),_0x292aa7,_0xf6ea('0xa'),JSON['stringify'](_0x5471fc));if(_0x5471fc[_0xf6ea('0xd')]){if(_0x5471fc[_0xf6ea('0xd')][_0xf6ea('0xe')]===0x1f4){logger[_0xf6ea('0xd')](_0xf6ea('0xf'),_0x292aa7,_0x5471fc['error'][_0xf6ea('0x10')]);return _0x5b85df(_0x5471fc[_0xf6ea('0xd')][_0xf6ea('0x10')]);}logger[_0xf6ea('0xd')](_0xf6ea('0xf'),_0x292aa7,_0x5471fc['error']['message']);return _0x5d236b(_0x5471fc[_0xf6ea('0xd')][_0xf6ea('0x10')]);}else{logger['info'](_0xf6ea('0xf'),_0x292aa7,_0xf6ea('0xa'));_0x5d236b(_0x5471fc[_0xf6ea('0x11')][_0xf6ea('0x10')]);}})[_0xf6ea('0x12')](function(_0x4608b4){logger[_0xf6ea('0xd')](_0xf6ea('0xf'),_0x292aa7,_0x4608b4);_0x5b85df(_0x4608b4);});});}exports[_0xf6ea('0x13')]=function(_0x58e5fc){var _0x1cd7d8=this;return new Promise(function(_0x48273b,_0x3dd9a6){return db[_0xf6ea('0x14')][_0xf6ea('0x15')](_0x58e5fc[_0xf6ea('0x16')],{'raw':_0x58e5fc[_0xf6ea('0x17')]?_0x58e5fc[_0xf6ea('0x17')][_0xf6ea('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x492c42){logger[_0xf6ea('0x19')](_0xf6ea('0x13'),_0x58e5fc);logger[_0xf6ea('0xb')](_0xf6ea('0x13'),_0x58e5fc,JSON[_0xf6ea('0x1a')](_0x492c42));_0x48273b(_0x492c42);})[_0xf6ea('0x12')](function(_0x327ddf){logger[_0xf6ea('0xd')](_0xf6ea('0x13'),_0x327ddf[_0xf6ea('0x10')],_0x58e5fc);_0x3dd9a6(_0x1cd7d8[_0xf6ea('0xd')](0x1f4,_0x327ddf[_0xf6ea('0x10')]));});});};
\ No newline at end of file
index 3a0f277..ff508d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x104b=['15s','test','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0x104b,0x169));var _0xb104=function(_0x5d8622,_0x5e6092){_0x5d8622=_0x5d8622-0x0;var _0x146c61=_0x104b[_0x5d8622];return _0x146c61;};'use strict';var multer=require(_0xb104('0x0'));var util=require(_0xb104('0x1'));var path=require(_0xb104('0x2'));var timeout=require(_0xb104('0x3'));var express=require(_0xb104('0x4'));var router=express['Router']();var fs_extra=require(_0xb104('0x5'));var auth=require(_0xb104('0x6'));var interaction=require(_0xb104('0x7'));var config=require(_0xb104('0x8'));var controller=require('./squareOdbc.controller');router[_0xb104('0x9')]('/',auth[_0xb104('0xa')](),controller[_0xb104('0xb')]);router[_0xb104('0x9')](_0xb104('0xc'),auth[_0xb104('0xa')](),controller['show']);router[_0xb104('0x9')]('/:id/test',auth[_0xb104('0xa')](),timeout(_0xb104('0xd')),controller[_0xb104('0xe')]);router[_0xb104('0xf')]('/',auth['isAuthenticated'](),controller[_0xb104('0x10')]);router[_0xb104('0x11')](_0xb104('0xc'),auth['isAuthenticated'](),controller[_0xb104('0x12')]);router[_0xb104('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb104('0x14')]);module[_0xb104('0x15')]=router;
\ No newline at end of file
+var _0x3701=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x909449,_0x455246){var _0x3011a6=function(_0x194a37){while(--_0x194a37){_0x909449['push'](_0x909449['shift']());}};_0x3011a6(++_0x455246);}(_0x3701,0x1c9));var _0x1370=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3701[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1370('0x0'));var util=require(_0x1370('0x1'));var path=require(_0x1370('0x2'));var timeout=require(_0x1370('0x3'));var express=require('express');var router=express[_0x1370('0x4')]();var fs_extra=require(_0x1370('0x5'));var auth=require(_0x1370('0x6'));var interaction=require(_0x1370('0x7'));var config=require(_0x1370('0x8'));var controller=require(_0x1370('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1370('0xa')](_0x1370('0xb'),auth[_0x1370('0xc')](),controller[_0x1370('0xd')]);router[_0x1370('0xa')](_0x1370('0xe'),auth[_0x1370('0xc')](),timeout(_0x1370('0xf')),controller[_0x1370('0x10')]);router[_0x1370('0x11')]('/',auth['isAuthenticated'](),controller[_0x1370('0x12')]);router[_0x1370('0x13')](_0x1370('0xb'),auth[_0x1370('0xc')](),controller[_0x1370('0x14')]);router[_0x1370('0x15')](_0x1370('0xb'),auth[_0x1370('0xc')](),controller[_0x1370('0x16')]);module['exports']=router;
\ No newline at end of file
index be04673..6d428dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2e7=['sequelize','name','STRING'];(function(_0x2f66b7,_0x1fe487){var _0x307de8=function(_0x4de0ff){while(--_0x4de0ff){_0x2f66b7['push'](_0x2f66b7['shift']());}};_0x307de8(++_0x1fe487);}(_0xf2e7,0xb4));var _0x7f2e=function(_0x225da3,_0x36ecc7){_0x225da3=_0x225da3-0x0;var _0x1389c1=_0xf2e7[_0x225da3];return _0x1389c1;};'use strict';var Sequelize=require(_0x7f2e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x7f2e('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x7f2e('0x2')]},'description':{'type':Sequelize[_0x7f2e('0x2')]}};
\ No newline at end of file
+var _0xaffc=['name','sequelize','exports','STRING'];(function(_0x2c8b7a,_0x483fe0){var _0x1c1cf9=function(_0x464bcf){while(--_0x464bcf){_0x2c8b7a['push'](_0x2c8b7a['shift']());}};_0x1c1cf9(++_0x483fe0);}(_0xaffc,0x145));var _0xcaff=function(_0x380274,_0x1651c8){_0x380274=_0x380274-0x0;var _0x18e9a5=_0xaffc[_0x380274];return _0x18e9a5;};'use strict';var Sequelize=require(_0xcaff('0x0'));module[_0xcaff('0x1')]={'name':{'type':Sequelize[_0xcaff('0x2')],'unique':_0xcaff('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcaff('0x2')]}};
\ No newline at end of file
index a88b7eb..0b866b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d3d=['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','update','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','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','limit','count','set','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','include','findAll','rows'];(function(_0x19a176,_0x1de8ee){var _0x56eb06=function(_0xaa4723){while(--_0xaa4723){_0x19a176['push'](_0x19a176['shift']());}};_0x56eb06(++_0x1de8ee);}(_0x4d3d,0xba));var _0xd4d3=function(_0x5575a3,_0x5a9736){_0x5575a3=_0x5575a3-0x0;var _0x1195d9=_0x4d3d[_0x5575a3];return _0x1195d9;};'use strict';var emlformat=require(_0xd4d3('0x0'));var rimraf=require(_0xd4d3('0x1'));var zipdir=require(_0xd4d3('0x2'));var jsonpatch=require(_0xd4d3('0x3'));var rp=require(_0xd4d3('0x4'));var moment=require(_0xd4d3('0x5'));var BPromise=require(_0xd4d3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd4d3('0x7'));var sox=require(_0xd4d3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4d3('0x9'));var squel=require(_0xd4d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd4d3('0xb'));var Redis=require(_0xd4d3('0xc'));var authService=require(_0xd4d3('0xd'));var qs=require(_0xd4d3('0xe'));var as=require(_0xd4d3('0xf'));var hardwareService=require(_0xd4d3('0x10'));var logger=require(_0xd4d3('0x11'))(_0xd4d3('0x12'));var utils=require('../../config/utils');var config=require(_0xd4d3('0x13'));var licenseUtil=require(_0xd4d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da920,_0x316e98){_0x316e98=_0x316e98||0xcc;return function(_0x2e1474){if(_0x2e1474){return _0x1da920[_0xd4d3('0x15')](_0x316e98);}return _0x1da920[_0xd4d3('0x16')](_0x316e98)[_0xd4d3('0x17')]();};}function respondWithResult(_0x1a7cd1,_0x5b1a9f){_0x5b1a9f=_0x5b1a9f||0xc8;return function(_0x1d74c6){if(_0x1d74c6){return _0x1a7cd1['status'](_0x5b1a9f)[_0xd4d3('0x18')](_0x1d74c6);}};}function respondWithFilteredResult(_0x1af289,_0x5d19c8){return function(_0x1a0992){if(_0x1a0992){var _0x2f22e4=typeof _0x5d19c8[_0xd4d3('0x19')]===_0xd4d3('0x1a')&&typeof _0x5d19c8[_0xd4d3('0x1b')]===_0xd4d3('0x1a');var _0x4e6147=_0x1a0992[_0xd4d3('0x1c')];var _0x3e6b9b=_0x2f22e4?0x0:_0x5d19c8[_0xd4d3('0x19')];var _0x41d9ee=_0x2f22e4?_0x1a0992[_0xd4d3('0x1c')]:_0x5d19c8[_0xd4d3('0x19')]+_0x5d19c8[_0xd4d3('0x1b')];var _0x5b01bd;if(_0x41d9ee>=_0x4e6147){_0x41d9ee=_0x4e6147;_0x5b01bd=0xc8;}else{_0x5b01bd=0xce;}_0x1af289[_0xd4d3('0x16')](_0x5b01bd);return _0x1af289[_0xd4d3('0x1d')](_0xd4d3('0x1e'),_0x3e6b9b+'-'+_0x41d9ee+'/'+_0x4e6147)[_0xd4d3('0x18')](_0x1a0992);}return null;};}function patchUpdates(_0x455c13){return function(_0x2e11d7){try{jsonpatch[_0xd4d3('0x1f')](_0x2e11d7,_0x455c13,!![]);}catch(_0x1babda){return BPromise['reject'](_0x1babda);}return _0x2e11d7[_0xd4d3('0x20')]();};}function saveUpdates(_0x7345e0,_0x282d07){return function(_0x2b48eb){if(_0x2b48eb){return _0x2b48eb['update'](_0x7345e0)[_0xd4d3('0x21')](function(_0x5af5db){return _0x5af5db;});}return null;};}function removeEntity(_0x542cea,_0x4d4013){return function(_0x38d988){if(_0x38d988){return _0x38d988[_0xd4d3('0x22')]()[_0xd4d3('0x21')](function(){var _0x33a32e=_0x38d988[_0xd4d3('0x23')]({'plain':!![]});var _0x188a8a=_0xd4d3('0x24');return db[_0xd4d3('0x25')]['destroy']({'where':{'type':_0x188a8a,'resourceId':_0x33a32e['id']}})[_0xd4d3('0x21')](function(){return _0x38d988;});})[_0xd4d3('0x21')](function(){_0x542cea['status'](0xcc)[_0xd4d3('0x17')]();});}};}function handleEntityNotFound(_0x145c24,_0x3012be){return function(_0x1b0d5c){if(!_0x1b0d5c){_0x145c24[_0xd4d3('0x15')](0x194);}return _0x1b0d5c;};}function handleError(_0x4bd308,_0x4abe1a){_0x4abe1a=_0x4abe1a||0x1f4;return function(_0xcb4c1){logger[_0xd4d3('0x26')](_0xcb4c1[_0xd4d3('0x27')]);if(_0xcb4c1[_0xd4d3('0x28')]){delete _0xcb4c1[_0xd4d3('0x28')];}_0x4bd308[_0xd4d3('0x16')](_0x4abe1a)['send'](_0xcb4c1);};}exports[_0xd4d3('0x29')]=function(_0x30a858,_0x5c3c9c){var _0x40b954={},_0x7f9a5e={},_0x5edff4={'count':0x0,'rows':[]};var _0x15fd2d=_[_0xd4d3('0x2a')](db[_0xd4d3('0x2b')][_0xd4d3('0x2c')],function(_0x58447e){return{'name':_0x58447e[_0xd4d3('0x2d')],'type':_0x58447e[_0xd4d3('0x2e')][_0xd4d3('0x2f')]};});_0x7f9a5e['model']=_[_0xd4d3('0x2a')](_0x15fd2d,_0xd4d3('0x28'));_0x7f9a5e[_0xd4d3('0x30')]=_[_0xd4d3('0x31')](_0x30a858[_0xd4d3('0x30')]);_0x7f9a5e[_0xd4d3('0x32')]=_[_0xd4d3('0x33')](_0x7f9a5e['model'],_0x7f9a5e[_0xd4d3('0x30')]);_0x40b954[_0xd4d3('0x34')]=_[_0xd4d3('0x33')](_0x7f9a5e[_0xd4d3('0x35')],qs[_0xd4d3('0x36')](_0x30a858['query']['fields']));_0x40b954[_0xd4d3('0x34')]=_0x40b954[_0xd4d3('0x34')][_0xd4d3('0x37')]?_0x40b954[_0xd4d3('0x34')]:_0x7f9a5e[_0xd4d3('0x35')];if(!_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x38')]('nolimit')){_0x40b954['limit']=qs[_0xd4d3('0x1b')](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x1b')]);_0x40b954['offset']=qs[_0xd4d3('0x19')](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x19')]);}_0x40b954[_0xd4d3('0x39')]=qs['sort'](_0x30a858[_0xd4d3('0x30')][_0xd4d3('0x3a')]);_0x40b954[_0xd4d3('0x3b')]=qs[_0xd4d3('0x32')](_['pick'](_0x30a858[_0xd4d3('0x30')],_0x7f9a5e[_0xd4d3('0x32')]),_0x15fd2d);if(_0x30a858[_0xd4d3('0x30')]['filter']){_0x40b954['where']=_['merge'](_0x40b954[_0xd4d3('0x3b')],{'$or':_['map'](_0x15fd2d,function(_0x2cf6b4){if(_0x2cf6b4['type']!=='VIRTUAL'){var _0x3ed98b={};_0x3ed98b[_0x2cf6b4[_0xd4d3('0x28')]]={'$like':'%'+_0x30a858['query'][_0xd4d3('0x3c')]+'%'};return _0x3ed98b;}})});}_0x40b954=_[_0xd4d3('0x3d')]({},_0x40b954,_0x30a858[_0xd4d3('0x3e')]);var _0x531774={'where':_0x40b954[_0xd4d3('0x3b')]};return db[_0xd4d3('0x2b')]['count'](_0x531774)[_0xd4d3('0x21')](function(_0x34cf0f){_0x5edff4[_0xd4d3('0x1c')]=_0x34cf0f;if(_0x30a858['query']['includeAll']){_0x40b954[_0xd4d3('0x3f')]=[{'all':!![]}];}return db[_0xd4d3('0x2b')][_0xd4d3('0x40')](_0x40b954);})['then'](function(_0x463c4b){_0x5edff4[_0xd4d3('0x41')]=_0x463c4b;return _0x5edff4;})[_0xd4d3('0x21')](respondWithFilteredResult(_0x5c3c9c,_0x40b954))['catch'](handleError(_0x5c3c9c,null));};exports['show']=function(_0x244a21,_0x4c6708){var _0x28bc36={'raw':!![],'where':{'id':_0x244a21[_0xd4d3('0x42')]['id']}},_0x43677d={};_0x43677d[_0xd4d3('0x35')]=_[_0xd4d3('0x31')](db[_0xd4d3('0x2b')][_0xd4d3('0x2c')]);_0x43677d['query']=_[_0xd4d3('0x31')](_0x244a21[_0xd4d3('0x30')]);_0x43677d['filters']=_[_0xd4d3('0x33')](_0x43677d[_0xd4d3('0x35')],_0x43677d['query']);_0x28bc36[_0xd4d3('0x34')]=_[_0xd4d3('0x33')](_0x43677d['model'],qs[_0xd4d3('0x36')](_0x244a21['query']['fields']));_0x28bc36[_0xd4d3('0x34')]=_0x28bc36['attributes']['length']?_0x28bc36[_0xd4d3('0x34')]:_0x43677d[_0xd4d3('0x35')];if(_0x244a21[_0xd4d3('0x30')]['includeAll']){_0x28bc36[_0xd4d3('0x3f')]=[{'all':!![]}];}_0x28bc36=_['merge']({},_0x28bc36,_0x244a21[_0xd4d3('0x3e')]);return db[_0xd4d3('0x2b')][_0xd4d3('0x43')](_0x28bc36)['then'](handleEntityNotFound(_0x4c6708,null))[_0xd4d3('0x21')](respondWithResult(_0x4c6708,null))[_0xd4d3('0x44')](handleError(_0x4c6708,null));};exports[_0xd4d3('0x45')]=function(_0x4067bc,_0x2431f9){return db[_0xd4d3('0x2b')]['create'](_0x4067bc[_0xd4d3('0x46')],{})[_0xd4d3('0x21')](function(_0x410875){var _0x3aa951=_0x4067bc[_0xd4d3('0x47')]['get']({'plain':!![]});if(!_0x3aa951)throw new Error(_0xd4d3('0x48'));if(_0x3aa951[_0xd4d3('0x49')]===_0xd4d3('0x47')){var _0x3590c8=_0x410875[_0xd4d3('0x23')]({'plain':!![]});var _0x5a8411='ODBC';return db[_0xd4d3('0x4a')]['find']({'where':{'name':_0x5a8411,'userProfileId':_0x3aa951[_0xd4d3('0x4b')]},'raw':!![]})[_0xd4d3('0x21')](function(_0x29bca0){if(_0x29bca0&&_0x29bca0[_0xd4d3('0x4c')]===0x0){return db['UserProfileResource'][_0xd4d3('0x45')]({'name':_0x3590c8[_0xd4d3('0x28')],'resourceId':_0x3590c8['id'],'type':_0x29bca0[_0xd4d3('0x28')],'sectionId':_0x29bca0['id']},{})['then'](function(){return _0x410875;});}else{return _0x410875;}})['catch'](function(_0x4c3b9a){logger['error'](_0xd4d3('0x4d'),_0x4c3b9a);throw _0x4c3b9a;});}return _0x410875;})[_0xd4d3('0x21')](respondWithResult(_0x2431f9,0xc9))[_0xd4d3('0x44')](handleError(_0x2431f9,null));};exports[_0xd4d3('0x4e')]=function(_0x3c4796,_0x1cf0cb){if(_0x3c4796['body']['id']){delete _0x3c4796['body']['id'];}return db[_0xd4d3('0x2b')][_0xd4d3('0x43')]({'where':{'id':_0x3c4796[_0xd4d3('0x42')]['id']}})[_0xd4d3('0x21')](handleEntityNotFound(_0x1cf0cb,null))['then'](saveUpdates(_0x3c4796[_0xd4d3('0x46')],null))[_0xd4d3('0x21')](respondWithResult(_0x1cf0cb,null))[_0xd4d3('0x44')](handleError(_0x1cf0cb,null));};exports[_0xd4d3('0x22')]=function(_0x11aebb,_0x21e3b9){return db['SquareOdbc'][_0xd4d3('0x43')]({'where':{'id':_0x11aebb[_0xd4d3('0x42')]['id']}})[_0xd4d3('0x21')](handleEntityNotFound(_0x21e3b9,null))['then'](removeEntity(_0x21e3b9,null))[_0xd4d3('0x44')](handleError(_0x21e3b9,null));};exports[_0xd4d3('0x4f')]=function(_0x3b4136,_0x25a2cd,_0x1bb709){var _0x2f0d42;return db[_0xd4d3('0x2b')][_0xd4d3('0x43')]({'where':{'id':_0x3b4136[_0xd4d3('0x42')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x25a2cd,null))[_0xd4d3('0x21')](function(_0x1ace85){if(_0x1ace85){var _0x8ee232=require(_0xd4d3('0x50'))();_0x8ee232[_0xd4d3('0x51')](_0x1ace85[_0xd4d3('0x52')]);_0x8ee232[_0xd4d3('0x53')]();return _0x1ace85;}})[_0xd4d3('0x21')](respondWithResult(_0x25a2cd,null))[_0xd4d3('0x44')](handleError(_0x25a2cd,null));};
\ No newline at end of file
+var _0x2f50=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2f8127,_0x1bc641){var _0x9ca7bb=function(_0x2817c9){while(--_0x2817c9){_0x2f8127['push'](_0x2f8127['shift']());}};_0x9ca7bb(++_0x1bc641);}(_0x2f50,0x15f));var _0x02f5=function(_0x19bdca,_0x4710cc){_0x19bdca=_0x19bdca-0x0;var _0x9e0470=_0x2f50[_0x19bdca];return _0x9e0470;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f5('0x0'));var zipdir=require(_0x02f5('0x1'));var jsonpatch=require(_0x02f5('0x2'));var rp=require(_0x02f5('0x3'));var moment=require(_0x02f5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x02f5('0x5'));var util=require(_0x02f5('0x6'));var path=require(_0x02f5('0x7'));var sox=require('sox');var csv=require(_0x02f5('0x8'));var ejs=require(_0x02f5('0x9'));var fs=require('fs');var fs_extra=require(_0x02f5('0xa'));var _=require(_0x02f5('0xb'));var squel=require(_0x02f5('0xc'));var crypto=require(_0x02f5('0xd'));var jsforce=require(_0x02f5('0xe'));var deskjs=require(_0x02f5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x02f5('0x10'));var Papa=require('papaparse');var Redis=require(_0x02f5('0x11'));var authService=require(_0x02f5('0x12'));var qs=require(_0x02f5('0x13'));var as=require(_0x02f5('0x14'));var hardwareService=require(_0x02f5('0x15'));var logger=require(_0x02f5('0x16'))(_0x02f5('0x17'));var utils=require(_0x02f5('0x18'));var config=require(_0x02f5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f5('0x1a'))['db'];function respondWithStatusCode(_0x913d00,_0x3314fa){_0x3314fa=_0x3314fa||0xcc;return function(_0x53c141){if(_0x53c141){return _0x913d00[_0x02f5('0x1b')](_0x3314fa);}return _0x913d00[_0x02f5('0x1c')](_0x3314fa)[_0x02f5('0x1d')]();};}function respondWithResult(_0x3f1e0b,_0x5c5213){_0x5c5213=_0x5c5213||0xc8;return function(_0x53a0c6){if(_0x53a0c6){return _0x3f1e0b[_0x02f5('0x1c')](_0x5c5213)[_0x02f5('0x1e')](_0x53a0c6);}};}function respondWithFilteredResult(_0x2d2af2,_0xbae3f4){return function(_0x322d17){if(_0x322d17){var _0x51e084=typeof _0xbae3f4[_0x02f5('0x1f')]===_0x02f5('0x20')&&typeof _0xbae3f4[_0x02f5('0x21')]===_0x02f5('0x20');var _0x39395b=_0x322d17['count'];var _0x4bd27b=_0x51e084?0x0:_0xbae3f4['offset'];var _0x35406e=_0x51e084?_0x322d17[_0x02f5('0x22')]:_0xbae3f4[_0x02f5('0x1f')]+_0xbae3f4[_0x02f5('0x21')];var _0x2d4c4e;if(_0x35406e>=_0x39395b){_0x35406e=_0x39395b;_0x2d4c4e=0xc8;}else{_0x2d4c4e=0xce;}_0x2d2af2[_0x02f5('0x1c')](_0x2d4c4e);return _0x2d2af2['set'](_0x02f5('0x23'),_0x4bd27b+'-'+_0x35406e+'/'+_0x39395b)[_0x02f5('0x1e')](_0x322d17);}return null;};}function patchUpdates(_0x1eb717){return function(_0x5bf336){try{jsonpatch[_0x02f5('0x24')](_0x5bf336,_0x1eb717,!![]);}catch(_0x4d2e6a){return BPromise[_0x02f5('0x25')](_0x4d2e6a);}return _0x5bf336['save']();};}function saveUpdates(_0x36bdf9,_0x519665){return function(_0x9b1008){if(_0x9b1008){return _0x9b1008[_0x02f5('0x26')](_0x36bdf9)[_0x02f5('0x27')](function(_0x1c496e){return _0x1c496e;});}return null;};}function removeEntity(_0x39320b,_0x296b1f){return function(_0x90f769){if(_0x90f769){return _0x90f769[_0x02f5('0x28')]()['then'](function(){var _0xe8c1af=_0x90f769[_0x02f5('0x29')]({'plain':!![]});var _0x1a4d5e='ODBC';return db[_0x02f5('0x2a')][_0x02f5('0x28')]({'where':{'type':_0x1a4d5e,'resourceId':_0xe8c1af['id']}})[_0x02f5('0x27')](function(){return _0x90f769;});})[_0x02f5('0x27')](function(){_0x39320b[_0x02f5('0x1c')](0xcc)[_0x02f5('0x1d')]();});}};}function handleEntityNotFound(_0x3d8661,_0x44c81e){return function(_0x3ffcbd){if(!_0x3ffcbd){_0x3d8661[_0x02f5('0x1b')](0x194);}return _0x3ffcbd;};}function handleError(_0x44f2b6,_0x5aaa76){_0x5aaa76=_0x5aaa76||0x1f4;return function(_0x5def68){logger[_0x02f5('0x2b')](_0x5def68[_0x02f5('0x2c')]);if(_0x5def68[_0x02f5('0x2d')]){delete _0x5def68[_0x02f5('0x2d')];}_0x44f2b6[_0x02f5('0x1c')](_0x5aaa76)[_0x02f5('0x2e')](_0x5def68);};}exports[_0x02f5('0x2f')]=function(_0x1841d7,_0xa8a9d2){var _0x42537e={},_0x5d8f5c={},_0xbf5882={'count':0x0,'rows':[]};var _0x9214fa=_[_0x02f5('0x30')](db[_0x02f5('0x31')][_0x02f5('0x32')],function(_0x1b3c98){return{'name':_0x1b3c98[_0x02f5('0x33')],'type':_0x1b3c98[_0x02f5('0x34')][_0x02f5('0x35')]};});_0x5d8f5c['model']=_[_0x02f5('0x30')](_0x9214fa,_0x02f5('0x2d'));_0x5d8f5c[_0x02f5('0x36')]=_[_0x02f5('0x37')](_0x1841d7[_0x02f5('0x36')]);_0x5d8f5c[_0x02f5('0x38')]=_[_0x02f5('0x39')](_0x5d8f5c[_0x02f5('0x3a')],_0x5d8f5c['query']);_0x42537e[_0x02f5('0x3b')]=_['intersection'](_0x5d8f5c[_0x02f5('0x3a')],qs[_0x02f5('0x3c')](_0x1841d7[_0x02f5('0x36')][_0x02f5('0x3c')]));_0x42537e[_0x02f5('0x3b')]=_0x42537e[_0x02f5('0x3b')][_0x02f5('0x3d')]?_0x42537e[_0x02f5('0x3b')]:_0x5d8f5c[_0x02f5('0x3a')];if(!_0x1841d7[_0x02f5('0x36')][_0x02f5('0x3e')](_0x02f5('0x3f'))){_0x42537e[_0x02f5('0x21')]=qs['limit'](_0x1841d7[_0x02f5('0x36')][_0x02f5('0x21')]);_0x42537e[_0x02f5('0x1f')]=qs[_0x02f5('0x1f')](_0x1841d7[_0x02f5('0x36')][_0x02f5('0x1f')]);}_0x42537e[_0x02f5('0x40')]=qs[_0x02f5('0x41')](_0x1841d7[_0x02f5('0x36')][_0x02f5('0x41')]);_0x42537e['where']=qs[_0x02f5('0x38')](_[_0x02f5('0x42')](_0x1841d7[_0x02f5('0x36')],_0x5d8f5c['filters']),_0x9214fa);if(_0x1841d7[_0x02f5('0x36')]['filter']){_0x42537e[_0x02f5('0x43')]=_[_0x02f5('0x44')](_0x42537e[_0x02f5('0x43')],{'$or':_[_0x02f5('0x30')](_0x9214fa,function(_0x5024b8){if(_0x5024b8[_0x02f5('0x34')]!==_0x02f5('0x45')){var _0x31ad89={};_0x31ad89[_0x5024b8[_0x02f5('0x2d')]]={'$like':'%'+_0x1841d7[_0x02f5('0x36')][_0x02f5('0x46')]+'%'};return _0x31ad89;}})});}_0x42537e=_['merge']({},_0x42537e,_0x1841d7[_0x02f5('0x47')]);var _0x43861f={'where':_0x42537e['where']};return db[_0x02f5('0x31')][_0x02f5('0x22')](_0x43861f)[_0x02f5('0x27')](function(_0x1e3f7b){_0xbf5882[_0x02f5('0x22')]=_0x1e3f7b;if(_0x1841d7[_0x02f5('0x36')][_0x02f5('0x48')]){_0x42537e[_0x02f5('0x49')]=[{'all':!![]}];}return db[_0x02f5('0x31')]['findAll'](_0x42537e);})[_0x02f5('0x27')](function(_0x2fcee2){_0xbf5882[_0x02f5('0x4a')]=_0x2fcee2;return _0xbf5882;})[_0x02f5('0x27')](respondWithFilteredResult(_0xa8a9d2,_0x42537e))[_0x02f5('0x4b')](handleError(_0xa8a9d2,null));};exports['show']=function(_0x1e0835,_0x5e4fd9){var _0x5a4c65={'raw':!![],'where':{'id':_0x1e0835[_0x02f5('0x4c')]['id']}},_0x318f95={};_0x318f95['model']=_['keys'](db[_0x02f5('0x31')][_0x02f5('0x32')]);_0x318f95[_0x02f5('0x36')]=_['keys'](_0x1e0835['query']);_0x318f95['filters']=_[_0x02f5('0x39')](_0x318f95['model'],_0x318f95[_0x02f5('0x36')]);_0x5a4c65[_0x02f5('0x3b')]=_[_0x02f5('0x39')](_0x318f95['model'],qs[_0x02f5('0x3c')](_0x1e0835[_0x02f5('0x36')]['fields']));_0x5a4c65[_0x02f5('0x3b')]=_0x5a4c65[_0x02f5('0x3b')][_0x02f5('0x3d')]?_0x5a4c65[_0x02f5('0x3b')]:_0x318f95[_0x02f5('0x3a')];if(_0x1e0835[_0x02f5('0x36')][_0x02f5('0x48')]){_0x5a4c65[_0x02f5('0x49')]=[{'all':!![]}];}_0x5a4c65=_[_0x02f5('0x44')]({},_0x5a4c65,_0x1e0835[_0x02f5('0x47')]);return db['SquareOdbc'][_0x02f5('0x4d')](_0x5a4c65)[_0x02f5('0x27')](handleEntityNotFound(_0x5e4fd9,null))[_0x02f5('0x27')](respondWithResult(_0x5e4fd9,null))[_0x02f5('0x4b')](handleError(_0x5e4fd9,null));};exports[_0x02f5('0x4e')]=function(_0x3b0d92,_0x24ac23){return db[_0x02f5('0x31')][_0x02f5('0x4e')](_0x3b0d92[_0x02f5('0x4f')],{})['then'](function(_0x38ecfc){var _0xa2709e=_0x3b0d92[_0x02f5('0x50')]['get']({'plain':!![]});if(!_0xa2709e)throw new Error(_0x02f5('0x51'));if(_0xa2709e[_0x02f5('0x52')]===_0x02f5('0x50')){var _0x30b580=_0x38ecfc[_0x02f5('0x29')]({'plain':!![]});var _0x1396b2='ODBC';return db[_0x02f5('0x53')]['find']({'where':{'name':_0x1396b2,'userProfileId':_0xa2709e[_0x02f5('0x54')]},'raw':!![]})['then'](function(_0x5b06f2){if(_0x5b06f2&&_0x5b06f2['autoAssociation']===0x0){return db[_0x02f5('0x2a')][_0x02f5('0x4e')]({'name':_0x30b580[_0x02f5('0x2d')],'resourceId':_0x30b580['id'],'type':_0x5b06f2['name'],'sectionId':_0x5b06f2['id']},{})[_0x02f5('0x27')](function(){return _0x38ecfc;});}else{return _0x38ecfc;}})[_0x02f5('0x4b')](function(_0x35a74a){logger[_0x02f5('0x2b')](_0x02f5('0x55'),_0x35a74a);throw _0x35a74a;});}return _0x38ecfc;})[_0x02f5('0x27')](respondWithResult(_0x24ac23,0xc9))[_0x02f5('0x4b')](handleError(_0x24ac23,null));};exports[_0x02f5('0x26')]=function(_0x3d33eb,_0x3fa7e7){if(_0x3d33eb['body']['id']){delete _0x3d33eb['body']['id'];}return db['SquareOdbc'][_0x02f5('0x4d')]({'where':{'id':_0x3d33eb[_0x02f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fa7e7,null))[_0x02f5('0x27')](saveUpdates(_0x3d33eb[_0x02f5('0x4f')],null))[_0x02f5('0x27')](respondWithResult(_0x3fa7e7,null))['catch'](handleError(_0x3fa7e7,null));};exports[_0x02f5('0x28')]=function(_0x1a024a,_0x120282){return db[_0x02f5('0x31')][_0x02f5('0x4d')]({'where':{'id':_0x1a024a[_0x02f5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x120282,null))[_0x02f5('0x27')](removeEntity(_0x120282,null))[_0x02f5('0x4b')](handleError(_0x120282,null));};exports[_0x02f5('0x56')]=function(_0x1ef9f6,_0x2fd209,_0x5daf54){var _0x34e4d3;return db['SquareOdbc']['find']({'where':{'id':_0x1ef9f6[_0x02f5('0x4c')]['id']},'attributes':['id',_0x02f5('0x57')]})[_0x02f5('0x27')](handleEntityNotFound(_0x2fd209,null))['then'](function(_0x4d0e45){if(_0x4d0e45){var _0x1a5b1f=require(_0x02f5('0x58'))();_0x1a5b1f[_0x02f5('0x59')](_0x4d0e45[_0x02f5('0x57')]);_0x1a5b1f[_0x02f5('0x5a')]();return _0x4d0e45;}})[_0x02f5('0x27')](respondWithResult(_0x2fd209,null))['catch'](handleError(_0x2fd209,null));};
\ No newline at end of file
index bef3d03..aaded5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda4=['exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x1fc249,_0x190811){var _0x4d5ab3=function(_0x1de3ce){while(--_0x1de3ce){_0x1fc249['push'](_0x1fc249['shift']());}};_0x4d5ab3(++_0x190811);}(_0xeda4,0x154));var _0x4eda=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xeda4[_0x456b57];return _0x18f49f;};'use strict';var _=require(_0x4eda('0x0'));var util=require('util');var logger=require(_0x4eda('0x1'))(_0x4eda('0x2'));var moment=require(_0x4eda('0x3'));var BPromise=require(_0x4eda('0x4'));var rp=require(_0x4eda('0x5'));var fs=require('fs');var path=require(_0x4eda('0x6'));var rimraf=require(_0x4eda('0x7'));var config=require(_0x4eda('0x8'));var attributes=require(_0x4eda('0x9'));module[_0x4eda('0xa')]=function(_0x3c9a57,_0x4d51bc){return _0x3c9a57[_0x4eda('0xb')](_0x4eda('0xc'),attributes,{'tableName':_0x4eda('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfcf=['path','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x14e329,_0x3d4e6c){var _0x4f7747=function(_0x53b8ea){while(--_0x53b8ea){_0x14e329['push'](_0x14e329['shift']());}};_0x4f7747(++_0x3d4e6c);}(_0xbfcf,0x122));var _0xfbfc=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xbfcf[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xfbfc('0x0'));var util=require(_0xfbfc('0x1'));var logger=require(_0xfbfc('0x2'))(_0xfbfc('0x3'));var moment=require(_0xfbfc('0x4'));var BPromise=require(_0xfbfc('0x5'));var rp=require(_0xfbfc('0x6'));var fs=require('fs');var path=require(_0xfbfc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbfc('0x8'));module['exports']=function(_0x5a71c0,_0x348501){return _0x5a71c0['define'](_0xfbfc('0x9'),attributes,{'tableName':_0xfbfc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 71a5b6a..5ef4ed5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e19=['stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','info','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6e19,0x16d));var _0x96e1=function(_0x1af3e4,_0x4bb7ef){_0x1af3e4=_0x1af3e4-0x0;var _0x5a7ba4=_0x6e19[_0x1af3e4];return _0x5a7ba4;};'use strict';var _=require('lodash');var util=require(_0x96e1('0x0'));var moment=require(_0x96e1('0x1'));var BPromise=require(_0x96e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96e1('0x3'));var db=require(_0x96e1('0x4'))['db'];var utils=require(_0x96e1('0x5'));var logger=require('../../config/logger')(_0x96e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x96e1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cafed,_0x1136c1,_0x32087f){return new BPromise(function(_0x8700a7,_0x27d3f1){return client[_0x96e1('0x8')](_0x1cafed,_0x32087f)[_0x96e1('0x9')](function(_0x261a24){logger['info'](_0x96e1('0xa'),_0x1136c1,'request\x20sent');logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x1136c1,_0x96e1('0xb'),JSON[_0x96e1('0xc')](_0x261a24));if(_0x261a24[_0x96e1('0xd')]){if(_0x261a24[_0x96e1('0xd')]['code']===0x1f4){logger[_0x96e1('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x1136c1,_0x261a24['error'][_0x96e1('0xe')]);return _0x27d3f1(_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);}logger['error'](_0x96e1('0xa'),_0x1136c1,_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);return _0x8700a7(_0x261a24[_0x96e1('0xd')][_0x96e1('0xe')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x1136c1,_0x96e1('0xb'));_0x8700a7(_0x261a24[_0x96e1('0xf')]['message']);}})['catch'](function(_0x265592){logger[_0x96e1('0xd')](_0x96e1('0xa'),_0x1136c1,_0x265592);_0x27d3f1(_0x265592);});});}exports[_0x96e1('0x10')]=function(_0x2cee43){var _0x3bafe9=this;return new Promise(function(_0x268cfa,_0x3db100){return db[_0x96e1('0x11')][_0x96e1('0x12')]({'raw':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x14')]===undefined?!![]:![]:!![],'where':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x15')]||null:null,'attributes':_0x2cee43[_0x96e1('0x13')]?_0x2cee43['options']['attributes']||null:null,'include':_0x2cee43[_0x96e1('0x13')]?_0x2cee43[_0x96e1('0x13')][_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x2cee43['options'][_0x96e1('0x16')],function(_0x2c4d75){return{'model':db[_0x2c4d75[_0x96e1('0x18')]],'as':_0x2c4d75['as'],'attributes':_0x2c4d75[_0x96e1('0x19')],'include':_0x2c4d75[_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x2c4d75[_0x96e1('0x16')],function(_0x279b8e){return{'model':db[_0x279b8e[_0x96e1('0x18')]],'as':_0x279b8e['as'],'attributes':_0x279b8e['attributes'],'include':_0x279b8e[_0x96e1('0x16')]?_[_0x96e1('0x17')](_0x279b8e[_0x96e1('0x16')],function(_0x328590){return{'model':db[_0x328590[_0x96e1('0x18')]],'as':_0x328590['as'],'attributes':_0x328590[_0x96e1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b0ea6){logger[_0x96e1('0x1a')]('ShowSquareOdbc',_0x2cee43);logger[_0x96e1('0x1b')](_0x96e1('0x10'),_0x2cee43,JSON[_0x96e1('0xc')](_0x3b0ea6));_0x268cfa(_0x3b0ea6);})[_0x96e1('0x1c')](function(_0x1ea688){logger[_0x96e1('0xd')](_0x96e1('0x10'),_0x1ea688['message'],_0x2cee43);_0x3db100(_0x3bafe9['error'](0x1f4,_0x1ea688[_0x96e1('0xe')]));});});};
\ No newline at end of file
+var _0x23e5=['info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then'];(function(_0x55bb63,_0x571215){var _0x1fb927=function(_0x21014b){while(--_0x21014b){_0x55bb63['push'](_0x55bb63['shift']());}};_0x1fb927(++_0x571215);}(_0x23e5,0x17c));var _0x523e=function(_0x162976,_0xea1272){_0x162976=_0x162976-0x0;var _0x1898ad=_0x23e5[_0x162976];return _0x1898ad;};'use strict';var _=require('lodash');var util=require(_0x523e('0x0'));var moment=require(_0x523e('0x1'));var BPromise=require(_0x523e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x523e('0x3'));var db=require(_0x523e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x523e('0x5'));var config=require('../../config/environment');var jayson=require(_0x523e('0x6'));var client=jayson[_0x523e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568ef8,_0x221b1d,_0x2a1fbe){return new BPromise(function(_0x81c41c,_0x35062f){return client[_0x523e('0x8')](_0x568ef8,_0x2a1fbe)[_0x523e('0x9')](function(_0x58fe16){logger[_0x523e('0xa')](_0x523e('0xb'),_0x221b1d,_0x523e('0xc'));logger[_0x523e('0xd')](_0x523e('0xe'),_0x221b1d,_0x523e('0xc'),JSON[_0x523e('0xf')](_0x58fe16));if(_0x58fe16[_0x523e('0x10')]){if(_0x58fe16[_0x523e('0x10')][_0x523e('0x11')]===0x1f4){logger[_0x523e('0x10')](_0x523e('0xb'),_0x221b1d,_0x58fe16[_0x523e('0x10')][_0x523e('0x12')]);return _0x35062f(_0x58fe16[_0x523e('0x10')]['message']);}logger[_0x523e('0x10')](_0x523e('0xb'),_0x221b1d,_0x58fe16['error'][_0x523e('0x12')]);return _0x81c41c(_0x58fe16[_0x523e('0x10')][_0x523e('0x12')]);}else{logger[_0x523e('0xa')](_0x523e('0xb'),_0x221b1d,'request\x20sent');_0x81c41c(_0x58fe16['result'][_0x523e('0x12')]);}})['catch'](function(_0x35cc37){logger[_0x523e('0x10')](_0x523e('0xb'),_0x221b1d,_0x35cc37);_0x35062f(_0x35cc37);});});}exports[_0x523e('0x13')]=function(_0x528a39){var _0x559969=this;return new Promise(function(_0x521c49,_0x4cec69){return db[_0x523e('0x14')][_0x523e('0x15')]({'raw':_0x528a39[_0x523e('0x16')]?_0x528a39['options'][_0x523e('0x17')]===undefined?!![]:![]:!![],'where':_0x528a39[_0x523e('0x16')]?_0x528a39[_0x523e('0x16')][_0x523e('0x18')]||null:null,'attributes':_0x528a39[_0x523e('0x16')]?_0x528a39[_0x523e('0x16')]['attributes']||null:null,'include':_0x528a39['options']?_0x528a39[_0x523e('0x16')][_0x523e('0x19')]?_[_0x523e('0x1a')](_0x528a39['options'][_0x523e('0x19')],function(_0x2eaa04){return{'model':db[_0x2eaa04[_0x523e('0x1b')]],'as':_0x2eaa04['as'],'attributes':_0x2eaa04[_0x523e('0x1c')],'include':_0x2eaa04[_0x523e('0x19')]?_[_0x523e('0x1a')](_0x2eaa04[_0x523e('0x19')],function(_0xd53dbd){return{'model':db[_0xd53dbd['model']],'as':_0xd53dbd['as'],'attributes':_0xd53dbd['attributes'],'include':_0xd53dbd[_0x523e('0x19')]?_['map'](_0xd53dbd[_0x523e('0x19')],function(_0x3dcce6){return{'model':db[_0x3dcce6[_0x523e('0x1b')]],'as':_0x3dcce6['as'],'attributes':_0x3dcce6[_0x523e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x523e('0x9')](function(_0x147dd8){logger[_0x523e('0xa')](_0x523e('0x13'),_0x528a39);logger[_0x523e('0xd')](_0x523e('0x13'),_0x528a39,JSON[_0x523e('0xf')](_0x147dd8));_0x521c49(_0x147dd8);})[_0x523e('0x1d')](function(_0x17c7f1){logger[_0x523e('0x10')]('ShowSquareOdbc',_0x17c7f1[_0x523e('0x12')],_0x528a39);_0x4cec69(_0x559969['error'](0x1f4,_0x17c7f1[_0x523e('0x12')]));});});};
\ No newline at end of file
index 1ec50c6..e7cc08d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x174b=['get','isAuthenticated','index','/:id','show','/:id/users','post','create','put','update','delete','removeUsers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x394cbe,_0xc005e){var _0x3de7ec=function(_0x4ed371){while(--_0x4ed371){_0x394cbe['push'](_0x394cbe['shift']());}};_0x3de7ec(++_0xc005e);}(_0x174b,0x19d));var _0xb174=function(_0x35b764,_0x11b9bb){_0x35b764=_0x35b764-0x0;var _0x4cded2=_0x174b[_0x35b764];return _0x4cded2;};'use strict';var multer=require(_0xb174('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb174('0x1'));var express=require(_0xb174('0x2'));var router=express[_0xb174('0x3')]();var fs_extra=require(_0xb174('0x4'));var auth=require(_0xb174('0x5'));var interaction=require(_0xb174('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xb174('0x7')]('/',auth[_0xb174('0x8')](),controller[_0xb174('0x9')]);router[_0xb174('0x7')](_0xb174('0xa'),auth[_0xb174('0x8')](),controller[_0xb174('0xb')]);router[_0xb174('0x7')](_0xb174('0xc'),auth[_0xb174('0x8')](),controller['getUsers']);router[_0xb174('0xd')]('/',auth['isAuthenticated'](),controller[_0xb174('0xe')]);router[_0xb174('0xd')]('/:id/users',auth[_0xb174('0x8')](),controller['addUsers']);router[_0xb174('0xf')](_0xb174('0xa'),auth['isAuthenticated'](),controller[_0xb174('0x10')]);router[_0xb174('0x11')](_0xb174('0xa'),auth[_0xb174('0x8')](),controller['destroy']);router[_0xb174('0x11')]('/:id/users',auth[_0xb174('0x8')](),controller[_0xb174('0x12')]);module[_0xb174('0x13')]=router;
\ No newline at end of file
+var _0xbac6=['addUsers','put','delete','destroy','removeUsers','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xbac6,0x1ec));var _0x6bac=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xbac6[_0x3cb30b];return _0x2ca717;};'use strict';var multer=require(_0x6bac('0x0'));var util=require(_0x6bac('0x1'));var path=require(_0x6bac('0x2'));var timeout=require('connect-timeout');var express=require(_0x6bac('0x3'));var router=express['Router']();var fs_extra=require(_0x6bac('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6bac('0x5'));var config=require(_0x6bac('0x6'));var controller=require('./squareProject.controller');router[_0x6bac('0x7')]('/',auth['isAuthenticated'](),controller[_0x6bac('0x8')]);router['get'](_0x6bac('0x9'),auth[_0x6bac('0xa')](),controller['show']);router['get']('/:id/users',auth['isAuthenticated'](),controller['getUsers']);router[_0x6bac('0xb')]('/',auth[_0x6bac('0xa')](),controller['create']);router['post']('/:id/users',auth[_0x6bac('0xa')](),controller[_0x6bac('0xc')]);router[_0x6bac('0xd')](_0x6bac('0x9'),auth[_0x6bac('0xa')](),controller['update']);router[_0x6bac('0xe')](_0x6bac('0x9'),auth['isAuthenticated'](),controller[_0x6bac('0xf')]);router['delete']('/:id/users',auth[_0x6bac('0xa')](),controller[_0x6bac('0x10')]);module[_0x6bac('0x11')]=router;
\ No newline at end of file
index c0d873c..3a7657f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ce9=['STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports'];(function(_0x13413f,_0x23ea3d){var _0x108bd9=function(_0x497358){while(--_0x497358){_0x13413f['push'](_0x13413f['shift']());}};_0x108bd9(++_0x23ea3d);}(_0x0ce9,0x9a));var _0x90ce=function(_0x13827c,_0x2c55e1){_0x13827c=_0x13827c-0x0;var _0x47f641=_0x0ce9[_0x13827c];return _0x47f641;};'use strict';var Sequelize=require(_0x90ce('0x0'));module[_0x90ce('0x1')]={'name':{'type':Sequelize[_0x90ce('0x2')],'unique':_0x90ce('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x90ce('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x90ce('0x4')](_0x90ce('0x5')),'get':function(){if(this[_0x90ce('0x6')]('preproduction')){return this[_0x90ce('0x6')](_0x90ce('0x7'))[_0x90ce('0x8')](_0x90ce('0x9'));}}},'production':{'type':Sequelize[_0x90ce('0x4')]('long'),'get':function(){if(this[_0x90ce('0x6')]('production')){return this['getDataValue'](_0x90ce('0xa'))[_0x90ce('0x8')](_0x90ce('0x9'));}}},'savedAt':{'type':Sequelize[_0x90ce('0xb')]},'publishedAt':{'type':Sequelize[_0x90ce('0xb')]}};
\ No newline at end of file
+var _0xe41b=['exports','STRING','TEXT','BLOB','getDataValue','preproduction','utf8','long','toString','DATE'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0xe41b,0x1ea));var _0xbe41=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe41b[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require('sequelize');module[_0xbe41('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbe41('0x1')]},'notes':{'type':Sequelize[_0xbe41('0x2')]},'preproduction':{'type':Sequelize[_0xbe41('0x3')]('long'),'get':function(){if(this[_0xbe41('0x4')](_0xbe41('0x5'))){return this[_0xbe41('0x4')](_0xbe41('0x5'))['toString'](_0xbe41('0x6'));}}},'production':{'type':Sequelize[_0xbe41('0x3')](_0xbe41('0x7')),'get':function(){if(this[_0xbe41('0x4')]('production')){return this[_0xbe41('0x4')]('production')[_0xbe41('0x8')](_0xbe41('0x6'));}}},'savedAt':{'type':Sequelize[_0xbe41('0x9')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 4ac4ecf..4a37bb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bfc=['rawAttributes','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','SquareProjects','destroy','sendStatus','error','name','send','index','map','SquareProject','fieldName','type','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0x4bfc,0x19e));var _0xc4bf=function(_0x5985fa,_0x49637d){_0x5985fa=_0x5985fa-0x0;var _0x3d65ca=_0x4bfc[_0x5985fa];return _0x3d65ca;};'use strict';var emlformat=require(_0xc4bf('0x0'));var rimraf=require(_0xc4bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4bf('0x2'));var rp=require('request-promise');var moment=require(_0xc4bf('0x3'));var BPromise=require(_0xc4bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc4bf('0x5'));var sox=require(_0xc4bf('0x6'));var csv=require(_0xc4bf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4bf('0x8'));var jsforce=require(_0xc4bf('0x9'));var deskjs=require(_0xc4bf('0xa'));var toCsv=require('to-csv');var querystring=require(_0xc4bf('0xb'));var Papa=require(_0xc4bf('0xc'));var Redis=require(_0xc4bf('0xd'));var authService=require(_0xc4bf('0xe'));var qs=require(_0xc4bf('0xf'));var as=require(_0xc4bf('0x10'));var hardwareService=require(_0xc4bf('0x11'));var logger=require(_0xc4bf('0x12'))(_0xc4bf('0x13'));var utils=require(_0xc4bf('0x14'));var config=require(_0xc4bf('0x15'));var licenseUtil=require(_0xc4bf('0x16'));var db=require(_0xc4bf('0x17'))['db'];config[_0xc4bf('0x18')]=_[_0xc4bf('0x19')](config[_0xc4bf('0x18')],{'host':_0xc4bf('0x1a'),'port':0x18eb});var socket=require(_0xc4bf('0x1b'))(new Redis(config[_0xc4bf('0x18')]));require(_0xc4bf('0x1c'))[_0xc4bf('0x1d')](socket);function respondWithStatusCode(_0x4a3258,_0x3c1dcb){_0x3c1dcb=_0x3c1dcb||0xcc;return function(_0x36dc76){if(_0x36dc76){return _0x4a3258['sendStatus'](_0x3c1dcb);}return _0x4a3258[_0xc4bf('0x1e')](_0x3c1dcb)[_0xc4bf('0x1f')]();};}function respondWithResult(_0x20584a,_0x1f9900){_0x1f9900=_0x1f9900||0xc8;return function(_0x4b252f){if(_0x4b252f){return _0x20584a[_0xc4bf('0x1e')](_0x1f9900)[_0xc4bf('0x20')](_0x4b252f);}};}function respondWithFilteredResult(_0x3cb54f,_0x4fa5a3){return function(_0x1fd9ae){if(_0x1fd9ae){var _0x4a58a2=typeof _0x4fa5a3[_0xc4bf('0x21')]===_0xc4bf('0x22')&&typeof _0x4fa5a3[_0xc4bf('0x23')]===_0xc4bf('0x22');var _0x2d761f=_0x1fd9ae[_0xc4bf('0x24')];var _0x1aae75=_0x4a58a2?0x0:_0x4fa5a3[_0xc4bf('0x21')];var _0x261780=_0x4a58a2?_0x1fd9ae[_0xc4bf('0x24')]:_0x4fa5a3[_0xc4bf('0x21')]+_0x4fa5a3[_0xc4bf('0x23')];var _0x46c1d7;if(_0x261780>=_0x2d761f){_0x261780=_0x2d761f;_0x46c1d7=0xc8;}else{_0x46c1d7=0xce;}_0x3cb54f[_0xc4bf('0x1e')](_0x46c1d7);return _0x3cb54f[_0xc4bf('0x25')]('Content-Range',_0x1aae75+'-'+_0x261780+'/'+_0x2d761f)[_0xc4bf('0x20')](_0x1fd9ae);}return null;};}function patchUpdates(_0x3e31a8){return function(_0x39b6f4){try{jsonpatch[_0xc4bf('0x26')](_0x39b6f4,_0x3e31a8,!![]);}catch(_0x522843){return BPromise[_0xc4bf('0x27')](_0x522843);}return _0x39b6f4[_0xc4bf('0x28')]();};}function saveUpdates(_0x3887ae,_0x52253d){return function(_0x43794f){if(_0x43794f){return _0x43794f[_0xc4bf('0x29')](_0x3887ae)[_0xc4bf('0x2a')](function(_0x41aac5){return _0x41aac5;});}return null;};}function removeEntity(_0x5739e4,_0x479944){return function(_0x27674e){if(_0x27674e){return _0x27674e['destroy']()[_0xc4bf('0x2a')](function(){var _0x577fcf=_0x27674e[_0xc4bf('0x2b')]({'plain':!![]});var _0x168e7a=_0xc4bf('0x2c');return db['UserProfileResource'][_0xc4bf('0x2d')]({'where':{'type':_0x168e7a,'resourceId':_0x577fcf['id']}})[_0xc4bf('0x2a')](function(){return _0x27674e;});})[_0xc4bf('0x2a')](function(){_0x5739e4['status'](0xcc)[_0xc4bf('0x1f')]();});}};}function handleEntityNotFound(_0x53018b,_0x47b084){return function(_0xf75ec){if(!_0xf75ec){_0x53018b[_0xc4bf('0x2e')](0x194);}return _0xf75ec;};}function handleError(_0x36845d,_0x64ca59){_0x64ca59=_0x64ca59||0x1f4;return function(_0x42c627){logger[_0xc4bf('0x2f')](_0x42c627['stack']);if(_0x42c627['name']){delete _0x42c627[_0xc4bf('0x30')];}_0x36845d[_0xc4bf('0x1e')](_0x64ca59)[_0xc4bf('0x31')](_0x42c627);};}exports[_0xc4bf('0x32')]=function(_0x1b6c46,_0x5c3d65){var _0x10e779={},_0x572d62={},_0x173859={'count':0x0,'rows':[]};var _0x39af56=_[_0xc4bf('0x33')](db[_0xc4bf('0x34')]['rawAttributes'],function(_0x4e0ce8){return{'name':_0x4e0ce8[_0xc4bf('0x35')],'type':_0x4e0ce8[_0xc4bf('0x36')]['key']};});_0x572d62['model']=_['map'](_0x39af56,_0xc4bf('0x30'));_0x572d62[_0xc4bf('0x37')]=_['keys'](_0x1b6c46['query']);_0x572d62[_0xc4bf('0x38')]=_['intersection'](_0x572d62[_0xc4bf('0x39')],_0x572d62[_0xc4bf('0x37')]);_0x10e779['attributes']=_[_0xc4bf('0x3a')](_0x572d62['model'],qs['fields'](_0x1b6c46['query'][_0xc4bf('0x3b')]));_0x10e779['attributes']=_0x10e779[_0xc4bf('0x3c')]['length']?_0x10e779[_0xc4bf('0x3c')]:_0x572d62[_0xc4bf('0x39')];if(!_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x3d')](_0xc4bf('0x3e'))){_0x10e779['limit']=qs[_0xc4bf('0x23')](_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x23')]);_0x10e779[_0xc4bf('0x21')]=qs['offset'](_0x1b6c46['query'][_0xc4bf('0x21')]);}_0x10e779[_0xc4bf('0x3f')]=qs['sort'](_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x40')]);_0x10e779[_0xc4bf('0x41')]=qs['filters'](_[_0xc4bf('0x42')](_0x1b6c46[_0xc4bf('0x37')],_0x572d62[_0xc4bf('0x38')]),_0x39af56);if(_0x1b6c46[_0xc4bf('0x37')][_0xc4bf('0x43')]){_0x10e779[_0xc4bf('0x41')]=_[_0xc4bf('0x44')](_0x10e779['where'],{'$or':_[_0xc4bf('0x33')](_0x39af56,function(_0x2077dd){if(_0x2077dd['type']!==_0xc4bf('0x45')){var _0x23df2d={};_0x23df2d[_0x2077dd[_0xc4bf('0x30')]]={'$like':'%'+_0x1b6c46['query'][_0xc4bf('0x43')]+'%'};return _0x23df2d;}})});}_0x10e779=_[_0xc4bf('0x44')]({},_0x10e779,_0x1b6c46[_0xc4bf('0x46')]);var _0x31f026={'where':_0x10e779[_0xc4bf('0x41')]};return db[_0xc4bf('0x34')][_0xc4bf('0x24')](_0x31f026)['then'](function(_0x526a80){_0x173859[_0xc4bf('0x24')]=_0x526a80;if(_0x1b6c46['query']['includeAll']){_0x10e779[_0xc4bf('0x47')]=[{'all':!![]}];}return db[_0xc4bf('0x34')][_0xc4bf('0x48')](_0x10e779);})[_0xc4bf('0x2a')](function(_0x324805){_0x173859['rows']=_0x324805;return _0x173859;})[_0xc4bf('0x2a')](respondWithFilteredResult(_0x5c3d65,_0x10e779))[_0xc4bf('0x49')](handleError(_0x5c3d65,null));};exports['show']=function(_0x2eb881,_0x5c5b44){var _0x52d4b5={'raw':![],'where':{'id':_0x2eb881[_0xc4bf('0x4a')]['id']}},_0x257de9={};_0x257de9[_0xc4bf('0x39')]=_[_0xc4bf('0x4b')](db[_0xc4bf('0x34')][_0xc4bf('0x4c')]);_0x257de9[_0xc4bf('0x37')]=_[_0xc4bf('0x4b')](_0x2eb881[_0xc4bf('0x37')]);_0x257de9[_0xc4bf('0x38')]=_[_0xc4bf('0x3a')](_0x257de9['model'],_0x257de9[_0xc4bf('0x37')]);_0x52d4b5[_0xc4bf('0x3c')]=_['intersection'](_0x257de9['model'],qs[_0xc4bf('0x3b')](_0x2eb881[_0xc4bf('0x37')][_0xc4bf('0x3b')]));_0x52d4b5['attributes']=_0x52d4b5[_0xc4bf('0x3c')][_0xc4bf('0x4d')]?_0x52d4b5[_0xc4bf('0x3c')]:_0x257de9[_0xc4bf('0x39')];if(_0x2eb881['query'][_0xc4bf('0x4e')]){_0x52d4b5[_0xc4bf('0x47')]=[{'all':!![]}];}_0x52d4b5=_['merge']({},_0x52d4b5,_0x2eb881[_0xc4bf('0x46')]);return db[_0xc4bf('0x34')][_0xc4bf('0x4f')](_0x52d4b5)['then'](handleEntityNotFound(_0x5c5b44,null))['then'](respondWithResult(_0x5c5b44,null))[_0xc4bf('0x49')](handleError(_0x5c5b44,null));};exports[_0xc4bf('0x50')]=function(_0xc61a4d,_0x2e8d2f){return db[_0xc4bf('0x34')][_0xc4bf('0x50')](_0xc61a4d[_0xc4bf('0x51')],{})[_0xc4bf('0x2a')](function(_0x5dfac6){var _0x5a6b10=_0xc61a4d[_0xc4bf('0x52')][_0xc4bf('0x2b')]({'plain':!![]});if(!_0x5a6b10)throw new Error(_0xc4bf('0x53'));if(_0x5a6b10[_0xc4bf('0x54')]===_0xc4bf('0x52')){var _0x107ecb=_0x5dfac6['get']({'plain':!![]});var _0x801a52=_0xc4bf('0x2c');return db['UserProfileSection'][_0xc4bf('0x4f')]({'where':{'name':_0x801a52,'userProfileId':_0x5a6b10[_0xc4bf('0x55')]},'raw':!![]})[_0xc4bf('0x2a')](function(_0x431668){if(_0x431668&&_0x431668[_0xc4bf('0x56')]===0x0){return db[_0xc4bf('0x57')][_0xc4bf('0x50')]({'name':_0x107ecb[_0xc4bf('0x30')],'resourceId':_0x107ecb['id'],'type':_0x431668[_0xc4bf('0x30')],'sectionId':_0x431668['id']},{})[_0xc4bf('0x2a')](function(){return _0x5dfac6;});}else{return _0x5dfac6;}})[_0xc4bf('0x49')](function(_0xecd00d){logger[_0xc4bf('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xecd00d);throw _0xecd00d;});}return _0x5dfac6;})['then'](respondWithResult(_0x2e8d2f,0xc9))[_0xc4bf('0x49')](handleError(_0x2e8d2f,null));};exports[_0xc4bf('0x29')]=function(_0x5dec9a,_0xafe1ed){if(_0x5dec9a[_0xc4bf('0x51')]['id']){delete _0x5dec9a[_0xc4bf('0x51')]['id'];}return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x5dec9a['params']['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0xafe1ed,null))[_0xc4bf('0x2a')](saveUpdates(_0x5dec9a['body'],null))[_0xc4bf('0x2a')](respondWithResult(_0xafe1ed,null))[_0xc4bf('0x49')](handleError(_0xafe1ed,null));};exports['destroy']=function(_0x5a8314,_0xfc6dd){return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x5a8314[_0xc4bf('0x4a')]['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0xfc6dd,null))[_0xc4bf('0x2a')](removeEntity(_0xfc6dd,null))[_0xc4bf('0x49')](handleError(_0xfc6dd,null));};exports[_0xc4bf('0x58')]=function(_0x351902,_0x2d790f,_0x539f61){return db[_0xc4bf('0x34')]['find']({'where':{'id':_0x351902['params']['id']}})['then'](handleEntityNotFound(_0x2d790f,null))['then'](function(_0x16b91a){if(_0x16b91a){return _0x16b91a[_0xc4bf('0x58')](_0x351902[_0xc4bf('0x51')][_0xc4bf('0x59')],_[_0xc4bf('0x5a')](_0x351902[_0xc4bf('0x51')],['ids','id'])||{});}})[_0xc4bf('0x2a')](respondWithResult(_0x2d790f,null))[_0xc4bf('0x49')](handleError(_0x2d790f,null));};exports[_0xc4bf('0x5b')]=function(_0x3941e0,_0x29b5aa,_0x4f9f39){return db[_0xc4bf('0x34')][_0xc4bf('0x4f')]({'where':{'id':_0x3941e0[_0xc4bf('0x4a')]['id']}})[_0xc4bf('0x2a')](handleEntityNotFound(_0x29b5aa,null))[_0xc4bf('0x2a')](function(_0x30bbfa){if(_0x30bbfa){return _0x30bbfa[_0xc4bf('0x5b')](_0x3941e0[_0xc4bf('0x37')]['ids'])['then'](function(){if(_[_0xc4bf('0x5c')](_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')])){for(var _0x3f763d=0x0;_0x3f763d<_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')][_0xc4bf('0x4d')];_0x3f763d+=0x1){socket[_0xc4bf('0x5d')](_0xc4bf('0x5e'),{'UserId':Number(_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')][_0x3f763d]),'SquareProjectId':Number(_0x3941e0[_0xc4bf('0x4a')]['id'])});}}else{socket['emit'](_0xc4bf('0x5e'),{'UserId':Number(_0x3941e0[_0xc4bf('0x37')][_0xc4bf('0x59')]),'SquareProjectId':Number(_0x3941e0['params']['id'])});}});}})[_0xc4bf('0x2a')](respondWithStatusCode(_0x29b5aa,null))[_0xc4bf('0x49')](handleError(_0x29b5aa,null));};exports[_0xc4bf('0x5f')]=function(_0x374494,_0x4ad7e9,_0xb7d3f2){var _0x220d3d={};var _0x5b8de9={};var _0x28c174;var _0x554b66;return db['SquareProject'][_0xc4bf('0x60')]({'where':{'id':_0x374494[_0xc4bf('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ad7e9,null))['then'](function(_0x21a4e4){if(_0x21a4e4){_0x28c174=_0x21a4e4;_0x5b8de9[_0xc4bf('0x39')]=_[_0xc4bf('0x4b')](db[_0xc4bf('0x61')]['rawAttributes']);_0x5b8de9[_0xc4bf('0x37')]=_[_0xc4bf('0x4b')](_0x374494[_0xc4bf('0x37')]);_0x5b8de9[_0xc4bf('0x38')]=_[_0xc4bf('0x3a')](_0x5b8de9[_0xc4bf('0x39')],_0x5b8de9[_0xc4bf('0x37')]);_0x220d3d[_0xc4bf('0x3c')]=_[_0xc4bf('0x3a')](_0x5b8de9[_0xc4bf('0x39')],qs[_0xc4bf('0x3b')](_0x374494[_0xc4bf('0x37')]['fields']));_0x220d3d[_0xc4bf('0x3c')]=_0x220d3d[_0xc4bf('0x3c')]['length']?_0x220d3d[_0xc4bf('0x3c')]:_0x5b8de9[_0xc4bf('0x39')];_0x220d3d['order']=qs[_0xc4bf('0x40')](_0x374494[_0xc4bf('0x37')][_0xc4bf('0x40')]);_0x220d3d[_0xc4bf('0x41')]=qs[_0xc4bf('0x38')](_[_0xc4bf('0x42')](_0x374494['query'],_0x5b8de9['filters']));if(_0x374494[_0xc4bf('0x37')][_0xc4bf('0x43')]){_0x220d3d[_0xc4bf('0x41')]=_[_0xc4bf('0x44')](_0x220d3d[_0xc4bf('0x41')],{'$or':_[_0xc4bf('0x33')](_0x220d3d[_0xc4bf('0x3c')],function(_0x350cb2){var _0x4eacc3={};_0x4eacc3[_0x350cb2]={'$like':'%'+_0x374494[_0xc4bf('0x37')]['filter']+'%'};return _0x4eacc3;})});}_0x220d3d=_[_0xc4bf('0x44')]({},_0x220d3d,_0x374494[_0xc4bf('0x46')]);return _0x28c174['getUsers'](_0x220d3d);}})[_0xc4bf('0x2a')](function(_0x2a3dea){if(_0x2a3dea){_0x554b66=_0x2a3dea[_0xc4bf('0x4d')];if(!_0x374494['query']['hasOwnProperty']('nolimit')){_0x220d3d['limit']=qs[_0xc4bf('0x23')](_0x374494[_0xc4bf('0x37')]['limit']);_0x220d3d['offset']=qs[_0xc4bf('0x21')](_0x374494[_0xc4bf('0x37')][_0xc4bf('0x21')]);}return _0x28c174['getUsers'](_0x220d3d);}})[_0xc4bf('0x2a')](function(_0x19c8a5){if(_0x19c8a5){return _0x19c8a5?{'count':_0x554b66,'rows':_0x19c8a5}:null;}})[_0xc4bf('0x2a')](respondWithResult(_0x4ad7e9,null))[_0xc4bf('0x49')](handleError(_0x4ad7e9,null));};
\ No newline at end of file
+var _0x59ac=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','SquareProjects','UserProfileResource','stack','name','send','index','SquareProject','rawAttributes','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','get'];(function(_0x171b12,_0x12b66e){var _0x27ee5a=function(_0x4528b3){while(--_0x4528b3){_0x171b12['push'](_0x171b12['shift']());}};_0x27ee5a(++_0x12b66e);}(_0x59ac,0x73));var _0xc59a=function(_0x1f74f0,_0x3492a8){_0x1f74f0=_0x1f74f0-0x0;var _0x513768=_0x59ac[_0x1f74f0];return _0x513768;};'use strict';var emlformat=require(_0xc59a('0x0'));var rimraf=require(_0xc59a('0x1'));var zipdir=require(_0xc59a('0x2'));var jsonpatch=require(_0xc59a('0x3'));var rp=require(_0xc59a('0x4'));var moment=require('moment');var BPromise=require(_0xc59a('0x5'));var Mustache=require(_0xc59a('0x6'));var util=require('util');var path=require(_0xc59a('0x7'));var sox=require(_0xc59a('0x8'));var csv=require(_0xc59a('0x9'));var ejs=require(_0xc59a('0xa'));var fs=require('fs');var fs_extra=require(_0xc59a('0xb'));var _=require('lodash');var squel=require(_0xc59a('0xc'));var crypto=require('crypto');var jsforce=require(_0xc59a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc59a('0x9'));var querystring=require('querystring');var Papa=require(_0xc59a('0xe'));var Redis=require('ioredis');var authService=require(_0xc59a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc59a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc59a('0x11'))(_0xc59a('0x12'));var utils=require(_0xc59a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc59a('0x14'));var db=require(_0xc59a('0x15'))['db'];config[_0xc59a('0x16')]=_['defaults'](config[_0xc59a('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc59a('0x17'))(new Redis(config[_0xc59a('0x16')]));require(_0xc59a('0x18'))[_0xc59a('0x19')](socket);function respondWithStatusCode(_0x977fe1,_0xf4aa70){_0xf4aa70=_0xf4aa70||0xcc;return function(_0x41c72a){if(_0x41c72a){return _0x977fe1[_0xc59a('0x1a')](_0xf4aa70);}return _0x977fe1[_0xc59a('0x1b')](_0xf4aa70)[_0xc59a('0x1c')]();};}function respondWithResult(_0x1a8c66,_0xb9eae4){_0xb9eae4=_0xb9eae4||0xc8;return function(_0x297fc4){if(_0x297fc4){return _0x1a8c66[_0xc59a('0x1b')](_0xb9eae4)[_0xc59a('0x1d')](_0x297fc4);}};}function respondWithFilteredResult(_0xe264c6,_0x2284c0){return function(_0x3686f6){if(_0x3686f6){var _0x257a64=typeof _0x2284c0[_0xc59a('0x1e')]===_0xc59a('0x1f')&&typeof _0x2284c0['limit']===_0xc59a('0x1f');var _0x8ba061=_0x3686f6['count'];var _0x3e7a66=_0x257a64?0x0:_0x2284c0[_0xc59a('0x1e')];var _0x49a637=_0x257a64?_0x3686f6[_0xc59a('0x20')]:_0x2284c0['offset']+_0x2284c0[_0xc59a('0x21')];var _0x47e28e;if(_0x49a637>=_0x8ba061){_0x49a637=_0x8ba061;_0x47e28e=0xc8;}else{_0x47e28e=0xce;}_0xe264c6[_0xc59a('0x1b')](_0x47e28e);return _0xe264c6['set'](_0xc59a('0x22'),_0x3e7a66+'-'+_0x49a637+'/'+_0x8ba061)[_0xc59a('0x1d')](_0x3686f6);}return null;};}function patchUpdates(_0x3d1d20){return function(_0x40ec35){try{jsonpatch[_0xc59a('0x23')](_0x40ec35,_0x3d1d20,!![]);}catch(_0x2cf82b){return BPromise['reject'](_0x2cf82b);}return _0x40ec35[_0xc59a('0x24')]();};}function saveUpdates(_0x208a40,_0x45da9c){return function(_0x1077aa){if(_0x1077aa){return _0x1077aa[_0xc59a('0x25')](_0x208a40)[_0xc59a('0x26')](function(_0x5ae91d){return _0x5ae91d;});}return null;};}function removeEntity(_0x4142b5,_0xac4f47){return function(_0x24d124){if(_0x24d124){return _0x24d124[_0xc59a('0x27')]()[_0xc59a('0x26')](function(){var _0xdea542=_0x24d124['get']({'plain':!![]});var _0x359053=_0xc59a('0x28');return db[_0xc59a('0x29')]['destroy']({'where':{'type':_0x359053,'resourceId':_0xdea542['id']}})[_0xc59a('0x26')](function(){return _0x24d124;});})[_0xc59a('0x26')](function(){_0x4142b5[_0xc59a('0x1b')](0xcc)[_0xc59a('0x1c')]();});}};}function handleEntityNotFound(_0x47f046,_0x480144){return function(_0x5253d1){if(!_0x5253d1){_0x47f046[_0xc59a('0x1a')](0x194);}return _0x5253d1;};}function handleError(_0x55cf24,_0x13109e){_0x13109e=_0x13109e||0x1f4;return function(_0x1d8b75){logger['error'](_0x1d8b75[_0xc59a('0x2a')]);if(_0x1d8b75[_0xc59a('0x2b')]){delete _0x1d8b75[_0xc59a('0x2b')];}_0x55cf24[_0xc59a('0x1b')](_0x13109e)[_0xc59a('0x2c')](_0x1d8b75);};}exports[_0xc59a('0x2d')]=function(_0x2b7403,_0x1860a8){var _0x24c0ef={},_0x58e906={},_0x3f4df0={'count':0x0,'rows':[]};var _0xdafc79=_['map'](db[_0xc59a('0x2e')][_0xc59a('0x2f')],function(_0x387ae5){return{'name':_0x387ae5['fieldName'],'type':_0x387ae5[_0xc59a('0x30')][_0xc59a('0x31')]};});_0x58e906[_0xc59a('0x32')]=_[_0xc59a('0x33')](_0xdafc79,_0xc59a('0x2b'));_0x58e906['query']=_['keys'](_0x2b7403[_0xc59a('0x34')]);_0x58e906[_0xc59a('0x35')]=_[_0xc59a('0x36')](_0x58e906[_0xc59a('0x32')],_0x58e906[_0xc59a('0x34')]);_0x24c0ef[_0xc59a('0x37')]=_['intersection'](_0x58e906['model'],qs['fields'](_0x2b7403['query']['fields']));_0x24c0ef[_0xc59a('0x37')]=_0x24c0ef[_0xc59a('0x37')][_0xc59a('0x38')]?_0x24c0ef[_0xc59a('0x37')]:_0x58e906['model'];if(!_0x2b7403['query'][_0xc59a('0x39')](_0xc59a('0x3a'))){_0x24c0ef[_0xc59a('0x21')]=qs[_0xc59a('0x21')](_0x2b7403[_0xc59a('0x34')][_0xc59a('0x21')]);_0x24c0ef['offset']=qs[_0xc59a('0x1e')](_0x2b7403[_0xc59a('0x34')][_0xc59a('0x1e')]);}_0x24c0ef['order']=qs['sort'](_0x2b7403[_0xc59a('0x34')][_0xc59a('0x3b')]);_0x24c0ef['where']=qs[_0xc59a('0x35')](_[_0xc59a('0x3c')](_0x2b7403[_0xc59a('0x34')],_0x58e906[_0xc59a('0x35')]),_0xdafc79);if(_0x2b7403[_0xc59a('0x34')][_0xc59a('0x3d')]){_0x24c0ef[_0xc59a('0x3e')]=_[_0xc59a('0x3f')](_0x24c0ef[_0xc59a('0x3e')],{'$or':_['map'](_0xdafc79,function(_0x47fcfc){if(_0x47fcfc[_0xc59a('0x30')]!==_0xc59a('0x40')){var _0x1a123e={};_0x1a123e[_0x47fcfc['name']]={'$like':'%'+_0x2b7403[_0xc59a('0x34')]['filter']+'%'};return _0x1a123e;}})});}_0x24c0ef=_['merge']({},_0x24c0ef,_0x2b7403[_0xc59a('0x41')]);var _0x177150={'where':_0x24c0ef[_0xc59a('0x3e')]};return db[_0xc59a('0x2e')]['count'](_0x177150)['then'](function(_0xcd38a5){_0x3f4df0['count']=_0xcd38a5;if(_0x2b7403[_0xc59a('0x34')][_0xc59a('0x42')]){_0x24c0ef[_0xc59a('0x43')]=[{'all':!![]}];}return db['SquareProject'][_0xc59a('0x44')](_0x24c0ef);})[_0xc59a('0x26')](function(_0x57c336){_0x3f4df0[_0xc59a('0x45')]=_0x57c336;return _0x3f4df0;})['then'](respondWithFilteredResult(_0x1860a8,_0x24c0ef))[_0xc59a('0x46')](handleError(_0x1860a8,null));};exports[_0xc59a('0x47')]=function(_0x328091,_0x3ea6d3){var _0x2f1222={'raw':![],'where':{'id':_0x328091[_0xc59a('0x48')]['id']}},_0x5ac8ec={};_0x5ac8ec['model']=_[_0xc59a('0x49')](db['SquareProject'][_0xc59a('0x2f')]);_0x5ac8ec['query']=_['keys'](_0x328091[_0xc59a('0x34')]);_0x5ac8ec[_0xc59a('0x35')]=_[_0xc59a('0x36')](_0x5ac8ec[_0xc59a('0x32')],_0x5ac8ec[_0xc59a('0x34')]);_0x2f1222['attributes']=_[_0xc59a('0x36')](_0x5ac8ec[_0xc59a('0x32')],qs[_0xc59a('0x4a')](_0x328091[_0xc59a('0x34')]['fields']));_0x2f1222[_0xc59a('0x37')]=_0x2f1222[_0xc59a('0x37')][_0xc59a('0x38')]?_0x2f1222[_0xc59a('0x37')]:_0x5ac8ec[_0xc59a('0x32')];if(_0x328091['query'][_0xc59a('0x42')]){_0x2f1222[_0xc59a('0x43')]=[{'all':!![]}];}_0x2f1222=_[_0xc59a('0x3f')]({},_0x2f1222,_0x328091[_0xc59a('0x41')]);return db[_0xc59a('0x2e')][_0xc59a('0x4b')](_0x2f1222)[_0xc59a('0x26')](handleEntityNotFound(_0x3ea6d3,null))[_0xc59a('0x26')](respondWithResult(_0x3ea6d3,null))['catch'](handleError(_0x3ea6d3,null));};exports[_0xc59a('0x4c')]=function(_0x1519e,_0x60bbbc){return db[_0xc59a('0x2e')][_0xc59a('0x4c')](_0x1519e[_0xc59a('0x4d')],{})[_0xc59a('0x26')](function(_0x2d025f){var _0x1c46c0=_0x1519e['user'][_0xc59a('0x4e')]({'plain':!![]});if(!_0x1c46c0)throw new Error(_0xc59a('0x4f'));if(_0x1c46c0[_0xc59a('0x50')]===_0xc59a('0x51')){var _0x3caafd=_0x2d025f['get']({'plain':!![]});var _0x473024=_0xc59a('0x28');return db[_0xc59a('0x52')]['find']({'where':{'name':_0x473024,'userProfileId':_0x1c46c0[_0xc59a('0x53')]},'raw':!![]})[_0xc59a('0x26')](function(_0x13225a){if(_0x13225a&&_0x13225a[_0xc59a('0x54')]===0x0){return db[_0xc59a('0x29')][_0xc59a('0x4c')]({'name':_0x3caafd[_0xc59a('0x2b')],'resourceId':_0x3caafd['id'],'type':_0x13225a[_0xc59a('0x2b')],'sectionId':_0x13225a['id']},{})['then'](function(){return _0x2d025f;});}else{return _0x2d025f;}})['catch'](function(_0x162b82){logger[_0xc59a('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x162b82);throw _0x162b82;});}return _0x2d025f;})[_0xc59a('0x26')](respondWithResult(_0x60bbbc,0xc9))[_0xc59a('0x46')](handleError(_0x60bbbc,null));};exports[_0xc59a('0x25')]=function(_0xd88f1b,_0x2322db){if(_0xd88f1b['body']['id']){delete _0xd88f1b[_0xc59a('0x4d')]['id'];}return db[_0xc59a('0x2e')][_0xc59a('0x4b')]({'where':{'id':_0xd88f1b[_0xc59a('0x48')]['id']}})['then'](handleEntityNotFound(_0x2322db,null))[_0xc59a('0x26')](saveUpdates(_0xd88f1b[_0xc59a('0x4d')],null))[_0xc59a('0x26')](respondWithResult(_0x2322db,null))[_0xc59a('0x46')](handleError(_0x2322db,null));};exports[_0xc59a('0x27')]=function(_0x2295ac,_0x2547ae){return db['SquareProject'][_0xc59a('0x4b')]({'where':{'id':_0x2295ac[_0xc59a('0x48')]['id']}})['then'](handleEntityNotFound(_0x2547ae,null))[_0xc59a('0x26')](removeEntity(_0x2547ae,null))[_0xc59a('0x46')](handleError(_0x2547ae,null));};exports[_0xc59a('0x56')]=function(_0x22d091,_0x1a93d8,_0x2035dd){return db[_0xc59a('0x2e')]['find']({'where':{'id':_0x22d091[_0xc59a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a93d8,null))[_0xc59a('0x26')](function(_0x1d02f9){if(_0x1d02f9){return _0x1d02f9[_0xc59a('0x56')](_0x22d091[_0xc59a('0x4d')][_0xc59a('0x57')],_[_0xc59a('0x58')](_0x22d091[_0xc59a('0x4d')],[_0xc59a('0x57'),'id'])||{});}})[_0xc59a('0x26')](respondWithResult(_0x1a93d8,null))[_0xc59a('0x46')](handleError(_0x1a93d8,null));};exports[_0xc59a('0x59')]=function(_0x2ca1eb,_0x2cb32e,_0x1ae057){return db[_0xc59a('0x2e')]['find']({'where':{'id':_0x2ca1eb[_0xc59a('0x48')]['id']}})[_0xc59a('0x26')](handleEntityNotFound(_0x2cb32e,null))[_0xc59a('0x26')](function(_0x11e154){if(_0x11e154){return _0x11e154[_0xc59a('0x59')](_0x2ca1eb[_0xc59a('0x34')]['ids'])[_0xc59a('0x26')](function(){if(_[_0xc59a('0x5a')](_0x2ca1eb[_0xc59a('0x34')][_0xc59a('0x57')])){for(var _0x5cbbd5=0x0;_0x5cbbd5<_0x2ca1eb[_0xc59a('0x34')][_0xc59a('0x57')]['length'];_0x5cbbd5+=0x1){socket['emit'](_0xc59a('0x5b'),{'UserId':Number(_0x2ca1eb[_0xc59a('0x34')][_0xc59a('0x57')][_0x5cbbd5]),'SquareProjectId':Number(_0x2ca1eb[_0xc59a('0x48')]['id'])});}}else{socket[_0xc59a('0x5c')](_0xc59a('0x5b'),{'UserId':Number(_0x2ca1eb[_0xc59a('0x34')]['ids']),'SquareProjectId':Number(_0x2ca1eb[_0xc59a('0x48')]['id'])});}});}})[_0xc59a('0x26')](respondWithStatusCode(_0x2cb32e,null))['catch'](handleError(_0x2cb32e,null));};exports[_0xc59a('0x5d')]=function(_0x40be6a,_0x5a0f31,_0x36ae1b){var _0x33a269={};var _0x342bda={};var _0x1035c6;var _0x2efe75;return db[_0xc59a('0x2e')][_0xc59a('0x5e')]({'where':{'id':_0x40be6a['params']['id']}})[_0xc59a('0x26')](handleEntityNotFound(_0x5a0f31,null))[_0xc59a('0x26')](function(_0x23d7d4){if(_0x23d7d4){_0x1035c6=_0x23d7d4;_0x342bda[_0xc59a('0x32')]=_[_0xc59a('0x49')](db[_0xc59a('0x5f')][_0xc59a('0x2f')]);_0x342bda[_0xc59a('0x34')]=_[_0xc59a('0x49')](_0x40be6a[_0xc59a('0x34')]);_0x342bda['filters']=_[_0xc59a('0x36')](_0x342bda['model'],_0x342bda[_0xc59a('0x34')]);_0x33a269['attributes']=_[_0xc59a('0x36')](_0x342bda['model'],qs['fields'](_0x40be6a[_0xc59a('0x34')]['fields']));_0x33a269[_0xc59a('0x37')]=_0x33a269[_0xc59a('0x37')]['length']?_0x33a269[_0xc59a('0x37')]:_0x342bda[_0xc59a('0x32')];_0x33a269[_0xc59a('0x60')]=qs[_0xc59a('0x3b')](_0x40be6a[_0xc59a('0x34')]['sort']);_0x33a269['where']=qs[_0xc59a('0x35')](_[_0xc59a('0x3c')](_0x40be6a['query'],_0x342bda[_0xc59a('0x35')]));if(_0x40be6a[_0xc59a('0x34')][_0xc59a('0x3d')]){_0x33a269['where']=_['merge'](_0x33a269['where'],{'$or':_[_0xc59a('0x33')](_0x33a269['attributes'],function(_0x5d7338){var _0x18b7c3={};_0x18b7c3[_0x5d7338]={'$like':'%'+_0x40be6a['query'][_0xc59a('0x3d')]+'%'};return _0x18b7c3;})});}_0x33a269=_[_0xc59a('0x3f')]({},_0x33a269,_0x40be6a[_0xc59a('0x41')]);return _0x1035c6[_0xc59a('0x5d')](_0x33a269);}})['then'](function(_0x16a253){if(_0x16a253){_0x2efe75=_0x16a253[_0xc59a('0x38')];if(!_0x40be6a[_0xc59a('0x34')][_0xc59a('0x39')]('nolimit')){_0x33a269[_0xc59a('0x21')]=qs['limit'](_0x40be6a['query'][_0xc59a('0x21')]);_0x33a269[_0xc59a('0x1e')]=qs['offset'](_0x40be6a[_0xc59a('0x34')]['offset']);}return _0x1035c6['getUsers'](_0x33a269);}})[_0xc59a('0x26')](function(_0x3a7616){if(_0x3a7616){return _0x3a7616?{'count':_0x2efe75,'rows':_0x3a7616}:null;}})[_0xc59a('0x26')](respondWithResult(_0x5a0f31,null))[_0xc59a('0x46')](handleError(_0x5a0f31,null));};
\ No newline at end of file
index e320831..c5624a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cf0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x1cf0,0x1e2));var _0x01cf=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x1cf0[_0x213518];return _0x1baf75;};'use strict';var EventEmitter=require(_0x01cf('0x0'));var SquareProject=require(_0x01cf('0x1'))['db'][_0x01cf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x01cf('0x3'),'afterDestroy':_0x01cf('0x4')};function emitEvent(_0x2c4b89){return function(_0x3c985c,_0x51b1aa,_0x8d8ec6){SquareProjectEvents[_0x01cf('0x5')](_0x2c4b89+':'+_0x3c985c['id'],_0x3c985c);SquareProjectEvents['emit'](_0x2c4b89,_0x3c985c);_0x8d8ec6(null);};}for(var e in events){if(events[_0x01cf('0x6')](e)){var event=events[e];SquareProject[_0x01cf('0x7')](e,emitEvent(event));}}module[_0x01cf('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x5b97=['events','../../mysqldb','SquareProject','remove','emit','hasOwnProperty','hook','exports'];(function(_0x396701,_0x1600e2){var _0x5df190=function(_0x4414e0){while(--_0x4414e0){_0x396701['push'](_0x396701['shift']());}};_0x5df190(++_0x1600e2);}(_0x5b97,0x140));var _0x75b9=function(_0x4f431d,_0xd51a3b){_0x4f431d=_0x4f431d-0x0;var _0x4f31e1=_0x5b97[_0x4f431d];return _0x4f31e1;};'use strict';var EventEmitter=require(_0x75b9('0x0'));var SquareProject=require(_0x75b9('0x1'))['db'][_0x75b9('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x75b9('0x3')};function emitEvent(_0x4f1767){return function(_0x33679b,_0x47f439,_0x571153){SquareProjectEvents['emit'](_0x4f1767+':'+_0x33679b['id'],_0x33679b);SquareProjectEvents[_0x75b9('0x4')](_0x4f1767,_0x33679b);_0x571153(null);};}for(var e in events){if(events[_0x75b9('0x5')](e)){var event=events[e];SquareProject[_0x75b9('0x6')](e,emitEvent(event));}}module[_0x75b9('0x7')]=SquareProjectEvents;
\ No newline at end of file
index c45ba52..5dfc7a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb35=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4ccec6,_0x249927){var _0xb841b=function(_0x274519){while(--_0x274519){_0x4ccec6['push'](_0x4ccec6['shift']());}};_0xb841b(++_0x249927);}(_0xdb35,0x1ef));var _0x5db3=function(_0x8307e3,_0x48eb78){_0x8307e3=_0x8307e3-0x0;var _0x492db9=_0xdb35[_0x8307e3];return _0x492db9;};'use strict';var _=require(_0x5db3('0x0'));var util=require(_0x5db3('0x1'));var logger=require('../../config/logger')(_0x5db3('0x2'));var moment=require(_0x5db3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5db3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5db3('0x5'));var config=require(_0x5db3('0x6'));var attributes=require('./squareProject.attributes');module[_0x5db3('0x7')]=function(_0x450d4e,_0x561d99){return _0x450d4e['define'](_0x5db3('0x8'),attributes,{'tableName':_0x5db3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bd01d,_0x137f06,_0xb5a4c7){if(_0x3bd01d[_0x5db3('0xa')](_0x5db3('0xb'))){_0x3bd01d[_0x5db3('0xc')]=moment()[_0x5db3('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3bd01d['changed']('production')){_0x3bd01d['publishedAt']=moment()[_0x5db3('0xd')](_0x5db3('0xe'));}_0xb5a4c7(null,_0x3bd01d);}}});};
\ No newline at end of file
+var _0x2308=['path','rimraf','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x38a2b1,_0x47a007){var _0x217320=function(_0x2b722a){while(--_0x2b722a){_0x38a2b1['push'](_0x38a2b1['shift']());}};_0x217320(++_0x47a007);}(_0x2308,0x108));var _0x8230=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x2308[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x8230('0x0'));var util=require('util');var logger=require(_0x8230('0x1'))(_0x8230('0x2'));var moment=require(_0x8230('0x3'));var BPromise=require(_0x8230('0x4'));var rp=require(_0x8230('0x5'));var fs=require('fs');var path=require(_0x8230('0x6'));var rimraf=require(_0x8230('0x7'));var config=require('../../config/environment');var attributes=require(_0x8230('0x8'));module['exports']=function(_0x269997,_0x5dafdc){return _0x269997[_0x8230('0x9')](_0x8230('0xa'),attributes,{'tableName':_0x8230('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2344b0,_0x1b89be,_0x147c4e){if(_0x2344b0[_0x8230('0xc')](_0x8230('0xd'))){_0x2344b0['savedAt']=moment()['format'](_0x8230('0xe'));}if(_0x2344b0['changed'](_0x8230('0xf'))){_0x2344b0[_0x8230('0x10')]=moment()[_0x8230('0x11')](_0x8230('0xe'));}_0x147c4e(null,_0x2344b0);}}});};
\ No newline at end of file
index 74bc094..005b1bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb478=['redis','defaults','localhost','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','ShowSquareProject','SquareProject','options','raw','where','attributes','map','include','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xb478,0x67));var _0x8b47=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0xb478[_0x14cb58];return _0x5f097e;};'use strict';var _=require(_0x8b47('0x0'));var util=require(_0x8b47('0x1'));var moment=require(_0x8b47('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b47('0x3'));var fs=require('fs');var Redis=require(_0x8b47('0x4'));var db=require(_0x8b47('0x5'))['db'];var utils=require(_0x8b47('0x6'));var logger=require(_0x8b47('0x7'))(_0x8b47('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8b47('0x9')][_0x8b47('0xa')]({'port':0x232a});config[_0x8b47('0xb')]=_[_0x8b47('0xc')](config['redis'],{'host':_0x8b47('0xd'),'port':0x18eb});var socket=require(_0x8b47('0xe'))(new Redis(config[_0x8b47('0xb')]));require(_0x8b47('0xf'))[_0x8b47('0x10')](socket);function respondWithRpcPromise(_0x590367,_0x57803e,_0x5c10bb){return new BPromise(function(_0x2fdd76,_0x385f27){return client[_0x8b47('0x11')](_0x590367,_0x5c10bb)['then'](function(_0x288902){logger[_0x8b47('0x12')](_0x8b47('0x13'),_0x57803e,_0x8b47('0x14'));logger[_0x8b47('0x15')](_0x8b47('0x16'),_0x57803e,_0x8b47('0x14'),JSON[_0x8b47('0x17')](_0x288902));if(_0x288902[_0x8b47('0x18')]){if(_0x288902['error'][_0x8b47('0x19')]===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x57803e,_0x288902[_0x8b47('0x18')][_0x8b47('0x1a')]);return _0x385f27(_0x288902[_0x8b47('0x18')]['message']);}logger['error'](_0x8b47('0x13'),_0x57803e,_0x288902['error'][_0x8b47('0x1a')]);return _0x2fdd76(_0x288902['error'][_0x8b47('0x1a')]);}else{logger[_0x8b47('0x12')](_0x8b47('0x13'),_0x57803e,'request\x20sent');_0x2fdd76(_0x288902[_0x8b47('0x1b')][_0x8b47('0x1a')]);}})['catch'](function(_0x542136){logger[_0x8b47('0x18')](_0x8b47('0x13'),_0x57803e,_0x542136);_0x385f27(_0x542136);});});}exports[_0x8b47('0x1c')]=function(_0x39a231){var _0xda679=this;return new Promise(function(_0x5ced30,_0x45f688){return db[_0x8b47('0x1d')]['find']({'raw':_0x39a231[_0x8b47('0x1e')]?_0x39a231['options'][_0x8b47('0x1f')]===undefined?!![]:![]:!![],'where':_0x39a231[_0x8b47('0x1e')]?_0x39a231['options'][_0x8b47('0x20')]||null:null,'attributes':_0x39a231[_0x8b47('0x1e')]?_0x39a231[_0x8b47('0x1e')][_0x8b47('0x21')]||null:null,'include':_0x39a231[_0x8b47('0x1e')]?_0x39a231[_0x8b47('0x1e')]['include']?_[_0x8b47('0x22')](_0x39a231[_0x8b47('0x1e')][_0x8b47('0x23')],function(_0x32738d){return{'model':db[_0x32738d[_0x8b47('0x24')]],'as':_0x32738d['as'],'attributes':_0x32738d['attributes'],'include':_0x32738d[_0x8b47('0x23')]?_[_0x8b47('0x22')](_0x32738d[_0x8b47('0x23')],function(_0xbf701c){return{'model':db[_0xbf701c[_0x8b47('0x24')]],'as':_0xbf701c['as'],'attributes':_0xbf701c['attributes'],'include':_0xbf701c[_0x8b47('0x23')]?_[_0x8b47('0x22')](_0xbf701c[_0x8b47('0x23')],function(_0xb8273f){return{'model':db[_0xb8273f[_0x8b47('0x24')]],'as':_0xb8273f['as'],'attributes':_0xb8273f[_0x8b47('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8b47('0x25')](function(_0x323e0d){logger['info'](_0x8b47('0x1c'),_0x39a231);logger[_0x8b47('0x15')](_0x8b47('0x1c'),_0x39a231,JSON[_0x8b47('0x17')](_0x323e0d));_0x5ced30(_0x323e0d);})['catch'](function(_0x2a4864){logger[_0x8b47('0x18')](_0x8b47('0x1c'),_0x2a4864['message'],_0x39a231);_0x45f688(_0xda679[_0x8b47('0x18')](0x1f4,_0x2a4864['message']));});});};
\ No newline at end of file
+var _0xd0d7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','ShowSquareProject','find','options','raw','where','map','include','attributes','model'];(function(_0x2b9126,_0x1e7f82){var _0x4e593e=function(_0x217dec){while(--_0x217dec){_0x2b9126['push'](_0x2b9126['shift']());}};_0x4e593e(++_0x1e7f82);}(_0xd0d7,0x144));var _0x7d0d=function(_0x2f48a7,_0x54ea3c){_0x2f48a7=_0x2f48a7-0x0;var _0x3546f6=_0xd0d7[_0x2f48a7];return _0x3546f6;};'use strict';var _=require(_0x7d0d('0x0'));var util=require(_0x7d0d('0x1'));var moment=require(_0x7d0d('0x2'));var BPromise=require(_0x7d0d('0x3'));var rs=require(_0x7d0d('0x4'));var fs=require('fs');var Redis=require(_0x7d0d('0x5'));var db=require(_0x7d0d('0x6'))['db'];var utils=require(_0x7d0d('0x7'));var logger=require(_0x7d0d('0x8'))(_0x7d0d('0x9'));var config=require(_0x7d0d('0xa'));var jayson=require(_0x7d0d('0xb'));var client=jayson[_0x7d0d('0xc')][_0x7d0d('0xd')]({'port':0x232a});config[_0x7d0d('0xe')]=_['defaults'](config[_0x7d0d('0xe')],{'host':_0x7d0d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d0d('0xe')]));require('./squareProject.socket')['register'](socket);function respondWithRpcPromise(_0x113ac6,_0x5cd722,_0x1337ac){return new BPromise(function(_0x30326d,_0x10e948){return client['request'](_0x113ac6,_0x1337ac)[_0x7d0d('0x10')](function(_0x32bdaf){logger[_0x7d0d('0x11')](_0x7d0d('0x12'),_0x5cd722,_0x7d0d('0x13'));logger[_0x7d0d('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x5cd722,_0x7d0d('0x13'),JSON[_0x7d0d('0x15')](_0x32bdaf));if(_0x32bdaf['error']){if(_0x32bdaf['error'][_0x7d0d('0x16')]===0x1f4){logger[_0x7d0d('0x17')]('SquareProject,\x20%s,\x20%s',_0x5cd722,_0x32bdaf[_0x7d0d('0x17')][_0x7d0d('0x18')]);return _0x10e948(_0x32bdaf['error']['message']);}logger[_0x7d0d('0x17')](_0x7d0d('0x12'),_0x5cd722,_0x32bdaf[_0x7d0d('0x17')][_0x7d0d('0x18')]);return _0x30326d(_0x32bdaf[_0x7d0d('0x17')][_0x7d0d('0x18')]);}else{logger[_0x7d0d('0x11')](_0x7d0d('0x12'),_0x5cd722,_0x7d0d('0x13'));_0x30326d(_0x32bdaf[_0x7d0d('0x19')][_0x7d0d('0x18')]);}})[_0x7d0d('0x1a')](function(_0x43cc2a){logger['error'](_0x7d0d('0x12'),_0x5cd722,_0x43cc2a);_0x10e948(_0x43cc2a);});});}exports[_0x7d0d('0x1b')]=function(_0x320570){var _0x1961cc=this;return new Promise(function(_0x8e2ecd,_0x956de3){return db['SquareProject'][_0x7d0d('0x1c')]({'raw':_0x320570['options']?_0x320570[_0x7d0d('0x1d')][_0x7d0d('0x1e')]===undefined?!![]:![]:!![],'where':_0x320570[_0x7d0d('0x1d')]?_0x320570['options'][_0x7d0d('0x1f')]||null:null,'attributes':_0x320570[_0x7d0d('0x1d')]?_0x320570['options']['attributes']||null:null,'include':_0x320570['options']?_0x320570[_0x7d0d('0x1d')]['include']?_[_0x7d0d('0x20')](_0x320570['options'][_0x7d0d('0x21')],function(_0x316276){return{'model':db[_0x316276['model']],'as':_0x316276['as'],'attributes':_0x316276[_0x7d0d('0x22')],'include':_0x316276[_0x7d0d('0x21')]?_[_0x7d0d('0x20')](_0x316276['include'],function(_0x3db5f6){return{'model':db[_0x3db5f6['model']],'as':_0x3db5f6['as'],'attributes':_0x3db5f6[_0x7d0d('0x22')],'include':_0x3db5f6[_0x7d0d('0x21')]?_['map'](_0x3db5f6['include'],function(_0x47a70c){return{'model':db[_0x47a70c[_0x7d0d('0x23')]],'as':_0x47a70c['as'],'attributes':_0x47a70c[_0x7d0d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7d0d('0x10')](function(_0xd982dc){logger[_0x7d0d('0x11')](_0x7d0d('0x1b'),_0x320570);logger[_0x7d0d('0x14')](_0x7d0d('0x1b'),_0x320570,JSON[_0x7d0d('0x15')](_0xd982dc));_0x8e2ecd(_0xd982dc);})[_0x7d0d('0x1a')](function(_0x2a2715){logger[_0x7d0d('0x17')](_0x7d0d('0x1b'),_0x2a2715['message'],_0x320570);_0x956de3(_0x1961cc[_0x7d0d('0x17')](0x1f4,_0x2a2715[_0x7d0d('0x18')]));});});};
\ No newline at end of file
index db2b217..3b717d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2978=['update','emit','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x4ab78f,_0x1cbc7f){var _0x5f1de1=function(_0x379c7c){while(--_0x379c7c){_0x4ab78f['push'](_0x4ab78f['shift']());}};_0x5f1de1(++_0x1cbc7f);}(_0x2978,0x11d));var _0x8297=function(_0x37cf35,_0x1b444f){_0x37cf35=_0x37cf35-0x0;var _0x306dfd=_0x2978[_0x37cf35];return _0x306dfd;};'use strict';var SquareProjectEvents=require(_0x8297('0x0'));var events=[_0x8297('0x1'),_0x8297('0x2'),_0x8297('0x3')];function createListener(_0x1858a6,_0xccf1f2){return function(_0x38404d){_0xccf1f2[_0x8297('0x4')](_0x1858a6,_0x38404d);};}function removeListener(_0x3b7537,_0x1767b4){return function(){SquareProjectEvents['removeListener'](_0x3b7537,_0x1767b4);};}exports[_0x8297('0x5')]=function(_0x200d87){for(var _0x220f2c=0x0,_0x4190bc=events[_0x8297('0x6')];_0x220f2c<_0x4190bc;_0x220f2c++){var _0x1187e2=events[_0x220f2c];var _0x4f63b0=createListener(_0x8297('0x7')+_0x1187e2,_0x200d87);SquareProjectEvents['on'](_0x1187e2,_0x4f63b0);}};
\ No newline at end of file
+var _0xb73a=['register','squareProject:','./squareProject.events','save','update','emit'];(function(_0x4b83bd,_0x1d2e43){var _0x3d149d=function(_0x4c19ac){while(--_0x4c19ac){_0x4b83bd['push'](_0x4b83bd['shift']());}};_0x3d149d(++_0x1d2e43);}(_0xb73a,0x10a));var _0xab73=function(_0x41a3dc,_0x14c6c8){_0x41a3dc=_0x41a3dc-0x0;var _0x5782bd=_0xb73a[_0x41a3dc];return _0x5782bd;};'use strict';var SquareProjectEvents=require(_0xab73('0x0'));var events=[_0xab73('0x1'),'remove',_0xab73('0x2')];function createListener(_0x27be50,_0x4460c0){return function(_0x6140c8){_0x4460c0[_0xab73('0x3')](_0x27be50,_0x6140c8);};}function removeListener(_0xdc1831,_0x300442){return function(){SquareProjectEvents['removeListener'](_0xdc1831,_0x300442);};}exports[_0xab73('0x4')]=function(_0x5826d1){for(var _0x4b0c8f=0x0,_0x13d6a6=events['length'];_0x4b0c8f<_0x13d6a6;_0x4b0c8f++){var _0x5424ea=events[_0x4b0c8f];var _0x578afe=createListener(_0xab73('0x5')+_0x5424ea,_0x5826d1);SquareProjectEvents['on'](_0x5424ea,_0x578afe);}};
\ No newline at end of file
index 9097bda..87cb86b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x2e20ac,_0x5b4359){var _0x584dbb=function(_0x54d851){while(--_0x54d851){_0x2e20ac['push'](_0x2e20ac['shift']());}};_0x584dbb(++_0x5b4359);}(_0x5fab,0x177));var _0xb5fa=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5fab[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
+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(_0x1c509d,_0x310ce5){var _0x33e75e=function(_0x3d29b7){while(--_0x3d29b7){_0x1c509d['push'](_0x1c509d['shift']());}};_0x33e75e(++_0x310ce5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'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
index 2bc9144..7233e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['getDataValue','sequelize','STRING','VIRTUAL'];(function(_0x2d8a6c,_0x5c8da8){var _0x5a680a=function(_0x30bce6){while(--_0x30bce6){_0x2d8a6c['push'](_0x2d8a6c['shift']());}};_0x5a680a(++_0x5c8da8);}(_0x326f,0xd1));var _0xf326=function(_0x31114f,_0x37fe17){_0x31114f=_0x31114f-0x0;var _0x521672=_0x326f[_0x31114f];return _0x521672;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xf326('0x1')]},'calleridname':{'type':Sequelize[_0xf326('0x1')]},'context':{'type':Sequelize[_0xf326('0x1')]},'extension':{'type':Sequelize[_0xf326('0x1')]},'priority':{'type':Sequelize[_0xf326('0x1')]},'accountcode':{'type':Sequelize[_0xf326('0x1')]},'dnid':{'type':Sequelize[_0xf326('0x1')]},'projectName':{'type':Sequelize[_0xf326('0x1')]},'saveName':{'type':Sequelize[_0xf326('0x1')]},'filename':{'type':Sequelize[_0xf326('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xf326('0x2')],'get':function(){var _0x3851eb='';var _0x165f95=this[_0xf326('0x3')]('savePath');if(_0x165f95){_0x3851eb=_0x165f95['substring'](_0x165f95['lastIndexOf']('.'));}return _0x3851eb;}}};
\ No newline at end of file
+var _0xf2ca=['getDataValue','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x280444,_0x315d9d){var _0x58b381=function(_0x2c5634){while(--_0x2c5634){_0x280444['push'](_0x280444['shift']());}};_0x58b381(++_0x315d9d);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0xf2ca[_0x34e752];return _0x7c6347;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'extension':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'dnid':{'type':Sequelize[_0xaf2c('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xaf2c('0x2')]},'filename':{'type':Sequelize[_0xaf2c('0x2')]},'savePath':{'type':Sequelize[_0xaf2c('0x2')]},'format':{'type':Sequelize[_0xaf2c('0x3')],'get':function(){var _0x58351f='';var _0x37fedd=this[_0xaf2c('0x4')]('savePath');if(_0x37fedd){_0x58351f=_0x37fedd[_0xaf2c('0x5')](_0x37fedd['lastIndexOf']('.'));}return _0x58351f;}}};
\ No newline at end of file
index 5fd0274..b9f6dc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8595=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end'];(function(_0x5db240,_0x459ab2){var _0x3940cc=function(_0x1e0a39){while(--_0x1e0a39){_0x5db240['push'](_0x5db240['shift']());}};_0x3940cc(++_0x459ab2);}(_0x8595,0x9f));var _0x5859=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8595[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5859('0x0'));var zipdir=require(_0x5859('0x1'));var jsonpatch=require(_0x5859('0x2'));var rp=require(_0x5859('0x3'));var moment=require(_0x5859('0x4'));var BPromise=require(_0x5859('0x5'));var Mustache=require('mustache');var util=require(_0x5859('0x6'));var path=require(_0x5859('0x7'));var sox=require(_0x5859('0x8'));var csv=require(_0x5859('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5859('0xa'));var _=require(_0x5859('0xb'));var squel=require(_0x5859('0xc'));var crypto=require('crypto');var jsforce=require(_0x5859('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5859('0x9'));var querystring=require(_0x5859('0xe'));var Papa=require(_0x5859('0xf'));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(_0x5859('0x10'));var logger=require(_0x5859('0x11'))(_0x5859('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5859('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x144669,_0x268d8d){_0x268d8d=_0x268d8d||0xcc;return function(_0x1d0e76){if(_0x1d0e76){return _0x144669[_0x5859('0x14')](_0x268d8d);}return _0x144669[_0x5859('0x15')](_0x268d8d)[_0x5859('0x16')]();};}function respondWithResult(_0x15f1b6,_0x1b39d0){_0x1b39d0=_0x1b39d0||0xc8;return function(_0x341472){if(_0x341472){return _0x15f1b6['status'](_0x1b39d0)[_0x5859('0x17')](_0x341472);}};}function respondWithFilteredResult(_0x367bd7,_0x744a06){return function(_0x583f71){if(_0x583f71){var _0x2f3421=typeof _0x744a06[_0x5859('0x18')]===_0x5859('0x19')&&typeof _0x744a06[_0x5859('0x1a')]==='undefined';var _0x5ed2ab=_0x583f71['count'];var _0x308195=_0x2f3421?0x0:_0x744a06['offset'];var _0x5f27b0=_0x2f3421?_0x583f71[_0x5859('0x1b')]:_0x744a06['offset']+_0x744a06[_0x5859('0x1a')];var _0x328308;if(_0x5f27b0>=_0x5ed2ab){_0x5f27b0=_0x5ed2ab;_0x328308=0xc8;}else{_0x328308=0xce;}_0x367bd7['status'](_0x328308);return _0x367bd7[_0x5859('0x1c')](_0x5859('0x1d'),_0x308195+'-'+_0x5f27b0+'/'+_0x5ed2ab)[_0x5859('0x17')](_0x583f71);}return null;};}function patchUpdates(_0x52406b){return function(_0x237db7){try{jsonpatch[_0x5859('0x1e')](_0x237db7,_0x52406b,!![]);}catch(_0x471ead){return BPromise['reject'](_0x471ead);}return _0x237db7[_0x5859('0x1f')]();};}function saveUpdates(_0x11acd1,_0x4a5177){return function(_0x2fdf88){if(_0x2fdf88){return _0x2fdf88[_0x5859('0x20')](_0x11acd1)[_0x5859('0x21')](function(_0x338fba){return _0x338fba;});}return null;};}function removeEntity(_0x1f422f,_0xbe7baa){return function(_0x485f05){if(_0x485f05){return _0x485f05[_0x5859('0x22')]()[_0x5859('0x21')](function(){_0x1f422f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5898bc,_0x498a30){return function(_0x119603){if(!_0x119603){_0x5898bc[_0x5859('0x14')](0x194);}return _0x119603;};}function handleError(_0x10d66e,_0x12cc63){_0x12cc63=_0x12cc63||0x1f4;return function(_0x1e0844){logger['error'](_0x1e0844[_0x5859('0x23')]);if(_0x1e0844[_0x5859('0x24')]){delete _0x1e0844[_0x5859('0x24')];}_0x10d66e[_0x5859('0x15')](_0x12cc63)[_0x5859('0x25')](_0x1e0844);};}exports[_0x5859('0x26')]=function(_0x84b319,_0x15dee5){var _0x43ee44={},_0xe5c892={},_0x2b6dc5={'count':0x0,'rows':[]};var _0x2b749d=_[_0x5859('0x27')](db[_0x5859('0x28')][_0x5859('0x29')],function(_0x485723){return{'name':_0x485723['fieldName'],'type':_0x485723[_0x5859('0x2a')][_0x5859('0x2b')]};});_0xe5c892[_0x5859('0x2c')]=_['map'](_0x2b749d,_0x5859('0x24'));_0xe5c892[_0x5859('0x2d')]=_[_0x5859('0x2e')](_0x84b319[_0x5859('0x2d')]);_0xe5c892[_0x5859('0x2f')]=_[_0x5859('0x30')](_0xe5c892[_0x5859('0x2c')],_0xe5c892['query']);_0x43ee44['attributes']=_[_0x5859('0x30')](_0xe5c892['model'],qs[_0x5859('0x31')](_0x84b319[_0x5859('0x2d')][_0x5859('0x31')]));_0x43ee44[_0x5859('0x32')]=_0x43ee44[_0x5859('0x32')][_0x5859('0x33')]?_0x43ee44[_0x5859('0x32')]:_0xe5c892['model'];if(!_0x84b319['query']['hasOwnProperty'](_0x5859('0x34'))){_0x43ee44[_0x5859('0x1a')]=qs['limit'](_0x84b319['query'][_0x5859('0x1a')]);_0x43ee44[_0x5859('0x18')]=qs['offset'](_0x84b319[_0x5859('0x2d')][_0x5859('0x18')]);}_0x43ee44[_0x5859('0x35')]=qs['sort'](_0x84b319[_0x5859('0x2d')][_0x5859('0x36')]);_0x43ee44['where']=qs[_0x5859('0x2f')](_['pick'](_0x84b319['query'],_0xe5c892[_0x5859('0x2f')]),_0x2b749d);if(_0x84b319[_0x5859('0x2d')]['filter']){_0x43ee44[_0x5859('0x37')]=_['merge'](_0x43ee44[_0x5859('0x37')],{'$or':_['map'](_0x2b749d,function(_0x2b1a06){if(_0x2b1a06[_0x5859('0x2a')]!==_0x5859('0x38')){var _0x2f9dd5={};_0x2f9dd5[_0x2b1a06[_0x5859('0x24')]]={'$like':'%'+_0x84b319['query']['filter']+'%'};return _0x2f9dd5;}})});}_0x43ee44=_[_0x5859('0x39')]({},_0x43ee44,_0x84b319[_0x5859('0x3a')]);var _0x1c5ae3={'where':_0x43ee44[_0x5859('0x37')]};return db[_0x5859('0x28')][_0x5859('0x1b')](_0x1c5ae3)[_0x5859('0x21')](function(_0x1249a0){_0x2b6dc5[_0x5859('0x1b')]=_0x1249a0;if(_0x84b319[_0x5859('0x2d')][_0x5859('0x3b')]){_0x43ee44[_0x5859('0x3c')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x43ee44);})['then'](function(_0x53c043){_0x2b6dc5['rows']=_0x53c043;return _0x2b6dc5;})['then'](respondWithFilteredResult(_0x15dee5,_0x43ee44))['catch'](handleError(_0x15dee5,null));};exports[_0x5859('0x3d')]=function(_0x133f65,_0x2c8ebb){var _0x2171c9={'raw':!![],'where':{'id':_0x133f65[_0x5859('0x3e')]['id']}},_0x157eae={};_0x157eae[_0x5859('0x2c')]=_[_0x5859('0x2e')](db['SquareRecording'][_0x5859('0x29')]);_0x157eae[_0x5859('0x2d')]=_[_0x5859('0x2e')](_0x133f65[_0x5859('0x2d')]);_0x157eae[_0x5859('0x2f')]=_['intersection'](_0x157eae['model'],_0x157eae['query']);_0x2171c9[_0x5859('0x32')]=_[_0x5859('0x30')](_0x157eae[_0x5859('0x2c')],qs[_0x5859('0x31')](_0x133f65[_0x5859('0x2d')]['fields']));_0x2171c9[_0x5859('0x32')]=_0x2171c9['attributes'][_0x5859('0x33')]?_0x2171c9[_0x5859('0x32')]:_0x157eae['model'];if(_0x133f65[_0x5859('0x2d')]['includeAll']){_0x2171c9['include']=[{'all':!![]}];}_0x2171c9=_[_0x5859('0x39')]({},_0x2171c9,_0x133f65[_0x5859('0x3a')]);return db[_0x5859('0x28')][_0x5859('0x3f')](_0x2171c9)[_0x5859('0x21')](handleEntityNotFound(_0x2c8ebb,null))[_0x5859('0x21')](respondWithResult(_0x2c8ebb,null))[_0x5859('0x40')](handleError(_0x2c8ebb,null));};exports[_0x5859('0x41')]=function(_0x2832a9,_0x5b2cb0){return db[_0x5859('0x28')][_0x5859('0x41')](_0x2832a9[_0x5859('0x42')],{})[_0x5859('0x21')](respondWithResult(_0x5b2cb0,0xc9))[_0x5859('0x40')](handleError(_0x5b2cb0,null));};exports[_0x5859('0x20')]=function(_0x4120d7,_0x5b775a){if(_0x4120d7[_0x5859('0x42')]['id']){delete _0x4120d7[_0x5859('0x42')]['id'];}return db[_0x5859('0x28')][_0x5859('0x3f')]({'where':{'id':_0x4120d7[_0x5859('0x3e')]['id']}})[_0x5859('0x21')](handleEntityNotFound(_0x5b775a,null))['then'](saveUpdates(_0x4120d7[_0x5859('0x42')],null))[_0x5859('0x21')](respondWithResult(_0x5b775a,null))[_0x5859('0x40')](handleError(_0x5b775a,null));};exports[_0x5859('0x43')]=function(_0x13c170,_0x5505c8,_0x589c96){var _0x346212=require(_0x5859('0x44'));var _0x27c3db=![];var _0x56953f={};if(_0x13c170['query']['type']&&_0x13c170[_0x5859('0x2d')][_0x5859('0x2a')]===_0x5859('0x45')){_0x56953f[_0x5859('0x45')]=_0x13c170[_0x5859('0x3e')]['id'];}else{_0x56953f['id']=_0x13c170[_0x5859('0x3e')]['id'];}return db['SquareRecording']['find']({'where':_0x56953f,'attributes':['id','savePath','filename'],'raw':!![]})[_0x5859('0x21')](handleEntityNotFound(_0x5505c8,null))[_0x5859('0x21')](function(_0x2620ec){if(_0x2620ec){var _0x2a5d8b=_0x2620ec[_0x5859('0x46')];var _0x20aa63=util[_0x5859('0x47')](_0x5859('0x48'),_0x2a5d8b);if(fs[_0x5859('0x49')](_0x20aa63)){_0x27c3db=!![];return _0x346212[_0x5859('0x4a')](_0x20aa63,_0x2a5d8b,config[_0x5859('0x4b')][_0x5859('0x4c')])[_0x5859('0x21')](function(){return _0x2620ec;});}return _0x2620ec;}})[_0x5859('0x21')](function(_0x4c33ed){if(_0x4c33ed){var _0x44d5c4=_0x4c33ed[_0x5859('0x46')];if(!fs[_0x5859('0x49')](_0x44d5c4)){throw new db['Sequelize'][(_0x5859('0x4d'))](_0x5859('0x4e'));}if(_0x4c33ed[_0x5859('0x4f')]){return _0x5505c8[_0x5859('0x43')](_0x44d5c4,_0x4c33ed[_0x5859('0x4f')]+path[_0x5859('0x50')](_0x44d5c4),function(){if(_0x27c3db){fs[_0x5859('0x51')](_0x44d5c4);}});}else{return _0x5505c8[_0x5859('0x43')](_0x44d5c4,function(_0x14a4fd){if(_0x27c3db){fs[_0x5859('0x51')](_0x44d5c4);}});}}})[_0x5859('0x40')](function(_0x48ef72){if(_0x48ef72[_0x5859('0x52')]===_0x5859('0x4e')){_0x5505c8[_0x5859('0x15')](0x194)[_0x5859('0x25')](_0x5859('0x53'));}else{return handleError(_0x5505c8,null);}});};exports[_0x5859('0x22')]=function(_0x376741,_0x1218ab){return db[_0x5859('0x28')][_0x5859('0x3f')]({'where':{'id':_0x376741[_0x5859('0x3e')]['id']}})[_0x5859('0x21')](function(_0x216ac1){if(_[_0x5859('0x54')](_0x216ac1)){throw new ReferenceError('Entity\x20not\x20found');}return _0x216ac1;})[_0x5859('0x21')](function(_0x54ddee){var _0x49e379=_0x54ddee[_0x5859('0x46')];logger[_0x5859('0x55')](_0x5859('0x56'),_0x49e379);if(!_[_0x5859('0x54')](_0x54ddee[_0x5859('0x46')])&&fs[_0x5859('0x49')](_0x49e379)){logger[_0x5859('0x55')](_0x5859('0x57')+_0x49e379+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5859('0x58')](_0x49e379);}_0x49e379=_0x49e379+_0x5859('0x59');if(!_[_0x5859('0x54')](_0x54ddee[_0x5859('0x46')])&&fs[_0x5859('0x49')](_0x49e379)){logger['info']('File:\x20\x22'+_0x49e379+_0x5859('0x5a'));fs[_0x5859('0x58')](_0x49e379);}return _0x54ddee;})['then'](function(_0x52efbd){if(!_0x52efbd)throw new InternalError();return _0x52efbd['destroy']();})[_0x5859('0x21')](function(){_0x1218ab['status'](0xcc)[_0x5859('0x16')]();})[_0x5859('0x40')](handleError(_0x1218ab,null));};
\ No newline at end of file
+var _0x9c45=['intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','catch','show','params','keys','create','body','find','download','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','model','query'];(function(_0x2c7fdd,_0x48d51e){var _0x320dac=function(_0x24c3a5){while(--_0x24c3a5){_0x2c7fdd['push'](_0x2c7fdd['shift']());}};_0x320dac(++_0x48d51e);}(_0x9c45,0x158));var _0x59c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c45[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x59c4('0x0'));var rimraf=require(_0x59c4('0x1'));var zipdir=require(_0x59c4('0x2'));var jsonpatch=require(_0x59c4('0x3'));var rp=require('request-promise');var moment=require(_0x59c4('0x4'));var BPromise=require(_0x59c4('0x5'));var Mustache=require(_0x59c4('0x6'));var util=require('util');var path=require('path');var sox=require(_0x59c4('0x7'));var csv=require('to-csv');var ejs=require(_0x59c4('0x8'));var fs=require('fs');var fs_extra=require(_0x59c4('0x9'));var _=require(_0x59c4('0xa'));var squel=require('squel');var crypto=require(_0x59c4('0xb'));var jsforce=require(_0x59c4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x59c4('0xd'));var querystring=require(_0x59c4('0xe'));var Papa=require(_0x59c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59c4('0x10'));var as=require(_0x59c4('0x11'));var hardwareService=require(_0x59c4('0x12'));var logger=require('../../config/logger')(_0x59c4('0x13'));var utils=require(_0x59c4('0x14'));var config=require(_0x59c4('0x15'));var licenseUtil=require(_0x59c4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4be2f3,_0x52904f){_0x52904f=_0x52904f||0xcc;return function(_0xdb6e6b){if(_0xdb6e6b){return _0x4be2f3[_0x59c4('0x17')](_0x52904f);}return _0x4be2f3[_0x59c4('0x18')](_0x52904f)[_0x59c4('0x19')]();};}function respondWithResult(_0x3af326,_0x34b54c){_0x34b54c=_0x34b54c||0xc8;return function(_0x2a8dd7){if(_0x2a8dd7){return _0x3af326['status'](_0x34b54c)[_0x59c4('0x1a')](_0x2a8dd7);}};}function respondWithFilteredResult(_0x5d8cd3,_0x10e7a5){return function(_0x94438e){if(_0x94438e){var _0x31be4d=typeof _0x10e7a5[_0x59c4('0x1b')]===_0x59c4('0x1c')&&typeof _0x10e7a5[_0x59c4('0x1d')]===_0x59c4('0x1c');var _0x55d8d1=_0x94438e[_0x59c4('0x1e')];var _0x5a3f35=_0x31be4d?0x0:_0x10e7a5[_0x59c4('0x1b')];var _0x4317fc=_0x31be4d?_0x94438e[_0x59c4('0x1e')]:_0x10e7a5[_0x59c4('0x1b')]+_0x10e7a5[_0x59c4('0x1d')];var _0x1c8309;if(_0x4317fc>=_0x55d8d1){_0x4317fc=_0x55d8d1;_0x1c8309=0xc8;}else{_0x1c8309=0xce;}_0x5d8cd3[_0x59c4('0x18')](_0x1c8309);return _0x5d8cd3[_0x59c4('0x1f')](_0x59c4('0x20'),_0x5a3f35+'-'+_0x4317fc+'/'+_0x55d8d1)[_0x59c4('0x1a')](_0x94438e);}return null;};}function patchUpdates(_0x62ebf5){return function(_0xe4f4f8){try{jsonpatch[_0x59c4('0x21')](_0xe4f4f8,_0x62ebf5,!![]);}catch(_0x2a57f5){return BPromise[_0x59c4('0x22')](_0x2a57f5);}return _0xe4f4f8[_0x59c4('0x23')]();};}function saveUpdates(_0x4fb910,_0x1c2b20){return function(_0x379d84){if(_0x379d84){return _0x379d84['update'](_0x4fb910)[_0x59c4('0x24')](function(_0x3dba4b){return _0x3dba4b;});}return null;};}function removeEntity(_0x35e6fc,_0x170ed9){return function(_0x274d8e){if(_0x274d8e){return _0x274d8e[_0x59c4('0x25')]()[_0x59c4('0x24')](function(){_0x35e6fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fac11,_0x10970a){return function(_0x19369f){if(!_0x19369f){_0x4fac11[_0x59c4('0x17')](0x194);}return _0x19369f;};}function handleError(_0xd3e10f,_0x2c963f){_0x2c963f=_0x2c963f||0x1f4;return function(_0x1ce770){logger[_0x59c4('0x26')](_0x1ce770[_0x59c4('0x27')]);if(_0x1ce770['name']){delete _0x1ce770[_0x59c4('0x28')];}_0xd3e10f[_0x59c4('0x18')](_0x2c963f)[_0x59c4('0x29')](_0x1ce770);};}exports['index']=function(_0x1c6f5a,_0x3adb5d){var _0x4c0512={},_0x1e0cda={},_0x12b9ca={'count':0x0,'rows':[]};var _0x42fd9b=_[_0x59c4('0x2a')](db['SquareRecording'][_0x59c4('0x2b')],function(_0x2bf5cf){return{'name':_0x2bf5cf[_0x59c4('0x2c')],'type':_0x2bf5cf[_0x59c4('0x2d')]['key']};});_0x1e0cda[_0x59c4('0x2e')]=_[_0x59c4('0x2a')](_0x42fd9b,_0x59c4('0x28'));_0x1e0cda[_0x59c4('0x2f')]=_['keys'](_0x1c6f5a['query']);_0x1e0cda['filters']=_[_0x59c4('0x30')](_0x1e0cda[_0x59c4('0x2e')],_0x1e0cda['query']);_0x4c0512[_0x59c4('0x31')]=_[_0x59c4('0x30')](_0x1e0cda['model'],qs[_0x59c4('0x32')](_0x1c6f5a[_0x59c4('0x2f')][_0x59c4('0x32')]));_0x4c0512['attributes']=_0x4c0512[_0x59c4('0x31')][_0x59c4('0x33')]?_0x4c0512[_0x59c4('0x31')]:_0x1e0cda[_0x59c4('0x2e')];if(!_0x1c6f5a[_0x59c4('0x2f')]['hasOwnProperty'](_0x59c4('0x34'))){_0x4c0512[_0x59c4('0x1d')]=qs[_0x59c4('0x1d')](_0x1c6f5a[_0x59c4('0x2f')]['limit']);_0x4c0512[_0x59c4('0x1b')]=qs['offset'](_0x1c6f5a[_0x59c4('0x2f')][_0x59c4('0x1b')]);}_0x4c0512[_0x59c4('0x35')]=qs[_0x59c4('0x36')](_0x1c6f5a[_0x59c4('0x2f')][_0x59c4('0x36')]);_0x4c0512[_0x59c4('0x37')]=qs['filters'](_[_0x59c4('0x38')](_0x1c6f5a['query'],_0x1e0cda[_0x59c4('0x39')]),_0x42fd9b);if(_0x1c6f5a[_0x59c4('0x2f')][_0x59c4('0x3a')]){_0x4c0512[_0x59c4('0x37')]=_[_0x59c4('0x3b')](_0x4c0512[_0x59c4('0x37')],{'$or':_[_0x59c4('0x2a')](_0x42fd9b,function(_0x45e072){if(_0x45e072[_0x59c4('0x2d')]!==_0x59c4('0x3c')){var _0x1e0ea5={};_0x1e0ea5[_0x45e072[_0x59c4('0x28')]]={'$like':'%'+_0x1c6f5a[_0x59c4('0x2f')]['filter']+'%'};return _0x1e0ea5;}})});}_0x4c0512=_[_0x59c4('0x3b')]({},_0x4c0512,_0x1c6f5a[_0x59c4('0x3d')]);var _0x27eb9e={'where':_0x4c0512[_0x59c4('0x37')]};return db['SquareRecording']['count'](_0x27eb9e)['then'](function(_0x457f3a){_0x12b9ca[_0x59c4('0x1e')]=_0x457f3a;if(_0x1c6f5a[_0x59c4('0x2f')][_0x59c4('0x3e')]){_0x4c0512[_0x59c4('0x3f')]=[{'all':!![]}];}return db[_0x59c4('0x40')][_0x59c4('0x41')](_0x4c0512);})[_0x59c4('0x24')](function(_0x363424){_0x12b9ca[_0x59c4('0x42')]=_0x363424;return _0x12b9ca;})[_0x59c4('0x24')](respondWithFilteredResult(_0x3adb5d,_0x4c0512))[_0x59c4('0x43')](handleError(_0x3adb5d,null));};exports[_0x59c4('0x44')]=function(_0x25f967,_0x4ec526){var _0x42f62a={'raw':!![],'where':{'id':_0x25f967[_0x59c4('0x45')]['id']}},_0x5cdad2={};_0x5cdad2[_0x59c4('0x2e')]=_['keys'](db['SquareRecording'][_0x59c4('0x2b')]);_0x5cdad2[_0x59c4('0x2f')]=_[_0x59c4('0x46')](_0x25f967[_0x59c4('0x2f')]);_0x5cdad2[_0x59c4('0x39')]=_[_0x59c4('0x30')](_0x5cdad2[_0x59c4('0x2e')],_0x5cdad2[_0x59c4('0x2f')]);_0x42f62a['attributes']=_[_0x59c4('0x30')](_0x5cdad2['model'],qs['fields'](_0x25f967[_0x59c4('0x2f')]['fields']));_0x42f62a['attributes']=_0x42f62a['attributes'][_0x59c4('0x33')]?_0x42f62a['attributes']:_0x5cdad2[_0x59c4('0x2e')];if(_0x25f967['query'][_0x59c4('0x3e')]){_0x42f62a[_0x59c4('0x3f')]=[{'all':!![]}];}_0x42f62a=_['merge']({},_0x42f62a,_0x25f967[_0x59c4('0x3d')]);return db[_0x59c4('0x40')]['find'](_0x42f62a)[_0x59c4('0x24')](handleEntityNotFound(_0x4ec526,null))[_0x59c4('0x24')](respondWithResult(_0x4ec526,null))['catch'](handleError(_0x4ec526,null));};exports[_0x59c4('0x47')]=function(_0x496230,_0x10f43b){return db[_0x59c4('0x40')][_0x59c4('0x47')](_0x496230[_0x59c4('0x48')],{})[_0x59c4('0x24')](respondWithResult(_0x10f43b,0xc9))['catch'](handleError(_0x10f43b,null));};exports['update']=function(_0xd87c64,_0x5bbba2){if(_0xd87c64['body']['id']){delete _0xd87c64[_0x59c4('0x48')]['id'];}return db['SquareRecording'][_0x59c4('0x49')]({'where':{'id':_0xd87c64[_0x59c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bbba2,null))[_0x59c4('0x24')](saveUpdates(_0xd87c64[_0x59c4('0x48')],null))[_0x59c4('0x24')](respondWithResult(_0x5bbba2,null))[_0x59c4('0x43')](handleError(_0x5bbba2,null));};exports[_0x59c4('0x4a')]=function(_0x5434fa,_0x34beaf,_0x4b7613){var _0x39801e=require('../../components/encryptor');var _0x49e6c3=![];var _0x5510bf={};if(_0x5434fa['query'][_0x59c4('0x2d')]&&_0x5434fa['query']['type']==='uniqueid'){_0x5510bf[_0x59c4('0x4b')]=_0x5434fa['params']['id'];}else{_0x5510bf['id']=_0x5434fa[_0x59c4('0x45')]['id'];}return db[_0x59c4('0x40')]['find']({'where':_0x5510bf,'attributes':['id',_0x59c4('0x4c'),_0x59c4('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x34beaf,null))[_0x59c4('0x24')](function(_0x6207df){if(_0x6207df){var _0x5ab2e0=_0x6207df[_0x59c4('0x4c')];var _0x3585fd=util[_0x59c4('0x4e')](_0x59c4('0x4f'),_0x5ab2e0);if(fs['existsSync'](_0x3585fd)){_0x49e6c3=!![];return _0x39801e[_0x59c4('0x50')](_0x3585fd,_0x5ab2e0,config[_0x59c4('0x51')]['recording'])['then'](function(){return _0x6207df;});}return _0x6207df;}})[_0x59c4('0x24')](function(_0x567014){if(_0x567014){var _0x13840c=_0x567014['savePath'];if(!fs[_0x59c4('0x52')](_0x13840c)){throw new db[(_0x59c4('0x53'))][(_0x59c4('0x54'))](_0x59c4('0x55'));}if(_0x567014['filename']){return _0x34beaf[_0x59c4('0x4a')](_0x13840c,_0x567014[_0x59c4('0x4d')]+path[_0x59c4('0x56')](_0x13840c),function(){if(_0x49e6c3){fs[_0x59c4('0x57')](_0x13840c);}});}else{return _0x34beaf[_0x59c4('0x4a')](_0x13840c,function(_0xa28e82){if(_0x49e6c3){fs[_0x59c4('0x57')](_0x13840c);}});}}})['catch'](function(_0x35bc13){if(_0x35bc13[_0x59c4('0x58')]==='SquareRecording\x20not\x20found'){_0x34beaf['status'](0x194)['send'](_0x59c4('0x59'));}else{return handleError(_0x34beaf,null);}});};exports[_0x59c4('0x25')]=function(_0x4e0d15,_0x388739){return db[_0x59c4('0x40')]['find']({'where':{'id':_0x4e0d15[_0x59c4('0x45')]['id']}})[_0x59c4('0x24')](function(_0x73d3cf){if(_[_0x59c4('0x5a')](_0x73d3cf)){throw new ReferenceError(_0x59c4('0x5b'));}return _0x73d3cf;})['then'](function(_0x15fbe1){var _0x5ebe82=_0x15fbe1['savePath'];logger[_0x59c4('0x5c')](_0x59c4('0x5d'),_0x5ebe82);if(!_[_0x59c4('0x5a')](_0x15fbe1[_0x59c4('0x4c')])&&fs[_0x59c4('0x52')](_0x5ebe82)){logger['info'](_0x59c4('0x5e')+_0x5ebe82+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x59c4('0x5f')](_0x5ebe82);}_0x5ebe82=_0x5ebe82+_0x59c4('0x60');if(!_[_0x59c4('0x5a')](_0x15fbe1[_0x59c4('0x4c')])&&fs[_0x59c4('0x52')](_0x5ebe82)){logger[_0x59c4('0x5c')](_0x59c4('0x5e')+_0x5ebe82+_0x59c4('0x61'));fs[_0x59c4('0x5f')](_0x5ebe82);}return _0x15fbe1;})[_0x59c4('0x24')](function(_0x16aef8){if(!_0x16aef8)throw new InternalError();return _0x16aef8[_0x59c4('0x25')]();})[_0x59c4('0x24')](function(){_0x388739[_0x59c4('0x18')](0xcc)[_0x59c4('0x19')]();})[_0x59c4('0x43')](handleError(_0x388739,null));};
\ No newline at end of file
index ef97f94..e0f9472 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2a83dd,_0x595542){var _0x5c89f6=function(_0x131732){while(--_0x131732){_0x2a83dd['push'](_0x2a83dd['shift']());}};_0x5c89f6(++_0x595542);}(_0x1893,0xa2));var _0x3189=function(_0x4005fe,_0x1fc3c1){_0x4005fe=_0x4005fe-0x0;var _0x50022d=_0x1893[_0x4005fe];return _0x50022d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));module[_0x3189('0x8')]=function(_0x2333e6,_0x4080a9){return _0x2333e6[_0x3189('0x9')](_0x3189('0xa'),attributes,{'tableName':_0x3189('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x398a=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x398a,0x11a));var _0xa398=function(_0x2afbe6,_0x43fca2){_0x2afbe6=_0x2afbe6-0x0;var _0x4f8376=_0x398a[_0x2afbe6];return _0x4f8376;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require(_0xa398('0x2'))(_0xa398('0x3'));var moment=require(_0xa398('0x4'));var BPromise=require(_0xa398('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa398('0x6'));var attributes=require(_0xa398('0x7'));module[_0xa398('0x8')]=function(_0x1e57a9,_0x3421a5){return _0x1e57a9[_0xa398('0x9')](_0xa398('0xa'),attributes,{'tableName':_0xa398('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 92efada..171e4be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee02=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SquareRecording','create','body','options','CreateSquareRecording','lodash','moment','bluebird','randomstring'];(function(_0x1819ba,_0x106553){var _0x57d548=function(_0x4687c3){while(--_0x4687c3){_0x1819ba['push'](_0x1819ba['shift']());}};_0x57d548(++_0x106553);}(_0xee02,0x74));var _0x2ee0=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xee02[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0x2ee0('0x0'));var util=require('util');var moment=require(_0x2ee0('0x1'));var BPromise=require(_0x2ee0('0x2'));var rs=require(_0x2ee0('0x3'));var fs=require('fs');var Redis=require(_0x2ee0('0x4'));var db=require(_0x2ee0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ee0('0x6'))(_0x2ee0('0x7'));var config=require(_0x2ee0('0x8'));var jayson=require(_0x2ee0('0x9'));var client=jayson[_0x2ee0('0xa')][_0x2ee0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cf52,_0x22a7c0,_0x498d48){return new BPromise(function(_0xcbf3cc,_0x3eae7c){return client[_0x2ee0('0xc')](_0x25cf52,_0x498d48)[_0x2ee0('0xd')](function(_0x54dddc){logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,'request\x20sent');logger[_0x2ee0('0x10')](_0x2ee0('0x11'),_0x22a7c0,_0x2ee0('0x12'),JSON[_0x2ee0('0x13')](_0x54dddc));if(_0x54dddc[_0x2ee0('0x14')]){if(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x15')]===0x1f4){logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);return _0x3eae7c(_0x54dddc['error']['message']);}logger[_0x2ee0('0x14')](_0x2ee0('0xf'),_0x22a7c0,_0x54dddc['error']['message']);return _0xcbf3cc(_0x54dddc[_0x2ee0('0x14')][_0x2ee0('0x16')]);}else{logger[_0x2ee0('0xe')](_0x2ee0('0xf'),_0x22a7c0,_0x2ee0('0x12'));_0xcbf3cc(_0x54dddc[_0x2ee0('0x17')][_0x2ee0('0x16')]);}})[_0x2ee0('0x18')](function(_0x359770){logger['error'](_0x2ee0('0xf'),_0x22a7c0,_0x359770);_0x3eae7c(_0x359770);});});}exports['CreateSquareRecording']=function(_0x455edb){var _0x3738b6=this;return new Promise(function(_0x32b7cd,_0x4006fd){return db[_0x2ee0('0x19')][_0x2ee0('0x1a')](_0x455edb[_0x2ee0('0x1b')],{'raw':_0x455edb['options']?_0x455edb[_0x2ee0('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x2ee0('0xd')](function(_0x36fa0c){logger[_0x2ee0('0xe')](_0x2ee0('0x1d'),_0x455edb);logger[_0x2ee0('0x10')](_0x2ee0('0x1d'),_0x455edb,JSON[_0x2ee0('0x13')](_0x36fa0c));_0x32b7cd(_0x36fa0c);})['catch'](function(_0x3318de){logger[_0x2ee0('0x14')](_0x2ee0('0x1d'),_0x3318de['message'],_0x455edb);_0x4006fd(_0x3738b6[_0x2ee0('0x14')](0x1f4,_0x3318de['message']));});});};
\ No newline at end of file
+var _0xe77d=['SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x51d2e3,_0x204c26){var _0x4170ae=function(_0x4a2901){while(--_0x4a2901){_0x51d2e3['push'](_0x51d2e3['shift']());}};_0x4170ae(++_0x204c26);}(_0xe77d,0x1b0));var _0xde77=function(_0x3e88f3,_0x4c7928){_0x3e88f3=_0x3e88f3-0x0;var _0x43b42d=_0xe77d[_0x3e88f3];return _0x43b42d;};'use strict';var _=require('lodash');var util=require(_0xde77('0x0'));var moment=require(_0xde77('0x1'));var BPromise=require(_0xde77('0x2'));var rs=require(_0xde77('0x3'));var fs=require('fs');var Redis=require(_0xde77('0x4'));var db=require(_0xde77('0x5'))['db'];var utils=require(_0xde77('0x6'));var logger=require('../../config/logger')(_0xde77('0x7'));var config=require(_0xde77('0x8'));var jayson=require(_0xde77('0x9'));var client=jayson[_0xde77('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e62fc,_0x2420b4,_0x3352e0){return new BPromise(function(_0x402960,_0x331c2d){return client['request'](_0x2e62fc,_0x3352e0)[_0xde77('0xb')](function(_0x21fd63){logger[_0xde77('0xc')](_0xde77('0xd'),_0x2420b4,_0xde77('0xe'));logger[_0xde77('0xf')](_0xde77('0x10'),_0x2420b4,_0xde77('0xe'),JSON[_0xde77('0x11')](_0x21fd63));if(_0x21fd63[_0xde77('0x12')]){if(_0x21fd63[_0xde77('0x12')]['code']===0x1f4){logger[_0xde77('0x12')]('SquareRecording,\x20%s,\x20%s',_0x2420b4,_0x21fd63[_0xde77('0x12')][_0xde77('0x13')]);return _0x331c2d(_0x21fd63[_0xde77('0x12')][_0xde77('0x13')]);}logger[_0xde77('0x12')](_0xde77('0xd'),_0x2420b4,_0x21fd63[_0xde77('0x12')][_0xde77('0x13')]);return _0x402960(_0x21fd63[_0xde77('0x12')]['message']);}else{logger[_0xde77('0xc')](_0xde77('0xd'),_0x2420b4,_0xde77('0xe'));_0x402960(_0x21fd63[_0xde77('0x14')]['message']);}})[_0xde77('0x15')](function(_0x2c8709){logger[_0xde77('0x12')](_0xde77('0xd'),_0x2420b4,_0x2c8709);_0x331c2d(_0x2c8709);});});}exports[_0xde77('0x16')]=function(_0x194803){var _0x301b5d=this;return new Promise(function(_0x3f6d41,_0x5a5de1){return db[_0xde77('0x17')][_0xde77('0x18')](_0x194803[_0xde77('0x19')],{'raw':_0x194803[_0xde77('0x1a')]?_0x194803[_0xde77('0x1a')][_0xde77('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x1d801b){logger['info'](_0xde77('0x16'),_0x194803);logger[_0xde77('0xf')](_0xde77('0x16'),_0x194803,JSON[_0xde77('0x11')](_0x1d801b));_0x3f6d41(_0x1d801b);})[_0xde77('0x15')](function(_0x208d8a){logger['error'](_0xde77('0x16'),_0x208d8a['message'],_0x194803);_0x5a5de1(_0x301b5d['error'](0x1f4,_0x208d8a['message']));});});};
\ No newline at end of file
index 0ad7208..188ce03 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(_0x2b4d01,_0x4c6044){var _0x4195d7=function(_0x59935){while(--_0x59935){_0x2b4d01['push'](_0x2b4d01['shift']());}};_0x4195d7(++_0x4c6044);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xe706,0xa3));var _0x6e70=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0xe706[_0x65ff6c];return _0x238215;};'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')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
index 19f4354..567cd63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4614=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x142678,_0x32f005){var _0x5c018b=function(_0x5ac88c){while(--_0x5ac88c){_0x142678['push'](_0x142678['shift']());}};_0x5c018b(++_0x32f005);}(_0x4614,0x1b2));var _0x4461=function(_0x427333,_0x3274a6){_0x427333=_0x427333-0x0;var _0x18b0f7=_0x4614[_0x427333];return _0x18b0f7;};'use strict';var Sequelize=require(_0x4461('0x0'));module[_0x4461('0x1')]={'network':{'type':Sequelize[_0x4461('0x2')]},'network_script':{'type':Sequelize[_0x4461('0x2')]},'request':{'type':Sequelize[_0x4461('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4461('0x2')]},'type':{'type':Sequelize[_0x4461('0x2')]},'uniqueid':{'type':Sequelize[_0x4461('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4461('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x4461('0x2')]},'callingani2':{'type':Sequelize[_0x4461('0x2')]},'callington':{'type':Sequelize[_0x4461('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x4461('0x2')]},'rdnis':{'type':Sequelize[_0x4461('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4461('0x2')]},'priority':{'type':Sequelize[_0x4461('0x2')]},'enhanced':{'type':Sequelize[_0x4461('0x2')]},'accountcode':{'type':Sequelize[_0x4461('0x2')]},'threadid':{'type':Sequelize[_0x4461('0x2')]},'project_name':{'type':Sequelize[_0x4461('0x2')]},'joinAt':{'type':Sequelize[_0x4461('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x4461('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xfbd4=['exports','STRING','DATE','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfbd4,0x11b));var _0x4fbd=function(_0x3fd274,_0x9832d0){_0x3fd274=_0x3fd274-0x0;var _0x30dd5c=_0xfbd4[_0x3fd274];return _0x30dd5c;};'use strict';var Sequelize=require(_0x4fbd('0x0'));module[_0x4fbd('0x1')]={'network':{'type':Sequelize[_0x4fbd('0x2')]},'network_script':{'type':Sequelize[_0x4fbd('0x2')]},'request':{'type':Sequelize[_0x4fbd('0x2')]},'channel':{'type':Sequelize[_0x4fbd('0x2')]},'language':{'type':Sequelize[_0x4fbd('0x2')]},'type':{'type':Sequelize[_0x4fbd('0x2')]},'uniqueid':{'type':Sequelize[_0x4fbd('0x2')]},'version':{'type':Sequelize[_0x4fbd('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4fbd('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x4fbd('0x2')]},'callington':{'type':Sequelize[_0x4fbd('0x2')]},'callingtns':{'type':Sequelize[_0x4fbd('0x2')]},'dnid':{'type':Sequelize[_0x4fbd('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4fbd('0x2')]},'priority':{'type':Sequelize[_0x4fbd('0x2')]},'enhanced':{'type':Sequelize[_0x4fbd('0x2')]},'accountcode':{'type':Sequelize[_0x4fbd('0x2')]},'threadid':{'type':Sequelize[_0x4fbd('0x2')]},'project_name':{'type':Sequelize[_0x4fbd('0x2')]},'joinAt':{'type':Sequelize[_0x4fbd('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index e33dcce..cebc410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf18b=['rawAttributes','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','update','then','sendStatus','error','stack','name','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4173ca,_0x113c01){var _0x5d4f98=function(_0x51bdb8){while(--_0x51bdb8){_0x4173ca['push'](_0x4173ca['shift']());}};_0x5d4f98(++_0x113c01);}(_0xf18b,0x92));var _0xbf18=function(_0x27b7ae,_0x2a2f5f){_0x27b7ae=_0x27b7ae-0x0;var _0x33be83=_0xf18b[_0x27b7ae];return _0x33be83;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf18('0x0'));var jsonpatch=require(_0xbf18('0x1'));var rp=require(_0xbf18('0x2'));var moment=require(_0xbf18('0x3'));var BPromise=require(_0xbf18('0x4'));var Mustache=require(_0xbf18('0x5'));var util=require(_0xbf18('0x6'));var path=require(_0xbf18('0x7'));var sox=require('sox');var csv=require(_0xbf18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf18('0x9'));var _=require(_0xbf18('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbf18('0xb'));var deskjs=require(_0xbf18('0xc'));var toCsv=require(_0xbf18('0x8'));var querystring=require(_0xbf18('0xd'));var Papa=require('papaparse');var Redis=require(_0xbf18('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbf18('0xf'));var as=require(_0xbf18('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf18('0x11'))(_0xbf18('0x12'));var utils=require(_0xbf18('0x13'));var config=require(_0xbf18('0x14'));var licenseUtil=require(_0xbf18('0x15'));var db=require(_0xbf18('0x16'))['db'];function respondWithStatusCode(_0x1d4b3f,_0x2c765f){_0x2c765f=_0x2c765f||0xcc;return function(_0x40b5c8){if(_0x40b5c8){return _0x1d4b3f['sendStatus'](_0x2c765f);}return _0x1d4b3f[_0xbf18('0x17')](_0x2c765f)[_0xbf18('0x18')]();};}function respondWithResult(_0x78107b,_0x3f12c9){_0x3f12c9=_0x3f12c9||0xc8;return function(_0x5badb){if(_0x5badb){return _0x78107b[_0xbf18('0x17')](_0x3f12c9)[_0xbf18('0x19')](_0x5badb);}};}function respondWithFilteredResult(_0x55e3c8,_0x44f9b3){return function(_0x474ec8){if(_0x474ec8){var _0x485227=typeof _0x44f9b3[_0xbf18('0x1a')]==='undefined'&&typeof _0x44f9b3[_0xbf18('0x1b')]===_0xbf18('0x1c');var _0x43f682=_0x474ec8[_0xbf18('0x1d')];var _0x28fad1=_0x485227?0x0:_0x44f9b3[_0xbf18('0x1a')];var _0x4d7251=_0x485227?_0x474ec8[_0xbf18('0x1d')]:_0x44f9b3[_0xbf18('0x1a')]+_0x44f9b3[_0xbf18('0x1b')];var _0x10c9bf;if(_0x4d7251>=_0x43f682){_0x4d7251=_0x43f682;_0x10c9bf=0xc8;}else{_0x10c9bf=0xce;}_0x55e3c8[_0xbf18('0x17')](_0x10c9bf);return _0x55e3c8['set'](_0xbf18('0x1e'),_0x28fad1+'-'+_0x4d7251+'/'+_0x43f682)[_0xbf18('0x19')](_0x474ec8);}return null;};}function patchUpdates(_0x55975f){return function(_0x4d21f3){try{jsonpatch['apply'](_0x4d21f3,_0x55975f,!![]);}catch(_0x43f248){return BPromise['reject'](_0x43f248);}return _0x4d21f3['save']();};}function saveUpdates(_0x13caa3,_0x16a12c){return function(_0xde45ca){if(_0xde45ca){return _0xde45ca[_0xbf18('0x1f')](_0x13caa3)[_0xbf18('0x20')](function(_0x23782b){return _0x23782b;});}return null;};}function removeEntity(_0x576d58,_0x547afc){return function(_0x5982bc){if(_0x5982bc){return _0x5982bc['destroy']()[_0xbf18('0x20')](function(){_0x576d58['status'](0xcc)[_0xbf18('0x18')]();});}};}function handleEntityNotFound(_0x1527fb,_0x520d33){return function(_0x4b98a0){if(!_0x4b98a0){_0x1527fb[_0xbf18('0x21')](0x194);}return _0x4b98a0;};}function handleError(_0x52ed7f,_0x49b7f0){_0x49b7f0=_0x49b7f0||0x1f4;return function(_0x2473b4){logger[_0xbf18('0x22')](_0x2473b4[_0xbf18('0x23')]);if(_0x2473b4['name']){delete _0x2473b4[_0xbf18('0x24')];}_0x52ed7f['status'](_0x49b7f0)['send'](_0x2473b4);};}exports['index']=function(_0x4be22f,_0x5f5814){var _0x37816b={},_0x8f9a1a={},_0x4000ff={'count':0x0,'rows':[]};var _0x2553ba=_[_0xbf18('0x25')](db[_0xbf18('0x26')]['rawAttributes'],function(_0x1d980e){return{'name':_0x1d980e[_0xbf18('0x27')],'type':_0x1d980e[_0xbf18('0x28')][_0xbf18('0x29')]};});_0x8f9a1a[_0xbf18('0x2a')]=_[_0xbf18('0x25')](_0x2553ba,_0xbf18('0x24'));_0x8f9a1a[_0xbf18('0x2b')]=_[_0xbf18('0x2c')](_0x4be22f[_0xbf18('0x2b')]);_0x8f9a1a[_0xbf18('0x2d')]=_[_0xbf18('0x2e')](_0x8f9a1a[_0xbf18('0x2a')],_0x8f9a1a[_0xbf18('0x2b')]);_0x37816b['attributes']=_[_0xbf18('0x2e')](_0x8f9a1a['model'],qs[_0xbf18('0x2f')](_0x4be22f[_0xbf18('0x2b')]['fields']));_0x37816b[_0xbf18('0x30')]=_0x37816b[_0xbf18('0x30')][_0xbf18('0x31')]?_0x37816b[_0xbf18('0x30')]:_0x8f9a1a[_0xbf18('0x2a')];if(!_0x4be22f['query'][_0xbf18('0x32')](_0xbf18('0x33'))){_0x37816b[_0xbf18('0x1b')]=qs[_0xbf18('0x1b')](_0x4be22f['query']['limit']);_0x37816b[_0xbf18('0x1a')]=qs[_0xbf18('0x1a')](_0x4be22f[_0xbf18('0x2b')]['offset']);}_0x37816b[_0xbf18('0x34')]=qs[_0xbf18('0x35')](_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x35')]);_0x37816b[_0xbf18('0x36')]=qs['filters'](_[_0xbf18('0x37')](_0x4be22f[_0xbf18('0x2b')],_0x8f9a1a['filters']),_0x2553ba);if(_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x38')]){_0x37816b[_0xbf18('0x36')]=_[_0xbf18('0x39')](_0x37816b[_0xbf18('0x36')],{'$or':_[_0xbf18('0x25')](_0x2553ba,function(_0x45e77a){if(_0x45e77a[_0xbf18('0x28')]!==_0xbf18('0x3a')){var _0x35ea40={};_0x35ea40[_0x45e77a['name']]={'$like':'%'+_0x4be22f[_0xbf18('0x2b')]['filter']+'%'};return _0x35ea40;}})});}_0x37816b=_[_0xbf18('0x39')]({},_0x37816b,_0x4be22f[_0xbf18('0x3b')]);var _0x4666f4={'where':_0x37816b['where']};return db['SquareReport'][_0xbf18('0x1d')](_0x4666f4)['then'](function(_0x13c386){_0x4000ff[_0xbf18('0x1d')]=_0x13c386;if(_0x4be22f[_0xbf18('0x2b')][_0xbf18('0x3c')]){_0x37816b[_0xbf18('0x3d')]=[{'all':!![]}];}return db[_0xbf18('0x26')]['findAll'](_0x37816b);})[_0xbf18('0x20')](function(_0x1ee3e4){_0x4000ff[_0xbf18('0x3e')]=_0x1ee3e4;return _0x4000ff;})[_0xbf18('0x20')](respondWithFilteredResult(_0x5f5814,_0x37816b))[_0xbf18('0x3f')](handleError(_0x5f5814,null));};exports['show']=function(_0x59e430,_0x420d4c){var _0x20fdf6={'raw':!![],'where':{'id':_0x59e430['params']['id']}},_0x4dd497={};_0x4dd497[_0xbf18('0x2a')]=_[_0xbf18('0x2c')](db[_0xbf18('0x26')][_0xbf18('0x40')]);_0x4dd497[_0xbf18('0x2b')]=_[_0xbf18('0x2c')](_0x59e430['query']);_0x4dd497[_0xbf18('0x2d')]=_[_0xbf18('0x2e')](_0x4dd497[_0xbf18('0x2a')],_0x4dd497['query']);_0x20fdf6[_0xbf18('0x30')]=_[_0xbf18('0x2e')](_0x4dd497[_0xbf18('0x2a')],qs[_0xbf18('0x2f')](_0x59e430[_0xbf18('0x2b')][_0xbf18('0x2f')]));_0x20fdf6[_0xbf18('0x30')]=_0x20fdf6['attributes'][_0xbf18('0x31')]?_0x20fdf6[_0xbf18('0x30')]:_0x4dd497[_0xbf18('0x2a')];if(_0x59e430[_0xbf18('0x2b')][_0xbf18('0x3c')]){_0x20fdf6[_0xbf18('0x3d')]=[{'all':!![]}];}_0x20fdf6=_['merge']({},_0x20fdf6,_0x59e430[_0xbf18('0x3b')]);return db['SquareReport'][_0xbf18('0x41')](_0x20fdf6)[_0xbf18('0x20')](handleEntityNotFound(_0x420d4c,null))[_0xbf18('0x20')](respondWithResult(_0x420d4c,null))[_0xbf18('0x3f')](handleError(_0x420d4c,null));};exports['create']=function(_0x114c70,_0x284bf5){return db['SquareReport'][_0xbf18('0x42')](_0x114c70[_0xbf18('0x43')],{})['then'](respondWithResult(_0x284bf5,0xc9))['catch'](handleError(_0x284bf5,null));};exports[_0xbf18('0x1f')]=function(_0x1d9156,_0x4abded){if(_0x1d9156[_0xbf18('0x43')]['id']){delete _0x1d9156[_0xbf18('0x43')]['id'];}return db['SquareReport'][_0xbf18('0x41')]({'where':{'id':_0x1d9156[_0xbf18('0x44')]['id']}})[_0xbf18('0x20')](handleEntityNotFound(_0x4abded,null))[_0xbf18('0x20')](saveUpdates(_0x1d9156['body'],null))[_0xbf18('0x20')](respondWithResult(_0x4abded,null))[_0xbf18('0x3f')](handleError(_0x4abded,null));};exports['destroy']=function(_0x11fafc,_0x4fdecd){return db[_0xbf18('0x26')]['find']({'where':{'id':_0x11fafc[_0xbf18('0x44')]['id']}})[_0xbf18('0x20')](handleEntityNotFound(_0x4fdecd,null))[_0xbf18('0x20')](removeEntity(_0x4fdecd,null))[_0xbf18('0x3f')](handleError(_0x4fdecd,null));};exports[_0xbf18('0x45')]=function(_0x1fca39,_0x570bb8){return db[_0xbf18('0x26')][_0xbf18('0x45')]()[_0xbf18('0x20')](respondWithResult(_0x570bb8,null))[_0xbf18('0x3f')](handleError(_0x570bb8,null));};
\ No newline at end of file
+var _0x4342=['includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x5c467d,_0x4e4f8){var _0x18b98a=function(_0x5ca1e2){while(--_0x5ca1e2){_0x5c467d['push'](_0x5c467d['shift']());}};_0x18b98a(++_0x4e4f8);}(_0x4342,0xe7));var _0x2434=function(_0xe45b6d,_0x443cac){_0xe45b6d=_0xe45b6d-0x0;var _0x4d6f47=_0x4342[_0xe45b6d];return _0x4d6f47;};'use strict';var emlformat=require(_0x2434('0x0'));var rimraf=require(_0x2434('0x1'));var zipdir=require(_0x2434('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2434('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2434('0x4'));var util=require('util');var path=require(_0x2434('0x5'));var sox=require(_0x2434('0x6'));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(_0x2434('0x7'));var crypto=require(_0x2434('0x8'));var jsforce=require(_0x2434('0x9'));var deskjs=require(_0x2434('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2434('0xb'));var Redis=require(_0x2434('0xc'));var authService=require(_0x2434('0xd'));var qs=require(_0x2434('0xe'));var as=require(_0x2434('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2434('0x10'))(_0x2434('0x11'));var utils=require(_0x2434('0x12'));var config=require(_0x2434('0x13'));var licenseUtil=require(_0x2434('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40962e,_0x337749){_0x337749=_0x337749||0xcc;return function(_0x2bcc0e){if(_0x2bcc0e){return _0x40962e['sendStatus'](_0x337749);}return _0x40962e[_0x2434('0x15')](_0x337749)[_0x2434('0x16')]();};}function respondWithResult(_0xb06600,_0x467da1){_0x467da1=_0x467da1||0xc8;return function(_0x55be4e){if(_0x55be4e){return _0xb06600[_0x2434('0x15')](_0x467da1)['json'](_0x55be4e);}};}function respondWithFilteredResult(_0x1f54fd,_0x22a6d1){return function(_0x15e905){if(_0x15e905){var _0x5c7358=typeof _0x22a6d1[_0x2434('0x17')]===_0x2434('0x18')&&typeof _0x22a6d1[_0x2434('0x19')]===_0x2434('0x18');var _0x3ea009=_0x15e905[_0x2434('0x1a')];var _0x289f7c=_0x5c7358?0x0:_0x22a6d1[_0x2434('0x17')];var _0x48aa26=_0x5c7358?_0x15e905[_0x2434('0x1a')]:_0x22a6d1[_0x2434('0x17')]+_0x22a6d1[_0x2434('0x19')];var _0x11355a;if(_0x48aa26>=_0x3ea009){_0x48aa26=_0x3ea009;_0x11355a=0xc8;}else{_0x11355a=0xce;}_0x1f54fd[_0x2434('0x15')](_0x11355a);return _0x1f54fd[_0x2434('0x1b')](_0x2434('0x1c'),_0x289f7c+'-'+_0x48aa26+'/'+_0x3ea009)[_0x2434('0x1d')](_0x15e905);}return null;};}function patchUpdates(_0x46fcbf){return function(_0x495c82){try{jsonpatch[_0x2434('0x1e')](_0x495c82,_0x46fcbf,!![]);}catch(_0x165030){return BPromise['reject'](_0x165030);}return _0x495c82[_0x2434('0x1f')]();};}function saveUpdates(_0x2f1116,_0x431d07){return function(_0x1145fc){if(_0x1145fc){return _0x1145fc[_0x2434('0x20')](_0x2f1116)[_0x2434('0x21')](function(_0x20f6ea){return _0x20f6ea;});}return null;};}function removeEntity(_0x4dd46f,_0x7d1840){return function(_0x491e36){if(_0x491e36){return _0x491e36[_0x2434('0x22')]()[_0x2434('0x21')](function(){_0x4dd46f['status'](0xcc)[_0x2434('0x16')]();});}};}function handleEntityNotFound(_0xaa57a5,_0x2bed85){return function(_0xb1af33){if(!_0xb1af33){_0xaa57a5[_0x2434('0x23')](0x194);}return _0xb1af33;};}function handleError(_0x4bb4c9,_0x49b356){_0x49b356=_0x49b356||0x1f4;return function(_0x286bdd){logger['error'](_0x286bdd[_0x2434('0x24')]);if(_0x286bdd[_0x2434('0x25')]){delete _0x286bdd[_0x2434('0x25')];}_0x4bb4c9[_0x2434('0x15')](_0x49b356)[_0x2434('0x26')](_0x286bdd);};}exports[_0x2434('0x27')]=function(_0x53ed88,_0x506c73){var _0x2c0bc7={},_0x525bee={},_0x560635={'count':0x0,'rows':[]};var _0x4e12f6=_[_0x2434('0x28')](db[_0x2434('0x29')][_0x2434('0x2a')],function(_0x4af2c8){return{'name':_0x4af2c8[_0x2434('0x2b')],'type':_0x4af2c8[_0x2434('0x2c')][_0x2434('0x2d')]};});_0x525bee[_0x2434('0x2e')]=_[_0x2434('0x28')](_0x4e12f6,_0x2434('0x25'));_0x525bee[_0x2434('0x2f')]=_[_0x2434('0x30')](_0x53ed88[_0x2434('0x2f')]);_0x525bee[_0x2434('0x31')]=_[_0x2434('0x32')](_0x525bee[_0x2434('0x2e')],_0x525bee[_0x2434('0x2f')]);_0x2c0bc7[_0x2434('0x33')]=_[_0x2434('0x32')](_0x525bee['model'],qs['fields'](_0x53ed88['query']['fields']));_0x2c0bc7['attributes']=_0x2c0bc7[_0x2434('0x33')][_0x2434('0x34')]?_0x2c0bc7[_0x2434('0x33')]:_0x525bee[_0x2434('0x2e')];if(!_0x53ed88['query'][_0x2434('0x35')](_0x2434('0x36'))){_0x2c0bc7[_0x2434('0x19')]=qs[_0x2434('0x19')](_0x53ed88[_0x2434('0x2f')][_0x2434('0x19')]);_0x2c0bc7[_0x2434('0x17')]=qs[_0x2434('0x17')](_0x53ed88[_0x2434('0x2f')][_0x2434('0x17')]);}_0x2c0bc7['order']=qs[_0x2434('0x37')](_0x53ed88[_0x2434('0x2f')][_0x2434('0x37')]);_0x2c0bc7[_0x2434('0x38')]=qs[_0x2434('0x31')](_[_0x2434('0x39')](_0x53ed88[_0x2434('0x2f')],_0x525bee[_0x2434('0x31')]),_0x4e12f6);if(_0x53ed88[_0x2434('0x2f')][_0x2434('0x3a')]){_0x2c0bc7[_0x2434('0x38')]=_[_0x2434('0x3b')](_0x2c0bc7['where'],{'$or':_[_0x2434('0x28')](_0x4e12f6,function(_0x3664b6){if(_0x3664b6[_0x2434('0x2c')]!==_0x2434('0x3c')){var _0x3480c8={};_0x3480c8[_0x3664b6[_0x2434('0x25')]]={'$like':'%'+_0x53ed88[_0x2434('0x2f')][_0x2434('0x3a')]+'%'};return _0x3480c8;}})});}_0x2c0bc7=_[_0x2434('0x3b')]({},_0x2c0bc7,_0x53ed88['options']);var _0xc8ce74={'where':_0x2c0bc7['where']};return db[_0x2434('0x29')][_0x2434('0x1a')](_0xc8ce74)['then'](function(_0x330053){_0x560635[_0x2434('0x1a')]=_0x330053;if(_0x53ed88['query'][_0x2434('0x3d')]){_0x2c0bc7[_0x2434('0x3e')]=[{'all':!![]}];}return db[_0x2434('0x29')][_0x2434('0x3f')](_0x2c0bc7);})[_0x2434('0x21')](function(_0x19d2f7){_0x560635[_0x2434('0x40')]=_0x19d2f7;return _0x560635;})['then'](respondWithFilteredResult(_0x506c73,_0x2c0bc7))[_0x2434('0x41')](handleError(_0x506c73,null));};exports[_0x2434('0x42')]=function(_0x1c35f9,_0x52d033){var _0xb81fdb={'raw':!![],'where':{'id':_0x1c35f9['params']['id']}},_0x555b8f={};_0x555b8f[_0x2434('0x2e')]=_['keys'](db[_0x2434('0x29')][_0x2434('0x2a')]);_0x555b8f[_0x2434('0x2f')]=_['keys'](_0x1c35f9['query']);_0x555b8f[_0x2434('0x31')]=_[_0x2434('0x32')](_0x555b8f[_0x2434('0x2e')],_0x555b8f[_0x2434('0x2f')]);_0xb81fdb[_0x2434('0x33')]=_['intersection'](_0x555b8f[_0x2434('0x2e')],qs[_0x2434('0x43')](_0x1c35f9['query'][_0x2434('0x43')]));_0xb81fdb[_0x2434('0x33')]=_0xb81fdb[_0x2434('0x33')][_0x2434('0x34')]?_0xb81fdb[_0x2434('0x33')]:_0x555b8f[_0x2434('0x2e')];if(_0x1c35f9[_0x2434('0x2f')]['includeAll']){_0xb81fdb[_0x2434('0x3e')]=[{'all':!![]}];}_0xb81fdb=_[_0x2434('0x3b')]({},_0xb81fdb,_0x1c35f9['options']);return db['SquareReport'][_0x2434('0x44')](_0xb81fdb)[_0x2434('0x21')](handleEntityNotFound(_0x52d033,null))[_0x2434('0x21')](respondWithResult(_0x52d033,null))[_0x2434('0x41')](handleError(_0x52d033,null));};exports[_0x2434('0x45')]=function(_0x30bc3e,_0xed268){return db[_0x2434('0x29')][_0x2434('0x45')](_0x30bc3e[_0x2434('0x46')],{})[_0x2434('0x21')](respondWithResult(_0xed268,0xc9))[_0x2434('0x41')](handleError(_0xed268,null));};exports[_0x2434('0x20')]=function(_0x4d7bfb,_0x50dfe8){if(_0x4d7bfb[_0x2434('0x46')]['id']){delete _0x4d7bfb[_0x2434('0x46')]['id'];}return db[_0x2434('0x29')][_0x2434('0x44')]({'where':{'id':_0x4d7bfb[_0x2434('0x47')]['id']}})[_0x2434('0x21')](handleEntityNotFound(_0x50dfe8,null))[_0x2434('0x21')](saveUpdates(_0x4d7bfb[_0x2434('0x46')],null))['then'](respondWithResult(_0x50dfe8,null))[_0x2434('0x41')](handleError(_0x50dfe8,null));};exports[_0x2434('0x22')]=function(_0x10775d,_0x189439){return db['SquareReport']['find']({'where':{'id':_0x10775d[_0x2434('0x47')]['id']}})[_0x2434('0x21')](handleEntityNotFound(_0x189439,null))[_0x2434('0x21')](removeEntity(_0x189439,null))[_0x2434('0x41')](handleError(_0x189439,null));};exports[_0x2434('0x48')]=function(_0x56cc6d,_0x1b75b3){return db['SquareReport'][_0x2434('0x48')]()[_0x2434('0x21')](respondWithResult(_0x1b75b3,null))[_0x2434('0x41')](handleError(_0x1b75b3,null));};
\ No newline at end of file
index d84089a..9dd64f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcde=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xfcde,0x1d6));var _0xefcd=function(_0x5a0d09,_0x30d02b){_0x5a0d09=_0x5a0d09-0x0;var _0x184bb9=_0xfcde[_0x5a0d09];return _0x184bb9;};'use strict';var _=require(_0xefcd('0x0'));var util=require(_0xefcd('0x1'));var logger=require(_0xefcd('0x2'))(_0xefcd('0x3'));var moment=require(_0xefcd('0x4'));var BPromise=require(_0xefcd('0x5'));var rp=require(_0xefcd('0x6'));var fs=require('fs');var path=require(_0xefcd('0x7'));var rimraf=require(_0xefcd('0x8'));var config=require(_0xefcd('0x9'));var attributes=require(_0xefcd('0xa'));module[_0xefcd('0xb')]=function(_0xedbd70,_0x36e171){return _0xedbd70[_0xefcd('0xc')](_0xefcd('0xd'),attributes,{'tableName':_0xefcd('0xe'),'paranoid':![],'indexes':[{'name':_0xefcd('0xf'),'fields':[_0xefcd('0x10'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1bf5=['report_square','uid_pname','leaveAt','lodash','../../config/logger','api','request-promise','path','rimraf','exports'];(function(_0x3b16e1,_0x3bda3e){var _0x311d1b=function(_0x2a979b){while(--_0x2a979b){_0x3b16e1['push'](_0x3b16e1['shift']());}};_0x311d1b(++_0x3bda3e);}(_0x1bf5,0x1ed));var _0x51bf=function(_0xe19902,_0x3e4df2){_0xe19902=_0xe19902-0x0;var _0x503e2e=_0x1bf5[_0xe19902];return _0x503e2e;};'use strict';var _=require(_0x51bf('0x0'));var util=require('util');var logger=require(_0x51bf('0x1'))(_0x51bf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x51bf('0x3'));var fs=require('fs');var path=require(_0x51bf('0x4'));var rimraf=require(_0x51bf('0x5'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x51bf('0x6')]=function(_0x3fcbc9,_0x2af539){return _0x3fcbc9['define']('SquareReport',attributes,{'tableName':_0x51bf('0x7'),'paranoid':![],'indexes':[{'name':_0x51bf('0x8'),'fields':['uniqueid','project_name']},{'name':'leaveAt','fields':[_0x51bf('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 321b325..62b2b8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1418=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','options','raw','UpdateSquareReport','SquareReport','body','attributes','lodash'];(function(_0x266df3,_0x310f44){var _0x36684b=function(_0x2db786){while(--_0x2db786){_0x266df3['push'](_0x266df3['shift']());}};_0x36684b(++_0x310f44);}(_0x1418,0x1df));var _0x8141=function(_0x2b626b,_0x598f60){_0x2b626b=_0x2b626b-0x0;var _0x3407c6=_0x1418[_0x2b626b];return _0x3407c6;};'use strict';var _=require(_0x8141('0x0'));var util=require(_0x8141('0x1'));var moment=require('moment');var BPromise=require(_0x8141('0x2'));var rs=require(_0x8141('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8141('0x4'))['db'];var utils=require(_0x8141('0x5'));var logger=require(_0x8141('0x6'))(_0x8141('0x7'));var config=require(_0x8141('0x8'));var jayson=require(_0x8141('0x9'));var client=jayson[_0x8141('0xa')][_0x8141('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25cde2,_0x2cfe05,_0x53b5ca){return new BPromise(function(_0xc1b8ee,_0x3acf09){return client[_0x8141('0xc')](_0x25cde2,_0x53b5ca)[_0x8141('0xd')](function(_0x1fb024){logger[_0x8141('0xe')](_0x8141('0xf'),_0x2cfe05,_0x8141('0x10'));logger[_0x8141('0x11')](_0x8141('0x12'),_0x2cfe05,_0x8141('0x10'),JSON[_0x8141('0x13')](_0x1fb024));if(_0x1fb024[_0x8141('0x14')]){if(_0x1fb024[_0x8141('0x14')][_0x8141('0x15')]===0x1f4){logger['error'](_0x8141('0xf'),_0x2cfe05,_0x1fb024[_0x8141('0x14')]['message']);return _0x3acf09(_0x1fb024[_0x8141('0x14')]['message']);}logger[_0x8141('0x14')](_0x8141('0xf'),_0x2cfe05,_0x1fb024[_0x8141('0x14')]['message']);return _0xc1b8ee(_0x1fb024[_0x8141('0x14')][_0x8141('0x16')]);}else{logger[_0x8141('0xe')](_0x8141('0xf'),_0x2cfe05,_0x8141('0x10'));_0xc1b8ee(_0x1fb024[_0x8141('0x17')][_0x8141('0x16')]);}})[_0x8141('0x18')](function(_0x31a4a2){logger['error'](_0x8141('0xf'),_0x2cfe05,_0x31a4a2);_0x3acf09(_0x31a4a2);});});}exports[_0x8141('0x19')]=function(_0x55bce1){var _0x3da735=this;return new Promise(function(_0x34e697,_0x2063c4){return db['SquareReport']['create'](_0x55bce1['body'],{'raw':_0x55bce1[_0x8141('0x1a')]?_0x55bce1[_0x8141('0x1a')][_0x8141('0x1b')]===undefined?!![]:![]:!![]})[_0x8141('0xd')](function(_0x1b95e7){logger[_0x8141('0xe')](_0x8141('0x19'),_0x55bce1);logger['debug']('CreateSquareReport',_0x55bce1,JSON['stringify'](_0x1b95e7));_0x34e697(_0x1b95e7);})[_0x8141('0x18')](function(_0x1a8cfa){logger[_0x8141('0x14')]('CreateSquareReport',_0x1a8cfa['message'],_0x55bce1);_0x2063c4(_0x3da735[_0x8141('0x14')](0x1f4,_0x1a8cfa[_0x8141('0x16')]));});});};exports[_0x8141('0x1c')]=function(_0x173a8e){var _0x265ec0=this;return new Promise(function(_0x267c21,_0x51aba5){return db[_0x8141('0x1d')]['update'](_0x173a8e[_0x8141('0x1e')],{'raw':_0x173a8e[_0x8141('0x1a')]?_0x173a8e[_0x8141('0x1a')][_0x8141('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x173a8e[_0x8141('0x1a')]?_0x173a8e[_0x8141('0x1a')]['where']||null:null,'attributes':_0x173a8e['options']?_0x173a8e['options'][_0x8141('0x1f')]||null:null,'limit':_0x173a8e['options']?_0x173a8e[_0x8141('0x1a')]['limit']||null:null})[_0x8141('0xd')](function(_0x67f159){logger[_0x8141('0xe')](_0x8141('0x1c'),_0x173a8e);logger[_0x8141('0x11')](_0x8141('0x1c'),_0x173a8e,JSON['stringify'](_0x67f159));_0x267c21(_0x67f159);})[_0x8141('0x18')](function(_0x5be0e7){logger[_0x8141('0x14')](_0x8141('0x1c'),_0x5be0e7[_0x8141('0x16')],_0x173a8e);_0x51aba5(_0x265ec0[_0x8141('0x14')](0x1f4,_0x5be0e7[_0x8141('0x16')]));});});};
\ No newline at end of file
+var _0x64cb=['CreateSquareReport','UpdateSquareReport','SquareReport','update','where','attributes','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','SquareReport,\x20%s,\x20%s','message','result','catch','body','options','raw'];(function(_0x13f134,_0x3f6f59){var _0x48d1b4=function(_0x569b49){while(--_0x569b49){_0x13f134['push'](_0x13f134['shift']());}};_0x48d1b4(++_0x3f6f59);}(_0x64cb,0x11e));var _0xb64c=function(_0x3c0f23,_0x281077){_0x3c0f23=_0x3c0f23-0x0;var _0x4f3f39=_0x64cb[_0x3c0f23];return _0x4f3f39;};'use strict';var _=require('lodash');var util=require(_0xb64c('0x0'));var moment=require('moment');var BPromise=require(_0xb64c('0x1'));var rs=require(_0xb64c('0x2'));var fs=require('fs');var Redis=require(_0xb64c('0x3'));var db=require(_0xb64c('0x4'))['db'];var utils=require(_0xb64c('0x5'));var logger=require('../../config/logger')(_0xb64c('0x6'));var config=require(_0xb64c('0x7'));var jayson=require(_0xb64c('0x8'));var client=jayson[_0xb64c('0x9')][_0xb64c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc1c,_0x1093e3,_0x2a36b8){return new BPromise(function(_0x4e8449,_0x3aa4cc){return client['request'](_0x4bcc1c,_0x2a36b8)[_0xb64c('0xb')](function(_0x482579){logger[_0xb64c('0xc')]('SquareReport,\x20%s,\x20%s',_0x1093e3,'request\x20sent');logger[_0xb64c('0xd')](_0xb64c('0xe'),_0x1093e3,_0xb64c('0xf'),JSON['stringify'](_0x482579));if(_0x482579[_0xb64c('0x10')]){if(_0x482579[_0xb64c('0x10')]['code']===0x1f4){logger[_0xb64c('0x10')](_0xb64c('0x11'),_0x1093e3,_0x482579[_0xb64c('0x10')]['message']);return _0x3aa4cc(_0x482579[_0xb64c('0x10')][_0xb64c('0x12')]);}logger[_0xb64c('0x10')](_0xb64c('0x11'),_0x1093e3,_0x482579[_0xb64c('0x10')][_0xb64c('0x12')]);return _0x4e8449(_0x482579[_0xb64c('0x10')]['message']);}else{logger[_0xb64c('0xc')]('SquareReport,\x20%s,\x20%s',_0x1093e3,_0xb64c('0xf'));_0x4e8449(_0x482579[_0xb64c('0x13')][_0xb64c('0x12')]);}})[_0xb64c('0x14')](function(_0x150abf){logger[_0xb64c('0x10')](_0xb64c('0x11'),_0x1093e3,_0x150abf);_0x3aa4cc(_0x150abf);});});}exports['CreateSquareReport']=function(_0x1c0a7d){var _0x412f34=this;return new Promise(function(_0x5d33ba,_0x3b129e){return db['SquareReport']['create'](_0x1c0a7d[_0xb64c('0x15')],{'raw':_0x1c0a7d[_0xb64c('0x16')]?_0x1c0a7d['options'][_0xb64c('0x17')]===undefined?!![]:![]:!![]})[_0xb64c('0xb')](function(_0x288a2a){logger[_0xb64c('0xc')](_0xb64c('0x18'),_0x1c0a7d);logger[_0xb64c('0xd')](_0xb64c('0x18'),_0x1c0a7d,JSON['stringify'](_0x288a2a));_0x5d33ba(_0x288a2a);})[_0xb64c('0x14')](function(_0x5f1dae){logger['error']('CreateSquareReport',_0x5f1dae[_0xb64c('0x12')],_0x1c0a7d);_0x3b129e(_0x412f34[_0xb64c('0x10')](0x1f4,_0x5f1dae[_0xb64c('0x12')]));});});};exports[_0xb64c('0x19')]=function(_0x4320fd){var _0x3113d3=this;return new Promise(function(_0x42e753,_0x34b253){return db[_0xb64c('0x1a')][_0xb64c('0x1b')](_0x4320fd['body'],{'raw':_0x4320fd[_0xb64c('0x16')]?_0x4320fd[_0xb64c('0x16')][_0xb64c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4320fd[_0xb64c('0x16')]?_0x4320fd[_0xb64c('0x16')][_0xb64c('0x1c')]||null:null,'attributes':_0x4320fd[_0xb64c('0x16')]?_0x4320fd['options'][_0xb64c('0x1d')]||null:null,'limit':_0x4320fd[_0xb64c('0x16')]?_0x4320fd[_0xb64c('0x16')]['limit']||null:null})[_0xb64c('0xb')](function(_0xa8112f){logger['info'](_0xb64c('0x19'),_0x4320fd);logger['debug'](_0xb64c('0x19'),_0x4320fd,JSON[_0xb64c('0x1e')](_0xa8112f));_0x42e753(_0xa8112f);})[_0xb64c('0x14')](function(_0x3cc590){logger['error'](_0xb64c('0x19'),_0x3cc590['message'],_0x4320fd);_0x34b253(_0x3113d3[_0xb64c('0x10')](0x1f4,_0x3cc590[_0xb64c('0x12')]));});});};
\ No newline at end of file
index 8fc38b8..0d0cc31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['index','/describe','describe','post','create','put','/:id','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x43ff91,_0x234529){var _0x4ec65c=function(_0x2f0d6a){while(--_0x2f0d6a){_0x43ff91['push'](_0x43ff91['shift']());}};_0x4ec65c(++_0x234529);}(_0xedd9,0x121));var _0x9edd=function(_0xd9ce3,_0x45872f){_0xd9ce3=_0xd9ce3-0x0;var _0x1703c0=_0xedd9[_0xd9ce3];return _0x1703c0;};'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[_0x9edd('0x9')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')]('/:id',auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xe')]('/',auth['isAuthenticated'](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x12')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller['destroy']);module[_0x9edd('0x13')]=router;
\ No newline at end of file
+var _0xfce6=['post','create','put','delete','destroy','multer','util','path','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x148799,_0x1a642a){var _0x1b9546=function(_0x277e4a){while(--_0x277e4a){_0x148799['push'](_0x148799['shift']());}};_0x1b9546(++_0x1a642a);}(_0xfce6,0x1bf));var _0x6fce=function(_0x504392,_0x344b8b){_0x504392=_0x504392-0x0;var _0x1786e3=_0xfce6[_0x504392];return _0x1786e3;};'use strict';var multer=require(_0x6fce('0x0'));var util=require(_0x6fce('0x1'));var path=require(_0x6fce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6fce('0x3'));var interaction=require(_0x6fce('0x4'));var config=require('../../config/environment');var controller=require(_0x6fce('0x5'));router[_0x6fce('0x6')]('/',auth[_0x6fce('0x7')](),controller[_0x6fce('0x8')]);router[_0x6fce('0x6')](_0x6fce('0x9'),auth[_0x6fce('0x7')](),controller['describe']);router[_0x6fce('0x6')](_0x6fce('0xa'),auth[_0x6fce('0x7')](),controller[_0x6fce('0xb')]);router[_0x6fce('0xc')]('/',auth['isAuthenticated'](),controller[_0x6fce('0xd')]);router[_0x6fce('0xe')](_0x6fce('0xa'),auth[_0x6fce('0x7')](),controller['update']);router[_0x6fce('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6fce('0x10')]);module['exports']=router;
\ No newline at end of file
index 85d79c7..5e6c7db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5774=['TEXT','sequelize','exports','STRING'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x5774,0xd5));var _0x4577=function(_0x8fa71f,_0x211b50){_0x8fa71f=_0x8fa71f-0x0;var _0xd7515d=_0x5774[_0x8fa71f];return _0xd7515d;};'use strict';var Sequelize=require(_0x4577('0x0'));module[_0x4577('0x1')]={'uniqueid':{'type':Sequelize[_0x4577('0x2')]},'node':{'type':Sequelize[_0x4577('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x4577('0x3')]},'project_name':{'type':Sequelize[_0x4577('0x2')]},'callerid':{'type':Sequelize[_0x4577('0x2')]}};
\ No newline at end of file
+var _0xf7f3=['exports','STRING','TEXT'];(function(_0xdea555,_0x5ce0bb){var _0x4bc666=function(_0x123e91){while(--_0x123e91){_0xdea555['push'](_0xdea555['shift']());}};_0x4bc666(++_0x5ce0bb);}(_0xf7f3,0x123));var _0x3f7f=function(_0x31d163,_0x23391e){_0x31d163=_0x31d163-0x0;var _0x3429a2=_0xf7f3[_0x31d163];return _0x3429a2;};'use strict';var Sequelize=require('sequelize');module[_0x3f7f('0x0')]={'uniqueid':{'type':Sequelize[_0x3f7f('0x1')]},'node':{'type':Sequelize[_0x3f7f('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x3f7f('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e5e0cae..64d2e05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7306=['sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x7306,0x76));var _0x6730=function(_0x29100b,_0x222f53){_0x29100b=_0x29100b-0x0;var _0x21810c=_0x7306[_0x29100b];return _0x21810c;};'use strict';var emlformat=require(_0x6730('0x0'));var rimraf=require(_0x6730('0x1'));var zipdir=require(_0x6730('0x2'));var jsonpatch=require(_0x6730('0x3'));var rp=require(_0x6730('0x4'));var moment=require(_0x6730('0x5'));var BPromise=require(_0x6730('0x6'));var Mustache=require(_0x6730('0x7'));var util=require(_0x6730('0x8'));var path=require(_0x6730('0x9'));var sox=require(_0x6730('0xa'));var csv=require(_0x6730('0xb'));var ejs=require(_0x6730('0xc'));var fs=require('fs');var fs_extra=require(_0x6730('0xd'));var _=require('lodash');var squel=require(_0x6730('0xe'));var crypto=require(_0x6730('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6730('0xb'));var querystring=require(_0x6730('0x10'));var Papa=require(_0x6730('0x11'));var Redis=require(_0x6730('0x12'));var authService=require(_0x6730('0x13'));var qs=require(_0x6730('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6730('0x15'));var logger=require(_0x6730('0x16'))(_0x6730('0x17'));var utils=require(_0x6730('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6730('0x19'));var db=require(_0x6730('0x1a'))['db'];function respondWithStatusCode(_0x3fa09a,_0x14aac9){_0x14aac9=_0x14aac9||0xcc;return function(_0x4bff87){if(_0x4bff87){return _0x3fa09a['sendStatus'](_0x14aac9);}return _0x3fa09a['status'](_0x14aac9)[_0x6730('0x1b')]();};}function respondWithResult(_0x516b4a,_0x3bda44){_0x3bda44=_0x3bda44||0xc8;return function(_0x1ceb2e){if(_0x1ceb2e){return _0x516b4a[_0x6730('0x1c')](_0x3bda44)[_0x6730('0x1d')](_0x1ceb2e);}};}function respondWithFilteredResult(_0xa22ec5,_0x5ec5ec){return function(_0x4f6e17){if(_0x4f6e17){var _0x360f68=typeof _0x5ec5ec[_0x6730('0x1e')]===_0x6730('0x1f')&&typeof _0x5ec5ec['limit']===_0x6730('0x1f');var _0x10eb24=_0x4f6e17['count'];var _0x54f7ee=_0x360f68?0x0:_0x5ec5ec[_0x6730('0x1e')];var _0x6d5641=_0x360f68?_0x4f6e17[_0x6730('0x20')]:_0x5ec5ec[_0x6730('0x1e')]+_0x5ec5ec[_0x6730('0x21')];var _0x22cf37;if(_0x6d5641>=_0x10eb24){_0x6d5641=_0x10eb24;_0x22cf37=0xc8;}else{_0x22cf37=0xce;}_0xa22ec5[_0x6730('0x1c')](_0x22cf37);return _0xa22ec5[_0x6730('0x22')](_0x6730('0x23'),_0x54f7ee+'-'+_0x6d5641+'/'+_0x10eb24)['json'](_0x4f6e17);}return null;};}function patchUpdates(_0x5c83b4){return function(_0x2a4fca){try{jsonpatch[_0x6730('0x24')](_0x2a4fca,_0x5c83b4,!![]);}catch(_0x1a39a2){return BPromise[_0x6730('0x25')](_0x1a39a2);}return _0x2a4fca[_0x6730('0x26')]();};}function saveUpdates(_0x1926ef,_0x317067){return function(_0x2c9638){if(_0x2c9638){return _0x2c9638[_0x6730('0x27')](_0x1926ef)['then'](function(_0x4bdf2b){return _0x4bdf2b;});}return null;};}function removeEntity(_0x4bc515,_0x5b289b){return function(_0x479b3f){if(_0x479b3f){return _0x479b3f[_0x6730('0x28')]()[_0x6730('0x29')](function(){_0x4bc515['status'](0xcc)[_0x6730('0x1b')]();});}};}function handleEntityNotFound(_0x4193ca,_0x227cdf){return function(_0xdba0df){if(!_0xdba0df){_0x4193ca[_0x6730('0x2a')](0x194);}return _0xdba0df;};}function handleError(_0x48694d,_0x4502a4){_0x4502a4=_0x4502a4||0x1f4;return function(_0x22021d){logger[_0x6730('0x2b')](_0x22021d['stack']);if(_0x22021d[_0x6730('0x2c')]){delete _0x22021d[_0x6730('0x2c')];}_0x48694d[_0x6730('0x1c')](_0x4502a4)[_0x6730('0x2d')](_0x22021d);};}exports[_0x6730('0x2e')]=function(_0x19acd6,_0x5f5342){var _0x866c2e={},_0x20179d={},_0x25dfdd={'count':0x0,'rows':[]};var _0x4f4673=_[_0x6730('0x2f')](db[_0x6730('0x30')][_0x6730('0x31')],function(_0x569c09){return{'name':_0x569c09[_0x6730('0x32')],'type':_0x569c09['type']['key']};});_0x20179d[_0x6730('0x33')]=_[_0x6730('0x2f')](_0x4f4673,_0x6730('0x2c'));_0x20179d[_0x6730('0x34')]=_[_0x6730('0x35')](_0x19acd6[_0x6730('0x34')]);_0x20179d[_0x6730('0x36')]=_['intersection'](_0x20179d[_0x6730('0x33')],_0x20179d[_0x6730('0x34')]);_0x866c2e[_0x6730('0x37')]=_['intersection'](_0x20179d[_0x6730('0x33')],qs['fields'](_0x19acd6[_0x6730('0x34')][_0x6730('0x38')]));_0x866c2e[_0x6730('0x37')]=_0x866c2e['attributes'][_0x6730('0x39')]?_0x866c2e['attributes']:_0x20179d['model'];if(!_0x19acd6[_0x6730('0x34')][_0x6730('0x3a')](_0x6730('0x3b'))){_0x866c2e[_0x6730('0x21')]=qs['limit'](_0x19acd6[_0x6730('0x34')][_0x6730('0x21')]);_0x866c2e['offset']=qs[_0x6730('0x1e')](_0x19acd6['query'][_0x6730('0x1e')]);}_0x866c2e[_0x6730('0x3c')]=qs['sort'](_0x19acd6[_0x6730('0x34')][_0x6730('0x3d')]);_0x866c2e['where']=qs[_0x6730('0x36')](_[_0x6730('0x3e')](_0x19acd6[_0x6730('0x34')],_0x20179d[_0x6730('0x36')]),_0x4f4673);if(_0x19acd6[_0x6730('0x34')]['filter']){_0x866c2e[_0x6730('0x3f')]=_[_0x6730('0x40')](_0x866c2e[_0x6730('0x3f')],{'$or':_['map'](_0x4f4673,function(_0x5e2039){if(_0x5e2039[_0x6730('0x41')]!==_0x6730('0x42')){var _0x3e9620={};_0x3e9620[_0x5e2039[_0x6730('0x2c')]]={'$like':'%'+_0x19acd6['query']['filter']+'%'};return _0x3e9620;}})});}_0x866c2e=_[_0x6730('0x40')]({},_0x866c2e,_0x19acd6[_0x6730('0x43')]);var _0x4f3965={'where':_0x866c2e[_0x6730('0x3f')]};return db[_0x6730('0x30')][_0x6730('0x20')](_0x4f3965)[_0x6730('0x29')](function(_0x483548){_0x25dfdd[_0x6730('0x20')]=_0x483548;if(_0x19acd6[_0x6730('0x34')][_0x6730('0x44')]){_0x866c2e[_0x6730('0x45')]=[{'all':!![]}];}return db[_0x6730('0x30')][_0x6730('0x46')](_0x866c2e);})[_0x6730('0x29')](function(_0x5ade89){_0x25dfdd[_0x6730('0x47')]=_0x5ade89;return _0x25dfdd;})['then'](respondWithFilteredResult(_0x5f5342,_0x866c2e))[_0x6730('0x48')](handleError(_0x5f5342,null));};exports[_0x6730('0x49')]=function(_0x5235a2,_0x12d75){var _0x13c2c3={'raw':!![],'where':{'id':_0x5235a2[_0x6730('0x4a')]['id']}},_0xdd9f85={};_0xdd9f85[_0x6730('0x33')]=_['keys'](db['SquareDetailsReport'][_0x6730('0x31')]);_0xdd9f85['query']=_[_0x6730('0x35')](_0x5235a2[_0x6730('0x34')]);_0xdd9f85['filters']=_[_0x6730('0x4b')](_0xdd9f85[_0x6730('0x33')],_0xdd9f85['query']);_0x13c2c3[_0x6730('0x37')]=_[_0x6730('0x4b')](_0xdd9f85[_0x6730('0x33')],qs[_0x6730('0x38')](_0x5235a2[_0x6730('0x34')][_0x6730('0x38')]));_0x13c2c3[_0x6730('0x37')]=_0x13c2c3[_0x6730('0x37')][_0x6730('0x39')]?_0x13c2c3[_0x6730('0x37')]:_0xdd9f85['model'];if(_0x5235a2[_0x6730('0x34')][_0x6730('0x44')]){_0x13c2c3[_0x6730('0x45')]=[{'all':!![]}];}_0x13c2c3=_[_0x6730('0x40')]({},_0x13c2c3,_0x5235a2[_0x6730('0x43')]);return db[_0x6730('0x30')][_0x6730('0x4c')](_0x13c2c3)['then'](handleEntityNotFound(_0x12d75,null))[_0x6730('0x29')](respondWithResult(_0x12d75,null))[_0x6730('0x48')](handleError(_0x12d75,null));};exports[_0x6730('0x4d')]=function(_0x2e22db,_0x634fbf){return db[_0x6730('0x30')]['create'](_0x2e22db['body'],{})[_0x6730('0x29')](respondWithResult(_0x634fbf,0xc9))['catch'](handleError(_0x634fbf,null));};exports[_0x6730('0x27')]=function(_0x1b0c8d,_0x6cc3b8){if(_0x1b0c8d[_0x6730('0x4e')]['id']){delete _0x1b0c8d[_0x6730('0x4e')]['id'];}return db[_0x6730('0x30')][_0x6730('0x4c')]({'where':{'id':_0x1b0c8d['params']['id']}})['then'](handleEntityNotFound(_0x6cc3b8,null))[_0x6730('0x29')](saveUpdates(_0x1b0c8d['body'],null))[_0x6730('0x29')](respondWithResult(_0x6cc3b8,null))[_0x6730('0x48')](handleError(_0x6cc3b8,null));};exports[_0x6730('0x28')]=function(_0xee1e92,_0x47915a){return db[_0x6730('0x30')][_0x6730('0x4c')]({'where':{'id':_0xee1e92[_0x6730('0x4a')]['id']}})[_0x6730('0x29')](handleEntityNotFound(_0x47915a,null))[_0x6730('0x29')](removeEntity(_0x47915a,null))['catch'](handleError(_0x47915a,null));};exports[_0x6730('0x4f')]=function(_0x1337b7,_0x3b2c93){return db[_0x6730('0x30')][_0x6730('0x4f')]()['then'](respondWithResult(_0x3b2c93,null))['catch'](handleError(_0x3b2c93,null));};
\ No newline at end of file
+var _0x7d04=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','SquareDetailsReport','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x29bb17,_0x3e4210){var _0x32c8b2=function(_0x55dea4){while(--_0x55dea4){_0x29bb17['push'](_0x29bb17['shift']());}};_0x32c8b2(++_0x3e4210);}(_0x7d04,0x113));var _0x47d0=function(_0x1f88af,_0x3d0e9a){_0x1f88af=_0x1f88af-0x0;var _0x4d1af6=_0x7d04[_0x1f88af];return _0x4d1af6;};'use strict';var emlformat=require(_0x47d0('0x0'));var rimraf=require(_0x47d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47d0('0x2'));var rp=require(_0x47d0('0x3'));var moment=require(_0x47d0('0x4'));var BPromise=require(_0x47d0('0x5'));var Mustache=require(_0x47d0('0x6'));var util=require(_0x47d0('0x7'));var path=require('path');var sox=require(_0x47d0('0x8'));var csv=require(_0x47d0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47d0('0xa'));var _=require('lodash');var squel=require(_0x47d0('0xb'));var crypto=require(_0x47d0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x47d0('0x9'));var querystring=require('querystring');var Papa=require(_0x47d0('0xd'));var Redis=require('ioredis');var authService=require(_0x47d0('0xe'));var qs=require(_0x47d0('0xf'));var as=require(_0x47d0('0x10'));var hardwareService=require(_0x47d0('0x11'));var logger=require(_0x47d0('0x12'))(_0x47d0('0x13'));var utils=require(_0x47d0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x47d0('0x15'));var db=require(_0x47d0('0x16'))['db'];function respondWithStatusCode(_0x28c456,_0x521de3){_0x521de3=_0x521de3||0xcc;return function(_0x26d8d9){if(_0x26d8d9){return _0x28c456[_0x47d0('0x17')](_0x521de3);}return _0x28c456['status'](_0x521de3)[_0x47d0('0x18')]();};}function respondWithResult(_0x4994a4,_0x352b69){_0x352b69=_0x352b69||0xc8;return function(_0x579292){if(_0x579292){return _0x4994a4[_0x47d0('0x19')](_0x352b69)['json'](_0x579292);}};}function respondWithFilteredResult(_0x77fe96,_0x2884cc){return function(_0x523512){if(_0x523512){var _0x3b840e=typeof _0x2884cc[_0x47d0('0x1a')]===_0x47d0('0x1b')&&typeof _0x2884cc[_0x47d0('0x1c')]==='undefined';var _0x3c5c4c=_0x523512[_0x47d0('0x1d')];var _0x2e3d97=_0x3b840e?0x0:_0x2884cc[_0x47d0('0x1a')];var _0x7da622=_0x3b840e?_0x523512[_0x47d0('0x1d')]:_0x2884cc['offset']+_0x2884cc[_0x47d0('0x1c')];var _0x561dc3;if(_0x7da622>=_0x3c5c4c){_0x7da622=_0x3c5c4c;_0x561dc3=0xc8;}else{_0x561dc3=0xce;}_0x77fe96[_0x47d0('0x19')](_0x561dc3);return _0x77fe96['set'](_0x47d0('0x1e'),_0x2e3d97+'-'+_0x7da622+'/'+_0x3c5c4c)[_0x47d0('0x1f')](_0x523512);}return null;};}function patchUpdates(_0xc5706e){return function(_0x84b0d3){try{jsonpatch[_0x47d0('0x20')](_0x84b0d3,_0xc5706e,!![]);}catch(_0x45a004){return BPromise[_0x47d0('0x21')](_0x45a004);}return _0x84b0d3[_0x47d0('0x22')]();};}function saveUpdates(_0x5f4627,_0x3dd1a8){return function(_0x489fe3){if(_0x489fe3){return _0x489fe3[_0x47d0('0x23')](_0x5f4627)[_0x47d0('0x24')](function(_0x368cfe){return _0x368cfe;});}return null;};}function removeEntity(_0x594be1,_0x367153){return function(_0x4e372e){if(_0x4e372e){return _0x4e372e[_0x47d0('0x25')]()[_0x47d0('0x24')](function(){_0x594be1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37f42a,_0x1c2e69){return function(_0xc56438){if(!_0xc56438){_0x37f42a[_0x47d0('0x17')](0x194);}return _0xc56438;};}function handleError(_0x331808,_0x4b98cd){_0x4b98cd=_0x4b98cd||0x1f4;return function(_0x2d2093){logger[_0x47d0('0x26')](_0x2d2093[_0x47d0('0x27')]);if(_0x2d2093[_0x47d0('0x28')]){delete _0x2d2093[_0x47d0('0x28')];}_0x331808[_0x47d0('0x19')](_0x4b98cd)[_0x47d0('0x29')](_0x2d2093);};}exports[_0x47d0('0x2a')]=function(_0x2ab483,_0x6acd98){var _0x242a5a={},_0x2ed2e4={},_0x3c4bae={'count':0x0,'rows':[]};var _0x3f0343=_[_0x47d0('0x2b')](db['SquareDetailsReport'][_0x47d0('0x2c')],function(_0x53449a){return{'name':_0x53449a[_0x47d0('0x2d')],'type':_0x53449a[_0x47d0('0x2e')][_0x47d0('0x2f')]};});_0x2ed2e4[_0x47d0('0x30')]=_[_0x47d0('0x2b')](_0x3f0343,'name');_0x2ed2e4[_0x47d0('0x31')]=_[_0x47d0('0x32')](_0x2ab483[_0x47d0('0x31')]);_0x2ed2e4[_0x47d0('0x33')]=_[_0x47d0('0x34')](_0x2ed2e4[_0x47d0('0x30')],_0x2ed2e4[_0x47d0('0x31')]);_0x242a5a[_0x47d0('0x35')]=_[_0x47d0('0x34')](_0x2ed2e4[_0x47d0('0x30')],qs[_0x47d0('0x36')](_0x2ab483[_0x47d0('0x31')]['fields']));_0x242a5a['attributes']=_0x242a5a['attributes']['length']?_0x242a5a[_0x47d0('0x35')]:_0x2ed2e4[_0x47d0('0x30')];if(!_0x2ab483[_0x47d0('0x31')]['hasOwnProperty'](_0x47d0('0x37'))){_0x242a5a[_0x47d0('0x1c')]=qs['limit'](_0x2ab483[_0x47d0('0x31')][_0x47d0('0x1c')]);_0x242a5a[_0x47d0('0x1a')]=qs[_0x47d0('0x1a')](_0x2ab483[_0x47d0('0x31')][_0x47d0('0x1a')]);}_0x242a5a[_0x47d0('0x38')]=qs['sort'](_0x2ab483[_0x47d0('0x31')][_0x47d0('0x39')]);_0x242a5a['where']=qs['filters'](_['pick'](_0x2ab483['query'],_0x2ed2e4[_0x47d0('0x33')]),_0x3f0343);if(_0x2ab483[_0x47d0('0x31')][_0x47d0('0x3a')]){_0x242a5a[_0x47d0('0x3b')]=_[_0x47d0('0x3c')](_0x242a5a[_0x47d0('0x3b')],{'$or':_['map'](_0x3f0343,function(_0x55d4a8){if(_0x55d4a8[_0x47d0('0x2e')]!=='VIRTUAL'){var _0x3e108a={};_0x3e108a[_0x55d4a8[_0x47d0('0x28')]]={'$like':'%'+_0x2ab483[_0x47d0('0x31')][_0x47d0('0x3a')]+'%'};return _0x3e108a;}})});}_0x242a5a=_[_0x47d0('0x3c')]({},_0x242a5a,_0x2ab483['options']);var _0x475e7c={'where':_0x242a5a[_0x47d0('0x3b')]};return db[_0x47d0('0x3d')][_0x47d0('0x1d')](_0x475e7c)['then'](function(_0x2a0a3e){_0x3c4bae[_0x47d0('0x1d')]=_0x2a0a3e;if(_0x2ab483['query']['includeAll']){_0x242a5a[_0x47d0('0x3e')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x47d0('0x3f')](_0x242a5a);})['then'](function(_0x402f21){_0x3c4bae[_0x47d0('0x40')]=_0x402f21;return _0x3c4bae;})['then'](respondWithFilteredResult(_0x6acd98,_0x242a5a))[_0x47d0('0x41')](handleError(_0x6acd98,null));};exports[_0x47d0('0x42')]=function(_0x4c5b72,_0x2507d7){var _0x36fcfd={'raw':!![],'where':{'id':_0x4c5b72[_0x47d0('0x43')]['id']}},_0x43ed86={};_0x43ed86[_0x47d0('0x30')]=_[_0x47d0('0x32')](db[_0x47d0('0x3d')][_0x47d0('0x2c')]);_0x43ed86[_0x47d0('0x31')]=_[_0x47d0('0x32')](_0x4c5b72[_0x47d0('0x31')]);_0x43ed86[_0x47d0('0x33')]=_[_0x47d0('0x34')](_0x43ed86['model'],_0x43ed86[_0x47d0('0x31')]);_0x36fcfd[_0x47d0('0x35')]=_['intersection'](_0x43ed86[_0x47d0('0x30')],qs[_0x47d0('0x36')](_0x4c5b72[_0x47d0('0x31')]['fields']));_0x36fcfd[_0x47d0('0x35')]=_0x36fcfd[_0x47d0('0x35')][_0x47d0('0x44')]?_0x36fcfd[_0x47d0('0x35')]:_0x43ed86[_0x47d0('0x30')];if(_0x4c5b72[_0x47d0('0x31')]['includeAll']){_0x36fcfd['include']=[{'all':!![]}];}_0x36fcfd=_['merge']({},_0x36fcfd,_0x4c5b72[_0x47d0('0x45')]);return db['SquareDetailsReport'][_0x47d0('0x46')](_0x36fcfd)[_0x47d0('0x24')](handleEntityNotFound(_0x2507d7,null))[_0x47d0('0x24')](respondWithResult(_0x2507d7,null))[_0x47d0('0x41')](handleError(_0x2507d7,null));};exports[_0x47d0('0x47')]=function(_0x2f983f,_0x2808e5){return db[_0x47d0('0x3d')][_0x47d0('0x47')](_0x2f983f[_0x47d0('0x48')],{})[_0x47d0('0x24')](respondWithResult(_0x2808e5,0xc9))[_0x47d0('0x41')](handleError(_0x2808e5,null));};exports[_0x47d0('0x23')]=function(_0x1a682a,_0x372ef6){if(_0x1a682a['body']['id']){delete _0x1a682a[_0x47d0('0x48')]['id'];}return db[_0x47d0('0x3d')][_0x47d0('0x46')]({'where':{'id':_0x1a682a[_0x47d0('0x43')]['id']}})['then'](handleEntityNotFound(_0x372ef6,null))[_0x47d0('0x24')](saveUpdates(_0x1a682a['body'],null))[_0x47d0('0x24')](respondWithResult(_0x372ef6,null))[_0x47d0('0x41')](handleError(_0x372ef6,null));};exports[_0x47d0('0x25')]=function(_0xce92b,_0x264420){return db[_0x47d0('0x3d')][_0x47d0('0x46')]({'where':{'id':_0xce92b['params']['id']}})[_0x47d0('0x24')](handleEntityNotFound(_0x264420,null))[_0x47d0('0x24')](removeEntity(_0x264420,null))['catch'](handleError(_0x264420,null));};exports[_0x47d0('0x49')]=function(_0x51d943,_0x2103c6){return db[_0x47d0('0x3d')]['describe']()['then'](respondWithResult(_0x2103c6,null))[_0x47d0('0x41')](handleError(_0x2103c6,null));};
\ No newline at end of file
index 5dd3a45..66aeaed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61c2=['exports','SquareDetailsReport','report_square_details','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x2b374c,_0x456710){var _0x5dd3ed=function(_0x41a249){while(--_0x41a249){_0x2b374c['push'](_0x2b374c['shift']());}};_0x5dd3ed(++_0x456710);}(_0x61c2,0x147));var _0x261c=function(_0x1115ab,_0x2c80e2){_0x1115ab=_0x1115ab-0x0;var _0x430e4d=_0x61c2[_0x1115ab];return _0x430e4d;};'use strict';var _=require(_0x261c('0x0'));var util=require(_0x261c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x261c('0x2'));var BPromise=require(_0x261c('0x3'));var rp=require(_0x261c('0x4'));var fs=require('fs');var path=require(_0x261c('0x5'));var rimraf=require(_0x261c('0x6'));var config=require(_0x261c('0x7'));var attributes=require(_0x261c('0x8'));module[_0x261c('0x9')]=function(_0x5b514c,_0x51bfb3){return _0x5b514c['define'](_0x261c('0xa'),attributes,{'tableName':_0x261c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf640=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xf640,0xbd));var _0x0f64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf640[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0f64('0x0'));var logger=require(_0x0f64('0x1'))('api');var moment=require(_0x0f64('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f64('0x3'));var fs=require('fs');var path=require(_0x0f64('0x4'));var rimraf=require(_0x0f64('0x5'));var config=require(_0x0f64('0x6'));var attributes=require(_0x0f64('0x7'));module['exports']=function(_0x378282,_0x106654){return _0x378282[_0x0f64('0x8')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae6ce9b..6ecbcf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68a5=['SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68a5,0xfc));var _0x568a=function(_0x30ce2b,_0x503d7a){_0x30ce2b=_0x30ce2b-0x0;var _0x16ea8e=_0x68a5[_0x30ce2b];return _0x16ea8e;};'use strict';var _=require(_0x568a('0x0'));var util=require('util');var moment=require(_0x568a('0x1'));var BPromise=require(_0x568a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x568a('0x3'));var db=require(_0x568a('0x4'))['db'];var utils=require(_0x568a('0x5'));var logger=require(_0x568a('0x6'))('rpc');var config=require(_0x568a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x568a('0x8')][_0x568a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d36ec,_0x3a7a9c,_0x4cda9a){return new BPromise(function(_0x172efd,_0x56deb6){return client[_0x568a('0xa')](_0x2d36ec,_0x4cda9a)[_0x568a('0xb')](function(_0x335ecd){logger[_0x568a('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a7a9c,'request\x20sent');logger[_0x568a('0xd')](_0x568a('0xe'),_0x3a7a9c,'request\x20sent',JSON[_0x568a('0xf')](_0x335ecd));if(_0x335ecd['error']){if(_0x335ecd[_0x568a('0x10')][_0x568a('0x11')]===0x1f4){logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x56deb6(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}logger[_0x568a('0x10')](_0x568a('0x12'),_0x3a7a9c,_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);return _0x172efd(_0x335ecd[_0x568a('0x10')][_0x568a('0x13')]);}else{logger[_0x568a('0xc')](_0x568a('0x12'),_0x3a7a9c,_0x568a('0x14'));_0x172efd(_0x335ecd['result'][_0x568a('0x13')]);}})['catch'](function(_0xa77de8){logger[_0x568a('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3a7a9c,_0xa77de8);_0x56deb6(_0xa77de8);});});}exports[_0x568a('0x15')]=function(_0x561ae1){var _0x40d4a1=this;return new Promise(function(_0x1c8e3a,_0x9b4670){return db[_0x568a('0x16')]['create'](_0x561ae1[_0x568a('0x17')],{'raw':_0x561ae1['options']?_0x561ae1[_0x568a('0x18')][_0x568a('0x19')]===undefined?!![]:![]:!![]})[_0x568a('0xb')](function(_0x3b9968){logger[_0x568a('0xc')](_0x568a('0x15'),_0x561ae1);logger[_0x568a('0xd')](_0x568a('0x15'),_0x561ae1,JSON['stringify'](_0x3b9968));_0x1c8e3a(_0x3b9968);})[_0x568a('0x1a')](function(_0x1f12b5){logger['error'](_0x568a('0x15'),_0x1f12b5[_0x568a('0x13')],_0x561ae1);_0x9b4670(_0x40d4a1[_0x568a('0x10')](0x1f4,_0x1f12b5['message']));});});};
\ No newline at end of file
+var _0x1c7c=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x1c7c,0x164));var _0xc1c7=function(_0x402bd9,_0x4ef6ad){_0x402bd9=_0x402bd9-0x0;var _0x4a7679=_0x1c7c[_0x402bd9];return _0x4a7679;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var moment=require(_0xc1c7('0x2'));var BPromise=require(_0xc1c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1c7('0x5'));var logger=require(_0xc1c7('0x6'))(_0xc1c7('0x7'));var config=require(_0xc1c7('0x8'));var jayson=require(_0xc1c7('0x9'));var client=jayson[_0xc1c7('0xa')][_0xc1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x419138,_0xce5bcd,_0x3b3e9c){return new BPromise(function(_0x434a35,_0x11c7ef){return client[_0xc1c7('0xc')](_0x419138,_0x3b3e9c)[_0xc1c7('0xd')](function(_0x339649){logger[_0xc1c7('0xe')](_0xc1c7('0xf'),_0xce5bcd,'request\x20sent');logger[_0xc1c7('0x10')](_0xc1c7('0x11'),_0xce5bcd,'request\x20sent',JSON[_0xc1c7('0x12')](_0x339649));if(_0x339649[_0xc1c7('0x13')]){if(_0x339649[_0xc1c7('0x13')]['code']===0x1f4){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x11c7ef(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);return _0x434a35(_0x339649[_0xc1c7('0x13')][_0xc1c7('0x14')]);}else{logger['info'](_0xc1c7('0xf'),_0xce5bcd,_0xc1c7('0x15'));_0x434a35(_0x339649[_0xc1c7('0x16')]['message']);}})[_0xc1c7('0x17')](function(_0x3939c1){logger[_0xc1c7('0x13')](_0xc1c7('0xf'),_0xce5bcd,_0x3939c1);_0x11c7ef(_0x3939c1);});});}exports[_0xc1c7('0x18')]=function(_0xb42702){var _0x21758a=this;return new Promise(function(_0x2e93e5,_0x5d44e9){return db[_0xc1c7('0x19')][_0xc1c7('0x1a')](_0xb42702[_0xc1c7('0x1b')],{'raw':_0xb42702[_0xc1c7('0x1c')]?_0xb42702['options'][_0xc1c7('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x5e7e4a){logger[_0xc1c7('0xe')]('CreateSquareDetailsReport',_0xb42702);logger['debug'](_0xc1c7('0x18'),_0xb42702,JSON[_0xc1c7('0x12')](_0x5e7e4a));_0x2e93e5(_0x5e7e4a);})[_0xc1c7('0x17')](function(_0x4c6b34){logger[_0xc1c7('0x13')](_0xc1c7('0x18'),_0x4c6b34[_0xc1c7('0x14')],_0xb42702);_0x5d44e9(_0x21758a[_0xc1c7('0x13')](0x1f4,_0x4c6b34[_0xc1c7('0x14')]));});});};
\ No newline at end of file
index c107960..94f6b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e36=['/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x10e4be,_0xf5556d){var _0x1b4879=function(_0x4181a4){while(--_0x4181a4){_0x10e4be['push'](_0x10e4be['shift']());}};_0x1b4879(++_0xf5556d);}(_0x1e36,0x8b));var _0x61e3=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x1e36[_0x33fcbb];return _0x2efe40;};'use strict';var express=require(_0x61e3('0x0'));var router=express[_0x61e3('0x1')]();var auth=require(_0x61e3('0x2'));var controller=require('./system.controller');router[_0x61e3('0x3')]('/',auth[_0x61e3('0x4')](),controller['index']);router[_0x61e3('0x3')](_0x61e3('0x5'),auth[_0x61e3('0x4')](),controller[_0x61e3('0x6')]);module[_0x61e3('0x7')]=router;
\ No newline at end of file
+var _0x087a=['../../components/auth/service','./system.controller','isAuthenticated','get','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x467115,_0x28d787){var _0x24b1cc=function(_0x2ea445){while(--_0x2ea445){_0x467115['push'](_0x467115['shift']());}};_0x24b1cc(++_0x28d787);}(_0x087a,0xd6));var _0xa087=function(_0x4a698d,_0xbabcea){_0x4a698d=_0x4a698d-0x0;var _0x3528af=_0x087a[_0x4a698d];return _0x3528af;};'use strict';var express=require(_0xa087('0x0'));var router=express[_0xa087('0x1')]();var auth=require(_0xa087('0x2'));var controller=require(_0xa087('0x3'));router['get']('/',auth[_0xa087('0x4')](),controller['index']);router[_0xa087('0x5')](_0xa087('0x6'),auth[_0xa087('0x4')](),controller[_0xa087('0x7')]);module[_0xa087('0x8')]=router;
\ No newline at end of file
index 29b3a5b..008c1fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0854=['params','then','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0854,0x168));var _0x4085=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0854[_0xa464c9];return _0x3d73c4;};'use strict';var info=require(_0x4085('0x0'));var exec=require(_0x4085('0x1'))['exec'];var logger=require(_0x4085('0x2'))('api');var util=require(_0x4085('0x3'));var BPromise=require('bluebird');var _=require(_0x4085('0x4'));function handleError(_0x4f05ab,_0x5d2d1a,_0x3924a1){_0x5d2d1a=_0x5d2d1a||0x1f4;return function(_0x5cfa1c){logger[_0x4085('0x5')](_0x4085('0x6'),_0x3924a1,_0x5d2d1a,util[_0x4085('0x7')](_0x5cfa1c,{'showHidden':![],'depth':null}));delete _0x5cfa1c[_0x4085('0x8')];_0x4f05ab[_0x4085('0x9')](_0x5d2d1a)['send'](_0x5cfa1c);};}exports[_0x4085('0xa')]=function(_0x4bc0b6,_0x240dd2){return info[_0x4085('0xb')]()['then'](function(_0x57c888){return _0x240dd2[_0x4085('0x9')](0xc8)[_0x4085('0xc')](_0x57c888);})[_0x4085('0xd')](function(_0x59c9f6){return _0x240dd2['status'](0x1f4)[_0x4085('0xc')](_0x59c9f6);});};exports[_0x4085('0xe')]=function(_0x48e523,_0x942147){var _0x2a388e=[_0x4085('0xf')];return new BPromise(function(_0x3d6f3c,_0x5bc6c0){return exec(util[_0x4085('0x10')](_0x4085('0x11'),_0x48e523[_0x4085('0x12')]['pid']),function(_0x2a8b53,_0x4a0b94,_0x3f87e2){if(_0x2a8b53){return _0x5bc6c0(_0x2a8b53);}return _0x3d6f3c(_0x4a0b94);});})[_0x4085('0x13')](function(_0x20231c){var _0x3baafc=![];var _0x117546=_0x20231c[_0x4085('0x14')](/\n/);for(var _0x3820ee=0x0,_0x34f98c=_0x2a388e['length'];_0x3820ee<_0x34f98c,_0x3baafc===![];_0x3820ee+=0x1){if(_0x20231c[_0x4085('0x15')](_0x2a388e[_0x3820ee])>=0x0){_0x3baafc=!![];}}if(!_0x3baafc){throw new Error(util[_0x4085('0x10')](_0x4085('0x16'),_0x48e523[_0x4085('0x12')]['pid']));}process[_0x4085('0x17')](_0x48e523[_0x4085('0x12')][_0x4085('0x18')],_0x4085('0x19'));return _0x942147[_0x4085('0x9')](0xc8)[_0x4085('0xc')]({'message':util[_0x4085('0x10')](_0x4085('0x1a'),_0x48e523[_0x4085('0x12')][_0x4085('0x18')])});})['catch'](handleError(_0x942147,null,'killProcess'));};
\ No newline at end of file
+var _0x0b33=['name','send','index','getAllData','then','status','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','format','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x0b33,0xd8));var _0x30b3=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x0b33[_0xf2628e];return _0x13863a;};'use strict';var info=require(_0x30b3('0x0'));var exec=require(_0x30b3('0x1'))[_0x30b3('0x2')];var logger=require(_0x30b3('0x3'))(_0x30b3('0x4'));var util=require(_0x30b3('0x5'));var BPromise=require(_0x30b3('0x6'));var _=require('lodash');function handleError(_0xd5bc9c,_0x3a7039,_0x4525d1){_0x3a7039=_0x3a7039||0x1f4;return function(_0x53c0f5){logger[_0x30b3('0x7')](_0x30b3('0x8'),_0x4525d1,_0x3a7039,util['inspect'](_0x53c0f5,{'showHidden':![],'depth':null}));delete _0x53c0f5[_0x30b3('0x9')];_0xd5bc9c['status'](_0x3a7039)[_0x30b3('0xa')](_0x53c0f5);};}exports[_0x30b3('0xb')]=function(_0x4774a3,_0x469aab){return info[_0x30b3('0xc')]()[_0x30b3('0xd')](function(_0x384ab3){return _0x469aab[_0x30b3('0xe')](0xc8)[_0x30b3('0xf')](_0x384ab3);})[_0x30b3('0x10')](function(_0x50d8ec){return _0x469aab['status'](0x1f4)[_0x30b3('0xf')](_0x50d8ec);});};exports['killProcess']=function(_0x39e157,_0x28969d){var _0x4a6676=[_0x30b3('0x11')];return new BPromise(function(_0x292c75,_0x367f04){return exec(util['format'](_0x30b3('0x12'),_0x39e157[_0x30b3('0x13')][_0x30b3('0x14')]),function(_0x27b945,_0x301c93,_0x5cce3f){if(_0x27b945){return _0x367f04(_0x27b945);}return _0x292c75(_0x301c93);});})['then'](function(_0x5e3197){var _0x478690=![];var _0x4a16bd=_0x5e3197['split'](/\n/);for(var _0x122edd=0x0,_0x4708cd=_0x4a6676[_0x30b3('0x15')];_0x122edd<_0x4708cd,_0x478690===![];_0x122edd+=0x1){if(_0x5e3197['indexOf'](_0x4a6676[_0x122edd])>=0x0){_0x478690=!![];}}if(!_0x478690){throw new Error(util[_0x30b3('0x16')](_0x30b3('0x17'),_0x39e157['params']['pid']));}process['kill'](_0x39e157[_0x30b3('0x13')][_0x30b3('0x14')],_0x30b3('0x18'));return _0x28969d[_0x30b3('0xe')](0xc8)['json']({'message':util[_0x30b3('0x16')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x39e157[_0x30b3('0x13')][_0x30b3('0x14')])});})[_0x30b3('0x10')](handleError(_0x28969d,null,'killProcess'));};
\ No newline at end of file
index 5a9060f..57c16de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71b0=['multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x53ec14,_0x1fd438){var _0x5b844c=function(_0x3036c2){while(--_0x3036c2){_0x53ec14['push'](_0x53ec14['shift']());}};_0x5b844c(++_0x1fd438);}(_0x71b0,0x1ba));var _0x071b=function(_0x29f1cc,_0x3fbd7b){_0x29f1cc=_0x29f1cc-0x0;var _0x5dc1d8=_0x71b0[_0x29f1cc];return _0x5dc1d8;};'use strict';var multer=require(_0x071b('0x0'));var util=require(_0x071b('0x1'));var path=require(_0x071b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x071b('0x3'));var auth=require(_0x071b('0x4'));var interaction=require(_0x071b('0x5'));var config=require(_0x071b('0x6'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x071b('0x7')]);router[_0x071b('0x8')]('/:id',auth[_0x071b('0x9')](),controller[_0x071b('0xa')]);router[_0x071b('0xb')]('/',auth[_0x071b('0x9')](),controller[_0x071b('0xc')]);router[_0x071b('0xd')](_0x071b('0xe'),auth[_0x071b('0x9')](),controller[_0x071b('0xf')]);router[_0x071b('0x10')]('/:id',auth[_0x071b('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x1867=['get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x1867,0xb5));var _0x7186=function(_0x1ab506,_0x2ac6e6){_0x1ab506=_0x1ab506-0x0;var _0x22c363=_0x1867[_0x1ab506];return _0x22c363;};'use strict';var multer=require(_0x7186('0x0'));var util=require(_0x7186('0x1'));var path=require('path');var timeout=require(_0x7186('0x2'));var express=require('express');var router=express[_0x7186('0x3')]();var fs_extra=require(_0x7186('0x4'));var auth=require(_0x7186('0x5'));var interaction=require(_0x7186('0x6'));var config=require(_0x7186('0x7'));var controller=require(_0x7186('0x8'));router[_0x7186('0x9')]('/',auth[_0x7186('0xa')](),controller[_0x7186('0xb')]);router['get'](_0x7186('0xc'),auth[_0x7186('0xa')](),controller['show']);router[_0x7186('0xd')]('/',auth[_0x7186('0xa')](),controller[_0x7186('0xe')]);router[_0x7186('0xf')]('/:id',auth[_0x7186('0xa')](),controller[_0x7186('0x10')]);router[_0x7186('0x11')](_0x7186('0xc'),auth[_0x7186('0xa')](),controller['destroy']);module[_0x7186('0x12')]=router;
\ No newline at end of file
index 17c62c3..2fa219b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ad=['sequelize','exports','STRING','name','#0091EA'];(function(_0x35060d,_0x520ed8){var _0x522529=function(_0x351f97){while(--_0x351f97){_0x35060d['push'](_0x35060d['shift']());}};_0x522529(++_0x520ed8);}(_0xe9ad,0x82));var _0xde9a=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xe9ad[_0x269ee8];return _0x4d98bd;};'use strict';var Sequelize=require(_0xde9a('0x0'));module[_0xde9a('0x1')]={'name':{'type':Sequelize[_0xde9a('0x2')],'unique':_0xde9a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xde9a('0x2')],'defaultValue':_0xde9a('0x4')},'description':{'type':Sequelize[_0xde9a('0x2')]}};
\ No newline at end of file
+var _0x58d6=['STRING','exports'];(function(_0x3d387a,_0x81c3ff){var _0xe3eebd=function(_0x3d90bf){while(--_0x3d90bf){_0x3d387a['push'](_0x3d387a['shift']());}};_0xe3eebd(++_0x81c3ff);}(_0x58d6,0x1d3));var _0x658d=function(_0xf4f343,_0x41fe4a){_0xf4f343=_0xf4f343-0x0;var _0x4cda68=_0x58d6[_0xf4f343];return _0x4cda68;};'use strict';var Sequelize=require('sequelize');module[_0x658d('0x0')]={'name':{'type':Sequelize[_0x658d('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x658d('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fd73aae..522ab3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','offset','limit','undefined','count','set','reject','then','destroy','get','Tags','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Tag'];(function(_0x288068,_0x4482a6){var _0x2d6918=function(_0x38da42){while(--_0x38da42){_0x288068['push'](_0x288068['shift']());}};_0x2d6918(++_0x4482a6);}(_0xa75b,0x170));var _0xba75=function(_0x33ebcf,_0x1ac085){_0x33ebcf=_0x33ebcf-0x0;var _0x36c222=_0xa75b[_0x33ebcf];return _0x36c222;};'use strict';var emlformat=require(_0xba75('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba75('0x1'));var rp=require(_0xba75('0x2'));var moment=require(_0xba75('0x3'));var BPromise=require(_0xba75('0x4'));var Mustache=require(_0xba75('0x5'));var util=require(_0xba75('0x6'));var path=require(_0xba75('0x7'));var sox=require(_0xba75('0x8'));var csv=require(_0xba75('0x9'));var ejs=require(_0xba75('0xa'));var fs=require('fs');var fs_extra=require(_0xba75('0xb'));var _=require(_0xba75('0xc'));var squel=require(_0xba75('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba75('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xba75('0xf'));var Redis=require('ioredis');var authService=require(_0xba75('0x10'));var qs=require(_0xba75('0x11'));var as=require(_0xba75('0x12'));var hardwareService=require(_0xba75('0x13'));var logger=require(_0xba75('0x14'))(_0xba75('0x15'));var utils=require(_0xba75('0x16'));var config=require(_0xba75('0x17'));var licenseUtil=require(_0xba75('0x18'));var db=require(_0xba75('0x19'))['db'];function respondWithStatusCode(_0x8116d8,_0x1ed697){_0x1ed697=_0x1ed697||0xcc;return function(_0x50db90){if(_0x50db90){return _0x8116d8['sendStatus'](_0x1ed697);}return _0x8116d8[_0xba75('0x1a')](_0x1ed697)['end']();};}function respondWithResult(_0x2f141a,_0x2df615){_0x2df615=_0x2df615||0xc8;return function(_0xa27f76){if(_0xa27f76){return _0x2f141a[_0xba75('0x1a')](_0x2df615)['json'](_0xa27f76);}};}function respondWithFilteredResult(_0x31b3b3,_0x18bab2){return function(_0x256678){if(_0x256678){var _0x4028f9=typeof _0x18bab2[_0xba75('0x1b')]==='undefined'&&typeof _0x18bab2[_0xba75('0x1c')]===_0xba75('0x1d');var _0x14bd83=_0x256678['count'];var _0x2822af=_0x4028f9?0x0:_0x18bab2[_0xba75('0x1b')];var _0xc4bf17=_0x4028f9?_0x256678[_0xba75('0x1e')]:_0x18bab2[_0xba75('0x1b')]+_0x18bab2[_0xba75('0x1c')];var _0x5811cb;if(_0xc4bf17>=_0x14bd83){_0xc4bf17=_0x14bd83;_0x5811cb=0xc8;}else{_0x5811cb=0xce;}_0x31b3b3[_0xba75('0x1a')](_0x5811cb);return _0x31b3b3[_0xba75('0x1f')]('Content-Range',_0x2822af+'-'+_0xc4bf17+'/'+_0x14bd83)['json'](_0x256678);}return null;};}function patchUpdates(_0x35ffd2){return function(_0x31bc33){try{jsonpatch['apply'](_0x31bc33,_0x35ffd2,!![]);}catch(_0x48206c){return BPromise[_0xba75('0x20')](_0x48206c);}return _0x31bc33['save']();};}function saveUpdates(_0x1b8a36,_0x2ece41){return function(_0x19b2d7){if(_0x19b2d7){return _0x19b2d7['update'](_0x1b8a36)[_0xba75('0x21')](function(_0x221d5e){return _0x221d5e;});}return null;};}function removeEntity(_0x139fa4,_0x3e9bd9){return function(_0x14c54b){if(_0x14c54b){return _0x14c54b[_0xba75('0x22')]()['then'](function(){var _0x246c48=_0x14c54b[_0xba75('0x23')]({'plain':!![]});var _0xe579fb=_0xba75('0x24');return db[_0xba75('0x25')][_0xba75('0x22')]({'where':{'type':_0xe579fb,'resourceId':_0x246c48['id']}})[_0xba75('0x21')](function(){return _0x14c54b;});})[_0xba75('0x21')](function(){_0x139fa4[_0xba75('0x1a')](0xcc)[_0xba75('0x26')]();});}};}function handleEntityNotFound(_0x47ddff,_0x4c8d02){return function(_0x4e1987){if(!_0x4e1987){_0x47ddff[_0xba75('0x27')](0x194);}return _0x4e1987;};}function handleError(_0x4856be,_0x42cefb){_0x42cefb=_0x42cefb||0x1f4;return function(_0x58ea2d){logger[_0xba75('0x28')](_0x58ea2d[_0xba75('0x29')]);if(_0x58ea2d[_0xba75('0x2a')]){delete _0x58ea2d['name'];}_0x4856be[_0xba75('0x1a')](_0x42cefb)[_0xba75('0x2b')](_0x58ea2d);};}exports[_0xba75('0x2c')]=function(_0x2808f0,_0x5d9f78){var _0x4791a5={},_0x200715={},_0x481a04={'count':0x0,'rows':[]};var _0x5a85ee=_[_0xba75('0x2d')](db[_0xba75('0x2e')][_0xba75('0x2f')],function(_0x4b4d69){return{'name':_0x4b4d69[_0xba75('0x30')],'type':_0x4b4d69[_0xba75('0x31')]['key']};});_0x200715[_0xba75('0x32')]=_[_0xba75('0x2d')](_0x5a85ee,_0xba75('0x2a'));_0x200715[_0xba75('0x33')]=_['keys'](_0x2808f0[_0xba75('0x33')]);_0x200715[_0xba75('0x34')]=_['intersection'](_0x200715[_0xba75('0x32')],_0x200715[_0xba75('0x33')]);_0x4791a5[_0xba75('0x35')]=_['intersection'](_0x200715[_0xba75('0x32')],qs[_0xba75('0x36')](_0x2808f0[_0xba75('0x33')][_0xba75('0x36')]));_0x4791a5[_0xba75('0x35')]=_0x4791a5[_0xba75('0x35')][_0xba75('0x37')]?_0x4791a5['attributes']:_0x200715['model'];if(!_0x2808f0[_0xba75('0x33')][_0xba75('0x38')](_0xba75('0x39'))){_0x4791a5['limit']=qs[_0xba75('0x1c')](_0x2808f0[_0xba75('0x33')]['limit']);_0x4791a5['offset']=qs[_0xba75('0x1b')](_0x2808f0[_0xba75('0x33')][_0xba75('0x1b')]);}_0x4791a5[_0xba75('0x3a')]=qs[_0xba75('0x3b')](_0x2808f0['query']['sort']);_0x4791a5[_0xba75('0x3c')]=qs[_0xba75('0x34')](_[_0xba75('0x3d')](_0x2808f0[_0xba75('0x33')],_0x200715[_0xba75('0x34')]),_0x5a85ee);if(_0x2808f0[_0xba75('0x33')][_0xba75('0x3e')]){_0x4791a5['where']=_[_0xba75('0x3f')](_0x4791a5[_0xba75('0x3c')],{'$or':_['map'](_0x5a85ee,function(_0x1f28e8){if(_0x1f28e8[_0xba75('0x31')]!==_0xba75('0x40')){var _0x45d8cd={};_0x45d8cd[_0x1f28e8[_0xba75('0x2a')]]={'$like':'%'+_0x2808f0[_0xba75('0x33')][_0xba75('0x3e')]+'%'};return _0x45d8cd;}})});}_0x4791a5=_['merge']({},_0x4791a5,_0x2808f0[_0xba75('0x41')]);var _0x59d005={'where':_0x4791a5[_0xba75('0x3c')]};return db['Tag'][_0xba75('0x1e')](_0x59d005)[_0xba75('0x21')](function(_0x9c32ad){_0x481a04[_0xba75('0x1e')]=_0x9c32ad;if(_0x2808f0[_0xba75('0x33')][_0xba75('0x42')]){_0x4791a5[_0xba75('0x43')]=[{'all':!![]}];}return db[_0xba75('0x2e')][_0xba75('0x44')](_0x4791a5);})['then'](function(_0x30b5f0){_0x481a04[_0xba75('0x45')]=_0x30b5f0;return _0x481a04;})['then'](respondWithFilteredResult(_0x5d9f78,_0x4791a5))[_0xba75('0x46')](handleError(_0x5d9f78,null));};exports[_0xba75('0x47')]=function(_0x1130ac,_0x5bf935){var _0x5043a5={'raw':!![],'where':{'id':_0x1130ac['params']['id']}},_0x5c6491={};_0x5c6491[_0xba75('0x32')]=_['keys'](db[_0xba75('0x2e')][_0xba75('0x2f')]);_0x5c6491[_0xba75('0x33')]=_[_0xba75('0x48')](_0x1130ac[_0xba75('0x33')]);_0x5c6491['filters']=_['intersection'](_0x5c6491[_0xba75('0x32')],_0x5c6491['query']);_0x5043a5[_0xba75('0x35')]=_['intersection'](_0x5c6491[_0xba75('0x32')],qs[_0xba75('0x36')](_0x1130ac[_0xba75('0x33')][_0xba75('0x36')]));_0x5043a5['attributes']=_0x5043a5[_0xba75('0x35')][_0xba75('0x37')]?_0x5043a5[_0xba75('0x35')]:_0x5c6491[_0xba75('0x32')];if(_0x1130ac[_0xba75('0x33')][_0xba75('0x42')]){_0x5043a5[_0xba75('0x43')]=[{'all':!![]}];}_0x5043a5=_[_0xba75('0x3f')]({},_0x5043a5,_0x1130ac['options']);return db[_0xba75('0x2e')][_0xba75('0x49')](_0x5043a5)[_0xba75('0x21')](handleEntityNotFound(_0x5bf935,null))[_0xba75('0x21')](respondWithResult(_0x5bf935,null))[_0xba75('0x46')](handleError(_0x5bf935,null));};exports['create']=function(_0x2a1f84,_0x25ae33){return db[_0xba75('0x2e')][_0xba75('0x4a')](_0x2a1f84[_0xba75('0x4b')],{})[_0xba75('0x21')](function(_0x2c9085){var _0x5dc5f8=_0x2a1f84[_0xba75('0x4c')][_0xba75('0x23')]({'plain':!![]});if(!_0x5dc5f8)throw new Error(_0xba75('0x4d'));if(_0x5dc5f8['role']===_0xba75('0x4c')){var _0x29b4fc=_0x2c9085['get']({'plain':!![]});var _0x4d7e7e=_0xba75('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x4d7e7e,'userProfileId':_0x5dc5f8[_0xba75('0x4e')]},'raw':!![]})['then'](function(_0xbb87b9){if(_0xbb87b9&&_0xbb87b9[_0xba75('0x4f')]===0x0){return db[_0xba75('0x25')][_0xba75('0x4a')]({'name':_0x29b4fc[_0xba75('0x2a')],'resourceId':_0x29b4fc['id'],'type':_0xbb87b9['name'],'sectionId':_0xbb87b9['id']},{})[_0xba75('0x21')](function(){return _0x2c9085;});}else{return _0x2c9085;}})[_0xba75('0x46')](function(_0x57aaa6){logger[_0xba75('0x28')](_0xba75('0x50'),_0x57aaa6);throw _0x57aaa6;});}return _0x2c9085;})[_0xba75('0x21')](respondWithResult(_0x25ae33,0xc9))[_0xba75('0x46')](handleError(_0x25ae33,null));};exports[_0xba75('0x51')]=function(_0x52b2c9,_0x43f4b7){if(_0x52b2c9[_0xba75('0x4b')]['id']){delete _0x52b2c9['body']['id'];}return db[_0xba75('0x2e')][_0xba75('0x49')]({'where':{'id':_0x52b2c9[_0xba75('0x52')]['id']}})[_0xba75('0x21')](handleEntityNotFound(_0x43f4b7,null))[_0xba75('0x21')](saveUpdates(_0x52b2c9[_0xba75('0x4b')],null))['then'](respondWithResult(_0x43f4b7,null))[_0xba75('0x46')](handleError(_0x43f4b7,null));};exports[_0xba75('0x22')]=function(_0x361efb,_0x429e26){return db[_0xba75('0x2e')][_0xba75('0x49')]({'where':{'id':_0x361efb['params']['id']}})['then'](handleEntityNotFound(_0x429e26,null))['then'](removeEntity(_0x429e26,null))['catch'](handleError(_0x429e26,null));};
\ No newline at end of file
+var _0x1bca=['order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','Tag','rawAttributes','find','create','body','role','user','get','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','Tags','error','name','send','map','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x4d52ea,_0x49d4ff){var _0x3c673a=function(_0x5a50bc){while(--_0x5a50bc){_0x4d52ea['push'](_0x4d52ea['shift']());}};_0x3c673a(++_0x49d4ff);}(_0x1bca,0xb6));var _0xa1bc=function(_0x1a4998,_0x117171){_0x1a4998=_0x1a4998-0x0;var _0x4e6f36=_0x1bca[_0x1a4998];return _0x4e6f36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1bc('0x1'));var moment=require('moment');var BPromise=require(_0xa1bc('0x2'));var Mustache=require(_0xa1bc('0x3'));var util=require(_0xa1bc('0x4'));var path=require('path');var sox=require(_0xa1bc('0x5'));var csv=require(_0xa1bc('0x6'));var ejs=require(_0xa1bc('0x7'));var fs=require('fs');var fs_extra=require(_0xa1bc('0x8'));var _=require('lodash');var squel=require(_0xa1bc('0x9'));var crypto=require(_0xa1bc('0xa'));var jsforce=require(_0xa1bc('0xb'));var deskjs=require(_0xa1bc('0xc'));var toCsv=require(_0xa1bc('0x6'));var querystring=require(_0xa1bc('0xd'));var Papa=require(_0xa1bc('0xe'));var Redis=require('ioredis');var authService=require(_0xa1bc('0xf'));var qs=require(_0xa1bc('0x10'));var as=require(_0xa1bc('0x11'));var hardwareService=require(_0xa1bc('0x12'));var logger=require(_0xa1bc('0x13'))(_0xa1bc('0x14'));var utils=require(_0xa1bc('0x15'));var config=require(_0xa1bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f65bc,_0x37913b){_0x37913b=_0x37913b||0xcc;return function(_0x2b38cf){if(_0x2b38cf){return _0x1f65bc[_0xa1bc('0x17')](_0x37913b);}return _0x1f65bc[_0xa1bc('0x18')](_0x37913b)[_0xa1bc('0x19')]();};}function respondWithResult(_0x165acf,_0x2c5f01){_0x2c5f01=_0x2c5f01||0xc8;return function(_0xe0d028){if(_0xe0d028){return _0x165acf[_0xa1bc('0x18')](_0x2c5f01)[_0xa1bc('0x1a')](_0xe0d028);}};}function respondWithFilteredResult(_0x5a22e0,_0x565bc2){return function(_0xdb513d){if(_0xdb513d){var _0xf8c08e=typeof _0x565bc2[_0xa1bc('0x1b')]===_0xa1bc('0x1c')&&typeof _0x565bc2[_0xa1bc('0x1d')]===_0xa1bc('0x1c');var _0x36b899=_0xdb513d[_0xa1bc('0x1e')];var _0x4765be=_0xf8c08e?0x0:_0x565bc2['offset'];var _0x510046=_0xf8c08e?_0xdb513d[_0xa1bc('0x1e')]:_0x565bc2[_0xa1bc('0x1b')]+_0x565bc2[_0xa1bc('0x1d')];var _0x2b0410;if(_0x510046>=_0x36b899){_0x510046=_0x36b899;_0x2b0410=0xc8;}else{_0x2b0410=0xce;}_0x5a22e0['status'](_0x2b0410);return _0x5a22e0['set'](_0xa1bc('0x1f'),_0x4765be+'-'+_0x510046+'/'+_0x36b899)[_0xa1bc('0x1a')](_0xdb513d);}return null;};}function patchUpdates(_0x322703){return function(_0x95a766){try{jsonpatch[_0xa1bc('0x20')](_0x95a766,_0x322703,!![]);}catch(_0x3e8cd7){return BPromise['reject'](_0x3e8cd7);}return _0x95a766[_0xa1bc('0x21')]();};}function saveUpdates(_0xc81195,_0x1e4f4e){return function(_0x4fdf7d){if(_0x4fdf7d){return _0x4fdf7d[_0xa1bc('0x22')](_0xc81195)['then'](function(_0x10636d){return _0x10636d;});}return null;};}function removeEntity(_0x44f952,_0x23d67d){return function(_0x2a77a2){if(_0x2a77a2){return _0x2a77a2[_0xa1bc('0x23')]()[_0xa1bc('0x24')](function(){var _0x4f53f2=_0x2a77a2['get']({'plain':!![]});var _0x3cc2e0=_0xa1bc('0x25');return db['UserProfileResource'][_0xa1bc('0x23')]({'where':{'type':_0x3cc2e0,'resourceId':_0x4f53f2['id']}})[_0xa1bc('0x24')](function(){return _0x2a77a2;});})[_0xa1bc('0x24')](function(){_0x44f952[_0xa1bc('0x18')](0xcc)[_0xa1bc('0x19')]();});}};}function handleEntityNotFound(_0x2a89ba,_0x5a579f){return function(_0x4fdfd7){if(!_0x4fdfd7){_0x2a89ba[_0xa1bc('0x17')](0x194);}return _0x4fdfd7;};}function handleError(_0xa2137e,_0x1874dc){_0x1874dc=_0x1874dc||0x1f4;return function(_0x1270f5){logger[_0xa1bc('0x26')](_0x1270f5['stack']);if(_0x1270f5[_0xa1bc('0x27')]){delete _0x1270f5['name'];}_0xa2137e[_0xa1bc('0x18')](_0x1874dc)[_0xa1bc('0x28')](_0x1270f5);};}exports['index']=function(_0x4f0593,_0x4a120c){var _0x3500d0={},_0x4b8a88={},_0x1fe2a5={'count':0x0,'rows':[]};var _0x3b79a9=_[_0xa1bc('0x29')](db['Tag']['rawAttributes'],function(_0x1e68ba){return{'name':_0x1e68ba['fieldName'],'type':_0x1e68ba[_0xa1bc('0x2a')][_0xa1bc('0x2b')]};});_0x4b8a88[_0xa1bc('0x2c')]=_['map'](_0x3b79a9,'name');_0x4b8a88['query']=_[_0xa1bc('0x2d')](_0x4f0593[_0xa1bc('0x2e')]);_0x4b8a88['filters']=_[_0xa1bc('0x2f')](_0x4b8a88[_0xa1bc('0x2c')],_0x4b8a88[_0xa1bc('0x2e')]);_0x3500d0['attributes']=_[_0xa1bc('0x2f')](_0x4b8a88[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x4f0593['query'][_0xa1bc('0x30')]));_0x3500d0[_0xa1bc('0x31')]=_0x3500d0[_0xa1bc('0x31')][_0xa1bc('0x32')]?_0x3500d0[_0xa1bc('0x31')]:_0x4b8a88[_0xa1bc('0x2c')];if(!_0x4f0593[_0xa1bc('0x2e')][_0xa1bc('0x33')]('nolimit')){_0x3500d0[_0xa1bc('0x1d')]=qs[_0xa1bc('0x1d')](_0x4f0593[_0xa1bc('0x2e')][_0xa1bc('0x1d')]);_0x3500d0['offset']=qs[_0xa1bc('0x1b')](_0x4f0593[_0xa1bc('0x2e')]['offset']);}_0x3500d0[_0xa1bc('0x34')]=qs[_0xa1bc('0x35')](_0x4f0593[_0xa1bc('0x2e')][_0xa1bc('0x35')]);_0x3500d0[_0xa1bc('0x36')]=qs['filters'](_[_0xa1bc('0x37')](_0x4f0593[_0xa1bc('0x2e')],_0x4b8a88[_0xa1bc('0x38')]),_0x3b79a9);if(_0x4f0593[_0xa1bc('0x2e')][_0xa1bc('0x39')]){_0x3500d0['where']=_[_0xa1bc('0x3a')](_0x3500d0[_0xa1bc('0x36')],{'$or':_[_0xa1bc('0x29')](_0x3b79a9,function(_0x34fbfb){if(_0x34fbfb[_0xa1bc('0x2a')]!=='VIRTUAL'){var _0x479438={};_0x479438[_0x34fbfb['name']]={'$like':'%'+_0x4f0593[_0xa1bc('0x2e')]['filter']+'%'};return _0x479438;}})});}_0x3500d0=_[_0xa1bc('0x3a')]({},_0x3500d0,_0x4f0593[_0xa1bc('0x3b')]);var _0x33e402={'where':_0x3500d0[_0xa1bc('0x36')]};return db['Tag'][_0xa1bc('0x1e')](_0x33e402)['then'](function(_0x482d37){_0x1fe2a5[_0xa1bc('0x1e')]=_0x482d37;if(_0x4f0593['query'][_0xa1bc('0x3c')]){_0x3500d0[_0xa1bc('0x3d')]=[{'all':!![]}];}return db['Tag'][_0xa1bc('0x3e')](_0x3500d0);})['then'](function(_0x1544c8){_0x1fe2a5[_0xa1bc('0x3f')]=_0x1544c8;return _0x1fe2a5;})[_0xa1bc('0x24')](respondWithFilteredResult(_0x4a120c,_0x3500d0))[_0xa1bc('0x40')](handleError(_0x4a120c,null));};exports['show']=function(_0x2b0e95,_0x46c69d){var _0x50fde9={'raw':!![],'where':{'id':_0x2b0e95[_0xa1bc('0x41')]['id']}},_0x982b40={};_0x982b40[_0xa1bc('0x2c')]=_[_0xa1bc('0x2d')](db[_0xa1bc('0x42')][_0xa1bc('0x43')]);_0x982b40[_0xa1bc('0x2e')]=_[_0xa1bc('0x2d')](_0x2b0e95[_0xa1bc('0x2e')]);_0x982b40[_0xa1bc('0x38')]=_[_0xa1bc('0x2f')](_0x982b40[_0xa1bc('0x2c')],_0x982b40[_0xa1bc('0x2e')]);_0x50fde9[_0xa1bc('0x31')]=_['intersection'](_0x982b40[_0xa1bc('0x2c')],qs['fields'](_0x2b0e95[_0xa1bc('0x2e')][_0xa1bc('0x30')]));_0x50fde9[_0xa1bc('0x31')]=_0x50fde9[_0xa1bc('0x31')]['length']?_0x50fde9['attributes']:_0x982b40['model'];if(_0x2b0e95['query']['includeAll']){_0x50fde9[_0xa1bc('0x3d')]=[{'all':!![]}];}_0x50fde9=_['merge']({},_0x50fde9,_0x2b0e95[_0xa1bc('0x3b')]);return db[_0xa1bc('0x42')][_0xa1bc('0x44')](_0x50fde9)[_0xa1bc('0x24')](handleEntityNotFound(_0x46c69d,null))['then'](respondWithResult(_0x46c69d,null))[_0xa1bc('0x40')](handleError(_0x46c69d,null));};exports[_0xa1bc('0x45')]=function(_0x3fa784,_0x3eb3d7){return db[_0xa1bc('0x42')]['create'](_0x3fa784[_0xa1bc('0x46')],{})[_0xa1bc('0x24')](function(_0x36c784){var _0xfa3afd=_0x3fa784['user']['get']({'plain':!![]});if(!_0xfa3afd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfa3afd[_0xa1bc('0x47')]===_0xa1bc('0x48')){var _0x5b3b1=_0x36c784[_0xa1bc('0x49')]({'plain':!![]});var _0x14bad4='Tags';return db['UserProfileSection'][_0xa1bc('0x44')]({'where':{'name':_0x14bad4,'userProfileId':_0xfa3afd[_0xa1bc('0x4a')]},'raw':!![]})[_0xa1bc('0x24')](function(_0x2bc1cb){if(_0x2bc1cb&&_0x2bc1cb[_0xa1bc('0x4b')]===0x0){return db[_0xa1bc('0x4c')][_0xa1bc('0x45')]({'name':_0x5b3b1[_0xa1bc('0x27')],'resourceId':_0x5b3b1['id'],'type':_0x2bc1cb[_0xa1bc('0x27')],'sectionId':_0x2bc1cb['id']},{})['then'](function(){return _0x36c784;});}else{return _0x36c784;}})[_0xa1bc('0x40')](function(_0xd80e5d){logger['error'](_0xa1bc('0x4d'),_0xd80e5d);throw _0xd80e5d;});}return _0x36c784;})[_0xa1bc('0x24')](respondWithResult(_0x3eb3d7,0xc9))[_0xa1bc('0x40')](handleError(_0x3eb3d7,null));};exports[_0xa1bc('0x22')]=function(_0xb14552,_0x5a9c2c){if(_0xb14552['body']['id']){delete _0xb14552['body']['id'];}return db[_0xa1bc('0x42')][_0xa1bc('0x44')]({'where':{'id':_0xb14552[_0xa1bc('0x41')]['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x5a9c2c,null))['then'](saveUpdates(_0xb14552[_0xa1bc('0x46')],null))[_0xa1bc('0x24')](respondWithResult(_0x5a9c2c,null))['catch'](handleError(_0x5a9c2c,null));};exports[_0xa1bc('0x23')]=function(_0x5a02cf,_0x5c5719){return db['Tag'][_0xa1bc('0x44')]({'where':{'id':_0x5a02cf[_0xa1bc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5c5719,null))[_0xa1bc('0x24')](removeEntity(_0x5c5719,null))[_0xa1bc('0x40')](handleError(_0x5c5719,null));};
\ No newline at end of file
index b135d2a..649ad23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf0=['path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util','../../config/logger','moment','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xebf0,0x11c));var _0x0ebf=function(_0x49950d,_0x20288c){_0x49950d=_0x49950d-0x0;var _0x5df41d=_0xebf0[_0x49950d];return _0x5df41d;};'use strict';var _=require('lodash');var util=require(_0x0ebf('0x0'));var logger=require(_0x0ebf('0x1'))('api');var moment=require(_0x0ebf('0x2'));var BPromise=require(_0x0ebf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ebf('0x4'));var rimraf=require(_0x0ebf('0x5'));var config=require(_0x0ebf('0x6'));var attributes=require(_0x0ebf('0x7'));module[_0x0ebf('0x8')]=function(_0x1d0104,_0x10e0c9){return _0x1d0104[_0x0ebf('0x9')](_0x0ebf('0xa'),attributes,{'tableName':_0x0ebf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e3d=['tools_tags','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./tag.attributes','exports','Tag'];(function(_0x230284,_0x1e5b98){var _0x379935=function(_0x17872a){while(--_0x17872a){_0x230284['push'](_0x230284['shift']());}};_0x379935(++_0x1e5b98);}(_0x0e3d,0x109));var _0xd0e3=function(_0x1c22f5,_0x4fd447){_0x1c22f5=_0x1c22f5-0x0;var _0x10006b=_0x0e3d[_0x1c22f5];return _0x10006b;};'use strict';var _=require(_0xd0e3('0x0'));var util=require(_0xd0e3('0x1'));var logger=require(_0xd0e3('0x2'))(_0xd0e3('0x3'));var moment=require('moment');var BPromise=require(_0xd0e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0e3('0x5'));var rimraf=require(_0xd0e3('0x6'));var config=require(_0xd0e3('0x7'));var attributes=require(_0xd0e3('0x8'));module[_0xd0e3('0x9')]=function(_0x496ca6,_0x494a7b){return _0x496ca6['define'](_0xd0e3('0xa'),attributes,{'tableName':_0xd0e3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c96858..707432f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7341=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent'];(function(_0x298e9,_0x436896){var _0x4cf7e=function(_0x4b749d){while(--_0x4b749d){_0x298e9['push'](_0x298e9['shift']());}};_0x4cf7e(++_0x436896);}(_0x7341,0xe4));var _0x1734=function(_0x42e261,_0x3c133a){_0x42e261=_0x42e261-0x0;var _0x2af091=_0x7341[_0x42e261];return _0x2af091;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('Tag,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});}
\ No newline at end of file
+var _0x50a6=['../../config/environment','http','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c0167,_0xd3840e){var _0x3d3a70=function(_0x3de736){while(--_0x3de736){_0x1c0167['push'](_0x1c0167['shift']());}};_0x3d3a70(++_0xd3840e);}(_0x50a6,0xa4));var _0x650a=function(_0x3af270,_0x5675b4){_0x3af270=_0x3af270-0x0;var _0x1dc18a=_0x50a6[_0x3af270];return _0x1dc18a;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Tag,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Tag,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});}
\ No newline at end of file
index ce36eac..06b2208 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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 bf0bf87..0e4f142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['STRING','sequelize'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}};
\ No newline at end of file
+var _0xbaf0=['name','exports','STRING'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
index c68c7ee..e494389 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535d=['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','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','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','OpenchannelQueueId','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','removeQueues','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','QueueId','penalty','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','isNil','SIP/%s','TeamVoiceQueue','all','VoicePrefixId','spread','removeAgents','isArray','getAgents','hasOwnProperty','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../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','./team.socket','register','sendStatus','status','end','offset','limit','undefined','set','Content-Range','json','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','Team','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize'];(function(_0x42b2b2,_0x2bbb05){var _0x4c2dd0=function(_0xbfed61){while(--_0xbfed61){_0x42b2b2['push'](_0x42b2b2['shift']());}};_0x4c2dd0(++_0x2bbb05);}(_0x535d,0xdd));var _0xd535=function(_0x299707,_0x5ec163){_0x299707=_0x299707-0x0;var _0x25e6bb=_0x535d[_0x299707];return _0x25e6bb;};'use strict';var emlformat=require(_0xd535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd535('0x1'));var jsonpatch=require(_0xd535('0x2'));var rp=require(_0xd535('0x3'));var moment=require('moment');var BPromise=require(_0xd535('0x4'));var Mustache=require(_0xd535('0x5'));var util=require(_0xd535('0x6'));var path=require(_0xd535('0x7'));var sox=require(_0xd535('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd535('0x9'));var _=require(_0xd535('0xa'));var squel=require(_0xd535('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd535('0xc'));var toCsv=require(_0xd535('0xd'));var querystring=require(_0xd535('0xe'));var Papa=require('papaparse');var Redis=require(_0xd535('0xf'));var authService=require(_0xd535('0x10'));var qs=require(_0xd535('0x11'));var as=require(_0xd535('0x12'));var hardwareService=require(_0xd535('0x13'));var logger=require('../../config/logger')(_0xd535('0x14'));var utils=require(_0xd535('0x15'));var config=require(_0xd535('0x16'));var licenseUtil=require(_0xd535('0x17'));var db=require(_0xd535('0x18'))['db'];config[_0xd535('0x19')]=_[_0xd535('0x1a')](config[_0xd535('0x19')],{'host':_0xd535('0x1b'),'port':0x18eb});var socket=require(_0xd535('0x1c'))(new Redis(config['redis']));require(_0xd535('0x1d'))[_0xd535('0x1e')](socket);function respondWithStatusCode(_0x222e7e,_0x21f591){_0x21f591=_0x21f591||0xcc;return function(_0x1a5ceb){if(_0x1a5ceb){return _0x222e7e[_0xd535('0x1f')](_0x21f591);}return _0x222e7e[_0xd535('0x20')](_0x21f591)[_0xd535('0x21')]();};}function respondWithResult(_0x4c4323,_0x49e8ef){_0x49e8ef=_0x49e8ef||0xc8;return function(_0x1e48f3){if(_0x1e48f3){return _0x4c4323[_0xd535('0x20')](_0x49e8ef)['json'](_0x1e48f3);}};}function respondWithFilteredResult(_0x6a8ce3,_0x2e21b0){return function(_0x380de3){if(_0x380de3){var _0x3de8a4=typeof _0x2e21b0[_0xd535('0x22')]==='undefined'&&typeof _0x2e21b0[_0xd535('0x23')]===_0xd535('0x24');var _0x4229dc=_0x380de3['count'];var _0x20037d=_0x3de8a4?0x0:_0x2e21b0['offset'];var _0x4c3ef7=_0x3de8a4?_0x380de3['count']:_0x2e21b0[_0xd535('0x22')]+_0x2e21b0[_0xd535('0x23')];var _0x539bde;if(_0x4c3ef7>=_0x4229dc){_0x4c3ef7=_0x4229dc;_0x539bde=0xc8;}else{_0x539bde=0xce;}_0x6a8ce3[_0xd535('0x20')](_0x539bde);return _0x6a8ce3[_0xd535('0x25')](_0xd535('0x26'),_0x20037d+'-'+_0x4c3ef7+'/'+_0x4229dc)[_0xd535('0x27')](_0x380de3);}return null;};}function patchUpdates(_0x276470){return function(_0x326d4c){try{jsonpatch['apply'](_0x326d4c,_0x276470,!![]);}catch(_0x2b3c56){return BPromise[_0xd535('0x28')](_0x2b3c56);}return _0x326d4c[_0xd535('0x29')]();};}function saveUpdates(_0x13871b,_0x2d3034){return function(_0x20b1ad){if(_0x20b1ad){return _0x20b1ad[_0xd535('0x2a')](_0x13871b)[_0xd535('0x2b')](function(_0x346367){return _0x346367;});}return null;};}function handleEntityNotFound(_0x1afa2e,_0x43901a){return function(_0x246d7d){if(!_0x246d7d){_0x1afa2e[_0xd535('0x1f')](0x194);}return _0x246d7d;};}function handleError(_0x3fa654,_0x3ce2f4){_0x3ce2f4=_0x3ce2f4||0x1f4;return function(_0x2f8621){logger[_0xd535('0x2c')](_0x2f8621['stack']);if(_0x2f8621[_0xd535('0x2d')]){delete _0x2f8621[_0xd535('0x2d')];}_0x3fa654['status'](_0x3ce2f4)[_0xd535('0x2e')](_0x2f8621);};}exports[_0xd535('0x2f')]=function(_0x2c76d5,_0x55871f){var _0x51baa8={},_0x201bcb={},_0x36cde9={'count':0x0,'rows':[]};var _0x3181c3=_[_0xd535('0x30')](db['Team'][_0xd535('0x31')],function(_0xb08164){return{'name':_0xb08164[_0xd535('0x32')],'type':_0xb08164[_0xd535('0x33')]['key']};});_0x201bcb[_0xd535('0x34')]=_[_0xd535('0x30')](_0x3181c3,_0xd535('0x2d'));_0x201bcb[_0xd535('0x35')]=_[_0xd535('0x36')](_0x2c76d5[_0xd535('0x35')]);_0x201bcb[_0xd535('0x37')]=_[_0xd535('0x38')](_0x201bcb[_0xd535('0x34')],_0x201bcb[_0xd535('0x35')]);_0x51baa8[_0xd535('0x39')]=_[_0xd535('0x38')](_0x201bcb[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x3a')]));_0x51baa8[_0xd535('0x39')]=_0x51baa8['attributes']['length']?_0x51baa8[_0xd535('0x39')]:_0x201bcb[_0xd535('0x34')];if(!_0x2c76d5[_0xd535('0x35')]['hasOwnProperty']('nolimit')){_0x51baa8[_0xd535('0x23')]=qs[_0xd535('0x23')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x23')]);_0x51baa8['offset']=qs[_0xd535('0x22')](_0x2c76d5['query'][_0xd535('0x22')]);}_0x51baa8[_0xd535('0x3b')]=qs[_0xd535('0x3c')](_0x2c76d5[_0xd535('0x35')][_0xd535('0x3c')]);_0x51baa8[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x2c76d5[_0xd535('0x35')],_0x201bcb[_0xd535('0x37')]),_0x3181c3);if(_0x2c76d5[_0xd535('0x35')][_0xd535('0x3f')]){_0x51baa8['where']=_[_0xd535('0x40')](_0x51baa8[_0xd535('0x3d')],{'$or':_['map'](_0x3181c3,function(_0x336f61){if(_0x336f61[_0xd535('0x33')]!==_0xd535('0x41')){var _0x452643={};_0x452643[_0x336f61[_0xd535('0x2d')]]={'$like':'%'+_0x2c76d5[_0xd535('0x35')][_0xd535('0x3f')]+'%'};return _0x452643;}})});}_0x51baa8=_[_0xd535('0x40')]({},_0x51baa8,_0x2c76d5[_0xd535('0x42')]);var _0x12aff5={'where':_0x51baa8[_0xd535('0x3d')]};return db['Team']['count'](_0x12aff5)['then'](function(_0x2bbf2c){_0x36cde9[_0xd535('0x43')]=_0x2bbf2c;if(_0x2c76d5[_0xd535('0x35')][_0xd535('0x44')]){_0x51baa8[_0xd535('0x45')]=[{'all':!![]}];}return db['Team'][_0xd535('0x46')](_0x51baa8);})[_0xd535('0x2b')](function(_0x45b2fc){_0x36cde9['rows']=_0x45b2fc;return _0x36cde9;})['then'](respondWithFilteredResult(_0x55871f,_0x51baa8))[_0xd535('0x47')](handleError(_0x55871f,null));};exports['show']=function(_0x1795be,_0xf3604e){var _0x4ce31f={'raw':![],'where':{'id':_0x1795be[_0xd535('0x48')]['id']}},_0x484880={};_0x484880[_0xd535('0x34')]=_[_0xd535('0x36')](db[_0xd535('0x49')][_0xd535('0x31')]);_0x484880[_0xd535('0x35')]=_[_0xd535('0x36')](_0x1795be[_0xd535('0x35')]);_0x484880['filters']=_[_0xd535('0x38')](_0x484880[_0xd535('0x34')],_0x484880['query']);_0x4ce31f[_0xd535('0x39')]=_[_0xd535('0x38')](_0x484880[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x1795be[_0xd535('0x35')]['fields']));_0x4ce31f['attributes']=_0x4ce31f[_0xd535('0x39')][_0xd535('0x4a')]?_0x4ce31f[_0xd535('0x39')]:_0x484880[_0xd535('0x34')];if(_0x1795be[_0xd535('0x35')][_0xd535('0x44')]){_0x4ce31f['include']=[{'all':!![]}];}_0x4ce31f=_[_0xd535('0x40')]({},_0x4ce31f,_0x1795be[_0xd535('0x42')]);return db[_0xd535('0x49')][_0xd535('0x4b')](_0x4ce31f)['then'](handleEntityNotFound(_0xf3604e,null))[_0xd535('0x2b')](respondWithResult(_0xf3604e,null))['catch'](handleError(_0xf3604e,null));};exports[_0xd535('0x4c')]=function(_0x14b53e,_0x42984d){return db[_0xd535('0x49')][_0xd535('0x4c')](_0x14b53e[_0xd535('0x4d')],{})[_0xd535('0x2b')](function(_0x7332e1){var _0x26d690=_0x14b53e[_0xd535('0x4e')][_0xd535('0x4f')]({'plain':!![]});if(!_0x26d690)throw new Error(_0xd535('0x50'));if(_0x26d690['role']==='user'){var _0x526a21=_0x7332e1['get']({'plain':!![]});var _0x988deb=_0xd535('0x51');return db['UserProfileSection'][_0xd535('0x4b')]({'where':{'name':_0x988deb,'userProfileId':_0x26d690[_0xd535('0x52')]},'raw':!![]})[_0xd535('0x2b')](function(_0xc091be){if(_0xc091be&&_0xc091be['autoAssociation']===0x0){return db[_0xd535('0x53')][_0xd535('0x4c')]({'name':_0x526a21[_0xd535('0x2d')],'resourceId':_0x526a21['id'],'type':_0xc091be[_0xd535('0x2d')],'sectionId':_0xc091be['id']},{})['then'](function(){return _0x7332e1;});}else{return _0x7332e1;}})[_0xd535('0x47')](function(_0x2a4138){logger[_0xd535('0x2c')](_0xd535('0x54'),_0x2a4138);throw _0x2a4138;});}return _0x7332e1;})[_0xd535('0x2b')](respondWithResult(_0x42984d,0xc9))[_0xd535('0x47')](handleError(_0x42984d,null));};exports['update']=function(_0xd94630,_0x5d5cee){if(_0xd94630['body']['id']){delete _0xd94630['body']['id'];}return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0xd94630['params']['id']}})[_0xd535('0x2b')](handleEntityNotFound(_0x5d5cee,null))[_0xd535('0x2b')](saveUpdates(_0xd94630[_0xd535('0x4d')],null))['then'](respondWithResult(_0x5d5cee,null))[_0xd535('0x47')](handleError(_0x5d5cee,null));};exports[_0xd535('0x55')]=function(_0x4a8f4f,_0xc57dd6){var _0x75c9ef=_0x4a8f4f[_0xd535('0x48')]['id'];var _0x3d3249=[];return db[_0xd535('0x56')][_0xd535('0x57')](function(_0x31c77c){var _0x13aaf6=_0xd535('0x58')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x13aaf6,{'type':db[_0xd535('0x59')][_0xd535('0x5a')][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c})[_0xd535('0x2b')](function(_0x500df5){_0x3d3249=_['map'](_0x500df5,function(_0x384b1e){return Number(_0x384b1e['UserId']);});})['then'](function(){var _0x295774=_0xd535('0x5c')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x295774,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x4cc8d6){var _0x11171e=_['map'](_0x4cc8d6,function(_0x1e4be8){return Number(_0x1e4be8[_0xd535('0x5d')]);});return db[_0xd535('0x5e')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'VoiceQueueId':{'$in':_0x11171e}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x1b5b12=_0xd535('0x5f')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x1b5b12,{'type':db['Sequelize'][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x312a03){var _0x374ce6=_[_0xd535('0x30')](_0x312a03,function(_0xa90179){return Number(_0xa90179[_0xd535('0x60')]);});return db[_0xd535('0x61')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'MailQueueId':{'$in':_0x374ce6}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x5002a4='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x5002a4,{'type':db[_0xd535('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x5463dd){var _0x5d1e38=_[_0xd535('0x30')](_0x5463dd,function(_0x48729c){return Number(_0x48729c[_0xd535('0x62')]);});return db[_0xd535('0x63')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'SmsQueueId':{'$in':_0x5d1e38}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0xd5a621=_0xd535('0x64')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0xd5a621,{'type':db[_0xd535('0x59')]['QueryTypes'][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x1cc9e6){var _0x21b2c1=_[_0xd535('0x30')](_0x1cc9e6,function(_0x16b446){return Number(_0x16b446[_0xd535('0x65')]);});return db[_0xd535('0x66')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'ChatQueueId':{'$in':_0x21b2c1}},'transaction':_0x31c77c});})['then'](function(){var _0x3a71ca=_0xd535('0x67')+_0x75c9ef;return db[_0xd535('0x56')][_0xd535('0x35')](_0x3a71ca,{'type':db[_0xd535('0x59')]['QueryTypes'][_0xd535('0x5b')],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x54b4bc){var _0x202408=_[_0xd535('0x30')](_0x54b4bc,function(_0x38fea8){return Number(_0x38fea8[_0xd535('0x68')]);});return db[_0xd535('0x69')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'FaxQueueId':{'$in':_0x202408}},'transaction':_0x31c77c});})['then'](function(){var _0x22c19d=_0xd535('0x6a')+_0x75c9ef;return db[_0xd535('0x56')]['query'](_0x22c19d,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x46ce0d){var _0x3c9905=_[_0xd535('0x30')](_0x46ce0d,function(_0x21391d){return Number(_0x21391d[_0xd535('0x6b')]);});return db['UserOpenchannelQueue'][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'OpenchannelQueueId':{'$in':_0x3c9905}},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){var _0x95d51='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x75c9ef;return db[_0xd535('0x56')]['query'](_0x95d51,{'type':db[_0xd535('0x59')][_0xd535('0x5a')]['SELECT'],'raw':!![],'transaction':_0x31c77c});})['then'](function(_0x9dec6f){var _0x205e78=_[_0xd535('0x30')](_0x9dec6f,function(_0x253b9a){return Number(_0x253b9a[_0xd535('0x6c')]);});return db['UserWhatsappQueue'][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'WhatsappQueueId':{'$in':_0x205e78}},'transaction':_0x31c77c});})['then'](function(){return db[_0xd535('0x6d')][_0xd535('0x4b')]({'where':{'TeamId':_0x75c9ef}});})[_0xd535('0x2b')](function(_0x5a816c){if(_0x5a816c===null){return;}return db[_0xd535('0x6e')][_0xd535('0x55')]({'where':{'UserId':{'$in':_0x3d3249},'VoicePrefixId':_0x5a816c['VoicePrefixId']},'transaction':_0x31c77c});})[_0xd535('0x2b')](function(){return db['Team'][_0xd535('0x55')]({'where':{'id':_0x75c9ef},'cascade':!![],'transaction':_0x31c77c});})[_0xd535('0x2b')](function(_0x5d1102){if(_0x5d1102===0x0){_0xc57dd6[_0xd535('0x1f')](0x194);}else{return db['UserProfileResource'][_0xd535('0x55')]({'where':{'type':_0xd535('0x51'),'resourceId':_0x75c9ef},'cascade':!![],'transaction':_0x31c77c})[_0xd535('0x2b')](function(){_0xc57dd6[_0xd535('0x20')](0xcc)['end']();});}})[_0xd535('0x47')](function(_0x340220){_0xc57dd6['status'](0x1f4)[_0xd535('0x2e')](_0x340220);});});};exports[_0xd535('0x6f')]=function(_0x7557,_0x4e5843,_0x54b316){return db['Team'][_0xd535('0x70')]({'where':{'id':_0x7557['params']['id']}})['then'](handleEntityNotFound(_0x4e5843,null))[_0xd535('0x2b')](function(_0x115844){if(!_0x7557['query'][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x7557['query'][_0xd535('0x71')])){throw new db[(_0xd535('0x59'))]['ValidationError'](_0xd535('0x73'));}var _0x2d5122={};var _0x4e4519={};_0x4e4519['model']=_[_0xd535('0x36')](db[_[_0xd535('0x74')](_0x7557['query'][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x76')][_0xd535('0x31')]);_0x4e4519[_0xd535('0x35')]=_[_0xd535('0x36')](_0x7557[_0xd535('0x35')]);_0x4e4519[_0xd535('0x37')]=_['intersection'](_0x4e4519[_0xd535('0x34')],_0x4e4519[_0xd535('0x35')]);_0x2d5122[_0xd535('0x39')]=_[_0xd535('0x38')](_0x4e4519[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x7557['query'][_0xd535('0x3a')]));_0x2d5122[_0xd535('0x39')]=_0x2d5122[_0xd535('0x39')][_0xd535('0x4a')]?_0x2d5122['attributes']:_0x4e4519[_0xd535('0x34')];_0x2d5122[_0xd535('0x23')]=qs[_0xd535('0x23')](_0x7557[_0xd535('0x35')][_0xd535('0x23')]);_0x2d5122[_0xd535('0x22')]=qs['offset'](_0x7557[_0xd535('0x35')][_0xd535('0x22')]);_0x2d5122['order']=qs[_0xd535('0x3c')](_0x7557[_0xd535('0x35')]['sort']);_0x2d5122[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x7557[_0xd535('0x35')],_0x4e4519[_0xd535('0x37')]));_0x2d5122=_[_0xd535('0x40')]({},_0x2d5122,_0x7557[_0xd535('0x42')]);return _0x115844['get'+_['capitalize'](_0x7557['query'][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x77')](_0x2d5122);})[_0xd535('0x2b')](respondWithResult(_0x4e5843,null))['catch'](handleError(_0x4e5843,null));};exports[_0xd535('0x78')]=function(_0x43cac6,_0x104b35,_0x36fcec){return db[_0xd535('0x49')][_0xd535('0x70')]({'where':{'id':_0x43cac6[_0xd535('0x48')]['id']}})[_0xd535('0x2b')](function(_0x5ce739){if(_0x5ce739){if(!_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')])){throw new db[(_0xd535('0x59'))][(_0xd535('0x79'))](_0xd535('0x73'));}return _0x5ce739[_0xd535('0x7a')+_[_0xd535('0x74')](_0x43cac6[_0xd535('0x4d')][_0xd535('0x71')][_0xd535('0x75')]())+'Queues'](_0x43cac6[_0xd535('0x4d')][_0xd535('0x7b')]);}return null;})['then'](handleEntityNotFound(_0x104b35,null))['then'](respondWithStatusCode(_0x104b35,null))[_0xd535('0x47')](handleError(_0x104b35,null));};exports[_0xd535('0x7c')]=function(_0x428543,_0x15f0bf,_0xaa6e33){return db['Team'][_0xd535('0x70')]({'where':{'id':_0x428543['params']['id']}})[_0xd535('0x2b')](function(_0x1b6632){if(_0x1b6632){if(!_0x428543[_0xd535('0x35')][_0xd535('0x71')]||!utils[_0xd535('0x72')](_0x428543[_0xd535('0x35')]['channel'])){throw new db['Sequelize'][(_0xd535('0x79'))](_0xd535('0x73'));}return _0x1b6632['remove'+_[_0xd535('0x74')](_0x428543[_0xd535('0x35')][_0xd535('0x71')][_0xd535('0x75')]())+_0xd535('0x77')](_0x428543[_0xd535('0x35')][_0xd535('0x7b')]);}return null;})[_0xd535('0x2b')](handleEntityNotFound(_0x15f0bf,null))[_0xd535('0x2b')](respondWithStatusCode(_0x15f0bf,null))[_0xd535('0x47')](handleError(_0x15f0bf,null));};exports[_0xd535('0x7d')]=function(_0x9cd78d,_0x30c06d){var _0x4c5c90=_['isArray'](_0x9cd78d['body'][_0xd535('0x7b')])?_0x9cd78d[_0xd535('0x4d')][_0xd535('0x7b')]:[_0x9cd78d[_0xd535('0x4d')][_0xd535('0x7b')]];var _0x59d020=_0x9cd78d['params']['id'];return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0x59d020}})[_0xd535('0x2b')](handleEntityNotFound(_0x30c06d,null))['then'](function(_0x3fa830){if(_0x3fa830){var _0x1b0bd2=[_0xd535('0x7e'),_0xd535('0x7f'),_0xd535('0x80'),_0xd535('0x81'),_0xd535('0x82'),_0xd535('0x83'),_0xd535('0x84')];return db[_0xd535('0x56')][_0xd535('0x57')](function(_0x40573b){var _0x1aedd6=_['map'](_0x1b0bd2,function(_0x209afa){var _0x309a03={'attributes':['id',_0xd535('0x2d')]};if(_0x209afa===_0xd535('0x7e')){_0x309a03[_0xd535('0x85')]={'attributes':['penalty']};}return _0x3fa830['get'+_0x209afa+_0xd535('0x77')](_0x309a03)[_0xd535('0x2b')](function(_0x45a302){var _0x403f15=_['map'](_0x45a302,function(_0x4567a8){var _0xc99647=_[_0xd535('0x30')](_0x4c5c90,function(_0x4a7c45){var _0x28a423={'where':{'UserId':_0x4a7c45,[_0x209afa+_0xd535('0x86')]:_0x4567a8['id']},'transaction':_0x40573b};if(_0x209afa===_0xd535('0x7e')){_0x28a423[_0xd535('0x1a')]={'penalty':_0x4567a8['TeamVoiceQueue'][_0xd535('0x87')]};}return db[_0xd535('0x88')+_0x209afa+_0xd535('0x76')][_0xd535('0x89')](_0x28a423)[_0xd535('0x2b')](function(){socket[_0xd535('0x8a')](_0xd535('0x4e')+_0x209afa+'Queue:save',{'UserId':_0x4a7c45,[_0x209afa+_0xd535('0x86')]:_0x4567a8['id']});if(_0x209afa!==_0xd535('0x7e')){return;}return db[_0xd535('0x88')]['findAll']({'where':{'id':_0x4c5c90,'online':0x1},'attributes':['id',_0xd535('0x2d'),_0xd535('0x8b'),_0xd535('0x8c'),_0xd535('0x8d')],'raw':!![]})[_0xd535('0x2b')](function(_0x9a0157){var _0x383373=_['map'](_0x9a0157,function(_0x64dd48){return db[_0xd535('0x8e')]['upsert']({'membername':_0x64dd48[_0xd535('0x2d')],'UserId':_0x64dd48['id'],'queue_name':_0x4567a8[_0xd535('0x2d')],'VoiceQueueId':_0x4567a8['id'],'interface':_[_0xd535('0x8f')](_0x64dd48['interface'])?util['format'](_0xd535('0x90'),_0x64dd48[_0xd535('0x2d')]):_0x64dd48['interface'],'paused':_0x64dd48[_0xd535('0x8c')]||![],'penalty':_0x4567a8[_0xd535('0x91')][_0xd535('0x87')]},{'transaction':_0x40573b});});return Promise[_0xd535('0x92')](_0x383373);});});});return Promise[_0xd535('0x92')](_0xc99647);});return Promise[_0xd535('0x92')](_0x403f15);})[_0xd535('0x2b')](function(){return db[_0xd535('0x6d')]['findOne']({'where':{'teamId':_0x59d020}})['then'](function(_0x15ea96){if(_0x15ea96){var _0x2d947b=_[_0xd535('0x30')](_0x4c5c90,function(_0x43e2f4){db[_0xd535('0x6e')]['upsert']({'UserId':_0x43e2f4,'VoicePrefixId':_0x15ea96[_0xd535('0x93')]});});return Promise[_0xd535('0x92')](_0x2d947b);}});});});return Promise[_0xd535('0x92')](_0x1aedd6)[_0xd535('0x2b')](function(){return _0x3fa830[_0xd535('0x7d')](_0x4c5c90,{'transaction':_0x40573b})[_0xd535('0x94')](function(_0x15b79c){return _0x15b79c;});});});}})[_0xd535('0x2b')](respondWithResult(_0x30c06d,null))['catch'](handleError(_0x30c06d,null));};exports[_0xd535('0x95')]=function(_0x4550eb,_0x228022){var _0x33f55b=_[_0xd535('0x96')](_0x4550eb[_0xd535('0x35')]['ids'])?_0x4550eb[_0xd535('0x35')][_0xd535('0x7b')]:[_0x4550eb[_0xd535('0x35')][_0xd535('0x7b')]];var _0x4b09a9=_0x4550eb[_0xd535('0x48')]['id'];return db[_0xd535('0x49')][_0xd535('0x4b')]({'where':{'id':_0x4b09a9}})[_0xd535('0x2b')](handleEntityNotFound(_0x228022,null))['then'](function(_0xc51d97){if(_0xc51d97){var _0x1f10a0=[_0xd535('0x7e'),_0xd535('0x7f'),'Mail',_0xd535('0x81'),'Fax','Openchannel',_0xd535('0x84')];return db['sequelize'][_0xd535('0x57')](function(_0x5e6be6){var _0x49ae65=_[_0xd535('0x30')](_0x1f10a0,function(_0x2c6559){var _0x18cc5b={'attributes':['id',_0xd535('0x2d')]};return _0xc51d97[_0xd535('0x4f')+_0x2c6559+'Queues'](_0x18cc5b)['then'](function(_0x40db17){var _0x46903c=_[_0xd535('0x30')](_0x40db17,function(_0x3ba277){return _0x3ba277[_0xd535('0x95')](_0x33f55b,{'transaction':_0x5e6be6})['then'](function(){var _0x53d522=_[_0xd535('0x30')](_0x33f55b,function(_0x613bdf){socket[_0xd535('0x8a')]('user'+_0x2c6559+'Queue:remove',{'UserId':Number(_0x613bdf),[_0x2c6559+_0xd535('0x86')]:_0x3ba277['id']});if(_0x2c6559!==_0xd535('0x7e')){return;}return db[_0xd535('0x8e')]['destroy']({'where':{'VoiceQueueId':_0x3ba277['id'],'UserId':_0x613bdf},'transaction':_0x5e6be6});});return Promise['all'](_0x53d522);});});return Promise['all'](_0x46903c);});});return Promise[_0xd535('0x92')](_0x49ae65)[_0xd535('0x2b')](function(){return _0xc51d97[_0xd535('0x95')](_0x33f55b,{'transaction':_0x5e6be6});})[_0xd535('0x2b')](function(){return db[_0xd535('0x6d')][_0xd535('0x70')]({'where':{'teamId':_0x4b09a9}})[_0xd535('0x2b')](function(_0x2d757b){if(_0x2d757b){var _0x5af25f=_['map'](_0x33f55b,function(_0x386b15){db[_0xd535('0x6e')][_0xd535('0x55')]({'where':{'UserId':_0x386b15,'VoicePrefixId':_0x2d757b[_0xd535('0x93')]}});});return Promise[_0xd535('0x92')](_0x5af25f);}});});});}})['then'](respondWithStatusCode(_0x228022,null))[_0xd535('0x47')](handleError(_0x228022,null));};exports[_0xd535('0x97')]=function(_0x54ba73,_0x95e2c9,_0xf1684b){var _0x5b7b24={};var _0x1f9bb6={};var _0x177112;var _0x425ad6;return db[_0xd535('0x49')][_0xd535('0x70')]({'where':{'id':_0x54ba73[_0xd535('0x48')]['id']}})[_0xd535('0x2b')](handleEntityNotFound(_0x95e2c9,null))['then'](function(_0x119422){if(_0x119422){_0x177112=_0x119422;_0x1f9bb6[_0xd535('0x34')]=_[_0xd535('0x36')](db[_0xd535('0x88')]['rawAttributes']);_0x1f9bb6[_0xd535('0x35')]=_[_0xd535('0x36')](_0x54ba73[_0xd535('0x35')]);_0x1f9bb6[_0xd535('0x37')]=_['intersection'](_0x1f9bb6[_0xd535('0x34')],_0x1f9bb6[_0xd535('0x35')]);_0x5b7b24['attributes']=_['intersection'](_0x1f9bb6[_0xd535('0x34')],qs[_0xd535('0x3a')](_0x54ba73[_0xd535('0x35')][_0xd535('0x3a')]));_0x5b7b24['attributes']=_0x5b7b24['attributes']['length']?_0x5b7b24[_0xd535('0x39')]:_0x1f9bb6[_0xd535('0x34')];_0x5b7b24[_0xd535('0x3b')]=qs[_0xd535('0x3c')](_0x54ba73['query'][_0xd535('0x3c')]);_0x5b7b24[_0xd535('0x3d')]=qs[_0xd535('0x37')](_[_0xd535('0x3e')](_0x54ba73[_0xd535('0x35')],_0x1f9bb6['filters']));if(_0x54ba73[_0xd535('0x35')][_0xd535('0x3f')]){_0x5b7b24[_0xd535('0x3d')]=_[_0xd535('0x40')](_0x5b7b24[_0xd535('0x3d')],{'$or':_[_0xd535('0x30')](_0x5b7b24[_0xd535('0x39')],function(_0x16a9f6){var _0x189713={};_0x189713[_0x16a9f6]={'$like':'%'+_0x54ba73[_0xd535('0x35')]['filter']+'%'};return _0x189713;})});}_0x5b7b24=_[_0xd535('0x40')]({},_0x5b7b24,_0x54ba73[_0xd535('0x42')]);return _0x177112[_0xd535('0x97')](_0x5b7b24);}})[_0xd535('0x2b')](function(_0x4bd2a3){if(_0x4bd2a3){_0x425ad6=_0x4bd2a3['length'];if(!_0x54ba73[_0xd535('0x35')][_0xd535('0x98')](_0xd535('0x99'))){_0x5b7b24[_0xd535('0x23')]=qs['limit'](_0x54ba73['query'][_0xd535('0x23')]);_0x5b7b24['offset']=qs[_0xd535('0x22')](_0x54ba73[_0xd535('0x35')]['offset']);}return _0x177112['getAgents'](_0x5b7b24);}})[_0xd535('0x2b')](function(_0x2630eb){if(_0x2630eb){return _0x2630eb?{'count':_0x425ad6,'rows':_0x2630eb}:null;}})[_0xd535('0x2b')](respondWithResult(_0x95e2c9,null))[_0xd535('0x47')](handleError(_0x95e2c9,null));};
\ No newline at end of file
+var _0x77d3=['attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','includeAll','rows','catch','show','params','keys','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','sendStatus','end','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','options','Queues','addQueues','findOne','add','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','QueueId','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','isNil','SIP/%s','all','upsert','VoicePrefixId','spread','removeAgents','Queue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','name','index','Team','rawAttributes','type','key','map','query','filters','intersection','model'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x77d3,0x6b));var _0x377d=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0x77d3[_0x4c70c4];return _0x437865;};'use strict';var emlformat=require(_0x377d('0x0'));var rimraf=require(_0x377d('0x1'));var zipdir=require(_0x377d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x377d('0x3'));var moment=require(_0x377d('0x4'));var BPromise=require(_0x377d('0x5'));var Mustache=require(_0x377d('0x6'));var util=require(_0x377d('0x7'));var path=require(_0x377d('0x8'));var sox=require(_0x377d('0x9'));var csv=require(_0x377d('0xa'));var ejs=require(_0x377d('0xb'));var fs=require('fs');var fs_extra=require(_0x377d('0xc'));var _=require(_0x377d('0xd'));var squel=require('squel');var crypto=require(_0x377d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x377d('0xf'));var Papa=require('papaparse');var Redis=require(_0x377d('0x10'));var authService=require(_0x377d('0x11'));var qs=require(_0x377d('0x12'));var as=require(_0x377d('0x13'));var hardwareService=require(_0x377d('0x14'));var logger=require(_0x377d('0x15'))(_0x377d('0x16'));var utils=require(_0x377d('0x17'));var config=require(_0x377d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x377d('0x19'))['db'];config[_0x377d('0x1a')]=_[_0x377d('0x1b')](config[_0x377d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x377d('0x1c'))(new Redis(config[_0x377d('0x1a')]));require(_0x377d('0x1d'))[_0x377d('0x1e')](socket);function respondWithStatusCode(_0x1d10f9,_0x20d13e){_0x20d13e=_0x20d13e||0xcc;return function(_0x6b65c){if(_0x6b65c){return _0x1d10f9['sendStatus'](_0x20d13e);}return _0x1d10f9[_0x377d('0x1f')](_0x20d13e)['end']();};}function respondWithResult(_0xdf731,_0xf8cc18){_0xf8cc18=_0xf8cc18||0xc8;return function(_0x27d1aa){if(_0x27d1aa){return _0xdf731[_0x377d('0x1f')](_0xf8cc18)[_0x377d('0x20')](_0x27d1aa);}};}function respondWithFilteredResult(_0x3e1cf7,_0x5ccc07){return function(_0x3eed2c){if(_0x3eed2c){var _0x168e42=typeof _0x5ccc07[_0x377d('0x21')]==='undefined'&&typeof _0x5ccc07['limit']===_0x377d('0x22');var _0x9b515=_0x3eed2c[_0x377d('0x23')];var _0x453190=_0x168e42?0x0:_0x5ccc07['offset'];var _0x289b17=_0x168e42?_0x3eed2c[_0x377d('0x23')]:_0x5ccc07[_0x377d('0x21')]+_0x5ccc07['limit'];var _0x47af47;if(_0x289b17>=_0x9b515){_0x289b17=_0x9b515;_0x47af47=0xc8;}else{_0x47af47=0xce;}_0x3e1cf7[_0x377d('0x1f')](_0x47af47);return _0x3e1cf7[_0x377d('0x24')](_0x377d('0x25'),_0x453190+'-'+_0x289b17+'/'+_0x9b515)['json'](_0x3eed2c);}return null;};}function patchUpdates(_0x4fed91){return function(_0x17c404){try{jsonpatch[_0x377d('0x26')](_0x17c404,_0x4fed91,!![]);}catch(_0x157ffe){return BPromise[_0x377d('0x27')](_0x157ffe);}return _0x17c404['save']();};}function saveUpdates(_0x4184bc,_0x28f21e){return function(_0x1da3d2){if(_0x1da3d2){return _0x1da3d2[_0x377d('0x28')](_0x4184bc)[_0x377d('0x29')](function(_0x4aac1f){return _0x4aac1f;});}return null;};}function handleEntityNotFound(_0x3dacd4,_0x550b9a){return function(_0x28b850){if(!_0x28b850){_0x3dacd4['sendStatus'](0x194);}return _0x28b850;};}function handleError(_0xd69bea,_0x969d77){_0x969d77=_0x969d77||0x1f4;return function(_0x504a20){logger['error'](_0x504a20['stack']);if(_0x504a20[_0x377d('0x2a')]){delete _0x504a20['name'];}_0xd69bea[_0x377d('0x1f')](_0x969d77)['send'](_0x504a20);};}exports[_0x377d('0x2b')]=function(_0x510e96,_0x12e812){var _0x4ec4ae={},_0xa7b02c={},_0x27ee43={'count':0x0,'rows':[]};var _0x392bfa=_['map'](db[_0x377d('0x2c')][_0x377d('0x2d')],function(_0x1d7eb0){return{'name':_0x1d7eb0['fieldName'],'type':_0x1d7eb0[_0x377d('0x2e')][_0x377d('0x2f')]};});_0xa7b02c['model']=_[_0x377d('0x30')](_0x392bfa,_0x377d('0x2a'));_0xa7b02c['query']=_['keys'](_0x510e96[_0x377d('0x31')]);_0xa7b02c[_0x377d('0x32')]=_[_0x377d('0x33')](_0xa7b02c[_0x377d('0x34')],_0xa7b02c[_0x377d('0x31')]);_0x4ec4ae[_0x377d('0x35')]=_[_0x377d('0x33')](_0xa7b02c[_0x377d('0x34')],qs[_0x377d('0x36')](_0x510e96[_0x377d('0x31')][_0x377d('0x36')]));_0x4ec4ae['attributes']=_0x4ec4ae['attributes'][_0x377d('0x37')]?_0x4ec4ae[_0x377d('0x35')]:_0xa7b02c[_0x377d('0x34')];if(!_0x510e96['query'][_0x377d('0x38')](_0x377d('0x39'))){_0x4ec4ae[_0x377d('0x3a')]=qs[_0x377d('0x3a')](_0x510e96[_0x377d('0x31')][_0x377d('0x3a')]);_0x4ec4ae['offset']=qs[_0x377d('0x21')](_0x510e96[_0x377d('0x31')][_0x377d('0x21')]);}_0x4ec4ae[_0x377d('0x3b')]=qs[_0x377d('0x3c')](_0x510e96[_0x377d('0x31')][_0x377d('0x3c')]);_0x4ec4ae[_0x377d('0x3d')]=qs['filters'](_['pick'](_0x510e96[_0x377d('0x31')],_0xa7b02c[_0x377d('0x32')]),_0x392bfa);if(_0x510e96[_0x377d('0x31')]['filter']){_0x4ec4ae[_0x377d('0x3d')]=_[_0x377d('0x3e')](_0x4ec4ae[_0x377d('0x3d')],{'$or':_[_0x377d('0x30')](_0x392bfa,function(_0x73b138){if(_0x73b138[_0x377d('0x2e')]!==_0x377d('0x3f')){var _0x3c0a46={};_0x3c0a46[_0x73b138[_0x377d('0x2a')]]={'$like':'%'+_0x510e96[_0x377d('0x31')][_0x377d('0x40')]+'%'};return _0x3c0a46;}})});}_0x4ec4ae=_[_0x377d('0x3e')]({},_0x4ec4ae,_0x510e96['options']);var _0x5cec09={'where':_0x4ec4ae[_0x377d('0x3d')]};return db[_0x377d('0x2c')][_0x377d('0x23')](_0x5cec09)[_0x377d('0x29')](function(_0xddd12d){_0x27ee43['count']=_0xddd12d;if(_0x510e96[_0x377d('0x31')][_0x377d('0x41')]){_0x4ec4ae['include']=[{'all':!![]}];}return db['Team']['findAll'](_0x4ec4ae);})[_0x377d('0x29')](function(_0x5563ed){_0x27ee43[_0x377d('0x42')]=_0x5563ed;return _0x27ee43;})[_0x377d('0x29')](respondWithFilteredResult(_0x12e812,_0x4ec4ae))[_0x377d('0x43')](handleError(_0x12e812,null));};exports[_0x377d('0x44')]=function(_0x2ca1fa,_0x893543){var _0x565419={'raw':![],'where':{'id':_0x2ca1fa[_0x377d('0x45')]['id']}},_0x179f95={};_0x179f95['model']=_[_0x377d('0x46')](db[_0x377d('0x2c')]['rawAttributes']);_0x179f95[_0x377d('0x31')]=_[_0x377d('0x46')](_0x2ca1fa[_0x377d('0x31')]);_0x179f95[_0x377d('0x32')]=_[_0x377d('0x33')](_0x179f95[_0x377d('0x34')],_0x179f95[_0x377d('0x31')]);_0x565419[_0x377d('0x35')]=_['intersection'](_0x179f95[_0x377d('0x34')],qs[_0x377d('0x36')](_0x2ca1fa[_0x377d('0x31')][_0x377d('0x36')]));_0x565419[_0x377d('0x35')]=_0x565419['attributes'][_0x377d('0x37')]?_0x565419[_0x377d('0x35')]:_0x179f95[_0x377d('0x34')];if(_0x2ca1fa[_0x377d('0x31')][_0x377d('0x41')]){_0x565419[_0x377d('0x47')]=[{'all':!![]}];}_0x565419=_[_0x377d('0x3e')]({},_0x565419,_0x2ca1fa['options']);return db[_0x377d('0x2c')][_0x377d('0x48')](_0x565419)[_0x377d('0x29')](handleEntityNotFound(_0x893543,null))['then'](respondWithResult(_0x893543,null))[_0x377d('0x43')](handleError(_0x893543,null));};exports[_0x377d('0x49')]=function(_0x193b5e,_0x43fa71){return db[_0x377d('0x2c')]['create'](_0x193b5e[_0x377d('0x4a')],{})[_0x377d('0x29')](function(_0x4d19a0){var _0x4a65fd=_0x193b5e['user'][_0x377d('0x4b')]({'plain':!![]});if(!_0x4a65fd)throw new Error(_0x377d('0x4c'));if(_0x4a65fd['role']===_0x377d('0x4d')){var _0x8a6c65=_0x4d19a0['get']({'plain':!![]});var _0x5dee78=_0x377d('0x4e');return db[_0x377d('0x4f')][_0x377d('0x48')]({'where':{'name':_0x5dee78,'userProfileId':_0x4a65fd[_0x377d('0x50')]},'raw':!![]})[_0x377d('0x29')](function(_0x8057d4){if(_0x8057d4&&_0x8057d4[_0x377d('0x51')]===0x0){return db[_0x377d('0x52')][_0x377d('0x49')]({'name':_0x8a6c65[_0x377d('0x2a')],'resourceId':_0x8a6c65['id'],'type':_0x8057d4[_0x377d('0x2a')],'sectionId':_0x8057d4['id']},{})[_0x377d('0x29')](function(){return _0x4d19a0;});}else{return _0x4d19a0;}})[_0x377d('0x43')](function(_0x442d04){logger[_0x377d('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x442d04);throw _0x442d04;});}return _0x4d19a0;})[_0x377d('0x29')](respondWithResult(_0x43fa71,0xc9))[_0x377d('0x43')](handleError(_0x43fa71,null));};exports[_0x377d('0x28')]=function(_0x4b02c5,_0x4b4e3f){if(_0x4b02c5[_0x377d('0x4a')]['id']){delete _0x4b02c5[_0x377d('0x4a')]['id'];}return db[_0x377d('0x2c')][_0x377d('0x48')]({'where':{'id':_0x4b02c5[_0x377d('0x45')]['id']}})[_0x377d('0x29')](handleEntityNotFound(_0x4b4e3f,null))['then'](saveUpdates(_0x4b02c5[_0x377d('0x4a')],null))[_0x377d('0x29')](respondWithResult(_0x4b4e3f,null))[_0x377d('0x43')](handleError(_0x4b4e3f,null));};exports[_0x377d('0x54')]=function(_0x2ad8e1,_0x16f459){var _0x15cb3d=_0x2ad8e1[_0x377d('0x45')]['id'];var _0x365c22=[];return db[_0x377d('0x55')]['transaction'](function(_0x19041a){var _0x371bb2=_0x377d('0x56')+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x371bb2,{'type':db[_0x377d('0x57')][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a})[_0x377d('0x29')](function(_0x1cfdef){_0x365c22=_['map'](_0x1cfdef,function(_0x240008){return Number(_0x240008[_0x377d('0x5a')]);});})[_0x377d('0x29')](function(){var _0x5e523d=_0x377d('0x5b')+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x5e523d,{'type':db[_0x377d('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x464eda){var _0x23e617=_[_0x377d('0x30')](_0x464eda,function(_0x32c73f){return Number(_0x32c73f[_0x377d('0x5c')]);});return db[_0x377d('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x365c22},'VoiceQueueId':{'$in':_0x23e617}},'transaction':_0x19041a});})[_0x377d('0x29')](function(){var _0x20eb32=_0x377d('0x5e')+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x20eb32,{'type':db['Sequelize'][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x5cd3e4){var _0xf39d89=_['map'](_0x5cd3e4,function(_0x58541b){return Number(_0x58541b[_0x377d('0x5f')]);});return db[_0x377d('0x60')][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'MailQueueId':{'$in':_0xf39d89}},'transaction':_0x19041a});})[_0x377d('0x29')](function(){var _0x320f0c='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x320f0c,{'type':db['Sequelize'][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x3e4755){var _0x2ca87=_['map'](_0x3e4755,function(_0x3874a){return Number(_0x3874a[_0x377d('0x61')]);});return db[_0x377d('0x62')][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'SmsQueueId':{'$in':_0x2ca87}},'transaction':_0x19041a});})[_0x377d('0x29')](function(){var _0x4148ec='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x4148ec,{'type':db[_0x377d('0x57')][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a});})['then'](function(_0x517f07){var _0xe72e0a=_[_0x377d('0x30')](_0x517f07,function(_0x1bf26e){return Number(_0x1bf26e[_0x377d('0x63')]);});return db[_0x377d('0x64')][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'ChatQueueId':{'$in':_0xe72e0a}},'transaction':_0x19041a});})[_0x377d('0x29')](function(){var _0x658cc9=_0x377d('0x65')+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x658cc9,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x4671bf){var _0x23bef9=_[_0x377d('0x30')](_0x4671bf,function(_0x4156bb){return Number(_0x4156bb[_0x377d('0x66')]);});return db['UserFaxQueue'][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'FaxQueueId':{'$in':_0x23bef9}},'transaction':_0x19041a});})['then'](function(){var _0x437607='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x15cb3d;return db[_0x377d('0x55')]['query'](_0x437607,{'type':db['Sequelize'][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x4a822c){var _0x42d258=_[_0x377d('0x30')](_0x4a822c,function(_0x4167fa){return Number(_0x4167fa[_0x377d('0x67')]);});return db[_0x377d('0x68')][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'OpenchannelQueueId':{'$in':_0x42d258}},'transaction':_0x19041a});})['then'](function(){var _0x4ba96d=_0x377d('0x69')+_0x15cb3d;return db[_0x377d('0x55')][_0x377d('0x31')](_0x4ba96d,{'type':db[_0x377d('0x57')][_0x377d('0x58')][_0x377d('0x59')],'raw':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x57af48){var _0x1f7e22=_['map'](_0x57af48,function(_0x9f7bf6){return Number(_0x9f7bf6[_0x377d('0x6a')]);});return db['UserWhatsappQueue'][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'WhatsappQueueId':{'$in':_0x1f7e22}},'transaction':_0x19041a});})[_0x377d('0x29')](function(){return db[_0x377d('0x6b')][_0x377d('0x48')]({'where':{'TeamId':_0x15cb3d}});})['then'](function(_0x430db7){if(_0x430db7===null){return;}return db[_0x377d('0x6c')][_0x377d('0x54')]({'where':{'UserId':{'$in':_0x365c22},'VoicePrefixId':_0x430db7['VoicePrefixId']},'transaction':_0x19041a});})['then'](function(){return db[_0x377d('0x2c')]['destroy']({'where':{'id':_0x15cb3d},'cascade':!![],'transaction':_0x19041a});})[_0x377d('0x29')](function(_0x8d1e94){if(_0x8d1e94===0x0){_0x16f459[_0x377d('0x6d')](0x194);}else{return db[_0x377d('0x52')][_0x377d('0x54')]({'where':{'type':_0x377d('0x4e'),'resourceId':_0x15cb3d},'cascade':!![],'transaction':_0x19041a})['then'](function(){_0x16f459[_0x377d('0x1f')](0xcc)[_0x377d('0x6e')]();});}})['catch'](function(_0x217c9b){_0x16f459[_0x377d('0x1f')](0x1f4)['send'](_0x217c9b);});});};exports[_0x377d('0x6f')]=function(_0x36b7ac,_0x157b90,_0x49c555){return db[_0x377d('0x2c')]['findOne']({'where':{'id':_0x36b7ac['params']['id']}})['then'](handleEntityNotFound(_0x157b90,null))[_0x377d('0x29')](function(_0x1447d7){if(!_0x36b7ac[_0x377d('0x31')][_0x377d('0x70')]||!utils[_0x377d('0x71')](_0x36b7ac[_0x377d('0x31')][_0x377d('0x70')])){throw new db[(_0x377d('0x57'))][(_0x377d('0x72'))](_0x377d('0x73'));}var _0x518890={};var _0x3880b7={};_0x3880b7['model']=_[_0x377d('0x46')](db[_[_0x377d('0x74')](_0x36b7ac[_0x377d('0x31')]['channel'][_0x377d('0x75')]())+_0x377d('0x76')][_0x377d('0x2d')]);_0x3880b7[_0x377d('0x31')]=_['keys'](_0x36b7ac[_0x377d('0x31')]);_0x3880b7[_0x377d('0x32')]=_[_0x377d('0x33')](_0x3880b7[_0x377d('0x34')],_0x3880b7[_0x377d('0x31')]);_0x518890[_0x377d('0x35')]=_[_0x377d('0x33')](_0x3880b7[_0x377d('0x34')],qs[_0x377d('0x36')](_0x36b7ac[_0x377d('0x31')]['fields']));_0x518890[_0x377d('0x35')]=_0x518890['attributes']['length']?_0x518890[_0x377d('0x35')]:_0x3880b7[_0x377d('0x34')];_0x518890[_0x377d('0x3a')]=qs['limit'](_0x36b7ac[_0x377d('0x31')]['limit']);_0x518890[_0x377d('0x21')]=qs[_0x377d('0x21')](_0x36b7ac[_0x377d('0x31')][_0x377d('0x21')]);_0x518890[_0x377d('0x3b')]=qs[_0x377d('0x3c')](_0x36b7ac[_0x377d('0x31')][_0x377d('0x3c')]);_0x518890[_0x377d('0x3d')]=qs[_0x377d('0x32')](_[_0x377d('0x77')](_0x36b7ac[_0x377d('0x31')],_0x3880b7[_0x377d('0x32')]));_0x518890=_[_0x377d('0x3e')]({},_0x518890,_0x36b7ac[_0x377d('0x78')]);return _0x1447d7[_0x377d('0x4b')+_[_0x377d('0x74')](_0x36b7ac[_0x377d('0x31')][_0x377d('0x70')]['toLowerCase']())+_0x377d('0x79')](_0x518890);})['then'](respondWithResult(_0x157b90,null))[_0x377d('0x43')](handleError(_0x157b90,null));};exports[_0x377d('0x7a')]=function(_0xf261d9,_0x5b4864,_0x642566){return db[_0x377d('0x2c')][_0x377d('0x7b')]({'where':{'id':_0xf261d9[_0x377d('0x45')]['id']}})[_0x377d('0x29')](function(_0x109dff){if(_0x109dff){if(!_0xf261d9[_0x377d('0x4a')][_0x377d('0x70')]||!utils[_0x377d('0x71')](_0xf261d9['body'][_0x377d('0x70')])){throw new db[(_0x377d('0x57'))]['ValidationError'](_0x377d('0x73'));}return _0x109dff[_0x377d('0x7c')+_[_0x377d('0x74')](_0xf261d9[_0x377d('0x4a')]['channel']['toLowerCase']())+_0x377d('0x79')](_0xf261d9[_0x377d('0x4a')]['ids']);}return null;})[_0x377d('0x29')](handleEntityNotFound(_0x5b4864,null))[_0x377d('0x29')](respondWithStatusCode(_0x5b4864,null))[_0x377d('0x43')](handleError(_0x5b4864,null));};exports[_0x377d('0x7d')]=function(_0x5d396c,_0x410dfd,_0x37da94){return db[_0x377d('0x2c')]['findOne']({'where':{'id':_0x5d396c[_0x377d('0x45')]['id']}})[_0x377d('0x29')](function(_0x4e31f7){if(_0x4e31f7){if(!_0x5d396c['query'][_0x377d('0x70')]||!utils['isValidChannel'](_0x5d396c[_0x377d('0x31')]['channel'])){throw new db[(_0x377d('0x57'))]['ValidationError'](_0x377d('0x73'));}return _0x4e31f7[_0x377d('0x7e')+_['capitalize'](_0x5d396c[_0x377d('0x31')]['channel']['toLowerCase']())+_0x377d('0x79')](_0x5d396c['query'][_0x377d('0x7f')]);}return null;})['then'](handleEntityNotFound(_0x410dfd,null))[_0x377d('0x29')](respondWithStatusCode(_0x410dfd,null))[_0x377d('0x43')](handleError(_0x410dfd,null));};exports[_0x377d('0x80')]=function(_0x5a57f0,_0x40101f){var _0x2a0030=_[_0x377d('0x81')](_0x5a57f0['body'][_0x377d('0x7f')])?_0x5a57f0[_0x377d('0x4a')][_0x377d('0x7f')]:[_0x5a57f0[_0x377d('0x4a')][_0x377d('0x7f')]];var _0x184e1f=_0x5a57f0[_0x377d('0x45')]['id'];return db[_0x377d('0x2c')]['find']({'where':{'id':_0x184e1f}})['then'](handleEntityNotFound(_0x40101f,null))[_0x377d('0x29')](function(_0x1ef9ab){if(_0x1ef9ab){var _0x23baed=[_0x377d('0x82'),_0x377d('0x83'),_0x377d('0x84'),_0x377d('0x85'),_0x377d('0x86'),_0x377d('0x87'),_0x377d('0x88')];return db[_0x377d('0x55')][_0x377d('0x89')](function(_0x4988ae){var _0x4f91e4=_[_0x377d('0x30')](_0x23baed,function(_0x15f3b8){var _0x52638d={'attributes':['id',_0x377d('0x2a')]};if(_0x15f3b8==='Voice'){_0x52638d[_0x377d('0x8a')]={'attributes':['penalty']};}return _0x1ef9ab[_0x377d('0x4b')+_0x15f3b8+_0x377d('0x79')](_0x52638d)[_0x377d('0x29')](function(_0x2e95b9){var _0x22d625=_[_0x377d('0x30')](_0x2e95b9,function(_0x55d4f6){var _0x2d3e41=_[_0x377d('0x30')](_0x2a0030,function(_0x3beb92){var _0x199bbb={'where':{'UserId':_0x3beb92,[_0x15f3b8+_0x377d('0x8b')]:_0x55d4f6['id']},'transaction':_0x4988ae};if(_0x15f3b8===_0x377d('0x82')){_0x199bbb[_0x377d('0x1b')]={'penalty':_0x55d4f6[_0x377d('0x8c')][_0x377d('0x8d')]};}return db[_0x377d('0x8e')+_0x15f3b8+_0x377d('0x76')][_0x377d('0x8f')](_0x199bbb)[_0x377d('0x29')](function(){socket[_0x377d('0x90')]('user'+_0x15f3b8+_0x377d('0x91'),{'UserId':_0x3beb92,[_0x15f3b8+_0x377d('0x8b')]:_0x55d4f6['id']});if(_0x15f3b8!=='Voice'){return;}return db[_0x377d('0x8e')][_0x377d('0x92')]({'where':{'id':_0x2a0030,'online':0x1},'attributes':['id',_0x377d('0x2a'),_0x377d('0x93'),_0x377d('0x94'),_0x377d('0x95')],'raw':!![]})[_0x377d('0x29')](function(_0x4ac6e6){var _0x3afb2a=_[_0x377d('0x30')](_0x4ac6e6,function(_0x187e26){return db[_0x377d('0x96')]['upsert']({'membername':_0x187e26['name'],'UserId':_0x187e26['id'],'queue_name':_0x55d4f6[_0x377d('0x2a')],'VoiceQueueId':_0x55d4f6['id'],'interface':_[_0x377d('0x97')](_0x187e26[_0x377d('0x95')])?util['format'](_0x377d('0x98'),_0x187e26[_0x377d('0x2a')]):_0x187e26[_0x377d('0x95')],'paused':_0x187e26[_0x377d('0x94')]||![],'penalty':_0x55d4f6['TeamVoiceQueue']['penalty']},{'transaction':_0x4988ae});});return Promise[_0x377d('0x99')](_0x3afb2a);});});});return Promise[_0x377d('0x99')](_0x2d3e41);});return Promise[_0x377d('0x99')](_0x22d625);})[_0x377d('0x29')](function(){return db['TeamVoicePrefix'][_0x377d('0x7b')]({'where':{'teamId':_0x184e1f}})[_0x377d('0x29')](function(_0x109c6f){if(_0x109c6f){var _0x54f1da=_[_0x377d('0x30')](_0x2a0030,function(_0x3fb64e){db[_0x377d('0x6c')][_0x377d('0x9a')]({'UserId':_0x3fb64e,'VoicePrefixId':_0x109c6f[_0x377d('0x9b')]});});return Promise[_0x377d('0x99')](_0x54f1da);}});});});return Promise[_0x377d('0x99')](_0x4f91e4)['then'](function(){return _0x1ef9ab[_0x377d('0x80')](_0x2a0030,{'transaction':_0x4988ae})[_0x377d('0x9c')](function(_0x4732f4){return _0x4732f4;});});});}})[_0x377d('0x29')](respondWithResult(_0x40101f,null))['catch'](handleError(_0x40101f,null));};exports[_0x377d('0x9d')]=function(_0x252578,_0xa8c85f){var _0x355902=_[_0x377d('0x81')](_0x252578[_0x377d('0x31')]['ids'])?_0x252578[_0x377d('0x31')][_0x377d('0x7f')]:[_0x252578[_0x377d('0x31')][_0x377d('0x7f')]];var _0x23bfcb=_0x252578[_0x377d('0x45')]['id'];return db[_0x377d('0x2c')][_0x377d('0x48')]({'where':{'id':_0x23bfcb}})[_0x377d('0x29')](handleEntityNotFound(_0xa8c85f,null))['then'](function(_0x5db319){if(_0x5db319){var _0x419a2f=[_0x377d('0x82'),_0x377d('0x83'),_0x377d('0x84'),'Sms',_0x377d('0x86'),'Openchannel','Whatsapp'];return db[_0x377d('0x55')][_0x377d('0x89')](function(_0x45e6ad){var _0x5a0211=_['map'](_0x419a2f,function(_0x207b13){var _0x2d2b1f={'attributes':['id',_0x377d('0x2a')]};return _0x5db319[_0x377d('0x4b')+_0x207b13+_0x377d('0x79')](_0x2d2b1f)[_0x377d('0x29')](function(_0x3dfab2){var _0x274445=_[_0x377d('0x30')](_0x3dfab2,function(_0x337702){return _0x337702[_0x377d('0x9d')](_0x355902,{'transaction':_0x45e6ad})[_0x377d('0x29')](function(){var _0x37b3e6=_[_0x377d('0x30')](_0x355902,function(_0x55089c){socket[_0x377d('0x90')](_0x377d('0x4d')+_0x207b13+_0x377d('0x9e'),{'UserId':Number(_0x55089c),[_0x207b13+_0x377d('0x8b')]:_0x337702['id']});if(_0x207b13!==_0x377d('0x82')){return;}return db[_0x377d('0x96')][_0x377d('0x54')]({'where':{'VoiceQueueId':_0x337702['id'],'UserId':_0x55089c},'transaction':_0x45e6ad});});return Promise[_0x377d('0x99')](_0x37b3e6);});});return Promise[_0x377d('0x99')](_0x274445);});});return Promise[_0x377d('0x99')](_0x5a0211)['then'](function(){return _0x5db319['removeAgents'](_0x355902,{'transaction':_0x45e6ad});})[_0x377d('0x29')](function(){return db['TeamVoicePrefix'][_0x377d('0x7b')]({'where':{'teamId':_0x23bfcb}})[_0x377d('0x29')](function(_0x2a5022){if(_0x2a5022){var _0x3c2e3b=_[_0x377d('0x30')](_0x355902,function(_0x235c3a){db['UserVoicePrefix'][_0x377d('0x54')]({'where':{'UserId':_0x235c3a,'VoicePrefixId':_0x2a5022[_0x377d('0x9b')]}});});return Promise[_0x377d('0x99')](_0x3c2e3b);}});});});}})[_0x377d('0x29')](respondWithStatusCode(_0xa8c85f,null))['catch'](handleError(_0xa8c85f,null));};exports[_0x377d('0x9f')]=function(_0x4c6109,_0x420f16,_0x5e015a){var _0x516114={};var _0x40e9db={};var _0x52ba17;var _0x515197;return db['Team'][_0x377d('0x7b')]({'where':{'id':_0x4c6109[_0x377d('0x45')]['id']}})[_0x377d('0x29')](handleEntityNotFound(_0x420f16,null))[_0x377d('0x29')](function(_0x5bbc3b){if(_0x5bbc3b){_0x52ba17=_0x5bbc3b;_0x40e9db[_0x377d('0x34')]=_[_0x377d('0x46')](db[_0x377d('0x8e')]['rawAttributes']);_0x40e9db[_0x377d('0x31')]=_['keys'](_0x4c6109[_0x377d('0x31')]);_0x40e9db[_0x377d('0x32')]=_['intersection'](_0x40e9db[_0x377d('0x34')],_0x40e9db[_0x377d('0x31')]);_0x516114[_0x377d('0x35')]=_[_0x377d('0x33')](_0x40e9db[_0x377d('0x34')],qs['fields'](_0x4c6109[_0x377d('0x31')][_0x377d('0x36')]));_0x516114[_0x377d('0x35')]=_0x516114[_0x377d('0x35')]['length']?_0x516114[_0x377d('0x35')]:_0x40e9db[_0x377d('0x34')];_0x516114[_0x377d('0x3b')]=qs[_0x377d('0x3c')](_0x4c6109['query'][_0x377d('0x3c')]);_0x516114[_0x377d('0x3d')]=qs[_0x377d('0x32')](_[_0x377d('0x77')](_0x4c6109['query'],_0x40e9db[_0x377d('0x32')]));if(_0x4c6109['query'][_0x377d('0x40')]){_0x516114[_0x377d('0x3d')]=_[_0x377d('0x3e')](_0x516114[_0x377d('0x3d')],{'$or':_[_0x377d('0x30')](_0x516114[_0x377d('0x35')],function(_0x37a6c9){var _0x1c900b={};_0x1c900b[_0x37a6c9]={'$like':'%'+_0x4c6109[_0x377d('0x31')][_0x377d('0x40')]+'%'};return _0x1c900b;})});}_0x516114=_['merge']({},_0x516114,_0x4c6109[_0x377d('0x78')]);return _0x52ba17[_0x377d('0x9f')](_0x516114);}})['then'](function(_0x576e2f){if(_0x576e2f){_0x515197=_0x576e2f[_0x377d('0x37')];if(!_0x4c6109[_0x377d('0x31')][_0x377d('0x38')](_0x377d('0x39'))){_0x516114[_0x377d('0x3a')]=qs['limit'](_0x4c6109[_0x377d('0x31')][_0x377d('0x3a')]);_0x516114[_0x377d('0x21')]=qs[_0x377d('0x21')](_0x4c6109[_0x377d('0x31')][_0x377d('0x21')]);}return _0x52ba17['getAgents'](_0x516114);}})['then'](function(_0x5e4727){if(_0x5e4727){return _0x5e4727?{'count':_0x515197,'rows':_0x5e4727}:null;}})[_0x377d('0x29')](respondWithResult(_0x420f16,null))[_0x377d('0x43')](handleError(_0x420f16,null));};
\ No newline at end of file
index fb47d4f..6ecf13b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa862=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1af8cb,_0x48ba46){var _0x4544d6=function(_0xa2213b){while(--_0xa2213b){_0x1af8cb['push'](_0x1af8cb['shift']());}};_0x4544d6(++_0x48ba46);}(_0xa862,0xf0));var _0x2a86=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xa862[_0x3f2d02];return _0x54092b;};'use strict';var EventEmitter=require('events');var Team=require(_0x2a86('0x0'))['db'][_0x2a86('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2a86('0x2')](0x0);var events={'afterCreate':_0x2a86('0x3'),'afterUpdate':_0x2a86('0x4'),'afterDestroy':_0x2a86('0x5')};function emitEvent(_0x19fb73){return function(_0x65bfb6,_0x511aed,_0x2aabe0){TeamEvents[_0x2a86('0x6')](_0x19fb73+':'+_0x65bfb6['id'],_0x65bfb6);TeamEvents[_0x2a86('0x6')](_0x19fb73,_0x65bfb6);_0x2aabe0(null);};}for(var e in events){if(events[_0x2a86('0x7')](e)){var event=events[e];Team[_0x2a86('0x8')](e,emitEvent(event));}}module[_0x2a86('0x9')]=TeamEvents;
\ No newline at end of file
+var _0x9e55=['hasOwnProperty','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x424719,_0x1533ee){var _0x216ce5=function(_0x218dbb){while(--_0x218dbb){_0x424719['push'](_0x424719['shift']());}};_0x216ce5(++_0x1533ee);}(_0x9e55,0x106));var _0x59e5=function(_0x2d0ba0,_0x4af9dd){_0x2d0ba0=_0x2d0ba0-0x0;var _0x2c4d09=_0x9e55[_0x2d0ba0];return _0x2c4d09;};'use strict';var EventEmitter=require(_0x59e5('0x0'));var Team=require(_0x59e5('0x1'))['db'][_0x59e5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x59e5('0x3')](0x0);var events={'afterCreate':_0x59e5('0x4'),'afterUpdate':_0x59e5('0x5'),'afterDestroy':_0x59e5('0x6')};function emitEvent(_0x36167d){return function(_0x4b68d9,_0xa2a378,_0x596bda){TeamEvents[_0x59e5('0x7')](_0x36167d+':'+_0x4b68d9['id'],_0x4b68d9);TeamEvents[_0x59e5('0x7')](_0x36167d,_0x4b68d9);_0x596bda(null);};}for(var e in events){if(events[_0x59e5('0x8')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 8c21fac..90ba7f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfebc=['moment','bluebird','rimraf','../../config/environment','./team.attributes','exports','teams','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfebc,0x1ed));var _0xcfeb=function(_0x20275f,_0x4528c5){_0x20275f=_0x20275f-0x0;var _0x5a5457=_0xfebc[_0x20275f];return _0x5a5457;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcfeb('0x0'))(_0xcfeb('0x1'));var moment=require(_0xcfeb('0x2'));var BPromise=require(_0xcfeb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcfeb('0x4'));var config=require(_0xcfeb('0x5'));var attributes=require(_0xcfeb('0x6'));module[_0xcfeb('0x7')]=function(_0x445a7e,_0x5e4df4){return _0x445a7e['define']('Team',attributes,{'tableName':_0xcfeb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61da=['Team','teams','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./team.attributes','exports','define'];(function(_0xe667cd,_0x48aecb){var _0x518684=function(_0x173759){while(--_0x173759){_0xe667cd['push'](_0xe667cd['shift']());}};_0x518684(++_0x48aecb);}(_0x61da,0x176));var _0xa61d=function(_0x45f165,_0xb0040e){_0x45f165=_0x45f165-0x0;var _0xfc7b5e=_0x61da[_0x45f165];return _0xfc7b5e;};'use strict';var _=require(_0xa61d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa61d('0x1'));var moment=require(_0xa61d('0x2'));var BPromise=require(_0xa61d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa61d('0x4'));var rimraf=require(_0xa61d('0x5'));var config=require(_0xa61d('0x6'));var attributes=require(_0xa61d('0x7'));module[_0xa61d('0x8')]=function(_0x4caa18,_0x2ca236){return _0x4caa18[_0xa61d('0x9')](_0xa61d('0xa'),attributes,{'tableName':_0xa61d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b636a4..032e40e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf178=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x32fbc0,_0x4c20e2){var _0x3c8fc0=function(_0x56cd0a){while(--_0x56cd0a){_0x32fbc0['push'](_0x32fbc0['shift']());}};_0x3c8fc0(++_0x4c20e2);}(_0xf178,0xb5));var _0x8f17=function(_0x47d193,_0x3d630b){_0x47d193=_0x47d193-0x0;var _0x442d26=_0xf178[_0x47d193];return _0x442d26;};'use strict';var _=require(_0x8f17('0x0'));var util=require('util');var moment=require(_0x8f17('0x1'));var BPromise=require(_0x8f17('0x2'));var rs=require(_0x8f17('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f17('0x4'))['db'];var utils=require(_0x8f17('0x5'));var logger=require(_0x8f17('0x6'))(_0x8f17('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f17('0x8'));var client=jayson[_0x8f17('0x9')][_0x8f17('0xa')]({'port':0x232a});config[_0x8f17('0xb')]=_['defaults'](config[_0x8f17('0xb')],{'host':_0x8f17('0xc'),'port':0x18eb});var socket=require(_0x8f17('0xd'))(new Redis(config['redis']));require(_0x8f17('0xe'))[_0x8f17('0xf')](socket);function respondWithRpcPromise(_0x32b5f8,_0x1381da,_0x15be1c){return new BPromise(function(_0x226b61,_0x1191e5){return client[_0x8f17('0x10')](_0x32b5f8,_0x15be1c)[_0x8f17('0x11')](function(_0x263730){logger[_0x8f17('0x12')](_0x8f17('0x13'),_0x1381da,_0x8f17('0x14'));logger['debug'](_0x8f17('0x15'),_0x1381da,_0x8f17('0x14'),JSON['stringify'](_0x263730));if(_0x263730[_0x8f17('0x16')]){if(_0x263730[_0x8f17('0x16')][_0x8f17('0x17')]===0x1f4){logger[_0x8f17('0x16')](_0x8f17('0x13'),_0x1381da,_0x263730['error']['message']);return _0x1191e5(_0x263730[_0x8f17('0x16')][_0x8f17('0x18')]);}logger[_0x8f17('0x16')](_0x8f17('0x13'),_0x1381da,_0x263730['error'][_0x8f17('0x18')]);return _0x226b61(_0x263730[_0x8f17('0x16')][_0x8f17('0x18')]);}else{logger[_0x8f17('0x12')](_0x8f17('0x13'),_0x1381da,_0x8f17('0x14'));_0x226b61(_0x263730[_0x8f17('0x19')][_0x8f17('0x18')]);}})[_0x8f17('0x1a')](function(_0x2a7ca9){logger[_0x8f17('0x16')]('Team,\x20%s,\x20%s',_0x1381da,_0x2a7ca9);_0x1191e5(_0x2a7ca9);});});}
\ No newline at end of file
+var _0xe707=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','debug'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xe707,0x166));var _0x7e70=function(_0x11ba97,_0x3b5170){_0x11ba97=_0x11ba97-0x0;var _0x2975c6=_0xe707[_0x11ba97];return _0x2975c6;};'use strict';var _=require(_0x7e70('0x0'));var util=require('util');var moment=require(_0x7e70('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e70('0x2'));var fs=require('fs');var Redis=require(_0x7e70('0x3'));var db=require(_0x7e70('0x4'))['db'];var utils=require(_0x7e70('0x5'));var logger=require(_0x7e70('0x6'))(_0x7e70('0x7'));var config=require(_0x7e70('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7e70('0x9')]({'port':0x232a});config[_0x7e70('0xa')]=_[_0x7e70('0xb')](config[_0x7e70('0xa')],{'host':_0x7e70('0xc'),'port':0x18eb});var socket=require(_0x7e70('0xd'))(new Redis(config[_0x7e70('0xa')]));require(_0x7e70('0xe'))[_0x7e70('0xf')](socket);function respondWithRpcPromise(_0x380927,_0x544603,_0x1c6f8c){return new BPromise(function(_0x3428a3,_0x21f0e1){return client['request'](_0x380927,_0x1c6f8c)[_0x7e70('0x10')](function(_0x3ff86d){logger[_0x7e70('0x11')](_0x7e70('0x12'),_0x544603,'request\x20sent');logger[_0x7e70('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x544603,_0x7e70('0x14'),JSON[_0x7e70('0x15')](_0x3ff86d));if(_0x3ff86d['error']){if(_0x3ff86d[_0x7e70('0x16')][_0x7e70('0x17')]===0x1f4){logger[_0x7e70('0x16')]('Team,\x20%s,\x20%s',_0x544603,_0x3ff86d[_0x7e70('0x16')][_0x7e70('0x18')]);return _0x21f0e1(_0x3ff86d[_0x7e70('0x16')][_0x7e70('0x18')]);}logger['error'](_0x7e70('0x12'),_0x544603,_0x3ff86d[_0x7e70('0x16')]['message']);return _0x3428a3(_0x3ff86d[_0x7e70('0x16')][_0x7e70('0x18')]);}else{logger[_0x7e70('0x11')](_0x7e70('0x12'),_0x544603,_0x7e70('0x14'));_0x3428a3(_0x3ff86d[_0x7e70('0x19')][_0x7e70('0x18')]);}})[_0x7e70('0x1a')](function(_0x284814){logger[_0x7e70('0x16')](_0x7e70('0x12'),_0x544603,_0x284814);_0x21f0e1(_0x284814);});});}
\ No newline at end of file
index 302b1a8..1389f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27dd=['remove','update','emit','removeListener','register','length','team:','./team.events'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x27dd,0x177));var _0xd27d=function(_0xaa6a4,_0x64b067){_0xaa6a4=_0xaa6a4-0x0;var _0xdc31a4=_0x27dd[_0xaa6a4];return _0xdc31a4;};'use strict';var TeamEvents=require(_0xd27d('0x0'));var events=['save',_0xd27d('0x1'),_0xd27d('0x2')];function createListener(_0x3c1ab5,_0x5626d6){return function(_0x5c09f3){_0x5626d6[_0xd27d('0x3')](_0x3c1ab5,_0x5c09f3);};}function removeListener(_0x47e0b0,_0x4f35fe){return function(){TeamEvents[_0xd27d('0x4')](_0x47e0b0,_0x4f35fe);};}exports[_0xd27d('0x5')]=function(_0x57f9df){for(var _0x1485e7=0x0,_0x2c917e=events[_0xd27d('0x6')];_0x1485e7<_0x2c917e;_0x1485e7++){var _0x1cc3f8=events[_0x1485e7];var _0x5154dd=createListener(_0xd27d('0x7')+_0x1cc3f8,_0x57f9df);TeamEvents['on'](_0x1cc3f8,_0x5154dd);}};
\ No newline at end of file
+var _0x43ea=['remove','update','emit','removeListener','register','length','team:','./team.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x43ea,0x142));var _0xa43e=function(_0x3e20f9,_0x5da5ff){_0x3e20f9=_0x3e20f9-0x0;var _0x32768a=_0x43ea[_0x3e20f9];return _0x32768a;};'use strict';var TeamEvents=require(_0xa43e('0x0'));var events=[_0xa43e('0x1'),_0xa43e('0x2'),_0xa43e('0x3')];function createListener(_0x4d278f,_0x5120de){return function(_0x4ae296){_0x5120de[_0xa43e('0x4')](_0x4d278f,_0x4ae296);};}function removeListener(_0x3bed76,_0x6f496c){return function(){TeamEvents[_0xa43e('0x5')](_0x3bed76,_0x6f496c);};}exports[_0xa43e('0x6')]=function(_0x4fac19){for(var _0x4a01a5=0x0,_0x4b81b3=events[_0xa43e('0x7')];_0x4a01a5<_0x4b81b3;_0x4a01a5++){var _0x6e45db=events[_0x4a01a5];var _0x55a7ab=createListener(_0xa43e('0x8')+_0x6e45db,_0x4fac19);TeamEvents['on'](_0x6e45db,_0x55a7ab);}};
\ No newline at end of file
index 6262dbd..6094345 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1752=['INTEGER','exports'];(function(_0x1704d5,_0x1f1740){var _0x58b71d=function(_0x252c42){while(--_0x252c42){_0x1704d5['push'](_0x1704d5['shift']());}};_0x58b71d(++_0x1f1740);}(_0x1752,0xa5));var _0x2175=function(_0x4fab47,_0x3c43b6){_0x4fab47=_0x4fab47-0x0;var _0x34a394=_0x1752[_0x4fab47];return _0x34a394;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'TeamId':{'type':Sequelize[_0x2175('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x2175('0x1')]}};
\ No newline at end of file
+var _0xd757=['exports','INTEGER','sequelize'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xd757,0x1e5));var _0x7d75=function(_0x1055cf,_0x293e11){_0x1055cf=_0x1055cf-0x0;var _0x29fd60=_0xd757[_0x1055cf];return _0x29fd60;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'TeamId':{'type':Sequelize[_0x7d75('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7d75('0x2')]}};
\ No newline at end of file
index a3cef00..b8944e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x866a=['rimraf','../../config/environment','exports','define','TeamVoicePrefix','team_has_voice_prefixes','util','../../config/logger','api','moment','bluebird','path'];(function(_0x114356,_0x561b7a){var _0xd46fa7=function(_0x4b93ef){while(--_0x4b93ef){_0x114356['push'](_0x114356['shift']());}};_0xd46fa7(++_0x561b7a);}(_0x866a,0x156));var _0xa866=function(_0x2c32ad,_0x1a12d4){_0x2c32ad=_0x2c32ad-0x0;var _0x1d474f=_0x866a[_0x2c32ad];return _0x1d474f;};'use strict';var _=require('lodash');var util=require(_0xa866('0x0'));var logger=require(_0xa866('0x1'))(_0xa866('0x2'));var moment=require(_0xa866('0x3'));var BPromise=require(_0xa866('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa866('0x5'));var rimraf=require(_0xa866('0x6'));var config=require(_0xa866('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xa866('0x8')]=function(_0x31a017,_0x1ea4de){return _0x31a017[_0xa866('0x9')](_0xa866('0xa'),attributes,{'tableName':_0xa866('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x138d=['api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x89a220,_0x2fd418){var _0x9995b8=function(_0x1c467b){while(--_0x1c467b){_0x89a220['push'](_0x89a220['shift']());}};_0x9995b8(++_0x2fd418);}(_0x138d,0x1ab));var _0xd138=function(_0x401676,_0x3f1436){_0x401676=_0x401676-0x0;var _0x4f13fe=_0x138d[_0x401676];return _0x4f13fe;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var logger=require('../../config/logger')(_0xd138('0x2'));var moment=require(_0xd138('0x3'));var BPromise=require(_0xd138('0x4'));var rp=require(_0xd138('0x5'));var fs=require('fs');var path=require(_0xd138('0x6'));var rimraf=require(_0xd138('0x7'));var config=require('../../config/environment');var attributes=require(_0xd138('0x8'));module[_0xd138('0x9')]=function(_0x343962,_0x54f02e){return _0x343962[_0xd138('0xa')](_0xd138('0xb'),attributes,{'tableName':_0xd138('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c8be9ec..366d248 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(_0x35f5a5,_0x3f8a65){var _0x143dce=function(_0x5c3197){while(--_0x5c3197){_0x35f5a5['push'](_0x35f5a5['shift']());}};_0x143dce(++_0x3f8a65);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var 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(_0x183e96,_0x212699){var _0x273b91=function(_0x2bf163){while(--_0x2bf163){_0x183e96['push'](_0x183e96['shift']());}};_0x273b91(++_0x212699);}(_0xe706,0xa3));var _0x6e70=function(_0x14bdfb,_0x7ebb3c){_0x14bdfb=_0x14bdfb-0x0;var _0x433477=_0xe706[_0x14bdfb];return _0x433477;};'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 da4145c..35d6600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78b2=['sequelize','exports','INTEGER'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x78b2,0x7e));var _0x278b=function(_0x440e4b,_0x498759){_0x440e4b=_0x440e4b-0x0;var _0x46a09f=_0x78b2[_0x440e4b];return _0x46a09f;};'use strict';var Sequelize=require(_0x278b('0x0'));module[_0x278b('0x1')]={'penalty':{'type':Sequelize[_0x278b('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0899=['sequelize','exports','INTEGER'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0899,0x183));var _0x9089=function(_0x34bf1d,_0x4f87f9){_0x34bf1d=_0x34bf1d-0x0;var _0x2a56a3=_0x0899[_0x34bf1d];return _0x2a56a3;};'use strict';var Sequelize=require(_0x9089('0x0'));module[_0x9089('0x1')]={'penalty':{'type':Sequelize[_0x9089('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 0486918..73d7898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ce=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','TeamVoiceQueue','util','api','moment'];(function(_0x23615e,_0x3d7c79){var _0x5a7e3b=function(_0x44de59){while(--_0x44de59){_0x23615e['push'](_0x23615e['shift']());}};_0x5a7e3b(++_0x3d7c79);}(_0xd2ce,0x13c));var _0xed2c=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xd2ce[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var logger=require('../../config/logger')(_0xed2c('0x1'));var moment=require(_0xed2c('0x2'));var BPromise=require(_0xed2c('0x3'));var rp=require(_0xed2c('0x4'));var fs=require('fs');var path=require(_0xed2c('0x5'));var rimraf=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var attributes=require('./teamVoiceQueue.attributes');module[_0xed2c('0x8')]=function(_0x5b6ccb,_0x38aa25){return _0x5b6ccb[_0xed2c('0x9')](_0xed2c('0xa'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4fef=['path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','lodash','util','api','bluebird','request-promise'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x4fef,0x10f));var _0xf4fe=function(_0x50b79,_0xf131b6){_0x50b79=_0x50b79-0x0;var _0x226f48=_0x4fef[_0x50b79];return _0x226f48;};'use strict';var _=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var logger=require('../../config/logger')(_0xf4fe('0x2'));var moment=require('moment');var BPromise=require(_0xf4fe('0x3'));var rp=require(_0xf4fe('0x4'));var fs=require('fs');var path=require(_0xf4fe('0x5'));var rimraf=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var attributes=require(_0xf4fe('0x8'));module[_0xf4fe('0x9')]=function(_0x27c6c9,_0x522427){return _0x27c6c9[_0xf4fe('0xa')](_0xf4fe('0xb'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f971fce..284abe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb18=['code','message','result','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4bc532,_0x42f9c5){var _0x2b20f1=function(_0x4a9c95){while(--_0x4a9c95){_0x4bc532['push'](_0x4bc532['shift']());}};_0x2b20f1(++_0x42f9c5);}(_0xcb18,0x159));var _0x8cb1=function(_0x567569,_0x4e3b4f){_0x567569=_0x567569-0x0;var _0xcbe051=_0xcb18[_0x567569];return _0xcbe051;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8cb1('0x0'));var BPromise=require('bluebird');var rs=require(_0x8cb1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cb1('0x2'))['db'];var utils=require(_0x8cb1('0x3'));var logger=require(_0x8cb1('0x4'))(_0x8cb1('0x5'));var config=require(_0x8cb1('0x6'));var jayson=require(_0x8cb1('0x7'));var client=jayson['client'][_0x8cb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x335e41,_0x55ca24,_0x186f71){return new BPromise(function(_0x510e92,_0x34dbbb){return client[_0x8cb1('0x9')](_0x335e41,_0x186f71)['then'](function(_0xc6491b){logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,_0x8cb1('0xc'));logger[_0x8cb1('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x55ca24,_0x8cb1('0xc'),JSON[_0x8cb1('0xe')](_0xc6491b));if(_0xc6491b[_0x8cb1('0xf')]){if(_0xc6491b['error'][_0x8cb1('0x10')]===0x1f4){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x34dbbb(_0xc6491b[_0x8cb1('0xf')]['message']);}logger[_0x8cb1('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x55ca24,_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);return _0x510e92(_0xc6491b[_0x8cb1('0xf')][_0x8cb1('0x11')]);}else{logger[_0x8cb1('0xa')](_0x8cb1('0xb'),_0x55ca24,'request\x20sent');_0x510e92(_0xc6491b[_0x8cb1('0x12')]['message']);}})['catch'](function(_0x557fb5){logger[_0x8cb1('0xf')](_0x8cb1('0xb'),_0x55ca24,_0x557fb5);_0x34dbbb(_0x557fb5);});});}
\ No newline at end of file
+var _0x74f0=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x74f0,0xf3));var _0x074f=function(_0x2f6dfe,_0x115dab){_0x2f6dfe=_0x2f6dfe-0x0;var _0x5e5c9c=_0x74f0[_0x2f6dfe];return _0x5e5c9c;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x074f('0x1'));var fs=require('fs');var Redis=require(_0x074f('0x2'));var db=require(_0x074f('0x3'))['db'];var utils=require(_0x074f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x074f('0x5'));var jayson=require(_0x074f('0x6'));var client=jayson[_0x074f('0x7')][_0x074f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10b244,_0x395b3c,_0x3dd440){return new BPromise(function(_0x547297,_0x7108e1){return client[_0x074f('0x9')](_0x10b244,_0x3dd440)['then'](function(_0x252a2e){logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));logger[_0x074f('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x395b3c,'request\x20sent',JSON[_0x074f('0xe')](_0x252a2e));if(_0x252a2e[_0x074f('0xf')]){if(_0x252a2e[_0x074f('0xf')][_0x074f('0x10')]===0x1f4){logger[_0x074f('0xf')](_0x074f('0xb'),_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x7108e1(_0x252a2e[_0x074f('0xf')]['message']);}logger[_0x074f('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x395b3c,_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);return _0x547297(_0x252a2e[_0x074f('0xf')][_0x074f('0x11')]);}else{logger[_0x074f('0xa')](_0x074f('0xb'),_0x395b3c,_0x074f('0xc'));_0x547297(_0x252a2e[_0x074f('0x12')][_0x074f('0x11')]);}})[_0x074f('0x13')](function(_0x40fd10){logger['error'](_0x074f('0xb'),_0x395b3c,_0x40fd10);_0x7108e1(_0x40fd10);});});}
\ No newline at end of file
index f3cf809..5274f46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56b9=['isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./template.controller','get','index','/:id'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x56b9,0x196));var _0x956b=function(_0x596fca,_0x561214){_0x596fca=_0x596fca-0x0;var _0x1e64f1=_0x56b9[_0x596fca];return _0x1e64f1;};'use strict';var multer=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var path=require(_0x956b('0x2'));var timeout=require(_0x956b('0x3'));var express=require(_0x956b('0x4'));var router=express[_0x956b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x956b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x956b('0x7'));var controller=require(_0x956b('0x8'));router[_0x956b('0x9')]('/',auth['isAuthenticated'](),controller[_0x956b('0xa')]);router[_0x956b('0x9')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0xd')]);router[_0x956b('0xe')]('/',auth[_0x956b('0xc')](),controller[_0x956b('0xf')]);router['put'](_0x956b('0xb'),auth[_0x956b('0xc')](),controller['update']);router[_0x956b('0x10')](_0x956b('0xb'),auth[_0x956b('0xc')](),controller[_0x956b('0x11')]);module[_0x956b('0x12')]=router;
\ No newline at end of file
+var _0x57ef=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x57ef,0xdb));var _0xf57e=function(_0x64938e,_0x45018f){_0x64938e=_0x64938e-0x0;var _0x17c96a=_0x57ef[_0x64938e];return _0x17c96a;};'use strict';var multer=require('multer');var util=require(_0xf57e('0x0'));var path=require(_0xf57e('0x1'));var timeout=require(_0xf57e('0x2'));var express=require(_0xf57e('0x3'));var router=express[_0xf57e('0x4')]();var fs_extra=require(_0xf57e('0x5'));var auth=require(_0xf57e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf57e('0x7'));var controller=require(_0xf57e('0x8'));router[_0xf57e('0x9')]('/',auth[_0xf57e('0xa')](),controller[_0xf57e('0xb')]);router[_0xf57e('0x9')](_0xf57e('0xc'),auth[_0xf57e('0xa')](),controller['show']);router[_0xf57e('0xd')]('/',auth[_0xf57e('0xa')](),controller[_0xf57e('0xe')]);router[_0xf57e('0xf')](_0xf57e('0xc'),auth['isAuthenticated'](),controller[_0xf57e('0x10')]);router[_0xf57e('0x11')]('/:id',auth[_0xf57e('0xa')](),controller[_0xf57e('0x12')]);module[_0xf57e('0x13')]=router;
\ No newline at end of file
index adaac07..4689923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38a6=['sequelize','exports','STRING','TEXT'];(function(_0x2ac8aa,_0x9b30fb){var _0x2ed2d2=function(_0x45789a){while(--_0x45789a){_0x2ac8aa['push'](_0x2ac8aa['shift']());}};_0x2ed2d2(++_0x9b30fb);}(_0x38a6,0xb0));var _0x638a=function(_0x51e15a,_0x8d4d12){_0x51e15a=_0x51e15a-0x0;var _0x3c0868=_0x38a6[_0x51e15a];return _0x3c0868;};'use strict';var Sequelize=require(_0x638a('0x0'));module[_0x638a('0x1')]={'name':{'type':Sequelize[_0x638a('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x638a('0x3')]}};
\ No newline at end of file
+var _0x8285=['sequelize','exports','STRING','TEXT'];(function(_0xecb0b,_0x58a3af){var _0xadcb1d=function(_0x1967e8){while(--_0x1967e8){_0xecb0b['push'](_0xecb0b['shift']());}};_0xadcb1d(++_0x58a3af);}(_0x8285,0x144));var _0x5828=function(_0x41ed0a,_0x44b88a){_0x41ed0a=_0x41ed0a-0x0;var _0x323939=_0x8285[_0x41ed0a];return _0x323939;};'use strict';var Sequelize=require(_0x5828('0x0'));module[_0x5828('0x1')]={'name':{'type':Sequelize[_0x5828('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5828('0x3')]}};
\ No newline at end of file
index f3b445c..8a7c7e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6805=['user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6805,0x10d));var _0x5680=function(_0x16ad5a,_0x103565){_0x16ad5a=_0x16ad5a-0x0;var _0x108a4d=_0x6805[_0x16ad5a];return _0x108a4d;};'use strict';var emlformat=require(_0x5680('0x0'));var rimraf=require(_0x5680('0x1'));var zipdir=require(_0x5680('0x2'));var jsonpatch=require(_0x5680('0x3'));var rp=require(_0x5680('0x4'));var moment=require(_0x5680('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5680('0x6'));var util=require(_0x5680('0x7'));var path=require(_0x5680('0x8'));var sox=require(_0x5680('0x9'));var csv=require(_0x5680('0xa'));var ejs=require(_0x5680('0xb'));var fs=require('fs');var fs_extra=require(_0x5680('0xc'));var _=require(_0x5680('0xd'));var squel=require(_0x5680('0xe'));var crypto=require(_0x5680('0xf'));var jsforce=require(_0x5680('0x10'));var deskjs=require(_0x5680('0x11'));var toCsv=require(_0x5680('0xa'));var querystring=require(_0x5680('0x12'));var Papa=require(_0x5680('0x13'));var Redis=require(_0x5680('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x5680('0x15'));var as=require(_0x5680('0x16'));var hardwareService=require(_0x5680('0x17'));var logger=require(_0x5680('0x18'))(_0x5680('0x19'));var utils=require(_0x5680('0x1a'));var config=require(_0x5680('0x1b'));var licenseUtil=require(_0x5680('0x1c'));var db=require(_0x5680('0x1d'))['db'];function respondWithStatusCode(_0x4d2de1,_0x24f6f6){_0x24f6f6=_0x24f6f6||0xcc;return function(_0x2b8d4c){if(_0x2b8d4c){return _0x4d2de1[_0x5680('0x1e')](_0x24f6f6);}return _0x4d2de1['status'](_0x24f6f6)[_0x5680('0x1f')]();};}function respondWithResult(_0x352136,_0x340983){_0x340983=_0x340983||0xc8;return function(_0x249eaa){if(_0x249eaa){return _0x352136[_0x5680('0x20')](_0x340983)[_0x5680('0x21')](_0x249eaa);}};}function respondWithFilteredResult(_0x21a2c4,_0x1f8995){return function(_0x318d29){if(_0x318d29){var _0x2147d5=typeof _0x1f8995[_0x5680('0x22')]===_0x5680('0x23')&&typeof _0x1f8995[_0x5680('0x24')]===_0x5680('0x23');var _0x18fd4e=_0x318d29['count'];var _0x23acba=_0x2147d5?0x0:_0x1f8995[_0x5680('0x22')];var _0x6248f3=_0x2147d5?_0x318d29['count']:_0x1f8995[_0x5680('0x22')]+_0x1f8995[_0x5680('0x24')];var _0x502554;if(_0x6248f3>=_0x18fd4e){_0x6248f3=_0x18fd4e;_0x502554=0xc8;}else{_0x502554=0xce;}_0x21a2c4[_0x5680('0x20')](_0x502554);return _0x21a2c4[_0x5680('0x25')]('Content-Range',_0x23acba+'-'+_0x6248f3+'/'+_0x18fd4e)['json'](_0x318d29);}return null;};}function patchUpdates(_0xed9703){return function(_0xc6d5ac){try{jsonpatch[_0x5680('0x26')](_0xc6d5ac,_0xed9703,!![]);}catch(_0x315e93){return BPromise[_0x5680('0x27')](_0x315e93);}return _0xc6d5ac[_0x5680('0x28')]();};}function saveUpdates(_0x185525,_0x49161f){return function(_0x1de434){if(_0x1de434){return _0x1de434[_0x5680('0x29')](_0x185525)[_0x5680('0x2a')](function(_0x38bf6c){return _0x38bf6c;});}return null;};}function removeEntity(_0x4f38b0,_0x3068ad){return function(_0x371701){if(_0x371701){return _0x371701[_0x5680('0x2b')]()[_0x5680('0x2a')](function(){var _0x4758ed=_0x371701[_0x5680('0x2c')]({'plain':!![]});var _0x414210=_0x5680('0x2d');return db[_0x5680('0x2e')][_0x5680('0x2b')]({'where':{'type':_0x414210,'resourceId':_0x4758ed['id']}})['then'](function(){return _0x371701;});})['then'](function(){_0x4f38b0['status'](0xcc)[_0x5680('0x1f')]();});}};}function handleEntityNotFound(_0x3025fb,_0x2d0325){return function(_0x1c8043){if(!_0x1c8043){_0x3025fb[_0x5680('0x1e')](0x194);}return _0x1c8043;};}function handleError(_0x575228,_0x4b3a52){_0x4b3a52=_0x4b3a52||0x1f4;return function(_0x5b74e4){logger[_0x5680('0x2f')](_0x5b74e4[_0x5680('0x30')]);if(_0x5b74e4[_0x5680('0x31')]){delete _0x5b74e4[_0x5680('0x31')];}_0x575228[_0x5680('0x20')](_0x4b3a52)[_0x5680('0x32')](_0x5b74e4);};}exports[_0x5680('0x33')]=function(_0x35729e,_0x48e2e1){var _0x203332={},_0x275fac={},_0xe7cbe9={'count':0x0,'rows':[]};var _0x8f22f2=_[_0x5680('0x34')](db[_0x5680('0x35')][_0x5680('0x36')],function(_0x38dd1f){return{'name':_0x38dd1f[_0x5680('0x37')],'type':_0x38dd1f[_0x5680('0x38')][_0x5680('0x39')]};});_0x275fac['model']=_[_0x5680('0x34')](_0x8f22f2,'name');_0x275fac['query']=_[_0x5680('0x3a')](_0x35729e[_0x5680('0x3b')]);_0x275fac[_0x5680('0x3c')]=_[_0x5680('0x3d')](_0x275fac[_0x5680('0x3e')],_0x275fac[_0x5680('0x3b')]);_0x203332[_0x5680('0x3f')]=_[_0x5680('0x3d')](_0x275fac[_0x5680('0x3e')],qs[_0x5680('0x40')](_0x35729e[_0x5680('0x3b')][_0x5680('0x40')]));_0x203332[_0x5680('0x3f')]=_0x203332[_0x5680('0x3f')][_0x5680('0x41')]?_0x203332[_0x5680('0x3f')]:_0x275fac['model'];if(!_0x35729e[_0x5680('0x3b')][_0x5680('0x42')](_0x5680('0x43'))){_0x203332[_0x5680('0x24')]=qs[_0x5680('0x24')](_0x35729e['query'][_0x5680('0x24')]);_0x203332['offset']=qs[_0x5680('0x22')](_0x35729e['query'][_0x5680('0x22')]);}_0x203332['order']=qs[_0x5680('0x44')](_0x35729e[_0x5680('0x3b')]['sort']);_0x203332[_0x5680('0x45')]=qs[_0x5680('0x3c')](_[_0x5680('0x46')](_0x35729e[_0x5680('0x3b')],_0x275fac[_0x5680('0x3c')]),_0x8f22f2);if(_0x35729e[_0x5680('0x3b')][_0x5680('0x47')]){_0x203332[_0x5680('0x45')]=_[_0x5680('0x48')](_0x203332['where'],{'$or':_[_0x5680('0x34')](_0x8f22f2,function(_0x40c348){if(_0x40c348[_0x5680('0x38')]!==_0x5680('0x49')){var _0x1fc4af={};_0x1fc4af[_0x40c348['name']]={'$like':'%'+_0x35729e[_0x5680('0x3b')][_0x5680('0x47')]+'%'};return _0x1fc4af;}})});}_0x203332=_[_0x5680('0x48')]({},_0x203332,_0x35729e[_0x5680('0x4a')]);var _0x70b3d6={'where':_0x203332['where']};return db[_0x5680('0x35')][_0x5680('0x4b')](_0x70b3d6)['then'](function(_0x751078){_0xe7cbe9[_0x5680('0x4b')]=_0x751078;if(_0x35729e['query']['includeAll']){_0x203332[_0x5680('0x4c')]=[{'all':!![]}];}return db[_0x5680('0x35')]['findAll'](_0x203332);})[_0x5680('0x2a')](function(_0x1698d6){_0xe7cbe9['rows']=_0x1698d6;return _0xe7cbe9;})[_0x5680('0x2a')](respondWithFilteredResult(_0x48e2e1,_0x203332))[_0x5680('0x4d')](handleError(_0x48e2e1,null));};exports['show']=function(_0x59a901,_0xeff476){var _0x526da5={'raw':!![],'where':{'id':_0x59a901[_0x5680('0x4e')]['id']}},_0x3dcc26={};_0x3dcc26[_0x5680('0x3e')]=_['keys'](db[_0x5680('0x35')][_0x5680('0x36')]);_0x3dcc26[_0x5680('0x3b')]=_[_0x5680('0x3a')](_0x59a901[_0x5680('0x3b')]);_0x3dcc26['filters']=_[_0x5680('0x3d')](_0x3dcc26[_0x5680('0x3e')],_0x3dcc26['query']);_0x526da5[_0x5680('0x3f')]=_['intersection'](_0x3dcc26[_0x5680('0x3e')],qs['fields'](_0x59a901[_0x5680('0x3b')][_0x5680('0x40')]));_0x526da5['attributes']=_0x526da5['attributes']['length']?_0x526da5['attributes']:_0x3dcc26[_0x5680('0x3e')];if(_0x59a901[_0x5680('0x3b')]['includeAll']){_0x526da5[_0x5680('0x4c')]=[{'all':!![]}];}_0x526da5=_[_0x5680('0x48')]({},_0x526da5,_0x59a901['options']);return db[_0x5680('0x35')]['find'](_0x526da5)[_0x5680('0x2a')](handleEntityNotFound(_0xeff476,null))[_0x5680('0x2a')](respondWithResult(_0xeff476,null))[_0x5680('0x4d')](handleError(_0xeff476,null));};exports['create']=function(_0xdf459b,_0x4e94e6){return db[_0x5680('0x35')][_0x5680('0x4f')](_0xdf459b[_0x5680('0x50')],{})[_0x5680('0x2a')](function(_0x2be905){var _0xe7e30=_0xdf459b['user'][_0x5680('0x2c')]({'plain':!![]});if(!_0xe7e30)throw new Error(_0x5680('0x51'));if(_0xe7e30[_0x5680('0x52')]===_0x5680('0x53')){var _0x20b46f=_0x2be905[_0x5680('0x2c')]({'plain':!![]});var _0x2b89d9=_0x5680('0x2d');return db[_0x5680('0x54')]['find']({'where':{'name':_0x2b89d9,'userProfileId':_0xe7e30[_0x5680('0x55')]},'raw':!![]})[_0x5680('0x2a')](function(_0x64efc4){if(_0x64efc4&&_0x64efc4[_0x5680('0x56')]===0x0){return db[_0x5680('0x2e')]['create']({'name':_0x20b46f[_0x5680('0x31')],'resourceId':_0x20b46f['id'],'type':_0x64efc4[_0x5680('0x31')],'sectionId':_0x64efc4['id']},{})[_0x5680('0x2a')](function(){return _0x2be905;});}else{return _0x2be905;}})[_0x5680('0x4d')](function(_0x2844ff){logger[_0x5680('0x2f')](_0x5680('0x57'),_0x2844ff);throw _0x2844ff;});}return _0x2be905;})[_0x5680('0x2a')](respondWithResult(_0x4e94e6,0xc9))['catch'](handleError(_0x4e94e6,null));};exports[_0x5680('0x29')]=function(_0x51a73d,_0x590a26){if(_0x51a73d[_0x5680('0x50')]['id']){delete _0x51a73d[_0x5680('0x50')]['id'];}return db['Template']['find']({'where':{'id':_0x51a73d[_0x5680('0x4e')]['id']}})[_0x5680('0x2a')](handleEntityNotFound(_0x590a26,null))[_0x5680('0x2a')](saveUpdates(_0x51a73d['body'],null))[_0x5680('0x2a')](respondWithResult(_0x590a26,null))[_0x5680('0x4d')](handleError(_0x590a26,null));};exports[_0x5680('0x2b')]=function(_0x352f05,_0x545d49){return db[_0x5680('0x35')]['find']({'where':{'id':_0x352f05[_0x5680('0x4e')]['id']}})['then'](handleEntityNotFound(_0x545d49,null))[_0x5680('0x2a')](removeEntity(_0x545d49,null))[_0x5680('0x4d')](handleError(_0x545d49,null));};
\ No newline at end of file
+var _0xaad0=['sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','reject','save','update','then','destroy','Templates','stack','name','index','map','Template','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','userProfileId','UserProfileResource','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x5d8542,_0x324fb5){var _0x344e00=function(_0x51c6bf){while(--_0x51c6bf){_0x5d8542['push'](_0x5d8542['shift']());}};_0x344e00(++_0x324fb5);}(_0xaad0,0x86));var _0x0aad=function(_0x32bf57,_0x5b9afe){_0x32bf57=_0x32bf57-0x0;var _0x5b3549=_0xaad0[_0x32bf57];return _0x5b3549;};'use strict';var emlformat=require(_0x0aad('0x0'));var rimraf=require(_0x0aad('0x1'));var zipdir=require(_0x0aad('0x2'));var jsonpatch=require(_0x0aad('0x3'));var rp=require(_0x0aad('0x4'));var moment=require('moment');var BPromise=require(_0x0aad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0aad('0x6'));var sox=require(_0x0aad('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0aad('0x8'));var _=require(_0x0aad('0x9'));var squel=require('squel');var crypto=require(_0x0aad('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0aad('0xb'));var toCsv=require(_0x0aad('0xc'));var querystring=require(_0x0aad('0xd'));var Papa=require(_0x0aad('0xe'));var Redis=require(_0x0aad('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0aad('0x10'));var hardwareService=require(_0x0aad('0x11'));var logger=require(_0x0aad('0x12'))(_0x0aad('0x13'));var utils=require(_0x0aad('0x14'));var config=require(_0x0aad('0x15'));var licenseUtil=require(_0x0aad('0x16'));var db=require(_0x0aad('0x17'))['db'];function respondWithStatusCode(_0x47ed90,_0x304ba9){_0x304ba9=_0x304ba9||0xcc;return function(_0x550b3b){if(_0x550b3b){return _0x47ed90[_0x0aad('0x18')](_0x304ba9);}return _0x47ed90[_0x0aad('0x19')](_0x304ba9)[_0x0aad('0x1a')]();};}function respondWithResult(_0x4185ba,_0x35838b){_0x35838b=_0x35838b||0xc8;return function(_0x3ffbd7){if(_0x3ffbd7){return _0x4185ba[_0x0aad('0x19')](_0x35838b)[_0x0aad('0x1b')](_0x3ffbd7);}};}function respondWithFilteredResult(_0x53d05a,_0x4fa0b9){return function(_0x2978ca){if(_0x2978ca){var _0x2f6524=typeof _0x4fa0b9['offset']===_0x0aad('0x1c')&&typeof _0x4fa0b9[_0x0aad('0x1d')]===_0x0aad('0x1c');var _0x5524a8=_0x2978ca['count'];var _0x2eb700=_0x2f6524?0x0:_0x4fa0b9[_0x0aad('0x1e')];var _0x2b94fc=_0x2f6524?_0x2978ca[_0x0aad('0x1f')]:_0x4fa0b9[_0x0aad('0x1e')]+_0x4fa0b9[_0x0aad('0x1d')];var _0x37b126;if(_0x2b94fc>=_0x5524a8){_0x2b94fc=_0x5524a8;_0x37b126=0xc8;}else{_0x37b126=0xce;}_0x53d05a[_0x0aad('0x19')](_0x37b126);return _0x53d05a['set'](_0x0aad('0x20'),_0x2eb700+'-'+_0x2b94fc+'/'+_0x5524a8)['json'](_0x2978ca);}return null;};}function patchUpdates(_0x37307b){return function(_0x4d12a7){try{jsonpatch['apply'](_0x4d12a7,_0x37307b,!![]);}catch(_0x2dc982){return BPromise[_0x0aad('0x21')](_0x2dc982);}return _0x4d12a7[_0x0aad('0x22')]();};}function saveUpdates(_0x1eccf7,_0x9a291a){return function(_0x4919f0){if(_0x4919f0){return _0x4919f0[_0x0aad('0x23')](_0x1eccf7)[_0x0aad('0x24')](function(_0x5cccb8){return _0x5cccb8;});}return null;};}function removeEntity(_0x5554c5,_0x5484b5){return function(_0x6c17ac){if(_0x6c17ac){return _0x6c17ac[_0x0aad('0x25')]()[_0x0aad('0x24')](function(){var _0x3ca11e=_0x6c17ac['get']({'plain':!![]});var _0x576638=_0x0aad('0x26');return db['UserProfileResource'][_0x0aad('0x25')]({'where':{'type':_0x576638,'resourceId':_0x3ca11e['id']}})['then'](function(){return _0x6c17ac;});})[_0x0aad('0x24')](function(){_0x5554c5[_0x0aad('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57a1ff,_0x160ed4){return function(_0x78c1bd){if(!_0x78c1bd){_0x57a1ff[_0x0aad('0x18')](0x194);}return _0x78c1bd;};}function handleError(_0x262e24,_0x15f1cb){_0x15f1cb=_0x15f1cb||0x1f4;return function(_0x203566){logger['error'](_0x203566[_0x0aad('0x27')]);if(_0x203566['name']){delete _0x203566[_0x0aad('0x28')];}_0x262e24[_0x0aad('0x19')](_0x15f1cb)['send'](_0x203566);};}exports[_0x0aad('0x29')]=function(_0x1aff91,_0x4cd0a0){var _0x146df7={},_0x425407={},_0x4dae83={'count':0x0,'rows':[]};var _0x40bd9c=_[_0x0aad('0x2a')](db[_0x0aad('0x2b')]['rawAttributes'],function(_0x5a6a22){return{'name':_0x5a6a22['fieldName'],'type':_0x5a6a22[_0x0aad('0x2c')][_0x0aad('0x2d')]};});_0x425407[_0x0aad('0x2e')]=_[_0x0aad('0x2a')](_0x40bd9c,'name');_0x425407[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x1aff91[_0x0aad('0x2f')]);_0x425407[_0x0aad('0x31')]=_[_0x0aad('0x32')](_0x425407['model'],_0x425407['query']);_0x146df7['attributes']=_['intersection'](_0x425407[_0x0aad('0x2e')],qs[_0x0aad('0x33')](_0x1aff91[_0x0aad('0x2f')][_0x0aad('0x33')]));_0x146df7[_0x0aad('0x34')]=_0x146df7[_0x0aad('0x34')][_0x0aad('0x35')]?_0x146df7[_0x0aad('0x34')]:_0x425407[_0x0aad('0x2e')];if(!_0x1aff91[_0x0aad('0x2f')][_0x0aad('0x36')](_0x0aad('0x37'))){_0x146df7['limit']=qs[_0x0aad('0x1d')](_0x1aff91[_0x0aad('0x2f')]['limit']);_0x146df7[_0x0aad('0x1e')]=qs[_0x0aad('0x1e')](_0x1aff91[_0x0aad('0x2f')][_0x0aad('0x1e')]);}_0x146df7['order']=qs[_0x0aad('0x38')](_0x1aff91[_0x0aad('0x2f')]['sort']);_0x146df7[_0x0aad('0x39')]=qs[_0x0aad('0x31')](_[_0x0aad('0x3a')](_0x1aff91[_0x0aad('0x2f')],_0x425407[_0x0aad('0x31')]),_0x40bd9c);if(_0x1aff91[_0x0aad('0x2f')][_0x0aad('0x3b')]){_0x146df7[_0x0aad('0x39')]=_[_0x0aad('0x3c')](_0x146df7[_0x0aad('0x39')],{'$or':_[_0x0aad('0x2a')](_0x40bd9c,function(_0x1d6aeb){if(_0x1d6aeb[_0x0aad('0x2c')]!==_0x0aad('0x3d')){var _0x4e1d3f={};_0x4e1d3f[_0x1d6aeb[_0x0aad('0x28')]]={'$like':'%'+_0x1aff91[_0x0aad('0x2f')]['filter']+'%'};return _0x4e1d3f;}})});}_0x146df7=_[_0x0aad('0x3c')]({},_0x146df7,_0x1aff91[_0x0aad('0x3e')]);var _0x39af36={'where':_0x146df7['where']};return db[_0x0aad('0x2b')]['count'](_0x39af36)[_0x0aad('0x24')](function(_0x28e413){_0x4dae83[_0x0aad('0x1f')]=_0x28e413;if(_0x1aff91[_0x0aad('0x2f')][_0x0aad('0x3f')]){_0x146df7[_0x0aad('0x40')]=[{'all':!![]}];}return db[_0x0aad('0x2b')][_0x0aad('0x41')](_0x146df7);})['then'](function(_0x3b5353){_0x4dae83[_0x0aad('0x42')]=_0x3b5353;return _0x4dae83;})[_0x0aad('0x24')](respondWithFilteredResult(_0x4cd0a0,_0x146df7))[_0x0aad('0x43')](handleError(_0x4cd0a0,null));};exports[_0x0aad('0x44')]=function(_0x2b7267,_0x35e1b0){var _0xe1692d={'raw':!![],'where':{'id':_0x2b7267[_0x0aad('0x45')]['id']}},_0x2d90e8={};_0x2d90e8[_0x0aad('0x2e')]=_[_0x0aad('0x30')](db[_0x0aad('0x2b')]['rawAttributes']);_0x2d90e8[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x2b7267['query']);_0x2d90e8['filters']=_[_0x0aad('0x32')](_0x2d90e8['model'],_0x2d90e8[_0x0aad('0x2f')]);_0xe1692d[_0x0aad('0x34')]=_[_0x0aad('0x32')](_0x2d90e8['model'],qs[_0x0aad('0x33')](_0x2b7267[_0x0aad('0x2f')]['fields']));_0xe1692d[_0x0aad('0x34')]=_0xe1692d[_0x0aad('0x34')][_0x0aad('0x35')]?_0xe1692d[_0x0aad('0x34')]:_0x2d90e8[_0x0aad('0x2e')];if(_0x2b7267[_0x0aad('0x2f')][_0x0aad('0x3f')]){_0xe1692d[_0x0aad('0x40')]=[{'all':!![]}];}_0xe1692d=_[_0x0aad('0x3c')]({},_0xe1692d,_0x2b7267[_0x0aad('0x3e')]);return db[_0x0aad('0x2b')][_0x0aad('0x46')](_0xe1692d)[_0x0aad('0x24')](handleEntityNotFound(_0x35e1b0,null))[_0x0aad('0x24')](respondWithResult(_0x35e1b0,null))[_0x0aad('0x43')](handleError(_0x35e1b0,null));};exports['create']=function(_0xb374d6,_0x46b5a6){return db[_0x0aad('0x2b')][_0x0aad('0x47')](_0xb374d6[_0x0aad('0x48')],{})[_0x0aad('0x24')](function(_0x12e2f7){var _0x15b472=_0xb374d6[_0x0aad('0x49')][_0x0aad('0x4a')]({'plain':!![]});if(!_0x15b472)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15b472[_0x0aad('0x4b')]===_0x0aad('0x49')){var _0x5603d3=_0x12e2f7['get']({'plain':!![]});var _0x308664='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x308664,'userProfileId':_0x15b472[_0x0aad('0x4c')]},'raw':!![]})[_0x0aad('0x24')](function(_0x263c9b){if(_0x263c9b&&_0x263c9b['autoAssociation']===0x0){return db[_0x0aad('0x4d')][_0x0aad('0x47')]({'name':_0x5603d3[_0x0aad('0x28')],'resourceId':_0x5603d3['id'],'type':_0x263c9b['name'],'sectionId':_0x263c9b['id']},{})[_0x0aad('0x24')](function(){return _0x12e2f7;});}else{return _0x12e2f7;}})[_0x0aad('0x43')](function(_0x4e0f4b){logger[_0x0aad('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e0f4b);throw _0x4e0f4b;});}return _0x12e2f7;})[_0x0aad('0x24')](respondWithResult(_0x46b5a6,0xc9))['catch'](handleError(_0x46b5a6,null));};exports[_0x0aad('0x23')]=function(_0x162977,_0x4fad19){if(_0x162977['body']['id']){delete _0x162977[_0x0aad('0x48')]['id'];}return db[_0x0aad('0x2b')][_0x0aad('0x46')]({'where':{'id':_0x162977[_0x0aad('0x45')]['id']}})[_0x0aad('0x24')](handleEntityNotFound(_0x4fad19,null))[_0x0aad('0x24')](saveUpdates(_0x162977[_0x0aad('0x48')],null))['then'](respondWithResult(_0x4fad19,null))[_0x0aad('0x43')](handleError(_0x4fad19,null));};exports[_0x0aad('0x25')]=function(_0x4c488f,_0x3b7068){return db[_0x0aad('0x2b')][_0x0aad('0x46')]({'where':{'id':_0x4c488f['params']['id']}})[_0x0aad('0x24')](handleEntityNotFound(_0x3b7068,null))[_0x0aad('0x24')](removeEntity(_0x3b7068,null))['catch'](handleError(_0x3b7068,null));};
\ No newline at end of file
index 911ea5f..102ef04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa65=['Template','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes'];(function(_0x3d107e,_0x53fa04){var _0x443c0f=function(_0x4a3ecf){while(--_0x4a3ecf){_0x3d107e['push'](_0x3d107e['shift']());}};_0x443c0f(++_0x53fa04);}(_0xaa65,0x15f));var _0x5aa6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa65[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var logger=require('../../config/logger')(_0x5aa6('0x2'));var moment=require(_0x5aa6('0x3'));var BPromise=require(_0x5aa6('0x4'));var rp=require(_0x5aa6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5aa6('0x6'));var config=require(_0x5aa6('0x7'));var attributes=require(_0x5aa6('0x8'));module['exports']=function(_0x942167,_0x5e74f8){return _0x942167['define'](_0x5aa6('0x9'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa160=['path','rimraf','./template.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x29e30f,_0x1d5d40){var _0x50644e=function(_0x2e1cc7){while(--_0x2e1cc7){_0x29e30f['push'](_0x29e30f['shift']());}};_0x50644e(++_0x1d5d40);}(_0xa160,0xbd));var _0x0a16=function(_0x3f193a,_0x573c8e){_0x3f193a=_0x3f193a-0x0;var _0x4bc282=_0xa160[_0x3f193a];return _0x4bc282;};'use strict';var _=require(_0x0a16('0x0'));var util=require('util');var logger=require(_0x0a16('0x1'))(_0x0a16('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a16('0x3'));var rimraf=require(_0x0a16('0x4'));var config=require('../../config/environment');var attributes=require(_0x0a16('0x5'));module[_0x0a16('0x6')]=function(_0x41d36e,_0x24528f){return _0x41d36e[_0x0a16('0x7')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4ba502..0cf7b37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1b4=['findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','message','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','result','catch','GetTemplate'];(function(_0x2e5849,_0x4e615a){var _0x17cd13=function(_0x5dffe0){while(--_0x5dffe0){_0x2e5849['push'](_0x2e5849['shift']());}};_0x17cd13(++_0x4e615a);}(_0xc1b4,0x1bf));var _0x4c1b=function(_0x3c0edf,_0x2403cc){_0x3c0edf=_0x3c0edf-0x0;var _0x38ab72=_0xc1b4[_0x3c0edf];return _0x38ab72;};'use strict';var _=require('lodash');var util=require(_0x4c1b('0x0'));var moment=require(_0x4c1b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c1b('0x2'))['db'];var utils=require(_0x4c1b('0x3'));var logger=require('../../config/logger')(_0x4c1b('0x4'));var config=require(_0x4c1b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4c1b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1219de,_0x34c61d,_0x46ac25){return new BPromise(function(_0x24b28a,_0x21a638){return client[_0x4c1b('0x7')](_0x1219de,_0x46ac25)['then'](function(_0x51ddec){logger[_0x4c1b('0x8')](_0x4c1b('0x9'),_0x34c61d,_0x4c1b('0xa'));logger[_0x4c1b('0xb')](_0x4c1b('0xc'),_0x34c61d,_0x4c1b('0xa'),JSON['stringify'](_0x51ddec));if(_0x51ddec['error']){if(_0x51ddec[_0x4c1b('0xd')]['code']===0x1f4){logger[_0x4c1b('0xd')]('Template,\x20%s,\x20%s',_0x34c61d,_0x51ddec[_0x4c1b('0xd')]['message']);return _0x21a638(_0x51ddec[_0x4c1b('0xd')]['message']);}logger[_0x4c1b('0xd')](_0x4c1b('0x9'),_0x34c61d,_0x51ddec['error']['message']);return _0x24b28a(_0x51ddec[_0x4c1b('0xd')]['message']);}else{logger[_0x4c1b('0x8')](_0x4c1b('0x9'),_0x34c61d,'request\x20sent');_0x24b28a(_0x51ddec[_0x4c1b('0xe')]['message']);}})[_0x4c1b('0xf')](function(_0x2b03b9){logger[_0x4c1b('0xd')](_0x4c1b('0x9'),_0x34c61d,_0x2b03b9);_0x21a638(_0x2b03b9);});});}exports[_0x4c1b('0x10')]=function(_0x499cff){var _0x4fd087=this;return new Promise(function(_0x2a2ee0,_0x2fc629){return db['Template'][_0x4c1b('0x11')]({'raw':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x13')]===undefined?!![]:![]:!![],'where':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x14')]||null:null,'attributes':_0x499cff[_0x4c1b('0x12')]?_0x499cff[_0x4c1b('0x12')][_0x4c1b('0x15')]||null:null,'limit':_0x499cff[_0x4c1b('0x12')]?_0x499cff['options'][_0x4c1b('0x16')]||null:null,'include':_0x499cff[_0x4c1b('0x12')]?_0x499cff[_0x4c1b('0x12')][_0x4c1b('0x17')]?_[_0x4c1b('0x18')](_0x499cff[_0x4c1b('0x12')]['include'],function(_0x306827){return{'model':db[_0x306827[_0x4c1b('0x19')]],'as':_0x306827['as'],'attributes':_0x306827[_0x4c1b('0x15')],'include':_0x306827['include']?_[_0x4c1b('0x18')](_0x306827[_0x4c1b('0x17')],function(_0x4fd068){return{'model':db[_0x4fd068[_0x4c1b('0x19')]],'as':_0x4fd068['as'],'attributes':_0x4fd068['attributes'],'include':_0x4fd068[_0x4c1b('0x17')]?_[_0x4c1b('0x18')](_0x4fd068['include'],function(_0x4a62e2){return{'model':db[_0x4a62e2[_0x4c1b('0x19')]],'as':_0x4a62e2['as'],'attributes':_0x4a62e2[_0x4c1b('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4c1b('0x1a')](function(_0x2b76fd){logger[_0x4c1b('0x8')](_0x4c1b('0x10'),_0x499cff);logger[_0x4c1b('0xb')](_0x4c1b('0x10'),_0x499cff,JSON[_0x4c1b('0x1b')](_0x2b76fd));_0x2a2ee0(_0x2b76fd);})[_0x4c1b('0xf')](function(_0x1b98bf){logger[_0x4c1b('0xd')](_0x4c1b('0x10'),_0x1b98bf[_0x4c1b('0x1c')],_0x499cff);_0x2fc629(_0x4fd087[_0x4c1b('0xd')](0x1f4,_0x1b98bf[_0x4c1b('0x1c')]));});});};
\ No newline at end of file
+var _0x9348=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','Template','findAll','options','raw','attributes','limit','include','map','model','then','GetTemplate','catch','lodash','util','moment'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x9348,0x10d));var _0x8934=function(_0x5ab847,_0x124c13){_0x5ab847=_0x5ab847-0x0;var _0xf6db63=_0x9348[_0x5ab847];return _0xf6db63;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var moment=require(_0x8934('0x2'));var BPromise=require(_0x8934('0x3'));var rs=require(_0x8934('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8934('0x5'))['db'];var utils=require(_0x8934('0x6'));var logger=require('../../config/logger')(_0x8934('0x7'));var config=require(_0x8934('0x8'));var jayson=require(_0x8934('0x9'));var client=jayson[_0x8934('0xa')][_0x8934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ee9b9,_0x512f30,_0x284a62){return new BPromise(function(_0x3734c5,_0x1c7f03){return client['request'](_0x3ee9b9,_0x284a62)['then'](function(_0x5ec16d){logger['info'](_0x8934('0xc'),_0x512f30,'request\x20sent');logger[_0x8934('0xd')](_0x8934('0xe'),_0x512f30,_0x8934('0xf'),JSON[_0x8934('0x10')](_0x5ec16d));if(_0x5ec16d[_0x8934('0x11')]){if(_0x5ec16d[_0x8934('0x11')][_0x8934('0x12')]===0x1f4){logger[_0x8934('0x11')]('Template,\x20%s,\x20%s',_0x512f30,_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);return _0x1c7f03(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0x5ec16d['error'][_0x8934('0x13')]);return _0x3734c5(_0x5ec16d[_0x8934('0x11')][_0x8934('0x13')]);}else{logger[_0x8934('0x14')](_0x8934('0xc'),_0x512f30,_0x8934('0xf'));_0x3734c5(_0x5ec16d[_0x8934('0x15')][_0x8934('0x13')]);}})['catch'](function(_0xb86bc9){logger[_0x8934('0x11')](_0x8934('0xc'),_0x512f30,_0xb86bc9);_0x1c7f03(_0xb86bc9);});});}exports['GetTemplate']=function(_0x47f25e){var _0x597eed=this;return new Promise(function(_0x2ff9ce,_0x51f9ed){return db[_0x8934('0x16')][_0x8934('0x17')]({'raw':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x19')]===undefined?!![]:![]:!![],'where':_0x47f25e['options']?_0x47f25e[_0x8934('0x18')]['where']||null:null,'attributes':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1a')]||null:null,'limit':_0x47f25e[_0x8934('0x18')]?_0x47f25e[_0x8934('0x18')][_0x8934('0x1b')]||null:null,'include':_0x47f25e[_0x8934('0x18')]?_0x47f25e['options'][_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x47f25e[_0x8934('0x18')][_0x8934('0x1c')],function(_0x43b89a){return{'model':db[_0x43b89a['model']],'as':_0x43b89a['as'],'attributes':_0x43b89a[_0x8934('0x1a')],'include':_0x43b89a[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x43b89a['include'],function(_0x16cfc2){return{'model':db[_0x16cfc2['model']],'as':_0x16cfc2['as'],'attributes':_0x16cfc2[_0x8934('0x1a')],'include':_0x16cfc2[_0x8934('0x1c')]?_[_0x8934('0x1d')](_0x16cfc2['include'],function(_0x1fd5eb){return{'model':db[_0x1fd5eb[_0x8934('0x1e')]],'as':_0x1fd5eb['as'],'attributes':_0x1fd5eb[_0x8934('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8934('0x1f')](function(_0x4b5780){logger[_0x8934('0x14')](_0x8934('0x20'),_0x47f25e);logger[_0x8934('0xd')](_0x8934('0x20'),_0x47f25e,JSON[_0x8934('0x10')](_0x4b5780));_0x2ff9ce(_0x4b5780);})[_0x8934('0x21')](function(_0x3f328a){logger[_0x8934('0x11')](_0x8934('0x20'),_0x3f328a[_0x8934('0x13')],_0x47f25e);_0x51f9ed(_0x597eed['error'](0x1f4,_0x3f328a[_0x8934('0x13')]));});});};
\ No newline at end of file
index c44aac2..6c4b5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1ba=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./trigger.controller','index','/:id','/:id/all_conditions','getAllConditions','get','/:id/any_conditions','isAuthenticated','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','delete'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xc1ba,0x1bc));var _0xac1b=function(_0xc0aa62,_0x41d630){_0xc0aa62=_0xc0aa62-0x0;var _0x585510=_0xc1ba[_0xc0aa62];return _0x585510;};'use strict';var multer=require(_0xac1b('0x0'));var util=require(_0xac1b('0x1'));var path=require(_0xac1b('0x2'));var timeout=require(_0xac1b('0x3'));var express=require(_0xac1b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac1b('0x5'));var config=require(_0xac1b('0x6'));var controller=require(_0xac1b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xac1b('0x8')]);router['get'](_0xac1b('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xac1b('0xa'),auth['isAuthenticated'](),controller[_0xac1b('0xb')]);router[_0xac1b('0xc')](_0xac1b('0xd'),auth[_0xac1b('0xe')](),controller[_0xac1b('0xf')]);router[_0xac1b('0xc')](_0xac1b('0x10'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x11')]);router[_0xac1b('0x12')]('/',auth[_0xac1b('0xe')](),controller[_0xac1b('0x13')]);router[_0xac1b('0x12')](_0xac1b('0xa'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x14')]);router['post'](_0xac1b('0xd'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x15')]);router[_0xac1b('0x12')](_0xac1b('0x10'),auth[_0xac1b('0xe')](),controller[_0xac1b('0x16')]);router['put'](_0xac1b('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xac1b('0x17')]('/:id',auth[_0xac1b('0xe')](),controller[_0xac1b('0x18')]);module[_0xac1b('0x19')]=router;
\ No newline at end of file
+var _0xcf9f=['delete','destroy','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','update'];(function(_0x139c54,_0x53f5a0){var _0x388d4c=function(_0x4d81bd){while(--_0x4d81bd){_0x139c54['push'](_0x139c54['shift']());}};_0x388d4c(++_0x53f5a0);}(_0xcf9f,0x178));var _0xfcf9=function(_0xef8337,_0xa3b04a){_0xef8337=_0xef8337-0x0;var _0x278454=_0xcf9f[_0xef8337];return _0x278454;};'use strict';var multer=require(_0xfcf9('0x0'));var util=require(_0xfcf9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcf9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfcf9('0x3'));var interaction=require(_0xfcf9('0x4'));var config=require(_0xfcf9('0x5'));var controller=require('./trigger.controller');router['get']('/',auth[_0xfcf9('0x6')](),controller['index']);router[_0xfcf9('0x7')](_0xfcf9('0x8'),auth['isAuthenticated'](),controller[_0xfcf9('0x9')]);router[_0xfcf9('0x7')](_0xfcf9('0xa'),auth[_0xfcf9('0x6')](),controller[_0xfcf9('0xb')]);router['get'](_0xfcf9('0xc'),auth[_0xfcf9('0x6')](),controller[_0xfcf9('0xd')]);router[_0xfcf9('0x7')](_0xfcf9('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xfcf9('0xf')]('/',auth[_0xfcf9('0x6')](),controller[_0xfcf9('0x10')]);router['post'](_0xfcf9('0xa'),auth[_0xfcf9('0x6')](),controller[_0xfcf9('0x11')]);router[_0xfcf9('0xf')](_0xfcf9('0xc'),auth[_0xfcf9('0x6')](),controller[_0xfcf9('0x12')]);router[_0xfcf9('0xf')](_0xfcf9('0xe'),auth[_0xfcf9('0x6')](),controller['addAction']);router['put'](_0xfcf9('0x8'),auth[_0xfcf9('0x6')](),controller[_0xfcf9('0x13')]);router[_0xfcf9('0x14')](_0xfcf9('0x8'),auth['isAuthenticated'](),controller[_0xfcf9('0x15')]);module['exports']=router;
\ No newline at end of file
index c1b88ef..5ff475b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x902a=['BOOLEAN','sequelize','exports','STRING'];(function(_0x49813b,_0x4f170a){var _0x491ece=function(_0x45c465){while(--_0x45c465){_0x49813b['push'](_0x49813b['shift']());}};_0x491ece(++_0x4f170a);}(_0x902a,0x89));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa902('0x0'));module[_0xa902('0x1')]={'name':{'type':Sequelize[_0xa902('0x2')]},'channel':{'type':Sequelize[_0xa902('0x2')]},'description':{'type':Sequelize[_0xa902('0x2')]},'status':{'type':Sequelize[_0xa902('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x241d=['BOOLEAN','sequelize','STRING'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x241d,0x64));var _0xd241=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x241d[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xd241('0x0'));module['exports']={'name':{'type':Sequelize[_0xd241('0x1')]},'channel':{'type':Sequelize[_0xd241('0x1')]},'description':{'type':Sequelize[_0xd241('0x1')]},'status':{'type':Sequelize[_0xd241('0x2')],'defaultValue':![]}};
\ No newline at end of file
index c3ac861..444e97c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4c2=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','TriggerAllId','Condition','getAllConditions','findOne','options','hasOwnProperty','getAnyConditions','rawAttributes','addAction','TriggerId','getActions','Action','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','Trigger','fieldName','type','key','map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','findAll','rows','show','keys','length','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId'];(function(_0x11adfe,_0x288b24){var _0x1218d0=function(_0x2ab768){while(--_0x2ab768){_0x11adfe['push'](_0x11adfe['shift']());}};_0x1218d0(++_0x288b24);}(_0xa4c2,0xc4));var _0x2a4c=function(_0x427627,_0x1d9f73){_0x427627=_0x427627-0x0;var _0xcaac7b=_0xa4c2[_0x427627];return _0xcaac7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a4c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a4c('0x1'));var rp=require('request-promise');var moment=require(_0x2a4c('0x2'));var BPromise=require(_0x2a4c('0x3'));var Mustache=require('mustache');var util=require(_0x2a4c('0x4'));var path=require('path');var sox=require(_0x2a4c('0x5'));var csv=require(_0x2a4c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a4c('0x7'));var _=require('lodash');var squel=require(_0x2a4c('0x8'));var crypto=require('crypto');var jsforce=require(_0x2a4c('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2a4c('0xa'));var authService=require(_0x2a4c('0xb'));var qs=require(_0x2a4c('0xc'));var as=require(_0x2a4c('0xd'));var hardwareService=require(_0x2a4c('0xe'));var logger=require(_0x2a4c('0xf'))(_0x2a4c('0x10'));var utils=require(_0x2a4c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2a4c('0x12'))['db'];function respondWithStatusCode(_0x5cf8fc,_0x29433b){_0x29433b=_0x29433b||0xcc;return function(_0x5c3014){if(_0x5c3014){return _0x5cf8fc[_0x2a4c('0x13')](_0x29433b);}return _0x5cf8fc[_0x2a4c('0x14')](_0x29433b)[_0x2a4c('0x15')]();};}function respondWithResult(_0x2d4df5,_0x72d0ce){_0x72d0ce=_0x72d0ce||0xc8;return function(_0x3c2dff){if(_0x3c2dff){return _0x2d4df5[_0x2a4c('0x14')](_0x72d0ce)['json'](_0x3c2dff);}};}function respondWithFilteredResult(_0xbc70b7,_0xe9c4aa){return function(_0x3e21d7){if(_0x3e21d7){var _0x2de346=typeof _0xe9c4aa['offset']===_0x2a4c('0x16')&&typeof _0xe9c4aa[_0x2a4c('0x17')]===_0x2a4c('0x16');var _0x145daf=_0x3e21d7[_0x2a4c('0x18')];var _0x1ce6dc=_0x2de346?0x0:_0xe9c4aa[_0x2a4c('0x19')];var _0x53a1ea=_0x2de346?_0x3e21d7[_0x2a4c('0x18')]:_0xe9c4aa[_0x2a4c('0x19')]+_0xe9c4aa['limit'];var _0x254a57;if(_0x53a1ea>=_0x145daf){_0x53a1ea=_0x145daf;_0x254a57=0xc8;}else{_0x254a57=0xce;}_0xbc70b7[_0x2a4c('0x14')](_0x254a57);return _0xbc70b7[_0x2a4c('0x1a')](_0x2a4c('0x1b'),_0x1ce6dc+'-'+_0x53a1ea+'/'+_0x145daf)[_0x2a4c('0x1c')](_0x3e21d7);}return null;};}function patchUpdates(_0x186c1){return function(_0x2c9020){try{jsonpatch[_0x2a4c('0x1d')](_0x2c9020,_0x186c1,!![]);}catch(_0x3958d6){return BPromise[_0x2a4c('0x1e')](_0x3958d6);}return _0x2c9020[_0x2a4c('0x1f')]();};}function saveUpdates(_0x335d8b,_0x39df93){return function(_0x13c3eb){if(_0x13c3eb){return _0x13c3eb[_0x2a4c('0x20')](_0x335d8b)['then'](function(_0x247b76){return _0x247b76;});}return null;};}function removeEntity(_0x115865,_0x3a2862){return function(_0x4b1b90){if(_0x4b1b90){return _0x4b1b90[_0x2a4c('0x21')]()[_0x2a4c('0x22')](function(){var _0x55c34e=_0x4b1b90[_0x2a4c('0x23')]({'plain':!![]});var _0x10cd31='Triggers';return db[_0x2a4c('0x24')][_0x2a4c('0x21')]({'where':{'type':_0x10cd31,'resourceId':_0x55c34e['id']}})[_0x2a4c('0x22')](function(){return _0x4b1b90;});})['then'](function(){_0x115865['status'](0xcc)[_0x2a4c('0x15')]();});}};}function handleEntityNotFound(_0x4817d7,_0x443c45){return function(_0x5c4dc0){if(!_0x5c4dc0){_0x4817d7['sendStatus'](0x194);}return _0x5c4dc0;};}function handleError(_0x2acbda,_0x1e4ba5){_0x1e4ba5=_0x1e4ba5||0x1f4;return function(_0x29ff52){logger['error'](_0x29ff52[_0x2a4c('0x25')]);if(_0x29ff52[_0x2a4c('0x26')]){delete _0x29ff52[_0x2a4c('0x26')];}_0x2acbda[_0x2a4c('0x14')](_0x1e4ba5)[_0x2a4c('0x27')](_0x29ff52);};}exports[_0x2a4c('0x28')]=function(_0x3cca2a,_0x97ed5f){var _0x112cfd={},_0x2cbf6c={},_0xc018b4={'count':0x0,'rows':[]};var _0x1d08a0=_['map'](db[_0x2a4c('0x29')]['rawAttributes'],function(_0x287e25){return{'name':_0x287e25[_0x2a4c('0x2a')],'type':_0x287e25[_0x2a4c('0x2b')][_0x2a4c('0x2c')]};});_0x2cbf6c['model']=_[_0x2a4c('0x2d')](_0x1d08a0,_0x2a4c('0x26'));_0x2cbf6c[_0x2a4c('0x2e')]=_['keys'](_0x3cca2a['query']);_0x2cbf6c[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x2cbf6c[_0x2a4c('0x31')],_0x2cbf6c['query']);_0x112cfd['attributes']=_['intersection'](_0x2cbf6c[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x3cca2a[_0x2a4c('0x2e')]['fields']));_0x112cfd[_0x2a4c('0x33')]=_0x112cfd[_0x2a4c('0x33')]['length']?_0x112cfd['attributes']:_0x2cbf6c[_0x2a4c('0x31')];if(!_0x3cca2a[_0x2a4c('0x2e')]['hasOwnProperty'](_0x2a4c('0x34'))){_0x112cfd[_0x2a4c('0x17')]=qs['limit'](_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x17')]);_0x112cfd['offset']=qs[_0x2a4c('0x19')](_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x19')]);}_0x112cfd[_0x2a4c('0x35')]=qs['sort'](_0x3cca2a['query'][_0x2a4c('0x36')]);_0x112cfd['where']=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x3cca2a[_0x2a4c('0x2e')],_0x2cbf6c[_0x2a4c('0x2f')]),_0x1d08a0);if(_0x3cca2a['query'][_0x2a4c('0x38')]){_0x112cfd[_0x2a4c('0x39')]=_['merge'](_0x112cfd['where'],{'$or':_[_0x2a4c('0x2d')](_0x1d08a0,function(_0x2d8810){if(_0x2d8810[_0x2a4c('0x2b')]!==_0x2a4c('0x3a')){var _0x5aab10={};_0x5aab10[_0x2d8810[_0x2a4c('0x26')]]={'$like':'%'+_0x3cca2a[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x5aab10;}})});}_0x112cfd=_[_0x2a4c('0x3b')]({},_0x112cfd,_0x3cca2a['options']);var _0x40af9c={'where':_0x112cfd[_0x2a4c('0x39')]};return db[_0x2a4c('0x29')][_0x2a4c('0x18')](_0x40af9c)[_0x2a4c('0x22')](function(_0x53b324){_0xc018b4[_0x2a4c('0x18')]=_0x53b324;if(_0x3cca2a[_0x2a4c('0x2e')]['includeAll']){_0x112cfd['include']=[{'all':!![]}];}return db['Trigger'][_0x2a4c('0x3c')](_0x112cfd);})[_0x2a4c('0x22')](function(_0x520cd6){_0xc018b4[_0x2a4c('0x3d')]=_0x520cd6;return _0xc018b4;})[_0x2a4c('0x22')](respondWithFilteredResult(_0x97ed5f,_0x112cfd))['catch'](handleError(_0x97ed5f,null));};exports[_0x2a4c('0x3e')]=function(_0x224e56,_0x1750e3){var _0x5c7872={'raw':![],'where':{'id':_0x224e56['params']['id']}},_0x295133={};_0x295133[_0x2a4c('0x31')]=_[_0x2a4c('0x3f')](db[_0x2a4c('0x29')]['rawAttributes']);_0x295133[_0x2a4c('0x2e')]=_['keys'](_0x224e56['query']);_0x295133['filters']=_[_0x2a4c('0x30')](_0x295133[_0x2a4c('0x31')],_0x295133[_0x2a4c('0x2e')]);_0x5c7872['attributes']=_['intersection'](_0x295133['model'],qs[_0x2a4c('0x32')](_0x224e56[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0x5c7872[_0x2a4c('0x33')]=_0x5c7872[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x5c7872[_0x2a4c('0x33')]:_0x295133['model'];if(_0x224e56[_0x2a4c('0x2e')][_0x2a4c('0x41')]){_0x5c7872['include']=[{'all':!![]}];}_0x5c7872=_['merge']({},_0x5c7872,_0x224e56['options']);return db[_0x2a4c('0x29')][_0x2a4c('0x42')](_0x5c7872)[_0x2a4c('0x22')](handleEntityNotFound(_0x1750e3,null))[_0x2a4c('0x22')](respondWithResult(_0x1750e3,null))[_0x2a4c('0x43')](handleError(_0x1750e3,null));};exports[_0x2a4c('0x44')]=function(_0xf2427e,_0x46e2bf){return db[_0x2a4c('0x29')]['create'](_0xf2427e[_0x2a4c('0x45')],{})[_0x2a4c('0x22')](function(_0x487b1b){var _0x45b5bf=_0xf2427e['user'][_0x2a4c('0x23')]({'plain':!![]});if(!_0x45b5bf)throw new Error(_0x2a4c('0x46'));if(_0x45b5bf[_0x2a4c('0x47')]===_0x2a4c('0x48')){var _0x5b671d=_0x487b1b['get']({'plain':!![]});var _0x44e8c1='Triggers';return db['UserProfileSection'][_0x2a4c('0x42')]({'where':{'name':_0x44e8c1,'userProfileId':_0x45b5bf[_0x2a4c('0x49')]},'raw':!![]})['then'](function(_0x2c5684){if(_0x2c5684&&_0x2c5684[_0x2a4c('0x4a')]===0x0){return db[_0x2a4c('0x24')]['create']({'name':_0x5b671d['name'],'resourceId':_0x5b671d['id'],'type':_0x2c5684[_0x2a4c('0x26')],'sectionId':_0x2c5684['id']},{})[_0x2a4c('0x22')](function(){return _0x487b1b;});}else{return _0x487b1b;}})[_0x2a4c('0x43')](function(_0x210a76){logger[_0x2a4c('0x4b')](_0x2a4c('0x4c'),_0x210a76);throw _0x210a76;});}return _0x487b1b;})['then'](respondWithResult(_0x46e2bf,0xc9))[_0x2a4c('0x43')](handleError(_0x46e2bf,null));};exports[_0x2a4c('0x20')]=function(_0x5917d3,_0x405ab2){if(_0x5917d3[_0x2a4c('0x45')]['id']){delete _0x5917d3[_0x2a4c('0x45')]['id'];}return db[_0x2a4c('0x29')]['find']({'where':{'id':_0x5917d3['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x405ab2,null))[_0x2a4c('0x22')](saveUpdates(_0x5917d3[_0x2a4c('0x45')],null))[_0x2a4c('0x22')](respondWithResult(_0x405ab2,null))[_0x2a4c('0x43')](handleError(_0x405ab2,null));};exports[_0x2a4c('0x21')]=function(_0x435988,_0x45c80b){return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x435988[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x45c80b,null))[_0x2a4c('0x22')](removeEntity(_0x45c80b,null))[_0x2a4c('0x43')](handleError(_0x45c80b,null));};exports['addAllCondition']=function(_0x4936c5,_0x531fe9,_0x1d70bc){if(_0x4936c5['body']['id']){delete _0x4936c5['body']['id'];}return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x4936c5[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x531fe9,null))[_0x2a4c('0x22')](function(_0x442532){if(_0x442532){_0x4936c5[_0x2a4c('0x45')][_0x2a4c('0x4e')]=_0x442532['id'];return db[_0x2a4c('0x4f')]['create'](_0x4936c5[_0x2a4c('0x45')]);}})[_0x2a4c('0x22')](respondWithResult(_0x531fe9,null))[_0x2a4c('0x43')](handleError(_0x531fe9,null));};exports['addAnyCondition']=function(_0x3fb6b4,_0x382c67,_0x2824d0){if(_0x3fb6b4['body']['id']){delete _0x3fb6b4[_0x2a4c('0x45')]['id'];}return db[_0x2a4c('0x29')][_0x2a4c('0x42')]({'where':{'id':_0x3fb6b4[_0x2a4c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x382c67,null))['then'](function(_0x1a2186){if(_0x1a2186){_0x3fb6b4[_0x2a4c('0x45')]['TriggerAnyId']=_0x1a2186['id'];return db[_0x2a4c('0x4f')][_0x2a4c('0x44')](_0x3fb6b4[_0x2a4c('0x45')]);}})[_0x2a4c('0x22')](respondWithResult(_0x382c67,null))[_0x2a4c('0x43')](handleError(_0x382c67,null));};exports[_0x2a4c('0x50')]=function(_0x2e2bf6,_0x27ff98,_0x5536f5){var _0x1243fc={};var _0x38b062={};var _0x15e366;var _0x5a0043;return db['Trigger'][_0x2a4c('0x51')]({'where':{'id':_0x2e2bf6['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x27ff98,null))[_0x2a4c('0x22')](function(_0x5aec26){if(_0x5aec26){_0x15e366=_0x5aec26;_0x38b062['model']=_[_0x2a4c('0x3f')](db['Condition']['rawAttributes']);_0x38b062[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x2e2bf6[_0x2a4c('0x2e')]);_0x38b062['filters']=_[_0x2a4c('0x30')](_0x38b062['model'],_0x38b062[_0x2a4c('0x2e')]);_0x1243fc[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x38b062[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x2e2bf6['query'][_0x2a4c('0x32')]));_0x1243fc['attributes']=_0x1243fc[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x1243fc['attributes']:_0x38b062['model'];_0x1243fc[_0x2a4c('0x35')]=qs[_0x2a4c('0x36')](_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x36')]);_0x1243fc[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_['pick'](_0x2e2bf6[_0x2a4c('0x2e')],_0x38b062[_0x2a4c('0x2f')]));if(_0x2e2bf6['query'][_0x2a4c('0x38')]){_0x1243fc[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0x1243fc[_0x2a4c('0x39')],{'$or':_[_0x2a4c('0x2d')](_0x1243fc['attributes'],function(_0x2eadd0){var _0x560669={};_0x560669[_0x2eadd0]={'$like':'%'+_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x560669;})});}_0x1243fc=_[_0x2a4c('0x3b')]({},_0x1243fc,_0x2e2bf6[_0x2a4c('0x52')]);return _0x15e366[_0x2a4c('0x50')](_0x1243fc);}})[_0x2a4c('0x22')](function(_0xa369b6){if(_0xa369b6){_0x5a0043=_0xa369b6[_0x2a4c('0x40')];if(!_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0x1243fc['limit']=qs[_0x2a4c('0x17')](_0x2e2bf6[_0x2a4c('0x2e')][_0x2a4c('0x17')]);_0x1243fc[_0x2a4c('0x19')]=qs['offset'](_0x2e2bf6[_0x2a4c('0x2e')]['offset']);}return _0x15e366[_0x2a4c('0x50')](_0x1243fc);}})[_0x2a4c('0x22')](function(_0x4bfeda){if(_0x4bfeda){return _0x4bfeda?{'count':_0x5a0043,'rows':_0x4bfeda}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x27ff98,null))[_0x2a4c('0x43')](handleError(_0x27ff98,null));};exports[_0x2a4c('0x54')]=function(_0x21f8c3,_0x40321c,_0x127d5c){var _0xe0883f={};var _0x4a7ace={};var _0xf44176;var _0x217061;return db['Trigger'][_0x2a4c('0x51')]({'where':{'id':_0x21f8c3['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x40321c,null))[_0x2a4c('0x22')](function(_0x265d92){if(_0x265d92){_0xf44176=_0x265d92;_0x4a7ace[_0x2a4c('0x31')]=_['keys'](db['Condition'][_0x2a4c('0x55')]);_0x4a7ace[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x21f8c3[_0x2a4c('0x2e')]);_0x4a7ace[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x4a7ace[_0x2a4c('0x31')],_0x4a7ace[_0x2a4c('0x2e')]);_0xe0883f[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x4a7ace['model'],qs['fields'](_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0xe0883f['attributes']=_0xe0883f[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0xe0883f['attributes']:_0x4a7ace['model'];_0xe0883f[_0x2a4c('0x35')]=qs[_0x2a4c('0x36')](_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x36')]);_0xe0883f[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x21f8c3[_0x2a4c('0x2e')],_0x4a7ace[_0x2a4c('0x2f')]));if(_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x38')]){_0xe0883f[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0xe0883f[_0x2a4c('0x39')],{'$or':_['map'](_0xe0883f[_0x2a4c('0x33')],function(_0x5e3545){var _0x4a7865={};_0x4a7865[_0x5e3545]={'$like':'%'+_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x38')]+'%'};return _0x4a7865;})});}_0xe0883f=_[_0x2a4c('0x3b')]({},_0xe0883f,_0x21f8c3[_0x2a4c('0x52')]);return _0xf44176[_0x2a4c('0x54')](_0xe0883f);}})[_0x2a4c('0x22')](function(_0x4c6d5e){if(_0x4c6d5e){_0x217061=_0x4c6d5e['length'];if(!_0x21f8c3[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0xe0883f[_0x2a4c('0x17')]=qs[_0x2a4c('0x17')](_0x21f8c3[_0x2a4c('0x2e')]['limit']);_0xe0883f[_0x2a4c('0x19')]=qs[_0x2a4c('0x19')](_0x21f8c3['query'][_0x2a4c('0x19')]);}return _0xf44176[_0x2a4c('0x54')](_0xe0883f);}})[_0x2a4c('0x22')](function(_0x6beba9){if(_0x6beba9){return _0x6beba9?{'count':_0x217061,'rows':_0x6beba9}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x40321c,null))[_0x2a4c('0x43')](handleError(_0x40321c,null));};exports[_0x2a4c('0x56')]=function(_0x4d6b0f,_0x461740,_0x41b1a5){if(_0x4d6b0f[_0x2a4c('0x45')]['id']){delete _0x4d6b0f['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x4d6b0f['params']['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x461740,null))[_0x2a4c('0x22')](function(_0x280ca3){if(_0x280ca3){_0x4d6b0f['body'][_0x2a4c('0x57')]=_0x280ca3['id'];return db['Action'][_0x2a4c('0x44')](_0x4d6b0f[_0x2a4c('0x45')]);}})['then'](respondWithResult(_0x461740,null))[_0x2a4c('0x43')](handleError(_0x461740,null));};exports[_0x2a4c('0x58')]=function(_0x53a4cf,_0x1b7028,_0x7c4c6c){var _0x15dd1e={};var _0x302259={};var _0x38c9e9;var _0x1cadbf;return db[_0x2a4c('0x29')]['findOne']({'where':{'id':_0x53a4cf[_0x2a4c('0x4d')]['id']}})[_0x2a4c('0x22')](handleEntityNotFound(_0x1b7028,null))[_0x2a4c('0x22')](function(_0x506376){if(_0x506376){_0x38c9e9=_0x506376;_0x302259[_0x2a4c('0x31')]=_['keys'](db[_0x2a4c('0x59')]['rawAttributes']);_0x302259[_0x2a4c('0x2e')]=_[_0x2a4c('0x3f')](_0x53a4cf['query']);_0x302259[_0x2a4c('0x2f')]=_[_0x2a4c('0x30')](_0x302259[_0x2a4c('0x31')],_0x302259['query']);_0x15dd1e[_0x2a4c('0x33')]=_[_0x2a4c('0x30')](_0x302259[_0x2a4c('0x31')],qs[_0x2a4c('0x32')](_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x32')]));_0x15dd1e[_0x2a4c('0x33')]=_0x15dd1e[_0x2a4c('0x33')][_0x2a4c('0x40')]?_0x15dd1e[_0x2a4c('0x33')]:_0x302259[_0x2a4c('0x31')];_0x15dd1e['order']=qs[_0x2a4c('0x36')](_0x53a4cf['query'][_0x2a4c('0x36')]);_0x15dd1e[_0x2a4c('0x39')]=qs[_0x2a4c('0x2f')](_[_0x2a4c('0x37')](_0x53a4cf['query'],_0x302259[_0x2a4c('0x2f')]));if(_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x38')]){_0x15dd1e[_0x2a4c('0x39')]=_[_0x2a4c('0x3b')](_0x15dd1e[_0x2a4c('0x39')],{'$or':_[_0x2a4c('0x2d')](_0x15dd1e[_0x2a4c('0x33')],function(_0x52ec28){var _0x4807fd={};_0x4807fd[_0x52ec28]={'$like':'%'+_0x53a4cf[_0x2a4c('0x2e')]['filter']+'%'};return _0x4807fd;})});}_0x15dd1e=_[_0x2a4c('0x3b')]({},_0x15dd1e,_0x53a4cf[_0x2a4c('0x52')]);return _0x38c9e9[_0x2a4c('0x58')](_0x15dd1e);}})['then'](function(_0x66c431){if(_0x66c431){_0x1cadbf=_0x66c431['length'];if(!_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x53')](_0x2a4c('0x34'))){_0x15dd1e[_0x2a4c('0x17')]=qs[_0x2a4c('0x17')](_0x53a4cf[_0x2a4c('0x2e')]['limit']);_0x15dd1e[_0x2a4c('0x19')]=qs[_0x2a4c('0x19')](_0x53a4cf[_0x2a4c('0x2e')][_0x2a4c('0x19')]);}return _0x38c9e9[_0x2a4c('0x58')](_0x15dd1e);}})[_0x2a4c('0x22')](function(_0x50efd4){if(_0x50efd4){return _0x50efd4?{'count':_0x1cadbf,'rows':_0x50efd4}:null;}})[_0x2a4c('0x22')](respondWithResult(_0x1b7028,null))[_0x2a4c('0x43')](handleError(_0x1b7028,null));};
\ No newline at end of file
+var _0xff2a=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','Triggers','UserProfileResource','sendStatus','error','stack','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','Trigger','findAll','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','getAllConditions','findOne','Condition','nolimit','getAnyConditions','hasOwnProperty','addAction','TriggerId','Action','getActions'];(function(_0x10b089,_0x4821cb){var _0x1f4540=function(_0x52581c){while(--_0x52581c){_0x10b089['push'](_0x10b089['shift']());}};_0x1f4540(++_0x4821cb);}(_0xff2a,0x12c));var _0xaff2=function(_0x1b33ec,_0x4c5bb3){_0x1b33ec=_0x1b33ec-0x0;var _0x36c0a4=_0xff2a[_0x1b33ec];return _0x36c0a4;};'use strict';var emlformat=require(_0xaff2('0x0'));var rimraf=require(_0xaff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaff2('0x2'));var rp=require(_0xaff2('0x3'));var moment=require(_0xaff2('0x4'));var BPromise=require(_0xaff2('0x5'));var Mustache=require(_0xaff2('0x6'));var util=require('util');var path=require('path');var sox=require(_0xaff2('0x7'));var csv=require('to-csv');var ejs=require(_0xaff2('0x8'));var fs=require('fs');var fs_extra=require(_0xaff2('0x9'));var _=require(_0xaff2('0xa'));var squel=require(_0xaff2('0xb'));var crypto=require(_0xaff2('0xc'));var jsforce=require(_0xaff2('0xd'));var deskjs=require(_0xaff2('0xe'));var toCsv=require(_0xaff2('0xf'));var querystring=require('querystring');var Papa=require(_0xaff2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaff2('0x11'));var as=require(_0xaff2('0x12'));var hardwareService=require(_0xaff2('0x13'));var logger=require(_0xaff2('0x14'))(_0xaff2('0x15'));var utils=require('../../config/utils');var config=require(_0xaff2('0x16'));var licenseUtil=require(_0xaff2('0x17'));var db=require(_0xaff2('0x18'))['db'];function respondWithStatusCode(_0x1f84b2,_0x2d1326){_0x2d1326=_0x2d1326||0xcc;return function(_0x576195){if(_0x576195){return _0x1f84b2['sendStatus'](_0x2d1326);}return _0x1f84b2['status'](_0x2d1326)[_0xaff2('0x19')]();};}function respondWithResult(_0x37882d,_0x13446a){_0x13446a=_0x13446a||0xc8;return function(_0x1d6957){if(_0x1d6957){return _0x37882d[_0xaff2('0x1a')](_0x13446a)[_0xaff2('0x1b')](_0x1d6957);}};}function respondWithFilteredResult(_0x544351,_0x136e8a){return function(_0x4b6a5b){if(_0x4b6a5b){var _0x11618a=typeof _0x136e8a['offset']===_0xaff2('0x1c')&&typeof _0x136e8a[_0xaff2('0x1d')]===_0xaff2('0x1c');var _0x49c8f9=_0x4b6a5b[_0xaff2('0x1e')];var _0x1ceae6=_0x11618a?0x0:_0x136e8a[_0xaff2('0x1f')];var _0x11e063=_0x11618a?_0x4b6a5b['count']:_0x136e8a[_0xaff2('0x1f')]+_0x136e8a['limit'];var _0x468277;if(_0x11e063>=_0x49c8f9){_0x11e063=_0x49c8f9;_0x468277=0xc8;}else{_0x468277=0xce;}_0x544351['status'](_0x468277);return _0x544351[_0xaff2('0x20')](_0xaff2('0x21'),_0x1ceae6+'-'+_0x11e063+'/'+_0x49c8f9)[_0xaff2('0x1b')](_0x4b6a5b);}return null;};}function patchUpdates(_0x5c8f5c){return function(_0x424406){try{jsonpatch[_0xaff2('0x22')](_0x424406,_0x5c8f5c,!![]);}catch(_0x32db5f){return BPromise[_0xaff2('0x23')](_0x32db5f);}return _0x424406[_0xaff2('0x24')]();};}function saveUpdates(_0x5d020d,_0x3d55ee){return function(_0xa2b9d3){if(_0xa2b9d3){return _0xa2b9d3[_0xaff2('0x25')](_0x5d020d)[_0xaff2('0x26')](function(_0x90e246){return _0x90e246;});}return null;};}function removeEntity(_0x347a40,_0x50112e){return function(_0x52f034){if(_0x52f034){return _0x52f034[_0xaff2('0x27')]()[_0xaff2('0x26')](function(){var _0x47bb94=_0x52f034['get']({'plain':!![]});var _0x274a7f=_0xaff2('0x28');return db[_0xaff2('0x29')][_0xaff2('0x27')]({'where':{'type':_0x274a7f,'resourceId':_0x47bb94['id']}})[_0xaff2('0x26')](function(){return _0x52f034;});})[_0xaff2('0x26')](function(){_0x347a40[_0xaff2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9679,_0x29fa60){return function(_0x43a163){if(!_0x43a163){_0x2f9679[_0xaff2('0x2a')](0x194);}return _0x43a163;};}function handleError(_0x42cb1b,_0x4539e7){_0x4539e7=_0x4539e7||0x1f4;return function(_0x539413){logger[_0xaff2('0x2b')](_0x539413[_0xaff2('0x2c')]);if(_0x539413['name']){delete _0x539413['name'];}_0x42cb1b['status'](_0x4539e7)[_0xaff2('0x2d')](_0x539413);};}exports['index']=function(_0x337d73,_0x5deb1e){var _0x25f822={},_0x2289b3={},_0x533642={'count':0x0,'rows':[]};var _0x233c45=_[_0xaff2('0x2e')](db['Trigger'][_0xaff2('0x2f')],function(_0x2344ad){return{'name':_0x2344ad[_0xaff2('0x30')],'type':_0x2344ad[_0xaff2('0x31')][_0xaff2('0x32')]};});_0x2289b3[_0xaff2('0x33')]=_['map'](_0x233c45,'name');_0x2289b3['query']=_[_0xaff2('0x34')](_0x337d73[_0xaff2('0x35')]);_0x2289b3[_0xaff2('0x36')]=_['intersection'](_0x2289b3[_0xaff2('0x33')],_0x2289b3[_0xaff2('0x35')]);_0x25f822['attributes']=_[_0xaff2('0x37')](_0x2289b3[_0xaff2('0x33')],qs[_0xaff2('0x38')](_0x337d73[_0xaff2('0x35')]['fields']));_0x25f822[_0xaff2('0x39')]=_0x25f822[_0xaff2('0x39')]['length']?_0x25f822['attributes']:_0x2289b3[_0xaff2('0x33')];if(!_0x337d73[_0xaff2('0x35')]['hasOwnProperty']('nolimit')){_0x25f822[_0xaff2('0x1d')]=qs[_0xaff2('0x1d')](_0x337d73[_0xaff2('0x35')]['limit']);_0x25f822['offset']=qs[_0xaff2('0x1f')](_0x337d73[_0xaff2('0x35')][_0xaff2('0x1f')]);}_0x25f822[_0xaff2('0x3a')]=qs[_0xaff2('0x3b')](_0x337d73['query']['sort']);_0x25f822[_0xaff2('0x3c')]=qs[_0xaff2('0x36')](_[_0xaff2('0x3d')](_0x337d73['query'],_0x2289b3['filters']),_0x233c45);if(_0x337d73[_0xaff2('0x35')][_0xaff2('0x3e')]){_0x25f822[_0xaff2('0x3c')]=_[_0xaff2('0x3f')](_0x25f822[_0xaff2('0x3c')],{'$or':_[_0xaff2('0x2e')](_0x233c45,function(_0x1ceec8){if(_0x1ceec8[_0xaff2('0x31')]!==_0xaff2('0x40')){var _0x4b219e={};_0x4b219e[_0x1ceec8[_0xaff2('0x41')]]={'$like':'%'+_0x337d73['query'][_0xaff2('0x3e')]+'%'};return _0x4b219e;}})});}_0x25f822=_[_0xaff2('0x3f')]({},_0x25f822,_0x337d73[_0xaff2('0x42')]);var _0x1e4d43={'where':_0x25f822[_0xaff2('0x3c')]};return db['Trigger'][_0xaff2('0x1e')](_0x1e4d43)[_0xaff2('0x26')](function(_0xc07c57){_0x533642[_0xaff2('0x1e')]=_0xc07c57;if(_0x337d73[_0xaff2('0x35')][_0xaff2('0x43')]){_0x25f822[_0xaff2('0x44')]=[{'all':!![]}];}return db[_0xaff2('0x45')][_0xaff2('0x46')](_0x25f822);})[_0xaff2('0x26')](function(_0x1b6a9d){_0x533642[_0xaff2('0x47')]=_0x1b6a9d;return _0x533642;})[_0xaff2('0x26')](respondWithFilteredResult(_0x5deb1e,_0x25f822))['catch'](handleError(_0x5deb1e,null));};exports[_0xaff2('0x48')]=function(_0x9d054b,_0x3f7e4f){var _0xe8755={'raw':![],'where':{'id':_0x9d054b[_0xaff2('0x49')]['id']}},_0x480d21={};_0x480d21[_0xaff2('0x33')]=_[_0xaff2('0x34')](db[_0xaff2('0x45')][_0xaff2('0x2f')]);_0x480d21[_0xaff2('0x35')]=_[_0xaff2('0x34')](_0x9d054b[_0xaff2('0x35')]);_0x480d21[_0xaff2('0x36')]=_[_0xaff2('0x37')](_0x480d21[_0xaff2('0x33')],_0x480d21[_0xaff2('0x35')]);_0xe8755[_0xaff2('0x39')]=_[_0xaff2('0x37')](_0x480d21[_0xaff2('0x33')],qs[_0xaff2('0x38')](_0x9d054b[_0xaff2('0x35')][_0xaff2('0x38')]));_0xe8755[_0xaff2('0x39')]=_0xe8755[_0xaff2('0x39')][_0xaff2('0x4a')]?_0xe8755[_0xaff2('0x39')]:_0x480d21[_0xaff2('0x33')];if(_0x9d054b['query'][_0xaff2('0x43')]){_0xe8755[_0xaff2('0x44')]=[{'all':!![]}];}_0xe8755=_[_0xaff2('0x3f')]({},_0xe8755,_0x9d054b['options']);return db['Trigger']['find'](_0xe8755)[_0xaff2('0x26')](handleEntityNotFound(_0x3f7e4f,null))['then'](respondWithResult(_0x3f7e4f,null))[_0xaff2('0x4b')](handleError(_0x3f7e4f,null));};exports['create']=function(_0x229f47,_0x261d77){return db['Trigger'][_0xaff2('0x4c')](_0x229f47[_0xaff2('0x4d')],{})['then'](function(_0x58b34c){var _0x32e3e2=_0x229f47[_0xaff2('0x4e')]['get']({'plain':!![]});if(!_0x32e3e2)throw new Error(_0xaff2('0x4f'));if(_0x32e3e2[_0xaff2('0x50')]==='user'){var _0x51b3d4=_0x58b34c[_0xaff2('0x51')]({'plain':!![]});var _0x34066a=_0xaff2('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x34066a,'userProfileId':_0x32e3e2[_0xaff2('0x52')]},'raw':!![]})[_0xaff2('0x26')](function(_0x234ae5){if(_0x234ae5&&_0x234ae5[_0xaff2('0x53')]===0x0){return db['UserProfileResource'][_0xaff2('0x4c')]({'name':_0x51b3d4[_0xaff2('0x41')],'resourceId':_0x51b3d4['id'],'type':_0x234ae5[_0xaff2('0x41')],'sectionId':_0x234ae5['id']},{})[_0xaff2('0x26')](function(){return _0x58b34c;});}else{return _0x58b34c;}})['catch'](function(_0x1972d1){logger[_0xaff2('0x2b')](_0xaff2('0x54'),_0x1972d1);throw _0x1972d1;});}return _0x58b34c;})[_0xaff2('0x26')](respondWithResult(_0x261d77,0xc9))[_0xaff2('0x4b')](handleError(_0x261d77,null));};exports['update']=function(_0x158af0,_0x4b525e){if(_0x158af0['body']['id']){delete _0x158af0[_0xaff2('0x4d')]['id'];}return db[_0xaff2('0x45')][_0xaff2('0x55')]({'where':{'id':_0x158af0[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x4b525e,null))['then'](saveUpdates(_0x158af0[_0xaff2('0x4d')],null))[_0xaff2('0x26')](respondWithResult(_0x4b525e,null))[_0xaff2('0x4b')](handleError(_0x4b525e,null));};exports[_0xaff2('0x27')]=function(_0x5f319b,_0x2a9caf){return db[_0xaff2('0x45')][_0xaff2('0x55')]({'where':{'id':_0x5f319b[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x2a9caf,null))[_0xaff2('0x26')](removeEntity(_0x2a9caf,null))['catch'](handleError(_0x2a9caf,null));};exports[_0xaff2('0x56')]=function(_0x521bee,_0x113b4f,_0x45ce98){if(_0x521bee['body']['id']){delete _0x521bee[_0xaff2('0x4d')]['id'];}return db[_0xaff2('0x45')][_0xaff2('0x55')]({'where':{'id':_0x521bee[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x113b4f,null))[_0xaff2('0x26')](function(_0x48f634){if(_0x48f634){_0x521bee[_0xaff2('0x4d')][_0xaff2('0x57')]=_0x48f634['id'];return db['Condition'][_0xaff2('0x4c')](_0x521bee[_0xaff2('0x4d')]);}})[_0xaff2('0x26')](respondWithResult(_0x113b4f,null))['catch'](handleError(_0x113b4f,null));};exports[_0xaff2('0x58')]=function(_0x995c95,_0x5bd5cb,_0x2e85c8){if(_0x995c95[_0xaff2('0x4d')]['id']){delete _0x995c95[_0xaff2('0x4d')]['id'];}return db[_0xaff2('0x45')]['find']({'where':{'id':_0x995c95[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x5bd5cb,null))['then'](function(_0x36009a){if(_0x36009a){_0x995c95[_0xaff2('0x4d')][_0xaff2('0x59')]=_0x36009a['id'];return db['Condition'][_0xaff2('0x4c')](_0x995c95['body']);}})[_0xaff2('0x26')](respondWithResult(_0x5bd5cb,null))[_0xaff2('0x4b')](handleError(_0x5bd5cb,null));};exports[_0xaff2('0x5a')]=function(_0x2b8084,_0x2d4d4e,_0x2a5c16){var _0xe87b4e={};var _0x27b7f8={};var _0x22f02c;var _0x4d61b2;return db[_0xaff2('0x45')][_0xaff2('0x5b')]({'where':{'id':_0x2b8084[_0xaff2('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d4d4e,null))[_0xaff2('0x26')](function(_0x5f1a71){if(_0x5f1a71){_0x22f02c=_0x5f1a71;_0x27b7f8['model']=_[_0xaff2('0x34')](db[_0xaff2('0x5c')][_0xaff2('0x2f')]);_0x27b7f8[_0xaff2('0x35')]=_[_0xaff2('0x34')](_0x2b8084['query']);_0x27b7f8[_0xaff2('0x36')]=_[_0xaff2('0x37')](_0x27b7f8['model'],_0x27b7f8[_0xaff2('0x35')]);_0xe87b4e[_0xaff2('0x39')]=_[_0xaff2('0x37')](_0x27b7f8['model'],qs[_0xaff2('0x38')](_0x2b8084[_0xaff2('0x35')][_0xaff2('0x38')]));_0xe87b4e[_0xaff2('0x39')]=_0xe87b4e[_0xaff2('0x39')][_0xaff2('0x4a')]?_0xe87b4e[_0xaff2('0x39')]:_0x27b7f8[_0xaff2('0x33')];_0xe87b4e[_0xaff2('0x3a')]=qs[_0xaff2('0x3b')](_0x2b8084[_0xaff2('0x35')][_0xaff2('0x3b')]);_0xe87b4e['where']=qs['filters'](_['pick'](_0x2b8084['query'],_0x27b7f8[_0xaff2('0x36')]));if(_0x2b8084[_0xaff2('0x35')]['filter']){_0xe87b4e[_0xaff2('0x3c')]=_[_0xaff2('0x3f')](_0xe87b4e['where'],{'$or':_[_0xaff2('0x2e')](_0xe87b4e[_0xaff2('0x39')],function(_0x50d6a0){var _0x53d1a1={};_0x53d1a1[_0x50d6a0]={'$like':'%'+_0x2b8084['query']['filter']+'%'};return _0x53d1a1;})});}_0xe87b4e=_[_0xaff2('0x3f')]({},_0xe87b4e,_0x2b8084['options']);return _0x22f02c['getAllConditions'](_0xe87b4e);}})['then'](function(_0x375774){if(_0x375774){_0x4d61b2=_0x375774[_0xaff2('0x4a')];if(!_0x2b8084[_0xaff2('0x35')]['hasOwnProperty'](_0xaff2('0x5d'))){_0xe87b4e[_0xaff2('0x1d')]=qs[_0xaff2('0x1d')](_0x2b8084[_0xaff2('0x35')][_0xaff2('0x1d')]);_0xe87b4e[_0xaff2('0x1f')]=qs['offset'](_0x2b8084[_0xaff2('0x35')]['offset']);}return _0x22f02c[_0xaff2('0x5a')](_0xe87b4e);}})['then'](function(_0x3fc760){if(_0x3fc760){return _0x3fc760?{'count':_0x4d61b2,'rows':_0x3fc760}:null;}})[_0xaff2('0x26')](respondWithResult(_0x2d4d4e,null))[_0xaff2('0x4b')](handleError(_0x2d4d4e,null));};exports[_0xaff2('0x5e')]=function(_0x140a64,_0x88be8c,_0x20c3c8){var _0x5faedd={};var _0x3a517d={};var _0x57f31a;var _0x3c39ec;return db['Trigger']['findOne']({'where':{'id':_0x140a64['params']['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x88be8c,null))[_0xaff2('0x26')](function(_0x386e81){if(_0x386e81){_0x57f31a=_0x386e81;_0x3a517d['model']=_[_0xaff2('0x34')](db[_0xaff2('0x5c')][_0xaff2('0x2f')]);_0x3a517d[_0xaff2('0x35')]=_[_0xaff2('0x34')](_0x140a64['query']);_0x3a517d[_0xaff2('0x36')]=_[_0xaff2('0x37')](_0x3a517d[_0xaff2('0x33')],_0x3a517d[_0xaff2('0x35')]);_0x5faedd[_0xaff2('0x39')]=_['intersection'](_0x3a517d[_0xaff2('0x33')],qs[_0xaff2('0x38')](_0x140a64[_0xaff2('0x35')]['fields']));_0x5faedd[_0xaff2('0x39')]=_0x5faedd[_0xaff2('0x39')][_0xaff2('0x4a')]?_0x5faedd[_0xaff2('0x39')]:_0x3a517d[_0xaff2('0x33')];_0x5faedd[_0xaff2('0x3a')]=qs[_0xaff2('0x3b')](_0x140a64[_0xaff2('0x35')]['sort']);_0x5faedd[_0xaff2('0x3c')]=qs[_0xaff2('0x36')](_[_0xaff2('0x3d')](_0x140a64[_0xaff2('0x35')],_0x3a517d['filters']));if(_0x140a64[_0xaff2('0x35')][_0xaff2('0x3e')]){_0x5faedd[_0xaff2('0x3c')]=_['merge'](_0x5faedd[_0xaff2('0x3c')],{'$or':_[_0xaff2('0x2e')](_0x5faedd[_0xaff2('0x39')],function(_0x5856d1){var _0x327eb4={};_0x327eb4[_0x5856d1]={'$like':'%'+_0x140a64['query'][_0xaff2('0x3e')]+'%'};return _0x327eb4;})});}_0x5faedd=_[_0xaff2('0x3f')]({},_0x5faedd,_0x140a64[_0xaff2('0x42')]);return _0x57f31a['getAnyConditions'](_0x5faedd);}})[_0xaff2('0x26')](function(_0x5706c7){if(_0x5706c7){_0x3c39ec=_0x5706c7[_0xaff2('0x4a')];if(!_0x140a64[_0xaff2('0x35')][_0xaff2('0x5f')]('nolimit')){_0x5faedd[_0xaff2('0x1d')]=qs[_0xaff2('0x1d')](_0x140a64[_0xaff2('0x35')][_0xaff2('0x1d')]);_0x5faedd[_0xaff2('0x1f')]=qs['offset'](_0x140a64[_0xaff2('0x35')][_0xaff2('0x1f')]);}return _0x57f31a[_0xaff2('0x5e')](_0x5faedd);}})[_0xaff2('0x26')](function(_0x19fc34){if(_0x19fc34){return _0x19fc34?{'count':_0x3c39ec,'rows':_0x19fc34}:null;}})[_0xaff2('0x26')](respondWithResult(_0x88be8c,null))[_0xaff2('0x4b')](handleError(_0x88be8c,null));};exports[_0xaff2('0x60')]=function(_0x594abb,_0x59f662,_0x3999ee){if(_0x594abb[_0xaff2('0x4d')]['id']){delete _0x594abb['body']['id'];}return db[_0xaff2('0x45')]['find']({'where':{'id':_0x594abb[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x59f662,null))[_0xaff2('0x26')](function(_0x5389e9){if(_0x5389e9){_0x594abb[_0xaff2('0x4d')][_0xaff2('0x61')]=_0x5389e9['id'];return db[_0xaff2('0x62')][_0xaff2('0x4c')](_0x594abb[_0xaff2('0x4d')]);}})[_0xaff2('0x26')](respondWithResult(_0x59f662,null))[_0xaff2('0x4b')](handleError(_0x59f662,null));};exports[_0xaff2('0x63')]=function(_0x4d4973,_0x3a6a38,_0x4d434a){var _0x4d7dfd={};var _0x516eef={};var _0x237649;var _0x8b1cc2;return db['Trigger'][_0xaff2('0x5b')]({'where':{'id':_0x4d4973[_0xaff2('0x49')]['id']}})[_0xaff2('0x26')](handleEntityNotFound(_0x3a6a38,null))['then'](function(_0x4068d8){if(_0x4068d8){_0x237649=_0x4068d8;_0x516eef[_0xaff2('0x33')]=_[_0xaff2('0x34')](db[_0xaff2('0x62')]['rawAttributes']);_0x516eef[_0xaff2('0x35')]=_[_0xaff2('0x34')](_0x4d4973[_0xaff2('0x35')]);_0x516eef['filters']=_[_0xaff2('0x37')](_0x516eef[_0xaff2('0x33')],_0x516eef[_0xaff2('0x35')]);_0x4d7dfd['attributes']=_[_0xaff2('0x37')](_0x516eef[_0xaff2('0x33')],qs[_0xaff2('0x38')](_0x4d4973['query']['fields']));_0x4d7dfd[_0xaff2('0x39')]=_0x4d7dfd['attributes'][_0xaff2('0x4a')]?_0x4d7dfd[_0xaff2('0x39')]:_0x516eef[_0xaff2('0x33')];_0x4d7dfd['order']=qs[_0xaff2('0x3b')](_0x4d4973[_0xaff2('0x35')]['sort']);_0x4d7dfd[_0xaff2('0x3c')]=qs[_0xaff2('0x36')](_[_0xaff2('0x3d')](_0x4d4973[_0xaff2('0x35')],_0x516eef[_0xaff2('0x36')]));if(_0x4d4973[_0xaff2('0x35')][_0xaff2('0x3e')]){_0x4d7dfd[_0xaff2('0x3c')]=_[_0xaff2('0x3f')](_0x4d7dfd[_0xaff2('0x3c')],{'$or':_[_0xaff2('0x2e')](_0x4d7dfd[_0xaff2('0x39')],function(_0x42ff89){var _0x5c6e76={};_0x5c6e76[_0x42ff89]={'$like':'%'+_0x4d4973[_0xaff2('0x35')]['filter']+'%'};return _0x5c6e76;})});}_0x4d7dfd=_[_0xaff2('0x3f')]({},_0x4d7dfd,_0x4d4973[_0xaff2('0x42')]);return _0x237649[_0xaff2('0x63')](_0x4d7dfd);}})['then'](function(_0xef5f89){if(_0xef5f89){_0x8b1cc2=_0xef5f89[_0xaff2('0x4a')];if(!_0x4d4973[_0xaff2('0x35')][_0xaff2('0x5f')](_0xaff2('0x5d'))){_0x4d7dfd[_0xaff2('0x1d')]=qs['limit'](_0x4d4973['query']['limit']);_0x4d7dfd['offset']=qs['offset'](_0x4d4973[_0xaff2('0x35')][_0xaff2('0x1f')]);}return _0x237649[_0xaff2('0x63')](_0x4d7dfd);}})[_0xaff2('0x26')](function(_0x59d561){if(_0x59d561){return _0x59d561?{'count':_0x8b1cc2,'rows':_0x59d561}:null;}})[_0xaff2('0x26')](respondWithResult(_0x3a6a38,null))[_0xaff2('0x4b')](handleError(_0x3a6a38,null));};
\ No newline at end of file
index ad6dc62..db89416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafe6=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','moment','bluebird'];(function(_0x189552,_0x39b6e3){var _0x12652a=function(_0x1f1e83){while(--_0x1f1e83){_0x189552['push'](_0x189552['shift']());}};_0x12652a(++_0x39b6e3);}(_0xafe6,0xac));var _0x6afe=function(_0x93fac6,_0x5a5058){_0x93fac6=_0x93fac6-0x0;var _0x1a206e=_0xafe6[_0x93fac6];return _0x1a206e;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6afe('0x2'));var BPromise=require(_0x6afe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6afe('0x4'));var config=require(_0x6afe('0x5'));var attributes=require(_0x6afe('0x6'));module[_0x6afe('0x7')]=function(_0x2ce302,_0x4898bb){return _0x2ce302[_0x6afe('0x8')](_0x6afe('0x9'),attributes,{'tableName':_0x6afe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e16=['exports','Trigger','tools_triggers','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x3e05f1,_0x4c5206){var _0x286db1=function(_0x3562c2){while(--_0x3562c2){_0x3e05f1['push'](_0x3e05f1['shift']());}};_0x286db1(++_0x4c5206);}(_0x6e16,0x1d3));var _0x66e1=function(_0x5ba859,_0x4ba90a){_0x5ba859=_0x5ba859-0x0;var _0x4e2957=_0x6e16[_0x5ba859];return _0x4e2957;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x66e1('0x0'))('api');var moment=require(_0x66e1('0x1'));var BPromise=require('bluebird');var rp=require(_0x66e1('0x2'));var fs=require('fs');var path=require(_0x66e1('0x3'));var rimraf=require('rimraf');var config=require(_0x66e1('0x4'));var attributes=require('./trigger.attributes');module[_0x66e1('0x5')]=function(_0x204db8,_0x3f95fa){return _0x204db8['define'](_0x66e1('0x6'),attributes,{'tableName':_0x66e1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa84683..b0ef02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7b7=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trigger','options','raw','where','attributes','include','map','model','GetTrigger','ShowTrigger','lodash','bluebird','randomstring','ioredis'];(function(_0x268c23,_0x3f79c2){var _0x5d3ee2=function(_0x44affd){while(--_0x44affd){_0x268c23['push'](_0x268c23['shift']());}};_0x5d3ee2(++_0x3f79c2);}(_0xf7b7,0x1cd));var _0x7f7b=function(_0x1fae53,_0x28f2e0){_0x1fae53=_0x1fae53-0x0;var _0x39f959=_0xf7b7[_0x1fae53];return _0x39f959;};'use strict';var _=require(_0x7f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7f7b('0x1'));var rs=require(_0x7f7b('0x2'));var fs=require('fs');var Redis=require(_0x7f7b('0x3'));var db=require(_0x7f7b('0x4'))['db'];var utils=require(_0x7f7b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7f7b('0x6'));var jayson=require(_0x7f7b('0x7'));var client=jayson['client'][_0x7f7b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc90,_0x34ab3e,_0x43a424){return new BPromise(function(_0x7722ed,_0x452292){return client[_0x7f7b('0x9')](_0x1ccc90,_0x43a424)[_0x7f7b('0xa')](function(_0x43e3bc){logger[_0x7f7b('0xb')](_0x7f7b('0xc'),_0x34ab3e,_0x7f7b('0xd'));logger[_0x7f7b('0xe')](_0x7f7b('0xf'),_0x34ab3e,_0x7f7b('0xd'),JSON[_0x7f7b('0x10')](_0x43e3bc));if(_0x43e3bc[_0x7f7b('0x11')]){if(_0x43e3bc[_0x7f7b('0x11')][_0x7f7b('0x12')]===0x1f4){logger[_0x7f7b('0x11')]('Trigger,\x20%s,\x20%s',_0x34ab3e,_0x43e3bc['error'][_0x7f7b('0x13')]);return _0x452292(_0x43e3bc[_0x7f7b('0x11')]['message']);}logger[_0x7f7b('0x11')](_0x7f7b('0xc'),_0x34ab3e,_0x43e3bc[_0x7f7b('0x11')][_0x7f7b('0x13')]);return _0x7722ed(_0x43e3bc['error'][_0x7f7b('0x13')]);}else{logger['info'](_0x7f7b('0xc'),_0x34ab3e,_0x7f7b('0xd'));_0x7722ed(_0x43e3bc['result'][_0x7f7b('0x13')]);}})[_0x7f7b('0x14')](function(_0x371ec8){logger[_0x7f7b('0x11')](_0x7f7b('0xc'),_0x34ab3e,_0x371ec8);_0x452292(_0x371ec8);});});}exports['GetTrigger']=function(_0x408bc9){var _0x23ec11=this;return new Promise(function(_0x354b2e,_0x5eb1f1){return db[_0x7f7b('0x15')]['findAll']({'raw':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x17')]===undefined?!![]:![]:!![],'where':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x18')]||null:null,'attributes':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x19')]||null:null,'limit':_0x408bc9[_0x7f7b('0x16')]?_0x408bc9[_0x7f7b('0x16')]['limit']||null:null,'include':_0x408bc9['options']?_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x408bc9[_0x7f7b('0x16')][_0x7f7b('0x1a')],function(_0xf7c9cc){return{'model':db[_0xf7c9cc['model']],'as':_0xf7c9cc['as'],'attributes':_0xf7c9cc[_0x7f7b('0x19')],'include':_0xf7c9cc[_0x7f7b('0x1a')]?_['map'](_0xf7c9cc['include'],function(_0x33e7c9){return{'model':db[_0x33e7c9['model']],'as':_0x33e7c9['as'],'attributes':_0x33e7c9['attributes'],'include':_0x33e7c9[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x33e7c9[_0x7f7b('0x1a')],function(_0x4166d2){return{'model':db[_0x4166d2[_0x7f7b('0x1c')]],'as':_0x4166d2['as'],'attributes':_0x4166d2[_0x7f7b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7f7b('0xa')](function(_0x443674){logger['info'](_0x7f7b('0x1d'),_0x408bc9);logger[_0x7f7b('0xe')](_0x7f7b('0x1d'),_0x408bc9,JSON['stringify'](_0x443674));_0x354b2e(_0x443674);})[_0x7f7b('0x14')](function(_0xa66916){logger['error'](_0x7f7b('0x1d'),_0xa66916[_0x7f7b('0x13')],_0x408bc9);_0x5eb1f1(_0x23ec11[_0x7f7b('0x11')](0x1f4,_0xa66916[_0x7f7b('0x13')]));});});};exports[_0x7f7b('0x1e')]=function(_0x38f5fa){var _0x2fd8b3=this;return new Promise(function(_0x1ab118,_0x1ae2fa){return db[_0x7f7b('0x15')]['find']({'raw':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x17')]===undefined?!![]:![]:!![],'where':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa['options']['where']||null:null,'attributes':_0x38f5fa['options']?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x19')]||null:null,'include':_0x38f5fa[_0x7f7b('0x16')]?_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x1a')]?_['map'](_0x38f5fa[_0x7f7b('0x16')][_0x7f7b('0x1a')],function(_0x576d81){return{'model':db[_0x576d81[_0x7f7b('0x1c')]],'as':_0x576d81['as'],'attributes':_0x576d81[_0x7f7b('0x19')],'include':_0x576d81[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0x576d81[_0x7f7b('0x1a')],function(_0xd41893){return{'model':db[_0xd41893['model']],'as':_0xd41893['as'],'attributes':_0xd41893[_0x7f7b('0x19')],'include':_0xd41893[_0x7f7b('0x1a')]?_[_0x7f7b('0x1b')](_0xd41893[_0x7f7b('0x1a')],function(_0x556e92){return{'model':db[_0x556e92[_0x7f7b('0x1c')]],'as':_0x556e92['as'],'attributes':_0x556e92[_0x7f7b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7f7b('0xa')](function(_0x336cd8){logger[_0x7f7b('0xb')](_0x7f7b('0x1e'),_0x38f5fa);logger[_0x7f7b('0xe')]('ShowTrigger',_0x38f5fa,JSON[_0x7f7b('0x10')](_0x336cd8));_0x1ab118(_0x336cd8);})[_0x7f7b('0x14')](function(_0x153382){logger[_0x7f7b('0x11')]('ShowTrigger',_0x153382['message'],_0x38f5fa);_0x1ae2fa(_0x2fd8b3['error'](0x1f4,_0x153382['message']));});});};
\ No newline at end of file
+var _0x626c=['result','catch','GetTrigger','findAll','options','limit','include','map','model','attributes','Trigger','find','ShowTrigger','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x455953,_0x2ee57d){var _0x2d7d6b=function(_0x1453b7){while(--_0x1453b7){_0x455953['push'](_0x455953['shift']());}};_0x2d7d6b(++_0x2ee57d);}(_0x626c,0x143));var _0xc626=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x626c[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0xc626('0x0'));var moment=require(_0xc626('0x1'));var BPromise=require(_0xc626('0x2'));var rs=require(_0xc626('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc626('0x4'));var logger=require(_0xc626('0x5'))('rpc');var config=require(_0xc626('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc626('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe67ee,_0x5bc22e,_0x3c324a){return new BPromise(function(_0x3be599,_0x27d221){return client['request'](_0xfe67ee,_0x3c324a)[_0xc626('0x8')](function(_0x1fffd2){logger[_0xc626('0x9')](_0xc626('0xa'),_0x5bc22e,_0xc626('0xb'));logger[_0xc626('0xc')](_0xc626('0xd'),_0x5bc22e,_0xc626('0xb'),JSON[_0xc626('0xe')](_0x1fffd2));if(_0x1fffd2[_0xc626('0xf')]){if(_0x1fffd2[_0xc626('0xf')][_0xc626('0x10')]===0x1f4){logger[_0xc626('0xf')](_0xc626('0xa'),_0x5bc22e,_0x1fffd2['error'][_0xc626('0x11')]);return _0x27d221(_0x1fffd2[_0xc626('0xf')]['message']);}logger[_0xc626('0xf')](_0xc626('0xa'),_0x5bc22e,_0x1fffd2[_0xc626('0xf')]['message']);return _0x3be599(_0x1fffd2['error']['message']);}else{logger[_0xc626('0x9')](_0xc626('0xa'),_0x5bc22e,_0xc626('0xb'));_0x3be599(_0x1fffd2[_0xc626('0x12')][_0xc626('0x11')]);}})[_0xc626('0x13')](function(_0x4c2af5){logger[_0xc626('0xf')]('Trigger,\x20%s,\x20%s',_0x5bc22e,_0x4c2af5);_0x27d221(_0x4c2af5);});});}exports[_0xc626('0x14')]=function(_0x89eb05){var _0x2484d3=this;return new Promise(function(_0x77e570,_0x7df602){return db['Trigger'][_0xc626('0x15')]({'raw':_0x89eb05[_0xc626('0x16')]?_0x89eb05[_0xc626('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x89eb05[_0xc626('0x16')]?_0x89eb05[_0xc626('0x16')]['where']||null:null,'attributes':_0x89eb05[_0xc626('0x16')]?_0x89eb05['options']['attributes']||null:null,'limit':_0x89eb05[_0xc626('0x16')]?_0x89eb05[_0xc626('0x16')][_0xc626('0x17')]||null:null,'include':_0x89eb05[_0xc626('0x16')]?_0x89eb05['options'][_0xc626('0x18')]?_[_0xc626('0x19')](_0x89eb05[_0xc626('0x16')][_0xc626('0x18')],function(_0x579539){return{'model':db[_0x579539[_0xc626('0x1a')]],'as':_0x579539['as'],'attributes':_0x579539[_0xc626('0x1b')],'include':_0x579539['include']?_['map'](_0x579539[_0xc626('0x18')],function(_0x2217a0){return{'model':db[_0x2217a0[_0xc626('0x1a')]],'as':_0x2217a0['as'],'attributes':_0x2217a0['attributes'],'include':_0x2217a0['include']?_[_0xc626('0x19')](_0x2217a0[_0xc626('0x18')],function(_0x55cb3b){return{'model':db[_0x55cb3b[_0xc626('0x1a')]],'as':_0x55cb3b['as'],'attributes':_0x55cb3b[_0xc626('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x565fb2){logger[_0xc626('0x9')]('GetTrigger',_0x89eb05);logger[_0xc626('0xc')]('GetTrigger',_0x89eb05,JSON[_0xc626('0xe')](_0x565fb2));_0x77e570(_0x565fb2);})[_0xc626('0x13')](function(_0x3c381e){logger['error'](_0xc626('0x14'),_0x3c381e[_0xc626('0x11')],_0x89eb05);_0x7df602(_0x2484d3[_0xc626('0xf')](0x1f4,_0x3c381e['message']));});});};exports['ShowTrigger']=function(_0x36ab8b){var _0x3731cb=this;return new Promise(function(_0x4f8a2d,_0x2a7380){return db[_0xc626('0x1c')][_0xc626('0x1d')]({'raw':_0x36ab8b[_0xc626('0x16')]?_0x36ab8b[_0xc626('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x36ab8b[_0xc626('0x16')]?_0x36ab8b[_0xc626('0x16')]['where']||null:null,'attributes':_0x36ab8b[_0xc626('0x16')]?_0x36ab8b[_0xc626('0x16')][_0xc626('0x1b')]||null:null,'include':_0x36ab8b[_0xc626('0x16')]?_0x36ab8b[_0xc626('0x16')][_0xc626('0x18')]?_[_0xc626('0x19')](_0x36ab8b['options'][_0xc626('0x18')],function(_0x1e75e2){return{'model':db[_0x1e75e2[_0xc626('0x1a')]],'as':_0x1e75e2['as'],'attributes':_0x1e75e2[_0xc626('0x1b')],'include':_0x1e75e2[_0xc626('0x18')]?_[_0xc626('0x19')](_0x1e75e2[_0xc626('0x18')],function(_0x3eb30c){return{'model':db[_0x3eb30c[_0xc626('0x1a')]],'as':_0x3eb30c['as'],'attributes':_0x3eb30c[_0xc626('0x1b')],'include':_0x3eb30c[_0xc626('0x18')]?_[_0xc626('0x19')](_0x3eb30c[_0xc626('0x18')],function(_0x298d05){return{'model':db[_0x298d05[_0xc626('0x1a')]],'as':_0x298d05['as'],'attributes':_0x298d05[_0xc626('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c079f){logger[_0xc626('0x9')](_0xc626('0x1e'),_0x36ab8b);logger[_0xc626('0xc')](_0xc626('0x1e'),_0x36ab8b,JSON['stringify'](_0x3c079f));_0x4f8a2d(_0x3c079f);})[_0xc626('0x13')](function(_0x53e6b4){logger[_0xc626('0xf')](_0xc626('0x1e'),_0x53e6b4['message'],_0x36ab8b);_0x2a7380(_0x3731cb[_0xc626('0xf')](0x1f4,_0x53e6b4[_0xc626('0x11')]));});});};
\ No newline at end of file
index 7191e6b..7a71f7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1af=['show','post','/:id/clone','clone','put','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x523bb2,_0x331d0d){var _0x2bca92=function(_0x3f5a6f){while(--_0x3f5a6f){_0x523bb2['push'](_0x523bb2['shift']());}};_0x2bca92(++_0x331d0d);}(_0xc1af,0x79));var _0xfc1a=function(_0x4d9b8b,_0x17724d){_0x4d9b8b=_0x4d9b8b-0x0;var _0x16bc6b=_0xc1af[_0x4d9b8b];return _0x16bc6b;};'use strict';var multer=require('multer');var util=require(_0xfc1a('0x0'));var path=require(_0xfc1a('0x1'));var timeout=require(_0xfc1a('0x2'));var express=require(_0xfc1a('0x3'));var router=express[_0xfc1a('0x4')]();var fs_extra=require(_0xfc1a('0x5'));var auth=require(_0xfc1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xfc1a('0x7'));var controller=require('./trunk.controller');router[_0xfc1a('0x8')]('/',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xa')]);router['get'](_0xfc1a('0xb'),auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xc')]);router[_0xfc1a('0xd')](_0xfc1a('0xe'),auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfc1a('0x10')](_0xfc1a('0xb'),auth['isAuthenticated'](),controller[_0xfc1a('0x11')]);router['delete']('/:id',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x59f7=['destroy','multer','util','Router','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','show','post','clone','create','put','update','/:id'];(function(_0x1dc75e,_0x331455){var _0x4f7357=function(_0x5ad057){while(--_0x5ad057){_0x1dc75e['push'](_0x1dc75e['shift']());}};_0x4f7357(++_0x331455);}(_0x59f7,0x1aa));var _0x759f=function(_0x4dd3ed,_0x4baa4f){_0x4dd3ed=_0x4dd3ed-0x0;var _0x130883=_0x59f7[_0x4dd3ed];return _0x130883;};'use strict';var multer=require(_0x759f('0x0'));var util=require(_0x759f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x759f('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x759f('0x3'));var config=require(_0x759f('0x4'));var controller=require(_0x759f('0x5'));router['get']('/',auth[_0x759f('0x6')](),controller[_0x759f('0x7')]);router[_0x759f('0x8')]('/:id',auth[_0x759f('0x6')](),controller[_0x759f('0x9')]);router[_0x759f('0xa')]('/:id/clone',auth[_0x759f('0x6')](),controller[_0x759f('0xb')]);router[_0x759f('0xa')]('/',auth[_0x759f('0x6')](),controller[_0x759f('0xc')]);router[_0x759f('0xd')]('/:id',auth[_0x759f('0x6')](),controller[_0x759f('0xe')]);router['delete'](_0x759f('0xf'),auth[_0x759f('0x6')](),controller[_0x759f('0x10')]);module['exports']=router;
\ No newline at end of file
index 269b56e..72c4599 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b52=['outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','refuse','originate','uac','uas','pai','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name','friend','user','peer','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat'];(function(_0xb5ec2e,_0x539083){var _0x37de36=function(_0x4d8f53){while(--_0x4d8f53){_0xb5ec2e['push'](_0xb5ec2e['shift']());}};_0x37de36(++_0x539083);}(_0x0b52,0x1e4));var _0x20b5=function(_0x168457,_0x56d669){_0x168457=_0x168457-0x0;var _0x22d916=_0x0b52[_0x168457];return _0x22d916;};'use strict';var Sequelize=require(_0x20b5('0x0'));module['exports']={'name':{'type':Sequelize[_0x20b5('0x1')],'allowNull':![],'unique':_0x20b5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x20b5('0x3'),_0x20b5('0x4'),_0x20b5('0x5')),'allowNull':![],'defaultValue':_0x20b5('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x20b5('0x6')},'callingpres':{'type':Sequelize[_0x20b5('0x7')]('ALLOWED_NOT_SCREENED',_0x20b5('0x8'),_0x20b5('0x9'),'ALLOWED',_0x20b5('0xa'),_0x20b5('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x20b5('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x20b5('0x1')]},'remotesecret':{'type':Sequelize[_0x20b5('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x20b5('0xc'),'set':function(_0x1cbde1){this[_0x20b5('0xd')](_0x20b5('0xe'),_0x1cbde1?_0x1cbde1[_0x20b5('0xf')](','):null);},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0xe'))?this[_0x20b5('0x10')](_0x20b5('0xe'))[_0x20b5('0x11')](','):null;},'comment':_0x20b5('0x12')},'dtmfmode':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x13'),_0x20b5('0x14'),_0x20b5('0x15'),_0x20b5('0x16'),_0x20b5('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x19'),'update',_0x20b5('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x20b5('0x1')]},'directmediadeny':{'type':Sequelize[_0x20b5('0x1')]},'nat':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x1b'),'set':function(_0x1e0a2e){this['setDataValue'](_0x20b5('0x1c'),_0x1e0a2e?_0x1e0a2e[_0x20b5('0xf')](','):null);},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0x1c'))?this[_0x20b5('0x10')](_0x20b5('0x1c'))['split'](','):null;},'comment':_0x20b5('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x20b5('0x1')]},'pickupgroup':{'type':Sequelize[_0x20b5('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x20b5('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x1e')},'allow':{'type':Sequelize[_0x20b5('0x1')],'allowNull':![],'defaultValue':_0x20b5('0x1f'),'set':function(_0x44613b){this[_0x20b5('0xd')](_0x20b5('0x20'),_0x44613b?_0x44613b['join'](';'):_0x20b5('0x1f'));},'get':function(){return this[_0x20b5('0x10')](_0x20b5('0x20'))?this[_0x20b5('0x10')](_0x20b5('0x20'))['split'](';'):null;},'comment':_0x20b5('0x21')},'autoframing':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x20b5('0x22'),'set':function(_0x1292e4){this[_0x20b5('0xd')]('insecure',_0x1292e4?_0x1292e4['join'](','):null);},'get':function(){return this['getDataValue'](_0x20b5('0x23'))?this[_0x20b5('0x10')](_0x20b5('0x23'))[_0x20b5('0x11')](','):null;},'comment':_0x20b5('0x24')},'trustrpid':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x25'))},'promiscredir':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'accountcode':{'type':Sequelize[_0x20b5('0x26')](0xb)},'setvar':{'type':Sequelize[_0x20b5('0x1')]},'callerid':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x27')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x20b5('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x20b5('0x1')]},'template':{'type':Sequelize[_0x20b5('0x1')]},'videosupport':{'type':Sequelize[_0x20b5('0x7')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x20b5('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'mailbox':{'type':Sequelize[_0x20b5('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x20b5('0x28'),_0x20b5('0x29'))},'session_expires':{'type':Sequelize[_0x20b5('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x20b5('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x2a'),_0x20b5('0x2b')),'defaultValue':_0x20b5('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x20b5('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x20b5('0x1')]},'fromuser':{'type':Sequelize[_0x20b5('0x1')]},'port':{'type':Sequelize[_0x20b5('0x26')](0x5)},'qualify':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no'),'defaultValue':_0x20b5('0x18')},'keepalive':{'type':Sequelize[_0x20b5('0x26')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x20b5('0x1')]},'rtptimeout':{'type':Sequelize[_0x20b5('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x20b5('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x20b5('0x1')]},'callbackextension':{'type':Sequelize[_0x20b5('0x1')]},'timert1':{'type':Sequelize[_0x20b5('0x26')](0xb)},'timerb':{'type':Sequelize[_0x20b5('0x26')](0xb)},'qualifyfreq':{'type':Sequelize[_0x20b5('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x20b5('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x20b5('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x20b5('0x1')]},'maxforwards':{'type':Sequelize[_0x20b5('0x26')](0xb)},'encryption':{'type':Sequelize[_0x20b5('0x7')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x20b5('0x7')]('yes','no')},'force_avp':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'icesupport':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x20b5('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x20b5('0x1')]},'dtlscafile':{'type':Sequelize[_0x20b5('0x1')]},'dtlscapath':{'type':Sequelize[_0x20b5('0x1')]},'dtlssetup':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x2d'),_0x20b5('0x2e'),_0x20b5('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x20b5('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x20b5('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x20b5('0x1')]},'call_limit':{'type':Sequelize[_0x20b5('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no')},'vmexten':{'type':Sequelize[_0x20b5('0x1')]},'mohinterpret':{'type':Sequelize[_0x20b5('0x1')]},'mohsuggest':{'type':Sequelize[_0x20b5('0x1')]},'parkinglot':{'type':Sequelize[_0x20b5('0x1')]},'description':{'type':Sequelize[_0x20b5('0x1')]},'host':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':_0x20b5('0x30')},'canreinvite':{'type':Sequelize[_0x20b5('0x7')](_0x20b5('0x18'),'no',_0x20b5('0x19'),'update',_0x20b5('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x20b5('0x1')]},'otherFields':{'type':Sequelize[_0x20b5('0x1')]},'active':{'type':Sequelize[_0x20b5('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x20b5('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xa5d1=['uac','uas','pai','fingerprint','active','passive','update','update,nonat','sequelize','STRING','ENUM','friend','user','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','rfc2833','info','inband','auto','yes','nonat','outgoing','force_rport,comedia','nat','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa5d1,0xac));var _0x1a5d=function(_0x10ac8d,_0x35b693){_0x10ac8d=_0x10ac8d-0x0;var _0x586c82=_0xa5d1[_0x10ac8d];return _0x586c82;};'use strict';var Sequelize=require(_0x1a5d('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a5d('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x3'),_0x1a5d('0x4'),_0x1a5d('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x1a5d('0x2')]('ALLOWED_NOT_SCREENED',_0x1a5d('0x6'),_0x1a5d('0x7'),'ALLOWED','PROHIB_NOT_SCREENED',_0x1a5d('0x8'),'PROHIB_FAILED_SCREEN',_0x1a5d('0x9'))},'deny':{'type':Sequelize[_0x1a5d('0x1')]},'permit':{'type':Sequelize[_0x1a5d('0x1')]},'secret':{'type':Sequelize[_0x1a5d('0x1')]},'md5secret':{'type':Sequelize[_0x1a5d('0x1')]},'remotesecret':{'type':Sequelize[_0x1a5d('0x1')]},'transport':{'type':Sequelize[_0x1a5d('0x1')],'defaultValue':_0x1a5d('0xa'),'set':function(_0x59d32d){this[_0x1a5d('0xb')](_0x1a5d('0xc'),_0x59d32d?_0x59d32d[_0x1a5d('0xd')](','):null);},'get':function(){return this[_0x1a5d('0xe')](_0x1a5d('0xc'))?this[_0x1a5d('0xe')](_0x1a5d('0xc'))[_0x1a5d('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x1a5d('0x10'),_0x1a5d('0x11'),'shortinfo',_0x1a5d('0x12'),_0x1a5d('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no',_0x1a5d('0x15'),'update',_0x1a5d('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x1a5d('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x1a5d('0x17'),'set':function(_0x110a20){this[_0x1a5d('0xb')](_0x1a5d('0x18'),_0x110a20?_0x110a20[_0x1a5d('0xd')](','):null);},'get':function(){return this[_0x1a5d('0xe')]('nat')?this[_0x1a5d('0xe')](_0x1a5d('0x18'))[_0x1a5d('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1a5d('0x1')]},'namedcallgroup':{'type':Sequelize[_0x1a5d('0x1')]},'pickupgroup':{'type':Sequelize[_0x1a5d('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x1a5d('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1a5d('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x1a5d('0x19')},'allow':{'type':Sequelize[_0x1a5d('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x5a56ab){this[_0x1a5d('0xb')](_0x1a5d('0x1a'),_0x5a56ab?_0x5a56ab[_0x1a5d('0xd')](';'):_0x1a5d('0x1b'));},'get':function(){return this['getDataValue'](_0x1a5d('0x1a'))?this[_0x1a5d('0xe')](_0x1a5d('0x1a'))[_0x1a5d('0xf')](';'):null;},'comment':_0x1a5d('0x1c')},'autoframing':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'insecure':{'type':Sequelize[_0x1a5d('0x1')],'defaultValue':'port,invite','set':function(_0x437c92){this[_0x1a5d('0xb')](_0x1a5d('0x1d'),_0x437c92?_0x437c92[_0x1a5d('0xd')](','):null);},'get':function(){return this[_0x1a5d('0xe')](_0x1a5d('0x1d'))?this['getDataValue'](_0x1a5d('0x1d'))[_0x1a5d('0xf')](','):null;},'comment':_0x1a5d('0x1e')},'trustrpid':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x1a5d('0x1')]},'callerid':{'type':Sequelize[_0x1a5d('0x1')],'defaultValue':_0x1a5d('0x1f')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x1a5d('0x2')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0x1a5d('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no')},'subscribecontext':{'type':Sequelize[_0x1a5d('0x1')]},'template':{'type':Sequelize[_0x1a5d('0x1')]},'videosupport':{'type':Sequelize['ENUM']('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x1a5d('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x1a5d('0x1')]},'session_timers':{'type':Sequelize['ENUM']('accept','refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'session_refresher':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x21'),_0x1a5d('0x22')),'defaultValue':_0x1a5d('0x22')},'t38pt_usertpsource':{'type':Sequelize[_0x1a5d('0x1')]},'regexten':{'type':Sequelize[_0x1a5d('0x1')]},'fromdomain':{'type':Sequelize[_0x1a5d('0x1')]},'fromuser':{'type':Sequelize[_0x1a5d('0x1')]},'port':{'type':Sequelize[_0x1a5d('0x20')](0x5)},'qualify':{'type':Sequelize[_0x1a5d('0x2')]('yes','no'),'defaultValue':_0x1a5d('0x14')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x1a5d('0x1')]},'rtptimeout':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no',_0x1a5d('0x23')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x1a5d('0x1')]},'timert1':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'timerb':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'contactpermit':{'type':Sequelize[_0x1a5d('0x1')]},'contactdeny':{'type':Sequelize[_0x1a5d('0x1')]},'contactacl':{'type':Sequelize[_0x1a5d('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x1a5d('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'encryption':{'type':Sequelize[_0x1a5d('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no')},'icesupport':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no',_0x1a5d('0x24'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x1a5d('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x1a5d('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x1a5d('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x1a5d('0x1')]},'dtlscapath':{'type':Sequelize[_0x1a5d('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1a5d('0x25'),_0x1a5d('0x26'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1a5d('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0x1a5d('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1a5d('0x1')]},'recordofffeature':{'type':Sequelize[_0x1a5d('0x1')]},'call_limit':{'type':Sequelize[_0x1a5d('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0x1a5d('0x2')]('yes','no')},'vmexten':{'type':Sequelize[_0x1a5d('0x1')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x1a5d('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a5d('0x1')]},'host':{'type':Sequelize[_0x1a5d('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x1a5d('0x2')](_0x1a5d('0x14'),'no',_0x1a5d('0x15'),_0x1a5d('0x27'),_0x1a5d('0x28')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x1a5d('0x1')]},'otherFields':{'type':Sequelize[_0x1a5d('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x1a5d('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index 10dc108..055496c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x283ff1,_0x5ecb57){var _0x480f7d=function(_0x131f70){while(--_0x131f70){_0x283ff1['push'](_0x283ff1['shift']());}};_0x480f7d(++_0x5ecb57);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2bd5ff,_0xfe80a5){_0x2bd5ff=_0x2bd5ff-0x0;var _0x5e1694=_0xd6d6[_0x2bd5ff];return _0x5e1694;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));};
\ No newline at end of file
+var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x454cf6,_0x381dda){var _0xef9120=function(_0x1c5025){while(--_0x1c5025){_0x454cf6['push'](_0x454cf6['shift']());}};_0xef9120(++_0x381dda);}(_0x425d,0x1e0));var _0xd425=function(_0x4287bd,_0x4b6c73){_0x4287bd=_0x4287bd-0x0;var _0x7a7d4b=_0x425d[_0x4287bd];return _0x7a7d4b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));};
\ No newline at end of file
index 78c135c..7fc5a68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d0=['exports','define','Trunk','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x4a13db,_0x912364){var _0x3bdc9e=function(_0x2f3ed9){while(--_0x2f3ed9){_0x4a13db['push'](_0x4a13db['shift']());}};_0x3bdc9e(++_0x912364);}(_0xa3d0,0x1b3));var _0x0a3d=function(_0x4b6cbf,_0x3bb242){_0x4b6cbf=_0x4b6cbf-0x0;var _0x1d84bf=_0xa3d0[_0x4b6cbf];return _0x1d84bf;};'use strict';var _=require(_0x0a3d('0x0'));var util=require('util');var logger=require(_0x0a3d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0a3d('0x2'));var fs=require('fs');var path=require(_0x0a3d('0x3'));var rimraf=require(_0x0a3d('0x4'));var config=require(_0x0a3d('0x5'));var attributes=require('./trunk.attributes');module[_0x0a3d('0x6')]=function(_0x196822,_0x15ac33){return _0x196822[_0x0a3d('0x7')](_0x0a3d('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e60=['bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','tools_trunks','util','../../config/logger','api','moment'];(function(_0x56c775,_0x5f3444){var _0x1ee287=function(_0x1655ed){while(--_0x1655ed){_0x56c775['push'](_0x56c775['shift']());}};_0x1ee287(++_0x5f3444);}(_0x3e60,0x158));var _0x03e6=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x3e60[_0x152fe3];return _0xc5bb39;};'use strict';var _=require('lodash');var util=require(_0x03e6('0x0'));var logger=require(_0x03e6('0x1'))(_0x03e6('0x2'));var moment=require(_0x03e6('0x3'));var BPromise=require(_0x03e6('0x4'));var rp=require(_0x03e6('0x5'));var fs=require('fs');var path=require(_0x03e6('0x6'));var rimraf=require(_0x03e6('0x7'));var config=require(_0x03e6('0x8'));var attributes=require(_0x03e6('0x9'));module['exports']=function(_0x46c271,_0x1059b6){return _0x46c271[_0x03e6('0xa')]('Trunk',attributes,{'tableName':_0x03e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5de1aa..2e911fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaef=['rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','map','include','model','find','info','ShowTrunk','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaaef,0x1da));var _0xfaae=function(_0x489a1c,_0x166e23){_0x489a1c=_0x489a1c-0x0;var _0x207f0f=_0xaaef[_0x489a1c];return _0x207f0f;};'use strict';var _=require(_0xfaae('0x0'));var util=require(_0xfaae('0x1'));var moment=require(_0xfaae('0x2'));var BPromise=require(_0xfaae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfaae('0x4'))['db'];var utils=require(_0xfaae('0x5'));var logger=require(_0xfaae('0x6'))(_0xfaae('0x7'));var config=require(_0xfaae('0x8'));var jayson=require(_0xfaae('0x9'));var client=jayson[_0xfaae('0xa')][_0xfaae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b2b0,_0x41eb3b,_0x4b9c46){return new BPromise(function(_0x2eb982,_0xbb4711){return client[_0xfaae('0xc')](_0x42b2b0,_0x4b9c46)[_0xfaae('0xd')](function(_0x153d5d){logger['info'](_0xfaae('0xe'),_0x41eb3b,_0xfaae('0xf'));logger[_0xfaae('0x10')](_0xfaae('0x11'),_0x41eb3b,_0xfaae('0xf'),JSON[_0xfaae('0x12')](_0x153d5d));if(_0x153d5d[_0xfaae('0x13')]){if(_0x153d5d[_0xfaae('0x13')]['code']===0x1f4){logger[_0xfaae('0x13')](_0xfaae('0xe'),_0x41eb3b,_0x153d5d[_0xfaae('0x13')]['message']);return _0xbb4711(_0x153d5d[_0xfaae('0x13')][_0xfaae('0x14')]);}logger['error'](_0xfaae('0xe'),_0x41eb3b,_0x153d5d[_0xfaae('0x13')]['message']);return _0x2eb982(_0x153d5d[_0xfaae('0x13')][_0xfaae('0x14')]);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x41eb3b,'request\x20sent');_0x2eb982(_0x153d5d[_0xfaae('0x15')]['message']);}})[_0xfaae('0x16')](function(_0xec2fd8){logger['error']('Trunk,\x20%s,\x20%s',_0x41eb3b,_0xec2fd8);_0xbb4711(_0xec2fd8);});});}exports[_0xfaae('0x17')]=function(_0x5b5e54){var _0x5cef1d=this;return new Promise(function(_0x5ee078,_0xb43dc0){return db[_0xfaae('0x18')][_0xfaae('0x19')]({'raw':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x1b')]===undefined?!![]:![]:!![],'where':_0x5b5e54['options']?_0x5b5e54['options'][_0xfaae('0x1c')]||null:null,'attributes':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54['options'][_0xfaae('0x1d')]||null:null,'limit':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x1e')]||null:null,'include':_0x5b5e54[_0xfaae('0x1a')]?_0x5b5e54['options']['include']?_[_0xfaae('0x1f')](_0x5b5e54[_0xfaae('0x1a')][_0xfaae('0x20')],function(_0x277c1c){return{'model':db[_0x277c1c[_0xfaae('0x21')]],'as':_0x277c1c['as'],'attributes':_0x277c1c[_0xfaae('0x1d')],'include':_0x277c1c[_0xfaae('0x20')]?_[_0xfaae('0x1f')](_0x277c1c[_0xfaae('0x20')],function(_0x31d8d4){return{'model':db[_0x31d8d4[_0xfaae('0x21')]],'as':_0x31d8d4['as'],'attributes':_0x31d8d4[_0xfaae('0x1d')],'include':_0x31d8d4['include']?_[_0xfaae('0x1f')](_0x31d8d4[_0xfaae('0x20')],function(_0x1c5f30){return{'model':db[_0x1c5f30[_0xfaae('0x21')]],'as':_0x1c5f30['as'],'attributes':_0x1c5f30['attributes']};}):[]};}):[]};}):[]:[]})[_0xfaae('0xd')](function(_0xc831f5){logger['info']('GetTrunk',_0x5b5e54);logger[_0xfaae('0x10')](_0xfaae('0x17'),_0x5b5e54,JSON['stringify'](_0xc831f5));_0x5ee078(_0xc831f5);})[_0xfaae('0x16')](function(_0x23186d){logger[_0xfaae('0x13')](_0xfaae('0x17'),_0x23186d[_0xfaae('0x14')],_0x5b5e54);_0xb43dc0(_0x5cef1d[_0xfaae('0x13')](0x1f4,_0x23186d[_0xfaae('0x14')]));});});};exports['ShowTrunk']=function(_0x5bd3a3){var _0x3bb3e8=this;return new Promise(function(_0x47e264,_0x1018a9){return db[_0xfaae('0x18')][_0xfaae('0x22')]({'raw':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3['options'][_0xfaae('0x1b')]===undefined?!![]:![]:!![],'where':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')][_0xfaae('0x1c')]||null:null,'attributes':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')]['attributes']||null:null,'include':_0x5bd3a3[_0xfaae('0x1a')]?_0x5bd3a3[_0xfaae('0x1a')]['include']?_['map'](_0x5bd3a3[_0xfaae('0x1a')]['include'],function(_0x5348cf){return{'model':db[_0x5348cf[_0xfaae('0x21')]],'as':_0x5348cf['as'],'attributes':_0x5348cf[_0xfaae('0x1d')],'include':_0x5348cf['include']?_[_0xfaae('0x1f')](_0x5348cf[_0xfaae('0x20')],function(_0x2cb2a9){return{'model':db[_0x2cb2a9['model']],'as':_0x2cb2a9['as'],'attributes':_0x2cb2a9[_0xfaae('0x1d')],'include':_0x2cb2a9['include']?_[_0xfaae('0x1f')](_0x2cb2a9[_0xfaae('0x20')],function(_0x5181ab){return{'model':db[_0x5181ab['model']],'as':_0x5181ab['as'],'attributes':_0x5181ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30d0ed){logger[_0xfaae('0x23')](_0xfaae('0x24'),_0x5bd3a3);logger[_0xfaae('0x10')](_0xfaae('0x24'),_0x5bd3a3,JSON[_0xfaae('0x12')](_0x30d0ed));_0x47e264(_0x30d0ed);})[_0xfaae('0x16')](function(_0x6ece25){logger['error'](_0xfaae('0x24'),_0x6ece25['message'],_0x5bd3a3);_0x1018a9(_0x3bb3e8[_0xfaae('0x13')](0x1f4,_0x6ece25[_0xfaae('0x14')]));});});};
\ No newline at end of file
+var _0x645a=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','map','model','include','ShowTrunk','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x38bd64,_0x31ec19){var _0x467bab=function(_0x3311bc){while(--_0x3311bc){_0x38bd64['push'](_0x38bd64['shift']());}};_0x467bab(++_0x31ec19);}(_0x645a,0x171));var _0xa645=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x645a[_0xaaf2e2];return _0x28bc36;};'use strict';var _=require(_0xa645('0x0'));var util=require(_0xa645('0x1'));var moment=require(_0xa645('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa645('0x3'))['db'];var utils=require(_0xa645('0x4'));var logger=require('../../config/logger')(_0xa645('0x5'));var config=require(_0xa645('0x6'));var jayson=require(_0xa645('0x7'));var client=jayson[_0xa645('0x8')][_0xa645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x456dd9,_0xb3be0,_0x269e6a){return new BPromise(function(_0x27aa1a,_0x12fa82){return client[_0xa645('0xa')](_0x456dd9,_0x269e6a)[_0xa645('0xb')](function(_0x279e5f){logger[_0xa645('0xc')](_0xa645('0xd'),_0xb3be0,_0xa645('0xe'));logger[_0xa645('0xf')](_0xa645('0x10'),_0xb3be0,_0xa645('0xe'),JSON[_0xa645('0x11')](_0x279e5f));if(_0x279e5f['error']){if(_0x279e5f[_0xa645('0x12')][_0xa645('0x13')]===0x1f4){logger['error'](_0xa645('0xd'),_0xb3be0,_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);return _0x12fa82(_0x279e5f['error'][_0xa645('0x14')]);}logger['error']('Trunk,\x20%s,\x20%s',_0xb3be0,_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);return _0x27aa1a(_0x279e5f[_0xa645('0x12')][_0xa645('0x14')]);}else{logger[_0xa645('0xc')](_0xa645('0xd'),_0xb3be0,_0xa645('0xe'));_0x27aa1a(_0x279e5f[_0xa645('0x15')]['message']);}})[_0xa645('0x16')](function(_0x273297){logger[_0xa645('0x12')](_0xa645('0xd'),_0xb3be0,_0x273297);_0x12fa82(_0x273297);});});}exports[_0xa645('0x17')]=function(_0x5151a8){var _0xedd8f8=this;return new Promise(function(_0x812844,_0x3fff0c){return db[_0xa645('0x18')]['findAll']({'raw':_0x5151a8['options']?_0x5151a8[_0xa645('0x19')][_0xa645('0x1a')]===undefined?!![]:![]:!![],'where':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')][_0xa645('0x1b')]||null:null,'attributes':_0x5151a8[_0xa645('0x19')]?_0x5151a8['options'][_0xa645('0x1c')]||null:null,'limit':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')][_0xa645('0x1d')]||null:null,'include':_0x5151a8[_0xa645('0x19')]?_0x5151a8[_0xa645('0x19')]['include']?_[_0xa645('0x1e')](_0x5151a8[_0xa645('0x19')]['include'],function(_0x2bb343){return{'model':db[_0x2bb343[_0xa645('0x1f')]],'as':_0x2bb343['as'],'attributes':_0x2bb343[_0xa645('0x1c')],'include':_0x2bb343[_0xa645('0x20')]?_[_0xa645('0x1e')](_0x2bb343[_0xa645('0x20')],function(_0x19b1d6){return{'model':db[_0x19b1d6['model']],'as':_0x19b1d6['as'],'attributes':_0x19b1d6[_0xa645('0x1c')],'include':_0x19b1d6['include']?_[_0xa645('0x1e')](_0x19b1d6['include'],function(_0x4dfda2){return{'model':db[_0x4dfda2[_0xa645('0x1f')]],'as':_0x4dfda2['as'],'attributes':_0x4dfda2[_0xa645('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa645('0xb')](function(_0xc79663){logger[_0xa645('0xc')](_0xa645('0x17'),_0x5151a8);logger[_0xa645('0xf')](_0xa645('0x17'),_0x5151a8,JSON[_0xa645('0x11')](_0xc79663));_0x812844(_0xc79663);})[_0xa645('0x16')](function(_0x3c2a37){logger['error'](_0xa645('0x17'),_0x3c2a37[_0xa645('0x14')],_0x5151a8);_0x3fff0c(_0xedd8f8['error'](0x1f4,_0x3c2a37['message']));});});};exports[_0xa645('0x21')]=function(_0x15ef15){var _0x1ed60d=this;return new Promise(function(_0x48f317,_0x65aab0){return db[_0xa645('0x18')]['find']({'raw':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x1a')]===undefined?!![]:![]:!![],'where':_0x15ef15['options']?_0x15ef15[_0xa645('0x19')][_0xa645('0x1b')]||null:null,'attributes':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x1c')]||null:null,'include':_0x15ef15[_0xa645('0x19')]?_0x15ef15[_0xa645('0x19')][_0xa645('0x20')]?_[_0xa645('0x1e')](_0x15ef15[_0xa645('0x19')][_0xa645('0x20')],function(_0x224772){return{'model':db[_0x224772[_0xa645('0x1f')]],'as':_0x224772['as'],'attributes':_0x224772[_0xa645('0x1c')],'include':_0x224772['include']?_[_0xa645('0x1e')](_0x224772[_0xa645('0x20')],function(_0x4b39ea){return{'model':db[_0x4b39ea[_0xa645('0x1f')]],'as':_0x4b39ea['as'],'attributes':_0x4b39ea[_0xa645('0x1c')],'include':_0x4b39ea['include']?_[_0xa645('0x1e')](_0x4b39ea['include'],function(_0x2a8181){return{'model':db[_0x2a8181[_0xa645('0x1f')]],'as':_0x2a8181['as'],'attributes':_0x2a8181[_0xa645('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa645('0xb')](function(_0x5cda3f){logger[_0xa645('0xc')](_0xa645('0x21'),_0x15ef15);logger[_0xa645('0xf')]('ShowTrunk',_0x15ef15,JSON[_0xa645('0x11')](_0x5cda3f));_0x48f317(_0x5cda3f);})[_0xa645('0x16')](function(_0x26c3eb){logger[_0xa645('0x12')](_0xa645('0x21'),_0x26c3eb['message'],_0x15ef15);_0x65aab0(_0x1ed60d[_0xa645('0x12')](0x1f4,_0x26c3eb[_0xa645('0x14')]));});});};
\ No newline at end of file
index 37b4c5c..f9fda7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31e0=['getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','originalname','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','update','put','/:id/password','changePassword','removeQueues','destroy','removeChatInteractions','delete','removeMailInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','util','../../components/interaction/service','./user.controller','get','isAuthenticated','index','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x3a1a69,_0x469e8d){var _0x417be1=function(_0x4af948){while(--_0x4af948){_0x3a1a69['push'](_0x3a1a69['shift']());}};_0x417be1(++_0x469e8d);}(_0x31e0,0x1a2));var _0x031e=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x31e0[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require('multer');var util=require(_0x031e('0x0'));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('../../components/auth/service');var interaction=require(_0x031e('0x1'));var config=require('../../config/environment');var controller=require(_0x031e('0x2'));router[_0x031e('0x3')]('/',auth[_0x031e('0x4')](),controller[_0x031e('0x5')]);router[_0x031e('0x3')]('/describe',auth[_0x031e('0x4')](),controller[_0x031e('0x6')]);router[_0x031e('0x3')]('/whoami',auth[_0x031e('0x4')](),controller[_0x031e('0x7')]);router[_0x031e('0x3')](_0x031e('0x8'),auth[_0x031e('0x4')](),controller[_0x031e('0x9')]);router[_0x031e('0x3')](_0x031e('0xa'),auth[_0x031e('0x4')](),controller[_0x031e('0xb')]);router[_0x031e('0x3')](_0x031e('0xc'),controller['getAvatar']);router[_0x031e('0x3')](_0x031e('0xd'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x031e('0x4')](),controller[_0x031e('0xe')]);router['get'](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x10')]);router[_0x031e('0x3')](_0x031e('0x11'),auth['isAuthenticated'](),controller[_0x031e('0x12')]);router['get']('/:id/groups',auth[_0x031e('0x4')](),controller[_0x031e('0x13')]);router[_0x031e('0x3')](_0x031e('0x14'),auth[_0x031e('0x4')](),controller[_0x031e('0x15')]);router['get'](_0x031e('0x16'),auth[_0x031e('0x4')](),controller[_0x031e('0x17')]);router['get'](_0x031e('0x18'),auth[_0x031e('0x4')](),controller[_0x031e('0x19')]);router[_0x031e('0x3')]('/:id/openchannel/interactions',auth[_0x031e('0x4')](),controller[_0x031e('0x1a')]);router[_0x031e('0x3')](_0x031e('0x1b'),auth[_0x031e('0x4')](),controller['getMailInteractions']);router[_0x031e('0x3')](_0x031e('0x1c'),auth[_0x031e('0x4')](),controller[_0x031e('0x1d')]);router[_0x031e('0x3')](_0x031e('0x1e'),auth['isAuthenticated'](),controller[_0x031e('0x1f')]);router[_0x031e('0x3')]('/:id/whatsapp/interactions',auth[_0x031e('0x4')](),controller['getWhatsappInteractions']);router[_0x031e('0x3')](_0x031e('0x20'),auth[_0x031e('0x4')](),controller[_0x031e('0x21')]);router[_0x031e('0x3')](_0x031e('0x22'),auth[_0x031e('0x4')](),controller[_0x031e('0x23')]);router['get']('/:id/agents',auth[_0x031e('0x4')](),controller[_0x031e('0x24')]);router[_0x031e('0x3')]('/:id/prefixes',auth[_0x031e('0x4')](),controller[_0x031e('0x25')]);router[_0x031e('0x3')](_0x031e('0x26'),auth[_0x031e('0x4')](),controller[_0x031e('0x27')]);router[_0x031e('0x3')](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x29')]);router[_0x031e('0x3')](_0x031e('0x2a'),auth[_0x031e('0x4')](),controller[_0x031e('0x2b')]);router[_0x031e('0x3')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x031e('0x2c')]);router[_0x031e('0x3')]('/:id/chat_websites',auth[_0x031e('0x4')](),controller[_0x031e('0x2d')]);router[_0x031e('0x3')](_0x031e('0x2e'),auth[_0x031e('0x4')](),controller[_0x031e('0x2f')]);router[_0x031e('0x3')](_0x031e('0x30'),auth[_0x031e('0x4')](),controller[_0x031e('0x31')]);router['get'](_0x031e('0x32'),auth[_0x031e('0x4')](),controller[_0x031e('0x33')]);router[_0x031e('0x3')]('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0x031e('0x34')](_0x031e('0x35'),auth[_0x031e('0x4')](),controller[_0x031e('0x36')]);router['post']('/',auth[_0x031e('0x4')](),controller[_0x031e('0x37')]);router[_0x031e('0x34')]('/create_many',auth['isAuthenticated'](),controller[_0x031e('0x38')]);router[_0x031e('0x34')](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x39')]);var upload=multer({'storage':multer[_0x031e('0x3a')]({'destination':function(_0x534839,_0x4a1b05,_0x16726b){_0x16726b(null,path[_0x031e('0x3b')](config[_0x031e('0x3c')],_0x031e('0x3d')));},'filename':function(_0x5877ed,_0x11a554,_0x4cb53c){_0x4cb53c(null,util[_0x031e('0x3e')]('%s-%s',Date['now'](),_0x11a554[_0x031e('0x3f')]));}})});router[_0x031e('0x34')]('/:id/avatar',upload['single'](_0x031e('0x40')),controller[_0x031e('0x41')]);router[_0x031e('0x34')](_0x031e('0x42'),auth['isAuthenticated'](),controller[_0x031e('0x43')]);router['post'](_0x031e('0x44'),auth[_0x031e('0x4')](),controller[_0x031e('0x45')]);router[_0x031e('0x34')](_0x031e('0x46'),auth[_0x031e('0x4')](),controller[_0x031e('0x47')]);router[_0x031e('0x34')](_0x031e('0x48'),auth[_0x031e('0x4')](),controller['unpause']);router[_0x031e('0x34')]('/:id/teams',auth[_0x031e('0x4')](),controller[_0x031e('0x49')]);router[_0x031e('0x34')](_0x031e('0x4a'),auth['isAuthenticated'](),controller[_0x031e('0x4b')]);router[_0x031e('0x34')](_0x031e('0x4c'),auth[_0x031e('0x4')](),controller[_0x031e('0x4d')]);router['post'](_0x031e('0x4e'),auth[_0x031e('0x4')](),controller[_0x031e('0x4f')]);router[_0x031e('0x34')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x031e('0x34')](_0x031e('0x50'),auth[_0x031e('0x4')](),controller['addOpenchannelInteractions']);router[_0x031e('0x34')](_0x031e('0x51'),auth[_0x031e('0x4')](),controller[_0x031e('0x52')]);router['post']('/:id/fax_accounts',auth[_0x031e('0x4')](),controller[_0x031e('0x53')]);router['post'](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x54')]);router[_0x031e('0x34')](_0x031e('0x2a'),auth[_0x031e('0x4')](),controller['addOpenchannelAccounts']);router[_0x031e('0x34')](_0x031e('0x55'),auth[_0x031e('0x4')](),controller[_0x031e('0x56')]);router[_0x031e('0x34')](_0x031e('0x57'),auth[_0x031e('0x4')](),controller[_0x031e('0x58')]);router['post'](_0x031e('0x2e'),auth['isAuthenticated'](),controller[_0x031e('0x59')]);router[_0x031e('0x34')]('/:id/square_projects',auth[_0x031e('0x4')](),controller['addSquareProjects']);router[_0x031e('0x34')](_0x031e('0x5a'),auth[_0x031e('0x4')](),controller[_0x031e('0x5b')]);router['put'](_0x031e('0xa'),auth[_0x031e('0x4')](),controller[_0x031e('0x5c')]);router[_0x031e('0x5d')](_0x031e('0x5e'),auth['isAuthenticated'](),controller[_0x031e('0x5f')]);router['delete'](_0x031e('0xf'),auth[_0x031e('0x4')](),controller[_0x031e('0x60')]);router['delete'](_0x031e('0x20'),auth[_0x031e('0x4')](),controller['removeTeams']);router['delete']('/:id',auth[_0x031e('0x4')](),controller[_0x031e('0x61')]);router['delete'](_0x031e('0x4a'),auth['isAuthenticated'](),controller[_0x031e('0x62')]);router[_0x031e('0x63')](_0x031e('0x4c'),auth['isAuthenticated'](),controller[_0x031e('0x64')]);router['delete'](_0x031e('0x4e'),auth[_0x031e('0x4')](),controller['removeFaxInteractions']);router['delete'](_0x031e('0x65'),auth[_0x031e('0x4')](),controller['removeSmsInteractions']);router['delete'](_0x031e('0x50'),auth[_0x031e('0x4')](),controller[_0x031e('0x66')]);router[_0x031e('0x63')](_0x031e('0x51'),auth['isAuthenticated'](),controller[_0x031e('0x67')]);router[_0x031e('0x63')](_0x031e('0x26'),auth[_0x031e('0x4')](),controller[_0x031e('0x68')]);router[_0x031e('0x63')](_0x031e('0x28'),auth[_0x031e('0x4')](),controller[_0x031e('0x69')]);router[_0x031e('0x63')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0x031e('0x6a')]);router[_0x031e('0x63')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x031e('0x6b')]);router[_0x031e('0x63')](_0x031e('0x57'),auth[_0x031e('0x4')](),controller[_0x031e('0x6c')]);router[_0x031e('0x63')](_0x031e('0x2e'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x031e('0x63')](_0x031e('0x30'),auth[_0x031e('0x4')](),controller[_0x031e('0x6d')]);router[_0x031e('0x63')](_0x031e('0x5a'),auth[_0x031e('0x4')](),controller[_0x031e('0x6e')]);module['exports']=router;
\ No newline at end of file
+var _0xc074=['getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','root','format','%s-%s','now','originalname','single','file','/:id/login','login','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','update','put','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/whoami','isAuthenticated','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions'];(function(_0x9f2af9,_0x55141a){var _0x24aa62=function(_0x534fca){while(--_0x534fca){_0x9f2af9['push'](_0x9f2af9['shift']());}};_0x24aa62(++_0x55141a);}(_0xc074,0xcf));var _0x4c07=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xc074[_0x36c6eb];return _0x30675b;};'use strict';var multer=require(_0x4c07('0x0'));var util=require('util');var path=require(_0x4c07('0x1'));var timeout=require(_0x4c07('0x2'));var express=require(_0x4c07('0x3'));var router=express[_0x4c07('0x4')]();var fs_extra=require(_0x4c07('0x5'));var auth=require(_0x4c07('0x6'));var interaction=require(_0x4c07('0x7'));var config=require(_0x4c07('0x8'));var controller=require('./user.controller');router[_0x4c07('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4c07('0x9')](_0x4c07('0xa'),auth['isAuthenticated'](),controller[_0x4c07('0xb')]);router[_0x4c07('0x9')](_0x4c07('0xc'),auth[_0x4c07('0xd')](),controller[_0x4c07('0xe')]);router[_0x4c07('0x9')](_0x4c07('0xf'),auth['isAuthenticated'](),controller[_0x4c07('0x10')]);router[_0x4c07('0x9')](_0x4c07('0x11'),auth[_0x4c07('0xd')](),controller['show']);router[_0x4c07('0x9')](_0x4c07('0x12'),controller[_0x4c07('0x13')]);router[_0x4c07('0x9')](_0x4c07('0x14'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x15')]);router[_0x4c07('0x9')](_0x4c07('0x16'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x17')]);router['get'](_0x4c07('0x18'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x19')]);router['get'](_0x4c07('0x1a'),auth['isAuthenticated'](),controller[_0x4c07('0x1b')]);router[_0x4c07('0x9')](_0x4c07('0x1c'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x1d')]);router[_0x4c07('0x9')](_0x4c07('0x1e'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x1f')]);router[_0x4c07('0x9')](_0x4c07('0x20'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x21')]);router[_0x4c07('0x9')]('/:id/chat/interactions',auth[_0x4c07('0xd')](),controller[_0x4c07('0x22')]);router[_0x4c07('0x9')](_0x4c07('0x23'),auth['isAuthenticated'](),controller[_0x4c07('0x24')]);router[_0x4c07('0x9')](_0x4c07('0x25'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x26')]);router[_0x4c07('0x9')]('/:id/sms/interactions',auth[_0x4c07('0xd')](),controller[_0x4c07('0x27')]);router[_0x4c07('0x9')](_0x4c07('0x28'),auth['isAuthenticated'](),controller[_0x4c07('0x29')]);router[_0x4c07('0x9')](_0x4c07('0x2a'),auth['isAuthenticated'](),controller[_0x4c07('0x2b')]);router['get'](_0x4c07('0x2c'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x2d')]);router[_0x4c07('0x9')](_0x4c07('0x2e'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x2f')]);router['get'](_0x4c07('0x30'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x31')]);router[_0x4c07('0x9')](_0x4c07('0x32'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x33')]);router[_0x4c07('0x9')](_0x4c07('0x34'),auth['isAuthenticated'](),controller[_0x4c07('0x35')]);router[_0x4c07('0x9')](_0x4c07('0x36'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x37')]);router['get'](_0x4c07('0x38'),auth['isAuthenticated'](),controller[_0x4c07('0x39')]);router[_0x4c07('0x9')](_0x4c07('0x3a'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x3b')]);router[_0x4c07('0x9')](_0x4c07('0x3c'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x3d')]);router[_0x4c07('0x9')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x4c07('0x3e')]);router[_0x4c07('0x9')](_0x4c07('0x3f'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x40')]);router['get'](_0x4c07('0x41'),auth['isAuthenticated'](),controller[_0x4c07('0x42')]);router[_0x4c07('0x9')](_0x4c07('0x43'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x44')]);router[_0x4c07('0x45')](_0x4c07('0x16'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x46')]);router[_0x4c07('0x45')]('/',auth[_0x4c07('0xd')](),controller[_0x4c07('0x47')]);router[_0x4c07('0x45')](_0x4c07('0x48'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x49')]);router['post'](_0x4c07('0x18'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x4c07('0x4a')]({'destination':function(_0x44da04,_0xfa81a5,_0x5842ad){_0x5842ad(null,path['join'](config[_0x4c07('0x4b')],'server/files/images/'));},'filename':function(_0x5c5b24,_0x59e6f9,_0x2e8fcb){_0x2e8fcb(null,util[_0x4c07('0x4c')](_0x4c07('0x4d'),Date[_0x4c07('0x4e')](),_0x59e6f9[_0x4c07('0x4f')]));}})});router[_0x4c07('0x45')]('/:id/avatar',upload[_0x4c07('0x50')](_0x4c07('0x51')),controller['addAvatar']);router['post'](_0x4c07('0x52'),auth['isAuthenticated'](),controller[_0x4c07('0x53')]);router[_0x4c07('0x45')]('/:id/logout',auth[_0x4c07('0xd')](),controller[_0x4c07('0x54')]);router['post'](_0x4c07('0x55'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x56')]);router[_0x4c07('0x45')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x4c07('0x57')]);router[_0x4c07('0x45')](_0x4c07('0x2c'),auth[_0x4c07('0xd')](),controller['addTeams']);router[_0x4c07('0x45')](_0x4c07('0x58'),auth['isAuthenticated'](),controller[_0x4c07('0x59')]);router[_0x4c07('0x45')](_0x4c07('0x5a'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x5b')]);router[_0x4c07('0x45')](_0x4c07('0x5c'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x5d')]);router[_0x4c07('0x45')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x4c07('0x45')](_0x4c07('0x5e'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x5f')]);router[_0x4c07('0x45')](_0x4c07('0x60'),auth[_0x4c07('0xd')](),controller['addWhatsappInteractions']);router[_0x4c07('0x45')](_0x4c07('0x34'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x61')]);router[_0x4c07('0x45')](_0x4c07('0x36'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x62')]);router['post'](_0x4c07('0x38'),auth[_0x4c07('0xd')](),controller['addOpenchannelAccounts']);router[_0x4c07('0x45')](_0x4c07('0x3a'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x63')]);router[_0x4c07('0x45')](_0x4c07('0x3c'),auth['isAuthenticated'](),controller[_0x4c07('0x64')]);router[_0x4c07('0x45')](_0x4c07('0x65'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router['post'](_0x4c07('0x3f'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x66')]);router[_0x4c07('0x45')](_0x4c07('0x43'),auth[_0x4c07('0xd')](),controller['createApiKey']);router['put'](_0x4c07('0x11'),auth['isAuthenticated'](),controller[_0x4c07('0x67')]);router[_0x4c07('0x68')](_0x4c07('0x69'),auth['isAuthenticated'](),controller[_0x4c07('0x6a')]);router['delete']('/:id/queues',auth[_0x4c07('0xd')](),controller[_0x4c07('0x6b')]);router[_0x4c07('0x6c')](_0x4c07('0x2c'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x6d')]);router[_0x4c07('0x6c')](_0x4c07('0x11'),auth['isAuthenticated'](),controller[_0x4c07('0x6e')]);router[_0x4c07('0x6c')](_0x4c07('0x58'),auth['isAuthenticated'](),controller[_0x4c07('0x6f')]);router[_0x4c07('0x6c')](_0x4c07('0x5a'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x70')]);router['delete'](_0x4c07('0x5c'),auth['isAuthenticated'](),controller[_0x4c07('0x71')]);router[_0x4c07('0x6c')](_0x4c07('0x72'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x73')]);router[_0x4c07('0x6c')](_0x4c07('0x5e'),auth[_0x4c07('0xd')](),controller['removeOpenchannelInteractions']);router[_0x4c07('0x6c')](_0x4c07('0x60'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x74')]);router[_0x4c07('0x6c')](_0x4c07('0x34'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x75')]);router[_0x4c07('0x6c')](_0x4c07('0x36'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x76')]);router[_0x4c07('0x6c')](_0x4c07('0x38'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x77')]);router['delete'](_0x4c07('0x3a'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x78')]);router[_0x4c07('0x6c')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x4c07('0x79')]);router[_0x4c07('0x6c')](_0x4c07('0x65'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0x4c07('0x6c')]('/:id/square_projects',auth[_0x4c07('0xd')](),controller[_0x4c07('0x7a')]);router[_0x4c07('0x6c')](_0x4c07('0x43'),auth[_0x4c07('0xd')](),controller[_0x4c07('0x7b')]);module[_0x4c07('0x7c')]=router;
\ No newline at end of file
index aba4505..8eed80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd47f=['local','INTEGER','accountcode','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','user','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','split','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue','internal','email','admin'];(function(_0x4f0ac9,_0xf8844e){var _0x1d1f24=function(_0x4f1387){while(--_0x4f1387){_0x4f0ac9['push'](_0x4f0ac9['shift']());}};_0x1d1f24(++_0xf8844e);}(_0xd47f,0x1bd));var _0xfd47=function(_0x582514,_0x4667aa){_0x582514=_0x582514-0x0;var _0x369266=_0xd47f[_0x582514];return _0x369266;};'use strict';var Sequelize=require(_0xfd47('0x0'));var moment=require('moment');var util=require(_0xfd47('0x1'));var _=require(_0xfd47('0x2'));module[_0xfd47('0x3')]={'name':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x32a237){this[_0xfd47('0x6')](_0xfd47('0x5'),_0x32a237);this[_0xfd47('0x6')](_0xfd47('0x7'),_0x32a237);},'comment':_0xfd47('0x8')},'fullname':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'set':function(_0x55fd0b){this['setDataValue'](_0xfd47('0x9'),_0x55fd0b);this['setDataValue']('callerid',util['format'](_0xfd47('0xa'),_0x55fd0b,this[_0xfd47('0xb')](_0xfd47('0xc'))));}},'alias':{'type':Sequelize[_0xfd47('0x4')]},'email':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'unique':_0xfd47('0xd'),'validate':{'isEmail':!![]},'set':function(_0x5a6644){if(_0x5a6644){this['setDataValue'](_0xfd47('0xd'),_0x5a6644['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xfd47('0xe'),'user','agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0xfd47('0xf')},'internal':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':![],'unique':_0xfd47('0xc'),'set':function(_0x49c00a){this[_0xfd47('0x6')](_0xfd47('0xc'),_0x49c00a);this[_0xfd47('0x6')](_0xfd47('0x11'),_0x49c00a);this['setDataValue'](_0xfd47('0x12'),util[_0xfd47('0x13')](_0xfd47('0xa'),this['getDataValue']('fullname'),_0x49c00a));}},'salt':{'type':Sequelize[_0xfd47('0x4')]},'phone':{'type':Sequelize[_0xfd47('0x4')]},'mobile':{'type':Sequelize[_0xfd47('0x4')]},'address':{'type':Sequelize[_0xfd47('0x4')]},'zipcode':{'type':Sequelize[_0xfd47('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xfd47('0x4')]},'country':{'type':Sequelize[_0xfd47('0x4')]},'online':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfd47('0x15')]},'voicePause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':_0xfd47('0x16')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfd47('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x17')},'ipaddr':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfd47('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x19'),_0xfd47('0x1a'),_0xfd47('0x1b')),'allowNull':!![],'defaultValue':_0xfd47('0x19')},'context':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x1c')},'callingpres':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x1d'),'ALLOWED_PASSED_SCREEN',_0xfd47('0x1e'),_0xfd47('0x1f'),_0xfd47('0x20'),'PROHIB_PASSED_SCREEN',_0xfd47('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x22'),'set':function(_0x3d95bc){this[_0xfd47('0x6')](_0xfd47('0x23'),_0x3d95bc?_0x3d95bc[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')]('transport')?this[_0xfd47('0xb')](_0xfd47('0x23'))['split'](','):null;},'comment':_0xfd47('0x25')},'dtmfmode':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x26'),'info',_0xfd47('0x27'),'inband',_0xfd47('0x28')),'allowNull':!![],'defaultValue':_0xfd47('0x26')},'directmedia':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x2c'),'set':function(_0x516a4c){this[_0xfd47('0x6')](_0xfd47('0x2d'),_0x516a4c?_0x516a4c['join'](','):null);},'get':function(){return this['getDataValue'](_0xfd47('0x2d'))?this['getDataValue'](_0xfd47('0x2d'))['split'](','):null;},'comment':_0xfd47('0x2e')},'callgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xfd47('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfd47('0x4')],'allowNull':![],'defaultValue':_0xfd47('0x2f'),'set':function(_0x2c70a8){this['setDataValue']('allow',_0x2c70a8?_0x2c70a8['join'](';'):_0xfd47('0x2f'));},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x30'))?this[_0xfd47('0xb')](_0xfd47('0x30'))['split'](';'):null;},'comment':_0xfd47('0x31')},'autoframing':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'set':function(_0xf0727c){this[_0xfd47('0x6')](_0xfd47('0x32'),_0xf0727c?_0xf0727c[_0xfd47('0x24')](','):null);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x32'))?this[_0xfd47('0xb')](_0xfd47('0x32'))['split'](','):null;},'comment':_0xfd47('0x33')},'trustrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![],'defaultValue':_0xfd47('0x35')},'amaflags':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'busylevel':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfd47('0x18')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfd47('0x18')]('yes','no',_0xfd47('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xfd47('0x37'),_0xfd47('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x39'),_0xfd47('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':_0xfd47('0x29')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xfd47('0x3b'),_0xfd47('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x3d'),_0xfd47('0x3e'),_0xfd47('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfd47('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfd47('0x18')](_0xfd47('0x29'),'no',_0xfd47('0x2a'),_0xfd47('0x2b'),_0xfd47('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfd47('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfd47('0x15')]},'passwordResetAt':{'type':Sequelize[_0xfd47('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0,'set':function(_0x583e85){this[_0xfd47('0x6')](_0xfd47('0x41'),_0x583e85);var _0x2b2ae1=this['get']({'plain':!![]});switch(_0x583e85){case 0x0:case 0x1:var _0xb988b9=_0x2b2ae1[_0xfd47('0x23')]?_[_0xfd47('0x42')](_0x2b2ae1[_0xfd47('0x23')])?_0x2b2ae1['transport'][_0xfd47('0x24')]():_0x2b2ae1[_0xfd47('0x23')]:_0xfd47('0x22');if(_0xb988b9===_0xfd47('0x43')){_0xb988b9=_0xfd47('0x22');}this[_0xfd47('0x6')](_0xfd47('0x23'),_0xb988b9);this[_0xfd47('0x6')](_0xfd47('0x44'),'no');this['setDataValue'](_0xfd47('0x45'),null);this[_0xfd47('0x6')](_0xfd47('0x46'),null);this[_0xfd47('0x6')]('icesupport',null);this['setDataValue'](_0xfd47('0x47'),null);this['setDataValue'](_0xfd47('0x48'),null);this[_0xfd47('0x6')](_0xfd47('0x49'),null);this[_0xfd47('0x6')](_0xfd47('0x4a'),null);this[_0xfd47('0x6')](_0xfd47('0x4b'),null);this[_0xfd47('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xfd47('0x23'),_0xfd47('0x43'));this[_0xfd47('0x6')](_0xfd47('0x44'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x45'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x46'),_0xfd47('0x29'));this[_0xfd47('0x6')](_0xfd47('0x4c'),'yes');this['setDataValue'](_0xfd47('0x47'),'yes');this[_0xfd47('0x6')](_0xfd47('0x48'),'no');this['setDataValue']('dtlssetup',_0xfd47('0x3f'));this[_0xfd47('0x6')]('dtlscertfile',_0x2b2ae1[_0xfd47('0x4a')]||_0xfd47('0x4d'));this[_0xfd47('0x6')](_0xfd47('0x4b'),_0x2b2ae1[_0xfd47('0x4b')]||_0xfd47('0x4e'));this[_0xfd47('0x6')](_0xfd47('0x4f'),_0xfd47('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xfd47('0x50')],'set':function(_0x4e39d3){this[_0xfd47('0x6')](_0xfd47('0x51'),_0x4e39d3?_0x4e39d3[_0xfd47('0x24')](','):[]);},'get':function(){return this[_0xfd47('0xb')](_0xfd47('0x51'))?_[_0xfd47('0x52')](this[_0xfd47('0xb')](_0xfd47('0x51'))[_0xfd47('0x53')](','),function(_0x1ef84e){return parseInt(_0x1ef84e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xfd47('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfd47('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xfd47('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0xfd47('0xb')](_0xfd47('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfd47('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfd47('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':![],'set':function(_0x4cea58){if(typeof _0x4cea58===_0xfd47('0x55')){var _0x2119c1=_0x4cea58==='1'?!![]:_0x4cea58==='0'?![]:_0x4cea58===_0xfd47('0x56')?!![]:_0x4cea58===_0xfd47('0x57')?![]:![];this[_0xfd47('0x6')](_0xfd47('0x58'),_0x2119c1);}else{this['setDataValue']('screenrecording',_0x4cea58);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x64f723){this['setDataValue'](_0xfd47('0x59'),_0x64f723);if(_0x64f723===!![]){this[_0xfd47('0x6')](_0xfd47('0x5a'),moment());this[_0xfd47('0x6')]('loginAttempts',0x0);}else{this[_0xfd47('0x6')](_0xfd47('0x5a'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xfd47('0x10')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfd47('0x10')](0x5)[_0xfd47('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfd47('0x14')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xafdd=['uas','fingerprint','certificate','active','passive','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','local','accountcode','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','user','peer','friend','from-sip','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','yes','nat','join','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\x22gsm\x22]','insecure','never','accept','refuse','originate','uac'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xafdd,0x19a));var _0xdafd=function(_0x2ee647,_0x5e25d6){_0x2ee647=_0x2ee647-0x0;var _0x449a0a=_0xafdd[_0x2ee647];return _0x449a0a;};'use strict';var Sequelize=require(_0xdafd('0x0'));var moment=require(_0xdafd('0x1'));var util=require(_0xdafd('0x2'));var _=require(_0xdafd('0x3'));module[_0xdafd('0x4')]={'name':{'type':Sequelize[_0xdafd('0x5')],'allowNull':![],'unique':_0xdafd('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2b0752){this['setDataValue'](_0xdafd('0x6'),_0x2b0752);this[_0xdafd('0x7')](_0xdafd('0x8'),_0x2b0752);},'comment':_0xdafd('0x9')},'fullname':{'type':Sequelize[_0xdafd('0x5')],'allowNull':![],'set':function(_0x57cfee){this[_0xdafd('0x7')]('fullname',_0x57cfee);this[_0xdafd('0x7')](_0xdafd('0xa'),util[_0xdafd('0xb')]('\x22%s\x22\x20<%s>',_0x57cfee,this[_0xdafd('0xc')](_0xdafd('0xd'))));}},'alias':{'type':Sequelize[_0xdafd('0x5')]},'email':{'type':Sequelize[_0xdafd('0x5')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x42373f){if(_0x42373f){this[_0xdafd('0x7')](_0xdafd('0xe'),_0x42373f[_0xdafd('0xf')]());}}},'role':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x11'),'user',_0xdafd('0x12'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xdafd('0x5')],'defaultValue':_0xdafd('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xdafd('0xd'),'set':function(_0x490382){this['setDataValue'](_0xdafd('0xd'),_0x490382);this[_0xdafd('0x7')](_0xdafd('0x14'),_0x490382);this[_0xdafd('0x7')](_0xdafd('0xa'),util['format'](_0xdafd('0x15'),this[_0xdafd('0xc')](_0xdafd('0x16')),_0x490382));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdafd('0x5')]},'mobile':{'type':Sequelize[_0xdafd('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xdafd('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdafd('0x5')]},'online':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdafd('0x18')]},'voicePause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xdafd('0x5')],'defaultValue':_0xdafd('0x19')},'lastPauseAt':{'type':Sequelize[_0xdafd('0x18')]},'chatCapacity':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdafd('0x1a')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdafd('0x1a')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![],'defaultValue':_0xdafd('0x1b')},'ipaddr':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xdafd('0x1a')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdafd('0x10')]('friend',_0xdafd('0x1c'),_0xdafd('0x1d')),'allowNull':!![],'defaultValue':_0xdafd('0x1e')},'context':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![],'defaultValue':_0xdafd('0x1f')},'callingpres':{'type':Sequelize[_0xdafd('0x10')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xdafd('0x20'),_0xdafd('0x21'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xdafd('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'secret':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x10c9e5){this[_0xdafd('0x7')](_0xdafd('0x23'),_0x10c9e5?_0x10c9e5['join'](','):null);},'get':function(){return this[_0xdafd('0xc')](_0xdafd('0x23'))?this['getDataValue'](_0xdafd('0x23'))[_0xdafd('0x24')](','):null;},'comment':_0xdafd('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0xdafd('0x26'),_0xdafd('0x27'),_0xdafd('0x28'),_0xdafd('0x29'),_0xdafd('0x2a')),'allowNull':!![],'defaultValue':_0xdafd('0x26')},'directmedia':{'type':Sequelize[_0xdafd('0x10')]('yes','no',_0xdafd('0x2b'),_0xdafd('0x2c'),_0xdafd('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'nat':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x3dbdb1){this[_0xdafd('0x7')](_0xdafd('0x2f'),_0x3dbdb1?_0x3dbdb1[_0xdafd('0x30')](','):null);},'get':function(){return this[_0xdafd('0xc')](_0xdafd('0x2f'))?this[_0xdafd('0xc')](_0xdafd('0x2f'))[_0xdafd('0x24')](','):null;},'comment':_0xdafd('0x31')},'callgroup':{'type':Sequelize[_0xdafd('0x5')]},'namedcallgroup':{'type':Sequelize[_0xdafd('0x5')]},'pickupgroup':{'type':Sequelize[_0xdafd('0x5')]},'namedpickupgroup':{'type':Sequelize[_0xdafd('0x5')]},'language':{'type':Sequelize[_0xdafd('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdafd('0x5')]},'disallow':{'type':Sequelize[_0xdafd('0x5')],'allowNull':![],'defaultValue':_0xdafd('0x32')},'allow':{'type':Sequelize[_0xdafd('0x5')],'allowNull':![],'defaultValue':_0xdafd('0x33'),'set':function(_0x3f25c2){this[_0xdafd('0x7')](_0xdafd('0x34'),_0x3f25c2?_0x3f25c2[_0xdafd('0x30')](';'):_0xdafd('0x33'));},'get':function(){return this[_0xdafd('0xc')]('allow')?this['getDataValue'](_0xdafd('0x34'))['split'](';'):null;},'comment':_0xdafd('0x35')},'autoframing':{'type':Sequelize[_0xdafd('0x10')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x244e80){this[_0xdafd('0x7')](_0xdafd('0x36'),_0x244e80?_0x244e80[_0xdafd('0x30')](','):null);},'get':function(){return this[_0xdafd('0xc')](_0xdafd('0x36'))?this[_0xdafd('0xc')](_0xdafd('0x36'))[_0xdafd('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no',_0xdafd('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdafd('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdafd('0x10')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x38'),_0xdafd('0x39'),_0xdafd('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x3b'),_0xdafd('0x3c')),'allowNull':!![],'defaultValue':_0xdafd('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdafd('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xdafd('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xdafd('0x10')]('yes','no',_0xdafd('0x3d'),_0xdafd('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdafd('0x1a')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x3f'),_0xdafd('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdafd('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdafd('0x10')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdafd('0x10')](_0xdafd('0x2e'),'no','nonat',_0xdafd('0x2c'),_0xdafd('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xdafd('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xdafd('0x18')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdafd('0x42')]},'showWebBar':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0,'set':function(_0x4e1714){this[_0xdafd('0x7')](_0xdafd('0x43'),_0x4e1714);var _0x1f5cd2=this[_0xdafd('0x44')]({'plain':!![]});switch(_0x4e1714){case 0x0:case 0x1:var _0x3bcb25=_0x1f5cd2['transport']?_[_0xdafd('0x45')](_0x1f5cd2['transport'])?_0x1f5cd2['transport'][_0xdafd('0x30')]():_0x1f5cd2['transport']:_0xdafd('0x46');if(_0x3bcb25===_0xdafd('0x47')){_0x3bcb25=_0xdafd('0x46');}this[_0xdafd('0x7')]('transport',_0x3bcb25);this[_0xdafd('0x7')](_0xdafd('0x48'),'no');this[_0xdafd('0x7')](_0xdafd('0x49'),null);this[_0xdafd('0x7')](_0xdafd('0x4a'),null);this[_0xdafd('0x7')](_0xdafd('0x4b'),null);this[_0xdafd('0x7')](_0xdafd('0x4c'),null);this[_0xdafd('0x7')](_0xdafd('0x4d'),null);this[_0xdafd('0x7')](_0xdafd('0x4e'),null);this[_0xdafd('0x7')](_0xdafd('0x4f'),null);this[_0xdafd('0x7')]('dtlsprivatekey',null);this[_0xdafd('0x7')]('rtcp_mux','no');break;case 0x2:this[_0xdafd('0x7')]('transport',_0xdafd('0x47'));this[_0xdafd('0x7')]('encryption','yes');this[_0xdafd('0x7')](_0xdafd('0x49'),_0xdafd('0x2e'));this['setDataValue']('force_avp','yes');this[_0xdafd('0x7')]('icesupport',_0xdafd('0x2e'));this['setDataValue'](_0xdafd('0x4c'),_0xdafd('0x2e'));this[_0xdafd('0x7')](_0xdafd('0x4d'),'no');this[_0xdafd('0x7')]('dtlssetup','actpass');this[_0xdafd('0x7')]('dtlscertfile',_0x1f5cd2[_0xdafd('0x4f')]||_0xdafd('0x50'));this['setDataValue'](_0xdafd('0x51'),_0x1f5cd2[_0xdafd('0x51')]||_0xdafd('0x52'));this[_0xdafd('0x7')](_0xdafd('0x53'),_0xdafd('0x2e'));break;default:}}},'permissions':{'type':Sequelize[_0xdafd('0x42')],'set':function(_0x1255bb){this['setDataValue'](_0xdafd('0x54'),_0x1255bb?_0x1255bb[_0xdafd('0x30')](','):[]);},'get':function(){return this['getDataValue'](_0xdafd('0x54'))?_[_0xdafd('0x55')](this['getDataValue'](_0xdafd('0x54'))[_0xdafd('0x24')](','),function(_0x56adcd){return parseInt(_0x56adcd,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdafd('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdafd('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdafd('0x5')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdafd('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xdafd('0x2e'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdafd('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xdafd('0x56')],'get':function(){return this['getDataValue'](_0xdafd('0x57'))?this[_0xdafd('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0xdafd('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xdafd('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![],'set':function(_0x28f9b3){if(typeof _0x28f9b3===_0xdafd('0x58')){var _0x1e593f=_0x28f9b3==='1'?!![]:_0x28f9b3==='0'?![]:_0x28f9b3==='true'?!![]:_0x28f9b3===_0xdafd('0x59')?![]:![];this[_0xdafd('0x7')](_0xdafd('0x5a'),_0x1e593f);}else{this[_0xdafd('0x7')](_0xdafd('0x5a'),_0x28f9b3);}}},'blocked':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![],'set':function(_0x4711bf){this[_0xdafd('0x7')](_0xdafd('0x5b'),_0x4711bf);if(_0x4711bf===!![]){this[_0xdafd('0x7')](_0xdafd('0x5c'),moment());this['setDataValue'](_0xdafd('0x5d'),0x0);}else{this[_0xdafd('0x7')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xdafd('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdafd('0x1a')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xdafd('0x1a')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdafd('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 9232bf4..35e1958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','previousPasswords','passwordHistoryLimit','updatePasswordsHistory','addQueues','loginInPause','isValidChannel','toLowerCase','Queues','penalty','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','interface','format','SIP/%s','voicePause','each','upsert','channel','Unknown\x20channel','remove','Queue:remove','addAvatar','userpic','filename','join','download','existsSync','server/files/images/','root','getOpenTabs','ChatOpenTabs','CHAT','createdAt','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','findOne','order','sort','pick','merge','getContacts','hasOwnProperty','CmList','List','Tag','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','phone','mobile','LOCAL/%s@from-sip/n','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','UserVoiceQueueRt','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','concat','LOGININPAUSE','isMiddleware','resolve','logout','QueuePause','pause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','flatten','transaction','online','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Fax','Openchannel','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','CmContact','Contact','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getPresence','teams','inbound','queues','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','SELECT','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','bluebird','util','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','defaults','client','request','then','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','get','admin','Users','Agents','agent','Telephones','telephone','filter','ignore','value','includes','role','name','destroy','stack','index','User','rawAttributes','type','key','password','where','query','includeAll','include','attributes','rows','length','push','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','catch','show','params','differenceBy','keys','salt','filters','intersection','model','fields','options','find','openTabs','true','body','describe','addContacts','ids','omit','internal','findById','securePassword','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)','QueryTypes','from','voicemail','mailbox','VoiceMail','fullname','permissions','101','113','110','104','105','106','108','109','100','114','create','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','some','findAll','isEmpty','map','compact','oldPassword','newPassword','ValidationError','authenticate','Sequelize','Wrong\x20credentials'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x57ca,0x108));var _0xa57c=function(_0x5c039b,_0x7c3ece){_0x5c039b=_0x5c039b-0x0;var _0x46fd21=_0x57ca[_0x5c039b];return _0x46fd21;};'use strict';var moment=require('moment');var BPromise=require(_0xa57c('0x0'));var util=require(_0xa57c('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xa57c('0x2'));var squel=require(_0xa57c('0x3'));var jayson=require(_0xa57c('0x4'));var Redis=require(_0xa57c('0x5'));var authService=require(_0xa57c('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xa57c('0x7'))(_0xa57c('0x8'));var utils=require(_0xa57c('0x9'));var config=require(_0xa57c('0xa'));var licenseUtil=require(_0xa57c('0xb'));var db=require(_0xa57c('0xc'))['db'];var socket=require(_0xa57c('0xd'))(new Redis(config[_0xa57c('0xe')]));require('./user.socket')[_0xa57c('0xf')](socket);config['redis']=_[_0xa57c('0x10')](config[_0xa57c('0xe')],{'host':'localhost','port':0x18eb});var client=jayson[_0xa57c('0x11')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x554101,_0x44b221,_0x58e6b6,_0x2ed4c6){return new BPromise(function(_0x5a8952,_0x4200c1){var _0x4ca5b2=_0x2ed4c6||client;return _0x4ca5b2[_0xa57c('0x12')](_0x554101,_0x58e6b6)[_0xa57c('0x13')](function(_0x205e72){logger['info'](_0xa57c('0x14'),_0x44b221,'request\x20sent');logger[_0xa57c('0x15')](_0xa57c('0x16'),_0x44b221,_0xa57c('0x17'),JSON[_0xa57c('0x18')](_0x205e72));if(_0x205e72[_0xa57c('0x19')]){if(_0x205e72[_0xa57c('0x19')][_0xa57c('0x1a')]===0x1f4){logger['error'](_0xa57c('0x14'),_0x44b221,_0x205e72[_0xa57c('0x19')][_0xa57c('0x1b')]);return _0x4200c1(_0x205e72['error'][_0xa57c('0x1b')]);}logger['error'](_0xa57c('0x14'),_0x44b221,_0x205e72[_0xa57c('0x19')][_0xa57c('0x1b')]);return _0x5a8952(_0x205e72[_0xa57c('0x19')][_0xa57c('0x1b')]);}else{logger[_0xa57c('0x1c')](_0xa57c('0x14'),_0x44b221,_0xa57c('0x17'));_0x5a8952(_0x205e72['result'][_0xa57c('0x1b')]);}})['catch'](function(_0x4a35bb){logger[_0xa57c('0x19')](_0xa57c('0x14'),_0x44b221,_0x4a35bb);_0x4200c1(_0x4a35bb);});});}function respondWithStatusCode(_0x3eee75,_0x23bec0){_0x23bec0=_0x23bec0||0xcc;return function(_0x49242c){if(_0x49242c){return _0x3eee75[_0xa57c('0x1d')](_0x23bec0);}return _0x3eee75[_0xa57c('0x1e')](_0x23bec0)[_0xa57c('0x1f')]();};}function respondWithResult(_0x2213b2,_0x3bb969){_0x3bb969=_0x3bb969||0xc8;return function(_0x1404fd){if(_0x1404fd){return _0x2213b2[_0xa57c('0x1e')](_0x3bb969)[_0xa57c('0x20')](_0x1404fd);}};}function respondWithFilteredResult(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){var _0x1e7f7a=typeof _0xdf65dd[_0xa57c('0x21')]===_0xa57c('0x22')&&typeof _0xdf65dd[_0xa57c('0x23')]==='undefined';var _0x2db443=_0x382a26[_0xa57c('0x24')];var _0x27884d=_0x1e7f7a?0x0:_0xdf65dd[_0xa57c('0x21')];var _0x315ad7=_0x1e7f7a?_0x382a26[_0xa57c('0x24')]:_0xdf65dd[_0xa57c('0x21')]+_0xdf65dd[_0xa57c('0x23')];var _0x337f97;if(_0x315ad7>=_0x2db443){_0x315ad7=_0x2db443;_0x337f97=0xc8;}else{_0x337f97=0xce;}_0x2e99ed[_0xa57c('0x1e')](_0x337f97);return _0x2e99ed['set'](_0xa57c('0x25'),_0x27884d+'-'+_0x315ad7+'/'+_0x2db443)['json'](_0x382a26);}return null;};}function saveUpdates(_0x54a18b){return function(_0x257661){if(_0x257661){return _0x257661[_0xa57c('0x26')](_0x54a18b)['then'](function(_0x12898b){return _0x12898b;});}return null;};}function removeEntity(_0x1ef331){return function(_0x3eb9e9){if(_0x3eb9e9){return _0x3eb9e9['destroy']()[_0xa57c('0x13')](function(){var _0x58d46f=_0x3eb9e9[_0xa57c('0x27')]({'plain':!![]});if(_0x58d46f['role']===_0xa57c('0x28'))return;var _0x51ad09=[{'name':_0xa57c('0x29'),'value':'user','ignore':!![]},{'name':_0xa57c('0x2a'),'value':_0xa57c('0x2b'),'ignore':![]},{'name':_0xa57c('0x2c'),'value':_0xa57c('0x2d'),'ignore':![]}];var _0xfd0f66=_(_0x51ad09)[_0xa57c('0x2e')](_0xa57c('0x2f'))['map'](_0xa57c('0x30'))['value']();if(_[_0xa57c('0x31')](_0xfd0f66,_0x58d46f[_0xa57c('0x32')])){return;}var _0x27ada0=_['find'](_0x51ad09,[_0xa57c('0x30'),_0x58d46f['role']])[_0xa57c('0x33')];return db['UserProfileResource'][_0xa57c('0x34')]({'where':{'type':_0x27ada0,'resourceId':_0x58d46f['id']}})['then'](function(){return _0x3eb9e9;});})[_0xa57c('0x13')](function(){_0x1ef331[_0xa57c('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b8d17){return function(_0x47b65c){if(!_0x47b65c){_0x3b8d17[_0xa57c('0x1d')](0x194);}return _0x47b65c;};}function handleError(_0x5c56d3,_0x189d9b){_0x189d9b=_0x189d9b||0x1f4;return function(_0x3776de){logger[_0xa57c('0x19')](_0x3776de[_0xa57c('0x35')]);if(_0x3776de[_0xa57c('0x33')]){delete _0x3776de[_0xa57c('0x33')];}_0x5c56d3['status'](_0x189d9b)['send'](_0x3776de);};}exports[_0xa57c('0x36')]=function(_0x13e390,_0x2c70d6){var _0x570f6c={},_0x12b644={'count':0x0,'rows':[]};var _0x5308d5=_(db[_0xa57c('0x37')][_0xa57c('0x38')])['map'](function(_0x558cf7){return{'name':_0x558cf7['fieldName'],'type':_0x558cf7[_0xa57c('0x39')][_0xa57c('0x3a')]};})[_0xa57c('0x2e')](function(_0x21e4df){return!_[_0xa57c('0x31')]([_0xa57c('0x3b'),'salt'],_0x21e4df[_0xa57c('0x33')]);})[_0xa57c('0x30')]();_0x570f6c=qs['getOptions'](_0x5308d5,_0x13e390);var _0x5ed42d={'where':_0x570f6c[_0xa57c('0x3c')]};return db[_0xa57c('0x37')]['count'](_0x5ed42d)[_0xa57c('0x13')](function(_0x5603cf){_0x12b644[_0xa57c('0x24')]=_0x5603cf;if(_0x13e390[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x570f6c[_0xa57c('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x570f6c[_0xa57c('0x40')],'id')){_0x570f6c['attributes']['push']('id');}return db['User']['findAll'](_0x570f6c);})['then'](function(_0x39b20f){_0x12b644[_0xa57c('0x41')]=_0x39b20f;if(_0x13e390[_0xa57c('0x3d')]['openTabs']==='true'){var _0x49e072=[];for(var _0x44f1e8=0x0;_0x44f1e8<_0x12b644[_0xa57c('0x41')][_0xa57c('0x42')];_0x44f1e8++){_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x44'),_0x12b644[_0xa57c('0x41')][_0x44f1e8]['dataValues']));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x47'),_0x12b644['rows'][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x48'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072['push'](get_open_tabs(_0xa57c('0x49'),_0x12b644[_0xa57c('0x41')][_0x44f1e8][_0xa57c('0x46')]));_0x49e072[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x12b644[_0xa57c('0x41')][_0x44f1e8]['dataValues']));}return BPromise[_0xa57c('0x4b')](_0x49e072)[_0xa57c('0x13')](function(_0x247906){return _0x12b644;});}else{return _0x12b644;}})[_0xa57c('0x13')](respondWithFilteredResult(_0x2c70d6,_0x570f6c))[_0xa57c('0x4c')](handleError(_0x2c70d6,null));};exports[_0xa57c('0x4d')]=function(_0x57533e,_0x516461){var _0x578436={'raw':![],'where':{'id':_0x57533e[_0xa57c('0x4e')]['id']}},_0x5082ef={};_0x5082ef['model']=_[_0xa57c('0x4f')](_[_0xa57c('0x50')](db['User'][_0xa57c('0x38')]),[_0xa57c('0x3b'),_0xa57c('0x51')]);_0x5082ef[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x57533e['query']);_0x5082ef[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x5082ef[_0xa57c('0x54')],_0x5082ef[_0xa57c('0x3d')]);_0x578436[_0xa57c('0x40')]=_['intersection'](_0x5082ef[_0xa57c('0x54')],qs['fields'](_0x57533e['query'][_0xa57c('0x55')]));_0x578436[_0xa57c('0x40')]=_0x578436[_0xa57c('0x40')]['length']?_0x578436['attributes']:_0x5082ef[_0xa57c('0x54')];if(_0x57533e[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x578436[_0xa57c('0x3f')]=[{'all':!![]}];}_0x578436=_['merge']({},_0x578436,_0x57533e[_0xa57c('0x56')]);if(!_[_0xa57c('0x31')](_0x578436[_0xa57c('0x40')],'id')){_0x578436['attributes']['push']('id');}return db[_0xa57c('0x37')][_0xa57c('0x57')](_0x578436)['then'](handleEntityNotFound(_0x516461,null))[_0xa57c('0x13')](function(_0x28f650){var _0x273975=[];values=_0x28f650;if(_0x57533e[_0xa57c('0x3d')][_0xa57c('0x58')]===_0xa57c('0x59')){_0x273975[_0xa57c('0x43')](get_open_tabs('chat',_0x28f650['dataValues']));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x28f650[_0xa57c('0x46')]));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x49'),_0x28f650[_0xa57c('0x46')]));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x28f650['dataValues']));_0x273975['push'](get_open_tabs(_0xa57c('0x47'),_0x28f650['dataValues']));_0x273975[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x48'),_0x28f650[_0xa57c('0x46')]));return BPromise['all'](_0x273975);}else{return values;}})[_0xa57c('0x13')](function(_0x5b3bf0){return values;})[_0xa57c('0x13')](respondWithResult(_0x516461,null))['catch'](handleError(_0x516461,null));};exports[_0xa57c('0x26')]=function(_0x170187,_0x398743){if(_0x170187[_0xa57c('0x5a')]['id']){delete _0x170187['body']['id'];}delete _0x170187[_0xa57c('0x5a')][_0xa57c('0x32')];return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x170187[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x398743,null))[_0xa57c('0x13')](saveUpdates(_0x170187[_0xa57c('0x5a')],null))[_0xa57c('0x13')](respondWithResult(_0x398743,null))[_0xa57c('0x4c')](handleError(_0x398743,null));};exports[_0xa57c('0x5b')]=function(_0xe5e63,_0x143ec3){return db[_0xa57c('0x37')][_0xa57c('0x5b')]()[_0xa57c('0x13')](respondWithResult(_0x143ec3,null))['catch'](handleError(_0x143ec3,null));};exports[_0xa57c('0x5c')]=function(_0x297518,_0x1bc70b){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x297518[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1bc70b,null))[_0xa57c('0x13')](function(_0x15eef4){if(_0x15eef4){return _0x15eef4['addContacts'](_0x297518[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x297518[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x1bc70b,null))[_0xa57c('0x4c')](handleError(_0x1bc70b,null));};function validateUser(_0x5e1103){return new BPromise(function(_0xaa82e1,_0x5a5653){if(_0x5e1103[_0xa57c('0x5f')])return _0xaa82e1(_0x5e1103);return db['Setting'][_0xa57c('0x60')](0x1)['then'](function(_0x3ef1f1){if(_0x3ef1f1[_0xa57c('0x61')])authService['validatePasswordPattern'](_0x5e1103[_0xa57c('0x3b')]);db[_0xa57c('0x37')][_0xa57c('0x62')](_0xa57c('0x5f'))['then'](function(_0x3a3983){if(_[_0xa57c('0x63')](_0x3a3983)){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')]||0x1;return;}if(_[_0xa57c('0x63')](_0x3ef1f1[_0xa57c('0x64')])||_0x3ef1f1[_0xa57c('0x64')]===_0x3a3983){_0x5e1103[_0xa57c('0x5f')]=_0x3a3983+0x1;return;}if(_0x3ef1f1[_0xa57c('0x64')]>_0x3a3983){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')];return;}return db[_0xa57c('0x65')][_0xa57c('0x3d')](_0xa57c('0x66'),{'type':db[_0xa57c('0x65')][_0xa57c('0x67')]['SELECT']})[_0xa57c('0x13')](function(_0x521503){if(_0x521503&&_0x521503[_0xa57c('0x42')]){for(var _0x24b09a=0x0,_0x245238=_0x521503['length'];_0x24b09a<_0x245238&&_[_0xa57c('0x63')](_0x5e1103[_0xa57c('0x5f')]);_0x24b09a++){if(_0x3ef1f1[_0xa57c('0x64')]<=_0x521503[_0x24b09a]['from']){_0x5e1103['internal']=_0x521503[_0x24b09a][_0xa57c('0x68')];}else if(_0x3ef1f1[_0xa57c('0x64')]>_0x521503[_0x24b09a][_0xa57c('0x68')]&&_0x3ef1f1[_0xa57c('0x64')]<=_0x521503[_0x24b09a]['to']){_0x5e1103[_0xa57c('0x5f')]=_0x3ef1f1[_0xa57c('0x64')];}}}if(_[_0xa57c('0x63')](_0x5e1103[_0xa57c('0x5f')])){_0x5e1103[_0xa57c('0x5f')]=_0x3a3983+0x1;}return _0xaa82e1(_0x5e1103);});});})['catch'](function(_0x25f5f0){_0x5a5653(_0x25f5f0);});});}function updateUser(_0x29951e){return new BPromise(function(_0x55f526,_0x2e37d7){try{if(_0x29951e[_0xa57c('0x69')]){_0x29951e[_0xa57c('0x6a')]=_0x29951e[_0xa57c('0x5f')];_0x29951e[_0xa57c('0x6b')]={'mailbox':_0x29951e[_0xa57c('0x5f')],'password':_0x29951e[_0xa57c('0x3b')],'fullname':_0x29951e[_0xa57c('0x6c')],'email':_0x29951e['email']};}if(_0x29951e[_0xa57c('0x32')]===_0xa57c('0x2b')){if(!_0x29951e['permissions'])_0x29951e[_0xa57c('0x6d')]=[_0xa57c('0x6e'),'102','103',_0xa57c('0x6f'),_0xa57c('0x70'),_0xa57c('0x71'),_0xa57c('0x72'),_0xa57c('0x73'),'107',_0xa57c('0x74'),_0xa57c('0x75'),_0xa57c('0x76'),'111',_0xa57c('0x77'),'115'];}_0x55f526(_0x29951e);}catch(_0x1281ec){_0x2e37d7(_0x1281ec);}});}exports[_0xa57c('0x78')]=function(_0x27321e,_0x2bd081){if(_0x27321e['user'][_0xa57c('0x32')]===_0xa57c('0x2b'))throw new Error(_0xa57c('0x79'));if(_0x27321e[_0xa57c('0x5a')]['role']===_0xa57c('0x7a')&&_0x27321e[_0xa57c('0x7a')][_0xa57c('0x32')]!=='admin'){throw new Error(_0xa57c('0x7b'));}if(_0x27321e[_0xa57c('0x5a')][_0xa57c('0x32')]==='admin'&&_0x27321e[_0xa57c('0x7a')][_0xa57c('0x32')]!==_0xa57c('0x28')){throw new Error(_0xa57c('0x7c'));}return licenseUtil['checkUserLimits']([_0x27321e[_0xa57c('0x5a')]])[_0xa57c('0x13')](function(){return validateUser(_0x27321e['body']);})[_0xa57c('0x13')](function(_0x1157ea){return updateUser(_0x1157ea)['then'](function(_0x29a4e0){if(_0x29a4e0['role']===_0xa57c('0x28')){_0x29a4e0[_0xa57c('0x7d')]=_0x27321e[_0xa57c('0x7a')][_0xa57c('0x7d')];delete _0x29a4e0['userProfileId'];}return _0x29a4e0;});})[_0xa57c('0x13')](function(_0x2288c2){return db[_0xa57c('0x37')][_0xa57c('0x78')](_0x2288c2,{'include':[{'model':db[_0xa57c('0x6b')],'as':_0xa57c('0x6b')}]});})[_0xa57c('0x13')](function(_0x390710){if(_0x27321e[_0xa57c('0x5a')][_0xa57c('0x32')]===_0xa57c('0x7a'))return _0x390710;if(_0x27321e['user']['role']!=='user')return _0x390710;return db[_0xa57c('0x7e')]['find']({'where':{'name':_0x390710[_0xa57c('0x32')]===_0xa57c('0x2b')?_0xa57c('0x2a'):'Telephones','userProfileId':_0x27321e[_0xa57c('0x7a')][_0xa57c('0x7f')]},'raw':!![]})[_0xa57c('0x13')](function(_0x39ae13){if(!_0x39ae13||_0x39ae13[_0xa57c('0x80')]!=0x0)return _0x390710;return db[_0xa57c('0x81')][_0xa57c('0x78')]({'name':_0x390710['name'],'resourceId':_0x390710['id'],'type':_0x39ae13[_0xa57c('0x33')],'sectionId':_0x39ae13['id']},{})[_0xa57c('0x13')](function(){return _0x390710;});})['catch'](function(_0x4e5292){logger[_0xa57c('0x19')](_0xa57c('0x82'),_0x4e5292);throw _0x4e5292;});})['then'](respondWithResult(_0x2bd081,0xc9))['catch'](handleError(_0x2bd081,null));};exports[_0xa57c('0x83')]=function(_0x4962ae,_0x3726ee){var _0x12f5dd=_0x4962ae['body'];var _0x1cda66=[];if(_0x4962ae[_0xa57c('0x7a')][_0xa57c('0x32')]===_0xa57c('0x2b'))throw new Error(_0xa57c('0x79'));if(_['some'](_0x12f5dd,[_0xa57c('0x32'),'user'])&&_0x4962ae[_0xa57c('0x7a')][_0xa57c('0x32')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x12f5dd,[_0xa57c('0x32'),'admin'])&&_0x4962ae['user'][_0xa57c('0x32')]!==_0xa57c('0x28')){throw new Error(_0xa57c('0x84'));}return licenseUtil['checkUserLimits'](_0x12f5dd)[_0xa57c('0x13')](function(){return validateUser(_0x12f5dd[0x0]);})[_0xa57c('0x13')](function(){for(var _0x11e592=0x1;_0x11e592<_0x12f5dd['length'];_0x11e592++){var _0x4b8228=_0x12f5dd[_0x11e592-0x1][_0xa57c('0x5f')];if(!_0x12f5dd[_0x11e592]['internal'])_0x12f5dd[_0x11e592][_0xa57c('0x5f')]=_0x4b8228+0x1;_0x1cda66[_0xa57c('0x43')](validateUser(_0x12f5dd[_0x11e592]));}return BPromise['all'](_0x1cda66);})[_0xa57c('0x13')](function(){_0x1cda66=[];for(var _0x55261e=0x0;_0x55261e<_0x12f5dd['length'];_0x55261e++){_0x1cda66['push'](updateUser(_0x12f5dd[_0x55261e]));}return BPromise[_0xa57c('0x4b')](_0x1cda66);})['then'](function(){return BPromise['each'](_0x12f5dd,function(_0x542194){return db[_0xa57c('0x37')][_0xa57c('0x78')](_0x542194,{'include':[{'model':db['VoiceMail'],'as':_0xa57c('0x6b')}]})[_0xa57c('0x13')](function(_0x25298c){_0x542194['id']=_0x25298c['id'];return _0x542194;});});})['then'](function(_0x31be8e){if(_0x4962ae[_0xa57c('0x5a')][_0xa57c('0x32')]===_0xa57c('0x7a'))return _0x31be8e;if(_0x4962ae['user']['role']!==_0xa57c('0x7a'))return _0x31be8e;var _0x512e3d=_[_0xa57c('0x85')](_0x31be8e,function(_0x3d1e2f){return _0x3d1e2f[_0xa57c('0x32')]==='agent'||_0x3d1e2f[_0xa57c('0x32')]==='telephone';});if(!_0x512e3d)return _0x31be8e;return db['UserProfileSection'][_0xa57c('0x86')]({'where':{'name':{'$or':['Agents',_0xa57c('0x2c')]},'userProfileId':_0x4962ae[_0xa57c('0x7a')]['userProfileId']},'raw':!![]})['then'](function(_0x46fbea){if(_[_0xa57c('0x87')](_0x46fbea)||!_['some'](_0x46fbea,['autoAssociation',0x0]))return _0x31be8e;_0x1cda66=[];var _0x2550bc=_(_0x46fbea)[_0xa57c('0x88')](function(_0xa09ff){if(_0xa09ff['autoAssociation']===0x1)return;return _0xa09ff[_0xa57c('0x33')]===_0xa57c('0x2a')?_0xa57c('0x2b'):_0xa57c('0x2d');})[_0xa57c('0x89')]()[_0xa57c('0x30')]();for(var _0x10f1b5=0x0;_0x10f1b5<_0x31be8e[_0xa57c('0x42')];_0x10f1b5++){if(!_[_0xa57c('0x31')](_0x2550bc,_0x31be8e[_0x10f1b5][_0xa57c('0x32')]))return;var _0x46b223=_0x31be8e[_0x10f1b5][_0xa57c('0x32')]===_0xa57c('0x2b')?'Agents':_0xa57c('0x2c');_0x1cda66[_0xa57c('0x43')](db[_0xa57c('0x81')][_0xa57c('0x78')]({'name':_0x31be8e[_0x10f1b5][_0xa57c('0x33')],'resourceId':_0x31be8e[_0x10f1b5]['id'],'type':_0x46b223,'sectionId':_[_0xa57c('0x57')](_0x46fbea,['name',_0x46b223])['id']},{}));}return BPromise['all'](_0x1cda66);});})[_0xa57c('0x13')](respondWithResult(_0x3726ee,0xc9))['catch'](handleError(_0x3726ee,null));};exports['changePassword']=function(_0x68c843,_0x138edd){if(_0x68c843[_0xa57c('0x5a')]['id']){delete _0x68c843['body']['id'];}return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x68c843[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](function(_0x3eb06d){if(!_0x3eb06d)return null;if(_0x3eb06d['id']===_0x68c843['user']['id']){if(!_0x68c843['body'][_0xa57c('0x8a')]||!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db['Sequelize'][(_0xa57c('0x8c'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x3eb06d[_0xa57c('0x8d')](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8a')])){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))](_0xa57c('0x8f'));}if(_0x68c843[_0xa57c('0x5a')]['oldPassword']===_0x68c843['body'][_0xa57c('0x8b')]){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x68c843['user'][_0xa57c('0x32')]===_0xa57c('0x28')){if(!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0x90'));}}else if(_0x68c843[_0xa57c('0x7a')][_0xa57c('0x32')]==='user'){if(!_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')]){throw new db['Sequelize'][(_0xa57c('0x8c'))](_0xa57c('0x90'));}if(_0x3eb06d[_0xa57c('0x32')]!==_0xa57c('0x2b')){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))](_0xa57c('0x79'));}}else{throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))]('Unauthorized');}return _0x3eb06d;})[_0xa57c('0x13')](handleEntityNotFound(_0x138edd,null))[_0xa57c('0x13')](function(_0xaf7884){return db[_0xa57c('0x91')]['findOne']({'attributes':['id','securePassword',_0xa57c('0x92'),'passwordHistoryLimit']})[_0xa57c('0x13')](function(_0x4a3423){if(_0x4a3423[_0xa57c('0x61')])authService['validatePasswordPattern'](_0x68c843['body'][_0xa57c('0x8b')]);if(!_0x4a3423['enforcePasswordHistory']||!_0xaf7884[_0xa57c('0x93')])return _0xaf7884;authService['validatePasswordHistory'](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')],_0xaf7884[_0xa57c('0x93')],_0x4a3423[_0xa57c('0x94')]);return _0xaf7884;})['then'](saveUpdates({'password':_0x68c843['body'][_0xa57c('0x8b')],'passwordResetAt':_0x68c843[_0xa57c('0x7a')]['id']==_0x68c843['params']['id']?moment():null,'previousPasswords':authService[_0xa57c('0x95')](_0x68c843[_0xa57c('0x5a')][_0xa57c('0x8b')],_0xaf7884[_0xa57c('0x93')])},null));})[_0xa57c('0x13')](respondWithResult(_0x138edd,null))[_0xa57c('0x4c')](handleError(_0x138edd,null));};exports[_0xa57c('0x96')]=function(_0x28dbe2,_0x507814){var _0xb618b4=_0x28dbe2['body']['channel'];return db[_0xa57c('0x37')]['find']({'where':{'id':_0x28dbe2[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),_0xa57c('0x32'),'online',_0xa57c('0x97'),'voicePause','interface']})[_0xa57c('0x13')](handleEntityNotFound(_0x507814,null))[_0xa57c('0x13')](function(_0x1ce6e8){if(_0x1ce6e8){if(!utils[_0xa57c('0x98')](_0xb618b4)){throw new db['Sequelize'][(_0xa57c('0x8c'))]('Unknown\x20channel');}return _0x1ce6e8['add'+_['capitalize'](_0xb618b4[_0xa57c('0x99')]())+_0xa57c('0x9a')](_0x28dbe2[_0xa57c('0x5a')][_0xa57c('0x5d')],{'penalty':_0x28dbe2['body'][_0xa57c('0x9b')]||0x0})['spread'](function(_0x3e9ce5){for(var _0x40577f=0x0;_0x40577f<_0x28dbe2['body'][_0xa57c('0x5d')][_0xa57c('0x42')];_0x40577f+=0x1){var _0x216300={'UserId':Number(_0x28dbe2[_0xa57c('0x4e')]['id'])};_0x216300[_[_0xa57c('0x9c')](_0xb618b4['toLowerCase']())+_0xa57c('0x9d')]=Number(_0x28dbe2['body'][_0xa57c('0x5d')][_0x40577f]);socket[_0xa57c('0x9e')](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0xb618b4[_0xa57c('0x99')]())+_0xa57c('0x9f'),_0x216300);}return _0x3e9ce5;})[_0xa57c('0x13')](function(){if(_0xb618b4===_0xa57c('0xa0')){return db[_0xa57c('0xa1')][_0xa57c('0x86')]({'where':{'id':_0x28dbe2['body'][_0xa57c('0x5d')]||[]},'raw':!![],'attributes':['id',_0xa57c('0x33')]});}})['then'](function(_0x53ef3d){var _0x525865=_0x1ce6e8[_0xa57c('0x27')]({'plain':!![]});var _0x2da247=[];if(_0xb618b4===_0xa57c('0xa0')&&_0x525865['role']===_0xa57c('0x2b')&&_0x525865['online']){for(var _0x2ec3ce=0x0;_0x2ec3ce<_0x53ef3d[_0xa57c('0x42')];_0x2ec3ce+=0x1){_0x2da247['push']({'membername':_0x525865[_0xa57c('0x33')],'UserId':_0x525865['id'],'queue_name':_0x53ef3d[_0x2ec3ce][_0xa57c('0x33')],'VoiceQueueId':_0x53ef3d[_0x2ec3ce]['id'],'interface':_[_0xa57c('0x63')](_0x525865[_0xa57c('0xa2')])?util[_0xa57c('0xa3')](_0xa57c('0xa4'),_0x525865['name']):_0x525865[_0xa57c('0xa2')],'paused':_0x525865[_0xa57c('0xa5')]||![],'penalty':_0x28dbe2[_0xa57c('0x5a')][_0xa57c('0x9b')]||0x0});}return BPromise[_0xa57c('0xa6')](_0x2da247,function(_0x44a93f){return db['UserVoiceQueueRt'][_0xa57c('0xa7')](_0x44a93f);});}return _0x1ce6e8;});}})[_0xa57c('0x13')](respondWithStatusCode(_0x507814,null))[_0xa57c('0x4c')](handleError(_0x507814,null));};exports['removeQueues']=function(_0x3eac3d,_0x582d6b){var _0x521f69;return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3eac3d[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),'role']})[_0xa57c('0x13')](handleEntityNotFound(_0x582d6b,null))['then'](function(_0x20b58c){if(_0x20b58c){_0x521f69=_0x20b58c;if(!_0x3eac3d['query']['channel']||!utils[_0xa57c('0x98')](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')])){throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0xa9'));}return _0x20b58c[_0xa57c('0xaa')+_[_0xa57c('0x9c')](_0x3eac3d[_0xa57c('0x3d')]['channel'][_0xa57c('0x99')]())+_0xa57c('0x9a')](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})[_0xa57c('0x13')](function(_0xb201ad){if(_['isArray'](_0x3eac3d['query']['ids'])){for(var _0x17bb3a=0x0;_0x17bb3a<_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0x5d')]['length'];_0x17bb3a+=0x1){var _0x495718={'UserId':Number(_0x3eac3d[_0xa57c('0x4e')]['id'])};_0x495718[_[_0xa57c('0x9c')](_0x3eac3d['query'][_0xa57c('0xa8')][_0xa57c('0x99')]())+_0xa57c('0x9d')]=Number(_0x3eac3d['query'][_0xa57c('0x5d')][_0x17bb3a]);socket[_0xa57c('0x9e')](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0x3eac3d[_0xa57c('0x3d')]['channel'][_0xa57c('0x99')]())+_0xa57c('0xab'),_0x495718);}}else{var _0x495718={'UserId':Number(_0x3eac3d[_0xa57c('0x4e')]['id'])};_0x495718[_['capitalize'](_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')]['toLowerCase']())+_0xa57c('0x9d')]=Number(_0x3eac3d[_0xa57c('0x3d')]['ids']);socket['emit'](_0xa57c('0x7a')+_[_0xa57c('0x9c')](_0x3eac3d['query'][_0xa57c('0xa8')][_0xa57c('0x99')]())+_0xa57c('0xab'),_0x495718);}return _0xb201ad;})[_0xa57c('0x13')](function(){if(_0x3eac3d[_0xa57c('0x3d')][_0xa57c('0xa8')]==='voice'){return db['UserVoiceQueueRt'][_0xa57c('0x34')]({'where':{'UserId':_0x3eac3d[_0xa57c('0x4e')]['id'],'VoiceQueueId':_0x3eac3d['query'][_0xa57c('0x5d')]},'individualHooks':!![]})[_0xa57c('0x13')](function(){return _0x521f69;});}return _0x521f69;})[_0xa57c('0x13')](respondWithStatusCode(_0x582d6b,null))[_0xa57c('0x4c')](handleError(_0x582d6b,null));};exports[_0xa57c('0xac')]=function(_0x3bcaf4,_0x336354){_0x3bcaf4[_0xa57c('0x5a')][_0xa57c('0xad')]=_0x3bcaf4['file'][_0xa57c('0xae')];return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3bcaf4[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x336354,null))[_0xa57c('0x13')](saveUpdates(_0x3bcaf4[_0xa57c('0x5a')],null))[_0xa57c('0x13')](respondWithResult(_0x336354,null))[_0xa57c('0x4c')](handleError(_0x336354,null));};exports['getAvatar']=function(_0x2f096,_0x26bee7){var _0x19e7ff=path[_0xa57c('0xaf')](config['root'],'server/files/images/logos/default_profile.png');return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x2f096[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0xad')],'raw':!![]})['then'](handleEntityNotFound(_0x26bee7,null))[_0xa57c('0x13')](function(_0x5ab876){if(_0x5ab876){if(_[_0xa57c('0x63')](_0x5ab876['userpic'])){return _0x26bee7[_0xa57c('0xb0')](_0x19e7ff);}else{if(!fs[_0xa57c('0xb1')](path['join'](config['root'],_0xa57c('0xb2'),_0x5ab876['userpic']))){return _0x26bee7[_0xa57c('0xb0')](_0x19e7ff);}return _0x26bee7[_0xa57c('0xb0')](path[_0xa57c('0xaf')](config[_0xa57c('0xb3')],'server/files/images/',_0x5ab876[_0xa57c('0xad')]));}}})['catch'](handleError(_0x26bee7,null));};exports[_0xa57c('0xb4')]=function(_0x1cb54d,_0x2c094f){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x1cb54d[_0xa57c('0x4e')]['id']},'attributes':['id']})[_0xa57c('0x13')](handleEntityNotFound(_0x2c094f,null))[_0xa57c('0x13')](function(_0x3c3292){var _0x145379=[];values=_0x3c3292[_0xa57c('0x46')];_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x44'),_0x3c3292['dataValues']));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x45'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x49'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x4a'),_0x3c3292[_0xa57c('0x46')]));_0x145379[_0xa57c('0x43')](get_open_tabs(_0xa57c('0x47'),_0x3c3292[_0xa57c('0x46')]));_0x145379['push'](get_open_tabs(_0xa57c('0x48'),_0x3c3292[_0xa57c('0x46')]));return BPromise[_0xa57c('0x4b')](_0x145379);})['then'](function(_0x5ceafb){var _0x2cda97=[];if(_0x5ceafb){for(var _0x297f25=0x0;_0x297f25<values['ChatOpenTabs'][_0xa57c('0x42')];_0x297f25++){var _0x1dc024=values[_0xa57c('0xb5')][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':_0xa57c('0xb6'),'id':_0x1dc024['id'],'createdAt':_0x1dc024[_0xa57c('0xb7')]});}for(var _0x297f25=0x0;_0x297f25<values['FaxOpenTabs']['length'];_0x297f25++){var _0x1dc024=values['FaxOpenTabs'][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':'FAX','id':_0x1dc024['id'],'createdAt':_0x1dc024[_0xa57c('0xb7')]});}for(var _0x297f25=0x0;_0x297f25<values[_0xa57c('0xb8')][_0xa57c('0x42')];_0x297f25++){var _0x1dc024=values['OpenchannelOpenTabs'][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':'OPENCHANNEL','id':_0x1dc024['id'],'createdAt':_0x1dc024[_0xa57c('0xb7')]});}for(var _0x297f25=0x0;_0x297f25<values[_0xa57c('0xb9')][_0xa57c('0x42')];_0x297f25++){var _0x1dc024=values['MailOpenTabs'][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':'MAIL','id':_0x1dc024['id'],'createdAt':_0x1dc024[_0xa57c('0xb7')]});}for(var _0x297f25=0x0;_0x297f25<values[_0xa57c('0xba')][_0xa57c('0x42')];_0x297f25++){var _0x1dc024=values[_0xa57c('0xba')][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':_0xa57c('0xbb'),'id':_0x1dc024['id'],'createdAt':_0x1dc024['createdAt']});}for(var _0x297f25=0x0;_0x297f25<values[_0xa57c('0xbc')][_0xa57c('0x42')];_0x297f25++){var _0x1dc024=values[_0xa57c('0xbc')][_0x297f25];_0x2cda97[_0xa57c('0x43')]({'channel':'WHATSAPP','id':_0x1dc024['id'],'createdAt':_0x1dc024[_0xa57c('0xb7')]});}var _0x606c63={'count':_0x2cda97['length'],'rows':_0x2cda97};return _0x606c63;}else return null;})[_0xa57c('0x13')](respondWithResult(_0x2c094f,null))[_0xa57c('0x4c')](handleError(_0x2c094f,null));};exports['getContacts']=function(_0x508345,_0x23f476){var _0x28d0df={};var _0x271e84={};var _0x1f81bb;var _0x3516b2;return db['User'][_0xa57c('0xbd')]({'where':{'id':_0x508345[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x23f476,null))[_0xa57c('0x13')](function(_0x5b7bab){if(_0x5b7bab){_0x1f81bb=_0x5b7bab;_0x271e84['model']=_[_0xa57c('0x50')](db['CmContact'][_0xa57c('0x38')]);_0x271e84[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x508345[_0xa57c('0x3d')]);_0x271e84[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x271e84[_0xa57c('0x54')],_0x271e84[_0xa57c('0x3d')]);_0x28d0df['attributes']=_[_0xa57c('0x53')](_0x271e84[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x508345[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x28d0df[_0xa57c('0x40')]=_0x28d0df[_0xa57c('0x40')]['length']?_0x28d0df[_0xa57c('0x40')]:_0x271e84[_0xa57c('0x54')];_0x28d0df[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x508345['query'][_0xa57c('0xbf')]);_0x28d0df['where']=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x508345[_0xa57c('0x3d')],_0x271e84[_0xa57c('0x52')]));if(_0x508345['query'][_0xa57c('0x2e')]){_0x28d0df[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x28d0df['where'],{'$or':_[_0xa57c('0x88')](_0x28d0df[_0xa57c('0x40')],function(_0x289509){var _0x401ff1={};_0x401ff1[_0x289509]={'$like':'%'+_0x508345[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x401ff1;})});}_0x28d0df=_[_0xa57c('0xc1')]({},_0x28d0df,_0x508345[_0xa57c('0x56')]);return _0x1f81bb[_0xa57c('0xc2')](_0x28d0df);}})[_0xa57c('0x13')](function(_0x1c43fc){if(_0x1c43fc){_0x3516b2=_0x1c43fc['length'];if(_0x508345[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0x3e'))){_0x28d0df[_0xa57c('0x3f')]=[{'model':db[_0xa57c('0xc4')],'as':_0xa57c('0xc5'),'required':![]},{'model':db[_0xa57c('0xc6')],'as':'Tags','attributes':['id','name',_0xa57c('0xc7')],'where':_0x508345[_0xa57c('0x3d')][_0xa57c('0xc8')]?{'id':_0x508345[_0xa57c('0x3d')][_0xa57c('0xc8')]}:undefined,'required':_0x508345['query'][_0xa57c('0xc8')]?!![]:![]}];}if(!_0x508345['query'][_0xa57c('0xc3')]('nolimit')){_0x28d0df[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x508345[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x28d0df[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x508345[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x1f81bb[_0xa57c('0xc2')](_0x28d0df);}})['then'](function(_0x38b40c){if(_0x38b40c){return _0x38b40c?{'count':_0x3516b2,'rows':_0x38b40c}:null;}})[_0xa57c('0x13')](respondWithResult(_0x23f476,null))[_0xa57c('0x4c')](handleError(_0x23f476,null));};exports[_0xa57c('0xc9')]=function(_0x1f3cef,_0x9133c8){var _0x2fc178;var _0x49fe5c;var _0xc5136d={};var _0x35ba4f;return db['User']['findOne']({'where':{'id':_0x1f3cef[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),_0xa57c('0x32')]})[_0xa57c('0x13')](handleEntityNotFound(_0x9133c8,null))['then'](function(_0x539c4b){if(!utils['isValidChannel'](_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0xa8')])){throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0xa9'));}_0x2fc178=_0x539c4b;var _0x260e0f={};_0x260e0f[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_[_0xa57c('0x9c')](_0x1f3cef['query']['channel'])+_0xa57c('0xca')]['rawAttributes']);_0x260e0f['query']=_[_0xa57c('0x50')](_0x1f3cef[_0xa57c('0x3d')]);_0x260e0f[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x260e0f[_0xa57c('0x54')],_0x260e0f[_0xa57c('0x3d')]);_0xc5136d[_0xa57c('0x40')]=_['intersection'](_0x260e0f[_0xa57c('0x54')],qs['fields'](_0x1f3cef['query'][_0xa57c('0x55')]));_0xc5136d[_0xa57c('0x40')]=_0xc5136d[_0xa57c('0x40')]['length']?_0xc5136d[_0xa57c('0x40')]:_0x260e0f[_0xa57c('0x54')];_0xc5136d[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0xc5136d['where']=qs['filters'](_[_0xa57c('0xc0')](_0x1f3cef['query'],_0x260e0f[_0xa57c('0x52')]));if(_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0xc5136d[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0xc5136d[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0xc5136d['attributes'],function(_0x43d328){var _0x488d61={};_0x488d61[_0x43d328]={'$like':'%'+_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x488d61;})});}_0xc5136d=_[_0xa57c('0xc1')]({},_0xc5136d,_0x1f3cef[_0xa57c('0x56')]);switch(_0x2fc178['role']){case _0xa57c('0x28'):return db[_['capitalize'](_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0xa8')])+_0xa57c('0xca')][_0xa57c('0x86')](_0xc5136d);case _0xa57c('0x7a'):case _0xa57c('0x2b'):return _0x2fc178[_0xa57c('0x27')+_[_0xa57c('0x9c')](_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0xa8')])+_0xa57c('0x9a')](_0xc5136d);default:throw new db[(_0xa57c('0x8e'))]['ValidationError'](_0xa57c('0xcb'));}})[_0xa57c('0x13')](function(_0x50c75b){_0x35ba4f=_0x50c75b[_0xa57c('0x42')];if(!_0x1f3cef[_0xa57c('0x3d')]['hasOwnProperty'](_0xa57c('0xcc'))){_0xc5136d[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x1f3cef[_0xa57c('0x3d')][_0xa57c('0x23')]);_0xc5136d[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x1f3cef['query']['offset']);}switch(_0x2fc178[_0xa57c('0x32')]){case'admin':return db[_[_0xa57c('0x9c')](_0x1f3cef['query'][_0xa57c('0xa8')])+_0xa57c('0xca')][_0xa57c('0x86')](_0xc5136d);case _0xa57c('0x7a'):case _0xa57c('0x2b'):return _0x2fc178[_0xa57c('0x27')+_[_0xa57c('0x9c')](_0x1f3cef[_0xa57c('0x3d')]['channel'])+_0xa57c('0x9a')](_0xc5136d);}})[_0xa57c('0x13')](function(_0x5671e6){return{'count':_0x35ba4f,'rows':_0x5671e6};})[_0xa57c('0x13')](respondWithResult(_0x9133c8,null))[_0xa57c('0x4c')](handleError(_0x9133c8,null));};exports[_0xa57c('0xcd')]=function(_0x282d34,_0x599fba){var _0x5ab8ac={};var _0x1d4da5={};var _0x3f7634;var _0x14a06d;return db['User']['findOne']({'where':{'id':_0x282d34[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x599fba,null))[_0xa57c('0x13')](function(_0x95af08){if(_0x95af08){_0x3f7634=_0x95af08;_0x1d4da5['model']=_['keys'](db['UserVoiceQueueRt'][_0xa57c('0x38')]);_0x1d4da5[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x282d34[_0xa57c('0x3d')]);_0x1d4da5['filters']=_[_0xa57c('0x53')](_0x1d4da5[_0xa57c('0x54')],_0x1d4da5[_0xa57c('0x3d')]);_0x5ab8ac[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x1d4da5[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x282d34[_0xa57c('0x3d')]['fields']));_0x5ab8ac['attributes']=_0x5ab8ac['attributes'][_0xa57c('0x42')]?_0x5ab8ac[_0xa57c('0x40')]:_0x1d4da5[_0xa57c('0x54')];_0x5ab8ac[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x282d34[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x5ab8ac[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x282d34[_0xa57c('0x3d')],_0x1d4da5[_0xa57c('0x52')]));if(_0x282d34[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x5ab8ac['where']=_[_0xa57c('0xc1')](_0x5ab8ac[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x5ab8ac[_0xa57c('0x40')],function(_0xfadd41){var _0xe76927={};_0xe76927[_0xfadd41]={'$like':'%'+_0x282d34[_0xa57c('0x3d')]['filter']+'%'};return _0xe76927;})});}_0x5ab8ac=_[_0xa57c('0xc1')]({},_0x5ab8ac,_0x282d34['options']);return _0x3f7634[_0xa57c('0xcd')](_0x5ab8ac);}})[_0xa57c('0x13')](function(_0x5de143){if(_0x5de143){_0x14a06d=_0x5de143['length'];if(!_0x282d34[_0xa57c('0x3d')][_0xa57c('0xc3')]('nolimit')){_0x5ab8ac['limit']=qs[_0xa57c('0x23')](_0x282d34[_0xa57c('0x3d')]['limit']);_0x5ab8ac[_0xa57c('0x21')]=qs['offset'](_0x282d34[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x3f7634[_0xa57c('0xcd')](_0x5ab8ac);}})[_0xa57c('0x13')](function(_0x3de2d3){if(_0x3de2d3){return _0x3de2d3?{'count':_0x14a06d,'rows':_0x3de2d3}:null;}})[_0xa57c('0x13')](respondWithResult(_0x599fba,null))[_0xa57c('0x4c')](handleError(_0x599fba,null));};exports['getGroups']=function(_0x3bbd06,_0x3620e2){var _0x51c3c6={};var _0x20a17c={};var _0x5d2760;var _0x3dd1dc;return db['User'][_0xa57c('0xbd')]({'where':{'id':_0x3bbd06[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x3620e2,null))[_0xa57c('0x13')](function(_0x5e0633){if(_0x5e0633){_0x5d2760=_0x5e0633;_0x20a17c[_0xa57c('0x54')]=_['keys'](db[_0xa57c('0xce')]['rawAttributes']);_0x20a17c['query']=_[_0xa57c('0x50')](_0x3bbd06[_0xa57c('0x3d')]);_0x20a17c[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x20a17c[_0xa57c('0x54')],_0x20a17c[_0xa57c('0x3d')]);_0x51c3c6[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x20a17c['model'],qs['fields'](_0x3bbd06['query']['fields']));_0x51c3c6[_0xa57c('0x40')]=_0x51c3c6[_0xa57c('0x40')][_0xa57c('0x42')]?_0x51c3c6[_0xa57c('0x40')]:_0x20a17c[_0xa57c('0x54')];_0x51c3c6['order']=qs[_0xa57c('0xbf')](_0x3bbd06['query'][_0xa57c('0xbf')]);_0x51c3c6[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x3bbd06[_0xa57c('0x3d')],_0x20a17c[_0xa57c('0x52')]));if(_0x3bbd06[_0xa57c('0x3d')]['filter']){_0x51c3c6[_0xa57c('0x3c')]=_['merge'](_0x51c3c6[_0xa57c('0x3c')],{'$or':_['map'](_0x51c3c6[_0xa57c('0x40')],function(_0x929c06){var _0x584a81={};_0x584a81[_0x929c06]={'$like':'%'+_0x3bbd06['query']['filter']+'%'};return _0x584a81;})});}_0x51c3c6=_[_0xa57c('0xc1')]({},_0x51c3c6,_0x3bbd06[_0xa57c('0x56')]);return _0x5d2760[_0xa57c('0xcf')](_0x51c3c6);}})[_0xa57c('0x13')](function(_0x4a9550){if(_0x4a9550){_0x3dd1dc=_0x4a9550[_0xa57c('0x42')];if(!_0x3bbd06[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x51c3c6['limit']=qs[_0xa57c('0x23')](_0x3bbd06['query'][_0xa57c('0x23')]);_0x51c3c6[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x3bbd06[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x5d2760[_0xa57c('0xcf')](_0x51c3c6);}})[_0xa57c('0x13')](function(_0x2b9a82){if(_0x2b9a82){return _0x2b9a82?{'count':_0x3dd1dc,'rows':_0x2b9a82}:null;}})[_0xa57c('0x13')](respondWithResult(_0x3620e2,null))[_0xa57c('0x4c')](handleError(_0x3620e2,null));};exports[_0xa57c('0xd0')]=function(_0x2bd515,_0x217f14){var _0x4b62e6={'raw':!![],'where':{}};var _0x2b2e88={};var _0x1e4594={'count':0x0,'rows':[]};return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x2bd515['params']['id']}})['then'](handleEntityNotFound(_0x217f14,null))[_0xa57c('0x13')](function(_0x320edb){if(_0x320edb){_0x2b2e88[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0xd1')][_0xa57c('0x38')]);_0x2b2e88['query']=_[_0xa57c('0x50')](_0x2bd515[_0xa57c('0x3d')]);_0x2b2e88[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x2b2e88[_0xa57c('0x54')],_0x2b2e88['query']);_0x4b62e6[_0xa57c('0x40')]=_['intersection'](_0x2b2e88['model'],qs[_0xa57c('0x55')](_0x2bd515[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x4b62e6[_0xa57c('0x40')]=_0x4b62e6[_0xa57c('0x40')][_0xa57c('0x42')]?_0x4b62e6[_0xa57c('0x40')]:_0x2b2e88[_0xa57c('0x54')];if(!_0x2bd515[_0xa57c('0x3d')][_0xa57c('0xc3')]('nolimit')){_0x4b62e6[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x2bd515[_0xa57c('0x3d')]['limit']);_0x4b62e6['offset']=qs['offset'](_0x2bd515['query'][_0xa57c('0x21')]);}_0x4b62e6[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x2bd515[_0xa57c('0x3d')]['sort']);_0x4b62e6[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_['pick'](_0x2bd515[_0xa57c('0x3d')],_0x2b2e88[_0xa57c('0x52')]));_0x4b62e6[_0xa57c('0x3c')]['UserId']=_0x320edb['id'];if(_0x2bd515[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x4b62e6[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x4b62e6[_0xa57c('0x3c')],{'$or':_['map'](_0x4b62e6[_0xa57c('0x40')],function(_0x1bd990){var _0x342558={};_0x342558[_0x1bd990]={'$like':'%'+_0x2bd515[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x342558;})});}_0x4b62e6=_['merge']({},_0x4b62e6,_0x2bd515[_0xa57c('0x56')]);return db[_0xa57c('0xd1')][_0xa57c('0x24')]({'where':_0x4b62e6['where']})[_0xa57c('0x13')](function(_0x4a6375){_0x1e4594[_0xa57c('0x24')]=_0x4a6375;if(_0x2bd515[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x4b62e6[_0xa57c('0x3f')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa57c('0x86')](_0x4b62e6);})[_0xa57c('0x13')](function(_0x4913d5){_0x1e4594[_0xa57c('0x41')]=_0x4913d5;return _0x1e4594;});}})['then'](respondWithFilteredResult(_0x217f14,_0x4b62e6))['catch'](handleError(_0x217f14,null));};exports[_0xa57c('0xd2')]=function(_0x2c5a19,_0x9fcbdc){var _0x51d955={'raw':!![],'where':{}};var _0x412efd={};var _0x28a7c3={'count':0x0,'rows':[]};return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x2c5a19[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x9fcbdc,null))[_0xa57c('0x13')](function(_0x364b47){if(_0x364b47){_0x412efd[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0xd3')]['rawAttributes']);_0x412efd[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x2c5a19[_0xa57c('0x3d')]);_0x412efd['filters']=_[_0xa57c('0x53')](_0x412efd[_0xa57c('0x54')],_0x412efd[_0xa57c('0x3d')]);_0x51d955[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x412efd[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x2c5a19[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x51d955['attributes']=_0x51d955[_0xa57c('0x40')][_0xa57c('0x42')]?_0x51d955['attributes']:_0x412efd[_0xa57c('0x54')];if(!_0x2c5a19[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x51d955[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x2c5a19['query'][_0xa57c('0x23')]);_0x51d955['offset']=qs[_0xa57c('0x21')](_0x2c5a19['query'][_0xa57c('0x21')]);}_0x51d955[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x2c5a19[_0xa57c('0x3d')]['sort']);_0x51d955[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x2c5a19['query'],_0x412efd['filters']));_0x51d955[_0xa57c('0x3c')][_0xa57c('0xd4')]=_0x364b47['id'];if(_0x2c5a19[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x51d955[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x51d955[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x51d955[_0xa57c('0x40')],function(_0x5f25e3){var _0x451e93={};_0x451e93[_0x5f25e3]={'$like':'%'+_0x2c5a19[_0xa57c('0x3d')]['filter']+'%'};return _0x451e93;})});}_0x51d955=_['merge']({},_0x51d955,_0x2c5a19['options']);return db['ScreenRecording'][_0xa57c('0x24')]({'where':_0x51d955[_0xa57c('0x3c')]})['then'](function(_0x5e9312){_0x28a7c3[_0xa57c('0x24')]=_0x5e9312;if(_0x2c5a19[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x51d955[_0xa57c('0x3f')]=[{'all':!![]}];}return db[_0xa57c('0xd3')][_0xa57c('0x86')](_0x51d955);})[_0xa57c('0x13')](function(_0x258412){_0x28a7c3[_0xa57c('0x41')]=_0x258412;return _0x28a7c3;});}})[_0xa57c('0x13')](respondWithFilteredResult(_0x9fcbdc,_0x51d955))['catch'](handleError(_0x9fcbdc,null));};exports['getChatInteractions']=function(_0x1dcf76,_0x7f4f06){var _0x4d900b={};var _0x5e7c20={};var _0x1069cb;var _0xcf2c2a;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x1dcf76[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x7f4f06,null))['then'](function(_0x2a039e){if(_0x2a039e){_0x1069cb=_0x2a039e;_0x5e7c20[_0xa57c('0x54')]=_[_0xa57c('0x50')](db['ChatInteraction'][_0xa57c('0x38')]);_0x5e7c20[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x1dcf76[_0xa57c('0x3d')]);_0x5e7c20[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x5e7c20[_0xa57c('0x54')],_0x5e7c20[_0xa57c('0x3d')]);_0x4d900b[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x5e7c20[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x1dcf76['query'][_0xa57c('0x55')]));_0x4d900b[_0xa57c('0x40')]=_0x4d900b['attributes'][_0xa57c('0x42')]?_0x4d900b['attributes']:_0x5e7c20[_0xa57c('0x54')];_0x4d900b[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x1dcf76[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x4d900b[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x1dcf76['query'],_0x5e7c20[_0xa57c('0x52')]));if(_0x1dcf76['query'][_0xa57c('0x2e')]){_0x4d900b[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x4d900b['where'],{'$or':_['map'](_0x4d900b[_0xa57c('0x40')],function(_0x5d2a9c){var _0x752d42={};_0x752d42[_0x5d2a9c]={'$like':'%'+_0x1dcf76[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x752d42;})});}_0x4d900b=_[_0xa57c('0xc1')]({},_0x4d900b,_0x1dcf76[_0xa57c('0x56')]);return _0x1069cb[_0xa57c('0xd5')](_0x4d900b);}})[_0xa57c('0x13')](function(_0x5239b8){if(_0x5239b8){_0xcf2c2a=_0x5239b8[_0xa57c('0x42')];if(!_0x1dcf76['query'][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x4d900b[_0xa57c('0x23')]=qs['limit'](_0x1dcf76['query'][_0xa57c('0x23')]);_0x4d900b[_0xa57c('0x21')]=qs['offset'](_0x1dcf76[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x1069cb[_0xa57c('0xd5')](_0x4d900b);}})[_0xa57c('0x13')](function(_0xd5202c){if(_0xd5202c){return _0xd5202c?{'count':_0xcf2c2a,'rows':_0xd5202c}:null;}})[_0xa57c('0x13')](respondWithResult(_0x7f4f06,null))[_0xa57c('0x4c')](handleError(_0x7f4f06,null));};exports[_0xa57c('0xd6')]=function(_0x84a5ef,_0x5951c9){var _0x40ca11={};var _0x8a5f50={};var _0x4b6e6d;var _0x2f4384;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x84a5ef[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5951c9,null))['then'](function(_0x487d48){if(_0x487d48){_0x4b6e6d=_0x487d48;_0x8a5f50['model']=_[_0xa57c('0x50')](db[_0xa57c('0xd7')][_0xa57c('0x38')]);_0x8a5f50['query']=_[_0xa57c('0x50')](_0x84a5ef[_0xa57c('0x3d')]);_0x8a5f50[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x8a5f50[_0xa57c('0x54')],_0x8a5f50[_0xa57c('0x3d')]);_0x40ca11[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x8a5f50['model'],qs[_0xa57c('0x55')](_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x40ca11['attributes']=_0x40ca11['attributes'][_0xa57c('0x42')]?_0x40ca11[_0xa57c('0x40')]:_0x8a5f50['model'];_0x40ca11[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x40ca11[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x84a5ef[_0xa57c('0x3d')],_0x8a5f50[_0xa57c('0x52')]));if(_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x40ca11[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x40ca11[_0xa57c('0x3c')],{'$or':_['map'](_0x40ca11[_0xa57c('0x40')],function(_0x657b5d){var _0x42ac0a={};_0x42ac0a[_0x657b5d]={'$like':'%'+_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x42ac0a;})});}_0x40ca11=_[_0xa57c('0xc1')]({},_0x40ca11,_0x84a5ef[_0xa57c('0x56')]);return _0x4b6e6d[_0xa57c('0xd6')](_0x40ca11);}})['then'](function(_0x47d49e){if(_0x47d49e){_0x2f4384=_0x47d49e[_0xa57c('0x42')];if(!_0x84a5ef['query']['hasOwnProperty'](_0xa57c('0xcc'))){_0x40ca11[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x40ca11[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x84a5ef[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x4b6e6d[_0xa57c('0xd6')](_0x40ca11);}})[_0xa57c('0x13')](function(_0x119276){if(_0x119276){return _0x119276?{'count':_0x2f4384,'rows':_0x119276}:null;}})['then'](respondWithResult(_0x5951c9,null))['catch'](handleError(_0x5951c9,null));};exports['getMailInteractions']=function(_0x5b7932,_0x31f0c0){var _0x4565f8={'raw':!![],'where':{}};var _0x1c3908={};var _0x41c713={'count':0x0,'rows':[]};return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x5b7932[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x31f0c0,null))[_0xa57c('0x13')](function(_0x4ee3f0){if(_0x4ee3f0){_0x1c3908[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0xd8')][_0xa57c('0x38')]);_0x1c3908[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x5b7932[_0xa57c('0x3d')]);_0x1c3908[_0xa57c('0x52')]=_['intersection'](_0x1c3908['model'],_0x1c3908[_0xa57c('0x3d')]);_0x4565f8['attributes']=_[_0xa57c('0x53')](_0x1c3908[_0xa57c('0x54')],qs['fields'](_0x5b7932[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x4565f8[_0xa57c('0x40')]=_0x4565f8[_0xa57c('0x40')][_0xa57c('0x42')]?_0x4565f8[_0xa57c('0x40')]:_0x1c3908[_0xa57c('0x54')];if(!_0x5b7932[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x4565f8['limit']=qs[_0xa57c('0x23')](_0x5b7932[_0xa57c('0x3d')]['limit']);_0x4565f8[_0xa57c('0x21')]=qs['offset'](_0x5b7932[_0xa57c('0x3d')][_0xa57c('0x21')]);}_0x4565f8['order']=qs[_0xa57c('0xbf')](_0x5b7932['query'][_0xa57c('0xbf')]);_0x4565f8[_0xa57c('0x3c')]=qs['filters'](_[_0xa57c('0xc0')](_0x5b7932[_0xa57c('0x3d')],_0x1c3908[_0xa57c('0x52')]));_0x4565f8[_0xa57c('0x3c')][_0xa57c('0xd4')]=_0x4ee3f0['id'];if(_0x5b7932[_0xa57c('0x3d')]['filter']){_0x4565f8['where']=_[_0xa57c('0xc1')](_0x4565f8[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x4565f8['attributes'],function(_0x5d9389){var _0x14eda3={};_0x14eda3[_0x5d9389]={'$like':'%'+_0x5b7932[_0xa57c('0x3d')]['filter']+'%'};return _0x14eda3;})});}_0x4565f8=_['merge']({},_0x4565f8,_0x5b7932[_0xa57c('0x56')]);return db[_0xa57c('0xd8')][_0xa57c('0x24')]({'where':_0x4565f8[_0xa57c('0x3c')]})[_0xa57c('0x13')](function(_0x3c5e7e){_0x41c713['count']=_0x3c5e7e;if(_0x5b7932['query'][_0xa57c('0x3e')]){_0x4565f8[_0xa57c('0x3f')]=[{'all':!![]}];}return db[_0xa57c('0xd8')][_0xa57c('0x86')](_0x4565f8);})['then'](function(_0x2b59bb){_0x41c713['rows']=_0x2b59bb;return _0x41c713;});}})['then'](respondWithFilteredResult(_0x31f0c0,_0x4565f8))['catch'](handleError(_0x31f0c0,null));};exports[_0xa57c('0xd9')]=function(_0x1d255a,_0x1f22b3){var _0x47a7fc={};var _0x28548b={};var _0x537b44;var _0x23ea23;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x1d255a[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1f22b3,null))[_0xa57c('0x13')](function(_0x184e7c){if(_0x184e7c){_0x537b44=_0x184e7c;_0x28548b[_0xa57c('0x54')]=_['keys'](db[_0xa57c('0xda')][_0xa57c('0x38')]);_0x28548b['query']=_[_0xa57c('0x50')](_0x1d255a['query']);_0x28548b[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x28548b[_0xa57c('0x54')],_0x28548b[_0xa57c('0x3d')]);_0x47a7fc[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x28548b[_0xa57c('0x54')],qs['fields'](_0x1d255a[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x47a7fc['attributes']=_0x47a7fc[_0xa57c('0x40')][_0xa57c('0x42')]?_0x47a7fc[_0xa57c('0x40')]:_0x28548b['model'];_0x47a7fc[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x1d255a[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x47a7fc['where']=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x1d255a[_0xa57c('0x3d')],_0x28548b[_0xa57c('0x52')]));if(_0x1d255a[_0xa57c('0x3d')]['filter']){_0x47a7fc[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x47a7fc['where'],{'$or':_[_0xa57c('0x88')](_0x47a7fc[_0xa57c('0x40')],function(_0x2cee8c){var _0x18e2e9={};_0x18e2e9[_0x2cee8c]={'$like':'%'+_0x1d255a[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x18e2e9;})});}_0x47a7fc=_['merge']({},_0x47a7fc,_0x1d255a[_0xa57c('0x56')]);return _0x537b44[_0xa57c('0xd9')](_0x47a7fc);}})[_0xa57c('0x13')](function(_0x25f404){if(_0x25f404){_0x23ea23=_0x25f404[_0xa57c('0x42')];if(!_0x1d255a['query'][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x47a7fc[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x1d255a['query'][_0xa57c('0x23')]);_0x47a7fc[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x1d255a[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x537b44[_0xa57c('0xd9')](_0x47a7fc);}})[_0xa57c('0x13')](function(_0x548cbe){if(_0x548cbe){return _0x548cbe?{'count':_0x23ea23,'rows':_0x548cbe}:null;}})[_0xa57c('0x13')](respondWithResult(_0x1f22b3,null))['catch'](handleError(_0x1f22b3,null));};exports[_0xa57c('0xdb')]=function(_0x10a24c,_0x4316b0){var _0x4c0543={};var _0x129cd2={};var _0x3113cc;var _0x40a5bb;return db['User']['findOne']({'where':{'id':_0x10a24c[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x4316b0,null))['then'](function(_0x552462){if(_0x552462){_0x3113cc=_0x552462;_0x129cd2[_0xa57c('0x54')]=_['keys'](db[_0xa57c('0xdc')][_0xa57c('0x38')]);_0x129cd2[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x10a24c['query']);_0x129cd2['filters']=_[_0xa57c('0x53')](_0x129cd2[_0xa57c('0x54')],_0x129cd2[_0xa57c('0x3d')]);_0x4c0543['attributes']=_['intersection'](_0x129cd2[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x10a24c[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x4c0543[_0xa57c('0x40')]=_0x4c0543['attributes']['length']?_0x4c0543['attributes']:_0x129cd2[_0xa57c('0x54')];_0x4c0543['order']=qs['sort'](_0x10a24c[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x4c0543[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x10a24c[_0xa57c('0x3d')],_0x129cd2['filters']));if(_0x10a24c[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x4c0543[_0xa57c('0x3c')]=_['merge'](_0x4c0543[_0xa57c('0x3c')],{'$or':_['map'](_0x4c0543['attributes'],function(_0x4df30e){var _0x2ee848={};_0x2ee848[_0x4df30e]={'$like':'%'+_0x10a24c[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x2ee848;})});}_0x4c0543=_[_0xa57c('0xc1')]({},_0x4c0543,_0x10a24c['options']);return _0x3113cc[_0xa57c('0xdb')](_0x4c0543);}})[_0xa57c('0x13')](function(_0x55eeb3){if(_0x55eeb3){_0x40a5bb=_0x55eeb3[_0xa57c('0x42')];if(!_0x10a24c[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x4c0543[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x10a24c[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x4c0543[_0xa57c('0x21')]=qs['offset'](_0x10a24c[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x3113cc[_0xa57c('0xdb')](_0x4c0543);}})[_0xa57c('0x13')](function(_0x2bbd71){if(_0x2bbd71){return _0x2bbd71?{'count':_0x40a5bb,'rows':_0x2bbd71}:null;}})['then'](respondWithResult(_0x4316b0,null))[_0xa57c('0x4c')](handleError(_0x4316b0,null));};exports[_0xa57c('0xdd')]=function(_0x23cd94,_0x37a2c0){var _0x3346f2={};var _0x330163={};var _0x153147;var _0x2dae27;return db['User']['findOne']({'where':{'id':_0x23cd94['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x37a2c0,null))[_0xa57c('0x13')](function(_0x28182e){if(_0x28182e){_0x153147=_0x28182e;_0x330163[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0xde')][_0xa57c('0x38')]);_0x330163[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x23cd94[_0xa57c('0x3d')]);_0x330163['filters']=_[_0xa57c('0x53')](_0x330163[_0xa57c('0x54')],_0x330163[_0xa57c('0x3d')]);_0x3346f2[_0xa57c('0x40')]=_['intersection'](_0x330163['model'],qs[_0xa57c('0x55')](_0x23cd94[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x3346f2[_0xa57c('0x40')]=_0x3346f2[_0xa57c('0x40')]['length']?_0x3346f2[_0xa57c('0x40')]:_0x330163[_0xa57c('0x54')];_0x3346f2[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x23cd94[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x3346f2[_0xa57c('0x3c')]=qs['filters'](_['pick'](_0x23cd94[_0xa57c('0x3d')],_0x330163[_0xa57c('0x52')]));if(_0x23cd94[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x3346f2[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x3346f2[_0xa57c('0x3c')],{'$or':_['map'](_0x3346f2[_0xa57c('0x40')],function(_0x220996){var _0x4c57be={};_0x4c57be[_0x220996]={'$like':'%'+_0x23cd94['query'][_0xa57c('0x2e')]+'%'};return _0x4c57be;})});}_0x3346f2=_['merge']({},_0x3346f2,_0x23cd94['options']);return _0x153147[_0xa57c('0xdd')](_0x3346f2);}})[_0xa57c('0x13')](function(_0x278e66){if(_0x278e66){_0x2dae27=_0x278e66[_0xa57c('0x42')];if(!_0x23cd94[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x3346f2[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x23cd94[_0xa57c('0x3d')]['limit']);_0x3346f2[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x23cd94[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x153147[_0xa57c('0xdd')](_0x3346f2);}})['then'](function(_0x589d6a){if(_0x589d6a){return _0x589d6a?{'count':_0x2dae27,'rows':_0x589d6a}:null;}})[_0xa57c('0x13')](respondWithResult(_0x37a2c0,null))[_0xa57c('0x4c')](handleError(_0x37a2c0,null));};exports['login']=function(_0x155538,_0x3a8bb3,_0x1a1d7d){var _0x5f3cec;var _0x360474;var _0x372723;var _0x1e1f89=!_[_0xa57c('0x63')](_0x155538[_0xa57c('0x4e')]['id'])?_0x155538[_0xa57c('0x4e')]['id']:!_['isNil'](_0x155538['user']['id'])?_0x155538[_0xa57c('0x7a')]['id']:null;return db['User'][_0xa57c('0x57')]({'where':{'id':_0x1e1f89,'role':{'$or':[_0xa57c('0x28'),_0xa57c('0x7a'),_0xa57c('0x2b')]}},'attributes':['id',_0xa57c('0x33'),_0xa57c('0xdf'),_0xa57c('0xe0'),'role',_0xa57c('0x5f'),_0xa57c('0x97')]})[_0xa57c('0x13')](function(_0x2b134b){if(_0x2b134b){if(_0x2b134b[_0xa57c('0x32')]===_0xa57c('0x2b')){_0x5f3cec=_0x2b134b;if(_0x155538[_0xa57c('0x5a')][_0xa57c('0xa2')]){_0x372723=util[_0xa57c('0xa3')](_0xa57c('0xe1'),_0x5f3cec[_0x155538[_0xa57c('0x5a')][_0xa57c('0xa2')]]);}else if(_0x155538[_0xa57c('0x5a')]['intrf']){_0x372723=util[_0xa57c('0xa3')](_0xa57c('0xa4'),_0x155538[_0xa57c('0x5a')]['intrf']);}else{_0x372723=util[_0xa57c('0xa3')](_0xa57c('0xa4'),_0x5f3cec[_0xa57c('0x33')]);}socket['to'](util[_0xa57c('0xa3')](_0xa57c('0xe2'),_0x5f3cec[_0xa57c('0x33')]))[_0xa57c('0x9e')](_0xa57c('0xe3'),{'user':{'id':_0x5f3cec['id'],'name':_0x5f3cec['name']},'ip':_0x155538[_0xa57c('0xe4')][_0xa57c('0xe5')]||_0x155538[_0xa57c('0xe6')]['remoteAddress']||_0x155538[_0xa57c('0xe7')][_0xa57c('0xe8')]||_0x155538[_0xa57c('0xe6')][_0xa57c('0xe7')][_0xa57c('0xe8')]});return db['UserVoiceQueueRt'][_0xa57c('0x34')]({'where':{'membername':_0x5f3cec[_0xa57c('0x33')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xa57c('0x13')](function(){if(_0x5f3cec){return _0x5f3cec[_0xa57c('0xe9')]({'raw':!![]});}})['then'](function(_0x5ce77e){if(_0x5f3cec){var _0xa5e6e4=[];if(_0x5ce77e){_0x360474=_0x5ce77e;if(_0x360474[_0xa57c('0x42')]){for(var _0x343236=0x0;_0x343236<_0x360474[_0xa57c('0x42')];_0x343236++){_0xa5e6e4[_0xa57c('0x43')]({'membername':_0x5f3cec[_0xa57c('0x33')],'UserId':_0x5f3cec['id'],'queue_name':_0x360474[_0x343236][_0xa57c('0x33')],'VoiceQueueId':_0x360474[_0x343236]['id'],'interface':_0x372723,'paused':_0x5f3cec[_0xa57c('0x97')]||![],'penalty':_0x360474[_0x343236][_0xa57c('0xea')]||0x0});}return BPromise[_0xa57c('0xa6')](_0xa5e6e4,function(_0x2ab65a){return db[_0xa57c('0xeb')][_0xa57c('0xa7')](_0x2ab65a);});}}}})[_0xa57c('0x13')](function(){if(_0x5f3cec){return db[_0xa57c('0xec')]['findAll']({'where':{'membername':_0x5f3cec['name'],'exitAt':null}});}})[_0xa57c('0x13')](function(_0x59e9be){if(_0x5f3cec){var _0x3c7440=[];_0x59e9be[_0xa57c('0xed')](function(_0x19d133){_0x3c7440[_0xa57c('0x43')](_0x19d133[_0xa57c('0x26')]({'exitAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee'))}));});return BPromise[_0xa57c('0x4b')](_0x3c7440);}})['then'](function(){if(_0x5f3cec){var _0x3eb1e7=[];var _0x49e8d9=[];var _0x38a99a=utils[_0xa57c('0xef')]();var _0x4f884d={'membername':_0x5f3cec['name'],'interface':_0x372723,'enterAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee')),'role':_0x5f3cec[_0xa57c('0x32')],'internal':_0x5f3cec[_0xa57c('0x5f')]};_0x38a99a[_0xa57c('0xed')](function(_0x28db8a){_0x3eb1e7[_0xa57c('0x43')](_[_0xa57c('0xc1')]({'channel':_0x28db8a,'type':'LOGIN','data1':_0x155538[_0xa57c('0x5a')][_0xa57c('0xf0')],'data2':_0x372723},_0x4f884d));if(_0x5f3cec['loginInPause']){_0x49e8d9[_0xa57c('0x43')](_[_0xa57c('0xc1')]({'channel':_0x28db8a,'type':_0xa57c('0xf1'),'data1':'LOGININPAUSE'},_0x4f884d));}});return db[_0xa57c('0xec')][_0xa57c('0x83')](_0x3eb1e7[_0xa57c('0xf2')](_0x49e8d9),{'individualHooks':!![]});}})[_0xa57c('0x13')](function(){if(_0x5f3cec){return _0x5f3cec[_0xa57c('0x26')]({'online':!![],'lastLoginAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee')),'voicePause':_0x5f3cec['loginInPause']||![],'mailPause':_0x5f3cec[_0xa57c('0x97')]||![],'chatPause':_0x5f3cec['loginInPause']||![],'faxPause':_0x5f3cec[_0xa57c('0x97')]||![],'smsPause':_0x5f3cec['loginInPause']||![],'openchannelPause':_0x5f3cec[_0xa57c('0x97')]||![],'whatsappPause':_0x5f3cec[_0xa57c('0x97')]||![],'pauseType':_0x5f3cec[_0xa57c('0x97')]?_0xa57c('0xf3'):null,'interface':_0x372723,'lastPauseAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee'))});}})[_0xa57c('0x13')](function(_0x2da56a){if(_0x155538[_0xa57c('0xf4')]){return _0x1a1d7d();}else{return BPromise[_0xa57c('0xf5')](_0x2da56a)['then'](respondWithResult(_0x3a8bb3,null));}})[_0xa57c('0x4c')](handleError(_0x3a8bb3,null));};exports[_0xa57c('0xf6')]=function(_0x378680,_0xe270b9){var _0x300b8e;return db['User']['find']({'where':{'id':_0x378680[_0xa57c('0x4e')]['id'],'role':_0xa57c('0x2b')},'attributes':['id',_0xa57c('0x33'),'role']})['then'](handleEntityNotFound(_0xe270b9,null))[_0xa57c('0x13')](function(_0x52d01e){if(_0x52d01e){_0x300b8e=_0x52d01e;return db[_0xa57c('0xeb')][_0xa57c('0x34')]({'where':{'membername':_0x300b8e['name']},'individualHooks':!![]});}})[_0xa57c('0x13')](function(){return db['MemberReport'][_0xa57c('0x86')]({'where':{'membername':_0x300b8e['name'],'exitAt':null}});})[_0xa57c('0x13')](function(_0x14cada){var _0x3d2f96=[];_0x14cada[_0xa57c('0xed')](function(_0x59b6c4){_0x3d2f96['push'](_0x59b6c4[_0xa57c('0x26')]({'exitAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee'))}));});return BPromise[_0xa57c('0x4b')](_0x3d2f96);})[_0xa57c('0x13')](function(){return _0x300b8e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0xe270b9,null))[_0xa57c('0x4c')](handleError(_0xe270b9,null));};exports['pause']=function(_0x24e0a2,_0xf0dcd9){var _0x419fbd;return db[_0xa57c('0xeb')][_0xa57c('0x26')]({'paused':0x1},{'where':{'UserId':_0x24e0a2[_0xa57c('0x4e')]['id']},'individualHooks':!![]})[_0xa57c('0x13')](function(){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x24e0a2['params']['id'],'role':'agent'},'attributes':['id',_0xa57c('0x33'),'role',_0xa57c('0x5f'),_0xa57c('0xa2')]});})[_0xa57c('0x13')](handleEntityNotFound(_0xf0dcd9,null))[_0xa57c('0x13')](function(_0x5b5c40){if(_0x5b5c40){_0x419fbd=_0x5b5c40;return respondWithRpcPromise(_0xa57c('0xf7'),_0xa57c('0xf8'),{'id':_0x419fbd['id'],'name':_0x419fbd['name'],'pause':!![]});}})[_0xa57c('0x13')](function(){if(_0x419fbd){return db[_0xa57c('0xec')][_0xa57c('0x86')]({'where':{'membername':_0x419fbd[_0xa57c('0x33')],'type':_0xa57c('0xf1'),'exitAt':null}});}})[_0xa57c('0x13')](function(_0x49afb1){if(_0x49afb1[_0xa57c('0x42')]){var _0x16b77d=moment()[_0xa57c('0xa3')](_0xa57c('0xee'));for(var _0x4fc1d5=0x0,_0x1f3d73=_0x49afb1[_0xa57c('0x42')];_0x4fc1d5<_0x1f3d73;_0x4fc1d5++){_0x49afb1[_0x4fc1d5]['updateAttributes']({'exitAt':_0x16b77d});}}})['then'](function(){var _0x560e3b=[];var _0x3b21f8=utils[_0xa57c('0xef')]();_0x3b21f8['forEach'](function(_0x30cb87){_0x560e3b['push']({'channel':_0x30cb87,'membername':_0x419fbd[_0xa57c('0x33')],'interface':_[_0xa57c('0x63')](_0x419fbd[_0xa57c('0xa2')])?util[_0xa57c('0xa3')](_0xa57c('0xa4'),_0x419fbd[_0xa57c('0x33')]):_0x419fbd[_0xa57c('0xa2')],'type':_0xa57c('0xf1'),'enterAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee')),'data1':_0x24e0a2[_0xa57c('0x5a')][_0xa57c('0x39')]||'DEFAULT\x20PAUSE','role':_0x419fbd[_0xa57c('0x32')],'internal':_0x419fbd[_0xa57c('0x5f')]});});return db['MemberReport']['bulkCreate'](_0x560e3b,{'individualHooks':!![]});})[_0xa57c('0x13')](function(){return _0x419fbd[_0xa57c('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x24e0a2[_0xa57c('0x5a')][_0xa57c('0x39')]||_0xa57c('0xf9'),'lastPauseAt':moment()[_0xa57c('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0xf0dcd9,null))['catch'](handleError(_0xf0dcd9,null));};exports[_0xa57c('0xfa')]=function(_0x18913c,_0x325a19){var _0x559bdc;return db['User'][_0xa57c('0x57')]({'where':{'id':_0x18913c[_0xa57c('0x4e')]['id']},'attributes':['id',_0xa57c('0x33'),'role','voicePause',_0xa57c('0xfb'),_0xa57c('0xfc'),_0xa57c('0xfd'),_0xa57c('0xfe'),_0xa57c('0xff'),'whatsapppause',_0xa57c('0x100'),'lastPauseAt']})['then'](handleEntityNotFound(_0x325a19,null))[_0xa57c('0x13')](function(_0x4ca245){if(_0x4ca245){_0x559bdc=_0x4ca245;if(_0x18913c[_0xa57c('0x5a')][_0xa57c('0xa8')]&&!utils['isValidChannel'](_0x18913c[_0xa57c('0x5a')][_0xa57c('0xa8')])){throw new db[(_0xa57c('0x8e'))][(_0xa57c('0x8c'))]('Unknown\x20channel');}switch(_0x18913c[_0xa57c('0x5a')][_0xa57c('0xa8')]){case'voice':return respondWithRpcPromise(_0xa57c('0xf7'),_0xa57c('0xfa'),{'id':_0x559bdc['id'],'name':_0x559bdc[_0xa57c('0x33')],'pause':![]})[_0xa57c('0x13')](function(){return db[_0xa57c('0xeb')][_0xa57c('0x26')]({'paused':0x0},{'where':{'UserId':_0x559bdc['id']},'individualHooks':!![]});})['then'](function(){return db[_0xa57c('0xec')][_0xa57c('0x57')]({'where':{'channel':_0x18913c['body']['channel'],'membername':_0x559bdc['name'],'type':'PAUSE','exitAt':null}});})[_0xa57c('0x13')](function(_0x4b13c0){if(_0x4b13c0){return _0x4b13c0['update']({'exitAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee')),'data2':_0xa57c('0x101')},{'individualHooks':!![]});}return null;})[_0xa57c('0x13')](function(){return _0x559bdc['update']({'voicePause':![]});});case'mail':case _0xa57c('0x44'):case _0xa57c('0x47'):case _0xa57c('0x45'):case _0xa57c('0x4a'):case _0xa57c('0x49'):return db[_0xa57c('0xec')][_0xa57c('0x57')]({'where':{'channel':_0x18913c[_0xa57c('0x5a')][_0xa57c('0xa8')],'membername':_0x559bdc[_0xa57c('0x33')],'type':_0xa57c('0xf1'),'exitAt':null}})[_0xa57c('0x13')](function(_0x43cdc6){if(_0x43cdc6){return _0x43cdc6[_0xa57c('0x26')]({'exitAt':moment()['format'](_0xa57c('0xee')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x4257c0={};_['set'](_0x4257c0,util['format'](_0xa57c('0x102'),_0x18913c['body']['channel'],_0xa57c('0x103')),![]);return _0x559bdc['update'](_0x4257c0);});default:return respondWithRpcPromise(_0xa57c('0xf7'),_0xa57c('0xfa'),{'id':_0x559bdc['id'],'name':_0x559bdc[_0xa57c('0x33')],'pause':![]})['then'](function(){return db[_0xa57c('0xeb')][_0xa57c('0x26')]({'paused':0x0},{'where':{'UserId':_0x559bdc['id']}});})[_0xa57c('0x13')](function(){return db['MemberReport'][_0xa57c('0x86')]({'where':{'membername':_0x559bdc['name'],'type':'PAUSE','exitAt':null}});})[_0xa57c('0x13')](function(_0x2af1f1){var _0xc31a28=[];_0x2af1f1[_0xa57c('0xed')](function(_0x5da960){_0xc31a28[_0xa57c('0x43')](_0x5da960['update']({'exitAt':moment()[_0xa57c('0xa3')](_0xa57c('0xee')),'data2':'manual'}));});return BPromise['all'](_0xc31a28);})[_0xa57c('0x13')](function(){return _0x559bdc[_0xa57c('0x26')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xa57c('0x13')](respondWithResult(_0x325a19,null))['catch'](handleError(_0x325a19,null));};exports[_0xa57c('0x104')]=function(_0x466bdc,_0x18e701){var _0x2ef323={};var _0x46aa95={};var _0x14c562;var _0x461bb7;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x466bdc[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18e701,null))[_0xa57c('0x13')](function(_0x4e8d68){if(_0x4e8d68){_0x14c562=_0x4e8d68;_0x46aa95[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0x105')][_0xa57c('0x38')]);_0x46aa95[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x466bdc[_0xa57c('0x3d')]);_0x46aa95[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x46aa95[_0xa57c('0x54')],_0x46aa95['query']);_0x2ef323[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x46aa95[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x466bdc[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x2ef323[_0xa57c('0x40')]=_0x2ef323['attributes'][_0xa57c('0x42')]?_0x2ef323[_0xa57c('0x40')]:_0x46aa95[_0xa57c('0x54')];_0x2ef323[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x466bdc[_0xa57c('0x3d')]['sort']);_0x2ef323[_0xa57c('0x3c')]=qs['filters'](_['pick'](_0x466bdc[_0xa57c('0x3d')],_0x46aa95[_0xa57c('0x52')]));if(_0x466bdc[_0xa57c('0x3d')]['filter']){_0x2ef323['where']=_[_0xa57c('0xc1')](_0x2ef323[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x2ef323[_0xa57c('0x40')],function(_0x52d8f9){var _0x24eb5a={};_0x24eb5a[_0x52d8f9]={'$like':'%'+_0x466bdc[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x24eb5a;})});}_0x2ef323=_[_0xa57c('0xc1')]({},_0x2ef323,_0x466bdc[_0xa57c('0x56')]);return _0x14c562[_0xa57c('0x104')](_0x2ef323);}})[_0xa57c('0x13')](function(_0x5b041e){if(_0x5b041e){_0x461bb7=_0x5b041e[_0xa57c('0x42')];if(!_0x466bdc[_0xa57c('0x3d')]['hasOwnProperty']('nolimit')){_0x2ef323['limit']=qs[_0xa57c('0x23')](_0x466bdc[_0xa57c('0x3d')]['limit']);_0x2ef323[_0xa57c('0x21')]=qs['offset'](_0x466bdc[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x14c562[_0xa57c('0x104')](_0x2ef323);}})[_0xa57c('0x13')](function(_0x501f1f){if(_0x501f1f){return _0x501f1f?{'count':_0x461bb7,'rows':_0x501f1f}:null;}})[_0xa57c('0x13')](respondWithResult(_0x18e701,null))[_0xa57c('0x4c')](handleError(_0x18e701,null));};exports['addTeams']=function(_0x426bad,_0x2581c3){return db['User']['find']({'where':{'id':_0x426bad[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x2581c3,null))[_0xa57c('0x13')](function(_0x67e37d){if(_0x67e37d){var _0x5cd5dc=_0x67e37d[_0xa57c('0x27')]({'plain':!![]});return _0x67e37d[_0xa57c('0x106')](_0x426bad['body'][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x426bad[_0xa57c('0x5a')],['ids','id'])||{})['then'](function(){for(var _0x40b493=0x0;_0x40b493<_0x426bad[_0xa57c('0x5a')]['ids'][_0xa57c('0x42')];_0x40b493++){var _0x427b8e=[];var _0x3ca70e={};db[_0xa57c('0x105')][_0xa57c('0xbd')]({'where':{'id':_0x426bad['body'][_0xa57c('0x5d')][_0x40b493]}})[_0xa57c('0x13')](function(_0xd0df0e){_0x3ca70e=_0xd0df0e['dataValues'];_0x427b8e['push'](_0xd0df0e['getVoiceQueues']()[_0xa57c('0x13')](function(_0x23cb43){for(var _0x278b92=0x0;_0x278b92<_0x23cb43[_0xa57c('0x42')];_0x278b92++){_0x23cb43[_0x278b92][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x108'));}return _0x23cb43;}));_0x427b8e[_0xa57c('0x43')](_0xd0df0e[_0xa57c('0x109')]()['then'](function(_0x4b6519){for(var _0x1b6ad2=0x0;_0x1b6ad2<_0x4b6519[_0xa57c('0x42')];_0x1b6ad2++){_0x4b6519[_0x1b6ad2][_0xa57c('0x107')]('channel',_0xa57c('0x10a'));}return _0x4b6519;}));_0x427b8e[_0xa57c('0x43')](_0xd0df0e[_0xa57c('0x10b')]()[_0xa57c('0x13')](function(_0x2125d7){for(var _0x2142e2=0x0;_0x2142e2<_0x2125d7[_0xa57c('0x42')];_0x2142e2++){_0x2125d7[_0x2142e2][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x10c'));}return _0x2125d7;}));_0x427b8e[_0xa57c('0x43')](_0xd0df0e[_0xa57c('0x10d')]()[_0xa57c('0x13')](function(_0x23b820){for(var _0x4701df=0x0;_0x4701df<_0x23b820[_0xa57c('0x42')];_0x4701df++){_0x23b820[_0x4701df][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x10e'));}return _0x23b820;}));_0x427b8e['push'](_0xd0df0e[_0xa57c('0x10f')]()[_0xa57c('0x13')](function(_0x76660a){for(var _0x346d69=0x0;_0x346d69<_0x76660a['length'];_0x346d69++){_0x76660a[_0x346d69]['setDataValue']('channel',_0xa57c('0x110'));}return _0x76660a;}));_0x427b8e[_0xa57c('0x43')](_0xd0df0e[_0xa57c('0x111')]()[_0xa57c('0x13')](function(_0x54ac20){for(var _0x3f3aa8=0x0;_0x3f3aa8<_0x54ac20['length'];_0x3f3aa8++){_0x54ac20[_0x3f3aa8][_0xa57c('0x107')](_0xa57c('0xa8'),'Fax');}return _0x54ac20;}));_0x427b8e[_0xa57c('0x43')](_0xd0df0e[_0xa57c('0x112')]()[_0xa57c('0x13')](function(_0x3226f0){for(var _0x2cd67a=0x0;_0x2cd67a<_0x3226f0[_0xa57c('0x42')];_0x2cd67a++){_0x3226f0[_0x2cd67a][_0xa57c('0x107')](_0xa57c('0xa8'),'Openchannel');}return _0x3226f0;}));return BPromise['all'](_0x427b8e);})[_0xa57c('0x13')](function(_0x3045ed){var _0x33b83f=_[_0xa57c('0x113')](_0x3045ed);_0x427b8e=[];return db[_0xa57c('0x65')][_0xa57c('0x114')](function(_0x5d5453){for(var _0x4eb998=0x0;_0x4eb998<_0x33b83f[_0xa57c('0x42')];_0x4eb998++){_0x427b8e['push'](_0x33b83f[_0x4eb998]['addAgent'](_0x5cd5dc['id']),{'transaction':_0x5d5453});}return BPromise[_0xa57c('0x4b')](_0x427b8e)[_0xa57c('0x13')](function(){if(_0x5cd5dc[_0xa57c('0x115')]){return BPromise['each'](_[_0xa57c('0x2e')](_0x33b83f,function(_0x33d0da){return _0x33d0da[_0xa57c('0x116')](_0xa57c('0xa8'))==='Voice';}),function(_0x242c81){return db['UserVoiceQueueRt'][_0xa57c('0xa7')]({'membername':_0x5cd5dc[_0xa57c('0x33')],'UserId':_0x5cd5dc['id'],'queue_name':_0x242c81['name'],'VoiceQueueId':_0x242c81['id'],'interface':_[_0xa57c('0x63')](_0x5cd5dc['interface'])?util[_0xa57c('0xa3')]('SIP/%s',_0x5cd5dc[_0xa57c('0x33')]):_0x5cd5dc[_0xa57c('0xa2')],'paused':_0x5cd5dc[_0xa57c('0xa5')]||![],'penalty':_0x5cd5dc[_0xa57c('0x9b')]},{'transaction':_0x5d5453});});}else{return;}})[_0xa57c('0x13')](function(){for(var _0x50fc63=0x0;_0x50fc63<_0x33b83f['length'];_0x50fc63++){var _0x17a150=_0x33b83f[_0x50fc63][_0xa57c('0x116')](_0xa57c('0xa8'));var _0x112d75=_0x17a150+_0xa57c('0x9d');socket[_0xa57c('0x9e')](_0xa57c('0x7a')+_0x17a150+_0xa57c('0x9f'),{'UserId':_0x5cd5dc['id'],['queueField']:_0x33b83f[_0x50fc63]['id']});}});});})['then'](function(){db[_0xa57c('0x117')][_0xa57c('0xbd')]({'where':{'teamId':_0x3ca70e['id']}})[_0xa57c('0x13')](function(_0x2f8c23){if(_0x2f8c23){db[_0xa57c('0x118')][_0xa57c('0x78')]({'UserId':_0x426bad[_0xa57c('0x4e')]['id'],'VoicePrefixId':_0x2f8c23[_0xa57c('0x119')]});}});});}});}})['then'](respondWithStatusCode(_0x2581c3,null))[_0xa57c('0x4c')](handleError(_0x2581c3,null));};exports['removeTeams']=function(_0x3fb856,_0x5986ee){return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x3fb856[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5986ee,null))[_0xa57c('0x13')](function(_0x2a8124){if(_0x2a8124){var _0x111423=_0x2a8124[_0xa57c('0x27')]({'plain':!![]});var _0x43d33b=_0x3fb856[_0xa57c('0x3d')][_0xa57c('0x5d')];return _0x2a8124[_0xa57c('0x11a')](_0x43d33b)[_0xa57c('0x13')](function(){for(var _0x27412f=0x0;_0x27412f<_0x43d33b[_0xa57c('0x42')];_0x27412f++){var _0x30a1b4=[];var _0x1dc946={};db[_0xa57c('0x105')][_0xa57c('0xbd')]({'where':{'id':_0x43d33b[_0x27412f]}})['then'](function(_0x3df493){_0x1dc946=_0x3df493['dataValues'];_0x30a1b4[_0xa57c('0x43')](_0x3df493['getVoiceQueues']()[_0xa57c('0x13')](function(_0xb25961){for(var _0x89cba7=0x0;_0x89cba7<_0xb25961[_0xa57c('0x42')];_0x89cba7++){_0xb25961[_0x89cba7][_0xa57c('0x107')](_0xa57c('0xa8'),'Voice');}return _0xb25961;}));_0x30a1b4[_0xa57c('0x43')](_0x3df493[_0xa57c('0x109')]()[_0xa57c('0x13')](function(_0x11d072){for(var _0x378a96=0x0;_0x378a96<_0x11d072['length'];_0x378a96++){_0x11d072[_0x378a96][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x10a'));}return _0x11d072;}));_0x30a1b4[_0xa57c('0x43')](_0x3df493[_0xa57c('0x10b')]()[_0xa57c('0x13')](function(_0x1d6f68){for(var _0x3a5029=0x0;_0x3a5029<_0x1d6f68['length'];_0x3a5029++){_0x1d6f68[_0x3a5029]['setDataValue']('channel',_0xa57c('0x10c'));}return _0x1d6f68;}));_0x30a1b4['push'](_0x3df493[_0xa57c('0x10d')]()[_0xa57c('0x13')](function(_0x4f9469){for(var _0x218c63=0x0;_0x218c63<_0x4f9469[_0xa57c('0x42')];_0x218c63++){_0x4f9469[_0x218c63]['setDataValue'](_0xa57c('0xa8'),'Sms');}return _0x4f9469;}));_0x30a1b4['push'](_0x3df493[_0xa57c('0x10f')]()['then'](function(_0x10944a){for(var _0x3fcb35=0x0;_0x3fcb35<_0x10944a['length'];_0x3fcb35++){_0x10944a[_0x3fcb35][_0xa57c('0x107')](_0xa57c('0xa8'),'Whatsapp');}return _0x10944a;}));_0x30a1b4['push'](_0x3df493[_0xa57c('0x111')]()[_0xa57c('0x13')](function(_0x4d5a5c){for(var _0x53af4a=0x0;_0x53af4a<_0x4d5a5c[_0xa57c('0x42')];_0x53af4a++){_0x4d5a5c[_0x53af4a][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x11b'));}return _0x4d5a5c;}));_0x30a1b4[_0xa57c('0x43')](_0x3df493[_0xa57c('0x112')]()[_0xa57c('0x13')](function(_0x4b7d3e){for(var _0x95e1d=0x0;_0x95e1d<_0x4b7d3e[_0xa57c('0x42')];_0x95e1d++){_0x4b7d3e[_0x95e1d][_0xa57c('0x107')](_0xa57c('0xa8'),_0xa57c('0x11c'));}return _0x4b7d3e;}));return BPromise[_0xa57c('0x4b')](_0x30a1b4);})[_0xa57c('0x13')](function(_0x4996bf){var _0x1e1480=_['flatten'](_0x4996bf);_0x30a1b4=[];return db[_0xa57c('0x65')][_0xa57c('0x114')](function(_0x482cc1){for(var _0x3c1162=0x0;_0x3c1162<_0x1e1480[_0xa57c('0x42')];_0x3c1162++){_0x30a1b4[_0xa57c('0x43')](_0x1e1480[_0x3c1162]['removeAgent'](_0x111423['id']),{'transaction':_0x482cc1});}return BPromise[_0xa57c('0x4b')](_0x30a1b4)[_0xa57c('0x13')](function(){if(_0x111423[_0xa57c('0x115')]){return BPromise['each'](_[_0xa57c('0x2e')](_0x1e1480,function(_0x5d18be){return _0x5d18be[_0xa57c('0x116')](_0xa57c('0xa8'))===_0xa57c('0x108');}),function(_0x57aea8){return db[_0xa57c('0xeb')]['destroy']({'where':{'VoiceQueueId':_0x57aea8['id'],'UserId':_0x111423['id']},'transaction':_0x482cc1});});}else{return;}})[_0xa57c('0x13')](function(){db[_0xa57c('0x117')]['findOne']({'where':{'teamId':_0x1dc946['id']}})[_0xa57c('0x13')](function(_0x3860b3){if(_0x3860b3){return db[_0xa57c('0x118')]['destroy']({'where':{'UserId':_0x111423['id'],'VoicePrefixId':_0x3860b3[_0xa57c('0x46')][_0xa57c('0x119')]}});}});})[_0xa57c('0x13')](function(){for(var _0x55ca78=0x0;_0x55ca78<_0x1e1480[_0xa57c('0x42')];_0x55ca78++){var _0x313906=_0x1e1480[_0x55ca78][_0xa57c('0x116')](_0xa57c('0xa8'));var _0x366df7=_0x313906+'QueueId';socket[_0xa57c('0x9e')]('user'+_0x313906+_0xa57c('0xab'),{'UserId':_0x111423['id'],['queueField']:_0x1e1480[_0x55ca78]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x5986ee,null))[_0xa57c('0x4c')](handleError(_0x5986ee,null));};exports[_0xa57c('0x11d')]=function(_0x3f0fca,_0x5e8bd1){var _0x1c6f21={};var _0x633aa7={};var _0x17f53e;var _0x40db7d;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x3f0fca[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5e8bd1,null))[_0xa57c('0x13')](function(_0xbc3ecb){if(_0xbc3ecb){_0x17f53e=_0xbc3ecb;_0x633aa7[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0xc4')][_0xa57c('0x38')]);_0x633aa7['query']=_['keys'](_0x3f0fca['query']);_0x633aa7[_0xa57c('0x52')]=_['intersection'](_0x633aa7[_0xa57c('0x54')],_0x633aa7['query']);_0x1c6f21[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x633aa7[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x3f0fca[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x1c6f21[_0xa57c('0x40')]=_0x1c6f21[_0xa57c('0x40')][_0xa57c('0x42')]?_0x1c6f21[_0xa57c('0x40')]:_0x633aa7['model'];_0x1c6f21['order']=qs[_0xa57c('0xbf')](_0x3f0fca[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x1c6f21['where']=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x3f0fca[_0xa57c('0x3d')],_0x633aa7['filters']));if(_0x3f0fca[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x1c6f21[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x1c6f21['where'],{'$or':_[_0xa57c('0x88')](_0x1c6f21[_0xa57c('0x40')],function(_0x337f1f){var _0x2f2e7a={};_0x2f2e7a[_0x337f1f]={'$like':'%'+_0x3f0fca[_0xa57c('0x3d')]['filter']+'%'};return _0x2f2e7a;})});}_0x1c6f21=_['merge']({},_0x1c6f21,_0x3f0fca[_0xa57c('0x56')]);return _0x17f53e[_0xa57c('0x11d')](_0x1c6f21);}})['then'](function(_0x4d83e3){if(_0x4d83e3){_0x40db7d=_0x4d83e3['length'];if(!_0x3f0fca[_0xa57c('0x3d')]['hasOwnProperty'](_0xa57c('0xcc'))){_0x1c6f21[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x3f0fca[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x1c6f21[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x3f0fca[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x17f53e[_0xa57c('0x11d')](_0x1c6f21);}})[_0xa57c('0x13')](function(_0x5f13b6){if(_0x5f13b6){return _0x5f13b6?{'count':_0x40db7d,'rows':_0x5f13b6}:null;}})[_0xa57c('0x13')](respondWithResult(_0x5e8bd1,null))['catch'](handleError(_0x5e8bd1,null));};exports[_0xa57c('0x11e')]=function(_0x4ae2f2,_0x209e72){var _0x42575c={};var _0x17f968={};var _0x12a8f4;var _0x24dc6a;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x4ae2f2[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x209e72,null))[_0xa57c('0x13')](function(_0x1c3e38){if(_0x1c3e38){_0x12a8f4=_0x1c3e38;_0x17f968[_0xa57c('0x54')]=_[_0xa57c('0x50')](db['User'][_0xa57c('0x38')]);_0x17f968[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x4ae2f2[_0xa57c('0x3d')]);_0x17f968['filters']=_[_0xa57c('0x53')](_0x17f968[_0xa57c('0x54')],_0x17f968['query']);_0x42575c['attributes']=_[_0xa57c('0x53')](_0x17f968['model'],qs['fields'](_0x4ae2f2['query']['fields']));_0x42575c['attributes']=_0x42575c[_0xa57c('0x40')][_0xa57c('0x42')]?_0x42575c[_0xa57c('0x40')]:_0x17f968[_0xa57c('0x54')];_0x42575c[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x4ae2f2[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x42575c[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x4ae2f2['query'],_0x17f968['filters']));if(_0x4ae2f2[_0xa57c('0x3d')]['filter']){_0x42575c[_0xa57c('0x3c')]=_['merge'](_0x42575c[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x42575c[_0xa57c('0x40')],function(_0x99bf21){var _0x549c0d={};_0x549c0d[_0x99bf21]={'$like':'%'+_0x4ae2f2['query'][_0xa57c('0x2e')]+'%'};return _0x549c0d;})});}_0x42575c[_0xa57c('0x54')]=db[_0xa57c('0x37')];_0x42575c['as']=_0xa57c('0x2a');_0x42575c=_[_0xa57c('0xc1')]({},_0x42575c,_0x4ae2f2[_0xa57c('0x56')]);return _0x12a8f4['getVoiceQueues']({'include':[_0x42575c]});}})[_0xa57c('0x13')](function(_0xfbdb71){if(_0xfbdb71){var _0x4c9efb={},_0x4faaa5=[],_0x90d73d=0x0;for(var _0x27c0d7=0x0;_0x27c0d7<_0xfbdb71['length'];_0x27c0d7+=0x1){for(var _0x39075b=0x0,_0x1bfd72;_0x39075b<_0xfbdb71[_0x27c0d7]['Agents'][_0xa57c('0x42')];_0x39075b+=0x1){_0x1bfd72=_0xfbdb71[_0x27c0d7][_0xa57c('0x2a')][_0x39075b]['get']({'plain':!![]});_0x4c9efb[_0x1bfd72['id']]=_0x1bfd72;}}_0x4c9efb=_[_0xa57c('0x11f')](_0x4c9efb);for(var _0x46ee1e=qs[_0xa57c('0x21')](_0x4ae2f2[_0xa57c('0x3d')]['offset']);_0x46ee1e<_0x4c9efb[_0xa57c('0x42')]&&_0x4faaa5['length']<qs['limit'](_0x4ae2f2[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x46ee1e+=0x1){if(_0x4c9efb[_0x46ee1e]){_0x4faaa5['push'](_0x4c9efb[_0x46ee1e]);}}return{'count':_0x4c9efb['length'],'rows':_0x4faaa5};}})[_0xa57c('0x13')](respondWithResult(_0x209e72,null))[_0xa57c('0x4c')](handleError(_0x209e72,null));};exports[_0xa57c('0x34')]=function(_0x5d6bd7,_0x961b9d){if(_0x5d6bd7[_0xa57c('0x7a')]['id']==_0x5d6bd7['params']['id']){return _0x961b9d[_0xa57c('0x1e')](0x1f4)[_0xa57c('0x120')]({'message':_0xa57c('0x121')});}return db[_0xa57c('0x37')]['find']({'where':{'id':_0x5d6bd7[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x961b9d,null))[_0xa57c('0x13')](removeEntity(_0x961b9d,null))[_0xa57c('0x4c')](handleError(_0x961b9d,null));};exports[_0xa57c('0x122')]=function(_0x3ea6ab,_0xb8685a){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x3ea6ab[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0xb8685a,null))['then'](function(_0x48e7c3){if(_0x48e7c3){return _0x48e7c3['addChatInteractions'](_0x3ea6ab[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x3ea6ab[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{})[_0xa57c('0x123')](function(){for(var _0x167405=0x0;_0x167405<_0x3ea6ab[_0xa57c('0x5a')]['ids'][_0xa57c('0x42')];_0x167405+=0x1){socket[_0xa57c('0x9e')](_0xa57c('0x124'),{'ChatInteractionId':Number(_0x3ea6ab['body'][_0xa57c('0x5d')][_0x167405]),'UserId':Number(_0x3ea6ab['params']['id'])});}return _0x3ea6ab[_0xa57c('0x5a')]['ids'];});}})[_0xa57c('0x13')](respondWithResult(_0xb8685a,null))[_0xa57c('0x4c')](handleError(_0xb8685a,null));};exports[_0xa57c('0x125')]=function(_0x260b7d,_0xbf43e0){return db['User'][_0xa57c('0x57')]({'where':{'id':_0x260b7d[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0xbf43e0,null))[_0xa57c('0x13')](function(_0x8bad5f){if(_0x8bad5f){return _0x8bad5f[_0xa57c('0x125')](_0x260b7d[_0xa57c('0x3d')]['ids'])[_0xa57c('0x13')](function(){if(_[_0xa57c('0x126')](_0x260b7d[_0xa57c('0x3d')]['ids'])){for(var _0x3384ed=0x0;_0x3384ed<_0x260b7d[_0xa57c('0x3d')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x3384ed+=0x1){socket[_0xa57c('0x9e')](_0xa57c('0x127'),{'ChatInteractionId':Number(_0x260b7d[_0xa57c('0x3d')]['ids'][_0x3384ed]),'UserId':Number(_0x260b7d[_0xa57c('0x4e')]['id'])});}}else{socket[_0xa57c('0x9e')](_0xa57c('0x127'),{'ChatInteractionId':Number(_0x260b7d[_0xa57c('0x3d')][_0xa57c('0x5d')]),'UserId':Number(_0x260b7d[_0xa57c('0x4e')]['id'])});}});}})[_0xa57c('0x13')](respondWithStatusCode(_0xbf43e0,null))[_0xa57c('0x4c')](handleError(_0xbf43e0,null));};exports[_0xa57c('0x128')]=function(_0x18e5cf,_0x56378f){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x18e5cf[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x56378f,null))['then'](function(_0x22ed81){if(_0x22ed81){return _0x22ed81[_0xa57c('0x128')](_0x18e5cf[_0xa57c('0x5a')][_0xa57c('0x5d')],_['omit'](_0x18e5cf[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{})[_0xa57c('0x123')](function(){for(var _0x3e9bd3=0x0;_0x3e9bd3<_0x18e5cf[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x3e9bd3+=0x1){socket[_0xa57c('0x9e')](_0xa57c('0x129'),{'MailInteractionId':Number(_0x18e5cf['body'][_0xa57c('0x5d')][_0x3e9bd3]),'UserId':Number(_0x18e5cf[_0xa57c('0x4e')]['id'])});}return _0x18e5cf[_0xa57c('0x5a')][_0xa57c('0x5d')];});}})[_0xa57c('0x13')](respondWithResult(_0x56378f,null))[_0xa57c('0x4c')](handleError(_0x56378f,null));};exports[_0xa57c('0x12a')]=function(_0x2b4b91,_0x71df29){return db['User']['find']({'where':{'id':_0x2b4b91['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x71df29,null))[_0xa57c('0x13')](function(_0xf96a05){if(_0xf96a05){return _0xf96a05[_0xa57c('0x12a')](_0x2b4b91[_0xa57c('0x3d')][_0xa57c('0x5d')])[_0xa57c('0x13')](function(){if(_[_0xa57c('0x126')](_0x2b4b91[_0xa57c('0x3d')]['ids'])){for(var _0x3d17cb=0x0;_0x3d17cb<_0x2b4b91[_0xa57c('0x3d')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x3d17cb+=0x1){socket[_0xa57c('0x9e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2b4b91['query'][_0xa57c('0x5d')][_0x3d17cb]),'UserId':Number(_0x2b4b91[_0xa57c('0x4e')]['id'])});}}else{socket[_0xa57c('0x9e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2b4b91[_0xa57c('0x3d')][_0xa57c('0x5d')]),'UserId':Number(_0x2b4b91[_0xa57c('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x71df29,null))[_0xa57c('0x4c')](handleError(_0x71df29,null));};exports[_0xa57c('0x12b')]=function(_0x482871,_0x5603a8){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x482871[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5603a8,null))[_0xa57c('0x13')](function(_0x2f568c){if(_0x2f568c){return _0x2f568c[_0xa57c('0x12b')](_0x482871[_0xa57c('0x5a')]['ids'],_[_0xa57c('0x5e')](_0x482871[_0xa57c('0x5a')],['ids','id'])||{})[_0xa57c('0x123')](function(){for(var _0x3480dc=0x0;_0x3480dc<_0x482871[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x3480dc+=0x1){socket[_0xa57c('0x9e')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x482871[_0xa57c('0x5a')][_0xa57c('0x5d')][_0x3480dc]),'UserId':Number(_0x482871[_0xa57c('0x4e')]['id'])});}return _0x482871['body'][_0xa57c('0x5d')];});}})[_0xa57c('0x13')](respondWithResult(_0x5603a8,null))[_0xa57c('0x4c')](handleError(_0x5603a8,null));};exports['removeFaxInteractions']=function(_0x53108c,_0x40d673){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x53108c['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x40d673,null))[_0xa57c('0x13')](function(_0x4cd07d){if(_0x4cd07d){return _0x4cd07d[_0xa57c('0x12c')](_0x53108c['query'][_0xa57c('0x5d')])[_0xa57c('0x13')](function(){if(_[_0xa57c('0x126')](_0x53108c[_0xa57c('0x3d')][_0xa57c('0x5d')])){for(var _0x45c568=0x0;_0x45c568<_0x53108c['query'][_0xa57c('0x5d')][_0xa57c('0x42')];_0x45c568+=0x1){socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x53108c[_0xa57c('0x3d')][_0xa57c('0x5d')][_0x45c568]),'UserId':Number(_0x53108c[_0xa57c('0x4e')]['id'])});}}else{socket['emit'](_0xa57c('0x12d'),{'FaxInteractionId':Number(_0x53108c[_0xa57c('0x3d')][_0xa57c('0x5d')]),'UserId':Number(_0x53108c['params']['id'])});}});}})[_0xa57c('0x13')](respondWithStatusCode(_0x40d673,null))[_0xa57c('0x4c')](handleError(_0x40d673,null));};exports['addSmsInteractions']=function(_0x39680a,_0x486e52){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x39680a[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x486e52,null))[_0xa57c('0x13')](function(_0x30a2c0){if(_0x30a2c0){return _0x30a2c0[_0xa57c('0x12e')](_0x39680a[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x39680a[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{})[_0xa57c('0x123')](function(){for(var _0x327867=0x0;_0x327867<_0x39680a[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x327867+=0x1){socket[_0xa57c('0x9e')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x39680a[_0xa57c('0x5a')][_0xa57c('0x5d')][_0x327867]),'UserId':Number(_0x39680a[_0xa57c('0x4e')]['id'])});}return _0x39680a[_0xa57c('0x5a')][_0xa57c('0x5d')];});}})['then'](respondWithResult(_0x486e52,null))[_0xa57c('0x4c')](handleError(_0x486e52,null));};exports[_0xa57c('0x12f')]=function(_0x67bce6,_0x201881){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x67bce6[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x201881,null))[_0xa57c('0x13')](function(_0x4e0154){if(_0x4e0154){return _0x4e0154[_0xa57c('0x12f')](_0x67bce6[_0xa57c('0x3d')]['ids'])['then'](function(){if(_[_0xa57c('0x126')](_0x67bce6['query'][_0xa57c('0x5d')])){for(var _0x39f205=0x0;_0x39f205<_0x67bce6['query']['ids']['length'];_0x39f205+=0x1){socket[_0xa57c('0x9e')](_0xa57c('0x130'),{'SmsInteractionId':Number(_0x67bce6['query'][_0xa57c('0x5d')][_0x39f205]),'UserId':Number(_0x67bce6[_0xa57c('0x4e')]['id'])});}}else{socket[_0xa57c('0x9e')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x67bce6[_0xa57c('0x3d')][_0xa57c('0x5d')]),'UserId':Number(_0x67bce6[_0xa57c('0x4e')]['id'])});}});}})[_0xa57c('0x13')](respondWithStatusCode(_0x201881,null))[_0xa57c('0x4c')](handleError(_0x201881,null));};exports[_0xa57c('0x131')]=function(_0x3076e5,_0x32dbd9){return db['User']['find']({'where':{'id':_0x3076e5[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x32dbd9,null))['then'](function(_0x4aea06){if(_0x4aea06){return _0x4aea06['addOpenchannelInteractions'](_0x3076e5['body']['ids'],_['omit'](_0x3076e5[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{})['spread'](function(){for(var _0xa010ea=0x0;_0xa010ea<_0x3076e5[_0xa57c('0x5a')]['ids']['length'];_0xa010ea+=0x1){socket[_0xa57c('0x9e')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x3076e5[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa010ea]),'UserId':Number(_0x3076e5[_0xa57c('0x4e')]['id'])});}return _0x3076e5[_0xa57c('0x5a')][_0xa57c('0x5d')];});}})[_0xa57c('0x13')](respondWithResult(_0x32dbd9,null))[_0xa57c('0x4c')](handleError(_0x32dbd9,null));};exports[_0xa57c('0x132')]=function(_0x3e6fe5,_0x3f6292){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3e6fe5['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x3f6292,null))['then'](function(_0x4ff41b){if(_0x4ff41b){return _0x4ff41b[_0xa57c('0x132')](_0x3e6fe5['query'][_0xa57c('0x5d')])[_0xa57c('0x13')](function(){if(_[_0xa57c('0x126')](_0x3e6fe5[_0xa57c('0x3d')][_0xa57c('0x5d')])){for(var _0x19373a=0x0;_0x19373a<_0x3e6fe5[_0xa57c('0x3d')][_0xa57c('0x5d')][_0xa57c('0x42')];_0x19373a+=0x1){socket[_0xa57c('0x9e')](_0xa57c('0x133'),{'OpenchannelInteractionId':Number(_0x3e6fe5[_0xa57c('0x3d')]['ids'][_0x19373a]),'UserId':Number(_0x3e6fe5[_0xa57c('0x4e')]['id'])});}}else{socket['emit'](_0xa57c('0x133'),{'OpenchannelInteractionId':Number(_0x3e6fe5[_0xa57c('0x3d')][_0xa57c('0x5d')]),'UserId':Number(_0x3e6fe5['params']['id'])});}});}})[_0xa57c('0x13')](respondWithStatusCode(_0x3f6292,null))['catch'](handleError(_0x3f6292,null));};exports['addWhatsappInteractions']=function(_0x2523e1,_0x5692aa){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x2523e1['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5692aa,null))[_0xa57c('0x13')](function(_0x4004c8){if(_0x4004c8){return _0x4004c8['addWhatsappInteractions'](_0x2523e1[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x2523e1[_0xa57c('0x5a')],['ids','id'])||{})[_0xa57c('0x123')](function(){for(var _0xa293b=0x0;_0xa293b<_0x2523e1[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa57c('0x42')];_0xa293b+=0x1){socket['emit'](_0xa57c('0x134'),{'WhatsappInteractionId':Number(_0x2523e1[_0xa57c('0x5a')][_0xa57c('0x5d')][_0xa293b]),'UserId':Number(_0x2523e1[_0xa57c('0x4e')]['id'])});}return _0x2523e1[_0xa57c('0x5a')][_0xa57c('0x5d')];});}})[_0xa57c('0x13')](respondWithResult(_0x5692aa,null))['catch'](handleError(_0x5692aa,null));};exports[_0xa57c('0x135')]=function(_0x1dd457,_0x1cc1ad){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x1dd457[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1cc1ad,null))[_0xa57c('0x13')](function(_0x46bae6){if(_0x46bae6){return _0x46bae6['removeWhatsappInteractions'](_0x1dd457[_0xa57c('0x3d')]['ids']);}})[_0xa57c('0x13')](respondWithStatusCode(_0x1cc1ad,null))[_0xa57c('0x4c')](handleError(_0x1cc1ad,null));};exports['getVoicePrefixes']=function(_0x23e11a,_0x5ad3eb){var _0x5e779c={};var _0x1ad139={};var _0x4815b0;var _0x115f96;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x23e11a[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x5ad3eb,null))[_0xa57c('0x13')](function(_0x4d9fa4){if(_0x4d9fa4){_0x4815b0=_0x4d9fa4;_0x1ad139[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0x136')][_0xa57c('0x38')]);_0x1ad139[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x23e11a[_0xa57c('0x3d')]);_0x1ad139[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x1ad139['model'],_0x1ad139['query']);_0x5e779c[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x1ad139[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x23e11a[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x5e779c[_0xa57c('0x40')]=_0x5e779c[_0xa57c('0x40')][_0xa57c('0x42')]?_0x5e779c[_0xa57c('0x40')]:_0x1ad139['model'];_0x5e779c[_0xa57c('0xbe')]=qs['sort'](_0x23e11a[_0xa57c('0x3d')]['sort']);_0x5e779c[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x23e11a[_0xa57c('0x3d')],_0x1ad139['filters']));if(_0x23e11a[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x5e779c['where']=_[_0xa57c('0xc1')](_0x5e779c['where'],{'$or':_[_0xa57c('0x88')](_0x5e779c[_0xa57c('0x40')],function(_0x440d8e){var _0x294e7d={};_0x294e7d[_0x440d8e]={'$like':'%'+_0x23e11a[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x294e7d;})});}_0x5e779c=_[_0xa57c('0xc1')]({},_0x5e779c,_0x23e11a['options']);return _0x4815b0[_0xa57c('0x137')](_0x5e779c);}})['then'](function(_0x37fb59){if(_0x37fb59){_0x115f96=_0x37fb59[_0xa57c('0x42')];if(!_0x23e11a[_0xa57c('0x3d')]['hasOwnProperty']('nolimit')){_0x5e779c[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x23e11a[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x5e779c[_0xa57c('0x21')]=qs['offset'](_0x23e11a[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x4815b0[_0xa57c('0x137')](_0x5e779c);}})[_0xa57c('0x13')](function(_0x1c3230){if(_0x1c3230){return _0x1c3230?{'count':_0x115f96,'rows':_0x1c3230}:null;}})['then'](respondWithResult(_0x5ad3eb,null))[_0xa57c('0x4c')](handleError(_0x5ad3eb,null));};exports[_0xa57c('0x138')]=function(_0x1ee29c,_0x350c1b){var _0x43eaa7={};var _0x1ef749={};var _0x2eeba4;var _0x89d8a;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x1ee29c[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x350c1b,null))[_0xa57c('0x13')](function(_0x4496a7){if(_0x4496a7){_0x2eeba4=_0x4496a7;_0x1ef749[_0xa57c('0x54')]=_['keys'](db[_0xa57c('0x139')][_0xa57c('0x38')]);_0x1ef749[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x1ee29c[_0xa57c('0x3d')]);_0x1ef749[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x1ef749['model'],_0x1ef749[_0xa57c('0x3d')]);_0x43eaa7[_0xa57c('0x40')]=_['intersection'](_0x1ef749['model'],qs['fields'](_0x1ee29c[_0xa57c('0x3d')]['fields']));_0x43eaa7[_0xa57c('0x40')]=_0x43eaa7[_0xa57c('0x40')][_0xa57c('0x42')]?_0x43eaa7[_0xa57c('0x40')]:_0x1ef749[_0xa57c('0x54')];_0x43eaa7[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x1ee29c[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x43eaa7[_0xa57c('0x3c')]=qs['filters'](_[_0xa57c('0xc0')](_0x1ee29c[_0xa57c('0x3d')],_0x1ef749[_0xa57c('0x52')]));if(_0x1ee29c['query'][_0xa57c('0x2e')]){_0x43eaa7[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x43eaa7['where'],{'$or':_[_0xa57c('0x88')](_0x43eaa7[_0xa57c('0x40')],function(_0x2added){var _0xabf156={};_0xabf156[_0x2added]={'$like':'%'+_0x1ee29c[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0xabf156;})});}_0x43eaa7=_[_0xa57c('0xc1')]({},_0x43eaa7,_0x1ee29c[_0xa57c('0x56')]);return _0x2eeba4[_0xa57c('0x138')](_0x43eaa7);}})[_0xa57c('0x13')](function(_0x272c26){if(_0x272c26){_0x89d8a=_0x272c26[_0xa57c('0x42')];if(!_0x1ee29c[_0xa57c('0x3d')][_0xa57c('0xc3')]('nolimit')){_0x43eaa7['limit']=qs[_0xa57c('0x23')](_0x1ee29c[_0xa57c('0x3d')]['limit']);_0x43eaa7[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x1ee29c['query'][_0xa57c('0x21')]);}return _0x2eeba4[_0xa57c('0x138')](_0x43eaa7);}})['then'](function(_0x54314a){if(_0x54314a){return _0x54314a?{'count':_0x89d8a,'rows':_0x54314a}:null;}})[_0xa57c('0x13')](respondWithResult(_0x350c1b,null))[_0xa57c('0x4c')](handleError(_0x350c1b,null));};exports[_0xa57c('0x13a')]=function(_0x494570,_0x31b990){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x494570[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x31b990,null))[_0xa57c('0x13')](function(_0x3cbb74){if(_0x3cbb74){return _0x3cbb74[_0xa57c('0x13a')](_0x494570['body']['ids'],_[_0xa57c('0x5e')](_0x494570[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x31b990,null))[_0xa57c('0x4c')](handleError(_0x31b990,null));};exports[_0xa57c('0x13b')]=function(_0x2bdf9e,_0x314542){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x2bdf9e[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x314542,null))[_0xa57c('0x13')](function(_0x47270e){if(_0x47270e){return _0x47270e[_0xa57c('0x13b')](_0x2bdf9e[_0xa57c('0x3d')]['ids']);}})[_0xa57c('0x13')](respondWithStatusCode(_0x314542,null))[_0xa57c('0x4c')](handleError(_0x314542,null));};exports['getMailAccounts']=function(_0x431890,_0x15266c){var _0x1f0296={};var _0x2738c4={};var _0x13e0cc;var _0x28f36c;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x431890[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x15266c,null))[_0xa57c('0x13')](function(_0x2e5713){if(_0x2e5713){_0x13e0cc=_0x2e5713;_0x2738c4['model']=_[_0xa57c('0x50')](db[_0xa57c('0x13c')]['rawAttributes']);_0x2738c4[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x431890[_0xa57c('0x3d')]);_0x2738c4[_0xa57c('0x52')]=_['intersection'](_0x2738c4[_0xa57c('0x54')],_0x2738c4[_0xa57c('0x3d')]);_0x1f0296['attributes']=_['intersection'](_0x2738c4['model'],qs['fields'](_0x431890[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x1f0296['attributes']=_0x1f0296[_0xa57c('0x40')][_0xa57c('0x42')]?_0x1f0296[_0xa57c('0x40')]:_0x2738c4['model'];_0x1f0296[_0xa57c('0xbe')]=qs['sort'](_0x431890['query'][_0xa57c('0xbf')]);_0x1f0296[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x431890[_0xa57c('0x3d')],_0x2738c4[_0xa57c('0x52')]));if(_0x431890[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x1f0296[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x1f0296[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x1f0296[_0xa57c('0x40')],function(_0x5e24a3){var _0x5d1902={};_0x5d1902[_0x5e24a3]={'$like':'%'+_0x431890['query']['filter']+'%'};return _0x5d1902;})});}_0x1f0296=_[_0xa57c('0xc1')]({},_0x1f0296,_0x431890['options']);return _0x13e0cc[_0xa57c('0x13d')](_0x1f0296);}})['then'](function(_0x4e5520){if(_0x4e5520){_0x28f36c=_0x4e5520[_0xa57c('0x42')];if(!_0x431890['query']['hasOwnProperty'](_0xa57c('0xcc'))){_0x1f0296['limit']=qs[_0xa57c('0x23')](_0x431890['query'][_0xa57c('0x23')]);_0x1f0296[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x431890[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x13e0cc[_0xa57c('0x13d')](_0x1f0296);}})[_0xa57c('0x13')](function(_0x5d24ad){if(_0x5d24ad){return _0x5d24ad?{'count':_0x28f36c,'rows':_0x5d24ad}:null;}})[_0xa57c('0x13')](respondWithResult(_0x15266c,null))[_0xa57c('0x4c')](handleError(_0x15266c,null));};exports[_0xa57c('0x13e')]=function(_0x204a01,_0x2af893){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x204a01[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x2af893,null))[_0xa57c('0x13')](function(_0x4b11c8){if(_0x4b11c8){return _0x4b11c8['addMailAccounts'](_0x204a01[_0xa57c('0x5a')][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x204a01[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x2af893,null))[_0xa57c('0x4c')](handleError(_0x2af893,null));};exports['removeMailAccounts']=function(_0xded31b,_0x28f36e){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0xded31b['params']['id']}})['then'](handleEntityNotFound(_0x28f36e,null))[_0xa57c('0x13')](function(_0x39c2b){if(_0x39c2b){return _0x39c2b[_0xa57c('0x13f')](_0xded31b[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})['then'](respondWithStatusCode(_0x28f36e,null))[_0xa57c('0x4c')](handleError(_0x28f36e,null));};exports['getOpenchannelAccounts']=function(_0x36f424,_0x38b1b5){var _0x313795={};var _0xfda1f7={};var _0x43eee5;var _0x15d927;return db['User'][_0xa57c('0xbd')]({'where':{'id':_0x36f424['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x38b1b5,null))[_0xa57c('0x13')](function(_0x466fd1){if(_0x466fd1){_0x43eee5=_0x466fd1;_0xfda1f7[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0x140')][_0xa57c('0x38')]);_0xfda1f7[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x36f424[_0xa57c('0x3d')]);_0xfda1f7[_0xa57c('0x52')]=_['intersection'](_0xfda1f7[_0xa57c('0x54')],_0xfda1f7['query']);_0x313795['attributes']=_[_0xa57c('0x53')](_0xfda1f7['model'],qs[_0xa57c('0x55')](_0x36f424['query'][_0xa57c('0x55')]));_0x313795[_0xa57c('0x40')]=_0x313795[_0xa57c('0x40')][_0xa57c('0x42')]?_0x313795[_0xa57c('0x40')]:_0xfda1f7['model'];_0x313795[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x36f424[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x313795[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x36f424['query'],_0xfda1f7[_0xa57c('0x52')]));if(_0x36f424[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x313795[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x313795['where'],{'$or':_[_0xa57c('0x88')](_0x313795['attributes'],function(_0x50d791){var _0x28f5ff={};_0x28f5ff[_0x50d791]={'$like':'%'+_0x36f424[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x28f5ff;})});}_0x313795=_[_0xa57c('0xc1')]({},_0x313795,_0x36f424[_0xa57c('0x56')]);return _0x43eee5[_0xa57c('0x141')](_0x313795);}})['then'](function(_0x411736){if(_0x411736){_0x15d927=_0x411736['length'];if(!_0x36f424[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x313795[_0xa57c('0x23')]=qs['limit'](_0x36f424[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x313795[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x36f424[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x43eee5[_0xa57c('0x141')](_0x313795);}})[_0xa57c('0x13')](function(_0x8164c7){if(_0x8164c7){return _0x8164c7?{'count':_0x15d927,'rows':_0x8164c7}:null;}})[_0xa57c('0x13')](respondWithResult(_0x38b1b5,null))[_0xa57c('0x4c')](handleError(_0x38b1b5,null));};exports[_0xa57c('0x142')]=function(_0x3f5876,_0xe285ae){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3f5876['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0xe285ae,null))[_0xa57c('0x13')](function(_0x3a55c2){if(_0x3a55c2){return _0x3a55c2[_0xa57c('0x142')](_0x3f5876['body'][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x3f5876[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0xe285ae,null))[_0xa57c('0x4c')](handleError(_0xe285ae,null));};exports[_0xa57c('0x143')]=function(_0x5b99a6,_0x1a7462){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x5b99a6[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x1a7462,null))['then'](function(_0x55a125){if(_0x55a125){return _0x55a125[_0xa57c('0x143')](_0x5b99a6[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})[_0xa57c('0x13')](respondWithStatusCode(_0x1a7462,null))[_0xa57c('0x4c')](handleError(_0x1a7462,null));};exports[_0xa57c('0x144')]=function(_0x2a587f,_0x6e79df){var _0x41844f={};var _0x5cf590={};var _0xf4ac0d;var _0x65cb13;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x2a587f[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x6e79df,null))['then'](function(_0x715a5d){if(_0x715a5d){_0xf4ac0d=_0x715a5d;_0x5cf590['model']=_[_0xa57c('0x50')](db['SmsAccount']['rawAttributes']);_0x5cf590['query']=_[_0xa57c('0x50')](_0x2a587f[_0xa57c('0x3d')]);_0x5cf590[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x5cf590['model'],_0x5cf590[_0xa57c('0x3d')]);_0x41844f[_0xa57c('0x40')]=_[_0xa57c('0x53')](_0x5cf590[_0xa57c('0x54')],qs['fields'](_0x2a587f['query'][_0xa57c('0x55')]));_0x41844f[_0xa57c('0x40')]=_0x41844f[_0xa57c('0x40')][_0xa57c('0x42')]?_0x41844f[_0xa57c('0x40')]:_0x5cf590[_0xa57c('0x54')];_0x41844f[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x2a587f[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x41844f[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x2a587f[_0xa57c('0x3d')],_0x5cf590[_0xa57c('0x52')]));if(_0x2a587f['query'][_0xa57c('0x2e')]){_0x41844f['where']=_[_0xa57c('0xc1')](_0x41844f[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x41844f[_0xa57c('0x40')],function(_0x52eb72){var _0x346982={};_0x346982[_0x52eb72]={'$like':'%'+_0x2a587f[_0xa57c('0x3d')]['filter']+'%'};return _0x346982;})});}_0x41844f=_[_0xa57c('0xc1')]({},_0x41844f,_0x2a587f[_0xa57c('0x56')]);return _0xf4ac0d[_0xa57c('0x144')](_0x41844f);}})[_0xa57c('0x13')](function(_0xf7df80){if(_0xf7df80){_0x65cb13=_0xf7df80['length'];if(!_0x2a587f['query'][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x41844f['limit']=qs[_0xa57c('0x23')](_0x2a587f[_0xa57c('0x3d')]['limit']);_0x41844f[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x2a587f[_0xa57c('0x3d')]['offset']);}return _0xf4ac0d[_0xa57c('0x144')](_0x41844f);}})[_0xa57c('0x13')](function(_0x46e489){if(_0x46e489){return _0x46e489?{'count':_0x65cb13,'rows':_0x46e489}:null;}})['then'](respondWithResult(_0x6e79df,null))['catch'](handleError(_0x6e79df,null));};exports[_0xa57c('0x145')]=function(_0x228b0b,_0x2830f6){return db['User']['find']({'where':{'id':_0x228b0b['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x2830f6,null))[_0xa57c('0x13')](function(_0xfb32bd){if(_0xfb32bd){return _0xfb32bd[_0xa57c('0x145')](_0x228b0b[_0xa57c('0x5a')]['ids'],_[_0xa57c('0x5e')](_0x228b0b['body'],[_0xa57c('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x2830f6,null))[_0xa57c('0x4c')](handleError(_0x2830f6,null));};exports[_0xa57c('0x146')]=function(_0x408535,_0x1efb22){return db['User'][_0xa57c('0x57')]({'where':{'id':_0x408535[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x1efb22,null))[_0xa57c('0x13')](function(_0x2abe0b){if(_0x2abe0b){return _0x2abe0b[_0xa57c('0x146')](_0x408535[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})['then'](respondWithStatusCode(_0x1efb22,null))[_0xa57c('0x4c')](handleError(_0x1efb22,null));};exports[_0xa57c('0x147')]=function(_0x49b61b,_0x3bc226){var _0x3b6c44={};var _0xdebe8e={};var _0x4bc9d4;var _0x244d97;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x49b61b['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x3bc226,null))[_0xa57c('0x13')](function(_0x21eff4){if(_0x21eff4){_0x4bc9d4=_0x21eff4;_0xdebe8e[_0xa57c('0x54')]=_[_0xa57c('0x50')](db[_0xa57c('0x148')][_0xa57c('0x38')]);_0xdebe8e['query']=_[_0xa57c('0x50')](_0x49b61b[_0xa57c('0x3d')]);_0xdebe8e[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0xdebe8e[_0xa57c('0x54')],_0xdebe8e[_0xa57c('0x3d')]);_0x3b6c44['attributes']=_[_0xa57c('0x53')](_0xdebe8e[_0xa57c('0x54')],qs['fields'](_0x49b61b['query']['fields']));_0x3b6c44[_0xa57c('0x40')]=_0x3b6c44[_0xa57c('0x40')][_0xa57c('0x42')]?_0x3b6c44['attributes']:_0xdebe8e['model'];_0x3b6c44[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x49b61b['query'][_0xa57c('0xbf')]);_0x3b6c44[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_['pick'](_0x49b61b[_0xa57c('0x3d')],_0xdebe8e['filters']));if(_0x49b61b[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x3b6c44['where']=_[_0xa57c('0xc1')](_0x3b6c44[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x3b6c44['attributes'],function(_0x5e253f){var _0x2c1233={};_0x2c1233[_0x5e253f]={'$like':'%'+_0x49b61b['query'][_0xa57c('0x2e')]+'%'};return _0x2c1233;})});}_0x3b6c44=_[_0xa57c('0xc1')]({},_0x3b6c44,_0x49b61b['options']);return _0x4bc9d4[_0xa57c('0x147')](_0x3b6c44);}})['then'](function(_0x4d639d){if(_0x4d639d){_0x244d97=_0x4d639d['length'];if(!_0x49b61b[_0xa57c('0x3d')][_0xa57c('0xc3')]('nolimit')){_0x3b6c44[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x49b61b[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x3b6c44['offset']=qs[_0xa57c('0x21')](_0x49b61b['query'][_0xa57c('0x21')]);}return _0x4bc9d4['getChatWebsites'](_0x3b6c44);}})['then'](function(_0x563776){if(_0x563776){return _0x563776?{'count':_0x244d97,'rows':_0x563776}:null;}})[_0xa57c('0x13')](respondWithResult(_0x3bc226,null))['catch'](handleError(_0x3bc226,null));};exports[_0xa57c('0x149')]=function(_0x546a86,_0x1e9ca6){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x546a86[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x1e9ca6,null))['then'](function(_0x36794d){if(_0x36794d){return _0x36794d[_0xa57c('0x149')](_0x546a86['body'][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x546a86['body'],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x1e9ca6,null))[_0xa57c('0x4c')](handleError(_0x1e9ca6,null));};exports[_0xa57c('0x14a')]=function(_0x3da8ae,_0x238b52){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x3da8ae['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x238b52,null))['then'](function(_0x2e91c3){if(_0x2e91c3){return _0x2e91c3[_0xa57c('0x14a')](_0x3da8ae['query']['ids']);}})[_0xa57c('0x13')](respondWithStatusCode(_0x238b52,null))[_0xa57c('0x4c')](handleError(_0x238b52,null));};exports[_0xa57c('0x14b')]=function(_0x515e76,_0x54dee8){var _0xa71a68={};var _0x2ed75f={};var _0x2e40d3;var _0x4bdfef;return db[_0xa57c('0x37')]['findOne']({'where':{'id':_0x515e76[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x54dee8,null))['then'](function(_0x11fd78){if(_0x11fd78){_0x2e40d3=_0x11fd78;_0x2ed75f[_0xa57c('0x54')]=_[_0xa57c('0x50')](db['WhatsappAccount'][_0xa57c('0x38')]);_0x2ed75f['query']=_[_0xa57c('0x50')](_0x515e76[_0xa57c('0x3d')]);_0x2ed75f[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x2ed75f[_0xa57c('0x54')],_0x2ed75f[_0xa57c('0x3d')]);_0xa71a68[_0xa57c('0x40')]=_['intersection'](_0x2ed75f[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x515e76[_0xa57c('0x3d')][_0xa57c('0x55')]));_0xa71a68[_0xa57c('0x40')]=_0xa71a68[_0xa57c('0x40')]['length']?_0xa71a68[_0xa57c('0x40')]:_0x2ed75f[_0xa57c('0x54')];_0xa71a68[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x515e76[_0xa57c('0x3d')]['sort']);_0xa71a68[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x515e76[_0xa57c('0x3d')],_0x2ed75f['filters']));if(_0x515e76['query']['filter']){_0xa71a68[_0xa57c('0x3c')]=_['merge'](_0xa71a68[_0xa57c('0x3c')],{'$or':_['map'](_0xa71a68[_0xa57c('0x40')],function(_0x285ff3){var _0x4e8b33={};_0x4e8b33[_0x285ff3]={'$like':'%'+_0x515e76[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x4e8b33;})});}_0xa71a68=_[_0xa57c('0xc1')]({},_0xa71a68,_0x515e76[_0xa57c('0x56')]);return _0x2e40d3['getWhatsappAccounts'](_0xa71a68);}})[_0xa57c('0x13')](function(_0x13004e){if(_0x13004e){_0x4bdfef=_0x13004e[_0xa57c('0x42')];if(!_0x515e76['query'][_0xa57c('0xc3')]('nolimit')){_0xa71a68[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x515e76[_0xa57c('0x3d')][_0xa57c('0x23')]);_0xa71a68['offset']=qs[_0xa57c('0x21')](_0x515e76[_0xa57c('0x3d')][_0xa57c('0x21')]);}return _0x2e40d3['getWhatsappAccounts'](_0xa71a68);}})[_0xa57c('0x13')](function(_0x35f31b){if(_0x35f31b){return _0x35f31b?{'count':_0x4bdfef,'rows':_0x35f31b}:null;}})[_0xa57c('0x13')](respondWithResult(_0x54dee8,null))[_0xa57c('0x4c')](handleError(_0x54dee8,null));};exports['addWhatsappAccounts']=function(_0x547702,_0x248c17){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x547702[_0xa57c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x248c17,null))[_0xa57c('0x13')](function(_0x578e0f){if(_0x578e0f){return _0x578e0f[_0xa57c('0x14c')](_0x547702[_0xa57c('0x5a')][_0xa57c('0x5d')],_['omit'](_0x547702[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x248c17,null))[_0xa57c('0x4c')](handleError(_0x248c17,null));};exports[_0xa57c('0x14d')]=function(_0x58fdbf,_0x2c933b){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x58fdbf[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x2c933b,null))[_0xa57c('0x13')](function(_0x28c1c9){if(_0x28c1c9){return _0x28c1c9[_0xa57c('0x14d')](_0x58fdbf[_0xa57c('0x3d')]['ids']);}})[_0xa57c('0x13')](respondWithStatusCode(_0x2c933b,null))[_0xa57c('0x4c')](handleError(_0x2c933b,null));};exports[_0xa57c('0x14e')]=function(_0x2549cb,_0x39eef9){var _0x42088d={};var _0x577a3a={};var _0x7b537a;var _0x20005c;return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x2549cb[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x39eef9,null))[_0xa57c('0x13')](function(_0x54dd47){if(_0x54dd47){_0x7b537a=_0x54dd47;_0x577a3a['model']=_[_0xa57c('0x50')](db[_0xa57c('0x14f')][_0xa57c('0x38')]);_0x577a3a[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x2549cb[_0xa57c('0x3d')]);_0x577a3a['filters']=_[_0xa57c('0x53')](_0x577a3a['model'],_0x577a3a[_0xa57c('0x3d')]);_0x42088d['attributes']=_['intersection'](_0x577a3a['model'],qs[_0xa57c('0x55')](_0x2549cb['query'][_0xa57c('0x55')]));_0x42088d[_0xa57c('0x40')]=_0x42088d[_0xa57c('0x40')][_0xa57c('0x42')]?_0x42088d[_0xa57c('0x40')]:_0x577a3a[_0xa57c('0x54')];_0x42088d[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x2549cb[_0xa57c('0x3d')][_0xa57c('0xbf')]);_0x42088d['where']=qs['filters'](_[_0xa57c('0xc0')](_0x2549cb[_0xa57c('0x3d')],_0x577a3a[_0xa57c('0x52')]));if(_0x2549cb[_0xa57c('0x3d')][_0xa57c('0x2e')]){_0x42088d[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x42088d['where'],{'$or':_[_0xa57c('0x88')](_0x42088d[_0xa57c('0x40')],function(_0x116154){var _0x3bbe32={};_0x3bbe32[_0x116154]={'$like':'%'+_0x2549cb[_0xa57c('0x3d')][_0xa57c('0x2e')]+'%'};return _0x3bbe32;})});}_0x42088d=_[_0xa57c('0xc1')]({},_0x42088d,_0x2549cb[_0xa57c('0x56')]);return _0x7b537a['getSquareProjects'](_0x42088d);}})[_0xa57c('0x13')](function(_0x1baa25){if(_0x1baa25){_0x20005c=_0x1baa25[_0xa57c('0x42')];if(!_0x2549cb[_0xa57c('0x3d')]['hasOwnProperty'](_0xa57c('0xcc'))){_0x42088d[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x2549cb[_0xa57c('0x3d')]['limit']);_0x42088d[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x2549cb[_0xa57c('0x3d')]['offset']);}return _0x7b537a[_0xa57c('0x14e')](_0x42088d);}})[_0xa57c('0x13')](function(_0x59922e){if(_0x59922e){return _0x59922e?{'count':_0x20005c,'rows':_0x59922e}:null;}})['then'](respondWithResult(_0x39eef9,null))['catch'](handleError(_0x39eef9,null));};exports['addSquareProjects']=function(_0x1a30b1,_0x1df517){return db[_0xa57c('0x37')][_0xa57c('0x57')]({'where':{'id':_0x1a30b1['params']['id']}})['then'](handleEntityNotFound(_0x1df517,null))['then'](function(_0x43d9b4){if(_0x43d9b4){return _0x43d9b4[_0xa57c('0x150')](_0x1a30b1['body'][_0xa57c('0x5d')],_[_0xa57c('0x5e')](_0x1a30b1[_0xa57c('0x5a')],[_0xa57c('0x5d'),'id'])||{});}})[_0xa57c('0x13')](respondWithResult(_0x1df517,null))['catch'](handleError(_0x1df517,null));};exports[_0xa57c('0x151')]=function(_0x1a135b,_0x1b7357){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x1a135b['params']['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x1b7357,null))[_0xa57c('0x13')](function(_0x7c3731){if(_0x7c3731){return _0x7c3731[_0xa57c('0x151')](_0x1a135b[_0xa57c('0x3d')][_0xa57c('0x5d')]);}})[_0xa57c('0x13')](respondWithStatusCode(_0x1b7357,null))[_0xa57c('0x4c')](handleError(_0x1b7357,null));};exports[_0xa57c('0x152')]=function(_0x41ee40,_0x553689){var _0x411228={},_0x403211={},_0x137b8e={'count':0x0,'rows':[]};var _0x2df5a8=db[_0xa57c('0x153')][_0xa57c('0x38')];_0x403211['model']=_['keys'](_0x2df5a8);_0x403211[_0xa57c('0x3d')]=_[_0xa57c('0x50')](_0x41ee40[_0xa57c('0x3d')]);_0x403211[_0xa57c('0x52')]=_[_0xa57c('0x53')](_0x403211[_0xa57c('0x54')],_0x403211[_0xa57c('0x3d')]);_0x403211[_0xa57c('0x52')]=_[_0xa57c('0xf2')](_0x403211['filters'],['$and',_0xa57c('0x154'),_0xa57c('0x155'),_0xa57c('0x156'),_0xa57c('0x157'),_0xa57c('0x158'),_0xa57c('0x159'),_0xa57c('0x15a'),_0xa57c('0x15b'),_0xa57c('0x15c'),_0xa57c('0x15d'),_0xa57c('0x15e'),_0xa57c('0x15f'),_0xa57c('0x160'),_0xa57c('0x161'),_0xa57c('0x162'),_0xa57c('0x163'),_0xa57c('0x160'),_0xa57c('0x164'),_0xa57c('0x165'),'$contained',_0xa57c('0x166')]);_0x411228[_0xa57c('0x40')]=_['intersection'](_0x403211[_0xa57c('0x54')],qs[_0xa57c('0x55')](_0x41ee40[_0xa57c('0x3d')][_0xa57c('0x55')]));_0x411228[_0xa57c('0x40')]=_0x411228['attributes'][_0xa57c('0x42')]?_0x411228[_0xa57c('0x40')]:_0x403211[_0xa57c('0x54')];if(!_0x41ee40[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x411228['limit']=qs[_0xa57c('0x23')](_0x41ee40[_0xa57c('0x3d')][_0xa57c('0x23')]);_0x411228[_0xa57c('0x21')]=qs['offset'](_0x41ee40[_0xa57c('0x3d')]['offset']);}_0x411228[_0xa57c('0xbe')]=qs[_0xa57c('0xbf')](_0x41ee40['query'][_0xa57c('0xbf')]);_0x411228[_0xa57c('0x3c')]=qs[_0xa57c('0x52')](_[_0xa57c('0xc0')](_0x41ee40[_0xa57c('0x3d')],_0x403211[_0xa57c('0x52')]));if(_0x41ee40['query'][_0xa57c('0x2e')]){_0x411228[_0xa57c('0x3c')]=_[_0xa57c('0xc1')](_0x411228[_0xa57c('0x3c')],{'$or':_[_0xa57c('0x88')](_0x411228[_0xa57c('0x40')],function(_0x69cdd6){var _0x3aba3a={};_0x3aba3a[_0x69cdd6]={'$like':'%'+_0x41ee40['query'][_0xa57c('0x2e')]+'%'};return _0x3aba3a;})});}_0x411228[_0xa57c('0x3c')]={'$and':[_0x411228[_0xa57c('0x3c')],{'$or':[{'UserId':_0x41ee40[_0xa57c('0x4e')]['id']},{'OwnerId':_0x41ee40[_0xa57c('0x4e')]['id']}]}]};_0x411228=_['merge']({},_0x411228,_0x41ee40[_0xa57c('0x56')]);var _0x37be2f={'where':_0x411228['where']};return db[_0xa57c('0x153')][_0xa57c('0x24')](_0x37be2f)['then'](function(_0x1a241d){_0x137b8e[_0xa57c('0x24')]=_0x1a241d;if(_0x41ee40[_0xa57c('0x3d')][_0xa57c('0x3e')]){_0x411228[_0xa57c('0x3f')]=[{'attributes':['id',_0xa57c('0x167'),_0xa57c('0x168'),_0xa57c('0xdf')],'model':db[_0xa57c('0x169')],'as':_0xa57c('0x16a')},{'attributes':['id','name','dialActive'],'model':db[_0xa57c('0xa1')],'as':_0xa57c('0xca')}];}return db[_0xa57c('0x153')][_0xa57c('0x86')](_0x411228);})[_0xa57c('0x13')](function(_0x5bc21b){_0x137b8e[_0xa57c('0x41')]=_0x5bc21b;return _0x137b8e;})[_0xa57c('0x13')](respondWithFilteredResult(_0x553689,_0x411228))['catch'](handleError(_0x553689,null));};exports[_0xa57c('0x16b')]=function(_0x41cb11,_0xda3142){if(!_[_0xa57c('0x63')](_0x41cb11[_0xa57c('0x7a')]['id'])&&(_0x41cb11[_0xa57c('0x7a')][_0xa57c('0x32')]==_0xa57c('0x28')||_0x41cb11[_0xa57c('0x7a')]['role']==_0xa57c('0x7a'))){return db[_0xa57c('0x37')][_0xa57c('0xbd')]({'where':{'id':_0x41cb11['params']['id']},'raw':!![]})[_0xa57c('0x13')](function(_0x5d0282){return authService[_0xa57c('0x16c')](_0x5d0282);})['then'](function(_0x5cbcfc){if(_0x5cbcfc){return _0xda3142[_0xa57c('0x1e')](0xc8)[_0xa57c('0x20')]({'api_key':_0x5cbcfc[_0xa57c('0x16d')]});}else{return _0xda3142[_0xa57c('0x1e')](0xcc)[_0xa57c('0x20')]({'message':_0xa57c('0x16e')});}})[_0xa57c('0x4c')](handleError(_0xda3142,0x193));}else{return _0xda3142['status'](0x191)[_0xa57c('0x20')]({'message':_0xa57c('0x16f')});}};exports['createApiKey']=function(_0x1f21e0,_0x5966da){if(!_[_0xa57c('0x63')](_0x1f21e0[_0xa57c('0x7a')]['id'])&&(_0x1f21e0[_0xa57c('0x7a')][_0xa57c('0x32')]=='admin'||_0x1f21e0['user'][_0xa57c('0x32')]==_0xa57c('0x7a'))){return db[_0xa57c('0x37')]['find']({'where':{'id':_0x1f21e0[_0xa57c('0x4e')]['id']}})['then'](function(_0x1d183d){return authService[_0xa57c('0x170')](_0x1d183d);})[_0xa57c('0x13')](function(_0x5dcb08){return db[_0xa57c('0x37')][_0xa57c('0x26')]({'apiKeyIat':_0x5dcb08[_0xa57c('0x171')],'apiKeyNonce':_0x5dcb08[_0xa57c('0x172')]},{'where':{'id':_0x1f21e0[_0xa57c('0x4e')]['id']}})['then'](function(){return _0x5966da[_0xa57c('0x1e')](0xc8)[_0xa57c('0x20')]({'api_key':_0x5dcb08[_0xa57c('0x16d')]});});})['catch'](handleError(_0x5966da,0x193));}else{return _0x5966da['status'](0x191)[_0xa57c('0x20')]({'message':_0xa57c('0x16f')});}};exports[_0xa57c('0x173')]=function(_0x2c89fd,_0x28bd5e){if(!_['isNil'](_0x2c89fd['user']['id'])&&(_0x2c89fd[_0xa57c('0x7a')][_0xa57c('0x32')]==_0xa57c('0x28')||_0x2c89fd[_0xa57c('0x7a')]['role']==_0xa57c('0x7a'))){return db['User'][_0xa57c('0x57')]({'where':{'id':_0x2c89fd[_0xa57c('0x4e')]['id']}})[_0xa57c('0x13')](handleEntityNotFound(_0x28bd5e,null))['then'](function(_0x199e1b){if(_0x199e1b&&_0x199e1b[_0xa57c('0x174')]&&_0x199e1b[_0xa57c('0x175')])return _0x199e1b;else throw{'message':_0xa57c('0x176')};})['then'](function(_0x3475bb){return db['User'][_0xa57c('0x26')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x2c89fd['params']['id']}});})[_0xa57c('0x13')](respondWithStatusCode(_0x28bd5e,0xc8))['catch'](handleError(_0x28bd5e,0x193));}else{return _0x28bd5e[_0xa57c('0x1e')](0x191)[_0xa57c('0x20')]({'message':_0xa57c('0x16f')});}};exports[_0xa57c('0x177')]=function(_0x3e2d42,_0x1198f7){var _0x364900=_0x3e2d42[_0xa57c('0x7a')][_0xa57c('0x27')]({'plain':!![]});if(!_0x364900){return _0x1198f7[_0xa57c('0x1e')](0x191)[_0xa57c('0x120')]('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x1198f7[_0xa57c('0x1e')](0xc8)[_0xa57c('0x20')](_0x364900);}};exports[_0xa57c('0x178')]=function(_0x211a69,_0x2f6169){var _0x26c4bc={'offset':0x0},_0x27048d={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0x211a69['query'][_0xa57c('0x2e')]&&!_0x211a69[_0xa57c('0x3d')][_0xa57c('0x179')]&&!_0x211a69[_0xa57c('0x3d')]['queues'])return[];return Promise[_0xa57c('0xf5')]()[_0xa57c('0x13')](function(){var _0x3fdd6d=[];if(!_[_0xa57c('0x87')](_0x211a69[_0xa57c('0x3d')][_0xa57c('0x179')])){_0x3fdd6d['push'](db[_0xa57c('0x105')]['findAll']({'attributes':['id','name'],'where':{'id':_0x211a69['query'][_0xa57c('0x179')]}}));}if(!_[_0xa57c('0x87')](_0x211a69[_0xa57c('0x3d')]['queues'])){_0x3fdd6d[_0xa57c('0x43')](db[_0xa57c('0xa1')][_0xa57c('0x86')]({'attributes':['id',_0xa57c('0x33')],'type':_0xa57c('0x17a'),'where':{'id':_0x211a69[_0xa57c('0x3d')][_0xa57c('0x17b')]}}));}return Promise[_0xa57c('0x4b')](_0x3fdd6d);})[_0xa57c('0x13')](function(_0xab4ee0){var _0x5068f6=_[_0xa57c('0x113')](_0xab4ee0)[_0xa57c('0x88')](function(_0x4c3b95){return _0x4c3b95['getAgents']({'attributes':['id',_0xa57c('0x33'),_0xa57c('0x5f'),'online'],'raw':!![]});});return Promise[_0xa57c('0x4b')](_0x5068f6);})[_0xa57c('0x13')](function(_0x5081bc){var _0x45b41d=_[_0xa57c('0x113')](_0x5081bc);if(!_0x211a69[_0xa57c('0x3d')]['filter'])return _0x45b41d;if(_[_0xa57c('0x87')](_0x45b41d)){return db[_0xa57c('0x37')][_0xa57c('0x86')]({'attributes':['id','name',_0xa57c('0x5f'),'online'],'where':{'role':'agent','$or':[db[_0xa57c('0x65')][_0xa57c('0x3c')](db[_0xa57c('0x65')]['fn'](_0xa57c('0x17c'),db['sequelize'][_0xa57c('0x17d')](_0xa57c('0x33'))),{'$like':'%'+_0x211a69['query'][_0xa57c('0x2e')][_0xa57c('0x99')]()+'%'}),{'internal':{'$like':'%'+_0x211a69[_0xa57c('0x3d')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x45b41d)['flatten']()[_0xa57c('0x2e')](function(_0x166732){return _0x166732['name'][_0xa57c('0x99')]()[_0xa57c('0x31')](_0x211a69[_0xa57c('0x3d')][_0xa57c('0x2e')][_0xa57c('0x99')]())||_0x166732[_0xa57c('0x5f')][_0xa57c('0x17e')]()[_0xa57c('0x31')](_0x211a69[_0xa57c('0x3d')][_0xa57c('0x2e')]);})[_0xa57c('0x30')]();}})[_0xa57c('0x13')](function(_0x383b4a){var _0x555179=_0xa57c('0x33');var _0x50ac72=_0xa57c('0x17f');if(_0x211a69['query'][_0xa57c('0xbf')]){var _0x50ac72=_0x211a69[_0xa57c('0x3d')][_0xa57c('0xbf')][0x0]==='-'?_0xa57c('0x180'):_0xa57c('0x17f');var _0x555179=_0x50ac72===_0xa57c('0x17f')?_0x211a69[_0xa57c('0x3d')][_0xa57c('0xbf')]:_0x211a69['query']['sort'][_0xa57c('0x181')](0x1);}return _(_0x383b4a)[_0xa57c('0x182')]('id')[_0xa57c('0x183')]([function(_0x17e769){return _0x555179===_0xa57c('0x33')?_0x17e769[_0x555179]['toLowerCase']():_0x17e769[_0x555179];}],[_0x50ac72])[_0xa57c('0x88')](function(_0x2237a8){return _['pick'](_0x2237a8,['id',_0xa57c('0x33'),_0xa57c('0x5f'),_0xa57c('0x115')]);})[_0xa57c('0x30')]();})['then'](function(_0x55fe3b){return client[_0xa57c('0x12')](_0xa57c('0x2a'),_0x211a69)[_0xa57c('0x13')](function(_0x5cfa15){if(_0x5cfa15['error'])throw new Error(_0xa57c('0x184'));var _0x1d2c6a=_0x5cfa15[_0xa57c('0x185')];var _0x371b71=jayson['client'][_0xa57c('0x186')]({'port':0x232c});return _0x371b71[_0xa57c('0x12')](_0xa57c('0x2a'),_0x211a69)[_0xa57c('0x13')](function(_0x110611){if(_0x110611[_0xa57c('0x19')])throw new Error(_0xa57c('0x187'));var _0x3884be=_0x110611[_0xa57c('0x185')];return _[_0xa57c('0xc1')]({},_0x3884be,_0x1d2c6a);});})[_0xa57c('0x13')](function(_0x47e88a){return _[_0xa57c('0x88')](_0x55fe3b,function(_0x421376){var _0x18b244=_[_0xa57c('0x57')](_0x47e88a[_0xa57c('0x41')],['id',_0x421376['id']]);if(!_0x18b244||!_0x421376[_0xa57c('0x115')]){_0x421376[_0xa57c('0x1e')]='offline';}else if(_0x18b244[_0xa57c('0xa5')]){_0x421376[_0xa57c('0x1e')]=_0xa57c('0xf8');}else{_0x421376[_0xa57c('0x1e')]=_[_0xa57c('0x31')]([_0xa57c('0x188'),_0xa57c('0x189'),_0xa57c('0x18a'),'ringing',null,undefined],_0x18b244[_0xa57c('0x18b')])?'online':_0xa57c('0x18c');}return _0x421376;});});});})[_0xa57c('0x13')](function(_0x4def88){if(!_0x211a69[_0xa57c('0x3d')][_0xa57c('0xc3')](_0xa57c('0xcc'))){_0x26c4bc[_0xa57c('0x23')]=qs[_0xa57c('0x23')](_0x211a69[_0xa57c('0x3d')][_0xa57c('0x23')]||0xa);_0x26c4bc[_0xa57c('0x21')]=qs[_0xa57c('0x21')](_0x211a69[_0xa57c('0x3d')]['offset']);}_0x27048d['count']=_0x4def88[_0xa57c('0x42')];_0x27048d[_0xa57c('0x41')]=_0x26c4bc[_0xa57c('0x23')]?_0x4def88[_0xa57c('0x18d')](_0x26c4bc[_0xa57c('0x21')],_0x26c4bc['offset']+_0x26c4bc[_0xa57c('0x23')]):_0x4def88;return _0x27048d;})[_0xa57c('0x13')](respondWithFilteredResult(_0x2f6169,_0x26c4bc))[_0xa57c('0x4c')](handleError(_0x2f6169,null));};function get_open_tabs(_0x47ce1e,_0x20ba2f){var _0x4b4d2d=_0x47ce1e[_0xa57c('0x18e')](0x0)[_0xa57c('0x18f')]()+_0x47ce1e[_0xa57c('0x18d')](0x1);var _0x421fc0={'type':db[_0xa57c('0x8e')][_0xa57c('0x67')][_0xa57c('0x190')],'raw':!![]};return new BPromise(function(_0x5e2d50,_0x328746){var _0xafcff9=squel[_0xa57c('0x191')]()[_0xa57c('0x192')](_0xa57c('0x193')+_0x4b4d2d+_0xa57c('0x194'),'id')[_0xa57c('0x192')]('ui.createdAt')['from'](_0xa57c('0x195')+_0x47ce1e+_0xa57c('0x196'),'ui')[_0xa57c('0x3c')](_0xa57c('0x197'),_0x20ba2f['id']);return db[_0xa57c('0x65')][_0xa57c('0x3d')](_0xafcff9['toString'](),_0x421fc0)['then'](function(_0x58fcdd){_0x20ba2f[_0x4b4d2d+'OpenTabs']=_0x58fcdd;_0x5e2d50(_0x58fcdd);})['catch'](function(_0x14a67e){_0x328746(_0x14a67e);});});};
\ No newline at end of file
+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(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x1a37,0xb4));var _0x71a3=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x1a37[_0x3826ad];return _0x17b900;};'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
index 3910cfd..b51d10b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf55=['save','update','remove','emit','hasOwnProperty','exports','events','User','setMaxListeners'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xbf55,0xc3));var _0x5bf5=function(_0x501f5c,_0x2292e4){_0x501f5c=_0x501f5c-0x0;var _0x2b988c=_0xbf55[_0x501f5c];return _0x2b988c;};'use strict';var EventEmitter=require(_0x5bf5('0x0'));var User=require('../../mysqldb')['db'][_0x5bf5('0x1')];var UserEvents=new EventEmitter();UserEvents[_0x5bf5('0x2')](0x0);var events={'afterCreate':_0x5bf5('0x3'),'afterUpdate':_0x5bf5('0x4'),'afterDestroy':_0x5bf5('0x5')};function emitEvent(_0x524625){return function(_0x17842e,_0x5dd334,_0x4f373c){UserEvents['emit'](_0x524625+':'+_0x17842e['id'],_0x17842e);UserEvents[_0x5bf5('0x6')](_0x524625,_0x17842e);_0x4f373c(null);};}for(var e in events){if(events[_0x5bf5('0x7')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x5bf5('0x8')]=UserEvents;
\ No newline at end of file
+var _0x3353=['User','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x31ce2d,_0xf40e64){var _0x244b57=function(_0x132d58){while(--_0x132d58){_0x31ce2d['push'](_0x31ce2d['shift']());}};_0x244b57(++_0xf40e64);}(_0x3353,0x170));var _0x3335=function(_0x1c5ac9,_0x31c218){_0x1c5ac9=_0x1c5ac9-0x0;var _0x2302cc=_0x3353[_0x1c5ac9];return _0x2302cc;};'use strict';var EventEmitter=require(_0x3335('0x0'));var User=require(_0x3335('0x1'))['db'][_0x3335('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x3335('0x3')](0x0);var events={'afterCreate':_0x3335('0x4'),'afterUpdate':'update','afterDestroy':_0x3335('0x5')};function emitEvent(_0x39e6f7){return function(_0x16bd9a,_0x405c52,_0x44ebdb){UserEvents['emit'](_0x39e6f7+':'+_0x16bd9a['id'],_0x16bd9a);UserEvents[_0x3335('0x6')](_0x39e6f7,_0x16bd9a);_0x44ebdb(null);};}for(var e in events){if(events[_0x3335('0x7')](e)){var event=events[e];User[_0x3335('0x8')](e,emitEvent(event));}}module[_0x3335('0x9')]=UserEvents;
\ No newline at end of file
index c427c32..3c3fcf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f9=['extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','priority','defaults','VoiceChanSpy','then','internal','concat','catch','models','define','User','utf8','utf8_bin','userProfileId','undefined','resolve','privacyEnabled','updateMd5Password','updatePassword','changed','find','VoiceExtension','bulkCreate','destroy','encryptPassword','function','randomBytes','base64','salt','pbkdf2Sync','sha1','pbkdf2','toString','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','lodash','google','length','context','format','%s%s','prefix','push','Set','CDR(type)=%s','chanspy','merge','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','WAV','gsm','from-sip','system'];(function(_0x2dffff,_0x2ae95a){var _0x452114=function(_0x4504ed){while(--_0x4504ed){_0x2dffff['push'](_0x2dffff['shift']());}};_0x452114(++_0x2ae95a);}(_0x04f9,0xb8));var _0x904f=function(_0x503f13,_0x8975cc){_0x503f13=_0x503f13-0x0;var _0x1ac98e=_0x04f9[_0x503f13];return _0x1ac98e;};'use strict';var BPromise=require(_0x904f('0x0'));var crypto=require(_0x904f('0x1'));var util=require('util');var md5=require('md5');var _=require(_0x904f('0x2'));var attributes=require('./user.attributes');var authTypes=[_0x904f('0x3')];var validatePresenceOf=function(_0x2c6cf8){return _0x2c6cf8&&_0x2c6cf8[_0x904f('0x4')];};var getChanSpyApplications=function(_0x2b878d,_0x16371f,_0x5f1410){var _0x112d51={'context':_0x2b878d[_0x904f('0x5')]||'from-sip','type':'system','isApp':![],'UserId':_0x2b878d['id']};var _0x4f3a8c=[];for(var _0x1d742e=0x0,_0x379bdd=0x1;_0x1d742e<_0x5f1410[_0x904f('0x4')];_0x1d742e++,_0x379bdd=0x1){var _0x2d053f={'exten':util[_0x904f('0x6')](_0x904f('0x7'),_0x5f1410[_0x1d742e][_0x904f('0x8')],_0x16371f),'ChanSpyId':_0x5f1410[_0x1d742e]['id']};_0x4f3a8c[_0x904f('0x9')](_['merge']({'app':_0x904f('0xa'),'appdata':util[_0x904f('0x6')](_0x904f('0xb'),_0x904f('0xc')),'priority':_0x379bdd++},_0x112d51,_0x2d053f));if(_0x5f1410[_0x1d742e]['record']){_0x4f3a8c['push'](_[_0x904f('0xd')]({'app':'MixMonitor','appdata':util['format']('${UNIQUEID}.%s,a',_0x5f1410[_0x1d742e][_0x904f('0xe')]),'priority':_0x379bdd++},_0x112d51,_0x2d053f));}if(_0x5f1410[_0x1d742e][_0x904f('0xf')]){_0x4f3a8c[_0x904f('0x9')](_[_0x904f('0xd')]({'app':_0x904f('0x10'),'appdata':_0x5f1410[_0x1d742e][_0x904f('0x11')],'priority':_0x379bdd++},_0x112d51,_0x2d053f));}_0x4f3a8c[_0x904f('0x9')](_[_0x904f('0xd')]({'app':_0x904f('0x12'),'appdata':util[_0x904f('0x6')](_0x904f('0x13'),_0x2b878d[_0x904f('0x14')],_0x5f1410[_0x1d742e][_0x904f('0x15')]?_0x5f1410[_0x1d742e]['options'][_0x904f('0x16')](''):''),'priority':_0x379bdd++},_0x112d51,_0x2d053f));if(_0x5f1410[_0x1d742e][_0x904f('0x17')]){_0x4f3a8c[_0x904f('0x9')](_[_0x904f('0xd')]({'app':_0x904f('0x18'),'priority':_0x379bdd++},_0x112d51,_0x2d053f));}}return _0x4f3a8c;};var getUserApplications=function(_0x385dd4,_0x5ee2df){var _0x4521d1=['wav',_0x904f('0x19'),_0x904f('0x1a')];var _0x305811={'context':_0x385dd4['context']||_0x904f('0x1b'),'exten':_0x5ee2df,'type':_0x904f('0x1c'),'isApp':![],'UserId':_0x385dd4['id']};var _0x131322=[{'app':_0x904f('0xa'),'appdata':'CDR(type)=internal'}];if(_0x385dd4[_0x904f('0x1d')]&&_[_0x904f('0x1e')](_0x4521d1,_0x385dd4[_0x904f('0x1d')])){_0x131322[_0x904f('0x9')]({'app':'Set','appdata':_0x904f('0x1f')});_0x131322[_0x904f('0x9')]({'app':_0x904f('0xa'),'appdata':util[_0x904f('0x6')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x385dd4[_0x904f('0x1d')])});_0x131322['push']({'app':'Dial','appdata':util['format'](_0x904f('0x20'),_0x385dd4[_0x904f('0x14')])});}else{_0x131322[_0x904f('0x9')]({'app':'Dial','appdata':util[_0x904f('0x6')](_0x904f('0x21'),_0x385dd4[_0x904f('0x14')])});}_0x131322[_0x904f('0x9')]({'app':'Hangup'});for(var _0xe47381=0x0;_0xe47381<_0x131322[_0x904f('0x4')];_0xe47381++){_0x131322[_0xe47381][_0x904f('0x22')]=_0xe47381+0x1;_0x131322[_0xe47381]=_[_0x904f('0x23')](_0x131322[_0xe47381],_0x305811);}return _0x131322;};var getChanSpyPromise=function(_0x4d4f4d,_0x35236b){return new BPromise(function(_0x2ea7b9,_0x4af3c0){return _0x4d4f4d[_0x904f('0x24')]['findAll']()[_0x904f('0x25')](function(_0x4724f3){if(_0x4724f3){var _0x4ec6d5=getChanSpyApplications(_0x35236b,_0x35236b[_0x904f('0x26')],_0x4724f3);if(_0x35236b[_0x904f('0x26')]!=_0x35236b[_0x904f('0x14')]){_0x4ec6d5=_0x4ec6d5[_0x904f('0x27')](getChanSpyApplications(_0x35236b,_0x35236b[_0x904f('0x14')],_0x4724f3));}return _0x2ea7b9(_0x4ec6d5);}return _0x2ea7b9([]);})[_0x904f('0x28')](function(_0x44847e){_0x4af3c0(_0x44847e);});});};module['exports']=function(_0x82f7f3,_0x40f41f){var _0x4a4c9b=_0x82f7f3[_0x904f('0x29')];return _0x82f7f3[_0x904f('0x2a')](_0x904f('0x2b'),attributes,{'tableName':'users','charset':_0x904f('0x2c'),'collate':_0x904f('0x2d'),'hooks':{'beforeCreate':function(_0x3e1cc0,_0x38ab10,_0x27ba9c){var _0x4c7589=typeof _0x3e1cc0[_0x904f('0x2e')]===_0x904f('0x2f')?BPromise[_0x904f('0x30')](null):_0x4a4c9b['UserProfile']['find']({'where':{'id':_0x3e1cc0[_0x904f('0x2e')]}});_0x4c7589[_0x904f('0x25')](function(_0x3b069d){if(_0x3b069d){_0x3e1cc0[_0x904f('0x31')]=_0x3b069d[_0x904f('0x31')];}})[_0x904f('0x25')](function(){_0x3e1cc0[_0x904f('0x32')]();_0x3e1cc0[_0x904f('0x33')](_0x27ba9c);})[_0x904f('0x28')](function(_0x3d68f3){_0x27ba9c(_0x3d68f3);});},'beforeUpdate':function(_0x31a314,_0x38230a,_0xbc9df5){Promise[_0x904f('0x30')]()[_0x904f('0x25')](function(){if(_0x31a314[_0x904f('0x34')](_0x904f('0x2e'))===![])return;return _0x4a4c9b['UserProfile'][_0x904f('0x35')]({'where':{'id':_0x31a314[_0x904f('0x2e')]}})['then'](function(_0x49849e){if(_0x49849e)_0x31a314[_0x904f('0x31')]=_0x49849e[_0x904f('0x31')];return;});})[_0x904f('0x25')](function(){if(_0x31a314['changed'](_0x904f('0x11'))){_0x31a314[_0x904f('0x32')]();return _0x31a314[_0x904f('0x33')](_0xbc9df5);}_0xbc9df5();})[_0x904f('0x28')](function(_0x44996e){_0xbc9df5(_0x44996e);});},'afterCreate':function(_0x3fb474,_0x290fdc,_0x2b713c){var _0xdf11be=getUserApplications(_0x3fb474,_0x3fb474[_0x904f('0x26')]);if(_0x3fb474[_0x904f('0x26')]!=_0x3fb474[_0x904f('0x14')]){_0xdf11be=_0xdf11be['concat'](getUserApplications(_0x3fb474,_0x3fb474[_0x904f('0x14')]));}return _0x4a4c9b[_0x904f('0x36')][_0x904f('0x37')](_0xdf11be)[_0x904f('0x25')](function(){if(_0x3fb474[_0x904f('0xc')]){return getChanSpyPromise(_0x4a4c9b,_0x3fb474);}})['then'](function(_0x4da664){if(_0x4da664&&_0x4da664[_0x904f('0x4')]){return _0x4a4c9b[_0x904f('0x36')]['bulkCreate'](_0x4da664);}})[_0x904f('0x25')](function(){_0x2b713c();})['catch'](function(_0x3b8acd){_0x2b713c(_0x3b8acd);});},'afterUpdate':function(_0x5b359f,_0x207a9f,_0x1eea3f){return BPromise[_0x904f('0x30')]()[_0x904f('0x25')](function(){if(_0x5b359f[_0x904f('0x34')]('chanspy')||_0x5b359f[_0x904f('0x34')](_0x904f('0x5'))){return _0x4a4c9b['VoiceExtension']['destroy']({'where':{'UserId':_0x5b359f['id'],'type':_0x904f('0x1c'),'ChanSpyId':{'$ne':null}}})[_0x904f('0x25')](function(){if(_0x5b359f[_0x904f('0xc')]){return getChanSpyPromise(_0x4a4c9b,_0x5b359f)[_0x904f('0x25')](function(_0x44d7ed){if(_0x44d7ed&&_0x44d7ed[_0x904f('0x4')]){return _0x4a4c9b[_0x904f('0x36')][_0x904f('0x37')](_0x44d7ed);}});}});}})['then'](function(){if(_0x5b359f[_0x904f('0x34')](_0x904f('0x1d'))||_0x5b359f['changed']('context')){return _0x4a4c9b['VoiceExtension'][_0x904f('0x38')]({'where':{'UserId':_0x5b359f['id'],'type':_0x904f('0x1c'),'ChanSpyId':null}})[_0x904f('0x25')](function(){var _0x31395d=getUserApplications(_0x5b359f,_0x5b359f[_0x904f('0x26')]);if(_0x5b359f['internal']!=_0x5b359f[_0x904f('0x14')]){_0x31395d=_0x31395d[_0x904f('0x27')](getUserApplications(_0x5b359f,_0x5b359f[_0x904f('0x14')]));}return _0x4a4c9b[_0x904f('0x36')][_0x904f('0x37')](_0x31395d);});}})[_0x904f('0x25')](function(){_0x1eea3f();})['catch'](function(_0x496331){_0x1eea3f(_0x496331);});},'afterDestroy':function(_0x2da5a8,_0x323a0d){return _0x4a4c9b[_0x904f('0x36')][_0x904f('0x38')]({'where':{'UserId':_0x2da5a8['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x5007e6,_0x76f6bc){if(!_0x76f6bc){return this[_0x904f('0x11')]===this[_0x904f('0x39')](_0x5007e6);}var _0x1652c2=this;this[_0x904f('0x39')](_0x5007e6,function(_0x5cf4f3,_0xade108){if(_0x5cf4f3){_0x76f6bc(_0x5cf4f3);}if(_0x1652c2[_0x904f('0x11')]===_0xade108){_0x76f6bc(null,!![]);}else{_0x76f6bc(null,![]);}});},'makeSalt':function(_0x57f599,_0x131fe8){var _0x541005=0x10;if(typeof arguments[0x0]==='function'){_0x131fe8=arguments[0x0];_0x57f599=_0x541005;}else if(typeof arguments[0x1]===_0x904f('0x3a')){_0x131fe8=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x57f599){_0x57f599=_0x541005;}return crypto[_0x904f('0x3b')](_0x57f599,function(_0x3b5722,_0x45b4b6){if(_0x3b5722){_0x131fe8(_0x3b5722);}return _0x131fe8(null,_0x45b4b6['toString'](_0x904f('0x3c')));});},'encryptPassword':function(_0x25b348,_0x102e30){if(!_0x25b348||!this[_0x904f('0x3d')]){return _0x102e30?_0x102e30(null):null;}var _0x2f9ff1=0x2710;var _0x51053f=0x40;var _0x4f5849=new Buffer(this[_0x904f('0x3d')],_0x904f('0x3c'));if(!_0x102e30){return crypto[_0x904f('0x3e')](_0x25b348,_0x4f5849,_0x2f9ff1,_0x51053f,_0x904f('0x3f'))['toString']('base64');}return crypto[_0x904f('0x40')](_0x25b348,_0x4f5849,_0x2f9ff1,_0x51053f,_0x904f('0x3f'),function(_0x306561,_0x130d3a){if(_0x306561){_0x102e30(_0x306561);}return _0x102e30(null,_0x130d3a[_0x904f('0x41')](_0x904f('0x3c')));});},'updatePassword':function(_0x51ecae){if(!this[_0x904f('0x11')]){return _0x51ecae(null);}if(!validatePresenceOf(this[_0x904f('0x11')])&&authTypes['indexOf'](this[_0x904f('0x42')])===-0x1){_0x51ecae(new Error(_0x904f('0x43')));}var _0x1a4ea6=this;this[_0x904f('0x44')](function(_0x2cd5a5,_0x482327){if(_0x2cd5a5){return _0x51ecae(_0x2cd5a5);}_0x1a4ea6['salt']=_0x482327;_0x1a4ea6[_0x904f('0x39')](_0x1a4ea6[_0x904f('0x11')],function(_0x26fd69,_0x1051a1){if(_0x26fd69){_0x51ecae(_0x26fd69);}_0x1a4ea6[_0x904f('0x11')]=_0x1051a1;_0x51ecae(null);});});},'updateMd5Password':function(){this[_0x904f('0x45')]=md5(this[_0x904f('0x14')]+_0x904f('0x46')+this[_0x904f('0x11')]);return this[_0x904f('0x45')];}}});};
\ No newline at end of file
+var _0x5f5e=['updateMd5Password','resolve','privacyEnabled','changed','updatePassword','concat','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','sha1','pbkdf2','provider','makeSalt','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes','length','from-sip','system','format','%s%s','prefix','push','Set','chanspy','record','merge','${UNIQUEID}.%s,a','auth','password','SIP/%s,%s','options','join','wav','WAV','context','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','internal','name','catch','exports','models','define','User','users','utf8','userProfileId','undefined','UserProfile','find'];(function(_0x2f2665,_0xe02029){var _0x347db5=function(_0x4ed877){while(--_0x4ed877){_0x2f2665['push'](_0x2f2665['shift']());}};_0x347db5(++_0xe02029);}(_0x5f5e,0x1d2));var _0xe5f5=function(_0x87fbd0,_0x304a55){_0x87fbd0=_0x87fbd0-0x0;var _0x3260c4=_0x5f5e[_0x87fbd0];return _0x3260c4;};'use strict';var BPromise=require(_0xe5f5('0x0'));var crypto=require(_0xe5f5('0x1'));var util=require(_0xe5f5('0x2'));var md5=require(_0xe5f5('0x3'));var _=require(_0xe5f5('0x4'));var attributes=require(_0xe5f5('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x5c52da){return _0x5c52da&&_0x5c52da[_0xe5f5('0x6')];};var getChanSpyApplications=function(_0x268585,_0x3bdb6d,_0x5cb127){var _0x646d17={'context':_0x268585['context']||_0xe5f5('0x7'),'type':_0xe5f5('0x8'),'isApp':![],'UserId':_0x268585['id']};var _0x40426b=[];for(var _0x3d5bb6=0x0,_0x32cdc2=0x1;_0x3d5bb6<_0x5cb127[_0xe5f5('0x6')];_0x3d5bb6++,_0x32cdc2=0x1){var _0x42863d={'exten':util[_0xe5f5('0x9')](_0xe5f5('0xa'),_0x5cb127[_0x3d5bb6][_0xe5f5('0xb')],_0x3bdb6d),'ChanSpyId':_0x5cb127[_0x3d5bb6]['id']};_0x40426b[_0xe5f5('0xc')](_['merge']({'app':_0xe5f5('0xd'),'appdata':util[_0xe5f5('0x9')]('CDR(type)=%s',_0xe5f5('0xe')),'priority':_0x32cdc2++},_0x646d17,_0x42863d));if(_0x5cb127[_0x3d5bb6][_0xe5f5('0xf')]){_0x40426b['push'](_[_0xe5f5('0x10')]({'app':'MixMonitor','appdata':util['format'](_0xe5f5('0x11'),_0x5cb127[_0x3d5bb6]['recordingFormat']),'priority':_0x32cdc2++},_0x646d17,_0x42863d));}if(_0x5cb127[_0x3d5bb6][_0xe5f5('0x12')]){_0x40426b[_0xe5f5('0xc')](_[_0xe5f5('0x10')]({'app':'Authenticate','appdata':_0x5cb127[_0x3d5bb6][_0xe5f5('0x13')],'priority':_0x32cdc2++},_0x646d17,_0x42863d));}_0x40426b[_0xe5f5('0xc')](_['merge']({'app':'ChanSpy','appdata':util[_0xe5f5('0x9')](_0xe5f5('0x14'),_0x268585['name'],_0x5cb127[_0x3d5bb6][_0xe5f5('0x15')]?_0x5cb127[_0x3d5bb6][_0xe5f5('0x15')][_0xe5f5('0x16')](''):''),'priority':_0x32cdc2++},_0x646d17,_0x42863d));if(_0x5cb127[_0x3d5bb6]['record']){_0x40426b['push'](_['merge']({'app':'StopMixMonitor','priority':_0x32cdc2++},_0x646d17,_0x42863d));}}return _0x40426b;};var getUserApplications=function(_0x18a867,_0x37f0b2){var _0x142cf=[_0xe5f5('0x17'),_0xe5f5('0x18'),'gsm'];var _0x20e5dd={'context':_0x18a867[_0xe5f5('0x19')]||'from-sip','exten':_0x37f0b2,'type':_0xe5f5('0x8'),'isApp':![],'UserId':_0x18a867['id']};var _0x15e725=[{'app':_0xe5f5('0xd'),'appdata':_0xe5f5('0x1a')}];if(_0x18a867[_0xe5f5('0x1b')]&&_[_0xe5f5('0x1c')](_0x142cf,_0x18a867[_0xe5f5('0x1b')])){_0x15e725[_0xe5f5('0xc')]({'app':'Set','appdata':_0xe5f5('0x1d')});_0x15e725[_0xe5f5('0xc')]({'app':_0xe5f5('0xd'),'appdata':util[_0xe5f5('0x9')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x18a867['extensionMonitor'])});_0x15e725['push']({'app':_0xe5f5('0x1e'),'appdata':util[_0xe5f5('0x9')](_0xe5f5('0x1f'),_0x18a867['name'])});}else{_0x15e725[_0xe5f5('0xc')]({'app':_0xe5f5('0x1e'),'appdata':util[_0xe5f5('0x9')](_0xe5f5('0x20'),_0x18a867['name'])});}_0x15e725[_0xe5f5('0xc')]({'app':_0xe5f5('0x21')});for(var _0x198250=0x0;_0x198250<_0x15e725[_0xe5f5('0x6')];_0x198250++){_0x15e725[_0x198250][_0xe5f5('0x22')]=_0x198250+0x1;_0x15e725[_0x198250]=_[_0xe5f5('0x23')](_0x15e725[_0x198250],_0x20e5dd);}return _0x15e725;};var getChanSpyPromise=function(_0x562f44,_0x329f35){return new BPromise(function(_0x48f012,_0x2d9ecb){return _0x562f44[_0xe5f5('0x24')][_0xe5f5('0x25')]()[_0xe5f5('0x26')](function(_0x740fd5){if(_0x740fd5){var _0x15f9df=getChanSpyApplications(_0x329f35,_0x329f35[_0xe5f5('0x27')],_0x740fd5);if(_0x329f35[_0xe5f5('0x27')]!=_0x329f35[_0xe5f5('0x28')]){_0x15f9df=_0x15f9df['concat'](getChanSpyApplications(_0x329f35,_0x329f35['name'],_0x740fd5));}return _0x48f012(_0x15f9df);}return _0x48f012([]);})[_0xe5f5('0x29')](function(_0x30519e){_0x2d9ecb(_0x30519e);});});};module[_0xe5f5('0x2a')]=function(_0x2eb80e,_0x3de01e){var _0x1a49c1=_0x2eb80e[_0xe5f5('0x2b')];return _0x2eb80e[_0xe5f5('0x2c')](_0xe5f5('0x2d'),attributes,{'tableName':_0xe5f5('0x2e'),'charset':_0xe5f5('0x2f'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x43e021,_0x169257,_0x4e90bf){var _0x29b90c=typeof _0x43e021[_0xe5f5('0x30')]===_0xe5f5('0x31')?BPromise['resolve'](null):_0x1a49c1[_0xe5f5('0x32')][_0xe5f5('0x33')]({'where':{'id':_0x43e021['userProfileId']}});_0x29b90c['then'](function(_0x4f1429){if(_0x4f1429){_0x43e021['privacyEnabled']=_0x4f1429['privacyEnabled'];}})[_0xe5f5('0x26')](function(){_0x43e021[_0xe5f5('0x34')]();_0x43e021['updatePassword'](_0x4e90bf);})[_0xe5f5('0x29')](function(_0x1a4c76){_0x4e90bf(_0x1a4c76);});},'beforeUpdate':function(_0x5039d6,_0x40a02a,_0x57ee10){Promise[_0xe5f5('0x35')]()['then'](function(){if(_0x5039d6['changed'](_0xe5f5('0x30'))===![])return;return _0x1a49c1[_0xe5f5('0x32')]['find']({'where':{'id':_0x5039d6[_0xe5f5('0x30')]}})['then'](function(_0x4406d6){if(_0x4406d6)_0x5039d6['privacyEnabled']=_0x4406d6[_0xe5f5('0x36')];return;});})[_0xe5f5('0x26')](function(){if(_0x5039d6[_0xe5f5('0x37')]('password')){_0x5039d6[_0xe5f5('0x34')]();return _0x5039d6[_0xe5f5('0x38')](_0x57ee10);}_0x57ee10();})[_0xe5f5('0x29')](function(_0x3a27bd){_0x57ee10(_0x3a27bd);});},'afterCreate':function(_0x1f5da2,_0x9960f0,_0x13517a){var _0x3ae0f3=getUserApplications(_0x1f5da2,_0x1f5da2[_0xe5f5('0x27')]);if(_0x1f5da2[_0xe5f5('0x27')]!=_0x1f5da2[_0xe5f5('0x28')]){_0x3ae0f3=_0x3ae0f3[_0xe5f5('0x39')](getUserApplications(_0x1f5da2,_0x1f5da2[_0xe5f5('0x28')]));}return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3b')](_0x3ae0f3)[_0xe5f5('0x26')](function(){if(_0x1f5da2[_0xe5f5('0xe')]){return getChanSpyPromise(_0x1a49c1,_0x1f5da2);}})['then'](function(_0x4797ae){if(_0x4797ae&&_0x4797ae[_0xe5f5('0x6')]){return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3b')](_0x4797ae);}})['then'](function(){_0x13517a();})[_0xe5f5('0x29')](function(_0x34a287){_0x13517a(_0x34a287);});},'afterUpdate':function(_0x2b5a8b,_0x2af4d9,_0x5c9f58){return BPromise[_0xe5f5('0x35')]()[_0xe5f5('0x26')](function(){if(_0x2b5a8b[_0xe5f5('0x37')]('chanspy')||_0x2b5a8b[_0xe5f5('0x37')](_0xe5f5('0x19'))){return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3c')]({'where':{'UserId':_0x2b5a8b['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xe5f5('0x26')](function(){if(_0x2b5a8b[_0xe5f5('0xe')]){return getChanSpyPromise(_0x1a49c1,_0x2b5a8b)[_0xe5f5('0x26')](function(_0x4b16a9){if(_0x4b16a9&&_0x4b16a9['length']){return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3b')](_0x4b16a9);}});}});}})[_0xe5f5('0x26')](function(){if(_0x2b5a8b[_0xe5f5('0x37')](_0xe5f5('0x1b'))||_0x2b5a8b['changed'](_0xe5f5('0x19'))){return _0x1a49c1[_0xe5f5('0x3a')]['destroy']({'where':{'UserId':_0x2b5a8b['id'],'type':_0xe5f5('0x8'),'ChanSpyId':null}})['then'](function(){var _0x1ffa38=getUserApplications(_0x2b5a8b,_0x2b5a8b[_0xe5f5('0x27')]);if(_0x2b5a8b[_0xe5f5('0x27')]!=_0x2b5a8b[_0xe5f5('0x28')]){_0x1ffa38=_0x1ffa38['concat'](getUserApplications(_0x2b5a8b,_0x2b5a8b[_0xe5f5('0x28')]));}return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3b')](_0x1ffa38);});}})['then'](function(){_0x5c9f58();})['catch'](function(_0x3f582f){_0x5c9f58(_0x3f582f);});},'afterDestroy':function(_0x31d8ef,_0xa2bb4f){return _0x1a49c1[_0xe5f5('0x3a')][_0xe5f5('0x3c')]({'where':{'UserId':_0x31d8ef['id'],'type':_0xe5f5('0x8')}});}},'instanceMethods':{'authenticate':function(_0x5ef9b9,_0x2d7470){if(!_0x2d7470){return this['password']===this[_0xe5f5('0x3d')](_0x5ef9b9);}var _0xa269ea=this;this['encryptPassword'](_0x5ef9b9,function(_0x1a0e99,_0x5c3e3b){if(_0x1a0e99){_0x2d7470(_0x1a0e99);}if(_0xa269ea[_0xe5f5('0x13')]===_0x5c3e3b){_0x2d7470(null,!![]);}else{_0x2d7470(null,![]);}});},'makeSalt':function(_0x5a0c33,_0x30dbbc){var _0x15828e=0x10;if(typeof arguments[0x0]===_0xe5f5('0x3e')){_0x30dbbc=arguments[0x0];_0x5a0c33=_0x15828e;}else if(typeof arguments[0x1]===_0xe5f5('0x3e')){_0x30dbbc=arguments[0x1];}else{throw new Error(_0xe5f5('0x3f'));}if(!_0x5a0c33){_0x5a0c33=_0x15828e;}return crypto[_0xe5f5('0x40')](_0x5a0c33,function(_0x2e280b,_0xb8cb97){if(_0x2e280b){_0x30dbbc(_0x2e280b);}return _0x30dbbc(null,_0xb8cb97[_0xe5f5('0x41')](_0xe5f5('0x42')));});},'encryptPassword':function(_0x306b70,_0x14cca5){if(!_0x306b70||!this[_0xe5f5('0x43')]){return _0x14cca5?_0x14cca5(null):null;}var _0xbe9d7a=0x2710;var _0x260394=0x40;var _0x20938e=new Buffer(this[_0xe5f5('0x43')],'base64');if(!_0x14cca5){return crypto[_0xe5f5('0x44')](_0x306b70,_0x20938e,_0xbe9d7a,_0x260394,_0xe5f5('0x45'))[_0xe5f5('0x41')](_0xe5f5('0x42'));}return crypto[_0xe5f5('0x46')](_0x306b70,_0x20938e,_0xbe9d7a,_0x260394,_0xe5f5('0x45'),function(_0x2b3a49,_0x540dca){if(_0x2b3a49){_0x14cca5(_0x2b3a49);}return _0x14cca5(null,_0x540dca[_0xe5f5('0x41')](_0xe5f5('0x42')));});},'updatePassword':function(_0x140123){if(!this[_0xe5f5('0x13')]){return _0x140123(null);}if(!validatePresenceOf(this['password'])&&authTypes['indexOf'](this[_0xe5f5('0x47')])===-0x1){_0x140123(new Error('Invalid\x20password'));}var _0x5deb49=this;this[_0xe5f5('0x48')](function(_0x294308,_0x16c0a9){if(_0x294308){return _0x140123(_0x294308);}_0x5deb49[_0xe5f5('0x43')]=_0x16c0a9;_0x5deb49[_0xe5f5('0x3d')](_0x5deb49['password'],function(_0x482e0a,_0x2f28cf){if(_0x482e0a){_0x140123(_0x482e0a);}_0x5deb49[_0xe5f5('0x13')]=_0x2f28cf;_0x140123(null);});});},'updateMd5Password':function(){this[_0xe5f5('0x49')]=md5(this['name']+':asterisk:'+this['password']);return this[_0xe5f5('0x49')];}}});};
\ No newline at end of file
index 55d6978..a1e4ec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef3f=['body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','findOne','channel','Unknown\x20channel','system','mail','chat','sms','set','Pause','all','LogoutUser','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','upsert','loginInPause','UserVoiceQueue.penalty','role','LOGIN','callysquare','merge','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','limit','include','map','model','attributes','ShowUser','find','where','PauseUser','name','internal','interface','UserVoiceQueueRt','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s'];(function(_0x551d1d,_0x1ade6e){var _0x4720b4=function(_0x353e73){while(--_0x353e73){_0x551d1d['push'](_0x551d1d['shift']());}};_0x4720b4(++_0x1ade6e);}(_0xef3f,0x1e2));var _0xfef3=function(_0x5d6020,_0x2ab917){_0x5d6020=_0x5d6020-0x0;var _0x2f6685=_0xef3f[_0x5d6020];return _0x2f6685;};'use strict';var _=require(_0xfef3('0x0'));var util=require(_0xfef3('0x1'));var moment=require(_0xfef3('0x2'));var BPromise=require('bluebird');var rs=require(_0xfef3('0x3'));var fs=require('fs');var Redis=require(_0xfef3('0x4'));var db=require(_0xfef3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfef3('0x6'))(_0xfef3('0x7'));var config=require('../../config/environment');var jayson=require(_0xfef3('0x8'));var client=jayson[_0xfef3('0x9')][_0xfef3('0xa')]({'port':0x232a});config[_0xfef3('0xb')]=_[_0xfef3('0xc')](config['redis'],{'host':_0xfef3('0xd'),'port':0x18eb});var socket=require(_0xfef3('0xe'))(new Redis(config[_0xfef3('0xb')]));require(_0xfef3('0xf'))[_0xfef3('0x10')](socket);function respondWithRpcPromise(_0x5b39eb,_0x39cd89,_0x471c63){return new BPromise(function(_0xfdd22d,_0x2bd1ab){return client[_0xfef3('0x11')](_0x5b39eb,_0x471c63)[_0xfef3('0x12')](function(_0x3186c1){logger[_0xfef3('0x13')](_0xfef3('0x14'),_0x39cd89,_0xfef3('0x15'));logger[_0xfef3('0x16')](_0xfef3('0x17'),_0x39cd89,_0xfef3('0x15'),JSON[_0xfef3('0x18')](_0x3186c1));if(_0x3186c1[_0xfef3('0x19')]){if(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1a')]===0x1f4){logger[_0xfef3('0x19')](_0xfef3('0x14'),_0x39cd89,_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);return _0x2bd1ab(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);}logger[_0xfef3('0x19')]('User,\x20%s,\x20%s',_0x39cd89,_0x3186c1[_0xfef3('0x19')]['message']);return _0xfdd22d(_0x3186c1[_0xfef3('0x19')][_0xfef3('0x1b')]);}else{logger['info']('User,\x20%s,\x20%s',_0x39cd89,_0xfef3('0x15'));_0xfdd22d(_0x3186c1[_0xfef3('0x1c')]['message']);}})[_0xfef3('0x1d')](function(_0x364050){logger[_0xfef3('0x19')](_0xfef3('0x14'),_0x39cd89,_0x364050);_0x2bd1ab(_0x364050);});});}exports[_0xfef3('0x1e')]=function(_0x47f655){var _0x191d47=this;return new Promise(function(_0x5badaf,_0x3e5060){return db[_0xfef3('0x1f')][_0xfef3('0x20')]({'raw':_0x47f655[_0xfef3('0x21')]?_0x47f655['options'][_0xfef3('0x22')]===undefined?!![]:![]:!![],'where':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')]['where']||null:null,'attributes':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')]['attributes']||null:null,'limit':_0x47f655[_0xfef3('0x21')]?_0x47f655['options'][_0xfef3('0x23')]||null:null,'include':_0x47f655[_0xfef3('0x21')]?_0x47f655[_0xfef3('0x21')][_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x47f655[_0xfef3('0x21')][_0xfef3('0x24')],function(_0x218968){return{'model':db[_0x218968[_0xfef3('0x26')]],'as':_0x218968['as'],'attributes':_0x218968['attributes'],'include':_0x218968[_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x218968[_0xfef3('0x24')],function(_0x1082e7){return{'model':db[_0x1082e7[_0xfef3('0x26')]],'as':_0x1082e7['as'],'attributes':_0x1082e7[_0xfef3('0x27')],'include':_0x1082e7['include']?_[_0xfef3('0x25')](_0x1082e7[_0xfef3('0x24')],function(_0x5069ae){return{'model':db[_0x5069ae[_0xfef3('0x26')]],'as':_0x5069ae['as'],'attributes':_0x5069ae[_0xfef3('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31e8c2){logger[_0xfef3('0x13')](_0xfef3('0x1e'),_0x47f655);logger[_0xfef3('0x16')](_0xfef3('0x1e'),_0x47f655,JSON[_0xfef3('0x18')](_0x31e8c2));_0x5badaf(_0x31e8c2);})[_0xfef3('0x1d')](function(_0x199e10){logger['error'](_0xfef3('0x1e'),_0x199e10[_0xfef3('0x1b')],_0x47f655);_0x3e5060(_0x191d47['error'](0x1f4,_0x199e10[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x28')]=function(_0x6bc96){var _0x37c22a=this;return new Promise(function(_0x15eb79,_0x15c7fb){return db[_0xfef3('0x1f')][_0xfef3('0x29')]({'raw':_0x6bc96['options']?_0x6bc96[_0xfef3('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x6bc96['options']?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x2a')]||null:null,'attributes':_0x6bc96[_0xfef3('0x21')]?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x27')]||null:null,'include':_0x6bc96[_0xfef3('0x21')]?_0x6bc96[_0xfef3('0x21')][_0xfef3('0x24')]?_[_0xfef3('0x25')](_0x6bc96['options'][_0xfef3('0x24')],function(_0x57c3a9){return{'model':db[_0x57c3a9['model']],'as':_0x57c3a9['as'],'attributes':_0x57c3a9[_0xfef3('0x27')],'include':_0x57c3a9[_0xfef3('0x24')]?_['map'](_0x57c3a9[_0xfef3('0x24')],function(_0x2fba7e){return{'model':db[_0x2fba7e[_0xfef3('0x26')]],'as':_0x2fba7e['as'],'attributes':_0x2fba7e[_0xfef3('0x27')],'include':_0x2fba7e['include']?_[_0xfef3('0x25')](_0x2fba7e['include'],function(_0xfd3789){return{'model':db[_0xfd3789['model']],'as':_0xfd3789['as'],'attributes':_0xfd3789[_0xfef3('0x27')]};}):[]};}):[]};}):[]:[]})[_0xfef3('0x12')](function(_0x4df3f0){logger[_0xfef3('0x13')]('ShowUser',_0x6bc96);logger[_0xfef3('0x16')]('ShowUser',_0x6bc96,JSON[_0xfef3('0x18')](_0x4df3f0));_0x15eb79(_0x4df3f0);})[_0xfef3('0x1d')](function(_0x3e1512){logger[_0xfef3('0x19')](_0xfef3('0x28'),_0x3e1512['message'],_0x6bc96);_0x15c7fb(_0x37c22a['error'](0x1f4,_0x3e1512[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x2b')]=function(_0x59c151){var _0x5d5e8d=this;return new Promise(function(_0x2f1463,_0x2dcfc8){var _0x1e194d;return db[_0xfef3('0x1f')]['find']({'where':_0x59c151[_0xfef3('0x21')]['where']||{},'attributes':['id',_0xfef3('0x2c'),'role',_0xfef3('0x2d'),_0xfef3('0x2e')]})[_0xfef3('0x12')](function(_0x5f0007){if(_0x5f0007){_0x1e194d=_0x5f0007;return db[_0xfef3('0x2f')]['update']({'paused':0x1},{'where':{'UserId':_0x1e194d['id']},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0x1e194d){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0x1e194d[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}});}})['then'](function(_0x1b126d){if(_0x1e194d){if(_0x1b126d&&_0x1b126d[_0xfef3('0x32')]){var _0x454be5=moment()[_0xfef3('0x33')](_0xfef3('0x34'));for(var _0x4a2cc2=0x0,_0x59e1c2=_0x1b126d[_0xfef3('0x32')];_0x4a2cc2<_0x59e1c2;_0x4a2cc2++){_0x1b126d[_0x4a2cc2][_0xfef3('0x35')]({'exitAt':_0x454be5});}}}})['then'](function(){if(_0x1e194d){var _0x5557fc=[];var _0x376f40=utils[_0xfef3('0x36')]();_0x376f40[_0xfef3('0x37')](function(_0x540a90){_0x5557fc[_0xfef3('0x38')]({'channel':_0x540a90,'membername':_0x1e194d[_0xfef3('0x2c')],'interface':_['isNil'](_0x1e194d['interface'])?util[_0xfef3('0x33')](_0xfef3('0x39'),_0x1e194d[_0xfef3('0x2c')]):_0x1e194d['interface'],'type':_0xfef3('0x31'),'enterAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'data1':_0x59c151[_0xfef3('0x3a')][_0xfef3('0x3b')]||_0xfef3('0x3c'),'role':_0x1e194d['role'],'internal':_0x1e194d['internal'],'uniqueid':_0x59c151['body'][_0xfef3('0x3d')]||null});});return db[_0xfef3('0x30')][_0xfef3('0x3e')](_0x5557fc,{'individualHooks':!![]});}})['then'](function(){if(_0x1e194d){return _0x1e194d[_0xfef3('0x3f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x59c151[_0xfef3('0x3a')][_0xfef3('0x3b')]||_0xfef3('0x3c'),'lastPauseAt':moment()[_0xfef3('0x33')](_0xfef3('0x34'))});}})['then'](function(_0x196179){_0x2f1463(_0x196179);})[_0xfef3('0x1d')](function(_0x6ca9eb){_0x2dcfc8(_0x5d5e8d[_0xfef3('0x19')](0x1f4,_0x6ca9eb[_0xfef3('0x1b')]));});});};exports['UnpauseUser']=function(_0x3a88d3){var _0x2bcfe7=this;return new Promise(function(_0xe57518,_0x2e0b83){var _0x3058cd;return db[_0xfef3('0x1f')][_0xfef3('0x40')]({'where':_0x3a88d3['options'][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c')]})[_0xfef3('0x12')](function(_0x4534af){if(_0x4534af){_0x3058cd=_0x4534af;if(_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')]&&!utils['isValidChannel'](_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')])){throw new Error(_0xfef3('0x42'));}switch(_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')]){case'voice':return db['UserVoiceQueueRt'][_0xfef3('0x3f')]({'paused':0x0},{'where':{'UserId':_0x3058cd['id']}})[_0xfef3('0x12')](function(){return db[_0xfef3('0x30')][_0xfef3('0x29')]({'where':{'channel':_0x3a88d3[_0xfef3('0x3a')][_0xfef3('0x41')],'membername':_0x3058cd[_0xfef3('0x2c')],'type':'PAUSE','exitAt':null}});})[_0xfef3('0x12')](function(_0x313045){if(_0x313045){return _0x313045['update']({'exitAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfef3('0x43')},{'individualHooks':!![]});}return null;})[_0xfef3('0x12')](function(){return _0x3058cd['update']({'voicePause':![]});});case _0xfef3('0x44'):case _0xfef3('0x45'):case'fax':case _0xfef3('0x46'):case'openchannel':case'whatsapp':return db[_0xfef3('0x30')]['find']({'where':{'channel':_0x3a88d3[_0xfef3('0x3a')]['channel'],'membername':_0x3058cd[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}})[_0xfef3('0x12')](function(_0x6fc42a){return _0x6fc42a[_0xfef3('0x3f')]({'exitAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'data2':_0xfef3('0x43')},{'individualHooks':!![]});})[_0xfef3('0x12')](function(){var _0x354b5d={};_[_0xfef3('0x47')](_0x354b5d,util[_0xfef3('0x33')]('%s%s',_0x3a88d3['body']['channel'],_0xfef3('0x48')),![]);return _0x3058cd[_0xfef3('0x3f')](_0x354b5d);});default:return db[_0xfef3('0x2f')][_0xfef3('0x3f')]({'paused':0x0},{'where':{'UserId':_0x3058cd['id']}})['then'](function(){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0x3058cd[_0xfef3('0x2c')],'type':_0xfef3('0x31'),'exitAt':null}});})[_0xfef3('0x12')](function(_0x27d0dd){var _0x25f11b=[];_0x27d0dd['forEach'](function(_0x1ba712){_0x25f11b[_0xfef3('0x38')](_0x1ba712[_0xfef3('0x3f')]({'exitAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xfef3('0x43')}));});return BPromise[_0xfef3('0x49')](_0x25f11b);})['then'](function(){return _0x3058cd[_0xfef3('0x3f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xfef3('0x12')](function(_0x1cd8ca){_0xe57518(_0x1cd8ca);})[_0xfef3('0x1d')](function(_0x58f56e){_0x2e0b83(_0x2bcfe7['error'](0x1f4,_0x58f56e[_0xfef3('0x1b')]));});});};exports[_0xfef3('0x4a')]=function(_0x2040e){var _0x30a732=this;return new Promise(function(_0xa6a59f,_0xf3c26a){var _0x273514;return db[_0xfef3('0x1f')]['findOne']({'where':_0x2040e[_0xfef3('0x21')][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c')]})[_0xfef3('0x12')](function(_0x3738b7){if(_0x3738b7){_0x273514=_0x3738b7;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x273514[_0xfef3('0x2c')]},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0x273514){return db[_0xfef3('0x30')]['findAll']({'where':{'membername':_0x273514[_0xfef3('0x2c')],'exitAt':null}});}})['then'](function(_0x3d5659){if(_0x273514){if(_0x3d5659&&_0x3d5659[_0xfef3('0x32')]){var _0x42e36b=[];_0x3d5659[_0xfef3('0x37')](function(_0x2a33cd){_0x42e36b[_0xfef3('0x38')](_0x2a33cd['update']({'exitAt':moment()[_0xfef3('0x33')](_0xfef3('0x34'))}));});return BPromise[_0xfef3('0x49')](_0x42e36b);}}})['then'](function(){if(_0x273514){return _0x273514[_0xfef3('0x3f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xfef3('0x12')](function(_0x369b53){_0xa6a59f(_0x369b53);})[_0xfef3('0x1d')](function(_0x9da0ed){_0xf3c26a(_0x30a732['error'](0x1f4,_0x9da0ed[_0xfef3('0x1b')]));});});};exports['LoginUser']=function(_0xbaca21){var _0x33985d=this;return new Promise(function(_0x5479df,_0x22a933){var _0xccc4e9;var _0x27a23f;var _0x3b6ea4;var _0x57fdf6;return db[_0xfef3('0x1f')]['findOne']({'where':_0xbaca21[_0xfef3('0x21')][_0xfef3('0x2a')]||{},'attributes':['id',_0xfef3('0x2c'),'role','mobile','phone','internal','loginInPause','interface']})[_0xfef3('0x12')](function(_0x350d4c){if(_0x350d4c){_0xccc4e9=_0x350d4c;_0x57fdf6=_0xbaca21[_0xfef3('0x3a')]['interface']?_0xbaca21[_0xfef3('0x3a')][_0xfef3('0x2e')]:util[_0xfef3('0x33')]('SIP/%s',_0xccc4e9['name']);return db[_0xfef3('0x1f')][_0xfef3('0x4b')]({'where':{'role':_0xfef3('0x4c'),'online':!![],'id':{'$ne':_0xccc4e9['id']}}});}})['then'](function(_0x526bc6){if(_0x526bc6){_0x3b6ea4=_0x526bc6;return require(_0xfef3('0x4d'))['getLicense']();}})[_0xfef3('0x12')](function(_0x586d31){if(_0x586d31&&_0x586d31[_0xfef3('0x4e')]&&_0x3b6ea4>=_0x586d31[_0xfef3('0x4e')]){throw new Error(_0xfef3('0x4f'));}})[_0xfef3('0x12')](function(){if(_0xccc4e9){return db['UserVoiceQueueRt'][_0xfef3('0x50')]({'where':{'membername':_0xccc4e9['name']},'individualHooks':!![]});}})[_0xfef3('0x12')](function(){if(_0xccc4e9){return _0xccc4e9['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x436e43){if(_0xccc4e9){if(_0x436e43){var _0x7c5bf4=[];_0x27a23f=_0x436e43;if(_0x27a23f[_0xfef3('0x32')]){for(var _0x20755f=0x0;_0x20755f<_0x27a23f['length'];_0x20755f++){_0x7c5bf4[_0xfef3('0x38')](db[_0xfef3('0x2f')][_0xfef3('0x51')]({'membername':_0xccc4e9[_0xfef3('0x2c')],'UserId':_0xccc4e9['id'],'queue_name':_0x27a23f[_0x20755f][_0xfef3('0x2c')],'VoiceQueueId':_0x27a23f[_0x20755f]['id'],'interface':_0x57fdf6,'paused':_0xccc4e9[_0xfef3('0x52')]||![],'penalty':_0x27a23f[_0x20755f][_0xfef3('0x53')]||0x0}));}return BPromise[_0xfef3('0x49')](_0x7c5bf4);}}}})['then'](function(){if(_0xccc4e9){return db[_0xfef3('0x30')][_0xfef3('0x20')]({'where':{'membername':_0xccc4e9[_0xfef3('0x2c')],'exitAt':null}});}})[_0xfef3('0x12')](function(_0x542be7){if(_0xccc4e9){if(_0x542be7&&_0x542be7[_0xfef3('0x32')]){var _0x3435f7=[];_0x542be7[_0xfef3('0x37')](function(_0x63b533){_0x3435f7[_0xfef3('0x38')](_0x63b533[_0xfef3('0x3f')]({'exitAt':moment()['format'](_0xfef3('0x34'))}));});return BPromise[_0xfef3('0x49')](_0x3435f7);}}})['then'](function(_0x484c15){if(_0xccc4e9){var _0x245318=[];var _0x473381=[];var _0x204f7e=utils[_0xfef3('0x36')]();var _0x2c7471={'membername':_0xccc4e9['name'],'interface':_0x57fdf6,'enterAt':moment()[_0xfef3('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xccc4e9[_0xfef3('0x54')],'internal':_0xccc4e9[_0xfef3('0x2d')]};_0x204f7e[_0xfef3('0x37')](function(_0x2e9e41){_0x245318[_0xfef3('0x38')](_['merge']({'channel':_0x2e9e41,'type':_0xfef3('0x55'),'data1':_0xfef3('0x56'),'data2':_0x57fdf6},_0x2c7471));if(_0xccc4e9[_0xfef3('0x52')]){_0x473381['push'](_[_0xfef3('0x57')]({'channel':_0x2e9e41,'type':'PAUSE','data1':_0xfef3('0x58')},_0x2c7471));}});return db[_0xfef3('0x30')][_0xfef3('0x3e')](_0x245318[_0xfef3('0x59')](_0x473381),{'individualHooks':!![]});}})['then'](function(){if(_0xccc4e9){return _0xccc4e9[_0xfef3('0x3f')]({'online':!![],'lastLoginAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'voicePause':_0xccc4e9[_0xfef3('0x52')]||![],'mailPause':_0xccc4e9[_0xfef3('0x52')]||![],'chatPause':_0xccc4e9[_0xfef3('0x52')]||![],'faxPause':_0xccc4e9[_0xfef3('0x52')]||![],'smsPause':_0xccc4e9[_0xfef3('0x52')]||![],'openchannelPause':_0xccc4e9[_0xfef3('0x52')]||![],'pauseType':_0xccc4e9[_0xfef3('0x52')]?_0xfef3('0x58'):null,'lastPauseAt':moment()[_0xfef3('0x33')](_0xfef3('0x34')),'interface':_0x57fdf6});}})[_0xfef3('0x12')](function(_0x3e5c05){_0x5479df(_0x3e5c05);})[_0xfef3('0x1d')](function(_0xb79a87){_0x22a933(_0x33985d[_0xfef3('0x19')](0x1f4,_0xb79a87[_0xfef3('0x1b')]));});});};
\ No newline at end of file
+var _0x5514=['phone','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','LOGIN','callysquare','merge','concat','LOGININPAUSE','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','findAll','options','raw','where','map','model','attributes','include','User','find','ShowUser','PauseUser','name','role','internal','UserVoiceQueueRt','update','MemberReport','PAUSE','format','length','getChannels','forEach','push','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','findOne','channel','isValidChannel','Unknown\x20channel','voice','fax','openchannel','whatsapp','system','set','%s%s','all','LogoutUser','destroy','mobile'];(function(_0x2fc95e,_0x14e242){var _0x41e567=function(_0x200e08){while(--_0x200e08){_0x2fc95e['push'](_0x2fc95e['shift']());}};_0x41e567(++_0x14e242);}(_0x5514,0x6b));var _0x4551=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x5514[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0x4551('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4551('0x1'));var rs=require(_0x4551('0x2'));var fs=require('fs');var Redis=require(_0x4551('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4551('0x4'));var logger=require(_0x4551('0x5'))('rpc');var config=require(_0x4551('0x6'));var jayson=require(_0x4551('0x7'));var client=jayson[_0x4551('0x8')][_0x4551('0x9')]({'port':0x232a});config['redis']=_[_0x4551('0xa')](config[_0x4551('0xb')],{'host':_0x4551('0xc'),'port':0x18eb});var socket=require(_0x4551('0xd'))(new Redis(config[_0x4551('0xb')]));require('./user.socket')[_0x4551('0xe')](socket);function respondWithRpcPromise(_0x3428bd,_0x3508c5,_0x3d9f65){return new BPromise(function(_0x568664,_0x1c1b0c){return client[_0x4551('0xf')](_0x3428bd,_0x3d9f65)[_0x4551('0x10')](function(_0xbdf24f){logger[_0x4551('0x11')](_0x4551('0x12'),_0x3508c5,_0x4551('0x13'));logger[_0x4551('0x14')](_0x4551('0x15'),_0x3508c5,'request\x20sent',JSON['stringify'](_0xbdf24f));if(_0xbdf24f[_0x4551('0x16')]){if(_0xbdf24f['error'][_0x4551('0x17')]===0x1f4){logger[_0x4551('0x16')](_0x4551('0x12'),_0x3508c5,_0xbdf24f[_0x4551('0x16')][_0x4551('0x18')]);return _0x1c1b0c(_0xbdf24f['error'][_0x4551('0x18')]);}logger[_0x4551('0x16')](_0x4551('0x12'),_0x3508c5,_0xbdf24f[_0x4551('0x16')][_0x4551('0x18')]);return _0x568664(_0xbdf24f[_0x4551('0x16')][_0x4551('0x18')]);}else{logger['info'](_0x4551('0x12'),_0x3508c5,_0x4551('0x13'));_0x568664(_0xbdf24f[_0x4551('0x19')][_0x4551('0x18')]);}})[_0x4551('0x1a')](function(_0x5ee36c){logger[_0x4551('0x16')](_0x4551('0x12'),_0x3508c5,_0x5ee36c);_0x1c1b0c(_0x5ee36c);});});}exports[_0x4551('0x1b')]=function(_0x11f87c){var _0x24d598=this;return new Promise(function(_0x2d4a01,_0x42f6c3){return db['User'][_0x4551('0x1c')]({'raw':_0x11f87c[_0x4551('0x1d')]?_0x11f87c[_0x4551('0x1d')][_0x4551('0x1e')]===undefined?!![]:![]:!![],'where':_0x11f87c[_0x4551('0x1d')]?_0x11f87c[_0x4551('0x1d')][_0x4551('0x1f')]||null:null,'attributes':_0x11f87c[_0x4551('0x1d')]?_0x11f87c[_0x4551('0x1d')]['attributes']||null:null,'limit':_0x11f87c['options']?_0x11f87c[_0x4551('0x1d')]['limit']||null:null,'include':_0x11f87c[_0x4551('0x1d')]?_0x11f87c[_0x4551('0x1d')]['include']?_[_0x4551('0x20')](_0x11f87c[_0x4551('0x1d')]['include'],function(_0x3ca1e5){return{'model':db[_0x3ca1e5[_0x4551('0x21')]],'as':_0x3ca1e5['as'],'attributes':_0x3ca1e5[_0x4551('0x22')],'include':_0x3ca1e5[_0x4551('0x23')]?_[_0x4551('0x20')](_0x3ca1e5[_0x4551('0x23')],function(_0x3d0f65){return{'model':db[_0x3d0f65[_0x4551('0x21')]],'as':_0x3d0f65['as'],'attributes':_0x3d0f65[_0x4551('0x22')],'include':_0x3d0f65[_0x4551('0x23')]?_[_0x4551('0x20')](_0x3d0f65[_0x4551('0x23')],function(_0x49df55){return{'model':db[_0x49df55['model']],'as':_0x49df55['as'],'attributes':_0x49df55[_0x4551('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e201a){logger[_0x4551('0x11')](_0x4551('0x1b'),_0x11f87c);logger['debug']('GetUser',_0x11f87c,JSON['stringify'](_0x4e201a));_0x2d4a01(_0x4e201a);})[_0x4551('0x1a')](function(_0x5f4143){logger['error']('GetUser',_0x5f4143[_0x4551('0x18')],_0x11f87c);_0x42f6c3(_0x24d598['error'](0x1f4,_0x5f4143[_0x4551('0x18')]));});});};exports['ShowUser']=function(_0x46dd40){var _0xfa1d86=this;return new Promise(function(_0x1727be,_0x3d10c3){return db[_0x4551('0x24')][_0x4551('0x25')]({'raw':_0x46dd40['options']?_0x46dd40[_0x4551('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x46dd40[_0x4551('0x1d')]?_0x46dd40['options'][_0x4551('0x1f')]||null:null,'attributes':_0x46dd40[_0x4551('0x1d')]?_0x46dd40['options']['attributes']||null:null,'include':_0x46dd40[_0x4551('0x1d')]?_0x46dd40[_0x4551('0x1d')][_0x4551('0x23')]?_[_0x4551('0x20')](_0x46dd40['options'][_0x4551('0x23')],function(_0x6e1c9e){return{'model':db[_0x6e1c9e[_0x4551('0x21')]],'as':_0x6e1c9e['as'],'attributes':_0x6e1c9e[_0x4551('0x22')],'include':_0x6e1c9e[_0x4551('0x23')]?_[_0x4551('0x20')](_0x6e1c9e[_0x4551('0x23')],function(_0x4ec7aa){return{'model':db[_0x4ec7aa[_0x4551('0x21')]],'as':_0x4ec7aa['as'],'attributes':_0x4ec7aa[_0x4551('0x22')],'include':_0x4ec7aa[_0x4551('0x23')]?_['map'](_0x4ec7aa[_0x4551('0x23')],function(_0x5ac593){return{'model':db[_0x5ac593[_0x4551('0x21')]],'as':_0x5ac593['as'],'attributes':_0x5ac593['attributes']};}):[]};}):[]};}):[]:[]})[_0x4551('0x10')](function(_0x4252c1){logger[_0x4551('0x11')](_0x4551('0x26'),_0x46dd40);logger[_0x4551('0x14')]('ShowUser',_0x46dd40,JSON['stringify'](_0x4252c1));_0x1727be(_0x4252c1);})['catch'](function(_0x27667d){logger[_0x4551('0x16')](_0x4551('0x26'),_0x27667d[_0x4551('0x18')],_0x46dd40);_0x3d10c3(_0xfa1d86[_0x4551('0x16')](0x1f4,_0x27667d['message']));});});};exports[_0x4551('0x27')]=function(_0xf04d0d){var _0x18f9e8=this;return new Promise(function(_0x3a00b8,_0x36ca29){var _0x339eba;return db['User'][_0x4551('0x25')]({'where':_0xf04d0d['options'][_0x4551('0x1f')]||{},'attributes':['id',_0x4551('0x28'),_0x4551('0x29'),_0x4551('0x2a'),'interface']})[_0x4551('0x10')](function(_0x5ecd59){if(_0x5ecd59){_0x339eba=_0x5ecd59;return db[_0x4551('0x2b')][_0x4551('0x2c')]({'paused':0x1},{'where':{'UserId':_0x339eba['id']},'individualHooks':!![]});}})['then'](function(){if(_0x339eba){return db[_0x4551('0x2d')][_0x4551('0x1c')]({'where':{'membername':_0x339eba[_0x4551('0x28')],'type':_0x4551('0x2e'),'exitAt':null}});}})[_0x4551('0x10')](function(_0xcc4ba5){if(_0x339eba){if(_0xcc4ba5&&_0xcc4ba5['length']){var _0x4eaa45=moment()[_0x4551('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1f37af=0x0,_0x239039=_0xcc4ba5[_0x4551('0x30')];_0x1f37af<_0x239039;_0x1f37af++){_0xcc4ba5[_0x1f37af]['updateAttributes']({'exitAt':_0x4eaa45});}}}})[_0x4551('0x10')](function(){if(_0x339eba){var _0x516128=[];var _0x539f23=utils[_0x4551('0x31')]();_0x539f23[_0x4551('0x32')](function(_0x424aac){_0x516128[_0x4551('0x33')]({'channel':_0x424aac,'membername':_0x339eba[_0x4551('0x28')],'interface':_['isNil'](_0x339eba[_0x4551('0x34')])?util[_0x4551('0x2f')](_0x4551('0x35'),_0x339eba[_0x4551('0x28')]):_0x339eba[_0x4551('0x34')],'type':'PAUSE','enterAt':moment()['format'](_0x4551('0x36')),'data1':_0xf04d0d[_0x4551('0x37')][_0x4551('0x38')]||_0x4551('0x39'),'role':_0x339eba[_0x4551('0x29')],'internal':_0x339eba['internal'],'uniqueid':_0xf04d0d['body'][_0x4551('0x3a')]||null});});return db['MemberReport'][_0x4551('0x3b')](_0x516128,{'individualHooks':!![]});}})['then'](function(){if(_0x339eba){return _0x339eba['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xf04d0d[_0x4551('0x37')][_0x4551('0x38')]||_0x4551('0x39'),'lastPauseAt':moment()[_0x4551('0x2f')](_0x4551('0x36'))});}})[_0x4551('0x10')](function(_0x1c7526){_0x3a00b8(_0x1c7526);})['catch'](function(_0x143b2d){_0x36ca29(_0x18f9e8[_0x4551('0x16')](0x1f4,_0x143b2d[_0x4551('0x18')]));});});};exports['UnpauseUser']=function(_0x4b554f){var _0x5a3d62=this;return new Promise(function(_0x272592,_0x50c354){var _0x1ac5f5;return db['User'][_0x4551('0x3c')]({'where':_0x4b554f['options'][_0x4551('0x1f')]||{},'attributes':['id',_0x4551('0x28')]})[_0x4551('0x10')](function(_0x1fbc73){if(_0x1fbc73){_0x1ac5f5=_0x1fbc73;if(_0x4b554f[_0x4551('0x37')][_0x4551('0x3d')]&&!utils[_0x4551('0x3e')](_0x4b554f[_0x4551('0x37')][_0x4551('0x3d')])){throw new Error(_0x4551('0x3f'));}switch(_0x4b554f[_0x4551('0x37')][_0x4551('0x3d')]){case _0x4551('0x40'):return db[_0x4551('0x2b')][_0x4551('0x2c')]({'paused':0x0},{'where':{'UserId':_0x1ac5f5['id']}})[_0x4551('0x10')](function(){return db[_0x4551('0x2d')]['find']({'where':{'channel':_0x4b554f[_0x4551('0x37')][_0x4551('0x3d')],'membername':_0x1ac5f5[_0x4551('0x28')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x2034d7){if(_0x2034d7){return _0x2034d7[_0x4551('0x2c')]({'exitAt':moment()[_0x4551('0x2f')](_0x4551('0x36')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x4551('0x10')](function(){return _0x1ac5f5[_0x4551('0x2c')]({'voicePause':![]});});case'mail':case'chat':case _0x4551('0x41'):case'sms':case _0x4551('0x42'):case _0x4551('0x43'):return db[_0x4551('0x2d')]['find']({'where':{'channel':_0x4b554f[_0x4551('0x37')]['channel'],'membername':_0x1ac5f5['name'],'type':_0x4551('0x2e'),'exitAt':null}})['then'](function(_0x20727b){return _0x20727b['update']({'exitAt':moment()[_0x4551('0x2f')](_0x4551('0x36')),'data2':_0x4551('0x44')},{'individualHooks':!![]});})[_0x4551('0x10')](function(){var _0x4f8f01={};_[_0x4551('0x45')](_0x4f8f01,util[_0x4551('0x2f')](_0x4551('0x46'),_0x4b554f[_0x4551('0x37')][_0x4551('0x3d')],'Pause'),![]);return _0x1ac5f5[_0x4551('0x2c')](_0x4f8f01);});default:return db[_0x4551('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x1ac5f5['id']}})['then'](function(){return db[_0x4551('0x2d')][_0x4551('0x1c')]({'where':{'membername':_0x1ac5f5[_0x4551('0x28')],'type':'PAUSE','exitAt':null}});})[_0x4551('0x10')](function(_0x4709e5){var _0x33314a=[];_0x4709e5[_0x4551('0x32')](function(_0x74f2be){_0x33314a[_0x4551('0x33')](_0x74f2be[_0x4551('0x2c')]({'exitAt':moment()[_0x4551('0x2f')](_0x4551('0x36')),'data2':_0x4551('0x44')}));});return BPromise[_0x4551('0x47')](_0x33314a);})['then'](function(){return _0x1ac5f5[_0x4551('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4551('0x10')](function(_0x20a218){_0x272592(_0x20a218);})[_0x4551('0x1a')](function(_0x65e1c7){_0x50c354(_0x5a3d62[_0x4551('0x16')](0x1f4,_0x65e1c7[_0x4551('0x18')]));});});};exports[_0x4551('0x48')]=function(_0x5900e8){var _0xb55b7d=this;return new Promise(function(_0x39919b,_0x514113){var _0xeeeee1;return db[_0x4551('0x24')][_0x4551('0x3c')]({'where':_0x5900e8['options'][_0x4551('0x1f')]||{},'attributes':['id',_0x4551('0x28')]})[_0x4551('0x10')](function(_0x2c6570){if(_0x2c6570){_0xeeeee1=_0x2c6570;return db[_0x4551('0x2b')][_0x4551('0x49')]({'where':{'membername':_0xeeeee1[_0x4551('0x28')]},'individualHooks':!![]});}})[_0x4551('0x10')](function(){if(_0xeeeee1){return db[_0x4551('0x2d')][_0x4551('0x1c')]({'where':{'membername':_0xeeeee1[_0x4551('0x28')],'exitAt':null}});}})[_0x4551('0x10')](function(_0x53627b){if(_0xeeeee1){if(_0x53627b&&_0x53627b[_0x4551('0x30')]){var _0x32c4db=[];_0x53627b['forEach'](function(_0x3967c4){_0x32c4db[_0x4551('0x33')](_0x3967c4[_0x4551('0x2c')]({'exitAt':moment()[_0x4551('0x2f')](_0x4551('0x36'))}));});return BPromise['all'](_0x32c4db);}}})[_0x4551('0x10')](function(){if(_0xeeeee1){return _0xeeeee1[_0x4551('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2ee21c){_0x39919b(_0x2ee21c);})['catch'](function(_0x49f3bb){_0x514113(_0xb55b7d[_0x4551('0x16')](0x1f4,_0x49f3bb[_0x4551('0x18')]));});});};exports['LoginUser']=function(_0x9657aa){var _0x3a252c=this;return new Promise(function(_0xe012b3,_0x12652c){var _0x568b04;var _0x7f11db;var _0x2c0953;var _0x52e14e;return db[_0x4551('0x24')][_0x4551('0x3c')]({'where':_0x9657aa[_0x4551('0x1d')][_0x4551('0x1f')]||{},'attributes':['id','name',_0x4551('0x29'),_0x4551('0x4a'),_0x4551('0x4b'),_0x4551('0x2a'),'loginInPause','interface']})[_0x4551('0x10')](function(_0x9b1496){if(_0x9b1496){_0x568b04=_0x9b1496;_0x52e14e=_0x9657aa[_0x4551('0x37')]['interface']?_0x9657aa[_0x4551('0x37')]['interface']:util[_0x4551('0x2f')](_0x4551('0x35'),_0x568b04['name']);return db['User'][_0x4551('0x4c')]({'where':{'role':_0x4551('0x4d'),'online':!![],'id':{'$ne':_0x568b04['id']}}});}})[_0x4551('0x10')](function(_0x29b6b0){if(_0x29b6b0){_0x2c0953=_0x29b6b0;return require(_0x4551('0x4e'))[_0x4551('0x4f')]();}})[_0x4551('0x10')](function(_0x2d10a5){if(_0x2d10a5&&_0x2d10a5[_0x4551('0x50')]&&_0x2c0953>=_0x2d10a5['agents']){throw new Error(_0x4551('0x51'));}})['then'](function(){if(_0x568b04){return db[_0x4551('0x2b')][_0x4551('0x49')]({'where':{'membername':_0x568b04[_0x4551('0x28')]},'individualHooks':!![]});}})[_0x4551('0x10')](function(){if(_0x568b04){return _0x568b04[_0x4551('0x52')]({'raw':!![]});}})['then'](function(_0x2f34af){if(_0x568b04){if(_0x2f34af){var _0x2aab50=[];_0x7f11db=_0x2f34af;if(_0x7f11db[_0x4551('0x30')]){for(var _0x42049b=0x0;_0x42049b<_0x7f11db[_0x4551('0x30')];_0x42049b++){_0x2aab50[_0x4551('0x33')](db['UserVoiceQueueRt'][_0x4551('0x53')]({'membername':_0x568b04[_0x4551('0x28')],'UserId':_0x568b04['id'],'queue_name':_0x7f11db[_0x42049b][_0x4551('0x28')],'VoiceQueueId':_0x7f11db[_0x42049b]['id'],'interface':_0x52e14e,'paused':_0x568b04[_0x4551('0x54')]||![],'penalty':_0x7f11db[_0x42049b][_0x4551('0x55')]||0x0}));}return BPromise[_0x4551('0x47')](_0x2aab50);}}}})[_0x4551('0x10')](function(){if(_0x568b04){return db[_0x4551('0x2d')]['findAll']({'where':{'membername':_0x568b04[_0x4551('0x28')],'exitAt':null}});}})['then'](function(_0x176475){if(_0x568b04){if(_0x176475&&_0x176475[_0x4551('0x30')]){var _0x104f35=[];_0x176475[_0x4551('0x32')](function(_0x16de73){_0x104f35[_0x4551('0x33')](_0x16de73[_0x4551('0x2c')]({'exitAt':moment()[_0x4551('0x2f')](_0x4551('0x36'))}));});return BPromise['all'](_0x104f35);}}})[_0x4551('0x10')](function(_0x305cbb){if(_0x568b04){var _0x5105ae=[];var _0xa9c672=[];var _0x5e0fd7=utils['getChannels']();var _0x4e4fed={'membername':_0x568b04[_0x4551('0x28')],'interface':_0x52e14e,'enterAt':moment()[_0x4551('0x2f')](_0x4551('0x36')),'role':_0x568b04[_0x4551('0x29')],'internal':_0x568b04[_0x4551('0x2a')]};_0x5e0fd7[_0x4551('0x32')](function(_0x210168){_0x5105ae[_0x4551('0x33')](_['merge']({'channel':_0x210168,'type':_0x4551('0x56'),'data1':_0x4551('0x57'),'data2':_0x52e14e},_0x4e4fed));if(_0x568b04[_0x4551('0x54')]){_0xa9c672[_0x4551('0x33')](_[_0x4551('0x58')]({'channel':_0x210168,'type':_0x4551('0x2e'),'data1':'LOGININPAUSE'},_0x4e4fed));}});return db['MemberReport'][_0x4551('0x3b')](_0x5105ae[_0x4551('0x59')](_0xa9c672),{'individualHooks':!![]});}})[_0x4551('0x10')](function(){if(_0x568b04){return _0x568b04[_0x4551('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x4551('0x2f')](_0x4551('0x36')),'voicePause':_0x568b04[_0x4551('0x54')]||![],'mailPause':_0x568b04['loginInPause']||![],'chatPause':_0x568b04[_0x4551('0x54')]||![],'faxPause':_0x568b04['loginInPause']||![],'smsPause':_0x568b04[_0x4551('0x54')]||![],'openchannelPause':_0x568b04[_0x4551('0x54')]||![],'pauseType':_0x568b04[_0x4551('0x54')]?_0x4551('0x5a'):null,'lastPauseAt':moment()[_0x4551('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x52e14e});}})[_0x4551('0x10')](function(_0xa34b9c){_0xe012b3(_0xa34b9c);})[_0x4551('0x1a')](function(_0x19fdda){_0x12652c(_0x3a252c['error'](0x1f4,_0x19fdda[_0x4551('0x18')]));});});};
\ No newline at end of file
index bcb6d7d..d063ee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac80=['./user.events','save','remove','emit','removeListener','register','length','user:'];(function(_0x2e75ad,_0x444919){var _0x286e1e=function(_0x3736c9){while(--_0x3736c9){_0x2e75ad['push'](_0x2e75ad['shift']());}};_0x286e1e(++_0x444919);}(_0xac80,0xb0));var _0x0ac8=function(_0x1dd4d2,_0x21d8cd){_0x1dd4d2=_0x1dd4d2-0x0;var _0x2e5cb2=_0xac80[_0x1dd4d2];return _0x2e5cb2;};'use strict';var UserEvents=require(_0x0ac8('0x0'));var events=[_0x0ac8('0x1'),_0x0ac8('0x2'),'update'];function createListener(_0x3e692a,_0x1d3876){return function(_0x1d53fb){_0x1d3876[_0x0ac8('0x3')](_0x3e692a,_0x1d53fb);};}function removeListener(_0x2466f5,_0x4f4316){return function(){UserEvents[_0x0ac8('0x4')](_0x2466f5,_0x4f4316);};}exports[_0x0ac8('0x5')]=function(_0x275157){for(var _0x4cfa82=0x0,_0x5e3c93=events[_0x0ac8('0x6')];_0x4cfa82<_0x5e3c93;_0x4cfa82++){var _0x47d513=events[_0x4cfa82];var _0x44af2f=createListener(_0x0ac8('0x7')+_0x47d513,_0x275157);UserEvents['on'](_0x47d513,_0x44af2f);}};
\ No newline at end of file
+var _0x573d=['./user.events','save','remove','update','emit','removeListener','register','length'];(function(_0x468d6a,_0x5dfd7d){var _0x278a69=function(_0x46d4ff){while(--_0x46d4ff){_0x468d6a['push'](_0x468d6a['shift']());}};_0x278a69(++_0x5dfd7d);}(_0x573d,0xa0));var _0xd573=function(_0x562c3a,_0x2d0c71){_0x562c3a=_0x562c3a-0x0;var _0x2c836c=_0x573d[_0x562c3a];return _0x2c836c;};'use strict';var UserEvents=require(_0xd573('0x0'));var events=[_0xd573('0x1'),_0xd573('0x2'),_0xd573('0x3')];function createListener(_0x552379,_0x1114e7){return function(_0x237025){_0x1114e7[_0xd573('0x4')](_0x552379,_0x237025);};}function removeListener(_0x34ddd5,_0x4c441f){return function(){UserEvents[_0xd573('0x5')](_0x34ddd5,_0x4c441f);};}exports[_0xd573('0x6')]=function(_0x208981){for(var _0x24e5f2=0x0,_0x3c4eff=events[_0xd573('0x7')];_0x24e5f2<_0x3c4eff;_0x24e5f2++){var _0x59f616=events[_0x24e5f2];var _0x24acac=createListener('user:'+_0x59f616,_0x208981);UserEvents['on'](_0x59f616,_0x24acac);}};
\ No newline at end of file
index fd2ad0a..567cc9b 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(_0x2294c7,_0x42d02e){var _0x3eafde=function(_0x29899a){while(--_0x29899a){_0x2294c7['push'](_0x2294c7['shift']());}};_0x3eafde(++_0x42d02e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xcb91[_0x2bf466];return _0x856885;};'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(_0x4dac30,_0x3b1e61){var _0x4ae741=function(_0x1a22c3){while(--_0x1a22c3){_0x4dac30['push'](_0x4dac30['shift']());}};_0x4ae741(++_0x3b1e61);}(_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 41b6457..3ffb142 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e61=['sequelize'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x3e61,0x1ef));var _0x13e6=function(_0xda574f,_0x33fae5){_0xda574f=_0xda574f-0x0;var _0x1a4318=_0x3e61[_0xda574f];return _0x1a4318;};'use strict';var Sequelize=require(_0x13e6('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x057f=['INTEGER','exports'];(function(_0x2439be,_0x38ac12){var _0x292242=function(_0x42a83a){while(--_0x42a83a){_0x2439be['push'](_0x2439be['shift']());}};_0x292242(++_0x38ac12);}(_0x057f,0x85));var _0xf057=function(_0x35488a,_0x4abc74){_0x35488a=_0x35488a-0x0;var _0x1bdf06=_0x057f[_0x35488a];return _0x1bdf06;};'use strict';var Sequelize=require('sequelize');module[_0xf057('0x0')]={'penalty':{'type':Sequelize[_0xf057('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 5f1b234..6a3e950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8f2=['../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x524ee5,_0x27b177){var _0x599b9c=function(_0x40551a){while(--_0x40551a){_0x524ee5['push'](_0x524ee5['shift']());}};_0x599b9c(++_0x27b177);}(_0xa8f2,0x102));var _0x2a8f=function(_0x546965,_0x10df53){_0x546965=_0x546965-0x0;var _0x388515=_0xa8f2[_0x546965];return _0x388515;};'use strict';var _=require(_0x2a8f('0x0'));var util=require(_0x2a8f('0x1'));var logger=require(_0x2a8f('0x2'))(_0x2a8f('0x3'));var moment=require(_0x2a8f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2a8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2a8f('0x6'));var attributes=require(_0x2a8f('0x7'));module[_0x2a8f('0x8')]=function(_0x14f84f,_0x4a2435){return _0x14f84f[_0x2a8f('0x9')]('UserChatQueue',attributes,{'tableName':_0x2a8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1de=['../../config/environment','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x156fd7,_0x2e4fd7){var _0x23085e=function(_0x177930){while(--_0x177930){_0x156fd7['push'](_0x156fd7['shift']());}};_0x23085e(++_0x2e4fd7);}(_0xa1de,0x1ed));var _0xea1d=function(_0x3a7298,_0x255ab5){_0x3a7298=_0x3a7298-0x0;var _0x1a6b31=_0xa1de[_0x3a7298];return _0x1a6b31;};'use strict';var _=require(_0xea1d('0x0'));var util=require(_0xea1d('0x1'));var logger=require('../../config/logger')(_0xea1d('0x2'));var moment=require(_0xea1d('0x3'));var BPromise=require(_0xea1d('0x4'));var rp=require(_0xea1d('0x5'));var fs=require('fs');var path=require(_0xea1d('0x6'));var rimraf=require('rimraf');var config=require(_0xea1d('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x1e71ab,_0x3cf26e){return _0x1e71ab['define'](_0xea1d('0x8'),attributes,{'tableName':_0xea1d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 820c1c6..c894c67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8115=['UserChatQueue,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8115,0xf6));var _0x5811=function(_0x17b4c0,_0xa80ae){_0x17b4c0=_0x17b4c0-0x0;var _0x49efb9=_0x8115[_0x17b4c0];return _0x49efb9;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require(_0x5811('0x2'));var BPromise=require(_0x5811('0x3'));var rs=require(_0x5811('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x5'))['db'];var utils=require(_0x5811('0x6'));var logger=require(_0x5811('0x7'))(_0x5811('0x8'));var config=require(_0x5811('0x9'));var jayson=require(_0x5811('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3af853,_0x1af6d9,_0x567434){return new BPromise(function(_0x3b6da1,_0x216d1b){return client[_0x5811('0xb')](_0x3af853,_0x567434)[_0x5811('0xc')](function(_0x9b60db){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x1af6d9,_0x5811('0xd'));logger[_0x5811('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x1af6d9,_0x5811('0xd'),JSON[_0x5811('0xf')](_0x9b60db));if(_0x9b60db[_0x5811('0x10')]){if(_0x9b60db[_0x5811('0x10')][_0x5811('0x11')]===0x1f4){logger[_0x5811('0x10')](_0x5811('0x12'),_0x1af6d9,_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);return _0x216d1b(_0x9b60db['error'][_0x5811('0x13')]);}logger['error'](_0x5811('0x12'),_0x1af6d9,_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);return _0x3b6da1(_0x9b60db[_0x5811('0x10')][_0x5811('0x13')]);}else{logger[_0x5811('0x14')](_0x5811('0x12'),_0x1af6d9,'request\x20sent');_0x3b6da1(_0x9b60db[_0x5811('0x15')]['message']);}})['catch'](function(_0x181478){logger[_0x5811('0x10')](_0x5811('0x12'),_0x1af6d9,_0x181478);_0x216d1b(_0x181478);});});}
\ No newline at end of file
+var _0x87c0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x87c0,0xe1));var _0x087c=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x87c0[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require(_0x087c('0x0'));var moment=require(_0x087c('0x1'));var BPromise=require(_0x087c('0x2'));var rs=require(_0x087c('0x3'));var fs=require('fs');var Redis=require(_0x087c('0x4'));var db=require(_0x087c('0x5'))['db'];var utils=require(_0x087c('0x6'));var logger=require(_0x087c('0x7'))(_0x087c('0x8'));var config=require(_0x087c('0x9'));var jayson=require(_0x087c('0xa'));var client=jayson[_0x087c('0xb')][_0x087c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16f73d,_0x31ffe0,_0x482789){return new BPromise(function(_0x5a5a6f,_0x4d8925){return client[_0x087c('0xd')](_0x16f73d,_0x482789)['then'](function(_0x346b43){logger[_0x087c('0xe')](_0x087c('0xf'),_0x31ffe0,'request\x20sent');logger['debug'](_0x087c('0x10'),_0x31ffe0,'request\x20sent',JSON[_0x087c('0x11')](_0x346b43));if(_0x346b43[_0x087c('0x12')]){if(_0x346b43[_0x087c('0x12')][_0x087c('0x13')]===0x1f4){logger[_0x087c('0x12')](_0x087c('0xf'),_0x31ffe0,_0x346b43['error'][_0x087c('0x14')]);return _0x4d8925(_0x346b43[_0x087c('0x12')][_0x087c('0x14')]);}logger[_0x087c('0x12')](_0x087c('0xf'),_0x31ffe0,_0x346b43[_0x087c('0x12')][_0x087c('0x14')]);return _0x5a5a6f(_0x346b43['error'][_0x087c('0x14')]);}else{logger[_0x087c('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x31ffe0,_0x087c('0x15'));_0x5a5a6f(_0x346b43[_0x087c('0x16')][_0x087c('0x14')]);}})['catch'](function(_0x1173c2){logger[_0x087c('0x12')](_0x087c('0xf'),_0x31ffe0,_0x1173c2);_0x4d8925(_0x1173c2);});});}
\ No newline at end of file
index 6622289..87bb290 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(_0x50ee83,_0x106751){var _0x3099ea=function(_0x1d38a4){while(--_0x1d38a4){_0x50ee83['push'](_0x50ee83['shift']());}};_0x3099ea(++_0x106751);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'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(_0x524c41,_0x561698){var _0x60a804=function(_0x52b2dd){while(--_0x52b2dd){_0x524c41['push'](_0x524c41['shift']());}};_0x60a804(++_0x561698);}(_0xe706,0xa3));var _0x6e70=function(_0x2deed4,_0x2793e8){_0x2deed4=_0x2deed4-0x0;var _0xfb91f4=_0xe706[_0x2deed4];return _0xfb91f4;};'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 577c0b4..a0ffa08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf084=['STRING','exports','INTEGER'];(function(_0x15ab85,_0x3e15df){var _0x39c07a=function(_0x2a599b){while(--_0x2a599b){_0x15ab85['push'](_0x15ab85['shift']());}};_0x39c07a(++_0x3e15df);}(_0xf084,0xe2));var _0x4f08=function(_0x291262,_0x366104){_0x291262=_0x291262-0x0;var _0x9a5178=_0xf084[_0x291262];return _0x9a5178;};'use strict';var Sequelize=require('sequelize');module[_0x4f08('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4f08('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x4f08('0x2')]}};
\ No newline at end of file
+var _0x5b05=['INTEGER','STRING','sequelize','exports'];(function(_0x19f00f,_0x181deb){var _0x332a97=function(_0x21d60e){while(--_0x21d60e){_0x19f00f['push'](_0x19f00f['shift']());}};_0x332a97(++_0x181deb);}(_0x5b05,0x11a));var _0x55b0=function(_0x3780b2,_0xa8007d){_0x3780b2=_0x3780b2-0x0;var _0x29c7c3=_0x5b05[_0x3780b2];return _0x29c7c3;};'use strict';var Sequelize=require(_0x55b0('0x0'));module[_0x55b0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x55b0('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x55b0('0x3')]}};
\ No newline at end of file
index e495f82..32d28be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2115=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','lodash'];(function(_0x428b2c,_0x5616a9){var _0x209877=function(_0x12ea82){while(--_0x12ea82){_0x428b2c['push'](_0x428b2c['shift']());}};_0x209877(++_0x5616a9);}(_0x2115,0x19f));var _0x5211=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x2115[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0x5211('0x0'));var util=require(_0x5211('0x1'));var logger=require(_0x5211('0x2'))(_0x5211('0x3'));var moment=require(_0x5211('0x4'));var BPromise=require(_0x5211('0x5'));var rp=require(_0x5211('0x6'));var fs=require('fs');var path=require(_0x5211('0x7'));var rimraf=require(_0x5211('0x8'));var config=require(_0x5211('0x9'));var attributes=require(_0x5211('0xa'));module[_0x5211('0xb')]=function(_0x2f8123,_0x295083){return _0x2f8123[_0x5211('0xc')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5599=['./userFaxQueue.attributes','define','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x3e921b,_0x26adc7){var _0x16cfbf=function(_0x627f2e){while(--_0x627f2e){_0x3e921b['push'](_0x3e921b['shift']());}};_0x16cfbf(++_0x26adc7);}(_0x5599,0xd2));var _0x9559=function(_0xe63537,_0x13603f){_0xe63537=_0xe63537-0x0;var _0x51e94e=_0x5599[_0xe63537];return _0x51e94e;};'use strict';var _=require('lodash');var util=require(_0x9559('0x0'));var logger=require(_0x9559('0x1'))(_0x9559('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9559('0x3'));var fs=require('fs');var path=require(_0x9559('0x4'));var rimraf=require('rimraf');var config=require(_0x9559('0x5'));var attributes=require(_0x9559('0x6'));module['exports']=function(_0x5cca42,_0x2547e8){return _0x5cca42[_0x9559('0x7')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0686bf..0463ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf382=['request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xb23ad5,_0x389a3c){var _0x3a9ce2=function(_0x4da668){while(--_0x4da668){_0xb23ad5['push'](_0xb23ad5['shift']());}};_0x3a9ce2(++_0x389a3c);}(_0xf382,0x16d));var _0x2f38=function(_0x252b17,_0x1fbd1d){_0x252b17=_0x252b17-0x0;var _0x4f5a2c=_0xf382[_0x252b17];return _0x4f5a2c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f38('0x0'));var BPromise=require(_0x2f38('0x1'));var rs=require(_0x2f38('0x2'));var fs=require('fs');var Redis=require(_0x2f38('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f38('0x4'));var logger=require('../../config/logger')(_0x2f38('0x5'));var config=require(_0x2f38('0x6'));var jayson=require(_0x2f38('0x7'));var client=jayson[_0x2f38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x320317,_0x28dc08,_0x1d9c14){return new BPromise(function(_0x52b9a5,_0x1d3f7b){return client[_0x2f38('0x9')](_0x320317,_0x1d9c14)[_0x2f38('0xa')](function(_0xb49e2a){logger[_0x2f38('0xb')](_0x2f38('0xc'),_0x28dc08,_0x2f38('0xd'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x28dc08,_0x2f38('0xd'),JSON[_0x2f38('0xe')](_0xb49e2a));if(_0xb49e2a['error']){if(_0xb49e2a['error']['code']===0x1f4){logger[_0x2f38('0xf')](_0x2f38('0xc'),_0x28dc08,_0xb49e2a[_0x2f38('0xf')][_0x2f38('0x10')]);return _0x1d3f7b(_0xb49e2a['error'][_0x2f38('0x10')]);}logger['error'](_0x2f38('0xc'),_0x28dc08,_0xb49e2a[_0x2f38('0xf')]['message']);return _0x52b9a5(_0xb49e2a[_0x2f38('0xf')][_0x2f38('0x10')]);}else{logger[_0x2f38('0xb')](_0x2f38('0xc'),_0x28dc08,'request\x20sent');_0x52b9a5(_0xb49e2a['result'][_0x2f38('0x10')]);}})['catch'](function(_0x15f209){logger[_0x2f38('0xf')](_0x2f38('0xc'),_0x28dc08,_0x15f209);_0x1d3f7b(_0x15f209);});});}
\ No newline at end of file
+var _0x2f1f=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x199548,_0x120011){var _0x222406=function(_0x5ce94d){while(--_0x5ce94d){_0x199548['push'](_0x199548['shift']());}};_0x222406(++_0x120011);}(_0x2f1f,0x1e3));var _0xf2f1=function(_0x1be9b6,_0x5c462e){_0x1be9b6=_0x1be9b6-0x0;var _0x3fe3a9=_0x2f1f[_0x1be9b6];return _0x3fe3a9;};'use strict';var _=require(_0xf2f1('0x0'));var util=require('util');var moment=require(_0xf2f1('0x1'));var BPromise=require(_0xf2f1('0x2'));var rs=require(_0xf2f1('0x3'));var fs=require('fs');var Redis=require(_0xf2f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2f1('0x5'));var logger=require(_0xf2f1('0x6'))(_0xf2f1('0x7'));var config=require(_0xf2f1('0x8'));var jayson=require(_0xf2f1('0x9'));var client=jayson[_0xf2f1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52d936,_0x14b33b,_0x1a408f){return new BPromise(function(_0x4a6665,_0x3c2a9a){return client['request'](_0x52d936,_0x1a408f)['then'](function(_0x4d006c){logger[_0xf2f1('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x14b33b,_0xf2f1('0xc'));logger['debug'](_0xf2f1('0xd'),_0x14b33b,_0xf2f1('0xc'),JSON[_0xf2f1('0xe')](_0x4d006c));if(_0x4d006c[_0xf2f1('0xf')]){if(_0x4d006c[_0xf2f1('0xf')][_0xf2f1('0x10')]===0x1f4){logger[_0xf2f1('0xf')](_0xf2f1('0x11'),_0x14b33b,_0x4d006c['error'][_0xf2f1('0x12')]);return _0x3c2a9a(_0x4d006c[_0xf2f1('0xf')]['message']);}logger[_0xf2f1('0xf')](_0xf2f1('0x11'),_0x14b33b,_0x4d006c[_0xf2f1('0xf')][_0xf2f1('0x12')]);return _0x4a6665(_0x4d006c['error'][_0xf2f1('0x12')]);}else{logger[_0xf2f1('0xb')](_0xf2f1('0x11'),_0x14b33b,'request\x20sent');_0x4a6665(_0x4d006c[_0xf2f1('0x13')]['message']);}})[_0xf2f1('0x14')](function(_0x288132){logger[_0xf2f1('0xf')](_0xf2f1('0x11'),_0x14b33b,_0x288132);_0x3c2a9a(_0x288132);});});}
\ No newline at end of file
index 78a81a5..852ea7b 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(_0x7ec97e,_0x3886a6){var _0x14c832=function(_0x38ba2e){while(--_0x38ba2e){_0x7ec97e['push'](_0x7ec97e['shift']());}};_0x14c832(++_0x3886a6);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2def93,_0x223296){var _0x349195=function(_0x38abf6){while(--_0x38abf6){_0x2def93['push'](_0x2def93['shift']());}};_0x349195(++_0x223296);}(_0x70e0,0x17b));var _0x070e=function(_0x1d5a2f,_0x4818d4){_0x1d5a2f=_0x1d5a2f-0x0;var _0x272180=_0x70e0[_0x1d5a2f];return _0x272180;};'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 582abcb..b5ad98d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d6=['INTEGER','sequelize'];(function(_0x4109ff,_0x44ab31){var _0x58f82d=function(_0x494b21){while(--_0x494b21){_0x4109ff['push'](_0x4109ff['shift']());}};_0x58f82d(++_0x44ab31);}(_0xd5d6,0xcb));var _0x6d5d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xd5d6[_0x55e08b];return _0xd1a7ff;};'use strict';var Sequelize=require(_0x6d5d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6d5d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x444c=['INTEGER','exports'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x444c,0x93));var _0xc444=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x444c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc444('0x0')]={'penalty':{'type':Sequelize[_0xc444('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 50e76a0..15e6976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51f2=['user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xff95db,_0x3908a9){var _0x19f1c4=function(_0x4d870d){while(--_0x4d870d){_0xff95db['push'](_0xff95db['shift']());}};_0x19f1c4(++_0x3908a9);}(_0x51f2,0xe2));var _0x251f=function(_0xa014e,_0x3d3129){_0xa014e=_0xa014e-0x0;var _0x2ce37d=_0x51f2[_0xa014e];return _0x2ce37d;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var logger=require(_0x251f('0x2'))('api');var moment=require(_0x251f('0x3'));var BPromise=require(_0x251f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x251f('0x5'));var rimraf=require(_0x251f('0x6'));var config=require(_0x251f('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x4c2561,_0x47076c){return _0x4c2561['define']('UserMailQueue',attributes,{'tableName':_0x251f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xadc3=['moment','request-promise','path','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0xadc3,0x10c));var _0x3adc=function(_0x4c2728,_0x363091){_0x4c2728=_0x4c2728-0x0;var _0x5e7c19=_0xadc3[_0x4c2728];return _0x5e7c19;};'use strict';var _=require(_0x3adc('0x0'));var util=require(_0x3adc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3adc('0x2'));var BPromise=require('bluebird');var rp=require(_0x3adc('0x3'));var fs=require('fs');var path=require(_0x3adc('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3adc('0x5'));module[_0x3adc('0x6')]=function(_0x5ae6f1,_0x3b2cf7){return _0x5ae6f1[_0x3adc('0x7')](_0x3adc('0x8'),attributes,{'tableName':_0x3adc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f6eaea3..adadba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x008c,0x188));var _0xc008=function(_0xf458be,_0x1cf158){_0xf458be=_0xf458be-0x0;var _0x52b318=_0x008c[_0xf458be];return _0x52b318;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}
\ No newline at end of file
+var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4710f6,_0x24307b){var _0x352e1c=function(_0x16f83e){while(--_0x16f83e){_0x4710f6['push'](_0x4710f6['shift']());}};_0x352e1c(++_0x24307b);}(_0x6aa7,0x178));var _0x76aa=function(_0x4bb515,_0x3d85ed){_0x4bb515=_0x4bb515-0x0;var _0x13b307=_0x6aa7[_0x4bb515];return _0x13b307;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}
\ No newline at end of file
index c6b3152..21ea171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f23=['connect-timeout','../../config/environment','isAuthenticated','exports','multer','util','path'];(function(_0x37af4b,_0x29b939){var _0x201f57=function(_0x361417){while(--_0x361417){_0x37af4b['push'](_0x37af4b['shift']());}};_0x201f57(++_0x29b939);}(_0x8f23,0x170));var _0x38f2=function(_0x3c5914,_0x3ecd81){_0x3c5914=_0x3c5914-0x0;var _0x48ffae=_0x8f23[_0x3c5914];return _0x48ffae;};'use strict';var multer=require(_0x38f2('0x0'));var util=require(_0x38f2('0x1'));var path=require(_0x38f2('0x2'));var timeout=require(_0x38f2('0x3'));var express=require('express');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(_0x38f2('0x4'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x38f2('0x5')](),controller['sendUserNotification']);module[_0x38f2('0x6')]=router;
\ No newline at end of file
+var _0x92c0=['util','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x92c0,0x104));var _0x092c=function(_0x565b5f,_0x2bd1a9){_0x565b5f=_0x565b5f-0x0;var _0x5e769b=_0x92c0[_0x565b5f];return _0x5e769b;};'use strict';var multer=require(_0x092c('0x0'));var util=require(_0x092c('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(_0x092c('0x2'));var interaction=require(_0x092c('0x3'));var config=require(_0x092c('0x4'));var controller=require(_0x092c('0x5'));router[_0x092c('0x6')]('/',auth['isAuthenticated'](),controller[_0x092c('0x7')]);module[_0x092c('0x8')]=router;
\ No newline at end of file
index 367abae..bc7a89d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ed=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x4987fc,_0x3532df){var _0x34fc6e=function(_0x48932e){while(--_0x48932e){_0x4987fc['push'](_0x4987fc['shift']());}};_0x34fc6e(++_0x3532df);}(_0xd7ed,0x1d1));var _0xdd7e=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xd7ed[_0xe45118];return _0x15e15d;};'use strict';var Sequelize=require(_0xdd7e('0x0'));module[_0xdd7e('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xdd7e('0x2')]},'recipientsId':{'type':Sequelize[_0xdd7e('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xdd7e('0x4')]}};
\ No newline at end of file
+var _0xb6a3=['STRING','BOOLEAN','exports','TEXT'];(function(_0x25d1fc,_0x5292ef){var _0x127a1f=function(_0x5b7fd5){while(--_0x5b7fd5){_0x25d1fc['push'](_0x25d1fc['shift']());}};_0x127a1f(++_0x5292ef);}(_0xb6a3,0x142));var _0x3b6a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xb6a3[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');module[_0x3b6a('0x0')]={'body':{'type':Sequelize[_0x3b6a('0x1')]},'senderName':{'type':Sequelize[_0x3b6a('0x2')]},'recipientsId':{'type':Sequelize[_0x3b6a('0x1')]},'recipientsDescription':{'type':Sequelize[_0x3b6a('0x2')]},'beep':{'type':Sequelize[_0x3b6a('0x3')]}};
\ No newline at end of file
index 7d5c5f7..861edc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe836=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','body','hasOwnProperty','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','recipientsId','join','transaction','UserNotification','forEach','recipient','userNotification:send','catch','text','Template','findOne','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','startCase','model','union','ids','queue','replace','Queue','push','flatten','getAgents','map','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xe836,0x16b));var _0x6e83=function(_0x25ee10,_0x4ac659){_0x25ee10=_0x25ee10-0x0;var _0x4f96be=_0xe836[_0x25ee10];return _0x4f96be;};'use strict';var emlformat=require(_0x6e83('0x0'));var rimraf=require(_0x6e83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6e83('0x2'));var moment=require(_0x6e83('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e83('0x4'));var util=require('util');var path=require(_0x6e83('0x5'));var sox=require(_0x6e83('0x6'));var csv=require(_0x6e83('0x7'));var ejs=require(_0x6e83('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e83('0x9'));var crypto=require(_0x6e83('0xa'));var jsforce=require(_0x6e83('0xb'));var deskjs=require(_0x6e83('0xc'));var toCsv=require(_0x6e83('0x7'));var querystring=require(_0x6e83('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6e83('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6e83('0xf'));var hardwareService=require(_0x6e83('0x10'));var logger=require(_0x6e83('0x11'))(_0x6e83('0x12'));var utils=require('../../config/utils');var config=require(_0x6e83('0x13'));var licenseUtil=require(_0x6e83('0x14'));var db=require(_0x6e83('0x15'))['db'];config[_0x6e83('0x16')]=_[_0x6e83('0x17')](config[_0x6e83('0x16')],{'host':_0x6e83('0x18'),'port':0x18eb});var socket=require(_0x6e83('0x19'))(new Redis(config['redis']));require(_0x6e83('0x1a'))[_0x6e83('0x1b')](socket);function respondWithStatusCode(_0x53d7d8,_0x66e51d){_0x66e51d=_0x66e51d||0xcc;return function(_0x42c52e){if(_0x42c52e){return _0x53d7d8[_0x6e83('0x1c')](_0x66e51d);}return _0x53d7d8[_0x6e83('0x1d')](_0x66e51d)[_0x6e83('0x1e')]();};}function respondWithResult(_0x18b95a,_0x54ce6c){_0x54ce6c=_0x54ce6c||0xc8;return function(_0x871253){if(_0x871253){return _0x18b95a[_0x6e83('0x1d')](_0x54ce6c)[_0x6e83('0x1f')](_0x871253);}};}function respondWithFilteredResult(_0x1e8ca9,_0x39e3f2){return function(_0xa2e7d9){if(_0xa2e7d9){var _0x5b64d1=typeof _0x39e3f2['offset']===_0x6e83('0x20')&&typeof _0x39e3f2[_0x6e83('0x21')]==='undefined';var _0x188319=_0xa2e7d9[_0x6e83('0x22')];var _0x49145e=_0x5b64d1?0x0:_0x39e3f2[_0x6e83('0x23')];var _0x1dd5bf=_0x5b64d1?_0xa2e7d9[_0x6e83('0x22')]:_0x39e3f2[_0x6e83('0x23')]+_0x39e3f2[_0x6e83('0x21')];var _0x10d4d7;if(_0x1dd5bf>=_0x188319){_0x1dd5bf=_0x188319;_0x10d4d7=0xc8;}else{_0x10d4d7=0xce;}_0x1e8ca9['status'](_0x10d4d7);return _0x1e8ca9[_0x6e83('0x24')](_0x6e83('0x25'),_0x49145e+'-'+_0x1dd5bf+'/'+_0x188319)[_0x6e83('0x1f')](_0xa2e7d9);}return null;};}function patchUpdates(_0x27d3f6){return function(_0x2c6770){try{jsonpatch[_0x6e83('0x26')](_0x2c6770,_0x27d3f6,!![]);}catch(_0x9f3dd1){return BPromise['reject'](_0x9f3dd1);}return _0x2c6770[_0x6e83('0x27')]();};}function saveUpdates(_0xfa78cc,_0x2eee11){return function(_0x5bf1aa){if(_0x5bf1aa){return _0x5bf1aa[_0x6e83('0x28')](_0xfa78cc)[_0x6e83('0x29')](function(_0x4155ad){return _0x4155ad;});}return null;};}function removeEntity(_0x4e62ae,_0xf26972){return function(_0xafc2c){if(_0xafc2c){return _0xafc2c[_0x6e83('0x2a')]()['then'](function(){_0x4e62ae[_0x6e83('0x1d')](0xcc)[_0x6e83('0x1e')]();});}};}function handleEntityNotFound(_0x58f16b,_0x4d6023){return function(_0x3ae451){if(!_0x3ae451){_0x58f16b['sendStatus'](0x194);}return _0x3ae451;};}function handleError(_0x489097,_0x1153e8){_0x1153e8=_0x1153e8||0x1f4;return function(_0x419eb9){logger[_0x6e83('0x2b')](_0x419eb9[_0x6e83('0x2c')]);if(_0x419eb9[_0x6e83('0x2d')]){delete _0x419eb9[_0x6e83('0x2d')];}_0x489097[_0x6e83('0x1d')](_0x1153e8)[_0x6e83('0x2e')](_0x419eb9);};}exports['sendUserNotification']=function(_0x459f97,_0x27676e,_0x5f12e8){if(!_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('text')&&!_0x459f97['body'][_0x6e83('0x30')]('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x6e83('0x31'));}else{if(_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('TemplateId')&&!_0x459f97[_0x6e83('0x2f')]['hasOwnProperty']('view')){throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x459f97[_0x6e83('0x2f')][_0x6e83('0x30')]('recipients')){throw new db['Sequelize']['ValidationError'](_0x6e83('0x34'));}else{try{var _0x21a352=JSON[_0x6e83('0x35')](_0x459f97[_0x6e83('0x2f')]['recipients']);}catch(_0x44e96b){logger[_0x6e83('0x2b')](_0x44e96b);throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x5edcd9=['chatqueue',_0x6e83('0x36'),_0x6e83('0x37'),_0x6e83('0x38'),'smsqueue',_0x6e83('0x39'),_0x6e83('0x3a'),_0x6e83('0x3b'),_0x6e83('0x3c')];if(_['some'](_0x21a352,function(_0xf2cb6c){return!_[_0x6e83('0x3d')](_0x5edcd9,_0xf2cb6c['model'][_0x6e83('0x3e')]());})){throw new db[(_0x6e83('0x32'))][(_0x6e83('0x33'))](_0x6e83('0x3f'));}}}var _0x419fb8={};_0x419fb8['senderName']=_0x459f97[_0x6e83('0x2f')]['hasOwnProperty'](_0x6e83('0x40'))?_0x459f97['body'][_0x6e83('0x40')]:_0x459f97['user']['fullname'];_0x419fb8[_0x6e83('0x41')]=_[_0x6e83('0x42')](_0x459f97[_0x6e83('0x2f')][_0x6e83('0x41')])?null:_0x459f97['body'][_0x6e83('0x41')];_0x419fb8[_0x6e83('0x43')]=_0x459f97[_0x6e83('0x2f')][_0x6e83('0x43')]||![];_0x419fb8['SenderId']=_0x459f97[_0x6e83('0x3c')]['id'];return getContent(_0x459f97[_0x6e83('0x2f')])[_0x6e83('0x29')](function(_0x90ba06){_0x419fb8[_0x6e83('0x2f')]=_0x90ba06;return getRecipients(_0x21a352);})[_0x6e83('0x29')](function(_0x3ff1ca){_0x419fb8[_0x6e83('0x44')]=_['sortBy'](_0x3ff1ca)[_0x6e83('0x45')](',');return db['sequelize'][_0x6e83('0x46')](function(_0x242d76){return db[_0x6e83('0x47')]['create'](_0x419fb8,{'raw':!![],'transaction':_0x242d76})[_0x6e83('0x29')](function(_0x5a8ec){var _0x2fa510={'sender':_0x419fb8[_0x6e83('0x40')],'description':_0x419fb8[_0x6e83('0x41')],'content':_0x419fb8[_0x6e83('0x2f')],'beep':_0x419fb8[_0x6e83('0x43')]};_0x3ff1ca[_0x6e83('0x48')](function(_0x146b7b){_0x2fa510[_0x6e83('0x49')]=_0x146b7b;socket['emit'](_0x6e83('0x4a'),_0x2fa510);});return _0x5a8ec;});});})['then'](respondWithResult(_0x27676e,0xc9))[_0x6e83('0x4b')](handleError(_0x27676e,null));};function getContent(_0x1a2294){return new BPromise(function(_0x5c8e0e,_0x3b8573){if(_0x1a2294[_0x6e83('0x4c')]){_0x5c8e0e(_0x1a2294[_0x6e83('0x4c')]);return;}return db[_0x6e83('0x4d')][_0x6e83('0x4e')]({'attributes':[_0x6e83('0x4f')],'where':{'id':_0x1a2294[_0x6e83('0x50')]},'raw':!![]})['then'](function(_0x31affb){if(!_0x31affb)throw new db[(_0x6e83('0x32'))]['ValidationError'](_0x6e83('0x51'));var _0x269f70=Mustache[_0x6e83('0x52')](_0x31affb[_0x6e83('0x4f')],_0x1a2294[_0x6e83('0x53')]);_0x5c8e0e(_0x269f70);})['catch'](function(_0x2fa604){_0x3b8573(_0x2fa604);});});}function getRecipients(_0x360fe3){return new BPromise(function(_0x20144a,_0x400900){var _0x3cc907=[];var _0x4f5ddd=[];_0x360fe3['forEach'](function(_0x12e06c){var _0xfacd66=_[_0x6e83('0x54')](_0x12e06c[_0x6e83('0x55')][_0x6e83('0x3e')]());if(_0xfacd66==='User'){_0x3cc907=_[_0x6e83('0x56')](_0x3cc907,_0x12e06c[_0x6e83('0x57')]);}else{if(_[_0x6e83('0x3d')](_0xfacd66,_0x6e83('0x58')))_0xfacd66=_0xfacd66[_0x6e83('0x59')](_0x6e83('0x58'),_0x6e83('0x5a'));_0x12e06c[_0x6e83('0x57')][_0x6e83('0x48')](function(_0x56ea9b){_0x4f5ddd[_0x6e83('0x5b')](getAgents(_0xfacd66,_0x56ea9b));});}});return BPromise['all'](_0x4f5ddd)['then'](function(_0x5e96c6){_0x3cc907=_['union'](_0x3cc907,_[_0x6e83('0x5c')](_0x5e96c6));_0x20144a(_0x3cc907);})[_0x6e83('0x4b')](function(_0x48343b){_0x400900(_0x48343b);});});}function getAgents(_0x2d43a9,_0x2368cf){return new BPromise(function(_0x57b6d6,_0xb2c692){return db[_0x2d43a9]['findOne']({'where':{'id':_0x2368cf}})[_0x6e83('0x29')](function(_0x36316b){return _0x36316b[_0x6e83('0x5d')]({'attributes':['id'],'raw':!![]})[_0x6e83('0x29')](function(_0x13287b){var _0x3a1ae4=_[_0x6e83('0x5e')](_0x13287b,'id');_0x57b6d6(_0x3a1ae4);});})[_0x6e83('0x4b')](function(_0x2aca11){_0xb2c692(_0x2aca11);});});}
\ No newline at end of file
+var _0x35eb=['all','flatten','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','destroy','then','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','view','ValidationError','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','toLowerCase','User','union','ids','includes','replace','queue','Queue','push'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x35eb,0x136));var _0xb35e=function(_0x2da357,_0x1f9b2f){_0x2da357=_0x2da357-0x0;var _0x138fdd=_0x35eb[_0x2da357];return _0x138fdd;};'use strict';var emlformat=require(_0xb35e('0x0'));var rimraf=require(_0xb35e('0x1'));var zipdir=require(_0xb35e('0x2'));var jsonpatch=require(_0xb35e('0x3'));var rp=require(_0xb35e('0x4'));var moment=require(_0xb35e('0x5'));var BPromise=require(_0xb35e('0x6'));var Mustache=require(_0xb35e('0x7'));var util=require(_0xb35e('0x8'));var path=require('path');var sox=require(_0xb35e('0x9'));var csv=require(_0xb35e('0xa'));var ejs=require(_0xb35e('0xb'));var fs=require('fs');var fs_extra=require(_0xb35e('0xc'));var _=require('lodash');var squel=require(_0xb35e('0xd'));var crypto=require(_0xb35e('0xe'));var jsforce=require(_0xb35e('0xf'));var deskjs=require(_0xb35e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb35e('0x11'));var Papa=require(_0xb35e('0x12'));var Redis=require(_0xb35e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb35e('0x14'));var as=require(_0xb35e('0x15'));var hardwareService=require(_0xb35e('0x16'));var logger=require(_0xb35e('0x17'))(_0xb35e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb35e('0x19'));var db=require(_0xb35e('0x1a'))['db'];config[_0xb35e('0x1b')]=_['defaults'](config['redis'],{'host':_0xb35e('0x1c'),'port':0x18eb});var socket=require(_0xb35e('0x1d'))(new Redis(config[_0xb35e('0x1b')]));require(_0xb35e('0x1e'))[_0xb35e('0x1f')](socket);function respondWithStatusCode(_0x2b072c,_0x116249){_0x116249=_0x116249||0xcc;return function(_0xee4ba9){if(_0xee4ba9){return _0x2b072c[_0xb35e('0x20')](_0x116249);}return _0x2b072c[_0xb35e('0x21')](_0x116249)[_0xb35e('0x22')]();};}function respondWithResult(_0x2ad991,_0x347ff3){_0x347ff3=_0x347ff3||0xc8;return function(_0x10ccb8){if(_0x10ccb8){return _0x2ad991['status'](_0x347ff3)[_0xb35e('0x23')](_0x10ccb8);}};}function respondWithFilteredResult(_0x24a6ef,_0x57b5af){return function(_0x1c80df){if(_0x1c80df){var _0x36dd01=typeof _0x57b5af[_0xb35e('0x24')]===_0xb35e('0x25')&&typeof _0x57b5af[_0xb35e('0x26')]===_0xb35e('0x25');var _0x1b169c=_0x1c80df[_0xb35e('0x27')];var _0x1c229a=_0x36dd01?0x0:_0x57b5af[_0xb35e('0x24')];var _0x2d6d91=_0x36dd01?_0x1c80df[_0xb35e('0x27')]:_0x57b5af[_0xb35e('0x24')]+_0x57b5af['limit'];var _0x595764;if(_0x2d6d91>=_0x1b169c){_0x2d6d91=_0x1b169c;_0x595764=0xc8;}else{_0x595764=0xce;}_0x24a6ef[_0xb35e('0x21')](_0x595764);return _0x24a6ef['set'](_0xb35e('0x28'),_0x1c229a+'-'+_0x2d6d91+'/'+_0x1b169c)[_0xb35e('0x23')](_0x1c80df);}return null;};}function patchUpdates(_0x15f5a9){return function(_0x207533){try{jsonpatch['apply'](_0x207533,_0x15f5a9,!![]);}catch(_0x33b9a8){return BPromise[_0xb35e('0x29')](_0x33b9a8);}return _0x207533['save']();};}function saveUpdates(_0x486049,_0x46c8f3){return function(_0x4291fb){if(_0x4291fb){return _0x4291fb['update'](_0x486049)['then'](function(_0x57d925){return _0x57d925;});}return null;};}function removeEntity(_0x26a98e,_0x34a02c){return function(_0x5bcb39){if(_0x5bcb39){return _0x5bcb39[_0xb35e('0x2a')]()[_0xb35e('0x2b')](function(){_0x26a98e[_0xb35e('0x21')](0xcc)[_0xb35e('0x22')]();});}};}function handleEntityNotFound(_0x39ef35,_0x326ab4){return function(_0x430775){if(!_0x430775){_0x39ef35['sendStatus'](0x194);}return _0x430775;};}function handleError(_0x1eab33,_0x56ad61){_0x56ad61=_0x56ad61||0x1f4;return function(_0x21f98c){logger[_0xb35e('0x2c')](_0x21f98c[_0xb35e('0x2d')]);if(_0x21f98c[_0xb35e('0x2e')]){delete _0x21f98c['name'];}_0x1eab33[_0xb35e('0x21')](_0x56ad61)[_0xb35e('0x2f')](_0x21f98c);};}exports[_0xb35e('0x30')]=function(_0x4ed6bd,_0x4c5bc2,_0x50164b){if(!_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x32')](_0xb35e('0x33'))&&!_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x32')](_0xb35e('0x34'))){throw new db['Sequelize']['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x4ed6bd[_0xb35e('0x31')]['hasOwnProperty'](_0xb35e('0x34'))&&!_0x4ed6bd[_0xb35e('0x31')]['hasOwnProperty'](_0xb35e('0x35'))){throw new db['Sequelize'][(_0xb35e('0x36'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x32')](_0xb35e('0x37'))){throw new db[(_0xb35e('0x38'))]['ValidationError'](_0xb35e('0x39'));}else{try{var _0x73a558=JSON[_0xb35e('0x3a')](_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x37')]);}catch(_0x399c86){logger[_0xb35e('0x2c')](_0x399c86);throw new db[(_0xb35e('0x38'))]['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0x186080=[_0xb35e('0x3b'),_0xb35e('0x3c'),'mailqueue',_0xb35e('0x3d'),_0xb35e('0x3e'),_0xb35e('0x3f'),'whatsappqueue','team','user'];if(_['some'](_0x73a558,function(_0x37c3e2){return!_['includes'](_0x186080,_0x37c3e2[_0xb35e('0x40')]['toLowerCase']());})){throw new db[(_0xb35e('0x38'))]['ValidationError'](_0xb35e('0x41'));}}}var _0x323c16={};_0x323c16['senderName']=_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x32')]('senderName')?_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x42')]:_0x4ed6bd[_0xb35e('0x43')][_0xb35e('0x44')];_0x323c16[_0xb35e('0x45')]=_[_0xb35e('0x46')](_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x45')])?null:_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x45')];_0x323c16[_0xb35e('0x47')]=_0x4ed6bd[_0xb35e('0x31')][_0xb35e('0x47')]||![];_0x323c16[_0xb35e('0x48')]=_0x4ed6bd[_0xb35e('0x43')]['id'];return getContent(_0x4ed6bd[_0xb35e('0x31')])['then'](function(_0x5c41ad){_0x323c16[_0xb35e('0x31')]=_0x5c41ad;return getRecipients(_0x73a558);})[_0xb35e('0x2b')](function(_0x5abfdf){_0x323c16[_0xb35e('0x49')]=_[_0xb35e('0x4a')](_0x5abfdf)[_0xb35e('0x4b')](',');return db[_0xb35e('0x4c')][_0xb35e('0x4d')](function(_0x489716){return db[_0xb35e('0x4e')][_0xb35e('0x4f')](_0x323c16,{'raw':!![],'transaction':_0x489716})['then'](function(_0x59f011){var _0x32c1ae={'sender':_0x323c16[_0xb35e('0x42')],'description':_0x323c16[_0xb35e('0x45')],'content':_0x323c16[_0xb35e('0x31')],'beep':_0x323c16[_0xb35e('0x47')]};_0x5abfdf[_0xb35e('0x50')](function(_0x459290){_0x32c1ae[_0xb35e('0x51')]=_0x459290;socket[_0xb35e('0x52')](_0xb35e('0x53'),_0x32c1ae);});return _0x59f011;});});})[_0xb35e('0x2b')](respondWithResult(_0x4c5bc2,0xc9))[_0xb35e('0x54')](handleError(_0x4c5bc2,null));};function getContent(_0x311453){return new BPromise(function(_0x216d62,_0x388417){if(_0x311453['text']){_0x216d62(_0x311453[_0xb35e('0x33')]);return;}return db[_0xb35e('0x55')]['findOne']({'attributes':[_0xb35e('0x56')],'where':{'id':_0x311453[_0xb35e('0x34')]},'raw':!![]})[_0xb35e('0x2b')](function(_0x52a8d2){if(!_0x52a8d2)throw new db[(_0xb35e('0x38'))][(_0xb35e('0x36'))](_0xb35e('0x57'));var _0x5c7765=Mustache['render'](_0x52a8d2[_0xb35e('0x56')],_0x311453[_0xb35e('0x35')]);_0x216d62(_0x5c7765);})[_0xb35e('0x54')](function(_0x1309c6){_0x388417(_0x1309c6);});});}function getRecipients(_0x4c2d8d){return new BPromise(function(_0x2f8e75,_0x500bd8){var _0x323abb=[];var _0x2ce57b=[];_0x4c2d8d[_0xb35e('0x50')](function(_0x506095){var _0x4f48ba=_[_0xb35e('0x58')](_0x506095['model'][_0xb35e('0x59')]());if(_0x4f48ba===_0xb35e('0x5a')){_0x323abb=_[_0xb35e('0x5b')](_0x323abb,_0x506095[_0xb35e('0x5c')]);}else{if(_[_0xb35e('0x5d')](_0x4f48ba,'queue'))_0x4f48ba=_0x4f48ba[_0xb35e('0x5e')](_0xb35e('0x5f'),_0xb35e('0x60'));_0x506095[_0xb35e('0x5c')]['forEach'](function(_0x4162e5){_0x2ce57b[_0xb35e('0x61')](getAgents(_0x4f48ba,_0x4162e5));});}});return BPromise[_0xb35e('0x62')](_0x2ce57b)[_0xb35e('0x2b')](function(_0x34af59){_0x323abb=_[_0xb35e('0x5b')](_0x323abb,_[_0xb35e('0x63')](_0x34af59));_0x2f8e75(_0x323abb);})['catch'](function(_0x1fdcd3){_0x500bd8(_0x1fdcd3);});});}function getAgents(_0x4183fb,_0x51a699){return new BPromise(function(_0x4b7c65,_0x449e42){return db[_0x4183fb][_0xb35e('0x64')]({'where':{'id':_0x51a699}})[_0xb35e('0x2b')](function(_0x3fc3fb){return _0x3fc3fb[_0xb35e('0x65')]({'attributes':['id'],'raw':!![]})[_0xb35e('0x2b')](function(_0x1377c4){var _0x2acae9=_['map'](_0x1377c4,'id');_0x4b7c65(_0x2acae9);});})[_0xb35e('0x54')](function(_0x45936d){_0x449e42(_0x45936d);});});}
\ No newline at end of file
index 6599e9c..f79d829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fc7=['../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x361087,_0x22f6df){var _0x57b4c6=function(_0x37b02d){while(--_0x37b02d){_0x361087['push'](_0x361087['shift']());}};_0x57b4c6(++_0x22f6df);}(_0x9fc7,0x1cb));var _0x79fc=function(_0x4f292f,_0x35d89f){_0x4f292f=_0x4f292f-0x0;var _0x1d9922=_0x9fc7[_0x4f292f];return _0x1d9922;};'use strict';var EventEmitter=require(_0x79fc('0x0'));var UserNotification=require(_0x79fc('0x1'))['db'][_0x79fc('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x79fc('0x3')](0x0);var events={'afterCreate':_0x79fc('0x4'),'afterUpdate':_0x79fc('0x5'),'afterDestroy':_0x79fc('0x6')};function emitEvent(_0x382fa2){return function(_0x3ab5e2,_0x434c04,_0x253a47){UserNotificationEvents['emit'](_0x382fa2+':'+_0x3ab5e2['id'],_0x3ab5e2);UserNotificationEvents[_0x79fc('0x7')](_0x382fa2,_0x3ab5e2);_0x253a47(null);};}for(var e in events){if(events[_0x79fc('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x79fc('0x9')]=UserNotificationEvents;
\ No newline at end of file
+var _0x3e6b=['exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3754b6,_0x2973d7){var _0x1b0af3=function(_0x61f1f4){while(--_0x61f1f4){_0x3754b6['push'](_0x3754b6['shift']());}};_0x1b0af3(++_0x2973d7);}(_0x3e6b,0xb5));var _0xb3e6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3e6b[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xb3e6('0x0'));var UserNotification=require(_0xb3e6('0x1'))['db'][_0xb3e6('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb3e6('0x3'),'afterUpdate':_0xb3e6('0x4'),'afterDestroy':_0xb3e6('0x5')};function emitEvent(_0x2144d1){return function(_0x342b6c,_0x5ea7f5,_0x48a6a5){UserNotificationEvents[_0xb3e6('0x6')](_0x2144d1+':'+_0x342b6c['id'],_0x342b6c);UserNotificationEvents[_0xb3e6('0x6')](_0x2144d1,_0x342b6c);_0x48a6a5(null);};}for(var e in events){if(events[_0xb3e6('0x7')](e)){var event=events[e];UserNotification[_0xb3e6('0x8')](e,emitEvent(event));}}module[_0xb3e6('0x9')]=UserNotificationEvents;
\ No newline at end of file
index 445bb59..0726708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x941d=['bluebird','request-promise','path','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','util','api','moment'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x941d,0x189));var _0xd941=function(_0x19e915,_0x3ac017){_0x19e915=_0x19e915-0x0;var _0x23c76c=_0x941d[_0x19e915];return _0x23c76c;};'use strict';var _=require('lodash');var util=require(_0xd941('0x0'));var logger=require('../../config/logger')(_0xd941('0x1'));var moment=require(_0xd941('0x2'));var BPromise=require(_0xd941('0x3'));var rp=require(_0xd941('0x4'));var fs=require('fs');var path=require(_0xd941('0x5'));var rimraf=require('rimraf');var config=require(_0xd941('0x6'));var attributes=require('./userNotification.attributes');module[_0xd941('0x7')]=function(_0x388e14,_0x3c0e20){return _0x388e14[_0xd941('0x8')](_0xd941('0x9'),attributes,{'tableName':_0xd941('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd941('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x050a=['bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x1189e6,_0x335e1c){var _0x545ae9=function(_0x84b11b){while(--_0x84b11b){_0x1189e6['push'](_0x1189e6['shift']());}};_0x545ae9(++_0x335e1c);}(_0x050a,0xa6));var _0xa050=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x050a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa050('0x0'));var util=require(_0xa050('0x1'));var logger=require(_0xa050('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa050('0x3'));var rp=require(_0xa050('0x4'));var fs=require('fs');var path=require(_0xa050('0x5'));var rimraf=require('rimraf');var config=require(_0xa050('0x6'));var attributes=require(_0xa050('0x7'));module[_0xa050('0x8')]=function(_0x5086ba,_0x47833d){return _0x5086ba[_0xa050('0x9')](_0xa050('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa050('0xb'),'collate':_0xa050('0xc')});};
\ No newline at end of file
index 115cdbd..59de1c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa60=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userNotification.socket','register','request','then','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','UserNotification,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment'];(function(_0x2b77d0,_0x11f932){var _0x3b1d83=function(_0x27b661){while(--_0x27b661){_0x2b77d0['push'](_0x2b77d0['shift']());}};_0x3b1d83(++_0x11f932);}(_0xfa60,0x65));var _0x0fa6=function(_0x54a733,_0x6355fd){_0x54a733=_0x54a733-0x0;var _0x28a120=_0xfa60[_0x54a733];return _0x28a120;};'use strict';var _=require(_0x0fa6('0x0'));var util=require(_0x0fa6('0x1'));var moment=require(_0x0fa6('0x2'));var BPromise=require(_0x0fa6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fa6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0fa6('0x5'));var config=require(_0x0fa6('0x6'));var jayson=require(_0x0fa6('0x7'));var client=jayson[_0x0fa6('0x8')][_0x0fa6('0x9')]({'port':0x232a});config['redis']=_[_0x0fa6('0xa')](config['redis'],{'host':_0x0fa6('0xb'),'port':0x18eb});var socket=require(_0x0fa6('0xc'))(new Redis(config[_0x0fa6('0xd')]));require(_0x0fa6('0xe'))[_0x0fa6('0xf')](socket);function respondWithRpcPromise(_0x8796da,_0x4d18dd,_0x577ff0){return new BPromise(function(_0x1c3f50,_0xd9459e){return client[_0x0fa6('0x10')](_0x8796da,_0x577ff0)[_0x0fa6('0x11')](function(_0x2d9441){logger['info']('UserNotification,\x20%s,\x20%s',_0x4d18dd,_0x0fa6('0x12'));logger[_0x0fa6('0x13')](_0x0fa6('0x14'),_0x4d18dd,_0x0fa6('0x12'),JSON['stringify'](_0x2d9441));if(_0x2d9441['error']){if(_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x16')]===0x1f4){logger[_0x0fa6('0x15')](_0x0fa6('0x17'),_0x4d18dd,_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);return _0xd9459e(_0x2d9441[_0x0fa6('0x15')]['message']);}logger['error'](_0x0fa6('0x17'),_0x4d18dd,_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);return _0x1c3f50(_0x2d9441[_0x0fa6('0x15')][_0x0fa6('0x18')]);}else{logger[_0x0fa6('0x19')]('UserNotification,\x20%s,\x20%s',_0x4d18dd,'request\x20sent');_0x1c3f50(_0x2d9441[_0x0fa6('0x1a')][_0x0fa6('0x18')]);}})['catch'](function(_0x3d9f3f){logger[_0x0fa6('0x15')](_0x0fa6('0x17'),_0x4d18dd,_0x3d9f3f);_0xd9459e(_0x3d9f3f);});});}
\ No newline at end of file
+var _0x27e2=['ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x27e2,0xef));var _0x227e=function(_0x23b3e0,_0x802d57){_0x23b3e0=_0x23b3e0-0x0;var _0x122558=_0x27e2[_0x23b3e0];return _0x122558;};'use strict';var _=require(_0x227e('0x0'));var util=require(_0x227e('0x1'));var moment=require('moment');var BPromise=require(_0x227e('0x2'));var rs=require(_0x227e('0x3'));var fs=require('fs');var Redis=require(_0x227e('0x4'));var db=require(_0x227e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x227e('0x6'));var config=require('../../config/environment');var jayson=require(_0x227e('0x7'));var client=jayson[_0x227e('0x8')][_0x227e('0x9')]({'port':0x232a});config[_0x227e('0xa')]=_[_0x227e('0xb')](config[_0x227e('0xa')],{'host':_0x227e('0xc'),'port':0x18eb});var socket=require(_0x227e('0xd'))(new Redis(config[_0x227e('0xa')]));require(_0x227e('0xe'))['register'](socket);function respondWithRpcPromise(_0x4f2e2d,_0x9718dc,_0x297a84){return new BPromise(function(_0x3dc802,_0x2cc54b){return client[_0x227e('0xf')](_0x4f2e2d,_0x297a84)[_0x227e('0x10')](function(_0x347f95){logger[_0x227e('0x11')](_0x227e('0x12'),_0x9718dc,_0x227e('0x13'));logger[_0x227e('0x14')](_0x227e('0x15'),_0x9718dc,'request\x20sent',JSON['stringify'](_0x347f95));if(_0x347f95[_0x227e('0x16')]){if(_0x347f95['error'][_0x227e('0x17')]===0x1f4){logger[_0x227e('0x16')](_0x227e('0x12'),_0x9718dc,_0x347f95[_0x227e('0x16')][_0x227e('0x18')]);return _0x2cc54b(_0x347f95['error'][_0x227e('0x18')]);}logger[_0x227e('0x16')]('UserNotification,\x20%s,\x20%s',_0x9718dc,_0x347f95[_0x227e('0x16')][_0x227e('0x18')]);return _0x3dc802(_0x347f95[_0x227e('0x16')]['message']);}else{logger[_0x227e('0x11')]('UserNotification,\x20%s,\x20%s',_0x9718dc,_0x227e('0x13'));_0x3dc802(_0x347f95[_0x227e('0x19')]['message']);}})[_0x227e('0x1a')](function(_0x2627e9){logger[_0x227e('0x16')]('UserNotification,\x20%s,\x20%s',_0x9718dc,_0x2627e9);_0x2cc54b(_0x2627e9);});});}
\ No newline at end of file
index c237fe1..7e1da54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5746=['./userNotification.events','update','emit','removeListener','register','length'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x5746,0x150));var _0x6574=function(_0x49b407,_0x189d49){_0x49b407=_0x49b407-0x0;var _0x48ed95=_0x5746[_0x49b407];return _0x48ed95;};'use strict';var UserNotificationEvents=require(_0x6574('0x0'));var events=['save','remove',_0x6574('0x1')];function createListener(_0x1e3cdf,_0x23cc53){return function(_0x553acf){_0x23cc53[_0x6574('0x2')](_0x1e3cdf,_0x553acf);};}function removeListener(_0x146170,_0xd3f56d){return function(){UserNotificationEvents[_0x6574('0x3')](_0x146170,_0xd3f56d);};}exports[_0x6574('0x4')]=function(_0x3a2200){for(var _0x3f7170=0x0,_0x4d497a=events[_0x6574('0x5')];_0x3f7170<_0x4d497a;_0x3f7170++){var _0x5e9ad0=events[_0x3f7170];var _0x50d074=createListener('userNotification:'+_0x5e9ad0,_0x3a2200);UserNotificationEvents['on'](_0x5e9ad0,_0x50d074);}};
\ No newline at end of file
+var _0x34d7=['emit','removeListener','register','userNotification:','./userNotification.events','save','remove','update'];(function(_0x56d374,_0x3c02a5){var _0x272fea=function(_0x4ed4cf){while(--_0x4ed4cf){_0x56d374['push'](_0x56d374['shift']());}};_0x272fea(++_0x3c02a5);}(_0x34d7,0xe4));var _0x734d=function(_0x337e05,_0x4c2777){_0x337e05=_0x337e05-0x0;var _0x59cabb=_0x34d7[_0x337e05];return _0x59cabb;};'use strict';var UserNotificationEvents=require(_0x734d('0x0'));var events=[_0x734d('0x1'),_0x734d('0x2'),_0x734d('0x3')];function createListener(_0xf23486,_0x37335f){return function(_0x5117d9){_0x37335f[_0x734d('0x4')](_0xf23486,_0x5117d9);};}function removeListener(_0x2080a8,_0x2f133d){return function(){UserNotificationEvents[_0x734d('0x5')](_0x2080a8,_0x2f133d);};}exports[_0x734d('0x6')]=function(_0x18a5e8){for(var _0x5a2876=0x0,_0x2b5fee=events['length'];_0x5a2876<_0x2b5fee;_0x5a2876++){var _0x9b5a32=events[_0x5a2876];var _0x46beda=createListener(_0x734d('0x7')+_0x9b5a32,_0x18a5e8);UserNotificationEvents['on'](_0x9b5a32,_0x46beda);}};
\ No newline at end of file
index 18e4d7e..201b8d4 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(_0x2edef3,_0x15e695){var _0x133049=function(_0x49524e){while(--_0x49524e){_0x2edef3['push'](_0x2edef3['shift']());}};_0x133049(++_0x15e695);}(_0x70e0,0x17b));var _0x070e=function(_0x5e91e1,_0x15310a){_0x5e91e1=_0x5e91e1-0x0;var _0x347b31=_0x70e0[_0x5e91e1];return _0x347b31;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1966ad,_0x43f2f3){var _0x5d7637=function(_0x24b943){while(--_0x24b943){_0x1966ad['push'](_0x1966ad['shift']());}};_0x5d7637(++_0x43f2f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 0f45995..0bf9dbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ff=['sequelize','INTEGER'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xb7ff,0x6e));var _0xfb7f=function(_0xbe0f8b,_0x56f63a){_0xbe0f8b=_0xbe0f8b-0x0;var _0x5c4f2b=_0xb7ff[_0xbe0f8b];return _0x5c4f2b;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfb7f('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x757b=['exports','sequelize'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x757b,0xa7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb757('0x0'));module[_0xb757('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 725da6d..a702768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac81=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','define'];(function(_0x394d4f,_0x43cf8e){var _0x534041=function(_0x289b9f){while(--_0x289b9f){_0x394d4f['push'](_0x394d4f['shift']());}};_0x534041(++_0x43cf8e);}(_0xac81,0xe6));var _0x1ac8=function(_0x4c91a1,_0x140404){_0x4c91a1=_0x4c91a1-0x0;var _0x2c2390=_0xac81[_0x4c91a1];return _0x2c2390;};'use strict';var _=require(_0x1ac8('0x0'));var util=require(_0x1ac8('0x1'));var logger=require(_0x1ac8('0x2'))(_0x1ac8('0x3'));var moment=require('moment');var BPromise=require(_0x1ac8('0x4'));var rp=require(_0x1ac8('0x5'));var fs=require('fs');var path=require(_0x1ac8('0x6'));var rimraf=require(_0x1ac8('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ac8('0x8'));module['exports']=function(_0x59e5f6,_0x57a4fb){return _0x59e5f6[_0x1ac8('0x9')](_0x1ac8('0xa'),attributes,{'tableName':_0x1ac8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec43=['../../config/environment','define','user_has_openchannel_queues','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xec43,0x1e0));var _0x3ec4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec43[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x3ec4('0x0'));var logger=require(_0x3ec4('0x1'))(_0x3ec4('0x2'));var moment=require('moment');var BPromise=require(_0x3ec4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ec4('0x4'));var rimraf=require(_0x3ec4('0x5'));var config=require(_0x3ec4('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x152cfb,_0x379587){return _0x152cfb[_0x3ec4('0x7')]('UserOpenchannelQueue',attributes,{'tableName':_0x3ec4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 162663b..c5f20e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec3=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x22c9d3,_0x307c00){var _0x319833=function(_0x1932c1){while(--_0x1932c1){_0x22c9d3['push'](_0x22c9d3['shift']());}};_0x319833(++_0x307c00);}(_0x9ec3,0x88));var _0x39ec=function(_0x25b7bc,_0x4cb6bf){_0x25b7bc=_0x25b7bc-0x0;var _0x479fdb=_0x9ec3[_0x25b7bc];return _0x479fdb;};'use strict';var _=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var moment=require(_0x39ec('0x2'));var BPromise=require(_0x39ec('0x3'));var rs=require(_0x39ec('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x39ec('0x5'))['db'];var utils=require(_0x39ec('0x6'));var logger=require(_0x39ec('0x7'))('rpc');var config=require(_0x39ec('0x8'));var jayson=require(_0x39ec('0x9'));var client=jayson[_0x39ec('0xa')][_0x39ec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33f7ca,_0xa6bfd7,_0x286209){return new BPromise(function(_0x838988,_0xe4734f){return client[_0x39ec('0xc')](_0x33f7ca,_0x286209)[_0x39ec('0xd')](function(_0x49daa2){logger[_0x39ec('0xe')](_0x39ec('0xf'),_0xa6bfd7,_0x39ec('0x10'));logger[_0x39ec('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xa6bfd7,_0x39ec('0x10'),JSON[_0x39ec('0x12')](_0x49daa2));if(_0x49daa2[_0x39ec('0x13')]){if(_0x49daa2[_0x39ec('0x13')]['code']===0x1f4){logger['error'](_0x39ec('0xf'),_0xa6bfd7,_0x49daa2[_0x39ec('0x13')][_0x39ec('0x14')]);return _0xe4734f(_0x49daa2['error'][_0x39ec('0x14')]);}logger['error'](_0x39ec('0xf'),_0xa6bfd7,_0x49daa2[_0x39ec('0x13')][_0x39ec('0x14')]);return _0x838988(_0x49daa2['error'][_0x39ec('0x14')]);}else{logger[_0x39ec('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa6bfd7,_0x39ec('0x10'));_0x838988(_0x49daa2[_0x39ec('0x15')][_0x39ec('0x14')]);}})[_0x39ec('0x16')](function(_0x40b6a8){logger[_0x39ec('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa6bfd7,_0x40b6a8);_0xe4734f(_0x40b6a8);});});}
\ No newline at end of file
+var _0x97cd=['http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\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'];(function(_0x28adc7,_0x25ca4d){var _0x4f90bc=function(_0xfe636e){while(--_0xfe636e){_0x28adc7['push'](_0x28adc7['shift']());}};_0x4f90bc(++_0x25ca4d);}(_0x97cd,0x1d5));var _0xd97c=function(_0x22e225,_0x226755){_0x22e225=_0x22e225-0x0;var _0x1b4066=_0x97cd[_0x22e225];return _0x1b4066;};'use strict';var _=require(_0xd97c('0x0'));var util=require(_0xd97c('0x1'));var moment=require(_0xd97c('0x2'));var BPromise=require(_0xd97c('0x3'));var rs=require(_0xd97c('0x4'));var fs=require('fs');var Redis=require(_0xd97c('0x5'));var db=require(_0xd97c('0x6'))['db'];var utils=require(_0xd97c('0x7'));var logger=require(_0xd97c('0x8'))(_0xd97c('0x9'));var config=require('../../config/environment');var jayson=require(_0xd97c('0xa'));var client=jayson['client'][_0xd97c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x89709a,_0x4fed85,_0x42fffc){return new BPromise(function(_0x195ffb,_0x43f7ec){return client[_0xd97c('0xc')](_0x89709a,_0x42fffc)[_0xd97c('0xd')](function(_0x4495d1){logger[_0xd97c('0xe')](_0xd97c('0xf'),_0x4fed85,_0xd97c('0x10'));logger['debug'](_0xd97c('0x11'),_0x4fed85,_0xd97c('0x10'),JSON[_0xd97c('0x12')](_0x4495d1));if(_0x4495d1[_0xd97c('0x13')]){if(_0x4495d1[_0xd97c('0x13')][_0xd97c('0x14')]===0x1f4){logger[_0xd97c('0x13')](_0xd97c('0xf'),_0x4fed85,_0x4495d1[_0xd97c('0x13')][_0xd97c('0x15')]);return _0x43f7ec(_0x4495d1[_0xd97c('0x13')][_0xd97c('0x15')]);}logger['error'](_0xd97c('0xf'),_0x4fed85,_0x4495d1[_0xd97c('0x13')][_0xd97c('0x15')]);return _0x195ffb(_0x4495d1[_0xd97c('0x13')][_0xd97c('0x15')]);}else{logger[_0xd97c('0xe')](_0xd97c('0xf'),_0x4fed85,_0xd97c('0x10'));_0x195ffb(_0x4495d1[_0xd97c('0x16')][_0xd97c('0x15')]);}})[_0xd97c('0x17')](function(_0x1353f6){logger[_0xd97c('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4fed85,_0x1353f6);_0x43f7ec(_0x1353f6);});});}
\ No newline at end of file
index fea8c9a..8d149ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec3=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/:id','getSections','/:id/resources','getResources','create','post','clone','addSections','put','update','destroy','/:id/sections','removeSections','delete','exports','multer','util','express'];(function(_0x889c34,_0x371f4d){var _0x3d5a9c=function(_0xf20390){while(--_0xf20390){_0x889c34['push'](_0x889c34['shift']());}};_0x3d5a9c(++_0x371f4d);}(_0x9ec3,0xcd));var _0x39ec=function(_0x5ea887,_0x5bb376){_0x5ea887=_0x5ea887-0x0;var _0x45c71b=_0x9ec3[_0x5ea887];return _0x45c71b;};'use strict';var multer=require(_0x39ec('0x0'));var util=require(_0x39ec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39ec('0x2'));var router=express['Router']();var fs_extra=require(_0x39ec('0x3'));var auth=require(_0x39ec('0x4'));var interaction=require(_0x39ec('0x5'));var config=require(_0x39ec('0x6'));var controller=require(_0x39ec('0x7'));router[_0x39ec('0x8')]('/',auth[_0x39ec('0x9')](),controller[_0x39ec('0xa')]);router['get']('/describe',auth[_0x39ec('0x9')](),controller['describe']);router[_0x39ec('0x8')](_0x39ec('0xb'),auth[_0x39ec('0x9')](),controller['show']);router[_0x39ec('0x8')]('/:id/sections',auth[_0x39ec('0x9')](),controller[_0x39ec('0xc')]);router['get'](_0x39ec('0xd'),auth[_0x39ec('0x9')](),controller[_0x39ec('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x39ec('0xf')]);router[_0x39ec('0x10')]('/:id/clone',auth[_0x39ec('0x9')](),controller[_0x39ec('0x11')]);router[_0x39ec('0x10')]('/:id/sections',auth[_0x39ec('0x9')](),controller[_0x39ec('0x12')]);router[_0x39ec('0x10')](_0x39ec('0xd'),auth[_0x39ec('0x9')](),controller['addResources']);router[_0x39ec('0x13')](_0x39ec('0xb'),auth['isAuthenticated'](),controller[_0x39ec('0x14')]);router['delete'](_0x39ec('0xb'),auth[_0x39ec('0x9')](),controller[_0x39ec('0x15')]);router['delete'](_0x39ec('0x16'),auth[_0x39ec('0x9')](),controller[_0x39ec('0x17')]);router[_0x39ec('0x18')](_0x39ec('0xd'),auth['isAuthenticated'](),controller['removeResources']);module[_0x39ec('0x19')]=router;
\ No newline at end of file
+var _0x8bc0=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addSections','put','update','destroy','delete','removeSections','removeResources','exports','multer','path','express','Router'];(function(_0x498a12,_0x3a251c){var _0x2c7dcf=function(_0x5cfc78){while(--_0x5cfc78){_0x498a12['push'](_0x498a12['shift']());}};_0x2c7dcf(++_0x3a251c);}(_0x8bc0,0x88));var _0x08bc=function(_0x105fb1,_0x2e2ee1){_0x105fb1=_0x105fb1-0x0;var _0x5d0b9e=_0x8bc0[_0x105fb1];return _0x5d0b9e;};'use strict';var multer=require(_0x08bc('0x0'));var util=require('util');var path=require(_0x08bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x08bc('0x2'));var router=express[_0x08bc('0x3')]();var fs_extra=require(_0x08bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08bc('0x5'));var config=require(_0x08bc('0x6'));var controller=require('./userProfile.controller');router[_0x08bc('0x7')]('/',auth[_0x08bc('0x8')](),controller[_0x08bc('0x9')]);router[_0x08bc('0x7')](_0x08bc('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x08bc('0xb'),auth[_0x08bc('0x8')](),controller[_0x08bc('0xc')]);router[_0x08bc('0x7')]('/:id/sections',auth[_0x08bc('0x8')](),controller[_0x08bc('0xd')]);router[_0x08bc('0x7')](_0x08bc('0xe'),auth[_0x08bc('0x8')](),controller[_0x08bc('0xf')]);router[_0x08bc('0x10')]('/',auth[_0x08bc('0x8')](),controller[_0x08bc('0x11')]);router[_0x08bc('0x10')]('/:id/clone',auth[_0x08bc('0x8')](),controller[_0x08bc('0x12')]);router[_0x08bc('0x10')](_0x08bc('0x13'),auth['isAuthenticated'](),controller[_0x08bc('0x14')]);router[_0x08bc('0x10')]('/:id/resources',auth[_0x08bc('0x8')](),controller['addResources']);router[_0x08bc('0x15')](_0x08bc('0xb'),auth[_0x08bc('0x8')](),controller[_0x08bc('0x16')]);router['delete'](_0x08bc('0xb'),auth['isAuthenticated'](),controller[_0x08bc('0x17')]);router[_0x08bc('0x18')](_0x08bc('0x13'),auth[_0x08bc('0x8')](),controller[_0x08bc('0x19')]);router[_0x08bc('0x18')](_0x08bc('0xe'),auth['isAuthenticated'](),controller[_0x08bc('0x1a')]);module[_0x08bc('0x1b')]=router;
\ No newline at end of file
index c60052e..934699d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd23=['exports','STRING','setDataValue','join','crudPermissions','split','BOOLEAN'];(function(_0x3cfcc3,_0x1b3823){var _0x4e19a7=function(_0x192a14){while(--_0x192a14){_0x3cfcc3['push'](_0x3cfcc3['shift']());}};_0x4e19a7(++_0x1b3823);}(_0xcd23,0x19d));var _0x3cd2=function(_0x37317e,_0x3ce630){_0x37317e=_0x37317e-0x0;var _0x560af0=_0xcd23[_0x37317e];return _0x560af0;};'use strict';var Sequelize=require('sequelize');module[_0x3cd2('0x0')]={'name':{'type':Sequelize[_0x3cd2('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x3cd2('0x1')],'set':function(_0x45ea14){this[_0x3cd2('0x2')]('crudPermissions',_0x45ea14?_0x45ea14[_0x3cd2('0x3')](''):[]);},'get':function(){return this['getDataValue'](_0x3cd2('0x4'))?this['getDataValue']('crudPermissions')[_0x3cd2('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3cd2('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3cd2('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x45a5=['exports','name','getDataValue','split','STRING','BOOLEAN','sequelize'];(function(_0x4c09e6,_0x4ab78d){var _0x5ad225=function(_0x45ba6f){while(--_0x45ba6f){_0x4c09e6['push'](_0x4c09e6['shift']());}};_0x5ad225(++_0x4ab78d);}(_0x45a5,0xa7));var _0x545a=function(_0xc920fd,_0x5cdee9){_0xc920fd=_0xc920fd-0x0;var _0x438fb4=_0x45a5[_0xc920fd];return _0x438fb4;};'use strict';var Sequelize=require(_0x545a('0x0'));module[_0x545a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x545a('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x128d9c){this['setDataValue']('crudPermissions',_0x128d9c?_0x128d9c['join'](''):[]);},'get':function(){return this[_0x545a('0x3')]('crudPermissions')?this[_0x545a('0x3')]('crudPermissions')[_0x545a('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x545a('0x5')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x545a('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index 8a1d24c..2188514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b11=['ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./userProfile.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','name','send','index','map','UserProfile','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','UserProfileResource','sectionId','omit','userProfileId','Resources','UserProfileSection','destroy','describe','addSections','sequelize','push'];(function(_0x31251f,_0x430e3e){var _0x41120a=function(_0x15b9c5){while(--_0x15b9c5){_0x31251f['push'](_0x31251f['shift']());}};_0x41120a(++_0x430e3e);}(_0x4b11,0xf4));var _0x14b1=function(_0x3c4404,_0x482233){_0x3c4404=_0x3c4404-0x0;var _0x55b303=_0x4b11[_0x3c4404];return _0x55b303;};'use strict';var emlformat=require(_0x14b1('0x0'));var rimraf=require(_0x14b1('0x1'));var zipdir=require(_0x14b1('0x2'));var jsonpatch=require(_0x14b1('0x3'));var rp=require('request-promise');var moment=require(_0x14b1('0x4'));var BPromise=require(_0x14b1('0x5'));var Mustache=require(_0x14b1('0x6'));var util=require('util');var path=require(_0x14b1('0x7'));var sox=require(_0x14b1('0x8'));var csv=require(_0x14b1('0x9'));var ejs=require(_0x14b1('0xa'));var fs=require('fs');var fs_extra=require(_0x14b1('0xb'));var _=require(_0x14b1('0xc'));var squel=require(_0x14b1('0xd'));var crypto=require(_0x14b1('0xe'));var jsforce=require(_0x14b1('0xf'));var deskjs=require(_0x14b1('0x10'));var toCsv=require(_0x14b1('0x9'));var querystring=require(_0x14b1('0x11'));var Papa=require(_0x14b1('0x12'));var Redis=require(_0x14b1('0x13'));var authService=require(_0x14b1('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x14b1('0x15'));var hardwareService=require(_0x14b1('0x16'));var logger=require('../../config/logger')(_0x14b1('0x17'));var utils=require(_0x14b1('0x18'));var config=require(_0x14b1('0x19'));var licenseUtil=require(_0x14b1('0x1a'));var db=require(_0x14b1('0x1b'))['db'];config[_0x14b1('0x1c')]=_['defaults'](config[_0x14b1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x14b1('0x1c')]));require(_0x14b1('0x1d'))[_0x14b1('0x1e')](socket);function respondWithStatusCode(_0xef8e33,_0xe3de6){_0xe3de6=_0xe3de6||0xcc;return function(_0x2bccc6){if(_0x2bccc6){return _0xef8e33['sendStatus'](_0xe3de6);}return _0xef8e33[_0x14b1('0x1f')](_0xe3de6)[_0x14b1('0x20')]();};}function respondWithResult(_0x2f5a3b,_0xee6c2b){_0xee6c2b=_0xee6c2b||0xc8;return function(_0x459033){if(_0x459033){return _0x2f5a3b[_0x14b1('0x1f')](_0xee6c2b)[_0x14b1('0x21')](_0x459033);}};}function respondWithFilteredResult(_0x35bdff,_0x5dcb52){return function(_0x5b9c4e){if(_0x5b9c4e){var _0x54c287=typeof _0x5dcb52[_0x14b1('0x22')]===_0x14b1('0x23')&&typeof _0x5dcb52[_0x14b1('0x24')]===_0x14b1('0x23');var _0x3d0d98=_0x5b9c4e[_0x14b1('0x25')];var _0x36aca6=_0x54c287?0x0:_0x5dcb52[_0x14b1('0x22')];var _0x4f4830=_0x54c287?_0x5b9c4e[_0x14b1('0x25')]:_0x5dcb52['offset']+_0x5dcb52[_0x14b1('0x24')];var _0x1f905c;if(_0x4f4830>=_0x3d0d98){_0x4f4830=_0x3d0d98;_0x1f905c=0xc8;}else{_0x1f905c=0xce;}_0x35bdff['status'](_0x1f905c);return _0x35bdff[_0x14b1('0x26')](_0x14b1('0x27'),_0x36aca6+'-'+_0x4f4830+'/'+_0x3d0d98)['json'](_0x5b9c4e);}return null;};}function patchUpdates(_0x3ceda2){return function(_0x259dc1){try{jsonpatch[_0x14b1('0x28')](_0x259dc1,_0x3ceda2,!![]);}catch(_0x5033ca){return BPromise[_0x14b1('0x29')](_0x5033ca);}return _0x259dc1['save']();};}function saveUpdates(_0x675488,_0x1306ad){return function(_0x4332f1){if(_0x4332f1){return _0x4332f1[_0x14b1('0x2a')](_0x675488)[_0x14b1('0x2b')](function(_0x3ae844){return _0x3ae844;});}return null;};}function removeEntity(_0x17eb54,_0x3453a7){return function(_0x83f502){if(_0x83f502){return _0x83f502['destroy']()['then'](function(){_0x17eb54[_0x14b1('0x1f')](0xcc)[_0x14b1('0x20')]();});}};}function handleEntityNotFound(_0x4b0295,_0x2365e8){return function(_0x35b21b){if(!_0x35b21b){_0x4b0295['sendStatus'](0x194);}return _0x35b21b;};}function handleError(_0x3bf896,_0x326711){_0x326711=_0x326711||0x1f4;return function(_0x12416e){logger[_0x14b1('0x2c')](_0x12416e['stack']);if(_0x12416e[_0x14b1('0x2d')]){delete _0x12416e[_0x14b1('0x2d')];}_0x3bf896[_0x14b1('0x1f')](_0x326711)[_0x14b1('0x2e')](_0x12416e);};}exports[_0x14b1('0x2f')]=function(_0x1c9fd3,_0x5b943e){var _0x1cb354={},_0x5ddffe={},_0x51ac25={'count':0x0,'rows':[]};var _0x4f0042=_[_0x14b1('0x30')](db[_0x14b1('0x31')]['rawAttributes'],function(_0x2d22f5){return{'name':_0x2d22f5[_0x14b1('0x32')],'type':_0x2d22f5['type']['key']};});_0x5ddffe[_0x14b1('0x33')]=_['map'](_0x4f0042,_0x14b1('0x2d'));_0x5ddffe[_0x14b1('0x34')]=_['keys'](_0x1c9fd3[_0x14b1('0x34')]);_0x5ddffe['filters']=_[_0x14b1('0x35')](_0x5ddffe[_0x14b1('0x33')],_0x5ddffe[_0x14b1('0x34')]);_0x1cb354[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x5ddffe[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x1c9fd3[_0x14b1('0x34')]['fields']));_0x1cb354[_0x14b1('0x36')]=_0x1cb354[_0x14b1('0x36')][_0x14b1('0x38')]?_0x1cb354[_0x14b1('0x36')]:_0x5ddffe['model'];if(!_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x39')](_0x14b1('0x3a'))){_0x1cb354['limit']=qs['limit'](_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x24')]);_0x1cb354['offset']=qs[_0x14b1('0x22')](_0x1c9fd3['query'][_0x14b1('0x22')]);}_0x1cb354[_0x14b1('0x3b')]=qs[_0x14b1('0x3c')](_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x3c')]);_0x1cb354[_0x14b1('0x3d')]=qs['filters'](_[_0x14b1('0x3e')](_0x1c9fd3[_0x14b1('0x34')],_0x5ddffe[_0x14b1('0x3f')]),_0x4f0042);if(_0x1c9fd3['query']['filter']){_0x1cb354[_0x14b1('0x3d')]=_[_0x14b1('0x40')](_0x1cb354['where'],{'$or':_['map'](_0x4f0042,function(_0x473216){if(_0x473216[_0x14b1('0x41')]!==_0x14b1('0x42')){var _0x4316c7={};_0x4316c7[_0x473216[_0x14b1('0x2d')]]={'$like':'%'+_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x43')]+'%'};return _0x4316c7;}})});}_0x1cb354=_[_0x14b1('0x40')]({},_0x1cb354,_0x1c9fd3['options']);var _0x117c5b={'where':_0x1cb354[_0x14b1('0x3d')]};return db[_0x14b1('0x31')]['count'](_0x117c5b)[_0x14b1('0x2b')](function(_0x39c96f){_0x51ac25[_0x14b1('0x25')]=_0x39c96f;if(_0x1c9fd3[_0x14b1('0x34')][_0x14b1('0x44')]){_0x1cb354[_0x14b1('0x45')]=[{'all':!![]}];}return db[_0x14b1('0x31')][_0x14b1('0x46')](_0x1cb354);})[_0x14b1('0x2b')](function(_0x13029d){_0x51ac25['rows']=_0x13029d;return _0x51ac25;})['then'](respondWithFilteredResult(_0x5b943e,_0x1cb354))[_0x14b1('0x47')](handleError(_0x5b943e,null));};exports[_0x14b1('0x48')]=function(_0x107be0,_0x2946b8){var _0x304935={'raw':![],'where':{'id':_0x107be0[_0x14b1('0x49')]['id']}},_0x4f96de={};_0x4f96de['model']=_[_0x14b1('0x4a')](db[_0x14b1('0x31')][_0x14b1('0x4b')]);_0x4f96de[_0x14b1('0x34')]=_[_0x14b1('0x4a')](_0x107be0[_0x14b1('0x34')]);_0x4f96de[_0x14b1('0x3f')]=_[_0x14b1('0x35')](_0x4f96de['model'],_0x4f96de[_0x14b1('0x34')]);_0x304935[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x4f96de[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x107be0[_0x14b1('0x34')]['fields']));_0x304935[_0x14b1('0x36')]=_0x304935[_0x14b1('0x36')][_0x14b1('0x38')]?_0x304935[_0x14b1('0x36')]:_0x4f96de[_0x14b1('0x33')];if(_0x107be0['query'][_0x14b1('0x44')]){_0x304935[_0x14b1('0x45')]=[{'all':!![]}];}_0x304935=_['merge']({},_0x304935,_0x107be0['options']);return db['UserProfile'][_0x14b1('0x4c')](_0x304935)[_0x14b1('0x2b')](handleEntityNotFound(_0x2946b8,null))[_0x14b1('0x2b')](respondWithResult(_0x2946b8,null))[_0x14b1('0x47')](handleError(_0x2946b8,null));};exports[_0x14b1('0x4d')]=function(_0x23afe1,_0x4f0e17){return db[_0x14b1('0x31')][_0x14b1('0x4d')](_0x23afe1[_0x14b1('0x4e')],{})['then'](respondWithResult(_0x4f0e17,0xc9))['catch'](handleError(_0x4f0e17,null));};exports[_0x14b1('0x4f')]=function(_0x4884e6,_0x425fa1){var _0x252dba={'where':{'id':_0x4884e6['params']['id']}},_0x3d7199={};_0x3d7199[_0x14b1('0x33')]=_[_0x14b1('0x4a')](db[_0x14b1('0x31')][_0x14b1('0x4b')]);_0x252dba[_0x14b1('0x36')]=_[_0x14b1('0x35')](_0x3d7199[_0x14b1('0x33')],qs[_0x14b1('0x37')](_0x4884e6[_0x14b1('0x34')][_0x14b1('0x37')]));_0x252dba[_0x14b1('0x36')]=_0x252dba[_0x14b1('0x36')][_0x14b1('0x38')]?_0x252dba[_0x14b1('0x36')]:_0x3d7199[_0x14b1('0x33')];if(_0x4884e6['query'][_0x14b1('0x44')]){_0x252dba[_0x14b1('0x45')]=[{'all':!![]}];}_0x252dba=_[_0x14b1('0x40')]({},_0x252dba,_0x4884e6['options']);return db[_0x14b1('0x31')]['find'](_0x252dba)[_0x14b1('0x2b')](handleEntityNotFound(_0x425fa1,null))['then'](function(_0x7b9832){if(_0x7b9832){var _0x52d3ac=_0x7b9832[_0x14b1('0x50')]({'plain':!![]});_0x52d3ac=qs['omit'](_0x52d3ac,['id',_0x14b1('0x51'),_0x14b1('0x52'),_0x14b1('0x53')]);_0x4884e6['body']=_['omit'](_0x4884e6[_0x14b1('0x4e')],['id','createdAt',_0x14b1('0x52')]);return db['sequelize'][_0x14b1('0x54')](function(_0x521db6){return db[_0x14b1('0x31')][_0x14b1('0x4d')](_[_0x14b1('0x40')](_0x52d3ac,_0x4884e6[_0x14b1('0x4e')]),{'include':_0x4884e6[_0x14b1('0x34')][_0x14b1('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x521db6})[_0x14b1('0x2b')](function(_0x4ab1ff){var _0x58ad92=_0x4ab1ff[_0x14b1('0x50')]({'plain':!![]});return db['UserProfileSection'][_0x14b1('0x46')]({'where':{'userProfileId':_0x4884e6['params']['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x2fd36b){if(_0x2fd36b){return BPromise[_0x14b1('0x55')](_0x2fd36b,function(_0x30f913){return new BPromise(function(_0x2ff755,_0x464be3){if(_0x30f913[_0x14b1('0x56')]===null||_0x30f913[_0x14b1('0x56')]===0x1)_0x2ff755(null);return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x30f913['id']},'raw':!![]})['then'](function(_0x2b8f80){var _0x3ab795=_['map'](_0x2b8f80,function(_0x22ac60){return qs['omit'](_0x22ac60,['id','createdAt',_0x14b1('0x52'),_0x14b1('0x58')]);});_0x2ff755(_0x3ab795);})[_0x14b1('0x47')](function(_0x16b5d6){_0x464be3(_0x16b5d6);});})['then'](function(_0x56c53e){var _0x4a9ba2=qs[_0x14b1('0x59')](_0x30f913,['id',_0x14b1('0x51'),_0x14b1('0x52')]);_0x4a9ba2[_0x14b1('0x5a')]=_0x58ad92['id'];if(_0x56c53e)_0x4a9ba2[_0x14b1('0x5b')]=_0x56c53e;return _0x4a9ba2;})['then'](function(_0x5b8a89){return db[_0x14b1('0x5c')][_0x14b1('0x4d')](_0x5b8a89,{'include':[{'model':db[_0x14b1('0x57')],'as':_0x14b1('0x5b')}],'raw':!![],'transaction':_0x521db6});});})[_0x14b1('0x2b')](function(){return _0x58ad92;});}});});});}})[_0x14b1('0x2b')](respondWithResult(_0x425fa1,0xc9))['catch'](handleError(_0x425fa1,null));};exports['update']=function(_0x252ae7,_0x516984){if(_0x252ae7[_0x14b1('0x4e')]['id']){delete _0x252ae7['body']['id'];}return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x252ae7[_0x14b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x516984,null))[_0x14b1('0x2b')](saveUpdates(_0x252ae7[_0x14b1('0x4e')],null))[_0x14b1('0x2b')](respondWithResult(_0x516984,null))[_0x14b1('0x47')](handleError(_0x516984,null));};exports[_0x14b1('0x5d')]=function(_0x4c7952,_0x13c4a8){return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x4c7952[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x13c4a8,null))[_0x14b1('0x2b')](removeEntity(_0x13c4a8,null))['catch'](handleError(_0x13c4a8,null));};exports[_0x14b1('0x5e')]=function(_0x1d0821,_0x4c3e45){return db[_0x14b1('0x31')][_0x14b1('0x5e')]()[_0x14b1('0x2b')](respondWithResult(_0x4c3e45,null))[_0x14b1('0x47')](handleError(_0x4c3e45,null));};exports[_0x14b1('0x5f')]=function(_0x31041a,_0x411460){var _0x1502ce=_0x31041a[_0x14b1('0x4e')];return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x31041a['params']['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x411460,null))[_0x14b1('0x2b')](function(_0x5095fc){if(_0x5095fc){return db[_0x14b1('0x60')][_0x14b1('0x54')](function(_0x1c416f){return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x31041a[_0x14b1('0x49')]['id'],'sectionId':_['map'](_0x1502ce,function(_0x1be7fd){return _0x1be7fd[_0x14b1('0x58')];})},'transaction':_0x1c416f})[_0x14b1('0x2b')](function(){var _0x59d1d6=_[_0x14b1('0x30')](_0x1502ce,function(_0x2f2004){_0x2f2004[_0x14b1('0x5a')]=_0x31041a[_0x14b1('0x49')]['id'];return _0x2f2004;});var _0x33266d=[];return BPromise[_0x14b1('0x55')](_0x59d1d6,function(_0x357ffb){return db['UserProfileSection'][_0x14b1('0x4d')](_0x357ffb,{'include':[{'model':db[_0x14b1('0x57')],'as':_0x14b1('0x5b')}],'raw':!![],'transaction':_0x1c416f})[_0x14b1('0x2b')](function(_0x4c3982){_0x33266d[_0x14b1('0x61')](_0x4c3982[_0x14b1('0x50')]({'plain':!![]}));});})[_0x14b1('0x2b')](function(){return _0x33266d;});});});}})[_0x14b1('0x2b')](function(_0x160ec6){return _0x160ec6;})[_0x14b1('0x2b')](respondWithResult(_0x411460,null))[_0x14b1('0x47')](handleError(_0x411460,null));};exports['removeSections']=function(_0x1ebca5,_0x15da04){var _0x503c48;return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x1ebca5[_0x14b1('0x49')]['id']},'attributes':['id','name']})[_0x14b1('0x2b')](handleEntityNotFound(_0x15da04,null))['then'](function(_0x1a34e2){if(_0x1a34e2){_0x503c48=_0x1a34e2;return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x1ebca5[_0x14b1('0x49')]['id'],'sectionId':_0x1ebca5['query'][_0x14b1('0x62')]}});}})[_0x14b1('0x2b')](function(){return _0x503c48;})[_0x14b1('0x2b')](respondWithStatusCode(_0x15da04,null))[_0x14b1('0x47')](handleError(_0x15da04,null));};exports[_0x14b1('0x63')]=function(_0x1c79fe,_0x463cb9){var _0x1c9b84=[];var _0x574d2d=[];return db[_0x14b1('0x5c')][_0x14b1('0x46')]({'where':{'userProfileId':_0x1c79fe[_0x14b1('0x49')]['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x223fbf){_0x1c9b84=_[_0x14b1('0x43')](_0x223fbf,function(_0x4972e3){return _0x4972e3[_0x14b1('0x64')]===0x1||_[_0x14b1('0x65')]([0x3eb,0x709],_0x4972e3[_0x14b1('0x58')]);});if(!_['isEmpty'](_0x1c9b84)){return _[_0x14b1('0x30')](_0x1c9b84,function(_0xe62cad){return _0xe62cad[_0x14b1('0x58')];});}else{return;}})[_0x14b1('0x2b')](function(_0x101ff5){if(_0x101ff5)_0x574d2d=_0x101ff5;if(_[_0x14b1('0x65')](_0x574d2d,0x64)){var _0x3b9b75=_[_0x14b1('0x4c')](_0x1c9b84,{'sectionId':0x64});return hasDefaultDashboard(_0x3b9b75)[_0x14b1('0x2b')](function(_0x268d88){return _[_0x14b1('0x30')](_0x1c9b84,function(_0x1d56ad){if(_0x1d56ad[_0x14b1('0x58')]===0x64){_0x1d56ad[_0x14b1('0x66')]=_0x268d88;}return _0x1d56ad;});});}else{return;}})[_0x14b1('0x2b')](function(_0x78cc6d){if(_0x78cc6d)_0x1c9b84=_0x78cc6d;if(_[_0x14b1('0x65')](_0x574d2d,0x3eb)){var _0x25d692=_[_0x14b1('0x4c')](_0x1c9b84,{'sectionId':0x3eb});return getCustomDashboards(_0x25d692)['then'](function(_0x4176ed){return _[_0x14b1('0x30')](_0x1c9b84,function(_0x510f0b){if(_0x25d692['enabled']){if(_0x510f0b[_0x14b1('0x58')]===0x3eb){_0x510f0b[_0x14b1('0x66')]=_0x4176ed;}}else{if(_0x510f0b[_0x14b1('0x58')]===0x64){_0x510f0b[_0x14b1('0x66')]=_0x4176ed;}}return _0x510f0b;});});}else{return;}})[_0x14b1('0x2b')](function(_0x21772e){if(_0x21772e)_0x1c9b84=_0x21772e;if(_[_0x14b1('0x65')](_0x574d2d,0x709)){var _0x215f6e=_['find'](_0x1c9b84,{'sectionId':0x709});return getPlugins(_0x215f6e)[_0x14b1('0x2b')](function(_0x3ba80c){if(_0x215f6e[_0x14b1('0x64')]){return _['map'](_0x1c9b84,function(_0x21eb80){if(_0x21eb80['sectionId']===0x709){_0x21eb80[_0x14b1('0x66')]=_0x3ba80c;}return _0x21eb80;});}else{var _0x32c91f={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3ba80c};var _0x4912e5=_[_0x14b1('0x30')](_0x1c9b84);_0x4912e5['push'](_0x32c91f);return _0x4912e5;}});}else{return;}})[_0x14b1('0x2b')](function(_0x538b43){if(_0x538b43)_0x1c9b84=_0x538b43;return _[_0x14b1('0x43')](_0x1c9b84,[_0x14b1('0x64'),0x1]);})['then'](respondWithResult(_0x463cb9,null))[_0x14b1('0x47')](handleError(_0x463cb9,null));};function hasDefaultDashboard(_0x1ac5cd){var _0x4ae655=[0x65];return new BPromise(function(_0xc278f3,_0x1cdec7){try{if(_0x1ac5cd[_0x14b1('0x56')]){_0xc278f3(_0x4ae655);}else{return db[_0x14b1('0x57')][_0x14b1('0x67')]({'where':{'sectionId':_0x1ac5cd['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x406626){_0x406626?_0xc278f3(_0x4ae655):_0xc278f3();});}}catch(_0x24ba13){_0x1cdec7(_0x24ba13);}});}function getCustomDashboards(_0x2b4ca2){var _0x38f445=[];return new BPromise(function(_0x2915a5,_0x49b6b6){try{if(_0x2b4ca2[_0x14b1('0x56')]){return db[_0x14b1('0x68')][_0x14b1('0x46')]({'raw':!![]})[_0x14b1('0x2b')](function(_0x5c5b74){_0x5c5b74[_0x14b1('0x69')](function(_0x3df690){_0x38f445[_0x14b1('0x61')](_0x3df690['id']+0x1869f);});_0x2915a5(_0x38f445);});}else{return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x2b4ca2['id']},'raw':!![]})[_0x14b1('0x2b')](function(_0x515a29){_0x515a29[_0x14b1('0x69')](function(_0x5a62bd){_0x38f445[_0x14b1('0x61')](_0x5a62bd[_0x14b1('0x6a')]+0x1869f);});_0x2915a5(_0x38f445);});}}catch(_0x9a8d89){_0x49b6b6(_0x9a8d89);}});}function getPlugins(_0x29d124){var _0x5343a1=[];return new BPromise(function(_0x42866d,_0x1658ec){try{if(_0x29d124[_0x14b1('0x56')]){return db['Plugin']['findAll']({'raw':!![]})[_0x14b1('0x2b')](function(_0xa70c5f){_0xa70c5f[_0x14b1('0x69')](function(_0x1e8ed5){_0x5343a1[_0x14b1('0x61')](_0x1e8ed5['id']+0x15b38);});_0x42866d(_0x5343a1);});}else{return db[_0x14b1('0x57')][_0x14b1('0x46')]({'where':{'sectionId':_0x29d124['id']},'raw':!![]})['then'](function(_0x49ca28){_0x49ca28['forEach'](function(_0xa4d11c){_0x5343a1[_0x14b1('0x61')](_0xa4d11c[_0x14b1('0x6a')]+0x15b38);});_0x42866d(_0x5343a1);});}}catch(_0x2d9af8){_0x1658ec(_0x2d9af8);}});}exports[_0x14b1('0x6b')]=function(_0x4fad16,_0xae7554){return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0x4fad16[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0xae7554,null))[_0x14b1('0x2b')](function(_0xd18a3a){if(_0xd18a3a){return db[_0x14b1('0x60')][_0x14b1('0x54')](function(_0x90861b){return db[_0x14b1('0x5c')]['findAll']({'where':{'userProfileId':_0x4fad16[_0x14b1('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x14b1('0x2b')](function(_0x2865dc){if(_0x2865dc){return db[_0x14b1('0x5c')][_0x14b1('0x5d')]({'where':{'userProfileId':_0x4fad16['params']['id'],'id':_['map'](_0x2865dc,function(_0x4759c1){return _0x4759c1['id'];})},'transaction':_0x90861b});}})[_0x14b1('0x2b')](function(_0x175984){var _0x1098c6=_['map'](_0x4fad16[_0x14b1('0x4e')],function(_0x4f5252){_0x4f5252[_0x14b1('0x5a')]=_0x4fad16[_0x14b1('0x49')]['id'];return _0x4f5252;});return db['UserProfileSection'][_0x14b1('0x6c')](_0x1098c6,{'raw':!![],'transaction':_0x90861b});})[_0x14b1('0x2b')](function(_0xbc0710){var _0x113339=_['filter'](_['map'](_0xbc0710,function(_0x790290){return _0x790290[_0x14b1('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x113339){return db[_0x14b1('0x5c')]['findAll']({'where':{'userProfileId':_0x4fad16[_0x14b1('0x49')]['id'],'sectionId':_['map'](_0x113339,function(_0x378596){return _0x378596[_0x14b1('0x58')];})},'attributes':['id',_0x14b1('0x58')],'raw':!![]})[_0x14b1('0x2b')](function(_0x299ca8){var _0x52cdce=_['map'](_0x4fad16[_0x14b1('0x4e')],function(_0x1f9cfe){_0x1f9cfe['userProfileId']=_0x4fad16[_0x14b1('0x49')]['id'];return _0x1f9cfe;});return db[_0x14b1('0x57')][_0x14b1('0x6c')](_0x52cdce,{'raw':!![],'transaction':_0x90861b});});}})[_0x14b1('0x47')](handleError(_0xae7554,null));});}})[_0x14b1('0x2b')](function(_0x27378f){var _0x50f3e7=_['map'](_0x27378f,function(_0x5613c3){return _0x5613c3[_0x14b1('0x50')]({'plain':!![]});});})['then'](respondWithResult(_0xae7554,null))[_0x14b1('0x47')](handleError(_0xae7554,null));};exports['removeResources']=function(_0x504c3f,_0x30427e,_0x34dddd){return db[_0x14b1('0x31')][_0x14b1('0x4c')]({'where':{'id':_0x504c3f[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](handleEntityNotFound(_0x30427e,null))[_0x14b1('0x2b')](function(_0xc0b385){if(_0xc0b385){return _0xc0b385[_0x14b1('0x6d')](_0x504c3f[_0x14b1('0x34')][_0x14b1('0x62')]);}})['then'](respondWithStatusCode(_0x30427e,null))[_0x14b1('0x47')](handleError(_0x30427e,null));};exports[_0x14b1('0x6e')]=function(_0xbac603,_0x374a56){var _0x17f085={};if(!_0xbac603[_0x14b1('0x34')][_0x14b1('0x6f')])throw new Error(_0x14b1('0x70'));if(!_0xbac603[_0x14b1('0x34')][_0x14b1('0x39')](_0x14b1('0x3a'))){_0x17f085[_0x14b1('0x24')]=qs[_0x14b1('0x24')](_0xbac603[_0x14b1('0x34')]['limit']);_0x17f085['offset']=qs[_0x14b1('0x22')](_0xbac603[_0x14b1('0x34')]['offset']);}return db['UserProfile'][_0x14b1('0x4c')]({'where':{'id':_0xbac603[_0x14b1('0x49')]['id']}})[_0x14b1('0x2b')](function(_0x55a4c0){if(!_0x55a4c0)throw new Error(_0x14b1('0x71')+_0xbac603[_0x14b1('0x49')]['id']);return db[_0x14b1('0x31')][_0x14b1('0x6e')](_0xbac603);})[_0x14b1('0x2b')](respondWithFilteredResult(_0x374a56,_0x17f085))[_0x14b1('0x47')](handleError(_0x374a56,null));};
\ No newline at end of file
+var _0x65cb=['keys','length','includeAll','options','find','create','body','params','get','createdAt','updatedAt','omit','sequelize','transaction','UserProfileSection','each','sectionId','Resources','UserProfileResource','describe','addSections','destroy','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show'];(function(_0x58ecb4,_0x2c03c4){var _0x4b2adc=function(_0x1f4ac0){while(--_0x1f4ac0){_0x58ecb4['push'](_0x58ecb4['shift']());}};_0x4b2adc(++_0x2c03c4);}(_0x65cb,0xa4));var _0xb65c=function(_0x43791a,_0x430599){_0x43791a=_0x43791a-0x0;var _0x370d6c=_0x65cb[_0x43791a];return _0x370d6c;};'use strict';var emlformat=require(_0xb65c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb65c('0x1'));var jsonpatch=require(_0xb65c('0x2'));var rp=require(_0xb65c('0x3'));var moment=require('moment');var BPromise=require(_0xb65c('0x4'));var Mustache=require(_0xb65c('0x5'));var util=require(_0xb65c('0x6'));var path=require(_0xb65c('0x7'));var sox=require(_0xb65c('0x8'));var csv=require('to-csv');var ejs=require(_0xb65c('0x9'));var fs=require('fs');var fs_extra=require(_0xb65c('0xa'));var _=require(_0xb65c('0xb'));var squel=require(_0xb65c('0xc'));var crypto=require(_0xb65c('0xd'));var jsforce=require(_0xb65c('0xe'));var deskjs=require(_0xb65c('0xf'));var toCsv=require(_0xb65c('0x10'));var querystring=require('querystring');var Papa=require(_0xb65c('0x11'));var Redis=require(_0xb65c('0x12'));var authService=require(_0xb65c('0x13'));var qs=require(_0xb65c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb65c('0x15'));var logger=require('../../config/logger')(_0xb65c('0x16'));var utils=require(_0xb65c('0x17'));var config=require(_0xb65c('0x18'));var licenseUtil=require(_0xb65c('0x19'));var db=require(_0xb65c('0x1a'))['db'];config[_0xb65c('0x1b')]=_['defaults'](config[_0xb65c('0x1b')],{'host':_0xb65c('0x1c'),'port':0x18eb});var socket=require(_0xb65c('0x1d'))(new Redis(config[_0xb65c('0x1b')]));require(_0xb65c('0x1e'))[_0xb65c('0x1f')](socket);function respondWithStatusCode(_0x2821e2,_0x48c337){_0x48c337=_0x48c337||0xcc;return function(_0x3bd91d){if(_0x3bd91d){return _0x2821e2[_0xb65c('0x20')](_0x48c337);}return _0x2821e2['status'](_0x48c337)[_0xb65c('0x21')]();};}function respondWithResult(_0x5c6d66,_0x32f4b5){_0x32f4b5=_0x32f4b5||0xc8;return function(_0x20b28e){if(_0x20b28e){return _0x5c6d66[_0xb65c('0x22')](_0x32f4b5)[_0xb65c('0x23')](_0x20b28e);}};}function respondWithFilteredResult(_0x24c1e2,_0x396eb2){return function(_0x1bca9d){if(_0x1bca9d){var _0x203c7b=typeof _0x396eb2[_0xb65c('0x24')]===_0xb65c('0x25')&&typeof _0x396eb2[_0xb65c('0x26')]===_0xb65c('0x25');var _0x2fe603=_0x1bca9d[_0xb65c('0x27')];var _0x1d36f9=_0x203c7b?0x0:_0x396eb2['offset'];var _0x2d54fc=_0x203c7b?_0x1bca9d[_0xb65c('0x27')]:_0x396eb2[_0xb65c('0x24')]+_0x396eb2[_0xb65c('0x26')];var _0x37b944;if(_0x2d54fc>=_0x2fe603){_0x2d54fc=_0x2fe603;_0x37b944=0xc8;}else{_0x37b944=0xce;}_0x24c1e2[_0xb65c('0x22')](_0x37b944);return _0x24c1e2[_0xb65c('0x28')](_0xb65c('0x29'),_0x1d36f9+'-'+_0x2d54fc+'/'+_0x2fe603)[_0xb65c('0x23')](_0x1bca9d);}return null;};}function patchUpdates(_0x33fa4c){return function(_0x1730ad){try{jsonpatch[_0xb65c('0x2a')](_0x1730ad,_0x33fa4c,!![]);}catch(_0xd04d5){return BPromise[_0xb65c('0x2b')](_0xd04d5);}return _0x1730ad[_0xb65c('0x2c')]();};}function saveUpdates(_0x5ed03,_0x108eb9){return function(_0x4ad9e4){if(_0x4ad9e4){return _0x4ad9e4[_0xb65c('0x2d')](_0x5ed03)[_0xb65c('0x2e')](function(_0x29c0c0){return _0x29c0c0;});}return null;};}function removeEntity(_0x585f93,_0x1b7e00){return function(_0x4c5627){if(_0x4c5627){return _0x4c5627['destroy']()['then'](function(){_0x585f93[_0xb65c('0x22')](0xcc)[_0xb65c('0x21')]();});}};}function handleEntityNotFound(_0xeb8e29,_0xc65b5a){return function(_0x4a9b0c){if(!_0x4a9b0c){_0xeb8e29[_0xb65c('0x20')](0x194);}return _0x4a9b0c;};}function handleError(_0x186f32,_0x3e372d){_0x3e372d=_0x3e372d||0x1f4;return function(_0x21cb9c){logger[_0xb65c('0x2f')](_0x21cb9c[_0xb65c('0x30')]);if(_0x21cb9c['name']){delete _0x21cb9c[_0xb65c('0x31')];}_0x186f32[_0xb65c('0x22')](_0x3e372d)[_0xb65c('0x32')](_0x21cb9c);};}exports['index']=function(_0x44fe3b,_0x5f5ca7){var _0x393320={},_0x1284cd={},_0x48eb26={'count':0x0,'rows':[]};var _0x123cf4=_[_0xb65c('0x33')](db[_0xb65c('0x34')][_0xb65c('0x35')],function(_0x1b3240){return{'name':_0x1b3240[_0xb65c('0x36')],'type':_0x1b3240[_0xb65c('0x37')][_0xb65c('0x38')]};});_0x1284cd['model']=_[_0xb65c('0x33')](_0x123cf4,_0xb65c('0x31'));_0x1284cd[_0xb65c('0x39')]=_['keys'](_0x44fe3b['query']);_0x1284cd[_0xb65c('0x3a')]=_['intersection'](_0x1284cd[_0xb65c('0x3b')],_0x1284cd['query']);_0x393320[_0xb65c('0x3c')]=_[_0xb65c('0x3d')](_0x1284cd[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x44fe3b['query'][_0xb65c('0x3e')]));_0x393320['attributes']=_0x393320[_0xb65c('0x3c')]['length']?_0x393320[_0xb65c('0x3c')]:_0x1284cd[_0xb65c('0x3b')];if(!_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x3f')]('nolimit')){_0x393320[_0xb65c('0x26')]=qs[_0xb65c('0x26')](_0x44fe3b[_0xb65c('0x39')]['limit']);_0x393320[_0xb65c('0x24')]=qs[_0xb65c('0x24')](_0x44fe3b['query']['offset']);}_0x393320[_0xb65c('0x40')]=qs[_0xb65c('0x41')](_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x41')]);_0x393320['where']=qs[_0xb65c('0x3a')](_[_0xb65c('0x42')](_0x44fe3b[_0xb65c('0x39')],_0x1284cd[_0xb65c('0x3a')]),_0x123cf4);if(_0x44fe3b['query'][_0xb65c('0x43')]){_0x393320[_0xb65c('0x44')]=_[_0xb65c('0x45')](_0x393320[_0xb65c('0x44')],{'$or':_[_0xb65c('0x33')](_0x123cf4,function(_0x12a8c0){if(_0x12a8c0[_0xb65c('0x37')]!==_0xb65c('0x46')){var _0xc83cb3={};_0xc83cb3[_0x12a8c0[_0xb65c('0x31')]]={'$like':'%'+_0x44fe3b[_0xb65c('0x39')][_0xb65c('0x43')]+'%'};return _0xc83cb3;}})});}_0x393320=_[_0xb65c('0x45')]({},_0x393320,_0x44fe3b['options']);var _0x4c9bd9={'where':_0x393320[_0xb65c('0x44')]};return db[_0xb65c('0x34')][_0xb65c('0x27')](_0x4c9bd9)['then'](function(_0x42acd6){_0x48eb26[_0xb65c('0x27')]=_0x42acd6;if(_0x44fe3b['query']['includeAll']){_0x393320[_0xb65c('0x47')]=[{'all':!![]}];}return db[_0xb65c('0x34')][_0xb65c('0x48')](_0x393320);})[_0xb65c('0x2e')](function(_0x199625){_0x48eb26[_0xb65c('0x49')]=_0x199625;return _0x48eb26;})['then'](respondWithFilteredResult(_0x5f5ca7,_0x393320))[_0xb65c('0x4a')](handleError(_0x5f5ca7,null));};exports[_0xb65c('0x4b')]=function(_0x2a384d,_0x8300c2){var _0x3851fa={'raw':![],'where':{'id':_0x2a384d['params']['id']}},_0x169b7f={};_0x169b7f[_0xb65c('0x3b')]=_[_0xb65c('0x4c')](db[_0xb65c('0x34')][_0xb65c('0x35')]);_0x169b7f[_0xb65c('0x39')]=_['keys'](_0x2a384d[_0xb65c('0x39')]);_0x169b7f[_0xb65c('0x3a')]=_[_0xb65c('0x3d')](_0x169b7f[_0xb65c('0x3b')],_0x169b7f[_0xb65c('0x39')]);_0x3851fa['attributes']=_['intersection'](_0x169b7f[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x2a384d[_0xb65c('0x39')][_0xb65c('0x3e')]));_0x3851fa['attributes']=_0x3851fa[_0xb65c('0x3c')][_0xb65c('0x4d')]?_0x3851fa['attributes']:_0x169b7f[_0xb65c('0x3b')];if(_0x2a384d['query'][_0xb65c('0x4e')]){_0x3851fa[_0xb65c('0x47')]=[{'all':!![]}];}_0x3851fa=_[_0xb65c('0x45')]({},_0x3851fa,_0x2a384d[_0xb65c('0x4f')]);return db['UserProfile'][_0xb65c('0x50')](_0x3851fa)[_0xb65c('0x2e')](handleEntityNotFound(_0x8300c2,null))[_0xb65c('0x2e')](respondWithResult(_0x8300c2,null))[_0xb65c('0x4a')](handleError(_0x8300c2,null));};exports[_0xb65c('0x51')]=function(_0x5e81e2,_0x481d4d){return db[_0xb65c('0x34')][_0xb65c('0x51')](_0x5e81e2[_0xb65c('0x52')],{})['then'](respondWithResult(_0x481d4d,0xc9))[_0xb65c('0x4a')](handleError(_0x481d4d,null));};exports['clone']=function(_0x2ca61f,_0x488f34){var _0x489eb3={'where':{'id':_0x2ca61f[_0xb65c('0x53')]['id']}},_0x50f16d={};_0x50f16d['model']=_['keys'](db[_0xb65c('0x34')][_0xb65c('0x35')]);_0x489eb3[_0xb65c('0x3c')]=_[_0xb65c('0x3d')](_0x50f16d[_0xb65c('0x3b')],qs[_0xb65c('0x3e')](_0x2ca61f['query']['fields']));_0x489eb3[_0xb65c('0x3c')]=_0x489eb3[_0xb65c('0x3c')]['length']?_0x489eb3[_0xb65c('0x3c')]:_0x50f16d[_0xb65c('0x3b')];if(_0x2ca61f[_0xb65c('0x39')]['includeAll']){_0x489eb3[_0xb65c('0x47')]=[{'all':!![]}];}_0x489eb3=_['merge']({},_0x489eb3,_0x2ca61f[_0xb65c('0x4f')]);return db[_0xb65c('0x34')][_0xb65c('0x50')](_0x489eb3)['then'](handleEntityNotFound(_0x488f34,null))['then'](function(_0x852886){if(_0x852886){var _0x1d3664=_0x852886[_0xb65c('0x54')]({'plain':!![]});_0x1d3664=qs['omit'](_0x1d3664,['id',_0xb65c('0x55'),_0xb65c('0x56'),'crudPermissions']);_0x2ca61f[_0xb65c('0x52')]=_[_0xb65c('0x57')](_0x2ca61f['body'],['id',_0xb65c('0x55'),_0xb65c('0x56')]);return db[_0xb65c('0x58')][_0xb65c('0x59')](function(_0x4f3af4){return db[_0xb65c('0x34')]['create'](_['merge'](_0x1d3664,_0x2ca61f[_0xb65c('0x52')]),{'include':_0x2ca61f[_0xb65c('0x39')][_0xb65c('0x4e')]?[{'all':!![]}]:undefined,'transaction':_0x4f3af4})[_0xb65c('0x2e')](function(_0x2677ad){var _0x3585d7=_0x2677ad[_0xb65c('0x54')]({'plain':!![]});return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x2ca61f['params']['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x584c2c){if(_0x584c2c){return BPromise[_0xb65c('0x5b')](_0x584c2c,function(_0x39fa16){return new BPromise(function(_0x866214,_0x76a3bd){if(_0x39fa16['autoAssociation']===null||_0x39fa16['autoAssociation']===0x1)_0x866214(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x39fa16['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x53605d){var _0x56727b=_['map'](_0x53605d,function(_0x3843de){return qs[_0xb65c('0x57')](_0x3843de,['id','createdAt',_0xb65c('0x56'),_0xb65c('0x5c')]);});_0x866214(_0x56727b);})['catch'](function(_0x48004c){_0x76a3bd(_0x48004c);});})[_0xb65c('0x2e')](function(_0x2634ab){var _0x4214ce=qs[_0xb65c('0x57')](_0x39fa16,['id','createdAt',_0xb65c('0x56')]);_0x4214ce['userProfileId']=_0x3585d7['id'];if(_0x2634ab)_0x4214ce[_0xb65c('0x5d')]=_0x2634ab;return _0x4214ce;})['then'](function(_0x359162){return db['UserProfileSection'][_0xb65c('0x51')](_0x359162,{'include':[{'model':db[_0xb65c('0x5e')],'as':_0xb65c('0x5d')}],'raw':!![],'transaction':_0x4f3af4});});})[_0xb65c('0x2e')](function(){return _0x3585d7;});}});});});}})[_0xb65c('0x2e')](respondWithResult(_0x488f34,0xc9))[_0xb65c('0x4a')](handleError(_0x488f34,null));};exports[_0xb65c('0x2d')]=function(_0x51e8f8,_0x4e17b2){if(_0x51e8f8[_0xb65c('0x52')]['id']){delete _0x51e8f8[_0xb65c('0x52')]['id'];}return db['UserProfile'][_0xb65c('0x50')]({'where':{'id':_0x51e8f8[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x4e17b2,null))['then'](saveUpdates(_0x51e8f8[_0xb65c('0x52')],null))[_0xb65c('0x2e')](respondWithResult(_0x4e17b2,null))[_0xb65c('0x4a')](handleError(_0x4e17b2,null));};exports['destroy']=function(_0x56fdee,_0x12616a){return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x56fdee['params']['id']}})['then'](handleEntityNotFound(_0x12616a,null))[_0xb65c('0x2e')](removeEntity(_0x12616a,null))['catch'](handleError(_0x12616a,null));};exports[_0xb65c('0x5f')]=function(_0x619b13,_0x3dcc4b){return db[_0xb65c('0x34')][_0xb65c('0x5f')]()[_0xb65c('0x2e')](respondWithResult(_0x3dcc4b,null))[_0xb65c('0x4a')](handleError(_0x3dcc4b,null));};exports[_0xb65c('0x60')]=function(_0x5c5e55,_0x24f043){var _0x593af0=_0x5c5e55[_0xb65c('0x52')];return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x5c5e55['params']['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x24f043,null))[_0xb65c('0x2e')](function(_0x128a4e){if(_0x128a4e){return db[_0xb65c('0x58')][_0xb65c('0x59')](function(_0x683a98){return db[_0xb65c('0x5a')][_0xb65c('0x61')]({'where':{'userProfileId':_0x5c5e55[_0xb65c('0x53')]['id'],'sectionId':_['map'](_0x593af0,function(_0x3017fc){return _0x3017fc[_0xb65c('0x5c')];})},'transaction':_0x683a98})[_0xb65c('0x2e')](function(){var _0x10eaff=_[_0xb65c('0x33')](_0x593af0,function(_0x4611c5){_0x4611c5[_0xb65c('0x62')]=_0x5c5e55['params']['id'];return _0x4611c5;});var _0x4807ab=[];return BPromise[_0xb65c('0x5b')](_0x10eaff,function(_0x1c4ecf){return db['UserProfileSection'][_0xb65c('0x51')](_0x1c4ecf,{'include':[{'model':db[_0xb65c('0x5e')],'as':_0xb65c('0x5d')}],'raw':!![],'transaction':_0x683a98})[_0xb65c('0x2e')](function(_0xa78dd7){_0x4807ab[_0xb65c('0x63')](_0xa78dd7[_0xb65c('0x54')]({'plain':!![]}));});})[_0xb65c('0x2e')](function(){return _0x4807ab;});});});}})[_0xb65c('0x2e')](function(_0x4da99a){return _0x4da99a;})[_0xb65c('0x2e')](respondWithResult(_0x24f043,null))[_0xb65c('0x4a')](handleError(_0x24f043,null));};exports[_0xb65c('0x64')]=function(_0x3231c8,_0x1b7ff6){var _0x886490;return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x3231c8[_0xb65c('0x53')]['id']},'attributes':['id',_0xb65c('0x31')]})['then'](handleEntityNotFound(_0x1b7ff6,null))[_0xb65c('0x2e')](function(_0x289919){if(_0x289919){_0x886490=_0x289919;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3231c8[_0xb65c('0x53')]['id'],'sectionId':_0x3231c8[_0xb65c('0x39')][_0xb65c('0x65')]}});}})[_0xb65c('0x2e')](function(){return _0x886490;})[_0xb65c('0x2e')](respondWithStatusCode(_0x1b7ff6,null))[_0xb65c('0x4a')](handleError(_0x1b7ff6,null));};exports[_0xb65c('0x66')]=function(_0x48fcdb,_0x1228d9){var _0x158d91=[];var _0x5779ba=[];return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x48fcdb[_0xb65c('0x53')]['id']},'raw':!![]})['then'](function(_0x134248){_0x158d91=_['filter'](_0x134248,function(_0x5ee546){return _0x5ee546[_0xb65c('0x67')]===0x1||_[_0xb65c('0x68')]([0x3eb,0x709],_0x5ee546[_0xb65c('0x5c')]);});if(!_[_0xb65c('0x69')](_0x158d91)){return _[_0xb65c('0x33')](_0x158d91,function(_0x44cb52){return _0x44cb52[_0xb65c('0x5c')];});}else{return;}})['then'](function(_0x3c3b18){if(_0x3c3b18)_0x5779ba=_0x3c3b18;if(_['includes'](_0x5779ba,0x64)){var _0x306999=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x64});return hasDefaultDashboard(_0x306999)[_0xb65c('0x2e')](function(_0x997f9a){return _['map'](_0x158d91,function(_0x59f5f6){if(_0x59f5f6['sectionId']===0x64){_0x59f5f6[_0xb65c('0x6a')]=_0x997f9a;}return _0x59f5f6;});});}else{return;}})['then'](function(_0xf4eb64){if(_0xf4eb64)_0x158d91=_0xf4eb64;if(_[_0xb65c('0x68')](_0x5779ba,0x3eb)){var _0x2f8b7=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x3eb});return getCustomDashboards(_0x2f8b7)[_0xb65c('0x2e')](function(_0x1bbe90){return _[_0xb65c('0x33')](_0x158d91,function(_0x3bbfe7){if(_0x2f8b7[_0xb65c('0x67')]){if(_0x3bbfe7[_0xb65c('0x5c')]===0x3eb){_0x3bbfe7['subsections']=_0x1bbe90;}}else{if(_0x3bbfe7[_0xb65c('0x5c')]===0x64){_0x3bbfe7[_0xb65c('0x6a')]=_0x1bbe90;}}return _0x3bbfe7;});});}else{return;}})[_0xb65c('0x2e')](function(_0x398702){if(_0x398702)_0x158d91=_0x398702;if(_['includes'](_0x5779ba,0x709)){var _0x298722=_[_0xb65c('0x50')](_0x158d91,{'sectionId':0x709});return getPlugins(_0x298722)[_0xb65c('0x2e')](function(_0x318edf){if(_0x298722[_0xb65c('0x67')]){return _[_0xb65c('0x33')](_0x158d91,function(_0x14370b){if(_0x14370b[_0xb65c('0x5c')]===0x709){_0x14370b[_0xb65c('0x6a')]=_0x318edf;}return _0x14370b;});}else{var _0x113002={'sectionId':0x76c,'enabled':0x1,'subsections':_0x318edf};var _0x5b9e8d=_[_0xb65c('0x33')](_0x158d91);_0x5b9e8d[_0xb65c('0x63')](_0x113002);return _0x5b9e8d;}});}else{return;}})[_0xb65c('0x2e')](function(_0x4da2c0){if(_0x4da2c0)_0x158d91=_0x4da2c0;return _[_0xb65c('0x43')](_0x158d91,[_0xb65c('0x67'),0x1]);})[_0xb65c('0x2e')](respondWithResult(_0x1228d9,null))[_0xb65c('0x4a')](handleError(_0x1228d9,null));};function hasDefaultDashboard(_0x48f783){var _0x36be93=[0x65];return new BPromise(function(_0x128d17,_0x2e4f95){try{if(_0x48f783[_0xb65c('0x6b')]){_0x128d17(_0x36be93);}else{return db[_0xb65c('0x5e')][_0xb65c('0x6c')]({'where':{'sectionId':_0x48f783['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x3ab9c5){_0x3ab9c5?_0x128d17(_0x36be93):_0x128d17();});}}catch(_0x246a8b){_0x2e4f95(_0x246a8b);}});}function getCustomDashboards(_0x4afbb9){var _0xebb714=[];return new BPromise(function(_0xb31b06,_0x3a26e6){try{if(_0x4afbb9['autoAssociation']){return db[_0xb65c('0x6d')][_0xb65c('0x48')]({'raw':!![]})['then'](function(_0x1bca4b){_0x1bca4b[_0xb65c('0x6e')](function(_0x297efe){_0xebb714['push'](_0x297efe['id']+0x1869f);});_0xb31b06(_0xebb714);});}else{return db[_0xb65c('0x5e')]['findAll']({'where':{'sectionId':_0x4afbb9['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x1a9a26){_0x1a9a26[_0xb65c('0x6e')](function(_0x16c1f6){_0xebb714[_0xb65c('0x63')](_0x16c1f6[_0xb65c('0x6f')]+0x1869f);});_0xb31b06(_0xebb714);});}}catch(_0x37e121){_0x3a26e6(_0x37e121);}});}function getPlugins(_0x2cfc0b){var _0x33635c=[];return new BPromise(function(_0x56317c,_0x1fae00){try{if(_0x2cfc0b[_0xb65c('0x6b')]){return db[_0xb65c('0x70')][_0xb65c('0x48')]({'raw':!![]})['then'](function(_0x3f916f){_0x3f916f[_0xb65c('0x6e')](function(_0x35ef01){_0x33635c[_0xb65c('0x63')](_0x35ef01['id']+0x15b38);});_0x56317c(_0x33635c);});}else{return db['UserProfileResource'][_0xb65c('0x48')]({'where':{'sectionId':_0x2cfc0b['id']},'raw':!![]})[_0xb65c('0x2e')](function(_0x13afb6){_0x13afb6[_0xb65c('0x6e')](function(_0x560eac){_0x33635c[_0xb65c('0x63')](_0x560eac[_0xb65c('0x6f')]+0x15b38);});_0x56317c(_0x33635c);});}}catch(_0x51f2c6){_0x1fae00(_0x51f2c6);}});}exports[_0xb65c('0x71')]=function(_0x3c35ce,_0x1fc361){return db[_0xb65c('0x34')]['find']({'where':{'id':_0x3c35ce[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x1fc361,null))[_0xb65c('0x2e')](function(_0x1e79f5){if(_0x1e79f5){return db[_0xb65c('0x58')]['transaction'](function(_0x2c098c){return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id']},'attributes':['id'],'raw':!![]})[_0xb65c('0x2e')](function(_0x5e0970){if(_0x5e0970){return db[_0xb65c('0x5a')]['destroy']({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id'],'id':_['map'](_0x5e0970,function(_0x273495){return _0x273495['id'];})},'transaction':_0x2c098c});}})['then'](function(_0x5d506f){var _0xee82a3=_[_0xb65c('0x33')](_0x3c35ce[_0xb65c('0x52')],function(_0x164aed){_0x164aed[_0xb65c('0x62')]=_0x3c35ce[_0xb65c('0x53')]['id'];return _0x164aed;});return db[_0xb65c('0x5a')]['bulkCreate'](_0xee82a3,{'raw':!![],'transaction':_0x2c098c});})['then'](function(_0x3c63de){var _0x1f693d=_['filter'](_['map'](_0x3c63de,function(_0x53396c){return _0x53396c[_0xb65c('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x1f693d){return db[_0xb65c('0x5a')][_0xb65c('0x48')]({'where':{'userProfileId':_0x3c35ce[_0xb65c('0x53')]['id'],'sectionId':_['map'](_0x1f693d,function(_0x42b1cb){return _0x42b1cb[_0xb65c('0x5c')];})},'attributes':['id',_0xb65c('0x5c')],'raw':!![]})[_0xb65c('0x2e')](function(_0x8a1a1b){var _0x223515=_[_0xb65c('0x33')](_0x3c35ce[_0xb65c('0x52')],function(_0x2f8049){_0x2f8049[_0xb65c('0x62')]=_0x3c35ce[_0xb65c('0x53')]['id'];return _0x2f8049;});return db[_0xb65c('0x5e')][_0xb65c('0x72')](_0x223515,{'raw':!![],'transaction':_0x2c098c});});}})['catch'](handleError(_0x1fc361,null));});}})[_0xb65c('0x2e')](function(_0x2ca2a7){var _0x36726e=_[_0xb65c('0x33')](_0x2ca2a7,function(_0x2baef2){return _0x2baef2['get']({'plain':!![]});});})['then'](respondWithResult(_0x1fc361,null))[_0xb65c('0x4a')](handleError(_0x1fc361,null));};exports[_0xb65c('0x73')]=function(_0x1ddbb6,_0x179a2f,_0x47bc88){return db[_0xb65c('0x34')]['find']({'where':{'id':_0x1ddbb6[_0xb65c('0x53')]['id']}})[_0xb65c('0x2e')](handleEntityNotFound(_0x179a2f,null))['then'](function(_0xde12a8){if(_0xde12a8){return _0xde12a8['removeResources'](_0x1ddbb6[_0xb65c('0x39')]['ids']);}})[_0xb65c('0x2e')](respondWithStatusCode(_0x179a2f,null))['catch'](handleError(_0x179a2f,null));};exports[_0xb65c('0x74')]=function(_0x49a0bc,_0x3f6c2b){var _0x4ddaa5={};if(!_0x49a0bc[_0xb65c('0x39')]['section'])throw new Error(_0xb65c('0x75'));if(!_0x49a0bc[_0xb65c('0x39')][_0xb65c('0x3f')](_0xb65c('0x76'))){_0x4ddaa5[_0xb65c('0x26')]=qs[_0xb65c('0x26')](_0x49a0bc[_0xb65c('0x39')]['limit']);_0x4ddaa5[_0xb65c('0x24')]=qs[_0xb65c('0x24')](_0x49a0bc[_0xb65c('0x39')]['offset']);}return db[_0xb65c('0x34')][_0xb65c('0x50')]({'where':{'id':_0x49a0bc[_0xb65c('0x53')]['id']}})['then'](function(_0x574d34){if(!_0x574d34)throw new Error(_0xb65c('0x77')+_0x49a0bc[_0xb65c('0x53')]['id']);return db[_0xb65c('0x34')]['getResources'](_0x49a0bc);})[_0xb65c('0x2e')](respondWithFilteredResult(_0x3f6c2b,_0x4ddaa5))['catch'](handleError(_0x3f6c2b,null));};
\ No newline at end of file
index af44dfc..8d9ed0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1228=['UserProfile','save','update','remove','emit','hook','exports','events'];(function(_0x3bf802,_0x2043c0){var _0x5b820a=function(_0x1f57d9){while(--_0x1f57d9){_0x3bf802['push'](_0x3bf802['shift']());}};_0x5b820a(++_0x2043c0);}(_0x1228,0x12f));var _0x8122=function(_0x2923b8,_0x1dba92){_0x2923b8=_0x2923b8-0x0;var _0x25659a=_0x1228[_0x2923b8];return _0x25659a;};'use strict';var EventEmitter=require(_0x8122('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x8122('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8122('0x2'),'afterUpdate':_0x8122('0x3'),'afterDestroy':_0x8122('0x4')};function emitEvent(_0x49a540){return function(_0x762ce4,_0xf4d3e5,_0x4de3a0){UserProfileEvents[_0x8122('0x5')](_0x49a540+':'+_0x762ce4['id'],_0x762ce4);UserProfileEvents[_0x8122('0x5')](_0x49a540,_0x762ce4);_0x4de3a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x8122('0x6')](e,emitEvent(event));}}module[_0x8122('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0xdbb1=['exports','events','save','hasOwnProperty','hook'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xdbb1,0x105));var _0x1dbb=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xdbb1[_0x231e16];return _0x570a7c;};'use strict';var EventEmitter=require(_0x1dbb('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1dbb('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x395788){return function(_0x483e15,_0xa1e321,_0xd53e45){UserProfileEvents['emit'](_0x395788+':'+_0x483e15['id'],_0x483e15);UserProfileEvents['emit'](_0x395788,_0x483e15);_0xd53e45(null);};}for(var e in events){if(events[_0x1dbb('0x2')](e)){var event=events[e];UserProfile[_0x1dbb('0x3')](e,emitEvent(event));}}module[_0x1dbb('0x4')]=UserProfileEvents;
\ No newline at end of file
index 70fe634..b7d54c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e24=['squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','VoiceQueue','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','union','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','where','pick','merge','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','options','autoAssociation','includeAll','include','default','CustomReports','count','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','fax','mail','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','map','catch','field','model','findAll','associatedResources','name','resolve','UserProfileResource','resourceId','type','toLowerCase'];(function(_0x3f5d69,_0x39e054){var _0x14f758=function(_0x1cd3c1){while(--_0x1cd3c1){_0x3f5d69['push'](_0x3f5d69['shift']());}};_0x14f758(++_0x39e054);}(_0x3e24,0x167));var _0x43e2=function(_0x419ffd,_0x10bdfe){_0x419ffd=_0x419ffd-0x0;var _0xb0b19d=_0x3e24[_0x419ffd];return _0xb0b19d;};'use strict';var _=require(_0x43e2('0x0'));var attributes=require(_0x43e2('0x1'));var qs=require(_0x43e2('0x2'));var squel=require(_0x43e2('0x3'));module[_0x43e2('0x4')]=function(_0x582ca4){var _0x2f7153=_0x582ca4[_0x43e2('0x5')];function _0x5d2806(_0x1dd127,_0x18629c){return new Promise(function(_0x1a89fc,_0x28b144){if(!_0x18629c)return _0x1a89fc(null);var _0x43b5a7=_0x18629c[_0x43e2('0x6')]?{[_0x18629c[_0x43e2('0x6')]['field']]:_0x18629c[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x1dd127]['findAll']({'where':_0x43b5a7,'raw':!![]})[_0x43e2('0x8')](function(_0x2fdf85){_0x18629c['associatedResources']=_[_0x43e2('0x9')](_0x2fdf85,'id');_0x1a89fc(_0x18629c);})[_0x43e2('0xa')](function(_0x52146c){_0x28b144(_0x52146c);});});}function _0x45848e(_0x48c5f3,_0x547723){return new Promise(function(_0x5847f0,_0x103220){var _0x33dbcb=_0x48c5f3[_0x43e2('0x6')]?{[_0x48c5f3[_0x43e2('0x6')][_0x43e2('0xb')]]:_0x48c5f3[_0x43e2('0x6')][_0x43e2('0x7')]}:undefined;return _0x2f7153[_0x48c5f3[_0x43e2('0xc')]][_0x43e2('0xd')]({'where':_0x33dbcb,'raw':!![]})[_0x43e2('0x8')](function(_0x377097){_0x547723[_0x43e2('0xe')]=_['map'](_0x377097,function(_0x376bba){return _0x376bba[_0x43e2('0xf')];});_0x5847f0(_0x547723);})[_0x43e2('0xa')](function(_0x2a0fb0){_0x103220(_0x2a0fb0);});});}function _0x5cea01(_0x4a6443,_0x241da2,_0x417ce5){if(!_0x241da2)return Promise[_0x43e2('0x10')](null);return new Promise(function(_0x3a27eb,_0x105cb8){return _0x2f7153[_0x43e2('0x11')][_0x43e2('0xd')]({'where':{'sectionId':_0x241da2['id']},'raw':!![]})[_0x43e2('0x8')](function(_0x3236b9){if(_0x4a6443[_0x43e2('0xb')]&&_0x4a6443['field']!=='id'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x4de509){return _0x4de509[_0x4a6443[_0x43e2('0xb')]];});}else{if(_0x417ce5==='AnalyticExtractedReport'){_0x241da2[_0x43e2('0xe')]=_[_0x43e2('0x9')](_0x3236b9,function(_0x1fac53){return{'id':_0x1fac53[_0x43e2('0x12')],'type':_0x1fac53[_0x43e2('0x13')]};});}else{_0x241da2['associatedResources']=_[_0x43e2('0x9')](_0x3236b9,function(_0x12d842){return _0x12d842[_0x43e2('0x12')];});}}_0x3a27eb(_0x241da2);})['catch'](function(_0x234a1d){_0x105cb8(_0x234a1d);});});}function _0x32f048(_0x43078f,_0x11b285){var _0x4f20e6={'parentSections':[]};switch(_0x43078f[_0x43e2('0x14')]()){case _0x43e2('0x15'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x17');break;case _0x43e2('0x18'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x19');break;case _0x43e2('0x1a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x1b');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x1d'),'field':'name','foreignKey':_0x43e2('0x1e')}];break;case _0x43e2('0x1f'):_0x4f20e6['childModel']=_0x43e2('0x20');break;case _0x43e2('0x21'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x22');_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Lists','field':'id','foreignKey':_0x43e2('0x23')}];break;case _0x43e2('0x24'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x25');break;case _0x43e2('0x26'):_0x4f20e6[_0x43e2('0x16')]='CmCompany';break;case'globalcustomfields':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x27');break;case _0x43e2('0x28'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x29');break;case'chatwebsites':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2a');break;case _0x43e2('0x2b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x2c');break;case _0x43e2('0x2d'):_0x4f20e6[_0x43e2('0x16')]='FaxAccount';break;case'inboundroutes':case _0x43e2('0x2e'):case _0x43e2('0x2f'):_0x4f20e6['childModel']=_0x43e2('0x30');break;case _0x43e2('0x31'):_0x4f20e6['childModel']=_0x43e2('0x32');break;case'voicemails':_0x4f20e6['childModel']='VoiceMail';break;case _0x43e2('0x33'):_0x4f20e6['childModel']=_0x43e2('0x34');_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x35'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x39')]}},{'name':_0x43e2('0x3a'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x36'),'model':_0x43e2('0x37'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x3b')]}},{'name':_0x43e2('0x3c'),'field':_0x43e2('0xf'),'foreignKey':_0x43e2('0x3d'),'model':'VoiceQueue','filter':{'field':'type','value':['inbound']}},{'name':_0x43e2('0x3e'),'field':_0x43e2('0xf'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x43e2('0x13'),'value':[_0x43e2('0x3f')]}}];break;case _0x43e2('0x40'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x41');break;case _0x43e2('0x42'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x43');break;case _0x43e2('0x44'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x45');break;case _0x43e2('0x46'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x47');break;case'mailqueues':_0x4f20e6[_0x43e2('0x16')]='MailQueue';break;case _0x43e2('0x48'):_0x4f20e6['childModel']=_0x43e2('0x49');break;case _0x43e2('0x4a'):_0x4f20e6[_0x43e2('0x16')]='MailSubstatus';break;case _0x43e2('0x4b'):_0x4f20e6['childModel']=_0x43e2('0x4c');break;case _0x43e2('0x4d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x4e');break;case'smsqueues':_0x4f20e6['childModel']=_0x43e2('0x4f');break;case _0x43e2('0x50'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x51');break;case'whatsappqueues':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x52');break;case _0x43e2('0x53'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x54');break;case'teams':_0x4f20e6[_0x43e2('0x16')]='Team';break;case _0x43e2('0x55'):case _0x43e2('0x56'):_0x4f20e6['childModel']=_0x43e2('0x57');if(_0x11b285){_0x4f20e6['parentSections']=[{'name':'VoiceQueues'},{'name':_0x43e2('0x3e')}];}break;case _0x43e2('0x58'):case _0x43e2('0x59'):case _0x43e2('0x5a'):_0x4f20e6[_0x43e2('0x16')]='User';if(_0x11b285){_0x4f20e6[_0x43e2('0x1c')]=[{'name':_0x43e2('0x5b'),'filter':{'field':_0x43e2('0x38'),'value':[_0x43e2('0x5c'),_0x43e2('0x5d')]},'ignore':!![]},{'name':_0x43e2('0x35')},{'name':_0x43e2('0x3a')}];}break;case _0x43e2('0x5e'):_0x4f20e6['childModel']=_0x43e2('0x5f');break;case _0x43e2('0x60'):_0x4f20e6['childModel']=_0x43e2('0x61');break;case _0x43e2('0x62'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x63');break;case'sugarcrmaccounts':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x64');break;case _0x43e2('0x65'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x66');break;case'zohoaccounts':_0x4f20e6['childModel']=_0x43e2('0x67');break;case _0x43e2('0x68'):_0x4f20e6['childModel']=_0x43e2('0x37');break;case _0x43e2('0x69'):_0x4f20e6[_0x43e2('0x16')]='CannedAnswer';break;case'dispositions':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6a');break;case _0x43e2('0x6b'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6c');break;case _0x43e2('0x6d'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x6e');break;case _0x43e2('0x6f'):_0x4f20e6['childModel']=_0x43e2('0x70');break;case'scheduler':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x71');break;case _0x43e2('0x72'):_0x4f20e6['childModel']=_0x43e2('0x73');break;case _0x43e2('0x74'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x75');break;case _0x43e2('0x76'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x77');break;case _0x43e2('0x78'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x79');break;case _0x43e2('0x7a'):_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7b');break;case'variables':_0x4f20e6['childModel']='Variable';break;case'plugins':_0x4f20e6['childModel']='Plugin';break;case _0x43e2('0x7c'):_0x4f20e6['childModel']='AnalyticExtractedReport';_0x4f20e6[_0x43e2('0x1c')]=[{'name':'Reports','field':'id','foreignKey':_0x43e2('0x7d')}];break;case'metrics':_0x4f20e6[_0x43e2('0x16')]=_0x43e2('0x7e');break;}return _0x4f20e6;}function _0x1d8647(_0x4cfd0b,_0x21d35d){var _0x13685a=_0x4cfd0b[_0x43e2('0x7f')](0x0)[_0x43e2('0x80')]()+_0x4cfd0b[_0x43e2('0x81')](0x1);var _0x238517={'type':_0x2f7153['Sequelize'][_0x43e2('0x82')][_0x43e2('0x83')],'raw':!![]};return new Promise(function(_0x5b4161,_0x2a795d){var _0x57c7b3=squel['select']()['field']('ui.'+_0x13685a+'InteractionId','id')[_0x43e2('0xb')](_0x43e2('0x84'))[_0x43e2('0x85')](_0x43e2('0x86')+_0x4cfd0b+'_interactions','ui')['where'](_0x43e2('0x87'),_0x21d35d['id']);return _0x2f7153[_0x43e2('0x88')][_0x43e2('0x89')](_0x57c7b3[_0x43e2('0x8a')](),_0x238517)[_0x43e2('0x8')](function(_0x25037d){_0x21d35d[_0x13685a+_0x43e2('0x8b')]=_0x25037d;_0x5b4161(_0x25037d);})[_0x43e2('0xa')](function(_0x2eb2aa){_0x2a795d(_0x2eb2aa);});});}return _0x582ca4[_0x43e2('0x8c')](_0x43e2('0x8d'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e86fb){var _0x477c5f={'raw':![],'where':{}};var _0x139cae={};var _0x30c8f5={'count':0x0,'rows':[]};var _0x1c0a77=_0x2e86fb['query'][_0x43e2('0x8e')];var _0x27e555=_0x2e86fb['query'][_0x43e2('0x8f')]||![];var _0x483315=_0x32f048(_0x1c0a77,_0x27e555);if(!_0x483315[_0x43e2('0x16')])throw new Error(_0x43e2('0x90')+_0x1c0a77+'\x27');var _0x40ee6e=[{'name':_0x1c0a77}];if(!_[_0x43e2('0x91')](_0x483315[_0x43e2('0x1c')]))_0x40ee6e=_0x483315[_0x43e2('0x1c')];var _0x216e57=[];for(var _0xb0c30b=0x0;_0xb0c30b<_0x40ee6e[_0x43e2('0x92')];_0xb0c30b++){_0x216e57['push'](_0x2f7153['UserProfileSection'][_0x43e2('0x93')]({'where':{'userProfileId':_0x2e86fb[_0x43e2('0x94')]['id'],'name':_0x40ee6e[_0xb0c30b][_0x43e2('0xf')]},'raw':!![]}));}return Promise[_0x43e2('0x95')](_0x216e57)['then'](function(_0x453f37){var _0x3485fb=_[_0x43e2('0x6')](_0x453f37,function(_0x54ab4f){return _0x54ab4f?_0x54ab4f:undefined;});var _0x228280=_[_0x43e2('0x6')](_0x40ee6e,[_0x43e2('0x96'),!![]]);var _0x463027=_['isEmpty'](_0x3485fb)&&_[_0x43e2('0x91')](_0x228280)?null:_[_0x43e2('0x97')](_0x228280,_0x3485fb);if(!_0x463027)return null;var _0x4dafc1=[];for(var _0x5d2ae5=0x0;_0x5d2ae5<_0x463027['length'];_0x5d2ae5++){var _0x7e5d4f=_[_0x43e2('0x93')](_0x40ee6e,function(_0x518aa1){return _0x463027[_0x5d2ae5]?_0x518aa1[_0x43e2('0xf')]===_0x463027[_0x5d2ae5][_0x43e2('0xf')]:null;});if(_0x7e5d4f){if(_0x463027[_0x5d2ae5][_0x43e2('0x96')]){_0x4dafc1['push'](_0x5d2806(_0x483315[_0x43e2('0x16')],_0x463027[_0x5d2ae5]));}else{if(!_0x463027[_0x5d2ae5]['autoAssociation']){_0x4dafc1[_0x43e2('0x98')](_0x5cea01(_0x7e5d4f,_0x463027[_0x5d2ae5],_0x483315[_0x43e2('0x16')]));}else{if(_0x7e5d4f[_0x43e2('0xc')]){_0x4dafc1[_0x43e2('0x98')](_0x45848e(_0x7e5d4f,_0x463027[_0x5d2ae5]));}}}}}return Promise[_0x43e2('0x95')](_0x4dafc1);})[_0x43e2('0x8')](function(_0x16dc65){var _0x364a6b=_0x16dc65;var _0x4ece0a=null;if(_0x364a6b){_0x4ece0a=_0x364a6b[_0x43e2('0x92')]===0x1?_0x364a6b[0x0]:null;}if(!_0x4ece0a&&!_0x364a6b)return _0x30c8f5;var _0x44dc86=_0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0x99')];_0x139cae[_0x43e2('0xc')]=_[_0x43e2('0x9a')](_0x44dc86);_0x139cae[_0x43e2('0x89')]=_[_0x43e2('0x9a')](_0x2e86fb[_0x43e2('0x89')]);_0x139cae[_0x43e2('0x9b')]=_[_0x43e2('0x9c')](_0x139cae['model'],_0x139cae[_0x43e2('0x89')]);_0x477c5f[_0x43e2('0x9d')]=_[_0x43e2('0x9c')](_0x139cae['model'],qs[_0x43e2('0x9e')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9e')]));_0x477c5f[_0x43e2('0x9d')]=_0x477c5f['attributes'][_0x43e2('0x92')]?_0x477c5f['attributes']:_0x139cae[_0x43e2('0xc')];if(!_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x9f')]('nolimit')){_0x477c5f[_0x43e2('0xa0')]=qs[_0x43e2('0xa0')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa0')]);_0x477c5f[_0x43e2('0xa1')]=qs[_0x43e2('0xa1')](_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xa1')]);}_0x477c5f[_0x43e2('0xa2')]=qs[_0x43e2('0xa3')](_0x2e86fb[_0x43e2('0x89')]['sort']);_0x477c5f[_0x43e2('0xa4')]=qs[_0x43e2('0x9b')](_[_0x43e2('0xa5')](_0x2e86fb[_0x43e2('0x89')],_0x139cae['filters']));if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]){_0x477c5f[_0x43e2('0xa4')]=_[_0x43e2('0xa6')](_0x477c5f[_0x43e2('0xa4')],{'$or':_[_0x43e2('0x9')](_0x44dc86,function(_0x3c176d){if(_0x3c176d[_0x43e2('0x13')]['key']!==_0x43e2('0xa7')){var _0x29c24d={};_0x29c24d[_0x3c176d[_0x43e2('0xb')]]={'$like':'%'+_0x2e86fb[_0x43e2('0x89')][_0x43e2('0x6')]+'%'};return _0x29c24d;}})});}var _0x4704cc=[];var _0x3af5ef=null;var _0x5b5a2e={};if(_0x4ece0a){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,[_0x43e2('0xf'),_0x4ece0a[_0x43e2('0xf')]]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};if(_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){_0x5b5a2e[_0x3af5ef['foreignKey']]=_[_0x43e2('0x9')](_0x4ece0a[_0x43e2('0xe')],'id');}else{_0x5b5a2e[_0x3af5ef[_0x43e2('0xa9')]]=_0x4ece0a[_0x43e2('0xe')];}_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{_0x477c5f[_0x43e2('0xa4')]['id']=_0x4ece0a['associatedResources'];}}else{for(var _0x2d57ff=0x0;_0x2d57ff<_0x364a6b[_0x43e2('0x92')];_0x2d57ff++){_0x3af5ef=_[_0x43e2('0x93')](_0x40ee6e,['name',_0x364a6b[_0x2d57ff]['name']]);if(_0x3af5ef[_0x43e2('0xb')]){_0x5b5a2e={};_0x5b5a2e[_0x3af5ef['foreignKey']]=_0x364a6b[_0x2d57ff]['associatedResources'];_0x4704cc[_0x43e2('0x98')](_0x5b5a2e);}else{if(!_0x477c5f[_0x43e2('0xa4')]['id'])_0x477c5f[_0x43e2('0xa4')]['id']=[];_0x364a6b[_0x2d57ff]['associatedResources'][_0x43e2('0xaa')](function(_0x5cdf92){_0x477c5f[_0x43e2('0xa4')]['id'][_0x43e2('0x98')](_0x5cdf92);});}}}if(!_[_0x43e2('0x91')](_0x4704cc)){_0x477c5f['where']=_['merge'](_0x477c5f['where'],{'$and':{'$or':_0x4704cc}});}_0x477c5f=_[_0x43e2('0xa6')]({},_0x477c5f,_0x2e86fb[_0x43e2('0xab')]);if(_0x4ece0a&&!_0x4ece0a[_0x43e2('0xac')]&&_0x483315[_0x43e2('0x16')]===_0x43e2('0xa8')){if(_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xad')]){_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f)[_0x43e2('0x8')](function(_0x48f054){var _0x3fb3fe=[];_0x48f054[_0x43e2('0xaa')](function(_0x5a0d57){var _0x2b1a80;switch(_0x5a0d57['reportType']){case _0x43e2('0xaf'):_0x2b1a80=_[_0x43e2('0x93')](_0x4ece0a[_0x43e2('0xe')],function(_0x4a01cf){return _0x4a01cf['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x4a01cf[_0x43e2('0x13')]==='DefaultReports';});break;case'custom':_0x2b1a80=_['find'](_0x4ece0a[_0x43e2('0xe')],function(_0x3574d8){return _0x3574d8['id']===_0x5a0d57[_0x43e2('0x7d')]&&_0x3574d8[_0x43e2('0x13')]===_0x43e2('0xb0');});break;}if(_0x2b1a80)_0x3fb3fe[_0x43e2('0x98')](_0x5a0d57);});_0x30c8f5[_0x43e2('0xb1')]=_0x3fb3fe['length'];_0x30c8f5['rows']=_0x3fb3fe;return _0x30c8f5;});}else{return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xb1')]({'where':_0x477c5f['where']})[_0x43e2('0x8')](function(_0x44edab){_0x30c8f5[_0x43e2('0xb1')]=_0x44edab;if(_0x2e86fb['query'][_0x43e2('0xad')]){if(_0x483315[_0x43e2('0x16')]===_0x43e2('0x22')){_0x477c5f[_0x43e2('0xae')]=[{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb2'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'required':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]?!![]:![]},{'model':_0x2f7153[_0x43e2('0x75')],'as':_0x43e2('0xb5'),'attributes':['id',_0x43e2('0xf'),_0x43e2('0xb3')],'through':_0x2e86fb['query'][_0x43e2('0xb4')]?{'attributes':[],'where':{'TagId':_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb4')]||undefined}}:{},'required':_0x2e86fb['query']['tag']?!![]:![]}];}else{_0x477c5f[_0x43e2('0xae')]=[{'all':!![]}];}}return _0x2f7153[_0x483315[_0x43e2('0x16')]][_0x43e2('0xd')](_0x477c5f);})['then'](function(_0x5ef6f4){_0x30c8f5[_0x43e2('0xb6')]=_0x5ef6f4;if(_0x1c0a77===_0x43e2('0x35')&&_0x2e86fb[_0x43e2('0x89')][_0x43e2('0xb7')]===_0x43e2('0xb8')){var _0x3c273d=[];for(var _0x3ff1c9=0x0;_0x3ff1c9<_0x30c8f5[_0x43e2('0xb6')][_0x43e2('0x92')];_0x3ff1c9++){_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xb9'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbb'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbc'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647(_0x43e2('0xbd'),_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d['push'](_0x1d8647('openchannel',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));_0x3c273d[_0x43e2('0x98')](_0x1d8647('whatsapp',_0x30c8f5[_0x43e2('0xb6')][_0x3ff1c9][_0x43e2('0xba')]));}return Promise[_0x43e2('0x95')](_0x3c273d)['then'](function(){return _0x30c8f5;});}return _0x30c8f5;});}});}}});};
\ No newline at end of file
+var _0xd8fb=['CmList','companies','CmCompany','CmCustomField','chatqueues','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','Schedule','sounds','Sound','tags','Tag','templates','Template','Trigger','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','ui.','InteractionId','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','mergeResources','length','UserProfileSection','find','all','ignore','isEmpty','push','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','pick','merge','key','foreignKey','autoAssociation','includeAll','include','forEach','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','openTabs','true','chat','dataValues','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','value','associatedResources','map','field','model','findAll','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','ListId','lists'];(function(_0x446da7,_0x4652a9){var _0x1a9039=function(_0x124b7e){while(--_0x124b7e){_0x446da7['push'](_0x446da7['shift']());}};_0x1a9039(++_0x4652a9);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4464ec,_0x413770){_0x4464ec=_0x4464ec-0x0;var _0x4d56ae=_0xd8fb[_0x4464ec];return _0x4d56ae;};'use strict';var _=require(_0xbd8f('0x0'));var attributes=require(_0xbd8f('0x1'));var qs=require(_0xbd8f('0x2'));var squel=require(_0xbd8f('0x3'));module['exports']=function(_0x5ea933){var _0x4e9545=_0x5ea933[_0xbd8f('0x4')];function _0x43d177(_0x53cccc,_0x400dfb){return new Promise(function(_0x2343bf,_0x5543b2){if(!_0x400dfb)return _0x2343bf(null);var _0x33d541=_0x400dfb['filter']?{[_0x400dfb[_0xbd8f('0x5')]['field']]:_0x400dfb[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x53cccc]['findAll']({'where':_0x33d541,'raw':!![]})['then'](function(_0x3caa93){_0x400dfb[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x3caa93,'id');_0x2343bf(_0x400dfb);})['catch'](function(_0x255af3){_0x5543b2(_0x255af3);});});}function _0x42ae20(_0x5b834b,_0x4ac253){return new Promise(function(_0x342bcb,_0x40a5bc){var _0x12dcac=_0x5b834b['filter']?{[_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x9')]]:_0x5b834b[_0xbd8f('0x5')][_0xbd8f('0x6')]}:undefined;return _0x4e9545[_0x5b834b[_0xbd8f('0xa')]][_0xbd8f('0xb')]({'where':_0x12dcac,'raw':!![]})[_0xbd8f('0xc')](function(_0x29ffe8){_0x4ac253[_0xbd8f('0x7')]=_['map'](_0x29ffe8,function(_0x31573c){return _0x31573c[_0xbd8f('0xd')];});_0x342bcb(_0x4ac253);})[_0xbd8f('0xe')](function(_0x10d72e){_0x40a5bc(_0x10d72e);});});}function _0x4da96f(_0x174929,_0x63db18,_0x5ebf8b){if(!_0x63db18)return Promise[_0xbd8f('0xf')](null);return new Promise(function(_0xf5e7a,_0x504adb){return _0x4e9545[_0xbd8f('0x10')][_0xbd8f('0xb')]({'where':{'sectionId':_0x63db18['id']},'raw':!![]})['then'](function(_0x5a572b){if(_0x174929[_0xbd8f('0x9')]&&_0x174929['field']!=='id'){_0x63db18['associatedResources']=_[_0xbd8f('0x8')](_0x5a572b,function(_0x4b5fac){return _0x4b5fac[_0x174929[_0xbd8f('0x9')]];});}else{if(_0x5ebf8b===_0xbd8f('0x11')){_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0xdc11cc){return{'id':_0xdc11cc[_0xbd8f('0x12')],'type':_0xdc11cc[_0xbd8f('0x13')]};});}else{_0x63db18[_0xbd8f('0x7')]=_[_0xbd8f('0x8')](_0x5a572b,function(_0x775acc){return _0x775acc[_0xbd8f('0x12')];});}}_0xf5e7a(_0x63db18);})[_0xbd8f('0xe')](function(_0x2f7c45){_0x504adb(_0x2f7c45);});});}function _0x15c4a9(_0x320ede,_0xd11ae){var _0x395b1b={'parentSections':[]};switch(_0x320ede['toLowerCase']()){case _0xbd8f('0x14'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x16');break;case _0xbd8f('0x17'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x18');break;case _0xbd8f('0x19'):_0x395b1b[_0xbd8f('0x15')]='SquareRecording';_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x1b'),'field':'name','foreignKey':_0xbd8f('0x1c')}];break;case'projects':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1d');break;case _0xbd8f('0x1e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x1f');_0x395b1b[_0xbd8f('0x1a')]=[{'name':'Lists','field':'id','foreignKey':_0xbd8f('0x20')}];break;case _0xbd8f('0x21'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x22');break;case _0xbd8f('0x23'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x24');break;case'globalcustomfields':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x25');break;case _0xbd8f('0x26'):_0x395b1b[_0xbd8f('0x15')]='ChatQueue';break;case'chatwebsites':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x27');break;case _0xbd8f('0x28'):_0x395b1b[_0xbd8f('0x15')]='FaxQueue';break;case _0xbd8f('0x29'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2a');break;case _0xbd8f('0x2b'):case _0xbd8f('0x2c'):case'outboundroutes':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2d');break;case _0xbd8f('0x2e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x2f');break;case'voicemails':_0x395b1b[_0xbd8f('0x15')]='VoiceMail';break;case _0xbd8f('0x30'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x31');_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x32'),'field':_0xbd8f('0xd'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xbd8f('0x33')]}},{'name':_0xbd8f('0x34'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x35'),'model':_0xbd8f('0x36'),'filter':{'field':_0xbd8f('0x37'),'value':[_0xbd8f('0x38')]}},{'name':_0xbd8f('0x39'),'field':_0xbd8f('0xd'),'foreignKey':_0xbd8f('0x3a'),'model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':[_0xbd8f('0x3c')]}},{'name':_0xbd8f('0x3d'),'field':_0xbd8f('0xd'),'foreignKey':'queue','model':_0xbd8f('0x3b'),'filter':{'field':_0xbd8f('0x13'),'value':['outbound']}}];break;case _0xbd8f('0x3e'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3f');break;case'chanspies':_0x395b1b[_0xbd8f('0x15')]='VoiceChanSpy';break;case _0xbd8f('0x40'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x41');break;case'ivrcampaigns':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x42');break;case _0xbd8f('0x43'):_0x395b1b['childModel']=_0xbd8f('0x44');break;case _0xbd8f('0x45'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x46');break;case _0xbd8f('0x47'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x48');break;case _0xbd8f('0x49'):_0x395b1b[_0xbd8f('0x15')]='OpenchannelQueue';break;case'openchannelaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4a');break;case _0xbd8f('0x4b'):_0x395b1b[_0xbd8f('0x15')]='SmsQueue';break;case _0xbd8f('0x4c'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x4d');break;case _0xbd8f('0x4e'):_0x395b1b[_0xbd8f('0x15')]='WhatsappQueue';break;case'whatsappaccounts':_0x395b1b[_0xbd8f('0x15')]='WhatsappAccount';break;case _0xbd8f('0x4f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x50');break;case _0xbd8f('0x51'):case _0xbd8f('0x52'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x3b');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':'VoiceQueues'},{'name':_0xbd8f('0x3d')}];}break;case _0xbd8f('0x53'):case _0xbd8f('0x54'):case _0xbd8f('0x55'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x36');if(_0xd11ae){_0x395b1b[_0xbd8f('0x1a')]=[{'name':_0xbd8f('0x56'),'filter':{'field':'role','value':[_0xbd8f('0x57'),_0xbd8f('0x58')]},'ignore':!![]},{'name':_0xbd8f('0x32')},{'name':_0xbd8f('0x34')}];}break;case _0xbd8f('0x59'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5a');break;case _0xbd8f('0x5b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5c');break;case _0xbd8f('0x5d'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x5e');break;case _0xbd8f('0x5f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x60');break;case _0xbd8f('0x61'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x62');break;case'zohoaccounts':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x63');break;case _0xbd8f('0x64'):_0x395b1b[_0xbd8f('0x15')]='User';break;case _0xbd8f('0x65'):_0x395b1b['childModel']=_0xbd8f('0x66');break;case _0xbd8f('0x67'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x68');break;case'customdashboards':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x69');break;case _0xbd8f('0x6a'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6b');break;case _0xbd8f('0x6c'):_0x395b1b['childModel']=_0xbd8f('0x6d');break;case'scheduler':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x6e');break;case _0xbd8f('0x6f'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x70');break;case _0xbd8f('0x71'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x72');break;case _0xbd8f('0x73'):_0x395b1b['childModel']=_0xbd8f('0x74');break;case'triggers':_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x75');break;case'trunks':_0x395b1b[_0xbd8f('0x15')]='Trunk';break;case'variables':_0x395b1b['childModel']='Variable';break;case _0xbd8f('0x76'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x77');break;case _0xbd8f('0x78'):_0x395b1b[_0xbd8f('0x15')]='AnalyticExtractedReport';_0x395b1b['parentSections']=[{'name':_0xbd8f('0x79'),'field':'id','foreignKey':_0xbd8f('0x7a')}];break;case _0xbd8f('0x7b'):_0x395b1b[_0xbd8f('0x15')]=_0xbd8f('0x7c');break;}return _0x395b1b;}function _0x576970(_0x4d2b28,_0x55a99b){var _0x9cf2d5=_0x4d2b28[_0xbd8f('0x7d')](0x0)[_0xbd8f('0x7e')]()+_0x4d2b28['slice'](0x1);var _0x3255be={'type':_0x4e9545[_0xbd8f('0x7f')][_0xbd8f('0x80')][_0xbd8f('0x81')],'raw':!![]};return new Promise(function(_0x50622d,_0x5327f2){var _0x388af8=squel['select']()[_0xbd8f('0x9')](_0xbd8f('0x82')+_0x9cf2d5+_0xbd8f('0x83'),'id')[_0xbd8f('0x9')]('ui.createdAt')['from'](_0xbd8f('0x84')+_0x4d2b28+_0xbd8f('0x85'),'ui')[_0xbd8f('0x86')](_0xbd8f('0x87'),_0x55a99b['id']);return _0x4e9545[_0xbd8f('0x88')][_0xbd8f('0x89')](_0x388af8[_0xbd8f('0x8a')](),_0x3255be)[_0xbd8f('0xc')](function(_0x2b9ba3){_0x55a99b[_0x9cf2d5+_0xbd8f('0x8b')]=_0x2b9ba3;_0x50622d(_0x2b9ba3);})[_0xbd8f('0xe')](function(_0x5c69c6){_0x5327f2(_0x5c69c6);});});}return _0x5ea933[_0xbd8f('0x8c')](_0xbd8f('0x8d'),attributes,{'tableName':_0xbd8f('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x12ee82){var _0x3b43f7={'raw':![],'where':{}};var _0xbbe096={};var _0x50e345={'count':0x0,'rows':[]};var _0x46c686=_0x12ee82[_0xbd8f('0x89')]['section'];var _0x5e18fc=_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x8f')]||![];var _0x109616=_0x15c4a9(_0x46c686,_0x5e18fc);if(!_0x109616['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x46c686+'\x27');var _0x118f1a=[{'name':_0x46c686}];if(!_['isEmpty'](_0x109616['parentSections']))_0x118f1a=_0x109616['parentSections'];var _0x5a858e=[];for(var _0x5b26eb=0x0;_0x5b26eb<_0x118f1a[_0xbd8f('0x90')];_0x5b26eb++){_0x5a858e['push'](_0x4e9545[_0xbd8f('0x91')][_0xbd8f('0x92')]({'where':{'userProfileId':_0x12ee82['params']['id'],'name':_0x118f1a[_0x5b26eb][_0xbd8f('0xd')]},'raw':!![]}));}return Promise[_0xbd8f('0x93')](_0x5a858e)[_0xbd8f('0xc')](function(_0xeabb79){var _0x199d7d=_['filter'](_0xeabb79,function(_0x583d7a){return _0x583d7a?_0x583d7a:undefined;});var _0x378e72=_[_0xbd8f('0x5')](_0x118f1a,[_0xbd8f('0x94'),!![]]);var _0x296794=_[_0xbd8f('0x95')](_0x199d7d)&&_[_0xbd8f('0x95')](_0x378e72)?null:_['union'](_0x378e72,_0x199d7d);if(!_0x296794)return null;var _0x4eddf2=[];for(var _0x467b0f=0x0;_0x467b0f<_0x296794[_0xbd8f('0x90')];_0x467b0f++){var _0x528b29=_[_0xbd8f('0x92')](_0x118f1a,function(_0x372386){return _0x296794[_0x467b0f]?_0x372386['name']===_0x296794[_0x467b0f][_0xbd8f('0xd')]:null;});if(_0x528b29){if(_0x296794[_0x467b0f][_0xbd8f('0x94')]){_0x4eddf2[_0xbd8f('0x96')](_0x43d177(_0x109616['childModel'],_0x296794[_0x467b0f]));}else{if(!_0x296794[_0x467b0f]['autoAssociation']){_0x4eddf2[_0xbd8f('0x96')](_0x4da96f(_0x528b29,_0x296794[_0x467b0f],_0x109616[_0xbd8f('0x15')]));}else{if(_0x528b29[_0xbd8f('0xa')]){_0x4eddf2[_0xbd8f('0x96')](_0x42ae20(_0x528b29,_0x296794[_0x467b0f]));}}}}}return Promise[_0xbd8f('0x93')](_0x4eddf2);})['then'](function(_0x200718){var _0x27ec14=_0x200718;var _0x400bf6=null;if(_0x27ec14){_0x400bf6=_0x27ec14[_0xbd8f('0x90')]===0x1?_0x27ec14[0x0]:null;}if(!_0x400bf6&&!_0x27ec14)return _0x50e345;var _0x1efdf4=_0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0x97')];_0xbbe096[_0xbd8f('0xa')]=_[_0xbd8f('0x98')](_0x1efdf4);_0xbbe096[_0xbd8f('0x89')]=_[_0xbd8f('0x98')](_0x12ee82[_0xbd8f('0x89')]);_0xbbe096[_0xbd8f('0x99')]=_[_0xbd8f('0x9a')](_0xbbe096[_0xbd8f('0xa')],_0xbbe096[_0xbd8f('0x89')]);_0x3b43f7[_0xbd8f('0x9b')]=_[_0xbd8f('0x9a')](_0xbbe096['model'],qs[_0xbd8f('0x9c')](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9c')]));_0x3b43f7[_0xbd8f('0x9b')]=_0x3b43f7[_0xbd8f('0x9b')][_0xbd8f('0x90')]?_0x3b43f7['attributes']:_0xbbe096['model'];if(!_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9d')]('nolimit')){_0x3b43f7[_0xbd8f('0x9e')]=qs['limit'](_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x9e')]);_0x3b43f7[_0xbd8f('0x9f')]=qs[_0xbd8f('0x9f')](_0x12ee82['query'][_0xbd8f('0x9f')]);}_0x3b43f7[_0xbd8f('0xa0')]=qs[_0xbd8f('0xa1')](_0x12ee82['query'][_0xbd8f('0xa1')]);_0x3b43f7[_0xbd8f('0x86')]=qs[_0xbd8f('0x99')](_[_0xbd8f('0xa2')](_0x12ee82['query'],_0xbbe096[_0xbd8f('0x99')]));if(_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$or':_[_0xbd8f('0x8')](_0x1efdf4,function(_0x3a320c){if(_0x3a320c['type'][_0xbd8f('0xa4')]!=='VIRTUAL'){var _0x3da31b={};_0x3da31b[_0x3a320c['field']]={'$like':'%'+_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0x5')]+'%'};return _0x3da31b;}})});}var _0x5465e5=[];var _0x3d015f=null;var _0x87191={};if(_0x400bf6){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x400bf6['name']]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};if(_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_['map'](_0x400bf6['associatedResources'],'id');}else{_0x87191[_0x3d015f[_0xbd8f('0xa5')]]=_0x400bf6[_0xbd8f('0x7')];}_0x5465e5[_0xbd8f('0x96')](_0x87191);}else{_0x3b43f7[_0xbd8f('0x86')]['id']=_0x400bf6[_0xbd8f('0x7')];}}else{for(var _0x53076d=0x0;_0x53076d<_0x27ec14[_0xbd8f('0x90')];_0x53076d++){_0x3d015f=_[_0xbd8f('0x92')](_0x118f1a,[_0xbd8f('0xd'),_0x27ec14[_0x53076d][_0xbd8f('0xd')]]);if(_0x3d015f[_0xbd8f('0x9')]){_0x87191={};_0x87191[_0x3d015f['foreignKey']]=_0x27ec14[_0x53076d]['associatedResources'];_0x5465e5['push'](_0x87191);}else{if(!_0x3b43f7[_0xbd8f('0x86')]['id'])_0x3b43f7['where']['id']=[];_0x27ec14[_0x53076d]['associatedResources']['forEach'](function(_0x63c20c){_0x3b43f7[_0xbd8f('0x86')]['id'][_0xbd8f('0x96')](_0x63c20c);});}}}if(!_[_0xbd8f('0x95')](_0x5465e5)){_0x3b43f7[_0xbd8f('0x86')]=_[_0xbd8f('0xa3')](_0x3b43f7[_0xbd8f('0x86')],{'$and':{'$or':_0x5465e5}});}_0x3b43f7=_[_0xbd8f('0xa3')]({},_0x3b43f7,_0x12ee82['options']);if(_0x400bf6&&!_0x400bf6[_0xbd8f('0xa6')]&&_0x109616[_0xbd8f('0x15')]===_0xbd8f('0x11')){if(_0x12ee82['query'][_0xbd8f('0xa7')]){_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}return _0x4e9545[_0x109616[_0xbd8f('0x15')]][_0xbd8f('0xb')](_0x3b43f7)[_0xbd8f('0xc')](function(_0x44ee0d){var _0x1d3c63=[];_0x44ee0d[_0xbd8f('0xa9')](function(_0x3aa33a){var _0x9e2f8a;switch(_0x3aa33a['reportType']){case _0xbd8f('0xaa'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x5c9c3a){return _0x5c9c3a['id']===_0x3aa33a[_0xbd8f('0x7a')]&&_0x5c9c3a['type']===_0xbd8f('0xab');});break;case _0xbd8f('0xac'):_0x9e2f8a=_[_0xbd8f('0x92')](_0x400bf6[_0xbd8f('0x7')],function(_0x351caa){return _0x351caa['id']===_0x3aa33a['reportId']&&_0x351caa[_0xbd8f('0x13')]===_0xbd8f('0xad');});break;}if(_0x9e2f8a)_0x1d3c63[_0xbd8f('0x96')](_0x3aa33a);});_0x50e345[_0xbd8f('0xae')]=_0x1d3c63[_0xbd8f('0x90')];_0x50e345[_0xbd8f('0xaf')]=_0x1d3c63;return _0x50e345;});}else{return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xae')]({'where':_0x3b43f7[_0xbd8f('0x86')]})['then'](function(_0x49e15e){_0x50e345[_0xbd8f('0xae')]=_0x49e15e;if(_0x12ee82['query']['includeAll']){if(_0x109616['childModel']===_0xbd8f('0x1f')){_0x3b43f7[_0xbd8f('0xa8')]=[{'model':_0x4e9545[_0xbd8f('0x72')],'as':_0xbd8f('0xb0'),'attributes':['id','name',_0xbd8f('0xb1')],'required':_0x12ee82[_0xbd8f('0x89')]['tag']?!![]:![]},{'model':_0x4e9545['Tag'],'as':_0xbd8f('0xb2'),'attributes':['id','name',_0xbd8f('0xb1')],'through':_0x12ee82['query']['tag']?{'attributes':[],'where':{'TagId':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]||undefined}}:{},'required':_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb3')]?!![]:![]}];}else{_0x3b43f7[_0xbd8f('0xa8')]=[{'all':!![]}];}}return _0x4e9545[_0x109616['childModel']][_0xbd8f('0xb')](_0x3b43f7);})[_0xbd8f('0xc')](function(_0x3a6ec4){_0x50e345['rows']=_0x3a6ec4;if(_0x46c686===_0xbd8f('0x32')&&_0x12ee82[_0xbd8f('0x89')][_0xbd8f('0xb4')]===_0xbd8f('0xb5')){var _0x11fb11=[];for(var _0xc7a57c=0x0;_0xc7a57c<_0x50e345[_0xbd8f('0xaf')][_0xbd8f('0x90')];_0xc7a57c++){_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb6'),_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11['push'](_0x576970('sms',_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970('fax',_0x50e345['rows'][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb8'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c]['dataValues']));_0x11fb11[_0xbd8f('0x96')](_0x576970(_0xbd8f('0xb9'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));_0x11fb11['push'](_0x576970(_0xbd8f('0xba'),_0x50e345[_0xbd8f('0xaf')][_0xc7a57c][_0xbd8f('0xb7')]));}return Promise['all'](_0x11fb11)[_0xbd8f('0xc')](function(){return _0x50e345;});}return _0x50e345;});}});}}});};
\ No newline at end of file
index 9a435cf..e01c1bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a38=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1a38,0xb0));var _0x81a3=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x1a38[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});config[_0x81a3('0xb')]=_[_0x81a3('0xc')](config[_0x81a3('0xb')],{'host':_0x81a3('0xd'),'port':0x18eb});var socket=require(_0x81a3('0xe'))(new Redis(config['redis']));require(_0x81a3('0xf'))[_0x81a3('0x10')](socket);function respondWithRpcPromise(_0x3ece9a,_0x10f4c5,_0x3fd4fe){return new BPromise(function(_0x4a7f3a,_0xeef25e){return client[_0x81a3('0x11')](_0x3ece9a,_0x3fd4fe)[_0x81a3('0x12')](function(_0x516492){logger['info'](_0x81a3('0x13'),_0x10f4c5,_0x81a3('0x14'));logger[_0x81a3('0x15')](_0x81a3('0x16'),_0x10f4c5,_0x81a3('0x14'),JSON[_0x81a3('0x17')](_0x516492));if(_0x516492[_0x81a3('0x18')]){if(_0x516492[_0x81a3('0x18')][_0x81a3('0x19')]===0x1f4){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492[_0x81a3('0x18')]['message']);return _0xeef25e(_0x516492[_0x81a3('0x18')][_0x81a3('0x1a')]);}logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492['error'][_0x81a3('0x1a')]);return _0x4a7f3a(_0x516492[_0x81a3('0x18')]['message']);}else{logger[_0x81a3('0x1b')]('UserProfile,\x20%s,\x20%s',_0x10f4c5,'request\x20sent');_0x4a7f3a(_0x516492[_0x81a3('0x1c')][_0x81a3('0x1a')]);}})[_0x81a3('0x1d')](function(_0x18c316){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x18c316);_0xeef25e(_0x18c316);});});}
\ No newline at end of file
+var _0xbb67=['http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47093f,_0x22e890){var _0x1f8683=function(_0x4faec0){while(--_0x4faec0){_0x47093f['push'](_0x47093f['shift']());}};_0x1f8683(++_0x22e890);}(_0xbb67,0x161));var _0x7bb6=function(_0x4b9626,_0x27f2d2){_0x4b9626=_0x4b9626-0x0;var _0x4557ff=_0xbb67[_0x4b9626];return _0x4557ff;};'use strict';var _=require('lodash');var util=require(_0x7bb6('0x0'));var moment=require(_0x7bb6('0x1'));var BPromise=require(_0x7bb6('0x2'));var rs=require(_0x7bb6('0x3'));var fs=require('fs');var Redis=require(_0x7bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bb6('0x5'));var logger=require(_0x7bb6('0x6'))(_0x7bb6('0x7'));var config=require(_0x7bb6('0x8'));var jayson=require(_0x7bb6('0x9'));var client=jayson[_0x7bb6('0xa')][_0x7bb6('0xb')]({'port':0x232a});config[_0x7bb6('0xc')]=_['defaults'](config[_0x7bb6('0xc')],{'host':_0x7bb6('0xd'),'port':0x18eb});var socket=require(_0x7bb6('0xe'))(new Redis(config[_0x7bb6('0xc')]));require(_0x7bb6('0xf'))[_0x7bb6('0x10')](socket);function respondWithRpcPromise(_0x2ffdaa,_0x17eee7,_0x14a6af){return new BPromise(function(_0x4fce9e,_0x3dc93c){return client[_0x7bb6('0x11')](_0x2ffdaa,_0x14a6af)[_0x7bb6('0x12')](function(_0x46be82){logger[_0x7bb6('0x13')](_0x7bb6('0x14'),_0x17eee7,_0x7bb6('0x15'));logger[_0x7bb6('0x16')](_0x7bb6('0x17'),_0x17eee7,'request\x20sent',JSON['stringify'](_0x46be82));if(_0x46be82[_0x7bb6('0x18')]){if(_0x46be82[_0x7bb6('0x18')]['code']===0x1f4){logger[_0x7bb6('0x18')](_0x7bb6('0x14'),_0x17eee7,_0x46be82[_0x7bb6('0x18')][_0x7bb6('0x19')]);return _0x3dc93c(_0x46be82[_0x7bb6('0x18')][_0x7bb6('0x19')]);}logger['error'](_0x7bb6('0x14'),_0x17eee7,_0x46be82[_0x7bb6('0x18')][_0x7bb6('0x19')]);return _0x4fce9e(_0x46be82[_0x7bb6('0x18')][_0x7bb6('0x19')]);}else{logger[_0x7bb6('0x13')]('UserProfile,\x20%s,\x20%s',_0x17eee7,_0x7bb6('0x15'));_0x4fce9e(_0x46be82[_0x7bb6('0x1a')][_0x7bb6('0x19')]);}})[_0x7bb6('0x1b')](function(_0x392a00){logger['error']('UserProfile,\x20%s,\x20%s',_0x17eee7,_0x392a00);_0x3dc93c(_0x392a00);});});}
\ No newline at end of file
index 442eba4..ef1d49f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bb5=['removeListener','userProfile:','save','remove','update','emit'];(function(_0x2a2385,_0x483814){var _0x2c75=function(_0x1991da){while(--_0x1991da){_0x2a2385['push'](_0x2a2385['shift']());}};_0x2c75(++_0x483814);}(_0x9bb5,0xbc));var _0x59bb=function(_0x455ec9,_0x2f1507){_0x455ec9=_0x455ec9-0x0;var _0x1681b7=_0x9bb5[_0x455ec9];return _0x1681b7;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x59bb('0x0'),_0x59bb('0x1'),_0x59bb('0x2')];function createListener(_0x555832,_0x5116fc){return function(_0x151fbf){_0x5116fc[_0x59bb('0x3')](_0x555832,_0x151fbf);};}function removeListener(_0x2673c0,_0x2bac74){return function(){UserProfileEvents[_0x59bb('0x4')](_0x2673c0,_0x2bac74);};}exports['register']=function(_0xcafb9c){for(var _0x3dc83b=0x0,_0x3a4fc0=events['length'];_0x3dc83b<_0x3a4fc0;_0x3dc83b++){var _0x22bf6f=events[_0x3dc83b];var _0x2da6be=createListener(_0x59bb('0x5')+_0x22bf6f,_0xcafb9c);UserProfileEvents['on'](_0x22bf6f,_0x2da6be);}};
\ No newline at end of file
+var _0xccb7=['length','userProfile:','./userProfile.events','save','remove','emit'];(function(_0x3ad01b,_0x4c6aca){var _0x46164f=function(_0x32bde1){while(--_0x32bde1){_0x3ad01b['push'](_0x3ad01b['shift']());}};_0x46164f(++_0x4c6aca);}(_0xccb7,0x74));var _0x7ccb=function(_0x3c6650,_0x37da7a){_0x3c6650=_0x3c6650-0x0;var _0x2216ce=_0xccb7[_0x3c6650];return _0x2216ce;};'use strict';var UserProfileEvents=require(_0x7ccb('0x0'));var events=[_0x7ccb('0x1'),_0x7ccb('0x2'),'update'];function createListener(_0x1c1b7e,_0x112ad1){return function(_0x2ad844){_0x112ad1[_0x7ccb('0x3')](_0x1c1b7e,_0x2ad844);};}function removeListener(_0x473110,_0x4eec79){return function(){UserProfileEvents['removeListener'](_0x473110,_0x4eec79);};}exports['register']=function(_0x26f40f){for(var _0x6247cc=0x0,_0x594319=events[_0x7ccb('0x4')];_0x6247cc<_0x594319;_0x6247cc++){var _0x1d1f51=events[_0x6247cc];var _0x26a8e7=createListener(_0x7ccb('0x5')+_0x1d1f51,_0x26f40f);UserProfileEvents['on'](_0x1d1f51,_0x26a8e7);}};
\ No newline at end of file
index 2784374..4eeac86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3105=['../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2cf695,_0x58e294){var _0x44b02c=function(_0x5c329d){while(--_0x5c329d){_0x2cf695['push'](_0x2cf695['shift']());}};_0x44b02c(++_0x58e294);}(_0x3105,0x1ae));var _0x5310=function(_0x2db429,_0x451682){_0x2db429=_0x2db429-0x0;var _0x2248fa=_0x3105[_0x2db429];return _0x2248fa;};'use strict';var multer=require(_0x5310('0x0'));var util=require(_0x5310('0x1'));var path=require(_0x5310('0x2'));var timeout=require(_0x5310('0x3'));var express=require(_0x5310('0x4'));var router=express['Router']();var fs_extra=require(_0x5310('0x5'));var auth=require(_0x5310('0x6'));var interaction=require(_0x5310('0x7'));var config=require(_0x5310('0x8'));var controller=require(_0x5310('0x9'));router[_0x5310('0xa')]('/',auth['isAuthenticated'](),controller[_0x5310('0xb')]);router[_0x5310('0xa')](_0x5310('0xc'),auth[_0x5310('0xd')](),controller[_0x5310('0xe')]);router['get'](_0x5310('0xf'),auth[_0x5310('0xd')](),controller[_0x5310('0x10')]);router[_0x5310('0x11')]('/',auth[_0x5310('0xd')](),controller[_0x5310('0x12')]);router[_0x5310('0x13')](_0x5310('0xf'),auth[_0x5310('0xd')](),controller[_0x5310('0x14')]);router['delete'](_0x5310('0xf'),auth['isAuthenticated'](),controller[_0x5310('0x15')]);module[_0x5310('0x16')]=router;
\ No newline at end of file
+var _0xbf2a=['Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x36b261,_0x504c02){var _0x2cf069=function(_0x2d61cc){while(--_0x2d61cc){_0x36b261['push'](_0x36b261['shift']());}};_0x2cf069(++_0x504c02);}(_0xbf2a,0xb3));var _0xabf2=function(_0x3f7830,_0x2ef515){_0x3f7830=_0x3f7830-0x0;var _0x392bcf=_0xbf2a[_0x3f7830];return _0x392bcf;};'use strict';var multer=require(_0xabf2('0x0'));var util=require(_0xabf2('0x1'));var path=require(_0xabf2('0x2'));var timeout=require(_0xabf2('0x3'));var express=require(_0xabf2('0x4'));var router=express[_0xabf2('0x5')]();var fs_extra=require(_0xabf2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xabf2('0x7'));var config=require('../../config/environment');var controller=require(_0xabf2('0x8'));router[_0xabf2('0x9')]('/',auth[_0xabf2('0xa')](),controller[_0xabf2('0xb')]);router[_0xabf2('0x9')](_0xabf2('0xc'),auth['isAuthenticated'](),controller[_0xabf2('0xd')]);router[_0xabf2('0x9')]('/:id',auth[_0xabf2('0xa')](),controller[_0xabf2('0xe')]);router[_0xabf2('0xf')]('/',auth[_0xabf2('0xa')](),controller[_0xabf2('0x10')]);router[_0xabf2('0x11')](_0xabf2('0x12'),auth['isAuthenticated'](),controller[_0xabf2('0x13')]);router[_0xabf2('0x14')]('/:id',auth[_0xabf2('0xa')](),controller[_0xabf2('0x15')]);module[_0xabf2('0x16')]=router;
\ No newline at end of file
index 31ff732..cdb80fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2530=['INTEGER','sequelize','STRING'];(function(_0x54412d,_0x253e09){var _0x368884=function(_0x366270){while(--_0x366270){_0x54412d['push'](_0x54412d['shift']());}};_0x368884(++_0x253e09);}(_0x2530,0x11b));var _0x0253=function(_0x5034cf,_0x54f09c){_0x5034cf=_0x5034cf-0x0;var _0x3171bc=_0x2530[_0x5034cf];return _0x3171bc;};'use strict';var Sequelize=require(_0x0253('0x0'));module['exports']={'name':{'type':Sequelize[_0x0253('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0253('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0253('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x7614=['STRING','sequelize','exports'];(function(_0x2812eb,_0x3b3ae6){var _0x2f348a=function(_0x44ed62){while(--_0x44ed62){_0x2812eb['push'](_0x2812eb['shift']());}};_0x2f348a(++_0x3b3ae6);}(_0x7614,0x193));var _0x4761=function(_0x45a394,_0x139086){_0x45a394=_0x45a394-0x0;var _0x3ffd52=_0x7614[_0x45a394];return _0x3ffd52;};'use strict';var Sequelize=require(_0x4761('0x0'));module[_0x4761('0x1')]={'name':{'type':Sequelize[_0x4761('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x4761('0x2')],'allowNull':![]}};
\ No newline at end of file
index 9b500e8..66bb25c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a37,0xb4));var _0x71a3=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1a37[_0x4fde08];return _0x12e725;};'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
+var _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x450608,_0x591a8b){_0x450608=_0x450608-0x0;var _0x58483a=_0x5f2f[_0x450608];return _0x58483a;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));};
\ No newline at end of file
index 4807d57..e986ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a3e=['request-promise','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','api','moment'];(function(_0x21a268,_0x57219b){var _0x573dfb=function(_0x36372b){while(--_0x36372b){_0x21a268['push'](_0x21a268['shift']());}};_0x573dfb(++_0x57219b);}(_0x9a3e,0xb1));var _0xe9a3=function(_0x40cba0,_0x5b8e8f){_0x40cba0=_0x40cba0-0x0;var _0x327eb7=_0x9a3e[_0x40cba0];return _0x327eb7;};'use strict';var _=require(_0xe9a3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe9a3('0x1'));var moment=require(_0xe9a3('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9a3('0x3'));var fs=require('fs');var path=require(_0xe9a3('0x4'));var rimraf=require(_0xe9a3('0x5'));var config=require('../../config/environment');var attributes=require(_0xe9a3('0x6'));module['exports']=function(_0x54975f,_0x5b8b3a){return _0x54975f[_0xe9a3('0x7')](_0xe9a3('0x8'),attributes,{'tableName':_0xe9a3('0x9'),'paranoid':![],'indexes':[{'name':_0xe9a3('0xa'),'fields':['resourceId',_0xe9a3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa8ca=['exports','define','UserProfileResource','user_profile_has_resources','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x1a73f3,_0x2f0342){var _0x9fbc8f=function(_0x3990a4){while(--_0x3990a4){_0x1a73f3['push'](_0x1a73f3['shift']());}};_0x9fbc8f(++_0x2f0342);}(_0xa8ca,0xfb));var _0xaa8c=function(_0x157f2b,_0x17a4b0){_0x157f2b=_0x157f2b-0x0;var _0x597139=_0xa8ca[_0x157f2b];return _0x597139;};'use strict';var _=require(_0xaa8c('0x0'));var util=require(_0xaa8c('0x1'));var logger=require(_0xaa8c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xaa8c('0x3'));var rp=require(_0xaa8c('0x4'));var fs=require('fs');var path=require(_0xaa8c('0x5'));var rimraf=require(_0xaa8c('0x6'));var config=require(_0xaa8c('0x7'));var attributes=require(_0xaa8c('0x8'));module[_0xaa8c('0x9')]=function(_0x11e702,_0x3d854d){return _0x11e702[_0xaa8c('0xa')](_0xaa8c('0xb'),attributes,{'tableName':_0xaa8c('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});};
\ No newline at end of file
index 4510fac..67647eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x312e=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x899dff,_0x1c99fb){var _0x4752d0=function(_0x5151e3){while(--_0x5151e3){_0x899dff['push'](_0x899dff['shift']());}};_0x4752d0(++_0x1c99fb);}(_0x312e,0xd7));var _0xe312=function(_0x24ca45,_0x556eda){_0x24ca45=_0x24ca45-0x0;var _0x13ef71=_0x312e[_0x24ca45];return _0x13ef71;};'use strict';var _=require('lodash');var util=require(_0xe312('0x0'));var moment=require(_0xe312('0x1'));var BPromise=require(_0xe312('0x2'));var rs=require(_0xe312('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe312('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe312('0x5'));var config=require(_0xe312('0x6'));var jayson=require(_0xe312('0x7'));var client=jayson[_0xe312('0x8')][_0xe312('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8151,_0x4e06fa,_0x57a18f){return new BPromise(function(_0x22572e,_0x1213d5){return client[_0xe312('0xa')](_0x5c8151,_0x57a18f)[_0xe312('0xb')](function(_0x5c201a){logger['info'](_0xe312('0xc'),_0x4e06fa,_0xe312('0xd'));logger[_0xe312('0xe')](_0xe312('0xf'),_0x4e06fa,_0xe312('0xd'),JSON[_0xe312('0x10')](_0x5c201a));if(_0x5c201a[_0xe312('0x11')]){if(_0x5c201a[_0xe312('0x11')][_0xe312('0x12')]===0x1f4){logger[_0xe312('0x11')](_0xe312('0xc'),_0x4e06fa,_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);return _0x1213d5(_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);}logger['error'](_0xe312('0xc'),_0x4e06fa,_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);return _0x22572e(_0x5c201a[_0xe312('0x11')][_0xe312('0x13')]);}else{logger[_0xe312('0x14')](_0xe312('0xc'),_0x4e06fa,_0xe312('0xd'));_0x22572e(_0x5c201a['result']['message']);}})[_0xe312('0x15')](function(_0x2d4041){logger[_0xe312('0x11')](_0xe312('0xc'),_0x4e06fa,_0x2d4041);_0x1213d5(_0x2d4041);});});}
\ No newline at end of file
+var _0xb7b4=['http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x24b9ae,_0x315e2e){var _0x224ad1=function(_0x21dcc7){while(--_0x21dcc7){_0x24b9ae['push'](_0x24b9ae['shift']());}};_0x224ad1(++_0x315e2e);}(_0xb7b4,0x16b));var _0x4b7b=function(_0x3cc2f1,_0x4f6f57){_0x3cc2f1=_0x3cc2f1-0x0;var _0x4006b9=_0xb7b4[_0x3cc2f1];return _0x4006b9;};'use strict';var _=require(_0x4b7b('0x0'));var util=require(_0x4b7b('0x1'));var moment=require(_0x4b7b('0x2'));var BPromise=require(_0x4b7b('0x3'));var rs=require(_0x4b7b('0x4'));var fs=require('fs');var Redis=require(_0x4b7b('0x5'));var db=require(_0x4b7b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b7b('0x7'))(_0x4b7b('0x8'));var config=require(_0x4b7b('0x9'));var jayson=require(_0x4b7b('0xa'));var client=jayson[_0x4b7b('0xb')][_0x4b7b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c430f,_0x2985f3,_0x168a1c){return new BPromise(function(_0x331d4b,_0xc3fdc7){return client[_0x4b7b('0xd')](_0x3c430f,_0x168a1c)[_0x4b7b('0xe')](function(_0x5d59a3){logger[_0x4b7b('0xf')](_0x4b7b('0x10'),_0x2985f3,_0x4b7b('0x11'));logger[_0x4b7b('0x12')](_0x4b7b('0x13'),_0x2985f3,_0x4b7b('0x11'),JSON['stringify'](_0x5d59a3));if(_0x5d59a3[_0x4b7b('0x14')]){if(_0x5d59a3[_0x4b7b('0x14')][_0x4b7b('0x15')]===0x1f4){logger[_0x4b7b('0x14')]('UserProfileResource,\x20%s,\x20%s',_0x2985f3,_0x5d59a3[_0x4b7b('0x14')][_0x4b7b('0x16')]);return _0xc3fdc7(_0x5d59a3['error']['message']);}logger['error'](_0x4b7b('0x10'),_0x2985f3,_0x5d59a3[_0x4b7b('0x14')]['message']);return _0x331d4b(_0x5d59a3[_0x4b7b('0x14')][_0x4b7b('0x16')]);}else{logger['info'](_0x4b7b('0x10'),_0x2985f3,_0x4b7b('0x11'));_0x331d4b(_0x5d59a3[_0x4b7b('0x17')]['message']);}})[_0x4b7b('0x18')](function(_0x2e4767){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2985f3,_0x2e4767);_0xc3fdc7(_0x2e4767);});});}
\ No newline at end of file
index d7d5ea9..a627379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c8a=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put'];(function(_0x21cc06,_0x1c3faa){var _0x18cb0e=function(_0x3628e3){while(--_0x3628e3){_0x21cc06['push'](_0x21cc06['shift']());}};_0x18cb0e(++_0x1c3faa);}(_0x4c8a,0x1e7));var _0xa4c8=function(_0x51e1af,_0x3085d6){_0x51e1af=_0x51e1af-0x0;var _0x1dfefb=_0x4c8a[_0x51e1af];return _0x1dfefb;};'use strict';var multer=require(_0xa4c8('0x0'));var util=require(_0xa4c8('0x1'));var path=require('path');var timeout=require(_0xa4c8('0x2'));var express=require(_0xa4c8('0x3'));var router=express[_0xa4c8('0x4')]();var fs_extra=require(_0xa4c8('0x5'));var auth=require(_0xa4c8('0x6'));var interaction=require(_0xa4c8('0x7'));var config=require(_0xa4c8('0x8'));var controller=require(_0xa4c8('0x9'));router['get']('/',auth[_0xa4c8('0xa')](),controller['index']);router[_0xa4c8('0xb')](_0xa4c8('0xc'),auth[_0xa4c8('0xa')](),controller[_0xa4c8('0xd')]);router[_0xa4c8('0xb')](_0xa4c8('0xe'),auth['isAuthenticated'](),controller[_0xa4c8('0xf')]);router[_0xa4c8('0x10')]('/',auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x11')]);router[_0xa4c8('0x12')](_0xa4c8('0xe'),auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x13')]);router[_0xa4c8('0x14')]('/:id',auth[_0xa4c8('0xa')](),controller[_0xa4c8('0x15')]);module[_0xa4c8('0x16')]=router;
\ No newline at end of file
+var _0x3e17=['/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x3e17,0x1bf));var _0x73e1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e17[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x73e1('0x0'));var util=require(_0x73e1('0x1'));var path=require('path');var timeout=require(_0x73e1('0x2'));var express=require('express');var router=express[_0x73e1('0x3')]();var fs_extra=require(_0x73e1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73e1('0x5'));var config=require(_0x73e1('0x6'));var controller=require(_0x73e1('0x7'));router[_0x73e1('0x8')]('/',auth[_0x73e1('0x9')](),controller[_0x73e1('0xa')]);router[_0x73e1('0x8')](_0x73e1('0xb'),auth[_0x73e1('0x9')](),controller[_0x73e1('0xc')]);router[_0x73e1('0x8')](_0x73e1('0xd'),auth['isAuthenticated'](),controller[_0x73e1('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x73e1('0xf')]);router[_0x73e1('0x10')](_0x73e1('0xd'),auth[_0x73e1('0x9')](),controller[_0x73e1('0x11')]);router[_0x73e1('0x12')](_0x73e1('0xd'),auth[_0x73e1('0x9')](),controller[_0x73e1('0x13')]);module['exports']=router;
\ No newline at end of file
index 7532fd8..aa5040f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c1=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x2481d7,_0x32fa02){var _0x4a6cb8=function(_0x5c0833){while(--_0x5c0833){_0x2481d7['push'](_0x2481d7['shift']());}};_0x4a6cb8(++_0x32fa02);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x197c('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x197c('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x197c('0x2')],'set':function(_0x26833e){this[_0x197c('0x4')](_0x197c('0x5'),_0x26833e?_0x26833e['join'](''):[]);},'get':function(){return this['getDataValue'](_0x197c('0x5'))?this[_0x197c('0x6')](_0x197c('0x5'))[_0x197c('0x7')](''):[];}}};
\ No newline at end of file
+var _0x3de3=['sequelize','STRING','BOOLEAN','crudPermissions','join','split'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x3de3,0x1ce));var _0x33de=function(_0x22c295,_0x461886){_0x22c295=_0x22c295-0x0;var _0x52d9f2=_0x3de3[_0x22c295];return _0x52d9f2;};'use strict';var Sequelize=require(_0x33de('0x0'));module['exports']={'name':{'type':Sequelize[_0x33de('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x33de('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x33de('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x33de('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x33de('0x1')],'set':function(_0xbdd404){this['setDataValue'](_0x33de('0x3'),_0xbdd404?_0xbdd404[_0x33de('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x33de('0x3'))?this['getDataValue'](_0x33de('0x3'))[_0x33de('0x5')](''):[];}}};
\ No newline at end of file
index fc2d92e..77a97f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dd2=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','UserProfileSection','include','findAll','catch','params','rawAttributes','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dd2,0xc5));var _0x27dd=function(_0x453f0f,_0x2dee3f){_0x453f0f=_0x453f0f-0x0;var _0x17dd08=_0x7dd2[_0x453f0f];return _0x17dd08;};'use strict';var emlformat=require(_0x27dd('0x0'));var rimraf=require(_0x27dd('0x1'));var zipdir=require(_0x27dd('0x2'));var jsonpatch=require(_0x27dd('0x3'));var rp=require('request-promise');var moment=require(_0x27dd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x27dd('0x5'));var path=require(_0x27dd('0x6'));var sox=require(_0x27dd('0x7'));var csv=require(_0x27dd('0x8'));var ejs=require(_0x27dd('0x9'));var fs=require('fs');var fs_extra=require(_0x27dd('0xa'));var _=require(_0x27dd('0xb'));var squel=require(_0x27dd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x27dd('0xd'));var toCsv=require(_0x27dd('0x8'));var querystring=require(_0x27dd('0xe'));var Papa=require(_0x27dd('0xf'));var Redis=require('ioredis');var authService=require(_0x27dd('0x10'));var qs=require(_0x27dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x27dd('0x12'));var logger=require(_0x27dd('0x13'))('api');var utils=require(_0x27dd('0x14'));var config=require(_0x27dd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27dd('0x16'))['db'];function respondWithStatusCode(_0x58bf8c,_0x827029){_0x827029=_0x827029||0xcc;return function(_0xc99bcc){if(_0xc99bcc){return _0x58bf8c[_0x27dd('0x17')](_0x827029);}return _0x58bf8c[_0x27dd('0x18')](_0x827029)[_0x27dd('0x19')]();};}function respondWithResult(_0x2c4263,_0x262bdb){_0x262bdb=_0x262bdb||0xc8;return function(_0x26fe09){if(_0x26fe09){return _0x2c4263[_0x27dd('0x18')](_0x262bdb)['json'](_0x26fe09);}};}function respondWithFilteredResult(_0x265e19,_0x2f34df){return function(_0x444516){if(_0x444516){var _0x352c1b=typeof _0x2f34df[_0x27dd('0x1a')]===_0x27dd('0x1b')&&typeof _0x2f34df[_0x27dd('0x1c')]===_0x27dd('0x1b');var _0x3855ff=_0x444516['count'];var _0x1d1a53=_0x352c1b?0x0:_0x2f34df['offset'];var _0x3b4846=_0x352c1b?_0x444516[_0x27dd('0x1d')]:_0x2f34df[_0x27dd('0x1a')]+_0x2f34df[_0x27dd('0x1c')];var _0x345a57;if(_0x3b4846>=_0x3855ff){_0x3b4846=_0x3855ff;_0x345a57=0xc8;}else{_0x345a57=0xce;}_0x265e19[_0x27dd('0x18')](_0x345a57);return _0x265e19['set'](_0x27dd('0x1e'),_0x1d1a53+'-'+_0x3b4846+'/'+_0x3855ff)[_0x27dd('0x1f')](_0x444516);}return null;};}function patchUpdates(_0x2652d6){return function(_0x313229){try{jsonpatch[_0x27dd('0x20')](_0x313229,_0x2652d6,!![]);}catch(_0xfdc236){return BPromise[_0x27dd('0x21')](_0xfdc236);}return _0x313229[_0x27dd('0x22')]();};}function saveUpdates(_0x44fa18,_0x567742){return function(_0x3fb21f){if(_0x3fb21f){return _0x3fb21f[_0x27dd('0x23')](_0x44fa18)[_0x27dd('0x24')](function(_0x26f492){return _0x26f492;});}return null;};}function removeEntity(_0x44aad9,_0x31ced9){return function(_0x2b85cb){if(_0x2b85cb){return _0x2b85cb[_0x27dd('0x25')]()[_0x27dd('0x24')](function(){_0x44aad9[_0x27dd('0x18')](0xcc)[_0x27dd('0x19')]();});}};}function handleEntityNotFound(_0x58e711,_0x5014c2){return function(_0x404c0c){if(!_0x404c0c){_0x58e711[_0x27dd('0x17')](0x194);}return _0x404c0c;};}function handleError(_0x5dfc7d,_0x42179e){_0x42179e=_0x42179e||0x1f4;return function(_0x225e57){logger['error'](_0x225e57['stack']);if(_0x225e57['name']){delete _0x225e57[_0x27dd('0x26')];}_0x5dfc7d[_0x27dd('0x18')](_0x42179e)[_0x27dd('0x27')](_0x225e57);};}exports['index']=function(_0x11615c,_0x125135){var _0x2a4944={},_0x5f5611={},_0x2f9b7f={'count':0x0,'rows':[]};var _0x22cf40=_[_0x27dd('0x28')](db['UserProfileSection']['rawAttributes'],function(_0x401620){return{'name':_0x401620[_0x27dd('0x29')],'type':_0x401620[_0x27dd('0x2a')][_0x27dd('0x2b')]};});_0x5f5611[_0x27dd('0x2c')]=_['map'](_0x22cf40,_0x27dd('0x26'));_0x5f5611['query']=_[_0x27dd('0x2d')](_0x11615c['query']);_0x5f5611[_0x27dd('0x2e')]=_[_0x27dd('0x2f')](_0x5f5611[_0x27dd('0x2c')],_0x5f5611['query']);_0x2a4944[_0x27dd('0x30')]=_[_0x27dd('0x2f')](_0x5f5611[_0x27dd('0x2c')],qs['fields'](_0x11615c[_0x27dd('0x31')][_0x27dd('0x32')]));_0x2a4944[_0x27dd('0x30')]=_0x2a4944[_0x27dd('0x30')][_0x27dd('0x33')]?_0x2a4944[_0x27dd('0x30')]:_0x5f5611['model'];if(!_0x11615c['query'][_0x27dd('0x34')](_0x27dd('0x35'))){_0x2a4944['limit']=qs[_0x27dd('0x1c')](_0x11615c[_0x27dd('0x31')][_0x27dd('0x1c')]);_0x2a4944[_0x27dd('0x1a')]=qs[_0x27dd('0x1a')](_0x11615c[_0x27dd('0x31')]['offset']);}_0x2a4944[_0x27dd('0x36')]=qs[_0x27dd('0x37')](_0x11615c['query'][_0x27dd('0x37')]);_0x2a4944['where']=qs[_0x27dd('0x2e')](_[_0x27dd('0x38')](_0x11615c[_0x27dd('0x31')],_0x5f5611[_0x27dd('0x2e')]),_0x22cf40);if(_0x11615c[_0x27dd('0x31')][_0x27dd('0x39')]){_0x2a4944[_0x27dd('0x3a')]=_['merge'](_0x2a4944[_0x27dd('0x3a')],{'$or':_[_0x27dd('0x28')](_0x22cf40,function(_0xc2923e){if(_0xc2923e[_0x27dd('0x2a')]!=='VIRTUAL'){var _0x1bf622={};_0x1bf622[_0xc2923e['name']]={'$like':'%'+_0x11615c[_0x27dd('0x31')]['filter']+'%'};return _0x1bf622;}})});}_0x2a4944=_[_0x27dd('0x3b')]({},_0x2a4944,_0x11615c['options']);var _0x1df370={'where':_0x2a4944[_0x27dd('0x3a')]};return db[_0x27dd('0x3c')]['count'](_0x1df370)[_0x27dd('0x24')](function(_0xff2aca){_0x2f9b7f[_0x27dd('0x1d')]=_0xff2aca;if(_0x11615c[_0x27dd('0x31')]['includeAll']){_0x2a4944[_0x27dd('0x3d')]=[{'all':!![]}];}return db[_0x27dd('0x3c')][_0x27dd('0x3e')](_0x2a4944);})['then'](function(_0x13b12a){_0x2f9b7f['rows']=_0x13b12a;return _0x2f9b7f;})[_0x27dd('0x24')](respondWithFilteredResult(_0x125135,_0x2a4944))[_0x27dd('0x3f')](handleError(_0x125135,null));};exports['show']=function(_0x492727,_0x55949e){var _0x4f3e46={'raw':![],'where':{'id':_0x492727[_0x27dd('0x40')]['id']}},_0x5151fa={};_0x5151fa['model']=_['keys'](db[_0x27dd('0x3c')][_0x27dd('0x41')]);_0x5151fa[_0x27dd('0x31')]=_[_0x27dd('0x2d')](_0x492727[_0x27dd('0x31')]);_0x5151fa[_0x27dd('0x2e')]=_[_0x27dd('0x2f')](_0x5151fa[_0x27dd('0x2c')],_0x5151fa[_0x27dd('0x31')]);_0x4f3e46[_0x27dd('0x30')]=_[_0x27dd('0x2f')](_0x5151fa[_0x27dd('0x2c')],qs[_0x27dd('0x32')](_0x492727['query'][_0x27dd('0x32')]));_0x4f3e46[_0x27dd('0x30')]=_0x4f3e46[_0x27dd('0x30')]['length']?_0x4f3e46[_0x27dd('0x30')]:_0x5151fa[_0x27dd('0x2c')];if(_0x492727['query'][_0x27dd('0x42')]){_0x4f3e46['include']=[{'all':!![]}];}_0x4f3e46=_['merge']({},_0x4f3e46,_0x492727[_0x27dd('0x43')]);return db[_0x27dd('0x3c')][_0x27dd('0x44')](_0x4f3e46)['then'](handleEntityNotFound(_0x55949e,null))[_0x27dd('0x24')](respondWithResult(_0x55949e,null))['catch'](handleError(_0x55949e,null));};exports[_0x27dd('0x45')]=function(_0xb8f9b1,_0x214593){return db[_0x27dd('0x3c')][_0x27dd('0x45')](_0xb8f9b1[_0x27dd('0x46')],{})[_0x27dd('0x24')](respondWithResult(_0x214593,0xc9))[_0x27dd('0x3f')](handleError(_0x214593,null));};exports[_0x27dd('0x23')]=function(_0x3244b9,_0x50a7e7){if(_0x3244b9[_0x27dd('0x46')]['id']){delete _0x3244b9[_0x27dd('0x46')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x3244b9[_0x27dd('0x40')]['id']}})[_0x27dd('0x24')](handleEntityNotFound(_0x50a7e7,null))['then'](saveUpdates(_0x3244b9[_0x27dd('0x46')],null))['then'](respondWithResult(_0x50a7e7,null))[_0x27dd('0x3f')](handleError(_0x50a7e7,null));};exports[_0x27dd('0x25')]=function(_0x388ce6,_0x1a1875){return db[_0x27dd('0x3c')][_0x27dd('0x44')]({'where':{'id':_0x388ce6['params']['id']}})[_0x27dd('0x24')](handleEntityNotFound(_0x1a1875,null))[_0x27dd('0x24')](removeEntity(_0x1a1875,null))[_0x27dd('0x3f')](handleError(_0x1a1875,null));};exports[_0x27dd('0x47')]=function(_0x270a6e,_0xf9d897){return db[_0x27dd('0x3c')][_0x27dd('0x47')]()[_0x27dd('0x24')](respondWithResult(_0xf9d897,null))[_0x27dd('0x3f')](handleError(_0xf9d897,null));};
\ No newline at end of file
+var _0x70d3=['end','error','index','UserProfileSection','rawAttributes','fieldName','key','model','keys','filters','attributes','intersection','query','length','hasOwnProperty','nolimit','pick','filter','where','map','type','name','includeAll','include','findAll','rows','show','fields','merge','options','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x70d3,0xff));var _0x370d=function(_0x182bb6,_0x1d8773){_0x182bb6=_0x182bb6-0x0;var _0x4ff9e0=_0x70d3[_0x182bb6];return _0x4ff9e0;};'use strict';var emlformat=require(_0x370d('0x0'));var rimraf=require(_0x370d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x370d('0x2'));var rp=require(_0x370d('0x3'));var moment=require('moment');var BPromise=require(_0x370d('0x4'));var Mustache=require(_0x370d('0x5'));var util=require(_0x370d('0x6'));var path=require(_0x370d('0x7'));var sox=require(_0x370d('0x8'));var csv=require('to-csv');var ejs=require(_0x370d('0x9'));var fs=require('fs');var fs_extra=require(_0x370d('0xa'));var _=require(_0x370d('0xb'));var squel=require('squel');var crypto=require(_0x370d('0xc'));var jsforce=require(_0x370d('0xd'));var deskjs=require(_0x370d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x370d('0xf'));var Papa=require('papaparse');var Redis=require(_0x370d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x370d('0x11'));var as=require(_0x370d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x370d('0x13'))(_0x370d('0x14'));var utils=require(_0x370d('0x15'));var config=require(_0x370d('0x16'));var licenseUtil=require(_0x370d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf8c24,_0x4ab1a2){_0x4ab1a2=_0x4ab1a2||0xcc;return function(_0x313888){if(_0x313888){return _0xf8c24[_0x370d('0x18')](_0x4ab1a2);}return _0xf8c24[_0x370d('0x19')](_0x4ab1a2)['end']();};}function respondWithResult(_0x1a019d,_0x1b3457){_0x1b3457=_0x1b3457||0xc8;return function(_0x4d41a5){if(_0x4d41a5){return _0x1a019d[_0x370d('0x19')](_0x1b3457)['json'](_0x4d41a5);}};}function respondWithFilteredResult(_0x4c0cfc,_0xa012e){return function(_0x5959be){if(_0x5959be){var _0x3a4d20=typeof _0xa012e[_0x370d('0x1a')]===_0x370d('0x1b')&&typeof _0xa012e[_0x370d('0x1c')]==='undefined';var _0x2a9e6c=_0x5959be[_0x370d('0x1d')];var _0x5f4469=_0x3a4d20?0x0:_0xa012e[_0x370d('0x1a')];var _0x24aa88=_0x3a4d20?_0x5959be['count']:_0xa012e['offset']+_0xa012e[_0x370d('0x1c')];var _0x350bbc;if(_0x24aa88>=_0x2a9e6c){_0x24aa88=_0x2a9e6c;_0x350bbc=0xc8;}else{_0x350bbc=0xce;}_0x4c0cfc[_0x370d('0x19')](_0x350bbc);return _0x4c0cfc[_0x370d('0x1e')](_0x370d('0x1f'),_0x5f4469+'-'+_0x24aa88+'/'+_0x2a9e6c)[_0x370d('0x20')](_0x5959be);}return null;};}function patchUpdates(_0x3e6fcb){return function(_0x176782){try{jsonpatch[_0x370d('0x21')](_0x176782,_0x3e6fcb,!![]);}catch(_0x404572){return BPromise['reject'](_0x404572);}return _0x176782['save']();};}function saveUpdates(_0x59eecc,_0x254a99){return function(_0x29033d){if(_0x29033d){return _0x29033d[_0x370d('0x22')](_0x59eecc)[_0x370d('0x23')](function(_0x54b925){return _0x54b925;});}return null;};}function removeEntity(_0x19f4f5,_0x38c178){return function(_0x5e0daf){if(_0x5e0daf){return _0x5e0daf[_0x370d('0x24')]()[_0x370d('0x23')](function(){_0x19f4f5[_0x370d('0x19')](0xcc)[_0x370d('0x25')]();});}};}function handleEntityNotFound(_0x55e440,_0x255b6e){return function(_0x24e2d5){if(!_0x24e2d5){_0x55e440['sendStatus'](0x194);}return _0x24e2d5;};}function handleError(_0x2a0dc5,_0x26ef98){_0x26ef98=_0x26ef98||0x1f4;return function(_0x5ac25f){logger[_0x370d('0x26')](_0x5ac25f['stack']);if(_0x5ac25f['name']){delete _0x5ac25f['name'];}_0x2a0dc5[_0x370d('0x19')](_0x26ef98)['send'](_0x5ac25f);};}exports[_0x370d('0x27')]=function(_0x34dad6,_0x20b5ee){var _0x2ee40c={},_0x285cfc={},_0x5e0d2a={'count':0x0,'rows':[]};var _0xe3715d=_['map'](db[_0x370d('0x28')][_0x370d('0x29')],function(_0x3f6854){return{'name':_0x3f6854[_0x370d('0x2a')],'type':_0x3f6854['type'][_0x370d('0x2b')]};});_0x285cfc[_0x370d('0x2c')]=_['map'](_0xe3715d,'name');_0x285cfc['query']=_[_0x370d('0x2d')](_0x34dad6['query']);_0x285cfc[_0x370d('0x2e')]=_['intersection'](_0x285cfc[_0x370d('0x2c')],_0x285cfc['query']);_0x2ee40c[_0x370d('0x2f')]=_[_0x370d('0x30')](_0x285cfc[_0x370d('0x2c')],qs['fields'](_0x34dad6[_0x370d('0x31')]['fields']));_0x2ee40c[_0x370d('0x2f')]=_0x2ee40c[_0x370d('0x2f')][_0x370d('0x32')]?_0x2ee40c[_0x370d('0x2f')]:_0x285cfc[_0x370d('0x2c')];if(!_0x34dad6['query'][_0x370d('0x33')](_0x370d('0x34'))){_0x2ee40c['limit']=qs['limit'](_0x34dad6[_0x370d('0x31')][_0x370d('0x1c')]);_0x2ee40c['offset']=qs[_0x370d('0x1a')](_0x34dad6[_0x370d('0x31')][_0x370d('0x1a')]);}_0x2ee40c['order']=qs['sort'](_0x34dad6[_0x370d('0x31')]['sort']);_0x2ee40c['where']=qs[_0x370d('0x2e')](_[_0x370d('0x35')](_0x34dad6[_0x370d('0x31')],_0x285cfc['filters']),_0xe3715d);if(_0x34dad6['query'][_0x370d('0x36')]){_0x2ee40c['where']=_['merge'](_0x2ee40c[_0x370d('0x37')],{'$or':_[_0x370d('0x38')](_0xe3715d,function(_0x22d4e2){if(_0x22d4e2[_0x370d('0x39')]!=='VIRTUAL'){var _0x114f21={};_0x114f21[_0x22d4e2[_0x370d('0x3a')]]={'$like':'%'+_0x34dad6[_0x370d('0x31')][_0x370d('0x36')]+'%'};return _0x114f21;}})});}_0x2ee40c=_['merge']({},_0x2ee40c,_0x34dad6['options']);var _0x116dc7={'where':_0x2ee40c[_0x370d('0x37')]};return db['UserProfileSection']['count'](_0x116dc7)[_0x370d('0x23')](function(_0x3f9eaa){_0x5e0d2a[_0x370d('0x1d')]=_0x3f9eaa;if(_0x34dad6[_0x370d('0x31')][_0x370d('0x3b')]){_0x2ee40c[_0x370d('0x3c')]=[{'all':!![]}];}return db['UserProfileSection'][_0x370d('0x3d')](_0x2ee40c);})[_0x370d('0x23')](function(_0x3657c0){_0x5e0d2a[_0x370d('0x3e')]=_0x3657c0;return _0x5e0d2a;})['then'](respondWithFilteredResult(_0x20b5ee,_0x2ee40c))['catch'](handleError(_0x20b5ee,null));};exports[_0x370d('0x3f')]=function(_0xf2656b,_0x288390){var _0xd66455={'raw':![],'where':{'id':_0xf2656b['params']['id']}},_0x48b910={};_0x48b910['model']=_[_0x370d('0x2d')](db[_0x370d('0x28')][_0x370d('0x29')]);_0x48b910['query']=_[_0x370d('0x2d')](_0xf2656b[_0x370d('0x31')]);_0x48b910[_0x370d('0x2e')]=_[_0x370d('0x30')](_0x48b910[_0x370d('0x2c')],_0x48b910[_0x370d('0x31')]);_0xd66455[_0x370d('0x2f')]=_[_0x370d('0x30')](_0x48b910[_0x370d('0x2c')],qs[_0x370d('0x40')](_0xf2656b['query']['fields']));_0xd66455['attributes']=_0xd66455['attributes'][_0x370d('0x32')]?_0xd66455[_0x370d('0x2f')]:_0x48b910[_0x370d('0x2c')];if(_0xf2656b['query'][_0x370d('0x3b')]){_0xd66455[_0x370d('0x3c')]=[{'all':!![]}];}_0xd66455=_[_0x370d('0x41')]({},_0xd66455,_0xf2656b[_0x370d('0x42')]);return db[_0x370d('0x28')][_0x370d('0x43')](_0xd66455)[_0x370d('0x23')](handleEntityNotFound(_0x288390,null))[_0x370d('0x23')](respondWithResult(_0x288390,null))[_0x370d('0x44')](handleError(_0x288390,null));};exports[_0x370d('0x45')]=function(_0x24ecdc,_0x120a6b){return db[_0x370d('0x28')][_0x370d('0x45')](_0x24ecdc[_0x370d('0x46')],{})[_0x370d('0x23')](respondWithResult(_0x120a6b,0xc9))['catch'](handleError(_0x120a6b,null));};exports[_0x370d('0x22')]=function(_0x53ac81,_0x15beae){if(_0x53ac81[_0x370d('0x46')]['id']){delete _0x53ac81['body']['id'];}return db['UserProfileSection'][_0x370d('0x43')]({'where':{'id':_0x53ac81['params']['id']}})[_0x370d('0x23')](handleEntityNotFound(_0x15beae,null))['then'](saveUpdates(_0x53ac81[_0x370d('0x46')],null))[_0x370d('0x23')](respondWithResult(_0x15beae,null))[_0x370d('0x44')](handleError(_0x15beae,null));};exports['destroy']=function(_0x4a43fc,_0xf910c4){return db['UserProfileSection']['find']({'where':{'id':_0x4a43fc[_0x370d('0x47')]['id']}})[_0x370d('0x23')](handleEntityNotFound(_0xf910c4,null))[_0x370d('0x23')](removeEntity(_0xf910c4,null))['catch'](handleError(_0xf910c4,null));};exports[_0x370d('0x48')]=function(_0xf16c40,_0x48fe24){return db['UserProfileSection'][_0x370d('0x48')]()[_0x370d('0x23')](respondWithResult(_0x48fe24,null))[_0x370d('0x44')](handleError(_0x48fe24,null));};
\ No newline at end of file
index 61df1be..48adad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93ef=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','user_profile_has_sections','sectionId','util','../../config/logger','api','moment'];(function(_0x1adffa,_0xad7505){var _0x231f18=function(_0x3d850a){while(--_0x3d850a){_0x1adffa['push'](_0x1adffa['shift']());}};_0x231f18(++_0xad7505);}(_0x93ef,0x192));var _0xf93e=function(_0x41e387,_0x13d62e){_0x41e387=_0x41e387-0x0;var _0x1f01bd=_0x93ef[_0x41e387];return _0x1f01bd;};'use strict';var _=require('lodash');var util=require(_0xf93e('0x0'));var logger=require(_0xf93e('0x1'))(_0xf93e('0x2'));var moment=require(_0xf93e('0x3'));var BPromise=require(_0xf93e('0x4'));var rp=require(_0xf93e('0x5'));var fs=require('fs');var path=require(_0xf93e('0x6'));var rimraf=require(_0xf93e('0x7'));var config=require(_0xf93e('0x8'));var attributes=require(_0xf93e('0x9'));module[_0xf93e('0xa')]=function(_0x3b8b8b,_0xa40702){return _0x3b8b8b[_0xf93e('0xb')]('UserProfileSection',attributes,{'tableName':_0xf93e('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xf93e('0xd'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaf34=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaf34,0x186));var _0x4af3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xaf34[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x4af3('0x0'));var logger=require(_0x4af3('0x1'))(_0x4af3('0x2'));var moment=require(_0x4af3('0x3'));var BPromise=require(_0x4af3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4af3('0x5'));var rimraf=require('rimraf');var config=require(_0x4af3('0x6'));var attributes=require('./userProfileSection.attributes');module[_0x4af3('0x7')]=function(_0x87298d,_0x41e0c7){return _0x87298d[_0x4af3('0x8')](_0x4af3('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x4af3('0xa'),'fields':[_0x4af3('0xb'),_0x4af3('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 93568f7..275bf36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80f2=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x122943,_0x5c2166){var _0x383304=function(_0x367e0d){while(--_0x367e0d){_0x122943['push'](_0x122943['shift']());}};_0x383304(++_0x5c2166);}(_0x80f2,0xda));var _0x280f=function(_0x314dd6,_0x8576aa){_0x314dd6=_0x314dd6-0x0;var _0x53b99c=_0x80f2[_0x314dd6];return _0x53b99c;};'use strict';var _=require(_0x280f('0x0'));var util=require(_0x280f('0x1'));var moment=require(_0x280f('0x2'));var BPromise=require(_0x280f('0x3'));var rs=require(_0x280f('0x4'));var fs=require('fs');var Redis=require(_0x280f('0x5'));var db=require(_0x280f('0x6'))['db'];var utils=require(_0x280f('0x7'));var logger=require('../../config/logger')(_0x280f('0x8'));var config=require(_0x280f('0x9'));var jayson=require(_0x280f('0xa'));var client=jayson[_0x280f('0xb')][_0x280f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18ec04,_0x169daf,_0x3ca66a){return new BPromise(function(_0x186ad4,_0x5329ef){return client[_0x280f('0xd')](_0x18ec04,_0x3ca66a)[_0x280f('0xe')](function(_0x26e841){logger[_0x280f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,_0x280f('0x10'));logger[_0x280f('0x11')](_0x280f('0x12'),_0x169daf,'request\x20sent',JSON[_0x280f('0x13')](_0x26e841));if(_0x26e841[_0x280f('0x14')]){if(_0x26e841[_0x280f('0x14')][_0x280f('0x15')]===0x1f4){logger[_0x280f('0x14')](_0x280f('0x16'),_0x169daf,_0x26e841[_0x280f('0x14')][_0x280f('0x17')]);return _0x5329ef(_0x26e841['error'][_0x280f('0x17')]);}logger[_0x280f('0x14')](_0x280f('0x16'),_0x169daf,_0x26e841['error'][_0x280f('0x17')]);return _0x186ad4(_0x26e841[_0x280f('0x14')]['message']);}else{logger[_0x280f('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,'request\x20sent');_0x186ad4(_0x26e841['result'][_0x280f('0x17')]);}})[_0x280f('0x18')](function(_0x21fe48){logger[_0x280f('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x169daf,_0x21fe48);_0x5329ef(_0x21fe48);});});}
\ No newline at end of file
+var _0xca1f=['code','UserProfileSection,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error'];(function(_0x5c4948,_0x449436){var _0x32f59b=function(_0x2f06bc){while(--_0x2f06bc){_0x5c4948['push'](_0x5c4948['shift']());}};_0x32f59b(++_0x449436);}(_0xca1f,0xd5));var _0xfca1=function(_0x4e2979,_0x4e350e){_0x4e2979=_0x4e2979-0x0;var _0x51a5cd=_0xca1f[_0x4e2979];return _0x51a5cd;};'use strict';var _=require(_0xfca1('0x0'));var util=require('util');var moment=require(_0xfca1('0x1'));var BPromise=require(_0xfca1('0x2'));var rs=require(_0xfca1('0x3'));var fs=require('fs');var Redis=require(_0xfca1('0x4'));var db=require(_0xfca1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfca1('0x6'))(_0xfca1('0x7'));var config=require(_0xfca1('0x8'));var jayson=require(_0xfca1('0x9'));var client=jayson[_0xfca1('0xa')][_0xfca1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1efbe5,_0x44ef0f,_0x590cac){return new BPromise(function(_0x3149fb,_0x25e8d0){return client[_0xfca1('0xc')](_0x1efbe5,_0x590cac)[_0xfca1('0xd')](function(_0x56336e){logger[_0xfca1('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x44ef0f,_0xfca1('0xf'));logger['debug'](_0xfca1('0x10'),_0x44ef0f,_0xfca1('0xf'),JSON['stringify'](_0x56336e));if(_0x56336e[_0xfca1('0x11')]){if(_0x56336e[_0xfca1('0x11')][_0xfca1('0x12')]===0x1f4){logger[_0xfca1('0x11')](_0xfca1('0x13'),_0x44ef0f,_0x56336e['error'][_0xfca1('0x14')]);return _0x25e8d0(_0x56336e[_0xfca1('0x11')][_0xfca1('0x14')]);}logger[_0xfca1('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x44ef0f,_0x56336e[_0xfca1('0x11')][_0xfca1('0x14')]);return _0x3149fb(_0x56336e[_0xfca1('0x11')][_0xfca1('0x14')]);}else{logger[_0xfca1('0xe')](_0xfca1('0x13'),_0x44ef0f,_0xfca1('0xf'));_0x3149fb(_0x56336e['result'][_0xfca1('0x14')]);}})['catch'](function(_0xc4a28b){logger[_0xfca1('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x44ef0f,_0xc4a28b);_0x25e8d0(_0xc4a28b);});});}
\ No newline at end of file
index a3c7eff..5129585 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(_0x46ee3c,_0x1c08f0){var _0x530a97=function(_0x194bba){while(--_0x194bba){_0x46ee3c['push'](_0x46ee3c['shift']());}};_0x530a97(++_0x1c08f0);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2160f5,_0x4d2efa){var _0xb30d61=function(_0x44acba){while(--_0x44acba){_0x2160f5['push'](_0x2160f5['shift']());}};_0xb30d61(++_0x4d2efa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0xcb91[_0x1c7889];return _0x2f14e5;};'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 372089b..7910fb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe93b=['exports','INTEGER','sequelize'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xe93b,0x16a));var _0xbe93=function(_0xf7edae,_0x498714){_0xf7edae=_0xf7edae-0x0;var _0x13e30a=_0xe93b[_0xf7edae];return _0x13e30a;};'use strict';var Sequelize=require(_0xbe93('0x0'));module[_0xbe93('0x1')]={'penalty':{'type':Sequelize[_0xbe93('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9a8b=['sequelize','exports'];(function(_0x1d0a9d,_0x2d0656){var _0x725b6a=function(_0x45abea){while(--_0x45abea){_0x1d0a9d['push'](_0x1d0a9d['shift']());}};_0x725b6a(++_0x2d0656);}(_0x9a8b,0x1ba));var _0xb9a8=function(_0x19fcf9,_0x253afb){_0x19fcf9=_0x19fcf9-0x0;var _0x43157b=_0x9a8b[_0x19fcf9];return _0x43157b;};'use strict';var Sequelize=require(_0xb9a8('0x0'));module[_0xb9a8('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 19fd47f..d718cb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3d8a41,_0x2b0fbe){var _0x28675e=function(_0x222859){while(--_0x222859){_0x3d8a41['push'](_0x3d8a41['shift']());}};_0x28675e(++_0x2b0fbe);}(_0xe5af,0x9c));var _0xfe5a=function(_0x5c3a99,_0x3a6edc){_0x5c3a99=_0x5c3a99-0x0;var _0x54e700=_0xe5af[_0x5c3a99];return _0x54e700;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var logger=require(_0xfe5a('0x1'))('api');var moment=require(_0xfe5a('0x2'));var BPromise=require(_0xfe5a('0x3'));var rp=require(_0xfe5a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe5a('0x5'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0xfe5a('0x6')]=function(_0x2039cd,_0x4e418f){return _0x2039cd['define'](_0xfe5a('0x7'),attributes,{'tableName':_0xfe5a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ccb=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x2741dd,_0x46d6da){var _0x55703d=function(_0x15c20a){while(--_0x15c20a){_0x2741dd['push'](_0x2741dd['shift']());}};_0x55703d(++_0x46d6da);}(_0x4ccb,0x196));var _0xb4cc=function(_0x4cd85b,_0x2abba3){_0x4cd85b=_0x4cd85b-0x0;var _0x36c61f=_0x4ccb[_0x4cd85b];return _0x36c61f;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var logger=require(_0xb4cc('0x2'))('api');var moment=require(_0xb4cc('0x3'));var BPromise=require(_0xb4cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4cc('0x5'));var rimraf=require(_0xb4cc('0x6'));var config=require(_0xb4cc('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xb4cc('0x8')]=function(_0x2181b2,_0x1e19dd){return _0x2181b2['define'](_0xb4cc('0x9'),attributes,{'tableName':_0xb4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 43c52d6..45e7812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f58=['info','UserSmsQueue,\x20%s,\x20%s','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x11e5c0,_0x3d493d){var _0x1270db=function(_0x564804){while(--_0x564804){_0x11e5c0['push'](_0x11e5c0['shift']());}};_0x1270db(++_0x3d493d);}(_0x6f58,0x182));var _0x86f5=function(_0x3aff20,_0x508ccc){_0x3aff20=_0x3aff20-0x0;var _0x389e89=_0x6f58[_0x3aff20];return _0x389e89;};'use strict';var _=require(_0x86f5('0x0'));var util=require(_0x86f5('0x1'));var moment=require(_0x86f5('0x2'));var BPromise=require(_0x86f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86f5('0x5'));var logger=require(_0x86f5('0x6'))(_0x86f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x86f5('0x8'));var client=jayson[_0x86f5('0x9')][_0x86f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31c73a,_0x1fbb29,_0x4ac57c){return new BPromise(function(_0x586888,_0x46c885){return client[_0x86f5('0xb')](_0x31c73a,_0x4ac57c)[_0x86f5('0xc')](function(_0x549b8b){logger[_0x86f5('0xd')](_0x86f5('0xe'),_0x1fbb29,'request\x20sent');logger['debug'](_0x86f5('0xf'),_0x1fbb29,_0x86f5('0x10'),JSON[_0x86f5('0x11')](_0x549b8b));if(_0x549b8b['error']){if(_0x549b8b[_0x86f5('0x12')]['code']===0x1f4){logger[_0x86f5('0x12')](_0x86f5('0xe'),_0x1fbb29,_0x549b8b[_0x86f5('0x12')][_0x86f5('0x13')]);return _0x46c885(_0x549b8b[_0x86f5('0x12')][_0x86f5('0x13')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1fbb29,_0x549b8b[_0x86f5('0x12')]['message']);return _0x586888(_0x549b8b['error'][_0x86f5('0x13')]);}else{logger['info'](_0x86f5('0xe'),_0x1fbb29,_0x86f5('0x10'));_0x586888(_0x549b8b[_0x86f5('0x14')][_0x86f5('0x13')]);}})['catch'](function(_0x4889e7){logger[_0x86f5('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x1fbb29,_0x4889e7);_0x46c885(_0x4889e7);});});}
\ No newline at end of file
+var _0xd4e2=['UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xd4e2,0x1a2));var _0x2d4e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd4e2[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2d4e('0x0'));var util=require(_0x2d4e('0x1'));var moment=require(_0x2d4e('0x2'));var BPromise=require(_0x2d4e('0x3'));var rs=require(_0x2d4e('0x4'));var fs=require('fs');var Redis=require(_0x2d4e('0x5'));var db=require(_0x2d4e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d4e('0x7'))(_0x2d4e('0x8'));var config=require(_0x2d4e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2d4e('0xa')][_0x2d4e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3426c9,_0x151e4e,_0x28267c){return new BPromise(function(_0x45ed13,_0x255fe9){return client[_0x2d4e('0xc')](_0x3426c9,_0x28267c)[_0x2d4e('0xd')](function(_0xc43b63){logger['info'](_0x2d4e('0xe'),_0x151e4e,'request\x20sent');logger[_0x2d4e('0xf')](_0x2d4e('0x10'),_0x151e4e,_0x2d4e('0x11'),JSON[_0x2d4e('0x12')](_0xc43b63));if(_0xc43b63['error']){if(_0xc43b63[_0x2d4e('0x13')][_0x2d4e('0x14')]===0x1f4){logger[_0x2d4e('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x151e4e,_0xc43b63[_0x2d4e('0x13')][_0x2d4e('0x15')]);return _0x255fe9(_0xc43b63[_0x2d4e('0x13')][_0x2d4e('0x15')]);}logger[_0x2d4e('0x13')](_0x2d4e('0xe'),_0x151e4e,_0xc43b63[_0x2d4e('0x13')][_0x2d4e('0x15')]);return _0x45ed13(_0xc43b63[_0x2d4e('0x13')]['message']);}else{logger[_0x2d4e('0x16')]('UserSmsQueue,\x20%s,\x20%s',_0x151e4e,_0x2d4e('0x11'));_0x45ed13(_0xc43b63['result']['message']);}})[_0x2d4e('0x17')](function(_0x2f5181){logger[_0x2d4e('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x151e4e,_0x2f5181);_0x255fe9(_0x2f5181);});});}
\ No newline at end of file
index da28176..3dc83c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31e8=['exports','INTEGER','sequelize'];(function(_0xe51596,_0x314d5b){var _0x22c705=function(_0x4c6f94){while(--_0x4c6f94){_0xe51596['push'](_0xe51596['shift']());}};_0x22c705(++_0x314d5b);}(_0x31e8,0x1b2));var _0x831e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x31e8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x831e('0x0'));module[_0x831e('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x831e('0x2')]}};
\ No newline at end of file
+var _0xbfc0=['INTEGER'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xbfc0,0x11d));var _0x0bfc=function(_0x5c0979,_0x287854){_0x5c0979=_0x5c0979-0x0;var _0x309972=_0xbfc0[_0x5c0979];return _0x309972;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0x0bfc('0x0')]},'VoicePrefixId':{'type':Sequelize[_0x0bfc('0x0')]}};
\ No newline at end of file
index 3e51786..b12d27b 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(_0x245282,_0x3f8f50){var _0x5c998e=function(_0x212563){while(--_0x212563){_0x245282['push'](_0x245282['shift']());}};_0x5c998e(++_0x3f8f50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x4ff1fa,_0x8f0a94){var _0x446cfe=function(_0x5296d2){while(--_0x5296d2){_0x4ff1fa['push'](_0x4ff1fa['shift']());}};_0x446cfe(++_0x8f0a94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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 08950cf..a58b52a 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(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x55de41,_0x29e5d1){var _0x1117e3=function(_0x2dad7f){while(--_0x2dad7f){_0x55de41['push'](_0x55de41['shift']());}};_0x1117e3(++_0x29e5d1);}(_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 e55fe13..536be14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6088=['sequelize','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6088,0x188));var _0x8608=function(_0x2be345,_0x320e80){_0x2be345=_0x2be345-0x0;var _0x53db79=_0x6088[_0x2be345];return _0x53db79;};'use strict';var Sequelize=require(_0x8608('0x0'));module[_0x8608('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xefe9=['INTEGER','sequelize','exports'];(function(_0x2fc69b,_0x55537d){var _0x25e3c9=function(_0x4da4b5){while(--_0x4da4b5){_0x2fc69b['push'](_0x2fc69b['shift']());}};_0x25e3c9(++_0x55537d);}(_0xefe9,0xee));var _0x9efe=function(_0x527266,_0x4ed87c){_0x527266=_0x527266-0x0;var _0x47ca88=_0xefe9[_0x527266];return _0x47ca88;};'use strict';var Sequelize=require(_0x9efe('0x0'));module[_0x9efe('0x1')]={'penalty':{'type':Sequelize[_0x9efe('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 142c28b..6c58001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4cd=['define','UserVoiceQueue','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x19635b,_0x5e7134){var _0x182b89=function(_0x1ec2a1){while(--_0x1ec2a1){_0x19635b['push'](_0x19635b['shift']());}};_0x182b89(++_0x5e7134);}(_0xa4cd,0x70));var _0xda4c=function(_0xa19c53,_0x188f53){_0xa19c53=_0xa19c53-0x0;var _0x447226=_0xa4cd[_0xa19c53];return _0x447226;};'use strict';var _=require(_0xda4c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda4c('0x1'));var moment=require(_0xda4c('0x2'));var BPromise=require('bluebird');var rp=require(_0xda4c('0x3'));var fs=require('fs');var path=require(_0xda4c('0x4'));var rimraf=require(_0xda4c('0x5'));var config=require(_0xda4c('0x6'));var attributes=require(_0xda4c('0x7'));module['exports']=function(_0x5521f8,_0x263496){return _0x5521f8[_0xda4c('0x8')](_0xda4c('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9153=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x23635c,_0x2c9f6f){var _0x240a52=function(_0x44d511){while(--_0x44d511){_0x23635c['push'](_0x23635c['shift']());}};_0x240a52(++_0x2c9f6f);}(_0x9153,0x1a7));var _0x3915=function(_0x5056b9,_0x294f10){_0x5056b9=_0x5056b9-0x0;var _0x430129=_0x9153[_0x5056b9];return _0x430129;};'use strict';var _=require(_0x3915('0x0'));var util=require(_0x3915('0x1'));var logger=require(_0x3915('0x2'))(_0x3915('0x3'));var moment=require('moment');var BPromise=require(_0x3915('0x4'));var rp=require(_0x3915('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3915('0x6'));var config=require(_0x3915('0x7'));var attributes=require(_0x3915('0x8'));module[_0x3915('0x9')]=function(_0x2e6f92,_0x376288){return _0x2e6f92[_0x3915('0xa')](_0x3915('0xb'),attributes,{'tableName':_0x3915('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53c0f9d..7404499 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cfa=['client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6cfa,0xa6));var _0xa6cf=function(_0x30726a,_0x5cef0c){_0x30726a=_0x30726a-0x0;var _0x471bd2=_0x6cfa[_0x30726a];return _0x471bd2;};'use strict';var _=require(_0xa6cf('0x0'));var util=require(_0xa6cf('0x1'));var moment=require('moment');var BPromise=require(_0xa6cf('0x2'));var rs=require(_0xa6cf('0x3'));var fs=require('fs');var Redis=require(_0xa6cf('0x4'));var db=require(_0xa6cf('0x5'))['db'];var utils=require(_0xa6cf('0x6'));var logger=require(_0xa6cf('0x7'))(_0xa6cf('0x8'));var config=require(_0xa6cf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa6cf('0xa')][_0xa6cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ad04c,_0x296179,_0x52999e){return new BPromise(function(_0x4eb3c8,_0x4824ec){return client[_0xa6cf('0xc')](_0x1ad04c,_0x52999e)[_0xa6cf('0xd')](function(_0x54a535){logger[_0xa6cf('0xe')](_0xa6cf('0xf'),_0x296179,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x296179,_0xa6cf('0x10'),JSON[_0xa6cf('0x11')](_0x54a535));if(_0x54a535[_0xa6cf('0x12')]){if(_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x13')]===0x1f4){logger['error'](_0xa6cf('0xf'),_0x296179,_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);return _0x4824ec(_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);}logger[_0xa6cf('0x12')](_0xa6cf('0xf'),_0x296179,_0x54a535[_0xa6cf('0x12')][_0xa6cf('0x14')]);return _0x4eb3c8(_0x54a535['error'][_0xa6cf('0x14')]);}else{logger[_0xa6cf('0xe')](_0xa6cf('0xf'),_0x296179,_0xa6cf('0x10'));_0x4eb3c8(_0x54a535[_0xa6cf('0x15')]['message']);}})['catch'](function(_0x42b695){logger[_0xa6cf('0x12')](_0xa6cf('0xf'),_0x296179,_0x42b695);_0x4824ec(_0x42b695);});});}
\ No newline at end of file
+var _0x7e0c=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x4f63f9,_0x18963f){var _0x27d595=function(_0x1c49db){while(--_0x1c49db){_0x4f63f9['push'](_0x4f63f9['shift']());}};_0x27d595(++_0x18963f);}(_0x7e0c,0x66));var _0xc7e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e0c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc7e0('0x0'));var util=require(_0xc7e0('0x1'));var moment=require(_0xc7e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7e0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7e0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7e0('0x5'));var config=require(_0xc7e0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc7e0('0x7')][_0xc7e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e1926,_0x4d39ef,_0x50aca9){return new BPromise(function(_0x87cc29,_0x2e2d83){return client['request'](_0x5e1926,_0x50aca9)['then'](function(_0x32b1dc){logger[_0xc7e0('0x9')](_0xc7e0('0xa'),_0x4d39ef,_0xc7e0('0xb'));logger[_0xc7e0('0xc')](_0xc7e0('0xd'),_0x4d39ef,_0xc7e0('0xb'),JSON[_0xc7e0('0xe')](_0x32b1dc));if(_0x32b1dc['error']){if(_0x32b1dc[_0xc7e0('0xf')]['code']===0x1f4){logger[_0xc7e0('0xf')](_0xc7e0('0xa'),_0x4d39ef,_0x32b1dc[_0xc7e0('0xf')][_0xc7e0('0x10')]);return _0x2e2d83(_0x32b1dc['error'][_0xc7e0('0x10')]);}logger[_0xc7e0('0xf')](_0xc7e0('0xa'),_0x4d39ef,_0x32b1dc[_0xc7e0('0xf')][_0xc7e0('0x10')]);return _0x87cc29(_0x32b1dc[_0xc7e0('0xf')]['message']);}else{logger['info'](_0xc7e0('0xa'),_0x4d39ef,_0xc7e0('0xb'));_0x87cc29(_0x32b1dc[_0xc7e0('0x11')][_0xc7e0('0x10')]);}})[_0xc7e0('0x12')](function(_0x457083){logger[_0xc7e0('0xf')](_0xc7e0('0xa'),_0x4d39ef,_0x457083);_0x2e2d83(_0x457083);});});}
\ No newline at end of file
index b0d85e6..91b481d 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(_0x54e4fd,_0x4059d4){var _0x50cbb2=function(_0x47549d){while(--_0x47549d){_0x54e4fd['push'](_0x54e4fd['shift']());}};_0x50cbb2(++_0x4059d4);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x395f63,_0x2cfb5f){var _0x580f5c=function(_0x5ebbbf){while(--_0x5ebbbf){_0x395f63['push'](_0x395f63['shift']());}};_0x580f5c(++_0x2cfb5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 eafaa76..aab1047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9b9=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x57aa3d,_0x4c4899){var _0x4a6cc6=function(_0x210859){while(--_0x210859){_0x57aa3d['push'](_0x57aa3d['shift']());}};_0x4a6cc6(++_0x4c4899);}(_0xd9b9,0x118));var _0x9d9b=function(_0x16d278,_0x19ce90){_0x16d278=_0x16d278-0x0;var _0x3e4b01=_0xd9b9[_0x16d278];return _0x3e4b01;};'use strict';var Sequelize=require(_0x9d9b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9d9b('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9d9b('0x2')},'membername':{'type':Sequelize[_0x9d9b('0x3')],'allowNull':![],'comment':_0x9d9b('0x2')},'UserId':{'type':Sequelize[_0x9d9b('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x9d9b('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x9d9b('0x2')},'VoiceQueueId':{'type':Sequelize[_0x9d9b('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x9d9b('0x2')},'penalty':{'type':Sequelize[_0x9d9b('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x9d9b('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0x1c90=['exports','INTEGER','Required\x20by\x20Asterisk','queue_interface'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x1c90,0x104));var _0x01c9=function(_0x503472,_0x4c41d2){_0x503472=_0x503472-0x0;var _0xa63d72=_0x1c90[_0x503472];return _0xa63d72;};'use strict';var Sequelize=require('sequelize');module[_0x01c9('0x0')]={'uniqueid':{'type':Sequelize[_0x01c9('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x01c9('0x2')},'UserId':{'type':Sequelize[_0x01c9('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x01c9('0x3'),'comment':_0x01c9('0x2')},'VoiceQueueId':{'type':Sequelize[_0x01c9('0x1')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x01c9('0x3'),'comment':_0x01c9('0x2')},'penalty':{'type':Sequelize[_0x01c9('0x1')](0xb),'defaultValue':0x0,'comment':_0x01c9('0x2')},'paused':{'type':Sequelize[_0x01c9('0x1')](0xb),'defaultValue':0x0,'comment':_0x01c9('0x2')}};
\ No newline at end of file
index b9912d4..4e0ca50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ca=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5c9403,_0x28e328){var _0x1d05fd=function(_0x2c7a19){while(--_0x2c7a19){_0x5c9403['push'](_0x5c9403['shift']());}};_0x1d05fd(++_0x28e328);}(_0x02ca,0xe7));var _0xa02c=function(_0x2be255,_0x250130){_0x2be255=_0x2be255-0x0;var _0x491cf3=_0x02ca[_0x2be255];return _0x491cf3;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xa02c('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa02c('0x1')](0x0);var events={'afterCreate':_0xa02c('0x2'),'afterUpdate':'update','afterDestroy':_0xa02c('0x3')};function emitEvent(_0x10fbe5){return function(_0x1512d8,_0x2ffe22,_0xebe969){UserVoiceQueueRtEvents['emit'](_0x10fbe5+':'+_0x1512d8['id'],_0x1512d8);UserVoiceQueueRtEvents[_0xa02c('0x4')](_0x10fbe5,_0x1512d8);_0xebe969(null);};}for(var e in events){if(events[_0xa02c('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xa02c('0x6')](e,emitEvent(event));}}module[_0xa02c('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x9486=['events','../../mysqldb','UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty'];(function(_0x308e8b,_0xeba8fb){var _0x4859bc=function(_0x3f8136){while(--_0x3f8136){_0x308e8b['push'](_0x308e8b['shift']());}};_0x4859bc(++_0xeba8fb);}(_0x9486,0x110));var _0x6948=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9486[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0x6948('0x0'));var UserVoiceQueueRt=require(_0x6948('0x1'))['db'][_0x6948('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6948('0x3'),'afterUpdate':_0x6948('0x4'),'afterDestroy':_0x6948('0x5')};function emitEvent(_0x278382){return function(_0x40c78d,_0x40393c,_0x5dc963){UserVoiceQueueRtEvents[_0x6948('0x6')](_0x278382+':'+_0x40c78d['id'],_0x40c78d);UserVoiceQueueRtEvents[_0x6948('0x6')](_0x278382,_0x40c78d);_0x5dc963(null);};}for(var e in events){if(events[_0x6948('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
index 2216f01..1e1a81d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56cf=['exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','path','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x56cf,0x18b));var _0xf56c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56cf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf56c('0x0'));var util=require('util');var logger=require(_0xf56c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf56c('0x2'));var rimraf=require('rimraf');var config=require(_0xf56c('0x3'));var attributes=require(_0xf56c('0x4'));module[_0xf56c('0x5')]=function(_0x595b1,_0x51c061){return _0x595b1['define'](_0xf56c('0x6'),attributes,{'tableName':_0xf56c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x767c=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./userVoiceQueueRt.attributes','exports'];(function(_0x29144b,_0x40edec){var _0x351153=function(_0x415bcf){while(--_0x415bcf){_0x29144b['push'](_0x29144b['shift']());}};_0x351153(++_0x40edec);}(_0x767c,0x153));var _0xc767=function(_0x230469,_0x187146){_0x230469=_0x230469-0x0;var _0x19aa05=_0x767c[_0x230469];return _0x19aa05;};'use strict';var _=require(_0xc767('0x0'));var util=require('util');var logger=require(_0xc767('0x1'))(_0xc767('0x2'));var moment=require(_0xc767('0x3'));var BPromise=require(_0xc767('0x4'));var rp=require(_0xc767('0x5'));var fs=require('fs');var path=require(_0xc767('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc767('0x7'));module[_0xc767('0x8')]=function(_0x1b9b9f,_0x56703a){return _0x1b9b9f[_0xc767('0x9')](_0xc767('0xa'),attributes,{'tableName':_0xc767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c6af0e..83cd591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc117=['register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x539e71,_0x4deb48){var _0xe1e8b8=function(_0x37a803){while(--_0x37a803){_0x539e71['push'](_0x539e71['shift']());}};_0xe1e8b8(++_0x4deb48);}(_0xc117,0xbc));var _0x7c11=function(_0x5cef55,_0x53e114){_0x5cef55=_0x5cef55-0x0;var _0x20c353=_0xc117[_0x5cef55];return _0x20c353;};'use strict';var _=require(_0x7c11('0x0'));var util=require(_0x7c11('0x1'));var moment=require('moment');var BPromise=require(_0x7c11('0x2'));var rs=require(_0x7c11('0x3'));var fs=require('fs');var Redis=require(_0x7c11('0x4'));var db=require(_0x7c11('0x5'))['db'];var utils=require(_0x7c11('0x6'));var logger=require(_0x7c11('0x7'))(_0x7c11('0x8'));var config=require(_0x7c11('0x9'));var jayson=require(_0x7c11('0xa'));var client=jayson[_0x7c11('0xb')][_0x7c11('0xc')]({'port':0x232a});config['redis']=_[_0x7c11('0xd')](config[_0x7c11('0xe')],{'host':_0x7c11('0xf'),'port':0x18eb});var socket=require(_0x7c11('0x10'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x7c11('0x11')](socket);function respondWithRpcPromise(_0x1f18da,_0x2d9f8e,_0x55aff7){return new BPromise(function(_0xddde98,_0x4cd340){return client[_0x7c11('0x12')](_0x1f18da,_0x55aff7)[_0x7c11('0x13')](function(_0x541105){logger[_0x7c11('0x14')](_0x7c11('0x15'),_0x2d9f8e,_0x7c11('0x16'));logger[_0x7c11('0x17')](_0x7c11('0x18'),_0x2d9f8e,_0x7c11('0x16'),JSON['stringify'](_0x541105));if(_0x541105[_0x7c11('0x19')]){if(_0x541105[_0x7c11('0x19')][_0x7c11('0x1a')]===0x1f4){logger[_0x7c11('0x19')](_0x7c11('0x15'),_0x2d9f8e,_0x541105['error'][_0x7c11('0x1b')]);return _0x4cd340(_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);return _0xddde98(_0x541105[_0x7c11('0x19')][_0x7c11('0x1b')]);}else{logger[_0x7c11('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x7c11('0x16'));_0xddde98(_0x541105[_0x7c11('0x1c')][_0x7c11('0x1b')]);}})['catch'](function(_0x9d7246){logger[_0x7c11('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2d9f8e,_0x9d7246);_0x4cd340(_0x9d7246);});});}exports[_0x7c11('0x1d')]=function(_0x4126ee){var _0x2bf566=this;return new Promise(function(_0x1dd0f4,_0x466cf7){return db[_0x7c11('0x1e')]['findAll']({'raw':_0x4126ee[_0x7c11('0x1f')]?_0x4126ee[_0x7c11('0x1f')][_0x7c11('0x20')]===undefined?!![]:![]:!![],'where':_0x4126ee[_0x7c11('0x1f')]?_0x4126ee[_0x7c11('0x1f')][_0x7c11('0x21')]||null:null,'attributes':[[db[_0x7c11('0x22')]['fn'](_0x7c11('0x23'),db[_0x7c11('0x22')]['fn']('IF',db[_0x7c11('0x22')][_0x7c11('0x24')](_0x7c11('0x25')))),_0x7c11('0x26')]]})[_0x7c11('0x13')](function(_0x28d8c3){logger['info'](_0x7c11('0x1d'),_0x4126ee);logger[_0x7c11('0x17')](_0x7c11('0x1d'),_0x4126ee,JSON[_0x7c11('0x27')](_0x28d8c3));_0x1dd0f4(_0x28d8c3);})[_0x7c11('0x28')](function(_0x128f57){logger[_0x7c11('0x19')](_0x7c11('0x1d'),_0x128f57['message'],_0x4126ee);_0x466cf7(_0x2bf566['error'](0x1f4,_0x128f57[_0x7c11('0x1b')]));});});};
\ No newline at end of file
+var _0x22f8=['UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x579308,_0x64cc48){var _0x400107=function(_0x1781b9){while(--_0x1781b9){_0x579308['push'](_0x579308['shift']());}};_0x400107(++_0x64cc48);}(_0x22f8,0x140));var _0x822f=function(_0x8ad45d,_0x2c14cd){_0x8ad45d=_0x8ad45d-0x0;var _0x1c31b0=_0x22f8[_0x8ad45d];return _0x1c31b0;};'use strict';var _=require(_0x822f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x822f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x822f('0x2'));var db=require(_0x822f('0x3'))['db'];var utils=require(_0x822f('0x4'));var logger=require('../../config/logger')(_0x822f('0x5'));var config=require(_0x822f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x822f('0x7')][_0x822f('0x8')]({'port':0x232a});config[_0x822f('0x9')]=_['defaults'](config['redis'],{'host':_0x822f('0xa'),'port':0x18eb});var socket=require(_0x822f('0xb'))(new Redis(config[_0x822f('0x9')]));require(_0x822f('0xc'))[_0x822f('0xd')](socket);function respondWithRpcPromise(_0x34aef4,_0x5bb505,_0x5f2ff7){return new BPromise(function(_0x51689b,_0x543645){return client[_0x822f('0xe')](_0x34aef4,_0x5f2ff7)[_0x822f('0xf')](function(_0x344a79){logger[_0x822f('0x10')](_0x822f('0x11'),_0x5bb505,_0x822f('0x12'));logger[_0x822f('0x13')](_0x822f('0x14'),_0x5bb505,'request\x20sent',JSON[_0x822f('0x15')](_0x344a79));if(_0x344a79[_0x822f('0x16')]){if(_0x344a79['error'][_0x822f('0x17')]===0x1f4){logger[_0x822f('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bb505,_0x344a79[_0x822f('0x16')]['message']);return _0x543645(_0x344a79['error'][_0x822f('0x18')]);}logger['error'](_0x822f('0x11'),_0x5bb505,_0x344a79['error'][_0x822f('0x18')]);return _0x51689b(_0x344a79['error']['message']);}else{logger[_0x822f('0x10')](_0x822f('0x11'),_0x5bb505,'request\x20sent');_0x51689b(_0x344a79['result'][_0x822f('0x18')]);}})[_0x822f('0x19')](function(_0x6b6124){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x5bb505,_0x6b6124);_0x543645(_0x6b6124);});});}exports[_0x822f('0x1a')]=function(_0x4d6a5d){var _0x4c6171=this;return new Promise(function(_0x186b25,_0x210449){return db[_0x822f('0x1b')]['findAll']({'raw':_0x4d6a5d[_0x822f('0x1c')]?_0x4d6a5d[_0x822f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4d6a5d['options']?_0x4d6a5d[_0x822f('0x1c')][_0x822f('0x1d')]||null:null,'attributes':[[db[_0x822f('0x1e')]['fn']('COUNT',db[_0x822f('0x1e')]['fn']('IF',db[_0x822f('0x1e')][_0x822f('0x1f')](_0x822f('0x20')))),_0x822f('0x21')]]})[_0x822f('0xf')](function(_0x114cf7){logger[_0x822f('0x10')](_0x822f('0x1a'),_0x4d6a5d);logger[_0x822f('0x13')](_0x822f('0x1a'),_0x4d6a5d,JSON[_0x822f('0x15')](_0x114cf7));_0x186b25(_0x114cf7);})[_0x822f('0x19')](function(_0x29ff49){logger[_0x822f('0x16')](_0x822f('0x1a'),_0x29ff49['message'],_0x4d6a5d);_0x210449(_0x4c6171[_0x822f('0x16')](0x1f4,_0x29ff49['message']));});});};
\ No newline at end of file
index 93668a2..9f4d977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf70=['removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x1a1072,_0x84a807){var _0x415142=function(_0x3c20d6){while(--_0x3c20d6){_0x1a1072['push'](_0x1a1072['shift']());}};_0x415142(++_0x84a807);}(_0xdf70,0x86));var _0x0df7=function(_0x4025b4,_0x339dd1){_0x4025b4=_0x4025b4-0x0;var _0x3d5fad=_0xdf70[_0x4025b4];return _0x3d5fad;};'use strict';var UserVoiceQueueRtEvents=require(_0x0df7('0x0'));var events=[_0x0df7('0x1'),_0x0df7('0x2'),'update'];function createListener(_0x380bec,_0x2267dd){return function(_0x530905){_0x2267dd[_0x0df7('0x3')](_0x380bec,_0x530905);};}function removeListener(_0x4ae128,_0x278b96){return function(){UserVoiceQueueRtEvents[_0x0df7('0x4')](_0x4ae128,_0x278b96);};}exports['register']=function(_0x523ac0){for(var _0x2521b6=0x0,_0x42090d=events['length'];_0x2521b6<_0x42090d;_0x2521b6++){var _0x1f1680=events[_0x2521b6];var _0x392337=createListener(_0x0df7('0x5')+_0x1f1680,_0x523ac0);UserVoiceQueueRtEvents['on'](_0x1f1680,_0x392337);}};
\ No newline at end of file
+var _0xf722=['register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0xf722,0x18f));var _0x2f72=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf722[_0x5ddb1c];return _0x354adc;};'use strict';var UserVoiceQueueRtEvents=require(_0x2f72('0x0'));var events=[_0x2f72('0x1'),_0x2f72('0x2'),_0x2f72('0x3')];function createListener(_0x5e6b94,_0x23d53e){return function(_0x297070){_0x23d53e[_0x2f72('0x4')](_0x5e6b94,_0x297070);};}function removeListener(_0x418aed,_0x47d759){return function(){UserVoiceQueueRtEvents[_0x2f72('0x5')](_0x418aed,_0x47d759);};}exports[_0x2f72('0x6')]=function(_0x334168){for(var _0x537e3d=0x0,_0x4d4cf4=events[_0x2f72('0x7')];_0x537e3d<_0x4d4cf4;_0x537e3d++){var _0x3cb15e=events[_0x537e3d];var _0x1f3afb=createListener(_0x2f72('0x8')+_0x3cb15e,_0x334168);UserVoiceQueueRtEvents['on'](_0x3cb15e,_0x1f3afb);}};
\ No newline at end of file
index ef66d44..a9e1c25 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(_0x1f0948,_0x329e59){var _0x2c8175=function(_0x1bed09){while(--_0x1bed09){_0x1f0948['push'](_0x1f0948['shift']());}};_0x2c8175(++_0x329e59);}(_0xe706,0xa3));var _0x6e70=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xe706[_0x393d69];return _0x3cee37;};'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(_0x33832e,_0x3fa9c4){var _0x24130d=function(_0x173ec5){while(--_0x173ec5){_0x33832e['push'](_0x33832e['shift']());}};_0x24130d(++_0x3fa9c4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 548f044..282c666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa800=['sequelize','exports','INTEGER'];(function(_0x5b376e,_0x61c7c3){var _0x364769=function(_0xa5dce2){while(--_0xa5dce2){_0x5b376e['push'](_0x5b376e['shift']());}};_0x364769(++_0x61c7c3);}(_0xa800,0x1a7));var _0x0a80=function(_0xf93b08,_0x2559d7){_0xf93b08=_0xf93b08-0x0;var _0x12f72e=_0xa800[_0xf93b08];return _0x12f72e;};'use strict';var Sequelize=require(_0x0a80('0x0'));module[_0x0a80('0x1')]={'penalty':{'type':Sequelize[_0x0a80('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x40fc=['exports','INTEGER','sequelize'];(function(_0x835c24,_0x485929){var _0x1dace3=function(_0x5c0216){while(--_0x5c0216){_0x835c24['push'](_0x835c24['shift']());}};_0x1dace3(++_0x485929);}(_0x40fc,0x182));var _0xc40f=function(_0x16e0f5,_0x4ec0f3){_0x16e0f5=_0x16e0f5-0x0;var _0x4839d5=_0x40fc[_0x16e0f5];return _0x4839d5;};'use strict';var Sequelize=require(_0xc40f('0x0'));module[_0xc40f('0x1')]={'penalty':{'type':Sequelize[_0xc40f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 593aaba..844e9f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ceb=['define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports'];(function(_0x365c92,_0xe33979){var _0x4fa598=function(_0x405d87){while(--_0x405d87){_0x365c92['push'](_0x365c92['shift']());}};_0x4fa598(++_0xe33979);}(_0x9ceb,0x1ed));var _0xb9ce=function(_0x16318f,_0x2edf62){_0x16318f=_0x16318f-0x0;var _0x57ee83=_0x9ceb[_0x16318f];return _0x57ee83;};'use strict';var _=require(_0xb9ce('0x0'));var util=require(_0xb9ce('0x1'));var logger=require('../../config/logger')(_0xb9ce('0x2'));var moment=require(_0xb9ce('0x3'));var BPromise=require(_0xb9ce('0x4'));var rp=require(_0xb9ce('0x5'));var fs=require('fs');var path=require(_0xb9ce('0x6'));var rimraf=require(_0xb9ce('0x7'));var config=require(_0xb9ce('0x8'));var attributes=require(_0xb9ce('0x9'));module[_0xb9ce('0xa')]=function(_0x496276,_0x85b075){return _0x496276[_0xb9ce('0xb')](_0xb9ce('0xc'),attributes,{'tableName':_0xb9ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x713d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x713d,0x98));var _0xd713=function(_0x329aa6,_0x46c1ad){_0x329aa6=_0x329aa6-0x0;var _0x148f9c=_0x713d[_0x329aa6];return _0x148f9c;};'use strict';var _=require(_0xd713('0x0'));var util=require(_0xd713('0x1'));var logger=require(_0xd713('0x2'))(_0xd713('0x3'));var moment=require(_0xd713('0x4'));var BPromise=require(_0xd713('0x5'));var rp=require(_0xd713('0x6'));var fs=require('fs');var path=require(_0xd713('0x7'));var rimraf=require(_0xd713('0x8'));var config=require(_0xd713('0x9'));var attributes=require(_0xd713('0xa'));module[_0xd713('0xb')]=function(_0x32364d,_0x4306a3){return _0x32364d[_0xd713('0xc')](_0xd713('0xd'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cdd7841..e3744ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f5f=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x3f5f,0xd0));var _0xf3f5=function(_0x325e1e,_0x903510){_0x325e1e=_0x325e1e-0x0;var _0x33aa0f=_0x3f5f[_0x325e1e];return _0x33aa0f;};'use strict';var _=require(_0xf3f5('0x0'));var util=require(_0xf3f5('0x1'));var moment=require(_0xf3f5('0x2'));var BPromise=require(_0xf3f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3f5('0x4'));var db=require(_0xf3f5('0x5'))['db'];var utils=require(_0xf3f5('0x6'));var logger=require('../../config/logger')(_0xf3f5('0x7'));var config=require(_0xf3f5('0x8'));var jayson=require(_0xf3f5('0x9'));var client=jayson[_0xf3f5('0xa')][_0xf3f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15b562,_0x546352,_0x1d4f7e){return new BPromise(function(_0x1d3754,_0x42af1c){return client['request'](_0x15b562,_0x1d4f7e)[_0xf3f5('0xc')](function(_0x2a4e64){logger['info'](_0xf3f5('0xd'),_0x546352,_0xf3f5('0xe'));logger[_0xf3f5('0xf')](_0xf3f5('0x10'),_0x546352,_0xf3f5('0xe'),JSON[_0xf3f5('0x11')](_0x2a4e64));if(_0x2a4e64[_0xf3f5('0x12')]){if(_0x2a4e64[_0xf3f5('0x12')][_0xf3f5('0x13')]===0x1f4){logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x2a4e64['error'][_0xf3f5('0x14')]);return _0x42af1c(_0x2a4e64[_0xf3f5('0x12')][_0xf3f5('0x14')]);}logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x2a4e64['error'][_0xf3f5('0x14')]);return _0x1d3754(_0x2a4e64[_0xf3f5('0x12')]['message']);}else{logger[_0xf3f5('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x546352,_0xf3f5('0xe'));_0x1d3754(_0x2a4e64['result']['message']);}})[_0xf3f5('0x16')](function(_0x35551a){logger[_0xf3f5('0x12')](_0xf3f5('0xd'),_0x546352,_0x35551a);_0x42af1c(_0x35551a);});});}
\ No newline at end of file
+var _0x1acc=['error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1acc,0x16b));var _0xc1ac=function(_0x5d5e0c,_0x543810){_0x5d5e0c=_0x5d5e0c-0x0;var _0x231f7f=_0x1acc[_0x5d5e0c];return _0x231f7f;};'use strict';var _=require(_0xc1ac('0x0'));var util=require(_0xc1ac('0x1'));var moment=require(_0xc1ac('0x2'));var BPromise=require(_0xc1ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc1ac('0x5'));var logger=require(_0xc1ac('0x6'))(_0xc1ac('0x7'));var config=require(_0xc1ac('0x8'));var jayson=require(_0xc1ac('0x9'));var client=jayson[_0xc1ac('0xa')][_0xc1ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c351c,_0x226708,_0x1bfd42){return new BPromise(function(_0x48e9cf,_0x38179a){return client['request'](_0x9c351c,_0x1bfd42)['then'](function(_0x580608){logger[_0xc1ac('0xc')](_0xc1ac('0xd'),_0x226708,_0xc1ac('0xe'));logger[_0xc1ac('0xf')](_0xc1ac('0x10'),_0x226708,_0xc1ac('0xe'),JSON['stringify'](_0x580608));if(_0x580608[_0xc1ac('0x11')]){if(_0x580608['error']['code']===0x1f4){logger['error'](_0xc1ac('0xd'),_0x226708,_0x580608[_0xc1ac('0x11')][_0xc1ac('0x12')]);return _0x38179a(_0x580608[_0xc1ac('0x11')]['message']);}logger['error'](_0xc1ac('0xd'),_0x226708,_0x580608[_0xc1ac('0x11')][_0xc1ac('0x12')]);return _0x48e9cf(_0x580608[_0xc1ac('0x11')][_0xc1ac('0x12')]);}else{logger[_0xc1ac('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x226708,_0xc1ac('0xe'));_0x48e9cf(_0x580608['result']['message']);}})[_0xc1ac('0x13')](function(_0x52469f){logger[_0xc1ac('0x11')](_0xc1ac('0xd'),_0x226708,_0x52469f);_0x38179a(_0x52469f);});});}
\ No newline at end of file
index 06a47f2..5265034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['./variable.controller','index','get','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22bec2,_0x235160){var _0x259c59=function(_0x2fd02f){while(--_0x2fd02f){_0x22bec2['push'](_0x22bec2['shift']());}};_0x259c59(++_0x235160);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4df4a5,_0x1b8d74){_0x4df4a5=_0x4df4a5-0x0;var _0x4193b8=_0x8d0e[_0x4df4a5];return _0x4193b8;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xf')]('/',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x10')]);router['put'](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x11')]);router['delete']('/:id',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x12')]);module[_0xe8d0('0x13')]=router;
\ No newline at end of file
+var _0xe0c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','index','get','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x58c35f,_0x1ca528){var _0x2161cc=function(_0xf8f6d1){while(--_0xf8f6d1){_0x58c35f['push'](_0x58c35f['shift']());}};_0x2161cc(++_0x1ca528);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xf')]('/',auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller['update']);router['delete'](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);module[_0x3e0c('0x13')]=router;
\ No newline at end of file
index 2b23781..74d731d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee54=['sequelize','exports','STRING','name'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xee54,0x1f0));var _0x4ee5=function(_0x2b7c64,_0x1a0100){_0x2b7c64=_0x2b7c64-0x0;var _0x272759=_0xee54[_0x2b7c64];return _0x272759;};'use strict';var Sequelize=require(_0x4ee5('0x0'));module[_0x4ee5('0x1')]={'name':{'type':Sequelize[_0x4ee5('0x2')],'unique':_0x4ee5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4ee5('0x2')]}};
\ No newline at end of file
+var _0xe53e=['name','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe53e,0x11b));var _0xee53=function(_0x56db6d,_0x5ec845){_0x56db6d=_0x56db6d-0x0;var _0x4c4656=_0xe53e[_0x56db6d];return _0x4c4656;};'use strict';var Sequelize=require(_0xee53('0x0'));module['exports']={'name':{'type':Sequelize[_0xee53('0x1')],'unique':_0xee53('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8b64e92..c1810d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaad=['includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','rimraf','zip-dir','request-promise','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','destroy','Variables','UserProfileResource','then','error','stack','name','index','Variable','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rawAttributes'];(function(_0x4368b4,_0xd9647){var _0x1d650b=function(_0x4d60d2){while(--_0x4d60d2){_0x4368b4['push'](_0x4368b4['shift']());}};_0x1d650b(++_0xd9647);}(_0xcaad,0xa5));var _0xdcaa=function(_0x3af3e3,_0x4f1af2){_0x3af3e3=_0x3af3e3-0x0;var _0x112814=_0xcaad[_0x3af3e3];return _0x112814;};'use strict';var emlformat=require(_0xdcaa('0x0'));var rimraf=require(_0xdcaa('0x1'));var zipdir=require(_0xdcaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdcaa('0x4'));var sox=require('sox');var csv=require(_0xdcaa('0x5'));var ejs=require(_0xdcaa('0x6'));var fs=require('fs');var fs_extra=require(_0xdcaa('0x7'));var _=require('lodash');var squel=require(_0xdcaa('0x8'));var crypto=require(_0xdcaa('0x9'));var jsforce=require(_0xdcaa('0xa'));var deskjs=require(_0xdcaa('0xb'));var toCsv=require(_0xdcaa('0x5'));var querystring=require(_0xdcaa('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcaa('0xd'));var qs=require(_0xdcaa('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcaa('0xf'));var logger=require(_0xdcaa('0x10'))(_0xdcaa('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xdcaa('0x12'));var db=require(_0xdcaa('0x13'))['db'];function respondWithStatusCode(_0x3cb2c8,_0x25da57){_0x25da57=_0x25da57||0xcc;return function(_0x17cade){if(_0x17cade){return _0x3cb2c8[_0xdcaa('0x14')](_0x25da57);}return _0x3cb2c8['status'](_0x25da57)[_0xdcaa('0x15')]();};}function respondWithResult(_0x5458d1,_0x486a42){_0x486a42=_0x486a42||0xc8;return function(_0x440a7d){if(_0x440a7d){return _0x5458d1[_0xdcaa('0x16')](_0x486a42)[_0xdcaa('0x17')](_0x440a7d);}};}function respondWithFilteredResult(_0x20528a,_0x14c45d){return function(_0x604a46){if(_0x604a46){var _0x3ad51d=typeof _0x14c45d[_0xdcaa('0x18')]===_0xdcaa('0x19')&&typeof _0x14c45d['limit']===_0xdcaa('0x19');var _0x8adabb=_0x604a46[_0xdcaa('0x1a')];var _0x159090=_0x3ad51d?0x0:_0x14c45d[_0xdcaa('0x18')];var _0x596a93=_0x3ad51d?_0x604a46[_0xdcaa('0x1a')]:_0x14c45d[_0xdcaa('0x18')]+_0x14c45d[_0xdcaa('0x1b')];var _0x3563fa;if(_0x596a93>=_0x8adabb){_0x596a93=_0x8adabb;_0x3563fa=0xc8;}else{_0x3563fa=0xce;}_0x20528a[_0xdcaa('0x16')](_0x3563fa);return _0x20528a[_0xdcaa('0x1c')](_0xdcaa('0x1d'),_0x159090+'-'+_0x596a93+'/'+_0x8adabb)[_0xdcaa('0x17')](_0x604a46);}return null;};}function patchUpdates(_0x3f72b4){return function(_0x3b39a9){try{jsonpatch['apply'](_0x3b39a9,_0x3f72b4,!![]);}catch(_0x44efd3){return BPromise['reject'](_0x44efd3);}return _0x3b39a9['save']();};}function saveUpdates(_0x1e5f28,_0x27751a){return function(_0x28ef7a){if(_0x28ef7a){return _0x28ef7a[_0xdcaa('0x1e')](_0x1e5f28)['then'](function(_0x3ffd1a){return _0x3ffd1a;});}return null;};}function removeEntity(_0x3f207a,_0x2817f9){return function(_0x3f4cb0){if(_0x3f4cb0){return _0x3f4cb0[_0xdcaa('0x1f')]()['then'](function(){var _0x445cf2=_0x3f4cb0['get']({'plain':!![]});var _0x32424b=_0xdcaa('0x20');return db[_0xdcaa('0x21')][_0xdcaa('0x1f')]({'where':{'type':_0x32424b,'resourceId':_0x445cf2['id']}})[_0xdcaa('0x22')](function(){return _0x3f4cb0;});})[_0xdcaa('0x22')](function(){_0x3f207a[_0xdcaa('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd8fdc5,_0x2b7d85){return function(_0x261c97){if(!_0x261c97){_0xd8fdc5[_0xdcaa('0x14')](0x194);}return _0x261c97;};}function handleError(_0x2a06a4,_0x12945a){_0x12945a=_0x12945a||0x1f4;return function(_0xf64250){logger[_0xdcaa('0x23')](_0xf64250[_0xdcaa('0x24')]);if(_0xf64250[_0xdcaa('0x25')]){delete _0xf64250['name'];}_0x2a06a4[_0xdcaa('0x16')](_0x12945a)['send'](_0xf64250);};}exports[_0xdcaa('0x26')]=function(_0x21ccd9,_0x127339){var _0x2f5ac5={},_0x44e25e={},_0x1a9f04={'count':0x0,'rows':[]};var _0x1f5f7e=_['map'](db[_0xdcaa('0x27')]['rawAttributes'],function(_0x47380f){return{'name':_0x47380f[_0xdcaa('0x28')],'type':_0x47380f[_0xdcaa('0x29')]['key']};});_0x44e25e[_0xdcaa('0x2a')]=_[_0xdcaa('0x2b')](_0x1f5f7e,_0xdcaa('0x25'));_0x44e25e[_0xdcaa('0x2c')]=_[_0xdcaa('0x2d')](_0x21ccd9[_0xdcaa('0x2c')]);_0x44e25e[_0xdcaa('0x2e')]=_[_0xdcaa('0x2f')](_0x44e25e['model'],_0x44e25e[_0xdcaa('0x2c')]);_0x2f5ac5['attributes']=_[_0xdcaa('0x2f')](_0x44e25e['model'],qs[_0xdcaa('0x30')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x30')]));_0x2f5ac5[_0xdcaa('0x31')]=_0x2f5ac5[_0xdcaa('0x31')][_0xdcaa('0x32')]?_0x2f5ac5[_0xdcaa('0x31')]:_0x44e25e[_0xdcaa('0x2a')];if(!_0x21ccd9['query'][_0xdcaa('0x33')](_0xdcaa('0x34'))){_0x2f5ac5[_0xdcaa('0x1b')]=qs[_0xdcaa('0x1b')](_0x21ccd9[_0xdcaa('0x2c')]['limit']);_0x2f5ac5[_0xdcaa('0x18')]=qs[_0xdcaa('0x18')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x18')]);}_0x2f5ac5[_0xdcaa('0x35')]=qs[_0xdcaa('0x36')](_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x36')]);_0x2f5ac5[_0xdcaa('0x37')]=qs[_0xdcaa('0x2e')](_[_0xdcaa('0x38')](_0x21ccd9[_0xdcaa('0x2c')],_0x44e25e[_0xdcaa('0x2e')]),_0x1f5f7e);if(_0x21ccd9[_0xdcaa('0x2c')][_0xdcaa('0x39')]){_0x2f5ac5[_0xdcaa('0x37')]=_[_0xdcaa('0x3a')](_0x2f5ac5[_0xdcaa('0x37')],{'$or':_[_0xdcaa('0x2b')](_0x1f5f7e,function(_0xf93535){if(_0xf93535[_0xdcaa('0x29')]!=='VIRTUAL'){var _0x5c7208={};_0x5c7208[_0xf93535[_0xdcaa('0x25')]]={'$like':'%'+_0x21ccd9[_0xdcaa('0x2c')]['filter']+'%'};return _0x5c7208;}})});}_0x2f5ac5=_[_0xdcaa('0x3a')]({},_0x2f5ac5,_0x21ccd9[_0xdcaa('0x3b')]);var _0x4ad8a4={'where':_0x2f5ac5[_0xdcaa('0x37')]};return db[_0xdcaa('0x27')][_0xdcaa('0x1a')](_0x4ad8a4)[_0xdcaa('0x22')](function(_0x14c1f9){_0x1a9f04[_0xdcaa('0x1a')]=_0x14c1f9;if(_0x21ccd9[_0xdcaa('0x2c')]['includeAll']){_0x2f5ac5[_0xdcaa('0x3c')]=[{'all':!![]}];}return db[_0xdcaa('0x27')][_0xdcaa('0x3d')](_0x2f5ac5);})[_0xdcaa('0x22')](function(_0x2816e5){_0x1a9f04['rows']=_0x2816e5;return _0x1a9f04;})[_0xdcaa('0x22')](respondWithFilteredResult(_0x127339,_0x2f5ac5))['catch'](handleError(_0x127339,null));};exports['show']=function(_0x46c7dc,_0x37c6c2){var _0x4f5ab3={'raw':!![],'where':{'id':_0x46c7dc['params']['id']}},_0xe0b25={};_0xe0b25[_0xdcaa('0x2a')]=_[_0xdcaa('0x2d')](db['Variable'][_0xdcaa('0x3e')]);_0xe0b25[_0xdcaa('0x2c')]=_[_0xdcaa('0x2d')](_0x46c7dc[_0xdcaa('0x2c')]);_0xe0b25[_0xdcaa('0x2e')]=_[_0xdcaa('0x2f')](_0xe0b25[_0xdcaa('0x2a')],_0xe0b25[_0xdcaa('0x2c')]);_0x4f5ab3[_0xdcaa('0x31')]=_['intersection'](_0xe0b25['model'],qs[_0xdcaa('0x30')](_0x46c7dc[_0xdcaa('0x2c')][_0xdcaa('0x30')]));_0x4f5ab3[_0xdcaa('0x31')]=_0x4f5ab3[_0xdcaa('0x31')][_0xdcaa('0x32')]?_0x4f5ab3[_0xdcaa('0x31')]:_0xe0b25['model'];if(_0x46c7dc[_0xdcaa('0x2c')][_0xdcaa('0x3f')]){_0x4f5ab3[_0xdcaa('0x3c')]=[{'all':!![]}];}_0x4f5ab3=_[_0xdcaa('0x3a')]({},_0x4f5ab3,_0x46c7dc[_0xdcaa('0x3b')]);return db[_0xdcaa('0x27')]['find'](_0x4f5ab3)[_0xdcaa('0x22')](handleEntityNotFound(_0x37c6c2,null))[_0xdcaa('0x22')](respondWithResult(_0x37c6c2,null))['catch'](handleError(_0x37c6c2,null));};exports[_0xdcaa('0x40')]=function(_0x2feabe,_0x3148fe){return db[_0xdcaa('0x27')][_0xdcaa('0x40')](_0x2feabe[_0xdcaa('0x41')],{})[_0xdcaa('0x22')](function(_0x12cfa4){var _0x5f1dde=_0x2feabe[_0xdcaa('0x42')][_0xdcaa('0x43')]({'plain':!![]});if(!_0x5f1dde)throw new Error(_0xdcaa('0x44'));if(_0x5f1dde[_0xdcaa('0x45')]===_0xdcaa('0x42')){var _0x4d80a3=_0x12cfa4[_0xdcaa('0x43')]({'plain':!![]});var _0x1a2449=_0xdcaa('0x20');return db[_0xdcaa('0x46')]['find']({'where':{'name':_0x1a2449,'userProfileId':_0x5f1dde[_0xdcaa('0x47')]},'raw':!![]})[_0xdcaa('0x22')](function(_0x27bc46){if(_0x27bc46&&_0x27bc46['autoAssociation']===0x0){return db['UserProfileResource'][_0xdcaa('0x40')]({'name':_0x4d80a3[_0xdcaa('0x25')],'resourceId':_0x4d80a3['id'],'type':_0x27bc46[_0xdcaa('0x25')],'sectionId':_0x27bc46['id']},{})[_0xdcaa('0x22')](function(){return _0x12cfa4;});}else{return _0x12cfa4;}})[_0xdcaa('0x48')](function(_0x2e2aae){logger['error'](_0xdcaa('0x49'),_0x2e2aae);throw _0x2e2aae;});}return _0x12cfa4;})['then'](respondWithResult(_0x3148fe,0xc9))[_0xdcaa('0x48')](handleError(_0x3148fe,null));};exports[_0xdcaa('0x1e')]=function(_0x4b5be1,_0x2ea179){if(_0x4b5be1[_0xdcaa('0x41')]['id']){delete _0x4b5be1[_0xdcaa('0x41')]['id'];}return db[_0xdcaa('0x27')][_0xdcaa('0x4a')]({'where':{'id':_0x4b5be1[_0xdcaa('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ea179,null))['then'](saveUpdates(_0x4b5be1[_0xdcaa('0x41')],null))[_0xdcaa('0x22')](respondWithResult(_0x2ea179,null))[_0xdcaa('0x48')](handleError(_0x2ea179,null));};exports[_0xdcaa('0x1f')]=function(_0x468673,_0x55a5ac){return db[_0xdcaa('0x27')][_0xdcaa('0x4a')]({'where':{'id':_0x468673['params']['id']}})[_0xdcaa('0x22')](handleEntityNotFound(_0x55a5ac,null))[_0xdcaa('0x22')](removeEntity(_0x55a5ac,null))[_0xdcaa('0x48')](handleError(_0x55a5ac,null));};
\ No newline at end of file
+var _0xd2e3=['mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Variables','UserProfileResource','sendStatus','error','name','send','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','Variable','findAll','rows','params','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0xd2e3,0x146));var _0x3d2e=function(_0x3e773f,_0x4d3a30){_0x3e773f=_0x3e773f-0x0;var _0x1e7a54=_0xd2e3[_0x3e773f];return _0x1e7a54;};'use strict';var emlformat=require(_0x3d2e('0x0'));var rimraf=require(_0x3d2e('0x1'));var zipdir=require(_0x3d2e('0x2'));var jsonpatch=require(_0x3d2e('0x3'));var rp=require(_0x3d2e('0x4'));var moment=require(_0x3d2e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3d2e('0x6'));var util=require(_0x3d2e('0x7'));var path=require(_0x3d2e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3d2e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d2e('0xa'));var squel=require(_0x3d2e('0xb'));var crypto=require(_0x3d2e('0xc'));var jsforce=require(_0x3d2e('0xd'));var deskjs=require(_0x3d2e('0xe'));var toCsv=require(_0x3d2e('0xf'));var querystring=require(_0x3d2e('0x10'));var Papa=require('papaparse');var Redis=require(_0x3d2e('0x11'));var authService=require(_0x3d2e('0x12'));var qs=require(_0x3d2e('0x13'));var as=require(_0x3d2e('0x14'));var hardwareService=require(_0x3d2e('0x15'));var logger=require(_0x3d2e('0x16'))(_0x3d2e('0x17'));var utils=require(_0x3d2e('0x18'));var config=require(_0x3d2e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d2e('0x1a'))['db'];function respondWithStatusCode(_0x17fd52,_0xe25a3a){_0xe25a3a=_0xe25a3a||0xcc;return function(_0x149ebb){if(_0x149ebb){return _0x17fd52['sendStatus'](_0xe25a3a);}return _0x17fd52[_0x3d2e('0x1b')](_0xe25a3a)[_0x3d2e('0x1c')]();};}function respondWithResult(_0x390751,_0xb40e29){_0xb40e29=_0xb40e29||0xc8;return function(_0x3568ec){if(_0x3568ec){return _0x390751['status'](_0xb40e29)[_0x3d2e('0x1d')](_0x3568ec);}};}function respondWithFilteredResult(_0x4e7d92,_0x49e93f){return function(_0x270e89){if(_0x270e89){var _0x1f168d=typeof _0x49e93f[_0x3d2e('0x1e')]===_0x3d2e('0x1f')&&typeof _0x49e93f[_0x3d2e('0x20')]==='undefined';var _0x6ceabb=_0x270e89[_0x3d2e('0x21')];var _0x200598=_0x1f168d?0x0:_0x49e93f[_0x3d2e('0x1e')];var _0x10ddde=_0x1f168d?_0x270e89[_0x3d2e('0x21')]:_0x49e93f[_0x3d2e('0x1e')]+_0x49e93f[_0x3d2e('0x20')];var _0x333bf2;if(_0x10ddde>=_0x6ceabb){_0x10ddde=_0x6ceabb;_0x333bf2=0xc8;}else{_0x333bf2=0xce;}_0x4e7d92[_0x3d2e('0x1b')](_0x333bf2);return _0x4e7d92[_0x3d2e('0x22')](_0x3d2e('0x23'),_0x200598+'-'+_0x10ddde+'/'+_0x6ceabb)[_0x3d2e('0x1d')](_0x270e89);}return null;};}function patchUpdates(_0x66eb86){return function(_0x3a89e6){try{jsonpatch[_0x3d2e('0x24')](_0x3a89e6,_0x66eb86,!![]);}catch(_0x11ed65){return BPromise[_0x3d2e('0x25')](_0x11ed65);}return _0x3a89e6[_0x3d2e('0x26')]();};}function saveUpdates(_0xb09bbc,_0x58fa89){return function(_0x25a493){if(_0x25a493){return _0x25a493[_0x3d2e('0x27')](_0xb09bbc)['then'](function(_0x1ccae9){return _0x1ccae9;});}return null;};}function removeEntity(_0x467c74,_0x4b9e68){return function(_0x3c4ac0){if(_0x3c4ac0){return _0x3c4ac0[_0x3d2e('0x28')]()[_0x3d2e('0x29')](function(){var _0x1a0a17=_0x3c4ac0[_0x3d2e('0x2a')]({'plain':!![]});var _0x358245=_0x3d2e('0x2b');return db[_0x3d2e('0x2c')]['destroy']({'where':{'type':_0x358245,'resourceId':_0x1a0a17['id']}})[_0x3d2e('0x29')](function(){return _0x3c4ac0;});})[_0x3d2e('0x29')](function(){_0x467c74[_0x3d2e('0x1b')](0xcc)[_0x3d2e('0x1c')]();});}};}function handleEntityNotFound(_0x2f5d3c,_0x375394){return function(_0x1970ba){if(!_0x1970ba){_0x2f5d3c[_0x3d2e('0x2d')](0x194);}return _0x1970ba;};}function handleError(_0x135d68,_0x3cf065){_0x3cf065=_0x3cf065||0x1f4;return function(_0x1b7df8){logger[_0x3d2e('0x2e')](_0x1b7df8['stack']);if(_0x1b7df8[_0x3d2e('0x2f')]){delete _0x1b7df8[_0x3d2e('0x2f')];}_0x135d68[_0x3d2e('0x1b')](_0x3cf065)[_0x3d2e('0x30')](_0x1b7df8);};}exports['index']=function(_0x3d75b6,_0x54cde9){var _0x32b2d4={},_0x10e976={},_0x2d71c9={'count':0x0,'rows':[]};var _0x5e4ce3=_['map'](db['Variable']['rawAttributes'],function(_0x44915b){return{'name':_0x44915b[_0x3d2e('0x31')],'type':_0x44915b[_0x3d2e('0x32')]['key']};});_0x10e976[_0x3d2e('0x33')]=_['map'](_0x5e4ce3,_0x3d2e('0x2f'));_0x10e976['query']=_['keys'](_0x3d75b6[_0x3d2e('0x34')]);_0x10e976[_0x3d2e('0x35')]=_[_0x3d2e('0x36')](_0x10e976[_0x3d2e('0x33')],_0x10e976[_0x3d2e('0x34')]);_0x32b2d4[_0x3d2e('0x37')]=_[_0x3d2e('0x36')](_0x10e976[_0x3d2e('0x33')],qs['fields'](_0x3d75b6[_0x3d2e('0x34')][_0x3d2e('0x38')]));_0x32b2d4[_0x3d2e('0x37')]=_0x32b2d4[_0x3d2e('0x37')][_0x3d2e('0x39')]?_0x32b2d4['attributes']:_0x10e976[_0x3d2e('0x33')];if(!_0x3d75b6[_0x3d2e('0x34')][_0x3d2e('0x3a')](_0x3d2e('0x3b'))){_0x32b2d4[_0x3d2e('0x20')]=qs['limit'](_0x3d75b6['query'][_0x3d2e('0x20')]);_0x32b2d4[_0x3d2e('0x1e')]=qs[_0x3d2e('0x1e')](_0x3d75b6['query'][_0x3d2e('0x1e')]);}_0x32b2d4[_0x3d2e('0x3c')]=qs['sort'](_0x3d75b6['query'][_0x3d2e('0x3d')]);_0x32b2d4[_0x3d2e('0x3e')]=qs['filters'](_[_0x3d2e('0x3f')](_0x3d75b6[_0x3d2e('0x34')],_0x10e976['filters']),_0x5e4ce3);if(_0x3d75b6[_0x3d2e('0x34')][_0x3d2e('0x40')]){_0x32b2d4[_0x3d2e('0x3e')]=_['merge'](_0x32b2d4[_0x3d2e('0x3e')],{'$or':_['map'](_0x5e4ce3,function(_0x21f0e2){if(_0x21f0e2[_0x3d2e('0x32')]!=='VIRTUAL'){var _0x513428={};_0x513428[_0x21f0e2[_0x3d2e('0x2f')]]={'$like':'%'+_0x3d75b6[_0x3d2e('0x34')][_0x3d2e('0x40')]+'%'};return _0x513428;}})});}_0x32b2d4=_[_0x3d2e('0x41')]({},_0x32b2d4,_0x3d75b6[_0x3d2e('0x42')]);var _0x62248c={'where':_0x32b2d4[_0x3d2e('0x3e')]};return db['Variable'][_0x3d2e('0x21')](_0x62248c)['then'](function(_0x503e1b){_0x2d71c9[_0x3d2e('0x21')]=_0x503e1b;if(_0x3d75b6[_0x3d2e('0x34')][_0x3d2e('0x43')]){_0x32b2d4[_0x3d2e('0x44')]=[{'all':!![]}];}return db[_0x3d2e('0x45')][_0x3d2e('0x46')](_0x32b2d4);})[_0x3d2e('0x29')](function(_0x124852){_0x2d71c9[_0x3d2e('0x47')]=_0x124852;return _0x2d71c9;})['then'](respondWithFilteredResult(_0x54cde9,_0x32b2d4))['catch'](handleError(_0x54cde9,null));};exports['show']=function(_0x4e241f,_0x2e6ca9){var _0x94f5c8={'raw':!![],'where':{'id':_0x4e241f[_0x3d2e('0x48')]['id']}},_0x6cee1={};_0x6cee1['model']=_[_0x3d2e('0x49')](db[_0x3d2e('0x45')]['rawAttributes']);_0x6cee1[_0x3d2e('0x34')]=_[_0x3d2e('0x49')](_0x4e241f[_0x3d2e('0x34')]);_0x6cee1[_0x3d2e('0x35')]=_['intersection'](_0x6cee1['model'],_0x6cee1[_0x3d2e('0x34')]);_0x94f5c8[_0x3d2e('0x37')]=_[_0x3d2e('0x36')](_0x6cee1[_0x3d2e('0x33')],qs[_0x3d2e('0x38')](_0x4e241f['query'][_0x3d2e('0x38')]));_0x94f5c8['attributes']=_0x94f5c8[_0x3d2e('0x37')]['length']?_0x94f5c8[_0x3d2e('0x37')]:_0x6cee1[_0x3d2e('0x33')];if(_0x4e241f[_0x3d2e('0x34')][_0x3d2e('0x43')]){_0x94f5c8[_0x3d2e('0x44')]=[{'all':!![]}];}_0x94f5c8=_[_0x3d2e('0x41')]({},_0x94f5c8,_0x4e241f[_0x3d2e('0x42')]);return db[_0x3d2e('0x45')][_0x3d2e('0x4a')](_0x94f5c8)['then'](handleEntityNotFound(_0x2e6ca9,null))['then'](respondWithResult(_0x2e6ca9,null))[_0x3d2e('0x4b')](handleError(_0x2e6ca9,null));};exports[_0x3d2e('0x4c')]=function(_0x46ab95,_0x152833){return db[_0x3d2e('0x45')][_0x3d2e('0x4c')](_0x46ab95[_0x3d2e('0x4d')],{})[_0x3d2e('0x29')](function(_0xfc7d97){var _0x33de5d=_0x46ab95[_0x3d2e('0x4e')][_0x3d2e('0x2a')]({'plain':!![]});if(!_0x33de5d)throw new Error(_0x3d2e('0x4f'));if(_0x33de5d[_0x3d2e('0x50')]===_0x3d2e('0x4e')){var _0x8f0509=_0xfc7d97['get']({'plain':!![]});var _0x405e8b=_0x3d2e('0x2b');return db['UserProfileSection'][_0x3d2e('0x4a')]({'where':{'name':_0x405e8b,'userProfileId':_0x33de5d[_0x3d2e('0x51')]},'raw':!![]})[_0x3d2e('0x29')](function(_0x5dad51){if(_0x5dad51&&_0x5dad51['autoAssociation']===0x0){return db[_0x3d2e('0x2c')][_0x3d2e('0x4c')]({'name':_0x8f0509[_0x3d2e('0x2f')],'resourceId':_0x8f0509['id'],'type':_0x5dad51[_0x3d2e('0x2f')],'sectionId':_0x5dad51['id']},{})[_0x3d2e('0x29')](function(){return _0xfc7d97;});}else{return _0xfc7d97;}})[_0x3d2e('0x4b')](function(_0x15c5c2){logger['error'](_0x3d2e('0x52'),_0x15c5c2);throw _0x15c5c2;});}return _0xfc7d97;})['then'](respondWithResult(_0x152833,0xc9))[_0x3d2e('0x4b')](handleError(_0x152833,null));};exports[_0x3d2e('0x27')]=function(_0xaff1ce,_0x50f58c){if(_0xaff1ce[_0x3d2e('0x4d')]['id']){delete _0xaff1ce[_0x3d2e('0x4d')]['id'];}return db[_0x3d2e('0x45')]['find']({'where':{'id':_0xaff1ce[_0x3d2e('0x48')]['id']}})['then'](handleEntityNotFound(_0x50f58c,null))[_0x3d2e('0x29')](saveUpdates(_0xaff1ce['body'],null))[_0x3d2e('0x29')](respondWithResult(_0x50f58c,null))['catch'](handleError(_0x50f58c,null));};exports[_0x3d2e('0x28')]=function(_0x163499,_0x3f5c52){return db[_0x3d2e('0x45')][_0x3d2e('0x4a')]({'where':{'id':_0x163499[_0x3d2e('0x48')]['id']}})[_0x3d2e('0x29')](handleEntityNotFound(_0x3f5c52,null))[_0x3d2e('0x29')](removeEntity(_0x3f5c52,null))[_0x3d2e('0x4b')](handleError(_0x3f5c52,null));};
\ No newline at end of file
index 87a0448..b1bab59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf277=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Variable','lodash'];(function(_0xabeb68,_0x3aecbc){var _0x3ce2cf=function(_0xc599c1){while(--_0xc599c1){_0xabeb68['push'](_0xabeb68['shift']());}};_0x3ce2cf(++_0x3aecbc);}(_0xf277,0x1d8));var _0x7f27=function(_0x243392,_0x712e9){_0x243392=_0x243392-0x0;var _0x35914d=_0xf277[_0x243392];return _0x35914d;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var logger=require(_0x7f27('0x2'))('api');var moment=require(_0x7f27('0x3'));var BPromise=require(_0x7f27('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f27('0x5'));var rimraf=require(_0x7f27('0x6'));var config=require(_0x7f27('0x7'));var attributes=require('./variable.attributes');module[_0x7f27('0x8')]=function(_0x3c27ef,_0x57c1bb){return _0x3c27ef[_0x7f27('0x9')](_0x7f27('0xa'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x123a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x123a,0x15a));var _0xa123=function(_0x7789fb,_0x301dc5){_0x7789fb=_0x7789fb-0x0;var _0x44653b=_0x123a[_0x7789fb];return _0x44653b;};'use strict';var _=require(_0xa123('0x0'));var util=require(_0xa123('0x1'));var logger=require(_0xa123('0x2'))(_0xa123('0x3'));var moment=require(_0xa123('0x4'));var BPromise=require(_0xa123('0x5'));var rp=require(_0xa123('0x6'));var fs=require('fs');var path=require(_0xa123('0x7'));var rimraf=require(_0xa123('0x8'));var config=require(_0xa123('0x9'));var attributes=require(_0xa123('0xa'));module['exports']=function(_0x2d8b62,_0x5104de){return _0x2d8b62[_0xa123('0xb')](_0xa123('0xc'),attributes,{'tableName':_0xa123('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 11aaa67..e171a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x5ade35,_0x35cec6){var _0x21d317=function(_0x4369b1){while(--_0x4369b1){_0x5ade35['push'](_0x5ade35['shift']());}};_0x21d317(++_0x35cec6);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x5fc3[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x11cbbd,_0x5d4106){var _0x153af2=function(_0xd8cb94){while(--_0xd8cb94){_0x11cbbd['push'](_0x11cbbd['shift']());}};_0x153af2(++_0x5d4106);}(_0x3e74,0x175));var _0x43e7=function(_0x45e2af,_0x18bd2e){_0x45e2af=_0x45e2af-0x0;var _0x292fd7=_0x3e74[_0x45e2af];return _0x292fd7;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});};
\ No newline at end of file
index 56418cd..5493a0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69d=['express','Router','../../components/auth/service','./version.controller','get','index','/fetch','canUpdate','fetch','/reset','reset','/pull','pull','/restart','isAuthenticated','restart','/migrations','migrations'];(function(_0x18b4ed,_0x2862d8){var _0x30e16a=function(_0x50713b){while(--_0x50713b){_0x18b4ed['push'](_0x18b4ed['shift']());}};_0x30e16a(++_0x2862d8);}(_0xf69d,0xea));var _0xdf69=function(_0x554114,_0x5da584){_0x554114=_0x554114-0x0;var _0x7223ae=_0xf69d[_0x554114];return _0x7223ae;};'use strict';var express=require(_0xdf69('0x0'));var router=express[_0xdf69('0x1')]();var auth=require(_0xdf69('0x2'));var controller=require(_0xdf69('0x3'));router[_0xdf69('0x4')]('/',controller[_0xdf69('0x5')]);router[_0xdf69('0x4')](_0xdf69('0x6'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0x8')]);router[_0xdf69('0x4')](_0xdf69('0x9'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0xa')]);router['get'](_0xdf69('0xb'),auth['isAuthenticated'](),auth[_0xdf69('0x7')](),controller[_0xdf69('0xc')]);router['get'](_0xdf69('0xd'),auth[_0xdf69('0xe')](),controller[_0xdf69('0xf')]);router[_0xdf69('0x4')](_0xdf69('0x10'),controller[_0xdf69('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0511=['../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','exports'];(function(_0x2c9509,_0x159071){var _0x7125e7=function(_0x3d101f){while(--_0x3d101f){_0x2c9509['push'](_0x2c9509['shift']());}};_0x7125e7(++_0x159071);}(_0x0511,0x134));var _0x1051=function(_0x3211f6,_0x47eb23){_0x3211f6=_0x3211f6-0x0;var _0x273e60=_0x0511[_0x3211f6];return _0x273e60;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1051('0x0'));var controller=require(_0x1051('0x1'));router[_0x1051('0x2')]('/',controller['index']);router[_0x1051('0x2')](_0x1051('0x3'),auth[_0x1051('0x4')](),auth[_0x1051('0x5')](),controller[_0x1051('0x6')]);router[_0x1051('0x2')]('/reset',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1051('0x7')]);router[_0x1051('0x2')](_0x1051('0x8'),auth[_0x1051('0x4')](),auth[_0x1051('0x5')](),controller[_0x1051('0x9')]);router[_0x1051('0x2')](_0x1051('0xa'),auth['isAuthenticated'](),controller[_0x1051('0xb')]);router[_0x1051('0x2')](_0x1051('0xc'),controller['migrations']);module[_0x1051('0xd')]=router;
\ No newline at end of file
index 930929d..22a99e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69e5=['catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/pm2','update','root','index','exports','query','latest','fetch','2.0.0','status','json','origin','master','info','git\x20fetch\x20origin\x20master','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','join','server','replace','.js','length','Migration','sequelize','getQueryInterface','constructor','map','\x20to\x20'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x69e5,0x129));var _0x569e=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x69e5[_0x55c00d];return _0x254a8f;};'use strict';var Umzug=require(_0x569e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x569e('0x1'));var pkginfo=require(_0x569e('0x2'))(module,_0x569e('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x569e('0x4'))[_0x569e('0x5')];var db=require(_0x569e('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x569e('0x7'));var logger=require('../../config/logger')(_0x569e('0x8'));var git=require('simple-git')(config[_0x569e('0x9')]);exports[_0x569e('0xa')]=function(_0x405fc2,_0x3f8818){var _0x9c53a3={'current':module[_0x569e('0xb')][_0x569e('0x3')],'phonebar':0x2};if(_0x405fc2[_0x569e('0xc')]&&_0x405fc2['query'][_0x569e('0xd')]){return git[_0x569e('0xe')]()['tags'](function(_0xd2e3fa,_0xf22cbf){_0x9c53a3[_0x569e('0xd')]=(_0xd2e3fa?module[_0x569e('0xb')][_0x569e('0x3')]:_0xf22cbf[_0x569e('0xd')])||_0x569e('0xf');return _0x3f8818[_0x569e('0x10')](0xc8)[_0x569e('0x11')](_0x9c53a3);});}else{return _0x3f8818[_0x569e('0x10')](0xc8)[_0x569e('0x11')](_0x9c53a3);}};exports['fetch']=function(_0x9076b0,_0x256c07){return git[_0x569e('0xe')]([_0x569e('0x12'),_0x569e('0x13')],function(_0x2a2145){if(_0x2a2145){logger['error'](_0x2a2145);return _0x256c07['status'](0x1f4)[_0x569e('0x11')](_0x2a2145);}logger[_0x569e('0x14')]('git\x20fetch');return _0x256c07['status'](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x15')});});};exports['reset']=function(_0x42edd3,_0x4fd272){return git[_0x569e('0x16')]([_0x569e('0x17'),'FETCH_HEAD'],function(_0x22cb9c){if(_0x22cb9c){logger[_0x569e('0x18')](_0x22cb9c);return _0x4fd272[_0x569e('0x10')](0x1f4)[_0x569e('0x11')](_0x22cb9c);}logger['info'](_0x569e('0x19'));return _0x4fd272['status'](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x1a')});});};exports[_0x569e('0x1b')]=function(_0x319789,_0x5f46c5){exec(_0x569e('0x1c'),function(_0x43d841,_0x4f58ed,_0x4a363f){logger[_0x569e('0x14')](_0x4f58ed);logger['info'](_0x4a363f);if(_0x43d841){logger[_0x569e('0x18')](_0x43d841);return _0x5f46c5[_0x569e('0x10')](0x1f4)[_0x569e('0x11')](_0x43d841);}return _0x5f46c5[_0x569e('0x10')](0xc8)['json']({'output':_0x4f58ed});});};exports[_0x569e('0x1d')]=function(_0xbafa08,_0x505cee){return pm2[_0x569e('0x1d')](_0x569e('0x1e'))[_0x569e('0x1f')](function(_0x2d12f4){logger['info'](_0x569e('0x20'),_0x2d12f4);return _0x505cee[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x21')});})['catch'](function(_0x5e1788){logger[_0x569e('0x18')](_0x5e1788);return _0x505cee[_0x569e('0x10')](0x1f4)['json'](_0x5e1788);});};exports[_0x569e('0x22')]=function(_0x4d5ad1,_0x59f161){var _0x4564b6=fs['readdirSync'](path[_0x569e('0x23')](config[_0x569e('0x9')],_0x569e('0x24'),_0x569e('0x22')));var _0x28f97c=[];for(var _0x1b7959=0x0;_0x1b7959<_0x4564b6['length'];_0x1b7959++){var _0x376945=_0x4564b6[_0x1b7959][_0x569e('0x25')](_0x569e('0x26'),'');if(compareVersions(module[_0x569e('0xb')][_0x569e('0x3')],_0x376945)===-0x1){_0x28f97c['push'](_0x376945);}}if(_0x28f97c[_0x569e('0x27')]){var _0x3abada=_0x28f97c['sort'](compareVersions);var _0x1da8b4=new Umzug({'storage':'sequelize','storageOptions':{'model':db['Migration'],'modelName':_0x569e('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x569e('0x29')][_0x569e('0x2a')](),db[_0x569e('0x29')][_0x569e('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x569e('0x23')](config['root'],_0x569e('0x24'),_0x569e('0x22')),'pattern':/\.js$/}});_0x1da8b4['up']({'migrations':_[_0x569e('0x2c')](_0x3abada,function(_0x16887d){return _0x16887d+_0x569e('0x26');})})[_0x569e('0x1f')](function(){return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0x569e('0x2d')+_['last'](_0x3abada),'migrations':_['join'](_0x3abada)});})[_0x569e('0x2e')](function(_0x24399f){if(_0x24399f instanceof db[_0x569e('0x29')][_0x569e('0x2f')]){return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x59f161[_0x569e('0x10')](0x1f4)['json'](_0x24399f);}});}else{return _0x59f161[_0x569e('0x10')](0xc8)[_0x569e('0x11')]({'output':_0x569e('0x30')});}};
\ No newline at end of file
+var _0x6658=['migrations','join','root','server','length','replace','.js','exports','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','simple-git','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','reset','--hard','FETCH_HEAD','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0x211ff4,_0x485afa){var _0x50e84b=function(_0xd5c8c8){while(--_0xd5c8c8){_0x211ff4['push'](_0x211ff4['shift']());}};_0x50e84b(++_0x485afa);}(_0x6658,0x131));var _0x8665=function(_0x26baa9,_0x5863ff){_0x26baa9=_0x26baa9-0x0;var _0x4aaac7=_0x6658[_0x26baa9];return _0x4aaac7;};'use strict';var Umzug=require(_0x8665('0x0'));var path=require(_0x8665('0x1'));var fs=require('fs');var _=require(_0x8665('0x2'));var pkginfo=require('pkginfo')(module,_0x8665('0x3'));var compareVersions=require(_0x8665('0x4'));var exec=require(_0x8665('0x5'))[_0x8665('0x6')];var db=require(_0x8665('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x8665('0x8'));var logger=require(_0x8665('0x9'))('update');var git=require(_0x8665('0xa'))(config['root']);exports['index']=function(_0x1eb3e6,_0x57dfeb){var _0x37734f={'current':module['exports'][_0x8665('0x3')],'phonebar':0x2};if(_0x1eb3e6[_0x8665('0xb')]&&_0x1eb3e6[_0x8665('0xb')]['latest']){return git[_0x8665('0xc')]()[_0x8665('0xd')](function(_0x3a8a7e,_0xefaa37){_0x37734f[_0x8665('0xe')]=(_0x3a8a7e?module['exports'][_0x8665('0x3')]:_0xefaa37[_0x8665('0xe')])||_0x8665('0xf');return _0x57dfeb[_0x8665('0x10')](0xc8)[_0x8665('0x11')](_0x37734f);});}else{return _0x57dfeb['status'](0xc8)[_0x8665('0x11')](_0x37734f);}};exports[_0x8665('0xc')]=function(_0x58b643,_0x2ed786){return git['fetch']([_0x8665('0x12'),_0x8665('0x13')],function(_0x55b3cc){if(_0x55b3cc){logger[_0x8665('0x14')](_0x55b3cc);return _0x2ed786['status'](0x1f4)[_0x8665('0x11')](_0x55b3cc);}logger[_0x8665('0x15')]('git\x20fetch');return _0x2ed786['status'](0xc8)[_0x8665('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x8665('0x16')]=function(_0x159b26,_0x5bb9e9){return git[_0x8665('0x16')]([_0x8665('0x17'),_0x8665('0x18')],function(_0x1b1601){if(_0x1b1601){logger[_0x8665('0x14')](_0x1b1601);return _0x5bb9e9[_0x8665('0x10')](0x1f4)['json'](_0x1b1601);}logger[_0x8665('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x5bb9e9[_0x8665('0x10')](0xc8)[_0x8665('0x11')]({'output':'git\x20reset\x20--hard'});});};exports[_0x8665('0x19')]=function(_0x5d4833,_0x3e3773){exec('npm\x20install\x20--production',function(_0x1f91a9,_0x4efda4,_0x31efca){logger[_0x8665('0x15')](_0x4efda4);logger[_0x8665('0x15')](_0x31efca);if(_0x1f91a9){logger[_0x8665('0x14')](_0x1f91a9);return _0x3e3773[_0x8665('0x10')](0x1f4)[_0x8665('0x11')](_0x1f91a9);}return _0x3e3773['status'](0xc8)[_0x8665('0x11')]({'output':_0x4efda4});});};exports[_0x8665('0x1a')]=function(_0x28928a,_0xacc0b0){return pm2['restart'](_0x8665('0x1b'))[_0x8665('0x1c')](function(_0x365697){logger[_0x8665('0x15')]('pm2\x20restart\x20motion\x20%s',_0x365697);return _0xacc0b0[_0x8665('0x10')](0xc8)[_0x8665('0x11')]({'output':_0x8665('0x1d')});})[_0x8665('0x1e')](function(_0x428309){logger['error'](_0x428309);return _0xacc0b0[_0x8665('0x10')](0x1f4)[_0x8665('0x11')](_0x428309);});};exports[_0x8665('0x1f')]=function(_0x10dd1f,_0x1d5212){var _0x2b161b=fs['readdirSync'](path[_0x8665('0x20')](config[_0x8665('0x21')],_0x8665('0x22'),_0x8665('0x1f')));var _0x2640a1=[];for(var _0x371247=0x0;_0x371247<_0x2b161b[_0x8665('0x23')];_0x371247++){var _0x467fb2=_0x2b161b[_0x371247][_0x8665('0x24')](_0x8665('0x25'),'');if(compareVersions(module[_0x8665('0x26')]['version'],_0x467fb2)===-0x1){_0x2640a1[_0x8665('0x27')](_0x467fb2);}}if(_0x2640a1[_0x8665('0x23')]){var _0x48dab8=_0x2640a1['sort'](compareVersions);var _0x33e340=new Umzug({'storage':_0x8665('0x28'),'storageOptions':{'model':db[_0x8665('0x29')],'modelName':_0x8665('0x29'),'columnName':'version'},'migrations':{'params':[db[_0x8665('0x28')][_0x8665('0x2a')](),db['sequelize'][_0x8665('0x2b')],function(){throw new Error(_0x8665('0x2c'));}],'path':path[_0x8665('0x20')](config[_0x8665('0x21')],_0x8665('0x22'),_0x8665('0x1f')),'pattern':/\.js$/}});_0x33e340['up']({'migrations':_['map'](_0x48dab8,function(_0x346d23){return _0x346d23+_0x8665('0x25');})})[_0x8665('0x1c')](function(){return _0x1d5212[_0x8665('0x10')](0xc8)[_0x8665('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8665('0x26')][_0x8665('0x3')]+_0x8665('0x2d')+_[_0x8665('0x2e')](_0x48dab8),'migrations':_[_0x8665('0x20')](_0x48dab8)});})[_0x8665('0x1e')](function(_0x51a8e3){if(_0x51a8e3 instanceof db[_0x8665('0x28')]['UniqueConstraintError']){return _0x1d5212[_0x8665('0x10')](0xc8)['json']({'output':_0x8665('0x2f')});}else{return _0x1d5212[_0x8665('0x10')](0x1f4)['json'](_0x51a8e3);}});}else{return _0x1d5212[_0x8665('0x10')](0xc8)[_0x8665('0x11')]({'output':_0x8665('0x2f')});}};
\ No newline at end of file
index 4162597..9baf6b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cfa=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete','destroy','exports','multer'];(function(_0x23bc66,_0x5c6783){var _0x5d5609=function(_0x21691a){while(--_0x21691a){_0x23bc66['push'](_0x23bc66['shift']());}};_0x5d5609(++_0x5c6783);}(_0x9cfa,0xb3));var _0xa9cf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9cfa[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa9cf('0x0'));var util=require(_0xa9cf('0x1'));var path=require(_0xa9cf('0x2'));var timeout=require(_0xa9cf('0x3'));var express=require('express');var router=express[_0xa9cf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa9cf('0x5'));var interaction=require(_0xa9cf('0x6'));var config=require(_0xa9cf('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xa9cf('0x8')](),controller[_0xa9cf('0x9')]);router[_0xa9cf('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xa9cf('0xb')]);router[_0xa9cf('0xa')](_0xa9cf('0xc'),auth[_0xa9cf('0x8')](),controller[_0xa9cf('0xd')]);router[_0xa9cf('0xe')]('/',auth['isAuthenticated'](),controller[_0xa9cf('0xf')]);router['put'](_0xa9cf('0xc'),auth[_0xa9cf('0x8')](),controller[_0xa9cf('0x10')]);router[_0xa9cf('0x11')](_0xa9cf('0xc'),auth['isAuthenticated'](),controller[_0xa9cf('0x12')]);module[_0xa9cf('0x13')]=router;
\ No newline at end of file
+var _0xaa65=['express','Router','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','destroy','connect-timeout'];(function(_0x155413,_0x1c89b4){var _0x434c71=function(_0x5b74a0){while(--_0x5b74a0){_0x155413['push'](_0x155413['shift']());}};_0x434c71(++_0x1c89b4);}(_0xaa65,0x194));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5aa6('0x0'));var express=require(_0x5aa6('0x1'));var router=express[_0x5aa6('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5aa6('0x3'));var controller=require(_0x5aa6('0x4'));router[_0x5aa6('0x5')]('/',auth[_0x5aa6('0x6')](),controller[_0x5aa6('0x7')]);router[_0x5aa6('0x5')](_0x5aa6('0x8'),auth[_0x5aa6('0x6')](),controller[_0x5aa6('0x9')]);router[_0x5aa6('0x5')](_0x5aa6('0xa'),auth[_0x5aa6('0x6')](),controller['show']);router['post']('/',auth[_0x5aa6('0x6')](),controller['create']);router[_0x5aa6('0xb')](_0x5aa6('0xa'),auth[_0x5aa6('0x6')](),controller[_0x5aa6('0xc')]);router[_0x5aa6('0xd')]('/:id',auth[_0x5aa6('0x6')](),controller[_0x5aa6('0xe')]);module['exports']=router;
\ No newline at end of file
index 18226d7..febe785 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x170f9d,_0xba5fad){var _0x44d5f5=function(_0x1a165f){while(--_0x1a165f){_0x170f9d['push'](_0x170f9d['shift']());}};_0x44d5f5(++_0xba5fad);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xeb3b[_0x1c34e7];return _0x378cb1;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'type':{'type':Sequelize[_0xbeb3('0x2')]},'uniqueid':{'type':Sequelize[_0xbeb3('0x2')]},'calleridnum':{'type':Sequelize[_0xbeb3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xbeb3('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xbeb3('0x3')]},'agentdumpAt':{'type':Sequelize[_0xbeb3('0x3')]},'holdtime':{'type':Sequelize[_0xbeb3('0x4')]},'agentcomplete':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xbeb3('0x4')]},'agentacw':{'type':Sequelize[_0xbeb3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xbeb3('0x4')]},'reason':{'type':Sequelize[_0xbeb3('0x2')]},'lastevent':{'type':Sequelize[_0xbeb3('0x2')]},'channel':{'type':Sequelize[_0xbeb3('0x2')]},'channelstate':{'type':Sequelize[_0xbeb3('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xbeb3('0x2')]},'connectedlinename':{'type':Sequelize[_0xbeb3('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xbeb3('0x2')]},'context':{'type':Sequelize[_0xbeb3('0x2')]},'exten':{'type':Sequelize[_0xbeb3('0x2')]},'priority':{'type':Sequelize[_0xbeb3('0x2')]},'destchannel':{'type':Sequelize[_0xbeb3('0x2')]},'destchannelstate':{'type':Sequelize[_0xbeb3('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xbeb3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xbeb3('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xbeb3('0x2')]},'destcontext':{'type':Sequelize[_0xbeb3('0x2')]},'destexten':{'type':Sequelize[_0xbeb3('0x2')]},'destpriority':{'type':Sequelize[_0xbeb3('0x2')]},'destuniqueid':{'type':Sequelize[_0xbeb3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xbeb3('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xbeb3('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xbeb3('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3cae=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x219143,_0x451ca3){var _0x501e6b=function(_0x5888fc){while(--_0x5888fc){_0x219143['push'](_0x219143['shift']());}};_0x501e6b(++_0x451ca3);}(_0x3cae,0x117));var _0xe3ca=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0x3cae[_0x1fafa5];return _0xcf08c9;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'type':{'type':Sequelize[_0xe3ca('0x2')]},'uniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'calleridnum':{'type':Sequelize[_0xe3ca('0x2')]},'calleridname':{'type':Sequelize[_0xe3ca('0x2')]},'queue':{'type':Sequelize[_0xe3ca('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe3ca('0x2')]},'agentcalledAt':{'type':Sequelize[_0xe3ca('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xe3ca('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xe3ca('0x3')]},'holdtime':{'type':Sequelize[_0xe3ca('0x4')]},'agentcomplete':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe3ca('0x4')]},'agentacw':{'type':Sequelize[_0xe3ca('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe3ca('0x4')]},'reason':{'type':Sequelize[_0xe3ca('0x2')]},'lastevent':{'type':Sequelize[_0xe3ca('0x2')]},'channel':{'type':Sequelize[_0xe3ca('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe3ca('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe3ca('0x2')]},'language':{'type':Sequelize[_0xe3ca('0x2')]},'accountcode':{'type':Sequelize[_0xe3ca('0x2')]},'context':{'type':Sequelize[_0xe3ca('0x2')]},'exten':{'type':Sequelize[_0xe3ca('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe3ca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe3ca('0x2')]},'destcalleridname':{'type':Sequelize[_0xe3ca('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe3ca('0x2')]},'destlanguage':{'type':Sequelize[_0xe3ca('0x2')]},'destaccountcode':{'type':Sequelize[_0xe3ca('0x2')]},'destcontext':{'type':Sequelize[_0xe3ca('0x2')]},'destexten':{'type':Sequelize[_0xe3ca('0x2')]},'destpriority':{'type':Sequelize[_0xe3ca('0x2')]},'destuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe3ca('0x2')],'comment':_0xe3ca('0x6')},'transferexten':{'type':Sequelize[_0xe3ca('0x2')]},'transferuniqueid':{'type':Sequelize[_0xe3ca('0x2')]},'agententerreason':{'type':Sequelize[_0xe3ca('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 0027974..88d8ab2 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(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 223ac0b..aed4875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16cc=['path','../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe016b6,_0x3568e3){var _0xe24755=function(_0x109814){while(--_0x109814){_0xe016b6['push'](_0xe016b6['shift']());}};_0xe24755(++_0x3568e3);}(_0x16cc,0x120));var _0xc16c=function(_0x3abbaf,_0x2b778c){_0x3abbaf=_0x3abbaf-0x0;var _0x59db27=_0x16cc[_0x3abbaf];return _0x59db27;};'use strict';var _=require('lodash');var util=require(_0xc16c('0x0'));var logger=require(_0xc16c('0x1'))(_0xc16c('0x2'));var moment=require(_0xc16c('0x3'));var BPromise=require(_0xc16c('0x4'));var rp=require(_0xc16c('0x5'));var fs=require('fs');var path=require(_0xc16c('0x6'));var rimraf=require('rimraf');var config=require(_0xc16c('0x7'));var attributes=require(_0xc16c('0x8'));module[_0xc16c('0x9')]=function(_0x1019ec,_0x5ea82b){return _0x1019ec[_0xc16c('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xc16c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xc16c('0xc'),_0xc16c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0763=['path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xabeccc,_0x6d8305){var _0x37f527=function(_0x2b1d19){while(--_0x2b1d19){_0xabeccc['push'](_0xabeccc['shift']());}};_0x37f527(++_0x6d8305);}(_0x0763,0x87));var _0x3076=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x0763[_0x1b95a1];return _0x57aef1;};'use strict';var _=require(_0x3076('0x0'));var util=require('util');var logger=require(_0x3076('0x1'))(_0x3076('0x2'));var moment=require('moment');var BPromise=require(_0x3076('0x3'));var rp=require(_0x3076('0x4'));var fs=require('fs');var path=require(_0x3076('0x5'));var rimraf=require(_0x3076('0x6'));var config=require('../../config/environment');var attributes=require(_0x3076('0x7'));module[_0x3076('0x8')]=function(_0x1ce2ff,_0x1b5f4e){return _0x1ce2ff[_0x3076('0x9')](_0x3076('0xa'),attributes,{'tableName':_0x3076('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3076('0xc'),_0x3076('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d9c2ca1..674187c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cad=['code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x1cad,0x118));var _0xd1ca=function(_0x2934ef,_0x113448){_0x2934ef=_0x2934ef-0x0;var _0x544a8d=_0x1cad[_0x2934ef];return _0x544a8d;};'use strict';var _=require('lodash');var util=require(_0xd1ca('0x0'));var moment=require(_0xd1ca('0x1'));var BPromise=require(_0xd1ca('0x2'));var rs=require(_0xd1ca('0x3'));var fs=require('fs');var Redis=require(_0xd1ca('0x4'));var db=require(_0xd1ca('0x5'))['db'];var utils=require(_0xd1ca('0x6'));var logger=require('../../config/logger')(_0xd1ca('0x7'));var config=require('../../config/environment');var jayson=require(_0xd1ca('0x8'));var client=jayson['client'][_0xd1ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2af3c5,_0x49dea,_0x171647){return new BPromise(function(_0x5ed8df,_0x406b08){return client[_0xd1ca('0xa')](_0x2af3c5,_0x171647)[_0xd1ca('0xb')](function(_0x198702){logger['info'](_0xd1ca('0xc'),_0x49dea,_0xd1ca('0xd'));logger[_0xd1ca('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x49dea,_0xd1ca('0xd'),JSON[_0xd1ca('0xf')](_0x198702));if(_0x198702[_0xd1ca('0x10')]){if(_0x198702[_0xd1ca('0x10')][_0xd1ca('0x11')]===0x1f4){logger[_0xd1ca('0x10')](_0xd1ca('0xc'),_0x49dea,_0x198702[_0xd1ca('0x10')]['message']);return _0x406b08(_0x198702[_0xd1ca('0x10')]['message']);}logger['error'](_0xd1ca('0xc'),_0x49dea,_0x198702[_0xd1ca('0x10')][_0xd1ca('0x12')]);return _0x5ed8df(_0x198702[_0xd1ca('0x10')]['message']);}else{logger[_0xd1ca('0x13')](_0xd1ca('0xc'),_0x49dea,'request\x20sent');_0x5ed8df(_0x198702[_0xd1ca('0x14')][_0xd1ca('0x12')]);}})[_0xd1ca('0x15')](function(_0x336241){logger[_0xd1ca('0x10')](_0xd1ca('0xc'),_0x49dea,_0x336241);_0x406b08(_0x336241);});});}exports[_0xd1ca('0x16')]=function(_0x1068a4){var _0x18d282=this;return new Promise(function(_0x30bd35,_0x198e93){return db[_0xd1ca('0x17')][_0xd1ca('0x18')](_0x1068a4[_0xd1ca('0x19')],{'raw':_0x1068a4[_0xd1ca('0x1a')]?_0x1068a4['options']['raw']===undefined?!![]:![]:!![]})[_0xd1ca('0xb')](function(_0xadc215){logger[_0xd1ca('0x13')](_0xd1ca('0x16'),_0x1068a4);logger[_0xd1ca('0xe')]('CreateVoiceAgentReport',_0x1068a4,JSON[_0xd1ca('0xf')](_0xadc215));_0x30bd35(_0xadc215);})[_0xd1ca('0x15')](function(_0x9c7199){logger[_0xd1ca('0x10')]('CreateVoiceAgentReport',_0x9c7199[_0xd1ca('0x12')],_0x1068a4);_0x198e93(_0x18d282[_0xd1ca('0x10')](0x1f4,_0x9c7199[_0xd1ca('0x12')]));});});};exports[_0xd1ca('0x1b')]=function(_0x4ca918){var _0x4e1674=this;return new Promise(function(_0x4ceb0a,_0x32be53){return db['VoiceAgentReport'][_0xd1ca('0x1c')](_0x4ca918[_0xd1ca('0x19')],{'raw':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918['options'][_0xd1ca('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x1e')]||null:null,'attributes':_0x4ca918['options']?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x1f')]||null:null,'limit':_0x4ca918[_0xd1ca('0x1a')]?_0x4ca918[_0xd1ca('0x1a')][_0xd1ca('0x20')]||null:null})[_0xd1ca('0xb')](function(_0x3778f2){logger[_0xd1ca('0x13')](_0xd1ca('0x1b'),_0x4ca918);logger[_0xd1ca('0xe')](_0xd1ca('0x1b'),_0x4ca918,JSON[_0xd1ca('0xf')](_0x3778f2));_0x4ceb0a(_0x3778f2);})['catch'](function(_0x65c083){logger[_0xd1ca('0x10')](_0xd1ca('0x1b'),_0x65c083[_0xd1ca('0x12')],_0x4ca918);_0x32be53(_0x4e1674['error'](0x1f4,_0x65c083[_0xd1ca('0x12')]));});});};
\ No newline at end of file
+var _0x15a4=['../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x195bca,_0x5e92c7){var _0x495e7b=function(_0x59a09f){while(--_0x59a09f){_0x195bca['push'](_0x195bca['shift']());}};_0x495e7b(++_0x5e92c7);}(_0x15a4,0x178));var _0x415a=function(_0x4cb133,_0x18788d){_0x4cb133=_0x4cb133-0x0;var _0x378e2b=_0x15a4[_0x4cb133];return _0x378e2b;};'use strict';var _=require(_0x415a('0x0'));var util=require(_0x415a('0x1'));var moment=require(_0x415a('0x2'));var BPromise=require(_0x415a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x415a('0x4'));var db=require(_0x415a('0x5'))['db'];var utils=require(_0x415a('0x6'));var logger=require(_0x415a('0x7'))('rpc');var config=require(_0x415a('0x8'));var jayson=require(_0x415a('0x9'));var client=jayson[_0x415a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb196,_0x2106d0,_0x398fae){return new BPromise(function(_0x2021b4,_0x2f18e9){return client[_0x415a('0xb')](_0x2bb196,_0x398fae)[_0x415a('0xc')](function(_0x5eb699){logger[_0x415a('0xd')](_0x415a('0xe'),_0x2106d0,_0x415a('0xf'));logger[_0x415a('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x2106d0,_0x415a('0xf'),JSON[_0x415a('0x11')](_0x5eb699));if(_0x5eb699[_0x415a('0x12')]){if(_0x5eb699[_0x415a('0x12')]['code']===0x1f4){logger[_0x415a('0x12')](_0x415a('0xe'),_0x2106d0,_0x5eb699[_0x415a('0x12')][_0x415a('0x13')]);return _0x2f18e9(_0x5eb699[_0x415a('0x12')][_0x415a('0x13')]);}logger[_0x415a('0x12')](_0x415a('0xe'),_0x2106d0,_0x5eb699[_0x415a('0x12')]['message']);return _0x2021b4(_0x5eb699[_0x415a('0x12')][_0x415a('0x13')]);}else{logger[_0x415a('0xd')](_0x415a('0xe'),_0x2106d0,_0x415a('0xf'));_0x2021b4(_0x5eb699[_0x415a('0x14')][_0x415a('0x13')]);}})[_0x415a('0x15')](function(_0x5c445a){logger[_0x415a('0x12')](_0x415a('0xe'),_0x2106d0,_0x5c445a);_0x2f18e9(_0x5c445a);});});}exports[_0x415a('0x16')]=function(_0x7ceb0d){var _0x16ff2a=this;return new Promise(function(_0x3e95f3,_0x463c4d){return db[_0x415a('0x17')][_0x415a('0x18')](_0x7ceb0d[_0x415a('0x19')],{'raw':_0x7ceb0d[_0x415a('0x1a')]?_0x7ceb0d[_0x415a('0x1a')][_0x415a('0x1b')]===undefined?!![]:![]:!![]})[_0x415a('0xc')](function(_0x421a92){logger[_0x415a('0xd')](_0x415a('0x16'),_0x7ceb0d);logger[_0x415a('0x10')](_0x415a('0x16'),_0x7ceb0d,JSON[_0x415a('0x11')](_0x421a92));_0x3e95f3(_0x421a92);})['catch'](function(_0x31ab77){logger[_0x415a('0x12')](_0x415a('0x16'),_0x31ab77[_0x415a('0x13')],_0x7ceb0d);_0x463c4d(_0x16ff2a[_0x415a('0x12')](0x1f4,_0x31ab77[_0x415a('0x13')]));});});};exports[_0x415a('0x1c')]=function(_0x483b07){var _0x1d4b39=this;return new Promise(function(_0x44c65b,_0x5e39b2){return db[_0x415a('0x17')]['update'](_0x483b07[_0x415a('0x19')],{'raw':_0x483b07[_0x415a('0x1a')]?_0x483b07[_0x415a('0x1a')][_0x415a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x483b07[_0x415a('0x1a')]?_0x483b07['options'][_0x415a('0x1d')]||null:null,'attributes':_0x483b07[_0x415a('0x1a')]?_0x483b07[_0x415a('0x1a')][_0x415a('0x1e')]||null:null,'limit':_0x483b07[_0x415a('0x1a')]?_0x483b07[_0x415a('0x1a')][_0x415a('0x1f')]||null:null})[_0x415a('0xc')](function(_0x1b25d9){logger[_0x415a('0xd')](_0x415a('0x1c'),_0x483b07);logger[_0x415a('0x10')]('UpdateVoiceAgentReport',_0x483b07,JSON[_0x415a('0x11')](_0x1b25d9));_0x44c65b(_0x1b25d9);})['catch'](function(_0x3a9c15){logger[_0x415a('0x12')](_0x415a('0x1c'),_0x3a9c15[_0x415a('0x13')],_0x483b07);_0x5e39b2(_0x1d4b39['error'](0x1f4,_0x3a9c15['message']));});});};
\ No newline at end of file
index d452500..8f6d272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','show','post','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x008c,0x188));var _0xc008=function(_0x308c00,_0x3cbd67){_0x308c00=_0x308c00-0x0;var _0x2b21b2=_0x008c[_0x308c00];return _0x2b21b2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['update']);router[_0xc008('0x10')](_0xc008('0xf'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);module[_0xc008('0x12')]=router;
\ No newline at end of file
+var _0x032e=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller'];(function(_0x16fe0d,_0x6e648a){var _0x5230c8=function(_0x43815a){while(--_0x43815a){_0x16fe0d['push'](_0x16fe0d['shift']());}};_0x5230c8(++_0x6e648a);}(_0x032e,0x124));var _0xe032=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x032e[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')]('/',auth[_0xe032('0x9')](),controller[_0xe032('0xa')]);router[_0xe032('0x8')](_0xe032('0xb'),auth[_0xe032('0x9')](),controller[_0xe032('0xc')]);router[_0xe032('0x8')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0xe')]);router[_0xe032('0xf')]('/',auth[_0xe032('0x9')](),controller['create']);router[_0xe032('0x10')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller[_0xe032('0x11')]);router[_0xe032('0x12')](_0xe032('0xd'),auth[_0xe032('0x9')](),controller['destroy']);module[_0xe032('0x13')]=router;
\ No newline at end of file
index bdb526b..7e434cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dc7=['ENUM','inbound','internal','outbound','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x2d9be5,_0x38ec53){var _0x86cded=function(_0x33858a){while(--_0x33858a){_0x2d9be5['push'](_0x2d9be5['shift']());}};_0x86cded(++_0x38ec53);}(_0x5dc7,0x148));var _0x75dc=function(_0x49dca5,_0x563f7e){_0x49dca5=_0x49dca5-0x0;var _0x15b7de=_0x5dc7[_0x49dca5];return _0x15b7de;};'use strict';var Sequelize=require(_0x75dc('0x0'));module[_0x75dc('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x75dc('0x2')](_0x75dc('0x3'),_0x75dc('0x4'),_0x75dc('0x5'),'inbound-fax','outbound-fax',_0x75dc('0x6'))},'tag':{'type':Sequelize[_0x75dc('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x75dc('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x75dc('0x7')]},'callerid':{'type':Sequelize[_0x75dc('0x7')]},'channel':{'type':Sequelize[_0x75dc('0x7')]},'destinationchannel':{'type':Sequelize[_0x75dc('0x7')]},'lastapplication':{'type':Sequelize[_0x75dc('0x7')]},'lastdata':{'type':Sequelize[_0x75dc('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x75dc('0x9')]},'endtime':{'type':Sequelize[_0x75dc('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x75dc('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x75dc('0x7')]},'amaflags':{'type':Sequelize[_0x75dc('0x7')]},'userfield':{'type':Sequelize[_0x75dc('0x7')]},'userDisposition':{'type':Sequelize[_0x75dc('0x7')]},'userSecondDisposition':{'type':Sequelize[_0x75dc('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x75dc('0x7')]},'note':{'type':Sequelize[_0x75dc('0x7')]},'prefix':{'type':Sequelize[_0x75dc('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x75dc('0x7')]}};
\ No newline at end of file
+var _0x74ca=['STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x74ca,0xfa));var _0xa74c=function(_0x1fb46a,_0x3f6afc){_0x1fb46a=_0x1fb46a-0x0;var _0x5e2e22=_0x74ca[_0x1fb46a];return _0x5e2e22;};'use strict';var Sequelize=require(_0xa74c('0x0'));module[_0xa74c('0x1')]={'uniqueid':{'type':Sequelize[_0xa74c('0x2')]},'type':{'type':Sequelize[_0xa74c('0x3')](_0xa74c('0x4'),_0xa74c('0x5'),_0xa74c('0x6'),_0xa74c('0x7'),'outbound-fax',_0xa74c('0x8'))},'tag':{'type':Sequelize[_0xa74c('0x2')]},'accountcode':{'type':Sequelize[_0xa74c('0x2')]},'source':{'type':Sequelize[_0xa74c('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xa74c('0x2')]},'callerid':{'type':Sequelize[_0xa74c('0x2')]},'channel':{'type':Sequelize[_0xa74c('0x2')]},'destinationchannel':{'type':Sequelize[_0xa74c('0x2')]},'lastapplication':{'type':Sequelize[_0xa74c('0x2')]},'lastdata':{'type':Sequelize[_0xa74c('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xa74c('0xa')]},'answertime':{'type':Sequelize[_0xa74c('0xa')]},'endtime':{'type':Sequelize[_0xa74c('0xa')]},'duration':{'type':Sequelize[_0xa74c('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xa74c('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa74c('0x2')]},'amaflags':{'type':Sequelize[_0xa74c('0x2')]},'userfield':{'type':Sequelize[_0xa74c('0x2')]},'userDisposition':{'type':Sequelize[_0xa74c('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xa74c('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa74c('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xa74c('0xb')]},'sipcallid':{'type':Sequelize[_0xa74c('0x2')]}};
\ No newline at end of file
index 088fea5..fe54023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'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
+var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x99ceac,_0x23cfec){var _0x258999=function(_0x45baee){while(--_0x45baee){_0x99ceac['push'](_0x99ceac['shift']());}};_0x258999(++_0x23cfec);}(_0xdb28,0x106));var _0x8db2=function(_0x4d9ed6,_0x1c8b2c){_0x4d9ed6=_0x4d9ed6-0x0;var _0x37d416=_0xdb28[_0x4d9ed6];return _0x37d416;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};
\ No newline at end of file
index d5a6287..d065e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc882=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','path'];(function(_0x40711c,_0x2b24e1){var _0x1d0b89=function(_0xe8884f){while(--_0xe8884f){_0x40711c['push'](_0x40711c['shift']());}};_0x1d0b89(++_0x2b24e1);}(_0xc882,0x126));var _0x2c88=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc882[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2c88('0x0'));var util=require(_0x2c88('0x1'));var logger=require(_0x2c88('0x2'))('api');var moment=require(_0x2c88('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c88('0x4'));var rimraf=require(_0x2c88('0x5'));var config=require(_0x2c88('0x6'));var attributes=require(_0x2c88('0x7'));module[_0x2c88('0x8')]=function(_0x37e343,_0x322f8c){return _0x37e343[_0x2c88('0x9')](_0x2c88('0xa'),attributes,{'tableName':_0x2c88('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2c88('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a99=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','define','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x34a6b1,_0x422c44){var _0x4f18dc=function(_0x413456){while(--_0x413456){_0x34a6b1['push'](_0x34a6b1['shift']());}};_0x4f18dc(++_0x422c44);}(_0x2a99,0x14a));var _0x92a9=function(_0x42fc3e,_0xdc5885){_0x42fc3e=_0x42fc3e-0x0;var _0x52e1fa=_0x2a99[_0x42fc3e];return _0x52e1fa;};'use strict';var _=require(_0x92a9('0x0'));var util=require(_0x92a9('0x1'));var logger=require(_0x92a9('0x2'))(_0x92a9('0x3'));var moment=require(_0x92a9('0x4'));var BPromise=require(_0x92a9('0x5'));var rp=require(_0x92a9('0x6'));var fs=require('fs');var path=require(_0x92a9('0x7'));var rimraf=require(_0x92a9('0x8'));var config=require(_0x92a9('0x9'));var attributes=require(_0x92a9('0xa'));module['exports']=function(_0xbcf21,_0x286c9b){return _0xbcf21[_0x92a9('0xb')]('VoiceCallReport',attributes,{'tableName':_0x92a9('0xc'),'paranoid':![],'indexes':[{'fields':[_0x92a9('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d180952..28fad01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe521=['../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x463012,_0x4ba3a9){var _0x28fe0c=function(_0x49bdf4){while(--_0x49bdf4){_0x463012['push'](_0x463012['shift']());}};_0x28fe0c(++_0x4ba3a9);}(_0xe521,0x174));var _0x1e52=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe521[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e52('0x0'));var util=require(_0x1e52('0x1'));var moment=require(_0x1e52('0x2'));var BPromise=require(_0x1e52('0x3'));var rs=require(_0x1e52('0x4'));var fs=require('fs');var Redis=require(_0x1e52('0x5'));var db=require(_0x1e52('0x6'))['db'];var utils=require(_0x1e52('0x7'));var logger=require(_0x1e52('0x8'))(_0x1e52('0x9'));var config=require(_0x1e52('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1e52('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa69753,_0x59066b,_0x41a63a){return new BPromise(function(_0x4a093e,_0x16318b){return client[_0x1e52('0xc')](_0xa69753,_0x41a63a)[_0x1e52('0xd')](function(_0x19df65){logger[_0x1e52('0xe')](_0x1e52('0xf'),_0x59066b,_0x1e52('0x10'));logger[_0x1e52('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x59066b,_0x1e52('0x10'),JSON[_0x1e52('0x12')](_0x19df65));if(_0x19df65['error']){if(_0x19df65[_0x1e52('0x13')][_0x1e52('0x14')]===0x1f4){logger['error'](_0x1e52('0xf'),_0x59066b,_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);return _0x16318b(_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);}logger[_0x1e52('0x13')](_0x1e52('0xf'),_0x59066b,_0x19df65['error'][_0x1e52('0x15')]);return _0x4a093e(_0x19df65[_0x1e52('0x13')][_0x1e52('0x15')]);}else{logger[_0x1e52('0xe')](_0x1e52('0xf'),_0x59066b,_0x1e52('0x10'));_0x4a093e(_0x19df65[_0x1e52('0x16')][_0x1e52('0x15')]);}})[_0x1e52('0x17')](function(_0x4fcda4){logger[_0x1e52('0x13')](_0x1e52('0xf'),_0x59066b,_0x4fcda4);_0x16318b(_0x4fcda4);});});}exports['GetVoiceCallReport']=function(_0x1ab0fd){var _0x29c574=this;return new Promise(function(_0x5812ab,_0xc53c30){return db[_0x1e52('0x18')][_0x1e52('0x19')]({'raw':_0x1ab0fd['options']?_0x1ab0fd[_0x1e52('0x1a')][_0x1e52('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd[_0x1e52('0x1a')]['where']||null:null,'attributes':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd[_0x1e52('0x1a')][_0x1e52('0x1c')]||null:null,'limit':_0x1ab0fd[_0x1e52('0x1a')]?_0x1ab0fd['options'][_0x1e52('0x1d')]||null:null,'include':_0x1ab0fd['options']?_0x1ab0fd[_0x1e52('0x1a')]['include']?_['map'](_0x1ab0fd[_0x1e52('0x1a')]['include'],function(_0x9edb99){return{'model':db[_0x9edb99['model']],'as':_0x9edb99['as'],'attributes':_0x9edb99[_0x1e52('0x1c')],'include':_0x9edb99[_0x1e52('0x1e')]?_[_0x1e52('0x1f')](_0x9edb99[_0x1e52('0x1e')],function(_0x48d45c){return{'model':db[_0x48d45c[_0x1e52('0x20')]],'as':_0x48d45c['as'],'attributes':_0x48d45c[_0x1e52('0x1c')],'include':_0x48d45c[_0x1e52('0x1e')]?_[_0x1e52('0x1f')](_0x48d45c[_0x1e52('0x1e')],function(_0x3123b0){return{'model':db[_0x3123b0[_0x1e52('0x20')]],'as':_0x3123b0['as'],'attributes':_0x3123b0[_0x1e52('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1e52('0xd')](function(_0x285b17){logger[_0x1e52('0xe')]('GetVoiceCallReport',_0x1ab0fd);logger[_0x1e52('0x11')](_0x1e52('0x21'),_0x1ab0fd,JSON[_0x1e52('0x12')](_0x285b17));_0x5812ab(_0x285b17);})[_0x1e52('0x17')](function(_0x4126c4){logger[_0x1e52('0x13')](_0x1e52('0x21'),_0x4126c4[_0x1e52('0x15')],_0x1ab0fd);_0xc53c30(_0x29c574[_0x1e52('0x13')](0x1f4,_0x4126c4[_0x1e52('0x15')]));});});};exports[_0x1e52('0x22')]=function(_0x2649ae){var _0x56dc7e=this;return new Promise(function(_0x4c6527,_0x4f35a1){return db[_0x1e52('0x18')]['create'](_0x2649ae['body'],{'raw':_0x2649ae[_0x1e52('0x1a')]?_0x2649ae[_0x1e52('0x1a')][_0x1e52('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x430608){logger[_0x1e52('0xe')]('CreateVoiceCallReport',_0x2649ae);logger[_0x1e52('0x11')](_0x1e52('0x22'),_0x2649ae,JSON[_0x1e52('0x12')](_0x430608));_0x4c6527(_0x430608);})[_0x1e52('0x17')](function(_0x95f3c1){logger[_0x1e52('0x13')](_0x1e52('0x22'),_0x95f3c1[_0x1e52('0x15')],_0x2649ae);_0x4f35a1(_0x56dc7e['error'](0x1f4,_0x95f3c1[_0x1e52('0x15')]));});});};exports[_0x1e52('0x23')]=function(_0x562d11){var _0x5b381c=this;return new Promise(function(_0x1b0b37,_0x8a9546){return db['VoiceCallReport'][_0x1e52('0x24')](_0x562d11['body'],{'raw':_0x562d11[_0x1e52('0x1a')]?_0x562d11['options'][_0x1e52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x562d11[_0x1e52('0x1a')]?_0x562d11[_0x1e52('0x1a')][_0x1e52('0x25')]||null:null,'attributes':_0x562d11[_0x1e52('0x1a')]?_0x562d11[_0x1e52('0x1a')][_0x1e52('0x1c')]||null:null,'limit':_0x562d11[_0x1e52('0x1a')]?_0x562d11['options'][_0x1e52('0x1d')]||null:null})[_0x1e52('0xd')](function(_0x2b5807){logger[_0x1e52('0xe')](_0x1e52('0x23'),_0x562d11);logger[_0x1e52('0x11')](_0x1e52('0x23'),_0x562d11,JSON[_0x1e52('0x12')](_0x2b5807));_0x1b0b37(_0x2b5807);})[_0x1e52('0x17')](function(_0x1b3872){logger[_0x1e52('0x13')](_0x1e52('0x23'),_0x1b3872[_0x1e52('0x15')],_0x562d11);_0x8a9546(_0x5b381c[_0x1e52('0x13')](0x1f4,_0x1b3872[_0x1e52('0x15')]));});});};
\ No newline at end of file
+var _0x534d=['model','then','create','raw','CreateVoiceCallReport','UpdateVoiceCallReport','update','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','include','map'];(function(_0x213035,_0x522aae){var _0x467663=function(_0x45c36f){while(--_0x45c36f){_0x213035['push'](_0x213035['shift']());}};_0x467663(++_0x522aae);}(_0x534d,0x154));var _0xd534=function(_0x29d1d4,_0x268165){_0x29d1d4=_0x29d1d4-0x0;var _0x33ec90=_0x534d[_0x29d1d4];return _0x33ec90;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd534('0x0'));var BPromise=require('bluebird');var rs=require(_0xd534('0x1'));var fs=require('fs');var Redis=require(_0xd534('0x2'));var db=require(_0xd534('0x3'))['db'];var utils=require(_0xd534('0x4'));var logger=require('../../config/logger')(_0xd534('0x5'));var config=require(_0xd534('0x6'));var jayson=require(_0xd534('0x7'));var client=jayson[_0xd534('0x8')][_0xd534('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b6e99,_0x312a1b,_0x1e7c33){return new BPromise(function(_0x170032,_0x1a4a45){return client[_0xd534('0xa')](_0x5b6e99,_0x1e7c33)['then'](function(_0x4627d4){logger[_0xd534('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x312a1b,_0xd534('0xc'));logger[_0xd534('0xd')](_0xd534('0xe'),_0x312a1b,_0xd534('0xc'),JSON[_0xd534('0xf')](_0x4627d4));if(_0x4627d4['error']){if(_0x4627d4[_0xd534('0x10')][_0xd534('0x11')]===0x1f4){logger[_0xd534('0x10')](_0xd534('0x12'),_0x312a1b,_0x4627d4[_0xd534('0x10')]['message']);return _0x1a4a45(_0x4627d4[_0xd534('0x10')][_0xd534('0x13')]);}logger[_0xd534('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x312a1b,_0x4627d4[_0xd534('0x10')][_0xd534('0x13')]);return _0x170032(_0x4627d4['error']['message']);}else{logger[_0xd534('0xb')](_0xd534('0x12'),_0x312a1b,_0xd534('0xc'));_0x170032(_0x4627d4[_0xd534('0x14')][_0xd534('0x13')]);}})[_0xd534('0x15')](function(_0x258f93){logger[_0xd534('0x10')](_0xd534('0x12'),_0x312a1b,_0x258f93);_0x1a4a45(_0x258f93);});});}exports[_0xd534('0x16')]=function(_0x27e8e7){var _0x135d84=this;return new Promise(function(_0x323ae7,_0xfcd07f){return db[_0xd534('0x17')][_0xd534('0x18')]({'raw':_0x27e8e7[_0xd534('0x19')]?_0x27e8e7['options']['raw']===undefined?!![]:![]:!![],'where':_0x27e8e7[_0xd534('0x19')]?_0x27e8e7['options'][_0xd534('0x1a')]||null:null,'attributes':_0x27e8e7[_0xd534('0x19')]?_0x27e8e7[_0xd534('0x19')][_0xd534('0x1b')]||null:null,'limit':_0x27e8e7[_0xd534('0x19')]?_0x27e8e7['options']['limit']||null:null,'include':_0x27e8e7[_0xd534('0x19')]?_0x27e8e7[_0xd534('0x19')][_0xd534('0x1c')]?_[_0xd534('0x1d')](_0x27e8e7['options']['include'],function(_0x53aa0c){return{'model':db[_0x53aa0c[_0xd534('0x1e')]],'as':_0x53aa0c['as'],'attributes':_0x53aa0c['attributes'],'include':_0x53aa0c['include']?_[_0xd534('0x1d')](_0x53aa0c[_0xd534('0x1c')],function(_0x3209f9){return{'model':db[_0x3209f9[_0xd534('0x1e')]],'as':_0x3209f9['as'],'attributes':_0x3209f9['attributes'],'include':_0x3209f9[_0xd534('0x1c')]?_[_0xd534('0x1d')](_0x3209f9[_0xd534('0x1c')],function(_0xbe952d){return{'model':db[_0xbe952d[_0xd534('0x1e')]],'as':_0xbe952d['as'],'attributes':_0xbe952d[_0xd534('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd534('0x1f')](function(_0x1cf0bd){logger[_0xd534('0xb')](_0xd534('0x16'),_0x27e8e7);logger[_0xd534('0xd')](_0xd534('0x16'),_0x27e8e7,JSON[_0xd534('0xf')](_0x1cf0bd));_0x323ae7(_0x1cf0bd);})[_0xd534('0x15')](function(_0x3d7934){logger[_0xd534('0x10')](_0xd534('0x16'),_0x3d7934[_0xd534('0x13')],_0x27e8e7);_0xfcd07f(_0x135d84[_0xd534('0x10')](0x1f4,_0x3d7934[_0xd534('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x47b978){var _0x41dbc9=this;return new Promise(function(_0x542262,_0x166fed){return db[_0xd534('0x17')][_0xd534('0x20')](_0x47b978['body'],{'raw':_0x47b978['options']?_0x47b978[_0xd534('0x19')][_0xd534('0x21')]===undefined?!![]:![]:!![]})[_0xd534('0x1f')](function(_0x27ca6a){logger['info'](_0xd534('0x22'),_0x47b978);logger[_0xd534('0xd')](_0xd534('0x22'),_0x47b978,JSON[_0xd534('0xf')](_0x27ca6a));_0x542262(_0x27ca6a);})[_0xd534('0x15')](function(_0x334e86){logger['error']('CreateVoiceCallReport',_0x334e86['message'],_0x47b978);_0x166fed(_0x41dbc9[_0xd534('0x10')](0x1f4,_0x334e86['message']));});});};exports[_0xd534('0x23')]=function(_0x3ed5fa){var _0x1e6098=this;return new Promise(function(_0x179225,_0x45d03c){return db[_0xd534('0x17')][_0xd534('0x24')](_0x3ed5fa['body'],{'raw':_0x3ed5fa[_0xd534('0x19')]?_0x3ed5fa[_0xd534('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ed5fa[_0xd534('0x19')]?_0x3ed5fa[_0xd534('0x19')]['where']||null:null,'attributes':_0x3ed5fa[_0xd534('0x19')]?_0x3ed5fa[_0xd534('0x19')][_0xd534('0x1b')]||null:null,'limit':_0x3ed5fa[_0xd534('0x19')]?_0x3ed5fa[_0xd534('0x19')]['limit']||null:null})[_0xd534('0x1f')](function(_0x12c747){logger['info'](_0xd534('0x23'),_0x3ed5fa);logger[_0xd534('0xd')](_0xd534('0x23'),_0x3ed5fa,JSON[_0xd534('0xf')](_0x12c747));_0x179225(_0x12c747);})[_0xd534('0x15')](function(_0x2b6a58){logger[_0xd534('0x10')]('UpdateVoiceCallReport',_0x2b6a58['message'],_0x3ed5fa);_0x45d03c(_0x1e6098['error'](0x1f4,_0x2b6a58[_0xd534('0x13')]));});});};
\ No newline at end of file
index c73eb75..3bbd808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b8=['get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0xd3b8,0xd6));var _0x8d3b=function(_0x23d2a0,_0x516174){_0x23d2a0=_0x23d2a0-0x0;var _0x409e80=_0xd3b8[_0x23d2a0];return _0x409e80;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8d3b('0x0'));var express=require(_0x8d3b('0x1'));var router=express[_0x8d3b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8d3b('0x3'));var interaction=require(_0x8d3b('0x4'));var config=require(_0x8d3b('0x5'));var controller=require(_0x8d3b('0x6'));router[_0x8d3b('0x7')]('/',auth[_0x8d3b('0x8')](),controller[_0x8d3b('0x9')]);router['get'](_0x8d3b('0xa'),auth['isAuthenticated'](),controller[_0x8d3b('0xb')]);router['post']('/',auth[_0x8d3b('0x8')](),controller[_0x8d3b('0xc')]);router[_0x8d3b('0xd')](_0x8d3b('0xa'),auth[_0x8d3b('0x8')](),controller['update']);router[_0x8d3b('0xe')](_0x8d3b('0xa'),auth[_0x8d3b('0x8')](),controller[_0x8d3b('0xf')]);module[_0x8d3b('0x10')]=router;
\ No newline at end of file
+var _0x4af2=['/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x4af2,0x1ca));var _0x24af=function(_0x3b945f,_0x2a0b57){_0x3b945f=_0x3b945f-0x0;var _0x4513c3=_0x4af2[_0x3b945f];return _0x4513c3;};'use strict';var multer=require('multer');var util=require(_0x24af('0x0'));var path=require(_0x24af('0x1'));var timeout=require(_0x24af('0x2'));var express=require(_0x24af('0x3'));var router=express[_0x24af('0x4')]();var fs_extra=require(_0x24af('0x5'));var auth=require(_0x24af('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24af('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x24af('0x8')]('/',auth[_0x24af('0x9')](),controller['index']);router[_0x24af('0x8')](_0x24af('0xa'),auth[_0x24af('0x9')](),controller[_0x24af('0xb')]);router[_0x24af('0xc')]('/',auth[_0x24af('0x9')](),controller[_0x24af('0xd')]);router[_0x24af('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x24af('0xf')]);router['delete']('/:id',auth[_0x24af('0x9')](),controller[_0x24af('0x10')]);module[_0x24af('0x11')]=router;
\ No newline at end of file
index 7543d12..f893e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ce=['BOOLEAN','sequelize','exports','STRING','name','options','join','getDataValue','split'];(function(_0x7e4e6b,_0x4c26c6){var _0x219afa=function(_0x20e11e){while(--_0x20e11e){_0x7e4e6b['push'](_0x7e4e6b['shift']());}};_0x219afa(++_0x4c26c6);}(_0xe9ce,0xbe));var _0xee9c=function(_0x18ece2,_0xd87505){_0x18ece2=_0x18ece2-0x0;var _0x1c3930=_0xe9ce[_0x18ece2];return _0x1c3930;};'use strict';var Sequelize=require(_0xee9c('0x0'));module[_0xee9c('0x1')]={'name':{'type':Sequelize[_0xee9c('0x2')]},'prefix':{'type':Sequelize[_0xee9c('0x2')],'unique':_0xee9c('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xee9c('0x2')],'set':function(_0x2c13e3){this['setDataValue'](_0xee9c('0x4'),_0x2c13e3?_0x2c13e3[_0xee9c('0x5')](''):[]);},'get':function(){return this[_0xee9c('0x6')](_0xee9c('0x4'))?this[_0xee9c('0x6')](_0xee9c('0x4'))[_0xee9c('0x7')](''):[];}},'auth':{'type':Sequelize[_0xee9c('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xee9c('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee9c('0x2')]}};
\ No newline at end of file
+var _0x31ba=['getDataValue','BOOLEAN','exports','STRING','name','join'];(function(_0x2bff5c,_0x3c1ebb){var _0x1e391b=function(_0x20239b){while(--_0x20239b){_0x2bff5c['push'](_0x2bff5c['shift']());}};_0x1e391b(++_0x3c1ebb);}(_0x31ba,0x158));var _0xa31b=function(_0x5427c6,_0x1240a1){_0x5427c6=_0x5427c6-0x0;var _0x5144ff=_0x31ba[_0x5427c6];return _0x5144ff;};'use strict';var Sequelize=require('sequelize');module[_0xa31b('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xa31b('0x1')],'unique':_0xa31b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xa31b('0x1')],'set':function(_0xa45ad1){this['setDataValue']('options',_0xa45ad1?_0xa45ad1[_0xa31b('0x3')](''):[]);},'get':function(){return this[_0xa31b('0x4')]('options')?this[_0xa31b('0x4')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0xa31b('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0xa31b('0x1')]},'record':{'type':Sequelize[_0xa31b('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xa31b('0x1')]},'description':{'type':Sequelize[_0xa31b('0x1')]}};
\ No newline at end of file
index c7f96d4..0fd05cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35a9=['attributes','fields','query','length','nolimit','order','sort','pick','merge','where','map','type','VIRTUAL','filter','includeAll','include','VoiceChanSpy','findAll','catch','show','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','rawAttributes','key','model','keys','filters','intersection'];(function(_0x1d906c,_0x3a6c23){var _0x4600ff=function(_0x259890){while(--_0x259890){_0x1d906c['push'](_0x1d906c['shift']());}};_0x4600ff(++_0x3a6c23);}(_0x35a9,0x73));var _0x935a=function(_0x55fa2f,_0x215e30){_0x55fa2f=_0x55fa2f-0x0;var _0x538f59=_0x35a9[_0x55fa2f];return _0x538f59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x935a('0x0'));var zipdir=require(_0x935a('0x1'));var jsonpatch=require(_0x935a('0x2'));var rp=require(_0x935a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x935a('0x4'));var util=require('util');var path=require(_0x935a('0x5'));var sox=require(_0x935a('0x6'));var csv=require(_0x935a('0x7'));var ejs=require(_0x935a('0x8'));var fs=require('fs');var fs_extra=require(_0x935a('0x9'));var _=require(_0x935a('0xa'));var squel=require(_0x935a('0xb'));var crypto=require(_0x935a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x935a('0xd'));var toCsv=require(_0x935a('0x7'));var querystring=require(_0x935a('0xe'));var Papa=require(_0x935a('0xf'));var Redis=require(_0x935a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x935a('0x11'));var as=require(_0x935a('0x12'));var hardwareService=require(_0x935a('0x13'));var logger=require('../../config/logger')(_0x935a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x935a('0x15'));var db=require(_0x935a('0x16'))['db'];function respondWithStatusCode(_0x1e5152,_0x441f98){_0x441f98=_0x441f98||0xcc;return function(_0x3ed7e0){if(_0x3ed7e0){return _0x1e5152[_0x935a('0x17')](_0x441f98);}return _0x1e5152[_0x935a('0x18')](_0x441f98)[_0x935a('0x19')]();};}function respondWithResult(_0x5e1131,_0x109a98){_0x109a98=_0x109a98||0xc8;return function(_0x304c38){if(_0x304c38){return _0x5e1131[_0x935a('0x18')](_0x109a98)[_0x935a('0x1a')](_0x304c38);}};}function respondWithFilteredResult(_0xeebc0c,_0x22ab95){return function(_0xf881d6){if(_0xf881d6){var _0x463db1=typeof _0x22ab95[_0x935a('0x1b')]===_0x935a('0x1c')&&typeof _0x22ab95['limit']===_0x935a('0x1c');var _0x2aab94=_0xf881d6[_0x935a('0x1d')];var _0x446232=_0x463db1?0x0:_0x22ab95[_0x935a('0x1b')];var _0x3bac3e=_0x463db1?_0xf881d6[_0x935a('0x1d')]:_0x22ab95['offset']+_0x22ab95[_0x935a('0x1e')];var _0x90ef4;if(_0x3bac3e>=_0x2aab94){_0x3bac3e=_0x2aab94;_0x90ef4=0xc8;}else{_0x90ef4=0xce;}_0xeebc0c[_0x935a('0x18')](_0x90ef4);return _0xeebc0c[_0x935a('0x1f')]('Content-Range',_0x446232+'-'+_0x3bac3e+'/'+_0x2aab94)[_0x935a('0x1a')](_0xf881d6);}return null;};}function patchUpdates(_0x2c6873){return function(_0x53267b){try{jsonpatch[_0x935a('0x20')](_0x53267b,_0x2c6873,!![]);}catch(_0x257eb9){return BPromise[_0x935a('0x21')](_0x257eb9);}return _0x53267b[_0x935a('0x22')]();};}function saveUpdates(_0xe04139,_0x490627){return function(_0x267c48){if(_0x267c48){return _0x267c48[_0x935a('0x23')](_0xe04139)[_0x935a('0x24')](function(_0x4dd7aa){return _0x4dd7aa;});}return null;};}function removeEntity(_0x13e62a,_0x413787){return function(_0x326246){if(_0x326246){return _0x326246[_0x935a('0x25')]()['then'](function(){var _0x540f4e=_0x326246[_0x935a('0x26')]({'plain':!![]});var _0x46b6b8='ChanSpies';return db[_0x935a('0x27')][_0x935a('0x25')]({'where':{'type':_0x46b6b8,'resourceId':_0x540f4e['id']}})[_0x935a('0x24')](function(){return _0x326246;});})[_0x935a('0x24')](function(){_0x13e62a[_0x935a('0x18')](0xcc)[_0x935a('0x19')]();});}};}function handleEntityNotFound(_0x194a2a,_0x752f15){return function(_0x385ca2){if(!_0x385ca2){_0x194a2a[_0x935a('0x17')](0x194);}return _0x385ca2;};}function handleError(_0x31562c,_0x422d1c){_0x422d1c=_0x422d1c||0x1f4;return function(_0x595b1c){logger[_0x935a('0x28')](_0x595b1c[_0x935a('0x29')]);if(_0x595b1c[_0x935a('0x2a')]){delete _0x595b1c['name'];}_0x31562c[_0x935a('0x18')](_0x422d1c)[_0x935a('0x2b')](_0x595b1c);};}exports[_0x935a('0x2c')]=function(_0x1bb4e4,_0x48c9b5){var _0x1ab791={},_0x9c7f8d={},_0x16f0d8={'count':0x0,'rows':[]};var _0x2850fc=_['map'](db['VoiceChanSpy'][_0x935a('0x2d')],function(_0x226bb4){return{'name':_0x226bb4['fieldName'],'type':_0x226bb4['type'][_0x935a('0x2e')]};});_0x9c7f8d[_0x935a('0x2f')]=_['map'](_0x2850fc,_0x935a('0x2a'));_0x9c7f8d['query']=_[_0x935a('0x30')](_0x1bb4e4['query']);_0x9c7f8d[_0x935a('0x31')]=_[_0x935a('0x32')](_0x9c7f8d['model'],_0x9c7f8d['query']);_0x1ab791[_0x935a('0x33')]=_[_0x935a('0x32')](_0x9c7f8d[_0x935a('0x2f')],qs[_0x935a('0x34')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x34')]));_0x1ab791[_0x935a('0x33')]=_0x1ab791[_0x935a('0x33')][_0x935a('0x36')]?_0x1ab791[_0x935a('0x33')]:_0x9c7f8d['model'];if(!_0x1bb4e4['query']['hasOwnProperty'](_0x935a('0x37'))){_0x1ab791[_0x935a('0x1e')]=qs[_0x935a('0x1e')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x1e')]);_0x1ab791[_0x935a('0x1b')]=qs['offset'](_0x1bb4e4[_0x935a('0x35')]['offset']);}_0x1ab791[_0x935a('0x38')]=qs[_0x935a('0x39')](_0x1bb4e4[_0x935a('0x35')][_0x935a('0x39')]);_0x1ab791['where']=qs[_0x935a('0x31')](_[_0x935a('0x3a')](_0x1bb4e4[_0x935a('0x35')],_0x9c7f8d[_0x935a('0x31')]),_0x2850fc);if(_0x1bb4e4[_0x935a('0x35')]['filter']){_0x1ab791['where']=_[_0x935a('0x3b')](_0x1ab791[_0x935a('0x3c')],{'$or':_[_0x935a('0x3d')](_0x2850fc,function(_0x43a566){if(_0x43a566[_0x935a('0x3e')]!==_0x935a('0x3f')){var _0x1a245e={};_0x1a245e[_0x43a566[_0x935a('0x2a')]]={'$like':'%'+_0x1bb4e4[_0x935a('0x35')][_0x935a('0x40')]+'%'};return _0x1a245e;}})});}_0x1ab791=_[_0x935a('0x3b')]({},_0x1ab791,_0x1bb4e4['options']);var _0x2a48ef={'where':_0x1ab791['where']};return db['VoiceChanSpy'][_0x935a('0x1d')](_0x2a48ef)['then'](function(_0x3f5653){_0x16f0d8[_0x935a('0x1d')]=_0x3f5653;if(_0x1bb4e4[_0x935a('0x35')][_0x935a('0x41')]){_0x1ab791[_0x935a('0x42')]=[{'all':!![]}];}return db[_0x935a('0x43')][_0x935a('0x44')](_0x1ab791);})['then'](function(_0x2d734d){_0x16f0d8['rows']=_0x2d734d;return _0x16f0d8;})[_0x935a('0x24')](respondWithFilteredResult(_0x48c9b5,_0x1ab791))[_0x935a('0x45')](handleError(_0x48c9b5,null));};exports[_0x935a('0x46')]=function(_0x1bee32,_0x196c4f){var _0x8ba2a9={'raw':![],'where':{'id':_0x1bee32[_0x935a('0x47')]['id']}},_0x4c3a61={};_0x4c3a61['model']=_[_0x935a('0x30')](db['VoiceChanSpy'][_0x935a('0x2d')]);_0x4c3a61[_0x935a('0x35')]=_['keys'](_0x1bee32[_0x935a('0x35')]);_0x4c3a61[_0x935a('0x31')]=_[_0x935a('0x32')](_0x4c3a61[_0x935a('0x2f')],_0x4c3a61[_0x935a('0x35')]);_0x8ba2a9[_0x935a('0x33')]=_['intersection'](_0x4c3a61['model'],qs[_0x935a('0x34')](_0x1bee32['query'][_0x935a('0x34')]));_0x8ba2a9[_0x935a('0x33')]=_0x8ba2a9[_0x935a('0x33')][_0x935a('0x36')]?_0x8ba2a9[_0x935a('0x33')]:_0x4c3a61[_0x935a('0x2f')];if(_0x1bee32[_0x935a('0x35')][_0x935a('0x41')]){_0x8ba2a9['include']=[{'all':!![]}];}_0x8ba2a9=_[_0x935a('0x3b')]({},_0x8ba2a9,_0x1bee32[_0x935a('0x48')]);return db[_0x935a('0x43')][_0x935a('0x49')](_0x8ba2a9)[_0x935a('0x24')](handleEntityNotFound(_0x196c4f,null))[_0x935a('0x24')](respondWithResult(_0x196c4f,null))[_0x935a('0x45')](handleError(_0x196c4f,null));};exports[_0x935a('0x4a')]=function(_0x479124,_0x23e85f){return db['VoiceChanSpy']['create'](_0x479124['body'],{})[_0x935a('0x24')](function(_0x384de0){var _0x1be4e2=_0x479124[_0x935a('0x4b')]['get']({'plain':!![]});if(!_0x1be4e2)throw new Error(_0x935a('0x4c'));if(_0x1be4e2['role']==='user'){var _0x41c5dc=_0x384de0[_0x935a('0x26')]({'plain':!![]});var _0x2d309e=_0x935a('0x4d');return db[_0x935a('0x4e')][_0x935a('0x49')]({'where':{'name':_0x2d309e,'userProfileId':_0x1be4e2[_0x935a('0x4f')]},'raw':!![]})['then'](function(_0x2d48e3){if(_0x2d48e3&&_0x2d48e3[_0x935a('0x50')]===0x0){return db['UserProfileResource'][_0x935a('0x4a')]({'name':_0x41c5dc['name'],'resourceId':_0x41c5dc['id'],'type':_0x2d48e3['name'],'sectionId':_0x2d48e3['id']},{})['then'](function(){return _0x384de0;});}else{return _0x384de0;}})[_0x935a('0x45')](function(_0x2ce8fe){logger['error'](_0x935a('0x51'),_0x2ce8fe);throw _0x2ce8fe;});}return _0x384de0;})[_0x935a('0x24')](respondWithResult(_0x23e85f,0xc9))[_0x935a('0x45')](handleError(_0x23e85f,null));};exports[_0x935a('0x23')]=function(_0xde20f9,_0x22552a){if(_0xde20f9[_0x935a('0x52')]['id']){delete _0xde20f9[_0x935a('0x52')]['id'];}return db[_0x935a('0x43')][_0x935a('0x49')]({'where':{'id':_0xde20f9[_0x935a('0x47')]['id']}})['then'](handleEntityNotFound(_0x22552a,null))[_0x935a('0x24')](saveUpdates(_0xde20f9[_0x935a('0x52')],null))[_0x935a('0x24')](respondWithResult(_0x22552a,null))[_0x935a('0x45')](handleError(_0x22552a,null));};exports[_0x935a('0x25')]=function(_0x5874b6,_0x5601d1){return db[_0x935a('0x43')]['find']({'where':{'id':_0x5874b6[_0x935a('0x47')]['id']}})[_0x935a('0x24')](handleEntityNotFound(_0x5601d1,null))['then'](removeEntity(_0x5601d1,null))[_0x935a('0x45')](handleError(_0x5601d1,null));};
\ No newline at end of file
+var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','ChanSpies','UserProfileResource','destroy','stack','name','index','map','VoiceChanSpy','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x54945e,_0x42f71a){var _0x36eabd=function(_0x178ecf){while(--_0x178ecf){_0x54945e['push'](_0x54945e['shift']());}};_0x36eabd(++_0x42f71a);}(_0x524a,0xf5));var _0xa524=function(_0x5a7238,_0x2a45f0){_0x5a7238=_0x5a7238-0x0;var _0x49c9aa=_0x524a[_0x5a7238];return _0x49c9aa;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['VoiceChanSpy'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['VoiceChanSpy'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));};
\ No newline at end of file
index 0134e3a..f4ae24f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd643=['User','findAll','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd643,0xc5));var _0x3d64=function(_0x5759c0,_0x1f0dcc){_0x5759c0=_0x5759c0-0x0;var _0x5b5059=_0xd643[_0x5759c0];return _0x5b5059;};'use strict';var _=require(_0x3d64('0x0'));var util=require(_0x3d64('0x1'));var BPromise=require(_0x3d64('0x2'));var attributes=require(_0x3d64('0x3'));var getUserApplications=function(_0x6c77f6,_0x362947,_0x453f78){var _0xb2d45d=0x1;var _0x5ac7ae=[];var _0x1ea145={'context':_0x362947[_0x3d64('0x4')]||'from-sip','exten':util['format'](_0x3d64('0x5'),_0x6c77f6[_0x3d64('0x6')],_0x453f78),'type':'system','isApp':![],'ChanSpyId':_0x6c77f6['id'],'UserId':_0x362947['id']};_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':_0x3d64('0x9'),'appdata':util[_0x3d64('0xa')](_0x3d64('0xb'),_0x3d64('0xc')),'priority':_0xb2d45d++},_0x1ea145));if(_0x6c77f6['record']){_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':_0x3d64('0xd'),'appdata':util[_0x3d64('0xa')](_0x3d64('0xe'),_0x6c77f6['recordingFormat']),'priority':_0xb2d45d++},_0x1ea145));}if(_0x6c77f6['auth']){_0x5ac7ae['push'](_[_0x3d64('0x8')]({'app':_0x3d64('0xf'),'appdata':_0x6c77f6[_0x3d64('0x10')],'priority':_0xb2d45d++},_0x1ea145));}_0x5ac7ae['push'](_[_0x3d64('0x8')]({'app':_0x3d64('0x11'),'appdata':util[_0x3d64('0xa')](_0x3d64('0x12'),_0x362947[_0x3d64('0x13')],_0x6c77f6[_0x3d64('0x14')]?_0x6c77f6[_0x3d64('0x14')][_0x3d64('0x15')](''):''),'priority':_0xb2d45d++},_0x1ea145));if(_0x6c77f6['record']){_0x5ac7ae[_0x3d64('0x7')](_[_0x3d64('0x8')]({'app':'StopMixMonitor','priority':_0xb2d45d++},_0x1ea145));}return _0x5ac7ae;};var getChanSpyApplications=function(_0x1ff18d,_0x56af87){var _0x1786b1=[];for(var _0x3c759f=0x0,_0x538e64=0x1;_0x3c759f<_0x56af87[_0x3d64('0x16')];_0x3c759f++,_0x538e64=0x1){_0x1786b1=_0x1786b1[_0x3d64('0x17')](getUserApplications(_0x1ff18d,_0x56af87[_0x3c759f],_0x56af87[_0x3c759f][_0x3d64('0x18')]));if(_0x56af87[_0x3c759f][_0x3d64('0x18')]!=_0x56af87[_0x3c759f][_0x3d64('0x13')]){_0x1786b1=_0x1786b1[_0x3d64('0x17')](getUserApplications(_0x1ff18d,_0x56af87[_0x3c759f],_0x56af87[_0x3c759f][_0x3d64('0x13')]));}}return _0x1786b1;};var getChanSpyPromise=function(_0x15d3fb,_0x4cc3fd){return new BPromise(function(_0x6ec185,_0xedaea5){return _0x15d3fb[_0x3d64('0x19')][_0x3d64('0x1a')]({'attributes':['id',_0x3d64('0x13'),_0x3d64('0x18')],'where':{'role':_0x3d64('0x1b'),'chanspy':!![]},'raw':!![]})[_0x3d64('0x1c')](function(_0x5af598){if(_0x5af598){return _0x6ec185(getChanSpyApplications(_0x4cc3fd,_0x5af598));}return _0x6ec185([]);})[_0x3d64('0x1d')](function(_0x3cd984){_0xedaea5(_0x3cd984);});});};module[_0x3d64('0x1e')]=function(_0x19a734,_0x330219){var _0x315914=_0x19a734[_0x3d64('0x1f')];return _0x19a734['define'](_0x3d64('0x20'),attributes,{'tableName':_0x3d64('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa91cd6,_0x95cc75,_0x5cecbe){return getChanSpyPromise(_0x315914,_0xa91cd6)[_0x3d64('0x1c')](function(_0x1cb181){if(_0x1cb181&&_0x1cb181[_0x3d64('0x16')]){return _0x315914[_0x3d64('0x22')][_0x3d64('0x23')](_0x1cb181);}})['then'](function(){_0x5cecbe();})[_0x3d64('0x1d')](function(_0x528dbc){_0x5cecbe(_0x528dbc);});},'afterUpdate':function(_0x4f5f15,_0x4cf04e,_0xf194b7){return _0x315914[_0x3d64('0x22')]['destroy']({'where':{'ChanSpyId':_0x4f5f15['id']}})[_0x3d64('0x1c')](function(){return getChanSpyPromise(_0x315914,_0x4f5f15);})[_0x3d64('0x1c')](function(_0x35861d){if(_0x35861d&&_0x35861d['length']){return _0x315914[_0x3d64('0x22')]['bulkCreate'](_0x35861d);}})[_0x3d64('0x1c')](function(){_0xf194b7();})['catch'](function(_0x3ce031){_0xf194b7(_0x3ce031);});},'afterDestroy':function(_0x1975af,_0x429d18,_0x47edd6){return _0x315914[_0x3d64('0x22')][_0x3d64('0x24')]({'where':{'ChanSpyId':_0x1975af['id']}})[_0x3d64('0x1c')](function(){_0x47edd6();})['catch'](function(_0x1b7c9c){_0x47edd6(_0x1b7c9c);});}}});};
\ No newline at end of file
+var _0xc27c=['VoiceExtension','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','Set','record','merge','${UNIQUEID}.%s,a','recordingFormat','Authenticate','SIP/%s,%s','name','options','StopMixMonitor','length','internal','concat','User','then','catch','exports','models','define','VoiceChanSpy','bulkCreate','destroy'];(function(_0x502036,_0x502686){var _0x485247=function(_0x135ee3){while(--_0x135ee3){_0x502036['push'](_0x502036['shift']());}};_0x485247(++_0x502686);}(_0xc27c,0x161));var _0xcc27=function(_0x107520,_0x457f64){_0x107520=_0x107520-0x0;var _0x3b05b0=_0xc27c[_0x107520];return _0x3b05b0;};'use strict';var _=require(_0xcc27('0x0'));var util=require(_0xcc27('0x1'));var BPromise=require('bluebird');var attributes=require(_0xcc27('0x2'));var getUserApplications=function(_0x354267,_0x24d7ad,_0x2432ae){var _0x313e22=0x1;var _0x5bfba4=[];var _0x18fcb1={'context':_0x24d7ad[_0xcc27('0x3')]||_0xcc27('0x4'),'exten':util[_0xcc27('0x5')]('%s%s',_0x354267[_0xcc27('0x6')],_0x2432ae),'type':_0xcc27('0x7'),'isApp':![],'ChanSpyId':_0x354267['id'],'UserId':_0x24d7ad['id']};_0x5bfba4[_0xcc27('0x8')](_['merge']({'app':_0xcc27('0x9'),'appdata':util[_0xcc27('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x313e22++},_0x18fcb1));if(_0x354267[_0xcc27('0xa')]){_0x5bfba4['push'](_[_0xcc27('0xb')]({'app':'MixMonitor','appdata':util[_0xcc27('0x5')](_0xcc27('0xc'),_0x354267[_0xcc27('0xd')]),'priority':_0x313e22++},_0x18fcb1));}if(_0x354267['auth']){_0x5bfba4[_0xcc27('0x8')](_[_0xcc27('0xb')]({'app':_0xcc27('0xe'),'appdata':_0x354267['password'],'priority':_0x313e22++},_0x18fcb1));}_0x5bfba4['push'](_[_0xcc27('0xb')]({'app':'ChanSpy','appdata':util[_0xcc27('0x5')](_0xcc27('0xf'),_0x24d7ad[_0xcc27('0x10')],_0x354267[_0xcc27('0x11')]?_0x354267['options']['join'](''):''),'priority':_0x313e22++},_0x18fcb1));if(_0x354267[_0xcc27('0xa')]){_0x5bfba4['push'](_[_0xcc27('0xb')]({'app':_0xcc27('0x12'),'priority':_0x313e22++},_0x18fcb1));}return _0x5bfba4;};var getChanSpyApplications=function(_0x1dd96a,_0x495bab){var _0x15d6d9=[];for(var _0x465659=0x0,_0x1460d1=0x1;_0x465659<_0x495bab[_0xcc27('0x13')];_0x465659++,_0x1460d1=0x1){_0x15d6d9=_0x15d6d9['concat'](getUserApplications(_0x1dd96a,_0x495bab[_0x465659],_0x495bab[_0x465659]['internal']));if(_0x495bab[_0x465659][_0xcc27('0x14')]!=_0x495bab[_0x465659]['name']){_0x15d6d9=_0x15d6d9[_0xcc27('0x15')](getUserApplications(_0x1dd96a,_0x495bab[_0x465659],_0x495bab[_0x465659]['name']));}}return _0x15d6d9;};var getChanSpyPromise=function(_0x316709,_0x5ab29c){return new BPromise(function(_0x112bc2,_0x1fb527){return _0x316709[_0xcc27('0x16')]['findAll']({'attributes':['id',_0xcc27('0x10'),_0xcc27('0x14')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xcc27('0x17')](function(_0x18e2b2){if(_0x18e2b2){return _0x112bc2(getChanSpyApplications(_0x5ab29c,_0x18e2b2));}return _0x112bc2([]);})[_0xcc27('0x18')](function(_0x5ee8fd){_0x1fb527(_0x5ee8fd);});});};module[_0xcc27('0x19')]=function(_0x1df1cc,_0x1cc48d){var _0x187606=_0x1df1cc[_0xcc27('0x1a')];return _0x1df1cc[_0xcc27('0x1b')](_0xcc27('0x1c'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2542c8,_0x701e9e,_0x3cd9c9){return getChanSpyPromise(_0x187606,_0x2542c8)[_0xcc27('0x17')](function(_0x5b79df){if(_0x5b79df&&_0x5b79df[_0xcc27('0x13')]){return _0x187606['VoiceExtension'][_0xcc27('0x1d')](_0x5b79df);}})[_0xcc27('0x17')](function(){_0x3cd9c9();})[_0xcc27('0x18')](function(_0x5bfddc){_0x3cd9c9(_0x5bfddc);});},'afterUpdate':function(_0x19061e,_0x38371f,_0x459431){return _0x187606['VoiceExtension'][_0xcc27('0x1e')]({'where':{'ChanSpyId':_0x19061e['id']}})[_0xcc27('0x17')](function(){return getChanSpyPromise(_0x187606,_0x19061e);})[_0xcc27('0x17')](function(_0x39d5ac){if(_0x39d5ac&&_0x39d5ac['length']){return _0x187606[_0xcc27('0x1f')][_0xcc27('0x1d')](_0x39d5ac);}})[_0xcc27('0x17')](function(){_0x459431();})[_0xcc27('0x18')](function(_0x2e5d31){_0x459431(_0x2e5d31);});},'afterDestroy':function(_0x3109d4,_0x4bcaca,_0x5468ba){return _0x187606[_0xcc27('0x1f')][_0xcc27('0x1e')]({'where':{'ChanSpyId':_0x3109d4['id']}})[_0xcc27('0x17')](function(){_0x5468ba();})[_0xcc27('0x18')](function(_0x1387d8){_0x5468ba(_0x1387d8);});}}});};
\ No newline at end of file
index 1344359..ea9b387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1306=['client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe8125,_0x56a3ad){var _0x468559=function(_0x46a6ac){while(--_0x46a6ac){_0xe8125['push'](_0xe8125['shift']());}};_0x468559(++_0x56a3ad);}(_0x1306,0x17a));var _0x6130=function(_0x388020,_0x417f93){_0x388020=_0x388020-0x0;var _0x4ccfac=_0x1306[_0x388020];return _0x4ccfac;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var moment=require(_0x6130('0x2'));var BPromise=require(_0x6130('0x3'));var rs=require(_0x6130('0x4'));var fs=require('fs');var Redis=require(_0x6130('0x5'));var db=require(_0x6130('0x6'))['db'];var utils=require(_0x6130('0x7'));var logger=require(_0x6130('0x8'))(_0x6130('0x9'));var config=require(_0x6130('0xa'));var jayson=require(_0x6130('0xb'));var client=jayson[_0x6130('0xc')][_0x6130('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1db089,_0x25469a,_0x354501){return new BPromise(function(_0x288b1d,_0x13163f){return client[_0x6130('0xe')](_0x1db089,_0x354501)[_0x6130('0xf')](function(_0x33b116){logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));logger[_0x6130('0x13')](_0x6130('0x14'),_0x25469a,_0x6130('0x12'),JSON[_0x6130('0x15')](_0x33b116));if(_0x33b116['error']){if(_0x33b116[_0x6130('0x16')]['code']===0x1f4){logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116['error'][_0x6130('0x17')]);return _0x13163f(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}logger[_0x6130('0x16')](_0x6130('0x11'),_0x25469a,_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);return _0x288b1d(_0x33b116[_0x6130('0x16')][_0x6130('0x17')]);}else{logger[_0x6130('0x10')](_0x6130('0x11'),_0x25469a,_0x6130('0x12'));_0x288b1d(_0x33b116[_0x6130('0x18')][_0x6130('0x17')]);}})[_0x6130('0x19')](function(_0x46c2e3){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x25469a,_0x46c2e3);_0x13163f(_0x46c2e3);});});}
\ No newline at end of file
+var _0xd139=['../../config/logger','rpc','../../config/environment','client','http','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x420561,_0x42a7eb){var _0x48bd76=function(_0x2ab171){while(--_0x2ab171){_0x420561['push'](_0x420561['shift']());}};_0x48bd76(++_0x42a7eb);}(_0xd139,0x14e));var _0x9d13=function(_0x105d7b,_0x2051a3){_0x105d7b=_0x105d7b-0x0;var _0x45d235=_0xd139[_0x105d7b];return _0x45d235;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});}
\ No newline at end of file
index f03cac0..eb144c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c1e=['get','isAuthenticated','index','show','put','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x39ab31,_0x147110){var _0x5d13c7=function(_0x5dff37){while(--_0x5dff37){_0x39ab31['push'](_0x39ab31['shift']());}};_0x5d13c7(++_0x147110);}(_0x4c1e,0x177));var _0xe4c1=function(_0x10fb8c,_0x3b6f74){_0x10fb8c=_0x10fb8c-0x0;var _0x1ecd6e=_0x4c1e[_0x10fb8c];return _0x1ecd6e;};'use strict';var multer=require('multer');var util=require(_0xe4c1('0x0'));var path=require('path');var timeout=require(_0xe4c1('0x1'));var express=require(_0xe4c1('0x2'));var router=express[_0xe4c1('0x3')]();var fs_extra=require(_0xe4c1('0x4'));var auth=require(_0xe4c1('0x5'));var interaction=require(_0xe4c1('0x6'));var config=require(_0xe4c1('0x7'));var controller=require(_0xe4c1('0x8'));router[_0xe4c1('0x9')]('/',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xb')]);router[_0xe4c1('0x9')]('/:id',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xc')]);router['post']('/',auth[_0xe4c1('0xa')](),controller['create']);router[_0xe4c1('0xd')]('/:id',auth[_0xe4c1('0xa')](),controller[_0xe4c1('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xe4c1('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x21dd=['update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','put','/:id'];(function(_0x55212d,_0x18c820){var _0x5a4bec=function(_0x31027b){while(--_0x31027b){_0x55212d['push'](_0x55212d['shift']());}};_0x5a4bec(++_0x18c820);}(_0x21dd,0x1e9));var _0xd21d=function(_0x566774,_0x535311){_0x566774=_0x566774-0x0;var _0x57be38=_0x21dd[_0x566774];return _0x57be38;};'use strict';var multer=require(_0xd21d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd21d('0x1'));var express=require(_0xd21d('0x2'));var router=express[_0xd21d('0x3')]();var fs_extra=require(_0xd21d('0x4'));var auth=require(_0xd21d('0x5'));var interaction=require(_0xd21d('0x6'));var config=require(_0xd21d('0x7'));var controller=require(_0xd21d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd21d('0x9')]('/:id',auth[_0xd21d('0xa')](),controller[_0xd21d('0xb')]);router[_0xd21d('0xc')]('/',auth[_0xd21d('0xa')](),controller['create']);router[_0xd21d('0xd')](_0xd21d('0xe'),auth[_0xd21d('0xa')](),controller[_0xd21d('0xf')]);router['delete'](_0xd21d('0xe'),auth[_0xd21d('0xa')](),controller[_0xd21d('0x10')]);module[_0xd21d('0x11')]=router;
\ No newline at end of file
index d41d8d7..1b7f5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb965=['BOOLEAN','sequelize','exports','STRING'];(function(_0xfd6c7e,_0x441bbd){var _0x2082a2=function(_0x2cb753){while(--_0x2cb753){_0xfd6c7e['push'](_0xfd6c7e['shift']());}};_0x2082a2(++_0x441bbd);}(_0xb965,0x9d));var _0x5b96=function(_0x24bcd8,_0x54f8d6){_0x24bcd8=_0x24bcd8-0x0;var _0x2cabab=_0xb965[_0x24bcd8];return _0x2cabab;};'use strict';var Sequelize=require(_0x5b96('0x0'));module[_0x5b96('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x5b96('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x5b96('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa06e=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0xa06e,0xc2));var _0xea06=function(_0x5bfee6,_0x3e9443){_0x5bfee6=_0x5bfee6-0x0;var _0x4aad05=_0xa06e[_0x5bfee6];return _0x4aad05;};'use strict';var Sequelize=require(_0xea06('0x0'));module[_0xea06('0x1')]={'name':{'type':Sequelize[_0xea06('0x2')],'unique':_0xea06('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xea06('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 59445a2..383be68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a98=['filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','find','create','readFileSync','join','root','utf8','writeFileSync','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','server/files/templates/context.ejs','render','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4123c6,_0x29e2f3){var _0x4c28bb=function(_0x218d4f){while(--_0x218d4f){_0x4123c6['push'](_0x4123c6['shift']());}};_0x4c28bb(++_0x29e2f3);}(_0x7a98,0x1bb));var _0x87a9=function(_0x3c73e5,_0x198b7b){_0x3c73e5=_0x3c73e5-0x0;var _0x223370=_0x7a98[_0x3c73e5];return _0x223370;};'use strict';var emlformat=require(_0x87a9('0x0'));var rimraf=require(_0x87a9('0x1'));var zipdir=require(_0x87a9('0x2'));var jsonpatch=require(_0x87a9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87a9('0x4'));var util=require(_0x87a9('0x5'));var path=require(_0x87a9('0x6'));var sox=require(_0x87a9('0x7'));var csv=require(_0x87a9('0x8'));var ejs=require(_0x87a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87a9('0xa'));var squel=require('squel');var crypto=require(_0x87a9('0xb'));var jsforce=require(_0x87a9('0xc'));var deskjs=require(_0x87a9('0xd'));var toCsv=require(_0x87a9('0x8'));var querystring=require(_0x87a9('0xe'));var Papa=require(_0x87a9('0xf'));var Redis=require('ioredis');var authService=require(_0x87a9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87a9('0x11'));var hardwareService=require(_0x87a9('0x12'));var logger=require(_0x87a9('0x13'))(_0x87a9('0x14'));var utils=require('../../config/utils');var config=require(_0x87a9('0x15'));var licenseUtil=require(_0x87a9('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x87a9('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x38534a,_0x4d133e,_0x2145de,_0x297e48){return new BPromise(function(_0x1c7aba,_0x2e91bf){var _0x339867=_0x297e48||client;return _0x339867[_0x87a9('0x18')](_0x38534a,_0x2145de)[_0x87a9('0x19')](function(_0x4a02cc){logger[_0x87a9('0x1a')](_0x87a9('0x1b'),_0x4d133e,'request\x20sent');logger[_0x87a9('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x4d133e,_0x87a9('0x1d'),JSON[_0x87a9('0x1e')](_0x4a02cc));if(_0x4a02cc[_0x87a9('0x1f')]){if(_0x4a02cc['error'][_0x87a9('0x20')]===0x1f4){logger[_0x87a9('0x1f')](_0x87a9('0x1b'),_0x4d133e,_0x4a02cc['error']['message']);return _0x2e91bf(_0x4a02cc[_0x87a9('0x1f')][_0x87a9('0x21')]);}logger[_0x87a9('0x1f')](_0x87a9('0x1b'),_0x4d133e,_0x4a02cc['error']['message']);return _0x1c7aba(_0x4a02cc[_0x87a9('0x1f')][_0x87a9('0x21')]);}else{logger[_0x87a9('0x1a')](_0x87a9('0x1b'),_0x4d133e,'request\x20sent');_0x1c7aba(_0x4a02cc[_0x87a9('0x22')]['message']);}})[_0x87a9('0x23')](function(_0xfade35){logger['error'](_0x87a9('0x1b'),_0x4d133e,_0xfade35);_0x2e91bf(_0xfade35);});});}function respondWithStatusCode(_0x566e52,_0x21353c){_0x21353c=_0x21353c||0xcc;return function(_0x263cd8){if(_0x263cd8){return _0x566e52[_0x87a9('0x24')](_0x21353c);}return _0x566e52[_0x87a9('0x25')](_0x21353c)[_0x87a9('0x26')]();};}function respondWithResult(_0x34ee79,_0x4aeaf8){_0x4aeaf8=_0x4aeaf8||0xc8;return function(_0x4a90bd){if(_0x4a90bd){return _0x34ee79[_0x87a9('0x25')](_0x4aeaf8)['json'](_0x4a90bd);}};}function respondWithFilteredResult(_0x250153,_0xb90f39){return function(_0x2aca7f){if(_0x2aca7f){var _0x571c5b=typeof _0xb90f39[_0x87a9('0x27')]===_0x87a9('0x28')&&typeof _0xb90f39[_0x87a9('0x29')]===_0x87a9('0x28');var _0x384f0e=_0x2aca7f[_0x87a9('0x2a')];var _0x3594e0=_0x571c5b?0x0:_0xb90f39['offset'];var _0x1e9d0b=_0x571c5b?_0x2aca7f['count']:_0xb90f39['offset']+_0xb90f39['limit'];var _0xec9784;if(_0x1e9d0b>=_0x384f0e){_0x1e9d0b=_0x384f0e;_0xec9784=0xc8;}else{_0xec9784=0xce;}_0x250153[_0x87a9('0x25')](_0xec9784);return _0x250153['set'](_0x87a9('0x2b'),_0x3594e0+'-'+_0x1e9d0b+'/'+_0x384f0e)[_0x87a9('0x2c')](_0x2aca7f);}return null;};}function patchUpdates(_0x578022){return function(_0x5ef4cd){try{jsonpatch[_0x87a9('0x2d')](_0x5ef4cd,_0x578022,!![]);}catch(_0x2077f3){return BPromise['reject'](_0x2077f3);}return _0x5ef4cd[_0x87a9('0x2e')]();};}function saveUpdates(_0x344a35,_0x4d65bd){return function(_0x5746af){if(_0x5746af){return _0x5746af[_0x87a9('0x2f')](_0x344a35)['then'](function(_0x515b9f){return _0x515b9f;});}return null;};}function removeEntity(_0x49c9c5,_0x41ee8d){return function(_0xf39539){if(_0xf39539){return _0xf39539[_0x87a9('0x30')]()[_0x87a9('0x19')](function(){var _0x5ac255=_0xf39539[_0x87a9('0x31')]({'plain':!![]});var _0x47f0d0=_0x87a9('0x32');return db[_0x87a9('0x33')]['destroy']({'where':{'type':_0x47f0d0,'resourceId':_0x5ac255['id']}})['then'](function(){return _0xf39539;});})[_0x87a9('0x19')](function(){_0x49c9c5[_0x87a9('0x25')](0xcc)[_0x87a9('0x26')]();});}};}function handleEntityNotFound(_0x13af7b,_0x52cf3b){return function(_0x2af3ed){if(!_0x2af3ed){_0x13af7b[_0x87a9('0x24')](0x194);}return _0x2af3ed;};}function handleError(_0x502553,_0x4bdcfc){_0x4bdcfc=_0x4bdcfc||0x1f4;return function(_0x56d3ec){logger[_0x87a9('0x1f')](_0x56d3ec[_0x87a9('0x34')]);if(_0x56d3ec[_0x87a9('0x35')]){delete _0x56d3ec[_0x87a9('0x35')];}_0x502553['status'](_0x4bdcfc)[_0x87a9('0x36')](_0x56d3ec);};}exports[_0x87a9('0x37')]=function(_0x4e91d6,_0x2e9268){var _0x6377cb={},_0x5b74c6={},_0x3f7db3={'count':0x0,'rows':[]};var _0x2ef464=_[_0x87a9('0x38')](db[_0x87a9('0x39')][_0x87a9('0x3a')],function(_0x73664b){return{'name':_0x73664b[_0x87a9('0x3b')],'type':_0x73664b[_0x87a9('0x3c')][_0x87a9('0x3d')]};});_0x5b74c6[_0x87a9('0x3e')]=_[_0x87a9('0x38')](_0x2ef464,'name');_0x5b74c6[_0x87a9('0x3f')]=_['keys'](_0x4e91d6[_0x87a9('0x3f')]);_0x5b74c6['filters']=_[_0x87a9('0x40')](_0x5b74c6[_0x87a9('0x3e')],_0x5b74c6[_0x87a9('0x3f')]);_0x6377cb['attributes']=_[_0x87a9('0x40')](_0x5b74c6[_0x87a9('0x3e')],qs[_0x87a9('0x41')](_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x41')]));_0x6377cb['attributes']=_0x6377cb[_0x87a9('0x42')][_0x87a9('0x43')]?_0x6377cb[_0x87a9('0x42')]:_0x5b74c6['model'];if(!_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x44')](_0x87a9('0x45'))){_0x6377cb[_0x87a9('0x29')]=qs[_0x87a9('0x29')](_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x29')]);_0x6377cb['offset']=qs[_0x87a9('0x27')](_0x4e91d6[_0x87a9('0x3f')]['offset']);}_0x6377cb[_0x87a9('0x46')]=qs[_0x87a9('0x47')](_0x4e91d6['query']['sort']);_0x6377cb['where']=qs[_0x87a9('0x48')](_['pick'](_0x4e91d6['query'],_0x5b74c6[_0x87a9('0x48')]),_0x2ef464);if(_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x49')]){_0x6377cb[_0x87a9('0x4a')]=_[_0x87a9('0x4b')](_0x6377cb[_0x87a9('0x4a')],{'$or':_[_0x87a9('0x38')](_0x2ef464,function(_0x523706){if(_0x523706[_0x87a9('0x3c')]!==_0x87a9('0x4c')){var _0x56593b={};_0x56593b[_0x523706[_0x87a9('0x35')]]={'$like':'%'+_0x4e91d6[_0x87a9('0x3f')][_0x87a9('0x49')]+'%'};return _0x56593b;}})});}_0x6377cb=_[_0x87a9('0x4b')]({},_0x6377cb,_0x4e91d6[_0x87a9('0x4d')]);var _0x552429={'where':_0x6377cb[_0x87a9('0x4a')]};return db['VoiceContext'][_0x87a9('0x2a')](_0x552429)['then'](function(_0x5e7bbf){_0x3f7db3[_0x87a9('0x2a')]=_0x5e7bbf;if(_0x4e91d6['query']['includeAll']){_0x6377cb[_0x87a9('0x4e')]=[{'all':!![]}];}return db[_0x87a9('0x39')][_0x87a9('0x4f')](_0x6377cb);})['then'](function(_0x2483f1){_0x3f7db3[_0x87a9('0x50')]=_0x2483f1;return _0x3f7db3;})[_0x87a9('0x19')](respondWithFilteredResult(_0x2e9268,_0x6377cb))[_0x87a9('0x23')](handleError(_0x2e9268,null));};exports['show']=function(_0x91aaea,_0x22ce80){var _0x5510f1={'raw':![],'where':{'id':_0x91aaea[_0x87a9('0x51')]['id']}},_0x171568={};_0x171568[_0x87a9('0x3e')]=_['keys'](db['VoiceContext']['rawAttributes']);_0x171568[_0x87a9('0x3f')]=_['keys'](_0x91aaea['query']);_0x171568[_0x87a9('0x48')]=_[_0x87a9('0x40')](_0x171568['model'],_0x171568[_0x87a9('0x3f')]);_0x5510f1[_0x87a9('0x42')]=_[_0x87a9('0x40')](_0x171568[_0x87a9('0x3e')],qs[_0x87a9('0x41')](_0x91aaea['query'][_0x87a9('0x41')]));_0x5510f1['attributes']=_0x5510f1[_0x87a9('0x42')][_0x87a9('0x43')]?_0x5510f1['attributes']:_0x171568[_0x87a9('0x3e')];if(_0x91aaea[_0x87a9('0x3f')][_0x87a9('0x52')]){_0x5510f1[_0x87a9('0x4e')]=[{'all':!![]}];}_0x5510f1=_[_0x87a9('0x4b')]({},_0x5510f1,_0x91aaea[_0x87a9('0x4d')]);return db[_0x87a9('0x39')][_0x87a9('0x53')](_0x5510f1)[_0x87a9('0x19')](handleEntityNotFound(_0x22ce80,null))[_0x87a9('0x19')](respondWithResult(_0x22ce80,null))[_0x87a9('0x23')](handleError(_0x22ce80,null));};exports[_0x87a9('0x54')]=function(_0x3d2eeb,_0x198941,_0x495746){var _0xb56fb1;return db['VoiceContext'][_0x87a9('0x54')](_0x3d2eeb['body'],{'raw':!![]})[_0x87a9('0x19')](function(_0x176112){_0xb56fb1=_0x176112;return db[_0x87a9('0x39')][_0x87a9('0x4f')]({'raw':!![]});})[_0x87a9('0x19')](function(_0x289f24){var _0x17b43f=fs[_0x87a9('0x55')](path[_0x87a9('0x56')](config[_0x87a9('0x57')],'server/files/templates/context.ejs'),_0x87a9('0x58'));var _0x40c64c=ejs['render'](_0x17b43f,{'contexts':_0x289f24||[]});fs[_0x87a9('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x40c64c);})[_0x87a9('0x19')](function(){return respondWithRpcPromise(_0x87a9('0x5a'),_0x87a9('0x54'),{'module':'chan_sip.so'});})[_0x87a9('0x19')](function(){var _0x41ed56=_0x3d2eeb[_0x87a9('0x5b')][_0x87a9('0x31')]({'plain':!![]});if(!_0x41ed56)throw new Error(_0x87a9('0x5c'));if(_0x41ed56[_0x87a9('0x5d')]===_0x87a9('0x5b')){var _0x3661a0=_0xb56fb1[_0x87a9('0x31')]({'plain':!![]});return db[_0x87a9('0x5e')][_0x87a9('0x53')]({'where':{'name':_0x87a9('0x32'),'userProfileId':_0x41ed56[_0x87a9('0x5f')]},'raw':!![]})['then'](function(_0x3c9a08){if(_0x3c9a08&&_0x3c9a08[_0x87a9('0x60')]===0x0){return db[_0x87a9('0x33')][_0x87a9('0x54')]({'name':_0x3661a0[_0x87a9('0x35')],'resourceId':_0x3661a0['id'],'type':_0x3c9a08[_0x87a9('0x35')],'sectionId':_0x3c9a08['id']},{})[_0x87a9('0x19')](function(){return _0xb56fb1;});}else{return _0xb56fb1;}})[_0x87a9('0x23')](function(_0xfde269){logger['error'](_0x87a9('0x61'),_0xfde269);throw _0xfde269;});}return _0xb56fb1;})[_0x87a9('0x19')](respondWithResult(_0x198941,0xc9))[_0x87a9('0x23')](handleError(_0x198941,null));};exports[_0x87a9('0x2f')]=function(_0x371934,_0x97a1d5,_0x3ccc29){var _0x1218f9;return db[_0x87a9('0x39')]['find']({'where':{'id':_0x371934[_0x87a9('0x51')]['id']}})[_0x87a9('0x19')](handleEntityNotFound(_0x97a1d5,null))[_0x87a9('0x19')](saveUpdates(_0x371934[_0x87a9('0x62')],null))[_0x87a9('0x19')](function(_0x16d114){if(_0x16d114){_0x1218f9=_0x16d114;return db[_0x87a9('0x39')][_0x87a9('0x4f')]({'raw':!![]});}})[_0x87a9('0x19')](function(_0x1a2093){var _0xcb3d83=fs['readFileSync'](path[_0x87a9('0x56')](config[_0x87a9('0x57')],_0x87a9('0x63')),'utf8');var _0x15fda9=ejs[_0x87a9('0x64')](_0xcb3d83,{'contexts':_0x1a2093||[]});fs[_0x87a9('0x59')](_0x87a9('0x65'),_0x15fda9);})[_0x87a9('0x19')](function(){return respondWithRpcPromise(_0x87a9('0x5a'),'update',{'module':_0x87a9('0x66')});})[_0x87a9('0x19')](function(){return _0x1218f9;})[_0x87a9('0x19')](respondWithResult(_0x97a1d5,null))['catch'](handleError(_0x97a1d5,null));};exports[_0x87a9('0x30')]=function(_0x2d405f,_0x1234ef,_0x10d73e){var _0x30d41c;return db[_0x87a9('0x39')][_0x87a9('0x53')]({'where':{'id':_0x2d405f[_0x87a9('0x51')]['id']}})[_0x87a9('0x19')](handleEntityNotFound(_0x1234ef,null))['then'](removeEntity(_0x1234ef,null))[_0x87a9('0x19')](function(){return db[_0x87a9('0x39')]['findAll']({'raw':!![]});})[_0x87a9('0x19')](function(_0x4627be){var _0x1a4e65=fs[_0x87a9('0x55')](path[_0x87a9('0x56')](config[_0x87a9('0x57')],'server/files/templates/context.ejs'),'utf8');var _0x5c2394=ejs['render'](_0x1a4e65,{'contexts':_0x4627be});fs[_0x87a9('0x59')](_0x87a9('0x65'),_0x5c2394);return respondWithRpcPromise(_0x87a9('0x5a'),_0x87a9('0x30'),{'module':'chan_sip.so'});})[_0x87a9('0x23')](handleError(_0x1234ef,null));};
\ No newline at end of file
+var _0x1784=['UserProfileResource','stack','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','count','includeAll','findAll','rows','show','params','include','find','catch','create','body','root','server/files/templates/context.ejs','utf8','render','writeFileSync','user','role','UserProfileSection','userProfileId','update','readFileSync','join','Reload','chan_sip.so','/etc/asterisk/extensions_xcally_contexts.conf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','VoiceContext,\x20%s,\x20%s','message','info','result','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','destroy','get','Contexts'];(function(_0x26a80d,_0x341470){var _0x55ae5f=function(_0x37cf97){while(--_0x37cf97){_0x26a80d['push'](_0x26a80d['shift']());}};_0x55ae5f(++_0x341470);}(_0x1784,0x16c));var _0x4178=function(_0x498381,_0x122bfc){_0x498381=_0x498381-0x0;var _0x7e0ae8=_0x1784[_0x498381];return _0x7e0ae8;};'use strict';var emlformat=require(_0x4178('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4178('0x1'));var moment=require(_0x4178('0x2'));var BPromise=require(_0x4178('0x3'));var Mustache=require(_0x4178('0x4'));var util=require(_0x4178('0x5'));var path=require(_0x4178('0x6'));var sox=require(_0x4178('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4178('0x8'));var _=require(_0x4178('0x9'));var squel=require(_0x4178('0xa'));var crypto=require(_0x4178('0xb'));var jsforce=require(_0x4178('0xc'));var deskjs=require(_0x4178('0xd'));var toCsv=require(_0x4178('0xe'));var querystring=require(_0x4178('0xf'));var Papa=require(_0x4178('0x10'));var Redis=require(_0x4178('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4178('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4178('0x13'));var logger=require('../../config/logger')(_0x4178('0x14'));var utils=require(_0x4178('0x15'));var config=require(_0x4178('0x16'));var licenseUtil=require(_0x4178('0x17'));var db=require(_0x4178('0x18'))['db'];var jayson=require(_0x4178('0x19'));var client=jayson[_0x4178('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a9a6,_0x5e529c,_0x12156a,_0x57a429){return new BPromise(function(_0x1da15a,_0x3e21b9){var _0x25c9ec=_0x57a429||client;return _0x25c9ec[_0x4178('0x1b')](_0x10a9a6,_0x12156a)[_0x4178('0x1c')](function(_0x5dee3f){logger['info']('VoiceContext,\x20%s,\x20%s',_0x5e529c,'request\x20sent');logger[_0x4178('0x1d')](_0x4178('0x1e'),_0x5e529c,_0x4178('0x1f'),JSON['stringify'](_0x5dee3f));if(_0x5dee3f['error']){if(_0x5dee3f['error'][_0x4178('0x20')]===0x1f4){logger[_0x4178('0x21')](_0x4178('0x22'),_0x5e529c,_0x5dee3f[_0x4178('0x21')][_0x4178('0x23')]);return _0x3e21b9(_0x5dee3f[_0x4178('0x21')][_0x4178('0x23')]);}logger[_0x4178('0x21')](_0x4178('0x22'),_0x5e529c,_0x5dee3f[_0x4178('0x21')]['message']);return _0x1da15a(_0x5dee3f[_0x4178('0x21')][_0x4178('0x23')]);}else{logger[_0x4178('0x24')](_0x4178('0x22'),_0x5e529c,_0x4178('0x1f'));_0x1da15a(_0x5dee3f[_0x4178('0x25')]['message']);}})['catch'](function(_0x2b7820){logger[_0x4178('0x21')]('VoiceContext,\x20%s,\x20%s',_0x5e529c,_0x2b7820);_0x3e21b9(_0x2b7820);});});}function respondWithStatusCode(_0x46e5bf,_0x307136){_0x307136=_0x307136||0xcc;return function(_0x21a2c3){if(_0x21a2c3){return _0x46e5bf[_0x4178('0x26')](_0x307136);}return _0x46e5bf['status'](_0x307136)[_0x4178('0x27')]();};}function respondWithResult(_0xe3e268,_0x1ae791){_0x1ae791=_0x1ae791||0xc8;return function(_0x1d94a0){if(_0x1d94a0){return _0xe3e268[_0x4178('0x28')](_0x1ae791)[_0x4178('0x29')](_0x1d94a0);}};}function respondWithFilteredResult(_0xe11ca2,_0x34afc2){return function(_0x3cc683){if(_0x3cc683){var _0x5d3139=typeof _0x34afc2[_0x4178('0x2a')]===_0x4178('0x2b')&&typeof _0x34afc2['limit']===_0x4178('0x2b');var _0x53ad0a=_0x3cc683['count'];var _0x115c7b=_0x5d3139?0x0:_0x34afc2[_0x4178('0x2a')];var _0x404aa6=_0x5d3139?_0x3cc683['count']:_0x34afc2[_0x4178('0x2a')]+_0x34afc2[_0x4178('0x2c')];var _0x12833b;if(_0x404aa6>=_0x53ad0a){_0x404aa6=_0x53ad0a;_0x12833b=0xc8;}else{_0x12833b=0xce;}_0xe11ca2[_0x4178('0x28')](_0x12833b);return _0xe11ca2[_0x4178('0x2d')](_0x4178('0x2e'),_0x115c7b+'-'+_0x404aa6+'/'+_0x53ad0a)[_0x4178('0x29')](_0x3cc683);}return null;};}function patchUpdates(_0x340448){return function(_0x4652b0){try{jsonpatch[_0x4178('0x2f')](_0x4652b0,_0x340448,!![]);}catch(_0x248ce5){return BPromise[_0x4178('0x30')](_0x248ce5);}return _0x4652b0['save']();};}function saveUpdates(_0x1d2746,_0x3fe9a8){return function(_0x294b72){if(_0x294b72){return _0x294b72['update'](_0x1d2746)[_0x4178('0x1c')](function(_0x5c9b18){return _0x5c9b18;});}return null;};}function removeEntity(_0x21a00d,_0x44434b){return function(_0x81146d){if(_0x81146d){return _0x81146d[_0x4178('0x31')]()[_0x4178('0x1c')](function(){var _0x3d3997=_0x81146d[_0x4178('0x32')]({'plain':!![]});var _0xed9758=_0x4178('0x33');return db[_0x4178('0x34')][_0x4178('0x31')]({'where':{'type':_0xed9758,'resourceId':_0x3d3997['id']}})[_0x4178('0x1c')](function(){return _0x81146d;});})[_0x4178('0x1c')](function(){_0x21a00d[_0x4178('0x28')](0xcc)[_0x4178('0x27')]();});}};}function handleEntityNotFound(_0x575296,_0x4de2fb){return function(_0x33647d){if(!_0x33647d){_0x575296[_0x4178('0x26')](0x194);}return _0x33647d;};}function handleError(_0xe9a228,_0x488d58){_0x488d58=_0x488d58||0x1f4;return function(_0x373b7e){logger[_0x4178('0x21')](_0x373b7e[_0x4178('0x35')]);if(_0x373b7e['name']){delete _0x373b7e['name'];}_0xe9a228['status'](_0x488d58)[_0x4178('0x36')](_0x373b7e);};}exports[_0x4178('0x37')]=function(_0x137ec7,_0x45253d){var _0x2b9218={},_0xae31d6={},_0x5b6ac0={'count':0x0,'rows':[]};var _0x44a31b=_[_0x4178('0x38')](db[_0x4178('0x39')][_0x4178('0x3a')],function(_0x54d780){return{'name':_0x54d780[_0x4178('0x3b')],'type':_0x54d780[_0x4178('0x3c')]['key']};});_0xae31d6[_0x4178('0x3d')]=_[_0x4178('0x38')](_0x44a31b,'name');_0xae31d6['query']=_[_0x4178('0x3e')](_0x137ec7[_0x4178('0x3f')]);_0xae31d6[_0x4178('0x40')]=_['intersection'](_0xae31d6['model'],_0xae31d6['query']);_0x2b9218['attributes']=_[_0x4178('0x41')](_0xae31d6[_0x4178('0x3d')],qs[_0x4178('0x42')](_0x137ec7[_0x4178('0x3f')][_0x4178('0x42')]));_0x2b9218['attributes']=_0x2b9218[_0x4178('0x43')][_0x4178('0x44')]?_0x2b9218[_0x4178('0x43')]:_0xae31d6[_0x4178('0x3d')];if(!_0x137ec7[_0x4178('0x3f')]['hasOwnProperty'](_0x4178('0x45'))){_0x2b9218[_0x4178('0x2c')]=qs['limit'](_0x137ec7[_0x4178('0x3f')]['limit']);_0x2b9218[_0x4178('0x2a')]=qs[_0x4178('0x2a')](_0x137ec7[_0x4178('0x3f')]['offset']);}_0x2b9218[_0x4178('0x46')]=qs[_0x4178('0x47')](_0x137ec7['query'][_0x4178('0x47')]);_0x2b9218[_0x4178('0x48')]=qs[_0x4178('0x40')](_[_0x4178('0x49')](_0x137ec7[_0x4178('0x3f')],_0xae31d6['filters']),_0x44a31b);if(_0x137ec7[_0x4178('0x3f')][_0x4178('0x4a')]){_0x2b9218[_0x4178('0x48')]=_[_0x4178('0x4b')](_0x2b9218[_0x4178('0x48')],{'$or':_[_0x4178('0x38')](_0x44a31b,function(_0x344726){if(_0x344726[_0x4178('0x3c')]!==_0x4178('0x4c')){var _0x3f0ce2={};_0x3f0ce2[_0x344726[_0x4178('0x4d')]]={'$like':'%'+_0x137ec7[_0x4178('0x3f')]['filter']+'%'};return _0x3f0ce2;}})});}_0x2b9218=_['merge']({},_0x2b9218,_0x137ec7['options']);var _0x577cf3={'where':_0x2b9218['where']};return db[_0x4178('0x39')][_0x4178('0x4e')](_0x577cf3)['then'](function(_0x14bdcd){_0x5b6ac0[_0x4178('0x4e')]=_0x14bdcd;if(_0x137ec7[_0x4178('0x3f')][_0x4178('0x4f')]){_0x2b9218['include']=[{'all':!![]}];}return db[_0x4178('0x39')][_0x4178('0x50')](_0x2b9218);})[_0x4178('0x1c')](function(_0x4fe59e){_0x5b6ac0[_0x4178('0x51')]=_0x4fe59e;return _0x5b6ac0;})[_0x4178('0x1c')](respondWithFilteredResult(_0x45253d,_0x2b9218))['catch'](handleError(_0x45253d,null));};exports[_0x4178('0x52')]=function(_0x3b0f77,_0x4c0f46){var _0x544122={'raw':![],'where':{'id':_0x3b0f77[_0x4178('0x53')]['id']}},_0x427bf7={};_0x427bf7[_0x4178('0x3d')]=_['keys'](db[_0x4178('0x39')][_0x4178('0x3a')]);_0x427bf7[_0x4178('0x3f')]=_[_0x4178('0x3e')](_0x3b0f77[_0x4178('0x3f')]);_0x427bf7[_0x4178('0x40')]=_[_0x4178('0x41')](_0x427bf7['model'],_0x427bf7[_0x4178('0x3f')]);_0x544122[_0x4178('0x43')]=_[_0x4178('0x41')](_0x427bf7[_0x4178('0x3d')],qs[_0x4178('0x42')](_0x3b0f77[_0x4178('0x3f')][_0x4178('0x42')]));_0x544122[_0x4178('0x43')]=_0x544122['attributes'][_0x4178('0x44')]?_0x544122[_0x4178('0x43')]:_0x427bf7[_0x4178('0x3d')];if(_0x3b0f77['query']['includeAll']){_0x544122[_0x4178('0x54')]=[{'all':!![]}];}_0x544122=_[_0x4178('0x4b')]({},_0x544122,_0x3b0f77['options']);return db[_0x4178('0x39')][_0x4178('0x55')](_0x544122)['then'](handleEntityNotFound(_0x4c0f46,null))[_0x4178('0x1c')](respondWithResult(_0x4c0f46,null))[_0x4178('0x56')](handleError(_0x4c0f46,null));};exports[_0x4178('0x57')]=function(_0x29d14b,_0xd2710d,_0x1b56a9){var _0x284406;return db[_0x4178('0x39')]['create'](_0x29d14b[_0x4178('0x58')],{'raw':!![]})[_0x4178('0x1c')](function(_0x6ce248){_0x284406=_0x6ce248;return db[_0x4178('0x39')][_0x4178('0x50')]({'raw':!![]});})['then'](function(_0x4aff98){var _0x212f6a=fs['readFileSync'](path['join'](config[_0x4178('0x59')],_0x4178('0x5a')),_0x4178('0x5b'));var _0x18a947=ejs[_0x4178('0x5c')](_0x212f6a,{'contexts':_0x4aff98||[]});fs[_0x4178('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x18a947);})[_0x4178('0x1c')](function(){return respondWithRpcPromise('Reload',_0x4178('0x57'),{'module':'chan_sip.so'});})[_0x4178('0x1c')](function(){var _0x28ce94=_0x29d14b[_0x4178('0x5e')][_0x4178('0x32')]({'plain':!![]});if(!_0x28ce94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28ce94[_0x4178('0x5f')]===_0x4178('0x5e')){var _0x30b05b=_0x284406[_0x4178('0x32')]({'plain':!![]});return db[_0x4178('0x60')][_0x4178('0x55')]({'where':{'name':_0x4178('0x33'),'userProfileId':_0x28ce94[_0x4178('0x61')]},'raw':!![]})[_0x4178('0x1c')](function(_0x4215f5){if(_0x4215f5&&_0x4215f5['autoAssociation']===0x0){return db['UserProfileResource'][_0x4178('0x57')]({'name':_0x30b05b[_0x4178('0x4d')],'resourceId':_0x30b05b['id'],'type':_0x4215f5['name'],'sectionId':_0x4215f5['id']},{})[_0x4178('0x1c')](function(){return _0x284406;});}else{return _0x284406;}})[_0x4178('0x56')](function(_0x399faf){logger[_0x4178('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x399faf);throw _0x399faf;});}return _0x284406;})[_0x4178('0x1c')](respondWithResult(_0xd2710d,0xc9))[_0x4178('0x56')](handleError(_0xd2710d,null));};exports[_0x4178('0x62')]=function(_0x239d9f,_0x510cde,_0x3cc1f9){var _0x214986;return db[_0x4178('0x39')][_0x4178('0x55')]({'where':{'id':_0x239d9f['params']['id']}})[_0x4178('0x1c')](handleEntityNotFound(_0x510cde,null))[_0x4178('0x1c')](saveUpdates(_0x239d9f[_0x4178('0x58')],null))[_0x4178('0x1c')](function(_0x4a7534){if(_0x4a7534){_0x214986=_0x4a7534;return db[_0x4178('0x39')][_0x4178('0x50')]({'raw':!![]});}})[_0x4178('0x1c')](function(_0x1f4885){var _0x1bad60=fs[_0x4178('0x63')](path[_0x4178('0x64')](config[_0x4178('0x59')],'server/files/templates/context.ejs'),_0x4178('0x5b'));var _0x7caba=ejs['render'](_0x1bad60,{'contexts':_0x1f4885||[]});fs[_0x4178('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x7caba);})[_0x4178('0x1c')](function(){return respondWithRpcPromise(_0x4178('0x65'),_0x4178('0x62'),{'module':_0x4178('0x66')});})[_0x4178('0x1c')](function(){return _0x214986;})['then'](respondWithResult(_0x510cde,null))[_0x4178('0x56')](handleError(_0x510cde,null));};exports[_0x4178('0x31')]=function(_0x109b24,_0x57559f,_0x44ec5b){var _0x1cdb55;return db[_0x4178('0x39')][_0x4178('0x55')]({'where':{'id':_0x109b24[_0x4178('0x53')]['id']}})[_0x4178('0x1c')](handleEntityNotFound(_0x57559f,null))[_0x4178('0x1c')](removeEntity(_0x57559f,null))[_0x4178('0x1c')](function(){return db[_0x4178('0x39')][_0x4178('0x50')]({'raw':!![]});})[_0x4178('0x1c')](function(_0x55903f){var _0x4d0b84=fs[_0x4178('0x63')](path[_0x4178('0x64')](config[_0x4178('0x59')],_0x4178('0x5a')),'utf8');var _0x1af53d=ejs[_0x4178('0x5c')](_0x4d0b84,{'contexts':_0x55903f});fs['writeFileSync'](_0x4178('0x67'),_0x1af53d);return respondWithRpcPromise(_0x4178('0x65'),'destroy',{'module':_0x4178('0x66')});})['catch'](handleError(_0x57559f,null));};
\ No newline at end of file
index 06ca385..fbab516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3301=['path','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','request-promise'];(function(_0x16916b,_0x520c80){var _0x12fd40=function(_0x3eedf6){while(--_0x3eedf6){_0x16916b['push'](_0x16916b['shift']());}};_0x12fd40(++_0x520c80);}(_0x3301,0x69));var _0x1330=function(_0xfaaad,_0x4c46e6){_0xfaaad=_0xfaaad-0x0;var _0x59136e=_0x3301[_0xfaaad];return _0x59136e;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var logger=require(_0x1330('0x2'))('api');var moment=require(_0x1330('0x3'));var BPromise=require('bluebird');var rp=require(_0x1330('0x4'));var fs=require('fs');var path=require(_0x1330('0x5'));var rimraf=require('rimraf');var config=require(_0x1330('0x6'));var attributes=require('./voiceContext.attributes');module[_0x1330('0x7')]=function(_0x18ec8a,_0x299e03){return _0x18ec8a[_0x1330('0x8')](_0x1330('0x9'),attributes,{'tableName':_0x1330('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1b9=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x34df9a,_0x14e0db){var _0x33b4e7=function(_0x39fc6e){while(--_0x39fc6e){_0x34df9a['push'](_0x34df9a['shift']());}};_0x33b4e7(++_0x14e0db);}(_0xb1b9,0x186));var _0x9b1b=function(_0x151ed7,_0x471294){_0x151ed7=_0x151ed7-0x0;var _0x1cc9b6=_0xb1b9[_0x151ed7];return _0x1cc9b6;};'use strict';var _=require('lodash');var util=require(_0x9b1b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9b1b('0x1'));var BPromise=require(_0x9b1b('0x2'));var rp=require(_0x9b1b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b1b('0x4'));var config=require(_0x9b1b('0x5'));var attributes=require(_0x9b1b('0x6'));module[_0x9b1b('0x7')]=function(_0x37ff75,_0x473696){return _0x37ff75[_0x9b1b('0x8')](_0x9b1b('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bd51c64..691b745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8201=['bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','catch','lodash'];(function(_0x20d6b8,_0xf4c277){var _0x8f4d1e=function(_0x3571fc){while(--_0x3571fc){_0x20d6b8['push'](_0x20d6b8['shift']());}};_0x8f4d1e(++_0xf4c277);}(_0x8201,0x71));var _0x1820=function(_0x100f96,_0x188546){_0x100f96=_0x100f96-0x0;var _0x509e66=_0x8201[_0x100f96];return _0x509e66;};'use strict';var _=require(_0x1820('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1820('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1820('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1820('0x3'));var logger=require(_0x1820('0x4'))('rpc');var config=require(_0x1820('0x5'));var jayson=require(_0x1820('0x6'));var client=jayson[_0x1820('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4297b3,_0x1ee24d,_0x5d33c6){return new BPromise(function(_0x26cd56,_0x395dea){return client[_0x1820('0x8')](_0x4297b3,_0x5d33c6)[_0x1820('0x9')](function(_0x210e2e){logger[_0x1820('0xa')](_0x1820('0xb'),_0x1ee24d,'request\x20sent');logger['debug'](_0x1820('0xc'),_0x1ee24d,_0x1820('0xd'),JSON[_0x1820('0xe')](_0x210e2e));if(_0x210e2e[_0x1820('0xf')]){if(_0x210e2e[_0x1820('0xf')][_0x1820('0x10')]===0x1f4){logger[_0x1820('0xf')]('VoiceContext,\x20%s,\x20%s',_0x1ee24d,_0x210e2e['error']['message']);return _0x395dea(_0x210e2e[_0x1820('0xf')]['message']);}logger[_0x1820('0xf')](_0x1820('0xb'),_0x1ee24d,_0x210e2e[_0x1820('0xf')]['message']);return _0x26cd56(_0x210e2e[_0x1820('0xf')]['message']);}else{logger[_0x1820('0xa')](_0x1820('0xb'),_0x1ee24d,_0x1820('0xd'));_0x26cd56(_0x210e2e[_0x1820('0x11')]['message']);}})[_0x1820('0x12')](function(_0x343387){logger['error'](_0x1820('0xb'),_0x1ee24d,_0x343387);_0x395dea(_0x343387);});});}
\ No newline at end of file
+var _0x9972=['result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x219aab,_0x264694){var _0x7ecb81=function(_0x5e629f){while(--_0x5e629f){_0x219aab['push'](_0x219aab['shift']());}};_0x7ecb81(++_0x264694);}(_0x9972,0xaa));var _0x2997=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9972[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x2997('0x0'));var util=require(_0x2997('0x1'));var moment=require(_0x2997('0x2'));var BPromise=require(_0x2997('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2997('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2997('0x5'));var logger=require('../../config/logger')(_0x2997('0x6'));var config=require(_0x2997('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2997('0x8')][_0x2997('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27d795,_0x581ed1,_0x1820dc){return new BPromise(function(_0x4445bb,_0x1fe2bb){return client[_0x2997('0xa')](_0x27d795,_0x1820dc)[_0x2997('0xb')](function(_0x5d857){logger['info'](_0x2997('0xc'),_0x581ed1,_0x2997('0xd'));logger['debug'](_0x2997('0xe'),_0x581ed1,'request\x20sent',JSON[_0x2997('0xf')](_0x5d857));if(_0x5d857['error']){if(_0x5d857[_0x2997('0x10')][_0x2997('0x11')]===0x1f4){logger[_0x2997('0x10')]('VoiceContext,\x20%s,\x20%s',_0x581ed1,_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);return _0x1fe2bb(_0x5d857['error'][_0x2997('0x12')]);}logger[_0x2997('0x10')](_0x2997('0xc'),_0x581ed1,_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);return _0x4445bb(_0x5d857[_0x2997('0x10')][_0x2997('0x12')]);}else{logger['info'](_0x2997('0xc'),_0x581ed1,_0x2997('0xd'));_0x4445bb(_0x5d857[_0x2997('0x13')]['message']);}})[_0x2997('0x14')](function(_0x2c65d1){logger[_0x2997('0x10')](_0x2997('0xc'),_0x581ed1,_0x2c65d1);_0x1fe2bb(_0x2c65d1);});});}
\ No newline at end of file
index 015c87e..16e3bff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9909=['show','post','create','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9909,0x9e));var _0x9990=function(_0x2a0eb8,_0x48affb){_0x2a0eb8=_0x2a0eb8-0x0;var _0x51f8d9=_0x9909[_0x2a0eb8];return _0x51f8d9;};'use strict';var multer=require('multer');var util=require(_0x9990('0x0'));var path=require(_0x9990('0x1'));var timeout=require('connect-timeout');var express=require(_0x9990('0x2'));var router=express[_0x9990('0x3')]();var fs_extra=require(_0x9990('0x4'));var auth=require(_0x9990('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9990('0x6'));var controller=require(_0x9990('0x7'));router['get']('/',auth[_0x9990('0x8')](),controller[_0x9990('0x9')]);router[_0x9990('0xa')]('/describe',auth[_0x9990('0x8')](),controller[_0x9990('0xb')]);router[_0x9990('0xa')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller[_0x9990('0xd')]);router[_0x9990('0xe')]('/',auth[_0x9990('0x8')](),controller[_0x9990('0xf')]);router[_0x9990('0x10')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller['update']);router[_0x9990('0x11')](_0x9990('0xc'),auth[_0x9990('0x8')](),controller[_0x9990('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xbd06=['isAuthenticated','index','/describe','describe','/:id','create','put','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0x207203,_0x54cc1d){var _0x268e5c=function(_0xa01aee){while(--_0xa01aee){_0x207203['push'](_0x207203['shift']());}};_0x268e5c(++_0x54cc1d);}(_0xbd06,0x78));var _0x6bd0=function(_0x287e87,_0x35b4e2){_0x287e87=_0x287e87-0x0;var _0x1b3253=_0xbd06[_0x287e87];return _0x1b3253;};'use strict';var multer=require(_0x6bd0('0x0'));var util=require(_0x6bd0('0x1'));var path=require(_0x6bd0('0x2'));var timeout=require('connect-timeout');var express=require(_0x6bd0('0x3'));var router=express[_0x6bd0('0x4')]();var fs_extra=require(_0x6bd0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6bd0('0x6'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x6bd0('0x7')]('/',auth[_0x6bd0('0x8')](),controller[_0x6bd0('0x9')]);router[_0x6bd0('0x7')](_0x6bd0('0xa'),auth['isAuthenticated'](),controller[_0x6bd0('0xb')]);router[_0x6bd0('0x7')](_0x6bd0('0xc'),auth[_0x6bd0('0x8')](),controller['show']);router['post']('/',auth[_0x6bd0('0x8')](),controller[_0x6bd0('0xd')]);router[_0x6bd0('0xe')](_0x6bd0('0xc'),auth[_0x6bd0('0x8')](),controller['update']);router['delete'](_0x6bd0('0xc'),auth[_0x6bd0('0x8')](),controller[_0x6bd0('0xf')]);module['exports']=router;
\ No newline at end of file
index e97415d..569479b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x33005d,_0x12837b){var _0x76e4d1=function(_0x38f182){while(--_0x38f182){_0x33005d['push'](_0x33005d['shift']());}};_0x76e4d1(++_0x12837b);}(_0x008c,0x188));var _0xc008=function(_0x5da9e3,_0x3d80cd){_0x5da9e3=_0x5da9e3-0x0;var _0x5a68cd=_0x008c[_0x5da9e3];return _0x5a68cd;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}};
\ No newline at end of file
+var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x201767,_0x148223){var _0xd01cd8=function(_0x595436){while(--_0x595436){_0x201767['push'](_0x201767['shift']());}};_0xd01cd8(++_0x148223);}(_0xa41a,0x6b));var _0xaa41=function(_0x999c6a,_0xd2fd3a){_0x999c6a=_0x999c6a-0x0;var _0x2345db=_0xa41a[_0x999c6a];return _0x2345db;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}};
\ No newline at end of file
index 98f90b3..0daf7a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3569=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x735da9,_0x38b186){var _0x39160b=function(_0x5cb870){while(--_0x5cb870){_0x735da9['push'](_0x735da9['shift']());}};_0x39160b(++_0x38b186);}(_0x3569,0x94));var _0x9356=function(_0x4c825d,_0x10ec2b){_0x4c825d=_0x4c825d-0x0;var _0x43de87=_0x3569[_0x4c825d];return _0x43de87;};'use strict';var emlformat=require(_0x9356('0x0'));var rimraf=require(_0x9356('0x1'));var zipdir=require(_0x9356('0x2'));var jsonpatch=require(_0x9356('0x3'));var rp=require('request-promise');var moment=require(_0x9356('0x4'));var BPromise=require(_0x9356('0x5'));var Mustache=require(_0x9356('0x6'));var util=require(_0x9356('0x7'));var path=require(_0x9356('0x8'));var sox=require(_0x9356('0x9'));var csv=require(_0x9356('0xa'));var ejs=require(_0x9356('0xb'));var fs=require('fs');var fs_extra=require(_0x9356('0xc'));var _=require(_0x9356('0xd'));var squel=require('squel');var crypto=require(_0x9356('0xe'));var jsforce=require(_0x9356('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9356('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9356('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9356('0x11'));var hardwareService=require(_0x9356('0x12'));var logger=require(_0x9356('0x13'))('api');var utils=require(_0x9356('0x14'));var config=require(_0x9356('0x15'));var licenseUtil=require(_0x9356('0x16'));var db=require(_0x9356('0x17'))['db'];function respondWithStatusCode(_0x399660,_0x37c351){_0x37c351=_0x37c351||0xcc;return function(_0x19b95e){if(_0x19b95e){return _0x399660[_0x9356('0x18')](_0x37c351);}return _0x399660[_0x9356('0x19')](_0x37c351)[_0x9356('0x1a')]();};}function respondWithResult(_0x437af5,_0x15e6d3){_0x15e6d3=_0x15e6d3||0xc8;return function(_0x352153){if(_0x352153){return _0x437af5[_0x9356('0x19')](_0x15e6d3)[_0x9356('0x1b')](_0x352153);}};}function respondWithFilteredResult(_0x2b233c,_0x23b5fd){return function(_0x221478){if(_0x221478){var _0x278765=typeof _0x23b5fd[_0x9356('0x1c')]===_0x9356('0x1d')&&typeof _0x23b5fd[_0x9356('0x1e')]===_0x9356('0x1d');var _0x569cb4=_0x221478[_0x9356('0x1f')];var _0x562609=_0x278765?0x0:_0x23b5fd[_0x9356('0x1c')];var _0x402ac9=_0x278765?_0x221478[_0x9356('0x1f')]:_0x23b5fd['offset']+_0x23b5fd['limit'];var _0x46a17f;if(_0x402ac9>=_0x569cb4){_0x402ac9=_0x569cb4;_0x46a17f=0xc8;}else{_0x46a17f=0xce;}_0x2b233c[_0x9356('0x19')](_0x46a17f);return _0x2b233c['set'](_0x9356('0x20'),_0x562609+'-'+_0x402ac9+'/'+_0x569cb4)[_0x9356('0x1b')](_0x221478);}return null;};}function patchUpdates(_0x327e73){return function(_0x5e6365){try{jsonpatch[_0x9356('0x21')](_0x5e6365,_0x327e73,!![]);}catch(_0x3db9ea){return BPromise[_0x9356('0x22')](_0x3db9ea);}return _0x5e6365[_0x9356('0x23')]();};}function saveUpdates(_0x38a5e0,_0x18cc75){return function(_0x49bc30){if(_0x49bc30){return _0x49bc30[_0x9356('0x24')](_0x38a5e0)[_0x9356('0x25')](function(_0x3b1f6d){return _0x3b1f6d;});}return null;};}function removeEntity(_0x3abeaf,_0x372c49){return function(_0x3bfd6d){if(_0x3bfd6d){return _0x3bfd6d['destroy']()[_0x9356('0x25')](function(){_0x3abeaf[_0x9356('0x19')](0xcc)[_0x9356('0x1a')]();});}};}function handleEntityNotFound(_0x9aaf7c,_0x23dbd1){return function(_0x5a172b){if(!_0x5a172b){_0x9aaf7c[_0x9356('0x18')](0x194);}return _0x5a172b;};}function handleError(_0x966626,_0x465071){_0x465071=_0x465071||0x1f4;return function(_0x5541d1){logger[_0x9356('0x26')](_0x5541d1[_0x9356('0x27')]);if(_0x5541d1['name']){delete _0x5541d1[_0x9356('0x28')];}_0x966626[_0x9356('0x19')](_0x465071)[_0x9356('0x29')](_0x5541d1);};}exports[_0x9356('0x2a')]=function(_0x337a59,_0x47449e){var _0x2098ca={},_0x259c1c={},_0x38d567={'count':0x0,'rows':[]};var _0x437e3e=_[_0x9356('0x2b')](db[_0x9356('0x2c')][_0x9356('0x2d')],function(_0x4e3c66){return{'name':_0x4e3c66['fieldName'],'type':_0x4e3c66[_0x9356('0x2e')][_0x9356('0x2f')]};});_0x259c1c[_0x9356('0x30')]=_['map'](_0x437e3e,_0x9356('0x28'));_0x259c1c[_0x9356('0x31')]=_[_0x9356('0x32')](_0x337a59[_0x9356('0x31')]);_0x259c1c[_0x9356('0x33')]=_['intersection'](_0x259c1c[_0x9356('0x30')],_0x259c1c['query']);_0x2098ca[_0x9356('0x34')]=_[_0x9356('0x35')](_0x259c1c['model'],qs['fields'](_0x337a59[_0x9356('0x31')][_0x9356('0x36')]));_0x2098ca[_0x9356('0x34')]=_0x2098ca[_0x9356('0x34')]['length']?_0x2098ca[_0x9356('0x34')]:_0x259c1c[_0x9356('0x30')];if(!_0x337a59[_0x9356('0x31')][_0x9356('0x37')](_0x9356('0x38'))){_0x2098ca['limit']=qs['limit'](_0x337a59[_0x9356('0x31')]['limit']);_0x2098ca[_0x9356('0x1c')]=qs[_0x9356('0x1c')](_0x337a59['query']['offset']);}_0x2098ca[_0x9356('0x39')]=qs[_0x9356('0x3a')](_0x337a59['query'][_0x9356('0x3a')]);_0x2098ca[_0x9356('0x3b')]=qs['filters'](_[_0x9356('0x3c')](_0x337a59[_0x9356('0x31')],_0x259c1c[_0x9356('0x33')]),_0x437e3e);if(_0x337a59['query'][_0x9356('0x3d')]){_0x2098ca['where']=_[_0x9356('0x3e')](_0x2098ca[_0x9356('0x3b')],{'$or':_['map'](_0x437e3e,function(_0xf2cdb8){if(_0xf2cdb8[_0x9356('0x2e')]!==_0x9356('0x3f')){var _0x9b583={};_0x9b583[_0xf2cdb8[_0x9356('0x28')]]={'$like':'%'+_0x337a59[_0x9356('0x31')][_0x9356('0x3d')]+'%'};return _0x9b583;}})});}_0x2098ca=_['merge']({},_0x2098ca,_0x337a59[_0x9356('0x40')]);var _0x54dbb4={'where':_0x2098ca['where']};return db[_0x9356('0x2c')]['count'](_0x54dbb4)[_0x9356('0x25')](function(_0x3959a7){_0x38d567[_0x9356('0x1f')]=_0x3959a7;if(_0x337a59[_0x9356('0x31')][_0x9356('0x41')]){_0x2098ca['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x9356('0x42')](_0x2098ca);})[_0x9356('0x25')](function(_0x1758cd){_0x38d567[_0x9356('0x43')]=_0x1758cd;return _0x38d567;})[_0x9356('0x25')](respondWithFilteredResult(_0x47449e,_0x2098ca))[_0x9356('0x44')](handleError(_0x47449e,null));};exports[_0x9356('0x45')]=function(_0x55b641,_0x5f5a37){var _0x4c6a3c={'raw':!![],'where':{'id':_0x55b641[_0x9356('0x46')]['id']}},_0x32d161={};_0x32d161['model']=_[_0x9356('0x32')](db[_0x9356('0x2c')][_0x9356('0x2d')]);_0x32d161['query']=_['keys'](_0x55b641[_0x9356('0x31')]);_0x32d161['filters']=_['intersection'](_0x32d161[_0x9356('0x30')],_0x32d161['query']);_0x4c6a3c[_0x9356('0x34')]=_['intersection'](_0x32d161[_0x9356('0x30')],qs[_0x9356('0x36')](_0x55b641[_0x9356('0x31')][_0x9356('0x36')]));_0x4c6a3c['attributes']=_0x4c6a3c['attributes']['length']?_0x4c6a3c[_0x9356('0x34')]:_0x32d161['model'];if(_0x55b641['query']['includeAll']){_0x4c6a3c[_0x9356('0x47')]=[{'all':!![]}];}_0x4c6a3c=_[_0x9356('0x3e')]({},_0x4c6a3c,_0x55b641[_0x9356('0x40')]);return db[_0x9356('0x2c')][_0x9356('0x48')](_0x4c6a3c)['then'](handleEntityNotFound(_0x5f5a37,null))[_0x9356('0x25')](respondWithResult(_0x5f5a37,null))[_0x9356('0x44')](handleError(_0x5f5a37,null));};exports[_0x9356('0x49')]=function(_0x22b97d,_0x162f78){return db[_0x9356('0x2c')][_0x9356('0x49')](_0x22b97d['body'],{})[_0x9356('0x25')](respondWithResult(_0x162f78,0xc9))['catch'](handleError(_0x162f78,null));};exports['update']=function(_0x386013,_0x222450){if(_0x386013[_0x9356('0x4a')]['id']){delete _0x386013[_0x9356('0x4a')]['id'];}return db[_0x9356('0x2c')]['find']({'where':{'id':_0x386013[_0x9356('0x46')]['id']}})[_0x9356('0x25')](handleEntityNotFound(_0x222450,null))[_0x9356('0x25')](saveUpdates(_0x386013[_0x9356('0x4a')],null))[_0x9356('0x25')](respondWithResult(_0x222450,null))[_0x9356('0x44')](handleError(_0x222450,null));};exports[_0x9356('0x4b')]=function(_0x23532d,_0x53fece){return db['VoiceDialReport']['find']({'where':{'id':_0x23532d[_0x9356('0x46')]['id']}})[_0x9356('0x25')](handleEntityNotFound(_0x53fece,null))[_0x9356('0x25')](removeEntity(_0x53fece,null))['catch'](handleError(_0x53fece,null));};exports[_0x9356('0x4c')]=function(_0x332cca,_0x27db95){return db[_0x9356('0x2c')]['describe']()['then'](respondWithResult(_0x27db95,null))[_0x9356('0x44')](handleError(_0x27db95,null));};
\ No newline at end of file
+var _0x0e9e=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','keys','filters','attributes','intersection','fields','length','query','hasOwnProperty','nolimit','where','filter','merge','options','includeAll','rows','catch','find','create','body','params','describe','eml-format'];(function(_0x47893a,_0x3c7a44){var _0x3abff4=function(_0xfc8b31){while(--_0xfc8b31){_0x47893a['push'](_0x47893a['shift']());}};_0x3abff4(++_0x3c7a44);}(_0x0e9e,0x167));var _0xe0e9=function(_0x2db425,_0x526d9f){_0x2db425=_0x2db425-0x0;var _0xda4165=_0x0e9e[_0x2db425];return _0xda4165;};'use strict';var emlformat=require(_0xe0e9('0x0'));var rimraf=require(_0xe0e9('0x1'));var zipdir=require(_0xe0e9('0x2'));var jsonpatch=require(_0xe0e9('0x3'));var rp=require(_0xe0e9('0x4'));var moment=require(_0xe0e9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe0e9('0x6'));var util=require('util');var path=require(_0xe0e9('0x7'));var sox=require(_0xe0e9('0x8'));var csv=require('to-csv');var ejs=require(_0xe0e9('0x9'));var fs=require('fs');var fs_extra=require(_0xe0e9('0xa'));var _=require('lodash');var squel=require(_0xe0e9('0xb'));var crypto=require(_0xe0e9('0xc'));var jsforce=require(_0xe0e9('0xd'));var deskjs=require(_0xe0e9('0xe'));var toCsv=require(_0xe0e9('0xf'));var querystring=require(_0xe0e9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe0e9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0e9('0x12'));var hardwareService=require(_0xe0e9('0x13'));var logger=require(_0xe0e9('0x14'))(_0xe0e9('0x15'));var utils=require(_0xe0e9('0x16'));var config=require(_0xe0e9('0x17'));var licenseUtil=require(_0xe0e9('0x18'));var db=require(_0xe0e9('0x19'))['db'];function respondWithStatusCode(_0x4e880c,_0x38532b){_0x38532b=_0x38532b||0xcc;return function(_0x3f8610){if(_0x3f8610){return _0x4e880c[_0xe0e9('0x1a')](_0x38532b);}return _0x4e880c['status'](_0x38532b)[_0xe0e9('0x1b')]();};}function respondWithResult(_0x4f2688,_0x133b11){_0x133b11=_0x133b11||0xc8;return function(_0x22c88e){if(_0x22c88e){return _0x4f2688[_0xe0e9('0x1c')](_0x133b11)[_0xe0e9('0x1d')](_0x22c88e);}};}function respondWithFilteredResult(_0x5e2c7c,_0x107bdd){return function(_0x3649da){if(_0x3649da){var _0x33fd17=typeof _0x107bdd[_0xe0e9('0x1e')]===_0xe0e9('0x1f')&&typeof _0x107bdd[_0xe0e9('0x20')]==='undefined';var _0x23b6ca=_0x3649da[_0xe0e9('0x21')];var _0x1bb793=_0x33fd17?0x0:_0x107bdd['offset'];var _0x463627=_0x33fd17?_0x3649da[_0xe0e9('0x21')]:_0x107bdd[_0xe0e9('0x1e')]+_0x107bdd['limit'];var _0xf65b9;if(_0x463627>=_0x23b6ca){_0x463627=_0x23b6ca;_0xf65b9=0xc8;}else{_0xf65b9=0xce;}_0x5e2c7c['status'](_0xf65b9);return _0x5e2c7c[_0xe0e9('0x22')]('Content-Range',_0x1bb793+'-'+_0x463627+'/'+_0x23b6ca)[_0xe0e9('0x1d')](_0x3649da);}return null;};}function patchUpdates(_0x5834e8){return function(_0x1e487f){try{jsonpatch[_0xe0e9('0x23')](_0x1e487f,_0x5834e8,!![]);}catch(_0x439b18){return BPromise['reject'](_0x439b18);}return _0x1e487f[_0xe0e9('0x24')]();};}function saveUpdates(_0x4df2ee,_0x1d7b27){return function(_0x205102){if(_0x205102){return _0x205102[_0xe0e9('0x25')](_0x4df2ee)[_0xe0e9('0x26')](function(_0x36e879){return _0x36e879;});}return null;};}function removeEntity(_0x4146a3,_0x43afee){return function(_0x24d6a2){if(_0x24d6a2){return _0x24d6a2[_0xe0e9('0x27')]()['then'](function(){_0x4146a3[_0xe0e9('0x1c')](0xcc)[_0xe0e9('0x1b')]();});}};}function handleEntityNotFound(_0x3ab50a,_0x270b31){return function(_0x19dfc1){if(!_0x19dfc1){_0x3ab50a['sendStatus'](0x194);}return _0x19dfc1;};}function handleError(_0x22a513,_0x577b5c){_0x577b5c=_0x577b5c||0x1f4;return function(_0x28dc0e){logger[_0xe0e9('0x28')](_0x28dc0e[_0xe0e9('0x29')]);if(_0x28dc0e[_0xe0e9('0x2a')]){delete _0x28dc0e[_0xe0e9('0x2a')];}_0x22a513[_0xe0e9('0x1c')](_0x577b5c)[_0xe0e9('0x2b')](_0x28dc0e);};}exports[_0xe0e9('0x2c')]=function(_0x2bd935,_0x3c263d){var _0x21188b={},_0x455dce={},_0x5a2e9c={'count':0x0,'rows':[]};var _0x3d692e=_[_0xe0e9('0x2d')](db[_0xe0e9('0x2e')][_0xe0e9('0x2f')],function(_0x3f74cb){return{'name':_0x3f74cb[_0xe0e9('0x30')],'type':_0x3f74cb[_0xe0e9('0x31')]['key']};});_0x455dce[_0xe0e9('0x32')]=_[_0xe0e9('0x2d')](_0x3d692e,_0xe0e9('0x2a'));_0x455dce['query']=_[_0xe0e9('0x33')](_0x2bd935['query']);_0x455dce[_0xe0e9('0x34')]=_['intersection'](_0x455dce[_0xe0e9('0x32')],_0x455dce['query']);_0x21188b[_0xe0e9('0x35')]=_[_0xe0e9('0x36')](_0x455dce[_0xe0e9('0x32')],qs['fields'](_0x2bd935['query'][_0xe0e9('0x37')]));_0x21188b[_0xe0e9('0x35')]=_0x21188b[_0xe0e9('0x35')][_0xe0e9('0x38')]?_0x21188b[_0xe0e9('0x35')]:_0x455dce[_0xe0e9('0x32')];if(!_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x3a')](_0xe0e9('0x3b'))){_0x21188b[_0xe0e9('0x20')]=qs[_0xe0e9('0x20')](_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x20')]);_0x21188b[_0xe0e9('0x1e')]=qs['offset'](_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x1e')]);}_0x21188b['order']=qs['sort'](_0x2bd935[_0xe0e9('0x39')]['sort']);_0x21188b[_0xe0e9('0x3c')]=qs[_0xe0e9('0x34')](_['pick'](_0x2bd935[_0xe0e9('0x39')],_0x455dce[_0xe0e9('0x34')]),_0x3d692e);if(_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x3d')]){_0x21188b[_0xe0e9('0x3c')]=_[_0xe0e9('0x3e')](_0x21188b[_0xe0e9('0x3c')],{'$or':_[_0xe0e9('0x2d')](_0x3d692e,function(_0x2093e5){if(_0x2093e5[_0xe0e9('0x31')]!=='VIRTUAL'){var _0x2f2302={};_0x2f2302[_0x2093e5['name']]={'$like':'%'+_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x3d')]+'%'};return _0x2f2302;}})});}_0x21188b=_[_0xe0e9('0x3e')]({},_0x21188b,_0x2bd935[_0xe0e9('0x3f')]);var _0x22fc02={'where':_0x21188b[_0xe0e9('0x3c')]};return db[_0xe0e9('0x2e')][_0xe0e9('0x21')](_0x22fc02)[_0xe0e9('0x26')](function(_0x4e33a7){_0x5a2e9c['count']=_0x4e33a7;if(_0x2bd935[_0xe0e9('0x39')][_0xe0e9('0x40')]){_0x21188b['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x21188b);})[_0xe0e9('0x26')](function(_0x39bf65){_0x5a2e9c[_0xe0e9('0x41')]=_0x39bf65;return _0x5a2e9c;})[_0xe0e9('0x26')](respondWithFilteredResult(_0x3c263d,_0x21188b))[_0xe0e9('0x42')](handleError(_0x3c263d,null));};exports['show']=function(_0x122406,_0x4d8933){var _0x298831={'raw':!![],'where':{'id':_0x122406['params']['id']}},_0x39f96d={};_0x39f96d[_0xe0e9('0x32')]=_[_0xe0e9('0x33')](db[_0xe0e9('0x2e')][_0xe0e9('0x2f')]);_0x39f96d[_0xe0e9('0x39')]=_[_0xe0e9('0x33')](_0x122406[_0xe0e9('0x39')]);_0x39f96d[_0xe0e9('0x34')]=_[_0xe0e9('0x36')](_0x39f96d[_0xe0e9('0x32')],_0x39f96d['query']);_0x298831[_0xe0e9('0x35')]=_['intersection'](_0x39f96d[_0xe0e9('0x32')],qs[_0xe0e9('0x37')](_0x122406['query'][_0xe0e9('0x37')]));_0x298831[_0xe0e9('0x35')]=_0x298831[_0xe0e9('0x35')][_0xe0e9('0x38')]?_0x298831[_0xe0e9('0x35')]:_0x39f96d['model'];if(_0x122406[_0xe0e9('0x39')][_0xe0e9('0x40')]){_0x298831['include']=[{'all':!![]}];}_0x298831=_[_0xe0e9('0x3e')]({},_0x298831,_0x122406[_0xe0e9('0x3f')]);return db['VoiceDialReport'][_0xe0e9('0x43')](_0x298831)[_0xe0e9('0x26')](handleEntityNotFound(_0x4d8933,null))['then'](respondWithResult(_0x4d8933,null))['catch'](handleError(_0x4d8933,null));};exports[_0xe0e9('0x44')]=function(_0x56a7f7,_0x506a85){return db[_0xe0e9('0x2e')][_0xe0e9('0x44')](_0x56a7f7[_0xe0e9('0x45')],{})[_0xe0e9('0x26')](respondWithResult(_0x506a85,0xc9))[_0xe0e9('0x42')](handleError(_0x506a85,null));};exports[_0xe0e9('0x25')]=function(_0x12fc5f,_0x54fb61){if(_0x12fc5f['body']['id']){delete _0x12fc5f[_0xe0e9('0x45')]['id'];}return db['VoiceDialReport'][_0xe0e9('0x43')]({'where':{'id':_0x12fc5f[_0xe0e9('0x46')]['id']}})[_0xe0e9('0x26')](handleEntityNotFound(_0x54fb61,null))['then'](saveUpdates(_0x12fc5f[_0xe0e9('0x45')],null))['then'](respondWithResult(_0x54fb61,null))[_0xe0e9('0x42')](handleError(_0x54fb61,null));};exports['destroy']=function(_0x2f844f,_0x1dd89b){return db[_0xe0e9('0x2e')][_0xe0e9('0x43')]({'where':{'id':_0x2f844f['params']['id']}})['then'](handleEntityNotFound(_0x1dd89b,null))['then'](removeEntity(_0x1dd89b,null))[_0xe0e9('0x42')](handleError(_0x1dd89b,null));};exports[_0xe0e9('0x47')]=function(_0x2cee2e,_0x2abc30){return db['VoiceDialReport'][_0xe0e9('0x47')]()['then'](respondWithResult(_0x2abc30,null))[_0xe0e9('0x42')](handleError(_0x2abc30,null));};
\ No newline at end of file
index d0c5847..b7bd026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ddc=['report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x459084,_0x2c4333){var _0x36516e=function(_0x2fe9d9){while(--_0x2fe9d9){_0x459084['push'](_0x459084['shift']());}};_0x36516e(++_0x2c4333);}(_0x5ddc,0x13d));var _0xc5dd=function(_0x876cb,_0x2a5122){_0x876cb=_0x876cb-0x0;var _0x5b09bc=_0x5ddc[_0x876cb];return _0x5b09bc;};'use strict';var _=require('lodash');var util=require(_0xc5dd('0x0'));var logger=require(_0xc5dd('0x1'))(_0xc5dd('0x2'));var moment=require(_0xc5dd('0x3'));var BPromise=require(_0xc5dd('0x4'));var rp=require(_0xc5dd('0x5'));var fs=require('fs');var path=require(_0xc5dd('0x6'));var rimraf=require(_0xc5dd('0x7'));var config=require(_0xc5dd('0x8'));var attributes=require(_0xc5dd('0x9'));module[_0xc5dd('0xa')]=function(_0x3d64a8,_0x2bfe44){return _0x3d64a8[_0xc5dd('0xb')](_0xc5dd('0xc'),attributes,{'tableName':_0xc5dd('0xd'),'paranoid':![],'indexes':[{'fields':[_0xc5dd('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ace=['exports','VoiceDialReport','report_dial','uniqueid','util','api','rimraf','../../config/environment'];(function(_0x18528a,_0x4de7d1){var _0x2c3214=function(_0x1b9ff8){while(--_0x1b9ff8){_0x18528a['push'](_0x18528a['shift']());}};_0x2c3214(++_0x4de7d1);}(_0x9ace,0xac));var _0xe9ac=function(_0x424800,_0x173bce){_0x424800=_0x424800-0x0;var _0x13e2f4=_0x9ace[_0x424800];return _0x13e2f4;};'use strict';var _=require('lodash');var util=require(_0xe9ac('0x0'));var logger=require('../../config/logger')(_0xe9ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe9ac('0x2'));var config=require(_0xe9ac('0x3'));var attributes=require('./voiceDialReport.attributes');module[_0xe9ac('0x4')]=function(_0x296b83,_0x59889b){return _0x296b83['define'](_0xe9ac('0x5'),attributes,{'tableName':_0xe9ac('0x6'),'paranoid':![],'indexes':[{'fields':[_0xe9ac('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
index ae605e4..d8df33d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbefc=['info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','stringify','catch','UpdateVoiceDialReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbefc,0x195));var _0xcbef=function(_0x3199ba,_0x42a7a1){_0x3199ba=_0x3199ba-0x0;var _0x37f931=_0xbefc[_0x3199ba];return _0x37f931;};'use strict';var _=require('lodash');var util=require(_0xcbef('0x0'));var moment=require(_0xcbef('0x1'));var BPromise=require(_0xcbef('0x2'));var rs=require(_0xcbef('0x3'));var fs=require('fs');var Redis=require(_0xcbef('0x4'));var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))(_0xcbef('0x8'));var config=require(_0xcbef('0x9'));var jayson=require(_0xcbef('0xa'));var client=jayson[_0xcbef('0xb')][_0xcbef('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17bf41,_0x3137a4,_0x36eae6){return new BPromise(function(_0x3c76cd,_0x10e840){return client[_0xcbef('0xd')](_0x17bf41,_0x36eae6)[_0xcbef('0xe')](function(_0x2e10e4){logger[_0xcbef('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));logger[_0xcbef('0x11')](_0xcbef('0x12'),_0x3137a4,'request\x20sent',JSON['stringify'](_0x2e10e4));if(_0x2e10e4[_0xcbef('0x13')]){if(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x14')]===0x1f4){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x10e840(_0x2e10e4['error'][_0xcbef('0x16')]);}logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);return _0x3c76cd(_0x2e10e4[_0xcbef('0x13')][_0xcbef('0x16')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x3137a4,_0xcbef('0x10'));_0x3c76cd(_0x2e10e4[_0xcbef('0x17')][_0xcbef('0x16')]);}})['catch'](function(_0x48a6c9){logger[_0xcbef('0x13')](_0xcbef('0x15'),_0x3137a4,_0x48a6c9);_0x10e840(_0x48a6c9);});});}exports[_0xcbef('0x18')]=function(_0x5b02be){var _0x2a3887=this;return new Promise(function(_0x17f198,_0x4d59b3){return db[_0xcbef('0x19')][_0xcbef('0x1a')](_0x5b02be['body'],{'raw':_0x5b02be['options']?_0x5b02be[_0xcbef('0x1b')][_0xcbef('0x1c')]===undefined?!![]:![]:!![]})[_0xcbef('0xe')](function(_0x490b04){logger[_0xcbef('0xf')](_0xcbef('0x18'),_0x5b02be);logger[_0xcbef('0x11')]('CreateVoiceDialReport',_0x5b02be,JSON[_0xcbef('0x1d')](_0x490b04));_0x17f198(_0x490b04);})[_0xcbef('0x1e')](function(_0x181f83){logger['error'](_0xcbef('0x18'),_0x181f83[_0xcbef('0x16')],_0x5b02be);_0x4d59b3(_0x2a3887[_0xcbef('0x13')](0x1f4,_0x181f83[_0xcbef('0x16')]));});});};exports[_0xcbef('0x1f')]=function(_0x55a64e){var _0x43046a=this;return new Promise(function(_0x16a7db,_0x38be1f){return db[_0xcbef('0x19')][_0xcbef('0x20')](_0x55a64e['body'],{'raw':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e['options'][_0xcbef('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e[_0xcbef('0x1b')][_0xcbef('0x21')]||null:null,'attributes':_0x55a64e['options']?_0x55a64e[_0xcbef('0x1b')]['attributes']||null:null,'limit':_0x55a64e[_0xcbef('0x1b')]?_0x55a64e[_0xcbef('0x1b')][_0xcbef('0x22')]||null:null})[_0xcbef('0xe')](function(_0x5ef8ce){logger[_0xcbef('0xf')](_0xcbef('0x1f'),_0x55a64e);logger[_0xcbef('0x11')](_0xcbef('0x1f'),_0x55a64e,JSON[_0xcbef('0x1d')](_0x5ef8ce));_0x16a7db(_0x5ef8ce);})[_0xcbef('0x1e')](function(_0x57b8be){logger[_0xcbef('0x13')]('UpdateVoiceDialReport',_0x57b8be[_0xcbef('0x16')],_0x55a64e);_0x38be1f(_0x43046a['error'](0x1f4,_0x57b8be['message']));});});};
\ No newline at end of file
+var _0xda38=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','catch','CreateVoiceDialReport','create','options','UpdateVoiceDialReport','VoiceDialReport','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xda38,0x94));var _0x8da3=function(_0xcfe0ed,_0x3feab1){_0xcfe0ed=_0xcfe0ed-0x0;var _0x15bdec=_0xda38[_0xcfe0ed];return _0x15bdec;};'use strict';var _=require(_0x8da3('0x0'));var util=require(_0x8da3('0x1'));var moment=require(_0x8da3('0x2'));var BPromise=require(_0x8da3('0x3'));var rs=require(_0x8da3('0x4'));var fs=require('fs');var Redis=require(_0x8da3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8da3('0x6'));var logger=require(_0x8da3('0x7'))(_0x8da3('0x8'));var config=require(_0x8da3('0x9'));var jayson=require(_0x8da3('0xa'));var client=jayson['client'][_0x8da3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d0a98,_0x260935,_0xf75e6d){return new BPromise(function(_0x4ec236,_0x517a12){return client['request'](_0x2d0a98,_0xf75e6d)[_0x8da3('0xc')](function(_0x564e65){logger[_0x8da3('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x260935,_0x8da3('0xe'));logger[_0x8da3('0xf')](_0x8da3('0x10'),_0x260935,_0x8da3('0xe'),JSON[_0x8da3('0x11')](_0x564e65));if(_0x564e65[_0x8da3('0x12')]){if(_0x564e65['error']['code']===0x1f4){logger['error'](_0x8da3('0x13'),_0x260935,_0x564e65[_0x8da3('0x12')][_0x8da3('0x14')]);return _0x517a12(_0x564e65['error'][_0x8da3('0x14')]);}logger[_0x8da3('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x260935,_0x564e65[_0x8da3('0x12')][_0x8da3('0x14')]);return _0x4ec236(_0x564e65[_0x8da3('0x12')][_0x8da3('0x14')]);}else{logger[_0x8da3('0xd')](_0x8da3('0x13'),_0x260935,'request\x20sent');_0x4ec236(_0x564e65['result'][_0x8da3('0x14')]);}})[_0x8da3('0x15')](function(_0x21cf43){logger[_0x8da3('0x12')](_0x8da3('0x13'),_0x260935,_0x21cf43);_0x517a12(_0x21cf43);});});}exports[_0x8da3('0x16')]=function(_0x35f8b7){var _0xbea843=this;return new Promise(function(_0x3740a4,_0x3c7274){return db['VoiceDialReport'][_0x8da3('0x17')](_0x35f8b7['body'],{'raw':_0x35f8b7[_0x8da3('0x18')]?_0x35f8b7['options']['raw']===undefined?!![]:![]:!![]})[_0x8da3('0xc')](function(_0x251a1a){logger['info'](_0x8da3('0x16'),_0x35f8b7);logger['debug'](_0x8da3('0x16'),_0x35f8b7,JSON[_0x8da3('0x11')](_0x251a1a));_0x3740a4(_0x251a1a);})[_0x8da3('0x15')](function(_0x913fbe){logger[_0x8da3('0x12')](_0x8da3('0x16'),_0x913fbe['message'],_0x35f8b7);_0x3c7274(_0xbea843[_0x8da3('0x12')](0x1f4,_0x913fbe['message']));});});};exports[_0x8da3('0x19')]=function(_0x16424e){var _0x4c90a2=this;return new Promise(function(_0x14384c,_0x260be1){return db[_0x8da3('0x1a')]['update'](_0x16424e[_0x8da3('0x1b')],{'raw':_0x16424e[_0x8da3('0x18')]?_0x16424e[_0x8da3('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16424e[_0x8da3('0x18')]?_0x16424e['options'][_0x8da3('0x1c')]||null:null,'attributes':_0x16424e[_0x8da3('0x18')]?_0x16424e[_0x8da3('0x18')][_0x8da3('0x1d')]||null:null,'limit':_0x16424e[_0x8da3('0x18')]?_0x16424e[_0x8da3('0x18')][_0x8da3('0x1e')]||null:null})[_0x8da3('0xc')](function(_0x40e821){logger['info'](_0x8da3('0x19'),_0x16424e);logger['debug']('UpdateVoiceDialReport',_0x16424e,JSON[_0x8da3('0x11')](_0x40e821));_0x14384c(_0x40e821);})[_0x8da3('0x15')](function(_0x3a5cf2){logger[_0x8da3('0x12')](_0x8da3('0x19'),_0x3a5cf2[_0x8da3('0x14')],_0x16424e);_0x260be1(_0x4c90a2[_0x8da3('0x12')](0x1f4,_0x3a5cf2[_0x8da3('0x14')]));});});};
\ No newline at end of file
index bbdf0d0..5c81f92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d84=['get','isAuthenticated','show','post','create','/:id/applications','addApplications','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x34bfd8,_0x24eaa3){var _0x122c91=function(_0x17081a){while(--_0x17081a){_0x34bfd8['push'](_0x34bfd8['shift']());}};_0x122c91(++_0x24eaa3);}(_0x9d84,0xfd));var _0x49d8=function(_0x489e57,_0x4c2d00){_0x489e57=_0x489e57-0x0;var _0x1adede=_0x9d84[_0x489e57];return _0x1adede;};'use strict';var multer=require(_0x49d8('0x0'));var util=require(_0x49d8('0x1'));var path=require(_0x49d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x49d8('0x3'));var router=express[_0x49d8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x49d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x49d8('0x6'));var controller=require('./voiceExtension.controller');router[_0x49d8('0x7')]('/',auth[_0x49d8('0x8')](),controller['index']);router[_0x49d8('0x7')]('/:id',auth[_0x49d8('0x8')](),controller[_0x49d8('0x9')]);router[_0x49d8('0xa')]('/',auth[_0x49d8('0x8')](),controller[_0x49d8('0xb')]);router[_0x49d8('0xa')](_0x49d8('0xc'),auth[_0x49d8('0x8')](),controller[_0x49d8('0xd')]);router[_0x49d8('0xe')](_0x49d8('0xf'),auth[_0x49d8('0x8')](),controller[_0x49d8('0x10')]);router[_0x49d8('0x11')](_0x49d8('0xf'),auth[_0x49d8('0x8')](),controller[_0x49d8('0x12')]);module[_0x49d8('0x13')]=router;
\ No newline at end of file
+var _0x346b=['show','post','create','/:id/applications','addApplications','put','update','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','get','index','/:id','isAuthenticated'];(function(_0x3371cc,_0x13a125){var _0x2ce1a8=function(_0x3d1023){while(--_0x3d1023){_0x3371cc['push'](_0x3371cc['shift']());}};_0x2ce1a8(++_0x13a125);}(_0x346b,0xbc));var _0xb346=function(_0x155811,_0x1bde00){_0x155811=_0x155811-0x0;var _0x540c4d=_0x346b[_0x155811];return _0x540c4d;};'use strict';var multer=require(_0xb346('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb346('0x1'));var router=express['Router']();var fs_extra=require(_0xb346('0x2'));var auth=require(_0xb346('0x3'));var interaction=require(_0xb346('0x4'));var config=require('../../config/environment');var controller=require(_0xb346('0x5'));router[_0xb346('0x6')]('/',auth['isAuthenticated'](),controller[_0xb346('0x7')]);router[_0xb346('0x6')](_0xb346('0x8'),auth[_0xb346('0x9')](),controller[_0xb346('0xa')]);router[_0xb346('0xb')]('/',auth[_0xb346('0x9')](),controller[_0xb346('0xc')]);router['post'](_0xb346('0xd'),auth[_0xb346('0x9')](),controller[_0xb346('0xe')]);router[_0xb346('0xf')](_0xb346('0x8'),auth[_0xb346('0x9')](),controller[_0xb346('0x10')]);router['delete'](_0xb346('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xb346('0x11')]=router;
\ No newline at end of file
index 15dc7da..c46879f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd977=['ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','STRING','compositeIndex','NoOp'];(function(_0x2bdba8,_0x1be69b){var _0x2ddf5e=function(_0x1ef2d4){while(--_0x1ef2d4){_0x2bdba8['push'](_0x2bdba8['shift']());}};_0x2ddf5e(++_0x1be69b);}(_0xd977,0x1c7));var _0x7d97=function(_0x3751a3,_0x485ce5){_0x3751a3=_0x3751a3-0x0;var _0x4a9337=_0xd977[_0x3751a3];return _0x4a9337;};'use strict';var Sequelize=require(_0x7d97('0x0'));module['exports']={'context':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'unique':_0x7d97('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'unique':_0x7d97('0x2')},'priority':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x7d97('0x2')},'tag':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':_0x7d97('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x7d97('0x4')](_0x7d97('0x5'),_0x7d97('0x6'),_0x7d97('0x7'),_0x7d97('0x8'),_0x7d97('0x9'),_0x7d97('0xa'),_0x7d97('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x7d97('0x1')]},'interval':{'type':Sequelize[_0x7d97('0x1')],'allowNull':![],'defaultValue':_0x7d97('0xc')},'IntervalId':{'type':Sequelize[_0x7d97('0xd')]},'isApp':{'type':Sequelize[_0x7d97('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7d97('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7d97('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7d97('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7d97('0xd')]},'recordingFormat':{'type':Sequelize[_0x7d97('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x7d97('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7d97('0xf')],'get':function(_0x4e8d12){return this['getDataValue'](_0x7d97('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x1a8a=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','outbound-fax','system','any'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x1a8a,0x73));var _0xa1a8=function(_0x3300ec,_0x377793){_0x3300ec=_0x3300ec-0x0;var _0x1e99f4=_0x1a8a[_0x3300ec];return _0x1e99f4;};'use strict';var Sequelize=require(_0xa1a8('0x0'));module['exports']={'context':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':![],'unique':_0xa1a8('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa1a8('0x2')},'priority':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':![],'defaultValue':_0xa1a8('0x3')},'appdata':{'type':Sequelize[_0xa1a8('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xa1a8('0x4'),_0xa1a8('0x5'),_0xa1a8('0x6'),_0xa1a8('0x7'),_0xa1a8('0x8'),_0xa1a8('0x9'),_0xa1a8('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xa1a8('0x1')]},'interval':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':![],'defaultValue':_0xa1a8('0xb')},'IntervalId':{'type':Sequelize[_0xa1a8('0xc')]},'isApp':{'type':Sequelize[_0xa1a8('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xa1a8('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa1a8('0xc')]},'recordingFormat':{'type':Sequelize[_0xa1a8('0x1')],'defaultValue':_0xa1a8('0xe')},'answer':{'type':Sequelize[_0xa1a8('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xa1a8('0xf')],'get':function(_0x1e20ab){return this[_0xa1a8('0x10')](_0xa1a8('0x11'));}},'alias':{'type':Sequelize[_0xa1a8('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 725757a..f163bb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb910=['include','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','mandatoryDisposition','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','findAndCountAll','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','map','value','includes','type','find','error','stack','name','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show'];(function(_0x5a3d6d,_0x2ed4cb){var _0x4e7088=function(_0x1c2ede){while(--_0x1c2ede){_0x5a3d6d['push'](_0x5a3d6d['shift']());}};_0x4e7088(++_0x2ed4cb);}(_0xb910,0x12b));var _0x0b91=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xb910[_0x166d93];return _0xba708;};'use strict';var _=require(_0x0b91('0x0'));var Redis=require(_0x0b91('0x1'));var qs=require(_0x0b91('0x2'));var logger=require(_0x0b91('0x3'))(_0x0b91('0x4'));var config=require(_0x0b91('0x5'));var db=require(_0x0b91('0x6'))['db'];config[_0x0b91('0x7')]=_[_0x0b91('0x8')](config[_0x0b91('0x7')],{'host':_0x0b91('0x9'),'port':0x18eb});var socket=require(_0x0b91('0xa'))(new Redis(config[_0x0b91('0x7')]));require(_0x0b91('0xb'))['register'](socket);function respondWithStatusCode(_0x156fd1,_0xc65d86){_0xc65d86=_0xc65d86||0xcc;return function(_0x3e8800){if(_0x3e8800){return _0x156fd1[_0x0b91('0xc')](_0xc65d86);}return _0x156fd1[_0x0b91('0xd')](_0xc65d86)[_0x0b91('0xe')]();};}function respondWithResult(_0x4118b8,_0x13b9b7){_0x13b9b7=_0x13b9b7||0xc8;return function(_0x42e3dc){if(_0x42e3dc){return _0x4118b8['status'](_0x13b9b7)[_0x0b91('0xf')](_0x42e3dc);}};}function respondWithFilteredResult(_0x547a8b,_0x322ff0){return function(_0x5eb743){if(_0x5eb743){var _0x4ee548=typeof _0x322ff0[_0x0b91('0x10')]===_0x0b91('0x11')&&typeof _0x322ff0[_0x0b91('0x12')]===_0x0b91('0x11');var _0x5b6f36=_0x5eb743[_0x0b91('0x13')];var _0x2577a1=_0x4ee548?0x0:_0x322ff0[_0x0b91('0x10')];var _0x2ec488=_0x4ee548?_0x5eb743['count']:_0x322ff0[_0x0b91('0x10')]+_0x322ff0[_0x0b91('0x12')];var _0x1932a9;if(_0x2ec488>=_0x5b6f36){_0x2ec488=_0x5b6f36;_0x1932a9=0xc8;}else{_0x1932a9=0xce;}_0x547a8b[_0x0b91('0xd')](_0x1932a9);return _0x547a8b[_0x0b91('0x14')](_0x0b91('0x15'),_0x2577a1+'-'+_0x2ec488+'/'+_0x5b6f36)['json'](_0x5eb743);}return null;};}function removeEntity(_0x83ffe1){return function(_0x25e66a){if(_0x25e66a){return _0x25e66a[_0x0b91('0x16')]()[_0x0b91('0x17')](function(){var _0x106ec8=_0x25e66a[_0x0b91('0x18')]({'plain':!![]});var _0x1101c3=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a'),'ignore':![]},{'name':_0x0b91('0x1b'),'value':_0x0b91('0x1c'),'ignore':![]},{'name':_0x0b91('0x1d'),'value':'internal','ignore':![]}];var _0x2df818=_(_0x1101c3)['filter']('ignore')[_0x0b91('0x1e')](_0x0b91('0x1f'))[_0x0b91('0x1f')]();if(_[_0x0b91('0x20')](_0x2df818,_0x106ec8[_0x0b91('0x21')])){return;}var _0x5369c0=_[_0x0b91('0x22')](_0x1101c3,[_0x0b91('0x1f'),_0x106ec8[_0x0b91('0x21')]])['name'];return db['UserProfileResource']['destroy']({'where':{'type':_0x5369c0,'resourceId':_0x106ec8['id']}})['then'](function(){return _0x25e66a;});})[_0x0b91('0x17')](function(){_0x83ffe1[_0x0b91('0xd')](0xcc)[_0x0b91('0xe')]();});}};}function handleEntityNotFound(_0x24b98f){return function(_0x26d2e7){if(!_0x26d2e7){_0x24b98f[_0x0b91('0xc')](0x194);}return _0x26d2e7;};}function handleError(_0x119748,_0x2071c0){_0x2071c0=_0x2071c0||0x1f4;return function(_0x231327){logger[_0x0b91('0x23')](_0x231327[_0x0b91('0x24')]);if(_0x231327[_0x0b91('0x25')]){delete _0x231327['name'];}_0x119748[_0x0b91('0xd')](_0x2071c0)['send'](_0x231327);};}exports['index']=function(_0x1ea590,_0x5b6811){var _0x120ae2={},_0x4afbd1={},_0xb8cebf={'count':0x0,'rows':[]};var _0x15755c=_['map'](db[_0x0b91('0x26')][_0x0b91('0x27')],function(_0x493c5e){return{'name':_0x493c5e['fieldName'],'type':_0x493c5e['type'][_0x0b91('0x28')]};});_0x4afbd1[_0x0b91('0x29')]=_[_0x0b91('0x1e')](_0x15755c,_0x0b91('0x25'));_0x4afbd1[_0x0b91('0x2a')]=_[_0x0b91('0x2b')](_0x1ea590[_0x0b91('0x2a')]);_0x4afbd1[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x4afbd1[_0x0b91('0x29')],_0x4afbd1[_0x0b91('0x2a')]);_0x120ae2['attributes']=_['intersection'](_0x4afbd1[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x2e')]));_0x120ae2[_0x0b91('0x2f')]=_0x120ae2[_0x0b91('0x2f')]['length']?_0x120ae2[_0x0b91('0x2f')]:_0x4afbd1[_0x0b91('0x29')];if(!_0x1ea590['query']['hasOwnProperty'](_0x0b91('0x30'))){_0x120ae2[_0x0b91('0x12')]=qs[_0x0b91('0x12')](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x12')]);_0x120ae2['offset']=qs['offset'](_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x10')]);}_0x120ae2[_0x0b91('0x31')]=qs[_0x0b91('0x32')](_0x1ea590[_0x0b91('0x2a')]['sort']);_0x120ae2[_0x0b91('0x33')]=qs['filters'](_[_0x0b91('0x34')](_0x1ea590['query'],_0x4afbd1['filters']),_0x15755c);if(_0x1ea590['query'][_0x0b91('0x35')]){_0x120ae2[_0x0b91('0x33')]=_[_0x0b91('0x36')](_0x120ae2['where'],{'$or':_[_0x0b91('0x1e')](_0x15755c,function(_0x17388a){if(_0x17388a[_0x0b91('0x21')]!==_0x0b91('0x37')){var _0x4cd9ac={};_0x4cd9ac[_0x17388a[_0x0b91('0x25')]]={'$like':'%'+_0x1ea590['query'][_0x0b91('0x35')]+'%'};return _0x4cd9ac;}})});}_0x120ae2=_[_0x0b91('0x36')]({},_0x120ae2,_0x1ea590[_0x0b91('0x38')]);var _0x44c2d8={'where':_0x120ae2[_0x0b91('0x33')]};return db['VoiceExtension'][_0x0b91('0x13')](_0x44c2d8)[_0x0b91('0x17')](function(_0x5a7277){_0xb8cebf['count']=_0x5a7277;if(_0x1ea590[_0x0b91('0x2a')][_0x0b91('0x39')]){_0x120ae2['include']=[{'all':!![]}];}return db[_0x0b91('0x26')][_0x0b91('0x3a')](_0x120ae2);})[_0x0b91('0x17')](function(_0x5e1f06){_0xb8cebf['rows']=_0x5e1f06;return _0xb8cebf;})[_0x0b91('0x17')](respondWithFilteredResult(_0x5b6811,_0x120ae2))[_0x0b91('0x3b')](handleError(_0x5b6811,null));};exports[_0x0b91('0x3c')]=function(_0x256887,_0x43b8ee){var _0x18065f={'raw':![],'where':{'id':_0x256887['params']['id']}},_0x1166cc={};_0x1166cc[_0x0b91('0x29')]=_[_0x0b91('0x2b')](db[_0x0b91('0x26')][_0x0b91('0x27')]);_0x1166cc['query']=_[_0x0b91('0x2b')](_0x256887[_0x0b91('0x2a')]);_0x1166cc[_0x0b91('0x2c')]=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],_0x1166cc[_0x0b91('0x2a')]);_0x18065f['attributes']=_[_0x0b91('0x2d')](_0x1166cc[_0x0b91('0x29')],qs[_0x0b91('0x2e')](_0x256887[_0x0b91('0x2a')]['fields']));_0x18065f[_0x0b91('0x2f')]=_0x18065f[_0x0b91('0x2f')]['length']?_0x18065f[_0x0b91('0x2f')]:_0x1166cc[_0x0b91('0x29')];if(_0x256887[_0x0b91('0x2a')]['includeAll']){_0x18065f[_0x0b91('0x3d')]=[{'all':!![]}];}_0x18065f=_[_0x0b91('0x36')]({},_0x18065f,_0x256887[_0x0b91('0x38')]);return db[_0x0b91('0x26')][_0x0b91('0x22')](_0x18065f)[_0x0b91('0x17')](handleEntityNotFound(_0x43b8ee,null))[_0x0b91('0x17')](respondWithResult(_0x43b8ee,null))[_0x0b91('0x3b')](handleError(_0x43b8ee,null));};exports[_0x0b91('0x16')]=function(_0x1a1f74,_0x2fa952){return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x1a1f74[_0x0b91('0x3e')]['id']}})[_0x0b91('0x17')](handleEntityNotFound(_0x2fa952,null))['then'](removeEntity(_0x2fa952,null))[_0x0b91('0x3b')](handleError(_0x2fa952,null));};exports[_0x0b91('0x3f')]=function(_0x2ea30f,_0x78e4db){if(_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x21')]===_0x0b91('0x1c')&&!_[_0x0b91('0x41')](_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')],'_')){_0x2ea30f[_0x0b91('0x40')][_0x0b91('0x42')]='_'[_0x0b91('0x43')](_0x2ea30f['body']['exten']);}return db[_0x0b91('0x26')][_0x0b91('0x3f')](_0x2ea30f[_0x0b91('0x40')],{'raw':![]})['then'](function(_0x5c3cd7){var _0x1a367b=_0x2ea30f[_0x0b91('0x44')][_0x0b91('0x18')]({'plain':!![]});if(!_0x1a367b)throw new Error(_0x0b91('0x45'));if(_0x1a367b[_0x0b91('0x46')]===_0x0b91('0x44')){var _0x30b94a=_0x5c3cd7['get']({'plain':!![]});var _0x384266=[{'name':_0x0b91('0x19'),'value':_0x0b91('0x1a')},{'name':_0x0b91('0x1b'),'value':'outbound'},{'name':_0x0b91('0x1d'),'value':_0x0b91('0x47')}];var _0x4f08c5=_[_0x0b91('0x22')](_0x384266,[_0x0b91('0x1f'),_0x30b94a[_0x0b91('0x21')]])[_0x0b91('0x25')];return db['UserProfileSection']['find']({'where':{'name':_0x4f08c5,'userProfileId':_0x1a367b[_0x0b91('0x48')]},'raw':!![]})[_0x0b91('0x17')](function(_0x1bfc77){if(_0x1bfc77&&_0x1bfc77[_0x0b91('0x49')]===0x0){return db[_0x0b91('0x4a')][_0x0b91('0x3f')]({'name':_0x30b94a['name'],'resourceId':_0x30b94a['id'],'type':_0x1bfc77[_0x0b91('0x25')],'sectionId':_0x1bfc77['id']},{})[_0x0b91('0x17')](function(){return _0x5c3cd7;});}else{return _0x5c3cd7;}})[_0x0b91('0x3b')](function(_0x55a664){logger[_0x0b91('0x23')](_0x0b91('0x4b'),_0x55a664);throw _0x55a664;});}return _0x5c3cd7;})[_0x0b91('0x17')](respondWithResult(_0x78e4db,0xc9))['catch'](handleError(_0x78e4db,null));};exports[_0x0b91('0x4c')]=function(_0x3229d7,_0x2b2263){if(_0x3229d7[_0x0b91('0x40')]['id']){delete _0x3229d7['body']['id'];}return db[_0x0b91('0x26')][_0x0b91('0x22')]({'where':{'id':_0x3229d7[_0x0b91('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b2263,null))['then'](function(_0x3d5ad0){if(_0x3d5ad0){return db[_0x0b91('0x26')][_0x0b91('0x4c')](_[_0x0b91('0x34')](_0x3229d7[_0x0b91('0x40')],[_0x0b91('0x42'),'context','description',_0x0b91('0x4d'),'cutdigits',_0x0b91('0x4e'),_0x0b91('0x4f')]),{'where':{'context':_0x3d5ad0['context'],'exten':_0x3d5ad0[_0x0b91('0x42')]},'individualHooks':!![]})[_0x0b91('0x17')](function(_0x4460e6){return _0x4460e6;});}return null;})[_0x0b91('0x17')](respondWithStatusCode(_0x2b2263,null))['catch'](handleError(_0x2b2263,null));};exports[_0x0b91('0x50')]=function(_0x2f9d1b,_0x2eb38a){return db[_0x0b91('0x26')][_0x0b91('0x51')]({'where':{'id':_0x2f9d1b['params']['id']}})[_0x0b91('0x17')](function(_0x39fd3d){if(_0x39fd3d){return db[_0x0b91('0x52')][_0x0b91('0x53')](function(_0x5397df){return db['VoiceExtension'][_0x0b91('0x16')]({'where':{'VoiceExtensionId':_0x2f9d1b['params']['id']},'transaction':_0x5397df})['then'](function(){var _0x39689c=_['map'](_0x2f9d1b[_0x0b91('0x40')],function(_0x3071de){_0x3071de[_0x0b91('0x54')]=_0x2f9d1b['params']['id'];_0x3071de[_0x0b91('0x55')]=!![];return _0x3071de;});return _0x39fd3d[_0x0b91('0x56')](_0x39689c);})['then'](function(_0x224a90){console['log'](_0x0b91('0x57'),_0x224a90);return db[_0x0b91('0x26')][_0x0b91('0x58')](_0x224a90,{'transaction':_0x5397df});});})[_0x0b91('0x17')](function(){return db[_0x0b91('0x26')][_0x0b91('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2f9d1b[_0x0b91('0x3e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x0b91('0x17')](respondWithResult(_0x2eb38a,null))['catch'](handleError(_0x2eb38a,null));};
\ No newline at end of file
+var _0x804e=['body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','alias','addApplications','findOne','sequelize','transaction','VoiceExtensionId','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','count','limit','Content-Range','destroy','then','get','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','find','type','name','UserProfileResource','end','error','stack','index','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','VoiceExtension','catch','show','include','params','startsWith','exten','concat'];(function(_0x12961d,_0x5cdcdd){var _0x41f148=function(_0x3c731d){while(--_0x3c731d){_0x12961d['push'](_0x12961d['shift']());}};_0x41f148(++_0x5cdcdd);}(_0x804e,0x6e));var _0xe804=function(_0x100897,_0x2998b8){_0x100897=_0x100897-0x0;var _0x207df7=_0x804e[_0x100897];return _0x207df7;};'use strict';var _=require(_0xe804('0x0'));var Redis=require(_0xe804('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xe804('0x2'))(_0xe804('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe804('0x4')]=_[_0xe804('0x5')](config[_0xe804('0x4')],{'host':_0xe804('0x6'),'port':0x18eb});var socket=require(_0xe804('0x7'))(new Redis(config[_0xe804('0x4')]));require(_0xe804('0x8'))[_0xe804('0x9')](socket);function respondWithStatusCode(_0x30ffd8,_0x3c19b3){_0x3c19b3=_0x3c19b3||0xcc;return function(_0x31c192){if(_0x31c192){return _0x30ffd8[_0xe804('0xa')](_0x3c19b3);}return _0x30ffd8['status'](_0x3c19b3)['end']();};}function respondWithResult(_0x2c6084,_0x2122cf){_0x2122cf=_0x2122cf||0xc8;return function(_0x15ee61){if(_0x15ee61){return _0x2c6084[_0xe804('0xb')](_0x2122cf)[_0xe804('0xc')](_0x15ee61);}};}function respondWithFilteredResult(_0x360725,_0x51a77d){return function(_0x58fdd0){if(_0x58fdd0){var _0x50f7e8=typeof _0x51a77d[_0xe804('0xd')]==='undefined'&&typeof _0x51a77d['limit']==='undefined';var _0x4ee50d=_0x58fdd0[_0xe804('0xe')];var _0xb80aac=_0x50f7e8?0x0:_0x51a77d[_0xe804('0xd')];var _0x5772ce=_0x50f7e8?_0x58fdd0['count']:_0x51a77d[_0xe804('0xd')]+_0x51a77d[_0xe804('0xf')];var _0x26d067;if(_0x5772ce>=_0x4ee50d){_0x5772ce=_0x4ee50d;_0x26d067=0xc8;}else{_0x26d067=0xce;}_0x360725['status'](_0x26d067);return _0x360725['set'](_0xe804('0x10'),_0xb80aac+'-'+_0x5772ce+'/'+_0x4ee50d)[_0xe804('0xc')](_0x58fdd0);}return null;};}function removeEntity(_0x5def9a){return function(_0x386aa9){if(_0x386aa9){return _0x386aa9[_0xe804('0x11')]()[_0xe804('0x12')](function(){var _0x61e51e=_0x386aa9[_0xe804('0x13')]({'plain':!![]});var _0x1005fe=[{'name':'InboundRoutes','value':'inbound','ignore':![]},{'name':_0xe804('0x14'),'value':_0xe804('0x15'),'ignore':![]},{'name':_0xe804('0x16'),'value':_0xe804('0x17'),'ignore':![]}];var _0xa17a7=_(_0x1005fe)['filter']('ignore')[_0xe804('0x18')]('value')[_0xe804('0x19')]();if(_[_0xe804('0x1a')](_0xa17a7,_0x61e51e['type'])){return;}var _0xb42379=_[_0xe804('0x1b')](_0x1005fe,[_0xe804('0x19'),_0x61e51e[_0xe804('0x1c')]])[_0xe804('0x1d')];return db[_0xe804('0x1e')][_0xe804('0x11')]({'where':{'type':_0xb42379,'resourceId':_0x61e51e['id']}})[_0xe804('0x12')](function(){return _0x386aa9;});})['then'](function(){_0x5def9a[_0xe804('0xb')](0xcc)[_0xe804('0x1f')]();});}};}function handleEntityNotFound(_0x418335){return function(_0x4cc580){if(!_0x4cc580){_0x418335['sendStatus'](0x194);}return _0x4cc580;};}function handleError(_0x25c51b,_0x187897){_0x187897=_0x187897||0x1f4;return function(_0x352506){logger[_0xe804('0x20')](_0x352506[_0xe804('0x21')]);if(_0x352506[_0xe804('0x1d')]){delete _0x352506[_0xe804('0x1d')];}_0x25c51b[_0xe804('0xb')](_0x187897)['send'](_0x352506);};}exports[_0xe804('0x22')]=function(_0x3e87aa,_0x3b2f4a){var _0x2820e9={},_0x3a0693={},_0x267a77={'count':0x0,'rows':[]};var _0x242ab6=_['map'](db['VoiceExtension'][_0xe804('0x23')],function(_0x1020ef){return{'name':_0x1020ef[_0xe804('0x24')],'type':_0x1020ef[_0xe804('0x1c')][_0xe804('0x25')]};});_0x3a0693['model']=_['map'](_0x242ab6,'name');_0x3a0693[_0xe804('0x26')]=_[_0xe804('0x27')](_0x3e87aa[_0xe804('0x26')]);_0x3a0693[_0xe804('0x28')]=_[_0xe804('0x29')](_0x3a0693[_0xe804('0x2a')],_0x3a0693[_0xe804('0x26')]);_0x2820e9['attributes']=_['intersection'](_0x3a0693['model'],qs[_0xe804('0x2b')](_0x3e87aa[_0xe804('0x26')]['fields']));_0x2820e9['attributes']=_0x2820e9[_0xe804('0x2c')]['length']?_0x2820e9[_0xe804('0x2c')]:_0x3a0693[_0xe804('0x2a')];if(!_0x3e87aa['query'][_0xe804('0x2d')]('nolimit')){_0x2820e9[_0xe804('0xf')]=qs['limit'](_0x3e87aa[_0xe804('0x26')][_0xe804('0xf')]);_0x2820e9[_0xe804('0xd')]=qs['offset'](_0x3e87aa[_0xe804('0x26')][_0xe804('0xd')]);}_0x2820e9[_0xe804('0x2e')]=qs[_0xe804('0x2f')](_0x3e87aa[_0xe804('0x26')]['sort']);_0x2820e9[_0xe804('0x30')]=qs[_0xe804('0x28')](_[_0xe804('0x31')](_0x3e87aa[_0xe804('0x26')],_0x3a0693[_0xe804('0x28')]),_0x242ab6);if(_0x3e87aa['query'][_0xe804('0x32')]){_0x2820e9[_0xe804('0x30')]=_[_0xe804('0x33')](_0x2820e9['where'],{'$or':_['map'](_0x242ab6,function(_0x509e9e){if(_0x509e9e[_0xe804('0x1c')]!=='VIRTUAL'){var _0x383343={};_0x383343[_0x509e9e[_0xe804('0x1d')]]={'$like':'%'+_0x3e87aa[_0xe804('0x26')][_0xe804('0x32')]+'%'};return _0x383343;}})});}_0x2820e9=_[_0xe804('0x33')]({},_0x2820e9,_0x3e87aa[_0xe804('0x34')]);var _0x285c02={'where':_0x2820e9[_0xe804('0x30')]};return db['VoiceExtension']['count'](_0x285c02)['then'](function(_0x42bd25){_0x267a77[_0xe804('0xe')]=_0x42bd25;if(_0x3e87aa[_0xe804('0x26')][_0xe804('0x35')]){_0x2820e9['include']=[{'all':!![]}];}return db[_0xe804('0x36')]['findAll'](_0x2820e9);})['then'](function(_0x117c1d){_0x267a77['rows']=_0x117c1d;return _0x267a77;})[_0xe804('0x12')](respondWithFilteredResult(_0x3b2f4a,_0x2820e9))[_0xe804('0x37')](handleError(_0x3b2f4a,null));};exports[_0xe804('0x38')]=function(_0x18d393,_0x2ec7a4){var _0x386c5d={'raw':![],'where':{'id':_0x18d393['params']['id']}},_0x1aedab={};_0x1aedab[_0xe804('0x2a')]=_[_0xe804('0x27')](db['VoiceExtension'][_0xe804('0x23')]);_0x1aedab[_0xe804('0x26')]=_[_0xe804('0x27')](_0x18d393[_0xe804('0x26')]);_0x1aedab['filters']=_['intersection'](_0x1aedab[_0xe804('0x2a')],_0x1aedab[_0xe804('0x26')]);_0x386c5d[_0xe804('0x2c')]=_[_0xe804('0x29')](_0x1aedab[_0xe804('0x2a')],qs[_0xe804('0x2b')](_0x18d393[_0xe804('0x26')][_0xe804('0x2b')]));_0x386c5d['attributes']=_0x386c5d[_0xe804('0x2c')]['length']?_0x386c5d[_0xe804('0x2c')]:_0x1aedab['model'];if(_0x18d393[_0xe804('0x26')][_0xe804('0x35')]){_0x386c5d[_0xe804('0x39')]=[{'all':!![]}];}_0x386c5d=_[_0xe804('0x33')]({},_0x386c5d,_0x18d393[_0xe804('0x34')]);return db['VoiceExtension']['find'](_0x386c5d)[_0xe804('0x12')](handleEntityNotFound(_0x2ec7a4,null))[_0xe804('0x12')](respondWithResult(_0x2ec7a4,null))[_0xe804('0x37')](handleError(_0x2ec7a4,null));};exports[_0xe804('0x11')]=function(_0x463ba4,_0x1f0cf9){return db[_0xe804('0x36')][_0xe804('0x1b')]({'where':{'id':_0x463ba4[_0xe804('0x3a')]['id']}})[_0xe804('0x12')](handleEntityNotFound(_0x1f0cf9,null))[_0xe804('0x12')](removeEntity(_0x1f0cf9,null))[_0xe804('0x37')](handleError(_0x1f0cf9,null));};exports['create']=function(_0x51c758,_0xd41d7b){if(_0x51c758['body'][_0xe804('0x1c')]===_0xe804('0x15')&&!_[_0xe804('0x3b')](_0x51c758['body']['exten'],'_')){_0x51c758['body'][_0xe804('0x3c')]='_'[_0xe804('0x3d')](_0x51c758[_0xe804('0x3e')][_0xe804('0x3c')]);}return db[_0xe804('0x36')][_0xe804('0x3f')](_0x51c758[_0xe804('0x3e')],{'raw':![]})['then'](function(_0x343c61){var _0x151e7f=_0x51c758[_0xe804('0x40')][_0xe804('0x13')]({'plain':!![]});if(!_0x151e7f)throw new Error(_0xe804('0x41'));if(_0x151e7f[_0xe804('0x42')]==='user'){var _0x48962a=_0x343c61[_0xe804('0x13')]({'plain':!![]});var _0x11ce81=[{'name':'InboundRoutes','value':_0xe804('0x43')},{'name':_0xe804('0x14'),'value':_0xe804('0x15')},{'name':_0xe804('0x16'),'value':'internal'}];var _0x32a23d=_[_0xe804('0x1b')](_0x11ce81,[_0xe804('0x19'),_0x48962a['type']])[_0xe804('0x1d')];return db[_0xe804('0x44')]['find']({'where':{'name':_0x32a23d,'userProfileId':_0x151e7f[_0xe804('0x45')]},'raw':!![]})[_0xe804('0x12')](function(_0x28e041){if(_0x28e041&&_0x28e041[_0xe804('0x46')]===0x0){return db[_0xe804('0x1e')][_0xe804('0x3f')]({'name':_0x48962a['name'],'resourceId':_0x48962a['id'],'type':_0x28e041['name'],'sectionId':_0x28e041['id']},{})[_0xe804('0x12')](function(){return _0x343c61;});}else{return _0x343c61;}})['catch'](function(_0x3bbb48){logger[_0xe804('0x20')](_0xe804('0x47'),_0x3bbb48);throw _0x3bbb48;});}return _0x343c61;})[_0xe804('0x12')](respondWithResult(_0xd41d7b,0xc9))[_0xe804('0x37')](handleError(_0xd41d7b,null));};exports[_0xe804('0x48')]=function(_0x31f2d0,_0x1f5d2b){if(_0x31f2d0['body']['id']){delete _0x31f2d0[_0xe804('0x3e')]['id'];}return db['VoiceExtension'][_0xe804('0x1b')]({'where':{'id':_0x31f2d0[_0xe804('0x3a')]['id']}})[_0xe804('0x12')](handleEntityNotFound(_0x1f5d2b,null))[_0xe804('0x12')](function(_0x3862e5){if(_0x3862e5){return db[_0xe804('0x36')][_0xe804('0x48')](_[_0xe804('0x31')](_0x31f2d0[_0xe804('0x3e')],['exten','context',_0xe804('0x49'),_0xe804('0x4a'),_0xe804('0x4b'),'mandatoryDisposition',_0xe804('0x4c')]),{'where':{'context':_0x3862e5['context'],'exten':_0x3862e5[_0xe804('0x3c')]},'individualHooks':!![]})[_0xe804('0x12')](function(_0x3f6e3c){return _0x3f6e3c;});}return null;})[_0xe804('0x12')](respondWithStatusCode(_0x1f5d2b,null))['catch'](handleError(_0x1f5d2b,null));};exports[_0xe804('0x4d')]=function(_0x5b0b04,_0x501432){return db[_0xe804('0x36')][_0xe804('0x4e')]({'where':{'id':_0x5b0b04[_0xe804('0x3a')]['id']}})[_0xe804('0x12')](function(_0x482e3e){if(_0x482e3e){return db[_0xe804('0x4f')][_0xe804('0x50')](function(_0x48dac6){return db[_0xe804('0x36')][_0xe804('0x11')]({'where':{'VoiceExtensionId':_0x5b0b04[_0xe804('0x3a')]['id']},'transaction':_0x48dac6})[_0xe804('0x12')](function(){var _0x3a6330=_[_0xe804('0x18')](_0x5b0b04[_0xe804('0x3e')],function(_0x4ee5d6){_0x4ee5d6[_0xe804('0x51')]=_0x5b0b04[_0xe804('0x3a')]['id'];_0x4ee5d6['isApp']=!![];return _0x4ee5d6;});return _0x482e3e[_0xe804('0x52')](_0x3a6330);})[_0xe804('0x12')](function(_0x29f3f4){console['log'](_0xe804('0x53'),_0x29f3f4);return db['VoiceExtension'][_0xe804('0x54')](_0x29f3f4,{'transaction':_0x48dac6});});})[_0xe804('0x12')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5b0b04[_0xe804('0x3a')]['id']},'order':_0xe804('0x55')});});}})[_0xe804('0x12')](respondWithResult(_0x501432,null))['catch'](handleError(_0x501432,null));};
\ No newline at end of file
index bf5143b..b2809c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe579=['events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe579,0x118));var _0x9e57=function(_0x27a740,_0x3ffe2a){_0x27a740=_0x27a740-0x0;var _0x3cf3a9=_0xe579[_0x27a740];return _0x3cf3a9;};'use strict';var EventEmitter=require(_0x9e57('0x0'));var VoiceExtension=require(_0x9e57('0x1'))['db'][_0x9e57('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x9e57('0x3')](0x0);var events={'afterCreate':_0x9e57('0x4'),'afterUpdate':_0x9e57('0x5'),'afterDestroy':_0x9e57('0x6')};function emitEvent(_0x271606){return function(_0x57aee4,_0x2c0f51,_0x3562f6){VoiceExtensionEvents['emit'](_0x271606+':'+_0x57aee4['id'],_0x57aee4);VoiceExtensionEvents[_0x9e57('0x7')](_0x271606,_0x57aee4);_0x3562f6(null);};}for(var e in events){if(events[_0x9e57('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x9e57('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x41bd=['hook','exports','events','../../mysqldb','VoiceExtension','save','remove','emit','hasOwnProperty'];(function(_0x4d3078,_0x448284){var _0x432ffa=function(_0x163ef0){while(--_0x163ef0){_0x4d3078['push'](_0x4d3078['shift']());}};_0x432ffa(++_0x448284);}(_0x41bd,0x110));var _0xd41b=function(_0x31412d,_0x1ecc51){_0x31412d=_0x31412d-0x0;var _0x5e78b1=_0x41bd[_0x31412d];return _0x5e78b1;};'use strict';var EventEmitter=require(_0xd41b('0x0'));var VoiceExtension=require(_0xd41b('0x1'))['db'][_0xd41b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd41b('0x3'),'afterUpdate':'update','afterDestroy':_0xd41b('0x4')};function emitEvent(_0x43311e){return function(_0x152507,_0x11be9e,_0x28bebb){VoiceExtensionEvents[_0xd41b('0x5')](_0x43311e+':'+_0x152507['id'],_0x152507);VoiceExtensionEvents['emit'](_0x43311e,_0x152507);_0x28bebb(null);};}for(var e in events){if(events[_0xd41b('0x6')](e)){var event=events[e];VoiceExtension[_0xd41b('0x7')](e,emitEvent(event));}}module[_0xd41b('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
index 8ddfcf8..a15331e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8cb=['indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','includes','toLowerCase','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','name','phone','param','prefix','${EXTEN}','join'];(function(_0x33a2f9,_0x5bc81e){var _0x2c595c=function(_0x29a7d3){while(--_0x29a7d3){_0x33a2f9['push'](_0x33a2f9['shift']());}};_0x2c595c(++_0x5bc81e);}(_0xe8cb,0x11a));var _0xbe8c=function(_0x2adf7f,_0xd8c06a){_0x2adf7f=_0x2adf7f-0x0;var _0x5d86b4=_0xe8cb[_0x2adf7f];return _0x5d86b4;};'use strict';var _=require(_0xbe8c('0x0'));var attributes=require(_0xbe8c('0x1'));module[_0xbe8c('0x2')]=function(_0x554340){var _0x525404=_0x554340[_0xbe8c('0x3')];function _0x482715(_0x4d712a){var _0x5e57a5=0x2;var _0x248e82=[{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x6')+_0x4d712a[_0xbe8c('0x4')],'context':_0x4d712a['context'],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0x4d712a[_0xbe8c('0x8')]?_0xbe8c('0x5'):_0xbe8c('0x9'),'appdata':_0x4d712a[_0xbe8c('0x8')]?'CDR(routeAlias)='+_0x4d712a[_0xbe8c('0x8')]:_0xbe8c('0xa'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']}];if(_0x4d712a[_0xbe8c('0x4')]===_0xbe8c('0xc')){_0x248e82[_0xbe8c('0xd')]({'type':_0xbe8c('0xc'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xe')+_0x4d712a['id'],'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']});}_0x248e82[_0xbe8c('0xd')]({'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xf'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a[_0xbe8c('0x4')],'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x10'),'context':_0x4d712a[_0xbe8c('0xb')],'exten':_0x4d712a[_0xbe8c('0x7')],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']},{'type':_0x4d712a['type'],'app':_0xbe8c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d712a['context'],'exten':_0x4d712a['exten'],'priority':_0x5e57a5++,'VoiceExtensionId':_0x4d712a['id']});return _0x248e82;}function _0x259ba3(_0x52064d){var _0x6528d5=0x2;var _0x30143f=[{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x12'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':'outbound','app':_0x52064d['alias']?_0xbe8c('0x5'):'NoOp','appdata':_0x52064d['alias']?_0xbe8c('0x13')+_0x52064d['alias']:'No\x20alias\x20set','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x52064d['cutdigits']?'${EXTEN:'+_0x52064d[_0xbe8c('0x14')]+'}':'${EXTEN}'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':'CDR(routeid)='+_0x52064d['id'],'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x15'),'appdata':_0xbe8c('0x16')+(_0x6528d5+0x2)+_0xbe8c('0x17')+(_0x6528d5+0x1)+')','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0x52064d[_0xbe8c('0x14')]?_0xbe8c('0x18')+_0x52064d[_0xbe8c('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0xf'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x10'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0x52064d['context'],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':'Set','appdata':_0xbe8c('0x19')+_0x52064d['id'],'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']}];if(_0x52064d['hasOwnProperty'](_0xbe8c('0x1a'))&&_0x52064d[_0xbe8c('0x1a')]!==_0xbe8c('0x1b')){_0x30143f[_0xbe8c('0xd')]({'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x1c'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d[_0xbe8c('0x7')],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']},{'type':_0xbe8c('0x11'),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x1d')+_0x52064d[_0xbe8c('0x1a')]||_0xbe8c('0x1e'),'context':_0x52064d[_0xbe8c('0xb')],'exten':_0x52064d['exten'],'priority':_0x6528d5++,'VoiceExtensionId':_0x52064d['id']});}return _0x30143f;}function _0x1ffc42(_0x19aed0,_0xb779f2){var _0x1e4965=[{'name':_0xbe8c('0x1f'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xbe8c('0x20'),'param':0x2},{'name':_0xbe8c('0x21'),'param':0x3}];var _0xab7d2a={};var _0x3971f5=_0xb779f2[_0xbe8c('0x22')](',');var _0x9c25b=[];for(var _0x5ef717=0x0;_0x5ef717<_0x1e4965[_0xbe8c('0x23')];_0x5ef717++){switch(_0x1e4965[_0x5ef717][_0xbe8c('0x24')]){case _0xbe8c('0x1f'):_0xab7d2a[_0xbe8c('0x1f')]=_0x3971f5[_0x1e4965[_0x5ef717]['param']][_0xbe8c('0x22')]('/')[0x1];_0xab7d2a[_0xbe8c('0x25')]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]][_0xbe8c('0x22')]('/')[0x2];_0xab7d2a[_0xbe8c('0x27')]=_0xab7d2a[_0xbe8c('0x25')]?_0xab7d2a[_0xbe8c('0x25')][_0xbe8c('0x22')]('$')[0x0]:undefined;_0xab7d2a[_0xbe8c('0x25')]=_0x19aed0[_0xbe8c('0x14')]?(_0xab7d2a[_0xbe8c('0x27')]||'')+'${EXTEN:'+_0x19aed0[_0xbe8c('0x14')]+'}':(_0xab7d2a[_0xbe8c('0x27')]||'')+_0xbe8c('0x28');_0x9c25b[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]]=['SIP',_0xab7d2a['trunk'],_0xab7d2a[_0xbe8c('0x25')]][_0xbe8c('0x29')]('/');break;case'options':_0xab7d2a[_0xbe8c('0x20')]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]];if(_0x19aed0['recordingFormat']!==_0xbe8c('0x1b')){if(_0xab7d2a['options'][_0xbe8c('0x2a')](_0xbe8c('0x2b'))<0x0){_0xab7d2a['options']+=_0xbe8c('0x2b');}}else{_0xab7d2a[_0xbe8c('0x20')]=_0xab7d2a[_0xbe8c('0x20')][_0xbe8c('0x2c')](_0xbe8c('0x2b'),'');}_0x9c25b[_0x1e4965[_0x5ef717]['param']]=_0xab7d2a[_0xbe8c('0x20')];break;default:_0x9c25b[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]]=_0x3971f5[_0x1e4965[_0x5ef717][_0xbe8c('0x26')]];}}return _0x9c25b['join'](',');}function _0x45dcda(_0x167293,_0x3b0848,_0x1074ec){return new Promise(function(_0x2e3890,_0x1edbb4){var _0x2f5bfb=[];if(_['isEmpty'](_0x3b0848))return _0x2e3890(_0x2f5bfb);_0x525404[_0xbe8c('0x2d')]['findAll']({'attributes':['id',_0xbe8c('0x2e'),_0xbe8c('0x2f')],'raw':!![]})[_0xbe8c('0x30')](function(_0x17d0ae){for(var _0x78ff45=0x0,_0x41c99d=0x0;_0x78ff45<_0x3b0848[_0xbe8c('0x23')];_0x78ff45++,_0x41c99d=0x0){var _0x2c6e62=_0x3b0848[_0x78ff45];var _0x35cec9=[];var _0x23bfa3=[];delete _0x2c6e62['id'];if(_0x2c6e62[_0xbe8c('0x2e')]!==_0xbe8c('0x31')){_0x2c6e62['intervals']=[_0x2c6e62['interval']];}else{_0x2c6e62[_0xbe8c('0x32')]=_0x2c6e62[_0xbe8c('0x2f')]?_[_0xbe8c('0x33')](_[_0xbe8c('0x34')](_0x17d0ae,{'IntervalId':_0x2c6e62[_0xbe8c('0x2f')]}),_0xbe8c('0x2e')):[];}_0x2c6e62[_0xbe8c('0xb')]=_0x167293[_0xbe8c('0xb')];_0x2c6e62[_0xbe8c('0x7')]=_0x167293[_0xbe8c('0x7')];if(_0x2c6e62[_0xbe8c('0x4')])_0x2c6e62[_0xbe8c('0x4')]=_0x2c6e62['type']['toLowerCase']();if(_0x167293[_0xbe8c('0x4')]==='outbound'){if(_0x2c6e62['hasOwnProperty'](_0xbe8c('0x35'))&&_0x2c6e62[_0xbe8c('0x35')]&&_0x2c6e62[_0xbe8c('0x35')]!=='--'){_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')]['toLowerCase'](),'app':_0xbe8c('0x5'),'appdata':'CDR(tag)='+_0x2c6e62[_0xbe8c('0x35')],'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293['exten'],'priority':_0x2c6e62[_0xbe8c('0x32')]['length']+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}_0x35cec9['push']({'type':_0x2c6e62[_0xbe8c('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xbe8c('0x36')+(_0x2c6e62[_0xbe8c('0x37')]?'Set(CALLERID(all)='+_0x2c6e62[_0xbe8c('0x37')]+')':_0xbe8c('0x38')),'context':_0x167293['context'],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')]['length']+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}else{if(_0x2c6e62[_0xbe8c('0x39')](_0xbe8c('0x3a'))){if([_0xbe8c('0x3b'),_0xbe8c('0x3c')][_0xbe8c('0x3d')](_0x2c6e62['app'][_0xbe8c('0x3e')]())&&_0x2c6e62['appType']!==_0xbe8c('0x3f')){if(_0x2c6e62[_0xbe8c('0x3a')]){_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62['type'][_0xbe8c('0x3e')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':'Set','appdata':_0xbe8c('0x40'),'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}else{_0x35cec9['push']({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':'ExecIf','appdata':_0xbe8c('0x41'),'context':_0x167293[_0xbe8c('0xb')],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});_0x35cec9[_0xbe8c('0xd')]({'type':_0x2c6e62[_0xbe8c('0x4')][_0xbe8c('0x3e')](),'app':_0xbe8c('0x5'),'appdata':_0xbe8c('0x42'),'context':_0x167293['context'],'exten':_0x167293[_0xbe8c('0x7')],'priority':_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]+_0x1074ec+_0x41c99d++,'VoiceExtensionId':_0x167293['id']});}}}}for(var _0x5a892b=0x0;_0x5a892b<_0x2c6e62['intervals'][_0xbe8c('0x23')];_0x5a892b++){var _0x32b462=_0x1074ec+_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')];var _0xc7565a=_0x5a892b===_0x2c6e62[_0xbe8c('0x32')][_0xbe8c('0x23')]-0x1?_0x1074ec+_0x35cec9[_0xbe8c('0x23')]+_0x23bfa3[_0xbe8c('0x23')]+0x2:_0x1074ec+_0x5a892b+0x1;_0x35cec9[_0xbe8c('0x43')](_0x5a892b,0x0,{'type':_0x167293[_0xbe8c('0x4')],'app':_0xbe8c('0x44'),'appdata':_0x2c6e62['intervals'][_0x5a892b]+'?'+_0x167293[_0xbe8c('0xb')]+_0xbe8c('0x45')+_0x32b462+':'+_0x167293[_0xbe8c('0xb')]+_0xbe8c('0x45')+_0xc7565a,'exten':_0x167293['exten'],'context':_0x167293['context'],'priority':_0x1074ec+_0x5a892b,'VoiceExtensionId':_0x167293['id']});}if(_0x2c6e62[_0xbe8c('0x46')]===_0xbe8c('0x47'))_0x2c6e62[_0xbe8c('0x48')]=_0x1ffc42(_0x167293,_0x2c6e62['appdata']);_0x2c6e62['priority']=_0x35cec9[_0xbe8c('0x23')]?_['last'](_0x35cec9)[_0xbe8c('0x49')]+0x1:_0x1074ec;_0x2f5bfb=_[_0xbe8c('0x4a')](_0x2f5bfb,_0x35cec9,[_0x2c6e62],_0x23bfa3);_0x1074ec=_[_0xbe8c('0x4b')](_0x2f5bfb)[_0xbe8c('0x49')]+0x1;}return _0x2e3890(_0x2f5bfb);})[_0xbe8c('0x4c')](function(_0x1e6592){_0x1edbb4(_0x1e6592);});});}return _0x554340[_0xbe8c('0x4d')](_0xbe8c('0x4e'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4c2957){var _0x5d4690=this[_0xbe8c('0x4f')]({'plain':!![]});var _0x2f0308=_0x5d4690[_0xbe8c('0x4')]===_0xbe8c('0x11')?_0x259ba3(_0x5d4690):_0x482715(_0x5d4690);return _0x45dcda(_0x5d4690,_0x4c2957,_[_0xbe8c('0x4b')](_0x2f0308)['priority']+0x1)[_0xbe8c('0x30')](function(_0x9f38e7){var _0x4c8bcb=_['concat'](_0x2f0308,_0x9f38e7);_0x4c8bcb[_0xbe8c('0xd')]({'type':_0x5d4690['type'],'app':_0xbe8c('0x50'),'exten':_0x5d4690[_0xbe8c('0x7')],'context':_0x5d4690['context'],'priority':_[_0xbe8c('0x4b')](_0x4c8bcb)[_0xbe8c('0x49')]+0x1,'VoiceExtensionId':_0x5d4690['id']});return _0x4c8bcb;});}}});};
\ No newline at end of file
+var _0x9559=['No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','MONITOR_OPTIONS=ab','outboundrouteid=','recordingFormat','none','wav','trunk','options','length','name','split','phone','param','prefix','${EXTEN:','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','intervals','map','hasOwnProperty','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','VoiceExtension','voice_extensions','get','Hangup','lodash','exports','models','type','CDR(type)=','exten','alias','Set','NoOp','CDR(routeAlias)=','context','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outbound'];(function(_0x18ed47,_0x1cb78c){var _0x373449=function(_0x286eba){while(--_0x286eba){_0x18ed47['push'](_0x18ed47['shift']());}};_0x373449(++_0x1cb78c);}(_0x9559,0x12b));var _0x9955=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x9559[_0x308374];return _0x1f71e0;};'use strict';var _=require(_0x9955('0x0'));var attributes=require('./voiceExtension.attributes');module[_0x9955('0x1')]=function(_0x58b4c0){var _0x6c0c51=_0x58b4c0[_0x9955('0x2')];function _0x52f499(_0x133800){var _0x14a6a9=0x2;var _0x4b4dc8=[{'type':_0x133800[_0x9955('0x3')],'app':'Set','appdata':_0x9955('0x4')+_0x133800[_0x9955('0x3')],'context':_0x133800['context'],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']},{'type':_0x133800['type'],'app':_0x133800[_0x9955('0x6')]?_0x9955('0x7'):_0x9955('0x8'),'appdata':_0x133800[_0x9955('0x6')]?_0x9955('0x9')+_0x133800['alias']:'No\x20alias\x20set','context':_0x133800[_0x9955('0xa')],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']}];if(_0x133800['type']==='inbound'){_0x4b4dc8[_0x9955('0xb')]({'type':_0x9955('0xc'),'app':_0x9955('0x7'),'appdata':_0x9955('0xd')+_0x133800['id'],'context':_0x133800[_0x9955('0xa')],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']});}_0x4b4dc8[_0x9955('0xb')]({'type':_0x133800['type'],'app':_0x9955('0x7'),'appdata':_0x9955('0xe'),'context':_0x133800['context'],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']},{'type':_0x133800[_0x9955('0x3')],'app':_0x9955('0x7'),'appdata':_0x9955('0xf'),'context':_0x133800[_0x9955('0xa')],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']},{'type':_0x133800[_0x9955('0x3')],'app':_0x9955('0x7'),'appdata':'MONITOR_OPTIONS=ab','context':_0x133800[_0x9955('0xa')],'exten':_0x133800[_0x9955('0x5')],'priority':_0x14a6a9++,'VoiceExtensionId':_0x133800['id']});return _0x4b4dc8;}function _0x30e761(_0x4eccdb){var _0x3190b1=0x2;var _0x5e678f=[{'type':'outbound','app':_0x9955('0x7'),'appdata':'CDR(type)=outbound','context':_0x4eccdb['context'],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x4eccdb[_0x9955('0x6')]?_0x9955('0x7'):'NoOp','appdata':_0x4eccdb[_0x9955('0x6')]?_0x9955('0x9')+_0x4eccdb['alias']:_0x9955('0x11'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0x12')+(_0x4eccdb[_0x9955('0x13')]?'${EXTEN:'+_0x4eccdb[_0x9955('0x13')]+'}':_0x9955('0x14')),'context':_0x4eccdb['context'],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0xd')+_0x4eccdb['id'],'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x15'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3190b1+0x2)+_0x9955('0x16')+(_0x3190b1+0x1)+')','context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x4eccdb[_0x9955('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x4eccdb['cutdigits']+'}':_0x9955('0x17'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb['exten'],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0xe'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0xf'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0x18'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':_0x9955('0x19')+_0x4eccdb['id'],'context':_0x4eccdb['context'],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']}];if(_0x4eccdb['hasOwnProperty'](_0x9955('0x1a'))&&_0x4eccdb['recordingFormat']!==_0x9955('0x1b')){_0x5e678f[_0x9955('0xb')]({'type':_0x9955('0x10'),'app':_0x9955('0x7'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4eccdb['context'],'exten':_0x4eccdb['exten'],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x4eccdb['recordingFormat']||_0x9955('0x1c'),'context':_0x4eccdb[_0x9955('0xa')],'exten':_0x4eccdb[_0x9955('0x5')],'priority':_0x3190b1++,'VoiceExtensionId':_0x4eccdb['id']});}return _0x5e678f;}function _0x1880b6(_0x18faf9,_0x1693dd){var _0x313c19=[{'name':_0x9955('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x9955('0x1e'),'param':0x2},{'name':'url','param':0x3}];var _0x4331f1={};var _0xd786ae=_0x1693dd['split'](',');var _0x20ef51=[];for(var _0x276d5c=0x0;_0x276d5c<_0x313c19[_0x9955('0x1f')];_0x276d5c++){switch(_0x313c19[_0x276d5c][_0x9955('0x20')]){case _0x9955('0x1d'):_0x4331f1[_0x9955('0x1d')]=_0xd786ae[_0x313c19[_0x276d5c]['param']][_0x9955('0x21')]('/')[0x1];_0x4331f1[_0x9955('0x22')]=_0xd786ae[_0x313c19[_0x276d5c][_0x9955('0x23')]]['split']('/')[0x2];_0x4331f1['prefix']=_0x4331f1['phone']?_0x4331f1[_0x9955('0x22')]['split']('$')[0x0]:undefined;_0x4331f1[_0x9955('0x22')]=_0x18faf9['cutdigits']?(_0x4331f1[_0x9955('0x24')]||'')+_0x9955('0x25')+_0x18faf9[_0x9955('0x13')]+'}':(_0x4331f1[_0x9955('0x24')]||'')+'${EXTEN}';_0x20ef51[_0x313c19[_0x276d5c][_0x9955('0x23')]]=['SIP',_0x4331f1[_0x9955('0x1d')],_0x4331f1[_0x9955('0x22')]][_0x9955('0x26')]('/');break;case _0x9955('0x1e'):_0x4331f1['options']=_0xd786ae[_0x313c19[_0x276d5c][_0x9955('0x23')]];if(_0x18faf9[_0x9955('0x1a')]!==_0x9955('0x1b')){if(_0x4331f1[_0x9955('0x1e')][_0x9955('0x27')](_0x9955('0x28'))<0x0){_0x4331f1['options']+='U(xcally-mixmonitor-context)';}}else{_0x4331f1[_0x9955('0x1e')]=_0x4331f1[_0x9955('0x1e')][_0x9955('0x29')](_0x9955('0x28'),'');}_0x20ef51[_0x313c19[_0x276d5c][_0x9955('0x23')]]=_0x4331f1[_0x9955('0x1e')];break;default:_0x20ef51[_0x313c19[_0x276d5c][_0x9955('0x23')]]=_0xd786ae[_0x313c19[_0x276d5c]['param']];}}return _0x20ef51[_0x9955('0x26')](',');}function _0x5c6aa2(_0x2862bf,_0x151310,_0x57f687){return new Promise(function(_0xb3c819,_0x6129b5){var _0x30d7a7=[];if(_[_0x9955('0x2a')](_0x151310))return _0xb3c819(_0x30d7a7);_0x6c0c51[_0x9955('0x2b')][_0x9955('0x2c')]({'attributes':['id',_0x9955('0x2d'),_0x9955('0x2e')],'raw':!![]})[_0x9955('0x2f')](function(_0x2b7467){for(var _0x202207=0x0,_0x386727=0x0;_0x202207<_0x151310[_0x9955('0x1f')];_0x202207++,_0x386727=0x0){var _0x5e6e8e=_0x151310[_0x202207];var _0xcabb83=[];var _0x5be72c=[];delete _0x5e6e8e['id'];if(_0x5e6e8e[_0x9955('0x2d')]!=='*,*,*,*'){_0x5e6e8e[_0x9955('0x30')]=[_0x5e6e8e[_0x9955('0x2d')]];}else{_0x5e6e8e['intervals']=_0x5e6e8e['IntervalId']?_[_0x9955('0x31')](_['filter'](_0x2b7467,{'IntervalId':_0x5e6e8e[_0x9955('0x2e')]}),_0x9955('0x2d')):[];}_0x5e6e8e[_0x9955('0xa')]=_0x2862bf[_0x9955('0xa')];_0x5e6e8e[_0x9955('0x5')]=_0x2862bf[_0x9955('0x5')];if(_0x5e6e8e['type'])_0x5e6e8e[_0x9955('0x3')]=_0x5e6e8e[_0x9955('0x3')]['toLowerCase']();if(_0x2862bf[_0x9955('0x3')]===_0x9955('0x10')){if(_0x5e6e8e[_0x9955('0x32')](_0x9955('0x33'))&&_0x5e6e8e[_0x9955('0x33')]&&_0x5e6e8e[_0x9955('0x33')]!=='--'){_0xcabb83['push']({'type':_0x5e6e8e[_0x9955('0x3')][_0x9955('0x34')](),'app':'Set','appdata':_0x9955('0x35')+_0x5e6e8e[_0x9955('0x33')],'context':_0x2862bf[_0x9955('0xa')],'exten':_0x2862bf[_0x9955('0x5')],'priority':_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});}_0xcabb83[_0x9955('0xb')]({'type':_0x5e6e8e[_0x9955('0x3')][_0x9955('0x34')](),'app':'ExecIf','appdata':_0x9955('0x36')+(_0x5e6e8e['callerID']?_0x9955('0x37')+_0x5e6e8e[_0x9955('0x38')]+')':_0x9955('0x39')),'context':_0x2862bf[_0x9955('0xa')],'exten':_0x2862bf[_0x9955('0x5')],'priority':_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});}else{if(_0x5e6e8e['hasOwnProperty'](_0x9955('0x3a'))){if([_0x9955('0x3b'),_0x9955('0x3c')][_0x9955('0x3d')](_0x5e6e8e['app']['toLowerCase']())&&_0x5e6e8e[_0x9955('0x3e')]!==_0x9955('0x3f')){if(_0x5e6e8e['answer']){_0xcabb83[_0x9955('0xb')]({'type':_0x5e6e8e['type'][_0x9955('0x34')](),'app':'ExecIf','appdata':_0x9955('0x40'),'context':_0x2862bf[_0x9955('0xa')],'exten':_0x2862bf[_0x9955('0x5')],'priority':_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});_0xcabb83[_0x9955('0xb')]({'type':_0x5e6e8e[_0x9955('0x3')]['toLowerCase'](),'app':_0x9955('0x7'),'appdata':_0x9955('0x41'),'context':_0x2862bf[_0x9955('0xa')],'exten':_0x2862bf[_0x9955('0x5')],'priority':_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});}else{_0xcabb83['push']({'type':_0x5e6e8e['type'][_0x9955('0x34')](),'app':_0x9955('0x15'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2862bf[_0x9955('0xa')],'exten':_0x2862bf[_0x9955('0x5')],'priority':_0x5e6e8e['intervals'][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});_0xcabb83[_0x9955('0xb')]({'type':_0x5e6e8e[_0x9955('0x3')][_0x9955('0x34')](),'app':_0x9955('0x7'),'appdata':_0x9955('0x42'),'context':_0x2862bf['context'],'exten':_0x2862bf['exten'],'priority':_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]+_0x57f687+_0x386727++,'VoiceExtensionId':_0x2862bf['id']});}}}}for(var _0x218475=0x0;_0x218475<_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')];_0x218475++){var _0x13dc3d=_0x57f687+_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')];var _0x1aca21=_0x218475===_0x5e6e8e[_0x9955('0x30')][_0x9955('0x1f')]-0x1?_0x57f687+_0xcabb83[_0x9955('0x1f')]+_0x5be72c[_0x9955('0x1f')]+0x2:_0x57f687+_0x218475+0x1;_0xcabb83[_0x9955('0x43')](_0x218475,0x0,{'type':_0x2862bf[_0x9955('0x3')],'app':'GotoIfTime','appdata':_0x5e6e8e['intervals'][_0x218475]+'?'+_0x2862bf[_0x9955('0xa')]+_0x9955('0x44')+_0x13dc3d+':'+_0x2862bf['context']+_0x9955('0x44')+_0x1aca21,'exten':_0x2862bf['exten'],'context':_0x2862bf[_0x9955('0xa')],'priority':_0x57f687+_0x218475,'VoiceExtensionId':_0x2862bf['id']});}if(_0x5e6e8e[_0x9955('0x3e')]===_0x9955('0x45'))_0x5e6e8e['appdata']=_0x1880b6(_0x2862bf,_0x5e6e8e[_0x9955('0x46')]);_0x5e6e8e[_0x9955('0x47')]=_0xcabb83[_0x9955('0x1f')]?_[_0x9955('0x48')](_0xcabb83)[_0x9955('0x47')]+0x1:_0x57f687;_0x30d7a7=_[_0x9955('0x49')](_0x30d7a7,_0xcabb83,[_0x5e6e8e],_0x5be72c);_0x57f687=_[_0x9955('0x48')](_0x30d7a7)[_0x9955('0x47')]+0x1;}return _0xb3c819(_0x30d7a7);})[_0x9955('0x4a')](function(_0x122b68){_0x6129b5(_0x122b68);});});}return _0x58b4c0['define'](_0x9955('0x4b'),attributes,{'tableName':_0x9955('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1a0639){var _0x1dac22=this[_0x9955('0x4d')]({'plain':!![]});var _0x141bbb=_0x1dac22[_0x9955('0x3')]===_0x9955('0x10')?_0x30e761(_0x1dac22):_0x52f499(_0x1dac22);return _0x5c6aa2(_0x1dac22,_0x1a0639,_['last'](_0x141bbb)[_0x9955('0x47')]+0x1)[_0x9955('0x2f')](function(_0x1a64d5){var _0x9de1fe=_[_0x9955('0x49')](_0x141bbb,_0x1a64d5);_0x9de1fe[_0x9955('0xb')]({'type':_0x1dac22[_0x9955('0x3')],'app':_0x9955('0x4e'),'exten':_0x1dac22[_0x9955('0x5')],'context':_0x1dac22[_0x9955('0xa')],'priority':_[_0x9955('0x48')](_0x9de1fe)[_0x9955('0x47')]+0x1,'VoiceExtensionId':_0x1dac22['id']});return _0x9de1fe;});}}});};
\ No newline at end of file
index f61c526..69fdbeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacd6=['info','catch','GetVoiceExtension','findAll','options','where','limit','map','include','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5e48f8,_0x54ea70){var _0x15f1da=function(_0x2ae67f){while(--_0x2ae67f){_0x5e48f8['push'](_0x5e48f8['shift']());}};_0x15f1da(++_0x54ea70);}(_0xacd6,0xef));var _0x6acd=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xacd6[_0x3fb030];return _0xd6899b;};'use strict';var _=require(_0x6acd('0x0'));var util=require(_0x6acd('0x1'));var moment=require(_0x6acd('0x2'));var BPromise=require(_0x6acd('0x3'));var rs=require(_0x6acd('0x4'));var fs=require('fs');var Redis=require(_0x6acd('0x5'));var db=require(_0x6acd('0x6'))['db'];var utils=require(_0x6acd('0x7'));var logger=require(_0x6acd('0x8'))(_0x6acd('0x9'));var config=require(_0x6acd('0xa'));var jayson=require(_0x6acd('0xb'));var client=jayson['client'][_0x6acd('0xc')]({'port':0x232a});config[_0x6acd('0xd')]=_[_0x6acd('0xe')](config[_0x6acd('0xd')],{'host':_0x6acd('0xf'),'port':0x18eb});var socket=require(_0x6acd('0x10'))(new Redis(config[_0x6acd('0xd')]));require(_0x6acd('0x11'))['register'](socket);function respondWithRpcPromise(_0x35c08d,_0x20deb7,_0x211c33){return new BPromise(function(_0x3d827b,_0x1352cb){return client[_0x6acd('0x12')](_0x35c08d,_0x211c33)[_0x6acd('0x13')](function(_0x5670cc){logger['info'](_0x6acd('0x14'),_0x20deb7,_0x6acd('0x15'));logger[_0x6acd('0x16')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x20deb7,_0x6acd('0x15'),JSON[_0x6acd('0x17')](_0x5670cc));if(_0x5670cc[_0x6acd('0x18')]){if(_0x5670cc[_0x6acd('0x18')][_0x6acd('0x19')]===0x1f4){logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x5670cc[_0x6acd('0x18')]['message']);return _0x1352cb(_0x5670cc[_0x6acd('0x18')][_0x6acd('0x1a')]);}logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x5670cc[_0x6acd('0x18')]['message']);return _0x3d827b(_0x5670cc['error'][_0x6acd('0x1a')]);}else{logger[_0x6acd('0x1b')]('VoiceExtension,\x20%s,\x20%s',_0x20deb7,_0x6acd('0x15'));_0x3d827b(_0x5670cc['result'][_0x6acd('0x1a')]);}})[_0x6acd('0x1c')](function(_0x21192e){logger[_0x6acd('0x18')](_0x6acd('0x14'),_0x20deb7,_0x21192e);_0x1352cb(_0x21192e);});});}exports[_0x6acd('0x1d')]=function(_0x2c53b8){var _0x3b5ab2=this;return new Promise(function(_0x595592,_0x3d5a6a){return db['VoiceExtension'][_0x6acd('0x1e')]({'raw':_0x2c53b8[_0x6acd('0x1f')]?_0x2c53b8[_0x6acd('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x20')]||null:null,'attributes':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')]['attributes']||null:null,'limit':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x21')]||null:null,'include':_0x2c53b8['options']?_0x2c53b8[_0x6acd('0x1f')]['include']?_[_0x6acd('0x22')](_0x2c53b8[_0x6acd('0x1f')][_0x6acd('0x23')],function(_0x48ce7b){return{'model':db[_0x48ce7b[_0x6acd('0x24')]],'as':_0x48ce7b['as'],'attributes':_0x48ce7b[_0x6acd('0x25')],'include':_0x48ce7b[_0x6acd('0x23')]?_[_0x6acd('0x22')](_0x48ce7b[_0x6acd('0x23')],function(_0x29a6d9){return{'model':db[_0x29a6d9[_0x6acd('0x24')]],'as':_0x29a6d9['as'],'attributes':_0x29a6d9['attributes'],'include':_0x29a6d9[_0x6acd('0x23')]?_[_0x6acd('0x22')](_0x29a6d9['include'],function(_0x229269){return{'model':db[_0x229269['model']],'as':_0x229269['as'],'attributes':_0x229269['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ff700){logger[_0x6acd('0x1b')](_0x6acd('0x1d'),_0x2c53b8);logger['debug']('GetVoiceExtension',_0x2c53b8,JSON[_0x6acd('0x17')](_0x1ff700));_0x595592(_0x1ff700);})[_0x6acd('0x1c')](function(_0x4ce355){logger[_0x6acd('0x18')](_0x6acd('0x1d'),_0x4ce355['message'],_0x2c53b8);_0x3d5a6a(_0x3b5ab2[_0x6acd('0x18')](0x1f4,_0x4ce355[_0x6acd('0x1a')]));});});};
\ No newline at end of file
+var _0xac6a=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','raw','limit','map','include','model','attributes','debug','stringify','catch','lodash'];(function(_0x1fc0de,_0x60beb7){var _0x2fb0cb=function(_0x1847ee){while(--_0x1847ee){_0x1fc0de['push'](_0x1fc0de['shift']());}};_0x2fb0cb(++_0x60beb7);}(_0xac6a,0xc2));var _0xaac6=function(_0x9cca8c,_0x232279){_0x9cca8c=_0x9cca8c-0x0;var _0x522905=_0xac6a[_0x9cca8c];return _0x522905;};'use strict';var _=require(_0xaac6('0x0'));var util=require(_0xaac6('0x1'));var moment=require(_0xaac6('0x2'));var BPromise=require(_0xaac6('0x3'));var rs=require(_0xaac6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaac6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaac6('0x6'))(_0xaac6('0x7'));var config=require(_0xaac6('0x8'));var jayson=require(_0xaac6('0x9'));var client=jayson[_0xaac6('0xa')][_0xaac6('0xb')]({'port':0x232a});config[_0xaac6('0xc')]=_[_0xaac6('0xd')](config[_0xaac6('0xc')],{'host':_0xaac6('0xe'),'port':0x18eb});var socket=require(_0xaac6('0xf'))(new Redis(config[_0xaac6('0xc')]));require('./voiceExtension.socket')[_0xaac6('0x10')](socket);function respondWithRpcPromise(_0x160834,_0x31fa92,_0x37c3ba){return new BPromise(function(_0x19345a,_0x2b9460){return client['request'](_0x160834,_0x37c3ba)[_0xaac6('0x11')](function(_0x1605a3){logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));logger['debug'](_0xaac6('0x15'),_0x31fa92,_0xaac6('0x14'),JSON['stringify'](_0x1605a3));if(_0x1605a3['error']){if(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x17')]===0x1f4){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x2b9460(_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);}logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x1605a3[_0xaac6('0x16')][_0xaac6('0x18')]);return _0x19345a(_0x1605a3['error']['message']);}else{logger[_0xaac6('0x12')](_0xaac6('0x13'),_0x31fa92,_0xaac6('0x14'));_0x19345a(_0x1605a3[_0xaac6('0x19')][_0xaac6('0x18')]);}})['catch'](function(_0x22d66e){logger[_0xaac6('0x16')](_0xaac6('0x13'),_0x31fa92,_0x22d66e);_0x2b9460(_0x22d66e);});});}exports[_0xaac6('0x1a')]=function(_0xab5028){var _0x1e7c3e=this;return new Promise(function(_0x450019,_0x4a6064){return db[_0xaac6('0x1b')][_0xaac6('0x1c')]({'raw':_0xab5028[_0xaac6('0x1d')]?_0xab5028[_0xaac6('0x1d')][_0xaac6('0x1e')]===undefined?!![]:![]:!![],'where':_0xab5028[_0xaac6('0x1d')]?_0xab5028[_0xaac6('0x1d')]['where']||null:null,'attributes':_0xab5028['options']?_0xab5028[_0xaac6('0x1d')]['attributes']||null:null,'limit':_0xab5028[_0xaac6('0x1d')]?_0xab5028[_0xaac6('0x1d')][_0xaac6('0x1f')]||null:null,'include':_0xab5028['options']?_0xab5028[_0xaac6('0x1d')]['include']?_[_0xaac6('0x20')](_0xab5028[_0xaac6('0x1d')][_0xaac6('0x21')],function(_0x335300){return{'model':db[_0x335300[_0xaac6('0x22')]],'as':_0x335300['as'],'attributes':_0x335300['attributes'],'include':_0x335300[_0xaac6('0x21')]?_[_0xaac6('0x20')](_0x335300['include'],function(_0x50a896){return{'model':db[_0x50a896[_0xaac6('0x22')]],'as':_0x50a896['as'],'attributes':_0x50a896['attributes'],'include':_0x50a896[_0xaac6('0x21')]?_[_0xaac6('0x20')](_0x50a896[_0xaac6('0x21')],function(_0x3b63f3){return{'model':db[_0x3b63f3[_0xaac6('0x22')]],'as':_0x3b63f3['as'],'attributes':_0x3b63f3[_0xaac6('0x23')]};}):[]};}):[]};}):[]:[]})[_0xaac6('0x11')](function(_0xb02a9b){logger[_0xaac6('0x12')]('GetVoiceExtension',_0xab5028);logger[_0xaac6('0x24')](_0xaac6('0x1a'),_0xab5028,JSON[_0xaac6('0x25')](_0xb02a9b));_0x450019(_0xb02a9b);})[_0xaac6('0x26')](function(_0xf71ad8){logger['error']('GetVoiceExtension',_0xf71ad8[_0xaac6('0x18')],_0xab5028);_0x4a6064(_0x1e7c3e[_0xaac6('0x16')](0x1f4,_0xf71ad8[_0xaac6('0x18')]));});});};
\ No newline at end of file
index 4e0b0ce..30e90f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x564b6b,_0x59c3a0){var _0x3dab45=function(_0x2d85d4){while(--_0x2d85d4){_0x564b6b['push'](_0x564b6b['shift']());}};_0x3dab45(++_0x59c3a0);}(_0x1261,0x144));var _0x1126=function(_0x2af29a,_0x4f44bc){_0x2af29a=_0x2af29a-0x0;var _0x5ef02f=_0x1261[_0x2af29a];return _0x5ef02f;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}};
\ No newline at end of file
+var _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x33a0fd,_0x4349ad){var _0x3184ee=function(_0x5cd8d0){while(--_0x5cd8d0){_0x33a0fd['push'](_0x33a0fd['shift']());}};_0x3184ee(++_0x4349ad);}(_0x5fab,0x177));var _0xb5fa=function(_0x176259,_0x30e46f){_0x176259=_0x176259-0x0;var _0x48dc40=_0x5fab[_0x176259];return _0x48dc40;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}};
\ No newline at end of file
index 1a68a61..d3a4bb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x88923f,_0x7c090c){var _0x5a5dda=function(_0x4d1539){while(--_0x4d1539){_0x88923f['push'](_0x88923f['shift']());}};_0x5a5dda(++_0x7c090c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x219653,_0x4f09a6){_0x219653=_0x219653-0x0;var _0x3f96e2=_0xa6b0[_0x219653];return _0x3f96e2;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0a6b('0xe')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);module[_0x0a6b('0x14')]=router;
\ No newline at end of file
+var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','/:id','isAuthenticated','/:id/messages','getMessages','post','create','put','update','delete','destroy','multer','util'];(function(_0x4782ac,_0x47975f){var _0x51f823=function(_0x229dd4){while(--_0x229dd4){_0x4782ac['push'](_0x4782ac['shift']());}};_0x51f823(++_0x47975f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x18f06b,_0x152ede){_0x18f06b=_0x18f06b-0x0;var _0x2d1baf=_0x9f0e[_0x18f06b];return _0x2d1baf;};'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['show']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xa'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xa'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router;
\ No newline at end of file
index c389b3e..72537fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe13c=['INTEGER','VIRTUAL','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xe13c,0x164));var _0xce13=function(_0x47aadb,_0x5e07cc){_0x47aadb=_0x47aadb-0x0;var _0x1880bf=_0xe13c[_0x47aadb];return _0x1880bf;};'use strict';var Sequelize=require(_0xce13('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xce13('0x1')],'defaultValue':_0xce13('0x2'),'unique':_0xce13('0x3')},'mailbox':{'type':Sequelize[_0xce13('0x1')],'defaultValue':'','allowNull':![],'unique':_0xce13('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xce13('0x1')]},'email':{'type':Sequelize[_0xce13('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2b162b){this[_0xce13('0x4')](_0xce13('0x5'),typeof _0x2b162b===_0xce13('0x6')&&_0x2b162b[_0xce13('0x7')]()?_0x2b162b['trim']():null);}},'pager':{'type':Sequelize[_0xce13('0x1')]},'tz':{'type':Sequelize[_0xce13('0x1')],'defaultValue':_0xce13('0x8')},'attach':{'type':Sequelize[_0xce13('0x9')]('yes','no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0xce13('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xce13('0xa'),'no'),'defaultValue':_0xce13('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xce13('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xce13('0x9')](_0xce13('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xce13('0xb')},'emailsubject':{'type':Sequelize[_0xce13('0x1')]},'emailbody':{'type':Sequelize[_0xce13('0x1')]},'maxsecs':{'type':Sequelize[_0xce13('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xce13('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xce13('0xd')],'get':function(){return this['getDataValue']('fullname')+_0xce13('0xe')+this['getDataValue'](_0xce13('0xf'));}}};
\ No newline at end of file
+var _0xc94b=['TINYINT(4)','TIMESTAMP','INTEGER','fullname','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc94b,0x15c));var _0xbc94=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xc94b[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0xbc94('0x0'));module[_0xbc94('0x1')]={'customer_id':{'type':Sequelize[_0xbc94('0x2')]},'context':{'type':Sequelize[_0xbc94('0x2')],'defaultValue':_0xbc94('0x3'),'unique':_0xbc94('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xbc94('0x4')},'password':{'type':Sequelize[_0xbc94('0x2')]},'fullname':{'type':Sequelize[_0xbc94('0x2')]},'email':{'type':Sequelize[_0xbc94('0x2')],'validate':{'isEmail':!![]},'set':function(_0x25d4d3){this[_0xbc94('0x5')](_0xbc94('0x6'),typeof _0x25d4d3===_0xbc94('0x7')&&_0x25d4d3[_0xbc94('0x8')]()?_0x25d4d3[_0xbc94('0x8')]():null);}},'pager':{'type':Sequelize[_0xbc94('0x2')]},'tz':{'type':Sequelize[_0xbc94('0x2')],'defaultValue':_0xbc94('0x9')},'attach':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':_0xbc94('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xbc94('0x2')]},'callback':{'type':Sequelize[_0xbc94('0x2')]},'review':{'type':Sequelize['ENUM'](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xbc94('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xbc94('0xb'),'no'),'defaultValue':_0xbc94('0xb'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xbc94('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xbc94('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xbc94('0xa')](_0xbc94('0xb'),'no'),'defaultValue':_0xbc94('0xb'),'allowNull':![]},'stamp':{'type':_0xbc94('0xd')},'emailsubject':{'type':Sequelize[_0xbc94('0x2')]},'emailbody':{'type':Sequelize[_0xbc94('0x2')]},'maxsecs':{'type':Sequelize[_0xbc94('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xbc94('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xbc94('0xf'))+'\x20-\x20'+this[_0xbc94('0x10')](_0xbc94('0x11'));}}};
\ No newline at end of file
index 0cfc2b6..8c30f5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x282b=['json','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','options','VoiceMail','includeAll','include','findAll','catch','show','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','getMessages','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x282b,0xec));var _0xb282=function(_0x122298,_0x99c33d){_0x122298=_0x122298-0x0;var _0x127af3=_0x282b[_0x122298];return _0x127af3;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x338bdb,_0xc08746){_0xc08746=_0xc08746||0xcc;return function(_0x40d7b8){if(_0x40d7b8){return _0x338bdb[_0xb282('0x17')](_0xc08746);}return _0x338bdb[_0xb282('0x18')](_0xc08746)['end']();};}function respondWithResult(_0x34c595,_0x5adf7f){_0x5adf7f=_0x5adf7f||0xc8;return function(_0xe1d53){if(_0xe1d53){return _0x34c595[_0xb282('0x18')](_0x5adf7f)['json'](_0xe1d53);}};}function respondWithFilteredResult(_0x525cfa,_0x5bc7c3){return function(_0x13cea1){if(_0x13cea1){var _0x350676=typeof _0x5bc7c3[_0xb282('0x19')]===_0xb282('0x1a')&&typeof _0x5bc7c3[_0xb282('0x1b')]==='undefined';var _0x191a31=_0x13cea1[_0xb282('0x1c')];var _0xca5f12=_0x350676?0x0:_0x5bc7c3[_0xb282('0x19')];var _0x3f8a3f=_0x350676?_0x13cea1['count']:_0x5bc7c3['offset']+_0x5bc7c3[_0xb282('0x1b')];var _0x2cdeb1;if(_0x3f8a3f>=_0x191a31){_0x3f8a3f=_0x191a31;_0x2cdeb1=0xc8;}else{_0x2cdeb1=0xce;}_0x525cfa['status'](_0x2cdeb1);return _0x525cfa[_0xb282('0x1d')](_0xb282('0x1e'),_0xca5f12+'-'+_0x3f8a3f+'/'+_0x191a31)[_0xb282('0x1f')](_0x13cea1);}return null;};}function patchUpdates(_0x438dbe){return function(_0x1c3084){try{jsonpatch['apply'](_0x1c3084,_0x438dbe,!![]);}catch(_0x1de407){return BPromise[_0xb282('0x20')](_0x1de407);}return _0x1c3084[_0xb282('0x21')]();};}function saveUpdates(_0x4b79d7,_0x437d66){return function(_0x2a7ef8){if(_0x2a7ef8){return _0x2a7ef8[_0xb282('0x22')](_0x4b79d7)[_0xb282('0x23')](function(_0x680095){return _0x680095;});}return null;};}function removeEntity(_0x56645f,_0x4d624f){return function(_0x360f15){if(_0x360f15){return _0x360f15[_0xb282('0x24')]()['then'](function(){var _0x5e828e=_0x360f15[_0xb282('0x25')]({'plain':!![]});var _0x114f77=_0xb282('0x26');return db[_0xb282('0x27')][_0xb282('0x24')]({'where':{'type':_0x114f77,'resourceId':_0x5e828e['id']}})[_0xb282('0x23')](function(){return _0x360f15;});})['then'](function(){_0x56645f[_0xb282('0x18')](0xcc)[_0xb282('0x28')]();});}};}function handleEntityNotFound(_0x50bd73,_0x22d895){return function(_0x38a1f8){if(!_0x38a1f8){_0x50bd73[_0xb282('0x17')](0x194);}return _0x38a1f8;};}function handleError(_0x280940,_0x59644e){_0x59644e=_0x59644e||0x1f4;return function(_0x1520b1){logger[_0xb282('0x29')](_0x1520b1[_0xb282('0x2a')]);if(_0x1520b1[_0xb282('0x2b')]){delete _0x1520b1[_0xb282('0x2b')];}_0x280940[_0xb282('0x18')](_0x59644e)[_0xb282('0x2c')](_0x1520b1);};}exports['index']=function(_0x1b15b5,_0x1e2861){var _0x3eb294={},_0xd8780b={},_0x42ef75={'count':0x0,'rows':[]};var _0x5f3ddf=_[_0xb282('0x2d')](db['VoiceMail'][_0xb282('0x2e')],function(_0x1bf721){return{'name':_0x1bf721[_0xb282('0x2f')],'type':_0x1bf721['type'][_0xb282('0x30')]};});_0xd8780b['model']=_[_0xb282('0x2d')](_0x5f3ddf,_0xb282('0x2b'));_0xd8780b[_0xb282('0x31')]=_[_0xb282('0x32')](_0x1b15b5[_0xb282('0x31')]);_0xd8780b[_0xb282('0x33')]=_['intersection'](_0xd8780b[_0xb282('0x34')],_0xd8780b[_0xb282('0x31')]);_0x3eb294['attributes']=_['intersection'](_0xd8780b[_0xb282('0x34')],qs[_0xb282('0x35')](_0x1b15b5[_0xb282('0x31')]['fields']));_0x3eb294['attributes']=_0x3eb294['attributes'][_0xb282('0x36')]?_0x3eb294[_0xb282('0x37')]:_0xd8780b[_0xb282('0x34')];if(!_0x1b15b5[_0xb282('0x31')][_0xb282('0x38')](_0xb282('0x39'))){_0x3eb294[_0xb282('0x1b')]=qs['limit'](_0x1b15b5[_0xb282('0x31')]['limit']);_0x3eb294[_0xb282('0x19')]=qs[_0xb282('0x19')](_0x1b15b5[_0xb282('0x31')]['offset']);}_0x3eb294[_0xb282('0x3a')]=qs['sort'](_0x1b15b5[_0xb282('0x31')][_0xb282('0x3b')]);_0x3eb294[_0xb282('0x3c')]=qs[_0xb282('0x33')](_['pick'](_0x1b15b5['query'],_0xd8780b[_0xb282('0x33')]),_0x5f3ddf);if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]){_0x3eb294[_0xb282('0x3c')]=_['merge'](_0x3eb294[_0xb282('0x3c')],{'$or':_['map'](_0x5f3ddf,function(_0x475895){if(_0x475895[_0xb282('0x3e')]!=='VIRTUAL'){var _0x41f2c4={};_0x41f2c4[_0x475895[_0xb282('0x2b')]]={'$like':'%'+_0x1b15b5[_0xb282('0x31')][_0xb282('0x3d')]+'%'};return _0x41f2c4;}})});}_0x3eb294=_[_0xb282('0x3f')]({},_0x3eb294,_0x1b15b5[_0xb282('0x40')]);var _0x43e87e={'where':_0x3eb294[_0xb282('0x3c')]};return db[_0xb282('0x41')][_0xb282('0x1c')](_0x43e87e)[_0xb282('0x23')](function(_0x91fe43){_0x42ef75[_0xb282('0x1c')]=_0x91fe43;if(_0x1b15b5[_0xb282('0x31')][_0xb282('0x42')]){_0x3eb294[_0xb282('0x43')]=[{'all':!![]}];}return db[_0xb282('0x41')][_0xb282('0x44')](_0x3eb294);})['then'](function(_0x310ad1){_0x42ef75['rows']=_0x310ad1;return _0x42ef75;})[_0xb282('0x23')](respondWithFilteredResult(_0x1e2861,_0x3eb294))[_0xb282('0x45')](handleError(_0x1e2861,null));};exports[_0xb282('0x46')]=function(_0x2f2ce8,_0x197472){var _0x3ddf56={'raw':!![],'where':{'id':_0x2f2ce8['params']['id']}},_0x5a6c0d={};_0x5a6c0d[_0xb282('0x34')]=_['keys'](db[_0xb282('0x41')][_0xb282('0x2e')]);_0x5a6c0d['query']=_[_0xb282('0x32')](_0x2f2ce8[_0xb282('0x31')]);_0x5a6c0d[_0xb282('0x33')]=_['intersection'](_0x5a6c0d['model'],_0x5a6c0d[_0xb282('0x31')]);_0x3ddf56['attributes']=_[_0xb282('0x47')](_0x5a6c0d[_0xb282('0x34')],qs[_0xb282('0x35')](_0x2f2ce8[_0xb282('0x31')][_0xb282('0x35')]));_0x3ddf56[_0xb282('0x37')]=_0x3ddf56['attributes'][_0xb282('0x36')]?_0x3ddf56[_0xb282('0x37')]:_0x5a6c0d[_0xb282('0x34')];if(_0x2f2ce8['query'][_0xb282('0x42')]){_0x3ddf56['include']=[{'all':!![]}];}_0x3ddf56=_[_0xb282('0x3f')]({},_0x3ddf56,_0x2f2ce8['options']);return db[_0xb282('0x41')]['find'](_0x3ddf56)['then'](handleEntityNotFound(_0x197472,null))['then'](respondWithResult(_0x197472,null))[_0xb282('0x45')](handleError(_0x197472,null));};exports[_0xb282('0x48')]=function(_0x42d99f,_0x7a5aa4){return db['VoiceMail']['create'](_0x42d99f['body'],{})[_0xb282('0x23')](function(_0x255ad5){var _0x3bed8d=_0x42d99f[_0xb282('0x49')]['get']({'plain':!![]});if(!_0x3bed8d)throw new Error(_0xb282('0x4a'));if(_0x3bed8d[_0xb282('0x4b')]==='user'){var _0x33bded=_0x255ad5[_0xb282('0x25')]({'plain':!![]});var _0x16f66b=_0xb282('0x26');return db[_0xb282('0x4c')]['find']({'where':{'name':_0x16f66b,'userProfileId':_0x3bed8d[_0xb282('0x4d')]},'raw':!![]})[_0xb282('0x23')](function(_0x465209){if(_0x465209&&_0x465209[_0xb282('0x4e')]===0x0){return db[_0xb282('0x27')][_0xb282('0x48')]({'name':_0x33bded['name'],'resourceId':_0x33bded['id'],'type':_0x465209[_0xb282('0x2b')],'sectionId':_0x465209['id']},{})['then'](function(){return _0x255ad5;});}else{return _0x255ad5;}})[_0xb282('0x45')](function(_0x1e6ade){logger['error'](_0xb282('0x4f'),_0x1e6ade);throw _0x1e6ade;});}return _0x255ad5;})[_0xb282('0x23')](respondWithResult(_0x7a5aa4,0xc9))[_0xb282('0x45')](handleError(_0x7a5aa4,null));};exports['update']=function(_0x51cbb0,_0x1028b9){if(_0x51cbb0[_0xb282('0x50')]['id']){delete _0x51cbb0[_0xb282('0x50')]['id'];}return db['VoiceMail'][_0xb282('0x51')]({'where':{'id':_0x51cbb0['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x1028b9,null))[_0xb282('0x23')](saveUpdates(_0x51cbb0['body'],null))[_0xb282('0x23')](respondWithResult(_0x1028b9,null))['catch'](handleError(_0x1028b9,null));};exports[_0xb282('0x24')]=function(_0x34b31a,_0x2e6eaa){return db[_0xb282('0x41')][_0xb282('0x51')]({'where':{'id':_0x34b31a[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x2e6eaa,null))[_0xb282('0x23')](removeEntity(_0x2e6eaa,null))['catch'](handleError(_0x2e6eaa,null));};exports[_0xb282('0x53')]=function(_0x34baf2,_0x53d50a,_0x597793){return db[_0xb282('0x41')][_0xb282('0x54')]({'where':{'id':_0x34baf2[_0xb282('0x52')]['id']}})['then'](handleEntityNotFound(_0x53d50a,null))['then'](function(_0x40ae87){var _0x2dbbc4;var _0x3716b0={},_0x5d6a78={};_0x5d6a78[_0xb282('0x34')]=_['keys'](db[_0xb282('0x55')][_0xb282('0x2e')]);_0x5d6a78[_0xb282('0x31')]=_[_0xb282('0x32')](_0x34baf2[_0xb282('0x31')]);_0x5d6a78[_0xb282('0x33')]=_[_0xb282('0x47')](_0x5d6a78['model'],_0x5d6a78[_0xb282('0x31')]);_0x3716b0[_0xb282('0x37')]=_[_0xb282('0x47')](_0x5d6a78['model'],qs['fields'](_0x34baf2[_0xb282('0x31')][_0xb282('0x35')]));_0x3716b0[_0xb282('0x37')]=_0x3716b0['attributes']['length']?_0x3716b0[_0xb282('0x37')]:_0x5d6a78[_0xb282('0x34')];if(!_0x34baf2['query'][_0xb282('0x38')](_0xb282('0x39'))){_0x3716b0[_0xb282('0x1b')]=qs['limit'](_0x34baf2[_0xb282('0x31')][_0xb282('0x1b')]);_0x3716b0['offset']=qs[_0xb282('0x19')](_0x34baf2[_0xb282('0x31')][_0xb282('0x19')]);}_0x3716b0[_0xb282('0x3a')]=qs['sort'](_0x34baf2['query'][_0xb282('0x3b')]);_0x3716b0[_0xb282('0x3c')]=qs['filters'](_[_0xb282('0x56')](_0x34baf2[_0xb282('0x31')],_0x5d6a78[_0xb282('0x33')]));if(_0x34baf2[_0xb282('0x31')][_0xb282('0x3d')]){_0x3716b0[_0xb282('0x3c')]=_[_0xb282('0x3f')](_0x3716b0[_0xb282('0x3c')],{'$or':_['map'](_0x3716b0[_0xb282('0x37')],function(_0xb22721){var _0x18f33d={};_0x18f33d[_0xb22721]={'$like':'%'+_0x34baf2['query'][_0xb282('0x3d')]+'%'};return _0x18f33d;})});}_0x3716b0[_0xb282('0x3c')]=_['merge'](_0x3716b0['where'],{'mailboxuser':_0x40ae87[_0xb282('0x57')]});_0x3716b0=_[_0xb282('0x3f')]({},_0x3716b0,_0x34baf2[_0xb282('0x40')]);return db[_0xb282('0x55')][_0xb282('0x58')](_0x3716b0)[_0xb282('0x23')](respondWithFilteredResult(_0x53d50a,_0x3716b0));})[_0xb282('0x45')](handleError(_0x53d50a,null));};
\ No newline at end of file
+var _0xbfcc=['stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','nolimit','VoiceMailMessage','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x3a0472,_0xcf7d62){var _0x581422=function(_0x2ead83){while(--_0x2ead83){_0x3a0472['push'](_0x3a0472['shift']());}};_0x581422(++_0xcf7d62);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xbfcc[_0x33c9f8];return _0x2d7004;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){var _0x49f5bf=_0x34cffa[_0xcbfc('0x23')]({'plain':!![]});var _0x51284a=_0xcbfc('0x24');return db[_0xcbfc('0x25')]['destroy']({'where':{'type':_0x51284a,'resourceId':_0x49f5bf['id']}})[_0xcbfc('0x21')](function(){return _0x34cffa;});})[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x3c3afd,_0x2f7549){return function(_0x41f3b8){if(!_0x41f3b8){_0x3c3afd['sendStatus'](0x194);}return _0x41f3b8;};}function handleError(_0x29f896,_0x1ec530){_0x1ec530=_0x1ec530||0x1f4;return function(_0x4f632a){logger[_0xcbfc('0x26')](_0x4f632a[_0xcbfc('0x27')]);if(_0x4f632a[_0xcbfc('0x28')]){delete _0x4f632a[_0xcbfc('0x28')];}_0x29f896[_0xcbfc('0x18')](_0x1ec530)[_0xcbfc('0x29')](_0x4f632a);};}exports[_0xcbfc('0x2a')]=function(_0x5366cf,_0x41b68b){var _0x433300={},_0x3f9d20={},_0x20a378={'count':0x0,'rows':[]};var _0x500a0b=_[_0xcbfc('0x2b')](db[_0xcbfc('0x2c')][_0xcbfc('0x2d')],function(_0x245986){return{'name':_0x245986[_0xcbfc('0x2e')],'type':_0x245986[_0xcbfc('0x2f')][_0xcbfc('0x30')]};});_0x3f9d20['model']=_[_0xcbfc('0x2b')](_0x500a0b,_0xcbfc('0x28'));_0x3f9d20['query']=_[_0xcbfc('0x31')](_0x5366cf[_0xcbfc('0x32')]);_0x3f9d20[_0xcbfc('0x33')]=_['intersection'](_0x3f9d20['model'],_0x3f9d20['query']);_0x433300[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x3f9d20[_0xcbfc('0x36')],qs[_0xcbfc('0x37')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x433300[_0xcbfc('0x34')]=_0x433300[_0xcbfc('0x34')]['length']?_0x433300[_0xcbfc('0x34')]:_0x3f9d20[_0xcbfc('0x36')];if(!_0x5366cf['query'][_0xcbfc('0x38')]('nolimit')){_0x433300[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x5366cf[_0xcbfc('0x32')]['limit']);_0x433300[_0xcbfc('0x1b')]=qs['offset'](_0x5366cf['query'][_0xcbfc('0x1b')]);}_0x433300[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x433300[_0xcbfc('0x3b')]=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x5366cf['query'],_0x3f9d20[_0xcbfc('0x33')]),_0x500a0b);if(_0x5366cf['query'][_0xcbfc('0x3d')]){_0x433300[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x433300[_0xcbfc('0x3b')],{'$or':_['map'](_0x500a0b,function(_0x5306e9){if(_0x5306e9[_0xcbfc('0x2f')]!==_0xcbfc('0x3f')){var _0x404f46={};_0x404f46[_0x5306e9[_0xcbfc('0x28')]]={'$like':'%'+_0x5366cf[_0xcbfc('0x32')]['filter']+'%'};return _0x404f46;}})});}_0x433300=_[_0xcbfc('0x3e')]({},_0x433300,_0x5366cf[_0xcbfc('0x40')]);var _0xf2da32={'where':_0x433300['where']};return db[_0xcbfc('0x2c')][_0xcbfc('0x1c')](_0xf2da32)[_0xcbfc('0x21')](function(_0x4ca55c){_0x20a378[_0xcbfc('0x1c')]=_0x4ca55c;if(_0x5366cf[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0x433300[_0xcbfc('0x42')]=[{'all':!![]}];}return db[_0xcbfc('0x2c')][_0xcbfc('0x43')](_0x433300);})[_0xcbfc('0x21')](function(_0x561544){_0x20a378[_0xcbfc('0x44')]=_0x561544;return _0x20a378;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x41b68b,_0x433300))['catch'](handleError(_0x41b68b,null));};exports[_0xcbfc('0x45')]=function(_0x50a01c,_0x17b87b){var _0xdc0521={'raw':!![],'where':{'id':_0x50a01c[_0xcbfc('0x46')]['id']}},_0xd609ec={};_0xd609ec[_0xcbfc('0x36')]=_[_0xcbfc('0x31')](db['VoiceMail'][_0xcbfc('0x2d')]);_0xd609ec[_0xcbfc('0x32')]=_[_0xcbfc('0x31')](_0x50a01c[_0xcbfc('0x32')]);_0xd609ec[_0xcbfc('0x33')]=_[_0xcbfc('0x35')](_0xd609ec[_0xcbfc('0x36')],_0xd609ec['query']);_0xdc0521[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0xd609ec['model'],qs[_0xcbfc('0x37')](_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0xdc0521['attributes']=_0xdc0521[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0xdc0521[_0xcbfc('0x34')]:_0xd609ec[_0xcbfc('0x36')];if(_0x50a01c[_0xcbfc('0x32')][_0xcbfc('0x41')]){_0xdc0521[_0xcbfc('0x42')]=[{'all':!![]}];}_0xdc0521=_['merge']({},_0xdc0521,_0x50a01c['options']);return db[_0xcbfc('0x2c')][_0xcbfc('0x48')](_0xdc0521)[_0xcbfc('0x21')](handleEntityNotFound(_0x17b87b,null))[_0xcbfc('0x21')](respondWithResult(_0x17b87b,null))['catch'](handleError(_0x17b87b,null));};exports['create']=function(_0x2e89bf,_0xe5c5ef){return db[_0xcbfc('0x2c')]['create'](_0x2e89bf[_0xcbfc('0x49')],{})[_0xcbfc('0x21')](function(_0x4446b7){var _0x4b3096=_0x2e89bf[_0xcbfc('0x4a')][_0xcbfc('0x23')]({'plain':!![]});if(!_0x4b3096)throw new Error(_0xcbfc('0x4b'));if(_0x4b3096[_0xcbfc('0x4c')]===_0xcbfc('0x4a')){var _0xd9976d=_0x4446b7[_0xcbfc('0x23')]({'plain':!![]});var _0x374998=_0xcbfc('0x24');return db[_0xcbfc('0x4d')]['find']({'where':{'name':_0x374998,'userProfileId':_0x4b3096[_0xcbfc('0x4e')]},'raw':!![]})[_0xcbfc('0x21')](function(_0x44cc11){if(_0x44cc11&&_0x44cc11['autoAssociation']===0x0){return db[_0xcbfc('0x25')][_0xcbfc('0x4f')]({'name':_0xd9976d['name'],'resourceId':_0xd9976d['id'],'type':_0x44cc11[_0xcbfc('0x28')],'sectionId':_0x44cc11['id']},{})[_0xcbfc('0x21')](function(){return _0x4446b7;});}else{return _0x4446b7;}})[_0xcbfc('0x50')](function(_0x25e48d){logger['error'](_0xcbfc('0x51'),_0x25e48d);throw _0x25e48d;});}return _0x4446b7;})[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,0xc9))['catch'](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x52')]=function(_0x34db13,_0x3ed9f0){if(_0x34db13[_0xcbfc('0x49')]['id']){delete _0x34db13[_0xcbfc('0x49')]['id'];}return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x34db13[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x3ed9f0,null))[_0xcbfc('0x21')](saveUpdates(_0x34db13['body'],null))[_0xcbfc('0x21')](respondWithResult(_0x3ed9f0,null))['catch'](handleError(_0x3ed9f0,null));};exports['destroy']=function(_0x4a10e6,_0x4239da){return db[_0xcbfc('0x2c')][_0xcbfc('0x48')]({'where':{'id':_0x4a10e6[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x4239da,null))[_0xcbfc('0x21')](removeEntity(_0x4239da,null))[_0xcbfc('0x50')](handleError(_0x4239da,null));};exports[_0xcbfc('0x53')]=function(_0x4d2df1,_0x9e0c38,_0xf5f5e1){return db[_0xcbfc('0x2c')]['findOne']({'where':{'id':_0x4d2df1[_0xcbfc('0x46')]['id']}})[_0xcbfc('0x21')](handleEntityNotFound(_0x9e0c38,null))[_0xcbfc('0x21')](function(_0x3b526f){var _0x1ed350;var _0x310b78={},_0x34ec1d={};_0x34ec1d['model']=_[_0xcbfc('0x31')](db['VoiceMailMessage'][_0xcbfc('0x2d')]);_0x34ec1d[_0xcbfc('0x32')]=_['keys'](_0x4d2df1[_0xcbfc('0x32')]);_0x34ec1d['filters']=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],_0x34ec1d[_0xcbfc('0x32')]);_0x310b78[_0xcbfc('0x34')]=_[_0xcbfc('0x35')](_0x34ec1d[_0xcbfc('0x36')],qs['fields'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x37')]));_0x310b78['attributes']=_0x310b78[_0xcbfc('0x34')][_0xcbfc('0x47')]?_0x310b78[_0xcbfc('0x34')]:_0x34ec1d[_0xcbfc('0x36')];if(!_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x38')](_0xcbfc('0x54'))){_0x310b78[_0xcbfc('0x19')]=qs['limit'](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x19')]);_0x310b78[_0xcbfc('0x1b')]=qs[_0xcbfc('0x1b')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x1b')]);}_0x310b78[_0xcbfc('0x39')]=qs[_0xcbfc('0x3a')](_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3a')]);_0x310b78['where']=qs[_0xcbfc('0x33')](_[_0xcbfc('0x3c')](_0x4d2df1['query'],_0x34ec1d[_0xcbfc('0x33')]));if(_0x4d2df1['query']['filter']){_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'$or':_[_0xcbfc('0x2b')](_0x310b78[_0xcbfc('0x34')],function(_0x4d8d2a){var _0x53babd={};_0x53babd[_0x4d8d2a]={'$like':'%'+_0x4d2df1[_0xcbfc('0x32')][_0xcbfc('0x3d')]+'%'};return _0x53babd;})});}_0x310b78[_0xcbfc('0x3b')]=_[_0xcbfc('0x3e')](_0x310b78[_0xcbfc('0x3b')],{'mailboxuser':_0x3b526f['mailbox']});_0x310b78=_[_0xcbfc('0x3e')]({},_0x310b78,_0x4d2df1[_0xcbfc('0x40')]);return db[_0xcbfc('0x55')]['findAndCountAll'](_0x310b78)['then'](respondWithFilteredResult(_0x9e0c38,_0x310b78));})['catch'](handleError(_0x9e0c38,null));};
\ No newline at end of file
index 0b51998..ae3cb2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb22a=['moment','bluebird','request-promise','path','rimraf','exports','VoiceMail','mailbox_context','mailbox','context','lodash','util','api'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0xb22a,0xb3));var _0xab22=function(_0x427217,_0x4039b1){_0x427217=_0x427217-0x0;var _0x5b28fb=_0xb22a[_0x427217];return _0x5b28fb;};'use strict';var _=require(_0xab22('0x0'));var util=require(_0xab22('0x1'));var logger=require('../../config/logger')(_0xab22('0x2'));var moment=require(_0xab22('0x3'));var BPromise=require(_0xab22('0x4'));var rp=require(_0xab22('0x5'));var fs=require('fs');var path=require(_0xab22('0x6'));var rimraf=require(_0xab22('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0xab22('0x8')]=function(_0x49a00b,_0x109d0a){return _0x49a00b['define'](_0xab22('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xab22('0xa'),'fields':[_0xab22('0xb'),_0xab22('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x16ce=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox','context','lodash','util'];(function(_0x2179f1,_0x21c653){var _0x176ec9=function(_0x4c4a4c){while(--_0x4c4a4c){_0x2179f1['push'](_0x2179f1['shift']());}};_0x176ec9(++_0x21c653);}(_0x16ce,0x1e8));var _0xe16c=function(_0x35bd1e,_0x3d9fd3){_0x35bd1e=_0x35bd1e-0x0;var _0x5e1918=_0x16ce[_0x35bd1e];return _0x5e1918;};'use strict';var _=require(_0xe16c('0x0'));var util=require(_0xe16c('0x1'));var logger=require(_0xe16c('0x2'))(_0xe16c('0x3'));var moment=require(_0xe16c('0x4'));var BPromise=require(_0xe16c('0x5'));var rp=require(_0xe16c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe16c('0x7'));var attributes=require(_0xe16c('0x8'));module[_0xe16c('0x9')]=function(_0x325233,_0x8d4374){return _0x325233[_0xe16c('0xa')](_0xe16c('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xe16c('0xc'),_0xe16c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 6875b46..99fa912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5543=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x3aa235,_0x27a45a){var _0x17f250=function(_0x4b9d34){while(--_0x4b9d34){_0x3aa235['push'](_0x3aa235['shift']());}};_0x17f250(++_0x27a45a);}(_0x5543,0xce));var _0x3554=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x5543[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0x3554('0x0'));var util=require(_0x3554('0x1'));var moment=require('moment');var BPromise=require(_0x3554('0x2'));var rs=require(_0x3554('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3554('0x4'))['db'];var utils=require(_0x3554('0x5'));var logger=require(_0x3554('0x6'))('rpc');var config=require(_0x3554('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45d500,_0x3d3d05,_0x5efb8a){return new BPromise(function(_0x2faa79,_0x5bf3c6){return client[_0x3554('0x8')](_0x45d500,_0x5efb8a)['then'](function(_0x10d216){logger[_0x3554('0x9')](_0x3554('0xa'),_0x3d3d05,_0x3554('0xb'));logger[_0x3554('0xc')](_0x3554('0xd'),_0x3d3d05,'request\x20sent',JSON[_0x3554('0xe')](_0x10d216));if(_0x10d216[_0x3554('0xf')]){if(_0x10d216[_0x3554('0xf')][_0x3554('0x10')]===0x1f4){logger[_0x3554('0xf')](_0x3554('0xa'),_0x3d3d05,_0x10d216[_0x3554('0xf')]['message']);return _0x5bf3c6(_0x10d216['error'][_0x3554('0x11')]);}logger[_0x3554('0xf')](_0x3554('0xa'),_0x3d3d05,_0x10d216[_0x3554('0xf')][_0x3554('0x11')]);return _0x2faa79(_0x10d216[_0x3554('0xf')][_0x3554('0x11')]);}else{logger[_0x3554('0x9')](_0x3554('0xa'),_0x3d3d05,'request\x20sent');_0x2faa79(_0x10d216[_0x3554('0x12')][_0x3554('0x11')]);}})[_0x3554('0x13')](function(_0x3f9e2a){logger[_0x3554('0xf')]('VoiceMail,\x20%s,\x20%s',_0x3d3d05,_0x3f9e2a);_0x5bf3c6(_0x3f9e2a);});});}
\ No newline at end of file
+var _0xbcd3=['request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xbcd3,0x1ef));var _0x3bcd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbcd3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3bcd('0x0'));var util=require(_0x3bcd('0x1'));var moment=require(_0x3bcd('0x2'));var BPromise=require(_0x3bcd('0x3'));var rs=require(_0x3bcd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3bcd('0x5'));var logger=require(_0x3bcd('0x6'))(_0x3bcd('0x7'));var config=require('../../config/environment');var jayson=require(_0x3bcd('0x8'));var client=jayson[_0x3bcd('0x9')][_0x3bcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfc5462,_0x4053b9,_0x53ecca){return new BPromise(function(_0x3ea339,_0x2fd8d1){return client[_0x3bcd('0xb')](_0xfc5462,_0x53ecca)[_0x3bcd('0xc')](function(_0x2e31e1){logger[_0x3bcd('0xd')](_0x3bcd('0xe'),_0x4053b9,_0x3bcd('0xf'));logger[_0x3bcd('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4053b9,'request\x20sent',JSON[_0x3bcd('0x11')](_0x2e31e1));if(_0x2e31e1[_0x3bcd('0x12')]){if(_0x2e31e1[_0x3bcd('0x12')][_0x3bcd('0x13')]===0x1f4){logger[_0x3bcd('0x12')](_0x3bcd('0xe'),_0x4053b9,_0x2e31e1[_0x3bcd('0x12')]['message']);return _0x2fd8d1(_0x2e31e1[_0x3bcd('0x12')][_0x3bcd('0x14')]);}logger['error'](_0x3bcd('0xe'),_0x4053b9,_0x2e31e1[_0x3bcd('0x12')]['message']);return _0x3ea339(_0x2e31e1[_0x3bcd('0x12')]['message']);}else{logger[_0x3bcd('0xd')](_0x3bcd('0xe'),_0x4053b9,'request\x20sent');_0x3ea339(_0x2e31e1[_0x3bcd('0x15')][_0x3bcd('0x14')]);}})[_0x3bcd('0x16')](function(_0x3d5e81){logger[_0x3bcd('0x12')](_0x3bcd('0xe'),_0x4053b9,_0x3d5e81);_0x2fd8d1(_0x3d5e81);});});}
\ No newline at end of file
index 259c91f..0496454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9476=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','index','show','get','/:id/download','isAuthenticated','download','post','create','put','/:id','update','delete'];(function(_0x43ec99,_0x376c5){var _0x25b9c8=function(_0x5ade84){while(--_0x5ade84){_0x43ec99['push'](_0x43ec99['shift']());}};_0x25b9c8(++_0x376c5);}(_0x9476,0x80));var _0x6947=function(_0x1aae2e,_0x449ce2){_0x1aae2e=_0x1aae2e-0x0;var _0x25fc7d=_0x9476[_0x1aae2e];return _0x25fc7d;};'use strict';var multer=require(_0x6947('0x0'));var util=require(_0x6947('0x1'));var path=require('path');var timeout=require(_0x6947('0x2'));var express=require('express');var router=express[_0x6947('0x3')]();var fs_extra=require(_0x6947('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6947('0x5'));var controller=require(_0x6947('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6947('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6947('0x8')]);router[_0x6947('0x9')](_0x6947('0xa'),auth[_0x6947('0xb')](),controller[_0x6947('0xc')]);router[_0x6947('0xd')]('/',auth[_0x6947('0xb')](),controller[_0x6947('0xe')]);router[_0x6947('0xf')](_0x6947('0x10'),auth[_0x6947('0xb')](),controller[_0x6947('0x11')]);router[_0x6947('0x12')](_0x6947('0x10'),auth[_0x6947('0xb')](),controller[_0x6947('0x13')]);module[_0x6947('0x14')]=router;
\ No newline at end of file
+var _0x7a6b=['index','get','/:id','/:id/download','download','post','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated'];(function(_0x45ab89,_0x3a1cd3){var _0x50d552=function(_0x26e645){while(--_0x26e645){_0x45ab89['push'](_0x45ab89['shift']());}};_0x50d552(++_0x3a1cd3);}(_0x7a6b,0xcf));var _0xb7a6=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x7a6b[_0x284a61];return _0x220e3c;};'use strict';var multer=require(_0xb7a6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb7a6('0x1'));var express=require('express');var router=express[_0xb7a6('0x2')]();var fs_extra=require(_0xb7a6('0x3'));var auth=require(_0xb7a6('0x4'));var interaction=require(_0xb7a6('0x5'));var config=require(_0xb7a6('0x6'));var controller=require(_0xb7a6('0x7'));router['get']('/',auth[_0xb7a6('0x8')](),controller[_0xb7a6('0x9')]);router[_0xb7a6('0xa')](_0xb7a6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb7a6('0xa')](_0xb7a6('0xc'),auth[_0xb7a6('0x8')](),controller[_0xb7a6('0xd')]);router[_0xb7a6('0xe')]('/',auth[_0xb7a6('0x8')](),controller['create']);router['put']('/:id',auth[_0xb7a6('0x8')](),controller['update']);router[_0xb7a6('0xf')](_0xb7a6('0xb'),auth[_0xb7a6('0x8')](),controller[_0xb7a6('0x10')]);module[_0xb7a6('0x11')]=router;
\ No newline at end of file
index d2926ad..7015c12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc6a=['VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x2533cd,_0x5dd3ae){var _0x4a0cd4=function(_0x262431){while(--_0x262431){_0x2533cd['push'](_0x2533cd['shift']());}};_0x4a0cd4(++_0x5dd3ae);}(_0xbc6a,0x180));var _0xabc6=function(_0x29e7eb,_0x232f12){_0x29e7eb=_0x29e7eb-0x0;var _0x5774e1=_0xbc6a[_0x29e7eb];return _0x5774e1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xabc6('0x0')],'get':function(_0x407d7a){return this[_0xabc6('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xabc6('0x3')](_0xabc6('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xabc6('0x2')],'defaultValue':''},'stamp':{'type':_0xabc6('0x5'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0x548b=['BLOB','long','TIMESTAMP','literal','getDataValue','INTEGER','STRING'];(function(_0x266918,_0x4c0786){var _0x4b13e4=function(_0x561b88){while(--_0x561b88){_0x266918['push'](_0x266918['shift']());}};_0x4b13e4(++_0x4c0786);}(_0x548b,0x193));var _0xb548=function(_0x4a41f8,_0x21d781){_0x4a41f8=_0x4a41f8-0x0;var _0xafc177=_0x548b[_0x4a41f8];return _0xafc177;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x46c9df){return this[_0xb548('0x0')]('id');}},'msgnum':{'type':Sequelize[_0xb548('0x1')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0xb548('0x3')](_0xb548('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xb548('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xb548('0x5'),'defaultValue':Sequelize[_0xb548('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index b72afc0..1abfd43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27b5=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','fast-json-patch'];(function(_0x4a5aa8,_0x31a125){var _0x2ae85b=function(_0x4a5423){while(--_0x4a5423){_0x4a5aa8['push'](_0x4a5aa8['shift']());}};_0x2ae85b(++_0x31a125);}(_0x27b5,0x1f0));var _0x527b=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x27b5[_0x1646fa];return _0x5a47a5;};'use strict';var emlformat=require(_0x527b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x527b('0x1'));var rp=require(_0x527b('0x2'));var moment=require(_0x527b('0x3'));var BPromise=require(_0x527b('0x4'));var Mustache=require(_0x527b('0x5'));var util=require(_0x527b('0x6'));var path=require('path');var sox=require(_0x527b('0x7'));var csv=require(_0x527b('0x8'));var ejs=require(_0x527b('0x9'));var fs=require('fs');var fs_extra=require(_0x527b('0xa'));var _=require('lodash');var squel=require(_0x527b('0xb'));var crypto=require(_0x527b('0xc'));var jsforce=require(_0x527b('0xd'));var deskjs=require(_0x527b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x527b('0xf'));var Redis=require('ioredis');var authService=require(_0x527b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x527b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x527b('0x12'))(_0x527b('0x13'));var utils=require('../../config/utils');var config=require(_0x527b('0x14'));var licenseUtil=require(_0x527b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ff46,_0x2cb221){_0x2cb221=_0x2cb221||0xcc;return function(_0x3bbf84){if(_0x3bbf84){return _0x28ff46[_0x527b('0x16')](_0x2cb221);}return _0x28ff46[_0x527b('0x17')](_0x2cb221)['end']();};}function respondWithResult(_0x524ffc,_0x2ef8c1){_0x2ef8c1=_0x2ef8c1||0xc8;return function(_0x27e910){if(_0x27e910){return _0x524ffc[_0x527b('0x17')](_0x2ef8c1)[_0x527b('0x18')](_0x27e910);}};}function respondWithFilteredResult(_0x2dd235,_0x3e35b9){return function(_0x1c3b74){if(_0x1c3b74){var _0x4f83bc=typeof _0x3e35b9[_0x527b('0x19')]===_0x527b('0x1a')&&typeof _0x3e35b9[_0x527b('0x1b')]===_0x527b('0x1a');var _0x432d48=_0x1c3b74['count'];var _0x333e67=_0x4f83bc?0x0:_0x3e35b9[_0x527b('0x19')];var _0x5a10d8=_0x4f83bc?_0x1c3b74[_0x527b('0x1c')]:_0x3e35b9[_0x527b('0x19')]+_0x3e35b9[_0x527b('0x1b')];var _0x181c17;if(_0x5a10d8>=_0x432d48){_0x5a10d8=_0x432d48;_0x181c17=0xc8;}else{_0x181c17=0xce;}_0x2dd235[_0x527b('0x17')](_0x181c17);return _0x2dd235[_0x527b('0x1d')]('Content-Range',_0x333e67+'-'+_0x5a10d8+'/'+_0x432d48)[_0x527b('0x18')](_0x1c3b74);}return null;};}function patchUpdates(_0x510853){return function(_0x4a0ef7){try{jsonpatch[_0x527b('0x1e')](_0x4a0ef7,_0x510853,!![]);}catch(_0x3456e8){return BPromise[_0x527b('0x1f')](_0x3456e8);}return _0x4a0ef7[_0x527b('0x20')]();};}function saveUpdates(_0x5b07e2,_0x13c1e9){return function(_0x1798fa){if(_0x1798fa){return _0x1798fa[_0x527b('0x21')](_0x5b07e2)[_0x527b('0x22')](function(_0x1fc338){return _0x1fc338;});}return null;};}function removeEntity(_0x34dfc1,_0x5d923d){return function(_0x29c569){if(_0x29c569){return _0x29c569['destroy']()['then'](function(){_0x34dfc1['status'](0xcc)[_0x527b('0x23')]();});}};}function handleEntityNotFound(_0x49eb54,_0x448859){return function(_0x29a881){if(!_0x29a881){_0x49eb54[_0x527b('0x16')](0x194);}return _0x29a881;};}function handleError(_0x3ac34d,_0x25670f){_0x25670f=_0x25670f||0x1f4;return function(_0x2ed3c0){logger[_0x527b('0x24')](_0x2ed3c0[_0x527b('0x25')]);if(_0x2ed3c0[_0x527b('0x26')]){delete _0x2ed3c0[_0x527b('0x26')];}_0x3ac34d[_0x527b('0x17')](_0x25670f)[_0x527b('0x27')](_0x2ed3c0);};}exports[_0x527b('0x28')]=function(_0x4df3e5,_0x14e822){var _0x245da4={},_0x2311dd={},_0x4ad1c1={'count':0x0,'rows':[]};var _0x3a42ed=_[_0x527b('0x29')](db[_0x527b('0x2a')][_0x527b('0x2b')],function(_0x716fe9){return{'name':_0x716fe9[_0x527b('0x2c')],'type':_0x716fe9[_0x527b('0x2d')][_0x527b('0x2e')]};});_0x2311dd[_0x527b('0x2f')]=_['differenceBy'](_[_0x527b('0x29')](_0x3a42ed,_0x527b('0x26')),[_0x527b('0x26')]);_0x2311dd[_0x527b('0x30')]=_[_0x527b('0x31')](_0x4df3e5['query']);_0x2311dd[_0x527b('0x32')]=_[_0x527b('0x33')](_0x2311dd[_0x527b('0x2f')],_0x2311dd[_0x527b('0x30')]);_0x245da4[_0x527b('0x34')]=_[_0x527b('0x33')](_0x2311dd['model'],qs['fields'](_0x4df3e5[_0x527b('0x30')][_0x527b('0x35')]));_0x245da4[_0x527b('0x34')]=_0x245da4[_0x527b('0x34')]['length']?_0x245da4[_0x527b('0x34')]:_0x2311dd['model'];if(!_0x4df3e5['query'][_0x527b('0x36')](_0x527b('0x37'))){_0x245da4['limit']=qs['limit'](_0x4df3e5[_0x527b('0x30')]['limit']);_0x245da4[_0x527b('0x19')]=qs['offset'](_0x4df3e5['query'][_0x527b('0x19')]);}_0x245da4[_0x527b('0x38')]=qs['sort'](_0x4df3e5[_0x527b('0x30')][_0x527b('0x39')]);_0x245da4['where']=qs['filters'](_['pick'](_0x4df3e5[_0x527b('0x30')],_0x2311dd[_0x527b('0x32')]),_0x3a42ed);if(_0x4df3e5[_0x527b('0x30')][_0x527b('0x3a')]){_0x245da4[_0x527b('0x3b')]=_[_0x527b('0x3c')](_0x245da4[_0x527b('0x3b')],{'$or':_['map'](_0x3a42ed,function(_0x53a8bc){if(_0x53a8bc['type']!==_0x527b('0x3d')){var _0x40f546={};_0x40f546[_0x53a8bc[_0x527b('0x26')]]={'$like':'%'+_0x4df3e5['query'][_0x527b('0x3a')]+'%'};return _0x40f546;}})});}_0x245da4=_[_0x527b('0x3c')]({},_0x245da4,_0x4df3e5[_0x527b('0x3e')]);var _0x50c8f5={'where':_0x245da4['where']};return db[_0x527b('0x2a')][_0x527b('0x1c')](_0x50c8f5)[_0x527b('0x22')](function(_0x496219){_0x4ad1c1[_0x527b('0x1c')]=_0x496219;if(_0x4df3e5[_0x527b('0x30')][_0x527b('0x3f')]){_0x245da4[_0x527b('0x40')]=[{'all':!![]}];}return db[_0x527b('0x2a')][_0x527b('0x41')](_0x245da4);})['then'](function(_0x41f1b2){_0x4ad1c1[_0x527b('0x42')]=_0x41f1b2;return _0x4ad1c1;})['then'](respondWithFilteredResult(_0x14e822,_0x245da4))[_0x527b('0x43')](handleError(_0x14e822,null));};exports[_0x527b('0x44')]=function(_0xe2d6cf,_0x4f3f93){var _0xc9a1d9={'raw':!![],'where':{'id':_0xe2d6cf[_0x527b('0x45')]['id']}},_0x2844b1={};_0x2844b1[_0x527b('0x2f')]=_[_0x527b('0x31')](db['VoiceMailMessage']['rawAttributes']);_0x2844b1[_0x527b('0x30')]=_['keys'](_0xe2d6cf[_0x527b('0x30')]);_0x2844b1[_0x527b('0x32')]=_['intersection'](_0x2844b1['model'],_0x2844b1[_0x527b('0x30')]);_0xc9a1d9['attributes']=_[_0x527b('0x33')](_0x2844b1[_0x527b('0x2f')],qs['fields'](_0xe2d6cf[_0x527b('0x30')][_0x527b('0x35')]));_0xc9a1d9['attributes']=_0xc9a1d9[_0x527b('0x34')][_0x527b('0x46')]?_0xc9a1d9[_0x527b('0x34')]:_0x2844b1[_0x527b('0x2f')];if(_0xe2d6cf[_0x527b('0x30')][_0x527b('0x3f')]){_0xc9a1d9['include']=[{'all':!![]}];}_0xc9a1d9=_['merge']({},_0xc9a1d9,_0xe2d6cf[_0x527b('0x3e')]);return db['VoiceMailMessage'][_0x527b('0x47')](_0xc9a1d9)[_0x527b('0x22')](handleEntityNotFound(_0x4f3f93,null))[_0x527b('0x22')](respondWithResult(_0x4f3f93,null))['catch'](handleError(_0x4f3f93,null));};exports[_0x527b('0x48')]=function(_0x2c03c6,_0x1e97d6){return db[_0x527b('0x2a')]['create'](_0x2c03c6[_0x527b('0x49')],{})[_0x527b('0x22')](respondWithResult(_0x1e97d6,0xc9))[_0x527b('0x43')](handleError(_0x1e97d6,null));};exports[_0x527b('0x21')]=function(_0x1b622e,_0x329deb){if(_0x1b622e[_0x527b('0x49')]['id']){delete _0x1b622e[_0x527b('0x49')]['id'];}return db[_0x527b('0x2a')][_0x527b('0x47')]({'where':{'id':_0x1b622e[_0x527b('0x45')]['id']}})[_0x527b('0x22')](handleEntityNotFound(_0x329deb,null))['then'](saveUpdates(_0x1b622e['body'],null))[_0x527b('0x22')](respondWithResult(_0x329deb,null))[_0x527b('0x43')](handleError(_0x329deb,null));};exports['destroy']=function(_0xf50926,_0x2c3f8d){return db[_0x527b('0x2a')][_0x527b('0x47')]({'where':{'id':_0xf50926[_0x527b('0x45')]['id']}})[_0x527b('0x22')](handleEntityNotFound(_0x2c3f8d,null))['then'](removeEntity(_0x2c3f8d,null))[_0x527b('0x43')](handleError(_0x2c3f8d,null));};exports[_0x527b('0x4a')]=function(_0x641a67,_0x17bc3d,_0x13abfb){return db[_0x527b('0x2a')]['find']({'where':{'id':_0x641a67[_0x527b('0x45')]['id']},'attributes':['id',_0x527b('0x4b'),'msg_id']})[_0x527b('0x22')](handleEntityNotFound(_0x17bc3d,null))[_0x527b('0x22')](function(_0x1fa28b){if(_0x1fa28b){if(!_0x1fa28b[_0x527b('0x4b')]){throw new db[(_0x527b('0x4c'))][(_0x527b('0x4d'))](_0x527b('0x4e'));}var _0xe652e={'Content-Type':_0x527b('0x4f'),'Content-Disposition':_0x527b('0x50')};if(_0x1fa28b['msg_id']){_0xe652e[_0x527b('0x51')]=_0x527b('0x52')+_0x1fa28b['msg_id']+'.wav\x22';}_0x17bc3d[_0x527b('0x1d')](_0xe652e);return _0x17bc3d['send'](new Buffer(_0x1fa28b[_0x527b('0x4b')]));}})[_0x527b('0x43')](handleError(_0x17bc3d,null));};
\ No newline at end of file
+var _0xbf1c=['offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','show','params','keys','intersection','catch','create','body','find','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','set','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbf1c,0x18d));var _0xcbf1=function(_0x1fe097,_0x44a921){_0x1fe097=_0x1fe097-0x0;var _0x2edbb7=_0xbf1c[_0x1fe097];return _0x2edbb7;};'use strict';var emlformat=require(_0xcbf1('0x0'));var rimraf=require(_0xcbf1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcbf1('0x2'));var rp=require('request-promise');var moment=require(_0xcbf1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcbf1('0x4'));var util=require(_0xcbf1('0x5'));var path=require(_0xcbf1('0x6'));var sox=require(_0xcbf1('0x7'));var csv=require(_0xcbf1('0x8'));var ejs=require(_0xcbf1('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf1('0xa'));var _=require(_0xcbf1('0xb'));var squel=require(_0xcbf1('0xc'));var crypto=require(_0xcbf1('0xd'));var jsforce=require(_0xcbf1('0xe'));var deskjs=require(_0xcbf1('0xf'));var toCsv=require(_0xcbf1('0x8'));var querystring=require('querystring');var Papa=require(_0xcbf1('0x10'));var Redis=require(_0xcbf1('0x11'));var authService=require(_0xcbf1('0x12'));var qs=require(_0xcbf1('0x13'));var as=require(_0xcbf1('0x14'));var hardwareService=require(_0xcbf1('0x15'));var logger=require(_0xcbf1('0x16'))(_0xcbf1('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcbf1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb7e6e1,_0x55e1bc){_0x55e1bc=_0x55e1bc||0xcc;return function(_0xddb302){if(_0xddb302){return _0xb7e6e1[_0xcbf1('0x19')](_0x55e1bc);}return _0xb7e6e1[_0xcbf1('0x1a')](_0x55e1bc)[_0xcbf1('0x1b')]();};}function respondWithResult(_0x5d853c,_0x4b8a71){_0x4b8a71=_0x4b8a71||0xc8;return function(_0x434cee){if(_0x434cee){return _0x5d853c[_0xcbf1('0x1a')](_0x4b8a71)['json'](_0x434cee);}};}function respondWithFilteredResult(_0x1c8023,_0x3bcc4f){return function(_0x20ef77){if(_0x20ef77){var _0x8306f1=typeof _0x3bcc4f[_0xcbf1('0x1c')]===_0xcbf1('0x1d')&&typeof _0x3bcc4f[_0xcbf1('0x1e')]==='undefined';var _0x128e1d=_0x20ef77[_0xcbf1('0x1f')];var _0x2ba6ec=_0x8306f1?0x0:_0x3bcc4f[_0xcbf1('0x1c')];var _0x3c60f5=_0x8306f1?_0x20ef77[_0xcbf1('0x1f')]:_0x3bcc4f['offset']+_0x3bcc4f[_0xcbf1('0x1e')];var _0x15f797;if(_0x3c60f5>=_0x128e1d){_0x3c60f5=_0x128e1d;_0x15f797=0xc8;}else{_0x15f797=0xce;}_0x1c8023[_0xcbf1('0x1a')](_0x15f797);return _0x1c8023['set']('Content-Range',_0x2ba6ec+'-'+_0x3c60f5+'/'+_0x128e1d)['json'](_0x20ef77);}return null;};}function patchUpdates(_0x736e6b){return function(_0x1ab49e){try{jsonpatch[_0xcbf1('0x20')](_0x1ab49e,_0x736e6b,!![]);}catch(_0x519650){return BPromise[_0xcbf1('0x21')](_0x519650);}return _0x1ab49e['save']();};}function saveUpdates(_0x4c9e88,_0x1c6517){return function(_0x51aeba){if(_0x51aeba){return _0x51aeba[_0xcbf1('0x22')](_0x4c9e88)[_0xcbf1('0x23')](function(_0x3b1e91){return _0x3b1e91;});}return null;};}function removeEntity(_0x5a6122,_0x5bb846){return function(_0x895681){if(_0x895681){return _0x895681[_0xcbf1('0x24')]()[_0xcbf1('0x23')](function(){_0x5a6122[_0xcbf1('0x1a')](0xcc)[_0xcbf1('0x1b')]();});}};}function handleEntityNotFound(_0x687391,_0x225c9c){return function(_0x29702d){if(!_0x29702d){_0x687391[_0xcbf1('0x19')](0x194);}return _0x29702d;};}function handleError(_0x44db76,_0x3f1810){_0x3f1810=_0x3f1810||0x1f4;return function(_0x4bd5b1){logger[_0xcbf1('0x25')](_0x4bd5b1[_0xcbf1('0x26')]);if(_0x4bd5b1[_0xcbf1('0x27')]){delete _0x4bd5b1[_0xcbf1('0x27')];}_0x44db76[_0xcbf1('0x1a')](_0x3f1810)[_0xcbf1('0x28')](_0x4bd5b1);};}exports[_0xcbf1('0x29')]=function(_0x878178,_0x465d82){var _0x4ee080={},_0x345817={},_0x5eda77={'count':0x0,'rows':[]};var _0x299013=_[_0xcbf1('0x2a')](db['VoiceMailMessage'][_0xcbf1('0x2b')],function(_0x43e6e3){return{'name':_0x43e6e3[_0xcbf1('0x2c')],'type':_0x43e6e3[_0xcbf1('0x2d')][_0xcbf1('0x2e')]};});_0x345817[_0xcbf1('0x2f')]=_[_0xcbf1('0x30')](_[_0xcbf1('0x2a')](_0x299013,_0xcbf1('0x27')),[_0xcbf1('0x27')]);_0x345817[_0xcbf1('0x31')]=_['keys'](_0x878178[_0xcbf1('0x31')]);_0x345817[_0xcbf1('0x32')]=_['intersection'](_0x345817[_0xcbf1('0x2f')],_0x345817[_0xcbf1('0x31')]);_0x4ee080[_0xcbf1('0x33')]=_['intersection'](_0x345817[_0xcbf1('0x2f')],qs[_0xcbf1('0x34')](_0x878178[_0xcbf1('0x31')][_0xcbf1('0x34')]));_0x4ee080[_0xcbf1('0x33')]=_0x4ee080[_0xcbf1('0x33')][_0xcbf1('0x35')]?_0x4ee080[_0xcbf1('0x33')]:_0x345817['model'];if(!_0x878178[_0xcbf1('0x31')][_0xcbf1('0x36')](_0xcbf1('0x37'))){_0x4ee080['limit']=qs[_0xcbf1('0x1e')](_0x878178[_0xcbf1('0x31')][_0xcbf1('0x1e')]);_0x4ee080['offset']=qs[_0xcbf1('0x1c')](_0x878178[_0xcbf1('0x31')][_0xcbf1('0x1c')]);}_0x4ee080[_0xcbf1('0x38')]=qs[_0xcbf1('0x39')](_0x878178[_0xcbf1('0x31')][_0xcbf1('0x39')]);_0x4ee080['where']=qs['filters'](_[_0xcbf1('0x3a')](_0x878178[_0xcbf1('0x31')],_0x345817[_0xcbf1('0x32')]),_0x299013);if(_0x878178['query'][_0xcbf1('0x3b')]){_0x4ee080[_0xcbf1('0x3c')]=_[_0xcbf1('0x3d')](_0x4ee080[_0xcbf1('0x3c')],{'$or':_[_0xcbf1('0x2a')](_0x299013,function(_0x3cfabb){if(_0x3cfabb[_0xcbf1('0x2d')]!==_0xcbf1('0x3e')){var _0x52ecf2={};_0x52ecf2[_0x3cfabb[_0xcbf1('0x27')]]={'$like':'%'+_0x878178['query'][_0xcbf1('0x3b')]+'%'};return _0x52ecf2;}})});}_0x4ee080=_[_0xcbf1('0x3d')]({},_0x4ee080,_0x878178[_0xcbf1('0x3f')]);var _0x379a17={'where':_0x4ee080[_0xcbf1('0x3c')]};return db[_0xcbf1('0x40')][_0xcbf1('0x1f')](_0x379a17)[_0xcbf1('0x23')](function(_0x467915){_0x5eda77[_0xcbf1('0x1f')]=_0x467915;if(_0x878178[_0xcbf1('0x31')][_0xcbf1('0x41')]){_0x4ee080[_0xcbf1('0x42')]=[{'all':!![]}];}return db[_0xcbf1('0x40')][_0xcbf1('0x43')](_0x4ee080);})[_0xcbf1('0x23')](function(_0x5e33a5){_0x5eda77[_0xcbf1('0x44')]=_0x5e33a5;return _0x5eda77;})['then'](respondWithFilteredResult(_0x465d82,_0x4ee080))['catch'](handleError(_0x465d82,null));};exports[_0xcbf1('0x45')]=function(_0x2613b4,_0x4b0d88){var _0x544da7={'raw':!![],'where':{'id':_0x2613b4[_0xcbf1('0x46')]['id']}},_0x4bdd47={};_0x4bdd47[_0xcbf1('0x2f')]=_[_0xcbf1('0x47')](db[_0xcbf1('0x40')][_0xcbf1('0x2b')]);_0x4bdd47[_0xcbf1('0x31')]=_[_0xcbf1('0x47')](_0x2613b4[_0xcbf1('0x31')]);_0x4bdd47[_0xcbf1('0x32')]=_[_0xcbf1('0x48')](_0x4bdd47['model'],_0x4bdd47[_0xcbf1('0x31')]);_0x544da7[_0xcbf1('0x33')]=_[_0xcbf1('0x48')](_0x4bdd47[_0xcbf1('0x2f')],qs[_0xcbf1('0x34')](_0x2613b4[_0xcbf1('0x31')][_0xcbf1('0x34')]));_0x544da7['attributes']=_0x544da7['attributes']['length']?_0x544da7['attributes']:_0x4bdd47['model'];if(_0x2613b4[_0xcbf1('0x31')][_0xcbf1('0x41')]){_0x544da7[_0xcbf1('0x42')]=[{'all':!![]}];}_0x544da7=_[_0xcbf1('0x3d')]({},_0x544da7,_0x2613b4[_0xcbf1('0x3f')]);return db[_0xcbf1('0x40')]['find'](_0x544da7)[_0xcbf1('0x23')](handleEntityNotFound(_0x4b0d88,null))[_0xcbf1('0x23')](respondWithResult(_0x4b0d88,null))[_0xcbf1('0x49')](handleError(_0x4b0d88,null));};exports[_0xcbf1('0x4a')]=function(_0x59f2dc,_0x4ee695){return db[_0xcbf1('0x40')][_0xcbf1('0x4a')](_0x59f2dc[_0xcbf1('0x4b')],{})[_0xcbf1('0x23')](respondWithResult(_0x4ee695,0xc9))['catch'](handleError(_0x4ee695,null));};exports[_0xcbf1('0x22')]=function(_0x38de1b,_0x276977){if(_0x38de1b['body']['id']){delete _0x38de1b[_0xcbf1('0x4b')]['id'];}return db['VoiceMailMessage'][_0xcbf1('0x4c')]({'where':{'id':_0x38de1b[_0xcbf1('0x46')]['id']}})[_0xcbf1('0x23')](handleEntityNotFound(_0x276977,null))[_0xcbf1('0x23')](saveUpdates(_0x38de1b[_0xcbf1('0x4b')],null))['then'](respondWithResult(_0x276977,null))[_0xcbf1('0x49')](handleError(_0x276977,null));};exports[_0xcbf1('0x24')]=function(_0x5d4cac,_0x4c29e4){return db[_0xcbf1('0x40')][_0xcbf1('0x4c')]({'where':{'id':_0x5d4cac[_0xcbf1('0x46')]['id']}})[_0xcbf1('0x23')](handleEntityNotFound(_0x4c29e4,null))[_0xcbf1('0x23')](removeEntity(_0x4c29e4,null))[_0xcbf1('0x49')](handleError(_0x4c29e4,null));};exports[_0xcbf1('0x4d')]=function(_0x42b1f7,_0x55eb52,_0x2b3534){return db[_0xcbf1('0x40')][_0xcbf1('0x4c')]({'where':{'id':_0x42b1f7['params']['id']},'attributes':['id',_0xcbf1('0x4e'),_0xcbf1('0x4f')]})[_0xcbf1('0x23')](handleEntityNotFound(_0x55eb52,null))[_0xcbf1('0x23')](function(_0x1f5c5f){if(_0x1f5c5f){if(!_0x1f5c5f[_0xcbf1('0x4e')]){throw new db[(_0xcbf1('0x50'))]['ValidationError'](_0xcbf1('0x51'));}var _0x5c39f5={'Content-Type':_0xcbf1('0x52'),'Content-Disposition':'attachment'};if(_0x1f5c5f[_0xcbf1('0x4f')]){_0x5c39f5[_0xcbf1('0x53')]='attachment;\x20filename=\x22'+_0x1f5c5f[_0xcbf1('0x4f')]+'.wav\x22';}_0x55eb52[_0xcbf1('0x54')](_0x5c39f5);return _0x55eb52['send'](new Buffer(_0x1f5c5f[_0xcbf1('0x4e')]));}})[_0xcbf1('0x49')](handleError(_0x55eb52,null));};
\ No newline at end of file
index edf3e1a..1266d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe76d=['voice_voicemail_messages','dir','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage'];(function(_0x2fca03,_0x2b5ef5){var _0x6bd452=function(_0x5430b6){while(--_0x5430b6){_0x2fca03['push'](_0x2fca03['shift']());}};_0x6bd452(++_0x2b5ef5);}(_0xe76d,0x16a));var _0xde76=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xe76d[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xde76('0x0'));var util=require('util');var logger=require(_0xde76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xde76('0x2'));var rp=require(_0xde76('0x3'));var fs=require('fs');var path=require(_0xde76('0x4'));var rimraf=require(_0xde76('0x5'));var config=require(_0xde76('0x6'));var attributes=require(_0xde76('0x7'));module[_0xde76('0x8')]=function(_0x15a643,_0x1bf217){return _0x15a643['define'](_0xde76('0x9'),attributes,{'tableName':_0xde76('0xa'),'paranoid':![],'indexes':[{'name':_0xde76('0xb'),'fields':[_0xde76('0xb')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xe6c6=['../../config/environment','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x11b85a,_0x1d3c5a){var _0x5a45cb=function(_0x1a3f2d){while(--_0x1a3f2d){_0x11b85a['push'](_0x11b85a['shift']());}};_0x5a45cb(++_0x1d3c5a);}(_0xe6c6,0x19d));var _0x6e6c=function(_0x34559b,_0x42b8ed){_0x34559b=_0x34559b-0x0;var _0x517ca8=_0xe6c6[_0x34559b];return _0x517ca8;};'use strict';var _=require(_0x6e6c('0x0'));var util=require(_0x6e6c('0x1'));var logger=require(_0x6e6c('0x2'))(_0x6e6c('0x3'));var moment=require('moment');var BPromise=require(_0x6e6c('0x4'));var rp=require(_0x6e6c('0x5'));var fs=require('fs');var path=require(_0x6e6c('0x6'));var rimraf=require('rimraf');var config=require(_0x6e6c('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x6e6c('0x8')]=function(_0x1f53d2,_0x57219b){return _0x1f53d2[_0x6e6c('0x9')](_0x6e6c('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x6e6c('0xb'),'fields':[_0x6e6c('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index 6036064..f041d93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ac7=['client','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/environment'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x9ac7,0x9a));var _0x79ac=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9ac7[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x79ac('0x0'));var util=require('util');var moment=require(_0x79ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x79ac('0x2'));var fs=require('fs');var Redis=require(_0x79ac('0x3'));var db=require(_0x79ac('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x79ac('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x79ac('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f656c,_0x53578a,_0x194506){return new BPromise(function(_0x51876a,_0x45a7fd){return client[_0x79ac('0x7')](_0x2f656c,_0x194506)['then'](function(_0x44db39){logger['info'](_0x79ac('0x8'),_0x53578a,_0x79ac('0x9'));logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x53578a,_0x79ac('0x9'),JSON[_0x79ac('0xa')](_0x44db39));if(_0x44db39['error']){if(_0x44db39['error']['code']===0x1f4){logger[_0x79ac('0xb')](_0x79ac('0x8'),_0x53578a,_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);return _0x45a7fd(_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);}logger[_0x79ac('0xb')](_0x79ac('0x8'),_0x53578a,_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);return _0x51876a(_0x44db39[_0x79ac('0xb')][_0x79ac('0xc')]);}else{logger[_0x79ac('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x53578a,_0x79ac('0x9'));_0x51876a(_0x44db39[_0x79ac('0xe')]['message']);}})[_0x79ac('0xf')](function(_0x27f5e2){logger[_0x79ac('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x53578a,_0x27f5e2);_0x45a7fd(_0x27f5e2);});});}
\ No newline at end of file
+var _0x9d9d=['debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x4bbc7a,_0x1eb7a8){var _0x593e10=function(_0x358339){while(--_0x358339){_0x4bbc7a['push'](_0x4bbc7a['shift']());}};_0x593e10(++_0x1eb7a8);}(_0x9d9d,0xa8));var _0xd9d9=function(_0x213abb,_0x1ddb0c){_0x213abb=_0x213abb-0x0;var _0x2554c8=_0x9d9d[_0x213abb];return _0x2554c8;};'use strict';var _=require(_0xd9d9('0x0'));var util=require(_0xd9d9('0x1'));var moment=require(_0xd9d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9d9('0x3'));var fs=require('fs');var Redis=require(_0xd9d9('0x4'));var db=require(_0xd9d9('0x5'))['db'];var utils=require(_0xd9d9('0x6'));var logger=require(_0xd9d9('0x7'))(_0xd9d9('0x8'));var config=require(_0xd9d9('0x9'));var jayson=require(_0xd9d9('0xa'));var client=jayson[_0xd9d9('0xb')][_0xd9d9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x371509,_0x203b29,_0x5d203d){return new BPromise(function(_0x3bca70,_0x1d3af3){return client[_0xd9d9('0xd')](_0x371509,_0x5d203d)['then'](function(_0x46b76b){logger[_0xd9d9('0xe')](_0xd9d9('0xf'),_0x203b29,'request\x20sent');logger[_0xd9d9('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x203b29,_0xd9d9('0x11'),JSON[_0xd9d9('0x12')](_0x46b76b));if(_0x46b76b[_0xd9d9('0x13')]){if(_0x46b76b[_0xd9d9('0x13')]['code']===0x1f4){logger[_0xd9d9('0x13')](_0xd9d9('0xf'),_0x203b29,_0x46b76b[_0xd9d9('0x13')][_0xd9d9('0x14')]);return _0x1d3af3(_0x46b76b[_0xd9d9('0x13')][_0xd9d9('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x203b29,_0x46b76b[_0xd9d9('0x13')][_0xd9d9('0x14')]);return _0x3bca70(_0x46b76b[_0xd9d9('0x13')]['message']);}else{logger[_0xd9d9('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x203b29,_0xd9d9('0x11'));_0x3bca70(_0x46b76b[_0xd9d9('0x15')]['message']);}})[_0xd9d9('0x16')](function(_0x24904c){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x203b29,_0x24904c);_0x1d3af3(_0x24904c);});});}
\ No newline at end of file
index ad06001..7212473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4d0=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','util','connect-timeout','express','fs-extra'];(function(_0x31a2e5,_0x4515df){var _0x5ca3bb=function(_0x131983){while(--_0x131983){_0x31a2e5['push'](_0x31a2e5['shift']());}};_0x5ca3bb(++_0x4515df);}(_0xb4d0,0x176));var _0x0b4d=function(_0x2c8b13,_0x12aeb2){_0x2c8b13=_0x2c8b13-0x0;var _0x4df8a7=_0xb4d0[_0x2c8b13];return _0x4df8a7;};'use strict';var multer=require('multer');var util=require(_0x0b4d('0x0'));var path=require('path');var timeout=require(_0x0b4d('0x1'));var express=require(_0x0b4d('0x2'));var router=express['Router']();var fs_extra=require(_0x0b4d('0x3'));var auth=require(_0x0b4d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0b4d('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x0b4d('0x6')]('/',auth[_0x0b4d('0x7')](),controller[_0x0b4d('0x8')]);router['get'](_0x0b4d('0x9'),auth['isAuthenticated'](),controller[_0x0b4d('0xa')]);router[_0x0b4d('0x6')](_0x0b4d('0xb'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0b4d('0xd')]);router[_0x0b4d('0xe')](_0x0b4d('0xb'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0xf')]);router[_0x0b4d('0x10')](_0x0b4d('0x9'),auth[_0x0b4d('0x7')](),controller[_0x0b4d('0x11')]);router[_0x0b4d('0x12')](_0x0b4d('0x9'),auth['isAuthenticated'](),controller[_0x0b4d('0x13')]);router[_0x0b4d('0x12')](_0x0b4d('0x14'),auth['isAuthenticated'](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
+var _0x4e1d=['addSound','put','destroy','delete','/:id/sounds/:id2','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x4e1d,0x18c));var _0xd4e1=function(_0x5ea6d9,_0x4b5602){_0x5ea6d9=_0x5ea6d9-0x0;var _0x2036d7=_0x4e1d[_0x5ea6d9];return _0x2036d7;};'use strict';var multer=require(_0xd4e1('0x0'));var util=require('util');var path=require(_0xd4e1('0x1'));var timeout=require(_0xd4e1('0x2'));var express=require(_0xd4e1('0x3'));var router=express[_0xd4e1('0x4')]();var fs_extra=require(_0xd4e1('0x5'));var auth=require(_0xd4e1('0x6'));var interaction=require(_0xd4e1('0x7'));var config=require(_0xd4e1('0x8'));var controller=require(_0xd4e1('0x9'));router[_0xd4e1('0xa')]('/',auth[_0xd4e1('0xb')](),controller[_0xd4e1('0xc')]);router[_0xd4e1('0xa')](_0xd4e1('0xd'),auth[_0xd4e1('0xb')](),controller['show']);router[_0xd4e1('0xa')](_0xd4e1('0xe'),auth[_0xd4e1('0xb')](),controller[_0xd4e1('0xf')]);router[_0xd4e1('0x10')]('/',auth[_0xd4e1('0xb')](),controller[_0xd4e1('0x11')]);router[_0xd4e1('0x10')](_0xd4e1('0xe'),auth['isAuthenticated'](),controller[_0xd4e1('0x12')]);router[_0xd4e1('0x13')](_0xd4e1('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd4e1('0xb')](),controller[_0xd4e1('0x14')]);router[_0xd4e1('0x15')](_0xd4e1('0x16'),auth[_0xd4e1('0xb')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index c4fefe8..a195801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb30f=['STRING','name','custom','files','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP'];(function(_0x4f7d50,_0x2f7e5b){var _0x8c9db4=function(_0x22f0b9){while(--_0x22f0b9){_0x4f7d50['push'](_0x4f7d50['shift']());}};_0x8c9db4(++_0x2f7e5b);}(_0xb30f,0x195));var _0xfb30=function(_0x477310,_0x5a3209){_0x477310=_0x477310-0x0;var _0x1271cf=_0xb30f[_0x477310];return _0x1271cf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb30('0x0')],'allowNull':![],'unique':_0xfb30('0x1')},'mode':{'type':Sequelize['ENUM'](_0xfb30('0x2'),_0xfb30('0x3'),'mp3nb',_0xfb30('0x4'),_0xfb30('0x5'),_0xfb30('0x6')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xfb30('0x0')],'allowNull':!![],'defaultValue':_0xfb30('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xfb30('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe64e=['mp3nb','quietmp3nb','quietmp3','STRING','BOOLEAN','sequelize','exports','name','ENUM','custom','files'];(function(_0xe40d6d,_0x4831b9){var _0x481f0c=function(_0x5ca23a){while(--_0x5ca23a){_0xe40d6d['push'](_0xe40d6d['shift']());}};_0x481f0c(++_0x4831b9);}(_0xe64e,0xaa));var _0xee64=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe64e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xee64('0x0'));module[_0xee64('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xee64('0x2')},'mode':{'type':Sequelize[_0xee64('0x3')](_0xee64('0x4'),_0xee64('0x5'),_0xee64('0x6'),_0xee64('0x7'),_0xee64('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0xee64('0x5')},'directory':{'type':Sequelize[_0xee64('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0xee64('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xee64('0x9')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xee64('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 3161cda..8e17b31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0810=['transaction','files','join','root','server/files/moh','mode','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','extname','symlinkSync','message','removeSound','id2','unlinkSync','getSounds','sort','eml-format','rimraf','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','count','offset','set','json','reject','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','VoiceMusicOnHold','findAll','rows','params','keys','include','merge','find','catch','body','create','sequelize'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x0810,0x1da));var _0x0081=function(_0x126125,_0x1e8479){_0x126125=_0x126125-0x0;var _0x4307dd=_0x0810[_0x126125];return _0x4307dd;};'use strict';var emlformat=require(_0x0081('0x0'));var rimraf=require(_0x0081('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0081('0x2'));var rp=require(_0x0081('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0081('0x4'));var path=require('path');var sox=require(_0x0081('0x5'));var csv=require(_0x0081('0x6'));var ejs=require(_0x0081('0x7'));var fs=require('fs');var fs_extra=require(_0x0081('0x8'));var _=require(_0x0081('0x9'));var squel=require(_0x0081('0xa'));var crypto=require(_0x0081('0xb'));var jsforce=require(_0x0081('0xc'));var deskjs=require(_0x0081('0xd'));var toCsv=require(_0x0081('0x6'));var querystring=require('querystring');var Papa=require(_0x0081('0xe'));var Redis=require(_0x0081('0xf'));var authService=require(_0x0081('0x10'));var qs=require(_0x0081('0x11'));var as=require(_0x0081('0x12'));var hardwareService=require(_0x0081('0x13'));var logger=require(_0x0081('0x14'))(_0x0081('0x15'));var utils=require(_0x0081('0x16'));var config=require(_0x0081('0x17'));var licenseUtil=require(_0x0081('0x18'));var db=require(_0x0081('0x19'))['db'];function respondWithStatusCode(_0xdc2bb8,_0x33c906){_0x33c906=_0x33c906||0xcc;return function(_0x6c4e18){if(_0x6c4e18){return _0xdc2bb8['sendStatus'](_0x33c906);}return _0xdc2bb8[_0x0081('0x1a')](_0x33c906)[_0x0081('0x1b')]();};}function respondWithResult(_0x1e5e65,_0x3a4ef4){_0x3a4ef4=_0x3a4ef4||0xc8;return function(_0x5241eb){if(_0x5241eb){return _0x1e5e65[_0x0081('0x1a')](_0x3a4ef4)['json'](_0x5241eb);}};}function respondWithFilteredResult(_0x3ba6c8,_0x1584dc){return function(_0x2c794c){if(_0x2c794c){var _0x517071=typeof _0x1584dc['offset']===_0x0081('0x1c')&&typeof _0x1584dc[_0x0081('0x1d')]===_0x0081('0x1c');var _0x3cd074=_0x2c794c[_0x0081('0x1e')];var _0x1c835b=_0x517071?0x0:_0x1584dc[_0x0081('0x1f')];var _0x27fb95=_0x517071?_0x2c794c[_0x0081('0x1e')]:_0x1584dc[_0x0081('0x1f')]+_0x1584dc[_0x0081('0x1d')];var _0x50edc6;if(_0x27fb95>=_0x3cd074){_0x27fb95=_0x3cd074;_0x50edc6=0xc8;}else{_0x50edc6=0xce;}_0x3ba6c8[_0x0081('0x1a')](_0x50edc6);return _0x3ba6c8[_0x0081('0x20')]('Content-Range',_0x1c835b+'-'+_0x27fb95+'/'+_0x3cd074)[_0x0081('0x21')](_0x2c794c);}return null;};}function patchUpdates(_0x2bcf40){return function(_0x5b927c){try{jsonpatch['apply'](_0x5b927c,_0x2bcf40,!![]);}catch(_0x3c8cab){return BPromise[_0x0081('0x22')](_0x3c8cab);}return _0x5b927c['save']();};}function saveUpdates(_0x81b4e4,_0x2fb064){return function(_0x41790e){if(_0x41790e){return _0x41790e[_0x0081('0x23')](_0x81b4e4)['then'](function(_0x1cff90){return _0x1cff90;});}return null;};}function removeEntity(_0x83f517,_0xe8be7c){return function(_0x1380ea){if(_0x1380ea){return _0x1380ea[_0x0081('0x24')]()[_0x0081('0x25')](function(){var _0x5c84cf=_0x1380ea[_0x0081('0x26')]({'plain':!![]});var _0x5d43d6=_0x0081('0x27');return db[_0x0081('0x28')][_0x0081('0x24')]({'where':{'type':_0x5d43d6,'resourceId':_0x5c84cf['id']}})[_0x0081('0x25')](function(){return _0x1380ea;});})['then'](function(){_0x83f517[_0x0081('0x1a')](0xcc)[_0x0081('0x1b')]();});}};}function handleEntityNotFound(_0xe5f96a,_0x5dccf7){return function(_0x1a84a0){if(!_0x1a84a0){_0xe5f96a['sendStatus'](0x194);}return _0x1a84a0;};}function handleError(_0x23cfd2,_0x555ce6){_0x555ce6=_0x555ce6||0x1f4;return function(_0x17ed77){logger[_0x0081('0x29')](_0x17ed77['stack']);if(_0x17ed77[_0x0081('0x2a')]){delete _0x17ed77[_0x0081('0x2a')];}_0x23cfd2[_0x0081('0x1a')](_0x555ce6)[_0x0081('0x2b')](_0x17ed77);};}exports[_0x0081('0x2c')]=function(_0x25da50,_0x4b4020){var _0x44d672={},_0x2e5e5f={},_0x24abc0={'count':0x0,'rows':[]};var _0x4f8023=_[_0x0081('0x2d')](db['VoiceMusicOnHold'][_0x0081('0x2e')],function(_0x38c1f1){return{'name':_0x38c1f1['fieldName'],'type':_0x38c1f1[_0x0081('0x2f')][_0x0081('0x30')]};});_0x2e5e5f[_0x0081('0x31')]=_[_0x0081('0x2d')](_0x4f8023,'name');_0x2e5e5f[_0x0081('0x32')]=_['keys'](_0x25da50[_0x0081('0x32')]);_0x2e5e5f[_0x0081('0x33')]=_[_0x0081('0x34')](_0x2e5e5f['model'],_0x2e5e5f['query']);_0x44d672[_0x0081('0x35')]=_['intersection'](_0x2e5e5f[_0x0081('0x31')],qs[_0x0081('0x36')](_0x25da50[_0x0081('0x32')][_0x0081('0x36')]));_0x44d672['attributes']=_0x44d672[_0x0081('0x35')][_0x0081('0x37')]?_0x44d672[_0x0081('0x35')]:_0x2e5e5f[_0x0081('0x31')];if(!_0x25da50['query'][_0x0081('0x38')](_0x0081('0x39'))){_0x44d672['limit']=qs[_0x0081('0x1d')](_0x25da50[_0x0081('0x32')]['limit']);_0x44d672['offset']=qs[_0x0081('0x1f')](_0x25da50['query']['offset']);}_0x44d672[_0x0081('0x3a')]=qs['sort'](_0x25da50['query']['sort']);delete _0x25da50[_0x0081('0x32')]['sort'];_0x44d672[_0x0081('0x3b')]=qs[_0x0081('0x33')](_[_0x0081('0x3c')](_0x25da50[_0x0081('0x32')],_0x2e5e5f[_0x0081('0x33')]),_0x4f8023);if(_0x25da50[_0x0081('0x32')][_0x0081('0x3d')]){_0x44d672[_0x0081('0x3b')]=_['merge'](_0x44d672[_0x0081('0x3b')],{'$or':_[_0x0081('0x2d')](_0x4f8023,function(_0x2dc556){if(_0x2dc556[_0x0081('0x2f')]!==_0x0081('0x3e')){var _0x25280c={};_0x25280c[_0x2dc556[_0x0081('0x2a')]]={'$like':'%'+_0x25da50['query'][_0x0081('0x3d')]+'%'};return _0x25280c;}})});}_0x44d672=_['merge']({},_0x44d672,_0x25da50[_0x0081('0x3f')]);var _0x23eeef={'where':_0x44d672[_0x0081('0x3b')]};return db['VoiceMusicOnHold'][_0x0081('0x1e')](_0x23eeef)[_0x0081('0x25')](function(_0x5c0157){_0x24abc0[_0x0081('0x1e')]=_0x5c0157;if(_0x25da50[_0x0081('0x32')]['includeAll']){_0x44d672['include']=[{'all':!![]}];}return db[_0x0081('0x40')][_0x0081('0x41')](_0x44d672);})[_0x0081('0x25')](function(_0x173a6e){_0x24abc0[_0x0081('0x42')]=_0x173a6e;return _0x24abc0;})[_0x0081('0x25')](respondWithFilteredResult(_0x4b4020,_0x44d672))['catch'](handleError(_0x4b4020,null));};exports['show']=function(_0x5312e0,_0x2aee58){var _0x44bf18={'raw':![],'where':{'id':_0x5312e0[_0x0081('0x43')]['id']}},_0x5994f4={};_0x5994f4[_0x0081('0x31')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x5994f4[_0x0081('0x32')]=_[_0x0081('0x44')](_0x5312e0[_0x0081('0x32')]);_0x5994f4[_0x0081('0x33')]=_[_0x0081('0x34')](_0x5994f4[_0x0081('0x31')],_0x5994f4[_0x0081('0x32')]);_0x44bf18['attributes']=_[_0x0081('0x34')](_0x5994f4[_0x0081('0x31')],qs[_0x0081('0x36')](_0x5312e0[_0x0081('0x32')][_0x0081('0x36')]));_0x44bf18[_0x0081('0x35')]=_0x44bf18[_0x0081('0x35')][_0x0081('0x37')]?_0x44bf18[_0x0081('0x35')]:_0x5994f4['model'];if(_0x5312e0[_0x0081('0x32')]['includeAll']){_0x44bf18[_0x0081('0x45')]=[{'all':!![]}];}_0x44bf18=_[_0x0081('0x46')]({},_0x44bf18,_0x5312e0[_0x0081('0x3f')]);return db[_0x0081('0x40')][_0x0081('0x47')](_0x44bf18)[_0x0081('0x25')](handleEntityNotFound(_0x2aee58,null))[_0x0081('0x25')](respondWithResult(_0x2aee58,null))[_0x0081('0x48')](handleError(_0x2aee58,null));};exports['update']=function(_0x4adec0,_0x211543){if(_0x4adec0[_0x0081('0x49')]['id']){delete _0x4adec0['body']['id'];}return db[_0x0081('0x40')]['find']({'where':{'id':_0x4adec0['params']['id']}})[_0x0081('0x25')](handleEntityNotFound(_0x211543,null))['then'](saveUpdates(_0x4adec0[_0x0081('0x49')],null))[_0x0081('0x25')](respondWithResult(_0x211543,null))[_0x0081('0x48')](handleError(_0x211543,null));};exports[_0x0081('0x4a')]=function(_0x2502f3,_0x4ec89a,_0x5a8e4c){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x18d91b){if(_0x2502f3[_0x0081('0x49')]['mode']===_0x0081('0x4d')){_0x2502f3[_0x0081('0x49')]['directory']=path[_0x0081('0x4e')](config[_0x0081('0x4f')],_0x0081('0x50'),_0x2502f3[_0x0081('0x49')][_0x0081('0x2a')]);}return db[_0x0081('0x40')][_0x0081('0x4a')](_0x2502f3[_0x0081('0x49')],{'transaction':_0x18d91b})[_0x0081('0x25')](function(_0x37dd0e){if(_0x2502f3['body'][_0x0081('0x51')]==='files'){fs['mkdirSync'](_0x37dd0e[_0x0081('0x52')],parseInt(_0x0081('0x53'),0x8));}var _0x57a371=_0x2502f3[_0x0081('0x54')][_0x0081('0x26')]({'plain':!![]});if(!_0x57a371)throw new Error(_0x0081('0x55'));if(_0x57a371[_0x0081('0x56')]==='user'){var _0xf56058=_0x37dd0e['get']({'plain':!![]});return db[_0x0081('0x57')]['find']({'where':{'name':_0x0081('0x27'),'userProfileId':_0x57a371[_0x0081('0x58')]},'raw':!![]})['then'](function(_0xa30b3c){if(_0xa30b3c&&_0xa30b3c[_0x0081('0x59')]===0x0){return db['UserProfileResource'][_0x0081('0x4a')]({'name':_0xf56058['name'],'resourceId':_0xf56058['id'],'type':_0xa30b3c[_0x0081('0x2a')],'sectionId':_0xa30b3c['id']},{})[_0x0081('0x25')](function(){return _0x37dd0e;});}else{return _0x37dd0e;}})[_0x0081('0x48')](function(_0x31ce9a){logger[_0x0081('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ce9a);});}return _0x37dd0e;});})[_0x0081('0x25')](respondWithResult(_0x4ec89a,0xc9))['catch'](handleError(_0x4ec89a,null));};exports[_0x0081('0x24')]=function(_0x51fbf3,_0x59ff5d,_0x46749b){var _0x5717fb;return db[_0x0081('0x40')][_0x0081('0x47')]({'where':{'id':_0x51fbf3['params']['id']}})[_0x0081('0x25')](function(_0x462b5f){if(_0x462b5f){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x22110a){return _0x462b5f['destroy']({'transaction':_0x22110a,'raw':!![]})[_0x0081('0x25')](function(_0x5a6966){if(_0x5a6966[_0x0081('0x52')]){fs['readdirSync'](_0x5a6966['directory'])['forEach'](function(_0x2bc570){fs['unlinkSync'](path[_0x0081('0x4e')](_0x5a6966[_0x0081('0x52')],_0x2bc570));});fs[_0x0081('0x5a')](_0x5a6966[_0x0081('0x52')]);}return _0x5a6966;});})[_0x0081('0x48')](function(_0x393127){throw new db[(_0x0081('0x5b'))][(_0x0081('0x5c'))](_0x393127['message']);});}})['then'](handleEntityNotFound(_0x59ff5d,null))[_0x0081('0x25')](removeEntity(_0x59ff5d,null))[_0x0081('0x48')](handleError(_0x59ff5d,null));};exports[_0x0081('0x5d')]=function(_0x1c63ba,_0x1f9a0,_0xf3915e){return db[_0x0081('0x4b')]['transaction'](function(_0x5508e9){var _0x21018f;return db[_0x0081('0x40')]['find']({'where':{'id':_0x1c63ba[_0x0081('0x43')]['id']}})[_0x0081('0x25')](function(_0x988837){if(_0x988837){_0x21018f=_0x988837;return _0x988837['addSound'](_0x1c63ba[_0x0081('0x49')]['id'],{'transaction':_0x5508e9});}})[_0x0081('0x25')](function(_0x98657d){if(_0x98657d){return db[_0x0081('0x5e')][_0x0081('0x5f')]({'where':{'id':_0x1c63ba[_0x0081('0x49')]['id']},'attributes':['id','name',_0x0081('0x60'),_0x0081('0x61'),_0x0081('0x62')],'raw':!![]});}})[_0x0081('0x25')](function(_0x5ebbb9){if(_0x5ebbb9){var _0x4f8fa4=path[_0x0081('0x4e')](config[_0x0081('0x4f')],'server/files/sounds/converted',util[_0x0081('0x63')](_0x0081('0x64'),path[_0x0081('0x65')](_0x5ebbb9['save_name'],path[_0x0081('0x66')](_0x5ebbb9[_0x0081('0x60')])),_0x5ebbb9[_0x0081('0x61')]));var _0x133199=path[_0x0081('0x4e')](config[_0x0081('0x4f')],'server/files/moh',_0x21018f['name'],util['format'](_0x0081('0x64'),_0x5ebbb9[_0x0081('0x2a')],_0x5ebbb9[_0x0081('0x61')]));fs[_0x0081('0x67')](_0x4f8fa4,_0x133199);return _0x5ebbb9;}})['catch'](function(_0x21b88d){throw new db['Sequelize'][(_0x0081('0x5c'))](_0x21b88d[_0x0081('0x68')]);});})['then'](handleEntityNotFound(_0x1f9a0,null))[_0x0081('0x25')](respondWithResult(_0x1f9a0,0xc9))[_0x0081('0x48')](handleError(_0x1f9a0,null));};exports[_0x0081('0x69')]=function(_0x27e9c2,_0x54b64e,_0x49d07a){return db[_0x0081('0x4b')][_0x0081('0x4c')](function(_0x5c7f64){var _0x115bd4;return db[_0x0081('0x40')]['findOne']({'where':{'id':_0x27e9c2[_0x0081('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b64e,null))[_0x0081('0x25')](function(_0x541989){if(_0x541989){_0x115bd4=_0x541989;return _0x541989[_0x0081('0x69')](_0x27e9c2[_0x0081('0x43')][_0x0081('0x6a')]);}})['then'](function(_0x26bdf2){if(_0x26bdf2){return db[_0x0081('0x5e')][_0x0081('0x5f')]({'where':{'id':_0x27e9c2[_0x0081('0x43')][_0x0081('0x6a')]},'attributes':['id',_0x0081('0x2a'),'save_name',_0x0081('0x61'),_0x0081('0x62')],'raw':!![]});}})[_0x0081('0x25')](function(_0x1f4f3e){if(_0x1f4f3e){fs[_0x0081('0x6b')](path[_0x0081('0x4e')](_0x115bd4['directory'],util[_0x0081('0x63')](_0x0081('0x64'),_0x1f4f3e['name'],_0x1f4f3e[_0x0081('0x61')])));return _0x1f4f3e;}})[_0x0081('0x48')](function(_0x18282f){throw new db[(_0x0081('0x5b'))][(_0x0081('0x5c'))](_0x18282f[_0x0081('0x68')]);});})[_0x0081('0x25')](handleEntityNotFound(_0x54b64e,null))[_0x0081('0x25')](respondWithStatusCode(_0x54b64e,0xcc))['catch'](handleError(_0x54b64e,null));};exports[_0x0081('0x6c')]=function(_0x27f0d5,_0x3d5b2f,_0x37564b){var _0x14eaf1={};var _0x371cb4={};var _0x2a25f4;var _0x4c57e3;return db['VoiceMusicOnHold'][_0x0081('0x5f')]({'where':{'id':_0x27f0d5['params']['id']}})[_0x0081('0x25')](handleEntityNotFound(_0x3d5b2f,null))[_0x0081('0x25')](function(_0x1993a4){if(_0x1993a4){_0x2a25f4=_0x1993a4;_0x371cb4['model']=_['keys'](db['Sound'][_0x0081('0x2e')]);_0x371cb4[_0x0081('0x32')]=_[_0x0081('0x44')](_0x27f0d5[_0x0081('0x32')]);_0x371cb4[_0x0081('0x33')]=_[_0x0081('0x34')](_0x371cb4[_0x0081('0x31')],_0x371cb4[_0x0081('0x32')]);_0x14eaf1['attributes']=_[_0x0081('0x34')](_0x371cb4[_0x0081('0x31')],qs[_0x0081('0x36')](_0x27f0d5['query']['fields']));_0x14eaf1['attributes']=_0x14eaf1[_0x0081('0x35')][_0x0081('0x37')]?_0x14eaf1[_0x0081('0x35')]:_0x371cb4[_0x0081('0x31')];_0x14eaf1[_0x0081('0x3a')]=qs[_0x0081('0x6d')](_0x27f0d5['query'][_0x0081('0x6d')]);_0x14eaf1['where']=qs['filters'](_['pick'](_0x27f0d5[_0x0081('0x32')],_0x371cb4['filters']));if(_0x27f0d5[_0x0081('0x32')][_0x0081('0x3d')]){_0x14eaf1['where']=_['merge'](_0x14eaf1['where'],{'$or':_[_0x0081('0x2d')](_0x14eaf1[_0x0081('0x35')],function(_0x2ff36e){var _0x9c7410={};_0x9c7410[_0x2ff36e]={'$like':'%'+_0x27f0d5['query']['filter']+'%'};return _0x9c7410;})});}_0x14eaf1=_[_0x0081('0x46')]({},_0x14eaf1,_0x27f0d5[_0x0081('0x3f')]);return _0x2a25f4[_0x0081('0x6c')](_0x14eaf1);}})['then'](function(_0x36c839){if(_0x36c839){_0x4c57e3=_0x36c839[_0x0081('0x37')];if(!_0x27f0d5[_0x0081('0x32')][_0x0081('0x38')](_0x0081('0x39'))){_0x14eaf1['limit']=qs['limit'](_0x27f0d5['query'][_0x0081('0x1d')]);_0x14eaf1[_0x0081('0x1f')]=qs[_0x0081('0x1f')](_0x27f0d5[_0x0081('0x32')]['offset']);}return _0x2a25f4[_0x0081('0x6c')](_0x14eaf1);}})['then'](function(_0x4a7aa9){if(_0x4a7aa9){return _0x4a7aa9?{'count':_0x4c57e3,'rows':_0x4a7aa9}:null;}})[_0x0081('0x25')](respondWithResult(_0x3d5b2f,null))[_0x0081('0x48')](handleError(_0x3d5b2f,null));};
\ No newline at end of file
+var _0x5d52=['filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','sequelize','transaction','mode','files','directory','join','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','save_name','createdAt','root','format','%s.%s','extname','converted_format','symlinkSync','message','removeSound','Sound','findOne','id2','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','stack','name','send','map','VoiceMusicOnHold','fieldName','type','key','query','keys'];(function(_0x45f0b0,_0x4d9e81){var _0x41a871=function(_0x2e643b){while(--_0x2e643b){_0x45f0b0['push'](_0x45f0b0['shift']());}};_0x41a871(++_0x4d9e81);}(_0x5d52,0x1f4));var _0x25d5=function(_0xe1b523,_0x2bc05b){_0xe1b523=_0xe1b523-0x0;var _0x52c152=_0x5d52[_0xe1b523];return _0x52c152;};'use strict';var emlformat=require(_0x25d5('0x0'));var rimraf=require(_0x25d5('0x1'));var zipdir=require(_0x25d5('0x2'));var jsonpatch=require(_0x25d5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25d5('0x4'));var Mustache=require(_0x25d5('0x5'));var util=require(_0x25d5('0x6'));var path=require('path');var sox=require(_0x25d5('0x7'));var csv=require(_0x25d5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x25d5('0x9'));var _=require(_0x25d5('0xa'));var squel=require(_0x25d5('0xb'));var crypto=require('crypto');var jsforce=require(_0x25d5('0xc'));var deskjs=require(_0x25d5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x25d5('0xe'));var Papa=require(_0x25d5('0xf'));var Redis=require(_0x25d5('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x25d5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x25d5('0x12'));var utils=require(_0x25d5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x25d5('0x14'));var db=require(_0x25d5('0x15'))['db'];function respondWithStatusCode(_0x5d87f6,_0x191df7){_0x191df7=_0x191df7||0xcc;return function(_0x267849){if(_0x267849){return _0x5d87f6[_0x25d5('0x16')](_0x191df7);}return _0x5d87f6[_0x25d5('0x17')](_0x191df7)[_0x25d5('0x18')]();};}function respondWithResult(_0x4b5ec7,_0x519afe){_0x519afe=_0x519afe||0xc8;return function(_0x3c017f){if(_0x3c017f){return _0x4b5ec7[_0x25d5('0x17')](_0x519afe)[_0x25d5('0x19')](_0x3c017f);}};}function respondWithFilteredResult(_0x309afd,_0x40ab02){return function(_0x4d679c){if(_0x4d679c){var _0xdfa8c4=typeof _0x40ab02[_0x25d5('0x1a')]==='undefined'&&typeof _0x40ab02[_0x25d5('0x1b')]==='undefined';var _0x3a48d9=_0x4d679c[_0x25d5('0x1c')];var _0x207ace=_0xdfa8c4?0x0:_0x40ab02[_0x25d5('0x1a')];var _0x365540=_0xdfa8c4?_0x4d679c[_0x25d5('0x1c')]:_0x40ab02['offset']+_0x40ab02[_0x25d5('0x1b')];var _0x3a37d3;if(_0x365540>=_0x3a48d9){_0x365540=_0x3a48d9;_0x3a37d3=0xc8;}else{_0x3a37d3=0xce;}_0x309afd[_0x25d5('0x17')](_0x3a37d3);return _0x309afd[_0x25d5('0x1d')]('Content-Range',_0x207ace+'-'+_0x365540+'/'+_0x3a48d9)['json'](_0x4d679c);}return null;};}function patchUpdates(_0x42bfda){return function(_0x3b2f94){try{jsonpatch[_0x25d5('0x1e')](_0x3b2f94,_0x42bfda,!![]);}catch(_0x1454e8){return BPromise[_0x25d5('0x1f')](_0x1454e8);}return _0x3b2f94[_0x25d5('0x20')]();};}function saveUpdates(_0x1665bf,_0x8a74b3){return function(_0x301e92){if(_0x301e92){return _0x301e92[_0x25d5('0x21')](_0x1665bf)['then'](function(_0x117011){return _0x117011;});}return null;};}function removeEntity(_0x9acd2a,_0x16cd8d){return function(_0x4e3a39){if(_0x4e3a39){return _0x4e3a39[_0x25d5('0x22')]()[_0x25d5('0x23')](function(){var _0x34a6b8=_0x4e3a39[_0x25d5('0x24')]({'plain':!![]});var _0x40e778=_0x25d5('0x25');return db[_0x25d5('0x26')][_0x25d5('0x22')]({'where':{'type':_0x40e778,'resourceId':_0x34a6b8['id']}})[_0x25d5('0x23')](function(){return _0x4e3a39;});})[_0x25d5('0x23')](function(){_0x9acd2a[_0x25d5('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1b71,_0x2b60a7){return function(_0x21c338){if(!_0x21c338){_0x3a1b71[_0x25d5('0x16')](0x194);}return _0x21c338;};}function handleError(_0x4d094b,_0x561225){_0x561225=_0x561225||0x1f4;return function(_0x9e5280){logger[_0x25d5('0x27')](_0x9e5280[_0x25d5('0x28')]);if(_0x9e5280['name']){delete _0x9e5280[_0x25d5('0x29')];}_0x4d094b['status'](_0x561225)[_0x25d5('0x2a')](_0x9e5280);};}exports['index']=function(_0x1bca47,_0x3c797a){var _0x28b794={},_0xd7db7f={},_0x289369={'count':0x0,'rows':[]};var _0x3a07c3=_[_0x25d5('0x2b')](db[_0x25d5('0x2c')]['rawAttributes'],function(_0x47ec66){return{'name':_0x47ec66[_0x25d5('0x2d')],'type':_0x47ec66[_0x25d5('0x2e')][_0x25d5('0x2f')]};});_0xd7db7f['model']=_[_0x25d5('0x2b')](_0x3a07c3,'name');_0xd7db7f[_0x25d5('0x30')]=_[_0x25d5('0x31')](_0x1bca47[_0x25d5('0x30')]);_0xd7db7f[_0x25d5('0x32')]=_['intersection'](_0xd7db7f[_0x25d5('0x33')],_0xd7db7f[_0x25d5('0x30')]);_0x28b794['attributes']=_[_0x25d5('0x34')](_0xd7db7f[_0x25d5('0x33')],qs['fields'](_0x1bca47[_0x25d5('0x30')][_0x25d5('0x35')]));_0x28b794[_0x25d5('0x36')]=_0x28b794['attributes']['length']?_0x28b794['attributes']:_0xd7db7f[_0x25d5('0x33')];if(!_0x1bca47[_0x25d5('0x30')][_0x25d5('0x37')](_0x25d5('0x38'))){_0x28b794[_0x25d5('0x1b')]=qs[_0x25d5('0x1b')](_0x1bca47[_0x25d5('0x30')][_0x25d5('0x1b')]);_0x28b794['offset']=qs[_0x25d5('0x1a')](_0x1bca47[_0x25d5('0x30')]['offset']);}_0x28b794['order']=qs[_0x25d5('0x39')](_0x1bca47[_0x25d5('0x30')]['sort']);delete _0x1bca47[_0x25d5('0x30')][_0x25d5('0x39')];_0x28b794[_0x25d5('0x3a')]=qs[_0x25d5('0x32')](_[_0x25d5('0x3b')](_0x1bca47['query'],_0xd7db7f[_0x25d5('0x32')]),_0x3a07c3);if(_0x1bca47[_0x25d5('0x30')][_0x25d5('0x3c')]){_0x28b794[_0x25d5('0x3a')]=_['merge'](_0x28b794[_0x25d5('0x3a')],{'$or':_['map'](_0x3a07c3,function(_0x2a0f63){if(_0x2a0f63[_0x25d5('0x2e')]!==_0x25d5('0x3d')){var _0x5c9af8={};_0x5c9af8[_0x2a0f63[_0x25d5('0x29')]]={'$like':'%'+_0x1bca47['query'][_0x25d5('0x3c')]+'%'};return _0x5c9af8;}})});}_0x28b794=_[_0x25d5('0x3e')]({},_0x28b794,_0x1bca47[_0x25d5('0x3f')]);var _0x504f1b={'where':_0x28b794[_0x25d5('0x3a')]};return db[_0x25d5('0x2c')][_0x25d5('0x1c')](_0x504f1b)[_0x25d5('0x23')](function(_0x4d8448){_0x289369[_0x25d5('0x1c')]=_0x4d8448;if(_0x1bca47[_0x25d5('0x30')][_0x25d5('0x40')]){_0x28b794[_0x25d5('0x41')]=[{'all':!![]}];}return db[_0x25d5('0x2c')][_0x25d5('0x42')](_0x28b794);})['then'](function(_0x5a9fe0){_0x289369[_0x25d5('0x43')]=_0x5a9fe0;return _0x289369;})[_0x25d5('0x23')](respondWithFilteredResult(_0x3c797a,_0x28b794))['catch'](handleError(_0x3c797a,null));};exports[_0x25d5('0x44')]=function(_0x4d8811,_0x30b5d4){var _0x3f32c8={'raw':![],'where':{'id':_0x4d8811[_0x25d5('0x45')]['id']}},_0x27f672={};_0x27f672['model']=_[_0x25d5('0x31')](db[_0x25d5('0x2c')][_0x25d5('0x46')]);_0x27f672[_0x25d5('0x30')]=_[_0x25d5('0x31')](_0x4d8811[_0x25d5('0x30')]);_0x27f672[_0x25d5('0x32')]=_[_0x25d5('0x34')](_0x27f672[_0x25d5('0x33')],_0x27f672[_0x25d5('0x30')]);_0x3f32c8[_0x25d5('0x36')]=_[_0x25d5('0x34')](_0x27f672[_0x25d5('0x33')],qs[_0x25d5('0x35')](_0x4d8811[_0x25d5('0x30')][_0x25d5('0x35')]));_0x3f32c8['attributes']=_0x3f32c8['attributes'][_0x25d5('0x47')]?_0x3f32c8[_0x25d5('0x36')]:_0x27f672[_0x25d5('0x33')];if(_0x4d8811[_0x25d5('0x30')][_0x25d5('0x40')]){_0x3f32c8['include']=[{'all':!![]}];}_0x3f32c8=_[_0x25d5('0x3e')]({},_0x3f32c8,_0x4d8811[_0x25d5('0x3f')]);return db[_0x25d5('0x2c')][_0x25d5('0x48')](_0x3f32c8)[_0x25d5('0x23')](handleEntityNotFound(_0x30b5d4,null))[_0x25d5('0x23')](respondWithResult(_0x30b5d4,null))[_0x25d5('0x49')](handleError(_0x30b5d4,null));};exports[_0x25d5('0x21')]=function(_0x1745b4,_0x12e95f){if(_0x1745b4[_0x25d5('0x4a')]['id']){delete _0x1745b4['body']['id'];}return db[_0x25d5('0x2c')]['find']({'where':{'id':_0x1745b4[_0x25d5('0x45')]['id']}})['then'](handleEntityNotFound(_0x12e95f,null))[_0x25d5('0x23')](saveUpdates(_0x1745b4[_0x25d5('0x4a')],null))[_0x25d5('0x23')](respondWithResult(_0x12e95f,null))['catch'](handleError(_0x12e95f,null));};exports['create']=function(_0x1c2508,_0x26ba7f,_0x4fca5a){return db[_0x25d5('0x4b')][_0x25d5('0x4c')](function(_0x295177){if(_0x1c2508[_0x25d5('0x4a')][_0x25d5('0x4d')]===_0x25d5('0x4e')){_0x1c2508[_0x25d5('0x4a')][_0x25d5('0x4f')]=path[_0x25d5('0x50')](config['root'],_0x25d5('0x51'),_0x1c2508['body']['name']);}return db['VoiceMusicOnHold']['create'](_0x1c2508[_0x25d5('0x4a')],{'transaction':_0x295177})[_0x25d5('0x23')](function(_0x31cbc8){if(_0x1c2508['body']['mode']===_0x25d5('0x4e')){fs['mkdirSync'](_0x31cbc8[_0x25d5('0x4f')],parseInt(_0x25d5('0x52'),0x8));}var _0x139b2c=_0x1c2508[_0x25d5('0x53')][_0x25d5('0x24')]({'plain':!![]});if(!_0x139b2c)throw new Error(_0x25d5('0x54'));if(_0x139b2c['role']==='user'){var _0x4d3eda=_0x31cbc8[_0x25d5('0x24')]({'plain':!![]});return db[_0x25d5('0x55')][_0x25d5('0x48')]({'where':{'name':_0x25d5('0x25'),'userProfileId':_0x139b2c[_0x25d5('0x56')]},'raw':!![]})[_0x25d5('0x23')](function(_0x5a5a5a){if(_0x5a5a5a&&_0x5a5a5a['autoAssociation']===0x0){return db[_0x25d5('0x26')][_0x25d5('0x57')]({'name':_0x4d3eda['name'],'resourceId':_0x4d3eda['id'],'type':_0x5a5a5a['name'],'sectionId':_0x5a5a5a['id']},{})[_0x25d5('0x23')](function(){return _0x31cbc8;});}else{return _0x31cbc8;}})[_0x25d5('0x49')](function(_0x3a389e){logger[_0x25d5('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a389e);});}return _0x31cbc8;});})[_0x25d5('0x23')](respondWithResult(_0x26ba7f,0xc9))[_0x25d5('0x49')](handleError(_0x26ba7f,null));};exports[_0x25d5('0x22')]=function(_0x55e67b,_0x58f7a1,_0x4ef1a0){var _0x52d6eb;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x55e67b[_0x25d5('0x45')]['id']}})['then'](function(_0x2e628e){if(_0x2e628e){return db[_0x25d5('0x4b')][_0x25d5('0x4c')](function(_0x10f648){return _0x2e628e[_0x25d5('0x22')]({'transaction':_0x10f648,'raw':!![]})[_0x25d5('0x23')](function(_0x2e1dd0){if(_0x2e1dd0[_0x25d5('0x4f')]){fs[_0x25d5('0x58')](_0x2e1dd0['directory'])[_0x25d5('0x59')](function(_0x12d493){fs[_0x25d5('0x5a')](path[_0x25d5('0x50')](_0x2e1dd0['directory'],_0x12d493));});fs[_0x25d5('0x5b')](_0x2e1dd0[_0x25d5('0x4f')]);}return _0x2e1dd0;});})[_0x25d5('0x49')](function(_0x3be7a2){throw new db[(_0x25d5('0x5c'))][(_0x25d5('0x5d'))](_0x3be7a2['message']);});}})[_0x25d5('0x23')](handleEntityNotFound(_0x58f7a1,null))['then'](removeEntity(_0x58f7a1,null))['catch'](handleError(_0x58f7a1,null));};exports['addSound']=function(_0x3cf74d,_0x543928,_0x463c41){return db[_0x25d5('0x4b')]['transaction'](function(_0x3a3e36){var _0xecfceb;return db[_0x25d5('0x2c')][_0x25d5('0x48')]({'where':{'id':_0x3cf74d[_0x25d5('0x45')]['id']}})['then'](function(_0x818a49){if(_0x818a49){_0xecfceb=_0x818a49;return _0x818a49[_0x25d5('0x5e')](_0x3cf74d[_0x25d5('0x4a')]['id'],{'transaction':_0x3a3e36});}})[_0x25d5('0x23')](function(_0x5f19b5){if(_0x5f19b5){return db['Sound']['findOne']({'where':{'id':_0x3cf74d[_0x25d5('0x4a')]['id']},'attributes':['id','name',_0x25d5('0x5f'),'converted_format',_0x25d5('0x60')],'raw':!![]});}})['then'](function(_0x4b8a34){if(_0x4b8a34){var _0x3a5e10=path['join'](config[_0x25d5('0x61')],'server/files/sounds/converted',util[_0x25d5('0x62')](_0x25d5('0x63'),path['basename'](_0x4b8a34[_0x25d5('0x5f')],path[_0x25d5('0x64')](_0x4b8a34[_0x25d5('0x5f')])),_0x4b8a34[_0x25d5('0x65')]));var _0x221685=path['join'](config[_0x25d5('0x61')],_0x25d5('0x51'),_0xecfceb[_0x25d5('0x29')],util[_0x25d5('0x62')](_0x25d5('0x63'),_0x4b8a34[_0x25d5('0x29')],_0x4b8a34[_0x25d5('0x65')]));fs[_0x25d5('0x66')](_0x3a5e10,_0x221685);return _0x4b8a34;}})[_0x25d5('0x49')](function(_0xca2ba8){throw new db[(_0x25d5('0x5c'))][(_0x25d5('0x5d'))](_0xca2ba8[_0x25d5('0x67')]);});})[_0x25d5('0x23')](handleEntityNotFound(_0x543928,null))[_0x25d5('0x23')](respondWithResult(_0x543928,0xc9))[_0x25d5('0x49')](handleError(_0x543928,null));};exports[_0x25d5('0x68')]=function(_0x2d6e8c,_0x29dae3,_0x3fbc8a){return db[_0x25d5('0x4b')][_0x25d5('0x4c')](function(_0x30d986){var _0xc6d98b;return db[_0x25d5('0x2c')]['findOne']({'where':{'id':_0x2d6e8c[_0x25d5('0x45')]['id']}})[_0x25d5('0x23')](handleEntityNotFound(_0x29dae3,null))[_0x25d5('0x23')](function(_0x5c27c4){if(_0x5c27c4){_0xc6d98b=_0x5c27c4;return _0x5c27c4[_0x25d5('0x68')](_0x2d6e8c['params']['id2']);}})[_0x25d5('0x23')](function(_0x269476){if(_0x269476){return db[_0x25d5('0x69')][_0x25d5('0x6a')]({'where':{'id':_0x2d6e8c[_0x25d5('0x45')][_0x25d5('0x6b')]},'attributes':['id',_0x25d5('0x29'),'save_name',_0x25d5('0x65'),_0x25d5('0x60')],'raw':!![]});}})[_0x25d5('0x23')](function(_0x2b626d){if(_0x2b626d){fs[_0x25d5('0x5a')](path['join'](_0xc6d98b['directory'],util[_0x25d5('0x62')](_0x25d5('0x63'),_0x2b626d[_0x25d5('0x29')],_0x2b626d[_0x25d5('0x65')])));return _0x2b626d;}})[_0x25d5('0x49')](function(_0x1d909c){throw new db[(_0x25d5('0x5c'))]['ValidationError'](_0x1d909c[_0x25d5('0x67')]);});})[_0x25d5('0x23')](handleEntityNotFound(_0x29dae3,null))[_0x25d5('0x23')](respondWithStatusCode(_0x29dae3,0xcc))[_0x25d5('0x49')](handleError(_0x29dae3,null));};exports[_0x25d5('0x6c')]=function(_0x5b91ef,_0x83e6c,_0x1057bd){var _0x3675df={};var _0x382193={};var _0x47f4b9;var _0x3d3fb7;return db[_0x25d5('0x2c')][_0x25d5('0x6a')]({'where':{'id':_0x5b91ef[_0x25d5('0x45')]['id']}})[_0x25d5('0x23')](handleEntityNotFound(_0x83e6c,null))[_0x25d5('0x23')](function(_0x56ceab){if(_0x56ceab){_0x47f4b9=_0x56ceab;_0x382193[_0x25d5('0x33')]=_['keys'](db[_0x25d5('0x69')][_0x25d5('0x46')]);_0x382193[_0x25d5('0x30')]=_[_0x25d5('0x31')](_0x5b91ef[_0x25d5('0x30')]);_0x382193[_0x25d5('0x32')]=_[_0x25d5('0x34')](_0x382193[_0x25d5('0x33')],_0x382193[_0x25d5('0x30')]);_0x3675df[_0x25d5('0x36')]=_[_0x25d5('0x34')](_0x382193[_0x25d5('0x33')],qs[_0x25d5('0x35')](_0x5b91ef[_0x25d5('0x30')][_0x25d5('0x35')]));_0x3675df[_0x25d5('0x36')]=_0x3675df[_0x25d5('0x36')][_0x25d5('0x47')]?_0x3675df['attributes']:_0x382193[_0x25d5('0x33')];_0x3675df[_0x25d5('0x6d')]=qs[_0x25d5('0x39')](_0x5b91ef[_0x25d5('0x30')]['sort']);_0x3675df[_0x25d5('0x3a')]=qs['filters'](_[_0x25d5('0x3b')](_0x5b91ef[_0x25d5('0x30')],_0x382193[_0x25d5('0x32')]));if(_0x5b91ef['query'][_0x25d5('0x3c')]){_0x3675df[_0x25d5('0x3a')]=_['merge'](_0x3675df['where'],{'$or':_[_0x25d5('0x2b')](_0x3675df['attributes'],function(_0x12d1f5){var _0xfb3724={};_0xfb3724[_0x12d1f5]={'$like':'%'+_0x5b91ef[_0x25d5('0x30')][_0x25d5('0x3c')]+'%'};return _0xfb3724;})});}_0x3675df=_[_0x25d5('0x3e')]({},_0x3675df,_0x5b91ef[_0x25d5('0x3f')]);return _0x47f4b9['getSounds'](_0x3675df);}})[_0x25d5('0x23')](function(_0x280221){if(_0x280221){_0x3d3fb7=_0x280221[_0x25d5('0x47')];if(!_0x5b91ef[_0x25d5('0x30')][_0x25d5('0x37')]('nolimit')){_0x3675df[_0x25d5('0x1b')]=qs['limit'](_0x5b91ef[_0x25d5('0x30')][_0x25d5('0x1b')]);_0x3675df[_0x25d5('0x1a')]=qs[_0x25d5('0x1a')](_0x5b91ef[_0x25d5('0x30')]['offset']);}return _0x47f4b9[_0x25d5('0x6c')](_0x3675df);}})[_0x25d5('0x23')](function(_0x4c3a2e){if(_0x4c3a2e){return _0x4c3a2e?{'count':_0x3d3fb7,'rows':_0x4c3a2e}:null;}})['then'](respondWithResult(_0x83e6c,null))[_0x25d5('0x49')](handleError(_0x83e6c,null));};
\ No newline at end of file
index e626b75..256c0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9396=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5ada09,_0x5c2b38){var _0xb89d93=function(_0x7ca413){while(--_0x7ca413){_0x5ada09['push'](_0x5ada09['shift']());}};_0xb89d93(++_0x5c2b38);}(_0x9396,0x10e));var _0x6939=function(_0x3f91f3,_0x294896){_0x3f91f3=_0x3f91f3-0x0;var _0x4a9f96=_0x9396[_0x3f91f3];return _0x4a9f96;};'use strict';var _=require(_0x6939('0x0'));var util=require(_0x6939('0x1'));var logger=require(_0x6939('0x2'))('api');var moment=require(_0x6939('0x3'));var BPromise=require(_0x6939('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6939('0x5'));var rimraf=require(_0x6939('0x6'));var config=require(_0x6939('0x7'));var attributes=require(_0x6939('0x8'));module['exports']=function(_0x3be35c,_0x56ef7b){return _0x3be35c[_0x6939('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x6939('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4977=['VoiceMusicOnHold','util','../../config/logger','api','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define'];(function(_0x3c387b,_0x35e099){var _0x286571=function(_0x4db210){while(--_0x4db210){_0x3c387b['push'](_0x3c387b['shift']());}};_0x286571(++_0x35e099);}(_0x4977,0xbf));var _0x7497=function(_0x2fcf69,_0x1e8dd8){_0x2fcf69=_0x2fcf69-0x0;var _0x1454ce=_0x4977[_0x2fcf69];return _0x1454ce;};'use strict';var _=require('lodash');var util=require(_0x7497('0x0'));var logger=require(_0x7497('0x1'))(_0x7497('0x2'));var moment=require('moment');var BPromise=require(_0x7497('0x3'));var rp=require(_0x7497('0x4'));var fs=require('fs');var path=require(_0x7497('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7497('0x6'));module[_0x7497('0x7')]=function(_0x50d418,_0x5203e4){return _0x50d418[_0x7497('0x8')](_0x7497('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 035e8d1..877693f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x138050,_0x4cbc6c){var _0xcdf7b8=function(_0x4e7811){while(--_0x4e7811){_0x138050['push'](_0x138050['shift']());}};_0xcdf7b8(++_0x4cbc6c);}(_0xe706,0xa3));var _0x6e70=function(_0xf1af27,_0x598bb1){_0xf1af27=_0xf1af27-0x0;var _0x46b274=_0xe706[_0xf1af27];return _0x46b274;};'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']('VoiceMusicOnHold,\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']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x49fd10,_0x387293){var _0x3ddb31=function(_0x1fc1e0){while(--_0x1fc1e0){_0x49fd10['push'](_0x49fd10['shift']());}};_0x3ddb31(++_0x387293);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});}
\ No newline at end of file
index 8907fdc..167d4ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ffb=['getTeams','post','create','/:id/teams','addTeams','put','/:id','update','delete','removeAgents','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','show','/:id/users','getAgents'];(function(_0x52fadf,_0x3c3d57){var _0x4829c6=function(_0x364fcd){while(--_0x364fcd){_0x52fadf['push'](_0x52fadf['shift']());}};_0x4829c6(++_0x3c3d57);}(_0x3ffb,0x13f));var _0xb3ff=function(_0x27c678,_0x318a2f){_0x27c678=_0x27c678-0x0;var _0x41a5e9=_0x3ffb[_0x27c678];return _0x41a5e9;};'use strict';var multer=require(_0xb3ff('0x0'));var util=require(_0xb3ff('0x1'));var path=require(_0xb3ff('0x2'));var timeout=require(_0xb3ff('0x3'));var express=require(_0xb3ff('0x4'));var router=express['Router']();var fs_extra=require(_0xb3ff('0x5'));var auth=require(_0xb3ff('0x6'));var interaction=require(_0xb3ff('0x7'));var config=require(_0xb3ff('0x8'));var controller=require(_0xb3ff('0x9'));router[_0xb3ff('0xa')]('/',auth[_0xb3ff('0xb')](),controller['index']);router[_0xb3ff('0xa')](_0xb3ff('0xc'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xd')]);router['get']('/:id',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0xe')]);router[_0xb3ff('0xa')](_0xb3ff('0xf'),auth['isAuthenticated'](),controller[_0xb3ff('0x10')]);router[_0xb3ff('0xa')]('/:id/teams',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x11')]);router[_0xb3ff('0x12')]('/',auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x13')]);router[_0xb3ff('0x12')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller['addAgents']);router[_0xb3ff('0x12')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x15')]);router[_0xb3ff('0x16')](_0xb3ff('0x17'),auth['isAuthenticated'](),controller[_0xb3ff('0x18')]);router['delete'](_0xb3ff('0x17'),auth[_0xb3ff('0xb')](),controller['destroy']);router[_0xb3ff('0x19')](_0xb3ff('0xf'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1a')]);router[_0xb3ff('0x19')](_0xb3ff('0x14'),auth[_0xb3ff('0xb')](),controller[_0xb3ff('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x5c37=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/users','getAgents','/:id/teams','post','create','addAgents','put','update','delete','destroy','removeAgents','removeTeams','exports'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x5c37,0x11e));var _0x75c3=function(_0x31c19c,_0xbe4b70){_0x31c19c=_0x31c19c-0x0;var _0x1a87f7=_0x5c37[_0x31c19c];return _0x1a87f7;};'use strict';var multer=require(_0x75c3('0x0'));var util=require(_0x75c3('0x1'));var path=require(_0x75c3('0x2'));var timeout=require(_0x75c3('0x3'));var express=require(_0x75c3('0x4'));var router=express[_0x75c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x75c3('0x6'));var interaction=require(_0x75c3('0x7'));var config=require(_0x75c3('0x8'));var controller=require('./voicePrefix.controller');router[_0x75c3('0x9')]('/',auth[_0x75c3('0xa')](),controller[_0x75c3('0xb')]);router[_0x75c3('0x9')]('/describe',auth[_0x75c3('0xa')](),controller['describe']);router['get'](_0x75c3('0xc'),auth[_0x75c3('0xa')](),controller['show']);router[_0x75c3('0x9')](_0x75c3('0xd'),auth[_0x75c3('0xa')](),controller[_0x75c3('0xe')]);router[_0x75c3('0x9')](_0x75c3('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x75c3('0x10')]('/',auth[_0x75c3('0xa')](),controller[_0x75c3('0x11')]);router[_0x75c3('0x10')](_0x75c3('0xd'),auth['isAuthenticated'](),controller[_0x75c3('0x12')]);router[_0x75c3('0x10')](_0x75c3('0xf'),auth[_0x75c3('0xa')](),controller['addTeams']);router[_0x75c3('0x13')](_0x75c3('0xc'),auth[_0x75c3('0xa')](),controller[_0x75c3('0x14')]);router[_0x75c3('0x15')](_0x75c3('0xc'),auth[_0x75c3('0xa')](),controller[_0x75c3('0x16')]);router[_0x75c3('0x15')]('/:id/users',auth[_0x75c3('0xa')](),controller[_0x75c3('0x17')]);router[_0x75c3('0x15')](_0x75c3('0xf'),auth[_0x75c3('0xa')](),controller[_0x75c3('0x18')]);module[_0x75c3('0x19')]=router;
\ No newline at end of file
index c98a263..0dd060f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4bb=['VIRTUAL','system-','getDataValue','name','STRING','exports'];(function(_0x2ee88f,_0x1b4a0c){var _0x4ccc0a=function(_0xbedb63){while(--_0xbedb63){_0x2ee88f['push'](_0x2ee88f['shift']());}};_0x4ccc0a(++_0x1b4a0c);}(_0xe4bb,0x1cd));var _0xbe4b=function(_0x3192db,_0x49172f){_0x3192db=_0x3192db-0x0;var _0x4048a0=_0xe4bb[_0x3192db];return _0x4048a0;};'use strict';var Sequelize=require('sequelize');module[_0xbe4b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xbe4b('0x1')],'get':function(_0x428eb8){return _0xbe4b('0x2')+this[_0xbe4b('0x3')](_0xbe4b('0x4'))+'-';}},'description':{'type':Sequelize[_0xbe4b('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x37f1=['name','system-','getDataValue','STRING','sequelize','exports'];(function(_0x540c04,_0x4c1e2f){var _0x5bcb58=function(_0x1b461b){while(--_0x1b461b){_0x540c04['push'](_0x540c04['shift']());}};_0x5bcb58(++_0x4c1e2f);}(_0x37f1,0x136));var _0x137f=function(_0x38004a,_0xf8622a){_0x38004a=_0x38004a-0x0;var _0x24dc96=_0x37f1[_0x38004a];return _0x24dc96;};'use strict';var Sequelize=require(_0x137f('0x0'));module[_0x137f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x137f('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xe6fe09){return _0x137f('0x3')+this[_0x137f('0x4')](_0x137f('0x2'))+'-';}},'description':{'type':Sequelize[_0x137f('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index a01e4af..7963606 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['appdata','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','NoOp','No\x20callerid\x20available','goto','charAt','system-','sequelize','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','nolimit','getTeams','Team','Agents','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','isEmpty','eml-format','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','name','send','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','show','include','options','find','catch','params','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a2,0x173));var _0x2d4a=function(_0x295d32,_0x3b6bd7){_0x295d32=_0x295d32-0x0;var _0x2db548=_0xd4a2[_0x295d32];return _0x2db548;};'use strict';var emlformat=require(_0x2d4a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2d4a('0x1'));var rp=require('request-promise');var moment=require(_0x2d4a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2d4a('0x3'));var util=require('util');var path=require(_0x2d4a('0x4'));var sox=require(_0x2d4a('0x5'));var csv=require(_0x2d4a('0x6'));var ejs=require(_0x2d4a('0x7'));var fs=require('fs');var fs_extra=require(_0x2d4a('0x8'));var _=require('lodash');var squel=require(_0x2d4a('0x9'));var crypto=require(_0x2d4a('0xa'));var jsforce=require(_0x2d4a('0xb'));var deskjs=require(_0x2d4a('0xc'));var toCsv=require(_0x2d4a('0x6'));var querystring=require(_0x2d4a('0xd'));var Papa=require(_0x2d4a('0xe'));var Redis=require(_0x2d4a('0xf'));var authService=require(_0x2d4a('0x10'));var qs=require(_0x2d4a('0x11'));var as=require(_0x2d4a('0x12'));var hardwareService=require(_0x2d4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2d4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2d4a('0x15'));var db=require(_0x2d4a('0x16'))['db'];config[_0x2d4a('0x17')]=_[_0x2d4a('0x18')](config[_0x2d4a('0x17')],{'host':_0x2d4a('0x19'),'port':0x18eb});var socket=require(_0x2d4a('0x1a'))(new Redis(config[_0x2d4a('0x17')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x2a1d0f,_0x5b6c4f){_0x5b6c4f=_0x5b6c4f||0xcc;return function(_0x11c64a){if(_0x11c64a){return _0x2a1d0f[_0x2d4a('0x1b')](_0x5b6c4f);}return _0x2a1d0f[_0x2d4a('0x1c')](_0x5b6c4f)[_0x2d4a('0x1d')]();};}function respondWithResult(_0x4c5287,_0x5f825d){_0x5f825d=_0x5f825d||0xc8;return function(_0x5a6378){if(_0x5a6378){return _0x4c5287[_0x2d4a('0x1c')](_0x5f825d)['json'](_0x5a6378);}};}function respondWithFilteredResult(_0x435687,_0xd1dd52){return function(_0x2188b2){if(_0x2188b2){var _0x388371=typeof _0xd1dd52['offset']==='undefined'&&typeof _0xd1dd52['limit']===_0x2d4a('0x1e');var _0x1966d1=_0x2188b2[_0x2d4a('0x1f')];var _0x419df5=_0x388371?0x0:_0xd1dd52[_0x2d4a('0x20')];var _0x2e4069=_0x388371?_0x2188b2['count']:_0xd1dd52['offset']+_0xd1dd52[_0x2d4a('0x21')];var _0x1f3e17;if(_0x2e4069>=_0x1966d1){_0x2e4069=_0x1966d1;_0x1f3e17=0xc8;}else{_0x1f3e17=0xce;}_0x435687[_0x2d4a('0x1c')](_0x1f3e17);return _0x435687[_0x2d4a('0x22')](_0x2d4a('0x23'),_0x419df5+'-'+_0x2e4069+'/'+_0x1966d1)[_0x2d4a('0x24')](_0x2188b2);}return null;};}function patchUpdates(_0x22dd0b){return function(_0xa43fb1){try{jsonpatch['apply'](_0xa43fb1,_0x22dd0b,!![]);}catch(_0x26e7b8){return BPromise[_0x2d4a('0x25')](_0x26e7b8);}return _0xa43fb1[_0x2d4a('0x26')]();};}function saveUpdates(_0x42d813,_0x2c845c){return function(_0xed2822){if(_0xed2822){return _0xed2822[_0x2d4a('0x27')](_0x42d813)[_0x2d4a('0x28')](function(_0x54c910){return _0x54c910;});}return null;};}function removeEntity(_0x544b9b,_0x5cc7d8){return function(_0x2bb9f0){if(_0x2bb9f0){return _0x2bb9f0['destroy']()[_0x2d4a('0x28')](function(){var _0x3a2fd3=_0x2bb9f0[_0x2d4a('0x29')]({'plain':!![]});var _0x1d2fa6=_0x2d4a('0x2a');return db[_0x2d4a('0x2b')][_0x2d4a('0x2c')]({'where':{'type':_0x1d2fa6,'resourceId':_0x3a2fd3['id']}})[_0x2d4a('0x28')](function(){return _0x2bb9f0;});})['then'](function(){_0x544b9b[_0x2d4a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x221602,_0x9bac28){return function(_0xc497ce){if(!_0xc497ce){_0x221602[_0x2d4a('0x1b')](0x194);}return _0xc497ce;};}function handleError(_0x101382,_0x1dfc5d){_0x1dfc5d=_0x1dfc5d||0x1f4;return function(_0x25ac5c){logger[_0x2d4a('0x2d')](_0x25ac5c['stack']);if(_0x25ac5c[_0x2d4a('0x2e')]){delete _0x25ac5c[_0x2d4a('0x2e')];}_0x101382[_0x2d4a('0x1c')](_0x1dfc5d)[_0x2d4a('0x2f')](_0x25ac5c);};}exports[_0x2d4a('0x30')]=function(_0x57bf71,_0x217653){var _0x31d8ae={},_0x27015d={},_0x24bcc2={'count':0x0,'rows':[]};var _0x2bb93d=_['map'](db[_0x2d4a('0x31')][_0x2d4a('0x32')],function(_0x46b623){return{'name':_0x46b623[_0x2d4a('0x33')],'type':_0x46b623[_0x2d4a('0x34')][_0x2d4a('0x35')]};});_0x27015d['model']=_[_0x2d4a('0x36')](_0x2bb93d,_0x2d4a('0x2e'));_0x27015d[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x57bf71[_0x2d4a('0x37')]);_0x27015d['filters']=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],_0x27015d['query']);_0x31d8ae[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x27015d[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0x31d8ae['attributes']=_0x31d8ae[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x31d8ae[_0x2d4a('0x3b')]:_0x27015d[_0x2d4a('0x3a')];if(!_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x3e')]('nolimit')){_0x31d8ae['limit']=qs[_0x2d4a('0x21')](_0x57bf71['query'][_0x2d4a('0x21')]);_0x31d8ae[_0x2d4a('0x20')]=qs['offset'](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x20')]);}_0x31d8ae[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0x31d8ae[_0x2d4a('0x41')]=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x57bf71[_0x2d4a('0x37')],_0x27015d[_0x2d4a('0x42')]),_0x2bb93d);if(_0x57bf71['query'][_0x2d4a('0x44')]){_0x31d8ae[_0x2d4a('0x41')]=_[_0x2d4a('0x45')](_0x31d8ae[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0x2bb93d,function(_0x483a40){if(_0x483a40['type']!=='VIRTUAL'){var _0x5af510={};_0x5af510[_0x483a40[_0x2d4a('0x2e')]]={'$like':'%'+_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x44')]+'%'};return _0x5af510;}})});}_0x31d8ae=_[_0x2d4a('0x45')]({},_0x31d8ae,_0x57bf71['options']);var _0x155f2d={'where':_0x31d8ae[_0x2d4a('0x41')]};return db['VoicePrefix'][_0x2d4a('0x1f')](_0x155f2d)[_0x2d4a('0x28')](function(_0x8a9375){_0x24bcc2[_0x2d4a('0x1f')]=_0x8a9375;if(_0x57bf71[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x31d8ae['include']=[{'all':!![]}];}return db[_0x2d4a('0x31')][_0x2d4a('0x47')](_0x31d8ae);})[_0x2d4a('0x28')](function(_0x365399){_0x24bcc2[_0x2d4a('0x48')]=_0x365399;return _0x24bcc2;})[_0x2d4a('0x28')](respondWithFilteredResult(_0x217653,_0x31d8ae))['catch'](handleError(_0x217653,null));};exports[_0x2d4a('0x49')]=function(_0x1f08a3,_0x10b723){var _0x4e1901={'raw':![],'where':{'id':_0x1f08a3['params']['id']}},_0x2585db={};_0x2585db[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x31')][_0x2d4a('0x32')]);_0x2585db[_0x2d4a('0x37')]=_['keys'](_0x1f08a3['query']);_0x2585db[_0x2d4a('0x42')]=_[_0x2d4a('0x39')](_0x2585db['model'],_0x2585db[_0x2d4a('0x37')]);_0x4e1901['attributes']=_[_0x2d4a('0x39')](_0x2585db[_0x2d4a('0x3a')],qs[_0x2d4a('0x3c')](_0x1f08a3['query'][_0x2d4a('0x3c')]));_0x4e1901['attributes']=_0x4e1901[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4e1901[_0x2d4a('0x3b')]:_0x2585db[_0x2d4a('0x3a')];if(_0x1f08a3[_0x2d4a('0x37')][_0x2d4a('0x46')]){_0x4e1901[_0x2d4a('0x4a')]=[{'all':!![]}];}_0x4e1901=_[_0x2d4a('0x45')]({},_0x4e1901,_0x1f08a3[_0x2d4a('0x4b')]);return db[_0x2d4a('0x31')][_0x2d4a('0x4c')](_0x4e1901)['then'](handleEntityNotFound(_0x10b723,null))[_0x2d4a('0x28')](respondWithResult(_0x10b723,null))[_0x2d4a('0x4d')](handleError(_0x10b723,null));};exports[_0x2d4a('0x2c')]=function(_0x1467ab,_0x2d2e24){return db['VoicePrefix'][_0x2d4a('0x4c')]({'where':{'id':_0x1467ab[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2d2e24,null))[_0x2d4a('0x28')](removeEntity(_0x2d2e24,null))[_0x2d4a('0x4d')](handleError(_0x2d2e24,null));};exports['describe']=function(_0x4b9a52,_0x43e74a){return db[_0x2d4a('0x31')]['describe']()[_0x2d4a('0x28')](respondWithResult(_0x43e74a,null))[_0x2d4a('0x4d')](handleError(_0x43e74a,null));};exports[_0x2d4a('0x4f')]=function(_0x19109b,_0x52a468){var _0x31576d;return db['sequelize'][_0x2d4a('0x50')](function(_0x3fe91b){return db[_0x2d4a('0x31')][_0x2d4a('0x4f')](_0x19109b[_0x2d4a('0x51')],{'transaction':_0x3fe91b})[_0x2d4a('0x28')](function(_0x25fb59){_0x31576d=_0x25fb59[_0x2d4a('0x29')]({'plain':!![]});return db['VoiceExtension'][_0x2d4a('0x4c')]({'where':{'id':_0x31576d[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x67ddff){return createVoicePrefixExtensions(_0x31576d,_0x67ddff,_0x3fe91b);});});})[_0x2d4a('0x28')](function(){var _0x334d6a=_0x19109b[_0x2d4a('0x53')][_0x2d4a('0x29')]({'plain':!![]});if(!_0x334d6a)throw new Error(_0x2d4a('0x54'));if(_0x334d6a[_0x2d4a('0x55')]===_0x2d4a('0x53')){var _0x113bc4=_0x31576d;return db[_0x2d4a('0x56')][_0x2d4a('0x4c')]({'where':{'name':_0x2d4a('0x2a'),'userProfileId':_0x334d6a[_0x2d4a('0x57')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x4cce5e){if(_0x4cce5e&&_0x4cce5e[_0x2d4a('0x58')]===0x0){return db[_0x2d4a('0x2b')]['create']({'name':_0x113bc4[_0x2d4a('0x2e')],'resourceId':_0x113bc4['id'],'type':_0x4cce5e[_0x2d4a('0x2e')],'sectionId':_0x4cce5e['id']},{})[_0x2d4a('0x28')](function(){return _0x31576d;});}else{return _0x31576d;}})[_0x2d4a('0x4d')](function(_0x165c00){logger[_0x2d4a('0x2d')](_0x2d4a('0x59'),_0x165c00);throw _0x165c00;});}return _0x31576d;})[_0x2d4a('0x28')](respondWithResult(_0x52a468,null))[_0x2d4a('0x4d')](handleError(_0x52a468,null));};function Extension(_0x352b50,_0x346f2b,_0x302323,_0x5c7cf9){this[_0x2d4a('0x5a')]=_0x2d4a('0x5b');this['exten']=_0x352b50;this[_0x2d4a('0x5c')]=_0x302323;this[_0x2d4a('0x34')]=_0x2d4a('0x5d');this[_0x2d4a('0x5e')]=_0x2d4a('0x5f');this[_0x2d4a('0x60')]=_0x346f2b;this[_0x2d4a('0x61')]=_0x5c7cf9;}function createVoicePrefixExtensions(_0x43e6a6,_0x1034d2,_0x282df8){return new BPromise(function(_0x5bbc96,_0x2bd137){var _0x8ae6bd=new Extension(formatPrefixName(_0x43e6a6[_0x2d4a('0x62')]),0x1,'NoOp',_0x2d4a('0x63'));_0x8ae6bd[_0x2d4a('0x64')]=_0x43e6a6['id'];return db[_0x2d4a('0x65')][_0x2d4a('0x4f')](_0x8ae6bd,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x278bbc){var _0x7e2699=_0x278bbc[_0x2d4a('0x29')]({'plain':!![]});var _0x1ed616=_['map'](addVoicePrefixExtensions(_0x43e6a6,_0x1034d2),function(_0x21b8e9){_0x21b8e9[_0x2d4a('0x52')]=_0x7e2699['id'];_0x21b8e9[_0x2d4a('0x64')]=_0x43e6a6['id'];return _0x21b8e9;});return db[_0x2d4a('0x65')][_0x2d4a('0x66')](_0x1ed616,{'transaction':_0x282df8})[_0x2d4a('0x28')](function(_0x53f52b){if(!_0x53f52b){return _0x2bd137(_0x2d4a('0x67'));}else{return _0x5bbc96(_0x53f52b);}})[_0x2d4a('0x4d')](function(_0x22707f){return _0x2bd137(_0x22707f);});});;});};function addVoicePrefixExtensions(_0x4809af,_0x465c89){var _0x442691=[];var _0x4f4a09=formatPrefixName(_0x4809af[_0x2d4a('0x62')]);_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x2,'Set',_0x2d4a('0x69')+_0x4809af['name']));if(_0x4809af['callerIdAll']){_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6a'),_0x2d4a('0x6b')+_0x4809af[_0x2d4a('0x6c')]));}else{_0x442691['push'](new Extension(_0x4f4a09,0x3,_0x2d4a('0x6d'),_0x2d4a('0x6e')));}_0x442691[_0x2d4a('0x68')](new Extension(_0x4f4a09,0x4,_0x2d4a('0x6f'),_0x465c89['context']+','+'${EXTEN:'+(0x8+_0x4809af[_0x2d4a('0x2e')][_0x2d4a('0x3d')])+'}'+','+0x1));return _0x442691;}function formatPrefixName(_0x2a2441){var _0x2aa9e8='_';for(var _0x9e6321=0x0;_0x9e6321<_0x2a2441[_0x2d4a('0x3d')];_0x9e6321++){if(_0x2a2441[_0x2d4a('0x70')](_0x9e6321)=='-'){_0x2aa9e8+=_0x2a2441['charAt'](_0x9e6321);}else{_0x2aa9e8+='['+_0x2a2441[_0x2d4a('0x70')](_0x9e6321)+']';}}_0x2aa9e8+='.';return _0x2aa9e8;}exports[_0x2d4a('0x27')]=function(_0xf3d514,_0x398439,_0x59810d){var _0x299bdf=_0xf3d514[_0x2d4a('0x51')];_0x299bdf[_0x2d4a('0x62')]=_0x2d4a('0x71')+_0x299bdf['name']+'-';return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x55d565){return db[_0x2d4a('0x31')][_0x2d4a('0x27')](_0x299bdf,{'where':{'id':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db['VoiceExtension'][_0x2d4a('0x2c')]({'where':{'VoicePrefixId':_0x299bdf['id']},'transaction':_0x55d565})[_0x2d4a('0x28')](function(){return db[_0x2d4a('0x65')][_0x2d4a('0x4c')]({'where':{'id':_0x299bdf[_0x2d4a('0x52')]},'raw':!![]})[_0x2d4a('0x28')](function(_0x3bc965){return createVoicePrefixExtensions(_0x299bdf,_0x3bc965,_0x55d565);});});});})['then'](function(){return db[_0x2d4a('0x31')][_0x2d4a('0x73')](_0x299bdf['id']);})[_0x2d4a('0x28')](respondWithResult(_0x398439,null))[_0x2d4a('0x4d')](handleError(_0x398439,null));};exports[_0x2d4a('0x74')]=function(_0x55ebbb,_0x38e623,_0x5aead3){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x55ebbb[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x38e623,null))[_0x2d4a('0x28')](function(_0x2ba9c2){if(_0x2ba9c2){return _0x2ba9c2[_0x2d4a('0x74')](_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')],_[_0x2d4a('0x76')](_0x55ebbb['body'],[_0x2d4a('0x75'),'id'])||{})['spread'](function(_0x3d7d7d){for(var _0x3c284d=0x0;_0x3c284d<_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x3c284d+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':Number(_0x55ebbb[_0x2d4a('0x51')][_0x2d4a('0x75')][_0x3c284d]),'VoicePrefixId':Number(_0x55ebbb['params']['id'])});}return _0x3d7d7d;});}})[_0x2d4a('0x28')](respondWithResult(_0x38e623,null))[_0x2d4a('0x4d')](handleError(_0x38e623,null));};exports[_0x2d4a('0x79')]=function(_0xcdf787,_0x574285,_0x36d253){return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0xcdf787[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x574285,null))[_0x2d4a('0x28')](function(_0x5769be){if(_0x5769be){return _0x5769be[_0x2d4a('0x79')](_0xcdf787[_0x2d4a('0x37')]['ids'])[_0x2d4a('0x28')](function(){if(_[_0x2d4a('0x7a')](_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')])){for(var _0x429579=0x0;_0x429579<_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')][_0x2d4a('0x3d')];_0x429579+=0x1){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787['query'][_0x2d4a('0x75')][_0x429579]),'VoicePrefixId':Number(_0xcdf787['params']['id'])});}}else{socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':Number(_0xcdf787[_0x2d4a('0x37')][_0x2d4a('0x75')]),'VoicePrefixId':Number(_0xcdf787[_0x2d4a('0x4e')]['id'])});}});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x574285,null))[_0x2d4a('0x4d')](handleError(_0x574285,null));};exports['getAgents']=function(_0x119c59,_0x2ebb9e,_0xc11b2e){var _0xfc7b53={};var _0x47377e={};var _0x5e7f23;var _0x4ebda1;return db['VoicePrefix'][_0x2d4a('0x7c')]({'where':{'id':_0x119c59[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x2ebb9e,null))['then'](function(_0x135f58){if(_0x135f58){_0x5e7f23=_0x135f58;_0x47377e[_0x2d4a('0x3a')]=_[_0x2d4a('0x38')](db[_0x2d4a('0x7d')][_0x2d4a('0x32')]);_0x47377e[_0x2d4a('0x37')]=_['keys'](_0x119c59[_0x2d4a('0x37')]);_0x47377e['filters']=_[_0x2d4a('0x39')](_0x47377e[_0x2d4a('0x3a')],_0x47377e['query']);_0xfc7b53[_0x2d4a('0x3b')]=_['intersection'](_0x47377e['model'],qs['fields'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3c')]));_0xfc7b53[_0x2d4a('0x3b')]=_0xfc7b53['attributes'][_0x2d4a('0x3d')]?_0xfc7b53[_0x2d4a('0x3b')]:_0x47377e[_0x2d4a('0x3a')];_0xfc7b53[_0x2d4a('0x3f')]=qs['sort'](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x40')]);_0xfc7b53['where']=qs[_0x2d4a('0x42')](_[_0x2d4a('0x43')](_0x119c59['query'],_0x47377e[_0x2d4a('0x42')]));if(_0x119c59['query']['filter']){_0xfc7b53[_0x2d4a('0x41')]=_['merge'](_0xfc7b53[_0x2d4a('0x41')],{'$or':_[_0x2d4a('0x36')](_0xfc7b53[_0x2d4a('0x3b')],function(_0x44d3b3){var _0x5e939f={};_0x5e939f[_0x44d3b3]={'$like':'%'+_0x119c59[_0x2d4a('0x37')]['filter']+'%'};return _0x5e939f;})});}_0xfc7b53=_[_0x2d4a('0x45')]({},_0xfc7b53,_0x119c59[_0x2d4a('0x4b')]);return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x45f6b7){if(_0x45f6b7){_0x4ebda1=_0x45f6b7['length'];if(!_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0xfc7b53['limit']=qs[_0x2d4a('0x21')](_0x119c59['query']['limit']);_0xfc7b53[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x119c59[_0x2d4a('0x37')][_0x2d4a('0x20')]);}return _0x5e7f23[_0x2d4a('0x7e')](_0xfc7b53);}})[_0x2d4a('0x28')](function(_0x2bffb4){if(_0x2bffb4){return _0x2bffb4?{'count':_0x4ebda1,'rows':_0x2bffb4}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x2ebb9e,null))[_0x2d4a('0x4d')](handleError(_0x2ebb9e,null));};exports[_0x2d4a('0x80')]=function(_0x5ecf3e,_0x16c4fd,_0x2b29b1){var _0x4647cb={};var _0x10d86c={};var _0x36b067;var _0x1cb5b3;return db[_0x2d4a('0x31')][_0x2d4a('0x7c')]({'where':{'id':_0x5ecf3e['params']['id']}})[_0x2d4a('0x28')](handleEntityNotFound(_0x16c4fd,null))[_0x2d4a('0x28')](function(_0xa4c947){if(_0xa4c947){_0x36b067=_0xa4c947;_0x10d86c['model']=_[_0x2d4a('0x38')](db['Team'][_0x2d4a('0x32')]);_0x10d86c[_0x2d4a('0x37')]=_[_0x2d4a('0x38')](_0x5ecf3e[_0x2d4a('0x37')]);_0x10d86c['filters']=_[_0x2d4a('0x39')](_0x10d86c['model'],_0x10d86c[_0x2d4a('0x37')]);_0x4647cb[_0x2d4a('0x3b')]=_[_0x2d4a('0x39')](_0x10d86c['model'],qs[_0x2d4a('0x3c')](_0x5ecf3e['query'][_0x2d4a('0x3c')]));_0x4647cb[_0x2d4a('0x3b')]=_0x4647cb[_0x2d4a('0x3b')][_0x2d4a('0x3d')]?_0x4647cb[_0x2d4a('0x3b')]:_0x10d86c[_0x2d4a('0x3a')];_0x4647cb[_0x2d4a('0x3f')]=qs[_0x2d4a('0x40')](_0x5ecf3e[_0x2d4a('0x37')]['sort']);_0x4647cb['where']=qs['filters'](_[_0x2d4a('0x43')](_0x5ecf3e['query'],_0x10d86c[_0x2d4a('0x42')]));if(_0x5ecf3e['query'][_0x2d4a('0x44')]){_0x4647cb[_0x2d4a('0x41')]=_['merge'](_0x4647cb['where'],{'$or':_[_0x2d4a('0x36')](_0x4647cb['attributes'],function(_0x279c26){var _0x643012={};_0x643012[_0x279c26]={'$like':'%'+_0x5ecf3e[_0x2d4a('0x37')]['filter']+'%'};return _0x643012;})});}_0x4647cb=_[_0x2d4a('0x45')]({},_0x4647cb,_0x5ecf3e[_0x2d4a('0x4b')]);return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x1c3c0f){if(_0x1c3c0f){_0x1cb5b3=_0x1c3c0f[_0x2d4a('0x3d')];if(!_0x5ecf3e[_0x2d4a('0x37')][_0x2d4a('0x3e')](_0x2d4a('0x7f'))){_0x4647cb[_0x2d4a('0x21')]=qs[_0x2d4a('0x21')](_0x5ecf3e[_0x2d4a('0x37')]['limit']);_0x4647cb[_0x2d4a('0x20')]=qs[_0x2d4a('0x20')](_0x5ecf3e[_0x2d4a('0x37')]['offset']);}return _0x36b067[_0x2d4a('0x80')](_0x4647cb);}})[_0x2d4a('0x28')](function(_0x250a9c){if(_0x250a9c){return _0x250a9c?{'count':_0x1cb5b3,'rows':_0x250a9c}:null;}})[_0x2d4a('0x28')](respondWithResult(_0x16c4fd,null))[_0x2d4a('0x4d')](handleError(_0x16c4fd,null));};exports['addTeams']=function(_0x438769,_0x1483af,_0x5413c1){var _0x2d5122=_0x438769['body'][_0x2d4a('0x75')];var _0x1cd7fd;return db[_0x2d4a('0x81')][_0x2d4a('0x47')]({'where':{'id':_0x2d5122},'attributes':['id'],'include':[{'model':db[_0x2d4a('0x7d')],'as':_0x2d4a('0x82'),'attributes':['id',_0x2d4a('0x2e'),'online',_0x2d4a('0x83'),_0x2d4a('0x84')],'raw':!![]}]})[_0x2d4a('0x28')](function(_0x1e5be2){if(_0x1e5be2){_0x1cd7fd=_0x1e5be2;var _0x139e4e=_[_0x2d4a('0x85')](_0x1e5be2,function(_0x58b196){var _0x23577f=_0x58b196[_0x2d4a('0x29')]({'plain':!![]});return _0x23577f[_0x2d4a('0x82')];});return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x438769['params']['id']}})['then'](function(_0x3e276d){return db[_0x2d4a('0x72')][_0x2d4a('0x50')](function(_0x2fee11){return _0x3e276d[_0x2d4a('0x86')](_0x2d5122,{'transaction':_0x2fee11})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x1cd7fd,function(_0x1adcbc){return db[_0x2d4a('0x88')]['upsert']({'TeamId':_0x1adcbc['id'],'VoicePrefixId':_0x438769['params']['id']},{'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){return BPromise[_0x2d4a('0x87')](_0x139e4e,function(_0x3b4585){return db[_0x2d4a('0x89')][_0x2d4a('0x8a')]({'where':{'UserId':_0x3b4585['id'],'VoicePrefixId':_0x438769[_0x2d4a('0x4e')]['id']},'transaction':_0x2fee11});});})[_0x2d4a('0x28')](function(){_0x139e4e[_0x2d4a('0x8b')](function(_0x12914d){socket[_0x2d4a('0x77')](_0x2d4a('0x78'),{'UserId':_0x12914d['id'],'VoicePrefixId':_0x3e276d['id']});});});});});}})[_0x2d4a('0x28')](respondWithStatusCode(_0x1483af,null))['catch'](handleError(_0x1483af,null));};exports['removeTeams']=function(_0x51cba2,_0x448b4d,_0x4cefec){return db['Team'][_0x2d4a('0x47')]({'where':{'id':_0x51cba2[_0x2d4a('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2d4a('0x28')](handleEntityNotFound(_0x448b4d,null))[_0x2d4a('0x28')](function(_0x1e05c5){var _0x3e199a=_[_0x2d4a('0x36')](_0x1e05c5,'id');var _0x357dfc=[];var _0xd80165=[];var _0x448664=squel[_0x2d4a('0x8c')]();_0x448664[_0x2d4a('0x8d')]('tq.TeamId')[_0x2d4a('0x8e')](_0x2d4a('0x8f'),'tq')[_0x2d4a('0x90')](_0x2d4a('0x91'),'ut',_0x2d4a('0x92'))[_0x2d4a('0x41')]('VoicePrefixId\x20=\x20?',_0x51cba2[_0x2d4a('0x4e')]['id']);for(var _0x3030e1=0x0;_0x3030e1<_0x1e05c5['length'];_0x3030e1+=0x1){let _0xc5500=_0x1e05c5[_0x3030e1];for(var _0xe198b=0x0;_0xe198b<_0xc5500['Agents']['length'];_0xe198b+=0x1){let _0x497b03=_0xc5500['Agents'][_0xe198b];var _0xb81202=_0x448664['clone']();_0xb81202[_0x2d4a('0x41')](_0x2d4a('0x93'),_0x497b03['id']);_0xd80165[_0x2d4a('0x68')](db[_0x2d4a('0x72')][_0x2d4a('0x37')](_0xb81202[_0x2d4a('0x94')](),{'type':db[_0x2d4a('0x72')]['QueryTypes'][_0x2d4a('0x95')]})['then'](function(_0x2b6040){if(_0x2b6040[_0x2d4a('0x3d')]===0x1){return _0x497b03['id'];}else{var _0x137c57=_[_0x2d4a('0x96')](_[_0x2d4a('0x36')](_0x2b6040,_0x2d4a('0x97')),function(_0x29108f){return _['includes'](_0x3e199a,_0x29108f);});if(_0x137c57){return _0x497b03['id'];}}}));}}return BPromise[_0x2d4a('0x98')](_0xd80165)['then'](function(_0x1d4cc3){_0x357dfc=_(_0x357dfc)[_0x2d4a('0x99')](_0x1d4cc3)[_0x2d4a('0x9a')]()['value']();return db[_0x2d4a('0x31')][_0x2d4a('0x4c')]({'where':{'id':_0x51cba2[_0x2d4a('0x4e')]['id']}})[_0x2d4a('0x28')](function(_0x108cd1){return db[_0x2d4a('0x72')]['transaction'](function(_0x29a294){return _0x108cd1['removeTeams'](_0x51cba2[_0x2d4a('0x37')]['ids'],{'transaction':_0x29a294})['then'](function(){if(!_[_0x2d4a('0x9b')](_0x357dfc)){return _0x108cd1['removeAgents'](_0x357dfc,{'transaction':_0x29a294});}})['then'](function(){_0x357dfc[_0x2d4a('0x8b')](function(_0x206717){socket[_0x2d4a('0x77')](_0x2d4a('0x7b'),{'UserId':_0x206717,'VoicePrefixId':_0x108cd1['id']});});});});});});})[_0x2d4a('0x28')](respondWithStatusCode(_0x448b4d,null))[_0x2d4a('0x4d')](handleError(_0x448b4d,null));};
\ No newline at end of file
+var _0xe820=['appdata','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','User','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','value','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','name','send','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority'];(function(_0x3ce85d,_0x43f4e9){var _0x1db583=function(_0x30155a){while(--_0x30155a){_0x3ce85d['push'](_0x3ce85d['shift']());}};_0x1db583(++_0x43f4e9);}(_0xe820,0xd2));var _0x0e82=function(_0x1a32f6,_0x49f388){_0x1a32f6=_0x1a32f6-0x0;var _0x262059=_0xe820[_0x1a32f6];return _0x262059;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];config[_0x0e82('0x18')]=_[_0x0e82('0x19')](config[_0x0e82('0x18')],{'host':_0x0e82('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e82('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x1e4ddb,_0x4b748a){_0x4b748a=_0x4b748a||0xcc;return function(_0x5b4ffd){if(_0x5b4ffd){return _0x1e4ddb['sendStatus'](_0x4b748a);}return _0x1e4ddb[_0x0e82('0x1b')](_0x4b748a)['end']();};}function respondWithResult(_0x585b9b,_0x1149b1){_0x1149b1=_0x1149b1||0xc8;return function(_0x582f45){if(_0x582f45){return _0x585b9b[_0x0e82('0x1b')](_0x1149b1)[_0x0e82('0x1c')](_0x582f45);}};}function respondWithFilteredResult(_0x233c6d,_0x315ce4){return function(_0x53622b){if(_0x53622b){var _0x25ac21=typeof _0x315ce4[_0x0e82('0x1d')]===_0x0e82('0x1e')&&typeof _0x315ce4[_0x0e82('0x1f')]===_0x0e82('0x1e');var _0x1230e6=_0x53622b[_0x0e82('0x20')];var _0x3735c0=_0x25ac21?0x0:_0x315ce4[_0x0e82('0x1d')];var _0x224455=_0x25ac21?_0x53622b[_0x0e82('0x20')]:_0x315ce4['offset']+_0x315ce4['limit'];var _0x294696;if(_0x224455>=_0x1230e6){_0x224455=_0x1230e6;_0x294696=0xc8;}else{_0x294696=0xce;}_0x233c6d[_0x0e82('0x1b')](_0x294696);return _0x233c6d[_0x0e82('0x21')](_0x0e82('0x22'),_0x3735c0+'-'+_0x224455+'/'+_0x1230e6)[_0x0e82('0x1c')](_0x53622b);}return null;};}function patchUpdates(_0x1bdad4){return function(_0x39fcbe){try{jsonpatch[_0x0e82('0x23')](_0x39fcbe,_0x1bdad4,!![]);}catch(_0x56b3ad){return BPromise[_0x0e82('0x24')](_0x56b3ad);}return _0x39fcbe[_0x0e82('0x25')]();};}function saveUpdates(_0x3d6c28,_0x24f883){return function(_0x507f08){if(_0x507f08){return _0x507f08[_0x0e82('0x26')](_0x3d6c28)[_0x0e82('0x27')](function(_0x7a9399){return _0x7a9399;});}return null;};}function removeEntity(_0x16e11c,_0x4900d3){return function(_0x1ef751){if(_0x1ef751){return _0x1ef751['destroy']()['then'](function(){var _0x384f88=_0x1ef751[_0x0e82('0x28')]({'plain':!![]});var _0x4c5fc1=_0x0e82('0x29');return db[_0x0e82('0x2a')][_0x0e82('0x2b')]({'where':{'type':_0x4c5fc1,'resourceId':_0x384f88['id']}})['then'](function(){return _0x1ef751;});})[_0x0e82('0x27')](function(){_0x16e11c[_0x0e82('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xabc536,_0x59a5b6){return function(_0x4300f9){if(!_0x4300f9){_0xabc536[_0x0e82('0x2c')](0x194);}return _0x4300f9;};}function handleError(_0x551f96,_0x38cbbc){_0x38cbbc=_0x38cbbc||0x1f4;return function(_0x268af5){logger[_0x0e82('0x2d')](_0x268af5['stack']);if(_0x268af5['name']){delete _0x268af5[_0x0e82('0x2e')];}_0x551f96['status'](_0x38cbbc)[_0x0e82('0x2f')](_0x268af5);};}exports['index']=function(_0x1a3b2e,_0x264022){var _0x44e177={},_0x56ca79={},_0x45a40e={'count':0x0,'rows':[]};var _0x59d2f8=_[_0x0e82('0x30')](db[_0x0e82('0x31')][_0x0e82('0x32')],function(_0x30c993){return{'name':_0x30c993[_0x0e82('0x33')],'type':_0x30c993[_0x0e82('0x34')]['key']};});_0x56ca79[_0x0e82('0x35')]=_[_0x0e82('0x30')](_0x59d2f8,_0x0e82('0x2e'));_0x56ca79[_0x0e82('0x36')]=_[_0x0e82('0x37')](_0x1a3b2e[_0x0e82('0x36')]);_0x56ca79[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],_0x56ca79[_0x0e82('0x36')]);_0x44e177[_0x0e82('0x3a')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x1a3b2e[_0x0e82('0x36')]['fields']));_0x44e177[_0x0e82('0x3a')]=_0x44e177[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x44e177[_0x0e82('0x3a')]:_0x56ca79['model'];if(!_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x3d')]('nolimit')){_0x44e177[_0x0e82('0x1f')]=qs['limit'](_0x1a3b2e['query'][_0x0e82('0x1f')]);_0x44e177[_0x0e82('0x1d')]=qs[_0x0e82('0x1d')](_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x1d')]);}_0x44e177[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x1a3b2e['query']['sort']);_0x44e177[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x1a3b2e[_0x0e82('0x36')],_0x56ca79[_0x0e82('0x38')]),_0x59d2f8);if(_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x42')]){_0x44e177[_0x0e82('0x40')]=_['merge'](_0x44e177[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x59d2f8,function(_0x233a18){if(_0x233a18[_0x0e82('0x34')]!==_0x0e82('0x43')){var _0x3d0a45={};_0x3d0a45[_0x233a18[_0x0e82('0x2e')]]={'$like':'%'+_0x1a3b2e['query'][_0x0e82('0x42')]+'%'};return _0x3d0a45;}})});}_0x44e177=_[_0x0e82('0x44')]({},_0x44e177,_0x1a3b2e[_0x0e82('0x45')]);var _0x36fe4c={'where':_0x44e177[_0x0e82('0x40')]};return db[_0x0e82('0x31')][_0x0e82('0x20')](_0x36fe4c)['then'](function(_0x581764){_0x45a40e['count']=_0x581764;if(_0x1a3b2e['query']['includeAll']){_0x44e177['include']=[{'all':!![]}];}return db[_0x0e82('0x31')][_0x0e82('0x46')](_0x44e177);})[_0x0e82('0x27')](function(_0x199495){_0x45a40e[_0x0e82('0x47')]=_0x199495;return _0x45a40e;})[_0x0e82('0x27')](respondWithFilteredResult(_0x264022,_0x44e177))[_0x0e82('0x48')](handleError(_0x264022,null));};exports[_0x0e82('0x49')]=function(_0x55b53a,_0x484f94){var _0x2ae914={'raw':![],'where':{'id':_0x55b53a[_0x0e82('0x4a')]['id']}},_0x36a0c2={};_0x36a0c2[_0x0e82('0x35')]=_[_0x0e82('0x37')](db[_0x0e82('0x31')][_0x0e82('0x32')]);_0x36a0c2[_0x0e82('0x36')]=_['keys'](_0x55b53a[_0x0e82('0x36')]);_0x36a0c2['filters']=_[_0x0e82('0x39')](_0x36a0c2['model'],_0x36a0c2[_0x0e82('0x36')]);_0x2ae914['attributes']=_[_0x0e82('0x39')](_0x36a0c2[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x55b53a['query']['fields']));_0x2ae914[_0x0e82('0x3a')]=_0x2ae914[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x2ae914['attributes']:_0x36a0c2[_0x0e82('0x35')];if(_0x55b53a['query'][_0x0e82('0x4b')]){_0x2ae914[_0x0e82('0x4c')]=[{'all':!![]}];}_0x2ae914=_[_0x0e82('0x44')]({},_0x2ae914,_0x55b53a[_0x0e82('0x45')]);return db[_0x0e82('0x31')][_0x0e82('0x4d')](_0x2ae914)[_0x0e82('0x27')](handleEntityNotFound(_0x484f94,null))[_0x0e82('0x27')](respondWithResult(_0x484f94,null))[_0x0e82('0x48')](handleError(_0x484f94,null));};exports[_0x0e82('0x2b')]=function(_0x41e27e,_0x22c249){return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x41e27e[_0x0e82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c249,null))[_0x0e82('0x27')](removeEntity(_0x22c249,null))['catch'](handleError(_0x22c249,null));};exports['describe']=function(_0x42a535,_0x505663){return db[_0x0e82('0x31')][_0x0e82('0x4e')]()[_0x0e82('0x27')](respondWithResult(_0x505663,null))[_0x0e82('0x48')](handleError(_0x505663,null));};exports[_0x0e82('0x4f')]=function(_0x535f6d,_0x104bfe){var _0x4cb6e7;return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x42c4a7){return db[_0x0e82('0x31')][_0x0e82('0x4f')](_0x535f6d['body'],{'transaction':_0x42c4a7})[_0x0e82('0x27')](function(_0x22d56b){_0x4cb6e7=_0x22d56b[_0x0e82('0x28')]({'plain':!![]});return db[_0x0e82('0x52')][_0x0e82('0x4d')]({'where':{'id':_0x4cb6e7['VoiceExtensionId']},'raw':!![]})[_0x0e82('0x27')](function(_0x348b00){return createVoicePrefixExtensions(_0x4cb6e7,_0x348b00,_0x42c4a7);});});})[_0x0e82('0x27')](function(){var _0x1e6d69=_0x535f6d[_0x0e82('0x53')][_0x0e82('0x28')]({'plain':!![]});if(!_0x1e6d69)throw new Error(_0x0e82('0x54'));if(_0x1e6d69[_0x0e82('0x55')]===_0x0e82('0x53')){var _0x2852d4=_0x4cb6e7;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x1e6d69[_0x0e82('0x56')]},'raw':!![]})['then'](function(_0x23741c){if(_0x23741c&&_0x23741c[_0x0e82('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x2852d4[_0x0e82('0x2e')],'resourceId':_0x2852d4['id'],'type':_0x23741c[_0x0e82('0x2e')],'sectionId':_0x23741c['id']},{})[_0x0e82('0x27')](function(){return _0x4cb6e7;});}else{return _0x4cb6e7;}})[_0x0e82('0x48')](function(_0x174da5){logger[_0x0e82('0x2d')](_0x0e82('0x58'),_0x174da5);throw _0x174da5;});}return _0x4cb6e7;})[_0x0e82('0x27')](respondWithResult(_0x104bfe,null))[_0x0e82('0x48')](handleError(_0x104bfe,null));};function Extension(_0x3b35e0,_0x4ce423,_0x30e9f1,_0x21aaac){this[_0x0e82('0x59')]=_0x0e82('0x5a');this[_0x0e82('0x5b')]=_0x3b35e0;this[_0x0e82('0x5c')]=_0x30e9f1;this[_0x0e82('0x34')]=_0x0e82('0x5d');this['description']=_0x0e82('0x5e');this[_0x0e82('0x5f')]=_0x4ce423;this[_0x0e82('0x60')]=_0x21aaac;}function createVoicePrefixExtensions(_0x1ea2fc,_0x21c870,_0x28f3b7){return new BPromise(function(_0x2d1e59,_0x11ef9e){var _0x20bf0c=new Extension(formatPrefixName(_0x1ea2fc['prefix']),0x1,_0x0e82('0x61'),'Voice\x20Prefix');_0x20bf0c[_0x0e82('0x62')]=_0x1ea2fc['id'];return db['VoiceExtension'][_0x0e82('0x4f')](_0x20bf0c,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x5f3ec3){var _0x30e0a3=_0x5f3ec3[_0x0e82('0x28')]({'plain':!![]});var _0x244b42=_[_0x0e82('0x30')](addVoicePrefixExtensions(_0x1ea2fc,_0x21c870),function(_0x336df1){_0x336df1['VoiceExtensionId']=_0x30e0a3['id'];_0x336df1[_0x0e82('0x62')]=_0x1ea2fc['id'];return _0x336df1;});return db['VoiceExtension']['bulkCreate'](_0x244b42,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x2cf29f){if(!_0x2cf29f){return _0x11ef9e(_0x0e82('0x63'));}else{return _0x2d1e59(_0x2cf29f);}})[_0x0e82('0x48')](function(_0x2bdca1){return _0x11ef9e(_0x2bdca1);});});;});};function addVoicePrefixExtensions(_0xa4fe1f,_0xb1a061){var _0x41ef93=[];var _0x277327=formatPrefixName(_0xa4fe1f[_0x0e82('0x64')]);_0x41ef93['push'](new Extension(_0x277327,0x2,'Set',_0x0e82('0x65')+_0xa4fe1f['name']));if(_0xa4fe1f[_0x0e82('0x66')]){_0x41ef93[_0x0e82('0x67')](new Extension(_0x277327,0x3,'Set',_0x0e82('0x68')+_0xa4fe1f[_0x0e82('0x66')]));}else{_0x41ef93['push'](new Extension(_0x277327,0x3,_0x0e82('0x61'),_0x0e82('0x69')));}_0x41ef93['push'](new Extension(_0x277327,0x4,_0x0e82('0x6a'),_0xb1a061['context']+','+_0x0e82('0x6b')+(0x8+_0xa4fe1f[_0x0e82('0x2e')][_0x0e82('0x3c')])+'}'+','+0x1));return _0x41ef93;}function formatPrefixName(_0x3bdc68){var _0x34faf5='_';for(var _0x75a64d=0x0;_0x75a64d<_0x3bdc68[_0x0e82('0x3c')];_0x75a64d++){if(_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)=='-'){_0x34faf5+=_0x3bdc68[_0x0e82('0x6c')](_0x75a64d);}else{_0x34faf5+='['+_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)+']';}}_0x34faf5+='.';return _0x34faf5;}exports['update']=function(_0x39911a,_0x4a696b,_0x131698){var _0x2dfd03=_0x39911a[_0x0e82('0x6d')];_0x2dfd03['prefix']=_0x0e82('0x6e')+_0x2dfd03[_0x0e82('0x2e')]+'-';return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x1a67bc){return db['VoicePrefix'][_0x0e82('0x26')](_0x2dfd03,{'where':{'id':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db[_0x0e82('0x52')][_0x0e82('0x2b')]({'where':{'VoicePrefixId':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db['VoiceExtension'][_0x0e82('0x4d')]({'where':{'id':_0x2dfd03[_0x0e82('0x6f')]},'raw':!![]})[_0x0e82('0x27')](function(_0x22791b){return createVoicePrefixExtensions(_0x2dfd03,_0x22791b,_0x1a67bc);});});});})[_0x0e82('0x27')](function(){return db[_0x0e82('0x31')][_0x0e82('0x70')](_0x2dfd03['id']);})[_0x0e82('0x27')](respondWithResult(_0x4a696b,null))[_0x0e82('0x48')](handleError(_0x4a696b,null));};exports['addAgents']=function(_0x4249fd,_0x328d74,_0x480d15){return db['VoicePrefix']['find']({'where':{'id':_0x4249fd[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x328d74,null))[_0x0e82('0x27')](function(_0x542b28){if(_0x542b28){return _0x542b28[_0x0e82('0x71')](_0x4249fd['body'][_0x0e82('0x72')],_[_0x0e82('0x73')](_0x4249fd[_0x0e82('0x6d')],[_0x0e82('0x72'),'id'])||{})[_0x0e82('0x74')](function(_0x48ac18){for(var _0x28097c=0x0;_0x28097c<_0x4249fd[_0x0e82('0x6d')]['ids'][_0x0e82('0x3c')];_0x28097c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x76'),{'UserId':Number(_0x4249fd['body'][_0x0e82('0x72')][_0x28097c]),'VoicePrefixId':Number(_0x4249fd['params']['id'])});}return _0x48ac18;});}})[_0x0e82('0x27')](respondWithResult(_0x328d74,null))[_0x0e82('0x48')](handleError(_0x328d74,null));};exports[_0x0e82('0x77')]=function(_0x5ca20d,_0xe258d4,_0x115800){return db[_0x0e82('0x31')][_0x0e82('0x4d')]({'where':{'id':_0x5ca20d['params']['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0xe258d4,null))[_0x0e82('0x27')](function(_0x168bf1){if(_0x168bf1){return _0x168bf1[_0x0e82('0x77')](_0x5ca20d[_0x0e82('0x36')]['ids'])[_0x0e82('0x27')](function(){if(_['isArray'](_0x5ca20d[_0x0e82('0x36')]['ids'])){for(var _0x40e10c=0x0;_0x40e10c<_0x5ca20d[_0x0e82('0x36')]['ids'][_0x0e82('0x3c')];_0x40e10c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d['query']['ids'][_0x40e10c]),'VoicePrefixId':Number(_0x5ca20d['params']['id'])});}}else{socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d[_0x0e82('0x36')]['ids']),'VoicePrefixId':Number(_0x5ca20d[_0x0e82('0x4a')]['id'])});}});}})[_0x0e82('0x27')](respondWithStatusCode(_0xe258d4,null))[_0x0e82('0x48')](handleError(_0xe258d4,null));};exports[_0x0e82('0x79')]=function(_0x183fe7,_0x27928f,_0x6fcbe1){var _0x446a39={};var _0x556a2d={};var _0x445d82;var _0x384428;return db[_0x0e82('0x31')][_0x0e82('0x7a')]({'where':{'id':_0x183fe7[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x27928f,null))[_0x0e82('0x27')](function(_0x42b39c){if(_0x42b39c){_0x445d82=_0x42b39c;_0x556a2d['model']=_[_0x0e82('0x37')](db['User']['rawAttributes']);_0x556a2d['query']=_[_0x0e82('0x37')](_0x183fe7[_0x0e82('0x36')]);_0x556a2d[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x556a2d['model'],_0x556a2d[_0x0e82('0x36')]);_0x446a39['attributes']=_[_0x0e82('0x39')](_0x556a2d[_0x0e82('0x35')],qs['fields'](_0x183fe7[_0x0e82('0x36')]['fields']));_0x446a39['attributes']=_0x446a39[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x446a39['attributes']:_0x556a2d['model'];_0x446a39[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x446a39[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x183fe7[_0x0e82('0x36')],_0x556a2d['filters']));if(_0x183fe7['query'][_0x0e82('0x42')]){_0x446a39[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x446a39[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x446a39[_0x0e82('0x3a')],function(_0x350b6c){var _0x56804d={};_0x56804d[_0x350b6c]={'$like':'%'+_0x183fe7[_0x0e82('0x36')]['filter']+'%'};return _0x56804d;})});}_0x446a39=_['merge']({},_0x446a39,_0x183fe7[_0x0e82('0x45')]);return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x2ca1e2){if(_0x2ca1e2){_0x384428=_0x2ca1e2['length'];if(!_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x446a39[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x446a39['offset']=qs[_0x0e82('0x1d')](_0x183fe7['query']['offset']);}return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x30f947){if(_0x30f947){return _0x30f947?{'count':_0x384428,'rows':_0x30f947}:null;}})[_0x0e82('0x27')](respondWithResult(_0x27928f,null))[_0x0e82('0x48')](handleError(_0x27928f,null));};exports[_0x0e82('0x7c')]=function(_0x33eaa3,_0x57d238,_0x890f08){var _0x4a5773={};var _0x5f59f1={};var _0x48bd88;var _0x1fad5a;return db['VoicePrefix']['findOne']({'where':{'id':_0x33eaa3[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x57d238,null))['then'](function(_0x5800a5){if(_0x5800a5){_0x48bd88=_0x5800a5;_0x5f59f1[_0x0e82('0x35')]=_['keys'](db[_0x0e82('0x7d')][_0x0e82('0x32')]);_0x5f59f1[_0x0e82('0x36')]=_['keys'](_0x33eaa3[_0x0e82('0x36')]);_0x5f59f1[_0x0e82('0x38')]=_['intersection'](_0x5f59f1[_0x0e82('0x35')],_0x5f59f1[_0x0e82('0x36')]);_0x4a5773['attributes']=_[_0x0e82('0x39')](_0x5f59f1[_0x0e82('0x35')],qs['fields'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3b')]));_0x4a5773[_0x0e82('0x3a')]=_0x4a5773[_0x0e82('0x3a')]['length']?_0x4a5773['attributes']:_0x5f59f1[_0x0e82('0x35')];_0x4a5773[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x4a5773[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x33eaa3[_0x0e82('0x36')],_0x5f59f1['filters']));if(_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]){_0x4a5773[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x4a5773['where'],{'$or':_[_0x0e82('0x30')](_0x4a5773[_0x0e82('0x3a')],function(_0x51b943){var _0x148a2f={};_0x148a2f[_0x51b943]={'$like':'%'+_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]+'%'};return _0x148a2f;})});}_0x4a5773=_[_0x0e82('0x44')]({},_0x4a5773,_0x33eaa3[_0x0e82('0x45')]);return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x17a56d){if(_0x17a56d){_0x1fad5a=_0x17a56d['length'];if(!_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x4a5773[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x4a5773[_0x0e82('0x1d')]=qs['offset'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1d')]);}return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x273036){if(_0x273036){return _0x273036?{'count':_0x1fad5a,'rows':_0x273036}:null;}})['then'](respondWithResult(_0x57d238,null))[_0x0e82('0x48')](handleError(_0x57d238,null));};exports['addTeams']=function(_0x317358,_0x3691ac,_0x436572){var _0x532041=_0x317358[_0x0e82('0x6d')][_0x0e82('0x72')];var _0xae4be5;return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x532041},'attributes':['id'],'include':[{'model':db[_0x0e82('0x7e')],'as':_0x0e82('0x7f'),'attributes':['id',_0x0e82('0x2e'),_0x0e82('0x80'),_0x0e82('0x81'),'interface'],'raw':!![]}]})[_0x0e82('0x27')](function(_0x252df2){if(_0x252df2){_0xae4be5=_0x252df2;var _0xca734b=_[_0x0e82('0x82')](_0x252df2,function(_0x456bad){var _0x4ed7ba=_0x456bad['get']({'plain':!![]});return _0x4ed7ba[_0x0e82('0x7f')];});return db[_0x0e82('0x31')]['find']({'where':{'id':_0x317358['params']['id']}})[_0x0e82('0x27')](function(_0x226726){return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x326ed0){return _0x226726[_0x0e82('0x83')](_0x532041,{'transaction':_0x326ed0})['then'](function(){return BPromise[_0x0e82('0x84')](_0xae4be5,function(_0x270ad0){return db[_0x0e82('0x85')][_0x0e82('0x86')]({'TeamId':_0x270ad0['id'],'VoicePrefixId':_0x317358['params']['id']},{'transaction':_0x326ed0});});})['then'](function(){return BPromise[_0x0e82('0x84')](_0xca734b,function(_0x38a73a){return db[_0x0e82('0x87')][_0x0e82('0x88')]({'where':{'UserId':_0x38a73a['id'],'VoicePrefixId':_0x317358[_0x0e82('0x4a')]['id']},'transaction':_0x326ed0});});})['then'](function(){_0xca734b['forEach'](function(_0x3ab464){socket['emit'](_0x0e82('0x76'),{'UserId':_0x3ab464['id'],'VoicePrefixId':_0x226726['id']});});});});});}})['then'](respondWithStatusCode(_0x3691ac,null))[_0x0e82('0x48')](handleError(_0x3691ac,null));};exports[_0x0e82('0x89')]=function(_0x33d446,_0x34d730,_0x1c1a0d){return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x33d446['query'][_0x0e82('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e82('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x0e82('0x27')](handleEntityNotFound(_0x34d730,null))[_0x0e82('0x27')](function(_0x1c5350){var _0x396f44=_[_0x0e82('0x30')](_0x1c5350,'id');var _0x1d79b5=[];var _0x1e305f=[];var _0x25c63b=squel['select']();_0x25c63b[_0x0e82('0x8a')](_0x0e82('0x8b'))[_0x0e82('0x8c')](_0x0e82('0x8d'),'tq')[_0x0e82('0x8e')](_0x0e82('0x8f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0e82('0x40')](_0x0e82('0x90'),_0x33d446[_0x0e82('0x4a')]['id']);for(var _0x5d13ab=0x0;_0x5d13ab<_0x1c5350[_0x0e82('0x3c')];_0x5d13ab+=0x1){let _0xf8b029=_0x1c5350[_0x5d13ab];for(var _0x5581e6=0x0;_0x5581e6<_0xf8b029[_0x0e82('0x7f')][_0x0e82('0x3c')];_0x5581e6+=0x1){let _0x524665=_0xf8b029[_0x0e82('0x7f')][_0x5581e6];var _0x32264b=_0x25c63b[_0x0e82('0x91')]();_0x32264b[_0x0e82('0x40')](_0x0e82('0x92'),_0x524665['id']);_0x1e305f[_0x0e82('0x67')](db[_0x0e82('0x50')][_0x0e82('0x36')](_0x32264b[_0x0e82('0x93')](),{'type':db[_0x0e82('0x50')]['QueryTypes'][_0x0e82('0x94')]})['then'](function(_0x546f99){if(_0x546f99[_0x0e82('0x3c')]===0x1){return _0x524665['id'];}else{var _0x4b3009=_[_0x0e82('0x95')](_[_0x0e82('0x30')](_0x546f99,_0x0e82('0x96')),function(_0x414250){return _[_0x0e82('0x97')](_0x396f44,_0x414250);});if(_0x4b3009){return _0x524665['id'];}}}));}}return BPromise['all'](_0x1e305f)[_0x0e82('0x27')](function(_0x1df810){_0x1d79b5=_(_0x1d79b5)['union'](_0x1df810)['compact']()[_0x0e82('0x98')]();return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x33d446[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](function(_0x4f2118){return db['sequelize'][_0x0e82('0x51')](function(_0x5e7f11){return _0x4f2118[_0x0e82('0x89')](_0x33d446['query'][_0x0e82('0x72')],{'transaction':_0x5e7f11})[_0x0e82('0x27')](function(){if(!_['isEmpty'](_0x1d79b5)){return _0x4f2118[_0x0e82('0x77')](_0x1d79b5,{'transaction':_0x5e7f11});}})[_0x0e82('0x27')](function(){_0x1d79b5['forEach'](function(_0x22da22){socket[_0x0e82('0x75')]('userVoicePrefix:remove',{'UserId':_0x22da22,'VoicePrefixId':_0x4f2118['id']});});});});});});})['then'](respondWithStatusCode(_0x34d730,null))[_0x0e82('0x48')](handleError(_0x34d730,null));};
\ No newline at end of file
index 4902f07..f2af9b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddbe=['setMaxListeners','save','remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0x215258,_0x1190ad){var _0x52f6a6=function(_0x144046){while(--_0x144046){_0x215258['push'](_0x215258['shift']());}};_0x52f6a6(++_0x1190ad);}(_0xddbe,0x19b));var _0xeddb=function(_0x289a73,_0x339e45){_0x289a73=_0x289a73-0x0;var _0x45ec6d=_0xddbe[_0x289a73];return _0x45ec6d;};'use strict';var EventEmitter=require(_0xeddb('0x0'));var VoicePrefix=require(_0xeddb('0x1'))['db'][_0xeddb('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xeddb('0x3')](0x0);var events={'afterCreate':_0xeddb('0x4'),'afterUpdate':'update','afterDestroy':_0xeddb('0x5')};function emitEvent(_0x105755){return function(_0x1470ba,_0x1900fd,_0x583b59){VoicePrefixEvents['emit'](_0x105755+':'+_0x1470ba['id'],_0x1470ba);VoicePrefixEvents['emit'](_0x105755,_0x1470ba);_0x583b59(null);};}for(var e in events){if(events[_0xeddb('0x6')](e)){var event=events[e];VoicePrefix[_0xeddb('0x7')](e,emitEvent(event));}}module[_0xeddb('0x8')]=VoicePrefixEvents;
\ No newline at end of file
+var _0xa9a6=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix'];(function(_0x5a2eee,_0x34ca3a){var _0x22aba7=function(_0x1c14bb){while(--_0x1c14bb){_0x5a2eee['push'](_0x5a2eee['shift']());}};_0x22aba7(++_0x34ca3a);}(_0xa9a6,0x89));var _0x6a9a=function(_0x2953cd,_0x46eb14){_0x2953cd=_0x2953cd-0x0;var _0xce58e8=_0xa9a6[_0x2953cd];return _0xce58e8;};'use strict';var EventEmitter=require(_0x6a9a('0x0'));var VoicePrefix=require(_0x6a9a('0x1'))['db'][_0x6a9a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6a9a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6a9a('0x4'),'afterDestroy':_0x6a9a('0x5')};function emitEvent(_0x24c213){return function(_0x3d22c6,_0x562b37,_0x5aad83){VoicePrefixEvents[_0x6a9a('0x6')](_0x24c213+':'+_0x3d22c6['id'],_0x3d22c6);VoicePrefixEvents[_0x6a9a('0x6')](_0x24c213,_0x3d22c6);_0x5aad83(null);};}for(var e in events){if(events[_0x6a9a('0x7')](e)){var event=events[e];VoicePrefix[_0x6a9a('0x8')](e,emitEvent(event));}}module[_0x6a9a('0x9')]=VoicePrefixEvents;
\ No newline at end of file
index a6558b1..038fa54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8246=['moment','rimraf','../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0x8246,0xa1));var _0x6824=function(_0x440b1c,_0x2e0c71){_0x440b1c=_0x440b1c-0x0;var _0x3997a8=_0x8246[_0x440b1c];return _0x3997a8;};'use strict';var _=require(_0x6824('0x0'));var util=require(_0x6824('0x1'));var logger=require(_0x6824('0x2'))(_0x6824('0x3'));var moment=require(_0x6824('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6824('0x5'));var config=require(_0x6824('0x6'));var attributes=require('./voicePrefix.attributes');module[_0x6824('0x7')]=function(_0x50b570,_0x40c71e){return _0x50b570[_0x6824('0x8')](_0x6824('0x9'),attributes,{'tableName':_0x6824('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8a62=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util'];(function(_0x193109,_0x89b613){var _0x1b71db=function(_0x23a730){while(--_0x23a730){_0x193109['push'](_0x193109['shift']());}};_0x1b71db(++_0x89b613);}(_0x8a62,0x1d2));var _0x28a6=function(_0x269731,_0x29abd8){_0x269731=_0x269731-0x0;var _0x16c454=_0x8a62[_0x269731];return _0x16c454;};'use strict';var _=require(_0x28a6('0x0'));var util=require(_0x28a6('0x1'));var logger=require(_0x28a6('0x2'))(_0x28a6('0x3'));var moment=require(_0x28a6('0x4'));var BPromise=require(_0x28a6('0x5'));var rp=require(_0x28a6('0x6'));var fs=require('fs');var path=require(_0x28a6('0x7'));var rimraf=require(_0x28a6('0x8'));var config=require('../../config/environment');var attributes=require(_0x28a6('0x9'));module[_0x28a6('0xa')]=function(_0x137d91,_0x14247d){return _0x137d91[_0x28a6('0xb')]('VoicePrefix',attributes,{'tableName':_0x28a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d52850b..5990454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20de=['VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./voicePrefix.socket','then','info'];(function(_0x313002,_0x1b748e){var _0x8664e5=function(_0x496dfe){while(--_0x496dfe){_0x313002['push'](_0x313002['shift']());}};_0x8664e5(++_0x1b748e);}(_0x20de,0x134));var _0xe20d=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x20de[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xe20d('0x0'));var util=require('util');var moment=require(_0xe20d('0x1'));var BPromise=require(_0xe20d('0x2'));var rs=require(_0xe20d('0x3'));var fs=require('fs');var Redis=require(_0xe20d('0x4'));var db=require(_0xe20d('0x5'))['db'];var utils=require(_0xe20d('0x6'));var logger=require(_0xe20d('0x7'))(_0xe20d('0x8'));var config=require(_0xe20d('0x9'));var jayson=require(_0xe20d('0xa'));var client=jayson[_0xe20d('0xb')]['http']({'port':0x232a});config[_0xe20d('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe20d('0xd'))(new Redis(config[_0xe20d('0xc')]));require(_0xe20d('0xe'))['register'](socket);function respondWithRpcPromise(_0x288d35,_0x2df52b,_0x5b40ad){return new BPromise(function(_0x339764,_0x337c85){return client['request'](_0x288d35,_0x5b40ad)[_0xe20d('0xf')](function(_0x21763b){logger[_0xe20d('0x10')](_0xe20d('0x11'),_0x2df52b,'request\x20sent');logger['debug'](_0xe20d('0x12'),_0x2df52b,_0xe20d('0x13'),JSON[_0xe20d('0x14')](_0x21763b));if(_0x21763b[_0xe20d('0x15')]){if(_0x21763b[_0xe20d('0x15')][_0xe20d('0x16')]===0x1f4){logger[_0xe20d('0x15')](_0xe20d('0x11'),_0x2df52b,_0x21763b[_0xe20d('0x15')]['message']);return _0x337c85(_0x21763b[_0xe20d('0x15')]['message']);}logger[_0xe20d('0x15')](_0xe20d('0x11'),_0x2df52b,_0x21763b[_0xe20d('0x15')]['message']);return _0x339764(_0x21763b[_0xe20d('0x15')]['message']);}else{logger[_0xe20d('0x10')](_0xe20d('0x11'),_0x2df52b,_0xe20d('0x13'));_0x339764(_0x21763b['result'][_0xe20d('0x17')]);}})[_0xe20d('0x18')](function(_0xd96fa7){logger[_0xe20d('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x2df52b,_0xd96fa7);_0x337c85(_0xd96fa7);});});}
\ No newline at end of file
+var _0x96fd=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5310a7,_0x5c6458){var _0x17a55a=function(_0x1226fb){while(--_0x1226fb){_0x5310a7['push'](_0x5310a7['shift']());}};_0x17a55a(++_0x5c6458);}(_0x96fd,0x1e9));var _0xd96f=function(_0x11c5b0,_0x5abeac){_0x11c5b0=_0x11c5b0-0x0;var _0x4b8438=_0x96fd[_0x11c5b0];return _0x4b8438;};'use strict';var _=require('lodash');var util=require(_0xd96f('0x0'));var moment=require('moment');var BPromise=require(_0xd96f('0x1'));var rs=require(_0xd96f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd96f('0x3'))['db'];var utils=require(_0xd96f('0x4'));var logger=require(_0xd96f('0x5'))(_0xd96f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd96f('0x7'));var client=jayson[_0xd96f('0x8')]['http']({'port':0x232a});config[_0xd96f('0x9')]=_[_0xd96f('0xa')](config[_0xd96f('0x9')],{'host':_0xd96f('0xb'),'port':0x18eb});var socket=require(_0xd96f('0xc'))(new Redis(config[_0xd96f('0x9')]));require(_0xd96f('0xd'))[_0xd96f('0xe')](socket);function respondWithRpcPromise(_0x2e4482,_0x29d794,_0xd77bc5){return new BPromise(function(_0x54c112,_0x37ac24){return client[_0xd96f('0xf')](_0x2e4482,_0xd77bc5)[_0xd96f('0x10')](function(_0x4d6aa){logger[_0xd96f('0x11')](_0xd96f('0x12'),_0x29d794,'request\x20sent');logger['debug'](_0xd96f('0x13'),_0x29d794,_0xd96f('0x14'),JSON['stringify'](_0x4d6aa));if(_0x4d6aa['error']){if(_0x4d6aa[_0xd96f('0x15')][_0xd96f('0x16')]===0x1f4){logger[_0xd96f('0x15')](_0xd96f('0x12'),_0x29d794,_0x4d6aa[_0xd96f('0x15')][_0xd96f('0x17')]);return _0x37ac24(_0x4d6aa[_0xd96f('0x15')][_0xd96f('0x17')]);}logger[_0xd96f('0x15')](_0xd96f('0x12'),_0x29d794,_0x4d6aa['error'][_0xd96f('0x17')]);return _0x54c112(_0x4d6aa[_0xd96f('0x15')]['message']);}else{logger[_0xd96f('0x11')](_0xd96f('0x12'),_0x29d794,_0xd96f('0x14'));_0x54c112(_0x4d6aa[_0xd96f('0x18')][_0xd96f('0x17')]);}})[_0xd96f('0x19')](function(_0x55377c){logger[_0xd96f('0x15')](_0xd96f('0x12'),_0x29d794,_0x55377c);_0x37ac24(_0x55377c);});});}
\ No newline at end of file
index 9d56288..62b6d6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a4=['register','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x2512fd,_0x5f5bfd){var _0x576639=function(_0x516f80){while(--_0x516f80){_0x2512fd['push'](_0x2512fd['shift']());}};_0x576639(++_0x5f5bfd);}(_0x81a4,0x1a6));var _0x481a=function(_0xe4bb3d,_0x21e87e){_0xe4bb3d=_0xe4bb3d-0x0;var _0xd9e51=_0x81a4[_0xe4bb3d];return _0xd9e51;};'use strict';var VoicePrefixEvents=require(_0x481a('0x0'));var events=[_0x481a('0x1'),_0x481a('0x2'),_0x481a('0x3')];function createListener(_0x5a1f1f,_0x39262a){return function(_0x4f7de1){_0x39262a[_0x481a('0x4')](_0x5a1f1f,_0x4f7de1);};}function removeListener(_0x27a5dd,_0x2bc9ed){return function(){VoicePrefixEvents['removeListener'](_0x27a5dd,_0x2bc9ed);};}exports[_0x481a('0x5')]=function(_0x3a6458){for(var _0x17d40e=0x0,_0x14b819=events['length'];_0x17d40e<_0x14b819;_0x17d40e++){var _0x13ed10=events[_0x17d40e];var _0x13b771=createListener(_0x481a('0x6')+_0x13ed10,_0x3a6458);VoicePrefixEvents['on'](_0x13ed10,_0x13b771);}};
\ No newline at end of file
+var _0xbc4a=['voicePrefix:','./voicePrefix.events','save','remove','removeListener','register','length'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0xbc4a,0x1dd));var _0xabc4=function(_0x5db129,_0x151303){_0x5db129=_0x5db129-0x0;var _0x5ec143=_0xbc4a[_0x5db129];return _0x5ec143;};'use strict';var VoicePrefixEvents=require(_0xabc4('0x0'));var events=[_0xabc4('0x1'),_0xabc4('0x2'),'update'];function createListener(_0x497e18,_0x4d2996){return function(_0x4fc0f9){_0x4d2996['emit'](_0x497e18,_0x4fc0f9);};}function removeListener(_0x145a9d,_0x4e84f9){return function(){VoicePrefixEvents[_0xabc4('0x3')](_0x145a9d,_0x4e84f9);};}exports[_0xabc4('0x4')]=function(_0x282a1e){for(var _0x422903=0x0,_0x244d3a=events[_0xabc4('0x5')];_0x422903<_0x244d3a;_0x422903++){var _0x244a46=events[_0x422903];var _0x28ea0b=createListener(_0xabc4('0x6')+_0x244a46,_0x282a1e);VoicePrefixEvents['on'](_0x244a46,_0x28ea0b);}};
\ No newline at end of file
index 44105e6..74a6198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7b8=['get','isAuthenticated','index','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','/:id/users','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','addTeams','addAgents','/:id/lists','addLists','/:id/blacklists','addBlackLists','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller'];(function(_0x4ed4af,_0x4a1a9c){var _0x4191a3=function(_0x1616f0){while(--_0x1616f0){_0x4ed4af['push'](_0x4ed4af['shift']());}};_0x4191a3(++_0x4a1a9c);}(_0xb7b8,0x168));var _0x8b7b=function(_0x4feec1,_0x149bfb){_0x4feec1=_0x4feec1-0x0;var _0x582e2d=_0xb7b8[_0x4feec1];return _0x582e2d;};'use strict';var multer=require(_0x8b7b('0x0'));var util=require('util');var path=require(_0x8b7b('0x1'));var timeout=require(_0x8b7b('0x2'));var express=require(_0x8b7b('0x3'));var router=express[_0x8b7b('0x4')]();var fs_extra=require(_0x8b7b('0x5'));var auth=require(_0x8b7b('0x6'));var interaction=require(_0x8b7b('0x7'));var config=require('../../config/environment');var controller=require(_0x8b7b('0x8'));router[_0x8b7b('0x9')]('/',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0xb')]);router['get'](_0x8b7b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x8b7b('0x9')](_0x8b7b('0xd'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x8b7b('0x9')](_0x8b7b('0xe'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0xf')]);router[_0x8b7b('0x9')]('/:id/hopper_finals',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x10')]);router['get'](_0x8b7b('0x11'),auth[_0x8b7b('0xa')](),controller['getHopperBlacks']);router[_0x8b7b('0x9')](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x13')]);router[_0x8b7b('0x9')](_0x8b7b('0x14'),auth[_0x8b7b('0xa')](),controller['getAgents']);router[_0x8b7b('0x9')]('/:id/members',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x15')]);router[_0x8b7b('0x9')]('/:id/lists',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x8b7b('0x17')]);router[_0x8b7b('0x18')]('/',auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x19')]);router[_0x8b7b('0x18')](_0x8b7b('0x1a'),auth['isAuthenticated'](),controller[_0x8b7b('0x1b')]);router[_0x8b7b('0x18')](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x1c')]);router[_0x8b7b('0x18')](_0x8b7b('0x14'),auth['isAuthenticated'](),controller[_0x8b7b('0x1d')]);router['post'](_0x8b7b('0x1e'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x1f')]);router[_0x8b7b('0x18')](_0x8b7b('0x20'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x21')]);router['put'](_0x8b7b('0xc'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x22')]);router[_0x8b7b('0x23')](_0x8b7b('0xc'),auth[_0x8b7b('0xa')](),controller['destroy']);router['delete'](_0x8b7b('0x12'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x24')]);router['delete'](_0x8b7b('0x14'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x25')]);router['delete'](_0x8b7b('0x1e'),auth['isAuthenticated'](),controller[_0x8b7b('0x26')]);router[_0x8b7b('0x23')](_0x8b7b('0x20'),auth[_0x8b7b('0xa')](),controller[_0x8b7b('0x27')]);module[_0x8b7b('0x28')]=router;
\ No newline at end of file
+var _0xa457=['/:id/teams','addTeams','addAgents','/:id/lists','addLists','addBlackLists','put','/:id','update','delete','destroy','removeTeams','removeAgents','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa457,0xcd));var _0x7a45=function(_0x301277,_0x317057){_0x301277=_0x301277-0x0;var _0x96743e=_0xa457[_0x301277];return _0x96743e;};'use strict';var multer=require(_0x7a45('0x0'));var util=require(_0x7a45('0x1'));var path=require(_0x7a45('0x2'));var timeout=require(_0x7a45('0x3'));var express=require(_0x7a45('0x4'));var router=express[_0x7a45('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a45('0x6'));var interaction=require(_0x7a45('0x7'));var config=require(_0x7a45('0x8'));var controller=require('./voiceQueue.controller');router[_0x7a45('0x9')]('/',auth[_0x7a45('0xa')](),controller[_0x7a45('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7a45('0x9')](_0x7a45('0xc'),auth[_0x7a45('0xa')](),controller[_0x7a45('0xd')]);router[_0x7a45('0x9')](_0x7a45('0xe'),auth[_0x7a45('0xa')](),controller[_0x7a45('0xf')]);router[_0x7a45('0x9')](_0x7a45('0x10'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x11')]);router['get']('/:id/hopper_black',auth[_0x7a45('0xa')](),controller[_0x7a45('0x12')]);router[_0x7a45('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7a45('0x13')]);router[_0x7a45('0x9')](_0x7a45('0x14'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x15')]);router['get'](_0x7a45('0x16'),auth['isAuthenticated'](),controller[_0x7a45('0x17')]);router[_0x7a45('0x9')]('/:id/lists',auth[_0x7a45('0xa')](),controller[_0x7a45('0x18')]);router[_0x7a45('0x9')]('/:id/blacklists',auth[_0x7a45('0xa')](),controller[_0x7a45('0x19')]);router[_0x7a45('0x1a')]('/',auth[_0x7a45('0xa')](),controller[_0x7a45('0x1b')]);router[_0x7a45('0x1a')](_0x7a45('0x1c'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x1d')]);router[_0x7a45('0x1a')](_0x7a45('0x1e'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x1f')]);router[_0x7a45('0x1a')](_0x7a45('0x14'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x20')]);router['post'](_0x7a45('0x21'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x22')]);router['post']('/:id/blacklists',auth[_0x7a45('0xa')](),controller[_0x7a45('0x23')]);router[_0x7a45('0x24')](_0x7a45('0x25'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x26')]);router[_0x7a45('0x27')](_0x7a45('0x25'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x28')]);router[_0x7a45('0x27')](_0x7a45('0x1e'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x29')]);router['delete']('/:id/users',auth[_0x7a45('0xa')](),controller[_0x7a45('0x2a')]);router[_0x7a45('0x27')](_0x7a45('0x21'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x2b')]);router[_0x7a45('0x27')](_0x7a45('0x2c'),auth[_0x7a45('0xa')](),controller[_0x7a45('0x2d')]);module[_0x7a45('0x2e')]=router;
\ No newline at end of file
index b14bbc3..6d4f84f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x522b=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','outbound','inbound','default','STRING','ENUM','ringall','leastrecent','random','rrmemory','rrordered','setDataValue','getDataValue','dialMethod','strategy','booked','roundrobin','predictive','power','INTEGER','yes','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x4273d1,_0x26d223){var _0x3fc1ec=function(_0xcbae6a){while(--_0xcbae6a){_0x4273d1['push'](_0x4273d1['shift']());}};_0x3fc1ec(++_0x26d223);}(_0x522b,0x1c3));var _0xb522=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x522b[_0x8560d3];return _0x33b1b5;};'use strict';var Sequelize=require(_0xb522('0x0'));module[_0xb522('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb522('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xb522('0x3')),'allowNull':![],'defaultValue':_0xb522('0x4')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xb522('0x5')},'announce':{'type':Sequelize[_0xb522('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0xb522('0x7')]('rr',_0xb522('0x8'),_0xb522('0x9'),'fewestcalls',_0xb522('0xa'),_0xb522('0xb'),'linear','wrandom',_0xb522('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x3f4f63){this[_0xb522('0xd')]('strategy',_0x3f4f63?_0x3f4f63:_0xb522('0xb'));},'get':function(){var _0x2676b7=this[_0xb522('0xe')]('type');var _0x58d053=this[_0xb522('0xe')](_0xb522('0xf'));var _0x37d16c=this['getDataValue'](_0xb522('0x10'));if(_0x2676b7==='inbound'){return _0x37d16c;}if(_0x58d053===_0xb522('0x11')&&_0x37d16c===_0xb522('0xb')||_0x58d053==='booked'&&_0x37d16c===_0xb522('0x12')){return _0x37d16c;}if(_0x58d053==='progressive'||_0x58d053===_0xb522('0x13')||_0x58d053===_0xb522('0x14')){return _0x37d16c;}return null;}},'servicelevel':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb522('0x15')](0xb)},'timeout':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xb522('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':_0xb522('0x16')},'autopause':{'type':Sequelize['ENUM'](_0xb522('0x16'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb522('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb522('0x7')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb522('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb522('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb522('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb522('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb522('0x6')]},'queue_youarenext':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb522('0x6')]},'queue_quantity1':{'type':Sequelize[_0xb522('0x6')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xb522('0x6')]},'queue_less_than':{'type':Sequelize[_0xb522('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x3ae80d){this[_0xb522('0xd')](_0xb522('0x17'),_0x3ae80d?_0x3ae80d[_0xb522('0x18')](','):[]);},'get':function(){return this[_0xb522('0xe')]('periodic_announce')?this[_0xb522('0xe')](_0xb522('0x17'))[_0xb522('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xb522('0x6')],'defaultValue':_0xb522('0x16'),'set':function(_0xdeba3){this[_0xb522('0xd')]('joinempty',_0xdeba3?_0xdeba3[_0xb522('0x18')](','):undefined);},'get':function(){return this[_0xb522('0xe')](_0xb522('0x1a'))?this['getDataValue'](_0xb522('0x1a'))[_0xb522('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x55f719){this[_0xb522('0xd')](_0xb522('0x1b'),_0x55f719?_0x55f719[_0xb522('0x18')](','):undefined);},'get':function(){return this[_0xb522('0xe')](_0xb522('0x1b'))?this[_0xb522('0xe')](_0xb522('0x1b'))[_0xb522('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb522('0x6')]},'description':{'type':Sequelize[_0xb522('0x6')]},'acw':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'set':function(_0x37853e){this['setDataValue']('acw',_0x37853e);if(_0x37853e){if(this['getDataValue'](_0xb522('0x1d'))<0x2){this[_0xb522('0xd')](_0xb522('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb522('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':_0xb522('0x1e')},'dialMethod':{'type':Sequelize[_0xb522('0x7')]('preview','progressive',_0xb522('0x14'),'predictive',_0xb522('0x11')),'defaultValue':_0xb522('0x1f'),'comment':_0xb522('0x20')},'dialLimitChannel':{'type':Sequelize[_0xb522('0x15')](0x4)[_0xb522('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb522('0x22')},'dialLimitQueue':{'type':Sequelize[_0xb522('0x15')](0x4)[_0xb522('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xb522('0x23')](0x2)[_0xb522('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0xb522('0x24')),'defaultValue':_0xb522('0x24'),'comment':_0xb522('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb522('0x23')](0x2)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb522('0x26')},'dialPredictiveInterval':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb522('0x27')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb522('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb522('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x28')},'dialQueueOptions':{'type':Sequelize[_0xb522('0x6')],'defaultValue':_0xb522('0x29'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb522('0x2a')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x2b')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x2c')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x2e')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb522('0x2f')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xb522('0x30')},'dialPrefix':{'type':Sequelize[_0xb522('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x31'),'never',_0xb522('0x32')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb522('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb522('0x33')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb522('0x34')},'dialAMDMinWordLength':{'type':Sequelize[_0xb522('0x15')](0x9)[_0xb522('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb522('0x35')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb522('0x36')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb522('0x37')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb522('0x38')},'dialRecallMeTimeout':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb522('0x39')},'dialRecallInQueue':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb522('0x7')](_0xb522('0x3a'),'ASC'),'defaultValue':_0xb522('0x3a')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xb522('0x2a')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb522('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb522('0x3b')},'dialCutDigit':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb522('0x3c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x3d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x3e')},'dialDropRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x3f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x40')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x41')},'dialMachineMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb522('0x42')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb522('0x15')](0x3)[_0xb522('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb522('0x43')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb522('0x15')](0x5)[_0xb522('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb522('0x15')],'allowNull':!![],'comment':_0xb522('0x44')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb522('0x45'),'set':function(_0x2c285e){if(!_0x2c285e)this[_0xb522('0xd')](_0xb522('0x46'),null);this[_0xb522('0xd')](_0xb522('0x47'),_0x2c285e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xb522('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0xfde9=['never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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','ASC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x245505,_0x2cfe7b){var _0x424bcb=function(_0x10c8df){while(--_0x10c8df){_0x245505['push'](_0x245505['shift']());}};_0x424bcb(++_0x2cfe7b);}(_0xfde9,0x66));var _0x9fde=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfde9[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x9fde('0x0'));module[_0x9fde('0x1')]={'name':{'type':Sequelize[_0x9fde('0x2')],'allowNull':![],'unique':_0x9fde('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9fde('0x4')]('inbound',_0x9fde('0x5')),'allowNull':![],'defaultValue':_0x9fde('0x6')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x9fde('0x7')},'announce':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9fde('0x4')]('rr',_0x9fde('0x8'),_0x9fde('0x9'),_0x9fde('0xa'),_0x9fde('0xb'),_0x9fde('0xc'),_0x9fde('0xd'),_0x9fde('0xe'),_0x9fde('0xf')),'allowNull':![],'defaultValue':_0x9fde('0x8'),'set':function(_0x50e26){this[_0x9fde('0x10')]('strategy',_0x50e26?_0x50e26:'rrmemory');},'get':function(){var _0x579fed=this[_0x9fde('0x11')](_0x9fde('0x12'));var _0x3004f2=this['getDataValue'](_0x9fde('0x13'));var _0xdc4bf0=this[_0x9fde('0x11')](_0x9fde('0x14'));if(_0x579fed===_0x9fde('0x6')){return _0xdc4bf0;}if(_0x3004f2===_0x9fde('0x15')&&_0xdc4bf0===_0x9fde('0xc')||_0x3004f2===_0x9fde('0x15')&&_0xdc4bf0===_0x9fde('0x16')){return _0xdc4bf0;}if(_0x3004f2===_0x9fde('0x17')||_0x3004f2===_0x9fde('0x18')||_0x3004f2===_0x9fde('0x19')){return _0xdc4bf0;}return null;}},'servicelevel':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9fde('0x1a')](0xb)},'timeout':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9fde('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':_0x9fde('0x1b')},'autopause':{'type':Sequelize['ENUM'](_0x9fde('0x1b'),'no',_0x9fde('0x1c')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9fde('0x1a')](0xb)},'autopausebusy':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9fde('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9fde('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9fde('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x9fde('0x1b'),'no'),'defaultValue':_0x9fde('0x1b')},'announce_holdtime':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no',_0x9fde('0x1d')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no')},'announce_position_limit':{'type':Sequelize[_0x9fde('0x1a')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9fde('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9fde('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9fde('0x2')]},'queue_quantity1':{'type':Sequelize[_0x9fde('0x2')]},'queue_quantity2':{'type':Sequelize[_0x9fde('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x9fde('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x2e3260){this[_0x9fde('0x10')](_0x9fde('0x1e'),_0x2e3260?_0x2e3260[_0x9fde('0x1f')](','):[]);},'get':function(){return this[_0x9fde('0x11')](_0x9fde('0x1e'))?this[_0x9fde('0x11')](_0x9fde('0x1e'))[_0x9fde('0x20')](','):[];}},'joinempty':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':_0x9fde('0x1b'),'set':function(_0x2af80b){this[_0x9fde('0x10')](_0x9fde('0x21'),_0x2af80b?_0x2af80b[_0x9fde('0x1f')](','):undefined);},'get':function(){return this[_0x9fde('0x11')](_0x9fde('0x21'))?this[_0x9fde('0x11')]('joinempty')[_0x9fde('0x20')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':'no','set':function(_0x2d7821){this[_0x9fde('0x10')]('leavewhenempty',_0x2d7821?_0x2d7821[_0x9fde('0x1f')](','):undefined);},'get':function(){return this[_0x9fde('0x11')](_0x9fde('0x22'))?this[_0x9fde('0x11')]('leavewhenempty')[_0x9fde('0x20')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9fde('0x1a')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x9fde('0x1b'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9fde('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x9fde('0x23')],'defaultValue':0x0,'set':function(_0x2c894a){this['setDataValue']('acw',_0x2c894a);if(_0x2c894a){if(this[_0x9fde('0x11')](_0x9fde('0x24'))<0x2){this['setDataValue'](_0x9fde('0x24'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x9fde('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x25'),'progressive',_0x9fde('0x19'),_0x9fde('0x18'),_0x9fde('0x15')),'defaultValue':_0x9fde('0x17'),'comment':_0x9fde('0x26')},'dialLimitChannel':{'type':Sequelize[_0x9fde('0x1a')](0x4)[_0x9fde('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x9fde('0x1a')](0x4)[_0x9fde('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9fde('0x28')},'dialPowerLevel':{'type':Sequelize[_0x9fde('0x29')](0x2)[_0x9fde('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9fde('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x2b'),_0x9fde('0x2c')),'defaultValue':_0x9fde('0x2c'),'comment':_0x9fde('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9fde('0x29')](0x2)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9fde('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9fde('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9fde('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x9fde('0x1a')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9fde('0x30'),'comment':_0x9fde('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x32')},'dialQueueProject':{'type':Sequelize[_0x9fde('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9fde('0x34')},'dialBusyMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9fde('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'comment':_0x9fde('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9fde('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9fde('0x39')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9fde('0x3a')},'dialPrefix':{'type':Sequelize[_0x9fde('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x3b'),_0x9fde('0x3c'),_0x9fde('0x3d')),'defaultValue':_0x9fde('0x3b')},'dialAMDActive':{'type':Sequelize[_0x9fde('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x9fde('0x1a')](0x9)[_0x9fde('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9fde('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x9fde('0x1a')](0x9)[_0x9fde('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9fde('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9fde('0x1a')](0x9)[_0x9fde('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9fde('0x1a')](0x9)[_0x9fde('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9fde('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9fde('0x1a')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9fde('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9fde('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9fde('0x1a')](0x9)[_0x9fde('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9fde('0x43')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x9fde('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9fde('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x9fde('0x23')],'defaultValue':0x0,'comment':_0x9fde('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9fde('0x4')](_0x9fde('0x46'),_0x9fde('0x47')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x9fde('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9fde('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9fde('0x1a')](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9fde('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9fde('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9fde('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9fde('0x1a')],'allowNull':!![],'comment':_0x9fde('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x9fde('0x23')],'defaultValue':![],'comment':_0x9fde('0x4f'),'set':function(_0x139d5e){if(!_0x139d5e)this[_0x9fde('0x10')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x9fde('0x50'),_0x139d5e);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9fde('0x1a')](0x3)[_0x9fde('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 54958c3..f93bbf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf10=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','QueueCampaigns','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','role','getHoppers','CmHopper','hasOwnProperty','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','interface','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','ids','spread','isEmpty','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ListId','select','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','fromQuery','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','outbound','filter','map','value','type','find','name','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body'];(function(_0x3f2329,_0x55490c){var _0x294dd3=function(_0x4eda0d){while(--_0x4eda0d){_0x3f2329['push'](_0x3f2329['shift']());}};_0x294dd3(++_0x55490c);}(_0xcf10,0x1dd));var _0x0cf1=function(_0x9c607a,_0x1cb2c6){_0x9c607a=_0x9c607a-0x0;var _0x3b1311=_0xcf10[_0x9c607a];return _0x3b1311;};'use strict';var emlformat=require(_0x0cf1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cf1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0cf1('0x2'));var moment=require('moment');var BPromise=require(_0x0cf1('0x3'));var Mustache=require('mustache');var util=require(_0x0cf1('0x4'));var path=require(_0x0cf1('0x5'));var sox=require(_0x0cf1('0x6'));var csv=require(_0x0cf1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0cf1('0x8'));var _=require(_0x0cf1('0x9'));var squel=require(_0x0cf1('0xa'));var crypto=require(_0x0cf1('0xb'));var jsforce=require(_0x0cf1('0xc'));var deskjs=require(_0x0cf1('0xd'));var toCsv=require(_0x0cf1('0x7'));var querystring=require(_0x0cf1('0xe'));var Papa=require(_0x0cf1('0xf'));var Redis=require(_0x0cf1('0x10'));var authService=require(_0x0cf1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0cf1('0x12'));var hardwareService=require(_0x0cf1('0x13'));var logger=require(_0x0cf1('0x14'))(_0x0cf1('0x15'));var utils=require(_0x0cf1('0x16'));var config=require(_0x0cf1('0x17'));var licenseUtil=require(_0x0cf1('0x18'));var db=require(_0x0cf1('0x19'))['db'];config[_0x0cf1('0x1a')]=_[_0x0cf1('0x1b')](config[_0x0cf1('0x1a')],{'host':_0x0cf1('0x1c'),'port':0x18eb});var socket=require(_0x0cf1('0x1d'))(new Redis(config[_0x0cf1('0x1a')]));require(_0x0cf1('0x1e'))[_0x0cf1('0x1f')](socket);function respondWithStatusCode(_0x47b619,_0x1cdc15){_0x1cdc15=_0x1cdc15||0xcc;return function(_0x55a068){if(_0x55a068){return _0x47b619[_0x0cf1('0x20')](_0x1cdc15);}return _0x47b619[_0x0cf1('0x21')](_0x1cdc15)[_0x0cf1('0x22')]();};}function respondWithResult(_0x126b0a,_0x21dcd4){_0x21dcd4=_0x21dcd4||0xc8;return function(_0xf578be){if(_0xf578be){return _0x126b0a[_0x0cf1('0x21')](_0x21dcd4)[_0x0cf1('0x23')](_0xf578be);}};}function respondWithFilteredResult(_0x551a37,_0x1de596){return function(_0x1d0452){if(_0x1d0452){var _0x24d57b=typeof _0x1de596[_0x0cf1('0x24')]==='undefined'&&typeof _0x1de596['limit']===_0x0cf1('0x25');var _0xb6b14b=_0x1d0452[_0x0cf1('0x26')];var _0x327dac=_0x24d57b?0x0:_0x1de596[_0x0cf1('0x24')];var _0xa01c20=_0x24d57b?_0x1d0452[_0x0cf1('0x26')]:_0x1de596[_0x0cf1('0x24')]+_0x1de596[_0x0cf1('0x27')];var _0x46a1db;if(_0xa01c20>=_0xb6b14b){_0xa01c20=_0xb6b14b;_0x46a1db=0xc8;}else{_0x46a1db=0xce;}_0x551a37[_0x0cf1('0x21')](_0x46a1db);return _0x551a37[_0x0cf1('0x28')](_0x0cf1('0x29'),_0x327dac+'-'+_0xa01c20+'/'+_0xb6b14b)[_0x0cf1('0x23')](_0x1d0452);}return null;};}function patchUpdates(_0x1a7d82){return function(_0x598970){try{jsonpatch[_0x0cf1('0x2a')](_0x598970,_0x1a7d82,!![]);}catch(_0xe457e0){return BPromise[_0x0cf1('0x2b')](_0xe457e0);}return _0x598970[_0x0cf1('0x2c')]();};}function saveUpdates(_0x3e2e8d,_0x37ed5c){return function(_0x803662){if(_0x803662){return _0x803662[_0x0cf1('0x2d')](_0x3e2e8d)[_0x0cf1('0x2e')](function(_0x21a5d4){return _0x21a5d4;});}return null;};}function removeEntity(_0x23a430,_0x4e76a6){return function(_0x428704){if(_0x428704){return _0x428704[_0x0cf1('0x2f')]()[_0x0cf1('0x2e')](function(){var _0x1ba78d=_0x428704['get']({'plain':!![]});var _0x4ed237=[{'name':_0x0cf1('0x30'),'value':_0x0cf1('0x31'),'ignore':![]},{'name':'QueueCampaigns','value':_0x0cf1('0x32'),'ignore':![]}];var _0x46bf11=_(_0x4ed237)[_0x0cf1('0x33')]('ignore')[_0x0cf1('0x34')](_0x0cf1('0x35'))[_0x0cf1('0x35')]();if(_['includes'](_0x46bf11,_0x1ba78d[_0x0cf1('0x36')])){return;}var _0x50ae4d=_[_0x0cf1('0x37')](_0x4ed237,[_0x0cf1('0x35'),_0x1ba78d[_0x0cf1('0x36')]])[_0x0cf1('0x38')];return db['UserProfileResource']['destroy']({'where':{'type':_0x50ae4d,'resourceId':_0x1ba78d['id']}})[_0x0cf1('0x2e')](function(){return _0x428704;});})[_0x0cf1('0x2e')](function(){_0x23a430['status'](0xcc)[_0x0cf1('0x22')]();});}};}function handleEntityNotFound(_0x5802da,_0x48f4e4){return function(_0x408e24){if(!_0x408e24){_0x5802da['sendStatus'](0x194);}return _0x408e24;};}function handleError(_0x3d5b60,_0x41eb39){_0x41eb39=_0x41eb39||0x1f4;return function(_0x5ed52f){logger[_0x0cf1('0x39')](_0x5ed52f[_0x0cf1('0x3a')]);if(_0x5ed52f[_0x0cf1('0x38')]){delete _0x5ed52f[_0x0cf1('0x38')];}_0x3d5b60[_0x0cf1('0x21')](_0x41eb39)[_0x0cf1('0x3b')](_0x5ed52f);};}exports[_0x0cf1('0x3c')]=function(_0xaa251f,_0x1442b5){var _0x20957e={},_0x4d52e9={},_0x17db63={'count':0x0,'rows':[]};var _0x44964f=_[_0x0cf1('0x34')](db[_0x0cf1('0x3d')][_0x0cf1('0x3e')],function(_0xb5f426){return{'name':_0xb5f426[_0x0cf1('0x3f')],'type':_0xb5f426['type'][_0x0cf1('0x40')]};});_0x4d52e9[_0x0cf1('0x41')]=_['map'](_0x44964f,_0x0cf1('0x38'));_0x4d52e9[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0xaa251f['query']);_0x4d52e9[_0x0cf1('0x44')]=_['intersection'](_0x4d52e9['model'],_0x4d52e9[_0x0cf1('0x42')]);_0x20957e['attributes']=_[_0x0cf1('0x45')](_0x4d52e9[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x20957e[_0x0cf1('0x47')]=_0x20957e['attributes'][_0x0cf1('0x48')]?_0x20957e[_0x0cf1('0x47')]:_0x4d52e9[_0x0cf1('0x41')];if(!_0xaa251f[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x20957e[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x20957e['offset']=qs[_0x0cf1('0x24')](_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x24')]);}_0x20957e[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0xaa251f['query']['sort']);_0x20957e['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0xaa251f[_0x0cf1('0x42')],_0x4d52e9['filters']),_0x44964f);if(_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x20957e[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x20957e[_0x0cf1('0x4d')],{'$or':_['map'](_0x44964f,function(_0x405f18){if(_0x405f18['type']!==_0x0cf1('0x4f')){var _0x28c0e3={};_0x28c0e3[_0x405f18['name']]={'$like':'%'+_0xaa251f['query'][_0x0cf1('0x33')]+'%'};return _0x28c0e3;}})});}_0x20957e=_[_0x0cf1('0x4e')]({},_0x20957e,_0xaa251f[_0x0cf1('0x50')]);var _0x47e698={'where':_0x20957e[_0x0cf1('0x4d')]};return db[_0x0cf1('0x3d')][_0x0cf1('0x26')](_0x47e698)['then'](function(_0x2ca364){_0x17db63['count']=_0x2ca364;if(_0xaa251f[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x20957e[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x3d')][_0x0cf1('0x53')](_0x20957e);})[_0x0cf1('0x2e')](function(_0x3b22d2){_0x17db63[_0x0cf1('0x54')]=_0x3b22d2;return _0x17db63;})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x1442b5,_0x20957e))[_0x0cf1('0x55')](handleError(_0x1442b5,null));};exports[_0x0cf1('0x56')]=function(_0x1be249,_0x2f22f8){var _0x2808b0={'raw':![],'where':{'id':_0x1be249[_0x0cf1('0x57')]['id']}},_0x2063ce={};_0x2063ce[_0x0cf1('0x41')]=_['keys'](db['VoiceQueue'][_0x0cf1('0x3e')]);_0x2063ce['query']=_[_0x0cf1('0x43')](_0x1be249[_0x0cf1('0x42')]);_0x2063ce[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x2063ce['model'],_0x2063ce[_0x0cf1('0x42')]);_0x2808b0[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x2063ce[_0x0cf1('0x41')],qs['fields'](_0x1be249[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x2808b0[_0x0cf1('0x47')]=_0x2808b0['attributes'][_0x0cf1('0x48')]?_0x2808b0[_0x0cf1('0x47')]:_0x2063ce['model'];if(_0x1be249[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x2808b0[_0x0cf1('0x52')]=[{'all':!![]}];}_0x2808b0=_[_0x0cf1('0x4e')]({},_0x2808b0,_0x1be249[_0x0cf1('0x50')]);return db[_0x0cf1('0x3d')][_0x0cf1('0x37')](_0x2808b0)[_0x0cf1('0x2e')](handleEntityNotFound(_0x2f22f8,null))[_0x0cf1('0x2e')](respondWithResult(_0x2f22f8,null))[_0x0cf1('0x55')](handleError(_0x2f22f8,null));};exports[_0x0cf1('0x58')]=function(_0x1ecc79,_0x7b4e3a){return db['VoiceQueue']['create'](_0x1ecc79[_0x0cf1('0x59')],{})[_0x0cf1('0x2e')](function(_0x2b156a){var _0x1ad6f6=_0x1ecc79[_0x0cf1('0x5a')]['get']({'plain':!![]});if(!_0x1ad6f6)throw new Error(_0x0cf1('0x5b'));if(_0x1ad6f6['role']==='user'){var _0x1364b3=_0x2b156a[_0x0cf1('0x5c')]({'plain':!![]});var _0x54c0e1=[{'name':'VoiceQueues','value':_0x0cf1('0x31')},{'name':_0x0cf1('0x5d'),'value':_0x0cf1('0x32')}];var _0x422493=_[_0x0cf1('0x37')](_0x54c0e1,['value',_0x1364b3['type']])[_0x0cf1('0x38')];return db[_0x0cf1('0x5e')]['find']({'where':{'name':_0x422493,'userProfileId':_0x1ad6f6['userProfileId']},'raw':!![]})[_0x0cf1('0x2e')](function(_0x13d126){if(_0x13d126&&_0x13d126[_0x0cf1('0x5f')]===0x0){return db[_0x0cf1('0x60')][_0x0cf1('0x58')]({'name':_0x1364b3[_0x0cf1('0x38')],'resourceId':_0x1364b3['id'],'type':_0x13d126[_0x0cf1('0x38')],'sectionId':_0x13d126['id']},{})[_0x0cf1('0x2e')](function(){return _0x2b156a;});}else{return _0x2b156a;}})['catch'](function(_0x5a44d9){logger['error'](_0x0cf1('0x61'),_0x5a44d9);throw _0x5a44d9;});}return _0x2b156a;})['then'](respondWithResult(_0x7b4e3a,0xc9))[_0x0cf1('0x55')](handleError(_0x7b4e3a,null));};exports['clone']=function(_0x4a89c8,_0x37a207){var _0x456a2a={'where':{'id':_0x4a89c8[_0x0cf1('0x57')]['id']}},_0x2d971b={};_0x2d971b['model']=_['keys'](db[_0x0cf1('0x3d')][_0x0cf1('0x3e')]);_0x456a2a[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x2d971b[_0x0cf1('0x41')],qs['fields'](_0x4a89c8[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x456a2a[_0x0cf1('0x47')]=_0x456a2a[_0x0cf1('0x47')]['length']?_0x456a2a[_0x0cf1('0x47')]:_0x2d971b['model'];if(_0x4a89c8[_0x0cf1('0x42')]['includeAll']){_0x456a2a[_0x0cf1('0x52')]=[{'all':!![]}];}_0x456a2a=_[_0x0cf1('0x4e')]({},_0x456a2a,_0x4a89c8[_0x0cf1('0x50')]);return db[_0x0cf1('0x3d')]['find'](_0x456a2a)[_0x0cf1('0x2e')](handleEntityNotFound(_0x37a207,null))[_0x0cf1('0x2e')](function(_0x3ac72c){if(_0x3ac72c){var _0x577f84=_0x3ac72c[_0x0cf1('0x5c')]({'plain':!![]});_0x577f84=qs['omit'](_0x577f84,['id',_0x0cf1('0x62'),_0x0cf1('0x63')]);_0x4a89c8[_0x0cf1('0x59')]=_[_0x0cf1('0x64')](_0x4a89c8[_0x0cf1('0x59')],['id',_0x0cf1('0x62'),'updatedAt']);return db[_0x0cf1('0x3d')][_0x0cf1('0x58')](_[_0x0cf1('0x4e')](_0x577f84,_0x4a89c8[_0x0cf1('0x59')]),{'include':_0x4a89c8[_0x0cf1('0x42')][_0x0cf1('0x51')]?[{'all':!![]}]:undefined})[_0x0cf1('0x2e')](function(_0x54e47b){var _0x55f88e=_0x4a89c8['user'][_0x0cf1('0x5c')]({'plain':!![]});if(!_0x55f88e)throw new Error(_0x0cf1('0x5b'));if(_0x55f88e[_0x0cf1('0x65')]===_0x0cf1('0x5a')){var _0x5beca9=_0x54e47b['get']({'plain':!![]});var _0x3b657e=[{'name':_0x0cf1('0x30'),'value':_0x0cf1('0x31')},{'name':'QueueCampaigns','value':_0x0cf1('0x32')}];var _0x6a82d4=_[_0x0cf1('0x37')](_0x3b657e,['value',_0x5beca9[_0x0cf1('0x36')]])['name'];return db[_0x0cf1('0x5e')]['find']({'where':{'name':_0x6a82d4,'userProfileId':_0x55f88e['userProfileId']},'raw':!![]})[_0x0cf1('0x2e')](function(_0x1ab17b){if(_0x1ab17b&&_0x1ab17b[_0x0cf1('0x5f')]===0x0){return db[_0x0cf1('0x60')][_0x0cf1('0x58')]({'name':_0x5beca9[_0x0cf1('0x38')],'resourceId':_0x5beca9['id'],'type':_0x1ab17b[_0x0cf1('0x38')],'sectionId':_0x1ab17b['id']},{})[_0x0cf1('0x2e')](function(){return _0x54e47b;});}else{return _0x54e47b;}})[_0x0cf1('0x55')](function(_0x12f479){logger['error'](_0x0cf1('0x61'),_0x12f479);throw _0x12f479;});}return _0x54e47b;});}})[_0x0cf1('0x2e')](respondWithResult(_0x37a207,0xc9))[_0x0cf1('0x55')](handleError(_0x37a207,null));};exports[_0x0cf1('0x2d')]=function(_0x134ba0,_0x3d2c78){if(_0x134ba0[_0x0cf1('0x59')]['id']){delete _0x134ba0[_0x0cf1('0x59')]['id'];}return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x134ba0[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x3d2c78,null))[_0x0cf1('0x2e')](saveUpdates(_0x134ba0[_0x0cf1('0x59')],null))['then'](respondWithResult(_0x3d2c78,null))['catch'](handleError(_0x3d2c78,null));};exports[_0x0cf1('0x2f')]=function(_0x473fce,_0x86d118){return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x473fce['params']['id']}})['then'](handleEntityNotFound(_0x86d118,null))[_0x0cf1('0x2e')](removeEntity(_0x86d118,null))[_0x0cf1('0x55')](handleError(_0x86d118,null));};exports[_0x0cf1('0x66')]=function(_0x2dd964,_0x4b3a26,_0x3f0543){var _0x5e7678={'raw':![],'where':{}};var _0x3bb2df={};var _0x5c2f7f={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x2dd964[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x4b3a26,null))[_0x0cf1('0x2e')](function(_0x4b84eb){if(_0x4b84eb){_0x3bb2df[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0x67')][_0x0cf1('0x3e')]);_0x3bb2df[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x2dd964[_0x0cf1('0x42')]);_0x3bb2df['filters']=_[_0x0cf1('0x45')](_0x3bb2df['model'],_0x3bb2df[_0x0cf1('0x42')]);_0x5e7678[_0x0cf1('0x47')]=_['intersection'](_0x3bb2df['model'],qs[_0x0cf1('0x46')](_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x5e7678[_0x0cf1('0x47')]=_0x5e7678[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x5e7678['attributes']:_0x3bb2df['model'];if(!_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x5e7678['limit']=qs[_0x0cf1('0x27')](_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x5e7678[_0x0cf1('0x24')]=qs['offset'](_0x2dd964['query'][_0x0cf1('0x24')]);}_0x5e7678[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0x2dd964['query'][_0x0cf1('0x4b')]);_0x5e7678['where']=qs['filters'](_[_0x0cf1('0x4c')](_0x2dd964[_0x0cf1('0x42')],_0x3bb2df[_0x0cf1('0x44')]));_0x5e7678[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x4b84eb['id'];if(_0x2dd964[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x5e7678[_0x0cf1('0x4d')]=_['merge'](_0x5e7678[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x5e7678[_0x0cf1('0x47')],function(_0xae387a){var _0x184283={};_0x184283[_0xae387a]={'$like':'%'+_0x2dd964['query'][_0x0cf1('0x33')]+'%'};return _0x184283;})});}_0x5e7678=_[_0x0cf1('0x4e')]({},_0x5e7678,_0x2dd964[_0x0cf1('0x50')]);return db[_0x0cf1('0x67')]['count']({'where':_0x5e7678[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x3eb557){_0x5c2f7f[_0x0cf1('0x26')]=_0x3eb557;if(_0x2dd964[_0x0cf1('0x42')]['includeAll']){_0x5e7678[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x67')]['findAll'](_0x5e7678);})['then'](function(_0x23d1bc){_0x5c2f7f[_0x0cf1('0x54')]=_0x23d1bc;return _0x5c2f7f;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x4b3a26,_0x5e7678))[_0x0cf1('0x55')](handleError(_0x4b3a26,null));};exports[_0x0cf1('0x6a')]=function(_0x33b3db,_0x5ef347,_0x3d4af6){var _0xc7872d={'raw':!![],'where':{}};var _0x337a16={};var _0x53b152={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x33b3db[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ef347,null))['then'](function(_0x421ab7){if(_0x421ab7){_0x337a16['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x6c')][_0x0cf1('0x3e')]);_0x337a16[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x33b3db['query']);_0x337a16[_0x0cf1('0x44')]=_['intersection'](_0x337a16[_0x0cf1('0x41')],_0x337a16[_0x0cf1('0x42')]);_0xc7872d[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x337a16[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0xc7872d[_0x0cf1('0x47')]=_0xc7872d[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0xc7872d[_0x0cf1('0x47')]:_0x337a16[_0x0cf1('0x41')];if(!_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0xc7872d[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x33b3db[_0x0cf1('0x42')]['limit']);_0xc7872d[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x24')]);}_0xc7872d[_0x0cf1('0x4a')]=qs['sort'](_0x33b3db[_0x0cf1('0x42')]['sort']);_0xc7872d[_0x0cf1('0x4d')]=qs['filters'](_[_0x0cf1('0x4c')](_0x33b3db['query'],_0x337a16[_0x0cf1('0x44')]));_0xc7872d[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x421ab7['id'];if(_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0xc7872d['where']=_[_0x0cf1('0x4e')](_0xc7872d[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0xc7872d[_0x0cf1('0x47')],function(_0x431a07){var _0x44af67={};_0x44af67[_0x431a07]={'$like':'%'+_0x33b3db['query'][_0x0cf1('0x33')]+'%'};return _0x44af67;})});}_0xc7872d=_[_0x0cf1('0x4e')]({},_0xc7872d,_0x33b3db[_0x0cf1('0x50')]);return db['CmHopperHistory']['count']({'where':_0xc7872d[_0x0cf1('0x4d')]})['then'](function(_0x1c02b0){_0x53b152[_0x0cf1('0x26')]=_0x1c02b0;if(_0x33b3db[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0xc7872d[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6c')][_0x0cf1('0x53')](_0xc7872d);})[_0x0cf1('0x2e')](function(_0x2ccb58){_0x53b152[_0x0cf1('0x54')]=_0x2ccb58;return _0x53b152;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x5ef347,_0xc7872d))[_0x0cf1('0x55')](handleError(_0x5ef347,null));};exports['getHopperFinals']=function(_0x641bd0,_0x5a363c,_0x4d2546){var _0x1ef54d={'raw':!![],'where':{}};var _0x1cb311={};var _0x4dae21={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x641bd0['params']['id']}})['then'](handleEntityNotFound(_0x5a363c,null))[_0x0cf1('0x2e')](function(_0x26cc9a){if(_0x26cc9a){_0x1cb311['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x6d')][_0x0cf1('0x3e')]);_0x1cb311[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x641bd0[_0x0cf1('0x42')]);_0x1cb311['filters']=_[_0x0cf1('0x45')](_0x1cb311[_0x0cf1('0x41')],_0x1cb311['query']);_0x1ef54d['attributes']=_[_0x0cf1('0x45')](_0x1cb311['model'],qs[_0x0cf1('0x46')](_0x641bd0[_0x0cf1('0x42')]['fields']));_0x1ef54d[_0x0cf1('0x47')]=_0x1ef54d[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x1ef54d[_0x0cf1('0x47')]:_0x1cb311[_0x0cf1('0x41')];if(!_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0x1ef54d[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x1ef54d[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x641bd0['query'][_0x0cf1('0x24')]);}_0x1ef54d['order']=qs[_0x0cf1('0x4b')](_0x641bd0['query']['sort']);_0x1ef54d[_0x0cf1('0x4d')]=qs['filters'](_[_0x0cf1('0x4c')](_0x641bd0[_0x0cf1('0x42')],_0x1cb311[_0x0cf1('0x44')]));_0x1ef54d[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x26cc9a['id'];if(_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x1ef54d[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x1ef54d[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x1ef54d[_0x0cf1('0x47')],function(_0x3a6cc4){var _0x25f99e={};_0x25f99e[_0x3a6cc4]={'$like':'%'+_0x641bd0['query'][_0x0cf1('0x33')]+'%'};return _0x25f99e;})});}_0x1ef54d=_['merge']({},_0x1ef54d,_0x641bd0[_0x0cf1('0x50')]);return db['CmHopperFinal']['count']({'where':_0x1ef54d[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x4fa1d1){_0x4dae21[_0x0cf1('0x26')]=_0x4fa1d1;if(_0x641bd0[_0x0cf1('0x42')][_0x0cf1('0x51')]){_0x1ef54d[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6d')]['findAll'](_0x1ef54d);})[_0x0cf1('0x2e')](function(_0x4c16b0){_0x4dae21[_0x0cf1('0x54')]=_0x4c16b0;return _0x4dae21;});}})[_0x0cf1('0x2e')](respondWithFilteredResult(_0x5a363c,_0x1ef54d))[_0x0cf1('0x55')](handleError(_0x5a363c,null));};exports[_0x0cf1('0x6e')]=function(_0x529ab2,_0x346724,_0x5d9130){var _0x5c6848={'raw':!![],'where':{}};var _0x3b395f={};var _0x2888e7={'count':0x0,'rows':[]};return db[_0x0cf1('0x3d')][_0x0cf1('0x6b')]({'where':{'id':_0x529ab2[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x346724,null))[_0x0cf1('0x2e')](function(_0x9f3598){if(_0x9f3598){_0x3b395f[_0x0cf1('0x41')]=_['keys'](db[_0x0cf1('0x6f')]['rawAttributes']);_0x3b395f[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x529ab2[_0x0cf1('0x42')]);_0x3b395f[_0x0cf1('0x44')]=_['intersection'](_0x3b395f[_0x0cf1('0x41')],_0x3b395f[_0x0cf1('0x42')]);_0x5c6848[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x3b395f[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x529ab2['query'][_0x0cf1('0x46')]));_0x5c6848[_0x0cf1('0x47')]=_0x5c6848[_0x0cf1('0x47')]['length']?_0x5c6848[_0x0cf1('0x47')]:_0x3b395f['model'];if(!_0x529ab2[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x5c6848[_0x0cf1('0x27')]=qs['limit'](_0x529ab2[_0x0cf1('0x42')]['limit']);_0x5c6848['offset']=qs['offset'](_0x529ab2[_0x0cf1('0x42')]['offset']);}_0x5c6848['order']=qs[_0x0cf1('0x4b')](_0x529ab2[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x5c6848['where']=qs['filters'](_[_0x0cf1('0x4c')](_0x529ab2[_0x0cf1('0x42')],_0x3b395f[_0x0cf1('0x44')]));_0x5c6848[_0x0cf1('0x4d')][_0x0cf1('0x69')]=_0x9f3598['id'];if(_0x529ab2['query'][_0x0cf1('0x33')]){_0x5c6848[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x5c6848[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x5c6848[_0x0cf1('0x47')],function(_0x1df660){var _0x9f0103={};_0x9f0103[_0x1df660]={'$like':'%'+_0x529ab2[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x9f0103;})});}_0x5c6848=_[_0x0cf1('0x4e')]({},_0x5c6848,_0x529ab2['options']);return db['CmHopperBlack'][_0x0cf1('0x26')]({'where':_0x5c6848[_0x0cf1('0x4d')]})[_0x0cf1('0x2e')](function(_0x411e3a){_0x2888e7['count']=_0x411e3a;if(_0x529ab2[_0x0cf1('0x42')]['includeAll']){_0x5c6848[_0x0cf1('0x52')]=[{'all':!![]}];}return db[_0x0cf1('0x6f')][_0x0cf1('0x53')](_0x5c6848);})[_0x0cf1('0x2e')](function(_0x2d4a25){_0x2888e7[_0x0cf1('0x54')]=_0x2d4a25;return _0x2888e7;});}})['then'](respondWithFilteredResult(_0x346724,_0x5c6848))[_0x0cf1('0x55')](handleError(_0x346724,null));};exports[_0x0cf1('0x70')]=function(_0x3c9d95,_0x1c08dc,_0xf019d1){var _0x3a5d11={};var _0x586a27={};var _0x4bcf14;var _0x424a64;return db['VoiceQueue']['findOne']({'where':{'id':_0x3c9d95[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1c08dc,null))[_0x0cf1('0x2e')](function(_0x20041f){if(_0x20041f){_0x4bcf14=_0x20041f;_0x586a27[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0x71')][_0x0cf1('0x3e')]);_0x586a27['query']=_[_0x0cf1('0x43')](_0x3c9d95[_0x0cf1('0x42')]);_0x586a27[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x586a27[_0x0cf1('0x41')],_0x586a27[_0x0cf1('0x42')]);_0x3a5d11[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x586a27[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x3c9d95[_0x0cf1('0x42')]['fields']));_0x3a5d11[_0x0cf1('0x47')]=_0x3a5d11[_0x0cf1('0x47')]['length']?_0x3a5d11[_0x0cf1('0x47')]:_0x586a27[_0x0cf1('0x41')];_0x3a5d11[_0x0cf1('0x4a')]=qs[_0x0cf1('0x4b')](_0x3c9d95[_0x0cf1('0x42')]['sort']);_0x3a5d11[_0x0cf1('0x4d')]=qs['filters'](_['pick'](_0x3c9d95['query'],_0x586a27['filters']));if(_0x3c9d95['query'][_0x0cf1('0x33')]){_0x3a5d11[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x3a5d11['where'],{'$or':_['map'](_0x3a5d11['attributes'],function(_0x47e57b){var _0x5a73b9={};_0x5a73b9[_0x47e57b]={'$like':'%'+_0x3c9d95['query'][_0x0cf1('0x33')]+'%'};return _0x5a73b9;})});}_0x3a5d11=_[_0x0cf1('0x4e')]({},_0x3a5d11,_0x3c9d95[_0x0cf1('0x50')]);return _0x4bcf14[_0x0cf1('0x70')](_0x3a5d11);}})[_0x0cf1('0x2e')](function(_0x4ea947){if(_0x4ea947){_0x424a64=_0x4ea947[_0x0cf1('0x48')];if(!_0x3c9d95[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0x3a5d11[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x3c9d95['query'][_0x0cf1('0x27')]);_0x3a5d11[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x3c9d95[_0x0cf1('0x42')][_0x0cf1('0x24')]);}return _0x4bcf14[_0x0cf1('0x70')](_0x3a5d11);}})[_0x0cf1('0x2e')](function(_0x23448b){if(_0x23448b){return _0x23448b?{'count':_0x424a64,'rows':_0x23448b}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x1c08dc,null))[_0x0cf1('0x55')](handleError(_0x1c08dc,null));};exports['addTeams']=function(_0x3d171c,_0x115167,_0x22bb2b){var _0x3cffa8=_0x3d171c[_0x0cf1('0x59')][_0x0cf1('0x72')];var _0x178646=_['map'](_0x3cffa8,'id');return db[_0x0cf1('0x71')]['findAll']({'where':{'id':_0x178646},'attributes':['id'],'include':[{'model':db[_0x0cf1('0x73')],'as':'Agents','attributes':['id',_0x0cf1('0x38'),'online','voicePause',_0x0cf1('0x74')],'raw':!![]}]})[_0x0cf1('0x2e')](function(_0x3c0f4e){if(_0x3c0f4e){var _0x553742=_['flatMap'](_0x3c0f4e,function(_0x58ee0f){var _0x1ad822=_0x58ee0f['get']({'plain':!![]});_0x1ad822[_0x0cf1('0x75')][_0x0cf1('0x76')](function(_0x1eaaf5){_0x1eaaf5[_0x0cf1('0x77')]=_['find'](_0x3cffa8,{'id':_0x1ad822['id']})[_0x0cf1('0x77')];});return _0x1ad822[_0x0cf1('0x75')];});return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x3d171c[_0x0cf1('0x57')]['id']}})['then'](function(_0x1372a3){return db[_0x0cf1('0x78')][_0x0cf1('0x79')](function(_0x433a50){return _0x1372a3[_0x0cf1('0x7a')](_0x178646,{'transaction':_0x433a50})[_0x0cf1('0x2e')](function(){return BPromise[_0x0cf1('0x7b')](_0x3cffa8,function(_0x5c16c0){return db['TeamVoiceQueue'][_0x0cf1('0x7c')]({'TeamId':_0x5c16c0['id'],'VoiceQueueId':_0x3d171c['params']['id'],'penalty':_0x5c16c0[_0x0cf1('0x77')]},{'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){return BPromise['each'](_0x553742,function(_0x4ba6d3){return db[_0x0cf1('0x7d')]['findOrCreate']({'where':{'UserId':_0x4ba6d3['id'],'VoiceQueueId':_0x3d171c[_0x0cf1('0x57')]['id']},'defaults':{'penalty':_0x4ba6d3[_0x0cf1('0x77')]},'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){return BPromise['each'](_['filter'](_0x553742,{'online':!![]}),function(_0x57c4ad){return db['UserVoiceQueueRt'][_0x0cf1('0x7c')]({'membername':_0x57c4ad['name'],'UserId':_0x57c4ad['id'],'queue_name':_0x1372a3[_0x0cf1('0x38')],'VoiceQueueId':_0x1372a3['id'],'interface':_['isNil'](_0x57c4ad[_0x0cf1('0x74')])?util[_0x0cf1('0x7e')](_0x0cf1('0x7f'),_0x57c4ad[_0x0cf1('0x38')]):_0x57c4ad[_0x0cf1('0x74')],'paused':_0x57c4ad[_0x0cf1('0x80')]||![],'penalty':_0x57c4ad[_0x0cf1('0x77')]},{'transaction':_0x433a50});});})[_0x0cf1('0x2e')](function(){_0x553742[_0x0cf1('0x76')](function(_0x24d568){socket[_0x0cf1('0x81')](_0x0cf1('0x82'),{'UserId':_0x24d568['id'],'VoiceQueueId':_0x1372a3['id']});});});});});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x115167,null))['catch'](handleError(_0x115167,null));};exports[_0x0cf1('0x83')]=function(_0x4a7a4b,_0x1383b4,_0x565d3b){return db['Team'][_0x0cf1('0x53')]({'where':{'id':_0x4a7a4b[_0x0cf1('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0cf1('0x73')],'as':_0x0cf1('0x75'),'attributes':['id'],'raw':!![]}]})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1383b4,null))[_0x0cf1('0x2e')](function(_0x18da99){var _0x32cf0c=_['map'](_0x18da99,'id');var _0xbf3ba0=[];var _0x303bb5=[];var _0x4b2179=squel['select']();_0x4b2179[_0x0cf1('0x84')](_0x0cf1('0x85'))[_0x0cf1('0x86')](_0x0cf1('0x87'),'tq')[_0x0cf1('0x88')]('user_has_teams','ut',_0x0cf1('0x89'))[_0x0cf1('0x4d')](_0x0cf1('0x8a'),_0x4a7a4b[_0x0cf1('0x57')]['id']);for(var _0x1bd5d3=0x0;_0x1bd5d3<_0x18da99[_0x0cf1('0x48')];_0x1bd5d3+=0x1){let _0x41cc54=_0x18da99[_0x1bd5d3];for(var _0x5aaa09=0x0;_0x5aaa09<_0x41cc54[_0x0cf1('0x75')][_0x0cf1('0x48')];_0x5aaa09+=0x1){let _0x43767c=_0x41cc54[_0x0cf1('0x75')][_0x5aaa09];var _0x28ed50=_0x4b2179[_0x0cf1('0x8b')]();_0x28ed50[_0x0cf1('0x4d')](_0x0cf1('0x8c'),_0x43767c['id']);_0x303bb5[_0x0cf1('0x8d')](db[_0x0cf1('0x78')][_0x0cf1('0x42')](_0x28ed50[_0x0cf1('0x8e')](),{'type':db[_0x0cf1('0x78')][_0x0cf1('0x8f')][_0x0cf1('0x90')]})[_0x0cf1('0x2e')](function(_0x2db00f){if(_0x2db00f[_0x0cf1('0x48')]===0x1){return _0x43767c['id'];}else{var _0x18560c=_[_0x0cf1('0x91')](_[_0x0cf1('0x34')](_0x2db00f,_0x0cf1('0x92')),function(_0x39ffed){return _[_0x0cf1('0x93')](_0x32cf0c,_0x39ffed);});if(_0x18560c){return _0x43767c['id'];}}}));}}return BPromise[_0x0cf1('0x94')](_0x303bb5)[_0x0cf1('0x2e')](function(_0xae6a7c){_0xbf3ba0=_(_0xbf3ba0)['union'](_0xae6a7c)[_0x0cf1('0x95')]()[_0x0cf1('0x35')]();return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x4a7a4b[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](function(_0x2ad342){return db[_0x0cf1('0x78')][_0x0cf1('0x79')](function(_0x4b9baa){return _0x2ad342[_0x0cf1('0x83')](_0x4a7a4b[_0x0cf1('0x42')]['ids'],{'transaction':_0x4b9baa})[_0x0cf1('0x2e')](function(){if(!_['isEmpty'](_0xbf3ba0)){return _0x2ad342[_0x0cf1('0x96')](_0xbf3ba0,{'transaction':_0x4b9baa})[_0x0cf1('0x2e')](function(){return db[_0x0cf1('0x97')][_0x0cf1('0x2f')]({'where':{'VoiceQueueId':_0x4a7a4b['params']['id'],'UserId':_0xbf3ba0},'transaction':_0x4b9baa});});}})[_0x0cf1('0x2e')](function(){_0xbf3ba0['forEach'](function(_0x2e79a8){socket[_0x0cf1('0x81')](_0x0cf1('0x98'),{'UserId':_0x2e79a8,'VoiceQueueId':_0x2ad342['id']});});});});});});})[_0x0cf1('0x2e')](respondWithStatusCode(_0x1383b4,null))[_0x0cf1('0x55')](handleError(_0x1383b4,null));};exports['addAgents']=function(_0x15751c,_0xda100b,_0x9f9fd0){var _0x2ae6d5,_0x10ee97;return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x15751c[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0xda100b,null))['then'](function(_0x3b8f56){if(_0x3b8f56){_0x10ee97=_0x3b8f56;return _0x3b8f56[_0x0cf1('0x99')](_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')],_[_0x0cf1('0x64')](_0x15751c['body'],[_0x0cf1('0x9a'),'id'])||{})[_0x0cf1('0x9b')](function(_0x4969f5){for(var _0x2c9c9a=0x0;_0x2c9c9a<_0x15751c[_0x0cf1('0x59')]['ids']['length'];_0x2c9c9a+=0x1){socket['emit'](_0x0cf1('0x82'),{'UserId':Number(_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')][_0x2c9c9a]),'VoiceQueueId':Number(_0x15751c[_0x0cf1('0x57')]['id'])});}return _0x4969f5;});}})[_0x0cf1('0x2e')](function(_0x454d90){_0x2ae6d5=_0x454d90||[];if(_0x10ee97){return db[_0x0cf1('0x73')]['findAll']({'where':{'id':_0x15751c[_0x0cf1('0x59')][_0x0cf1('0x9a')]},'attributes':['id',_0x0cf1('0x38'),'online','voicePause','interface'],'raw':!![]});}})[_0x0cf1('0x2e')](function(_0x5f3a49){if(!_[_0x0cf1('0x9c')](_0x5f3a49)){var _0x19231e=[];for(var _0x45c54b=0x0;_0x45c54b<_0x5f3a49['length'];_0x45c54b++){if(_0x5f3a49[_0x45c54b][_0x0cf1('0x9d')]){_0x19231e['push'](db[_0x0cf1('0x97')][_0x0cf1('0x7c')]({'membername':_0x5f3a49[_0x45c54b][_0x0cf1('0x38')],'UserId':_0x5f3a49[_0x45c54b]['id'],'queue_name':_0x10ee97['name'],'VoiceQueueId':_0x10ee97['id'],'interface':_['isNil'](_0x5f3a49[_0x45c54b][_0x0cf1('0x74')])?util[_0x0cf1('0x7e')]('SIP/%s',_0x5f3a49[_0x45c54b][_0x0cf1('0x38')]):_0x5f3a49[_0x45c54b]['interface'],'paused':_0x5f3a49[_0x45c54b][_0x0cf1('0x80')]||![],'penalty':_0x15751c['body'][_0x0cf1('0x77')]||0x0}));}}return BPromise[_0x0cf1('0x94')](_0x19231e);}})[_0x0cf1('0x2e')](function(){return _0x2ae6d5;})[_0x0cf1('0x2e')](respondWithResult(_0xda100b,null))[_0x0cf1('0x55')](handleError(_0xda100b,null));};exports['removeAgents']=function(_0x370a77,_0x336a86,_0x50f18f){return db[_0x0cf1('0x3d')]['find']({'where':{'id':_0x370a77[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x336a86,null))[_0x0cf1('0x2e')](function(_0x3bfbaa){if(_0x3bfbaa){return _0x3bfbaa[_0x0cf1('0x96')](_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')])[_0x0cf1('0x2e')](function(){if(_[_0x0cf1('0x9e')](_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')])){for(var _0x503fdb=0x0;_0x503fdb<_0x370a77['query'][_0x0cf1('0x9a')][_0x0cf1('0x48')];_0x503fdb+=0x1){socket[_0x0cf1('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x370a77[_0x0cf1('0x42')][_0x0cf1('0x9a')][_0x503fdb]),'VoiceQueueId':Number(_0x370a77[_0x0cf1('0x57')]['id'])});}}else{socket[_0x0cf1('0x81')](_0x0cf1('0x98'),{'UserId':Number(_0x370a77['query']['ids']),'VoiceQueueId':Number(_0x370a77[_0x0cf1('0x57')]['id'])});}});}})['then'](function(_0x3c1af9){return db[_0x0cf1('0x97')]['destroy']({'where':{'VoiceQueueId':_0x370a77['params']['id'],'UserId':_0x370a77['query'][_0x0cf1('0x9a')]}})['then'](function(){return _0x3c1af9;});})['then'](respondWithStatusCode(_0x336a86,null))[_0x0cf1('0x55')](handleError(_0x336a86,null));};exports[_0x0cf1('0x9f')]=function(_0x119b8f,_0x1fe608,_0x5acc1){var _0xa37e2f={};var _0x5ac77a={};var _0x3152fa;var _0x6c898f;return db['VoiceQueue'][_0x0cf1('0x6b')]({'where':{'id':_0x119b8f[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x1fe608,null))['then'](function(_0x3743b8){if(_0x3743b8){_0x3152fa=_0x3743b8;_0x5ac77a[_0x0cf1('0x41')]=_['keys'](db[_0x0cf1('0x73')][_0x0cf1('0x3e')]);_0x5ac77a[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x119b8f[_0x0cf1('0x42')]);_0x5ac77a['filters']=_['intersection'](_0x5ac77a[_0x0cf1('0x41')],_0x5ac77a[_0x0cf1('0x42')]);_0xa37e2f[_0x0cf1('0x47')]=_['intersection'](_0x5ac77a[_0x0cf1('0x41')],qs['fields'](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0xa37e2f[_0x0cf1('0x47')]=_0xa37e2f[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0xa37e2f['attributes']:_0x5ac77a['model'];_0xa37e2f[_0x0cf1('0x4a')]=qs['sort'](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0xa37e2f['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x119b8f['query'],_0x5ac77a[_0x0cf1('0x44')]));if(_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0xa37e2f[_0x0cf1('0x4d')]=_['merge'](_0xa37e2f[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0xa37e2f['attributes'],function(_0x452993){var _0x494bc5={};_0x494bc5[_0x452993]={'$like':'%'+_0x119b8f['query'][_0x0cf1('0x33')]+'%'};return _0x494bc5;})});}_0xa37e2f=_[_0x0cf1('0x4e')]({},_0xa37e2f,_0x119b8f[_0x0cf1('0x50')]);return _0x3152fa[_0x0cf1('0x9f')](_0xa37e2f);}})['then'](function(_0x2627d8){if(_0x2627d8){_0x6c898f=_0x2627d8['length'];if(!_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x68')]('nolimit')){_0xa37e2f['limit']=qs[_0x0cf1('0x27')](_0x119b8f[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0xa37e2f[_0x0cf1('0x24')]=qs['offset'](_0x119b8f['query'][_0x0cf1('0x24')]);}return _0x3152fa[_0x0cf1('0x9f')](_0xa37e2f);}})[_0x0cf1('0x2e')](function(_0x4f78c5){if(_0x4f78c5){return _0x4f78c5?{'count':_0x6c898f,'rows':_0x4f78c5}:null;}})['then'](respondWithResult(_0x1fe608,null))['catch'](handleError(_0x1fe608,null));};exports[_0x0cf1('0xa0')]=function(_0x93edce,_0x30bff3,_0x1e9694){var _0x219db9={};var _0x48ad43={};var _0x5f006d;var _0xa93e52;return db[_0x0cf1('0x3d')]['findOne']({'where':{'id':_0x93edce['params']['id']}})['then'](handleEntityNotFound(_0x30bff3,null))['then'](function(_0x1230d6){if(_0x1230d6){_0x5f006d=_0x1230d6;_0x48ad43['model']=_[_0x0cf1('0x43')](db[_0x0cf1('0x97')][_0x0cf1('0x3e')]);_0x48ad43[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x93edce[_0x0cf1('0x42')]);_0x48ad43[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x48ad43['model'],_0x48ad43['query']);_0x219db9[_0x0cf1('0x47')]=_['intersection'](_0x48ad43[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x93edce[_0x0cf1('0x42')]['fields']));_0x219db9[_0x0cf1('0x47')]=_0x219db9[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x219db9[_0x0cf1('0x47')]:_0x48ad43['model'];_0x219db9[_0x0cf1('0x4a')]=qs['sort'](_0x93edce[_0x0cf1('0x42')]['sort']);_0x219db9[_0x0cf1('0x4d')]=qs['filters'](_['pick'](_0x93edce['query'],_0x48ad43[_0x0cf1('0x44')]));if(_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x219db9['where']=_[_0x0cf1('0x4e')](_0x219db9['where'],{'$or':_[_0x0cf1('0x34')](_0x219db9[_0x0cf1('0x47')],function(_0x193b36){var _0x43033f={};_0x43033f[_0x193b36]={'$like':'%'+_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x43033f;})});}_0x219db9=_[_0x0cf1('0x4e')]({},_0x219db9,_0x93edce['options']);return _0x5f006d[_0x0cf1('0xa0')](_0x219db9);}})[_0x0cf1('0x2e')](function(_0xb1ab96){if(_0xb1ab96){_0xa93e52=_0xb1ab96[_0x0cf1('0x48')];if(!_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x219db9['limit']=qs['limit'](_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x27')]);_0x219db9[_0x0cf1('0x24')]=qs[_0x0cf1('0x24')](_0x93edce[_0x0cf1('0x42')][_0x0cf1('0x24')]);}return _0x5f006d[_0x0cf1('0xa0')](_0x219db9);}})[_0x0cf1('0x2e')](function(_0x2a4e19){return _0x2a4e19?{'count':_0xa93e52,'rows':_0x2a4e19}:null;})[_0x0cf1('0x2e')](respondWithResult(_0x30bff3,null))[_0x0cf1('0x55')](handleError(_0x30bff3,null));};exports[_0x0cf1('0xa1')]=function(_0x48807b,_0x1da063,_0x39a8c0){var _0x325f7c={};var _0x292481={};var _0x4db92e;var _0x581994;return db[_0x0cf1('0x3d')][_0x0cf1('0x6b')]({'where':{'id':_0x48807b[_0x0cf1('0x57')]['id']}})['then'](handleEntityNotFound(_0x1da063,null))[_0x0cf1('0x2e')](function(_0x4a3516){if(_0x4a3516){_0x4db92e=_0x4a3516;_0x292481[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db[_0x0cf1('0xa2')][_0x0cf1('0x3e')]);_0x292481[_0x0cf1('0x42')]=_[_0x0cf1('0x43')](_0x48807b['query']);_0x292481[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0x292481[_0x0cf1('0x41')],_0x292481['query']);_0x325f7c[_0x0cf1('0x47')]=_[_0x0cf1('0x45')](_0x292481[_0x0cf1('0x41')],qs['fields'](_0x48807b['query']['fields']));_0x325f7c[_0x0cf1('0x47')]=_0x325f7c['attributes'][_0x0cf1('0x48')]?_0x325f7c[_0x0cf1('0x47')]:_0x292481['model'];_0x325f7c[_0x0cf1('0x4a')]=qs['sort'](_0x48807b[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x325f7c['where']=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x48807b[_0x0cf1('0x42')],_0x292481[_0x0cf1('0x44')]));if(_0x48807b['query']['filter']){_0x325f7c[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x325f7c[_0x0cf1('0x4d')],{'$or':_[_0x0cf1('0x34')](_0x325f7c['attributes'],function(_0x49ea89){var _0xa9e819={};_0xa9e819[_0x49ea89]={'$like':'%'+_0x48807b[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0xa9e819;})});}_0x325f7c=_[_0x0cf1('0x4e')]({},_0x325f7c,_0x48807b[_0x0cf1('0x50')]);return _0x4db92e[_0x0cf1('0xa1')](_0x325f7c);}})['then'](function(_0x43e724){if(_0x43e724){_0x581994=_0x43e724[_0x0cf1('0x48')];if(!_0x48807b[_0x0cf1('0x42')]['hasOwnProperty'](_0x0cf1('0x49'))){_0x325f7c['limit']=qs[_0x0cf1('0x27')](_0x48807b[_0x0cf1('0x42')]['limit']);_0x325f7c['offset']=qs[_0x0cf1('0x24')](_0x48807b[_0x0cf1('0x42')]['offset']);}return _0x4db92e[_0x0cf1('0xa1')](_0x325f7c);}})[_0x0cf1('0x2e')](function(_0x3994ad){if(_0x3994ad){return _0x3994ad?{'count':_0x581994,'rows':_0x3994ad}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x1da063,null))[_0x0cf1('0x55')](handleError(_0x1da063,null));};exports[_0x0cf1('0xa3')]=function(_0x155ac4,_0x1e5c9d,_0x450be9){var _0xe6cacc,_0x259156;return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x155ac4['params']['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x1e5c9d,null))[_0x0cf1('0x2e')](function(_0x4a54a5){if(_0x4a54a5){_0x259156=_0x4a54a5;return _0x4a54a5[_0x0cf1('0xa3')](_0x155ac4[_0x0cf1('0x59')][_0x0cf1('0x9a')],_[_0x0cf1('0x64')](_0x155ac4[_0x0cf1('0x59')],[_0x0cf1('0x9a'),'id'])||{});}return null;})[_0x0cf1('0x9b')](function(_0x606208){var _0x111185;_0xe6cacc=_0x606208||[];var _0x204130=[];if(_0x606208){for(var _0x1668c8=0x0;_0x1668c8<_0x606208['length'];_0x1668c8+=0x1){var _0x298895=_0x606208[_0x1668c8][_0x0cf1('0x5c')]({'plain':!![]});_0x259156[_0x0cf1('0xa4')]=_0x155ac4[_0x0cf1('0x59')]['dialCheckDuplicateType']?_0x155ac4[_0x0cf1('0x59')][_0x0cf1('0xa4')]:_0x259156[_0x0cf1('0xa4')];switch(_0x259156[_0x0cf1('0xa4')]){case _0x0cf1('0xa5'):_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))['fromQuery']([_0x0cf1('0xa9'),_0x0cf1('0xaa'),'ContactId',_0x0cf1('0xab'),_0x0cf1('0x69'),'createdAt','updatedAt'],squel[_0x0cf1('0xac')]()['field'](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0xaa'))[_0x0cf1('0x84')]('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),_0x0cf1('0xab'))['field'](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field'](_0x0cf1('0xad'),_0x0cf1('0x63'))['from'](_0x0cf1('0xb0'))[_0x0cf1('0x4d')](_0x0cf1('0xb1'))['where'](_0x0cf1('0xb2'),_0x298895[_0x0cf1('0xaf')]['toString']())[_0x0cf1('0x4d')](_0x0cf1('0xb3'))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel[_0x0cf1('0xac')]()['field'](_0x0cf1('0xb5'))['from'](_0x0cf1('0xb6'))[_0x0cf1('0x4d')](_0x0cf1('0x8a'),_0x155ac4['params']['id'][_0x0cf1('0x8e')]()))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xb7'))[_0x0cf1('0x86')](_0x0cf1('0xa8'))['where'](_0x0cf1('0x8a'),_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')]())))[_0x0cf1('0x8e')]();break;case'onlyIfOpen':_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))[_0x0cf1('0xb8')](['phone',_0x0cf1('0xaa'),_0x0cf1('0xae'),'ListId',_0x0cf1('0x69'),'createdAt','updatedAt'],squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0xaa'))[_0x0cf1('0x84')]('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),_0x0cf1('0xab'))[_0x0cf1('0x84')](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')]('NOW()',_0x0cf1('0x62'))[_0x0cf1('0x84')]('NOW()','updatedAt')[_0x0cf1('0x86')]('cm_contacts')[_0x0cf1('0x4d')]('deletedAt\x20IS\x20NULL')[_0x0cf1('0x4d')]('ListId\x20=\x20?',_0x298895[_0x0cf1('0xaf')]['toString']())[_0x0cf1('0x4d')](_0x0cf1('0xb3'))[_0x0cf1('0x4d')](_0x0cf1('0xb4'),squel['select']()['field'](_0x0cf1('0xb7'))[_0x0cf1('0x86')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')]())))['toString']();break;default:_0x111185=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')](_0x0cf1('0xa8'))['fromQuery']([_0x0cf1('0xa9'),_0x0cf1('0xaa'),_0x0cf1('0xae'),_0x0cf1('0xab'),'VoiceQueueId',_0x0cf1('0x62'),_0x0cf1('0x63')],squel[_0x0cf1('0xac')]()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')]('NOW()',_0x0cf1('0xaa'))['field']('id',_0x0cf1('0xae'))[_0x0cf1('0x84')](_0x298895['CmListId'][_0x0cf1('0x8e')](),_0x0cf1('0xab'))['field'](_0x155ac4[_0x0cf1('0x57')]['id'][_0x0cf1('0x8e')](),'VoiceQueueId')[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field'](_0x0cf1('0xad'),_0x0cf1('0x63'))[_0x0cf1('0x86')](_0x0cf1('0xb0'))[_0x0cf1('0x4d')](_0x0cf1('0xb1'))[_0x0cf1('0x4d')]('ListId\x20=\x20?',_0x298895[_0x0cf1('0xaf')][_0x0cf1('0x8e')]())['where'](_0x0cf1('0xb3')))[_0x0cf1('0x8e')]();}_0x204130[_0x0cf1('0x8d')](db[_0x0cf1('0x78')][_0x0cf1('0x42')](_0x111185));}return BPromise[_0x0cf1('0x94')](_0x204130);}})[_0x0cf1('0x2e')](function(){return _0xe6cacc;})[_0x0cf1('0x2e')](respondWithResult(_0x1e5c9d,null))['catch'](handleError(_0x1e5c9d,null));};exports[_0x0cf1('0xb9')]=function(_0x282eb1,_0x5859d2,_0x261c5f){return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x282eb1[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x5859d2,null))['then'](function(_0x5e1835){if(_0x5e1835){return _0x5e1835[_0x0cf1('0xb9')](_0x282eb1[_0x0cf1('0x42')][_0x0cf1('0x9a')]);}})[_0x0cf1('0x2e')](function(_0x5c6f26){if(_0x5c6f26){return db[_0x0cf1('0x67')][_0x0cf1('0x2f')]({'where':{'ListId':_0x282eb1[_0x0cf1('0x42')][_0x0cf1('0x9a')],'VoiceQueueId':_0x282eb1['params']['id']}})[_0x0cf1('0x2e')](function(){return _0x5c6f26;});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x5859d2,null))[_0x0cf1('0x55')](handleError(_0x5859d2,null));};exports[_0x0cf1('0xba')]=function(_0x436def,_0x192aed,_0x4df289){var _0x5bdd11={};var _0xced3d5={};var _0xfb998c;var _0x3d1601;return db['VoiceQueue']['findOne']({'where':{'id':_0x436def['params']['id']}})['then'](handleEntityNotFound(_0x192aed,null))[_0x0cf1('0x2e')](function(_0x3f6fb7){if(_0x3f6fb7){_0xfb998c=_0x3f6fb7;_0xced3d5[_0x0cf1('0x41')]=_[_0x0cf1('0x43')](db['CmList'][_0x0cf1('0x3e')]);_0xced3d5['query']=_[_0x0cf1('0x43')](_0x436def[_0x0cf1('0x42')]);_0xced3d5[_0x0cf1('0x44')]=_[_0x0cf1('0x45')](_0xced3d5[_0x0cf1('0x41')],_0xced3d5[_0x0cf1('0x42')]);_0x5bdd11[_0x0cf1('0x47')]=_['intersection'](_0xced3d5[_0x0cf1('0x41')],qs[_0x0cf1('0x46')](_0x436def[_0x0cf1('0x42')][_0x0cf1('0x46')]));_0x5bdd11['attributes']=_0x5bdd11[_0x0cf1('0x47')][_0x0cf1('0x48')]?_0x5bdd11['attributes']:_0xced3d5[_0x0cf1('0x41')];_0x5bdd11['order']=qs['sort'](_0x436def[_0x0cf1('0x42')][_0x0cf1('0x4b')]);_0x5bdd11[_0x0cf1('0x4d')]=qs[_0x0cf1('0x44')](_[_0x0cf1('0x4c')](_0x436def[_0x0cf1('0x42')],_0xced3d5[_0x0cf1('0x44')]));if(_0x436def[_0x0cf1('0x42')][_0x0cf1('0x33')]){_0x5bdd11[_0x0cf1('0x4d')]=_[_0x0cf1('0x4e')](_0x5bdd11['where'],{'$or':_['map'](_0x5bdd11[_0x0cf1('0x47')],function(_0x34818b){var _0x194ded={};_0x194ded[_0x34818b]={'$like':'%'+_0x436def[_0x0cf1('0x42')][_0x0cf1('0x33')]+'%'};return _0x194ded;})});}_0x5bdd11=_[_0x0cf1('0x4e')]({},_0x5bdd11,_0x436def['options']);return _0xfb998c[_0x0cf1('0xba')](_0x5bdd11);}})[_0x0cf1('0x2e')](function(_0x1c93ac){if(_0x1c93ac){_0x3d1601=_0x1c93ac['length'];if(!_0x436def['query'][_0x0cf1('0x68')](_0x0cf1('0x49'))){_0x5bdd11[_0x0cf1('0x27')]=qs[_0x0cf1('0x27')](_0x436def[_0x0cf1('0x42')]['limit']);_0x5bdd11['offset']=qs[_0x0cf1('0x24')](_0x436def['query']['offset']);}return _0xfb998c[_0x0cf1('0xba')](_0x5bdd11);}})[_0x0cf1('0x2e')](function(_0x111c92){if(_0x111c92){return _0x111c92?{'count':_0x3d1601,'rows':_0x111c92}:null;}})[_0x0cf1('0x2e')](respondWithResult(_0x192aed,null))[_0x0cf1('0x55')](handleError(_0x192aed,null));};exports[_0x0cf1('0xbb')]=function(_0x433c96,_0x367e97,_0x28130e){var _0x38f9e5,_0x23459f;return db['VoiceQueue'][_0x0cf1('0x37')]({'where':{'id':_0x433c96[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x367e97,null))[_0x0cf1('0x2e')](function(_0x91c04a){if(_0x91c04a){_0x23459f=_0x91c04a;return _0x91c04a[_0x0cf1('0xbb')](_0x433c96['body']['ids'],_[_0x0cf1('0x64')](_0x433c96['body'],[_0x0cf1('0x9a'),'id'])||{});}return null;})[_0x0cf1('0x9b')](function(_0x141956){var _0x3a40fd;_0x38f9e5=_0x141956||[];var _0x595bc1=[];if(_0x141956){for(var _0x131b7f=0x0;_0x131b7f<_0x141956[_0x0cf1('0x48')];_0x131b7f+=0x1){var _0x4bab57=_0x141956[_0x131b7f][_0x0cf1('0x5c')]({'plain':!![]});_0x3a40fd=squel[_0x0cf1('0xa6')]()[_0x0cf1('0xa7')]('cm_hopper_black')[_0x0cf1('0xb8')]([_0x0cf1('0xa9'),_0x0cf1('0xae'),_0x0cf1('0xab'),_0x0cf1('0x69'),'createdAt','updatedAt'],squel['select']()[_0x0cf1('0x84')](_0x0cf1('0xa9'),_0x0cf1('0xa9'))[_0x0cf1('0x84')]('id','ContactId')[_0x0cf1('0x84')](_0x4bab57[_0x0cf1('0xaf')][_0x0cf1('0x8e')](),'ListId')['field'](_0x433c96[_0x0cf1('0x57')]['id']['toString'](),_0x0cf1('0x69'))[_0x0cf1('0x84')](_0x0cf1('0xad'),_0x0cf1('0x62'))['field']('NOW()',_0x0cf1('0x63'))[_0x0cf1('0x86')]('cm_contacts')['where'](_0x0cf1('0xb1'))[_0x0cf1('0x4d')](_0x0cf1('0xb2'),_0x4bab57[_0x0cf1('0xaf')][_0x0cf1('0x8e')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0cf1('0x8e')]();_0x595bc1[_0x0cf1('0x8d')](db[_0x0cf1('0x78')]['query'](_0x3a40fd));}return BPromise['all'](_0x595bc1);}})[_0x0cf1('0x2e')](function(){return _0x38f9e5;})[_0x0cf1('0x2e')](respondWithResult(_0x367e97,null))[_0x0cf1('0x55')](handleError(_0x367e97,null));};exports['removeBlackLists']=function(_0x2a9a64,_0x4f5619,_0x3fe477){return db[_0x0cf1('0x3d')][_0x0cf1('0x37')]({'where':{'id':_0x2a9a64[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](handleEntityNotFound(_0x4f5619,null))[_0x0cf1('0x2e')](function(_0x1faea9){if(_0x1faea9){return _0x1faea9[_0x0cf1('0xbc')](_0x2a9a64[_0x0cf1('0x42')][_0x0cf1('0x9a')]);}})[_0x0cf1('0x2e')](function(_0x43d115){if(_0x43d115){return db[_0x0cf1('0x6f')][_0x0cf1('0x2f')]({'where':{'ListId':_0x2a9a64[_0x0cf1('0x42')][_0x0cf1('0x9a')],'VoiceQueueId':_0x2a9a64[_0x0cf1('0x57')]['id']}})[_0x0cf1('0x2e')](function(){return _0x43d115;});}})[_0x0cf1('0x2e')](respondWithStatusCode(_0x4f5619,null))[_0x0cf1('0x55')](handleError(_0x4f5619,null));};
\ No newline at end of file
+var _0x33fd=['ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','union','compact','ids','isEmpty','emit','userVoiceQueue:remove','addAgents','spread','push','all','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','into','cm_contacts','removeLists','getBlackLists','CmList','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','VoiceQueues','QueueCampaigns','outbound','ignore','value','includes','type','find','name','UserProfileResource','destroy','error','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','VoiceQueue','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','get','omit','createdAt','updatedAt','user','role','getHoppers','findOne','CmHopper','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','transaction','each','TeamVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','removeTeams','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?'];(function(_0x782536,_0x31da3c){var _0xcd5656=function(_0x53d817){while(--_0x53d817){_0x782536['push'](_0x782536['shift']());}};_0xcd5656(++_0x31da3c);}(_0x33fd,0x1a2));var _0xd33f=function(_0x9f1382,_0x11b733){_0x9f1382=_0x9f1382-0x0;var _0x23410d=_0x33fd[_0x9f1382];return _0x23410d;};'use strict';var emlformat=require(_0xd33f('0x0'));var rimraf=require(_0xd33f('0x1'));var zipdir=require(_0xd33f('0x2'));var jsonpatch=require(_0xd33f('0x3'));var rp=require(_0xd33f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd33f('0x5'));var util=require(_0xd33f('0x6'));var path=require(_0xd33f('0x7'));var sox=require('sox');var csv=require(_0xd33f('0x8'));var ejs=require(_0xd33f('0x9'));var fs=require('fs');var fs_extra=require(_0xd33f('0xa'));var _=require(_0xd33f('0xb'));var squel=require(_0xd33f('0xc'));var crypto=require('crypto');var jsforce=require(_0xd33f('0xd'));var deskjs=require(_0xd33f('0xe'));var toCsv=require(_0xd33f('0x8'));var querystring=require(_0xd33f('0xf'));var Papa=require(_0xd33f('0x10'));var Redis=require(_0xd33f('0x11'));var authService=require(_0xd33f('0x12'));var qs=require(_0xd33f('0x13'));var as=require(_0xd33f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd33f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd33f('0x16'));var licenseUtil=require(_0xd33f('0x17'));var db=require(_0xd33f('0x18'))['db'];config[_0xd33f('0x19')]=_[_0xd33f('0x1a')](config[_0xd33f('0x19')],{'host':_0xd33f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd33f('0x1c'))['register'](socket);function respondWithStatusCode(_0x1e0317,_0x3ffacb){_0x3ffacb=_0x3ffacb||0xcc;return function(_0x31708e){if(_0x31708e){return _0x1e0317[_0xd33f('0x1d')](_0x3ffacb);}return _0x1e0317[_0xd33f('0x1e')](_0x3ffacb)[_0xd33f('0x1f')]();};}function respondWithResult(_0x182c46,_0x428f95){_0x428f95=_0x428f95||0xc8;return function(_0x2b4b0d){if(_0x2b4b0d){return _0x182c46[_0xd33f('0x1e')](_0x428f95)[_0xd33f('0x20')](_0x2b4b0d);}};}function respondWithFilteredResult(_0x457421,_0x44e39c){return function(_0x43ecd7){if(_0x43ecd7){var _0x27fbab=typeof _0x44e39c['offset']===_0xd33f('0x21')&&typeof _0x44e39c[_0xd33f('0x22')]===_0xd33f('0x21');var _0x5d7939=_0x43ecd7[_0xd33f('0x23')];var _0x17d2c8=_0x27fbab?0x0:_0x44e39c[_0xd33f('0x24')];var _0x138622=_0x27fbab?_0x43ecd7[_0xd33f('0x23')]:_0x44e39c[_0xd33f('0x24')]+_0x44e39c['limit'];var _0x3e21e5;if(_0x138622>=_0x5d7939){_0x138622=_0x5d7939;_0x3e21e5=0xc8;}else{_0x3e21e5=0xce;}_0x457421['status'](_0x3e21e5);return _0x457421[_0xd33f('0x25')](_0xd33f('0x26'),_0x17d2c8+'-'+_0x138622+'/'+_0x5d7939)[_0xd33f('0x20')](_0x43ecd7);}return null;};}function patchUpdates(_0xdb443d){return function(_0x599ac){try{jsonpatch[_0xd33f('0x27')](_0x599ac,_0xdb443d,!![]);}catch(_0x32a593){return BPromise['reject'](_0x32a593);}return _0x599ac[_0xd33f('0x28')]();};}function saveUpdates(_0x354cae,_0x157c4d){return function(_0x2bb3ce){if(_0x2bb3ce){return _0x2bb3ce[_0xd33f('0x29')](_0x354cae)[_0xd33f('0x2a')](function(_0x86c1fe){return _0x86c1fe;});}return null;};}function removeEntity(_0x3abbe6,_0x4a295b){return function(_0x37590e){if(_0x37590e){return _0x37590e['destroy']()[_0xd33f('0x2a')](function(){var _0x1376b3=_0x37590e['get']({'plain':!![]});var _0x1cc338=[{'name':_0xd33f('0x2b'),'value':'inbound','ignore':![]},{'name':_0xd33f('0x2c'),'value':_0xd33f('0x2d'),'ignore':![]}];var _0x5bb0d1=_(_0x1cc338)['filter'](_0xd33f('0x2e'))['map'](_0xd33f('0x2f'))[_0xd33f('0x2f')]();if(_[_0xd33f('0x30')](_0x5bb0d1,_0x1376b3[_0xd33f('0x31')])){return;}var _0x275d6f=_[_0xd33f('0x32')](_0x1cc338,[_0xd33f('0x2f'),_0x1376b3['type']])[_0xd33f('0x33')];return db[_0xd33f('0x34')][_0xd33f('0x35')]({'where':{'type':_0x275d6f,'resourceId':_0x1376b3['id']}})[_0xd33f('0x2a')](function(){return _0x37590e;});})[_0xd33f('0x2a')](function(){_0x3abbe6[_0xd33f('0x1e')](0xcc)[_0xd33f('0x1f')]();});}};}function handleEntityNotFound(_0x1a535b,_0x160ce0){return function(_0x2c68c9){if(!_0x2c68c9){_0x1a535b[_0xd33f('0x1d')](0x194);}return _0x2c68c9;};}function handleError(_0x51b02f,_0x443815){_0x443815=_0x443815||0x1f4;return function(_0x26a3d1){logger[_0xd33f('0x36')](_0x26a3d1['stack']);if(_0x26a3d1[_0xd33f('0x33')]){delete _0x26a3d1[_0xd33f('0x33')];}_0x51b02f[_0xd33f('0x1e')](_0x443815)[_0xd33f('0x37')](_0x26a3d1);};}exports[_0xd33f('0x38')]=function(_0x5d1831,_0x557afe){var _0xf40181={},_0x1fcb96={},_0x2b0c4f={'count':0x0,'rows':[]};var _0x181eb2=_[_0xd33f('0x39')](db['VoiceQueue'][_0xd33f('0x3a')],function(_0x163b10){return{'name':_0x163b10[_0xd33f('0x3b')],'type':_0x163b10[_0xd33f('0x31')][_0xd33f('0x3c')]};});_0x1fcb96[_0xd33f('0x3d')]=_['map'](_0x181eb2,_0xd33f('0x33'));_0x1fcb96[_0xd33f('0x3e')]=_[_0xd33f('0x3f')](_0x5d1831[_0xd33f('0x3e')]);_0x1fcb96[_0xd33f('0x40')]=_['intersection'](_0x1fcb96[_0xd33f('0x3d')],_0x1fcb96['query']);_0xf40181[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x1fcb96[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x5d1831[_0xd33f('0x3e')]['fields']));_0xf40181['attributes']=_0xf40181['attributes'][_0xd33f('0x44')]?_0xf40181[_0xd33f('0x41')]:_0x1fcb96[_0xd33f('0x3d')];if(!_0x5d1831[_0xd33f('0x3e')][_0xd33f('0x45')](_0xd33f('0x46'))){_0xf40181['limit']=qs['limit'](_0x5d1831[_0xd33f('0x3e')][_0xd33f('0x22')]);_0xf40181['offset']=qs['offset'](_0x5d1831['query'][_0xd33f('0x24')]);}_0xf40181[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x5d1831['query'][_0xd33f('0x48')]);_0xf40181[_0xd33f('0x49')]=qs['filters'](_[_0xd33f('0x4a')](_0x5d1831[_0xd33f('0x3e')],_0x1fcb96[_0xd33f('0x40')]),_0x181eb2);if(_0x5d1831[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0xf40181[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0xf40181[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x181eb2,function(_0x5e1ae5){if(_0x5e1ae5[_0xd33f('0x31')]!==_0xd33f('0x4d')){var _0x534130={};_0x534130[_0x5e1ae5[_0xd33f('0x33')]]={'$like':'%'+_0x5d1831[_0xd33f('0x3e')][_0xd33f('0x4b')]+'%'};return _0x534130;}})});}_0xf40181=_['merge']({},_0xf40181,_0x5d1831[_0xd33f('0x4e')]);var _0x1e5294={'where':_0xf40181[_0xd33f('0x49')]};return db['VoiceQueue'][_0xd33f('0x23')](_0x1e5294)[_0xd33f('0x2a')](function(_0x1d46df){_0x2b0c4f[_0xd33f('0x23')]=_0x1d46df;if(_0x5d1831[_0xd33f('0x3e')][_0xd33f('0x4f')]){_0xf40181['include']=[{'all':!![]}];}return db['VoiceQueue'][_0xd33f('0x50')](_0xf40181);})[_0xd33f('0x2a')](function(_0x2e11ec){_0x2b0c4f['rows']=_0x2e11ec;return _0x2b0c4f;})[_0xd33f('0x2a')](respondWithFilteredResult(_0x557afe,_0xf40181))[_0xd33f('0x51')](handleError(_0x557afe,null));};exports['show']=function(_0xb025f3,_0x490103){var _0x50ca9a={'raw':![],'where':{'id':_0xb025f3[_0xd33f('0x52')]['id']}},_0x530d3e={};_0x530d3e['model']=_[_0xd33f('0x3f')](db['VoiceQueue'][_0xd33f('0x3a')]);_0x530d3e[_0xd33f('0x3e')]=_['keys'](_0xb025f3['query']);_0x530d3e[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x530d3e[_0xd33f('0x3d')],_0x530d3e[_0xd33f('0x3e')]);_0x50ca9a[_0xd33f('0x41')]=_['intersection'](_0x530d3e[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0xb025f3[_0xd33f('0x3e')][_0xd33f('0x43')]));_0x50ca9a['attributes']=_0x50ca9a[_0xd33f('0x41')][_0xd33f('0x44')]?_0x50ca9a[_0xd33f('0x41')]:_0x530d3e[_0xd33f('0x3d')];if(_0xb025f3[_0xd33f('0x3e')][_0xd33f('0x4f')]){_0x50ca9a[_0xd33f('0x53')]=[{'all':!![]}];}_0x50ca9a=_[_0xd33f('0x4c')]({},_0x50ca9a,_0xb025f3['options']);return db[_0xd33f('0x54')][_0xd33f('0x32')](_0x50ca9a)[_0xd33f('0x2a')](handleEntityNotFound(_0x490103,null))[_0xd33f('0x2a')](respondWithResult(_0x490103,null))[_0xd33f('0x51')](handleError(_0x490103,null));};exports[_0xd33f('0x55')]=function(_0x11451b,_0x4eeb08){return db['VoiceQueue']['create'](_0x11451b[_0xd33f('0x56')],{})[_0xd33f('0x2a')](function(_0x27c9a0){var _0x571224=_0x11451b['user']['get']({'plain':!![]});if(!_0x571224)throw new Error(_0xd33f('0x57'));if(_0x571224['role']==='user'){var _0x294fc2=_0x27c9a0['get']({'plain':!![]});var _0x39570d=[{'name':'VoiceQueues','value':_0xd33f('0x58')},{'name':_0xd33f('0x2c'),'value':_0xd33f('0x2d')}];var _0x11dfd=_[_0xd33f('0x32')](_0x39570d,[_0xd33f('0x2f'),_0x294fc2['type']])[_0xd33f('0x33')];return db[_0xd33f('0x59')][_0xd33f('0x32')]({'where':{'name':_0x11dfd,'userProfileId':_0x571224[_0xd33f('0x5a')]},'raw':!![]})[_0xd33f('0x2a')](function(_0x39210f){if(_0x39210f&&_0x39210f[_0xd33f('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x294fc2[_0xd33f('0x33')],'resourceId':_0x294fc2['id'],'type':_0x39210f[_0xd33f('0x33')],'sectionId':_0x39210f['id']},{})[_0xd33f('0x2a')](function(){return _0x27c9a0;});}else{return _0x27c9a0;}})[_0xd33f('0x51')](function(_0x25be14){logger[_0xd33f('0x36')](_0xd33f('0x5c'),_0x25be14);throw _0x25be14;});}return _0x27c9a0;})['then'](respondWithResult(_0x4eeb08,0xc9))[_0xd33f('0x51')](handleError(_0x4eeb08,null));};exports[_0xd33f('0x5d')]=function(_0x2efb21,_0x10d021){var _0x3144fe={'where':{'id':_0x2efb21['params']['id']}},_0x20444c={};_0x20444c[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db['VoiceQueue']['rawAttributes']);_0x3144fe[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x20444c[_0xd33f('0x3d')],qs['fields'](_0x2efb21[_0xd33f('0x3e')][_0xd33f('0x43')]));_0x3144fe['attributes']=_0x3144fe['attributes'][_0xd33f('0x44')]?_0x3144fe[_0xd33f('0x41')]:_0x20444c['model'];if(_0x2efb21[_0xd33f('0x3e')]['includeAll']){_0x3144fe['include']=[{'all':!![]}];}_0x3144fe=_[_0xd33f('0x4c')]({},_0x3144fe,_0x2efb21[_0xd33f('0x4e')]);return db['VoiceQueue'][_0xd33f('0x32')](_0x3144fe)[_0xd33f('0x2a')](handleEntityNotFound(_0x10d021,null))[_0xd33f('0x2a')](function(_0x58d9b1){if(_0x58d9b1){var _0x2572e4=_0x58d9b1[_0xd33f('0x5e')]({'plain':!![]});_0x2572e4=qs[_0xd33f('0x5f')](_0x2572e4,['id',_0xd33f('0x60'),_0xd33f('0x61')]);_0x2efb21[_0xd33f('0x56')]=_['omit'](_0x2efb21[_0xd33f('0x56')],['id','createdAt',_0xd33f('0x61')]);return db['VoiceQueue'][_0xd33f('0x55')](_['merge'](_0x2572e4,_0x2efb21[_0xd33f('0x56')]),{'include':_0x2efb21[_0xd33f('0x3e')][_0xd33f('0x4f')]?[{'all':!![]}]:undefined})[_0xd33f('0x2a')](function(_0x291f36){var _0x4f756b=_0x2efb21[_0xd33f('0x62')][_0xd33f('0x5e')]({'plain':!![]});if(!_0x4f756b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f756b[_0xd33f('0x63')]===_0xd33f('0x62')){var _0x1f718b=_0x291f36[_0xd33f('0x5e')]({'plain':!![]});var _0x1838cc=[{'name':_0xd33f('0x2b'),'value':_0xd33f('0x58')},{'name':_0xd33f('0x2c'),'value':_0xd33f('0x2d')}];var _0x4d311b=_[_0xd33f('0x32')](_0x1838cc,[_0xd33f('0x2f'),_0x1f718b[_0xd33f('0x31')]])[_0xd33f('0x33')];return db[_0xd33f('0x59')][_0xd33f('0x32')]({'where':{'name':_0x4d311b,'userProfileId':_0x4f756b[_0xd33f('0x5a')]},'raw':!![]})[_0xd33f('0x2a')](function(_0x4f205f){if(_0x4f205f&&_0x4f205f[_0xd33f('0x5b')]===0x0){return db[_0xd33f('0x34')][_0xd33f('0x55')]({'name':_0x1f718b['name'],'resourceId':_0x1f718b['id'],'type':_0x4f205f[_0xd33f('0x33')],'sectionId':_0x4f205f['id']},{})[_0xd33f('0x2a')](function(){return _0x291f36;});}else{return _0x291f36;}})[_0xd33f('0x51')](function(_0x101011){logger[_0xd33f('0x36')](_0xd33f('0x5c'),_0x101011);throw _0x101011;});}return _0x291f36;});}})[_0xd33f('0x2a')](respondWithResult(_0x10d021,0xc9))[_0xd33f('0x51')](handleError(_0x10d021,null));};exports['update']=function(_0x218cfe,_0x28930e){if(_0x218cfe['body']['id']){delete _0x218cfe[_0xd33f('0x56')]['id'];}return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x218cfe['params']['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x28930e,null))[_0xd33f('0x2a')](saveUpdates(_0x218cfe[_0xd33f('0x56')],null))[_0xd33f('0x2a')](respondWithResult(_0x28930e,null))[_0xd33f('0x51')](handleError(_0x28930e,null));};exports['destroy']=function(_0x568ca0,_0x23cd21){return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x568ca0['params']['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x23cd21,null))['then'](removeEntity(_0x23cd21,null))[_0xd33f('0x51')](handleError(_0x23cd21,null));};exports[_0xd33f('0x64')]=function(_0x3830c3,_0x58dec8,_0x305e4c){var _0x39c26f={'raw':![],'where':{}};var _0x4ded07={};var _0x7d4fec={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd33f('0x65')]({'where':{'id':_0x3830c3[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x58dec8,null))[_0xd33f('0x2a')](function(_0x132d14){if(_0x132d14){_0x4ded07[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db[_0xd33f('0x66')]['rawAttributes']);_0x4ded07[_0xd33f('0x3e')]=_['keys'](_0x3830c3[_0xd33f('0x3e')]);_0x4ded07[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x4ded07[_0xd33f('0x3d')],_0x4ded07[_0xd33f('0x3e')]);_0x39c26f[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x4ded07[_0xd33f('0x3d')],qs['fields'](_0x3830c3['query']['fields']));_0x39c26f[_0xd33f('0x41')]=_0x39c26f[_0xd33f('0x41')][_0xd33f('0x44')]?_0x39c26f[_0xd33f('0x41')]:_0x4ded07[_0xd33f('0x3d')];if(!_0x3830c3[_0xd33f('0x3e')][_0xd33f('0x45')](_0xd33f('0x46'))){_0x39c26f['limit']=qs['limit'](_0x3830c3[_0xd33f('0x3e')]['limit']);_0x39c26f['offset']=qs[_0xd33f('0x24')](_0x3830c3[_0xd33f('0x3e')][_0xd33f('0x24')]);}_0x39c26f[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x3830c3['query']['sort']);_0x39c26f[_0xd33f('0x49')]=qs[_0xd33f('0x40')](_[_0xd33f('0x4a')](_0x3830c3[_0xd33f('0x3e')],_0x4ded07[_0xd33f('0x40')]));_0x39c26f['where']['VoiceQueueId']=_0x132d14['id'];if(_0x3830c3[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x39c26f[_0xd33f('0x49')]=_['merge'](_0x39c26f[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x39c26f[_0xd33f('0x41')],function(_0x330af3){var _0x14f977={};_0x14f977[_0x330af3]={'$like':'%'+_0x3830c3['query'][_0xd33f('0x4b')]+'%'};return _0x14f977;})});}_0x39c26f=_[_0xd33f('0x4c')]({},_0x39c26f,_0x3830c3[_0xd33f('0x4e')]);return db['CmHopper'][_0xd33f('0x23')]({'where':_0x39c26f[_0xd33f('0x49')]})['then'](function(_0x36f302){_0x7d4fec[_0xd33f('0x23')]=_0x36f302;if(_0x3830c3[_0xd33f('0x3e')][_0xd33f('0x4f')]){_0x39c26f[_0xd33f('0x53')]=[{'all':!![]}];}return db[_0xd33f('0x66')][_0xd33f('0x50')](_0x39c26f);})[_0xd33f('0x2a')](function(_0x2cd669){_0x7d4fec[_0xd33f('0x67')]=_0x2cd669;return _0x7d4fec;});}})['then'](respondWithFilteredResult(_0x58dec8,_0x39c26f))[_0xd33f('0x51')](handleError(_0x58dec8,null));};exports[_0xd33f('0x68')]=function(_0x32f724,_0x5174e,_0x4dbc0e){var _0x1dcac3={'raw':!![],'where':{}};var _0x2897ce={};var _0x154fc1={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd33f('0x65')]({'where':{'id':_0x32f724[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x5174e,null))['then'](function(_0x5e4fd7){if(_0x5e4fd7){_0x2897ce[_0xd33f('0x3d')]=_['keys'](db[_0xd33f('0x69')][_0xd33f('0x3a')]);_0x2897ce['query']=_[_0xd33f('0x3f')](_0x32f724[_0xd33f('0x3e')]);_0x2897ce[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x2897ce[_0xd33f('0x3d')],_0x2897ce['query']);_0x1dcac3[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x2897ce[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x32f724[_0xd33f('0x3e')]['fields']));_0x1dcac3[_0xd33f('0x41')]=_0x1dcac3[_0xd33f('0x41')][_0xd33f('0x44')]?_0x1dcac3[_0xd33f('0x41')]:_0x2897ce[_0xd33f('0x3d')];if(!_0x32f724[_0xd33f('0x3e')]['hasOwnProperty']('nolimit')){_0x1dcac3['limit']=qs[_0xd33f('0x22')](_0x32f724[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x1dcac3[_0xd33f('0x24')]=qs['offset'](_0x32f724[_0xd33f('0x3e')][_0xd33f('0x24')]);}_0x1dcac3[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x32f724[_0xd33f('0x3e')][_0xd33f('0x48')]);_0x1dcac3['where']=qs[_0xd33f('0x40')](_[_0xd33f('0x4a')](_0x32f724[_0xd33f('0x3e')],_0x2897ce['filters']));_0x1dcac3['where'][_0xd33f('0x6a')]=_0x5e4fd7['id'];if(_0x32f724[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x1dcac3[_0xd33f('0x49')]=_['merge'](_0x1dcac3['where'],{'$or':_[_0xd33f('0x39')](_0x1dcac3[_0xd33f('0x41')],function(_0x22945c){var _0x4cf895={};_0x4cf895[_0x22945c]={'$like':'%'+_0x32f724[_0xd33f('0x3e')][_0xd33f('0x4b')]+'%'};return _0x4cf895;})});}_0x1dcac3=_[_0xd33f('0x4c')]({},_0x1dcac3,_0x32f724[_0xd33f('0x4e')]);return db['CmHopperHistory']['count']({'where':_0x1dcac3[_0xd33f('0x49')]})[_0xd33f('0x2a')](function(_0x352fc9){_0x154fc1[_0xd33f('0x23')]=_0x352fc9;if(_0x32f724[_0xd33f('0x3e')][_0xd33f('0x4f')]){_0x1dcac3[_0xd33f('0x53')]=[{'all':!![]}];}return db[_0xd33f('0x69')][_0xd33f('0x50')](_0x1dcac3);})[_0xd33f('0x2a')](function(_0x29b6d3){_0x154fc1[_0xd33f('0x67')]=_0x29b6d3;return _0x154fc1;});}})['then'](respondWithFilteredResult(_0x5174e,_0x1dcac3))[_0xd33f('0x51')](handleError(_0x5174e,null));};exports[_0xd33f('0x6b')]=function(_0x55f00b,_0x2ec93c,_0x188188){var _0x3d17b0={'raw':!![],'where':{}};var _0x21eb93={};var _0x341530={'count':0x0,'rows':[]};return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x55f00b[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x2ec93c,null))[_0xd33f('0x2a')](function(_0x5b4059){if(_0x5b4059){_0x21eb93['model']=_[_0xd33f('0x3f')](db['CmHopperFinal']['rawAttributes']);_0x21eb93[_0xd33f('0x3e')]=_[_0xd33f('0x3f')](_0x55f00b[_0xd33f('0x3e')]);_0x21eb93['filters']=_['intersection'](_0x21eb93[_0xd33f('0x3d')],_0x21eb93[_0xd33f('0x3e')]);_0x3d17b0[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x21eb93[_0xd33f('0x3d')],qs['fields'](_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x43')]));_0x3d17b0[_0xd33f('0x41')]=_0x3d17b0[_0xd33f('0x41')][_0xd33f('0x44')]?_0x3d17b0[_0xd33f('0x41')]:_0x21eb93['model'];if(!_0x55f00b['query'][_0xd33f('0x45')]('nolimit')){_0x3d17b0[_0xd33f('0x22')]=qs[_0xd33f('0x22')](_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x3d17b0[_0xd33f('0x24')]=qs['offset'](_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x24')]);}_0x3d17b0[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x48')]);_0x3d17b0[_0xd33f('0x49')]=qs['filters'](_[_0xd33f('0x4a')](_0x55f00b[_0xd33f('0x3e')],_0x21eb93['filters']));_0x3d17b0[_0xd33f('0x49')][_0xd33f('0x6a')]=_0x5b4059['id'];if(_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x3d17b0[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0x3d17b0[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x3d17b0[_0xd33f('0x41')],function(_0xa0947d){var _0x54bf59={};_0x54bf59[_0xa0947d]={'$like':'%'+_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x4b')]+'%'};return _0x54bf59;})});}_0x3d17b0=_[_0xd33f('0x4c')]({},_0x3d17b0,_0x55f00b[_0xd33f('0x4e')]);return db[_0xd33f('0x6c')]['count']({'where':_0x3d17b0[_0xd33f('0x49')]})['then'](function(_0x4cfbce){_0x341530['count']=_0x4cfbce;if(_0x55f00b[_0xd33f('0x3e')][_0xd33f('0x4f')]){_0x3d17b0['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3d17b0);})[_0xd33f('0x2a')](function(_0x2efd40){_0x341530['rows']=_0x2efd40;return _0x341530;});}})[_0xd33f('0x2a')](respondWithFilteredResult(_0x2ec93c,_0x3d17b0))[_0xd33f('0x51')](handleError(_0x2ec93c,null));};exports[_0xd33f('0x6d')]=function(_0x546acf,_0x53f8f4,_0x23a17a){var _0x15f5b0={'raw':!![],'where':{}};var _0x241e90={};var _0x533f5a={'count':0x0,'rows':[]};return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x546acf[_0xd33f('0x52')]['id']}})['then'](handleEntityNotFound(_0x53f8f4,null))[_0xd33f('0x2a')](function(_0x1ca299){if(_0x1ca299){_0x241e90[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db[_0xd33f('0x6e')]['rawAttributes']);_0x241e90[_0xd33f('0x3e')]=_[_0xd33f('0x3f')](_0x546acf[_0xd33f('0x3e')]);_0x241e90['filters']=_[_0xd33f('0x42')](_0x241e90[_0xd33f('0x3d')],_0x241e90[_0xd33f('0x3e')]);_0x15f5b0[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x241e90[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x546acf[_0xd33f('0x3e')][_0xd33f('0x43')]));_0x15f5b0[_0xd33f('0x41')]=_0x15f5b0[_0xd33f('0x41')]['length']?_0x15f5b0['attributes']:_0x241e90['model'];if(!_0x546acf[_0xd33f('0x3e')][_0xd33f('0x45')](_0xd33f('0x46'))){_0x15f5b0[_0xd33f('0x22')]=qs['limit'](_0x546acf['query'][_0xd33f('0x22')]);_0x15f5b0[_0xd33f('0x24')]=qs['offset'](_0x546acf[_0xd33f('0x3e')]['offset']);}_0x15f5b0[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x546acf['query'][_0xd33f('0x48')]);_0x15f5b0[_0xd33f('0x49')]=qs[_0xd33f('0x40')](_[_0xd33f('0x4a')](_0x546acf[_0xd33f('0x3e')],_0x241e90[_0xd33f('0x40')]));_0x15f5b0['where']['VoiceQueueId']=_0x1ca299['id'];if(_0x546acf[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x15f5b0[_0xd33f('0x49')]=_['merge'](_0x15f5b0[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x15f5b0[_0xd33f('0x41')],function(_0x4be69f){var _0x4cb6d2={};_0x4cb6d2[_0x4be69f]={'$like':'%'+_0x546acf[_0xd33f('0x3e')]['filter']+'%'};return _0x4cb6d2;})});}_0x15f5b0=_[_0xd33f('0x4c')]({},_0x15f5b0,_0x546acf[_0xd33f('0x4e')]);return db[_0xd33f('0x6e')][_0xd33f('0x23')]({'where':_0x15f5b0[_0xd33f('0x49')]})['then'](function(_0x3590a0){_0x533f5a[_0xd33f('0x23')]=_0x3590a0;if(_0x546acf['query']['includeAll']){_0x15f5b0[_0xd33f('0x53')]=[{'all':!![]}];}return db[_0xd33f('0x6e')][_0xd33f('0x50')](_0x15f5b0);})['then'](function(_0x2280b8){_0x533f5a['rows']=_0x2280b8;return _0x533f5a;});}})[_0xd33f('0x2a')](respondWithFilteredResult(_0x53f8f4,_0x15f5b0))[_0xd33f('0x51')](handleError(_0x53f8f4,null));};exports[_0xd33f('0x6f')]=function(_0x12af9d,_0x34738d,_0x2b74c2){var _0x572bf1={};var _0x516a3f={};var _0x2f7864;var _0x2254c4;return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x12af9d['params']['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x34738d,null))[_0xd33f('0x2a')](function(_0x45de2d){if(_0x45de2d){_0x2f7864=_0x45de2d;_0x516a3f['model']=_[_0xd33f('0x3f')](db[_0xd33f('0x70')]['rawAttributes']);_0x516a3f[_0xd33f('0x3e')]=_[_0xd33f('0x3f')](_0x12af9d['query']);_0x516a3f[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x516a3f['model'],_0x516a3f[_0xd33f('0x3e')]);_0x572bf1['attributes']=_[_0xd33f('0x42')](_0x516a3f[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x12af9d['query'][_0xd33f('0x43')]));_0x572bf1['attributes']=_0x572bf1[_0xd33f('0x41')][_0xd33f('0x44')]?_0x572bf1[_0xd33f('0x41')]:_0x516a3f['model'];_0x572bf1[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x12af9d[_0xd33f('0x3e')]['sort']);_0x572bf1[_0xd33f('0x49')]=qs[_0xd33f('0x40')](_[_0xd33f('0x4a')](_0x12af9d[_0xd33f('0x3e')],_0x516a3f['filters']));if(_0x12af9d[_0xd33f('0x3e')]['filter']){_0x572bf1[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0x572bf1[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x572bf1['attributes'],function(_0x24c4c8){var _0x3fed3a={};_0x3fed3a[_0x24c4c8]={'$like':'%'+_0x12af9d[_0xd33f('0x3e')][_0xd33f('0x4b')]+'%'};return _0x3fed3a;})});}_0x572bf1=_[_0xd33f('0x4c')]({},_0x572bf1,_0x12af9d['options']);return _0x2f7864[_0xd33f('0x6f')](_0x572bf1);}})['then'](function(_0x1e80d4){if(_0x1e80d4){_0x2254c4=_0x1e80d4[_0xd33f('0x44')];if(!_0x12af9d[_0xd33f('0x3e')][_0xd33f('0x45')]('nolimit')){_0x572bf1['limit']=qs[_0xd33f('0x22')](_0x12af9d[_0xd33f('0x3e')]['limit']);_0x572bf1[_0xd33f('0x24')]=qs[_0xd33f('0x24')](_0x12af9d[_0xd33f('0x3e')]['offset']);}return _0x2f7864['getTeams'](_0x572bf1);}})[_0xd33f('0x2a')](function(_0x4abd86){if(_0x4abd86){return _0x4abd86?{'count':_0x2254c4,'rows':_0x4abd86}:null;}})[_0xd33f('0x2a')](respondWithResult(_0x34738d,null))[_0xd33f('0x51')](handleError(_0x34738d,null));};exports[_0xd33f('0x71')]=function(_0x184e02,_0x58d983,_0x52a56d){var _0x55be79=_0x184e02[_0xd33f('0x56')][_0xd33f('0x72')];var _0x312c25=_['map'](_0x55be79,'id');return db['Team']['findAll']({'where':{'id':_0x312c25},'attributes':['id'],'include':[{'model':db[_0xd33f('0x73')],'as':_0xd33f('0x74'),'attributes':['id',_0xd33f('0x33'),_0xd33f('0x75'),_0xd33f('0x76'),_0xd33f('0x77')],'raw':!![]}]})[_0xd33f('0x2a')](function(_0x571f9e){if(_0x571f9e){var _0x402110=_['flatMap'](_0x571f9e,function(_0xde6720){var _0x1854d0=_0xde6720[_0xd33f('0x5e')]({'plain':!![]});_0x1854d0[_0xd33f('0x74')][_0xd33f('0x78')](function(_0x52fa3f){_0x52fa3f['penalty']=_[_0xd33f('0x32')](_0x55be79,{'id':_0x1854d0['id']})[_0xd33f('0x79')];});return _0x1854d0[_0xd33f('0x74')];});return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x184e02[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](function(_0x5de7a0){return db['sequelize'][_0xd33f('0x7a')](function(_0x3162e2){return _0x5de7a0[_0xd33f('0x71')](_0x312c25,{'transaction':_0x3162e2})[_0xd33f('0x2a')](function(){return BPromise[_0xd33f('0x7b')](_0x55be79,function(_0x5c57c2){return db[_0xd33f('0x7c')]['upsert']({'TeamId':_0x5c57c2['id'],'VoiceQueueId':_0x184e02['params']['id'],'penalty':_0x5c57c2[_0xd33f('0x79')]},{'transaction':_0x3162e2});});})['then'](function(){return BPromise[_0xd33f('0x7b')](_0x402110,function(_0x48ba1d){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x48ba1d['id'],'VoiceQueueId':_0x184e02[_0xd33f('0x52')]['id']},'defaults':{'penalty':_0x48ba1d[_0xd33f('0x79')]},'transaction':_0x3162e2});});})['then'](function(){return BPromise[_0xd33f('0x7b')](_[_0xd33f('0x4b')](_0x402110,{'online':!![]}),function(_0x2cc6ed){return db[_0xd33f('0x7d')][_0xd33f('0x7e')]({'membername':_0x2cc6ed[_0xd33f('0x33')],'UserId':_0x2cc6ed['id'],'queue_name':_0x5de7a0[_0xd33f('0x33')],'VoiceQueueId':_0x5de7a0['id'],'interface':_[_0xd33f('0x7f')](_0x2cc6ed['interface'])?util[_0xd33f('0x80')](_0xd33f('0x81'),_0x2cc6ed[_0xd33f('0x33')]):_0x2cc6ed[_0xd33f('0x77')],'paused':_0x2cc6ed[_0xd33f('0x76')]||![],'penalty':_0x2cc6ed[_0xd33f('0x79')]},{'transaction':_0x3162e2});});})['then'](function(){_0x402110['forEach'](function(_0x23836f){socket['emit']('userVoiceQueue:save',{'UserId':_0x23836f['id'],'VoiceQueueId':_0x5de7a0['id']});});});});});}})[_0xd33f('0x2a')](respondWithStatusCode(_0x58d983,null))[_0xd33f('0x51')](handleError(_0x58d983,null));};exports[_0xd33f('0x82')]=function(_0x28c473,_0x29a51c,_0x358534){return db['Team']['findAll']({'where':{'id':_0x28c473[_0xd33f('0x3e')]['ids']},'attributes':['id'],'include':[{'model':db[_0xd33f('0x73')],'as':_0xd33f('0x74'),'attributes':['id'],'raw':!![]}]})[_0xd33f('0x2a')](handleEntityNotFound(_0x29a51c,null))[_0xd33f('0x2a')](function(_0x119002){var _0xa02b93=_[_0xd33f('0x39')](_0x119002,'id');var _0x2deb15=[];var _0x2e0ccc=[];var _0x4f13fb=squel[_0xd33f('0x83')]();_0x4f13fb[_0xd33f('0x84')](_0xd33f('0x85'))[_0xd33f('0x86')](_0xd33f('0x87'),'tq')[_0xd33f('0x88')](_0xd33f('0x89'),'ut',_0xd33f('0x8a'))[_0xd33f('0x49')](_0xd33f('0x8b'),_0x28c473[_0xd33f('0x52')]['id']);for(var _0x37313c=0x0;_0x37313c<_0x119002[_0xd33f('0x44')];_0x37313c+=0x1){let _0x3fbfe3=_0x119002[_0x37313c];for(var _0xe1891=0x0;_0xe1891<_0x3fbfe3['Agents']['length'];_0xe1891+=0x1){let _0x207036=_0x3fbfe3[_0xd33f('0x74')][_0xe1891];var _0x349764=_0x4f13fb[_0xd33f('0x5d')]();_0x349764[_0xd33f('0x49')](_0xd33f('0x8c'),_0x207036['id']);_0x2e0ccc['push'](db['sequelize'][_0xd33f('0x3e')](_0x349764['toString'](),{'type':db[_0xd33f('0x8d')][_0xd33f('0x8e')][_0xd33f('0x8f')]})['then'](function(_0x19a620){if(_0x19a620[_0xd33f('0x44')]===0x1){return _0x207036['id'];}else{var _0x1b1efb=_[_0xd33f('0x90')](_[_0xd33f('0x39')](_0x19a620,'TeamId'),function(_0x1b83c0){return _['includes'](_0xa02b93,_0x1b83c0);});if(_0x1b1efb){return _0x207036['id'];}}}));}}return BPromise['all'](_0x2e0ccc)[_0xd33f('0x2a')](function(_0xcdf618){_0x2deb15=_(_0x2deb15)[_0xd33f('0x91')](_0xcdf618)[_0xd33f('0x92')]()[_0xd33f('0x2f')]();return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x28c473[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](function(_0x27f3f9){return db[_0xd33f('0x8d')][_0xd33f('0x7a')](function(_0x498ea1){return _0x27f3f9[_0xd33f('0x82')](_0x28c473['query'][_0xd33f('0x93')],{'transaction':_0x498ea1})['then'](function(){if(!_[_0xd33f('0x94')](_0x2deb15)){return _0x27f3f9['removeAgents'](_0x2deb15,{'transaction':_0x498ea1})[_0xd33f('0x2a')](function(){return db['UserVoiceQueueRt'][_0xd33f('0x35')]({'where':{'VoiceQueueId':_0x28c473[_0xd33f('0x52')]['id'],'UserId':_0x2deb15},'transaction':_0x498ea1});});}})[_0xd33f('0x2a')](function(){_0x2deb15[_0xd33f('0x78')](function(_0x177e12){socket[_0xd33f('0x95')](_0xd33f('0x96'),{'UserId':_0x177e12,'VoiceQueueId':_0x27f3f9['id']});});});});});});})[_0xd33f('0x2a')](respondWithStatusCode(_0x29a51c,null))['catch'](handleError(_0x29a51c,null));};exports[_0xd33f('0x97')]=function(_0x4786dc,_0x5c4aa7,_0x4e93b5){var _0x49ec33,_0x3934e0;return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x4786dc[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x5c4aa7,null))[_0xd33f('0x2a')](function(_0x44ce7f){if(_0x44ce7f){_0x3934e0=_0x44ce7f;return _0x44ce7f[_0xd33f('0x97')](_0x4786dc[_0xd33f('0x56')][_0xd33f('0x93')],_[_0xd33f('0x5f')](_0x4786dc['body'],['ids','id'])||{})[_0xd33f('0x98')](function(_0x3adc76){for(var _0x48b5c3=0x0;_0x48b5c3<_0x4786dc[_0xd33f('0x56')][_0xd33f('0x93')]['length'];_0x48b5c3+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x4786dc['body'][_0xd33f('0x93')][_0x48b5c3]),'VoiceQueueId':Number(_0x4786dc['params']['id'])});}return _0x3adc76;});}})['then'](function(_0xe2e570){_0x49ec33=_0xe2e570||[];if(_0x3934e0){return db[_0xd33f('0x73')][_0xd33f('0x50')]({'where':{'id':_0x4786dc[_0xd33f('0x56')]['ids']},'attributes':['id',_0xd33f('0x33'),'online','voicePause',_0xd33f('0x77')],'raw':!![]});}})[_0xd33f('0x2a')](function(_0x7843cd){if(!_['isEmpty'](_0x7843cd)){var _0x4b93ba=[];for(var _0x113209=0x0;_0x113209<_0x7843cd['length'];_0x113209++){if(_0x7843cd[_0x113209][_0xd33f('0x75')]){_0x4b93ba[_0xd33f('0x99')](db[_0xd33f('0x7d')][_0xd33f('0x7e')]({'membername':_0x7843cd[_0x113209][_0xd33f('0x33')],'UserId':_0x7843cd[_0x113209]['id'],'queue_name':_0x3934e0[_0xd33f('0x33')],'VoiceQueueId':_0x3934e0['id'],'interface':_[_0xd33f('0x7f')](_0x7843cd[_0x113209][_0xd33f('0x77')])?util[_0xd33f('0x80')]('SIP/%s',_0x7843cd[_0x113209][_0xd33f('0x33')]):_0x7843cd[_0x113209][_0xd33f('0x77')],'paused':_0x7843cd[_0x113209][_0xd33f('0x76')]||![],'penalty':_0x4786dc['body']['penalty']||0x0}));}}return BPromise[_0xd33f('0x9a')](_0x4b93ba);}})[_0xd33f('0x2a')](function(){return _0x49ec33;})['then'](respondWithResult(_0x5c4aa7,null))['catch'](handleError(_0x5c4aa7,null));};exports[_0xd33f('0x9b')]=function(_0x2399d7,_0x4033a1,_0x459e96){return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x2399d7[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x4033a1,null))[_0xd33f('0x2a')](function(_0x3c3f85){if(_0x3c3f85){return _0x3c3f85[_0xd33f('0x9b')](_0x2399d7[_0xd33f('0x3e')][_0xd33f('0x93')])[_0xd33f('0x2a')](function(){if(_[_0xd33f('0x9c')](_0x2399d7[_0xd33f('0x3e')][_0xd33f('0x93')])){for(var _0x3289d1=0x0;_0x3289d1<_0x2399d7[_0xd33f('0x3e')]['ids']['length'];_0x3289d1+=0x1){socket['emit'](_0xd33f('0x96'),{'UserId':Number(_0x2399d7['query'][_0xd33f('0x93')][_0x3289d1]),'VoiceQueueId':Number(_0x2399d7[_0xd33f('0x52')]['id'])});}}else{socket[_0xd33f('0x95')](_0xd33f('0x96'),{'UserId':Number(_0x2399d7[_0xd33f('0x3e')][_0xd33f('0x93')]),'VoiceQueueId':Number(_0x2399d7[_0xd33f('0x52')]['id'])});}});}})[_0xd33f('0x2a')](function(_0x3b2f62){return db[_0xd33f('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x2399d7[_0xd33f('0x52')]['id'],'UserId':_0x2399d7[_0xd33f('0x3e')]['ids']}})['then'](function(){return _0x3b2f62;});})[_0xd33f('0x2a')](respondWithStatusCode(_0x4033a1,null))[_0xd33f('0x51')](handleError(_0x4033a1,null));};exports['getAgents']=function(_0x3b0a49,_0x4a7f37,_0x2c5881){var _0x3d5ee7={};var _0x5b159a={};var _0x4de9d1;var _0x57c5ee;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b0a49[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x4a7f37,null))[_0xd33f('0x2a')](function(_0x430366){if(_0x430366){_0x4de9d1=_0x430366;_0x5b159a[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db[_0xd33f('0x73')]['rawAttributes']);_0x5b159a['query']=_[_0xd33f('0x3f')](_0x3b0a49[_0xd33f('0x3e')]);_0x5b159a[_0xd33f('0x40')]=_['intersection'](_0x5b159a[_0xd33f('0x3d')],_0x5b159a[_0xd33f('0x3e')]);_0x3d5ee7['attributes']=_[_0xd33f('0x42')](_0x5b159a[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x3b0a49['query'][_0xd33f('0x43')]));_0x3d5ee7[_0xd33f('0x41')]=_0x3d5ee7[_0xd33f('0x41')][_0xd33f('0x44')]?_0x3d5ee7[_0xd33f('0x41')]:_0x5b159a[_0xd33f('0x3d')];_0x3d5ee7[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x3b0a49[_0xd33f('0x3e')]['sort']);_0x3d5ee7[_0xd33f('0x49')]=qs['filters'](_[_0xd33f('0x4a')](_0x3b0a49[_0xd33f('0x3e')],_0x5b159a[_0xd33f('0x40')]));if(_0x3b0a49[_0xd33f('0x3e')]['filter']){_0x3d5ee7[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0x3d5ee7[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x3d5ee7['attributes'],function(_0x183a60){var _0x2867fa={};_0x2867fa[_0x183a60]={'$like':'%'+_0x3b0a49['query']['filter']+'%'};return _0x2867fa;})});}_0x3d5ee7=_[_0xd33f('0x4c')]({},_0x3d5ee7,_0x3b0a49[_0xd33f('0x4e')]);return _0x4de9d1[_0xd33f('0x9d')](_0x3d5ee7);}})[_0xd33f('0x2a')](function(_0x43d4dc){if(_0x43d4dc){_0x57c5ee=_0x43d4dc[_0xd33f('0x44')];if(!_0x3b0a49[_0xd33f('0x3e')][_0xd33f('0x45')](_0xd33f('0x46'))){_0x3d5ee7[_0xd33f('0x22')]=qs[_0xd33f('0x22')](_0x3b0a49[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x3d5ee7[_0xd33f('0x24')]=qs[_0xd33f('0x24')](_0x3b0a49['query'][_0xd33f('0x24')]);}return _0x4de9d1[_0xd33f('0x9d')](_0x3d5ee7);}})[_0xd33f('0x2a')](function(_0x2be252){if(_0x2be252){return _0x2be252?{'count':_0x57c5ee,'rows':_0x2be252}:null;}})[_0xd33f('0x2a')](respondWithResult(_0x4a7f37,null))[_0xd33f('0x51')](handleError(_0x4a7f37,null));};exports[_0xd33f('0x9e')]=function(_0x5a7967,_0x558c3d,_0x1f3264){var _0x57ffe1={};var _0x35faee={};var _0xba1c4b;var _0x2f924c;return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x5a7967[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x558c3d,null))[_0xd33f('0x2a')](function(_0x1702ec){if(_0x1702ec){_0xba1c4b=_0x1702ec;_0x35faee[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db['UserVoiceQueueRt'][_0xd33f('0x3a')]);_0x35faee['query']=_[_0xd33f('0x3f')](_0x5a7967[_0xd33f('0x3e')]);_0x35faee['filters']=_['intersection'](_0x35faee[_0xd33f('0x3d')],_0x35faee[_0xd33f('0x3e')]);_0x57ffe1['attributes']=_[_0xd33f('0x42')](_0x35faee[_0xd33f('0x3d')],qs['fields'](_0x5a7967[_0xd33f('0x3e')]['fields']));_0x57ffe1[_0xd33f('0x41')]=_0x57ffe1['attributes'][_0xd33f('0x44')]?_0x57ffe1[_0xd33f('0x41')]:_0x35faee[_0xd33f('0x3d')];_0x57ffe1[_0xd33f('0x47')]=qs[_0xd33f('0x48')](_0x5a7967[_0xd33f('0x3e')]['sort']);_0x57ffe1[_0xd33f('0x49')]=qs['filters'](_[_0xd33f('0x4a')](_0x5a7967[_0xd33f('0x3e')],_0x35faee['filters']));if(_0x5a7967['query'][_0xd33f('0x4b')]){_0x57ffe1[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0x57ffe1[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x57ffe1[_0xd33f('0x41')],function(_0x284b76){var _0x2d546d={};_0x2d546d[_0x284b76]={'$like':'%'+_0x5a7967['query'][_0xd33f('0x4b')]+'%'};return _0x2d546d;})});}_0x57ffe1=_[_0xd33f('0x4c')]({},_0x57ffe1,_0x5a7967['options']);return _0xba1c4b[_0xd33f('0x9e')](_0x57ffe1);}})[_0xd33f('0x2a')](function(_0x48edd9){if(_0x48edd9){_0x2f924c=_0x48edd9[_0xd33f('0x44')];if(!_0x5a7967['query'][_0xd33f('0x45')]('nolimit')){_0x57ffe1[_0xd33f('0x22')]=qs[_0xd33f('0x22')](_0x5a7967[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x57ffe1[_0xd33f('0x24')]=qs[_0xd33f('0x24')](_0x5a7967['query'][_0xd33f('0x24')]);}return _0xba1c4b[_0xd33f('0x9e')](_0x57ffe1);}})[_0xd33f('0x2a')](function(_0x49a563){return _0x49a563?{'count':_0x2f924c,'rows':_0x49a563}:null;})[_0xd33f('0x2a')](respondWithResult(_0x558c3d,null))[_0xd33f('0x51')](handleError(_0x558c3d,null));};exports[_0xd33f('0x9f')]=function(_0x71cf68,_0x89ede1,_0x23df6d){var _0x53a08b={};var _0x48bef5={};var _0x5a990e;var _0x19a08f;return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x71cf68[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x89ede1,null))['then'](function(_0x33f21b){if(_0x33f21b){_0x5a990e=_0x33f21b;_0x48bef5[_0xd33f('0x3d')]=_['keys'](db['CmList'][_0xd33f('0x3a')]);_0x48bef5[_0xd33f('0x3e')]=_[_0xd33f('0x3f')](_0x71cf68[_0xd33f('0x3e')]);_0x48bef5[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x48bef5[_0xd33f('0x3d')],_0x48bef5[_0xd33f('0x3e')]);_0x53a08b['attributes']=_[_0xd33f('0x42')](_0x48bef5[_0xd33f('0x3d')],qs['fields'](_0x71cf68['query'][_0xd33f('0x43')]));_0x53a08b['attributes']=_0x53a08b[_0xd33f('0x41')][_0xd33f('0x44')]?_0x53a08b[_0xd33f('0x41')]:_0x48bef5[_0xd33f('0x3d')];_0x53a08b[_0xd33f('0x47')]=qs['sort'](_0x71cf68[_0xd33f('0x3e')][_0xd33f('0x48')]);_0x53a08b['where']=qs[_0xd33f('0x40')](_[_0xd33f('0x4a')](_0x71cf68[_0xd33f('0x3e')],_0x48bef5['filters']));if(_0x71cf68[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x53a08b[_0xd33f('0x49')]=_[_0xd33f('0x4c')](_0x53a08b[_0xd33f('0x49')],{'$or':_['map'](_0x53a08b[_0xd33f('0x41')],function(_0x521cd7){var _0x1665ed={};_0x1665ed[_0x521cd7]={'$like':'%'+_0x71cf68[_0xd33f('0x3e')]['filter']+'%'};return _0x1665ed;})});}_0x53a08b=_['merge']({},_0x53a08b,_0x71cf68[_0xd33f('0x4e')]);return _0x5a990e[_0xd33f('0x9f')](_0x53a08b);}})[_0xd33f('0x2a')](function(_0x2e1028){if(_0x2e1028){_0x19a08f=_0x2e1028[_0xd33f('0x44')];if(!_0x71cf68[_0xd33f('0x3e')]['hasOwnProperty'](_0xd33f('0x46'))){_0x53a08b[_0xd33f('0x22')]=qs['limit'](_0x71cf68[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x53a08b[_0xd33f('0x24')]=qs[_0xd33f('0x24')](_0x71cf68[_0xd33f('0x3e')][_0xd33f('0x24')]);}return _0x5a990e['getLists'](_0x53a08b);}})[_0xd33f('0x2a')](function(_0x5343da){if(_0x5343da){return _0x5343da?{'count':_0x19a08f,'rows':_0x5343da}:null;}})[_0xd33f('0x2a')](respondWithResult(_0x89ede1,null))['catch'](handleError(_0x89ede1,null));};exports[_0xd33f('0xa0')]=function(_0x59f852,_0x19118c,_0x15821e){var _0x2d0d45,_0x506c4c;return db['VoiceQueue'][_0xd33f('0x32')]({'where':{'id':_0x59f852['params']['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x19118c,null))[_0xd33f('0x2a')](function(_0x5cd569){if(_0x5cd569){_0x506c4c=_0x5cd569;return _0x5cd569['addLists'](_0x59f852[_0xd33f('0x56')][_0xd33f('0x93')],_['omit'](_0x59f852[_0xd33f('0x56')],[_0xd33f('0x93'),'id'])||{});}return null;})['spread'](function(_0x470d8a){var _0xcfa84c;_0x2d0d45=_0x470d8a||[];var _0x33b0ba=[];if(_0x470d8a){for(var _0x2f8343=0x0;_0x2f8343<_0x470d8a[_0xd33f('0x44')];_0x2f8343+=0x1){var _0x91ce72=_0x470d8a[_0x2f8343][_0xd33f('0x5e')]({'plain':!![]});_0x506c4c[_0xd33f('0xa1')]=_0x59f852[_0xd33f('0x56')][_0xd33f('0xa1')]?_0x59f852['body']['dialCheckDuplicateType']:_0x506c4c[_0xd33f('0xa1')];switch(_0x506c4c[_0xd33f('0xa1')]){case _0xd33f('0xa2'):_0xcfa84c=squel[_0xd33f('0xa3')]()['into'](_0xd33f('0xa4'))[_0xd33f('0xa5')](['phone',_0xd33f('0xa6'),_0xd33f('0xa7'),_0xd33f('0xa8'),_0xd33f('0x6a'),_0xd33f('0x60'),_0xd33f('0x61')],squel[_0xd33f('0x83')]()[_0xd33f('0x84')]('phone',_0xd33f('0xa9'))[_0xd33f('0x84')](_0xd33f('0xaa'),_0xd33f('0xa6'))['field']('id','ContactId')[_0xd33f('0x84')](_0x91ce72[_0xd33f('0xab')][_0xd33f('0xac')](),_0xd33f('0xa8'))[_0xd33f('0x84')](_0x59f852[_0xd33f('0x52')]['id'][_0xd33f('0xac')](),'VoiceQueueId')['field'](_0xd33f('0xaa'),_0xd33f('0x60'))[_0xd33f('0x84')](_0xd33f('0xaa'),_0xd33f('0x61'))[_0xd33f('0x86')]('cm_contacts')['where'](_0xd33f('0xad'))[_0xd33f('0x49')]('ListId\x20=\x20?',_0x91ce72[_0xd33f('0xab')][_0xd33f('0xac')]())[_0xd33f('0x49')](_0xd33f('0xae'))[_0xd33f('0x49')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd33f('0x83')]()[_0xd33f('0x84')](_0xd33f('0xaf'))[_0xd33f('0x86')](_0xd33f('0xb0'))['where'](_0xd33f('0x8b'),_0x59f852['params']['id']['toString']()))[_0xd33f('0x49')](_0xd33f('0xb1'),squel[_0xd33f('0x83')]()[_0xd33f('0x84')](_0xd33f('0xb2'))[_0xd33f('0x86')]('cm_hopper')[_0xd33f('0x49')](_0xd33f('0x8b'),_0x59f852[_0xd33f('0x52')]['id'][_0xd33f('0xac')]())))['toString']();break;case'onlyIfOpen':_0xcfa84c=squel['insert']()[_0xd33f('0xb3')](_0xd33f('0xa4'))['fromQuery']([_0xd33f('0xa9'),_0xd33f('0xa6'),_0xd33f('0xa7'),_0xd33f('0xa8'),_0xd33f('0x6a'),_0xd33f('0x60'),'updatedAt'],squel[_0xd33f('0x83')]()[_0xd33f('0x84')](_0xd33f('0xa9'),_0xd33f('0xa9'))[_0xd33f('0x84')](_0xd33f('0xaa'),_0xd33f('0xa6'))[_0xd33f('0x84')]('id','ContactId')['field'](_0x91ce72[_0xd33f('0xab')][_0xd33f('0xac')](),_0xd33f('0xa8'))[_0xd33f('0x84')](_0x59f852[_0xd33f('0x52')]['id'][_0xd33f('0xac')](),_0xd33f('0x6a'))[_0xd33f('0x84')]('NOW()',_0xd33f('0x60'))['field'](_0xd33f('0xaa'),_0xd33f('0x61'))['from'](_0xd33f('0xb4'))[_0xd33f('0x49')](_0xd33f('0xad'))[_0xd33f('0x49')]('ListId\x20=\x20?',_0x91ce72['CmListId']['toString']())[_0xd33f('0x49')](_0xd33f('0xae'))['where'](_0xd33f('0xb1'),squel[_0xd33f('0x83')]()[_0xd33f('0x84')](_0xd33f('0xb2'))[_0xd33f('0x86')]('cm_hopper')[_0xd33f('0x49')]('VoiceQueueId\x20=\x20?',_0x59f852['params']['id']['toString']())))[_0xd33f('0xac')]();break;default:_0xcfa84c=squel[_0xd33f('0xa3')]()['into'](_0xd33f('0xa4'))[_0xd33f('0xa5')]([_0xd33f('0xa9'),'scheduledAt',_0xd33f('0xa7'),_0xd33f('0xa8'),_0xd33f('0x6a'),_0xd33f('0x60'),_0xd33f('0x61')],squel[_0xd33f('0x83')]()['field'](_0xd33f('0xa9'),_0xd33f('0xa9'))[_0xd33f('0x84')](_0xd33f('0xaa'),'scheduledAt')['field']('id',_0xd33f('0xa7'))[_0xd33f('0x84')](_0x91ce72[_0xd33f('0xab')][_0xd33f('0xac')](),_0xd33f('0xa8'))['field'](_0x59f852[_0xd33f('0x52')]['id'][_0xd33f('0xac')](),'VoiceQueueId')[_0xd33f('0x84')]('NOW()','createdAt')[_0xd33f('0x84')](_0xd33f('0xaa'),_0xd33f('0x61'))['from'](_0xd33f('0xb4'))[_0xd33f('0x49')](_0xd33f('0xad'))[_0xd33f('0x49')]('ListId\x20=\x20?',_0x91ce72[_0xd33f('0xab')]['toString']())[_0xd33f('0x49')](_0xd33f('0xae')))[_0xd33f('0xac')]();}_0x33b0ba[_0xd33f('0x99')](db[_0xd33f('0x8d')]['query'](_0xcfa84c));}return BPromise[_0xd33f('0x9a')](_0x33b0ba);}})[_0xd33f('0x2a')](function(){return _0x2d0d45;})[_0xd33f('0x2a')](respondWithResult(_0x19118c,null))[_0xd33f('0x51')](handleError(_0x19118c,null));};exports[_0xd33f('0xb5')]=function(_0x1d3f66,_0x4eeeed,_0x8123ae){return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x1d3f66[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x4eeeed,null))[_0xd33f('0x2a')](function(_0x4dd951){if(_0x4dd951){return _0x4dd951[_0xd33f('0xb5')](_0x1d3f66[_0xd33f('0x3e')][_0xd33f('0x93')]);}})[_0xd33f('0x2a')](function(_0x4a7c2a){if(_0x4a7c2a){return db['CmHopper'][_0xd33f('0x35')]({'where':{'ListId':_0x1d3f66[_0xd33f('0x3e')][_0xd33f('0x93')],'VoiceQueueId':_0x1d3f66[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](function(){return _0x4a7c2a;});}})['then'](respondWithStatusCode(_0x4eeeed,null))[_0xd33f('0x51')](handleError(_0x4eeeed,null));};exports[_0xd33f('0xb6')]=function(_0x5c2f29,_0x1de240,_0x581adf){var _0x3472f6={};var _0x7365f={};var _0x4ff4f8;var _0x11ed55;return db[_0xd33f('0x54')][_0xd33f('0x65')]({'where':{'id':_0x5c2f29[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x1de240,null))[_0xd33f('0x2a')](function(_0x30a7ee){if(_0x30a7ee){_0x4ff4f8=_0x30a7ee;_0x7365f[_0xd33f('0x3d')]=_[_0xd33f('0x3f')](db[_0xd33f('0xb7')][_0xd33f('0x3a')]);_0x7365f['query']=_['keys'](_0x5c2f29[_0xd33f('0x3e')]);_0x7365f[_0xd33f('0x40')]=_[_0xd33f('0x42')](_0x7365f[_0xd33f('0x3d')],_0x7365f['query']);_0x3472f6[_0xd33f('0x41')]=_[_0xd33f('0x42')](_0x7365f[_0xd33f('0x3d')],qs[_0xd33f('0x43')](_0x5c2f29[_0xd33f('0x3e')][_0xd33f('0x43')]));_0x3472f6[_0xd33f('0x41')]=_0x3472f6[_0xd33f('0x41')]['length']?_0x3472f6['attributes']:_0x7365f[_0xd33f('0x3d')];_0x3472f6['order']=qs[_0xd33f('0x48')](_0x5c2f29[_0xd33f('0x3e')][_0xd33f('0x48')]);_0x3472f6['where']=qs[_0xd33f('0x40')](_['pick'](_0x5c2f29[_0xd33f('0x3e')],_0x7365f[_0xd33f('0x40')]));if(_0x5c2f29[_0xd33f('0x3e')][_0xd33f('0x4b')]){_0x3472f6[_0xd33f('0x49')]=_['merge'](_0x3472f6[_0xd33f('0x49')],{'$or':_[_0xd33f('0x39')](_0x3472f6['attributes'],function(_0x1fa370){var _0x302a60={};_0x302a60[_0x1fa370]={'$like':'%'+_0x5c2f29['query'][_0xd33f('0x4b')]+'%'};return _0x302a60;})});}_0x3472f6=_['merge']({},_0x3472f6,_0x5c2f29[_0xd33f('0x4e')]);return _0x4ff4f8[_0xd33f('0xb6')](_0x3472f6);}})[_0xd33f('0x2a')](function(_0x6fb437){if(_0x6fb437){_0x11ed55=_0x6fb437[_0xd33f('0x44')];if(!_0x5c2f29[_0xd33f('0x3e')]['hasOwnProperty'](_0xd33f('0x46'))){_0x3472f6[_0xd33f('0x22')]=qs[_0xd33f('0x22')](_0x5c2f29[_0xd33f('0x3e')][_0xd33f('0x22')]);_0x3472f6['offset']=qs[_0xd33f('0x24')](_0x5c2f29[_0xd33f('0x3e')]['offset']);}return _0x4ff4f8[_0xd33f('0xb6')](_0x3472f6);}})[_0xd33f('0x2a')](function(_0x552722){if(_0x552722){return _0x552722?{'count':_0x11ed55,'rows':_0x552722}:null;}})[_0xd33f('0x2a')](respondWithResult(_0x1de240,null))[_0xd33f('0x51')](handleError(_0x1de240,null));};exports[_0xd33f('0xb8')]=function(_0x56bd2d,_0x12613f,_0x1904f7){var _0x940d1,_0x467dc2;return db[_0xd33f('0x54')][_0xd33f('0x32')]({'where':{'id':_0x56bd2d[_0xd33f('0x52')]['id']}})['then'](handleEntityNotFound(_0x12613f,null))['then'](function(_0x451923){if(_0x451923){_0x467dc2=_0x451923;return _0x451923['addBlackLists'](_0x56bd2d['body'][_0xd33f('0x93')],_[_0xd33f('0x5f')](_0x56bd2d['body'],[_0xd33f('0x93'),'id'])||{});}return null;})['spread'](function(_0x17fc48){var _0xa1b23;_0x940d1=_0x17fc48||[];var _0x2474f3=[];if(_0x17fc48){for(var _0x5a78b7=0x0;_0x5a78b7<_0x17fc48[_0xd33f('0x44')];_0x5a78b7+=0x1){var _0x174a67=_0x17fc48[_0x5a78b7][_0xd33f('0x5e')]({'plain':!![]});_0xa1b23=squel[_0xd33f('0xa3')]()[_0xd33f('0xb3')]('cm_hopper_black')['fromQuery']([_0xd33f('0xa9'),'ContactId',_0xd33f('0xa8'),'VoiceQueueId','createdAt','updatedAt'],squel['select']()['field'](_0xd33f('0xa9'),'phone')[_0xd33f('0x84')]('id',_0xd33f('0xa7'))[_0xd33f('0x84')](_0x174a67[_0xd33f('0xab')][_0xd33f('0xac')](),_0xd33f('0xa8'))['field'](_0x56bd2d[_0xd33f('0x52')]['id']['toString'](),_0xd33f('0x6a'))['field'](_0xd33f('0xaa'),_0xd33f('0x60'))['field'](_0xd33f('0xaa'),_0xd33f('0x61'))['from'](_0xd33f('0xb4'))['where'](_0xd33f('0xad'))[_0xd33f('0x49')]('ListId\x20=\x20?',_0x174a67[_0xd33f('0xab')][_0xd33f('0xac')]())[_0xd33f('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0xd33f('0xac')]();_0x2474f3[_0xd33f('0x99')](db[_0xd33f('0x8d')][_0xd33f('0x3e')](_0xa1b23));}return BPromise[_0xd33f('0x9a')](_0x2474f3);}})['then'](function(){return _0x940d1;})[_0xd33f('0x2a')](respondWithResult(_0x12613f,null))['catch'](handleError(_0x12613f,null));};exports[_0xd33f('0xb9')]=function(_0x40eb1d,_0x146fdb,_0x310f47){return db['VoiceQueue'][_0xd33f('0x32')]({'where':{'id':_0x40eb1d[_0xd33f('0x52')]['id']}})[_0xd33f('0x2a')](handleEntityNotFound(_0x146fdb,null))[_0xd33f('0x2a')](function(_0x4cdf54){if(_0x4cdf54){return _0x4cdf54[_0xd33f('0xb9')](_0x40eb1d[_0xd33f('0x3e')][_0xd33f('0x93')]);}})[_0xd33f('0x2a')](function(_0x1b1bad){if(_0x1b1bad){return db[_0xd33f('0x6e')][_0xd33f('0x35')]({'where':{'ListId':_0x40eb1d['query'][_0xd33f('0x93')],'VoiceQueueId':_0x40eb1d[_0xd33f('0x52')]['id']}})['then'](function(){return _0x1b1bad;});}})[_0xd33f('0x2a')](respondWithStatusCode(_0x146fdb,null))[_0xd33f('0x51')](handleError(_0x146fdb,null));};
\ No newline at end of file
index adccae4..fff01e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da1=['events','../../mysqldb','VoiceQueue','remove','emit','hasOwnProperty','hook','exports'];(function(_0x322b7e,_0x3c8e7e){var _0x2f0e1f=function(_0x17127c){while(--_0x17127c){_0x322b7e['push'](_0x322b7e['shift']());}};_0x2f0e1f(++_0x3c8e7e);}(_0x5da1,0x128));var _0x15da=function(_0x542540,_0x180cd1){_0x542540=_0x542540-0x0;var _0x3ddeff=_0x5da1[_0x542540];return _0x3ddeff;};'use strict';var EventEmitter=require(_0x15da('0x0'));var VoiceQueue=require(_0x15da('0x1'))['db'][_0x15da('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x15da('0x3')};function emitEvent(_0x1c3b8b){return function(_0x14d54e,_0x37347d,_0x2e633b){VoiceQueueEvents[_0x15da('0x4')](_0x1c3b8b+':'+_0x14d54e['id'],_0x14d54e);VoiceQueueEvents[_0x15da('0x4')](_0x1c3b8b,_0x14d54e);_0x2e633b(null);};}for(var e in events){if(events[_0x15da('0x5')](e)){var event=events[e];VoiceQueue[_0x15da('0x6')](e,emitEvent(event));}}module[_0x15da('0x7')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xfc35=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xe5366,_0x32ea05){var _0x3dfd7d=function(_0x3aeb41){while(--_0x3aeb41){_0xe5366['push'](_0xe5366['shift']());}};_0x3dfd7d(++_0x32ea05);}(_0xfc35,0x19f));var _0x5fc3=function(_0x192295,_0x4cfc6f){_0x192295=_0x192295-0x0;var _0x2c4bda=_0xfc35[_0x192295];return _0x2c4bda;};'use strict';var EventEmitter=require(_0x5fc3('0x0'));var VoiceQueue=require(_0x5fc3('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x5fc3('0x2')](0x0);var events={'afterCreate':_0x5fc3('0x3'),'afterUpdate':'update','afterDestroy':_0x5fc3('0x4')};function emitEvent(_0xd13890){return function(_0x31bf2b,_0x242d62,_0x31d405){VoiceQueueEvents[_0x5fc3('0x5')](_0xd13890+':'+_0x31bf2b['id'],_0x31bf2b);VoiceQueueEvents[_0x5fc3('0x5')](_0xd13890,_0x31bf2b);_0x31d405(null);};}for(var e in events){if(events[_0x5fc3('0x6')](e)){var event=events[e];VoiceQueue[_0x5fc3('0x7')](e,emitEvent(event));}}module[_0x5fc3('0x8')]=VoiceQueueEvents;
\ No newline at end of file
index 2d3b08e..2c364c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3937b6,_0xd53d2b){var _0x1ba356=function(_0x4816cc){while(--_0x4816cc){_0x3937b6['push'](_0x3937b6['shift']());}};_0x1ba356(++_0xd53d2b);}(_0x008c,0x188));var _0xc008=function(_0x464e1f,_0x2aa86f){_0x464e1f=_0x464e1f-0x0;var _0x1c1ce2=_0x008c[_0x464e1f];return _0x1c1ce2;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x173e14,_0x2bc9a7){var _0x82460a=function(_0x4ddf8a){while(--_0x4ddf8a){_0x173e14['push'](_0x173e14['shift']());}};_0x82460a(++_0x2bc9a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7cd7ed3..b8c2c3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1600=['request','then','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','VoiceQueue,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','map','include','model','info','ShowVoiceQueue','find','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register'];(function(_0x132765,_0x2663cd){var _0x2f3263=function(_0x28c713){while(--_0x28c713){_0x132765['push'](_0x132765['shift']());}};_0x2f3263(++_0x2663cd);}(_0x1600,0xea));var _0x0160=function(_0x22b7ac,_0x473133){_0x22b7ac=_0x22b7ac-0x0;var _0x57f406=_0x1600[_0x22b7ac];return _0x57f406;};'use strict';var _=require(_0x0160('0x0'));var util=require(_0x0160('0x1'));var moment=require(_0x0160('0x2'));var BPromise=require(_0x0160('0x3'));var rs=require(_0x0160('0x4'));var fs=require('fs');var Redis=require(_0x0160('0x5'));var db=require(_0x0160('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0160('0x7'))(_0x0160('0x8'));var config=require(_0x0160('0x9'));var jayson=require(_0x0160('0xa'));var client=jayson['client'][_0x0160('0xb')]({'port':0x232a});config[_0x0160('0xc')]=_[_0x0160('0xd')](config[_0x0160('0xc')],{'host':_0x0160('0xe'),'port':0x18eb});var socket=require(_0x0160('0xf'))(new Redis(config[_0x0160('0xc')]));require(_0x0160('0x10'))[_0x0160('0x11')](socket);function respondWithRpcPromise(_0x2234f4,_0x19f31,_0x274d4d){return new BPromise(function(_0x2bcddd,_0x2ebc1c){return client[_0x0160('0x12')](_0x2234f4,_0x274d4d)[_0x0160('0x13')](function(_0x8fceb6){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x19f31,_0x0160('0x14'));logger['debug'](_0x0160('0x15'),_0x19f31,_0x0160('0x14'),JSON[_0x0160('0x16')](_0x8fceb6));if(_0x8fceb6['error']){if(_0x8fceb6['error']['code']===0x1f4){logger['error'](_0x0160('0x17'),_0x19f31,_0x8fceb6[_0x0160('0x18')][_0x0160('0x19')]);return _0x2ebc1c(_0x8fceb6[_0x0160('0x18')]['message']);}logger[_0x0160('0x18')](_0x0160('0x17'),_0x19f31,_0x8fceb6['error'][_0x0160('0x19')]);return _0x2bcddd(_0x8fceb6[_0x0160('0x18')][_0x0160('0x19')]);}else{logger['info'](_0x0160('0x17'),_0x19f31,_0x0160('0x14'));_0x2bcddd(_0x8fceb6[_0x0160('0x1a')]['message']);}})[_0x0160('0x1b')](function(_0x333054){logger[_0x0160('0x18')](_0x0160('0x17'),_0x19f31,_0x333054);_0x2ebc1c(_0x333054);});});}exports[_0x0160('0x1c')]=function(_0x2b3583){var _0x243cb1=this;return new Promise(function(_0x721b83,_0x342217){return db[_0x0160('0x1d')]['findAll']({'raw':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x1f')]===undefined?!![]:![]:!![],'where':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x20')]||null:null,'attributes':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')][_0x0160('0x21')]||null:null,'limit':_0x2b3583[_0x0160('0x1e')]?_0x2b3583['options'][_0x0160('0x22')]||null:null,'include':_0x2b3583[_0x0160('0x1e')]?_0x2b3583[_0x0160('0x1e')]['include']?_[_0x0160('0x23')](_0x2b3583[_0x0160('0x1e')][_0x0160('0x24')],function(_0x57a899){return{'model':db[_0x57a899[_0x0160('0x25')]],'as':_0x57a899['as'],'attributes':_0x57a899['attributes'],'include':_0x57a899[_0x0160('0x24')]?_[_0x0160('0x23')](_0x57a899[_0x0160('0x24')],function(_0x1fe08f){return{'model':db[_0x1fe08f[_0x0160('0x25')]],'as':_0x1fe08f['as'],'attributes':_0x1fe08f[_0x0160('0x21')],'include':_0x1fe08f[_0x0160('0x24')]?_['map'](_0x1fe08f[_0x0160('0x24')],function(_0x3e985d){return{'model':db[_0x3e985d[_0x0160('0x25')]],'as':_0x3e985d['as'],'attributes':_0x3e985d[_0x0160('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0160('0x13')](function(_0x46ee65){logger[_0x0160('0x26')](_0x0160('0x1c'),_0x2b3583);logger['debug'](_0x0160('0x1c'),_0x2b3583,JSON[_0x0160('0x16')](_0x46ee65));_0x721b83(_0x46ee65);})[_0x0160('0x1b')](function(_0x44dc87){logger['error'](_0x0160('0x1c'),_0x44dc87[_0x0160('0x19')],_0x2b3583);_0x342217(_0x243cb1[_0x0160('0x18')](0x1f4,_0x44dc87[_0x0160('0x19')]));});});};exports[_0x0160('0x27')]=function(_0x1eb4a2){var _0x3217bb=this;return new Promise(function(_0x591b74,_0x1e3733){return db[_0x0160('0x1d')][_0x0160('0x28')]({'raw':_0x1eb4a2[_0x0160('0x1e')]?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x1f')]===undefined?!![]:![]:!![],'where':_0x1eb4a2[_0x0160('0x1e')]?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x20')]||null:null,'attributes':_0x1eb4a2['options']?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x21')]||null:null,'include':_0x1eb4a2['options']?_0x1eb4a2[_0x0160('0x1e')][_0x0160('0x24')]?_['map'](_0x1eb4a2[_0x0160('0x1e')]['include'],function(_0x49832a){return{'model':db[_0x49832a[_0x0160('0x25')]],'as':_0x49832a['as'],'attributes':_0x49832a[_0x0160('0x21')],'include':_0x49832a[_0x0160('0x24')]?_[_0x0160('0x23')](_0x49832a['include'],function(_0x4a940d){return{'model':db[_0x4a940d[_0x0160('0x25')]],'as':_0x4a940d['as'],'attributes':_0x4a940d['attributes'],'include':_0x4a940d[_0x0160('0x24')]?_[_0x0160('0x23')](_0x4a940d[_0x0160('0x24')],function(_0x5d108f){return{'model':db[_0x5d108f[_0x0160('0x25')]],'as':_0x5d108f['as'],'attributes':_0x5d108f[_0x0160('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0160('0x13')](function(_0x4989e7){logger[_0x0160('0x26')]('ShowVoiceQueue',_0x1eb4a2);logger[_0x0160('0x29')](_0x0160('0x27'),_0x1eb4a2,JSON[_0x0160('0x16')](_0x4989e7));_0x591b74(_0x4989e7);})[_0x0160('0x1b')](function(_0x93ae6b){logger['error'](_0x0160('0x27'),_0x93ae6b[_0x0160('0x19')],_0x1eb4a2);_0x1e3733(_0x3217bb[_0x0160('0x18')](0x1f4,_0x93ae6b[_0x0160('0x19')]));});});};
\ No newline at end of file
+var _0x09f0=['client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x350500,_0x12365c){var _0x49b1b2=function(_0x3e5c1e){while(--_0x3e5c1e){_0x350500['push'](_0x350500['shift']());}};_0x49b1b2(++_0x12365c);}(_0x09f0,0x1c3));var _0x009f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x09f0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x009f('0x0'));var util=require(_0x009f('0x1'));var moment=require(_0x009f('0x2'));var BPromise=require(_0x009f('0x3'));var rs=require(_0x009f('0x4'));var fs=require('fs');var Redis=require(_0x009f('0x5'));var db=require(_0x009f('0x6'))['db'];var utils=require(_0x009f('0x7'));var logger=require(_0x009f('0x8'))('rpc');var config=require(_0x009f('0x9'));var jayson=require(_0x009f('0xa'));var client=jayson[_0x009f('0xb')]['http']({'port':0x232a});config[_0x009f('0xc')]=_[_0x009f('0xd')](config[_0x009f('0xc')],{'host':_0x009f('0xe'),'port':0x18eb});var socket=require(_0x009f('0xf'))(new Redis(config[_0x009f('0xc')]));require(_0x009f('0x10'))[_0x009f('0x11')](socket);function respondWithRpcPromise(_0x165425,_0x3436b4,_0x32136d){return new BPromise(function(_0x5c3e64,_0x54ea12){return client['request'](_0x165425,_0x32136d)['then'](function(_0x52bfa6){logger[_0x009f('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x3436b4,_0x009f('0x13'));logger[_0x009f('0x14')](_0x009f('0x15'),_0x3436b4,_0x009f('0x13'),JSON[_0x009f('0x16')](_0x52bfa6));if(_0x52bfa6[_0x009f('0x17')]){if(_0x52bfa6['error'][_0x009f('0x18')]===0x1f4){logger['error'](_0x009f('0x19'),_0x3436b4,_0x52bfa6['error'][_0x009f('0x1a')]);return _0x54ea12(_0x52bfa6[_0x009f('0x17')]['message']);}logger[_0x009f('0x17')](_0x009f('0x19'),_0x3436b4,_0x52bfa6['error'][_0x009f('0x1a')]);return _0x5c3e64(_0x52bfa6[_0x009f('0x17')][_0x009f('0x1a')]);}else{logger[_0x009f('0x12')](_0x009f('0x19'),_0x3436b4,_0x009f('0x13'));_0x5c3e64(_0x52bfa6[_0x009f('0x1b')][_0x009f('0x1a')]);}})[_0x009f('0x1c')](function(_0x118497){logger[_0x009f('0x17')](_0x009f('0x19'),_0x3436b4,_0x118497);_0x54ea12(_0x118497);});});}exports[_0x009f('0x1d')]=function(_0x150d47){var _0x1eba60=this;return new Promise(function(_0x565297,_0x21bf6f){return db['VoiceQueue']['findAll']({'raw':_0x150d47[_0x009f('0x1e')]?_0x150d47[_0x009f('0x1e')][_0x009f('0x1f')]===undefined?!![]:![]:!![],'where':_0x150d47[_0x009f('0x1e')]?_0x150d47[_0x009f('0x1e')][_0x009f('0x20')]||null:null,'attributes':_0x150d47[_0x009f('0x1e')]?_0x150d47[_0x009f('0x1e')][_0x009f('0x21')]||null:null,'limit':_0x150d47['options']?_0x150d47['options'][_0x009f('0x22')]||null:null,'include':_0x150d47['options']?_0x150d47[_0x009f('0x1e')][_0x009f('0x23')]?_[_0x009f('0x24')](_0x150d47[_0x009f('0x1e')][_0x009f('0x23')],function(_0x4b5d04){return{'model':db[_0x4b5d04[_0x009f('0x25')]],'as':_0x4b5d04['as'],'attributes':_0x4b5d04[_0x009f('0x21')],'include':_0x4b5d04[_0x009f('0x23')]?_[_0x009f('0x24')](_0x4b5d04[_0x009f('0x23')],function(_0x3ab663){return{'model':db[_0x3ab663['model']],'as':_0x3ab663['as'],'attributes':_0x3ab663[_0x009f('0x21')],'include':_0x3ab663[_0x009f('0x23')]?_[_0x009f('0x24')](_0x3ab663[_0x009f('0x23')],function(_0x220791){return{'model':db[_0x220791['model']],'as':_0x220791['as'],'attributes':_0x220791[_0x009f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x009f('0x26')](function(_0x52a7b9){logger[_0x009f('0x12')]('GetVoiceQueue',_0x150d47);logger[_0x009f('0x14')](_0x009f('0x1d'),_0x150d47,JSON[_0x009f('0x16')](_0x52a7b9));_0x565297(_0x52a7b9);})[_0x009f('0x1c')](function(_0x3ac270){logger[_0x009f('0x17')](_0x009f('0x1d'),_0x3ac270[_0x009f('0x1a')],_0x150d47);_0x21bf6f(_0x1eba60['error'](0x1f4,_0x3ac270[_0x009f('0x1a')]));});});};exports[_0x009f('0x27')]=function(_0x122d25){var _0x88029d=this;return new Promise(function(_0x2f0dcb,_0x50193c){return db[_0x009f('0x28')][_0x009f('0x29')]({'raw':_0x122d25[_0x009f('0x1e')]?_0x122d25[_0x009f('0x1e')][_0x009f('0x1f')]===undefined?!![]:![]:!![],'where':_0x122d25[_0x009f('0x1e')]?_0x122d25[_0x009f('0x1e')][_0x009f('0x20')]||null:null,'attributes':_0x122d25[_0x009f('0x1e')]?_0x122d25[_0x009f('0x1e')][_0x009f('0x21')]||null:null,'include':_0x122d25[_0x009f('0x1e')]?_0x122d25['options'][_0x009f('0x23')]?_[_0x009f('0x24')](_0x122d25['options'][_0x009f('0x23')],function(_0x4e3f55){return{'model':db[_0x4e3f55[_0x009f('0x25')]],'as':_0x4e3f55['as'],'attributes':_0x4e3f55['attributes'],'include':_0x4e3f55[_0x009f('0x23')]?_[_0x009f('0x24')](_0x4e3f55[_0x009f('0x23')],function(_0x561e49){return{'model':db[_0x561e49[_0x009f('0x25')]],'as':_0x561e49['as'],'attributes':_0x561e49[_0x009f('0x21')],'include':_0x561e49[_0x009f('0x23')]?_[_0x009f('0x24')](_0x561e49[_0x009f('0x23')],function(_0x493648){return{'model':db[_0x493648[_0x009f('0x25')]],'as':_0x493648['as'],'attributes':_0x493648[_0x009f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x009f('0x26')](function(_0x3ab9d1){logger['info'](_0x009f('0x27'),_0x122d25);logger[_0x009f('0x14')](_0x009f('0x27'),_0x122d25,JSON[_0x009f('0x16')](_0x3ab9d1));_0x2f0dcb(_0x3ab9d1);})[_0x009f('0x1c')](function(_0x2ee524){logger[_0x009f('0x17')](_0x009f('0x27'),_0x2ee524[_0x009f('0x1a')],_0x122d25);_0x50193c(_0x88029d['error'](0x1f4,_0x2ee524[_0x009f('0x1a')]));});});};
\ No newline at end of file
index e3824a6..5751f21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf9a=['removeListener','register','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x2052cc,_0x4f76dc){var _0x58609f=function(_0x28bdc9){while(--_0x28bdc9){_0x2052cc['push'](_0x2052cc['shift']());}};_0x58609f(++_0x4f76dc);}(_0xdf9a,0x177));var _0xadf9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf9a[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceQueueEvents=require(_0xadf9('0x0'));var events=[_0xadf9('0x1'),'remove',_0xadf9('0x2')];function createListener(_0x3381dc,_0x531742){return function(_0x5bd9e4){_0x531742['emit'](_0x3381dc,_0x5bd9e4);};}function removeListener(_0x4c510b,_0x5b23fb){return function(){VoiceQueueEvents[_0xadf9('0x3')](_0x4c510b,_0x5b23fb);};}exports[_0xadf9('0x4')]=function(_0x290a59){for(var _0x2011c7=0x0,_0x18c8cd=events['length'];_0x2011c7<_0x18c8cd;_0x2011c7++){var _0x59a997=events[_0x2011c7];var _0x1b23fb=createListener(_0xadf9('0x5')+_0x59a997,_0x290a59);VoiceQueueEvents['on'](_0x59a997,_0x1b23fb);}};
\ No newline at end of file
+var _0xd681=['removeListener','./voiceQueue.events','remove','update'];(function(_0x52aad8,_0x3d3dd0){var _0x4a25fb=function(_0x18f032){while(--_0x18f032){_0x52aad8['push'](_0x52aad8['shift']());}};_0x4a25fb(++_0x3d3dd0);}(_0xd681,0xe1));var _0x1d68=function(_0x2094be,_0x52ee68){_0x2094be=_0x2094be-0x0;var _0x55614=_0xd681[_0x2094be];return _0x55614;};'use strict';var VoiceQueueEvents=require(_0x1d68('0x0'));var events=['save',_0x1d68('0x1'),_0x1d68('0x2')];function createListener(_0x3fc955,_0x53ded7){return function(_0x1cbccc){_0x53ded7['emit'](_0x3fc955,_0x1cbccc);};}function removeListener(_0x3f10e9,_0x12db59){return function(){VoiceQueueEvents[_0x1d68('0x3')](_0x3f10e9,_0x12db59);};}exports['register']=function(_0x5dc01f){for(var _0x5cdcb5=0x0,_0x5a79a0=events['length'];_0x5cdcb5<_0x5a79a0;_0x5cdcb5++){var _0x14e07d=events[_0x5cdcb5];var _0x4b6297=createListener('voiceQueue:'+_0x14e07d,_0x5dc01f);VoiceQueueEvents['on'](_0x14e07d,_0x4b6297);}};
\ No newline at end of file
index d8d6e2c..fa51fda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x977f=['./voiceQueueReport.controller','get','index','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25c33b,_0x3e1ab6){var _0x3e13d6=function(_0x5dd757){while(--_0x5dd757){_0x25c33b['push'](_0x25c33b['shift']());}};_0x3e13d6(++_0x3e1ab6);}(_0x977f,0xa7));var _0xf977=function(_0x3f2322,_0x1aa435){_0x3f2322=_0x3f2322-0x0;var _0x1f6284=_0x977f[_0x3f2322];return _0x1f6284;};'use strict';var multer=require(_0xf977('0x0'));var util=require(_0xf977('0x1'));var path=require(_0xf977('0x2'));var timeout=require(_0xf977('0x3'));var express=require('express');var router=express[_0xf977('0x4')]();var fs_extra=require(_0xf977('0x5'));var auth=require(_0xf977('0x6'));var interaction=require(_0xf977('0x7'));var config=require(_0xf977('0x8'));var controller=require(_0xf977('0x9'));router[_0xf977('0xa')]('/',auth['isAuthenticated'](),controller[_0xf977('0xb')]);router['get']('/describe',auth[_0xf977('0xc')](),controller[_0xf977('0xd')]);router['get'](_0xf977('0xe'),auth[_0xf977('0xc')](),controller[_0xf977('0xf')]);router[_0xf977('0xa')](_0xf977('0x10'),auth[_0xf977('0xc')](),controller[_0xf977('0x11')]);router[_0xf977('0x12')]('/',auth[_0xf977('0xc')](),controller[_0xf977('0x13')]);router['put'](_0xf977('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xf977('0x14')](_0xf977('0x10'),auth[_0xf977('0xc')](),controller[_0xf977('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xdfa0=['./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','getVoiceQueuesReport','/:id','show','create','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4d1cc5,_0xa4a23d){var _0xaa2916=function(_0x22bd7b){while(--_0x22bd7b){_0x4d1cc5['push'](_0x4d1cc5['shift']());}};_0xaa2916(++_0xa4a23d);}(_0xdfa0,0x109));var _0x0dfa=function(_0x4aac25,_0x198af7){_0x4aac25=_0x4aac25-0x0;var _0x484a51=_0xdfa0[_0x4aac25];return _0x484a51;};'use strict';var multer=require(_0x0dfa('0x0'));var util=require(_0x0dfa('0x1'));var path=require('path');var timeout=require(_0x0dfa('0x2'));var express=require(_0x0dfa('0x3'));var router=express[_0x0dfa('0x4')]();var fs_extra=require(_0x0dfa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0dfa('0x6'));var config=require(_0x0dfa('0x7'));var controller=require(_0x0dfa('0x8'));router[_0x0dfa('0x9')]('/',auth['isAuthenticated'](),controller[_0x0dfa('0xa')]);router[_0x0dfa('0x9')](_0x0dfa('0xb'),auth[_0x0dfa('0xc')](),controller[_0x0dfa('0xd')]);router['get']('/index',auth[_0x0dfa('0xc')](),controller[_0x0dfa('0xe')]);router[_0x0dfa('0x9')](_0x0dfa('0xf'),auth[_0x0dfa('0xc')](),controller[_0x0dfa('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0dfa('0x11')]);router['put'](_0x0dfa('0xf'),auth[_0x0dfa('0xc')](),controller[_0x0dfa('0x12')]);router['delete']('/:id',auth[_0x0dfa('0xc')](),controller[_0x0dfa('0x13')]);module[_0x0dfa('0x14')]=router;
\ No newline at end of file
index 4a1bb9c..6549bf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba20=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x31edd4,_0x247be0){var _0x30d61c=function(_0x407efd){while(--_0x407efd){_0x31edd4['push'](_0x31edd4['shift']());}};_0x30d61c(++_0x247be0);}(_0xba20,0x10c));var _0x0ba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba20[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0ba2('0x0'));var moment=require(_0x0ba2('0x1'));module[_0x0ba2('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0ba2('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0ba2('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x0ba2('0x4')],'set':function(_0x3bda23){var _0x451ca5=moment(_0x3bda23);var _0x1053a4=moment(this[_0x0ba2('0x5')](_0x0ba2('0x6')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4cdb76=_0x451ca5[_0x0ba2('0x7')](_0x1053a4,_0x0ba2('0x8'));this[_0x0ba2('0x9')](_0x0ba2('0xa'),_0x3bda23);this[_0x0ba2('0x9')](_0x0ba2('0xb'),_0x4cdb76||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x0ba2('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerexit':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0ba2('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x0ba2('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x0ba2('0xc')]},'channel':{'type':Sequelize[_0x0ba2('0x3')]},'connectedlinenum':{'type':Sequelize[_0x0ba2('0x3')]},'connectedlinename':{'type':Sequelize[_0x0ba2('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0ba2('0x3')]},'priority':{'type':Sequelize[_0x0ba2('0x3')]},'holdtime':{'type':Sequelize[_0x0ba2('0xc')]},'mohtime':{'type':Sequelize[_0x0ba2('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0ba2('0x3')]},'transfer':{'type':Sequelize[_0x0ba2('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x0ba2('0x3')],'comment':_0x0ba2('0xe')},'transferexten':{'type':Sequelize[_0x0ba2('0x3')]},'transferuniqueid':{'type':Sequelize[_0x0ba2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0ba2('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0ba2('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbd95=['STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x12400e,_0x144185){var _0x1b2e71=function(_0x4bfca7){while(--_0x4bfca7){_0x12400e['push'](_0x12400e['shift']());}};_0x1b2e71(++_0x144185);}(_0xbd95,0x11b));var _0x5bd9=function(_0x6c622f,_0x29a1c5){_0x6c622f=_0x6c622f-0x0;var _0x4bfc25=_0xbd95[_0x6c622f];return _0x4bfc25;};'use strict';var Sequelize=require(_0x5bd9('0x0'));var moment=require(_0x5bd9('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5bd9('0x2')]},'calleridname':{'type':Sequelize[_0x5bd9('0x2')]},'queue':{'type':Sequelize[_0x5bd9('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x5bd9('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1e0afd){var _0x3d8df9=moment(_0x1e0afd);var _0x3bc49c=moment(this[_0x5bd9('0x4')](_0x5bd9('0x5')))[_0x5bd9('0x6')](_0x5bd9('0x7'));var _0x567daf=_0x3d8df9[_0x5bd9('0x8')](_0x3bc49c,_0x5bd9('0x9'));this[_0x5bd9('0xa')]('queuecallerleaveAt',_0x1e0afd);this[_0x5bd9('0xa')](_0x5bd9('0xb'),_0x567daf||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x5bd9('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5bd9('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x5bd9('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5bd9('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5bd9('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x5bd9('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x5bd9('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5bd9('0x2')]},'connectedlinename':{'type':Sequelize[_0x5bd9('0x2')]},'accountcode':{'type':Sequelize[_0x5bd9('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x5bd9('0xc')]},'mohtime':{'type':Sequelize[_0x5bd9('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5bd9('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5bd9('0x2')]},'transfer':{'type':Sequelize[_0x5bd9('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5bd9('0x2')],'comment':_0x5bd9('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5bd9('0x2')]},'secondDisposition':{'type':Sequelize[_0x5bd9('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x5bd9('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 90ca650..0dd5df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a52=['bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','eml-format','rimraf','request-promise'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x6a52,0xa5));var _0x26a5=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0x6a52[_0x286726];return _0xcd4fe9;};'use strict';var emlformat=require(_0x26a5('0x0'));var rimraf=require(_0x26a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x26a5('0x2'));var moment=require('moment');var BPromise=require(_0x26a5('0x3'));var Mustache=require(_0x26a5('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x26a5('0x5'));var ejs=require(_0x26a5('0x6'));var fs=require('fs');var fs_extra=require(_0x26a5('0x7'));var _=require(_0x26a5('0x8'));var squel=require(_0x26a5('0x9'));var crypto=require('crypto');var jsforce=require(_0x26a5('0xa'));var deskjs=require(_0x26a5('0xb'));var toCsv=require(_0x26a5('0x5'));var querystring=require(_0x26a5('0xc'));var Papa=require(_0x26a5('0xd'));var Redis=require(_0x26a5('0xe'));var authService=require(_0x26a5('0xf'));var qs=require(_0x26a5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x26a5('0x11'));var utils=require(_0x26a5('0x12'));var config=require(_0x26a5('0x13'));var licenseUtil=require(_0x26a5('0x14'));var db=require(_0x26a5('0x15'))['db'];config[_0x26a5('0x16')]=_[_0x26a5('0x17')](config[_0x26a5('0x16')],{'host':_0x26a5('0x18'),'port':0x18eb});var socket=require(_0x26a5('0x19'))(new Redis(config[_0x26a5('0x16')]));require(_0x26a5('0x1a'))[_0x26a5('0x1b')](socket);function respondWithStatusCode(_0x519678,_0xa25a02){_0xa25a02=_0xa25a02||0xcc;return function(_0x2e4552){if(_0x2e4552){return _0x519678['sendStatus'](_0xa25a02);}return _0x519678[_0x26a5('0x1c')](_0xa25a02)[_0x26a5('0x1d')]();};}function respondWithResult(_0x228cc1,_0x2fc3c6){_0x2fc3c6=_0x2fc3c6||0xc8;return function(_0x14f3e5){if(_0x14f3e5){return _0x228cc1[_0x26a5('0x1c')](_0x2fc3c6)['json'](_0x14f3e5);}};}function respondWithFilteredResult(_0xe5e6c4,_0x182874){return function(_0x4baf9e){if(_0x4baf9e){var _0x2186b3=typeof _0x182874[_0x26a5('0x1e')]===_0x26a5('0x1f')&&typeof _0x182874[_0x26a5('0x20')]===_0x26a5('0x1f');var _0x406894=_0x4baf9e['count'];var _0x13bafb=_0x2186b3?0x0:_0x182874[_0x26a5('0x1e')];var _0x5eda16=_0x2186b3?_0x4baf9e[_0x26a5('0x21')]:_0x182874[_0x26a5('0x1e')]+_0x182874[_0x26a5('0x20')];var _0x4be4ce;if(_0x5eda16>=_0x406894){_0x5eda16=_0x406894;_0x4be4ce=0xc8;}else{_0x4be4ce=0xce;}_0xe5e6c4['status'](_0x4be4ce);return _0xe5e6c4[_0x26a5('0x22')](_0x26a5('0x23'),_0x13bafb+'-'+_0x5eda16+'/'+_0x406894)[_0x26a5('0x24')](_0x4baf9e);}return null;};}function patchUpdates(_0x5c4336){return function(_0xeb42ff){try{jsonpatch[_0x26a5('0x25')](_0xeb42ff,_0x5c4336,!![]);}catch(_0x56864c){return BPromise[_0x26a5('0x26')](_0x56864c);}return _0xeb42ff[_0x26a5('0x27')]();};}function saveUpdates(_0x204221,_0x42ddef){return function(_0x5b795e){if(_0x5b795e){return _0x5b795e[_0x26a5('0x28')](_0x204221)['then'](function(_0x1d7a25){return _0x1d7a25;});}return null;};}function removeEntity(_0x1f3787,_0x2322c1){return function(_0x100414){if(_0x100414){return _0x100414['destroy']()[_0x26a5('0x29')](function(){_0x1f3787['status'](0xcc)[_0x26a5('0x1d')]();});}};}function handleEntityNotFound(_0x44d837,_0x134548){return function(_0x2df7ca){if(!_0x2df7ca){_0x44d837[_0x26a5('0x2a')](0x194);}return _0x2df7ca;};}function handleError(_0x2c8849,_0x5ea2f8){_0x5ea2f8=_0x5ea2f8||0x1f4;return function(_0x599192){logger[_0x26a5('0x2b')](_0x599192[_0x26a5('0x2c')]);if(_0x599192[_0x26a5('0x2d')]){delete _0x599192['name'];}_0x2c8849[_0x26a5('0x1c')](_0x5ea2f8)[_0x26a5('0x2e')](_0x599192);};}exports[_0x26a5('0x2f')]=function(_0x3ed618,_0x2ef845){var _0x3a5cc4={},_0x3eb836={},_0x7bffef={'count':0x0,'rows':[]};var _0x4f2518=_[_0x26a5('0x30')](db[_0x26a5('0x31')][_0x26a5('0x32')],function(_0x1f50e4){return{'name':_0x1f50e4[_0x26a5('0x33')],'type':_0x1f50e4[_0x26a5('0x34')][_0x26a5('0x35')]};});_0x3eb836[_0x26a5('0x36')]=_['map'](_0x4f2518,_0x26a5('0x2d'));_0x3eb836[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x3ed618[_0x26a5('0x37')]);_0x3eb836[_0x26a5('0x39')]=_[_0x26a5('0x3a')](_0x3eb836[_0x26a5('0x36')],_0x3eb836[_0x26a5('0x37')]);_0x3a5cc4['attributes']=_[_0x26a5('0x3a')](_0x3eb836['model'],qs[_0x26a5('0x3b')](_0x3ed618[_0x26a5('0x37')]['fields']));_0x3a5cc4[_0x26a5('0x3c')]=_0x3a5cc4['attributes'][_0x26a5('0x3d')]?_0x3a5cc4[_0x26a5('0x3c')]:_0x3eb836[_0x26a5('0x36')];if(!_0x3ed618['query'][_0x26a5('0x3e')]('nolimit')){_0x3a5cc4[_0x26a5('0x20')]=qs[_0x26a5('0x20')](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x20')]);_0x3a5cc4[_0x26a5('0x1e')]=qs['offset'](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x1e')]);}_0x3a5cc4[_0x26a5('0x3f')]=qs[_0x26a5('0x40')](_0x3ed618[_0x26a5('0x37')][_0x26a5('0x40')]);_0x3a5cc4[_0x26a5('0x41')]=qs[_0x26a5('0x39')](_[_0x26a5('0x42')](_0x3ed618[_0x26a5('0x37')],_0x3eb836[_0x26a5('0x39')]),_0x4f2518);if(_0x3ed618[_0x26a5('0x37')][_0x26a5('0x43')]){_0x3a5cc4[_0x26a5('0x41')]=_[_0x26a5('0x44')](_0x3a5cc4[_0x26a5('0x41')],{'$or':_[_0x26a5('0x30')](_0x4f2518,function(_0x3d293c){if(_0x3d293c['type']!==_0x26a5('0x45')){var _0x2b041c={};_0x2b041c[_0x3d293c[_0x26a5('0x2d')]]={'$like':'%'+_0x3ed618[_0x26a5('0x37')][_0x26a5('0x43')]+'%'};return _0x2b041c;}})});}_0x3a5cc4=_[_0x26a5('0x44')]({},_0x3a5cc4,_0x3ed618[_0x26a5('0x46')]);var _0x2b5a93={'where':_0x3a5cc4[_0x26a5('0x41')]};return db['VoiceQueueReport'][_0x26a5('0x21')](_0x2b5a93)['then'](function(_0x2f4729){_0x7bffef[_0x26a5('0x21')]=_0x2f4729;if(_0x3ed618['query'][_0x26a5('0x47')]){_0x3a5cc4['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x26a5('0x48')](_0x3a5cc4);})[_0x26a5('0x29')](function(_0x2f1122){_0x7bffef['rows']=_0x2f1122;return _0x7bffef;})[_0x26a5('0x29')](respondWithFilteredResult(_0x2ef845,_0x3a5cc4))[_0x26a5('0x49')](handleError(_0x2ef845,null));};exports[_0x26a5('0x4a')]=function(_0x10cc73,_0x59ca61){var _0x3af891={'raw':![],'where':{'id':_0x10cc73[_0x26a5('0x4b')]['id']}},_0x224001={};_0x224001[_0x26a5('0x36')]=_[_0x26a5('0x38')](db[_0x26a5('0x31')][_0x26a5('0x32')]);_0x224001[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x10cc73['query']);_0x224001['filters']=_[_0x26a5('0x3a')](_0x224001[_0x26a5('0x36')],_0x224001[_0x26a5('0x37')]);_0x3af891[_0x26a5('0x3c')]=_[_0x26a5('0x3a')](_0x224001[_0x26a5('0x36')],qs['fields'](_0x10cc73['query'][_0x26a5('0x3b')]));_0x3af891[_0x26a5('0x3c')]=_0x3af891[_0x26a5('0x3c')]['length']?_0x3af891[_0x26a5('0x3c')]:_0x224001['model'];if(_0x10cc73[_0x26a5('0x37')]['includeAll']){_0x3af891[_0x26a5('0x4c')]=[{'all':!![]}];}_0x3af891=_[_0x26a5('0x44')]({},_0x3af891,_0x10cc73[_0x26a5('0x46')]);return db[_0x26a5('0x31')][_0x26a5('0x4d')](_0x3af891)[_0x26a5('0x29')](handleEntityNotFound(_0x59ca61,null))['then'](respondWithResult(_0x59ca61,null))[_0x26a5('0x49')](handleError(_0x59ca61,null));};exports[_0x26a5('0x4e')]=function(_0x3c639f,_0x35c278){return db[_0x26a5('0x31')][_0x26a5('0x4e')](_0x3c639f['body'],{})[_0x26a5('0x29')](respondWithResult(_0x35c278,0xc9))[_0x26a5('0x49')](handleError(_0x35c278,null));};exports['update']=function(_0x11d723,_0x4efd6e){if(_0x11d723[_0x26a5('0x4f')]['id']){delete _0x11d723[_0x26a5('0x4f')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x11d723[_0x26a5('0x4b')]['id']}})[_0x26a5('0x29')](handleEntityNotFound(_0x4efd6e,null))[_0x26a5('0x29')](saveUpdates(_0x11d723['body'],null))[_0x26a5('0x29')](respondWithResult(_0x4efd6e,null))['catch'](handleError(_0x4efd6e,null));};exports[_0x26a5('0x50')]=function(_0x4ac171,_0x355e9a){return db[_0x26a5('0x31')][_0x26a5('0x4d')]({'where':{'id':_0x4ac171['params']['id']}})[_0x26a5('0x29')](handleEntityNotFound(_0x355e9a,null))[_0x26a5('0x29')](removeEntity(_0x355e9a,null))[_0x26a5('0x49')](handleError(_0x355e9a,null));};exports[_0x26a5('0x51')]=function(_0x579e32,_0x4d0b15){return db['VoiceQueueReport'][_0x26a5('0x51')]()[_0x26a5('0x29')](respondWithResult(_0x4d0b15,null))[_0x26a5('0x49')](handleError(_0x4d0b15,null));};exports[_0x26a5('0x52')]=function(_0x281186,_0x239d00){var _0x4cbdd3={},_0x298d15={},_0x6afe07={'count':0x0,'rows':[]};_0x298d15['model']=_[_0x26a5('0x38')](db[_0x26a5('0x31')][_0x26a5('0x32')]);_0x298d15[_0x26a5('0x37')]=_[_0x26a5('0x38')](_0x281186[_0x26a5('0x37')]);_0x298d15['filters']=_[_0x26a5('0x3a')](_0x298d15[_0x26a5('0x36')],_0x298d15[_0x26a5('0x37')]);_0x4cbdd3[_0x26a5('0x3c')]=_['intersection'](_0x298d15[_0x26a5('0x36')],qs['fields'](_0x281186[_0x26a5('0x37')][_0x26a5('0x3b')]));_0x4cbdd3[_0x26a5('0x3c')]=_0x4cbdd3[_0x26a5('0x3c')][_0x26a5('0x3d')]?_0x4cbdd3[_0x26a5('0x3c')]:_0x298d15['model'];if(!_0x281186[_0x26a5('0x37')]['hasOwnProperty'](_0x26a5('0x53'))){_0x4cbdd3[_0x26a5('0x20')]=qs[_0x26a5('0x20')](_0x281186[_0x26a5('0x37')]['limit']);_0x4cbdd3[_0x26a5('0x1e')]=qs[_0x26a5('0x1e')](_0x281186[_0x26a5('0x37')][_0x26a5('0x1e')]);}_0x4cbdd3['order']=qs['sort'](_0x281186[_0x26a5('0x37')]['sort']);_0x4cbdd3[_0x26a5('0x41')]=qs['filters'](_[_0x26a5('0x42')](_0x281186['query'],_0x298d15[_0x26a5('0x39')]));if(_0x281186[_0x26a5('0x37')][_0x26a5('0x43')]){_0x4cbdd3[_0x26a5('0x41')]=_[_0x26a5('0x44')](_0x4cbdd3[_0x26a5('0x41')],{'$or':_[_0x26a5('0x30')](_0x4cbdd3[_0x26a5('0x3c')],function(_0x48dd6b){var _0x249428={};_0x249428[_0x48dd6b]={'$like':'%'+_0x281186['query'][_0x26a5('0x43')]+'%'};return _0x249428;})});}_0x4cbdd3=_[_0x26a5('0x44')]({},_0x4cbdd3,_0x281186[_0x26a5('0x46')]);var _0x29d4e0={'where':_0x4cbdd3[_0x26a5('0x41')]};return db['VoiceQueueReport'][_0x26a5('0x21')](_0x29d4e0)['then'](function(_0x597f59){_0x6afe07[_0x26a5('0x21')]=_0x597f59;if(_0x281186[_0x26a5('0x37')][_0x26a5('0x47')]){_0x4cbdd3[_0x26a5('0x4c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x26a5('0x48')](_0x4cbdd3);})['then'](function(_0x5647cf){_0x6afe07['rows']=_0x5647cf;return _0x6afe07;})['then'](respondWithFilteredResult(_0x239d00,_0x4cbdd3,'getVoiceQueuesReport'))['catch'](handleError(_0x239d00,null,_0x26a5('0x52')));};
\ No newline at end of file
+var _0xfab7=['bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceQueueReport','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','hasOwnProperty','sort','merge','findAll','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x498789,_0x465536){var _0x3f8b64=function(_0x47b635){while(--_0x47b635){_0x498789['push'](_0x498789['shift']());}};_0x3f8b64(++_0x465536);}(_0xfab7,0xfa));var _0x7fab=function(_0x441906,_0x10b76e){_0x441906=_0x441906-0x0;var _0x212ea4=_0xfab7[_0x441906];return _0x212ea4;};'use strict';var emlformat=require(_0x7fab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7fab('0x1'));var jsonpatch=require(_0x7fab('0x2'));var rp=require(_0x7fab('0x3'));var moment=require(_0x7fab('0x4'));var BPromise=require(_0x7fab('0x5'));var Mustache=require('mustache');var util=require(_0x7fab('0x6'));var path=require('path');var sox=require(_0x7fab('0x7'));var csv=require(_0x7fab('0x8'));var ejs=require(_0x7fab('0x9'));var fs=require('fs');var fs_extra=require(_0x7fab('0xa'));var _=require('lodash');var squel=require(_0x7fab('0xb'));var crypto=require(_0x7fab('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fab('0xd'));var toCsv=require(_0x7fab('0x8'));var querystring=require(_0x7fab('0xe'));var Papa=require(_0x7fab('0xf'));var Redis=require(_0x7fab('0x10'));var authService=require(_0x7fab('0x11'));var qs=require(_0x7fab('0x12'));var as=require(_0x7fab('0x13'));var hardwareService=require(_0x7fab('0x14'));var logger=require(_0x7fab('0x15'))(_0x7fab('0x16'));var utils=require(_0x7fab('0x17'));var config=require(_0x7fab('0x18'));var licenseUtil=require(_0x7fab('0x19'));var db=require(_0x7fab('0x1a'))['db'];config[_0x7fab('0x1b')]=_[_0x7fab('0x1c')](config[_0x7fab('0x1b')],{'host':_0x7fab('0x1d'),'port':0x18eb});var socket=require(_0x7fab('0x1e'))(new Redis(config[_0x7fab('0x1b')]));require(_0x7fab('0x1f'))['register'](socket);function respondWithStatusCode(_0x37fff8,_0x435a2d){_0x435a2d=_0x435a2d||0xcc;return function(_0x260267){if(_0x260267){return _0x37fff8[_0x7fab('0x20')](_0x435a2d);}return _0x37fff8[_0x7fab('0x21')](_0x435a2d)[_0x7fab('0x22')]();};}function respondWithResult(_0x2fb495,_0x513ae2){_0x513ae2=_0x513ae2||0xc8;return function(_0x24fcc6){if(_0x24fcc6){return _0x2fb495[_0x7fab('0x21')](_0x513ae2)['json'](_0x24fcc6);}};}function respondWithFilteredResult(_0xd1bccd,_0x5831d0){return function(_0x2f893b){if(_0x2f893b){var _0x58b19b=typeof _0x5831d0[_0x7fab('0x23')]===_0x7fab('0x24')&&typeof _0x5831d0[_0x7fab('0x25')]==='undefined';var _0x551a77=_0x2f893b[_0x7fab('0x26')];var _0x3a3671=_0x58b19b?0x0:_0x5831d0[_0x7fab('0x23')];var _0x4a0073=_0x58b19b?_0x2f893b[_0x7fab('0x26')]:_0x5831d0['offset']+_0x5831d0[_0x7fab('0x25')];var _0x1f4997;if(_0x4a0073>=_0x551a77){_0x4a0073=_0x551a77;_0x1f4997=0xc8;}else{_0x1f4997=0xce;}_0xd1bccd[_0x7fab('0x21')](_0x1f4997);return _0xd1bccd['set'](_0x7fab('0x27'),_0x3a3671+'-'+_0x4a0073+'/'+_0x551a77)[_0x7fab('0x28')](_0x2f893b);}return null;};}function patchUpdates(_0x4bc9a5){return function(_0x306633){try{jsonpatch['apply'](_0x306633,_0x4bc9a5,!![]);}catch(_0x5d1089){return BPromise[_0x7fab('0x29')](_0x5d1089);}return _0x306633[_0x7fab('0x2a')]();};}function saveUpdates(_0x313609,_0x2f0aad){return function(_0x247a44){if(_0x247a44){return _0x247a44[_0x7fab('0x2b')](_0x313609)['then'](function(_0x5e3c1c){return _0x5e3c1c;});}return null;};}function removeEntity(_0x4cc9d2,_0x3c6954){return function(_0x12568e){if(_0x12568e){return _0x12568e[_0x7fab('0x2c')]()[_0x7fab('0x2d')](function(){_0x4cc9d2['status'](0xcc)[_0x7fab('0x22')]();});}};}function handleEntityNotFound(_0x33fca9,_0x3b9e15){return function(_0x3337ce){if(!_0x3337ce){_0x33fca9[_0x7fab('0x20')](0x194);}return _0x3337ce;};}function handleError(_0x1734ed,_0x16d9f4){_0x16d9f4=_0x16d9f4||0x1f4;return function(_0x4d07b7){logger[_0x7fab('0x2e')](_0x4d07b7[_0x7fab('0x2f')]);if(_0x4d07b7[_0x7fab('0x30')]){delete _0x4d07b7[_0x7fab('0x30')];}_0x1734ed[_0x7fab('0x21')](_0x16d9f4)[_0x7fab('0x31')](_0x4d07b7);};}exports[_0x7fab('0x32')]=function(_0x5be84e,_0x488240){var _0x4f8486={},_0x2c527d={},_0x45934a={'count':0x0,'rows':[]};var _0x90081b=_[_0x7fab('0x33')](db[_0x7fab('0x34')]['rawAttributes'],function(_0x141328){return{'name':_0x141328['fieldName'],'type':_0x141328['type'][_0x7fab('0x35')]};});_0x2c527d[_0x7fab('0x36')]=_[_0x7fab('0x33')](_0x90081b,_0x7fab('0x30'));_0x2c527d['query']=_[_0x7fab('0x37')](_0x5be84e[_0x7fab('0x38')]);_0x2c527d[_0x7fab('0x39')]=_[_0x7fab('0x3a')](_0x2c527d[_0x7fab('0x36')],_0x2c527d['query']);_0x4f8486['attributes']=_[_0x7fab('0x3a')](_0x2c527d[_0x7fab('0x36')],qs[_0x7fab('0x3b')](_0x5be84e[_0x7fab('0x38')][_0x7fab('0x3b')]));_0x4f8486[_0x7fab('0x3c')]=_0x4f8486[_0x7fab('0x3c')][_0x7fab('0x3d')]?_0x4f8486[_0x7fab('0x3c')]:_0x2c527d[_0x7fab('0x36')];if(!_0x5be84e[_0x7fab('0x38')]['hasOwnProperty'](_0x7fab('0x3e'))){_0x4f8486[_0x7fab('0x25')]=qs['limit'](_0x5be84e[_0x7fab('0x38')][_0x7fab('0x25')]);_0x4f8486['offset']=qs[_0x7fab('0x23')](_0x5be84e[_0x7fab('0x38')][_0x7fab('0x23')]);}_0x4f8486[_0x7fab('0x3f')]=qs['sort'](_0x5be84e[_0x7fab('0x38')]['sort']);_0x4f8486[_0x7fab('0x40')]=qs['filters'](_[_0x7fab('0x41')](_0x5be84e[_0x7fab('0x38')],_0x2c527d[_0x7fab('0x39')]),_0x90081b);if(_0x5be84e['query'][_0x7fab('0x42')]){_0x4f8486[_0x7fab('0x40')]=_['merge'](_0x4f8486[_0x7fab('0x40')],{'$or':_[_0x7fab('0x33')](_0x90081b,function(_0x81bb79){if(_0x81bb79['type']!==_0x7fab('0x43')){var _0x5d1ce5={};_0x5d1ce5[_0x81bb79[_0x7fab('0x30')]]={'$like':'%'+_0x5be84e['query'][_0x7fab('0x42')]+'%'};return _0x5d1ce5;}})});}_0x4f8486=_['merge']({},_0x4f8486,_0x5be84e[_0x7fab('0x44')]);var _0xeb7d04={'where':_0x4f8486[_0x7fab('0x40')]};return db['VoiceQueueReport']['count'](_0xeb7d04)[_0x7fab('0x2d')](function(_0x584d32){_0x45934a[_0x7fab('0x26')]=_0x584d32;if(_0x5be84e[_0x7fab('0x38')][_0x7fab('0x45')]){_0x4f8486[_0x7fab('0x46')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x4f8486);})[_0x7fab('0x2d')](function(_0x47d8fe){_0x45934a[_0x7fab('0x47')]=_0x47d8fe;return _0x45934a;})['then'](respondWithFilteredResult(_0x488240,_0x4f8486))['catch'](handleError(_0x488240,null));};exports[_0x7fab('0x48')]=function(_0x421272,_0x38e2b7){var _0x508af8={'raw':![],'where':{'id':_0x421272[_0x7fab('0x49')]['id']}},_0x29ead8={};_0x29ead8[_0x7fab('0x36')]=_[_0x7fab('0x37')](db[_0x7fab('0x34')][_0x7fab('0x4a')]);_0x29ead8[_0x7fab('0x38')]=_[_0x7fab('0x37')](_0x421272['query']);_0x29ead8[_0x7fab('0x39')]=_[_0x7fab('0x3a')](_0x29ead8[_0x7fab('0x36')],_0x29ead8[_0x7fab('0x38')]);_0x508af8['attributes']=_[_0x7fab('0x3a')](_0x29ead8[_0x7fab('0x36')],qs[_0x7fab('0x3b')](_0x421272[_0x7fab('0x38')]['fields']));_0x508af8[_0x7fab('0x3c')]=_0x508af8['attributes'][_0x7fab('0x3d')]?_0x508af8[_0x7fab('0x3c')]:_0x29ead8[_0x7fab('0x36')];if(_0x421272[_0x7fab('0x38')]['includeAll']){_0x508af8[_0x7fab('0x46')]=[{'all':!![]}];}_0x508af8=_['merge']({},_0x508af8,_0x421272[_0x7fab('0x44')]);return db[_0x7fab('0x34')][_0x7fab('0x4b')](_0x508af8)['then'](handleEntityNotFound(_0x38e2b7,null))['then'](respondWithResult(_0x38e2b7,null))[_0x7fab('0x4c')](handleError(_0x38e2b7,null));};exports[_0x7fab('0x4d')]=function(_0x3578a3,_0x3be228){return db[_0x7fab('0x34')]['create'](_0x3578a3['body'],{})[_0x7fab('0x2d')](respondWithResult(_0x3be228,0xc9))[_0x7fab('0x4c')](handleError(_0x3be228,null));};exports[_0x7fab('0x2b')]=function(_0x2e65f4,_0x4fd624){if(_0x2e65f4['body']['id']){delete _0x2e65f4[_0x7fab('0x4e')]['id'];}return db[_0x7fab('0x34')]['find']({'where':{'id':_0x2e65f4[_0x7fab('0x49')]['id']}})[_0x7fab('0x2d')](handleEntityNotFound(_0x4fd624,null))[_0x7fab('0x2d')](saveUpdates(_0x2e65f4[_0x7fab('0x4e')],null))[_0x7fab('0x2d')](respondWithResult(_0x4fd624,null))[_0x7fab('0x4c')](handleError(_0x4fd624,null));};exports[_0x7fab('0x2c')]=function(_0x21a16d,_0x47e886){return db[_0x7fab('0x34')][_0x7fab('0x4b')]({'where':{'id':_0x21a16d['params']['id']}})[_0x7fab('0x2d')](handleEntityNotFound(_0x47e886,null))[_0x7fab('0x2d')](removeEntity(_0x47e886,null))[_0x7fab('0x4c')](handleError(_0x47e886,null));};exports[_0x7fab('0x4f')]=function(_0x394b4a,_0x310620){return db[_0x7fab('0x34')][_0x7fab('0x4f')]()['then'](respondWithResult(_0x310620,null))[_0x7fab('0x4c')](handleError(_0x310620,null));};exports['getVoiceQueuesReport']=function(_0x4dfb3f,_0x4c102a){var _0x2c1941={},_0xfb86a4={},_0x3eacff={'count':0x0,'rows':[]};_0xfb86a4['model']=_[_0x7fab('0x37')](db[_0x7fab('0x34')][_0x7fab('0x4a')]);_0xfb86a4[_0x7fab('0x38')]=_['keys'](_0x4dfb3f['query']);_0xfb86a4[_0x7fab('0x39')]=_[_0x7fab('0x3a')](_0xfb86a4[_0x7fab('0x36')],_0xfb86a4[_0x7fab('0x38')]);_0x2c1941[_0x7fab('0x3c')]=_[_0x7fab('0x3a')](_0xfb86a4[_0x7fab('0x36')],qs['fields'](_0x4dfb3f['query'][_0x7fab('0x3b')]));_0x2c1941['attributes']=_0x2c1941['attributes'][_0x7fab('0x3d')]?_0x2c1941[_0x7fab('0x3c')]:_0xfb86a4[_0x7fab('0x36')];if(!_0x4dfb3f['query'][_0x7fab('0x50')](_0x7fab('0x3e'))){_0x2c1941[_0x7fab('0x25')]=qs['limit'](_0x4dfb3f[_0x7fab('0x38')][_0x7fab('0x25')]);_0x2c1941[_0x7fab('0x23')]=qs[_0x7fab('0x23')](_0x4dfb3f[_0x7fab('0x38')][_0x7fab('0x23')]);}_0x2c1941[_0x7fab('0x3f')]=qs['sort'](_0x4dfb3f[_0x7fab('0x38')][_0x7fab('0x51')]);_0x2c1941[_0x7fab('0x40')]=qs[_0x7fab('0x39')](_[_0x7fab('0x41')](_0x4dfb3f[_0x7fab('0x38')],_0xfb86a4[_0x7fab('0x39')]));if(_0x4dfb3f['query'][_0x7fab('0x42')]){_0x2c1941[_0x7fab('0x40')]=_[_0x7fab('0x52')](_0x2c1941[_0x7fab('0x40')],{'$or':_[_0x7fab('0x33')](_0x2c1941[_0x7fab('0x3c')],function(_0x1ee55e){var _0x5aed2c={};_0x5aed2c[_0x1ee55e]={'$like':'%'+_0x4dfb3f[_0x7fab('0x38')]['filter']+'%'};return _0x5aed2c;})});}_0x2c1941=_['merge']({},_0x2c1941,_0x4dfb3f['options']);var _0xce7766={'where':_0x2c1941[_0x7fab('0x40')]};return db[_0x7fab('0x34')][_0x7fab('0x26')](_0xce7766)['then'](function(_0x2b0ffc){_0x3eacff[_0x7fab('0x26')]=_0x2b0ffc;if(_0x4dfb3f[_0x7fab('0x38')][_0x7fab('0x45')]){_0x2c1941[_0x7fab('0x46')]=[{'all':!![]}];}return db[_0x7fab('0x34')][_0x7fab('0x53')](_0x2c1941);})[_0x7fab('0x2d')](function(_0x1534d5){_0x3eacff[_0x7fab('0x47')]=_0x1534d5;return _0x3eacff;})[_0x7fab('0x2d')](respondWithFilteredResult(_0x4c102a,_0x2c1941,_0x7fab('0x54')))[_0x7fab('0x4c')](handleError(_0x4c102a,null,_0x7fab('0x54')));};
\ No newline at end of file
index fc05dc0..9a8166e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe4b=['hasOwnProperty','hook','exports','events','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0xbe4b,0x147));var _0xbbe4=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xbe4b[_0x199572];return _0x13cfa3;};'use strict';var EventEmitter=require(_0xbbe4('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xbbe4('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbbe4('0x2')](0x0);var events={'afterCreate':_0xbbe4('0x3'),'afterUpdate':_0xbbe4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x272b8a){return function(_0x122bc8,_0x390d84,_0x1181a4){VoiceQueueReportEvents[_0xbbe4('0x5')](_0x272b8a+':'+_0x122bc8['id'],_0x122bc8);VoiceQueueReportEvents[_0xbbe4('0x5')](_0x272b8a,_0x122bc8);_0x1181a4(null);};}for(var e in events){if(events[_0xbbe4('0x6')](e)){var event=events[e];VoiceQueueReport[_0xbbe4('0x7')](e,emitEvent(event));}}module[_0xbbe4('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xa4d8=['hook','exports','VoiceQueueReport','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x24d03f,_0x34c2f2){var _0x2ee41c=function(_0x3c8ed3){while(--_0x3c8ed3){_0x24d03f['push'](_0x24d03f['shift']());}};_0x2ee41c(++_0x34c2f2);}(_0xa4d8,0x1bb));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x8a4d('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8a4d('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a4d('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3935e9){return function(_0x1457a2,_0x12b1ba,_0x37dc01){VoiceQueueReportEvents[_0x8a4d('0x3')](_0x3935e9+':'+_0x1457a2['id'],_0x1457a2);VoiceQueueReportEvents['emit'](_0x3935e9,_0x1457a2);_0x37dc01(null);};}for(var e in events){if(events[_0x8a4d('0x4')](e)){var event=events[e];VoiceQueueReport[_0x8a4d('0x5')](e,emitEvent(event));}}module[_0x8a4d('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
index 81bfc22..8426613 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa996=['api','moment','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x1668c5,_0x16170a){var _0x3e4e04=function(_0x2c6840){while(--_0x2c6840){_0x1668c5['push'](_0x1668c5['shift']());}};_0x3e4e04(++_0x16170a);}(_0xa996,0x11a));var _0x6a99=function(_0x53ec11,_0x45c7fc){_0x53ec11=_0x53ec11-0x0;var _0x637888=_0xa996[_0x53ec11];return _0x637888;};'use strict';var _=require(_0x6a99('0x0'));var util=require(_0x6a99('0x1'));var logger=require(_0x6a99('0x2'))(_0x6a99('0x3'));var moment=require(_0x6a99('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a99('0x5'));var rimraf=require(_0x6a99('0x6'));var config=require(_0x6a99('0x7'));var attributes=require(_0x6a99('0x8'));module[_0x6a99('0x9')]=function(_0x5b9e1e,_0x2b45d8){return _0x5b9e1e[_0x6a99('0xa')](_0x6a99('0xb'),attributes,{'tableName':_0x6a99('0xc'),'paranoid':![],'indexes':[{'fields':[_0x6a99('0xd')]},{'fields':[_0x6a99('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xca3a=['rimraf','../../config/environment','./voiceQueueReport.attributes','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e8b79,_0xe14d4e){var _0xbf7bc0=function(_0x13fbb0){while(--_0x13fbb0){_0x5e8b79['push'](_0x5e8b79['shift']());}};_0xbf7bc0(++_0xe14d4e);}(_0xca3a,0xbc));var _0xaca3=function(_0xb3af2,_0x3a4875){_0xb3af2=_0xb3af2-0x0;var _0x225538=_0xca3a[_0xb3af2];return _0x225538;};'use strict';var _=require(_0xaca3('0x0'));var util=require(_0xaca3('0x1'));var logger=require(_0xaca3('0x2'))(_0xaca3('0x3'));var moment=require(_0xaca3('0x4'));var BPromise=require(_0xaca3('0x5'));var rp=require(_0xaca3('0x6'));var fs=require('fs');var path=require(_0xaca3('0x7'));var rimraf=require(_0xaca3('0x8'));var config=require(_0xaca3('0x9'));var attributes=require(_0xaca3('0xa'));module['exports']=function(_0x670182,_0xda4723){return _0x670182['define']('VoiceQueueReport',attributes,{'tableName':_0xaca3('0xb'),'paranoid':![],'indexes':[{'fields':[_0xaca3('0xc')]},{'fields':[_0xaca3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 82db1e1..7bd7777 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba53=['then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','./voiceQueueReport.socket','register'];(function(_0x58384b,_0xc9dc35){var _0x4f039f=function(_0x413651){while(--_0x413651){_0x58384b['push'](_0x58384b['shift']());}};_0x4f039f(++_0xc9dc35);}(_0xba53,0x1d1));var _0x3ba5=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xba53[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x3ba5('0x0'));var util=require('util');var moment=require(_0x3ba5('0x1'));var BPromise=require(_0x3ba5('0x2'));var rs=require(_0x3ba5('0x3'));var fs=require('fs');var Redis=require(_0x3ba5('0x4'));var db=require(_0x3ba5('0x5'))['db'];var utils=require(_0x3ba5('0x6'));var logger=require('../../config/logger')(_0x3ba5('0x7'));var config=require(_0x3ba5('0x8'));var jayson=require(_0x3ba5('0x9'));var client=jayson[_0x3ba5('0xa')]['http']({'port':0x232a});config[_0x3ba5('0xb')]=_['defaults'](config[_0x3ba5('0xb')],{'host':_0x3ba5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ba5('0xb')]));require(_0x3ba5('0xd'))[_0x3ba5('0xe')](socket);function respondWithRpcPromise(_0x426539,_0x402ef6,_0x1cd029){return new BPromise(function(_0x4aca35,_0x3c84da){return client['request'](_0x426539,_0x1cd029)[_0x3ba5('0xf')](function(_0x711c5f){logger['info'](_0x3ba5('0x10'),_0x402ef6,_0x3ba5('0x11'));logger[_0x3ba5('0x12')](_0x3ba5('0x13'),_0x402ef6,'request\x20sent',JSON['stringify'](_0x711c5f));if(_0x711c5f['error']){if(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x15')]===0x1f4){logger['error'](_0x3ba5('0x10'),_0x402ef6,_0x711c5f['error'][_0x3ba5('0x16')]);return _0x3c84da(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x16')]);}logger['error'](_0x3ba5('0x10'),_0x402ef6,_0x711c5f[_0x3ba5('0x14')]['message']);return _0x4aca35(_0x711c5f[_0x3ba5('0x14')][_0x3ba5('0x16')]);}else{logger[_0x3ba5('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x402ef6,'request\x20sent');_0x4aca35(_0x711c5f['result'][_0x3ba5('0x16')]);}})[_0x3ba5('0x18')](function(_0x411065){logger[_0x3ba5('0x14')](_0x3ba5('0x10'),_0x402ef6,_0x411065);_0x3c84da(_0x411065);});});}exports['GetVoiceQueueReport']=function(_0x322e92){var _0x392dcf=this;return new Promise(function(_0x4033f6,_0x2eebe8){return db[_0x3ba5('0x19')][_0x3ba5('0x1a')]({'raw':_0x322e92['options']?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1c')]===undefined?!![]:![]:!![],'where':_0x322e92[_0x3ba5('0x1b')]?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1d')]||null:null,'attributes':_0x322e92[_0x3ba5('0x1b')]?_0x322e92['options'][_0x3ba5('0x1e')]||null:null,'limit':_0x322e92['options']?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x1f')]||null:null,'include':_0x322e92[_0x3ba5('0x1b')]?_0x322e92[_0x3ba5('0x1b')][_0x3ba5('0x20')]?_[_0x3ba5('0x21')](_0x322e92['options'][_0x3ba5('0x20')],function(_0x26945f){return{'model':db[_0x26945f[_0x3ba5('0x22')]],'as':_0x26945f['as'],'attributes':_0x26945f[_0x3ba5('0x1e')],'include':_0x26945f['include']?_[_0x3ba5('0x21')](_0x26945f['include'],function(_0x2e20be){return{'model':db[_0x2e20be['model']],'as':_0x2e20be['as'],'attributes':_0x2e20be['attributes'],'include':_0x2e20be['include']?_['map'](_0x2e20be[_0x3ba5('0x20')],function(_0x2cac8b){return{'model':db[_0x2cac8b[_0x3ba5('0x22')]],'as':_0x2cac8b['as'],'attributes':_0x2cac8b['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ba5('0xf')](function(_0x15ed5e){logger['info'](_0x3ba5('0x23'),_0x322e92);logger['debug'](_0x3ba5('0x23'),_0x322e92,JSON[_0x3ba5('0x24')](_0x15ed5e));_0x4033f6(_0x15ed5e);})[_0x3ba5('0x18')](function(_0x9a1908){logger[_0x3ba5('0x14')]('GetVoiceQueueReport',_0x9a1908[_0x3ba5('0x16')],_0x322e92);_0x2eebe8(_0x392dcf['error'](0x1f4,_0x9a1908['message']));});});};exports[_0x3ba5('0x25')]=function(_0x5ef791){var _0x49bc80=this;return new Promise(function(_0x375684,_0x49a89b){return db['VoiceQueueReport']['create'](_0x5ef791[_0x3ba5('0x26')],{'raw':_0x5ef791[_0x3ba5('0x1b')]?_0x5ef791[_0x3ba5('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3ba5('0xf')](function(_0x2595a6){logger['info'](_0x3ba5('0x25'),_0x5ef791);logger[_0x3ba5('0x12')](_0x3ba5('0x25'),_0x5ef791,JSON['stringify'](_0x2595a6));_0x375684(_0x2595a6);})[_0x3ba5('0x18')](function(_0x44b240){logger[_0x3ba5('0x14')](_0x3ba5('0x25'),_0x44b240[_0x3ba5('0x16')],_0x5ef791);_0x49a89b(_0x49bc80[_0x3ba5('0x14')](0x1f4,_0x44b240['message']));});});};exports[_0x3ba5('0x27')]=function(_0x576324){var _0x49c723=this;return new Promise(function(_0x3014eb,_0x221542){return db['VoiceQueueReport']['update'](_0x576324[_0x3ba5('0x26')],{'raw':_0x576324['options']?_0x576324[_0x3ba5('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576324['options']?_0x576324['options'][_0x3ba5('0x1d')]||null:null,'attributes':_0x576324[_0x3ba5('0x1b')]?_0x576324[_0x3ba5('0x1b')][_0x3ba5('0x1e')]||null:null,'limit':_0x576324[_0x3ba5('0x1b')]?_0x576324[_0x3ba5('0x1b')][_0x3ba5('0x1f')]||null:null})['then'](function(_0x521b49){logger[_0x3ba5('0x17')]('UpdateVoiceQueueReport',_0x576324);logger['debug'](_0x3ba5('0x27'),_0x576324,JSON['stringify'](_0x521b49));_0x3014eb(_0x521b49);})[_0x3ba5('0x18')](function(_0x56b4ea){logger[_0x3ba5('0x14')](_0x3ba5('0x27'),_0x56b4ea[_0x3ba5('0x16')],_0x576324);_0x221542(_0x49c723[_0x3ba5('0x14')](0x1f4,_0x56b4ea['message']));});});};
\ No newline at end of file
+var _0xf04e=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','where','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x327c2f,_0x429eb1){var _0xe1d1dc=function(_0x38fe96){while(--_0x38fe96){_0x327c2f['push'](_0x327c2f['shift']());}};_0xe1d1dc(++_0x429eb1);}(_0xf04e,0x72));var _0xef04=function(_0x17f98e,_0x51e6ba){_0x17f98e=_0x17f98e-0x0;var _0x5418e2=_0xf04e[_0x17f98e];return _0x5418e2;};'use strict';var _=require('lodash');var util=require(_0xef04('0x0'));var moment=require(_0xef04('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef04('0x2'));var db=require(_0xef04('0x3'))['db'];var utils=require(_0xef04('0x4'));var logger=require(_0xef04('0x5'))(_0xef04('0x6'));var config=require('../../config/environment');var jayson=require(_0xef04('0x7'));var client=jayson['client'][_0xef04('0x8')]({'port':0x232a});config[_0xef04('0x9')]=_[_0xef04('0xa')](config['redis'],{'host':_0xef04('0xb'),'port':0x18eb});var socket=require(_0xef04('0xc'))(new Redis(config[_0xef04('0x9')]));require(_0xef04('0xd'))['register'](socket);function respondWithRpcPromise(_0x1c70a,_0x23ee75,_0x4f872e){return new BPromise(function(_0x49f483,_0xc8e702){return client[_0xef04('0xe')](_0x1c70a,_0x4f872e)[_0xef04('0xf')](function(_0x196822){logger[_0xef04('0x10')](_0xef04('0x11'),_0x23ee75,'request\x20sent');logger[_0xef04('0x12')](_0xef04('0x13'),_0x23ee75,_0xef04('0x14'),JSON[_0xef04('0x15')](_0x196822));if(_0x196822['error']){if(_0x196822[_0xef04('0x16')][_0xef04('0x17')]===0x1f4){logger[_0xef04('0x16')](_0xef04('0x11'),_0x23ee75,_0x196822[_0xef04('0x16')][_0xef04('0x18')]);return _0xc8e702(_0x196822['error'][_0xef04('0x18')]);}logger[_0xef04('0x16')](_0xef04('0x11'),_0x23ee75,_0x196822[_0xef04('0x16')][_0xef04('0x18')]);return _0x49f483(_0x196822['error'][_0xef04('0x18')]);}else{logger[_0xef04('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x23ee75,_0xef04('0x14'));_0x49f483(_0x196822['result'][_0xef04('0x18')]);}})[_0xef04('0x19')](function(_0x56d8b1){logger[_0xef04('0x16')](_0xef04('0x11'),_0x23ee75,_0x56d8b1);_0xc8e702(_0x56d8b1);});});}exports[_0xef04('0x1a')]=function(_0x561e93){var _0x169d15=this;return new Promise(function(_0x7de42e,_0xf92680){return db[_0xef04('0x1b')][_0xef04('0x1c')]({'raw':_0x561e93[_0xef04('0x1d')]?_0x561e93[_0xef04('0x1d')][_0xef04('0x1e')]===undefined?!![]:![]:!![],'where':_0x561e93[_0xef04('0x1d')]?_0x561e93[_0xef04('0x1d')]['where']||null:null,'attributes':_0x561e93[_0xef04('0x1d')]?_0x561e93[_0xef04('0x1d')][_0xef04('0x1f')]||null:null,'limit':_0x561e93[_0xef04('0x1d')]?_0x561e93['options']['limit']||null:null,'include':_0x561e93['options']?_0x561e93[_0xef04('0x1d')][_0xef04('0x20')]?_[_0xef04('0x21')](_0x561e93[_0xef04('0x1d')][_0xef04('0x20')],function(_0x559392){return{'model':db[_0x559392[_0xef04('0x22')]],'as':_0x559392['as'],'attributes':_0x559392[_0xef04('0x1f')],'include':_0x559392[_0xef04('0x20')]?_[_0xef04('0x21')](_0x559392[_0xef04('0x20')],function(_0x587b8f){return{'model':db[_0x587b8f[_0xef04('0x22')]],'as':_0x587b8f['as'],'attributes':_0x587b8f[_0xef04('0x1f')],'include':_0x587b8f['include']?_[_0xef04('0x21')](_0x587b8f[_0xef04('0x20')],function(_0x48d7d7){return{'model':db[_0x48d7d7[_0xef04('0x22')]],'as':_0x48d7d7['as'],'attributes':_0x48d7d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4edeb1){logger[_0xef04('0x10')]('GetVoiceQueueReport',_0x561e93);logger['debug'](_0xef04('0x1a'),_0x561e93,JSON[_0xef04('0x15')](_0x4edeb1));_0x7de42e(_0x4edeb1);})[_0xef04('0x19')](function(_0xeb5d22){logger[_0xef04('0x16')](_0xef04('0x1a'),_0xeb5d22[_0xef04('0x18')],_0x561e93);_0xf92680(_0x169d15[_0xef04('0x16')](0x1f4,_0xeb5d22[_0xef04('0x18')]));});});};exports[_0xef04('0x23')]=function(_0x2e5aa1){var _0x57d61d=this;return new Promise(function(_0x107b20,_0x257d8c){return db[_0xef04('0x1b')]['create'](_0x2e5aa1[_0xef04('0x24')],{'raw':_0x2e5aa1[_0xef04('0x1d')]?_0x2e5aa1['options'][_0xef04('0x1e')]===undefined?!![]:![]:!![]})[_0xef04('0xf')](function(_0x276c35){logger[_0xef04('0x10')]('CreateVoiceQueueReport',_0x2e5aa1);logger[_0xef04('0x12')](_0xef04('0x23'),_0x2e5aa1,JSON[_0xef04('0x15')](_0x276c35));_0x107b20(_0x276c35);})[_0xef04('0x19')](function(_0x39fa88){logger[_0xef04('0x16')](_0xef04('0x23'),_0x39fa88[_0xef04('0x18')],_0x2e5aa1);_0x257d8c(_0x57d61d['error'](0x1f4,_0x39fa88['message']));});});};exports[_0xef04('0x25')]=function(_0x4ed8fe){var _0x3d9be1=this;return new Promise(function(_0xa5fa93,_0x48a271){return db[_0xef04('0x1b')][_0xef04('0x26')](_0x4ed8fe['body'],{'raw':_0x4ed8fe['options']?_0x4ed8fe[_0xef04('0x1d')][_0xef04('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ed8fe[_0xef04('0x1d')]?_0x4ed8fe[_0xef04('0x1d')][_0xef04('0x27')]||null:null,'attributes':_0x4ed8fe['options']?_0x4ed8fe[_0xef04('0x1d')]['attributes']||null:null,'limit':_0x4ed8fe[_0xef04('0x1d')]?_0x4ed8fe[_0xef04('0x1d')][_0xef04('0x28')]||null:null})['then'](function(_0x837c7b){logger[_0xef04('0x10')](_0xef04('0x25'),_0x4ed8fe);logger[_0xef04('0x12')](_0xef04('0x25'),_0x4ed8fe,JSON[_0xef04('0x15')](_0x837c7b));_0xa5fa93(_0x837c7b);})[_0xef04('0x19')](function(_0x583762){logger['error'](_0xef04('0x25'),_0x583762[_0xef04('0x18')],_0x4ed8fe);_0x48a271(_0x3d9be1[_0xef04('0x16')](0x1f4,_0x583762[_0xef04('0x18')]));});});};
\ No newline at end of file
index 770c9cb..9e9c330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf0=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','removeListener','register'];(function(_0x216c16,_0x46dc09){var _0x50f07b=function(_0x1f98fe){while(--_0x1f98fe){_0x216c16['push'](_0x216c16['shift']());}};_0x50f07b(++_0x46dc09);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x2c87d9,_0x37b6fd){_0x2c87d9=_0x2c87d9-0x0;var _0xd49741=_0xdcf0[_0x2c87d9];return _0xd49741;};'use strict';var VoiceQueueReportEvents=require(_0x0dcf('0x0'));var events=[_0x0dcf('0x1'),'remove',_0x0dcf('0x2')];function createListener(_0x4390bb,_0x53ce12){return function(_0x41aea7){_0x53ce12['emit'](_0x4390bb,_0x41aea7);};}function removeListener(_0x4b1323,_0x388fc3){return function(){VoiceQueueReportEvents[_0x0dcf('0x3')](_0x4b1323,_0x388fc3);};}exports[_0x0dcf('0x4')]=function(_0x2586c8){for(var _0x1367df=0x0,_0x598cf5=events[_0x0dcf('0x5')];_0x1367df<_0x598cf5;_0x1367df++){var _0x4ea8e2=events[_0x1367df];var _0x37871c=createListener(_0x0dcf('0x6')+_0x4ea8e2,_0x2586c8);VoiceQueueReportEvents['on'](_0x4ea8e2,_0x37871c);}};
\ No newline at end of file
+var _0xc932=['register','length','./voiceQueueReport.events','update','emit'];(function(_0x2185f9,_0x2bcfd1){var _0x7e9acd=function(_0x5a4ef3){while(--_0x5a4ef3){_0x2185f9['push'](_0x2185f9['shift']());}};_0x7e9acd(++_0x2bcfd1);}(_0xc932,0x18d));var _0x2c93=function(_0x27842c,_0x324fcb){_0x27842c=_0x27842c-0x0;var _0x493de8=_0xc932[_0x27842c];return _0x493de8;};'use strict';var VoiceQueueReportEvents=require(_0x2c93('0x0'));var events=['save','remove',_0x2c93('0x1')];function createListener(_0x4f320a,_0x4f2552){return function(_0x2b8a4f){_0x4f2552[_0x2c93('0x2')](_0x4f320a,_0x2b8a4f);};}function removeListener(_0x58f555,_0x486bd3){return function(){VoiceQueueReportEvents['removeListener'](_0x58f555,_0x486bd3);};}exports[_0x2c93('0x3')]=function(_0x4258e9){for(var _0x3fd3fa=0x0,_0x49871c=events[_0x2c93('0x4')];_0x3fd3fa<_0x49871c;_0x3fd3fa++){var _0x386ef5=events[_0x3fd3fa];var _0x1a0150=createListener('voiceQueueReport:'+_0x386ef5,_0x4258e9);VoiceQueueReportEvents['on'](_0x386ef5,_0x1a0150);}};
\ No newline at end of file
index b585728..b052e1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53a2=['destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','show','post','create','/:id','delete'];(function(_0x36ffbf,_0x170a71){var _0x568c7d=function(_0x4ac6e9){while(--_0x4ac6e9){_0x36ffbf['push'](_0x36ffbf['shift']());}};_0x568c7d(++_0x170a71);}(_0x53a2,0x1ab));var _0x253a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x53a2[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x253a('0x0'));var path=require('path');var timeout=require(_0x253a('0x1'));var express=require(_0x253a('0x2'));var router=express[_0x253a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x253a('0x4'));var interaction=require(_0x253a('0x5'));var config=require(_0x253a('0x6'));var controller=require(_0x253a('0x7'));router[_0x253a('0x8')]('/',auth[_0x253a('0x9')](),controller['index']);router[_0x253a('0x8')]('/:id',auth[_0x253a('0x9')](),controller[_0x253a('0xa')]);router[_0x253a('0xb')]('/',auth[_0x253a('0x9')](),controller[_0x253a('0xc')]);router['put'](_0x253a('0xd'),auth[_0x253a('0x9')](),controller['update']);router[_0x253a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x253a('0xf')]);module[_0x253a('0x10')]=router;
\ No newline at end of file
+var _0xd5af=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x24422f,_0xb8a57){var _0x3bcaa4=function(_0x1aa148){while(--_0x1aa148){_0x24422f['push'](_0x24422f['shift']());}};_0x3bcaa4(++_0xb8a57);}(_0xd5af,0x1d5));var _0xfd5a=function(_0x32cd34,_0x26dcae){_0x32cd34=_0x32cd34-0x0;var _0x46c94c=_0xd5af[_0x32cd34];return _0x46c94c;};'use strict';var multer=require(_0xfd5a('0x0'));var util=require(_0xfd5a('0x1'));var path=require('path');var timeout=require(_0xfd5a('0x2'));var express=require(_0xfd5a('0x3'));var router=express[_0xfd5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfd5a('0x5'));var interaction=require(_0xfd5a('0x6'));var config=require('../../config/environment');var controller=require(_0xfd5a('0x7'));router[_0xfd5a('0x8')]('/',auth[_0xfd5a('0x9')](),controller['index']);router['get'](_0xfd5a('0xa'),auth['isAuthenticated'](),controller[_0xfd5a('0xb')]);router[_0xfd5a('0xc')]('/',auth[_0xfd5a('0x9')](),controller[_0xfd5a('0xd')]);router[_0xfd5a('0xe')](_0xfd5a('0xa'),auth[_0xfd5a('0x9')](),controller[_0xfd5a('0xf')]);router[_0xfd5a('0x10')](_0xfd5a('0xa'),auth[_0xfd5a('0x9')](),controller['destroy']);module[_0xfd5a('0x11')]=router;
\ No newline at end of file
index 95b6ed1..794064d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a5=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x5a83f7,_0x5e5404){var _0x2ab43b=function(_0x1352f9){while(--_0x1352f9){_0x5a83f7['push'](_0x5a83f7['shift']());}};_0x2ab43b(++_0x5e5404);}(_0x43a5,0x196));var _0x543a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x43a5[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x543a('0x0'));module[_0x543a('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x543a('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x543a('0x3')],'allowNull':![],'defaultValue':moment()[_0x543a('0x4')](_0x543a('0x5'))}};
\ No newline at end of file
+var _0x2488=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x508448,_0x38fb59){var _0x5cc2a2=function(_0x18e5b4){while(--_0x18e5b4){_0x508448['push'](_0x508448['shift']());}};_0x5cc2a2(++_0x38fb59);}(_0x2488,0xaa));var _0x8248=function(_0x5be484,_0x3180c6){_0x5be484=_0x5be484-0x0;var _0x45eade=_0x2488[_0x5be484];return _0x45eade;};'use strict';var Sequelize=require(_0x8248('0x0'));var moment=require(_0x8248('0x1'));module[_0x8248('0x2')]={'time':{'type':Sequelize[_0x8248('0x3')]},'callid':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8248('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8248('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x8248('0x5'))}};
\ No newline at end of file
index 402d803..2bf7e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d61=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','save','update','then','destroy','error','stack','name','index','map','VoiceQueuesLog','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x2d61,0x1bd));var _0x12d6=function(_0x319999,_0x26042c){_0x319999=_0x319999-0x0;var _0xc46ca4=_0x2d61[_0x319999];return _0xc46ca4;};'use strict';var emlformat=require(_0x12d6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12d6('0x1'));var jsonpatch=require(_0x12d6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x12d6('0x3'));var Mustache=require(_0x12d6('0x4'));var util=require(_0x12d6('0x5'));var path=require(_0x12d6('0x6'));var sox=require(_0x12d6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12d6('0x8'));var squel=require(_0x12d6('0x9'));var crypto=require(_0x12d6('0xa'));var jsforce=require(_0x12d6('0xb'));var deskjs=require(_0x12d6('0xc'));var toCsv=require(_0x12d6('0xd'));var querystring=require(_0x12d6('0xe'));var Papa=require(_0x12d6('0xf'));var Redis=require(_0x12d6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x12d6('0x11'));var as=require(_0x12d6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12d6('0x13'))('api');var utils=require(_0x12d6('0x14'));var config=require(_0x12d6('0x15'));var licenseUtil=require(_0x12d6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23c0c1,_0x2729d1){_0x2729d1=_0x2729d1||0xcc;return function(_0x2ddc8a){if(_0x2ddc8a){return _0x23c0c1[_0x12d6('0x17')](_0x2729d1);}return _0x23c0c1[_0x12d6('0x18')](_0x2729d1)['end']();};}function respondWithResult(_0x3388e3,_0x1beb2c){_0x1beb2c=_0x1beb2c||0xc8;return function(_0xa66c62){if(_0xa66c62){return _0x3388e3[_0x12d6('0x18')](_0x1beb2c)[_0x12d6('0x19')](_0xa66c62);}};}function respondWithFilteredResult(_0x33f252,_0x5c8d5e){return function(_0x3bd0d2){if(_0x3bd0d2){var _0x2cf4bc=typeof _0x5c8d5e[_0x12d6('0x1a')]===_0x12d6('0x1b')&&typeof _0x5c8d5e['limit']===_0x12d6('0x1b');var _0x1a29cc=_0x3bd0d2[_0x12d6('0x1c')];var _0x5e13c0=_0x2cf4bc?0x0:_0x5c8d5e[_0x12d6('0x1a')];var _0x30933c=_0x2cf4bc?_0x3bd0d2['count']:_0x5c8d5e[_0x12d6('0x1a')]+_0x5c8d5e[_0x12d6('0x1d')];var _0x1272b6;if(_0x30933c>=_0x1a29cc){_0x30933c=_0x1a29cc;_0x1272b6=0xc8;}else{_0x1272b6=0xce;}_0x33f252['status'](_0x1272b6);return _0x33f252['set']('Content-Range',_0x5e13c0+'-'+_0x30933c+'/'+_0x1a29cc)[_0x12d6('0x19')](_0x3bd0d2);}return null;};}function patchUpdates(_0x2adace){return function(_0x463d98){try{jsonpatch['apply'](_0x463d98,_0x2adace,!![]);}catch(_0xe2ead5){return BPromise['reject'](_0xe2ead5);}return _0x463d98[_0x12d6('0x1e')]();};}function saveUpdates(_0x3fcb8d,_0xab628a){return function(_0x77aefd){if(_0x77aefd){return _0x77aefd[_0x12d6('0x1f')](_0x3fcb8d)[_0x12d6('0x20')](function(_0x3575ff){return _0x3575ff;});}return null;};}function removeEntity(_0x1f30d4,_0xd508f7){return function(_0x38f110){if(_0x38f110){return _0x38f110[_0x12d6('0x21')]()[_0x12d6('0x20')](function(){_0x1f30d4[_0x12d6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b79d7,_0x24dc93){return function(_0x371fdd){if(!_0x371fdd){_0x1b79d7[_0x12d6('0x17')](0x194);}return _0x371fdd;};}function handleError(_0x1921d7,_0x3df137){_0x3df137=_0x3df137||0x1f4;return function(_0x2e8fa7){logger[_0x12d6('0x22')](_0x2e8fa7[_0x12d6('0x23')]);if(_0x2e8fa7[_0x12d6('0x24')]){delete _0x2e8fa7[_0x12d6('0x24')];}_0x1921d7['status'](_0x3df137)['send'](_0x2e8fa7);};}exports[_0x12d6('0x25')]=function(_0x6533a1,_0xd21d8c){var _0x5af2ab={},_0xff4806={},_0x120340={'count':0x0,'rows':[]};var _0x551ef0=_[_0x12d6('0x26')](db[_0x12d6('0x27')][_0x12d6('0x28')],function(_0x1a226e){return{'name':_0x1a226e['fieldName'],'type':_0x1a226e[_0x12d6('0x29')]['key']};});_0xff4806[_0x12d6('0x2a')]=_[_0x12d6('0x26')](_0x551ef0,_0x12d6('0x24'));_0xff4806[_0x12d6('0x2b')]=_['keys'](_0x6533a1[_0x12d6('0x2b')]);_0xff4806[_0x12d6('0x2c')]=_[_0x12d6('0x2d')](_0xff4806[_0x12d6('0x2a')],_0xff4806['query']);_0x5af2ab[_0x12d6('0x2e')]=_['intersection'](_0xff4806[_0x12d6('0x2a')],qs[_0x12d6('0x2f')](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x2f')]));_0x5af2ab[_0x12d6('0x2e')]=_0x5af2ab[_0x12d6('0x2e')][_0x12d6('0x30')]?_0x5af2ab[_0x12d6('0x2e')]:_0xff4806[_0x12d6('0x2a')];if(!_0x6533a1[_0x12d6('0x2b')]['hasOwnProperty'](_0x12d6('0x31'))){_0x5af2ab[_0x12d6('0x1d')]=qs[_0x12d6('0x1d')](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x1d')]);_0x5af2ab['offset']=qs[_0x12d6('0x1a')](_0x6533a1['query']['offset']);}_0x5af2ab[_0x12d6('0x32')]=qs['sort'](_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x33')]);_0x5af2ab['where']=qs[_0x12d6('0x2c')](_['pick'](_0x6533a1[_0x12d6('0x2b')],_0xff4806[_0x12d6('0x2c')]),_0x551ef0);if(_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x34')]){_0x5af2ab[_0x12d6('0x35')]=_[_0x12d6('0x36')](_0x5af2ab[_0x12d6('0x35')],{'$or':_[_0x12d6('0x26')](_0x551ef0,function(_0x1f0c29){if(_0x1f0c29[_0x12d6('0x29')]!==_0x12d6('0x37')){var _0x125e77={};_0x125e77[_0x1f0c29['name']]={'$like':'%'+_0x6533a1[_0x12d6('0x2b')]['filter']+'%'};return _0x125e77;}})});}_0x5af2ab=_['merge']({},_0x5af2ab,_0x6533a1[_0x12d6('0x38')]);var _0x4b61af={'where':_0x5af2ab[_0x12d6('0x35')]};return db[_0x12d6('0x27')]['count'](_0x4b61af)[_0x12d6('0x20')](function(_0x195de7){_0x120340[_0x12d6('0x1c')]=_0x195de7;if(_0x6533a1[_0x12d6('0x2b')][_0x12d6('0x39')]){_0x5af2ab[_0x12d6('0x3a')]=[{'all':!![]}];}return db[_0x12d6('0x27')]['findAll'](_0x5af2ab);})[_0x12d6('0x20')](function(_0x419496){_0x120340[_0x12d6('0x3b')]=_0x419496;return _0x120340;})[_0x12d6('0x20')](respondWithFilteredResult(_0xd21d8c,_0x5af2ab))[_0x12d6('0x3c')](handleError(_0xd21d8c,null));};exports['show']=function(_0x5a3a38,_0x245371){var _0x3d3380={'raw':!![],'where':{'id':_0x5a3a38[_0x12d6('0x3d')]['id']}},_0x584005={};_0x584005['model']=_[_0x12d6('0x3e')](db[_0x12d6('0x27')]['rawAttributes']);_0x584005[_0x12d6('0x2b')]=_[_0x12d6('0x3e')](_0x5a3a38[_0x12d6('0x2b')]);_0x584005[_0x12d6('0x2c')]=_[_0x12d6('0x2d')](_0x584005['model'],_0x584005['query']);_0x3d3380[_0x12d6('0x2e')]=_[_0x12d6('0x2d')](_0x584005[_0x12d6('0x2a')],qs[_0x12d6('0x2f')](_0x5a3a38['query'][_0x12d6('0x2f')]));_0x3d3380['attributes']=_0x3d3380['attributes'][_0x12d6('0x30')]?_0x3d3380[_0x12d6('0x2e')]:_0x584005[_0x12d6('0x2a')];if(_0x5a3a38['query']['includeAll']){_0x3d3380['include']=[{'all':!![]}];}_0x3d3380=_['merge']({},_0x3d3380,_0x5a3a38[_0x12d6('0x38')]);return db[_0x12d6('0x27')][_0x12d6('0x3f')](_0x3d3380)[_0x12d6('0x20')](handleEntityNotFound(_0x245371,null))[_0x12d6('0x20')](respondWithResult(_0x245371,null))[_0x12d6('0x3c')](handleError(_0x245371,null));};exports['create']=function(_0x4f6dd0,_0x2b7182){return db[_0x12d6('0x27')]['create'](_0x4f6dd0[_0x12d6('0x40')],{})['then'](respondWithResult(_0x2b7182,0xc9))[_0x12d6('0x3c')](handleError(_0x2b7182,null));};exports['update']=function(_0x5e0215,_0x1c2539){if(_0x5e0215[_0x12d6('0x40')]['id']){delete _0x5e0215[_0x12d6('0x40')]['id'];}return db[_0x12d6('0x27')]['find']({'where':{'id':_0x5e0215['params']['id']}})['then'](handleEntityNotFound(_0x1c2539,null))[_0x12d6('0x20')](saveUpdates(_0x5e0215[_0x12d6('0x40')],null))['then'](respondWithResult(_0x1c2539,null))[_0x12d6('0x3c')](handleError(_0x1c2539,null));};exports[_0x12d6('0x21')]=function(_0x408aa3,_0x4a9f13){return db[_0x12d6('0x27')]['find']({'where':{'id':_0x408aa3['params']['id']}})[_0x12d6('0x20')](handleEntityNotFound(_0x4a9f13,null))[_0x12d6('0x20')](removeEntity(_0x4a9f13,null))['catch'](handleError(_0x4a9f13,null));};
\ No newline at end of file
+var _0xe195=['offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','keys','includeAll','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe195,0x7b));var _0x5e19=function(_0x4d1586,_0x18c790){_0x4d1586=_0x4d1586-0x0;var _0x5625bc=_0xe195[_0x4d1586];return _0x5625bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e19('0x0'));var zipdir=require(_0x5e19('0x1'));var jsonpatch=require(_0x5e19('0x2'));var rp=require(_0x5e19('0x3'));var moment=require(_0x5e19('0x4'));var BPromise=require(_0x5e19('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5e19('0x6'));var csv=require('to-csv');var ejs=require(_0x5e19('0x7'));var fs=require('fs');var fs_extra=require(_0x5e19('0x8'));var _=require(_0x5e19('0x9'));var squel=require(_0x5e19('0xa'));var crypto=require('crypto');var jsforce=require(_0x5e19('0xb'));var deskjs=require(_0x5e19('0xc'));var toCsv=require(_0x5e19('0xd'));var querystring=require('querystring');var Papa=require(_0x5e19('0xe'));var Redis=require('ioredis');var authService=require(_0x5e19('0xf'));var qs=require(_0x5e19('0x10'));var as=require(_0x5e19('0x11'));var hardwareService=require(_0x5e19('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5e19('0x13'));var config=require(_0x5e19('0x14'));var licenseUtil=require(_0x5e19('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x139bf7,_0x289243){_0x289243=_0x289243||0xcc;return function(_0x3ebebe){if(_0x3ebebe){return _0x139bf7[_0x5e19('0x16')](_0x289243);}return _0x139bf7[_0x5e19('0x17')](_0x289243)[_0x5e19('0x18')]();};}function respondWithResult(_0x483b27,_0x195c91){_0x195c91=_0x195c91||0xc8;return function(_0x22a7e7){if(_0x22a7e7){return _0x483b27[_0x5e19('0x17')](_0x195c91)['json'](_0x22a7e7);}};}function respondWithFilteredResult(_0x269131,_0x26a7c0){return function(_0x32b834){if(_0x32b834){var _0x4fc737=typeof _0x26a7c0[_0x5e19('0x19')]==='undefined'&&typeof _0x26a7c0[_0x5e19('0x1a')]===_0x5e19('0x1b');var _0xe68a90=_0x32b834[_0x5e19('0x1c')];var _0x264728=_0x4fc737?0x0:_0x26a7c0[_0x5e19('0x19')];var _0x35173a=_0x4fc737?_0x32b834['count']:_0x26a7c0['offset']+_0x26a7c0[_0x5e19('0x1a')];var _0x5058d9;if(_0x35173a>=_0xe68a90){_0x35173a=_0xe68a90;_0x5058d9=0xc8;}else{_0x5058d9=0xce;}_0x269131['status'](_0x5058d9);return _0x269131[_0x5e19('0x1d')](_0x5e19('0x1e'),_0x264728+'-'+_0x35173a+'/'+_0xe68a90)[_0x5e19('0x1f')](_0x32b834);}return null;};}function patchUpdates(_0x56f474){return function(_0x2d0c43){try{jsonpatch[_0x5e19('0x20')](_0x2d0c43,_0x56f474,!![]);}catch(_0x5bd41f){return BPromise[_0x5e19('0x21')](_0x5bd41f);}return _0x2d0c43[_0x5e19('0x22')]();};}function saveUpdates(_0x2d5d56,_0x38492c){return function(_0x3d4561){if(_0x3d4561){return _0x3d4561[_0x5e19('0x23')](_0x2d5d56)[_0x5e19('0x24')](function(_0x55b453){return _0x55b453;});}return null;};}function removeEntity(_0x536c0d,_0x51a284){return function(_0x2c7025){if(_0x2c7025){return _0x2c7025[_0x5e19('0x25')]()[_0x5e19('0x24')](function(){_0x536c0d['status'](0xcc)[_0x5e19('0x18')]();});}};}function handleEntityNotFound(_0x153074,_0x2317db){return function(_0x5f2e57){if(!_0x5f2e57){_0x153074[_0x5e19('0x16')](0x194);}return _0x5f2e57;};}function handleError(_0x302d5f,_0x2cf1f6){_0x2cf1f6=_0x2cf1f6||0x1f4;return function(_0x5be982){logger[_0x5e19('0x26')](_0x5be982[_0x5e19('0x27')]);if(_0x5be982['name']){delete _0x5be982['name'];}_0x302d5f[_0x5e19('0x17')](_0x2cf1f6)['send'](_0x5be982);};}exports['index']=function(_0x250e15,_0x3ad288){var _0x27e1df={},_0x1e90d8={},_0x293997={'count':0x0,'rows':[]};var _0x49e5ef=_['map'](db[_0x5e19('0x28')][_0x5e19('0x29')],function(_0x451235){return{'name':_0x451235[_0x5e19('0x2a')],'type':_0x451235[_0x5e19('0x2b')][_0x5e19('0x2c')]};});_0x1e90d8[_0x5e19('0x2d')]=_[_0x5e19('0x2e')](_0x49e5ef,_0x5e19('0x2f'));_0x1e90d8[_0x5e19('0x30')]=_['keys'](_0x250e15[_0x5e19('0x30')]);_0x1e90d8[_0x5e19('0x31')]=_[_0x5e19('0x32')](_0x1e90d8[_0x5e19('0x2d')],_0x1e90d8['query']);_0x27e1df[_0x5e19('0x33')]=_[_0x5e19('0x32')](_0x1e90d8[_0x5e19('0x2d')],qs['fields'](_0x250e15[_0x5e19('0x30')][_0x5e19('0x34')]));_0x27e1df[_0x5e19('0x33')]=_0x27e1df[_0x5e19('0x33')][_0x5e19('0x35')]?_0x27e1df[_0x5e19('0x33')]:_0x1e90d8[_0x5e19('0x2d')];if(!_0x250e15[_0x5e19('0x30')][_0x5e19('0x36')](_0x5e19('0x37'))){_0x27e1df['limit']=qs['limit'](_0x250e15[_0x5e19('0x30')]['limit']);_0x27e1df[_0x5e19('0x19')]=qs[_0x5e19('0x19')](_0x250e15['query'][_0x5e19('0x19')]);}_0x27e1df[_0x5e19('0x38')]=qs[_0x5e19('0x39')](_0x250e15[_0x5e19('0x30')][_0x5e19('0x39')]);_0x27e1df[_0x5e19('0x3a')]=qs['filters'](_[_0x5e19('0x3b')](_0x250e15[_0x5e19('0x30')],_0x1e90d8[_0x5e19('0x31')]),_0x49e5ef);if(_0x250e15[_0x5e19('0x30')][_0x5e19('0x3c')]){_0x27e1df[_0x5e19('0x3a')]=_[_0x5e19('0x3d')](_0x27e1df[_0x5e19('0x3a')],{'$or':_[_0x5e19('0x2e')](_0x49e5ef,function(_0x2353ae){if(_0x2353ae['type']!==_0x5e19('0x3e')){var _0x17ecab={};_0x17ecab[_0x2353ae[_0x5e19('0x2f')]]={'$like':'%'+_0x250e15['query'][_0x5e19('0x3c')]+'%'};return _0x17ecab;}})});}_0x27e1df=_[_0x5e19('0x3d')]({},_0x27e1df,_0x250e15[_0x5e19('0x3f')]);var _0xbe0ccf={'where':_0x27e1df[_0x5e19('0x3a')]};return db[_0x5e19('0x28')][_0x5e19('0x1c')](_0xbe0ccf)['then'](function(_0x5f4ad3){_0x293997['count']=_0x5f4ad3;if(_0x250e15[_0x5e19('0x30')]['includeAll']){_0x27e1df[_0x5e19('0x40')]=[{'all':!![]}];}return db[_0x5e19('0x28')][_0x5e19('0x41')](_0x27e1df);})[_0x5e19('0x24')](function(_0x265ea4){_0x293997['rows']=_0x265ea4;return _0x293997;})['then'](respondWithFilteredResult(_0x3ad288,_0x27e1df))[_0x5e19('0x42')](handleError(_0x3ad288,null));};exports[_0x5e19('0x43')]=function(_0x11fdb6,_0x5e11c9){var _0x4a660a={'raw':!![],'where':{'id':_0x11fdb6['params']['id']}},_0x1824aa={};_0x1824aa['model']=_[_0x5e19('0x44')](db['VoiceQueuesLog'][_0x5e19('0x29')]);_0x1824aa['query']=_[_0x5e19('0x44')](_0x11fdb6[_0x5e19('0x30')]);_0x1824aa[_0x5e19('0x31')]=_[_0x5e19('0x32')](_0x1824aa[_0x5e19('0x2d')],_0x1824aa['query']);_0x4a660a[_0x5e19('0x33')]=_['intersection'](_0x1824aa[_0x5e19('0x2d')],qs[_0x5e19('0x34')](_0x11fdb6['query'][_0x5e19('0x34')]));_0x4a660a[_0x5e19('0x33')]=_0x4a660a[_0x5e19('0x33')][_0x5e19('0x35')]?_0x4a660a[_0x5e19('0x33')]:_0x1824aa[_0x5e19('0x2d')];if(_0x11fdb6[_0x5e19('0x30')][_0x5e19('0x45')]){_0x4a660a[_0x5e19('0x40')]=[{'all':!![]}];}_0x4a660a=_[_0x5e19('0x3d')]({},_0x4a660a,_0x11fdb6[_0x5e19('0x3f')]);return db['VoiceQueuesLog'][_0x5e19('0x46')](_0x4a660a)[_0x5e19('0x24')](handleEntityNotFound(_0x5e11c9,null))[_0x5e19('0x24')](respondWithResult(_0x5e11c9,null))['catch'](handleError(_0x5e11c9,null));};exports[_0x5e19('0x47')]=function(_0x2e4cb0,_0x477461){return db['VoiceQueuesLog'][_0x5e19('0x47')](_0x2e4cb0['body'],{})[_0x5e19('0x24')](respondWithResult(_0x477461,0xc9))['catch'](handleError(_0x477461,null));};exports[_0x5e19('0x23')]=function(_0x39e791,_0x47244e){if(_0x39e791[_0x5e19('0x48')]['id']){delete _0x39e791['body']['id'];}return db[_0x5e19('0x28')][_0x5e19('0x46')]({'where':{'id':_0x39e791[_0x5e19('0x49')]['id']}})[_0x5e19('0x24')](handleEntityNotFound(_0x47244e,null))['then'](saveUpdates(_0x39e791[_0x5e19('0x48')],null))[_0x5e19('0x24')](respondWithResult(_0x47244e,null))[_0x5e19('0x42')](handleError(_0x47244e,null));};exports[_0x5e19('0x25')]=function(_0x266ae8,_0x49bd18){return db[_0x5e19('0x28')][_0x5e19('0x46')]({'where':{'id':_0x266ae8[_0x5e19('0x49')]['id']}})[_0x5e19('0x24')](handleEntityNotFound(_0x49bd18,null))[_0x5e19('0x24')](removeEntity(_0x49bd18,null))[_0x5e19('0x42')](handleError(_0x49bd18,null));};
\ No newline at end of file
index 224d062..e7d7d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8cf=['event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceQueuesLog'];(function(_0x1f373c,_0x223821){var _0x5c4612=function(_0x378891){while(--_0x378891){_0x1f373c['push'](_0x1f373c['shift']());}};_0x5c4612(++_0x223821);}(_0xe8cf,0x16e));var _0xfe8c=function(_0x933b86,_0x28d64a){_0x933b86=_0x933b86-0x0;var _0x1e2d4e=_0xe8cf[_0x933b86];return _0x1e2d4e;};'use strict';var _=require('lodash');var util=require(_0xfe8c('0x0'));var logger=require(_0xfe8c('0x1'))(_0xfe8c('0x2'));var moment=require(_0xfe8c('0x3'));var BPromise=require(_0xfe8c('0x4'));var rp=require(_0xfe8c('0x5'));var fs=require('fs');var path=require(_0xfe8c('0x6'));var rimraf=require(_0xfe8c('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module[_0xfe8c('0x8')]=function(_0x49c46b,_0xb5ce37){return _0x49c46b[_0xfe8c('0x9')](_0xfe8c('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xfe8c('0xb'),_0xfe8c('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xc734=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','api','moment','bluebird'];(function(_0x499076,_0x3ad5f9){var _0x3150c9=function(_0x47c5c4){while(--_0x47c5c4){_0x499076['push'](_0x499076['shift']());}};_0x3150c9(++_0x3ad5f9);}(_0xc734,0x1ca));var _0x4c73=function(_0x3e85a4,_0x18c3a9){_0x3e85a4=_0x3e85a4-0x0;var _0x21e7d1=_0xc734[_0x3e85a4];return _0x21e7d1;};'use strict';var _=require('lodash');var util=require(_0x4c73('0x0'));var logger=require('../../config/logger')(_0x4c73('0x1'));var moment=require(_0x4c73('0x2'));var BPromise=require(_0x4c73('0x3'));var rp=require(_0x4c73('0x4'));var fs=require('fs');var path=require(_0x4c73('0x5'));var rimraf=require(_0x4c73('0x6'));var config=require(_0x4c73('0x7'));var attributes=require(_0x4c73('0x8'));module['exports']=function(_0x588865,_0x13b503){return _0x588865['define'](_0x4c73('0x9'),attributes,{'tableName':_0x4c73('0xa'),'paranoid':![],'indexes':[{'name':_0x4c73('0xb'),'fields':[_0x4c73('0xc'),_0x4c73('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index 25a0b0f..d7d0fbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b7=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x1d69ba,_0x4090c9){var _0x8bab8c=function(_0x33ce38){while(--_0x33ce38){_0x1d69ba['push'](_0x1d69ba['shift']());}};_0x8bab8c(++_0x4090c9);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x4a9e66,_0x23ce1a){_0x4a9e66=_0x4a9e66-0x0;var _0x1a9d2d=_0xf5b7[_0x4a9e66];return _0x1a9d2d;};'use strict';var _=require('lodash');var util=require(_0x7f5b('0x0'));var moment=require(_0x7f5b('0x1'));var BPromise=require(_0x7f5b('0x2'));var rs=require(_0x7f5b('0x3'));var fs=require('fs');var Redis=require(_0x7f5b('0x4'));var db=require(_0x7f5b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f5b('0x6'))('rpc');var config=require(_0x7f5b('0x7'));var jayson=require(_0x7f5b('0x8'));var client=jayson['client'][_0x7f5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fcd6b,_0x185c7c,_0x16ac54){return new BPromise(function(_0x1d1844,_0x384476){return client[_0x7f5b('0xa')](_0x1fcd6b,_0x16ac54)[_0x7f5b('0xb')](function(_0x35fd0a){logger[_0x7f5b('0xc')](_0x7f5b('0xd'),_0x185c7c,_0x7f5b('0xe'));logger[_0x7f5b('0xf')](_0x7f5b('0x10'),_0x185c7c,_0x7f5b('0xe'),JSON['stringify'](_0x35fd0a));if(_0x35fd0a[_0x7f5b('0x11')]){if(_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x12')]===0x1f4){logger[_0x7f5b('0x11')](_0x7f5b('0xd'),_0x185c7c,_0x35fd0a[_0x7f5b('0x11')]['message']);return _0x384476(_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x13')]);}logger[_0x7f5b('0x11')](_0x7f5b('0xd'),_0x185c7c,_0x35fd0a[_0x7f5b('0x11')][_0x7f5b('0x13')]);return _0x1d1844(_0x35fd0a['error']['message']);}else{logger['info'](_0x7f5b('0xd'),_0x185c7c,_0x7f5b('0xe'));_0x1d1844(_0x35fd0a[_0x7f5b('0x14')][_0x7f5b('0x13')]);}})[_0x7f5b('0x15')](function(_0x9b9d56){logger[_0x7f5b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x185c7c,_0x9b9d56);_0x384476(_0x9b9d56);});});}
\ No newline at end of file
+var _0xf9b2=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result'];(function(_0x5d81cc,_0xedaa67){var _0x3e3574=function(_0x7eeb81){while(--_0x7eeb81){_0x5d81cc['push'](_0x5d81cc['shift']());}};_0x3e3574(++_0xedaa67);}(_0xf9b2,0x9a));var _0x2f9b=function(_0x16f2ea,_0x2b6d4a){_0x16f2ea=_0x16f2ea-0x0;var _0x20dea8=_0xf9b2[_0x16f2ea];return _0x20dea8;};'use strict';var _=require(_0x2f9b('0x0'));var util=require(_0x2f9b('0x1'));var moment=require(_0x2f9b('0x2'));var BPromise=require(_0x2f9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f9b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f9b('0x6'));var jayson=require(_0x2f9b('0x7'));var client=jayson[_0x2f9b('0x8')][_0x2f9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae8281,_0x329642,_0xcf6aea){return new BPromise(function(_0x4bf726,_0x21a47e){return client[_0x2f9b('0xa')](_0xae8281,_0xcf6aea)[_0x2f9b('0xb')](function(_0x5dfcbf){logger[_0x2f9b('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x2f9b('0xd'));logger[_0x2f9b('0xe')](_0x2f9b('0xf'),_0x329642,_0x2f9b('0xd'),JSON[_0x2f9b('0x10')](_0x5dfcbf));if(_0x5dfcbf[_0x2f9b('0x11')]){if(_0x5dfcbf['error'][_0x2f9b('0x12')]===0x1f4){logger[_0x2f9b('0x11')](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x21a47e(_0x5dfcbf[_0x2f9b('0x11')][_0x2f9b('0x14')]);}logger['error'](_0x2f9b('0x13'),_0x329642,_0x5dfcbf[_0x2f9b('0x11')]['message']);return _0x4bf726(_0x5dfcbf['error'][_0x2f9b('0x14')]);}else{logger[_0x2f9b('0xc')](_0x2f9b('0x13'),_0x329642,_0x2f9b('0xd'));_0x4bf726(_0x5dfcbf[_0x2f9b('0x15')]['message']);}})['catch'](function(_0x1fedfa){logger[_0x2f9b('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x329642,_0x1fedfa);_0x21a47e(_0x1fedfa);});});}
\ No newline at end of file
index 0422beb..5bcfd7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x058c=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','multer'];(function(_0x29a132,_0x49c0cc){var _0x1443cf=function(_0x25914b){while(--_0x25914b){_0x29a132['push'](_0x29a132['shift']());}};_0x1443cf(++_0x49c0cc);}(_0x058c,0x86));var _0xc058=function(_0x28e609,_0x1e5009){_0x28e609=_0x28e609-0x0;var _0x334c68=_0x058c[_0x28e609];return _0x334c68;};'use strict';var multer=require(_0xc058('0x0'));var util=require(_0xc058('0x1'));var path=require('path');var timeout=require(_0xc058('0x2'));var express=require(_0xc058('0x3'));var router=express[_0xc058('0x4')]();var fs_extra=require(_0xc058('0x5'));var auth=require(_0xc058('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc058('0x7'));var controller=require(_0xc058('0x8'));router[_0xc058('0x9')]('/',auth[_0xc058('0xa')](),controller[_0xc058('0xb')]);router[_0xc058('0x9')](_0xc058('0xc'),auth[_0xc058('0xa')](),controller[_0xc058('0xd')]);router['get'](_0xc058('0xe'),auth['isAuthenticated'](),controller[_0xc058('0xf')]);router['get'](_0xc058('0x10'),auth['isAuthenticated'](),controller[_0xc058('0x11')]);router[_0xc058('0x9')](_0xc058('0x12'),controller[_0xc058('0x13')]);router[_0xc058('0x9')](_0xc058('0x14'),auth[_0xc058('0xa')](),controller[_0xc058('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc058('0x16')]);router[_0xc058('0x17')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0xc058('0x18')]);router[_0xc058('0x19')](_0xc058('0xe'),auth[_0xc058('0xa')](),controller[_0xc058('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7006=['/:id/transcribe','post','create','runTranscribe','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads'];(function(_0x43f3ef,_0x5d975d){var _0x1c021f=function(_0x340d30){while(--_0x340d30){_0x43f3ef['push'](_0x43f3ef['shift']());}};_0x1c021f(++_0x5d975d);}(_0x7006,0x1e7));var _0x6700=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x7006[_0x11a220];return _0x20d8fe;};'use strict';var multer=require(_0x6700('0x0'));var util=require('util');var path=require(_0x6700('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6700('0x2')]();var fs_extra=require(_0x6700('0x3'));var auth=require(_0x6700('0x4'));var interaction=require(_0x6700('0x5'));var config=require(_0x6700('0x6'));var controller=require(_0x6700('0x7'));router[_0x6700('0x8')]('/',auth['isAuthenticated'](),controller[_0x6700('0x9')]);router[_0x6700('0x8')]('/describe',auth[_0x6700('0xa')](),controller[_0x6700('0xb')]);router['get'](_0x6700('0xc'),auth[_0x6700('0xa')](),controller[_0x6700('0xd')]);router[_0x6700('0x8')](_0x6700('0xe'),auth[_0x6700('0xa')](),controller[_0x6700('0xf')]);router[_0x6700('0x8')](_0x6700('0x10'),controller['downloads']);router['get'](_0x6700('0x11'),auth[_0x6700('0xa')](),controller['downloadTranscribe']);router[_0x6700('0x12')]('/',auth[_0x6700('0xa')](),controller[_0x6700('0x13')]);router[_0x6700('0x12')]('/:id/transcribe',auth[_0x6700('0xa')](),controller[_0x6700('0x14')]);router[_0x6700('0x15')](_0x6700('0xc'),auth[_0x6700('0xa')](),controller[_0x6700('0x16')]);router[_0x6700('0x17')]('/:id',auth[_0x6700('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4214747..b532a70 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 dbd408a..badce60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e3=['keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','sequelize','MD5','col','token','push','$and','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','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','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','stack','name','map','VoiceRecording','fieldName','type','model','format'];(function(_0x1a357d,_0x23d284){var _0x51a696=function(_0x54ecad){while(--_0x54ecad){_0x1a357d['push'](_0x1a357d['shift']());}};_0x51a696(++_0x23d284);}(_0xb6e3,0x199));var _0x3b6e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xb6e3[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x3b6e('0x0'));var rimraf=require(_0x3b6e('0x1'));var zipdir=require(_0x3b6e('0x2'));var jsonpatch=require(_0x3b6e('0x3'));var rp=require(_0x3b6e('0x4'));var moment=require(_0x3b6e('0x5'));var BPromise=require(_0x3b6e('0x6'));var Mustache=require(_0x3b6e('0x7'));var util=require(_0x3b6e('0x8'));var path=require(_0x3b6e('0x9'));var sox=require(_0x3b6e('0xa'));var csv=require(_0x3b6e('0xb'));var ejs=require(_0x3b6e('0xc'));var fs=require('fs');var fs_extra=require(_0x3b6e('0xd'));var _=require(_0x3b6e('0xe'));var squel=require(_0x3b6e('0xf'));var crypto=require(_0x3b6e('0x10'));var jsforce=require(_0x3b6e('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x3b6e('0xb'));var querystring=require(_0x3b6e('0x12'));var Papa=require(_0x3b6e('0x13'));var AWS=require('aws-sdk');var uuidv4=require(_0x3b6e('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b6e('0x15'));var as=require(_0x3b6e('0x16'));var hardwareService=require(_0x3b6e('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3b6e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b6e('0x19'))['db'];function respondWithStatusCode(_0x11fe23,_0x38048a){_0x38048a=_0x38048a||0xcc;return function(_0x22d021){if(_0x22d021){return _0x11fe23[_0x3b6e('0x1a')](_0x38048a);}return _0x11fe23['status'](_0x38048a)['end']();};}function respondWithResult(_0x5ace19,_0x3e7e82){_0x3e7e82=_0x3e7e82||0xc8;return function(_0x1659ca){if(_0x1659ca){return _0x5ace19[_0x3b6e('0x1b')](_0x3e7e82)[_0x3b6e('0x1c')](_0x1659ca);}};}function respondWithFilteredResult(_0x33ac36,_0x46e522){return function(_0x2912eb){if(_0x2912eb){var _0x2388e8=typeof _0x46e522[_0x3b6e('0x1d')]===_0x3b6e('0x1e')&&typeof _0x46e522[_0x3b6e('0x1f')]===_0x3b6e('0x1e');var _0x215ed6=_0x2912eb[_0x3b6e('0x20')];var _0x5e8128=_0x2388e8?0x0:_0x46e522[_0x3b6e('0x1d')];var _0x113285=_0x2388e8?_0x2912eb['count']:_0x46e522['offset']+_0x46e522[_0x3b6e('0x1f')];var _0x2f0d13;if(_0x113285>=_0x215ed6){_0x113285=_0x215ed6;_0x2f0d13=0xc8;}else{_0x2f0d13=0xce;}_0x33ac36[_0x3b6e('0x1b')](_0x2f0d13);return _0x33ac36['set'](_0x3b6e('0x21'),_0x5e8128+'-'+_0x113285+'/'+_0x215ed6)[_0x3b6e('0x1c')](_0x2912eb);}return null;};}function patchUpdates(_0x176518){return function(_0x21d8bc){try{jsonpatch[_0x3b6e('0x22')](_0x21d8bc,_0x176518,!![]);}catch(_0x298a15){return BPromise['reject'](_0x298a15);}return _0x21d8bc[_0x3b6e('0x23')]();};}function saveUpdates(_0x198713,_0x1b268d){return function(_0x3f2c71){if(_0x3f2c71){return _0x3f2c71[_0x3b6e('0x24')](_0x198713)[_0x3b6e('0x25')](function(_0x1d5c98){return _0x1d5c98;});}return null;};}function removeEntity(_0x1db48d,_0x5ecb01){return function(_0xfc1e25){if(_0xfc1e25){return _0xfc1e25['destroy']()[_0x3b6e('0x25')](function(){_0x1db48d[_0x3b6e('0x1b')](0xcc)[_0x3b6e('0x26')]();});}};}function handleEntityNotFound(_0x362eb5,_0xe70fde){return function(_0x5ba4b3){if(!_0x5ba4b3){_0x362eb5[_0x3b6e('0x1a')](0x194);}return _0x5ba4b3;};}function handleError(_0x3c51,_0x358131){_0x358131=_0x358131||0x1f4;return function(_0x2cdc80){logger['error'](_0x2cdc80[_0x3b6e('0x27')]);if(_0x2cdc80[_0x3b6e('0x28')]){delete _0x2cdc80['name'];}_0x3c51[_0x3b6e('0x1b')](_0x358131)['send'](_0x2cdc80);};}exports['index']=function(_0x2c5168,_0x32ae5a){var _0x3166c3={},_0x23b6a7={},_0xe52780={'count':0x0,'rows':[]};var _0x542136=_[_0x3b6e('0x29')](db[_0x3b6e('0x2a')]['rawAttributes'],function(_0x2d9a60){return{'name':_0x2d9a60[_0x3b6e('0x2b')],'type':_0x2d9a60[_0x3b6e('0x2c')]['key']};});_0x23b6a7[_0x3b6e('0x2d')]=_['differenceBy'](_[_0x3b6e('0x29')](_0x542136,_0x3b6e('0x28')),[_0x3b6e('0x2e')]);_0x23b6a7['query']=_[_0x3b6e('0x2f')](_0x2c5168['query']);_0x23b6a7['filters']=_[_0x3b6e('0x30')](_0x23b6a7[_0x3b6e('0x2d')],_0x23b6a7[_0x3b6e('0x31')]);_0x3166c3[_0x3b6e('0x32')]=_['intersection'](_0x23b6a7[_0x3b6e('0x2d')],qs['fields'](_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x33')]));_0x3166c3[_0x3b6e('0x32')]=_0x3166c3[_0x3b6e('0x32')][_0x3b6e('0x34')]?_0x3166c3[_0x3b6e('0x32')]:_0x23b6a7[_0x3b6e('0x2d')];if(!_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x35')](_0x3b6e('0x36'))){_0x3166c3[_0x3b6e('0x1f')]=qs['limit'](_0x2c5168['query'][_0x3b6e('0x1f')]);_0x3166c3[_0x3b6e('0x1d')]=qs[_0x3b6e('0x1d')](_0x2c5168[_0x3b6e('0x31')]['offset']);}_0x3166c3[_0x3b6e('0x37')]=qs[_0x3b6e('0x38')](_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x38')]);_0x3166c3[_0x3b6e('0x39')]=qs[_0x3b6e('0x3a')](_['pick'](_0x2c5168[_0x3b6e('0x31')],_0x23b6a7['filters']),_0x542136);if(_0x2c5168['query'][_0x3b6e('0x3b')]){_0x3166c3[_0x3b6e('0x39')]=_[_0x3b6e('0x3c')](_0x3166c3['where'],{'$or':_[_0x3b6e('0x29')](_0x542136,function(_0x593fc0){if(_0x593fc0[_0x3b6e('0x2c')]!==_0x3b6e('0x3d')){var _0x2cc854={};_0x2cc854[_0x593fc0[_0x3b6e('0x28')]]={'$like':'%'+_0x2c5168[_0x3b6e('0x31')]['filter']+'%'};return _0x2cc854;}})});}_0x3166c3=_[_0x3b6e('0x3c')]({},_0x3166c3,_0x2c5168[_0x3b6e('0x3e')]);var _0x40d073={'where':_0x3166c3[_0x3b6e('0x39')]};return db[_0x3b6e('0x2a')][_0x3b6e('0x20')](_0x40d073)[_0x3b6e('0x25')](function(_0x3a56c8){_0xe52780[_0x3b6e('0x20')]=_0x3a56c8;if(_0x2c5168[_0x3b6e('0x31')][_0x3b6e('0x3f')]){_0x3166c3[_0x3b6e('0x40')]=[{'all':!![]}];}return db[_0x3b6e('0x2a')][_0x3b6e('0x41')](_0x3166c3);})[_0x3b6e('0x25')](function(_0x452f79){_0xe52780[_0x3b6e('0x42')]=_0x452f79;return _0xe52780;})['then'](respondWithFilteredResult(_0x32ae5a,_0x3166c3))[_0x3b6e('0x43')](handleError(_0x32ae5a,null));};exports['show']=function(_0x3334a9,_0x5ed05e){var _0x13dce7={'raw':![],'where':{'id':_0x3334a9[_0x3b6e('0x44')]['id']}},_0x572b15={};_0x572b15[_0x3b6e('0x2d')]=_[_0x3b6e('0x2f')](db['VoiceRecording'][_0x3b6e('0x45')]);_0x572b15[_0x3b6e('0x31')]=_[_0x3b6e('0x2f')](_0x3334a9[_0x3b6e('0x31')]);_0x572b15[_0x3b6e('0x3a')]=_[_0x3b6e('0x30')](_0x572b15[_0x3b6e('0x2d')],_0x572b15[_0x3b6e('0x31')]);_0x13dce7['attributes']=_['intersection'](_0x572b15[_0x3b6e('0x2d')],qs['fields'](_0x3334a9[_0x3b6e('0x31')]['fields']));_0x13dce7[_0x3b6e('0x32')]=_0x13dce7[_0x3b6e('0x32')]['length']?_0x13dce7[_0x3b6e('0x32')]:_0x572b15['model'];if(_0x3334a9[_0x3b6e('0x31')]['includeAll']){_0x13dce7['include']=[{'all':!![]}];}_0x13dce7=_['merge']({},_0x13dce7,_0x3334a9['options']);return db[_0x3b6e('0x2a')][_0x3b6e('0x46')](_0x13dce7)[_0x3b6e('0x25')](handleEntityNotFound(_0x5ed05e,null))[_0x3b6e('0x25')](respondWithResult(_0x5ed05e,null))['catch'](handleError(_0x5ed05e,null));};exports[_0x3b6e('0x47')]=function(_0x34ee8d,_0x59f389){return db[_0x3b6e('0x2a')]['create'](_0x34ee8d['body'],{})[_0x3b6e('0x25')](respondWithResult(_0x59f389,0xc9))[_0x3b6e('0x43')](handleError(_0x59f389,null));};exports[_0x3b6e('0x24')]=function(_0x3e8fe6,_0x474c3d){if(_0x3e8fe6[_0x3b6e('0x48')]['id']){delete _0x3e8fe6[_0x3b6e('0x48')]['id'];}return db[_0x3b6e('0x2a')][_0x3b6e('0x46')]({'where':{'id':_0x3e8fe6[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](handleEntityNotFound(_0x474c3d,null))[_0x3b6e('0x25')](saveUpdates(_0x3e8fe6[_0x3b6e('0x48')],null))[_0x3b6e('0x25')](respondWithResult(_0x474c3d,null))[_0x3b6e('0x43')](handleError(_0x474c3d,null));};exports[_0x3b6e('0x49')]=function(_0x3e461e,_0xbc166d){return db['VoiceRecording']['describe']()[_0x3b6e('0x25')](respondWithResult(_0xbc166d,null))['catch'](handleError(_0xbc166d,null));};exports[_0x3b6e('0x4a')]=function(_0x1e1d06,_0x3861f8,_0x146516){var _0x101d92=require(_0x3b6e('0x4b'));var _0x4d1a5d=![];var _0x3a8aa9={};if(_0x1e1d06[_0x3b6e('0x31')][_0x3b6e('0x2c')]&&_0x1e1d06[_0x3b6e('0x31')][_0x3b6e('0x2c')]===_0x3b6e('0x4c')){_0x3a8aa9[_0x3b6e('0x4c')]=_0x1e1d06[_0x3b6e('0x44')]['id'];}else{_0x3a8aa9['id']=_0x1e1d06['params']['id'];}return db[_0x3b6e('0x2a')]['find']({'where':_0x3a8aa9,'attributes':['id',_0x3b6e('0x4d')],'raw':!![]})[_0x3b6e('0x25')](handleEntityNotFound(_0x3861f8,null))[_0x3b6e('0x25')](function(_0x4f50ad){if(_0x4f50ad){var _0x10bbf3=_0x4f50ad[_0x3b6e('0x4d')];var _0x1c43fd=util[_0x3b6e('0x2e')](_0x3b6e('0x4e'),_0x10bbf3);if(fs['existsSync'](_0x1c43fd)){_0x4d1a5d=!![];return _0x101d92[_0x3b6e('0x4f')](_0x1c43fd,_0x10bbf3,config[_0x3b6e('0x50')][_0x3b6e('0x51')])['then'](function(){return _0x4f50ad;});}return _0x4f50ad;}})['then'](function(_0x534afd){if(_0x534afd){var _0x2d6283=_0x534afd[_0x3b6e('0x4d')];if(!fs[_0x3b6e('0x52')](_0x2d6283)){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x534afd[_0x3b6e('0x55')]){return _0x3861f8[_0x3b6e('0x4a')](_0x2d6283,_0x534afd[_0x3b6e('0x55')]+path[_0x3b6e('0x56')](_0x2d6283),function(){if(_0x4d1a5d){fs[_0x3b6e('0x57')](_0x2d6283);}});}else{return _0x3861f8['download'](_0x2d6283,function(_0xdeab19){if(_0x4d1a5d){fs['unlink'](_0x2d6283);}});}}})['catch'](function(_0x12638b){if(_0x12638b[_0x3b6e('0x58')]===_0x3b6e('0x59')){_0x3861f8[_0x3b6e('0x1b')](0x194)[_0x3b6e('0x5a')](_0x3b6e('0x5b'));}else{return handleError(_0x3861f8,null);}});};exports['downloads']=function(_0x57d9b,_0x2a90db,_0x192d5f){var _0xe5af39=require(_0x3b6e('0x4b'));var _0x1dc856=![];var _0x8a811b={'$and':[db['sequelize'][_0x3b6e('0x39')](db[_0x3b6e('0x5c')]['fn'](_0x3b6e('0x5d'),db[_0x3b6e('0x5c')][_0x3b6e('0x5e')](_0x3b6e('0x4c'))),_0x57d9b[_0x3b6e('0x31')][_0x3b6e('0x5f')])]};if(_0x57d9b[_0x3b6e('0x31')][_0x3b6e('0x2c')]&&_0x57d9b[_0x3b6e('0x31')]['type']==='uniqueid'){_0x8a811b['$and'][_0x3b6e('0x60')]({'uniqueid':_0x57d9b[_0x3b6e('0x44')]['id']});}else{_0x8a811b[_0x3b6e('0x61')]['push']({'id':_0x57d9b[_0x3b6e('0x44')]['id']});}return db[_0x3b6e('0x2a')]['find']({'where':_0x8a811b,'attributes':['id',_0x3b6e('0x4d')],'raw':!![]})[_0x3b6e('0x25')](handleEntityNotFound(_0x2a90db,null))['then'](function(_0x3d4e27){if(_0x3d4e27){var _0x5f11c2=util[_0x3b6e('0x2e')]('%s.cypher',_0x3d4e27[_0x3b6e('0x4d')]);if(fs[_0x3b6e('0x52')](_0x5f11c2)){_0x1dc856=!![];return _0xe5af39[_0x3b6e('0x4f')](_0x5f11c2,_0x3d4e27[_0x3b6e('0x4d')],config['secrets'][_0x3b6e('0x51')])[_0x3b6e('0x25')](function(){return _0x3d4e27;});}return _0x3d4e27;}})[_0x3b6e('0x25')](function(_0xb6fd5f){if(_0xb6fd5f){if(!fs[_0x3b6e('0x52')](_0xb6fd5f[_0x3b6e('0x4d')])){throw new db[(_0x3b6e('0x53'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0xb6fd5f[_0x3b6e('0x55')]){return _0x2a90db[_0x3b6e('0x4a')](_0xb6fd5f[_0x3b6e('0x4d')],_0xb6fd5f[_0x3b6e('0x55')]+path[_0x3b6e('0x56')](_0xb6fd5f['value']),function(){if(_0x1dc856){fs[_0x3b6e('0x57')](_0xb6fd5f['value']);}});}else{return _0x2a90db[_0x3b6e('0x4a')](_0xb6fd5f[_0x3b6e('0x4d')],function(_0x42dc2a){if(_0x1dc856){fs['unlink'](_0xb6fd5f['value']);}});}}})['catch'](handleError(_0x2a90db,null));};exports[_0x3b6e('0x62')]=function(_0x244958,_0xe9fb29){return db[_0x3b6e('0x2a')][_0x3b6e('0x46')]({'where':{'id':_0x244958[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](function(_0x413127){if(_[_0x3b6e('0x63')](_0x413127)){throw new ReferenceError(_0x3b6e('0x64'));}return _0x413127;})['then'](function(_0x203011){var _0x351c80=_0x203011[_0x3b6e('0x4d')];logger[_0x3b6e('0x65')](_0x3b6e('0x66'),_0x351c80);if(!_[_0x3b6e('0x63')](_0x203011[_0x3b6e('0x4d')])&&fs[_0x3b6e('0x52')](_0x351c80)){logger[_0x3b6e('0x65')](_0x3b6e('0x67')+_0x351c80+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3b6e('0x68')](_0x351c80);}_0x351c80=_0x351c80+_0x3b6e('0x69');if(!_[_0x3b6e('0x63')](_0x203011[_0x3b6e('0x4d')])&&fs['existsSync'](_0x351c80)){logger[_0x3b6e('0x65')]('File:\x20\x22'+_0x351c80+_0x3b6e('0x6a'));fs[_0x3b6e('0x68')](_0x351c80);}return _0x203011;})[_0x3b6e('0x25')](function(_0x420b82){if(!_0x420b82)throw new InternalError();return _0x420b82[_0x3b6e('0x62')]();})[_0x3b6e('0x25')](function(){_0xe9fb29['status'](0xcc)[_0x3b6e('0x26')]();})[_0x3b6e('0x43')](handleError(_0xe9fb29,null));};function getBucketslist(_0x3c9b88,_0x4866df,_0x35a6da){return new Promise(function(_0x198f3f,_0x4a3e23){var _0x44d502=new AWS['S3']({'accessKeyId':_0x4866df,'secretAccessKey':_0x3c9b88,'region':_0x35a6da});_0x44d502[_0x3b6e('0x6b')]({},function(_0x2bdba0,_0x154240){if(_0x2bdba0){return _0x4a3e23(_0x2bdba0);}else{return _0x198f3f(_0x154240);}});});}function createBucket(_0x50a3cc,_0x490a5b,_0x3b1448,_0x511590){return new Promise(function(_0x27b955,_0x24b498){var _0x342fc4=new AWS['S3']({'accessKeyId':_0x490a5b,'secretAccessKey':_0x50a3cc,'region':_0x3b1448});_0x342fc4[_0x3b6e('0x6c')]({'Bucket':_0x511590},function(_0x5aac9e,_0x44e6aa){if(_0x5aac9e){return _0x24b498(_0x5aac9e);}else{return _0x27b955(_0x44e6aa);}});});}function uploadFile(_0x2e17ae,_0x658d78,_0x28b125,_0xf87b6,_0x807b53,_0x2e3184){return new Promise(function(_0x1af6e3,_0x1ea43e){var _0x278f85=new AWS['S3']({'accessKeyId':_0x658d78,'secretAccessKey':_0x2e17ae,'region':_0x28b125});_0x278f85[_0x3b6e('0x6d')]({'Bucket':_0xf87b6,'Key':_0x807b53,'Body':_0x2e3184},function(_0x1e30b6,_0x10ce81){if(_0x1e30b6){return _0x1ea43e(_0x1e30b6);}else{return _0x1af6e3(_0x10ce81);}});});}function startTranscribe(_0x5f2369,_0x19dcb3,_0x433bc0,_0x3fd703,_0x346d98,_0x1e10d7){return new Promise(function(_0x5585dc,_0x3da064){var _0x4af5f0=new AWS['TranscribeService']({'accessKeyId':_0x19dcb3,'secretAccessKey':_0x5f2369,'region':_0x433bc0});_0x4af5f0[_0x3b6e('0x6e')]({'TranscriptionJobName':_0x3fd703,'LanguageCode':_0x346d98,'Media':{'MediaFileUri':_0x1e10d7}},function(_0x437730,_0x5aadff){if(_0x437730){return _0x3da064(_0x437730);}else{return _0x5585dc(_0x5aadff);}});});}function transcribe(_0x3e8874,_0x37c18a,_0x40bc5a,_0x1c2c96,_0x58ff1a,_0x1ff999,_0x43ee38){return new Promise(function(_0x413af2,_0x58b7b9){var _0x13a935={};logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x6f'),_0x3e8874,_0x58ff1a));return uploadFile(_0x37c18a,_0x40bc5a,_0x1c2c96,_0x58ff1a,path['basename'](_0x1ff999),fs[_0x3b6e('0x70')](_0x1ff999))[_0x3b6e('0x25')](function(_0x1ee941){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x71'),_0x3e8874,_0x58ff1a,_0x1ee941[_0x3b6e('0x72')]));_0x13a935[_0x3b6e('0x73')]=_0x1ee941[_0x3b6e('0x74')];_0x13a935[_0x3b6e('0x75')]=_0x1ee941[_0x3b6e('0x72')];logger['info'](util[_0x3b6e('0x2e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3e8874));return startTranscribe(_0x37c18a,_0x40bc5a,_0x1c2c96,uuidv4(),_0x43ee38,_0x1ee941['Location']);})[_0x3b6e('0x25')](function(_0x5484df){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x76'),_0x3e8874,_0x5484df[_0x3b6e('0x77')][_0x3b6e('0x78')]));_0x13a935['transcribeName']=_0x5484df['TranscriptionJob'][_0x3b6e('0x78')];_0x13a935[_0x3b6e('0x79')]=_0x5484df[_0x3b6e('0x77')][_0x3b6e('0x7a')];return _0x413af2(_0x13a935);})[_0x3b6e('0x43')](function(_0x342054){return _0x58b7b9(_0x342054);});});}exports[_0x3b6e('0x7b')]=function(_0x2217b6,_0x46789e,_0x2fa72f){var _0x3365ce;var _0x549cd;var _0x508a66;var _0xbcb3a=require('../../components/encryptor');return db[_0x3b6e('0x2a')]['findOne']({'where':{'id':_0x2217b6['params']['id']}})['then'](function(_0x4cf38b){if(_0x4cf38b){var _0x1202e6=util[_0x3b6e('0x2e')](_0x3b6e('0x4e'),_0x4cf38b[_0x3b6e('0x4d')]);if(fs['existsSync'](_0x1202e6)){cypher=!![];return _0xbcb3a[_0x3b6e('0x4f')](_0x1202e6,_0x4cf38b[_0x3b6e('0x4d')],config['secrets'][_0x3b6e('0x51')])['then'](function(){return _0x4cf38b;});}return _0x4cf38b;}})[_0x3b6e('0x25')](function(_0x32c7ab){if(!_0x32c7ab){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x7c'));}_0x549cd=_0x32c7ab;return db['Setting'][_0x3b6e('0x7d')]({'where':{'id':0x1}});})[_0x3b6e('0x25')](handleEntityNotFound(_0x46789e,null))[_0x3b6e('0x25')](function(_0x34c423){if(_0x34c423){_0x3365ce=_0x34c423;if(!_0x3365ce['transcribe']||!_0x3365ce[_0x3b6e('0x7e')]||!_0x3365ce[_0x3b6e('0x7f')]||!_0x3365ce[_0x3b6e('0x80')]||!_0x3365ce[_0x3b6e('0x73')]){throw new db['Sequelize'][(_0x3b6e('0x54'))](_0x3b6e('0x81'));}if(_0x2217b6[_0x3b6e('0x48')][_0x3b6e('0x82')]&&(!_0x3365ce['sentiment']||!_0x3365ce[_0x3b6e('0x83')]||!_0x3365ce[_0x3b6e('0x84')]||!_0x3365ce[_0x3b6e('0x80')]||!_0x3365ce['bucket'])){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x85'));}return db[_0x3b6e('0x86')][_0x3b6e('0x7d')]({'where':{'id':_0x3365ce[_0x3b6e('0x7e')]}});}})[_0x3b6e('0x25')](function(_0x2bc51e){if(!_0x2bc51e){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x87'));}if(!_0x2bc51e[_0x3b6e('0x88')]||!_0x2bc51e[_0x3b6e('0x89')]){throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))](_0x3b6e('0x8a'));}_0x508a66=_0x2bc51e;return getBucketslist(_0x508a66[_0x3b6e('0x88')],_0x508a66[_0x3b6e('0x89')],_0x3365ce['transcribeRegion']);})['then'](function(_0x499346){if(_0x499346&&_0x499346[_0x3b6e('0x8b')]){var _0x17b74b=_[_0x3b6e('0x46')](_0x499346[_0x3b6e('0x8b')],function(_0x415fbe){return _0x415fbe[_0x3b6e('0x8c')]===_0x3365ce[_0x3b6e('0x73')];});if(!_0x17b74b){logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')](_0x3b6e('0x8d'),_0x2217b6['params']['id'],_0x3365ce['bucket']));return createBucket(_0x508a66[_0x3b6e('0x88')],_0x508a66['data2'],_0x3365ce[_0x3b6e('0x7f')],_0x3365ce[_0x3b6e('0x73')]);}logger[_0x3b6e('0x65')](util['format'](_0x3b6e('0x8e'),_0x2217b6[_0x3b6e('0x44')]['id'],_0x3365ce[_0x3b6e('0x73')]));return;}})[_0x3b6e('0x25')](function(_0x5df07b){if(_0x549cd[_0x3b6e('0x79')]===_0x3b6e('0x8f')){return transcribe(_0x2217b6[_0x3b6e('0x44')]['id'],_0x508a66['data1'],_0x508a66[_0x3b6e('0x89')],_0x3365ce[_0x3b6e('0x7f')],_0x3365ce[_0x3b6e('0x73')],_0x549cd['value'],_0x3365ce['language']);}else{logger[_0x3b6e('0x65')](util[_0x3b6e('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x2217b6[_0x3b6e('0x44')]['id']));return{'transcribeStatus':_0x3b6e('0x90')};}})[_0x3b6e('0x25')](function(_0x4d3408){if(_0x4d3408){_0x4d3408['tempSentiment']=_0x2217b6[_0x3b6e('0x48')][_0x3b6e('0x82')];return _0x549cd[_0x3b6e('0x91')](_0x4d3408);}})[_0x3b6e('0x25')](respondWithResult(_0x46789e,null))[_0x3b6e('0x43')](handleError(_0x46789e,null));};function writeFile(_0x4bd1f2,_0x3a828c){return new Promise(function(_0x36549b,_0x55710d){fs[_0x3b6e('0x92')](_0x3a828c,_0x4bd1f2,function(_0x40835c,_0x5130c2){if(_0x40835c){return _0x55710d(_0x40835c);}else{return _0x36549b(_0x5130c2);}});});}exports[_0x3b6e('0x93')]=function(_0x3e4504,_0x3be39d,_0x8a0685){return db[_0x3b6e('0x2a')][_0x3b6e('0x7d')]({'where':{'id':_0x3e4504[_0x3b6e('0x44')]['id']}})[_0x3b6e('0x25')](handleEntityNotFound(_0x3be39d))['then'](function(_0x1c54e1){if(_0x1c54e1&&_0x1c54e1[_0x3b6e('0x94')]){var _0x3a31d4=_0x1c54e1['fileText'];var _0x3ef531=config[_0x3b6e('0x95')]+_0x3b6e('0x96')+_0x1c54e1['id']+_0x3b6e('0x97');if(fs[_0x3b6e('0x52')](_0x3ef531)){return _0x3ef531;}return writeFile(_0x3a31d4,_0x3ef531)[_0x3b6e('0x25')](function(){return _0x3ef531;});}else{throw new db[(_0x3b6e('0x53'))][(_0x3b6e('0x54'))]('Transcript\x20not\x20available');}})[_0x3b6e('0x25')](function(_0x4e4941){return _0x3be39d[_0x3b6e('0x4a')](_0x4e4941);})[_0x3b6e('0x43')](handleError(_0x3be39d));};
\ No newline at end of file
+var _0x1b63=['offset','limit','undefined','count','set','Content-Range','json','reject','save','then','destroy','stack','name','index','rawAttributes','type','key','map','format','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','VoiceRecording','findAll','catch','includeAll','find','create','body','update','params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','sequelize','col','$and','push','decryptFile','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x4527f1,_0x2d1dec){var _0x107e4d=function(_0x1e3be9){while(--_0x1e3be9){_0x4527f1['push'](_0x4527f1['shift']());}};_0x107e4d(++_0x2d1dec);}(_0x1b63,0x108));var _0x31b6=function(_0x244862,_0x3da79e){_0x244862=_0x244862-0x0;var _0x2bce23=_0x1b63[_0x244862];return _0x2bce23;};'use strict';var emlformat=require(_0x31b6('0x0'));var rimraf=require(_0x31b6('0x1'));var zipdir=require(_0x31b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x31b6('0x3'));var moment=require('moment');var BPromise=require(_0x31b6('0x4'));var Mustache=require(_0x31b6('0x5'));var util=require('util');var path=require(_0x31b6('0x6'));var sox=require(_0x31b6('0x7'));var csv=require(_0x31b6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31b6('0x9'));var squel=require(_0x31b6('0xa'));var crypto=require(_0x31b6('0xb'));var jsforce=require(_0x31b6('0xc'));var deskjs=require(_0x31b6('0xd'));var toCsv=require(_0x31b6('0x8'));var querystring=require(_0x31b6('0xe'));var Papa=require(_0x31b6('0xf'));var AWS=require(_0x31b6('0x10'));var uuidv4=require(_0x31b6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x31b6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x31b6('0x13'))(_0x31b6('0x14'));var utils=require('../../config/utils');var config=require(_0x31b6('0x15'));var licenseUtil=require(_0x31b6('0x16'));var db=require(_0x31b6('0x17'))['db'];function respondWithStatusCode(_0x12c9b0,_0x14d6a7){_0x14d6a7=_0x14d6a7||0xcc;return function(_0x2f8521){if(_0x2f8521){return _0x12c9b0['sendStatus'](_0x14d6a7);}return _0x12c9b0[_0x31b6('0x18')](_0x14d6a7)[_0x31b6('0x19')]();};}function respondWithResult(_0x466f94,_0xa0db7b){_0xa0db7b=_0xa0db7b||0xc8;return function(_0x5037d0){if(_0x5037d0){return _0x466f94[_0x31b6('0x18')](_0xa0db7b)['json'](_0x5037d0);}};}function respondWithFilteredResult(_0x52bb06,_0x95104a){return function(_0x5936ec){if(_0x5936ec){var _0x32ccbc=typeof _0x95104a[_0x31b6('0x1a')]==='undefined'&&typeof _0x95104a[_0x31b6('0x1b')]===_0x31b6('0x1c');var _0x266fa3=_0x5936ec[_0x31b6('0x1d')];var _0x12642e=_0x32ccbc?0x0:_0x95104a['offset'];var _0x325c22=_0x32ccbc?_0x5936ec[_0x31b6('0x1d')]:_0x95104a['offset']+_0x95104a[_0x31b6('0x1b')];var _0x58b6f0;if(_0x325c22>=_0x266fa3){_0x325c22=_0x266fa3;_0x58b6f0=0xc8;}else{_0x58b6f0=0xce;}_0x52bb06['status'](_0x58b6f0);return _0x52bb06[_0x31b6('0x1e')](_0x31b6('0x1f'),_0x12642e+'-'+_0x325c22+'/'+_0x266fa3)[_0x31b6('0x20')](_0x5936ec);}return null;};}function patchUpdates(_0x55f3d4){return function(_0x4cccd4){try{jsonpatch['apply'](_0x4cccd4,_0x55f3d4,!![]);}catch(_0x4d4618){return BPromise[_0x31b6('0x21')](_0x4d4618);}return _0x4cccd4[_0x31b6('0x22')]();};}function saveUpdates(_0x499854,_0x4b1c3f){return function(_0x2aa544){if(_0x2aa544){return _0x2aa544['update'](_0x499854)[_0x31b6('0x23')](function(_0x439999){return _0x439999;});}return null;};}function removeEntity(_0x3b29b6,_0x5e6cb3){return function(_0x101e8d){if(_0x101e8d){return _0x101e8d[_0x31b6('0x24')]()[_0x31b6('0x23')](function(){_0x3b29b6[_0x31b6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5147da,_0x5e5fc4){return function(_0x498f5b){if(!_0x498f5b){_0x5147da['sendStatus'](0x194);}return _0x498f5b;};}function handleError(_0x5e88a2,_0x1fc7fc){_0x1fc7fc=_0x1fc7fc||0x1f4;return function(_0x5e5d12){logger['error'](_0x5e5d12[_0x31b6('0x25')]);if(_0x5e5d12[_0x31b6('0x26')]){delete _0x5e5d12['name'];}_0x5e88a2['status'](_0x1fc7fc)['send'](_0x5e5d12);};}exports[_0x31b6('0x27')]=function(_0x27ddc3,_0xe3584b){var _0x3a132b={},_0x2b25f3={},_0x3bd30f={'count':0x0,'rows':[]};var _0x4abf63=_['map'](db['VoiceRecording'][_0x31b6('0x28')],function(_0x546ac8){return{'name':_0x546ac8['fieldName'],'type':_0x546ac8[_0x31b6('0x29')][_0x31b6('0x2a')]};});_0x2b25f3['model']=_['differenceBy'](_[_0x31b6('0x2b')](_0x4abf63,_0x31b6('0x26')),[_0x31b6('0x2c')]);_0x2b25f3[_0x31b6('0x2d')]=_[_0x31b6('0x2e')](_0x27ddc3[_0x31b6('0x2d')]);_0x2b25f3['filters']=_[_0x31b6('0x2f')](_0x2b25f3[_0x31b6('0x30')],_0x2b25f3[_0x31b6('0x2d')]);_0x3a132b[_0x31b6('0x31')]=_[_0x31b6('0x2f')](_0x2b25f3[_0x31b6('0x30')],qs[_0x31b6('0x32')](_0x27ddc3[_0x31b6('0x2d')][_0x31b6('0x32')]));_0x3a132b[_0x31b6('0x31')]=_0x3a132b['attributes'][_0x31b6('0x33')]?_0x3a132b['attributes']:_0x2b25f3[_0x31b6('0x30')];if(!_0x27ddc3['query'][_0x31b6('0x34')](_0x31b6('0x35'))){_0x3a132b[_0x31b6('0x1b')]=qs[_0x31b6('0x1b')](_0x27ddc3[_0x31b6('0x2d')]['limit']);_0x3a132b[_0x31b6('0x1a')]=qs[_0x31b6('0x1a')](_0x27ddc3[_0x31b6('0x2d')][_0x31b6('0x1a')]);}_0x3a132b[_0x31b6('0x36')]=qs[_0x31b6('0x37')](_0x27ddc3[_0x31b6('0x2d')][_0x31b6('0x37')]);_0x3a132b[_0x31b6('0x38')]=qs['filters'](_['pick'](_0x27ddc3[_0x31b6('0x2d')],_0x2b25f3[_0x31b6('0x39')]),_0x4abf63);if(_0x27ddc3[_0x31b6('0x2d')][_0x31b6('0x3a')]){_0x3a132b['where']=_[_0x31b6('0x3b')](_0x3a132b[_0x31b6('0x38')],{'$or':_[_0x31b6('0x2b')](_0x4abf63,function(_0x2ff14b){if(_0x2ff14b[_0x31b6('0x29')]!==_0x31b6('0x3c')){var _0x31a6d1={};_0x31a6d1[_0x2ff14b[_0x31b6('0x26')]]={'$like':'%'+_0x27ddc3[_0x31b6('0x2d')]['filter']+'%'};return _0x31a6d1;}})});}_0x3a132b=_[_0x31b6('0x3b')]({},_0x3a132b,_0x27ddc3[_0x31b6('0x3d')]);var _0x1aead1={'where':_0x3a132b['where']};return db[_0x31b6('0x3e')][_0x31b6('0x1d')](_0x1aead1)['then'](function(_0x6f8372){_0x3bd30f[_0x31b6('0x1d')]=_0x6f8372;if(_0x27ddc3[_0x31b6('0x2d')]['includeAll']){_0x3a132b['include']=[{'all':!![]}];}return db[_0x31b6('0x3e')][_0x31b6('0x3f')](_0x3a132b);})['then'](function(_0x747f95){_0x3bd30f['rows']=_0x747f95;return _0x3bd30f;})['then'](respondWithFilteredResult(_0xe3584b,_0x3a132b))[_0x31b6('0x40')](handleError(_0xe3584b,null));};exports['show']=function(_0xcd8f5f,_0x4ff9c0){var _0x3d2783={'raw':![],'where':{'id':_0xcd8f5f['params']['id']}},_0x25dff4={};_0x25dff4['model']=_[_0x31b6('0x2e')](db['VoiceRecording'][_0x31b6('0x28')]);_0x25dff4[_0x31b6('0x2d')]=_[_0x31b6('0x2e')](_0xcd8f5f[_0x31b6('0x2d')]);_0x25dff4[_0x31b6('0x39')]=_[_0x31b6('0x2f')](_0x25dff4[_0x31b6('0x30')],_0x25dff4['query']);_0x3d2783[_0x31b6('0x31')]=_[_0x31b6('0x2f')](_0x25dff4['model'],qs[_0x31b6('0x32')](_0xcd8f5f[_0x31b6('0x2d')][_0x31b6('0x32')]));_0x3d2783['attributes']=_0x3d2783[_0x31b6('0x31')][_0x31b6('0x33')]?_0x3d2783[_0x31b6('0x31')]:_0x25dff4[_0x31b6('0x30')];if(_0xcd8f5f['query'][_0x31b6('0x41')]){_0x3d2783['include']=[{'all':!![]}];}_0x3d2783=_['merge']({},_0x3d2783,_0xcd8f5f[_0x31b6('0x3d')]);return db[_0x31b6('0x3e')][_0x31b6('0x42')](_0x3d2783)[_0x31b6('0x23')](handleEntityNotFound(_0x4ff9c0,null))[_0x31b6('0x23')](respondWithResult(_0x4ff9c0,null))[_0x31b6('0x40')](handleError(_0x4ff9c0,null));};exports[_0x31b6('0x43')]=function(_0x22aed3,_0x5c940c){return db['VoiceRecording']['create'](_0x22aed3[_0x31b6('0x44')],{})[_0x31b6('0x23')](respondWithResult(_0x5c940c,0xc9))[_0x31b6('0x40')](handleError(_0x5c940c,null));};exports[_0x31b6('0x45')]=function(_0x440041,_0x11ea41){if(_0x440041[_0x31b6('0x44')]['id']){delete _0x440041[_0x31b6('0x44')]['id'];}return db[_0x31b6('0x3e')][_0x31b6('0x42')]({'where':{'id':_0x440041[_0x31b6('0x46')]['id']}})[_0x31b6('0x23')](handleEntityNotFound(_0x11ea41,null))['then'](saveUpdates(_0x440041[_0x31b6('0x44')],null))[_0x31b6('0x23')](respondWithResult(_0x11ea41,null))[_0x31b6('0x40')](handleError(_0x11ea41,null));};exports[_0x31b6('0x47')]=function(_0x571361,_0x379b7b){return db[_0x31b6('0x3e')]['describe']()[_0x31b6('0x23')](respondWithResult(_0x379b7b,null))[_0x31b6('0x40')](handleError(_0x379b7b,null));};exports[_0x31b6('0x48')]=function(_0x457077,_0x15975c,_0x25aa95){var _0x523d78=require(_0x31b6('0x49'));var _0x45d5ba=![];var _0x127139={};if(_0x457077[_0x31b6('0x2d')][_0x31b6('0x29')]&&_0x457077['query']['type']===_0x31b6('0x4a')){_0x127139[_0x31b6('0x4a')]=_0x457077[_0x31b6('0x46')]['id'];}else{_0x127139['id']=_0x457077[_0x31b6('0x46')]['id'];}return db['VoiceRecording']['find']({'where':_0x127139,'attributes':['id',_0x31b6('0x4b')],'raw':!![]})[_0x31b6('0x23')](handleEntityNotFound(_0x15975c,null))[_0x31b6('0x23')](function(_0x3094fa){if(_0x3094fa){var _0x595b2d=_0x3094fa[_0x31b6('0x4b')];var _0x3daca6=util[_0x31b6('0x2c')](_0x31b6('0x4c'),_0x595b2d);if(fs[_0x31b6('0x4d')](_0x3daca6)){_0x45d5ba=!![];return _0x523d78['decryptFile'](_0x3daca6,_0x595b2d,config[_0x31b6('0x4e')][_0x31b6('0x4f')])['then'](function(){return _0x3094fa;});}return _0x3094fa;}})['then'](function(_0x133622){if(_0x133622){var _0x1e0d7a=_0x133622[_0x31b6('0x4b')];if(!fs[_0x31b6('0x4d')](_0x1e0d7a)){throw new db[(_0x31b6('0x50'))][(_0x31b6('0x51'))](_0x31b6('0x52'));}if(_0x133622[_0x31b6('0x53')]){return _0x15975c[_0x31b6('0x48')](_0x1e0d7a,_0x133622['filename']+path[_0x31b6('0x54')](_0x1e0d7a),function(){if(_0x45d5ba){fs[_0x31b6('0x55')](_0x1e0d7a);}});}else{return _0x15975c[_0x31b6('0x48')](_0x1e0d7a,function(_0x52068f){if(_0x45d5ba){fs[_0x31b6('0x55')](_0x1e0d7a);}});}}})['catch'](function(_0x4bc002){if(_0x4bc002[_0x31b6('0x56')]===_0x31b6('0x52')){_0x15975c[_0x31b6('0x18')](0x194)[_0x31b6('0x57')](_0x31b6('0x58'));}else{return handleError(_0x15975c,null);}});};exports['downloads']=function(_0xb7a8c0,_0x4059d5,_0x35bbf3){var _0x44f710=require('../../components/encryptor');var _0x499dcd=![];var _0x2eeb26={'$and':[db[_0x31b6('0x59')][_0x31b6('0x38')](db[_0x31b6('0x59')]['fn']('MD5',db[_0x31b6('0x59')][_0x31b6('0x5a')]('uniqueid')),_0xb7a8c0[_0x31b6('0x2d')]['token'])]};if(_0xb7a8c0[_0x31b6('0x2d')][_0x31b6('0x29')]&&_0xb7a8c0[_0x31b6('0x2d')][_0x31b6('0x29')]===_0x31b6('0x4a')){_0x2eeb26[_0x31b6('0x5b')][_0x31b6('0x5c')]({'uniqueid':_0xb7a8c0['params']['id']});}else{_0x2eeb26[_0x31b6('0x5b')]['push']({'id':_0xb7a8c0[_0x31b6('0x46')]['id']});}return db[_0x31b6('0x3e')][_0x31b6('0x42')]({'where':_0x2eeb26,'attributes':['id','value'],'raw':!![]})[_0x31b6('0x23')](handleEntityNotFound(_0x4059d5,null))['then'](function(_0x517691){if(_0x517691){var _0xc07092=util['format'](_0x31b6('0x4c'),_0x517691[_0x31b6('0x4b')]);if(fs[_0x31b6('0x4d')](_0xc07092)){_0x499dcd=!![];return _0x44f710[_0x31b6('0x5d')](_0xc07092,_0x517691[_0x31b6('0x4b')],config[_0x31b6('0x4e')][_0x31b6('0x4f')])[_0x31b6('0x23')](function(){return _0x517691;});}return _0x517691;}})[_0x31b6('0x23')](function(_0x34a264){if(_0x34a264){if(!fs[_0x31b6('0x4d')](_0x34a264[_0x31b6('0x4b')])){throw new db[(_0x31b6('0x50'))][(_0x31b6('0x51'))]('VoiceRecording\x20not\x20found');}if(_0x34a264[_0x31b6('0x53')]){return _0x4059d5[_0x31b6('0x48')](_0x34a264[_0x31b6('0x4b')],_0x34a264[_0x31b6('0x53')]+path['extname'](_0x34a264['value']),function(){if(_0x499dcd){fs['unlink'](_0x34a264[_0x31b6('0x4b')]);}});}else{return _0x4059d5['download'](_0x34a264[_0x31b6('0x4b')],function(_0x591af7){if(_0x499dcd){fs['unlink'](_0x34a264[_0x31b6('0x4b')]);}});}}})[_0x31b6('0x40')](handleError(_0x4059d5,null));};exports[_0x31b6('0x24')]=function(_0x5ef25a,_0x32d8cd){return db[_0x31b6('0x3e')]['find']({'where':{'id':_0x5ef25a[_0x31b6('0x46')]['id']}})[_0x31b6('0x23')](function(_0x3fbd94){if(_[_0x31b6('0x5e')](_0x3fbd94)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3fbd94;})[_0x31b6('0x23')](function(_0x921f7){var _0x4ae098=_0x921f7[_0x31b6('0x4b')];logger[_0x31b6('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x4ae098);if(!_[_0x31b6('0x5e')](_0x921f7[_0x31b6('0x4b')])&&fs[_0x31b6('0x4d')](_0x4ae098)){logger[_0x31b6('0x5f')](_0x31b6('0x60')+_0x4ae098+_0x31b6('0x61'));fs['unlinkSync'](_0x4ae098);}_0x4ae098=_0x4ae098+_0x31b6('0x62');if(!_['isNil'](_0x921f7[_0x31b6('0x4b')])&&fs[_0x31b6('0x4d')](_0x4ae098)){logger[_0x31b6('0x5f')](_0x31b6('0x60')+_0x4ae098+_0x31b6('0x61'));fs[_0x31b6('0x63')](_0x4ae098);}return _0x921f7;})[_0x31b6('0x23')](function(_0x233556){if(!_0x233556)throw new InternalError();return _0x233556['destroy']();})[_0x31b6('0x23')](function(){_0x32d8cd[_0x31b6('0x18')](0xcc)[_0x31b6('0x19')]();})['catch'](handleError(_0x32d8cd,null));};function getBucketslist(_0x2ebe9c,_0x1e8a71,_0x102615){return new Promise(function(_0x110847,_0x154afe){var _0x5212a2=new AWS['S3']({'accessKeyId':_0x1e8a71,'secretAccessKey':_0x2ebe9c,'region':_0x102615});_0x5212a2[_0x31b6('0x64')]({},function(_0x5e5240,_0x483536){if(_0x5e5240){return _0x154afe(_0x5e5240);}else{return _0x110847(_0x483536);}});});}function createBucket(_0x5b916b,_0x1d2056,_0x12f9e2,_0x2b8ff4){return new Promise(function(_0x4339ae,_0x52a399){var _0x27db82=new AWS['S3']({'accessKeyId':_0x1d2056,'secretAccessKey':_0x5b916b,'region':_0x12f9e2});_0x27db82[_0x31b6('0x65')]({'Bucket':_0x2b8ff4},function(_0x20de74,_0x138f1f){if(_0x20de74){return _0x52a399(_0x20de74);}else{return _0x4339ae(_0x138f1f);}});});}function uploadFile(_0x4dde8c,_0x327735,_0x55609e,_0x1a653c,_0x409084,_0x3eccc0){return new Promise(function(_0x563061,_0x3b048c){var _0x4e9c0b=new AWS['S3']({'accessKeyId':_0x327735,'secretAccessKey':_0x4dde8c,'region':_0x55609e});_0x4e9c0b['upload']({'Bucket':_0x1a653c,'Key':_0x409084,'Body':_0x3eccc0},function(_0x503d67,_0xfa438e){if(_0x503d67){return _0x3b048c(_0x503d67);}else{return _0x563061(_0xfa438e);}});});}function startTranscribe(_0x290517,_0x5962f4,_0x5a648e,_0x3dfc72,_0x54c784,_0x5b2b4f){return new Promise(function(_0x26ff06,_0x2a63db){var _0x1825b8=new AWS[(_0x31b6('0x66'))]({'accessKeyId':_0x5962f4,'secretAccessKey':_0x290517,'region':_0x5a648e});_0x1825b8[_0x31b6('0x67')]({'TranscriptionJobName':_0x3dfc72,'LanguageCode':_0x54c784,'Media':{'MediaFileUri':_0x5b2b4f}},function(_0x400507,_0x5da2a2){if(_0x400507){return _0x2a63db(_0x400507);}else{return _0x26ff06(_0x5da2a2);}});});}function transcribe(_0x2861c2,_0x5e3ea2,_0x2214a7,_0x4bec91,_0x415bac,_0x4a0e2d,_0x151eab){return new Promise(function(_0xedc31a,_0x5726a0){var _0x55046f={};logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')](_0x31b6('0x68'),_0x2861c2,_0x415bac));return uploadFile(_0x5e3ea2,_0x2214a7,_0x4bec91,_0x415bac,path[_0x31b6('0x69')](_0x4a0e2d),fs[_0x31b6('0x6a')](_0x4a0e2d))[_0x31b6('0x23')](function(_0x213c92){logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')](_0x31b6('0x6b'),_0x2861c2,_0x415bac,_0x213c92[_0x31b6('0x6c')]));_0x55046f[_0x31b6('0x6d')]=_0x213c92[_0x31b6('0x6e')];_0x55046f['location']=_0x213c92[_0x31b6('0x6c')];logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2861c2));return startTranscribe(_0x5e3ea2,_0x2214a7,_0x4bec91,uuidv4(),_0x151eab,_0x213c92[_0x31b6('0x6c')]);})['then'](function(_0x153a94){logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')](_0x31b6('0x6f'),_0x2861c2,_0x153a94[_0x31b6('0x70')][_0x31b6('0x71')]));_0x55046f[_0x31b6('0x72')]=_0x153a94[_0x31b6('0x70')][_0x31b6('0x71')];_0x55046f['transcribeStatus']=_0x153a94[_0x31b6('0x70')][_0x31b6('0x73')];return _0xedc31a(_0x55046f);})['catch'](function(_0x30f370){return _0x5726a0(_0x30f370);});});}exports[_0x31b6('0x74')]=function(_0x529285,_0x4c1b4b,_0x14901e){var _0xa900ec;var _0x21a12b;var _0x18ac8b;var _0x3b0843=require(_0x31b6('0x49'));return db[_0x31b6('0x3e')][_0x31b6('0x75')]({'where':{'id':_0x529285[_0x31b6('0x46')]['id']}})['then'](function(_0x31f1ed){if(_0x31f1ed){var _0x25f620=util[_0x31b6('0x2c')](_0x31b6('0x4c'),_0x31f1ed[_0x31b6('0x4b')]);if(fs['existsSync'](_0x25f620)){cypher=!![];return _0x3b0843['decryptFile'](_0x25f620,_0x31f1ed['value'],config[_0x31b6('0x4e')]['recording'])['then'](function(){return _0x31f1ed;});}return _0x31f1ed;}})[_0x31b6('0x23')](function(_0x19834d){if(!_0x19834d){throw new db[(_0x31b6('0x50'))]['ValidationError'](_0x31b6('0x76'));}_0x21a12b=_0x19834d;return db[_0x31b6('0x77')][_0x31b6('0x75')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x4c1b4b,null))[_0x31b6('0x23')](function(_0x551846){if(_0x551846){_0xa900ec=_0x551846;if(!_0xa900ec[_0x31b6('0x78')]||!_0xa900ec[_0x31b6('0x79')]||!_0xa900ec['transcribeRegion']||!_0xa900ec[_0x31b6('0x7a')]||!_0xa900ec[_0x31b6('0x6d')]){throw new db[(_0x31b6('0x50'))][(_0x31b6('0x51'))]('Transcribe\x20not\x20configured');}if(_0x529285[_0x31b6('0x44')]['runSentiment']&&(!_0xa900ec[_0x31b6('0x7b')]||!_0xa900ec[_0x31b6('0x7c')]||!_0xa900ec[_0x31b6('0x7d')]||!_0xa900ec[_0x31b6('0x7a')]||!_0xa900ec[_0x31b6('0x6d')])){throw new db[(_0x31b6('0x50'))]['ValidationError'](_0x31b6('0x7e'));}return db[_0x31b6('0x7f')][_0x31b6('0x75')]({'where':{'id':_0xa900ec[_0x31b6('0x79')]}});}})[_0x31b6('0x23')](function(_0x24f982){if(!_0x24f982){throw new db['Sequelize'][(_0x31b6('0x51'))](_0x31b6('0x80'));}if(!_0x24f982[_0x31b6('0x81')]||!_0x24f982['data2']){throw new db[(_0x31b6('0x50'))][(_0x31b6('0x51'))](_0x31b6('0x82'));}_0x18ac8b=_0x24f982;return getBucketslist(_0x18ac8b['data1'],_0x18ac8b['data2'],_0xa900ec[_0x31b6('0x83')]);})['then'](function(_0x4ff1cd){if(_0x4ff1cd&&_0x4ff1cd[_0x31b6('0x84')]){var _0xa85e2a=_[_0x31b6('0x42')](_0x4ff1cd[_0x31b6('0x84')],function(_0x306f90){return _0x306f90[_0x31b6('0x85')]===_0xa900ec[_0x31b6('0x6d')];});if(!_0xa85e2a){logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x529285[_0x31b6('0x46')]['id'],_0xa900ec['bucket']));return createBucket(_0x18ac8b[_0x31b6('0x81')],_0x18ac8b[_0x31b6('0x86')],_0xa900ec[_0x31b6('0x83')],_0xa900ec['bucket']);}logger['info'](util[_0x31b6('0x2c')](_0x31b6('0x87'),_0x529285[_0x31b6('0x46')]['id'],_0xa900ec[_0x31b6('0x6d')]));return;}})[_0x31b6('0x23')](function(_0x5cd964){if(_0x21a12b[_0x31b6('0x88')]===_0x31b6('0x89')){return transcribe(_0x529285[_0x31b6('0x46')]['id'],_0x18ac8b[_0x31b6('0x81')],_0x18ac8b['data2'],_0xa900ec[_0x31b6('0x83')],_0xa900ec['bucket'],_0x21a12b['value'],_0xa900ec['language']);}else{logger[_0x31b6('0x5f')](util[_0x31b6('0x2c')](_0x31b6('0x8a'),_0x529285[_0x31b6('0x46')]['id']));return{'transcribeStatus':_0x31b6('0x8b')};}})[_0x31b6('0x23')](function(_0x308e02){if(_0x308e02){_0x308e02[_0x31b6('0x8c')]=_0x529285['body'][_0x31b6('0x8d')];return _0x21a12b[_0x31b6('0x8e')](_0x308e02);}})[_0x31b6('0x23')](respondWithResult(_0x4c1b4b,null))[_0x31b6('0x40')](handleError(_0x4c1b4b,null));};function writeFile(_0x5b9d6f,_0x58369e){return new Promise(function(_0x15f3d1,_0xb3b869){fs[_0x31b6('0x8f')](_0x58369e,_0x5b9d6f,function(_0x40139d,_0x3d5afa){if(_0x40139d){return _0xb3b869(_0x40139d);}else{return _0x15f3d1(_0x3d5afa);}});});}exports['downloadTranscribe']=function(_0x320141,_0x4b0ba2,_0x2400f1){return db['VoiceRecording'][_0x31b6('0x75')]({'where':{'id':_0x320141['params']['id']}})[_0x31b6('0x23')](handleEntityNotFound(_0x4b0ba2))[_0x31b6('0x23')](function(_0x38a600){if(_0x38a600&&_0x38a600[_0x31b6('0x90')]){var _0x3071a9=_0x38a600[_0x31b6('0x90')];var _0x1d4eae=config['root']+'/server/files/transcribes/transcribe_'+_0x38a600['id']+'.txt';if(fs[_0x31b6('0x4d')](_0x1d4eae)){return _0x1d4eae;}return writeFile(_0x3071a9,_0x1d4eae)['then'](function(){return _0x1d4eae;});}else{throw new db['Sequelize']['ValidationError']('Transcript\x20not\x20available');}})[_0x31b6('0x23')](function(_0x24d923){return _0x4b0ba2[_0x31b6('0x48')](_0x24d923);})['catch'](handleError(_0x4b0ba2));};
\ No newline at end of file
index 84f9ced..73b3a83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49a1=['exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x49a1,0x190));var _0x149a=function(_0x2f78ef,_0x75e901){_0x2f78ef=_0x2f78ef-0x0;var _0x11036c=_0x49a1[_0x2f78ef];return _0x11036c;};'use strict';var _=require(_0x149a('0x0'));var util=require(_0x149a('0x1'));var logger=require(_0x149a('0x2'))(_0x149a('0x3'));var moment=require(_0x149a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x149a('0x5'));var config=require(_0x149a('0x6'));var attributes=require('./voiceRecording.attributes');module[_0x149a('0x7')]=function(_0x25e18e,_0x5b4b37){return _0x25e18e[_0x149a('0x8')]('VoiceRecording',attributes,{'tableName':_0x149a('0x9'),'paranoid':![],'indexes':[{'name':_0x149a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ab9=['../../config/environment','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2de1f2,_0x28f2a4){var _0x303c80=function(_0x88931){while(--_0x88931){_0x2de1f2['push'](_0x2de1f2['shift']());}};_0x303c80(++_0x28f2a4);}(_0x9ab9,0x19d));var _0x99ab=function(_0x1c100d,_0x3d8861){_0x1c100d=_0x1c100d-0x0;var _0x3d075c=_0x9ab9[_0x1c100d];return _0x3d075c;};'use strict';var _=require(_0x99ab('0x0'));var util=require(_0x99ab('0x1'));var logger=require(_0x99ab('0x2'))(_0x99ab('0x3'));var moment=require(_0x99ab('0x4'));var BPromise=require('bluebird');var rp=require(_0x99ab('0x5'));var fs=require('fs');var path=require(_0x99ab('0x6'));var rimraf=require('rimraf');var config=require(_0x99ab('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x99ab('0x8')]=function(_0x1042a3,_0x390d41){return _0x1042a3[_0x99ab('0x9')](_0x99ab('0xa'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x99ab('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 611174c..b6d0702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c6=['unlink','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','create','body','existsSync','value','%s.cypher','encryptFile','secrets'];(function(_0x1ca5a7,_0x1a2974){var _0x30ca42=function(_0x183f38){while(--_0x183f38){_0x1ca5a7['push'](_0x1ca5a7['shift']());}};_0x30ca42(++_0x1a2974);}(_0x81c6,0x1d5));var _0x681c=function(_0x17fc20,_0x7d3f2f){_0x17fc20=_0x17fc20-0x0;var _0x29d108=_0x81c6[_0x17fc20];return _0x29d108;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45331,_0xdc57a5,_0x5624d7){return new BPromise(function(_0x5b5f22,_0x1750e2){return client[_0x681c('0x8')](_0x45331,_0x5624d7)[_0x681c('0x9')](function(_0x5de78e){logger['info'](_0x681c('0xa'),_0xdc57a5,'request\x20sent');logger[_0x681c('0xb')](_0x681c('0xc'),_0xdc57a5,_0x681c('0xd'),JSON[_0x681c('0xe')](_0x5de78e));if(_0x5de78e['error']){if(_0x5de78e['error'][_0x681c('0xf')]===0x1f4){logger[_0x681c('0x10')](_0x681c('0xa'),_0xdc57a5,_0x5de78e['error'][_0x681c('0x11')]);return _0x1750e2(_0x5de78e['error'][_0x681c('0x11')]);}logger['error'](_0x681c('0xa'),_0xdc57a5,_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);return _0x5b5f22(_0x5de78e[_0x681c('0x10')][_0x681c('0x11')]);}else{logger[_0x681c('0x12')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x681c('0xd'));_0x5b5f22(_0x5de78e[_0x681c('0x13')][_0x681c('0x11')]);}})[_0x681c('0x14')](function(_0x2fce11){logger[_0x681c('0x10')]('VoiceRecording,\x20%s,\x20%s',_0xdc57a5,_0x2fce11);_0x1750e2(_0x2fce11);});});}exports[_0x681c('0x15')]=function(_0x42f506){var _0x4a9192=this;return new Promise(function(_0x42304f,_0x5b03fd){return db[_0x681c('0x16')][_0x681c('0x17')](_0x42f506['body'],{'raw':_0x42f506[_0x681c('0x18')]?_0x42f506['options'][_0x681c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f506[_0x681c('0x18')]?_0x42f506[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'attributes':_0x42f506[_0x681c('0x18')]?_0x42f506['options']['attributes']||null:null,'limit':_0x42f506['options']?_0x42f506[_0x681c('0x18')][_0x681c('0x1b')]||null:null})[_0x681c('0x9')](function(_0x27b8a0){logger[_0x681c('0x12')](_0x681c('0x15'),_0x42f506);logger[_0x681c('0xb')](_0x681c('0x15'),_0x42f506,JSON[_0x681c('0xe')](_0x27b8a0));_0x42304f(_0x27b8a0);})[_0x681c('0x14')](function(_0x2be552){logger[_0x681c('0x10')](_0x681c('0x15'),_0x2be552[_0x681c('0x11')],_0x42f506);_0x5b03fd(_0x4a9192[_0x681c('0x10')](0x1f4,_0x2be552[_0x681c('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x11063b){var _0x5705a7=this;return new Promise(function(_0x5f8d64,_0x4bf08e){var _0x583499=require(_0x681c('0x1c'));var _0x17ea7c;return db[_0x681c('0x1d')][_0x681c('0x1e')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x681c('0x9')](function(_0x39fca3){_0x17ea7c=_0x39fca3;return db[_0x681c('0x16')][_0x681c('0x1f')](_0x11063b[_0x681c('0x20')]);})[_0x681c('0x9')](function(_0x2c619f){if(_0x17ea7c['callRecordingEncryption']&&fs[_0x681c('0x21')](_0x2c619f[_0x681c('0x22')])){var _0x2e783d=util['format'](_0x681c('0x23'),_0x2c619f[_0x681c('0x22')]);return _0x583499[_0x681c('0x24')](_0x2c619f['value'],_0x2e783d,config[_0x681c('0x25')]['recording'])['then'](function(){fs[_0x681c('0x26')](_0x2c619f[_0x681c('0x22')]);logger[_0x681c('0x12')]('CreateVoiceRecording\x20file\x20encrypted');return _0x2c619f;});}return _0x2c619f;})[_0x681c('0x9')](function(_0x508fb9){logger[_0x681c('0x12')]('CreateVoiceRecording',_0x11063b);logger['debug']('CreateVoiceRecording',_0x11063b,JSON[_0x681c('0xe')](_0x508fb9));_0x5f8d64(_0x508fb9);})[_0x681c('0x14')](function(_0x5a349a){logger[_0x681c('0x10')]('CreateVoiceRecording',_0x5a349a['message'],_0x11063b);_0x4bf08e(_0x5705a7[_0x681c('0x10')](0x1f4,_0x5a349a['message']));});});};
\ No newline at end of file
+var _0xe3da=['CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceRecording','update','body','options','where','attributes','limit','then','UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink'];(function(_0x237879,_0x37c73e){var _0x3f651a=function(_0x217cba){while(--_0x217cba){_0x237879['push'](_0x237879['shift']());}};_0x3f651a(++_0x37c73e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['UpdateVoiceRecording']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')](_0x3f8cf9[_0xae3d('0x1a')],{'raw':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9['options'][_0xae3d('0x1c')]||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1d')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1b')]?_0x3f8cf9[_0xae3d('0x1b')][_0xae3d('0x1e')]||null:null})[_0xae3d('0x1f')](function(_0x3224ff){logger[_0xae3d('0xe')](_0xae3d('0x20'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x20'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x3224ff));_0x558e42(_0x3224ff);})[_0xae3d('0x21')](function(_0x1fe90f){logger[_0xae3d('0x14')](_0xae3d('0x20'),_0x1fe90f[_0xae3d('0x16')],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x1fe90f['message']));});});};exports[_0xae3d('0x22')]=function(_0x185e71){var _0xb5940=this;return new Promise(function(_0x52df0f,_0x256bd0){var _0x4391db=require(_0xae3d('0x23'));var _0x54c1e1;return db['Setting'][_0xae3d('0x24')]({'attributes':['id',_0xae3d('0x25')],'where':{'id':0x1},'raw':!![]})[_0xae3d('0x1f')](function(_0x3114f9){_0x54c1e1=_0x3114f9;return db[_0xae3d('0x18')]['create'](_0x185e71[_0xae3d('0x1a')]);})[_0xae3d('0x1f')](function(_0x5a39c5){if(_0x54c1e1[_0xae3d('0x25')]&&fs[_0xae3d('0x26')](_0x5a39c5[_0xae3d('0x27')])){var _0x46f484=util[_0xae3d('0x28')](_0xae3d('0x29'),_0x5a39c5['value']);return _0x4391db['encryptFile'](_0x5a39c5['value'],_0x46f484,config[_0xae3d('0x2a')][_0xae3d('0x2b')])[_0xae3d('0x1f')](function(){fs[_0xae3d('0x2c')](_0x5a39c5['value']);logger[_0xae3d('0xe')](_0xae3d('0x2d'));return _0x5a39c5;});}return _0x5a39c5;})[_0xae3d('0x1f')](function(_0x3748d2){logger[_0xae3d('0xe')](_0xae3d('0x22'),_0x185e71);logger[_0xae3d('0x11')]('CreateVoiceRecording',_0x185e71,JSON[_0xae3d('0x13')](_0x3748d2));_0x52df0f(_0x3748d2);})['catch'](function(_0x55aae4){logger[_0xae3d('0x14')]('CreateVoiceRecording',_0x55aae4[_0xae3d('0x16')],_0x185e71);_0x256bd0(_0xb5940['error'](0x1f4,_0x55aae4['message']));});});};
\ No newline at end of file
index 2cc7178..296aa8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53dd=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','index','/describe','isAuthenticated','get','/:id','show','post','create','update','delete','destroy'];(function(_0x1ebf22,_0x273424){var _0x326d54=function(_0x55c3e8){while(--_0x55c3e8){_0x1ebf22['push'](_0x1ebf22['shift']());}};_0x326d54(++_0x273424);}(_0x53dd,0xe8));var _0xd53d=function(_0x24982a,_0x335d1c){_0x24982a=_0x24982a-0x0;var _0x57b651=_0x53dd[_0x24982a];return _0x57b651;};'use strict';var multer=require('multer');var util=require(_0xd53d('0x0'));var path=require('path');var timeout=require(_0xd53d('0x1'));var express=require(_0xd53d('0x2'));var router=express[_0xd53d('0x3')]();var fs_extra=require(_0xd53d('0x4'));var auth=require(_0xd53d('0x5'));var interaction=require(_0xd53d('0x6'));var config=require(_0xd53d('0x7'));var controller=require(_0xd53d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd53d('0x9')]);router['get'](_0xd53d('0xa'),auth[_0xd53d('0xb')](),controller['describe']);router[_0xd53d('0xc')](_0xd53d('0xd'),auth['isAuthenticated'](),controller[_0xd53d('0xe')]);router[_0xd53d('0xf')]('/',auth['isAuthenticated'](),controller[_0xd53d('0x10')]);router['put'](_0xd53d('0xd'),auth[_0xd53d('0xb')](),controller[_0xd53d('0x11')]);router[_0xd53d('0x12')](_0xd53d('0xd'),auth[_0xd53d('0xb')](),controller[_0xd53d('0x13')]);module[_0xd53d('0x14')]=router;
\ No newline at end of file
+var _0xbbe8=['fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0xbbe8,0x165));var _0x8bbe=function(_0x4a8e69,_0x593023){_0x4a8e69=_0x4a8e69-0x0;var _0x55d440=_0xbbe8[_0x4a8e69];return _0x55d440;};'use strict';var multer=require(_0x8bbe('0x0'));var util=require(_0x8bbe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8bbe('0x2'));var router=express[_0x8bbe('0x3')]();var fs_extra=require(_0x8bbe('0x4'));var auth=require(_0x8bbe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8bbe('0x6'));router[_0x8bbe('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8bbe('0x7')](_0x8bbe('0x8'),auth[_0x8bbe('0x9')](),controller[_0x8bbe('0xa')]);router['get']('/:id',auth[_0x8bbe('0x9')](),controller['show']);router[_0x8bbe('0xb')]('/',auth[_0x8bbe('0x9')](),controller[_0x8bbe('0xc')]);router[_0x8bbe('0xd')](_0x8bbe('0xe'),auth[_0x8bbe('0x9')](),controller[_0x8bbe('0xf')]);router[_0x8bbe('0x10')](_0x8bbe('0xe'),auth['isAuthenticated'](),controller[_0x8bbe('0x11')]);module[_0x8bbe('0x12')]=router;
\ No newline at end of file
index 3378134..b8d1e71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d1f=['attended','STRING','sequelize','moment','ENUM','blind'];(function(_0x2c30d5,_0x53b615){var _0x56471b=function(_0x507b36){while(--_0x507b36){_0x2c30d5['push'](_0x2c30d5['shift']());}};_0x56471b(++_0x53b615);}(_0x3d1f,0x16a));var _0xf3d1=function(_0x2462ae,_0x1d27e2){_0x2462ae=_0x2462ae-0x0;var _0x493ded=_0x3d1f[_0x2462ae];return _0x493ded;};'use strict';var Sequelize=require(_0xf3d1('0x0'));var moment=require(_0xf3d1('0x1'));module['exports']={'type':{'type':Sequelize[_0xf3d1('0x2')](_0xf3d1('0x3'),_0xf3d1('0x4'))},'result':{'type':Sequelize[_0xf3d1('0x5')]},'transfererchannel':{'type':Sequelize[_0xf3d1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf3d1('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf3d1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf3d1('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xf3d1('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0xf3d1('0x5')]},'transfererexten':{'type':Sequelize[_0xf3d1('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf3d1('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xf3d1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf3d1('0x5')]},'transfereeexten':{'type':Sequelize[_0xf3d1('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf3d1('0x5')]},'isexternal':{'type':Sequelize[_0xf3d1('0x2')]('Yes','No')},'context':{'type':Sequelize[_0xf3d1('0x5')]},'extension':{'type':Sequelize[_0xf3d1('0x5')]}};
\ No newline at end of file
+var _0xbd62=['sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0xbd62,0x12d));var _0x2bd6=function(_0x393b47,_0x29eb8d){_0x393b47=_0x393b47-0x0;var _0xf61bec=_0xbd62[_0x393b47];return _0xf61bec;};'use strict';var Sequelize=require(_0x2bd6('0x0'));var moment=require(_0x2bd6('0x1'));module[_0x2bd6('0x2')]={'type':{'type':Sequelize[_0x2bd6('0x3')](_0x2bd6('0x4'),_0x2bd6('0x5'))},'result':{'type':Sequelize[_0x2bd6('0x6')]},'transfererchannel':{'type':Sequelize[_0x2bd6('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x2bd6('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2bd6('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x2bd6('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x2bd6('0x6')]},'transfererexten':{'type':Sequelize[_0x2bd6('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x2bd6('0x6')]},'transfereechannel':{'type':Sequelize[_0x2bd6('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x2bd6('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x2bd6('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2bd6('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2bd6('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x2bd6('0x6')]},'transfereeexten':{'type':Sequelize[_0x2bd6('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x2bd6('0x6')]},'isexternal':{'type':Sequelize[_0x2bd6('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x2bd6('0x6')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6435ec5..1a86cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd29=['filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd29,0x137));var _0x9bd2=function(_0x1dd2fe,_0x478f00){_0x1dd2fe=_0x1dd2fe-0x0;var _0x281cf0=_0xbd29[_0x1dd2fe];return _0x281cf0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9bd2('0x0'));var zipdir=require(_0x9bd2('0x1'));var jsonpatch=require(_0x9bd2('0x2'));var rp=require(_0x9bd2('0x3'));var moment=require(_0x9bd2('0x4'));var BPromise=require(_0x9bd2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9bd2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bd2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9bd2('0x8'));var jsforce=require(_0x9bd2('0x9'));var deskjs=require(_0x9bd2('0xa'));var toCsv=require(_0x9bd2('0xb'));var querystring=require(_0x9bd2('0xc'));var Papa=require(_0x9bd2('0xd'));var Redis=require(_0x9bd2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9bd2('0xf'));var hardwareService=require(_0x9bd2('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9bd2('0x11'));var config=require(_0x9bd2('0x12'));var licenseUtil=require(_0x9bd2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5efa53,_0x4da0c0){_0x4da0c0=_0x4da0c0||0xcc;return function(_0x2ed365){if(_0x2ed365){return _0x5efa53[_0x9bd2('0x14')](_0x4da0c0);}return _0x5efa53['status'](_0x4da0c0)[_0x9bd2('0x15')]();};}function respondWithResult(_0x3d1208,_0x1f70e0){_0x1f70e0=_0x1f70e0||0xc8;return function(_0x12720c){if(_0x12720c){return _0x3d1208[_0x9bd2('0x16')](_0x1f70e0)[_0x9bd2('0x17')](_0x12720c);}};}function respondWithFilteredResult(_0xebfa98,_0xaf48f5){return function(_0x4ed7a4){if(_0x4ed7a4){var _0x821211=typeof _0xaf48f5[_0x9bd2('0x18')]==='undefined'&&typeof _0xaf48f5[_0x9bd2('0x19')]===_0x9bd2('0x1a');var _0x28abbd=_0x4ed7a4[_0x9bd2('0x1b')];var _0x4a5e82=_0x821211?0x0:_0xaf48f5['offset'];var _0x28dd57=_0x821211?_0x4ed7a4[_0x9bd2('0x1b')]:_0xaf48f5[_0x9bd2('0x18')]+_0xaf48f5[_0x9bd2('0x19')];var _0x2811a2;if(_0x28dd57>=_0x28abbd){_0x28dd57=_0x28abbd;_0x2811a2=0xc8;}else{_0x2811a2=0xce;}_0xebfa98['status'](_0x2811a2);return _0xebfa98[_0x9bd2('0x1c')](_0x9bd2('0x1d'),_0x4a5e82+'-'+_0x28dd57+'/'+_0x28abbd)[_0x9bd2('0x17')](_0x4ed7a4);}return null;};}function patchUpdates(_0x3ead9b){return function(_0x19ca48){try{jsonpatch[_0x9bd2('0x1e')](_0x19ca48,_0x3ead9b,!![]);}catch(_0x1f4813){return BPromise[_0x9bd2('0x1f')](_0x1f4813);}return _0x19ca48[_0x9bd2('0x20')]();};}function saveUpdates(_0x5883bf,_0x306d1c){return function(_0x376277){if(_0x376277){return _0x376277[_0x9bd2('0x21')](_0x5883bf)[_0x9bd2('0x22')](function(_0x445ad4){return _0x445ad4;});}return null;};}function removeEntity(_0x2a577b,_0xa3ef04){return function(_0x448a42){if(_0x448a42){return _0x448a42[_0x9bd2('0x23')]()[_0x9bd2('0x22')](function(){_0x2a577b[_0x9bd2('0x16')](0xcc)[_0x9bd2('0x15')]();});}};}function handleEntityNotFound(_0x446032,_0x34b236){return function(_0x16a472){if(!_0x16a472){_0x446032[_0x9bd2('0x14')](0x194);}return _0x16a472;};}function handleError(_0x84a31,_0x44d5bd){_0x44d5bd=_0x44d5bd||0x1f4;return function(_0xb35270){logger[_0x9bd2('0x24')](_0xb35270[_0x9bd2('0x25')]);if(_0xb35270[_0x9bd2('0x26')]){delete _0xb35270[_0x9bd2('0x26')];}_0x84a31[_0x9bd2('0x16')](_0x44d5bd)['send'](_0xb35270);};}exports[_0x9bd2('0x27')]=function(_0x2ff9dd,_0x2242c2){var _0x1413ce={},_0x24f70f={},_0x287eaf={'count':0x0,'rows':[]};var _0x282c32=_[_0x9bd2('0x28')](db[_0x9bd2('0x29')][_0x9bd2('0x2a')],function(_0x5ac477){return{'name':_0x5ac477[_0x9bd2('0x2b')],'type':_0x5ac477[_0x9bd2('0x2c')][_0x9bd2('0x2d')]};});_0x24f70f[_0x9bd2('0x2e')]=_[_0x9bd2('0x28')](_0x282c32,'name');_0x24f70f[_0x9bd2('0x2f')]=_['keys'](_0x2ff9dd['query']);_0x24f70f[_0x9bd2('0x30')]=_[_0x9bd2('0x31')](_0x24f70f[_0x9bd2('0x2e')],_0x24f70f[_0x9bd2('0x2f')]);_0x1413ce[_0x9bd2('0x32')]=_[_0x9bd2('0x31')](_0x24f70f['model'],qs['fields'](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x33')]));_0x1413ce['attributes']=_0x1413ce[_0x9bd2('0x32')][_0x9bd2('0x34')]?_0x1413ce['attributes']:_0x24f70f['model'];if(!_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x35')](_0x9bd2('0x36'))){_0x1413ce[_0x9bd2('0x19')]=qs[_0x9bd2('0x19')](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x19')]);_0x1413ce[_0x9bd2('0x18')]=qs[_0x9bd2('0x18')](_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x18')]);}_0x1413ce[_0x9bd2('0x37')]=qs[_0x9bd2('0x38')](_0x2ff9dd['query'][_0x9bd2('0x38')]);_0x1413ce[_0x9bd2('0x39')]=qs['filters'](_[_0x9bd2('0x3a')](_0x2ff9dd[_0x9bd2('0x2f')],_0x24f70f[_0x9bd2('0x30')]),_0x282c32);if(_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3b')]){_0x1413ce[_0x9bd2('0x39')]=_[_0x9bd2('0x3c')](_0x1413ce[_0x9bd2('0x39')],{'$or':_[_0x9bd2('0x28')](_0x282c32,function(_0x4fe5dc){if(_0x4fe5dc[_0x9bd2('0x2c')]!==_0x9bd2('0x3d')){var _0x34eaf8={};_0x34eaf8[_0x4fe5dc['name']]={'$like':'%'+_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3b')]+'%'};return _0x34eaf8;}})});}_0x1413ce=_['merge']({},_0x1413ce,_0x2ff9dd['options']);var _0x297ae0={'where':_0x1413ce['where']};return db[_0x9bd2('0x29')][_0x9bd2('0x1b')](_0x297ae0)[_0x9bd2('0x22')](function(_0x1ef87a){_0x287eaf[_0x9bd2('0x1b')]=_0x1ef87a;if(_0x2ff9dd[_0x9bd2('0x2f')][_0x9bd2('0x3e')]){_0x1413ce[_0x9bd2('0x3f')]=[{'all':!![]}];}return db[_0x9bd2('0x29')][_0x9bd2('0x40')](_0x1413ce);})[_0x9bd2('0x22')](function(_0x91cede){_0x287eaf[_0x9bd2('0x41')]=_0x91cede;return _0x287eaf;})['then'](respondWithFilteredResult(_0x2242c2,_0x1413ce))['catch'](handleError(_0x2242c2,null));};exports[_0x9bd2('0x42')]=function(_0x278917,_0x94a80d){var _0x38d65c={'raw':!![],'where':{'id':_0x278917[_0x9bd2('0x43')]['id']}},_0x1cc323={};_0x1cc323['model']=_[_0x9bd2('0x44')](db[_0x9bd2('0x29')][_0x9bd2('0x2a')]);_0x1cc323[_0x9bd2('0x2f')]=_['keys'](_0x278917[_0x9bd2('0x2f')]);_0x1cc323[_0x9bd2('0x30')]=_[_0x9bd2('0x31')](_0x1cc323[_0x9bd2('0x2e')],_0x1cc323[_0x9bd2('0x2f')]);_0x38d65c['attributes']=_[_0x9bd2('0x31')](_0x1cc323['model'],qs[_0x9bd2('0x33')](_0x278917['query']['fields']));_0x38d65c[_0x9bd2('0x32')]=_0x38d65c['attributes'][_0x9bd2('0x34')]?_0x38d65c[_0x9bd2('0x32')]:_0x1cc323['model'];if(_0x278917[_0x9bd2('0x2f')]['includeAll']){_0x38d65c[_0x9bd2('0x3f')]=[{'all':!![]}];}_0x38d65c=_[_0x9bd2('0x3c')]({},_0x38d65c,_0x278917['options']);return db['VoiceTransferReport'][_0x9bd2('0x45')](_0x38d65c)[_0x9bd2('0x22')](handleEntityNotFound(_0x94a80d,null))[_0x9bd2('0x22')](respondWithResult(_0x94a80d,null))[_0x9bd2('0x46')](handleError(_0x94a80d,null));};exports[_0x9bd2('0x47')]=function(_0x49a956,_0x4fbbb8){return db['VoiceTransferReport'][_0x9bd2('0x47')](_0x49a956[_0x9bd2('0x48')],{})['then'](respondWithResult(_0x4fbbb8,0xc9))['catch'](handleError(_0x4fbbb8,null));};exports[_0x9bd2('0x21')]=function(_0x459ecd,_0x2f6af3){if(_0x459ecd[_0x9bd2('0x48')]['id']){delete _0x459ecd[_0x9bd2('0x48')]['id'];}return db[_0x9bd2('0x29')][_0x9bd2('0x45')]({'where':{'id':_0x459ecd[_0x9bd2('0x43')]['id']}})[_0x9bd2('0x22')](handleEntityNotFound(_0x2f6af3,null))[_0x9bd2('0x22')](saveUpdates(_0x459ecd[_0x9bd2('0x48')],null))['then'](respondWithResult(_0x2f6af3,null))[_0x9bd2('0x46')](handleError(_0x2f6af3,null));};exports['destroy']=function(_0xad5fe3,_0x2470a3){return db[_0x9bd2('0x29')][_0x9bd2('0x45')]({'where':{'id':_0xad5fe3[_0x9bd2('0x43')]['id']}})[_0x9bd2('0x22')](handleEntityNotFound(_0x2470a3,null))[_0x9bd2('0x22')](removeEntity(_0x2470a3,null))[_0x9bd2('0x46')](handleError(_0x2470a3,null));};exports[_0x9bd2('0x49')]=function(_0x435766,_0xf731c3){return db[_0x9bd2('0x29')][_0x9bd2('0x49')]()[_0x9bd2('0x22')](respondWithResult(_0xf731c3,null))[_0x9bd2('0x46')](handleError(_0xf731c3,null));};
\ No newline at end of file
+var _0x6ae6=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceTransferReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x510b72,_0x514bb0){var _0x362dbf=function(_0x9cd999){while(--_0x9cd999){_0x510b72['push'](_0x510b72['shift']());}};_0x362dbf(++_0x514bb0);}(_0x6ae6,0x1b1));var _0x66ae=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x6ae6[_0x37a79c];return _0x561d89;};'use strict';var emlformat=require(_0x66ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x66ae('0x1'));var jsonpatch=require(_0x66ae('0x2'));var rp=require('request-promise');var moment=require(_0x66ae('0x3'));var BPromise=require(_0x66ae('0x4'));var Mustache=require(_0x66ae('0x5'));var util=require(_0x66ae('0x6'));var path=require('path');var sox=require(_0x66ae('0x7'));var csv=require(_0x66ae('0x8'));var ejs=require(_0x66ae('0x9'));var fs=require('fs');var fs_extra=require(_0x66ae('0xa'));var _=require(_0x66ae('0xb'));var squel=require(_0x66ae('0xc'));var crypto=require('crypto');var jsforce=require(_0x66ae('0xd'));var deskjs=require(_0x66ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0x66ae('0xf'));var Papa=require(_0x66ae('0x10'));var Redis=require(_0x66ae('0x11'));var authService=require(_0x66ae('0x12'));var qs=require(_0x66ae('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66ae('0x14'));var logger=require(_0x66ae('0x15'))('api');var utils=require(_0x66ae('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x66ae('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x525376,_0x99ee96){_0x99ee96=_0x99ee96||0xcc;return function(_0x3dda3a){if(_0x3dda3a){return _0x525376[_0x66ae('0x18')](_0x99ee96);}return _0x525376[_0x66ae('0x19')](_0x99ee96)[_0x66ae('0x1a')]();};}function respondWithResult(_0x581cf2,_0x2fd793){_0x2fd793=_0x2fd793||0xc8;return function(_0x119d1a){if(_0x119d1a){return _0x581cf2['status'](_0x2fd793)[_0x66ae('0x1b')](_0x119d1a);}};}function respondWithFilteredResult(_0x45901b,_0xb10443){return function(_0x272395){if(_0x272395){var _0x52759c=typeof _0xb10443[_0x66ae('0x1c')]===_0x66ae('0x1d')&&typeof _0xb10443[_0x66ae('0x1e')]==='undefined';var _0x4356c2=_0x272395[_0x66ae('0x1f')];var _0x3dd60b=_0x52759c?0x0:_0xb10443[_0x66ae('0x1c')];var _0x2032b5=_0x52759c?_0x272395[_0x66ae('0x1f')]:_0xb10443[_0x66ae('0x1c')]+_0xb10443['limit'];var _0x1b6098;if(_0x2032b5>=_0x4356c2){_0x2032b5=_0x4356c2;_0x1b6098=0xc8;}else{_0x1b6098=0xce;}_0x45901b['status'](_0x1b6098);return _0x45901b[_0x66ae('0x20')](_0x66ae('0x21'),_0x3dd60b+'-'+_0x2032b5+'/'+_0x4356c2)[_0x66ae('0x1b')](_0x272395);}return null;};}function patchUpdates(_0x4929a6){return function(_0x3ed05a){try{jsonpatch[_0x66ae('0x22')](_0x3ed05a,_0x4929a6,!![]);}catch(_0x1d7a25){return BPromise[_0x66ae('0x23')](_0x1d7a25);}return _0x3ed05a[_0x66ae('0x24')]();};}function saveUpdates(_0x25c4c6,_0x5a9a81){return function(_0x581dac){if(_0x581dac){return _0x581dac[_0x66ae('0x25')](_0x25c4c6)[_0x66ae('0x26')](function(_0x3acf4f){return _0x3acf4f;});}return null;};}function removeEntity(_0x501917,_0x3a820f){return function(_0x2b084b){if(_0x2b084b){return _0x2b084b[_0x66ae('0x27')]()['then'](function(){_0x501917[_0x66ae('0x19')](0xcc)[_0x66ae('0x1a')]();});}};}function handleEntityNotFound(_0x289912,_0x51b387){return function(_0x33108e){if(!_0x33108e){_0x289912[_0x66ae('0x18')](0x194);}return _0x33108e;};}function handleError(_0x3af38e,_0x49b240){_0x49b240=_0x49b240||0x1f4;return function(_0x323306){logger[_0x66ae('0x28')](_0x323306[_0x66ae('0x29')]);if(_0x323306[_0x66ae('0x2a')]){delete _0x323306[_0x66ae('0x2a')];}_0x3af38e[_0x66ae('0x19')](_0x49b240)['send'](_0x323306);};}exports[_0x66ae('0x2b')]=function(_0x1196d6,_0x1dd167){var _0x5852e1={},_0x401203={},_0x451f69={'count':0x0,'rows':[]};var _0x48b0f2=_['map'](db[_0x66ae('0x2c')][_0x66ae('0x2d')],function(_0xef765e){return{'name':_0xef765e['fieldName'],'type':_0xef765e[_0x66ae('0x2e')][_0x66ae('0x2f')]};});_0x401203['model']=_[_0x66ae('0x30')](_0x48b0f2,_0x66ae('0x2a'));_0x401203[_0x66ae('0x31')]=_[_0x66ae('0x32')](_0x1196d6[_0x66ae('0x31')]);_0x401203[_0x66ae('0x33')]=_[_0x66ae('0x34')](_0x401203[_0x66ae('0x35')],_0x401203[_0x66ae('0x31')]);_0x5852e1[_0x66ae('0x36')]=_[_0x66ae('0x34')](_0x401203[_0x66ae('0x35')],qs['fields'](_0x1196d6[_0x66ae('0x31')][_0x66ae('0x37')]));_0x5852e1[_0x66ae('0x36')]=_0x5852e1['attributes'][_0x66ae('0x38')]?_0x5852e1['attributes']:_0x401203[_0x66ae('0x35')];if(!_0x1196d6['query'][_0x66ae('0x39')](_0x66ae('0x3a'))){_0x5852e1[_0x66ae('0x1e')]=qs[_0x66ae('0x1e')](_0x1196d6[_0x66ae('0x31')][_0x66ae('0x1e')]);_0x5852e1['offset']=qs[_0x66ae('0x1c')](_0x1196d6[_0x66ae('0x31')]['offset']);}_0x5852e1['order']=qs['sort'](_0x1196d6['query'][_0x66ae('0x3b')]);_0x5852e1[_0x66ae('0x3c')]=qs[_0x66ae('0x33')](_['pick'](_0x1196d6[_0x66ae('0x31')],_0x401203['filters']),_0x48b0f2);if(_0x1196d6[_0x66ae('0x31')][_0x66ae('0x3d')]){_0x5852e1['where']=_[_0x66ae('0x3e')](_0x5852e1['where'],{'$or':_['map'](_0x48b0f2,function(_0x10b2cf){if(_0x10b2cf[_0x66ae('0x2e')]!==_0x66ae('0x3f')){var _0x493341={};_0x493341[_0x10b2cf[_0x66ae('0x2a')]]={'$like':'%'+_0x1196d6[_0x66ae('0x31')][_0x66ae('0x3d')]+'%'};return _0x493341;}})});}_0x5852e1=_['merge']({},_0x5852e1,_0x1196d6[_0x66ae('0x40')]);var _0x426e33={'where':_0x5852e1[_0x66ae('0x3c')]};return db[_0x66ae('0x2c')][_0x66ae('0x1f')](_0x426e33)[_0x66ae('0x26')](function(_0x104528){_0x451f69['count']=_0x104528;if(_0x1196d6[_0x66ae('0x31')][_0x66ae('0x41')]){_0x5852e1[_0x66ae('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x66ae('0x43')](_0x5852e1);})['then'](function(_0x4da1c4){_0x451f69['rows']=_0x4da1c4;return _0x451f69;})['then'](respondWithFilteredResult(_0x1dd167,_0x5852e1))['catch'](handleError(_0x1dd167,null));};exports[_0x66ae('0x44')]=function(_0x671450,_0x50ea48){var _0x43e524={'raw':!![],'where':{'id':_0x671450[_0x66ae('0x45')]['id']}},_0x5c91c7={};_0x5c91c7[_0x66ae('0x35')]=_['keys'](db['VoiceTransferReport'][_0x66ae('0x2d')]);_0x5c91c7[_0x66ae('0x31')]=_[_0x66ae('0x32')](_0x671450[_0x66ae('0x31')]);_0x5c91c7[_0x66ae('0x33')]=_[_0x66ae('0x34')](_0x5c91c7[_0x66ae('0x35')],_0x5c91c7[_0x66ae('0x31')]);_0x43e524[_0x66ae('0x36')]=_[_0x66ae('0x34')](_0x5c91c7[_0x66ae('0x35')],qs[_0x66ae('0x37')](_0x671450[_0x66ae('0x31')][_0x66ae('0x37')]));_0x43e524[_0x66ae('0x36')]=_0x43e524['attributes'][_0x66ae('0x38')]?_0x43e524['attributes']:_0x5c91c7['model'];if(_0x671450[_0x66ae('0x31')]['includeAll']){_0x43e524[_0x66ae('0x42')]=[{'all':!![]}];}_0x43e524=_[_0x66ae('0x3e')]({},_0x43e524,_0x671450[_0x66ae('0x40')]);return db['VoiceTransferReport']['find'](_0x43e524)[_0x66ae('0x26')](handleEntityNotFound(_0x50ea48,null))[_0x66ae('0x26')](respondWithResult(_0x50ea48,null))[_0x66ae('0x46')](handleError(_0x50ea48,null));};exports[_0x66ae('0x47')]=function(_0x4c17f2,_0x3575a9){return db['VoiceTransferReport']['create'](_0x4c17f2[_0x66ae('0x48')],{})[_0x66ae('0x26')](respondWithResult(_0x3575a9,0xc9))[_0x66ae('0x46')](handleError(_0x3575a9,null));};exports['update']=function(_0x1b5d3e,_0x295bfc){if(_0x1b5d3e[_0x66ae('0x48')]['id']){delete _0x1b5d3e['body']['id'];}return db[_0x66ae('0x2c')][_0x66ae('0x49')]({'where':{'id':_0x1b5d3e[_0x66ae('0x45')]['id']}})[_0x66ae('0x26')](handleEntityNotFound(_0x295bfc,null))[_0x66ae('0x26')](saveUpdates(_0x1b5d3e['body'],null))[_0x66ae('0x26')](respondWithResult(_0x295bfc,null))['catch'](handleError(_0x295bfc,null));};exports[_0x66ae('0x27')]=function(_0x3c680f,_0x329d3c){return db[_0x66ae('0x2c')]['find']({'where':{'id':_0x3c680f[_0x66ae('0x45')]['id']}})[_0x66ae('0x26')](handleEntityNotFound(_0x329d3c,null))[_0x66ae('0x26')](removeEntity(_0x329d3c,null))[_0x66ae('0x46')](handleError(_0x329d3c,null));};exports['describe']=function(_0x47e5fb,_0x3e57e7){return db[_0x66ae('0x2c')]['describe']()[_0x66ae('0x26')](respondWithResult(_0x3e57e7,null))[_0x66ae('0x46')](handleError(_0x3e57e7,null));};
\ No newline at end of file
index 079b694..30a3314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa417=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport'];(function(_0x2d68b8,_0xe4fc22){var _0x16bc48=function(_0x53ccf0){while(--_0x53ccf0){_0x2d68b8['push'](_0x2d68b8['shift']());}};_0x16bc48(++_0xe4fc22);}(_0xa417,0x186));var _0x7a41=function(_0xe68a4c,_0x1cfead){_0xe68a4c=_0xe68a4c-0x0;var _0x492b36=_0xa417[_0xe68a4c];return _0x492b36;};'use strict';var _=require(_0x7a41('0x0'));var util=require('util');var logger=require(_0x7a41('0x1'))(_0x7a41('0x2'));var moment=require(_0x7a41('0x3'));var BPromise=require(_0x7a41('0x4'));var rp=require(_0x7a41('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a41('0x6'));var config=require(_0x7a41('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x7a41('0x8')]=function(_0x5c36cb,_0x2a2dee){return _0x5c36cb['define'](_0x7a41('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0c08=['exports','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x315453,_0x2d7185){var _0x4d45bd=function(_0x4478dd){while(--_0x4478dd){_0x315453['push'](_0x315453['shift']());}};_0x4d45bd(++_0x2d7185);}(_0x0c08,0x16b));var _0x80c0=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0x0c08[_0x36f243];return _0x426436;};'use strict';var _=require(_0x80c0('0x0'));var util=require('util');var logger=require(_0x80c0('0x1'))(_0x80c0('0x2'));var moment=require(_0x80c0('0x3'));var BPromise=require(_0x80c0('0x4'));var rp=require(_0x80c0('0x5'));var fs=require('fs');var path=require(_0x80c0('0x6'));var rimraf=require(_0x80c0('0x7'));var config=require(_0x80c0('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x80c0('0x9')]=function(_0xe2bef8,_0x37033b){return _0xe2bef8['define'](_0x80c0('0xa'),attributes,{'tableName':_0x80c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bfa27bb..aacc790 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc8b=['catch','VoiceTransferReport','create','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','http','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','VoiceTransferReport,\x20%s,\x20%s','result'];(function(_0xc884ce,_0x559e9a){var _0x1a7379=function(_0x49656f){while(--_0x49656f){_0xc884ce['push'](_0xc884ce['shift']());}};_0x1a7379(++_0x559e9a);}(_0xcc8b,0x14b));var _0xbcc8=function(_0x58a8a4,_0x5bdf62){_0x58a8a4=_0x58a8a4-0x0;var _0x22f94a=_0xcc8b[_0x58a8a4];return _0x22f94a;};'use strict';var _=require(_0xbcc8('0x0'));var util=require(_0xbcc8('0x1'));var moment=require(_0xbcc8('0x2'));var BPromise=require(_0xbcc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcc8('0x4'));var db=require(_0xbcc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbcc8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbcc8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x272451,_0x1682f4,_0x201e32){return new BPromise(function(_0x426b90,_0x52ec5e){return client['request'](_0x272451,_0x201e32)[_0xbcc8('0x8')](function(_0x464b89){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0xbcc8('0x9'));logger[_0xbcc8('0xa')](_0xbcc8('0xb'),_0x1682f4,_0xbcc8('0x9'),JSON[_0xbcc8('0xc')](_0x464b89));if(_0x464b89['error']){if(_0x464b89['error'][_0xbcc8('0xd')]===0x1f4){logger[_0xbcc8('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0x464b89[_0xbcc8('0xe')]['message']);return _0x52ec5e(_0x464b89[_0xbcc8('0xe')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1682f4,_0x464b89[_0xbcc8('0xe')][_0xbcc8('0xf')]);return _0x426b90(_0x464b89[_0xbcc8('0xe')][_0xbcc8('0xf')]);}else{logger[_0xbcc8('0x10')](_0xbcc8('0x11'),_0x1682f4,_0xbcc8('0x9'));_0x426b90(_0x464b89[_0xbcc8('0x12')][_0xbcc8('0xf')]);}})[_0xbcc8('0x13')](function(_0x5905ee){logger[_0xbcc8('0xe')](_0xbcc8('0x11'),_0x1682f4,_0x5905ee);_0x52ec5e(_0x5905ee);});});}exports['CreateVoiceTransferReport']=function(_0x397df5){var _0x2ce9dd=this;return new Promise(function(_0x26b18e,_0x39e50e){return db[_0xbcc8('0x14')][_0xbcc8('0x15')](_0x397df5['body'],{'raw':_0x397df5[_0xbcc8('0x16')]?_0x397df5['options'][_0xbcc8('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x476a1e){logger['info'](_0xbcc8('0x18'),_0x397df5);logger[_0xbcc8('0xa')](_0xbcc8('0x18'),_0x397df5,JSON['stringify'](_0x476a1e));_0x26b18e(_0x476a1e);})[_0xbcc8('0x13')](function(_0x3fda0c){logger[_0xbcc8('0xe')]('CreateVoiceTransferReport',_0x3fda0c['message'],_0x397df5);_0x39e50e(_0x2ce9dd['error'](0x1f4,_0x3fda0c['message']));});});};
\ No newline at end of file
+var _0x99d9=['request\x20sent','stringify','error','message','result','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0x99d9,0xad));var _0x999d=function(_0x398a84,_0x2d2d33){_0x398a84=_0x398a84-0x0;var _0x426f95=_0x99d9[_0x398a84];return _0x426f95;};'use strict';var _=require(_0x999d('0x0'));var util=require(_0x999d('0x1'));var moment=require(_0x999d('0x2'));var BPromise=require(_0x999d('0x3'));var rs=require(_0x999d('0x4'));var fs=require('fs');var Redis=require(_0x999d('0x5'));var db=require(_0x999d('0x6'))['db'];var utils=require(_0x999d('0x7'));var logger=require(_0x999d('0x8'))(_0x999d('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x999d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fc36a,_0x3a8ea5,_0x14b0d6){return new BPromise(function(_0xd7e4a1,_0x241e18){return client[_0x999d('0xb')](_0x2fc36a,_0x14b0d6)[_0x999d('0xc')](function(_0x3cd970){logger[_0x999d('0xd')](_0x999d('0xe'),_0x3a8ea5,'request\x20sent');logger['debug'](_0x999d('0xf'),_0x3a8ea5,_0x999d('0x10'),JSON[_0x999d('0x11')](_0x3cd970));if(_0x3cd970[_0x999d('0x12')]){if(_0x3cd970[_0x999d('0x12')]['code']===0x1f4){logger[_0x999d('0x12')](_0x999d('0xe'),_0x3a8ea5,_0x3cd970[_0x999d('0x12')][_0x999d('0x13')]);return _0x241e18(_0x3cd970[_0x999d('0x12')][_0x999d('0x13')]);}logger['error'](_0x999d('0xe'),_0x3a8ea5,_0x3cd970['error']['message']);return _0xd7e4a1(_0x3cd970['error'][_0x999d('0x13')]);}else{logger[_0x999d('0xd')](_0x999d('0xe'),_0x3a8ea5,_0x999d('0x10'));_0xd7e4a1(_0x3cd970[_0x999d('0x14')]['message']);}})['catch'](function(_0x536f8d){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x3a8ea5,_0x536f8d);_0x241e18(_0x536f8d);});});}exports['CreateVoiceTransferReport']=function(_0x1139a4){var _0x590e5b=this;return new Promise(function(_0x97c4,_0x4efda5){return db[_0x999d('0x15')][_0x999d('0x16')](_0x1139a4[_0x999d('0x17')],{'raw':_0x1139a4[_0x999d('0x18')]?_0x1139a4[_0x999d('0x18')][_0x999d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x40121b){logger['info']('CreateVoiceTransferReport',_0x1139a4);logger['debug'](_0x999d('0x1a'),_0x1139a4,JSON[_0x999d('0x11')](_0x40121b));_0x97c4(_0x40121b);})['catch'](function(_0x23ccbf){logger['error']('CreateVoiceTransferReport',_0x23ccbf[_0x999d('0x13')],_0x1139a4);_0x4efda5(_0x590e5b[_0x999d('0x12')](0x1f4,_0x23ccbf[_0x999d('0x13')]));});});};
\ No newline at end of file
index 487025f..1aa0b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d9=['unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold'];(function(_0x2320bb,_0x18f641){var _0x1fbbff=function(_0x5b595d){while(--_0x5b595d){_0x2320bb['push'](_0x2320bb['shift']());}};_0x1fbbff(++_0x18f641);}(_0x41d9,0x1d4));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x941d('0x0'));var router=express[_0x941d('0x1')]();var auth=require(_0x941d('0x2'));var controller=require(_0x941d('0x3'));router[_0x941d('0x4')](_0x941d('0x5'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x8')]);router[_0x941d('0x4')](_0x941d('0x9'),auth[_0x941d('0x6')](),auth['canUpdate'](),controller[_0x941d('0xa')]);router[_0x941d('0x4')](_0x941d('0xb'),auth[_0x941d('0x6')](),auth['canUpdate'](),controller[_0x941d('0xc')]);router[_0x941d('0x4')](_0x941d('0xd'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0xe')]);router[_0x941d('0x4')](_0x941d('0xf'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x10')]);router[_0x941d('0x4')](_0x941d('0x11'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x941d('0x12')]);router['post'](_0x941d('0x13'),auth[_0x941d('0x6')](),auth[_0x941d('0x7')](),controller[_0x941d('0x14')]);module[_0x941d('0x15')]=router;
\ No newline at end of file
+var _0x3de9=['/answer','answer','hold','/unhold','unhold','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','canUpdate','post','/hangup','hangup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3de9,0x14b));var _0x93de=function(_0x4e7202,_0x590151){_0x4e7202=_0x4e7202-0x0;var _0x653890=_0x3de9[_0x4e7202];return _0x653890;};'use strict';var express=require(_0x93de('0x0'));var router=express['Router']();var auth=require(_0x93de('0x1'));var controller=require(_0x93de('0x2'));router['post'](_0x93de('0x3'),auth[_0x93de('0x4')](),auth[_0x93de('0x5')](),controller['originate']);router[_0x93de('0x6')](_0x93de('0x7'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x93de('0x8')]);router['post'](_0x93de('0x9'),auth[_0x93de('0x4')](),auth[_0x93de('0x5')](),controller[_0x93de('0xa')]);router[_0x93de('0x6')]('/hold',auth[_0x93de('0x4')](),auth[_0x93de('0x5')](),controller[_0x93de('0xb')]);router[_0x93de('0x6')](_0x93de('0xc'),auth['isAuthenticated'](),auth[_0x93de('0x5')](),controller[_0x93de('0xd')]);router[_0x93de('0x6')]('/calls',auth[_0x93de('0x4')](),auth[_0x93de('0x5')](),controller['calls']);router[_0x93de('0x6')](_0x93de('0xe'),auth[_0x93de('0x4')](),auth[_0x93de('0x5')](),controller[_0x93de('0xf')]);module[_0x93de('0x10')]=router;
\ No newline at end of file
index a1f123c..9db61ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['redis','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','name','status','send','NotFound','request','then','message','result','catch','agent','VoiceChannels','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','callNumber','callbackUrl','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','format','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','defaults'];(function(_0x20052b,_0xd1fb7d){var _0x31b6f6=function(_0x4f4454){while(--_0x4f4454){_0x20052b['push'](_0x20052b['shift']());}};_0x31b6f6(++_0xd1fb7d);}(_0xbec5,0xe5));var _0x5bec=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xbec5[_0x2a9f4];return _0x3c39e0;};'use strict';var path=require(_0x5bec('0x0'));var fs=require('fs');var _=require(_0x5bec('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x5bec('0x2'));var util=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var jayson=require(_0x5bec('0x5'));var amiClient=jayson[_0x5bec('0x6')]['http']({'port':0x232a});var logger=require(_0x5bec('0x7'))(_0x5bec('0x8'));var Redis=require(_0x5bec('0x9'));config['redis']=_[_0x5bec('0xa')](config[_0x5bec('0xb')],{'host':_0x5bec('0xc'),'port':0x18eb});var io=require(_0x5bec('0xd'))(new Redis(config[_0x5bec('0xb')]));var Schema=require(_0x5bec('0xe'));var originateValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'callNumber':{'type':'string','required':[!![],_0x5bec('0x11')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x5bec('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x5bec('0x12'),'required':[!![],_0x5bec('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]},'sessionId':{'type':_0x5bec('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x5bec('0xf'),'required':[!![],_0x5bec('0x10')]}});function emit(_0x11fb8e,_0x506639,_0x4ab821){logger[_0x5bec('0x14')](_0x11fb8e,_0x506639,JSON[_0x5bec('0x15')](_0x4ab821));io['to'](_0x11fb8e)[_0x5bec('0x16')](_0x506639,_0x4ab821);}function handleError(_0x1771e7){return function(_0x5cd7ae){console['log'](_0x5bec('0x17'),_0x5cd7ae,_0x5cd7ae instanceof RangeError);logger[_0x5bec('0x18')](_0x5cd7ae['stack']);if(_0x5cd7ae instanceof RangeError){if(_0x5cd7ae[_0x5bec('0x19')]){delete _0x5cd7ae[_0x5bec('0x19')];}_0x1771e7[_0x5bec('0x1a')](0x194)[_0x5bec('0x1b')](_0x5cd7ae);}else{if(_0x5cd7ae['name']){delete _0x5cd7ae[_0x5bec('0x19')];}_0x1771e7['status'](0x1f4)[_0x5bec('0x1b')](_0x5cd7ae);}};}function checkError(){return function(_0x208d99){if(!_0x208d99){throw new RangeError(_0x5bec('0x1c'));}return _0x208d99;};}function respondWithRpcPromise(_0x43a62d,_0xfed23){return new BPromise(function(_0x5e154e,_0x232584){var _0x4cfcb8=amiClient;return _0x4cfcb8[_0x5bec('0x1d')](_0x43a62d,_0xfed23)[_0x5bec('0x1e')](function(_0x5b2636){if(_0x5b2636[_0x5bec('0x18')]){if(_0x5b2636[_0x5bec('0x18')]['code']===0x1f4){return _0x232584(_0x5b2636[_0x5bec('0x18')][_0x5bec('0x1f')]);}return _0x5e154e(_0x5b2636[_0x5bec('0x18')][_0x5bec('0x1f')]);}else{_0x5e154e(_0x5b2636[_0x5bec('0x20')]);}})[_0x5bec('0x21')](function(_0x2dc014){_0x232584(_0x2dc014);});});}function getAgent(_0x4de66a){return db['User']['findOne']({'where':{'id':_0x4de66a,'role':_0x5bec('0x22')}})[_0x5bec('0x1e')](checkError());}function getAgentCheckSession(_0x338c25,_0x4939a5){return new BPromise(function(_0x2b3b2c,_0x472e54){var _0x57331b=respondWithRpcPromise(_0x5bec('0x23'));var _0x63ac8=getAgent(_0x338c25);Promise['all']([_0x57331b,_0x63ac8])['then'](function(_0x3575e7){var _0x2a82d5=_0x3575e7[0x0];var _0x3039f0=_0x3575e7[0x1];var _0x2c7a7b=_[_0x5bec('0x24')](_0x2a82d5[_0x5bec('0x25')],function(_0x5d6621){return _0x5d6621[_0x5bec('0x26')]==_0x3039f0['id']&&_0x5d6621['sessionId']==_0x4939a5;});if(_0x2c7a7b[_0x5bec('0x27')]==0x1){_0x2b3b2c(_0x3039f0);}else{_0x472e54(new RangeError(_0x5bec('0x28')+_0x4939a5+_0x5bec('0x29')));}});});}exports[_0x5bec('0x2a')]=function(_0x5128c0,_0x2b42c8){logger[_0x5bec('0x14')](_0x5bec('0x2b'),_0x5128c0['body']);var _0xf6ae6b=originateValidation['validate'](_0x5128c0[_0x5bec('0x2c')]);if(_0xf6ae6b[_0x5bec('0x27')]>0x0){return _0x2b42c8[_0x5bec('0x1a')](0x190)['json'](_0xf6ae6b);}var _0xdc831e=_0x5128c0[_0x5bec('0x2c')]['userId'];var _0x34b441=_0x5128c0[_0x5bec('0x2c')][_0x5bec('0x2d')];var _0x170e28=_0x5128c0[_0x5bec('0x2c')]['callerId'];var _0x7ebd9c=_0x5128c0['body'][_0x5bec('0x2e')];return getAgent(_0xdc831e)[_0x5bec('0x1e')](function(_0x182b86){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x182b86[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x182b86[_0x5bec('0x19')]),_0x5bec('0x31'),{'callNumber':_0x34b441,'callerId':_0x170e28,'callbackUrl':_0x7ebd9c});return _0x2b42c8['status'](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x33')});})['catch'](handleError(_0x2b42c8));};exports[_0x5bec('0x34')]=function(_0x58c34e,_0x400e22){logger[_0x5bec('0x14')](_0x5bec('0x35'),_0x58c34e['body']);var _0xd7b727=hangupValidation[_0x5bec('0xe')](_0x58c34e[_0x5bec('0x2c')]);if(_0xd7b727[_0x5bec('0x27')]>0x0){return _0x400e22[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0xd7b727);}var _0x3b7e50=_0x58c34e['body'][_0x5bec('0x36')];var _0x224c2e=_0x58c34e[_0x5bec('0x2c')][_0x5bec('0x37')];return getAgent(_0x3b7e50)['then'](function(_0x27863b){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x27863b['name']);emit(util['format'](_0x5bec('0x30'),_0x27863b[_0x5bec('0x19')]),_0x5bec('0x38'),{'sessionId':_0x224c2e});return _0x400e22[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x400e22));};exports[_0x5bec('0x39')]=function(_0x5cb97e,_0x39597c){logger[_0x5bec('0x14')](_0x5bec('0x3a'),_0x5cb97e['body']);var _0x1e59a3=answerValidation[_0x5bec('0xe')](_0x5cb97e['body']);if(_0x1e59a3[_0x5bec('0x27')]>0x0){return _0x39597c[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x1e59a3);}var _0x2b51f7=_0x5cb97e[_0x5bec('0x2c')][_0x5bec('0x36')];var _0x3a795c=_0x5cb97e['body']['sessionId'];return getAgent(_0x2b51f7)[_0x5bec('0x1e')](function(_0x4bfa57){logger['info'](_0x5bec('0x2f'),_0x4bfa57['name']);emit(util['format']('user:%s',_0x4bfa57[_0x5bec('0x19')]),_0x5bec('0x3b'),{'sessionId':_0x3a795c});return _0x39597c[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':'answer\x20executed!'});})[_0x5bec('0x21')](handleError(_0x39597c));};exports[_0x5bec('0x3c')]=function(_0xa4d32,_0x3a88d2){logger['info'](_0x5bec('0x3d'),_0xa4d32[_0x5bec('0x2c')]);var _0x2bbb1a=holdValidation['validate'](_0xa4d32[_0x5bec('0x2c')]);if(_0x2bbb1a['length']>0x0){return _0x3a88d2[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x2bbb1a);}var _0x133d5c=_0xa4d32[_0x5bec('0x2c')]['userId'];var _0x32869f=_0xa4d32[_0x5bec('0x2c')][_0x5bec('0x37')];return getAgent(_0x133d5c)[_0x5bec('0x1e')](function(_0x35b250){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x35b250['name']);emit(util[_0x5bec('0x3e')](_0x5bec('0x30'),_0x35b250['name']),_0x5bec('0x3f'),{'sessionId':_0x32869f});return _0x3a88d2[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x40')});})[_0x5bec('0x21')](handleError(_0x3a88d2));};exports[_0x5bec('0x41')]=function(_0x3545a5,_0x4f08d9){logger[_0x5bec('0x14')]('unhold\x20fired:',_0x3545a5[_0x5bec('0x2c')]);var _0x208c7b=unholdValidation[_0x5bec('0xe')](_0x3545a5[_0x5bec('0x2c')]);if(_0x208c7b[_0x5bec('0x27')]>0x0){return _0x4f08d9[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x208c7b);}var _0x3bc0c9=_0x3545a5[_0x5bec('0x2c')][_0x5bec('0x36')];var _0x580c75=_0x3545a5[_0x5bec('0x2c')]['sessionId'];return getAgent(_0x3bc0c9)['then'](function(_0x45eb95){logger['info']('entityFound:',_0x45eb95[_0x5bec('0x19')]);emit(util[_0x5bec('0x3e')](_0x5bec('0x30'),_0x45eb95['name']),_0x5bec('0x42'),{'sessionId':_0x580c75});return _0x4f08d9[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x43')});})['catch'](handleError(_0x4f08d9));};exports[_0x5bec('0x44')]=function(_0x209da3,_0x9cae50){logger[_0x5bec('0x14')](_0x5bec('0x45'),_0x9cae50[_0x5bec('0x2c')]);var _0x33b924=callsValidation['validate'](_0x209da3['body']);if(_0x33b924[_0x5bec('0x27')]>0x0){return _0x9cae50['status'](0x190)[_0x5bec('0x32')](_0x33b924);}var _0x7ad053=_0x209da3['body'][_0x5bec('0x36')];var _0x5ddf8b=respondWithRpcPromise(_0x5bec('0x23'));var _0x3ed7ba=getAgent(_0x7ad053);return Promise[_0x5bec('0x46')]([_0x5ddf8b,_0x3ed7ba])[_0x5bec('0x1e')](function(_0x2fb334){var _0x340b42=_0x2fb334[0x0];var _0x2e4293=_0x2fb334[0x1];var _0x2c2e44=_[_0x5bec('0x24')](_0x340b42[_0x5bec('0x25')],function(_0x4ca9c3){return _0x4ca9c3[_0x5bec('0x26')]==_0x2e4293['id'];});return _0x9cae50[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'count':_0x2c2e44['length'],'rows':_0x2c2e44});})[_0x5bec('0x21')](handleError(_0x9cae50));};exports[_0x5bec('0x47')]=function(_0x432a26,_0x56a539){logger[_0x5bec('0x14')](_0x5bec('0x48'),_0x432a26[_0x5bec('0x2c')]);var _0x340cd9=conferenceValidation[_0x5bec('0xe')](_0x432a26['body']);if(_0x340cd9[_0x5bec('0x27')]>0x0){return _0x56a539[_0x5bec('0x1a')](0x190)[_0x5bec('0x32')](_0x340cd9);}var _0x2abc02=_0x432a26['body'][_0x5bec('0x36')];return getAgent(_0x2abc02)['then'](function(_0x2b701f){logger[_0x5bec('0x14')](_0x5bec('0x2f'),_0x2b701f[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x2b701f[_0x5bec('0x19')]),_0x5bec('0x49'));return _0x56a539[_0x5bec('0x1a')](0xc8)[_0x5bec('0x32')]({'error':![],'message':_0x5bec('0x4a')});})[_0x5bec('0x21')](handleError(_0x56a539));};exports[_0x5bec('0x4b')]=function(_0x407828,_0x245932){logger[_0x5bec('0x14')](_0x5bec('0x4c'),_0x407828[_0x5bec('0x2c')]);var _0x5d3092=transferValidation[_0x5bec('0xe')](_0x407828['body']);if(_0x5d3092[_0x5bec('0x27')]>0x0){return _0x245932[_0x5bec('0x1a')](0x190)['json'](_0x5d3092);}var _0xa7a394=_0x407828['body'][_0x5bec('0x36')];var _0x1061d3=_0x407828['body']['sessionId'];var _0xd54be0=_0x407828[_0x5bec('0x2c')][_0x5bec('0x4d')];return getAgent(_0xa7a394)[_0x5bec('0x1e')](function(_0x2c7a94){logger['info'](_0x5bec('0x2f'),_0x2c7a94[_0x5bec('0x19')]);emit(util['format'](_0x5bec('0x30'),_0x2c7a94[_0x5bec('0x19')]),_0x5bec('0x4e'),{'sessionId':_0x1061d3,'transferNumber':_0xd54be0});return _0x245932[_0x5bec('0x1a')](0xc8)['json']({'error':![],'message':_0x5bec('0x4f')});})['catch'](handleError(_0x245932));};
\ No newline at end of file
+var _0x3140=['answer\x20executed!','hold','sessionId','webbar:hold','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','agent','VoiceChannels','all','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','userId','callNumber','callerId','entityFound:','format','originate\x20executed!','hangup\x20fired:','user:%s','webbar:hangup','answer','answer\x20fired:','webbar:answer'];(function(_0xd8ed58,_0x553238){var _0x36352b=function(_0x6e16ed){while(--_0x6e16ed){_0xd8ed58['push'](_0xd8ed58['shift']());}};_0x36352b(++_0x553238);}(_0x3140,0xaf));var _0x0314=function(_0x10d52b,_0xc6a4f1){_0x10d52b=_0x10d52b-0x0;var _0x2bf44a=_0x3140[_0x10d52b];return _0x2bf44a;};'use strict';var path=require(_0x0314('0x0'));var fs=require('fs');var _=require(_0x0314('0x1'));var db=require(_0x0314('0x2'))['db'];var config=require(_0x0314('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x0314('0x4'));var amiClient=jayson[_0x0314('0x5')][_0x0314('0x6')]({'port':0x232a});var logger=require(_0x0314('0x7'))(_0x0314('0x8'));var Redis=require(_0x0314('0x9'));config[_0x0314('0xa')]=_[_0x0314('0xb')](config[_0x0314('0xa')],{'host':_0x0314('0xc'),'port':0x18eb});var io=require(_0x0314('0xd'))(new Redis(config['redis']));var Schema=require(_0x0314('0xe'));var originateValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x0314('0x10')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x0314('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]},'sessionId':{'type':_0x0314('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]},'sessionId':{'type':_0x0314('0x11'),'required':[!![],_0x0314('0x13')]},'transferNumber':{'type':_0x0314('0x11'),'required':[!![],_0x0314('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0314('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]},'sessionId':{'type':_0x0314('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]}});var conferenceValidation=new Schema({'userId':{'type':_0x0314('0xf'),'required':[!![],_0x0314('0x12')]}});function emit(_0x5e460f,_0xb9730b,_0x24cd42){logger[_0x0314('0x15')](_0x5e460f,_0xb9730b,JSON['stringify'](_0x24cd42));io['to'](_0x5e460f)[_0x0314('0x16')](_0xb9730b,_0x24cd42);}function handleError(_0x5f2e82){return function(_0x575b68){console[_0x0314('0x17')](_0x0314('0x18'),_0x575b68,_0x575b68 instanceof RangeError);logger['error'](_0x575b68[_0x0314('0x19')]);if(_0x575b68 instanceof RangeError){if(_0x575b68[_0x0314('0x1a')]){delete _0x575b68['name'];}_0x5f2e82[_0x0314('0x1b')](0x194)['send'](_0x575b68);}else{if(_0x575b68[_0x0314('0x1a')]){delete _0x575b68[_0x0314('0x1a')];}_0x5f2e82[_0x0314('0x1b')](0x1f4)[_0x0314('0x1c')](_0x575b68);}};}function checkError(){return function(_0x3bdb1){if(!_0x3bdb1){throw new RangeError(_0x0314('0x1d'));}return _0x3bdb1;};}function respondWithRpcPromise(_0x4d3bc6,_0x56ef33){return new BPromise(function(_0x20305b,_0xbd3ad0){var _0x1945f8=amiClient;return _0x1945f8[_0x0314('0x1e')](_0x4d3bc6,_0x56ef33)[_0x0314('0x1f')](function(_0xd7638b){if(_0xd7638b['error']){if(_0xd7638b[_0x0314('0x20')][_0x0314('0x21')]===0x1f4){return _0xbd3ad0(_0xd7638b['error'][_0x0314('0x22')]);}return _0x20305b(_0xd7638b[_0x0314('0x20')][_0x0314('0x22')]);}else{_0x20305b(_0xd7638b[_0x0314('0x23')]);}})[_0x0314('0x24')](function(_0x3af9d3){_0xbd3ad0(_0x3af9d3);});});}function getAgent(_0x5d5b13){return db[_0x0314('0x25')][_0x0314('0x26')]({'where':{'id':_0x5d5b13,'role':_0x0314('0x27')}})['then'](checkError());}function getAgentCheckSession(_0x29b4b5,_0x5e3eba){return new BPromise(function(_0x47c102,_0x5da2c7){var _0x2fc520=respondWithRpcPromise(_0x0314('0x28'));var _0x550dc4=getAgent(_0x29b4b5);Promise[_0x0314('0x29')]([_0x2fc520,_0x550dc4])[_0x0314('0x1f')](function(_0x5291c2){var _0x547ab3=_0x5291c2[0x0];var _0x15fbfb=_0x5291c2[0x1];var _0x345cef=_['filter'](_0x547ab3[_0x0314('0x2a')],function(_0x16e74a){return _0x16e74a[_0x0314('0x2b')]==_0x15fbfb['id']&&_0x16e74a['sessionId']==_0x5e3eba;});if(_0x345cef[_0x0314('0x2c')]==0x1){_0x47c102(_0x15fbfb);}else{_0x5da2c7(new RangeError(_0x0314('0x2d')+_0x5e3eba+_0x0314('0x2e')));}});});}exports[_0x0314('0x2f')]=function(_0x549b0b,_0x1d01b5){logger['info']('originate\x20fired:',_0x549b0b[_0x0314('0x30')]);var _0x14d3b4=originateValidation[_0x0314('0xe')](_0x549b0b['body']);if(_0x14d3b4[_0x0314('0x2c')]>0x0){return _0x1d01b5['status'](0x190)[_0x0314('0x31')](_0x14d3b4);}var _0x5a0767=_0x549b0b['body'][_0x0314('0x32')];var _0x5d3b0e=_0x549b0b[_0x0314('0x30')][_0x0314('0x33')];var _0x2990ea=_0x549b0b[_0x0314('0x30')][_0x0314('0x34')];var _0x1a9ff7=_0x549b0b[_0x0314('0x30')]['callbackUrl'];return getAgent(_0x5a0767)[_0x0314('0x1f')](function(_0x28c6d0){logger[_0x0314('0x15')](_0x0314('0x35'),_0x28c6d0[_0x0314('0x1a')]);emit(util[_0x0314('0x36')]('user:%s',_0x28c6d0[_0x0314('0x1a')]),'webbar:originate',{'callNumber':_0x5d3b0e,'callerId':_0x2990ea,'callbackUrl':_0x1a9ff7});return _0x1d01b5[_0x0314('0x1b')](0xc8)['json']({'error':![],'message':_0x0314('0x37')});})['catch'](handleError(_0x1d01b5));};exports['hangup']=function(_0x58c701,_0x1765d7){logger[_0x0314('0x15')](_0x0314('0x38'),_0x58c701[_0x0314('0x30')]);var _0x986315=hangupValidation['validate'](_0x58c701[_0x0314('0x30')]);if(_0x986315[_0x0314('0x2c')]>0x0){return _0x1765d7[_0x0314('0x1b')](0x190)['json'](_0x986315);}var _0x273f2c=_0x58c701['body'][_0x0314('0x32')];var _0x5b034a=_0x58c701[_0x0314('0x30')]['sessionId'];return getAgent(_0x273f2c)['then'](function(_0x370539){logger[_0x0314('0x15')]('entityFound:',_0x370539[_0x0314('0x1a')]);emit(util['format'](_0x0314('0x39'),_0x370539[_0x0314('0x1a')]),_0x0314('0x3a'),{'sessionId':_0x5b034a});return _0x1765d7[_0x0314('0x1b')](0xc8)[_0x0314('0x31')]({'error':![],'message':'hangup\x20executed!'});})[_0x0314('0x24')](handleError(_0x1765d7));};exports[_0x0314('0x3b')]=function(_0x3b070a,_0x5f33cd){logger[_0x0314('0x15')](_0x0314('0x3c'),_0x3b070a[_0x0314('0x30')]);var _0x599473=answerValidation[_0x0314('0xe')](_0x3b070a['body']);if(_0x599473[_0x0314('0x2c')]>0x0){return _0x5f33cd[_0x0314('0x1b')](0x190)[_0x0314('0x31')](_0x599473);}var _0x583aba=_0x3b070a[_0x0314('0x30')][_0x0314('0x32')];var _0x588e65=_0x3b070a['body']['sessionId'];return getAgent(_0x583aba)[_0x0314('0x1f')](function(_0x70bcd){logger[_0x0314('0x15')]('entityFound:',_0x70bcd[_0x0314('0x1a')]);emit(util[_0x0314('0x36')](_0x0314('0x39'),_0x70bcd[_0x0314('0x1a')]),_0x0314('0x3d'),{'sessionId':_0x588e65});return _0x5f33cd['status'](0xc8)[_0x0314('0x31')]({'error':![],'message':_0x0314('0x3e')});})[_0x0314('0x24')](handleError(_0x5f33cd));};exports[_0x0314('0x3f')]=function(_0x1b7292,_0x209ea9){logger[_0x0314('0x15')]('hold\x20fired:',_0x1b7292[_0x0314('0x30')]);var _0x1d72f6=holdValidation['validate'](_0x1b7292[_0x0314('0x30')]);if(_0x1d72f6[_0x0314('0x2c')]>0x0){return _0x209ea9[_0x0314('0x1b')](0x190)['json'](_0x1d72f6);}var _0x4a1850=_0x1b7292[_0x0314('0x30')][_0x0314('0x32')];var _0x2cbed3=_0x1b7292[_0x0314('0x30')][_0x0314('0x40')];return getAgent(_0x4a1850)[_0x0314('0x1f')](function(_0x36a72a){logger['info'](_0x0314('0x35'),_0x36a72a['name']);emit(util[_0x0314('0x36')](_0x0314('0x39'),_0x36a72a[_0x0314('0x1a')]),_0x0314('0x41'),{'sessionId':_0x2cbed3});return _0x209ea9[_0x0314('0x1b')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x0314('0x24')](handleError(_0x209ea9));};exports[_0x0314('0x42')]=function(_0x20070c,_0x26ecb7){logger['info'](_0x0314('0x43'),_0x20070c[_0x0314('0x30')]);var _0x2b601a=unholdValidation[_0x0314('0xe')](_0x20070c[_0x0314('0x30')]);if(_0x2b601a[_0x0314('0x2c')]>0x0){return _0x26ecb7[_0x0314('0x1b')](0x190)['json'](_0x2b601a);}var _0x28ca8f=_0x20070c[_0x0314('0x30')][_0x0314('0x32')];var _0x577a91=_0x20070c[_0x0314('0x30')][_0x0314('0x40')];return getAgent(_0x28ca8f)['then'](function(_0x92cb75){logger[_0x0314('0x15')](_0x0314('0x35'),_0x92cb75[_0x0314('0x1a')]);emit(util['format'](_0x0314('0x39'),_0x92cb75[_0x0314('0x1a')]),_0x0314('0x44'),{'sessionId':_0x577a91});return _0x26ecb7[_0x0314('0x1b')](0xc8)[_0x0314('0x31')]({'error':![],'message':_0x0314('0x45')});})[_0x0314('0x24')](handleError(_0x26ecb7));};exports[_0x0314('0x46')]=function(_0x166154,_0xa8dc19){logger['info'](_0x0314('0x47'),_0xa8dc19[_0x0314('0x30')]);var _0xf29a33=callsValidation[_0x0314('0xe')](_0x166154[_0x0314('0x30')]);if(_0xf29a33[_0x0314('0x2c')]>0x0){return _0xa8dc19[_0x0314('0x1b')](0x190)['json'](_0xf29a33);}var _0x5c4e26=_0x166154['body'][_0x0314('0x32')];var _0x3c292c=respondWithRpcPromise('VoiceChannels');var _0xda9a80=getAgent(_0x5c4e26);return Promise[_0x0314('0x29')]([_0x3c292c,_0xda9a80])[_0x0314('0x1f')](function(_0x4b35d8){var _0x50e8dc=_0x4b35d8[0x0];var _0x2e29ce=_0x4b35d8[0x1];var _0x40a4d8=_['filter'](_0x50e8dc[_0x0314('0x2a')],function(_0x4b022a){return _0x4b022a[_0x0314('0x2b')]==_0x2e29ce['id'];});return _0xa8dc19[_0x0314('0x1b')](0xc8)[_0x0314('0x31')]({'count':_0x40a4d8[_0x0314('0x2c')],'rows':_0x40a4d8});})['catch'](handleError(_0xa8dc19));};exports[_0x0314('0x48')]=function(_0x3fc295,_0x549f4c){logger['info'](_0x0314('0x49'),_0x3fc295[_0x0314('0x30')]);var _0x1cca34=conferenceValidation[_0x0314('0xe')](_0x3fc295[_0x0314('0x30')]);if(_0x1cca34[_0x0314('0x2c')]>0x0){return _0x549f4c[_0x0314('0x1b')](0x190)['json'](_0x1cca34);}var _0x340676=_0x3fc295['body']['userId'];return getAgent(_0x340676)[_0x0314('0x1f')](function(_0x5521dd){logger[_0x0314('0x15')](_0x0314('0x35'),_0x5521dd[_0x0314('0x1a')]);emit(util[_0x0314('0x36')](_0x0314('0x39'),_0x5521dd[_0x0314('0x1a')]),_0x0314('0x4a'));return _0x549f4c[_0x0314('0x1b')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})[_0x0314('0x24')](handleError(_0x549f4c));};exports[_0x0314('0x4b')]=function(_0xf480fe,_0x582451){logger['info']('transfer\x20fired:',_0xf480fe[_0x0314('0x30')]);var _0x17dbb9=transferValidation['validate'](_0xf480fe[_0x0314('0x30')]);if(_0x17dbb9[_0x0314('0x2c')]>0x0){return _0x582451[_0x0314('0x1b')](0x190)[_0x0314('0x31')](_0x17dbb9);}var _0x19d14b=_0xf480fe[_0x0314('0x30')]['userId'];var _0x41ec80=_0xf480fe[_0x0314('0x30')][_0x0314('0x40')];var _0x5a69ac=_0xf480fe[_0x0314('0x30')][_0x0314('0x4c')];return getAgent(_0x19d14b)[_0x0314('0x1f')](function(_0x51632e){logger[_0x0314('0x15')](_0x0314('0x35'),_0x51632e['name']);emit(util[_0x0314('0x36')](_0x0314('0x39'),_0x51632e[_0x0314('0x1a')]),_0x0314('0x4d'),{'sessionId':_0x41ec80,'transferNumber':_0x5a69ac});return _0x582451[_0x0314('0x1b')](0xc8)['json']({'error':![],'message':_0x0314('0x4e')});})[_0x0314('0x24')](handleError(_0x582451));};
\ No newline at end of file
index 6b5ef29..ecfca13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','put','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x524e,0x15e));var _0xe524=function(_0x4c4700,_0x3cca07){_0x4c4700=_0x4c4700-0x0;var _0x18031b=_0x524e[_0x4c4700];return _0x18031b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x9')](_0xe524('0x10'),auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x9')](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x9')](_0xe524('0x14'),auth[_0xe524('0xe')](),controller['getAgents']);router['get'](_0xe524('0x15'),auth[_0xe524('0xe')](),controller[_0xe524('0x16')]);router[_0xe524('0x17')]('/',auth[_0xe524('0xe')](),controller['create']);router[_0xe524('0x17')]('/:id/dispositions',auth[_0xe524('0xe')](),controller[_0xe524('0x18')]);router['post'](_0xe524('0x12'),auth['isAuthenticated'](),controller[_0xe524('0x19')]);router['post'](_0xe524('0x14'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xe524('0x15'),auth['isAuthenticated'](),controller[_0xe524('0x1a')]);router[_0xe524('0x17')](_0xe524('0x1b'),controller[_0xe524('0x1c')]);router['post'](_0xe524('0x1d'),auth[_0xe524('0xe')](),controller['send']);router[_0xe524('0x1e')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x1f')]);router[_0xe524('0x20')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x21')]);router[_0xe524('0x20')]('/:id/dispositions',auth[_0xe524('0xe')](),controller['removeDispositions']);router['delete'](_0xe524('0x12'),auth[_0xe524('0xe')](),controller[_0xe524('0x22')]);router[_0xe524('0x20')]('/:id/users',auth[_0xe524('0xe')](),controller['removeAgents']);module[_0xe524('0x23')]=router;
\ No newline at end of file
+var _0xc6ac=['index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','create','post','addDisposition','addAgents','addApplications','/:id/notify','notify','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated'];(function(_0x2bdf04,_0x5e608e){var _0x33ce04=function(_0x357c41){while(--_0x357c41){_0x2bdf04['push'](_0x2bdf04['shift']());}};_0x33ce04(++_0x5e608e);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x251757,_0x2ab196){_0x251757=_0x251757-0x0;var _0x4aedb0=_0xc6ac[_0x251757];return _0x4aedb0;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0xb')](_0xcc6a('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0xcc6a('0xb')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller['getApplications']);router['post']('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x18')]);router[_0xcc6a('0x19')](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1a')]);router[_0xcc6a('0x19')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x19')](_0xcc6a('0x17'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1c')]);router[_0xcc6a('0x19')](_0xcc6a('0x1d'),controller[_0xcc6a('0x1e')]);router[_0xcc6a('0x19')]('/:id/send',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x1f')]);router[_0xcc6a('0x20')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x21')]);router[_0xcc6a('0x22')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x23')]);router[_0xcc6a('0x22')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x24')]);router[_0xcc6a('0x22')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x25')]);router[_0xcc6a('0x22')](_0xcc6a('0x16'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x26')]);module[_0xcc6a('0x27')]=router;
\ No newline at end of file
index 837df1e..89c4d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe60=['ENUM','twilio','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','mandatoryDisposition','sequelize','STRING','name','generate'];(function(_0x188650,_0xc40d8){var _0x4db216=function(_0x42cc5c){while(--_0x42cc5c){_0x188650['push'](_0x188650['shift']());}};_0x4db216(++_0xc40d8);}(_0xbe60,0x173));var _0x0be6=function(_0x485600,_0x5aa262){_0x485600=_0x485600-0x0;var _0x9bec12=_0xbe60[_0x485600];return _0x9bec12;};'use strict';var Sequelize=require(_0x0be6('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x0be6('0x1')],'unique':_0x0be6('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x0be6('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0be6('0x1')],'defaultValue':function(){return rs[_0x0be6('0x3')]();}},'phone':{'type':Sequelize[_0x0be6('0x1')]},'type':{'type':Sequelize[_0x0be6('0x4')](_0x0be6('0x5'))},'accountSid':{'type':Sequelize[_0x0be6('0x1')]},'authToken':{'type':Sequelize[_0x0be6('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0be6('0x6')],'defaultValue':function(){return _0x0be6('0x7');}},'notificationSound':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'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[_0x0be6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0be6('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0be6('0x9')],'comment':_0x0be6('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x0be6('0x8')],'defaultValue':![],'comment':_0x0be6('0xb'),'set':function(_0x25341b){if(!_0x25341b){this[_0x0be6('0xc')](_0x0be6('0xd'),null);}this[_0x0be6('0xc')](_0x0be6('0xe'),_0x25341b);}},'description':{'type':Sequelize[_0x0be6('0x1')]}};
\ No newline at end of file
+var _0xf8aa=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','generate','ENUM','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x463f24,_0x48446f){var _0x142111=function(_0x494b8a){while(--_0x494b8a){_0x463f24['push'](_0x463f24['shift']());}};_0x142111(++_0x48446f);}(_0xf8aa,0xe1));var _0xaf8a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf8aa[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xaf8a('0x0'));var rs=require(_0xaf8a('0x1'));module['exports']={'name':{'type':Sequelize[_0xaf8a('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xaf8a('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xaf8a('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xaf8a('0x2')],'defaultValue':function(){return rs[_0xaf8a('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf8a('0x4')]('twilio')},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xaf8a('0x2')]},'notificationTemplate':{'type':Sequelize[_0xaf8a('0x5')],'defaultValue':function(){return _0xaf8a('0x6');}},'notificationSound':{'type':Sequelize[_0xaf8a('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xaf8a('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaf8a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaf8a('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf8a('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaf8a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf8a('0x8')],'comment':_0xaf8a('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xaf8a('0xa'),'set':function(_0x5af3e5){if(!_0x5af3e5){this[_0xaf8a('0xb')](_0xaf8a('0xc'),null);}this['setDataValue']('mandatoryDisposition',_0x5af3e5);}},'description':{'type':Sequelize[_0xaf8a('0x2')]}};
\ No newline at end of file
index e08303b..ac193dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17c=['hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','WhatsappAccount','includeAll','include','findAll','show','params','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','rawAttributes','order','rows','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','messageId','MessageSid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','defaults','contact','WhatsappInteraction','interaction','push','applications','close','*,*,*,*','created','WhatsappMessage','ContactId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','to\x20is\x20mandatory','List','out','Messages','dataValues','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','key','query','keys','filters','model','intersection','fields','attributes','length'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0xc17c,0x124));var _0xcc17=function(_0x1812bf,_0x35a68d){_0x1812bf=_0x1812bf-0x0;var _0x5f3c47=_0xc17c[_0x1812bf];return _0x5f3c47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc17('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc17('0x1'));var rp=require(_0xcc17('0x2'));var moment=require('moment');var BPromise=require(_0xcc17('0x3'));var Mustache=require(_0xcc17('0x4'));var util=require(_0xcc17('0x5'));var path=require(_0xcc17('0x6'));var sox=require(_0xcc17('0x7'));var csv=require('to-csv');var ejs=require(_0xcc17('0x8'));var fs=require('fs');var fs_extra=require(_0xcc17('0x9'));var _=require('lodash');var squel=require(_0xcc17('0xa'));var crypto=require(_0xcc17('0xb'));var jsforce=require(_0xcc17('0xc'));var deskjs=require(_0xcc17('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc17('0xe'));var Redis=require(_0xcc17('0xf'));var authService=require(_0xcc17('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcc17('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcc17('0x12'));var utils=require(_0xcc17('0x13'));var config=require(_0xcc17('0x14'));var licenseUtil=require(_0xcc17('0x15'));var db=require(_0xcc17('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcc17('0x17'),'port':0x18eb});var socket=require(_0xcc17('0x18'))(new Redis(config[_0xcc17('0x19')]));require(_0xcc17('0x1a'))[_0xcc17('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xcc17('0x1c')][_0xcc17('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x5490f9,_0x435e76,_0x1adc29,_0x570cdd){return new BPromise(function(_0x39e788,_0x219c80){var _0x220dd3=_0x570cdd||client;return _0x220dd3['request'](_0x5490f9,_0x1adc29)[_0xcc17('0x1e')](function(_0x24b39a){logger[_0xcc17('0x1f')](_0xcc17('0x20'),_0x435e76,_0xcc17('0x21'));logger[_0xcc17('0x22')](_0xcc17('0x23'),_0x435e76,_0xcc17('0x21'),JSON[_0xcc17('0x24')](_0x24b39a));if(_0x24b39a[_0xcc17('0x25')]){if(_0x24b39a['error'][_0xcc17('0x26')]===0x1f4){logger[_0xcc17('0x25')](_0xcc17('0x20'),_0x435e76,_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);return _0x219c80(_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);}logger[_0xcc17('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x435e76,_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);return _0x39e788(_0x24b39a[_0xcc17('0x25')][_0xcc17('0x27')]);}else{logger[_0xcc17('0x1f')](_0xcc17('0x20'),_0x435e76,'request\x20sent');_0x39e788(_0x24b39a[_0xcc17('0x28')][_0xcc17('0x27')]);}})[_0xcc17('0x29')](function(_0x2594d0){logger['error'](_0xcc17('0x20'),_0x435e76,_0x2594d0);_0x219c80(_0x2594d0);});});}function respondWithStatusCode(_0x2246e1,_0x5adc7d){_0x5adc7d=_0x5adc7d||0xcc;return function(_0x19190f){if(_0x19190f){return _0x2246e1[_0xcc17('0x2a')](_0x5adc7d);}return _0x2246e1[_0xcc17('0x2b')](_0x5adc7d)[_0xcc17('0x2c')]();};}function respondWithResult(_0x3f3a8e,_0x2c0b8d){_0x2c0b8d=_0x2c0b8d||0xc8;return function(_0x520951){if(_0x520951){return _0x3f3a8e['status'](_0x2c0b8d)[_0xcc17('0x2d')](_0x520951);}};}function respondWithFilteredResult(_0x1fd78c,_0x17b87c){return function(_0x49ddbf){if(_0x49ddbf){var _0x262f26=typeof _0x17b87c[_0xcc17('0x2e')]===_0xcc17('0x2f')&&typeof _0x17b87c['limit']==='undefined';var _0x5565ce=_0x49ddbf[_0xcc17('0x30')];var _0x9ca5d5=_0x262f26?0x0:_0x17b87c[_0xcc17('0x2e')];var _0x185d6c=_0x262f26?_0x49ddbf[_0xcc17('0x30')]:_0x17b87c[_0xcc17('0x2e')]+_0x17b87c[_0xcc17('0x31')];var _0x3bebcf;if(_0x185d6c>=_0x5565ce){_0x185d6c=_0x5565ce;_0x3bebcf=0xc8;}else{_0x3bebcf=0xce;}_0x1fd78c['status'](_0x3bebcf);return _0x1fd78c[_0xcc17('0x32')](_0xcc17('0x33'),_0x9ca5d5+'-'+_0x185d6c+'/'+_0x5565ce)[_0xcc17('0x2d')](_0x49ddbf);}return null;};}function patchUpdates(_0x464361){return function(_0x303049){try{jsonpatch[_0xcc17('0x34')](_0x303049,_0x464361,!![]);}catch(_0x43b6f0){return BPromise[_0xcc17('0x35')](_0x43b6f0);}return _0x303049['save']();};}function saveUpdates(_0x4e3067,_0x5bb4cb){return function(_0x22e8ec){if(_0x22e8ec){return _0x22e8ec[_0xcc17('0x36')](_0x4e3067)['then'](function(_0x2927de){return _0x2927de;});}return null;};}function removeEntity(_0x2c19b1,_0x3139d2){return function(_0x5def21){if(_0x5def21){return _0x5def21[_0xcc17('0x37')]()['then'](function(){var _0x4f2583=_0x5def21['get']({'plain':!![]});var _0x1795e0=_0xcc17('0x38');return db[_0xcc17('0x39')][_0xcc17('0x37')]({'where':{'type':_0x1795e0,'resourceId':_0x4f2583['id']}})['then'](function(){return _0x5def21;});})[_0xcc17('0x1e')](function(){_0x2c19b1[_0xcc17('0x2b')](0xcc)[_0xcc17('0x2c')]();});}};}function handleEntityNotFound(_0x58f394,_0x2d212b){return function(_0x1ab5c8){if(!_0x1ab5c8){_0x58f394[_0xcc17('0x2a')](0x194);}return _0x1ab5c8;};}function handleError(_0xede912,_0x316502){_0x316502=_0x316502||0x1f4;return function(_0x5bb5a7){logger[_0xcc17('0x25')](_0x5bb5a7[_0xcc17('0x3a')]);if(_0x5bb5a7['name']){delete _0x5bb5a7[_0xcc17('0x3b')];}_0xede912[_0xcc17('0x2b')](_0x316502)[_0xcc17('0x3c')](_0x5bb5a7);};}exports['index']=function(_0x597aa3,_0x5b3772){var _0x346569={'include':[{'model':db[_0xcc17('0x3d')],'as':_0xcc17('0x3e')}]},_0x18209c={},_0x3ef7a4={'count':0x0,'rows':[]};var _0x5dda08=_[_0xcc17('0x3f')](db['WhatsappAccount']['rawAttributes'],function(_0x4695f6){return{'name':_0x4695f6[_0xcc17('0x40')],'type':_0x4695f6['type'][_0xcc17('0x41')]};});_0x18209c['model']=_[_0xcc17('0x3f')](_0x5dda08,_0xcc17('0x3b'));_0x18209c[_0xcc17('0x42')]=_[_0xcc17('0x43')](_0x597aa3[_0xcc17('0x42')]);_0x18209c[_0xcc17('0x44')]=_['intersection'](_0x18209c[_0xcc17('0x45')],_0x18209c[_0xcc17('0x42')]);_0x346569['attributes']=_[_0xcc17('0x46')](_0x18209c['model'],qs[_0xcc17('0x47')](_0x597aa3[_0xcc17('0x42')]['fields']));_0x346569['attributes']=_0x346569[_0xcc17('0x48')][_0xcc17('0x49')]?_0x346569[_0xcc17('0x48')]:_0x18209c[_0xcc17('0x45')];if(!_0x597aa3['query'][_0xcc17('0x4a')]('nolimit')){_0x346569[_0xcc17('0x31')]=qs['limit'](_0x597aa3[_0xcc17('0x42')]['limit']);_0x346569['offset']=qs[_0xcc17('0x2e')](_0x597aa3[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x346569['order']=qs[_0xcc17('0x4b')](_0x597aa3['query'][_0xcc17('0x4b')]);_0x346569[_0xcc17('0x4c')]=qs['filters'](_[_0xcc17('0x4d')](_0x597aa3[_0xcc17('0x42')],_0x18209c[_0xcc17('0x44')]),_0x5dda08);if(_0x597aa3[_0xcc17('0x42')]['filter']){_0x346569[_0xcc17('0x4c')]=_[_0xcc17('0x4e')](_0x346569[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x5dda08,function(_0x475615){if(_0x475615[_0xcc17('0x4f')]!==_0xcc17('0x50')){var _0x40073c={};_0x40073c[_0x475615[_0xcc17('0x3b')]]={'$like':'%'+_0x597aa3[_0xcc17('0x42')][_0xcc17('0x51')]+'%'};return _0x40073c;}})});}_0x346569=_['merge']({},_0x346569,_0x597aa3[_0xcc17('0x52')]);var _0x3d10b5={'where':_0x346569[_0xcc17('0x4c')]};return db[_0xcc17('0x53')][_0xcc17('0x30')](_0x3d10b5)[_0xcc17('0x1e')](function(_0x47b377){_0x3ef7a4[_0xcc17('0x30')]=_0x47b377;if(_0x597aa3[_0xcc17('0x42')][_0xcc17('0x54')]){_0x346569[_0xcc17('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcc17('0x56')](_0x346569);})[_0xcc17('0x1e')](function(_0x573a63){_0x3ef7a4['rows']=_0x573a63;return _0x3ef7a4;})[_0xcc17('0x1e')](respondWithFilteredResult(_0x5b3772,_0x346569))['catch'](handleError(_0x5b3772,null));};exports[_0xcc17('0x57')]=function(_0x254744,_0x500144){var _0xb5cf64={'raw':![],'where':{'id':_0x254744[_0xcc17('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x426129={};_0x426129[_0xcc17('0x45')]=_[_0xcc17('0x43')](db[_0xcc17('0x53')]['rawAttributes']);_0x426129[_0xcc17('0x42')]=_[_0xcc17('0x43')](_0x254744[_0xcc17('0x42')]);_0x426129[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x426129[_0xcc17('0x45')],_0x426129[_0xcc17('0x42')]);_0xb5cf64['attributes']=_[_0xcc17('0x46')](_0x426129[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x254744[_0xcc17('0x42')][_0xcc17('0x47')]));_0xb5cf64['attributes']=_0xb5cf64[_0xcc17('0x48')]['length']?_0xb5cf64['attributes']:_0x426129[_0xcc17('0x45')];if(_0x254744['query'][_0xcc17('0x54')]){_0xb5cf64['include']=[{'all':!![]}];}_0xb5cf64=_[_0xcc17('0x4e')]({},_0xb5cf64,_0x254744[_0xcc17('0x52')]);return db[_0xcc17('0x53')]['find'](_0xb5cf64)['then'](handleEntityNotFound(_0x500144,null))['then'](respondWithResult(_0x500144,null))[_0xcc17('0x29')](handleError(_0x500144,null));};exports[_0xcc17('0x59')]=function(_0x2a1deb,_0x350354){return db[_0xcc17('0x53')][_0xcc17('0x59')](_0x2a1deb[_0xcc17('0x5a')],{})['then'](function(_0x925b84){var _0x1c0528=_0x2a1deb['user'][_0xcc17('0x5b')]({'plain':!![]});if(!_0x1c0528)throw new Error(_0xcc17('0x5c'));if(_0x1c0528['role']===_0xcc17('0x5d')){var _0x496d9a=_0x925b84[_0xcc17('0x5b')]({'plain':!![]});var _0x5312aa=_0xcc17('0x38');return db[_0xcc17('0x5e')][_0xcc17('0x5f')]({'where':{'name':_0x5312aa,'userProfileId':_0x1c0528['userProfileId']},'raw':!![]})[_0xcc17('0x1e')](function(_0x1ebd4c){if(_0x1ebd4c&&_0x1ebd4c[_0xcc17('0x60')]===0x0){return db[_0xcc17('0x39')]['create']({'name':_0x496d9a[_0xcc17('0x3b')],'resourceId':_0x496d9a['id'],'type':_0x1ebd4c[_0xcc17('0x3b')],'sectionId':_0x1ebd4c['id']},{})['then'](function(){return _0x925b84;});}else{return _0x925b84;}})[_0xcc17('0x29')](function(_0x24b9a0){logger[_0xcc17('0x25')](_0xcc17('0x61'),_0x24b9a0);throw _0x24b9a0;});}return _0x925b84;})['then'](respondWithResult(_0x350354,0xc9))['catch'](handleError(_0x350354,null));};exports[_0xcc17('0x36')]=function(_0x5e3aeb,_0x2988fc){if(_0x5e3aeb['body']['id']){delete _0x5e3aeb[_0xcc17('0x5a')]['id'];}return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x5e3aeb[_0xcc17('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xcc17('0x1e')](handleEntityNotFound(_0x2988fc,null))[_0xcc17('0x1e')](saveUpdates(_0x5e3aeb['body'],null))[_0xcc17('0x1e')](respondWithResult(_0x2988fc,null))[_0xcc17('0x29')](handleError(_0x2988fc,null));};exports[_0xcc17('0x37')]=function(_0xf453b6,_0x3c758a){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0xf453b6[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c758a,null))['then'](removeEntity(_0x3c758a,null))[_0xcc17('0x29')](handleError(_0x3c758a,null));};exports['describe']=function(_0x284c01,_0x53f139){return db[_0xcc17('0x53')][_0xcc17('0x62')]()[_0xcc17('0x1e')](respondWithResult(_0x53f139,null))[_0xcc17('0x29')](handleError(_0x53f139,null));};exports[_0xcc17('0x63')]=function(_0x3f66ca,_0x26eea3,_0x467b38){if(_0x3f66ca[_0xcc17('0x5a')]['id']){delete _0x3f66ca[_0xcc17('0x5a')]['id'];}return db['WhatsappAccount'][_0xcc17('0x5f')]({'where':{'id':_0x3f66ca['params']['id']}})['then'](handleEntityNotFound(_0x26eea3,null))[_0xcc17('0x1e')](function(_0x1ae93a){if(_0x1ae93a){_0x3f66ca[_0xcc17('0x5a')][_0xcc17('0x64')]=_0x1ae93a['id'];return db['Disposition']['create'](_0x3f66ca[_0xcc17('0x5a')]);}})[_0xcc17('0x1e')](respondWithResult(_0x26eea3,null))[_0xcc17('0x29')](handleError(_0x26eea3,null));};exports[_0xcc17('0x65')]=function(_0x5200b2,_0xff8798,_0x5afe81){var _0x1fd44f={'raw':![],'where':{}};var _0x2dcf9f={};var _0x373b84={'count':0x0,'rows':[]};return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x5200b2[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0xff8798,null))[_0xcc17('0x1e')](function(_0x575c7b){if(_0x575c7b){_0x2dcf9f[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x67')][_0xcc17('0x68')]);_0x2dcf9f[_0xcc17('0x42')]=_['keys'](_0x5200b2[_0xcc17('0x42')]);_0x2dcf9f[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x2dcf9f[_0xcc17('0x45')],_0x2dcf9f[_0xcc17('0x42')]);_0x1fd44f['attributes']=_[_0xcc17('0x46')](_0x2dcf9f[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x5200b2[_0xcc17('0x42')]['fields']));_0x1fd44f[_0xcc17('0x48')]=_0x1fd44f[_0xcc17('0x48')][_0xcc17('0x49')]?_0x1fd44f['attributes']:_0x2dcf9f[_0xcc17('0x45')];if(!_0x5200b2['query'][_0xcc17('0x4a')]('nolimit')){_0x1fd44f['limit']=qs[_0xcc17('0x31')](_0x5200b2['query'][_0xcc17('0x31')]);_0x1fd44f[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x5200b2[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x1fd44f[_0xcc17('0x69')]=qs[_0xcc17('0x4b')](_0x5200b2[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x1fd44f[_0xcc17('0x4c')]=qs[_0xcc17('0x44')](_[_0xcc17('0x4d')](_0x5200b2['query'],_0x2dcf9f[_0xcc17('0x44')]));_0x1fd44f[_0xcc17('0x4c')][_0xcc17('0x64')]=_0x575c7b['id'];if(_0x5200b2[_0xcc17('0x42')]['filter']){_0x1fd44f[_0xcc17('0x4c')]=_['merge'](_0x1fd44f['where'],{'$or':_['map'](_0x1fd44f['attributes'],function(_0x4aad13){var _0x3210f6={};_0x3210f6[_0x4aad13]={'$like':'%'+_0x5200b2[_0xcc17('0x42')]['filter']+'%'};return _0x3210f6;})});}_0x1fd44f=_[_0xcc17('0x4e')]({},_0x1fd44f,_0x5200b2[_0xcc17('0x52')]);return db[_0xcc17('0x67')][_0xcc17('0x30')]({'where':_0x1fd44f[_0xcc17('0x4c')]})['then'](function(_0x2ce383){_0x373b84[_0xcc17('0x30')]=_0x2ce383;if(_0x5200b2[_0xcc17('0x42')]['includeAll']){_0x1fd44f[_0xcc17('0x55')]=[{'all':!![]}];}return db[_0xcc17('0x67')][_0xcc17('0x56')](_0x1fd44f);})[_0xcc17('0x1e')](function(_0x421e60){_0x373b84[_0xcc17('0x6a')]=_0x421e60;return _0x373b84;});}})[_0xcc17('0x1e')](respondWithFilteredResult(_0xff8798,_0x1fd44f))[_0xcc17('0x29')](handleError(_0xff8798,null));};exports['removeDispositions']=function(_0x5e44a1,_0x3eb715,_0x50caea){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x5e44a1[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x3eb715,null))[_0xcc17('0x1e')](function(_0x688b18){if(_0x688b18){return _0x688b18['removeDispositions'](_0x5e44a1['query'][_0xcc17('0x6b')]);}})[_0xcc17('0x1e')](respondWithStatusCode(_0x3eb715,null))['catch'](handleError(_0x3eb715,null));};exports[_0xcc17('0x6c')]=function(_0x563830,_0x4ba313,_0x23ccd9){if(_0x563830[_0xcc17('0x5a')]['id']){delete _0x563830['body']['id'];}return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x563830[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x4ba313,null))[_0xcc17('0x1e')](function(_0x54dab9){if(_0x54dab9){_0x563830[_0xcc17('0x5a')][_0xcc17('0x64')]=_0x54dab9['id'];return db['CannedAnswer'][_0xcc17('0x59')](_0x563830[_0xcc17('0x5a')]);}})[_0xcc17('0x1e')](respondWithResult(_0x4ba313,null))[_0xcc17('0x29')](handleError(_0x4ba313,null));};exports['getAnswers']=function(_0x333bff,_0x33f216,_0x50b921){var _0x1acfd3={'raw':![],'where':{}};var _0x497b03={};var _0x305814={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcc17('0x66')]({'where':{'id':_0x333bff['params']['id']}})['then'](handleEntityNotFound(_0x33f216,null))[_0xcc17('0x1e')](function(_0x139f0c){if(_0x139f0c){_0x497b03[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x6d')][_0xcc17('0x68')]);_0x497b03['query']=_['keys'](_0x333bff[_0xcc17('0x42')]);_0x497b03['filters']=_[_0xcc17('0x46')](_0x497b03[_0xcc17('0x45')],_0x497b03['query']);_0x1acfd3[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x497b03[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x333bff[_0xcc17('0x42')][_0xcc17('0x47')]));_0x1acfd3['attributes']=_0x1acfd3[_0xcc17('0x48')][_0xcc17('0x49')]?_0x1acfd3[_0xcc17('0x48')]:_0x497b03[_0xcc17('0x45')];if(!_0x333bff[_0xcc17('0x42')][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x1acfd3[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x333bff['query'][_0xcc17('0x31')]);_0x1acfd3[_0xcc17('0x2e')]=qs['offset'](_0x333bff[_0xcc17('0x42')][_0xcc17('0x2e')]);}_0x1acfd3['order']=qs[_0xcc17('0x4b')](_0x333bff[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x1acfd3['where']=qs[_0xcc17('0x44')](_[_0xcc17('0x4d')](_0x333bff[_0xcc17('0x42')],_0x497b03[_0xcc17('0x44')]));_0x1acfd3[_0xcc17('0x4c')][_0xcc17('0x64')]=_0x139f0c['id'];if(_0x333bff['query'][_0xcc17('0x51')]){_0x1acfd3['where']=_[_0xcc17('0x4e')](_0x1acfd3[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x1acfd3[_0xcc17('0x48')],function(_0x121a44){var _0x3a5931={};_0x3a5931[_0x121a44]={'$like':'%'+_0x333bff['query']['filter']+'%'};return _0x3a5931;})});}_0x1acfd3=_[_0xcc17('0x4e')]({},_0x1acfd3,_0x333bff[_0xcc17('0x52')]);return db['CannedAnswer'][_0xcc17('0x30')]({'where':_0x1acfd3['where']})[_0xcc17('0x1e')](function(_0x4e4bc2){_0x305814[_0xcc17('0x30')]=_0x4e4bc2;if(_0x333bff['query']['includeAll']){_0x1acfd3[_0xcc17('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcc17('0x56')](_0x1acfd3);})[_0xcc17('0x1e')](function(_0x2a79e1){_0x305814[_0xcc17('0x6a')]=_0x2a79e1;return _0x305814;});}})[_0xcc17('0x1e')](respondWithFilteredResult(_0x33f216,_0x1acfd3))[_0xcc17('0x29')](handleError(_0x33f216,null));};exports[_0xcc17('0x6f')]=function(_0x336b33,_0x354b1f,_0x4aa46c){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x336b33['params']['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x354b1f,null))['then'](function(_0x219cdc){if(_0x219cdc){return _0x219cdc[_0xcc17('0x6f')](_0x336b33[_0xcc17('0x42')][_0xcc17('0x6b')]);}})[_0xcc17('0x1e')](respondWithStatusCode(_0x354b1f,null))[_0xcc17('0x29')](handleError(_0x354b1f,null));};exports[_0xcc17('0x70')]=function(_0xdb191,_0x3d0bcb,_0x52705b){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0xdb191[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d0bcb,null))[_0xcc17('0x1e')](function(_0x5428cd){if(_0x5428cd){return _0x5428cd['addAgents'](_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')],_[_0xcc17('0x71')](_0xdb191['body'],[_0xcc17('0x6b'),'id'])||{})[_0xcc17('0x72')](function(_0x143c37){for(var _0x37961e=0x0;_0x37961e<_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')][_0xcc17('0x49')];_0x37961e+=0x1){socket[_0xcc17('0x73')](_0xcc17('0x74'),{'UserId':Number(_0xdb191[_0xcc17('0x5a')][_0xcc17('0x6b')][_0x37961e]),'WhatsappAccountId':Number(_0xdb191[_0xcc17('0x58')]['id'])});}return _0x143c37;});}})['then'](respondWithResult(_0x3d0bcb,null))['catch'](handleError(_0x3d0bcb,null));};exports[_0xcc17('0x75')]=function(_0x40b41b,_0x3764a7,_0x13a500){return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x40b41b[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x3764a7,null))[_0xcc17('0x1e')](function(_0xcbcaff){if(_0xcbcaff){return _0xcbcaff[_0xcc17('0x75')](_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')])[_0xcc17('0x1e')](function(){if(_[_0xcc17('0x76')](_0x40b41b['query'][_0xcc17('0x6b')])){for(var _0x1613ab=0x0;_0x1613ab<_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')]['length'];_0x1613ab+=0x1){socket[_0xcc17('0x73')](_0xcc17('0x77'),{'UserId':Number(_0x40b41b['query']['ids'][_0x1613ab]),'WhatsappAccountId':Number(_0x40b41b[_0xcc17('0x58')]['id'])});}}else{socket[_0xcc17('0x73')](_0xcc17('0x77'),{'UserId':Number(_0x40b41b[_0xcc17('0x42')][_0xcc17('0x6b')]),'WhatsappAccountId':Number(_0x40b41b[_0xcc17('0x58')]['id'])});}});}})[_0xcc17('0x1e')](respondWithStatusCode(_0x3764a7,null))['catch'](handleError(_0x3764a7,null));};exports[_0xcc17('0x78')]=function(_0x19e993,_0x28b8b8,_0x488662){var _0x38997d={};var _0x52fcf5={};var _0x30f97a;var _0xadd686;return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x19e993['params']['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x28b8b8,null))[_0xcc17('0x1e')](function(_0x45fca2){if(_0x45fca2){_0x30f97a=_0x45fca2;_0x52fcf5[_0xcc17('0x45')]=_[_0xcc17('0x43')](db['User'][_0xcc17('0x68')]);_0x52fcf5[_0xcc17('0x42')]=_['keys'](_0x19e993[_0xcc17('0x42')]);_0x52fcf5[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x52fcf5['model'],_0x52fcf5[_0xcc17('0x42')]);_0x38997d[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x52fcf5[_0xcc17('0x45')],qs[_0xcc17('0x47')](_0x19e993[_0xcc17('0x42')][_0xcc17('0x47')]));_0x38997d[_0xcc17('0x48')]=_0x38997d[_0xcc17('0x48')]['length']?_0x38997d['attributes']:_0x52fcf5[_0xcc17('0x45')];_0x38997d[_0xcc17('0x69')]=qs[_0xcc17('0x4b')](_0x19e993['query'][_0xcc17('0x4b')]);_0x38997d['where']=qs['filters'](_[_0xcc17('0x4d')](_0x19e993['query'],_0x52fcf5['filters']));if(_0x19e993[_0xcc17('0x42')][_0xcc17('0x51')]){_0x38997d['where']=_[_0xcc17('0x4e')](_0x38997d[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x38997d['attributes'],function(_0x44a2e4){var _0x172f18={};_0x172f18[_0x44a2e4]={'$like':'%'+_0x19e993[_0xcc17('0x42')][_0xcc17('0x51')]+'%'};return _0x172f18;})});}_0x38997d=_[_0xcc17('0x4e')]({},_0x38997d,_0x19e993[_0xcc17('0x52')]);return _0x30f97a[_0xcc17('0x78')](_0x38997d);}})[_0xcc17('0x1e')](function(_0x46de24){if(_0x46de24){_0xadd686=_0x46de24[_0xcc17('0x49')];if(!_0x19e993['query'][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x38997d[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x19e993[_0xcc17('0x42')]['limit']);_0x38997d[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x19e993[_0xcc17('0x42')]['offset']);}return _0x30f97a[_0xcc17('0x78')](_0x38997d);}})[_0xcc17('0x1e')](function(_0x40dd7c){if(_0x40dd7c){return _0x40dd7c?{'count':_0xadd686,'rows':_0x40dd7c}:null;}})['then'](respondWithResult(_0x28b8b8,null))['catch'](handleError(_0x28b8b8,null));};exports['addApplications']=function(_0x2612ba,_0x335fc3,_0x3925ad){return db['WhatsappAccount'][_0xcc17('0x66')]({'where':{'id':_0x2612ba[_0xcc17('0x58')]['id']}})[_0xcc17('0x1e')](handleEntityNotFound(_0x335fc3,null))[_0xcc17('0x1e')](function(_0x1650e9){if(_0x1650e9){return db[_0xcc17('0x79')][_0xcc17('0x7a')](function(_0x109aba){return db[_0xcc17('0x7b')][_0xcc17('0x37')]({'where':{'WhatsappAccountId':_0x2612ba[_0xcc17('0x58')]['id']},'transaction':_0x109aba})[_0xcc17('0x1e')](function(_0x34e882){var _0x1d5bee=_[_0xcc17('0x3f')](_0x2612ba[_0xcc17('0x5a')],function(_0x2f6459){_0x2f6459[_0xcc17('0x64')]=_0x2612ba['params']['id'];return _0x2f6459;});return db[_0xcc17('0x7b')][_0xcc17('0x7c')](_0x1d5bee,{'transaction':_0x109aba});});})['then'](function(){return db['WhatsappApplication'][_0xcc17('0x7d')]({'where':{'WhatsappAccountId':_0x2612ba[_0xcc17('0x58')]['id']},'order':_0xcc17('0x7e')});});}})['then'](respondWithResult(_0x335fc3,null))[_0xcc17('0x29')](handleError(_0x335fc3,null));};exports[_0xcc17('0x7f')]=function(_0x1e185e,_0x3d64fa,_0x1f9f96){var _0x5b6ca3={};var _0x18ef0a={};var _0x5a56e0;var _0x14bac8;return db[_0xcc17('0x53')][_0xcc17('0x66')]({'where':{'id':_0x1e185e[_0xcc17('0x58')]['id']}})['then'](handleEntityNotFound(_0x3d64fa,null))[_0xcc17('0x1e')](function(_0x4eb3af){if(_0x4eb3af){_0x5a56e0=_0x4eb3af;_0x18ef0a[_0xcc17('0x45')]=_['keys'](db[_0xcc17('0x7b')][_0xcc17('0x68')]);_0x18ef0a['query']=_[_0xcc17('0x43')](_0x1e185e[_0xcc17('0x42')]);_0x18ef0a[_0xcc17('0x44')]=_[_0xcc17('0x46')](_0x18ef0a['model'],_0x18ef0a[_0xcc17('0x42')]);_0x5b6ca3[_0xcc17('0x48')]=_[_0xcc17('0x46')](_0x18ef0a['model'],qs[_0xcc17('0x47')](_0x1e185e[_0xcc17('0x42')]['fields']));_0x5b6ca3[_0xcc17('0x48')]=_0x5b6ca3[_0xcc17('0x48')][_0xcc17('0x49')]?_0x5b6ca3[_0xcc17('0x48')]:_0x18ef0a[_0xcc17('0x45')];_0x5b6ca3['order']=qs[_0xcc17('0x4b')](_0x1e185e[_0xcc17('0x42')][_0xcc17('0x4b')]);_0x5b6ca3[_0xcc17('0x4c')]=qs['filters'](_['pick'](_0x1e185e[_0xcc17('0x42')],_0x18ef0a[_0xcc17('0x44')]));if(_0x1e185e['query'][_0xcc17('0x51')]){_0x5b6ca3[_0xcc17('0x4c')]=_[_0xcc17('0x4e')](_0x5b6ca3[_0xcc17('0x4c')],{'$or':_[_0xcc17('0x3f')](_0x5b6ca3[_0xcc17('0x48')],function(_0x9320d9){var _0x3dc68d={};_0x3dc68d[_0x9320d9]={'$like':'%'+_0x1e185e[_0xcc17('0x42')]['filter']+'%'};return _0x3dc68d;})});}_0x5b6ca3=_['merge']({},_0x5b6ca3,_0x1e185e['options']);return _0x5a56e0[_0xcc17('0x7f')](_0x5b6ca3);}})[_0xcc17('0x1e')](function(_0x3b521e){if(_0x3b521e){_0x14bac8=_0x3b521e[_0xcc17('0x49')];if(!_0x1e185e[_0xcc17('0x42')][_0xcc17('0x4a')](_0xcc17('0x6e'))){_0x5b6ca3[_0xcc17('0x31')]=qs[_0xcc17('0x31')](_0x1e185e['query']['limit']);_0x5b6ca3[_0xcc17('0x2e')]=qs[_0xcc17('0x2e')](_0x1e185e['query'][_0xcc17('0x2e')]);}return _0x5a56e0[_0xcc17('0x7f')](_0x5b6ca3);}})[_0xcc17('0x1e')](function(_0x3e408a){if(_0x3e408a){return _0x3e408a?{'count':_0x14bac8,'rows':_0x3e408a}:null;}})['then'](respondWithResult(_0x3d64fa,null))[_0xcc17('0x29')](handleError(_0x3d64fa,null));};exports[_0xcc17('0x80')]=function(_0x29ac22,_0xedc31d,_0x496631){var _0x51011f={'channel':_0xcc17('0x81')};var _0x364de3=[];var _0x35fcb6=[];var _0x56deeb={};return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x29ac22[_0xcc17('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xcc17('0x82')}]})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))[_0xcc17('0x1e')](function(_0x3b52b7){_0x51011f[_0xcc17('0x83')]=_0x3b52b7;_0x51011f['applications']=_['orderBy'](_0x3b52b7[_0xcc17('0x82')],[_0xcc17('0x7e')],[_0xcc17('0x84')]);if(_0x51011f[_0xcc17('0x83')][_0xcc17('0x82')]){delete _0x51011f[_0xcc17('0x83')][_0xcc17('0x82')];}return db[_0xcc17('0x85')][_0xcc17('0x62')]();})['then'](function(_0x54d1a9){if(!_0x54d1a9){throw new db['Sequelize'][(_0xcc17('0x86'))](_0xcc17('0x87'));}_0x364de3=_[_0xcc17('0x88')](_['keys'](_0x54d1a9),['createdAt',_0xcc17('0x89')]);_0x35fcb6=_['difference'](_[_0xcc17('0x43')](_0x54d1a9),[_0xcc17('0x8a'),_0xcc17('0x89'),_0xcc17('0x8b'),_0xcc17('0x8c')]);_0x51011f[_0xcc17('0x5a')]={'mapKey':_0xcc17('0x8d')};if(_0x51011f[_0xcc17('0x83')]['type']&&_0x51011f['account'][_0xcc17('0x4f')]===_0xcc17('0x8e')){_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')]=_0x29ac22[_0xcc17('0x5a')][_0xcc17('0x90')]['replace'](_0xcc17('0x91'),'');_0x51011f['body'][_0xcc17('0x5a')]=_0x29ac22['body']['Body'];_0x51011f['body'][_0xcc17('0x92')]=_0x29ac22[_0xcc17('0x5a')][_0xcc17('0x93')];}if(_0x51011f[_0xcc17('0x5a')]['id']){delete _0x51011f[_0xcc17('0x5a')]['id'];}if(_[_0xcc17('0x94')](_0x51011f[_0xcc17('0x5a')]['from'])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))]('from\x20is\x20mandatory');}if(_[_0xcc17('0x94')](_0x51011f['body'][_0xcc17('0x5a')])||_0x51011f[_0xcc17('0x5a')]['body']===''){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0x96'));}if(_['isNil'](_0x51011f['body'][_0xcc17('0x97')])){throw new db['Sequelize']['ValidationError'](_0xcc17('0x98')+_0x35fcb6);}if(!_[_0xcc17('0x99')](_0x35fcb6,_0x51011f[_0xcc17('0x5a')][_0xcc17('0x97')])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35fcb6);}_0x56deeb[_0x51011f[_0xcc17('0x5a')][_0xcc17('0x97')]]=_0x51011f[_0xcc17('0x5a')]['from'];return db[_0xcc17('0x9a')][_0xcc17('0x5f')]({'where':{'id':_0x51011f['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0xcc17('0x9b'),'where':_0x56deeb,'limit':0x1,'order':[[_0xcc17('0x89'),_0xcc17('0x9c')]]}]});})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))['then'](function(_0x31c4ce){if(_0x31c4ce){_0x51011f[_0xcc17('0x9d')]=_[_0xcc17('0x71')](_0x31c4ce,[_0xcc17('0x9b')]);if(_0x31c4ce['Contacts']['length']){return _0x31c4ce['Contacts'][0x0];}var _0x51bd98=_[_0xcc17('0x9e')](_0x51011f['body'],{'firstName':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'ListId':_0x31c4ce['id']});_0x51bd98[_0x51011f[_0xcc17('0x5a')]['mapKey']]=_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')];return db[_0xcc17('0x85')][_0xcc17('0x59')](_0x51bd98,{'fields':_0x364de3,'raw':!![]});}})[_0xcc17('0x1e')](handleEntityNotFound(_0xedc31d,null))[_0xcc17('0x1e')](function(_0x9ebb64){if(_0x9ebb64){_0x51011f[_0xcc17('0x9f')]=_0x9ebb64;var _0x20e420={'ContactId':_0x9ebb64['id'],'phone':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'WhatsappAccountId':_0x29ac22[_0xcc17('0x58')]['id']};var _0x42fa84={'ContactId':_0x9ebb64['id'],'WhatsappAccountId':_0x29ac22[_0xcc17('0x58')]['id'],'closed':![]};return db[_0xcc17('0xa0')]['find']({'where':_0x42fa84})['then'](function(_0x1abb65){if(_0x1abb65){return[_0x1abb65,![]];}return db[_0xcc17('0xa0')][_0xcc17('0x59')](_0x20e420)[_0xcc17('0x1e')](function(_0xaafefe){return[_0xaafefe,!![]];});});}})['spread'](function(_0x594438,_0x100c42){_0x51011f[_0xcc17('0xa1')]=_0x594438['get']({'plain':!![]});_0x51011f['interaction']['created']=![];if(_0x100c42){if(_0x51011f['account']['autoclose']){_0x51011f['applications'][_0xcc17('0xa2')]({'id':0x0,'priority':_0x51011f[_0xcc17('0xa3')][_0xcc17('0x49')]+0x1,'app':_0xcc17('0xa4'),'appdata':'unmanaged','interval':_0xcc17('0xa5')});}_0x51011f['interaction'][_0xcc17('0xa6')]=!![];}return db[_0xcc17('0xa7')][_0xcc17('0x59')]({'phone':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x8f')],'messageId':_0x51011f[_0xcc17('0x5a')][_0xcc17('0x92')],'body':_0x51011f['body'][_0xcc17('0x5a')],'WhatsappAccountId':_0x29ac22['params']['id'],'WhatsappInteractionId':_0x594438['id'],'direction':'in','ContactId':_0x594438[_0xcc17('0xa8')],'AttachmentId':_0x51011f[_0xcc17('0x5a')]['AttachmentId']});})[_0xcc17('0x1e')](function(_0x4297e1){_0x51011f['message']=_0x4297e1;if(_0x51011f[_0xcc17('0xa1')]['UserId']){return db[_0xcc17('0xa9')][_0xcc17('0x5f')]({'attributes':['id',_0xcc17('0x3b')],'where':{'id':_0x51011f['interaction']['UserId']}})[_0xcc17('0x1e')](function(_0x5c62a6){if(_0x5c62a6){_0x51011f[_0xcc17('0xa3')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcc17('0xaa'),'appdata':_0x5c62a6[_0xcc17('0x3b')]+','+(_0x51011f[_0xcc17('0x83')][_0xcc17('0xab')]||0xa),'interval':_0xcc17('0xa5')});}return respondWithRpcPromise(_0xcc17('0xac'),_0xcc17('0xad'),_0x51011f);});}return respondWithRpcPromise(_0xcc17('0xac'),_0xcc17('0xad'),_0x51011f);})[_0xcc17('0x1e')](function(_0x42b794){if(_0x42b794){var _0x40fbcf=0xc8;var _0xadc61d=_0xcc17('0xae');logger[_0xcc17('0x1f')](_0xcc17('0x23'),_0xadc61d,_0x40fbcf,_0xcc17('0xaf'));logger[_0xcc17('0x22')](_0xcc17('0xb0'),_0xadc61d,_0x40fbcf,'entity\x20found',JSON[_0xcc17('0x24')](_0x42b794));if(_0x51011f[_0xcc17('0x83')][_0xcc17('0x4f')]===_0xcc17('0x8e')){return _0xedc31d[_0xcc17('0x2b')](_0x40fbcf)['set'](_0xcc17('0xb1'),'text/xml')[_0xcc17('0x3c')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0xedc31d[_0xcc17('0x2b')](_0x40fbcf)[_0xcc17('0x2d')](_0x42b794);}}})[_0xcc17('0x29')](handleError(_0xedc31d,null));};exports[_0xcc17('0x3c')]=function(_0x3f992c,_0x375386,_0x9c5e52){var _0x13f12a,_0x576eb8,_0x480788;if(_[_0xcc17('0x94')](_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')])||_0x3f992c[_0xcc17('0x5a')]['body']===''){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0x96'));}if(_[_0xcc17('0x94')](_0x3f992c[_0xcc17('0x5a')]['to'])){throw new db[(_0xcc17('0x95'))][(_0xcc17('0x86'))](_0xcc17('0xb2'));}_0x13f12a=_0x3f992c[_0xcc17('0x5a')]['to'];return db[_0xcc17('0x53')][_0xcc17('0x5f')]({'where':{'id':_0x3f992c[_0xcc17('0x58')]['id']},'include':[{'model':db[_0xcc17('0x9a')],'as':_0xcc17('0xb3'),'include':[{'model':db['CmContact'],'as':_0xcc17('0x9b'),'where':{'mobile':_0x13f12a},'limit':0x1,'order':[[_0xcc17('0x89'),_0xcc17('0x9c')]]}]}]})[_0xcc17('0x1e')](handleEntityNotFound(_0x375386,null))[_0xcc17('0x1e')](function(_0x476edc){if(_0x476edc&&_0x476edc[_0xcc17('0xb3')]){_0x576eb8=_0x476edc[_0xcc17('0x5b')]({'plain':!![]});if(_0x576eb8[_0xcc17('0xb3')]&&_0x576eb8[_0xcc17('0xb3')][_0xcc17('0x9b')]['length']){return _0x576eb8['List'][_0xcc17('0x9b')][0x0];}return db[_0xcc17('0x85')][_0xcc17('0x59')](_[_0xcc17('0x9e')](_0x3f992c['body'],{'firstName':_0x13f12a,'mobile':_0x13f12a,'phone':_0x13f12a,'ListId':_0x576eb8[_0xcc17('0x8c')]}));}})[_0xcc17('0x1e')](handleEntityNotFound(_0x375386,null))['then'](function(_0x578ed6){if(_0x578ed6){_0x480788=_0x578ed6;return db[_0xcc17('0xa0')][_0xcc17('0x5f')]({'where':{'ContactId':_0x480788['id'],'closed':![],'WhatsappAccountId':_0x576eb8['id']}})[_0xcc17('0x1e')](function(_0xaad719){if(_0xaad719){return[_0xaad719,![]];}return db[_0xcc17('0xa0')][_0xcc17('0x59')]({'UserId':_0x3f992c[_0xcc17('0x5d')]['id'],'ContactId':_0x480788['id'],'WhatsappAccountId':_0x576eb8['id'],'phone':_0x13f12a,'firstMsgDirection':_0xcc17('0xb4'),'Messages':[_[_0xcc17('0x4e')](_0x3f992c[_0xcc17('0x5a')],{'read':![],'body':_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')],'phone':_0x13f12a,'WhatsappAccountId':_0x576eb8['id'],'UserId':_0x3f992c[_0xcc17('0x5d')]['id'],'ContactId':_0x480788['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xcc17('0xb5')}]})[_0xcc17('0x1e')](function(_0x5870d3){return[_0x5870d3,!![]];});});}})[_0xcc17('0x72')](function(_0x484d85,_0x807906){if(_0x807906){return _0x484d85;}return db[_0xcc17('0xa7')][_0xcc17('0x59')](_[_0xcc17('0x4e')](_0x3f992c['body'],{'read':![],'body':_0x3f992c[_0xcc17('0x5a')][_0xcc17('0x5a')],'phone':_0x13f12a,'WhatsappAccountId':_0x576eb8['id'],'WhatsappInteractionId':_0x484d85['id'],'UserId':_0x3f992c['user']['id'],'ContactId':_0x480788['id']}))[_0xcc17('0x1e')](function(_0x3ce94f){_0x484d85['dataValues'][_0xcc17('0xb5')]=[];_0x484d85['dataValues'][_0xcc17('0xb5')][_0xcc17('0xa2')](_0x3ce94f[_0xcc17('0xb6')]);return _0x484d85;});})['then'](respondWithResult(_0x375386,null))[_0xcc17('0x29')](handleError(_0x375386,null));};
\ No newline at end of file
+var _0x7c5e=['autoclose','push','close','unmanaged','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','Disposition','getDispositions','WhatsappAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','findOne','notify','Applications','account','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','ListId','mobile','twilio','from','replace','Body','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','WhatsappInteraction','spread','interaction','created'];(function(_0x131085,_0x2fdf72){var _0x19ecf9=function(_0x12db33){while(--_0x12db33){_0x131085['push'](_0x131085['shift']());}};_0x19ecf9(++_0x2fdf72);}(_0x7c5e,0x18c));var _0xe7c5=function(_0x28750c,_0x31224b){_0x28750c=_0x28750c-0x0;var _0xad3863=_0x7c5e[_0x28750c];return _0xad3863;};'use strict';var emlformat=require(_0xe7c5('0x0'));var rimraf=require(_0xe7c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe7c5('0x2'));var rp=require('request-promise');var moment=require(_0xe7c5('0x3'));var BPromise=require(_0xe7c5('0x4'));var Mustache=require(_0xe7c5('0x5'));var util=require(_0xe7c5('0x6'));var path=require(_0xe7c5('0x7'));var sox=require('sox');var csv=require(_0xe7c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7c5('0x9'));var squel=require(_0xe7c5('0xa'));var crypto=require(_0xe7c5('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe7c5('0xc'));var Papa=require(_0xe7c5('0xd'));var Redis=require(_0xe7c5('0xe'));var authService=require(_0xe7c5('0xf'));var qs=require(_0xe7c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7c5('0x11'));var logger=require('../../config/logger')(_0xe7c5('0x12'));var utils=require('../../config/utils');var config=require(_0xe7c5('0x13'));var licenseUtil=require(_0xe7c5('0x14'));var db=require(_0xe7c5('0x15'))['db'];config['redis']=_[_0xe7c5('0x16')](config[_0xe7c5('0x17')],{'host':_0xe7c5('0x18'),'port':0x18eb});var socket=require(_0xe7c5('0x19'))(new Redis(config[_0xe7c5('0x17')]));require('./whatsappAccount.socket')['register'](socket);var jayson=require(_0xe7c5('0x1a'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x42d282,_0x398cdc,_0x1b2223,_0x1b26ba){return new BPromise(function(_0x207c84,_0x54bb6d){var _0x7d773c=_0x1b26ba||client;return _0x7d773c['request'](_0x42d282,_0x1b2223)[_0xe7c5('0x1b')](function(_0x2e6d98){logger[_0xe7c5('0x1c')](_0xe7c5('0x1d'),_0x398cdc,'request\x20sent');logger[_0xe7c5('0x1e')](_0xe7c5('0x1f'),_0x398cdc,'request\x20sent',JSON['stringify'](_0x2e6d98));if(_0x2e6d98[_0xe7c5('0x20')]){if(_0x2e6d98[_0xe7c5('0x20')][_0xe7c5('0x21')]===0x1f4){logger['error'](_0xe7c5('0x1d'),_0x398cdc,_0x2e6d98[_0xe7c5('0x20')][_0xe7c5('0x22')]);return _0x54bb6d(_0x2e6d98[_0xe7c5('0x20')]['message']);}logger[_0xe7c5('0x20')](_0xe7c5('0x1d'),_0x398cdc,_0x2e6d98[_0xe7c5('0x20')][_0xe7c5('0x22')]);return _0x207c84(_0x2e6d98[_0xe7c5('0x20')][_0xe7c5('0x22')]);}else{logger[_0xe7c5('0x1c')]('WhatsappAccount,\x20%s,\x20%s',_0x398cdc,_0xe7c5('0x23'));_0x207c84(_0x2e6d98['result'][_0xe7c5('0x22')]);}})['catch'](function(_0x467740){logger['error'](_0xe7c5('0x1d'),_0x398cdc,_0x467740);_0x54bb6d(_0x467740);});});}function respondWithStatusCode(_0x467576,_0x256e70){_0x256e70=_0x256e70||0xcc;return function(_0x11631f){if(_0x11631f){return _0x467576[_0xe7c5('0x24')](_0x256e70);}return _0x467576[_0xe7c5('0x25')](_0x256e70)[_0xe7c5('0x26')]();};}function respondWithResult(_0x164479,_0x19f879){_0x19f879=_0x19f879||0xc8;return function(_0x145690){if(_0x145690){return _0x164479[_0xe7c5('0x25')](_0x19f879)[_0xe7c5('0x27')](_0x145690);}};}function respondWithFilteredResult(_0x1a922d,_0x13f388){return function(_0x53344d){if(_0x53344d){var _0x4858ef=typeof _0x13f388[_0xe7c5('0x28')]==='undefined'&&typeof _0x13f388[_0xe7c5('0x29')]===_0xe7c5('0x2a');var _0x503749=_0x53344d[_0xe7c5('0x2b')];var _0xcf7577=_0x4858ef?0x0:_0x13f388[_0xe7c5('0x28')];var _0x5bc26f=_0x4858ef?_0x53344d[_0xe7c5('0x2b')]:_0x13f388['offset']+_0x13f388[_0xe7c5('0x29')];var _0x53b252;if(_0x5bc26f>=_0x503749){_0x5bc26f=_0x503749;_0x53b252=0xc8;}else{_0x53b252=0xce;}_0x1a922d[_0xe7c5('0x25')](_0x53b252);return _0x1a922d['set'](_0xe7c5('0x2c'),_0xcf7577+'-'+_0x5bc26f+'/'+_0x503749)[_0xe7c5('0x27')](_0x53344d);}return null;};}function patchUpdates(_0x241051){return function(_0x1f4123){try{jsonpatch[_0xe7c5('0x2d')](_0x1f4123,_0x241051,!![]);}catch(_0x45f83b){return BPromise[_0xe7c5('0x2e')](_0x45f83b);}return _0x1f4123[_0xe7c5('0x2f')]();};}function saveUpdates(_0x5e8cc1,_0x143d84){return function(_0x42a126){if(_0x42a126){return _0x42a126['update'](_0x5e8cc1)['then'](function(_0x323584){return _0x323584;});}return null;};}function removeEntity(_0x3ca10d,_0x4e40f4){return function(_0x496161){if(_0x496161){return _0x496161[_0xe7c5('0x30')]()[_0xe7c5('0x1b')](function(){var _0x2f3e9c=_0x496161[_0xe7c5('0x31')]({'plain':!![]});var _0x4f1f66=_0xe7c5('0x32');return db[_0xe7c5('0x33')][_0xe7c5('0x30')]({'where':{'type':_0x4f1f66,'resourceId':_0x2f3e9c['id']}})['then'](function(){return _0x496161;});})[_0xe7c5('0x1b')](function(){_0x3ca10d[_0xe7c5('0x25')](0xcc)[_0xe7c5('0x26')]();});}};}function handleEntityNotFound(_0x39d501,_0x418588){return function(_0x4ce7ba){if(!_0x4ce7ba){_0x39d501[_0xe7c5('0x24')](0x194);}return _0x4ce7ba;};}function handleError(_0x5a5b31,_0x458484){_0x458484=_0x458484||0x1f4;return function(_0x4494f0){logger[_0xe7c5('0x20')](_0x4494f0['stack']);if(_0x4494f0['name']){delete _0x4494f0['name'];}_0x5a5b31['status'](_0x458484)[_0xe7c5('0x34')](_0x4494f0);};}exports[_0xe7c5('0x35')]=function(_0x2a7762,_0x4c6814){var _0x4efa2d={'include':[{'model':db[_0xe7c5('0x36')],'as':_0xe7c5('0x37')}]},_0x39efd0={},_0x142b7e={'count':0x0,'rows':[]};var _0x35c27d=_[_0xe7c5('0x38')](db[_0xe7c5('0x39')][_0xe7c5('0x3a')],function(_0x25224f){return{'name':_0x25224f[_0xe7c5('0x3b')],'type':_0x25224f[_0xe7c5('0x3c')][_0xe7c5('0x3d')]};});_0x39efd0['model']=_[_0xe7c5('0x38')](_0x35c27d,_0xe7c5('0x3e'));_0x39efd0[_0xe7c5('0x3f')]=_[_0xe7c5('0x40')](_0x2a7762['query']);_0x39efd0[_0xe7c5('0x41')]=_['intersection'](_0x39efd0[_0xe7c5('0x42')],_0x39efd0[_0xe7c5('0x3f')]);_0x4efa2d[_0xe7c5('0x43')]=_[_0xe7c5('0x44')](_0x39efd0[_0xe7c5('0x42')],qs['fields'](_0x2a7762[_0xe7c5('0x3f')]['fields']));_0x4efa2d[_0xe7c5('0x43')]=_0x4efa2d['attributes'][_0xe7c5('0x45')]?_0x4efa2d[_0xe7c5('0x43')]:_0x39efd0[_0xe7c5('0x42')];if(!_0x2a7762[_0xe7c5('0x3f')][_0xe7c5('0x46')](_0xe7c5('0x47'))){_0x4efa2d[_0xe7c5('0x29')]=qs[_0xe7c5('0x29')](_0x2a7762[_0xe7c5('0x3f')][_0xe7c5('0x29')]);_0x4efa2d['offset']=qs[_0xe7c5('0x28')](_0x2a7762[_0xe7c5('0x3f')]['offset']);}_0x4efa2d[_0xe7c5('0x48')]=qs[_0xe7c5('0x49')](_0x2a7762[_0xe7c5('0x3f')][_0xe7c5('0x49')]);_0x4efa2d[_0xe7c5('0x4a')]=qs[_0xe7c5('0x41')](_[_0xe7c5('0x4b')](_0x2a7762[_0xe7c5('0x3f')],_0x39efd0[_0xe7c5('0x41')]),_0x35c27d);if(_0x2a7762[_0xe7c5('0x3f')]['filter']){_0x4efa2d[_0xe7c5('0x4a')]=_[_0xe7c5('0x4c')](_0x4efa2d[_0xe7c5('0x4a')],{'$or':_[_0xe7c5('0x38')](_0x35c27d,function(_0x285460){if(_0x285460[_0xe7c5('0x3c')]!==_0xe7c5('0x4d')){var _0x5b1ef0={};_0x5b1ef0[_0x285460[_0xe7c5('0x3e')]]={'$like':'%'+_0x2a7762[_0xe7c5('0x3f')][_0xe7c5('0x4e')]+'%'};return _0x5b1ef0;}})});}_0x4efa2d=_[_0xe7c5('0x4c')]({},_0x4efa2d,_0x2a7762[_0xe7c5('0x4f')]);var _0x2db388={'where':_0x4efa2d[_0xe7c5('0x4a')]};return db[_0xe7c5('0x39')]['count'](_0x2db388)['then'](function(_0xae22c8){_0x142b7e['count']=_0xae22c8;if(_0x2a7762[_0xe7c5('0x3f')]['includeAll']){_0x4efa2d['include']=[{'all':!![]}];}return db[_0xe7c5('0x39')][_0xe7c5('0x50')](_0x4efa2d);})['then'](function(_0x18ccc5){_0x142b7e[_0xe7c5('0x51')]=_0x18ccc5;return _0x142b7e;})[_0xe7c5('0x1b')](respondWithFilteredResult(_0x4c6814,_0x4efa2d))[_0xe7c5('0x52')](handleError(_0x4c6814,null));};exports[_0xe7c5('0x53')]=function(_0x588310,_0x218719){var _0x5128f6={'raw':![],'where':{'id':_0x588310[_0xe7c5('0x54')]['id']},'include':[{'model':db[_0xe7c5('0x36')],'as':'mandatoryDispositionPause'}]},_0x1d63f6={};_0x1d63f6[_0xe7c5('0x42')]=_[_0xe7c5('0x40')](db['WhatsappAccount'][_0xe7c5('0x3a')]);_0x1d63f6[_0xe7c5('0x3f')]=_[_0xe7c5('0x40')](_0x588310[_0xe7c5('0x3f')]);_0x1d63f6['filters']=_['intersection'](_0x1d63f6[_0xe7c5('0x42')],_0x1d63f6[_0xe7c5('0x3f')]);_0x5128f6[_0xe7c5('0x43')]=_['intersection'](_0x1d63f6['model'],qs[_0xe7c5('0x55')](_0x588310[_0xe7c5('0x3f')]['fields']));_0x5128f6[_0xe7c5('0x43')]=_0x5128f6[_0xe7c5('0x43')][_0xe7c5('0x45')]?_0x5128f6[_0xe7c5('0x43')]:_0x1d63f6['model'];if(_0x588310[_0xe7c5('0x3f')][_0xe7c5('0x56')]){_0x5128f6[_0xe7c5('0x57')]=[{'all':!![]}];}_0x5128f6=_[_0xe7c5('0x4c')]({},_0x5128f6,_0x588310[_0xe7c5('0x4f')]);return db[_0xe7c5('0x39')][_0xe7c5('0x58')](_0x5128f6)[_0xe7c5('0x1b')](handleEntityNotFound(_0x218719,null))[_0xe7c5('0x1b')](respondWithResult(_0x218719,null))[_0xe7c5('0x52')](handleError(_0x218719,null));};exports[_0xe7c5('0x59')]=function(_0x29d462,_0x1062ba){return db[_0xe7c5('0x39')]['create'](_0x29d462[_0xe7c5('0x5a')],{})['then'](function(_0x1775f4){var _0x435322=_0x29d462[_0xe7c5('0x5b')]['get']({'plain':!![]});if(!_0x435322)throw new Error(_0xe7c5('0x5c'));if(_0x435322[_0xe7c5('0x5d')]===_0xe7c5('0x5b')){var _0x330592=_0x1775f4[_0xe7c5('0x31')]({'plain':!![]});var _0x4af03f=_0xe7c5('0x32');return db[_0xe7c5('0x5e')]['find']({'where':{'name':_0x4af03f,'userProfileId':_0x435322[_0xe7c5('0x5f')]},'raw':!![]})[_0xe7c5('0x1b')](function(_0x2ac183){if(_0x2ac183&&_0x2ac183[_0xe7c5('0x60')]===0x0){return db[_0xe7c5('0x33')]['create']({'name':_0x330592[_0xe7c5('0x3e')],'resourceId':_0x330592['id'],'type':_0x2ac183['name'],'sectionId':_0x2ac183['id']},{})[_0xe7c5('0x1b')](function(){return _0x1775f4;});}else{return _0x1775f4;}})[_0xe7c5('0x52')](function(_0x544a2b){logger[_0xe7c5('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x544a2b);throw _0x544a2b;});}return _0x1775f4;})[_0xe7c5('0x1b')](respondWithResult(_0x1062ba,0xc9))[_0xe7c5('0x52')](handleError(_0x1062ba,null));};exports[_0xe7c5('0x61')]=function(_0x4f2fe4,_0x1127d7){if(_0x4f2fe4[_0xe7c5('0x5a')]['id']){delete _0x4f2fe4[_0xe7c5('0x5a')]['id'];}return db[_0xe7c5('0x39')]['find']({'where':{'id':_0x4f2fe4[_0xe7c5('0x54')]['id']},'include':[{'model':db[_0xe7c5('0x36')],'as':_0xe7c5('0x37')}]})[_0xe7c5('0x1b')](handleEntityNotFound(_0x1127d7,null))['then'](saveUpdates(_0x4f2fe4[_0xe7c5('0x5a')],null))[_0xe7c5('0x1b')](respondWithResult(_0x1127d7,null))['catch'](handleError(_0x1127d7,null));};exports[_0xe7c5('0x30')]=function(_0x58ded9,_0x10ebb3){return db[_0xe7c5('0x39')][_0xe7c5('0x58')]({'where':{'id':_0x58ded9[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x10ebb3,null))[_0xe7c5('0x1b')](removeEntity(_0x10ebb3,null))[_0xe7c5('0x52')](handleError(_0x10ebb3,null));};exports[_0xe7c5('0x62')]=function(_0x23e2d1,_0x9ff6bd){return db[_0xe7c5('0x39')][_0xe7c5('0x62')]()[_0xe7c5('0x1b')](respondWithResult(_0x9ff6bd,null))[_0xe7c5('0x52')](handleError(_0x9ff6bd,null));};exports[_0xe7c5('0x63')]=function(_0x85ef68,_0x5272ae,_0x283245){if(_0x85ef68[_0xe7c5('0x5a')]['id']){delete _0x85ef68['body']['id'];}return db['WhatsappAccount'][_0xe7c5('0x58')]({'where':{'id':_0x85ef68[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x5272ae,null))['then'](function(_0xf560f6){if(_0xf560f6){_0x85ef68[_0xe7c5('0x5a')]['WhatsappAccountId']=_0xf560f6['id'];return db[_0xe7c5('0x64')][_0xe7c5('0x59')](_0x85ef68[_0xe7c5('0x5a')]);}})[_0xe7c5('0x1b')](respondWithResult(_0x5272ae,null))['catch'](handleError(_0x5272ae,null));};exports[_0xe7c5('0x65')]=function(_0x4034bb,_0x257e90,_0x49fe7b){var _0x39723e={'raw':![],'where':{}};var _0x46f7b3={};var _0x30d961={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x4034bb[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x257e90,null))[_0xe7c5('0x1b')](function(_0x2bd480){if(_0x2bd480){_0x46f7b3[_0xe7c5('0x42')]=_['keys'](db[_0xe7c5('0x64')][_0xe7c5('0x3a')]);_0x46f7b3[_0xe7c5('0x3f')]=_['keys'](_0x4034bb[_0xe7c5('0x3f')]);_0x46f7b3[_0xe7c5('0x41')]=_[_0xe7c5('0x44')](_0x46f7b3['model'],_0x46f7b3[_0xe7c5('0x3f')]);_0x39723e[_0xe7c5('0x43')]=_[_0xe7c5('0x44')](_0x46f7b3['model'],qs[_0xe7c5('0x55')](_0x4034bb[_0xe7c5('0x3f')][_0xe7c5('0x55')]));_0x39723e[_0xe7c5('0x43')]=_0x39723e['attributes'][_0xe7c5('0x45')]?_0x39723e[_0xe7c5('0x43')]:_0x46f7b3[_0xe7c5('0x42')];if(!_0x4034bb['query'][_0xe7c5('0x46')](_0xe7c5('0x47'))){_0x39723e[_0xe7c5('0x29')]=qs[_0xe7c5('0x29')](_0x4034bb[_0xe7c5('0x3f')][_0xe7c5('0x29')]);_0x39723e[_0xe7c5('0x28')]=qs['offset'](_0x4034bb[_0xe7c5('0x3f')][_0xe7c5('0x28')]);}_0x39723e[_0xe7c5('0x48')]=qs['sort'](_0x4034bb['query'][_0xe7c5('0x49')]);_0x39723e['where']=qs['filters'](_[_0xe7c5('0x4b')](_0x4034bb['query'],_0x46f7b3[_0xe7c5('0x41')]));_0x39723e[_0xe7c5('0x4a')][_0xe7c5('0x66')]=_0x2bd480['id'];if(_0x4034bb[_0xe7c5('0x3f')][_0xe7c5('0x4e')]){_0x39723e['where']=_[_0xe7c5('0x4c')](_0x39723e[_0xe7c5('0x4a')],{'$or':_[_0xe7c5('0x38')](_0x39723e[_0xe7c5('0x43')],function(_0x11c543){var _0x18a036={};_0x18a036[_0x11c543]={'$like':'%'+_0x4034bb['query'][_0xe7c5('0x4e')]+'%'};return _0x18a036;})});}_0x39723e=_[_0xe7c5('0x4c')]({},_0x39723e,_0x4034bb['options']);return db[_0xe7c5('0x64')][_0xe7c5('0x2b')]({'where':_0x39723e[_0xe7c5('0x4a')]})[_0xe7c5('0x1b')](function(_0x3f7069){_0x30d961[_0xe7c5('0x2b')]=_0x3f7069;if(_0x4034bb[_0xe7c5('0x3f')][_0xe7c5('0x56')]){_0x39723e[_0xe7c5('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xe7c5('0x50')](_0x39723e);})[_0xe7c5('0x1b')](function(_0xcd0c57){_0x30d961[_0xe7c5('0x51')]=_0xcd0c57;return _0x30d961;});}})[_0xe7c5('0x1b')](respondWithFilteredResult(_0x257e90,_0x39723e))[_0xe7c5('0x52')](handleError(_0x257e90,null));};exports[_0xe7c5('0x67')]=function(_0x6febb1,_0x51d482,_0x48f259){return db[_0xe7c5('0x39')][_0xe7c5('0x58')]({'where':{'id':_0x6febb1['params']['id']}})['then'](handleEntityNotFound(_0x51d482,null))[_0xe7c5('0x1b')](function(_0x4f71a4){if(_0x4f71a4){return _0x4f71a4[_0xe7c5('0x67')](_0x6febb1[_0xe7c5('0x3f')][_0xe7c5('0x68')]);}})[_0xe7c5('0x1b')](respondWithStatusCode(_0x51d482,null))[_0xe7c5('0x52')](handleError(_0x51d482,null));};exports[_0xe7c5('0x69')]=function(_0x4eed1b,_0x568aa9,_0x1a6262){if(_0x4eed1b['body']['id']){delete _0x4eed1b[_0xe7c5('0x5a')]['id'];}return db[_0xe7c5('0x39')]['find']({'where':{'id':_0x4eed1b[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x568aa9,null))[_0xe7c5('0x1b')](function(_0x4a2c58){if(_0x4a2c58){_0x4eed1b[_0xe7c5('0x5a')]['WhatsappAccountId']=_0x4a2c58['id'];return db[_0xe7c5('0x6a')][_0xe7c5('0x59')](_0x4eed1b[_0xe7c5('0x5a')]);}})[_0xe7c5('0x1b')](respondWithResult(_0x568aa9,null))['catch'](handleError(_0x568aa9,null));};exports[_0xe7c5('0x6b')]=function(_0x45d69e,_0x263c39,_0x2f1a6e){var _0xba6fc={'raw':![],'where':{}};var _0x1be5d9={};var _0x535294={'count':0x0,'rows':[]};return db[_0xe7c5('0x39')]['findOne']({'where':{'id':_0x45d69e[_0xe7c5('0x54')]['id']}})['then'](handleEntityNotFound(_0x263c39,null))['then'](function(_0x16e6d6){if(_0x16e6d6){_0x1be5d9[_0xe7c5('0x42')]=_[_0xe7c5('0x40')](db['CannedAnswer'][_0xe7c5('0x3a')]);_0x1be5d9['query']=_['keys'](_0x45d69e[_0xe7c5('0x3f')]);_0x1be5d9['filters']=_[_0xe7c5('0x44')](_0x1be5d9['model'],_0x1be5d9['query']);_0xba6fc[_0xe7c5('0x43')]=_[_0xe7c5('0x44')](_0x1be5d9['model'],qs[_0xe7c5('0x55')](_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x55')]));_0xba6fc[_0xe7c5('0x43')]=_0xba6fc['attributes'][_0xe7c5('0x45')]?_0xba6fc[_0xe7c5('0x43')]:_0x1be5d9['model'];if(!_0x45d69e[_0xe7c5('0x3f')]['hasOwnProperty'](_0xe7c5('0x47'))){_0xba6fc[_0xe7c5('0x29')]=qs[_0xe7c5('0x29')](_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x29')]);_0xba6fc[_0xe7c5('0x28')]=qs[_0xe7c5('0x28')](_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x28')]);}_0xba6fc[_0xe7c5('0x48')]=qs['sort'](_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x49')]);_0xba6fc[_0xe7c5('0x4a')]=qs['filters'](_[_0xe7c5('0x4b')](_0x45d69e[_0xe7c5('0x3f')],_0x1be5d9[_0xe7c5('0x41')]));_0xba6fc['where'][_0xe7c5('0x66')]=_0x16e6d6['id'];if(_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x4e')]){_0xba6fc[_0xe7c5('0x4a')]=_[_0xe7c5('0x4c')](_0xba6fc['where'],{'$or':_['map'](_0xba6fc[_0xe7c5('0x43')],function(_0x50502e){var _0x1ede85={};_0x1ede85[_0x50502e]={'$like':'%'+_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x4e')]+'%'};return _0x1ede85;})});}_0xba6fc=_[_0xe7c5('0x4c')]({},_0xba6fc,_0x45d69e['options']);return db[_0xe7c5('0x6a')][_0xe7c5('0x2b')]({'where':_0xba6fc[_0xe7c5('0x4a')]})[_0xe7c5('0x1b')](function(_0x348171){_0x535294[_0xe7c5('0x2b')]=_0x348171;if(_0x45d69e[_0xe7c5('0x3f')][_0xe7c5('0x56')]){_0xba6fc['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xe7c5('0x50')](_0xba6fc);})[_0xe7c5('0x1b')](function(_0x10e798){_0x535294[_0xe7c5('0x51')]=_0x10e798;return _0x535294;});}})[_0xe7c5('0x1b')](respondWithFilteredResult(_0x263c39,_0xba6fc))[_0xe7c5('0x52')](handleError(_0x263c39,null));};exports[_0xe7c5('0x6c')]=function(_0x2a745a,_0x110d64,_0x383e05){return db[_0xe7c5('0x39')][_0xe7c5('0x58')]({'where':{'id':_0x2a745a[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x110d64,null))[_0xe7c5('0x1b')](function(_0x35ac41){if(_0x35ac41){return _0x35ac41['removeAnswers'](_0x2a745a[_0xe7c5('0x3f')][_0xe7c5('0x68')]);}})[_0xe7c5('0x1b')](respondWithStatusCode(_0x110d64,null))['catch'](handleError(_0x110d64,null));};exports[_0xe7c5('0x6d')]=function(_0x7d70e9,_0x20cea2,_0x465a6f){return db[_0xe7c5('0x39')][_0xe7c5('0x58')]({'where':{'id':_0x7d70e9[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x20cea2,null))[_0xe7c5('0x1b')](function(_0x2dbcd0){if(_0x2dbcd0){return _0x2dbcd0['addAgents'](_0x7d70e9[_0xe7c5('0x5a')][_0xe7c5('0x68')],_[_0xe7c5('0x6e')](_0x7d70e9[_0xe7c5('0x5a')],['ids','id'])||{})['spread'](function(_0x2337ea){for(var _0x5c8f50=0x0;_0x5c8f50<_0x7d70e9[_0xe7c5('0x5a')][_0xe7c5('0x68')]['length'];_0x5c8f50+=0x1){socket[_0xe7c5('0x6f')](_0xe7c5('0x70'),{'UserId':Number(_0x7d70e9[_0xe7c5('0x5a')][_0xe7c5('0x68')][_0x5c8f50]),'WhatsappAccountId':Number(_0x7d70e9['params']['id'])});}return _0x2337ea;});}})[_0xe7c5('0x1b')](respondWithResult(_0x20cea2,null))[_0xe7c5('0x52')](handleError(_0x20cea2,null));};exports[_0xe7c5('0x71')]=function(_0x4383a8,_0x11f3c1,_0xb6b1ec){return db[_0xe7c5('0x39')][_0xe7c5('0x58')]({'where':{'id':_0x4383a8[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x11f3c1,null))[_0xe7c5('0x1b')](function(_0x4ac447){if(_0x4ac447){return _0x4ac447[_0xe7c5('0x71')](_0x4383a8['query'][_0xe7c5('0x68')])[_0xe7c5('0x1b')](function(){if(_[_0xe7c5('0x72')](_0x4383a8['query'][_0xe7c5('0x68')])){for(var _0x5cd66c=0x0;_0x5cd66c<_0x4383a8[_0xe7c5('0x3f')][_0xe7c5('0x68')][_0xe7c5('0x45')];_0x5cd66c+=0x1){socket[_0xe7c5('0x6f')](_0xe7c5('0x73'),{'UserId':Number(_0x4383a8[_0xe7c5('0x3f')][_0xe7c5('0x68')][_0x5cd66c]),'WhatsappAccountId':Number(_0x4383a8[_0xe7c5('0x54')]['id'])});}}else{socket[_0xe7c5('0x6f')](_0xe7c5('0x73'),{'UserId':Number(_0x4383a8[_0xe7c5('0x3f')]['ids']),'WhatsappAccountId':Number(_0x4383a8[_0xe7c5('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x11f3c1,null))[_0xe7c5('0x52')](handleError(_0x11f3c1,null));};exports[_0xe7c5('0x74')]=function(_0x116b9d,_0x2195e8,_0x5586d5){var _0x27f08={};var _0x2f7b5f={};var _0x2d0cd3;var _0x21865c;return db[_0xe7c5('0x39')]['findOne']({'where':{'id':_0x116b9d[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x2195e8,null))[_0xe7c5('0x1b')](function(_0x37209f){if(_0x37209f){_0x2d0cd3=_0x37209f;_0x2f7b5f[_0xe7c5('0x42')]=_['keys'](db[_0xe7c5('0x75')][_0xe7c5('0x3a')]);_0x2f7b5f[_0xe7c5('0x3f')]=_[_0xe7c5('0x40')](_0x116b9d[_0xe7c5('0x3f')]);_0x2f7b5f['filters']=_[_0xe7c5('0x44')](_0x2f7b5f['model'],_0x2f7b5f[_0xe7c5('0x3f')]);_0x27f08[_0xe7c5('0x43')]=_[_0xe7c5('0x44')](_0x2f7b5f[_0xe7c5('0x42')],qs[_0xe7c5('0x55')](_0x116b9d['query']['fields']));_0x27f08['attributes']=_0x27f08['attributes']['length']?_0x27f08[_0xe7c5('0x43')]:_0x2f7b5f[_0xe7c5('0x42')];_0x27f08[_0xe7c5('0x48')]=qs[_0xe7c5('0x49')](_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x49')]);_0x27f08[_0xe7c5('0x4a')]=qs[_0xe7c5('0x41')](_[_0xe7c5('0x4b')](_0x116b9d['query'],_0x2f7b5f[_0xe7c5('0x41')]));if(_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x4e')]){_0x27f08[_0xe7c5('0x4a')]=_[_0xe7c5('0x4c')](_0x27f08[_0xe7c5('0x4a')],{'$or':_[_0xe7c5('0x38')](_0x27f08[_0xe7c5('0x43')],function(_0x25f440){var _0x441a91={};_0x441a91[_0x25f440]={'$like':'%'+_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x4e')]+'%'};return _0x441a91;})});}_0x27f08=_[_0xe7c5('0x4c')]({},_0x27f08,_0x116b9d[_0xe7c5('0x4f')]);return _0x2d0cd3[_0xe7c5('0x74')](_0x27f08);}})[_0xe7c5('0x1b')](function(_0x4dcb52){if(_0x4dcb52){_0x21865c=_0x4dcb52[_0xe7c5('0x45')];if(!_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x46')](_0xe7c5('0x47'))){_0x27f08[_0xe7c5('0x29')]=qs[_0xe7c5('0x29')](_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x29')]);_0x27f08['offset']=qs[_0xe7c5('0x28')](_0x116b9d[_0xe7c5('0x3f')][_0xe7c5('0x28')]);}return _0x2d0cd3[_0xe7c5('0x74')](_0x27f08);}})[_0xe7c5('0x1b')](function(_0x4fc08c){if(_0x4fc08c){return _0x4fc08c?{'count':_0x21865c,'rows':_0x4fc08c}:null;}})[_0xe7c5('0x1b')](respondWithResult(_0x2195e8,null))['catch'](handleError(_0x2195e8,null));};exports['addApplications']=function(_0x2a8688,_0x3c51b9,_0x4dca8d){return db[_0xe7c5('0x39')]['findOne']({'where':{'id':_0x2a8688[_0xe7c5('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c51b9,null))['then'](function(_0xe934f6){if(_0xe934f6){return db[_0xe7c5('0x76')][_0xe7c5('0x77')](function(_0xbb804d){return db[_0xe7c5('0x78')][_0xe7c5('0x30')]({'where':{'WhatsappAccountId':_0x2a8688['params']['id']},'transaction':_0xbb804d})['then'](function(_0x464403){var _0x55b2c7=_[_0xe7c5('0x38')](_0x2a8688['body'],function(_0x4a0d96){_0x4a0d96[_0xe7c5('0x66')]=_0x2a8688[_0xe7c5('0x54')]['id'];return _0x4a0d96;});return db['WhatsappApplication'][_0xe7c5('0x79')](_0x55b2c7,{'transaction':_0xbb804d});});})[_0xe7c5('0x1b')](function(){return db['WhatsappApplication'][_0xe7c5('0x7a')]({'where':{'WhatsappAccountId':_0x2a8688[_0xe7c5('0x54')]['id']},'order':_0xe7c5('0x7b')});});}})[_0xe7c5('0x1b')](respondWithResult(_0x3c51b9,null))[_0xe7c5('0x52')](handleError(_0x3c51b9,null));};exports[_0xe7c5('0x7c')]=function(_0x5d1e1a,_0xe89336,_0x4ed14d){var _0x4d29df={};var _0x520f25={};var _0x579671;var _0x44a008;return db[_0xe7c5('0x39')][_0xe7c5('0x7d')]({'where':{'id':_0x5d1e1a[_0xe7c5('0x54')]['id']}})[_0xe7c5('0x1b')](handleEntityNotFound(_0xe89336,null))[_0xe7c5('0x1b')](function(_0x223b14){if(_0x223b14){_0x579671=_0x223b14;_0x520f25[_0xe7c5('0x42')]=_[_0xe7c5('0x40')](db[_0xe7c5('0x78')][_0xe7c5('0x3a')]);_0x520f25['query']=_[_0xe7c5('0x40')](_0x5d1e1a[_0xe7c5('0x3f')]);_0x520f25['filters']=_[_0xe7c5('0x44')](_0x520f25['model'],_0x520f25['query']);_0x4d29df['attributes']=_[_0xe7c5('0x44')](_0x520f25[_0xe7c5('0x42')],qs[_0xe7c5('0x55')](_0x5d1e1a[_0xe7c5('0x3f')][_0xe7c5('0x55')]));_0x4d29df['attributes']=_0x4d29df['attributes'][_0xe7c5('0x45')]?_0x4d29df[_0xe7c5('0x43')]:_0x520f25[_0xe7c5('0x42')];_0x4d29df[_0xe7c5('0x48')]=qs['sort'](_0x5d1e1a['query']['sort']);_0x4d29df[_0xe7c5('0x4a')]=qs[_0xe7c5('0x41')](_['pick'](_0x5d1e1a[_0xe7c5('0x3f')],_0x520f25[_0xe7c5('0x41')]));if(_0x5d1e1a[_0xe7c5('0x3f')][_0xe7c5('0x4e')]){_0x4d29df['where']=_[_0xe7c5('0x4c')](_0x4d29df[_0xe7c5('0x4a')],{'$or':_[_0xe7c5('0x38')](_0x4d29df['attributes'],function(_0xcd9b0e){var _0x2409fa={};_0x2409fa[_0xcd9b0e]={'$like':'%'+_0x5d1e1a[_0xe7c5('0x3f')][_0xe7c5('0x4e')]+'%'};return _0x2409fa;})});}_0x4d29df=_[_0xe7c5('0x4c')]({},_0x4d29df,_0x5d1e1a[_0xe7c5('0x4f')]);return _0x579671['getApplications'](_0x4d29df);}})[_0xe7c5('0x1b')](function(_0x28e78a){if(_0x28e78a){_0x44a008=_0x28e78a[_0xe7c5('0x45')];if(!_0x5d1e1a[_0xe7c5('0x3f')][_0xe7c5('0x46')]('nolimit')){_0x4d29df['limit']=qs[_0xe7c5('0x29')](_0x5d1e1a[_0xe7c5('0x3f')][_0xe7c5('0x29')]);_0x4d29df[_0xe7c5('0x28')]=qs[_0xe7c5('0x28')](_0x5d1e1a[_0xe7c5('0x3f')]['offset']);}return _0x579671['getApplications'](_0x4d29df);}})[_0xe7c5('0x1b')](function(_0x5aac28){if(_0x5aac28){return _0x5aac28?{'count':_0x44a008,'rows':_0x5aac28}:null;}})[_0xe7c5('0x1b')](respondWithResult(_0xe89336,null))[_0xe7c5('0x52')](handleError(_0xe89336,null));};exports[_0xe7c5('0x7e')]=function(_0x419033,_0x21fc47,_0xe9398b){var _0x10f9bf={'channel':'whatsapp'};var _0x186176=[];var _0x57c609=[];var _0x21fdd7={};return db['WhatsappAccount'][_0xe7c5('0x58')]({'where':{'id':_0x419033[_0xe7c5('0x54')]['id']},'include':[{'model':db[_0xe7c5('0x78')],'as':_0xe7c5('0x7f')}]})[_0xe7c5('0x1b')](handleEntityNotFound(_0x21fc47,null))['then'](function(_0x416aa5){_0x10f9bf[_0xe7c5('0x80')]=_0x416aa5;_0x10f9bf[_0xe7c5('0x81')]=_['orderBy'](_0x416aa5[_0xe7c5('0x7f')],[_0xe7c5('0x7b')],[_0xe7c5('0x82')]);if(_0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0x7f')]){delete _0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0x7f')];}return db[_0xe7c5('0x83')][_0xe7c5('0x62')]();})[_0xe7c5('0x1b')](function(_0x5e7994){if(!_0x5e7994){throw new db['Sequelize'][(_0xe7c5('0x84'))](_0xe7c5('0x85'));}_0x186176=_['difference'](_[_0xe7c5('0x40')](_0x5e7994),[_0xe7c5('0x86'),'updatedAt']);_0x57c609=_[_0xe7c5('0x87')](_[_0xe7c5('0x40')](_0x5e7994),[_0xe7c5('0x86'),_0xe7c5('0x88'),'CompanyId',_0xe7c5('0x89')]);_0x10f9bf[_0xe7c5('0x5a')]={'mapKey':_0xe7c5('0x8a')};if(_0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0x3c')]&&_0x10f9bf['account']['type']===_0xe7c5('0x8b')){_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x8c')]=_0x419033[_0xe7c5('0x5a')]['From'][_0xe7c5('0x8d')]('whatsapp:','');_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x5a')]=_0x419033['body'][_0xe7c5('0x8e')];_0x10f9bf[_0xe7c5('0x5a')]['messageId']=_0x419033[_0xe7c5('0x5a')]['MessageSid'];}if(_0x10f9bf[_0xe7c5('0x5a')]['id']){delete _0x10f9bf[_0xe7c5('0x5a')]['id'];}if(_[_0xe7c5('0x8f')](_0x10f9bf['body'][_0xe7c5('0x8c')])){throw new db[(_0xe7c5('0x90'))][(_0xe7c5('0x84'))]('from\x20is\x20mandatory');}if(_[_0xe7c5('0x8f')](_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x5a')])||_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x5a')]===''){throw new db['Sequelize'][(_0xe7c5('0x84'))](_0xe7c5('0x91'));}if(_[_0xe7c5('0x8f')](_0x10f9bf[_0xe7c5('0x5a')]['mapKey'])){throw new db['Sequelize'][(_0xe7c5('0x84'))](_0xe7c5('0x92')+_0x57c609);}if(!_['includes'](_0x57c609,_0x10f9bf['body'][_0xe7c5('0x93')])){throw new db[(_0xe7c5('0x90'))][(_0xe7c5('0x84'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57c609);}_0x21fdd7[_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x93')]]=_0x10f9bf['body'][_0xe7c5('0x8c')];return db[_0xe7c5('0x94')][_0xe7c5('0x58')]({'where':{'id':_0x10f9bf['account'][_0xe7c5('0x89')]},'include':[{'model':db[_0xe7c5('0x83')],'as':_0xe7c5('0x95'),'where':_0x21fdd7,'limit':0x1,'order':[[_0xe7c5('0x88'),_0xe7c5('0x96')]]}]});})[_0xe7c5('0x1b')](handleEntityNotFound(_0x21fc47,null))['then'](function(_0x3e0f8d){if(_0x3e0f8d){_0x10f9bf[_0xe7c5('0x97')]=_[_0xe7c5('0x6e')](_0x3e0f8d,[_0xe7c5('0x95')]);if(_0x3e0f8d[_0xe7c5('0x95')][_0xe7c5('0x45')]){return _0x3e0f8d[_0xe7c5('0x95')][0x0];}var _0x17e3a5=_['defaults'](_0x10f9bf[_0xe7c5('0x5a')],{'firstName':_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x8c')],'ListId':_0x3e0f8d['id']});_0x17e3a5[_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x93')]]=_0x10f9bf['body']['from'];return db['CmContact']['create'](_0x17e3a5,{'fields':_0x186176,'raw':!![]});}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x21fc47,null))[_0xe7c5('0x1b')](function(_0x55274c){if(_0x55274c){_0x10f9bf['contact']=_0x55274c;var _0x17a7c0={'ContactId':_0x55274c['id'],'phone':_0x10f9bf[_0xe7c5('0x5a')]['from'],'WhatsappAccountId':_0x419033[_0xe7c5('0x54')]['id']};var _0x1902a5={'ContactId':_0x55274c['id'],'WhatsappAccountId':_0x419033[_0xe7c5('0x54')]['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x1902a5})['then'](function(_0x7f0d2c){if(_0x7f0d2c){return[_0x7f0d2c,![]];}return db[_0xe7c5('0x98')][_0xe7c5('0x59')](_0x17a7c0)[_0xe7c5('0x1b')](function(_0x9c4bec){return[_0x9c4bec,!![]];});});}})[_0xe7c5('0x99')](function(_0x4de3ce,_0x5d2c4e){_0x10f9bf[_0xe7c5('0x9a')]=_0x4de3ce[_0xe7c5('0x31')]({'plain':!![]});_0x10f9bf[_0xe7c5('0x9a')][_0xe7c5('0x9b')]=![];if(_0x5d2c4e){if(_0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0x9c')]){_0x10f9bf[_0xe7c5('0x81')][_0xe7c5('0x9d')]({'id':0x0,'priority':_0x10f9bf[_0xe7c5('0x81')]['length']+0x1,'app':_0xe7c5('0x9e'),'appdata':_0xe7c5('0x9f'),'interval':'*,*,*,*'});}_0x10f9bf[_0xe7c5('0x9a')][_0xe7c5('0x9b')]=!![];}return db[_0xe7c5('0xa0')][_0xe7c5('0x59')]({'phone':_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x8c')],'messageId':_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0xa1')],'body':_0x10f9bf[_0xe7c5('0x5a')][_0xe7c5('0x5a')],'WhatsappAccountId':_0x419033['params']['id'],'WhatsappInteractionId':_0x4de3ce['id'],'direction':'in','ContactId':_0x4de3ce[_0xe7c5('0xa2')],'AttachmentId':_0x10f9bf['body'][_0xe7c5('0xa3')]});})[_0xe7c5('0x1b')](function(_0x30b416){_0x10f9bf[_0xe7c5('0x22')]=_0x30b416;if(_0x10f9bf[_0xe7c5('0x9a')][_0xe7c5('0xa4')]){return db[_0xe7c5('0x75')][_0xe7c5('0x58')]({'attributes':['id',_0xe7c5('0x3e')],'where':{'id':_0x10f9bf['interaction'][_0xe7c5('0xa4')]}})[_0xe7c5('0x1b')](function(_0x5dac8a){if(_0x5dac8a){_0x10f9bf['applications'][_0xe7c5('0xa5')]({'id':0x0,'priority':0x0,'app':_0xe7c5('0xa6'),'appdata':_0x5dac8a[_0xe7c5('0x3e')]+','+(_0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0xa7')]||0xa),'interval':_0xe7c5('0xa8')});}return respondWithRpcPromise(_0xe7c5('0xa9'),_0xe7c5('0xaa'),_0x10f9bf);});}return respondWithRpcPromise(_0xe7c5('0xa9'),_0xe7c5('0xaa'),_0x10f9bf);})[_0xe7c5('0x1b')](function(_0x3807c1){if(_0x3807c1){var _0x445ee1=0xc8;var _0xa34447=_0xe7c5('0xab');logger[_0xe7c5('0x1c')](_0xe7c5('0x1f'),_0xa34447,_0x445ee1,_0xe7c5('0xac'));logger[_0xe7c5('0x1e')](_0xe7c5('0xad'),_0xa34447,_0x445ee1,_0xe7c5('0xac'),JSON[_0xe7c5('0xae')](_0x3807c1));if(_0x10f9bf[_0xe7c5('0x80')][_0xe7c5('0x3c')]===_0xe7c5('0x8b')){return _0x21fc47[_0xe7c5('0x25')](_0x445ee1)[_0xe7c5('0xaf')](_0xe7c5('0xb0'),_0xe7c5('0xb1'))[_0xe7c5('0x34')](_0xe7c5('0xb2'));}else{return _0x21fc47[_0xe7c5('0x25')](_0x445ee1)[_0xe7c5('0x27')](_0x3807c1);}}})['catch'](handleError(_0x21fc47,null));};exports[_0xe7c5('0x34')]=function(_0x4867ad,_0x3ee5d8,_0x30e53e){var _0x35da99,_0x38c35d,_0x5cfa85;if(_['isNil'](_0x4867ad[_0xe7c5('0x5a')][_0xe7c5('0x5a')])||_0x4867ad[_0xe7c5('0x5a')][_0xe7c5('0x5a')]===''){throw new db['Sequelize'][(_0xe7c5('0x84'))](_0xe7c5('0x91'));}if(_[_0xe7c5('0x8f')](_0x4867ad[_0xe7c5('0x5a')]['to'])){throw new db['Sequelize'][(_0xe7c5('0x84'))](_0xe7c5('0xb3'));}_0x35da99=_0x4867ad[_0xe7c5('0x5a')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x4867ad[_0xe7c5('0x54')]['id']},'include':[{'model':db[_0xe7c5('0x94')],'as':_0xe7c5('0xb4'),'include':[{'model':db[_0xe7c5('0x83')],'as':_0xe7c5('0x95'),'where':{'mobile':_0x35da99},'limit':0x1,'order':[[_0xe7c5('0x88'),_0xe7c5('0x96')]]}]}]})[_0xe7c5('0x1b')](handleEntityNotFound(_0x3ee5d8,null))[_0xe7c5('0x1b')](function(_0x576abd){if(_0x576abd&&_0x576abd['List']){_0x38c35d=_0x576abd['get']({'plain':!![]});if(_0x38c35d['List']&&_0x38c35d[_0xe7c5('0xb4')]['Contacts'][_0xe7c5('0x45')]){return _0x38c35d[_0xe7c5('0xb4')][_0xe7c5('0x95')][0x0];}return db['CmContact']['create'](_['defaults'](_0x4867ad[_0xe7c5('0x5a')],{'firstName':_0x35da99,'mobile':_0x35da99,'phone':_0x35da99,'ListId':_0x38c35d[_0xe7c5('0x89')]}));}})[_0xe7c5('0x1b')](handleEntityNotFound(_0x3ee5d8,null))[_0xe7c5('0x1b')](function(_0x5ae9d5){if(_0x5ae9d5){_0x5cfa85=_0x5ae9d5;return db['WhatsappInteraction'][_0xe7c5('0x58')]({'where':{'ContactId':_0x5cfa85['id'],'closed':![],'WhatsappAccountId':_0x38c35d['id']}})[_0xe7c5('0x1b')](function(_0x57803b){if(_0x57803b){return[_0x57803b,![]];}return db[_0xe7c5('0x98')][_0xe7c5('0x59')]({'UserId':_0x4867ad[_0xe7c5('0x5b')]['id'],'ContactId':_0x5cfa85['id'],'WhatsappAccountId':_0x38c35d['id'],'phone':_0x35da99,'firstMsgDirection':_0xe7c5('0xb5'),'Messages':[_['merge'](_0x4867ad[_0xe7c5('0x5a')],{'read':![],'body':_0x4867ad[_0xe7c5('0x5a')]['body'],'phone':_0x35da99,'WhatsappAccountId':_0x38c35d['id'],'UserId':_0x4867ad[_0xe7c5('0x5b')]['id'],'ContactId':_0x5cfa85['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xe7c5('0xb6')}]})['then'](function(_0x3f83bf){return[_0x3f83bf,!![]];});});}})['spread'](function(_0x3fe3a3,_0x4e4fbc){if(_0x4e4fbc){return _0x3fe3a3;}return db[_0xe7c5('0xa0')][_0xe7c5('0x59')](_['merge'](_0x4867ad[_0xe7c5('0x5a')],{'read':![],'body':_0x4867ad['body'][_0xe7c5('0x5a')],'phone':_0x35da99,'WhatsappAccountId':_0x38c35d['id'],'WhatsappInteractionId':_0x3fe3a3['id'],'UserId':_0x4867ad[_0xe7c5('0x5b')]['id'],'ContactId':_0x5cfa85['id']}))[_0xe7c5('0x1b')](function(_0x240e40){_0x3fe3a3[_0xe7c5('0xb7')][_0xe7c5('0xb6')]=[];_0x3fe3a3['dataValues'][_0xe7c5('0xb6')][_0xe7c5('0x9d')](_0x240e40[_0xe7c5('0xb7')]);return _0x3fe3a3;});})[_0xe7c5('0x1b')](respondWithResult(_0x3ee5d8,null))[_0xe7c5('0x52')](handleError(_0x3ee5d8,null));};
\ No newline at end of file
index 5c39db3..8f973b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04e0=['setMaxListeners','update','emit','hook','events','../../mysqldb','WhatsappAccount'];(function(_0x137520,_0x4ab4b0){var _0x5d1adb=function(_0x31988e){while(--_0x31988e){_0x137520['push'](_0x137520['shift']());}};_0x5d1adb(++_0x4ab4b0);}(_0x04e0,0x1e7));var _0x004e=function(_0x8e4c02,_0x24c0ac){_0x8e4c02=_0x8e4c02-0x0;var _0x410c6f=_0x04e0[_0x8e4c02];return _0x410c6f;};'use strict';var EventEmitter=require(_0x004e('0x0'));var WhatsappAccount=require(_0x004e('0x1'))['db'][_0x004e('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x004e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x004e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e36c2){return function(_0x2cca8c,_0x46bb85,_0x1d334b){WhatsappAccountEvents[_0x004e('0x5')](_0x5e36c2+':'+_0x2cca8c['id'],_0x2cca8c);WhatsappAccountEvents['emit'](_0x5e36c2,_0x2cca8c);_0x1d334b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x004e('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
+var _0xd881=['../../mysqldb','WhatsappAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x122d9f,_0x2c9e5b){var _0x41a09e=function(_0x3d9564){while(--_0x3d9564){_0x122d9f['push'](_0x122d9f['shift']());}};_0x41a09e(++_0x2c9e5b);}(_0xd881,0xfb));var _0x1d88=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd881[_0x42cae2];return _0x5f256f;};'use strict';var EventEmitter=require(_0x1d88('0x0'));var WhatsappAccount=require(_0x1d88('0x1'))['db'][_0x1d88('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1d88('0x3')](0x0);var events={'afterCreate':_0x1d88('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5727f1){return function(_0x5154cd,_0x478091,_0x3b0ffb){WhatsappAccountEvents[_0x1d88('0x5')](_0x5727f1+':'+_0x5154cd['id'],_0x5154cd);WhatsappAccountEvents[_0x1d88('0x5')](_0x5727f1,_0x5154cd);_0x3b0ffb(null);};}for(var e in events){if(events[_0x1d88('0x6')](e)){var event=events[e];WhatsappAccount[_0x1d88('0x7')](e,emitEvent(event));}}module[_0x1d88('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
index 051dccc..59a61d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8f=['../../config/environment','exports','define','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3294b8,_0x25b32d){var _0x164391=function(_0x4e65eb){while(--_0x4e65eb){_0x3294b8['push'](_0x3294b8['shift']());}};_0x164391(++_0x25b32d);}(_0x7c8f,0xae));var _0xf7c8=function(_0x4f58eb,_0x334778){_0x4f58eb=_0x4f58eb-0x0;var _0x11a1d1=_0x7c8f[_0x4f58eb];return _0x11a1d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf7c8('0x0'))(_0xf7c8('0x1'));var moment=require(_0xf7c8('0x2'));var BPromise=require(_0xf7c8('0x3'));var rp=require(_0xf7c8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7c8('0x5'));var config=require(_0xf7c8('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0xf7c8('0x7')]=function(_0x3d776f,_0x11905a){return _0x3d776f[_0xf7c8('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33e7=['request-promise','rimraf','../../config/environment','exports','define','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3a96cc,_0x133cf5){var _0x5d2cac=function(_0x108582){while(--_0x108582){_0x3a96cc['push'](_0x3a96cc['shift']());}};_0x5d2cac(++_0x133cf5);}(_0x33e7,0x13a));var _0x733e=function(_0x5286ea,_0x5d7e75){_0x5286ea=_0x5286ea-0x0;var _0x410213=_0x33e7[_0x5286ea];return _0x410213;};'use strict';var _=require(_0x733e('0x0'));var util=require('util');var logger=require(_0x733e('0x1'))(_0x733e('0x2'));var moment=require(_0x733e('0x3'));var BPromise=require(_0x733e('0x4'));var rp=require(_0x733e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x733e('0x6'));var config=require(_0x733e('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x733e('0x8')]=function(_0x5eb1a3,_0x1e8c6c){return _0x5eb1a3[_0x733e('0x9')]('WhatsappAccount',attributes,{'tableName':_0x733e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e1adcb..84b9824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab3=['stringify','error','message','info','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','model','map','lodash','util','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s'];(function(_0xdcc10a,_0x3687b9){var _0x2afd5b=function(_0x576319){while(--_0x576319){_0xdcc10a['push'](_0xdcc10a['shift']());}};_0x2afd5b(++_0x3687b9);}(_0x1ab3,0x8e));var _0x31ab=function(_0x37d61c,_0x42b68b){_0x37d61c=_0x37d61c-0x0;var _0x303976=_0x1ab3[_0x37d61c];return _0x303976;};'use strict';var _=require(_0x31ab('0x0'));var util=require(_0x31ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31ab('0x2'));var db=require(_0x31ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x31ab('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31ab('0x5'));var client=jayson[_0x31ab('0x6')][_0x31ab('0x7')]({'port':0x232a});config['redis']=_[_0x31ab('0x8')](config[_0x31ab('0x9')],{'host':_0x31ab('0xa'),'port':0x18eb});var socket=require(_0x31ab('0xb'))(new Redis(config[_0x31ab('0x9')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x5179bf,_0x5a45f3,_0x1ab414){return new BPromise(function(_0x2488d4,_0x1399b0){return client[_0x31ab('0xc')](_0x5179bf,_0x1ab414)[_0x31ab('0xd')](function(_0x2c1796){logger['info'](_0x31ab('0xe'),_0x5a45f3,_0x31ab('0xf'));logger[_0x31ab('0x10')](_0x31ab('0x11'),_0x5a45f3,'request\x20sent',JSON[_0x31ab('0x12')](_0x2c1796));if(_0x2c1796[_0x31ab('0x13')]){if(_0x2c1796[_0x31ab('0x13')]['code']===0x1f4){logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x2c1796['error']['message']);return _0x1399b0(_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);}logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);return _0x2488d4(_0x2c1796[_0x31ab('0x13')][_0x31ab('0x14')]);}else{logger[_0x31ab('0x15')](_0x31ab('0xe'),_0x5a45f3,'request\x20sent');_0x2488d4(_0x2c1796['result'][_0x31ab('0x14')]);}})[_0x31ab('0x16')](function(_0x1d9a0f){logger[_0x31ab('0x13')](_0x31ab('0xe'),_0x5a45f3,_0x1d9a0f);_0x1399b0(_0x1d9a0f);});});}exports[_0x31ab('0x17')]=function(_0x561a5e){var _0x13936b=this;return new Promise(function(_0x23ea91,_0x53a57e){return db[_0x31ab('0x18')][_0x31ab('0x19')]({'raw':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1b')]||null:null,'attributes':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1c')]||null:null,'include':_0x561a5e[_0x31ab('0x1a')]?_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1d')]?_['map'](_0x561a5e[_0x31ab('0x1a')][_0x31ab('0x1d')],function(_0x26afb1){return{'model':db[_0x26afb1[_0x31ab('0x1e')]],'as':_0x26afb1['as'],'attributes':_0x26afb1[_0x31ab('0x1c')],'include':_0x26afb1[_0x31ab('0x1d')]?_['map'](_0x26afb1[_0x31ab('0x1d')],function(_0x4cf9e8){return{'model':db[_0x4cf9e8['model']],'as':_0x4cf9e8['as'],'attributes':_0x4cf9e8['attributes'],'include':_0x4cf9e8[_0x31ab('0x1d')]?_[_0x31ab('0x1f')](_0x4cf9e8[_0x31ab('0x1d')],function(_0x4583f9){return{'model':db[_0x4583f9[_0x31ab('0x1e')]],'as':_0x4583f9['as'],'attributes':_0x4583f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x31ab('0xd')](function(_0x437241){logger[_0x31ab('0x15')](_0x31ab('0x17'),_0x561a5e);logger['debug'](_0x31ab('0x17'),_0x561a5e,JSON['stringify'](_0x437241));_0x23ea91(_0x437241);})['catch'](function(_0x3135b4){logger[_0x31ab('0x13')]('ShowWhatsappAccount',_0x3135b4[_0x31ab('0x14')],_0x561a5e);_0x53a57e(_0x13936b['error'](0x1f4,_0x3135b4[_0x31ab('0x14')]));});});};
\ No newline at end of file
+var _0x7ef1=['message','WhatsappAccount,\x20%s,\x20%s','result','catch','WhatsappAccount','options','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2a1fd0,_0x523517){var _0x552080=function(_0x45824f){while(--_0x45824f){_0x2a1fd0['push'](_0x2a1fd0['shift']());}};_0x552080(++_0x523517);}(_0x7ef1,0xf6));var _0x17ef=function(_0x3c3956,_0x15d5e5){_0x3c3956=_0x3c3956-0x0;var _0x3eddf2=_0x7ef1[_0x3c3956];return _0x3eddf2;};'use strict';var _=require(_0x17ef('0x0'));var util=require(_0x17ef('0x1'));var moment=require(_0x17ef('0x2'));var BPromise=require(_0x17ef('0x3'));var rs=require(_0x17ef('0x4'));var fs=require('fs');var Redis=require(_0x17ef('0x5'));var db=require(_0x17ef('0x6'))['db'];var utils=require(_0x17ef('0x7'));var logger=require(_0x17ef('0x8'))(_0x17ef('0x9'));var config=require(_0x17ef('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x17ef('0xb')][_0x17ef('0xc')]({'port':0x232a});config[_0x17ef('0xd')]=_[_0x17ef('0xe')](config['redis'],{'host':_0x17ef('0xf'),'port':0x18eb});var socket=require(_0x17ef('0x10'))(new Redis(config['redis']));require(_0x17ef('0x11'))[_0x17ef('0x12')](socket);function respondWithRpcPromise(_0x410635,_0x12d3b5,_0x4ffac0){return new BPromise(function(_0x4f5f96,_0x170ea4){return client[_0x17ef('0x13')](_0x410635,_0x4ffac0)[_0x17ef('0x14')](function(_0x3d6b5f){logger[_0x17ef('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x12d3b5,_0x17ef('0x16'));logger[_0x17ef('0x17')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12d3b5,_0x17ef('0x16'),JSON[_0x17ef('0x18')](_0x3d6b5f));if(_0x3d6b5f[_0x17ef('0x19')]){if(_0x3d6b5f[_0x17ef('0x19')][_0x17ef('0x1a')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x12d3b5,_0x3d6b5f['error']['message']);return _0x170ea4(_0x3d6b5f[_0x17ef('0x19')][_0x17ef('0x1b')]);}logger[_0x17ef('0x19')](_0x17ef('0x1c'),_0x12d3b5,_0x3d6b5f[_0x17ef('0x19')]['message']);return _0x4f5f96(_0x3d6b5f['error'][_0x17ef('0x1b')]);}else{logger['info'](_0x17ef('0x1c'),_0x12d3b5,_0x17ef('0x16'));_0x4f5f96(_0x3d6b5f[_0x17ef('0x1d')]['message']);}})[_0x17ef('0x1e')](function(_0x316cb0){logger[_0x17ef('0x19')](_0x17ef('0x1c'),_0x12d3b5,_0x316cb0);_0x170ea4(_0x316cb0);});});}exports['ShowWhatsappAccount']=function(_0x10cad9){var _0x5dd811=this;return new Promise(function(_0x30a7a8,_0x460ecd){return db[_0x17ef('0x1f')]['find']({'raw':_0x10cad9['options']?_0x10cad9[_0x17ef('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x10cad9[_0x17ef('0x20')]?_0x10cad9['options'][_0x17ef('0x21')]||null:null,'attributes':_0x10cad9[_0x17ef('0x20')]?_0x10cad9[_0x17ef('0x20')][_0x17ef('0x22')]||null:null,'include':_0x10cad9[_0x17ef('0x20')]?_0x10cad9[_0x17ef('0x20')][_0x17ef('0x23')]?_[_0x17ef('0x24')](_0x10cad9['options'][_0x17ef('0x23')],function(_0x322b79){return{'model':db[_0x322b79[_0x17ef('0x25')]],'as':_0x322b79['as'],'attributes':_0x322b79[_0x17ef('0x22')],'include':_0x322b79[_0x17ef('0x23')]?_['map'](_0x322b79[_0x17ef('0x23')],function(_0x2ce2c8){return{'model':db[_0x2ce2c8[_0x17ef('0x25')]],'as':_0x2ce2c8['as'],'attributes':_0x2ce2c8[_0x17ef('0x22')],'include':_0x2ce2c8[_0x17ef('0x23')]?_[_0x17ef('0x24')](_0x2ce2c8[_0x17ef('0x23')],function(_0x1cc4ed){return{'model':db[_0x1cc4ed[_0x17ef('0x25')]],'as':_0x1cc4ed['as'],'attributes':_0x1cc4ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x17ef('0x14')](function(_0x1b1d0e){logger[_0x17ef('0x15')](_0x17ef('0x26'),_0x10cad9);logger[_0x17ef('0x17')](_0x17ef('0x26'),_0x10cad9,JSON['stringify'](_0x1b1d0e));_0x30a7a8(_0x1b1d0e);})[_0x17ef('0x1e')](function(_0x59d1df){logger[_0x17ef('0x19')](_0x17ef('0x26'),_0x59d1df[_0x17ef('0x1b')],_0x10cad9);_0x460ecd(_0x5dd811[_0x17ef('0x19')](0x1f4,_0x59d1df['message']));});});};
\ No newline at end of file
index 4d6558e..3448542 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf0=['length','whatsappAccount:','./whatsappAccount.events','save','emit','register'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0xbdf0,0x188));var _0x0bdf=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0xbdf0[_0x4cd4e4];return _0x18cf3b;};'use strict';var WhatsappAccountEvents=require(_0x0bdf('0x0'));var events=[_0x0bdf('0x1'),'remove','update'];function createListener(_0x3e9014,_0x44735b){return function(_0x437c83){_0x44735b[_0x0bdf('0x2')](_0x3e9014,_0x437c83);};}function removeListener(_0x3816a3,_0x356269){return function(){WhatsappAccountEvents['removeListener'](_0x3816a3,_0x356269);};}exports[_0x0bdf('0x3')]=function(_0x63f54d){for(var _0x271477=0x0,_0x438db0=events[_0x0bdf('0x4')];_0x271477<_0x438db0;_0x271477++){var _0x26843b=events[_0x271477];var _0x117184=createListener(_0x0bdf('0x5')+_0x26843b,_0x63f54d);WhatsappAccountEvents['on'](_0x26843b,_0x117184);}};
\ No newline at end of file
+var _0x9e64=['register','length','./whatsappAccount.events','save','remove','update','removeListener'];(function(_0x2720ee,_0x101bb7){var _0x428ae1=function(_0x5a3d00){while(--_0x5a3d00){_0x2720ee['push'](_0x2720ee['shift']());}};_0x428ae1(++_0x101bb7);}(_0x9e64,0x1ad));var _0x49e6=function(_0x51cb48,_0x37c777){_0x51cb48=_0x51cb48-0x0;var _0x22a14d=_0x9e64[_0x51cb48];return _0x22a14d;};'use strict';var WhatsappAccountEvents=require(_0x49e6('0x0'));var events=[_0x49e6('0x1'),_0x49e6('0x2'),_0x49e6('0x3')];function createListener(_0xcff442,_0x4adb30){return function(_0x325d84){_0x4adb30['emit'](_0xcff442,_0x325d84);};}function removeListener(_0x2a21c4,_0x2a3904){return function(){WhatsappAccountEvents[_0x49e6('0x4')](_0x2a21c4,_0x2a3904);};}exports[_0x49e6('0x5')]=function(_0x106ed5){for(var _0x3386f2=0x0,_0x377821=events[_0x49e6('0x6')];_0x3386f2<_0x377821;_0x3386f2++){var _0x343218=events[_0x3386f2];var _0x59a17d=createListener('whatsappAccount:'+_0x343218,_0x106ed5);WhatsappAccountEvents['on'](_0x343218,_0x59a17d);}};
\ No newline at end of file
index d829c9f..42ad9fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd150=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','update','destroy'];(function(_0x22e38e,_0x22b160){var _0x247042=function(_0x3451a9){while(--_0x3451a9){_0x22e38e['push'](_0x22e38e['shift']());}};_0x247042(++_0x22b160);}(_0xd150,0x1a3));var _0x0d15=function(_0x118d59,_0x3fbf95){_0x118d59=_0x118d59-0x0;var _0x5ee7e1=_0xd150[_0x118d59];return _0x5ee7e1;};'use strict';var multer=require(_0x0d15('0x0'));var util=require('util');var path=require(_0x0d15('0x1'));var timeout=require(_0x0d15('0x2'));var express=require(_0x0d15('0x3'));var router=express[_0x0d15('0x4')]();var fs_extra=require(_0x0d15('0x5'));var auth=require(_0x0d15('0x6'));var interaction=require(_0x0d15('0x7'));var config=require(_0x0d15('0x8'));var controller=require(_0x0d15('0x9'));router[_0x0d15('0xa')]('/',auth[_0x0d15('0xb')](),controller[_0x0d15('0xc')]);router['get'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0xe')]);router[_0x0d15('0xf')]('/',auth[_0x0d15('0xb')](),controller['create']);router['put'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0x10')]);router['delete'](_0x0d15('0xd'),auth[_0x0d15('0xb')](),controller[_0x0d15('0x11')]);module[_0x0d15('0x12')]=router;
\ No newline at end of file
+var _0xde29=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x552021,_0x120a9c){var _0x21b148=function(_0x4a3ba4){while(--_0x4a3ba4){_0x552021['push'](_0x552021['shift']());}};_0x21b148(++_0x120a9c);}(_0xde29,0x157));var _0x9de2=function(_0x2283e1,_0x560558){_0x2283e1=_0x2283e1-0x0;var _0x57a1ab=_0xde29[_0x2283e1];return _0x57a1ab;};'use strict';var multer=require(_0x9de2('0x0'));var util=require(_0x9de2('0x1'));var path=require(_0x9de2('0x2'));var timeout=require(_0x9de2('0x3'));var express=require(_0x9de2('0x4'));var router=express[_0x9de2('0x5')]();var fs_extra=require(_0x9de2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9de2('0x7'));var config=require(_0x9de2('0x8'));var controller=require(_0x9de2('0x9'));router[_0x9de2('0xa')]('/',auth[_0x9de2('0xb')](),controller[_0x9de2('0xc')]);router[_0x9de2('0xa')](_0x9de2('0xd'),auth[_0x9de2('0xb')](),controller[_0x9de2('0xe')]);router[_0x9de2('0xf')]('/',auth[_0x9de2('0xb')](),controller['create']);router[_0x9de2('0x10')]('/:id',auth[_0x9de2('0xb')](),controller[_0x9de2('0x11')]);router[_0x9de2('0x12')](_0x9de2('0xd'),auth[_0x9de2('0xb')](),controller[_0x9de2('0x13')]);module['exports']=router;
\ No newline at end of file
index e91b109..92e0fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x132a=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x5173d1,_0x424b63){var _0x11b350=function(_0x56c629){while(--_0x56c629){_0x5173d1['push'](_0x5173d1['shift']());}};_0x11b350(++_0x424b63);}(_0x132a,0xe7));var _0xa132=function(_0x4334ee,_0x80633){_0x4334ee=_0x4334ee-0x0;var _0x3496ec=_0x132a[_0x4334ee];return _0x3496ec;};'use strict';var Sequelize=require('sequelize');module[_0xa132('0x0')]={'priority':{'type':Sequelize[_0xa132('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa132('0x2')],'allowNull':![],'defaultValue':_0xa132('0x3')},'appdata':{'type':Sequelize[_0xa132('0x4')]()},'description':{'type':Sequelize[_0xa132('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa132('0x5')}};
\ No newline at end of file
+var _0x6e91=['TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x5f382f,_0x3f1432){var _0x3bb11b=function(_0x4daf9b){while(--_0x4daf9b){_0x5f382f['push'](_0x5f382f['shift']());}};_0x3bb11b(++_0x3f1432);}(_0x6e91,0x110));var _0x16e9=function(_0x16ca86,_0x4614f4){_0x16ca86=_0x16ca86-0x0;var _0xa8d79b=_0x6e91[_0x16ca86];return _0xa8d79b;};'use strict';var Sequelize=require(_0x16e9('0x0'));module[_0x16e9('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x16e9('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x16e9('0x3')]()},'description':{'type':Sequelize[_0x16e9('0x2')]},'interval':{'type':Sequelize[_0x16e9('0x2')],'defaultValue':_0x16e9('0x4')}};
\ No newline at end of file
index 69aa846..38ce7f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd9e=['status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','findAll','rows','catch','length','includeAll','include','find','create','body','params','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5be43e,_0x5341e1){var _0x300aef=function(_0x5ef3c6){while(--_0x5ef3c6){_0x5be43e['push'](_0x5be43e['shift']());}};_0x300aef(++_0x5341e1);}(_0xbd9e,0x108));var _0xebd9=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xbd9e[_0x4e9628];return _0x27bc8c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xebd9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebd9('0x1'));var moment=require(_0xebd9('0x2'));var BPromise=require(_0xebd9('0x3'));var Mustache=require(_0xebd9('0x4'));var util=require(_0xebd9('0x5'));var path=require('path');var sox=require(_0xebd9('0x6'));var csv=require('to-csv');var ejs=require(_0xebd9('0x7'));var fs=require('fs');var fs_extra=require(_0xebd9('0x8'));var _=require(_0xebd9('0x9'));var squel=require(_0xebd9('0xa'));var crypto=require(_0xebd9('0xb'));var jsforce=require(_0xebd9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xebd9('0xd'));var querystring=require(_0xebd9('0xe'));var Papa=require(_0xebd9('0xf'));var Redis=require(_0xebd9('0x10'));var authService=require(_0xebd9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xebd9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebd9('0x13'))('api');var utils=require(_0xebd9('0x14'));var config=require(_0xebd9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebd9('0x16'))['db'];function respondWithStatusCode(_0x11b8ed,_0x4b1c92){_0x4b1c92=_0x4b1c92||0xcc;return function(_0xd5a048){if(_0xd5a048){return _0x11b8ed[_0xebd9('0x17')](_0x4b1c92);}return _0x11b8ed[_0xebd9('0x18')](_0x4b1c92)[_0xebd9('0x19')]();};}function respondWithResult(_0x5cf3f7,_0x324363){_0x324363=_0x324363||0xc8;return function(_0xdfe08e){if(_0xdfe08e){return _0x5cf3f7[_0xebd9('0x18')](_0x324363)[_0xebd9('0x1a')](_0xdfe08e);}};}function respondWithFilteredResult(_0x1f5dd1,_0x237d00){return function(_0x29fde8){if(_0x29fde8){var _0x35095e=typeof _0x237d00[_0xebd9('0x1b')]===_0xebd9('0x1c')&&typeof _0x237d00[_0xebd9('0x1d')]===_0xebd9('0x1c');var _0x296341=_0x29fde8[_0xebd9('0x1e')];var _0x4d04cb=_0x35095e?0x0:_0x237d00[_0xebd9('0x1b')];var _0x8310f2=_0x35095e?_0x29fde8[_0xebd9('0x1e')]:_0x237d00['offset']+_0x237d00[_0xebd9('0x1d')];var _0x58086a;if(_0x8310f2>=_0x296341){_0x8310f2=_0x296341;_0x58086a=0xc8;}else{_0x58086a=0xce;}_0x1f5dd1[_0xebd9('0x18')](_0x58086a);return _0x1f5dd1[_0xebd9('0x1f')]('Content-Range',_0x4d04cb+'-'+_0x8310f2+'/'+_0x296341)['json'](_0x29fde8);}return null;};}function patchUpdates(_0x5701cd){return function(_0x23b478){try{jsonpatch[_0xebd9('0x20')](_0x23b478,_0x5701cd,!![]);}catch(_0x36bc37){return BPromise['reject'](_0x36bc37);}return _0x23b478[_0xebd9('0x21')]();};}function saveUpdates(_0x44fa41,_0x3fb488){return function(_0x2c17c8){if(_0x2c17c8){return _0x2c17c8[_0xebd9('0x22')](_0x44fa41)[_0xebd9('0x23')](function(_0x5ec121){return _0x5ec121;});}return null;};}function removeEntity(_0x1a3895,_0x259d17){return function(_0x588091){if(_0x588091){return _0x588091['destroy']()[_0xebd9('0x23')](function(){_0x1a3895[_0xebd9('0x18')](0xcc)[_0xebd9('0x19')]();});}};}function handleEntityNotFound(_0x1f2bbb,_0x4b54d7){return function(_0x1ac789){if(!_0x1ac789){_0x1f2bbb[_0xebd9('0x17')](0x194);}return _0x1ac789;};}function handleError(_0x2ef023,_0x1d2330){_0x1d2330=_0x1d2330||0x1f4;return function(_0x5548ae){logger[_0xebd9('0x24')](_0x5548ae['stack']);if(_0x5548ae['name']){delete _0x5548ae[_0xebd9('0x25')];}_0x2ef023[_0xebd9('0x18')](_0x1d2330)[_0xebd9('0x26')](_0x5548ae);};}exports[_0xebd9('0x27')]=function(_0x472601,_0x576834){var _0x5310a8={},_0x4e12bf={},_0x222d94={'count':0x0,'rows':[]};var _0x278edb=_[_0xebd9('0x28')](db[_0xebd9('0x29')][_0xebd9('0x2a')],function(_0xf17a69){return{'name':_0xf17a69[_0xebd9('0x2b')],'type':_0xf17a69[_0xebd9('0x2c')][_0xebd9('0x2d')]};});_0x4e12bf[_0xebd9('0x2e')]=_[_0xebd9('0x28')](_0x278edb,_0xebd9('0x25'));_0x4e12bf['query']=_[_0xebd9('0x2f')](_0x472601['query']);_0x4e12bf[_0xebd9('0x30')]=_[_0xebd9('0x31')](_0x4e12bf['model'],_0x4e12bf['query']);_0x5310a8[_0xebd9('0x32')]=_[_0xebd9('0x31')](_0x4e12bf[_0xebd9('0x2e')],qs[_0xebd9('0x33')](_0x472601[_0xebd9('0x34')][_0xebd9('0x33')]));_0x5310a8[_0xebd9('0x32')]=_0x5310a8[_0xebd9('0x32')]['length']?_0x5310a8[_0xebd9('0x32')]:_0x4e12bf[_0xebd9('0x2e')];if(!_0x472601[_0xebd9('0x34')][_0xebd9('0x35')](_0xebd9('0x36'))){_0x5310a8[_0xebd9('0x1d')]=qs[_0xebd9('0x1d')](_0x472601[_0xebd9('0x34')][_0xebd9('0x1d')]);_0x5310a8['offset']=qs[_0xebd9('0x1b')](_0x472601['query'][_0xebd9('0x1b')]);}_0x5310a8[_0xebd9('0x37')]=qs[_0xebd9('0x38')](_0x472601[_0xebd9('0x34')]['sort']);_0x5310a8[_0xebd9('0x39')]=qs[_0xebd9('0x30')](_['pick'](_0x472601[_0xebd9('0x34')],_0x4e12bf[_0xebd9('0x30')]),_0x278edb);if(_0x472601[_0xebd9('0x34')]['filter']){_0x5310a8[_0xebd9('0x39')]=_['merge'](_0x5310a8[_0xebd9('0x39')],{'$or':_[_0xebd9('0x28')](_0x278edb,function(_0x4f0eb0){if(_0x4f0eb0[_0xebd9('0x2c')]!==_0xebd9('0x3a')){var _0x115e7c={};_0x115e7c[_0x4f0eb0['name']]={'$like':'%'+_0x472601[_0xebd9('0x34')]['filter']+'%'};return _0x115e7c;}})});}_0x5310a8=_[_0xebd9('0x3b')]({},_0x5310a8,_0x472601[_0xebd9('0x3c')]);var _0x2c4f60={'where':_0x5310a8[_0xebd9('0x39')]};return db[_0xebd9('0x29')][_0xebd9('0x1e')](_0x2c4f60)[_0xebd9('0x23')](function(_0x57d0a0){_0x222d94[_0xebd9('0x1e')]=_0x57d0a0;if(_0x472601[_0xebd9('0x34')]['includeAll']){_0x5310a8['include']=[{'all':!![]}];}return db['WhatsappApplication'][_0xebd9('0x3d')](_0x5310a8);})[_0xebd9('0x23')](function(_0x1be720){_0x222d94[_0xebd9('0x3e')]=_0x1be720;return _0x222d94;})[_0xebd9('0x23')](respondWithFilteredResult(_0x576834,_0x5310a8))[_0xebd9('0x3f')](handleError(_0x576834,null));};exports['show']=function(_0x3f9f3d,_0x56ba3b){var _0x33ef42={'raw':!![],'where':{'id':_0x3f9f3d['params']['id']}},_0x1f0fcc={};_0x1f0fcc['model']=_['keys'](db[_0xebd9('0x29')][_0xebd9('0x2a')]);_0x1f0fcc[_0xebd9('0x34')]=_[_0xebd9('0x2f')](_0x3f9f3d[_0xebd9('0x34')]);_0x1f0fcc[_0xebd9('0x30')]=_[_0xebd9('0x31')](_0x1f0fcc[_0xebd9('0x2e')],_0x1f0fcc['query']);_0x33ef42[_0xebd9('0x32')]=_['intersection'](_0x1f0fcc[_0xebd9('0x2e')],qs[_0xebd9('0x33')](_0x3f9f3d[_0xebd9('0x34')]['fields']));_0x33ef42[_0xebd9('0x32')]=_0x33ef42[_0xebd9('0x32')][_0xebd9('0x40')]?_0x33ef42['attributes']:_0x1f0fcc[_0xebd9('0x2e')];if(_0x3f9f3d[_0xebd9('0x34')][_0xebd9('0x41')]){_0x33ef42[_0xebd9('0x42')]=[{'all':!![]}];}_0x33ef42=_[_0xebd9('0x3b')]({},_0x33ef42,_0x3f9f3d[_0xebd9('0x3c')]);return db[_0xebd9('0x29')][_0xebd9('0x43')](_0x33ef42)['then'](handleEntityNotFound(_0x56ba3b,null))[_0xebd9('0x23')](respondWithResult(_0x56ba3b,null))['catch'](handleError(_0x56ba3b,null));};exports[_0xebd9('0x44')]=function(_0x4bcc0d,_0xdcae7c){return db[_0xebd9('0x29')][_0xebd9('0x44')](_0x4bcc0d[_0xebd9('0x45')],{})[_0xebd9('0x23')](respondWithResult(_0xdcae7c,0xc9))[_0xebd9('0x3f')](handleError(_0xdcae7c,null));};exports['update']=function(_0x1d2fed,_0x59df76){if(_0x1d2fed[_0xebd9('0x45')]['id']){delete _0x1d2fed[_0xebd9('0x45')]['id'];}return db[_0xebd9('0x29')][_0xebd9('0x43')]({'where':{'id':_0x1d2fed[_0xebd9('0x46')]['id']}})[_0xebd9('0x23')](handleEntityNotFound(_0x59df76,null))[_0xebd9('0x23')](saveUpdates(_0x1d2fed[_0xebd9('0x45')],null))[_0xebd9('0x23')](respondWithResult(_0x59df76,null))[_0xebd9('0x3f')](handleError(_0x59df76,null));};exports[_0xebd9('0x47')]=function(_0x13ade2,_0xe6821f){return db[_0xebd9('0x29')]['find']({'where':{'id':_0x13ade2['params']['id']}})[_0xebd9('0x23')](handleEntityNotFound(_0xe6821f,null))['then'](removeEntity(_0xe6821f,null))[_0xebd9('0x3f')](handleError(_0xe6821f,null));};
\ No newline at end of file
+var _0x50a5=['sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xa63b19,_0x42c68f){var _0x25afb3=function(_0x166e09){while(--_0x166e09){_0xa63b19['push'](_0xa63b19['shift']());}};_0x25afb3(++_0x42c68f);}(_0x50a5,0xd1));var _0x550a=function(_0x5adca9,_0x51d815){_0x5adca9=_0x5adca9-0x0;var _0x53baf5=_0x50a5[_0x5adca9];return _0x53baf5;};'use strict';var emlformat=require(_0x550a('0x0'));var rimraf=require(_0x550a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x550a('0x2'));var Mustache=require('mustache');var util=require(_0x550a('0x3'));var path=require(_0x550a('0x4'));var sox=require(_0x550a('0x5'));var csv=require(_0x550a('0x6'));var ejs=require(_0x550a('0x7'));var fs=require('fs');var fs_extra=require(_0x550a('0x8'));var _=require(_0x550a('0x9'));var squel=require(_0x550a('0xa'));var crypto=require(_0x550a('0xb'));var jsforce=require(_0x550a('0xc'));var deskjs=require(_0x550a('0xd'));var toCsv=require(_0x550a('0x6'));var querystring=require(_0x550a('0xe'));var Papa=require('papaparse');var Redis=require(_0x550a('0xf'));var authService=require(_0x550a('0x10'));var qs=require(_0x550a('0x11'));var as=require(_0x550a('0x12'));var hardwareService=require(_0x550a('0x13'));var logger=require(_0x550a('0x14'))('api');var utils=require(_0x550a('0x15'));var config=require(_0x550a('0x16'));var licenseUtil=require(_0x550a('0x17'));var db=require(_0x550a('0x18'))['db'];function respondWithStatusCode(_0x2fb177,_0x38b9fe){_0x38b9fe=_0x38b9fe||0xcc;return function(_0x1fea00){if(_0x1fea00){return _0x2fb177[_0x550a('0x19')](_0x38b9fe);}return _0x2fb177['status'](_0x38b9fe)[_0x550a('0x1a')]();};}function respondWithResult(_0x4d22ea,_0x535eab){_0x535eab=_0x535eab||0xc8;return function(_0x1c602a){if(_0x1c602a){return _0x4d22ea[_0x550a('0x1b')](_0x535eab)['json'](_0x1c602a);}};}function respondWithFilteredResult(_0x23d2db,_0x4d1cb8){return function(_0x388aaa){if(_0x388aaa){var _0x4fa030=typeof _0x4d1cb8[_0x550a('0x1c')]===_0x550a('0x1d')&&typeof _0x4d1cb8[_0x550a('0x1e')]===_0x550a('0x1d');var _0x179ae5=_0x388aaa[_0x550a('0x1f')];var _0x5d4f5d=_0x4fa030?0x0:_0x4d1cb8[_0x550a('0x1c')];var _0x5d8f86=_0x4fa030?_0x388aaa[_0x550a('0x1f')]:_0x4d1cb8[_0x550a('0x1c')]+_0x4d1cb8[_0x550a('0x1e')];var _0x31c19b;if(_0x5d8f86>=_0x179ae5){_0x5d8f86=_0x179ae5;_0x31c19b=0xc8;}else{_0x31c19b=0xce;}_0x23d2db[_0x550a('0x1b')](_0x31c19b);return _0x23d2db['set'](_0x550a('0x20'),_0x5d4f5d+'-'+_0x5d8f86+'/'+_0x179ae5)[_0x550a('0x21')](_0x388aaa);}return null;};}function patchUpdates(_0x252242){return function(_0x1556c3){try{jsonpatch[_0x550a('0x22')](_0x1556c3,_0x252242,!![]);}catch(_0x4bb936){return BPromise[_0x550a('0x23')](_0x4bb936);}return _0x1556c3[_0x550a('0x24')]();};}function saveUpdates(_0x3d1c2d,_0x1fcf3b){return function(_0x4c550d){if(_0x4c550d){return _0x4c550d[_0x550a('0x25')](_0x3d1c2d)[_0x550a('0x26')](function(_0xc48d09){return _0xc48d09;});}return null;};}function removeEntity(_0x512517,_0x2d03e5){return function(_0x18aa4b){if(_0x18aa4b){return _0x18aa4b['destroy']()[_0x550a('0x26')](function(){_0x512517['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x132679,_0x55ae44){return function(_0x231470){if(!_0x231470){_0x132679['sendStatus'](0x194);}return _0x231470;};}function handleError(_0x4893ec,_0x2d4565){_0x2d4565=_0x2d4565||0x1f4;return function(_0x19b2cf){logger[_0x550a('0x27')](_0x19b2cf[_0x550a('0x28')]);if(_0x19b2cf[_0x550a('0x29')]){delete _0x19b2cf[_0x550a('0x29')];}_0x4893ec[_0x550a('0x1b')](_0x2d4565)[_0x550a('0x2a')](_0x19b2cf);};}exports['index']=function(_0x51b453,_0x26d08d){var _0x1d0a05={},_0x2326ef={},_0x56273d={'count':0x0,'rows':[]};var _0xc1cf31=_['map'](db[_0x550a('0x2b')][_0x550a('0x2c')],function(_0x369905){return{'name':_0x369905[_0x550a('0x2d')],'type':_0x369905[_0x550a('0x2e')][_0x550a('0x2f')]};});_0x2326ef[_0x550a('0x30')]=_[_0x550a('0x31')](_0xc1cf31,_0x550a('0x29'));_0x2326ef[_0x550a('0x32')]=_[_0x550a('0x33')](_0x51b453['query']);_0x2326ef[_0x550a('0x34')]=_[_0x550a('0x35')](_0x2326ef['model'],_0x2326ef[_0x550a('0x32')]);_0x1d0a05[_0x550a('0x36')]=_['intersection'](_0x2326ef[_0x550a('0x30')],qs['fields'](_0x51b453[_0x550a('0x32')][_0x550a('0x37')]));_0x1d0a05[_0x550a('0x36')]=_0x1d0a05['attributes'][_0x550a('0x38')]?_0x1d0a05['attributes']:_0x2326ef[_0x550a('0x30')];if(!_0x51b453[_0x550a('0x32')][_0x550a('0x39')](_0x550a('0x3a'))){_0x1d0a05[_0x550a('0x1e')]=qs[_0x550a('0x1e')](_0x51b453[_0x550a('0x32')][_0x550a('0x1e')]);_0x1d0a05[_0x550a('0x1c')]=qs[_0x550a('0x1c')](_0x51b453[_0x550a('0x32')][_0x550a('0x1c')]);}_0x1d0a05[_0x550a('0x3b')]=qs[_0x550a('0x3c')](_0x51b453['query'][_0x550a('0x3c')]);_0x1d0a05['where']=qs[_0x550a('0x34')](_[_0x550a('0x3d')](_0x51b453[_0x550a('0x32')],_0x2326ef['filters']),_0xc1cf31);if(_0x51b453['query']['filter']){_0x1d0a05[_0x550a('0x3e')]=_['merge'](_0x1d0a05[_0x550a('0x3e')],{'$or':_[_0x550a('0x31')](_0xc1cf31,function(_0x447508){if(_0x447508['type']!==_0x550a('0x3f')){var _0x2fc459={};_0x2fc459[_0x447508[_0x550a('0x29')]]={'$like':'%'+_0x51b453[_0x550a('0x32')][_0x550a('0x40')]+'%'};return _0x2fc459;}})});}_0x1d0a05=_[_0x550a('0x41')]({},_0x1d0a05,_0x51b453[_0x550a('0x42')]);var _0x4fa71f={'where':_0x1d0a05[_0x550a('0x3e')]};return db['WhatsappApplication']['count'](_0x4fa71f)[_0x550a('0x26')](function(_0x57a521){_0x56273d[_0x550a('0x1f')]=_0x57a521;if(_0x51b453['query']['includeAll']){_0x1d0a05[_0x550a('0x43')]=[{'all':!![]}];}return db[_0x550a('0x2b')][_0x550a('0x44')](_0x1d0a05);})[_0x550a('0x26')](function(_0x44ee5f){_0x56273d[_0x550a('0x45')]=_0x44ee5f;return _0x56273d;})[_0x550a('0x26')](respondWithFilteredResult(_0x26d08d,_0x1d0a05))[_0x550a('0x46')](handleError(_0x26d08d,null));};exports[_0x550a('0x47')]=function(_0x11b3e7,_0x54f8b8){var _0x4aacb4={'raw':!![],'where':{'id':_0x11b3e7[_0x550a('0x48')]['id']}},_0x37dc74={};_0x37dc74['model']=_[_0x550a('0x33')](db[_0x550a('0x2b')][_0x550a('0x2c')]);_0x37dc74[_0x550a('0x32')]=_[_0x550a('0x33')](_0x11b3e7[_0x550a('0x32')]);_0x37dc74[_0x550a('0x34')]=_[_0x550a('0x35')](_0x37dc74['model'],_0x37dc74['query']);_0x4aacb4[_0x550a('0x36')]=_['intersection'](_0x37dc74[_0x550a('0x30')],qs[_0x550a('0x37')](_0x11b3e7['query'][_0x550a('0x37')]));_0x4aacb4['attributes']=_0x4aacb4[_0x550a('0x36')][_0x550a('0x38')]?_0x4aacb4['attributes']:_0x37dc74[_0x550a('0x30')];if(_0x11b3e7[_0x550a('0x32')][_0x550a('0x49')]){_0x4aacb4['include']=[{'all':!![]}];}_0x4aacb4=_[_0x550a('0x41')]({},_0x4aacb4,_0x11b3e7[_0x550a('0x42')]);return db[_0x550a('0x2b')][_0x550a('0x4a')](_0x4aacb4)['then'](handleEntityNotFound(_0x54f8b8,null))[_0x550a('0x26')](respondWithResult(_0x54f8b8,null))[_0x550a('0x46')](handleError(_0x54f8b8,null));};exports[_0x550a('0x4b')]=function(_0x567373,_0x3f852b){return db['WhatsappApplication']['create'](_0x567373['body'],{})[_0x550a('0x26')](respondWithResult(_0x3f852b,0xc9))[_0x550a('0x46')](handleError(_0x3f852b,null));};exports[_0x550a('0x25')]=function(_0x3183fe,_0x12763f){if(_0x3183fe[_0x550a('0x4c')]['id']){delete _0x3183fe['body']['id'];}return db[_0x550a('0x2b')][_0x550a('0x4a')]({'where':{'id':_0x3183fe['params']['id']}})[_0x550a('0x26')](handleEntityNotFound(_0x12763f,null))['then'](saveUpdates(_0x3183fe[_0x550a('0x4c')],null))[_0x550a('0x26')](respondWithResult(_0x12763f,null))[_0x550a('0x46')](handleError(_0x12763f,null));};exports[_0x550a('0x4d')]=function(_0x15d32c,_0x1f7211){return db[_0x550a('0x2b')]['find']({'where':{'id':_0x15d32c[_0x550a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f7211,null))[_0x550a('0x26')](removeEntity(_0x1f7211,null))['catch'](handleError(_0x1f7211,null));};
\ No newline at end of file
index 1929878..7ce7978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff1=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications'];(function(_0x3a03be,_0x597b9a){var _0xd572b8=function(_0xdd1ff9){while(--_0xdd1ff9){_0x3a03be['push'](_0x3a03be['shift']());}};_0xd572b8(++_0x597b9a);}(_0x6ff1,0x10a));var _0x16ff=function(_0xf696b4,_0x531efb){_0xf696b4=_0xf696b4-0x0;var _0x1bb8bb=_0x6ff1[_0xf696b4];return _0x1bb8bb;};'use strict';var _=require(_0x16ff('0x0'));var util=require(_0x16ff('0x1'));var logger=require(_0x16ff('0x2'))(_0x16ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x16ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16ff('0x5'));var config=require(_0x16ff('0x6'));var attributes=require(_0x16ff('0x7'));module[_0x16ff('0x8')]=function(_0x5325dd,_0x4f3752){return _0x5325dd['define']('WhatsappApplication',attributes,{'tableName':_0x16ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x16ff('0xa'),'collate':_0x16ff('0xb')});};
\ No newline at end of file
+var _0xeb5d=['../../config/logger','api','moment','path','rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x242487,_0x41cbe7){var _0x288378=function(_0x5255c4){while(--_0x5255c4){_0x242487['push'](_0x242487['shift']());}};_0x288378(++_0x41cbe7);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xeb5d[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var logger=require(_0xdeb5('0x1'))(_0xdeb5('0x2'));var moment=require(_0xdeb5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdeb5('0x4'));var rimraf=require(_0xdeb5('0x5'));var config=require('../../config/environment');var attributes=require(_0xdeb5('0x6'));module[_0xdeb5('0x7')]=function(_0x164ecb,_0x33af72){return _0x164ecb[_0xdeb5('0x8')](_0xdeb5('0x9'),attributes,{'tableName':_0xdeb5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb5('0xb'),'collate':_0xdeb5('0xc')});};
\ No newline at end of file
index 1ff471b..2ec8f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2a27de,_0x4aaa18){var _0x4335d=function(_0xc8eb38){while(--_0xc8eb38){_0x2a27de['push'](_0x2a27de['shift']());}};_0x4335d(++_0x4aaa18);}(_0x2d17,0x17e));var _0x72d1=function(_0x900b20,_0x16116c){_0x900b20=_0x900b20-0x0;var _0x2a4b54=_0x2d17[_0x900b20];return _0x2a4b54;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});}
\ No newline at end of file
+var _0xbd50=['WhatsappApplication,\x20%s,\x20%s','request\x20sent','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd50,0x196));var _0x0bd5=function(_0x1d5e43,_0xcddb52){_0x1d5e43=_0x1d5e43-0x0;var _0x4ebb66=_0xbd50[_0x1d5e43];return _0x4ebb66;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}
\ No newline at end of file
index 2787092..d7cd104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4074=['destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0x928d7d,_0x27b172){var _0xb1d98=function(_0x383abb){while(--_0x383abb){_0x928d7d['push'](_0x928d7d['shift']());}};_0xb1d98(++_0x27b172);}(_0x4074,0xf0));var _0x4407=function(_0x1bec4a,_0x565187){_0x1bec4a=_0x1bec4a-0x0;var _0x570270=_0x4074[_0x1bec4a];return _0x570270;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require('connect-timeout');var express=require(_0x4407('0x3'));var router=express[_0x4407('0x4')]();var fs_extra=require(_0x4407('0x5'));var auth=require(_0x4407('0x6'));var interaction=require(_0x4407('0x7'));var config=require(_0x4407('0x8'));var controller=require(_0x4407('0x9'));router[_0x4407('0xa')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router['get'](_0x4407('0xd'),auth['isAuthenticated'](),controller[_0x4407('0xe')]);router[_0x4407('0xa')](_0x4407('0xf'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4407('0x10'),auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);router[_0x4407('0xa')](_0x4407('0x12'),auth[_0x4407('0xb')](),controller[_0x4407('0x13')]);router[_0x4407('0x14')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0x15')]);router[_0x4407('0x14')]('/:id/messages',auth[_0x4407('0xb')](),controller[_0x4407('0x16')]);router['post'](_0x4407('0x17'),auth['isAuthenticated'](),interaction[_0x4407('0x18')](_0x4407('0x19'),_0x4407('0x1a')),controller[_0x4407('0x1b')]);router[_0x4407('0x1c')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction[_0x4407('0x18')]('whatsapp',_0x4407('0x1d')),controller[_0x4407('0x1e')]);router[_0x4407('0x1f')](_0x4407('0xf'),auth[_0x4407('0xb')](),interaction['tracked'](_0x4407('0x19'),'whatsappinteraction:destroy'),controller[_0x4407('0x20')]);router[_0x4407('0x1f')](_0x4407('0x17'),auth[_0x4407('0xb')](),controller[_0x4407('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0x0309=['whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','index','get','isAuthenticated','/:id','/:id/messages','/:id/download','download','post','create','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete'];(function(_0x5c089c,_0x2817cc){var _0x32bd34=function(_0x59dc67){while(--_0x59dc67){_0x5c089c['push'](_0x5c089c['shift']());}};_0x32bd34(++_0x2817cc);}(_0x0309,0x165));var _0x9030=function(_0x5bfef9,_0x26cdc6){_0x5bfef9=_0x5bfef9-0x0;var _0x4e2264=_0x0309[_0x5bfef9];return _0x4e2264;};'use strict';var multer=require(_0x9030('0x0'));var util=require('util');var path=require(_0x9030('0x1'));var timeout=require('connect-timeout');var express=require(_0x9030('0x2'));var router=express[_0x9030('0x3')]();var fs_extra=require(_0x9030('0x4'));var auth=require(_0x9030('0x5'));var interaction=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var controller=require(_0x9030('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9030('0x9')]);router[_0x9030('0xa')]('/describe',auth[_0x9030('0xb')](),controller['describe']);router[_0x9030('0xa')](_0x9030('0xc'),auth[_0x9030('0xb')](),controller['show']);router[_0x9030('0xa')](_0x9030('0xd'),auth[_0x9030('0xb')](),controller['getMessages']);router[_0x9030('0xa')](_0x9030('0xe'),auth[_0x9030('0xb')](),controller[_0x9030('0xf')]);router[_0x9030('0x10')]('/',auth[_0x9030('0xb')](),controller[_0x9030('0x11')]);router['post'](_0x9030('0xd'),auth[_0x9030('0xb')](),controller[_0x9030('0x12')]);router[_0x9030('0x10')]('/:id/tags',auth[_0x9030('0xb')](),interaction[_0x9030('0x13')](_0x9030('0x14'),_0x9030('0x15')),controller[_0x9030('0x16')]);router[_0x9030('0x17')](_0x9030('0xc'),auth[_0x9030('0xb')](),interaction[_0x9030('0x13')]('whatsapp',_0x9030('0x18')),controller[_0x9030('0x19')]);router[_0x9030('0x1a')](_0x9030('0xc'),auth[_0x9030('0xb')](),interaction[_0x9030('0x13')](_0x9030('0x14'),_0x9030('0x1b')),controller[_0x9030('0x1c')]);router[_0x9030('0x1a')](_0x9030('0x1d'),auth[_0x9030('0xb')](),controller[_0x9030('0x1e')]);module[_0x9030('0x1f')]=router;
\ No newline at end of file
index 1eb30e0..92b28d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0960=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x8e6083,_0x10131e){var _0x434191=function(_0x9436fd){while(--_0x9436fd){_0x8e6083['push'](_0x8e6083['shift']());}};_0x434191(++_0x10131e);}(_0x0960,0xc2));var _0x0096=function(_0x4976de,_0xc4566b){_0x4976de=_0x4976de-0x0;var _0x4422c4=_0x0960[_0x4976de];return _0x4422c4;};'use strict';var Sequelize=require(_0x0096('0x0'));var moment=require(_0x0096('0x1'));module['exports']={'closed':{'type':Sequelize[_0x0096('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0096('0x3')]},'disposition':{'type':Sequelize[_0x0096('0x4')]},'secondDisposition':{'type':Sequelize[_0x0096('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0096('0x4')]},'note':{'type':Sequelize[_0x0096('0x4')]},'phone':{'type':Sequelize[_0x0096('0x4')]},'read1stAt':{'type':Sequelize[_0x0096('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0096('0x5')]('in',_0x0096('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0096('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0096('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5fd1=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x2691d8,_0x1e1cb0){var _0x2ca910=function(_0x2e589e){while(--_0x2e589e){_0x2691d8['push'](_0x2691d8['shift']());}};_0x2ca910(++_0x1e1cb0);}(_0x5fd1,0x155));var _0x15fd=function(_0xf63d4e,_0xbc63d6){_0xf63d4e=_0xf63d4e-0x0;var _0x4aa0d3=_0x5fd1[_0xf63d4e];return _0x4aa0d3;};'use strict';var Sequelize=require(_0x15fd('0x0'));var moment=require('moment');module[_0x15fd('0x1')]={'closed':{'type':Sequelize[_0x15fd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x15fd('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x15fd('0x4')]},'note':{'type':Sequelize[_0x15fd('0x4')]},'phone':{'type':Sequelize[_0x15fd('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x15fd('0x5')]('in',_0x15fd('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x15fd('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x15fd('0x5')]('in',_0x15fd('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index dbab906..fcb26d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x548b=['replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\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.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','all','rows','show','params','includeAll','include','create','describe','WhatsappMessage','addMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','merge','options','addTags','setTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','lastName','Messages','direction','Account','Owner','get','Whatsapp','N.A.','closed','closedAt','disposition','Attachment','basename','existsSync','createReadStream','createWriteStream','out','System','secret','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','zip-dir','fast-json-patch','request-promise','moment','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','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','end','status','offset','limit','undefined','count','set','reject','update','then','destroy','sendStatus','error','name','Users','map','fullname','TagIds','Tags','forEach','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','body','some','i.WhatsappAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter'];(function(_0x592019,_0x1b695e){var _0xcb2624=function(_0x40ad26){while(--_0x40ad26){_0x592019['push'](_0x592019['shift']());}};_0xcb2624(++_0x1b695e);}(_0x548b,0x14f));var _0xb548=function(_0x539d67,_0x2e2bef){_0x539d67=_0x539d67-0x0;var _0x1b46ab=_0x548b[_0x539d67];return _0x1b46ab;};'use strict';var emlformat=require(_0xb548('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb548('0x1'));var jsonpatch=require(_0xb548('0x2'));var rp=require(_0xb548('0x3'));var moment=require(_0xb548('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb548('0x5'));var path=require(_0xb548('0x6'));var sox=require(_0xb548('0x7'));var csv=require(_0xb548('0x8'));var ejs=require(_0xb548('0x9'));var fs=require('fs');var fs_extra=require(_0xb548('0xa'));var _=require(_0xb548('0xb'));var squel=require(_0xb548('0xc'));var crypto=require(_0xb548('0xd'));var jsforce=require(_0xb548('0xe'));var deskjs=require(_0xb548('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb548('0x10'));var Papa=require(_0xb548('0x11'));var Redis=require(_0xb548('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb548('0x13'));var as=require(_0xb548('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb548('0x15'));var utils=require(_0xb548('0x16'));var config=require(_0xb548('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb548('0x18'))['db'];config[_0xb548('0x19')]=_['defaults'](config[_0xb548('0x19')],{'host':_0xb548('0x1a'),'port':0x18eb});var socket=require(_0xb548('0x1b'))(new Redis(config['redis']));require(_0xb548('0x1c'))[_0xb548('0x1d')](socket);function respondWithStatusCode(_0x26b05c,_0x16822f){_0x16822f=_0x16822f||0xcc;return function(_0x3ee052){if(_0x3ee052){return _0x26b05c['sendStatus'](_0x16822f);}return _0x26b05c['status'](_0x16822f)[_0xb548('0x1e')]();};}function respondWithResult(_0x50dc3e,_0x4e428a){_0x4e428a=_0x4e428a||0xc8;return function(_0x48c6f4){if(_0x48c6f4){return _0x50dc3e[_0xb548('0x1f')](_0x4e428a)['json'](_0x48c6f4);}};}function respondWithFilteredResult(_0x2f1449,_0x4d83eb){return function(_0x2683e9){if(_0x2683e9){var _0x29c552=typeof _0x4d83eb[_0xb548('0x20')]==='undefined'&&typeof _0x4d83eb[_0xb548('0x21')]===_0xb548('0x22');var _0x415450=_0x2683e9[_0xb548('0x23')];var _0x102953=_0x29c552?0x0:_0x4d83eb[_0xb548('0x20')];var _0x5e780e=_0x29c552?_0x2683e9[_0xb548('0x23')]:_0x4d83eb[_0xb548('0x20')]+_0x4d83eb[_0xb548('0x21')];var _0xd51e6;if(_0x5e780e>=_0x415450){_0x5e780e=_0x415450;_0xd51e6=0xc8;}else{_0xd51e6=0xce;}_0x2f1449['status'](_0xd51e6);return _0x2f1449[_0xb548('0x24')]('Content-Range',_0x102953+'-'+_0x5e780e+'/'+_0x415450)['json'](_0x2683e9);}return null;};}function patchUpdates(_0x3329ac){return function(_0x1903f0){try{jsonpatch['apply'](_0x1903f0,_0x3329ac,!![]);}catch(_0x33b780){return BPromise[_0xb548('0x25')](_0x33b780);}return _0x1903f0['save']();};}function saveUpdates(_0x21be53,_0x14f677){return function(_0x1da85f){if(_0x1da85f){return _0x1da85f[_0xb548('0x26')](_0x21be53)[_0xb548('0x27')](function(_0x12f9e0){return _0x12f9e0;});}return null;};}function removeEntity(_0x519038,_0xd6505a){return function(_0x254c58){if(_0x254c58){return _0x254c58[_0xb548('0x28')]()['then'](function(){_0x519038[_0xb548('0x1f')](0xcc)[_0xb548('0x1e')]();});}};}function handleEntityNotFound(_0x31c712,_0x58c5c8){return function(_0x45c1ca){if(!_0x45c1ca){_0x31c712[_0xb548('0x29')](0x194);}return _0x45c1ca;};}function handleError(_0x208fd7,_0x2eb53f){_0x2eb53f=_0x2eb53f||0x1f4;return function(_0x2df09e){logger[_0xb548('0x2a')](_0x2df09e['stack']);if(_0x2df09e[_0xb548('0x2b')]){delete _0x2df09e[_0xb548('0x2b')];}_0x208fd7['status'](_0x2eb53f)['send'](_0x2df09e);};}function getInteractionUsers(_0x496510,_0x13430b){return new BPromise(function(_0x571cd8,_0x2488b6){try{if(_0x13430b[_0x496510['id']]){_0x496510[_0xb548('0x2c')]=_[_0xb548('0x2d')](_0x13430b[_0x496510['id']],function(_0x3fef01){return{'id':_0x3fef01['id'],'fullname':_0x3fef01[_0xb548('0x2e')]};});}}catch(_0x46ebf4){_0x2488b6(_0x46ebf4);}_0x571cd8(_0x496510);});}function getInteractionTags(_0x322505,_0x536689){return new BPromise(function(_0x30153e,_0x281458){try{if(_0x322505[_0xb548('0x2f')]){_0x322505[_0xb548('0x30')]=[];_0x322505[_0xb548('0x2f')]['split'](',')[_0xb548('0x31')](function(_0x190ddf){_0x322505['Tags']['push'](_0x536689[_0x190ddf]);});}delete _0x322505[_0xb548('0x2f')];}catch(_0x217146){_0x281458(_0x217146);}_0x30153e(_0x322505);});}function updateWhatsappInteraction(_0x5b6126,_0x54b421,_0x254c1b){return new BPromise(function(_0x174406,_0x1c7dee){return getInteractionUsers(_0x5b6126,_0x254c1b)['then'](function(_0x777a1e){return getInteractionTags(_0x777a1e,_0x54b421);})[_0xb548('0x27')](function(_0x401ad6){_0x174406(_0x401ad6);})[_0xb548('0x32')](function(_0x5e1e25){_0x1c7dee(_0x5e1e25);});});}exports[_0xb548('0x33')]=function(_0x88a42,_0x38d4d4){var _0xc10fa1={},_0x435415={},_0x3fc1ec={'count':0x0,'rows':[]};var _0x336837=_[_0xb548('0x2d')](db[_0xb548('0x34')][_0xb548('0x35')],function(_0x22a674){return{'name':_0x22a674[_0xb548('0x36')],'type':_0x22a674[_0xb548('0x37')][_0xb548('0x38')]};});_0x435415[_0xb548('0x39')]=_['map'](_0x336837,'name');_0x435415['query']=_[_0xb548('0x3a')](_0x88a42[_0xb548('0x3b')]);_0x435415['filters']=_[_0xb548('0x3c')](_0x435415['model'],_0x435415[_0xb548('0x3b')]);_0xc10fa1[_0xb548('0x3d')]=_[_0xb548('0x3c')](_0x435415[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x88a42['query'][_0xb548('0x3e')]));_0xc10fa1[_0xb548('0x3d')]=_0xc10fa1[_0xb548('0x3d')][_0xb548('0x3f')]?_0xc10fa1['attributes']:_0x435415[_0xb548('0x39')];if(!_0x88a42[_0xb548('0x3b')][_0xb548('0x40')]('nolimit')){_0xc10fa1[_0xb548('0x21')]=qs[_0xb548('0x21')](_0x88a42[_0xb548('0x3b')][_0xb548('0x21')]);_0xc10fa1[_0xb548('0x20')]=qs['offset'](_0x88a42['query'][_0xb548('0x20')]);}_0xc10fa1[_0xb548('0x41')]=qs[_0xb548('0x42')](_0x88a42[_0xb548('0x3b')]['sort']);_0xc10fa1[_0xb548('0x43')]=qs[_0xb548('0x44')](_[_0xb548('0x45')](_0x88a42[_0xb548('0x3b')],_0x435415['filters']),_0x336837);var _0x63bd2b=[];var _0x4889ae=squel[_0xb548('0x46')]()[_0xb548('0x47')]('id')[_0xb548('0x47')]('name')[_0xb548('0x47')](_0xb548('0x48'))[_0xb548('0x49')](_0xb548('0x4a'));var _0x1effa0=squel[_0xb548('0x46')]()[_0xb548('0x47')](_0xb548('0x4b'))[_0xb548('0x47')](_0xb548('0x4c'))['field'](_0xb548('0x4d'))['from']('user_has_whatsapp_interactions','ui')[_0xb548('0x4e')](_0xb548('0x4f'),'u',_0xb548('0x50'));var _0x230795=squel[_0xb548('0x46')]()[_0xb548('0x49')]('whatsapp_interactions','i')['left_join'](_0xb548('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb548('0x4e')]('users','o',_0xb548('0x52'))[_0xb548('0x4e')]('whatsapp_accounts','a',_0xb548('0x53'))[_0xb548('0x4e')]('whatsapp_messages','me',_0xb548('0x54'))[_0xb548('0x4e')](_0xb548('0x55'),'it',_0xb548('0x56'))[_0xb548('0x4e')](_0xb548('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x16ab54=squel[_0xb548('0x57')]();var _0x3f36d8=[];var _0xd72a57=squel['expr']();var _0x4bb126;if(_0x88a42['query']['search']){_0x4bb126=as['parseSearch'](_0x88a42[_0xb548('0x3b')][_0xb548('0x58')]);var _0x5802c7=_0x4bb126[_0xb548('0x59')];for(var _0x5424f9=0x0;_0x5424f9<_0x4bb126[_0xb548('0x5a')][_0xb548('0x3f')];_0x5424f9++){var _0x11d4b7=_0x4bb126[_0xb548('0x5a')][_0x5424f9];var _0x1322bc='i';var _0x11a9e4=_[_0xb548('0x5b')](_0x336837,['name',_0x11d4b7['field']]);if(!_0x11a9e4){switch(_0x11d4b7['field']){case _0xb548('0x5c'):if(_0x11d4b7[_0xb548('0x5d')]==0x1){_0x230795[_0xb548('0x5e')]('`'+_0x11d4b7[_0xb548('0x47')]+_0xb548('0x5f'));}else{_0x230795[_0xb548('0x5e')]('`'+_0x11d4b7[_0xb548('0x47')]+_0xb548('0x60'));}break;case _0xb548('0x61'):if(_0x11d4b7[_0xb548('0x62')]===_0xb548('0x63')){if(_0x11d4b7[_0xb548('0x5d')][_0xb548('0x64')]('\x20')[_0xb548('0x3f')]>0x1){_0x16ab54[_0x5802c7](_0xb548('0x65'),qs[_0xb548('0x66')](_0x11d4b7[_0xb548('0x5d')]),null);}else{var _0x31ef37='%'+_0x11d4b7[_0xb548('0x5d')]+'%';_0x16ab54[_0x5802c7](_0xb548('0x67'),_0x31ef37,_0x31ef37,_0x31ef37);}}else{_0x11a9e4=_[_0xb548('0x5b')](_0x336837,[_0xb548('0x2b'),_0xb548('0x68')]);_0x11d4b7[_0xb548('0x47')]='ContactId';_0x3fed8b=as[_0xb548('0x69')](_0x1322bc,_0x11a9e4['type'],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b['text'],_0x3fed8b['value'][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}break;case _0xb548('0x6b'):var _0x40705c=_0x11d4b7[_0xb548('0x5d')][_0xb548('0x64')](',')['map'](function(_0x2ff049){return Number(_0x2ff049);});_0x40705c[_0xb548('0x31')](function(_0x1a6f75){_0xd72a57['or'](_0xb548('0x6c'),'%,'+_0x1a6f75+',%');});_0x3f36d8=_[_0xb548('0x6d')](_0x3f36d8,_0x40705c);break;case _0xb548('0x6e'):if(_0x11d4b7[_0xb548('0x62')]===_0xb548('0x63')){_0x16ab54[_0x5802c7]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x11d4b7[_0xb548('0x5d')]+'%',null);}else{_0x11a9e4=_[_0xb548('0x5b')](_0x336837,[_0xb548('0x2b'),_0xb548('0x6f')]);_0x11d4b7['field']=_0xb548('0x6f');_0x3fed8b=as[_0xb548('0x69')](_0x1322bc,_0x11a9e4['type'],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')]['start'],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}break;case _0xb548('0x71'):_0x3fed8b=as[_0xb548('0x69')]('me',null,_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);break;}}else{var _0x3fed8b=as['buildExpression'](_0x1322bc,_0x11a9e4[_0xb548('0x37')],_0x11d4b7);_0x16ab54[_0x5802c7](_0x3fed8b[_0xb548('0x70')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x6a')],_0x3fed8b[_0xb548('0x5d')][_0xb548('0x1e')]);}}}else{var _0x3e8dee=_(_0x88a42[_0xb548('0x3b')])['keys']()[_0xb548('0x2d')](function(_0x4d1f09){return _[_0xb548('0x72')](_0x336837,[_0xb548('0x2b'),_0x4d1f09])?_0x4d1f09:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x3e8dee)){_0x3e8dee['forEach'](function(_0x199fff){if(_0x199fff==='WhatsappAccountId'){_0x230795[_0xb548('0x43')](_0xb548('0x73'),[]['concat'](_0x88a42[_0xb548('0x3b')][_0x199fff]));}else if(_0x199fff===_0xb548('0x74')){var _0x331b6c=JSON[_0xb548('0x75')](_0x88a42['query'][_0x199fff])[_0xb548('0x76')];var _0x4c78f6=JSON[_0xb548('0x75')](_0x88a42[_0xb548('0x3b')][_0x199fff])[_0xb548('0x77')];_0x230795[_0xb548('0x43')](_0xb548('0x78'),_0x331b6c,_0x4c78f6);}else{if(_0x88a42[_0xb548('0x3b')][_0x199fff]==='null'){_0x230795[_0xb548('0x43')]('i.'+_0x199fff+_0xb548('0x79'));}else{_0x230795[_0xb548('0x43')]('i.'+_0x199fff+_0xb548('0x7a'),_0x88a42[_0xb548('0x3b')][_0x199fff]);}}});}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7b')]){if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7b')]==0x1){_0x230795[_0xb548('0x5e')](_0xb548('0x7c'));}else{_0x230795[_0xb548('0x5e')](_0xb548('0x7d'));}}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')]){_0x3f36d8=_[_0xb548('0x7f')](_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')])?_0x88a42[_0xb548('0x3b')][_0xb548('0x7e')]:new Array(_0x88a42['query'][_0xb548('0x7e')]);_0x3f36d8[_0xb548('0x31')](function(_0x52fc7c){_0xd72a57['or'](_0xb548('0x6c'),'%,'+_0x52fc7c+',%');});}if(_0x88a42[_0xb548('0x3b')][_0xb548('0x80')]){var _0x5844b0=_0x88a42[_0xb548('0x3b')][_0xb548('0x80')][_0xb548('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5844b0)){_0x16ab54['or'](_0xb548('0x82'),_0x5844b0+'%')['or'](_0xb548('0x83'),_0x5844b0+'%');}else{_0x16ab54['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb548('0x66')](_0x5844b0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5844b0+'%');}}}_0x230795[_0xb548('0x43')](_0x16ab54);_0x230795[_0xb548('0x84')](_0xb548('0x85'));var _0x1514b6={'type':db[_0xb548('0x86')][_0xb548('0x87')][_0xb548('0x88')],'raw':!![]};var _0xa95ae5=_0x230795['clone']();_0xa95ae5[_0xb548('0x47')](_0xb548('0x85'));_0xa95ae5[_0xb548('0x47')](_0xb548('0x89'),_0xb548('0x5c'));if(_0xc10fa1[_0xb548('0x41')]){_0xc10fa1['order'][_0xb548('0x31')](function(_0x507f98){var _0xb32a6e=_0x507f98[0x0]===_0xb548('0x8a')?_0x507f98[0x0]:'i.'+_0x507f98[0x0];_0x230795[_0xb548('0x41')](_0xb32a6e,_0x507f98[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb548('0x8b')](_0x3f36d8)){_0x230795['having'](_0xd72a57);_0xa95ae5[_0xb548('0x43')](_0xb548('0x8c'),_0x3f36d8);}BPromise[_0xb548('0x8d')]()[_0xb548('0x27')](function(){if(!_0x4bb126){if(_0x88a42[_0xb548('0x3b')]['WhatsappAccountId'])return;_0xa95ae5[_0xb548('0x43')](_0xb548('0x8e'));_0x230795[_0xb548('0x43')](_0xb548('0x8e'));return;}if(_0x88a42['user'][_0xb548('0x8f')]!==_0xb548('0x90'))return;return _0x88a42[_0xb548('0x91')][_0xb548('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x34d35e){if(_['isEmpty'](_0x34d35e)){_0xa95ae5[_0xb548('0x43')]('i.WhatsappAccountId\x20IS\x20NULL');_0x230795[_0xb548('0x43')](_0xb548('0x93'));}else{_0xa95ae5[_0xb548('0x43')](_0xb548('0x73'),_[_0xb548('0x2d')](_0x34d35e,'id'));_0x230795[_0xb548('0x43')](_0xb548('0x73'),_[_0xb548('0x2d')](_0x34d35e,'id'));}});})[_0xb548('0x27')](function(){if(_0x88a42[_0xb548('0x91')][_0xb548('0x8f')]===_0xb548('0x90')&&!_0x4bb126&&!_0x88a42[_0xb548('0x3b')]['WhatsappAccountId'])return[];return db[_0xb548('0x94')][_0xb548('0x3b')](_0xa95ae5[_0xb548('0x95')](),_0x1514b6);})[_0xb548('0x27')](function(_0x14b006){_0x3fc1ec[_0xb548('0x23')]=_0x14b006['length'];if(_0x3fc1ec[_0xb548('0x23')]===0x0)return[];return db[_0xb548('0x94')][_0xb548('0x3b')](_0x4889ae[_0xb548('0x95')](),_0x1514b6)[_0xb548('0x27')](function(_0x33ded4){_0x63bd2b=_[_0xb548('0x96')](_0x33ded4,'id');_0x1514b6=_['merge'](_0x1514b6,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x88a42[_0xb548('0x3b')]['fields']){_0xc10fa1[_0xb548('0x3d')][_0xb548('0x31')](function(_0x122a2e){_0x230795[_0xb548('0x47')]('i.'+_0x122a2e);});}else{_0x230795[_0xb548('0x47')](_0xb548('0x89'),'unreadMessages');_0x230795['field'](_0xb548('0x97'),_0xb548('0x98'));_0x230795[_0xb548('0x47')](_0xb548('0x99'),_0xb548('0x9a'));_0x230795[_0xb548('0x47')](_0xb548('0x9b'),'contactName');_0x230795[_0xb548('0x47')](_0xb548('0x9c'));_0x230795[_0xb548('0x47')](_0xb548('0x9d'),_0xb548('0x9e'));_0x230795[_0xb548('0x47')](_0xb548('0x9f'),_0xb548('0xa0'));_0x230795[_0xb548('0x47')](_0xb548('0xa1'),'Contact.email');_0x230795['field']('c.phone',_0xb548('0xa2'));_0x230795[_0xb548('0x47')]('c.mobile','Contact.mobile');_0x230795[_0xb548('0x47')](_0xb548('0xa3'),_0xb548('0xa4'));_0x230795[_0xb548('0x47')](_0xb548('0xa5'),_0xb548('0xa6'));_0x230795[_0xb548('0x47')](_0xb548('0xa7'),'Owner.internal');_0x230795['field'](_0xb548('0xa8'),_0xb548('0x2f'));}if(_0xc10fa1['limit'])_0x230795['limit'](_0xc10fa1[_0xb548('0x21')]);if(_0xc10fa1[_0xb548('0x20')])_0x230795[_0xb548('0x20')](_0xc10fa1['offset']);return db[_0xb548('0x94')][_0xb548('0x3b')](_0x230795[_0xb548('0x95')](),_0x1514b6);})['then'](function(_0x53ccd3){if(_0x53ccd3['length']>0x0)_0x1effa0[_0xb548('0x43')](_0xb548('0xa9'),_['map'](_0x53ccd3,'id'));return db[_0xb548('0x94')][_0xb548('0x3b')](_0x1effa0[_0xb548('0x95')](),_0x1514b6)['then'](function(_0xb0050c){var _0x162126=_[_0xb548('0xaa')](_0xb0050c,_0xb548('0xab'));var _0x50034d=[];_0x53ccd3['forEach'](function(_0x3509c7){_0x50034d[_0xb548('0xac')](updateWhatsappInteraction(_0x3509c7,_0x63bd2b,_0x162126));});return BPromise[_0xb548('0xad')](_0x50034d);});});})[_0xb548('0x27')](function(_0x1632ad){_0x3fc1ec[_0xb548('0xae')]=_0x1632ad;return _0x3fc1ec;})[_0xb548('0x27')](respondWithFilteredResult(_0x38d4d4,_0xc10fa1))[_0xb548('0x32')](handleError(_0x38d4d4,null));};exports[_0xb548('0xaf')]=function(_0x3c81eb,_0x2dd1d5){var _0x2bf79c={'raw':![],'where':{'id':_0x3c81eb[_0xb548('0xb0')]['id']}},_0x45f547={};_0x45f547['model']=_[_0xb548('0x3a')](db[_0xb548('0x34')][_0xb548('0x35')]);_0x45f547[_0xb548('0x3b')]=_[_0xb548('0x3a')](_0x3c81eb[_0xb548('0x3b')]);_0x45f547[_0xb548('0x44')]=_[_0xb548('0x3c')](_0x45f547[_0xb548('0x39')],_0x45f547['query']);_0x2bf79c['attributes']=_[_0xb548('0x3c')](_0x45f547[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x3c81eb[_0xb548('0x3b')][_0xb548('0x3e')]));_0x2bf79c[_0xb548('0x3d')]=_0x2bf79c['attributes']['length']?_0x2bf79c[_0xb548('0x3d')]:_0x45f547[_0xb548('0x39')];if(_0x3c81eb[_0xb548('0x3b')][_0xb548('0xb1')]){_0x2bf79c[_0xb548('0xb2')]=[{'all':!![]}];}_0x2bf79c=_['merge']({},_0x2bf79c,_0x3c81eb['options']);return db[_0xb548('0x34')]['find'](_0x2bf79c)['then'](handleEntityNotFound(_0x2dd1d5,null))[_0xb548('0x27')](respondWithResult(_0x2dd1d5,null))['catch'](handleError(_0x2dd1d5,null));};exports[_0xb548('0xb3')]=function(_0x519364,_0x3c4e3c){return db[_0xb548('0x34')]['create'](_0x519364['body'],{})[_0xb548('0x27')](respondWithResult(_0x3c4e3c,0xc9))['catch'](handleError(_0x3c4e3c,null));};exports[_0xb548('0x26')]=function(_0x595364,_0x242349){if(_0x595364[_0xb548('0x71')]['id']){delete _0x595364[_0xb548('0x71')]['id'];}return db[_0xb548('0x34')][_0xb548('0x5b')]({'where':{'id':_0x595364['params']['id']}})[_0xb548('0x27')](handleEntityNotFound(_0x242349,null))[_0xb548('0x27')](saveUpdates(_0x595364[_0xb548('0x71')],null))['then'](respondWithResult(_0x242349,null))[_0xb548('0x32')](handleError(_0x242349,null));};exports[_0xb548('0x28')]=function(_0x54ba13,_0x58366e){return db[_0xb548('0x34')]['find']({'where':{'id':_0x54ba13[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x58366e,null))[_0xb548('0x27')](removeEntity(_0x58366e,null))['catch'](handleError(_0x58366e,null));};exports[_0xb548('0xb4')]=function(_0x8e8cd0,_0x5e1321){return db[_0xb548('0x34')][_0xb548('0xb4')]()[_0xb548('0x27')](respondWithResult(_0x5e1321,null))[_0xb548('0x32')](handleError(_0x5e1321,null));};exports['addMessage']=function(_0x524d90,_0x5d406a,_0x204805){return db[_0xb548('0xb5')][_0xb548('0x5b')]({'where':{'id':_0x524d90[_0xb548('0xb0')]['id']}})[_0xb548('0x27')](handleEntityNotFound(_0x5d406a,null))['then'](function(_0x2f2285){if(_0x2f2285){return _0x2f2285[_0xb548('0xb6')](_0x524d90[_0xb548('0x71')][_0xb548('0xb7')],_[_0xb548('0xb8')](_0x524d90[_0xb548('0x71')],[_0xb548('0xb7'),'id'])||{});}})[_0xb548('0x27')](respondWithResult(_0x5d406a,null))[_0xb548('0x32')](handleError(_0x5d406a,null));};exports['getMessages']=function(_0x1d54c3,_0x1da0cf,_0x373ad9){var _0x437917={'raw':![],'where':{}};var _0x551ac1={};var _0x2bf77c={'count':0x0,'rows':[]};return db[_0xb548('0x34')][_0xb548('0xb9')]({'where':{'id':_0x1d54c3[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x1da0cf,null))['then'](function(_0x49360c){if(_0x49360c){_0x551ac1[_0xb548('0x39')]=_[_0xb548('0x3a')](db[_0xb548('0xb5')][_0xb548('0x35')]);_0x551ac1['query']=_[_0xb548('0x3a')](_0x1d54c3[_0xb548('0x3b')]);_0x551ac1[_0xb548('0x44')]=_[_0xb548('0x3c')](_0x551ac1['model'],_0x551ac1[_0xb548('0x3b')]);_0x437917['attributes']=_[_0xb548('0x3c')](_0x551ac1[_0xb548('0x39')],qs[_0xb548('0x3e')](_0x1d54c3[_0xb548('0x3b')]['fields']));_0x437917['attributes']=_0x437917[_0xb548('0x3d')][_0xb548('0x3f')]?_0x437917['attributes']:_0x551ac1[_0xb548('0x39')];if(!_0x1d54c3[_0xb548('0x3b')][_0xb548('0x40')](_0xb548('0xba'))){_0x437917[_0xb548('0x21')]=qs[_0xb548('0x21')](_0x1d54c3['query'][_0xb548('0x21')]);_0x437917[_0xb548('0x20')]=qs['offset'](_0x1d54c3[_0xb548('0x3b')][_0xb548('0x20')]);}_0x437917[_0xb548('0x41')]=qs[_0xb548('0x42')](_0x1d54c3['query'][_0xb548('0x42')]);_0x437917[_0xb548('0x43')]=qs[_0xb548('0x44')](_[_0xb548('0x45')](_0x1d54c3['query'],_0x551ac1[_0xb548('0x44')]));_0x437917[_0xb548('0x43')][_0xb548('0xab')]=_0x49360c['id'];if(_0x1d54c3[_0xb548('0x3b')][_0xb548('0x80')]){_0x437917['where']=_['merge'](_0x437917[_0xb548('0x43')],{'$or':_['map'](_0x437917[_0xb548('0x3d')],function(_0x2be913){var _0x48cada={};_0x48cada[_0x2be913]={'$like':'%'+_0x1d54c3['query'][_0xb548('0x80')]+'%'};return _0x48cada;})});}if(_0x1d54c3['query'][_0xb548('0x76')]){var _0x9ed3fb=_0x1d54c3[_0xb548('0x3b')][_0xb548('0x76')][_0xb548('0x64')](',');var _0xafa52d={};_0xafa52d[_0x9ed3fb[0x0]]={'$gte':moment(_0x9ed3fb[0x1])[_0xb548('0xbb')](_0xb548('0xbc'))};_0x437917[_0xb548('0x43')]=_[_0xb548('0xbd')](_0x437917[_0xb548('0x43')],_0xafa52d);}_0x437917=_[_0xb548('0xbd')]({},_0x437917,_0x1d54c3[_0xb548('0xbe')]);return db[_0xb548('0xb5')][_0xb548('0x23')]({'where':_0x437917[_0xb548('0x43')]})[_0xb548('0x27')](function(_0x5dba8e){_0x2bf77c[_0xb548('0x23')]=_0x5dba8e;if(_0x1d54c3['query'][_0xb548('0xb1')]){_0x437917[_0xb548('0xb2')]=[{'all':!![]}];}return db[_0xb548('0xb5')]['findAll'](_0x437917);})[_0xb548('0x27')](function(_0x4a42c6){_0x2bf77c[_0xb548('0xae')]=_0x4a42c6;return _0x2bf77c;});}})[_0xb548('0x27')](respondWithFilteredResult(_0x1da0cf,_0x437917))['catch'](handleError(_0x1da0cf,null));};exports[_0xb548('0xbf')]=function(_0x483412,_0x34a070,_0x668914){return db[_0xb548('0x34')]['find']({'where':{'id':_0x483412[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0x34a070,null))[_0xb548('0x27')](function(_0x3e9c68){if(_0x3e9c68){return _0x3e9c68[_0xb548('0xc0')](_0x483412[_0xb548('0x71')][_0xb548('0xb7')],_[_0xb548('0xb8')](_0x483412['body'],[_0xb548('0xb7'),'id'])||{})[_0xb548('0xc1')](function(){return db[_0xb548('0x6b')][_0xb548('0xc2')]({'attributes':['id',_0xb548('0x2b'),_0xb548('0x48')],'where':{'id':_0x483412[_0xb548('0x71')]['ids']}});})[_0xb548('0x27')](function(_0x5a27de){socket[_0xb548('0xc3')](_0xb548('0xc4'),{'id':Number(_0x483412['params']['id']),'tags':_0x5a27de||[]});return{'id':Number(_0x483412[_0xb548('0xb0')]['id']),'tags':_0x5a27de||[]};});}})[_0xb548('0x27')](respondWithResult(_0x34a070,null))[_0xb548('0x32')](handleError(_0x34a070,null));};exports['removeTags']=function(_0x8d7a11,_0xbc2e38,_0x3dc285){return db[_0xb548('0x34')]['find']({'where':{'id':_0x8d7a11[_0xb548('0xb0')]['id']}})['then'](handleEntityNotFound(_0xbc2e38,null))[_0xb548('0x27')](function(_0x5dc36d){if(_0x5dc36d){return _0x5dc36d[_0xb548('0xc5')](_0x8d7a11['query']['ids']);}})[_0xb548('0x27')](respondWithStatusCode(_0xbc2e38,null))['catch'](handleError(_0xbc2e38,null));};exports['download']=function(_0x2b13ad,_0x4811cf){var _0x496914=moment()[_0xb548('0xc6')]()[_0xb548('0x95')]();var _0x2b0873=path[_0xb548('0xc7')](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xca'),'tmp');var _0x351c63=path[_0xb548('0xc7')](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xca'),_0xb548('0xcb'));var _0x55f69b=path[_0xb548('0xc7')](_0x2b0873,_0x496914);var _0x52ac70=util[_0xb548('0xbb')](_0xb548('0xcc'),_0x2b13ad[_0xb548('0xb0')]['id'],_0x496914);var _0x550d34=path[_0xb548('0xc7')](_0x2b0873,_0x52ac70);var _0x2fabb0=[];_0x2fabb0[_0xb548('0xac')]({'model':db[_0xb548('0x6e')],'as':_0xb548('0x6e'),'attributes':['id',_0xb548('0x2e')],'raw':!![]});_0x2fabb0[_0xb548('0xac')]({'model':db[_0xb548('0xcd')],'as':_0xb548('0x61'),'attributes':['id','firstName',_0xb548('0xce')],'raw':!![]});if(_0x2b13ad[_0xb548('0x3b')]['attachments']){_0x2fabb0[_0xb548('0xac')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x9c829b=[{'model':db['WhatsappMessage'],'as':_0xb548('0xcf'),'attributes':['id','body',_0xb548('0x74'),_0xb548('0xd0'),'secret',_0xb548('0x7b')],'include':_0x2fabb0}];_0x9c829b[_0xb548('0xac')]({'model':db['WhatsappAccount'],'as':_0xb548('0xd1'),'attributes':['id','name']});_0x9c829b['push']({'model':db[_0xb548('0x6e')],'as':_0xb548('0xd2'),'attributes':['id',_0xb548('0x2e')]});return db[_0xb548('0x34')][_0xb548('0x5b')]({'where':{'id':_0x2b13ad[_0xb548('0xb0')]['id']},'include':_0x9c829b})['then'](handleEntityNotFound(_0x4811cf,null))[_0xb548('0x27')](function(_0x4e4693){if(_0x4e4693){var _0x361f8e=_0x4e4693[_0xb548('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x55f69b);var _0x15263c={'channel':_0xb548('0xd4'),'account':_0x361f8e['Account'][_0xb548('0x2b')],'agent':_0x361f8e[_0xb548('0xd2')]?_0x361f8e[_0xb548('0xd2')][_0xb548('0x2e')]:_0xb548('0xd5'),'createdAt':moment(_0x361f8e[_0xb548('0x74')])[_0xb548('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x361f8e[_0xb548('0xd6')]?moment(_0x361f8e[_0xb548('0xd7')])[_0xb548('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x361f8e[_0xb548('0xd8')],'messages':_(_0x361f8e[_0xb548('0xcf')])[_0xb548('0x80')]({'secret':![]})['map'](function(_0x210b6e){if(_0x210b6e['Attachment']){var _0x59c2b3=path[_0xb548('0xc7')](_0x351c63,_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')]);if(fs[_0xb548('0xdb')](_0x59c2b3)){fs[_0xb548('0xdc')](_0x59c2b3)['pipe'](fs[_0xb548('0xdd')](path[_0xb548('0xc7')](_0x55f69b,_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')])));}}return{'date':moment(_0x210b6e['createdAt'])['format'](_0xb548('0xbc'))[_0xb548('0x95')](),'sender':_0x210b6e[_0xb548('0xd0')]===_0xb548('0xde')?_0x210b6e[_0xb548('0x6e')]?_0x210b6e['User'][_0xb548('0x2e')]:_0xb548('0xdf'):_0x210b6e[_0xb548('0x61')]['firstName']+(_0x210b6e['Contact'][_0xb548('0xce')]?'\x20'+_0x210b6e[_0xb548('0x61')][_0xb548('0xce')]:''),'body':_0x210b6e[_0xb548('0xd9')]?_0x210b6e[_0xb548('0xd9')][_0xb548('0xda')]:_0x210b6e[_0xb548('0x71')],'direction':_0x210b6e[_0xb548('0xd0')]===_0xb548('0xde')?'A':'C','secret':_0x210b6e[_0xb548('0xe0')],'read':_0x210b6e['read'],'attachment':_0x210b6e[_0xb548('0xd9')]};})[_0xb548('0x5d')]()};return ejs[_0xb548('0xe1')](path['join'](config[_0xb548('0xc8')],_0xb548('0xc9'),_0xb548('0xe2'),_0xb548('0xe3')),{'interaction':_0x15263c})[_0xb548('0x27')](function(_0x58bec7){var _0x5ef924=path[_0xb548('0xc7')](_0x55f69b,_0xb548('0xe4')+_0x361f8e['id']+'-'+_0x496914+_0xb548('0xe5'));var _0x2e3a55={'path':_0x5ef924,'channel':_0xb548('0xd4'),'interactionId':_0x361f8e['id']};return pdf[_0xb548('0xe6')](_0x58bec7,_0x2e3a55);})[_0xb548('0x27')](function(){return new BPromise(function(_0x2efad4,_0x251ddb){zipdir(_0x55f69b,{'saveTo':_0x550d34},function(_0x14c288,_0x28e2fc){if(_0x14c288)return _0x251ddb(_0x14c288);return _0x2efad4(_0x28e2fc);});})[_0xb548('0x27')](function(){return new BPromise(function(_0x1c2658,_0x1dde58){rimraf(_0x55f69b,function(_0x5592aa){if(_0x5592aa)_0x1dde58(_0x5592aa);return _0x1c2658();});});})[_0xb548('0x27')](function(){return _0x4811cf['download'](_0x550d34,_0x52ac70,function(_0x19a3a0){if(_0x19a3a0){console[_0xb548('0xe7')]('err',_0x19a3a0);}else{fs['unlinkSync'](_0x550d34);}});});});}else{return _0x4811cf['sendStatus'](0xc8);}})['catch'](handleError(_0x4811cf,null));};
\ No newline at end of file
+var _0x84e1=['basename','existsSync','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','map','TagIds','split','Tags','push','then','index','WhatsappInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','UserId','body','start','some','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','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','contactName','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','fullname','firstName','lastName','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','Whatsapp','closed','closedAt'];(function(_0x56544f,_0x5f2e8d){var _0x2709cd=function(_0x3bd6af){while(--_0x3bd6af){_0x56544f['push'](_0x56544f['shift']());}};_0x2709cd(++_0x5f2e8d);}(_0x84e1,0x1dc));var _0x184e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x84e1[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x184e('0x0'));var rimraf=require(_0x184e('0x1'));var zipdir=require(_0x184e('0x2'));var jsonpatch=require(_0x184e('0x3'));var rp=require(_0x184e('0x4'));var moment=require(_0x184e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x184e('0x6'));var util=require(_0x184e('0x7'));var path=require(_0x184e('0x8'));var sox=require(_0x184e('0x9'));var csv=require(_0x184e('0xa'));var ejs=require(_0x184e('0xb'));var fs=require('fs');var fs_extra=require(_0x184e('0xc'));var _=require('lodash');var squel=require(_0x184e('0xd'));var crypto=require(_0x184e('0xe'));var jsforce=require(_0x184e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x184e('0xa'));var querystring=require(_0x184e('0x10'));var Papa=require(_0x184e('0x11'));var Redis=require(_0x184e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x184e('0x13'));var as=require(_0x184e('0x14'));var pdf=require(_0x184e('0x15'));var hardwareService=require(_0x184e('0x16'));var logger=require(_0x184e('0x17'))(_0x184e('0x18'));var utils=require(_0x184e('0x19'));var config=require(_0x184e('0x1a'));var licenseUtil=require(_0x184e('0x1b'));var db=require(_0x184e('0x1c'))['db'];config[_0x184e('0x1d')]=_[_0x184e('0x1e')](config['redis'],{'host':_0x184e('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x184e('0x1d')]));require(_0x184e('0x20'))[_0x184e('0x21')](socket);function respondWithStatusCode(_0x82ad57,_0x436368){_0x436368=_0x436368||0xcc;return function(_0x446813){if(_0x446813){return _0x82ad57[_0x184e('0x22')](_0x436368);}return _0x82ad57[_0x184e('0x23')](_0x436368)[_0x184e('0x24')]();};}function respondWithResult(_0x4c5442,_0x1f3d61){_0x1f3d61=_0x1f3d61||0xc8;return function(_0x5d3a36){if(_0x5d3a36){return _0x4c5442[_0x184e('0x23')](_0x1f3d61)['json'](_0x5d3a36);}};}function respondWithFilteredResult(_0x52d797,_0x2625a7){return function(_0x12d361){if(_0x12d361){var _0x28ab7f=typeof _0x2625a7[_0x184e('0x25')]===_0x184e('0x26')&&typeof _0x2625a7[_0x184e('0x27')]===_0x184e('0x26');var _0x442fb2=_0x12d361['count'];var _0x492c86=_0x28ab7f?0x0:_0x2625a7[_0x184e('0x25')];var _0x274c30=_0x28ab7f?_0x12d361[_0x184e('0x28')]:_0x2625a7[_0x184e('0x25')]+_0x2625a7[_0x184e('0x27')];var _0x5bc8ef;if(_0x274c30>=_0x442fb2){_0x274c30=_0x442fb2;_0x5bc8ef=0xc8;}else{_0x5bc8ef=0xce;}_0x52d797[_0x184e('0x23')](_0x5bc8ef);return _0x52d797[_0x184e('0x29')](_0x184e('0x2a'),_0x492c86+'-'+_0x274c30+'/'+_0x442fb2)[_0x184e('0x2b')](_0x12d361);}return null;};}function patchUpdates(_0x1362c8){return function(_0x257d21){try{jsonpatch[_0x184e('0x2c')](_0x257d21,_0x1362c8,!![]);}catch(_0x71ac9c){return BPromise[_0x184e('0x2d')](_0x71ac9c);}return _0x257d21[_0x184e('0x2e')]();};}function saveUpdates(_0x4e99a6,_0x5c90b6){return function(_0x3176ad){if(_0x3176ad){return _0x3176ad[_0x184e('0x2f')](_0x4e99a6)['then'](function(_0x173317){return _0x173317;});}return null;};}function removeEntity(_0x56b7c6,_0x31bf1d){return function(_0x43637a){if(_0x43637a){return _0x43637a[_0x184e('0x30')]()['then'](function(){_0x56b7c6[_0x184e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5bde,_0x25eed5){return function(_0x55e987){if(!_0x55e987){_0x1c5bde[_0x184e('0x22')](0x194);}return _0x55e987;};}function handleError(_0x3b9d54,_0x42a11e){_0x42a11e=_0x42a11e||0x1f4;return function(_0x424f62){logger['error'](_0x424f62[_0x184e('0x31')]);if(_0x424f62[_0x184e('0x32')]){delete _0x424f62[_0x184e('0x32')];}_0x3b9d54[_0x184e('0x23')](_0x42a11e)[_0x184e('0x33')](_0x424f62);};}function getInteractionUsers(_0x23385e,_0x52ef94){return new BPromise(function(_0x1159cb,_0x35fb9b){try{if(_0x52ef94[_0x23385e['id']]){_0x23385e['Users']=_[_0x184e('0x34')](_0x52ef94[_0x23385e['id']],function(_0x3d3a7b){return{'id':_0x3d3a7b['id'],'fullname':_0x3d3a7b['fullname']};});}}catch(_0x24eae5){_0x35fb9b(_0x24eae5);}_0x1159cb(_0x23385e);});}function getInteractionTags(_0x36bbd6,_0x45ad7a){return new BPromise(function(_0x49bc1e,_0x1b9c10){try{if(_0x36bbd6['TagIds']){_0x36bbd6['Tags']=[];_0x36bbd6[_0x184e('0x35')][_0x184e('0x36')](',')['forEach'](function(_0x675aa4){_0x36bbd6[_0x184e('0x37')][_0x184e('0x38')](_0x45ad7a[_0x675aa4]);});}delete _0x36bbd6[_0x184e('0x35')];}catch(_0x1deda5){_0x1b9c10(_0x1deda5);}_0x49bc1e(_0x36bbd6);});}function updateWhatsappInteraction(_0x41c232,_0xfc3abc,_0x243c29){return new BPromise(function(_0x3195a8,_0x514472){return getInteractionUsers(_0x41c232,_0x243c29)[_0x184e('0x39')](function(_0x3f3bf7){return getInteractionTags(_0x3f3bf7,_0xfc3abc);})[_0x184e('0x39')](function(_0x5b90cd){_0x3195a8(_0x5b90cd);})['catch'](function(_0x1b27ff){_0x514472(_0x1b27ff);});});}exports[_0x184e('0x3a')]=function(_0x650318,_0x353e36){var _0x11240f={},_0x1b8585={},_0x483a08={'count':0x0,'rows':[]};var _0x120148=_[_0x184e('0x34')](db[_0x184e('0x3b')][_0x184e('0x3c')],function(_0x457f79){return{'name':_0x457f79[_0x184e('0x3d')],'type':_0x457f79[_0x184e('0x3e')][_0x184e('0x3f')]};});_0x1b8585['model']=_[_0x184e('0x34')](_0x120148,_0x184e('0x32'));_0x1b8585[_0x184e('0x40')]=_[_0x184e('0x41')](_0x650318['query']);_0x1b8585[_0x184e('0x42')]=_['intersection'](_0x1b8585[_0x184e('0x43')],_0x1b8585[_0x184e('0x40')]);_0x11240f[_0x184e('0x44')]=_[_0x184e('0x45')](_0x1b8585[_0x184e('0x43')],qs['fields'](_0x650318['query'][_0x184e('0x46')]));_0x11240f[_0x184e('0x44')]=_0x11240f['attributes'][_0x184e('0x47')]?_0x11240f[_0x184e('0x44')]:_0x1b8585[_0x184e('0x43')];if(!_0x650318[_0x184e('0x40')][_0x184e('0x48')](_0x184e('0x49'))){_0x11240f['limit']=qs[_0x184e('0x27')](_0x650318[_0x184e('0x40')][_0x184e('0x27')]);_0x11240f[_0x184e('0x25')]=qs[_0x184e('0x25')](_0x650318[_0x184e('0x40')][_0x184e('0x25')]);}_0x11240f[_0x184e('0x4a')]=qs[_0x184e('0x4b')](_0x650318[_0x184e('0x40')][_0x184e('0x4b')]);_0x11240f[_0x184e('0x4c')]=qs[_0x184e('0x42')](_[_0x184e('0x4d')](_0x650318[_0x184e('0x40')],_0x1b8585[_0x184e('0x42')]),_0x120148);var _0x57fc7d=[];var _0x5ab2cd=squel['select']()[_0x184e('0x4e')]('id')[_0x184e('0x4e')](_0x184e('0x32'))[_0x184e('0x4e')](_0x184e('0x4f'))[_0x184e('0x50')](_0x184e('0x51'));var _0x1f3f26=squel['select']()[_0x184e('0x4e')]('u.id')[_0x184e('0x4e')](_0x184e('0x52'))[_0x184e('0x4e')](_0x184e('0x53'))[_0x184e('0x50')](_0x184e('0x54'),'ui')[_0x184e('0x55')]('users','u',_0x184e('0x56'));var _0x5ebaa9=squel['select']()[_0x184e('0x50')](_0x184e('0x57'),'i')['left_join'](_0x184e('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x184e('0x55')]('users','o','o.id\x20=\x20i.UserId')['left_join'](_0x184e('0x59'),'a',_0x184e('0x5a'))[_0x184e('0x55')](_0x184e('0x5b'),'me',_0x184e('0x5c'))[_0x184e('0x55')]('whatsapp_interaction_has_tags','it',_0x184e('0x5d'))[_0x184e('0x55')](_0x184e('0x51'),'t','t.id\x20=\x20it.TagId');var _0x4fe8e3=squel[_0x184e('0x5e')]();var _0x89232b=[];var _0xbfc454=squel[_0x184e('0x5e')]();var _0x53f2c6;if(_0x650318['query']['search']){_0x53f2c6=as[_0x184e('0x5f')](_0x650318['query'][_0x184e('0x60')]);var _0x4e5861=_0x53f2c6[_0x184e('0x61')];for(var _0x3686b9=0x0;_0x3686b9<_0x53f2c6[_0x184e('0x62')]['length'];_0x3686b9++){var _0x18975c=_0x53f2c6['conditions'][_0x3686b9];var _0xea23a='i';var _0x1d193e=_[_0x184e('0x63')](_0x120148,['name',_0x18975c[_0x184e('0x4e')]]);if(!_0x1d193e){switch(_0x18975c[_0x184e('0x4e')]){case'unreadMessages':if(_0x18975c[_0x184e('0x64')]==0x1){_0x5ebaa9[_0x184e('0x65')]('`'+_0x18975c['field']+_0x184e('0x66'));}else{_0x5ebaa9[_0x184e('0x65')]('`'+_0x18975c[_0x184e('0x4e')]+_0x184e('0x67'));}break;case _0x184e('0x68'):if(_0x18975c['operator']===_0x184e('0x69')){if(_0x18975c[_0x184e('0x64')]['split']('\x20')['length']>0x1){_0x4fe8e3[_0x4e5861](_0x184e('0x6a'),qs['getFullTextValue'](_0x18975c[_0x184e('0x64')]),null);}else{var _0x34ee43='%'+_0x18975c[_0x184e('0x64')]+'%';_0x4fe8e3[_0x4e5861]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x34ee43,_0x34ee43,_0x34ee43);}}else{_0x1d193e=_[_0x184e('0x63')](_0x120148,['name',_0x184e('0x6b')]);_0x18975c[_0x184e('0x4e')]=_0x184e('0x6b');_0x2bf614=as[_0x184e('0x6c')](_0xea23a,_0x1d193e['type'],_0x18975c);_0x4fe8e3[_0x4e5861](_0x2bf614[_0x184e('0x6d')],_0x2bf614['value']['start'],_0x2bf614[_0x184e('0x64')]['end']);}break;case _0x184e('0x6e'):var _0x10eb6e=_0x18975c[_0x184e('0x64')][_0x184e('0x36')](',')[_0x184e('0x34')](function(_0x513c96){return Number(_0x513c96);});_0x10eb6e[_0x184e('0x6f')](function(_0x395b69){_0xbfc454['or'](_0x184e('0x70'),'%,'+_0x395b69+',%');});_0x89232b=_[_0x184e('0x71')](_0x89232b,_0x10eb6e);break;case _0x184e('0x72'):if(_0x18975c[_0x184e('0x73')]==='$substring'){_0x4fe8e3[_0x4e5861]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x18975c[_0x184e('0x64')]+'%',null);}else{_0x1d193e=_[_0x184e('0x63')](_0x120148,['name',_0x184e('0x74')]);_0x18975c[_0x184e('0x4e')]=_0x184e('0x74');_0x2bf614=as[_0x184e('0x6c')](_0xea23a,_0x1d193e[_0x184e('0x3e')],_0x18975c);_0x4fe8e3[_0x4e5861](_0x2bf614[_0x184e('0x6d')],_0x2bf614['value']['start'],_0x2bf614[_0x184e('0x64')][_0x184e('0x24')]);}break;case _0x184e('0x75'):_0x2bf614=as[_0x184e('0x6c')]('me',null,_0x18975c);_0x4fe8e3[_0x4e5861](_0x2bf614[_0x184e('0x6d')],_0x2bf614['value'][_0x184e('0x76')],_0x2bf614['value'][_0x184e('0x24')]);break;}}else{var _0x2bf614=as[_0x184e('0x6c')](_0xea23a,_0x1d193e[_0x184e('0x3e')],_0x18975c);_0x4fe8e3[_0x4e5861](_0x2bf614[_0x184e('0x6d')],_0x2bf614[_0x184e('0x64')][_0x184e('0x76')],_0x2bf614[_0x184e('0x64')][_0x184e('0x24')]);}}}else{var _0x3b374f=_(_0x650318[_0x184e('0x40')])[_0x184e('0x41')]()[_0x184e('0x34')](function(_0x54aeac){return _[_0x184e('0x77')](_0x120148,[_0x184e('0x32'),_0x54aeac])?_0x54aeac:undefined;})[_0x184e('0x78')]()[_0x184e('0x64')]();if(!_[_0x184e('0x79')](_0x3b374f)){_0x3b374f[_0x184e('0x6f')](function(_0x494af5){if(_0x494af5===_0x184e('0x7a')){_0x5ebaa9[_0x184e('0x4c')](_0x184e('0x7b'),[]['concat'](_0x650318[_0x184e('0x40')][_0x494af5]));}else if(_0x494af5===_0x184e('0x7c')){var _0x56769b=JSON['parse'](_0x650318['query'][_0x494af5])[_0x184e('0x7d')];var _0x5fc7f6=JSON[_0x184e('0x7e')](_0x650318[_0x184e('0x40')][_0x494af5])[_0x184e('0x7f')];_0x5ebaa9[_0x184e('0x4c')](_0x184e('0x80'),_0x56769b,_0x5fc7f6);}else{if(_0x650318['query'][_0x494af5]===_0x184e('0x81')){_0x5ebaa9['where']('i.'+_0x494af5+'\x20IS\x20NULL');}else{_0x5ebaa9[_0x184e('0x4c')]('i.'+_0x494af5+_0x184e('0x82'),_0x650318[_0x184e('0x40')][_0x494af5]);}}});}if(_0x650318['query'][_0x184e('0x83')]){if(_0x650318['query']['read']==0x1){_0x5ebaa9[_0x184e('0x65')](_0x184e('0x84'));}else{_0x5ebaa9[_0x184e('0x65')](_0x184e('0x85'));}}if(_0x650318[_0x184e('0x40')][_0x184e('0x86')]){_0x89232b=_['isArray'](_0x650318['query'][_0x184e('0x86')])?_0x650318[_0x184e('0x40')][_0x184e('0x86')]:new Array(_0x650318['query'][_0x184e('0x86')]);_0x89232b[_0x184e('0x6f')](function(_0x298fb6){_0xbfc454['or'](_0x184e('0x70'),'%,'+_0x298fb6+',%');});}if(_0x650318[_0x184e('0x40')][_0x184e('0x87')]){var _0x1ce3b1=_0x650318[_0x184e('0x40')]['filter']['replace']('\x5c','\x5c\x5c')[_0x184e('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1ce3b1)){_0x4fe8e3['or'](_0x184e('0x89'),_0x1ce3b1+'%')['or']('i.phone\x20LIKE\x20?',_0x1ce3b1+'%');}else{_0x4fe8e3['or'](_0x184e('0x8a'),qs[_0x184e('0x8b')](_0x1ce3b1))['or'](_0x184e('0x8c'),_0x1ce3b1+'%');}}}_0x5ebaa9[_0x184e('0x4c')](_0x4fe8e3);_0x5ebaa9['group'](_0x184e('0x8d'));var _0xa291e8={'type':db[_0x184e('0x8e')]['QueryTypes']['SELECT'],'raw':!![]};var _0x5a79d9=_0x5ebaa9['clone']();_0x5a79d9[_0x184e('0x4e')](_0x184e('0x8d'));_0x5a79d9[_0x184e('0x4e')](_0x184e('0x8f'),_0x184e('0x90'));if(_0x11240f['order']){_0x11240f[_0x184e('0x4a')]['forEach'](function(_0x43908e){var _0x3029e7=_0x43908e[0x0]==='contactName'?_0x43908e[0x0]:'i.'+_0x43908e[0x0];_0x5ebaa9[_0x184e('0x4a')](_0x3029e7,_0x43908e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x184e('0x79')](_0x89232b)){_0x5ebaa9[_0x184e('0x65')](_0xbfc454);_0x5a79d9['where'](_0x184e('0x91'),_0x89232b);}BPromise[_0x184e('0x92')]()['then'](function(){if(!_0x53f2c6){if(_0x650318[_0x184e('0x40')][_0x184e('0x7a')])return;_0x5a79d9[_0x184e('0x4c')](_0x184e('0x93'));_0x5ebaa9[_0x184e('0x4c')](_0x184e('0x93'));return;}if(_0x650318['user']['role']!==_0x184e('0x94'))return;return _0x650318[_0x184e('0x95')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x184e('0x39')](function(_0x4f188f){if(_[_0x184e('0x79')](_0x4f188f)){_0x5a79d9[_0x184e('0x4c')](_0x184e('0x96'));_0x5ebaa9[_0x184e('0x4c')](_0x184e('0x96'));}else{_0x5a79d9[_0x184e('0x4c')](_0x184e('0x7b'),_['map'](_0x4f188f,'id'));_0x5ebaa9[_0x184e('0x4c')](_0x184e('0x7b'),_[_0x184e('0x34')](_0x4f188f,'id'));}});})['then'](function(){if(_0x650318[_0x184e('0x95')][_0x184e('0x97')]===_0x184e('0x94')&&!_0x53f2c6&&!_0x650318[_0x184e('0x40')]['WhatsappAccountId'])return[];return db[_0x184e('0x98')]['query'](_0x5a79d9[_0x184e('0x99')](),_0xa291e8);})[_0x184e('0x39')](function(_0x4d168e){_0x483a08[_0x184e('0x28')]=_0x4d168e['length'];if(_0x483a08[_0x184e('0x28')]===0x0)return[];return db['sequelize'][_0x184e('0x40')](_0x5ab2cd[_0x184e('0x99')](),_0xa291e8)[_0x184e('0x39')](function(_0x2e8912){_0x57fc7d=_[_0x184e('0x9a')](_0x2e8912,'id');_0xa291e8=_[_0x184e('0x9b')](_0xa291e8,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x650318[_0x184e('0x40')][_0x184e('0x46')]){_0x11240f[_0x184e('0x44')][_0x184e('0x6f')](function(_0xe5684b){_0x5ebaa9[_0x184e('0x4e')]('i.'+_0xe5684b);});}else{_0x5ebaa9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x184e('0x90'));_0x5ebaa9[_0x184e('0x4e')]('a.key',_0x184e('0x9c'));_0x5ebaa9['field']('a.mandatoryDisposition',_0x184e('0x9d'));_0x5ebaa9['field'](_0x184e('0x9e'),_0x184e('0x9f'));_0x5ebaa9['field']('i.*');_0x5ebaa9[_0x184e('0x4e')](_0x184e('0xa0'),'Contact.firstName');_0x5ebaa9['field'](_0x184e('0xa1'),_0x184e('0xa2'));_0x5ebaa9['field']('c.email',_0x184e('0xa3'));_0x5ebaa9[_0x184e('0x4e')](_0x184e('0xa4'),_0x184e('0xa5'));_0x5ebaa9[_0x184e('0x4e')](_0x184e('0xa6'),_0x184e('0xa7'));_0x5ebaa9[_0x184e('0x4e')](_0x184e('0xa8'),_0x184e('0xa9'));_0x5ebaa9['field']('o.fullname',_0x184e('0xaa'));_0x5ebaa9['field']('o.internal','Owner.internal');_0x5ebaa9[_0x184e('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x11240f[_0x184e('0x27')])_0x5ebaa9[_0x184e('0x27')](_0x11240f[_0x184e('0x27')]);if(_0x11240f[_0x184e('0x25')])_0x5ebaa9[_0x184e('0x25')](_0x11240f[_0x184e('0x25')]);return db[_0x184e('0x98')][_0x184e('0x40')](_0x5ebaa9['toString'](),_0xa291e8);})['then'](function(_0x380a4d){if(_0x380a4d[_0x184e('0x47')]>0x0)_0x1f3f26[_0x184e('0x4c')](_0x184e('0xab'),_[_0x184e('0x34')](_0x380a4d,'id'));return db['sequelize'][_0x184e('0x40')](_0x1f3f26[_0x184e('0x99')](),_0xa291e8)[_0x184e('0x39')](function(_0x57d3ac){var _0x42db52=_[_0x184e('0xac')](_0x57d3ac,_0x184e('0xad'));var _0x5e3876=[];_0x380a4d['forEach'](function(_0x123ffc){_0x5e3876[_0x184e('0x38')](updateWhatsappInteraction(_0x123ffc,_0x57fc7d,_0x42db52));});return BPromise[_0x184e('0xae')](_0x5e3876);});});})[_0x184e('0x39')](function(_0x452be1){_0x483a08[_0x184e('0xaf')]=_0x452be1;return _0x483a08;})[_0x184e('0x39')](respondWithFilteredResult(_0x353e36,_0x11240f))[_0x184e('0xb0')](handleError(_0x353e36,null));};exports[_0x184e('0xb1')]=function(_0x1040d2,_0x4b2611){var _0x49586b={'raw':![],'where':{'id':_0x1040d2[_0x184e('0xb2')]['id']}},_0x315f5f={};_0x315f5f[_0x184e('0x43')]=_[_0x184e('0x41')](db['WhatsappInteraction']['rawAttributes']);_0x315f5f[_0x184e('0x40')]=_[_0x184e('0x41')](_0x1040d2['query']);_0x315f5f[_0x184e('0x42')]=_['intersection'](_0x315f5f[_0x184e('0x43')],_0x315f5f[_0x184e('0x40')]);_0x49586b[_0x184e('0x44')]=_[_0x184e('0x45')](_0x315f5f['model'],qs['fields'](_0x1040d2[_0x184e('0x40')]['fields']));_0x49586b['attributes']=_0x49586b['attributes'][_0x184e('0x47')]?_0x49586b[_0x184e('0x44')]:_0x315f5f[_0x184e('0x43')];if(_0x1040d2['query'][_0x184e('0xb3')]){_0x49586b[_0x184e('0xb4')]=[{'all':!![]}];}_0x49586b=_[_0x184e('0x9b')]({},_0x49586b,_0x1040d2[_0x184e('0xb5')]);return db[_0x184e('0x3b')][_0x184e('0x63')](_0x49586b)[_0x184e('0x39')](handleEntityNotFound(_0x4b2611,null))[_0x184e('0x39')](respondWithResult(_0x4b2611,null))[_0x184e('0xb0')](handleError(_0x4b2611,null));};exports[_0x184e('0xb6')]=function(_0x494564,_0x40c053){return db[_0x184e('0x3b')][_0x184e('0xb6')](_0x494564[_0x184e('0x75')],{})['then'](respondWithResult(_0x40c053,0xc9))[_0x184e('0xb0')](handleError(_0x40c053,null));};exports[_0x184e('0x2f')]=function(_0x5bba38,_0x3683e5){if(_0x5bba38[_0x184e('0x75')]['id']){delete _0x5bba38['body']['id'];}return db['WhatsappInteraction'][_0x184e('0x63')]({'where':{'id':_0x5bba38[_0x184e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x3683e5,null))[_0x184e('0x39')](saveUpdates(_0x5bba38[_0x184e('0x75')],null))[_0x184e('0x39')](respondWithResult(_0x3683e5,null))[_0x184e('0xb0')](handleError(_0x3683e5,null));};exports['destroy']=function(_0x4c8156,_0x4e84a8){return db[_0x184e('0x3b')][_0x184e('0x63')]({'where':{'id':_0x4c8156[_0x184e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4e84a8,null))[_0x184e('0x39')](removeEntity(_0x4e84a8,null))[_0x184e('0xb0')](handleError(_0x4e84a8,null));};exports[_0x184e('0xb7')]=function(_0x56b56e,_0x23344d){return db['WhatsappInteraction'][_0x184e('0xb7')]()[_0x184e('0x39')](respondWithResult(_0x23344d,null))[_0x184e('0xb0')](handleError(_0x23344d,null));};exports[_0x184e('0xb8')]=function(_0x28a363,_0x5da0c7,_0x28c37a){return db[_0x184e('0xb9')][_0x184e('0x63')]({'where':{'id':_0x28a363[_0x184e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5da0c7,null))['then'](function(_0x16a954){if(_0x16a954){return _0x16a954[_0x184e('0xb8')](_0x28a363['body'][_0x184e('0xba')],_[_0x184e('0xbb')](_0x28a363[_0x184e('0x75')],[_0x184e('0xba'),'id'])||{});}})[_0x184e('0x39')](respondWithResult(_0x5da0c7,null))['catch'](handleError(_0x5da0c7,null));};exports[_0x184e('0xbc')]=function(_0xce486e,_0x560b41,_0xb41baa){var _0x303086={'raw':![],'where':{}};var _0x3add9a={};var _0x289894={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x184e('0xbd')]({'where':{'id':_0xce486e[_0x184e('0xb2')]['id']}})[_0x184e('0x39')](handleEntityNotFound(_0x560b41,null))[_0x184e('0x39')](function(_0x214b03){if(_0x214b03){_0x3add9a['model']=_[_0x184e('0x41')](db[_0x184e('0xb9')]['rawAttributes']);_0x3add9a[_0x184e('0x40')]=_['keys'](_0xce486e[_0x184e('0x40')]);_0x3add9a[_0x184e('0x42')]=_[_0x184e('0x45')](_0x3add9a[_0x184e('0x43')],_0x3add9a[_0x184e('0x40')]);_0x303086[_0x184e('0x44')]=_[_0x184e('0x45')](_0x3add9a['model'],qs[_0x184e('0x46')](_0xce486e[_0x184e('0x40')][_0x184e('0x46')]));_0x303086[_0x184e('0x44')]=_0x303086['attributes'][_0x184e('0x47')]?_0x303086[_0x184e('0x44')]:_0x3add9a[_0x184e('0x43')];if(!_0xce486e[_0x184e('0x40')][_0x184e('0x48')](_0x184e('0x49'))){_0x303086['limit']=qs[_0x184e('0x27')](_0xce486e[_0x184e('0x40')]['limit']);_0x303086[_0x184e('0x25')]=qs['offset'](_0xce486e[_0x184e('0x40')][_0x184e('0x25')]);}_0x303086[_0x184e('0x4a')]=qs[_0x184e('0x4b')](_0xce486e[_0x184e('0x40')][_0x184e('0x4b')]);_0x303086[_0x184e('0x4c')]=qs['filters'](_[_0x184e('0x4d')](_0xce486e['query'],_0x3add9a[_0x184e('0x42')]));_0x303086['where'][_0x184e('0xad')]=_0x214b03['id'];if(_0xce486e[_0x184e('0x40')][_0x184e('0x87')]){_0x303086[_0x184e('0x4c')]=_[_0x184e('0x9b')](_0x303086[_0x184e('0x4c')],{'$or':_[_0x184e('0x34')](_0x303086[_0x184e('0x44')],function(_0x16df1f){var _0xff5bd6={};_0xff5bd6[_0x16df1f]={'$like':'%'+_0xce486e[_0x184e('0x40')][_0x184e('0x87')]+'%'};return _0xff5bd6;})});}if(_0xce486e['query']['$gte']){var _0x44f4dd=_0xce486e[_0x184e('0x40')][_0x184e('0x7d')]['split'](',');var _0x3d58b6={};_0x3d58b6[_0x44f4dd[0x0]]={'$gte':moment(_0x44f4dd[0x1])[_0x184e('0xbe')](_0x184e('0xbf'))};_0x303086[_0x184e('0x4c')]=_[_0x184e('0x9b')](_0x303086[_0x184e('0x4c')],_0x3d58b6);}_0x303086=_['merge']({},_0x303086,_0xce486e[_0x184e('0xb5')]);return db[_0x184e('0xb9')][_0x184e('0x28')]({'where':_0x303086[_0x184e('0x4c')]})['then'](function(_0x93835){_0x289894['count']=_0x93835;if(_0xce486e[_0x184e('0x40')][_0x184e('0xb3')]){_0x303086[_0x184e('0xb4')]=[{'all':!![]}];}return db[_0x184e('0xb9')][_0x184e('0xc0')](_0x303086);})[_0x184e('0x39')](function(_0x2cf7fa){_0x289894[_0x184e('0xaf')]=_0x2cf7fa;return _0x289894;});}})[_0x184e('0x39')](respondWithFilteredResult(_0x560b41,_0x303086))[_0x184e('0xb0')](handleError(_0x560b41,null));};exports[_0x184e('0xc1')]=function(_0x4730db,_0x301c31,_0x1cc987){return db[_0x184e('0x3b')][_0x184e('0x63')]({'where':{'id':_0x4730db[_0x184e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x301c31,null))[_0x184e('0x39')](function(_0x5624cb){if(_0x5624cb){return _0x5624cb[_0x184e('0xc2')](_0x4730db[_0x184e('0x75')][_0x184e('0xba')],_[_0x184e('0xbb')](_0x4730db[_0x184e('0x75')],['ids','id'])||{})[_0x184e('0xc3')](function(){return db[_0x184e('0x6e')][_0x184e('0xc0')]({'attributes':['id',_0x184e('0x32'),_0x184e('0x4f')],'where':{'id':_0x4730db[_0x184e('0x75')][_0x184e('0xba')]}});})['then'](function(_0x228992){socket['emit'](_0x184e('0xc4'),{'id':Number(_0x4730db[_0x184e('0xb2')]['id']),'tags':_0x228992||[]});return{'id':Number(_0x4730db[_0x184e('0xb2')]['id']),'tags':_0x228992||[]};});}})[_0x184e('0x39')](respondWithResult(_0x301c31,null))['catch'](handleError(_0x301c31,null));};exports[_0x184e('0xc5')]=function(_0xf68833,_0x3abae1,_0x90c69d){return db[_0x184e('0x3b')][_0x184e('0x63')]({'where':{'id':_0xf68833['params']['id']}})[_0x184e('0x39')](handleEntityNotFound(_0x3abae1,null))[_0x184e('0x39')](function(_0x2dd31a){if(_0x2dd31a){return _0x2dd31a['removeTags'](_0xf68833['query'][_0x184e('0xba')]);}})[_0x184e('0x39')](respondWithStatusCode(_0x3abae1,null))[_0x184e('0xb0')](handleError(_0x3abae1,null));};exports[_0x184e('0xc6')]=function(_0x8a6294,_0x228d3c){var _0x90e5ba=moment()[_0x184e('0xc7')]()[_0x184e('0x99')]();var _0x291c27=path['join'](config[_0x184e('0xc8')],_0x184e('0xc9'),_0x184e('0xca'),_0x184e('0xcb'));var _0x27c1f9=path[_0x184e('0xcc')](config[_0x184e('0xc8')],_0x184e('0xc9'),_0x184e('0xca'),_0x184e('0xcd'));var _0x394eab=path[_0x184e('0xcc')](_0x291c27,_0x90e5ba);var _0x3b9857=util['format'](_0x184e('0xce'),_0x8a6294[_0x184e('0xb2')]['id'],_0x90e5ba);var _0x5694c1=path[_0x184e('0xcc')](_0x291c27,_0x3b9857);var _0x30ccfc=[];_0x30ccfc[_0x184e('0x38')]({'model':db['User'],'as':_0x184e('0x72'),'attributes':['id',_0x184e('0xcf')],'raw':!![]});_0x30ccfc[_0x184e('0x38')]({'model':db['CmContact'],'as':_0x184e('0x68'),'attributes':['id',_0x184e('0xd0'),_0x184e('0xd1')],'raw':!![]});if(_0x8a6294[_0x184e('0x40')]['attachments']){_0x30ccfc['push']({'model':db[_0x184e('0xd2')],'as':_0x184e('0xd2'),'raw':!![]});}var _0x22ab7d=[{'model':db[_0x184e('0xb9')],'as':_0x184e('0xd3'),'attributes':['id',_0x184e('0x75'),_0x184e('0x7c'),_0x184e('0xd4'),_0x184e('0xd5'),'read'],'include':_0x30ccfc}];_0x22ab7d[_0x184e('0x38')]({'model':db['WhatsappAccount'],'as':_0x184e('0xd6'),'attributes':['id',_0x184e('0x32')]});_0x22ab7d[_0x184e('0x38')]({'model':db[_0x184e('0x72')],'as':_0x184e('0xd7'),'attributes':['id',_0x184e('0xcf')]});return db[_0x184e('0x3b')][_0x184e('0x63')]({'where':{'id':_0x8a6294[_0x184e('0xb2')]['id']},'include':_0x22ab7d})[_0x184e('0x39')](handleEntityNotFound(_0x228d3c,null))[_0x184e('0x39')](function(_0x1d8bd6){if(_0x1d8bd6){var _0x36e289=_0x1d8bd6['get']({'plain':!![]});fs[_0x184e('0xd8')](_0x394eab);var _0x4183c7={'channel':_0x184e('0xd9'),'account':_0x36e289[_0x184e('0xd6')][_0x184e('0x32')],'agent':_0x36e289[_0x184e('0xd7')]?_0x36e289[_0x184e('0xd7')][_0x184e('0xcf')]:'N.A.','createdAt':moment(_0x36e289[_0x184e('0x7c')])[_0x184e('0xbe')](_0x184e('0xbf'))[_0x184e('0x99')](),'closedAt':_0x36e289[_0x184e('0xda')]?moment(_0x36e289[_0x184e('0xdb')])[_0x184e('0xbe')](_0x184e('0xbf'))[_0x184e('0x99')]():'','disposition':_0x36e289['disposition'],'messages':_(_0x36e289[_0x184e('0xd3')])['filter']({'secret':![]})[_0x184e('0x34')](function(_0x3758aa){if(_0x3758aa[_0x184e('0xd2')]){var _0x53802e=path[_0x184e('0xcc')](_0x27c1f9,_0x3758aa[_0x184e('0xd2')][_0x184e('0xdc')]);if(fs[_0x184e('0xdd')](_0x53802e)){fs['createReadStream'](_0x53802e)['pipe'](fs[_0x184e('0xde')](path[_0x184e('0xcc')](_0x394eab,_0x3758aa[_0x184e('0xd2')][_0x184e('0xdc')])));}}return{'date':moment(_0x3758aa['createdAt'])[_0x184e('0xbe')](_0x184e('0xbf'))['toString'](),'sender':_0x3758aa[_0x184e('0xd4')]===_0x184e('0xdf')?_0x3758aa[_0x184e('0x72')]?_0x3758aa[_0x184e('0x72')][_0x184e('0xcf')]:'System':_0x3758aa['Contact'][_0x184e('0xd0')]+(_0x3758aa['Contact'][_0x184e('0xd1')]?'\x20'+_0x3758aa[_0x184e('0x68')][_0x184e('0xd1')]:''),'body':_0x3758aa[_0x184e('0xd2')]?_0x3758aa['Attachment'][_0x184e('0xdc')]:_0x3758aa[_0x184e('0x75')],'direction':_0x3758aa['direction']===_0x184e('0xdf')?'A':'C','secret':_0x3758aa[_0x184e('0xd5')],'read':_0x3758aa[_0x184e('0x83')],'attachment':_0x3758aa[_0x184e('0xd2')]};})[_0x184e('0x64')]()};return ejs[_0x184e('0xe0')](path[_0x184e('0xcc')](config[_0x184e('0xc8')],_0x184e('0xc9'),'views',_0x184e('0xe1')),{'interaction':_0x4183c7})[_0x184e('0x39')](function(_0x241e12){var _0xdc9fef=path[_0x184e('0xcc')](_0x394eab,_0x184e('0xe2')+_0x36e289['id']+'-'+_0x90e5ba+_0x184e('0xe3'));var _0x585133={'path':_0xdc9fef,'channel':_0x184e('0xd9'),'interactionId':_0x36e289['id']};return pdf[_0x184e('0xe4')](_0x241e12,_0x585133);})[_0x184e('0x39')](function(){return new BPromise(function(_0x304269,_0x5dc88e){zipdir(_0x394eab,{'saveTo':_0x5694c1},function(_0xdc6785,_0x2b7ad9){if(_0xdc6785)return _0x5dc88e(_0xdc6785);return _0x304269(_0x2b7ad9);});})[_0x184e('0x39')](function(){return new BPromise(function(_0x1e1a99,_0x465b60){rimraf(_0x394eab,function(_0x1ba59e){if(_0x1ba59e)_0x465b60(_0x1ba59e);return _0x1e1a99();});});})[_0x184e('0x39')](function(){return _0x228d3c['download'](_0x5694c1,_0x3b9857,function(_0x12d854){if(_0x12d854){console[_0x184e('0xe5')](_0x184e('0xe6'),_0x12d854);}else{fs[_0x184e('0xe7')](_0x5694c1);}});});});}else{return _0x228d3c[_0x184e('0x22')](0xc8);}})[_0x184e('0xb0')](handleError(_0x228d3c,null));};
\ No newline at end of file
index f01cbbc..abd8124 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea1a=['remove','then','setDataValue','map','findAll','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update'];(function(_0x27571a,_0x453c6e){var _0x2fc807=function(_0x3bacdc){while(--_0x3bacdc){_0x27571a['push'](_0x27571a['shift']());}};_0x2fc807(++_0x453c6e);}(_0xea1a,0x158));var _0xaea1=function(_0x4a71b3,_0x1b7610){_0x4a71b3=_0x4a71b3-0x0;var _0x501268=_0xea1a[_0x4a71b3];return _0x501268;};'use strict';var EventEmitter=require(_0xaea1('0x0'));var WhatsappInteraction=require(_0xaea1('0x1'))['db'][_0xaea1('0x2')];var WhatsappMessage=require(_0xaea1('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xaea1('0x3')](0x0);var events={'afterCreate':_0xaea1('0x4'),'afterUpdate':_0xaea1('0x5'),'afterDestroy':_0xaea1('0x6')};function emitEvent(_0x3badb1){return function(_0x1676b5,_0x116caf,_0x246ebc){_0x1676b5['getUsers']({'attributes':['id'],'raw':!![]})[_0xaea1('0x7')](function(_0x8883ab){_0x1676b5[_0xaea1('0x8')]('Users',_0x8883ab[_0xaea1('0x9')](function(_0x553b92){return{'id':_0x553b92['id']};}));return WhatsappMessage[_0xaea1('0xa')]({'where':{'WhatsappInteractionId':_0x1676b5['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x26fb87){_0x1676b5['setDataValue']('unreadMessages',_0x26fb87['length']);WhatsappInteractionEvents[_0xaea1('0xb')](_0x3badb1+':'+_0x1676b5['id'],_0x1676b5);WhatsappInteractionEvents['emit'](_0x3badb1,_0x1676b5);_0x246ebc(null);})['catch'](_0x246ebc(null));};}for(var e in events){if(events[_0xaea1('0xc')](e)){var event=events[e];WhatsappInteraction[_0xaea1('0xd')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xdca3=['../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','WhatsappInteraction'];(function(_0x3ae694,_0x454bb8){var _0x40798f=function(_0x34a8fa){while(--_0x34a8fa){_0x3ae694['push'](_0x3ae694['shift']());}};_0x40798f(++_0x454bb8);}(_0xdca3,0x64));var _0x3dca=function(_0x4f16fe,_0x14bed3){_0x4f16fe=_0x4f16fe-0x0;var _0x4fb56c=_0xdca3[_0x4f16fe];return _0x4fb56c;};'use strict';var EventEmitter=require(_0x3dca('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x3dca('0x1')];var WhatsappMessage=require(_0x3dca('0x2'))['db'][_0x3dca('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x3dca('0x4')](0x0);var events={'afterCreate':_0x3dca('0x5'),'afterUpdate':_0x3dca('0x6'),'afterDestroy':_0x3dca('0x7')};function emitEvent(_0x221ad8){return function(_0x3887bd,_0x10c46f,_0x3e2811){_0x3887bd['getUsers']({'attributes':['id'],'raw':!![]})[_0x3dca('0x8')](function(_0x5d52c3){_0x3887bd['setDataValue'](_0x3dca('0x9'),_0x5d52c3['map'](function(_0x32a125){return{'id':_0x32a125['id']};}));return WhatsappMessage[_0x3dca('0xa')]({'where':{'WhatsappInteractionId':_0x3887bd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3dca('0x8')](function(_0x152aca){_0x3887bd['setDataValue'](_0x3dca('0xb'),_0x152aca[_0x3dca('0xc')]);WhatsappInteractionEvents[_0x3dca('0xd')](_0x221ad8+':'+_0x3887bd['id'],_0x3887bd);WhatsappInteractionEvents[_0x3dca('0xd')](_0x221ad8,_0x3887bd);_0x3e2811(null);})[_0x3dca('0xe')](_0x3e2811(null));};}for(var e in events){if(events[_0x3dca('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x3dca('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index cae94ec..05aee6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b3=['./whatsappInteraction.attributes','exports','define','whatsapp_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5d0b7c,_0x90953a){var _0x6c6a1f=function(_0x3155f8){while(--_0x3155f8){_0x5d0b7c['push'](_0x5d0b7c['shift']());}};_0x6c6a1f(++_0x90953a);}(_0x02b3,0x9f));var _0x302b=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x02b3[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require(_0x302b('0x0'));var util=require(_0x302b('0x1'));var logger=require(_0x302b('0x2'))(_0x302b('0x3'));var moment=require(_0x302b('0x4'));var BPromise=require(_0x302b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x302b('0x6'));var rimraf=require(_0x302b('0x7'));var config=require(_0x302b('0x8'));var attributes=require(_0x302b('0x9'));module[_0x302b('0xa')]=function(_0x39db55,_0x428d7d){return _0x39db55[_0x302b('0xb')]('WhatsappInteraction',attributes,{'tableName':_0x302b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x202a8b,_0x5a92b4,_0x418272){if(_0x202a8b['changed']('closed')){_0x202a8b['closedAt']=moment()['format'](_0x302b('0xd'));}_0x418272(null,_0x202a8b);}}});};
\ No newline at end of file
+var _0x69b6=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x6823e,_0xc66f0e){var _0x5a2be8=function(_0x461770){while(--_0x461770){_0x6823e['push'](_0x6823e['shift']());}};_0x5a2be8(++_0xc66f0e);}(_0x69b6,0xa3));var _0x669b=function(_0x3ecbe3,_0x85040f){_0x3ecbe3=_0x3ecbe3-0x0;var _0x17435f=_0x69b6[_0x3ecbe3];return _0x17435f;};'use strict';var _=require(_0x669b('0x0'));var util=require(_0x669b('0x1'));var logger=require(_0x669b('0x2'))(_0x669b('0x3'));var moment=require(_0x669b('0x4'));var BPromise=require(_0x669b('0x5'));var rp=require(_0x669b('0x6'));var fs=require('fs');var path=require(_0x669b('0x7'));var rimraf=require('rimraf');var config=require(_0x669b('0x8'));var attributes=require(_0x669b('0x9'));module['exports']=function(_0x2222d5,_0x25ea2c){return _0x2222d5[_0x669b('0xa')](_0x669b('0xb'),attributes,{'tableName':_0x669b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x433ef8,_0x5c4950,_0x302198){if(_0x433ef8[_0x669b('0xd')](_0x669b('0xe'))){_0x433ef8[_0x669b('0xf')]=moment()[_0x669b('0x10')](_0x669b('0x11'));}_0x302198(null,_0x433ef8);}}});};
\ No newline at end of file
index e337d62..dc3c2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcccc=['options','raw','where','limit','then','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappInteraction,\x20%s,\x20%s','result','catch','UpdateWhatsappInteraction','update','body'];(function(_0x4f03ce,_0x5cb284){var _0x52acd1=function(_0x192bfc){while(--_0x192bfc){_0x4f03ce['push'](_0x4f03ce['shift']());}};_0x52acd1(++_0x5cb284);}(_0xcccc,0x8f));var _0xcccc=function(_0x49ebed,_0x2ed245){_0x49ebed=_0x49ebed-0x0;var _0x247194=_0xcccc[_0x49ebed];return _0x247194;};'use strict';var _=require(_0xcccc('0x0'));var util=require(_0xcccc('0x1'));var moment=require(_0xcccc('0x2'));var BPromise=require(_0xcccc('0x3'));var rs=require(_0xcccc('0x4'));var fs=require('fs');var Redis=require(_0xcccc('0x5'));var db=require(_0xcccc('0x6'))['db'];var utils=require(_0xcccc('0x7'));var logger=require(_0xcccc('0x8'))(_0xcccc('0x9'));var config=require('../../config/environment');var jayson=require(_0xcccc('0xa'));var client=jayson[_0xcccc('0xb')][_0xcccc('0xc')]({'port':0x232a});config[_0xcccc('0xd')]=_['defaults'](config[_0xcccc('0xd')],{'host':_0xcccc('0xe'),'port':0x18eb});var socket=require(_0xcccc('0xf'))(new Redis(config['redis']));require(_0xcccc('0x10'))[_0xcccc('0x11')](socket);function respondWithRpcPromise(_0x5f26be,_0x37633e,_0x46aacc){return new BPromise(function(_0x3204ad,_0x209ae8){return client[_0xcccc('0x12')](_0x5f26be,_0x46aacc)['then'](function(_0x109d0e){logger[_0xcccc('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,'request\x20sent');logger[_0xcccc('0x14')](_0xcccc('0x15'),_0x37633e,_0xcccc('0x16'),JSON[_0xcccc('0x17')](_0x109d0e));if(_0x109d0e[_0xcccc('0x18')]){if(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x19')]===0x1f4){logger[_0xcccc('0x18')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);return _0x209ae8(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);}logger[_0xcccc('0x18')](_0xcccc('0x1b'),_0x37633e,_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);return _0x3204ad(_0x109d0e[_0xcccc('0x18')][_0xcccc('0x1a')]);}else{logger[_0xcccc('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x37633e,_0xcccc('0x16'));_0x3204ad(_0x109d0e[_0xcccc('0x1c')]['message']);}})[_0xcccc('0x1d')](function(_0x115ee6){logger[_0xcccc('0x18')](_0xcccc('0x1b'),_0x37633e,_0x115ee6);_0x209ae8(_0x115ee6);});});}exports[_0xcccc('0x1e')]=function(_0x127b56){var _0x31f917=this;return new Promise(function(_0x551c3a,_0x5cb4b0){return db['WhatsappInteraction'][_0xcccc('0x1f')](_0x127b56[_0xcccc('0x20')],{'raw':_0x127b56[_0xcccc('0x21')]?_0x127b56[_0xcccc('0x21')][_0xcccc('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x127b56[_0xcccc('0x21')]?_0x127b56[_0xcccc('0x21')][_0xcccc('0x23')]||null:null,'attributes':_0x127b56[_0xcccc('0x21')]?_0x127b56['options']['attributes']||null:null,'limit':_0x127b56['options']?_0x127b56['options'][_0xcccc('0x24')]||null:null})[_0xcccc('0x25')](function(_0x5755cc){logger[_0xcccc('0x13')](_0xcccc('0x1e'),_0x127b56);logger[_0xcccc('0x14')](_0xcccc('0x1e'),_0x127b56,JSON[_0xcccc('0x17')](_0x5755cc));_0x551c3a(_0x5755cc);})[_0xcccc('0x1d')](function(_0x57bd3b){logger[_0xcccc('0x18')](_0xcccc('0x1e'),_0x57bd3b[_0xcccc('0x1a')],_0x127b56);_0x5cb4b0(_0x31f917[_0xcccc('0x18')](0x1f4,_0x57bd3b[_0xcccc('0x1a')]));});});};exports[_0xcccc('0x26')]=function(_0x56ab87){return new Promise(function(_0x4a8fd7,_0x111e11){return db[_0xcccc('0x27')]['find']({'where':_0x56ab87[_0xcccc('0x21')]?_0x56ab87[_0xcccc('0x21')][_0xcccc('0x23')]||null:null})[_0xcccc('0x25')](function(_0x5ec9bb){if(_0x5ec9bb){return _0x5ec9bb[_0xcccc('0x28')](_0x56ab87[_0xcccc('0x20')][_0xcccc('0x29')],_['omit'](_0x56ab87[_0xcccc('0x20')],[_0xcccc('0x29'),'id'])||{});}})[_0xcccc('0x2a')](function(_0x142b8c){logger[_0xcccc('0x13')](_0xcccc('0x2b'),_0x56ab87);logger['debug'](_0xcccc('0x2b'),_0x56ab87,JSON['stringify'](_0x142b8c));_0x4a8fd7(_0x142b8c);})[_0xcccc('0x1d')](function(_0x1e47f8){logger[_0xcccc('0x18')](_0xcccc('0x2b'),_0x1e47f8[_0xcccc('0x1a')],_0x56ab87);_0x111e11(_this[_0xcccc('0x18')](0x1f4,_0x1e47f8['message']));});});};
\ No newline at end of file
+var _0x09b0=['body','options','where','attributes','limit','catch','AddTagsToWhatsappInteraction','find','ids','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x09b0,0x1b7));var _0x009b=function(_0x256bff,_0x335e3d){_0x256bff=_0x256bff-0x0;var _0x428057=_0x09b0[_0x256bff];return _0x428057;};'use strict';var _=require('lodash');var util=require(_0x009b('0x0'));var moment=require(_0x009b('0x1'));var BPromise=require(_0x009b('0x2'));var rs=require(_0x009b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x009b('0x4'));var logger=require(_0x009b('0x5'))(_0x009b('0x6'));var config=require(_0x009b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x009b('0x8')]({'port':0x232a});config[_0x009b('0x9')]=_[_0x009b('0xa')](config['redis'],{'host':_0x009b('0xb'),'port':0x18eb});var socket=require(_0x009b('0xc'))(new Redis(config['redis']));require(_0x009b('0xd'))['register'](socket);function respondWithRpcPromise(_0x5823ea,_0x2cec52,_0x568ee3){return new BPromise(function(_0x2573f8,_0x218a90){return client[_0x009b('0xe')](_0x5823ea,_0x568ee3)[_0x009b('0xf')](function(_0x2e3556){logger[_0x009b('0x10')](_0x009b('0x11'),_0x2cec52,_0x009b('0x12'));logger[_0x009b('0x13')](_0x009b('0x14'),_0x2cec52,_0x009b('0x12'),JSON[_0x009b('0x15')](_0x2e3556));if(_0x2e3556[_0x009b('0x16')]){if(_0x2e3556[_0x009b('0x16')][_0x009b('0x17')]===0x1f4){logger['error'](_0x009b('0x11'),_0x2cec52,_0x2e3556[_0x009b('0x16')]['message']);return _0x218a90(_0x2e3556[_0x009b('0x16')]['message']);}logger[_0x009b('0x16')](_0x009b('0x11'),_0x2cec52,_0x2e3556[_0x009b('0x16')][_0x009b('0x18')]);return _0x2573f8(_0x2e3556[_0x009b('0x16')][_0x009b('0x18')]);}else{logger[_0x009b('0x10')](_0x009b('0x11'),_0x2cec52,_0x009b('0x12'));_0x2573f8(_0x2e3556[_0x009b('0x19')][_0x009b('0x18')]);}})['catch'](function(_0x349d14){logger['error'](_0x009b('0x11'),_0x2cec52,_0x349d14);_0x218a90(_0x349d14);});});}exports[_0x009b('0x1a')]=function(_0x168892){var _0x186c5b=this;return new Promise(function(_0x3e4722,_0x17d59c){return db[_0x009b('0x1b')][_0x009b('0x1c')](_0x168892[_0x009b('0x1d')],{'raw':_0x168892[_0x009b('0x1e')]?_0x168892['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168892[_0x009b('0x1e')]?_0x168892[_0x009b('0x1e')][_0x009b('0x1f')]||null:null,'attributes':_0x168892[_0x009b('0x1e')]?_0x168892['options'][_0x009b('0x20')]||null:null,'limit':_0x168892[_0x009b('0x1e')]?_0x168892[_0x009b('0x1e')][_0x009b('0x21')]||null:null})['then'](function(_0x35bf70){logger[_0x009b('0x10')](_0x009b('0x1a'),_0x168892);logger['debug'](_0x009b('0x1a'),_0x168892,JSON['stringify'](_0x35bf70));_0x3e4722(_0x35bf70);})[_0x009b('0x22')](function(_0x1ecfe7){logger['error'](_0x009b('0x1a'),_0x1ecfe7[_0x009b('0x18')],_0x168892);_0x17d59c(_0x186c5b[_0x009b('0x16')](0x1f4,_0x1ecfe7[_0x009b('0x18')]));});});};exports[_0x009b('0x23')]=function(_0x467fd0){return new Promise(function(_0x186301,_0x4fd8d4){return db[_0x009b('0x1b')][_0x009b('0x24')]({'where':_0x467fd0[_0x009b('0x1e')]?_0x467fd0[_0x009b('0x1e')][_0x009b('0x1f')]||null:null})['then'](function(_0x348472){if(_0x348472){return _0x348472['addTags'](_0x467fd0['body'][_0x009b('0x25')],_['omit'](_0x467fd0['body'],[_0x009b('0x25'),'id'])||{});}})['spread'](function(_0x1aba0f){logger['info'](_0x009b('0x26'),_0x467fd0);logger[_0x009b('0x13')](_0x009b('0x26'),_0x467fd0,JSON[_0x009b('0x15')](_0x1aba0f));_0x186301(_0x1aba0f);})[_0x009b('0x22')](function(_0x3f68cd){logger['error'](_0x009b('0x26'),_0x3f68cd[_0x009b('0x18')],_0x467fd0);_0x4fd8d4(_this[_0x009b('0x16')](0x1f4,_0x3f68cd[_0x009b('0x18')]));});});};
\ No newline at end of file
index 47d9d68..a255212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2b4=['update','emit','removeListener','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xf2b4,0xcd));var _0x4f2b=function(_0x492c19,_0x323efe){_0x492c19=_0x492c19-0x0;var _0x498a29=_0xf2b4[_0x492c19];return _0x498a29;};'use strict';var WhatsappInteractionEvents=require(_0x4f2b('0x0'));var events=[_0x4f2b('0x1'),_0x4f2b('0x2'),_0x4f2b('0x3')];function createListener(_0xa26222,_0x31f3b){return function(_0x5aa449){_0x31f3b[_0x4f2b('0x4')](_0xa26222,_0x5aa449);};}function removeListener(_0x24a219,_0x460d83){return function(){WhatsappInteractionEvents[_0x4f2b('0x5')](_0x24a219,_0x460d83);};}exports[_0x4f2b('0x6')]=function(_0x58dac5){for(var _0x2dd933=0x0,_0x2aa97e=events['length'];_0x2dd933<_0x2aa97e;_0x2dd933++){var _0x17d9ab=events[_0x2dd933];var _0x405bcb=createListener(_0x4f2b('0x7')+_0x17d9ab,_0x58dac5);WhatsappInteractionEvents['on'](_0x17d9ab,_0x405bcb);}};
\ No newline at end of file
+var _0x8181=['removeListener','register','length','whatsappInteraction:','save','update','emit'];(function(_0x457bd1,_0x1a6c49){var _0x34f19f=function(_0x29309c){while(--_0x29309c){_0x457bd1['push'](_0x457bd1['shift']());}};_0x34f19f(++_0x1a6c49);}(_0x8181,0x177));var _0x1818=function(_0x1ebada,_0x560243){_0x1ebada=_0x1ebada-0x0;var _0x2025c9=_0x8181[_0x1ebada];return _0x2025c9;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x1818('0x0'),'remove',_0x1818('0x1')];function createListener(_0x2a8895,_0x5b8f66){return function(_0x596e53){_0x5b8f66[_0x1818('0x2')](_0x2a8895,_0x596e53);};}function removeListener(_0x24a8e0,_0x5bba04){return function(){WhatsappInteractionEvents[_0x1818('0x3')](_0x24a8e0,_0x5bba04);};}exports[_0x1818('0x4')]=function(_0x2789fa){for(var _0x4a21d3=0x0,_0x45550a=events[_0x1818('0x5')];_0x4a21d3<_0x45550a;_0x4a21d3++){var _0x194ddc=events[_0x4a21d3];var _0x1f741e=createListener(_0x1818('0x6')+_0x194ddc,_0x2789fa);WhatsappInteractionEvents['on'](_0x194ddc,_0x1f741e);}};
\ No newline at end of file
index 573ddaf..be7fecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd839=['whatsapp','whatsappmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','post'];(function(_0x435e4e,_0x1f9a86){var _0x1102b3=function(_0x12ba3a){while(--_0x12ba3a){_0x435e4e['push'](_0x435e4e['shift']());}};_0x1102b3(++_0x1f9a86);}(_0xd839,0x1a6));var _0x9d83=function(_0x4b4cfd,_0x46d47c){_0x4b4cfd=_0x4b4cfd-0x0;var _0x3cec3a=_0xd839[_0x4b4cfd];return _0x3cec3a;};'use strict';var multer=require(_0x9d83('0x0'));var util=require('util');var path=require(_0x9d83('0x1'));var timeout=require(_0x9d83('0x2'));var express=require(_0x9d83('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9d83('0x4'));var interaction=require(_0x9d83('0x5'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0x9d83('0x6')]('/',auth[_0x9d83('0x7')](),controller[_0x9d83('0x8')]);router[_0x9d83('0x6')]('/describe',auth[_0x9d83('0x7')](),controller['describe']);router[_0x9d83('0x6')]('/:id',auth[_0x9d83('0x7')](),controller['show']);router[_0x9d83('0x9')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x9d83('0xa'),_0x9d83('0xb')),controller[_0x9d83('0xc')]);router[_0x9d83('0x9')](_0x9d83('0xd'),controller[_0x9d83('0xe')]);router['put'](_0x9d83('0xf'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x10')]);router[_0x9d83('0x11')](_0x9d83('0x12'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x13')]);router[_0x9d83('0x11')](_0x9d83('0x14'),auth[_0x9d83('0x7')](),controller[_0x9d83('0x15')]);router[_0x9d83('0x16')](_0x9d83('0xf'),auth[_0x9d83('0x7')](),controller['destroy']);module[_0x9d83('0x17')]=router;
\ No newline at end of file
+var _0x7a1e=['util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','/:id','show','tracked','whatsapp','create','put','/:id/accept','accept','reject','delete','destroy','exports','multer'];(function(_0x208807,_0x51afc7){var _0x314dc3=function(_0xc6ecd9){while(--_0xc6ecd9){_0x208807['push'](_0x208807['shift']());}};_0x314dc3(++_0x51afc7);}(_0x7a1e,0xf9));var _0xe7a1=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7a1e[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0xe7a1('0x0'));var util=require(_0xe7a1('0x1'));var path=require(_0xe7a1('0x2'));var timeout=require('connect-timeout');var express=require(_0xe7a1('0x3'));var router=express['Router']();var fs_extra=require(_0xe7a1('0x4'));var auth=require(_0xe7a1('0x5'));var interaction=require(_0xe7a1('0x6'));var config=require(_0xe7a1('0x7'));var controller=require(_0xe7a1('0x8'));router[_0xe7a1('0x9')]('/',auth[_0xe7a1('0xa')](),controller[_0xe7a1('0xb')]);router[_0xe7a1('0x9')]('/describe',auth[_0xe7a1('0xa')](),controller[_0xe7a1('0xc')]);router[_0xe7a1('0x9')](_0xe7a1('0xd'),auth[_0xe7a1('0xa')](),controller[_0xe7a1('0xe')]);router['post']('/',auth[_0xe7a1('0xa')](),interaction[_0xe7a1('0xf')](_0xe7a1('0x10'),'whatsappmessage:create'),controller[_0xe7a1('0x11')]);router['post']('/:id/status',controller['status']);router[_0xe7a1('0x12')](_0xe7a1('0xd'),auth[_0xe7a1('0xa')](),controller['update']);router['put'](_0xe7a1('0x13'),auth['isAuthenticated'](),controller[_0xe7a1('0x14')]);router['put']('/:id/reject',auth[_0xe7a1('0xa')](),controller[_0xe7a1('0x15')]);router[_0xe7a1('0x16')](_0xe7a1('0xd'),auth[_0xe7a1('0xa')](),controller[_0xe7a1('0x17')]);module[_0xe7a1('0x18')]=router;
\ No newline at end of file
index fa8cfd3..3931aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd8=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x11f67d,_0x38606d){var _0x1f4872=function(_0x2c4f49){while(--_0x2c4f49){_0x11f67d['push'](_0x11f67d['shift']());}};_0x1f4872(++_0x38606d);}(_0xbbd8,0x174));var _0x8bbd=function(_0x1fc96d,_0x258ddf){_0x1fc96d=_0x1fc96d-0x0;var _0x504006=_0xbbd8[_0x1fc96d];return _0x504006;};'use strict';var Sequelize=require(_0x8bbd('0x0'));module[_0x8bbd('0x1')]={'body':{'type':Sequelize[_0x8bbd('0x2')](_0x8bbd('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8bbd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8bbd('0x5')),'defaultValue':_0x8bbd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8bbd('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8bbd('0x6')]},'readAt':{'type':Sequelize[_0x8bbd('0x7')]},'secret':{'type':Sequelize[_0x8bbd('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8bbd('0x6')]},'providerResponse':{'type':Sequelize[_0x8bbd('0x2')]}};
\ No newline at end of file
+var _0x85a1=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x28a1a8,_0x31e10e){var _0x3298fc=function(_0x271e4c){while(--_0x271e4c){_0x28a1a8['push'](_0x28a1a8['shift']());}};_0x3298fc(++_0x31e10e);}(_0x85a1,0x1f2));var _0x185a=function(_0x519fe9,_0x37c72a){_0x519fe9=_0x519fe9-0x0;var _0x27e38a=_0x85a1[_0x519fe9];return _0x27e38a;};'use strict';var Sequelize=require(_0x185a('0x0'));module[_0x185a('0x1')]={'body':{'type':Sequelize[_0x185a('0x2')](_0x185a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x185a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x185a('0x5')]('in',_0x185a('0x6')),'defaultValue':_0x185a('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x185a('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x185a('0x8')]},'secret':{'type':Sequelize[_0x185a('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x185a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 633dda3..b675e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87cb=['role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','fullname','rejectmessage','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','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','include','findAll','rows','show','params','options','create','body','find','destroy','describe','whatsapp-interactions','whatsapp','readAt','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x87cb,0xaa));var _0xb87c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x87cb[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xb87c('0x0'));var rimraf=require(_0xb87c('0x1'));var zipdir=require(_0xb87c('0x2'));var jsonpatch=require(_0xb87c('0x3'));var rp=require(_0xb87c('0x4'));var moment=require(_0xb87c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb87c('0x6'));var path=require(_0xb87c('0x7'));var sox=require(_0xb87c('0x8'));var csv=require(_0xb87c('0x9'));var ejs=require(_0xb87c('0xa'));var fs=require('fs');var fs_extra=require(_0xb87c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb87c('0xc'));var jsforce=require(_0xb87c('0xd'));var deskjs=require(_0xb87c('0xe'));var toCsv=require(_0xb87c('0x9'));var querystring=require(_0xb87c('0xf'));var Papa=require('papaparse');var Redis=require(_0xb87c('0x10'));var authService=require(_0xb87c('0x11'));var qs=require(_0xb87c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb87c('0x13'));var logger=require(_0xb87c('0x14'))(_0xb87c('0x15'));var utils=require(_0xb87c('0x16'));var config=require(_0xb87c('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xb87c('0x18')]=_[_0xb87c('0x19')](config[_0xb87c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb87c('0x1a'))(new Redis(config[_0xb87c('0x18')]));require(_0xb87c('0x1b'))[_0xb87c('0x1c')](socket);var jayson=require(_0xb87c('0x1d'));var client=jayson[_0xb87c('0x1e')][_0xb87c('0x1f')]({'port':0x232c});var client9002=jayson[_0xb87c('0x1e')][_0xb87c('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5016b0,_0x1bc036,_0x19b014,_0x24c7e0){return new BPromise(function(_0x8cb26c,_0x502127){var _0x3dc99c=_0x24c7e0||client;return _0x3dc99c['request'](_0x5016b0,_0x19b014)['then'](function(_0x2a64a9){logger[_0xb87c('0x20')](_0xb87c('0x21'),_0x1bc036,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1bc036,'request\x20sent',JSON[_0xb87c('0x22')](_0x2a64a9));if(_0x2a64a9['error']){if(_0x2a64a9[_0xb87c('0x23')][_0xb87c('0x24')]===0x1f4){logger['error'](_0xb87c('0x21'),_0x1bc036,_0x2a64a9[_0xb87c('0x23')]['message']);return _0x502127(_0x2a64a9['error'][_0xb87c('0x25')]);}logger[_0xb87c('0x23')](_0xb87c('0x21'),_0x1bc036,_0x2a64a9[_0xb87c('0x23')]['message']);return _0x8cb26c(_0x2a64a9[_0xb87c('0x23')]['message']);}else{logger[_0xb87c('0x20')](_0xb87c('0x21'),_0x1bc036,_0xb87c('0x26'));_0x8cb26c(_0x2a64a9[_0xb87c('0x27')][_0xb87c('0x25')]);}})[_0xb87c('0x28')](function(_0x38738e){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1bc036,_0x38738e);_0x502127(_0x38738e);});});}function respondWithStatusCode(_0x39a0c9,_0x270caf){_0x270caf=_0x270caf||0xcc;return function(_0x514c2a){if(_0x514c2a){return _0x39a0c9[_0xb87c('0x29')](_0x270caf);}return _0x39a0c9[_0xb87c('0x2a')](_0x270caf)[_0xb87c('0x2b')]();};}function respondWithResult(_0x4794b3,_0x53bb92){_0x53bb92=_0x53bb92||0xc8;return function(_0x2c0ebd){if(_0x2c0ebd){return _0x4794b3[_0xb87c('0x2a')](_0x53bb92)[_0xb87c('0x2c')](_0x2c0ebd);}};}function respondWithFilteredResult(_0x4d6c1f,_0x247576){return function(_0x10d80a){if(_0x10d80a){var _0x22171f=typeof _0x247576[_0xb87c('0x2d')]===_0xb87c('0x2e')&&typeof _0x247576['limit']==='undefined';var _0x2dad01=_0x10d80a[_0xb87c('0x2f')];var _0x1610f4=_0x22171f?0x0:_0x247576[_0xb87c('0x2d')];var _0x25ccb1=_0x22171f?_0x10d80a[_0xb87c('0x2f')]:_0x247576[_0xb87c('0x2d')]+_0x247576[_0xb87c('0x30')];var _0xd4938d;if(_0x25ccb1>=_0x2dad01){_0x25ccb1=_0x2dad01;_0xd4938d=0xc8;}else{_0xd4938d=0xce;}_0x4d6c1f[_0xb87c('0x2a')](_0xd4938d);return _0x4d6c1f['set']('Content-Range',_0x1610f4+'-'+_0x25ccb1+'/'+_0x2dad01)[_0xb87c('0x2c')](_0x10d80a);}return null;};}function patchUpdates(_0x30a056){return function(_0x4831a2){try{jsonpatch[_0xb87c('0x31')](_0x4831a2,_0x30a056,!![]);}catch(_0x209733){return BPromise[_0xb87c('0x32')](_0x209733);}return _0x4831a2[_0xb87c('0x33')]();};}function saveUpdates(_0x5df232,_0x54d6db){return function(_0x174c65){if(_0x174c65){return _0x174c65[_0xb87c('0x34')](_0x5df232)[_0xb87c('0x35')](function(_0x4aea22){return _0x4aea22;});}return null;};}function removeEntity(_0x128956,_0x49ac9e){return function(_0x3f7689){if(_0x3f7689){return _0x3f7689['destroy']()[_0xb87c('0x35')](function(){_0x128956[_0xb87c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b724,_0x5ea8f1){return function(_0xdfb600){if(!_0xdfb600){_0x48b724[_0xb87c('0x29')](0x194);}return _0xdfb600;};}function handleError(_0x562bb8,_0x2844ce){_0x2844ce=_0x2844ce||0x1f4;return function(_0x40e418){logger[_0xb87c('0x23')](_0x40e418[_0xb87c('0x36')]);if(_0x40e418[_0xb87c('0x37')]){delete _0x40e418[_0xb87c('0x37')];}_0x562bb8[_0xb87c('0x2a')](_0x2844ce)[_0xb87c('0x38')](_0x40e418);};}exports[_0xb87c('0x39')]=function(_0x3c9633,_0x3fb7e2){var _0xe801aa={},_0x26e21b={},_0x590a66={'count':0x0,'rows':[]};var _0x125c00=_['map'](db[_0xb87c('0x3a')][_0xb87c('0x3b')],function(_0x3c1686){return{'name':_0x3c1686[_0xb87c('0x3c')],'type':_0x3c1686[_0xb87c('0x3d')][_0xb87c('0x3e')]};});_0x26e21b[_0xb87c('0x3f')]=_['map'](_0x125c00,_0xb87c('0x37'));_0x26e21b[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x3c9633['query']);_0x26e21b[_0xb87c('0x42')]=_['intersection'](_0x26e21b[_0xb87c('0x3f')],_0x26e21b[_0xb87c('0x40')]);_0xe801aa[_0xb87c('0x43')]=_[_0xb87c('0x44')](_0x26e21b[_0xb87c('0x3f')],qs[_0xb87c('0x45')](_0x3c9633[_0xb87c('0x40')]['fields']));_0xe801aa[_0xb87c('0x43')]=_0xe801aa[_0xb87c('0x43')][_0xb87c('0x46')]?_0xe801aa['attributes']:_0x26e21b[_0xb87c('0x3f')];if(!_0x3c9633[_0xb87c('0x40')][_0xb87c('0x47')]('nolimit')){_0xe801aa[_0xb87c('0x30')]=qs[_0xb87c('0x30')](_0x3c9633[_0xb87c('0x40')][_0xb87c('0x30')]);_0xe801aa[_0xb87c('0x2d')]=qs[_0xb87c('0x2d')](_0x3c9633[_0xb87c('0x40')][_0xb87c('0x2d')]);}_0xe801aa['order']=qs[_0xb87c('0x48')](_0x3c9633[_0xb87c('0x40')]['sort']);_0xe801aa[_0xb87c('0x49')]=qs[_0xb87c('0x42')](_[_0xb87c('0x4a')](_0x3c9633[_0xb87c('0x40')],_0x26e21b['filters']),_0x125c00);if(_0x3c9633[_0xb87c('0x40')]['filter']){_0xe801aa[_0xb87c('0x49')]=_[_0xb87c('0x4b')](_0xe801aa[_0xb87c('0x49')],{'$or':_['map'](_0x125c00,function(_0x110538){if(_0x110538['type']!=='VIRTUAL'){var _0x99da7a={};_0x99da7a[_0x110538['name']]={'$like':'%'+_0x3c9633['query']['filter']+'%'};return _0x99da7a;}})});}_0xe801aa=_[_0xb87c('0x4b')]({},_0xe801aa,_0x3c9633['options']);var _0x100419={'where':_0xe801aa[_0xb87c('0x49')]};return db[_0xb87c('0x3a')][_0xb87c('0x2f')](_0x100419)[_0xb87c('0x35')](function(_0x5bab30){_0x590a66[_0xb87c('0x2f')]=_0x5bab30;if(_0x3c9633['query']['includeAll']){_0xe801aa[_0xb87c('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb87c('0x4d')](_0xe801aa);})['then'](function(_0x4cb04a){_0x590a66[_0xb87c('0x4e')]=_0x4cb04a;return _0x590a66;})['then'](respondWithFilteredResult(_0x3fb7e2,_0xe801aa))[_0xb87c('0x28')](handleError(_0x3fb7e2,null));};exports[_0xb87c('0x4f')]=function(_0x213eff,_0x1c661a){var _0x461e30={'raw':!![],'where':{'id':_0x213eff[_0xb87c('0x50')]['id']}},_0x55ba81={};_0x55ba81[_0xb87c('0x3f')]=_['keys'](db[_0xb87c('0x3a')][_0xb87c('0x3b')]);_0x55ba81[_0xb87c('0x40')]=_[_0xb87c('0x41')](_0x213eff[_0xb87c('0x40')]);_0x55ba81[_0xb87c('0x42')]=_[_0xb87c('0x44')](_0x55ba81[_0xb87c('0x3f')],_0x55ba81[_0xb87c('0x40')]);_0x461e30[_0xb87c('0x43')]=_['intersection'](_0x55ba81[_0xb87c('0x3f')],qs['fields'](_0x213eff[_0xb87c('0x40')][_0xb87c('0x45')]));_0x461e30[_0xb87c('0x43')]=_0x461e30[_0xb87c('0x43')][_0xb87c('0x46')]?_0x461e30['attributes']:_0x55ba81['model'];if(_0x213eff[_0xb87c('0x40')]['includeAll']){_0x461e30[_0xb87c('0x4c')]=[{'all':!![]}];}_0x461e30=_[_0xb87c('0x4b')]({},_0x461e30,_0x213eff[_0xb87c('0x51')]);return db[_0xb87c('0x3a')]['find'](_0x461e30)[_0xb87c('0x35')](handleEntityNotFound(_0x1c661a,null))[_0xb87c('0x35')](respondWithResult(_0x1c661a,null))['catch'](handleError(_0x1c661a,null));};exports['create']=function(_0x23de79,_0x15637b){return db[_0xb87c('0x3a')][_0xb87c('0x52')](_0x23de79[_0xb87c('0x53')],{})[_0xb87c('0x35')](respondWithResult(_0x15637b,0xc9))[_0xb87c('0x28')](handleError(_0x15637b,null));};exports[_0xb87c('0x34')]=function(_0x4c443b,_0x32a4a0){if(_0x4c443b[_0xb87c('0x53')]['id']){delete _0x4c443b[_0xb87c('0x53')]['id'];}return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x4c443b[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x32a4a0,null))[_0xb87c('0x35')](saveUpdates(_0x4c443b[_0xb87c('0x53')],null))[_0xb87c('0x35')](respondWithResult(_0x32a4a0,null))['catch'](handleError(_0x32a4a0,null));};exports[_0xb87c('0x55')]=function(_0x254fa5,_0x17149d){return db[_0xb87c('0x3a')]['find']({'where':{'id':_0x254fa5[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x17149d,null))[_0xb87c('0x35')](removeEntity(_0x17149d,null))[_0xb87c('0x28')](handleError(_0x17149d,null));};exports[_0xb87c('0x56')]=function(_0x1eb9ee,_0x35f331){return db[_0xb87c('0x3a')][_0xb87c('0x56')]()['then'](respondWithResult(_0x35f331,null))[_0xb87c('0x28')](handleError(_0x35f331,null));};var interaction_log=require(_0xb87c('0x14'))(_0xb87c('0x57'));exports['accept']=function(_0x577564,_0x2efade,_0x1201b0){var _0x2a5bd2={'agent':{},'channel':_0xb87c('0x58')};if(_0x577564[_0xb87c('0x53')]['id']){delete _0x577564['body']['id'];}_0x577564[_0xb87c('0x53')]['read']=!![];_0x577564[_0xb87c('0x53')][_0xb87c('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x577564['body'][_0xb87c('0x5a')]=_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')]||_0x577564[_0xb87c('0x5b')]['id'];_0x2a5bd2[_0xb87c('0x5c')]['id']=_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')];return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x577564[_0xb87c('0x50')]['id'],'UserId':null}})[_0xb87c('0x35')](handleEntityNotFound(_0x2efade,null))[_0xb87c('0x35')](saveUpdates(_0x577564[_0xb87c('0x53')],null))[_0xb87c('0x35')](function(_0x384de0){if(_0x384de0){_0x2a5bd2[_0xb87c('0x25')]=_0x384de0['get']({'plain':!![]});return db[_0xb87c('0x5d')][_0xb87c('0x54')]({'where':{'id':_0x384de0[_0xb87c('0x5e')]}});}return null;})[_0xb87c('0x35')](handleEntityNotFound(_0x2efade,null))['then'](function(_0x136c66){if(_0x136c66){return _0x136c66[_0xb87c('0x34')]({'UserId':_0x577564['body'][_0xb87c('0x5a')],'read1stAt':_[_0xb87c('0x5f')](_0x136c66[_0xb87c('0x60')])?moment()[_0xb87c('0x61')](_0xb87c('0x62')):undefined});}return null;})[_0xb87c('0x35')](function(_0x77ed7){if(_0x77ed7){_0x2a5bd2[_0xb87c('0x63')]=_0x77ed7[_0xb87c('0x64')]({'plain':!![]});interaction_log[_0xb87c('0x20')](_0xb87c('0x65'),_0x577564[_0xb87c('0x5b')]['id'],_0x577564[_0xb87c('0x5b')][_0xb87c('0x37')],_0x577564[_0xb87c('0x5b')][_0xb87c('0x66')],_0x2a5bd2[_0xb87c('0x63')]['id'],_0x577564[_0xb87c('0x53')]?JSON[_0xb87c('0x22')](_0x577564[_0xb87c('0x53')]):_0xb87c('0x67'));return respondWithRpcPromise('AcceptMessage',_0xb87c('0x68'),_0x2a5bd2);}return null;})[_0xb87c('0x35')](function(_0x162f48){var _0x427130=_0xb87c('0x69')+_0x162f48['message'][_0xb87c('0x6a')];return db[_0xb87c('0x6b')][_0xb87c('0x40')](_0x427130,{'type':db[_0xb87c('0x6c')][_0xb87c('0x6d')][_0xb87c('0x6e')],'raw':!![]})[_0xb87c('0x35')](function(_0x20c817){return _0x20c817;});})['then'](function(_0x77b694){if(_0x77b694){_0x2a5bd2[_0xb87c('0x25')]['contact']=_0x77b694[0x0];if(!_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')])return;return db[_0xb87c('0x6f')]['find']({'where':{'id':_0x577564[_0xb87c('0x53')][_0xb87c('0x5a')],'role':'agent'},'attributes':['id','name','fullname',_0xb87c('0x70'),_0xb87c('0x71')],'raw':!![]});}return null;})['then'](function(_0x4c2fcc){if(!_0x4c2fcc)return null;_0x2a5bd2[_0xb87c('0x25')][_0xb87c('0x5c')]=_0x4c2fcc;return _0x2a5bd2;})['then'](function(_0x49a8b4){if(_0x49a8b4){if(_0x577564['body'][_0xb87c('0x72')]){_0x2a5bd2[_0xb87c('0x25')]['interface']=util[_0xb87c('0x61')](_0xb87c('0x73'),_0x577564['user'][_0xb87c('0x37')]);_0x2a5bd2['message']['channel']=_0x2a5bd2[_0xb87c('0x74')];_0x2a5bd2['message'][_0xb87c('0x75')]=_0x2a5bd2['channel'];_0x2a5bd2['message'][_0xb87c('0x76')]=_0xb87c('0x77');return respondWithRpcPromise(_0xb87c('0x78'),_0xb87c('0x78'),{'event':_0xb87c('0x79'),'message':_0x2a5bd2[_0xb87c('0x25')]},client9002)['then'](function(){return _0x2a5bd2;});}return _0x2a5bd2;}return null;})[_0xb87c('0x35')](respondWithResult(_0x2efade,null))[_0xb87c('0x28')](handleError(_0x2efade,null));};var interaction_log=require('../../config/logger')(_0xb87c('0x57'));exports[_0xb87c('0x32')]=function(_0x2bc759,_0x584ec4,_0x375759){var _0x20325f={'agent':{},'channel':_0xb87c('0x58')};if(_0x2bc759[_0xb87c('0x53')]['id']){delete _0x2bc759['body']['id'];}_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')]=_0x2bc759['body'][_0xb87c('0x5a')]||_0x2bc759[_0xb87c('0x5b')]['id'];_0x20325f[_0xb87c('0x5c')]['id']=_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')];return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x2bc759[_0xb87c('0x50')]['id'],'UserId':null}})[_0xb87c('0x35')](handleEntityNotFound(_0x584ec4,null))[_0xb87c('0x35')](function(_0x37b9f4){if(_0x37b9f4){_0x20325f[_0xb87c('0x25')]=_0x37b9f4[_0xb87c('0x64')]({'plain':!![]});return db[_0xb87c('0x5d')][_0xb87c('0x54')]({'where':{'id':_0x37b9f4[_0xb87c('0x5e')]}});}return null;})[_0xb87c('0x35')](handleEntityNotFound(_0x584ec4,null))[_0xb87c('0x35')](function(_0x1f1a32){if(_0x1f1a32){_0x20325f['interaction']=_0x1f1a32[_0xb87c('0x64')]({'plain':!![]});interaction_log[_0xb87c('0x20')](_0xb87c('0x7a'),_0x2bc759[_0xb87c('0x5b')]['id'],_0x2bc759[_0xb87c('0x5b')][_0xb87c('0x37')],_0x2bc759[_0xb87c('0x5b')]['role'],_0x20325f['interaction']['id'],_0x2bc759[_0xb87c('0x53')]?JSON[_0xb87c('0x22')](_0x2bc759[_0xb87c('0x53')]):'null');return respondWithRpcPromise('RejectMessage',_0xb87c('0x7b'),_0x20325f);}return null;})[_0xb87c('0x35')](function(_0x180744){var _0x5a0d01=_0xb87c('0x69')+_0x180744[_0xb87c('0x25')][_0xb87c('0x6a')];return db[_0xb87c('0x6b')][_0xb87c('0x40')](_0x5a0d01,{'type':db[_0xb87c('0x6c')][_0xb87c('0x6d')][_0xb87c('0x6e')],'raw':!![]})[_0xb87c('0x35')](function(_0x3bf2d9){return _0x3bf2d9;});})[_0xb87c('0x35')](function(_0x543484){if(_0x543484){_0x20325f[_0xb87c('0x25')][_0xb87c('0x7c')]=_0x543484[0x0];if(!_0x2bc759[_0xb87c('0x53')][_0xb87c('0x5a')])return;return db['User'][_0xb87c('0x54')]({'where':{'id':_0x2bc759[_0xb87c('0x53')]['UserId'],'role':'agent'},'attributes':['id','name',_0xb87c('0x7d'),_0xb87c('0x70'),_0xb87c('0x71')],'raw':!![]});}return null;})[_0xb87c('0x35')](function(_0x4a3932){if(!_0x4a3932)return null;_0x20325f[_0xb87c('0x25')]['agent']=_0x4a3932;return _0x20325f;})['then'](function(_0x5aa6a7){if(_0x5aa6a7){_0x5aa6a7[_0xb87c('0x25')]['interface']=util[_0xb87c('0x61')]('SIP/%s',_0x2bc759['user'][_0xb87c('0x37')]);_0x5aa6a7['message']['channel']=_0x20325f[_0xb87c('0x74')];_0x5aa6a7[_0xb87c('0x25')][_0xb87c('0x75')]=_0x20325f[_0xb87c('0x74')];_0x5aa6a7['message']['event']=_0xb87c('0x32');respondWithRpcPromise('EventManager',_0xb87c('0x78'),{'event':_0xb87c('0x7e'),'message':_0x5aa6a7['message']},client9002);return _0x20325f;}return null;})[_0xb87c('0x35')](respondWithResult(_0x584ec4,null))[_0xb87c('0x28')](handleError(_0x584ec4,null));};exports[_0xb87c('0x2a')]=function(_0x38d5ca,_0x14d43b,_0x5054f5){if(_0x38d5ca[_0xb87c('0x53')]['id']){delete _0x38d5ca[_0xb87c('0x53')]['id'];}var _0x4555bc;return db[_0xb87c('0x3a')][_0xb87c('0x54')]({'where':{'id':_0x38d5ca[_0xb87c('0x50')]['id']}})[_0xb87c('0x35')](handleEntityNotFound(_0x14d43b,null))[_0xb87c('0x35')](function(_0x465f24){if(_0x465f24){_0x4555bc=_0x465f24;return db['WhatsappAccount']['find']({'where':{'id':_0x465f24[_0xb87c('0x7f')]}});}})[_0xb87c('0x35')](handleEntityNotFound(_0x14d43b,null))[_0xb87c('0x35')](function(_0x1b994b){if(_0x1b994b){logger['debug'](_0xb87c('0x80'),_0xb87c('0x2a'),_0xb87c('0x81'),_0x1b994b[_0xb87c('0x3d')],util[_0xb87c('0x82')](_0x38d5ca['body'],{'showHidden':![],'depth':null}));switch(_0x1b994b[_0xb87c('0x3d')]){case _0xb87c('0x83'):if(_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x84')]&&_0x38d5ca[_0xb87c('0x53')]['MessageSid']===_0x4555bc[_0xb87c('0x85')]&&_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x86')]&&_0x38d5ca[_0xb87c('0x53')][_0xb87c('0x86')]===_0xb87c('0x87')){return _0x4555bc['update']({'read':!![]});}else{logger[_0xb87c('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xb87c('0x83'),util[_0xb87c('0x82')](_0x38d5ca[_0xb87c('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x4555bc;}})[_0xb87c('0x35')](respondWithResult(_0x14d43b,null))[_0xb87c('0x28')](handleError(_0x14d43b,null));};
\ No newline at end of file
+var _0xf43e=['socket.io-emitter','register','jayson/promise','client','http','request','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','WhatsappMessage','include','findAll','rows','show','keys','includeAll','options','create','body','find','params','describe','whatsapp-interactions','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','update','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','fullname','motionChannel','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/utils','../../mysqldb','redis','defaults','localhost'];(function(_0x178c03,_0x31c7b2){var _0x13e510=function(_0x2f551a){while(--_0x2f551a){_0x178c03['push'](_0x178c03['shift']());}};_0x13e510(++_0x31c7b2);}(_0xf43e,0x75));var _0xef43=function(_0x5c5622,_0x48d8f3){_0x5c5622=_0x5c5622-0x0;var _0x43ff20=_0xf43e[_0x5c5622];return _0x43ff20;};'use strict';var emlformat=require(_0xef43('0x0'));var rimraf=require(_0xef43('0x1'));var zipdir=require(_0xef43('0x2'));var jsonpatch=require(_0xef43('0x3'));var rp=require(_0xef43('0x4'));var moment=require(_0xef43('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xef43('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef43('0x7'));var fs=require('fs');var fs_extra=require(_0xef43('0x8'));var _=require(_0xef43('0x9'));var squel=require('squel');var crypto=require(_0xef43('0xa'));var jsforce=require(_0xef43('0xb'));var deskjs=require(_0xef43('0xc'));var toCsv=require(_0xef43('0xd'));var querystring=require(_0xef43('0xe'));var Papa=require(_0xef43('0xf'));var Redis=require(_0xef43('0x10'));var authService=require(_0xef43('0x11'));var qs=require(_0xef43('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef43('0x13'));var logger=require(_0xef43('0x14'))(_0xef43('0x15'));var utils=require(_0xef43('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef43('0x17'))['db'];config[_0xef43('0x18')]=_[_0xef43('0x19')](config[_0xef43('0x18')],{'host':_0xef43('0x1a'),'port':0x18eb});var socket=require(_0xef43('0x1b'))(new Redis(config[_0xef43('0x18')]));require('./whatsappMessage.socket')[_0xef43('0x1c')](socket);var jayson=require(_0xef43('0x1d'));var client=jayson[_0xef43('0x1e')][_0xef43('0x1f')]({'port':0x232c});var client9002=jayson[_0xef43('0x1e')][_0xef43('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x112e59,_0x1ec665,_0x470266,_0x542381){return new BPromise(function(_0x238ef7,_0x2a86bc){var _0x6e06ad=_0x542381||client;return _0x6e06ad[_0xef43('0x20')](_0x112e59,_0x470266)['then'](function(_0x18b0f5){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x1ec665,_0xef43('0x21'));logger[_0xef43('0x22')](_0xef43('0x23'),_0x1ec665,'request\x20sent',JSON[_0xef43('0x24')](_0x18b0f5));if(_0x18b0f5[_0xef43('0x25')]){if(_0x18b0f5[_0xef43('0x25')][_0xef43('0x26')]===0x1f4){logger['error'](_0xef43('0x27'),_0x1ec665,_0x18b0f5[_0xef43('0x25')][_0xef43('0x28')]);return _0x2a86bc(_0x18b0f5[_0xef43('0x25')][_0xef43('0x28')]);}logger[_0xef43('0x25')](_0xef43('0x27'),_0x1ec665,_0x18b0f5[_0xef43('0x25')]['message']);return _0x238ef7(_0x18b0f5['error']['message']);}else{logger[_0xef43('0x29')](_0xef43('0x27'),_0x1ec665,_0xef43('0x21'));_0x238ef7(_0x18b0f5[_0xef43('0x2a')][_0xef43('0x28')]);}})[_0xef43('0x2b')](function(_0x11c2e2){logger[_0xef43('0x25')](_0xef43('0x27'),_0x1ec665,_0x11c2e2);_0x2a86bc(_0x11c2e2);});});}function respondWithStatusCode(_0x3fa580,_0x23cb3c){_0x23cb3c=_0x23cb3c||0xcc;return function(_0x562cab){if(_0x562cab){return _0x3fa580['sendStatus'](_0x23cb3c);}return _0x3fa580[_0xef43('0x2c')](_0x23cb3c)[_0xef43('0x2d')]();};}function respondWithResult(_0x3c69d2,_0x52d907){_0x52d907=_0x52d907||0xc8;return function(_0x333432){if(_0x333432){return _0x3c69d2['status'](_0x52d907)[_0xef43('0x2e')](_0x333432);}};}function respondWithFilteredResult(_0x4858b9,_0x332a42){return function(_0x340f1f){if(_0x340f1f){var _0x3ae10b=typeof _0x332a42[_0xef43('0x2f')]===_0xef43('0x30')&&typeof _0x332a42[_0xef43('0x31')]===_0xef43('0x30');var _0x31e1f5=_0x340f1f[_0xef43('0x32')];var _0x44c402=_0x3ae10b?0x0:_0x332a42[_0xef43('0x2f')];var _0x1f6951=_0x3ae10b?_0x340f1f[_0xef43('0x32')]:_0x332a42[_0xef43('0x2f')]+_0x332a42['limit'];var _0x3e676c;if(_0x1f6951>=_0x31e1f5){_0x1f6951=_0x31e1f5;_0x3e676c=0xc8;}else{_0x3e676c=0xce;}_0x4858b9[_0xef43('0x2c')](_0x3e676c);return _0x4858b9[_0xef43('0x33')](_0xef43('0x34'),_0x44c402+'-'+_0x1f6951+'/'+_0x31e1f5)[_0xef43('0x2e')](_0x340f1f);}return null;};}function patchUpdates(_0x3dccb4){return function(_0x27a08b){try{jsonpatch[_0xef43('0x35')](_0x27a08b,_0x3dccb4,!![]);}catch(_0x20cacd){return BPromise[_0xef43('0x36')](_0x20cacd);}return _0x27a08b[_0xef43('0x37')]();};}function saveUpdates(_0x17a0ef,_0x4b15d1){return function(_0xb04786){if(_0xb04786){return _0xb04786['update'](_0x17a0ef)['then'](function(_0x16a1eb){return _0x16a1eb;});}return null;};}function removeEntity(_0x49b933,_0xa6c8d8){return function(_0x117113){if(_0x117113){return _0x117113[_0xef43('0x38')]()[_0xef43('0x39')](function(){_0x49b933['status'](0xcc)[_0xef43('0x2d')]();});}};}function handleEntityNotFound(_0x23c920,_0x3e697e){return function(_0x2630c9){if(!_0x2630c9){_0x23c920[_0xef43('0x3a')](0x194);}return _0x2630c9;};}function handleError(_0x627df0,_0x1f7a80){_0x1f7a80=_0x1f7a80||0x1f4;return function(_0x348b2b){logger['error'](_0x348b2b[_0xef43('0x3b')]);if(_0x348b2b[_0xef43('0x3c')]){delete _0x348b2b['name'];}_0x627df0[_0xef43('0x2c')](_0x1f7a80)[_0xef43('0x3d')](_0x348b2b);};}exports[_0xef43('0x3e')]=function(_0x2ae9b9,_0x3f7898){var _0xbda886={},_0x535254={},_0x4fd450={'count':0x0,'rows':[]};var _0x5f86c6=_[_0xef43('0x3f')](db['WhatsappMessage'][_0xef43('0x40')],function(_0x4a0526){return{'name':_0x4a0526[_0xef43('0x41')],'type':_0x4a0526[_0xef43('0x42')]['key']};});_0x535254['model']=_[_0xef43('0x3f')](_0x5f86c6,'name');_0x535254[_0xef43('0x43')]=_['keys'](_0x2ae9b9[_0xef43('0x43')]);_0x535254[_0xef43('0x44')]=_[_0xef43('0x45')](_0x535254[_0xef43('0x46')],_0x535254[_0xef43('0x43')]);_0xbda886[_0xef43('0x47')]=_['intersection'](_0x535254['model'],qs[_0xef43('0x48')](_0x2ae9b9[_0xef43('0x43')][_0xef43('0x48')]));_0xbda886[_0xef43('0x47')]=_0xbda886[_0xef43('0x47')]['length']?_0xbda886[_0xef43('0x47')]:_0x535254[_0xef43('0x46')];if(!_0x2ae9b9[_0xef43('0x43')][_0xef43('0x49')](_0xef43('0x4a'))){_0xbda886[_0xef43('0x31')]=qs[_0xef43('0x31')](_0x2ae9b9[_0xef43('0x43')]['limit']);_0xbda886['offset']=qs['offset'](_0x2ae9b9[_0xef43('0x43')][_0xef43('0x2f')]);}_0xbda886[_0xef43('0x4b')]=qs[_0xef43('0x4c')](_0x2ae9b9['query'][_0xef43('0x4c')]);_0xbda886[_0xef43('0x4d')]=qs['filters'](_[_0xef43('0x4e')](_0x2ae9b9[_0xef43('0x43')],_0x535254[_0xef43('0x44')]),_0x5f86c6);if(_0x2ae9b9[_0xef43('0x43')][_0xef43('0x4f')]){_0xbda886['where']=_['merge'](_0xbda886[_0xef43('0x4d')],{'$or':_[_0xef43('0x3f')](_0x5f86c6,function(_0x3764eb){if(_0x3764eb[_0xef43('0x42')]!==_0xef43('0x50')){var _0x1a92ef={};_0x1a92ef[_0x3764eb[_0xef43('0x3c')]]={'$like':'%'+_0x2ae9b9[_0xef43('0x43')][_0xef43('0x4f')]+'%'};return _0x1a92ef;}})});}_0xbda886=_[_0xef43('0x51')]({},_0xbda886,_0x2ae9b9['options']);var _0x17cb4a={'where':_0xbda886[_0xef43('0x4d')]};return db[_0xef43('0x52')][_0xef43('0x32')](_0x17cb4a)[_0xef43('0x39')](function(_0xb90f5d){_0x4fd450[_0xef43('0x32')]=_0xb90f5d;if(_0x2ae9b9[_0xef43('0x43')]['includeAll']){_0xbda886[_0xef43('0x53')]=[{'all':!![]}];}return db[_0xef43('0x52')][_0xef43('0x54')](_0xbda886);})[_0xef43('0x39')](function(_0x2cf9ff){_0x4fd450[_0xef43('0x55')]=_0x2cf9ff;return _0x4fd450;})['then'](respondWithFilteredResult(_0x3f7898,_0xbda886))['catch'](handleError(_0x3f7898,null));};exports[_0xef43('0x56')]=function(_0x48cb53,_0x5e3777){var _0x39ae65={'raw':!![],'where':{'id':_0x48cb53['params']['id']}},_0x16c45b={};_0x16c45b['model']=_[_0xef43('0x57')](db[_0xef43('0x52')][_0xef43('0x40')]);_0x16c45b[_0xef43('0x43')]=_[_0xef43('0x57')](_0x48cb53[_0xef43('0x43')]);_0x16c45b[_0xef43('0x44')]=_[_0xef43('0x45')](_0x16c45b[_0xef43('0x46')],_0x16c45b[_0xef43('0x43')]);_0x39ae65[_0xef43('0x47')]=_['intersection'](_0x16c45b[_0xef43('0x46')],qs[_0xef43('0x48')](_0x48cb53[_0xef43('0x43')][_0xef43('0x48')]));_0x39ae65[_0xef43('0x47')]=_0x39ae65['attributes']['length']?_0x39ae65[_0xef43('0x47')]:_0x16c45b[_0xef43('0x46')];if(_0x48cb53[_0xef43('0x43')][_0xef43('0x58')]){_0x39ae65[_0xef43('0x53')]=[{'all':!![]}];}_0x39ae65=_['merge']({},_0x39ae65,_0x48cb53[_0xef43('0x59')]);return db[_0xef43('0x52')]['find'](_0x39ae65)[_0xef43('0x39')](handleEntityNotFound(_0x5e3777,null))[_0xef43('0x39')](respondWithResult(_0x5e3777,null))[_0xef43('0x2b')](handleError(_0x5e3777,null));};exports['create']=function(_0x265fc5,_0x4b9ad3){return db['WhatsappMessage'][_0xef43('0x5a')](_0x265fc5[_0xef43('0x5b')],{})[_0xef43('0x39')](respondWithResult(_0x4b9ad3,0xc9))[_0xef43('0x2b')](handleError(_0x4b9ad3,null));};exports['update']=function(_0x21401b,_0x1b2229){if(_0x21401b[_0xef43('0x5b')]['id']){delete _0x21401b['body']['id'];}return db['WhatsappMessage'][_0xef43('0x5c')]({'where':{'id':_0x21401b[_0xef43('0x5d')]['id']}})[_0xef43('0x39')](handleEntityNotFound(_0x1b2229,null))['then'](saveUpdates(_0x21401b['body'],null))[_0xef43('0x39')](respondWithResult(_0x1b2229,null))[_0xef43('0x2b')](handleError(_0x1b2229,null));};exports['destroy']=function(_0xac3799,_0x2ea72c){return db[_0xef43('0x52')][_0xef43('0x5c')]({'where':{'id':_0xac3799['params']['id']}})[_0xef43('0x39')](handleEntityNotFound(_0x2ea72c,null))[_0xef43('0x39')](removeEntity(_0x2ea72c,null))[_0xef43('0x2b')](handleError(_0x2ea72c,null));};exports['describe']=function(_0x3531ff,_0x84d276){return db[_0xef43('0x52')][_0xef43('0x5e')]()['then'](respondWithResult(_0x84d276,null))['catch'](handleError(_0x84d276,null));};var interaction_log=require(_0xef43('0x14'))(_0xef43('0x5f'));exports['accept']=function(_0x3cf3a3,_0x4ce809,_0x27f46d){var _0x32248e={'agent':{},'channel':_0xef43('0x60')};if(_0x3cf3a3[_0xef43('0x5b')]['id']){delete _0x3cf3a3[_0xef43('0x5b')]['id'];}_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x61')]=!![];_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x62')]=moment()[_0xef43('0x63')](_0xef43('0x64'));_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x65')]=_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x65')]||_0x3cf3a3[_0xef43('0x66')]['id'];_0x32248e[_0xef43('0x67')]['id']=_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x65')];return db[_0xef43('0x52')][_0xef43('0x5c')]({'where':{'id':_0x3cf3a3[_0xef43('0x5d')]['id'],'UserId':null}})[_0xef43('0x39')](handleEntityNotFound(_0x4ce809,null))[_0xef43('0x39')](saveUpdates(_0x3cf3a3[_0xef43('0x5b')],null))[_0xef43('0x39')](function(_0x11578c){if(_0x11578c){_0x32248e['message']=_0x11578c[_0xef43('0x68')]({'plain':!![]});return db['WhatsappInteraction'][_0xef43('0x5c')]({'where':{'id':_0x11578c['WhatsappInteractionId']}});}return null;})[_0xef43('0x39')](handleEntityNotFound(_0x4ce809,null))[_0xef43('0x39')](function(_0x3c7710){if(_0x3c7710){return _0x3c7710[_0xef43('0x69')]({'UserId':_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x65')],'read1stAt':_[_0xef43('0x6a')](_0x3c7710[_0xef43('0x6b')])?moment()[_0xef43('0x63')](_0xef43('0x64')):undefined});}return null;})[_0xef43('0x39')](function(_0x57dbc5){if(_0x57dbc5){_0x32248e[_0xef43('0x6c')]=_0x57dbc5[_0xef43('0x68')]({'plain':!![]});interaction_log['info'](_0xef43('0x6d'),_0x3cf3a3[_0xef43('0x66')]['id'],_0x3cf3a3[_0xef43('0x66')]['name'],_0x3cf3a3[_0xef43('0x66')][_0xef43('0x6e')],_0x32248e['interaction']['id'],_0x3cf3a3[_0xef43('0x5b')]?JSON[_0xef43('0x24')](_0x3cf3a3[_0xef43('0x5b')]):'null');return respondWithRpcPromise(_0xef43('0x6f'),_0xef43('0x70'),_0x32248e);}return null;})[_0xef43('0x39')](function(_0x2b73c7){var _0x2700bc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b73c7['message'][_0xef43('0x71')];return db[_0xef43('0x72')][_0xef43('0x43')](_0x2700bc,{'type':db[_0xef43('0x73')]['QueryTypes'][_0xef43('0x74')],'raw':!![]})[_0xef43('0x39')](function(_0x128ac8){return _0x128ac8;});})[_0xef43('0x39')](function(_0x356f9e){if(_0x356f9e){_0x32248e[_0xef43('0x28')][_0xef43('0x75')]=_0x356f9e[0x0];if(!_0x3cf3a3[_0xef43('0x5b')]['UserId'])return;return db[_0xef43('0x76')][_0xef43('0x5c')]({'where':{'id':_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x65')],'role':'agent'},'attributes':['id',_0xef43('0x3c'),'fullname',_0xef43('0x77'),'internal'],'raw':!![]});}return null;})[_0xef43('0x39')](function(_0xbba279){if(!_0xbba279)return null;_0x32248e[_0xef43('0x28')]['agent']=_0xbba279;return _0x32248e;})['then'](function(_0x7e48a2){if(_0x7e48a2){if(_0x3cf3a3[_0xef43('0x5b')][_0xef43('0x78')]){_0x32248e['message'][_0xef43('0x79')]=util[_0xef43('0x63')](_0xef43('0x7a'),_0x3cf3a3[_0xef43('0x66')][_0xef43('0x3c')]);_0x32248e[_0xef43('0x28')][_0xef43('0x7b')]=_0x32248e[_0xef43('0x7b')];_0x32248e[_0xef43('0x28')]['motionChannel']=_0x32248e['channel'];_0x32248e[_0xef43('0x28')][_0xef43('0x7c')]=_0xef43('0x7d');return respondWithRpcPromise('EventManager',_0xef43('0x7e'),{'event':_0xef43('0x7f'),'message':_0x32248e[_0xef43('0x28')]},client9002)[_0xef43('0x39')](function(){return _0x32248e;});}return _0x32248e;}return null;})['then'](respondWithResult(_0x4ce809,null))['catch'](handleError(_0x4ce809,null));};var interaction_log=require(_0xef43('0x14'))(_0xef43('0x5f'));exports[_0xef43('0x36')]=function(_0x17e1b1,_0x1d5b52,_0x3657fd){var _0x53165e={'agent':{},'channel':'whatsapp'};if(_0x17e1b1[_0xef43('0x5b')]['id']){delete _0x17e1b1[_0xef43('0x5b')]['id'];}_0x17e1b1[_0xef43('0x5b')][_0xef43('0x65')]=_0x17e1b1[_0xef43('0x5b')]['UserId']||_0x17e1b1[_0xef43('0x66')]['id'];_0x53165e[_0xef43('0x67')]['id']=_0x17e1b1['body'][_0xef43('0x65')];return db[_0xef43('0x52')][_0xef43('0x5c')]({'where':{'id':_0x17e1b1[_0xef43('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d5b52,null))[_0xef43('0x39')](function(_0x1fea5b){if(_0x1fea5b){_0x53165e[_0xef43('0x28')]=_0x1fea5b[_0xef43('0x68')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1fea5b[_0xef43('0x80')]}});}return null;})['then'](handleEntityNotFound(_0x1d5b52,null))['then'](function(_0x379d2){if(_0x379d2){_0x53165e[_0xef43('0x6c')]=_0x379d2['get']({'plain':!![]});interaction_log[_0xef43('0x29')](_0xef43('0x81'),_0x17e1b1[_0xef43('0x66')]['id'],_0x17e1b1['user'][_0xef43('0x3c')],_0x17e1b1['user'][_0xef43('0x6e')],_0x53165e[_0xef43('0x6c')]['id'],_0x17e1b1[_0xef43('0x5b')]?JSON[_0xef43('0x24')](_0x17e1b1[_0xef43('0x5b')]):'null');return respondWithRpcPromise(_0xef43('0x82'),_0xef43('0x83'),_0x53165e);}return null;})['then'](function(_0xb13f95){var _0xd33ab9=_0xef43('0x84')+_0xb13f95[_0xef43('0x28')]['ContactId'];return db[_0xef43('0x72')]['query'](_0xd33ab9,{'type':db['Sequelize'][_0xef43('0x85')][_0xef43('0x74')],'raw':!![]})[_0xef43('0x39')](function(_0x3e162b){return _0x3e162b;});})[_0xef43('0x39')](function(_0x1366a9){if(_0x1366a9){_0x53165e[_0xef43('0x28')][_0xef43('0x75')]=_0x1366a9[0x0];if(!_0x17e1b1[_0xef43('0x5b')][_0xef43('0x65')])return;return db[_0xef43('0x76')][_0xef43('0x5c')]({'where':{'id':_0x17e1b1[_0xef43('0x5b')][_0xef43('0x65')],'role':_0xef43('0x67')},'attributes':['id',_0xef43('0x3c'),_0xef43('0x86'),_0xef43('0x77'),'internal'],'raw':!![]});}return null;})[_0xef43('0x39')](function(_0x4159c7){if(!_0x4159c7)return null;_0x53165e[_0xef43('0x28')]['agent']=_0x4159c7;return _0x53165e;})[_0xef43('0x39')](function(_0xe649a0){if(_0xe649a0){_0xe649a0[_0xef43('0x28')]['interface']=util[_0xef43('0x63')](_0xef43('0x7a'),_0x17e1b1[_0xef43('0x66')][_0xef43('0x3c')]);_0xe649a0[_0xef43('0x28')][_0xef43('0x7b')]=_0x53165e[_0xef43('0x7b')];_0xe649a0[_0xef43('0x28')][_0xef43('0x87')]=_0x53165e[_0xef43('0x7b')];_0xe649a0[_0xef43('0x28')][_0xef43('0x7c')]=_0xef43('0x36');respondWithRpcPromise(_0xef43('0x7e'),_0xef43('0x7e'),{'event':_0xef43('0x88'),'message':_0xe649a0[_0xef43('0x28')]},client9002);return _0x53165e;}return null;})[_0xef43('0x39')](respondWithResult(_0x1d5b52,null))[_0xef43('0x2b')](handleError(_0x1d5b52,null));};exports['status']=function(_0xcb94f2,_0x3e86b0,_0x108177){if(_0xcb94f2[_0xef43('0x5b')]['id']){delete _0xcb94f2['body']['id'];}var _0x2b98ad;return db[_0xef43('0x52')][_0xef43('0x5c')]({'where':{'id':_0xcb94f2[_0xef43('0x5d')]['id']}})[_0xef43('0x39')](handleEntityNotFound(_0x3e86b0,null))[_0xef43('0x39')](function(_0x555e30){if(_0x555e30){_0x2b98ad=_0x555e30;return db[_0xef43('0x89')][_0xef43('0x5c')]({'where':{'id':_0x555e30['WhatsappAccountId']}});}})[_0xef43('0x39')](handleEntityNotFound(_0x3e86b0,null))['then'](function(_0x1047bb){if(_0x1047bb){logger[_0xef43('0x22')](_0xef43('0x8a'),_0xef43('0x2c'),_0xef43('0x8b'),_0x1047bb[_0xef43('0x42')],util[_0xef43('0x8c')](_0xcb94f2[_0xef43('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1047bb[_0xef43('0x42')]){case _0xef43('0x8d'):if(_0xcb94f2['body'][_0xef43('0x8e')]&&_0xcb94f2[_0xef43('0x5b')][_0xef43('0x8e')]===_0x2b98ad['messageId']&&_0xcb94f2[_0xef43('0x5b')][_0xef43('0x8f')]&&_0xcb94f2[_0xef43('0x5b')][_0xef43('0x8f')]==='read'){return _0x2b98ad['update']({'read':!![]});}else{logger[_0xef43('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xef43('0x2c'),_0xef43('0x8d'),util[_0xef43('0x8c')](_0xcb94f2[_0xef43('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x2b98ad;}})[_0xef43('0x39')](respondWithResult(_0x3e86b0,null))[_0xef43('0x2b')](handleError(_0x3e86b0,null));};
\ No newline at end of file
index fa89ed4..69c29aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4af8=['emit','hasOwnProperty','exports','save','update','remove'];(function(_0x5c4a2d,_0x439f24){var _0x1db64c=function(_0x9ad14d){while(--_0x9ad14d){_0x5c4a2d['push'](_0x5c4a2d['shift']());}};_0x1db64c(++_0x439f24);}(_0x4af8,0x1ad));var _0x84af=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x4af8[_0x397cfb];return _0x15fed9;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x84af('0x0'),'afterUpdate':_0x84af('0x1'),'afterDestroy':_0x84af('0x2')};function emitEvent(_0x1446d3){return function(_0x482825,_0x294e04,_0x83633){WhatsappMessageEvents['emit'](_0x1446d3+':'+_0x482825['id'],_0x482825);WhatsappMessageEvents[_0x84af('0x3')](_0x1446d3,_0x482825);_0x83633(null);};}for(var e in events){if(events[_0x84af('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x84af('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x9c5e=['save','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x15f972,_0x4a1fc7){var _0x3d916e=function(_0x4efd86){while(--_0x4efd86){_0x15f972['push'](_0x15f972['shift']());}};_0x3d916e(++_0x4a1fc7);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x1bd4ca,_0xa2ba6e){_0x1bd4ca=_0x1bd4ca-0x0;var _0x225d50=_0x9c5e[_0x1bd4ca];return _0x225d50;};'use strict';var EventEmitter=require(_0xe9c5('0x0'));var WhatsappMessage=require(_0xe9c5('0x1'))['db'][_0xe9c5('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xe9c5('0x3')](0x0);var events={'afterCreate':_0xe9c5('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x595373){return function(_0x120d2f,_0x13d5d7,_0x4fa4c5){WhatsappMessageEvents[_0xe9c5('0x5')](_0x595373+':'+_0x120d2f['id'],_0x120d2f);WhatsappMessageEvents[_0xe9c5('0x5')](_0x595373,_0x120d2f);_0x4fa4c5(null);};}for(var e in events){if(events[_0xe9c5('0x6')](e)){var event=events[e];WhatsappMessage[_0xe9c5('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index 4f3b85b..217b63e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32e6=['fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','then','createdAt','catch','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','/api/whatsapp/messages/','/status?token=','token','update','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','error','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId'];(function(_0x3d7365,_0x13ccfb){var _0x3d96ac=function(_0x24135e){while(--_0x24135e){_0x3d7365['push'](_0x3d7365['shift']());}};_0x3d96ac(++_0x13ccfb);}(_0x32e6,0x82));var _0x632e=function(_0x2c9d06,_0x2eb18c){_0x2c9d06=_0x2c9d06-0x0;var _0x2fef1b=_0x32e6[_0x2c9d06];return _0x2fef1b;};'use strict';var _=require(_0x632e('0x0'));var util=require(_0x632e('0x1'));var logger=require(_0x632e('0x2'))(_0x632e('0x3'));var moment=require(_0x632e('0x4'));var BPromise=require('bluebird');var rp=require(_0x632e('0x5'));var fs=require('fs');var path=require(_0x632e('0x6'));var rimraf=require(_0x632e('0x7'));var config=require('../../config/environment');var attributes=require(_0x632e('0x8'));module[_0x632e('0x9')]=function(_0x1abc27,_0x1d2800){return _0x1abc27[_0x632e('0xa')](_0x632e('0xb'),attributes,{'tableName':_0x632e('0xc'),'paranoid':![],'indexes':[{'name':_0x632e('0xd'),'fields':['messageId']},{'name':_0x632e('0xe'),'fields':[_0x632e('0xf')],'type':_0x632e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b8917,_0x582d06,_0x2b783c){var _0x10c92c=_0x1abc27[_0x632e('0x11')];var _0x4169db=_0x5b8917[_0x632e('0x12')]({'plain':!![]});if(_0x4169db[_0x632e('0x13')]['toLowerCase']()==='in'||_0x4169db[_0x632e('0x13')][_0x632e('0x14')]()===_0x632e('0x15')&&!_0x4169db[_0x632e('0x16')]&&!_[_0x632e('0x17')](_0x4169db[_0x632e('0x18')])){_0x10c92c[_0x632e('0x19')][_0x632e('0x1a')]({'where':{'id':_0x4169db['WhatsappInteractionId']}})[_0x632e('0x1b')](function(_0x13da4c){if(_0x13da4c){_0x13da4c['update']({'lastMsgAt':_0x4169db[_0x632e('0x1c')],'lastMsgDirection':_0x4169db[_0x632e('0x13')][_0x632e('0x14')]()});}})[_0x632e('0x1d')](function(_0x266df1){console['error'](_0x266df1);});}if(_0x4169db[_0x632e('0x13')]===_0x632e('0x15')&&!_0x4169db['secret']){var _0x244ad3;_0x10c92c['WhatsappAccount']['find']({'where':{'id':_0x4169db[_0x632e('0x1e')]},'raw':!![]})[_0x632e('0x1b')](function(_0x1996d6){_0x244ad3=_0x1996d6;if(_0x244ad3&&_0x244ad3[_0x632e('0x1f')]){switch(_0x244ad3[_0x632e('0x1f')]){case _0x632e('0x20'):var _0x1a83de=require(_0x632e('0x20'));if(_0x244ad3[_0x632e('0x21')]&&_0x244ad3[_0x632e('0x22')]&&_0x244ad3[_0x632e('0x23')]){var _0x439555=new _0x1a83de(_0x244ad3['accountSid'],_0x244ad3[_0x632e('0x22')]);_0x439555[_0x632e('0x24')]['create']({'body':_0x4169db[_0x632e('0xf')],'to':_0x632e('0x25')+_0x4169db[_0x632e('0x23')],'from':_0x632e('0x25')+_0x244ad3[_0x632e('0x23')],'statusCallback':_0x244ad3['remote']+_0x632e('0x26')+_0x4169db['id']+_0x632e('0x27')+_0x244ad3[_0x632e('0x28')]})['then'](function(_0x161198){if(_0x161198['sid']){return _0x5b8917[_0x632e('0x29')]({'messageId':_0x161198[_0x632e('0x2a')]});}})[_0x632e('0x1d')](function(_0x1fc947){logger['error'](_0x632e('0x2b'),'afterCreate','twilio',util[_0x632e('0x2c')](_0x1fc947,{'showHidden':![],'depth':null}));});}else{logger[_0x632e('0x2d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x632e('0x2e')](function(){_0x2b783c();});}else{_0x2b783c();}}},'charset':_0x632e('0x2f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb01a=['createdAt','catch','WhatsappAccount','then','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','update'];(function(_0xcbe654,_0x2783cc){var _0x36421a=function(_0x499efd){while(--_0x499efd){_0xcbe654['push'](_0xcbe654['shift']());}};_0x36421a(++_0x2783cc);}(_0xb01a,0xe0));var _0xab01=function(_0x3eed3f,_0x5253b5){_0x3eed3f=_0x3eed3f-0x0;var _0xd68fd8=_0xb01a[_0x3eed3f];return _0xd68fd8;};'use strict';var _=require(_0xab01('0x0'));var util=require(_0xab01('0x1'));var logger=require(_0xab01('0x2'))(_0xab01('0x3'));var moment=require(_0xab01('0x4'));var BPromise=require(_0xab01('0x5'));var rp=require(_0xab01('0x6'));var fs=require('fs');var path=require(_0xab01('0x7'));var rimraf=require(_0xab01('0x8'));var config=require(_0xab01('0x9'));var attributes=require(_0xab01('0xa'));module['exports']=function(_0x502e33,_0x4ff501){return _0x502e33[_0xab01('0xb')]('WhatsappMessage',attributes,{'tableName':_0xab01('0xc'),'paranoid':![],'indexes':[{'name':_0xab01('0xd'),'fields':[_0xab01('0xd')]},{'name':_0xab01('0xe'),'fields':[_0xab01('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8db7eb,_0x3ee077,_0x428412){var _0x355c13=_0x502e33[_0xab01('0x10')];var _0x28972b=_0x8db7eb['get']({'plain':!![]});if(_0x28972b[_0xab01('0x11')]['toLowerCase']()==='in'||_0x28972b[_0xab01('0x11')][_0xab01('0x12')]()===_0xab01('0x13')&&!_0x28972b[_0xab01('0x14')]&&!_[_0xab01('0x15')](_0x28972b[_0xab01('0x16')])){_0x355c13[_0xab01('0x17')]['findOne']({'where':{'id':_0x28972b[_0xab01('0x18')]}})['then'](function(_0x5b527a){if(_0x5b527a){_0x5b527a[_0xab01('0x19')]({'lastMsgAt':_0x28972b[_0xab01('0x1a')],'lastMsgDirection':_0x28972b[_0xab01('0x11')]['toLowerCase']()});}})[_0xab01('0x1b')](function(_0x1e366e){console['error'](_0x1e366e);});}if(_0x28972b[_0xab01('0x11')]==='out'&&!_0x28972b[_0xab01('0x14')]){var _0x539809;_0x355c13[_0xab01('0x1c')]['find']({'where':{'id':_0x28972b['WhatsappAccountId']},'raw':!![]})[_0xab01('0x1d')](function(_0x30117b){_0x539809=_0x30117b;if(_0x539809&&_0x539809[_0xab01('0x1e')]){switch(_0x539809['type']){case'twilio':var _0x182693=require(_0xab01('0x1f'));if(_0x539809['accountSid']&&_0x539809[_0xab01('0x20')]&&_0x539809[_0xab01('0x21')]){var _0x139660=new _0x182693(_0x539809[_0xab01('0x22')],_0x539809['authToken']);_0x139660[_0xab01('0x23')][_0xab01('0x24')]({'body':_0x28972b[_0xab01('0xf')],'to':_0xab01('0x25')+_0x28972b[_0xab01('0x21')],'from':_0xab01('0x25')+_0x539809[_0xab01('0x21')],'statusCallback':_0x539809[_0xab01('0x26')]+_0xab01('0x27')+_0x28972b['id']+_0xab01('0x28')+_0x539809[_0xab01('0x29')]})['then'](function(_0x148a3d){if(_0x148a3d[_0xab01('0x2a')]){return _0x8db7eb[_0xab01('0x19')]({'messageId':_0x148a3d[_0xab01('0x2a')]});}})[_0xab01('0x1b')](function(_0x30e8f9){logger[_0xab01('0x2b')](_0xab01('0x2c'),_0xab01('0x2d'),'twilio',util[_0xab01('0x2e')](_0x30e8f9,{'showHidden':![],'depth':null}));});}else{logger[_0xab01('0x2b')](_0xab01('0x2c'),_0xab01('0x2d'),_0xab01('0x1f'),_0xab01('0x2f'));}break;}}})['finally'](function(){_0x428412();});}else{_0x428412();}}},'charset':_0xab01('0x30'),'collate':_0xab01('0x31')});};
\ No newline at end of file
index 54d47f0..8464836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd75=['ioredis','../../mysqldb','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappMessage','WhatsappMessage','create','options','raw','catch','lodash','moment','bluebird','randomstring'];(function(_0x3724d1,_0x2f4c95){var _0x5700d5=function(_0x33bdbb){while(--_0x33bdbb){_0x3724d1['push'](_0x3724d1['shift']());}};_0x5700d5(++_0x2f4c95);}(_0xdd75,0x1be));var _0x5dd7=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xdd75[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x5dd7('0x0'));var util=require('util');var moment=require(_0x5dd7('0x1'));var BPromise=require(_0x5dd7('0x2'));var rs=require(_0x5dd7('0x3'));var fs=require('fs');var Redis=require(_0x5dd7('0x4'));var db=require(_0x5dd7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5dd7('0x6'));var config=require(_0x5dd7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5dd7('0x8')]['http']({'port':0x232a});config[_0x5dd7('0x9')]=_['defaults'](config[_0x5dd7('0x9')],{'host':_0x5dd7('0xa'),'port':0x18eb});var socket=require(_0x5dd7('0xb'))(new Redis(config[_0x5dd7('0x9')]));require(_0x5dd7('0xc'))[_0x5dd7('0xd')](socket);function respondWithRpcPromise(_0x3f9ed7,_0x4206b8,_0x29b001){return new BPromise(function(_0x5c61a9,_0x37a9d6){return client[_0x5dd7('0xe')](_0x3f9ed7,_0x29b001)[_0x5dd7('0xf')](function(_0x683cf6){logger[_0x5dd7('0x10')](_0x5dd7('0x11'),_0x4206b8,_0x5dd7('0x12'));logger['debug'](_0x5dd7('0x13'),_0x4206b8,_0x5dd7('0x12'),JSON[_0x5dd7('0x14')](_0x683cf6));if(_0x683cf6[_0x5dd7('0x15')]){if(_0x683cf6[_0x5dd7('0x15')]['code']===0x1f4){logger[_0x5dd7('0x15')](_0x5dd7('0x11'),_0x4206b8,_0x683cf6['error'][_0x5dd7('0x16')]);return _0x37a9d6(_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);}logger[_0x5dd7('0x15')](_0x5dd7('0x11'),_0x4206b8,_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);return _0x5c61a9(_0x683cf6[_0x5dd7('0x15')][_0x5dd7('0x16')]);}else{logger[_0x5dd7('0x10')](_0x5dd7('0x11'),_0x4206b8,'request\x20sent');_0x5c61a9(_0x683cf6[_0x5dd7('0x17')][_0x5dd7('0x16')]);}})['catch'](function(_0xba1652){logger['error'](_0x5dd7('0x11'),_0x4206b8,_0xba1652);_0x37a9d6(_0xba1652);});});}exports[_0x5dd7('0x18')]=function(_0x3ff58e){var _0x5d257e=this;return new Promise(function(_0x492150,_0x24d921){return db[_0x5dd7('0x19')][_0x5dd7('0x1a')](_0x3ff58e['body'],{'raw':_0x3ff58e[_0x5dd7('0x1b')]?_0x3ff58e['options'][_0x5dd7('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3093c2){logger[_0x5dd7('0x10')](_0x5dd7('0x18'),_0x3ff58e);logger['debug'](_0x5dd7('0x18'),_0x3ff58e,JSON[_0x5dd7('0x14')](_0x3093c2));_0x492150(_0x3093c2);})[_0x5dd7('0x1d')](function(_0x38db0f){logger[_0x5dd7('0x15')](_0x5dd7('0x18'),_0x38db0f[_0x5dd7('0x16')],_0x3ff58e);_0x24d921(_0x5d257e[_0x5dd7('0x15')](0x1f4,_0x38db0f[_0x5dd7('0x16')]));});});};
\ No newline at end of file
+var _0xa976=['WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info'];(function(_0x6cbff6,_0x3b59f8){var _0x390e52=function(_0xff24a){while(--_0xff24a){_0x6cbff6['push'](_0x6cbff6['shift']());}};_0x390e52(++_0x3b59f8);}(_0xa976,0x116));var _0x6a97=function(_0x513c8c,_0xb78db3){_0x513c8c=_0x513c8c-0x0;var _0x391657=_0xa976[_0x513c8c];return _0x391657;};'use strict';var _=require(_0x6a97('0x0'));var util=require(_0x6a97('0x1'));var moment=require('moment');var BPromise=require(_0x6a97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a97('0x3'));var db=require(_0x6a97('0x4'))['db'];var utils=require(_0x6a97('0x5'));var logger=require(_0x6a97('0x6'))(_0x6a97('0x7'));var config=require('../../config/environment');var jayson=require(_0x6a97('0x8'));var client=jayson[_0x6a97('0x9')][_0x6a97('0xa')]({'port':0x232a});config[_0x6a97('0xb')]=_[_0x6a97('0xc')](config['redis'],{'host':_0x6a97('0xd'),'port':0x18eb});var socket=require(_0x6a97('0xe'))(new Redis(config[_0x6a97('0xb')]));require(_0x6a97('0xf'))[_0x6a97('0x10')](socket);function respondWithRpcPromise(_0x1ea7c1,_0x210d1e,_0x31828e){return new BPromise(function(_0x4336b6,_0x2e3b2c){return client['request'](_0x1ea7c1,_0x31828e)[_0x6a97('0x11')](function(_0x1de2f7){logger[_0x6a97('0x12')](_0x6a97('0x13'),_0x210d1e,_0x6a97('0x14'));logger['debug'](_0x6a97('0x15'),_0x210d1e,_0x6a97('0x14'),JSON[_0x6a97('0x16')](_0x1de2f7));if(_0x1de2f7['error']){if(_0x1de2f7[_0x6a97('0x17')]['code']===0x1f4){logger['error'](_0x6a97('0x13'),_0x210d1e,_0x1de2f7[_0x6a97('0x17')]['message']);return _0x2e3b2c(_0x1de2f7[_0x6a97('0x17')][_0x6a97('0x18')]);}logger['error'](_0x6a97('0x13'),_0x210d1e,_0x1de2f7[_0x6a97('0x17')][_0x6a97('0x18')]);return _0x4336b6(_0x1de2f7[_0x6a97('0x17')]['message']);}else{logger[_0x6a97('0x12')](_0x6a97('0x13'),_0x210d1e,_0x6a97('0x14'));_0x4336b6(_0x1de2f7[_0x6a97('0x19')][_0x6a97('0x18')]);}})[_0x6a97('0x1a')](function(_0x2cbcda){logger[_0x6a97('0x17')](_0x6a97('0x13'),_0x210d1e,_0x2cbcda);_0x2e3b2c(_0x2cbcda);});});}exports[_0x6a97('0x1b')]=function(_0x1438c8){var _0x4c7916=this;return new Promise(function(_0x396b34,_0x2caf81){return db[_0x6a97('0x1c')][_0x6a97('0x1d')](_0x1438c8[_0x6a97('0x1e')],{'raw':_0x1438c8[_0x6a97('0x1f')]?_0x1438c8[_0x6a97('0x1f')][_0x6a97('0x20')]===undefined?!![]:![]:!![]})[_0x6a97('0x11')](function(_0x26f848){logger[_0x6a97('0x12')](_0x6a97('0x1b'),_0x1438c8);logger['debug'](_0x6a97('0x1b'),_0x1438c8,JSON[_0x6a97('0x16')](_0x26f848));_0x396b34(_0x26f848);})[_0x6a97('0x1a')](function(_0x20df27){logger[_0x6a97('0x17')](_0x6a97('0x1b'),_0x20df27[_0x6a97('0x18')],_0x1438c8);_0x2caf81(_0x4c7916[_0x6a97('0x17')](0x1f4,_0x20df27[_0x6a97('0x18')]));});});};
\ No newline at end of file
index 9f3d4c2..335edf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd946=['update','removeListener','register','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x4be326,_0xcae821){var _0x46d1d0=function(_0x29958a){while(--_0x29958a){_0x4be326['push'](_0x4be326['shift']());}};_0x46d1d0(++_0xcae821);}(_0xd946,0x169));var _0x6d94=function(_0x3f83d4,_0x265536){_0x3f83d4=_0x3f83d4-0x0;var _0x5990a4=_0xd946[_0x3f83d4];return _0x5990a4;};'use strict';var WhatsappMessageEvents=require(_0x6d94('0x0'));var events=[_0x6d94('0x1'),_0x6d94('0x2'),_0x6d94('0x3')];function createListener(_0x3e953f,_0x505ab9){return function(_0x56b048){_0x505ab9['emit'](_0x3e953f,_0x56b048);};}function removeListener(_0x4a90ba,_0x52dd7a){return function(){WhatsappMessageEvents[_0x6d94('0x4')](_0x4a90ba,_0x52dd7a);};}exports[_0x6d94('0x5')]=function(_0x2178f5){for(var _0x2a15b2=0x0,_0xf4fa4=events['length'];_0x2a15b2<_0xf4fa4;_0x2a15b2++){var _0x8669ee=events[_0x2a15b2];var _0x25a381=createListener(_0x6d94('0x6')+_0x8669ee,_0x2178f5);WhatsappMessageEvents['on'](_0x8669ee,_0x25a381);}};
\ No newline at end of file
+var _0x802b=['length','whatsappMessage:','emit','removeListener'];(function(_0x270595,_0x101701){var _0x4c2305=function(_0x3ef553){while(--_0x3ef553){_0x270595['push'](_0x270595['shift']());}};_0x4c2305(++_0x101701);}(_0x802b,0xa2));var _0xb802=function(_0x175fbe,_0xad639a){_0x175fbe=_0x175fbe-0x0;var _0x5be67e=_0x802b[_0x175fbe];return _0x5be67e;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save','remove','update'];function createListener(_0x27ed1f,_0x6712d9){return function(_0x29e049){_0x6712d9[_0xb802('0x0')](_0x27ed1f,_0x29e049);};}function removeListener(_0x4acd8f,_0x17cd0a){return function(){WhatsappMessageEvents[_0xb802('0x1')](_0x4acd8f,_0x17cd0a);};}exports['register']=function(_0x166dc9){for(var _0x403d56=0x0,_0x11d8b6=events[_0xb802('0x2')];_0x403d56<_0x11d8b6;_0x403d56++){var _0x43c8c4=events[_0x403d56];var _0x147b22=createListener(_0xb802('0x3')+_0x43c8c4,_0x166dc9);WhatsappMessageEvents['on'](_0x43c8c4,_0x147b22);}};
\ No newline at end of file
index cf9369b..62d8b24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9ab=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','update','delete','removeTeams','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9ab,0x65));var _0xbc9a=function(_0xdd999,_0x2c94cf){_0xdd999=_0xdd999-0x0;var _0x3e0e5a=_0xc9ab[_0xdd999];return _0x3e0e5a;};'use strict';var multer=require(_0xbc9a('0x0'));var util=require('util');var path=require(_0xbc9a('0x1'));var timeout=require(_0xbc9a('0x2'));var express=require(_0xbc9a('0x3'));var router=express['Router']();var fs_extra=require(_0xbc9a('0x4'));var auth=require(_0xbc9a('0x5'));var interaction=require(_0xbc9a('0x6'));var config=require(_0xbc9a('0x7'));var controller=require(_0xbc9a('0x8'));router[_0xbc9a('0x9')]('/',auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xb')]);router['get'](_0xbc9a('0xc'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xd')]);router[_0xbc9a('0x9')](_0xbc9a('0xe'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0xf')]);router['get'](_0xbc9a('0x10'),auth[_0xbc9a('0xa')](),controller['getMembers']);router[_0xbc9a('0x9')](_0xbc9a('0x11'),auth['isAuthenticated'](),controller[_0xbc9a('0x12')]);router[_0xbc9a('0x9')](_0xbc9a('0x13'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x14')]);router[_0xbc9a('0x15')]('/',auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x16')]);router['post'](_0xbc9a('0x11'),auth[_0xbc9a('0xa')](),controller['addTeams']);router[_0xbc9a('0x15')]('/:id/users',auth[_0xbc9a('0xa')](),controller['addAgents']);router[_0xbc9a('0x17')](_0xbc9a('0xe'),auth['isAuthenticated'](),controller[_0xbc9a('0x18')]);router[_0xbc9a('0x19')](_0xbc9a('0xe'),auth[_0xbc9a('0xa')](),controller['destroy']);router[_0xbc9a('0x19')](_0xbc9a('0x11'),auth[_0xbc9a('0xa')](),controller[_0xbc9a('0x1a')]);router[_0xbc9a('0x19')](_0xbc9a('0x13'),auth[_0xbc9a('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xb408=['/:id/members','getMembers','getTeams','/:id/users','getAgents','post','addTeams','put','delete','destroy','/:id/teams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0xb408,0x15f));var _0x8b40=function(_0x1e84ff,_0x354f81){_0x1e84ff=_0x1e84ff-0x0;var _0x244512=_0xb408[_0x1e84ff];return _0x244512;};'use strict';var multer=require(_0x8b40('0x0'));var util=require(_0x8b40('0x1'));var path=require('path');var timeout=require(_0x8b40('0x2'));var express=require(_0x8b40('0x3'));var router=express['Router']();var fs_extra=require(_0x8b40('0x4'));var auth=require(_0x8b40('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x8b40('0x6')]('/',auth[_0x8b40('0x7')](),controller[_0x8b40('0x8')]);router[_0x8b40('0x6')](_0x8b40('0x9'),auth[_0x8b40('0x7')](),controller[_0x8b40('0xa')]);router[_0x8b40('0x6')](_0x8b40('0xb'),auth['isAuthenticated'](),controller[_0x8b40('0xc')]);router[_0x8b40('0x6')](_0x8b40('0xd'),auth[_0x8b40('0x7')](),controller[_0x8b40('0xe')]);router[_0x8b40('0x6')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8b40('0xf')]);router[_0x8b40('0x6')](_0x8b40('0x10'),auth['isAuthenticated'](),controller[_0x8b40('0x11')]);router[_0x8b40('0x12')]('/',auth[_0x8b40('0x7')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x8b40('0x13')]);router[_0x8b40('0x12')](_0x8b40('0x10'),auth[_0x8b40('0x7')](),controller['addAgents']);router[_0x8b40('0x14')]('/:id',auth[_0x8b40('0x7')](),controller['update']);router[_0x8b40('0x15')](_0x8b40('0xb'),auth[_0x8b40('0x7')](),controller[_0x8b40('0x16')]);router[_0x8b40('0x15')](_0x8b40('0x17'),auth[_0x8b40('0x7')](),controller['removeTeams']);router[_0x8b40('0x15')]('/:id/users',auth[_0x8b40('0x7')](),controller[_0x8b40('0x18')]);module[_0x8b40('0x19')]=router;
\ No newline at end of file
index ba741c6..8b0f3f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee11=['INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','name'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0xee11,0x146));var _0x1ee1=function(_0x124d74,_0x18eda2){_0x124d74=_0x124d74-0x0;var _0x46418e=_0xee11[_0x124d74];return _0x46418e;};'use strict';var Sequelize=require(_0x1ee1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1ee1('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1ee1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ee1('0x3')](_0x1ee1('0x4'),_0x1ee1('0x5'),_0x1ee1('0x6'))},'description':{'type':Sequelize[_0x1ee1('0x7')]}};
\ No newline at end of file
+var _0xf9f7=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x775b8a,_0x3fe3f4){var _0x4164cf=function(_0x482a52){while(--_0x482a52){_0x775b8a['push'](_0x775b8a['shift']());}};_0x4164cf(++_0x3fe3f4);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x37e0a8,_0x184bc8){_0x37e0a8=_0x37e0a8-0x0;var _0x5ca63c=_0xf9f7[_0x37e0a8];return _0x5ca63c;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'name':{'type':Sequelize[_0x7f9f('0x2')],'unique':_0x7f9f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x7f9f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7f9f('0x5')]('rrmemory','beepall',_0x7f9f('0x6'))},'description':{'type':Sequelize[_0x7f9f('0x2')]}};
\ No newline at end of file
index d941175..4e8931b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde1d=['fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','WhatsappQueue','includeAll','catch','show','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','nolimit','order','User','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','ids','findAll','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','UserWhatsappQueue','forEach','emit','userWhatsappQueue:save','removeTeams','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','includes','union','value','removeAgents','userWhatsappQueue:remove','addAgents','spread','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','sox','fs-extra','lodash','crypto','jsforce','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','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes'];(function(_0x2a2cb4,_0x1347cc){var _0x4a8374=function(_0x21f531){while(--_0x21f531){_0x2a2cb4['push'](_0x2a2cb4['shift']());}};_0x4a8374(++_0x1347cc);}(_0xde1d,0x162));var _0xdde1=function(_0x57252a,_0x1ceae9){_0x57252a=_0x57252a-0x0;var _0x2733a8=_0xde1d[_0x57252a];return _0x2733a8;};'use strict';var emlformat=require(_0xdde1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdde1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdde1('0x2'));var moment=require(_0xdde1('0x3'));var BPromise=require(_0xdde1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xdde1('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdde1('0x6'));var _=require(_0xdde1('0x7'));var squel=require('squel');var crypto=require(_0xdde1('0x8'));var jsforce=require(_0xdde1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xdde1('0xa'));var querystring=require('querystring');var Papa=require(_0xdde1('0xb'));var Redis=require(_0xdde1('0xc'));var authService=require(_0xdde1('0xd'));var qs=require(_0xdde1('0xe'));var as=require(_0xdde1('0xf'));var hardwareService=require(_0xdde1('0x10'));var logger=require(_0xdde1('0x11'))(_0xdde1('0x12'));var utils=require(_0xdde1('0x13'));var config=require(_0xdde1('0x14'));var licenseUtil=require(_0xdde1('0x15'));var db=require(_0xdde1('0x16'))['db'];config[_0xdde1('0x17')]=_[_0xdde1('0x18')](config[_0xdde1('0x17')],{'host':_0xdde1('0x19'),'port':0x18eb});var socket=require(_0xdde1('0x1a'))(new Redis(config[_0xdde1('0x17')]));require(_0xdde1('0x1b'))[_0xdde1('0x1c')](socket);function respondWithStatusCode(_0x475298,_0x18a79a){_0x18a79a=_0x18a79a||0xcc;return function(_0x27193a){if(_0x27193a){return _0x475298[_0xdde1('0x1d')](_0x18a79a);}return _0x475298[_0xdde1('0x1e')](_0x18a79a)['end']();};}function respondWithResult(_0x28e5a4,_0x54cc76){_0x54cc76=_0x54cc76||0xc8;return function(_0x57aaa4){if(_0x57aaa4){return _0x28e5a4['status'](_0x54cc76)[_0xdde1('0x1f')](_0x57aaa4);}};}function respondWithFilteredResult(_0x50d2e5,_0x5b4388){return function(_0x185b39){if(_0x185b39){var _0x35549f=typeof _0x5b4388[_0xdde1('0x20')]===_0xdde1('0x21')&&typeof _0x5b4388[_0xdde1('0x22')]===_0xdde1('0x21');var _0x171cc0=_0x185b39['count'];var _0x4f76bb=_0x35549f?0x0:_0x5b4388[_0xdde1('0x20')];var _0x407a37=_0x35549f?_0x185b39[_0xdde1('0x23')]:_0x5b4388[_0xdde1('0x20')]+_0x5b4388[_0xdde1('0x22')];var _0x4b3b10;if(_0x407a37>=_0x171cc0){_0x407a37=_0x171cc0;_0x4b3b10=0xc8;}else{_0x4b3b10=0xce;}_0x50d2e5[_0xdde1('0x1e')](_0x4b3b10);return _0x50d2e5[_0xdde1('0x24')](_0xdde1('0x25'),_0x4f76bb+'-'+_0x407a37+'/'+_0x171cc0)['json'](_0x185b39);}return null;};}function patchUpdates(_0xbd4484){return function(_0x5aed15){try{jsonpatch['apply'](_0x5aed15,_0xbd4484,!![]);}catch(_0x190a2e){return BPromise[_0xdde1('0x26')](_0x190a2e);}return _0x5aed15[_0xdde1('0x27')]();};}function saveUpdates(_0x37ac16,_0x39d517){return function(_0x9afcf9){if(_0x9afcf9){return _0x9afcf9['update'](_0x37ac16)[_0xdde1('0x28')](function(_0x5958b9){return _0x5958b9;});}return null;};}function removeEntity(_0x577b07,_0x2e7dcb){return function(_0x42f060){if(_0x42f060){return _0x42f060[_0xdde1('0x29')]()['then'](function(){var _0x8dba09=_0x42f060[_0xdde1('0x2a')]({'plain':!![]});var _0x19740f='WhatsappQueues';return db[_0xdde1('0x2b')]['destroy']({'where':{'type':_0x19740f,'resourceId':_0x8dba09['id']}})[_0xdde1('0x28')](function(){return _0x42f060;});})[_0xdde1('0x28')](function(){_0x577b07[_0xdde1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4729f5,_0x21184a){return function(_0x27bb14){if(!_0x27bb14){_0x4729f5[_0xdde1('0x1d')](0x194);}return _0x27bb14;};}function handleError(_0x3e4855,_0x73dfa4){_0x73dfa4=_0x73dfa4||0x1f4;return function(_0x1665ea){logger[_0xdde1('0x2c')](_0x1665ea[_0xdde1('0x2d')]);if(_0x1665ea[_0xdde1('0x2e')]){delete _0x1665ea[_0xdde1('0x2e')];}_0x3e4855[_0xdde1('0x1e')](_0x73dfa4)[_0xdde1('0x2f')](_0x1665ea);};}exports[_0xdde1('0x30')]=function(_0x5bf70b,_0x1b22fa){var _0x5922dc={},_0x1deb2d={},_0x474d4b={'count':0x0,'rows':[]};var _0x558d73=_[_0xdde1('0x31')](db['WhatsappQueue'][_0xdde1('0x32')],function(_0x7ace81){return{'name':_0x7ace81[_0xdde1('0x33')],'type':_0x7ace81['type'][_0xdde1('0x34')]};});_0x1deb2d[_0xdde1('0x35')]=_[_0xdde1('0x31')](_0x558d73,_0xdde1('0x2e'));_0x1deb2d[_0xdde1('0x36')]=_['keys'](_0x5bf70b['query']);_0x1deb2d['filters']=_[_0xdde1('0x37')](_0x1deb2d[_0xdde1('0x35')],_0x1deb2d[_0xdde1('0x36')]);_0x5922dc[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0x1deb2d['model'],qs[_0xdde1('0x39')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x39')]));_0x5922dc[_0xdde1('0x38')]=_0x5922dc[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x5922dc[_0xdde1('0x38')]:_0x1deb2d['model'];if(!_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x3b')]('nolimit')){_0x5922dc['limit']=qs[_0xdde1('0x22')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x22')]);_0x5922dc[_0xdde1('0x20')]=qs['offset'](_0x5bf70b['query'][_0xdde1('0x20')]);}_0x5922dc['order']=qs[_0xdde1('0x3c')](_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x3c')]);_0x5922dc['where']=qs[_0xdde1('0x3d')](_[_0xdde1('0x3e')](_0x5bf70b['query'],_0x1deb2d['filters']),_0x558d73);if(_0x5bf70b[_0xdde1('0x36')]['filter']){_0x5922dc[_0xdde1('0x3f')]=_[_0xdde1('0x40')](_0x5922dc[_0xdde1('0x3f')],{'$or':_[_0xdde1('0x31')](_0x558d73,function(_0x112742){if(_0x112742[_0xdde1('0x41')]!==_0xdde1('0x42')){var _0x5b4b22={};_0x5b4b22[_0x112742[_0xdde1('0x2e')]]={'$like':'%'+_0x5bf70b[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x5b4b22;}})});}_0x5922dc=_[_0xdde1('0x40')]({},_0x5922dc,_0x5bf70b[_0xdde1('0x44')]);var _0x309933={'where':_0x5922dc[_0xdde1('0x3f')]};return db[_0xdde1('0x45')][_0xdde1('0x23')](_0x309933)[_0xdde1('0x28')](function(_0x850fe4){_0x474d4b[_0xdde1('0x23')]=_0x850fe4;if(_0x5bf70b['query'][_0xdde1('0x46')]){_0x5922dc['include']=[{'all':!![]}];}return db[_0xdde1('0x45')]['findAll'](_0x5922dc);})['then'](function(_0x30cdc8){_0x474d4b['rows']=_0x30cdc8;return _0x474d4b;})['then'](respondWithFilteredResult(_0x1b22fa,_0x5922dc))[_0xdde1('0x47')](handleError(_0x1b22fa,null));};exports[_0xdde1('0x48')]=function(_0x4549b4,_0x5e162d){var _0x12cdef={'raw':!![],'where':{'id':_0x4549b4[_0xdde1('0x49')]['id']}},_0x12f216={};_0x12f216[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db['WhatsappQueue'][_0xdde1('0x32')]);_0x12f216[_0xdde1('0x36')]=_[_0xdde1('0x4a')](_0x4549b4[_0xdde1('0x36')]);_0x12f216['filters']=_['intersection'](_0x12f216['model'],_0x12f216[_0xdde1('0x36')]);_0x12cdef[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0x12f216['model'],qs[_0xdde1('0x39')](_0x4549b4[_0xdde1('0x36')][_0xdde1('0x39')]));_0x12cdef['attributes']=_0x12cdef[_0xdde1('0x38')]['length']?_0x12cdef[_0xdde1('0x38')]:_0x12f216['model'];if(_0x4549b4[_0xdde1('0x36')][_0xdde1('0x46')]){_0x12cdef[_0xdde1('0x4b')]=[{'all':!![]}];}_0x12cdef=_[_0xdde1('0x40')]({},_0x12cdef,_0x4549b4['options']);return db[_0xdde1('0x45')][_0xdde1('0x4c')](_0x12cdef)['then'](handleEntityNotFound(_0x5e162d,null))[_0xdde1('0x28')](respondWithResult(_0x5e162d,null))[_0xdde1('0x47')](handleError(_0x5e162d,null));};exports[_0xdde1('0x4d')]=function(_0x43ffd2,_0x261646){return db[_0xdde1('0x45')][_0xdde1('0x4d')](_0x43ffd2[_0xdde1('0x4e')],{})[_0xdde1('0x28')](function(_0x3f8496){var _0xbcb70=_0x43ffd2[_0xdde1('0x4f')][_0xdde1('0x2a')]({'plain':!![]});if(!_0xbcb70)throw new Error(_0xdde1('0x50'));if(_0xbcb70[_0xdde1('0x51')]==='user'){var _0x2e647a=_0x3f8496[_0xdde1('0x2a')]({'plain':!![]});var _0x39ff13=_0xdde1('0x52');return db[_0xdde1('0x53')][_0xdde1('0x4c')]({'where':{'name':_0x39ff13,'userProfileId':_0xbcb70['userProfileId']},'raw':!![]})['then'](function(_0xbb4410){if(_0xbb4410&&_0xbb4410[_0xdde1('0x54')]===0x0){return db[_0xdde1('0x2b')]['create']({'name':_0x2e647a[_0xdde1('0x2e')],'resourceId':_0x2e647a['id'],'type':_0xbb4410[_0xdde1('0x2e')],'sectionId':_0xbb4410['id']},{})[_0xdde1('0x28')](function(){return _0x3f8496;});}else{return _0x3f8496;}})['catch'](function(_0x5d19b1){logger['error'](_0xdde1('0x55'),_0x5d19b1);throw _0x5d19b1;});}return _0x3f8496;})['then'](respondWithResult(_0x261646,0xc9))[_0xdde1('0x47')](handleError(_0x261646,null));};exports['update']=function(_0x2fb58b,_0xbf0df9){if(_0x2fb58b[_0xdde1('0x4e')]['id']){delete _0x2fb58b[_0xdde1('0x4e')]['id'];}return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x2fb58b[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0xbf0df9,null))[_0xdde1('0x28')](saveUpdates(_0x2fb58b[_0xdde1('0x4e')],null))[_0xdde1('0x28')](respondWithResult(_0xbf0df9,null))['catch'](handleError(_0xbf0df9,null));};exports['destroy']=function(_0x1f450e,_0x47e827){return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x1f450e[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x47e827,null))[_0xdde1('0x28')](removeEntity(_0x47e827,null))[_0xdde1('0x47')](handleError(_0x47e827,null));};exports[_0xdde1('0x56')]=function(_0x12c7cd,_0x5993cf){return db[_0xdde1('0x45')]['describe']()[_0xdde1('0x28')](respondWithResult(_0x5993cf,null))[_0xdde1('0x47')](handleError(_0x5993cf,null));};exports['getMembers']=function(_0x3cca5a,_0x1014c5,_0x4a8d97){var _0x18922c={'raw':!![],'where':{}},_0x59cdbd={},_0x39e895;return db[_0xdde1('0x45')][_0xdde1('0x57')]({'where':{'id':_0x3cca5a[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0x1014c5,null))['then'](function(_0x41bb8c){if(_0x41bb8c){_0x39e895=_0x41bb8c[_0xdde1('0x2a')]({'plain':!![]});_0x59cdbd[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db['UserWhatsappQueue'][_0xdde1('0x32')]);_0x59cdbd['query']=_[_0xdde1('0x4a')](_0x3cca5a[_0xdde1('0x36')]);_0x59cdbd['filters']=_['intersection'](_0x59cdbd[_0xdde1('0x35')],_0x59cdbd[_0xdde1('0x36')]);_0x18922c[_0xdde1('0x38')]=_['intersection'](_0x59cdbd[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x3cca5a['query'][_0xdde1('0x39')]));_0x18922c[_0xdde1('0x38')]=_0x18922c[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x18922c[_0xdde1('0x38')]:_0x59cdbd[_0xdde1('0x35')];if(!_0x3cca5a[_0xdde1('0x36')]['hasOwnProperty'](_0xdde1('0x58'))){_0x18922c[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x3cca5a[_0xdde1('0x36')][_0xdde1('0x22')]);_0x18922c[_0xdde1('0x20')]=qs[_0xdde1('0x20')](_0x3cca5a[_0xdde1('0x36')]['offset']);}_0x18922c[_0xdde1('0x59')]=qs[_0xdde1('0x3c')](_0x3cca5a[_0xdde1('0x36')]['sort']);_0x18922c[_0xdde1('0x3f')]=qs[_0xdde1('0x3d')](_[_0xdde1('0x3e')](_0x3cca5a[_0xdde1('0x36')],_0x59cdbd['filters']));_0x18922c[_0xdde1('0x3f')]['WhatsappQueueId']=_0x41bb8c['id'];if(_0x3cca5a[_0xdde1('0x36')]['filter']){_0x18922c['where']=_[_0xdde1('0x40')](_0x18922c[_0xdde1('0x3f')],{'$or':_[_0xdde1('0x31')](_0x18922c['attributes'],function(_0x4f7ce2){var _0x482094={};_0x482094[_0x4f7ce2]={'$like':'%'+_0x3cca5a[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x482094;})});}_0x18922c=_[_0xdde1('0x40')]({},_0x18922c,_0x3cca5a[_0xdde1('0x44')]);return db['UserWhatsappQueue']['findAll'](_0x18922c);}})[_0xdde1('0x28')](function(_0x14f32f){if(_0x14f32f){return db[_0xdde1('0x5a')]['findAndCountAll']({'where':{'id':_[_0xdde1('0x31')](_0x14f32f,_0xdde1('0x5b')),'role':_0xdde1('0x5c')},'attributes':['id',_0xdde1('0x2e'),_0xdde1('0x5d'),_0xdde1('0x5e'),'createdAt']});}})[_0xdde1('0x28')](function(_0x3d7823){if(_0x3d7823){return{'count':_0x3d7823[_0xdde1('0x23')],'rows':_[_0xdde1('0x31')](_0x3d7823['rows'],function(_0x248a51){return{'membername':_0x248a51[_0xdde1('0x2e')],'UserId':_0x248a51['id'],'queue_name':_0x39e895[_0xdde1('0x2e')],'WhatsappQueueId':_0x39e895['id'],'interface':util[_0xdde1('0x5f')](_0xdde1('0x60'),_0xdde1('0x61'),_0x248a51[_0xdde1('0x2e')]),'penalty':0x0,'paused':_0x248a51[_0xdde1('0x5d')],'createdAt':_0x248a51[_0xdde1('0x62')],'updatedAt':_0x248a51['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdde1('0x28')](respondWithFilteredResult(_0x1014c5,_0x18922c))[_0xdde1('0x47')](handleError(_0x1014c5,null));};exports[_0xdde1('0x63')]=function(_0x323c29,_0xd487eb,_0x4bd929){var _0x40292d={};var _0x5db192={};var _0x3a73f9;var _0x192468;return db[_0xdde1('0x45')]['findOne']({'where':{'id':_0x323c29[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0xd487eb,null))[_0xdde1('0x28')](function(_0x1f75ee){if(_0x1f75ee){_0x3a73f9=_0x1f75ee;_0x5db192[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db[_0xdde1('0x64')][_0xdde1('0x32')]);_0x5db192['query']=_['keys'](_0x323c29[_0xdde1('0x36')]);_0x5db192[_0xdde1('0x3d')]=_[_0xdde1('0x37')](_0x5db192[_0xdde1('0x35')],_0x5db192[_0xdde1('0x36')]);_0x40292d[_0xdde1('0x38')]=_['intersection'](_0x5db192[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x323c29['query'][_0xdde1('0x39')]));_0x40292d[_0xdde1('0x38')]=_0x40292d['attributes'][_0xdde1('0x3a')]?_0x40292d[_0xdde1('0x38')]:_0x5db192[_0xdde1('0x35')];_0x40292d[_0xdde1('0x59')]=qs['sort'](_0x323c29['query'][_0xdde1('0x3c')]);_0x40292d[_0xdde1('0x3f')]=qs[_0xdde1('0x3d')](_['pick'](_0x323c29[_0xdde1('0x36')],_0x5db192[_0xdde1('0x3d')]));if(_0x323c29[_0xdde1('0x36')][_0xdde1('0x43')]){_0x40292d['where']=_['merge'](_0x40292d[_0xdde1('0x3f')],{'$or':_['map'](_0x40292d[_0xdde1('0x38')],function(_0x306512){var _0x1bd716={};_0x1bd716[_0x306512]={'$like':'%'+_0x323c29[_0xdde1('0x36')]['filter']+'%'};return _0x1bd716;})});}_0x40292d=_[_0xdde1('0x40')]({},_0x40292d,_0x323c29[_0xdde1('0x44')]);return _0x3a73f9[_0xdde1('0x63')](_0x40292d);}})[_0xdde1('0x28')](function(_0x2fdee8){if(_0x2fdee8){_0x192468=_0x2fdee8[_0xdde1('0x3a')];if(!_0x323c29[_0xdde1('0x36')][_0xdde1('0x3b')](_0xdde1('0x58'))){_0x40292d[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x323c29[_0xdde1('0x36')][_0xdde1('0x22')]);_0x40292d[_0xdde1('0x20')]=qs[_0xdde1('0x20')](_0x323c29[_0xdde1('0x36')]['offset']);}return _0x3a73f9[_0xdde1('0x63')](_0x40292d);}})['then'](function(_0x131c04){if(_0x131c04){return _0x131c04?{'count':_0x192468,'rows':_0x131c04}:null;}})[_0xdde1('0x28')](respondWithResult(_0xd487eb,null))[_0xdde1('0x47')](handleError(_0xd487eb,null));};exports['addTeams']=function(_0x49f3ed,_0x1f1fc6,_0x57fd35){var _0x480a23=_0x49f3ed['body'][_0xdde1('0x65')];return db['Team'][_0xdde1('0x66')]({'where':{'id':_0x480a23},'attributes':['id'],'include':[{'model':db[_0xdde1('0x5a')],'as':_0xdde1('0x67'),'attributes':['id',_0xdde1('0x2e'),'online',_0xdde1('0x68'),'interface'],'raw':!![]}]})[_0xdde1('0x28')](function(_0x440d96){if(_0x440d96){var _0x25943c=_[_0xdde1('0x69')](_0x440d96,function(_0x3098a3){var _0x11f922=_0x3098a3[_0xdde1('0x2a')]({'plain':!![]});return _0x11f922['Agents'];});return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x49f3ed[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](function(_0x1ed812){return db[_0xdde1('0x6a')][_0xdde1('0x6b')](function(_0x47f2b1){return _0x1ed812[_0xdde1('0x6c')](_0x480a23,{'transaction':_0x47f2b1})[_0xdde1('0x28')](function(){return BPromise[_0xdde1('0x6d')](_0x25943c,function(_0x4292da){return db[_0xdde1('0x6e')]['findOrCreate']({'where':{'UserId':_0x4292da['id'],'WhatsappQueueId':_0x49f3ed[_0xdde1('0x49')]['id']},'transaction':_0x47f2b1});});})[_0xdde1('0x28')](function(){_0x25943c[_0xdde1('0x6f')](function(_0x5193e2){socket[_0xdde1('0x70')](_0xdde1('0x71'),{'UserId':_0x5193e2['id'],'WhatsappQueueId':_0x1ed812['id']});});});});});}})[_0xdde1('0x28')](respondWithStatusCode(_0x1f1fc6,null))['catch'](handleError(_0x1f1fc6,null));};exports[_0xdde1('0x72')]=function(_0x47e835,_0x33f916,_0x3e7693){return db['Team'][_0xdde1('0x66')]({'where':{'id':_0x47e835['query'][_0xdde1('0x65')]},'attributes':['id'],'include':[{'model':db[_0xdde1('0x5a')],'as':_0xdde1('0x67'),'attributes':['id'],'raw':!![]}]})[_0xdde1('0x28')](handleEntityNotFound(_0x33f916,null))[_0xdde1('0x28')](function(_0x2a614f){var _0x3b0198=_[_0xdde1('0x31')](_0x2a614f,'id');var _0x235d40=[];var _0x53eb0d=[];var _0x28b510=squel['select']();_0x28b510[_0xdde1('0x73')]('tq.TeamId')[_0xdde1('0x74')](_0xdde1('0x75'),'tq')[_0xdde1('0x76')](_0xdde1('0x77'),'ut',_0xdde1('0x78'))[_0xdde1('0x3f')](_0xdde1('0x79'),_0x47e835[_0xdde1('0x49')]['id']);for(var _0x496de0=0x0;_0x496de0<_0x2a614f[_0xdde1('0x3a')];_0x496de0+=0x1){let _0x151f1e=_0x2a614f[_0x496de0];for(var _0x5d59b0=0x0;_0x5d59b0<_0x151f1e[_0xdde1('0x67')][_0xdde1('0x3a')];_0x5d59b0+=0x1){let _0x21776d=_0x151f1e[_0xdde1('0x67')][_0x5d59b0];var _0xcb4af3=_0x28b510[_0xdde1('0x7a')]();_0xcb4af3[_0xdde1('0x3f')]('ut.UserId\x20=\x20?',_0x21776d['id']);_0x53eb0d['push'](db[_0xdde1('0x6a')]['query'](_0xcb4af3[_0xdde1('0x7b')](),{'type':db[_0xdde1('0x6a')][_0xdde1('0x7c')][_0xdde1('0x7d')]})[_0xdde1('0x28')](function(_0x577ef2){if(_0x577ef2[_0xdde1('0x3a')]===0x1){return _0x21776d['id'];}else{var _0x144389=_['every'](_[_0xdde1('0x31')](_0x577ef2,_0xdde1('0x7e')),function(_0x470130){return _[_0xdde1('0x7f')](_0x3b0198,_0x470130);});if(_0x144389){return _0x21776d['id'];}}}));}}return BPromise['all'](_0x53eb0d)[_0xdde1('0x28')](function(_0x315091){_0x235d40=_(_0x235d40)[_0xdde1('0x80')](_0x315091)['compact']()[_0xdde1('0x81')]();return db['WhatsappQueue'][_0xdde1('0x4c')]({'where':{'id':_0x47e835['params']['id']}})[_0xdde1('0x28')](function(_0x1e9f42){return db[_0xdde1('0x6a')][_0xdde1('0x6b')](function(_0x3db140){return _0x1e9f42[_0xdde1('0x72')](_0x47e835[_0xdde1('0x36')][_0xdde1('0x65')],{'transaction':_0x3db140})[_0xdde1('0x28')](function(){if(!_['isEmpty'](_0x235d40)){return _0x1e9f42[_0xdde1('0x82')](_0x235d40,{'transaction':_0x3db140});}})['then'](function(){_0x235d40[_0xdde1('0x6f')](function(_0x428127){socket['emit'](_0xdde1('0x83'),{'UserId':_0x428127,'WhatsappQueueId':_0x1e9f42['id']});});});});});});})[_0xdde1('0x28')](respondWithStatusCode(_0x33f916,null))[_0xdde1('0x47')](handleError(_0x33f916,null));};exports[_0xdde1('0x84')]=function(_0x8c991,_0x672248,_0x294e25){return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x8c991[_0xdde1('0x49')]['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x672248,null))[_0xdde1('0x28')](function(_0x3ead8a){if(_0x3ead8a){return _0x3ead8a[_0xdde1('0x84')](_0x8c991['body'][_0xdde1('0x65')],_['omit'](_0x8c991['body'],[_0xdde1('0x65'),'id'])||{})[_0xdde1('0x85')](function(_0x327fdb){for(var _0xc06a7f=0x0;_0xc06a7f<_0x8c991['body']['ids']['length'];_0xc06a7f+=0x1){socket[_0xdde1('0x70')](_0xdde1('0x71'),{'UserId':Number(_0x8c991[_0xdde1('0x4e')]['ids'][_0xc06a7f]),'WhatsappQueueId':Number(_0x8c991[_0xdde1('0x49')]['id'])});}return _0x327fdb;});}})[_0xdde1('0x28')](respondWithResult(_0x672248,null))[_0xdde1('0x47')](handleError(_0x672248,null));};exports['removeAgents']=function(_0x137a6c,_0x31a93a,_0x440d9e){return db[_0xdde1('0x45')][_0xdde1('0x4c')]({'where':{'id':_0x137a6c['params']['id']}})[_0xdde1('0x28')](handleEntityNotFound(_0x31a93a,null))[_0xdde1('0x28')](function(_0x4186dc){if(_0x4186dc){return _0x4186dc[_0xdde1('0x82')](_0x137a6c['query'][_0xdde1('0x65')])['then'](function(){if(_['isArray'](_0x137a6c['query'][_0xdde1('0x65')])){for(var _0x2dcfce=0x0;_0x2dcfce<_0x137a6c[_0xdde1('0x36')][_0xdde1('0x65')]['length'];_0x2dcfce+=0x1){socket[_0xdde1('0x70')](_0xdde1('0x83'),{'UserId':Number(_0x137a6c[_0xdde1('0x36')]['ids'][_0x2dcfce]),'WhatsappQueueId':Number(_0x137a6c[_0xdde1('0x49')]['id'])});}}else{socket[_0xdde1('0x70')]('userWhatsappQueue:remove',{'UserId':Number(_0x137a6c[_0xdde1('0x36')][_0xdde1('0x65')]),'WhatsappQueueId':Number(_0x137a6c[_0xdde1('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x31a93a,null))[_0xdde1('0x47')](handleError(_0x31a93a,null));};exports['getAgents']=function(_0x2ffcce,_0x4ac70f,_0x309c52){var _0x251283={};var _0xe479e0={};var _0x186398;var _0x151dfc;return db['WhatsappQueue'][_0xdde1('0x57')]({'where':{'id':_0x2ffcce[_0xdde1('0x49')]['id']}})['then'](handleEntityNotFound(_0x4ac70f,null))['then'](function(_0x309d4a){if(_0x309d4a){_0x186398=_0x309d4a;_0xe479e0[_0xdde1('0x35')]=_[_0xdde1('0x4a')](db[_0xdde1('0x5a')][_0xdde1('0x32')]);_0xe479e0[_0xdde1('0x36')]=_['keys'](_0x2ffcce[_0xdde1('0x36')]);_0xe479e0[_0xdde1('0x3d')]=_[_0xdde1('0x37')](_0xe479e0[_0xdde1('0x35')],_0xe479e0['query']);_0x251283[_0xdde1('0x38')]=_[_0xdde1('0x37')](_0xe479e0[_0xdde1('0x35')],qs[_0xdde1('0x39')](_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x39')]));_0x251283['attributes']=_0x251283[_0xdde1('0x38')][_0xdde1('0x3a')]?_0x251283['attributes']:_0xe479e0[_0xdde1('0x35')];_0x251283[_0xdde1('0x59')]=qs['sort'](_0x2ffcce['query'][_0xdde1('0x3c')]);_0x251283[_0xdde1('0x3f')]=qs['filters'](_['pick'](_0x2ffcce['query'],_0xe479e0[_0xdde1('0x3d')]));if(_0x2ffcce[_0xdde1('0x36')]['filter']){_0x251283[_0xdde1('0x3f')]=_['merge'](_0x251283[_0xdde1('0x3f')],{'$or':_['map'](_0x251283[_0xdde1('0x38')],function(_0x2ad6ce){var _0x49974f={};_0x49974f[_0x2ad6ce]={'$like':'%'+_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x43')]+'%'};return _0x49974f;})});}_0x251283=_['merge']({},_0x251283,_0x2ffcce['options']);return _0x186398[_0xdde1('0x86')](_0x251283);}})[_0xdde1('0x28')](function(_0x4dbb70){if(_0x4dbb70){_0x151dfc=_0x4dbb70[_0xdde1('0x3a')];if(!_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x3b')](_0xdde1('0x58'))){_0x251283[_0xdde1('0x22')]=qs[_0xdde1('0x22')](_0x2ffcce[_0xdde1('0x36')][_0xdde1('0x22')]);_0x251283[_0xdde1('0x20')]=qs['offset'](_0x2ffcce['query']['offset']);}return _0x186398['getAgents'](_0x251283);}})[_0xdde1('0x28')](function(_0x266a3e){if(_0x266a3e){return _0x266a3e?{'count':_0x151dfc,'rows':_0x266a3e}:null;}})[_0xdde1('0x28')](respondWithResult(_0x4ac70f,null))[_0xdde1('0x47')](handleError(_0x4ac70f,null));};
\ No newline at end of file
+var _0x5cd1=['index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','findAll','catch','show','length','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','UserProfileSection','find','autoAssociation','params','getMembers','findOne','UserWhatsappQueue','nolimit','order','WhatsappQueueId','User','UserId','whatsappPause','createdAt','rows','format','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send'];(function(_0x5192ea,_0x396e10){var _0x318eee=function(_0x2a4352){while(--_0x2a4352){_0x5192ea['push'](_0x5192ea['shift']());}};_0x318eee(++_0x396e10);}(_0x5cd1,0x172));var _0x15cd=function(_0x175db7,_0x407116){_0x175db7=_0x175db7-0x0;var _0x57c508=_0x5cd1[_0x175db7];return _0x57c508;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x15cd('0x0'));var jsonpatch=require(_0x15cd('0x1'));var rp=require(_0x15cd('0x2'));var moment=require(_0x15cd('0x3'));var BPromise=require(_0x15cd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x15cd('0x5'));var sox=require(_0x15cd('0x6'));var csv=require(_0x15cd('0x7'));var ejs=require(_0x15cd('0x8'));var fs=require('fs');var fs_extra=require(_0x15cd('0x9'));var _=require(_0x15cd('0xa'));var squel=require('squel');var crypto=require(_0x15cd('0xb'));var jsforce=require(_0x15cd('0xc'));var deskjs=require(_0x15cd('0xd'));var toCsv=require(_0x15cd('0x7'));var querystring=require(_0x15cd('0xe'));var Papa=require(_0x15cd('0xf'));var Redis=require(_0x15cd('0x10'));var authService=require(_0x15cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x15cd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15cd('0x13'))(_0x15cd('0x14'));var utils=require(_0x15cd('0x15'));var config=require(_0x15cd('0x16'));var licenseUtil=require(_0x15cd('0x17'));var db=require('../../mysqldb')['db'];config[_0x15cd('0x18')]=_['defaults'](config[_0x15cd('0x18')],{'host':_0x15cd('0x19'),'port':0x18eb});var socket=require(_0x15cd('0x1a'))(new Redis(config[_0x15cd('0x18')]));require(_0x15cd('0x1b'))[_0x15cd('0x1c')](socket);function respondWithStatusCode(_0x343b08,_0x4520d9){_0x4520d9=_0x4520d9||0xcc;return function(_0x35436c){if(_0x35436c){return _0x343b08[_0x15cd('0x1d')](_0x4520d9);}return _0x343b08[_0x15cd('0x1e')](_0x4520d9)['end']();};}function respondWithResult(_0x9bef97,_0x18630f){_0x18630f=_0x18630f||0xc8;return function(_0x1380ef){if(_0x1380ef){return _0x9bef97[_0x15cd('0x1e')](_0x18630f)[_0x15cd('0x1f')](_0x1380ef);}};}function respondWithFilteredResult(_0x3feccf,_0x3d6d5e){return function(_0x3b22dd){if(_0x3b22dd){var _0x26b40c=typeof _0x3d6d5e[_0x15cd('0x20')]===_0x15cd('0x21')&&typeof _0x3d6d5e[_0x15cd('0x22')]===_0x15cd('0x21');var _0xc56053=_0x3b22dd['count'];var _0x1d125a=_0x26b40c?0x0:_0x3d6d5e[_0x15cd('0x20')];var _0x52b089=_0x26b40c?_0x3b22dd[_0x15cd('0x23')]:_0x3d6d5e[_0x15cd('0x20')]+_0x3d6d5e['limit'];var _0x2aea07;if(_0x52b089>=_0xc56053){_0x52b089=_0xc56053;_0x2aea07=0xc8;}else{_0x2aea07=0xce;}_0x3feccf[_0x15cd('0x1e')](_0x2aea07);return _0x3feccf[_0x15cd('0x24')]('Content-Range',_0x1d125a+'-'+_0x52b089+'/'+_0xc56053)[_0x15cd('0x1f')](_0x3b22dd);}return null;};}function patchUpdates(_0x304e3a){return function(_0x28a662){try{jsonpatch['apply'](_0x28a662,_0x304e3a,!![]);}catch(_0x448ab4){return BPromise[_0x15cd('0x25')](_0x448ab4);}return _0x28a662[_0x15cd('0x26')]();};}function saveUpdates(_0x5cea20,_0x29a586){return function(_0x5a80f7){if(_0x5a80f7){return _0x5a80f7[_0x15cd('0x27')](_0x5cea20)[_0x15cd('0x28')](function(_0x54b2ab){return _0x54b2ab;});}return null;};}function removeEntity(_0x1871d7,_0x104b81){return function(_0x5f4a0d){if(_0x5f4a0d){return _0x5f4a0d[_0x15cd('0x29')]()[_0x15cd('0x28')](function(){var _0x212787=_0x5f4a0d['get']({'plain':!![]});var _0x236db5='WhatsappQueues';return db[_0x15cd('0x2a')][_0x15cd('0x29')]({'where':{'type':_0x236db5,'resourceId':_0x212787['id']}})[_0x15cd('0x28')](function(){return _0x5f4a0d;});})[_0x15cd('0x28')](function(){_0x1871d7[_0x15cd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b7848,_0x3c6eb8){return function(_0x9a6b47){if(!_0x9a6b47){_0x4b7848[_0x15cd('0x1d')](0x194);}return _0x9a6b47;};}function handleError(_0x1c481a,_0x3c6f17){_0x3c6f17=_0x3c6f17||0x1f4;return function(_0x2b6e7c){logger[_0x15cd('0x2b')](_0x2b6e7c[_0x15cd('0x2c')]);if(_0x2b6e7c[_0x15cd('0x2d')]){delete _0x2b6e7c[_0x15cd('0x2d')];}_0x1c481a['status'](_0x3c6f17)[_0x15cd('0x2e')](_0x2b6e7c);};}exports[_0x15cd('0x2f')]=function(_0x4beb65,_0xc1f3b6){var _0x1ef2bc={},_0x3797bd={},_0x54ff8b={'count':0x0,'rows':[]};var _0x48134b=_['map'](db['WhatsappQueue'][_0x15cd('0x30')],function(_0x30b8c3){return{'name':_0x30b8c3[_0x15cd('0x31')],'type':_0x30b8c3[_0x15cd('0x32')][_0x15cd('0x33')]};});_0x3797bd[_0x15cd('0x34')]=_[_0x15cd('0x35')](_0x48134b,_0x15cd('0x2d'));_0x3797bd[_0x15cd('0x36')]=_[_0x15cd('0x37')](_0x4beb65[_0x15cd('0x36')]);_0x3797bd['filters']=_[_0x15cd('0x38')](_0x3797bd['model'],_0x3797bd[_0x15cd('0x36')]);_0x1ef2bc[_0x15cd('0x39')]=_['intersection'](_0x3797bd[_0x15cd('0x34')],qs['fields'](_0x4beb65[_0x15cd('0x36')][_0x15cd('0x3a')]));_0x1ef2bc[_0x15cd('0x39')]=_0x1ef2bc['attributes']['length']?_0x1ef2bc[_0x15cd('0x39')]:_0x3797bd[_0x15cd('0x34')];if(!_0x4beb65[_0x15cd('0x36')][_0x15cd('0x3b')]('nolimit')){_0x1ef2bc['limit']=qs['limit'](_0x4beb65[_0x15cd('0x36')][_0x15cd('0x22')]);_0x1ef2bc['offset']=qs[_0x15cd('0x20')](_0x4beb65[_0x15cd('0x36')][_0x15cd('0x20')]);}_0x1ef2bc['order']=qs['sort'](_0x4beb65['query'][_0x15cd('0x3c')]);_0x1ef2bc[_0x15cd('0x3d')]=qs[_0x15cd('0x3e')](_[_0x15cd('0x3f')](_0x4beb65[_0x15cd('0x36')],_0x3797bd['filters']),_0x48134b);if(_0x4beb65[_0x15cd('0x36')][_0x15cd('0x40')]){_0x1ef2bc[_0x15cd('0x3d')]=_[_0x15cd('0x41')](_0x1ef2bc[_0x15cd('0x3d')],{'$or':_[_0x15cd('0x35')](_0x48134b,function(_0x2741c8){if(_0x2741c8[_0x15cd('0x32')]!==_0x15cd('0x42')){var _0x4b3e03={};_0x4b3e03[_0x2741c8[_0x15cd('0x2d')]]={'$like':'%'+_0x4beb65[_0x15cd('0x36')][_0x15cd('0x40')]+'%'};return _0x4b3e03;}})});}_0x1ef2bc=_[_0x15cd('0x41')]({},_0x1ef2bc,_0x4beb65[_0x15cd('0x43')]);var _0x4ba39c={'where':_0x1ef2bc['where']};return db['WhatsappQueue'][_0x15cd('0x23')](_0x4ba39c)['then'](function(_0x464ee4){_0x54ff8b[_0x15cd('0x23')]=_0x464ee4;if(_0x4beb65[_0x15cd('0x36')][_0x15cd('0x44')]){_0x1ef2bc[_0x15cd('0x45')]=[{'all':!![]}];}return db[_0x15cd('0x46')][_0x15cd('0x47')](_0x1ef2bc);})[_0x15cd('0x28')](function(_0x1d3cce){_0x54ff8b['rows']=_0x1d3cce;return _0x54ff8b;})[_0x15cd('0x28')](respondWithFilteredResult(_0xc1f3b6,_0x1ef2bc))[_0x15cd('0x48')](handleError(_0xc1f3b6,null));};exports[_0x15cd('0x49')]=function(_0x47de88,_0x307c72){var _0x287b18={'raw':!![],'where':{'id':_0x47de88['params']['id']}},_0x12df10={};_0x12df10[_0x15cd('0x34')]=_[_0x15cd('0x37')](db[_0x15cd('0x46')][_0x15cd('0x30')]);_0x12df10['query']=_[_0x15cd('0x37')](_0x47de88[_0x15cd('0x36')]);_0x12df10['filters']=_[_0x15cd('0x38')](_0x12df10[_0x15cd('0x34')],_0x12df10[_0x15cd('0x36')]);_0x287b18[_0x15cd('0x39')]=_[_0x15cd('0x38')](_0x12df10[_0x15cd('0x34')],qs[_0x15cd('0x3a')](_0x47de88[_0x15cd('0x36')][_0x15cd('0x3a')]));_0x287b18[_0x15cd('0x39')]=_0x287b18['attributes'][_0x15cd('0x4a')]?_0x287b18[_0x15cd('0x39')]:_0x12df10['model'];if(_0x47de88[_0x15cd('0x36')][_0x15cd('0x44')]){_0x287b18[_0x15cd('0x45')]=[{'all':!![]}];}_0x287b18=_[_0x15cd('0x41')]({},_0x287b18,_0x47de88[_0x15cd('0x43')]);return db[_0x15cd('0x46')]['find'](_0x287b18)['then'](handleEntityNotFound(_0x307c72,null))[_0x15cd('0x28')](respondWithResult(_0x307c72,null))['catch'](handleError(_0x307c72,null));};exports['create']=function(_0x4e9002,_0x1ac630){return db[_0x15cd('0x46')][_0x15cd('0x4b')](_0x4e9002[_0x15cd('0x4c')],{})['then'](function(_0x527c4a){var _0x2c107d=_0x4e9002['user'][_0x15cd('0x4d')]({'plain':!![]});if(!_0x2c107d)throw new Error(_0x15cd('0x4e'));if(_0x2c107d[_0x15cd('0x4f')]===_0x15cd('0x50')){var _0x4b5778=_0x527c4a[_0x15cd('0x4d')]({'plain':!![]});var _0x58e8fb=_0x15cd('0x51');return db[_0x15cd('0x52')][_0x15cd('0x53')]({'where':{'name':_0x58e8fb,'userProfileId':_0x2c107d['userProfileId']},'raw':!![]})[_0x15cd('0x28')](function(_0x34c556){if(_0x34c556&&_0x34c556[_0x15cd('0x54')]===0x0){return db[_0x15cd('0x2a')][_0x15cd('0x4b')]({'name':_0x4b5778['name'],'resourceId':_0x4b5778['id'],'type':_0x34c556['name'],'sectionId':_0x34c556['id']},{})[_0x15cd('0x28')](function(){return _0x527c4a;});}else{return _0x527c4a;}})['catch'](function(_0x186b64){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x186b64);throw _0x186b64;});}return _0x527c4a;})[_0x15cd('0x28')](respondWithResult(_0x1ac630,0xc9))['catch'](handleError(_0x1ac630,null));};exports['update']=function(_0x106d97,_0x3bbd6c){if(_0x106d97[_0x15cd('0x4c')]['id']){delete _0x106d97['body']['id'];}return db['WhatsappQueue'][_0x15cd('0x53')]({'where':{'id':_0x106d97[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x3bbd6c,null))[_0x15cd('0x28')](saveUpdates(_0x106d97[_0x15cd('0x4c')],null))['then'](respondWithResult(_0x3bbd6c,null))['catch'](handleError(_0x3bbd6c,null));};exports[_0x15cd('0x29')]=function(_0x2a17a2,_0x34fc29){return db['WhatsappQueue'][_0x15cd('0x53')]({'where':{'id':_0x2a17a2[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x34fc29,null))[_0x15cd('0x28')](removeEntity(_0x34fc29,null))['catch'](handleError(_0x34fc29,null));};exports['describe']=function(_0x536486,_0x164488){return db[_0x15cd('0x46')]['describe']()['then'](respondWithResult(_0x164488,null))[_0x15cd('0x48')](handleError(_0x164488,null));};exports[_0x15cd('0x56')]=function(_0x729742,_0xf680af,_0x5dca13){var _0x2a1873={'raw':!![],'where':{}},_0x2b60d3={},_0x373c12;return db['WhatsappQueue'][_0x15cd('0x57')]({'where':{'id':_0x729742[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0xf680af,null))[_0x15cd('0x28')](function(_0x28e1bd){if(_0x28e1bd){_0x373c12=_0x28e1bd[_0x15cd('0x4d')]({'plain':!![]});_0x2b60d3[_0x15cd('0x34')]=_[_0x15cd('0x37')](db[_0x15cd('0x58')]['rawAttributes']);_0x2b60d3[_0x15cd('0x36')]=_[_0x15cd('0x37')](_0x729742[_0x15cd('0x36')]);_0x2b60d3[_0x15cd('0x3e')]=_[_0x15cd('0x38')](_0x2b60d3[_0x15cd('0x34')],_0x2b60d3[_0x15cd('0x36')]);_0x2a1873[_0x15cd('0x39')]=_[_0x15cd('0x38')](_0x2b60d3[_0x15cd('0x34')],qs['fields'](_0x729742['query']['fields']));_0x2a1873[_0x15cd('0x39')]=_0x2a1873[_0x15cd('0x39')]['length']?_0x2a1873[_0x15cd('0x39')]:_0x2b60d3[_0x15cd('0x34')];if(!_0x729742[_0x15cd('0x36')][_0x15cd('0x3b')](_0x15cd('0x59'))){_0x2a1873[_0x15cd('0x22')]=qs[_0x15cd('0x22')](_0x729742[_0x15cd('0x36')][_0x15cd('0x22')]);_0x2a1873['offset']=qs[_0x15cd('0x20')](_0x729742['query']['offset']);}_0x2a1873[_0x15cd('0x5a')]=qs[_0x15cd('0x3c')](_0x729742[_0x15cd('0x36')][_0x15cd('0x3c')]);_0x2a1873[_0x15cd('0x3d')]=qs[_0x15cd('0x3e')](_[_0x15cd('0x3f')](_0x729742[_0x15cd('0x36')],_0x2b60d3[_0x15cd('0x3e')]));_0x2a1873[_0x15cd('0x3d')][_0x15cd('0x5b')]=_0x28e1bd['id'];if(_0x729742['query'][_0x15cd('0x40')]){_0x2a1873[_0x15cd('0x3d')]=_['merge'](_0x2a1873[_0x15cd('0x3d')],{'$or':_[_0x15cd('0x35')](_0x2a1873[_0x15cd('0x39')],function(_0xfc216){var _0x516bb8={};_0x516bb8[_0xfc216]={'$like':'%'+_0x729742[_0x15cd('0x36')][_0x15cd('0x40')]+'%'};return _0x516bb8;})});}_0x2a1873=_[_0x15cd('0x41')]({},_0x2a1873,_0x729742[_0x15cd('0x43')]);return db[_0x15cd('0x58')][_0x15cd('0x47')](_0x2a1873);}})[_0x15cd('0x28')](function(_0x1721ec){if(_0x1721ec){return db[_0x15cd('0x5c')]['findAndCountAll']({'where':{'id':_[_0x15cd('0x35')](_0x1721ec,_0x15cd('0x5d')),'role':'agent'},'attributes':['id',_0x15cd('0x2d'),_0x15cd('0x5e'),'updatedAt',_0x15cd('0x5f')]});}})[_0x15cd('0x28')](function(_0x3a6a22){if(_0x3a6a22){return{'count':_0x3a6a22['count'],'rows':_[_0x15cd('0x35')](_0x3a6a22[_0x15cd('0x60')],function(_0x2193bb){return{'membername':_0x2193bb[_0x15cd('0x2d')],'UserId':_0x2193bb['id'],'queue_name':_0x373c12['name'],'WhatsappQueueId':_0x373c12['id'],'interface':util[_0x15cd('0x61')]('%s/%s',_0x15cd('0x62'),_0x2193bb[_0x15cd('0x2d')]),'penalty':0x0,'paused':_0x2193bb[_0x15cd('0x5e')],'createdAt':_0x2193bb['createdAt'],'updatedAt':_0x2193bb[_0x15cd('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xf680af,_0x2a1873))[_0x15cd('0x48')](handleError(_0xf680af,null));};exports[_0x15cd('0x64')]=function(_0x1b882d,_0x1ae3e3,_0x5de564){var _0x244a8b={};var _0x47ea8e={};var _0x251fce;var _0x7ee3df;return db[_0x15cd('0x46')][_0x15cd('0x57')]({'where':{'id':_0x1b882d[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x1ae3e3,null))[_0x15cd('0x28')](function(_0x39d561){if(_0x39d561){_0x251fce=_0x39d561;_0x47ea8e[_0x15cd('0x34')]=_[_0x15cd('0x37')](db[_0x15cd('0x65')][_0x15cd('0x30')]);_0x47ea8e[_0x15cd('0x36')]=_[_0x15cd('0x37')](_0x1b882d[_0x15cd('0x36')]);_0x47ea8e['filters']=_[_0x15cd('0x38')](_0x47ea8e['model'],_0x47ea8e['query']);_0x244a8b[_0x15cd('0x39')]=_['intersection'](_0x47ea8e[_0x15cd('0x34')],qs['fields'](_0x1b882d[_0x15cd('0x36')][_0x15cd('0x3a')]));_0x244a8b[_0x15cd('0x39')]=_0x244a8b[_0x15cd('0x39')][_0x15cd('0x4a')]?_0x244a8b[_0x15cd('0x39')]:_0x47ea8e[_0x15cd('0x34')];_0x244a8b[_0x15cd('0x5a')]=qs[_0x15cd('0x3c')](_0x1b882d[_0x15cd('0x36')][_0x15cd('0x3c')]);_0x244a8b['where']=qs['filters'](_[_0x15cd('0x3f')](_0x1b882d[_0x15cd('0x36')],_0x47ea8e[_0x15cd('0x3e')]));if(_0x1b882d['query'][_0x15cd('0x40')]){_0x244a8b[_0x15cd('0x3d')]=_[_0x15cd('0x41')](_0x244a8b['where'],{'$or':_[_0x15cd('0x35')](_0x244a8b[_0x15cd('0x39')],function(_0xe3f569){var _0x19576f={};_0x19576f[_0xe3f569]={'$like':'%'+_0x1b882d['query'][_0x15cd('0x40')]+'%'};return _0x19576f;})});}_0x244a8b=_['merge']({},_0x244a8b,_0x1b882d[_0x15cd('0x43')]);return _0x251fce['getTeams'](_0x244a8b);}})[_0x15cd('0x28')](function(_0x2c91b9){if(_0x2c91b9){_0x7ee3df=_0x2c91b9[_0x15cd('0x4a')];if(!_0x1b882d[_0x15cd('0x36')][_0x15cd('0x3b')](_0x15cd('0x59'))){_0x244a8b[_0x15cd('0x22')]=qs[_0x15cd('0x22')](_0x1b882d['query'][_0x15cd('0x22')]);_0x244a8b[_0x15cd('0x20')]=qs[_0x15cd('0x20')](_0x1b882d[_0x15cd('0x36')]['offset']);}return _0x251fce[_0x15cd('0x64')](_0x244a8b);}})[_0x15cd('0x28')](function(_0x41242b){if(_0x41242b){return _0x41242b?{'count':_0x7ee3df,'rows':_0x41242b}:null;}})[_0x15cd('0x28')](respondWithResult(_0x1ae3e3,null))[_0x15cd('0x48')](handleError(_0x1ae3e3,null));};exports[_0x15cd('0x66')]=function(_0x2a9589,_0x5ba99d,_0x3f5547){var _0x5cbcd6=_0x2a9589[_0x15cd('0x4c')][_0x15cd('0x67')];return db[_0x15cd('0x65')][_0x15cd('0x47')]({'where':{'id':_0x5cbcd6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x15cd('0x68'),'attributes':['id',_0x15cd('0x2d'),_0x15cd('0x69'),_0x15cd('0x6a'),_0x15cd('0x6b')],'raw':!![]}]})[_0x15cd('0x28')](function(_0x40fa52){if(_0x40fa52){var _0x3563e3=_['flatMap'](_0x40fa52,function(_0x19425d){var _0x51c8a5=_0x19425d[_0x15cd('0x4d')]({'plain':!![]});return _0x51c8a5[_0x15cd('0x68')];});return db[_0x15cd('0x46')][_0x15cd('0x53')]({'where':{'id':_0x2a9589[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](function(_0x1354e5){return db[_0x15cd('0x6c')][_0x15cd('0x6d')](function(_0x2e6309){return _0x1354e5[_0x15cd('0x66')](_0x5cbcd6,{'transaction':_0x2e6309})[_0x15cd('0x28')](function(){return BPromise[_0x15cd('0x6e')](_0x3563e3,function(_0x4f692d){return db[_0x15cd('0x58')][_0x15cd('0x6f')]({'where':{'UserId':_0x4f692d['id'],'WhatsappQueueId':_0x2a9589['params']['id']},'transaction':_0x2e6309});});})[_0x15cd('0x28')](function(){_0x3563e3[_0x15cd('0x70')](function(_0x156e93){socket[_0x15cd('0x71')](_0x15cd('0x72'),{'UserId':_0x156e93['id'],'WhatsappQueueId':_0x1354e5['id']});});});});});}})[_0x15cd('0x28')](respondWithStatusCode(_0x5ba99d,null))[_0x15cd('0x48')](handleError(_0x5ba99d,null));};exports[_0x15cd('0x73')]=function(_0x58f6ba,_0x4833b4,_0x10f064){return db['Team'][_0x15cd('0x47')]({'where':{'id':_0x58f6ba[_0x15cd('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x15cd('0x5c')],'as':_0x15cd('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4833b4,null))['then'](function(_0x45d373){var _0x46028e=_[_0x15cd('0x35')](_0x45d373,'id');var _0x28382c=[];var _0x2a143e=[];var _0x3caaa4=squel['select']();_0x3caaa4[_0x15cd('0x74')](_0x15cd('0x75'))[_0x15cd('0x76')](_0x15cd('0x77'),'tq')['join'](_0x15cd('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x15cd('0x3d')]('WhatsappQueueId\x20=\x20?',_0x58f6ba['params']['id']);for(var _0x24d445=0x0;_0x24d445<_0x45d373['length'];_0x24d445+=0x1){let _0x16d73b=_0x45d373[_0x24d445];for(var _0xcfef6b=0x0;_0xcfef6b<_0x16d73b[_0x15cd('0x68')][_0x15cd('0x4a')];_0xcfef6b+=0x1){let _0x2ebf72=_0x16d73b[_0x15cd('0x68')][_0xcfef6b];var _0x339205=_0x3caaa4[_0x15cd('0x79')]();_0x339205[_0x15cd('0x3d')](_0x15cd('0x7a'),_0x2ebf72['id']);_0x2a143e['push'](db[_0x15cd('0x6c')][_0x15cd('0x36')](_0x339205['toString'](),{'type':db[_0x15cd('0x6c')][_0x15cd('0x7b')][_0x15cd('0x7c')]})[_0x15cd('0x28')](function(_0x3d5fc3){if(_0x3d5fc3[_0x15cd('0x4a')]===0x1){return _0x2ebf72['id'];}else{var _0x41f08a=_[_0x15cd('0x7d')](_[_0x15cd('0x35')](_0x3d5fc3,_0x15cd('0x7e')),function(_0x4ea348){return _[_0x15cd('0x7f')](_0x46028e,_0x4ea348);});if(_0x41f08a){return _0x2ebf72['id'];}}}));}}return BPromise[_0x15cd('0x80')](_0x2a143e)[_0x15cd('0x28')](function(_0xeeeaea){_0x28382c=_(_0x28382c)[_0x15cd('0x81')](_0xeeeaea)[_0x15cd('0x82')]()[_0x15cd('0x83')]();return db[_0x15cd('0x46')][_0x15cd('0x53')]({'where':{'id':_0x58f6ba[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](function(_0x37df26){return db[_0x15cd('0x6c')][_0x15cd('0x6d')](function(_0x250961){return _0x37df26[_0x15cd('0x73')](_0x58f6ba[_0x15cd('0x36')][_0x15cd('0x67')],{'transaction':_0x250961})[_0x15cd('0x28')](function(){if(!_[_0x15cd('0x84')](_0x28382c)){return _0x37df26[_0x15cd('0x85')](_0x28382c,{'transaction':_0x250961});}})[_0x15cd('0x28')](function(){_0x28382c[_0x15cd('0x70')](function(_0x539f52){socket['emit'](_0x15cd('0x86'),{'UserId':_0x539f52,'WhatsappQueueId':_0x37df26['id']});});});});});});})['then'](respondWithStatusCode(_0x4833b4,null))['catch'](handleError(_0x4833b4,null));};exports[_0x15cd('0x87')]=function(_0x25aebf,_0x1d9f0a,_0x396472){return db['WhatsappQueue']['find']({'where':{'id':_0x25aebf[_0x15cd('0x55')]['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x1d9f0a,null))[_0x15cd('0x28')](function(_0x3ed62a){if(_0x3ed62a){return _0x3ed62a['addAgents'](_0x25aebf[_0x15cd('0x4c')][_0x15cd('0x67')],_[_0x15cd('0x88')](_0x25aebf[_0x15cd('0x4c')],['ids','id'])||{})[_0x15cd('0x89')](function(_0x591e3b){for(var _0x575dde=0x0;_0x575dde<_0x25aebf[_0x15cd('0x4c')][_0x15cd('0x67')][_0x15cd('0x4a')];_0x575dde+=0x1){socket[_0x15cd('0x71')](_0x15cd('0x72'),{'UserId':Number(_0x25aebf[_0x15cd('0x4c')][_0x15cd('0x67')][_0x575dde]),'WhatsappQueueId':Number(_0x25aebf['params']['id'])});}return _0x591e3b;});}})['then'](respondWithResult(_0x1d9f0a,null))[_0x15cd('0x48')](handleError(_0x1d9f0a,null));};exports[_0x15cd('0x85')]=function(_0x1ade82,_0x98342f,_0x18d181){return db[_0x15cd('0x46')][_0x15cd('0x53')]({'where':{'id':_0x1ade82['params']['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x98342f,null))[_0x15cd('0x28')](function(_0x43ddbe){if(_0x43ddbe){return _0x43ddbe[_0x15cd('0x85')](_0x1ade82[_0x15cd('0x36')][_0x15cd('0x67')])[_0x15cd('0x28')](function(){if(_[_0x15cd('0x8a')](_0x1ade82[_0x15cd('0x36')][_0x15cd('0x67')])){for(var _0x1a3868=0x0;_0x1a3868<_0x1ade82['query'][_0x15cd('0x67')][_0x15cd('0x4a')];_0x1a3868+=0x1){socket[_0x15cd('0x71')](_0x15cd('0x86'),{'UserId':Number(_0x1ade82[_0x15cd('0x36')]['ids'][_0x1a3868]),'WhatsappQueueId':Number(_0x1ade82[_0x15cd('0x55')]['id'])});}}else{socket['emit'](_0x15cd('0x86'),{'UserId':Number(_0x1ade82['query'][_0x15cd('0x67')]),'WhatsappQueueId':Number(_0x1ade82['params']['id'])});}});}})[_0x15cd('0x28')](respondWithStatusCode(_0x98342f,null))[_0x15cd('0x48')](handleError(_0x98342f,null));};exports['getAgents']=function(_0x9d510,_0x280baf,_0x28e0b0){var _0x1ecc3b={};var _0x4e3dcc={};var _0x29825d;var _0x48db2a;return db[_0x15cd('0x46')][_0x15cd('0x57')]({'where':{'id':_0x9d510['params']['id']}})[_0x15cd('0x28')](handleEntityNotFound(_0x280baf,null))[_0x15cd('0x28')](function(_0x5ef0a1){if(_0x5ef0a1){_0x29825d=_0x5ef0a1;_0x4e3dcc[_0x15cd('0x34')]=_[_0x15cd('0x37')](db[_0x15cd('0x5c')]['rawAttributes']);_0x4e3dcc[_0x15cd('0x36')]=_[_0x15cd('0x37')](_0x9d510[_0x15cd('0x36')]);_0x4e3dcc[_0x15cd('0x3e')]=_[_0x15cd('0x38')](_0x4e3dcc['model'],_0x4e3dcc[_0x15cd('0x36')]);_0x1ecc3b[_0x15cd('0x39')]=_['intersection'](_0x4e3dcc['model'],qs[_0x15cd('0x3a')](_0x9d510[_0x15cd('0x36')]['fields']));_0x1ecc3b[_0x15cd('0x39')]=_0x1ecc3b[_0x15cd('0x39')][_0x15cd('0x4a')]?_0x1ecc3b['attributes']:_0x4e3dcc[_0x15cd('0x34')];_0x1ecc3b[_0x15cd('0x5a')]=qs[_0x15cd('0x3c')](_0x9d510[_0x15cd('0x36')][_0x15cd('0x3c')]);_0x1ecc3b[_0x15cd('0x3d')]=qs[_0x15cd('0x3e')](_[_0x15cd('0x3f')](_0x9d510[_0x15cd('0x36')],_0x4e3dcc['filters']));if(_0x9d510['query'][_0x15cd('0x40')]){_0x1ecc3b[_0x15cd('0x3d')]=_[_0x15cd('0x41')](_0x1ecc3b[_0x15cd('0x3d')],{'$or':_[_0x15cd('0x35')](_0x1ecc3b[_0x15cd('0x39')],function(_0x168c61){var _0x930ec6={};_0x930ec6[_0x168c61]={'$like':'%'+_0x9d510[_0x15cd('0x36')][_0x15cd('0x40')]+'%'};return _0x930ec6;})});}_0x1ecc3b=_[_0x15cd('0x41')]({},_0x1ecc3b,_0x9d510['options']);return _0x29825d['getAgents'](_0x1ecc3b);}})['then'](function(_0x28563c){if(_0x28563c){_0x48db2a=_0x28563c['length'];if(!_0x9d510[_0x15cd('0x36')]['hasOwnProperty'](_0x15cd('0x59'))){_0x1ecc3b[_0x15cd('0x22')]=qs['limit'](_0x9d510[_0x15cd('0x36')][_0x15cd('0x22')]);_0x1ecc3b[_0x15cd('0x20')]=qs[_0x15cd('0x20')](_0x9d510[_0x15cd('0x36')][_0x15cd('0x20')]);}return _0x29825d['getAgents'](_0x1ecc3b);}})[_0x15cd('0x28')](function(_0x145be4){if(_0x145be4){return _0x145be4?{'count':_0x48db2a,'rows':_0x145be4}:null;}})[_0x15cd('0x28')](respondWithResult(_0x280baf,null))['catch'](handleError(_0x280baf,null));};
\ No newline at end of file
index b880a31..39acfa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15a5=['setMaxListeners','remove','emit','hook','events','../../mysqldb','WhatsappQueue'];(function(_0x5efbd0,_0x299553){var _0x475ec9=function(_0x3752ec){while(--_0x3752ec){_0x5efbd0['push'](_0x5efbd0['shift']());}};_0x475ec9(++_0x299553);}(_0x15a5,0x14d));var _0x515a=function(_0xbd72ab,_0x584e04){_0xbd72ab=_0xbd72ab-0x0;var _0x3284cf=_0x15a5[_0xbd72ab];return _0x3284cf;};'use strict';var EventEmitter=require(_0x515a('0x0'));var WhatsappQueue=require(_0x515a('0x1'))['db'][_0x515a('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x515a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x515a('0x4')};function emitEvent(_0x5bd119){return function(_0x1a658e,_0x5d9a98,_0x394ab0){WhatsappQueueEvents[_0x515a('0x5')](_0x5bd119+':'+_0x1a658e['id'],_0x1a658e);WhatsappQueueEvents[_0x515a('0x5')](_0x5bd119,_0x1a658e);_0x394ab0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x515a('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x2bfb=['exports','../../mysqldb','WhatsappQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x156840,_0x5b00d2){var _0x266d21=function(_0x448857){while(--_0x448857){_0x156840['push'](_0x156840['shift']());}};_0x266d21(++_0x5b00d2);}(_0x2bfb,0x99));var _0xb2bf=function(_0x58f896,_0x30488e){_0x58f896=_0x58f896-0x0;var _0x15f069=_0x2bfb[_0x58f896];return _0x15f069;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xb2bf('0x0'))['db'][_0xb2bf('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb2bf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb2bf('0x3'),'afterDestroy':_0xb2bf('0x4')};function emitEvent(_0x1a374e){return function(_0x46bc43,_0xd3fb70,_0x21d855){WhatsappQueueEvents[_0xb2bf('0x5')](_0x1a374e+':'+_0x46bc43['id'],_0x46bc43);WhatsappQueueEvents[_0xb2bf('0x5')](_0x1a374e,_0x46bc43);_0x21d855(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb2bf('0x6')](e,emitEvent(event));}}module[_0xb2bf('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index ffb4f87..41ab0d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c42=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','whatsapp_queues'];(function(_0x1bab18,_0xcf062){var _0x464bd7=function(_0x5008fc){while(--_0x5008fc){_0x1bab18['push'](_0x1bab18['shift']());}};_0x464bd7(++_0xcf062);}(_0x9c42,0x140));var _0x29c4=function(_0xec034,_0x16c358){_0xec034=_0xec034-0x0;var _0x2c5a19=_0x9c42[_0xec034];return _0x2c5a19;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x29c4('0x0'))(_0x29c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x29c4('0x2'));var fs=require('fs');var path=require(_0x29c4('0x3'));var rimraf=require(_0x29c4('0x4'));var config=require(_0x29c4('0x5'));var attributes=require('./whatsappQueue.attributes');module[_0x29c4('0x6')]=function(_0x54d352,_0xfd8d2c){return _0x54d352['define']('WhatsappQueue',attributes,{'tableName':_0x29c4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x954c=['WhatsappQueue','../../config/logger','api','bluebird','path','rimraf','./whatsappQueue.attributes','exports'];(function(_0x22bf34,_0x39b747){var _0x284714=function(_0x14dd96){while(--_0x14dd96){_0x22bf34['push'](_0x22bf34['shift']());}};_0x284714(++_0x39b747);}(_0x954c,0x1b1));var _0xc954=function(_0x13b4e7,_0xb89b59){_0x13b4e7=_0x13b4e7-0x0;var _0x1b95fc=_0x954c[_0x13b4e7];return _0x1b95fc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc954('0x0'))(_0xc954('0x1'));var moment=require('moment');var BPromise=require(_0xc954('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc954('0x3'));var rimraf=require(_0xc954('0x4'));var config=require('../../config/environment');var attributes=require(_0xc954('0x5'));module[_0xc954('0x6')]=function(_0x5a25d4,_0x2bea43){return _0x5a25d4['define'](_0xc954('0x7'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87ad285..11724c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a82=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then'];(function(_0x31f86e,_0x49ef55){var _0x3018c4=function(_0x41d0ed){while(--_0x41d0ed){_0x31f86e['push'](_0x31f86e['shift']());}};_0x3018c4(++_0x49ef55);}(_0x7a82,0x69));var _0x27a8=function(_0x174e00,_0x225f0c){_0x174e00=_0x174e00-0x0;var _0x346cdf=_0x7a82[_0x174e00];return _0x346cdf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x27a8('0x0'));var BPromise=require('bluebird');var rs=require(_0x27a8('0x1'));var fs=require('fs');var Redis=require(_0x27a8('0x2'));var db=require(_0x27a8('0x3'))['db'];var utils=require(_0x27a8('0x4'));var logger=require(_0x27a8('0x5'))('rpc');var config=require(_0x27a8('0x6'));var jayson=require(_0x27a8('0x7'));var client=jayson[_0x27a8('0x8')][_0x27a8('0x9')]({'port':0x232a});config[_0x27a8('0xa')]=_[_0x27a8('0xb')](config['redis'],{'host':_0x27a8('0xc'),'port':0x18eb});var socket=require(_0x27a8('0xd'))(new Redis(config['redis']));require(_0x27a8('0xe'))[_0x27a8('0xf')](socket);function respondWithRpcPromise(_0x46070f,_0x6d0f5f,_0x530647){return new BPromise(function(_0x4f0bfd,_0x5d35d7){return client[_0x27a8('0x10')](_0x46070f,_0x530647)[_0x27a8('0x11')](function(_0x5bbf06){logger[_0x27a8('0x12')](_0x27a8('0x13'),_0x6d0f5f,_0x27a8('0x14'));logger[_0x27a8('0x15')](_0x27a8('0x16'),_0x6d0f5f,_0x27a8('0x14'),JSON[_0x27a8('0x17')](_0x5bbf06));if(_0x5bbf06['error']){if(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x19')]===0x1f4){logger[_0x27a8('0x18')](_0x27a8('0x13'),_0x6d0f5f,_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);return _0x5d35d7(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);}logger[_0x27a8('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x6d0f5f,_0x5bbf06[_0x27a8('0x18')]['message']);return _0x4f0bfd(_0x5bbf06[_0x27a8('0x18')][_0x27a8('0x1a')]);}else{logger[_0x27a8('0x12')](_0x27a8('0x13'),_0x6d0f5f,_0x27a8('0x14'));_0x4f0bfd(_0x5bbf06['result']['message']);}})[_0x27a8('0x1b')](function(_0x50f448){logger[_0x27a8('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x6d0f5f,_0x50f448);_0x5d35d7(_0x50f448);});});}exports[_0x27a8('0x1c')]=function(_0x5cf0be){var _0x11a98e=this;return new Promise(function(_0x5f4a2a,_0x57c16b){return db[_0x27a8('0x1d')][_0x27a8('0x1e')]({'raw':_0x5cf0be['options']?_0x5cf0be[_0x27a8('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x20')]||null:null,'attributes':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x21')]||null:null,'limit':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x22')]||null:null,'include':_0x5cf0be[_0x27a8('0x1f')]?_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x23')]?_[_0x27a8('0x24')](_0x5cf0be[_0x27a8('0x1f')][_0x27a8('0x23')],function(_0x1ba393){return{'model':db[_0x1ba393[_0x27a8('0x25')]],'as':_0x1ba393['as'],'attributes':_0x1ba393[_0x27a8('0x21')],'include':_0x1ba393[_0x27a8('0x23')]?_['map'](_0x1ba393[_0x27a8('0x23')],function(_0x188ad5){return{'model':db[_0x188ad5[_0x27a8('0x25')]],'as':_0x188ad5['as'],'attributes':_0x188ad5[_0x27a8('0x21')],'include':_0x188ad5['include']?_[_0x27a8('0x24')](_0x188ad5['include'],function(_0x3c1ce9){return{'model':db[_0x3c1ce9[_0x27a8('0x25')]],'as':_0x3c1ce9['as'],'attributes':_0x3c1ce9[_0x27a8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd4a5a1){logger[_0x27a8('0x12')]('GetWhatsappQueue',_0x5cf0be);logger[_0x27a8('0x15')](_0x27a8('0x1c'),_0x5cf0be,JSON[_0x27a8('0x17')](_0xd4a5a1));_0x5f4a2a(_0xd4a5a1);})[_0x27a8('0x1b')](function(_0x8b854c){logger[_0x27a8('0x18')](_0x27a8('0x1c'),_0x8b854c[_0x27a8('0x1a')],_0x5cf0be);_0x57c16b(_0x11a98e[_0x27a8('0x18')](0x1f4,_0x8b854c['message']));});});};exports[_0x27a8('0x26')]=function(_0x1f4165){var _0x5a2403=this;return new Promise(function(_0x5e8cf2,_0x4862fa){return db[_0x27a8('0x1d')][_0x27a8('0x27')]({'raw':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165['options'][_0x27a8('0x28')]===undefined?!![]:![]:!![],'where':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165[_0x27a8('0x1f')][_0x27a8('0x20')]||null:null,'attributes':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165['options'][_0x27a8('0x21')]||null:null,'include':_0x1f4165[_0x27a8('0x1f')]?_0x1f4165[_0x27a8('0x1f')][_0x27a8('0x23')]?_[_0x27a8('0x24')](_0x1f4165['options'][_0x27a8('0x23')],function(_0x265df8){return{'model':db[_0x265df8[_0x27a8('0x25')]],'as':_0x265df8['as'],'attributes':_0x265df8[_0x27a8('0x21')],'include':_0x265df8['include']?_[_0x27a8('0x24')](_0x265df8[_0x27a8('0x23')],function(_0x532609){return{'model':db[_0x532609[_0x27a8('0x25')]],'as':_0x532609['as'],'attributes':_0x532609['attributes'],'include':_0x532609['include']?_[_0x27a8('0x24')](_0x532609[_0x27a8('0x23')],function(_0x388528){return{'model':db[_0x388528[_0x27a8('0x25')]],'as':_0x388528['as'],'attributes':_0x388528[_0x27a8('0x21')]};}):[]};}):[]};}):[]:[]})[_0x27a8('0x11')](function(_0x19d0de){logger[_0x27a8('0x12')](_0x27a8('0x26'),_0x1f4165);logger[_0x27a8('0x15')](_0x27a8('0x26'),_0x1f4165,JSON[_0x27a8('0x17')](_0x19d0de));_0x5e8cf2(_0x19d0de);})['catch'](function(_0x3c24ed){logger[_0x27a8('0x18')]('ShowWhatsappQueue',_0x3c24ed[_0x27a8('0x1a')],_0x1f4165);_0x4862fa(_0x5a2403[_0x27a8('0x18')](0x1f4,_0x3c24ed['message']));});});};
\ No newline at end of file
+var _0x0d64=['register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetWhatsappQueue','ShowWhatsappQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappQueue.socket'];(function(_0x55967d,_0x160110){var _0x3a926b=function(_0x21877e){while(--_0x21877e){_0x55967d['push'](_0x55967d['shift']());}};_0x3a926b(++_0x160110);}(_0x0d64,0x1ed));var _0x40d6=function(_0x5ea7e0,_0x2f46f2){_0x5ea7e0=_0x5ea7e0-0x0;var _0x1c49c7=_0x0d64[_0x5ea7e0];return _0x1c49c7;};'use strict';var _=require('lodash');var util=require(_0x40d6('0x0'));var moment=require(_0x40d6('0x1'));var BPromise=require(_0x40d6('0x2'));var rs=require(_0x40d6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x40d6('0x4'))['db'];var utils=require(_0x40d6('0x5'));var logger=require(_0x40d6('0x6'))('rpc');var config=require(_0x40d6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x40d6('0x8')][_0x40d6('0x9')]({'port':0x232a});config[_0x40d6('0xa')]=_[_0x40d6('0xb')](config[_0x40d6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x40d6('0xc'))(new Redis(config[_0x40d6('0xa')]));require(_0x40d6('0xd'))[_0x40d6('0xe')](socket);function respondWithRpcPromise(_0x2e6fdf,_0x35d17f,_0x56da4f){return new BPromise(function(_0x3be47a,_0x30b021){return client[_0x40d6('0xf')](_0x2e6fdf,_0x56da4f)['then'](function(_0x245fbf){logger[_0x40d6('0x10')](_0x40d6('0x11'),_0x35d17f,_0x40d6('0x12'));logger[_0x40d6('0x13')](_0x40d6('0x14'),_0x35d17f,_0x40d6('0x12'),JSON[_0x40d6('0x15')](_0x245fbf));if(_0x245fbf[_0x40d6('0x16')]){if(_0x245fbf[_0x40d6('0x16')]['code']===0x1f4){logger['error'](_0x40d6('0x11'),_0x35d17f,_0x245fbf[_0x40d6('0x16')]['message']);return _0x30b021(_0x245fbf[_0x40d6('0x16')][_0x40d6('0x17')]);}logger[_0x40d6('0x16')](_0x40d6('0x11'),_0x35d17f,_0x245fbf['error']['message']);return _0x3be47a(_0x245fbf['error']['message']);}else{logger[_0x40d6('0x10')](_0x40d6('0x11'),_0x35d17f,_0x40d6('0x12'));_0x3be47a(_0x245fbf[_0x40d6('0x18')][_0x40d6('0x17')]);}})[_0x40d6('0x19')](function(_0x4f38cd){logger[_0x40d6('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x35d17f,_0x4f38cd);_0x30b021(_0x4f38cd);});});}exports['GetWhatsappQueue']=function(_0x5b1a2f){var _0x2752c5=this;return new Promise(function(_0x444ec1,_0x18dda1){return db[_0x40d6('0x1a')][_0x40d6('0x1b')]({'raw':_0x5b1a2f[_0x40d6('0x1c')]?_0x5b1a2f[_0x40d6('0x1c')][_0x40d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b1a2f['options']?_0x5b1a2f['options'][_0x40d6('0x1e')]||null:null,'attributes':_0x5b1a2f[_0x40d6('0x1c')]?_0x5b1a2f[_0x40d6('0x1c')]['attributes']||null:null,'limit':_0x5b1a2f[_0x40d6('0x1c')]?_0x5b1a2f['options'][_0x40d6('0x1f')]||null:null,'include':_0x5b1a2f['options']?_0x5b1a2f[_0x40d6('0x1c')][_0x40d6('0x20')]?_[_0x40d6('0x21')](_0x5b1a2f[_0x40d6('0x1c')][_0x40d6('0x20')],function(_0x1e83e4){return{'model':db[_0x1e83e4[_0x40d6('0x22')]],'as':_0x1e83e4['as'],'attributes':_0x1e83e4['attributes'],'include':_0x1e83e4[_0x40d6('0x20')]?_['map'](_0x1e83e4[_0x40d6('0x20')],function(_0x4f452f){return{'model':db[_0x4f452f[_0x40d6('0x22')]],'as':_0x4f452f['as'],'attributes':_0x4f452f[_0x40d6('0x23')],'include':_0x4f452f[_0x40d6('0x20')]?_['map'](_0x4f452f['include'],function(_0x450296){return{'model':db[_0x450296[_0x40d6('0x22')]],'as':_0x450296['as'],'attributes':_0x450296[_0x40d6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x40d6('0x24')](function(_0x5a22d0){logger['info']('GetWhatsappQueue',_0x5b1a2f);logger[_0x40d6('0x13')]('GetWhatsappQueue',_0x5b1a2f,JSON[_0x40d6('0x15')](_0x5a22d0));_0x444ec1(_0x5a22d0);})[_0x40d6('0x19')](function(_0x350143){logger['error'](_0x40d6('0x25'),_0x350143[_0x40d6('0x17')],_0x5b1a2f);_0x18dda1(_0x2752c5['error'](0x1f4,_0x350143[_0x40d6('0x17')]));});});};exports[_0x40d6('0x26')]=function(_0x596b2d){var _0x293c56=this;return new Promise(function(_0x177032,_0x5ecc38){return db[_0x40d6('0x1a')]['find']({'raw':_0x596b2d[_0x40d6('0x1c')]?_0x596b2d['options'][_0x40d6('0x1d')]===undefined?!![]:![]:!![],'where':_0x596b2d[_0x40d6('0x1c')]?_0x596b2d['options'][_0x40d6('0x1e')]||null:null,'attributes':_0x596b2d[_0x40d6('0x1c')]?_0x596b2d[_0x40d6('0x1c')][_0x40d6('0x23')]||null:null,'include':_0x596b2d[_0x40d6('0x1c')]?_0x596b2d['options'][_0x40d6('0x20')]?_['map'](_0x596b2d['options'][_0x40d6('0x20')],function(_0x4a4a3e){return{'model':db[_0x4a4a3e['model']],'as':_0x4a4a3e['as'],'attributes':_0x4a4a3e['attributes'],'include':_0x4a4a3e[_0x40d6('0x20')]?_[_0x40d6('0x21')](_0x4a4a3e[_0x40d6('0x20')],function(_0x41bd5a){return{'model':db[_0x41bd5a[_0x40d6('0x22')]],'as':_0x41bd5a['as'],'attributes':_0x41bd5a[_0x40d6('0x23')],'include':_0x41bd5a[_0x40d6('0x20')]?_[_0x40d6('0x21')](_0x41bd5a['include'],function(_0xf698a0){return{'model':db[_0xf698a0[_0x40d6('0x22')]],'as':_0xf698a0['as'],'attributes':_0xf698a0[_0x40d6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x40d6('0x24')](function(_0xf5b9a){logger[_0x40d6('0x10')](_0x40d6('0x26'),_0x596b2d);logger[_0x40d6('0x13')]('ShowWhatsappQueue',_0x596b2d,JSON[_0x40d6('0x15')](_0xf5b9a));_0x177032(_0xf5b9a);})['catch'](function(_0x1ff532){logger[_0x40d6('0x16')](_0x40d6('0x26'),_0x1ff532[_0x40d6('0x17')],_0x596b2d);_0x5ecc38(_0x293c56['error'](0x1f4,_0x1ff532['message']));});});};
\ No newline at end of file
index 29b6044..1c8e5ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a3=['update','emit','removeListener','register','length','./whatsappQueue.events','remove'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x73a3,0x15c));var _0x373a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x73a3[_0xbd08b4];return _0x314f1e;};'use strict';var WhatsappQueueEvents=require(_0x373a('0x0'));var events=['save',_0x373a('0x1'),_0x373a('0x2')];function createListener(_0x1978bd,_0x26b776){return function(_0x5d4377){_0x26b776[_0x373a('0x3')](_0x1978bd,_0x5d4377);};}function removeListener(_0x2e5fcc,_0x4a4971){return function(){WhatsappQueueEvents[_0x373a('0x4')](_0x2e5fcc,_0x4a4971);};}exports[_0x373a('0x5')]=function(_0x34c1ea){for(var _0x113987=0x0,_0x49ff86=events[_0x373a('0x6')];_0x113987<_0x49ff86;_0x113987++){var _0x1a24e3=events[_0x113987];var _0x42f315=createListener('whatsappQueue:'+_0x1a24e3,_0x34c1ea);WhatsappQueueEvents['on'](_0x1a24e3,_0x42f315);}};
\ No newline at end of file
+var _0xf4dd=['emit','removeListener','register','length','./whatsappQueue.events','save'];(function(_0x2fe7b6,_0x3f7dab){var _0x269746=function(_0x2dd431){while(--_0x2dd431){_0x2fe7b6['push'](_0x2fe7b6['shift']());}};_0x269746(++_0x3f7dab);}(_0xf4dd,0x1a8));var _0xdf4d=function(_0x1b15e7,_0x458584){_0x1b15e7=_0x1b15e7-0x0;var _0x3c6b96=_0xf4dd[_0x1b15e7];return _0x3c6b96;};'use strict';var WhatsappQueueEvents=require(_0xdf4d('0x0'));var events=[_0xdf4d('0x1'),'remove','update'];function createListener(_0x2c5004,_0x10ab63){return function(_0x41cf9a){_0x10ab63[_0xdf4d('0x2')](_0x2c5004,_0x41cf9a);};}function removeListener(_0x464e50,_0x1e3dc6){return function(){WhatsappQueueEvents[_0xdf4d('0x3')](_0x464e50,_0x1e3dc6);};}exports[_0xdf4d('0x4')]=function(_0x5762a8){for(var _0x55c9fa=0x0,_0x8fa96f=events[_0xdf4d('0x5')];_0x55c9fa<_0x8fa96f;_0x55c9fa++){var _0x2c27d7=events[_0x55c9fa];var _0x22f0c5=createListener('whatsappQueue:'+_0x2c27d7,_0x5762a8);WhatsappQueueEvents['on'](_0x2c27d7,_0x22f0c5);}};
\ No newline at end of file
index 3c61b25..3e18aa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40e0=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x5bcb50,_0x7861a){var _0x54bc84=function(_0x25639b){while(--_0x25639b){_0x5bcb50['push'](_0x5bcb50['shift']());}};_0x54bc84(++_0x7861a);}(_0x40e0,0x1b9));var _0x040e=function(_0x490699,_0x161e16){_0x490699=_0x490699-0x0;var _0x207b0a=_0x40e0[_0x490699];return _0x207b0a;};'use strict';var multer=require(_0x040e('0x0'));var util=require(_0x040e('0x1'));var path=require(_0x040e('0x2'));var timeout=require('connect-timeout');var express=require(_0x040e('0x3'));var router=express[_0x040e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x040e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x040e('0x6'));var controller=require(_0x040e('0x7'));router[_0x040e('0x8')]('/',auth[_0x040e('0x9')](),controller[_0x040e('0xa')]);router[_0x040e('0x8')](_0x040e('0xb'),auth[_0x040e('0x9')](),controller[_0x040e('0xc')]);router[_0x040e('0x8')](_0x040e('0xd'),auth['isAuthenticated'](),controller[_0x040e('0xe')]);router[_0x040e('0xf')]('/',auth[_0x040e('0x9')](),controller[_0x040e('0x10')]);router[_0x040e('0x11')](_0x040e('0xd'),auth[_0x040e('0x9')](),controller['update']);router['delete'](_0x040e('0xd'),auth[_0x040e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb97a=['./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb97a,0x1af));var _0xab97=function(_0x56f915,_0x526cb2){_0x56f915=_0x56f915-0x0;var _0x32d1e2=_0xb97a[_0x56f915];return _0x32d1e2;};'use strict';var multer=require(_0xab97('0x0'));var util=require(_0xab97('0x1'));var path=require(_0xab97('0x2'));var timeout=require(_0xab97('0x3'));var express=require(_0xab97('0x4'));var router=express[_0xab97('0x5')]();var fs_extra=require(_0xab97('0x6'));var auth=require(_0xab97('0x7'));var interaction=require(_0xab97('0x8'));var config=require(_0xab97('0x9'));var controller=require(_0xab97('0xa'));router['get']('/',auth[_0xab97('0xb')](),controller[_0xab97('0xc')]);router[_0xab97('0xd')](_0xab97('0xe'),auth['isAuthenticated'](),controller[_0xab97('0xf')]);router[_0xab97('0xd')](_0xab97('0x10'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xab97('0xb')](),controller[_0xab97('0x11')]);router[_0xab97('0x12')](_0xab97('0x10'),auth['isAuthenticated'](),controller[_0xab97('0x13')]);router['delete'](_0xab97('0x10'),auth[_0xab97('0xb')](),controller[_0xab97('0x14')]);module['exports']=router;
\ No newline at end of file
index 005a389..196b107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x25a71b,_0x4799c8){var _0xcfa61d=function(_0x2e4602){while(--_0x2e4602){_0x25a71b['push'](_0x25a71b['shift']());}};_0xcfa61d(++_0x4799c8);}(_0x7a54,0x106));var _0x47a5=function(_0x75ca63,_0x155c82){_0x75ca63=_0x75ca63-0x0;var _0x39bae8=_0x7a54[_0x75ca63];return _0x39bae8;};'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(_0x40c279,_0x1841e4){var _0x4d3d7a=function(_0x2fe690){while(--_0x2fe690){_0x40c279['push'](_0x40c279['shift']());}};_0x4d3d7a(++_0x1841e4);}(_0x7a54,0x106));var _0x47a5=function(_0x354213,_0xdbb150){_0x354213=_0x354213-0x0;var _0xbb1c1=_0x7a54[_0x354213];return _0xbb1c1;};'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 9a7efd9..561f6a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc900=['filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query'];(function(_0x5fc42c,_0x42ff9a){var _0x3b791a=function(_0x19052c){while(--_0x19052c){_0x5fc42c['push'](_0x5fc42c['shift']());}};_0x3b791a(++_0x42ff9a);}(_0xc900,0xb3));var _0x0c90=function(_0x473cb7,_0x2e8642){_0x473cb7=_0x473cb7-0x0;var _0x43ce02=_0xc900[_0x473cb7];return _0x43ce02;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];function respondWithStatusCode(_0x50e7db,_0x459cdb){_0x459cdb=_0x459cdb||0xcc;return function(_0x26fc46){if(_0x26fc46){return _0x50e7db[_0x0c90('0x19')](_0x459cdb);}return _0x50e7db[_0x0c90('0x1a')](_0x459cdb)[_0x0c90('0x1b')]();};}function respondWithResult(_0x59ea8e,_0x467b32){_0x467b32=_0x467b32||0xc8;return function(_0x4451e0){if(_0x4451e0){return _0x59ea8e['status'](_0x467b32)[_0x0c90('0x1c')](_0x4451e0);}};}function respondWithFilteredResult(_0x3a492d,_0x3bd5e8){return function(_0x5bef7d){if(_0x5bef7d){var _0x5daeb7=typeof _0x3bd5e8[_0x0c90('0x1d')]===_0x0c90('0x1e')&&typeof _0x3bd5e8[_0x0c90('0x1f')]===_0x0c90('0x1e');var _0x276b92=_0x5bef7d[_0x0c90('0x20')];var _0x42321a=_0x5daeb7?0x0:_0x3bd5e8['offset'];var _0xc3bb47=_0x5daeb7?_0x5bef7d[_0x0c90('0x20')]:_0x3bd5e8[_0x0c90('0x1d')]+_0x3bd5e8[_0x0c90('0x1f')];var _0x594267;if(_0xc3bb47>=_0x276b92){_0xc3bb47=_0x276b92;_0x594267=0xc8;}else{_0x594267=0xce;}_0x3a492d[_0x0c90('0x1a')](_0x594267);return _0x3a492d[_0x0c90('0x21')](_0x0c90('0x22'),_0x42321a+'-'+_0xc3bb47+'/'+_0x276b92)[_0x0c90('0x1c')](_0x5bef7d);}return null;};}function patchUpdates(_0x315932){return function(_0xc08f54){try{jsonpatch['apply'](_0xc08f54,_0x315932,!![]);}catch(_0x365a42){return BPromise['reject'](_0x365a42);}return _0xc08f54[_0x0c90('0x23')]();};}function saveUpdates(_0x1a021e,_0x47b13c){return function(_0x2a053a){if(_0x2a053a){return _0x2a053a[_0x0c90('0x24')](_0x1a021e)[_0x0c90('0x25')](function(_0x86dee){return _0x86dee;});}return null;};}function removeEntity(_0x212164,_0x3b287c){return function(_0x4dfbc3){if(_0x4dfbc3){return _0x4dfbc3[_0x0c90('0x26')]()[_0x0c90('0x25')](function(){_0x212164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28d005,_0x3ea861){return function(_0x35c243){if(!_0x35c243){_0x28d005[_0x0c90('0x19')](0x194);}return _0x35c243;};}function handleError(_0x4dde67,_0x2dfa14){_0x2dfa14=_0x2dfa14||0x1f4;return function(_0x438652){logger[_0x0c90('0x27')](_0x438652[_0x0c90('0x28')]);if(_0x438652[_0x0c90('0x29')]){delete _0x438652[_0x0c90('0x29')];}_0x4dde67['status'](_0x2dfa14)[_0x0c90('0x2a')](_0x438652);};}exports[_0x0c90('0x2b')]=function(_0x39f1b2,_0x13b377){var _0x52d28d={},_0x4c8603={},_0x1f27f1={'count':0x0,'rows':[]};var _0x25da6e=_[_0x0c90('0x2c')](db[_0x0c90('0x2d')][_0x0c90('0x2e')],function(_0x562664){return{'name':_0x562664[_0x0c90('0x2f')],'type':_0x562664[_0x0c90('0x30')][_0x0c90('0x31')]};});_0x4c8603['model']=_[_0x0c90('0x2c')](_0x25da6e,'name');_0x4c8603['query']=_[_0x0c90('0x32')](_0x39f1b2[_0x0c90('0x33')]);_0x4c8603[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x4c8603['model'],_0x4c8603[_0x0c90('0x33')]);_0x52d28d['attributes']=_[_0x0c90('0x35')](_0x4c8603['model'],qs[_0x0c90('0x36')](_0x39f1b2[_0x0c90('0x33')]['fields']));_0x52d28d[_0x0c90('0x37')]=_0x52d28d[_0x0c90('0x37')][_0x0c90('0x38')]?_0x52d28d[_0x0c90('0x37')]:_0x4c8603[_0x0c90('0x39')];if(!_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3a')](_0x0c90('0x3b'))){_0x52d28d['limit']=qs[_0x0c90('0x1f')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1f')]);_0x52d28d[_0x0c90('0x1d')]=qs['offset'](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1d')]);}_0x52d28d[_0x0c90('0x3c')]=qs[_0x0c90('0x3d')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3d')]);_0x52d28d[_0x0c90('0x3e')]=qs[_0x0c90('0x34')](_['pick'](_0x39f1b2[_0x0c90('0x33')],_0x4c8603[_0x0c90('0x34')]),_0x25da6e);if(_0x39f1b2['query'][_0x0c90('0x3f')]){_0x52d28d[_0x0c90('0x3e')]=_[_0x0c90('0x40')](_0x52d28d[_0x0c90('0x3e')],{'$or':_[_0x0c90('0x2c')](_0x25da6e,function(_0x50c126){if(_0x50c126[_0x0c90('0x30')]!==_0x0c90('0x41')){var _0x11530f={};_0x11530f[_0x50c126[_0x0c90('0x29')]]={'$like':'%'+_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3f')]+'%'};return _0x11530f;}})});}_0x52d28d=_[_0x0c90('0x40')]({},_0x52d28d,_0x39f1b2[_0x0c90('0x42')]);var _0x11a8e3={'where':_0x52d28d['where']};return db[_0x0c90('0x2d')]['count'](_0x11a8e3)[_0x0c90('0x25')](function(_0x593cc0){_0x1f27f1[_0x0c90('0x20')]=_0x593cc0;if(_0x39f1b2[_0x0c90('0x33')]['includeAll']){_0x52d28d['include']=[{'all':!![]}];}return db[_0x0c90('0x2d')]['findAll'](_0x52d28d);})[_0x0c90('0x25')](function(_0x4545bb){_0x1f27f1[_0x0c90('0x43')]=_0x4545bb;return _0x1f27f1;})['then'](respondWithFilteredResult(_0x13b377,_0x52d28d))[_0x0c90('0x44')](handleError(_0x13b377,null));};exports[_0x0c90('0x45')]=function(_0x123b58,_0x3e5137){var _0x2139c3={'raw':!![],'where':{'id':_0x123b58['params']['id']}},_0x1184c4={};_0x1184c4[_0x0c90('0x39')]=_[_0x0c90('0x32')](db[_0x0c90('0x2d')][_0x0c90('0x2e')]);_0x1184c4[_0x0c90('0x33')]=_[_0x0c90('0x32')](_0x123b58[_0x0c90('0x33')]);_0x1184c4['filters']=_[_0x0c90('0x35')](_0x1184c4['model'],_0x1184c4[_0x0c90('0x33')]);_0x2139c3[_0x0c90('0x37')]=_[_0x0c90('0x35')](_0x1184c4[_0x0c90('0x39')],qs[_0x0c90('0x36')](_0x123b58[_0x0c90('0x33')][_0x0c90('0x36')]));_0x2139c3[_0x0c90('0x37')]=_0x2139c3[_0x0c90('0x37')][_0x0c90('0x38')]?_0x2139c3[_0x0c90('0x37')]:_0x1184c4[_0x0c90('0x39')];if(_0x123b58[_0x0c90('0x33')][_0x0c90('0x46')]){_0x2139c3[_0x0c90('0x47')]=[{'all':!![]}];}_0x2139c3=_['merge']({},_0x2139c3,_0x123b58[_0x0c90('0x42')]);return db[_0x0c90('0x2d')][_0x0c90('0x48')](_0x2139c3)[_0x0c90('0x25')](handleEntityNotFound(_0x3e5137,null))[_0x0c90('0x25')](respondWithResult(_0x3e5137,null))[_0x0c90('0x44')](handleError(_0x3e5137,null));};exports[_0x0c90('0x49')]=function(_0x302dc6,_0x3bb138){return db[_0x0c90('0x2d')][_0x0c90('0x49')](_0x302dc6[_0x0c90('0x4a')],{})[_0x0c90('0x25')](respondWithResult(_0x3bb138,0xc9))[_0x0c90('0x44')](handleError(_0x3bb138,null));};exports['update']=function(_0x1b4aac,_0x38f492){if(_0x1b4aac['body']['id']){delete _0x1b4aac['body']['id'];}return db['WhatsappQueueReport'][_0x0c90('0x48')]({'where':{'id':_0x1b4aac[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x38f492,null))[_0x0c90('0x25')](saveUpdates(_0x1b4aac[_0x0c90('0x4a')],null))['then'](respondWithResult(_0x38f492,null))[_0x0c90('0x44')](handleError(_0x38f492,null));};exports[_0x0c90('0x26')]=function(_0x2b756d,_0x549c78){return db[_0x0c90('0x2d')][_0x0c90('0x48')]({'where':{'id':_0x2b756d[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x549c78,null))[_0x0c90('0x25')](removeEntity(_0x549c78,null))[_0x0c90('0x44')](handleError(_0x549c78,null));};exports[_0x0c90('0x4c')]=function(_0x2a339d,_0x1daeed){return db[_0x0c90('0x2d')]['describe']()[_0x0c90('0x25')](respondWithResult(_0x1daeed,null))['catch'](handleError(_0x1daeed,null));};
\ No newline at end of file
+var _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../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','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x18a577,_0x25560c){var _0x1cb0c7=function(_0x195eeb){while(--_0x195eeb){_0x18a577['push'](_0x18a577['shift']());}};_0x1cb0c7(++_0x25560c);}(_0x1c9a,0x98));var _0xa1c9=function(_0x37a312,_0x4c5be6){_0x37a312=_0x37a312-0x0;var _0x342661=_0x1c9a[_0x37a312];return _0x342661;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));};
\ No newline at end of file
index e3e3363..1a281e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x277c,0x132));var _0xc277=function(_0xae2f00,_0x32d92f){_0xae2f00=_0xae2f00-0x0;var _0x1c9147=_0x277c[_0xae2f00];return _0x1c9147;};'use strict';var _=require('lodash');var util=require(_0xc277('0x0'));var logger=require(_0xc277('0x1'))('api');var moment=require(_0xc277('0x2'));var BPromise=require(_0xc277('0x3'));var rp=require(_0xc277('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc277('0x5'));var config=require(_0xc277('0x6'));var attributes=require(_0xc277('0x7'));module[_0xc277('0x8')]=function(_0x23b82f,_0x19efbd){return _0x23b82f[_0xc277('0x9')](_0xc277('0xa'),attributes,{'tableName':_0xc277('0xb'),'paranoid':![],'indexes':[{'name':_0xc277('0xc'),'fields':[_0xc277('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x910a=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x2955ff,_0x4d043f){var _0x5deb95=function(_0x5f1cf6){while(--_0x5f1cf6){_0x2955ff['push'](_0x2955ff['shift']());}};_0x5deb95(++_0x4d043f);}(_0x910a,0x13d));var _0xa910=function(_0x5e0251,_0x3f07f9){_0x5e0251=_0x5e0251-0x0;var _0x285759=_0x910a[_0x5e0251];return _0x285759;};'use strict';var _=require(_0xa910('0x0'));var util=require(_0xa910('0x1'));var logger=require(_0xa910('0x2'))(_0xa910('0x3'));var moment=require(_0xa910('0x4'));var BPromise=require(_0xa910('0x5'));var rp=require(_0xa910('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa910('0x7'));var config=require(_0xa910('0x8'));var attributes=require(_0xa910('0x9'));module[_0xa910('0xa')]=function(_0x15844e,_0x1bc951){return _0x15844e[_0xa910('0xb')](_0xa910('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xa910('0xd'),'fields':[_0xa910('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5a21974..ccd516b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7c1=['../../config/utils','rpc','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueueReport','body','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','options','where','attributes','lodash','util','bluebird','randomstring'];(function(_0x31316c,_0x3a77c5){var _0x3c0579=function(_0x4450f7){while(--_0x4450f7){_0x31316c['push'](_0x31316c['shift']());}};_0x3c0579(++_0x3a77c5);}(_0xb7c1,0x10a));var _0x1b7c=function(_0x19fe32,_0x3ff97f){_0x19fe32=_0x19fe32-0x0;var _0x318ab7=_0xb7c1[_0x19fe32];return _0x318ab7;};'use strict';var _=require(_0x1b7c('0x0'));var util=require(_0x1b7c('0x1'));var moment=require('moment');var BPromise=require(_0x1b7c('0x2'));var rs=require(_0x1b7c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1b7c('0x4'));var logger=require('../../config/logger')(_0x1b7c('0x5'));var config=require('../../config/environment');var jayson=require(_0x1b7c('0x6'));var client=jayson[_0x1b7c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d22d5,_0x398d8a,_0x462307){return new BPromise(function(_0x558c84,_0x39dea6){return client[_0x1b7c('0x8')](_0x3d22d5,_0x462307)[_0x1b7c('0x9')](function(_0x232e10){logger[_0x1b7c('0xa')](_0x1b7c('0xb'),_0x398d8a,_0x1b7c('0xc'));logger[_0x1b7c('0xd')](_0x1b7c('0xe'),_0x398d8a,'request\x20sent',JSON[_0x1b7c('0xf')](_0x232e10));if(_0x232e10['error']){if(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x11')]===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x398d8a,_0x232e10[_0x1b7c('0x10')]['message']);return _0x39dea6(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x12')]);}logger[_0x1b7c('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x398d8a,_0x232e10[_0x1b7c('0x10')]['message']);return _0x558c84(_0x232e10[_0x1b7c('0x10')][_0x1b7c('0x12')]);}else{logger[_0x1b7c('0xa')](_0x1b7c('0xb'),_0x398d8a,_0x1b7c('0xc'));_0x558c84(_0x232e10[_0x1b7c('0x13')][_0x1b7c('0x12')]);}})[_0x1b7c('0x14')](function(_0x2f62cd){logger[_0x1b7c('0x10')](_0x1b7c('0xb'),_0x398d8a,_0x2f62cd);_0x39dea6(_0x2f62cd);});});}exports['CreateWhatsappQueueReport']=function(_0x553ee7){var _0xb08836=this;return new Promise(function(_0x2a5cc2,_0x2b5553){return db[_0x1b7c('0x15')]['create'](_0x553ee7[_0x1b7c('0x16')],{'raw':_0x553ee7['options']?_0x553ee7['options'][_0x1b7c('0x17')]===undefined?!![]:![]:!![]})[_0x1b7c('0x9')](function(_0x325b3e){logger[_0x1b7c('0xa')](_0x1b7c('0x18'),_0x553ee7);logger[_0x1b7c('0xd')](_0x1b7c('0x18'),_0x553ee7,JSON[_0x1b7c('0xf')](_0x325b3e));_0x2a5cc2(_0x325b3e);})[_0x1b7c('0x14')](function(_0x58ecd7){logger[_0x1b7c('0x10')](_0x1b7c('0x18'),_0x58ecd7[_0x1b7c('0x12')],_0x553ee7);_0x2b5553(_0xb08836[_0x1b7c('0x10')](0x1f4,_0x58ecd7[_0x1b7c('0x12')]));});});};exports[_0x1b7c('0x19')]=function(_0x19d5e8){var _0x7d9294=this;return new Promise(function(_0x3e8bd1,_0x5e4655){return db[_0x1b7c('0x15')][_0x1b7c('0x1a')](_0x19d5e8[_0x1b7c('0x16')],{'raw':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')][_0x1b7c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d5e8[_0x1b7c('0x1b')]?_0x19d5e8['options'][_0x1b7c('0x1c')]||null:null,'attributes':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')][_0x1b7c('0x1d')]||null:null,'limit':_0x19d5e8['options']?_0x19d5e8[_0x1b7c('0x1b')]['limit']||null:null})[_0x1b7c('0x9')](function(_0x552963){logger[_0x1b7c('0xa')]('UpdateWhatsappQueueReport',_0x19d5e8);logger[_0x1b7c('0xd')](_0x1b7c('0x19'),_0x19d5e8,JSON[_0x1b7c('0xf')](_0x552963));_0x3e8bd1(_0x552963);})[_0x1b7c('0x14')](function(_0x3e086b){logger[_0x1b7c('0x10')]('UpdateWhatsappQueueReport',_0x3e086b[_0x1b7c('0x12')],_0x19d5e8);_0x5e4655(_0x7d9294[_0x1b7c('0x10')](0x1f4,_0x3e086b[_0x1b7c('0x12')]));});});};
\ No newline at end of file
+var _0x8b01=['UpdateWhatsappQueueReport','update','limit','util','moment','bluebird','../../mysqldb','../../config/environment','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','catch'];(function(_0x5c4e6d,_0x530340){var _0x237de1=function(_0x16fc6c){while(--_0x16fc6c){_0x5c4e6d['push'](_0x5c4e6d['shift']());}};_0x237de1(++_0x530340);}(_0x8b01,0x1e9));var _0x18b0=function(_0x171de5,_0x260fd1){_0x171de5=_0x171de5-0x0;var _0x1c2d68=_0x8b01[_0x171de5];return _0x1c2d68;};'use strict';var _=require('lodash');var util=require(_0x18b0('0x0'));var moment=require(_0x18b0('0x1'));var BPromise=require(_0x18b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x18b0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x18b0('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x18b0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0xe43e59,_0x4682ab,_0x3aa1c0){return new BPromise(function(_0x2b8454,_0x46f2b9){return client['request'](_0xe43e59,_0x3aa1c0)[_0x18b0('0x6')](function(_0x3e1443){logger[_0x18b0('0x7')](_0x18b0('0x8'),_0x4682ab,_0x18b0('0x9'));logger[_0x18b0('0xa')](_0x18b0('0xb'),_0x4682ab,_0x18b0('0x9'),JSON[_0x18b0('0xc')](_0x3e1443));if(_0x3e1443['error']){if(_0x3e1443[_0x18b0('0xd')][_0x18b0('0xe')]===0x1f4){logger[_0x18b0('0xd')](_0x18b0('0x8'),_0x4682ab,_0x3e1443['error']['message']);return _0x46f2b9(_0x3e1443['error'][_0x18b0('0xf')]);}logger['error'](_0x18b0('0x8'),_0x4682ab,_0x3e1443[_0x18b0('0xd')][_0x18b0('0xf')]);return _0x2b8454(_0x3e1443[_0x18b0('0xd')]['message']);}else{logger[_0x18b0('0x7')](_0x18b0('0x8'),_0x4682ab,_0x18b0('0x9'));_0x2b8454(_0x3e1443[_0x18b0('0x10')][_0x18b0('0xf')]);}})['catch'](function(_0x36aa80){logger[_0x18b0('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4682ab,_0x36aa80);_0x46f2b9(_0x36aa80);});});}exports[_0x18b0('0x11')]=function(_0x2aabd2){var _0x1a2618=this;return new Promise(function(_0x302852,_0x5778bf){return db[_0x18b0('0x12')][_0x18b0('0x13')](_0x2aabd2[_0x18b0('0x14')],{'raw':_0x2aabd2[_0x18b0('0x15')]?_0x2aabd2[_0x18b0('0x15')][_0x18b0('0x16')]===undefined?!![]:![]:!![]})[_0x18b0('0x6')](function(_0x5b1b5d){logger[_0x18b0('0x7')](_0x18b0('0x11'),_0x2aabd2);logger[_0x18b0('0xa')](_0x18b0('0x11'),_0x2aabd2,JSON[_0x18b0('0xc')](_0x5b1b5d));_0x302852(_0x5b1b5d);})[_0x18b0('0x17')](function(_0x4b3892){logger[_0x18b0('0xd')](_0x18b0('0x11'),_0x4b3892[_0x18b0('0xf')],_0x2aabd2);_0x5778bf(_0x1a2618[_0x18b0('0xd')](0x1f4,_0x4b3892[_0x18b0('0xf')]));});});};exports[_0x18b0('0x18')]=function(_0x411a2f){var _0x27c1b5=this;return new Promise(function(_0x3176e6,_0x458400){return db[_0x18b0('0x12')][_0x18b0('0x19')](_0x411a2f[_0x18b0('0x14')],{'raw':_0x411a2f[_0x18b0('0x15')]?_0x411a2f[_0x18b0('0x15')][_0x18b0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x411a2f[_0x18b0('0x15')]?_0x411a2f[_0x18b0('0x15')]['where']||null:null,'attributes':_0x411a2f[_0x18b0('0x15')]?_0x411a2f[_0x18b0('0x15')]['attributes']||null:null,'limit':_0x411a2f[_0x18b0('0x15')]?_0x411a2f[_0x18b0('0x15')][_0x18b0('0x1a')]||null:null})[_0x18b0('0x6')](function(_0xeebde5){logger[_0x18b0('0x7')](_0x18b0('0x18'),_0x411a2f);logger[_0x18b0('0xa')](_0x18b0('0x18'),_0x411a2f,JSON[_0x18b0('0xc')](_0xeebde5));_0x3176e6(_0xeebde5);})[_0x18b0('0x17')](function(_0x3cb4cd){logger[_0x18b0('0xd')](_0x18b0('0x18'),_0x3cb4cd[_0x18b0('0xf')],_0x411a2f);_0x458400(_0x27c1b5[_0x18b0('0xd')](0x1f4,_0x3cb4cd[_0x18b0('0xf')]));});});};
\ No newline at end of file
index 0458a3e..619975c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45c9=['post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x19a43e,_0x7f739c){var _0x52faa8=function(_0x13ee08){while(--_0x13ee08){_0x19a43e['push'](_0x19a43e['shift']());}};_0x52faa8(++_0x7f739c);}(_0x45c9,0x1b5));var _0x945c=function(_0x202d0f,_0x421cb4){_0x202d0f=_0x202d0f-0x0;var _0xdcc5be=_0x45c9[_0x202d0f];return _0xdcc5be;};'use strict';var multer=require(_0x945c('0x0'));var util=require(_0x945c('0x1'));var path=require(_0x945c('0x2'));var timeout=require(_0x945c('0x3'));var express=require(_0x945c('0x4'));var router=express[_0x945c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x945c('0x6'));var config=require(_0x945c('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x945c('0x8')]('/',auth[_0x945c('0x9')](),controller[_0x945c('0xa')]);router['get']('/describe',auth[_0x945c('0x9')](),controller['describe']);router[_0x945c('0x8')](_0x945c('0xb'),auth[_0x945c('0x9')](),controller[_0x945c('0xc')]);router[_0x945c('0xd')]('/',auth[_0x945c('0x9')](),controller[_0x945c('0xe')]);router[_0x945c('0xf')]('/:id',auth[_0x945c('0x9')](),controller['update']);router[_0x945c('0x10')](_0x945c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x945c('0x11')]=router;
\ No newline at end of file
+var _0x6b32=['destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','/:id','post','create','update','delete'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6b32,0xda));var _0x26b3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6b32[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x26b3('0x0'));var util=require(_0x26b3('0x1'));var path=require(_0x26b3('0x2'));var timeout=require(_0x26b3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x26b3('0x4'));var auth=require(_0x26b3('0x5'));var interaction=require(_0x26b3('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x26b3('0x7')]);router[_0x26b3('0x8')]('/describe',auth[_0x26b3('0x9')](),controller[_0x26b3('0xa')]);router[_0x26b3('0x8')](_0x26b3('0xb'),auth[_0x26b3('0x9')](),controller['show']);router[_0x26b3('0xc')]('/',auth[_0x26b3('0x9')](),controller[_0x26b3('0xd')]);router['put'](_0x26b3('0xb'),auth[_0x26b3('0x9')](),controller[_0x26b3('0xe')]);router[_0x26b3('0xf')]('/:id',auth[_0x26b3('0x9')](),controller[_0x26b3('0x10')]);module[_0x26b3('0x11')]=router;
\ No newline at end of file
index 9be8011..cbc3e5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbde=['account','agent','queue','sequelize','STRING','ENUM'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xcbde,0x141));var _0xecbd=function(_0x22498e,_0x40b64f){_0x22498e=_0x22498e-0x0;var _0x4c18e7=_0xcbde[_0x22498e];return _0x4c18e7;};'use strict';var Sequelize=require(_0xecbd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xecbd('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xecbd('0x2')](_0xecbd('0x3'),_0xecbd('0x4'),_0xecbd('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xe2cf=['queue','DATE','exports','ENUM','agent'];(function(_0x48a6fb,_0x4c7dc9){var _0x4bb7dc=function(_0x343608){while(--_0x343608){_0x48a6fb['push'](_0x48a6fb['shift']());}};_0x4bb7dc(++_0x4c7dc9);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x4c4d9c,_0x5bd0eb){_0x4c4d9c=_0x4c4d9c-0x0;var _0x5063fb=_0xe2cf[_0x4c4d9c];return _0x5063fb;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xfe2c('0x1')]('account',_0xfe2c('0x2'),_0xfe2c('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xfe2c('0x4')]}};
\ No newline at end of file
index cf624a0..01cebfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x269b=['fast-json-patch','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','show','params','filters','length','include','find','catch','create','body','describe','eml-format','zip-dir'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x269b,0x9a));var _0xb269=function(_0xc5a490,_0x217ba9){_0xc5a490=_0xc5a490-0x0;var _0x20e3e5=_0x269b[_0xc5a490];return _0x20e3e5;};'use strict';var emlformat=require(_0xb269('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb269('0x1'));var jsonpatch=require(_0xb269('0x2'));var rp=require(_0xb269('0x3'));var moment=require(_0xb269('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb269('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb269('0x6'));var ejs=require(_0xb269('0x7'));var fs=require('fs');var fs_extra=require(_0xb269('0x8'));var _=require(_0xb269('0x9'));var squel=require(_0xb269('0xa'));var crypto=require(_0xb269('0xb'));var jsforce=require(_0xb269('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb269('0xd'));var Papa=require(_0xb269('0xe'));var Redis=require(_0xb269('0xf'));var authService=require(_0xb269('0x10'));var qs=require(_0xb269('0x11'));var as=require(_0xb269('0x12'));var hardwareService=require(_0xb269('0x13'));var logger=require(_0xb269('0x14'))(_0xb269('0x15'));var utils=require(_0xb269('0x16'));var config=require(_0xb269('0x17'));var licenseUtil=require(_0xb269('0x18'));var db=require(_0xb269('0x19'))['db'];function respondWithStatusCode(_0x4ab7e6,_0x261911){_0x261911=_0x261911||0xcc;return function(_0x20e826){if(_0x20e826){return _0x4ab7e6[_0xb269('0x1a')](_0x261911);}return _0x4ab7e6[_0xb269('0x1b')](_0x261911)[_0xb269('0x1c')]();};}function respondWithResult(_0x217954,_0x55636f){_0x55636f=_0x55636f||0xc8;return function(_0x69805f){if(_0x69805f){return _0x217954[_0xb269('0x1b')](_0x55636f)[_0xb269('0x1d')](_0x69805f);}};}function respondWithFilteredResult(_0x32d28c,_0x1b2fdd){return function(_0x4d3c6d){if(_0x4d3c6d){var _0x4ceea4=typeof _0x1b2fdd[_0xb269('0x1e')]==='undefined'&&typeof _0x1b2fdd[_0xb269('0x1f')]===_0xb269('0x20');var _0x3094e1=_0x4d3c6d[_0xb269('0x21')];var _0x18c300=_0x4ceea4?0x0:_0x1b2fdd['offset'];var _0x270244=_0x4ceea4?_0x4d3c6d[_0xb269('0x21')]:_0x1b2fdd['offset']+_0x1b2fdd[_0xb269('0x1f')];var _0x370172;if(_0x270244>=_0x3094e1){_0x270244=_0x3094e1;_0x370172=0xc8;}else{_0x370172=0xce;}_0x32d28c[_0xb269('0x1b')](_0x370172);return _0x32d28c[_0xb269('0x22')](_0xb269('0x23'),_0x18c300+'-'+_0x270244+'/'+_0x3094e1)['json'](_0x4d3c6d);}return null;};}function patchUpdates(_0x171bf9){return function(_0x332e73){try{jsonpatch[_0xb269('0x24')](_0x332e73,_0x171bf9,!![]);}catch(_0x3bdca9){return BPromise[_0xb269('0x25')](_0x3bdca9);}return _0x332e73[_0xb269('0x26')]();};}function saveUpdates(_0x16c0a2,_0x3a2ace){return function(_0x7f43b0){if(_0x7f43b0){return _0x7f43b0[_0xb269('0x27')](_0x16c0a2)[_0xb269('0x28')](function(_0x257adf){return _0x257adf;});}return null;};}function removeEntity(_0x32f0f4,_0x1953c8){return function(_0x5c93c0){if(_0x5c93c0){return _0x5c93c0[_0xb269('0x29')]()[_0xb269('0x28')](function(){_0x32f0f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ff0d,_0x31a9d2){return function(_0x464110){if(!_0x464110){_0x20ff0d[_0xb269('0x1a')](0x194);}return _0x464110;};}function handleError(_0x15f1b5,_0x298502){_0x298502=_0x298502||0x1f4;return function(_0x31956e){logger[_0xb269('0x2a')](_0x31956e[_0xb269('0x2b')]);if(_0x31956e[_0xb269('0x2c')]){delete _0x31956e[_0xb269('0x2c')];}_0x15f1b5['status'](_0x298502)[_0xb269('0x2d')](_0x31956e);};}exports['index']=function(_0xefa3a7,_0x504268){var _0x3e7360={},_0x1763fa={},_0x43c544={'count':0x0,'rows':[]};var _0xac4e17=_[_0xb269('0x2e')](db['WhatsappTransferReport'][_0xb269('0x2f')],function(_0x39f8ee){return{'name':_0x39f8ee[_0xb269('0x30')],'type':_0x39f8ee[_0xb269('0x31')]['key']};});_0x1763fa['model']=_[_0xb269('0x2e')](_0xac4e17,_0xb269('0x2c'));_0x1763fa[_0xb269('0x32')]=_[_0xb269('0x33')](_0xefa3a7[_0xb269('0x32')]);_0x1763fa['filters']=_[_0xb269('0x34')](_0x1763fa['model'],_0x1763fa[_0xb269('0x32')]);_0x3e7360[_0xb269('0x35')]=_['intersection'](_0x1763fa['model'],qs[_0xb269('0x36')](_0xefa3a7[_0xb269('0x32')][_0xb269('0x36')]));_0x3e7360[_0xb269('0x35')]=_0x3e7360[_0xb269('0x35')]['length']?_0x3e7360['attributes']:_0x1763fa[_0xb269('0x37')];if(!_0xefa3a7['query'][_0xb269('0x38')]('nolimit')){_0x3e7360[_0xb269('0x1f')]=qs['limit'](_0xefa3a7[_0xb269('0x32')][_0xb269('0x1f')]);_0x3e7360[_0xb269('0x1e')]=qs['offset'](_0xefa3a7[_0xb269('0x32')][_0xb269('0x1e')]);}_0x3e7360[_0xb269('0x39')]=qs[_0xb269('0x3a')](_0xefa3a7['query']['sort']);_0x3e7360['where']=qs['filters'](_[_0xb269('0x3b')](_0xefa3a7[_0xb269('0x32')],_0x1763fa['filters']),_0xac4e17);if(_0xefa3a7[_0xb269('0x32')][_0xb269('0x3c')]){_0x3e7360[_0xb269('0x3d')]=_[_0xb269('0x3e')](_0x3e7360[_0xb269('0x3d')],{'$or':_[_0xb269('0x2e')](_0xac4e17,function(_0x15ee03){if(_0x15ee03[_0xb269('0x31')]!==_0xb269('0x3f')){var _0x348679={};_0x348679[_0x15ee03[_0xb269('0x2c')]]={'$like':'%'+_0xefa3a7[_0xb269('0x32')][_0xb269('0x3c')]+'%'};return _0x348679;}})});}_0x3e7360=_[_0xb269('0x3e')]({},_0x3e7360,_0xefa3a7[_0xb269('0x40')]);var _0x504331={'where':_0x3e7360['where']};return db[_0xb269('0x41')][_0xb269('0x21')](_0x504331)[_0xb269('0x28')](function(_0x249189){_0x43c544['count']=_0x249189;if(_0xefa3a7['query'][_0xb269('0x42')]){_0x3e7360['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb269('0x43')](_0x3e7360);})[_0xb269('0x28')](function(_0x2de738){_0x43c544['rows']=_0x2de738;return _0x43c544;})[_0xb269('0x28')](respondWithFilteredResult(_0x504268,_0x3e7360))['catch'](handleError(_0x504268,null));};exports[_0xb269('0x44')]=function(_0x1ae22c,_0x5c5978){var _0x18b123={'raw':!![],'where':{'id':_0x1ae22c[_0xb269('0x45')]['id']}},_0x5a76f9={};_0x5a76f9[_0xb269('0x37')]=_['keys'](db[_0xb269('0x41')]['rawAttributes']);_0x5a76f9[_0xb269('0x32')]=_['keys'](_0x1ae22c['query']);_0x5a76f9[_0xb269('0x46')]=_[_0xb269('0x34')](_0x5a76f9[_0xb269('0x37')],_0x5a76f9[_0xb269('0x32')]);_0x18b123[_0xb269('0x35')]=_[_0xb269('0x34')](_0x5a76f9[_0xb269('0x37')],qs[_0xb269('0x36')](_0x1ae22c[_0xb269('0x32')][_0xb269('0x36')]));_0x18b123['attributes']=_0x18b123['attributes'][_0xb269('0x47')]?_0x18b123[_0xb269('0x35')]:_0x5a76f9[_0xb269('0x37')];if(_0x1ae22c[_0xb269('0x32')][_0xb269('0x42')]){_0x18b123[_0xb269('0x48')]=[{'all':!![]}];}_0x18b123=_['merge']({},_0x18b123,_0x1ae22c[_0xb269('0x40')]);return db['WhatsappTransferReport'][_0xb269('0x49')](_0x18b123)[_0xb269('0x28')](handleEntityNotFound(_0x5c5978,null))[_0xb269('0x28')](respondWithResult(_0x5c5978,null))[_0xb269('0x4a')](handleError(_0x5c5978,null));};exports['create']=function(_0x2e16bc,_0x4c2d81){return db[_0xb269('0x41')][_0xb269('0x4b')](_0x2e16bc[_0xb269('0x4c')],{})['then'](respondWithResult(_0x4c2d81,0xc9))[_0xb269('0x4a')](handleError(_0x4c2d81,null));};exports[_0xb269('0x27')]=function(_0x4f099b,_0x3184b4){if(_0x4f099b[_0xb269('0x4c')]['id']){delete _0x4f099b[_0xb269('0x4c')]['id'];}return db[_0xb269('0x41')]['find']({'where':{'id':_0x4f099b[_0xb269('0x45')]['id']}})[_0xb269('0x28')](handleEntityNotFound(_0x3184b4,null))['then'](saveUpdates(_0x4f099b[_0xb269('0x4c')],null))[_0xb269('0x28')](respondWithResult(_0x3184b4,null))[_0xb269('0x4a')](handleError(_0x3184b4,null));};exports[_0xb269('0x29')]=function(_0x5d8669,_0x12e4c7){return db[_0xb269('0x41')][_0xb269('0x49')]({'where':{'id':_0x5d8669[_0xb269('0x45')]['id']}})[_0xb269('0x28')](handleEntityNotFound(_0x12e4c7,null))[_0xb269('0x28')](removeEntity(_0x12e4c7,null))[_0xb269('0x4a')](handleError(_0x12e4c7,null));};exports['describe']=function(_0x3466c1,_0x55e968){return db['WhatsappTransferReport'][_0xb269('0x4d')]()['then'](respondWithResult(_0x55e968,null))[_0xb269('0x4a')](handleError(_0x55e968,null));};
\ No newline at end of file
+var _0xa71c=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x41e711,_0x440a56){var _0x3430a9=function(_0x1a047c){while(--_0x1a047c){_0x41e711['push'](_0x41e711['shift']());}};_0x3430a9(++_0x440a56);}(_0xa71c,0x12a));var _0xca71=function(_0x5256c6,_0x375ae9){_0x5256c6=_0x5256c6-0x0;var _0x2c251f=_0xa71c[_0x5256c6];return _0x2c251f;};'use strict';var emlformat=require(_0xca71('0x0'));var rimraf=require(_0xca71('0x1'));var zipdir=require(_0xca71('0x2'));var jsonpatch=require(_0xca71('0x3'));var rp=require(_0xca71('0x4'));var moment=require('moment');var BPromise=require(_0xca71('0x5'));var Mustache=require(_0xca71('0x6'));var util=require('util');var path=require(_0xca71('0x7'));var sox=require(_0xca71('0x8'));var csv=require('to-csv');var ejs=require(_0xca71('0x9'));var fs=require('fs');var fs_extra=require(_0xca71('0xa'));var _=require(_0xca71('0xb'));var squel=require(_0xca71('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xca71('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca71('0xe'));var Redis=require(_0xca71('0xf'));var authService=require(_0xca71('0x10'));var qs=require(_0xca71('0x11'));var as=require(_0xca71('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xca71('0x13'))(_0xca71('0x14'));var utils=require(_0xca71('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xca71('0x16'))['db'];function respondWithStatusCode(_0xcb647a,_0x12b439){_0x12b439=_0x12b439||0xcc;return function(_0x58c62a){if(_0x58c62a){return _0xcb647a[_0xca71('0x17')](_0x12b439);}return _0xcb647a[_0xca71('0x18')](_0x12b439)[_0xca71('0x19')]();};}function respondWithResult(_0x4e7c53,_0x2f86df){_0x2f86df=_0x2f86df||0xc8;return function(_0x29456e){if(_0x29456e){return _0x4e7c53['status'](_0x2f86df)[_0xca71('0x1a')](_0x29456e);}};}function respondWithFilteredResult(_0x1c71b8,_0x10b932){return function(_0x319601){if(_0x319601){var _0x4e4e33=typeof _0x10b932[_0xca71('0x1b')]===_0xca71('0x1c')&&typeof _0x10b932[_0xca71('0x1d')]==='undefined';var _0x5721b3=_0x319601['count'];var _0x32ad3e=_0x4e4e33?0x0:_0x10b932[_0xca71('0x1b')];var _0x579fea=_0x4e4e33?_0x319601[_0xca71('0x1e')]:_0x10b932[_0xca71('0x1b')]+_0x10b932['limit'];var _0x2fbf04;if(_0x579fea>=_0x5721b3){_0x579fea=_0x5721b3;_0x2fbf04=0xc8;}else{_0x2fbf04=0xce;}_0x1c71b8[_0xca71('0x18')](_0x2fbf04);return _0x1c71b8['set'](_0xca71('0x1f'),_0x32ad3e+'-'+_0x579fea+'/'+_0x5721b3)[_0xca71('0x1a')](_0x319601);}return null;};}function patchUpdates(_0x300cef){return function(_0x4b2f64){try{jsonpatch[_0xca71('0x20')](_0x4b2f64,_0x300cef,!![]);}catch(_0x3245a7){return BPromise[_0xca71('0x21')](_0x3245a7);}return _0x4b2f64[_0xca71('0x22')]();};}function saveUpdates(_0x4af4b6,_0x46a6ff){return function(_0x4a0508){if(_0x4a0508){return _0x4a0508[_0xca71('0x23')](_0x4af4b6)[_0xca71('0x24')](function(_0x3cab68){return _0x3cab68;});}return null;};}function removeEntity(_0x47461b,_0x3bdc3b){return function(_0x4f576e){if(_0x4f576e){return _0x4f576e[_0xca71('0x25')]()['then'](function(){_0x47461b['status'](0xcc)[_0xca71('0x19')]();});}};}function handleEntityNotFound(_0x21d271,_0x375b43){return function(_0x5eb399){if(!_0x5eb399){_0x21d271[_0xca71('0x17')](0x194);}return _0x5eb399;};}function handleError(_0x5dc26a,_0x76d4dd){_0x76d4dd=_0x76d4dd||0x1f4;return function(_0x47b530){logger['error'](_0x47b530[_0xca71('0x26')]);if(_0x47b530['name']){delete _0x47b530[_0xca71('0x27')];}_0x5dc26a['status'](_0x76d4dd)[_0xca71('0x28')](_0x47b530);};}exports['index']=function(_0x3ab5c3,_0x146823){var _0x3c9746={},_0x55c557={},_0x13b13e={'count':0x0,'rows':[]};var _0xcd055a=_[_0xca71('0x29')](db[_0xca71('0x2a')][_0xca71('0x2b')],function(_0x578b5f){return{'name':_0x578b5f[_0xca71('0x2c')],'type':_0x578b5f['type'][_0xca71('0x2d')]};});_0x55c557[_0xca71('0x2e')]=_[_0xca71('0x29')](_0xcd055a,_0xca71('0x27'));_0x55c557[_0xca71('0x2f')]=_[_0xca71('0x30')](_0x3ab5c3[_0xca71('0x2f')]);_0x55c557[_0xca71('0x31')]=_[_0xca71('0x32')](_0x55c557[_0xca71('0x2e')],_0x55c557[_0xca71('0x2f')]);_0x3c9746['attributes']=_['intersection'](_0x55c557[_0xca71('0x2e')],qs['fields'](_0x3ab5c3[_0xca71('0x2f')][_0xca71('0x33')]));_0x3c9746[_0xca71('0x34')]=_0x3c9746['attributes'][_0xca71('0x35')]?_0x3c9746['attributes']:_0x55c557['model'];if(!_0x3ab5c3[_0xca71('0x2f')][_0xca71('0x36')](_0xca71('0x37'))){_0x3c9746['limit']=qs['limit'](_0x3ab5c3[_0xca71('0x2f')][_0xca71('0x1d')]);_0x3c9746[_0xca71('0x1b')]=qs['offset'](_0x3ab5c3['query'][_0xca71('0x1b')]);}_0x3c9746['order']=qs[_0xca71('0x38')](_0x3ab5c3[_0xca71('0x2f')][_0xca71('0x38')]);_0x3c9746[_0xca71('0x39')]=qs[_0xca71('0x31')](_[_0xca71('0x3a')](_0x3ab5c3['query'],_0x55c557[_0xca71('0x31')]),_0xcd055a);if(_0x3ab5c3[_0xca71('0x2f')][_0xca71('0x3b')]){_0x3c9746[_0xca71('0x39')]=_[_0xca71('0x3c')](_0x3c9746[_0xca71('0x39')],{'$or':_[_0xca71('0x29')](_0xcd055a,function(_0xcf830d){if(_0xcf830d[_0xca71('0x3d')]!==_0xca71('0x3e')){var _0x42828d={};_0x42828d[_0xcf830d[_0xca71('0x27')]]={'$like':'%'+_0x3ab5c3['query'][_0xca71('0x3b')]+'%'};return _0x42828d;}})});}_0x3c9746=_[_0xca71('0x3c')]({},_0x3c9746,_0x3ab5c3[_0xca71('0x3f')]);var _0x5b51f6={'where':_0x3c9746['where']};return db[_0xca71('0x2a')][_0xca71('0x1e')](_0x5b51f6)[_0xca71('0x24')](function(_0x341433){_0x13b13e[_0xca71('0x1e')]=_0x341433;if(_0x3ab5c3['query'][_0xca71('0x40')]){_0x3c9746[_0xca71('0x41')]=[{'all':!![]}];}return db[_0xca71('0x2a')][_0xca71('0x42')](_0x3c9746);})[_0xca71('0x24')](function(_0x5d3409){_0x13b13e[_0xca71('0x43')]=_0x5d3409;return _0x13b13e;})['then'](respondWithFilteredResult(_0x146823,_0x3c9746))[_0xca71('0x44')](handleError(_0x146823,null));};exports[_0xca71('0x45')]=function(_0x3a1fd4,_0x1b243c){var _0x59af53={'raw':!![],'where':{'id':_0x3a1fd4['params']['id']}},_0x21cc5d={};_0x21cc5d[_0xca71('0x2e')]=_[_0xca71('0x30')](db[_0xca71('0x2a')][_0xca71('0x2b')]);_0x21cc5d[_0xca71('0x2f')]=_[_0xca71('0x30')](_0x3a1fd4[_0xca71('0x2f')]);_0x21cc5d[_0xca71('0x31')]=_[_0xca71('0x32')](_0x21cc5d[_0xca71('0x2e')],_0x21cc5d[_0xca71('0x2f')]);_0x59af53['attributes']=_['intersection'](_0x21cc5d['model'],qs[_0xca71('0x33')](_0x3a1fd4[_0xca71('0x2f')][_0xca71('0x33')]));_0x59af53[_0xca71('0x34')]=_0x59af53[_0xca71('0x34')][_0xca71('0x35')]?_0x59af53['attributes']:_0x21cc5d['model'];if(_0x3a1fd4[_0xca71('0x2f')][_0xca71('0x40')]){_0x59af53[_0xca71('0x41')]=[{'all':!![]}];}_0x59af53=_[_0xca71('0x3c')]({},_0x59af53,_0x3a1fd4['options']);return db[_0xca71('0x2a')][_0xca71('0x46')](_0x59af53)['then'](handleEntityNotFound(_0x1b243c,null))[_0xca71('0x24')](respondWithResult(_0x1b243c,null))['catch'](handleError(_0x1b243c,null));};exports[_0xca71('0x47')]=function(_0xbe2269,_0xc40961){return db[_0xca71('0x2a')][_0xca71('0x47')](_0xbe2269['body'],{})['then'](respondWithResult(_0xc40961,0xc9))['catch'](handleError(_0xc40961,null));};exports[_0xca71('0x23')]=function(_0x32d1fa,_0x223fbc){if(_0x32d1fa[_0xca71('0x48')]['id']){delete _0x32d1fa[_0xca71('0x48')]['id'];}return db[_0xca71('0x2a')][_0xca71('0x46')]({'where':{'id':_0x32d1fa['params']['id']}})[_0xca71('0x24')](handleEntityNotFound(_0x223fbc,null))[_0xca71('0x24')](saveUpdates(_0x32d1fa[_0xca71('0x48')],null))[_0xca71('0x24')](respondWithResult(_0x223fbc,null))[_0xca71('0x44')](handleError(_0x223fbc,null));};exports[_0xca71('0x25')]=function(_0x89789b,_0x1ebb2d){return db[_0xca71('0x2a')][_0xca71('0x46')]({'where':{'id':_0x89789b['params']['id']}})[_0xca71('0x24')](handleEntityNotFound(_0x1ebb2d,null))[_0xca71('0x24')](removeEntity(_0x1ebb2d,null))[_0xca71('0x44')](handleError(_0x1ebb2d,null));};exports[_0xca71('0x49')]=function(_0x3b276d,_0x38699d){return db['WhatsappTransferReport'][_0xca71('0x49')]()[_0xca71('0x24')](respondWithResult(_0x38699d,null))['catch'](handleError(_0x38699d,null));};
\ No newline at end of file
index 984b3b2..61a458e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e70=['path','rimraf','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','moment','bluebird','request-promise'];(function(_0x569f12,_0x12cd74){var _0x1618cc=function(_0x5ec355){while(--_0x5ec355){_0x569f12['push'](_0x569f12['shift']());}};_0x1618cc(++_0x12cd74);}(_0x6e70,0x1ca));var _0x06e7=function(_0x4da630,_0x438f94){_0x4da630=_0x4da630-0x0;var _0x42679b=_0x6e70[_0x4da630];return _0x42679b;};'use strict';var _=require(_0x06e7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x06e7('0x1'));var BPromise=require(_0x06e7('0x2'));var rp=require(_0x06e7('0x3'));var fs=require('fs');var path=require(_0x06e7('0x4'));var rimraf=require(_0x06e7('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0x06e7('0x6')]=function(_0xf18dce,_0x313933){return _0xf18dce[_0x06e7('0x7')](_0x06e7('0x8'),attributes,{'tableName':_0x06e7('0x9'),'paranoid':![],'indexes':[{'name':_0x06e7('0xa'),'fields':[_0x06e7('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a53=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x9a53,0x9e));var _0x39a5=function(_0x4d1358,_0x3b533e){_0x4d1358=_0x4d1358-0x0;var _0x552b5a=_0x9a53[_0x4d1358];return _0x552b5a;};'use strict';var _=require(_0x39a5('0x0'));var util=require(_0x39a5('0x1'));var logger=require('../../config/logger')(_0x39a5('0x2'));var moment=require(_0x39a5('0x3'));var BPromise=require(_0x39a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x39a5('0x5'));var rimraf=require(_0x39a5('0x6'));var config=require(_0x39a5('0x7'));var attributes=require(_0x39a5('0x8'));module[_0x39a5('0x9')]=function(_0x35e07f,_0x1d40e5){return _0x35e07f[_0x39a5('0xa')](_0x39a5('0xb'),attributes,{'tableName':_0x39a5('0xc'),'paranoid':![],'indexes':[{'name':_0x39a5('0xd'),'fields':[_0x39a5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 7a5daf8..5185645 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x374a=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2e2d06,_0x5fcc37){var _0x2769a2=function(_0x4e69ad){while(--_0x4e69ad){_0x2e2d06['push'](_0x2e2d06['shift']());}};_0x2769a2(++_0x5fcc37);}(_0x374a,0x92));var _0xa374=function(_0x50183b,_0x718a41){_0x50183b=_0x50183b-0x0;var _0x51e190=_0x374a[_0x50183b];return _0x51e190;};'use strict';var _=require(_0xa374('0x0'));var util=require(_0xa374('0x1'));var moment=require(_0xa374('0x2'));var BPromise=require(_0xa374('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa374('0x4'));var db=require(_0xa374('0x5'))['db'];var utils=require(_0xa374('0x6'));var logger=require(_0xa374('0x7'))(_0xa374('0x8'));var config=require(_0xa374('0x9'));var jayson=require(_0xa374('0xa'));var client=jayson[_0xa374('0xb')][_0xa374('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x90734e,_0x221933,_0x57da12){return new BPromise(function(_0x4efa62,_0x3fa5d9){return client[_0xa374('0xd')](_0x90734e,_0x57da12)[_0xa374('0xe')](function(_0x1bf4a3){logger[_0xa374('0xf')](_0xa374('0x10'),_0x221933,_0xa374('0x11'));logger[_0xa374('0x12')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x221933,_0xa374('0x11'),JSON[_0xa374('0x13')](_0x1bf4a3));if(_0x1bf4a3[_0xa374('0x14')]){if(_0x1bf4a3[_0xa374('0x14')][_0xa374('0x15')]===0x1f4){logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x1bf4a3['error'][_0xa374('0x16')]);return _0x3fa5d9(_0x1bf4a3['error'][_0xa374('0x16')]);}logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x1bf4a3[_0xa374('0x14')][_0xa374('0x16')]);return _0x4efa62(_0x1bf4a3[_0xa374('0x14')]['message']);}else{logger[_0xa374('0xf')](_0xa374('0x10'),_0x221933,'request\x20sent');_0x4efa62(_0x1bf4a3['result']['message']);}})[_0xa374('0x17')](function(_0x54a0a1){logger[_0xa374('0x14')](_0xa374('0x10'),_0x221933,_0x54a0a1);_0x3fa5d9(_0x54a0a1);});});}
\ No newline at end of file
+var _0x00e7=['../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xfdd63,_0x59aa23){var _0x2c964f=function(_0x56ac9e){while(--_0x56ac9e){_0xfdd63['push'](_0xfdd63['shift']());}};_0x2c964f(++_0x59aa23);}(_0x00e7,0xf2));var _0x700e=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x00e7[_0x5c3ae9];return _0x3f5950;};'use strict';var _=require(_0x700e('0x0'));var util=require(_0x700e('0x1'));var moment=require(_0x700e('0x2'));var BPromise=require(_0x700e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x700e('0x4'));var db=require(_0x700e('0x5'))['db'];var utils=require(_0x700e('0x6'));var logger=require(_0x700e('0x7'))('rpc');var config=require(_0x700e('0x8'));var jayson=require(_0x700e('0x9'));var client=jayson[_0x700e('0xa')][_0x700e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x343d5f,_0x33dc00,_0x2dfb1c){return new BPromise(function(_0x382597,_0x505d3b){return client[_0x700e('0xc')](_0x343d5f,_0x2dfb1c)[_0x700e('0xd')](function(_0x19a53f){logger[_0x700e('0xe')](_0x700e('0xf'),_0x33dc00,'request\x20sent');logger[_0x700e('0x10')](_0x700e('0x11'),_0x33dc00,_0x700e('0x12'),JSON[_0x700e('0x13')](_0x19a53f));if(_0x19a53f[_0x700e('0x14')]){if(_0x19a53f[_0x700e('0x14')][_0x700e('0x15')]===0x1f4){logger[_0x700e('0x14')](_0x700e('0xf'),_0x33dc00,_0x19a53f[_0x700e('0x14')][_0x700e('0x16')]);return _0x505d3b(_0x19a53f[_0x700e('0x14')][_0x700e('0x16')]);}logger[_0x700e('0x14')](_0x700e('0xf'),_0x33dc00,_0x19a53f[_0x700e('0x14')][_0x700e('0x16')]);return _0x382597(_0x19a53f['error'][_0x700e('0x16')]);}else{logger['info'](_0x700e('0xf'),_0x33dc00,'request\x20sent');_0x382597(_0x19a53f[_0x700e('0x17')][_0x700e('0x16')]);}})[_0x700e('0x18')](function(_0x325e2c){logger[_0x700e('0x14')](_0x700e('0xf'),_0x33dc00,_0x325e2c);_0x505d3b(_0x325e2c);});});}
\ No newline at end of file
index da89707..b0dc082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bc1=['./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','listen','info','start','Online\x20apps:','map','filter','name','join','Offline\x20apps:','status','None','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x6bc1,0x1aa));var _0x16bc=function(_0xc10495,_0x580b5f){_0xc10495=_0xc10495-0x0;var _0x2f19c4=_0x6bc1[_0xc10495];return _0x2f19c4;};'use strict';var _=require(_0x16bc('0x0'));var mysqldb=require(_0x16bc('0x1'));var rpc=require(_0x16bc('0x2'));var config=require(_0x16bc('0x3'));var logger=require(_0x16bc('0x4'))(_0x16bc('0x5'));var pm2=require(_0x16bc('0x6'));var pm2Config=require(_0x16bc('0x7'));var schedule=require(_0x16bc('0x8'));var chat=require(_0x16bc('0x9'));var whatsapp=require(_0x16bc('0xa'));var transcribe=require(_0x16bc('0xb'));function main(){return mysqldb['db']['sequelize'][_0x16bc('0xc')]()[_0x16bc('0xd')](function(){return rpc[_0x16bc('0xe')]();})[_0x16bc('0xd')](function(_0x420dcf){logger[_0x16bc('0xf')](_0x420dcf);return chat[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return whatsapp[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return schedule[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(){return transcribe[_0x16bc('0x10')]();})[_0x16bc('0xd')](function(_0xe518ec){logger['info'](_0xe518ec);return pm2[_0x16bc('0x10')](pm2Config);})[_0x16bc('0xd')](function(_0x2cd1f3){logger[_0x16bc('0xf')](_0x16bc('0x11'),_[_0x16bc('0x12')](_[_0x16bc('0x13')](_0x2cd1f3,{'status':'online'}),_0x16bc('0x14'))[_0x16bc('0x15')]());logger[_0x16bc('0xf')](_0x16bc('0x16'),_[_0x16bc('0x12')](_[_0x16bc('0x13')](_0x2cd1f3,function(_0x96e3a5){return _0x96e3a5[_0x16bc('0x17')]!=='online';}),_0x16bc('0x14'))['join']()||_0x16bc('0x18'));config['seedDB']&&require('./config/seedDB')[_0x16bc('0x19')]();require(_0x16bc('0x1a'))[_0x16bc('0x19')]();})[_0x16bc('0x1b')](function(_0x321044){logger['error'](_0x16bc('0x1c'),_0x321044);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x454f=['info','start','then','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','sequelize','sync','listen'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x454f,0x1d1));var _0xf454=function(_0x561963,_0xdd7b9d){_0x561963=_0x561963-0x0;var _0xf782dd=_0x454f[_0x561963];return _0xf782dd;};'use strict';var _=require(_0xf454('0x0'));var mysqldb=require(_0xf454('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require('./config/logger')(_0xf454('0x2'));var pm2=require(_0xf454('0x3'));var pm2Config=require(_0xf454('0x4'));var schedule=require(_0xf454('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xf454('0x6'));function main(){return mysqldb['db'][_0xf454('0x7')][_0xf454('0x8')]()['then'](function(){return rpc[_0xf454('0x9')]();})['then'](function(_0x1018af){logger[_0xf454('0xa')](_0x1018af);return chat[_0xf454('0xb')]();})['then'](function(){return whatsapp[_0xf454('0xb')]();})['then'](function(){return schedule[_0xf454('0xb')]();})[_0xf454('0xc')](function(){return transcribe[_0xf454('0xb')]();})[_0xf454('0xc')](function(_0x2617f2){logger[_0xf454('0xa')](_0x2617f2);return pm2[_0xf454('0xb')](pm2Config);})['then'](function(_0x5b4a39){logger['info']('Online\x20apps:',_['map'](_[_0xf454('0xd')](_0x5b4a39,{'status':_0xf454('0xe')}),_0xf454('0xf'))[_0xf454('0x10')]());logger[_0xf454('0xa')](_0xf454('0x11'),_['map'](_[_0xf454('0xd')](_0x5b4a39,function(_0x472f4c){return _0x472f4c[_0xf454('0x12')]!==_0xf454('0xe');}),_0xf454('0xf'))['join']()||_0xf454('0x13'));config[_0xf454('0x14')]&&require(_0xf454('0x15'))[_0xf454('0x16')]();require('./config/license')['default']();})[_0xf454('0x17')](function(_0x4782ad){logger['error'](_0xf454('0x18'),_0x4782ad);process['exit'](0x1);});}main();
\ No newline at end of file
index 7133045..44c136e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0c9=['canUpdate','Forbidden','isMiddleware','signToken','setTokenCookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','splice','unshift','join','sign','secret','payload','options','verify','floor','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','disposition','then','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','status','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','allowedLoginAttempts','blockDuration','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.'];(function(_0x4c943d,_0x5e3b6f){var _0x508d76=function(_0x484841){while(--_0x484841){_0x4c943d['push'](_0x4c943d['shift']());}};_0x508d76(++_0x5e3b6f);}(_0xf0c9,0x116));var _0x9f0c=function(_0x2d5411,_0x1a439f){_0x2d5411=_0x2d5411-0x0;var _0x4f13d7=_0xf0c9[_0x2d5411];return _0x4f13d7;};'use strict';var db=require(_0x9f0c('0x0'))['db'];var config=require(_0x9f0c('0x1'));var hardwareConf=require(_0x9f0c('0x2'));var licenseUtil=require(_0x9f0c('0x3'));var encryptor=require(_0x9f0c('0x4'));var _=require(_0x9f0c('0x5'));var jwt=require(_0x9f0c('0x6'));var expressJwt=require(_0x9f0c('0x7'));var compose=require(_0x9f0c('0x8'));var basicAuth=require(_0x9f0c('0x9'));var crypto=require(_0x9f0c('0xa'));var BPromise=require('bluebird');var util=require(_0x9f0c('0xb'));var moment=require(_0x9f0c('0xc'));var validateJwt=expressJwt({'secret':config[_0x9f0c('0xd')][_0x9f0c('0xe')]});var userAttributes=['id',_0x9f0c('0xf'),_0x9f0c('0x10'),'name',_0x9f0c('0x11'),_0x9f0c('0x12'),_0x9f0c('0x13'),_0x9f0c('0x14'),_0x9f0c('0x15'),_0x9f0c('0x16'),'chatPause',_0x9f0c('0x17'),_0x9f0c('0x18'),_0x9f0c('0x19'),'openchannelPause',_0x9f0c('0x1a'),_0x9f0c('0x1b'),_0x9f0c('0x1c'),_0x9f0c('0x1d'),'crudPermissions',_0x9f0c('0x1e'),_0x9f0c('0x1f'),'alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x9f0c('0x20'),_0x9f0c('0x21'),_0x9f0c('0x22'),'phoneBarEnableSettings',_0x9f0c('0x23'),_0x9f0c('0x24'),_0x9f0c('0x25'),'phoneBarRemoteControlPort',_0x9f0c('0x26'),_0x9f0c('0x27'),_0x9f0c('0x28'),_0x9f0c('0x29'),_0x9f0c('0x2a'),_0x9f0c('0x2b'),_0x9f0c('0x2c'),_0x9f0c('0x2d'),_0x9f0c('0x2e')];exports[_0x9f0c('0x2f')]=function(){return this[_0x9f0c('0x30')](!![])[_0x9f0c('0x31')](function(_0xad2a99,_0x114d9b,_0x12a204){if(_0xad2a99[_0x9f0c('0x32')]){_0x12a204();}else{return db[_0x9f0c('0x33')][_0x9f0c('0x34')]({'where':{'id':_0xad2a99['params']['id']},'attributes':['id','closed',_0x9f0c('0x35')],'raw':!![]})[_0x9f0c('0x36')](function(_0x5b6f8c){if(_0x5b6f8c&&_0x5b6f8c['closed']){return _0x114d9b['status'](_0x5b6f8c[_0x9f0c('0x35')]===_0x9f0c('0x37')?0x195:0x193)['json']({'message':_0x5b6f8c[_0x9f0c('0x35')]===_0x9f0c('0x37')?_0x9f0c('0x38'):_0x9f0c('0x39')});}else{_0x12a204();}})[_0x9f0c('0x3a')](function(_0x5f14b2){_0x12a204(_0x5f14b2);});}});};exports[_0x9f0c('0x30')]=function isAuthenticated(_0x3b34f2){return compose()[_0x9f0c('0x31')](function(_0x4c6bd8,_0x1ef8c3,_0x2aecab){var _0x55475d;if(_0x4c6bd8[_0x9f0c('0x3b')][_0x9f0c('0x3c')]){if(_[_0x9f0c('0x3d')](_0x4c6bd8[_0x9f0c('0x3b')][_0x9f0c('0x3c')],_0x9f0c('0x3e'))){var _0xe2fb19=basicAuth(_0x4c6bd8);db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'name':_0xe2fb19['name']}})[_0x9f0c('0x36')](function(_0x24d19d){if(!_0x24d19d||!_0x24d19d[_0x9f0c('0x41')](_0xe2fb19[_0x9f0c('0x42')])){return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x45')});}_0x4c6bd8[_0x9f0c('0x32')]={'id':_0x24d19d['id']};_0x2aecab();})[_0x9f0c('0x3a')](function(_0x534efb){_0x2aecab(_0x534efb);});}else if(_[_0x9f0c('0x3d')](_0x4c6bd8[_0x9f0c('0x3b')]['authorization'],_0x9f0c('0x46'))){validateJwt(_0x4c6bd8,_0x1ef8c3,_0x2aecab);}else{if(_0x3b34f2){_0x2aecab();}else{return _0x1ef8c3[_0x9f0c('0x43')](0x193)[_0x9f0c('0x44')]({'message':_0x9f0c('0x47')});}}}else if(_0x4c6bd8['query'][_0x9f0c('0x48')]){try{var _0x4a9dd6={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x9f0c('0x49')]()};verifyJwt(_0x4c6bd8[_0x9f0c('0x4a')]['apikey'],_0x4a9dd6)[_0x9f0c('0x36')](function(_0x165ac8){return db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'id':_0x165ac8[_0x9f0c('0x4b')]}})[_0x9f0c('0x36')](function(_0x165755){_0x55475d=_0x165755;return db['Setting'][_0x9f0c('0x34')]({'where':{'id':0x1},'attributes':[_0x9f0c('0x4c'),_0x9f0c('0x4d')],'raw':!![]});})[_0x9f0c('0x36')](function(_0x346f36){if(!_0x55475d||!_['isEqual'](_0x55475d['apiKeyNonce'],_0x165ac8['nonce'])){return _0x1ef8c3['status'](0x191)[_0x9f0c('0x44')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x55475d[_0x9f0c('0x4e')]){return _0x1ef8c3[_0x9f0c('0x43')](0x191)['json']({'message':_0x9f0c('0x4f')});}if(_0x55475d[_0x9f0c('0x50')]){if(_0x346f36[_0x9f0c('0x4d')]>0x0){if(moment(_0x55475d['blockedAt'])[_0x9f0c('0x51')](_0x346f36[_0x9f0c('0x4d')],_0x9f0c('0x52'))>moment()){return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x4f')});}}else{return _0x1ef8c3[_0x9f0c('0x43')](0x191)[_0x9f0c('0x44')]({'message':_0x9f0c('0x4f')});}}_0x4c6bd8[_0x9f0c('0x32')]={'id':_0x55475d['id']};_0x2aecab();});})['catch'](function(){return _0x1ef8c3['status'](0x191)[_0x9f0c('0x44')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2a0342){_0x2aecab(_0x2a0342);}}else if(_0x3b34f2){_0x2aecab();}else{return _0x1ef8c3[_0x9f0c('0x43')](0x193)[_0x9f0c('0x44')]({'message':_0x9f0c('0x47')});}})['use'](function(_0x4a3f18,_0x13956e,_0x7e690c){if(_0x4a3f18[_0x9f0c('0x32')]){db[_0x9f0c('0x3f')][_0x9f0c('0x40')]({'where':{'id':_0x4a3f18[_0x9f0c('0x32')]['id']},'attributes':userAttributes})[_0x9f0c('0x36')](function(_0x31fc67){if(!_0x31fc67){return _0x13956e[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':_0x9f0c('0x53')});}_0x4a3f18[_0x9f0c('0x32')]=_0x31fc67;_0x7e690c();})[_0x9f0c('0x3a')](function(_0x455c85){_0x7e690c(_0x455c85);});}else if(_0x3b34f2){_0x7e690c();}else{return _0x13956e[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':_0x9f0c('0x54')});}});};exports[_0x9f0c('0x55')]=function canUpdate(){return compose()[_0x9f0c('0x31')](function(_0x3e0be7,_0x336ddc,_0x4b0fb9){return licenseUtil['getLicense']()[_0x9f0c('0x36')](function(_0x1cd53f){if(_0x1cd53f['update']){_0x4b0fb9();}else{return _0x336ddc[_0x9f0c('0x43')](0x193)['json']({'message':_0x9f0c('0x56')});}})['catch'](function(_0x15225c){_0x4b0fb9(_0x15225c);});});};exports['isMiddleware']=function(_0x267d12,_0xd8115b,_0xb5f19c){_0x267d12[_0x9f0c('0x57')]=!![];return _0xb5f19c();};exports[_0x9f0c('0x58')]=function signToken(_0x1dcbe8){return signJwt(_0x1dcbe8);};exports[_0x9f0c('0x59')]=function(_0x5470fb,_0x2d5308){if(!_0x5470fb[_0x9f0c('0x32')]){return _0x2d5308[_0x9f0c('0x43')](0x194)[_0x9f0c('0x44')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4cc0c2={'payload':{'id':_0x5470fb['user']['id'],'role':_0x5470fb[_0x9f0c('0x32')][_0x9f0c('0xf')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4cc0c2)['then'](function(_0x5d7fe7){_0x2d5308['cookie'](_0x9f0c('0x5a'),_0x5d7fe7);_0x2d5308[_0x9f0c('0x5b')](_0x9f0c('0x5c'));})['catch'](function(_0x4113d6){return _0x2d5308['status'](0x1f4)[_0x9f0c('0x5d')](_0x4113d6);});};exports[_0x9f0c('0x5e')]=function(_0x3a8a52){if(_[_0x9f0c('0x5f')](_0x3a8a52[_0x9f0c('0x60')])||_['isNil'](_0x3a8a52[_0x9f0c('0x61')])){return null;}else{return createJwt(_0x3a8a52);}};exports[_0x9f0c('0x62')]=function(_0x31f039){_0x31f039[_0x9f0c('0x60')]=generateNonce();_0x31f039['apiKeyIat']=generateIssuedAt();return createJwt(_0x31f039);};exports['regenerateApiKey']=function(_0x530ffc,_0x3b6ee5){var _0x390dbe=_0x530ffc[_0x9f0c('0x4a')][_0x9f0c('0x48')];if(_0x390dbe){var _0x583dc2={'nonce':_0x3b6ee5[_0x9f0c('0x60')],'iat':_0x3b6ee5['apiKeyIat'],'audience':hardwareConf[_0x9f0c('0x49')](),'issuer':hardwareConf[_0x9f0c('0x49')]()};return verifyJwt(_0x390dbe,_0x583dc2)['then'](function(){return generateApiKey(_0x3b6ee5);});}else{throw{'message':_0x9f0c('0x63')};}};exports['validatePasswordPattern']=function(_0x438b18){var _0x71b29c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x71b29c[_0x9f0c('0x64')](_0x438b18))throw new db[(_0x9f0c('0x65'))][(_0x9f0c('0x66'))](_0x9f0c('0x67'));return;};exports[_0x9f0c('0x68')]=function(_0x22d771,_0x329fd6,_0x529e96){var _0xe118b7=encryptor['decryptString'](_0x329fd6)[_0x9f0c('0x69')](',');for(var _0x38b228=0x0;_0x38b228<_0x529e96;_0x38b228++){if(!_0xe118b7[_0x38b228])break;if(_0x22d771[_0x9f0c('0x6a')]()===_0xe118b7[_0x38b228][_0x9f0c('0x6a')]()){var _0xffec41=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x529e96);if(_0x529e96===0x1){_0xffec41=_0x9f0c('0x6b');}throw new db[(_0x9f0c('0x65'))][(_0x9f0c('0x66'))](_0xffec41);}}return;};exports[_0x9f0c('0x6c')]=function(_0x36c95b,_0x490622){var _0x4ad908=_0x490622?encryptor[_0x9f0c('0x6d')](_0x490622)[_0x9f0c('0x69')](','):[];if(_0x4ad908['length']===0x5){_0x4ad908[_0x9f0c('0x6e')](-0x1,0x1);}_0x4ad908[_0x9f0c('0x6f')](_0x36c95b);return encryptor['encryptString'](_0x4ad908[_0x9f0c('0x70')](','));};function signJwt(_0x314182){var _0x566bcc=BPromise['promisify'](jwt[_0x9f0c('0x71')],{'context':jwt});var _0x22a974=_0x314182[_0x9f0c('0x72')]||config['secrets']['session'];return new BPromise(function(_0x15fc60,_0x4cd4ff){_0x566bcc(_0x314182[_0x9f0c('0x73')],_0x22a974,_0x314182[_0x9f0c('0x74')])[_0x9f0c('0x36')](function(_0x1dcd9e){_0x15fc60(_0x1dcd9e);})[_0x9f0c('0x3a')](function(_0xb9f2bc){_0x4cd4ff(_0xb9f2bc);});});}function verifyJwt(_0x347231,_0x2b7a94,_0x4c13dd){var _0x479a94=BPromise['promisify'](jwt[_0x9f0c('0x75')],{'context':jwt});var _0xf2fdfa=_0x4c13dd||config['secrets'][_0x9f0c('0xe')];return new BPromise(function(_0x3e4d61,_0x4c710d){_0x479a94(_0x347231,_0xf2fdfa,_0x2b7a94)['then'](function(_0x228faa){_0x3e4d61(_0x228faa);})['catch'](function(_0x3067fc){_0x4c710d(_0x3067fc);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString']('hex');}function generateIssuedAt(){return Math[_0x9f0c('0x76')](Date[_0x9f0c('0x77')]()/0x3e8)['toString']();}function createJwt(_0x1d9d0e){var _0x5aa01d={'payload':{'iat':_0x1d9d0e[_0x9f0c('0x61')],'nonce':_0x1d9d0e[_0x9f0c('0x60')]},'options':{'algorithm':'HS512','subject':_0x1d9d0e['id'][_0x9f0c('0x78')](),'issuer':hardwareConf[_0x9f0c('0x49')](),'audience':hardwareConf[_0x9f0c('0x49')]()}};return signJwt(_0x5aa01d)['then'](function(_0x30eace){return{'iat':_0x1d9d0e[_0x9f0c('0x61')],'nonce':_0x1d9d0e['apiKeyNonce'],'token':_0x30eace};});}
\ No newline at end of file
+var _0xee33=['Wrong\x20credentials.','startsWith','Bearer','json','Unknown\x20authorization\x20format','apikey','getUuid','query','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockDuration','blockedAt','User\x20not\x20found.','User\x20object\x20not\x20found.','getLicense','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','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\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','session','payload','options','randomBytes','hex','now','toString','HS512','../../config/environment','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','role','fullname','email','userpic','permissions','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','use','user','ChatInteraction','findOne','disposition','then','closed','status','unmanaged','Unmanaged.','catch','isAuthenticated','headers','authorization','Basic','User','find','name','authenticate'];(function(_0x310d56,_0x581328){var _0x8759c7=function(_0x2eafc5){while(--_0x2eafc5){_0x310d56['push'](_0x310d56['shift']());}};_0x8759c7(++_0x581328);}(_0xee33,0x19b));var _0x3ee3=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xee33[_0x5e3b04];return _0x1fc44d;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x3ee3('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x3ee3('0x1'));var encryptor=require(_0x3ee3('0x2'));var _=require('lodash');var jwt=require(_0x3ee3('0x3'));var expressJwt=require(_0x3ee3('0x4'));var compose=require(_0x3ee3('0x5'));var basicAuth=require(_0x3ee3('0x6'));var crypto=require(_0x3ee3('0x7'));var BPromise=require(_0x3ee3('0x8'));var util=require(_0x3ee3('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x3ee3('0xa'),_0x3ee3('0xb'),'name','internal',_0x3ee3('0xc'),_0x3ee3('0xd'),_0x3ee3('0xe'),'md5secret',_0x3ee3('0xf'),_0x3ee3('0x10'),_0x3ee3('0x11'),'faxPause',_0x3ee3('0x12'),_0x3ee3('0x13'),_0x3ee3('0x14'),'showWebBar','lastLoginAt',_0x3ee3('0x15'),_0x3ee3('0x16'),_0x3ee3('0x17'),_0x3ee3('0x18'),_0x3ee3('0x19'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x3ee3('0x1a'),_0x3ee3('0x1b'),_0x3ee3('0x1c'),_0x3ee3('0x1d'),'phoneBarRemoteControl',_0x3ee3('0x1e'),'hotdesk',_0x3ee3('0x1f'),_0x3ee3('0x20'),_0x3ee3('0x21'),'settingsEnabled',_0x3ee3('0x22'),_0x3ee3('0x23'),_0x3ee3('0x24'),_0x3ee3('0x25')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x3ee3('0x26')](function(_0x340e18,_0x54eb82,_0x216e27){if(_0x340e18[_0x3ee3('0x27')]){_0x216e27();}else{return db[_0x3ee3('0x28')][_0x3ee3('0x29')]({'where':{'id':_0x340e18['params']['id']},'attributes':['id','closed',_0x3ee3('0x2a')],'raw':!![]})[_0x3ee3('0x2b')](function(_0x572c34){if(_0x572c34&&_0x572c34[_0x3ee3('0x2c')]){return _0x54eb82[_0x3ee3('0x2d')](_0x572c34['disposition']===_0x3ee3('0x2e')?0x195:0x193)['json']({'message':_0x572c34['disposition']===_0x3ee3('0x2e')?_0x3ee3('0x2f'):'Forbidden.'});}else{_0x216e27();}})[_0x3ee3('0x30')](function(_0x4fe313){_0x216e27(_0x4fe313);});}});};exports[_0x3ee3('0x31')]=function isAuthenticated(_0x396638){return compose()[_0x3ee3('0x26')](function(_0x33afca,_0x4d2933,_0x2286fa){var _0x4d75c2;if(_0x33afca[_0x3ee3('0x32')][_0x3ee3('0x33')]){if(_['startsWith'](_0x33afca[_0x3ee3('0x32')][_0x3ee3('0x33')],_0x3ee3('0x34'))){var _0x2f470b=basicAuth(_0x33afca);db[_0x3ee3('0x35')][_0x3ee3('0x36')]({'where':{'name':_0x2f470b[_0x3ee3('0x37')]}})[_0x3ee3('0x2b')](function(_0x1dd4a1){if(!_0x1dd4a1||!_0x1dd4a1[_0x3ee3('0x38')](_0x2f470b['pass'])){return _0x4d2933['status'](0x191)['json']({'message':_0x3ee3('0x39')});}_0x33afca['user']={'id':_0x1dd4a1['id']};_0x2286fa();})[_0x3ee3('0x30')](function(_0x5bbd57){_0x2286fa(_0x5bbd57);});}else if(_[_0x3ee3('0x3a')](_0x33afca[_0x3ee3('0x32')][_0x3ee3('0x33')],_0x3ee3('0x3b'))){validateJwt(_0x33afca,_0x4d2933,_0x2286fa);}else{if(_0x396638){_0x2286fa();}else{return _0x4d2933[_0x3ee3('0x2d')](0x193)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x3d')});}}}else if(_0x33afca['query'][_0x3ee3('0x3e')]){try{var _0x364870={'audience':hardwareConf[_0x3ee3('0x3f')](),'issuer':hardwareConf[_0x3ee3('0x3f')]()};verifyJwt(_0x33afca[_0x3ee3('0x40')][_0x3ee3('0x3e')],_0x364870)[_0x3ee3('0x2b')](function(_0xedeabc){return db[_0x3ee3('0x35')][_0x3ee3('0x36')]({'where':{'id':_0xedeabc['sub']}})[_0x3ee3('0x2b')](function(_0x4fed6d){_0x4d75c2=_0x4fed6d;return db['Setting'][_0x3ee3('0x29')]({'where':{'id':0x1},'attributes':[_0x3ee3('0x41'),'blockDuration'],'raw':!![]});})[_0x3ee3('0x2b')](function(_0x1fa1ce){if(!_0x4d75c2||!_[_0x3ee3('0x42')](_0x4d75c2[_0x3ee3('0x43')],_0xedeabc[_0x3ee3('0x44')])){return _0x4d2933['status'](0x191)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x45')});}if(_0x4d75c2[_0x3ee3('0x46')]){return _0x4d2933[_0x3ee3('0x2d')](0x191)['json']({'message':_0x3ee3('0x47')});}if(_0x4d75c2['blocked']){if(_0x1fa1ce[_0x3ee3('0x48')]>0x0){if(moment(_0x4d75c2[_0x3ee3('0x49')])['add'](_0x1fa1ce['blockDuration'],'minutes')>moment()){return _0x4d2933[_0x3ee3('0x2d')](0x191)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x47')});}}else{return _0x4d2933['status'](0x191)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x47')});}}_0x33afca[_0x3ee3('0x27')]={'id':_0x4d75c2['id']};_0x2286fa();});})[_0x3ee3('0x30')](function(){return _0x4d2933[_0x3ee3('0x2d')](0x191)['json']({'message':_0x3ee3('0x47')});});}catch(_0x4f8165){_0x2286fa(_0x4f8165);}}else if(_0x396638){_0x2286fa();}else{return _0x4d2933['status'](0x193)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x3d')});}})[_0x3ee3('0x26')](function(_0x1cddbd,_0x3fd473,_0x54539e){if(_0x1cddbd[_0x3ee3('0x27')]){db[_0x3ee3('0x35')][_0x3ee3('0x36')]({'where':{'id':_0x1cddbd[_0x3ee3('0x27')]['id']},'attributes':userAttributes})[_0x3ee3('0x2b')](function(_0x1e3120){if(!_0x1e3120){return _0x3fd473['status'](0x194)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x4a')});}_0x1cddbd[_0x3ee3('0x27')]=_0x1e3120;_0x54539e();})[_0x3ee3('0x30')](function(_0x1ac376){_0x54539e(_0x1ac376);});}else if(_0x396638){_0x54539e();}else{return _0x3fd473['status'](0x194)[_0x3ee3('0x3c')]({'message':_0x3ee3('0x4b')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0x3ee3('0x26')](function(_0x51c244,_0x3d4ce7,_0x2924d6){return licenseUtil[_0x3ee3('0x4c')]()[_0x3ee3('0x2b')](function(_0x1b5dc1){if(_0x1b5dc1['update']){_0x2924d6();}else{return _0x3d4ce7['status'](0x193)['json']({'message':'Forbidden'});}})[_0x3ee3('0x30')](function(_0x4708da){_0x2924d6(_0x4708da);});});};exports[_0x3ee3('0x4d')]=function(_0x1769dd,_0x494bf8,_0x4c8f97){_0x1769dd[_0x3ee3('0x4d')]=!![];return _0x4c8f97();};exports[_0x3ee3('0x4e')]=function signToken(_0x1658ca){return signJwt(_0x1658ca);};exports[_0x3ee3('0x4f')]=function(_0x29d4d1,_0x34cd89){if(!_0x29d4d1[_0x3ee3('0x27')]){return _0x34cd89['status'](0x194)['json']({'message':_0x3ee3('0x50')});}var _0x43b37d={'payload':{'id':_0x29d4d1[_0x3ee3('0x27')]['id'],'role':_0x29d4d1[_0x3ee3('0x27')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x43b37d)[_0x3ee3('0x2b')](function(_0x5ea92f){_0x34cd89['cookie'](_0x3ee3('0x51'),_0x5ea92f);_0x34cd89[_0x3ee3('0x52')]('/dashboards/general');})[_0x3ee3('0x30')](function(_0x4c666d){return _0x34cd89['status'](0x1f4)[_0x3ee3('0x53')](_0x4c666d);});};exports[_0x3ee3('0x54')]=function(_0x19e0b8){if(_[_0x3ee3('0x55')](_0x19e0b8[_0x3ee3('0x43')])||_[_0x3ee3('0x55')](_0x19e0b8[_0x3ee3('0x56')])){return null;}else{return createJwt(_0x19e0b8);}};exports[_0x3ee3('0x57')]=function(_0x1a65ea){_0x1a65ea[_0x3ee3('0x43')]=generateNonce();_0x1a65ea[_0x3ee3('0x56')]=generateIssuedAt();return createJwt(_0x1a65ea);};exports[_0x3ee3('0x58')]=function(_0x549365,_0x59c3d1){var _0x543621=_0x549365[_0x3ee3('0x40')][_0x3ee3('0x3e')];if(_0x543621){var _0x538965={'nonce':_0x59c3d1[_0x3ee3('0x43')],'iat':_0x59c3d1[_0x3ee3('0x56')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x3ee3('0x3f')]()};return verifyJwt(_0x543621,_0x538965)[_0x3ee3('0x2b')](function(){return generateApiKey(_0x59c3d1);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x3ee3('0x59')]=function(_0x35f8e6){var _0x3ab1f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3ab1f0['test'](_0x35f8e6))throw new db[(_0x3ee3('0x5a'))][(_0x3ee3('0x5b'))](_0x3ee3('0x5c'));return;};exports[_0x3ee3('0x5d')]=function(_0xd22131,_0x280cbb,_0x263093){var _0x328a2d=encryptor['decryptString'](_0x280cbb)[_0x3ee3('0x5e')](',');for(var _0x2f6d7d=0x0;_0x2f6d7d<_0x263093;_0x2f6d7d++){if(!_0x328a2d[_0x2f6d7d])break;if(_0xd22131[_0x3ee3('0x5f')]()===_0x328a2d[_0x2f6d7d]['toLowerCase']()){var _0x46db53=util[_0x3ee3('0x60')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x263093);if(_0x263093===0x1){_0x46db53=_0x3ee3('0x61');}throw new db[(_0x3ee3('0x5a'))][(_0x3ee3('0x5b'))](_0x46db53);}}return;};exports[_0x3ee3('0x62')]=function(_0x38dfcd,_0x1de2da){var _0x1cba90=_0x1de2da?encryptor[_0x3ee3('0x63')](_0x1de2da)[_0x3ee3('0x5e')](','):[];if(_0x1cba90[_0x3ee3('0x64')]===0x5){_0x1cba90[_0x3ee3('0x65')](-0x1,0x1);}_0x1cba90[_0x3ee3('0x66')](_0x38dfcd);return encryptor[_0x3ee3('0x67')](_0x1cba90[_0x3ee3('0x68')](','));};function signJwt(_0x5e99b5){var _0x837570=BPromise[_0x3ee3('0x69')](jwt[_0x3ee3('0x6a')],{'context':jwt});var _0x1fb0d1=_0x5e99b5[_0x3ee3('0x6b')]||config[_0x3ee3('0x6c')][_0x3ee3('0x6d')];return new BPromise(function(_0x300335,_0xba97da){_0x837570(_0x5e99b5[_0x3ee3('0x6e')],_0x1fb0d1,_0x5e99b5[_0x3ee3('0x6f')])[_0x3ee3('0x2b')](function(_0x50a3a1){_0x300335(_0x50a3a1);})['catch'](function(_0xfae936){_0xba97da(_0xfae936);});});}function verifyJwt(_0xdf2284,_0x53c1c7,_0x34a4ae){var _0xc47b44=BPromise[_0x3ee3('0x69')](jwt['verify'],{'context':jwt});var _0x47e131=_0x34a4ae||config['secrets']['session'];return new BPromise(function(_0x1d4a89,_0x13eb87){_0xc47b44(_0xdf2284,_0x47e131,_0x53c1c7)[_0x3ee3('0x2b')](function(_0x55b218){_0x1d4a89(_0x55b218);})[_0x3ee3('0x30')](function(_0x54e642){_0x13eb87(_0x54e642);});});}function generateNonce(){return crypto[_0x3ee3('0x70')](0x10)['toString'](_0x3ee3('0x71'));}function generateIssuedAt(){return Math['floor'](Date[_0x3ee3('0x72')]()/0x3e8)[_0x3ee3('0x73')]();}function createJwt(_0x5d8ddc){var _0x4e3f5c={'payload':{'iat':_0x5d8ddc[_0x3ee3('0x56')],'nonce':_0x5d8ddc[_0x3ee3('0x43')]},'options':{'algorithm':_0x3ee3('0x74'),'subject':_0x5d8ddc['id'][_0x3ee3('0x73')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x3ee3('0x3f')]()}};return signJwt(_0x4e3f5c)['then'](function(_0x486bca){return{'iat':_0x5d8ddc[_0x3ee3('0x56')],'nonce':_0x5d8ddc[_0x3ee3('0x43')],'token':_0x486bca};});}
\ No newline at end of file
index 9657ef5..61417db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd836=['write','final','end','unlink','createReadStream','createDecipher','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary'];(function(_0x1ca993,_0x243c1e){var _0x150e5e=function(_0xaf1a3e){while(--_0xaf1a3e){_0x1ca993['push'](_0x1ca993['shift']());}};_0x150e5e(++_0x243c1e);}(_0xd836,0x72));var _0x6d83=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd836[_0x4565bf];return _0x5610ba;};'use strict';var crypto=require(_0x6d83('0x0'));var fs=require('fs');var BPromise=require(_0x6d83('0x1'));var _=require(_0x6d83('0x2'));var config=require(_0x6d83('0x3'));var logger=require('../../config/logger')(_0x6d83('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6d83('0x5')]['session'],'algorithm':_0x6d83('0x6')};const fileOptions={'algorithm':_0x6d83('0x7')};if(config[_0x6d83('0x8')]&&config[_0x6d83('0x8')][_0x6d83('0x9')]){var isSupported=isAlgorithmSupported(config[_0x6d83('0x8')]['algorithm']);if(isSupported){fileOptions[_0x6d83('0x9')]=config[_0x6d83('0x8')][_0x6d83('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6d83('0xa')](',\x20');logger[_0x6d83('0xb')](config[_0x6d83('0x8')][_0x6d83('0x9')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0xb6145c){return AES_SUPPORTED_RX[_0x6d83('0xc')](_0xb6145c);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x6d83('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x5ec01f){return getSupportedCiphers()[_0x6d83('0xe')](_0x5ec01f)>-0x1;}function combineOptions(_0x2c1f60){var _0x31fc92={};for(var _0x48939a in fileOptions){if(fileOptions['hasOwnProperty'](_0x48939a)){_0x31fc92[_0x48939a]=fileOptions[_0x48939a];}}if(_0x2c1f60){for(var _0xc1b6da in _0x2c1f60){if(_0x2c1f60[_0x6d83('0xf')](_0xc1b6da)){_0x31fc92[_0xc1b6da]=_0x2c1f60[_0xc1b6da];}}}return _0x31fc92;}exports[_0x6d83('0x10')]=function(_0x5c4e0e,_0x9aa6fa,_0x25f58b,_0x5662de){return new BPromise(function(_0x2e0cf2,_0x1f82b6){_0x5662de=combineOptions(_0x5662de);var _0x41a4cf=new Buffer(_0x25f58b);var _0x173c2a=fs['createReadStream'](_0x5c4e0e);var _0x4da1bb=fs[_0x6d83('0x11')](_0x9aa6fa);var _0x5760fa=crypto[_0x6d83('0x12')](_0x5662de[_0x6d83('0x9')],_0x41a4cf);_0x173c2a['on'](_0x6d83('0x13'),function(_0x2aea95){var _0x4608ec=new Buffer(_0x5760fa[_0x6d83('0x14')](_0x2aea95),_0x6d83('0x15'));_0x4da1bb[_0x6d83('0x16')](_0x4608ec);});_0x173c2a['on']('end',function(){try{var _0x21dbe5=new Buffer(_0x5760fa[_0x6d83('0x17')](_0x6d83('0x15')),_0x6d83('0x15'));_0x4da1bb[_0x6d83('0x16')](_0x21dbe5);_0x4da1bb[_0x6d83('0x18')]();_0x4da1bb['on']('close',function(){return _0x2e0cf2(_0x9aa6fa);});}catch(_0x3cea09){fs[_0x6d83('0x19')](_0x9aa6fa);return _0x1f82b6(_0x3cea09);}});});};exports['decryptFile']=function(_0x51de9a,_0x28bf6a,_0x2148da,_0x59f624){return new BPromise(function(_0x36621f,_0x165c77){_0x59f624=combineOptions(_0x59f624);var _0x5f5cb6=new Buffer(_0x2148da);var _0x1875bd=fs[_0x6d83('0x1a')](_0x51de9a);var _0x55f370=fs[_0x6d83('0x11')](_0x28bf6a);var _0x4038bd=crypto[_0x6d83('0x1b')](_0x59f624['algorithm'],_0x5f5cb6);_0x1875bd['on'](_0x6d83('0x13'),function(_0x461f4d){var _0x30a6df=new Buffer(_0x4038bd['update'](_0x461f4d),_0x6d83('0x15'));_0x55f370[_0x6d83('0x16')](_0x30a6df);});_0x1875bd['on']('end',function(){try{var _0x2f8d5c=new Buffer(_0x4038bd[_0x6d83('0x17')]('binary'),_0x6d83('0x15'));_0x55f370[_0x6d83('0x16')](_0x2f8d5c);_0x55f370[_0x6d83('0x18')]();_0x55f370['on'](_0x6d83('0x1c'),function(){return _0x36621f(_0x28bf6a);});}catch(_0x529359){fs[_0x6d83('0x19')](_0x28bf6a);return _0x165c77(_0x529359);}});});};exports[_0x6d83('0x1d')]=function(_0x1a3f40,_0x3c0491,_0x4e8a9e){var _0x5d21e8=_0x4e8a9e||stringOptions['algorithm'];var _0x59c870=_0x3c0491||stringOptions[_0x6d83('0x1e')];var _0x5d0d13=crypto[_0x6d83('0x12')](_0x5d21e8,_0x59c870);var _0x3d528d=_0x5d0d13[_0x6d83('0x14')](_0x1a3f40,_0x6d83('0x1f'),_0x6d83('0x20'));_0x3d528d+=_0x5d0d13[_0x6d83('0x17')](_0x6d83('0x20'));return _0x3d528d;};exports[_0x6d83('0x21')]=function(_0x31ed65,_0x303a35,_0x1fd6e6){var _0x409fc3=_0x1fd6e6||stringOptions[_0x6d83('0x9')];var _0x3f1e5c=_0x303a35||stringOptions['secret'];var _0x573942=crypto[_0x6d83('0x1b')](_0x409fc3,_0x3f1e5c);var _0x393d46=_0x573942[_0x6d83('0x14')](_0x31ed65,'base64',_0x6d83('0x1f'));_0x393d46+=_0x573942[_0x6d83('0x17')]('utf8');return _0x393d46;};
\ No newline at end of file
+var _0xb6be=['crypto','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','createCipher','data','update','binary','end','final','write','close','unlink','decryptFile','createReadStream','encryptString','secret','base64','decryptString','createDecipher','utf8'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xb6be,0x155));var _0xeb6b=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xb6be[_0x3c2a69];return _0x596bc8;};'use strict';var crypto=require(_0xeb6b('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xeb6b('0x1'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xeb6b('0x2')][_0xeb6b('0x3')],'algorithm':_0xeb6b('0x4')};const fileOptions={'algorithm':'aes192'};if(config[_0xeb6b('0x5')]&&config['encrypt'][_0xeb6b('0x6')]){var isSupported=isAlgorithmSupported(config[_0xeb6b('0x5')][_0xeb6b('0x6')]);if(isSupported){fileOptions[_0xeb6b('0x6')]=config[_0xeb6b('0x5')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xeb6b('0x7')](',\x20');logger[_0xeb6b('0x8')](config[_0xeb6b('0x5')][_0xeb6b('0x6')],_0xeb6b('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x32c138){return AES_SUPPORTED_RX[_0xeb6b('0xa')](_0x32c138);}function getSupportedCiphers(){return crypto[_0xeb6b('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x3aae13){return getSupportedCiphers()[_0xeb6b('0xc')](_0x3aae13)>-0x1;}function combineOptions(_0x3a60cf){var _0x24028c={};for(var _0x41d943 in fileOptions){if(fileOptions[_0xeb6b('0xd')](_0x41d943)){_0x24028c[_0x41d943]=fileOptions[_0x41d943];}}if(_0x3a60cf){for(var _0x9edb18 in _0x3a60cf){if(_0x3a60cf['hasOwnProperty'](_0x9edb18)){_0x24028c[_0x9edb18]=_0x3a60cf[_0x9edb18];}}}return _0x24028c;}exports['encryptFile']=function(_0x3db412,_0x3a838d,_0x5b1d7f,_0xebc41f){return new BPromise(function(_0x34c407,_0x59f973){_0xebc41f=combineOptions(_0xebc41f);var _0x53c86e=new Buffer(_0x5b1d7f);var _0x4feddb=fs['createReadStream'](_0x3db412);var _0x26b0c9=fs['createWriteStream'](_0x3a838d);var _0x4fe702=crypto[_0xeb6b('0xe')](_0xebc41f[_0xeb6b('0x6')],_0x53c86e);_0x4feddb['on'](_0xeb6b('0xf'),function(_0x501d28){var _0x4b9c2f=new Buffer(_0x4fe702[_0xeb6b('0x10')](_0x501d28),_0xeb6b('0x11'));_0x26b0c9['write'](_0x4b9c2f);});_0x4feddb['on'](_0xeb6b('0x12'),function(){try{var _0x542e55=new Buffer(_0x4fe702[_0xeb6b('0x13')](_0xeb6b('0x11')),'binary');_0x26b0c9[_0xeb6b('0x14')](_0x542e55);_0x26b0c9[_0xeb6b('0x12')]();_0x26b0c9['on'](_0xeb6b('0x15'),function(){return _0x34c407(_0x3a838d);});}catch(_0x7d0a0e){fs[_0xeb6b('0x16')](_0x3a838d);return _0x59f973(_0x7d0a0e);}});});};exports[_0xeb6b('0x17')]=function(_0x2e7cd5,_0xa7f96d,_0x1f1a6a,_0x568a46){return new BPromise(function(_0x266601,_0x537989){_0x568a46=combineOptions(_0x568a46);var _0x40fdbf=new Buffer(_0x1f1a6a);var _0x4b1529=fs[_0xeb6b('0x18')](_0x2e7cd5);var _0x4c4893=fs['createWriteStream'](_0xa7f96d);var _0x5913b0=crypto['createDecipher'](_0x568a46[_0xeb6b('0x6')],_0x40fdbf);_0x4b1529['on'](_0xeb6b('0xf'),function(_0x526099){var _0x507ccf=new Buffer(_0x5913b0['update'](_0x526099),'binary');_0x4c4893[_0xeb6b('0x14')](_0x507ccf);});_0x4b1529['on'](_0xeb6b('0x12'),function(){try{var _0x1e041f=new Buffer(_0x5913b0[_0xeb6b('0x13')]('binary'),_0xeb6b('0x11'));_0x4c4893['write'](_0x1e041f);_0x4c4893['end']();_0x4c4893['on'](_0xeb6b('0x15'),function(){return _0x266601(_0xa7f96d);});}catch(_0x2cad97){fs['unlink'](_0xa7f96d);return _0x537989(_0x2cad97);}});});};exports[_0xeb6b('0x19')]=function(_0x88b98a,_0x563ff1,_0x52c238){var _0x3f92be=_0x52c238||stringOptions['algorithm'];var _0x502363=_0x563ff1||stringOptions[_0xeb6b('0x1a')];var _0xc02f52=crypto[_0xeb6b('0xe')](_0x3f92be,_0x502363);var _0x2144ef=_0xc02f52[_0xeb6b('0x10')](_0x88b98a,'utf8',_0xeb6b('0x1b'));_0x2144ef+=_0xc02f52['final']('base64');return _0x2144ef;};exports[_0xeb6b('0x1c')]=function(_0x51db40,_0x4166d9,_0x3460af){var _0xb375d2=_0x3460af||stringOptions['algorithm'];var _0x42a468=_0x4166d9||stringOptions['secret'];var _0x3c675f=crypto[_0xeb6b('0x1d')](_0xb375d2,_0x42a468);var _0x2c6e21=_0x3c675f[_0xeb6b('0x10')](_0x51db40,_0xeb6b('0x1b'),_0xeb6b('0x1e'));_0x2c6e21+=_0x3c675f[_0xeb6b('0x13')](_0xeb6b('0x1e'));return _0x2c6e21;};
\ No newline at end of file
index 1fe387a..d1ffe4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6192=['csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','finally','util','path','lodash','to-csv','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','CSV','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','existsSync','mkdirSync','join','each','push','then'];(function(_0xd112a4,_0x42ca00){var _0x255a22=function(_0x170903){while(--_0x170903){_0xd112a4['push'](_0xd112a4['shift']());}};_0x255a22(++_0x42ca00);}(_0x6192,0xf3));var _0x2619=function(_0x21c7d9,_0x179196){_0x21c7d9=_0x21c7d9-0x0;var _0xed56f5=_0x6192[_0x21c7d9];return _0xed56f5;};'use strict';var util=require(_0x2619('0x0'));var path=require(_0x2619('0x1'));var _=require(_0x2619('0x2'));var csv=require(_0x2619('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x2619('0x4'));var db=require(_0x2619('0x5'))['db'];var dbH=require(_0x2619('0x5'))[_0x2619('0x6')];var logger=require(_0x2619('0x7'))(_0x2619('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x2619('0x9')][0x2]);var QUERY=process[_0x2619('0x9')][0x3];var PATH=process[_0x2619('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3eaf4b,_0x1febd8){var _0x29cc36={'status':_0x3eaf4b};var _0x26d5dc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1febd8){_0x29cc36[_0x2619('0xa')]=_0x1febd8;}return db[_0x2619('0xb')]['update'](_0x29cc36,_0x26d5dc);}function main(){var _0x4a5310=0x1388;var _0x25d666;logger[_0x2619('0xc')](util[_0x2619('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2619('0xe')));return db[_0x2619('0xf')][_0x2619('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2619('0x11'),_0x2619('0x12')]})['then'](function(_0x2e322a){if(_0x2e322a){_0x25d666=_0x2e322a;_0x4a5310=_0x25d666[_0x2619('0x12')]||0x1388;}})['then'](function(){return dbH[_0x2619('0x13')][_0x2619('0x14')](util['format'](_0x2619('0x15'),QUERY),{'type':dbH['sequelize'][_0x2619('0x16')]['SELECT']});})['then'](function(_0x41418d){if(!_0x41418d[0x0][_0x2619('0x17')]){return analyticExtractedReport(_0x2619('0x18'));}var _0x2c539a=[];var _0x3f5197=0x0;if(_0x25d666[_0x2619('0x11')]){if(_0x41418d&&_0x41418d[_0x2619('0x19')]){var _0x3ac551=_[_0x2619('0x1a')](_0x41418d[0x0][_0x2619('0x17')]/_0x4a5310);var _0x38dd3a=Number[_0x2619('0x1b')](_0x41418d[0x0][_0x2619('0x17')]/_0x4a5310)?_0x41418d[0x0][_0x2619('0x17')]%_0x4a5310:0x0;_0x3ac551[_0x2619('0x1c')](function(_0x3ff3f1){if(_0x3ff3f1>0x0){_0x3f5197+=_0x4a5310;}_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](util[_0x2619('0xd')](_0x2619('0x1d'),QUERY,_0x4a5310,_0x3f5197),{'type':dbH[_0x2619('0x13')]['QueryTypes']['SELECT']}));});if(_0x38dd3a>0x0){_0x3f5197+=_0x4a5310;_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](util[_0x2619('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x38dd3a,_0x3f5197),{'type':dbH[_0x2619('0x13')][_0x2619('0x16')][_0x2619('0x1e')]}));}}}else{_0x2c539a['push'](dbH[_0x2619('0x13')][_0x2619('0x14')](QUERY,{'type':dbH[_0x2619('0x13')]['QueryTypes']['SELECT']}));}var _0x5c6532=path[_0x2619('0x1f')](PATH);var _0x443947=path[_0x2619('0x20')](PATH,'.csv');var _0x4c84e7=_0x25d666[_0x2619('0x11')]&&_0x2c539a[_0x2619('0x19')]>0x1;var _0x795fee=[];if(!fs[_0x2619('0x21')](path['join'](_0x5c6532,_0x443947))&&_0x4c84e7){fs[_0x2619('0x22')](path[_0x2619('0x23')](_0x5c6532,_0x443947));}return BPromise[_0x2619('0x24')](_0x2c539a,function(_0x2b8e52){_0x795fee[_0x2619('0x25')](_0x2b8e52);})[_0x2619('0x26')](function(){for(var _0xead767=0x0;_0xead767<_0x795fee[_0x2619('0x19')];_0xead767+=0x1){var _0x4035e1;var _0xb51cd6=_0x795fee[_0xead767];if(_0x4c84e7){_0x4035e1=path['join'](_0x5c6532,_0x443947,util[_0x2619('0xd')]('%s%d.%s',_0x443947,_0xead767,_0x2619('0x27')));}else{_0x4035e1=path[_0x2619('0x23')](_0x5c6532,util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,_0x2619('0x27')));}fs[_0x2619('0x29')](_0x4035e1,csv(_0xb51cd6));}})[_0x2619('0x26')](function(){if(_0x4c84e7){return new Promise(function(_0x370e22){zipdir(path[_0x2619('0x23')](_0x5c6532,_0x443947),{'saveTo':path[_0x2619('0x23')](_0x5c6532,util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,'zip'))},function(_0x1e1c61,_0x16e148){rimraf(path['join'](_0x5c6532,_0x443947),function(){});_0x370e22(_0x2619('0x2a'));});});}})[_0x2619('0x26')](function(){logger[_0x2619('0xc')](util[_0x2619('0xd')](_0x2619('0x2b'),EXTRACTED_REPORT_ID,_0x2619('0xe')));return analyticExtractedReport('Completed',_0x4c84e7?util[_0x2619('0xd')](_0x2619('0x28'),_0x443947,_0x4c84e7?'zip':'csv'):null);});})[_0x2619('0x2c')](function(_0x2126c8){logger[_0x2619('0xc')](util[_0x2619('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2619('0xe')),util[_0x2619('0x2d')](_0x2126c8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2619('0x2e')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xf53c=['num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','split','length','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','info','CSV','find','splitSizeCsv','then','sequelize','query','format','QueryTypes','SELECT'];(function(_0x4c21d0,_0x16e2ac){var _0x3843b2=function(_0x47235c){while(--_0x47235c){_0x4c21d0['push'](_0x4c21d0['shift']());}};_0x3843b2(++_0x16e2ac);}(_0xf53c,0x6a));var _0xcf53=function(_0x5252e0,_0x1606cb){_0x5252e0=_0x5252e0-0x0;var _0x40720d=_0xf53c[_0x5252e0];return _0x40720d;};'use strict';var util=require(_0xcf53('0x0'));var path=require(_0xcf53('0x1'));var _=require(_0xcf53('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xcf53('0x3'));var zipdir=require(_0xcf53('0x4'));var rimraf=require(_0xcf53('0x5'));var db=require(_0xcf53('0x6'))['db'];var dbH=require(_0xcf53('0x6'))[_0xcf53('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xcf53('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xcf53('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e5908,_0x3fd9dc){var _0x2ef503={'status':_0x2e5908};var _0xd56a1d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3fd9dc){_0x2ef503[_0xcf53('0x9')]=_0x3fd9dc;}return db['AnalyticExtractedReport']['update'](_0x2ef503,_0xd56a1d);}function main(){var _0x1c7545=0x1388;var _0x19ffce;logger[_0xcf53('0xa')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xcf53('0xb')));return db['Setting'][_0xcf53('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xcf53('0xd')]})[_0xcf53('0xe')](function(_0x35a295){if(_0x35a295){_0x19ffce=_0x35a295;_0x1c7545=_0x19ffce[_0xcf53('0xd')]||0x1388;}})[_0xcf53('0xe')](function(){return dbH[_0xcf53('0xf')][_0xcf53('0x10')](util[_0xcf53('0x11')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xcf53('0xf')][_0xcf53('0x12')][_0xcf53('0x13')]});})[_0xcf53('0xe')](function(_0x43e469){if(!_0x43e469[0x0][_0xcf53('0x14')]){return analyticExtractedReport(_0xcf53('0x15'));}var _0x4a961f=[];var _0x3f91fa=0x0;if(_0x19ffce['split']){if(_0x43e469&&_0x43e469['length']){var _0x43fefc=_[_0xcf53('0x16')](_0x43e469[0x0][_0xcf53('0x14')]/_0x1c7545);var _0x2780ba=Number[_0xcf53('0x17')](_0x43e469[0x0][_0xcf53('0x14')]/_0x1c7545)?_0x43e469[0x0][_0xcf53('0x14')]%_0x1c7545:0x0;_0x43fefc[_0xcf53('0x18')](function(_0x5ab384){if(_0x5ab384>0x0){_0x3f91fa+=_0x1c7545;}_0x4a961f[_0xcf53('0x19')](dbH[_0xcf53('0xf')][_0xcf53('0x10')](util['format'](_0xcf53('0x1a'),QUERY,_0x1c7545,_0x3f91fa),{'type':dbH[_0xcf53('0xf')][_0xcf53('0x12')]['SELECT']}));});if(_0x2780ba>0x0){_0x3f91fa+=_0x1c7545;_0x4a961f['push'](dbH[_0xcf53('0xf')][_0xcf53('0x10')](util[_0xcf53('0x11')](_0xcf53('0x1a'),QUERY,_0x2780ba,_0x3f91fa),{'type':dbH[_0xcf53('0xf')][_0xcf53('0x12')][_0xcf53('0x13')]}));}}}else{_0x4a961f[_0xcf53('0x19')](dbH['sequelize'][_0xcf53('0x10')](QUERY,{'type':dbH['sequelize'][_0xcf53('0x12')][_0xcf53('0x13')]}));}var _0x5552d9=path['dirname'](PATH);var _0x42a2b3=path[_0xcf53('0x1b')](PATH,'.csv');var _0x15527d=_0x19ffce[_0xcf53('0x1c')]&&_0x4a961f[_0xcf53('0x1d')]>0x1;var _0xa36209=[];if(!fs['existsSync'](path[_0xcf53('0x1e')](_0x5552d9,_0x42a2b3))&&_0x15527d){fs[_0xcf53('0x1f')](path[_0xcf53('0x1e')](_0x5552d9,_0x42a2b3));}return BPromise['each'](_0x4a961f,function(_0x230adf){_0xa36209[_0xcf53('0x19')](_0x230adf);})[_0xcf53('0xe')](function(){for(var _0x2170ab=0x0;_0x2170ab<_0xa36209[_0xcf53('0x1d')];_0x2170ab+=0x1){var _0x2cd05a;var _0x14fc70=_0xa36209[_0x2170ab];if(_0x15527d){_0x2cd05a=path['join'](_0x5552d9,_0x42a2b3,util[_0xcf53('0x11')](_0xcf53('0x20'),_0x42a2b3,_0x2170ab,'csv'));}else{_0x2cd05a=path[_0xcf53('0x1e')](_0x5552d9,util[_0xcf53('0x11')](_0xcf53('0x21'),_0x42a2b3,_0xcf53('0x22')));}fs[_0xcf53('0x23')](_0x2cd05a,csv(_0x14fc70));}})[_0xcf53('0xe')](function(){if(_0x15527d){return new Promise(function(_0x22e313){zipdir(path[_0xcf53('0x1e')](_0x5552d9,_0x42a2b3),{'saveTo':path[_0xcf53('0x1e')](_0x5552d9,util['format'](_0xcf53('0x21'),_0x42a2b3,_0xcf53('0x24')))},function(_0x27e8df,_0x4510a7){rimraf(path['join'](_0x5552d9,_0x42a2b3),function(){});_0x22e313('zip\x20finished');});});}})[_0xcf53('0xe')](function(){logger[_0xcf53('0xa')](util[_0xcf53('0x11')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x15527d?util[_0xcf53('0x11')](_0xcf53('0x21'),_0x42a2b3,_0x15527d?_0xcf53('0x24'):'csv'):null);});})['catch'](function(_0x24ad06){logger[_0xcf53('0xa')](util[_0xcf53('0x11')](_0xcf53('0x25'),EXTRACTED_REPORT_ID,_0xcf53('0xb')),util[_0xcf53('0x26')](_0x24ad06,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcf53('0x27'));})[_0xcf53('0x28')](function(){process[_0xcf53('0x29')](EXIT_CODE);});}main();
\ No newline at end of file
index 54edf0e..66d5423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17af=['header','before','margin','landscape','toString','\x20/\x20','Arial','black','right','Empty','Setting','find','splitSizePdf','then','split','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','existsSync','mkdirSync','join','each','flatten','%s%d.%s','pdf','%s.%s','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','value','fill','length','auto','body','push','concat','chunk','keys','forEach','name','startDate','format','endDate'];(function(_0x11859d,_0x1c9f0e){var _0x6c172e=function(_0x5cc2c5){while(--_0x5cc2c5){_0x11859d['push'](_0x11859d['shift']());}};_0x6c172e(++_0x1c9f0e);}(_0x17af,0x19c));var _0xf17a=function(_0x5e291d,_0x335924){_0x5e291d=_0x5e291d-0x0;var _0x7597ec=_0x17af[_0x5e291d];return _0x7597ec;};'use strict';var _=require(_0xf17a('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xf17a('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0xf17a('0x2'));var PdfPrinter=require(_0xf17a('0x3'));var zipdir=require(_0xf17a('0x4'));var rimraf=require(_0xf17a('0x5'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xf17a('0x6'))['db'];var dbH=require(_0xf17a('0x6'))[_0xf17a('0x7')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xf17a('0x8')][0x3];var PATH=process[_0xf17a('0x8')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf17a('0x9');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2c4d79,_0x2cf639){var _0x1cf81d={'status':_0x2c4d79};var _0x4f453b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2cf639){_0x1cf81d[_0xf17a('0xa')]=_0x2cf639;}return db[_0xf17a('0xb')]['update'](_0x1cf81d,_0x4f453b);}function getHeaders(_0x126c30){return _[_0xf17a('0xc')](_0x126c30,function(_0x5d8569){return{'text':_0x5d8569,'style':_0xf17a('0xd')};});}function getRows(_0x397f00,_0x1d6838){return _[_0xf17a('0xc')](_0x1d6838,function(_0xa15e9f){return _(_0xa15e9f)['pick'](_0x397f00)[_0xf17a('0xc')](function(_0xf142e){return _0xf142e?_['toString'](_0xf142e):'';})[_0xf17a('0xe')]();});}function createTable(_0x21f77d,_0xfc1098){var _0xa58875={'widths':_[_0xf17a('0xf')](Array(_0x21f77d[_0xf17a('0x10')]),0x91),'heights':function(_0x5440e9){return _0x5440e9===0x0?_0xf17a('0x11'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc2c65d=getHeaders(_0x21f77d);_0xa58875[_0xf17a('0x12')][_0xf17a('0x13')](_0xc2c65d);var _0x28d6a1=getRows(_0x21f77d,_0xfc1098);_0xa58875[_0xf17a('0x12')]=_0xa58875[_0xf17a('0x12')][_0xf17a('0x14')](_0x28d6a1);return _0xa58875;}function createTables(_0x1a50a0){var _0x1a247b=[];var _0x2b6198=_[_0xf17a('0x15')](Object[_0xf17a('0x16')](_0x1a50a0[0x0]),0x5);_0x2b6198[_0xf17a('0x17')](function(_0x256407){_0x1a247b[_0xf17a('0x13')](createTable(_0x256407,_0x1a50a0));});return _0x1a247b;}function getPDFDocDefinition(_0x4c5c98){var _0x53bbb4=util['format']('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xf17a('0x18')],moment(EXTRACTED_REPORT[_0xf17a('0x19')])[_0xf17a('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0xf17a('0x1b')])['format'](FORMAT));var _0x3d211c=[];for(var _0x391933=0x0;_0x391933<_0x4c5c98[_0xf17a('0x10')];_0x391933++){var _0x3ac923=[];if(_0x391933===0x0){_0x3ac923['push']({'text':_0x53bbb4,'style':_0xf17a('0x1c')});}var _0x2081f6={'table':_0x4c5c98[_0x391933]};if(_0x391933>0x0){_0x2081f6['pageBreak']=_0xf17a('0x1d');_0x2081f6[_0xf17a('0x1e')]=[0x0,0x46,0x0,0x0];}_0x3ac923[_0xf17a('0x13')](_0x2081f6);_0x3d211c['push'](_0x3ac923);}return{'pageSize':'A4','pageOrientation':_0xf17a('0x1f'),'content':_0x3d211c,'footer':function(_0x1f6a26,_0x5cd8b4){return{'text':_0x1f6a26[_0xf17a('0x20')]()+_0xf17a('0x21')+_0x5cd8b4,'style':'footer'};},'defaultStyle':{'font':_0xf17a('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf17a('0x23')},'footer':{'alignment':_0xf17a('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4bf6e6){var _0x39acdc=0x1388;var _0xd12e42;if(!_0x4bf6e6[0x0]['num']){return analyticExtractedReport(_0xf17a('0x25'));}return db[_0xf17a('0x26')][_0xf17a('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf17a('0x28')]})['then'](function(_0x251416){if(_0x251416){_0xd12e42=_0x251416;_0x39acdc=_0xd12e42[_0xf17a('0x28')]||0x3e8;}})[_0xf17a('0x29')](function(){var _0x40783a=[];var _0x140528=0x0;if(_0xd12e42[_0xf17a('0x2a')]){if(_0x4bf6e6&&_0x4bf6e6[_0xf17a('0x10')]){var _0x5385c7=_['range'](_0x4bf6e6[0x0][_0xf17a('0x2b')]/_0x39acdc);var _0x7df846=Number[_0xf17a('0x2c')](_0x4bf6e6[0x0]['num']/_0x39acdc)?_0x4bf6e6[0x0]['num']%_0x39acdc:0x0;_0x5385c7[_0xf17a('0x17')](function(_0x3fd6e1){if(_0x3fd6e1>0x0){_0x140528+=_0x39acdc;}_0x40783a[_0xf17a('0x13')](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x2f'),QUERY,_0x39acdc,_0x140528),{'type':dbH[_0xf17a('0x2d')]['QueryTypes'][_0xf17a('0x30')]}));});if(_0x7df846>0x0){_0x140528+=_0x39acdc;_0x40783a[_0xf17a('0x13')](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x2f'),QUERY,_0x7df846,_0x140528),{'type':dbH['sequelize'][_0xf17a('0x31')]['SELECT']}));}}}else{_0x40783a['push'](dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](QUERY,{'type':dbH[_0xf17a('0x2d')]['QueryTypes'][_0xf17a('0x30')]}));}var _0x5a15cc=path[_0xf17a('0x32')](PATH);var _0x13b712=path[_0xf17a('0x33')](PATH,'.pdf');var _0xcd9089=_0xd12e42[_0xf17a('0x2a')]&&_0x40783a[_0xf17a('0x10')]>0x1;var _0x254c98=[];if(!fs[_0xf17a('0x34')](path['join'](_0x5a15cc,_0x13b712))&&_0xcd9089){fs[_0xf17a('0x35')](path[_0xf17a('0x36')](_0x5a15cc,_0x13b712));}return BPromise[_0xf17a('0x37')](_0x40783a,function(_0x5b47e3){_0x254c98[_0xf17a('0x13')](_0x5b47e3);})[_0xf17a('0x29')](function(){var _0x404358=[];for(var _0x30bd57=0x0;_0x30bd57<_0x254c98[_0xf17a('0x10')];_0x30bd57+=0x1){var _0x5e91ac=_0x254c98[_0x30bd57];var _0x5b63d0=createTables(_[_0xf17a('0x38')](_0x5e91ac));var _0x589d2e;var _0x147f40=getPDFDocDefinition(_0x5b63d0);var _0x4ea364=getPDFPrinter();var _0x565a05=_0x4ea364['createPdfKitDocument'](_0x147f40);if(_0xcd9089){_0x589d2e=path[_0xf17a('0x36')](_0x5a15cc,_0x13b712,util[_0xf17a('0x1a')](_0xf17a('0x39'),_0x13b712,_0x30bd57,_0xf17a('0x3a')));}else{_0x589d2e=path['join'](_0x5a15cc,util['format'](_0xf17a('0x3b'),_0x13b712,'pdf'));}_0x404358[_0xf17a('0x13')](writePDFDocument(_0x565a05,_0x589d2e));}return Promise[_0xf17a('0x3c')](_0x404358);})[_0xf17a('0x29')](function(){if(_0xcd9089){return new Promise(function(_0x4be178){zipdir(path[_0xf17a('0x36')](_0x5a15cc,_0x13b712),{'saveTo':path['join'](_0x5a15cc,util[_0xf17a('0x1a')](_0xf17a('0x3b'),_0x13b712,'zip'))},function(){rimraf(path['join'](_0x5a15cc,_0x13b712),function(){});_0x4be178(_0xf17a('0x3d'));});});}})[_0xf17a('0x29')](function(){if(!_0xcd9089)return;rimraf(path[_0xf17a('0x36')](_0x5a15cc,_0x13b712),function(){});})[_0xf17a('0x29')](function(){logger[_0xf17a('0x3e')](util[_0xf17a('0x1a')](_0xf17a('0x3f'),EXTRACTED_REPORT_ID,_0xf17a('0x40')));return analyticExtractedReport(_0xf17a('0x41'),_0xcd9089?util[_0xf17a('0x1a')](_0xf17a('0x3b'),_0x13b712,_0xcd9089?_0xf17a('0x42'):_0xf17a('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf17a('0x3e')](util['format'](_0xf17a('0x43'),EXTRACTED_REPORT_ID,_0xf17a('0x40')));return db[_0xf17a('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf17a('0x29')](function(_0x5f08fb){EXTRACTED_REPORT=_0x5f08fb;return dbH[_0xf17a('0x2d')][_0xf17a('0x2e')](util[_0xf17a('0x1a')](_0xf17a('0x44'),QUERY),{'type':dbH[_0xf17a('0x2d')][_0xf17a('0x31')]['SELECT']});})[_0xf17a('0x29')](extractReport)[_0xf17a('0x45')](function(_0x2a3e56){logger[_0xf17a('0x3e')](util['format'](_0xf17a('0x46'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x2a3e56,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf17a('0x47')](function(){process[_0xf17a('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x549c9d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xf17a('0x49'),'italics':__dirname+_0xf17a('0x4a'),'bolditalics':__dirname+_0xf17a('0x4b')}});return _0x549c9d;}function getPDFDocDefinitionFromHTML(_0x123b45,_0x1b6e93){var _0x3bd492=util[_0xf17a('0x1a')](_0xf17a('0x4c'),_0x1b6e93[_0xf17a('0x4d')],_0x1b6e93[_0xf17a('0x4e')]);var _0xdab6f7=moment()[_0xf17a('0x1a')](_0xf17a('0x4f'))[_0xf17a('0x20')]();var _0x1c9d21=htmlToPdfmake(_0x123b45,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1c9d21],'defaultStyle':{'font':_0xf17a('0x22')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf17a('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf17a('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xf17a('0x50')}},'header':function(){return[{'text':_0xf17a('0x51'),'style':_0xf17a('0x1c')}];},'footer':function(_0x2112ee,_0x3abd06){return[{'text':util[_0xf17a('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3bd492,_0x2112ee,_0x3abd06,_0xdab6f7),'style':_0xf17a('0x52')}];}};}function writePDFDocument(_0x1877ef,_0x6fb7f4){return new Promise(function(_0x4540f9,_0x252a9c){var _0x2df2ba=_0x1877ef[_0xf17a('0x53')](fs['createWriteStream'](_0x6fb7f4));_0x2df2ba['on'](_0xf17a('0x54'),function(){_0x4540f9(_0xf17a('0x54'));});_0x2df2ba['on'](_0xf17a('0x55'),function(_0xbcbcc7){_0x252a9c(_0xbcbcc7);});_0x1877ef[_0xf17a('0x56')]();});}exports[_0xf17a('0x57')]=function(_0x53e213,_0x273e02){var _0x2ca177=getPDFPrinter();var _0x9c996c=getPDFDocDefinitionFromHTML(_0x53e213,_0x273e02);var _0x52e67c=_0x2ca177['createPdfKitDocument'](_0x9c996c);return writePDFDocument(_0x52e67c,_0x273e02['path'])[_0xf17a('0x45')](function(_0x11881b){throw _0x11881b;});};
\ No newline at end of file
+var _0x8387=['tableHeader','pick','toString','value','fill','length','auto','body','push','chunk','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip\x20finished','PDF','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','YYYY-MM-DD','Arial','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','path','lodash','util','moment','html-to-pdfmake','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','argv','savename','update','map'];(function(_0x3b9790,_0xfbcf4b){var _0x50a671=function(_0x51e5c9){while(--_0x51e5c9){_0x3b9790['push'](_0x3b9790['shift']());}};_0x50a671(++_0xfbcf4b);}(_0x8387,0xb3));var _0x7838=function(_0x28ed52,_0x2b729d){_0x28ed52=_0x28ed52-0x0;var _0x2fabd9=_0x8387[_0x28ed52];return _0x2fabd9;};'use strict';var _=require(_0x7838('0x0'));var fs=require('fs');var util=require(_0x7838('0x1'));var path=require('path');var moment=require(_0x7838('0x2'));var htmlToPdfmake=require(_0x7838('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x7838('0x4'));var rimraf=require(_0x7838('0x5'));var JSDOM=require(_0x7838('0x6'))[_0x7838('0x7')];var window=new JSDOM('')[_0x7838('0x8')];var BPromise=require(_0x7838('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x7838('0xa'))[_0x7838('0xb')];var logger=require(_0x7838('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x7838('0xd')][0x2]);var QUERY=process[_0x7838('0xd')][0x3];var PATH=process[_0x7838('0xd')][0x4];var NAME=process[_0x7838('0xd')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x7fc139,_0x22691a){var _0x51ca5b={'status':_0x7fc139};var _0x936335={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22691a){_0x51ca5b[_0x7838('0xe')]=_0x22691a;}return db['AnalyticExtractedReport'][_0x7838('0xf')](_0x51ca5b,_0x936335);}function getHeaders(_0x5e12bf){return _[_0x7838('0x10')](_0x5e12bf,function(_0x13f41e){return{'text':_0x13f41e,'style':_0x7838('0x11')};});}function getRows(_0x5bd515,_0x14ff7a){return _['map'](_0x14ff7a,function(_0x357b01){return _(_0x357b01)[_0x7838('0x12')](_0x5bd515)[_0x7838('0x10')](function(_0x2e1c32){return _0x2e1c32?_[_0x7838('0x13')](_0x2e1c32):'';})[_0x7838('0x14')]();});}function createTable(_0x5aaa9a,_0x1df38b){var _0x34a742={'widths':_[_0x7838('0x15')](Array(_0x5aaa9a[_0x7838('0x16')]),0x91),'heights':function(_0x28ea8e){return _0x28ea8e===0x0?_0x7838('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3e9d53=getHeaders(_0x5aaa9a);_0x34a742[_0x7838('0x18')][_0x7838('0x19')](_0x3e9d53);var _0x2a900d=getRows(_0x5aaa9a,_0x1df38b);_0x34a742[_0x7838('0x18')]=_0x34a742['body']['concat'](_0x2a900d);return _0x34a742;}function createTables(_0x20e2e5){var _0x25df39=[];var _0x200ea0=_[_0x7838('0x1a')](Object[_0x7838('0x1b')](_0x20e2e5[0x0]),0x5);_0x200ea0['forEach'](function(_0x4bdff0){_0x25df39[_0x7838('0x19')](createTable(_0x4bdff0,_0x20e2e5));});return _0x25df39;}function getPDFDocDefinition(_0x96f65){var _0xde01e1=util[_0x7838('0x1c')](_0x7838('0x1d'),NAME,EXTRACTED_REPORT[_0x7838('0x1e')],moment(EXTRACTED_REPORT[_0x7838('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x7838('0x20')])[_0x7838('0x1c')](FORMAT));var _0x34e5c0=[];for(var _0x217baa=0x0;_0x217baa<_0x96f65['length'];_0x217baa++){var _0x31f8a8=[];if(_0x217baa===0x0){_0x31f8a8[_0x7838('0x19')]({'text':_0xde01e1,'style':'header'});}var _0x2bac3b={'table':_0x96f65[_0x217baa]};if(_0x217baa>0x0){_0x2bac3b[_0x7838('0x21')]=_0x7838('0x22');_0x2bac3b['margin']=[0x0,0x46,0x0,0x0];}_0x31f8a8[_0x7838('0x19')](_0x2bac3b);_0x34e5c0[_0x7838('0x19')](_0x31f8a8);}return{'pageSize':'A4','pageOrientation':_0x7838('0x23'),'content':_0x34e5c0,'footer':function(_0x5da5f1,_0x5c0268){return{'text':_0x5da5f1[_0x7838('0x13')]()+_0x7838('0x24')+_0x5c0268,'style':_0x7838('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7838('0x26')},'footer':{'alignment':_0x7838('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x14eebb){var _0x3448e1=0x1388;var _0x3489d1;if(!_0x14eebb[0x0][_0x7838('0x28')]){return analyticExtractedReport(_0x7838('0x29'));}return db[_0x7838('0x2a')][_0x7838('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7838('0x2c'),_0x7838('0x2d')]})[_0x7838('0x2e')](function(_0x835e99){if(_0x835e99){_0x3489d1=_0x835e99;_0x3448e1=_0x3489d1[_0x7838('0x2d')]||0x3e8;}})[_0x7838('0x2e')](function(){var _0x2bfd84=[];var _0x39094c=0x0;if(_0x3489d1[_0x7838('0x2c')]){if(_0x14eebb&&_0x14eebb[_0x7838('0x16')]){var _0x47db05=_[_0x7838('0x2f')](_0x14eebb[0x0]['num']/_0x3448e1);var _0x3b007a=Number[_0x7838('0x30')](_0x14eebb[0x0]['num']/_0x3448e1)?_0x14eebb[0x0][_0x7838('0x28')]%_0x3448e1:0x0;_0x47db05[_0x7838('0x31')](function(_0x485637){if(_0x485637>0x0){_0x39094c+=_0x3448e1;}_0x2bfd84['push'](dbH[_0x7838('0x32')]['query'](util[_0x7838('0x1c')](_0x7838('0x33'),QUERY,_0x3448e1,_0x39094c),{'type':dbH[_0x7838('0x32')][_0x7838('0x34')][_0x7838('0x35')]}));});if(_0x3b007a>0x0){_0x39094c+=_0x3448e1;_0x2bfd84[_0x7838('0x19')](dbH[_0x7838('0x32')]['query'](util[_0x7838('0x1c')](_0x7838('0x33'),QUERY,_0x3b007a,_0x39094c),{'type':dbH['sequelize'][_0x7838('0x34')][_0x7838('0x35')]}));}}}else{_0x2bfd84['push'](dbH[_0x7838('0x32')][_0x7838('0x36')](QUERY,{'type':dbH[_0x7838('0x32')][_0x7838('0x34')]['SELECT']}));}var _0x354bb0=path[_0x7838('0x37')](PATH);var _0x1c2704=path[_0x7838('0x38')](PATH,_0x7838('0x39'));var _0x34ed09=_0x3489d1[_0x7838('0x2c')]&&_0x2bfd84[_0x7838('0x16')]>0x1;var _0x59d4f5=[];if(!fs[_0x7838('0x3a')](path[_0x7838('0x3b')](_0x354bb0,_0x1c2704))&&_0x34ed09){fs[_0x7838('0x3c')](path[_0x7838('0x3b')](_0x354bb0,_0x1c2704));}return BPromise[_0x7838('0x3d')](_0x2bfd84,function(_0x1cada3){_0x59d4f5[_0x7838('0x19')](_0x1cada3);})[_0x7838('0x2e')](function(){var _0x561991=[];for(var _0x47a6ed=0x0;_0x47a6ed<_0x59d4f5[_0x7838('0x16')];_0x47a6ed+=0x1){var _0x2ea905=_0x59d4f5[_0x47a6ed];var _0x2e3dff=createTables(_[_0x7838('0x3e')](_0x2ea905));var _0x1a0fb3;var _0xc24601=getPDFDocDefinition(_0x2e3dff);var _0x4e7900=getPDFPrinter();var _0x1caa7f=_0x4e7900[_0x7838('0x3f')](_0xc24601);if(_0x34ed09){_0x1a0fb3=path['join'](_0x354bb0,_0x1c2704,util['format'](_0x7838('0x40'),_0x1c2704,_0x47a6ed,_0x7838('0x41')));}else{_0x1a0fb3=path[_0x7838('0x3b')](_0x354bb0,util[_0x7838('0x1c')](_0x7838('0x42'),_0x1c2704,_0x7838('0x41')));}_0x561991['push'](writePDFDocument(_0x1caa7f,_0x1a0fb3));}return Promise[_0x7838('0x43')](_0x561991);})[_0x7838('0x2e')](function(){if(_0x34ed09){return new Promise(function(_0xbfb97c){zipdir(path[_0x7838('0x3b')](_0x354bb0,_0x1c2704),{'saveTo':path[_0x7838('0x3b')](_0x354bb0,util[_0x7838('0x1c')](_0x7838('0x42'),_0x1c2704,'zip'))},function(){rimraf(path['join'](_0x354bb0,_0x1c2704),function(){});_0xbfb97c(_0x7838('0x44'));});});}})[_0x7838('0x2e')](function(){if(!_0x34ed09)return;rimraf(path[_0x7838('0x3b')](_0x354bb0,_0x1c2704),function(){});})[_0x7838('0x2e')](function(){logger['info'](util[_0x7838('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x7838('0x45')));return analyticExtractedReport('Completed',_0x34ed09?util['format'](_0x7838('0x42'),_0x1c2704,_0x34ed09?_0x7838('0x46'):_0x7838('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x7838('0x47')](util[_0x7838('0x1c')](_0x7838('0x48'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x7838('0x49')][_0x7838('0x4a')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x52c251){EXTRACTED_REPORT=_0x52c251;return dbH['sequelize'][_0x7838('0x36')](util['format'](_0x7838('0x4b'),QUERY),{'type':dbH[_0x7838('0x32')]['QueryTypes'][_0x7838('0x35')]});})[_0x7838('0x2e')](extractReport)[_0x7838('0x4c')](function(_0x22f343){logger[_0x7838('0x47')](util[_0x7838('0x1c')](_0x7838('0x4d'),EXTRACTED_REPORT_ID,_0x7838('0x45')),util[_0x7838('0x4e')](_0x22f343,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7838('0x4f'));})[_0x7838('0x50')](function(){process[_0x7838('0x51')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x317fb8=new PdfPrinter({'Arial':{'normal':__dirname+_0x7838('0x52'),'bold':__dirname+_0x7838('0x53'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x7838('0x54')}});return _0x317fb8;}function getPDFDocDefinitionFromHTML(_0x159a5d,_0x39b32b){var _0x195352=util['format']('%s\x20#%d',_0x39b32b['channel'],_0x39b32b['interactionId']);var _0x14e195=moment()[_0x7838('0x1c')](_0x7838('0x55'))[_0x7838('0x13')]();var _0x9ee602=htmlToPdfmake(_0x159a5d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x9ee602],'defaultStyle':{'font':_0x7838('0x56')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x7838('0x57'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x7838('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x7838('0x58'),'style':_0x7838('0x59')}];},'footer':function(_0x4f3a1a,_0x244913){return[{'text':util[_0x7838('0x1c')](_0x7838('0x5a'),_0x195352,_0x4f3a1a,_0x244913,_0x14e195),'style':'footer'}];}};}function writePDFDocument(_0x94afcf,_0x48d5c8){return new Promise(function(_0x2b820f,_0xeee34d){var _0x3b5aec=_0x94afcf[_0x7838('0x5b')](fs[_0x7838('0x5c')](_0x48d5c8));_0x3b5aec['on'](_0x7838('0x5d'),function(){_0x2b820f(_0x7838('0x5d'));});_0x3b5aec['on'](_0x7838('0x5e'),function(_0x7ccc19){_0xeee34d(_0x7ccc19);});_0x94afcf[_0x7838('0x5f')]();});}exports[_0x7838('0x60')]=function(_0x451092,_0x999f3){var _0x442d0b=getPDFPrinter();var _0x4fbb23=getPDFDocDefinitionFromHTML(_0x451092,_0x999f3);var _0x5e900a=_0x442d0b[_0x7838('0x3f')](_0x4fbb23);return writePDFDocument(_0x5e900a,_0x999f3[_0x7838('0x61')])[_0x7838('0x4c')](function(_0x50a3a1){throw _0x50a3a1;});};
\ No newline at end of file
index fddb463..0f86ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x336d=['existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx'];(function(_0x4df7de,_0x5da937){var _0x9c5e47=function(_0x2b66db){while(--_0x2b66db){_0x4df7de['push'](_0x4df7de['shift']());}};_0x9c5e47(++_0x5da937);}(_0x336d,0xae));var _0xd336=function(_0x22bd21,_0x1b17ac){_0x22bd21=_0x22bd21-0x0;var _0x279cd0=_0x336d[_0x22bd21];return _0x279cd0;};'use strict';var util=require('util');var path=require(_0xd336('0x0'));var _=require(_0xd336('0x1'));var fs=require('fs');var json2xls=require(_0xd336('0x2'));var BPromise=require(_0xd336('0x3'));var zipdir=require(_0xd336('0x4'));var rimraf=require(_0xd336('0x5'));var db=require(_0xd336('0x6'))['db'];var dbH=require(_0xd336('0x6'))[_0xd336('0x7')];var logger=require(_0xd336('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd336('0x9')][0x3];var PATH=process[_0xd336('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3cf826,_0x5debef){var _0x419f42={'status':_0x3cf826};var _0x223e93={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5debef){_0x419f42[_0xd336('0xa')]=_0x5debef;}return db[_0xd336('0xb')][_0xd336('0xc')](_0x419f42,_0x223e93);}function main(){var _0x294d96=0x1388;var _0x177f64;logger[_0xd336('0xd')](util[_0xd336('0xe')](_0xd336('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xd336('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd336('0x11'),_0xd336('0x12')]})[_0xd336('0x13')](function(_0x29aa4a){if(_0x29aa4a){_0x177f64=_0x29aa4a;_0x294d96=_0x177f64[_0xd336('0x12')]||0x1388;}})[_0xd336('0x13')](function(){return dbH[_0xd336('0x14')][_0xd336('0x15')](util[_0xd336('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd336('0x14')]['QueryTypes'][_0xd336('0x16')]});})[_0xd336('0x13')](function(_0x1b3cd8){if(!_0x1b3cd8[0x0][_0xd336('0x17')]){return analyticExtractedReport(_0xd336('0x18'));}var _0x96cab8=[];var _0x22e5a5=0x0;if(_0x177f64[_0xd336('0x11')]){if(_0x1b3cd8&&_0x1b3cd8[_0xd336('0x19')]){var _0x3a6e60=_[_0xd336('0x1a')](_0x1b3cd8[0x0][_0xd336('0x17')]/_0x294d96);var _0x3dfc7b=Number[_0xd336('0x1b')](_0x1b3cd8[0x0][_0xd336('0x17')]/_0x294d96)?_0x1b3cd8[0x0][_0xd336('0x17')]%_0x294d96:0x0;_0x3a6e60[_0xd336('0x1c')](function(_0x4a4945){if(_0x4a4945>0x0){_0x22e5a5+=_0x294d96;}_0x96cab8[_0xd336('0x1d')](dbH[_0xd336('0x14')][_0xd336('0x15')](util['format'](_0xd336('0x1e'),QUERY,_0x294d96,_0x22e5a5),{'type':dbH[_0xd336('0x14')]['QueryTypes'][_0xd336('0x16')]}));});if(_0x3dfc7b>0x0){_0x22e5a5+=_0x294d96;_0x96cab8[_0xd336('0x1d')](dbH['sequelize'][_0xd336('0x15')](util['format'](_0xd336('0x1e'),QUERY,_0x3dfc7b,_0x22e5a5),{'type':dbH[_0xd336('0x14')][_0xd336('0x1f')][_0xd336('0x16')]}));}}}else{_0x96cab8[_0xd336('0x1d')](dbH[_0xd336('0x14')]['query'](QUERY,{'type':dbH[_0xd336('0x14')][_0xd336('0x1f')][_0xd336('0x16')]}));}var _0xfa45e8=path[_0xd336('0x20')](PATH);var _0x2f16dd=path['basename'](PATH,_0xd336('0x21'));var _0x297fee=_0x177f64['split']&&_0x96cab8['length']>0x1;var _0x38ebd9=[];if(!fs[_0xd336('0x22')](path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd))&&_0x297fee){fs[_0xd336('0x24')](path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd));}return BPromise[_0xd336('0x25')](_0x96cab8,function(_0x2c11d6){_0x38ebd9[_0xd336('0x1d')](_0x2c11d6);})[_0xd336('0x13')](function(){for(var _0x449314=0x0;_0x449314<_0x38ebd9['length'];_0x449314+=0x1){var _0x4f183a;var _0x3fa6e6=_0x38ebd9[_0x449314];if(_0x297fee){_0x4f183a=path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd,util['format'](_0xd336('0x26'),_0x2f16dd,_0x449314,_0xd336('0x27')));}else{_0x4f183a=path['join'](_0xfa45e8,util[_0xd336('0xe')](_0xd336('0x28'),_0x2f16dd,_0xd336('0x27')));}fs[_0xd336('0x29')](_0x4f183a,json2xls(_0x3fa6e6),_0xd336('0x2a'));}})[_0xd336('0x13')](function(){if(_0x297fee){return new Promise(function(_0x18e96d){zipdir(path['join'](_0xfa45e8,_0x2f16dd),{'saveTo':path[_0xd336('0x23')](_0xfa45e8,util['format'](_0xd336('0x28'),_0x2f16dd,_0xd336('0x2b')))},function(_0x22a29d,_0x41550c){rimraf(path[_0xd336('0x23')](_0xfa45e8,_0x2f16dd),function(){});_0x18e96d(_0xd336('0x2c'));});});}})[_0xd336('0x13')](function(){logger[_0xd336('0xd')](util[_0xd336('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd336('0x2d')));return analyticExtractedReport(_0xd336('0x2e'),_0x297fee?util[_0xd336('0xe')](_0xd336('0x28'),_0x2f16dd,_0x297fee?_0xd336('0x2b'):_0xd336('0x27')):null);});})['catch'](function(_0x205230){logger[_0xd336('0xd')](util['format'](_0xd336('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xd336('0x30')](_0x205230,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd336('0x31'));})[_0xd336('0x32')](function(){process[_0xd336('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x3b31=['%s.%s','zip','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','inspect','Failed','util','path','bluebird','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','QueryTypes','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.xlsx','mkdirSync','join','each','%s%d.%s','xlsx','writeFileSync','binary'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x3b31,0x64));var _0x13b3=function(_0x3e24f0,_0x3cef55){_0x3e24f0=_0x3e24f0-0x0;var _0x49e6e1=_0x3b31[_0x3e24f0];return _0x49e6e1;};'use strict';var util=require(_0x13b3('0x0'));var path=require(_0x13b3('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x13b3('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x13b3('0x3'))['db'];var dbH=require(_0x13b3('0x3'))[_0x13b3('0x4')];var logger=require('../../config/logger')(_0x13b3('0x5'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x13b3('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x17432e,_0xa6f9e9){var _0xc4d449={'status':_0x17432e};var _0x4c8693={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa6f9e9){_0xc4d449[_0x13b3('0x7')]=_0xa6f9e9;}return db[_0x13b3('0x8')][_0x13b3('0x9')](_0xc4d449,_0x4c8693);}function main(){var _0x14b9a1=0x1388;var _0x9ebff8;logger['info'](util['format'](_0x13b3('0xa'),EXTRACTED_REPORT_ID,_0x13b3('0xb')));return db[_0x13b3('0xc')][_0x13b3('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x13b3('0xe'),_0x13b3('0xf')]})[_0x13b3('0x10')](function(_0x483906){if(_0x483906){_0x9ebff8=_0x483906;_0x14b9a1=_0x9ebff8[_0x13b3('0xf')]||0x1388;}})[_0x13b3('0x10')](function(){return dbH[_0x13b3('0x11')][_0x13b3('0x12')](util[_0x13b3('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x13b3('0x11')][_0x13b3('0x14')]['SELECT']});})[_0x13b3('0x10')](function(_0x2d40c2){if(!_0x2d40c2[0x0][_0x13b3('0x15')]){return analyticExtractedReport(_0x13b3('0x16'));}var _0x3dbe7a=[];var _0x3c4834=0x0;if(_0x9ebff8[_0x13b3('0xe')]){if(_0x2d40c2&&_0x2d40c2[_0x13b3('0x17')]){var _0xf3e4df=_[_0x13b3('0x18')](_0x2d40c2[0x0][_0x13b3('0x15')]/_0x14b9a1);var _0x29ab30=Number[_0x13b3('0x19')](_0x2d40c2[0x0]['num']/_0x14b9a1)?_0x2d40c2[0x0][_0x13b3('0x15')]%_0x14b9a1:0x0;_0xf3e4df[_0x13b3('0x1a')](function(_0x1ec120){if(_0x1ec120>0x0){_0x3c4834+=_0x14b9a1;}_0x3dbe7a[_0x13b3('0x1b')](dbH[_0x13b3('0x11')]['query'](util[_0x13b3('0x13')](_0x13b3('0x1c'),QUERY,_0x14b9a1,_0x3c4834),{'type':dbH[_0x13b3('0x11')][_0x13b3('0x14')]['SELECT']}));});if(_0x29ab30>0x0){_0x3c4834+=_0x14b9a1;_0x3dbe7a[_0x13b3('0x1b')](dbH[_0x13b3('0x11')][_0x13b3('0x12')](util[_0x13b3('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x29ab30,_0x3c4834),{'type':dbH[_0x13b3('0x11')][_0x13b3('0x14')]['SELECT']}));}}}else{_0x3dbe7a[_0x13b3('0x1b')](dbH[_0x13b3('0x11')][_0x13b3('0x12')](QUERY,{'type':dbH[_0x13b3('0x11')]['QueryTypes']['SELECT']}));}var _0x582505=path['dirname'](PATH);var _0x3246b4=path[_0x13b3('0x1d')](PATH,_0x13b3('0x1e'));var _0x28fdaf=_0x9ebff8[_0x13b3('0xe')]&&_0x3dbe7a[_0x13b3('0x17')]>0x1;var _0x253fea=[];if(!fs['existsSync'](path['join'](_0x582505,_0x3246b4))&&_0x28fdaf){fs[_0x13b3('0x1f')](path[_0x13b3('0x20')](_0x582505,_0x3246b4));}return BPromise[_0x13b3('0x21')](_0x3dbe7a,function(_0x3f38c5){_0x253fea[_0x13b3('0x1b')](_0x3f38c5);})['then'](function(){for(var _0x429dcf=0x0;_0x429dcf<_0x253fea[_0x13b3('0x17')];_0x429dcf+=0x1){var _0x47fa68;var _0x2ceb81=_0x253fea[_0x429dcf];if(_0x28fdaf){_0x47fa68=path[_0x13b3('0x20')](_0x582505,_0x3246b4,util[_0x13b3('0x13')](_0x13b3('0x22'),_0x3246b4,_0x429dcf,'xlsx'));}else{_0x47fa68=path[_0x13b3('0x20')](_0x582505,util[_0x13b3('0x13')]('%s.%s',_0x3246b4,_0x13b3('0x23')));}fs[_0x13b3('0x24')](_0x47fa68,json2xls(_0x2ceb81),_0x13b3('0x25'));}})[_0x13b3('0x10')](function(){if(_0x28fdaf){return new Promise(function(_0xa78083){zipdir(path['join'](_0x582505,_0x3246b4),{'saveTo':path[_0x13b3('0x20')](_0x582505,util[_0x13b3('0x13')](_0x13b3('0x26'),_0x3246b4,_0x13b3('0x27')))},function(_0x745ea9,_0x4b3185){rimraf(path['join'](_0x582505,_0x3246b4),function(){});_0xa78083('zip\x20finished');});});}})[_0x13b3('0x10')](function(){logger[_0x13b3('0x28')](util[_0x13b3('0x13')](_0x13b3('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x28fdaf?util[_0x13b3('0x13')](_0x13b3('0x26'),_0x3246b4,_0x28fdaf?'zip':_0x13b3('0x23')):null);});})[_0x13b3('0x2a')](function(_0x115f55){logger[_0x13b3('0x28')](util[_0x13b3('0x13')](_0x13b3('0x2b'),EXTRACTED_REPORT_ID,_0x13b3('0xb')),util[_0x13b3('0x2c')](_0x115f55,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x13b3('0x2d'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 5819b45..62c7fc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaae6=['type','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','CDR(destination)=','${EXTEN:','${EXTEN}','ExecIf','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','intervals','interval','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','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','rewrite','lodash','util','Interval','findAll','models','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xaae6,0x198));var _0x6aae=function(_0x4b8567,_0xce992){_0x4b8567=_0x4b8567-0x0;var _0x3ac2fb=_0xaae6[_0x4b8567];return _0x3ac2fb;};'use strict';var _=require(_0x6aae('0x0'));var util=require(_0x6aae('0x1'));function rewrite(_0x4ce0da,_0x43c322){var _0x316ae6=this;return _0x4ce0da['models'][_0x6aae('0x2')][_0x6aae('0x3')]({'raw':!![]})['then'](function(_0x2987eb){_0x316ae6['intervals']=_0x2987eb;return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x3')]({'where':{'IntervalId':_0x43c322[_0x6aae('0x6')]},'raw':!![]});})[_0x6aae('0x7')](function(_0x2ec4fa){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x3')]({'where':{'exten':{'$in':_[_0x6aae('0x8')](_[_0x6aae('0x9')](_0x2ec4fa,_0x6aae('0xa')))}},'order':[{'raw':_0x6aae('0xb')}],'raw':!![]});})[_0x6aae('0x7')](function(_0x4ca99a){var _0x2c1d71=_['filter'](_0x4ca99a,{'priority':'1'});var _0x17305c=_[_0x6aae('0xc')](_0x4ca99a,{'isApp':0x1});var _0x5c368b=_[_0x6aae('0xd')](_0x17305c,_0x6aae('0xa'));var _0x5921b9=[_0x6aae('0xe'),_0x6aae('0xf')];var _0x1a1de9=[];var _0x61a7eb=[];for(var _0x29f23c in _0x5c368b){if(_0x5c368b[_0x6aae('0x10')](_0x29f23c)){_0x316ae6[_0x6aae('0x11')]=0x2;_0x316ae6[_0x6aae('0x12')]=[];_0x316ae6[_0x6aae('0x13')]=_[_0x6aae('0x14')](_0x2c1d71,{'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')]});_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x16'),'appdata':util[_0x6aae('0x17')]('CDR(type)=%s',_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]===_0x6aae('0x1a')){_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x1b')+_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}else if(_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')]===_0x6aae('0x1d')){if(_0x316ae6[_0x6aae('0x13')]){_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':'Set','appdata':_0x6aae('0x1e')+(_0x316ae6[_0x6aae('0x13')]['cutdigits']?_0x6aae('0x1f')+_0x316ae6[_0x6aae('0x13')]['cutdigits']+'}':_0x6aae('0x20')),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});}_0x316ae6[_0x6aae('0x12')]['push']({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x1b')+_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')],'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});var _0x331112=_0x316ae6[_0x6aae('0x11')]++;_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x331112+0x2)+'):Goto('+(_0x331112+0x1)+')','context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x331112,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x316ae6['extension']){_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':'Set','appdata':_0x316ae6['extension'][_0x6aae('0x22')]?_0x6aae('0x23')+_0x316ae6[_0x6aae('0x13')][_0x6aae('0x22')]+'}':_0x6aae('0x24'),'context':_0x5c368b[_0x29f23c][0x0]['context'],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}_0x316ae6[_0x6aae('0x12')]['push']({'type':_0x5c368b[_0x29f23c][0x0]['type'],'app':_0x6aae('0x16'),'appdata':'outboundrouteid='+_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId'],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});if(_0x316ae6[_0x6aae('0x13')]&&_0x316ae6[_0x6aae('0x13')][_0x6aae('0x10')](_0x6aae('0x25'))&&_0x316ae6['extension']['recordingFormat']!=='none'){_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x26'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':'Set','appdata':_0x6aae('0x27')+_0x316ae6[_0x6aae('0x13')]['recordingFormat']||_0x6aae('0x28'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}}_0x316ae6['extensions'][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x29'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x2a'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6['priority']++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0]['VoiceExtensionId']});_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x2b'),'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'exten':_0x5c368b[_0x29f23c][0x0][_0x6aae('0xa')],'priority':_0x316ae6[_0x6aae('0x11')]++,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});for(var _0x53b1c4=0x0,_0x487dfa=0x0;_0x53b1c4<_0x5c368b[_0x29f23c][_0x6aae('0x2c')];_0x53b1c4+=0x1,_0x487dfa=0x0){var _0x1da782=_0x5c368b[_0x29f23c][_0x53b1c4];if(_0x1da782[_0x6aae('0x18')]){_0x1da782['type']=_0x1da782['type'][_0x6aae('0x2d')]();}var _0x3a4533=[];var _0x4cc60a=[];delete _0x1da782['id'];delete _0x1da782[_0x6aae('0x2e')];delete _0x1da782[_0x6aae('0x2f')];var _0x27487a=_0x1da782['interval']!==_0x6aae('0x30')?[_0x1da782['interval']]:_0x1da782[_0x6aae('0x6')]?_['map'](_[_0x6aae('0xc')](_0x316ae6[_0x6aae('0x31')],{'IntervalId':_0x1da782['IntervalId']}),_0x6aae('0x32')):[];if(_0x1da782[_0x6aae('0x10')](_0x6aae('0x33'))){if(_0x1da782[_0x6aae('0x33')]&&_0x1da782[_0x6aae('0x33')]!=='--'){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x34')+_0x1da782['tag'],'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}if(_0x1da782['type']==='outbound'&&_0x1da782[_0x6aae('0x10')](_0x6aae('0x35'))){if(_0x1da782[_0x6aae('0x35')]){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x36')+_0x1da782['callerID']+')','context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782['exten'],'priority':_0x27487a['length']+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782['VoiceExtensionId']});}else{_0x3a4533['push']({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x37'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}if(_0x1da782[_0x6aae('0x10')](_0x6aae('0x38'))){if(_0x5921b9[_0x6aae('0x39')](_0x1da782[_0x6aae('0x3a')][_0x6aae('0x2d')]())>=0x0&&_0x1da782[_0x6aae('0x3b')]!==_0x6aae('0x3c')){if(_0x1da782['answer']){_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782['type'],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x3d'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a['length']+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782['exten'],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6['priority']+_0x487dfa++,'VoiceExtensionId':_0x1da782['VoiceExtensionId']});}else{_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x21'),'appdata':_0x6aae('0x3e'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});_0x3a4533[_0x6aae('0x15')]({'type':_0x1da782[_0x6aae('0x18')],'app':_0x6aae('0x16'),'appdata':_0x6aae('0x3f'),'context':_0x1da782[_0x6aae('0x1c')],'exten':_0x1da782[_0x6aae('0xa')],'priority':_0x27487a[_0x6aae('0x2c')]+_0x316ae6[_0x6aae('0x11')]+_0x487dfa++,'VoiceExtensionId':_0x1da782[_0x6aae('0x19')]});}}}for(var _0x4be7bb=0x0;_0x4be7bb<_0x27487a['length'];_0x4be7bb+=0x1){var _0x31c5c0=_0x316ae6[_0x6aae('0x11')]+_0x27487a[_0x6aae('0x2c')];var _0x2a3b51=_0x4be7bb===_0x27487a[_0x6aae('0x2c')]-0x1?_0x316ae6[_0x6aae('0x11')]+_0x3a4533['length']+_0x4cc60a[_0x6aae('0x2c')]+0x2:_0x316ae6[_0x6aae('0x11')]+_0x4be7bb+0x1;_0x3a4533['splice'](_0x4be7bb,0x0,{'type':_0x1da782[_0x6aae('0x18')],'app':'GotoIfTime','appdata':_0x27487a[_0x4be7bb]+'?'+_0x1da782[_0x6aae('0x1c')]+_0x6aae('0x40')+_0x31c5c0+':'+_0x1da782['context']+_0x6aae('0x40')+_0x2a3b51,'exten':_0x1da782[_0x6aae('0xa')],'context':_0x1da782[_0x6aae('0x1c')],'priority':_0x316ae6[_0x6aae('0x11')]+_0x4be7bb,'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});}_0x1da782['priority']=_0x3a4533[_0x6aae('0x2c')]?_['last'](_0x3a4533)[_0x6aae('0x11')]+0x1:_0x316ae6[_0x6aae('0x11')];_0x316ae6['priority']=(_0x4cc60a[_0x6aae('0x2c')]?_[_0x6aae('0x41')](_0x4cc60a)[_0x6aae('0x11')]:_0x1da782['priority'])+0x1;_0x316ae6['extensions']=_[_0x6aae('0x42')](_0x316ae6['extensions'],_0x3a4533,[_0x1da782],_0x4cc60a);}_0x316ae6[_0x6aae('0x12')][_0x6aae('0x15')]({'type':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x18')],'app':_0x6aae('0x43'),'exten':_0x5c368b[_0x29f23c][0x0]['exten'],'context':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x1c')],'priority':_0x316ae6[_0x6aae('0x11')],'VoiceExtensionId':_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]});_0x1a1de9['push'](_0x5c368b[_0x29f23c][0x0][_0x6aae('0x19')]);_0x61a7eb=_['concat'](_0x61a7eb,_0x316ae6[_0x6aae('0x12')]);}}return _0x4ce0da[_0x6aae('0x44')](function(_0x12cc45){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')][_0x6aae('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x1a1de9}},'transaction':_0x12cc45})[_0x6aae('0x7')](function(_0x3232cc){return _0x4ce0da[_0x6aae('0x4')][_0x6aae('0x5')]['bulkCreate'](_['sortBy'](_0x61a7eb,_0x6aae('0x11')),{'transaction':_0x12cc45});});});})[_0x6aae('0x46')](function(_0x543f63){console['error'](_0x543f63);});}exports[_0x6aae('0x47')]=rewrite;
\ No newline at end of file
+var _0xd75e=['callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','length','answer','indexOf','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','filter','groupBy','queue','playback','priority','extensions','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag'];(function(_0x54d2a2,_0x446a81){var _0x5ead44=function(_0x4d301c){while(--_0x4d301c){_0x54d2a2['push'](_0x54d2a2['shift']());}};_0x5ead44(++_0x446a81);}(_0xd75e,0x1b9));var _0xed75=function(_0x534de8,_0x3fa360){_0x534de8=_0x534de8-0x0;var _0x17bc0a=_0xd75e[_0x534de8];return _0x17bc0a;};'use strict';var _=require(_0xed75('0x0'));var util=require(_0xed75('0x1'));function rewrite(_0x3d3385,_0x14727a){var _0x19e564=this;return _0x3d3385[_0xed75('0x2')]['Interval'][_0xed75('0x3')]({'raw':!![]})[_0xed75('0x4')](function(_0x3bd7da){_0x19e564[_0xed75('0x5')]=_0x3bd7da;return _0x3d3385[_0xed75('0x2')][_0xed75('0x6')][_0xed75('0x3')]({'where':{'IntervalId':_0x14727a[_0xed75('0x7')]},'raw':!![]});})[_0xed75('0x4')](function(_0x54fd4e){return _0x3d3385[_0xed75('0x2')][_0xed75('0x6')][_0xed75('0x3')]({'where':{'exten':{'$in':_[_0xed75('0x8')](_['map'](_0x54fd4e,_0xed75('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xed75('0x4')](function(_0x36209d){var _0x148055=_[_0xed75('0xa')](_0x36209d,{'priority':'1'});var _0x3d978b=_['filter'](_0x36209d,{'isApp':0x1});var _0x42fd95=_[_0xed75('0xb')](_0x3d978b,'exten');var _0x313386=[_0xed75('0xc'),_0xed75('0xd')];var _0x4d64d7=[];var _0xe328c5=[];for(var _0x290468 in _0x42fd95){if(_0x42fd95['hasOwnProperty'](_0x290468)){_0x19e564[_0xed75('0xe')]=0x2;_0x19e564[_0xed75('0xf')]=[];_0x19e564['extension']=_[_0xed75('0x10')](_0x148055,{'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')]});_0x19e564[_0xed75('0xf')][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':util[_0xed75('0x14')](_0xed75('0x15'),_0x42fd95[_0x290468][0x0][_0xed75('0x12')]),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564['priority']++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});if(_0x42fd95[_0x290468][0x0]['type']===_0xed75('0x18')){_0x19e564[_0xed75('0xf')][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x19')+_0x42fd95[_0x290468][0x0][_0xed75('0x17')],'context':_0x42fd95[_0x290468][0x0]['context'],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});}else if(_0x42fd95[_0x290468][0x0][_0xed75('0x12')]===_0xed75('0x1a')){if(_0x19e564[_0xed75('0x1b')]){_0x19e564[_0xed75('0xf')][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x1c')+(_0x19e564[_0xed75('0x1b')][_0xed75('0x1d')]?_0xed75('0x1e')+_0x19e564[_0xed75('0x1b')][_0xed75('0x1d')]+'}':'${EXTEN}'),'context':_0x42fd95[_0x290468][0x0]['context'],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0]['VoiceExtensionId']});}_0x19e564[_0xed75('0xf')]['push']({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':'CDR(routeid)='+_0x42fd95[_0x290468][0x0]['VoiceExtensionId'],'context':_0x42fd95[_0x290468][0x0]['context'],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0]['VoiceExtensionId']});var _0x17c86b=_0x19e564[_0xed75('0xe')]++;_0x19e564[_0xed75('0xf')]['push']({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x17c86b+0x2)+_0xed75('0x20')+(_0x17c86b+0x1)+')','context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x17c86b,'VoiceExtensionId':_0x42fd95[_0x290468][0x0]['VoiceExtensionId']});if(_0x19e564[_0xed75('0x1b')]){_0x19e564[_0xed75('0xf')]['push']({'type':_0x42fd95[_0x290468][0x0]['type'],'app':_0xed75('0x13'),'appdata':_0x19e564[_0xed75('0x1b')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x19e564[_0xed75('0x1b')]['cutdigits']+'}':_0xed75('0x21'),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});}_0x19e564[_0xed75('0xf')]['push']({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x22')+_0x42fd95[_0x290468][0x0][_0xed75('0x17')],'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});if(_0x19e564[_0xed75('0x1b')]&&_0x19e564[_0xed75('0x1b')][_0xed75('0x23')]('recordingFormat')&&_0x19e564[_0xed75('0x1b')][_0xed75('0x24')]!==_0xed75('0x25')){_0x19e564['extensions'][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0]['VoiceExtensionId']});_0x19e564['extensions'][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0]['type'],'app':_0xed75('0x13'),'appdata':_0xed75('0x26')+_0x19e564[_0xed75('0x1b')]['recordingFormat']||_0xed75('0x27'),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564['priority']++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0]['VoiceExtensionId']});}}_0x19e564['extensions'][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0]['type'],'app':'Set','appdata':_0xed75('0x28'),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});_0x19e564['extensions'][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x29'),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});_0x19e564['extensions'][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0][_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x2a'),'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'exten':_0x42fd95[_0x290468][0x0]['exten'],'priority':_0x19e564[_0xed75('0xe')]++,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});for(var _0x295462=0x0,_0x2c0f88=0x0;_0x295462<_0x42fd95[_0x290468]['length'];_0x295462+=0x1,_0x2c0f88=0x0){var _0x526c07=_0x42fd95[_0x290468][_0x295462];if(_0x526c07['type']){_0x526c07[_0xed75('0x12')]=_0x526c07[_0xed75('0x12')][_0xed75('0x2b')]();}var _0x451f76=[];var _0x324085=[];delete _0x526c07['id'];delete _0x526c07[_0xed75('0x2c')];delete _0x526c07[_0xed75('0x2d')];var _0x56781e=_0x526c07[_0xed75('0x2e')]!==_0xed75('0x2f')?[_0x526c07[_0xed75('0x2e')]]:_0x526c07['IntervalId']?_['map'](_[_0xed75('0xa')](_0x19e564['intervals'],{'IntervalId':_0x526c07[_0xed75('0x7')]}),_0xed75('0x2e')):[];if(_0x526c07[_0xed75('0x23')]('tag')){if(_0x526c07[_0xed75('0x30')]&&_0x526c07[_0xed75('0x30')]!=='--'){_0x451f76[_0xed75('0x11')]({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':'CDR(tag)='+_0x526c07['tag'],'context':_0x526c07['context'],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e['length']+_0x19e564[_0xed75('0xe')]+_0x2c0f88++,'VoiceExtensionId':_0x526c07['VoiceExtensionId']});}}if(_0x526c07[_0xed75('0x12')]===_0xed75('0x1a')&&_0x526c07[_0xed75('0x23')](_0xed75('0x31'))){if(_0x526c07[_0xed75('0x31')]){_0x451f76[_0xed75('0x11')]({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x526c07[_0xed75('0x31')]+')','context':_0x526c07['context'],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e['length']+_0x19e564[_0xed75('0xe')]+_0x2c0f88++,'VoiceExtensionId':_0x526c07[_0xed75('0x17')]});}else{_0x451f76[_0xed75('0x11')]({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x1f'),'appdata':_0xed75('0x32'),'context':_0x526c07[_0xed75('0x16')],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e[_0xed75('0x33')]+_0x19e564[_0xed75('0xe')]+_0x2c0f88++,'VoiceExtensionId':_0x526c07['VoiceExtensionId']});}}if(_0x526c07[_0xed75('0x23')](_0xed75('0x34'))){if(_0x313386[_0xed75('0x35')](_0x526c07['app'][_0xed75('0x2b')]())>=0x0&&_0x526c07[_0xed75('0x36')]!==_0xed75('0x37')){if(_0x526c07[_0xed75('0x34')]){_0x451f76[_0xed75('0x11')]({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x1f'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x526c07[_0xed75('0x16')],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e[_0xed75('0x33')]+_0x19e564['priority']+_0x2c0f88++,'VoiceExtensionId':_0x526c07['VoiceExtensionId']});_0x451f76['push']({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x38'),'context':_0x526c07['context'],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e[_0xed75('0x33')]+_0x19e564[_0xed75('0xe')]+_0x2c0f88++,'VoiceExtensionId':_0x526c07[_0xed75('0x17')]});}else{_0x451f76[_0xed75('0x11')]({'type':_0x526c07['type'],'app':_0xed75('0x1f'),'appdata':_0xed75('0x39'),'context':_0x526c07['context'],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e[_0xed75('0x33')]+_0x19e564['priority']+_0x2c0f88++,'VoiceExtensionId':_0x526c07[_0xed75('0x17')]});_0x451f76[_0xed75('0x11')]({'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x13'),'appdata':_0xed75('0x3a'),'context':_0x526c07[_0xed75('0x16')],'exten':_0x526c07[_0xed75('0x9')],'priority':_0x56781e[_0xed75('0x33')]+_0x19e564['priority']+_0x2c0f88++,'VoiceExtensionId':_0x526c07[_0xed75('0x17')]});}}}for(var _0x21bb7a=0x0;_0x21bb7a<_0x56781e['length'];_0x21bb7a+=0x1){var _0x33d0d8=_0x19e564[_0xed75('0xe')]+_0x56781e[_0xed75('0x33')];var _0x348634=_0x21bb7a===_0x56781e[_0xed75('0x33')]-0x1?_0x19e564['priority']+_0x451f76[_0xed75('0x33')]+_0x324085[_0xed75('0x33')]+0x2:_0x19e564[_0xed75('0xe')]+_0x21bb7a+0x1;_0x451f76[_0xed75('0x3b')](_0x21bb7a,0x0,{'type':_0x526c07[_0xed75('0x12')],'app':_0xed75('0x3c'),'appdata':_0x56781e[_0x21bb7a]+'?'+_0x526c07[_0xed75('0x16')]+_0xed75('0x3d')+_0x33d0d8+':'+_0x526c07['context']+_0xed75('0x3d')+_0x348634,'exten':_0x526c07['exten'],'context':_0x526c07[_0xed75('0x16')],'priority':_0x19e564[_0xed75('0xe')]+_0x21bb7a,'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});}_0x526c07[_0xed75('0xe')]=_0x451f76[_0xed75('0x33')]?_['last'](_0x451f76)['priority']+0x1:_0x19e564[_0xed75('0xe')];_0x19e564[_0xed75('0xe')]=(_0x324085['length']?_[_0xed75('0x3e')](_0x324085)['priority']:_0x526c07[_0xed75('0xe')])+0x1;_0x19e564[_0xed75('0xf')]=_['concat'](_0x19e564[_0xed75('0xf')],_0x451f76,[_0x526c07],_0x324085);}_0x19e564[_0xed75('0xf')][_0xed75('0x11')]({'type':_0x42fd95[_0x290468][0x0]['type'],'app':_0xed75('0x3f'),'exten':_0x42fd95[_0x290468][0x0][_0xed75('0x9')],'context':_0x42fd95[_0x290468][0x0][_0xed75('0x16')],'priority':_0x19e564[_0xed75('0xe')],'VoiceExtensionId':_0x42fd95[_0x290468][0x0][_0xed75('0x17')]});_0x4d64d7[_0xed75('0x11')](_0x42fd95[_0x290468][0x0][_0xed75('0x17')]);_0xe328c5=_['concat'](_0xe328c5,_0x19e564['extensions']);}}return _0x3d3385[_0xed75('0x40')](function(_0x27b2ed){return _0x3d3385[_0xed75('0x2')][_0xed75('0x6')][_0xed75('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x4d64d7}},'transaction':_0x27b2ed})['then'](function(_0x369963){return _0x3d3385[_0xed75('0x2')][_0xed75('0x6')][_0xed75('0x42')](_[_0xed75('0x43')](_0xe328c5,_0xed75('0xe')),{'transaction':_0x27b2ed});});});})[_0xed75('0x44')](function(_0x28e1c9){console[_0xed75('0x45')](_0x28e1c9);});}exports['rewrite']=rewrite;
\ No newline at end of file
index 7305e56..0694921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d7b=['dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','all','BlackLists','get','Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','phone','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','NOW()','createdAt','updatedAt','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','toString','insert','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists'];(function(_0x4ebb5d,_0x1e92b6){var _0x5abafd=function(_0x2e1f57){while(--_0x2e1f57){_0x4ebb5d['push'](_0x4ebb5d['shift']());}};_0x5abafd(++_0x1e92b6);}(_0x9d7b,0x86));var _0xb9d7=function(_0x3151e3,_0x500d5f){_0x3151e3=_0x3151e3-0x0;var _0x1c4d5e=_0x9d7b[_0x3151e3];return _0x1c4d5e;};'use strict';var BPromise=require('bluebird');var util=require(_0xb9d7('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0xb9d7('0x1'));var Papa=require(_0xb9d7('0x2'));var Redis=require(_0xb9d7('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xb9d7('0x4'));var logger=require(_0xb9d7('0x5'))('api');config[_0xb9d7('0x6')]=_[_0xb9d7('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb9d7('0x8'))(new Redis(config['redis']));require(_0xb9d7('0x9'))[_0xb9d7('0xa')](socket);try{if(!process[_0xb9d7('0xb')][0x2]||process[_0xb9d7('0xb')][0x2]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x2]===_0xb9d7('0xd')){throw new Error(_0xb9d7('0xe'));}var FILEPATH=process[_0xb9d7('0xb')][0x2];if(!process[_0xb9d7('0xb')][0x3]||process['argv'][0x3]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x3]===_0xb9d7('0xd')||!process[_0xb9d7('0xb')][0x4]||process[_0xb9d7('0xb')][0x4]==='undefined'||process[_0xb9d7('0xb')][0x4]===_0xb9d7('0xd')){throw new Error(_0xb9d7('0xf'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xb9d7('0x10')](','),process[_0xb9d7('0xb')][0x4]['split'](','));if(!process[_0xb9d7('0xb')][0x5]||process[_0xb9d7('0xb')][0x5]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x5]===_0xb9d7('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xb9d7('0xb')][0x6]!==_0xb9d7('0xc')&&process['argv'][0x6]!==_0xb9d7('0xd')?process[_0xb9d7('0xb')][0x6]:null;var DUPLICATES=process[_0xb9d7('0xb')][0x7]&&process[_0xb9d7('0xb')][0x7]!==_0xb9d7('0xc')&&process[_0xb9d7('0xb')][0x7]!==_0xb9d7('0xd')?process[_0xb9d7('0xb')][0x7]:null;if(!process[_0xb9d7('0xb')][0x8]||process[_0xb9d7('0xb')][0x8]===_0xb9d7('0xc')||process[_0xb9d7('0xb')][0x8]===_0xb9d7('0xd')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xb9d7('0xb')][0x8];}catch(_0x94da30){logger['error'](_0x94da30);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(_0xe45a0b,_0x4e3fb5,_0x1927ef,_0x557387){var _0x4c375b={'message':_0x4e3fb5};_0x4c375b[_0xe45a0b]=!![];if(_0x1927ef){_0x4c375b[_0xb9d7('0x11')]=_0x1927ef;}if(_0x557387){_0x4c375b[_0xb9d7('0x12')]=_0x557387;}return _0x4c375b;}function isEmail(_0x5c155a){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))*$/[_0xb9d7('0x13')](_0x5c155a);}function checkRow(_0x1074a0,_0x3963ef,_0x38ec22){return new BPromise(function(_0x4705ee,_0x42db45){if(_['isNil'](_0x1074a0)){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),_0xb9d7('0x15'),null,_0x38ec22));}if(_0x1074a0['errors']&&_0x1074a0[_0xb9d7('0x16')][_0xb9d7('0x17')]){var _0x566dc2=_[_0xb9d7('0x18')](_0x1074a0[_0xb9d7('0x16')],_0xb9d7('0x19'))['join'](';');return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),_0x566dc2,null,_0x38ec22));}var _0x2a4ae9={};for(var _0x4a7036 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4a7036)&&FIELDS[_0x4a7036]){_0x2a4ae9[_0x4a7036]=_0x1074a0[_0xb9d7('0x1a')][0x0][FIELDS[_0x4a7036]]||_0x1074a0[_0xb9d7('0x1a')][0x0]['\ufeff'+FIELDS[_0x4a7036]];}}if(!_0x2a4ae9[_0xb9d7('0x1b')]){return _0x42db45(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x38ec22));}if(!_0x2a4ae9[_0xb9d7('0x1c')]){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),'phone\x20not\x20specified!',null,_0x38ec22));}if(_0x2a4ae9[_0xb9d7('0x1d')]){var _0x291876=moment(_0x2a4ae9['birthDate'],_0xb9d7('0x1e'));if(!_0x291876[_0xb9d7('0x1f')]()){return _0x42db45(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x38ec22));}}if(_0x2a4ae9[_0xb9d7('0x20')]){if(!isEmail(_0x2a4ae9[_0xb9d7('0x20')])){return _0x42db45(handleCheckRowError('error',_0xb9d7('0x21'),null,_0x38ec22));}}_0x2a4ae9[_0xb9d7('0x22')]=LISTID;_0x2a4ae9[_0xb9d7('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb9d7('0x17')]&&_0x3963ef){var _0x294b89={};for(var _0x1019a2=0x0,_0x4884c4=DUPLICATES[_0xb9d7('0x17')];_0x1019a2<_0x4884c4;_0x1019a2+=0x1){_0x294b89[DUPLICATES[_0x1019a2]]=_0x2a4ae9[DUPLICATES[_0x1019a2]];}var _0x6aca37=_[_0xb9d7('0x24')](_0x3963ef,_0x294b89);if(_0x6aca37){return _0x42db45(handleCheckRowError(_0xb9d7('0x25'),_0xb9d7('0x26'),_0x6aca37,_0x38ec22));}}return db['CmContact']['create'](_0x2a4ae9,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2a4ae9)})[_0xb9d7('0x27')](function(_0x5b8bad){if(DUPLICATES&&DUPLICATES[_0xb9d7('0x17')]&&_0x3963ef){_0x3963ef[_0xb9d7('0x28')](_[_0xb9d7('0x29')](_0x2a4ae9,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5b8bad['id'];return _0x4705ee();})[_0xb9d7('0x2a')](function(_0x50e860){return _0x42db45(handleCheckRowError(_0xb9d7('0x14'),'Error\x20while\x20creating\x20contact:\x20'+(_0x50e860[_0xb9d7('0x19')]||JSON[_0xb9d7('0x2b')](_0x50e860)),null,_0x38ec22));});});}function checkHopper(){function _0x463af9(){return function(_0x3b84c4){logger['error'](_0xb9d7('0x2c'),_0xb9d7('0x2d'),util[_0xb9d7('0x2e')](_0x3b84c4,{'showHidden':![],'depth':null}));};}var _0x271e1e=function(_0x3d6126,_0x17427b){var _0x53a794=squel['insert']()['into'](_0xb9d7('0x2f'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x31'),_0xb9d7('0x32'),'ListId',_0x17427b,'createdAt','updatedAt'],squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'),_0xb9d7('0x1c'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))['field'](LISTID['toString'](),_0xb9d7('0x22'))['field'](_0x3d6126['id']['toString'](),_0x17427b)['field'](_0xb9d7('0x35'),_0xb9d7('0x36'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xb9d7('0x3b'),LISTID['toString']())[_0xb9d7('0x3a')](_0xb9d7('0x3c'))[_0xb9d7('0x3a')](_0xb9d7('0x3d'),squel[_0xb9d7('0x33')]()['field']('phone')[_0xb9d7('0x38')]('cm_hopper')[_0xb9d7('0x3a')](_0x17427b+_0xb9d7('0x3e'),_0x3d6126['id'][_0xb9d7('0x3f')]())))['toString']();return _0x53a794;};var _0x198132=function(_0x199243,_0x446e8f){var _0x5e190e=squel[_0xb9d7('0x40')]()[_0xb9d7('0x41')](_0xb9d7('0x2f'))[_0xb9d7('0x30')](['phone',_0xb9d7('0x31'),_0xb9d7('0x32'),_0xb9d7('0x22'),_0x446e8f,'createdAt',_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()['field']('phone',_0xb9d7('0x1c'))[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))[_0xb9d7('0x34')](LISTID[_0xb9d7('0x3f')](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x199243['id'][_0xb9d7('0x3f')](),_0x446e8f)[_0xb9d7('0x34')](_0xb9d7('0x35'),'createdAt')[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')](_0xb9d7('0x42'))[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel[_0xb9d7('0x44')](hopperContacts))['where'](_0xb9d7('0x3c'))['where'](_0xb9d7('0x3d'),squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')]('calleridnum')[_0xb9d7('0x38')](_0xb9d7('0x45'))['where'](_0x446e8f+_0xb9d7('0x3e'),_0x199243['id'][_0xb9d7('0x3f')]()))[_0xb9d7('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'))[_0xb9d7('0x38')](_0xb9d7('0x2f'))[_0xb9d7('0x3a')](_0x446e8f+'\x20=\x20?',_0x199243['id'][_0xb9d7('0x3f')]())))[_0xb9d7('0x3f')]();return _0x5e190e;};function _0xa4f3fd(_0x10cce3,_0x13839e){var _0x45e868=squel[_0xb9d7('0x40')]()['into'](_0xb9d7('0x2f'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x31'),_0xb9d7('0x32'),'ListId',_0x13839e,'createdAt',_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()[_0xb9d7('0x34')](_0xb9d7('0x1c'),'phone')[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x31'))[_0xb9d7('0x34')]('id',_0xb9d7('0x32'))['field'](LISTID['toString'](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x10cce3['id'][_0xb9d7('0x3f')](),_0x13839e)['field'](_0xb9d7('0x35'),_0xb9d7('0x36'))[_0xb9d7('0x34')](_0xb9d7('0x35'),_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')](_0xb9d7('0x42'))[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel[_0xb9d7('0x44')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x45e868;}function _0x440dd4(_0x24ea19,_0x37bc18){var _0x4b5008=squel[_0xb9d7('0x40')]()['into'](_0xb9d7('0x46'))[_0xb9d7('0x30')]([_0xb9d7('0x1c'),_0xb9d7('0x32'),_0xb9d7('0x22'),_0x37bc18,_0xb9d7('0x36'),_0xb9d7('0x37')],squel[_0xb9d7('0x33')]()['field']('phone','phone')[_0xb9d7('0x34')]('id','ContactId')[_0xb9d7('0x34')](LISTID['toString'](),_0xb9d7('0x22'))[_0xb9d7('0x34')](_0x24ea19['id']['toString'](),_0x37bc18)[_0xb9d7('0x34')]('NOW()','createdAt')[_0xb9d7('0x34')]('NOW()',_0xb9d7('0x37'))[_0xb9d7('0x38')](_0xb9d7('0x39'))[_0xb9d7('0x3a')]('deletedAt\x20IS\x20NULL')[_0xb9d7('0x3a')](_0xb9d7('0x3b'),LISTID[_0xb9d7('0x3f')]())['where'](_0xb9d7('0x43'),squel['str'](hopperContacts))['where'](_0xb9d7('0x3c')))[_0xb9d7('0x3f')]();return _0x4b5008;}return db[_0xb9d7('0x47')][_0xb9d7('0x48')]({'where':{'type':_0xb9d7('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xb9d7('0x4a')],'as':_0xb9d7('0x4b'),'where':{'id':LISTID}}]})['then'](function(_0x2632bb){var _0xe2b9c0=[];if(_0x2632bb){var _0x53fe76;for(var _0x239ed5=0x0,_0x10a3ed;_0x239ed5<_0x2632bb[_0xb9d7('0x17')];_0x239ed5+=0x1){_0x10a3ed=_0x2632bb[_0x239ed5]['get']({'plain':!![]});switch(_0x10a3ed[_0xb9d7('0x4c')]){case _0xb9d7('0x4d'):_0xe2b9c0[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x198132(_0x10a3ed,_0xb9d7('0x50')))['then'](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;case'onlyIfOpen':_0xe2b9c0[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x271e1e(_0x10a3ed,_0xb9d7('0x50')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;default:_0xe2b9c0['push'](db[_0xb9d7('0x4e')]['query'](_0xa4f3fd(_0x10a3ed,'VoiceQueueId'))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}}return _0xe2b9c0;})[_0xb9d7('0x51')]()[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x47')]['findAll']({'where':{'type':_0xb9d7('0x49')},'attributes':['id'],'include':[{'model':db[_0xb9d7('0x4a')],'as':_0xb9d7('0x52'),'where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x59f76c){var _0x2108c7=[];if(_0x59f76c){var _0x172db0;for(var _0x116ed5=0x0,_0x391226;_0x116ed5<_0x59f76c[_0xb9d7('0x17')];_0x116ed5+=0x1){_0x391226=_0x59f76c[_0x116ed5][_0xb9d7('0x53')]({'plain':!![]});_0x2108c7[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x440dd4(_0x391226,_0xb9d7('0x50')))[_0xb9d7('0x27')](function(){})['catch'](_0x463af9()));}}return _0x2108c7;})[_0xb9d7('0x51')]();})[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x54')][_0xb9d7('0x48')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x536232){var _0x45384e=[];if(_0x536232){for(var _0x22601d=0x0,_0x6d046d;_0x22601d<_0x536232['length'];_0x22601d+=0x1){_0x6d046d=_0x536232[_0x22601d][_0xb9d7('0x53')]({'plain':!![]});switch(_0x6d046d[_0xb9d7('0x4c')]){case _0xb9d7('0x4d'):_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')]['query'](_0x198132(_0x6d046d,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})['catch'](_0x463af9()));break;case _0xb9d7('0x56'):_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0x271e1e(_0x6d046d,_0xb9d7('0x55')))['then'](function(){})[_0xb9d7('0x2a')](_0x463af9()));break;default:_0x45384e[_0xb9d7('0x28')](db[_0xb9d7('0x4e')][_0xb9d7('0x4f')](_0xa4f3fd(_0x6d046d,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}}return _0x45384e;})['all']();})[_0xb9d7('0x27')](function(){return db[_0xb9d7('0x54')][_0xb9d7('0x48')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb9d7('0x52'),'where':{'id':LISTID}}]})[_0xb9d7('0x27')](function(_0x3fc2b7){var _0x2ffec0=[];if(_0x3fc2b7){for(var _0x4332d0=0x0,_0x33bf63;_0x4332d0<_0x3fc2b7[_0xb9d7('0x17')];_0x4332d0+=0x1){_0x33bf63=_0x3fc2b7[_0x4332d0][_0xb9d7('0x53')]({'plain':!![]});_0x2ffec0[_0xb9d7('0x28')](db['sequelize'][_0xb9d7('0x4f')](_0x440dd4(_0x33bf63,_0xb9d7('0x55')))[_0xb9d7('0x27')](function(){})[_0xb9d7('0x2a')](_0x463af9()));}}return _0x2ffec0;})['all']();})['catch'](function(_0x210436){logger[_0xb9d7('0x14')](_0xb9d7('0x57'),_0xb9d7('0x58'),_0x210436['message']);});}var processPromises=function(_0xcb1529){return BPromise[_0xb9d7('0x51')](promises)['then'](function(_0x5d5ec7){})[_0xb9d7('0x2a')](function(_0x38cfe1){logger[_0xb9d7('0x14')](_0xb9d7('0x59'),JSON['stringify'](_0x38cfe1));})[_0xb9d7('0x5a')](function(){socket[_0xb9d7('0x5b')](_0xb9d7('0x5c')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xcb1529){return _0xcb1529[_0xb9d7('0x5d')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xb9d7('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0xb9d7('0x27')](function(){socket[_0xb9d7('0x5b')](_0xb9d7('0x5c')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb9d7('0x5e')](FILEPATH);}catch(_0x31562c){logger[_0xb9d7('0x14')](_0xb9d7('0x5f'),JSON['stringify'](_0x31562c));}finally{process[_0xb9d7('0x60')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xb9d7('0x61'));endCsv();});function main(){return BPromise['resolve']()[_0xb9d7('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb9d7('0x10')](',');return db['CmContact'][_0xb9d7('0x48')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x597458){var _0xf1a994=fs[_0xb9d7('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb9d7('0x63')](_0xf1a994,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cee1f,_0x35a639){total+=0x1;var _0x398767=total;promises['push'](checkRow(_0x1cee1f,_0x597458,_0x398767)['then'](function(){success+=0x1;})[_0xb9d7('0x2a')](function(_0x364542){if(_0x364542[_0xb9d7('0x14')]){errors+=0x1;delete _0x364542[_0xb9d7('0x14')];}else if(_0x364542['duplicate']){duplicates+=0x1;delete _0x364542['duplicate'];}rows[_0xb9d7('0x28')](_0x364542);}));if(total%0xc8===0x0){_0x35a639[_0xb9d7('0x64')]();return processPromises(_0x35a639);}},'complete':function(){return processPromises()[_0xb9d7('0x27')](function(){logger[_0xb9d7('0x65')](_0xb9d7('0x66'));endCsv();});},'error':function(_0x422f93,_0x5c1427){logger[_0xb9d7('0x65')](_0xb9d7('0x67'),JSON[_0xb9d7('0x2b')](_0x422f93));endCsv();}});})[_0xb9d7('0x2a')](function(_0x3deb3e){logger[_0xb9d7('0x14')](_0xb9d7('0x68'),JSON[_0xb9d7('0x2b')](_0x3deb3e));});}main();
\ No newline at end of file
+var _0xd1e9=['info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','ioredis','../../../mysqldb','api','defaults','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','CompanyId','length','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','field','NOW()','toString','ListId','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','str','calleridnum','deletedAt\x20IS\x20NULL','into','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','catch','BlackLists','get','all','Campaign','CampaignId','onlyIfOpen','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','pause'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xd1e9,0x70));var _0x9d1e=function(_0x4f3b2d,_0x3bbf46){_0x4f3b2d=_0x4f3b2d-0x0;var _0x3dddfa=_0xd1e9[_0x4f3b2d];return _0x3dddfa;};'use strict';var BPromise=require(_0x9d1e('0x0'));var util=require(_0x9d1e('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x9d1e('0x2'));var db=require(_0x9d1e('0x3'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x9d1e('0x4'));config['redis']=_[_0x9d1e('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9d1e('0x6'))(new Redis(config[_0x9d1e('0x7')]));require(_0x9d1e('0x8'))[_0x9d1e('0x9')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x9d1e('0xa')||process[_0x9d1e('0xb')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x9d1e('0xb')][0x2];if(!process['argv'][0x3]||process['argv'][0x3]===_0x9d1e('0xa')||process['argv'][0x3]===_0x9d1e('0xc')||!process[_0x9d1e('0xb')][0x4]||process[_0x9d1e('0xb')][0x4]===_0x9d1e('0xa')||process[_0x9d1e('0xb')][0x4]==='null'){throw new Error(_0x9d1e('0xd'));}var FIELDS=_[_0x9d1e('0xe')](process[_0x9d1e('0xb')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x9d1e('0xb')][0x5]||process[_0x9d1e('0xb')][0x5]===_0x9d1e('0xa')||process[_0x9d1e('0xb')][0x5]===_0x9d1e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x9d1e('0xb')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x9d1e('0xa')&&process['argv'][0x6]!==_0x9d1e('0xc')?process[_0x9d1e('0xb')][0x6]:null;var DUPLICATES=process[_0x9d1e('0xb')][0x7]&&process[_0x9d1e('0xb')][0x7]!==_0x9d1e('0xa')&&process['argv'][0x7]!==_0x9d1e('0xc')?process[_0x9d1e('0xb')][0x7]:null;if(!process[_0x9d1e('0xb')][0x8]||process[_0x9d1e('0xb')][0x8]==='undefined'||process[_0x9d1e('0xb')][0x8]===_0x9d1e('0xc')){throw new Error(_0x9d1e('0xf'));}var SOCKET_TIMESTAMP=process[_0x9d1e('0xb')][0x8];}catch(_0x482a71){logger[_0x9d1e('0x10')](_0x482a71);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(_0x271ff6,_0x54fe8c,_0x4daf4a,_0x5ee8ee){var _0x4a9a50={'message':_0x54fe8c};_0x4a9a50[_0x271ff6]=!![];if(_0x4daf4a){_0x4a9a50[_0x9d1e('0x11')]=_0x4daf4a;}if(_0x5ee8ee){_0x4a9a50[_0x9d1e('0x12')]=_0x5ee8ee;}return _0x4a9a50;}function isEmail(_0x5f4ed5){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))*$/[_0x9d1e('0x13')](_0x5f4ed5);}function checkRow(_0x32e602,_0x15d127,_0x352f15){return new BPromise(function(_0x58d830,_0x1a7ea4){if(_[_0x9d1e('0x14')](_0x32e602)){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x9d1e('0x15'),null,_0x352f15));}if(_0x32e602[_0x9d1e('0x16')]&&_0x32e602[_0x9d1e('0x16')]['length']){var _0x5ac55c=_['map'](_0x32e602['errors'],_0x9d1e('0x17'))[_0x9d1e('0x18')](';');return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x5ac55c,null,_0x352f15));}var _0x501c6a={};for(var _0x4d430a in FIELDS){if(FIELDS[_0x9d1e('0x19')](_0x4d430a)&&FIELDS[_0x4d430a]){_0x501c6a[_0x4d430a]=_0x32e602[_0x9d1e('0x1a')][0x0][FIELDS[_0x4d430a]]||_0x32e602[_0x9d1e('0x1a')][0x0]['\ufeff'+FIELDS[_0x4d430a]];}}if(!_0x501c6a['firstName']){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x9d1e('0x1b'),null,_0x352f15));}if(!_0x501c6a['phone']){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x9d1e('0x1c'),null,_0x352f15));}if(_0x501c6a[_0x9d1e('0x1d')]){var _0x587939=moment(_0x501c6a[_0x9d1e('0x1d')],'YYYY-MM-DD');if(!_0x587939[_0x9d1e('0x1e')]()){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x9d1e('0x1f'),null,_0x352f15));}}if(_0x501c6a[_0x9d1e('0x20')]){if(!isEmail(_0x501c6a[_0x9d1e('0x20')])){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),'email\x20format\x20is\x20not\x20valid!',null,_0x352f15));}}_0x501c6a['ListId']=LISTID;_0x501c6a[_0x9d1e('0x21')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9d1e('0x22')]&&_0x15d127){var _0x2be9dc={};for(var _0x519b79=0x0,_0xe74362=DUPLICATES[_0x9d1e('0x22')];_0x519b79<_0xe74362;_0x519b79+=0x1){_0x2be9dc[DUPLICATES[_0x519b79]]=_0x501c6a[DUPLICATES[_0x519b79]];}var _0xc2e441=_[_0x9d1e('0x23')](_0x15d127,_0x2be9dc);if(_0xc2e441){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x24'),_0x9d1e('0x25'),_0xc2e441,_0x352f15));}}return db[_0x9d1e('0x26')][_0x9d1e('0x27')](_0x501c6a,{'raw':!![],'hooks':![],'fields':_[_0x9d1e('0x28')](_0x501c6a)})[_0x9d1e('0x29')](function(_0xfc98e5){if(DUPLICATES&&DUPLICATES[_0x9d1e('0x22')]&&_0x15d127){_0x15d127[_0x9d1e('0x2a')](_[_0x9d1e('0x2b')](_0x501c6a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xfc98e5['id'];return _0x58d830();})['catch'](function(_0x5a85d8){return _0x1a7ea4(handleCheckRowError(_0x9d1e('0x10'),_0x9d1e('0x2c')+(_0x5a85d8[_0x9d1e('0x17')]||JSON[_0x9d1e('0x2d')](_0x5a85d8)),null,_0x352f15));});});}function checkHopper(){function _0x13eee9(){return function(_0x5daed9){logger[_0x9d1e('0x10')](_0x9d1e('0x2e'),_0x9d1e('0x2f'),util[_0x9d1e('0x30')](_0x5daed9,{'showHidden':![],'depth':null}));};}var _0x1e4e41=function(_0x144257,_0x287ab3){var _0x2ea832=squel[_0x9d1e('0x31')]()['into'](_0x9d1e('0x32'))[_0x9d1e('0x33')]([_0x9d1e('0x34'),_0x9d1e('0x35'),_0x9d1e('0x36'),'ListId',_0x287ab3,_0x9d1e('0x37'),_0x9d1e('0x38')],squel['select']()[_0x9d1e('0x39')]('phone',_0x9d1e('0x34'))[_0x9d1e('0x39')](_0x9d1e('0x3a'),_0x9d1e('0x35'))[_0x9d1e('0x39')]('id',_0x9d1e('0x36'))[_0x9d1e('0x39')](LISTID[_0x9d1e('0x3b')](),_0x9d1e('0x3c'))[_0x9d1e('0x39')](_0x144257['id'][_0x9d1e('0x3b')](),_0x287ab3)[_0x9d1e('0x39')](_0x9d1e('0x3a'),_0x9d1e('0x37'))[_0x9d1e('0x39')](_0x9d1e('0x3a'),'updatedAt')[_0x9d1e('0x3d')](_0x9d1e('0x3e'))[_0x9d1e('0x3f')]('deletedAt\x20IS\x20NULL')[_0x9d1e('0x3f')](_0x9d1e('0x40'),LISTID[_0x9d1e('0x3b')]())[_0x9d1e('0x3f')](_0x9d1e('0x41'))[_0x9d1e('0x3f')](_0x9d1e('0x42'),squel[_0x9d1e('0x43')]()[_0x9d1e('0x39')](_0x9d1e('0x34'))[_0x9d1e('0x3d')](_0x9d1e('0x32'))[_0x9d1e('0x3f')](_0x287ab3+_0x9d1e('0x44'),_0x144257['id'][_0x9d1e('0x3b')]())))[_0x9d1e('0x3b')]();return _0x2ea832;};var _0xbfe8b9=function(_0x2977b4,_0x2c2512){var _0x20e543=squel[_0x9d1e('0x31')]()['into'](_0x9d1e('0x32'))[_0x9d1e('0x33')](['phone',_0x9d1e('0x35'),'ContactId',_0x9d1e('0x3c'),_0x2c2512,_0x9d1e('0x37'),_0x9d1e('0x38')],squel['select']()['field'](_0x9d1e('0x34'),'phone')[_0x9d1e('0x39')](_0x9d1e('0x3a'),'scheduledAt')[_0x9d1e('0x39')]('id',_0x9d1e('0x36'))['field'](LISTID['toString'](),'ListId')['field'](_0x2977b4['id'][_0x9d1e('0x3b')](),_0x2c2512)[_0x9d1e('0x39')](_0x9d1e('0x3a'),_0x9d1e('0x37'))[_0x9d1e('0x39')](_0x9d1e('0x3a'),_0x9d1e('0x38'))[_0x9d1e('0x3d')](_0x9d1e('0x3e'))[_0x9d1e('0x3f')]('deletedAt\x20IS\x20NULL')[_0x9d1e('0x3f')](_0x9d1e('0x40'),LISTID[_0x9d1e('0x3b')]())['where'](_0x9d1e('0x45'),squel[_0x9d1e('0x46')](hopperContacts))['where'](_0x9d1e('0x41'))['where'](_0x9d1e('0x42'),squel[_0x9d1e('0x43')]()[_0x9d1e('0x39')](_0x9d1e('0x47'))[_0x9d1e('0x3d')]('cm_hopper_final')[_0x9d1e('0x3f')](_0x2c2512+_0x9d1e('0x44'),_0x2977b4['id'][_0x9d1e('0x3b')]()))['where'](_0x9d1e('0x42'),squel[_0x9d1e('0x43')]()['field'](_0x9d1e('0x34'))[_0x9d1e('0x3d')](_0x9d1e('0x32'))[_0x9d1e('0x3f')](_0x2c2512+'\x20=\x20?',_0x2977b4['id'][_0x9d1e('0x3b')]())))[_0x9d1e('0x3b')]();return _0x20e543;};function _0x1f320b(_0x44ead4,_0x41f534){var _0x5d84a5=squel['insert']()['into'](_0x9d1e('0x32'))['fromQuery']([_0x9d1e('0x34'),_0x9d1e('0x35'),_0x9d1e('0x36'),_0x9d1e('0x3c'),_0x41f534,_0x9d1e('0x37'),_0x9d1e('0x38')],squel[_0x9d1e('0x43')]()[_0x9d1e('0x39')](_0x9d1e('0x34'),_0x9d1e('0x34'))[_0x9d1e('0x39')]('NOW()',_0x9d1e('0x35'))[_0x9d1e('0x39')]('id',_0x9d1e('0x36'))[_0x9d1e('0x39')](LISTID[_0x9d1e('0x3b')](),_0x9d1e('0x3c'))['field'](_0x44ead4['id'][_0x9d1e('0x3b')](),_0x41f534)[_0x9d1e('0x39')](_0x9d1e('0x3a'),_0x9d1e('0x37'))['field'](_0x9d1e('0x3a'),_0x9d1e('0x38'))['from'](_0x9d1e('0x3e'))['where'](_0x9d1e('0x48'))[_0x9d1e('0x3f')](_0x9d1e('0x40'),LISTID[_0x9d1e('0x3b')]())[_0x9d1e('0x3f')](_0x9d1e('0x45'),squel[_0x9d1e('0x46')](hopperContacts))[_0x9d1e('0x3f')](_0x9d1e('0x41')))[_0x9d1e('0x3b')]();return _0x5d84a5;}function _0x2a1600(_0x1c93be,_0x987894){var _0x515c75=squel[_0x9d1e('0x31')]()[_0x9d1e('0x49')]('cm_hopper_black')[_0x9d1e('0x33')]([_0x9d1e('0x34'),_0x9d1e('0x36'),'ListId',_0x987894,_0x9d1e('0x37'),'updatedAt'],squel[_0x9d1e('0x43')]()['field'](_0x9d1e('0x34'),_0x9d1e('0x34'))['field']('id',_0x9d1e('0x36'))[_0x9d1e('0x39')](LISTID[_0x9d1e('0x3b')](),'ListId')[_0x9d1e('0x39')](_0x1c93be['id'][_0x9d1e('0x3b')](),_0x987894)[_0x9d1e('0x39')]('NOW()',_0x9d1e('0x37'))[_0x9d1e('0x39')](_0x9d1e('0x3a'),'updatedAt')[_0x9d1e('0x3d')](_0x9d1e('0x3e'))['where'](_0x9d1e('0x48'))[_0x9d1e('0x3f')](_0x9d1e('0x40'),LISTID[_0x9d1e('0x3b')]())[_0x9d1e('0x3f')](_0x9d1e('0x45'),squel[_0x9d1e('0x46')](hopperContacts))[_0x9d1e('0x3f')](_0x9d1e('0x41')))[_0x9d1e('0x3b')]();return _0x515c75;}return db[_0x9d1e('0x4a')][_0x9d1e('0x4b')]({'where':{'type':_0x9d1e('0x4c')},'attributes':['id',_0x9d1e('0x4d')],'include':[{'model':db[_0x9d1e('0x4e')],'as':_0x9d1e('0x4f'),'where':{'id':LISTID}}]})[_0x9d1e('0x29')](function(_0x3bca0c){var _0xf7bab5=[];if(_0x3bca0c){var _0xf2528f;for(var _0x17ba55=0x0,_0x4b43e9;_0x17ba55<_0x3bca0c['length'];_0x17ba55+=0x1){_0x4b43e9=_0x3bca0c[_0x17ba55]['get']({'plain':!![]});switch(_0x4b43e9[_0x9d1e('0x4d')]){case _0x9d1e('0x50'):_0xf7bab5[_0x9d1e('0x2a')](db[_0x9d1e('0x51')]['query'](_0xbfe8b9(_0x4b43e9,'VoiceQueueId'))['then'](function(){})['catch'](_0x13eee9()));break;case'onlyIfOpen':_0xf7bab5[_0x9d1e('0x2a')](db[_0x9d1e('0x51')][_0x9d1e('0x52')](_0x1e4e41(_0x4b43e9,_0x9d1e('0x53')))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));break;default:_0xf7bab5[_0x9d1e('0x2a')](db[_0x9d1e('0x51')][_0x9d1e('0x52')](_0x1f320b(_0x4b43e9,'VoiceQueueId'))['then'](function(){})[_0x9d1e('0x54')](_0x13eee9()));}}}return _0xf7bab5;})['all']()[_0x9d1e('0x29')](function(){return db['VoiceQueue'][_0x9d1e('0x4b')]({'where':{'type':_0x9d1e('0x4c')},'attributes':['id'],'include':[{'model':db[_0x9d1e('0x4e')],'as':_0x9d1e('0x55'),'where':{'id':LISTID}}]})[_0x9d1e('0x29')](function(_0x4ce2e9){var _0x8a9b9f=[];if(_0x4ce2e9){var _0x457cd4;for(var _0x3d947a=0x0,_0x3d1461;_0x3d947a<_0x4ce2e9[_0x9d1e('0x22')];_0x3d947a+=0x1){_0x3d1461=_0x4ce2e9[_0x3d947a][_0x9d1e('0x56')]({'plain':!![]});_0x8a9b9f[_0x9d1e('0x2a')](db[_0x9d1e('0x51')]['query'](_0x2a1600(_0x3d1461,'VoiceQueueId'))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));}}return _0x8a9b9f;})[_0x9d1e('0x57')]();})['then'](function(){return db[_0x9d1e('0x58')][_0x9d1e('0x4b')]({'attributes':['id',_0x9d1e('0x4d')],'include':[{'model':db[_0x9d1e('0x4e')],'as':_0x9d1e('0x4f'),'where':{'id':LISTID}}]})[_0x9d1e('0x29')](function(_0xd58604){var _0x335d08=[];if(_0xd58604){for(var _0xfe5192=0x0,_0xc8a1a0;_0xfe5192<_0xd58604[_0x9d1e('0x22')];_0xfe5192+=0x1){_0xc8a1a0=_0xd58604[_0xfe5192][_0x9d1e('0x56')]({'plain':!![]});switch(_0xc8a1a0[_0x9d1e('0x4d')]){case'always':_0x335d08['push'](db[_0x9d1e('0x51')]['query'](_0xbfe8b9(_0xc8a1a0,_0x9d1e('0x59')))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));break;case _0x9d1e('0x5a'):_0x335d08['push'](db[_0x9d1e('0x51')][_0x9d1e('0x52')](_0x1e4e41(_0xc8a1a0,_0x9d1e('0x59')))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));break;default:_0x335d08[_0x9d1e('0x2a')](db[_0x9d1e('0x51')][_0x9d1e('0x52')](_0x1f320b(_0xc8a1a0,'CampaignId'))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));}}}return _0x335d08;})[_0x9d1e('0x57')]();})[_0x9d1e('0x29')](function(){return db[_0x9d1e('0x58')][_0x9d1e('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x9d1e('0x4e')],'as':_0x9d1e('0x55'),'where':{'id':LISTID}}]})[_0x9d1e('0x29')](function(_0x54b9c7){var _0x4692d1=[];if(_0x54b9c7){for(var _0x31c336=0x0,_0x19437c;_0x31c336<_0x54b9c7[_0x9d1e('0x22')];_0x31c336+=0x1){_0x19437c=_0x54b9c7[_0x31c336][_0x9d1e('0x56')]({'plain':!![]});_0x4692d1[_0x9d1e('0x2a')](db['sequelize'][_0x9d1e('0x52')](_0x2a1600(_0x19437c,_0x9d1e('0x59')))[_0x9d1e('0x29')](function(){})[_0x9d1e('0x54')](_0x13eee9()));}}return _0x4692d1;})[_0x9d1e('0x57')]();})[_0x9d1e('0x54')](function(_0x86b33f){logger[_0x9d1e('0x10')]('cmContact,\x20%s,\x20%s',_0x9d1e('0x5b'),_0x86b33f[_0x9d1e('0x17')]);});}var processPromises=function(_0x38b17e){return BPromise[_0x9d1e('0x57')](promises)[_0x9d1e('0x29')](function(_0x33ee8f){})[_0x9d1e('0x54')](function(_0x2679a4){logger[_0x9d1e('0x10')](_0x9d1e('0x5c'),JSON[_0x9d1e('0x2d')](_0x2679a4));})[_0x9d1e('0x5d')](function(){socket[_0x9d1e('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x38b17e){return _0x38b17e[_0x9d1e('0x5f')]();}});};var endCsv=function(){return BPromise[_0x9d1e('0x60')]()[_0x9d1e('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x9d1e('0x29')](function(){socket[_0x9d1e('0x5e')](_0x9d1e('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9d1e('0x62')](FILEPATH);}catch(_0x1fd592){logger[_0x9d1e('0x10')](_0x9d1e('0x63'),JSON[_0x9d1e('0x2d')](_0x1fd592));}finally{process['exit'](0x0);}});};process['on'](_0x9d1e('0x64'),function(){logger['info'](_0x9d1e('0x65'));endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9d1e('0x66')](',');return db[_0x9d1e('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9d1e('0x29')](function(_0x10e28e){var _0x2b49c4=fs[_0x9d1e('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9d1e('0x68')](_0x2b49c4,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1630ad,_0x3162d3){total+=0x1;var _0x51108e=total;promises[_0x9d1e('0x2a')](checkRow(_0x1630ad,_0x10e28e,_0x51108e)['then'](function(){success+=0x1;})[_0x9d1e('0x54')](function(_0x246e65){if(_0x246e65[_0x9d1e('0x10')]){errors+=0x1;delete _0x246e65[_0x9d1e('0x10')];}else if(_0x246e65[_0x9d1e('0x24')]){duplicates+=0x1;delete _0x246e65['duplicate'];}rows[_0x9d1e('0x2a')](_0x246e65);}));if(total%0xc8===0x0){_0x3162d3[_0x9d1e('0x69')]();return processPromises(_0x3162d3);}},'complete':function(){return processPromises()[_0x9d1e('0x29')](function(){logger[_0x9d1e('0x6a')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x407b3d,_0x13546e){logger[_0x9d1e('0x6a')](_0x9d1e('0x6b'),JSON[_0x9d1e('0x2d')](_0x407b3d));endCsv();}});})[_0x9d1e('0x54')](function(_0x5adfcc){logger[_0x9d1e('0x10')](_0x9d1e('0x6c'),JSON[_0x9d1e('0x2d')](_0x5adfcc));});}main();
\ No newline at end of file
index 6aa4838..cdf88d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a82=['code','sequelize','query','spread','catch','main','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','length','rows','errors','data','hasOwnProperty','trim','replace','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','isValid','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','then','affectedRows','unlink','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','.id\x20=\x20','\x20=\x20','where','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_hopper_black','ContactId','ListId\x20=\x20?','\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','push'];(function(_0x4a0066,_0x16fb7e){var _0x611761=function(_0x4c040d){while(--_0x4c040d){_0x4a0066['push'](_0x4a0066['shift']());}};_0x611761(++_0x16fb7e);}(_0x7a82,0xbc));var _0x27a8=function(_0x573087,_0x2d0d09){_0x573087=_0x573087-0x0;var _0x300b0d=_0x7a82[_0x573087];return _0x300b0d;};'use strict';var fs=require('fs');var path=require(_0x27a8('0x0'));var _=require(_0x27a8('0x1'));var Papa=require(_0x27a8('0x2'));var util=require(_0x27a8('0x3'));var BPromise=require(_0x27a8('0x4'));var moment=require(_0x27a8('0x5'));var squel=require('squel');var Redis=require(_0x27a8('0x6'));var db=require(_0x27a8('0x7'))['db'];var config=require(_0x27a8('0x8'));var logger=require('../../../config/logger')('import');config[_0x27a8('0x9')]=_[_0x27a8('0xa')](config[_0x27a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x27a8('0xb'))(new Redis(config[_0x27a8('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x27a8('0xc')](_0x27a8('0xd'));function isEmail(_0x259e0e){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))*$/[_0x27a8('0xe')](_0x259e0e);}function selectNotIn(_0x20f0c6,_0x2808bb,_0x140d8a,_0xb71531,_0x28e45a){return squel[_0x27a8('0xf')]()[_0x27a8('0x10')](_0x27a8('0x11'))[_0x27a8('0x12')](_0xb71531)['join'](_0x2808bb,null,_0x2808bb+_0x27a8('0x13')+_0xb71531+'.'+_0x140d8a)['where'](_0xb71531+'.'+_0x140d8a+_0x27a8('0x14')+_0x20f0c6+'.'+_0x140d8a)[_0x27a8('0x15')](_0x2808bb+'.dialCheckDuplicateType\x20IN\x20('+_0x28e45a[_0x27a8('0x16')]()+')');}function insertCmHopper(_0x137bf5,_0x28761d,_0x236865,_0x48e85c,_0x489aab){var _0x50854f=[_0x27a8('0x17'),_0x27a8('0x18'),'cm_contacts.id',_0x27a8('0x19'),_0x28761d+'.'+_0x48e85c,_0x27a8('0x1a'),'cm_contacts.updatedAt',_0x27a8('0x1b'),_0x27a8('0x1c'),'\x22'+_0x489aab+'\x22'];return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x1f'))[_0x27a8('0x20')]([_0x27a8('0x11'),_0x27a8('0x21'),'ContactId',_0x27a8('0x22'),_0x48e85c,_0x27a8('0x23'),_0x27a8('0x24'),_0x27a8('0x25'),_0x27a8('0x26'),_0x27a8('0x27')],squel[_0x27a8('0xf')]()[_0x27a8('0x28')](_0x50854f)[_0x27a8('0x12')](_0x28761d)['join'](_0x27a8('0x29'),null,_0x27a8('0x2a')+_0x28761d+_0x27a8('0x2b'))[_0x27a8('0x16')](_0x236865,null,_0x236865+_0x27a8('0x13')+_0x28761d+'.'+_0x48e85c)[_0x27a8('0x15')](_0x28761d+_0x27a8('0x2c'),_0x137bf5)[_0x27a8('0x15')](_0x27a8('0x2d'),NOW)[_0x27a8('0x15')](_0x27a8('0x2e'),selectNotIn(_0x28761d,_0x236865,_0x48e85c,'cm_hopper',[_0x27a8('0x2f'),_0x27a8('0x30')]))[_0x27a8('0x15')](_0x27a8('0x2e'),selectNotIn(_0x28761d,_0x236865,_0x48e85c,_0x27a8('0x1f'),[_0x27a8('0x2f')])))[_0x27a8('0x31')]();}function insertCmHopperBlack(_0x175066,_0x56e297,_0x1fedcb,_0x1b670e){var _0x77d92b=[_0x27a8('0x17'),_0x27a8('0x32'),_0x27a8('0x19'),_0x56e297+'.'+_0x1b670e,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x33'))['fromQuery'](['phone',_0x27a8('0x34'),_0x27a8('0x22'),_0x1b670e,'createdAt',_0x27a8('0x24')],squel[_0x27a8('0xf')]()['fields'](_0x77d92b)[_0x27a8('0x12')](_0x56e297)[_0x27a8('0x16')](_0x27a8('0x29'),null,_0x27a8('0x2a')+_0x56e297+'.CmListId')[_0x27a8('0x16')](_0x1fedcb,null,_0x1fedcb+'.id\x20=\x20'+_0x56e297+'.'+_0x1b670e)[_0x27a8('0x15')](_0x56e297+_0x27a8('0x2c'),_0x175066)[_0x27a8('0x15')](_0x27a8('0x2d'),NOW)[_0x27a8('0x15')](_0x27a8('0x2e'),squel['select']()[_0x27a8('0x10')](_0x27a8('0x11'))[_0x27a8('0x12')]('cm_hopper_black')['where'](_0x27a8('0x35'),_0x175066)['where'](_0x1b670e+_0x27a8('0x36'),_0x56e297+'.'+_0x1b670e)))['toString']();}function insertCmContact(_0x2ca1cc,_0x163930,_0x12be89,_0x44a630){var _0x23543d=_['concat'](_[_0x27a8('0x37')](_0x44a630),[_0x27a8('0x22'),_0x27a8('0x38'),'createdAt',_0x27a8('0x24')]);return squel[_0x27a8('0x1d')]()[_0x27a8('0x1e')](_0x27a8('0x29'))[_0x27a8('0x20')](_0x23543d,squel['select']()['fields'](_0x23543d)['from'](_0x163930)[_0x27a8('0x15')]('('+_0x12be89[_0x27a8('0x16')](',')+_0x27a8('0x39'),squel[_0x27a8('0xf')]()[_0x27a8('0x28')](_0x12be89)[_0x27a8('0x12')](_0x27a8('0x29'))[_0x27a8('0x15')](_0x27a8('0x35'),_0x2ca1cc)[_0x27a8('0x15')](_0x27a8('0x3a')))[_0x27a8('0x15')](_0x27a8('0x3b'),squel[_0x27a8('0xf')]()[_0x27a8('0x10')](_0x27a8('0x3c'),_0x27a8('0x3d'))['from'](_0x163930)[_0x27a8('0x3e')](_0x12be89['join'](','))))[_0x27a8('0x31')]();}function handleStop(){logger[_0x27a8('0x3f')](_0x27a8('0x40'));stopped=!![];}function handleUncaughtException(_0xbefc60){logger[_0x27a8('0x41')](_0xbefc60[_0x27a8('0x42')]);process['exit'](0x1);}function handleError(_0x182b5c,_0x153d70){stats['errors'][_0x27a8('0x43')]({'name':_0x153d70[_0x27a8('0x44')],'message':_0x153d70['message'],'row':_0x182b5c});}function handleQuery(_0x182a1){logger[_0x27a8('0x3f')](_0x182a1);return db[_0x27a8('0x45')][_0x27a8('0x46')](_0x182a1)[_0x27a8('0x47')](function(_0x3d4c11){results['push'](_0x3d4c11);})[_0x27a8('0x48')](function(_0xba14b9){logger[_0x27a8('0x41')](_0xba14b9[_0x27a8('0x42')]);});}function main(_0x531380,_0x59209c,_0x323b33,_0x2e80b4){logger[_0x27a8('0x3f')](_0x27a8('0x49'),_0x531380,JSON[_0x27a8('0x4a')](_0x59209c));process['send']('start');var _0x4586d5=_0x59209c[_0x27a8('0x4b')];var _0x1fa784=_0x59209c[_0x27a8('0x4c')];var _0x4bb46d=path['join'](config[_0x27a8('0x4d')],_0x27a8('0x4e'),_0x1fa784+_0x27a8('0x4f'));var _0x86436a=_[_0x27a8('0x37')](_0x4586d5)[_0x27a8('0x16')]();logger[_0x27a8('0x3f')]('header',_0x86436a);fs[_0x27a8('0x50')](_0x4bb46d,_0x86436a+'\x0a');Papa[_0x27a8('0x51')](fs[_0x27a8('0x52')](_0x531380),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1350f6,_0x315cc2){try{for(var _0x592297=0x0,_0x3bdfab=[];_0x592297<_0x1350f6['data'][_0x27a8('0x53')];_0x592297++){stats[_0x27a8('0x54')]+=0x1;if(_0x1350f6[_0x27a8('0x55')][_0x592297]){handleError(_0x1350f6[_0x27a8('0x56')][_0x592297],_0x1350f6['errors'][_0x592297]);}else{var _0xbbf321=[];for(var _0x386d1d in _0x4586d5){if(_0x4586d5[_0x27a8('0x57')](_0x386d1d)){if(_0x1350f6[_0x27a8('0x56')][_0x592297][_0x4586d5[_0x386d1d]]){var _0x3a5031=_[_0x27a8('0x58')](_0x1350f6['data'][_0x592297][_0x4586d5[_0x386d1d]][_0x27a8('0x59')](/"/g,'\x27'));switch(_0x386d1d){case _0x27a8('0x21'):var _0x3f1861=moment(_0x3a5031,_0x27a8('0xd'),!![]);if(_0x3f1861['isValid']()){_0x3bdfab['push']('\x22'+_0x3a5031+'\x22');}else{_0xbbf321['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x27a8('0x25'):var _0x276e30=parseInt(_0x3a5031);_0x3a5031=_[_0x27a8('0x5a')](_0x276e30)||_0x276e30<0x0||_0x276e30>0x4?_0x2e80b4?0x3:0x2:_0x276e30;_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');break;case'UserId':var _0x45953f=parseInt(_0x3a5031);if(_[_0x27a8('0x5b')](_0x45953f)&&_['includes'](_0x323b33,_0x45953f)){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x45953f+'\x22');}else{_0xbbf321['push'](_0x27a8('0x5c'));}break;case _0x27a8('0x5d'):if(isEmail(_0x3a5031)){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}else{_0xbbf321[_0x27a8('0x43')](_0x27a8('0x5e'));}break;case'dateOfBirth':var _0x360af2=moment(_0x3a5031,'YYYY-MM-DD',!![]);if(_0x360af2[_0x27a8('0x5f')]()){_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}else{_0xbbf321[_0x27a8('0x43')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x3bdfab[_0x27a8('0x43')]('\x22'+_0x3a5031+'\x22');}}else{switch(_0x386d1d){case _0x27a8('0x60'):case _0x27a8('0x11'):_0xbbf321['push'](_0x386d1d+_0x27a8('0x61'));break;default:_0x3bdfab[_0x27a8('0x43')]('\x22\x22');}}}}if(_0xbbf321[_0x27a8('0x53')]){handleError(_0x1350f6['data'][_0x592297],{'code':_0x27a8('0x62'),'message':_0xbbf321['join']()});}else{fs[_0x27a8('0x63')](_0x4bb46d,_0x3bdfab[_0x27a8('0x16')]()+'\x0a');}_0x3bdfab=[];}if(!(stats[_0x27a8('0x54')]%0xc8)){socket[_0x27a8('0x64')](_0x27a8('0x65')+_0x1fa784,stats);stats['errors']=[];}}if(stopped){logger[_0x27a8('0x3f')](_0x27a8('0x66'));_0x315cc2[_0x27a8('0x67')]();}}catch(_0x37fde8){handleError(_0x1350f6['data'][_0x592297],{'code':'SystemError','message':_0x37fde8['message']});logger[_0x27a8('0x41')](_0x27a8('0x68'),_0x37fde8[_0x27a8('0x42')]);}},'complete':function(){try{var _0x18809b=[];var _0x2867e5=_0x27a8('0x29');if(_0x59209c[_0x27a8('0x69')]&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]){_0x2867e5=_0x27a8('0x6a')+_0x1fa784;_0x18809b[_0x27a8('0x43')]('CREATE\x20TABLE\x20'+_0x2867e5+'\x20LIKE\x20cm_contacts;');}var _0x439f4d=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x4bb46d,_0x2867e5,_0x86436a,_0x59209c[_0x27a8('0x22')],_0x59209c['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x4586d5[_0x27a8('0x21')])){_0x439f4d+=_0x27a8('0x6b');}_0x18809b[_0x27a8('0x43')](_0x439f4d);if(_0x59209c[_0x27a8('0x69')]&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]){_0x18809b['push'](insertCmContact(_0x59209c[_0x27a8('0x22')],_0x2867e5,_0x59209c[_0x27a8('0x69')],_0x4586d5));_0x18809b[_0x27a8('0x43')](_0x27a8('0x6c')+_0x2867e5+';');}_0x18809b[_0x27a8('0x43')](insertCmHopper(_0x59209c['ListId'],'voice_queues_has_cm_lists',_0x27a8('0x6d'),_0x27a8('0x6e'),_0x2e80b4));_0x18809b[_0x27a8('0x43')](insertCmHopperBlack(_0x59209c['ListId'],_0x27a8('0x6f'),'voice_queues',_0x27a8('0x6e')));_0x18809b[_0x27a8('0x43')](insertCmHopper(_0x59209c[_0x27a8('0x22')],'campaigns_has_cm_lists',_0x27a8('0x70'),_0x27a8('0x71'),_0x2e80b4));_0x18809b['push'](insertCmHopperBlack(_0x59209c[_0x27a8('0x22')],'campaigns_has_cm_blacklists',_0x27a8('0x70'),_0x27a8('0x71')));BPromise['each'](_0x18809b,handleQuery)[_0x27a8('0x72')](function(_0x34aa80){stats['finish']=!![];stats[_0x27a8('0x73')]=_0x59209c['duplicates']&&_0x59209c[_0x27a8('0x69')][_0x27a8('0x53')]?results[0x2][_0x27a8('0x73')]:results[0x0]['affectedRows'];socket[_0x27a8('0x64')](_0x27a8('0x65')+_0x1fa784,stats);fs[_0x27a8('0x74')](_0x531380);fs[_0x27a8('0x74')](_0x4bb46d);process[_0x27a8('0x75')](0x0);})[_0x27a8('0x48')](function(_0x443550){logger[_0x27a8('0x41')](_0x443550[_0x27a8('0x42')]);process[_0x27a8('0x75')](0x1);});}catch(_0x32a78f){logger['error'](_0x27a8('0x76'),_0x32a78f[_0x27a8('0x42')]);process['exit'](0x1);}},'error':function(_0x4f9081,_0x30068d,_0x57b2a7,_0x25d346){throw new Error(_0x25d346);}});}function validate(){if(process[_0x27a8('0x77')]&&process[_0x27a8('0x77')]['length']<0x4){throw new Error(_0x27a8('0x78'));}var _0x3c7fd4=path['join'](config[_0x27a8('0x4d')],_0x27a8('0x4e'),process['argv'][0x2]);if(!fs['existsSync'](_0x3c7fd4)){throw new Error(_0x27a8('0x79'));}var _0x2073a2={};try{_0x2073a2=JSON[_0x27a8('0x51')](process[_0x27a8('0x77')][0x3]);if(!_0x2073a2[_0x27a8('0x4b')]){throw new Error(_0x27a8('0x7a'));}if(!_0x2073a2[_0x27a8('0x4b')][_0x27a8('0x11')]){throw new Error(_0x27a8('0x7b'));}if(!_0x2073a2['binding']['firstName']){throw new Error(_0x27a8('0x7c'));}var _0x180698=0x0;if(_0x2073a2[_0x27a8('0x4b')]['UserId']){_0x180698=0x1;}if(!_0x2073a2['ListId']){throw new Error(_0x27a8('0x7d'));}}catch(_0x56604a){throw new Error(_0x27a8('0x7e'));}var _0x4d6fb6=[];try{_0x4d6fb6=_['map'](JSON[_0x27a8('0x51')](process['argv'][0x4]),'id');}catch(_0x3accad){logger['info'](_0x27a8('0x7f'));}main(_0x3c7fd4,_0x2073a2,_0x4d6fb6,_0x180698);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x0cde=['../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','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_hopper_black','ListId','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','Received\x20SIGINT','error','message','exit','errors','push','code','info','query','catch','main','stringify','send','start','binding','root','server/files/tmp','.csv','writeFileSync','createReadStream','data','length','rows','hasOwnProperty','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','appendFileSync','emit','contact:import:','abort','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','moment','squel','ioredis'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0x0cde,0x106));var _0xe0cd=function(_0x53df1f,_0x522338){_0x53df1f=_0x53df1f-0x0;var _0x4188f1=_0x0cde[_0x53df1f];return _0x4188f1;};'use strict';var fs=require('fs');var path=require(_0xe0cd('0x0'));var _=require('lodash');var Papa=require(_0xe0cd('0x1'));var util=require('util');var BPromise=require(_0xe0cd('0x2'));var moment=require(_0xe0cd('0x3'));var squel=require(_0xe0cd('0x4'));var Redis=require(_0xe0cd('0x5'));var db=require(_0xe0cd('0x6'))['db'];var config=require(_0xe0cd('0x7'));var logger=require(_0xe0cd('0x8'))(_0xe0cd('0x9'));config[_0xe0cd('0xa')]=_[_0xe0cd('0xb')](config['redis'],{'host':_0xe0cd('0xc'),'port':0x18eb});var socket=require(_0xe0cd('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xe0cd('0xe')](_0xe0cd('0xf'));function isEmail(_0x101d47){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))*$/[_0xe0cd('0x10')](_0x101d47);}function selectNotIn(_0x598f0b,_0x47f07f,_0x4cf7a0,_0x346fb7,_0x55d0b9){return squel[_0xe0cd('0x11')]()[_0xe0cd('0x12')](_0xe0cd('0x13'))[_0xe0cd('0x14')](_0x346fb7)[_0xe0cd('0x15')](_0x47f07f,null,_0x47f07f+_0xe0cd('0x16')+_0x346fb7+'.'+_0x4cf7a0)[_0xe0cd('0x17')](_0x346fb7+'.'+_0x4cf7a0+_0xe0cd('0x18')+_0x598f0b+'.'+_0x4cf7a0)[_0xe0cd('0x17')](_0x47f07f+_0xe0cd('0x19')+_0x55d0b9[_0xe0cd('0x15')]()+')');}function insertCmHopper(_0x2cb996,_0x5a9442,_0x2105c8,_0x2ee91c,_0x4bee9b){var _0x371cf0=[_0xe0cd('0x1a'),_0xe0cd('0x1b'),_0xe0cd('0x1c'),_0xe0cd('0x1d'),_0x5a9442+'.'+_0x2ee91c,_0xe0cd('0x1e'),_0xe0cd('0x1f'),_0xe0cd('0x20'),'cm_contacts.UserId','\x22'+_0x4bee9b+'\x22'];return squel[_0xe0cd('0x21')]()[_0xe0cd('0x22')](_0xe0cd('0x23'))[_0xe0cd('0x24')]([_0xe0cd('0x13'),_0xe0cd('0x25'),_0xe0cd('0x26'),'ListId',_0x2ee91c,_0xe0cd('0x27'),_0xe0cd('0x28'),_0xe0cd('0x29'),_0xe0cd('0x2a'),_0xe0cd('0x2b')],squel['select']()[_0xe0cd('0x2c')](_0x371cf0)[_0xe0cd('0x14')](_0x5a9442)[_0xe0cd('0x15')](_0xe0cd('0x2d'),null,_0xe0cd('0x2e')+_0x5a9442+_0xe0cd('0x2f'))[_0xe0cd('0x15')](_0x2105c8,null,_0x2105c8+_0xe0cd('0x16')+_0x5a9442+'.'+_0x2ee91c)[_0xe0cd('0x17')](_0x5a9442+_0xe0cd('0x30'),_0x2cb996)[_0xe0cd('0x17')](_0xe0cd('0x31'),NOW)[_0xe0cd('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5a9442,_0x2105c8,_0x2ee91c,_0xe0cd('0x23'),[_0xe0cd('0x32'),_0xe0cd('0x33')]))['where'](_0xe0cd('0x34'),selectNotIn(_0x5a9442,_0x2105c8,_0x2ee91c,'cm_hopper',['\x22always\x22'])))[_0xe0cd('0x35')]();}function insertCmHopperBlack(_0x30b508,_0x1e8b9a,_0x10cd3a,_0x13c746){var _0x200283=['cm_contacts.phone',_0xe0cd('0x1c'),_0xe0cd('0x1d'),_0x1e8b9a+'.'+_0x13c746,_0xe0cd('0x1e'),'cm_contacts.updatedAt'];return squel[_0xe0cd('0x21')]()[_0xe0cd('0x22')](_0xe0cd('0x36'))['fromQuery']([_0xe0cd('0x13'),_0xe0cd('0x26'),_0xe0cd('0x37'),_0x13c746,'createdAt',_0xe0cd('0x28')],squel[_0xe0cd('0x11')]()[_0xe0cd('0x2c')](_0x200283)[_0xe0cd('0x14')](_0x1e8b9a)[_0xe0cd('0x15')](_0xe0cd('0x2d'),null,'cm_contacts.ListId\x20=\x20'+_0x1e8b9a+'.CmListId')[_0xe0cd('0x15')](_0x10cd3a,null,_0x10cd3a+'.id\x20=\x20'+_0x1e8b9a+'.'+_0x13c746)['where'](_0x1e8b9a+_0xe0cd('0x30'),_0x30b508)['where'](_0xe0cd('0x31'),NOW)[_0xe0cd('0x17')](_0xe0cd('0x34'),squel['select']()['field'](_0xe0cd('0x13'))['from']('cm_hopper_black')[_0xe0cd('0x17')]('ListId\x20=\x20?',_0x30b508)[_0xe0cd('0x17')](_0x13c746+'\x20=\x20?',_0x1e8b9a+'.'+_0x13c746)))['toString']();}function insertCmContact(_0x1145cc,_0x4ab2fb,_0xd04c58,_0x8e4256){var _0x1ebffa=_['concat'](_[_0xe0cd('0x38')](_0x8e4256),['ListId',_0xe0cd('0x39'),_0xe0cd('0x27'),_0xe0cd('0x28')]);return squel[_0xe0cd('0x21')]()[_0xe0cd('0x22')](_0xe0cd('0x2d'))['fromQuery'](_0x1ebffa,squel[_0xe0cd('0x11')]()['fields'](_0x1ebffa)[_0xe0cd('0x14')](_0x4ab2fb)[_0xe0cd('0x17')]('('+_0xd04c58['join'](',')+_0xe0cd('0x3a'),squel[_0xe0cd('0x11')]()[_0xe0cd('0x2c')](_0xd04c58)[_0xe0cd('0x14')]('cm_contacts')[_0xe0cd('0x17')](_0xe0cd('0x3b'),_0x1145cc)['where'](_0xe0cd('0x3c')))[_0xe0cd('0x17')](_0xe0cd('0x3d'),squel[_0xe0cd('0x11')]()[_0xe0cd('0x12')]('MIN(id)',_0xe0cd('0x3e'))[_0xe0cd('0x14')](_0x4ab2fb)['group'](_0xd04c58[_0xe0cd('0x15')](','))))[_0xe0cd('0x35')]();}function handleStop(){logger['info'](_0xe0cd('0x3f'));stopped=!![];}function handleUncaughtException(_0x5e6eab){logger[_0xe0cd('0x40')](_0x5e6eab[_0xe0cd('0x41')]);process[_0xe0cd('0x42')](0x1);}function handleError(_0xeafb62,_0x19277c){stats[_0xe0cd('0x43')][_0xe0cd('0x44')]({'name':_0x19277c[_0xe0cd('0x45')],'message':_0x19277c[_0xe0cd('0x41')],'row':_0xeafb62});}function handleQuery(_0x38c106){logger[_0xe0cd('0x46')](_0x38c106);return db['sequelize'][_0xe0cd('0x47')](_0x38c106)['spread'](function(_0x2e1fc0){results[_0xe0cd('0x44')](_0x2e1fc0);})[_0xe0cd('0x48')](function(_0x2b9069){logger['error'](_0x2b9069[_0xe0cd('0x41')]);});}function main(_0x5d1444,_0x56faec,_0x4aab4c,_0x1316ee){logger[_0xe0cd('0x46')](_0xe0cd('0x49'),_0x5d1444,JSON[_0xe0cd('0x4a')](_0x56faec));process[_0xe0cd('0x4b')](_0xe0cd('0x4c'));var _0x5207d2=_0x56faec[_0xe0cd('0x4d')];var _0x39249b=_0x56faec['socket_timestamp'];var _0xd13ca1=path['join'](config[_0xe0cd('0x4e')],_0xe0cd('0x4f'),_0x39249b+_0xe0cd('0x50'));var _0x8c2d4d=_['keys'](_0x5207d2)['join']();logger[_0xe0cd('0x46')]('header',_0x8c2d4d);fs[_0xe0cd('0x51')](_0xd13ca1,_0x8c2d4d+'\x0a');Papa['parse'](fs[_0xe0cd('0x52')](_0x5d1444),{'header':!![],'skipEmptyLines':!![],'step':function(_0x16189c,_0x15cf73){try{for(var _0x15d9e8=0x0,_0xa6c415=[];_0x15d9e8<_0x16189c[_0xe0cd('0x53')][_0xe0cd('0x54')];_0x15d9e8++){stats[_0xe0cd('0x55')]+=0x1;if(_0x16189c[_0xe0cd('0x43')][_0x15d9e8]){handleError(_0x16189c[_0xe0cd('0x53')][_0x15d9e8],_0x16189c[_0xe0cd('0x43')][_0x15d9e8]);}else{var _0x17a6dc=[];for(var _0x4d52b3 in _0x5207d2){if(_0x5207d2[_0xe0cd('0x56')](_0x4d52b3)){if(_0x16189c[_0xe0cd('0x53')][_0x15d9e8][_0x5207d2[_0x4d52b3]]){var _0x269f6f=_[_0xe0cd('0x57')](_0x16189c[_0xe0cd('0x53')][_0x15d9e8][_0x5207d2[_0x4d52b3]]['replace'](/"/g,'\x27'));switch(_0x4d52b3){case _0xe0cd('0x25'):var _0x1eab3d=moment(_0x269f6f,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1eab3d['isValid']()){_0xa6c415['push']('\x22'+_0x269f6f+'\x22');}else{_0x17a6dc[_0xe0cd('0x44')](_0xe0cd('0x58'));}break;case _0xe0cd('0x29'):var _0x103087=parseInt(_0x269f6f);_0x269f6f=_[_0xe0cd('0x59')](_0x103087)||_0x103087<0x0||_0x103087>0x4?_0x1316ee?0x3:0x2:_0x103087;_0xa6c415['push']('\x22'+_0x269f6f+'\x22');break;case'UserId':var _0x2fd5a7=parseInt(_0x269f6f);if(_[_0xe0cd('0x5a')](_0x2fd5a7)&&_[_0xe0cd('0x5b')](_0x4aab4c,_0x2fd5a7)){_0xa6c415['push']('\x22'+_0x2fd5a7+'\x22');}else{_0x17a6dc[_0xe0cd('0x44')]('agent\x20not\x20exists');}break;case _0xe0cd('0x5c'):if(isEmail(_0x269f6f)){_0xa6c415[_0xe0cd('0x44')]('\x22'+_0x269f6f+'\x22');}else{_0x17a6dc['push'](_0xe0cd('0x5d'));}break;case _0xe0cd('0x5e'):var _0x25b70b=moment(_0x269f6f,_0xe0cd('0x5f'),!![]);if(_0x25b70b[_0xe0cd('0x60')]()){_0xa6c415[_0xe0cd('0x44')]('\x22'+_0x269f6f+'\x22');}else{_0x17a6dc[_0xe0cd('0x44')](_0xe0cd('0x61'));}break;default:_0xa6c415['push']('\x22'+_0x269f6f+'\x22');}}else{switch(_0x4d52b3){case'firstName':case _0xe0cd('0x13'):_0x17a6dc['push'](_0x4d52b3+'\x20not\x20specified');break;default:_0xa6c415[_0xe0cd('0x44')]('\x22\x22');}}}}if(_0x17a6dc['length']){handleError(_0x16189c[_0xe0cd('0x53')][_0x15d9e8],{'code':'SystemRow','message':_0x17a6dc[_0xe0cd('0x15')]()});}else{fs[_0xe0cd('0x62')](_0xd13ca1,_0xa6c415[_0xe0cd('0x15')]()+'\x0a');}_0xa6c415=[];}if(!(stats['rows']%0xc8)){socket[_0xe0cd('0x63')](_0xe0cd('0x64')+_0x39249b,stats);stats[_0xe0cd('0x43')]=[];}}if(stopped){logger[_0xe0cd('0x46')]('Abort\x20parser');_0x15cf73[_0xe0cd('0x65')]();}}catch(_0x18ab77){handleError(_0x16189c[_0xe0cd('0x53')][_0x15d9e8],{'code':'SystemError','message':_0x18ab77[_0xe0cd('0x41')]});logger[_0xe0cd('0x40')](_0xe0cd('0x66'),_0x18ab77[_0xe0cd('0x41')]);}},'complete':function(){try{var _0x195cd2=[];var _0x18055e=_0xe0cd('0x2d');if(_0x56faec['duplicates']&&_0x56faec['duplicates'][_0xe0cd('0x54')]){_0x18055e=_0xe0cd('0x67')+_0x39249b;_0x195cd2[_0xe0cd('0x44')](_0xe0cd('0x68')+_0x18055e+_0xe0cd('0x69'));}var _0x3f0a5c=util[_0xe0cd('0xe')]('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',_0xd13ca1,_0x18055e,_0x8c2d4d,_0x56faec[_0xe0cd('0x37')],_0x56faec[_0xe0cd('0x39')]||null,NOW,NOW);if(_[_0xe0cd('0x6a')](_0x5207d2[_0xe0cd('0x25')])){_0x3f0a5c+=_0xe0cd('0x6b');}_0x195cd2[_0xe0cd('0x44')](_0x3f0a5c);if(_0x56faec[_0xe0cd('0x6c')]&&_0x56faec['duplicates']['length']){_0x195cd2['push'](insertCmContact(_0x56faec[_0xe0cd('0x37')],_0x18055e,_0x56faec['duplicates'],_0x5207d2));_0x195cd2['push'](_0xe0cd('0x6d')+_0x18055e+';');}_0x195cd2[_0xe0cd('0x44')](insertCmHopper(_0x56faec[_0xe0cd('0x37')],'voice_queues_has_cm_lists',_0xe0cd('0x6e'),_0xe0cd('0x6f'),_0x1316ee));_0x195cd2['push'](insertCmHopperBlack(_0x56faec['ListId'],_0xe0cd('0x70'),'voice_queues',_0xe0cd('0x6f')));_0x195cd2[_0xe0cd('0x44')](insertCmHopper(_0x56faec['ListId'],_0xe0cd('0x71'),_0xe0cd('0x72'),_0xe0cd('0x73'),_0x1316ee));_0x195cd2[_0xe0cd('0x44')](insertCmHopperBlack(_0x56faec[_0xe0cd('0x37')],_0xe0cd('0x74'),_0xe0cd('0x72'),_0xe0cd('0x73')));BPromise[_0xe0cd('0x75')](_0x195cd2,handleQuery)[_0xe0cd('0x76')](function(_0x8eab32){stats['finish']=!![];stats['affectedRows']=_0x56faec[_0xe0cd('0x6c')]&&_0x56faec[_0xe0cd('0x6c')][_0xe0cd('0x54')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0xe0cd('0x63')]('contact:import:'+_0x39249b,stats);fs[_0xe0cd('0x77')](_0x5d1444);fs['unlink'](_0xd13ca1);process['exit'](0x0);})['catch'](function(_0x235599){logger['error'](_0x235599['message']);process['exit'](0x1);});}catch(_0x5ea9e6){logger['error'](_0xe0cd('0x78'),_0x5ea9e6[_0xe0cd('0x41')]);process[_0xe0cd('0x42')](0x1);}},'error':function(_0x2eb6aa,_0x580ee2,_0x313b02,_0xb656e3){throw new Error(_0xb656e3);}});}function validate(){if(process[_0xe0cd('0x79')]&&process[_0xe0cd('0x79')][_0xe0cd('0x54')]<0x4){throw new Error(_0xe0cd('0x7a'));}var _0x20e55a=path['join'](config[_0xe0cd('0x4e')],_0xe0cd('0x4f'),process[_0xe0cd('0x79')][0x2]);if(!fs[_0xe0cd('0x7b')](_0x20e55a)){throw new Error(_0xe0cd('0x7c'));}var _0xede87a={};try{_0xede87a=JSON[_0xe0cd('0x7d')](process[_0xe0cd('0x79')][0x3]);if(!_0xede87a[_0xe0cd('0x4d')]){throw new Error(_0xe0cd('0x7e'));}if(!_0xede87a[_0xe0cd('0x4d')][_0xe0cd('0x13')]){throw new Error(_0xe0cd('0x7f'));}if(!_0xede87a[_0xe0cd('0x4d')][_0xe0cd('0x80')]){throw new Error('firstName\x20is\x20mandatory');}var _0x39b5c9=0x0;if(_0xede87a[_0xe0cd('0x4d')][_0xe0cd('0x2a')]){_0x39b5c9=0x1;}if(!_0xede87a[_0xe0cd('0x37')]){throw new Error(_0xe0cd('0x81'));}}catch(_0x20979c){throw new Error(_0xe0cd('0x82'));}var _0x230258=[];try{_0x230258=_['map'](JSON['parse'](process[_0xe0cd('0x79')][0x4]),'id');}catch(_0x17ee7c){logger[_0xe0cd('0x46')](_0xe0cd('0x83'));}main(_0x20e55a,_0xede87a,_0x230258,_0x39b5c9);}validate();process['on'](_0xe0cd('0x84'),handleStop);process['on'](_0xe0cd('0x85'),handleUncaughtException);
\ No newline at end of file
index 1e3c388..d9e4675 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe98a=['getSubjects','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','push','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','calleridname','Call\x20To','destexten','UniqueId','Date','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','talktime','Member\x20Name','membername','uniqueid','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds'];(function(_0x17ab69,_0x531650){var _0x366e83=function(_0x418485){while(--_0x418485){_0x17ab69['push'](_0x17ab69['shift']());}};_0x366e83(++_0x531650);}(_0xe98a,0x7e));var _0xae98=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0xe98a[_0x1f83a5];return _0x45edf0;};'use strict';exports[_0xae98('0x0')]=function(_0x207271,_0x357b13){var _0xbfbf37=[{'type':_0xae98('0x1'),'content':_0xae98('0x2'),'variableName':null}];switch(_0x207271['toLowerCase']()){case _0xae98('0x3'):switch(_0x357b13[_0xae98('0x4')]()){case _0xae98('0x5'):_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':'queue'});_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':_0xae98('0x8')});break;case _0xae98('0x9'):_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x1'),'content':'Outbound\x20Call','variableName':null});_0xbfbf37[_0xae98('0x6')]({'type':_0xae98('0x7'),'content':'','variableName':_0xae98('0xa')});break;}}return _0xbfbf37;};exports[_0xae98('0xb')]=function(_0x21dff0,_0x5c8c33){var _0x477ddd=[];switch(_0x21dff0['toLowerCase']()){case _0xae98('0x3'):switch(_0x5c8c33['toLowerCase']()){case _0xae98('0x5'):_0x477ddd=[{'type':_0xae98('0x1'),'content':_0xae98('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0xe'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x8')},{'type':_0xae98('0xd'),'content':'','key':'Caller\x20Name','keyType':_0xae98('0x7'),'variableName':_0xae98('0xf')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x10'),'keyType':'variable','variableName':_0xae98('0x11')},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x12'),'keyType':'variable','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xae98('0x13'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xae98('0xd'),'content':'','key':'Agent\x20Name','keyType':_0xae98('0x7'),'variableName':_0xae98('0x14')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x15'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0xa')},{'type':'string','content':_0xae98('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xae98('0x17'),'keyType':'variable','variableName':_0xae98('0x18')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x19'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x1a')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x1b'),'keyType':_0xae98('0x7'),'variableName':_0xae98('0x1c')},{'type':_0xae98('0xd'),'content':'','key':'Hold\x20Time','keyType':_0xae98('0x7'),'variableName':_0xae98('0x1d')},{'type':_0xae98('0xd'),'content':'','key':'Talk\x20Time','keyType':_0xae98('0x7'),'variableName':_0xae98('0x1e')}];break;case _0xae98('0x9'):_0x477ddd=[{'type':_0xae98('0x1'),'content':_0xae98('0xc'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0xa')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x1f'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x20')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x12'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x21')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x13'),'keyType':'variable','keyContent':'','variableName':_0xae98('0x22')},{'type':'string','content':_0xae98('0x16')},{'type':_0xae98('0xd'),'content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xae98('0x23')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x24'),'keyType':'variable','keyContent':'','variableName':_0xae98('0x25')},{'type':'keyValue','content':'','key':_0xae98('0x26'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x27')},{'type':_0xae98('0xd'),'content':'','key':_0xae98('0x28'),'keyType':_0xae98('0x7'),'keyContent':'','variableName':_0xae98('0x29')}];break;}}return _0x477ddd;};
\ No newline at end of file
+var _0x7c96=['agentcompleteAt','talktime','Member\x20Name','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','inbound','push','queue','calleridnum','outbound','variable','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','string','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete'];(function(_0x1feefe,_0x2018ad){var _0x56471a=function(_0x8745df){while(--_0x8745df){_0x1feefe['push'](_0x1feefe['shift']());}};_0x56471a(++_0x2018ad);}(_0x7c96,0xdd));var _0x67c9=function(_0x3f4891,_0x4e6f62){_0x3f4891=_0x3f4891-0x0;var _0x54f2d8=_0x7c96[_0x3f4891];return _0x54f2d8;};'use strict';exports[_0x67c9('0x0')]=function(_0x213c2f,_0x59728f){var _0x1716a5=[{'type':'string','content':_0x67c9('0x1'),'variableName':null}];switch(_0x213c2f[_0x67c9('0x2')]()){case'voice':switch(_0x59728f[_0x67c9('0x2')]()){case _0x67c9('0x3'):_0x1716a5[_0x67c9('0x4')]({'type':'variable','content':'','variableName':_0x67c9('0x5')});_0x1716a5[_0x67c9('0x4')]({'type':'variable','content':'','variableName':_0x67c9('0x6')});break;case _0x67c9('0x7'):_0x1716a5[_0x67c9('0x4')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x1716a5[_0x67c9('0x4')]({'type':_0x67c9('0x8'),'content':'','variableName':_0x67c9('0x9')});break;}}return _0x1716a5;};exports['getDescriptions']=function(_0x223598,_0x25d905){var _0x2bdb84=[];switch(_0x223598[_0x67c9('0x2')]()){case'voice':switch(_0x25d905[_0x67c9('0x2')]()){case _0x67c9('0x3'):_0x2bdb84=[{'type':'string','content':_0x67c9('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0xc'),'keyType':'variable','variableName':_0x67c9('0x6')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0xd'),'keyType':'variable','variableName':_0x67c9('0xe')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0xf'),'keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x10')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x11'),'keyType':'variable','variableName':_0x67c9('0x5')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x12'),'keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x13')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x14'),'keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x15')},{'type':'string','content':_0x67c9('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x67c9('0xb'),'content':'','key':'Agent\x20Name','keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x17')},{'type':'keyValue','content':'','key':_0x67c9('0x18'),'keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x9')},{'type':_0x67c9('0x19'),'content':_0x67c9('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x1b'),'keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x15')},{'type':'keyValue','content':'','key':_0x67c9('0x1c'),'keyType':'variable','variableName':_0x67c9('0x1d')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x1e'),'keyType':'variable','variableName':_0x67c9('0x1f')},{'type':_0x67c9('0xb'),'content':'','key':'Hold\x20Time','keyType':_0x67c9('0x8'),'variableName':'holdtime'},{'type':_0x67c9('0xb'),'content':'','key':'Talk\x20Time','keyType':_0x67c9('0x8'),'variableName':_0x67c9('0x20')}];break;case _0x67c9('0x7'):_0x2bdb84=[{'type':'string','content':_0x67c9('0xa'),'variableName':null},{'type':_0x67c9('0xb'),'content':'','key':'Called\x20Number','keyType':_0x67c9('0x8'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x21'),'keyType':_0x67c9('0x8'),'keyContent':'','variableName':'membername'},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x12'),'keyType':'variable','keyContent':'','variableName':_0x67c9('0x13')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x14'),'keyType':'variable','keyContent':'','variableName':_0x67c9('0x22')},{'type':_0x67c9('0x19'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x23'),'keyType':'variable','keyContent':'','variableName':_0x67c9('0x24')},{'type':_0x67c9('0xb'),'content':'','key':_0x67c9('0x25'),'keyType':_0x67c9('0x8'),'keyContent':'','variableName':_0x67c9('0x26')},{'type':'keyValue','content':'','key':_0x67c9('0x27'),'keyType':_0x67c9('0x8'),'keyContent':'','variableName':_0x67c9('0x28')},{'type':_0x67c9('0xb'),'content':'','key':'Billable\x20Time','keyType':_0x67c9('0x8'),'keyContent':'','variableName':_0x67c9('0x29')}];break;}}return _0x2bdb84;};
\ No newline at end of file
index 9391757..a380d05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x275f=['role','stringify','null','findOne','then','update','info','catch','error','tracked','user','body','html','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','InteractionId','upperFirst','unknown','toLowerCase','toUpperCase','name'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0x275f,0x193));var _0xf275=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x275f[_0x715d76];return _0x48fe88;};'use strict';var _=require(_0xf275('0x0'));var db=require(_0xf275('0x1'))['db'];var loggers={'openchannel':require(_0xf275('0x2'))(_0xf275('0x3')),'mail':require('../../config/logger')(_0xf275('0x4')),'fax':require('../../config/logger')(_0xf275('0x5')),'sms':require(_0xf275('0x2'))(_0xf275('0x6')),'chat':require(_0xf275('0x2'))('chat-interactions'),'whatsapp':require(_0xf275('0x2'))('whatsapp-interactions')};function getInteractionId(_0x1ded5d,_0x329843,_0x419281){if(_0x1ded5d&&_0x1ded5d[_['upperFirst'](_0x419281)+_0xf275('0x7')]){return _0x1ded5d[_[_0xf275('0x8')](_0x419281)+_0xf275('0x7')];}else if(_0x1ded5d&&_0x1ded5d['id']){return _0x1ded5d['id'];}else if(_0x329843&&_0x329843['id']){return _0x329843['id'];}else{return _0xf275('0x9');}}function log(_0x2a88e1,_0x46aa34,_0x2af4fa,_0x521dc7,_0xa885f7,_0x199387){loggers[_0xa885f7[_0xf275('0xa')]()][_0x2a88e1]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x199387[_0xf275('0xb')](),_0x46aa34?_0x46aa34['id']:null,_0x46aa34?_0x46aa34[_0xf275('0xc')]:null,_0x46aa34?_0x46aa34[_0xf275('0xd')]:null,getInteractionId(_0x2af4fa,_0x521dc7,_0xa885f7),_0x2af4fa?JSON[_0xf275('0xe')](_0x2af4fa):_0xf275('0xf'));}function updateUser(_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521){db[_[_0xf275('0x8')](_0x4d64e2)+'Interaction'][_0xf275('0x10')]({'where':{'id':getInteractionId(_0x4e8385,_0x12379f,_0x4d64e2)}})[_0xf275('0x11')](function(_0x1bff13){if(_0x1bff13){return _0x1bff13[_0xf275('0x12')]({'UserId':_0x3bdb4c?_0x3bdb4c['id']:null});}})[_0xf275('0x11')](function(_0x1e374e){if(_0x1e374e){log(_0xf275('0x13'),_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521);}})[_0xf275('0x14')](function(){log(_0xf275('0x15'),_0x3bdb4c,_0x4e8385,_0x12379f,_0x4d64e2,_0x333521);});}exports[_0xf275('0x16')]=function(_0x5ec890,_0x4d9a87){return function(_0x59fdec,_0x175b4d,_0x5e5319){var _0x5e3f1b=_0x59fdec[_0xf275('0x17')];var _0x1a32b2={};var _0x2016c0=_0x59fdec['query'];if(_0x1a32b2){_0x1a32b2=_['clone'](_0x59fdec[_0xf275('0x18')]);_0x1a32b2=_['omit'](_0x1a32b2,[_0xf275('0x18'),_0xf275('0x19'),'phone','fax','mobile']);}updateUser(_0x5e3f1b,_0x1a32b2,_0x2016c0,_0x5ec890,_0x4d9a87);_0x5e5319(null);};};
\ No newline at end of file
+var _0xeda0=['body','omit','html','phone','fax','mobile','lodash','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','findOne','then','update','info','error','tracked','user','query','clone'];(function(_0x5d808e,_0x5b6758){var _0x2421fe=function(_0x25c07d){while(--_0x25c07d){_0x5d808e['push'](_0x5d808e['shift']());}};_0x2421fe(++_0x5b6758);}(_0xeda0,0x97));var _0x0eda=function(_0x56e164,_0x12456e){_0x56e164=_0x56e164-0x0;var _0x19cbca=_0xeda0[_0x56e164];return _0x19cbca;};'use strict';var _=require(_0x0eda('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0eda('0x1'))(_0x0eda('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0x0eda('0x1'))('fax-interactions'),'sms':require(_0x0eda('0x1'))(_0x0eda('0x3')),'chat':require(_0x0eda('0x1'))(_0x0eda('0x4')),'whatsapp':require(_0x0eda('0x1'))(_0x0eda('0x5'))};function getInteractionId(_0x1cbbe8,_0x210ca3,_0x4ed499){if(_0x1cbbe8&&_0x1cbbe8[_[_0x0eda('0x6')](_0x4ed499)+_0x0eda('0x7')]){return _0x1cbbe8[_[_0x0eda('0x6')](_0x4ed499)+_0x0eda('0x7')];}else if(_0x1cbbe8&&_0x1cbbe8['id']){return _0x1cbbe8['id'];}else if(_0x210ca3&&_0x210ca3['id']){return _0x210ca3['id'];}else{return'unknown';}}function log(_0x1a8f23,_0x288fda,_0x5eb9a7,_0x17ced6,_0x3f62c3,_0x23c7ea){loggers[_0x3f62c3[_0x0eda('0x8')]()][_0x1a8f23](_0x0eda('0x9'),_0x23c7ea[_0x0eda('0xa')](),_0x288fda?_0x288fda['id']:null,_0x288fda?_0x288fda['name']:null,_0x288fda?_0x288fda[_0x0eda('0xb')]:null,getInteractionId(_0x5eb9a7,_0x17ced6,_0x3f62c3),_0x5eb9a7?JSON[_0x0eda('0xc')](_0x5eb9a7):_0x0eda('0xd'));}function updateUser(_0x34ae4f,_0x330cff,_0x4a2a23,_0x43b0ec,_0xdcc396){db[_['upperFirst'](_0x43b0ec)+'Interaction'][_0x0eda('0xe')]({'where':{'id':getInteractionId(_0x330cff,_0x4a2a23,_0x43b0ec)}})[_0x0eda('0xf')](function(_0x326f9c){if(_0x326f9c){return _0x326f9c[_0x0eda('0x10')]({'UserId':_0x34ae4f?_0x34ae4f['id']:null});}})[_0x0eda('0xf')](function(_0x2e19cc){if(_0x2e19cc){log(_0x0eda('0x11'),_0x34ae4f,_0x330cff,_0x4a2a23,_0x43b0ec,_0xdcc396);}})['catch'](function(){log(_0x0eda('0x12'),_0x34ae4f,_0x330cff,_0x4a2a23,_0x43b0ec,_0xdcc396);});}exports[_0x0eda('0x13')]=function(_0x30b4b3,_0x3db87d){return function(_0x3db534,_0x522829,_0x301308){var _0x28131d=_0x3db534[_0x0eda('0x14')];var _0x52198e={};var _0x17c23a=_0x3db534[_0x0eda('0x15')];if(_0x52198e){_0x52198e=_[_0x0eda('0x16')](_0x3db534[_0x0eda('0x17')]);_0x52198e=_[_0x0eda('0x18')](_0x52198e,[_0x0eda('0x17'),_0x0eda('0x19'),_0x0eda('0x1a'),_0x0eda('0x1b'),_0x0eda('0x1c')]);}updateUser(_0x28131d,_0x52198e,_0x17c23a,_0x30b4b3,_0x3db87d);_0x301308(null);};};
\ No newline at end of file
index d412732..c3f00e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x885a=['status','admin','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','then','count'];(function(_0x3bc89f,_0x317b1a){var _0x1c764c=function(_0x22fec1){while(--_0x22fec1){_0x3bc89f['push'](_0x3bc89f['shift']());}};_0x1c764c(++_0x317b1a);}(_0x885a,0x14d));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0xa885('0x0'));var util=require('util');var compose=require(_0xa885('0x1'));var db=require(_0xa885('0x2'))['db'];var config=require(_0xa885('0x3'));function getValueFromLicense(_0x5a7411,_0x44b41d){if(_0x5a7411&&_0x44b41d){if(_0x44b41d[_0xa885('0x4')]&&_0x44b41d[_0xa885('0x5')]){var _0x177cd5=_0x44b41d[_0xa885('0x4')];var _0x119686=_0x44b41d[_0xa885('0x5')];var _0x5ac179=_0x177cd5['split']('-')[0x4];var _0x2a136c=_0x177cd5['split']('-')[0x0];var _0x2bb864=crypto[_0xa885('0x6')](_0xa885('0x7'),util[_0xa885('0x8')](_0xa885('0x9'),_0x5ac179,_0x177cd5,_0x2a136c));var _0x70a8ab=_0x2bb864['update'](_0x119686,_0xa885('0xa'),_0xa885('0xb'));_0x70a8ab+=_0x2bb864[_0xa885('0xc')]('utf8');var _0x315064=JSON[_0xa885('0xd')](_0x70a8ab);return _0x315064[_0xa885('0xe')](_0x5a7411)?_0x315064[_0x5a7411]:null;}}return null;}function isLimit(_0xadc12f,_0x3b4371,_0x311fcf,_0x19371d){var _0xf5985a=_0x3b4371;return compose()[_0xa885('0xf')](function(_0x5f2c20,_0x53fa32,_0x10859d){return db[_0xa885('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xa885('0x11')](function(_0x3a5274){var _0x15e6c9=getValueFromLicense(_0xadc12f,_0x3a5274);return _0x15e6c9?_0x15e6c9:_0xf5985a;})[_0xa885('0x11')](function(_0x13fbd6){_0xf5985a=_0x13fbd6;return _0x311fcf[_0xa885('0x12')](_0x19371d);})[_0xa885('0x11')](function(_0x4355e5){if(_0x4355e5>=_0xf5985a){return _0x53fa32[_0xa885('0x13')](0x193)['json']({'message':util[_0xa885('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xadc12f)});}_0x10859d();})['catch'](function(_0x4fd721){_0x10859d(_0x4fd721);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0xa885('0x14')},{'role':'user'}]}});}exports[_0xa885('0x15')]=isUserLimit;
\ No newline at end of file
+var _0x568a=['then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','findOne'];(function(_0x1d7a7e,_0x25346e){var _0x48e207=function(_0x3c71ab){while(--_0x3c71ab){_0x1d7a7e['push'](_0x1d7a7e['shift']());}};_0x48e207(++_0x25346e);}(_0x568a,0xcd));var _0xa568=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x568a[_0xe66cf2];return _0x2d84e7;};'use strict';var crypto=require(_0xa568('0x0'));var util=require(_0xa568('0x1'));var compose=require(_0xa568('0x2'));var db=require(_0xa568('0x3'))['db'];var config=require(_0xa568('0x4'));function getValueFromLicense(_0x484b48,_0x51c3b8){if(_0x484b48&&_0x51c3b8){if(_0x51c3b8['data1']&&_0x51c3b8[_0xa568('0x5')]){var _0x4d18f9=_0x51c3b8['data1'];var _0x4bad2b=_0x51c3b8[_0xa568('0x5')];var _0x35d561=_0x4d18f9[_0xa568('0x6')]('-')[0x4];var _0x1cf69c=_0x4d18f9['split']('-')[0x0];var _0x2643d9=crypto[_0xa568('0x7')](_0xa568('0x8'),util[_0xa568('0x9')](_0xa568('0xa'),_0x35d561,_0x4d18f9,_0x1cf69c));var _0x56cd4b=_0x2643d9[_0xa568('0xb')](_0x4bad2b,_0xa568('0xc'),_0xa568('0xd'));_0x56cd4b+=_0x2643d9[_0xa568('0xe')]('utf8');var _0x1c81ef=JSON[_0xa568('0xf')](_0x56cd4b);return _0x1c81ef[_0xa568('0x10')](_0x484b48)?_0x1c81ef[_0x484b48]:null;}}return null;}function isLimit(_0x28270e,_0x34c8cd,_0x1126a1,_0x214324){var _0x5aa83b=_0x34c8cd;return compose()['use'](function(_0x26c892,_0x9fc55d,_0x21b122){return db[_0xa568('0x11')][_0xa568('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xa568('0x13')](function(_0x3c9771){var _0x4a22bd=getValueFromLicense(_0x28270e,_0x3c9771);return _0x4a22bd?_0x4a22bd:_0x5aa83b;})['then'](function(_0x2b1cff){_0x5aa83b=_0x2b1cff;return _0x1126a1[_0xa568('0x14')](_0x214324);})[_0xa568('0x13')](function(_0x151d51){if(_0x151d51>=_0x5aa83b){return _0x9fc55d[_0xa568('0x15')](0x193)['json']({'message':util[_0xa568('0x9')](_0xa568('0x16'),_0x28270e)});}_0x21b122();})[_0xa568('0x17')](function(_0x2b55df){_0x21b122(_0x2b55df);});});}function isUserLimit(){return isLimit(_0xa568('0x18'),0x1,db[_0xa568('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0xa568('0x1a')}]}});}exports[_0xa568('0x1b')]=isUserLimit;
\ No newline at end of file
index 5aca7c1..064eb29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xace4=['pop','DATE','utcOffset','minutes','seconds','lodash','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','match','filter','indexOf','conditions','push','$eq','operator','$between','includes','$gt','$lte','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$in','start','$substring','shift'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xace4,0x75));var _0x4ace=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xace4[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x4ace('0x0'));var moment=require('moment');exports[_0x4ace('0x1')]=function(_0x21c61f){var _0x582c82={'conditions':[]};_0x582c82[_0x4ace('0x2')]=_[_0x4ace('0x3')](_0x21c61f,_0x4ace('0x4'))?'or':_0x4ace('0x5');var _0x42f972=_0x21c61f[_0x4ace('0x6')](_0x4ace('0x7'),'')[_0x4ace('0x6')](_0x4ace('0x4'),'')[_0x4ace('0x8')]('||');for(var _0x319b5f=0x0;_0x319b5f<_0x42f972['length'];_0x319b5f++){var _0x56421f=_0x42f972[_0x319b5f]['split'](':=');var _0x54b2f9=_0x56421f[0x0];var _0x3deaa2=_0x56421f[_0x4ace('0x9')](0x1);_0x3deaa2[_0x4ace('0xa')](function(_0x2278fe){var _0x1cd443=_0x2278fe[_0x4ace('0x8')]('[')['shift']();var _0x25144a=_0x2278fe[_0x4ace('0xb')](/\[(.*?)\]/g);_0x25144a[_0x4ace('0xa')](function(_0x49cbee){var _0x9465a8=_0x49cbee[_0x4ace('0x8')]('[')[_0x4ace('0xc')](function(_0x40296f){return _0x40296f[_0x4ace('0xd')](']')>-0x1;})['map'](function(_0x1e58df){return _0x1e58df[_0x4ace('0x8')](']')[0x0];})[0x0];_0x582c82[_0x4ace('0xe')][_0x4ace('0xf')]({'field':_0x54b2f9,'operator':_0x1cd443,'value':_0x9465a8});});});}return _0x582c82;};exports['buildExpression']=function(_0x34ac6f,_0x4e8234,_0x5b1875){var _0x15c967={};if(_0x4e8234==='DATE'){if(_0x5b1875['operator']===_0x4ace('0x10')){_0x5b1875[_0x4ace('0x11')]=_0x4ace('0x12');_0x5b1875['value']+=','+_0x5b1875['value'];}else if(_[_0x4ace('0x13')]([_0x4ace('0x14'),_0x4ace('0x15')],_0x5b1875[_0x4ace('0x11')])){_0x5b1875[_0x4ace('0x16')]=moment(_0x5b1875[_0x4ace('0x16')])[_0x4ace('0x17')](0x1,_0x4ace('0x18'))[_0x4ace('0x19')](_0x4ace('0x1a'));}}if(_0x5b1875[_0x4ace('0x1b')]){_0x4e8234=_0x5b1875[_0x4ace('0x1b')];_0x15c967[_0x4ace('0x1c')]=_0x4ace('0x1d')+_0x34ac6f+'.'+_0x5b1875[_0x4ace('0x1e')]+_0x4ace('0x1f')+_0x5b1875[_0x4ace('0x1b')]+')\x20'+parseOperator(_0x5b1875[_0x4ace('0x11')]);}else{_0x15c967[_0x4ace('0x1c')]=_0x34ac6f+'.'+_0x5b1875[_0x4ace('0x1e')]+'\x20'+parseOperator(_0x5b1875[_0x4ace('0x11')]);}if(_[_0x4ace('0x13')]([_0x4ace('0x20'),_0x4ace('0x21')],_0x5b1875[_0x4ace('0x11')]))_0x15c967[_0x4ace('0x1c')]='('+_0x15c967[_0x4ace('0x1c')]+_0x4ace('0x22')+_0x34ac6f+'.'+_0x5b1875['field']+_0x4ace('0x23');_0x15c967['value']=parseValue(_0x4e8234,_0x5b1875[_0x4ace('0x11')],_0x5b1875[_0x4ace('0x16')]);return _0x15c967;};function parseOperator(_0x2c28f2){var _0x844c01;switch(_0x2c28f2){case'$in':_0x844c01=_0x4ace('0x24');break;case _0x4ace('0x21'):_0x844c01=_0x4ace('0x25');break;case _0x4ace('0x10'):_0x844c01=_0x4ace('0x26');break;case'$ne':_0x844c01='<>\x20?';break;case'$substring':case _0x4ace('0x27'):case _0x4ace('0x28'):_0x844c01='LIKE\x20?';break;case _0x4ace('0x29'):_0x844c01=_0x4ace('0x2a');break;case _0x4ace('0x14'):_0x844c01=_0x4ace('0x2b');break;case _0x4ace('0x15'):_0x844c01=_0x4ace('0x2c');break;case _0x4ace('0x2d'):_0x844c01=_0x4ace('0x2e');break;case'$between':_0x844c01='BETWEEN\x20?\x20AND\x20?';break;}return _0x844c01;}function parseValue(_0x1adc7e,_0x566aff,_0x140702){var _0xf633b6={'start':undefined,'end':undefined};switch(_0x566aff){case _0x4ace('0x2f'):case _0x4ace('0x21'):_0xf633b6[_0x4ace('0x30')]=_0x140702['split'](',');break;case _0x4ace('0x31'):_0xf633b6['start']='%'+_0x140702+'%';break;case'$startsWith':_0xf633b6[_0x4ace('0x30')]=_0x140702+'%';break;case _0x4ace('0x28'):_0xf633b6[_0x4ace('0x30')]='%'+_0x140702;break;case _0x4ace('0x12'):var _0x1ec876=_0x140702[_0x4ace('0x8')](',');var _0x140702=_0x1ec876[_0x4ace('0x32')]();var _0xd82d83=_0x1ec876[_0x4ace('0x33')]();if(_0x1adc7e===_0x4ace('0x34')){_0x140702=moment(_0x140702)[_0x4ace('0x35')](0x0,!![])[_0x4ace('0x19')]();_0xd82d83=moment(_0xd82d83)['utcOffset'](0x0,!![])[_0x4ace('0x17')](0x17,'hours')[_0x4ace('0x17')](0x3b,_0x4ace('0x36'))['add'](0x3b,_0x4ace('0x37'))[_0x4ace('0x19')]();}_0xf633b6={'start':_0x140702,'end':_0xd82d83};break;default:_0xf633b6['start']=_0x140702;break;}return _0xf633b6;}
\ No newline at end of file
+var _0x1c67=['forEach','match','filter','indexOf','map','conditions','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','add','format','YYYY-MM-DD','CAST(','\x20AS\x20','castTo','text','field','$notIn','\x20IS\x20NULL)','$in','IN\x20?','=\x20?','$ne','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$substring','$startsWith','start','shift','pop','DATE','utcOffset','minutes','lodash','parseSearch','startsWith','[$or]','and','replace','split','length'];(function(_0x26a48b,_0x217119){var _0xec7971=function(_0x34f5c4){while(--_0x34f5c4){_0x26a48b['push'](_0x26a48b['shift']());}};_0xec7971(++_0x217119);}(_0x1c67,0x97));var _0x71c6=function(_0x431790,_0x4f6512){_0x431790=_0x431790-0x0;var _0x381a9c=_0x1c67[_0x431790];return _0x381a9c;};'use strict';var _=require(_0x71c6('0x0'));var moment=require('moment');exports[_0x71c6('0x1')]=function(_0x276429){var _0x4a4d1f={'conditions':[]};_0x4a4d1f['sqlOperator']=_[_0x71c6('0x2')](_0x276429,_0x71c6('0x3'))?'or':_0x71c6('0x4');var _0x591a31=_0x276429[_0x71c6('0x5')]('[$and]','')['replace']('[$or]','')[_0x71c6('0x6')]('||');for(var _0x4a3a5a=0x0;_0x4a3a5a<_0x591a31[_0x71c6('0x7')];_0x4a3a5a++){var _0xb65d14=_0x591a31[_0x4a3a5a]['split'](':=');var _0x35f043=_0xb65d14[0x0];var _0x5f2052=_0xb65d14['slice'](0x1);_0x5f2052[_0x71c6('0x8')](function(_0x445d8d){var _0x4be9af=_0x445d8d[_0x71c6('0x6')]('[')['shift']();var _0x4fa43c=_0x445d8d[_0x71c6('0x9')](/\[(.*?)\]/g);_0x4fa43c[_0x71c6('0x8')](function(_0x21499d){var _0x1543ea=_0x21499d[_0x71c6('0x6')]('[')[_0x71c6('0xa')](function(_0xd07527){return _0xd07527[_0x71c6('0xb')](']')>-0x1;})[_0x71c6('0xc')](function(_0x13f1e3){return _0x13f1e3[_0x71c6('0x6')](']')[0x0];})[0x0];_0x4a4d1f[_0x71c6('0xd')][_0x71c6('0xe')]({'field':_0x35f043,'operator':_0x4be9af,'value':_0x1543ea});});});}return _0x4a4d1f;};exports[_0x71c6('0xf')]=function(_0x7d33a3,_0x21a56a,_0x12971b){var _0x2c4443={};if(_0x21a56a==='DATE'){if(_0x12971b[_0x71c6('0x10')]===_0x71c6('0x11')){_0x12971b['operator']=_0x71c6('0x12');_0x12971b[_0x71c6('0x13')]+=','+_0x12971b[_0x71c6('0x13')];}else if(_[_0x71c6('0x14')]([_0x71c6('0x15'),_0x71c6('0x16')],_0x12971b[_0x71c6('0x10')])){_0x12971b[_0x71c6('0x13')]=moment(_0x12971b[_0x71c6('0x13')])[_0x71c6('0x17')](0x1,'days')[_0x71c6('0x18')](_0x71c6('0x19'));}}if(_0x12971b['castTo']){_0x21a56a=_0x12971b['castTo'];_0x2c4443['text']=_0x71c6('0x1a')+_0x7d33a3+'.'+_0x12971b['field']+_0x71c6('0x1b')+_0x12971b[_0x71c6('0x1c')]+')\x20'+parseOperator(_0x12971b[_0x71c6('0x10')]);}else{_0x2c4443[_0x71c6('0x1d')]=_0x7d33a3+'.'+_0x12971b[_0x71c6('0x1e')]+'\x20'+parseOperator(_0x12971b[_0x71c6('0x10')]);}if(_[_0x71c6('0x14')](['$ne',_0x71c6('0x1f')],_0x12971b[_0x71c6('0x10')]))_0x2c4443[_0x71c6('0x1d')]='('+_0x2c4443[_0x71c6('0x1d')]+'\x20OR\x20'+_0x7d33a3+'.'+_0x12971b[_0x71c6('0x1e')]+_0x71c6('0x20');_0x2c4443[_0x71c6('0x13')]=parseValue(_0x21a56a,_0x12971b[_0x71c6('0x10')],_0x12971b[_0x71c6('0x13')]);return _0x2c4443;};function parseOperator(_0x206d14){var _0x5e2349;switch(_0x206d14){case _0x71c6('0x21'):_0x5e2349=_0x71c6('0x22');break;case _0x71c6('0x1f'):_0x5e2349='NOT\x20IN\x20?';break;case _0x71c6('0x11'):_0x5e2349=_0x71c6('0x23');break;case _0x71c6('0x24'):_0x5e2349='<>\x20?';break;case'$substring':case'$startsWith':case _0x71c6('0x25'):_0x5e2349=_0x71c6('0x26');break;case'$lt':_0x5e2349=_0x71c6('0x27');break;case _0x71c6('0x15'):_0x5e2349=_0x71c6('0x28');break;case _0x71c6('0x16'):_0x5e2349=_0x71c6('0x29');break;case _0x71c6('0x2a'):_0x5e2349=_0x71c6('0x2b');break;case _0x71c6('0x12'):_0x5e2349=_0x71c6('0x2c');break;}return _0x5e2349;}function parseValue(_0x10f354,_0x210ddf,_0x3a997c){var _0x491dc4={'start':undefined,'end':undefined};switch(_0x210ddf){case _0x71c6('0x21'):case _0x71c6('0x1f'):_0x491dc4['start']=_0x3a997c[_0x71c6('0x6')](',');break;case _0x71c6('0x2d'):_0x491dc4['start']='%'+_0x3a997c+'%';break;case _0x71c6('0x2e'):_0x491dc4[_0x71c6('0x2f')]=_0x3a997c+'%';break;case _0x71c6('0x25'):_0x491dc4[_0x71c6('0x2f')]='%'+_0x3a997c;break;case _0x71c6('0x12'):var _0x3c226b=_0x3a997c[_0x71c6('0x6')](',');var _0x3a997c=_0x3c226b[_0x71c6('0x30')]();var _0x13eb67=_0x3c226b[_0x71c6('0x31')]();if(_0x10f354===_0x71c6('0x32')){_0x3a997c=moment(_0x3a997c)[_0x71c6('0x33')](0x0,!![])['format']();_0x13eb67=moment(_0x13eb67)[_0x71c6('0x33')](0x0,!![])[_0x71c6('0x17')](0x17,'hours')[_0x71c6('0x17')](0x3b,_0x71c6('0x34'))[_0x71c6('0x17')](0x3b,'seconds')[_0x71c6('0x18')]();}_0x491dc4={'start':_0x3a997c,'end':_0x13eb67};break;default:_0x491dc4['start']=_0x3a997c;break;}return _0x491dc4;}
\ No newline at end of file
index 341dd98..2aca7ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d5b=['query','model','map','intersection','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','lodash','parse','keys','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','includes','push','join','$id'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7d5b,0x1e5));var _0xb7d5=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x7d5b[_0x47a349];return _0x18ab75;};'use strict';var _=require(_0xb7d5('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x433ea8){var _0x40dfec=['ne'];try{var _0x3cbc8b=JSON[_0xb7d5('0x1')](_0x433ea8);var _0x4d8578=Object[_0xb7d5('0x2')](_0x3cbc8b)[0x0];return _0x40dfec['includes'](_0x4d8578);}catch(_0x5bb2c9){return![];}}function getOperatorValue(_0x3eaee0){var _0x40c123=JSON['parse'](_0x3eaee0);var _0xef09ef=Object[_0xb7d5('0x2')](_0x40c123)[0x0];var _0x4d68c9=_0x40c123[_0xef09ef];return{['$'+_0xef09ef]:_0x4d68c9};}exports[_0xb7d5('0x3')]=function(_0x3061f0){var _0x2d7116=null;if(_0x3061f0){_0x2d7116=_0x3061f0[_0xb7d5('0x4')](',');}return _0x2d7116;};exports[_0xb7d5('0x5')]=function(_0x3c44a0,_0x80f90a){var _0x4417ce={};if(!_[_0xb7d5('0x6')](_0x3c44a0)){_['forOwn'](_0x3c44a0,function(_0x15f481,_0x12c3a4){try{if(_0x80f90a){var _0x184ad1=_[_0xb7d5('0x7')](_0x80f90a,{'name':_0x12c3a4})||{};if(hasSequelizeOperator(_0x15f481)){_0x4417ce[_0x12c3a4]=getOperatorValue(_0x15f481);}else if(_0x184ad1[_0xb7d5('0x8')]===_0xb7d5('0x9')&&_[_0xb7d5('0xa')](_0x15f481)){var _0xc18624=JSON['parse'](_0x15f481);var _0x264a96={'$gte':moment(moment(_0xc18624[_0xb7d5('0xb')])[_0xb7d5('0xc')]('YYYY-MM-DD'))[_0xb7d5('0xd')]()[_0xb7d5('0xc')](),'$lte':moment(moment(_0xc18624[_0xb7d5('0xe')])[_0xb7d5('0xc')](_0xb7d5('0xf')))[_0xb7d5('0xd')]()[_0xb7d5('0x10')](0x1,'s')['format']()};_0x4417ce[_0x12c3a4]=_0x264a96;}else if(_0x184ad1[_0xb7d5('0x11')]===_0xb7d5('0x12')){_0x4417ce[_0x12c3a4]=_0x15f481;}else{_0x4417ce[_0x12c3a4]=_['isArray'](_0x15f481)?_0x15f481:JSON[_0xb7d5('0x1')](_0x15f481);}}else{_0x4417ce[_0x12c3a4]=_[_0xb7d5('0x13')](_0x15f481)?_0x15f481:JSON[_0xb7d5('0x1')](_0x15f481);}}catch(_0x1900b8){_0x4417ce[_0x12c3a4]=_0x15f481[_0xb7d5('0x4')](',');}});}return _0x4417ce;};exports[_0xb7d5('0x14')]=function(_0x2a5f08){_0x2a5f08=parseInt(_0x2a5f08,0xa);if(!_0x2a5f08||_0x2a5f08<0x0){_0x2a5f08=LIMIT_VALUE;}return _0x2a5f08;};exports[_0xb7d5('0x15')]=function(_0x102d6f){_0x102d6f=parseInt(_0x102d6f,0xa);if(!_0x102d6f||_0x102d6f<0x0){_0x102d6f=0x0;}return _0x102d6f;};exports[_0xb7d5('0x16')]=function(_0x46a04f){var _0x425e4c,_0xe1e737=null;if(_0x46a04f){_0x425e4c=_0x46a04f[_0xb7d5('0x4')](',');_0xe1e737=_['map'](_0x425e4c,function(_0x3eaea4){if(_0x3eaea4[_0xb7d5('0x17')]('-')===0x0){return[_0x3eaea4===_0xb7d5('0x18')?sequelize[_0xb7d5('0x19')](sequelize[_0xb7d5('0x1a')]('priority'),_0xb7d5('0x1b')):_0x3eaea4['substr'](0x1),_0xb7d5('0x1c')];}else{return[_0x3eaea4===_0xb7d5('0x18')?sequelize['cast'](sequelize['col'](_0xb7d5('0x18')),_0xb7d5('0x1b')):_0x3eaea4,_0xb7d5('0x1d')];}});}return _0xe1e737;};exports[_0xb7d5('0x1e')]=function(_0x110dd1,_0x3946ef){if(_['isEmpty'](_0x110dd1)){return _0x110dd1;}if(_['isArray'](_0x110dd1)){for(var _0x5c49ca=0x0;_0x5c49ca<_0x110dd1[_0xb7d5('0x1f')];_0x5c49ca+=0x1){_0x110dd1[_0x5c49ca]=this[_0xb7d5('0x1e')](_0x110dd1[_0x5c49ca],_0x3946ef);}return _0x110dd1;}if(!_[_0xb7d5('0x20')](_0x110dd1)){return _0x110dd1;}if(_[_0xb7d5('0x21')](_0x3946ef)){_0x3946ef=[_0x3946ef];}if(!_[_0xb7d5('0x13')](_0x3946ef)){return _0x110dd1;}for(var _0x1d8440=0x0;_0x1d8440<_0x3946ef['length'];_0x1d8440+=0x1){_[_0xb7d5('0x22')](_0x110dd1,_0x3946ef[_0x1d8440]);}for(var _0x44dd0b in _0x110dd1){if(_0x110dd1[_0xb7d5('0x23')](_0x44dd0b)){_0x110dd1[_0x44dd0b]=this[_0xb7d5('0x1e')](_0x110dd1[_0x44dd0b],_0x3946ef);}}return _0x110dd1;};exports[_0xb7d5('0x24')]=function(_0x1e250c){return _0x1e250c[_0xb7d5('0x25')](RegExp(_0xb7d5('0x26')))?!![]:![];};exports['isEmail']=function(_0x323eac){return _0x323eac[_0xb7d5('0x25')](/^\S+@\S+$/)?!![]:![];};exports[_0xb7d5('0x27')]=function(_0x2fe861){var _0x4d7623=[];_0x2fe861['split'](/[ ,]+/)[_0xb7d5('0x28')](function(_0x5588bb){_0x5588bb=_0x5588bb[_0xb7d5('0x29')](/([^:]")"+/g,'$1');_0x5588bb='+'+_0x5588bb+'*';if(_0x5588bb[_0xb7d5('0x2a')]('@'))_0x5588bb='\x22'+_0x5588bb+'\x22';_0x4d7623[_0xb7d5('0x2b')](_0x5588bb);});return _0x4d7623[_0xb7d5('0x2c')]('\x20');};exports['getOptions']=function(_0x46d768,_0x411cb6,_0x5d6dc0){var _0x574ebf={},_0x398885={};if(_0x411cb6['query'][_0xb7d5('0x2d')]){_0x411cb6[_0xb7d5('0x2e')]['id']=_0x411cb6['query'][_0xb7d5('0x2d')];delete _0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x2d')];}_0x574ebf[_0xb7d5('0x2f')]=_[_0xb7d5('0x30')](_0x46d768,_0xb7d5('0x11'));_0x574ebf[_0xb7d5('0x2e')]=_[_0xb7d5('0x2')](_0x411cb6['query']);_0x574ebf[_0xb7d5('0x5')]=_[_0xb7d5('0x31')](_0x574ebf['model'],_0x574ebf[_0xb7d5('0x2e')]);_0x398885['attributes']=_['intersection'](_0x574ebf[_0xb7d5('0x2f')],this[_0xb7d5('0x3')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x3')]));_0x398885[_0xb7d5('0x32')]=_0x398885['attributes']['length']?_0x398885[_0xb7d5('0x32')]:_0x574ebf[_0xb7d5('0x2f')];if(!_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x23')](_0xb7d5('0x33'))){_0x398885[_0xb7d5('0x14')]=this['limit'](_0x411cb6['query'][_0xb7d5('0x14')]);_0x398885[_0xb7d5('0x15')]=this[_0xb7d5('0x15')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x15')]);}_0x398885[_0xb7d5('0x34')]=this[_0xb7d5('0x16')](_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x16')]);_0x398885[_0xb7d5('0x35')]=this[_0xb7d5('0x5')](_[_0xb7d5('0x36')](_0x411cb6[_0xb7d5('0x2e')],_0x574ebf[_0xb7d5('0x5')]),_0x46d768);if(_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x37')]){_0x398885[_0xb7d5('0x35')]=_[_0xb7d5('0x38')](_0x398885[_0xb7d5('0x35')],{'$or':_[_0xb7d5('0x30')](_0x46d768,function(_0x30705e){if(_0x30705e['type']!==_0xb7d5('0x39')){if(_0x5d6dc0){return sequelize[_0xb7d5('0x35')](sequelize['fn']('lower',sequelize[_0xb7d5('0x1a')](_0x30705e[_0xb7d5('0x11')])),{'$like':sequelize['fn'](_0xb7d5('0x3a'),'%'+_0x411cb6[_0xb7d5('0x2e')][_0xb7d5('0x37')]+'%')});}else{var _0x328944={};_0x328944[_0x30705e[_0xb7d5('0x11')]]={'$like':'%'+_0x411cb6[_0xb7d5('0x2e')]['filter']+'%'};return _0x328944;}}})});}_0x398885=_['merge']({},_0x398885,_0x411cb6['options']);return _0x398885;};
\ No newline at end of file
+var _0x2da9=['hasOwnProperty','isEmail','match','getFullTextValue','forEach','push','getOptions','query','$id','name','model','attributes','intersection','limit','order','where','pick','filter','merge','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','uniqueid','isArray','split','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','ASC','length','omit','isString'];(function(_0x3c0501,_0x459fed){var _0xa5ef33=function(_0x35530d){while(--_0x35530d){_0x3c0501['push'](_0x3c0501['shift']());}};_0xa5ef33(++_0x459fed);}(_0x2da9,0xbe));var _0x92da=function(_0x4ca027,_0x246607){_0x4ca027=_0x4ca027-0x0;var _0x301203=_0x2da9[_0x4ca027];return _0x301203;};'use strict';var _=require('lodash');var sequelize=require(_0x92da('0x0'));var moment=require(_0x92da('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4edcef){var _0xa87be=['ne'];try{var _0x310cad=JSON[_0x92da('0x2')](_0x4edcef);var _0x3f0afe=Object[_0x92da('0x3')](_0x310cad)[0x0];return _0xa87be[_0x92da('0x4')](_0x3f0afe);}catch(_0x514dc1){return![];}}function getOperatorValue(_0xee6af){var _0x35a810=JSON[_0x92da('0x2')](_0xee6af);var _0x45c741=Object[_0x92da('0x3')](_0x35a810)[0x0];var _0x4a6f69=_0x35a810[_0x45c741];return{['$'+_0x45c741]:_0x4a6f69};}exports[_0x92da('0x5')]=function(_0x39a018){var _0xfc79d3=null;if(_0x39a018){_0xfc79d3=_0x39a018['split'](',');}return _0xfc79d3;};exports[_0x92da('0x6')]=function(_0x10b009,_0x282b56){var _0x24ec06={};if(!_[_0x92da('0x7')](_0x10b009)){_[_0x92da('0x8')](_0x10b009,function(_0x248903,_0x5bbbf7){try{if(_0x282b56){var _0x120e56=_[_0x92da('0x9')](_0x282b56,{'name':_0x5bbbf7})||{};if(hasSequelizeOperator(_0x248903)){_0x24ec06[_0x5bbbf7]=getOperatorValue(_0x248903);}else if(_0x120e56[_0x92da('0xa')]===_0x92da('0xb')&&_[_0x92da('0xc')](_0x248903)){var _0x12bc9a=JSON['parse'](_0x248903);var _0x34ba14={'$gte':moment(moment(_0x12bc9a[_0x92da('0xd')])['format'](_0x92da('0xe')))[_0x92da('0xf')]()[_0x92da('0x10')](),'$lte':moment(moment(_0x12bc9a['$lte'])['format'](_0x92da('0xe')))[_0x92da('0xf')]()[_0x92da('0x11')](0x1,'s')[_0x92da('0x10')]()};_0x24ec06[_0x5bbbf7]=_0x34ba14;}else if(_0x120e56['name']===_0x92da('0x12')){_0x24ec06[_0x5bbbf7]=_0x248903;}else{_0x24ec06[_0x5bbbf7]=_[_0x92da('0x13')](_0x248903)?_0x248903:JSON[_0x92da('0x2')](_0x248903);}}else{_0x24ec06[_0x5bbbf7]=_[_0x92da('0x13')](_0x248903)?_0x248903:JSON[_0x92da('0x2')](_0x248903);}}catch(_0x4bc871){_0x24ec06[_0x5bbbf7]=_0x248903[_0x92da('0x14')](',');}});}return _0x24ec06;};exports['limit']=function(_0x4f0f0a){_0x4f0f0a=parseInt(_0x4f0f0a,0xa);if(!_0x4f0f0a||_0x4f0f0a<0x0){_0x4f0f0a=LIMIT_VALUE;}return _0x4f0f0a;};exports[_0x92da('0x15')]=function(_0x14ebbe){_0x14ebbe=parseInt(_0x14ebbe,0xa);if(!_0x14ebbe||_0x14ebbe<0x0){_0x14ebbe=0x0;}return _0x14ebbe;};exports[_0x92da('0x16')]=function(_0x3b0618){var _0x2ee838,_0x4eb42b=null;if(_0x3b0618){_0x2ee838=_0x3b0618['split'](',');_0x4eb42b=_[_0x92da('0x17')](_0x2ee838,function(_0x1d18cf){if(_0x1d18cf[_0x92da('0x18')]('-')===0x0){return[_0x1d18cf==='priority'?sequelize[_0x92da('0x19')](sequelize[_0x92da('0x1a')](_0x92da('0x1b')),_0x92da('0x1c')):_0x1d18cf[_0x92da('0x1d')](0x1),'DESC'];}else{return[_0x1d18cf==='priority'?sequelize[_0x92da('0x19')](sequelize[_0x92da('0x1a')](_0x92da('0x1b')),_0x92da('0x1c')):_0x1d18cf,_0x92da('0x1e')];}});}return _0x4eb42b;};exports['omit']=function(_0x2ff8fe,_0xb1ac5){if(_[_0x92da('0x7')](_0x2ff8fe)){return _0x2ff8fe;}if(_[_0x92da('0x13')](_0x2ff8fe)){for(var _0x49603c=0x0;_0x49603c<_0x2ff8fe[_0x92da('0x1f')];_0x49603c+=0x1){_0x2ff8fe[_0x49603c]=this[_0x92da('0x20')](_0x2ff8fe[_0x49603c],_0xb1ac5);}return _0x2ff8fe;}if(!_['isObject'](_0x2ff8fe)){return _0x2ff8fe;}if(_[_0x92da('0x21')](_0xb1ac5)){_0xb1ac5=[_0xb1ac5];}if(!_['isArray'](_0xb1ac5)){return _0x2ff8fe;}for(var _0x45126a=0x0;_0x45126a<_0xb1ac5['length'];_0x45126a+=0x1){_['unset'](_0x2ff8fe,_0xb1ac5[_0x45126a]);}for(var _0x528d68 in _0x2ff8fe){if(_0x2ff8fe[_0x92da('0x22')](_0x528d68)){_0x2ff8fe[_0x528d68]=this[_0x92da('0x20')](_0x2ff8fe[_0x528d68],_0xb1ac5);}}return _0x2ff8fe;};exports['isNumeric']=function(_0x4c7c9e){return _0x4c7c9e['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x92da('0x23')]=function(_0x4c0875){return _0x4c0875[_0x92da('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x92da('0x25')]=function(_0x4395b3){var _0x32a0a4=[];_0x4395b3[_0x92da('0x14')](/[ ,]+/)[_0x92da('0x26')](function(_0x57fa05){_0x57fa05=_0x57fa05['replace'](/([^:]")"+/g,'$1');_0x57fa05='+'+_0x57fa05+'*';if(_0x57fa05[_0x92da('0x4')]('@'))_0x57fa05='\x22'+_0x57fa05+'\x22';_0x32a0a4[_0x92da('0x27')](_0x57fa05);});return _0x32a0a4['join']('\x20');};exports[_0x92da('0x28')]=function(_0x215115,_0x3c7669,_0x3e3816){var _0x1e27d5={},_0x3efd5={};if(_0x3c7669[_0x92da('0x29')][_0x92da('0x2a')]){_0x3c7669['query']['id']=_0x3c7669['query'][_0x92da('0x2a')];delete _0x3c7669[_0x92da('0x29')][_0x92da('0x2a')];}_0x1e27d5['model']=_[_0x92da('0x17')](_0x215115,_0x92da('0x2b'));_0x1e27d5[_0x92da('0x29')]=_['keys'](_0x3c7669['query']);_0x1e27d5[_0x92da('0x6')]=_['intersection'](_0x1e27d5[_0x92da('0x2c')],_0x1e27d5[_0x92da('0x29')]);_0x3efd5[_0x92da('0x2d')]=_[_0x92da('0x2e')](_0x1e27d5[_0x92da('0x2c')],this[_0x92da('0x5')](_0x3c7669[_0x92da('0x29')][_0x92da('0x5')]));_0x3efd5[_0x92da('0x2d')]=_0x3efd5[_0x92da('0x2d')][_0x92da('0x1f')]?_0x3efd5[_0x92da('0x2d')]:_0x1e27d5[_0x92da('0x2c')];if(!_0x3c7669[_0x92da('0x29')]['hasOwnProperty']('nolimit')){_0x3efd5[_0x92da('0x2f')]=this[_0x92da('0x2f')](_0x3c7669[_0x92da('0x29')]['limit']);_0x3efd5[_0x92da('0x15')]=this['offset'](_0x3c7669[_0x92da('0x29')]['offset']);}_0x3efd5[_0x92da('0x30')]=this['sort'](_0x3c7669['query']['sort']);_0x3efd5[_0x92da('0x31')]=this['filters'](_[_0x92da('0x32')](_0x3c7669[_0x92da('0x29')],_0x1e27d5[_0x92da('0x6')]),_0x215115);if(_0x3c7669['query'][_0x92da('0x33')]){_0x3efd5[_0x92da('0x31')]=_[_0x92da('0x34')](_0x3efd5['where'],{'$or':_[_0x92da('0x17')](_0x215115,function(_0x6c45d2){if(_0x6c45d2['type']!==_0x92da('0x35')){if(_0x3e3816){return sequelize[_0x92da('0x31')](sequelize['fn'](_0x92da('0x36'),sequelize[_0x92da('0x1a')](_0x6c45d2[_0x92da('0x2b')])),{'$like':sequelize['fn'](_0x92da('0x36'),'%'+_0x3c7669['query'][_0x92da('0x33')]+'%')});}else{var _0x4e3f79={};_0x4e3f79[_0x6c45d2[_0x92da('0x2b')]]={'$like':'%'+_0x3c7669[_0x92da('0x29')][_0x92da('0x33')]+'%'};return _0x4e3f79;}}})});}_0x3efd5=_[_0x92da('0x34')]({},_0x3efd5,_0x3c7669[_0x92da('0x37')]);return _0x3efd5;};
\ No newline at end of file
index 7af2245..56d3e36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c89=['join','public','development','test','client','json\x20replacer','split','views','/server/views','html','ejs','renderFile','use','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','production','set','appPath'];(function(_0x42c410,_0x18238c){var _0x45df40=function(_0x1693b4){while(--_0x1693b4){_0x42c410['push'](_0x42c410['shift']());}};_0x45df40(++_0x18238c);}(_0x4c89,0xcb));var _0x94c8=function(_0x56ab4e,_0x2f6d9e){_0x56ab4e=_0x56ab4e-0x0;var _0x593823=_0x4c89[_0x56ab4e];return _0x593823;};'use strict';var express=require(_0x94c8('0x0'));var favicon=require(_0x94c8('0x1'));var bodyParser=require(_0x94c8('0x2'));var methodOverride=require(_0x94c8('0x3'));var cookieParser=require(_0x94c8('0x4'));var errorHandler=require(_0x94c8('0x5'));var path=require('path');var passport=require(_0x94c8('0x6'));var cors=require(_0x94c8('0x7'));var moment=require('moment');var config=require(_0x94c8('0x8'));var db=require('../mysqldb')['db'];exports[_0x94c8('0x9')]=function(_0x3e693a){var _0x3946e2=_0x3e693a[_0x94c8('0xa')]('env');if(_0x3946e2===_0x94c8('0xb')){_0x3e693a[_0x94c8('0xc')](_0x94c8('0xd'),path[_0x94c8('0xe')](config['root'],_0x94c8('0xf')));}if(_0x3946e2===_0x94c8('0x10')||_0x3946e2===_0x94c8('0x11')){_0x3e693a[_0x94c8('0xc')](_0x94c8('0xd'),path[_0x94c8('0xe')](config['root'],_0x94c8('0x12')));_0x3e693a['use'](errorHandler());}_0x3e693a[_0x94c8('0xc')](_0x94c8('0x13'),function(_0x10724a,_0x19e415){if(this[_0x10724a]instanceof Date){_0x19e415=this[_0x10724a]['toISOString']()[_0x94c8('0x14')]('.')[0x0]+'Z';}return _0x19e415;});_0x3e693a['use'](express['static'](_0x3e693a[_0x94c8('0xa')]('appPath')));_0x3e693a[_0x94c8('0xc')](_0x94c8('0x15'),config['root']+_0x94c8('0x16'));_0x3e693a['engine'](_0x94c8('0x17'),require(_0x94c8('0x18'))[_0x94c8('0x19')]);_0x3e693a[_0x94c8('0xc')]('view\x20engine',_0x94c8('0x17'));_0x3e693a[_0x94c8('0x1a')](bodyParser[_0x94c8('0x1b')]({'limit':_0x94c8('0x1c'),'extended':!![]}));_0x3e693a['use'](bodyParser[_0x94c8('0x1d')]({'limit':_0x94c8('0x1c')}));_0x3e693a[_0x94c8('0x1a')](cors());_0x3e693a[_0x94c8('0x1a')](methodOverride());_0x3e693a[_0x94c8('0x1a')](cookieParser());_0x3e693a[_0x94c8('0x1a')](passport[_0x94c8('0x1e')]());};
\ No newline at end of file
+var _0x6bfb=['json','initialize','express','method-override','cookie-parser','cors','moment','../mysqldb','default','get','production','appPath','join','root','development','test','set','client','json\x20replacer','toISOString','split','use','static','views','engine','html','ejs','renderFile','view\x20engine','50mb'];(function(_0x12c99b,_0x215c22){var _0x3e8d3f=function(_0x237fdf){while(--_0x237fdf){_0x12c99b['push'](_0x12c99b['shift']());}};_0x3e8d3f(++_0x215c22);}(_0x6bfb,0x110));var _0xb6bf=function(_0x121521,_0x263a44){_0x121521=_0x121521-0x0;var _0x569c58=_0x6bfb[_0x121521];return _0x569c58;};'use strict';var express=require(_0xb6bf('0x0'));var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0xb6bf('0x1'));var cookieParser=require(_0xb6bf('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require('passport');var cors=require(_0xb6bf('0x3'));var moment=require(_0xb6bf('0x4'));var config=require('./environment');var db=require(_0xb6bf('0x5'))['db'];exports[_0xb6bf('0x6')]=function(_0x5a7719){var _0x495a1e=_0x5a7719[_0xb6bf('0x7')]('env');if(_0x495a1e===_0xb6bf('0x8')){_0x5a7719['set'](_0xb6bf('0x9'),path[_0xb6bf('0xa')](config[_0xb6bf('0xb')],'public'));}if(_0x495a1e===_0xb6bf('0xc')||_0x495a1e===_0xb6bf('0xd')){_0x5a7719[_0xb6bf('0xe')]('appPath',path['join'](config[_0xb6bf('0xb')],_0xb6bf('0xf')));_0x5a7719['use'](errorHandler());}_0x5a7719[_0xb6bf('0xe')](_0xb6bf('0x10'),function(_0x57f6e1,_0x340ef4){if(this[_0x57f6e1]instanceof Date){_0x340ef4=this[_0x57f6e1][_0xb6bf('0x11')]()[_0xb6bf('0x12')]('.')[0x0]+'Z';}return _0x340ef4;});_0x5a7719[_0xb6bf('0x13')](express[_0xb6bf('0x14')](_0x5a7719['get'](_0xb6bf('0x9'))));_0x5a7719[_0xb6bf('0xe')](_0xb6bf('0x15'),config[_0xb6bf('0xb')]+'/server/views');_0x5a7719[_0xb6bf('0x16')](_0xb6bf('0x17'),require(_0xb6bf('0x18'))[_0xb6bf('0x19')]);_0x5a7719[_0xb6bf('0xe')](_0xb6bf('0x1a'),_0xb6bf('0x17'));_0x5a7719[_0xb6bf('0x13')](bodyParser['urlencoded']({'limit':_0xb6bf('0x1b'),'extended':!![]}));_0x5a7719[_0xb6bf('0x13')](bodyParser[_0xb6bf('0x1c')]({'limit':_0xb6bf('0x1b')}));_0x5a7719[_0xb6bf('0x13')](cors());_0x5a7719['use'](methodOverride());_0x5a7719[_0xb6bf('0x13')](cookieParser());_0x5a7719[_0xb6bf('0x13')](passport[_0xb6bf('0x1d')]());};
\ No newline at end of file
index d380e06..e7ce48a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccb2=['test','licenseToken','win32','utf8','replace','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','platform'];(function(_0x1390a0,_0x499668){var _0x359f67=function(_0x3daff4){while(--_0x3daff4){_0x1390a0['push'](_0x1390a0['shift']());}};_0x359f67(++_0x499668);}(_0xccb2,0xfd));var _0x2ccb=function(_0x2764c8,_0x37c224){_0x2764c8=_0x2764c8-0x0;var _0x5e8dc1=_0xccb2[_0x2764c8];return _0x5e8dc1;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2ccb('0x0'));var machine=require(_0x2ccb('0x1'));var exec=require(_0x2ccb('0x2'))[_0x2ccb('0x3')];var config=require(_0x2ccb('0x4'));function getInterfaces(){var _0x287ea2=[];var _0x36969a=os[_0x2ccb('0x5')]();var _0x13b9dc=_['orderBy'](_['keys'](_0x36969a));for(var _0x3a032b=0x0;_0x3a032b<_0x13b9dc[_0x2ccb('0x6')];_0x3a032b++){var _0x533500=_0x36969a[_0x13b9dc[_0x3a032b]][_0x2ccb('0x7')](function(_0x12ac4f){return _0x12ac4f[_0x2ccb('0x8')]===_0x2ccb('0x9')&&_0x12ac4f[_0x2ccb('0xa')]===![];});_0x287ea2=_0x287ea2[_0x2ccb('0xb')](_0x533500);}return _0x287ea2;}function getFirstInterface(){var _0x5576f1=_[_0x2ccb('0xc')](getInterfaces());return{'macAddress':_0x5576f1&&_0x5576f1[_0x2ccb('0xd')]?_0x5576f1[_0x2ccb('0xd')]:_0x2ccb('0xe'),'ipAddress':_0x5576f1&&_0x5576f1[_0x2ccb('0xf')]?_0x5576f1[_0x2ccb('0xf')]:_0x2ccb('0x10')};}exports[_0x2ccb('0x11')]=getFirstInterface;function getCPUhash(){var _0x30a794=_['orderBy'](os[_0x2ccb('0x12')]()[_0x2ccb('0x13')](function(_0x30a6c7){return _0x30a6c7[_0x2ccb('0x14')];}))[_0x2ccb('0x15')](':');return crypto[_0x2ccb('0x16')](_0x2ccb('0x17'))[_0x2ccb('0x18')](_0x30a794)['digest'](_0x2ccb('0x19'));}exports['getUuid']=function(){var _0x5440aa=os[_0x2ccb('0x1a')]();var _0x7b512=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x7b512[_0x2ccb('0x1b')](config[_0x2ccb('0x1c')])){return config[_0x2ccb('0x1c')];}else if(_0x5440aa===_0x2ccb('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x2ccb('0x1e')})[_0x2ccb('0x1f')]('\x0d\x0a','');}else{var _0x41f5ff=getFirstInterface();var _0x8b632d=getCPUhash();var _0x4965fe=_0x8b632d+'|'+os[_0x2ccb('0x20')]()+'|'+_0x41f5ff[_0x2ccb('0x21')]+'|'+_0x41f5ff['ipAddress'];var _0xcf697d=crypto[_0x2ccb('0x16')](_0x2ccb('0x17'))[_0x2ccb('0x18')](_0x4965fe)['digest'](_0x2ccb('0x19'));return _0xcf697d[_0x2ccb('0x22')](0x0,0x8)+'-'+_0xcf697d[_0x2ccb('0x22')](0x8,0xc)+'-'+_0xcf697d[_0x2ccb('0x22')](0xc,0x10)+'-'+_0xcf697d[_0x2ccb('0x22')](0x10,0x14)+'-'+_0xcf697d['substring'](0x14);}};
\ No newline at end of file
+var _0x68b9=['internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','join','createHash','update','digest','hex','platform','test','licenseToken','win32','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','orderBy','keys','family','IPv4'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x68b9,0x14a));var _0x968b=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x68b9[_0x7a112];return _0x136dc5;};'use strict';var _=require(_0x968b('0x0'));var os=require('os');var crypto=require(_0x968b('0x1'));var machine=require(_0x968b('0x2'));var exec=require('child_process')[_0x968b('0x3')];var config=require(_0x968b('0x4'));function getInterfaces(){var _0x1dbb0b=[];var _0x46c2b7=os[_0x968b('0x5')]();var _0x5b0344=_[_0x968b('0x6')](_[_0x968b('0x7')](_0x46c2b7));for(var _0x5c75e8=0x0;_0x5c75e8<_0x5b0344['length'];_0x5c75e8++){var _0x36154e=_0x46c2b7[_0x5b0344[_0x5c75e8]]['filter'](function(_0x19d318){return _0x19d318[_0x968b('0x8')]===_0x968b('0x9')&&_0x19d318[_0x968b('0xa')]===![];});_0x1dbb0b=_0x1dbb0b[_0x968b('0xb')](_0x36154e);}return _0x1dbb0b;}function getFirstInterface(){var _0xae8835=_[_0x968b('0xc')](getInterfaces());return{'macAddress':_0xae8835&&_0xae8835[_0x968b('0xd')]?_0xae8835[_0x968b('0xd')]:_0x968b('0xe'),'ipAddress':_0xae8835&&_0xae8835[_0x968b('0xf')]?_0xae8835['address']:_0x968b('0x10')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xd5f612=_[_0x968b('0x6')](os[_0x968b('0x11')]()[_0x968b('0x12')](function(_0x26aaf0){return _0x26aaf0['model'];}))[_0x968b('0x13')](':');return crypto[_0x968b('0x14')]('md5')[_0x968b('0x15')](_0xd5f612)[_0x968b('0x16')](_0x968b('0x17'));}exports['getUuid']=function(){var _0x387d96=os[_0x968b('0x18')]();var _0x545019=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x545019[_0x968b('0x19')](config[_0x968b('0x1a')])){return config['licenseToken'];}else if(_0x387d96===_0x968b('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x968b('0x1c')})[_0x968b('0x1d')]('\x0d\x0a','');}else{var _0x58ef01=getFirstInterface();var _0x32135d=getCPUhash();var _0x31e060=_0x32135d+'|'+os[_0x968b('0x1e')]()+'|'+_0x58ef01[_0x968b('0x1f')]+'|'+_0x58ef01[_0x968b('0x20')];var _0x23c4d2=crypto[_0x968b('0x14')]('md5')[_0x968b('0x15')](_0x31e060)[_0x968b('0x16')](_0x968b('0x17'));return _0x23c4d2['substring'](0x0,0x8)+'-'+_0x23c4d2[_0x968b('0x21')](0x8,0xc)+'-'+_0x23c4d2[_0x968b('0x21')](0xc,0x10)+'-'+_0x23c4d2[_0x968b('0x21')](0x10,0x14)+'-'+_0x23c4d2[_0x968b('0x21')](0x14);}};
\ No newline at end of file
index 3c752f5..714d9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbca2=['https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','days','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','request-promise','bluebird','../../mysqldb','./hardware','../logger','license'];(function(_0x468dd8,_0x497171){var _0x560346=function(_0x4c699a){while(--_0x4c699a){_0x468dd8['push'](_0x468dd8['shift']());}};_0x560346(++_0x497171);}(_0xbca2,0x189));var _0x2bca=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xbca2[_0x1cb18a];return _0x22442e;};'use strict';var util=require('util');var moment=require(_0x2bca('0x0'));var rp=require(_0x2bca('0x1'));var BPromise=require(_0x2bca('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x2bca('0x3'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x2bca('0x4'));var logger=require(_0x2bca('0x5'))(_0x2bca('0x6'));var HOST=_0x2bca('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x688316){return new BPromise(function(_0x271c6b,_0x3e74ea){var _0x3ebbd6=util['format'](_0x2bca('0x8'),HOST,_0x688316,module[_0x2bca('0x9')][_0x2bca('0xa')]);if(oldToken){_0x3ebbd6=util[_0x2bca('0xb')](_0x2bca('0xc'),HOST,_0x688316,module[_0x2bca('0x9')]['version'],oldToken);}var _0x4b2d1a={'uri':_0x3ebbd6,'method':_0x2bca('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4b2d1a)['then'](function(_0x40522a){_0x271c6b(_0x40522a);})['catch'](function(_0x597221){_0x3e74ea(_0x597221);});});}function manageLicense(_0x4628af,_0x1cb624){var _0x324375=_0x1cb624[_0x2bca('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x324375['data1']!==_0x4628af&&!_0x324375[_0x2bca('0xf')]){oldToken=_0x324375['data1'];}httpRequest(_0x4628af)[_0x2bca('0x10')](function(_0x4182a9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4182a9[_0x2bca('0x11')]){isOldTokenSent=![];if(!_0x324375[_0x2bca('0x6')]&&_0x324375['license']!=_0x4182a9['license']||_0x324375[_0x2bca('0x6')]&&_0x324375['data2']){logger['info'](_0x2bca('0x12'));}if(_0x324375[_0x2bca('0x6')]&&!_0x324375[_0x2bca('0xf')]&&_0x324375[_0x2bca('0x6')]!=_0x4182a9[_0x2bca('0x6')]){logger[_0x2bca('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x324375[_0x2bca('0x6')]&&!_0x324375[_0x2bca('0xf')]&&_0x324375[_0x2bca('0x6')]==_0x4182a9[_0x2bca('0x6')]){return _0x1cb624;}return _0x1cb624['update']({'data1':_0x4628af,'data2':null,'license':_0x4182a9['license']});}else{if(_0x4182a9[_0x2bca('0x6')]||_0x324375[_0x2bca('0x6')]){if(!_0x324375[_0x2bca('0xf')]){if(_0x324375['data1']==_0x4628af){GRAY_PERIOD_REASON=_0x2bca('0x14');logger['info'](_0x2bca('0x15'));}else{GRAY_PERIOD_REASON=_0x2bca('0x16');logger[_0x2bca('0x13')](_0x2bca('0x17'),_0x324375[_0x2bca('0x18')],_0x4628af);}logger['info'](_0x2bca('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x2bca('0xb')](_0x2bca('0x1a')));return _0x1cb624[_0x2bca('0x1b')]({'data2':encryptor['encryptString'](moment()[_0x2bca('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor['decryptString'](_0x324375['data2']),_0x2bca('0x1c'))>DAYS){logger[_0x2bca('0x13')](_0x2bca('0x1d'),moment()[_0x2bca('0xb')](_0x2bca('0x1a')));isOldTokenSent=![];return _0x1cb624['update']({'data1':_0x4628af,'data2':null,'license':null});}}}else{if(_0x324375['data1']!=_0x4628af){logger[_0x2bca('0x13')](_0x2bca('0x17'),_0x324375[_0x2bca('0x18')],_0x4628af);return _0x1cb624[_0x2bca('0x1b')]({'data1':_0x4628af,'data2':null,'license':null});}}}return _0x1cb624;})[_0x2bca('0x10')](function(_0x36beff){_0x1cb624=_0x36beff;})[_0x2bca('0x1e')](function(_0xada042){logger[_0x2bca('0x1f')](_0xada042[_0x2bca('0x20')]);})[_0x2bca('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x2bca('0x22')](),_0x1cb624);},TIME);});}function defaultLicense(){var _0x240286=hardware[_0x2bca('0x22')]();if(_0x240286){return db[_0x2bca('0x23')][_0x2bca('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x240286}})[_0x2bca('0x25')](function(_0x5e53d0,_0x5046a3){logger[_0x2bca('0x13')](_0x2bca('0x26'),_0x240286);manageLicense(_0x240286,_0x5e53d0);})['catch'](function(_0x139131){logger['error'](_0x139131[_0x2bca('0x20')]);});}}exports[_0x2bca('0x27')]=defaultLicense;
\ No newline at end of file
+var _0x0aa7=['%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','get','data1','data2','then','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','moment','request-promise','pkginfo','version','../../mysqldb','./hardware','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s'];(function(_0x238399,_0x2caea6){var _0x320d46=function(_0x5053b8){while(--_0x5053b8){_0x238399['push'](_0x238399['shift']());}};_0x320d46(++_0x2caea6);}(_0x0aa7,0x170));var _0x70aa=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x0aa7[_0x919445];return _0x511b3e;};'use strict';var util=require(_0x70aa('0x0'));var moment=require(_0x70aa('0x1'));var rp=require(_0x70aa('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x70aa('0x3'))(module,_0x70aa('0x4'));var db=require(_0x70aa('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x70aa('0x6'));var logger=require(_0x70aa('0x7'))('license');var HOST=_0x70aa('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a454){return new BPromise(function(_0x51f8a8,_0x46ce1b){var _0x37945a=util['format'](_0x70aa('0x9'),HOST,_0x2a454,module['exports'][_0x70aa('0x4')]);if(oldToken){_0x37945a=util['format'](_0x70aa('0xa'),HOST,_0x2a454,module[_0x70aa('0xb')][_0x70aa('0x4')],oldToken);}var _0x440ff6={'uri':_0x37945a,'method':_0x70aa('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x440ff6)['then'](function(_0x5f414b){_0x51f8a8(_0x5f414b);})['catch'](function(_0x2f247f){_0x46ce1b(_0x2f247f);});});}function manageLicense(_0x4622a0,_0x4ef253){var _0x366cf1=_0x4ef253[_0x70aa('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x366cf1[_0x70aa('0xe')]!==_0x4622a0&&!_0x366cf1[_0x70aa('0xf')]){oldToken=_0x366cf1[_0x70aa('0xe')];}httpRequest(_0x4622a0)[_0x70aa('0x10')](function(_0x218e47){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x218e47['active']){isOldTokenSent=![];if(!_0x366cf1[_0x70aa('0x11')]&&_0x366cf1['license']!=_0x218e47[_0x70aa('0x11')]||_0x366cf1[_0x70aa('0x11')]&&_0x366cf1[_0x70aa('0xf')]){logger[_0x70aa('0x12')](_0x70aa('0x13'));}if(_0x366cf1['license']&&!_0x366cf1[_0x70aa('0xf')]&&_0x366cf1[_0x70aa('0x11')]!=_0x218e47['license']){logger[_0x70aa('0x12')](_0x70aa('0x14'));}if(_0x366cf1[_0x70aa('0x11')]&&!_0x366cf1['data2']&&_0x366cf1['license']==_0x218e47['license']){return _0x4ef253;}return _0x4ef253['update']({'data1':_0x4622a0,'data2':null,'license':_0x218e47[_0x70aa('0x11')]});}else{if(_0x218e47[_0x70aa('0x11')]||_0x366cf1[_0x70aa('0x11')]){if(!_0x366cf1['data2']){if(_0x366cf1[_0x70aa('0xe')]==_0x4622a0){GRAY_PERIOD_REASON=_0x70aa('0x15');logger[_0x70aa('0x12')](_0x70aa('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x70aa('0x12')](_0x70aa('0x17'),_0x366cf1[_0x70aa('0xe')],_0x4622a0);}logger[_0x70aa('0x12')](_0x70aa('0x18'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x70aa('0x19')](_0x70aa('0x1a')));return _0x4ef253[_0x70aa('0x1b')]({'data2':encryptor[_0x70aa('0x1c')](moment()[_0x70aa('0x19')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x70aa('0x1d')](encryptor[_0x70aa('0x1e')](_0x366cf1['data2']),_0x70aa('0x1f'))>DAYS){logger['info'](_0x70aa('0x20'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x4ef253[_0x70aa('0x1b')]({'data1':_0x4622a0,'data2':null,'license':null});}}}else{if(_0x366cf1[_0x70aa('0xe')]!=_0x4622a0){logger[_0x70aa('0x12')](_0x70aa('0x17'),_0x366cf1['data1'],_0x4622a0);return _0x4ef253[_0x70aa('0x1b')]({'data1':_0x4622a0,'data2':null,'license':null});}}}return _0x4ef253;})[_0x70aa('0x10')](function(_0x143ef0){_0x4ef253=_0x143ef0;})[_0x70aa('0x21')](function(_0x3442ef){logger['error'](_0x3442ef['message']);})[_0x70aa('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x70aa('0x23')](),_0x4ef253);},TIME);});}function defaultLicense(){var _0x4a8c01=hardware[_0x70aa('0x23')]();if(_0x4a8c01){return db['License'][_0x70aa('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x4a8c01}})[_0x70aa('0x25')](function(_0x3ca022,_0xbb2c9){logger[_0x70aa('0x12')](_0x70aa('0x26'),_0x4a8c01);manageLicense(_0x4a8c01,_0x3ca022);})['catch'](function(_0x505c69){logger[_0x70aa('0x27')](_0x505c69[_0x70aa('0x28')]);});}}exports[_0x70aa('0x29')]=defaultLicense;
\ No newline at end of file
index 1f52c13..e7e6f75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee5=['../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','format','grayReason','changed','message','sequelize','COUNT','col','role','user','telephone','users','telephones','admin','count','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','./hardware'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0xeee5,0x1c7));var _0x5eee=function(_0x508fb4,_0x153f85){_0x508fb4=_0x508fb4-0x0;var _0x5abce3=_0xeee5[_0x508fb4];return _0x5abce3;};'use strict';var util=require(_0x5eee('0x0'));var _=require(_0x5eee('0x1'));var moment=require(_0x5eee('0x2'));var BPromise=require(_0x5eee('0x3'));var hardware=require(_0x5eee('0x4'));var encryptor=require(_0x5eee('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5eee('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5eee('0x7'),'machineUuid':hardware[_0x5eee('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5eee('0x9'),'machineUuid':hardware[_0x5eee('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x17002a){return new BPromise(function(_0x3bfbf2,_0x551b00){return db[_0x5eee('0xa')]['find'](_['defaults'](_0x17002a,{'raw':!![],'where':{'id':0x1}}))[_0x5eee('0xb')](function(_0x2c2b8b){return checkLicense(_0x2c2b8b,null);})[_0x5eee('0xb')](function(_0x1ec4dd){_0x3bfbf2(_0x1ec4dd);return;})[_0x5eee('0xc')](function(_0x25271d){_0x551b00(_0x25271d);});});}function checkLicense(_0xadc6ab,_0x5ea940){if(!_0xadc6ab){demoLicense[_0x5eee('0xd')]=_0xadc6ab['data1'];return demoLicense;}try{var _0x209e98=_0x5ea940||_0xadc6ab[_0x5eee('0xe')];if(_[_0x5eee('0xf')](_0x209e98)){throw new Error(_0x5eee('0x10'));}var _0x1a4936=_0xadc6ab[_0x5eee('0x11')];var _0x1c5d8a=_0xadc6ab[_0x5eee('0x12')];var _0x254513=_0x1a4936[_0x5eee('0x13')]('-')[0x4];var _0x351a09=_0x1a4936['split']('-')[0x0];var _0x172476=encryptor[_0x5eee('0x14')](_0x209e98,util['format'](_0x5eee('0x15'),_0x254513,_0x1a4936,_0x351a09));var _0x34e329=JSON[_0x5eee('0x16')](_0x172476);_0x34e329['demo']=![];_0x34e329[_0x5eee('0xd')]=_0x1a4936;_0x34e329[_0x5eee('0x17')]=hardware[_0x5eee('0x8')]();if(_0x1c5d8a){var _0x30bb52=encryptor[_0x5eee('0x14')](_0x1c5d8a);_0x34e329[_0x5eee('0x18')]=_0x30bb52;_0x34e329[_0x5eee('0x19')]=moment(_0x30bb52)[_0x5eee('0x1a')](0x7,_0x5eee('0x1b'))[_0x5eee('0x1c')]();_0x34e329[_0x5eee('0x1d')]=_0x34e329['uuid']!=_0x34e329[_0x5eee('0x17')]?_0x5eee('0x1e'):'disabled';}return _0x34e329;}catch(_0x19e9c1){breakingLicense['uuid']=_0xadc6ab[_0x5eee('0x11')];breakingLicense[_0x5eee('0x1f')]=_0x19e9c1['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4a9f43,_0x1029d7){getLicense()[_0x5eee('0xb')](function(_0x46614f){return db['User']['findAll']({'attributes':['role',[db[_0x5eee('0x20')]['fn'](_0x5eee('0x21'),db[_0x5eee('0x20')][_0x5eee('0x22')](_0x5eee('0x23'))),'count']],'group':_0x5eee('0x23'),'where':{'role':{'$or':['admin',_0x5eee('0x24'),_0x5eee('0x25')]}},'raw':!![]})['then'](function(_0x3ece67){var _0x3a4f8d={'user':_0x46614f[_0x5eee('0x26')]||0x0,'telephone':_0x46614f[_0x5eee('0x27')]||0x0};_0x3ece67['forEach'](function(_0x37c2a0){var _0x1f7721=_0x37c2a0[_0x5eee('0x23')]===_0x5eee('0x28')?'user':_0x37c2a0['role'];_0x3a4f8d[_0x1f7721]-=_0x37c2a0[_0x5eee('0x29')];if(_0x3a4f8d[_0x1f7721]<0x0)_0x3a4f8d[_0x1f7721]=0x0;});_0x4a9f43(_0x3a4f8d);return;});})[_0x5eee('0xc')](function(_0x54b706){_0x1029d7(_0x54b706);});});}function checkUserLimits(_0x4fe041){return new BPromise(function(_0x1b3c9c,_0x5e4e4a){getLimits()['then'](function(_0x20fc07){var _0x243e96=_[_0x5eee('0x2a')](_[_0x5eee('0x2b')](_0x4fe041,_0x5eee('0x23')),[_0x5eee('0x28'),_0x5eee('0x24'),_0x5eee('0x25')]);var _0x5dfcfc=(_0x243e96[_0x5eee('0x28')]||0x0)+(_0x243e96[_0x5eee('0x24')]||0x0);var _0x433765=_0x243e96['telephone']||0x0;if(_0x5dfcfc>_0x20fc07['user'])return _0x5e4e4a(_0x5eee('0x2c'));if(_0x433765>_0x20fc07[_0x5eee('0x25')])return _0x5e4e4a('License\x20limit\x20reached\x20for\x20telephones');return _0x1b3c9c();})['catch'](function(_0x33b6e5){_0x5e4e4a(_0x33b6e5);});});}module[_0x5eee('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x4789=['data1','data2','split','decryptString','format','%s:%s:%s','deadline','add','days','machineUuid','disabled','message','User','findAll','COUNT','sequelize','col','role','count','user','users','forEach','admin','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found'];(function(_0x453795,_0x25e16e){var _0x3d1b12=function(_0x21cea0){while(--_0x21cea0){_0x453795['push'](_0x453795['shift']());}};_0x3d1b12(++_0x25e16e);}(_0x4789,0x18c));var _0x9478=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x4789[_0xcfe8cc];return _0x55ac53;};'use strict';var util=require(_0x9478('0x0'));var _=require(_0x9478('0x1'));var moment=require('moment');var BPromise=require(_0x9478('0x2'));var hardware=require(_0x9478('0x3'));var encryptor=require(_0x9478('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9478('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9478('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9478('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9478('0x7'),'machineUuid':hardware[_0x9478('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x7d1b8d){return new BPromise(function(_0x66883a,_0x1a90bb){return db[_0x9478('0x9')][_0x9478('0xa')](_[_0x9478('0xb')](_0x7d1b8d,{'raw':!![],'where':{'id':0x1}}))[_0x9478('0xc')](function(_0x5db9b3){return checkLicense(_0x5db9b3,null);})[_0x9478('0xc')](function(_0x3bc075){_0x66883a(_0x3bc075);return;})[_0x9478('0xd')](function(_0x51c380){_0x1a90bb(_0x51c380);});});}function checkLicense(_0x2532e2,_0x54808a){if(!_0x2532e2){demoLicense[_0x9478('0xe')]=_0x2532e2['data1'];return demoLicense;}try{var _0x1e261c=_0x54808a||_0x2532e2[_0x9478('0xf')];if(_[_0x9478('0x10')](_0x1e261c)){throw new Error(_0x9478('0x11'));}var _0x4c7ad4=_0x2532e2[_0x9478('0x12')];var _0xd6808d=_0x2532e2[_0x9478('0x13')];var _0x1f7119=_0x4c7ad4[_0x9478('0x14')]('-')[0x4];var _0x28d0e2=_0x4c7ad4[_0x9478('0x14')]('-')[0x0];var _0x16637f=encryptor[_0x9478('0x15')](_0x1e261c,util[_0x9478('0x16')](_0x9478('0x17'),_0x1f7119,_0x4c7ad4,_0x28d0e2));var _0x5a71d5=JSON['parse'](_0x16637f);_0x5a71d5['demo']=![];_0x5a71d5[_0x9478('0xe')]=_0x4c7ad4;_0x5a71d5['machineUuid']=hardware[_0x9478('0x8')]();if(_0xd6808d){var _0x3bc089=encryptor[_0x9478('0x15')](_0xd6808d);_0x5a71d5['gray']=_0x3bc089;_0x5a71d5[_0x9478('0x18')]=moment(_0x3bc089)[_0x9478('0x19')](0x7,_0x9478('0x1a'))['format']();_0x5a71d5['grayReason']=_0x5a71d5['uuid']!=_0x5a71d5[_0x9478('0x1b')]?'changed':_0x9478('0x1c');}return _0x5a71d5;}catch(_0x46a04b){breakingLicense[_0x9478('0xe')]=_0x2532e2[_0x9478('0x12')];breakingLicense[_0x9478('0x1d')]=_0x46a04b[_0x9478('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x58b6d4,_0x178843){getLicense()[_0x9478('0xc')](function(_0x35026e){return db[_0x9478('0x1e')][_0x9478('0x1f')]({'attributes':['role',[db['sequelize']['fn'](_0x9478('0x20'),db[_0x9478('0x21')][_0x9478('0x22')](_0x9478('0x23'))),_0x9478('0x24')]],'group':_0x9478('0x23'),'where':{'role':{'$or':['admin',_0x9478('0x25'),'telephone']}},'raw':!![]})[_0x9478('0xc')](function(_0x155bbc){var _0x201fc8={'user':_0x35026e[_0x9478('0x26')]||0x0,'telephone':_0x35026e['telephones']||0x0};_0x155bbc[_0x9478('0x27')](function(_0x2fe4a4){var _0x134a93=_0x2fe4a4['role']===_0x9478('0x28')?_0x9478('0x25'):_0x2fe4a4['role'];_0x201fc8[_0x134a93]-=_0x2fe4a4[_0x9478('0x24')];if(_0x201fc8[_0x134a93]<0x0)_0x201fc8[_0x134a93]=0x0;});_0x58b6d4(_0x201fc8);return;});})[_0x9478('0xd')](function(_0x5dc770){_0x178843(_0x5dc770);});});}function checkUserLimits(_0x1e34ad){return new BPromise(function(_0x570797,_0x2658ce){getLimits()[_0x9478('0xc')](function(_0x5962e5){var _0x1b81e2=_[_0x9478('0x29')](_['countBy'](_0x1e34ad,_0x9478('0x23')),[_0x9478('0x28'),_0x9478('0x25'),_0x9478('0x2a')]);var _0x57aa87=(_0x1b81e2[_0x9478('0x28')]||0x0)+(_0x1b81e2[_0x9478('0x25')]||0x0);var _0x4edf46=_0x1b81e2[_0x9478('0x2a')]||0x0;if(_0x57aa87>_0x5962e5[_0x9478('0x25')])return _0x2658ce(_0x9478('0x2b'));if(_0x4edf46>_0x5962e5['telephone'])return _0x2658ce(_0x9478('0x2c'));return _0x570797();})['catch'](function(_0xf422ab){_0x2658ce(_0xf422ab);});});}module[_0x9478('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index f27298b..f24c6d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e7=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x25e7,0x1d6));var _0x725e=function(_0x3fe2ef,_0x211196){_0x3fe2ef=_0x3fe2ef-0x0;var _0x1fa60b=_0x25e7[_0x3fe2ef];return _0x1fa60b;};'use strict';module[_0x725e('0x0')]={'DOMAIN':_0x725e('0x1'),'SESSION_SECRET':_0x725e('0x2'),'GOOGLE_ID':_0x725e('0x3'),'GOOGLE_SECRET':_0x725e('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x0b0e=['secret','exports','myappanuglar-secret'];(function(_0x1158ec,_0x5421f7){var _0x289b12=function(_0x4749d5){while(--_0x4749d5){_0x1158ec['push'](_0x1158ec['shift']());}};_0x289b12(++_0x5421f7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4695e2,_0x3d5f15){_0x4695e2=_0x4695e2-0x0;var _0x160563=_0x0b0e[_0x4695e2];return _0x160563;};'use strict';module[_0xe0b0('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xe0b0('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xe0b0('0x2'),'DEBUG':''};
\ No newline at end of file
index 77f95e3..47344d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefde=['util','path','INFO','join','/var','format','%s-%s.log','message','replace','{{{','}}}','level','toUpperCase','exports','Logger','File','error','transports','info','Console','debugLevel','winston'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xefde,0x1a1));var _0xeefd=function(_0x50f3f7,_0x2d6e58){_0x50f3f7=_0x50f3f7-0x0;var _0x53ae8d=_0xefde[_0x50f3f7];return _0x53ae8d;};'use strict';var moment=require('moment');var winston=require(_0xeefd('0x0'));var util=require(_0xeefd('0x1'));var path=require(_0xeefd('0x2'));var debugLevel=_0xeefd('0x3');function filename(_0x5675e7,_0x2c1006){return path[_0xeefd('0x4')](_0xeefd('0x5'),'log','xcally',util[_0xeefd('0x6')](_0xeefd('0x7'),_0x5675e7,_0x2c1006));}function formatter(_0xe8200f,_0x3adc1d){_0x3adc1d[_0xeefd('0x8')]=_0x3adc1d[_0xeefd('0x8')][_0xeefd('0x9')](/@@{/g,_0xeefd('0xa'))[_0xeefd('0x9')](/}@@/g,_0xeefd('0xb'))[_0xeefd('0x9')](/@{/g,'{{')[_0xeefd('0x9')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x3adc1d[_0xeefd('0xc')][_0xeefd('0xd')](),_0xe8200f,_0x3adc1d['message']);}module[_0xeefd('0xe')]=function(_0x1c9fe2){return new winston[(_0xeefd('0xf'))]({'transports':[new winston['transports'][(_0xeefd('0x10'))]({'name':util[_0xeefd('0x6')]('%s-%s',_0x1c9fe2,_0xeefd('0x11')),'filename':filename(_0x1c9fe2,_0xeefd('0x11')),'level':_0xeefd('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x56863c){return formatter(_0x1c9fe2,_0x56863c);}}),new winston[(_0xeefd('0x12'))][(_0xeefd('0x10'))]({'name':util[_0xeefd('0x6')]('%s-%s',_0x1c9fe2,_0xeefd('0x13')),'filename':filename(_0x1c9fe2,_0xeefd('0x13')),'level':_0xeefd('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4daef1){return formatter(_0x1c9fe2,_0x4daef1);}}),new winston[(_0xeefd('0x12'))][(_0xeefd('0x14'))]({'level':process['env'][_0xeefd('0x15')]||debugLevel,'json':![],'formatter':function(_0x1aaf96){return formatter(_0x1c9fe2,_0x1aaf96);}})]});};
\ No newline at end of file
+var _0x85a3=['format','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','File','error','%s-%s','info','Console','env','winston','util','path','join','log','xcally'];(function(_0x2d2919,_0x572aec){var _0x49cd11=function(_0x2df841){while(--_0x2df841){_0x2d2919['push'](_0x2d2919['shift']());}};_0x49cd11(++_0x572aec);}(_0x85a3,0xa2));var _0x385a=function(_0x4018a2,_0x453cf7){_0x4018a2=_0x4018a2-0x0;var _0x19c62c=_0x85a3[_0x4018a2];return _0x19c62c;};'use strict';var moment=require('moment');var winston=require(_0x385a('0x0'));var util=require(_0x385a('0x1'));var path=require(_0x385a('0x2'));var debugLevel='INFO';function filename(_0x143fbf,_0x56ef3e){return path[_0x385a('0x3')]('/var',_0x385a('0x4'),_0x385a('0x5'),util[_0x385a('0x6')]('%s-%s.log',_0x143fbf,_0x56ef3e));}function formatter(_0x5d7f32,_0xd6d2ac){_0xd6d2ac['message']=_0xd6d2ac[_0x385a('0x7')][_0x385a('0x8')](/@@{/g,_0x385a('0x9'))[_0x385a('0x8')](/}@@/g,_0x385a('0xa'))[_0x385a('0x8')](/@{/g,'{{')[_0x385a('0x8')](/}@/g,'}}');return util[_0x385a('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x385a('0x6')](_0x385a('0xb')),_0xd6d2ac['level'][_0x385a('0xc')](),_0x5d7f32,_0xd6d2ac['message']);}module['exports']=function(_0x2ba5dd){return new winston[(_0x385a('0xd'))]({'transports':[new winston[(_0x385a('0xe'))][(_0x385a('0xf'))]({'name':util[_0x385a('0x6')]('%s-%s',_0x2ba5dd,'error'),'filename':filename(_0x2ba5dd,_0x385a('0x10')),'level':_0x385a('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1b8d0a){return formatter(_0x2ba5dd,_0x1b8d0a);}}),new winston[(_0x385a('0xe'))][(_0x385a('0xf'))]({'name':util['format'](_0x385a('0x11'),_0x2ba5dd,_0x385a('0x12')),'filename':filename(_0x2ba5dd,_0x385a('0x12')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ed368){return formatter(_0x2ba5dd,_0x3ed368);}}),new winston['transports'][(_0x385a('0x13'))]({'level':process[_0x385a('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x45faae){return formatter(_0x2ba5dd,_0x45faae);}})]});};
\ No newline at end of file
index c5cacfe..e36e44a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2b=['../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x45a541,_0x55e3c9){var _0x27cae8=function(_0x2648dd){while(--_0x2648dd){_0x45a541['push'](_0x45a541['shift']());}};_0x27cae8(++_0x55e3c9);}(_0x4e2b,0x76));var _0xb4e2=function(_0x53bf4b,_0x5b587b){_0x53bf4b=_0x53bf4b-0x0;var _0x3d160e=_0x4e2b[_0x53bf4b];return _0x3d160e;};'use strict';var path=require(_0xb4e2('0x0'));var os=require('os');var config={'apps':[{'name':_0xb4e2('0x1'),'script':path[_0xb4e2('0x2')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x3'))},{'name':'agi','script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x4'))},{'name':'email','script':path['join'](__dirname,_0xb4e2('0x5'))},{'name':_0xb4e2('0x6'),'script':path[_0xb4e2('0x2')](__dirname,_0xb4e2('0x7'))},{'name':_0xb4e2('0x8'),'script':path['join'](__dirname,_0xb4e2('0x9'))}]};module[_0xb4e2('0xa')]=config;
\ No newline at end of file
+var _0xe2f0=['routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2f0,0x148));var _0x0e2f=function(_0x5be7aa,_0x511ed0){_0x5be7aa=_0x5be7aa-0x0;var _0xcb1d4c=_0xe2f0[_0x5be7aa];return _0xcb1d4c;};'use strict';var path=require(_0x0e2f('0x0'));var os=require('os');var config={'apps':[{'name':_0x0e2f('0x1'),'script':path[_0x0e2f('0x2')](__dirname,_0x0e2f('0x3'))},{'name':_0x0e2f('0x4'),'script':path[_0x0e2f('0x2')](__dirname,_0x0e2f('0x5'))},{'name':'agi','script':path['join'](__dirname,_0x0e2f('0x6'))},{'name':_0x0e2f('0x7'),'script':path[_0x0e2f('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x0e2f('0x8'),'script':path[_0x0e2f('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x0e2f('0x9'),'script':path[_0x0e2f('0x2')](__dirname,_0x0e2f('0xa'))}]};module[_0x0e2f('0xb')]=config;
\ No newline at end of file
index 4281f42..0c1dbfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe11=['bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved'];(function(_0x283b55,_0x279bee){var _0x192e58=function(_0x535c7c){while(--_0x535c7c){_0x283b55['push'](_0x283b55['shift']());}};_0x192e58(++_0x279bee);}(_0xfe11,0x1dc));var _0x1fe1=function(_0x2a8010,_0x464b2a){_0x2a8010=_0x2a8010-0x0;var _0xddf282=_0xfe11[_0x2a8010];return _0xddf282;};'use strict';var pm2=require('pm2');var BPromise=require(_0x1fe1('0x0'));var config=require(_0x1fe1('0x1'));function connect(){return new BPromise(function(_0x3449ba,_0x46686a){return pm2[_0x1fe1('0x2')](function(_0x6bd38e){if(_0x6bd38e){return _0x46686a(_0x6bd38e);}return _0x3449ba(_0x1fe1('0x3'));});});};exports[_0x1fe1('0x4')]=function(_0x40e262){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x4b0504,_0x24804c){return pm2[_0x1fe1('0x4')](_0x40e262,function(_0x12ec13,_0x2a587f){if(_0x12ec13){return _0x24804c(_0x12ec13);}pm2[_0x1fe1('0x6')]();return _0x4b0504(_0x2a587f);});});});};exports[_0x1fe1('0x7')]=function(_0x2586e5){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x252513,_0x2e5681){return pm2[_0x1fe1('0x7')](_0x2586e5,function(_0x5cbdcb,_0x1f560a){if(_0x5cbdcb){return _0x2e5681(_0x5cbdcb);}pm2[_0x1fe1('0x6')]();return _0x252513(_0x1f560a);});});});};exports[_0x1fe1('0x8')]=function(_0xd5c2b3){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x2bbd74,_0x2db316){return pm2[_0x1fe1('0x8')](_0xd5c2b3,function(_0x5b82ed,_0x41a38d){if(_0x5b82ed){return _0x2db316(_0x5b82ed);}pm2[_0x1fe1('0x6')]();return _0x2bbd74(_0x41a38d);});});});};exports[_0x1fe1('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5b1e87,_0x117458){return pm2[_0x1fe1('0x9')](function(_0x5e354a,_0x2ebc4b){if(_0x5e354a){return _0x117458(_0x5e354a);}pm2[_0x1fe1('0x6')]();return _0x5b1e87(_0x2ebc4b);});});});};exports[_0x1fe1('0xa')]=function(_0x387795){return connect()['then'](function(){return new BPromise(function(_0x2e1439,_0x4667dc){return pm2['describe'](_0x387795,function(_0x573dc8,_0x12c249){if(_0x573dc8){return _0x4667dc(_0x573dc8);}pm2[_0x1fe1('0x6')]();return _0x2e1439(_0x12c249);});});});};exports[_0x1fe1('0xb')]=function(_0x39e582){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0xcd2ab1,_0x475d3a){return pm2[_0x1fe1('0xb')](_0x39e582,function(_0x33aa9d,_0x461fdf){if(_0x33aa9d){return _0x475d3a(_0x33aa9d);}pm2[_0x1fe1('0x6')]();return _0xcd2ab1(_0x461fdf);});});});};exports[_0x1fe1('0xc')]=function(){return connect()[_0x1fe1('0x5')](function(){return new BPromise(function(_0x2821a5,_0x306b8f){return pm2['dump'](function(_0x49c8ea){if(_0x49c8ea){return _0x306b8f(_0x49c8ea);}return _0x2821a5(_0x1fe1('0xd'));});});});};
\ No newline at end of file
+var _0x0669=['stop','then','disconnect','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x212b3a,_0x4313ed){var _0x54c59a=function(_0x14fb2c){while(--_0x14fb2c){_0x212b3a['push'](_0x212b3a['shift']());}};_0x54c59a(++_0x4313ed);}(_0x0669,0x126));var _0x9066=function(_0x1bda6c,_0x5440b1){_0x1bda6c=_0x1bda6c-0x0;var _0x501a86=_0x0669[_0x1bda6c];return _0x501a86;};'use strict';var pm2=require(_0x9066('0x0'));var BPromise=require(_0x9066('0x1'));var config=require(_0x9066('0x2'));function connect(){return new BPromise(function(_0x427bae,_0x5c6db7){return pm2[_0x9066('0x3')](function(_0x29b9f9){if(_0x29b9f9){return _0x5c6db7(_0x29b9f9);}return _0x427bae(_0x9066('0x4'));});});};exports['start']=function(_0x562fe8){return connect()['then'](function(){return new BPromise(function(_0x1fdc6a,_0x334d74){return pm2[_0x9066('0x5')](_0x562fe8,function(_0x4d355b,_0x12d93b){if(_0x4d355b){return _0x334d74(_0x4d355b);}pm2['disconnect']();return _0x1fdc6a(_0x12d93b);});});});};exports[_0x9066('0x6')]=function(_0x1a4221){return connect()[_0x9066('0x7')](function(){return new BPromise(function(_0x23485e,_0x4b4e4d){return pm2[_0x9066('0x6')](_0x1a4221,function(_0x428fd2,_0x2cdf55){if(_0x428fd2){return _0x4b4e4d(_0x428fd2);}pm2[_0x9066('0x8')]();return _0x23485e(_0x2cdf55);});});});};exports[_0x9066('0x9')]=function(_0x544ff2){return connect()[_0x9066('0x7')](function(){return new BPromise(function(_0x51dca8,_0x39f0cd){return pm2['restart'](_0x544ff2,function(_0x4e75a8,_0x5d7384){if(_0x4e75a8){return _0x39f0cd(_0x4e75a8);}pm2['disconnect']();return _0x51dca8(_0x5d7384);});});});};exports[_0x9066('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x411eec,_0x33ee8d){return pm2[_0x9066('0xa')](function(_0x2d679d,_0x126f22){if(_0x2d679d){return _0x33ee8d(_0x2d679d);}pm2[_0x9066('0x8')]();return _0x411eec(_0x126f22);});});});};exports[_0x9066('0xb')]=function(_0xf87397){return connect()[_0x9066('0x7')](function(){return new BPromise(function(_0x12ae0f,_0xab7609){return pm2['describe'](_0xf87397,function(_0x39750e,_0x5abf34){if(_0x39750e){return _0xab7609(_0x39750e);}pm2['disconnect']();return _0x12ae0f(_0x5abf34);});});});};exports[_0x9066('0xc')]=function(_0x13f1f9){return connect()[_0x9066('0x7')](function(){return new BPromise(function(_0x131ae9,_0xfe2e28){return pm2[_0x9066('0xc')](_0x13f1f9,function(_0x5b05f9,_0x1a71b7){if(_0x5b05f9){return _0xfe2e28(_0x5b05f9);}pm2['disconnect']();return _0x131ae9(_0x1a71b7);});});});};exports[_0x9066('0xd')]=function(){return connect()[_0x9066('0x7')](function(){return new BPromise(function(_0x3236b5,_0x721ebc){return pm2[_0x9066('0xd')](function(_0x264b4a){if(_0x264b4a){return _0x721ebc(_0x264b4a);}return _0x3236b5(_0x9066('0xe'));});});});};
\ No newline at end of file
index 48d1407..e24d3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x090b=['ChatInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','join','chatInteraction:update','catch','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','defaults','redis','socket.io-emitter','find','then','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x1c9b9f,_0xe5a84a){var _0x56684a=function(_0x3917ee){while(--_0x3917ee){_0x1c9b9f['push'](_0x1c9b9f['shift']());}};_0x56684a(++_0xe5a84a);}(_0x090b,0x19f));var _0xb090=function(_0x131248,_0x324b5e){_0x131248=_0x131248-0x0;var _0x14c54f=_0x090b[_0x131248];return _0x14c54f;};'use strict';var _=require(_0xb090('0x0'));var moment=require(_0xb090('0x1'));var Redis=require(_0xb090('0x2'));var util=require(_0xb090('0x3'));var config=require('../../config/environment');var db=require(_0xb090('0x4'))['db'];var logger=require(_0xb090('0x5'))(_0xb090('0x6'));config['redis']=_[_0xb090('0x7')](config[_0xb090('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb090('0x9'))(new Redis(config[_0xb090('0x8')]));function closeInteractions(){var _0xe4431e=0x0;var _0x2797c5=[];return db['Setting'][_0xb090('0xa')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xb090('0xb')](function(_0x457666){_0xe4431e=_0x457666['chatTimeout'];if(_0xe4431e){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x457666['chatTimeout'],_0xb090('0xc'))}}});}else{return[];}})[_0xb090('0xb')](function(_0x2805b2){if(_0x2805b2&&_0x2805b2[_0xb090('0xd')]){_0x2797c5=_[_0xb090('0xe')](_0x2805b2||[],'id');logger[_0xb090('0xf')](_0xb090('0x10'),_0x2797c5['join']());return db[_0xb090('0x11')][_0xb090('0x12')]({'closeReason':_0xb090('0x13'),'disposition':_0xb090('0x14'),'closed':!![],'closedAt':moment()['format'](_0xb090('0x15'))},{'where':{'id':_0x2797c5}});}})['then'](function(){if(_0x2797c5&&_0x2797c5[_0xb090('0xd')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x2797c5[_0xb090('0x16')]());for(var _0x13aa7e=0x0;_0x13aa7e<_0x2797c5[_0xb090('0xd')];_0x13aa7e++){io['emit'](_0xb090('0x17'),{'id':_0x2797c5[_0x13aa7e],'closed':!![]});}}})[_0xb090('0x18')](function(_0x116c9b){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x116c9b?util[_0xb090('0x19')](_0x116c9b,{'showHidden':![],'depth':null}):'');});}exports[_0xb090('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xe6a8=['../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment'];(function(_0x102469,_0x3af853){var _0x57cd31=function(_0x57de24){while(--_0x57de24){_0x102469['push'](_0x102469['shift']());}};_0x57cd31(++_0x3af853);}(_0xe6a8,0xea));var _0x8e6a=function(_0x5d3802,_0x47e4f7){_0x5d3802=_0x5d3802-0x0;var _0x286d29=_0xe6a8[_0x5d3802];return _0x286d29;};'use strict';var _=require(_0x8e6a('0x0'));var moment=require(_0x8e6a('0x1'));var Redis=require('ioredis');var util=require(_0x8e6a('0x2'));var config=require(_0x8e6a('0x3'));var db=require(_0x8e6a('0x4'))['db'];var logger=require(_0x8e6a('0x5'))('schedule');config[_0x8e6a('0x6')]=_[_0x8e6a('0x7')](config[_0x8e6a('0x6')],{'host':_0x8e6a('0x8'),'port':0x18eb});var io=require(_0x8e6a('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x47a1d4=0x0;var _0x24a366=[];return db[_0x8e6a('0xa')][_0x8e6a('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x8e6a('0xc')](function(_0x50b07f){_0x47a1d4=_0x50b07f[_0x8e6a('0xd')];if(_0x47a1d4){return db['ChatInteraction'][_0x8e6a('0xe')]({'raw':!![],'attributes':['id',_0x8e6a('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x8e6a('0x10')](_0x50b07f[_0x8e6a('0xd')],_0x8e6a('0x11'))}}});}else{return[];}})[_0x8e6a('0xc')](function(_0x4d92cb){if(_0x4d92cb&&_0x4d92cb[_0x8e6a('0x12')]){_0x24a366=_[_0x8e6a('0x13')](_0x4d92cb||[],'id');logger[_0x8e6a('0x14')](_0x8e6a('0x15'),_0x24a366['join']());return db[_0x8e6a('0x16')][_0x8e6a('0x17')]({'closeReason':_0x8e6a('0x18'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x8e6a('0x19')](_0x8e6a('0x1a'))},{'where':{'id':_0x24a366}});}})[_0x8e6a('0xc')](function(){if(_0x24a366&&_0x24a366[_0x8e6a('0x12')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x24a366[_0x8e6a('0x1b')]());for(var _0x57d9f6=0x0;_0x57d9f6<_0x24a366['length'];_0x57d9f6++){io[_0x8e6a('0x1c')](_0x8e6a('0x1d'),{'id':_0x24a366[_0x57d9f6],'closed':!![]});}}})[_0x8e6a('0x1e')](function(_0x3e1dc6){logger[_0x8e6a('0x1f')]('[CHAT]\x20Error\x20closing\x20interactions',_0x3e1dc6?util[_0x8e6a('0x20')](_0x3e1dc6,{'showHidden':![],'depth':null}):'');});}exports[_0x8e6a('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 7cdaef8..9d331d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdada=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','catch','CustomReportId','Schedule','findAll','MailServerOut','keys','map','toString','difference','intersection','length','stop','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','add','add\x20cron','exists','deleteJob','stop\x20cron','active','update','run','start','util','path','lodash','moment','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','%s.%s','zip','join','status','Sent','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','text'];(function(_0xeb8c5c,_0x5ae487){var _0x445bcf=function(_0x400a40){while(--_0x400a40){_0xeb8c5c['push'](_0xeb8c5c['shift']());}};_0x445bcf(++_0x5ae487);}(_0xdada,0x1d6));var _0xadad=function(_0x2ff42d,_0x251617){_0x2ff42d=_0x2ff42d-0x0;var _0x4a0c87=_0xdada[_0x2ff42d];return _0x4a0c87;};'use strict';var fs=require('fs');var util=require(_0xadad('0x0'));var path=require(_0xadad('0x1'));var _=require(_0xadad('0x2'));var moment=require(_0xadad('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xadad('0x4'));var BPromise=require('bluebird');var logger=require(_0xadad('0x5'))('schedule');var db=require(_0xadad('0x6'))['db'];var analyticCustomReportController=require(_0xadad('0x7'));var analyticDefaultReportController=require(_0xadad('0x8'));var client=jayson['client'][_0xadad('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2ea8ba,_0x18f9c3){return function(){logger[_0xadad('0xa')](_0xadad('0xb'),_0x2ea8ba[_0xadad('0xc')]);var _0x267497=!![];var _0x338aca={'tls':{'rejectUnauthorized':![]}};if(_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0xf')]){_0x338aca[_0xadad('0xf')]=_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0xf')];}else{_0x338aca[_0xadad('0x10')]=_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x10')];_0x338aca['port']=_0x2ea8ba[_0xadad('0xd')]['Smtp'][_0xadad('0x11')];_0x338aca[_0xadad('0x12')]=_0x2ea8ba['MailAccount'][_0xadad('0xe')][_0xadad('0x12')];}if(_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x13')]){_0x338aca[_0xadad('0x14')]={'user':_0x2ea8ba['MailAccount']['Smtp'][_0xadad('0x15')],'pass':_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x16')]};}var _0x217d2f={'account':_0x338aca,'message':{'from':util[_0xadad('0x17')](_0xadad('0x18'),_0x2ea8ba[_0xadad('0xd')][_0xadad('0x19')],_0x2ea8ba['MailAccount'][_0xadad('0xc')]||_0x2ea8ba[_0xadad('0xd')][_0xadad('0xe')][_0xadad('0x15')]),'to':_0x2ea8ba[_0xadad('0xc')],'cc':_0x2ea8ba['cc'],'bcc':_0x2ea8ba['bcc'],'subject':util[_0xadad('0x17')](_0xadad('0x1a'),_0x18f9c3[_0xadad('0x19')],_0x2ea8ba[_0xadad('0x1b')],_0x2ea8ba[_0xadad('0x1c')])}};var _0x740501=path['join'](__dirname,_0xadad('0x1d'));var _0x2adf76=_0x18f9c3['savename'];var _0x133b97=util[_0xadad('0x17')](_0xadad('0x1e'),path['basename'](_0x18f9c3['savename'],path['extname'](_0x18f9c3['savename'])),_0xadad('0x1f'));var _0x398ce5=path[_0xadad('0x20')](_0x740501,_0x2adf76);var _0x2c530f=path['join'](_0x740501,_0x133b97);if(fs['existsSync'](_0x398ce5)){_0x18f9c3[_0xadad('0x21')]=_0xadad('0x22');_0x217d2f[_0xadad('0x23')]['attachments']=[{'filename':_0x2adf76,'path':_0x398ce5}];_0x217d2f['message']['text']=util[_0xadad('0x17')](_0xadad('0x24'),JSON[_0xadad('0x25')](_0x18f9c3,null,0x2));}else if(fs[_0xadad('0x26')](_0x2c530f)){_0x18f9c3[_0xadad('0x21')]='Sent';_0x217d2f[_0xadad('0x23')]['attachments']=[{'filename':_0x133b97,'path':_0x2c530f}];}else{_0x217d2f[_0xadad('0x23')][_0xadad('0x27')]=_0xadad('0x28');if(!_0x2ea8ba[_0xadad('0x29')]){_0x267497=![];logger['info'](_0xadad('0x2a'));}}if(_0x267497){return client['request']('SendMail',_0x217d2f)[_0xadad('0x2b')](function(_0x2e22ac){if(_0x2e22ac[_0xadad('0x2c')]){return logger[_0xadad('0x2c')](_0xadad('0x2d'),JSON[_0xadad('0x25')](_0x2e22ac));}return logger[_0xadad('0xa')](_0xadad('0x2e'));})['catch'](function(_0x582e48){return logger['error'](_0xadad('0x2d'),JSON['stringify'](_0x582e48));});}};}function handleError(){return function(_0x4e9a14){return logger[_0xadad('0x2c')](JSON[_0xadad('0x25')](_0x4e9a14));};}function handleResult(_0x5ce726){return function(_0x24e9ba){logger[_0xadad('0xa')](_0xadad('0x2f'),JSON['stringify'](_0x24e9ba));if(_0x5ce726[_0xadad('0xd')]&&_0x5ce726['MailAccount'][_0xadad('0xe')]&&!_['isNil'](_0x5ce726[_0xadad('0xc')])){setTimeout(handleSendEmail(_0x5ce726,_0x24e9ba),0x3c*0x3e8);}};}function handleJob(_0x594e9b){return function(){try{if(_[_0xadad('0x30')](_0x594e9b[_0xadad('0x1b')])){return logger[_0xadad('0xa')](_0xadad('0x31'));}if(_[_0xadad('0x30')](_0x594e9b[_0xadad('0x1c')])){return logger[_0xadad('0xa')](_0xadad('0x32'));}var _0xdf17ab={'startDate':moment()['subtract'](_0x594e9b['subtractNumber'],_0x594e9b[_0xadad('0x1c')])[_0xadad('0x17')](_0xadad('0x33')),'endDate':moment()[_0xadad('0x17')](_0xadad('0x33')),'type':'scheduled','output':_0x594e9b[_0xadad('0x34')],'name':_0x594e9b[_0xadad('0x19')]};if(!_['isNil'](_0x594e9b[_0xadad('0x35')])){logger[_0xadad('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x594e9b[_0xadad('0x35')]);return analyticDefaultReportController[_0xadad('0x36')]({'id':_0x594e9b[_0xadad('0x35')]},_0xdf17ab)[_0xadad('0x2b')](handleResult(_0x594e9b))[_0xadad('0x37')](handleError());}if(!_[_0xadad('0x30')](_0x594e9b[_0xadad('0x38')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x594e9b[_0xadad('0x38')]);return analyticCustomReportController[_0xadad('0x36')]({'id':_0x594e9b[_0xadad('0x38')]},_0xdf17ab)[_0xadad('0x2b')](handleResult(_0x594e9b))['catch'](handleError());}}catch(_0xd44355){logger['error'](JSON['stringify'](_0xd44355));}return logger[_0xadad('0xa')]('no\x20report\x20id');};}function getJobs(_0x1402ec){var _0x3f34c5={};if(_0x1402ec){_0x3f34c5['id']=_0x1402ec;}return db[_0xadad('0x39')][_0xadad('0x3a')]({'where':_0x3f34c5,'include':[{'model':db[_0xadad('0xd')],'attributes':['id','name',_0xadad('0xc')],'include':[{'model':db[_0xadad('0x3b')],'as':_0xadad('0xe')}]}]})['then'](function(_0x23dfd0){var _0x1c0433=_[_0xadad('0x3c')](manager['jobs']);var _0x2b9107=_[_0xadad('0x3d')](_0x23dfd0,function(_0x1598ce){return _0x1598ce['id'][_0xadad('0x3e')]();});var _0xfee21c=_['keyBy'](_0x23dfd0,function(_0x15639c){return _0x15639c['id']['toString']();});var _0xc79a18=_0x1402ec?_0x2b9107:_[_0xadad('0x3f')](_0x2b9107,_0x1c0433);var _0x4e305e=_[_0xadad('0x40')](_0x2b9107,_0x1c0433);var _0x1fd271=_['difference'](_0x1c0433,_0x2b9107);var _0x45c81f;var _0x913aa9;for(_0x45c81f=0x0;_0x45c81f<_0x1fd271[_0xadad('0x41')]&&!_0x1402ec;_0x45c81f+=0x1){_0x913aa9=_0x1fd271[_0x45c81f][_0xadad('0x3e')]();if(manager['exists'](_0x913aa9)){manager[_0xadad('0x42')](_0x913aa9);manager['deleteJob'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x43'),_0x913aa9);}}logger[_0xadad('0xa')](_0xadad('0x44'),JSON[_0xadad('0x25')](_0xc79a18));for(_0x45c81f=0x0;_0x45c81f<_0xc79a18['length'];_0x45c81f+=0x1){_0x913aa9=_0xc79a18[_0x45c81f]['toString']();logger[_0xadad('0xa')](_0xadad('0x45'),_0x913aa9);if(_0x1402ec){logger['info'](_0xadad('0x46'),_0x1402ec);logger[_0xadad('0xa')](JSON[_0xadad('0x25')](_0xfee21c[_0x913aa9]));BPromise[_0xadad('0x47')]()[_0xadad('0x2b')](handleJob(_0xfee21c[_0x913aa9]));logger[_0xadad('0xa')](_0xadad('0x48'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else if(_0xfee21c[_0x913aa9][_0xadad('0x49')]&&_0xfee21c[_0x913aa9]['active']&&moment()[_0xadad('0x4a')](_0xfee21c[_0x913aa9][_0xadad('0x4b')],_0xfee21c[_0x913aa9]['endAt'])){manager[_0xadad('0x4c')](_0x913aa9,_0xfee21c[_0x913aa9][_0xadad('0x49')],handleJob(_0xfee21c[_0x913aa9]));manager['start'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x4d'),_0xfee21c[_0x913aa9]['name'],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else if(manager[_0xadad('0x4e')](_0x913aa9)){manager[_0xadad('0x42')](_0x913aa9);manager[_0xadad('0x4f')](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x50'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9]['cron']);}}for(_0x45c81f=0x0,_0x913aa9;_0x45c81f<_0x4e305e[_0xadad('0x41')]&&!_0x1402ec;_0x45c81f+=0x1){_0x913aa9=_0x4e305e[_0x45c81f][_0xadad('0x3e')]();if(manager[_0xadad('0x4e')](_0x913aa9)){if(_0xfee21c[_0x913aa9][_0xadad('0x49')]&&_0xfee21c[_0x913aa9][_0xadad('0x51')]&&moment()[_0xadad('0x4a')](_0xfee21c[_0x913aa9][_0xadad('0x4b')],_0xfee21c[_0x913aa9]['endAt'])){manager[_0xadad('0x52')](_0x913aa9,_0xfee21c[_0x913aa9][_0xadad('0x49')],handleJob(_0xfee21c[_0x913aa9]));logger[_0xadad('0xa')]('update\x20cron',_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}else{manager[_0xadad('0x42')](_0x913aa9);manager['deleteJob'](_0x913aa9);logger[_0xadad('0xa')](_0xadad('0x50'),_0xfee21c[_0x913aa9][_0xadad('0x19')],_0xfee21c[_0x913aa9][_0xadad('0x49')]);}}}})[_0xadad('0x37')](function(_0xbd3674){logger[_0xadad('0x2c')](JSON[_0xadad('0x25')](_0xbd3674));});}exports[_0xadad('0x53')]=function(_0x17232e){return getJobs(_0x17232e);};exports[_0xadad('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xc906=['deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','stop\x20cron','update','util','lodash','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','port','secure','authentication','auth','user','format','\x22%s\x22\x20<%s>','email','name','subtractUnit','savename','%s.%s','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','data','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','isNil','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','catch','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists'];(function(_0xe358c,_0xb802b5){var _0x472f8c=function(_0x2318c9){while(--_0x2318c9){_0xe358c['push'](_0xe358c['shift']());}};_0x472f8c(++_0xb802b5);}(_0xc906,0x1bb));var _0x6c90=function(_0x327d7e,_0x4ec62d){_0x327d7e=_0x327d7e-0x0;var _0x4349ed=_0xc906[_0x327d7e];return _0x4349ed;};'use strict';var fs=require('fs');var util=require(_0x6c90('0x0'));var path=require('path');var _=require(_0x6c90('0x1'));var moment=require('moment');var CronJobManager=require(_0x6c90('0x2'));var jayson=require(_0x6c90('0x3'));var BPromise=require(_0x6c90('0x4'));var logger=require(_0x6c90('0x5'))(_0x6c90('0x6'));var db=require(_0x6c90('0x7'))['db'];var analyticCustomReportController=require(_0x6c90('0x8'));var analyticDefaultReportController=require(_0x6c90('0x9'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x394c5a,_0x460711){return function(){logger['info'](_0x6c90('0xa'),_0x394c5a['email']);var _0x365ddc=!![];var _0x35b43f={'tls':{'rejectUnauthorized':![]}};if(_0x394c5a[_0x6c90('0xb')][_0x6c90('0xc')]['service']){_0x35b43f[_0x6c90('0xd')]=_0x394c5a['MailAccount']['Smtp'][_0x6c90('0xd')];}else{_0x35b43f['host']=_0x394c5a['MailAccount'][_0x6c90('0xc')]['host'];_0x35b43f[_0x6c90('0xe')]=_0x394c5a['MailAccount'][_0x6c90('0xc')][_0x6c90('0xe')];_0x35b43f[_0x6c90('0xf')]=_0x394c5a['MailAccount']['Smtp'][_0x6c90('0xf')];}if(_0x394c5a[_0x6c90('0xb')][_0x6c90('0xc')][_0x6c90('0x10')]){_0x35b43f[_0x6c90('0x11')]={'user':_0x394c5a[_0x6c90('0xb')]['Smtp'][_0x6c90('0x12')],'pass':_0x394c5a['MailAccount']['Smtp']['pass']};}var _0x1564da={'account':_0x35b43f,'message':{'from':util[_0x6c90('0x13')](_0x6c90('0x14'),_0x394c5a[_0x6c90('0xb')]['name'],_0x394c5a[_0x6c90('0xb')][_0x6c90('0x15')]||_0x394c5a[_0x6c90('0xb')][_0x6c90('0xc')]['user']),'to':_0x394c5a[_0x6c90('0x15')],'cc':_0x394c5a['cc'],'bcc':_0x394c5a['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x460711[_0x6c90('0x16')],_0x394c5a['subtractNumber'],_0x394c5a[_0x6c90('0x17')])}};var _0x4da15f=path['join'](__dirname,'../../files/reports');var _0x55a6c1=_0x460711[_0x6c90('0x18')];var _0x41ec7d=util[_0x6c90('0x13')](_0x6c90('0x19'),path['basename'](_0x460711[_0x6c90('0x18')],path['extname'](_0x460711[_0x6c90('0x18')])),_0x6c90('0x1a'));var _0x2191a6=path[_0x6c90('0x1b')](_0x4da15f,_0x55a6c1);var _0x49d518=path['join'](_0x4da15f,_0x41ec7d);if(fs[_0x6c90('0x1c')](_0x2191a6)){_0x460711[_0x6c90('0x1d')]=_0x6c90('0x1e');_0x1564da[_0x6c90('0x1f')][_0x6c90('0x20')]=[{'filename':_0x55a6c1,'path':_0x2191a6}];_0x1564da[_0x6c90('0x1f')][_0x6c90('0x21')]=util[_0x6c90('0x13')](_0x6c90('0x22'),JSON[_0x6c90('0x23')](_0x460711,null,0x2));}else if(fs['existsSync'](_0x49d518)){_0x460711[_0x6c90('0x1d')]=_0x6c90('0x1e');_0x1564da[_0x6c90('0x1f')][_0x6c90('0x20')]=[{'filename':_0x41ec7d,'path':_0x49d518}];}else{_0x1564da['message'][_0x6c90('0x21')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x394c5a['sendIfEmpty']){_0x365ddc=![];logger[_0x6c90('0x24')](_0x6c90('0x25'));}}if(_0x365ddc){return client['request'](_0x6c90('0x26'),_0x1564da)[_0x6c90('0x27')](function(_0x47108e){if(_0x47108e[_0x6c90('0x28')]){return logger['error'](_0x6c90('0x29'),JSON[_0x6c90('0x23')](_0x47108e));}return logger[_0x6c90('0x24')](_0x6c90('0x2a'));})['catch'](function(_0x576786){return logger[_0x6c90('0x28')]('error\x20mail',JSON[_0x6c90('0x23')](_0x576786));});}};}function handleError(){return function(_0xd03c1c){return logger['error'](JSON[_0x6c90('0x23')](_0xd03c1c));};}function handleResult(_0x160b16){return function(_0x13d61c){logger[_0x6c90('0x24')](_0x6c90('0x2b'),JSON['stringify'](_0x13d61c));if(_0x160b16['MailAccount']&&_0x160b16[_0x6c90('0xb')]['Smtp']&&!_['isNil'](_0x160b16[_0x6c90('0x15')])){setTimeout(handleSendEmail(_0x160b16,_0x13d61c),0x3c*0x3e8);}};}function handleJob(_0x1c07e4){return function(){try{if(_['isNil'](_0x1c07e4['subtractNumber'])){return logger[_0x6c90('0x24')](_0x6c90('0x2c'));}if(_['isNil'](_0x1c07e4[_0x6c90('0x17')])){return logger['info'](_0x6c90('0x2d'));}var _0x217dab={'startDate':moment()[_0x6c90('0x2e')](_0x1c07e4[_0x6c90('0x2f')],_0x1c07e4[_0x6c90('0x17')])[_0x6c90('0x13')](_0x6c90('0x30')),'endDate':moment()[_0x6c90('0x13')](_0x6c90('0x30')),'type':'scheduled','output':_0x1c07e4['output'],'name':_0x1c07e4[_0x6c90('0x16')]};if(!_[_0x6c90('0x31')](_0x1c07e4[_0x6c90('0x32')])){logger[_0x6c90('0x24')]('exec\x20defaul\x20report\x20id:%s',_0x1c07e4[_0x6c90('0x32')]);return analyticDefaultReportController[_0x6c90('0x33')]({'id':_0x1c07e4[_0x6c90('0x32')]},_0x217dab)[_0x6c90('0x27')](handleResult(_0x1c07e4))['catch'](handleError());}if(!_['isNil'](_0x1c07e4[_0x6c90('0x34')])){logger['info'](_0x6c90('0x35'),_0x1c07e4[_0x6c90('0x34')]);return analyticCustomReportController[_0x6c90('0x33')]({'id':_0x1c07e4['CustomReportId']},_0x217dab)[_0x6c90('0x27')](handleResult(_0x1c07e4))[_0x6c90('0x36')](handleError());}}catch(_0x37bd3a){logger[_0x6c90('0x28')](JSON[_0x6c90('0x23')](_0x37bd3a));}return logger[_0x6c90('0x24')](_0x6c90('0x37'));};}function getJobs(_0xdf343){var _0x457852={};if(_0xdf343){_0x457852['id']=_0xdf343;}return db['Schedule'][_0x6c90('0x38')]({'where':_0x457852,'include':[{'model':db['MailAccount'],'attributes':['id',_0x6c90('0x16'),'email'],'include':[{'model':db[_0x6c90('0x39')],'as':_0x6c90('0xc')}]}]})[_0x6c90('0x27')](function(_0x9760a0){var _0x1d251e=_[_0x6c90('0x3a')](manager[_0x6c90('0x3b')]);var _0x3721b9=_[_0x6c90('0x3c')](_0x9760a0,function(_0x23d8f4){return _0x23d8f4['id'][_0x6c90('0x3d')]();});var _0x3eca30=_[_0x6c90('0x3e')](_0x9760a0,function(_0x2b7f3c){return _0x2b7f3c['id'][_0x6c90('0x3d')]();});var _0x1e9533=_0xdf343?_0x3721b9:_[_0x6c90('0x3f')](_0x3721b9,_0x1d251e);var _0x8c83c3=_[_0x6c90('0x40')](_0x3721b9,_0x1d251e);var _0x53ae28=_['difference'](_0x1d251e,_0x3721b9);var _0x10d04e;var _0x361c81;for(_0x10d04e=0x0;_0x10d04e<_0x53ae28[_0x6c90('0x41')]&&!_0xdf343;_0x10d04e+=0x1){_0x361c81=_0x53ae28[_0x10d04e][_0x6c90('0x3d')]();if(manager[_0x6c90('0x42')](_0x361c81)){manager['stop'](_0x361c81);manager[_0x6c90('0x43')](_0x361c81);logger[_0x6c90('0x24')](_0x6c90('0x44'),_0x361c81);}}logger[_0x6c90('0x24')](_0x6c90('0x45'),JSON[_0x6c90('0x23')](_0x1e9533));for(_0x10d04e=0x0;_0x10d04e<_0x1e9533[_0x6c90('0x41')];_0x10d04e+=0x1){_0x361c81=_0x1e9533[_0x10d04e]['toString']();logger[_0x6c90('0x24')](_0x6c90('0x46'),_0x361c81);if(_0xdf343){logger[_0x6c90('0x24')](_0x6c90('0x47'),_0xdf343);logger[_0x6c90('0x24')](JSON[_0x6c90('0x23')](_0x3eca30[_0x361c81]));BPromise[_0x6c90('0x48')]()[_0x6c90('0x27')](handleJob(_0x3eca30[_0x361c81]));logger[_0x6c90('0x24')](_0x6c90('0x49'),_0x3eca30[_0x361c81][_0x6c90('0x16')],_0x3eca30[_0x361c81][_0x6c90('0x4a')]);}else if(_0x3eca30[_0x361c81]['cron']&&_0x3eca30[_0x361c81][_0x6c90('0x4b')]&&moment()[_0x6c90('0x4c')](_0x3eca30[_0x361c81][_0x6c90('0x4d')],_0x3eca30[_0x361c81][_0x6c90('0x4e')])){manager[_0x6c90('0x4f')](_0x361c81,_0x3eca30[_0x361c81][_0x6c90('0x4a')],handleJob(_0x3eca30[_0x361c81]));manager[_0x6c90('0x50')](_0x361c81);logger[_0x6c90('0x24')](_0x6c90('0x51'),_0x3eca30[_0x361c81][_0x6c90('0x16')],_0x3eca30[_0x361c81]['cron']);}else if(manager[_0x6c90('0x42')](_0x361c81)){manager[_0x6c90('0x52')](_0x361c81);manager[_0x6c90('0x43')](_0x361c81);logger[_0x6c90('0x24')](_0x6c90('0x53'),_0x3eca30[_0x361c81][_0x6c90('0x16')],_0x3eca30[_0x361c81][_0x6c90('0x4a')]);}}for(_0x10d04e=0x0,_0x361c81;_0x10d04e<_0x8c83c3[_0x6c90('0x41')]&&!_0xdf343;_0x10d04e+=0x1){_0x361c81=_0x8c83c3[_0x10d04e][_0x6c90('0x3d')]();if(manager['exists'](_0x361c81)){if(_0x3eca30[_0x361c81][_0x6c90('0x4a')]&&_0x3eca30[_0x361c81]['active']&&moment()[_0x6c90('0x4c')](_0x3eca30[_0x361c81]['startAt'],_0x3eca30[_0x361c81][_0x6c90('0x4e')])){manager[_0x6c90('0x54')](_0x361c81,_0x3eca30[_0x361c81][_0x6c90('0x4a')],handleJob(_0x3eca30[_0x361c81]));logger[_0x6c90('0x24')]('update\x20cron',_0x3eca30[_0x361c81][_0x6c90('0x16')],_0x3eca30[_0x361c81][_0x6c90('0x4a')]);}else{manager['stop'](_0x361c81);manager['deleteJob'](_0x361c81);logger[_0x6c90('0x24')](_0x6c90('0x53'),_0x3eca30[_0x361c81][_0x6c90('0x16')],_0x3eca30[_0x361c81][_0x6c90('0x4a')]);}}}})[_0x6c90('0x36')](function(_0x24541b){logger[_0x6c90('0x28')](JSON[_0x6c90('0x23')](_0x24541b));});}exports['run']=function(_0x4bc752){return getJobs(_0x4bc752);};exports[_0x6c90('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 83e3e88..8f4e2f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee0=['COMPLETED','TranscriptionJobStatus','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','then','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Mixed','catch','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','name','start','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','transcribeName','data1','data2','transcribeRegion','info','format','TranscriptionJob','fileText'];(function(_0x237956,_0x39a33f){var _0x38e407=function(_0x6e5616){while(--_0x6e5616){_0x237956['push'](_0x237956['shift']());}};_0x38e407(++_0x39a33f);}(_0xbee0,0x147));var _0x0bee=function(_0x334344,_0x4ec177){_0x334344=_0x334344-0x0;var _0x2b035b=_0xbee0[_0x334344];return _0x2b035b;};var _=require('lodash');var AWS=require(_0x0bee('0x0'));var rp=require(_0x0bee('0x1'));var util=require(_0x0bee('0x2'));var BPromise=require(_0x0bee('0x3'));var db=require(_0x0bee('0x4'))['db'];var logger=require(_0x0bee('0x5'))(_0x0bee('0x6'));function getTranscriptionJob(_0xaed51f,_0x4ac5c8,_0x57973b,_0x5871bc){return new Promise(function(_0xd0c8f,_0xa3a091){var _0x3e499b=new AWS[(_0x0bee('0x7'))]({'accessKeyId':_0x4ac5c8,'secretAccessKey':_0xaed51f,'region':_0x57973b});_0x3e499b['getTranscriptionJob']({'TranscriptionJobName':_0x5871bc},function(_0x163a08,_0x123424){if(_0x163a08){return _0xa3a091(_0x163a08);}else{return _0xd0c8f(_0x123424);}});});}function sentiment(_0x19d117,_0x314f79,_0x53a9af,_0x45b1aa,_0x36bb41){return new Promise(function(_0x162614,_0x100031){var _0xe11dcb=new AWS[(_0x0bee('0x8'))]({'accessKeyId':_0x314f79,'secretAccessKey':_0x19d117,'region':_0x53a9af});_0xe11dcb[_0x0bee('0x9')]({'Text':_0x45b1aa,'LanguageCode':_0x36bb41['substring'](0x0,0x2)},function(_0xa2e4f3,_0x5166a0){if(_0xa2e4f3){return _0x100031(_0xa2e4f3);}else{return _0x162614(_0x5166a0);}});});}function checkTranscribeJob(_0x25ab0b,_0x3b99a4,_0x3ab183){var _0x1d85c4;return new BPromise(function(_0x1f50e8,_0x141d88){logger['info'](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x25ab0b['id'],_0x25ab0b[_0x0bee('0xa')]));return getTranscriptionJob(_0x3ab183[_0x0bee('0xb')],_0x3ab183[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0xd')],_0x25ab0b['transcribeName'])['then'](function(_0x54aca4){logger[_0x0bee('0xe')](util[_0x0bee('0xf')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x25ab0b['id'],_0x25ab0b[_0x0bee('0xa')],_0x54aca4[_0x0bee('0x10')]['TranscriptionJobStatus']));if(!_0x25ab0b[_0x0bee('0x11')]){switch(_0x54aca4[_0x0bee('0x10')]['TranscriptionJobStatus']){case _0x0bee('0x12'):var _0x52bbbb={'transcribeStatus':_0x54aca4[_0x0bee('0x10')][_0x0bee('0x13')],'fileUri':_0x54aca4[_0x0bee('0x10')]['Transcript'][_0x0bee('0x14')]};logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x15'),_0x25ab0b['id']));return rp({'uri':_0x54aca4[_0x0bee('0x10')]['Transcript'][_0x0bee('0x14')],'json':!![]})['then'](function(_0x1397f0){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x16'),_0x25ab0b['id']));if(_0x1397f0&&_0x1397f0['results']&&_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')]&&_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')]['length']){_0x52bbbb[_0x0bee('0x11')]='';for(var _0x252ed0=0x0;_0x252ed0<_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')][_0x0bee('0x19')];_0x252ed0++){_0x52bbbb[_0x0bee('0x11')]+=_0x1397f0[_0x0bee('0x17')][_0x0bee('0x18')][_0x252ed0][_0x0bee('0x1a')]+'';}}return _0x25ab0b[_0x0bee('0x1b')](_0x52bbbb);})[_0x0bee('0x1c')](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));if(!_0x25ab0b[_0x0bee('0x1e')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x21'));}if(!_0x3b99a4['sentiment']||!_0x3b99a4['sentimentAccountId']||!_0x3b99a4[_0x0bee('0x22')]||!_0x3b99a4[_0x0bee('0x23')]||!_0x3b99a4[_0x0bee('0x24')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x25'));}if(!_0x52bbbb[_0x0bee('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x3b99a4['sentimentAccountId']===_0x3ab183['id']){return _0x3ab183;}else{return db['CloudProvider'][_0x0bee('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0bee('0x1c')](function(_0x3e5a09){if(!_0x3e5a09){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3e5a09[_0x0bee('0xb')]||!_0x3e5a09[_0x0bee('0xc')]){throw new db['Sequelize'][(_0x0bee('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d85c4=_0x3e5a09;logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x27'),_0x25ab0b['id']));return sentiment(_0x1d85c4['data1'],_0x1d85c4[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0x22')],_0x52bbbb['fileText'],_0x3b99a4[_0x0bee('0x23')]);})[_0x0bee('0x1c')](function(_0x40e516){logger['info'](util[_0x0bee('0xf')](_0x0bee('0x28'),_0x25ab0b['id']));return _0x25ab0b['update']({'sentiment':_0x40e516[_0x0bee('0x29')],'sPositive':_0x40e516[_0x0bee('0x2a')][_0x0bee('0x2b')],'sNegative':_0x40e516[_0x0bee('0x2a')][_0x0bee('0x2c')],'sMixed':_0x40e516[_0x0bee('0x2a')]['Mixed'],'sNeutral':_0x40e516[_0x0bee('0x2a')]['Neutral']});})[_0x0bee('0x1c')](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));_0x1f50e8();});case _0x0bee('0x2d'):return _0x25ab0b[_0x0bee('0x1b')]({'transcribeStatus':_0x0bee('0x2d'),'failureReason':_0x54aca4[_0x0bee('0x10')]['FailureReason']})['then'](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x1d'),_0x25ab0b['id']));_0x1f50e8();});default:logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x2e'),_0x25ab0b['id']));break;}}else{return BPromise[_0x0bee('0x2f')]()[_0x0bee('0x1c')](function(){if(!_0x25ab0b[_0x0bee('0x1e')]){throw new db['Sequelize'][(_0x0bee('0x20'))](_0x0bee('0x21'));}if(!_0x3b99a4[_0x0bee('0x30')]||!_0x3b99a4['sentimentAccountId']||!_0x3b99a4[_0x0bee('0x22')]||!_0x3b99a4['language']||!_0x3b99a4[_0x0bee('0x24')]){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x25'));}if(!_0x25ab0b[_0x0bee('0x11')]){throw new Error(_0x0bee('0x31'));}if(_0x3b99a4[_0x0bee('0x32')]===_0x3ab183['id']){return _0x3ab183;}else{return db[_0x0bee('0x33')][_0x0bee('0x26')]({'where':{'id':_settings[_0x0bee('0x32')]}});}})[_0x0bee('0x1c')](function(_0x37da91){if(!_0x37da91){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x34'));}if(!_0x37da91[_0x0bee('0xb')]||!_0x37da91[_0x0bee('0xc')]){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x35'));}_0x1d85c4=_0x37da91;logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x27'),_0x25ab0b['id']));return sentiment(_0x1d85c4['data1'],_0x1d85c4[_0x0bee('0xc')],_0x3b99a4[_0x0bee('0x22')],_0x25ab0b['fileText'],_0x3b99a4[_0x0bee('0x23')]);})[_0x0bee('0x1c')](function(_0x1ed25b){logger[_0x0bee('0xe')](util[_0x0bee('0xf')](_0x0bee('0x28'),_0x25ab0b['id']));return _0x25ab0b['update']({'sentiment':_0x1ed25b['Sentiment'],'sPositive':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x2b')],'sNegative':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x2c')],'sMixed':_0x1ed25b[_0x0bee('0x2a')][_0x0bee('0x36')],'sNeutral':_0x1ed25b[_0x0bee('0x2a')]['Neutral'],'transcribeStatus':_0x0bee('0x12')});})['then'](function(){logger[_0x0bee('0xe')](util[_0x0bee('0xf')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25ab0b['id']));_0x1f50e8();});}})[_0x0bee('0x37')](function(_0x2e0386){if(_0x2e0386){if(!_0x2e0386['name']||_0x2e0386['name']!==_0x0bee('0x38')){logger[_0x0bee('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x25ab0b['id']),util[_0x0bee('0x3a')](_0x2e0386,{'showHidden':![],'depth':null}));}}_0x1f50e8();});});}function checkTranscribe(){var _0x1cf2ee;var _0x22a9b8;var _0xcf823c;return db[_0x0bee('0x3b')][_0x0bee('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x0bee('0x1c')](function(_0x16a085){if(!_0x16a085||!_0x16a085[_0x0bee('0x19')]){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x3d'));}_0x1cf2ee=_0x16a085;return db['Setting'][_0x0bee('0x26')]({'where':{'id':0x1}});})[_0x0bee('0x1c')](function(_0x2949e3){if(!_0x2949e3){throw new db[(_0x0bee('0x1f'))]['ValidationError'](_0x0bee('0x3e'));}_0x22a9b8=_0x2949e3;if(!_0x22a9b8['transcribe']||!_0x22a9b8[_0x0bee('0x3f')]||!_0x22a9b8[_0x0bee('0xd')]||!_0x22a9b8[_0x0bee('0x23')]||!_0x22a9b8['bucket']){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))]('Transcribe\x20not\x20configured');}return db[_0x0bee('0x33')][_0x0bee('0x26')]({'where':{'id':_0x22a9b8[_0x0bee('0x3f')]}});})[_0x0bee('0x1c')](function(_0x5c152c){if(!_0x5c152c){throw new db['Sequelize'][(_0x0bee('0x20'))](_0x0bee('0x34'));}if(!_0x5c152c[_0x0bee('0xb')]||!_0x5c152c['data2']){throw new db[(_0x0bee('0x1f'))][(_0x0bee('0x20'))](_0x0bee('0x35'));}_0xcf823c=_0x5c152c;var _0x58d49e=[];_0x1cf2ee[_0x0bee('0x40')](function(_0x5b3146){_0x58d49e[_0x0bee('0x41')](checkTranscribeJob(_0x5b3146,_0x22a9b8,_0xcf823c));});return BPromise[_0x0bee('0x42')](_0x58d49e);})[_0x0bee('0x37')](function(_0x59b502){if(_0x59b502){if(!_0x59b502[_0x0bee('0x43')]||_0x59b502[_0x0bee('0x43')]!==_0x0bee('0x38')){logger[_0x0bee('0x39')](util[_0x0bee('0x3a')](_0x59b502,{'showHidden':![],'depth':null}));}}});}exports[_0x0bee('0x44')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x1d90=['resolve','sentiment','sentimentAccountId','bucket','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','Positive','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','SequelizeValidationError','start','lodash','request-promise','bluebird','../../config/logger','transcribe','TranscribeService','detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed'];(function(_0x4d51cb,_0x12df1b){var _0x7a9f54=function(_0x5992e9){while(--_0x5992e9){_0x4d51cb['push'](_0x4d51cb['shift']());}};_0x7a9f54(++_0x12df1b);}(_0x1d90,0x13e));var _0x01d9=function(_0x3f1385,_0x3620ff){_0x3f1385=_0x3f1385-0x0;var _0x5e13d0=_0x1d90[_0x3f1385];return _0x5e13d0;};var _=require(_0x01d9('0x0'));var AWS=require('aws-sdk');var rp=require(_0x01d9('0x1'));var util=require('util');var BPromise=require(_0x01d9('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x01d9('0x3'))(_0x01d9('0x4'));function getTranscriptionJob(_0x47e13e,_0x2f2e27,_0x405f55,_0xc03631){return new Promise(function(_0x549267,_0x500fb7){var _0x1664eb=new AWS[(_0x01d9('0x5'))]({'accessKeyId':_0x2f2e27,'secretAccessKey':_0x47e13e,'region':_0x405f55});_0x1664eb['getTranscriptionJob']({'TranscriptionJobName':_0xc03631},function(_0xef9d5b,_0x479447){if(_0xef9d5b){return _0x500fb7(_0xef9d5b);}else{return _0x549267(_0x479447);}});});}function sentiment(_0x497d40,_0x45a579,_0x2b8e06,_0x332f6a,_0x553073){return new Promise(function(_0x2745e4,_0x2a7727){var _0x2d1ca0=new AWS['Comprehend']({'accessKeyId':_0x45a579,'secretAccessKey':_0x497d40,'region':_0x2b8e06});_0x2d1ca0[_0x01d9('0x6')]({'Text':_0x332f6a,'LanguageCode':_0x553073[_0x01d9('0x7')](0x0,0x2)},function(_0x5fc001,_0x2b0a92){if(_0x5fc001){return _0x2a7727(_0x5fc001);}else{return _0x2745e4(_0x2b0a92);}});});}function checkTranscribeJob(_0xf99df2,_0x3c43c5,_0x411e2e){var _0x2895dd;return new BPromise(function(_0x2325c5,_0x3254a5){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0xf99df2['id'],_0xf99df2[_0x01d9('0xa')]));return getTranscriptionJob(_0x411e2e[_0x01d9('0xb')],_0x411e2e[_0x01d9('0xc')],_0x3c43c5[_0x01d9('0xd')],_0xf99df2['transcribeName'])[_0x01d9('0xe')](function(_0x5bc7fc){logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0xf'),_0xf99df2['id'],_0xf99df2['transcribeName'],_0x5bc7fc[_0x01d9('0x10')][_0x01d9('0x11')]));if(!_0xf99df2['fileText']){switch(_0x5bc7fc[_0x01d9('0x10')][_0x01d9('0x11')]){case _0x01d9('0x12'):var _0x4aceee={'transcribeStatus':_0x5bc7fc['TranscriptionJob'][_0x01d9('0x11')],'fileUri':_0x5bc7fc['TranscriptionJob']['Transcript'][_0x01d9('0x13')]};logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0x14'),_0xf99df2['id']));return rp({'uri':_0x5bc7fc['TranscriptionJob'][_0x01d9('0x15')][_0x01d9('0x13')],'json':!![]})['then'](function(_0x216a49){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xf99df2['id']));if(_0x216a49&&_0x216a49[_0x01d9('0x16')]&&_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')]&&_0x216a49[_0x01d9('0x16')]['transcripts'][_0x01d9('0x18')]){_0x4aceee['fileText']='';for(var _0x294b95=0x0;_0x294b95<_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')][_0x01d9('0x18')];_0x294b95++){_0x4aceee[_0x01d9('0x19')]+=_0x216a49[_0x01d9('0x16')][_0x01d9('0x17')][_0x294b95][_0x01d9('0x1a')]+'';}}return _0xf99df2[_0x01d9('0x1b')](_0x4aceee);})[_0x01d9('0xe')](function(){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xf99df2['id']));if(!_0xf99df2[_0x01d9('0x1c')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x1f'));}if(!_0x3c43c5['sentiment']||!_0x3c43c5['sentimentAccountId']||!_0x3c43c5[_0x01d9('0x20')]||!_0x3c43c5[_0x01d9('0x21')]||!_0x3c43c5['bucket']){throw new db[(_0x01d9('0x1d'))]['ValidationError'](_0x01d9('0x22'));}if(!_0x4aceee[_0x01d9('0x19')]){throw new Error('Transcript\x20not\x20available');}if(_0x3c43c5['sentimentAccountId']===_0x411e2e['id']){return _0x411e2e;}else{return db[_0x01d9('0x23')][_0x01d9('0x24')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x01d9('0xe')](function(_0x5dae9f){if(!_0x5dae9f){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5dae9f[_0x01d9('0xb')]||!_0x5dae9f[_0x01d9('0xc')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x2895dd=_0x5dae9f;logger['info'](util[_0x01d9('0x9')](_0x01d9('0x25'),_0xf99df2['id']));return sentiment(_0x2895dd[_0x01d9('0xb')],_0x2895dd['data2'],_0x3c43c5[_0x01d9('0x20')],_0x4aceee[_0x01d9('0x19')],_0x3c43c5[_0x01d9('0x21')]);})[_0x01d9('0xe')](function(_0x2f6152){logger[_0x01d9('0x8')](util[_0x01d9('0x9')](_0x01d9('0x26'),_0xf99df2['id']));return _0xf99df2[_0x01d9('0x1b')]({'sentiment':_0x2f6152[_0x01d9('0x27')],'sPositive':_0x2f6152[_0x01d9('0x28')]['Positive'],'sNegative':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x29')],'sMixed':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x2a')],'sNeutral':_0x2f6152[_0x01d9('0x28')][_0x01d9('0x2b')]});})[_0x01d9('0xe')](function(){logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});case _0x01d9('0x2d'):return _0xf99df2[_0x01d9('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0x5bc7fc[_0x01d9('0x10')]['FailureReason']})['then'](function(){logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});default:logger['info'](util[_0x01d9('0x9')](_0x01d9('0x2e'),_0xf99df2['id']));break;}}else{return BPromise[_0x01d9('0x2f')]()[_0x01d9('0xe')](function(){if(!_0xf99df2['tempSentiment']){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x3c43c5[_0x01d9('0x30')]||!_0x3c43c5[_0x01d9('0x31')]||!_0x3c43c5[_0x01d9('0x20')]||!_0x3c43c5[_0x01d9('0x21')]||!_0x3c43c5[_0x01d9('0x32')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x22'));}if(!_0xf99df2['fileText']){throw new Error(_0x01d9('0x33'));}if(_0x3c43c5[_0x01d9('0x31')]===_0x411e2e['id']){return _0x411e2e;}else{return db[_0x01d9('0x23')][_0x01d9('0x24')]({'where':{'id':_settings[_0x01d9('0x31')]}});}})[_0x01d9('0xe')](function(_0xa84480){if(!_0xa84480){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x34'));}if(!_0xa84480[_0x01d9('0xb')]||!_0xa84480[_0x01d9('0xc')]){throw new db['Sequelize'][(_0x01d9('0x1e'))](_0x01d9('0x35'));}_0x2895dd=_0xa84480;logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xf99df2['id']));return sentiment(_0x2895dd['data1'],_0x2895dd[_0x01d9('0xc')],_0x3c43c5['sentimentRegion'],_0xf99df2[_0x01d9('0x19')],_0x3c43c5[_0x01d9('0x21')]);})['then'](function(_0x35a8f2){logger[_0x01d9('0x8')](util[_0x01d9('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xf99df2['id']));return _0xf99df2['update']({'sentiment':_0x35a8f2[_0x01d9('0x27')],'sPositive':_0x35a8f2['SentimentScore'][_0x01d9('0x36')],'sNegative':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x29')],'sMixed':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x2a')],'sNeutral':_0x35a8f2[_0x01d9('0x28')][_0x01d9('0x2b')],'transcribeStatus':_0x01d9('0x12')});})[_0x01d9('0xe')](function(){logger[_0x01d9('0x8')](util['format'](_0x01d9('0x2c'),_0xf99df2['id']));_0x2325c5();});}})['catch'](function(_0x40f86c){if(_0x40f86c){if(!_0x40f86c[_0x01d9('0x37')]||_0x40f86c[_0x01d9('0x37')]!=='SequelizeValidationError'){logger[_0x01d9('0x38')](util['format'](_0x01d9('0x39'),_0xf99df2['id']),util[_0x01d9('0x3a')](_0x40f86c,{'showHidden':![],'depth':null}));}}_0x2325c5();});});}function checkTranscribe(){var _0x39a325;var _0x51ebf7;var _0x27cea2;return db[_0x01d9('0x3b')][_0x01d9('0x3c')]({'where':{'transcribeStatus':_0x01d9('0x3d')}})['then'](function(_0x80801b){if(!_0x80801b||!_0x80801b[_0x01d9('0x18')]){throw new db['Sequelize']['ValidationError'](_0x01d9('0x3e'));}_0x39a325=_0x80801b;return db[_0x01d9('0x3f')][_0x01d9('0x24')]({'where':{'id':0x1}});})['then'](function(_0x3e92cb){if(!_0x3e92cb){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x40'));}_0x51ebf7=_0x3e92cb;if(!_0x51ebf7[_0x01d9('0x4')]||!_0x51ebf7[_0x01d9('0x41')]||!_0x51ebf7['transcribeRegion']||!_0x51ebf7[_0x01d9('0x21')]||!_0x51ebf7['bucket']){throw new db['Sequelize'][(_0x01d9('0x1e'))](_0x01d9('0x42'));}return db['CloudProvider'][_0x01d9('0x24')]({'where':{'id':_0x51ebf7[_0x01d9('0x41')]}});})[_0x01d9('0xe')](function(_0x5a8595){if(!_0x5a8595){throw new db[(_0x01d9('0x1d'))]['ValidationError'](_0x01d9('0x34'));}if(!_0x5a8595[_0x01d9('0xb')]||!_0x5a8595[_0x01d9('0xc')]){throw new db[(_0x01d9('0x1d'))][(_0x01d9('0x1e'))](_0x01d9('0x35'));}_0x27cea2=_0x5a8595;var _0x1d6b41=[];_0x39a325[_0x01d9('0x43')](function(_0xe8cf19){_0x1d6b41[_0x01d9('0x44')](checkTranscribeJob(_0xe8cf19,_0x51ebf7,_0x27cea2));});return BPromise[_0x01d9('0x45')](_0x1d6b41);})[_0x01d9('0x46')](function(_0x576725){if(_0x576725){if(!_0x576725[_0x01d9('0x37')]||_0x576725[_0x01d9('0x37')]!==_0x01d9('0x47')){logger['error'](util['inspect'](_0x576725,{'showHidden':![],'depth':null}));}}});}exports[_0x01d9('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 040eecf..410401d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd880=['inspect','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','then','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions'];(function(_0xd71feb,_0x5a7e7c){var _0x342abb=function(_0x2cc443){while(--_0x2cc443){_0xd71feb['push'](_0xd71feb['shift']());}};_0x342abb(++_0x5a7e7c);}(_0xd880,0x7e));var _0x0d88=function(_0x49cb23,_0x40a318){_0x49cb23=_0x49cb23-0x0;var _0x33862f=_0xd880[_0x49cb23];return _0x33862f;};'use strict';var _=require(_0x0d88('0x0'));var moment=require(_0x0d88('0x1'));var Redis=require(_0x0d88('0x2'));var util=require(_0x0d88('0x3'));var config=require(_0x0d88('0x4'));var db=require(_0x0d88('0x5'))['db'];var logger=require('../logger')(_0x0d88('0x6'));config[_0x0d88('0x7')]=_['defaults'](config['redis'],{'host':_0x0d88('0x8'),'port':0x18eb});var io=require(_0x0d88('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x3d22d0=[];return db[_0x0d88('0xa')][_0x0d88('0xb')]({'raw':!![],'attributes':['id',_0x0d88('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0d88('0xd')](0x18,_0x0d88('0xe'))}}})['then'](function(_0x476948){if(_0x476948&&_0x476948['length']){_0x3d22d0=_[_0x0d88('0xf')](_0x476948||[],'id');logger[_0x0d88('0x10')](_0x0d88('0x11'),_0x3d22d0[_0x0d88('0x12')]());return db[_0x0d88('0xa')][_0x0d88('0x13')]({'closeReason':_0x0d88('0x14'),'disposition':_0x0d88('0x15'),'closed':!![],'closedAt':moment()['format'](_0x0d88('0x16'))},{'where':{'id':_0x3d22d0}});}})[_0x0d88('0x17')](function(){if(_0x3d22d0&&_0x3d22d0[_0x0d88('0x18')]){logger[_0x0d88('0x10')](_0x0d88('0x19'),_0x3d22d0['join']());for(var _0x13cb95=0x0;_0x13cb95<_0x3d22d0[_0x0d88('0x18')];_0x13cb95++){io['emit']('whatsappInteraction:update',{'id':_0x3d22d0[_0x13cb95],'closed':!![]});}}})[_0x0d88('0x1a')](function(_0x1c780c){logger[_0x0d88('0x1b')](_0x0d88('0x1c'),_0x1c780c?util[_0x0d88('0x1d')](_0x1c780c,{'showHidden':![],'depth':null}):'');});}exports[_0x0d88('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x310f=['findAll','hours','then','length','map','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../mysqldb','schedule','redis','defaults','localhost','WhatsappInteraction'];(function(_0x4c060b,_0x4c5e75){var _0x5b9790=function(_0x32e525){while(--_0x32e525){_0x4c060b['push'](_0x4c060b['shift']());}};_0x5b9790(++_0x4c5e75);}(_0x310f,0x13b));var _0xf310=function(_0x46c448,_0x561ba2){_0x46c448=_0x46c448-0x0;var _0x5e5df9=_0x310f[_0x46c448];return _0x5e5df9;};'use strict';var _=require(_0xf310('0x0'));var moment=require(_0xf310('0x1'));var Redis=require('ioredis');var util=require(_0xf310('0x2'));var config=require('../../config/environment');var db=require(_0xf310('0x3'))['db'];var logger=require('../logger')(_0xf310('0x4'));config[_0xf310('0x5')]=_[_0xf310('0x6')](config[_0xf310('0x5')],{'host':_0xf310('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf310('0x5')]));function closeInteractions(){var _0x620858=[];return db[_0xf310('0x8')][_0xf310('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xf310('0xa'))}}})[_0xf310('0xb')](function(_0x13b125){if(_0x13b125&&_0x13b125[_0xf310('0xc')]){_0x620858=_[_0xf310('0xd')](_0x13b125||[],'id');logger[_0xf310('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x620858[_0xf310('0xf')]());return db[_0xf310('0x8')][_0xf310('0x10')]({'closeReason':_0xf310('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xf310('0x12')](_0xf310('0x13'))},{'where':{'id':_0x620858}});}})[_0xf310('0xb')](function(){if(_0x620858&&_0x620858[_0xf310('0xc')]){logger[_0xf310('0xe')](_0xf310('0x14'),_0x620858['join']());for(var _0x57289c=0x0;_0x57289c<_0x620858[_0xf310('0xc')];_0x57289c++){io[_0xf310('0x15')](_0xf310('0x16'),{'id':_0x620858[_0x57289c],'closed':!![]});}}})[_0xf310('0x17')](function(_0x2652f9){logger[_0xf310('0x18')](_0xf310('0x19'),_0x2652f9?util[_0xf310('0x1a')](_0x2652f9,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 5f94530..a83d923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd945=['finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','then','log','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact'];(function(_0xae9e35,_0x4e272b){var _0x3509be=function(_0x379bc7){while(--_0x379bc7){_0xae9e35['push'](_0xae9e35['shift']());}};_0x3509be(++_0x4e272b);}(_0xd945,0x195));var _0x5d94=function(_0x14ed93,_0x2bbefd){_0x14ed93=_0x14ed93-0x0;var _0x2c3490=_0xd945[_0x14ed93];return _0x2c3490;};'use strict';var util=require(_0x5d94('0x0'));var db=require(_0x5d94('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5d94('0x2')]({'id':i,'firstName':_0x5d94('0x3')+i,'lastName':_0x5d94('0x4')+i,'phone':0xf879fb460+i,'email':_0x5d94('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x5d94('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x5d94('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5d94('0x2')]({'id':i,'firstName':_0x5d94('0x3')+i,'lastName':_0x5d94('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x5d94('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5d94('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x5d94('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5d94('0x6')](),'updatedAt':Date[_0x5d94('0x6')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db[_0x5d94('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log'](_0x5d94('0x9'),_0x5d94('0xa'));return db[_0x5d94('0xb')][_0x5d94('0xc')]({'where':{}});})['then'](function(){return db[_0x5d94('0xb')][_0x5d94('0xd')](hopper);})[_0x5d94('0xe')](function(){console[_0x5d94('0xf')]('finished\x20populating','hopper1');return db['CmContact'][_0x5d94('0xd')](contacts2);})[_0x5d94('0xe')](function(){console[_0x5d94('0xf')](_0x5d94('0x9'),_0x5d94('0x10'));return db[_0x5d94('0xb')]['bulkCreate'](hopper2);})['then'](function(){console[_0x5d94('0xf')](_0x5d94('0x9'),'hopper2');})[_0x5d94('0x11')](function(_0x26ee8f){console[_0x5d94('0xf')](_0x26ee8f);});
\ No newline at end of file
+var _0x3889=['Biondo','@xcally.com','now','Innocenzo','innocenzo.biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','catch','push'];(function(_0x4a3c7d,_0x391dda){var _0x428405=function(_0x1f9bfc){while(--_0x1f9bfc){_0x4a3c7d['push'](_0x4a3c7d['shift']());}};_0x428405(++_0x391dda);}(_0x3889,0x194));var _0x9388=function(_0x4243a6,_0x43e40b){_0x4243a6=_0x4243a6-0x0;var _0x4b0f9d=_0x3889[_0x4243a6];return _0x4b0f9d;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9388('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9388('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x9388('0x2')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9388('0x0')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9388('0x3')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9388('0x0')]({'id':i,'firstName':_0x9388('0x4')+i,'lastName':_0x9388('0x1')+i,'phone':0xf879fb460+i,'email':_0x9388('0x5')+i+_0x9388('0x2')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9388('0x0')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9388('0x3')](),'updatedAt':Date[_0x9388('0x3')]()});}db[_0x9388('0x6')][_0x9388('0x7')]({'where':{}})[_0x9388('0x8')](function(){return db[_0x9388('0x6')][_0x9388('0x9')](contacts);})[_0x9388('0x8')](function(){console[_0x9388('0xa')](_0x9388('0xb'),_0x9388('0xc'));return db[_0x9388('0xd')][_0x9388('0x7')]({'where':{}});})['then'](function(){return db[_0x9388('0xd')][_0x9388('0x9')](hopper);})[_0x9388('0x8')](function(){console[_0x9388('0xa')](_0x9388('0xb'),'hopper1');return db[_0x9388('0x6')][_0x9388('0x9')](contacts2);})[_0x9388('0x8')](function(){console[_0x9388('0xa')](_0x9388('0xb'),'contacts2');return db[_0x9388('0xd')]['bulkCreate'](hopper2);})[_0x9388('0x8')](function(){console[_0x9388('0xa')]('finished\x20populating','hopper2');})[_0x9388('0xe')](function(_0x3840fc){console['log'](_0x3840fc);});
\ No newline at end of file
index 59e7ed3..616d8e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48a2=['udp','all','yes','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','catch','util','../mysqldb','push','format','%s%s','agent','password','friend'];(function(_0x5a24fc,_0x8d4266){var _0xe44766=function(_0x5aaefb){while(--_0x5aaefb){_0x5a24fc['push'](_0x5a24fc['shift']());}};_0xe44766(++_0x8d4266);}(_0x48a2,0x190));var _0x248a=function(_0x295b61,_0x20b436){_0x295b61=_0x295b61-0x0;var _0x2d9519=_0x48a2[_0x295b61];return _0x2d9519;};'use strict';var util=require(_0x248a('0x0'));var db=require(_0x248a('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x248a('0x2')]({'name':util[_0x248a('0x3')](_0x248a('0x4'),_0x248a('0x5'),i),'fullname':util[_0x248a('0x3')](_0x248a('0x4'),'agent',i),'email':util['format']('%s%s@xcally.com',_0x248a('0x5'),i),'role':_0x248a('0x5'),'password':_0x248a('0x6'),'internal':0xfa0+i,'type':_0x248a('0x7'),'transport':[_0x248a('0x8'),'ws','wss'],'disallow':[_0x248a('0x9')],'allow':['ulaw'],'defaultuser':util[_0x248a('0x3')](_0x248a('0x4'),_0x248a('0x5'),i),'encryption':'yes','avpf':_0x248a('0xa'),'force_avp':_0x248a('0xa'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x248a('0xb'),'callerid':util[_0x248a('0x3')](_0x248a('0xc'),util[_0x248a('0x3')]('%s%s',_0x248a('0x5'),i),0xfa0+i)});}db['User'][_0x248a('0xd')](users)[_0x248a('0xe')](function(){console[_0x248a('0xf')]('add\x20user');})[_0x248a('0x10')](function(_0x5f5bfb){console[_0x248a('0xf')](_0x5f5bfb);});
\ No newline at end of file
+var _0x5b3b=['actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','push','%s%s','agent','format','all','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x263c25,_0x4b711b){var _0x3d32ab=function(_0x48f214){while(--_0x48f214){_0x263c25['push'](_0x263c25['shift']());}};_0x3d32ab(++_0x4b711b);}(_0x5b3b,0x151));var _0xb5b3=function(_0x1ee844,_0x5f4f54){_0x1ee844=_0x1ee844-0x0;var _0x4d0b7e=_0x5b3b[_0x1ee844];return _0x4d0b7e;};'use strict';var util=require(_0xb5b3('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb5b3('0x1')]({'name':util['format'](_0xb5b3('0x2'),_0xb5b3('0x3'),i),'fullname':util[_0xb5b3('0x4')](_0xb5b3('0x2'),_0xb5b3('0x3'),i),'email':util[_0xb5b3('0x4')]('%s%s@xcally.com','agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':'friend','transport':['udp','ws','wss'],'disallow':[_0xb5b3('0x5')],'allow':['ulaw'],'defaultuser':util['format'](_0xb5b3('0x2'),'agent',i),'encryption':_0xb5b3('0x6'),'avpf':_0xb5b3('0x6'),'force_avp':_0xb5b3('0x6'),'icesupport':_0xb5b3('0x6'),'dtlsenable':_0xb5b3('0x6'),'dtlsverify':'no','dtlscertfile':_0xb5b3('0x7'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xb5b3('0x8'),'callerid':util[_0xb5b3('0x4')](_0xb5b3('0x9'),util[_0xb5b3('0x4')]('%s%s','agent',i),0xfa0+i)});}db[_0xb5b3('0xa')][_0xb5b3('0xb')](users)[_0xb5b3('0xc')](function(){console[_0xb5b3('0xd')](_0xb5b3('0xe'));})['catch'](function(_0x1537b8){console[_0xb5b3('0xd')](_0x1537b8);});
\ No newline at end of file
index 4fc43e9..5c8289b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7939=['query','User','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','emit','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','join','default','connection','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','Agents','length','handshake'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x7939,0x11c));var _0x9793=function(_0x154bca,_0x170ba1){_0x154bca=_0x154bca-0x0;var _0x46f55d=_0x7939[_0x154bca];return _0x46f55d;};'use strict';var _=require('lodash');var util=require(_0x9793('0x0'));var BPromise=require(_0x9793('0x1'));var db=require(_0x9793('0x2'))['db'];var config=require(_0x9793('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x9793('0x4'),_0x9793('0x5')],'raw':!![],'where':{'role':_0x9793('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':_0x9793('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9793('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x9793('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9793('0x4'),_0x9793('0x8')],'where':{'type':_0x9793('0x9')}};function getAssociatedResources(_0x2a9b7c,_0x4e5923,_0x3901f3){return db['UserProfileSection'][_0x9793('0xa')]({'where':{'name':_0x2a9b7c,'userProfileId':_0x4e5923},'raw':!![]})[_0x9793('0xb')](function(_0x5ea2e2){if(_0x5ea2e2){if(_0x5ea2e2[_0x9793('0xc')]){switch(_0x2a9b7c){case _0x9793('0xd'):case _0x9793('0xe'):case _0x9793('0xf'):case _0x9793('0x10'):case'MailQueues':case'OpenchannelQueues':case _0x9793('0x11'):return db[_0x3901f3][_0x9793('0x12')](queryQueues);case _0x9793('0x13'):return db[_0x3901f3][_0x9793('0x12')](queryTelephones);case _0x9793('0x14'):return db[_0x3901f3][_0x9793('0x12')](queryTrunks);case _0x9793('0x15'):return db[_0x3901f3][_0x9793('0x12')](queryCampaigns);}}else{return db[_0x9793('0x16')][_0x9793('0x12')]({'attributes':[_0x9793('0x17')],'where':{'sectionId':_0x5ea2e2['id']},'raw':!![]})[_0x9793('0xb')](function(_0x4f0d68){if(_0x4f0d68){var _0x277e9b={'where':{'id':_[_0x9793('0x18')](_0x4f0d68,'resourceId')},'raw':!![]};switch(_0x3901f3){case'User':_0x277e9b[_0x9793('0x19')]['role']=_0x9793('0x7');break;case'Campaign':_0x277e9b[_0x9793('0x19')][_0x9793('0x8')]=_0x9793('0x9');break;}return db[_0x3901f3]['findAll'](_0x277e9b);}else{return[];}});}}else{return[];}})['then'](function(_0x2d6656){return _0x2d6656;});}function joinOrLeaveQueues(_0x53aa43,_0x5407c5,_0x369f5e,_0x4d1769){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')](_0x9793('0x1b'),_0x369f5e,_0x4d1769[_0x9793('0x4')]));if(_0x4d1769[_0x9793('0x1c')]){for(var _0x23b51e=0x0;_0x23b51e<_0x4d1769['Agents'][_0x9793('0x1d')];_0x23b51e+=0x1){_0x53aa43[_0x5407c5](util[_0x9793('0x1a')]('user:%s',_0x4d1769[_0x9793('0x1c')][_0x23b51e]['name']));}}}function joinOrLeave(_0x3054ec,_0x1f079d,_0x566c92){var _0x4eacb2;if(_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']){db[_0x9793('0x20')]['find']({'attributes':['id',_0x9793('0x4'),_0x9793('0x5'),_0x9793('0x21')],'where':{'id':_0x3054ec[_0x9793('0x1e')][_0x9793('0x1f')]['id']},'include':[{'model':db[_0x9793('0x22')],'as':_0x9793('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x24')],'as':_0x9793('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x26')],'as':_0x9793('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x28')],'as':_0x9793('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9793('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x9793('0x2b')],'as':_0x9793('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x9793('0xb')](function(_0x481e8a){if(_0x481e8a){_0x4eacb2=_0x481e8a;_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x2d'),_0x481e8a['name']));var _0x3048d8=[];switch(_0x481e8a[_0x9793('0x5')]){case _0x9793('0x2e'):_0x3054ec[_0x1f079d]('voice:inbound');_0x3054ec[_0x1f079d](_0x9793('0x2f'));if(queryQueues[_0x9793('0x30')](_0x9793('0x31'))){delete queryQueues['include'];}_0x3048d8[_0x9793('0x32')](db[_0x9793('0x33')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x34')]['findAll'](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x35')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x36')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x37')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x38')][_0x9793('0x12')](queryQueues));_0x3048d8['push'](db[_0x9793('0x39')][_0x9793('0x12')](queryQueues));_0x3048d8[_0x9793('0x32')](db['User']['findAll'](queryTelephones));_0x3048d8['push'](db[_0x9793('0x3a')]['findAll'](queryTrunks));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x3b')][_0x9793('0x12')](queryCampaigns));_0x3048d8[_0x9793('0x32')](db[_0x9793('0x20')][_0x9793('0x12')](queryAgents));break;case _0x9793('0x3c'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d]('voice:outbound');_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xd'),_0x481e8a[_0x9793('0x21')],_0x9793('0x33')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('ChatQueues',_0x481e8a['userProfileId'],_0x9793('0x34')));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0xf'),_0x481e8a[_0x9793('0x21')],_0x9793('0x35')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('SmsQueues',_0x481e8a[_0x9793('0x21')],_0x9793('0x36')));_0x3048d8[_0x9793('0x32')](getAssociatedResources('MailQueues',_0x481e8a[_0x9793('0x21')],'MailQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x3e'),_0x481e8a['userProfileId'],'OpenchannelQueue'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x11'),_0x481e8a[_0x9793('0x21')],_0x9793('0x39')));_0x3048d8['push'](getAssociatedResources(_0x9793('0x13'),_0x481e8a['userProfileId'],'User'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x14'),_0x481e8a['userProfileId'],'Trunk'));_0x3048d8[_0x9793('0x32')](getAssociatedResources(_0x9793('0x15'),_0x481e8a[_0x9793('0x21')],_0x9793('0x3b')));_0x3048d8['push'](db[_0x9793('0x20')]['findAll'](queryAgents));break;case _0x9793('0x6'):_0x3054ec[_0x1f079d](_0x9793('0x3d'));_0x3054ec[_0x1f079d](_0x9793('0x2f'));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x3f')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x40')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x41')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x42')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8['push'](_0x481e8a[_0x9793('0x43')]({'attributes':['id',_0x9793('0x4')]}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x44')]({'attributes':['id','name']}));_0x3048d8[_0x9793('0x32')](_0x481e8a[_0x9793('0x45')]({'attributes':['id','name']}));break;}return BPromise[_0x9793('0x46')](_0x3048d8);}})['then'](function(_0xe4171c){if(_0xe4171c&&_0xe4171c['length']){for(var _0x6c8092=0x0;_0x6c8092<_0xe4171c[_0x9793('0x1d')];_0x6c8092+=0x1){for(var _0x1c9d48=0x0;_0x1c9d48<_0xe4171c[_0x6c8092][_0x9793('0x1d')];_0x1c9d48+=0x1){switch(_0x6c8092){case 0x0:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x47'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x1:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x48'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x2:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x49'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x3:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4a'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x4:joinOrLeaveQueues(_0x3054ec,_0x1f079d,_0x9793('0x4b'),_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x5:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'openchannel',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x6:joinOrLeaveQueues(_0x3054ec,_0x1f079d,'whatsapp',_0xe4171c[_0x6c8092][_0x1c9d48]);break;case 0x7:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4c'),_0xe4171c[_0x6c8092][_0x1c9d48]['name']));break;case 0x8:if(_0x4eacb2[_0x9793('0x5')]!==_0x9793('0x6'))_0x3054ec[_0x1f079d](util[_0x9793('0x1a')](_0x9793('0x4d'),_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0x9:if(_0x4eacb2['role']!=='agent')_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('campaign:%s:%s',_0xe4171c[_0x6c8092][_0x1c9d48]['type'],_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;case 0xa:_0x3054ec[_0x1f079d](util[_0x9793('0x1a')]('user:%s',_0xe4171c[_0x6c8092][_0x1c9d48][_0x9793('0x4')]));break;}}}}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x2445fa=_['map'](_0x4eacb2[_0x9793('0x23')],'id');return _0x4eacb2[_0x9793('0x4f')](_0x2445fa)[_0x9793('0xb')](function(){for(var _0x3ca143=0x0;_0x3ca143<_0x2445fa[_0x9793('0x1d')];_0x3ca143+=0x1){_0x566c92['emit'](_0x9793('0x50'),{'ChatInteractionId':Number(_0x2445fa[_0x3ca143]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0xed9987=_['map'](_0x4eacb2['MailInteractions'],'id');return _0x4eacb2[_0x9793('0x51')](_0xed9987)[_0x9793('0xb')](function(){for(var _0xb15e63=0x0;_0xb15e63<_0xed9987['length'];_0xb15e63+=0x1){_0x566c92['emit'](_0x9793('0x52'),{'MailInteractionId':Number(_0xed9987[_0xb15e63]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3dbf43=_['map'](_0x4eacb2[_0x9793('0x27')],'id');return _0x4eacb2[_0x9793('0x53')](_0x3dbf43)[_0x9793('0xb')](function(){for(var _0x2298c6=0x0;_0x2298c6<_0x3dbf43['length'];_0x2298c6+=0x1){_0x566c92['emit'](_0x9793('0x54'),{'FaxInteractionId':Number(_0x3dbf43[_0x2298c6]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x40c043=_['map'](_0x4eacb2['SmsInteractions'],'id');return _0x4eacb2[_0x9793('0x55')](_0x40c043)[_0x9793('0xb')](function(){for(var _0x1ffe3d=0x0;_0x1ffe3d<_0x40c043[_0x9793('0x1d')];_0x1ffe3d+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x57'),{'SmsInteractionId':Number(_0x40c043[_0x1ffe3d]),'UserId':Number(_0x4eacb2['id'])});}});}})[_0x9793('0xb')](function(){if(_0x1f079d==='leave'){var _0x1d6f8b=_[_0x9793('0x18')](_0x4eacb2['OpenchannelInteractions'],'id');return _0x4eacb2[_0x9793('0x58')](_0x1d6f8b)[_0x9793('0xb')](function(){for(var _0x43e872=0x0;_0x43e872<_0x1d6f8b[_0x9793('0x1d')];_0x43e872+=0x1){_0x566c92[_0x9793('0x56')](_0x9793('0x59'),{'OpenchannelInteractionId':Number(_0x1d6f8b[_0x43e872]),'UserId':Number(_0x4eacb2['id'])});}});}})['then'](function(){if(_0x1f079d===_0x9793('0x4e')){var _0x3572db=_[_0x9793('0x18')](_0x4eacb2[_0x9793('0x2c')],'id');return _0x4eacb2[_0x9793('0x5a')](_0x3572db)[_0x9793('0xb')](function(){for(var _0x4fd474=0x0;_0x4fd474<_0x3572db[_0x9793('0x1d')];_0x4fd474+=0x1){_0x566c92[_0x9793('0x56')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3572db[_0x4fd474]),'UserId':Number(_0x4eacb2['id'])});}});}})['catch'](function(_0x31fad5){_0x3054ec['log'](_0x31fad5);});}}function onDisconnect(_0x3cccfa,_0x14bcba){joinOrLeave(_0x3cccfa,_0x9793('0x4e'),_0x14bcba);}function onConnect(_0x37e70b){joinOrLeave(_0x37e70b,_0x9793('0x5b'));}exports[_0x9793('0x5c')]=function(_0x643d8){_0x643d8['on'](_0x9793('0x5d'),function(_0x1f5b60){_0x1f5b60['setMaxListeners'](0x0);_0x1f5b60['address']=_0x1f5b60[_0x9793('0x5e')]['connection'][_0x9793('0x5f')]+':'+_0x1f5b60[_0x9793('0x5e')][_0x9793('0x5d')][_0x9793('0x60')];_0x1f5b60[_0x9793('0x61')]=new Date();_0x1f5b60['log']=function(_0x23dccc){console[_0x9793('0x62')](_0x9793('0x63')+_0x1f5b60[_0x9793('0x64')][_0x9793('0x4')]+'['+_0x1f5b60[_0x9793('0x65')]+']',_0x23dccc);};_0x1f5b60['on'](_0x9793('0x66'),function(){onDisconnect(_0x1f5b60,_0x643d8);_0x1f5b60[_0x9793('0x62')](_0x9793('0x67'));});onConnect(_0x1f5b60);_0x1f5b60[_0x9793('0x62')](_0x9793('0x68'));});};
\ No newline at end of file
+var _0x974c=['leave','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeWhatsappInteractions','catch','log','default','setMaxListeners','address','request','connection','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','telephone','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','FaxQueues','MailQueue','OpenchannelQueues','WhatsappQueues','Telephones','getVoiceQueues','getChatQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','whatsapp','campaign:%s:%s'];(function(_0x2d71dd,_0x24220b){var _0x5c6e72=function(_0x41a670){while(--_0x41a670){_0x2d71dd['push'](_0x2d71dd['shift']());}};_0x5c6e72(++_0x24220b);}(_0x974c,0xd4));var _0xc974=function(_0x2dadf8,_0x501ebe){_0x2dadf8=_0x2dadf8-0x0;var _0x4493e7=_0x974c[_0x2dadf8];return _0x4493e7;};'use strict';var _=require(_0xc974('0x0'));var util=require(_0xc974('0x1'));var BPromise=require(_0xc974('0x2'));var db=require(_0xc974('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xc974('0x4')],'include':[{'as':_0xc974('0x5'),'model':db[_0xc974('0x6')],'attributes':['id','name',_0xc974('0x7')],'raw':!![],'where':{'role':_0xc974('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc974('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xc974('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc974('0x4')],'where':{'role':_0xc974('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xc974('0x9')],'where':{'type':_0xc974('0xa')}};function getAssociatedResources(_0x283a60,_0x51ab1a,_0x4240de){return db[_0xc974('0xb')][_0xc974('0xc')]({'where':{'name':_0x283a60,'userProfileId':_0x51ab1a},'raw':!![]})[_0xc974('0xd')](function(_0x1c56cb){if(_0x1c56cb){if(_0x1c56cb[_0xc974('0xe')]){switch(_0x283a60){case _0xc974('0xf'):case _0xc974('0x10'):case'FaxQueues':case _0xc974('0x11'):case _0xc974('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x4240de][_0xc974('0x13')](queryQueues);case'Telephones':return db[_0x4240de][_0xc974('0x13')](queryTelephones);case _0xc974('0x14'):return db[_0x4240de][_0xc974('0x13')](queryTrunks);case _0xc974('0x15'):return db[_0x4240de]['findAll'](queryCampaigns);}}else{return db[_0xc974('0x16')][_0xc974('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x1c56cb['id']},'raw':!![]})[_0xc974('0xd')](function(_0x1df169){if(_0x1df169){var _0x1bc364={'where':{'id':_[_0xc974('0x17')](_0x1df169,_0xc974('0x18'))},'raw':!![]};switch(_0x4240de){case _0xc974('0x6'):_0x1bc364[_0xc974('0x19')][_0xc974('0x7')]=_0xc974('0x1a');break;case _0xc974('0x1b'):_0x1bc364[_0xc974('0x19')][_0xc974('0x9')]='ivr';break;}return db[_0x4240de][_0xc974('0x13')](_0x1bc364);}else{return[];}});}}else{return[];}})[_0xc974('0xd')](function(_0x60ca60){return _0x60ca60;});}function joinOrLeaveQueues(_0x53e4f5,_0x196106,_0x1f30a0,_0x470fc1){_0x53e4f5[_0x196106](util[_0xc974('0x1c')](_0xc974('0x1d'),_0x1f30a0,_0x470fc1[_0xc974('0x4')]));if(_0x470fc1[_0xc974('0x5')]){for(var _0x3f859d=0x0;_0x3f859d<_0x470fc1[_0xc974('0x5')][_0xc974('0x1e')];_0x3f859d+=0x1){_0x53e4f5[_0x196106](util[_0xc974('0x1c')](_0xc974('0x1f'),_0x470fc1['Agents'][_0x3f859d][_0xc974('0x4')]));}}}function joinOrLeave(_0xb12196,_0x1949d8,_0x24a85b){var _0x1e194f;if(_0xb12196[_0xc974('0x20')][_0xc974('0x21')]['id']){db[_0xc974('0x6')][_0xc974('0x22')]({'attributes':['id',_0xc974('0x4'),_0xc974('0x7'),_0xc974('0x23')],'where':{'id':_0xb12196['handshake']['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xc974('0x24')],'as':_0xc974('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xc974('0x26')],'as':_0xc974('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xc974('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc974('0x29')],'as':_0xc974('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xc974('0x2b')],'as':_0xc974('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xc974('0xd')](function(_0xcd28d1){if(_0xcd28d1){_0x1e194f=_0xcd28d1;_0xb12196[_0x1949d8](util[_0xc974('0x1c')](_0xc974('0x1f'),_0xcd28d1[_0xc974('0x4')]));var _0xcaa7ff=[];switch(_0xcd28d1[_0xc974('0x7')]){case _0xc974('0x2d'):_0xb12196[_0x1949d8](_0xc974('0x2e'));_0xb12196[_0x1949d8](_0xc974('0x2f'));if(queryQueues[_0xc974('0x30')]('include')){delete queryQueues['include'];}_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x32')][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x33')]['findAll'](queryQueues));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x34')][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db['SmsQueue'][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db['MailQueue'][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x35')][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x36')][_0xc974('0x13')](queryQueues));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x6')][_0xc974('0x13')](queryTelephones));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x37')][_0xc974('0x13')](queryTrunks));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x1b')][_0xc974('0x13')](queryCampaigns));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x6')][_0xc974('0x13')](queryAgents));break;case'user':_0xb12196[_0x1949d8](_0xc974('0x2e'));_0xb12196[_0x1949d8](_0xc974('0x2f'));_0xcaa7ff['push'](getAssociatedResources(_0xc974('0xf'),_0xcd28d1['userProfileId'],_0xc974('0x32')));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources(_0xc974('0x10'),_0xcd28d1[_0xc974('0x23')],'ChatQueue'));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources(_0xc974('0x38'),_0xcd28d1[_0xc974('0x23')],_0xc974('0x34')));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources(_0xc974('0x11'),_0xcd28d1[_0xc974('0x23')],'SmsQueue'));_0xcaa7ff['push'](getAssociatedResources(_0xc974('0x12'),_0xcd28d1['userProfileId'],_0xc974('0x39')));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources(_0xc974('0x3a'),_0xcd28d1[_0xc974('0x23')],_0xc974('0x35')));_0xcaa7ff['push'](getAssociatedResources(_0xc974('0x3b'),_0xcd28d1[_0xc974('0x23')],_0xc974('0x36')));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources(_0xc974('0x3c'),_0xcd28d1[_0xc974('0x23')],_0xc974('0x6')));_0xcaa7ff[_0xc974('0x31')](getAssociatedResources('Trunks',_0xcd28d1[_0xc974('0x23')],_0xc974('0x37')));_0xcaa7ff['push'](getAssociatedResources(_0xc974('0x15'),_0xcd28d1['userProfileId'],_0xc974('0x1b')));_0xcaa7ff[_0xc974('0x31')](db[_0xc974('0x6')]['findAll'](queryAgents));break;case _0xc974('0x8'):_0xb12196[_0x1949d8](_0xc974('0x2e'));_0xb12196[_0x1949d8](_0xc974('0x2f'));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1[_0xc974('0x3d')]({'attributes':['id',_0xc974('0x4')]}));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1[_0xc974('0x3e')]({'attributes':['id',_0xc974('0x4')]}));_0xcaa7ff['push'](_0xcd28d1['getFaxQueues']({'attributes':['id',_0xc974('0x4')]}));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1[_0xc974('0x3f')]({'attributes':['id',_0xc974('0x4')]}));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1['getMailQueues']({'attributes':['id','name']}));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1['getOpenchannelQueues']({'attributes':['id','name']}));_0xcaa7ff[_0xc974('0x31')](_0xcd28d1[_0xc974('0x40')]({'attributes':['id',_0xc974('0x4')]}));break;}return BPromise[_0xc974('0x41')](_0xcaa7ff);}})[_0xc974('0xd')](function(_0x2a5306){if(_0x2a5306&&_0x2a5306[_0xc974('0x1e')]){for(var _0x36cbd4=0x0;_0x36cbd4<_0x2a5306['length'];_0x36cbd4+=0x1){for(var _0x14d265=0x0;_0x14d265<_0x2a5306[_0x36cbd4][_0xc974('0x1e')];_0x14d265+=0x1){switch(_0x36cbd4){case 0x0:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x42'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x1:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x43'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x2:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x44'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x3:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x45'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x4:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x46'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x5:joinOrLeaveQueues(_0xb12196,_0x1949d8,'openchannel',_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x6:joinOrLeaveQueues(_0xb12196,_0x1949d8,_0xc974('0x47'),_0x2a5306[_0x36cbd4][_0x14d265]);break;case 0x7:if(_0x1e194f[_0xc974('0x7')]!==_0xc974('0x8'))_0xb12196[_0x1949d8](util[_0xc974('0x1c')]('telephone:%s',_0x2a5306[_0x36cbd4][_0x14d265]['name']));break;case 0x8:if(_0x1e194f['role']!==_0xc974('0x8'))_0xb12196[_0x1949d8](util[_0xc974('0x1c')]('trunk:%s',_0x2a5306[_0x36cbd4][_0x14d265]['name']));break;case 0x9:if(_0x1e194f[_0xc974('0x7')]!=='agent')_0xb12196[_0x1949d8](util['format'](_0xc974('0x48'),_0x2a5306[_0x36cbd4][_0x14d265][_0xc974('0x9')],_0x2a5306[_0x36cbd4][_0x14d265][_0xc974('0x4')]));break;case 0xa:_0xb12196[_0x1949d8](util[_0xc974('0x1c')](_0xc974('0x1f'),_0x2a5306[_0x36cbd4][_0x14d265][_0xc974('0x4')]));break;}}}}})[_0xc974('0xd')](function(){if(_0x1949d8===_0xc974('0x49')){var _0x1e1948=_[_0xc974('0x17')](_0x1e194f['ChatInteractions'],'id');return _0x1e194f['removeChatInteractions'](_0x1e1948)['then'](function(){for(var _0x30965c=0x0;_0x30965c<_0x1e1948[_0xc974('0x1e')];_0x30965c+=0x1){_0x24a85b['emit'](_0xc974('0x4a'),{'ChatInteractionId':Number(_0x1e1948[_0x30965c]),'UserId':Number(_0x1e194f['id'])});}});}})['then'](function(){if(_0x1949d8===_0xc974('0x49')){var _0x1dbfe8=_[_0xc974('0x17')](_0x1e194f[_0xc974('0x25')],'id');return _0x1e194f[_0xc974('0x4b')](_0x1dbfe8)[_0xc974('0xd')](function(){for(var _0x4dd59e=0x0;_0x4dd59e<_0x1dbfe8[_0xc974('0x1e')];_0x4dd59e+=0x1){_0x24a85b[_0xc974('0x4c')](_0xc974('0x4d'),{'MailInteractionId':Number(_0x1dbfe8[_0x4dd59e]),'UserId':Number(_0x1e194f['id'])});}});}})[_0xc974('0xd')](function(){if(_0x1949d8===_0xc974('0x49')){var _0x12f03a=_[_0xc974('0x17')](_0x1e194f[_0xc974('0x27')],'id');return _0x1e194f[_0xc974('0x4e')](_0x12f03a)['then'](function(){for(var _0x582de7=0x0;_0x582de7<_0x12f03a['length'];_0x582de7+=0x1){_0x24a85b[_0xc974('0x4c')](_0xc974('0x4f'),{'FaxInteractionId':Number(_0x12f03a[_0x582de7]),'UserId':Number(_0x1e194f['id'])});}});}})[_0xc974('0xd')](function(){if(_0x1949d8==='leave'){var _0x37474f=_['map'](_0x1e194f['SmsInteractions'],'id');return _0x1e194f[_0xc974('0x50')](_0x37474f)[_0xc974('0xd')](function(){for(var _0x5a0211=0x0;_0x5a0211<_0x37474f[_0xc974('0x1e')];_0x5a0211+=0x1){_0x24a85b[_0xc974('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x37474f[_0x5a0211]),'UserId':Number(_0x1e194f['id'])});}});}})[_0xc974('0xd')](function(){if(_0x1949d8==='leave'){var _0x40bbaa=_['map'](_0x1e194f[_0xc974('0x2a')],'id');return _0x1e194f['removeOpenchannelInteractions'](_0x40bbaa)[_0xc974('0xd')](function(){for(var _0x4ba61c=0x0;_0x4ba61c<_0x40bbaa[_0xc974('0x1e')];_0x4ba61c+=0x1){_0x24a85b[_0xc974('0x4c')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x40bbaa[_0x4ba61c]),'UserId':Number(_0x1e194f['id'])});}});}})[_0xc974('0xd')](function(){if(_0x1949d8===_0xc974('0x49')){var _0x5a6e8a=_[_0xc974('0x17')](_0x1e194f[_0xc974('0x2c')],'id');return _0x1e194f[_0xc974('0x51')](_0x5a6e8a)[_0xc974('0xd')](function(){for(var _0x3c5314=0x0;_0x3c5314<_0x5a6e8a[_0xc974('0x1e')];_0x3c5314+=0x1){_0x24a85b[_0xc974('0x4c')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5a6e8a[_0x3c5314]),'UserId':Number(_0x1e194f['id'])});}});}})[_0xc974('0x52')](function(_0x5e96e8){_0xb12196[_0xc974('0x53')](_0x5e96e8);});}}function onDisconnect(_0x5e5bc9,_0x448ced){joinOrLeave(_0x5e5bc9,_0xc974('0x49'),_0x448ced);}function onConnect(_0x480c22){joinOrLeave(_0x480c22,'join');}exports[_0xc974('0x54')]=function(_0x4b462e){_0x4b462e['on']('connection',function(_0x2a9546){_0x2a9546[_0xc974('0x55')](0x0);_0x2a9546[_0xc974('0x56')]=_0x2a9546[_0xc974('0x57')]['connection']['remoteAddress']+':'+_0x2a9546[_0xc974('0x57')][_0xc974('0x58')][_0xc974('0x59')];_0x2a9546['connectedAt']=new Date();_0x2a9546[_0xc974('0x53')]=function(_0x3a029c){console[_0xc974('0x53')](_0xc974('0x5a')+_0x2a9546[_0xc974('0x5b')]['name']+'['+_0x2a9546[_0xc974('0x56')]+']',_0x3a029c);};_0x2a9546['on'](_0xc974('0x5c'),function(){onDisconnect(_0x2a9546,_0x4b462e);_0x2a9546[_0xc974('0x53')](_0xc974('0x5d'));});onConnect(_0x2a9546);_0x2a9546[_0xc974('0x53')](_0xc974('0x5e'));});};
\ No newline at end of file
index b53396a..2e765c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b99=['changed','substatus','User','default','hasOwnProperty','model','hook','callback','../../mysqldb','../logger','lodash','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','Sms','SmsInteraction','SmsMessage','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','Trigger,\x20%s','error','code','catch','EventManager','get','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','then','contact','UserId','find','name','fullname','email','internal','interface','format','SIP/%s','channel','agent','incomingmessage','outgoingmessage','opened','Sequelize','closed'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7b99,0x19a));var _0x97b9=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7b99[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require('util');var db=require(_0x97b9('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x97b9('0x1'))('triggers');var _=require(_0x97b9('0x2'));var client=jayson['client'][_0x97b9('0x3')]({'port':0x232a});var triggers=[{'channel':_0x97b9('0x4'),'model':_0x97b9('0x5'),'event':_0x97b9('0x6'),'condition':_0x97b9('0x7'),'callback':afterCreate},{'channel':_0x97b9('0x4'),'model':_0x97b9('0x5'),'event':_0x97b9('0x8'),'condition':_0x97b9('0x9'),'callback':afterUpdate},{'channel':_0x97b9('0x4'),'model':_0x97b9('0xa'),'event':_0x97b9('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x97b9('0xb'),'model':_0x97b9('0xc'),'event':_0x97b9('0x6'),'condition':_0x97b9('0x7'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x97b9('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x97b9('0xd'),'event':_0x97b9('0x6'),'condition':_0x97b9('0xe'),'callback':afterCreateMessage},{'channel':_0x97b9('0xf'),'model':'WhatsappInteraction','event':_0x97b9('0x6'),'condition':_0x97b9('0x7'),'callback':afterCreate},{'channel':_0x97b9('0xf'),'model':_0x97b9('0x10'),'event':_0x97b9('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x97b9('0xf'),'model':_0x97b9('0x11'),'event':_0x97b9('0x6'),'condition':_0x97b9('0xe'),'callback':afterCreateMessage},{'channel':_0x97b9('0x12'),'model':_0x97b9('0x13'),'event':_0x97b9('0x6'),'condition':_0x97b9('0x7'),'callback':afterCreate},{'channel':'Fax','model':_0x97b9('0x13'),'event':_0x97b9('0x8'),'condition':_0x97b9('0x9'),'callback':afterUpdate},{'channel':_0x97b9('0x12'),'model':_0x97b9('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x97b9('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Mail','model':_0x97b9('0x15'),'event':_0x97b9('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x97b9('0x16'),'model':'MailMessage','event':_0x97b9('0x6'),'condition':_0x97b9('0xe'),'callback':afterCreateMessage},{'channel':_0x97b9('0x17'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x97b9('0x7'),'callback':afterCreate},{'channel':'Openchannel','model':_0x97b9('0x18'),'event':_0x97b9('0x8'),'condition':_0x97b9('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x97b9('0x19'),'event':_0x97b9('0x6'),'condition':_0x97b9('0xe'),'callback':afterCreateMessage}];function request(_0x15eb91){return client[_0x97b9('0x1a')]('EventManager',_0x15eb91)['then'](function(_0x45ffbc){logger['info'](_0x97b9('0x1b'),'EventManager',_0x45ffbc);if(_0x45ffbc[_0x97b9('0x1c')]){if(_0x45ffbc['error'][_0x97b9('0x1d')]===0x1f4){logger['error'](_0x97b9('0x1b'),'EventManager',_0x45ffbc['error']);}}})[_0x97b9('0x1e')](function(_0x5704fe){logger[_0x97b9('0x1c')](_0x97b9('0x1b'),_0x97b9('0x1f'),_0x5704fe);});}function afterCreateMessage(_0xc08c3d,_0x411f9c){return function(_0x4a52d0,_0x37107e){_0x4a52d0=_0x4a52d0[_0x97b9('0x20')]({'plain':!![]});_0x4a52d0['channel']=_0xc08c3d;_0x4a52d0[_0x97b9('0x21')]=_0xc08c3d;_0x4a52d0[_0x97b9('0x22')]=_0x4a52d0[_0x97b9('0x23')];var _0x329762=_0x97b9('0x24')+_0x4a52d0[_0x97b9('0x25')];return db[_0x97b9('0x26')][_0x97b9('0x27')](_0x329762,{'type':db['Sequelize'][_0x97b9('0x28')]['SELECT'],'raw':!![]})['then'](function(_0x38a594){return _0x38a594;})[_0x97b9('0x29')](function(_0x118347){if(_0x118347){_0x4a52d0[_0x97b9('0x2a')]=_0x118347[0x0];}if(_0x4a52d0[_0x97b9('0x2b')]){return db['User'][_0x97b9('0x2c')]({'where':{'id':_0x4a52d0[_0x97b9('0x2b')]},'attributes':['id',_0x97b9('0x2d'),_0x97b9('0x2e'),_0x97b9('0x2f'),_0x97b9('0x30')],'raw':!![]})[_0x97b9('0x29')](function(_0x8a2450){_0x4a52d0[_0x97b9('0x31')]=util[_0x97b9('0x32')](_0x97b9('0x33'),_0x8a2450[_0x97b9('0x2d')]);_0x4a52d0[_0x97b9('0x34')]=_0xc08c3d;_0x4a52d0[_0x97b9('0x35')]=_0x8a2450;return request({'event':_0x97b9('0x36'),'message':_0x4a52d0});})[_0x97b9('0x1e')](function(_0x5dacb1){console[_0x97b9('0x1c')](_0x5dacb1);});}else{return request({'event':_0x97b9('0x37'),'message':_0x4a52d0});}});};}function afterCreate(_0x3f0428,_0x1463b9){return function(_0x3e7ea0,_0x1c3a84){_0x3e7ea0=_0x3e7ea0[_0x97b9('0x20')]({'plain':!![]});_0x3e7ea0[_0x97b9('0x34')]=_0x3f0428;_0x3e7ea0[_0x97b9('0x21')]=_0x3f0428;_0x3e7ea0[_0x97b9('0x22')]=_0x97b9('0x38');var _0xff5c72='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3e7ea0[_0x97b9('0x25')];return db['sequelize'][_0x97b9('0x27')](_0xff5c72,{'type':db[_0x97b9('0x39')][_0x97b9('0x28')]['SELECT'],'raw':!![]})[_0x97b9('0x29')](function(_0x29ad06){return _0x29ad06;})['then'](function(_0x192d7f){if(_0x192d7f){_0x3e7ea0['contact']=_0x192d7f[0x0];}return request({'event':_0x1463b9,'message':_0x3e7ea0});});};}function afterUpdate(_0x89922b){return function(_0x1e5903){var _0x54d83b=_0x1e5903['changed'](_0x97b9('0x3a'))&&_0x1e5903[_0x97b9('0x3a')];var _0x3cf8a9=_0x1e5903[_0x97b9('0x3b')]('substatus');if(_0x54d83b||_0x3cf8a9){var _0x10e1b1=_0x54d83b?_0x97b9('0x9'):_0x97b9('0x3c');var _0x5a8d84=_0x1e5903['get']({'plain':!![]});_0x5a8d84[_0x97b9('0x34')]=_0x89922b;_0x5a8d84[_0x97b9('0x21')]=_0x89922b;_0x5a8d84[_0x97b9('0x22')]=_0x54d83b?_0x97b9('0x3a'):_0x97b9('0x3c');var _0x41fa7d=_0x97b9('0x24')+_0x5a8d84[_0x97b9('0x25')];return db[_0x97b9('0x26')][_0x97b9('0x27')](_0x41fa7d,{'type':db[_0x97b9('0x39')][_0x97b9('0x28')]['SELECT'],'raw':!![]})['then'](function(_0x1cb11a){if(_0x1cb11a){_0x5a8d84[_0x97b9('0x2a')]=_0x1cb11a[0x0];}if(_0x5a8d84[_0x97b9('0x2b')]){return db[_0x97b9('0x3d')]['find']({'where':{'id':_0x5a8d84[_0x97b9('0x2b')]},'attributes':['id',_0x97b9('0x2d'),_0x97b9('0x2e'),_0x97b9('0x2f'),'internal'],'raw':!![]})[_0x97b9('0x29')](function(_0x2412fa){_0x5a8d84[_0x97b9('0x31')]=util[_0x97b9('0x32')](_0x97b9('0x33'),_0x2412fa[_0x97b9('0x2d')]);_0x5a8d84['agent']=_0x2412fa;return request({'event':_0x10e1b1,'message':_0x5a8d84});})[_0x97b9('0x1e')](function(_0x36f929){console['error'](_0x36f929);});}else{return request({'event':_0x10e1b1,'message':_0x5a8d84});}});}};}exports[_0x97b9('0x3e')]=function(){for(var _0x2a7e6e=0x0;_0x2a7e6e<triggers['length'];_0x2a7e6e+=0x1){if(db[_0x97b9('0x3f')](triggers[_0x2a7e6e][_0x97b9('0x40')])){db[triggers[_0x2a7e6e]['model']][_0x97b9('0x41')](triggers[_0x2a7e6e][_0x97b9('0x22')],triggers[_0x2a7e6e][_0x97b9('0x42')](triggers[_0x2a7e6e]['channel']['toLowerCase'](),triggers[_0x2a7e6e]['condition']));}}};
\ No newline at end of file
+var _0x113a=['util','../../mysqldb','jayson/promise','../logger','lodash','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','Sms','SmsInteraction','closedinteraction','SmsMessage','WhatsappInteraction','Whatsapp','FaxInteraction','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','error','code','Trigger,\x20%s','catch','get','channel','motionChannel','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','UserId','User','find','name','fullname','email','internal','interface','format','outgoingmessage','event','query','changed','closed','substatus','contact','SIP/%s','agent','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition'];(function(_0x61e464,_0x4ac94f){var _0x23c492=function(_0x56b13d){while(--_0x56b13d){_0x61e464['push'](_0x61e464['shift']());}};_0x23c492(++_0x4ac94f);}(_0x113a,0x114));var _0xa113=function(_0x5d8396,_0x358bf9){_0x5d8396=_0x5d8396-0x0;var _0x4620ce=_0x113a[_0x5d8396];return _0x4620ce;};'use strict';var util=require(_0xa113('0x0'));var db=require(_0xa113('0x1'))['db'];var jayson=require(_0xa113('0x2'));var logger=require(_0xa113('0x3'))('triggers');var _=require(_0xa113('0x4'));var client=jayson[_0xa113('0x5')]['http']({'port':0x232a});var triggers=[{'channel':_0xa113('0x6'),'model':_0xa113('0x7'),'event':_0xa113('0x8'),'condition':_0xa113('0x9'),'callback':afterCreate},{'channel':_0xa113('0x6'),'model':_0xa113('0x7'),'event':_0xa113('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa113('0x6'),'model':_0xa113('0xb'),'event':_0xa113('0x8'),'condition':_0xa113('0xc'),'callback':afterCreateMessage},{'channel':_0xa113('0xd'),'model':_0xa113('0xe'),'event':_0xa113('0x8'),'condition':_0xa113('0x9'),'callback':afterCreate},{'channel':_0xa113('0xd'),'model':_0xa113('0xe'),'event':_0xa113('0xa'),'condition':_0xa113('0xf'),'callback':afterUpdate},{'channel':_0xa113('0xd'),'model':_0xa113('0x10'),'event':_0xa113('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0xa113('0x11'),'event':_0xa113('0x8'),'condition':_0xa113('0x9'),'callback':afterCreate},{'channel':_0xa113('0x12'),'model':_0xa113('0x11'),'event':'afterUpdate','condition':_0xa113('0xf'),'callback':afterUpdate},{'channel':_0xa113('0x12'),'model':'WhatsappMessage','event':_0xa113('0x8'),'condition':_0xa113('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xa113('0x13'),'event':_0xa113('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Fax','model':_0xa113('0x13'),'event':'afterUpdate','condition':_0xa113('0xf'),'callback':afterUpdate},{'channel':_0xa113('0x14'),'model':'FaxMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa113('0x15'),'model':_0xa113('0x16'),'event':'afterCreate','condition':_0xa113('0x9'),'callback':afterCreate},{'channel':_0xa113('0x15'),'model':'MailInteraction','event':_0xa113('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0xa113('0x17'),'event':_0xa113('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa113('0x18'),'model':_0xa113('0x19'),'event':_0xa113('0x8'),'condition':_0xa113('0x9'),'callback':afterCreate},{'channel':_0xa113('0x18'),'model':_0xa113('0x19'),'event':_0xa113('0xa'),'condition':_0xa113('0xf'),'callback':afterUpdate},{'channel':_0xa113('0x18'),'model':'OpenchannelMessage','event':_0xa113('0x8'),'condition':_0xa113('0xc'),'callback':afterCreateMessage}];function request(_0x4480a0){return client[_0xa113('0x1a')](_0xa113('0x1b'),_0x4480a0)[_0xa113('0x1c')](function(_0x154a20){logger['info']('Trigger,\x20%s',_0xa113('0x1b'),_0x154a20);if(_0x154a20[_0xa113('0x1d')]){if(_0x154a20[_0xa113('0x1d')][_0xa113('0x1e')]===0x1f4){logger[_0xa113('0x1d')](_0xa113('0x1f'),_0xa113('0x1b'),_0x154a20[_0xa113('0x1d')]);}}})[_0xa113('0x20')](function(_0x1e7a79){logger[_0xa113('0x1d')](_0xa113('0x1f'),_0xa113('0x1b'),_0x1e7a79);});}function afterCreateMessage(_0x338742,_0x18a0da){return function(_0x13ff57,_0x20ecb3){_0x13ff57=_0x13ff57[_0xa113('0x21')]({'plain':!![]});_0x13ff57[_0xa113('0x22')]=_0x338742;_0x13ff57[_0xa113('0x23')]=_0x338742;_0x13ff57['event']=_0x13ff57[_0xa113('0x24')];var _0x44a224=_0xa113('0x25')+_0x13ff57[_0xa113('0x26')];return db[_0xa113('0x27')]['query'](_0x44a224,{'type':db[_0xa113('0x28')][_0xa113('0x29')][_0xa113('0x2a')],'raw':!![]})[_0xa113('0x1c')](function(_0xb69652){return _0xb69652;})[_0xa113('0x1c')](function(_0x1938eb){if(_0x1938eb){_0x13ff57['contact']=_0x1938eb[0x0];}if(_0x13ff57[_0xa113('0x2b')]){return db[_0xa113('0x2c')][_0xa113('0x2d')]({'where':{'id':_0x13ff57['UserId']},'attributes':['id',_0xa113('0x2e'),_0xa113('0x2f'),_0xa113('0x30'),_0xa113('0x31')],'raw':!![]})['then'](function(_0x56935b){_0x13ff57[_0xa113('0x32')]=util[_0xa113('0x33')]('SIP/%s',_0x56935b[_0xa113('0x2e')]);_0x13ff57[_0xa113('0x22')]=_0x338742;_0x13ff57['agent']=_0x56935b;return request({'event':'incomingmessage','message':_0x13ff57});})[_0xa113('0x20')](function(_0x532399){console[_0xa113('0x1d')](_0x532399);});}else{return request({'event':_0xa113('0x34'),'message':_0x13ff57});}});};}function afterCreate(_0x39c31e,_0x970e5d){return function(_0x15ac26,_0x2df69d){_0x15ac26=_0x15ac26[_0xa113('0x21')]({'plain':!![]});_0x15ac26['channel']=_0x39c31e;_0x15ac26[_0xa113('0x23')]=_0x39c31e;_0x15ac26[_0xa113('0x35')]='opened';var _0x240e6d=_0xa113('0x25')+_0x15ac26[_0xa113('0x26')];return db[_0xa113('0x27')][_0xa113('0x36')](_0x240e6d,{'type':db[_0xa113('0x28')][_0xa113('0x29')][_0xa113('0x2a')],'raw':!![]})[_0xa113('0x1c')](function(_0x5bc2b3){return _0x5bc2b3;})[_0xa113('0x1c')](function(_0x4b3854){if(_0x4b3854){_0x15ac26['contact']=_0x4b3854[0x0];}return request({'event':_0x970e5d,'message':_0x15ac26});});};}function afterUpdate(_0x236647){return function(_0x254e97){var _0x17befa=_0x254e97[_0xa113('0x37')](_0xa113('0x38'))&&_0x254e97[_0xa113('0x38')];var _0x49ed3e=_0x254e97[_0xa113('0x37')](_0xa113('0x39'));if(_0x17befa||_0x49ed3e){var _0x8b7b56=_0x17befa?'closedinteraction':'substatus';var _0x5cdb05=_0x254e97[_0xa113('0x21')]({'plain':!![]});_0x5cdb05['channel']=_0x236647;_0x5cdb05[_0xa113('0x23')]=_0x236647;_0x5cdb05[_0xa113('0x35')]=_0x17befa?_0xa113('0x38'):'substatus';var _0xedb6cc=_0xa113('0x25')+_0x5cdb05[_0xa113('0x26')];return db['sequelize'][_0xa113('0x36')](_0xedb6cc,{'type':db[_0xa113('0x28')][_0xa113('0x29')]['SELECT'],'raw':!![]})[_0xa113('0x1c')](function(_0x26ffdd){if(_0x26ffdd){_0x5cdb05[_0xa113('0x3a')]=_0x26ffdd[0x0];}if(_0x5cdb05[_0xa113('0x2b')]){return db[_0xa113('0x2c')][_0xa113('0x2d')]({'where':{'id':_0x5cdb05['UserId']},'attributes':['id',_0xa113('0x2e'),_0xa113('0x2f'),_0xa113('0x30'),_0xa113('0x31')],'raw':!![]})[_0xa113('0x1c')](function(_0x669af9){_0x5cdb05[_0xa113('0x32')]=util[_0xa113('0x33')](_0xa113('0x3b'),_0x669af9[_0xa113('0x2e')]);_0x5cdb05[_0xa113('0x3c')]=_0x669af9;return request({'event':_0x8b7b56,'message':_0x5cdb05});})['catch'](function(_0x1927bb){console['error'](_0x1927bb);});}else{return request({'event':_0x8b7b56,'message':_0x5cdb05});}});}};}exports[_0xa113('0x3d')]=function(){for(var _0x508dbe=0x0;_0x508dbe<triggers[_0xa113('0x3e')];_0x508dbe+=0x1){if(db[_0xa113('0x3f')](triggers[_0x508dbe][_0xa113('0x40')])){db[triggers[_0x508dbe]['model']][_0xa113('0x41')](triggers[_0x508dbe][_0xa113('0x35')],triggers[_0x508dbe][_0xa113('0x42')](triggers[_0x508dbe][_0xa113('0x22')][_0xa113('0x43')](),triggers[_0x508dbe][_0xa113('0x44')]));}}};
\ No newline at end of file
index cefd9ab..b1c21e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd235=['mail','chat','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','User','agent','then','agents','catch','bluebird','./license/util','voice'];(function(_0x146a5f,_0x504b47){var _0x5f24d9=function(_0x3c16ff){while(--_0x3c16ff){_0x146a5f['push'](_0x146a5f['shift']());}};_0x5f24d9(++_0x504b47);}(_0xd235,0x1a1));var _0x5d23=function(_0x57b982,_0x510dea){_0x57b982=_0x57b982-0x0;var _0x187bc2=_0xd235[_0x57b982];return _0x187bc2;};'use strict';var _=require('lodash');var BPromise=require(_0x5d23('0x0'));var db=require('../mysqldb')['db'];var util=require(_0x5d23('0x1'));var channels=[_0x5d23('0x2'),_0x5d23('0x3'),_0x5d23('0x4'),'fax',_0x5d23('0x5'),'whatsapp',_0x5d23('0x6')];exports[_0x5d23('0x7')]=function(){return channels;};exports[_0x5d23('0x8')]=function(_0x50acad){_0x50acad=_0x50acad[_0x5d23('0x9')]();return _[_0x5d23('0xa')](channels,_0x50acad);};exports['clearBlockUser']=function(_0x27e99c,_0x6ec54d,_0x1ed9f7,_0x5f3c83){var _0x2a1677={'loginAttempts':_0x6ec54d,'blocked':_0x1ed9f7};if(!_[_0x5d23('0xb')](_0x5f3c83)){_0x2a1677[_0x5d23('0xc')]=_0x5f3c83;}return _0x27e99c[_0x5d23('0xd')](_0x2a1677);};exports[_0x5d23('0xe')]=function(_0x3c2a26){return new BPromise(function(_0x4d3e3a,_0x1bf3e9){var _0x46f4d8=0x0;if(_0x3c2a26[_0x5d23('0xf')]!=='agent'){_0x4d3e3a(_0x3c2a26);}db[_0x5d23('0x10')]['count']({'where':{'role':_0x5d23('0x11'),'online':!![],'id':{'$ne':_0x3c2a26['id']}}})[_0x5d23('0x12')](function(_0x51e841){_0x46f4d8=_0x51e841;return util[_0x5d23('0xe')]();})[_0x5d23('0x12')](function(_0x4baa1a){if(_0x4baa1a&&_0x4baa1a[_0x5d23('0x13')]&&_0x46f4d8>=_0x4baa1a[_0x5d23('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x4d3e3a(_0x3c2a26);})[_0x5d23('0x14')](function(_0x1643b5){_0x1bf3e9(_0x1643b5);});});};
\ No newline at end of file
+var _0xbc89=['voice','mail','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0x17a8b2,_0x33aad2){var _0x160596=function(_0x23af61){while(--_0x23af61){_0x17a8b2['push'](_0x17a8b2['shift']());}};_0x160596(++_0x33aad2);}(_0xbc89,0xb5));var _0x9bc8=function(_0x5807d4,_0x29306b){_0x5807d4=_0x5807d4-0x0;var _0x5ddf9b=_0xbc89[_0x5807d4];return _0x5ddf9b;};'use strict';var _=require(_0x9bc8('0x0'));var BPromise=require(_0x9bc8('0x1'));var db=require(_0x9bc8('0x2'))['db'];var util=require('./license/util');var channels=[_0x9bc8('0x3'),_0x9bc8('0x4'),'chat','fax',_0x9bc8('0x5'),_0x9bc8('0x6'),_0x9bc8('0x7')];exports[_0x9bc8('0x8')]=function(){return channels;};exports[_0x9bc8('0x9')]=function(_0x38d506){_0x38d506=_0x38d506[_0x9bc8('0xa')]();return _['includes'](channels,_0x38d506);};exports[_0x9bc8('0xb')]=function(_0x4c18d0,_0x51db60,_0x335d67,_0x2de4b5){var _0x34cb73={'loginAttempts':_0x51db60,'blocked':_0x335d67};if(!_[_0x9bc8('0xc')](_0x2de4b5)){_0x34cb73['blockedAt']=_0x2de4b5;}return _0x4c18d0[_0x9bc8('0xd')](_0x34cb73);};exports[_0x9bc8('0xe')]=function(_0x4e3070){return new BPromise(function(_0x5769e3,_0x429e30){var _0x5356e8=0x0;if(_0x4e3070[_0x9bc8('0xf')]!==_0x9bc8('0x10')){_0x5769e3(_0x4e3070);}db[_0x9bc8('0x11')][_0x9bc8('0x12')]({'where':{'role':_0x9bc8('0x10'),'online':!![],'id':{'$ne':_0x4e3070['id']}}})[_0x9bc8('0x13')](function(_0x435f7a){_0x5356e8=_0x435f7a;return util[_0x9bc8('0xe')]();})[_0x9bc8('0x13')](function(_0x459b18){if(_0x459b18&&_0x459b18[_0x9bc8('0x14')]&&_0x5356e8>=_0x459b18[_0x9bc8('0x14')]){throw Error(_0x9bc8('0x15'));}_0x5769e3(_0x4e3070);})[_0x9bc8('0x16')](function(_0x102445){_0x429e30(_0x102445);});});};
\ No newline at end of file
index b5e408b..cfdd6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa896=['exports','404','status','json'];(function(_0x584b6a,_0x4238e0){var _0x3d2ec9=function(_0x43a652){while(--_0x43a652){_0x584b6a['push'](_0x584b6a['shift']());}};_0x3d2ec9(++_0x4238e0);}(_0xa896,0xe0));var _0x6a89=function(_0x369b63,_0x229937){_0x369b63=_0x369b63-0x0;var _0x146990=_0xa896[_0x369b63];return _0x146990;};'use strict';module[_0x6a89('0x0')][0x194]=function pageNotFound(_0x413ff0,_0x50700b){var _0x311208=_0x6a89('0x1');var _0x1d79bb=0x194;var _0x28b980={'status':_0x1d79bb};_0x50700b[_0x6a89('0x2')](_0x28b980[_0x6a89('0x2')]);_0x50700b['render'](_0x311208,{},function(_0x4ae19d,_0x27a06c){if(_0x4ae19d){return _0x50700b[_0x6a89('0x2')](_0x28b980[_0x6a89('0x2')])[_0x6a89('0x3')](_0x28b980);}_0x50700b['send'](_0x27a06c);});};
\ No newline at end of file
+var _0x50c1=['status','render','send','exports','404'];(function(_0x194f04,_0xddec12){var _0x51ee8c=function(_0x3449cd){while(--_0x3449cd){_0x194f04['push'](_0x194f04['shift']());}};_0x51ee8c(++_0xddec12);}(_0x50c1,0x1b6));var _0x150c=function(_0x1514af,_0x21c52d){_0x1514af=_0x1514af-0x0;var _0x200e37=_0x50c1[_0x1514af];return _0x200e37;};'use strict';module[_0x150c('0x0')][0x194]=function pageNotFound(_0x480404,_0x29da4e){var _0x4c4e4d=_0x150c('0x1');var _0x786960=0x194;var _0x4fdcdf={'status':_0x786960};_0x29da4e[_0x150c('0x2')](_0x4fdcdf[_0x150c('0x2')]);_0x29da4e[_0x150c('0x3')](_0x4c4e4d,{},function(_0x14a91b,_0x4eca59){if(_0x14a91b){return _0x29da4e[_0x150c('0x2')](_0x4fdcdf[_0x150c('0x2')])['json'](_0x4fdcdf);}_0x29da4e[_0x150c('0x4')](_0x4eca59);});};
\ No newline at end of file
index 94b1567..7833034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','UserProfile','belongsToMany','Groups','Contacts','Lists','user_has_teams','MailInteraction','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccount','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','MailApplication','List','mandatoryDispositionPauseId','Teams','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','MailQueueReport','ListId','Items','FaxAccountId','Exntensions','Agents','user_has_fax_accounts','FaxQueue','FaxInteractionId','fax_interaction_has_tags','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','ChatGroupId','chat_group_has_users','CompanyId','JscriptySessionReport','Company','cm_user_has_contacts','cm_contact_has_tags','Condition','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','MailApplications','ChatApplications','FaxApplications','AnalyticDefaultReport','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','CustomReportId','Fields','DefaultReportId','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','SugarcrmAccount','Configurations','DescriptionId','VariableId','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyQuestionReport','SquareProject','team_has_mail_queues','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','cm_user_has_lists','userProfileId','UserProfileSections','UserProfileResource','Resources','WhatsappAccountId','WhatsappInteractionId','ToWhatsappAccountId','exports','../config/environment','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','database','username','password','sequelizeHistory','options','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition'];(function(_0xcba291,_0x10e9d5){var _0x162274=function(_0x38100e){while(--_0x38100e){_0xcba291['push'](_0xcba291['shift']());}};_0x162274(++_0x10e9d5);}(_0xa75b,0x170));var _0xba75=function(_0x145f49,_0x49f2e9){_0x145f49=_0x145f49-0x0;var _0x9b7a51=_0xa75b[_0x145f49];return _0x9b7a51;};'use strict';var config=require(_0xba75('0x0'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xba75('0x1'));var timezone=jstz[_0xba75('0x2')]();config[_0xba75('0x3')]=_[_0xba75('0x4')](config[_0xba75('0x3')],{'database':_0xba75('0x5'),'username':_0xba75('0x6'),'password':_0xba75('0x7'),'options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xba75('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0xba75('0x6'),'password':'xC@LL1234','options':{'host':_0xba75('0x8'),'port':0xcea,'dialect':_0xba75('0x9'),'dialectOptions':{'charset':_0xba75('0xa')},'logging':![],'timezone':timezone[_0xba75('0xb')](),'define':{'charset':_0xba75('0xc'),'collate':_0xba75('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x3')][_0xba75('0xe')],config[_0xba75('0x3')][_0xba75('0xf')],config[_0xba75('0x3')][_0xba75('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xba75('0x11')]['database'],config[_0xba75('0x11')][_0xba75('0xf')],config[_0xba75('0x11')][_0xba75('0x10')],config['sequelizeHistory'][_0xba75('0x12')])};db[_0xba75('0x13')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x15'));db['VoiceChanSpy']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x16'));db['VoiceContext']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x17'));db[_0xba75('0x18')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xba75('0x19')]=db[_0xba75('0x3')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xba75('0x1a')]=db[_0xba75('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xba75('0x1b')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1c'));db[_0xba75('0x1d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x1e'));db[_0xba75('0x1f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x20'));db['VoiceMailMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x21'));db[_0xba75('0x22')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x23'));db[_0xba75('0x24')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db['sequelize'][_0xba75('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xba75('0x25')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x26'));db[_0xba75('0x27')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x28'));db[_0xba75('0x29')]=db[_0xba75('0x3')]['import']('../api/trunk/trunk.model');db[_0xba75('0x2a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2b'));db[_0xba75('0x2c')]=db[_0xba75('0x3')]['import'](_0xba75('0x2d'));db[_0xba75('0x2e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x2f'));db[_0xba75('0x30')]=db[_0xba75('0x3')]['import'](_0xba75('0x31'));db[_0xba75('0x32')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x33'));db[_0xba75('0x34')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x35'));db[_0xba75('0x36')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x37'));db[_0xba75('0x38')]=db['sequelize']['import'](_0xba75('0x39'));db[_0xba75('0x3a')]=db[_0xba75('0x3')]['import'](_0xba75('0x3b'));db[_0xba75('0x3c')]=db['sequelize']['import'](_0xba75('0x3d'));db[_0xba75('0x3e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x3f'));db['MailAccount']=db['sequelize'][_0xba75('0x14')](_0xba75('0x40'));db[_0xba75('0x41')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x42'));db[_0xba75('0x43')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x44'));db['MailInteraction']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x45'));db[_0xba75('0x46')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x47'));db['MailApplication']=db[_0xba75('0x3')]['import'](_0xba75('0x48'));db['MailQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x49'));db[_0xba75('0x4a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x4b'));db[_0xba75('0x4c')]=db[_0xba75('0x3')]['import'](_0xba75('0x4d'));db[_0xba75('0x4e')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x4f'));db[_0xba75('0x50')]=db['sequelize']['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xba75('0x3')]['import'](_0xba75('0x51'));db[_0xba75('0x52')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x53'));db['FaxQueue']=db['sequelize'][_0xba75('0x14')]('../api/faxQueue/faxQueue.model');db[_0xba75('0x54')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x55'));db[_0xba75('0x56')]=db[_0xba75('0x3')]['import'](_0xba75('0x57'));db[_0xba75('0x58')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x59'));db[_0xba75('0x5a')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0xba75('0x5b')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x5c'));db[_0xba75('0x5d')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x5e'));db[_0xba75('0x5f')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x60'));db[_0xba75('0x61')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x62'));db[_0xba75('0x63')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x64'));db['OpenchannelMessage']=db['sequelize'][_0xba75('0x14')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xba75('0x3')]['import'](_0xba75('0x65'));db[_0xba75('0x66')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x67'));db['OpenchannelQueueReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xba75('0x68')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x69'));db[_0xba75('0x6a')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x6b'));db['ChatMessage']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6c'));db[_0xba75('0x6d')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xba75('0x6e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x6f'));db[_0xba75('0x70')]=db[_0xba75('0x3')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xba75('0x14')](_0xba75('0x71'));db[_0xba75('0x72')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x73'));db[_0xba75('0x74')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x75'));db[_0xba75('0x76')]=db[_0xba75('0x3')]['import'](_0xba75('0x77'));db[_0xba75('0x78')]=db['sequelize'][_0xba75('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xba75('0x79')]=db[_0xba75('0x3')]['import'](_0xba75('0x7a'));db[_0xba75('0x7b')]=db['sequelize']['import'](_0xba75('0x7c'));db['ReportAgentPreview']=db[_0xba75('0x3')]['import'](_0xba75('0x7d'));db[_0xba75('0x7e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x7f'));db['Action']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/action/action.model');db[_0xba75('0x80')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x81'));db[_0xba75('0x82')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x83'));db[_0xba75('0x84')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x85'));db['Condition']=db['sequelize'][_0xba75('0x14')](_0xba75('0x86'));db[_0xba75('0x87')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x88'));db[_0xba75('0x89')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8a'));db[_0xba75('0x8b')]=db['sequelize'][_0xba75('0x14')]('../api/cdr/cdr.model');db[_0xba75('0x8c')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x8d'));db[_0xba75('0x8e')]=db[_0xba75('0x3')]['import'](_0xba75('0x8f'));db['Sound']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/sound/sound.model');db['Tag']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x90'));db[_0xba75('0x91')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/template/template.model');db[_0xba75('0x92')]=db[_0xba75('0x3')]['import'](_0xba75('0x93'));db[_0xba75('0x94')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x95'));db['Integration']=db[_0xba75('0x3')]['import'](_0xba75('0x96'));db[_0xba75('0x97')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x98'));db[_0xba75('0x99')]=db['sequelize']['import'](_0xba75('0x9a'));db['AnalyticDefaultReport']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xba75('0x9b')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0xba75('0x9c')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x9d'));db[_0xba75('0x9e')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x9f'));db[_0xba75('0xa0')]=db['sequelize']['import'](_0xba75('0xa1'));db[_0xba75('0xa2')]=db['sequelize'][_0xba75('0x14')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xba75('0xa3')]=db[_0xba75('0x3')]['import'](_0xba75('0xa4'));db['SugarcrmAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xba75('0xa5')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa6'));db[_0xba75('0xa7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xa8'));db['DeskAccount']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xba75('0xa9')]=db['sequelize'][_0xba75('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0xba75('0x3')]['import'](_0xba75('0xaa'));db['ZohoConfiguration']=db['sequelize'][_0xba75('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xba75('0xab')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xac'));db[_0xba75('0xad')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xae'));db['ZendeskConfiguration']=db[_0xba75('0x3')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xba75('0xaf')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xb0'));db[_0xba75('0xb1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb2'));db[_0xba75('0xb3')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb4'));db[_0xba75('0xb5')]=db['sequelize']['import'](_0xba75('0xb6'));db['VtigerAccount']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xb7'));db[_0xba75('0xb8')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xba75('0x3')]['import'](_0xba75('0xb9'));db[_0xba75('0xba')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbb'));db['ServicenowConfiguration']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbc'));db[_0xba75('0xbd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xbe'));db[_0xba75('0xbf')]=db[_0xba75('0x3')]['import'](_0xba75('0xc0'));db[_0xba75('0xc1')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc2'));db[_0xba75('0xc3')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xba75('0xc4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xc5'));db[_0xba75('0xc6')]=db[_0xba75('0x3')]['import'](_0xba75('0xc7'));db['FreshsalesField']=db[_0xba75('0x3')]['import'](_0xba75('0xc8'));db[_0xba75('0xc9')]=db[_0xba75('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xca'));db[_0xba75('0xcb')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xcc'));db[_0xba75('0xcd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xce'));db[_0xba75('0xcf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd0'));db['JscriptyQuestionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd1'));db['JscriptySessionReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd2'));db[_0xba75('0xd3')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd4'));db['SquareReport']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xd5'));db[_0xba75('0xd6')]=db[_0xba75('0x3')]['import']('../api/squareReportDetail/squareReportDetail.model');db[_0xba75('0xd7')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xd8'));db[_0xba75('0xd9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xda'));db[_0xba75('0xdb')]=db[_0xba75('0x3')][_0xba75('0x14')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize'][_0xba75('0x14')]('../api/squareProject/squareProject.model');db[_0xba75('0xdc')]=db['sequelize'][_0xba75('0x14')]('../api/squareRecording/squareRecording.model');db[_0xba75('0xdd')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xde'));db[_0xba75('0xdf')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe0'));db['License']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe1'));db[_0xba75('0xe2')]=db[_0xba75('0x3')]['import'](_0xba75('0xe3'));db[_0xba75('0xe4')]=db[_0xba75('0x3')]['import'](_0xba75('0xe5'));db['Attachment']=db['sequelize'][_0xba75('0x14')](_0xba75('0xe6'));db[_0xba75('0xe7')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xe8'));db[_0xba75('0xe9')]=db['sequelize'][_0xba75('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0xba75('0xea')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xeb'));db[_0xba75('0xec')]=db[_0xba75('0x3')]['import'](_0xba75('0xed'));db[_0xba75('0xee')]=db[_0xba75('0x3')]['import'](_0xba75('0xef'));db[_0xba75('0xf0')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf1'));db[_0xba75('0xf2')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf3'));db[_0xba75('0xf4')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf5'));db['UserProfile']=db[_0xba75('0x3')][_0xba75('0x14')]('../api/userProfile/userProfile.model');db[_0xba75('0xf6')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xf7'));db['UserProfileResource']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0xf8'));db[_0xba75('0xf9')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfa'));db['WhatsappAccount']=db['sequelize']['import'](_0xba75('0xfb'));db[_0xba75('0xfc')]=db['sequelize'][_0xba75('0x14')](_0xba75('0xfd'));db[_0xba75('0xfe')]=db[_0xba75('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0xba75('0xff')]=db['sequelize'][_0xba75('0x14')](_0xba75('0x100'));db[_0xba75('0x101')]=db['sequelize'][_0xba75('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xba75('0x102')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x103'));db[_0xba75('0x104')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x105'));db[_0xba75('0x106')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x107'));db[_0xba75('0x108')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x109'));db[_0xba75('0x10a')]=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10b'));db['UserVoicePrefix']=db[_0xba75('0x3')][_0xba75('0x14')](_0xba75('0x10c'));db[_0xba75('0x13')][_0xba75('0x10d')](db[_0xba75('0x1f')],{'as':'VoiceMail','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x1b')],{'as':'Recordings','foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x2c')],{'as':_0xba75('0x111'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x112'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x13')][_0xba75('0x110')](db['CmHopperFinal'],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x114'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['OpenchannelInteraction'],{'as':_0xba75('0x116'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'UserId'});db[_0xba75('0x13')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'foreignKey':_0xba75('0x10f')});db['User'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x13')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0xba75('0x13')]['hasMany'](db[_0xba75('0xf9')],{'as':_0xba75('0x11b'),'foreignKey':_0xba75('0x11c')});db[_0xba75('0x13')]['belongsTo'](db[_0xba75('0x11d')],{'as':_0xba75('0x11d'),'foreignKey':'userProfileId'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x70')],{'as':_0xba75('0x11f'),'through':'chat_group_has_users'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':_0xba75('0x121'),'through':'cm_user_has_lists'});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x122')});db['User']['belongsToMany'](db[_0xba75('0x123')],{'as':'MailInteractions','through':_0xba75('0x124')});db['User'][_0xba75('0x11e')](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'through':_0xba75('0x126')});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x118')],{'as':_0xba75('0x119'),'through':_0xba75('0x127')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'through':_0xba75('0x128')});db['User'][_0xba75('0x11e')](db[_0xba75('0x63')],{'as':_0xba75('0x116'),'through':'user_has_openchannel_interactions'});db[_0xba75('0x13')][_0xba75('0x11e')](db['WhatsappInteraction'],{'as':_0xba75('0x129'),'through':_0xba75('0x12a')});db['User']['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db['VoicePrefix'],{'as':_0xba75('0x12c'),'through':_0xba75('0x12d'),'required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x41')],{'as':_0xba75('0x12e'),'through':_0xba75('0x32'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x6e')],{'as':_0xba75('0x12f'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0xba75('0x11e')](db['FaxQueue'],{'as':_0xba75('0x130'),'through':'UserFaxQueue','required':![]});db[_0xba75('0x13')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'as':_0xba75('0x131'),'through':_0xba75('0x36'),'required':![]});db['User'][_0xba75('0x11e')](db[_0xba75('0x132')],{'as':_0xba75('0x133'),'through':_0xba75('0x38'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x104')],{'as':_0xba75('0x134'),'through':_0xba75('0x3a'),'required':![]});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xba75('0x11e')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0xba75('0x135')});db[_0xba75('0x13')][_0xba75('0x11e')](db['FaxAccount'],{'as':_0xba75('0x136'),'through':'user_has_fax_accounts'});db[_0xba75('0x13')][_0xba75('0x11e')](db['MailAccount'],{'as':'MailAccounts','through':_0xba75('0x137')});db['User'][_0xba75('0x11e')](db[_0xba75('0x5f')],{'as':_0xba75('0x138'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x13')]['belongsToMany'](db[_0xba75('0x56')],{'as':'SmsAccounts','through':_0xba75('0x139')});db['User'][_0xba75('0x11e')](db[_0xba75('0x13a')],{'as':_0xba75('0x13b'),'through':_0xba75('0x13c')});db[_0xba75('0x13')][_0xba75('0x11e')](db['SquareProject'],{'as':'SquareProjects','through':_0xba75('0x13d')});db[_0xba75('0x13e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x13f'),'onDelete':'cascade','foreignKey':_0xba75('0x140')});db[_0xba75('0x141')][_0xba75('0x110')](db[_0xba75('0x18')],{'onDelete':'cascade'});db['VoiceExtension'][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x142'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x19')][_0xba75('0x11e')](db[_0xba75('0x143')],{'as':_0xba75('0x144'),'through':_0xba75('0x145')});db['VoiceQueue'][_0xba75('0x110')](db['UserVoiceQueueRt'],{'as':_0xba75('0x146'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['CmHopper'],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')]['hasMany'](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db['ReportAgentPreview'],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x110')](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x147')});db['VoiceQueue'][_0xba75('0x110')](db['JscriptySessionReport'],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x147')});db[_0xba75('0x1a')][_0xba75('0x14b')](db[_0xba75('0x29')],{'as':'Trunk','foreignKey':_0xba75('0x14c')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x14d'),'foreignKey':_0xba75('0x14e')});db[_0xba75('0x1a')][_0xba75('0x14b')](db['Interval'],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db['VoiceQueue'][_0xba75('0x14b')](db['Pause'],{'as':_0xba75('0x150'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'Lists','through':_0xba75('0x151')});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0xba75('0x1a')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'as':'Teams','through':_0xba75('0x108')});db[_0xba75('0x1a')]['belongsToMany'](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x152')});db['VoiceRecording'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1d')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x13'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x1f')]['hasMany'](db[_0xba75('0x153')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x155'),'sourceKey':_0xba75('0x156')});db['VoiceMailMessage'][_0xba75('0x14b')](db[_0xba75('0x1f')],{'foreignKey':_0xba75('0x155'),'targetKey':_0xba75('0x156')});db[_0xba75('0x22')]['hasMany'](db['VoiceQueueReport'],{'as':_0xba75('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0xba75('0x22')][_0xba75('0x110')](db[_0xba75('0x158')],{'as':_0xba75('0x159'),'foreignKey':_0xba75('0x15a'),'constraints':![]});db[_0xba75('0x22')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x13'),'foreignKey':'UserId'});db[_0xba75('0x22')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x3c')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x15d'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x3e')]['belongsTo'](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasOne'](db[_0xba75('0x3c')],{'as':_0xba75('0x15f'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x10d')](db['MailServerOut'],{'as':_0xba75('0x160'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x15d')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x15e'),'onDelete':_0xba75('0x10e')});db['MailAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'foreignKey':'MailAccountId'});db[_0xba75('0x15d')][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x15d')]['hasMany'](db[_0xba75('0x164')],{'as':'Applications'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db['MailAccount'][_0xba75('0x14b')](db[_0xba75('0x91')],{'as':_0xba75('0x91'),'foreignKey':'TemplateId'});db[_0xba75('0x15d')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db[_0xba75('0x15d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x137')});db['MailQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x32')});db[_0xba75('0x41')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_mail_queues','as':_0xba75('0x167')});db[_0xba75('0x123')]['hasMany'](db[_0xba75('0x46')],{'as':_0xba75('0x154'),'onDelete':'cascade','foreignKey':_0xba75('0x168')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x15e')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x123')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x123')]['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16d')});db['MailInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x16c'),'as':_0xba75('0x16e')});db[_0xba75('0x123')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':'user_has_mail_interactions','foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':_0xba75('0x171'),'onDelete':'cascade'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db[_0xba75('0x46')]['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x46')]['belongsTo'](db['MailInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x168')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'ChatWebsite','foreignKey':_0xba75('0x173')});db[_0xba75('0x46')][_0xba75('0x14b')](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db['MailApplication'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')][_0xba75('0x14b')](db['MailQueue'],{'onDelete':_0xba75('0x175')});db['MailApplication']['belongsTo'](db[_0xba75('0x15d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x164')]['belongsTo'](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x164')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db['MailQueueReport'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db['MailQueueReport']['belongsTo'](db[_0xba75('0x13')],{});db[_0xba75('0x177')][_0xba75('0x14b')](db[_0xba75('0x41')],{});db[_0xba75('0x4a')][_0xba75('0x110')](db[_0xba75('0x4c')],{'as':_0xba75('0x179'),'onDelete':'cascade'});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xba75('0x10e')});db['FaxAccount'][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x17a')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':_0xba75('0x163')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x50')],{'as':_0xba75('0x142')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':_0xba75('0x17b'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x4e')][_0xba75('0x110')](db[_0xba75('0x52')],{'as':_0xba75('0x154')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['Trunk'],{'as':_0xba75('0x29')});db[_0xba75('0x4e')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x4e')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x4e')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x17d')});db[_0xba75('0x50')][_0xba75('0x14b')](db['User'],{'onDelete':'restrict'});db[_0xba75('0x50')][_0xba75('0x14b')](db[_0xba75('0x17e')],{'onDelete':_0xba75('0x175')});db['FaxApplication'][_0xba75('0x14b')](db[_0xba75('0x4e')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x50')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db['FaxInteraction']['hasMany'](db['FaxMessage'],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':_0xba75('0x169'),'foreignKey':'FaxAccountId'});db[_0xba75('0x118')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x118')]['belongsTo'](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16d')});db['FaxInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x180'),'as':_0xba75('0x16e')});db[_0xba75('0x118')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x127'),'foreignKey':_0xba75('0x17f')});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x52')][_0xba75('0x14b')](db['FaxInteraction'],{'as':_0xba75('0x172'),'foreignKey':_0xba75('0x17f')});db['FaxMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':'AttachmentId'});db[_0xba75('0x52')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'as':'Account','foreignKey':_0xba75('0x17a')});db['FaxQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x34')});db['FaxQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxAccount'],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x54')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0x54')]['belongsTo'](db[_0xba75('0x52')],{});db['FaxQueueReport'][_0xba75('0x14b')](db['User'],{});db[_0xba75('0x54')][_0xba75('0x14b')](db['FaxQueue'],{});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':_0xba75('0x181'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x56')]['hasMany'](db['SmsInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x56')]['hasMany'](db[_0xba75('0x58')],{'as':_0xba75('0x142')});db['SmsAccount'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x56')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':'mandatoryDispositionPause','foreignKey':_0xba75('0x166')});db['SmsAccount']['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x139')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x5d')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')][_0xba75('0x14b')](db[_0xba75('0x56')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x58')]['belongsTo'](db[_0xba75('0x87')],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0x58')][_0xba75('0x14b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xba75('0x176')});db[_0xba75('0x5a')][_0xba75('0x110')](db[_0xba75('0x5b')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5a')][_0xba75('0x14b')](db['SmsAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x181')});db[_0xba75('0x5a')]['belongsTo'](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['SmsInteraction'][_0xba75('0x11e')](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xba75('0x16b')],{'through':_0xba75('0x183'),'as':'ThroughTags'});db[_0xba75('0x5a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x128'),'foreignKey':_0xba75('0x182')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':'User'});db['SmsMessage'][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x5a')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':'SmsInteractionId'});db[_0xba75('0x5b')][_0xba75('0x14b')](db[_0xba75('0x56')],{'as':_0xba75('0x169'),'foreignKey':'SmsAccountId'});db[_0xba75('0x5d')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x36'),'foreignKey':_0xba75('0x184')});db['SmsQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_sms_queues','as':'Teams'});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'OpenchannelAccountId','onDelete':_0xba75('0x10e')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x82')],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x185')});db['OpenchannelAccount'][_0xba75('0x110')](db[_0xba75('0x63')],{'as':_0xba75('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xba75('0x5f')][_0xba75('0x110')](db['OpenchannelMessage'],{'as':'Messages','foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x110')](db[_0xba75('0x61')],{'as':_0xba75('0x142'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x5f')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x5f')]['belongsTo'](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x5f')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':'user_has_openchannel_accounts'});db[_0xba75('0x61')]['belongsTo'](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0x61')][_0xba75('0x14b')](db['OpenchannelQueue'],{'onDelete':_0xba75('0x175'),'foreignKey':'OpenchannelQueueId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x5f')],{'onDelete':'restrict','foreignKey':_0xba75('0x185')});db['OpenchannelApplication'][_0xba75('0x14b')](db[_0xba75('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xba75('0x61')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db[_0xba75('0x63')][_0xba75('0x110')](db[_0xba75('0x186')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x187')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x185')});db[_0xba75('0x63')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['OpenchannelInteraction'][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':_0xba75('0x10f')});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':'Tags'});db['OpenchannelInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x188'),'as':_0xba75('0x16e')});db[_0xba75('0x63')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x189'),'foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':'cascade','as':'User'});db[_0xba75('0x186')]['belongsTo'](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x63')],{'onDelete':_0xba75('0x10e'),'as':'Interaction','foreignKey':_0xba75('0x187')});db[_0xba75('0x186')][_0xba75('0x14b')](db['Attachment'],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db['OpenchannelMessage'][_0xba75('0x14b')](db[_0xba75('0x5f')],{'as':'Account','foreignKey':_0xba75('0x185')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x38'),'foreignKey':_0xba75('0x18b')});db['OpenchannelQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x18c'),'as':_0xba75('0x167')});db['ChatWebsite'][_0xba75('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xba75('0x173'),'onDelete':'cascade'});db['ChatWebsite'][_0xba75('0x110')](db['CannedAnswer'],{'as':_0xba75('0x162'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x18d')],{'as':'ProactiveActions'});db[_0xba75('0x66')][_0xba75('0x110')](db['ChatInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x66')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x142')});db[_0xba75('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xba75('0x154')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x66')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':'Interval','foreignKey':_0xba75('0x14f')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'as':'MailAccount','foreignKey':_0xba75('0x15e')});db['ChatWebsite'][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x66')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x135')});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x5f')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x18e')][_0xba75('0x14b')](db['CmContact'],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x63')],{});db[_0xba75('0x18e')]['belongsTo'](db[_0xba75('0x186')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x18e')][_0xba75('0x14b')](db[_0xba75('0x132')],{});db[_0xba75('0x68')][_0xba75('0x14b')](db['User'],{'as':_0xba75('0x18f'),'foreignKey':_0xba75('0x10f'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xba75('0x6e')],{'as':_0xba75('0x190'),'foreignKey':_0xba75('0x191'),'onDelete':'restrict'});db['ChatApplication'][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173'),'onDelete':'restrict'});db[_0xba75('0x68')]['belongsTo'](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['ChatInteraction'][_0xba75('0x110')](db[_0xba75('0x192')],{'as':_0xba75('0x154'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x193')});db[_0xba75('0x6a')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6a')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6a')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db['ChatInteraction'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xba75('0x6a')][_0xba75('0x11e')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0xba75('0x16e')});db[_0xba75('0x6a')]['belongsToMany'](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x126'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x13')});db[_0xba75('0x192')][_0xba75('0x14b')](db['CmContact'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db[_0xba75('0x192')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x172'),'foreignKey':_0xba75('0x193')});db['ChatMessage'][_0xba75('0x14b')](db[_0xba75('0x170')],{'as':_0xba75('0x170'),'foreignKey':_0xba75('0x18a')});db[_0xba75('0x192')][_0xba75('0x14b')](db[_0xba75('0x66')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x173')});db[_0xba75('0x6d')][_0xba75('0x110')](db[_0xba75('0x170')],{'as':'Attachments','foreignKey':_0xba75('0x174'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x6d')][_0xba75('0x14b')](db[_0xba75('0x74')],{'onDelete':'cascade','as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x6d')][_0xba75('0x14b')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xba75('0x173')});db[_0xba75('0x6e')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x30'),'hooks':!![]});db['ChatQueue'][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':'team_has_chat_queues','as':'Teams'});db[_0xba75('0x70')][_0xba75('0x110')](db[_0xba75('0xcd')],{'as':'Messages','foreignKey':_0xba75('0x194'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x70')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x146'),'through':_0xba75('0x195')});db[_0xba75('0x18d')]['belongsTo'](db[_0xba75('0x66')],{'as':'Website','foreignKey':_0xba75('0x173')});db['CmCompany'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':_0xba75('0x120'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xba75('0x74')][_0xba75('0x110')](db['CmHopperHistory'],{'as':_0xba75('0x149'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x197')],{'as':_0xba75('0x14a'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x63')],{'as':'OpenchannelInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x6a')],{'as':_0xba75('0x125'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')]['hasMany'](db[_0xba75('0x5a')],{'as':_0xba75('0x117'),'foreignKey':'ContactId','onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x110')](db[_0xba75('0x118')],{'as':'FaxInteractions','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db['CmContact'][_0xba75('0x110')](db['MailInteraction'],{'as':_0xba75('0x11a'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x175')});db[_0xba75('0x74')][_0xba75('0x14b')](db[_0xba75('0x72')],{'as':_0xba75('0x198'),'foreignKey':_0xba75('0x196')});db[_0xba75('0x74')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x199')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'as':'Tags','through':_0xba75('0x19a')});db[_0xba75('0x74')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x19a'),'as':_0xba75('0x16e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x76')]['belongsTo'](db['User'],{'as':'Agent','foreignKey':_0xba75('0x10f')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db['CmHopper'][_0xba75('0x14b')](db[_0xba75('0xe2')],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db[_0xba75('0x76')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x16a'),'foreignKey':'OwnerId'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c'),'onDelete':_0xba75('0x10e')});db['CmHopperBlack'][_0xba75('0x14b')](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178'),'onDelete':'cascade'});db[_0xba75('0x78')][_0xba75('0x14b')](db[_0xba75('0x1a')],{'as':_0xba75('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xba75('0x10e')});db[_0xba75('0x78')]['belongsTo'](db['Campaign'],{'as':_0xba75('0xe2'),'foreignKey':'CampaignId','onDelete':_0xba75('0x10e')});db['Automation'][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19c'),'singular':_0xba75('0x19d')},'foreignKey':_0xba75('0x19e'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x19f'),'singular':_0xba75('0x1a0')},'foreignKey':'AutomationAnyId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x80')]['hasMany'](db[_0xba75('0x1a1')],{'as':_0xba75('0x1a2'),'foreignKey':_0xba75('0x1a3'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x84')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ParentId','onDelete':'cascade'});db['Interval'][_0xba75('0x110')](db[_0xba75('0x87')],{'as':'Intervals','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x10e'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xba75('0x18')],{'as':'Extensions','foreignKey':_0xba75('0x14f'),'onDelete':_0xba75('0x175')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x164')],{'as':_0xba75('0x1a4'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x68')],{'as':_0xba75('0x1a5'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db['FaxApplication'],{'as':_0xba75('0x1a6'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0x87')][_0xba75('0x110')](db[_0xba75('0x58')],{'as':'SmsApplications','foreignKey':_0xba75('0x14f')});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x15d')],{});db[_0xba75('0x8e')][_0xba75('0x14b')](db[_0xba75('0x1a7')],{'foreignKey':'DefaultReportId'});db[_0xba75('0x8e')]['belongsTo'](db[_0xba75('0x99')],{'foreignKey':'CustomReportId'});db[_0xba75('0x143')]['belongsToMany'](db[_0xba75('0x19')],{'as':_0xba75('0x1a8'),'through':_0xba75('0x145'),'onDelete':_0xba75('0x175')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x74')],{'through':_0xba75('0x19a')});db[_0xba75('0x16b')]['belongsToMany'](db['ChatInteraction'],{'through':_0xba75('0x1a9')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x123')],{'through':_0xba75('0x16c')});db['Tag'][_0xba75('0x11e')](db[_0xba75('0x5a')],{'through':_0xba75('0x183')});db['Tag']['belongsToMany'](db[_0xba75('0x118')],{'through':_0xba75('0x180')});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0x63')],{'through':'openchannel_interaction_has_tags'});db[_0xba75('0x16b')][_0xba75('0x11e')](db[_0xba75('0xfe')],{'through':_0xba75('0x1aa')});db['Trigger']['hasMany'](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ab'),'singular':_0xba75('0x1ac')},'foreignKey':_0xba75('0x1ad'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x92')][_0xba75('0x110')](db[_0xba75('0x19b')],{'as':{'plural':_0xba75('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0xba75('0x1af'),'onDelete':_0xba75('0x10e'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0xba75('0x10e'),'hooks':!![]});db[_0xba75('0x99')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xba75('0x1b0'),'hooks':!![]});db[_0xba75('0x1a7')][_0xba75('0x110')](db[_0xba75('0x9c')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b2')});db[_0xba75('0x1b3')][_0xba75('0x110')](db['AnalyticFieldReport'],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b4')});db[_0xba75('0x9c')]['belongsTo'](db[_0xba75('0x1b3')],{'foreignKey':_0xba75('0x1b4')});db[_0xba75('0xa0')][_0xba75('0x110')](db[_0xba75('0xa2')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa2')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xba75('0xa3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa2')]['belongsTo'](db[_0xba75('0xa0')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['SalesforceField'][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa3')][_0xba75('0x110')](db['SalesforceField'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xa3')][_0xba75('0x110')](db[_0xba75('0xa3')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa3')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':'VariableId'});db[_0xba75('0x1bd')]['hasMany'](db['SugarcrmConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa5')]['hasMany'](db[_0xba75('0xa7')],{'as':_0xba75('0x1b6'),'onDelete':'cascade','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa5')][_0xba75('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa5')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xba75('0x14b')](db[_0xba75('0x1bd')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0xa7')]['hasMany'](db['SugarcrmField'],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['SugarcrmField'][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa7')][_0xba75('0x110')](db[_0xba75('0xa7')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa7')][_0xba75('0x14b')](db['Variable'],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c1')]['hasMany'](db[_0xba75('0x1c2')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1c2')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c2')]['hasMany'](db[_0xba75('0xa9')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['DeskConfiguration'][_0xba75('0x14b')](db['DeskAccount'],{'as':_0xba75('0x169'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c3')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xa9')][_0xba75('0x110')](db[_0xba75('0xa9')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xa9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':'VariableId'});db[_0xba75('0x1c4')]['hasMany'](db[_0xba75('0x1c5')],{'as':_0xba75('0x1be'),'onDelete':'cascade','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c5')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['ZohoConfiguration']['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db['ZohoConfiguration'][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1b1'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c5')]['belongsTo'](db[_0xba75('0x1c4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xab')]['hasMany'](db[_0xba75('0xab')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xab')][_0xba75('0x110')](db[_0xba75('0xab')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZohoField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xad')][_0xba75('0x110')](db[_0xba75('0x1c6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1b6'),'foreignKey':'SubjectId'});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1c6')][_0xba75('0x110')](db['ZendeskField'],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1c6')][_0xba75('0x14b')](db[_0xba75('0xad')],{'as':'Account','foreignKey':_0xba75('0x1b5')});db[_0xba75('0x1c6')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':_0xba75('0x1c7')});db[_0xba75('0xaf')][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db['ZendeskField'][_0xba75('0x110')](db[_0xba75('0xaf')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xaf')]['hasMany'](db[_0xba75('0xaf')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['ZendeskField'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db[_0xba75('0xb1')]['hasMany'](db['FreshdeskConfiguration'],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')]['hasMany'](db[_0xba75('0xb5')],{'as':_0xba75('0x1b6'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb3')][_0xba75('0x110')](db['FreshdeskField'],{'as':_0xba75('0x1b8'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb3')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1b1'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0xba75('0xb3')][_0xba75('0x14b')](db['FreshdeskAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb3')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xba75('0xb5')]['hasMany'](db[_0xba75('0xb5')],{'as':'Subject','foreignKey':'SubjectId'});db['FreshdeskField'][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0xb5')][_0xba75('0x110')](db[_0xba75('0xb5')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0xb5')]['belongsTo'](db['Variable'],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0x1c8')][_0xba75('0x110')](db[_0xba75('0xb8')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xb8')][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xb8')]['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['VtigerConfiguration']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1b1'),'foreignKey':_0xba75('0x1b9')});db['VtigerConfiguration'][_0xba75('0x14b')](db['VtigerAccount'],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['VtigerField']['hasMany'](db[_0xba75('0x1c9')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['VtigerField'][_0xba75('0x110')](db[_0xba75('0x1c9')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db[_0xba75('0x1c9')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ServicenowAccount'][_0xba75('0x110')](db[_0xba75('0x1ca')],{'as':'Configurations','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':_0xba75('0x1b6'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0x1ca')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1b8'),'foreignKey':_0xba75('0x1bf')});db['ServicenowConfiguration']['hasMany'](db[_0xba75('0xbd')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1ca')][_0xba75('0x14b')](db[_0xba75('0xba')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db[_0xba75('0xbd')][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1ba'),'foreignKey':_0xba75('0x1b7')});db[_0xba75('0xbd')][_0xba75('0x110')](db['ServicenowField'],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db['ServicenowField'][_0xba75('0x110')](db[_0xba75('0xbd')],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0xbd')]['belongsTo'](db[_0xba75('0x94')],{'as':'Variable','foreignKey':_0xba75('0x1c0')});db['Dynamics365Account'][_0xba75('0x110')](db[_0xba75('0xc1')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':'AccountId'});db[_0xba75('0xc1')][_0xba75('0x110')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b7')});db['Dynamics365Configuration'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1b8'),'onDelete':'cascade','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc1')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':'Fields','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b9')});db['Dynamics365Configuration'][_0xba75('0x14b')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xba75('0x1b5')});db['Dynamics365Field'][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1ba'),'foreignKey':'SubjectId'});db[_0xba75('0xc3')]['hasMany'](db['Dynamics365Field'],{'as':_0xba75('0x1bb'),'foreignKey':'DescriptionId'});db[_0xba75('0xc3')][_0xba75('0x110')](db[_0xba75('0xc3')],{'as':_0xba75('0x1bc'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db[_0xba75('0xc4')][_0xba75('0x110')](db[_0xba75('0xc6')],{'as':_0xba75('0x1be'),'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesConfiguration'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subjects','foreignKey':_0xba75('0x1b7')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Descriptions','foreignKey':_0xba75('0x1bf')});db[_0xba75('0xc6')][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Fields','foreignKey':_0xba75('0x1b9')});db[_0xba75('0xc6')][_0xba75('0x14b')](db[_0xba75('0xc4')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1b5')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':'Subject','foreignKey':_0xba75('0x1b7')});db['FreshsalesField'][_0xba75('0x110')](db[_0xba75('0x1cb')],{'as':_0xba75('0x1bb'),'foreignKey':_0xba75('0x1bf')});db[_0xba75('0x1cb')][_0xba75('0x110')](db['FreshsalesField'],{'as':_0xba75('0x1bc'),'foreignKey':_0xba75('0x1b9')});db[_0xba75('0x1cb')][_0xba75('0x14b')](db[_0xba75('0x94')],{'as':_0xba75('0x94'),'foreignKey':_0xba75('0x1c0')});db['ChatQueueReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':'Contact','foreignKey':_0xba75('0x15c')});db[_0xba75('0xcb')]['belongsTo'](db[_0xba75('0x6a')],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xcb')]['belongsTo'](db['User'],{});db[_0xba75('0xcb')][_0xba75('0x14b')](db[_0xba75('0x6e')],{});db['ChatInternalMessage'][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cc')});db[_0xba75('0xcd')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1cd')});db[_0xba75('0x197')][_0xba75('0x110')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xba75('0x197')][_0xba75('0x110')](db[_0xba75('0xcf')],{'foreignKey':_0xba75('0x1ce'),'onDelete':'cascade'});db[_0xba75('0xd3')]['belongsTo'](db[_0xba75('0x56')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':'ListId'});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xd3')][_0xba75('0x14b')](db[_0xba75('0x13')],{});db['SmsQueueReport']['belongsTo'](db[_0xba75('0x5d')],{});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptySessionReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db[_0xba75('0x1d0')],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0xd7')][_0xba75('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xba75('0x1cf')});db[_0xba75('0x1d1')]['belongsToMany'](db[_0xba75('0x13')],{'as':_0xba75('0x16f'),'through':_0xba75('0x13d')});db['Team'][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':_0xba75('0x122')});db[_0xba75('0xdf')]['belongsToMany'](db['VoiceQueue'],{'through':_0xba75('0x108'),'as':_0xba75('0x12b')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x41')],{'through':_0xba75('0x1d2'),'as':'MailQueues'});db[_0xba75('0xdf')][_0xba75('0x11e')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xba75('0x12f')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x17e')],{'through':'team_has_fax_queues','as':_0xba75('0x130')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x5d')],{'through':_0xba75('0x1d3'),'as':_0xba75('0x131')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x132')],{'through':_0xba75('0x18c'),'as':_0xba75('0x133')});db[_0xba75('0xdf')][_0xba75('0x11e')](db[_0xba75('0x104')],{'through':_0xba75('0x1d4'),'as':_0xba75('0x134')});db['Team']['belongsToMany'](db[_0xba75('0xf4')],{'through':_0xba75('0x10a'),'as':_0xba75('0x12c')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x76')],{'as':_0xba75('0x148'),'foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':'HopperFinals','foreignKey':_0xba75('0x1d5')});db[_0xba75('0xe2')][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xba75('0xe2')]['hasMany'](db[_0xba75('0x78')],{'as':'HopperBlacks','foreignKey':_0xba75('0x1d5')});db['Campaign']['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x29'),'foreignKey':_0xba75('0x14c')});db[_0xba75('0xe2')]['belongsTo'](db[_0xba75('0x29')],{'as':_0xba75('0x14d'),'foreignKey':'TrunkBackupId'});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x87')],{'as':_0xba75('0x87'),'foreignKey':_0xba75('0x14f')});db[_0xba75('0xe2')][_0xba75('0x14b')](db[_0xba75('0x1d1')],{'as':_0xba75('0x1d1'),'foreignKey':_0xba75('0x1d6')});db[_0xba75('0xe2')]['belongsToMany'](db[_0xba75('0xf2')],{'as':_0xba75('0x121'),'through':_0xba75('0x1d7')});db[_0xba75('0xe2')][_0xba75('0x11e')](db[_0xba75('0xf2')],{'as':'BlackLists','through':_0xba75('0x1d8')});db[_0xba75('0x170')]['belongsTo'](db[_0xba75('0x6d')],{'as':_0xba75('0x6d'),'foreignKey':_0xba75('0x174')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x46')],{});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x123')],{});db['MailTransferReport'][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':_0xba75('0x1d9'),'as':'FromAccount'});db[_0xba75('0xe9')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x41')],{'foreignKey':'ToMailQueueId','as':_0xba75('0x1de')});db[_0xba75('0xe9')][_0xba75('0x14b')](db[_0xba75('0x15d')],{'foreignKey':'ToMailAccountId','as':_0xba75('0x1df')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x192')],{});db[_0xba75('0xea')]['belongsTo'](db[_0xba75('0x6a')],{});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e0'),'as':'FromAccount'});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':'FromAgent'});db['ChatTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x6e')],{'foreignKey':'ToChatQueueId','as':_0xba75('0x1de')});db[_0xba75('0xea')][_0xba75('0x14b')](db[_0xba75('0x66')],{'foreignKey':_0xba75('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x52')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x118')],{});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x4e')],{'foreignKey':_0xba75('0x1e2'),'as':_0xba75('0x1e3')});db[_0xba75('0xec')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':_0xba75('0x1db')});db[_0xba75('0xec')][_0xba75('0x14b')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xba75('0x14b')](db[_0xba75('0x17e')],{'foreignKey':_0xba75('0x1e4'),'as':_0xba75('0x1de')});db[_0xba75('0xec')][_0xba75('0x14b')](db['FaxAccount'],{'foreignKey':_0xba75('0x1e5'),'as':'ToAccount'});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelMessage'],{});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelInteraction'],{});db[_0xba75('0xee')]['belongsTo'](db[_0xba75('0x5f')],{'foreignKey':_0xba75('0x1e6'),'as':_0xba75('0x1e3')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xee')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['OpenchannelTransferReport'][_0xba75('0x14b')](db[_0xba75('0x132')],{'foreignKey':_0xba75('0x1e7'),'as':_0xba75('0x1de')});db[_0xba75('0xee')][_0xba75('0x14b')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xba75('0x14b')](db['SmsMessage'],{});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x5a')],{});db['SmsTransferReport'][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':_0xba75('0x1e8'),'as':_0xba75('0x1e3')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1da'),'as':_0xba75('0x1db')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['User'],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db[_0xba75('0xf0')][_0xba75('0x14b')](db['SmsQueue'],{'foreignKey':_0xba75('0x1e9'),'as':_0xba75('0x1de')});db[_0xba75('0xf0')][_0xba75('0x14b')](db[_0xba75('0x56')],{'foreignKey':'ToSmsAccountId','as':_0xba75('0x1df')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':_0xba75('0x161'),'foreignKey':'ListId','onDelete':_0xba75('0x10e')});db[_0xba75('0xf2')][_0xba75('0x110')](db['CmCustomField'],{'as':_0xba75('0x1ea'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x74')],{'as':'Contacts','onDelete':_0xba75('0x10e'),'foreignKey':'ListId'});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x79')],{'as':_0xba75('0x113'),'foreignKey':'ListId'});db['CmList'][_0xba75('0x110')](db[_0xba75('0x7b')],{'as':'HopperHistory','foreignKey':_0xba75('0x178')});db[_0xba75('0xf2')][_0xba75('0x110')](db[_0xba75('0x115')],{'as':_0xba75('0x115'),'foreignKey':'ListId'});db[_0xba75('0xf2')]['belongsToMany'](db[_0xba75('0x1a')],{'as':_0xba75('0x1eb'),'through':_0xba75('0x151')});db[_0xba75('0xf2')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x1ec')});db[_0xba75('0xf4')][_0xba75('0x110')](db[_0xba75('0x18')],{'as':'Extensions','onDelete':_0xba75('0x10e')});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xba75('0xf4')][_0xba75('0x11e')](db[_0xba75('0xdf')],{'through':_0xba75('0x10a'),'as':'Teams'});db[_0xba75('0x11d')]['hasMany'](db['User'],{'as':_0xba75('0x16f'),'foreignKey':_0xba75('0x1ed')});db[_0xba75('0x11d')][_0xba75('0x110')](db[_0xba75('0xf6')],{'as':_0xba75('0x1ee'),'foreignKey':_0xba75('0x1ed'),'onDelete':_0xba75('0x10e')});db[_0xba75('0xf6')][_0xba75('0x110')](db[_0xba75('0x1ef')],{'as':_0xba75('0x1f0'),'foreignKey':'sectionId','onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')][_0xba75('0x110')](db[_0xba75('0x84')],{'as':'Dispositions','foreignKey':_0xba75('0x1f1'),'onDelete':_0xba75('0x10e')});db[_0xba75('0x13a')]['hasMany'](db[_0xba75('0x82')],{'as':'Answers','foreignKey':_0xba75('0x1f1')});db['WhatsappAccount'][_0xba75('0x110')](db[_0xba75('0xff')],{'as':_0xba75('0x154'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappInteraction'],{'as':_0xba75('0x163')});db[_0xba75('0x13a')][_0xba75('0x110')](db['WhatsappApplication'],{'as':'Applications'});db[_0xba75('0x13a')]['belongsTo'](db['CmList'],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x13a')][_0xba75('0x14b')](db[_0xba75('0x89')],{'as':_0xba75('0x150'),'foreignKey':_0xba75('0x166')});db[_0xba75('0x13a')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':_0xba75('0x17c'),'through':_0xba75('0x13c')});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x13')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['WhatsappQueue'],{'onDelete':_0xba75('0x175')});db['WhatsappApplication'][_0xba75('0x14b')](db[_0xba75('0x13a')],{'onDelete':_0xba75('0x175')});db[_0xba75('0xfc')][_0xba75('0x14b')](db['Interval'],{'onDelete':_0xba75('0x175'),'foreignKey':'IntervalId'});db[_0xba75('0xfc')][_0xba75('0x14b')](db[_0xba75('0x16b')],{'onDelete':_0xba75('0x175'),'foreignKey':_0xba75('0x176')});db['WhatsappInteraction'][_0xba75('0x110')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0xba75('0x10e'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xfe')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':'Account','foreignKey':_0xba75('0x1f1')});db['WhatsappInteraction'][_0xba75('0x14b')](db[_0xba75('0x74')],{'as':_0xba75('0x15b'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0xba75('0x14b')](db['User'],{'as':'Owner','foreignKey':_0xba75('0x10f')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x16b')],{'through':'whatsapp_interaction_has_tags','as':_0xba75('0x16d')});db[_0xba75('0xfe')][_0xba75('0x11e')](db['Tag'],{'through':_0xba75('0x1aa'),'as':_0xba75('0x16e')});db[_0xba75('0xfe')][_0xba75('0x11e')](db[_0xba75('0x13')],{'as':'Users','through':_0xba75('0x12a'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13')],{'as':_0xba75('0x13')});db['WhatsappMessage']['belongsTo'](db[_0xba75('0x74')],{'onDelete':_0xba75('0x10e'),'as':_0xba75('0x15b')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0xfe')],{'onDelete':'cascade','as':_0xba75('0x172'),'foreignKey':_0xba75('0x1f2')});db[_0xba75('0xff')][_0xba75('0x14b')](db[_0xba75('0x13a')],{'as':_0xba75('0x169'),'foreignKey':_0xba75('0x1f1')});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x13a')],{});db['WhatsappQueueReport']['belongsTo'](db[_0xba75('0xf2')],{'as':_0xba75('0x165'),'foreignKey':_0xba75('0x178')});db[_0xba75('0x101')][_0xba75('0x14b')](db['CmContact'],{'as':_0xba75('0x15b'),'foreignKey':_0xba75('0x15c')});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0xfe')],{});db[_0xba75('0x101')][_0xba75('0x14b')](db[_0xba75('0x104')],{});db[_0xba75('0x101')]['belongsTo'](db[_0xba75('0xff')],{});db['WhatsappQueueReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0xff')],{});db[_0xba75('0x102')]['belongsTo'](db[_0xba75('0xfe')],{});db[_0xba75('0x102')][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xba75('0x14b')](db['WhatsappAccount'],{'foreignKey':_0xba75('0x1f3'),'as':_0xba75('0x1df')});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x104')],{'foreignKey':'ToQueueId','as':_0xba75('0x1de')});db['WhatsappTransferReport'][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xba75('0x102')][_0xba75('0x14b')](db[_0xba75('0x13')],{'foreignKey':_0xba75('0x1dc'),'as':_0xba75('0x1dd')});db['WhatsappQueue']['belongsToMany'](db[_0xba75('0x13')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xba75('0x104')][_0xba75('0x11e')](db['Team'],{'through':_0xba75('0x1d4'),'as':_0xba75('0x167')});module[_0xba75('0x1f4')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x5b02=['../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','UserVoicePrefix','hasOne','cascade','User','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteraction','OpenchannelInteractions','ChatInteraction','SmsInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','FaxQueue','UserFaxQueue','SmsQueues','WhatsappQueues','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','Applications','Sound','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','BlackLists','Messages','mailbox','VoiceMailMessage','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Disposition','Dispositions','Answers','Interactions','List','TemplateId','Agents','Teams','MailInteractionId','Owner','mail_interaction_has_tags','Users','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','ListId','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','Account','fax_interaction_has_tags','ThroughTags','Interaction','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','SmsApplication','user_has_sms_accounts','sms_interaction_has_tags','Tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','UserChatQueue','ChatInternalMessage','ChatGroupId','Members','ChatProactiveAction','CompanyId','FaxInteractions','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','Automation','OneAny','AutomationAnyId','Action','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','Subject','Description','DescriptionId','Field','FieldId','VariableId','int_desk_configuration_has_tags','ZohoField','ZendeskField','FreshdeskField','ServicenowField','Dynamics365Configuration','FreshsalesAccount','FromId','SessionId','JscriptyAnswerReport','ProjectId','SquareProject','team_has_mail_queues','team_has_chat_queues','ChatQueues','FaxQueues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','sequelizeHistory','utf8mb4','utf8_general_ci','database','username','password','options','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Variable','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport'];(function(_0x499490,_0x253738){var _0x19c28f=function(_0x13a296){while(--_0x13a296){_0x499490['push'](_0x499490['shift']());}};_0x19c28f(++_0x253738);}(_0x5b02,0xe9));var _0x25b0=function(_0x57a876,_0x5220b8){_0x57a876=_0x57a876-0x0;var _0x2fcaf5=_0x5b02[_0x57a876];return _0x2fcaf5;};'use strict';var config=require(_0x25b0('0x0'));var Sequelize=require(_0x25b0('0x1'));var _=require(_0x25b0('0x2'));var jstz=require(_0x25b0('0x3'));var timezone=jstz['determine']();config['sequelize']=_[_0x25b0('0x4')](config['sequelize'],{'database':_0x25b0('0x5'),'username':_0x25b0('0x6'),'password':_0x25b0('0x7'),'options':{'host':_0x25b0('0x8'),'port':0xcea,'dialect':_0x25b0('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x25b0('0xa')](),'define':{'charset':_0x25b0('0xb'),'collate':'utf8_general_ci'}}});config[_0x25b0('0xc')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x25b0('0x5'),'username':_0x25b0('0x6'),'password':_0x25b0('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x25b0('0x9'),'dialectOptions':{'charset':_0x25b0('0xd')},'logging':![],'timezone':timezone[_0x25b0('0xa')](),'define':{'charset':_0x25b0('0xb'),'collate':_0x25b0('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x25b0('0x1')][_0x25b0('0xf')],config[_0x25b0('0x1')][_0x25b0('0x10')],config[_0x25b0('0x1')][_0x25b0('0x11')],config[_0x25b0('0x1')][_0x25b0('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x25b0('0xc')][_0x25b0('0xf')],config[_0x25b0('0xc')][_0x25b0('0x10')],config[_0x25b0('0xc')][_0x25b0('0x11')],config[_0x25b0('0xc')][_0x25b0('0x12')])};db['User']=db['sequelize'][_0x25b0('0x13')]('../api/user/user.model');db[_0x25b0('0x14')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x15'));db['VoiceContext']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x16'));db[_0x25b0('0x17')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x25b0('0x18')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x19'));db[_0x25b0('0x1a')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x1b'));db[_0x25b0('0x1c')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x1d'));db['ScreenRecording']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/screenRecording/screenRecording.model');db[_0x25b0('0x1e')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x1f'));db[_0x25b0('0x20')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x21'));db[_0x25b0('0x22')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x25b0('0x23')]=db[_0x25b0('0x1')]['import']('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x24'));db[_0x25b0('0x25')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x26'));db[_0x25b0('0x27')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x28'));db[_0x25b0('0x29')]=db[_0x25b0('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x25b0('0x2a')]=db['sequelize']['import'](_0x25b0('0x2b'));db[_0x25b0('0x2c')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x2d'));db['UserChatQueue']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x25b0('0x2e')]=db[_0x25b0('0x1')]['import'](_0x25b0('0x2f'));db['UserFaxQueue']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x30'));db[_0x25b0('0x31')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x32'));db[_0x25b0('0x33')]=db[_0x25b0('0x1')]['import'](_0x25b0('0x34'));db[_0x25b0('0x35')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x36'));db[_0x25b0('0x37')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x38'));db[_0x25b0('0x39')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x3a'));db[_0x25b0('0x3b')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x3c'));db[_0x25b0('0x3d')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x3e'));db[_0x25b0('0x3f')]=db[_0x25b0('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x25b0('0x40')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x25b0('0x41')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x42'));db[_0x25b0('0x43')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/mailApplication/mailApplication.model');db[_0x25b0('0x44')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x45'));db[_0x25b0('0x46')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x47'));db[_0x25b0('0x48')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x49'));db[_0x25b0('0x4a')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x4b'));db[_0x25b0('0x4c')]=db['sequelize'][_0x25b0('0x13')]('../api/faxApplication/faxApplication.model');db[_0x25b0('0x4d')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x4e'));db['FaxMessage']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x4f'));db['FaxQueue']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x50'));db[_0x25b0('0x51')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x52'));db['SmsAccount']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x53'));db['SmsApplication']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x54'));db[_0x25b0('0x55')]=db[_0x25b0('0x1')]['import'](_0x25b0('0x56'));db[_0x25b0('0x57')]=db[_0x25b0('0x1')]['import'](_0x25b0('0x58'));db[_0x25b0('0x59')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x5a'));db[_0x25b0('0x5b')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x25b0('0x5c')]=db['sequelize']['import'](_0x25b0('0x5d'));db['OpenchannelInteraction']=db[_0x25b0('0x1')]['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0x25b0('0x5e')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x5f'));db[_0x25b0('0x60')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x61'));db[_0x25b0('0x62')]=db[_0x25b0('0x1')]['import']('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x63'));db[_0x25b0('0x64')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x65'));db['ChatInteraction']=db[_0x25b0('0x1')]['import'](_0x25b0('0x66'));db['ChatMessage']=db['sequelize'][_0x25b0('0x13')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x67'));db[_0x25b0('0x68')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x69'));db[_0x25b0('0x6a')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x25b0('0x6b')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x6c'));db[_0x25b0('0x6d')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x6e'));db[_0x25b0('0x6f')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x70'));db[_0x25b0('0x71')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x72'));db[_0x25b0('0x73')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x74'));db[_0x25b0('0x75')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x76'));db['ReportAgentPreview']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x25b0('0x77')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x78'));db['Action']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x79'));db['Automation']=db[_0x25b0('0x1')]['import'](_0x25b0('0x7a'));db[_0x25b0('0x7b')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x7c'));db['Disposition']=db[_0x25b0('0x1')]['import']('../api/disposition/disposition.model');db['Condition']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x7d'));db['Interval']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x7e'));db[_0x25b0('0x7f')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x80'));db[_0x25b0('0x81')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x82'));db[_0x25b0('0x83')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x84'));db[_0x25b0('0x85')]=db[_0x25b0('0x1')]['import'](_0x25b0('0x86'));db['Sound']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x87'));db[_0x25b0('0x88')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x89'));db[_0x25b0('0x8a')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x8b'));db['Trigger']=db['sequelize'][_0x25b0('0x13')]('../api/trigger/trigger.model');db[_0x25b0('0x8c')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/variable/variable.model');db[_0x25b0('0x8d')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x8e'));db['IntegrationReport']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x8f'));db['AnalyticCustomReport']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x90'));db[_0x25b0('0x91')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x92'));db[_0x25b0('0x93')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x94'));db[_0x25b0('0x95')]=db[_0x25b0('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x25b0('0x96')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x97'));db['AnalyticTreeReport']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x25b0('0x98')]=db[_0x25b0('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x25b0('0x99')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x9a'));db[_0x25b0('0x9b')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x9c'));db[_0x25b0('0x9d')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x9e'));db[_0x25b0('0x9f')]=db['sequelize'][_0x25b0('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x25b0('0xa0')]=db[_0x25b0('0x1')]['import'](_0x25b0('0xa1'));db[_0x25b0('0xa2')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xa3'));db[_0x25b0('0xa4')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xa5'));db[_0x25b0('0xa6')]=db[_0x25b0('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0x25b0('0xa7')]=db[_0x25b0('0x1')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x25b0('0xa8')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xa9'));db['ZohoField']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/intZohoField/intZohoField.model');db[_0x25b0('0xaa')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xab'));db[_0x25b0('0xac')]=db['sequelize']['import'](_0x25b0('0xad'));db['ZendeskField']=db['sequelize']['import'](_0x25b0('0xae'));db[_0x25b0('0xaf')]=db[_0x25b0('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x25b0('0xb0')]=db[_0x25b0('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xb1'));db[_0x25b0('0xb2')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xb3'));db[_0x25b0('0xb4')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xb5'));db[_0x25b0('0xb6')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xb7'));db[_0x25b0('0xb8')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xb9'));db[_0x25b0('0xba')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xbb'));db['ServicenowField']=db['sequelize'][_0x25b0('0x13')]('../api/intServicenowField/intServicenowField.model');db[_0x25b0('0xbc')]=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xbd'));db[_0x25b0('0xbe')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xbf'));db['FreshsalesAccount']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xc0'));db[_0x25b0('0xc1')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xc2'));db[_0x25b0('0xc3')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xc4'));db[_0x25b0('0x8d')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0x8e'));db[_0x25b0('0xc5')]=db[_0x25b0('0x1')]['import'](_0x25b0('0xc6'));db[_0x25b0('0xc7')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xc8'));db['ChatInternalMessage']=db[_0x25b0('0x1')]['import'](_0x25b0('0xc9'));db['JscriptyAnswerReport']=db['sequelize'][_0x25b0('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x25b0('0xca')]=db[_0x25b0('0x1')]['import'](_0x25b0('0xcb'));db[_0x25b0('0xcc')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x25b0('0xcd')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0x25b0('0xce')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xcf'));db[_0x25b0('0xd0')]=db['sequelize']['import'](_0x25b0('0xd1'));db[_0x25b0('0xd2')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xd3'));db[_0x25b0('0xd4')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xd5'));db[_0x25b0('0xd6')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xd7'));db['SquareProject']=db[_0x25b0('0x1')]['import'](_0x25b0('0xd8'));db[_0x25b0('0xd9')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xda'));db[_0x25b0('0xdb')]=db['sequelize'][_0x25b0('0x13')]('../api/squareMessage/squareMessage.model');db[_0x25b0('0xdc')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xdd'));db[_0x25b0('0xde')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xdf'));db['Campaign']=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xe0'));db[_0x25b0('0xe1')]=db[_0x25b0('0x1')]['import'](_0x25b0('0xe2'));db[_0x25b0('0xe3')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/attachment/attachment.model');db[_0x25b0('0xe4')]=db[_0x25b0('0x1')]['import'](_0x25b0('0xe5'));db[_0x25b0('0xe6')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xe7'));db[_0x25b0('0xe8')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xe9'));db[_0x25b0('0xea')]=db['sequelize'][_0x25b0('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x25b0('0xeb')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xec'));db[_0x25b0('0xed')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xee'));db[_0x25b0('0xef')]=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xf0'));db[_0x25b0('0xf1')]=db['sequelize'][_0x25b0('0x13')]('../api/userProfile/userProfile.model');db[_0x25b0('0xf2')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xf3'));db[_0x25b0('0xf4')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xf5'));db[_0x25b0('0xf6')]=db['sequelize'][_0x25b0('0x13')]('../api/userNotification/userNotification.model');db[_0x25b0('0xf7')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xf8'));db[_0x25b0('0xf9')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0xfa'));db[_0x25b0('0xfb')]=db[_0x25b0('0x1')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x25b0('0xfc')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xfd'));db['WhatsappQueueReport']=db['sequelize'][_0x25b0('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x25b0('0xfe')]=db[_0x25b0('0x1')][_0x25b0('0x13')](_0x25b0('0xff'));db[_0x25b0('0x100')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x101'));db[_0x25b0('0x102')]=db['sequelize'][_0x25b0('0x13')](_0x25b0('0x103'));db[_0x25b0('0x104')]=db['sequelize'][_0x25b0('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x25b0('0x1')][_0x25b0('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x25b0('0x105')]=db['sequelize'][_0x25b0('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['User'][_0x25b0('0x106')](db[_0x25b0('0x1e')],{'as':_0x25b0('0x1e'),'onDelete':_0x25b0('0x107'),'foreignKey':'UserId'});db[_0x25b0('0x108')]['hasMany'](db[_0x25b0('0x1c')],{'as':_0x25b0('0x109'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x2a')],{'as':_0x25b0('0x10c'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')]['hasMany'](db[_0x25b0('0x17')],{'as':_0x25b0('0x10d'),'onDelete':_0x25b0('0x107'),'hooks':!![]});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x73')],{'as':_0x25b0('0x10e'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')]['hasMany'](db['CmHopperHistory'],{'as':_0x25b0('0x10f'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x110')],{'as':_0x25b0('0x110'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x111')],{'as':_0x25b0('0x112'),'foreignKey':'UserId'});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x113')],{'as':'ChatInteractions','foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db['SmsInteraction'],{'as':_0x25b0('0x114'),'foreignKey':_0x25b0('0x10a')});db['User'][_0x25b0('0x10b')](db[_0x25b0('0x4d')],{'as':'FaxInteractions','foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0x40')],{'as':'MailInteractions','foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0xfb')],{'as':_0x25b0('0x115'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x108')][_0x25b0('0x10b')](db[_0x25b0('0xf6')],{'as':_0x25b0('0x116'),'foreignKey':'SenderId'});db['User'][_0x25b0('0x117')](db['UserProfile'],{'as':_0x25b0('0xf1'),'foreignKey':_0x25b0('0x118')});db[_0x25b0('0x108')][_0x25b0('0x119')](db['ChatGroup'],{'as':_0x25b0('0x11a'),'through':_0x25b0('0x11b')});db['User'][_0x25b0('0x119')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x11c'),'through':_0x25b0('0x11d')});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0xef')],{'as':_0x25b0('0x11e'),'through':_0x25b0('0x11f')});db['User'][_0x25b0('0x119')](db[_0x25b0('0xdc')],{'through':'user_has_teams'});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x40')],{'as':_0x25b0('0x120'),'through':_0x25b0('0x121')});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x113')],{'as':'ChatInteractions','through':_0x25b0('0x122')});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x4d')],{'as':'FaxInteractions','through':_0x25b0('0x123')});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x55')],{'as':_0x25b0('0x114'),'through':_0x25b0('0x124')});db[_0x25b0('0x108')][_0x25b0('0x119')](db['OpenchannelInteraction'],{'as':_0x25b0('0x112'),'through':'user_has_openchannel_interactions'});db[_0x25b0('0x108')][_0x25b0('0x119')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x25b0('0x125')});db['User'][_0x25b0('0x119')](db[_0x25b0('0x1a')],{'as':_0x25b0('0x126'),'through':_0x25b0('0x2c'),'required':![]});db['User'][_0x25b0('0x119')](db[_0x25b0('0x127')],{'as':_0x25b0('0x128'),'through':_0x25b0('0x105'),'required':![]});db[_0x25b0('0x108')]['belongsToMany'](db[_0x25b0('0x3d')],{'as':_0x25b0('0x129'),'through':_0x25b0('0x2e'),'required':![]});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x68')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x12a')],{'as':'FaxQueues','through':_0x25b0('0x12b'),'required':![]});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x59')],{'as':_0x25b0('0x12c'),'through':'UserSmsQueue','required':![]});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0x60')],{'as':'OpenchannelQueues','through':_0x25b0('0x33'),'required':![]});db[_0x25b0('0x108')][_0x25b0('0x119')](db['WhatsappQueue'],{'as':_0x25b0('0x12d'),'through':'UserWhatsappQueue','required':![]});db[_0x25b0('0x108')]['belongsToMany'](db[_0x25b0('0xef')],{'through':_0x25b0('0x11f')});db[_0x25b0('0x108')][_0x25b0('0x119')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x25b0('0x12e')});db[_0x25b0('0x108')][_0x25b0('0x119')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x25b0('0x12f')});db['User'][_0x25b0('0x119')](db['MailAccount'],{'as':_0x25b0('0x130'),'through':_0x25b0('0x131')});db['User'][_0x25b0('0x119')](db[_0x25b0('0x5b')],{'as':_0x25b0('0x132'),'through':'user_has_openchannel_accounts'});db['User'][_0x25b0('0x119')](db['SmsAccount'],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0x25b0('0x108')][_0x25b0('0x119')](db[_0x25b0('0xf7')],{'as':_0x25b0('0x133'),'through':_0x25b0('0x134')});db[_0x25b0('0x108')]['belongsToMany'](db['SquareProject'],{'as':_0x25b0('0x135'),'through':'user_has_square_projects'});db[_0x25b0('0x14')][_0x25b0('0x10b')](db[_0x25b0('0x17')],{'as':_0x25b0('0x136'),'onDelete':_0x25b0('0x107'),'foreignKey':'ChanSpyId'});db['VoiceContext'][_0x25b0('0x10b')](db[_0x25b0('0x17')],{'onDelete':_0x25b0('0x107')});db[_0x25b0('0x17')][_0x25b0('0x10b')](db[_0x25b0('0x17')],{'as':_0x25b0('0x137'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x18')]['belongsToMany'](db[_0x25b0('0x138')],{'as':'Sounds','through':_0x25b0('0x139')});db[_0x25b0('0x1a')][_0x25b0('0x10b')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x25b0('0x13a')});db[_0x25b0('0x1a')]['hasMany'](db['CmHopper'],{'as':_0x25b0('0x13b'),'foreignKey':'VoiceQueueId'});db[_0x25b0('0x1a')]['hasMany'](db['CmHopperFinal'],{'as':_0x25b0('0x10e'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x25b0('0x10b')](db[_0x25b0('0x75')],{'as':_0x25b0('0x13c'),'foreignKey':_0x25b0('0x13a')});db[_0x25b0('0x1a')][_0x25b0('0x10b')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x25b0('0x13a')});db[_0x25b0('0x1a')][_0x25b0('0x10b')](db[_0x25b0('0x71')],{'as':_0x25b0('0x13d'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x25b0('0x10b')](db[_0x25b0('0xcc')],{'as':_0x25b0('0x13e'),'foreignKey':_0x25b0('0x13a')});db[_0x25b0('0x1a')][_0x25b0('0x117')](db['Trunk'],{'as':_0x25b0('0x27'),'foreignKey':'TrunkId'});db[_0x25b0('0x1a')][_0x25b0('0x117')](db[_0x25b0('0x27')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0x25b0('0x117')](db[_0x25b0('0x13f')],{'as':'Interval','foreignKey':_0x25b0('0x140')});db['VoiceQueue'][_0x25b0('0x117')](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':_0x25b0('0x142')});db[_0x25b0('0x1a')][_0x25b0('0x119')](db[_0x25b0('0xef')],{'as':'Lists','through':_0x25b0('0x143')});db[_0x25b0('0x1a')]['belongsToMany'](db[_0x25b0('0x108')],{'as':'Agents','through':_0x25b0('0x2c')});db[_0x25b0('0x1a')][_0x25b0('0x119')](db[_0x25b0('0xdc')],{'as':'Teams','through':'TeamVoiceQueue'});db[_0x25b0('0x1a')][_0x25b0('0x119')](db['CmList'],{'as':_0x25b0('0x144'),'through':'voice_queues_has_cm_blacklists'});db[_0x25b0('0x1c')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x108'),'foreignKey':_0x25b0('0x10a')});db['ScreenRecording']['belongsTo'](db[_0x25b0('0x108')],{'as':_0x25b0('0x108'),'foreignKey':'UserId'});db[_0x25b0('0x1e')]['hasMany'](db['VoiceMailMessage'],{'as':_0x25b0('0x145'),'onDelete':_0x25b0('0x107'),'foreignKey':'mailboxuser','sourceKey':_0x25b0('0x146')});db[_0x25b0('0x147')][_0x25b0('0x117')](db[_0x25b0('0x1e')],{'foreignKey':'mailboxuser','targetKey':_0x25b0('0x146')});db['VoiceCallReport'][_0x25b0('0x10b')](db[_0x25b0('0x148')],{'as':_0x25b0('0x149'),'foreignKey':_0x25b0('0x14a'),'constraints':![]});db[_0x25b0('0x20')][_0x25b0('0x10b')](db[_0x25b0('0x23')],{'as':_0x25b0('0x14b'),'foreignKey':_0x25b0('0x14a'),'constraints':![]});db[_0x25b0('0x20')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x108'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x20')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db['MailServerIn'][_0x25b0('0x117')](db['MailAccount'],{'as':_0x25b0('0x3b'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0x25b0('0x117')](db[_0x25b0('0x3b')],{'as':'MailAccount','foreignKey':_0x25b0('0x14e')});db['MailAccount'][_0x25b0('0x106')](db[_0x25b0('0x37')],{'as':'Imap','onDelete':'cascade'});db[_0x25b0('0x3b')]['hasOne'](db[_0x25b0('0x39')],{'as':'Smtp','onDelete':_0x25b0('0x107')});db[_0x25b0('0x3b')]['hasMany'](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':_0x25b0('0x14e'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x3b')][_0x25b0('0x10b')](db[_0x25b0('0x7b')],{'as':_0x25b0('0x151'),'foreignKey':_0x25b0('0x14e')});db[_0x25b0('0x3b')][_0x25b0('0x10b')](db['MailMessage'],{'as':_0x25b0('0x145'),'foreignKey':'MailAccountId'});db[_0x25b0('0x3b')]['hasMany'](db['MailInteraction'],{'as':_0x25b0('0x152')});db[_0x25b0('0x3b')][_0x25b0('0x10b')](db[_0x25b0('0x43')],{'as':_0x25b0('0x137')});db[_0x25b0('0x3b')]['belongsTo'](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':'ListId'});db[_0x25b0('0x3b')][_0x25b0('0x117')](db[_0x25b0('0x8a')],{'as':'Template','foreignKey':_0x25b0('0x154')});db[_0x25b0('0x3b')]['belongsTo'](db[_0x25b0('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0x25b0('0x142')});db[_0x25b0('0x3b')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x131')});db[_0x25b0('0x3d')][_0x25b0('0x119')](db['User'],{'as':_0x25b0('0x155'),'through':'UserMailQueue'});db[_0x25b0('0x3d')][_0x25b0('0x119')](db['Team'],{'through':'team_has_mail_queues','as':_0x25b0('0x156')});db[_0x25b0('0x40')][_0x25b0('0x10b')](db[_0x25b0('0x41')],{'as':_0x25b0('0x145'),'onDelete':'cascade','foreignKey':_0x25b0('0x157')});db[_0x25b0('0x40')]['belongsTo'](db[_0x25b0('0x3b')],{'as':'Account','foreignKey':_0x25b0('0x14e')});db[_0x25b0('0x40')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x40')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x40')][_0x25b0('0x119')](db['Tag'],{'through':_0x25b0('0x159'),'as':'Tags'});db[_0x25b0('0x40')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x159'),'as':'ThroughTags'});db[_0x25b0('0x40')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x15a'),'through':_0x25b0('0x121'),'foreignKey':'MailInteractionId'});db[_0x25b0('0x41')][_0x25b0('0x10b')](db[_0x25b0('0xe3')],{'as':'Attachments','onDelete':_0x25b0('0x107')});db[_0x25b0('0x41')][_0x25b0('0x117')](db['User'],{'as':_0x25b0('0x108')});db['MailMessage'][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x14c')});db[_0x25b0('0x41')][_0x25b0('0x117')](db[_0x25b0('0x40')],{'as':'Interaction','foreignKey':_0x25b0('0x157')});db[_0x25b0('0x41')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{'as':'Account','foreignKey':_0x25b0('0x14e')});db[_0x25b0('0x41')][_0x25b0('0x117')](db['ChatWebsite'],{'as':_0x25b0('0x62'),'foreignKey':_0x25b0('0x15b')});db[_0x25b0('0x41')]['belongsTo'](db[_0x25b0('0x15c')],{'as':'ChatOfflineMessage','foreignKey':_0x25b0('0x15d')});db[_0x25b0('0x43')]['belongsTo'](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x43')][_0x25b0('0x117')](db[_0x25b0('0x3d')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x43')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x43')][_0x25b0('0x117')](db[_0x25b0('0x13f')],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x140')});db[_0x25b0('0x43')][_0x25b0('0x117')](db[_0x25b0('0x88')],{'onDelete':'restrict','foreignKey':_0x25b0('0x15f')});db[_0x25b0('0x44')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{});db[_0x25b0('0x44')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0x44')]['belongsTo'](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db['MailQueueReport'][_0x25b0('0x117')](db[_0x25b0('0x40')],{});db[_0x25b0('0x44')][_0x25b0('0x117')](db[_0x25b0('0x41')],{});db['MailQueueReport'][_0x25b0('0x117')](db['User'],{});db['MailQueueReport'][_0x25b0('0x117')](db['MailQueue'],{});db[_0x25b0('0x46')]['hasMany'](db[_0x25b0('0x48')],{'as':'Items','onDelete':_0x25b0('0x107')});db[_0x25b0('0x4a')][_0x25b0('0x10b')](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':_0x25b0('0x161'),'onDelete':'cascade'});db['FaxAccount'][_0x25b0('0x10b')](db[_0x25b0('0x7b')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0x25b0('0x4a')][_0x25b0('0x10b')](db[_0x25b0('0x4d')],{'as':_0x25b0('0x152')});db['FaxAccount'][_0x25b0('0x10b')](db[_0x25b0('0x4c')],{'as':_0x25b0('0x137')});db['FaxAccount'][_0x25b0('0x10b')](db[_0x25b0('0x17')],{'as':_0x25b0('0x162'),'onDelete':_0x25b0('0x107')});db['FaxAccount']['hasMany'](db[_0x25b0('0x163')],{'as':_0x25b0('0x145')});db['FaxAccount']['belongsTo'](db[_0x25b0('0x27')],{'as':'Trunk'});db['FaxAccount'][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':'List','foreignKey':_0x25b0('0x160')});db[_0x25b0('0x4a')][_0x25b0('0x117')](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':_0x25b0('0x142')});db[_0x25b0('0x4a')]['belongsToMany'](db['User'],{'as':_0x25b0('0x155'),'through':_0x25b0('0x12f')});db[_0x25b0('0x4c')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x15e')});db['FaxApplication'][_0x25b0('0x117')](db[_0x25b0('0x12a')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x4c')][_0x25b0('0x117')](db[_0x25b0('0x4a')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x4c')][_0x25b0('0x117')](db[_0x25b0('0x88')],{'onDelete':'restrict','foreignKey':_0x25b0('0x15f')});db['FaxInteraction'][_0x25b0('0x10b')](db[_0x25b0('0x163')],{'as':_0x25b0('0x145'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x164')});db[_0x25b0('0x4d')][_0x25b0('0x117')](db[_0x25b0('0x4a')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x161')});db[_0x25b0('0x4d')]['belongsTo'](db['CmContact'],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db['FaxInteraction'][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x10a')});db['FaxInteraction'][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x166'),'as':'Tags'});db[_0x25b0('0x4d')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x166'),'as':_0x25b0('0x167')});db['FaxInteraction'][_0x25b0('0x119')](db['User'],{'as':'Users','through':_0x25b0('0x123'),'foreignKey':_0x25b0('0x164')});db[_0x25b0('0x163')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':'cascade','as':_0x25b0('0x108')});db[_0x25b0('0x163')][_0x25b0('0x117')](db[_0x25b0('0x4d')],{'as':_0x25b0('0x168'),'foreignKey':_0x25b0('0x164')});db[_0x25b0('0x163')]['belongsTo'](db[_0x25b0('0x6d')],{'onDelete':_0x25b0('0x107'),'as':'Contact'});db[_0x25b0('0x163')][_0x25b0('0x117')](db[_0x25b0('0xe3')],{'as':_0x25b0('0xe3'),'foreignKey':_0x25b0('0x169')});db['FaxMessage']['belongsTo'](db[_0x25b0('0x4a')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x161')});db[_0x25b0('0x12a')]['belongsToMany'](db['User'],{'as':_0x25b0('0x155'),'through':_0x25b0('0x12b')});db[_0x25b0('0x12a')][_0x25b0('0x119')](db['Team'],{'through':_0x25b0('0x16a'),'as':_0x25b0('0x156')});db[_0x25b0('0x51')][_0x25b0('0x117')](db['FaxAccount'],{});db[_0x25b0('0x51')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0x51')][_0x25b0('0x117')](db['CmContact'],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db['FaxQueueReport']['belongsTo'](db['FaxInteraction'],{});db[_0x25b0('0x51')][_0x25b0('0x117')](db[_0x25b0('0x163')],{});db['FaxQueueReport'][_0x25b0('0x117')](db['User'],{});db['FaxQueueReport']['belongsTo'](db[_0x25b0('0x12a')],{});db[_0x25b0('0x16b')][_0x25b0('0x10b')](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':_0x25b0('0x16c'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x16b')]['hasMany'](db[_0x25b0('0x7b')],{'as':_0x25b0('0x151'),'foreignKey':_0x25b0('0x16c')});db[_0x25b0('0x16b')][_0x25b0('0x10b')](db[_0x25b0('0x57')],{'as':_0x25b0('0x145'),'foreignKey':_0x25b0('0x16c')});db[_0x25b0('0x16b')][_0x25b0('0x10b')](db[_0x25b0('0x55')],{'as':_0x25b0('0x152')});db[_0x25b0('0x16b')][_0x25b0('0x10b')](db[_0x25b0('0x16d')],{'as':_0x25b0('0x137')});db[_0x25b0('0x16b')]['belongsTo'](db[_0x25b0('0xef')],{'as':'List','foreignKey':_0x25b0('0x160')});db[_0x25b0('0x16b')][_0x25b0('0x117')](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x25b0('0x16b')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x16e')});db[_0x25b0('0x16d')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x16d')][_0x25b0('0x117')](db['SmsQueue'],{'onDelete':'restrict'});db['SmsApplication'][_0x25b0('0x117')](db[_0x25b0('0x16b')],{'onDelete':_0x25b0('0x15e')});db['SmsApplication'][_0x25b0('0x117')](db['Interval'],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x140')});db['SmsApplication']['belongsTo'](db[_0x25b0('0x88')],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x15f')});db[_0x25b0('0x55')][_0x25b0('0x10b')](db['SmsMessage'],{'as':'Messages','onDelete':_0x25b0('0x107'),'foreignKey':'SmsInteractionId'});db[_0x25b0('0x55')][_0x25b0('0x117')](db[_0x25b0('0x16b')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x16c')});db['SmsInteraction'][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':'Contact','foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x55')][_0x25b0('0x117')](db['User'],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x55')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x16f'),'as':_0x25b0('0x170')});db[_0x25b0('0x55')][_0x25b0('0x119')](db['Tag'],{'through':_0x25b0('0x16f'),'as':_0x25b0('0x167')});db[_0x25b0('0x55')]['belongsToMany'](db[_0x25b0('0x108')],{'as':'Users','through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0x25b0('0x57')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x108')});db[_0x25b0('0x57')][_0x25b0('0x117')](db['CmContact'],{'onDelete':_0x25b0('0x107'),'as':'Contact'});db[_0x25b0('0x57')]['belongsTo'](db[_0x25b0('0x55')],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x168'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x25b0('0x117')](db[_0x25b0('0x16b')],{'as':_0x25b0('0x165'),'foreignKey':'SmsAccountId'});db[_0x25b0('0x59')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x31'),'foreignKey':_0x25b0('0x171')});db[_0x25b0('0x59')][_0x25b0('0x119')](db[_0x25b0('0xdc')],{'through':_0x25b0('0x172'),'as':'Teams'});db[_0x25b0('0x5b')]['hasMany'](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':_0x25b0('0x173'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x5b')][_0x25b0('0x10b')](db[_0x25b0('0x7b')],{'as':_0x25b0('0x151'),'foreignKey':'OpenchannelAccountId'});db[_0x25b0('0x5b')][_0x25b0('0x10b')](db[_0x25b0('0x111')],{'as':_0x25b0('0x152'),'foreignKey':_0x25b0('0x173')});db[_0x25b0('0x5b')][_0x25b0('0x10b')](db[_0x25b0('0x5e')],{'as':_0x25b0('0x145'),'foreignKey':_0x25b0('0x173')});db[_0x25b0('0x5b')][_0x25b0('0x10b')](db[_0x25b0('0x5c')],{'as':_0x25b0('0x137'),'foreignKey':_0x25b0('0x173')});db[_0x25b0('0x5b')]['belongsTo'](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0x5b')][_0x25b0('0x117')](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':_0x25b0('0x142')});db[_0x25b0('0x5b')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x25b0('0x5c')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x5c')]['belongsTo'](db[_0x25b0('0x60')],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x174')});db[_0x25b0('0x5c')][_0x25b0('0x117')](db[_0x25b0('0x5b')],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x173')});db[_0x25b0('0x5c')][_0x25b0('0x117')](db[_0x25b0('0x13f')],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x140')});db[_0x25b0('0x5c')][_0x25b0('0x117')](db[_0x25b0('0x88')],{'onDelete':_0x25b0('0x15e'),'foreignKey':'TagId'});db[_0x25b0('0x111')][_0x25b0('0x10b')](db[_0x25b0('0x5e')],{'as':_0x25b0('0x145'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x175')});db[_0x25b0('0x111')]['belongsTo'](db[_0x25b0('0x5b')],{'as':_0x25b0('0x165'),'foreignKey':'OpenchannelAccountId'});db[_0x25b0('0x111')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':'Contact','foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x111')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x10a')});db['OpenchannelInteraction'][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x25b0('0x111')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x176'),'as':_0x25b0('0x167')});db[_0x25b0('0x111')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':'Users','through':_0x25b0('0x177'),'foreignKey':_0x25b0('0x175')});db['OpenchannelMessage'][_0x25b0('0x117')](db['User'],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x108')});db[_0x25b0('0x5e')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'onDelete':_0x25b0('0x107'),'as':'Contact'});db['OpenchannelMessage'][_0x25b0('0x117')](db['OpenchannelInteraction'],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x168'),'foreignKey':_0x25b0('0x175')});db[_0x25b0('0x5e')][_0x25b0('0x117')](db[_0x25b0('0xe3')],{'as':'Attachment','foreignKey':_0x25b0('0x169')});db[_0x25b0('0x5e')]['belongsTo'](db[_0x25b0('0x5b')],{'as':'Account','foreignKey':_0x25b0('0x173')});db[_0x25b0('0x60')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':'UserOpenchannelQueue','foreignKey':_0x25b0('0x174')});db[_0x25b0('0x60')]['belongsToMany'](db[_0x25b0('0xdc')],{'through':_0x25b0('0x178'),'as':_0x25b0('0x156')});db['ChatWebsite']['hasMany'](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':'ChatWebsiteId','onDelete':_0x25b0('0x107')});db[_0x25b0('0x62')][_0x25b0('0x10b')](db[_0x25b0('0x7b')],{'as':_0x25b0('0x151'),'foreignKey':'ChatWebsiteId'});db[_0x25b0('0x62')]['hasMany'](db['ChatProactiveAction'],{'as':_0x25b0('0x179')});db['ChatWebsite'][_0x25b0('0x10b')](db['ChatInteraction'],{'as':_0x25b0('0x152')});db[_0x25b0('0x62')]['hasMany'](db[_0x25b0('0x64')],{'as':_0x25b0('0x137')});db['ChatWebsite'][_0x25b0('0x10b')](db[_0x25b0('0x17a')],{'as':_0x25b0('0x145')});db[_0x25b0('0x62')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0x62')]['belongsTo'](db[_0x25b0('0x13f')],{'as':_0x25b0('0x13f'),'foreignKey':'IntervalId'});db[_0x25b0('0x62')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{'as':_0x25b0('0x3b'),'foreignKey':'MailAccountId'});db[_0x25b0('0x62')]['belongsTo'](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':_0x25b0('0x142')});db[_0x25b0('0x62')]['belongsToMany'](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x12e')});db[_0x25b0('0x17b')][_0x25b0('0x117')](db[_0x25b0('0x5b')],{});db[_0x25b0('0x17b')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':'List','foreignKey':_0x25b0('0x160')});db['OpenchannelQueueReport'][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db['OpenchannelQueueReport']['belongsTo'](db[_0x25b0('0x111')],{});db[_0x25b0('0x17b')][_0x25b0('0x117')](db[_0x25b0('0x5e')],{});db['OpenchannelQueueReport'][_0x25b0('0x117')](db['User'],{});db[_0x25b0('0x17b')][_0x25b0('0x117')](db[_0x25b0('0x60')],{});db[_0x25b0('0x64')]['belongsTo'](db['User'],{'as':_0x25b0('0x17c'),'foreignKey':_0x25b0('0x10a'),'onDelete':'restrict'});db[_0x25b0('0x64')][_0x25b0('0x117')](db[_0x25b0('0x68')],{'as':_0x25b0('0x17d'),'foreignKey':_0x25b0('0x17e'),'onDelete':'restrict'});db[_0x25b0('0x64')][_0x25b0('0x117')](db[_0x25b0('0x62')],{'as':_0x25b0('0x17f'),'foreignKey':'ChatWebsiteId','onDelete':_0x25b0('0x15e')});db[_0x25b0('0x64')][_0x25b0('0x117')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x25b0('0x15f')});db[_0x25b0('0x113')][_0x25b0('0x10b')](db[_0x25b0('0x17a')],{'as':'Messages','onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x180')});db['ChatInteraction'][_0x25b0('0x117')](db[_0x25b0('0x62')],{'as':'Account','foreignKey':_0x25b0('0x15b')});db[_0x25b0('0x113')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':'ContactId'});db[_0x25b0('0x113')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x113')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x181'),'as':_0x25b0('0x170')});db[_0x25b0('0x113')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x181'),'as':_0x25b0('0x167')});db['ChatInteraction'][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x15a'),'through':_0x25b0('0x122'),'foreignKey':_0x25b0('0x180')});db[_0x25b0('0x17a')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x108')});db[_0x25b0('0x17a')][_0x25b0('0x117')](db['CmContact'],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x17a')][_0x25b0('0x117')](db[_0x25b0('0x113')],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x168'),'foreignKey':_0x25b0('0x180')});db[_0x25b0('0x17a')][_0x25b0('0x117')](db['Attachment'],{'as':_0x25b0('0xe3'),'foreignKey':'AttachmentId'});db[_0x25b0('0x17a')]['belongsTo'](db[_0x25b0('0x62')],{'as':_0x25b0('0x165'),'foreignKey':'ChatWebsiteId'});db[_0x25b0('0x15c')]['hasMany'](db[_0x25b0('0xe3')],{'as':'Attachments','foreignKey':_0x25b0('0x15d'),'onDelete':_0x25b0('0x107'),'hooks':!![]});db[_0x25b0('0x15c')][_0x25b0('0x117')](db['CmContact'],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x14c'),'foreignKey':'ContactId'});db[_0x25b0('0x15c')][_0x25b0('0x117')](db['ChatWebsite'],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x15b')});db[_0x25b0('0x68')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x182'),'hooks':!![]});db['ChatQueue'][_0x25b0('0x119')](db[_0x25b0('0xdc')],{'through':'team_has_chat_queues','as':_0x25b0('0x156')});db[_0x25b0('0x6a')][_0x25b0('0x10b')](db[_0x25b0('0x183')],{'as':_0x25b0('0x145'),'foreignKey':_0x25b0('0x184'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x6a')]['belongsToMany'](db[_0x25b0('0x108')],{'as':_0x25b0('0x185'),'through':_0x25b0('0x11b')});db[_0x25b0('0x186')][_0x25b0('0x117')](db[_0x25b0('0x62')],{'as':_0x25b0('0x17f'),'foreignKey':'ChatWebsiteId'});db[_0x25b0('0x6b')]['hasMany'](db[_0x25b0('0x6d')],{'as':'Contacts','foreignKey':_0x25b0('0x187')});db['CmContact'][_0x25b0('0x10b')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x6d')]['hasMany'](db[_0x25b0('0x73')],{'as':_0x25b0('0x10e'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db['CmHopperHistory'],{'as':_0x25b0('0x13c'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db[_0x25b0('0x110')],{'as':_0x25b0('0x110'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db[_0x25b0('0xcc')],{'as':_0x25b0('0x13e'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x25b0('0x15e')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x25b0('0x14d'),'onDelete':'restrict'});db['CmContact'][_0x25b0('0x10b')](db[_0x25b0('0x55')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x25b0('0x15e')});db[_0x25b0('0x6d')][_0x25b0('0x10b')](db[_0x25b0('0x4d')],{'as':_0x25b0('0x188'),'foreignKey':_0x25b0('0x14d'),'onDelete':_0x25b0('0x15e')});db[_0x25b0('0x6d')]['hasMany'](db[_0x25b0('0x40')],{'as':_0x25b0('0x120'),'foreignKey':_0x25b0('0x14d'),'onDelete':_0x25b0('0x15e')});db['CmContact'][_0x25b0('0x117')](db[_0x25b0('0x6b')],{'as':_0x25b0('0x189'),'foreignKey':_0x25b0('0x187')});db['CmContact'][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160'),'onDelete':'cascade'});db[_0x25b0('0x6d')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x25b0('0x6d')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'as':_0x25b0('0x170'),'through':_0x25b0('0x18a')});db['CmContact'][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x18a'),'as':_0x25b0('0x167')});db[_0x25b0('0x6f')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':'Contact','foreignKey':_0x25b0('0x14d'),'onDelete':'cascade'});db[_0x25b0('0x6f')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':'List','foreignKey':'ListId','onDelete':_0x25b0('0x107')});db[_0x25b0('0x6f')][_0x25b0('0x117')](db['User'],{'as':'Agent','foreignKey':_0x25b0('0x10a')});db[_0x25b0('0x6f')][_0x25b0('0x117')](db[_0x25b0('0x1a')],{'as':_0x25b0('0x17d'),'foreignKey':'VoiceQueueId','onDelete':_0x25b0('0x107')});db['CmHopper'][_0x25b0('0x117')](db[_0x25b0('0x18b')],{'as':_0x25b0('0x18b'),'foreignKey':_0x25b0('0x18c'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x6f')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x158'),'foreignKey':_0x25b0('0x18d')});db[_0x25b0('0x71')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d'),'onDelete':_0x25b0('0x107')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x25b0('0x160'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x71')]['belongsTo'](db[_0x25b0('0x1a')],{'as':_0x25b0('0x17d'),'foreignKey':'VoiceQueueId','onDelete':_0x25b0('0x107')});db[_0x25b0('0x71')][_0x25b0('0x117')](db['Campaign'],{'as':_0x25b0('0x18b'),'foreignKey':_0x25b0('0x18c'),'onDelete':_0x25b0('0x107')});db['Automation']['hasMany'](db[_0x25b0('0x18e')],{'as':{'plural':_0x25b0('0x18f'),'singular':_0x25b0('0x190')},'foreignKey':_0x25b0('0x191'),'onDelete':_0x25b0('0x107'),'hooks':!![]});db[_0x25b0('0x192')]['hasMany'](db['Condition'],{'as':{'plural':'Any','singular':_0x25b0('0x193')},'foreignKey':_0x25b0('0x194'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x25b0('0x10b')](db[_0x25b0('0x195')],{'as':'Actions','foreignKey':_0x25b0('0x196'),'onDelete':'cascade','hooks':!![]});db[_0x25b0('0x14f')][_0x25b0('0x10b')](db['Disposition'],{'as':_0x25b0('0x150'),'foreignKey':_0x25b0('0x197'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x13f')][_0x25b0('0x10b')](db['Interval'],{'as':'Intervals','foreignKey':_0x25b0('0x140'),'onDelete':_0x25b0('0x107'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x25b0('0x17')],{'as':_0x25b0('0x10d'),'foreignKey':'IntervalId','onDelete':_0x25b0('0x15e')});db['Interval']['hasMany'](db['MailApplication'],{'as':_0x25b0('0x198'),'foreignKey':_0x25b0('0x140')});db['Interval'][_0x25b0('0x10b')](db[_0x25b0('0x64')],{'as':_0x25b0('0x199'),'foreignKey':_0x25b0('0x140')});db[_0x25b0('0x13f')][_0x25b0('0x10b')](db[_0x25b0('0x4c')],{'as':_0x25b0('0x19a'),'foreignKey':_0x25b0('0x140')});db[_0x25b0('0x13f')][_0x25b0('0x10b')](db[_0x25b0('0x16d')],{'as':'SmsApplications','foreignKey':_0x25b0('0x140')});db[_0x25b0('0x85')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{});db[_0x25b0('0x85')]['belongsTo'](db[_0x25b0('0x91')],{'foreignKey':_0x25b0('0x19b')});db['Schedule'][_0x25b0('0x117')](db[_0x25b0('0x19c')],{'foreignKey':_0x25b0('0x19d')});db[_0x25b0('0x138')][_0x25b0('0x119')](db[_0x25b0('0x18')],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db[_0x25b0('0x88')][_0x25b0('0x119')](db[_0x25b0('0x6d')],{'through':_0x25b0('0x18a')});db[_0x25b0('0x88')][_0x25b0('0x119')](db[_0x25b0('0x113')],{'through':_0x25b0('0x181')});db[_0x25b0('0x88')]['belongsToMany'](db[_0x25b0('0x40')],{'through':'mail_interaction_has_tags'});db[_0x25b0('0x88')][_0x25b0('0x119')](db[_0x25b0('0x55')],{'through':_0x25b0('0x16f')});db[_0x25b0('0x88')][_0x25b0('0x119')](db[_0x25b0('0x4d')],{'through':_0x25b0('0x166')});db[_0x25b0('0x88')][_0x25b0('0x119')](db[_0x25b0('0x111')],{'through':_0x25b0('0x176')});db['Tag']['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x25b0('0x19e')][_0x25b0('0x10b')](db[_0x25b0('0x18e')],{'as':{'plural':_0x25b0('0x19f'),'singular':_0x25b0('0x1a0')},'foreignKey':_0x25b0('0x1a1'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x25b0('0x10b')](db['Condition'],{'as':{'plural':_0x25b0('0x1a2'),'singular':_0x25b0('0x1a3')},'foreignKey':_0x25b0('0x1a4'),'onDelete':_0x25b0('0x107'),'hooks':!![]});db[_0x25b0('0x19e')][_0x25b0('0x10b')](db[_0x25b0('0x195')],{'as':_0x25b0('0x1a5'),'foreignKey':_0x25b0('0x1a6'),'onDelete':_0x25b0('0x107'),'hooks':!![]});db[_0x25b0('0x19c')][_0x25b0('0x10b')](db[_0x25b0('0x96')],{'as':'Fields','onDelete':_0x25b0('0x107'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x25b0('0x91')][_0x25b0('0x10b')](db[_0x25b0('0x96')],{'as':_0x25b0('0x1a7'),'onDelete':'cascade','foreignKey':_0x25b0('0x19b')});db[_0x25b0('0x95')][_0x25b0('0x10b')](db['AnalyticFieldReport'],{'as':_0x25b0('0x1a7'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1a8')});db['AnalyticFieldReport']['belongsTo'](db[_0x25b0('0x95')],{'foreignKey':_0x25b0('0x1a8')});db[_0x25b0('0x98')][_0x25b0('0x10b')](db[_0x25b0('0x99')],{'as':_0x25b0('0x1a9'),'onDelete':'cascade','foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0x99')][_0x25b0('0x10b')](db['SalesforceField'],{'as':_0x25b0('0x1ab'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0x99')][_0x25b0('0x10b')](db[_0x25b0('0x9b')],{'as':_0x25b0('0x1ad'),'onDelete':_0x25b0('0x107'),'foreignKey':'DescriptionId'});db[_0x25b0('0x99')][_0x25b0('0x10b')](db[_0x25b0('0x9b')],{'as':_0x25b0('0x1a7'),'onDelete':_0x25b0('0x107'),'foreignKey':'FieldId'});db[_0x25b0('0x99')][_0x25b0('0x117')](db[_0x25b0('0x98')],{'as':_0x25b0('0x165'),'foreignKey':'AccountId'});db[_0x25b0('0x9b')][_0x25b0('0x10b')](db[_0x25b0('0x9b')],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db['SalesforceField'][_0x25b0('0x10b')](db[_0x25b0('0x9b')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0x9b')][_0x25b0('0x10b')](db[_0x25b0('0x9b')],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0x9b')][_0x25b0('0x117')](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0x25b0('0x10b')](db[_0x25b0('0x9f')],{'as':_0x25b0('0x1a9'),'onDelete':'cascade','foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0x9f')]['hasMany'](db[_0x25b0('0xa0')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x25b0('0x1ac')});db['SugarcrmConfiguration'][_0x25b0('0x10b')](db['SugarcrmField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x25b0('0x1b0')});db['SugarcrmConfiguration'][_0x25b0('0x10b')](db[_0x25b0('0xa0')],{'as':_0x25b0('0x1a7'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x25b0('0x9f')][_0x25b0('0x117')](db['SugarcrmAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x25b0('0xa0')][_0x25b0('0x10b')](db[_0x25b0('0xa0')],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db['SugarcrmField'][_0x25b0('0x10b')](db[_0x25b0('0xa0')],{'as':_0x25b0('0x1af'),'foreignKey':'DescriptionId'});db[_0x25b0('0xa0')]['hasMany'](db[_0x25b0('0xa0')],{'as':_0x25b0('0x1b1'),'foreignKey':'FieldId'});db[_0x25b0('0xa0')][_0x25b0('0x117')](db['Variable'],{'as':'Variable','foreignKey':_0x25b0('0x1b3')});db[_0x25b0('0xa2')][_0x25b0('0x10b')](db['DeskConfiguration'],{'as':_0x25b0('0x1a9'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xa4')][_0x25b0('0x10b')](db['DeskField'],{'as':_0x25b0('0x1ab'),'onDelete':_0x25b0('0x107'),'foreignKey':'SubjectId'});db[_0x25b0('0xa4')][_0x25b0('0x10b')](db[_0x25b0('0xa6')],{'as':_0x25b0('0x1ad'),'onDelete':'cascade','foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0xa4')][_0x25b0('0x10b')](db[_0x25b0('0xa6')],{'as':_0x25b0('0x1a7'),'onDelete':'cascade','foreignKey':_0x25b0('0x1b2')});db['DeskConfiguration'][_0x25b0('0x117')](db['DeskAccount'],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xa4')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x1b4')});db[_0x25b0('0xa6')][_0x25b0('0x10b')](db['DeskField'],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db['DeskField']['hasMany'](db[_0x25b0('0xa6')],{'as':_0x25b0('0x1af'),'foreignKey':'DescriptionId'});db[_0x25b0('0xa6')]['hasMany'](db[_0x25b0('0xa6')],{'as':_0x25b0('0x1b1'),'foreignKey':'FieldId'});db[_0x25b0('0xa6')]['belongsTo'](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':_0x25b0('0x1b3')});db['ZohoAccount'][_0x25b0('0x10b')](db[_0x25b0('0xa8')],{'as':'Configurations','onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1aa')});db['ZohoConfiguration'][_0x25b0('0x10b')](db[_0x25b0('0x1b5')],{'as':_0x25b0('0x1ab'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0xa8')]['hasMany'](db[_0x25b0('0x1b5')],{'as':_0x25b0('0x1ad'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x25b0('0xa8')][_0x25b0('0x10b')](db[_0x25b0('0x1b5')],{'as':_0x25b0('0x1a7'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1b2')});db['ZohoConfiguration'][_0x25b0('0x117')](db['ZohoAccount'],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0x1b5')]['hasMany'](db[_0x25b0('0x1b5')],{'as':'Subject','foreignKey':_0x25b0('0x1ac')});db['ZohoField'][_0x25b0('0x10b')](db[_0x25b0('0x1b5')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0x1b5')][_0x25b0('0x10b')](db[_0x25b0('0x1b5')],{'as':_0x25b0('0x1b1'),'foreignKey':'FieldId'});db['ZohoField']['belongsTo'](db['Variable'],{'as':_0x25b0('0x8c'),'foreignKey':'VariableId'});db[_0x25b0('0xaa')]['hasMany'](db[_0x25b0('0xac')],{'as':_0x25b0('0x1a9'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xac')][_0x25b0('0x10b')](db[_0x25b0('0x1b6')],{'as':_0x25b0('0x1ab'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0xac')][_0x25b0('0x10b')](db[_0x25b0('0x1b6')],{'as':'Descriptions','foreignKey':_0x25b0('0x1b0')});db['ZendeskConfiguration']['hasMany'](db[_0x25b0('0x1b6')],{'as':'Fields','foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0xac')][_0x25b0('0x117')](db['ZendeskAccount'],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1aa')});db['ZendeskConfiguration']['belongsToMany'](db[_0x25b0('0x88')],{'through':'int_zendesk_configuration_has_tags'});db[_0x25b0('0x1b6')]['hasMany'](db[_0x25b0('0x1b6')],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0x1b6')][_0x25b0('0x10b')](db[_0x25b0('0x1b6')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0x1b6')][_0x25b0('0x10b')](db[_0x25b0('0x1b6')],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0x1b6')][_0x25b0('0x117')](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x25b0('0x10b')](db[_0x25b0('0xb0')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xb0')][_0x25b0('0x10b')](db[_0x25b0('0x1b7')],{'as':_0x25b0('0x1ab'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1ac')});db['FreshdeskConfiguration'][_0x25b0('0x10b')](db['FreshdeskField'],{'as':_0x25b0('0x1ad'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1b0')});db['FreshdeskConfiguration']['hasMany'](db[_0x25b0('0x1b7')],{'as':'Fields','onDelete':_0x25b0('0x107'),'foreignKey':'FieldId'});db[_0x25b0('0xb0')][_0x25b0('0x117')](db[_0x25b0('0xaf')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1aa')});db['FreshdeskConfiguration'][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x25b0('0x1b7')][_0x25b0('0x10b')](db['FreshdeskField'],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0x1b7')]['hasMany'](db['FreshdeskField'],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0x1b7')][_0x25b0('0x10b')](db['FreshdeskField'],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0x1b7')]['belongsTo'](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':_0x25b0('0x1b3')});db[_0x25b0('0xb2')][_0x25b0('0x10b')](db['VtigerConfiguration'],{'as':_0x25b0('0x1a9'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x25b0('0xb4')][_0x25b0('0x10b')](db['VtigerField'],{'as':_0x25b0('0x1ab'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0xb4')][_0x25b0('0x10b')](db[_0x25b0('0xb6')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x25b0('0xb4')][_0x25b0('0x10b')](db[_0x25b0('0xb6')],{'as':_0x25b0('0x1a7'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0xb4')][_0x25b0('0x117')](db[_0x25b0('0xb2')],{'as':'Account','foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xb6')][_0x25b0('0x10b')](db['VtigerField'],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db['VtigerField'][_0x25b0('0x10b')](db[_0x25b0('0xb6')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db['VtigerField']['hasMany'](db[_0x25b0('0xb6')],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0xb6')]['belongsTo'](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':_0x25b0('0x1b3')});db['ServicenowAccount'][_0x25b0('0x10b')](db[_0x25b0('0xba')],{'as':'Configurations','onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1aa')});db['ServicenowConfiguration'][_0x25b0('0x10b')](db[_0x25b0('0x1b8')],{'as':_0x25b0('0x1ab'),'foreignKey':'SubjectId'});db[_0x25b0('0xba')][_0x25b0('0x10b')](db[_0x25b0('0x1b8')],{'as':'Descriptions','foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0xba')][_0x25b0('0x10b')](db[_0x25b0('0x1b8')],{'as':_0x25b0('0x1a7'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0xba')]['belongsTo'](db['ServicenowAccount'],{'as':_0x25b0('0x165'),'foreignKey':'AccountId'});db['ServicenowField'][_0x25b0('0x10b')](db['ServicenowField'],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db['ServicenowField']['hasMany'](db[_0x25b0('0x1b8')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0x1b8')]['hasMany'](db[_0x25b0('0x1b8')],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0x1b8')][_0x25b0('0x117')](db[_0x25b0('0x8c')],{'as':'Variable','foreignKey':'VariableId'});db[_0x25b0('0xbc')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0x1b9')]['hasMany'](db[_0x25b0('0xbe')],{'as':_0x25b0('0x1ab'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0x1b9')][_0x25b0('0x10b')](db[_0x25b0('0xbe')],{'as':'Descriptions','onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1b0')});db['Dynamics365Configuration'][_0x25b0('0x10b')](db['Dynamics365Field'],{'as':_0x25b0('0x1a7'),'onDelete':_0x25b0('0x107'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0x1b9')][_0x25b0('0x117')](db[_0x25b0('0xbc')],{'as':_0x25b0('0x165'),'foreignKey':'AccountId'});db[_0x25b0('0xbe')][_0x25b0('0x10b')](db[_0x25b0('0xbe')],{'as':_0x25b0('0x1ae'),'foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0xbe')][_0x25b0('0x10b')](db[_0x25b0('0xbe')],{'as':_0x25b0('0x1af'),'foreignKey':_0x25b0('0x1b0')});db['Dynamics365Field'][_0x25b0('0x10b')](db[_0x25b0('0xbe')],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db[_0x25b0('0xbe')][_0x25b0('0x117')](db[_0x25b0('0x8c')],{'as':'Variable','foreignKey':_0x25b0('0x1b3')});db[_0x25b0('0x1ba')][_0x25b0('0x10b')](db[_0x25b0('0xc1')],{'as':_0x25b0('0x1a9'),'onDelete':'cascade','foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xc1')][_0x25b0('0x10b')](db[_0x25b0('0xc3')],{'as':'Subjects','foreignKey':_0x25b0('0x1ac')});db[_0x25b0('0xc1')]['hasMany'](db[_0x25b0('0xc3')],{'as':_0x25b0('0x1ad'),'foreignKey':_0x25b0('0x1b0')});db[_0x25b0('0xc1')]['hasMany'](db[_0x25b0('0xc3')],{'as':'Fields','foreignKey':_0x25b0('0x1b2')});db['FreshsalesConfiguration'][_0x25b0('0x117')](db[_0x25b0('0x1ba')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1aa')});db[_0x25b0('0xc3')][_0x25b0('0x10b')](db[_0x25b0('0xc3')],{'as':_0x25b0('0x1ae'),'foreignKey':'SubjectId'});db[_0x25b0('0xc3')][_0x25b0('0x10b')](db[_0x25b0('0xc3')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x25b0('0xc3')][_0x25b0('0x10b')](db['FreshsalesField'],{'as':_0x25b0('0x1b1'),'foreignKey':_0x25b0('0x1b2')});db['FreshsalesField'][_0x25b0('0x117')](db[_0x25b0('0x8c')],{'as':_0x25b0('0x8c'),'foreignKey':_0x25b0('0x1b3')});db[_0x25b0('0xc7')]['belongsTo'](db['ChatWebsite'],{});db[_0x25b0('0xc7')]['belongsTo'](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0xc7')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x14c'),'foreignKey':'ContactId'});db['ChatQueueReport'][_0x25b0('0x117')](db[_0x25b0('0x113')],{});db[_0x25b0('0xc7')]['belongsTo'](db[_0x25b0('0x17a')],{});db[_0x25b0('0xc7')]['belongsTo'](db[_0x25b0('0x108')],{});db[_0x25b0('0xc7')][_0x25b0('0x117')](db[_0x25b0('0x68')],{});db[_0x25b0('0x183')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'onDelete':'cascade','foreignKey':_0x25b0('0x1bb')});db[_0x25b0('0x183')]['belongsTo'](db[_0x25b0('0x108')],{'onDelete':_0x25b0('0x107'),'foreignKey':'ToId'});db[_0x25b0('0xcc')][_0x25b0('0x10b')](db[_0x25b0('0xca')],{'foreignKey':_0x25b0('0x1bc'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0xcc')][_0x25b0('0x10b')](db[_0x25b0('0x1bd')],{'foreignKey':_0x25b0('0x1bc'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0xcd')][_0x25b0('0x117')](db[_0x25b0('0x16b')],{});db['SmsQueueReport'][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':_0x25b0('0x153'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0xcd')]['belongsTo'](db[_0x25b0('0x6d')],{'as':'Contact','foreignKey':'ContactId'});db[_0x25b0('0xcd')][_0x25b0('0x117')](db[_0x25b0('0x55')],{});db[_0x25b0('0xcd')][_0x25b0('0x117')](db[_0x25b0('0x57')],{});db[_0x25b0('0xcd')][_0x25b0('0x117')](db[_0x25b0('0x108')],{});db[_0x25b0('0xcd')]['belongsTo'](db[_0x25b0('0x59')],{});db[_0x25b0('0xd2')][_0x25b0('0x10b')](db[_0x25b0('0xcc')],{'foreignKey':_0x25b0('0x1be')});db[_0x25b0('0xd2')][_0x25b0('0x10b')](db[_0x25b0('0xca')],{'foreignKey':_0x25b0('0x1be')});db[_0x25b0('0xd2')][_0x25b0('0x10b')](db[_0x25b0('0x1bd')],{'foreignKey':_0x25b0('0x1be')});db[_0x25b0('0x1bf')][_0x25b0('0x119')](db['User'],{'as':_0x25b0('0x15a'),'through':'user_has_square_projects'});db[_0x25b0('0xdc')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':'Agents','through':'user_has_teams'});db[_0x25b0('0xdc')][_0x25b0('0x119')](db[_0x25b0('0x1a')],{'through':_0x25b0('0x104'),'as':_0x25b0('0x126')});db[_0x25b0('0xdc')][_0x25b0('0x119')](db[_0x25b0('0x3d')],{'through':_0x25b0('0x1c0'),'as':_0x25b0('0x129')});db['Team'][_0x25b0('0x119')](db[_0x25b0('0x68')],{'through':_0x25b0('0x1c1'),'as':_0x25b0('0x1c2')});db['Team'][_0x25b0('0x119')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x25b0('0x1c3')});db[_0x25b0('0xdc')][_0x25b0('0x119')](db[_0x25b0('0x59')],{'through':_0x25b0('0x172'),'as':'SmsQueues'});db['Team'][_0x25b0('0x119')](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':_0x25b0('0x1c4')});db[_0x25b0('0xdc')][_0x25b0('0x119')](db['WhatsappQueue'],{'through':_0x25b0('0x1c5'),'as':_0x25b0('0x12d')});db[_0x25b0('0xdc')][_0x25b0('0x119')](db[_0x25b0('0x127')],{'through':_0x25b0('0x1c6'),'as':'VoicePrefixes'});db['Campaign'][_0x25b0('0x10b')](db[_0x25b0('0x6f')],{'as':_0x25b0('0x13b'),'foreignKey':_0x25b0('0x18c')});db[_0x25b0('0x18b')][_0x25b0('0x10b')](db[_0x25b0('0x73')],{'as':'HopperFinals','foreignKey':_0x25b0('0x18c')});db[_0x25b0('0x18b')][_0x25b0('0x10b')](db[_0x25b0('0x75')],{'as':_0x25b0('0x13c'),'foreignKey':_0x25b0('0x18c')});db[_0x25b0('0x18b')][_0x25b0('0x10b')](db[_0x25b0('0x71')],{'as':'HopperBlacks','foreignKey':'CampaignId'});db[_0x25b0('0x18b')][_0x25b0('0x117')](db[_0x25b0('0x27')],{'as':_0x25b0('0x27'),'foreignKey':_0x25b0('0x1c7')});db['Campaign'][_0x25b0('0x117')](db[_0x25b0('0x27')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x25b0('0x18b')][_0x25b0('0x117')](db[_0x25b0('0x13f')],{'as':_0x25b0('0x13f'),'foreignKey':_0x25b0('0x140')});db['Campaign'][_0x25b0('0x117')](db[_0x25b0('0x1bf')],{'as':_0x25b0('0x1bf'),'foreignKey':_0x25b0('0x1c8')});db[_0x25b0('0x18b')][_0x25b0('0x119')](db[_0x25b0('0xef')],{'as':_0x25b0('0x11e'),'through':_0x25b0('0x1c9')});db[_0x25b0('0x18b')]['belongsToMany'](db[_0x25b0('0xef')],{'as':_0x25b0('0x144'),'through':_0x25b0('0x1ca')});db[_0x25b0('0xe3')]['belongsTo'](db[_0x25b0('0x15c')],{'as':_0x25b0('0x15c'),'foreignKey':_0x25b0('0x15d')});db['MailTransferReport'][_0x25b0('0x117')](db[_0x25b0('0x41')],{});db[_0x25b0('0xe6')][_0x25b0('0x117')](db[_0x25b0('0x40')],{});db[_0x25b0('0xe6')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x25b0('0x1cb'),'as':_0x25b0('0x1cc')});db[_0x25b0('0xe6')][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1cd'),'as':_0x25b0('0x1ce')});db[_0x25b0('0xe6')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x25b0('0xe6')][_0x25b0('0x117')](db['MailQueue'],{'foreignKey':_0x25b0('0x1cf'),'as':_0x25b0('0x1d0')});db[_0x25b0('0xe6')][_0x25b0('0x117')](db[_0x25b0('0x3b')],{'foreignKey':'ToMailAccountId','as':_0x25b0('0x1d1')});db[_0x25b0('0xe8')]['belongsTo'](db['ChatMessage'],{});db[_0x25b0('0xe8')]['belongsTo'](db[_0x25b0('0x113')],{});db[_0x25b0('0xe8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x25b0('0x1d2'),'as':'FromAccount'});db[_0x25b0('0xe8')][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1cd'),'as':_0x25b0('0x1ce')});db[_0x25b0('0xe8')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'foreignKey':_0x25b0('0x1d3'),'as':'ToAgent'});db[_0x25b0('0xe8')][_0x25b0('0x117')](db['ChatQueue'],{'foreignKey':_0x25b0('0x1d4'),'as':_0x25b0('0x1d0')});db[_0x25b0('0xe8')][_0x25b0('0x117')](db[_0x25b0('0x62')],{'foreignKey':_0x25b0('0x1d5'),'as':'ToAccount'});db[_0x25b0('0xea')]['belongsTo'](db[_0x25b0('0x163')],{});db[_0x25b0('0xea')]['belongsTo'](db[_0x25b0('0x4d')],{});db[_0x25b0('0xea')][_0x25b0('0x117')](db['FaxAccount'],{'foreignKey':_0x25b0('0x1d6'),'as':_0x25b0('0x1cc')});db['FaxTransferReport'][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1cd'),'as':_0x25b0('0x1ce')});db[_0x25b0('0xea')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'foreignKey':_0x25b0('0x1d3'),'as':_0x25b0('0x1d7')});db['FaxTransferReport'][_0x25b0('0x117')](db[_0x25b0('0x12a')],{'foreignKey':'ToFaxQueueId','as':_0x25b0('0x1d0')});db[_0x25b0('0xea')][_0x25b0('0x117')](db['FaxAccount'],{'foreignKey':_0x25b0('0x1d8'),'as':_0x25b0('0x1d1')});db[_0x25b0('0xeb')][_0x25b0('0x117')](db['OpenchannelMessage'],{});db[_0x25b0('0xeb')][_0x25b0('0x117')](db[_0x25b0('0x111')],{});db[_0x25b0('0xeb')][_0x25b0('0x117')](db[_0x25b0('0x5b')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0x25b0('0xeb')][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1cd'),'as':_0x25b0('0x1ce')});db[_0x25b0('0xeb')][_0x25b0('0x117')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x25b0('0xeb')]['belongsTo'](db[_0x25b0('0x60')],{'foreignKey':_0x25b0('0x1d9'),'as':_0x25b0('0x1d0')});db[_0x25b0('0xeb')][_0x25b0('0x117')](db[_0x25b0('0x5b')],{'foreignKey':_0x25b0('0x1da'),'as':_0x25b0('0x1d1')});db[_0x25b0('0xed')][_0x25b0('0x117')](db[_0x25b0('0x57')],{});db[_0x25b0('0xed')][_0x25b0('0x117')](db[_0x25b0('0x55')],{});db['SmsTransferReport']['belongsTo'](db[_0x25b0('0x16b')],{'foreignKey':_0x25b0('0x1db'),'as':'FromAccount'});db[_0x25b0('0xed')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'foreignKey':'FromUserId','as':_0x25b0('0x1ce')});db['SmsTransferReport'][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1d3'),'as':_0x25b0('0x1d7')});db[_0x25b0('0xed')]['belongsTo'](db[_0x25b0('0x59')],{'foreignKey':'ToSmsQueueId','as':_0x25b0('0x1d0')});db[_0x25b0('0xed')][_0x25b0('0x117')](db[_0x25b0('0x16b')],{'foreignKey':_0x25b0('0x1dc'),'as':_0x25b0('0x1d1')});db[_0x25b0('0xef')][_0x25b0('0x10b')](db[_0x25b0('0x14f')],{'as':'Dispositions','foreignKey':_0x25b0('0x160'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0xef')][_0x25b0('0x10b')](db[_0x25b0('0x77')],{'as':_0x25b0('0x1dd'),'foreignKey':_0x25b0('0x160')});db['CmList'][_0x25b0('0x10b')](db[_0x25b0('0x6d')],{'as':_0x25b0('0x11c'),'onDelete':_0x25b0('0x107'),'foreignKey':'ListId'});db[_0x25b0('0xef')][_0x25b0('0x10b')](db[_0x25b0('0x73')],{'as':_0x25b0('0x10e'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0xef')][_0x25b0('0x10b')](db[_0x25b0('0x75')],{'as':_0x25b0('0x10f'),'foreignKey':_0x25b0('0x160')});db[_0x25b0('0xef')][_0x25b0('0x10b')](db[_0x25b0('0x110')],{'as':_0x25b0('0x110'),'foreignKey':_0x25b0('0x160')});db['CmList'][_0x25b0('0x119')](db[_0x25b0('0x1a')],{'as':_0x25b0('0x1de'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db['User'],{'as':_0x25b0('0x155'),'through':_0x25b0('0x11f')});db[_0x25b0('0x127')]['hasMany'](db[_0x25b0('0x17')],{'as':_0x25b0('0x10d'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0x127')]['belongsToMany'](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':'UserVoicePrefix'});db[_0x25b0('0x127')]['belongsToMany'](db['Team'],{'through':_0x25b0('0x1c6'),'as':_0x25b0('0x156')});db[_0x25b0('0xf1')][_0x25b0('0x10b')](db[_0x25b0('0x108')],{'as':'Users','foreignKey':'userProfileId'});db[_0x25b0('0xf1')][_0x25b0('0x10b')](db['UserProfileSection'],{'as':_0x25b0('0x1df'),'foreignKey':_0x25b0('0x118'),'onDelete':'cascade'});db[_0x25b0('0xf2')]['hasMany'](db['UserProfileResource'],{'as':_0x25b0('0x1e0'),'foreignKey':_0x25b0('0x1e1'),'onDelete':_0x25b0('0x107')});db[_0x25b0('0xf7')][_0x25b0('0x10b')](db[_0x25b0('0x14f')],{'as':_0x25b0('0x150'),'foreignKey':'WhatsappAccountId','onDelete':_0x25b0('0x107')});db['WhatsappAccount'][_0x25b0('0x10b')](db[_0x25b0('0x7b')],{'as':'Answers','foreignKey':_0x25b0('0x1e2')});db[_0x25b0('0xf7')][_0x25b0('0x10b')](db[_0x25b0('0xfc')],{'as':_0x25b0('0x145'),'foreignKey':_0x25b0('0x1e2')});db[_0x25b0('0xf7')][_0x25b0('0x10b')](db[_0x25b0('0xfb')],{'as':'Interactions'});db[_0x25b0('0xf7')][_0x25b0('0x10b')](db[_0x25b0('0xf9')],{'as':_0x25b0('0x137')});db[_0x25b0('0xf7')][_0x25b0('0x117')](db['CmList'],{'as':_0x25b0('0x153'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x25b0('0x117')](db[_0x25b0('0x7f')],{'as':_0x25b0('0x141'),'foreignKey':_0x25b0('0x142')});db[_0x25b0('0xf7')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x134')});db[_0x25b0('0xf9')][_0x25b0('0x117')](db['User'],{'onDelete':_0x25b0('0x15e')});db[_0x25b0('0xf9')][_0x25b0('0x117')](db[_0x25b0('0x100')],{'onDelete':_0x25b0('0x15e')});db['WhatsappApplication'][_0x25b0('0x117')](db['WhatsappAccount'],{'onDelete':_0x25b0('0x15e')});db['WhatsappApplication'][_0x25b0('0x117')](db[_0x25b0('0x13f')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x25b0('0xf9')]['belongsTo'](db['Tag'],{'onDelete':_0x25b0('0x15e'),'foreignKey':_0x25b0('0x15f')});db[_0x25b0('0xfb')][_0x25b0('0x10b')](db[_0x25b0('0xfc')],{'as':_0x25b0('0x145'),'onDelete':'cascade','foreignKey':_0x25b0('0x1e3')});db[_0x25b0('0xfb')][_0x25b0('0x117')](db[_0x25b0('0xf7')],{'as':'Account','foreignKey':_0x25b0('0x1e2')});db[_0x25b0('0xfb')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'as':'Contact','foreignKey':'ContactId'});db[_0x25b0('0xfb')][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':'Owner','foreignKey':_0x25b0('0x10a')});db[_0x25b0('0xfb')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x1e4'),'as':_0x25b0('0x170')});db[_0x25b0('0xfb')][_0x25b0('0x119')](db[_0x25b0('0x88')],{'through':_0x25b0('0x1e4'),'as':_0x25b0('0x167')});db[_0x25b0('0xfb')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x15a'),'through':_0x25b0('0x125'),'foreignKey':_0x25b0('0x1e3')});db['WhatsappMessage'][_0x25b0('0x117')](db[_0x25b0('0x108')],{'as':_0x25b0('0x108')});db[_0x25b0('0xfc')][_0x25b0('0x117')](db[_0x25b0('0x6d')],{'onDelete':_0x25b0('0x107'),'as':_0x25b0('0x14c')});db[_0x25b0('0xfc')]['belongsTo'](db[_0x25b0('0xfb')],{'onDelete':_0x25b0('0x107'),'as':'Interaction','foreignKey':_0x25b0('0x1e3')});db['WhatsappMessage'][_0x25b0('0x117')](db[_0x25b0('0xf7')],{'as':_0x25b0('0x165'),'foreignKey':_0x25b0('0x1e2')});db[_0x25b0('0x1e5')][_0x25b0('0x117')](db['WhatsappAccount'],{});db[_0x25b0('0x1e5')][_0x25b0('0x117')](db[_0x25b0('0xef')],{'as':'List','foreignKey':_0x25b0('0x160')});db[_0x25b0('0x1e5')][_0x25b0('0x117')](db['CmContact'],{'as':_0x25b0('0x14c'),'foreignKey':_0x25b0('0x14d')});db[_0x25b0('0x1e5')]['belongsTo'](db[_0x25b0('0xfb')],{});db['WhatsappQueueReport'][_0x25b0('0x117')](db[_0x25b0('0x100')],{});db[_0x25b0('0x1e5')][_0x25b0('0x117')](db[_0x25b0('0xfc')],{});db[_0x25b0('0x1e5')][_0x25b0('0x117')](db[_0x25b0('0x108')],{});db['WhatsappTransferReport'][_0x25b0('0x117')](db[_0x25b0('0xfc')],{});db[_0x25b0('0xfe')][_0x25b0('0x117')](db[_0x25b0('0xfb')],{});db[_0x25b0('0xfe')][_0x25b0('0x117')](db['WhatsappAccount'],{'foreignKey':_0x25b0('0x1e6'),'as':_0x25b0('0x1cc')});db['WhatsappTransferReport'][_0x25b0('0x117')](db[_0x25b0('0xf7')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x25b0('0xfe')][_0x25b0('0x117')](db[_0x25b0('0x100')],{'foreignKey':'ToQueueId','as':_0x25b0('0x1d0')});db['WhatsappTransferReport'][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1cd'),'as':_0x25b0('0x1ce')});db[_0x25b0('0xfe')][_0x25b0('0x117')](db['User'],{'foreignKey':_0x25b0('0x1d3'),'as':'ToAgent'});db[_0x25b0('0x100')][_0x25b0('0x119')](db[_0x25b0('0x108')],{'as':_0x25b0('0x155'),'through':_0x25b0('0x35'),'foreignKey':'WhatsappQueueId'});db[_0x25b0('0x100')][_0x25b0('0x119')](db['Team'],{'through':_0x25b0('0x1c5'),'as':'Teams'});module[_0x25b0('0x1e7')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 43a617e..fef84aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7573=['./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','username','password','newPassword','apiKey','lastName','street','phone','fax','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','lodash','path','express','express-winston','util','./errors','./config/environment','./config/logger','api','./safe-template','default','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','remoteAddress','statusCode','responseTime','user','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','url','name','role','agent_id','agent_name','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','./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/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/queues','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','/api/variables','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./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/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects'];(function(_0x82269b,_0x5c0d57){var _0x312a18=function(_0x292cc1){while(--_0x292cc1){_0x82269b['push'](_0x82269b['shift']());}};_0x312a18(++_0x5c0d57);}(_0x7573,0x72));var _0x3757=function(_0x4c69d1,_0x7fcd8){_0x4c69d1=_0x4c69d1-0x0;var _0x470fc4=_0x7573[_0x4c69d1];return _0x470fc4;};'use strict';var _=require(_0x3757('0x0'));var path=require(_0x3757('0x1'));var express=require(_0x3757('0x2'));var ewinston=require(_0x3757('0x3'));var util=require(_0x3757('0x4'));var errors=require(_0x3757('0x5'));var config=require(_0x3757('0x6'));var logger=require(_0x3757('0x7'))(_0x3757('0x8'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0x3757('0x9'))['safeTemplate'];exports[_0x3757('0xa')]=function(_0x5b1212){_0x5b1212[_0x3757('0xb')](ewinston[_0x3757('0xc')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xdd275a,_0x2ce77b){var _0xd1a9c5=_0x3757('0xd');if(!_[_0x3757('0xe')](_0xdd275a[_0x3757('0xf')])){_0xd1a9c5+=_0x3757('0x10');var _0xd139da=_0xdd275a[_0x3757('0xf')];maskSensitiveData(_0xd139da);}return safeTemplate(util[_0x3757('0x11')](_0xd1a9c5,_0xdd275a[_0x3757('0x12')],_0xdd275a[_0x3757('0x13')][_0x3757('0x14')]?_0xdd275a[_0x3757('0x13')][_0x3757('0x14')]:_0xdd275a['connection'][_0x3757('0x15')]||_0xdd275a['ip'],_0xdd275a['url'],_0x2ce77b[_0x3757('0x16')],_0x2ce77b[_0x3757('0x17')],_0xdd275a[_0x3757('0x18')]?_0xdd275a[_0x3757('0x18')]['id']:null,_0xdd275a[_0x3757('0x18')]?_0xdd275a['user']['name']:null,_0xdd275a[_0x3757('0x18')]?_0xdd275a[_0x3757('0x18')]['role']:null,_0xd139da?util['inspect'](_0xd139da,![],null):''));}}));_0x5b1212['use'](ewinston[_0x3757('0xc')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5b62e7,_0x100283){var _0x56053a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x5b62e7['body']&&_0x5b62e7[_0x3757('0xf')][_0x3757('0x19')]&&_0x5b62e7['body']['agent_id']){_0x56053a=_0x3757('0x1a');}return util[_0x3757('0x11')](_0x56053a,_0x5b62e7[_0x3757('0x12')],_0x5b62e7[_0x3757('0x13')][_0x3757('0x14')]?_0x5b62e7[_0x3757('0x13')][_0x3757('0x14')]:_0x5b62e7[_0x3757('0x1b')]['remoteAddress']||_0x5b62e7['ip'],_0x5b62e7[_0x3757('0x1c')],_0x100283[_0x3757('0x16')],_0x100283[_0x3757('0x17')],_0x5b62e7[_0x3757('0x18')]?_0x5b62e7[_0x3757('0x18')]['id']:null,_0x5b62e7[_0x3757('0x18')]?_0x5b62e7[_0x3757('0x18')][_0x3757('0x1d')]:null,_0x5b62e7['user']?_0x5b62e7['user'][_0x3757('0x1e')]:null,_0x5b62e7['body']&&_0x5b62e7['body'][_0x3757('0x19')]?_0x5b62e7['body'][_0x3757('0x19')]:'other',_0x5b62e7[_0x3757('0xf')]&&_0x5b62e7['body'][_0x3757('0x1f')]?_0x5b62e7[_0x3757('0xf')][_0x3757('0x1f')]:'',_0x5b62e7[_0x3757('0xf')]&&_0x5b62e7['body'][_0x3757('0x20')]?_0x5b62e7[_0x3757('0xf')][_0x3757('0x20')]:'');},'ignoreRoute':function(_0x57d841){var _0x3912f4=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3912f4['test'](_0x57d841['url']);}}));_0x5b1212[_0x3757('0xb')](_0x3757('0x21'),require('./api/user'));_0x5b1212[_0x3757('0xb')]('/api/voice/chanspy',require(_0x3757('0x22')));_0x5b1212[_0x3757('0xb')](_0x3757('0x23'),require(_0x3757('0x24')));_0x5b1212['use'](_0x3757('0x25'),require(_0x3757('0x26')));_0x5b1212[_0x3757('0xb')]('/api/voice/mohs',require(_0x3757('0x27')));_0x5b1212[_0x3757('0xb')]('/api/voice/queues',require(_0x3757('0x28')));_0x5b1212['use'](_0x3757('0x29'),require(_0x3757('0x2a')));_0x5b1212[_0x3757('0xb')](_0x3757('0x2b'),require('./api/screenRecording'));_0x5b1212[_0x3757('0xb')](_0x3757('0x2c'),require(_0x3757('0x2d')));_0x5b1212['use'](_0x3757('0x2e'),require('./api/voiceMailMessage'));_0x5b1212[_0x3757('0xb')]('/api/voice/calls/reports',require(_0x3757('0x2f')));_0x5b1212['use'](_0x3757('0x30'),require('./api/voiceDialReport'));_0x5b1212[_0x3757('0xb')]('/api/voice/agents/reports',require(_0x3757('0x31')));_0x5b1212[_0x3757('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x5b1212['use']('/api/members/reports',require(_0x3757('0x32')));_0x5b1212[_0x3757('0xb')](_0x3757('0x33'),require(_0x3757('0x34')));_0x5b1212[_0x3757('0xb')](_0x3757('0x35'),require(_0x3757('0x36')));_0x5b1212[_0x3757('0xb')](_0x3757('0x37'),require(_0x3757('0x38')));_0x5b1212[_0x3757('0xb')](_0x3757('0x39'),require('./api/mailAccount'));_0x5b1212['use'](_0x3757('0x3a'),require('./api/mailQueue'));_0x5b1212[_0x3757('0xb')]('/api/mail/substatuses',require(_0x3757('0x3b')));_0x5b1212['use'](_0x3757('0x3c'),require(_0x3757('0x3d')));_0x5b1212[_0x3757('0xb')]('/api/mail/messages',require(_0x3757('0x3e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x3f'),require(_0x3757('0x40')));_0x5b1212['use'](_0x3757('0x41'),require('./api/mailQueueReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x42'),require('./api/dashboard'));_0x5b1212[_0x3757('0xb')](_0x3757('0x43'),require(_0x3757('0x44')));_0x5b1212[_0x3757('0xb')]('/api/fax/accounts',require(_0x3757('0x45')));_0x5b1212['use'](_0x3757('0x46'),require(_0x3757('0x47')));_0x5b1212[_0x3757('0xb')](_0x3757('0x48'),require('./api/faxInteraction'));_0x5b1212['use'](_0x3757('0x49'),require('./api/faxMessage'));_0x5b1212['use']('/api/fax/queues',require(_0x3757('0x4a')));_0x5b1212[_0x3757('0xb')]('/api/fax/reports/queue',require(_0x3757('0x4b')));_0x5b1212['use'](_0x3757('0x4c'),require(_0x3757('0x4d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x4e'),require(_0x3757('0x4f')));_0x5b1212['use'](_0x3757('0x50'),require('./api/smsInteraction'));_0x5b1212[_0x3757('0xb')]('/api/sms/messages',require(_0x3757('0x51')));_0x5b1212[_0x3757('0xb')](_0x3757('0x52'),require(_0x3757('0x53')));_0x5b1212['use'](_0x3757('0x54'),require('./api/openchannelAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0x55'),require('./api/openchannelApplication'));_0x5b1212[_0x3757('0xb')](_0x3757('0x56'),require(_0x3757('0x57')));_0x5b1212['use'](_0x3757('0x58'),require(_0x3757('0x59')));_0x5b1212['use'](_0x3757('0x5a'),require(_0x3757('0x5b')));_0x5b1212[_0x3757('0xb')](_0x3757('0x5c'),require(_0x3757('0x5d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x5e'),require(_0x3757('0x5f')));_0x5b1212[_0x3757('0xb')](_0x3757('0x60'),require(_0x3757('0x61')));_0x5b1212[_0x3757('0xb')]('/api/chat/interactions',require('./api/chatInteraction'));_0x5b1212[_0x3757('0xb')](_0x3757('0x62'),require(_0x3757('0x63')));_0x5b1212[_0x3757('0xb')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x5b1212['use'](_0x3757('0x64'),require('./api/chatQueue'));_0x5b1212[_0x3757('0xb')]('/api/chat/groups',require(_0x3757('0x65')));_0x5b1212['use'](_0x3757('0x66'),require(_0x3757('0x67')));_0x5b1212[_0x3757('0xb')](_0x3757('0x68'),require(_0x3757('0x69')));_0x5b1212[_0x3757('0xb')](_0x3757('0x6a'),require(_0x3757('0x6b')));_0x5b1212['use'](_0x3757('0x6c'),require(_0x3757('0x6d')));_0x5b1212[_0x3757('0xb')](_0x3757('0x6e'),require(_0x3757('0x6f')));_0x5b1212[_0x3757('0xb')]('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x5b1212['use'](_0x3757('0x70'),require(_0x3757('0x71')));_0x5b1212[_0x3757('0xb')](_0x3757('0x72'),require('./api/cmCustomField'));_0x5b1212[_0x3757('0xb')](_0x3757('0x73'),require(_0x3757('0x74')));_0x5b1212[_0x3757('0xb')](_0x3757('0x75'),require(_0x3757('0x76')));_0x5b1212[_0x3757('0xb')](_0x3757('0x77'),require(_0x3757('0x78')));_0x5b1212[_0x3757('0xb')](_0x3757('0x79'),require(_0x3757('0x7a')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7b'),require(_0x3757('0x7c')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7d'),require(_0x3757('0x7e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x7f'),require('./api/pause'));_0x5b1212['use'](_0x3757('0x80'),require('./api/cdr'));_0x5b1212[_0x3757('0xb')](_0x3757('0x81'),require(_0x3757('0x82')));_0x5b1212[_0x3757('0xb')](_0x3757('0x83'),require(_0x3757('0x84')));_0x5b1212[_0x3757('0xb')](_0x3757('0x85'),require(_0x3757('0x86')));_0x5b1212[_0x3757('0xb')](_0x3757('0x87'),require(_0x3757('0x88')));_0x5b1212[_0x3757('0xb')](_0x3757('0x89'),require('./api/template'));_0x5b1212[_0x3757('0xb')](_0x3757('0x8a'),require('./api/trigger'));_0x5b1212[_0x3757('0xb')](_0x3757('0x8b'),require(_0x3757('0x8c')));_0x5b1212[_0x3757('0xb')]('/api/integrations',require(_0x3757('0x8d')));_0x5b1212[_0x3757('0xb')]('/api/integrations/reports',require(_0x3757('0x8e')));_0x5b1212['use'](_0x3757('0x8f'),require(_0x3757('0x90')));_0x5b1212[_0x3757('0xb')]('/api/analytics/default_reports',require(_0x3757('0x91')));_0x5b1212[_0x3757('0xb')](_0x3757('0x92'),require('./api/analyticExtractedReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x93'),require(_0x3757('0x94')));_0x5b1212[_0x3757('0xb')](_0x3757('0x95'),require('./api/analyticFieldReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0x96'),require(_0x3757('0x97')));_0x5b1212[_0x3757('0xb')](_0x3757('0x98'),require(_0x3757('0x99')));_0x5b1212[_0x3757('0xb')](_0x3757('0x9a'),require(_0x3757('0x9b')));_0x5b1212['use'](_0x3757('0x9c'),require(_0x3757('0x9d')));_0x5b1212[_0x3757('0xb')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0x9e'),require(_0x3757('0x9f')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa0'),require(_0x3757('0xa1')));_0x5b1212[_0x3757('0xb')]('/api/integrations/desk/accounts',require(_0x3757('0xa2')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa3'),require(_0x3757('0xa4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa5'),require(_0x3757('0xa6')));_0x5b1212[_0x3757('0xb')](_0x3757('0xa7'),require('./api/intZohoAccount'));_0x5b1212['use'](_0x3757('0xa8'),require(_0x3757('0xa9')));_0x5b1212[_0x3757('0xb')]('/api/integrations/zoho/fields',require(_0x3757('0xaa')));_0x5b1212[_0x3757('0xb')](_0x3757('0xab'),require(_0x3757('0xac')));_0x5b1212[_0x3757('0xb')]('/api/integrations/zendesk/configurations',require(_0x3757('0xad')));_0x5b1212[_0x3757('0xb')](_0x3757('0xae'),require(_0x3757('0xaf')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb0'),require(_0x3757('0xb1')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb2'),require(_0x3757('0xb3')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb4'),require(_0x3757('0xb5')));_0x5b1212[_0x3757('0xb')](_0x3757('0xb6'),require(_0x3757('0xb7')));_0x5b1212['use']('/api/integrations/vtiger/configurations',require(_0x3757('0xb8')));_0x5b1212['use'](_0x3757('0xb9'),require('./api/intVtigerField'));_0x5b1212['use'](_0x3757('0xba'),require(_0x3757('0xbb')));_0x5b1212[_0x3757('0xb')](_0x3757('0xbc'),require(_0x3757('0xbd')));_0x5b1212['use']('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x5b1212[_0x3757('0xb')](_0x3757('0xbe'),require(_0x3757('0xbf')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc0'),require(_0x3757('0xc1')));_0x5b1212['use']('/api/integrations/dynamics365/fields',require(_0x3757('0xc2')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc3'),require(_0x3757('0xc4')));_0x5b1212[_0x3757('0xb')]('/api/integrations/freshsales/configurations',require(_0x3757('0xc5')));_0x5b1212[_0x3757('0xb')](_0x3757('0xc6'),require(_0x3757('0xc7')));_0x5b1212[_0x3757('0xb')]('/api/networks',require(_0x3757('0xc8')));_0x5b1212['use'](_0x3757('0xc9'),require(_0x3757('0xca')));_0x5b1212[_0x3757('0xb')](_0x3757('0xcb'),require('./api/chatInternalMessage'));_0x5b1212[_0x3757('0xb')](_0x3757('0xcc'),require(_0x3757('0xcd')));_0x5b1212[_0x3757('0xb')](_0x3757('0xce'),require(_0x3757('0xcf')));_0x5b1212[_0x3757('0xb')]('/api/jscripty/sessions/reports',require(_0x3757('0xd0')));_0x5b1212['use'](_0x3757('0xd1'),require(_0x3757('0xd2')));_0x5b1212['use'](_0x3757('0xd3'),require(_0x3757('0xd4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xd5'),require(_0x3757('0xd6')));_0x5b1212[_0x3757('0xb')](_0x3757('0xd7'),require('./api/jscriptyProject'));_0x5b1212[_0x3757('0xb')](_0x3757('0xd8'),require(_0x3757('0xd9')));_0x5b1212[_0x3757('0xb')](_0x3757('0xda'),require(_0x3757('0xdb')));_0x5b1212['use'](_0x3757('0xdc'),require(_0x3757('0xdd')));_0x5b1212[_0x3757('0xb')](_0x3757('0xde'),require(_0x3757('0xdf')));_0x5b1212['use'](_0x3757('0xe0'),require(_0x3757('0xe1')));_0x5b1212[_0x3757('0xb')](_0x3757('0xe2'),require('./api/team'));_0x5b1212['use'](_0x3757('0xe3'),require(_0x3757('0xe4')));_0x5b1212[_0x3757('0xb')](_0x3757('0xe5'),require(_0x3757('0xe6')));_0x5b1212[_0x3757('0xb')]('/api/migrations',require('./api/migration'));_0x5b1212[_0x3757('0xb')](_0x3757('0xe7'),require(_0x3757('0xe8')));_0x5b1212['use'](_0x3757('0xe9'),require(_0x3757('0xea')));_0x5b1212['use'](_0x3757('0xeb'),require('./api/mailTransferReport'));_0x5b1212['use']('/api/chat/reports/transfer',require(_0x3757('0xec')));_0x5b1212[_0x3757('0xb')](_0x3757('0xed'),require(_0x3757('0xee')));_0x5b1212['use'](_0x3757('0xef'),require('./api/openchannelTransferReport'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf0'),require(_0x3757('0xf1')));_0x5b1212[_0x3757('0xb')]('/api/cm/lists',require('./api/cmList'));_0x5b1212[_0x3757('0xb')]('/api/voice/prefixes',require('./api/voicePrefix'));_0x5b1212['use'](_0x3757('0xf2'),require('./api/userProfile'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf3'),require(_0x3757('0xf4')));_0x5b1212['use'](_0x3757('0xf5'),require(_0x3757('0xf6')));_0x5b1212['use'](_0x3757('0xf7'),require('./api/userNotification'));_0x5b1212['use'](_0x3757('0xf8'),require('./api/whatsappAccount'));_0x5b1212[_0x3757('0xb')](_0x3757('0xf9'),require(_0x3757('0xfa')));_0x5b1212[_0x3757('0xb')](_0x3757('0xfb'),require('./api/whatsappInteraction'));_0x5b1212[_0x3757('0xb')](_0x3757('0xfc'),require('./api/whatsappMessage'));_0x5b1212[_0x3757('0xb')](_0x3757('0xfd'),require(_0x3757('0xfe')));_0x5b1212['use'](_0x3757('0xff'),require('./api/whatsappTransferReport'));_0x5b1212['use'](_0x3757('0x100'),require(_0x3757('0x101')));_0x5b1212['use'](_0x3757('0x102'),require(_0x3757('0x103')));_0x5b1212[_0x3757('0xb')](_0x3757('0x104'),require(_0x3757('0x105')));_0x5b1212[_0x3757('0xb')](_0x3757('0x106'),require(_0x3757('0x107')));_0x5b1212[_0x3757('0xb')]('/api/auth/google',require(_0x3757('0x108')));_0x5b1212[_0x3757('0xb')](_0x3757('0x109'),require(_0x3757('0x10a')));_0x5b1212['use'](_0x3757('0x10b'),require(_0x3757('0x10c')));_0x5b1212[_0x3757('0xb')](_0x3757('0x10d'),require(_0x3757('0x10e')));_0x5b1212[_0x3757('0xb')](_0x3757('0x10f'),require('./api/system'));_0x5b1212[_0x3757('0xb')](_0x3757('0x110'),require(_0x3757('0x111')));_0x5b1212[_0x3757('0xb')]('/api/webbar',require(_0x3757('0x112')));_0x5b1212[_0x3757('0xb')](_0x3757('0x113'),express['static'](path['join'](config['root'],_0x3757('0x113'))));_0x5b1212['use']('/www',express[_0x3757('0x114')](path['join'](config[_0x3757('0x115')],_0x3757('0x116'))));_0x5b1212[_0x3757('0xb')](_0x3757('0x117'),express[_0x3757('0x114')](path[_0x3757('0x118')](config[_0x3757('0x115')],_0x3757('0x117'))));_0x5b1212[_0x3757('0xb')](_0x3757('0x119'),express[_0x3757('0x114')](path[_0x3757('0x118')](config['root'],_0x3757('0x11a'),_0x3757('0x11b'))));_0x5b1212[_0x3757('0xb')]('/plugins',express[_0x3757('0x114')](path['join'](config['root'],_0x3757('0x11c'))));_0x5b1212[_0x3757('0x11d')](_0x3757('0x11e'))[_0x3757('0x11f')](errors[0x194]);_0x5b1212[_0x3757('0x11d')]('/*')[_0x3757('0x11f')](function(_0x533db7,_0xde7de9){_0xde7de9[_0x3757('0x120')](path[_0x3757('0x121')](_0x5b1212[_0x3757('0x11f')](_0x3757('0x122'))+'/index.html'));});};var sensitiveFields=[_0x3757('0x123'),_0x3757('0x124'),_0x3757('0x125'),_0x3757('0x126'),'firstName',_0x3757('0x127'),_0x3757('0x128'),_0x3757('0x129'),'mobile',_0x3757('0x12a'),_0x3757('0x12b'),_0x3757('0x12c'),'clientSecret','securityToken',_0x3757('0x12d'),_0x3757('0x12e'),_0x3757('0x12f'),_0x3757('0x130'),_0x3757('0x131'),_0x3757('0x132'),_0x3757('0x133'),_0x3757('0x134'),_0x3757('0x135'),_0x3757('0x136'),_0x3757('0x137'),_0x3757('0x138'),_0x3757('0x139'),_0x3757('0x13a'),_0x3757('0x13b'),_0x3757('0x13c'),_0x3757('0x13d'),_0x3757('0x13e'),_0x3757('0x13f'),_0x3757('0x140'),_0x3757('0x18'),_0x3757('0x141'),'accountSid',_0x3757('0x142'),_0x3757('0x143'),_0x3757('0x144'),_0x3757('0x145'),_0x3757('0x146')];function maskSensitiveData(_0x5b3c60){var _0x2173f9=/(?!^)[\s\S](?!$)/g;if(!_[_0x3757('0x147')](_0x5b3c60))return;for(var _0x3cb70c in _0x5b3c60){if(_[_0x3757('0x148')](_0x5b3c60[_0x3cb70c])){for(var _0x327000=0x0;_0x327000<_0x5b3c60[_0x3cb70c][_0x3757('0x149')];_0x327000++){maskSensitiveData(_0x5b3c60[_0x3cb70c][_0x327000]);}}else if(_[_0x3757('0x147')](_0x5b3c60[_0x3cb70c])){maskSensitiveData(_0x5b3c60[_0x3cb70c]);}else if(_[_0x3757('0x14a')](_0x5b3c60[_0x3cb70c])){_0x5b3c60[_0x3cb70c]=_0x5b3c60[_0x3cb70c][_0x3757('0x14b')](/{{{/g,_0x3757('0x14c'))[_0x3757('0x14b')](/}}}/g,_0x3757('0x14d'))[_0x3757('0x14b')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x3757('0x14e')](sensitiveFields,_0x3cb70c)){_0x5b3c60[_0x3cb70c]=_0x5b3c60[_0x3cb70c][_0x3757('0x14b')](_0x2173f9,'*');}}}}
\ No newline at end of file
+var _0xcb91=['./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','username','password','newPassword','firstName','lastName','phone','mobile','fax','email','clientId','clientSecret','code','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','replace','}@@','includes','lodash','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','remoteAddress','statusCode','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','url','responseTime','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./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/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups'];(function(_0x18db90,_0x47e33e){var _0x332549=function(_0x1926ce){while(--_0x1926ce){_0x18db90['push'](_0x18db90['shift']());}};_0x332549(++_0x47e33e);}(_0xcb91,0xea));var _0x1cb9=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xcb91[_0x44b3bd];return _0x1efc4a;};'use strict';var _=require(_0x1cb9('0x0'));var path=require('path');var express=require(_0x1cb9('0x1'));var ewinston=require(_0x1cb9('0x2'));var util=require(_0x1cb9('0x3'));var errors=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var logger=require(_0x1cb9('0x6'))(_0x1cb9('0x7'));var authLogger=require(_0x1cb9('0x6'))(_0x1cb9('0x8'));var safeTemplate=require('./safe-template')['safeTemplate'];exports[_0x1cb9('0x9')]=function(_0x113964){_0x113964[_0x1cb9('0xa')](ewinston[_0x1cb9('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4178c9,_0x3b3575){var _0x4b792e='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x1cb9('0xc')](_0x4178c9[_0x1cb9('0xd')])){_0x4b792e+=_0x1cb9('0xe');var _0xe435bc=_0x4178c9[_0x1cb9('0xd')];maskSensitiveData(_0xe435bc);}return safeTemplate(util[_0x1cb9('0xf')](_0x4b792e,_0x4178c9[_0x1cb9('0x10')],_0x4178c9[_0x1cb9('0x11')]['x-forwarded-for']?_0x4178c9[_0x1cb9('0x11')][_0x1cb9('0x12')]:_0x4178c9['connection'][_0x1cb9('0x13')]||_0x4178c9['ip'],_0x4178c9['url'],_0x3b3575[_0x1cb9('0x14')],_0x3b3575['responseTime'],_0x4178c9[_0x1cb9('0x15')]?_0x4178c9['user']['id']:null,_0x4178c9[_0x1cb9('0x15')]?_0x4178c9[_0x1cb9('0x15')]['name']:null,_0x4178c9[_0x1cb9('0x15')]?_0x4178c9[_0x1cb9('0x15')][_0x1cb9('0x16')]:null,_0xe435bc?util[_0x1cb9('0x17')](_0xe435bc,![],null):''));}}));_0x113964[_0x1cb9('0xa')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x24e905,_0x32781f){var _0x4c2e54=_0x1cb9('0x18');if(_0x24e905['body']&&_0x24e905[_0x1cb9('0xd')][_0x1cb9('0x19')]&&_0x24e905['body'][_0x1cb9('0x1a')]){_0x4c2e54=_0x1cb9('0x1b');}return util[_0x1cb9('0xf')](_0x4c2e54,_0x24e905[_0x1cb9('0x10')],_0x24e905[_0x1cb9('0x11')][_0x1cb9('0x12')]?_0x24e905['headers'][_0x1cb9('0x12')]:_0x24e905[_0x1cb9('0x1c')][_0x1cb9('0x13')]||_0x24e905['ip'],_0x24e905[_0x1cb9('0x1d')],_0x32781f['statusCode'],_0x32781f[_0x1cb9('0x1e')],_0x24e905[_0x1cb9('0x15')]?_0x24e905[_0x1cb9('0x15')]['id']:null,_0x24e905[_0x1cb9('0x15')]?_0x24e905['user']['name']:null,_0x24e905[_0x1cb9('0x15')]?_0x24e905[_0x1cb9('0x15')][_0x1cb9('0x16')]:null,_0x24e905[_0x1cb9('0xd')]&&_0x24e905[_0x1cb9('0xd')][_0x1cb9('0x19')]?_0x24e905[_0x1cb9('0xd')][_0x1cb9('0x19')]:_0x1cb9('0x1f'),_0x24e905[_0x1cb9('0xd')]&&_0x24e905[_0x1cb9('0xd')][_0x1cb9('0x1a')]?_0x24e905['body'][_0x1cb9('0x1a')]:'',_0x24e905[_0x1cb9('0xd')]&&_0x24e905[_0x1cb9('0xd')][_0x1cb9('0x20')]?_0x24e905[_0x1cb9('0xd')]['agent_name']:'');},'ignoreRoute':function(_0x3fdc60){var _0x3ee2db=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3ee2db[_0x1cb9('0x21')](_0x3fdc60[_0x1cb9('0x1d')]);}}));_0x113964['use'](_0x1cb9('0x22'),require(_0x1cb9('0x23')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x24'),require('./api/voiceChanSpy'));_0x113964['use'](_0x1cb9('0x25'),require(_0x1cb9('0x26')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x27'),require(_0x1cb9('0x28')));_0x113964[_0x1cb9('0xa')]('/api/voice/mohs',require(_0x1cb9('0x29')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x2a'),require(_0x1cb9('0x2b')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x2c'),require(_0x1cb9('0x2d')));_0x113964[_0x1cb9('0xa')]('/api/screen/recordings',require(_0x1cb9('0x2e')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x2f'),require(_0x1cb9('0x30')));_0x113964['use']('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x31'),require(_0x1cb9('0x32')));_0x113964[_0x1cb9('0xa')]('/api/voice/dials/reports',require(_0x1cb9('0x33')));_0x113964['use'](_0x1cb9('0x34'),require(_0x1cb9('0x35')));_0x113964['use'](_0x1cb9('0x36'),require(_0x1cb9('0x37')));_0x113964[_0x1cb9('0xa')]('/api/members/reports',require('./api/memberReport'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x38'),require('./api/trunk'));_0x113964[_0x1cb9('0xa')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x39'),require('./api/mailServerOut'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x3a'),require(_0x1cb9('0x3b')));_0x113964[_0x1cb9('0xa')]('/api/mail/queues',require('./api/mailQueue'));_0x113964['use'](_0x1cb9('0x3c'),require(_0x1cb9('0x3d')));_0x113964[_0x1cb9('0xa')]('/api/mail/interactions',require(_0x1cb9('0x3e')));_0x113964['use'](_0x1cb9('0x3f'),require(_0x1cb9('0x40')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x41'),require(_0x1cb9('0x42')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x43'),require(_0x1cb9('0x44')));_0x113964[_0x1cb9('0xa')]('/api/dashboards',require(_0x1cb9('0x45')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x46'),require(_0x1cb9('0x47')));_0x113964['use'](_0x1cb9('0x48'),require('./api/faxAccount'));_0x113964[_0x1cb9('0xa')]('/api/fax/applications',require(_0x1cb9('0x49')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x4a'),require(_0x1cb9('0x4b')));_0x113964[_0x1cb9('0xa')]('/api/fax/messages',require('./api/faxMessage'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x4c'),require('./api/faxQueue'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x4d'),require(_0x1cb9('0x4e')));_0x113964['use']('/api/sms/accounts',require('./api/smsAccount'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x4f'),require(_0x1cb9('0x50')));_0x113964['use'](_0x1cb9('0x51'),require(_0x1cb9('0x52')));_0x113964['use'](_0x1cb9('0x53'),require(_0x1cb9('0x54')));_0x113964['use'](_0x1cb9('0x55'),require(_0x1cb9('0x56')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x57'),require(_0x1cb9('0x58')));_0x113964['use'](_0x1cb9('0x59'),require(_0x1cb9('0x5a')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x5b'),require(_0x1cb9('0x5c')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x5d'),require(_0x1cb9('0x5e')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x5f'),require(_0x1cb9('0x60')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x61'),require('./api/chatWebsite'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x62'),require(_0x1cb9('0x63')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x64'),require(_0x1cb9('0x65')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x66'),require(_0x1cb9('0x67')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x68'),require('./api/chatMessage'));_0x113964['use'](_0x1cb9('0x69'),require(_0x1cb9('0x6a')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x6b'),require(_0x1cb9('0x6c')));_0x113964['use'](_0x1cb9('0x6d'),require(_0x1cb9('0x6e')));_0x113964['use']('/api/chat/proactive_actions',require(_0x1cb9('0x6f')));_0x113964['use'](_0x1cb9('0x70'),require(_0x1cb9('0x71')));_0x113964['use']('/api/cm/contacts',require(_0x1cb9('0x72')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x73'),require(_0x1cb9('0x74')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x75'),require(_0x1cb9('0x76')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x77'),require('./api/cmHopperFinal'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x78'),require(_0x1cb9('0x79')));_0x113964[_0x1cb9('0xa')]('/api/cm/custom_fields',require(_0x1cb9('0x7a')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x7b'),require('./api/action'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x7c'),require('./api/automation'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x7d'),require(_0x1cb9('0x7e')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x7f'),require(_0x1cb9('0x80')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x81'),require(_0x1cb9('0x82')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x83'),require(_0x1cb9('0x84')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x85'),require(_0x1cb9('0x86')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x87'),require('./api/cdr'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x88'),require(_0x1cb9('0x89')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x8a'),require('./api/schedule'));_0x113964['use'](_0x1cb9('0x8b'),require(_0x1cb9('0x8c')));_0x113964[_0x1cb9('0xa')]('/api/tags',require(_0x1cb9('0x8d')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x8e'),require(_0x1cb9('0x8f')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x90'),require(_0x1cb9('0x91')));_0x113964['use'](_0x1cb9('0x92'),require(_0x1cb9('0x93')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x94'),require(_0x1cb9('0x95')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x96'),require('./api/integrationReport'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x97'),require(_0x1cb9('0x98')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x99'),require(_0x1cb9('0x9a')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x9b'),require('./api/analyticExtractedReport'));_0x113964['use'](_0x1cb9('0x9c'),require(_0x1cb9('0x9d')));_0x113964[_0x1cb9('0xa')]('/api/analytics/field_reports',require(_0x1cb9('0x9e')));_0x113964['use'](_0x1cb9('0x9f'),require(_0x1cb9('0xa0')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xa1'),require(_0x1cb9('0xa2')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xa3'),require(_0x1cb9('0xa4')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xa5'),require('./api/intSalesforceField'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xa6'),require(_0x1cb9('0xa7')));_0x113964['use'](_0x1cb9('0xa8'),require(_0x1cb9('0xa9')));_0x113964['use'](_0x1cb9('0xaa'),require(_0x1cb9('0xab')));_0x113964[_0x1cb9('0xa')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x113964['use'](_0x1cb9('0xac'),require('./api/intDeskConfiguration'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xad'),require(_0x1cb9('0xae')));_0x113964[_0x1cb9('0xa')]('/api/integrations/zoho/accounts',require(_0x1cb9('0xaf')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xb0'),require('./api/intZohoConfiguration'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xb1'),require(_0x1cb9('0xb2')));_0x113964[_0x1cb9('0xa')]('/api/integrations/zendesk/accounts',require(_0x1cb9('0xb3')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xb4'),require('./api/intZendeskConfiguration'));_0x113964['use'](_0x1cb9('0xb5'),require(_0x1cb9('0xb6')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xb7'),require(_0x1cb9('0xb8')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xb9'),require(_0x1cb9('0xba')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xbb'),require(_0x1cb9('0xbc')));_0x113964[_0x1cb9('0xa')]('/api/integrations/vtiger/accounts',require(_0x1cb9('0xbd')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xbe'),require(_0x1cb9('0xbf')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xc0'),require(_0x1cb9('0xc1')));_0x113964['use'](_0x1cb9('0xc2'),require(_0x1cb9('0xc3')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xc4'),require(_0x1cb9('0xc5')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xc6'),require(_0x1cb9('0xc7')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xc8'),require(_0x1cb9('0xc9')));_0x113964['use'](_0x1cb9('0xca'),require(_0x1cb9('0xcb')));_0x113964['use']('/api/integrations/dynamics365/fields',require(_0x1cb9('0xcc')));_0x113964['use'](_0x1cb9('0xcd'),require(_0x1cb9('0xce')));_0x113964['use'](_0x1cb9('0xcf'),require('./api/intFreshsalesConfiguration'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xd0'),require(_0x1cb9('0xd1')));_0x113964['use'](_0x1cb9('0xd2'),require(_0x1cb9('0xd3')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xd4'),require(_0x1cb9('0xd5')));_0x113964[_0x1cb9('0xa')]('/api/chat/internal/messages',require(_0x1cb9('0xd6')));_0x113964['use'](_0x1cb9('0xd7'),require(_0x1cb9('0xd8')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xd9'),require('./api/jscriptyQuestionReport'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xda'),require(_0x1cb9('0xdb')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xdc'),require(_0x1cb9('0xdd')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xde'),require(_0x1cb9('0xdf')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xe0'),require(_0x1cb9('0xe1')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xe2'),require(_0x1cb9('0xe3')));_0x113964['use']('/api/settings',require(_0x1cb9('0xe4')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xe5'),require(_0x1cb9('0xe6')));_0x113964[_0x1cb9('0xa')]('/api/square/projects',require(_0x1cb9('0xe7')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xe8'),require(_0x1cb9('0xe9')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xea'),require(_0x1cb9('0xeb')));_0x113964['use']('/api/teams',require('./api/team'));_0x113964[_0x1cb9('0xa')]('/api/license',require(_0x1cb9('0xec')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xed'),require(_0x1cb9('0xee')));_0x113964['use']('/api/migrations',require(_0x1cb9('0xef')));_0x113964['use'](_0x1cb9('0xf0'),require(_0x1cb9('0xf1')));_0x113964[_0x1cb9('0xa')]('/api/plugins',require('./api/plugin'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xf2'),require(_0x1cb9('0xf3')));_0x113964[_0x1cb9('0xa')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xf4'),require(_0x1cb9('0xf5')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xf6'),require(_0x1cb9('0xf7')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xf8'),require(_0x1cb9('0xf9')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xfa'),require('./api/cmList'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xfb'),require(_0x1cb9('0xfc')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xfd'),require(_0x1cb9('0xfe')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0xff'),require(_0x1cb9('0x100')));_0x113964['use'](_0x1cb9('0x101'),require(_0x1cb9('0x102')));_0x113964['use'](_0x1cb9('0x103'),require('./api/userNotification'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x104'),require(_0x1cb9('0x105')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x106'),require(_0x1cb9('0x107')));_0x113964[_0x1cb9('0xa')]('/api/whatsapp/interactions',require(_0x1cb9('0x108')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x109'),require(_0x1cb9('0x10a')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x10b'),require(_0x1cb9('0x10c')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x10d'),require(_0x1cb9('0x10e')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x10f'),require(_0x1cb9('0x110')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x111'),require('./api/cloudProvider'));_0x113964[_0x1cb9('0xa')]('/api/realtime',require('./api/realtime'));_0x113964['use'](_0x1cb9('0x112'),require(_0x1cb9('0x113')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x114'),require(_0x1cb9('0x115')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x116'),require(_0x1cb9('0x117')));_0x113964[_0x1cb9('0xa')]('/api/rpc',require('./api/rpc'));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x118'),require(_0x1cb9('0x119')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x11a'),require(_0x1cb9('0x11b')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x11c'),require(_0x1cb9('0x11d')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x11e'),require(_0x1cb9('0x11f')));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x120'),express[_0x1cb9('0x121')](path['join'](config[_0x1cb9('0x122')],_0x1cb9('0x120'))));_0x113964['use'](_0x1cb9('0x123'),express[_0x1cb9('0x121')](path[_0x1cb9('0x124')](config[_0x1cb9('0x122')],_0x1cb9('0x123'))));_0x113964['use'](_0x1cb9('0x125'),express[_0x1cb9('0x121')](path[_0x1cb9('0x124')](config[_0x1cb9('0x122')],_0x1cb9('0x125'))));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x126'),express[_0x1cb9('0x121')](path['join'](config[_0x1cb9('0x122')],_0x1cb9('0x127'),_0x1cb9('0x128'))));_0x113964[_0x1cb9('0xa')](_0x1cb9('0x129'),express[_0x1cb9('0x121')](path['join'](config['root'],_0x1cb9('0x12a'))));_0x113964[_0x1cb9('0x12b')](_0x1cb9('0x12c'))['get'](errors[0x194]);_0x113964['route']('/*')[_0x1cb9('0x12d')](function(_0x1d6c06,_0x27cf30){_0x27cf30[_0x1cb9('0x12e')](path['resolve'](_0x113964['get']('appPath')+_0x1cb9('0x12f')));});};var sensitiveFields=[_0x1cb9('0x130'),_0x1cb9('0x131'),_0x1cb9('0x132'),'apiKey',_0x1cb9('0x133'),_0x1cb9('0x134'),'street',_0x1cb9('0x135'),_0x1cb9('0x136'),_0x1cb9('0x137'),_0x1cb9('0x138'),_0x1cb9('0x139'),_0x1cb9('0x13a'),'securityToken',_0x1cb9('0x13b'),'accessKey','tenantId',_0x1cb9('0x13c'),_0x1cb9('0x13d'),_0x1cb9('0x13e'),'accessTokenSecret',_0x1cb9('0x13f'),_0x1cb9('0x140'),_0x1cb9('0x141'),_0x1cb9('0x142'),_0x1cb9('0x143'),_0x1cb9('0x144'),_0x1cb9('0x145'),_0x1cb9('0x146'),_0x1cb9('0x147'),_0x1cb9('0x148'),_0x1cb9('0x149'),_0x1cb9('0x14a'),_0x1cb9('0x14b'),_0x1cb9('0x15'),_0x1cb9('0x14c'),_0x1cb9('0x14d'),_0x1cb9('0x14e'),_0x1cb9('0x14f'),_0x1cb9('0x150'),_0x1cb9('0x151'),_0x1cb9('0x152')];function maskSensitiveData(_0x3c726f){var _0x3745c1=/(?!^)[\s\S](?!$)/g;if(!_[_0x1cb9('0x153')](_0x3c726f))return;for(var _0x5bf81e in _0x3c726f){if(_[_0x1cb9('0x154')](_0x3c726f[_0x5bf81e])){for(var _0xd6672e=0x0;_0xd6672e<_0x3c726f[_0x5bf81e]['length'];_0xd6672e++){maskSensitiveData(_0x3c726f[_0x5bf81e][_0xd6672e]);}}else if(_['isPlainObject'](_0x3c726f[_0x5bf81e])){maskSensitiveData(_0x3c726f[_0x5bf81e]);}else if(_['isString'](_0x3c726f[_0x5bf81e])){_0x3c726f[_0x5bf81e]=_0x3c726f[_0x5bf81e]['replace'](/{{{/g,'@@{')[_0x1cb9('0x155')](/}}}/g,_0x1cb9('0x156'))[_0x1cb9('0x155')](/{{/g,'@{')[_0x1cb9('0x155')](/}}/g,'}@');if(_[_0x1cb9('0x157')](sensitiveFields,_0x5bf81e)){_0x3c726f[_0x5bf81e]=_0x3c726f[_0x5bf81e]['replace'](_0x3745c1,'*');}}}}
\ No newline at end of file
index ffca243..2cf540c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5896=['merge','../api/user/user.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/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/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.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/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0x5896,0x1f4));var _0x6589=function(_0x4987fc,_0x582842){_0x4987fc=_0x4987fc-0x0;var _0xe5a68d=_0x5896[_0x4987fc];return _0xe5a68d;};'use strict';var jayson=require(_0x6589('0x0'));var BPromise=require(_0x6589('0x1'));var _=require('lodash');var config=require(_0x6589('0x2'));exports[_0x6589('0x3')]=function(){return new BPromise(function(_0x241b5b,_0x222274){var _0x41c3f6={};_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x5')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceExtension/voiceExtension.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/voiceQueue/voiceQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceRecording/voiceRecording.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x6')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x7')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x8')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/memberReport/memberReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/trunk/trunk.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x9')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xa')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xb')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0xc')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/mailQueue/mailQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xd')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xe')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0xf')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x10')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x11')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x12')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x13')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x14')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x15')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x16')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x17')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x18')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x19')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x1a')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x1f')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x20')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/chatQueue/chatQueue.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x21')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/cmHopper/cmHopper.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x22')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x23')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x24')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x25')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x26')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x27')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x28')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x29')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x2a')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x2b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x2f')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x30')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x31')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x32')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x33')));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x34')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x35')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/squareReport/squareReport.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x36')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/setting/setting.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x37')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x38')));_0x41c3f6=_['merge'](_0x41c3f6,require('../api/squareRecording/squareRecording.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/squareMessage/squareMessage.rpc'));_0x41c3f6=_['merge'](_0x41c3f6,require(_0x6589('0x39')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3a')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3b')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3c')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3d')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require(_0x6589('0x3e')));_0x41c3f6=_[_0x6589('0x4')](_0x41c3f6,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x453285=jayson[_0x6589('0x3f')](_0x41c3f6)[_0x6589('0x40')]();var _0x2e1675=config[_0x6589('0x41')]['port']||config['port']+0x1;var _0x3632d2=config[_0x6589('0x41')]['ip']||_0x6589('0x42');_0x453285['on'](_0x6589('0x43'),function(_0x176793){return _0x222274(_0x176793);});_0x453285[_0x6589('0x3')](_0x2e1675,_0x3632d2,function(){console[_0x6589('0x44')](_0x6589('0x45'),_0x3632d2,_0x2e1675);require('../config/triggers')[_0x6589('0x46')]();return _0x241b5b(_0x6589('0x47')+_0x3632d2+':'+_0x2e1675);});});};
\ No newline at end of file
+var _0x88c5=['../api/pause/pause.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/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.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/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc'];(function(_0x73e5b0,_0x241ec0){var _0x23ed6f=function(_0x12825c){while(--_0x12825c){_0x73e5b0['push'](_0x73e5b0['shift']());}};_0x23ed6f(++_0x241ec0);}(_0x88c5,0xe6));var _0x588c=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x88c5[_0x44b7d6];return _0x5346f0;};'use strict';var jayson=require(_0x588c('0x0'));var BPromise=require(_0x588c('0x1'));var _=require(_0x588c('0x2'));var config=require(_0x588c('0x3'));exports[_0x588c('0x4')]=function(){return new BPromise(function(_0x105205,_0x6900cf){var _0x5dcdde={};_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x5')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x7')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x8')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x9')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0xa')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0xb')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0xc')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0xd')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0xe')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0xf')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x10')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x11')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/mailQueue/mailQueue.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x12')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x13')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/mailApplication/mailApplication.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/faxAccount/faxAccount.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x14')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/faxInteraction/faxInteraction.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x15')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/faxQueue/faxQueue.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x16')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x17')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x18')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x19')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x1a')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x1b')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x1c')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x1d')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x1e')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/chatMessage/chatMessage.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x1f')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x20')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x21')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x22')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x23')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x24')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x25')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x26')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/sound/sound.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x27')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x28')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x29')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x2a')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x2b')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x2c')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x2d')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x2e')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x2f')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x30')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x31')));_0x5dcdde=_['merge'](_0x5dcdde,require(_0x588c('0x32')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x33')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/setting/setting.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x34')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x35')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/squareRecording/squareRecording.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x36')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x37')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x38')));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/plugin/plugin.rpc'));_0x5dcdde=_['merge'](_0x5dcdde,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x39')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x3a')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x3b')));_0x5dcdde=_[_0x588c('0x6')](_0x5dcdde,require(_0x588c('0x3c')));var _0x4b91bd=jayson['server'](_0x5dcdde)[_0x588c('0x3d')]();var _0x4d58a8=config[_0x588c('0x3e')]['port']||config['port']+0x1;var _0x53f53b=config[_0x588c('0x3e')]['ip']||_0x588c('0x3f');_0x4b91bd['on']('error',function(_0x425b91){return _0x6900cf(_0x425b91);});_0x4b91bd['listen'](_0x4d58a8,_0x53f53b,function(){console['log'](_0x588c('0x40'),_0x53f53b,_0x4d58a8);require(_0x588c('0x41'))['default']();return _0x105205(_0x588c('0x42')+_0x53f53b+':'+_0x4d58a8);});});};
\ No newline at end of file
index fe75c83..9288d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string','replace'];(function(_0x446455,_0x19af51){var _0x57b6c8=function(_0xacf350){while(--_0xacf350){_0x446455['push'](_0x446455['shift']());}};_0x57b6c8(++_0x19af51);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x4a04c7){return _0x4a04c7==='{{'?_0x3342('0x0'):_0x3342('0x1');}function safeTemplate(_0x3477de){var _0x3b763d=_0x3477de;if(typeof _0x3477de===_0x3342('0x2')){_0x3b763d=_0x3477de[_0x3342('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3342('0x4')](_0x3477de)){_0x3b763d=_0x3477de[_0x3342('0x5')](function(_0x3075f8){return safeTemplate(_0x3075f8);});}else if(_[_0x3342('0x6')](_0x3477de)){_0x3b763d=Object[_0x3342('0x7')](_0x3477de)[_0x3342('0x8')](function(_0x29c40c,_0x420d4b){_0x29c40c[_0x420d4b]=safeTemplate(_0x3477de[_0x420d4b]);return _0x29c40c;},{});}return _0x3b763d;}module[_0x3342('0x9')][_0x3342('0xa')]=safeTemplate;
\ No newline at end of file
+var _0x3266=['\x20}\x20}','string','replace','isArray','keys','reduce','exports','lodash','{\x20{\x20'];(function(_0x9c0dee,_0x14d33c){var _0x1547d9=function(_0x5f29a1){while(--_0x5f29a1){_0x9c0dee['push'](_0x9c0dee['shift']());}};_0x1547d9(++_0x14d33c);}(_0x3266,0x6a));var _0x6326=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x3266[_0x209941];return _0x1e8729;};var _=require(_0x6326('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2b328d){return _0x2b328d==='{{'?_0x6326('0x1'):_0x6326('0x2');}function safeTemplate(_0x545df7){var _0x6b67c0=_0x545df7;if(typeof _0x545df7===_0x6326('0x3')){_0x6b67c0=_0x545df7[_0x6326('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6326('0x5')](_0x545df7)){_0x6b67c0=_0x545df7['map'](function(_0x30b22e){return safeTemplate(_0x30b22e);});}else if(_['isPlainObject'](_0x545df7)){_0x6b67c0=Object[_0x6326('0x6')](_0x545df7)[_0x6326('0x7')](function(_0x14208e,_0x5402e5){_0x14208e[_0x5402e5]=safeTemplate(_0x545df7[_0x5402e5]);return _0x14208e;},{});}return _0x6b67c0;}module[_0x6326('0x8')]['safeTemplate']=safeTemplate;
\ No newline at end of file
index 2c58ee8..c6e2218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42fa=['hangup','520-Invalid','search','520\x20End\x20of\x20proper','substring','replace','result=','indexOf','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','extension','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','label','util','lodash','./reply','./error','call','utf8','setTimeout','headers','emit','ready','line','toLowerCase'];(function(_0x465c3b,_0x384cf1){var _0x67f5d8=function(_0x4dbbaf){while(--_0x4dbbaf){_0x465c3b['push'](_0x465c3b['shift']());}};_0x67f5d8(++_0x384cf1);}(_0x42fa,0x161));var _0xa42f=function(_0x3734ca,_0x554044){_0x3734ca=_0x3734ca-0x0;var _0xc17aa2=_0x42fa[_0x3734ca];return _0xc17aa2;};'use strict';var util=require(_0xa42f('0x0'));var _=require(_0xa42f('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0xa42f('0x2'));var AGIError=require(_0xa42f('0x3'));function AGIChannel(_0x4001b5){var _0xe7cc95=this,_0x365971=new AGIReply(),_0x657df3=![],_0x3aabbe={};EventEmitter[_0xa42f('0x4')](_0xe7cc95);_0x4001b5['setEncoding'](_0xa42f('0x5'));_0x4001b5[_0xa42f('0x6')](0x8*0x3c*0x3c*0x3e8);_0x365971['setEncoding'](_0xa42f('0x5'));_0x365971['on'](_0xa42f('0x7'),function(_0x2376f0){for(var _0x2638cf in _0x2376f0){_0xe7cc95[_0x2638cf]=_0x2376f0[_0x2638cf];}_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x9'));});_0x365971['on'](_0xa42f('0xa'),function(_0x304f50){if(_0x304f50[_0xa42f('0xb')]()==_0xa42f('0xc')){_0xe7cc95[_0xa42f('0x8')]('hangup');return;}if(_0x304f50['substring'](0x0,0xb)==_0xa42f('0xd')){_0x657df3=!![];}if(_0x657df3){_0x3aabbe['rx']+=_0x304f50+'\x0a';if(_0x304f50[_0xa42f('0xe')](_0xa42f('0xf'))!=-0x1){_0x657df3=![];}}else{_0x3aabbe['rx']=_0x304f50;}if(_0x657df3){return;}if(typeof _0x3aabbe['cb']=='function'){var _0x2c9cb4=_0x3aabbe['rx'][_0xa42f('0x10')](0x0,0x3),_0x362b83=null,_0x4eeca9=null;_0x2c9cb4=parseInt(_0x2c9cb4);if(isNaN(_0x2c9cb4)){_0x3aabbe['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x2c9cb4!=0xc8){_0x3aabbe['cb'](null,{'code':_0x2c9cb4,'result':-0x1,'extra':'KO'});return;}_0x362b83=_0x3aabbe['rx']['substring'](0x4)[_0xa42f('0x11')](_0xa42f('0x12'),'');if(_0x362b83[_0xa42f('0x13')]('\x20')!=-0x1){_0x362b83=_0x362b83['substr'](0x0,_0x362b83[_0xa42f('0x13')]('\x20'));}if(_['startsWith'](_0x362b83,'-1')){_0x362b83=parseInt(_0x362b83);}_0x4eeca9=_0x3aabbe['rx'][_0xa42f('0x14')]('\x20');if(_0x4eeca9['length']==0x3){_0x4eeca9=_0x4eeca9[0x2][_0xa42f('0x10')](0x1,_0x4eeca9[0x2][_0xa42f('0x15')]-0x1);}else if(_0x4eeca9[_0xa42f('0x15')]>0x3){var _0x313373=/\((.+)\)/;var _0x1c9400=_0x3aabbe['rx'][_0xa42f('0x16')](_0x313373);if(_0x1c9400){_0x4eeca9=_0x1c9400[0x1];}else{_0x4eeca9=null;}}else{_0x4eeca9=null;}_0x3aabbe['cb'](null,{'code':_0x2c9cb4,'result':_0x362b83,'extra':_0x4eeca9});}});_0x4001b5['on']('error',function(_0x289efd){_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x17'),new AGIError('E_AGI_SOCKET_ERROR',_0x289efd[_0xa42f('0x18')]));});_0x4001b5['on'](_0xa42f('0x19'),function(){_0xe7cc95['emit'](_0xa42f('0x19'),new AGIError(_0xa42f('0x1a')));});_0x4001b5['on'](_0xa42f('0x1b'),function(){_0xe7cc95[_0xa42f('0x8')](_0xa42f('0x1b'),new AGIError(_0xa42f('0x1c')));_0x4001b5[_0xa42f('0x1d')]();});_0x4001b5[_0xa42f('0x1e')](_0x365971);this['command']=function(_0xe42cde,_0x42ff90){var _0xe42cde=_0xe42cde||'',_0x42ff90=typeof _0x42ff90==_0xa42f('0x1f')?_0x42ff90:new Function();_0x3aabbe={'tx':_0xe42cde,'rx':'','cb':_0x42ff90};_0x4001b5[_0xa42f('0x20')](_0xe42cde+'\x0a');},this[_0xa42f('0x19')]=function(){_0x4001b5[_0xa42f('0x1d')]();};}util[_0xa42f('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xa42f('0x22')][_0xa42f('0x23')]=function(_0x363bce){return this[_0xa42f('0x24')][_0xa42f('0x25')](this,_0x363bce);};AGIChannel[_0xa42f('0x22')][_0xa42f('0x26')]=function(){return this[_0xa42f('0x23')](_0xa42f('0x27'));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x28')]=function(_0x3a8f11,_0x114e00,_0x1c03fa){_0x3a8f11=_0x3a8f11===undefined?_0xa42f('0x29'):_0x3a8f11;_0x114e00=_0x114e00===undefined?'5':_0x114e00;_0x1c03fa=_0x1c03fa===undefined?'1':_0x1c03fa;return this[_0xa42f('0x23')](util['format'](_0xa42f('0x2a'),_0x3a8f11,_0x114e00*0x3e8,_0x1c03fa));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x2b')]=function(_0x298512){_0x298512=_0x298512||_0xa42f('0x2c');return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x2e'),_0x298512));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x2f')]=function(_0xae7e64,_0x5b8577){if(_[_0xa42f('0x30')](_0x5b8577)){return this['sendRequest'](util[_0xa42f('0x2d')]('EXEC\x20%s\x20%s',_0xae7e64,_0x5b8577[_0xa42f('0x31')](',')));}return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x32'),_0xae7e64,_0x5b8577));};AGIChannel[_0xa42f('0x22')]['setContext']=function(_0x2ff3e5){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SET\x20CONTEXT\x20%s',_0x2ff3e5));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x33')]=function(_0x3d11d9){return this[_0xa42f('0x23')](util['format']('SET\x20EXTENSION\x20%s',_0x3d11d9));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x34')]=function(_0x1fedf9){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x35'),_0x1fedf9));};AGIChannel['prototype'][_0xa42f('0xc')]=function(){return this[_0xa42f('0x23')](_0xa42f('0x36'));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x37')]=function(_0x3beecb,_0x13afaa){var _0x3c1647=_['isBoolean'](_0x13afaa)||_[_0xa42f('0x38')](_0x13afaa)?_0x13afaa[_0xa42f('0x39')]():_0x13afaa;return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3beecb,_0x3c1647?_0x3c1647[_0xa42f('0x39')]()[_0xa42f('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xa42f('0x3a')]=function(_0x5af5c1,_0x4f67fb){return this[_0xa42f('0x23')](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x5af5c1,_0x4f67fb));};AGIChannel['prototype'][_0xa42f('0x3b')]=function(_0x951e48,_0x5c05c8){return this[_0xa42f('0x23')](util['format'](_0xa42f('0x3c'),_0x951e48,_0x5c05c8));};AGIChannel[_0xa42f('0x22')]['sayPhonetic']=function(_0x134086,_0x491f18){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x134086,_0x491f18));};AGIChannel[_0xa42f('0x22')]['continueAt']=function(_0x2211f6,_0x7f6e63,_0x3f3984){_0x7f6e63=_0x7f6e63||this[_0xa42f('0x3d')];_0x3f3984=_0x3f3984||0x1;this[_0xa42f('0x3e')](_0x2211f6);this['setExtension'](_0x7f6e63);this[_0xa42f('0x34')](_0x3f3984);return this[_0xa42f('0x2b')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x2211f6,_0x7f6e63,_0x3f3984));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x3f')]=function(_0x130bcf){return this[_0xa42f('0x23')](util[_0xa42f('0x2d')](_0xa42f('0x40'),_0x130bcf));};AGIChannel[_0xa42f('0x22')][_0xa42f('0x41')]=function(_0x10b315,_0x381422,_0x46ad2b,_0x463283,_0xdabb50,_0x3d7c5b){_0x381422=_0x381422||'wav';_0x46ad2b=_0x46ad2b||'';_0x463283=_0x463283===undefined?-0x1:_0x463283==='-1'?-0x1:_0x463283*0x3e8;_0xdabb50=_0xdabb50===undefined?'':'s='+_0xdabb50;_0x3d7c5b=_0x3d7c5b?_0xa42f('0x42'):'';return this['sendRequest'](util['format'](_0xa42f('0x43'),_0x10b315,_0x381422,_0x46ad2b,_0x463283,_0x3d7c5b,_0xdabb50));};AGIChannel['prototype'][_0xa42f('0x44')]=function(_0x5c548b,_0x55e14e){_0x55e14e=_0x55e14e||'';return this['sendRequest'](util[_0xa42f('0x2d')](_0xa42f('0x45'),_0x5c548b,_0x55e14e));};AGIChannel['prototype'][_0xa42f('0x46')]=function(_0x24ff7f){return this[_0xa42f('0x2f')]('AGI',_0x24ff7f);};AGIChannel['prototype'][_0xa42f('0x47')]=function(_0x29f6eb){return this[_0xa42f('0x2f')]('WAIT',_0x29f6eb);};AGIChannel['prototype'][_0xa42f('0x17')]=function(_0x13edad,_0x26fd6d){this[_0xa42f('0x2b')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x13edad['id'],_0x13edad[_0xa42f('0x48')],_0x26fd6d));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xed5f=['join','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','setExtension','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits','sync','prototype','answer','sendRequest','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s'];(function(_0x134a33,_0x9afe8){var _0x5df4dc=function(_0x54b5cd){while(--_0x54b5cd){_0x134a33['push'](_0x134a33['shift']());}};_0x5df4dc(++_0x9afe8);}(_0xed5f,0x1de));var _0xfed5=function(_0x40af5f,_0xeae3f7){_0x40af5f=_0x40af5f-0x0;var _0x529792=_0xed5f[_0x40af5f];return _0x529792;};'use strict';var util=require(_0xfed5('0x0'));var _=require('lodash');var EventEmitter=require(_0xfed5('0x1'))[_0xfed5('0x2')];var AGIReply=require(_0xfed5('0x3'));var AGIError=require(_0xfed5('0x4'));function AGIChannel(_0x4165ca){var _0x562d89=this,_0x2dee02=new AGIReply(),_0x19f842=![],_0x36702d={};EventEmitter[_0xfed5('0x5')](_0x562d89);_0x4165ca[_0xfed5('0x6')](_0xfed5('0x7'));_0x4165ca[_0xfed5('0x8')](0x8*0x3c*0x3c*0x3e8);_0x2dee02[_0xfed5('0x6')](_0xfed5('0x7'));_0x2dee02['on']('headers',function(_0x46bfa4){for(var _0x409118 in _0x46bfa4){_0x562d89[_0x409118]=_0x46bfa4[_0x409118];}_0x562d89[_0xfed5('0x9')]('ready');});_0x2dee02['on'](_0xfed5('0xa'),function(_0x5b31c8){if(_0x5b31c8[_0xfed5('0xb')]()==_0xfed5('0xc')){_0x562d89[_0xfed5('0x9')](_0xfed5('0xc'));return;}if(_0x5b31c8[_0xfed5('0xd')](0x0,0xb)==_0xfed5('0xe')){_0x19f842=!![];}if(_0x19f842){_0x36702d['rx']+=_0x5b31c8+'\x0a';if(_0x5b31c8[_0xfed5('0xf')](_0xfed5('0x10'))!=-0x1){_0x19f842=![];}}else{_0x36702d['rx']=_0x5b31c8;}if(_0x19f842){return;}if(typeof _0x36702d['cb']==_0xfed5('0x11')){var _0x472cb6=_0x36702d['rx']['substring'](0x0,0x3),_0x18671f=null,_0x178cf1=null;_0x472cb6=parseInt(_0x472cb6);if(isNaN(_0x472cb6)){_0x36702d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xfed5('0x12')});return;}if(_0x472cb6!=0xc8){_0x36702d['cb'](null,{'code':_0x472cb6,'result':-0x1,'extra':'KO'});return;}_0x18671f=_0x36702d['rx'][_0xfed5('0xd')](0x4)[_0xfed5('0x13')]('result=','');if(_0x18671f[_0xfed5('0x14')]('\x20')!=-0x1){_0x18671f=_0x18671f['substr'](0x0,_0x18671f[_0xfed5('0x14')]('\x20'));}if(_['startsWith'](_0x18671f,'-1')){_0x18671f=parseInt(_0x18671f);}_0x178cf1=_0x36702d['rx']['split']('\x20');if(_0x178cf1['length']==0x3){_0x178cf1=_0x178cf1[0x2][_0xfed5('0xd')](0x1,_0x178cf1[0x2][_0xfed5('0x15')]-0x1);}else if(_0x178cf1['length']>0x3){var _0x4bae21=/\((.+)\)/;var _0x56351f=_0x36702d['rx'][_0xfed5('0x16')](_0x4bae21);if(_0x56351f){_0x178cf1=_0x56351f[0x1];}else{_0x178cf1=null;}}else{_0x178cf1=null;}_0x36702d['cb'](null,{'code':_0x472cb6,'result':_0x18671f,'extra':_0x178cf1});}});_0x4165ca['on'](_0xfed5('0x17'),function(_0x2301e8){_0x562d89[_0xfed5('0x9')]('error',new AGIError(_0xfed5('0x18'),_0x2301e8[_0xfed5('0x19')]));});_0x4165ca['on'](_0xfed5('0x1a'),function(){_0x562d89[_0xfed5('0x9')](_0xfed5('0x1a'),new AGIError(_0xfed5('0x1b')));});_0x4165ca['on'](_0xfed5('0x1c'),function(){_0x562d89[_0xfed5('0x9')](_0xfed5('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4165ca[_0xfed5('0x1d')]();});_0x4165ca[_0xfed5('0x1e')](_0x2dee02);this[_0xfed5('0x1f')]=function(_0x488f38,_0x4a3b18){var _0x488f38=_0x488f38||'',_0x4a3b18=typeof _0x4a3b18==_0xfed5('0x11')?_0x4a3b18:new Function();_0x36702d={'tx':_0x488f38,'rx':'','cb':_0x4a3b18};_0x4165ca[_0xfed5('0x20')](_0x488f38+'\x0a');},this[_0xfed5('0x1a')]=function(){_0x4165ca[_0xfed5('0x1d')]();};}util[_0xfed5('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x4f662d){return this[_0xfed5('0x1f')][_0xfed5('0x22')](this,_0x4f662d);};AGIChannel[_0xfed5('0x23')][_0xfed5('0x24')]=function(){return this[_0xfed5('0x25')](_0xfed5('0x26'));};AGIChannel[_0xfed5('0x23')]['getData']=function(_0x303749,_0x2491a1,_0x3a76fb){_0x303749=_0x303749===undefined?_0xfed5('0x27'):_0x303749;_0x2491a1=_0x2491a1===undefined?'5':_0x2491a1;_0x3a76fb=_0x3a76fb===undefined?'1':_0x3a76fb;return this[_0xfed5('0x25')](util['format'](_0xfed5('0x28'),_0x303749,_0x2491a1*0x3e8,_0x3a76fb));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x29')]=function(_0x37280f){_0x37280f=_0x37280f||_0xfed5('0x2a');return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x2c'),_0x37280f));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x2d')]=function(_0x226aa6,_0xedd31a){if(_['isArray'](_0xedd31a)){return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x2e'),_0x226aa6,_0xedd31a[_0xfed5('0x2f')](',')));}return this['sendRequest'](util[_0xfed5('0x2b')]('EXEC\x20%s\x20%s',_0x226aa6,_0xedd31a));};AGIChannel['prototype']['setContext']=function(_0x19d063){return this[_0xfed5('0x25')](util[_0xfed5('0x2b')]('SET\x20CONTEXT\x20%s',_0x19d063));};AGIChannel[_0xfed5('0x23')]['setExtension']=function(_0x2345b1){return this['sendRequest'](util[_0xfed5('0x2b')]('SET\x20EXTENSION\x20%s',_0x2345b1));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x30')]=function(_0x4184a2){return this['sendRequest'](util[_0xfed5('0x2b')](_0xfed5('0x31'),_0x4184a2));};AGIChannel[_0xfed5('0x23')][_0xfed5('0xc')]=function(){return this[_0xfed5('0x25')](_0xfed5('0x32'));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x33')]=function(_0x556bb9,_0x32146){var _0x384d6d=_[_0xfed5('0x34')](_0x32146)||_[_0xfed5('0x35')](_0x32146)?_0x32146[_0xfed5('0x36')]():_0x32146;return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x37'),_0x556bb9,_0x384d6d?_0x384d6d['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x38')]=function(_0x5a19d7,_0xb3affe){return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x39'),_0x5a19d7,_0xb3affe));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x3a')]=function(_0x53b3bf,_0x5c40ea){return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x3b'),_0x53b3bf,_0x5c40ea));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x3c')]=function(_0x1d5562,_0x23c8dc){return this['sendRequest'](util[_0xfed5('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x1d5562,_0x23c8dc));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x3d')]=function(_0x67d64a,_0x9aaaea,_0x3e00c7){_0x9aaaea=_0x9aaaea||this[_0xfed5('0x3e')];_0x3e00c7=_0x3e00c7||0x1;this[_0xfed5('0x3f')](_0x67d64a);this[_0xfed5('0x40')](_0x9aaaea);this[_0xfed5('0x30')](_0x3e00c7);return this[_0xfed5('0x29')](util[_0xfed5('0x2b')]('GOTO\x20%s\x20%s\x20%s',_0x67d64a,_0x9aaaea,_0x3e00c7));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x41')]=function(_0x80870d){return this['sendRequest'](util[_0xfed5('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x80870d));};AGIChannel[_0xfed5('0x23')]['recordFile']=function(_0x14eb0f,_0x8abdb6,_0x24dd8c,_0x2a5018,_0x26d68a,_0x2b799d){_0x8abdb6=_0x8abdb6||_0xfed5('0x42');_0x24dd8c=_0x24dd8c||'';_0x2a5018=_0x2a5018===undefined?-0x1:_0x2a5018==='-1'?-0x1:_0x2a5018*0x3e8;_0x26d68a=_0x26d68a===undefined?'':'s='+_0x26d68a;_0x2b799d=_0x2b799d?_0xfed5('0x43'):'';return this[_0xfed5('0x25')](util['format'](_0xfed5('0x44'),_0x14eb0f,_0x8abdb6,_0x24dd8c,_0x2a5018,_0x2b799d,_0x26d68a));};AGIChannel[_0xfed5('0x23')][_0xfed5('0x45')]=function(_0x37390f,_0x4a5cd4){_0x4a5cd4=_0x4a5cd4||'';return this[_0xfed5('0x25')](util[_0xfed5('0x2b')](_0xfed5('0x46'),_0x37390f,_0x4a5cd4));};AGIChannel['prototype']['agi']=function(_0x23f0c7){return this[_0xfed5('0x2d')](_0xfed5('0x47'),_0x23f0c7);};AGIChannel[_0xfed5('0x23')][_0xfed5('0x48')]=function(_0x2c8f7a){return this['exec'](_0xfed5('0x49'),_0x2c8f7a);};AGIChannel[_0xfed5('0x23')][_0xfed5('0x17')]=function(_0x3e4b95,_0x11e490){this[_0xfed5('0x29')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3e4b95['id'],_0x3e4b95[_0xfed5('0x4a')],_0x11e490));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index 21904bf..ed96153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf465=['E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x1f9501,_0x26db9d){var _0x503adf=function(_0x29280d){while(--_0x29280d){_0x1f9501['push'](_0x1f9501['shift']());}};_0x503adf(++_0x26db9d);}(_0xf465,0x172));var _0x5f46=function(_0x2c4f3f,_0x266947){_0x2c4f3f=_0x2c4f3f-0x0;var _0x3d0234=_0xf465[_0x2c4f3f];return _0x3d0234;};'use strict';var util=require(_0x5f46('0x0'));var error={'E_AGI_UNDEFINED':_0x5f46('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x5f46('0x2'),'E_AGI_SERVER_CLOSE':_0x5f46('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x5f46('0x4'),'E_AGI_SOCKET_CLOSE':_0x5f46('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x5f46('0x6'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5f46('0x7')};function AGIError(_0x433860){var _0x433860=_0x433860||null,_0x61bfb2=_0x61bfb2||[],_0x130d06=0x1,_0xe04776='';if(!error[_0x433860]){_0x433860=_0x5f46('0x8');}_0x61bfb2[_0x5f46('0x9')](error[_0x433860]);while(arguments[_0x130d06]){_0x61bfb2[_0x5f46('0x9')](arguments[_0x130d06]);_0x130d06++;}_0xe04776=util[_0x5f46('0xa')]['apply'](util,_0x61bfb2);this[_0x5f46('0xb')]=_0xe04776;this[_0x5f46('0xc')]=_0x433860;}module[_0x5f46('0xd')]=AGIError;
\ No newline at end of file
+var _0xcaea=['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.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name'];(function(_0x488814,_0x3fec59){var _0x58138b=function(_0x575c59){while(--_0x575c59){_0x488814['push'](_0x488814['shift']());}};_0x58138b(++_0x3fec59);}(_0xcaea,0xa3));var _0xacae=function(_0xa988cc,_0x18ccbf){_0xa988cc=_0xa988cc-0x0;var _0x4470d9=_0xcaea[_0xa988cc];return _0x4470d9;};'use strict';var util=require(_0xacae('0x0'));var error={'E_AGI_UNDEFINED':_0xacae('0x1'),'E_AGI_ARGUMENT_PORT':_0xacae('0x2'),'E_AGI_SERVER_ERROR':_0xacae('0x3'),'E_AGI_SERVER_CLOSE':_0xacae('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xacae('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xacae('0x6'),'E_AGI_SOCKET_CLOSE':_0xacae('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xacae('0x8'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xacae('0x9'),'E_AGI_IVR_ENTRY':_0xacae('0xa')};function AGIError(_0x35ead7){var _0x35ead7=_0x35ead7||null,_0x34fd0b=_0x34fd0b||[],_0x35b531=0x1,_0x516ca2='';if(!error[_0x35ead7]){_0x35ead7=_0xacae('0xb');}_0x34fd0b[_0xacae('0xc')](error[_0x35ead7]);while(arguments[_0x35b531]){_0x34fd0b[_0xacae('0xc')](arguments[_0x35b531]);_0x35b531++;}_0x516ca2=util[_0xacae('0xd')][_0xacae('0xe')](util,_0x34fd0b);this[_0xacae('0xf')]=_0x516ca2;this[_0xacae('0x10')]=_0x35ead7;}module[_0xacae('0x11')]=AGIError;
\ No newline at end of file
index d33d901..6921149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f3f=['condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','info','default','invalid','includes'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0f3f,0x198));var _0xf0f3=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x0f3f[_0x2ee790];return _0x5a54a5;};'use strict';var _=require(_0xf0f3('0x0'));var logger=require(_0xf0f3('0x1'))('agi');var verticesWithRetry=[_0xf0f3('0x2'),_0xf0f3('0x3'),_0xf0f3('0x4')];var Graph=function(){this[_0xf0f3('0x5')]={};this[_0xf0f3('0x6')]={};this[_0xf0f3('0x7')]=0x0;};Graph['prototype']['addVertex']=function(_0x1442e3){this[_0xf0f3('0x5')][_0x1442e3['id']]=_0x1442e3;this[_0xf0f3('0x6')][_0x1442e3['id']]=[];};Graph[_0xf0f3('0x8')][_0xf0f3('0x9')]=function(_0x260880,_0x22e854,_0x5e2d3f){this[_0xf0f3('0x6')][_0x260880][_0xf0f3('0xa')]({'target':_0x22e854,'condition':_0x5e2d3f});this[_0xf0f3('0x7')]+=0x1;};Graph[_0xf0f3('0x8')][_0xf0f3('0xb')]=function(){return _['size'](this[_0xf0f3('0x5')]);};Graph[_0xf0f3('0x8')][_0xf0f3('0xc')]=function(){return this[_0xf0f3('0x7')];};Graph[_0xf0f3('0x8')][_0xf0f3('0xd')]=function(_0x32a2a5){return this[_0xf0f3('0x5')][_0x32a2a5];};Graph[_0xf0f3('0x8')][_0xf0f3('0xe')]=function(_0x5ce570,_0x5f95ee){if(!this[_0xf0f3('0x5')][_0x5ce570]){return logger['info'](_0xf0f3('0xf'));}var _0x184d75=_0x5f95ee(this[_0xf0f3('0x5')][_0x5ce570]);if(!_0x184d75){return logger['info']('stop\x20traverse');}if(this['edges'][_0x5ce570][_0xf0f3('0x10')]===0x0){return logger['info'](_0xf0f3('0x11'));}for(var _0xacba3b=0x0,_0x25e584=[],_0x33a44f=![];_0xacba3b<this['edges'][_0x5ce570][_0xf0f3('0x10')];_0xacba3b+=0x1){if(this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b][_0xf0f3('0x12')]){_0x25e584=this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b][_0xf0f3('0x12')][_0xf0f3('0x13')](',');for(var _0x5ddc88=0x0;_0x5ddc88<_0x25e584['length'];_0x5ddc88+=0x1){if(this['vertices'][_0x5ce570][_0xf0f3('0x14')]===_0xf0f3('0x15')&&_0x25e584[_0x5ddc88]==='-'){_0x33a44f=this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b][_0xf0f3('0x16')];logger[_0xf0f3('0x17')](_0xf0f3('0x18'),_0x25e584[_0x5ddc88],this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b]['target']);}else if(this[_0xf0f3('0x5')][_0x5ce570]['agicommand']===_0xf0f3('0x2')&&_0x25e584[_0x5ddc88]==='i'){_0x33a44f=this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b][_0xf0f3('0x16')];logger['info'](_0xf0f3('0x19'),_0x25e584[_0x5ddc88],this['edges'][_0x5ce570][_0xacba3b][_0xf0f3('0x16')]);}if(_0x25e584[_0x5ddc88]===_0x184d75){return this[_0xf0f3('0xe')](this['edges'][_0x5ce570][_0xacba3b][_0xf0f3('0x16')],_0x5f95ee);}}}else{return this[_0xf0f3('0xe')](this[_0xf0f3('0x6')][_0x5ce570][_0xacba3b][_0xf0f3('0x16')],_0x5f95ee);}}if(_0x25e584[_0xf0f3('0x10')]){if(this[_0xf0f3('0x5')][_0x5ce570][_0xf0f3('0x14')]==='vswitch'){if(_0x33a44f){return this[_0xf0f3('0xe')](_0x33a44f,_0x5f95ee);}return logger[_0xf0f3('0x17')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0xf0f3('0x1a')](verticesWithRetry,this[_0xf0f3('0x5')][_0x5ce570][_0xf0f3('0x14')])){if(_0x184d75==='-'){return logger[_0xf0f3('0x17')]('max\x20retry\x20reach');}if(_0x33a44f&&_0x184d75!=='t'){return this['traverseBFS'](_0x33a44f,_0x5f95ee);}return this[_0xf0f3('0xe')](_0x5ce570,_0x5f95ee);}return logger[_0xf0f3('0x17')](_0xf0f3('0x1b'));}};module[_0xf0f3('0x1c')]=Graph;
\ No newline at end of file
+var _0x8116=['getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','vswitch','target','default','agicommand','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','addVertex','addEdge','prototype','size','relations','numberOfEdges'];(function(_0x4b72c6,_0x2e0c14){var _0x299c0d=function(_0x24446f){while(--_0x24446f){_0x4b72c6['push'](_0x4b72c6['shift']());}};_0x299c0d(++_0x2e0c14);}(_0x8116,0x115));var _0x6811=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8116[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6811('0x0'));var logger=require(_0x6811('0x1'))('agi');var verticesWithRetry=[_0x6811('0x2'),_0x6811('0x3'),_0x6811('0x4')];var Graph=function(){this[_0x6811('0x5')]={};this[_0x6811('0x6')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x6811('0x7')]=function(_0x42d847){this[_0x6811('0x5')][_0x42d847['id']]=_0x42d847;this[_0x6811('0x6')][_0x42d847['id']]=[];};Graph['prototype'][_0x6811('0x8')]=function(_0x42b1e4,_0x1b8b1a,_0x15fd61){this[_0x6811('0x6')][_0x42b1e4]['push']({'target':_0x1b8b1a,'condition':_0x15fd61});this['numberOfEdges']+=0x1;};Graph[_0x6811('0x9')]['size']=function(){return _[_0x6811('0xa')](this['vertices']);};Graph['prototype'][_0x6811('0xb')]=function(){return this[_0x6811('0xc')];};Graph[_0x6811('0x9')][_0x6811('0xd')]=function(_0x20069a){return this[_0x6811('0x5')][_0x20069a];};Graph[_0x6811('0x9')][_0x6811('0xe')]=function(_0x50d4f1,_0xfe93b1){if(!this[_0x6811('0x5')][_0x50d4f1]){return logger[_0x6811('0xf')](_0x6811('0x10'));}var _0x1bc2b0=_0xfe93b1(this[_0x6811('0x5')][_0x50d4f1]);if(!_0x1bc2b0){return logger[_0x6811('0xf')](_0x6811('0x11'));}if(this[_0x6811('0x6')][_0x50d4f1][_0x6811('0x12')]===0x0){return logger[_0x6811('0xf')](_0x6811('0x13'));}for(var _0x509b0a=0x0,_0x305962=[],_0x8ec24e=![];_0x509b0a<this[_0x6811('0x6')][_0x50d4f1]['length'];_0x509b0a+=0x1){if(this[_0x6811('0x6')][_0x50d4f1][_0x509b0a][_0x6811('0x14')]){_0x305962=this[_0x6811('0x6')][_0x50d4f1][_0x509b0a][_0x6811('0x14')]['split'](',');for(var _0xd97833=0x0;_0xd97833<_0x305962[_0x6811('0x12')];_0xd97833+=0x1){if(this['vertices'][_0x50d4f1]['agicommand']===_0x6811('0x15')&&_0x305962[_0xd97833]==='-'){_0x8ec24e=this[_0x6811('0x6')][_0x50d4f1][_0x509b0a][_0x6811('0x16')];logger['info'](_0x6811('0x17'),_0x305962[_0xd97833],this[_0x6811('0x6')][_0x50d4f1][_0x509b0a][_0x6811('0x16')]);}else if(this[_0x6811('0x5')][_0x50d4f1][_0x6811('0x18')]===_0x6811('0x2')&&_0x305962[_0xd97833]==='i'){_0x8ec24e=this['edges'][_0x50d4f1][_0x509b0a]['target'];logger['info']('invalid',_0x305962[_0xd97833],this[_0x6811('0x6')][_0x50d4f1][_0x509b0a][_0x6811('0x16')]);}if(_0x305962[_0xd97833]===_0x1bc2b0){return this['traverseBFS'](this[_0x6811('0x6')][_0x50d4f1][_0x509b0a]['target'],_0xfe93b1);}}}else{return this[_0x6811('0xe')](this['edges'][_0x50d4f1][_0x509b0a]['target'],_0xfe93b1);}}if(_0x305962[_0x6811('0x12')]){if(this[_0x6811('0x5')][_0x50d4f1][_0x6811('0x18')]==='vswitch'){if(_0x8ec24e){return this[_0x6811('0xe')](_0x8ec24e,_0xfe93b1);}return logger[_0x6811('0xf')](_0x6811('0x19'));}else if(_[_0x6811('0x1a')](verticesWithRetry,this[_0x6811('0x5')][_0x50d4f1][_0x6811('0x18')])){if(_0x1bc2b0==='-'){return logger[_0x6811('0xf')](_0x6811('0x1b'));}if(_0x8ec24e&&_0x1bc2b0!=='t'){return this['traverseBFS'](_0x8ec24e,_0xfe93b1);}return this[_0x6811('0xe')](_0x50d4f1,_0xfe93b1);}return logger[_0x6811('0xf')]('condition\x20not\x20found');}};module[_0x6811('0x1c')]=Graph;
\ No newline at end of file
index e10ebcb..bad0b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc272=['log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','evtHangup','mxGraphModel','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','agi_','substring','debug','stringify','info','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','start','clear','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','127.0.0.1','error','stack'];(function(_0x374202,_0x4d6227){var _0xbc3162=function(_0x2760fa){while(--_0x2760fa){_0x374202['push'](_0x374202['shift']());}};_0xbc3162(++_0x4d6227);}(_0xc272,0xfc));var _0x2c27=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0xc272[_0x3e6d5d];return _0x238923;};'use strict';var parser=require(_0x2c27('0x0'));var _=require('lodash');var syncho=require(_0x2c27('0x1'));var util=require(_0x2c27('0x2'));var moment=require('moment');var config=require(_0x2c27('0x3'));var logger=require('../../config/logger')(_0x2c27('0x4'));var utilLicense=require(_0x2c27('0x5'));var rpc=require(_0x2c27('0x6'));var mailRpc=require(_0x2c27('0x7'));var Graph=require(_0x2c27('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x2c27('0x4')],{'ip':_0x2c27('0x9'),'port':0x11dd});function connectionHandler(_0x36b763){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x36b763);agiHandler(_0x36b763);}catch(_0x502d64){logger[_0x2c27('0xa')](_0x502d64[_0x2c27('0xb')]);}});});}function listeningHandler(){console[_0x2c27('0xc')](_0x2c27('0xd'),config[_0x2c27('0x4')][_0x2c27('0xe')]);logger['info'](util[_0x2c27('0xf')](_0x2c27('0x10'),config[_0x2c27('0x4')]['ip'],config['agi'][_0x2c27('0xe')]));}function errorHandler(_0x57e122){if(_0x57e122&&_0x57e122['name']&&_0x57e122[_0x2c27('0x11')]){logger['error'](util[_0x2c27('0xf')](_0x2c27('0x12'),_0x57e122[_0x2c27('0x13')],_0x57e122['message']));}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')](_0x2c27('0x14'),_0x57e122[_0x2c27('0xb')]));}}function closeHandler(){logger['info'](util[_0x2c27('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2c27('0x15')],this[_0x2c27('0x16')],this['callerid'],this['dnid'],this[_0x2c27('0x17')]));try{createSquareReport(this);}catch(_0x5a916e){logger['error'](_0x5a916e[_0x2c27('0xb')]);}}function timeoutHandler(){logger['info'](util[_0x2c27('0xf')](_0x2c27('0x18'),this[_0x2c27('0x15')],this[_0x2c27('0x16')],this[_0x2c27('0x19')],this[_0x2c27('0x1a')],this[_0x2c27('0x17')]));}function hangupHandler(){logger['info'](util[_0x2c27('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x2c27('0x16')],this[_0x2c27('0x19')],this[_0x2c27('0x1a')],this[_0x2c27('0x17')]));this[_0x2c27('0x1b')]=!![];}function getRoot(_0x3d29cd){return parser['toJson'](_0x3d29cd,{'object':!![]})[_0x2c27('0x1c')]['root'];}function addVertex(_0xe89869,_0x53d9fa,_0x14f59f){_0x53d9fa['agicommand']=_0x14f59f;if(_0x53d9fa[_0x2c27('0x1d')]('retry')){_0x53d9fa[_0x2c27('0x1e')]=parseInt(_0x53d9fa[_0x2c27('0x1f')],0xa);}_0xe89869[_0x2c27('0x20')](_[_0x2c27('0x21')](_0x53d9fa,_0x2c27('0x22')));}function initGraph(_0x4b8da3,_0x3f2d56){var _0x269008=new Graph();for(var _0x464f70 in _0x4b8da3){if(_0x4b8da3['hasOwnProperty'](_0x464f70)){if(_[_0x2c27('0x23')](_0x4b8da3[_0x464f70])){for(var _0x505293=0x0;_0x505293<_0x4b8da3[_0x464f70]['length'];_0x505293+=0x1){addVertex(_0x269008,_0x4b8da3[_0x464f70][_0x505293],_0x464f70);}}else{addVertex(_0x269008,_0x4b8da3[_0x464f70],_0x464f70);}}}for(var _0x1f8933=0x0;_0x1f8933<_0x3f2d56[_0x2c27('0x24')];_0x1f8933+=0x1){if(_0x3f2d56[_0x1f8933][_0x2c27('0x25')]&&_0x3f2d56[_0x1f8933][_0x2c27('0x26')]){_0x269008[_0x2c27('0x27')](_0x3f2d56[_0x1f8933][_0x2c27('0x25')],_0x3f2d56[_0x1f8933]['target'],_0x3f2d56[_0x1f8933][_0x2c27('0x28')]);}}return _0x269008;}function getSquareProject(_0x5b76b2,_0x6d2827){rpc[_0x2c27('0x29')](_0x5b76b2)[_0x2c27('0x2a')](function(_0xd25602){_0x6d2827(null,_0xd25602);})['catch'](function(_0x289503){_0x6d2827(null,_0x289503);});}function createSquareReport(_0x480f71,_0x13ebe6){rpc['createSquareReport'](_0x480f71)[_0x2c27('0x2a')](function(_0x3a9a02){if(_0x13ebe6){_0x13ebe6(null,_0x3a9a02);}})[_0x2c27('0x2b')](function(_0x3c1e89){if(_0x13ebe6){_0x13ebe6(null,_0x3c1e89);}});}function setChannelVariables(_0x307eb8){for(var _0x51813a in _0x307eb8){if(_0x307eb8[_0x2c27('0x1d')](_0x51813a)){if(_0x51813a['indexOf'](_0x2c27('0x2c'))===0x0){_0x307eb8[_0x51813a[_0x2c27('0x2d')](0x4)]=_0x307eb8[_0x51813a];delete _0x307eb8[_0x51813a];}}}}function getLogFromObject(_0x3ab979){return util['inspect'](_0x3ab979,{'showHidden':![],'depth':null});}function agiHandler(_0x4985f0){var _0x320bfd,_0x4041d7,_0x2aab81,_0x1303bb,_0x3a9995;logger[_0x2c27('0x2e')]('variables',JSON[_0x2c27('0x2f')](_0x4985f0,null,0x2));logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x31'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4985f0['on'](_0x2c27('0xa'),errorHandler);_0x4985f0['on'](_0x2c27('0x32'),closeHandler);_0x4985f0['on'](_0x2c27('0x33'),timeoutHandler);_0x4985f0[_0x2c27('0x1b')]=![];_0x4985f0['on']('hangup',hangupHandler);var _0x4fc322=getSquareProject[_0x2c27('0x34')](null,_0x4985f0[_0x2c27('0x15')]);if(_0x4fc322){if(_0x4fc322[_0x2c27('0x35')]){_0x320bfd=getRoot(_0x4fc322[_0x2c27('0x35')]);if(_0x320bfd&&_0x320bfd['start']){logger['debug'](_0x2c27('0x36'),JSON[_0x2c27('0x2f')](_0x320bfd,null,0x2));_0x4985f0[_0x2c27('0x37')]=moment()['format'](_0x2c27('0x38'));_0x4041d7=initGraph(_[_0x2c27('0x21')](_0x320bfd,_0x2c27('0x22')),_0x320bfd['mxCell']);_0x2aab81=new Vertices(_0x4985f0,rpc,mailRpc);logger[_0x2c27('0x30')](util[_0x2c27('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4041d7[_0x2c27('0x39')](_0x320bfd[_0x2c27('0x3a')]['id'],function(_0x3b56d7){try{_0x3b56d7=_0x2aab81[_0x2c27('0x3b')](_0x3b56d7);logger[_0x2c27('0x2e')](_0x2c27('0x3c'),JSON[_0x2c27('0x2f')](_0x3b56d7,null,0x2));if(_0x3b56d7[_0x2c27('0x3d')]===_0x2c27('0x3e')){logger[_0x2c27('0x30')](_0x2c27('0x3f'));_0x4985f0['context']=_0x3b56d7[_0x2c27('0x40')]||_0x4985f0['context'];_0x4985f0[_0x2c27('0x41')]=_0x3b56d7[_0x2c27('0x41')];_0x4985f0[_0x2c27('0x42')]=_0x3b56d7[_0x2c27('0x42')]?_0x3b56d7[_0x2c27('0x42')]-0x1:0x1;return null;}else if(_0x3b56d7&&_0x2aab81[_0x3b56d7[_0x2c27('0x3d')]]){_0x3a9995=_0x2aab81[_0x3b56d7[_0x2c27('0x3d')]](_0x3b56d7);logger[_0x2c27('0x30')]('response',JSON[_0x2c27('0x2f')](_0x3a9995,null,0x2));if(_0x3a9995&&_0x3a9995[_0x2c27('0x43')]===AGI_CODE_SUCCESS&&_0x3a9995['result']!==AGI_RESULT_ERROR&&!_0x4985f0['evtHangup']){logger[_0x2c27('0x2e')](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return _[_0x2c27('0x45')](_0x3a9995[_0x2c27('0x46')])?null:_0x3a9995[_0x2c27('0x46')][_0x2c27('0x47')]();}else{logger[_0x2c27('0xa')](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return null;}}else{logger[_0x2c27('0xa')](_0x2c27('0x48'));return null;}}catch(_0x37b759){logger[_0x2c27('0xa')](_0x37b759[_0x2c27('0xb')]);return null;}});if(_0x320bfd[_0x2c27('0x49')]){logger['info'](util['format'](_0x2c27('0x4a'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0[_0x2c27('0x19')],_0x4985f0[_0x2c27('0x1a')],_0x4985f0[_0x2c27('0x17')]));_0x4041d7['traverseBFS'](_0x320bfd['finally']['id'],function(_0x14bcf6){try{_0x14bcf6=_0x2aab81['clear'](_0x14bcf6);logger[_0x2c27('0x2e')](_0x2c27('0x3c'),JSON['stringify'](_0x14bcf6,null,0x2));if(_0x14bcf6&&_0x2aab81[_0x14bcf6['agicommand']]){_0x3a9995=_0x2aab81[_0x14bcf6['agicommand']](_0x14bcf6);if(_0x3a9995){logger['debug'](_0x2c27('0x44'),getLogFromObject(_0x3a9995));return _[_0x2c27('0x45')](_0x3a9995[_0x2c27('0x46')])?null:_0x3a9995['result'][_0x2c27('0x47')]();}else{logger['error']('response',getLogFromObject(_0x3a9995));return null;}}else{logger[_0x2c27('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x10d209){logger['error'](_0x10d209[_0x2c27('0xb')]);return null;}});}logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x4b'),_0x4985f0[_0x2c27('0x15')],_0x4985f0[_0x2c27('0x16')],_0x4985f0['callerid'],_0x4985f0[_0x2c27('0x1a')],_0x4985f0['uniqueid']));logger[_0x2c27('0x30')](util[_0x2c27('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1));_0x4985f0[_0x2c27('0x4c')](_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0['priority'],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')]('Project\x20%s\x20not\x20published',_0x4985f0[_0x2c27('0x15')]));_0x4985f0[_0x2c27('0x4c')](_0x4985f0[_0x2c27('0x40')],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}else{logger[_0x2c27('0xa')](util[_0x2c27('0xf')](_0x2c27('0x4d'),_0x4985f0['arg_1']));_0x4985f0[_0x2c27('0x4c')](_0x4985f0['context'],_0x4985f0[_0x2c27('0x41')],parseInt(_0x4985f0[_0x2c27('0x42')],0xa)+0x1);_0x4985f0[_0x2c27('0x32')]();}}function main(){var _0x49cb1f;return utilLicense[_0x2c27('0x4e')]()['then'](function(_0x5b40f1){if(_0x5b40f1){if(_0x5b40f1[_0x2c27('0x4f')]){if(_0x5b40f1[_0x2c27('0x50')]&&_0x5b40f1[_0x2c27('0x50')]>0x0){logger[_0x2c27('0x30')](util[_0x2c27('0xf')](_0x2c27('0x51'),_0x5b40f1[_0x2c27('0x50')]));_0x49cb1f=_0x5b40f1[_0x2c27('0x50')];}else{logger[_0x2c27('0x30')](_0x2c27('0x52'));}}else{logger[_0x2c27('0x30')](_0x2c27('0x53'));_0x49cb1f=-0x1;}}})[_0x2c27('0x2b')](function(_0x10c60d){logger[_0x2c27('0xa')](_0x2c27('0x54'),_0x10c60d[_0x2c27('0xb')]);})['finally'](function(){var _0x331978=require(_0x2c27('0x55'))(config['agi'][_0x2c27('0xe')],config[_0x2c27('0x4')]['ip'],_0x49cb1f);_0x331978['on'](_0x2c27('0xa'),errorHandler);_0x331978['on'](_0x2c27('0x56'),listeningHandler);_0x331978['on'](_0x2c27('0x57'),connectionHandler);_0x331978['on'](_0x2c27('0x32'),closeHandler);});}main();
\ No newline at end of file
+var _0xd74c=['callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','mxGraphModel','root','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','target','source','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','sync','production','start','joinAt','traverseBFS','clear','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','Project\x20%s\x20not\x20found','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','util','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','nextTick','error','stack','log','info','format','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xd74c,0x96));var _0xcd74=function(_0xdf285c,_0x1d2a57){_0xdf285c=_0xdf285c-0x0;var _0x13ad53=_0xd74c[_0xdf285c];return _0x13ad53;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require('syncho');var util=require(_0xcd74('0x0'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xcd74('0x1'))(_0xcd74('0x2'));var utilLicense=require(_0xcd74('0x3'));var rpc=require(_0xcd74('0x4'));var mailRpc=require(_0xcd74('0x5'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xcd74('0x2')]=_['defaults'](config[_0xcd74('0x2')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x4e280e){process[_0xcd74('0x6')](function(){syncho(function(){try{setChannelVariables(_0x4e280e);agiHandler(_0x4e280e);}catch(_0x3bb523){logger[_0xcd74('0x7')](_0x3bb523[_0xcd74('0x8')]);}});});}function listeningHandler(){console[_0xcd74('0x9')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcd74('0x2')]['port']);logger[_0xcd74('0xa')](util[_0xcd74('0xb')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xcd74('0x2')]['ip'],config[_0xcd74('0x2')][_0xcd74('0xc')]));}function errorHandler(_0x5243c5){if(_0x5243c5&&_0x5243c5[_0xcd74('0xd')]&&_0x5243c5[_0xcd74('0xe')]){logger[_0xcd74('0x7')](util['format'](_0xcd74('0xf'),_0x5243c5[_0xcd74('0xd')],_0x5243c5[_0xcd74('0xe')]));}else{logger[_0xcd74('0x7')](util[_0xcd74('0xb')](_0xcd74('0x10'),_0x5243c5['stack']));}}function closeHandler(){logger[_0xcd74('0xa')](util['format'](_0xcd74('0x11'),this[_0xcd74('0x12')],this[_0xcd74('0x13')],this[_0xcd74('0x14')],this[_0xcd74('0x15')],this['uniqueid']));try{createSquareReport(this);}catch(_0x135608){logger[_0xcd74('0x7')](_0x135608[_0xcd74('0x8')]);}}function timeoutHandler(){logger[_0xcd74('0xa')](util[_0xcd74('0xb')](_0xcd74('0x16'),this[_0xcd74('0x12')],this['calleridname'],this[_0xcd74('0x14')],this['dnid'],this[_0xcd74('0x17')]));}function hangupHandler(){logger[_0xcd74('0xa')](util[_0xcd74('0xb')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xcd74('0x13')],this[_0xcd74('0x14')],this['dnid'],this[_0xcd74('0x17')]));this[_0xcd74('0x18')]=!![];}function getRoot(_0x1751b8){return parser[_0xcd74('0x19')](_0x1751b8,{'object':!![]})[_0xcd74('0x1a')][_0xcd74('0x1b')];}function addVertex(_0x2d7890,_0x4aba26,_0x9c5936){_0x4aba26['agicommand']=_0x9c5936;if(_0x4aba26['hasOwnProperty'](_0xcd74('0x1c'))){_0x4aba26[_0xcd74('0x1d')]=parseInt(_0x4aba26[_0xcd74('0x1c')],0xa);}_0x2d7890[_0xcd74('0x1e')](_[_0xcd74('0x1f')](_0x4aba26,_0xcd74('0x20')));}function initGraph(_0x46fe3b,_0xa05ec5){var _0x258e66=new Graph();for(var _0xae7775 in _0x46fe3b){if(_0x46fe3b[_0xcd74('0x21')](_0xae7775)){if(_[_0xcd74('0x22')](_0x46fe3b[_0xae7775])){for(var _0x213dbf=0x0;_0x213dbf<_0x46fe3b[_0xae7775][_0xcd74('0x23')];_0x213dbf+=0x1){addVertex(_0x258e66,_0x46fe3b[_0xae7775][_0x213dbf],_0xae7775);}}else{addVertex(_0x258e66,_0x46fe3b[_0xae7775],_0xae7775);}}}for(var _0x2b7e77=0x0;_0x2b7e77<_0xa05ec5[_0xcd74('0x23')];_0x2b7e77+=0x1){if(_0xa05ec5[_0x2b7e77]['source']&&_0xa05ec5[_0x2b7e77][_0xcd74('0x24')]){_0x258e66['addEdge'](_0xa05ec5[_0x2b7e77][_0xcd74('0x25')],_0xa05ec5[_0x2b7e77][_0xcd74('0x24')],_0xa05ec5[_0x2b7e77][_0xcd74('0x26')]);}}return _0x258e66;}function getSquareProject(_0x4a43fa,_0x2209c1){rpc[_0xcd74('0x27')](_0x4a43fa)[_0xcd74('0x28')](function(_0x510fee){_0x2209c1(null,_0x510fee);})[_0xcd74('0x29')](function(_0xcedaf8){_0x2209c1(null,_0xcedaf8);});}function createSquareReport(_0x4d0a12,_0x1c1e57){rpc[_0xcd74('0x2a')](_0x4d0a12)[_0xcd74('0x28')](function(_0x2a3ddd){if(_0x1c1e57){_0x1c1e57(null,_0x2a3ddd);}})[_0xcd74('0x29')](function(_0x27b837){if(_0x1c1e57){_0x1c1e57(null,_0x27b837);}});}function setChannelVariables(_0x3ff1d3){for(var _0x431ea5 in _0x3ff1d3){if(_0x3ff1d3[_0xcd74('0x21')](_0x431ea5)){if(_0x431ea5[_0xcd74('0x2b')](_0xcd74('0x2c'))===0x0){_0x3ff1d3[_0x431ea5[_0xcd74('0x2d')](0x4)]=_0x3ff1d3[_0x431ea5];delete _0x3ff1d3[_0x431ea5];}}}}function getLogFromObject(_0xa88ffb){return util[_0xcd74('0x2e')](_0xa88ffb,{'showHidden':![],'depth':null});}function agiHandler(_0x48685e){var _0x50f7b7,_0x269f1a,_0x515fb5,_0x5cebbc,_0x3e2e95;logger[_0xcd74('0x2f')](_0xcd74('0x30'),JSON[_0xcd74('0x31')](_0x48685e,null,0x2));logger[_0xcd74('0xa')](util[_0xcd74('0xb')](_0xcd74('0x32'),_0x48685e[_0xcd74('0x12')],_0x48685e[_0xcd74('0x13')],_0x48685e[_0xcd74('0x14')],_0x48685e[_0xcd74('0x15')],_0x48685e['uniqueid']));_0x48685e['on'](_0xcd74('0x7'),errorHandler);_0x48685e['on']('close',closeHandler);_0x48685e['on']('timeout',timeoutHandler);_0x48685e[_0xcd74('0x18')]=![];_0x48685e['on']('hangup',hangupHandler);var _0x4f4cf5=getSquareProject[_0xcd74('0x33')](null,_0x48685e[_0xcd74('0x12')]);if(_0x4f4cf5){if(_0x4f4cf5['production']){_0x50f7b7=getRoot(_0x4f4cf5[_0xcd74('0x34')]);if(_0x50f7b7&&_0x50f7b7[_0xcd74('0x35')]){logger['debug'](_0xcd74('0x1b'),JSON[_0xcd74('0x31')](_0x50f7b7,null,0x2));_0x48685e[_0xcd74('0x36')]=moment()[_0xcd74('0xb')]('YYYY-MM-DD\x20HH:mm:ss');_0x269f1a=initGraph(_[_0xcd74('0x1f')](_0x50f7b7,_0xcd74('0x20')),_0x50f7b7[_0xcd74('0x20')]);_0x515fb5=new Vertices(_0x48685e,rpc,mailRpc);logger[_0xcd74('0xa')](util[_0xcd74('0xb')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x48685e['arg_1'],_0x48685e[_0xcd74('0x13')],_0x48685e[_0xcd74('0x14')],_0x48685e[_0xcd74('0x15')],_0x48685e[_0xcd74('0x17')]));_0x269f1a[_0xcd74('0x37')](_0x50f7b7[_0xcd74('0x35')]['id'],function(_0x56f06b){try{_0x56f06b=_0x515fb5[_0xcd74('0x38')](_0x56f06b);logger[_0xcd74('0x2f')]('vertex',JSON[_0xcd74('0x31')](_0x56f06b,null,0x2));if(_0x56f06b[_0xcd74('0x39')]===_0xcd74('0x3a')){logger[_0xcd74('0xa')](_0xcd74('0x3b'));_0x48685e['context']=_0x56f06b[_0xcd74('0x3c')]||_0x48685e[_0xcd74('0x3c')];_0x48685e[_0xcd74('0x3d')]=_0x56f06b['extension'];_0x48685e[_0xcd74('0x3e')]=_0x56f06b[_0xcd74('0x3e')]?_0x56f06b[_0xcd74('0x3e')]-0x1:0x1;return null;}else if(_0x56f06b&&_0x515fb5[_0x56f06b['agicommand']]){_0x3e2e95=_0x515fb5[_0x56f06b[_0xcd74('0x39')]](_0x56f06b);logger[_0xcd74('0xa')](_0xcd74('0x3f'),JSON[_0xcd74('0x31')](_0x3e2e95,null,0x2));if(_0x3e2e95&&_0x3e2e95[_0xcd74('0x40')]===AGI_CODE_SUCCESS&&_0x3e2e95[_0xcd74('0x41')]!==AGI_RESULT_ERROR&&!_0x48685e[_0xcd74('0x18')]){logger[_0xcd74('0x2f')](_0xcd74('0x3f'),getLogFromObject(_0x3e2e95));return _[_0xcd74('0x42')](_0x3e2e95['result'])?null:_0x3e2e95[_0xcd74('0x41')][_0xcd74('0x43')]();}else{logger['error'](_0xcd74('0x3f'),getLogFromObject(_0x3e2e95));return null;}}else{logger['error'](_0xcd74('0x44'));return null;}}catch(_0x4caabd){logger[_0xcd74('0x7')](_0x4caabd['stack']);return null;}});if(_0x50f7b7[_0xcd74('0x45')]){logger['info'](util['format'](_0xcd74('0x46'),_0x48685e[_0xcd74('0x12')],_0x48685e[_0xcd74('0x13')],_0x48685e[_0xcd74('0x14')],_0x48685e[_0xcd74('0x15')],_0x48685e[_0xcd74('0x17')]));_0x269f1a[_0xcd74('0x37')](_0x50f7b7[_0xcd74('0x45')]['id'],function(_0x105585){try{_0x105585=_0x515fb5[_0xcd74('0x38')](_0x105585);logger['debug'](_0xcd74('0x47'),JSON['stringify'](_0x105585,null,0x2));if(_0x105585&&_0x515fb5[_0x105585[_0xcd74('0x39')]]){_0x3e2e95=_0x515fb5[_0x105585[_0xcd74('0x39')]](_0x105585);if(_0x3e2e95){logger[_0xcd74('0x2f')](_0xcd74('0x3f'),getLogFromObject(_0x3e2e95));return _[_0xcd74('0x42')](_0x3e2e95[_0xcd74('0x41')])?null:_0x3e2e95[_0xcd74('0x41')][_0xcd74('0x43')]();}else{logger[_0xcd74('0x7')]('response',getLogFromObject(_0x3e2e95));return null;}}else{logger[_0xcd74('0x7')](_0xcd74('0x44'));return null;}}catch(_0x2b3918){logger[_0xcd74('0x7')](_0x2b3918['stack']);return null;}});}logger[_0xcd74('0xa')](util[_0xcd74('0xb')](_0xcd74('0x48'),_0x48685e[_0xcd74('0x12')],_0x48685e['calleridname'],_0x48685e[_0xcd74('0x14')],_0x48685e['dnid'],_0x48685e[_0xcd74('0x17')]));logger[_0xcd74('0xa')](util[_0xcd74('0xb')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x48685e[_0xcd74('0x3c')],_0x48685e[_0xcd74('0x3d')],parseInt(_0x48685e[_0xcd74('0x3e')],0xa)+0x1));_0x48685e['continueAt'](_0x48685e['context'],_0x48685e[_0xcd74('0x3d')],parseInt(_0x48685e[_0xcd74('0x3e')],0xa)+0x1);_0x48685e['close']();}}else{logger[_0xcd74('0x7')](util['format']('Project\x20%s\x20not\x20published',_0x48685e[_0xcd74('0x12')]));_0x48685e['continueAt'](_0x48685e[_0xcd74('0x3c')],_0x48685e[_0xcd74('0x3d')],parseInt(_0x48685e[_0xcd74('0x3e')],0xa)+0x1);_0x48685e[_0xcd74('0x49')]();}}else{logger[_0xcd74('0x7')](util[_0xcd74('0xb')](_0xcd74('0x4a'),_0x48685e[_0xcd74('0x12')]));_0x48685e[_0xcd74('0x4b')](_0x48685e[_0xcd74('0x3c')],_0x48685e['extension'],parseInt(_0x48685e['priority'],0xa)+0x1);_0x48685e['close']();}}function main(){var _0x280357;return utilLicense['getLicense']()[_0xcd74('0x28')](function(_0x91c885){if(_0x91c885){if(_0x91c885[_0xcd74('0x4c')]){if(_0x91c885[_0xcd74('0x4d')]&&_0x91c885[_0xcd74('0x4d')]>0x0){logger['info'](util[_0xcd74('0xb')](_0xcd74('0x4e'),_0x91c885[_0xcd74('0x4d')]));_0x280357=_0x91c885[_0xcd74('0x4d')];}else{logger[_0xcd74('0xa')](_0xcd74('0x4f'));}}else{logger[_0xcd74('0xa')](_0xcd74('0x50'));_0x280357=-0x1;}}})[_0xcd74('0x29')](function(_0x160bf7){logger[_0xcd74('0x7')](_0xcd74('0x51'),_0x160bf7[_0xcd74('0x8')]);})[_0xcd74('0x45')](function(){var _0x3e45db=require(_0xcd74('0x52'))(config['agi'][_0xcd74('0xc')],config[_0xcd74('0x2')]['ip'],_0x280357);_0x3e45db['on'](_0xcd74('0x7'),errorHandler);_0x3e45db['on'](_0xcd74('0x53'),listeningHandler);_0x3e45db['on'](_0xcd74('0x54'),connectionHandler);_0x3e45db['on'](_0xcd74('0x49'),closeHandler);});}main();
\ No newline at end of file
index c3a2161..c709a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38e5=['jayson/promise','http','then','error','result','SendMail','bluebird'];(function(_0x1ef0cf,_0x261ab7){var _0x2fcec7=function(_0x22a4b6){while(--_0x22a4b6){_0x1ef0cf['push'](_0x1ef0cf['shift']());}};_0x2fcec7(++_0x261ab7);}(_0x38e5,0x99));var _0x538e=function(_0x3fa40d,_0x4ab277){_0x3fa40d=_0x3fa40d-0x0;var _0x494d33=_0x38e5[_0x3fa40d];return _0x494d33;};'use strict';var BPromise=require(_0x538e('0x0'));var jayson=require(_0x538e('0x1'));var client=jayson['client'][_0x538e('0x2')]({'port':0x232b});function request(_0x83802,_0x59587f){return new BPromise(function(_0xb2a2e0,_0x1fb728){return client['request'](_0x83802,_0x59587f)[_0x538e('0x3')](function(_0x1cf28c){if(_0x1cf28c[_0x538e('0x4')]){return _0x1fb728(_0x1cf28c[_0x538e('0x4')]['message']);}else{return _0xb2a2e0(_0x1cf28c[_0x538e('0x5')]);}})['catch'](function(_0x1f599f){return _0x1fb728(_0x1f599f);});});}exports['sendMailMessage']=function(_0x2d85e6,_0x5ea6d3){return request(_0x538e('0x6'),{'account':_0x2d85e6,'message':_0x5ea6d3});};
\ No newline at end of file
+var _0xf7b9=['message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','then','error'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xf7b9,0xd7));var _0x9f7b=function(_0x23d9ba,_0x27ed79){_0x23d9ba=_0x23d9ba-0x0;var _0x4db000=_0xf7b9[_0x23d9ba];return _0x4db000;};'use strict';var BPromise=require(_0x9f7b('0x0'));var jayson=require(_0x9f7b('0x1'));var client=jayson['client'][_0x9f7b('0x2')]({'port':0x232b});function request(_0x4a9e93,_0x125609){return new BPromise(function(_0x423b54,_0x320602){return client['request'](_0x4a9e93,_0x125609)[_0x9f7b('0x3')](function(_0x371c45){if(_0x371c45['error']){return _0x320602(_0x371c45[_0x9f7b('0x4')][_0x9f7b('0x5')]);}else{return _0x423b54(_0x371c45[_0x9f7b('0x6')]);}})[_0x9f7b('0x7')](function(_0x5efccb){return _0x320602(_0x5efccb);});});}exports[_0x9f7b('0x8')]=function(_0x1ab3cc,_0x1e949c){return request(_0x9f7b('0x9'),{'account':_0x1ab3cc,'message':_0x1e949c});};
\ No newline at end of file
index 6518450..c231892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad22=['util','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf','substring','length','split','trim','slice','emit','headers','line'];(function(_0x1d0bdd,_0x52c6d1){var _0x205377=function(_0x2ff6fc){while(--_0x2ff6fc){_0x1d0bdd['push'](_0x1d0bdd['shift']());}};_0x205377(++_0x52c6d1);}(_0xad22,0x1ed));var _0x2ad2=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0xad22[_0x50e40b];return _0x2608b7;};'use strict';var util=require(_0x2ad2('0x0'));var Transform=require('stream')[_0x2ad2('0x1')];function AGIReply(_0x2292b2){Transform[_0x2ad2('0x2')](this,_0x2292b2);this[_0x2ad2('0x3')]='';this[_0x2ad2('0x4')]=![];}util[_0x2ad2('0x5')](AGIReply,Transform);AGIReply[_0x2ad2('0x6')][_0x2ad2('0x7')]=function(_0x54c4df,_0x1ad0a6,_0x192488){var _0x3624da='\x0a',_0x7ada0c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0xaee54b=-0x1,_0x525470=-0x1,_0x152385='',_0x52efdb=0x0,_0x4b05d7='',_0x431f5c='';this[_0x2ad2('0x3')]+=_0x54c4df['toString']();_0x4b05d7=this[_0x2ad2('0x3')];if(!this[_0x2ad2('0x4')]){_0x52efdb=0x0;while(_0x7ada0c[_0x52efdb]){while((_0x525470=_0x4b05d7[_0x2ad2('0x8')](_0x7ada0c[_0x52efdb]))!=-0x1){_0x152385=_0x7ada0c[_0x52efdb];_0x431f5c=_0x4b05d7['substring'](0x0,_0x525470);_0x4b05d7=_0x4b05d7[_0x2ad2('0x9')](_0x525470+_0x152385[_0x2ad2('0xa')]);var _0x4c867f=_0x431f5c[_0x2ad2('0xb')](_0x3624da),_0x36415d=0x0,_0x527d10={},_0x1aa55b='',_0x399020='',_0x3f06e3=-0x1;while(_0x4c867f[_0x36415d]){_0x3f06e3=_0x4c867f[_0x36415d][_0x2ad2('0x8')](':');if(_0x3f06e3!=-0x1){_0x1aa55b=_0x4c867f[_0x36415d]['slice'](0x0,_0x3f06e3)[_0x2ad2('0xc')]();_0x399020=_0x4c867f[_0x36415d][_0x2ad2('0xd')](_0x3f06e3+0x1)[_0x2ad2('0xc')]();if(_0x1aa55b['length']>0x0){_0x527d10[_0x1aa55b]=_0x399020;}}else{}_0x36415d++;}this[_0x2ad2('0xe')](_0x2ad2('0xf'),_0x527d10);this[_0x2ad2('0x4')]=!![];}_0x52efdb++;}this[_0x2ad2('0x3')]=_0x4b05d7;}else{while((_0xaee54b=_0x4b05d7[_0x2ad2('0x8')](_0x3624da))!=-0x1){_0x431f5c=_0x4b05d7[_0x2ad2('0x9')](0x0,_0xaee54b);this['emit'](_0x2ad2('0x10'),_0x431f5c);_0x4b05d7=_0x4b05d7[_0x2ad2('0x9')](_0xaee54b+_0x3624da[_0x2ad2('0xa')]);}this[_0x2ad2('0x3')]=_0x4b05d7;}_0x192488();};module['exports']=AGIReply;
\ No newline at end of file
+var _0x2334=['slice','trim','emit','headers','line','exports','stream','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length'];(function(_0x148453,_0x3899eb){var _0x476491=function(_0x2099cf){while(--_0x2099cf){_0x148453['push'](_0x148453['shift']());}};_0x476491(++_0x3899eb);}(_0x2334,0x1d6));var _0x4233=function(_0x3986fc,_0x41fd49){_0x3986fc=_0x3986fc-0x0;var _0x514bd1=_0x2334[_0x3986fc];return _0x514bd1;};'use strict';var util=require('util');var Transform=require(_0x4233('0x0'))['Transform'];function AGIReply(_0x1a2bcc){Transform[_0x4233('0x1')](this,_0x1a2bcc);this[_0x4233('0x2')]='';this[_0x4233('0x3')]=![];}util[_0x4233('0x4')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x5958c4,_0x5e6c15,_0x26ecd3){var _0x571e8a='\x0a',_0x3e78f7=['\x0a\x0a',_0x4233('0x5')],_0x42a932=-0x1,_0x23f9d8=-0x1,_0x5f96a='',_0x326014=0x0,_0x598e77='',_0x1da1fc='';this[_0x4233('0x2')]+=_0x5958c4[_0x4233('0x6')]();_0x598e77=this[_0x4233('0x2')];if(!this[_0x4233('0x3')]){_0x326014=0x0;while(_0x3e78f7[_0x326014]){while((_0x23f9d8=_0x598e77[_0x4233('0x7')](_0x3e78f7[_0x326014]))!=-0x1){_0x5f96a=_0x3e78f7[_0x326014];_0x1da1fc=_0x598e77[_0x4233('0x8')](0x0,_0x23f9d8);_0x598e77=_0x598e77[_0x4233('0x8')](_0x23f9d8+_0x5f96a[_0x4233('0x9')]);var _0x1b92a4=_0x1da1fc['split'](_0x571e8a),_0x562018=0x0,_0x38e224={},_0x449652='',_0x484976='',_0x310d8c=-0x1;while(_0x1b92a4[_0x562018]){_0x310d8c=_0x1b92a4[_0x562018][_0x4233('0x7')](':');if(_0x310d8c!=-0x1){_0x449652=_0x1b92a4[_0x562018][_0x4233('0xa')](0x0,_0x310d8c)[_0x4233('0xb')]();_0x484976=_0x1b92a4[_0x562018]['slice'](_0x310d8c+0x1)['trim']();if(_0x449652[_0x4233('0x9')]>0x0){_0x38e224[_0x449652]=_0x484976;}}else{}_0x562018++;}this[_0x4233('0xc')](_0x4233('0xd'),_0x38e224);this[_0x4233('0x3')]=!![];}_0x326014++;}this[_0x4233('0x2')]=_0x598e77;}else{while((_0x42a932=_0x598e77[_0x4233('0x7')](_0x571e8a))!=-0x1){_0x1da1fc=_0x598e77['substring'](0x0,_0x42a932);this[_0x4233('0xc')](_0x4233('0xe'),_0x1da1fc);_0x598e77=_0x598e77[_0x4233('0x8')](_0x42a932+_0x571e8a[_0x4233('0x9')]);}this['_localBuffer']=_0x598e77;}_0x26ecd3();};module[_0x4233('0xf')]=AGIReply;
\ No newline at end of file
index 3030fbb..e40170e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bb6=['CreateSquareMessage','createCmContact','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','bluebird','moment','util','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','name','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage'];(function(_0x34f72e,_0xaf909f){var _0x444d63=function(_0x4de80e){while(--_0x4de80e){_0x34f72e['push'](_0x34f72e['shift']());}};_0x444d63(++_0xaf909f);}(_0x8bb6,0x1d3));var _0x68bb=function(_0x24d5a8,_0x3a36b3){_0x24d5a8=_0x24d5a8-0x0;var _0xa26640=_0x8bb6[_0x24d5a8];return _0xa26640;};'use strict';var BPromise=require(_0x68bb('0x0'));var moment=require(_0x68bb('0x1'));var _=require('lodash');var util=require(_0x68bb('0x2'));var jayson=require(_0x68bb('0x3'));var client=jayson[_0x68bb('0x4')]['http']({'port':0x2329});function request(_0x2399d2,_0x3e70de){return new BPromise(function(_0x4689ac,_0xdd3e86){return client[_0x68bb('0x5')](_0x2399d2,_0x3e70de)[_0x68bb('0x6')](function(_0x2f018d){if(_0x2f018d[_0x68bb('0x7')]){return _0xdd3e86(_0x2f018d[_0x68bb('0x7')][_0x68bb('0x8')]);}else{return _0x4689ac(_0x2f018d[_0x68bb('0x9')]);}})[_0x68bb('0xa')](function(_0x3ca3ad){return _0xdd3e86(_0x3ca3ad);});});}exports[_0x68bb('0xb')]=function(_0x4f5478){return request(_0x68bb('0xc'),{'options':{'raw':![],'where':{'name':_0x4f5478},'attributes':['production']}});};exports[_0x68bb('0xd')]=function(_0x2b6d84){return request(_0x68bb('0xe'),{'options':{'raw':![],'where':{'id':_0x2b6d84},'include':[{'model':_0x68bb('0xf'),'as':_0x68bb('0x10')}],'attributes':['id','name','email']}});};exports[_0x68bb('0x11')]=function(_0x2670cc){return request('ShowSquareProject',{'options':{'where':{'id':_0x2670cc},'attributes':['name']}});};exports[_0x68bb('0x12')]=function(_0x3b1654){return request(_0x68bb('0x13'),{'options':{'where':{'id':_0x3b1654},'attributes':['name']}});};exports[_0x68bb('0x14')]=function(_0x3afd4e){return request(_0x68bb('0x15'),{'options':{'where':{'id':_0x3afd4e},'attributes':[_0x68bb('0x16')]}});};exports[_0x68bb('0x17')]=function(_0x3c69aa){return request(_0x68bb('0x18'),{'options':{'where':{'id':_0x3c69aa},'attributes':[_0x68bb('0x19')]}});};exports[_0x68bb('0x1a')]=function(_0x5733f6){return request(_0x68bb('0x1b'),{'options':{'where':{'id':_0x5733f6},'attributes':[_0x68bb('0x16')]}});};exports[_0x68bb('0x1c')]=function(_0xed07b0){return request(_0x68bb('0x1d'),{'options':{'where':{'id':_0xed07b0},'attributes':[_0x68bb('0x16')]}});};exports['getSoundById']=function(_0x48924a){return request(_0x68bb('0x1e'),{'options':{'where':{'id':_0x48924a},'attributes':[_0x68bb('0x1f')]}});};exports[_0x68bb('0x20')]=function(_0x283680){return request(_0x68bb('0x21'),{'options':{'raw':![],'where':{'id':_0x283680},'include':[{'model':_0x68bb('0x22'),'as':'Intervals'}]}});};exports[_0x68bb('0x23')]=function(_0x10bc89){return request('ShowSmsAccount',{'options':{'where':{'id':_0x10bc89},'attributes':['id','name']}});};exports[_0x68bb('0x24')]=function(_0x383839){return request(_0x68bb('0x25'),{'body':_0x383839});};exports[_0x68bb('0x26')]=function(_0x30d3d2){return request('CreateSquareDetailsReport',{'body':_0x30d3d2});};exports[_0x68bb('0x27')]=function(_0x24005c){return request(_0x68bb('0x28'),{'body':_[_0x68bb('0x29')](_0x24005c,{'project_name':_0x24005c['arg_1'],'prev_project_name':_0x24005c[_0x68bb('0x2a')]||'','is_subproject':_0x24005c[_0x68bb('0x2a')]?!![]:![],'leaveAt':moment()[_0x68bb('0x2b')](_0x68bb('0x2c'))})});};exports['createSquareRecording']=function(_0x329572){return request('CreateSquareRecording',{'body':_0x329572});};exports[_0x68bb('0x2d')]=function(_0x488c9e){return request(_0x68bb('0x2e'),{'body':_0x488c9e});};exports[_0x68bb('0x2f')]=function(_0xc04ffb){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0xc04ffb[_0x68bb('0x30')],'ListId':_0xc04ffb[_0x68bb('0x31')]}}})['then'](function(_0x39b2a8){if(_0x39b2a8){return _0x39b2a8;}return request(_0x68bb('0x32'),{'body':_0xc04ffb});});};exports[_0x68bb('0x33')]=function(_0x42cbae){return request(_0x68bb('0x34'),{'options':{'where':{'id':_0x42cbae},'attributes':[_0x68bb('0x16')]}});};exports['agentLogin']=function(_0x35d323,_0x37a922){return request(_0x68bb('0x35'),{'body':{'interface':_0x37a922},'options':{'where':_0x35d323}});};exports[_0x68bb('0x36')]=function(_0x526c52,_0xf31a2c,_0xe46507){return request(_0x68bb('0x37'),{'body':{'type':_0xf31a2c,'uniqueid':_0xe46507},'options':{'where':_0x526c52}});};exports[_0x68bb('0x38')]=function(_0x5c6743){return request('UnpauseUser',{'body':{},'options':{'where':_0x5c6743}});};exports['agentLogout']=function(_0x3f38b2){return request('LogoutUser',{'body':{},'options':{'where':_0x3f38b2}});};
\ No newline at end of file
+var _0xa55b=['CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','LogoutUser','bluebird','moment','lodash','util','client','request','message','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','name','getSquareOdbcById','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ListId'];(function(_0x5943f6,_0x5c5715){var _0x1d2e0f=function(_0x45df6f){while(--_0x45df6f){_0x5943f6['push'](_0x5943f6['shift']());}};_0x1d2e0f(++_0x5c5715);}(_0xa55b,0x12d));var _0xba55=function(_0x11ebf9,_0x24d328){_0x11ebf9=_0x11ebf9-0x0;var _0x560c83=_0xa55b[_0x11ebf9];return _0x560c83;};'use strict';var BPromise=require(_0xba55('0x0'));var moment=require(_0xba55('0x1'));var _=require(_0xba55('0x2'));var util=require(_0xba55('0x3'));var jayson=require('jayson/promise');var client=jayson[_0xba55('0x4')]['http']({'port':0x2329});function request(_0x397070,_0x5ce41f){return new BPromise(function(_0x83a0ff,_0x9624c7){return client[_0xba55('0x5')](_0x397070,_0x5ce41f)['then'](function(_0x3e8ac4){if(_0x3e8ac4['error']){return _0x9624c7(_0x3e8ac4['error'][_0xba55('0x6')]);}else{return _0x83a0ff(_0x3e8ac4['result']);}})['catch'](function(_0x1346e0){return _0x9624c7(_0x1346e0);});});}exports[_0xba55('0x7')]=function(_0x78efe2){return request(_0xba55('0x8'),{'options':{'raw':![],'where':{'name':_0x78efe2},'attributes':['production']}});};exports[_0xba55('0x9')]=function(_0x5dc44f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5dc44f},'include':[{'model':_0xba55('0xa'),'as':_0xba55('0xb')}],'attributes':['id','name','email']}});};exports['getSquareProjectById']=function(_0x19dfd7){return request(_0xba55('0x8'),{'options':{'where':{'id':_0x19dfd7},'attributes':['name']}});};exports[_0xba55('0xc')]=function(_0x5065b9){return request(_0xba55('0xd'),{'options':{'where':{'id':_0x5065b9},'attributes':['name']}});};exports[_0xba55('0xe')]=function(_0x2366ad){return request(_0xba55('0xf'),{'options':{'where':{'id':_0x2366ad},'attributes':[_0xba55('0x10')]}});};exports[_0xba55('0x11')]=function(_0x3c7206){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3c7206},'attributes':[_0xba55('0x12')]}});};exports[_0xba55('0x13')]=function(_0x201891){return request(_0xba55('0x14'),{'options':{'where':{'id':_0x201891},'attributes':[_0xba55('0x10')]}});};exports[_0xba55('0x15')]=function(_0x367744){return request(_0xba55('0x16'),{'options':{'where':{'id':_0x367744},'attributes':[_0xba55('0x10')]}});};exports['getSoundById']=function(_0x4e283a){return request(_0xba55('0x17'),{'options':{'where':{'id':_0x4e283a},'attributes':[_0xba55('0x18')]}});};exports[_0xba55('0x19')]=function(_0x12ef9b){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x12ef9b},'include':[{'model':_0xba55('0x1a'),'as':_0xba55('0x1b')}]}});};exports['getSmsAccountById']=function(_0xde57b2){return request(_0xba55('0x1c'),{'options':{'where':{'id':_0xde57b2},'attributes':['id',_0xba55('0x10')]}});};exports[_0xba55('0x1d')]=function(_0x3908e0){return request(_0xba55('0x1e'),{'body':_0x3908e0});};exports[_0xba55('0x1f')]=function(_0x4370e9){return request('CreateSquareDetailsReport',{'body':_0x4370e9});};exports[_0xba55('0x20')]=function(_0x55eb20){return request(_0xba55('0x21'),{'body':_['merge'](_0x55eb20,{'project_name':_0x55eb20[_0xba55('0x22')],'prev_project_name':_0x55eb20[_0xba55('0x23')]||'','is_subproject':_0x55eb20[_0xba55('0x23')]?!![]:![],'leaveAt':moment()[_0xba55('0x24')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xba55('0x25')]=function(_0x40e4a4){return request(_0xba55('0x26'),{'body':_0x40e4a4});};exports['createSquareMessage']=function(_0x1482c5){return request(_0xba55('0x27'),{'body':_0x1482c5});};exports[_0xba55('0x28')]=function(_0x5cfa8b){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x5cfa8b['phone'],'ListId':_0x5cfa8b[_0xba55('0x29')]}}})['then'](function(_0x126749){if(_0x126749){return _0x126749;}return request(_0xba55('0x2a'),{'body':_0x5cfa8b});});};exports[_0xba55('0x2b')]=function(_0x1daa5a){return request(_0xba55('0x2c'),{'options':{'where':{'id':_0x1daa5a},'attributes':[_0xba55('0x10')]}});};exports[_0xba55('0x2d')]=function(_0x3ffd3e,_0x36293c){return request('LoginUser',{'body':{'interface':_0x36293c},'options':{'where':_0x3ffd3e}});};exports['agentPause']=function(_0x5f2346,_0x53b0d7,_0x206130){return request(_0xba55('0x2e'),{'body':{'type':_0x53b0d7,'uniqueid':_0x206130},'options':{'where':_0x5f2346}});};exports[_0xba55('0x2f')]=function(_0x3d0c68){return request('UnpauseUser',{'body':{},'options':{'where':_0x3d0c68}});};exports['agentLogout']=function(_0x103b6e){return request(_0xba55('0x30'),{'body':{},'options':{'where':_0x103b6e}});};
\ No newline at end of file
index 23cc0d7..7209ef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2c=['./lex','./polly'];(function(_0x378ad0,_0x44b4d2){var _0x1a65cf=function(_0x47a4a6){while(--_0x47a4a6){_0x378ad0['push'](_0x378ad0['shift']());}};_0x1a65cf(++_0x44b4d2);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x549c64,_0x4b27ae){_0x549c64=_0x549c64-0x0;var _0x4184e9=_0xbe2c[_0x549c64];return _0x4184e9;};var polly=require(_0xcbe2('0x0'));var lex=require(_0xcbe2('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x29eb=['./polly','./lex','exports'];(function(_0x50755f,_0x4711c6){var _0x352ba8=function(_0x2718cd){while(--_0x2718cd){_0x50755f['push'](_0x50755f['shift']());}};_0x352ba8(++_0x4711c6);}(_0x29eb,0x1c5));var _0xb29e=function(_0x21b75c,_0x477adc){_0x21b75c=_0x21b75c-0x0;var _0x7caebc=_0x29eb[_0x21b75c];return _0x7caebc;};var polly=require(_0xb29e('0x0'));var lex=require(_0xb29e('0x1'));module[_0xb29e('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index cc3ca53..9508d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff3=['exports'];(function(_0x4735d7,_0x121e5a){var _0x1ac3ca=function(_0x405e42){while(--_0x405e42){_0x4735d7['push'](_0x4735d7['shift']());}};_0x1ac3ca(++_0x121e5a);}(_0x5ff3,0x17d));var _0x35ff=function(_0x41b6e3,_0x2c8673){_0x41b6e3=_0x41b6e3-0x0;var _0x2883b8=_0x5ff3[_0x41b6e3];return _0x2883b8;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);};
\ No newline at end of file
+var _0x2750=['./lib/api'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0x2750,0x13b));var _0x0275=function(_0x232e2a,_0xdee2a8){_0x232e2a=_0x232e2a-0x0;var _0x2b5e9c=_0x2750[_0x232e2a];return _0x2b5e9c;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);};
\ No newline at end of file
index 7bf92d8..3f6d4b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x748214,_0x57f26e){var _0x4cc94a=function(_0x32d26a){while(--_0x32d26a){_0x748214['push'](_0x748214['shift']());}};_0x4cc94a(++_0x57f26e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x3b841b,_0x3ca8ac){var _0x394702=function(_0x5cbd04){while(--_0x5cbd04){_0x3b841b['push'](_0x3b841b['shift']());}};_0x394702(++_0x3ca8ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 d2738c6..bbf81ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66dc=['./lib/api','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x66dc,0xa2));var _0xc66d=function(_0x5edac0,_0x4140fb){_0x5edac0=_0x5edac0-0x0;var _0x194236=_0x66dc[_0x5edac0];return _0x194236;};'use strict';var polly=require(_0xc66d('0x0'));module[_0xc66d('0x1')]=function(_0x1cf60e,_0x19019e,_0x2d67ba,_0xf7f1ef,_0x21eb7f,_0xd4ef40,_0x49e734){return polly(_0x1cf60e,_0x19019e,_0x2d67ba,_0xf7f1ef,_0x21eb7f,_0xd4ef40,_0x49e734);};
\ No newline at end of file
+var _0xbb65=['./lib/api','exports'];(function(_0x252834,_0x55f763){var _0x58c864=function(_0x49080f){while(--_0x49080f){_0x252834['push'](_0x252834['shift']());}};_0x58c864(++_0x55f763);}(_0xbb65,0xde));var _0x5bb6=function(_0x2b0893,_0x2d7185){_0x2b0893=_0x2b0893-0x0;var _0x5dcbb=_0xbb65[_0x2b0893];return _0x5dcbb;};'use strict';var polly=require(_0x5bb6('0x0'));module[_0x5bb6('0x1')]=function(_0x1b2fb2,_0x25d0b4,_0x150380,_0x1050c0,_0xc8dee9,_0x513805,_0x373c83){return polly(_0x1b2fb2,_0x25d0b4,_0x150380,_0x1050c0,_0xc8dee9,_0x513805,_0x373c83);};
\ No newline at end of file
index c9de0bd..9c1e65f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ea=['exports','Polly','text','mp3','path','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x30c260,_0xf32209){var _0x126897=function(_0xa7f2c8){while(--_0xa7f2c8){_0x30c260['push'](_0x30c260['shift']());}};_0x126897(++_0xf32209);}(_0x17ea,0x17a));var _0xa17e=function(_0x3409cc,_0x48a866){_0x3409cc=_0x3409cc-0x0;var _0x8bbcd0=_0x17ea[_0x3409cc];return _0x8bbcd0;};'use strict';var fs=require('fs');var path=require(_0xa17e('0x0'));var BPromise=require('bluebird');var rs=require(_0xa17e('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x1c987d,_0x4a7fac,_0x4d0481){return new BPromise(function(_0x3c3bd4,_0x1ae9db){_0x1c987d[_0xa17e('0x2')](_0x4a7fac,function(_0x4c872a,_0x5ebf66){if(_0x4c872a){_0x1ae9db(_0x4c872a);}else if(_0x5ebf66){if(_0x5ebf66[_0xa17e('0x3')]instanceof Buffer){fs[_0xa17e('0x4')](_0x4d0481,_0x5ebf66[_0xa17e('0x3')],function(_0x2cad85){if(_0x2cad85){_0x1ae9db(_0x2cad85);}else{_0x3c3bd4();}});}else{_0x1ae9db(new Error(_0xa17e('0x5')));}}else{_0x1ae9db(new Error(_0xa17e('0x6')));}});});}module[_0xa17e('0x7')]=function(_0x565776,_0x301927,_0x4c5c2f,_0x5d4770,_0x2a3801,_0x38d30c,_0xd36801){var _0x2532b8=new AWS[(_0xa17e('0x8'))]({'accessKeyId':_0x565776,'secretAccessKey':_0x301927,'region':_0x4c5c2f});var _0x4aabde={'Text':_0x2a3801,'TextType':_0x38d30c||_0xa17e('0x9'),'OutputFormat':_0xa17e('0xa'),'VoiceId':_0x5d4770};return pollyResult(_0x2532b8,_0x4aabde,_0xd36801);};
\ No newline at end of file
+var _0x5c87=['exports','Polly','text','mp3','path','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x4adbb4,_0x1fc4af){var _0x3045af=function(_0x3b11b5){while(--_0x3b11b5){_0x4adbb4['push'](_0x4adbb4['shift']());}};_0x3045af(++_0x1fc4af);}(_0x5c87,0x72));var _0x75c8=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x5c87[_0x5ac84c];return _0x3c53d2;};'use strict';var fs=require('fs');var path=require(_0x75c8('0x0'));var BPromise=require('bluebird');var rs=require(_0x75c8('0x1'));var AWS=require(_0x75c8('0x2'));function pollyResult(_0x1317d9,_0xe79909,_0x2d4e57){return new BPromise(function(_0x3462ad,_0x262a3b){_0x1317d9[_0x75c8('0x3')](_0xe79909,function(_0x162bd1,_0x2c7cf9){if(_0x162bd1){_0x262a3b(_0x162bd1);}else if(_0x2c7cf9){if(_0x2c7cf9[_0x75c8('0x4')]instanceof Buffer){fs[_0x75c8('0x5')](_0x2d4e57,_0x2c7cf9[_0x75c8('0x4')],function(_0x3d775b){if(_0x3d775b){_0x262a3b(_0x3d775b);}else{_0x3462ad();}});}else{_0x262a3b(new Error(_0x75c8('0x6')));}}else{_0x262a3b(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x75c8('0x7')]=function(_0x5d383e,_0x3a701d,_0x2b685c,_0x1c9f97,_0xc65e7f,_0x1b809d,_0x424c55){var _0x2941f1=new AWS[(_0x75c8('0x8'))]({'accessKeyId':_0x5d383e,'secretAccessKey':_0x3a701d,'region':_0x2b685c});var _0x1b3e1e={'Text':_0xc65e7f,'TextType':_0x1b809d||_0x75c8('0x9'),'OutputFormat':_0x75c8('0xa'),'VoiceId':_0x1c9f97};return pollyResult(_0x2941f1,_0x1b3e1e,_0x424c55);};
\ No newline at end of file
index 1531b72..c7022ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5738=['./lib/api','exports'];(function(_0x47275c,_0x4bd743){var _0x1e892f=function(_0x3ff529){while(--_0x3ff529){_0x47275c['push'](_0x47275c['shift']());}};_0x1e892f(++_0x4bd743);}(_0x5738,0x70));var _0x8573=function(_0x28107d,_0x2ec8b3){_0x28107d=_0x28107d-0x0;var _0x2b1cbe=_0x5738[_0x28107d];return _0x2b1cbe;};'use strict';var asr=require(_0x8573('0x0'));module[_0x8573('0x1')]=function(_0x367227,_0x433fd6,_0x1e2292,_0x5f2f3a){return asr(_0x367227,_0x433fd6,_0x1e2292);};
\ No newline at end of file
+var _0x765a=['./lib/api'];(function(_0x47fb54,_0x28698c){var _0x1139a7=function(_0x17c781){while(--_0x17c781){_0x47fb54['push'](_0x47fb54['shift']());}};_0x1139a7(++_0x28698c);}(_0x765a,0xf7));var _0xa765=function(_0x5e92fe,_0x3d21df){_0x5e92fe=_0x5e92fe-0x0;var _0x3e7bbc=_0x765a[_0x5e92fe];return _0x3e7bbc;};'use strict';var asr=require(_0xa765('0x0'));module['exports']=function(_0x4de3ba,_0x179039,_0x136f85,_0x21dcf6){return asr(_0x4de3ba,_0x179039,_0x136f85);};
\ No newline at end of file
index b3d7e51..a06e40b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde56=['url','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','undefined','toString','base64','POST','LINEAR16','8000'];(function(_0x25e10c,_0x49596a){var _0x5dfd94=function(_0x2f4bfb){while(--_0x2f4bfb){_0x25e10c['push'](_0x25e10c['shift']());}};_0x5dfd94(++_0x49596a);}(_0xde56,0x144));var _0x6de5=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xde56[_0x1d8119];return _0x3e30f6;};'use strict';var url=require(_0x6de5('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x6de5('0x1');module[_0x6de5('0x2')]=function(_0x2d8342,_0x44082d,_0x2484e4){return new BPromise(function(_0x30b0d7,_0x1cdb30){var _0x382a2a;if(typeof _0x2d8342!==_0x6de5('0x3')||_0x2d8342[_0x6de5('0x4')]===0x0){return _0x1cdb30('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x44082d!==_0x6de5('0x3')||_0x44082d[_0x6de5('0x4')]===0x0){return _0x1cdb30(_0x6de5('0x5'));}if(typeof _0x2484e4!==_0x6de5('0x6')&&(typeof _0x2484e4!==_0x6de5('0x3')||_0x2484e4[_0x6de5('0x4')]===0x0)){return _0x1cdb30('lang\x20should\x20be\x20a\x20string');}try{_0x382a2a=fs['readFileSync'](_0x2d8342)[_0x6de5('0x7')](_0x6de5('0x8'));}catch(_0x1eed8f){return _0x1cdb30(_0x1eed8f);}return _0x30b0d7({'method':_0x6de5('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x44082d,'body':{'config':{'encoding':_0x6de5('0xa'),'sampleRateHertz':_0x6de5('0xb'),'languageCode':_0x2484e4},'audio':{'content':_0x382a2a}},'json':!![]});});};
\ No newline at end of file
+var _0x24cf=['8000','https://speech.googleapis.com','exports','string','length','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0x24cf,0x1d5));var _0xf24c=function(_0x9bee99,_0x45dde9){_0x9bee99=_0x9bee99-0x0;var _0x2c9ef4=_0x24cf[_0x9bee99];return _0x2c9ef4;};'use strict';var url=require('url');var BPromise=require('bluebird');var fs=require('fs');var host=_0xf24c('0x0');module[_0xf24c('0x1')]=function(_0x227c22,_0x40675a,_0x45f945){return new BPromise(function(_0x4cc9b1,_0x3cfc01){var _0x417bb2;if(typeof _0x227c22!==_0xf24c('0x2')||_0x227c22[_0xf24c('0x3')]===0x0){return _0x3cfc01('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x40675a!=='string'||_0x40675a['length']===0x0){return _0x3cfc01(_0xf24c('0x4'));}if(typeof _0x45f945!=='undefined'&&(typeof _0x45f945!==_0xf24c('0x2')||_0x45f945[_0xf24c('0x3')]===0x0)){return _0x3cfc01(_0xf24c('0x5'));}try{_0x417bb2=fs[_0xf24c('0x6')](_0x227c22)['toString'](_0xf24c('0x7'));}catch(_0x37193c){return _0x3cfc01(_0x37193c);}return _0x4cc9b1({'method':_0xf24c('0x8'),'uri':host+_0xf24c('0x9')+_0x40675a,'body':{'config':{'encoding':_0xf24c('0xa'),'sampleRateHertz':_0xf24c('0xb'),'languageCode':_0x45f945},'audio':{'content':_0x417bb2}},'json':!![]});});};
\ No newline at end of file
index 2661358..52debc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c2=['exports'];(function(_0x54de3a,_0x2a34c9){var _0x4ac73d=function(_0x3f6031){while(--_0x3f6031){_0x54de3a['push'](_0x54de3a['shift']());}};_0x4ac73d(++_0x2a34c9);}(_0x69c2,0x127));var _0x269c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x69c2[_0x397e5f];return _0x5302b8;};var asr=require('./asr');module[_0x269c('0x0')]={'asr':asr};
\ No newline at end of file
+var _0xb093=['./asr','exports'];(function(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0xb093,0xea));var _0x3b09=function(_0x4c5770,_0x48b574){_0x4c5770=_0x4c5770-0x0;var _0x303251=_0xb093[_0x4c5770];return _0x303251;};var asr=require(_0x3b09('0x0'));module[_0x3b09('0x1')]={'asr':asr};
\ No newline at end of file
index e5cc7e6..bc15511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9433=['goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','source','result','action','fulfillment','speech','score','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','querystring','request-promise','sox','url','parse','./aws','./google','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','path','request\x20to\x20','data','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','split','toString','googleCloudTTS','ssml','input','text:synthesize','.mp3','audioContent','777','.wav','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist'];(function(_0x4128fd,_0x1cd89c){var _0x1d02dd=function(_0x37e5b8){while(--_0x37e5b8){_0x4128fd['push'](_0x4128fd['shift']());}};_0x1d02dd(++_0x1cd89c);}(_0x9433,0x1c5));var _0x3943=function(_0x58168a,_0x11221f){_0x58168a=_0x58168a-0x0;var _0x5114ad=_0x9433[_0x58168a];return _0x5114ad;};'use strict';var apiai=require(_0x3943('0x0'));var BPromise=require(_0x3943('0x1'));var dialogflow=require(_0x3943('0x2'));var fs=require('fs');var http=require(_0x3943('0x3'));var https=require(_0x3943('0x4'));var md5=require('md5');var path=require('path');var querystring=require(_0x3943('0x5'));var rp=require(_0x3943('0x6'));var rs=require('randomstring');var sox=require(_0x3943('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x3943('0x8'))[_0x3943('0x9')];var util=require('util');var aws=require(_0x3943('0xa'));var google=require(_0x3943('0xb'));var sestek=require(_0x3943('0xc'));var tilde=require('./tilde');var logger=require(_0x3943('0xd'))('agi');var ISPEECH_API=_0x3943('0xe');function downloadFile(_0x487b12,_0x5e668c){return new BPromise(function(_0x1667c9,_0x4e31fe){var _0x5c12b9=urlParse(_0x487b12);var _0x4c7770=_0x5c12b9['protocol']===_0x3943('0xf')?https:http;var _0x42fd20={'host':_0x5c12b9[_0x3943('0x10')],'path':_0x5c12b9['path'],'headers':{'user-agent':_0x3943('0x11')}};_0x4c7770[_0x3943('0x12')](_0x42fd20,function(_0x41502d){if(_0x41502d[_0x3943('0x13')]!==0xc8){logger[_0x3943('0x14')]('request\x20to\x20'+_0x487b12+_0x3943('0x15')+_0x41502d[_0x3943('0x13')]+'\x20('+_0x41502d['statusMessage']+')');_0x4e31fe(new Error('request\x20to\x20'+_0x487b12+_0x3943('0x15')+_0x41502d[_0x3943('0x13')]+'\x20('+_0x41502d[_0x3943('0x16')]+')'));return;}var _0x39dc1b=fs['createWriteStream'](_0x5e668c);_0x39dc1b['on'](_0x3943('0x17'),function(){logger[_0x3943('0x18')](_0x3943('0x19'));_0x39dc1b[_0x3943('0x1a')](_0x1667c9);});_0x39dc1b['on'](_0x3943('0x14'),function(_0x15f7a8){fs[_0x3943('0x1b')](_0x5e668c);logger[_0x3943('0x14')](_0x3943('0x1c'),_0x15f7a8);_0x4e31fe(_0x15f7a8);});_0x41502d[_0x3943('0x1d')](_0x39dc1b);})['on']('error',function(_0x581371){logger[_0x3943('0x14')](_0x581371);_0x4e31fe(_0x581371);})[_0x3943('0x1e')]();});}function uploadFile(_0x5d6d3f){return new BPromise(function(_0x3ac97a,_0x15a0ed){var _0x340e67=urlParse(_0x5d6d3f);var _0x46c05b=_0x340e67['protocol']==='https:'?https:http;var _0x2367f3={'host':_0x340e67[_0x3943('0x10')],'path':_0x340e67[_0x3943('0x1f')],'headers':{'user-agent':'WHAT_EVER'}};_0x46c05b[_0x3943('0x12')](_0x2367f3,function(_0xdf4390){if(_0xdf4390['statusCode']!==0xc8){_0x15a0ed(new Error(_0x3943('0x20')+_0x5d6d3f+_0x3943('0x15')+_0xdf4390[_0x3943('0x13')]+'\x20('+_0xdf4390['statusMessage']+')'));return;}var _0x193a4c='';_0xdf4390['on'](_0x3943('0x21'),function(_0x13a2a7){_0x193a4c+=_0x13a2a7;});_0xdf4390['on'](_0x3943('0x1e'),function(){_0x3ac97a(_0x193a4c);});})['on']('error',function(_0x121a5f){_0x15a0ed(_0x121a5f);})[_0x3943('0x1e')]();});}function convertFile(_0x27c67b,_0x4a9500){return new BPromise(function(_0x2e040d,_0x132c53){var _0x596007=sox['transcode'](_0x27c67b,_0x4a9500,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x596007['on'](_0x3943('0x14'),function(_0x24714e){logger[_0x3943('0x14')](_0x3943('0x22'),_0x24714e);_0x132c53(_0x24714e);});_0x596007['on']('end',function(){logger['info'](_0x3943('0x23'));_0x2e040d();});_0x596007['start']();});}function base64Decode(_0x133f9c,_0x4b398e){var _0x585673=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.wav');fs[_0x3943('0x27')](_0x585673,_0x133f9c,_0x3943('0x28'));return convertFile(_0x585673,_0x4b398e)[_0x3943('0x29')](function(){try{fs['unlink'](_0x585673);fs[_0x3943('0x2a')](_0x4b398e,'777');}catch(_0x215b72){logger[_0x3943('0x14')](_0x215b72);}return _0x4b398e[_0x3943('0x2b')]('.')[0x0];});}function base64Encode(_0x11f9bd){var _0x96d24a=fs['readFileSync'](_0x11f9bd);return new Buffer(_0x96d24a)[_0x3943('0x2c')](_0x3943('0x28'));}exports[_0x3943('0x2d')]=function(_0x50a9b9,_0x359607,_0x5e9564,_0x3312de,_0x12f3a6,_0x1d0965){var _0x1b74ca,_0x28fae1;var _0x38cbd1='https://texttospeech.googleapis.com/v1/';var _0x53c5a0='?key='+_0x50a9b9;var _0x1ac02f={};if(_0x359607===_0x3943('0x2e')){_0x1ac02f[_0x3943('0x2f')]={'ssml':_0x5e9564};}else{_0x1ac02f[_0x3943('0x2f')]={'text':_0x5e9564};};_0x1ac02f['voice']={'languageCode':_0x3312de,'ssmlGender':_0x12f3a6};_0x1ac02f['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0xeedc55={'url':_0x38cbd1+_0x3943('0x30')+_0x53c5a0,'method':'POST','json':!![],'body':_0x1ac02f};return rp(_0xeedc55)[_0x3943('0x29')](function(_0x4b05c6){return new BPromise(function(_0x3766b2,_0x1479b8){_0x1b74ca=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x3943('0x31'));var _0x192bff=Buffer['from'](_0x4b05c6[_0x3943('0x32')],_0x3943('0x28'));return fs['writeFile'](_0x1b74ca,_0x192bff,function(_0x2a2c90){_0x1479b8(_0x2a2c90);},function(_0x73b5db){fs[_0x3943('0x2a')](_0x1b74ca,_0x3943('0x33'));_0x3766b2(_0x73b5db);});});})[_0x3943('0x29')](function(_0x11c823){_0x28fae1=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x1b74ca,_0x28fae1);})['then'](function(){try{fs['unlink'](_0x1b74ca);fs[_0x3943('0x2a')](_0x28fae1,_0x3943('0x33'));}catch(_0x57e272){logger[_0x3943('0x14')](_0x57e272);}logger['info'](_0x3943('0x35'),_0x28fae1[_0x3943('0x2b')]('.')[0x0]);return _0x28fae1['split']('.')[0x0];});};exports['googleTTS']=function(_0x2fcae1,_0xe922d1){var _0x51d1aa=_0x3943('0x36');var _0x110a80,_0xd25884;var _0x486f71;var _0x472258={'encoding':_0x3943('0x37'),'method':'POST','timeout':0x2710,'url':_0x51d1aa,'headers':{'Content-Type':_0x3943('0x38')},'body':_0x3943('0x39')+encodeURIComponent(JSON[_0x3943('0x3a')]([[[_0x3943('0x3b'),JSON['stringify']([_0x2fcae1,_0xe922d1||'en',![],_0x3943('0x3c')]),null,'generic']]]))};return rp(_0x472258)['then'](function(_0x3b5182){try{_0x486f71=eval(_0x3b5182[_0x3943('0x3d')](0x5))[0x0][0x2];}catch(_0x31f680){throw new Error(_0x3943('0x3e')+_0x3b5182[_0x3943('0x21')]);}if(!_0x486f71){if(_0x2fcae1[_0x3943('0x3f')]>0xc8){throw new Error(_0x3943('0x40'));}else{throw new Error(_0x3943('0x41')+_0xe922d1+_0x3943('0x42'));}}try{_0x486f71=eval(_0x486f71)[0x0];}catch(_0x39a2fd){throw new Error(_0x3943('0x3e')+res['data']);}const _0x2c45fe=_0x486f71;_0x110a80=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x31'));fs[_0x3943('0x27')](_0x110a80,_0x486f71,{'encoding':_0x3943('0x28')});_0xd25884=path[_0x3943('0x24')](__dirname,'tmp',rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x110a80,_0xd25884);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0x110a80);fs[_0x3943('0x2a')](_0xd25884,_0x3943('0x33'));}catch(_0x5e3d4c){logger[_0x3943('0x14')](_0x5e3d4c);}logger['info'](_0x3943('0x43'),_0xd25884['split']('.')[0x0]);return _0xd25884[_0x3943('0x2b')]('.')[0x0];});};exports[_0x3943('0x44')]=function(_0x4a5d64,_0x5c9b39,_0x38c547){return google[_0x3943('0x45')](_0x4a5d64,_0x5c9b39,_0x38c547)[_0x3943('0x29')](function(_0x2c439b){logger[_0x3943('0x18')](_0x2c439b[_0x3943('0x46')]);return rp(_0x2c439b);})[_0x3943('0x29')](function(_0x16a29f){var _0x2d725b='';var _0x2f0e40=0x0;try{fs[_0x3943('0x1b')](_0x4a5d64);}catch(_0x24d8cb){logger[_0x3943('0x14')](_0x24d8cb);}if(_0x16a29f&&_0x16a29f[_0x3943('0x47')]){_0x2d725b=_0x16a29f[_0x3943('0x47')]['map'](function(_0x3d3ac5){return _0x3d3ac5&&_0x3d3ac5[_0x3943('0x48')][0x0]&&_0x3d3ac5[_0x3943('0x48')][0x0][_0x3943('0x49')]?_0x3d3ac5[_0x3943('0x48')][0x0]['transcript']:'';})[_0x3943('0x4a')]('\x0a');_0x2f0e40=_0x16a29f[_0x3943('0x47')][_0x3943('0x4b')](function(_0x25c59b){return _0x25c59b&&_0x25c59b[_0x3943('0x48')][0x0]&&_0x25c59b[_0x3943('0x48')][0x0][_0x3943('0x4c')]?_0x25c59b['alternatives'][0x0][_0x3943('0x4c')]:0x0;})[_0x3943('0x4a')]('\x0a');}logger['info'](_0x3943('0x4d'),_0x2d725b);logger[_0x3943('0x18')](_0x3943('0x4e'),_0x2f0e40);return{'transcript':_0x2d725b,'confidence':_0x2f0e40};})[_0x3943('0x4f')](function(_0x5ba43b){logger['error'](_0x3943('0x50'),_0x5ba43b[_0x3943('0x13')],_0x5ba43b[_0x3943('0x51')],_0x5ba43b[_0x3943('0x52')]);});};exports[_0x3943('0x53')]=function(_0x3eefd2,_0x1fecf1,_0xe6be42,_0x34561c){var _0x48e277=apiai(_0x1fecf1,{'language':_0x34561c||'en'});return _0x48e277['textRequest'](_0xe6be42,{'sessionId':md5(_0x3eefd2)})[_0x3943('0x29')](function(_0x6ee0b){logger[_0x3943('0x18')](JSON[_0x3943('0x3a')](_0x6ee0b));return{'source':_0x6ee0b['result'][_0x3943('0x54')],'resolvedQuery':_0x6ee0b[_0x3943('0x55')]['resolvedQuery'],'action':_0x6ee0b[_0x3943('0x55')][_0x3943('0x56')],'actionIncomplete':_0x6ee0b[_0x3943('0x55')]['actionIncomplete'],'speech':_0x6ee0b[_0x3943('0x55')][_0x3943('0x57')][_0x3943('0x58')],'score':_0x6ee0b[_0x3943('0x55')][_0x3943('0x59')],'statusCode':_0x6ee0b['status'][_0x3943('0x5a')],'endConversation':_0x6ee0b[_0x3943('0x55')]['metadata']['endConversation']||![],'isFallbackIntent':_0x6ee0b[_0x3943('0x55')][_0x3943('0x5b')][_0x3943('0x5c')]};});};exports[_0x3943('0x5d')]=function(_0xf3f92c,_0x250874,_0x4d8716,_0x3af4b7,_0x14cd1d,_0x287f5a){var _0x454526=_0x3af4b7[_0x3943('0x5e')](/\\n/g,'\x0a');var _0x3fe759={'credentials':{'private_key':_0x454526,'client_email':_0x4d8716}};var _0x128755=new dialogflow[(_0x3943('0x5f'))](_0x3fe759);var _0xf78197=_0x128755[_0x3943('0x60')](_0x250874,md5(_0xf3f92c));var _0x442bc4={'session':_0xf78197,'queryInput':{'text':{'text':_0x14cd1d,'languageCode':_0x287f5a}}};return _0x128755[_0x3943('0x61')](_0x442bc4)[_0x3943('0x29')](function(_0x2da8a6){if(_0x2da8a6&&_0x2da8a6['length']){logger[_0x3943('0x18')](_0x3943('0x62'),JSON[_0x3943('0x3a')](_0x2da8a6));var _0x26902e=_0x2da8a6[0x0];if(_0x26902e){var _0x487ec2={'action':_0x26902e[_0x3943('0x63')][_0x3943('0x56')],'allRequiredParamsPresent':_0x26902e[_0x3943('0x63')]['allRequiredParamsPresent'],'endConversation':_0x26902e['queryResult']['diagnosticInfo']&&_0x26902e[_0x3943('0x63')][_0x3943('0x64')][_0x3943('0x65')]?_0x26902e[_0x3943('0x63')][_0x3943('0x64')]['fields'][_0x3943('0x66')][_0x3943('0x67')]:![],'fulfillmentText':_0x26902e[_0x3943('0x63')][_0x3943('0x68')],'intentName':_0x26902e[_0x3943('0x63')]['intent'][_0x3943('0x51')],'intentDisplayName':_0x26902e['queryResult'][_0x3943('0x69')]['displayName'],'isFallbackIntent':_0x26902e[_0x3943('0x63')][_0x3943('0x69')]['isFallback'],'languageCode':_0x26902e[_0x3943('0x63')][_0x3943('0x6a')],'queryText':_0x26902e[_0x3943('0x63')][_0x3943('0x6b')],'responseId':_0x26902e['responseId'],'score':_0x26902e['queryResult'][_0x3943('0x6c')],'speech':_0x26902e['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x3943('0x3a')](_0x2da8a6)};return _0x487ec2;}}});};exports[_0x3943('0x6d')]=function(_0x412531,_0x130572,_0x3d3c5d,_0x456b6c){return tilde[_0x3943('0x45')](_0x412531,_0x130572,_0x3d3c5d,_0x456b6c)['then'](function(_0x51c255){try{fs[_0x3943('0x1b')](_0x412531);}catch(_0x5d3a98){logger['error'](_0x5d3a98);}logger[_0x3943('0x18')](_0x3943('0x6e'),_0x51c255[_0x3943('0x49')]);logger['info'](_0x3943('0x6f'),_0x51c255[_0x3943('0x4c')]);return _0x51c255;});};exports[_0x3943('0x70')]=function(_0x1bb959,_0x429c03,_0xc0180b,_0x4e179c,_0x81ae48,_0x2be05b){var _0x28a7cf=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x31'));var _0x1bac80;return aws[_0x3943('0x71')](_0x1bb959,_0x429c03,_0xc0180b,_0x4e179c,_0x81ae48,_0x2be05b,_0x28a7cf)[_0x3943('0x29')](function(){_0x1bac80=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0x28a7cf,_0x1bac80);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0x28a7cf);fs[_0x3943('0x2a')](_0x1bac80,'777');}catch(_0x18264c){logger[_0x3943('0x14')](_0x18264c);}return _0x1bac80['split']('.')[0x0];});};exports['awsLex']=function(_0x202a3a,_0x43a7ee,_0x23b860,_0x525a42,_0x2bc23f,_0x499f12){return aws[_0x3943('0x72')](_0x202a3a,_0x43a7ee,_0x23b860,_0x525a42,_0x2bc23f,_0x499f12)['then'](function(_0x101153){logger[_0x3943('0x18')](JSON['stringify'](_0x101153));return _0x101153;});};exports[_0x3943('0x73')]=function(_0x239101,_0x499202,_0x1f4bb0,_0x1d8383){var _0x4460e0=util[_0x3943('0x74')](_0x3943('0x75'),ISPEECH_API,_0x239101,encodeURIComponent(_0x499202),_0x1f4bb0,_0x1d8383);var _0xd62390=path[_0x3943('0x24')](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.mp3');var _0x59454c;return downloadFile(_0x4460e0,_0xd62390)[_0x3943('0x29')](function(){_0x59454c=path[_0x3943('0x24')](__dirname,'tmp',rs[_0x3943('0x26')](0x4)+_0x3943('0x34'));return convertFile(_0xd62390,_0x59454c);})[_0x3943('0x29')](function(){try{fs[_0x3943('0x1b')](_0xd62390);fs[_0x3943('0x2a')](_0x59454c,_0x3943('0x33'));}catch(_0x1b542f){logger[_0x3943('0x14')](_0x1b542f);}return _0x59454c[_0x3943('0x2b')]('.')[0x0];});};exports[_0x3943('0x76')]=function(_0x5586b2,_0x363d2d,_0x5b69fe,_0x559261){var _0x4fd4ea=util[_0x3943('0x74')](_0x3943('0x77'),ISPEECH_API,_0x363d2d,_0x5b69fe,base64Encode(_0x5586b2),_0x559261?util[_0x3943('0x74')]('model=%s',encodeURIComponent(_0x559261)):_0x3943('0x78'));return uploadFile(_0x4fd4ea)[_0x3943('0x29')](function(_0x281d00){return querystring[_0x3943('0x9')](_0x281d00);});};exports[_0x3943('0x79')]=function(_0xf24e79,_0x1e6694){return sestek[_0x3943('0x7a')](_0xf24e79,_0x1e6694)[_0x3943('0x29')](function(_0x22773b){logger[_0x3943('0x18')](JSON[_0x3943('0x3a')](_0x22773b));var _0x2ef30d={'speech':_0x22773b[_0x3943('0x7b')],'action':_0x22773b[_0x3943('0x7c')]?_0x22773b[_0x3943('0x7c')]['CustomAction']:undefined,'actiondata':_0x22773b[_0x3943('0x7c')]?_0x22773b[_0x3943('0x7c')][_0x3943('0x7d')]:undefined};if(_0x22773b[_0x3943('0x7c')]&&_0x22773b[_0x3943('0x7c')][_0x3943('0x7e')]){return base64Decode(_0x22773b['channelData'][_0x3943('0x7e')][_0x3943('0x7f')],path['resolve'](__dirname,_0x3943('0x25'),rs[_0x3943('0x26')](0x4)+'.wav'))['then'](function(_0x5e489d){_0x2ef30d[_0x3943('0x80')]=_0x5e489d;return _0x2ef30d;});}return _0x2ef30d;});};exports[_0x3943('0x81')]=function(){return __dirname;};
\ No newline at end of file
+var _0xdeb7=['from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','status','code','isFallbackIntent','googleDialogflowV2','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','http','https','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','.wav','base64','then','chmodSync','777','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','POST','generate','.mp3'];(function(_0x548af2,_0x2f992e){var _0x5f48fa=function(_0x3d582b){while(--_0x3d582b){_0x548af2['push'](_0x548af2['shift']());}};_0x5f48fa(++_0x2f992e);}(_0xdeb7,0x16d));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var apiai=require(_0x7deb('0x0'));var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x7deb('0x1'));var https=require(_0x7deb('0x2'));var md5=require('md5');var path=require(_0x7deb('0x3'));var querystring=require('querystring');var rp=require(_0x7deb('0x4'));var rs=require(_0x7deb('0x5'));var sox=require(_0x7deb('0x6'));var tts=require(_0x7deb('0x7'));var urlParse=require(_0x7deb('0x8'))[_0x7deb('0x9')];var util=require(_0x7deb('0xa'));var aws=require(_0x7deb('0xb'));var google=require(_0x7deb('0xc'));var sestek=require(_0x7deb('0xd'));var tilde=require(_0x7deb('0xe'));var logger=require('../../../config/logger')(_0x7deb('0xf'));var ISPEECH_API=_0x7deb('0x10');function downloadFile(_0x532d38,_0x58d26f){return new BPromise(function(_0x4d9d4b,_0x13adde){var _0xb7613a=urlParse(_0x532d38);var _0x5ee30a=_0xb7613a[_0x7deb('0x11')]===_0x7deb('0x12')?https:http;var _0x50a2c7={'host':_0xb7613a[_0x7deb('0x13')],'path':_0xb7613a[_0x7deb('0x3')],'headers':{'user-agent':_0x7deb('0x14')}};_0x5ee30a[_0x7deb('0x15')](_0x50a2c7,function(_0x40597d){if(_0x40597d[_0x7deb('0x16')]!==0xc8){logger[_0x7deb('0x17')]('request\x20to\x20'+_0x532d38+_0x7deb('0x18')+_0x40597d[_0x7deb('0x16')]+'\x20('+_0x40597d[_0x7deb('0x19')]+')');_0x13adde(new Error(_0x7deb('0x1a')+_0x532d38+_0x7deb('0x18')+_0x40597d['statusCode']+'\x20('+_0x40597d['statusMessage']+')'));return;}var _0x484493=fs[_0x7deb('0x1b')](_0x58d26f);_0x484493['on'](_0x7deb('0x1c'),function(){logger[_0x7deb('0x1d')](_0x7deb('0x1e'));_0x484493['close'](_0x4d9d4b);});_0x484493['on']('error',function(_0x2d6aca){fs[_0x7deb('0x1f')](_0x58d26f);logger[_0x7deb('0x17')](_0x7deb('0x20'),_0x2d6aca);_0x13adde(_0x2d6aca);});_0x40597d[_0x7deb('0x21')](_0x484493);})['on'](_0x7deb('0x17'),function(_0x44a021){logger['error'](_0x44a021);_0x13adde(_0x44a021);})[_0x7deb('0x22')]();});}function uploadFile(_0x4e1436){return new BPromise(function(_0x4ba525,_0x58910a){var _0x16a5d2=urlParse(_0x4e1436);var _0xb56f41=_0x16a5d2[_0x7deb('0x11')]==='https:'?https:http;var _0x101331={'host':_0x16a5d2[_0x7deb('0x13')],'path':_0x16a5d2[_0x7deb('0x3')],'headers':{'user-agent':_0x7deb('0x14')}};_0xb56f41['get'](_0x101331,function(_0xdee0){if(_0xdee0['statusCode']!==0xc8){_0x58910a(new Error('request\x20to\x20'+_0x4e1436+'\x20failed,\x20status\x20code\x20=\x20'+_0xdee0['statusCode']+'\x20('+_0xdee0[_0x7deb('0x19')]+')'));return;}var _0x1ea26d='';_0xdee0['on'](_0x7deb('0x23'),function(_0x5cf7c8){_0x1ea26d+=_0x5cf7c8;});_0xdee0['on'](_0x7deb('0x22'),function(){_0x4ba525(_0x1ea26d);});})['on'](_0x7deb('0x17'),function(_0x418bd2){_0x58910a(_0x418bd2);})['end']();});}function convertFile(_0xff8eac,_0x428fa6){return new BPromise(function(_0x4f4782,_0x3eab46){var _0x2dec97=sox[_0x7deb('0x24')](_0xff8eac,_0x428fa6,{'sampleRate':0x1f40,'format':_0x7deb('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2dec97['on'](_0x7deb('0x17'),function(_0x53b7bc){logger[_0x7deb('0x17')](_0x7deb('0x26'),_0x53b7bc);_0x3eab46(_0x53b7bc);});_0x2dec97['on']('end',function(){logger['info'](_0x7deb('0x27'));_0x4f4782();});_0x2dec97[_0x7deb('0x28')]();});}function base64Decode(_0x2a2f5b,_0x2d7737){var _0x502835=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs['generate'](0x4)+_0x7deb('0x2b'));fs['writeFileSync'](_0x502835,_0x2a2f5b,_0x7deb('0x2c'));return convertFile(_0x502835,_0x2d7737)[_0x7deb('0x2d')](function(){try{fs['unlink'](_0x502835);fs[_0x7deb('0x2e')](_0x2d7737,_0x7deb('0x2f'));}catch(_0x477072){logger[_0x7deb('0x17')](_0x477072);}return _0x2d7737['split']('.')[0x0];});}function base64Encode(_0x597704){var _0x2b1881=fs[_0x7deb('0x30')](_0x597704);return new Buffer(_0x2b1881)['toString'](_0x7deb('0x2c'));}exports['googleCloudTTS']=function(_0x247749,_0x2c57e1,_0x517eb4,_0x17ec8f,_0x29eb29,_0xec0575){var _0xb5ba5f,_0x4efe14;var _0x238343=_0x7deb('0x31');var _0x48af80=_0x7deb('0x32')+_0x247749;var _0x47c4df={};if(_0x2c57e1===_0x7deb('0x33')){_0x47c4df[_0x7deb('0x34')]={'ssml':_0x517eb4};}else{_0x47c4df[_0x7deb('0x34')]={'text':_0x517eb4};};_0x47c4df[_0x7deb('0x35')]={'languageCode':_0x17ec8f,'ssmlGender':_0x29eb29};_0x47c4df[_0x7deb('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x42a387={'url':_0x238343+'text:synthesize'+_0x48af80,'method':_0x7deb('0x37'),'json':!![],'body':_0x47c4df};return rp(_0x42a387)['then'](function(_0x4e1207){return new BPromise(function(_0x19d5bb,_0x3f6c7c){_0xb5ba5f=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+_0x7deb('0x39'));var _0x2411fc=Buffer[_0x7deb('0x3a')](_0x4e1207[_0x7deb('0x3b')],_0x7deb('0x2c'));return fs[_0x7deb('0x3c')](_0xb5ba5f,_0x2411fc,function(_0x4480a7){_0x3f6c7c(_0x4480a7);},function(_0xf83990){fs[_0x7deb('0x2e')](_0xb5ba5f,_0x7deb('0x2f'));_0x19d5bb(_0xf83990);});});})['then'](function(_0x448245){_0x4efe14=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+_0x7deb('0x2b'));return convertFile(_0xb5ba5f,_0x4efe14);})[_0x7deb('0x2d')](function(){try{fs[_0x7deb('0x1f')](_0xb5ba5f);fs[_0x7deb('0x2e')](_0x4efe14,_0x7deb('0x2f'));}catch(_0x5e8f1b){logger[_0x7deb('0x17')](_0x5e8f1b);}logger[_0x7deb('0x1d')](_0x7deb('0x3d'),_0x4efe14[_0x7deb('0x3e')]('.')[0x0]);return _0x4efe14[_0x7deb('0x3e')]('.')[0x0];});};exports[_0x7deb('0x3f')]=function(_0x2d024f,_0x2f8e10){var _0x3c9cf5=_0x7deb('0x40');var _0x395d3f,_0x4ba5fa;var _0x7e0b73;var _0x3e261c={'encoding':'utf8','method':_0x7deb('0x37'),'timeout':0x2710,'url':_0x3c9cf5,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x7deb('0x41')+encodeURIComponent(JSON[_0x7deb('0x42')]([[[_0x7deb('0x43'),JSON[_0x7deb('0x42')]([_0x2d024f,_0x2f8e10||'en',![],_0x7deb('0x44')]),null,_0x7deb('0x45')]]]))};return rp(_0x3e261c)[_0x7deb('0x2d')](function(_0x4ddcef){try{_0x7e0b73=eval(_0x4ddcef[_0x7deb('0x46')](0x5))[0x0][0x2];}catch(_0x5b8aaa){throw new Error('parse\x20response\x20failed:\x0a'+_0x4ddcef[_0x7deb('0x23')]);}if(!_0x7e0b73){if(_0x2d024f[_0x7deb('0x47')]>0xc8){throw new Error(_0x7deb('0x48'));}else{throw new Error('lang\x20\x22'+_0x2f8e10+_0x7deb('0x49'));}}try{_0x7e0b73=eval(_0x7e0b73)[0x0];}catch(_0x44065a){throw new Error(_0x7deb('0x4a')+res[_0x7deb('0x23')]);}const _0x43fa1a=_0x7e0b73;_0x395d3f=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+_0x7deb('0x39'));fs[_0x7deb('0x4b')](_0x395d3f,_0x7e0b73,{'encoding':_0x7deb('0x2c')});_0x4ba5fa=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+'.wav');return convertFile(_0x395d3f,_0x4ba5fa);})['then'](function(){try{fs['unlink'](_0x395d3f);fs[_0x7deb('0x2e')](_0x4ba5fa,_0x7deb('0x2f'));}catch(_0x152a8a){logger[_0x7deb('0x17')](_0x152a8a);}logger[_0x7deb('0x1d')](_0x7deb('0x4c'),_0x4ba5fa['split']('.')[0x0]);return _0x4ba5fa[_0x7deb('0x3e')]('.')[0x0];});};exports['googleASR']=function(_0x1afad1,_0x313bb4,_0x1c1857){return google[_0x7deb('0x4d')](_0x1afad1,_0x313bb4,_0x1c1857)['then'](function(_0x5f2066){logger['info'](_0x5f2066[_0x7deb('0x4e')]);return rp(_0x5f2066);})[_0x7deb('0x2d')](function(_0x422628){var _0xafe97c='';var _0x4d198f=0x0;try{fs[_0x7deb('0x1f')](_0x1afad1);}catch(_0x48430d){logger[_0x7deb('0x17')](_0x48430d);}if(_0x422628&&_0x422628['results']){_0xafe97c=_0x422628[_0x7deb('0x4f')][_0x7deb('0x50')](function(_0xa2499){return _0xa2499&&_0xa2499[_0x7deb('0x51')][0x0]&&_0xa2499[_0x7deb('0x51')][0x0][_0x7deb('0x52')]?_0xa2499['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x4d198f=_0x422628['results']['map'](function(_0x2ba790){return _0x2ba790&&_0x2ba790[_0x7deb('0x51')][0x0]&&_0x2ba790['alternatives'][0x0][_0x7deb('0x53')]?_0x2ba790[_0x7deb('0x51')][0x0][_0x7deb('0x53')]:0x0;})[_0x7deb('0x54')]('\x0a');}logger[_0x7deb('0x1d')](_0x7deb('0x55'),_0xafe97c);logger[_0x7deb('0x1d')](_0x7deb('0x56'),_0x4d198f);return{'transcript':_0xafe97c,'confidence':_0x4d198f};})[_0x7deb('0x57')](function(_0x2d9120){logger[_0x7deb('0x17')](_0x7deb('0x58'),_0x2d9120['statusCode'],_0x2d9120[_0x7deb('0x59')],_0x2d9120[_0x7deb('0x5a')]);});};exports[_0x7deb('0x5b')]=function(_0x230168,_0x27c5a6,_0x14077c,_0x3e8878){var _0x3e36a8=apiai(_0x27c5a6,{'language':_0x3e8878||'en'});return _0x3e36a8[_0x7deb('0x5c')](_0x14077c,{'sessionId':md5(_0x230168)})['then'](function(_0x41ffca){logger[_0x7deb('0x1d')](JSON['stringify'](_0x41ffca));return{'source':_0x41ffca[_0x7deb('0x5d')][_0x7deb('0x5e')],'resolvedQuery':_0x41ffca[_0x7deb('0x5d')][_0x7deb('0x5f')],'action':_0x41ffca['result'][_0x7deb('0x60')],'actionIncomplete':_0x41ffca['result'][_0x7deb('0x61')],'speech':_0x41ffca['result'][_0x7deb('0x62')][_0x7deb('0x63')],'score':_0x41ffca[_0x7deb('0x5d')]['score'],'statusCode':_0x41ffca[_0x7deb('0x64')][_0x7deb('0x65')],'endConversation':_0x41ffca['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x41ffca[_0x7deb('0x5d')]['metadata'][_0x7deb('0x66')]};});};exports[_0x7deb('0x67')]=function(_0x34665f,_0x3b402b,_0x1f7ab0,_0x39ba8d,_0x10861b,_0x519a50){var _0x3da3b1=_0x39ba8d['replace'](/\\n/g,'\x0a');var _0x1af30a={'credentials':{'private_key':_0x3da3b1,'client_email':_0x1f7ab0}};var _0x1ecc19=new dialogflow['SessionsClient'](_0x1af30a);var _0x1fc07f=_0x1ecc19[_0x7deb('0x68')](_0x3b402b,md5(_0x34665f));var _0x5dca3d={'session':_0x1fc07f,'queryInput':{'text':{'text':_0x10861b,'languageCode':_0x519a50}}};return _0x1ecc19[_0x7deb('0x69')](_0x5dca3d)[_0x7deb('0x2d')](function(_0x597d57){if(_0x597d57&&_0x597d57[_0x7deb('0x47')]){logger[_0x7deb('0x1d')](_0x7deb('0x6a'),JSON[_0x7deb('0x42')](_0x597d57));var _0x5eb127=_0x597d57[0x0];if(_0x5eb127){var _0x4e2810={'action':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x60')],'allRequiredParamsPresent':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x6c')],'endConversation':_0x5eb127['queryResult'][_0x7deb('0x6d')]&&_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x6d')][_0x7deb('0x6e')]?_0x5eb127['queryResult'][_0x7deb('0x6d')][_0x7deb('0x6e')]['end_conversation'][_0x7deb('0x6f')]:![],'fulfillmentText':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x70')],'intentName':_0x5eb127[_0x7deb('0x6b')]['intent'][_0x7deb('0x59')],'intentDisplayName':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x71')][_0x7deb('0x72')],'isFallbackIntent':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x71')][_0x7deb('0x73')],'languageCode':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x74')],'queryText':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x75')],'responseId':_0x5eb127[_0x7deb('0x76')],'score':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x77')],'speech':_0x5eb127[_0x7deb('0x6b')][_0x7deb('0x70')],'providerResponse':JSON['stringify'](_0x597d57)};return _0x4e2810;}}});};exports['tildeASR']=function(_0x38a3df,_0xae9c1c,_0x5b641f,_0xc2de12){return tilde['asr'](_0x38a3df,_0xae9c1c,_0x5b641f,_0xc2de12)[_0x7deb('0x2d')](function(_0x34f76b){try{fs[_0x7deb('0x1f')](_0x38a3df);}catch(_0x10b039){logger['error'](_0x10b039);}logger[_0x7deb('0x1d')](_0x7deb('0x78'),_0x34f76b['transcript']);logger[_0x7deb('0x1d')](_0x7deb('0x79'),_0x34f76b[_0x7deb('0x53')]);return _0x34f76b;});};exports[_0x7deb('0x7a')]=function(_0x48198a,_0x24df4f,_0x56fbd8,_0x19e22a,_0x3f8ce6,_0x151c5a){var _0x16c250=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+'.mp3');var _0x54affe;return aws[_0x7deb('0x7b')](_0x48198a,_0x24df4f,_0x56fbd8,_0x19e22a,_0x3f8ce6,_0x151c5a,_0x16c250)[_0x7deb('0x2d')](function(){_0x54affe=path[_0x7deb('0x29')](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+'.wav');return convertFile(_0x16c250,_0x54affe);})['then'](function(){try{fs[_0x7deb('0x1f')](_0x16c250);fs['chmodSync'](_0x54affe,'777');}catch(_0x512ade){logger[_0x7deb('0x17')](_0x512ade);}return _0x54affe[_0x7deb('0x3e')]('.')[0x0];});};exports['awsLex']=function(_0x1fa64b,_0x53bca9,_0x36c907,_0x5f175c,_0x28d2e2,_0x58bfab){return aws[_0x7deb('0x7c')](_0x1fa64b,_0x53bca9,_0x36c907,_0x5f175c,_0x28d2e2,_0x58bfab)[_0x7deb('0x2d')](function(_0x33f460){logger[_0x7deb('0x1d')](JSON[_0x7deb('0x42')](_0x33f460));return _0x33f460;});};exports['ispeechTTS']=function(_0x425cef,_0x11399f,_0x503f94,_0x4444f3){var _0x4b8460=util['format'](_0x7deb('0x7d'),ISPEECH_API,_0x425cef,encodeURIComponent(_0x11399f),_0x503f94,_0x4444f3);var _0xfa2c83=path[_0x7deb('0x29')](__dirname,'tmp',rs[_0x7deb('0x38')](0x4)+'.mp3');var _0x29ed93;return downloadFile(_0x4b8460,_0xfa2c83)['then'](function(){_0x29ed93=path['resolve'](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+_0x7deb('0x2b'));return convertFile(_0xfa2c83,_0x29ed93);})['then'](function(){try{fs[_0x7deb('0x1f')](_0xfa2c83);fs['chmodSync'](_0x29ed93,_0x7deb('0x2f'));}catch(_0x8db9a5){logger[_0x7deb('0x17')](_0x8db9a5);}return _0x29ed93[_0x7deb('0x3e')]('.')[0x0];});};exports[_0x7deb('0x7e')]=function(_0x1112ce,_0x4be0c9,_0x311b43,_0x4f4273){var _0x580bcc=util['format'](_0x7deb('0x7f'),ISPEECH_API,_0x4be0c9,_0x311b43,base64Encode(_0x1112ce),_0x4f4273?util[_0x7deb('0x80')](_0x7deb('0x81'),encodeURIComponent(_0x4f4273)):_0x7deb('0x82'));return uploadFile(_0x580bcc)[_0x7deb('0x2d')](function(_0x3d0828){return querystring[_0x7deb('0x9')](_0x3d0828);});};exports[_0x7deb('0x83')]=function(_0x5a65a2,_0xc9fac3){return sestek[_0x7deb('0x84')](_0x5a65a2,_0xc9fac3)[_0x7deb('0x2d')](function(_0x44178a){logger[_0x7deb('0x1d')](JSON[_0x7deb('0x42')](_0x44178a));var _0x3f615f={'speech':_0x44178a[_0x7deb('0x85')],'action':_0x44178a[_0x7deb('0x86')]?_0x44178a['channelData'][_0x7deb('0x87')]:undefined,'actiondata':_0x44178a[_0x7deb('0x86')]?_0x44178a['channelData'][_0x7deb('0x88')]:undefined};if(_0x44178a[_0x7deb('0x86')]&&_0x44178a[_0x7deb('0x86')]['AudioFromTts']){return base64Decode(_0x44178a[_0x7deb('0x86')][_0x7deb('0x89')][_0x7deb('0x8a')],path['resolve'](__dirname,_0x7deb('0x2a'),rs[_0x7deb('0x38')](0x4)+'.wav'))[_0x7deb('0x2d')](function(_0x805c0c){_0x3f615f[_0x7deb('0x8b')]=_0x805c0c;return _0x3f615f;});}return _0x3f615f;});};exports[_0x7deb('0x8c')]=function(){return __dirname;};
\ No newline at end of file
index 7a76ca3..e0ae444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82e9=['exports','./nda'];(function(_0x4f83ea,_0x4b484e){var _0x3e41f6=function(_0x5cfcdc){while(--_0x5cfcdc){_0x4f83ea['push'](_0x4f83ea['shift']());}};_0x3e41f6(++_0x4b484e);}(_0x82e9,0xe9));var _0x982e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x82e9[_0x2763f2];return _0x3ef471;};var nda=require(_0x982e('0x0'));module[_0x982e('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x9397=['exports','./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9397,0xbb));var _0x7939=function(_0x9a5093,_0x2ba7ce){_0x9a5093=_0x9a5093-0x0;var _0x374933=_0x9397[_0x9a5093];return _0x374933;};var nda=require(_0x7939('0x0'));module[_0x7939('0x1')]={'nda':nda};
\ No newline at end of file
index 6390fb7..5c9ce11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','channelData','ProjectName','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url'];(function(_0x3a21c0,_0x348451){var _0x411e84=function(_0xdd7b02){while(--_0xdd7b02){_0x3a21c0['push'](_0x3a21c0['shift']());}};_0x411e84(++_0x348451);}(_0x0bb5,0x148));var _0x50bb=function(_0xf59184,_0x278da9){_0xf59184=_0xf59184-0x0;var _0x10d82d=_0x0bb5[_0xf59184];return _0x10d82d;};'use strict';var rp=require(_0x50bb('0x0'));var url=require(_0x50bb('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x50bb('0x2')]=function(_0x1aaa37,_0x6b7575){var _0x117e36={'method':_0x50bb('0x3'),'uri':url[_0x50bb('0x4')](_0x6b7575[_0x50bb('0x5')],_0x50bb('0x6')),'form':{'grant_type':'password','username':_0x6b7575['username'],'password':_0x6b7575[_0x50bb('0x7')]},'json':!![]};return rp(_0x117e36)[_0x50bb('0x8')](function(_0x2e5463){var _0x33ff54={'method':'POST','uri':url['resolve'](_0x6b7575[_0x50bb('0x9')],_0x50bb('0xa')),'body':{'type':_0x6b7575[_0x50bb('0xb')]||_0x50bb('0xc'),'channelId':'Nda','conversation':{'id':_0x1aaa37[_0x50bb('0xd')]},'from':{'id':_0x1aaa37[_0x50bb('0xe')],'name':_0x1aaa37[_0x50bb('0xf')]},'recipient':{'id':_0x1aaa37[_0x50bb('0x10')],'name':_0x1aaa37[_0x50bb('0x11')]},'text':_0x6b7575[_0x50bb('0x12')],'channelData':{}},'headers':{'Authorization':_0x50bb('0x13')+_0x2e5463['access_token']},'json':!![]};if(_0x6b7575[_0x50bb('0x14')]){_0x33ff54['body'][_0x50bb('0x15')][_0x50bb('0x16')]=_0x6b7575[_0x50bb('0x14')];}if(_0x6b7575['ndagenerate_audio']=='1'){_0x33ff54[_0x50bb('0x17')][_0x50bb('0x15')][_0x50bb('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x6b7575[_0x50bb('0x19')]){_0x33ff54['body'][_0x50bb('0x15')][_0x50bb('0x1a')]=_0x6b7575[_0x50bb('0x19')];if(_0x6b7575[_0x50bb('0x1b')]){_0x33ff54[_0x50bb('0x17')]['channelData'][_0x50bb('0x1c')]=_0x6b7575[_0x50bb('0x1b')];}}logger['info'](JSON[_0x50bb('0x1d')](_0x33ff54));return rp(_0x33ff54);});};
\ No newline at end of file
+var _0xde9d=['custom_action','CustomAction','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','then','ndassistant_url','message','Nda','uniqueid','calleridname','text','Bearer\x20','access_token','channelData','ProjectName','body','audio/wav'];(function(_0x51185b,_0x320003){var _0x14ae64=function(_0x356cb3){while(--_0x356cb3){_0x51185b['push'](_0x51185b['shift']());}};_0x14ae64(++_0x320003);}(_0xde9d,0x156));var _0xdde9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xde9d[_0x19e35c];return _0x3e1fe8;};'use strict';var rp=require(_0xdde9('0x0'));var url=require(_0xdde9('0x1'));var logger=require(_0xdde9('0x2'))(_0xdde9('0x3'));module[_0xdde9('0x4')]=function(_0x49fbbe,_0x2a7fa7){var _0x28cc44={'method':_0xdde9('0x5'),'uri':url['resolve'](_0x2a7fa7[_0xdde9('0x6')],_0xdde9('0x7')),'form':{'grant_type':_0xdde9('0x8'),'username':_0x2a7fa7['username'],'password':_0x2a7fa7[_0xdde9('0x8')]},'json':!![]};return rp(_0x28cc44)[_0xdde9('0x9')](function(_0x229168){var _0x3be8c1={'method':_0xdde9('0x5'),'uri':url['resolve'](_0x2a7fa7[_0xdde9('0xa')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x2a7fa7['ndaactivity_type']||_0xdde9('0xb'),'channelId':_0xdde9('0xc'),'conversation':{'id':_0x49fbbe[_0xdde9('0xd')]},'from':{'id':_0x49fbbe['callerid'],'name':_0x49fbbe[_0xdde9('0xe')]},'recipient':{'id':_0x49fbbe['dnid'],'name':_0x49fbbe['extension']},'text':_0x2a7fa7[_0xdde9('0xf')],'channelData':{}},'headers':{'Authorization':_0xdde9('0x10')+_0x229168[_0xdde9('0x11')]},'json':!![]};if(_0x2a7fa7['project']){_0x3be8c1['body'][_0xdde9('0x12')][_0xdde9('0x13')]=_0x2a7fa7['project'];}if(_0x2a7fa7['ndagenerate_audio']=='1'){_0x3be8c1[_0xdde9('0x14')][_0xdde9('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xdde9('0x15')};}if(_0x2a7fa7[_0xdde9('0x16')]){_0x3be8c1[_0xdde9('0x14')]['channelData'][_0xdde9('0x17')]=_0x2a7fa7['custom_action'];if(_0x2a7fa7['custom_action_data']){_0x3be8c1[_0xdde9('0x14')]['channelData']['CustomActionData']=_0x2a7fa7['custom_action_data'];}}logger[_0xdde9('0x18')](JSON[_0xdde9('0x19')](_0x3be8c1));return rp(_0x3be8c1);});};
\ No newline at end of file
index 178ecae..97d9986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa558=['./lib/api'];(function(_0x1d5a24,_0x12b487){var _0x322f43=function(_0x766e79){while(--_0x766e79){_0x1d5a24['push'](_0x1d5a24['shift']());}};_0x322f43(++_0x12b487);}(_0xa558,0x1a7));var _0x8a55=function(_0x205d4d,_0x4c1717){_0x205d4d=_0x205d4d-0x0;var _0x1bc898=_0xa558[_0x205d4d];return _0x1bc898;};'use strict';var asr=require(_0x8a55('0x0'));module['exports']=function(_0x3a783e,_0x532167,_0xe73306,_0x236ecd){return asr(_0x3a783e,_0x532167,_0xe73306,_0x236ecd);};
\ No newline at end of file
+var _0x79cd=['exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x79cd,0x17c));var _0xd79c=function(_0x1648a6,_0x38e0f3){_0x1648a6=_0x1648a6-0x0;var _0x161a07=_0x79cd[_0x1648a6];return _0x161a07;};'use strict';var asr=require('./lib/api');module[_0xd79c('0x0')]=function(_0x58e7e1,_0x2f5212,_0x1a32d3,_0x5219b8){return asr(_0x58e7e1,_0x2f5212,_0x1a32d3,_0x5219b8);};
\ No newline at end of file
index 90e24f9..625d58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe927=['agi','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','crypto','../../../../../../config/logger'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0xe927,0x193));var _0x7e92=function(_0x189e7c,_0x1de1c0){_0x189e7c=_0x189e7c-0x0;var _0xf85261=_0xe927[_0x189e7c];return _0xf85261;};'use strict';var BPromise=require(_0x7e92('0x0'));var _=require(_0x7e92('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x7e92('0x2'));var logger=require(_0x7e92('0x3'))(_0x7e92('0x4'));module['exports']=function(_0x4bdee5,_0x42ff00,_0x266571,_0x17f1b3){return new BPromise(function(_0x2f047b,_0x2fb79f){logger[_0x7e92('0x5')]('Tilde\x20URI',_0x17f1b3||_0x7e92('0x6'));var _0xbb7b7f=new WebSocket(_0x17f1b3||_0x7e92('0x6'),{'perMessageDeflate':![]});var _0x1a3877='';var _0x27b0f3='0';var _0x3994a1='1';var _0x41391b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4b14c2(_0x55c13a){var _0x209bb7=crypto['createHash']('sha1');_0x209bb7[_0x7e92('0x7')](_0x55c13a);return _0x209bb7[_0x7e92('0x8')](_0x7e92('0x9'));}function _0x14ea4b(){try{logger[_0x7e92('0x5')](_0x7e92('0xa'));var _0x44874d=moment()[_0x7e92('0xb')]();var _0x59831d=_0x4b14c2(_0x44874d+_0x42ff00+_0x266571);_0xbb7b7f[_0x7e92('0xc')](JSON[_0x7e92('0xd')]({'appID':_0x42ff00,'timestamp':_0x44874d,'appKey':_0x59831d}));var _0x9fafe8=fs[_0x7e92('0xe')](_0x4bdee5);_0x9fafe8['on']('data',function(_0x192eab){_0xbb7b7f[_0x7e92('0xc')](_0x192eab);});_0x9fafe8['on'](_0x7e92('0xf'),function(){_0xbb7b7f[_0x7e92('0xc')](_0x7e92('0x10'));});}catch(_0x5a1c80){logger[_0x7e92('0x11')](_0x7e92('0x12'),JSON[_0x7e92('0xd')](_0x5a1c80));_0xbb7b7f[_0x7e92('0x13')]();}}function _0x1455f7(_0x41567b){try{if(_0x41567b){var _0xcc07b5=JSON[_0x7e92('0x14')](_0x41567b);switch(_0xcc07b5[_0x7e92('0x15')]){case 0x0:if(_0xcc07b5[_0x7e92('0x16')]){if(_0xcc07b5['result']['final']){logger[_0x7e92('0x5')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')]));_0x1a3877=_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')][0x0][_0x7e92('0x18')];_0x27b0f3=_0xcc07b5[_0x7e92('0x16')][_0x7e92('0x17')][0x0][_0x7e92('0x19')];_0x3994a1='0';_0x41391b=_0x7e92('0x1a');_0xbb7b7f['terminate']();}}break;case 0x1:logger['info'](_0x7e92('0x1b'));_0x3994a1='1';_0x41391b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x7e92('0x5')](_0x7e92('0x1c'));_0x3994a1='2';_0x41391b=_0x7e92('0x1c');break;case 0x9:logger[_0x7e92('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3994a1='9';_0x41391b=_0x7e92('0x1d');break;case 0xa:logger[_0x7e92('0x5')](_0x7e92('0x1e'));_0x3994a1='10';_0x41391b='Authentication\x20failed.';break;case 0xb:logger[_0x7e92('0x5')](_0x7e92('0x1f'));_0x3994a1='11';_0x41391b=_0x7e92('0x1f');}}}catch(_0x13c9bf){logger[_0x7e92('0x11')](_0x7e92('0x20'),JSON[_0x7e92('0xd')](_0x13c9bf));_0xbb7b7f[_0x7e92('0x13')]();}}function _0x398d4e(){logger[_0x7e92('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x2f047b({'transcript':_0x1a3877,'confidence':_0x27b0f3,'status':_0x3994a1,'status_message':_0x41391b});}function _0x19baf3(_0x2234fb){logger[_0x7e92('0x11')](_0x7e92('0x21'));if(!_[_0x7e92('0x22')](_0x2234fb)){logger[_0x7e92('0x11')](_[_0x7e92('0x23')](_0x2234fb)?JSON[_0x7e92('0xd')](_0x2234fb):_0x2234fb);}}_0xbb7b7f['on']('open',_0x14ea4b);_0xbb7b7f['on'](_0x7e92('0x24'),_0x1455f7);_0xbb7b7f['on']('close',_0x398d4e);_0xbb7b7f['on'](_0x7e92('0x11'),_0x19baf3);});};
\ No newline at end of file
+var _0xd20e=['Tilde\x20ASR\x20hypoteses','result','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','unix','stringify','createReadStream','data','close','send','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','final'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0xd20e,0x12c));var _0xed20=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd20e[_0xdea41a];return _0x15d0d8;};'use strict';var BPromise=require('bluebird');var _=require(_0xed20('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xed20('0x1'));var crypto=require(_0xed20('0x2'));var logger=require(_0xed20('0x3'))(_0xed20('0x4'));module['exports']=function(_0x51a818,_0x1ddeb3,_0x20b4f9,_0x27ed20){return new BPromise(function(_0x4091cc,_0x3c8acc){logger['info']('Tilde\x20URI',_0x27ed20||_0xed20('0x5'));var _0x55f1c4=new WebSocket(_0x27ed20||_0xed20('0x5'),{'perMessageDeflate':![]});var _0x261d88='';var _0x1d9ecc='0';var _0xc367bf='1';var _0x5def=_0xed20('0x6');function _0x47a14c(_0x20369b){var _0x43147f=crypto['createHash'](_0xed20('0x7'));_0x43147f[_0xed20('0x8')](_0x20369b);return _0x43147f[_0xed20('0x9')](_0xed20('0xa'));}function _0x1d539d(){try{logger[_0xed20('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x3d5b8c=moment()[_0xed20('0xc')]();var _0x15277b=_0x47a14c(_0x3d5b8c+_0x1ddeb3+_0x20b4f9);_0x55f1c4['send'](JSON[_0xed20('0xd')]({'appID':_0x1ddeb3,'timestamp':_0x3d5b8c,'appKey':_0x15277b}));var _0x28836c=fs[_0xed20('0xe')](_0x51a818);_0x28836c['on'](_0xed20('0xf'),function(_0x1a46c5){_0x55f1c4['send'](_0x1a46c5);});_0x28836c['on'](_0xed20('0x10'),function(){_0x55f1c4[_0xed20('0x11')]('EOS');});}catch(_0x27515f){logger[_0xed20('0x12')](_0xed20('0x13'),JSON[_0xed20('0xd')](_0x27515f));_0x55f1c4[_0xed20('0x14')]();}}function _0x590185(_0x6b79d1){try{if(_0x6b79d1){var _0x349468=JSON[_0xed20('0x15')](_0x6b79d1);switch(_0x349468[_0xed20('0x16')]){case 0x0:if(_0x349468['result']){if(_0x349468['result'][_0xed20('0x17')]){logger[_0xed20('0xb')](_0xed20('0x18'),JSON['stringify'](_0x349468[_0xed20('0x19')][_0xed20('0x1a')]));_0x261d88=_0x349468[_0xed20('0x19')][_0xed20('0x1a')][0x0][_0xed20('0x1b')];_0x1d9ecc=_0x349468[_0xed20('0x19')][_0xed20('0x1a')][0x0][_0xed20('0x1c')];_0xc367bf='0';_0x5def=_0xed20('0x1d');_0x55f1c4[_0xed20('0x14')]();}}break;case 0x1:logger[_0xed20('0xb')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0xc367bf='1';_0x5def=_0xed20('0x6');break;case 0x2:logger[_0xed20('0xb')](_0xed20('0x1e'));_0xc367bf='2';_0x5def=_0xed20('0x1e');break;case 0x9:logger[_0xed20('0xb')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xc367bf='9';_0x5def='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xed20('0x1f'));_0xc367bf='10';_0x5def='Authentication\x20failed.';break;case 0xb:logger[_0xed20('0xb')](_0xed20('0x20'));_0xc367bf='11';_0x5def='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5adb3d){logger[_0xed20('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xed20('0xd')](_0x5adb3d));_0x55f1c4['terminate']();}}function _0x5bdecd(){logger[_0xed20('0xb')]('Close\x20Tilde\x20ASR\x20socket');_0x4091cc({'transcript':_0x261d88,'confidence':_0x1d9ecc,'status':_0xc367bf,'status_message':_0x5def});}function _0xa5622a(_0xbf0fe9){logger[_0xed20('0x12')](_0xed20('0x21'));if(!_['isNil'](_0xbf0fe9)){logger[_0xed20('0x12')](_['isObject'](_0xbf0fe9)?JSON[_0xed20('0xd')](_0xbf0fe9):_0xbf0fe9);}}_0x55f1c4['on'](_0xed20('0x22'),_0x1d539d);_0x55f1c4['on'](_0xed20('0x23'),_0x590185);_0x55f1c4['on']('close',_0x5bdecd);_0x55f1c4['on'](_0xed20('0x12'),_0xa5622a);});};
\ No newline at end of file
index 860e803..9efb476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f2=['exports','./asr'];(function(_0x2d7e09,_0x16be83){var _0x1ba707=function(_0x4d3063){while(--_0x4d3063){_0x2d7e09['push'](_0x2d7e09['shift']());}};_0x1ba707(++_0x16be83);}(_0x09f2,0x1e7));var _0x209f=function(_0x45cb03,_0x2c48dd){_0x45cb03=_0x45cb03-0x0;var _0x35d94f=_0x09f2[_0x45cb03];return _0x35d94f;};var asr=require(_0x209f('0x0'));module[_0x209f('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x6ed9=['./asr','exports'];(function(_0x602436,_0xbf433){var _0x504c33=function(_0x4770a0){while(--_0x4770a0){_0x602436['push'](_0x602436['shift']());}};_0x504c33(++_0xbf433);}(_0x6ed9,0x1b6));var _0x96ed=function(_0x653d5,_0xfe14a0){_0x653d5=_0x653d5-0x0;var _0xbf380a=_0x6ed9[_0x653d5];return _0xbf380a;};var asr=require(_0x96ed('0x0'));module[_0x96ed('0x1')]={'asr':asr};
\ No newline at end of file
index e1a8b61..683f7ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x118a=['error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections'];(function(_0x2e5405,_0x42ec09){var _0x2f0270=function(_0x70c5c8){while(--_0x70c5c8){_0x2e5405['push'](_0x2e5405['shift']());}};_0x2f0270(++_0x42ec09);}(_0x118a,0x183));var _0xa118=function(_0x1a4164,_0x523316){_0x1a4164=_0x1a4164-0x0;var _0x579fda=_0x118a[_0x1a4164];return _0x579fda;};'use strict';var util=require(_0xa118('0x0'));var net=require('net');var EventEmitter=require(_0xa118('0x1'))[_0xa118('0x2')];var AGIError=require(_0xa118('0x3'));var AGIChannel=require(_0xa118('0x4'));var AGIServer=function(_0xdd77b3,_0x4ce730,_0x58689c){var _0x153e50=this,_0xdd77b3=_0xdd77b3||0x11dd,_0x4ce730=_0x4ce730||_0xa118('0x5'),_0x43f050=null,_0x4219d9=0x0;EventEmitter[_0xa118('0x6')](_0x153e50);function _0x129e9f(){if(!_0xdd77b3){_0x153e50[_0xa118('0x7')]('error',new AGIError(_0xa118('0x8')));return![];}_0x43f050=net['createServer']();_0x43f050[_0xa118('0x9')](_0xdd77b3,_0x4ce730);_0x43f050['on'](_0xa118('0xa'),function(){_0x153e50[_0xa118('0x7')](_0xa118('0xa'));});_0x43f050['on'](_0xa118('0xb'),function(_0x4e61e5){_0x43f050[_0xa118('0xc')](function(_0x56172f,_0x358219){if(_0x56172f){_0x153e50[_0xa118('0x7')](_0xa118('0xd'),new AGIError(_0xa118('0xe'),_0x56172f));}else if(_0x58689c&&_0x58689c<0x0){_0x153e50[_0xa118('0x7')]('error',new AGIError(_0xa118('0xf')));_0x4e61e5[_0xa118('0x10')]();}else if(_0x58689c&&_0x58689c>0x0&&_0x58689c<_0x358219){_0x4219d9+=0x1;_0x153e50[_0xa118('0x7')](_0xa118('0xd'),new AGIError(_0xa118('0x11'),_0x4219d9));_0x4e61e5[_0xa118('0x10')]();}else{var _0x3832c7=new AGIChannel(_0x4e61e5);_0x3832c7['on'](_0xa118('0x12'),function(){_0x153e50[_0xa118('0x7')](_0xa118('0xb'),_0x3832c7);});}});});_0x43f050['on'](_0xa118('0xd'),function(_0x1c942a){_0x153e50['emit'](_0xa118('0xd'),new AGIError(_0xa118('0xe'),_0x1c942a[_0xa118('0x13')]));});_0x43f050['on'](_0xa118('0x14'),function(){_0x153e50['emit'](_0xa118('0x14'),new AGIError(_0xa118('0x15')));});}process[_0xa118('0x16')](function(){_0x129e9f();});};util[_0xa118('0x17')](AGIServer,EventEmitter);module[_0xa118('0x18')]=function(_0x173fcc,_0x2d4428,_0x4a4968){return new AGIServer(_0x173fcc,_0x2d4428,_0x4a4968);};
\ No newline at end of file
+var _0x1ebe=['destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','events','EventEmitter','./error','./channel','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED'];(function(_0xfc78ef,_0x3f983e){var _0x166f2f=function(_0x18d20f){while(--_0x18d20f){_0xfc78ef['push'](_0xfc78ef['shift']());}};_0x166f2f(++_0x3f983e);}(_0x1ebe,0x178));var _0xe1eb=function(_0xd20418,_0x301399){_0xd20418=_0xd20418-0x0;var _0x1c648a=_0x1ebe[_0xd20418];return _0x1c648a;};'use strict';var util=require(_0xe1eb('0x0'));var net=require(_0xe1eb('0x1'));var EventEmitter=require(_0xe1eb('0x2'))[_0xe1eb('0x3')];var AGIError=require(_0xe1eb('0x4'));var AGIChannel=require(_0xe1eb('0x5'));var AGIServer=function(_0x41bfd3,_0x4a00e5,_0x3c48e4){var _0xf8366f=this,_0x41bfd3=_0x41bfd3||0x11dd,_0x4a00e5=_0x4a00e5||'127.0.0.1',_0xef0b46=null,_0x3bebea=0x0;EventEmitter['call'](_0xf8366f);function _0x176474(){if(!_0x41bfd3){_0xf8366f[_0xe1eb('0x6')](_0xe1eb('0x7'),new AGIError(_0xe1eb('0x8')));return![];}_0xef0b46=net[_0xe1eb('0x9')]();_0xef0b46[_0xe1eb('0xa')](_0x41bfd3,_0x4a00e5);_0xef0b46['on'](_0xe1eb('0xb'),function(){_0xf8366f[_0xe1eb('0x6')]('listening');});_0xef0b46['on'](_0xe1eb('0xc'),function(_0x986935){_0xef0b46['getConnections'](function(_0xd187f4,_0x2dda17){if(_0xd187f4){_0xf8366f[_0xe1eb('0x6')]('error',new AGIError(_0xe1eb('0xd'),_0xd187f4));}else if(_0x3c48e4&&_0x3c48e4<0x0){_0xf8366f[_0xe1eb('0x6')]('error',new AGIError(_0xe1eb('0xe')));_0x986935[_0xe1eb('0xf')]();}else if(_0x3c48e4&&_0x3c48e4>0x0&&_0x3c48e4<_0x2dda17){_0x3bebea+=0x1;_0xf8366f[_0xe1eb('0x6')](_0xe1eb('0x7'),new AGIError(_0xe1eb('0x10'),_0x3bebea));_0x986935['destroy']();}else{var _0x1696e0=new AGIChannel(_0x986935);_0x1696e0['on'](_0xe1eb('0x11'),function(){_0xf8366f[_0xe1eb('0x6')](_0xe1eb('0xc'),_0x1696e0);});}});});_0xef0b46['on'](_0xe1eb('0x7'),function(_0x59bbc5){_0xf8366f[_0xe1eb('0x6')](_0xe1eb('0x7'),new AGIError(_0xe1eb('0xd'),_0x59bbc5[_0xe1eb('0x12')]));});_0xef0b46['on']('close',function(){_0xf8366f[_0xe1eb('0x6')](_0xe1eb('0x13'),new AGIError(_0xe1eb('0x14')));});}process[_0xe1eb('0x15')](function(){_0x176474();});};util['inherits'](AGIServer,EventEmitter);module[_0xe1eb('0x16')]=function(_0x49e619,_0x1368b6,_0x4c55a1){return new AGIServer(_0x49e619,_0x1368b6,_0x4c55a1);};
\ No newline at end of file
index 8184674..0168fdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0cb=['split','join','exports','path','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','createSquareRecording','callerid','calleridname','context','extension','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','audioEncoding','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','parse','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appid','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','extra','getAndSetVariable','getVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','minutes','sync','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','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','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','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','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','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20selected','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xb0cb,0x1d0));var _0xbb0c=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb0cb[_0x4c440b];return _0x2d48cf;};'use strict';var fs=require('fs');var path=require(_0xbb0c('0x0'));var util=require('util');var _=require(_0xbb0c('0x1'));var sh=require(_0xbb0c('0x2'));var odbc=require(_0xbb0c('0x3'))();var rs=require(_0xbb0c('0x4'));var moment=require(_0xbb0c('0x5'));var Mustache=require(_0xbb0c('0x6'));var rp=require(_0xbb0c('0x7'));var logger=require(_0xbb0c('0x8'))(_0xbb0c('0x9'));var config=require(_0xbb0c('0xa'));var scripts=require(_0xbb0c('0xb'));var FILES_PATH=_0xbb0c('0xc');var recursiveMapAttributes=[_0xbb0c('0xd'),_0xbb0c('0xe')];var verticesWithRetry=['menu',_0xbb0c('0xf'),_0xbb0c('0x10')];var AGIVertices=function(_0x4b11a3,_0x1632a4,_0x41f9bb){this[_0xbb0c('0x11')]=_0x4b11a3;this['rpc']=_0x1632a4;this[_0xbb0c('0x12')]=_0x41f9bb;};AGIVertices[_0xbb0c('0x13')]['getVariable']=function(_0x129402,_0x1633fb){this[_0xbb0c('0x14')][_0xbb0c('0x15')](_0x129402)['then'](function(_0x4ef046){_0x1633fb(null,_0x4ef046?_0x4ef046[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x2a2a89){_0x1633fb(_0x2a2a89);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x18')]=function(_0xcbe86b,_0x5c1262){this[_0xbb0c('0x14')][_0xbb0c('0x19')](_0xcbe86b)[_0xbb0c('0x1a')](function(_0x3e7e19){_0x5c1262(null,_0x3e7e19?_0x3e7e19[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x2d9ad5){_0x5c1262(_0x2d9ad5);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b')]=function(_0x1ecbfe,_0x2987e9){this['rpc'][_0xbb0c('0x1c')](_0x1ecbfe)[_0xbb0c('0x1a')](function(_0x50897d){_0x2987e9(null,_0x50897d?_0x50897d['name']:![]);})['catch'](function(_0x487a5c){_0x2987e9(_0x487a5c);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1d')]=function(_0x5460b1,_0x5e6d75){this[_0xbb0c('0x14')]['getSquareOdbcById'](_0x5460b1)[_0xbb0c('0x1a')](function(_0x1595ee){_0x5e6d75(null,_0x1595ee?_0x1595ee[_0xbb0c('0x1e')]:![]);})[_0xbb0c('0x17')](function(_0x2e5702){_0x5e6d75(_0x2e5702);});};AGIVertices['prototype'][_0xbb0c('0x1f')]=function(_0x23e034,_0x48ae39){this[_0xbb0c('0x14')][_0xbb0c('0x20')](_0x23e034)[_0xbb0c('0x1a')](function(_0x35b172){_0x48ae39(null,_0x35b172?_0x35b172[_0xbb0c('0x16')]:![]);})['catch'](function(_0x4b0d75){_0x48ae39(_0x4b0d75);});};AGIVertices['prototype'][_0xbb0c('0x21')]=function(_0x3fde1c,_0x4798f7){this['rpc'][_0xbb0c('0x22')](_0x3fde1c)[_0xbb0c('0x1a')](function(_0x247073){_0x4798f7(null,_0x247073?_0x247073[_0xbb0c('0x16')]:![]);})[_0xbb0c('0x17')](function(_0x544faa){_0x4798f7(_0x544faa);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x23')]=function(_0x5e51f3,_0x39d607){var _0x4f38c6=this;this['rpc'][_0xbb0c('0x24')](_0x5e51f3)[_0xbb0c('0x1a')](function(_0xb1fe66){_0x39d607(null,_0xb1fe66?_0x4f38c6[_0xbb0c('0x25')](_0xb1fe66[_0xbb0c('0x26')]):![]);})[_0xbb0c('0x17')](function(_0x30f616){_0x39d607(_0x30f616);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x27')]=function(_0x3315a9,_0x56cdaa){this[_0xbb0c('0x14')][_0xbb0c('0x28')](_0x3315a9)['then'](function(_0x680b3e){_0x56cdaa(null,_0x680b3e?_0x680b3e:![]);})[_0xbb0c('0x17')](function(_0x5dbd58){_0x56cdaa(_0x5dbd58);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x29')]=function(_0x4a129a,_0x353b11,_0x52eb5b){this[_0xbb0c('0x12')][_0xbb0c('0x29')](_0x4a129a,_0x353b11)[_0xbb0c('0x1a')](function(){_0x52eb5b(null);})[_0xbb0c('0x17')](function(_0x2bbbe0){_0x52eb5b(_0x2bbbe0);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x2a')]=function(_0x4beee0,_0x156d78){this[_0xbb0c('0x14')][_0xbb0c('0x2b')](_0x4beee0)[_0xbb0c('0x1a')](function(_0xc1de4b){if(_0xc1de4b){if(_0xc1de4b[_0xbb0c('0x2c')]){_0x156d78(null,[_0xc1de4b[_0xbb0c('0x2d')]]);}else{_0x156d78(null,_[_0xbb0c('0x2e')](_0xc1de4b[_0xbb0c('0x2f')],_0xbb0c('0x2d')));}}else{_0x156d78(null,![]);}})[_0xbb0c('0x17')](function(_0x4ec654){_0x156d78(_0x4ec654);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x25')]=function(_0x3d1a27){return util['format'](_0xbb0c('0x30'),FILES_PATH,_0x3d1a27);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x31')]=function(_0x2d4f87,_0x558fa4,_0x56883e){odbc[_0xbb0c('0x32')](_0x2d4f87,function(_0x5a1943){if(_0x5a1943){logger[_0xbb0c('0x33')](_0xbb0c('0x34'),_0x5a1943);_0x56883e(_0x5a1943);}else{logger[_0xbb0c('0x35')]('ODBC\x20connection\x20successfully');odbc[_0xbb0c('0x36')](_0x558fa4,function(_0x246f46,_0x334375){if(_0x246f46){logger[_0xbb0c('0x35')](_0xbb0c('0x37'),_0x558fa4);_0x56883e(_0x246f46);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x558fa4);odbc[_0xbb0c('0x38')](function(_0x5dae40){if(_0x5dae40){logger[_0xbb0c('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x5dae40);}_0x56883e(null,_0x334375);});}});}});};AGIVertices['prototype'][_0xbb0c('0x39')]=function(_0x48c389,_0x1a33af){this[_0xbb0c('0x14')][_0xbb0c('0x3a')](_0x48c389)[_0xbb0c('0x1a')](function(_0x27a8ef){_0x1a33af(null,_0x27a8ef?_0x27a8ef:![]);})['catch'](function(_0x803c0a){_0x1a33af(_0x803c0a);});};AGIVertices[_0xbb0c('0x13')]['createSmsMessage']=function(_0x16a8ad,_0x231cfa){this[_0xbb0c('0x14')][_0xbb0c('0x3b')](_0x16a8ad)['then'](function(_0x3c595f){_0x231cfa(null,_0x3c595f);})['catch'](function(_0x4402d3){_0x231cfa(_0x4402d3);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x3c')]=function(_0x5d5f53,_0x3adf8d,_0x3469a6){this[_0xbb0c('0x14')][_0xbb0c('0x3c')]({'uniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'node':_0x5d5f53[_0xbb0c('0x3e')],'application':_0x5d5f53['agicommand'],'data':_0x3adf8d||null,'project_name':this[_0xbb0c('0x11')]['arg_1'],'callerid':this[_0xbb0c('0x11')]['callerid']})[_0xbb0c('0x1a')](function(_0x18a30c){if(_0x3469a6){_0x3469a6(null,_0x18a30c);}})['catch'](function(_0x42e87f){if(_0x3469a6){_0x3469a6(_0x42e87f);}});};AGIVertices[_0xbb0c('0x13')]['createSquareRecording']=function(_0x3cad26,_0x1faa94,_0x12dc5f,_0x1a2b85){this[_0xbb0c('0x14')][_0xbb0c('0x3f')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0xbb0c('0x11')][_0xbb0c('0x40')],'calleridname':this[_0xbb0c('0x11')][_0xbb0c('0x41')],'context':this[_0xbb0c('0x11')][_0xbb0c('0x42')],'extension':this['channel'][_0xbb0c('0x43')],'priority':this[_0xbb0c('0x11')]['priority'],'accountcode':this[_0xbb0c('0x11')][_0xbb0c('0x44')],'dnid':this[_0xbb0c('0x11')]['dnid'],'projectName':this[_0xbb0c('0x11')][_0xbb0c('0x45')],'saveName':_0x1faa94,'filename':_0x3cad26[_0xbb0c('0x46')]||_0x1faa94,'savePath':_0x12dc5f})['then'](function(_0x32be21){_0x1a2b85(null,_0x32be21);})['catch'](function(_0x31dd9e){_0x1a2b85(_0x31dd9e);});};AGIVertices['prototype']['createSquareMessage']=function(_0x4be952,_0x17027d,_0x39c2cd,_0x4d9274,_0x4435ab){this[_0xbb0c('0x14')][_0xbb0c('0x47')]({'uniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'body':_0x4be952,'direction':_0x17027d,'providerName':_0x39c2cd,'providerResponse':_0x4d9274})['then'](function(_0x22d466){if(_0x4435ab){_0x4435ab(null,_0x22d466);}})['catch'](function(_0x4e5b33){if(_0x4435ab){_0x4435ab(_0x4e5b33);}});};AGIVertices[_0xbb0c('0x13')]['createCmContact']=function(_0x263f9f,_0x24653b){this[_0xbb0c('0x14')][_0xbb0c('0x48')]({'firstName':_[_0xbb0c('0x49')](_0x263f9f[_0xbb0c('0x16')])||_[_0xbb0c('0x4a')](_0x263f9f['name'])?_0xbb0c('0x4b')+Math[_0xbb0c('0x4c')]():_0x263f9f['name'],'lastName':_['isEmpty'](_0x263f9f[_0xbb0c('0x4d')])||_[_0xbb0c('0x4a')](_0x263f9f['lastName'])?null:_0x263f9f[_0xbb0c('0x4d')],'phone':_0x263f9f[_0xbb0c('0x4e')],'ListId':_0x263f9f['list_id'],'scheduledat':_0x263f9f[_0xbb0c('0x4f')],'callbackUniqueid':this[_0xbb0c('0x11')][_0xbb0c('0x3d')],'tags':'callback','description':_0xbb0c('0x50')+_0x263f9f[_0xbb0c('0x4f')][_0xbb0c('0x51')](),'priority':_0x263f9f[_0xbb0c('0x52')]})[_0xbb0c('0x1a')](function(_0x2f1df9){_0x24653b(null,_0x2f1df9);})[_0xbb0c('0x17')](function(_0x209744){_0x24653b(_0x209744);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x53')]=function(_0x31d0d0,_0x33a718){this[_0xbb0c('0x14')][_0xbb0c('0x54')](_0x31d0d0)[_0xbb0c('0x1a')](function(_0x264312){_0x33a718(null,_0x264312?_0x264312['name']:![]);})[_0xbb0c('0x17')](function(_0x50cbc7){_0x33a718(_0x50cbc7);});};AGIVertices[_0xbb0c('0x13')]['agentPause']=function(_0xd5bf97,_0x2ebf6b,_0x4d2742){var _0x166b35={'role':_0xbb0c('0x55')};_0x166b35[_0xd5bf97]=this[_0xbb0c('0x11')][_0xbb0c('0x40')];this['rpc']['agentPause'](_0x166b35,_0x2ebf6b,this[_0xbb0c('0x11')][_0xbb0c('0x3d')])[_0xbb0c('0x1a')](function(_0x16a6b0){_0x4d2742(null,_[_0xbb0c('0x4a')](_0x16a6b0)?![]:!![]);})[_0xbb0c('0x17')](function(_0x263622){logger[_0xbb0c('0x33')](_0x263622);_0x4d2742(null,![]);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x56')]=function(_0x28f0d6,_0x80aef8){var _0x56a0e7={'role':_0xbb0c('0x55')};_0x56a0e7[_0x28f0d6]=this[_0xbb0c('0x11')]['callerid'];this[_0xbb0c('0x14')][_0xbb0c('0x56')](_0x56a0e7)['then'](function(_0xe51716){_0x80aef8(null,_['isNil'](_0xe51716)?![]:!![]);})[_0xbb0c('0x17')](function(_0x3535a9){logger['error'](_0x3535a9);_0x80aef8(null,![]);});};AGIVertices['prototype'][_0xbb0c('0x57')]=function(_0x303827,_0x503c0e){var _0xec57e5={'role':'agent'};_0xec57e5[_0x303827]=this[_0xbb0c('0x11')][_0xbb0c('0x40')];this[_0xbb0c('0x14')][_0xbb0c('0x57')](_0xec57e5)[_0xbb0c('0x1a')](function(_0x471908){_0x503c0e(null,_['isNil'](_0x471908)?![]:!![]);})['catch'](function(_0x199a8e){logger[_0xbb0c('0x33')](_0x199a8e);_0x503c0e(null,![]);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x58')]=function(_0x90b48f,_0x2de891){var _0x4655d8={'role':_0xbb0c('0x55')};_0x4655d8[_0x90b48f]=this['channel'][_0xbb0c('0x40')];var _0x214aec=_0x90b48f!=_0xbb0c('0x59')?util[_0xbb0c('0x5a')](_0xbb0c('0x5b'),'LOCAL',this[_0xbb0c('0x11')][_0xbb0c('0x40')]):undefined;this[_0xbb0c('0x14')][_0xbb0c('0x58')](_0x4655d8,_0x214aec)[_0xbb0c('0x1a')](function(_0x59d097){_0x2de891(null,_[_0xbb0c('0x4a')](_0x59d097)?![]:!![]);})[_0xbb0c('0x17')](function(_0x59c0e9){logger[_0xbb0c('0x33')](_0x59c0e9);_0x2de891(null,![]);});};AGIVertices['prototype'][_0xbb0c('0x5c')]=function(_0x35a3f9,_0x15e794){sh[_0xbb0c('0x5d')](_[_0xbb0c('0x5e')](_0x35a3f9),function(_0x4eeead,_0x2bdf66){var _0x253e30=_0x2bdf66[_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'');_0x15e794(null,_0x253e30);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x60')]=function(_0x474a6f,_0x3b993f){scripts['googleCloudTTS'](_0x474a6f[_0xbb0c('0x61')],_0x474a6f[_0xbb0c('0x62')]||_0xbb0c('0x63'),_0x474a6f['text'],_0x474a6f['languageCode']||_0xbb0c('0x64'),_0x474a6f['ssmlGender']||'MALE',_0x474a6f[_0xbb0c('0x65')]||'MP3')[_0xbb0c('0x1a')](function(_0x49260b){_0x3b993f(null,_0x49260b);})[_0xbb0c('0x17')](function(_0x147159){_0x3b993f(_0x147159);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x66')]=function(_0x36e97d,_0x30da4a){scripts[_0xbb0c('0x66')](_0x36e97d[_0xbb0c('0x63')],_0x36e97d['google_tts_language']||'en',0x1)[_0xbb0c('0x1a')](function(_0x5f3acd){_0x30da4a(null,_0x5f3acd);})[_0xbb0c('0x17')](function(_0xcf1667){_0x30da4a(_0xcf1667);});};AGIVertices['prototype'][_0xbb0c('0x67')]=function(_0x3ffa0c,_0x31ab70){var _0x2c1452={'uri':_0x3ffa0c[_0xbb0c('0x68')],'method':_0x3ffa0c[_0xbb0c('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3ffa0c[_0xbb0c('0x6a')])===_0xbb0c('0x6b')&&parseInt(_0x3ffa0c[_0xbb0c('0x6a')])>=0x1?parseInt(_0x3ffa0c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xbb0c('0x6c')]([_0xbb0c('0x6d'),_0xbb0c('0x6e')],_0x2c1452[_0xbb0c('0x69')][_0xbb0c('0x6f')]())){try{_0x2c1452[_0xbb0c('0x70')]=_0x3ffa0c[_0xbb0c('0xe')]?JSON['parse'](_0x3ffa0c['rawBody']):{};}catch(_0x29736c){logger[_0xbb0c('0x33')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x29736c);}}try{_0x2c1452[_0xbb0c('0x71')]=_0x3ffa0c[_0xbb0c('0xd')]?JSON[_0xbb0c('0x72')](_0x3ffa0c['rawHeaders']):{};}catch(_0x4bcb60){logger[_0xbb0c('0x33')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4bcb60);}if(_0x3ffa0c[_0xbb0c('0x73')]){try{var _0x412724=require(_0x3ffa0c['computedVariables'])['sync'](this,_0x2c1452);_0x2c1452[_0xbb0c('0x74')]=Mustache[_0xbb0c('0x75')](_0x3ffa0c[_0xbb0c('0x68')],_0x412724,{},['$$','$$']);if(_0x2c1452[_0xbb0c('0x71')]){_0x2c1452[_0xbb0c('0x71')]=JSON[_0xbb0c('0x72')](Mustache[_0xbb0c('0x75')](JSON[_0xbb0c('0x76')](_0x2c1452[_0xbb0c('0x71')]),_0x412724,{},['$$','$$']));}if(_0x2c1452[_0xbb0c('0x70')]){_0x2c1452[_0xbb0c('0x70')]=JSON['parse'](Mustache[_0xbb0c('0x75')](JSON['stringify'](_0x2c1452['body']),_0x412724,{},['$$','$$']));}}catch(_0x951239){logger[_0xbb0c('0x33')](_0xbb0c('0x77'),_0x951239);}}rp(_0x2c1452)['then'](function(_0x32de69){var _0x18be5f={'statusCode':_0x32de69['statusCode']||0xc8,'statusMessage':_0x32de69[_0xbb0c('0x78')]||'OK','headers':_0x32de69[_0xbb0c('0x71')]||{},'body':_0x32de69['body']||{}};_0x31ab70(null,_0x18be5f);})['catch'](function(_0x3370e8){var _0x28e762={'statusCode':_0x3370e8[_0xbb0c('0x79')]||0x1f4,'statusMessage':_0x3370e8[_0xbb0c('0x7a')]||_0xbb0c('0x7b'),'headers':_0x3370e8[_0xbb0c('0x7c')][_0xbb0c('0x71')]||{},'body':_0x3370e8['options'][_0xbb0c('0x70')]||{}};_0x31ab70(null,_0x28e762);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x7d')]=function(_0x9369f,_0x4c506e){scripts[_0xbb0c('0x7d')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x9369f[_0xbb0c('0x7e')],_0x9369f[_0xbb0c('0x63')],_0x9369f['dialogflow_language']||'en')[_0xbb0c('0x1a')](function(_0x50d3f8){_0x4c506e(null,_0x50d3f8);})[_0xbb0c('0x17')](function(_0x4fad06){_0x4c506e(_0x4fad06);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x7f')]=function(_0x2e8102,_0x516335){scripts[_0xbb0c('0x7f')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x2e8102[_0xbb0c('0x80')],_0x2e8102[_0xbb0c('0x81')],_0x2e8102[_0xbb0c('0x82')],_0x2e8102[_0xbb0c('0x63')],_0x2e8102['dialogflowV2_language']||'en')[_0xbb0c('0x1a')](function(_0x55ee5c){_0x516335(null,_0x55ee5c);})['catch'](function(_0x4392ff){_0x516335(_0x4392ff);});};AGIVertices[_0xbb0c('0x13')]['sestekNDA']=function(_0x18bcee,_0x69c614){scripts['sestekNDA'](this[_0xbb0c('0x11')],_0x18bcee)[_0xbb0c('0x1a')](function(_0xa9910d){_0x69c614(null,_0xa9910d);})['catch'](function(_0xa1ee27){_0x69c614(_0xa1ee27);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x83')]=function(_0x245ef1,_0x2a144a){scripts[_0xbb0c('0x83')](_0x245ef1['key'],_0x245ef1['text'],_0x245ef1['ispeech_tts_language']||'en-US',_0x245ef1[_0xbb0c('0x84')])['then'](function(_0x5638ca){_0x2a144a(null,_0x5638ca);})[_0xbb0c('0x17')](function(_0x3f500c){_0x2a144a(_0x3f500c);});};AGIVertices['prototype'][_0xbb0c('0x85')]=function(_0x219c1c,_0x11d814,_0x200a70){scripts[_0xbb0c('0x85')](_0x11d814,_0x219c1c[_0xbb0c('0x7e')],_0x219c1c['ispeech_asr_language']||_0xbb0c('0x64'),this[_0xbb0c('0x86')](_0x219c1c[_0xbb0c('0x87')])?_0x219c1c[_0xbb0c('0x87')]:undefined)[_0xbb0c('0x1a')](function(_0x5b273f){_0x200a70(null,_0x5b273f);})['catch'](function(_0xb83d8f){_0x200a70(_0xb83d8f);});};AGIVertices['prototype'][_0xbb0c('0x88')]=function(_0x4148f5,_0x5f4449){scripts[_0xbb0c('0x88')](_0x4148f5[_0xbb0c('0x89')],_0x4148f5['aws_secret_access_key'],_0x4148f5[_0xbb0c('0x8a')],_0x4148f5[_0xbb0c('0x8b')]||'Amy',_0x4148f5[_0xbb0c('0x63')],_0x4148f5[_0xbb0c('0x8c')]||_0xbb0c('0x63'))['then'](function(_0x5897a4){_0x5f4449(null,_0x5897a4);})['catch'](function(_0x7da317){_0x5f4449(_0x7da317);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x8d')]=function(_0x54619c,_0x4602f3){scripts[_0xbb0c('0x8d')](this[_0xbb0c('0x11')][_0xbb0c('0x3d')],_0x54619c[_0xbb0c('0x89')],_0x54619c[_0xbb0c('0x8e')],_0x54619c['aws_lex_region'],_0x54619c[_0xbb0c('0x63')],_0x54619c[_0xbb0c('0x8f')])['then'](function(_0x8d75b1){_0x4602f3(null,_0x8d75b1);})['catch'](function(_0x485bb4){_0x4602f3(_0x485bb4);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x90')]=function(_0x5ed15c,_0x1a807e,_0x166514){scripts[_0xbb0c('0x90')](_0x1a807e,_0x5ed15c['key'],_0x5ed15c['google_asr_language']||_0xbb0c('0x64'))['then'](function(_0x5e51f6){_0x166514(null,_0x5e51f6);})[_0xbb0c('0x17')](function(_0x1a2a3e){_0x166514(_0x1a2a3e);});};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x91')]=function(_0x99a4ef,_0x163886,_0x59c842){scripts[_0xbb0c('0x91')](_0x163886,_0x99a4ef[_0xbb0c('0x92')],_0x99a4ef['appsecret'],_0x99a4ef[_0xbb0c('0x74')])[_0xbb0c('0x1a')](function(_0xf134a5){_0x59c842(null,_0xf134a5);})['catch'](function(_0x5c444a){_0x59c842(_0x5c444a);});};AGIVertices[_0xbb0c('0x13')]['clear']=function(_0x48acab){var _0x47e860=_[_0xbb0c('0x6c')](verticesWithRetry,_0x48acab['agicommand'])?_0x48acab:_[_0xbb0c('0x93')](_0x48acab);for(var _0x5cb773 in _0x47e860){if(_0x47e860[_0xbb0c('0x94')](_0x5cb773)){if(_0x47e860[_0x5cb773]&&_[_0xbb0c('0x95')](_0x47e860[_0x5cb773])){if(_[_0xbb0c('0x6c')](recursiveMapAttributes,_0x5cb773)){_0x47e860[_0x5cb773]=this[_0xbb0c('0x96')](_0x47e860[_0x5cb773]);}else{_0x47e860[_0x5cb773]=this[_0xbb0c('0x97')](_0x47e860[_0x5cb773]);}}}}return _0x47e860;};AGIVertices['prototype'][_0xbb0c('0x98')]=function(_0x314552){for(var _0x382655 in _0x314552){if(_0x314552[_0xbb0c('0x94')](_0x382655)){if(_['isPlainObject'](_0x314552[_0x382655])){this[_0xbb0c('0x98')](_0x314552[_0x382655]);}else if(_[_0xbb0c('0x99')](_0x314552[_0x382655])){for(var _0x2a72b3=0x0;_0x2a72b3<_0x314552[_0x382655][_0xbb0c('0x9a')];_0x2a72b3++){this[_0xbb0c('0x98')](_0x314552[_0x382655][_0x2a72b3]);}}else if(_[_0xbb0c('0x95')](_0x314552[_0x382655])){_0x314552[_0x382655]=this[_0xbb0c('0x97')](_0x314552[_0x382655]);}}}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x9b')]=function(_0x597924,_0x2ca062){for(var _0x202313 in _0x597924){if(_0x597924[_0xbb0c('0x94')](_0x202313)){if(_[_0xbb0c('0x9c')](_0x597924[_0x202313])){if(!_[_0xbb0c('0x49')](_0x597924[_0x202313])){this[_0xbb0c('0x9b')](_0x597924[_0x202313],util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x2ca062,_0x202313));}}else if(_[_0xbb0c('0x99')](_0x597924[_0x202313])){for(var _0x5cbe8d=0x0;_0x5cbe8d<_0x597924[_0x202313]['length'];_0x5cbe8d++){this[_0xbb0c('0x9b')](_0x597924[_0x202313][_0x5cbe8d],util['format'](_0xbb0c('0x9d'),_0x2ca062,_0x202313+'['+_0x5cbe8d+']'));}}else{if(!_[_0xbb0c('0x4a')](_0x597924[_0x202313])){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x2ca062,_0x202313),_0x597924[_0x202313]);}}}}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x96')]=function(_0x4646ec){try{var _0x3bd4c4=JSON[_0xbb0c('0x72')](_0x4646ec);this[_0xbb0c('0x98')](_0x3bd4c4);return JSON['stringify'](_0x3bd4c4);}catch(_0x13e492){return this[_0xbb0c('0x97')](_0x4646ec);}};AGIVertices['prototype'][_0xbb0c('0x97')]=function(_0x3bbc42){var _0x2e2014=_0x3bbc42['split']('{');for(var _0x490919=0x1;_0x490919<_0x2e2014['length'];_0x490919+=0x1){var _0xdfb02=_0x2e2014[_0x490919]['split']('}');if(_0xdfb02[_0xbb0c('0x9a')]>0x1){_0x3bbc42=_0x3bbc42['replaceAll']('{'+_0xdfb02[0x0]+'}',this['channel']['getVariable'](_0xdfb02[0x0])[_0xbb0c('0x9f')]||_0xdfb02[0x0]);}}if(_0x2e2014['length']===0x1){return _0x3bbc42[_0xbb0c('0x51')]();}return this[_0xbb0c('0x97')](_0x3bbc42);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa0')]=function(_0xbe6268,_0x24ee75){var _0x4283bc=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](_0xbe6268);if(_0x4283bc[_0xbb0c('0xa2')]===-0x1){return _0x4283bc;}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x24ee75,_0x4283bc[_0xbb0c('0x9f')]));return this[_0xbb0c('0x11')]['setVariable'](_0x24ee75,_0x4283bc[_0xbb0c('0x9f')]);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x86')]=function(_0x5837f3){return _0x5837f3&&_0x5837f3!=='0'&&_0x5837f3!=='-1'&&_0x5837f3!=='';};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa3')]=function(_0x5a8e98){this[_0xbb0c('0x3c')]['sync'](this,_0x5a8e98,'-');_0x5a8e98[_0xbb0c('0xa4')]=_0x5a8e98[_0xbb0c('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa5')]=function(_0x47b2fc){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xa6'),_0x47b2fc[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x47b2fc[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x5246b9='\x22'+_0x47b2fc[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x47b2fc[_0xbb0c('0x7c')])){_0x5246b9+=','+_0x47b2fc[_0xbb0c('0x7c')];}var _0x19f7f9=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xa9'),_0x5246b9);if(_0x19f7f9['result']===-0x1){return _0x19f7f9;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xaa'),_0x5246b9));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xab')]=function(_0x20b8a3){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xac'),_0x20b8a3[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x20b8a3[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xae'));}var _0x4cb466=_0x20b8a3[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0x20b8a3['options'])){_0x4cb466+=','+_0x20b8a3[_0xbb0c('0x7c')];}var _0x101f73=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xaf'),_0x4cb466);if(_0x101f73[_0xbb0c('0xa2')]===-0x1){return _0x101f73;}var _0x5b68df=this[_0xbb0c('0xa0')](_0xbb0c('0xb0'),_0xbb0c('0xb1'));if(_0x5b68df[_0xbb0c('0xa2')]===-0x1){return _0x5b68df;}var _0x2490c7=this[_0xbb0c('0xa0')](_0xbb0c('0xb2'),'MRCP_RECOG_TRANSCRIPT');if(_0x2490c7[_0xbb0c('0xa2')]===-0x1){return _0x2490c7;}var _0x144892=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),'MRCP_RECOG_INSTANCE');if(_0x144892[_0xbb0c('0xa2')]===-0x1){return _0x144892;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4cb466));};AGIVertices['prototype'][_0xbb0c('0x9')]=function(_0x3aa706){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x3aa706['label']));return this[_0xbb0c('0x11')][_0xbb0c('0x9')]([_0x3aa706[_0xbb0c('0xb4')],_0x3aa706[_0xbb0c('0xb5')]]);};AGIVertices[_0xbb0c('0x13')]['answer']=function(_0x44db62){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xb6'),_0x44db62[_0xbb0c('0x3e')]));if(this[_0xbb0c('0x86')](_0x44db62[_0xbb0c('0x6a')])){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x44db62[_0xbb0c('0x6a')]));var _0x2ad27d=this[_0xbb0c('0x11')][_0xbb0c('0xb7')](_0x44db62[_0xbb0c('0x6a')]);if(_0x2ad27d[_0xbb0c('0xa2')]===-0x1){return _0x2ad27d;}}return this[_0xbb0c('0x11')][_0xbb0c('0xb8')]();};AGIVertices['prototype'][_0xbb0c('0xb9')]=function(_0x3f7ee0){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xba'),_0x3f7ee0[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x3f7ee0[_0xbb0c('0xbb')])){return this['channel'][_0xbb0c('0x33')](_0x3f7ee0,_0xbb0c('0xbc'));}_0x3f7ee0[_0xbb0c('0x4f')]=moment();if(this[_0xbb0c('0x86')](_0x3f7ee0['delay'])){_0x3f7ee0['scheduledAt']=moment()['add'](_0x3f7ee0[_0xbb0c('0xbd')],_0xbb0c('0xbe'));}if(!this[_0xbb0c('0x86')](_0x3f7ee0[_0xbb0c('0x52')])){_0x3f7ee0[_0xbb0c('0x52')]=0x2;}this[_0xbb0c('0x48')][_0xbb0c('0xbf')](this,_0x3f7ee0);return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3f7ee0[_0xbb0c('0x4e')],_0x3f7ee0[_0xbb0c('0xbb')],_0x3f7ee0[_0xbb0c('0x4f')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc0')]=function(_0x45c3a5){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x45c3a5[_0xbb0c('0x3e')]));var _0x2bee3f=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0x45c3a5[_0xbb0c('0xc1')],_0x45c3a5[_0xbb0c('0x7c')]);if(_0x2bee3f[_0xbb0c('0xa2')]===-0x1){return _0x2bee3f;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xc2'),_0x45c3a5[_0xbb0c('0xc1')],_0x45c3a5[_0xbb0c('0x7c')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc3')]=function(_0x4c1efc){logger['info'](util['format'](_0xbb0c('0xc4'),_0x4c1efc[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x4c1efc['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x2889c8='\x22'+_0x4c1efc[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x4c1efc[_0xbb0c('0x7c')])){_0x2889c8+=','+_0x4c1efc[_0xbb0c('0x7c')];}var _0x23d0cd=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0xa9'),_0x2889c8);if(_0x23d0cd[_0xbb0c('0xa2')]===-0x1){return _0x23d0cd;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xaa'),_0x2889c8));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc5')]=function(_0x3fcd44){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x3fcd44['label']));if(!this['isConfigured'](_0x3fcd44[_0xbb0c('0x63')])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}var _0x3c98a5='\x22'+_0x3fcd44[_0xbb0c('0x63')]+'\x22';if(this[_0xbb0c('0x86')](_0x3fcd44['options'])){_0x3c98a5+=','+_0x3fcd44['options'];}var _0x56c412=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0xa9'),_0x3c98a5);if(_0x56c412[_0xbb0c('0xa2')]===-0x1){return _0x56c412;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xaa'),_0x3c98a5));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xc6')]=function(_0xd0de62){logger['info'](util['format'](_0xbb0c('0xc7'),_0xd0de62['label']));if(!this[_0xbb0c('0x86')](_0xd0de62[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20grammar\x20configured');}var _0x4a2c61=_0xd0de62[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0xd0de62[_0xbb0c('0x7c')])){_0x4a2c61+=','+_0xd0de62[_0xbb0c('0x7c')];}var _0x5ebb27=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xaf'),_0x4a2c61);if(_0x5ebb27[_0xbb0c('0xa2')]===-0x1){return _0x5ebb27;}var _0x1f9791=this['getAndSetVariable'](_0xbb0c('0xb0'),_0xbb0c('0xc8'));if(_0x1f9791[_0xbb0c('0xa2')]===-0x1){return _0x1f9791;}var _0x241809=this['getAndSetVariable'](_0xbb0c('0xb2'),_0xbb0c('0xc9'));if(_0x241809[_0xbb0c('0xa2')]===-0x1){return _0x241809;}var _0x2f0af7=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0x2f0af7[_0xbb0c('0xa2')]===-0x1){return _0x2f0af7;}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xca'),_0x4a2c61));};AGIVertices['prototype'][_0xbb0c('0xcb')]=function(_0x2ab79c){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xcc'),_0x2ab79c[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2ab79c[_0xbb0c('0xad')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xae'));}var _0x180f77=_0x2ab79c[_0xbb0c('0xad')];if(this[_0xbb0c('0x86')](_0x2ab79c[_0xbb0c('0x7c')])){_0x180f77+=','+_0x2ab79c['options'];}var _0x352ab9=this[_0xbb0c('0x11')][_0xbb0c('0x5d')]('MRCPRecog',_0x180f77);if(_0x352ab9[_0xbb0c('0xa2')]===-0x1){return _0x352ab9;}var _0x1be967=this[_0xbb0c('0xa0')](_0xbb0c('0xb0'),_0xbb0c('0xcd'));if(_0x1be967[_0xbb0c('0xa2')]===-0x1){return _0x1be967;}var _0x1df23d=this[_0xbb0c('0xa0')](_0xbb0c('0xb2'),_0xbb0c('0xce'));if(_0x1df23d['result']===-0x1){return _0x1df23d;}var _0x5c3751=this[_0xbb0c('0xa0')](_0xbb0c('0xb3'),_0xbb0c('0xcf'));if(_0x5c3751[_0xbb0c('0xa2')]===-0x1){return _0x5c3751;}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xca'),_0x180f77));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xd0')]=function(_0x529454){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xd1'),_0x529454[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x529454[_0xbb0c('0xd2')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,'no\x20database\x20selected');}var _0x23a76b=this[_0xbb0c('0x1d')][_0xbb0c('0xbf')](this,_0x529454[_0xbb0c('0xd2')]);if(!_0x23a76b){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,'no\x20odbc\x20database\x20found');}if(!this[_0xbb0c('0x86')](_0x529454['query'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,_0xbb0c('0xd3'));}var _0xac3c93=_0x529454['query'][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0xd4'),_0xac3c93));var _0xb7bd17=this[_0xbb0c('0x31')]['sync'](this,_0x23a76b,_0xac3c93);this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x529454,_0xac3c93);if(!this[_0xbb0c('0x86')](_0x529454[_0xbb0c('0xd5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xb8c94=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x529454['variable_id']);if(!_0xb8c94){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x529454,_0xbb0c('0xd6'));}var _0x412bfb=this;_0xb7bd17[_0xbb0c('0xd7')](function(_0x3d1b6d,_0x116b22){Object[_0xbb0c('0xd8')](_0x3d1b6d)[_0xbb0c('0xd7')](function(_0x55a402){_0x412bfb['channel'][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xd9'),_0xb8c94,_0x116b22,_0x55a402),_0x3d1b6d[_0x55a402]);});});this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xda'),_0xb8c94),_0xb7bd17[_0xbb0c('0x9a')]);return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xdb'),_0xb8c94));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xdc')]=function(_0x56e89f){logger[_0xbb0c('0xdd')](util[_0xbb0c('0x5a')](_0xbb0c('0xde'),_0x56e89f[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x56e89f[_0xbb0c('0xdf')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x56e89f,_0xbb0c('0xe0'));}var _0x2dd730=this[_0xbb0c('0x1f')][_0xbb0c('0xbf')](this,_0x56e89f[_0xbb0c('0xdf')]);if(!_0x2dd730){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x56e89f,_0xbb0c('0xe1'));}var _0x5a8e46=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xe2'),[util[_0xbb0c('0x5a')](_0xbb0c('0xe3'),_0x2dd730),_0x56e89f['timeout'],_0x56e89f['opts'],_0x56e89f['url']]);if(_0x5a8e46[_0xbb0c('0xa2')]===-0x1){return _0x5a8e46;}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xe4'),_0xbb0c('0xe2')));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xe5')]=function(_0x264bf0){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0xe6'),_0x264bf0[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x264bf0['key'])){return this[_0xbb0c('0x11')]['noop']('no\x20key\x20configured');}if(!this[_0xbb0c('0x86')](_0x264bf0[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x264bf0);this[_0xbb0c('0x47')](_0x264bf0[_0xbb0c('0x63')],'in','','');this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xe8'),_0x264bf0['text']));var _0x3c7061=this[_0xbb0c('0x7d')]['sync'](this,_0x264bf0);if(_0x3c7061){for(var _0x345fa4 in _0x3c7061){if(_0x3c7061['hasOwnProperty'](_0x345fa4)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0xe9'),_0x345fa4['toUpperCase']()),_0x3c7061[_0x345fa4]);}}this[_0xbb0c('0x47')](_0x3c7061[_0xbb0c('0xea')],_0xbb0c('0xeb'),'dialogflow','');return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xec'),_0x3c7061[_0xbb0c('0xea')]));}return this['channel'][_0xbb0c('0x33')](_0x264bf0,_0xbb0c('0xed'));};AGIVertices[_0xbb0c('0x13')]['dialogflowV2']=function(_0x4d059d){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x4d059d['label']));if(!this[_0xbb0c('0x86')](_0x4d059d['dialogflowV2_project_id'])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0xee'));}if(!this['isConfigured'](_0x4d059d[_0xbb0c('0x81')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20client_email\x20configured');}if(!this[_0xbb0c('0x86')](_0x4d059d[_0xbb0c('0x82')])){return this['channel'][_0xbb0c('0xa7')]('no\x20private_key\x20configured');}if(!this[_0xbb0c('0x86')](_0x4d059d['dialogflowV2_language'])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0xef'));}if(!this[_0xbb0c('0x86')](_0x4d059d[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')]['noop']('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x4d059d);this['createSquareMessage'](_0x4d059d[_0xbb0c('0x63')],'in','','');this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0xf0'),_0x4d059d['text']));var _0x45ee29=this['googleDialogflowV2'][_0xbb0c('0xbf')](this,_0x4d059d);if(_0x45ee29){for(var _0x1e8cae in _0x45ee29){if(_0x45ee29['hasOwnProperty'](_0x1e8cae)){if(_0x1e8cae!=='providerResponse'){this[_0xbb0c('0x11')]['setVariable'](util['format'](_0xbb0c('0xe9'),_0x1e8cae[_0xbb0c('0x6f')]()),_0x45ee29[_0x1e8cae]);}}}this[_0xbb0c('0x47')](_0x45ee29[_0xbb0c('0xea')],_0xbb0c('0xeb'),'dialogflowV2',_0x45ee29['providerResponse']);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xf1'),_0x45ee29[_0xbb0c('0xea')]));}return this['channel'][_0xbb0c('0x33')](_0x4d059d,_0xbb0c('0xf2'));};AGIVertices['prototype'][_0xbb0c('0xf3')]=function(_0x2a7366){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0xf4'),_0x2a7366[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xf5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf6'));}if(!this['isConfigured'](_0x2a7366['username'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf7'));}if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xf8')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xf9'));}if(!this[_0xbb0c('0x86')](_0x2a7366[_0xbb0c('0xfa')])){return this['channel'][_0xbb0c('0xa7')]('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this[_0xbb0c('0x3c')](_0x2a7366);this[_0xbb0c('0x47')](_0x2a7366['text'],'in','','');this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xfb'),_0x2a7366['text']));var _0x420329=this['sestekNDA'][_0xbb0c('0xbf')](this,_0x2a7366);if(_0x420329){for(var _0x87b76a in _0x420329){if(_0x420329[_0xbb0c('0x94')](_0x87b76a)){this['channel']['setVariable'](util['format'](_0xbb0c('0xfc'),_0x87b76a[_0xbb0c('0x6f')]()),_0x420329[_0x87b76a]);}}this['createSquareMessage'](_0x420329[_0xbb0c('0xea')],'out',_0xbb0c('0xf3'),'');if(_0x420329[_0xbb0c('0xfd')]){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xfe'),_0x420329[_0xbb0c('0xfd')]));var _0x4f68bf=this[_0xbb0c('0x11')][_0xbb0c('0xff')](_0x420329[_0xbb0c('0xfd')]);try{fs['unlink'](_0x420329[_0xbb0c('0xfd')]+_0xbb0c('0x100'));}catch(_0x5b5c9d){logger[_0xbb0c('0x33')](_0x5b5c9d);}return _0x4f68bf;}else{return this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0x101'),_0x420329[_0xbb0c('0xea')]));}}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x2a7366,_0xbb0c('0x102'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x103')]=function(_0x18595b){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20END\x20(%s)\x20block',_0x18595b[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x103'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x104')]=function(_0x1d8a3b){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x105'),_0x1d8a3b[_0xbb0c('0x3e')]));var _0x31162f='';if(_0x1d8a3b[_0xbb0c('0x106')]){if(!this[_0xbb0c('0x86')](_0x1d8a3b[_0xbb0c('0x106')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1d8a3b,_0xbb0c('0x107'));}else{var _0x2ba6d2=parseInt(_0x1d8a3b['trunk_id'],0xa);if(isNaN(_0x2ba6d2)){_0x31162f=_0x1d8a3b['trunk_id'];}else{_0x31162f=this[_0xbb0c('0x21')]['sync'](this,_0x1d8a3b[_0xbb0c('0x106')]);if(!_0x31162f){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1d8a3b,_0xbb0c('0x108'));}}}}else if(_0x1d8a3b[_0xbb0c('0x109')]){_0x31162f=_0x1d8a3b['trunk_name'];}else{return this[_0xbb0c('0x11')]['error'](_0x1d8a3b,'no\x20trunk\x20selected');}var _0x5f3c9f=this[_0xbb0c('0x11')][_0xbb0c('0x5d')](_0xbb0c('0xe2'),[util['format'](_0xbb0c('0x10a'),_0x31162f,_0x1d8a3b[_0xbb0c('0x4e')]),_0x1d8a3b['timeout'],_0x1d8a3b[_0xbb0c('0x10b')],_0x1d8a3b[_0xbb0c('0x68')]]);if(_0x5f3c9f[_0xbb0c('0xa2')]===-0x1){return _0x5f3c9f;}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xe4'),_0xbb0c('0xe2')));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x10c')]=function(_0x3217aa){logger['info'](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x3217aa[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x10c'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xf')]=function(_0x3272c4){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x10d'),_0x3272c4[_0xbb0c('0x3e')]));if(_0x3272c4['retry']===0x0){return this[_0xbb0c('0xa3')](_0x3272c4);}_0x3272c4['retry']-=0x1;if(!this['isConfigured'](_0x3272c4[_0xbb0c('0x10e')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x3272c4,'no\x20file\x20audio\x20selected');}var _0x243f36=this['getSound'][_0xbb0c('0xbf')](this,_0x3272c4[_0xbb0c('0x10e')]);if(!_0x243f36){return this['channel'][_0xbb0c('0x33')](_0x3272c4,_0xbb0c('0x10f'));}if(!this[_0xbb0c('0x86')](_0x3272c4[_0xbb0c('0xd5')])){return this['channel'][_0xbb0c('0x33')](_0xbb0c('0x110'));}var _0x1b70a6=this[_0xbb0c('0x11')]['getData'](_0x243f36,_0x3272c4[_0xbb0c('0x111')],_0x3272c4[_0xbb0c('0x112')]);var _0x47c8d1=_0x1b70a6['result']?_0x1b70a6[_0xbb0c('0xa2')][_0xbb0c('0x51')]():'';logger[_0xbb0c('0x35')]('test',JSON['stringify'](_0x1b70a6));if(_0x1b70a6[_0xbb0c('0xa2')]===-0x1){this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,_0x47c8d1);return _0x1b70a6;}else if(_0x1b70a6[_0xbb0c('0x9f')]===_0xbb0c('0x6a')){_0x1b70a6['result']=_0x47c8d1[_0xbb0c('0x9a')]>=parseInt(_0x3272c4[_0xbb0c('0x113')])?'x':'i';}else{_0x1b70a6['result']=_0x47c8d1[_0xbb0c('0x9a')]>=parseInt(_0x3272c4[_0xbb0c('0x113')])&&_0x47c8d1[_0xbb0c('0x9a')]<=parseInt(_0x3272c4['maxdigit'])?'x':'i';}var _0x43f9ae=this['getVariable'][_0xbb0c('0xbf')](this,_0x3272c4[_0xbb0c('0xd5')]);if(!_0x43f9ae){return this['channel'][_0xbb0c('0x33')](_0x3272c4,_0xbb0c('0xd6'));}this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x43f9ae,_0x47c8d1);if(this[_0xbb0c('0x86')](_0x3272c4[_0xbb0c('0x114')])){var _0x3c19d4=parseInt(_0x3272c4[_0xbb0c('0x114')],0xa);var _0x1d7599=rs[_0xbb0c('0x115')]({'charset':'*','length':_0x3c19d4});var _0x4c752e=_0x47c8d1['length'];if(_0x4c752e>0x0){if(_0x4c752e>_0x3c19d4){this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,_0x3272c4['hiddendigitspos']==='first'?_0x1d7599+_0x47c8d1['substr'](_0x3c19d4):_0x47c8d1[_0xbb0c('0x116')](0x0,_0x4c752e-_0x3c19d4)+_0x1d7599);}else{this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x3272c4,rs[_0xbb0c('0x115')]({'charset':'*','length':_0x4c752e}));}}else{this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x3272c4,'');}}else{this[_0xbb0c('0x3c')]['sync'](this,_0x3272c4,_0x47c8d1);}return _0x1b70a6;};AGIVertices['prototype']['getsecretdigits']=function(_0x7db850){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x117'),_0x7db850['label']));return this[_0xbb0c('0xf')](_0x7db850);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x118')]=function(_0x42ecd9){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x119'),_0x42ecd9[_0xbb0c('0x3e')]));this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x42ecd9,_0x42ecd9['goalname']);return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x11a'),_0x42ecd9['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x2d1a7b){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2d1a7b[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x2d1a7b[_0xbb0c('0x89')])||!this[_0xbb0c('0x86')](_0x2d1a7b['aws_secret_access_key'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xbb0c('0x86')](_0x2d1a7b[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x11b'),_0x2d1a7b[_0xbb0c('0x63')]));var _0x2e8af6=this[_0xbb0c('0x88')]['sync'](this,_0x2d1a7b);if(_0x2e8af6){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x11c'),_0x2e8af6));var _0x5e5a7f=this[_0xbb0c('0x11')]['streamFile'](_0x2e8af6);try{fs[_0xbb0c('0x11d')](_0x2e8af6+_0xbb0c('0x100'));}catch(_0x51ca44){logger[_0xbb0c('0x33')](_0x51ca44);}return _0x5e5a7f;}return this['channel'][_0xbb0c('0x33')](_0x2d1a7b,_0xbb0c('0x11e'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x11f')]=function(_0x48d3fd){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x120'),_0x48d3fd['label']));if(!this['isConfigured'](_0x48d3fd[_0xbb0c('0x89')])||!this[_0xbb0c('0x86')](_0x48d3fd[_0xbb0c('0x8e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x121'));}if(!this[_0xbb0c('0x86')](_0x48d3fd[_0xbb0c('0x8f')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x122'));}if(!this[_0xbb0c('0x86')](_0x48d3fd['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xe7')]=!![];this['createSquareDetailsReport'](_0x48d3fd);this['createSquareMessage'](_0x48d3fd['text'],'in','','');this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x48d3fd[_0xbb0c('0x63')]));var _0x3440e3=this['awsLex'][_0xbb0c('0xbf')](this,_0x48d3fd);if(_0x3440e3){for(var _0xc87a2f in _0x3440e3){if(_0x3440e3['hasOwnProperty'](_0xc87a2f)&&_[_0xbb0c('0x95')](_0x3440e3[_0xc87a2f])){this['channel'][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')]('AWS_LEX_%s',_0xc87a2f[_0xbb0c('0x6f')]()),_0x3440e3[_0xc87a2f]);}}if(_[_0xbb0c('0x4a')](_0x3440e3['message'])){return this['channel'][_0xbb0c('0xa7')](_0xbb0c('0x123'));}else{this['createSquareMessage'](_0x3440e3[_0xbb0c('0x7a')],_0xbb0c('0xeb'),_0xbb0c('0x124'),'');return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x125'),_0x3440e3[_0xbb0c('0x7a')]));}}return this[_0xbb0c('0x11')]['error'](_0x48d3fd,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x126')]=function(_0x49acda){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x49acda[_0xbb0c('0x3e')],_0x49acda[_0xbb0c('0x6a')]));if(!this[_0xbb0c('0x86')](_0x49acda[_0xbb0c('0x7e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x127'));}var _0x550e34=_0xbb0c('0x128');var _0x1969d8=util[_0xbb0c('0x5a')](_0xbb0c('0x129'),FILES_PATH,rs[_0xbb0c('0x115')](0x4));var _0x5eb429=util[_0xbb0c('0x5a')](_0xbb0c('0x9d'),_0x1969d8,_0x550e34);var _0x1fd9d3=!![];if(_0x49acda['beep']==='NOBEEP'){_0x1fd9d3=![];}var _0x2ac26a=this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x1969d8,_0x550e34,_0x49acda[_0xbb0c('0x12b')],_0x49acda['timeout'],undefined,_0x1fd9d3);if(_0x2ac26a[_0xbb0c('0xa2')]!==-0x1){this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x12c'),_0x5eb429));var _0x3032fe=this[_0xbb0c('0x90')][_0xbb0c('0xbf')](this,_0x49acda,_0x5eb429);if(_0x3032fe){for(var _0x4154ac in _0x3032fe){if(_0x3032fe[_0xbb0c('0x94')](_0x4154ac)){this['channel']['setVariable'](util[_0xbb0c('0x5a')](_0xbb0c('0x12d'),_0x4154ac[_0xbb0c('0x6f')]()),_0x3032fe[_0x4154ac]);}}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('GoogleASR\x20Result\x20%s',JSON[_0xbb0c('0x76')](_0x3032fe)));}}return _0x2ac26a;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x12e')]=function(_0x299d84){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x12f'),_0x299d84[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x299d84[_0xbb0c('0x92')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x130'));}if(!this[_0xbb0c('0x86')](_0x299d84[_0xbb0c('0x131')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x132'));}var _0x631f80=_0xbb0c('0x128');var _0x2498f6=util['format'](_0xbb0c('0x129'),FILES_PATH,rs['generate'](0x4));var _0x36375a=util['format'](_0xbb0c('0x9d'),_0x2498f6,_0x631f80);var _0xc82ce=!![];if(_0x299d84[_0xbb0c('0x133')]===_0xbb0c('0x134')){_0xc82ce=![];}var _0x172eb6=this[_0xbb0c('0x11')]['recordFile'](_0x2498f6,_0x631f80,_0x299d84[_0xbb0c('0x12b')],_0x299d84[_0xbb0c('0x6a')],undefined,_0xc82ce);if(_0x172eb6[_0xbb0c('0xa2')]!==-0x1){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('tilde\x20%s\x20file\x20created',_0x36375a));var _0x1112d0=this['tildeASR'][_0xbb0c('0xbf')](this,_0x299d84,_0x36375a);if(_0x1112d0){for(var _0x42e55d in _0x1112d0){if(_0x1112d0[_0xbb0c('0x94')](_0x42e55d)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x135'),_0x42e55d[_0xbb0c('0x6f')]()),_0x1112d0[_0x42e55d]);}}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x136'),JSON['stringify'](_0x1112d0)));}}return _0x172eb6;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x137')]=function(_0x2d8afc){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x138'),_0x2d8afc[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0x139')](_0x2d8afc['context'],_0x2d8afc['extension'],_0x2d8afc['priority']);};AGIVertices['prototype'][_0xbb0c('0x13a')]=function(_0x51fe7e){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x13b'),_0x51fe7e[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x51fe7e[_0xbb0c('0x13c')])){return this['channel'][_0xbb0c('0x33')](_0x51fe7e,_0xbb0c('0x13d'));}try{var _0x8c8f02=eval(_0x51fe7e[_0xbb0c('0x13c')])?'true':_0xbb0c('0x13e');this[_0xbb0c('0x11')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x51fe7e[_0xbb0c('0x13c')],_0x8c8f02));return{'code':0xc8,'result':_0x8c8f02};}catch(_0xf5ba31){return{'code':0xc8,'result':_0xbb0c('0x13e')};}};AGIVertices['prototype'][_0xbb0c('0x13f')]=function(_0x19cc11){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x140'),_0x19cc11[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x19cc11[_0xbb0c('0x141')])){return this['channel'][_0xbb0c('0x33')](_0x19cc11,_0xbb0c('0x142'));}var _0x9b799=this[_0xbb0c('0x2a')][_0xbb0c('0xbf')](this,_0x19cc11[_0xbb0c('0x141')]);if(!_0x9b799){return this[_0xbb0c('0x11')]['error'](_0x19cc11,'no\x20intervals\x20found');}for(var _0x1a7772=0x0;_0x1a7772<_0x9b799['length'];_0x1a7772+=0x1){var _0x123156=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](util[_0xbb0c('0x5a')](_0xbb0c('0x143'),_0x9b799[_0x1a7772]));if(_0x123156[_0xbb0c('0xa2')]===-0x1){return _0x123156;}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0x123156['extra']));if(_0x123156[_0xbb0c('0x9f')]===_0xbb0c('0x144')){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0x145'),_0x9b799[_0x1a7772],_0xbb0c('0x144')));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0xbb0c('0x144')));return{'code':0xc8,'result':_0xbb0c('0x144')};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x145'),_0x9b799[_0x1a7772],_0xbb0c('0x13e')));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x9b799[_0x1a7772],_0xbb0c('0x13e')));}}return{'code':0xc8,'result':_0xbb0c('0x13e')};};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x146')]=function(_0x3844b1){logger[_0xbb0c('0x35')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3844b1[_0xbb0c('0x3e')]));return this[_0xbb0c('0x11')]['hangup']();};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x147')]=function(_0x123fa4){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x148'),_0x123fa4['label']));if(!this[_0xbb0c('0x86')](_0x123fa4['key'])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x127'));}var _0x5a1698=_0xbb0c('0x128');var _0x1f0750=util[_0xbb0c('0x5a')](_0xbb0c('0x129'),FILES_PATH,rs[_0xbb0c('0x115')](0x4));var _0x475ec9=util['format'](_0xbb0c('0x9d'),_0x1f0750,_0x5a1698);var _0x27cb6b=!![];if(_0x123fa4['beep']===_0xbb0c('0x134')){_0x27cb6b=![];}var _0x47497b=this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x1f0750,_0x5a1698,_0x123fa4[_0xbb0c('0x12b')],_0x123fa4[_0xbb0c('0x6a')],undefined,_0x27cb6b);if(_0x47497b[_0xbb0c('0xa2')]!==-0x1){this['channel']['noop'](util['format'](_0xbb0c('0x149'),_0x475ec9));var _0x21fdaf=this[_0xbb0c('0x85')]['sync'](this,_0x123fa4,_0x475ec9);if(_0x21fdaf){for(var _0xce0bad in _0x21fdaf){if(_0x21fdaf[_0xbb0c('0x94')](_0xce0bad)){this[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')]('ISPEECH_ASR_%s',_0xce0bad[_0xbb0c('0x6f')]()),_0x21fdaf[_0xce0bad]);}}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x14a'),JSON['stringify'](_0x21fdaf)));}}return _0x47497b;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x14b')]=function(_0x4ed4ea){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x14c'),_0x4ed4ea[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x4ed4ea[_0xbb0c('0x7e')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20key\x20configured');}if(!this[_0xbb0c('0x86')](_0x4ed4ea['text'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0xa8'));}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x14d'),_0x4ed4ea[_0xbb0c('0x63')]));var _0x39e37a=this[_0xbb0c('0x83')][_0xbb0c('0xbf')](this,_0x4ed4ea);if(_0x39e37a){this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x149'),_0x39e37a));var _0x173a74=this['channel'][_0xbb0c('0xff')](_0x39e37a,_0x4ed4ea[_0xbb0c('0x12b')]);try{fs[_0xbb0c('0x11d')](_0x39e37a+_0xbb0c('0x100'));}catch(_0xe11798){logger[_0xbb0c('0x33')](_0xe11798);}return _0x173a74;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x4ed4ea,_0xbb0c('0x14e'));};AGIVertices[_0xbb0c('0x13')]['login']=function(_0x255b56){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x14f'),_0x255b56[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x255b56[_0xbb0c('0x150')])){return this['channel'][_0xbb0c('0x33')](_0x255b56,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x152'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56[_0xbb0c('0x150')]));var _0x902152=this[_0xbb0c('0x58')][_0xbb0c('0xbf')](this,_0x255b56[_0xbb0c('0x150')]);if(_0x902152){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')]['callerid'],_0x255b56[_0xbb0c('0x150')]));this[_0xbb0c('0x11')]['noop'](util['format'](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x154')};}else{logger['info'](util['format'](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x255b56['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x155'),this['channel'][_0xbb0c('0x40')],_0x255b56['findBy']));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x157')]=function(_0x22c402){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x158'),_0x22c402[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x22c402[_0xbb0c('0x150')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x22c402,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));var _0x2c05db=this[_0xbb0c('0x57')][_0xbb0c('0xbf')](this,_0x22c402[_0xbb0c('0x150')]);if(_0x2c05db){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x22c402['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xbb0c('0x40')],_0x22c402[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices['prototype'][_0xbb0c('0x159')]=function(_0x2edfc8){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x15a'),_0x2edfc8[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x2edfc8[_0xbb0c('0x15b')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x2edfc8,'no\x20operation\x20configured');}this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x15c'),_0x2edfc8[_0xbb0c('0x15b')]));var _0x93c962=eval(_0x2edfc8[_0xbb0c('0x15b')]);if(!this[_0xbb0c('0x86')](_0x2edfc8['variable_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x110'));}var _0xc21914=this[_0xbb0c('0xa1')]['sync'](this,_0x2edfc8[_0xbb0c('0xd5')]);if(!_0xc21914){return this[_0xbb0c('0x11')]['error'](_0x2edfc8,_0xbb0c('0xd6'));}if(_[_0xbb0c('0x99')](_0x93c962)){var _0x8be04=this;_0x93c962['forEach'](function(_0x24a980,_0x46ebbc){_0x8be04[_0xbb0c('0x11')][_0xbb0c('0x9e')](util[_0xbb0c('0x5a')](_0xbb0c('0x15d'),_0xc21914,_0x46ebbc),_0x24a980);});return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x15e'),_0xc21914));}else{return this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0xc21914,_0x93c962);}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x15f')]=function(_0x112587){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x160'),_0x112587[_0xbb0c('0x3e')]));if(_0x112587[_0xbb0c('0xa4')]===0x0){return this[_0xbb0c('0xa3')](_0x112587);}_0x112587[_0xbb0c('0xa4')]-=0x1;if(!this[_0xbb0c('0x86')](_0x112587['file_id'])){return this['channel'][_0xbb0c('0x33')](_0x112587,'no\x20file\x20audio\x20selected');}var _0x114389=this['getSound']['sync'](this,_0x112587[_0xbb0c('0x10e')]);if(!_0x114389){return this['channel'][_0xbb0c('0x33')](_0x112587,_0xbb0c('0x10f'));}var _0x53330f=this[_0xbb0c('0x11')][_0xbb0c('0x161')](_0x114389,_0x112587[_0xbb0c('0x111')],_0x112587[_0xbb0c('0x162')]);var _0x1463fc=_0x53330f[_0xbb0c('0xa2')];if(_0x53330f[_0xbb0c('0xa2')]===-0x1){this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x112587,'-1');return _0x53330f;}else if(_0x53330f[_0xbb0c('0x9f')]===_0xbb0c('0x6a')){_0x53330f[_0xbb0c('0xa2')]=_0x53330f[_0xbb0c('0xa2')]['length']>0x0?_0x53330f['result']:'t';}else if(_[_0xbb0c('0x49')](_0x53330f[_0xbb0c('0xa2')])){_0x53330f[_0xbb0c('0xa2')]='#';_0x1463fc='#';}if(!this[_0xbb0c('0x86')](_0x112587[_0xbb0c('0xd5')])){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x110'));}else{var _0x2dc419=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x112587['variable_id']);if(!_0x2dc419){return this['channel']['error'](_0x112587,'no\x20variable\x20found');}this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x2dc419,_0x1463fc);}this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x112587,_0x1463fc);return _0x53330f;};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0xa7')]=function(_0x24954f){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x163'),_0x24954f[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0xa7')](_0x24954f[_0xbb0c('0x164')]||_0x24954f[_0xbb0c('0x3e')]);};AGIVertices['prototype']['pause']=function(_0x387a38){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x165'),_0x387a38[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x387a38['findBy'])){return this['channel'][_0xbb0c('0x33')](_0x387a38,_0xbb0c('0x151'));}logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));var _0xf684f0=this[_0xbb0c('0x53')][_0xbb0c('0xbf')](this,_0x387a38[_0xbb0c('0x166')]);var _0x31fc44=this[_0xbb0c('0x167')][_0xbb0c('0xbf')](this,_0x387a38[_0xbb0c('0x150')],_0xf684f0);if(_0x31fc44){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')]['callerid'],_0x387a38['findBy']));this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this['channel'][_0xbb0c('0x40')],_0x387a38[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x168')]=function(_0x26c6d0){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x169'),_0x26c6d0[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x26c6d0[_0xbb0c('0x10e')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x26c6d0,_0xbb0c('0x16a'));}var _0x55ad63=this['getSound'][_0xbb0c('0xbf')](this,_0x26c6d0[_0xbb0c('0x10e')]);if(!_0x55ad63){return this[_0xbb0c('0x11')]['error'](_0x26c6d0,'no\x20file\x20audio\x20found');}var _0x117a63=this[_0xbb0c('0x11')]['exec'](_0xbb0c('0x16b'),[_0x55ad63,_0x26c6d0[_0xbb0c('0x10b')]]);if(_0x117a63['result']===-0x1){return _0x117a63;}return this['channel'][_0xbb0c('0xa7')](util['format'](_0xbb0c('0xc2'),_0xbb0c('0x16b'),_0x55ad63));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x16c')]=function(_0x377834){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x377834[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x377834[_0xbb0c('0x16d')])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x377834,'no\x20queue\x20selected');}var _0x276857='';var _0x4d4fd6=parseInt(_0x377834['queue_id'],0xa);if(isNaN(_0x4d4fd6)){_0x276857=_0x377834[_0xbb0c('0x16d')];}else{_0x276857=this[_0xbb0c('0x18')][_0xbb0c('0xbf')](this,_0x377834[_0xbb0c('0x16d')]);if(!_0x276857){return this['channel'][_0xbb0c('0x33')](_0x377834,_0xbb0c('0x16e'));}}var _0x2b1cc1='';if(this[_0xbb0c('0x86')](_0x377834[_0xbb0c('0x10e')])){var _0x517b1b=this[_0xbb0c('0x23')][_0xbb0c('0xbf')](this,_0x377834[_0xbb0c('0x10e')]);if(_0x517b1b){_0x2b1cc1=_0x517b1b;}}this['createSquareDetailsReport']['sync'](this,_0x377834,_0x276857);if(_0x377834['opts'][_0xbb0c('0x16f')]('x')<0x0){_0x377834[_0xbb0c('0x10b')]+='x';}if(_0x377834[_0xbb0c('0x10b')][_0xbb0c('0x16f')]('X')<0x0){_0x377834[_0xbb0c('0x10b')]+='X';}this[_0xbb0c('0x11')]['setVariable']('XMCS-QUEUE',_0x276857?_0x276857[_0xbb0c('0x170')]():'');var _0x575e58=this['channel'][_0xbb0c('0x5d')](_0xbb0c('0x171'),[_0x276857,_0x377834[_0xbb0c('0x10b')],_0x377834[_0xbb0c('0x68')],_0x2b1cc1,_0x377834['timeout'],_0x377834[_0xbb0c('0x9')],_0x377834[_0xbb0c('0x172')],_0x377834[_0xbb0c('0x173')],'',_0x377834[_0xbb0c('0x174')]]);if(_0x575e58[_0xbb0c('0xa2')]===-0x1){return _0x575e58;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0xbb0c('0x171'),_0x276857));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x175')]=function(_0x1c8210){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x176'),_0x1c8210[_0xbb0c('0x3e')]));var _0x2ef3ff=_0x1c8210[_0xbb0c('0x177')]||_0xbb0c('0x128');var _0x5a32e3=util[_0xbb0c('0x5a')](_0xbb0c('0x178'),this[_0xbb0c('0x11')][_0xbb0c('0x3d')],rs[_0xbb0c('0x115')](0x5));var _0x18246b=util[_0xbb0c('0x5a')]('%s/recordings/%s.%s',FILES_PATH,_0x5a32e3,_0x2ef3ff);var _0x300f34=util['format'](_0xbb0c('0x129'),FILES_PATH,_0x5a32e3);this[_0xbb0c('0x3f')][_0xbb0c('0xbf')](this,_0x1c8210,_0x5a32e3,_0x18246b);this[_0xbb0c('0x11')]['setVariable'](_0xbb0c('0x179'),_0x5a32e3);logger[_0xbb0c('0x35')](_0xbb0c('0x17a'),_0x300f34,_0x2ef3ff,_0x1c8210[_0xbb0c('0x17b')],_0x1c8210[_0xbb0c('0x6a')]);return this[_0xbb0c('0x11')][_0xbb0c('0x12a')](_0x300f34,_0x2ef3ff,_0x1c8210['escape_digits'],_0x1c8210['timeout'],undefined,!![]);};AGIVertices[_0xbb0c('0x13')]['restapi']=function(_0xebb74d){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x17c'),_0xebb74d[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0xebb74d['url'])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x17d'));}var _0xe8dc5d=this[_0xbb0c('0x67')][_0xbb0c('0xbf')](this,_0xebb74d);logger['info'](util['format'](_0xbb0c('0x17e'),util['inspect'](_0xe8dc5d,{'showHidden':![],'depth':null})));if(!this[_0xbb0c('0x86')](_0xebb74d[_0xbb0c('0xd5')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x17f'));}var _0x5841dd=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0xebb74d[_0xbb0c('0xd5')]);if(!_0x5841dd){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0xebb74d,_0xbb0c('0xd6'));}this['channel']['setVariable'](util[_0xbb0c('0x5a')](_0xbb0c('0x180'),_0x5841dd),_0xe8dc5d[_0xbb0c('0x79')]?_0xe8dc5d[_0xbb0c('0x79')]:_0xbb0c('0x181'));this['channel'][_0xbb0c('0x9e')](util['format'](_0xbb0c('0x182'),_0x5841dd),_0xe8dc5d['statusMessage']?_0xe8dc5d[_0xbb0c('0x78')]:'OK');if(_0xe8dc5d['body']){try{this[_0xbb0c('0x9b')](_0xe8dc5d[_0xbb0c('0x70')],_0x5841dd);}catch(_0xfea576){logger[_0xbb0c('0x33')](util[_0xbb0c('0x5a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5841dd));}}return this['channel'][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xdb'),_0x5841dd));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x183')]=function(_0x338ec3){logger[_0xbb0c('0x35')](util['format'](_0xbb0c('0x184'),_0x338ec3['label']));return this[_0xbb0c('0x11')]['sayDigits'](_0x338ec3[_0xbb0c('0x185')][_0xbb0c('0x5f')](/\s+/g,''),_0x338ec3['escape_digits']);};AGIVertices['prototype'][_0xbb0c('0x186')]=function(_0x3e1b77){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x187'),_0x3e1b77['label']));return this[_0xbb0c('0x11')][_0xbb0c('0x188')](_0x3e1b77[_0xbb0c('0x6b')][_0xbb0c('0x5f')](/\s+/g,''),_0x3e1b77['escape_digits']);};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x189')]=function(_0x136c35){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x18a'),_0x136c35[_0xbb0c('0x3e')]));return this['channel'][_0xbb0c('0x18b')](_0x136c35[_0xbb0c('0x63')],_0x136c35[_0xbb0c('0x17b')]);};AGIVertices[_0xbb0c('0x13')]['sendMail']=function(_0x38d4ca){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x18c'),_0x38d4ca[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x38d4ca[_0xbb0c('0x18d')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x18e'));}var _0x22ebad=this['getMailAccount'][_0xbb0c('0xbf')](this,_0x38d4ca[_0xbb0c('0x18d')]);if(!_0x22ebad||!_0x22ebad[_0xbb0c('0x18f')]){return this[_0xbb0c('0x11')]['error'](_0x38d4ca,_0xbb0c('0x190'));}var _0x108f44={'from':util[_0xbb0c('0x5a')]('\x22%s\x22\x20<%s>',_0x22ebad[_0xbb0c('0x16')],_0x22ebad[_0xbb0c('0x191')]||_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x192')]),'to':_0x38d4ca['to']||'','cc':_0x38d4ca['cc']||'','bcc':_0x38d4ca[_0xbb0c('0x193')]||'','subject':_0x38d4ca[_0xbb0c('0x194')],'html':_0x38d4ca['text'],'text':_0x38d4ca[_0xbb0c('0x63')]};var _0x3aaf3c={'tls':{'rejectUnauthorized':![]}};if(_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x195')]){_0x3aaf3c[_0xbb0c('0x195')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x195')];}else{_0x3aaf3c[_0xbb0c('0x196')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x196')];_0x3aaf3c[_0xbb0c('0x197')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x197')];_0x3aaf3c[_0xbb0c('0x198')]=_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x198')];}if(_0x22ebad[_0xbb0c('0x18f')]['authentication']){_0x3aaf3c['auth']={'user':_0x22ebad[_0xbb0c('0x18f')][_0xbb0c('0x192')],'pass':_0x22ebad[_0xbb0c('0x18f')]['pass']};}if(this['isConfigured'](_0x38d4ca[_0xbb0c('0x199')])){}logger[_0xbb0c('0xdd')](_0xbb0c('0x19a'),JSON[_0xbb0c('0x76')](_0x108f44));this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x38d4ca,_0x38d4ca[_0xbb0c('0x18d')]);this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x19b'),_0x22ebad[_0xbb0c('0x16')]));this['sendMailMessage'][_0xbb0c('0xbf')](this,_0x3aaf3c,_0x108f44);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x19c'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x19d')]=function(_0x477189){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x19e'),_0x477189['label']));return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x19f'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1a0')]=function(_0x16613c){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1a1'),_0x16613c[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x16613c[_0xbb0c('0x1a2')])){return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x1a3'));}var _0xebb127=this[_0xbb0c('0x39')][_0xbb0c('0xbf')](this,_0x16613c[_0xbb0c('0x1a2')]);if(!_0xebb127){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x16613c,_0xbb0c('0x1a4'));}var _0xd9d7d9={'body':_0x16613c[_0xbb0c('0x1a5')],'phone':_0x16613c['to']||'','SmsAccountId':_0xebb127['id']};logger['debug'](_0xbb0c('0x1a6'),JSON[_0xbb0c('0x76')](_0xd9d7d9));this['createSquareDetailsReport'][_0xbb0c('0xbf')](this,_0x16613c,_0x16613c[_0xbb0c('0x1a2')]);this['channel'][_0xbb0c('0xa7')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0xebb127[_0xbb0c('0x16')]));this[_0xbb0c('0x3b')][_0xbb0c('0xbf')](this,_0xd9d7d9);return this[_0xbb0c('0x11')]['noop'](_0xbb0c('0x1a7'));};AGIVertices['prototype'][_0xbb0c('0x1a8')]=function(_0x1acca2){logger['info'](util[_0xbb0c('0x5a')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x1acca2['label']));if(!this[_0xbb0c('0x86')](_0x1acca2['variable_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1acca2,_0xbb0c('0x1a9'));}var _0x26eb83=this[_0xbb0c('0xa1')]['sync'](this,_0x1acca2['variable_id']);if(!_0x26eb83){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1acca2,_0xbb0c('0xd6'));}return this[_0xbb0c('0x11')][_0xbb0c('0x9e')](_0x26eb83,_0x1acca2['variable_value']);};AGIVertices['prototype']['start']=function(_0x347c11){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1aa'),_0x347c11[_0xbb0c('0x3e')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('START\x20CALLY\x20SQUARE');if(_0x347c11['answer']===_0xbb0c('0x1ab')){this['channel']['noop'](_0xbb0c('0x1ac'));return this['channel'][_0xbb0c('0xb8')]();}return this['channel']['noop'](_0xbb0c('0x1ad'));};AGIVertices['prototype'][_0xbb0c('0x1ae')]=function(_0x1e4a93){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1af'),_0x1e4a93[_0xbb0c('0x3e')]));if(!this['isConfigured'](_0x1e4a93['project_id'])){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,_0xbb0c('0x1b0'));}var _0x549929=this['getSquareProject'][_0xbb0c('0xbf')](this,_0x1e4a93[_0xbb0c('0x1b1')]);if(!this['isConfigured'](_0x549929)){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,util[_0xbb0c('0x5a')](_0xbb0c('0x1b2'),_0x1e4a93[_0xbb0c('0x1b1')]));}if(_0x549929===this[_0xbb0c('0x11')][_0xbb0c('0x45')]){return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1e4a93,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x1e4a93,_0x549929);var _0x170fb4=this['channel'][_0xbb0c('0x5d')]('AGI',util[_0xbb0c('0x5a')](_0xbb0c('0x1b3'),config[_0xbb0c('0x9')]['host']||_0xbb0c('0x1b4'),_0x549929,this[_0xbb0c('0x11')][_0xbb0c('0x45')]));if(_0x170fb4[_0xbb0c('0xa2')]===-0x1){return _0x170fb4;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0xc2'),_0xbb0c('0x1b5'),_0x549929));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b6')]=function(_0x1a3248){logger[_0xbb0c('0x35')](util['format']('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1a3248[_0xbb0c('0x3e')]));var _0x55728a=this[_0xbb0c('0x5c')][_0xbb0c('0xbf')](this,_0x1a3248[_0xbb0c('0xb4')]);this[_0xbb0c('0x3c')][_0xbb0c('0xbf')](this,_0x1a3248,_0x1a3248[_0xbb0c('0xb4')]);if(this[_0xbb0c('0x86')](_0x1a3248['variable_id'])){var _0xdf3cf8=this[_0xbb0c('0xa1')][_0xbb0c('0xbf')](this,_0x1a3248[_0xbb0c('0xd5')]);if(_0xdf3cf8){this[_0xbb0c('0x11')]['setVariable'](_0xdf3cf8,_0x55728a);return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x1b7'),_0x1a3248[_0xbb0c('0xb4')],_0xdf3cf8));}}return this[_0xbb0c('0x11')]['noop'](util[_0xbb0c('0x5a')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1a3248[_0xbb0c('0xb4')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1b8')]=function(_0x1ddfb3){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1b9'),_0x1ddfb3[_0xbb0c('0x3e')]));_0x1ddfb3[_0xbb0c('0x63')]=_0x1ddfb3[_0xbb0c('0x63')][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1ddfb3[_0xbb0c('0x61')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](_0xbb0c('0x1ba'));}if(!this['isConfigured'](_0x1ddfb3[_0xbb0c('0x63')])){return this[_0xbb0c('0x11')][_0xbb0c('0xa7')]('no\x20text\x20configured');}this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x1bb'),_0x1ddfb3[_0xbb0c('0x63')]));var _0x30582c=this[_0xbb0c('0x60')][_0xbb0c('0xbf')](this,_0x1ddfb3);if(_0x30582c){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util['format'](_0xbb0c('0x1bc'),_0x30582c));var _0x3446e2=this['channel'][_0xbb0c('0xff')](_0x30582c);try{fs[_0xbb0c('0x11d')](_0x30582c+_0xbb0c('0x100'));}catch(_0x4549ea){logger[_0xbb0c('0x33')](_0x4549ea);}return _0x3446e2;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x1ddfb3,_0xbb0c('0x1bd'));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1be')]=function(_0x244a03){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x244a03['label']));_0x244a03[_0xbb0c('0x63')]=_0x244a03['text'][_0xbb0c('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbb0c('0x86')](_0x244a03[_0xbb0c('0x63')])){return this['channel']['noop']('no\x20text\x20configured');}this['channel']['noop'](util[_0xbb0c('0x5a')](_0xbb0c('0x1bf'),_0x244a03[_0xbb0c('0x63')]));var _0x4db807=this[_0xbb0c('0x66')][_0xbb0c('0xbf')](this,_0x244a03);if(_0x4db807){this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x1c0'),_0x4db807));var _0x52d471=this[_0xbb0c('0x11')]['streamFile'](_0x4db807);try{fs[_0xbb0c('0x11d')](_0x4db807+_0xbb0c('0x100'));}catch(_0x5e459e){logger[_0xbb0c('0x33')](_0x5e459e);}return _0x52d471;}return this[_0xbb0c('0x11')][_0xbb0c('0x33')](_0x244a03,_0xbb0c('0x1c1'));};AGIVertices[_0xbb0c('0x13')]['unpause']=function(_0x5510c8){logger['info'](util[_0xbb0c('0x5a')](_0xbb0c('0x1c2'),_0x5510c8[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x5510c8[_0xbb0c('0x150')])){return this['channel'][_0xbb0c('0x33')](_0x5510c8,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xbb0c('0x152'),this['channel'][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));var _0x22ed03=this[_0xbb0c('0x56')][_0xbb0c('0xbf')](this,_0x5510c8[_0xbb0c('0x150')]);if(_0x22ed03){logger['info'](util[_0xbb0c('0x5a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xbb0c('0x40')],_0x5510c8['findBy']));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x153'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));return{'code':0xc8,'result':'success'};}else{logger[_0xbb0c('0x35')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')](_0xbb0c('0x155'),this[_0xbb0c('0x11')][_0xbb0c('0x40')],_0x5510c8[_0xbb0c('0x150')]));return{'code':0xc8,'result':_0xbb0c('0x156')};}};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1c3')]=function(_0x877aab){logger[_0xbb0c('0x35')](util[_0xbb0c('0x5a')](_0xbb0c('0x1c4'),_0x877aab[_0xbb0c('0x3e')]));var _0x4410ee=this[_0xbb0c('0x11')][_0xbb0c('0x5d')]('VOICEMAIL',[_0x877aab[_0xbb0c('0x1c5')],_0x877aab['options']]);if(_0x4410ee[_0xbb0c('0xa2')]===-0x1){return _0x4410ee;}return this[_0xbb0c('0x11')][_0xbb0c('0xa7')](util[_0xbb0c('0x5a')]('Executed\x20command\x20%s\x20%s',_0xbb0c('0x1c6'),_0x877aab[_0xbb0c('0x1c5')]));};AGIVertices[_0xbb0c('0x13')][_0xbb0c('0x1c7')]=function(_0x495501){logger['info'](util['format'](_0xbb0c('0x1c8'),_0x495501[_0xbb0c('0x3e')]));if(!this[_0xbb0c('0x86')](_0x495501[_0xbb0c('0xd5')])){return this['channel'][_0xbb0c('0x33')](_0x495501,'no\x20variable\x20selected');}var _0x2d0b5e=this['getVariable'][_0xbb0c('0xbf')](this,_0x495501['variable_id']);if(!_0x2d0b5e){return this['channel']['error'](_0x495501,'no\x20variable\x20found');}var _0xe7051c=this[_0xbb0c('0x11')][_0xbb0c('0xa1')](_0x2d0b5e);return{'code':0xc8,'result':_0xe7051c[_0xbb0c('0x9f')]?_0xe7051c['extra']:'-'};};String[_0xbb0c('0x13')][_0xbb0c('0x1c9')]=function(_0x55c30e,_0x15944f){return this[_0xbb0c('0x1ca')](_0x55c30e)[_0xbb0c('0x1cb')](_0x15944f);};module[_0xbb0c('0x1cc')]=AGIVertices;
\ No newline at end of file
+var _0x10df=['getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','callerid','createSquareRecording','calleridname','context','accountcode','arg_1','createSquareMessage','isNil','callback_','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','method','timeout','number','includes','POST','PUT','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','grammar','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','out','dialogflowV2','DialogflowV2\x20Result\x20%s','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.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','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','first','substr','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','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','generate','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','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','no\x20find\x20by\x20configured','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','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','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','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','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','Intervals','format','%s/sounds/converted/%s'];(function(_0x1ac9f4,_0x5b796f){var _0x502020=function(_0x339456){while(--_0x339456){_0x1ac9f4['push'](_0x1ac9f4['shift']());}};_0x502020(++_0x5b796f);}(_0x10df,0x1ae));var _0xf10d=function(_0x4b634f,_0x4c0372){_0x4b634f=_0x4b634f-0x0;var _0x302e3c=_0x10df[_0x4b634f];return _0x302e3c;};'use strict';var fs=require('fs');var path=require(_0xf10d('0x0'));var util=require(_0xf10d('0x1'));var _=require('lodash');var sh=require(_0xf10d('0x2'));var odbc=require('odbc')();var rs=require(_0xf10d('0x3'));var moment=require(_0xf10d('0x4'));var Mustache=require(_0xf10d('0x5'));var rp=require(_0xf10d('0x6'));var logger=require('../../config/logger')(_0xf10d('0x7'));var config=require(_0xf10d('0x8'));var scripts=require(_0xf10d('0x9'));var FILES_PATH=_0xf10d('0xa');var recursiveMapAttributes=['rawHeaders',_0xf10d('0xb')];var verticesWithRetry=[_0xf10d('0xc'),'getdigits',_0xf10d('0xd')];var AGIVertices=function(_0x516f94,_0x1936d1,_0x3430c4){this['channel']=_0x516f94;this[_0xf10d('0xe')]=_0x1936d1;this[_0xf10d('0xf')]=_0x3430c4;};AGIVertices['prototype'][_0xf10d('0x10')]=function(_0x544ace,_0xc44808){this[_0xf10d('0xe')][_0xf10d('0x11')](_0x544ace)[_0xf10d('0x12')](function(_0x2a4389){_0xc44808(null,_0x2a4389?_0x2a4389[_0xf10d('0x13')]:![]);})['catch'](function(_0x32a19a){_0xc44808(_0x32a19a);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x15')]=function(_0x2f4476,_0x1d3f8b){this[_0xf10d('0xe')][_0xf10d('0x16')](_0x2f4476)[_0xf10d('0x12')](function(_0x43e042){_0x1d3f8b(null,_0x43e042?_0x43e042[_0xf10d('0x13')]:![]);})[_0xf10d('0x17')](function(_0x5848ed){_0x1d3f8b(_0x5848ed);});};AGIVertices['prototype']['getSquareProject']=function(_0x5acbf5,_0x43b3b2){this[_0xf10d('0xe')][_0xf10d('0x18')](_0x5acbf5)[_0xf10d('0x12')](function(_0x5ed1f3){_0x43b3b2(null,_0x5ed1f3?_0x5ed1f3[_0xf10d('0x13')]:![]);})[_0xf10d('0x17')](function(_0x2afb19){_0x43b3b2(_0x2afb19);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x19')]=function(_0x52a099,_0x2f44ab){this[_0xf10d('0xe')][_0xf10d('0x1a')](_0x52a099)[_0xf10d('0x12')](function(_0x796c21){_0x2f44ab(null,_0x796c21?_0x796c21[_0xf10d('0x1b')]:![]);})['catch'](function(_0x82050b){_0x2f44ab(_0x82050b);});};AGIVertices['prototype'][_0xf10d('0x1c')]=function(_0x158f26,_0x15872c){this[_0xf10d('0xe')][_0xf10d('0x1d')](_0x158f26)['then'](function(_0x5e01b3){_0x15872c(null,_0x5e01b3?_0x5e01b3[_0xf10d('0x13')]:![]);})[_0xf10d('0x17')](function(_0x474c01){_0x15872c(_0x474c01);});};AGIVertices[_0xf10d('0x14')]['getTrunk']=function(_0x45959c,_0x285fd9){this[_0xf10d('0xe')][_0xf10d('0x1e')](_0x45959c)['then'](function(_0x3106f4){_0x285fd9(null,_0x3106f4?_0x3106f4[_0xf10d('0x13')]:![]);})['catch'](function(_0x1c37f3){_0x285fd9(_0x1c37f3);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1f')]=function(_0x5880fc,_0x15c0d9){var _0x26d641=this;this[_0xf10d('0xe')]['getSoundById'](_0x5880fc)[_0xf10d('0x12')](function(_0x5a7030){_0x15c0d9(null,_0x5a7030?_0x26d641[_0xf10d('0x20')](_0x5a7030[_0xf10d('0x21')]):![]);})[_0xf10d('0x17')](function(_0x192400){_0x15c0d9(_0x192400);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x22')]=function(_0x55e4ef,_0x2e5f97){this[_0xf10d('0xe')]['getMailAccountById'](_0x55e4ef)[_0xf10d('0x12')](function(_0x1248d0){_0x2e5f97(null,_0x1248d0?_0x1248d0:![]);})[_0xf10d('0x17')](function(_0x286ee5){_0x2e5f97(_0x286ee5);});};AGIVertices[_0xf10d('0x14')]['sendMailMessage']=function(_0x37d758,_0x141b85,_0x354d8f){this[_0xf10d('0xf')][_0xf10d('0x23')](_0x37d758,_0x141b85)[_0xf10d('0x12')](function(){_0x354d8f(null);})['catch'](function(_0x417cd2){_0x354d8f(_0x417cd2);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x24')]=function(_0x5fa5dc,_0x31398b){this['rpc'][_0xf10d('0x25')](_0x5fa5dc)[_0xf10d('0x12')](function(_0x23efe6){if(_0x23efe6){if(_0x23efe6[_0xf10d('0x26')]){_0x31398b(null,[_0x23efe6[_0xf10d('0x27')]]);}else{_0x31398b(null,_['map'](_0x23efe6[_0xf10d('0x28')],_0xf10d('0x27')));}}else{_0x31398b(null,![]);}})[_0xf10d('0x17')](function(_0x545c6d){_0x31398b(_0x545c6d);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x20')]=function(_0x12284c){return util[_0xf10d('0x29')](_0xf10d('0x2a'),FILES_PATH,_0x12284c);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x2b')]=function(_0x163c0f,_0x934d67,_0x163790){odbc[_0xf10d('0x2c')](_0x163c0f,function(_0x3d1858){if(_0x3d1858){logger[_0xf10d('0x2d')](_0xf10d('0x2e'),_0x3d1858);_0x163790(_0x3d1858);}else{logger['info'](_0xf10d('0x2f'));odbc[_0xf10d('0x30')](_0x934d67,function(_0x21bdbe,_0x5e6d08){if(_0x21bdbe){logger[_0xf10d('0x31')](_0xf10d('0x32'),_0x934d67);_0x163790(_0x21bdbe);}else{logger[_0xf10d('0x31')](_0xf10d('0x33'),_0x934d67);odbc['close'](function(_0xe51517){if(_0xe51517){logger[_0xf10d('0x2d')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0xe51517);}_0x163790(null,_0x5e6d08);});}});}});};AGIVertices[_0xf10d('0x14')]['getSmsAccount']=function(_0x2813e8,_0x2dc7a6){this['rpc'][_0xf10d('0x34')](_0x2813e8)[_0xf10d('0x12')](function(_0x1f0db4){_0x2dc7a6(null,_0x1f0db4?_0x1f0db4:![]);})[_0xf10d('0x17')](function(_0x564be3){_0x2dc7a6(_0x564be3);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x35')]=function(_0x141251,_0x4191ae){this[_0xf10d('0xe')][_0xf10d('0x35')](_0x141251)[_0xf10d('0x12')](function(_0x2fcbf6){_0x4191ae(null,_0x2fcbf6);})[_0xf10d('0x17')](function(_0x4e7219){_0x4191ae(_0x4e7219);});};AGIVertices[_0xf10d('0x14')]['createSquareDetailsReport']=function(_0x32c031,_0x549f26,_0x1f6fe4){this[_0xf10d('0xe')][_0xf10d('0x36')]({'uniqueid':this[_0xf10d('0x37')][_0xf10d('0x38')],'node':_0x32c031['label'],'application':_0x32c031[_0xf10d('0x39')],'data':_0x549f26||null,'project_name':this[_0xf10d('0x37')]['arg_1'],'callerid':this['channel'][_0xf10d('0x3a')]})[_0xf10d('0x12')](function(_0x5d54a5){if(_0x1f6fe4){_0x1f6fe4(null,_0x5d54a5);}})[_0xf10d('0x17')](function(_0x20f8b1){if(_0x1f6fe4){_0x1f6fe4(_0x20f8b1);}});};AGIVertices[_0xf10d('0x14')]['createSquareRecording']=function(_0x433797,_0x46c587,_0x1d8fa9,_0x46f93d){this[_0xf10d('0xe')][_0xf10d('0x3b')]({'uniqueid':this[_0xf10d('0x37')][_0xf10d('0x38')],'callerid':this[_0xf10d('0x37')][_0xf10d('0x3a')],'calleridname':this[_0xf10d('0x37')][_0xf10d('0x3c')],'context':this[_0xf10d('0x37')][_0xf10d('0x3d')],'extension':this[_0xf10d('0x37')]['extension'],'priority':this[_0xf10d('0x37')]['priority'],'accountcode':this[_0xf10d('0x37')][_0xf10d('0x3e')],'dnid':this[_0xf10d('0x37')]['dnid'],'projectName':this[_0xf10d('0x37')][_0xf10d('0x3f')],'saveName':_0x46c587,'filename':_0x433797['file']||_0x46c587,'savePath':_0x1d8fa9})[_0xf10d('0x12')](function(_0x388820){_0x46f93d(null,_0x388820);})[_0xf10d('0x17')](function(_0x344669){_0x46f93d(_0x344669);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x40')]=function(_0x358f6b,_0x368aae,_0x1969d6,_0x132f4e,_0xa23a5c){this['rpc'][_0xf10d('0x40')]({'uniqueid':this[_0xf10d('0x37')][_0xf10d('0x38')],'body':_0x358f6b,'direction':_0x368aae,'providerName':_0x1969d6,'providerResponse':_0x132f4e})[_0xf10d('0x12')](function(_0x76339a){if(_0xa23a5c){_0xa23a5c(null,_0x76339a);}})['catch'](function(_0x429dc6){if(_0xa23a5c){_0xa23a5c(_0x429dc6);}});};AGIVertices[_0xf10d('0x14')]['createCmContact']=function(_0x1d12a9,_0x49340f){this[_0xf10d('0xe')]['createCmContact']({'firstName':_['isEmpty'](_0x1d12a9['name'])||_[_0xf10d('0x41')](_0x1d12a9['name'])?_0xf10d('0x42')+Math['random']():_0x1d12a9[_0xf10d('0x13')],'lastName':_[_0xf10d('0x43')](_0x1d12a9[_0xf10d('0x44')])||_['isNil'](_0x1d12a9['lastName'])?null:_0x1d12a9[_0xf10d('0x44')],'phone':_0x1d12a9[_0xf10d('0x45')],'ListId':_0x1d12a9[_0xf10d('0x46')],'scheduledat':_0x1d12a9[_0xf10d('0x47')],'callbackUniqueid':this[_0xf10d('0x37')][_0xf10d('0x38')],'tags':_0xf10d('0x48'),'description':_0xf10d('0x49')+_0x1d12a9[_0xf10d('0x47')][_0xf10d('0x4a')](),'priority':_0x1d12a9[_0xf10d('0x4b')]})['then'](function(_0x5d60dd){_0x49340f(null,_0x5d60dd);})['catch'](function(_0x12ee03){_0x49340f(_0x12ee03);});};AGIVertices['prototype'][_0xf10d('0x4c')]=function(_0xeba821,_0x2a7602){this['rpc'][_0xf10d('0x4d')](_0xeba821)[_0xf10d('0x12')](function(_0x5d5988){_0x2a7602(null,_0x5d5988?_0x5d5988[_0xf10d('0x13')]:![]);})['catch'](function(_0x36275c){_0x2a7602(_0x36275c);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x4e')]=function(_0x239ab0,_0x555f5d,_0x25e55a){var _0x1cfbb2={'role':_0xf10d('0x4f')};_0x1cfbb2[_0x239ab0]=this['channel'][_0xf10d('0x3a')];this['rpc'][_0xf10d('0x4e')](_0x1cfbb2,_0x555f5d,this[_0xf10d('0x37')]['uniqueid'])[_0xf10d('0x12')](function(_0x5b947d){_0x25e55a(null,_['isNil'](_0x5b947d)?![]:!![]);})[_0xf10d('0x17')](function(_0xd73c41){logger[_0xf10d('0x2d')](_0xd73c41);_0x25e55a(null,![]);});};AGIVertices[_0xf10d('0x14')]['agentUnpause']=function(_0x46a842,_0x4a35cc){var _0x137cd9={'role':'agent'};_0x137cd9[_0x46a842]=this['channel'][_0xf10d('0x3a')];this[_0xf10d('0xe')][_0xf10d('0x50')](_0x137cd9)[_0xf10d('0x12')](function(_0x19d966){_0x4a35cc(null,_[_0xf10d('0x41')](_0x19d966)?![]:!![]);})[_0xf10d('0x17')](function(_0xc0ffe4){logger[_0xf10d('0x2d')](_0xc0ffe4);_0x4a35cc(null,![]);});};AGIVertices[_0xf10d('0x14')]['agentLogout']=function(_0x418a02,_0x3de8d4){var _0x4712b3={'role':_0xf10d('0x4f')};_0x4712b3[_0x418a02]=this[_0xf10d('0x37')]['callerid'];this[_0xf10d('0xe')][_0xf10d('0x51')](_0x4712b3)[_0xf10d('0x12')](function(_0x29c76c){_0x3de8d4(null,_['isNil'](_0x29c76c)?![]:!![]);})[_0xf10d('0x17')](function(_0x1a9e61){logger[_0xf10d('0x2d')](_0x1a9e61);_0x3de8d4(null,![]);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x52')]=function(_0x2d8676,_0x406b0a){var _0x2f5938={'role':_0xf10d('0x4f')};_0x2f5938[_0x2d8676]=this['channel']['callerid'];var _0x49e4f2=_0x2d8676!=_0xf10d('0x53')?util[_0xf10d('0x29')](_0xf10d('0x54'),_0xf10d('0x55'),this['channel'][_0xf10d('0x3a')]):undefined;this[_0xf10d('0xe')][_0xf10d('0x52')](_0x2f5938,_0x49e4f2)['then'](function(_0x694d59){_0x406b0a(null,_[_0xf10d('0x41')](_0x694d59)?![]:!![]);})[_0xf10d('0x17')](function(_0xcf968b){logger[_0xf10d('0x2d')](_0xcf968b);_0x406b0a(null,![]);});};AGIVertices['prototype'][_0xf10d('0x56')]=function(_0x215b95,_0x4f02cc){sh[_0xf10d('0x57')](_[_0xf10d('0x58')](_0x215b95),function(_0x3d190c,_0x422273){var _0x18b61f=_0x422273[_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'');_0x4f02cc(null,_0x18b61f);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x5a')]=function(_0x48b7ca,_0x236327){scripts[_0xf10d('0x5a')](_0x48b7ca[_0xf10d('0x5b')],_0x48b7ca[_0xf10d('0x5c')]||'text',_0x48b7ca[_0xf10d('0x5d')],_0x48b7ca[_0xf10d('0x5e')]||_0xf10d('0x5f'),_0x48b7ca[_0xf10d('0x60')]||'MALE',_0x48b7ca[_0xf10d('0x61')]||_0xf10d('0x62'))[_0xf10d('0x12')](function(_0x2fa04b){_0x236327(null,_0x2fa04b);})[_0xf10d('0x17')](function(_0x71fb73){_0x236327(_0x71fb73);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x63')]=function(_0x2a6544,_0x1a3672){scripts[_0xf10d('0x63')](_0x2a6544[_0xf10d('0x5d')],_0x2a6544[_0xf10d('0x64')]||'en',0x1)['then'](function(_0x497f6a){_0x1a3672(null,_0x497f6a);})[_0xf10d('0x17')](function(_0x59b7b0){_0x1a3672(_0x59b7b0);});};AGIVertices['prototype'][_0xf10d('0x65')]=function(_0x44ca86,_0x52e66c){var _0x4e7abc={'uri':_0x44ca86['url'],'method':_0x44ca86[_0xf10d('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x44ca86[_0xf10d('0x67')])===_0xf10d('0x68')&&parseInt(_0x44ca86[_0xf10d('0x67')])>=0x1?parseInt(_0x44ca86[_0xf10d('0x67')])*0x3e8:0x5*0x3e8};if(_[_0xf10d('0x69')]([_0xf10d('0x6a'),_0xf10d('0x6b')],_0x4e7abc[_0xf10d('0x66')]['toUpperCase']())){try{_0x4e7abc[_0xf10d('0x6c')]=_0x44ca86[_0xf10d('0xb')]?JSON[_0xf10d('0x6d')](_0x44ca86[_0xf10d('0xb')]):{};}catch(_0x2a721c){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2a721c);}}try{_0x4e7abc[_0xf10d('0x6e')]=_0x44ca86[_0xf10d('0x6f')]?JSON[_0xf10d('0x6d')](_0x44ca86['rawHeaders']):{};}catch(_0x213166){logger[_0xf10d('0x2d')](_0xf10d('0x70'),_0x213166);}if(_0x44ca86[_0xf10d('0x71')]){try{var _0x3b7ec0=require(_0x44ca86['computedVariables'])[_0xf10d('0x72')](this,_0x4e7abc);_0x4e7abc[_0xf10d('0x73')]=Mustache[_0xf10d('0x74')](_0x44ca86[_0xf10d('0x75')],_0x3b7ec0,{},['$$','$$']);if(_0x4e7abc[_0xf10d('0x6e')]){_0x4e7abc[_0xf10d('0x6e')]=JSON[_0xf10d('0x6d')](Mustache['render'](JSON['stringify'](_0x4e7abc[_0xf10d('0x6e')]),_0x3b7ec0,{},['$$','$$']));}if(_0x4e7abc[_0xf10d('0x6c')]){_0x4e7abc[_0xf10d('0x6c')]=JSON['parse'](Mustache[_0xf10d('0x74')](JSON[_0xf10d('0x76')](_0x4e7abc[_0xf10d('0x6c')]),_0x3b7ec0,{},['$$','$$']));}}catch(_0x59e242){logger[_0xf10d('0x2d')](_0xf10d('0x77'),_0x59e242);}}rp(_0x4e7abc)[_0xf10d('0x12')](function(_0x5162ce){var _0x51b0b0={'statusCode':_0x5162ce['statusCode']||0xc8,'statusMessage':_0x5162ce[_0xf10d('0x78')]||'OK','headers':_0x5162ce[_0xf10d('0x6e')]||{},'body':_0x5162ce[_0xf10d('0x6c')]||{}};_0x52e66c(null,_0x51b0b0);})[_0xf10d('0x17')](function(_0x563921){var _0x47bee5={'statusCode':_0x563921[_0xf10d('0x79')]||0x1f4,'statusMessage':_0x563921[_0xf10d('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x563921[_0xf10d('0x7b')][_0xf10d('0x6e')]||{},'body':_0x563921[_0xf10d('0x7b')][_0xf10d('0x6c')]||{}};_0x52e66c(null,_0x47bee5);});};AGIVertices[_0xf10d('0x14')]['googleDialogflow']=function(_0x2c7060,_0x4aae17){scripts[_0xf10d('0x7c')](this['channel'][_0xf10d('0x38')],_0x2c7060[_0xf10d('0x7d')],_0x2c7060['text'],_0x2c7060[_0xf10d('0x7e')]||'en')[_0xf10d('0x12')](function(_0x4ec35e){_0x4aae17(null,_0x4ec35e);})[_0xf10d('0x17')](function(_0x3f9bce){_0x4aae17(_0x3f9bce);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x7f')]=function(_0x53c76a,_0x3f3e95){scripts[_0xf10d('0x7f')](this[_0xf10d('0x37')]['uniqueid'],_0x53c76a[_0xf10d('0x80')],_0x53c76a[_0xf10d('0x81')],_0x53c76a[_0xf10d('0x82')],_0x53c76a[_0xf10d('0x5d')],_0x53c76a['dialogflowV2_language']||'en')['then'](function(_0x344a15){_0x3f3e95(null,_0x344a15);})[_0xf10d('0x17')](function(_0x11bf0d){_0x3f3e95(_0x11bf0d);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x83')]=function(_0x309396,_0x5b0675){scripts[_0xf10d('0x83')](this['channel'],_0x309396)['then'](function(_0x2e06f2){_0x5b0675(null,_0x2e06f2);})[_0xf10d('0x17')](function(_0x5100bc){_0x5b0675(_0x5100bc);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x84')]=function(_0x2ab1b2,_0x4795ce){scripts[_0xf10d('0x84')](_0x2ab1b2[_0xf10d('0x7d')],_0x2ab1b2['text'],_0x2ab1b2[_0xf10d('0x85')]||_0xf10d('0x5f'),_0x2ab1b2[_0xf10d('0x86')])['then'](function(_0x581f59){_0x4795ce(null,_0x581f59);})[_0xf10d('0x17')](function(_0x469a63){_0x4795ce(_0x469a63);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x87')]=function(_0x54915a,_0xe777f0,_0x15c210){scripts[_0xf10d('0x87')](_0xe777f0,_0x54915a[_0xf10d('0x7d')],_0x54915a[_0xf10d('0x88')]||_0xf10d('0x5f'),this[_0xf10d('0x89')](_0x54915a[_0xf10d('0x8a')])?_0x54915a[_0xf10d('0x8a')]:undefined)[_0xf10d('0x12')](function(_0x3a0d28){_0x15c210(null,_0x3a0d28);})[_0xf10d('0x17')](function(_0x10ab28){_0x15c210(_0x10ab28);});};AGIVertices['prototype'][_0xf10d('0x8b')]=function(_0x95ebdb,_0x1f06bb){scripts[_0xf10d('0x8b')](_0x95ebdb[_0xf10d('0x8c')],_0x95ebdb['aws_secret_access_key'],_0x95ebdb['aws_polly_region'],_0x95ebdb[_0xf10d('0x8d')]||_0xf10d('0x8e'),_0x95ebdb[_0xf10d('0x5d')],_0x95ebdb[_0xf10d('0x8f')]||'text')['then'](function(_0x4d9f93){_0x1f06bb(null,_0x4d9f93);})[_0xf10d('0x17')](function(_0x13b9b5){_0x1f06bb(_0x13b9b5);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x90')]=function(_0x330370,_0x48ea24){scripts[_0xf10d('0x90')](this[_0xf10d('0x37')]['uniqueid'],_0x330370['aws_access_key_id'],_0x330370[_0xf10d('0x91')],_0x330370['aws_lex_region'],_0x330370[_0xf10d('0x5d')],_0x330370[_0xf10d('0x92')])['then'](function(_0x19d2eb){_0x48ea24(null,_0x19d2eb);})[_0xf10d('0x17')](function(_0x469d7a){_0x48ea24(_0x469d7a);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x93')]=function(_0x597624,_0x3fdc1e,_0x15a8cd){scripts[_0xf10d('0x93')](_0x3fdc1e,_0x597624['key'],_0x597624[_0xf10d('0x94')]||_0xf10d('0x5f'))[_0xf10d('0x12')](function(_0x1d2c4f){_0x15a8cd(null,_0x1d2c4f);})[_0xf10d('0x17')](function(_0x2e868d){_0x15a8cd(_0x2e868d);});};AGIVertices['prototype'][_0xf10d('0x95')]=function(_0x2c2cad,_0x5cea05,_0x27fa29){scripts[_0xf10d('0x95')](_0x5cea05,_0x2c2cad[_0xf10d('0x96')],_0x2c2cad['appsecret'],_0x2c2cad[_0xf10d('0x73')])[_0xf10d('0x12')](function(_0x172181){_0x27fa29(null,_0x172181);})['catch'](function(_0x221175){_0x27fa29(_0x221175);});};AGIVertices[_0xf10d('0x14')][_0xf10d('0x97')]=function(_0x50bab1){var _0x15f5e2=_['includes'](verticesWithRetry,_0x50bab1[_0xf10d('0x39')])?_0x50bab1:_['clone'](_0x50bab1);for(var _0x4cf1e3 in _0x15f5e2){if(_0x15f5e2[_0xf10d('0x98')](_0x4cf1e3)){if(_0x15f5e2[_0x4cf1e3]&&_[_0xf10d('0x99')](_0x15f5e2[_0x4cf1e3])){if(_[_0xf10d('0x69')](recursiveMapAttributes,_0x4cf1e3)){_0x15f5e2[_0x4cf1e3]=this[_0xf10d('0x9a')](_0x15f5e2[_0x4cf1e3]);}else{_0x15f5e2[_0x4cf1e3]=this[_0xf10d('0x9b')](_0x15f5e2[_0x4cf1e3]);}}}}return _0x15f5e2;};AGIVertices[_0xf10d('0x14')]['recursiveNodeIndex']=function(_0x1a2317){for(var _0x57ffa1 in _0x1a2317){if(_0x1a2317[_0xf10d('0x98')](_0x57ffa1)){if(_[_0xf10d('0x9c')](_0x1a2317[_0x57ffa1])){this[_0xf10d('0x9d')](_0x1a2317[_0x57ffa1]);}else if(_[_0xf10d('0x9e')](_0x1a2317[_0x57ffa1])){for(var _0x5a9fe0=0x0;_0x5a9fe0<_0x1a2317[_0x57ffa1][_0xf10d('0x9f')];_0x5a9fe0++){this[_0xf10d('0x9d')](_0x1a2317[_0x57ffa1][_0x5a9fe0]);}}else if(_[_0xf10d('0x99')](_0x1a2317[_0x57ffa1])){_0x1a2317[_0x57ffa1]=this[_0xf10d('0x9b')](_0x1a2317[_0x57ffa1]);}}}};AGIVertices[_0xf10d('0x14')][_0xf10d('0xa0')]=function(_0x40b0c4,_0x5b7fa0){for(var _0x20faa4 in _0x40b0c4){if(_0x40b0c4['hasOwnProperty'](_0x20faa4)){if(_[_0xf10d('0x9c')](_0x40b0c4[_0x20faa4])){if(!_[_0xf10d('0x43')](_0x40b0c4[_0x20faa4])){this[_0xf10d('0xa0')](_0x40b0c4[_0x20faa4],util[_0xf10d('0x29')]('%s.%s',_0x5b7fa0,_0x20faa4));}}else if(_[_0xf10d('0x9e')](_0x40b0c4[_0x20faa4])){for(var _0x582db1=0x0;_0x582db1<_0x40b0c4[_0x20faa4][_0xf10d('0x9f')];_0x582db1++){this[_0xf10d('0xa0')](_0x40b0c4[_0x20faa4][_0x582db1],util['format'](_0xf10d('0xa1'),_0x5b7fa0,_0x20faa4+'['+_0x582db1+']'));}}else{if(!_[_0xf10d('0x41')](_0x40b0c4[_0x20faa4])){this[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0xa1'),_0x5b7fa0,_0x20faa4),_0x40b0c4[_0x20faa4]);}}}}};AGIVertices['prototype'][_0xf10d('0x9a')]=function(_0x123a60){try{var _0x3d6dfb=JSON[_0xf10d('0x6d')](_0x123a60);this['recursiveNodeIndex'](_0x3d6dfb);return JSON['stringify'](_0x3d6dfb);}catch(_0x5abdea){return this['replaceAllVariables'](_0x123a60);}};AGIVertices[_0xf10d('0x14')]['replaceAllVariables']=function(_0x4ec5bb){var _0x526c68=_0x4ec5bb[_0xf10d('0xa3')]('{');for(var _0x5dd926=0x1;_0x5dd926<_0x526c68[_0xf10d('0x9f')];_0x5dd926+=0x1){var _0x21b06e=_0x526c68[_0x5dd926][_0xf10d('0xa3')]('}');if(_0x21b06e[_0xf10d('0x9f')]>0x1){_0x4ec5bb=_0x4ec5bb[_0xf10d('0xa4')]('{'+_0x21b06e[0x0]+'}',this[_0xf10d('0x37')][_0xf10d('0x10')](_0x21b06e[0x0])[_0xf10d('0xa5')]||_0x21b06e[0x0]);}}if(_0x526c68['length']===0x1){return _0x4ec5bb['toString']();}return this[_0xf10d('0x9b')](_0x4ec5bb);};AGIVertices['prototype'][_0xf10d('0xa6')]=function(_0x5bc577,_0xebbd06){var _0x656b7c=this['channel'][_0xf10d('0x10')](_0x5bc577);if(_0x656b7c[_0xf10d('0xa7')]===-0x1){return _0x656b7c;}logger['info'](util[_0xf10d('0x29')](_0xf10d('0xa8'),_0xebbd06,_0x656b7c[_0xf10d('0xa5')]));return this['channel'][_0xf10d('0xa2')](_0xebbd06,_0x656b7c[_0xf10d('0xa5')]);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x89')]=function(_0x45ab56){return _0x45ab56&&_0x45ab56!=='0'&&_0x45ab56!=='-1'&&_0x45ab56!=='';};AGIVertices[_0xf10d('0x14')][_0xf10d('0xa9')]=function(_0x4eb0f1){this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x4eb0f1,'-');_0x4eb0f1[_0xf10d('0xaa')]=_0x4eb0f1[_0xf10d('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf10d('0x14')][_0xf10d('0xab')]=function(_0x4fdfe9){logger[_0xf10d('0x31')](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x4fdfe9['label']));if(!this['isConfigured'](_0x4fdfe9[_0xf10d('0x5d')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xad'));}var _0x51f1a1='\x22'+_0x4fdfe9[_0xf10d('0x5d')]+'\x22';if(this[_0xf10d('0x89')](_0x4fdfe9[_0xf10d('0x7b')])){_0x51f1a1+=','+_0x4fdfe9['options'];}var _0x4026d2=this[_0xf10d('0x37')][_0xf10d('0x57')]('MRCPSynth',_0x51f1a1);if(_0x4026d2[_0xf10d('0xa7')]===-0x1){return _0x4026d2;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xae'),_0x51f1a1));};AGIVertices[_0xf10d('0x14')]['mrcprecog']=function(_0x5de37a){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xaf'),_0x5de37a[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x5de37a['grammar'])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xb1'));}var _0x336c62=_0x5de37a['grammar'];if(this[_0xf10d('0x89')](_0x5de37a['options'])){_0x336c62+=','+_0x5de37a[_0xf10d('0x7b')];}var _0x476ff3=this[_0xf10d('0x37')][_0xf10d('0x57')](_0xf10d('0xb2'),_0x336c62);if(_0x476ff3['result']===-0x1){return _0x476ff3;}var _0x2d1f5f=this[_0xf10d('0xa6')](_0xf10d('0xb3'),_0xf10d('0xb4'));if(_0x2d1f5f[_0xf10d('0xa7')]===-0x1){return _0x2d1f5f;}var _0x34796e=this[_0xf10d('0xa6')](_0xf10d('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x34796e['result']===-0x1){return _0x34796e;}var _0x456a06=this['getAndSetVariable'](_0xf10d('0xb6'),_0xf10d('0xb7'));if(_0x456a06[_0xf10d('0xa7')]===-0x1){return _0x456a06;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x336c62));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x7')]=function(_0x40c066){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xb8'),_0x40c066[_0xf10d('0xb0')]));return this[_0xf10d('0x37')]['agi']([_0x40c066[_0xf10d('0xb9')],_0x40c066[_0xf10d('0xba')]]);};AGIVertices[_0xf10d('0x14')][_0xf10d('0xbb')]=function(_0x2f4fac){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2f4fac[_0xf10d('0xb0')]));if(this[_0xf10d('0x89')](_0x2f4fac[_0xf10d('0x67')])){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xbc'),_0x2f4fac[_0xf10d('0x67')]));var _0x29d4bc=this[_0xf10d('0x37')][_0xf10d('0xbd')](_0x2f4fac['timeout']);if(_0x29d4bc['result']===-0x1){return _0x29d4bc;}}return this[_0xf10d('0x37')][_0xf10d('0xbb')]();};AGIVertices['prototype'][_0xf10d('0x48')]=function(_0x1e7aaa){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xbe'),_0x1e7aaa[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x1e7aaa['list_id'])){return this[_0xf10d('0x37')]['error'](_0x1e7aaa,_0xf10d('0xbf'));}_0x1e7aaa[_0xf10d('0x47')]=moment();if(this['isConfigured'](_0x1e7aaa[_0xf10d('0xc0')])){_0x1e7aaa[_0xf10d('0x47')]=moment()[_0xf10d('0xc1')](_0x1e7aaa[_0xf10d('0xc0')],'minutes');}if(!this[_0xf10d('0x89')](_0x1e7aaa[_0xf10d('0x4b')])){_0x1e7aaa[_0xf10d('0x4b')]=0x2;}this['createCmContact'][_0xf10d('0x72')](this,_0x1e7aaa);return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x1e7aaa[_0xf10d('0x45')],_0x1e7aaa[_0xf10d('0x46')],_0x1e7aaa[_0xf10d('0x47')]));};AGIVertices['prototype'][_0xf10d('0xc2')]=function(_0x527715){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x527715[_0xf10d('0xb0')]));var _0x15ba31=this[_0xf10d('0x37')][_0xf10d('0x57')](_0x527715[_0xf10d('0xc3')],_0x527715[_0xf10d('0x7b')]);if(_0x15ba31[_0xf10d('0xa7')]===-0x1){return _0x15ba31;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xc4'),_0x527715[_0xf10d('0xc3')],_0x527715[_0xf10d('0x7b')]));};AGIVertices[_0xf10d('0x14')][_0xf10d('0xc5')]=function(_0x1ce317){logger['info'](util[_0xf10d('0x29')](_0xf10d('0xc6'),_0x1ce317[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x1ce317['text'])){return this['channel']['noop']('no\x20text\x20configured');}var _0x5f109a='\x22'+_0x1ce317[_0xf10d('0x5d')]+'\x22';if(this[_0xf10d('0x89')](_0x1ce317[_0xf10d('0x7b')])){_0x5f109a+=','+_0x1ce317['options'];}var _0x5c1b59=this[_0xf10d('0x37')][_0xf10d('0x57')]('MRCPSynth',_0x5f109a);if(_0x5c1b59[_0xf10d('0xa7')]===-0x1){return _0x5c1b59;}return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5f109a));};AGIVertices[_0xf10d('0x14')]['sestektts']=function(_0x4b502e){logger[_0xf10d('0x31')](util['format'](_0xf10d('0xc7'),_0x4b502e[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x4b502e[_0xf10d('0x5d')])){return this[_0xf10d('0x37')]['noop'](_0xf10d('0xad'));}var _0x504f3c='\x22'+_0x4b502e[_0xf10d('0x5d')]+'\x22';if(this[_0xf10d('0x89')](_0x4b502e[_0xf10d('0x7b')])){_0x504f3c+=','+_0x4b502e[_0xf10d('0x7b')];}var _0x5633f5=this[_0xf10d('0x37')][_0xf10d('0x57')]('MRCPSynth',_0x504f3c);if(_0x5633f5[_0xf10d('0xa7')]===-0x1){return _0x5633f5;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xae'),_0x504f3c));};AGIVertices[_0xf10d('0x14')][_0xf10d('0xc8')]=function(_0x596c63){logger[_0xf10d('0x31')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x596c63[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x596c63[_0xf10d('0xc9')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xb1'));}var _0x4ae6f0=_0x596c63[_0xf10d('0xc9')];if(this['isConfigured'](_0x596c63[_0xf10d('0x7b')])){_0x4ae6f0+=','+_0x596c63[_0xf10d('0x7b')];}var _0x402710=this[_0xf10d('0x37')][_0xf10d('0x57')](_0xf10d('0xb2'),_0x4ae6f0);if(_0x402710[_0xf10d('0xa7')]===-0x1){return _0x402710;}var _0x53b090=this['getAndSetVariable'](_0xf10d('0xb3'),_0xf10d('0xca'));if(_0x53b090[_0xf10d('0xa7')]===-0x1){return _0x53b090;}var _0x58ed4d=this[_0xf10d('0xa6')](_0xf10d('0xb5'),_0xf10d('0xcb'));if(_0x58ed4d[_0xf10d('0xa7')]===-0x1){return _0x58ed4d;}var _0x3148dc=this[_0xf10d('0xa6')](_0xf10d('0xb6'),_0xf10d('0xcc'));if(_0x3148dc['result']===-0x1){return _0x3148dc;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xcd'),_0x4ae6f0));};AGIVertices[_0xf10d('0x14')]['sestekasr']=function(_0x4c7cd5){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xce'),_0x4c7cd5[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x4c7cd5[_0xf10d('0xc9')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xb1'));}var _0x1c827d=_0x4c7cd5['grammar'];if(this[_0xf10d('0x89')](_0x4c7cd5['options'])){_0x1c827d+=','+_0x4c7cd5[_0xf10d('0x7b')];}var _0x3af31b=this[_0xf10d('0x37')][_0xf10d('0x57')]('MRCPRecog',_0x1c827d);if(_0x3af31b[_0xf10d('0xa7')]===-0x1){return _0x3af31b;}var _0x574ea3=this[_0xf10d('0xa6')](_0xf10d('0xb3'),_0xf10d('0xcf'));if(_0x574ea3['result']===-0x1){return _0x574ea3;}var _0x2ac1c1=this[_0xf10d('0xa6')](_0xf10d('0xb5'),_0xf10d('0xd0'));if(_0x2ac1c1[_0xf10d('0xa7')]===-0x1){return _0x2ac1c1;}var _0x562086=this[_0xf10d('0xa6')](_0xf10d('0xb6'),'SESTEK_ASR_INSTANCE');if(_0x562086[_0xf10d('0xa7')]===-0x1){return _0x562086;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0xcd'),_0x1c827d));};AGIVertices[_0xf10d('0x14')][_0xf10d('0xd1')]=function(_0x45804f){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xd2'),_0x45804f[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x45804f[_0xf10d('0xd3')])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x45804f,_0xf10d('0xd4'));}var _0x281c92=this[_0xf10d('0x19')][_0xf10d('0x72')](this,_0x45804f['odbc_id']);if(!_0x281c92){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x45804f,'no\x20odbc\x20database\x20found');}if(!this[_0xf10d('0x89')](_0x45804f[_0xf10d('0x30')])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x45804f,_0xf10d('0xd5'));}var _0x51294b=_0x45804f[_0xf10d('0x30')][_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xd6'),_0x51294b));var _0x16c85b=this['getQueryOdbc'][_0xf10d('0x72')](this,_0x281c92,_0x51294b);this[_0xf10d('0x36')]['sync'](this,_0x45804f,_0x51294b);if(!this[_0xf10d('0x89')](_0x45804f['variable_id'])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xd7'));}var _0x141147=this['getVariable'][_0xf10d('0x72')](this,_0x45804f[_0xf10d('0xd8')]);if(!_0x141147){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x45804f,_0xf10d('0xd9'));}var _0x5d9782=this;_0x16c85b[_0xf10d('0xda')](function(_0x23f125,_0x2089fd){Object[_0xf10d('0xdb')](_0x23f125)[_0xf10d('0xda')](function(_0x40f587){_0x5d9782[_0xf10d('0x37')][_0xf10d('0xa2')](util['format']('%s[%s][%s]',_0x141147,_0x2089fd,_0x40f587),_0x23f125[_0x40f587]);});});this['channel']['setVariable'](util[_0xf10d('0x29')]('%s_ROWS_COUNT',_0x141147),_0x16c85b[_0xf10d('0x9f')]);return this[_0xf10d('0x37')]['noop'](util['format'](_0xf10d('0xdc'),_0x141147));};AGIVertices['prototype'][_0xf10d('0xdd')]=function(_0x4dcda7){logger[_0xf10d('0xde')](util[_0xf10d('0x29')](_0xf10d('0xdf'),_0x4dcda7[_0xf10d('0xb0')]));if(!this['isConfigured'](_0x4dcda7['sip_id'])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x4dcda7,'no\x20user\x20selected');}var _0x21690e=this[_0xf10d('0x1c')][_0xf10d('0x72')](this,_0x4dcda7['sip_id']);if(!_0x21690e){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x4dcda7,'no\x20user\x20found');}var _0x34d9f8=this['channel'][_0xf10d('0x57')](_0xf10d('0xe0'),[util[_0xf10d('0x29')](_0xf10d('0xe1'),_0x21690e),_0x4dcda7[_0xf10d('0x67')],_0x4dcda7[_0xf10d('0xe2')],_0x4dcda7[_0xf10d('0x75')]]);if(_0x34d9f8[_0xf10d('0xa7')]===-0x1){return _0x34d9f8;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xe3'),_0xf10d('0xe0')));};AGIVertices[_0xf10d('0x14')][_0xf10d('0xe4')]=function(_0x3a6435){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xe5'),_0x3a6435[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x3a6435[_0xf10d('0x7d')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xe6'));}if(!this[_0xf10d('0x89')](_0x3a6435[_0xf10d('0x5d')])){return this[_0xf10d('0x37')]['noop'](_0xf10d('0xad'));}this[_0xf10d('0x37')][_0xf10d('0xe7')]=!![];this[_0xf10d('0x36')](_0x3a6435);this[_0xf10d('0x40')](_0x3a6435[_0xf10d('0x5d')],'in','','');this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xe8'),_0x3a6435['text']));var _0x35f230=this['googleDialogflow'][_0xf10d('0x72')](this,_0x3a6435);if(_0x35f230){for(var _0x481ff6 in _0x35f230){if(_0x35f230[_0xf10d('0x98')](_0x481ff6)){this[_0xf10d('0x37')][_0xf10d('0xa2')](util['format']('DIALOGFLOW_%s',_0x481ff6[_0xf10d('0xe9')]()),_0x35f230[_0x481ff6]);}}this[_0xf10d('0x40')](_0x35f230['speech'],'out','dialogflow','');return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xea'),_0x35f230[_0xf10d('0xeb')]));}return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x3a6435,_0xf10d('0xec'));};AGIVertices[_0xf10d('0x14')]['dialogflowV2']=function(_0x363952){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0xed'),_0x363952[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x363952[_0xf10d('0x80')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xee'));}if(!this[_0xf10d('0x89')](_0x363952[_0xf10d('0x81')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xef'));}if(!this[_0xf10d('0x89')](_0x363952[_0xf10d('0x82')])){return this[_0xf10d('0x37')][_0xf10d('0xac')]('no\x20private_key\x20configured');}if(!this[_0xf10d('0x89')](_0x363952[_0xf10d('0xf0')])){return this[_0xf10d('0x37')][_0xf10d('0xac')]('no\x20anguage\x20configured');}if(!this[_0xf10d('0x89')](_0x363952[_0xf10d('0x5d')])){return this['channel'][_0xf10d('0xac')]('no\x20text\x20configured');}this[_0xf10d('0x37')][_0xf10d('0xe7')]=!![];this[_0xf10d('0x36')](_0x363952);this[_0xf10d('0x40')](_0x363952['text'],'in','','');this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xf1'),_0x363952[_0xf10d('0x5d')]));var _0x469aa0=this['googleDialogflowV2'][_0xf10d('0x72')](this,_0x363952);if(_0x469aa0){for(var _0x154efc in _0x469aa0){if(_0x469aa0['hasOwnProperty'](_0x154efc)){if(_0x154efc!==_0xf10d('0xf2')){this[_0xf10d('0x37')]['setVariable'](util[_0xf10d('0x29')](_0xf10d('0xf3'),_0x154efc[_0xf10d('0xe9')]()),_0x469aa0[_0x154efc]);}}}this[_0xf10d('0x40')](_0x469aa0[_0xf10d('0xeb')],_0xf10d('0xf4'),_0xf10d('0xf5'),_0x469aa0[_0xf10d('0xf2')]);return this['channel']['noop'](util[_0xf10d('0x29')](_0xf10d('0xf6'),_0x469aa0[_0xf10d('0xeb')]));}return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x363952,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype']['sesteknda']=function(_0x4836a6){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x4836a6[_0xf10d('0xb0')]));if(!this['isConfigured'](_0x4836a6[_0xf10d('0xf7')])){return this['channel']['noop'](_0xf10d('0xf8'));}if(!this[_0xf10d('0x89')](_0x4836a6[_0xf10d('0xf9')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xfa'));}if(!this[_0xf10d('0x89')](_0x4836a6[_0xf10d('0xfb')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xfc'));}if(!this[_0xf10d('0x89')](_0x4836a6[_0xf10d('0xfd')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xad'));}this[_0xf10d('0x37')]['bot']=!![];this[_0xf10d('0x36')](_0x4836a6);this[_0xf10d('0x40')](_0x4836a6[_0xf10d('0x5d')],'in','','');this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0xfe'),_0x4836a6['text']));var _0x3af30b=this['sestekNDA'][_0xf10d('0x72')](this,_0x4836a6);if(_0x3af30b){for(var _0x4aa8b3 in _0x3af30b){if(_0x3af30b[_0xf10d('0x98')](_0x4aa8b3)){this[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0xff'),_0x4aa8b3[_0xf10d('0xe9')]()),_0x3af30b[_0x4aa8b3]);}}this['createSquareMessage'](_0x3af30b[_0xf10d('0xeb')],'out',_0xf10d('0x100'),'');if(_0x3af30b['audiofile']){this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x101'),_0x3af30b[_0xf10d('0x102')]));var _0xd56dd2=this[_0xf10d('0x37')][_0xf10d('0x103')](_0x3af30b[_0xf10d('0x102')]);try{fs[_0xf10d('0x104')](_0x3af30b[_0xf10d('0x102')]+_0xf10d('0x105'));}catch(_0x4b3728){logger[_0xf10d('0x2d')](_0x4b3728);}return _0xd56dd2;}else{return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x106'),_0x3af30b[_0xf10d('0xeb')]));}}return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x4836a6,_0xf10d('0x107'));};AGIVertices['prototype'][_0xf10d('0x108')]=function(_0x1ca18f){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x109'),_0x1ca18f[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x108'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x10a')]=function(_0x365432){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x10b'),_0x365432['label']));var _0x106081='';if(_0x365432[_0xf10d('0x10c')]){if(!this[_0xf10d('0x89')](_0x365432['trunk_id'])){return this['channel'][_0xf10d('0x2d')](_0x365432,_0xf10d('0x10d'));}else{var _0x971109=parseInt(_0x365432[_0xf10d('0x10c')],0xa);if(isNaN(_0x971109)){_0x106081=_0x365432[_0xf10d('0x10c')];}else{_0x106081=this[_0xf10d('0x10e')][_0xf10d('0x72')](this,_0x365432[_0xf10d('0x10c')]);if(!_0x106081){return this[_0xf10d('0x37')]['error'](_0x365432,_0xf10d('0x10f'));}}}}else if(_0x365432['trunk_name']){_0x106081=_0x365432[_0xf10d('0x110')];}else{return this[_0xf10d('0x37')]['error'](_0x365432,_0xf10d('0x10d'));}var _0x5eee04=this[_0xf10d('0x37')][_0xf10d('0x57')](_0xf10d('0xe0'),[util[_0xf10d('0x29')]('SIP/%s/%s',_0x106081,_0x365432[_0xf10d('0x45')]),_0x365432[_0xf10d('0x67')],_0x365432[_0xf10d('0xe2')],_0x365432['url']]);if(_0x5eee04['result']===-0x1){return _0x5eee04;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xe3'),'DIAL'));};AGIVertices[_0xf10d('0x14')]['finally']=function(_0x46dd97){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x111'),_0x46dd97[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x112'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x113')]=function(_0x6ff11){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x114'),_0x6ff11[_0xf10d('0xb0')]));if(_0x6ff11[_0xf10d('0xaa')]===0x0){return this[_0xf10d('0xa9')](_0x6ff11);}_0x6ff11[_0xf10d('0xaa')]-=0x1;if(!this[_0xf10d('0x89')](_0x6ff11[_0xf10d('0x115')])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x6ff11,_0xf10d('0x116'));}var _0x3c911d=this[_0xf10d('0x1f')][_0xf10d('0x72')](this,_0x6ff11['file_id']);if(!_0x3c911d){return this['channel'][_0xf10d('0x2d')](_0x6ff11,_0xf10d('0x117'));}if(!this[_0xf10d('0x89')](_0x6ff11[_0xf10d('0xd8')])){return this['channel'][_0xf10d('0x2d')](_0xf10d('0xd7'));}var _0x4da57d=this[_0xf10d('0x37')][_0xf10d('0x118')](_0x3c911d,_0x6ff11[_0xf10d('0x119')],_0x6ff11[_0xf10d('0x11a')]);var _0x57198a=_0x4da57d[_0xf10d('0xa7')]?_0x4da57d[_0xf10d('0xa7')][_0xf10d('0x4a')]():'';logger[_0xf10d('0x31')](_0xf10d('0x11b'),JSON[_0xf10d('0x76')](_0x4da57d));if(_0x4da57d[_0xf10d('0xa7')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x6ff11,_0x57198a);return _0x4da57d;}else if(_0x4da57d[_0xf10d('0xa5')]===_0xf10d('0x67')){_0x4da57d[_0xf10d('0xa7')]=_0x57198a[_0xf10d('0x9f')]>=parseInt(_0x6ff11['mindigit'])?'x':'i';}else{_0x4da57d[_0xf10d('0xa7')]=_0x57198a[_0xf10d('0x9f')]>=parseInt(_0x6ff11[_0xf10d('0x11c')])&&_0x57198a[_0xf10d('0x9f')]<=parseInt(_0x6ff11[_0xf10d('0x11a')])?'x':'i';}var _0x4526b2=this[_0xf10d('0x10')][_0xf10d('0x72')](this,_0x6ff11[_0xf10d('0xd8')]);if(!_0x4526b2){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x6ff11,_0xf10d('0xd9'));}this[_0xf10d('0x37')][_0xf10d('0xa2')](_0x4526b2,_0x57198a);if(this[_0xf10d('0x89')](_0x6ff11[_0xf10d('0x11d')])){var _0x387018=parseInt(_0x6ff11['hiddendigitsnum'],0xa);var _0x7d4a83=rs['generate']({'charset':'*','length':_0x387018});var _0x17cea6=_0x57198a[_0xf10d('0x9f')];if(_0x17cea6>0x0){if(_0x17cea6>_0x387018){this[_0xf10d('0x36')]['sync'](this,_0x6ff11,_0x6ff11['hiddendigitspos']===_0xf10d('0x11e')?_0x7d4a83+_0x57198a[_0xf10d('0x11f')](_0x387018):_0x57198a[_0xf10d('0x11f')](0x0,_0x17cea6-_0x387018)+_0x7d4a83);}else{this[_0xf10d('0x36')]['sync'](this,_0x6ff11,rs['generate']({'charset':'*','length':_0x17cea6}));}}else{this[_0xf10d('0x36')]['sync'](this,_0x6ff11,'');}}else{this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x6ff11,_0x57198a);}return _0x4da57d;};AGIVertices[_0xf10d('0x14')][_0xf10d('0xd')]=function(_0x36021f){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x120'),_0x36021f[_0xf10d('0xb0')]));return this['getdigits'](_0x36021f);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x121')]=function(_0x408992){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x122'),_0x408992[_0xf10d('0xb0')]));this[_0xf10d('0x36')]['sync'](this,_0x408992,_0x408992[_0xf10d('0x123')]);return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x124'),_0x408992[_0xf10d('0x123')]));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x125')]=function(_0xea27f2){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x126'),_0xea27f2[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0xea27f2[_0xf10d('0x8c')])||!this[_0xf10d('0x89')](_0xea27f2['aws_secret_access_key'])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x127'));}if(!this['isConfigured'](_0xea27f2[_0xf10d('0x5d')])){return this[_0xf10d('0x37')]['noop'](_0xf10d('0xad'));}this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x128'),_0xea27f2[_0xf10d('0x5d')]));var _0x5c67b0=this['awsPolly']['sync'](this,_0xea27f2);if(_0x5c67b0){this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x5c67b0));var _0xd64832=this[_0xf10d('0x37')][_0xf10d('0x103')](_0x5c67b0);try{fs[_0xf10d('0x104')](_0x5c67b0+_0xf10d('0x105'));}catch(_0x1e378d){logger[_0xf10d('0x2d')](_0x1e378d);}return _0xd64832;}return this['channel'][_0xf10d('0x2d')](_0xea27f2,_0xf10d('0x129'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x12a')]=function(_0x449d37){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x449d37['label']));if(!this[_0xf10d('0x89')](_0x449d37[_0xf10d('0x8c')])||!this[_0xf10d('0x89')](_0x449d37[_0xf10d('0x91')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x127'));}if(!this[_0xf10d('0x89')](_0x449d37[_0xf10d('0x92')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x12b'));}if(!this['isConfigured'](_0x449d37[_0xf10d('0x5d')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xad'));}this['channel'][_0xf10d('0xe7')]=!![];this[_0xf10d('0x36')](_0x449d37);this[_0xf10d('0x40')](_0x449d37[_0xf10d('0x5d')],'in','','');this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x12c'),_0x449d37[_0xf10d('0x5d')]));var _0x289e8c=this['awsLex']['sync'](this,_0x449d37);if(_0x289e8c){for(var _0x439674 in _0x289e8c){if(_0x289e8c[_0xf10d('0x98')](_0x439674)&&_[_0xf10d('0x99')](_0x289e8c[_0x439674])){this[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0x12d'),_0x439674['toUpperCase']()),_0x289e8c[_0x439674]);}}if(_[_0xf10d('0x41')](_0x289e8c[_0xf10d('0x7a')])){return this[_0xf10d('0x37')][_0xf10d('0xac')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xf10d('0x40')](_0x289e8c[_0xf10d('0x7a')],_0xf10d('0xf4'),_0xf10d('0x12e'),'');return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')]('Amazon\x20Lex\x20Result\x20%s',_0x289e8c[_0xf10d('0x7a')]));}}return this[_0xf10d('0x37')]['error'](_0x449d37,_0xf10d('0x12f'));};AGIVertices['prototype'][_0xf10d('0x130')]=function(_0x5ac7f0){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x131'),_0x5ac7f0[_0xf10d('0xb0')],_0x5ac7f0[_0xf10d('0x67')]));if(!this['isConfigured'](_0x5ac7f0[_0xf10d('0x7d')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xe6'));}var _0x4971f4=_0xf10d('0x132');var _0x28b263=util['format'](_0xf10d('0x133'),FILES_PATH,rs['generate'](0x4));var _0x22ec27=util[_0xf10d('0x29')](_0xf10d('0xa1'),_0x28b263,_0x4971f4);var _0x409000=!![];if(_0x5ac7f0[_0xf10d('0x134')]===_0xf10d('0x135')){_0x409000=![];}var _0x182dbd=this[_0xf10d('0x37')][_0xf10d('0x136')](_0x28b263,_0x4971f4,_0x5ac7f0[_0xf10d('0x137')],_0x5ac7f0[_0xf10d('0x67')],undefined,_0x409000);if(_0x182dbd[_0xf10d('0xa7')]!==-0x1){this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x138'),_0x22ec27));var _0x3e1860=this[_0xf10d('0x93')][_0xf10d('0x72')](this,_0x5ac7f0,_0x22ec27);if(_0x3e1860){for(var _0x284822 in _0x3e1860){if(_0x3e1860[_0xf10d('0x98')](_0x284822)){this[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0x139'),_0x284822[_0xf10d('0xe9')]()),_0x3e1860[_0x284822]);}}return this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x13a'),JSON[_0xf10d('0x76')](_0x3e1860)));}}return _0x182dbd;};AGIVertices[_0xf10d('0x14')][_0xf10d('0x13b')]=function(_0x408e46){logger[_0xf10d('0x31')](util['format']('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x408e46[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x408e46[_0xf10d('0x96')])){return this[_0xf10d('0x37')]['noop'](_0xf10d('0x13c'));}if(!this[_0xf10d('0x89')](_0x408e46[_0xf10d('0x13d')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x13e'));}var _0x10cb88=_0xf10d('0x132');var _0x4dcc14=util[_0xf10d('0x29')](_0xf10d('0x133'),FILES_PATH,rs['generate'](0x4));var _0x34f645=util[_0xf10d('0x29')]('%s.%s',_0x4dcc14,_0x10cb88);var _0x3a862c=!![];if(_0x408e46[_0xf10d('0x134')]===_0xf10d('0x135')){_0x3a862c=![];}var _0x51c944=this[_0xf10d('0x37')][_0xf10d('0x136')](_0x4dcc14,_0x10cb88,_0x408e46[_0xf10d('0x137')],_0x408e46[_0xf10d('0x67')],undefined,_0x3a862c);if(_0x51c944[_0xf10d('0xa7')]!==-0x1){this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x13f'),_0x34f645));var _0x12c6ca=this[_0xf10d('0x95')]['sync'](this,_0x408e46,_0x34f645);if(_0x12c6ca){for(var _0x1b105a in _0x12c6ca){if(_0x12c6ca[_0xf10d('0x98')](_0x1b105a)){this['channel'][_0xf10d('0xa2')](util['format'](_0xf10d('0x140'),_0x1b105a[_0xf10d('0xe9')]()),_0x12c6ca[_0x1b105a]);}}return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x141'),JSON[_0xf10d('0x76')](_0x12c6ca)));}}return _0x51c944;};AGIVertices['prototype']['gotoc']=function(_0x59d7cb){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x142'),_0x59d7cb[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0x143')](_0x59d7cb[_0xf10d('0x3d')],_0x59d7cb[_0xf10d('0x144')],_0x59d7cb['priority']);};AGIVertices['prototype']['gotoif']=function(_0x119867){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x145'),_0x119867[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x119867[_0xf10d('0x146')])){return this[_0xf10d('0x37')]['error'](_0x119867,'no\x20condition\x20configured');}try{var _0x94fb6a=eval(_0x119867[_0xf10d('0x146')])?_0xf10d('0x147'):_0xf10d('0x148');this[_0xf10d('0x37')]['noop'](util[_0xf10d('0x29')](_0xf10d('0x149'),_0x119867[_0xf10d('0x146')],_0x94fb6a));return{'code':0xc8,'result':_0x94fb6a};}catch(_0x90f798){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xf10d('0x14')][_0xf10d('0x14a')]=function(_0x377918){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x14b'),_0x377918['label']));if(!this[_0xf10d('0x89')](_0x377918[_0xf10d('0x14c')])){return this['channel']['error'](_0x377918,_0xf10d('0x14d'));}var _0xac06fe=this[_0xf10d('0x24')][_0xf10d('0x72')](this,_0x377918[_0xf10d('0x14c')]);if(!_0xac06fe){return this['channel'][_0xf10d('0x2d')](_0x377918,_0xf10d('0x14e'));}for(var _0x2a2729=0x0;_0x2a2729<_0xac06fe[_0xf10d('0x9f')];_0x2a2729+=0x1){var _0x697921=this['channel'][_0xf10d('0x10')](util[_0xf10d('0x29')](_0xf10d('0x14f'),_0xac06fe[_0x2a2729]));if(_0x697921['result']===-0x1){return _0x697921;}logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x150'),_0xac06fe[_0x2a2729],_0x697921[_0xf10d('0xa5')]));if(_0x697921['extra']===_0xf10d('0x147')){logger['info'](util[_0xf10d('0x29')]('IFTIME\x20%s\x20%s',_0xac06fe[_0x2a2729],_0xf10d('0x147')));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x150'),_0xac06fe[_0x2a2729],_0xf10d('0x147')));return{'code':0xc8,'result':_0xf10d('0x147')};}else{logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x150'),_0xac06fe[_0x2a2729],_0xf10d('0x148')));this[_0xf10d('0x37')]['noop'](util['format']('IFTIME\x20%s\x20%s',_0xac06fe[_0x2a2729],'false'));}}return{'code':0xc8,'result':_0xf10d('0x148')};};AGIVertices['prototype']['hangup']=function(_0x58fda4){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x151'),_0x58fda4['label']));return this['channel'][_0xf10d('0x152')]();};AGIVertices[_0xf10d('0x14')][_0xf10d('0x153')]=function(_0x18f652){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x154'),_0x18f652[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x18f652[_0xf10d('0x7d')])){return this['channel']['noop'](_0xf10d('0xe6'));}var _0x4a755f=_0xf10d('0x132');var _0x204b81=util['format'](_0xf10d('0x133'),FILES_PATH,rs[_0xf10d('0x155')](0x4));var _0x52a0b2=util[_0xf10d('0x29')](_0xf10d('0xa1'),_0x204b81,_0x4a755f);var _0x51c374=!![];if(_0x18f652['beep']===_0xf10d('0x135')){_0x51c374=![];}var _0x42eb71=this[_0xf10d('0x37')]['recordFile'](_0x204b81,_0x4a755f,_0x18f652[_0xf10d('0x137')],_0x18f652['timeout'],undefined,_0x51c374);if(_0x42eb71[_0xf10d('0xa7')]!==-0x1){this['channel']['noop'](util[_0xf10d('0x29')](_0xf10d('0x156'),_0x52a0b2));var _0x505d39=this[_0xf10d('0x87')][_0xf10d('0x72')](this,_0x18f652,_0x52a0b2);if(_0x505d39){for(var _0x1754a4 in _0x505d39){if(_0x505d39[_0xf10d('0x98')](_0x1754a4)){this[_0xf10d('0x37')]['setVariable'](util[_0xf10d('0x29')](_0xf10d('0x157'),_0x1754a4['toUpperCase']()),_0x505d39[_0x1754a4]);}}return this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0x158'),JSON['stringify'](_0x505d39)));}}return _0x42eb71;};AGIVertices[_0xf10d('0x14')]['ispeechtts']=function(_0x2dee23){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x159'),_0x2dee23[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x2dee23[_0xf10d('0x7d')])){return this['channel']['noop'](_0xf10d('0xe6'));}if(!this[_0xf10d('0x89')](_0x2dee23[_0xf10d('0x5d')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xad'));}this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x15a'),_0x2dee23[_0xf10d('0x5d')]));var _0x47855b=this[_0xf10d('0x84')][_0xf10d('0x72')](this,_0x2dee23);if(_0x47855b){this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0x156'),_0x47855b));var _0x1588b0=this[_0xf10d('0x37')][_0xf10d('0x103')](_0x47855b,_0x2dee23['intKey']);try{fs[_0xf10d('0x104')](_0x47855b+_0xf10d('0x105'));}catch(_0x5b5691){logger['error'](_0x5b5691);}return _0x1588b0;}return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2dee23,_0xf10d('0x15b'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x15c')]=function(_0x5c87b3){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x15d'),_0x5c87b3[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x5c87b3[_0xf10d('0x15e')])){return this['channel'][_0xf10d('0x2d')](_0x5c87b3,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf10d('0x29')](_0xf10d('0x15f'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x5c87b3[_0xf10d('0x15e')]));var _0x2e0520=this[_0xf10d('0x52')]['sync'](this,_0x5c87b3[_0xf10d('0x15e')]);if(_0x2e0520){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x160'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x5c87b3['findBy']));this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x160'),this['channel'][_0xf10d('0x3a')],_0x5c87b3[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x161')};}else{logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x162'),this[_0xf10d('0x37')]['callerid'],_0x5c87b3[_0xf10d('0x15e')]));this[_0xf10d('0x37')]['noop'](util[_0xf10d('0x29')](_0xf10d('0x162'),this['channel'][_0xf10d('0x3a')],_0x5c87b3[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x163')};}};AGIVertices[_0xf10d('0x14')][_0xf10d('0x164')]=function(_0x52fd84){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x165'),_0x52fd84[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x52fd84[_0xf10d('0x15e')])){return this['channel'][_0xf10d('0x2d')](_0x52fd84,_0xf10d('0x166'));}logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x15f'),this['channel'][_0xf10d('0x3a')],_0x52fd84['findBy']));var _0x459533=this[_0xf10d('0x51')][_0xf10d('0x72')](this,_0x52fd84[_0xf10d('0x15e')]);if(_0x459533){logger['info'](util['format'](_0xf10d('0x160'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x52fd84[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x160'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x52fd84[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x161')};}else{logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x162'),this['channel'][_0xf10d('0x3a')],_0x52fd84[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x162'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x52fd84[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x163')};}};AGIVertices['prototype']['math']=function(_0x338d93){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x167'),_0x338d93[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x338d93[_0xf10d('0x168')])){return this['channel'][_0xf10d('0x2d')](_0x338d93,_0xf10d('0x169'));}this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x16a'),_0x338d93[_0xf10d('0x168')]));var _0x1f24cc=eval(_0x338d93[_0xf10d('0x168')]);if(!this[_0xf10d('0x89')](_0x338d93['variable_id'])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xd7'));}var _0x4b61af=this[_0xf10d('0x10')][_0xf10d('0x72')](this,_0x338d93[_0xf10d('0xd8')]);if(!_0x4b61af){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x338d93,_0xf10d('0xd9'));}if(_[_0xf10d('0x9e')](_0x1f24cc)){var _0x207439=this;_0x1f24cc[_0xf10d('0xda')](function(_0x123e89,_0x1900e2){_0x207439[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0x16b'),_0x4b61af,_0x1900e2),_0x123e89);});return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x16c'),_0x4b61af));}else{return this['channel'][_0xf10d('0xa2')](_0x4b61af,_0x1f24cc);}};AGIVertices[_0xf10d('0x14')]['menu']=function(_0x2a0b84){logger['info'](util['format'](_0xf10d('0x16d'),_0x2a0b84[_0xf10d('0xb0')]));if(_0x2a0b84[_0xf10d('0xaa')]===0x0){return this['maxRetry'](_0x2a0b84);}_0x2a0b84[_0xf10d('0xaa')]-=0x1;if(!this[_0xf10d('0x89')](_0x2a0b84[_0xf10d('0x115')])){return this[_0xf10d('0x37')]['error'](_0x2a0b84,'no\x20file\x20audio\x20selected');}var _0x30eeb1=this[_0xf10d('0x1f')]['sync'](this,_0x2a0b84['file_id']);if(!_0x30eeb1){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2a0b84,_0xf10d('0x117'));}var _0x473dff=this[_0xf10d('0x37')]['getData'](_0x30eeb1,_0x2a0b84['response'],_0x2a0b84[_0xf10d('0x16e')]);var _0x57e13a=_0x473dff[_0xf10d('0xa7')];if(_0x473dff[_0xf10d('0xa7')]===-0x1){this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x2a0b84,'-1');return _0x473dff;}else if(_0x473dff[_0xf10d('0xa5')]===_0xf10d('0x67')){_0x473dff['result']=_0x473dff[_0xf10d('0xa7')][_0xf10d('0x9f')]>0x0?_0x473dff[_0xf10d('0xa7')]:'t';}else if(_['isEmpty'](_0x473dff['result'])){_0x473dff['result']='#';_0x57e13a='#';}if(!this[_0xf10d('0x89')](_0x2a0b84[_0xf10d('0xd8')])){this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x18e8af=this[_0xf10d('0x10')]['sync'](this,_0x2a0b84[_0xf10d('0xd8')]);if(!_0x18e8af){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2a0b84,_0xf10d('0xd9'));}this[_0xf10d('0x37')][_0xf10d('0xa2')](_0x18e8af,_0x57e13a);}this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x2a0b84,_0x57e13a);return _0x473dff;};AGIVertices['prototype'][_0xf10d('0xac')]=function(_0x53fdbd){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x16f'),_0x53fdbd[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0xac')](_0x53fdbd[_0xf10d('0x170')]||_0x53fdbd[_0xf10d('0xb0')]);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x171')]=function(_0x256fea){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x256fea[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x256fea[_0xf10d('0x15e')])){return this[_0xf10d('0x37')]['error'](_0x256fea,_0xf10d('0x166'));}logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xf10d('0x3a')],_0x256fea[_0xf10d('0x15e')]));var _0x2fb8a5=this[_0xf10d('0x4c')][_0xf10d('0x72')](this,_0x256fea['pause_id']);var _0x47f53c=this[_0xf10d('0x4e')]['sync'](this,_0x256fea[_0xf10d('0x15e')],_0x2fb8a5);if(_0x47f53c){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf10d('0x37')]['callerid'],_0x256fea[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x256fea[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x161')};}else{logger[_0xf10d('0x31')](util['format'](_0xf10d('0x162'),this['channel'][_0xf10d('0x3a')],_0x256fea[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util['format'](_0xf10d('0x160'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x256fea[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x163')};}};AGIVertices[_0xf10d('0x14')]['playback']=function(_0x3024dd){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x172'),_0x3024dd[_0xf10d('0xb0')]));if(!this['isConfigured'](_0x3024dd[_0xf10d('0x115')])){return this[_0xf10d('0x37')]['error'](_0x3024dd,_0xf10d('0x116'));}var _0x2be43a=this[_0xf10d('0x1f')][_0xf10d('0x72')](this,_0x3024dd[_0xf10d('0x115')]);if(!_0x2be43a){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x3024dd,'no\x20file\x20audio\x20found');}var _0x2551bd=this['channel']['exec'](_0xf10d('0x173'),[_0x2be43a,_0x3024dd[_0xf10d('0xe2')]]);if(_0x2551bd['result']===-0x1){return _0x2551bd;}return this['channel']['noop'](util[_0xf10d('0x29')]('Executed\x20command\x20%s\x20%s',_0xf10d('0x173'),_0x2be43a));};AGIVertices[_0xf10d('0x14')]['queue']=function(_0x2f0033){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2f0033['label']));if(!this[_0xf10d('0x89')](_0x2f0033['queue_id'])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2f0033,'no\x20queue\x20selected');}var _0x4285c6='';var _0x25b723=parseInt(_0x2f0033['queue_id'],0xa);if(isNaN(_0x25b723)){_0x4285c6=_0x2f0033[_0xf10d('0x174')];}else{_0x4285c6=this[_0xf10d('0x15')][_0xf10d('0x72')](this,_0x2f0033[_0xf10d('0x174')]);if(!_0x4285c6){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2f0033,_0xf10d('0x175'));}}var _0x2f6b92='';if(this['isConfigured'](_0x2f0033[_0xf10d('0x115')])){var _0x5cdee0=this[_0xf10d('0x1f')]['sync'](this,_0x2f0033[_0xf10d('0x115')]);if(_0x5cdee0){_0x2f6b92=_0x5cdee0;}}this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x2f0033,_0x4285c6);if(_0x2f0033[_0xf10d('0xe2')][_0xf10d('0x176')]('x')<0x0){_0x2f0033[_0xf10d('0xe2')]+='x';}if(_0x2f0033[_0xf10d('0xe2')][_0xf10d('0x176')]('X')<0x0){_0x2f0033[_0xf10d('0xe2')]+='X';}this[_0xf10d('0x37')][_0xf10d('0xa2')](_0xf10d('0x177'),_0x4285c6?_0x4285c6['toLowerCase']():'');var _0x508b5f=this['channel']['exec'](_0xf10d('0x178'),[_0x4285c6,_0x2f0033[_0xf10d('0xe2')],_0x2f0033[_0xf10d('0x75')],_0x2f6b92,_0x2f0033[_0xf10d('0x67')],_0x2f0033[_0xf10d('0x7')],_0x2f0033[_0xf10d('0x179')],_0x2f0033[_0xf10d('0x17a')],'',_0x2f0033[_0xf10d('0x17b')]]);if(_0x508b5f[_0xf10d('0xa7')]===-0x1){return _0x508b5f;}return this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0xc4'),_0xf10d('0x178'),_0x4285c6));};AGIVertices['prototype'][_0xf10d('0x17c')]=function(_0xfb1f9d){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x17d'),_0xfb1f9d[_0xf10d('0xb0')]));var _0xcc9303=_0xfb1f9d['recordingFormat']||_0xf10d('0x132');var _0x1d9129=util[_0xf10d('0x29')](_0xf10d('0x17e'),this['channel'][_0xf10d('0x38')],rs['generate'](0x5));var _0x48c797=util[_0xf10d('0x29')](_0xf10d('0x17f'),FILES_PATH,_0x1d9129,_0xcc9303);var _0x47d398=util[_0xf10d('0x29')](_0xf10d('0x133'),FILES_PATH,_0x1d9129);this[_0xf10d('0x3b')][_0xf10d('0x72')](this,_0xfb1f9d,_0x1d9129,_0x48c797);this[_0xf10d('0x37')]['setVariable'](_0xf10d('0x180'),_0x1d9129);logger[_0xf10d('0x31')](_0xf10d('0x181'),_0x47d398,_0xcc9303,_0xfb1f9d[_0xf10d('0x182')],_0xfb1f9d[_0xf10d('0x67')]);return this['channel'][_0xf10d('0x136')](_0x47d398,_0xcc9303,_0xfb1f9d[_0xf10d('0x182')],_0xfb1f9d['timeout'],undefined,!![]);};AGIVertices[_0xf10d('0x14')]['restapi']=function(_0x59d5d7){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x183'),_0x59d5d7[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x59d5d7['url'])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x184'));}var _0x363188=this[_0xf10d('0x65')][_0xf10d('0x72')](this,_0x59d5d7);logger['info'](util['format']('Response:',util[_0xf10d('0x185')](_0x363188,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x59d5d7['variable_id'])){return this['channel']['noop'](_0xf10d('0x186'));}var _0x446980=this[_0xf10d('0x10')][_0xf10d('0x72')](this,_0x59d5d7[_0xf10d('0xd8')]);if(!_0x446980){return this['channel'][_0xf10d('0x2d')](_0x59d5d7,_0xf10d('0xd9'));}this[_0xf10d('0x37')][_0xf10d('0xa2')](util[_0xf10d('0x29')](_0xf10d('0x187'),_0x446980),_0x363188['statusCode']?_0x363188['statusCode']:_0xf10d('0x188'));this[_0xf10d('0x37')]['setVariable'](util['format'](_0xf10d('0x189'),_0x446980),_0x363188[_0xf10d('0x78')]?_0x363188[_0xf10d('0x78')]:'OK');if(_0x363188[_0xf10d('0x6c')]){try{this[_0xf10d('0xa0')](_0x363188[_0xf10d('0x6c')],_0x446980);}catch(_0x2c3b20){logger[_0xf10d('0x2d')](util[_0xf10d('0x29')](_0xf10d('0x18a'),_0x446980));}}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xdc'),_0x446980));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x18b')]=function(_0x551e77){logger['info'](util[_0xf10d('0x29')](_0xf10d('0x18c'),_0x551e77[_0xf10d('0xb0')]));return this['channel']['sayDigits'](_0x551e77[_0xf10d('0x18d')][_0xf10d('0x59')](/\s+/g,''),_0x551e77[_0xf10d('0x182')]);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x18e')]=function(_0x395009){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x395009['label']));return this['channel'][_0xf10d('0x18f')](_0x395009[_0xf10d('0x68')]['replace'](/\s+/g,''),_0x395009[_0xf10d('0x182')]);};AGIVertices[_0xf10d('0x14')]['sayphonetic']=function(_0x2f57ef){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x190'),_0x2f57ef[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0x191')](_0x2f57ef['text'],_0x2f57ef[_0xf10d('0x182')]);};AGIVertices[_0xf10d('0x14')]['sendMail']=function(_0x2a81d6){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x192'),_0x2a81d6[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x2a81d6[_0xf10d('0x193')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x194'));}var _0x59231c=this[_0xf10d('0x22')]['sync'](this,_0x2a81d6['account_id']);if(!_0x59231c||!_0x59231c['Smtp']){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2a81d6,_0xf10d('0x195'));}var _0x1e36bf={'from':util[_0xf10d('0x29')](_0xf10d('0x196'),_0x59231c[_0xf10d('0x13')],_0x59231c[_0xf10d('0x197')]||_0x59231c[_0xf10d('0x198')][_0xf10d('0x199')]),'to':_0x2a81d6['to']||'','cc':_0x2a81d6['cc']||'','bcc':_0x2a81d6[_0xf10d('0x19a')]||'','subject':_0x2a81d6[_0xf10d('0x19b')],'html':_0x2a81d6[_0xf10d('0x5d')],'text':_0x2a81d6[_0xf10d('0x5d')]};var _0xd6add6={'tls':{'rejectUnauthorized':![]}};if(_0x59231c[_0xf10d('0x198')]['service']){_0xd6add6[_0xf10d('0x19c')]=_0x59231c[_0xf10d('0x198')]['service'];}else{_0xd6add6[_0xf10d('0x19d')]=_0x59231c[_0xf10d('0x198')][_0xf10d('0x19d')];_0xd6add6[_0xf10d('0x19e')]=_0x59231c[_0xf10d('0x198')][_0xf10d('0x19e')];_0xd6add6[_0xf10d('0x19f')]=_0x59231c[_0xf10d('0x198')][_0xf10d('0x19f')];}if(_0x59231c[_0xf10d('0x198')][_0xf10d('0x1a0')]){_0xd6add6[_0xf10d('0x1a1')]={'user':_0x59231c['Smtp']['user'],'pass':_0x59231c[_0xf10d('0x198')][_0xf10d('0x1a2')]};}if(this['isConfigured'](_0x2a81d6[_0xf10d('0x1a3')])){}logger[_0xf10d('0xde')](_0xf10d('0x1a4'),JSON[_0xf10d('0x76')](_0x1e36bf));this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x2a81d6,_0x2a81d6[_0xf10d('0x193')]);this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0x1a5'),_0x59231c['name']));this[_0xf10d('0x23')][_0xf10d('0x72')](this,_0xd6add6,_0x1e36bf);return this['channel'][_0xf10d('0xac')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['sendFax']=function(_0x524821){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1a6'),_0x524821[_0xf10d('0xb0')]));return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x1a7'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1a8')]=function(_0x3283a7){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1a9'),_0x3283a7[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x3283a7[_0xf10d('0x1aa')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x1ab'));}var _0x4cbb6d=this[_0xf10d('0x1ac')][_0xf10d('0x72')](this,_0x3283a7[_0xf10d('0x1aa')]);if(!_0x4cbb6d){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x3283a7,_0xf10d('0x1ad'));}var _0x22095b={'body':_0x3283a7[_0xf10d('0x1ae')],'phone':_0x3283a7['to']||'','SmsAccountId':_0x4cbb6d['id']};logger['debug'](_0xf10d('0x1af'),JSON['stringify'](_0x22095b));this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x3283a7,_0x3283a7[_0xf10d('0x1aa')]);this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x1b0'),_0x4cbb6d[_0xf10d('0x13')]));this[_0xf10d('0x35')]['sync'](this,_0x22095b);return this[_0xf10d('0x37')]['noop'](_0xf10d('0x1b1'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1b2')]=function(_0x2878b){logger['info'](util[_0xf10d('0x29')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x2878b[_0xf10d('0xb0')]));if(!this[_0xf10d('0x89')](_0x2878b[_0xf10d('0xd8')])){return this[_0xf10d('0x37')]['error'](_0x2878b,_0xf10d('0x1b3'));}var _0x1e00f7=this['getVariable'][_0xf10d('0x72')](this,_0x2878b[_0xf10d('0xd8')]);if(!_0x1e00f7){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2878b,_0xf10d('0xd9'));}return this[_0xf10d('0x37')][_0xf10d('0xa2')](_0x1e00f7,_0x2878b['variable_value']);};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1b4')]=function(_0x59e635){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1b5'),_0x59e635[_0xf10d('0xb0')]));this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x1b6'));if(_0x59e635[_0xf10d('0xbb')]===_0xf10d('0x1b7')){this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0x1b8'));return this[_0xf10d('0x37')][_0xf10d('0xbb')]();}return this[_0xf10d('0x37')][_0xf10d('0xac')]('Skipped\x20Answer');};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1b9')]=function(_0x29693f){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1ba'),_0x29693f['label']));if(!this[_0xf10d('0x89')](_0x29693f['project_id'])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x29693f,_0xf10d('0x1bb'));}var _0x1af77d=this[_0xf10d('0x1bc')][_0xf10d('0x72')](this,_0x29693f[_0xf10d('0x1bd')]);if(!this['isConfigured'](_0x1af77d)){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x29693f,util[_0xf10d('0x29')](_0xf10d('0x1be'),_0x29693f[_0xf10d('0x1bd')]));}if(_0x1af77d===this[_0xf10d('0x37')][_0xf10d('0x3f')]){return this['channel'][_0xf10d('0x2d')](_0x29693f,_0xf10d('0x1bf'));}this[_0xf10d('0x36')]['sync'](this,_0x29693f,_0x1af77d);var _0x411814=this['channel']['exec'](_0xf10d('0x1c0'),util['format'](_0xf10d('0x1c1'),config['agi'][_0xf10d('0x19d')]||'127.0.0.1',_0x1af77d,this['channel'][_0xf10d('0x3f')]));if(_0x411814[_0xf10d('0xa7')]===-0x1){return _0x411814;}return this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xc4'),_0xf10d('0x1c0'),_0x1af77d));};AGIVertices['prototype'][_0xf10d('0x1c2')]=function(_0x5dc9de){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1c3'),_0x5dc9de[_0xf10d('0xb0')]));var _0x10072d=this[_0xf10d('0x56')]['sync'](this,_0x5dc9de[_0xf10d('0xb9')]);this[_0xf10d('0x36')][_0xf10d('0x72')](this,_0x5dc9de,_0x5dc9de[_0xf10d('0xb9')]);if(this['isConfigured'](_0x5dc9de['variable_id'])){var _0x1165c3=this[_0xf10d('0x10')][_0xf10d('0x72')](this,_0x5dc9de[_0xf10d('0xd8')]);if(_0x1165c3){this['channel'][_0xf10d('0xa2')](_0x1165c3,_0x10072d);return this[_0xf10d('0x37')]['noop'](util['format'](_0xf10d('0x1c4'),_0x5dc9de[_0xf10d('0xb9')],_0x1165c3));}}return this['channel']['noop'](util[_0xf10d('0x29')](_0xf10d('0x1c5'),_0x5dc9de[_0xf10d('0xb9')]));};AGIVertices['prototype'][_0xf10d('0x1c6')]=function(_0x5075c8){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1c7'),_0x5075c8[_0xf10d('0xb0')]));_0x5075c8['text']=_0x5075c8[_0xf10d('0x5d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf10d('0x89')](_0x5075c8[_0xf10d('0x5b')])){return this['channel'][_0xf10d('0xac')](_0xf10d('0x1c8'));}if(!this[_0xf10d('0x89')](_0x5075c8['text'])){return this['channel'][_0xf10d('0xac')](_0xf10d('0xad'));}this['channel'][_0xf10d('0xac')](util['format'](_0xf10d('0x1c9'),_0x5075c8[_0xf10d('0x5d')]));var _0x5cd5b6=this[_0xf10d('0x5a')]['sync'](this,_0x5075c8);if(_0x5cd5b6){this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x1ca'),_0x5cd5b6));var _0x55a8e3=this['channel'][_0xf10d('0x103')](_0x5cd5b6);try{fs[_0xf10d('0x104')](_0x5cd5b6+_0xf10d('0x105'));}catch(_0x16808f){logger[_0xf10d('0x2d')](_0x16808f);}return _0x55a8e3;}return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x5075c8,_0xf10d('0x1cb'));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1cc')]=function(_0x53f701){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1cd'),_0x53f701[_0xf10d('0xb0')]));_0x53f701[_0xf10d('0x5d')]=_0x53f701['text'][_0xf10d('0x59')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x53f701[_0xf10d('0x5d')])){return this[_0xf10d('0x37')][_0xf10d('0xac')](_0xf10d('0xad'));}this['channel']['noop'](util[_0xf10d('0x29')](_0xf10d('0x1ce'),_0x53f701[_0xf10d('0x5d')]));var _0x1b7db7=this[_0xf10d('0x63')][_0xf10d('0x72')](this,_0x53f701);if(_0x1b7db7){this[_0xf10d('0x37')]['noop'](util['format'](_0xf10d('0x1cf'),_0x1b7db7));var _0x151e22=this[_0xf10d('0x37')]['streamFile'](_0x1b7db7);try{fs[_0xf10d('0x104')](_0x1b7db7+_0xf10d('0x105'));}catch(_0x3d2a77){logger[_0xf10d('0x2d')](_0x3d2a77);}return _0x151e22;}return this['channel']['error'](_0x53f701,_0xf10d('0x1d0'));};AGIVertices['prototype'][_0xf10d('0x1d1')]=function(_0x2edb15){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1d2'),_0x2edb15[_0xf10d('0xb0')]));if(!this['isConfigured'](_0x2edb15['findBy'])){return this[_0xf10d('0x37')][_0xf10d('0x2d')](_0x2edb15,'no\x20find\x20by\x20configured');}logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x15f'),this['channel'][_0xf10d('0x3a')],_0x2edb15['findBy']));var _0x4f5c60=this[_0xf10d('0x50')][_0xf10d('0x72')](this,_0x2edb15[_0xf10d('0x15e')]);if(_0x4f5c60){logger[_0xf10d('0x31')](util['format'](_0xf10d('0x160'),this[_0xf10d('0x37')]['callerid'],_0x2edb15[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0x160'),this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x2edb15[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x161')};}else{logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x2edb15[_0xf10d('0x15e')]));this[_0xf10d('0x37')][_0xf10d('0xac')](util[_0xf10d('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xf10d('0x37')][_0xf10d('0x3a')],_0x2edb15[_0xf10d('0x15e')]));return{'code':0xc8,'result':_0xf10d('0x163')};}};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1d3')]=function(_0x33328f){logger[_0xf10d('0x31')](util[_0xf10d('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x33328f[_0xf10d('0xb0')]));var _0x1ebe19=this[_0xf10d('0x37')]['exec'](_0xf10d('0x1d4'),[_0x33328f[_0xf10d('0x1d5')],_0x33328f[_0xf10d('0x7b')]]);if(_0x1ebe19[_0xf10d('0xa7')]===-0x1){return _0x1ebe19;}return this['channel'][_0xf10d('0xac')](util[_0xf10d('0x29')](_0xf10d('0xc4'),_0xf10d('0x1d4'),_0x33328f['mailbox']));};AGIVertices[_0xf10d('0x14')][_0xf10d('0x1d6')]=function(_0x13ae01){logger[_0xf10d('0x31')](util[_0xf10d('0x29')](_0xf10d('0x1d7'),_0x13ae01[_0xf10d('0xb0')]));if(!this['isConfigured'](_0x13ae01[_0xf10d('0xd8')])){return this['channel'][_0xf10d('0x2d')](_0x13ae01,'no\x20variable\x20selected');}var _0x402e2a=this['getVariable'][_0xf10d('0x72')](this,_0x13ae01[_0xf10d('0xd8')]);if(!_0x402e2a){return this[_0xf10d('0x37')]['error'](_0x13ae01,_0xf10d('0xd9'));}var _0x31b91c=this[_0xf10d('0x37')]['getVariable'](_0x402e2a);return{'code':0xc8,'result':_0x31b91c['extra']?_0x31b91c[_0xf10d('0xa5')]:'-'};};String[_0xf10d('0x14')][_0xf10d('0xa4')]=function(_0x196b18,_0x48bc5e){return this[_0xf10d('0xa3')](_0x196b18)[_0xf10d('0x1d8')](_0x48bc5e);};module['exports']=AGIVertices;
\ No newline at end of file
index f6ed211..d219a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a9e=['[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','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','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','startAcw','interface','queue','mandatoryDisposition','name','Action','QueuePause','then','getAgent','info'];(function(_0x41c88c,_0x381f8d){var _0x2c97ea=function(_0x35fd44){while(--_0x35fd44){_0x41c88c['push'](_0x41c88c['shift']());}};_0x2c97ea(++_0x381f8d);}(_0x5a9e,0xd7));var _0xe5a9=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5a9e[_0x17928f];return _0x500b63;};'use strict';var util=require(_0xe5a9('0x0'));var _=require('lodash');var moment=require(_0xe5a9('0x1'));var ami=require('../ami');var logger=require(_0xe5a9('0x2'))(_0xe5a9('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xe5a9('0x4'));function Acw(_0x129387){this[_0xe5a9('0x5')]=_0x129387[_0xe5a9('0x5')];this[_0xe5a9('0x6')]=_0x129387[_0xe5a9('0x6')];this[_0xe5a9('0x7')]=_0x129387[_0xe5a9('0x7')];this[_0xe5a9('0x8')]={};ami['on'](_0xe5a9('0x9'),this[_0xe5a9('0xa')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0xc'),this[_0xe5a9('0xd')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0xe'),this['syncHangup']['bind'](this));ami['on'](_0xe5a9('0xf'),this[_0xe5a9('0x10')][_0xe5a9('0xb')](this));ami['on'](_0xe5a9('0x11'),this[_0xe5a9('0x12')]['bind'](this));ami['on'](_0xe5a9('0x13'),this[_0xe5a9('0x14')][_0xe5a9('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xe5a9('0xb')](this));}function getDiff(_0x3c9522){var _0x4eca73=moment()['milliseconds'](0x0);var _0x2e6425=moment(_0x3c9522)[_0xe5a9('0x15')](0x0);return _0x4eca73[_0xe5a9('0x16')](_0x2e6425,_0xe5a9('0x17'));}Acw['prototype'][_0xe5a9('0x18')]=function(_0x47de23){try{var _0x44381f=this;var _0x5debc8=this['channels'][_0x47de23][_0xe5a9('0x19')];var _0x542dca=this[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x1a')];var _0x1d80d9=this[_0xe5a9('0x5')][_0x542dca];var _0x283e51=![];var _0x3eaab9='ACW';if(_0x1d80d9[_0xe5a9('0x1b')]){if(_0x1d80d9['mandatoryDispositionPause'][_0xe5a9('0x1c')]){_0x283e51=!![];_0x3eaab9=_0x1d80d9['mandatoryDispositionPause'][_0xe5a9('0x1c')];}}ami[_0xe5a9('0x1d')]({'action':_0xe5a9('0x1e'),'interface':_0x5debc8,'paused':!![],'reason':_0x3eaab9})[_0xe5a9('0x1f')](function(_0x510602){if(_0x44381f[_0xe5a9('0x6')][_0x5debc8]){return RpcUser[_0xe5a9('0x20')](_0x44381f[_0xe5a9('0x6')][_0x5debc8]['id'])[_0xe5a9('0x1f')](function(_0xa77af6){if(_0xa77af6&&!_0xa77af6['voicePause']){logger[_0xe5a9('0x21')](_0xe5a9('0x22'),_0x47de23,_0x5debc8,_0x542dca);var _0x552d2e=_0x44381f[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x23')]&&_0x44381f[_0xe5a9('0x8')][_0x47de23][_0xe5a9('0x24')]?_0x44381f[_0xe5a9('0x8')][_0x47de23]['destlinkedid']:_0x47de23;return RpcUser[_0xe5a9('0x25')](_0x44381f[_0xe5a9('0x6')][_0x5debc8],_0x3eaab9,_0x552d2e)['then'](function(_0x3e1869){if(!_0x283e51){_0x44381f[_0xe5a9('0x7')][_0x5debc8]={};logger[_0xe5a9('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47de23,_0x44381f[_0xe5a9('0x5')][_0x542dca][_0xe5a9('0x26')],_0x5debc8,_0x542dca);_0x44381f[_0xe5a9('0x7')][_0x5debc8]['timer']=setTimeout(_0x44381f[_0xe5a9('0x27')][_0xe5a9('0xb')](_0x44381f,_0x5debc8),_0x44381f['voiceQueues'][_0x542dca][_0xe5a9('0x26')]*0x3e8);_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x28')]=moment()[_0xe5a9('0x29')](_0xe5a9('0x2a'));_0x44381f[_0xe5a9('0x7')][_0x5debc8]['uniqueid']=_0x47de23;_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x1a')]=_0x542dca;_0x44381f[_0xe5a9('0x7')][_0x5debc8]['updateAcw']=function(){var _0x4a73fb=getDiff(_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x28')]);clearTimeout(_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2b')]);_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2b')]=![];RpcVoiceAgentReport[_0xe5a9('0x2c')]({'acwtime':_0x4a73fb},_0x44381f[_0xe5a9('0x7')][_0x5debc8][_0xe5a9('0x2d')],_0x5debc8)[_0xe5a9('0x1f')](function(_0x1457ae){logger['info'](_0xe5a9('0x2e'),_0x47de23,_0x4a73fb,_0x1457ae);})['catch'](function(_0x1c72e5){logger[_0xe5a9('0x2f')](_0xe5a9('0x30'),_0x47de23,_0x1c72e5);});delete _0x44381f['timers'][_0x5debc8];};}});}else{logger[_0xe5a9('0x21')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x47de23,_0x5debc8,_0x542dca);}});}})[_0xe5a9('0x31')](function(_0x525898){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47de23,_0x44381f[_0xe5a9('0x5')][_0x542dca][_0xe5a9('0x26')],_0x5debc8,_0x542dca);})[_0xe5a9('0x32')](function(){delete _0x44381f[_0xe5a9('0x8')][_0x47de23];});}catch(_0x4dbbaf){logger[_0xe5a9('0x2f')](_0xe5a9('0x33'),_0x4dbbaf[_0xe5a9('0x34')]);}};Acw['prototype'][_0xe5a9('0x27')]=function(_0x3dacfe){try{var _0x7e4146=this;if(_0x7e4146['timers'][_0x3dacfe]){_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x2b')]=![];var _0x39c235=_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x2d')];var _0x429edc=_0x7e4146[_0xe5a9('0x7')][_0x3dacfe][_0xe5a9('0x1a')];var _0x36917a=_0x7e4146[_0xe5a9('0x5')][_0x429edc]['acwTimeout'];logger[_0xe5a9('0x21')](_0xe5a9('0x35'),_0x39c235,_0x3dacfe);RpcUser[_0xe5a9('0x36')](this[_0xe5a9('0x6')][_0x3dacfe]);RpcVoiceAgentReport[_0xe5a9('0x2c')]({'acwtime':_0x36917a,'agentacw':!![]},_0x39c235,_0x3dacfe)['then'](function(_0x446dba){logger['info'](_0xe5a9('0x2e'),_0x39c235,_0x36917a,_0x446dba);})[_0xe5a9('0x31')](function(_0x380fc1){logger['error'](_0xe5a9('0x30'),_0x39c235,_0x380fc1);});}else{logger[_0xe5a9('0x2f')](_0xe5a9('0x37'),_0x3dacfe);if(_0x7e4146[_0xe5a9('0x7')]){logger[_0xe5a9('0x21')](_0xe5a9('0x38'),JSON[_0xe5a9('0x39')](_0x7e4146[_0xe5a9('0x7')]));}}}catch(_0x5a6817){logger['error'](_0xe5a9('0x3a'),_0x5a6817['message']);}};Acw[_0xe5a9('0x3b')][_0xe5a9('0xa')]=function(_0x25b3b4){try{if(this['voiceQueues'][_0x25b3b4[_0xe5a9('0x1a')]]&&(this[_0xe5a9('0x5')][_0x25b3b4[_0xe5a9('0x1a')]][_0xe5a9('0x3')]||this[_0xe5a9('0x5')][_0x25b3b4[_0xe5a9('0x1a')]]['mandatoryDisposition'])){if(this[_0xe5a9('0x6')][_0x25b3b4[_0xe5a9('0x19')]]){this[_0xe5a9('0x8')][_0x25b3b4[_0xe5a9('0x2d')]]={'queue':_0x25b3b4[_0xe5a9('0x1a')],'interface':_0x25b3b4[_0xe5a9('0x19')],'destlinkedid':_0x25b3b4[_0xe5a9('0x24')]};}}}catch(_0x1d814f){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1d814f[_0xe5a9('0x34')]);}};Acw[_0xe5a9('0x3b')]['syncAgentConnectPreview']=function(_0x24a7e8){try{if(this[_0xe5a9('0x5')][_0x24a7e8[_0xe5a9('0x1a')]]&&(this['voiceQueues'][_0x24a7e8[_0xe5a9('0x1a')]]['acw']||this[_0xe5a9('0x5')][_0x24a7e8[_0xe5a9('0x1a')]]['mandatoryDisposition'])){if(this[_0xe5a9('0x6')][_0x24a7e8[_0xe5a9('0x19')]]){this[_0xe5a9('0x8')][_0x24a7e8['uniqueid']]={'queue':_0x24a7e8['queue'],'interface':_0x24a7e8[_0xe5a9('0x19')]};}}}catch(_0x9195ed){logger['error'](_0xe5a9('0x3c'),_0x9195ed['message']);}};Acw['prototype'][_0xe5a9('0xd')]=function(_0x4655bd){try{if(this[_0xe5a9('0x8')][_0x4655bd['uniqueid']]&&_[_0xe5a9('0x3d')](this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x2d')]][_0xe5a9('0x23')])){logger[_0xe5a9('0x21')](_0xe5a9('0x3e'),_0x4655bd[_0xe5a9('0x2d')]);this['startAcw'](_0x4655bd['uniqueid']);}else if(this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x3f')]]&&_['isUndefined'](this[_0xe5a9('0x8')][_0x4655bd[_0xe5a9('0x3f')]][_0xe5a9('0x23')])){logger[_0xe5a9('0x21')](_0xe5a9('0x40'),_0x4655bd[_0xe5a9('0x3f')]);this[_0xe5a9('0x18')](_0x4655bd[_0xe5a9('0x3f')]);}}catch(_0x499671){logger[_0xe5a9('0x2f')](_0xe5a9('0x41'),_0x499671[_0xe5a9('0x34')]);}};Acw['prototype']['syncHangup']=function(_0x31e83a){try{if(this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x2d')]]&&this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x2d')]]['attended']){logger[_0xe5a9('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x31e83a[_0xe5a9('0x2d')]);this['startAcw'](_0x31e83a[_0xe5a9('0x2d')]);}else if(this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x3f')]]&&this[_0xe5a9('0x8')][_0x31e83a[_0xe5a9('0x3f')]][_0xe5a9('0x23')]){logger['info'](_0xe5a9('0x42'),_0x31e83a['linkedid']);this[_0xe5a9('0x18')](_0x31e83a[_0xe5a9('0x3f')]);}}catch(_0x154393){logger[_0xe5a9('0x2f')]('[ACW][syncHangup]\x20%s',_0x154393[_0xe5a9('0x34')]);}};Acw['prototype'][_0xe5a9('0x12')]=function(_0x5d5eb1){try{if(!_[_0xe5a9('0x43')](this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x44')]])){this['startAcw'](_0x5d5eb1['transfereeuniqueid']);if(this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]]){this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]][_0xe5a9('0x23')]=!![];this[_0xe5a9('0x8')][_0x5d5eb1['transfertargetuniqueid']]=this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x45')]];delete this['channels'][_0x5d5eb1[_0xe5a9('0x45')]];}}else if(!_[_0xe5a9('0x43')](this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x46')]])){this[_0xe5a9('0x18')](_0x5d5eb1[_0xe5a9('0x46')]);if(this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x47')]]){this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x47')]][_0xe5a9('0x23')]=!![];this[_0xe5a9('0x8')][_0x5d5eb1[_0xe5a9('0x44')]]=this['channels'][_0x5d5eb1[_0xe5a9('0x47')]];delete this[_0xe5a9('0x8')][_0x5d5eb1['origtransfereruniqueid']];}}}catch(_0x3b481a){logger[_0xe5a9('0x2f')](_0xe5a9('0x48'),_0x3b481a['message']);}};Acw[_0xe5a9('0x3b')]['syncBlindTransfer']=function(_0xdb74c1){try{if(this[_0xe5a9('0x8')][_0xdb74c1[_0xe5a9('0x49')]]){logger[_0xe5a9('0x21')](_0xe5a9('0x4a'),JSON['stringify'](_0xdb74c1[_0xe5a9('0x49')]));this['startAcw'](_0xdb74c1[_0xe5a9('0x49')]);}else if(this[_0xe5a9('0x8')][_0xdb74c1['transfererlinkedid']]){logger[_0xe5a9('0x21')](_0xe5a9('0x4b'),JSON['stringify'](_0xdb74c1[_0xe5a9('0x4c')]));this[_0xe5a9('0x18')](_0xdb74c1[_0xe5a9('0x4c')]);}}catch(_0x50d46c){logger['error'](_0xe5a9('0x4d'),_0x50d46c['message']);}};Acw['prototype'][_0xe5a9('0x10')]=function(_0x42b23f){try{if(this[_0xe5a9('0x5')][_0x42b23f['queue']]&&this[_0xe5a9('0x5')][_0x42b23f[_0xe5a9('0x1a')]][_0xe5a9('0x4e')]===_0xe5a9('0x4f')){if(this[_0xe5a9('0x6')][_0x42b23f[_0xe5a9('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x42b23f[_0xe5a9('0x2d')],_0x42b23f[_0xe5a9('0x19')],_0x42b23f[_0xe5a9('0x1a')]);return RpcUser[_0xe5a9('0x25')](this['agents'][_0x42b23f[_0xe5a9('0x19')]],_0xe5a9('0x50'),_0x42b23f[_0xe5a9('0x2d')]);}}}catch(_0x3ab357){logger['error'](_0xe5a9('0x51'),_0x3ab357[_0xe5a9('0x34')]);}};module[_0xe5a9('0x52')]=Acw;
\ No newline at end of file
+var _0x0534=['destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x0534,0x184));var _0x4053=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x0534[_0x16771d];return _0x386f11;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4053('0x0'));var ami=require(_0x4053('0x1'));var logger=require(_0x4053('0x2'))(_0x4053('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x4053('0x4'));function Acw(_0x49d26d){this[_0x4053('0x5')]=_0x49d26d['voiceQueues'];this[_0x4053('0x6')]=_0x49d26d[_0x4053('0x6')];this[_0x4053('0x7')]=_0x49d26d[_0x4053('0x7')];this[_0x4053('0x8')]={};ami['on'](_0x4053('0x9'),this[_0x4053('0xa')][_0x4053('0xb')](this));ami['on'](_0x4053('0xc'),this[_0x4053('0xd')][_0x4053('0xb')](this));ami['on'](_0x4053('0xe'),this[_0x4053('0xf')][_0x4053('0xb')](this));ami['on'](_0x4053('0x10'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x4053('0x11'),this[_0x4053('0x12')][_0x4053('0xb')](this));ami['on'](_0x4053('0x13'),this[_0x4053('0x14')][_0x4053('0xb')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview']['bind'](this));}function getDiff(_0xdcc25a){var _0x3422d9=moment()[_0x4053('0x15')](0x0);var _0x21d9f5=moment(_0xdcc25a)[_0x4053('0x15')](0x0);return _0x3422d9[_0x4053('0x16')](_0x21d9f5,_0x4053('0x17'));}Acw[_0x4053('0x18')]['startAcw']=function(_0x9a855c){try{var _0x1e517a=this;var _0x1940e6=this['channels'][_0x9a855c][_0x4053('0x19')];var _0x314149=this[_0x4053('0x8')][_0x9a855c]['queue'];var _0x2d57d0=this[_0x4053('0x5')][_0x314149];var _0x2c4cc8=![];var _0x22e020=_0x4053('0x1a');if(_0x2d57d0[_0x4053('0x1b')]){if(_0x2d57d0[_0x4053('0x1c')][_0x4053('0x1d')]){_0x2c4cc8=!![];_0x22e020=_0x2d57d0[_0x4053('0x1c')][_0x4053('0x1d')];}}ami[_0x4053('0x1e')]({'action':_0x4053('0x1f'),'interface':_0x1940e6,'paused':!![],'reason':_0x22e020})[_0x4053('0x20')](function(_0x4b3804){if(_0x1e517a[_0x4053('0x6')][_0x1940e6]){return RpcUser[_0x4053('0x21')](_0x1e517a[_0x4053('0x6')][_0x1940e6]['id'])[_0x4053('0x20')](function(_0x4a55db){if(_0x4a55db&&!_0x4a55db[_0x4053('0x22')]){logger['info'](_0x4053('0x23'),_0x9a855c,_0x1940e6,_0x314149);var _0x2cfda1=_0x1e517a[_0x4053('0x8')][_0x9a855c][_0x4053('0x24')]&&_0x1e517a[_0x4053('0x8')][_0x9a855c]['destlinkedid']?_0x1e517a['channels'][_0x9a855c][_0x4053('0x25')]:_0x9a855c;return RpcUser[_0x4053('0x26')](_0x1e517a[_0x4053('0x6')][_0x1940e6],_0x22e020,_0x2cfda1)[_0x4053('0x20')](function(_0xe745cb){if(!_0x2c4cc8){_0x1e517a[_0x4053('0x7')][_0x1940e6]={};logger[_0x4053('0x27')](_0x4053('0x28'),_0x9a855c,_0x1e517a[_0x4053('0x5')][_0x314149][_0x4053('0x29')],_0x1940e6,_0x314149);_0x1e517a[_0x4053('0x7')][_0x1940e6][_0x4053('0x2a')]=setTimeout(_0x1e517a[_0x4053('0x2b')][_0x4053('0xb')](_0x1e517a,_0x1940e6),_0x1e517a[_0x4053('0x5')][_0x314149][_0x4053('0x29')]*0x3e8);_0x1e517a['timers'][_0x1940e6][_0x4053('0x2c')]=moment()[_0x4053('0x2d')](_0x4053('0x2e'));_0x1e517a['timers'][_0x1940e6][_0x4053('0x2f')]=_0x9a855c;_0x1e517a[_0x4053('0x7')][_0x1940e6][_0x4053('0x30')]=_0x314149;_0x1e517a[_0x4053('0x7')][_0x1940e6][_0x4053('0x31')]=function(){var _0x4bec67=getDiff(_0x1e517a[_0x4053('0x7')][_0x1940e6]['lastPauseAt']);clearTimeout(_0x1e517a['timers'][_0x1940e6][_0x4053('0x2a')]);_0x1e517a[_0x4053('0x7')][_0x1940e6][_0x4053('0x2a')]=![];RpcVoiceAgentReport[_0x4053('0x32')]({'acwtime':_0x4bec67},_0x1e517a[_0x4053('0x7')][_0x1940e6][_0x4053('0x2f')],_0x1940e6)[_0x4053('0x20')](function(_0x496fd8){logger[_0x4053('0x27')](_0x4053('0x33'),_0x9a855c,_0x4bec67,_0x496fd8);})[_0x4053('0x34')](function(_0x43c0f8){logger[_0x4053('0x35')](_0x4053('0x36'),_0x9a855c,_0x43c0f8);});delete _0x1e517a[_0x4053('0x7')][_0x1940e6];};}});}else{logger[_0x4053('0x27')](_0x4053('0x37'),_0x9a855c,_0x1940e6,_0x314149);}});}})['catch'](function(_0x5bcfd6){logger[_0x4053('0x35')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x9a855c,_0x1e517a[_0x4053('0x5')][_0x314149][_0x4053('0x29')],_0x1940e6,_0x314149);})['finally'](function(){delete _0x1e517a[_0x4053('0x8')][_0x9a855c];});}catch(_0x4048e6){logger[_0x4053('0x35')]('[ACW][START]\x20%s',_0x4048e6['message']);}};Acw[_0x4053('0x18')][_0x4053('0x2b')]=function(_0x44b56f){try{var _0x103bc6=this;if(_0x103bc6[_0x4053('0x7')][_0x44b56f]){_0x103bc6[_0x4053('0x7')][_0x44b56f][_0x4053('0x2a')]=![];var _0x4a69fd=_0x103bc6[_0x4053('0x7')][_0x44b56f]['uniqueid'];var _0x1034e5=_0x103bc6[_0x4053('0x7')][_0x44b56f][_0x4053('0x30')];var _0x18c7cf=_0x103bc6[_0x4053('0x5')][_0x1034e5]['acwTimeout'];logger[_0x4053('0x27')](_0x4053('0x38'),_0x4a69fd,_0x44b56f);RpcUser[_0x4053('0x39')](this[_0x4053('0x6')][_0x44b56f]);RpcVoiceAgentReport[_0x4053('0x32')]({'acwtime':_0x18c7cf,'agentacw':!![]},_0x4a69fd,_0x44b56f)[_0x4053('0x20')](function(_0x297854){logger['info'](_0x4053('0x33'),_0x4a69fd,_0x18c7cf,_0x297854);})[_0x4053('0x34')](function(_0x33b410){logger[_0x4053('0x35')](_0x4053('0x36'),_0x4a69fd,_0x33b410);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x44b56f);if(_0x103bc6[_0x4053('0x7')]){logger[_0x4053('0x27')]('[ACW][TIMERS]',JSON[_0x4053('0x3a')](_0x103bc6['timers']));}}}catch(_0x19697c){logger[_0x4053('0x35')](_0x4053('0x3b'),_0x19697c[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')][_0x4053('0xa')]=function(_0x47a60c){try{if(this[_0x4053('0x5')][_0x47a60c['queue']]&&(this[_0x4053('0x5')][_0x47a60c[_0x4053('0x30')]]['acw']||this[_0x4053('0x5')][_0x47a60c['queue']][_0x4053('0x1b')])){if(this['agents'][_0x47a60c[_0x4053('0x19')]]){this[_0x4053('0x8')][_0x47a60c[_0x4053('0x2f')]]={'queue':_0x47a60c['queue'],'interface':_0x47a60c['interface'],'destlinkedid':_0x47a60c[_0x4053('0x25')]};}}}catch(_0x3912c5){logger[_0x4053('0x35')](_0x4053('0x3d'),_0x3912c5[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')][_0x4053('0x3e')]=function(_0x1fb75f){try{if(this[_0x4053('0x5')][_0x1fb75f['queue']]&&(this[_0x4053('0x5')][_0x1fb75f['queue']][_0x4053('0x3')]||this['voiceQueues'][_0x1fb75f[_0x4053('0x30')]][_0x4053('0x1b')])){if(this['agents'][_0x1fb75f['interface']]){this[_0x4053('0x8')][_0x1fb75f[_0x4053('0x2f')]]={'queue':_0x1fb75f[_0x4053('0x30')],'interface':_0x1fb75f[_0x4053('0x19')]};}}}catch(_0x2b79c7){logger[_0x4053('0x35')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2b79c7[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')][_0x4053('0xd')]=function(_0x456781){try{if(this[_0x4053('0x8')][_0x456781[_0x4053('0x2f')]]&&_[_0x4053('0x3f')](this[_0x4053('0x8')][_0x456781[_0x4053('0x2f')]][_0x4053('0x24')])){logger[_0x4053('0x27')](_0x4053('0x40'),_0x456781['uniqueid']);this[_0x4053('0x41')](_0x456781[_0x4053('0x2f')]);}else if(this[_0x4053('0x8')][_0x456781[_0x4053('0x42')]]&&_['isUndefined'](this[_0x4053('0x8')][_0x456781[_0x4053('0x42')]][_0x4053('0x24')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x456781[_0x4053('0x42')]);this[_0x4053('0x41')](_0x456781['linkedid']);}}catch(_0x298b02){logger[_0x4053('0x35')]('[ACW][syncHangupRequest]\x20%s',_0x298b02[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')][_0x4053('0xf')]=function(_0x5d9a12){try{if(this[_0x4053('0x8')][_0x5d9a12[_0x4053('0x2f')]]&&this['channels'][_0x5d9a12['uniqueid']][_0x4053('0x24')]){logger['info'](_0x4053('0x43'),_0x5d9a12[_0x4053('0x2f')]);this[_0x4053('0x41')](_0x5d9a12[_0x4053('0x2f')]);}else if(this[_0x4053('0x8')][_0x5d9a12[_0x4053('0x42')]]&&this[_0x4053('0x8')][_0x5d9a12[_0x4053('0x42')]][_0x4053('0x24')]){logger[_0x4053('0x27')](_0x4053('0x44'),_0x5d9a12[_0x4053('0x42')]);this[_0x4053('0x41')](_0x5d9a12[_0x4053('0x42')]);}}catch(_0x36998d){logger[_0x4053('0x35')](_0x4053('0x45'),_0x36998d[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')][_0x4053('0x12')]=function(_0x1aaf94){try{if(!_[_0x4053('0x46')](this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x47')]])){this['startAcw'](_0x1aaf94[_0x4053('0x47')]);if(this['channels'][_0x1aaf94[_0x4053('0x48')]]){this[_0x4053('0x8')][_0x1aaf94['secondtransfereruniqueid']][_0x4053('0x24')]=!![];this[_0x4053('0x8')][_0x1aaf94['transfertargetuniqueid']]=this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x48')]];delete this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x48')]];}}else if(!_[_0x4053('0x46')](this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x49')]])){this[_0x4053('0x41')](_0x1aaf94['transfertargetuniqueid']);if(this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x4a')]]){this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x4a')]]['attended']=!![];this['channels'][_0x1aaf94[_0x4053('0x47')]]=this[_0x4053('0x8')][_0x1aaf94[_0x4053('0x4a')]];delete this['channels'][_0x1aaf94[_0x4053('0x4a')]];}}}catch(_0x1125d7){logger[_0x4053('0x35')](_0x4053('0x4b'),_0x1125d7[_0x4053('0x3c')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x169f6f){try{if(this[_0x4053('0x8')][_0x169f6f[_0x4053('0x4c')]]){logger[_0x4053('0x27')](_0x4053('0x4d'),JSON[_0x4053('0x3a')](_0x169f6f['transfereruniqueid']));this[_0x4053('0x41')](_0x169f6f['transfereruniqueid']);}else if(this[_0x4053('0x8')][_0x169f6f['transfererlinkedid']]){logger['info'](_0x4053('0x4e'),JSON[_0x4053('0x3a')](_0x169f6f[_0x4053('0x4f')]));this[_0x4053('0x41')](_0x169f6f[_0x4053('0x4f')]);}}catch(_0x4f1873){logger['error'](_0x4053('0x50'),_0x4f1873[_0x4053('0x3c')]);}};Acw[_0x4053('0x18')]['syncAgentRingNoAnswer']=function(_0x50663f){try{if(this['voiceQueues'][_0x50663f[_0x4053('0x30')]]&&this[_0x4053('0x5')][_0x50663f[_0x4053('0x30')]][_0x4053('0x51')]===_0x4053('0x52')){if(this[_0x4053('0x6')][_0x50663f[_0x4053('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x50663f[_0x4053('0x2f')],_0x50663f[_0x4053('0x19')],_0x50663f['queue']);return RpcUser[_0x4053('0x26')](this[_0x4053('0x6')][_0x50663f[_0x4053('0x19')]],_0x4053('0x53'),_0x50663f[_0x4053('0x2f')]);}}}catch(_0x2984b5){logger[_0x4053('0x35')](_0x4053('0x54'),_0x2984b5[_0x4053('0x3c')]);}};module['exports']=Acw;
\ No newline at end of file
index cb5761c..0f954a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c4=['Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','moment','util','lodash','../../config/logger','ami','asterisk','username','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port'];(function(_0x195c6b,_0x558639){var _0x239123=function(_0x31b683){while(--_0x31b683){_0x195c6b['push'](_0x195c6b['shift']());}};_0x239123(++_0x558639);}(_0x83c4,0x168));var _0x483c=function(_0x320ff6,_0x223d7a){_0x320ff6=_0x320ff6-0x0;var _0x5685e6=_0x83c4[_0x320ff6];return _0x5685e6;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x483c('0x0'));var util=require(_0x483c('0x1'));var _=require(_0x483c('0x2'));var logger=require(_0x483c('0x3'))(_0x483c('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x483c('0x5')]['port'],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['password'],!![]);ami[_0x483c('0x7')]();ami[_0x483c('0x8')]=BPromise['promisify'](ami[_0x483c('0x9')]);function error(_0x31d4ab){logger[_0x483c('0xa')](util[_0x483c('0xb')](_0x483c('0xc'),config['asterisk']['username'],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')],util['inspect'](_0x31d4ab,![],null)));}function close(){logger[_0x483c('0xa')](util[_0x483c('0xb')](_0x483c('0xe'),config[_0x483c('0x5')][_0x483c('0x6')],config['asterisk']['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));}ami[_0x483c('0xf')]=function(){return function(){return ami[_0x483c('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x483c('0x8')]({'action':_0x483c('0x10')});};};ami[_0x483c('0x11')]=function(){return function(){return ami['Action']({'action':_0x483c('0x12')});};};ami[_0x483c('0x13')]=function(){return function(){return ami[_0x483c('0x8')]({'action':'queuesummary'});};};ami[_0x483c('0x14')]=function(){return function(){return ami[_0x483c('0x8')]({'action':_0x483c('0x15')});};};function connect(_0x31e082){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x17'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));ami['once'](_0x483c('0xa'),error);ami[_0x483c('0x18')]('close',close);}ami['on'](_0x483c('0x19'),connect);ami['on'](_0x483c('0x1a'),function(_0x311d2d){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x1b'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')]['port'],util[_0x483c('0x1c')](_0x311d2d,![],null)));});ami['on'](_0x483c('0x1d'),function(_0x3901e3){logger[_0x483c('0x16')](util[_0x483c('0xb')](_0x483c('0x1e'),config[_0x483c('0x5')][_0x483c('0x6')],config[_0x483c('0x5')]['ip'],config[_0x483c('0x5')][_0x483c('0xd')]));return BPromise[_0x483c('0x1f')]()[_0x483c('0x20')](ami[_0x483c('0xf')]())[_0x483c('0x20')](ami['actionDeviceStateList']())[_0x483c('0x20')](ami[_0x483c('0x11')]())[_0x483c('0x20')](ami[_0x483c('0x13')]())[_0x483c('0x20')](ami[_0x483c('0x14')]())['catch'](function(_0x166902){console[_0x483c('0x21')](_0x166902);});});ami[_0x483c('0x18')](_0x483c('0xa'),error);ami['once']('close',close);module['exports']=ami;
\ No newline at end of file
+var _0xe6e9=['actionCoreShowChannels','catch','close','exports','moment','util','lodash','../../config/logger','asterisk','port','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then'];(function(_0x29f766,_0x48521c){var _0x3a3c8d=function(_0x29452b){while(--_0x29452b){_0x29f766['push'](_0x29f766['shift']());}};_0x3a3c8d(++_0x48521c);}(_0xe6e9,0xae));var _0x9e6e=function(_0x15d59c,_0xe70adb){_0x15d59c=_0x15d59c-0x0;var _0x39e514=_0xe6e9[_0x15d59c];return _0x39e514;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x9e6e('0x0'));var util=require(_0x9e6e('0x1'));var _=require(_0x9e6e('0x2'));var logger=require(_0x9e6e('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x9e6e('0x4')][_0x9e6e('0x5')],config['asterisk']['ip'],config[_0x9e6e('0x4')][_0x9e6e('0x6')],config[_0x9e6e('0x4')]['password'],!![]);ami[_0x9e6e('0x7')]();ami[_0x9e6e('0x8')]=BPromise[_0x9e6e('0x9')](ami[_0x9e6e('0xa')]);function error(_0x206d17){logger[_0x9e6e('0xb')](util[_0x9e6e('0xc')](_0x9e6e('0xd'),config[_0x9e6e('0x4')]['username'],config[_0x9e6e('0x4')]['ip'],config[_0x9e6e('0x4')][_0x9e6e('0x5')],util[_0x9e6e('0xe')](_0x206d17,![],null)));}function close(){logger[_0x9e6e('0xb')](util[_0x9e6e('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x9e6e('0x4')][_0x9e6e('0x6')],config['asterisk']['ip'],config[_0x9e6e('0x4')][_0x9e6e('0x5')]));}ami[_0x9e6e('0xf')]=function(){return function(){return ami[_0x9e6e('0x8')]({'action':_0x9e6e('0x10')});};};ami[_0x9e6e('0x11')]=function(){return function(){return ami[_0x9e6e('0x8')]({'action':_0x9e6e('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x9e6e('0x8')]({'action':_0x9e6e('0x13')});};};ami[_0x9e6e('0x14')]=function(){return function(){return ami[_0x9e6e('0x8')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(_0x117994){logger[_0x9e6e('0x15')](util['format'](_0x9e6e('0x16'),config[_0x9e6e('0x4')][_0x9e6e('0x6')],config[_0x9e6e('0x4')]['ip'],config[_0x9e6e('0x4')][_0x9e6e('0x5')]));ami[_0x9e6e('0x17')]('error',error);ami[_0x9e6e('0x17')]('close',close);}ami['on'](_0x9e6e('0x18'),connect);ami['on'](_0x9e6e('0x19'),function(_0xfd3e0e){logger[_0x9e6e('0x15')](util[_0x9e6e('0xc')](_0x9e6e('0x1a'),config[_0x9e6e('0x4')][_0x9e6e('0x6')],config[_0x9e6e('0x4')]['ip'],config['asterisk'][_0x9e6e('0x5')],util[_0x9e6e('0xe')](_0xfd3e0e,![],null)));});ami['on']('fullybooted',function(_0xd3d470){logger[_0x9e6e('0x15')](util[_0x9e6e('0xc')](_0x9e6e('0x1b'),config[_0x9e6e('0x4')][_0x9e6e('0x6')],config[_0x9e6e('0x4')]['ip'],config['asterisk'][_0x9e6e('0x5')]));return BPromise[_0x9e6e('0x1c')]()[_0x9e6e('0x1d')](ami['actionSipShowRegistry']())['then'](ami[_0x9e6e('0x11')]())[_0x9e6e('0x1d')](ami['actionSipPeerStatus']())[_0x9e6e('0x1d')](ami[_0x9e6e('0x14')]())['then'](ami[_0x9e6e('0x1e')]())[_0x9e6e('0x1f')](function(_0x5c4cec){console['log'](_0x5c4cec);});});ami[_0x9e6e('0x17')](_0x9e6e('0xb'),error);ami[_0x9e6e('0x17')](_0x9e6e('0x20'),close);module[_0x9e6e('0x21')]=ami;
\ No newline at end of file
index a1e242c..982e215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x70e0,0x17b));var _0x070e=function(_0x58e927,_0x46696e){_0x58e927=_0x58e927-0x0;var _0x46231e=_0x70e0[_0x58e927];return _0x46231e;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client;
\ No newline at end of file
+var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x5e45c3,_0x907997){var _0x5492ac=function(_0x3bf156){while(--_0x3bf156){_0x5e45c3['push'](_0x5e45c3['shift']());}};_0x5492ac(++_0x907997);}(_0xf4eb,0xec));var _0xbf4e=function(_0x28762b,_0x53ef00){_0x28762b=_0x28762b-0x0;var _0x499086=_0xf4eb[_0x28762b];return _0x499086;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client;
\ No newline at end of file
index 39a1604..daee2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec8=['CampaignId','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','voiceQueue','dialCutDigit','substring','prototype','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','Contact','firstName','lastName','number','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x4ec8,0xf7));var _0x84ec=function(_0x466855,_0x3851ac){_0x466855=_0x466855-0x0;var _0x60b632=_0x4ec8[_0x466855];return _0x60b632;};'use strict';var util=require(_0x84ec('0x0'));var _=require(_0x84ec('0x1'));var moment=require(_0x84ec('0x2'));function checkNameSurname(_0x18b6c0,_0x50526b,_0x407ec7){var _0x28dc87='';if(!_[_0x84ec('0x3')](_0x50526b)&&'string'===typeof _0x50526b){_0x28dc87+=_0x50526b;}if(!_['isNil'](_0x407ec7)&&_0x84ec('0x4')===typeof _0x407ec7){_0x28dc87+='\x20'+_0x407ec7;}if(_0x28dc87!==''){return _0x28dc87;}return _0x18b6c0;}function Action(_0x7f9c3,_0x234f24,_0x2cabc9){this['voiceQueue']=_0x7f9c3;this[_0x84ec('0x5')]=_0x2cabc9||undefined;this['name']=checkNameSurname(_0x234f24[_0x84ec('0x6')]['phone'],_0x234f24[_0x84ec('0x6')][_0x84ec('0x7')],_0x234f24[_0x84ec('0x6')][_0x84ec('0x8')]);this[_0x84ec('0x9')]=_0x234f24[_0x84ec('0x6')][_0x84ec('0xa')];this[_0x84ec('0xb')]=_0x7f9c3[_0x84ec('0xc')];this[_0x84ec('0xd')]=_0x234f24[_0x84ec('0xd')]||![];this[_0x84ec('0xe')]=_0x7f9c3[_0x84ec('0xe')];this[_0x84ec('0xf')]=_0x7f9c3['dialQueueTimeout']||0x3;this[_0x84ec('0x10')]=_0x234f24[_0x84ec('0x10')];this['countbusyretry']=_0x234f24[_0x84ec('0x11')];this['countcongestionretry']=_0x234f24[_0x84ec('0x12')];this[_0x84ec('0x13')]=_0x234f24['countnoanswerretry'];this['countnosuchnumberretry']=_0x234f24[_0x84ec('0x14')];this[_0x84ec('0x15')]=_0x234f24[_0x84ec('0x15')];this['countabandonedretry']=_0x234f24[_0x84ec('0x16')];this[_0x84ec('0x17')]=_0x234f24[_0x84ec('0x17')];this[_0x84ec('0x18')]=_0x234f24[_0x84ec('0x18')];this[_0x84ec('0x19')]=_0x234f24[_0x84ec('0x19')];this['ListId']=_0x234f24[_0x84ec('0x1a')];this[_0x84ec('0x1b')]=_0x234f24[_0x84ec('0x1b')];this[_0x84ec('0x1c')]=_0x234f24[_0x84ec('0x1c')];this[_0x84ec('0x1d')]=_0x234f24[_0x84ec('0x1d')];this['idHopper']=_0x234f24['id'];this[_0x84ec('0x1e')]=_0x234f24[_0x84ec('0x6')][_0x84ec('0x7')]||'';this[_0x84ec('0x1f')]=moment()[_0x84ec('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x84ec('0x21')]=_0x234f24['callback'];this[_0x84ec('0x22')]=_0x234f24[_0x84ec('0x22')];this[_0x84ec('0x23')]=_0x234f24[_0x84ec('0x23')];this[_0x84ec('0x24')]=_0x234f24[_0x84ec('0x24')];this[_0x84ec('0x25')]='';this[_0x84ec('0x26')]='';}Action['prototype'][_0x84ec('0x27')]=function(){return util[_0x84ec('0x20')]('\x22%s\x22\x20<%s>',this['name'],this[_0x84ec('0x28')][_0x84ec('0x29')]>0x0?this[_0x84ec('0x9')][_0x84ec('0x2a')](this['voiceQueue'][_0x84ec('0x29')]):this['number']);};Action[_0x84ec('0x2b')][_0x84ec('0x2c')]=function(){return this[_0x84ec('0xb')];};module[_0x84ec('0x2d')]=Action;
\ No newline at end of file
+var _0x823e=['originatecalleridname','prototype','getCaller','dialCutDigit','getQueue','queue','exports','util','lodash','moment','string','isNil','voiceQueue','name','Contact','phone','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0x15ccc0,_0x2ceee3){var _0x251353=function(_0x11ae48){while(--_0x11ae48){_0x15ccc0['push'](_0x15ccc0['shift']());}};_0x251353(++_0x2ceee3);}(_0x823e,0x1eb));var _0xe823=function(_0x450585,_0x1042af){_0x450585=_0x450585-0x0;var _0x1a33eb=_0x823e[_0x450585];return _0x1a33eb;};'use strict';var util=require(_0xe823('0x0'));var _=require(_0xe823('0x1'));var moment=require(_0xe823('0x2'));function checkNameSurname(_0x2135fc,_0x29707e,_0x28cc54){var _0x254124='';if(!_['isNil'](_0x29707e)&&_0xe823('0x3')===typeof _0x29707e){_0x254124+=_0x29707e;}if(!_[_0xe823('0x4')](_0x28cc54)&&_0xe823('0x3')===typeof _0x28cc54){_0x254124+='\x20'+_0x28cc54;}if(_0x254124!==''){return _0x254124;}return _0x2135fc;}function Action(_0x9ee68d,_0xbebd30,_0x3eb283){this[_0xe823('0x5')]=_0x9ee68d;this['uniqueid']=_0x3eb283||undefined;this[_0xe823('0x6')]=checkNameSurname(_0xbebd30[_0xe823('0x7')][_0xe823('0x8')],_0xbebd30[_0xe823('0x7')]['firstName'],_0xbebd30[_0xe823('0x7')][_0xe823('0x9')]);this[_0xe823('0xa')]=_0xbebd30[_0xe823('0x7')]['phone'];this['queue']=_0x9ee68d[_0xe823('0x6')];this[_0xe823('0xb')]=_0xbebd30[_0xe823('0xb')]||![];this[_0xe823('0xc')]=_0x9ee68d[_0xe823('0xc')];this[_0xe823('0xd')]=_0x9ee68d['dialQueueTimeout']||0x3;this[_0xe823('0xe')]=_0xbebd30[_0xe823('0xe')];this[_0xe823('0xf')]=_0xbebd30[_0xe823('0xf')];this[_0xe823('0x10')]=_0xbebd30['countcongestionretry'];this['countnoanswerretry']=_0xbebd30[_0xe823('0x11')];this['countnosuchnumberretry']=_0xbebd30['countnosuchnumberretry'];this[_0xe823('0x12')]=_0xbebd30['countdropretry'];this[_0xe823('0x13')]=_0xbebd30[_0xe823('0x13')];this[_0xe823('0x14')]=_0xbebd30[_0xe823('0x14')];this[_0xe823('0x15')]=_0xbebd30[_0xe823('0x15')];this[_0xe823('0x16')]=_0xbebd30[_0xe823('0x16')];this[_0xe823('0x17')]=_0xbebd30[_0xe823('0x17')];this['UserId']=_0xbebd30[_0xe823('0x18')];this[_0xe823('0x19')]=_0xbebd30[_0xe823('0x19')];this[_0xe823('0x1a')]=_0xbebd30[_0xe823('0x1a')];this[_0xe823('0x1b')]=_0xbebd30['id'];this[_0xe823('0x1c')]=_0xbebd30[_0xe823('0x7')]['firstName']||'';this[_0xe823('0x1d')]=moment()[_0xe823('0x1e')](_0xe823('0x1f'));this['callback']=_0xbebd30[_0xe823('0x20')];this[_0xe823('0x21')]=_0xbebd30[_0xe823('0x21')];this['callbackat']=_0xbebd30[_0xe823('0x22')];this[_0xe823('0x23')]=_0xbebd30[_0xe823('0x23')];this[_0xe823('0x24')]='';this[_0xe823('0x25')]='';}Action[_0xe823('0x26')][_0xe823('0x27')]=function(){return util[_0xe823('0x1e')]('\x22%s\x22\x20<%s>',this[_0xe823('0x6')],this[_0xe823('0x5')][_0xe823('0x28')]>0x0?this[_0xe823('0xa')]['substring'](this[_0xe823('0x5')][_0xe823('0x28')]):this['number']);};Action[_0xe823('0x26')][_0xe823('0x29')]=function(){return this[_0xe823('0x2a')];};module[_0xe823('0x2b')]=Action;
\ No newline at end of file
index 2148422..884b726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc87e=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x55e189,_0x5b53da){var _0x5db261=function(_0x3ea7f0){while(--_0x3ea7f0){_0x55e189['push'](_0x55e189['shift']());}};_0x5db261(++_0x5b53da);}(_0xc87e,0x117));var _0xec87=function(_0x4d7fac,_0x5e4e65){_0x4d7fac=_0x4d7fac-0x0;var _0xf81629=_0xc87e[_0x4d7fac];return _0xf81629;};'use strict';var util=require(_0xec87('0x0'));var _=require(_0xec87('0x1'));var moment=require(_0xec87('0x2'));function getSeconds(_0x3e161b,_0x210c1b){var _0x5386bf=moment(_0x3e161b)['milliseconds'](0x0);var _0x2eb210=moment(_0x210c1b)['milliseconds'](0x0);return _0x5386bf[_0xec87('0x3')](_0x2eb210,_0xec87('0x4'));}function AgentComplete(_0xa03ecf,_0x59a009){this[_0xec87('0x5')]=0x4;this[_0xec87('0x6')]='Answer';this[_0xec87('0x7')]=_0xa03ecf[_0xec87('0x7')];this[_0xec87('0x8')]=_0xa03ecf[_0xec87('0x8')];this[_0xec87('0x9')]=_0xa03ecf[_0xec87('0x8')]===_0xec87('0xa')?_0xec87('0xb'):_0xa03ecf[_0xec87('0x8')];this[_0xec87('0xc')]=_0xa03ecf['countbusyretry'];this['countcongestionretry']=_0xa03ecf[_0xec87('0xd')];this[_0xec87('0xe')]=_0xa03ecf['countnoanswerretry'];this['countglobal']=_0xa03ecf['countbusyretry']+_0xa03ecf[_0xec87('0xd')]+_0xa03ecf[_0xec87('0xe')]+_0xa03ecf[_0xec87('0xf')]+_0xa03ecf['countdropretry']+_0xa03ecf[_0xec87('0x10')]+_0xa03ecf[_0xec87('0x11')]+_0xa03ecf[_0xec87('0x12')];this['countnosuchnumberretry']=_0xa03ecf[_0xec87('0xf')];this[_0xec87('0x13')]=_0xa03ecf[_0xec87('0x13')];this[_0xec87('0x10')]=_0xa03ecf[_0xec87('0x10')];this['countmachineretry']=_0xa03ecf[_0xec87('0x11')];this['countagentrejectretry']=_0xa03ecf[_0xec87('0x12')];this['uniqueid']=_0x59a009['uniqueid'];this['calleridname']=_0xa03ecf[_0xec87('0x14')];this['calleridnum']=_0xa03ecf[_0xec87('0x15')];this[_0xec87('0x16')]=_0xa03ecf[_0xec87('0x16')];this[_0xec87('0x17')]=_0xa03ecf[_0xec87('0x17')];this[_0xec87('0x18')]=_0xa03ecf[_0xec87('0x18')];this[_0xec87('0x19')]=moment()[_0xec87('0x1a')](_0xec87('0x1b'));this[_0xec87('0x1c')]=getSeconds(_0xa03ecf[_0xec87('0x17')],_0xa03ecf[_0xec87('0x16')]);this[_0xec87('0x1d')]=getSeconds(_0xa03ecf['answertime'],_0xa03ecf[_0xec87('0x17')]);this[_0xec87('0x1e')]=getSeconds(this[_0xec87('0x19')],_0xa03ecf[_0xec87('0x18')]);this[_0xec87('0xb')]=_0x59a009[_0xec87('0xb')];this[_0xec87('0x1f')]=_0x59a009[_0xec87('0x1f')];this['reason']=_0x59a009[_0xec87('0x20')];this['callback']=_0xa03ecf[_0xec87('0x21')];this[_0xec87('0x22')]=_0xa03ecf[_0xec87('0x22')];this[_0xec87('0x23')]=_0xa03ecf[_0xec87('0x23')];this['recallme']=_0xa03ecf[_0xec87('0x24')];this[_0xec87('0x25')]=_0xa03ecf[_0xec87('0x25')];this[_0xec87('0x26')]=_0xa03ecf[_0xec87('0x26')];this[_0xec87('0x27')]=_0xa03ecf[_0xec87('0x27')];this[_0xec87('0x28')]=_0xa03ecf[_0xec87('0x28')];this[_0xec87('0x29')]=_0xa03ecf[_0xec87('0x29')];this[_0xec87('0x2a')]=_0xa03ecf[_0xec87('0x2a')]||'';this[_0xec87('0x2b')]=_0xa03ecf[_0xec87('0x2b')]||'';}module[_0xec87('0x2c')]=AgentComplete;
\ No newline at end of file
+var _0x4c5a=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c5a,0x164));var _0xa4c5=function(_0x32c647,_0x18f706){_0x32c647=_0x32c647-0x0;var _0x112645=_0x4c5a[_0x32c647];return _0x112645;};'use strict';var util=require(_0xa4c5('0x0'));var _=require(_0xa4c5('0x1'));var moment=require(_0xa4c5('0x2'));function getSeconds(_0x542a77,_0x5ad9b8){var _0x4bf52e=moment(_0x542a77)[_0xa4c5('0x3')](0x0);var _0x3aec61=moment(_0x5ad9b8)[_0xa4c5('0x3')](0x0);return _0x4bf52e[_0xa4c5('0x4')](_0x3aec61,'seconds');}function AgentComplete(_0x202163,_0x91db1b){this[_0xa4c5('0x5')]=0x4;this['statedesc']=_0xa4c5('0x6');this['scheduledat']=_0x202163[_0xa4c5('0x7')];this[_0xa4c5('0x8')]=_0x202163[_0xa4c5('0x8')];this[_0xa4c5('0x9')]=_0x202163[_0xa4c5('0x8')]==='outbound'?_0xa4c5('0xa'):_0x202163[_0xa4c5('0x8')];this['countbusyretry']=_0x202163[_0xa4c5('0xb')];this['countcongestionretry']=_0x202163[_0xa4c5('0xc')];this['countnoanswerretry']=_0x202163[_0xa4c5('0xd')];this['countglobal']=_0x202163[_0xa4c5('0xb')]+_0x202163[_0xa4c5('0xc')]+_0x202163['countnoanswerretry']+_0x202163[_0xa4c5('0xe')]+_0x202163['countdropretry']+_0x202163[_0xa4c5('0xf')]+_0x202163[_0xa4c5('0x10')]+_0x202163[_0xa4c5('0x11')];this['countnosuchnumberretry']=_0x202163[_0xa4c5('0xe')];this[_0xa4c5('0x12')]=_0x202163[_0xa4c5('0x12')];this['countabandonedretry']=_0x202163['countabandonedretry'];this[_0xa4c5('0x10')]=_0x202163[_0xa4c5('0x10')];this[_0xa4c5('0x11')]=_0x202163[_0xa4c5('0x11')];this[_0xa4c5('0x13')]=_0x91db1b[_0xa4c5('0x13')];this[_0xa4c5('0x14')]=_0x202163[_0xa4c5('0x15')];this[_0xa4c5('0x16')]=_0x202163[_0xa4c5('0x17')];this[_0xa4c5('0x18')]=_0x202163[_0xa4c5('0x18')];this['responsetime']=_0x202163[_0xa4c5('0x19')];this[_0xa4c5('0x1a')]=_0x202163['answertime'];this[_0xa4c5('0x1b')]=moment()[_0xa4c5('0x1c')](_0xa4c5('0x1d'));this[_0xa4c5('0x1e')]=getSeconds(_0x202163[_0xa4c5('0x19')],_0x202163[_0xa4c5('0x18')]);this[_0xa4c5('0x1f')]=getSeconds(_0x202163[_0xa4c5('0x1a')],_0x202163['responsetime']);this[_0xa4c5('0x20')]=getSeconds(this[_0xa4c5('0x1b')],_0x202163[_0xa4c5('0x1a')]);this['queue']=_0x91db1b[_0xa4c5('0xa')];this[_0xa4c5('0x21')]=_0x91db1b[_0xa4c5('0x21')];this[_0xa4c5('0x22')]=_0x91db1b['reason'];this[_0xa4c5('0x23')]=_0x202163[_0xa4c5('0x23')];this['callbackuniqueid']=_0x202163[_0xa4c5('0x24')];this[_0xa4c5('0x25')]=_0x202163['callbackat'];this[_0xa4c5('0x26')]=_0x202163[_0xa4c5('0x26')];this[_0xa4c5('0x27')]=_0x202163[_0xa4c5('0x27')];this[_0xa4c5('0x28')]=_0x202163[_0xa4c5('0x28')];this[_0xa4c5('0x29')]=_0x202163[_0xa4c5('0x29')];this[_0xa4c5('0x2a')]=_0x202163[_0xa4c5('0x2a')];this['CampaignId']=_0x202163[_0xa4c5('0x2b')];this[_0xa4c5('0x2c')]=_0x202163[_0xa4c5('0x2c')]||'';this['originatecalleridname']=_0x202163['originatecalleridname']||'';}module[_0xa4c5('0x2d')]=AgentComplete;
\ No newline at end of file
index 804680d..1ad8f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd67b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x5e17b5,_0x67cc67){var _0x51fef1=function(_0x2cebde){while(--_0x2cebde){_0x5e17b5['push'](_0x5e17b5['shift']());}};_0x51fef1(++_0x67cc67);}(_0xd67b,0x133));var _0xbd67=function(_0x306628,_0x2701a3){_0x306628=_0x306628-0x0;var _0x409342=_0xd67b[_0x306628];return _0x409342;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var moment=require('moment');function getSeconds(_0x1da24d,_0x280954){var _0x317e33=moment(_0x1da24d)['milliseconds'](0x0);var _0x40e384=moment(_0x280954)['milliseconds'](0x0);return _0x317e33[_0xbd67('0x1')](_0x40e384,'seconds');}function Final(_0x309962){this[_0xbd67('0x2')]=_0x309962[_0xbd67('0x2')];this[_0xbd67('0x3')]=_0x309962[_0xbd67('0x3')];this[_0xbd67('0x4')]=_0x309962[_0xbd67('0x4')];this[_0xbd67('0x5')]=_0x309962[_0xbd67('0x4')]===_0xbd67('0x6')?_0xbd67('0x7'):_0x309962[_0xbd67('0x4')];this[_0xbd67('0x8')]=_0x309962['countbusyretry'];this['countcongestionretry']=_0x309962[_0xbd67('0x9')];this['countnoanswerretry']=_0x309962[_0xbd67('0xa')];this[_0xbd67('0xb')]=_0x309962[_0xbd67('0x8')]+_0x309962[_0xbd67('0x9')]+_0x309962[_0xbd67('0xa')]+_0x309962[_0xbd67('0xc')]+_0x309962[_0xbd67('0xd')]+_0x309962[_0xbd67('0xe')]+_0x309962[_0xbd67('0xf')]+_0x309962[_0xbd67('0x10')];this['countnosuchnumberretry']=_0x309962[_0xbd67('0xc')];this[_0xbd67('0xd')]=_0x309962[_0xbd67('0xd')];this[_0xbd67('0xe')]=_0x309962[_0xbd67('0xe')];this[_0xbd67('0xf')]=_0x309962[_0xbd67('0xf')];this[_0xbd67('0x10')]=_0x309962[_0xbd67('0x10')];this[_0xbd67('0x7')]=_0x309962['queue'];this['calleridname']=_0x309962[_0xbd67('0x11')];this[_0xbd67('0x12')]=_0x309962[_0xbd67('0x12')];this['starttime']=_0x309962[_0xbd67('0x13')];this[_0xbd67('0x14')]=_0x309962[_0xbd67('0x14')];this['endtime']=_0x309962[_0xbd67('0x14')];this['ringtime']=_0x309962[_0xbd67('0x15')]||0x0;this[_0xbd67('0x16')]=_0x309962[_0xbd67('0x16')]||0x0;this['talktime']=_0x309962[_0xbd67('0x17')]||0x0;this[_0xbd67('0x18')]=_0x309962[_0xbd67('0x18')];this[_0xbd67('0x19')]=_0x309962[_0xbd67('0x19')];this[_0xbd67('0x1a')]=_0x309962['callbackat'];this[_0xbd67('0x1b')]=_0x309962[_0xbd67('0x1b')];this[_0xbd67('0x1c')]=_0x309962[_0xbd67('0x1c')];this[_0xbd67('0x1d')]=_0x309962[_0xbd67('0x1d')];this[_0xbd67('0x1e')]=_0x309962[_0xbd67('0x1e')];this[_0xbd67('0x1f')]=_0x309962[_0xbd67('0x1f')];this[_0xbd67('0x20')]=_0x309962['CampaignId'];this[_0xbd67('0x21')]=_0x309962['originatecalleridnum']||'';this[_0xbd67('0x22')]=_0x309962[_0xbd67('0x22')]||'';}module[_0xbd67('0x23')]=Final;
\ No newline at end of file
+var _0x885a=['scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x2c25b8,_0x30865b){var _0x4157a0=function(_0x5057af){while(--_0x5057af){_0x2c25b8['push'](_0x2c25b8['shift']());}};_0x4157a0(++_0x30865b);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var util=require('util');var _=require(_0xa885('0x0'));var moment=require(_0xa885('0x1'));function getSeconds(_0x35456c,_0x2e4bc8){var _0x573a2b=moment(_0x35456c)[_0xa885('0x2')](0x0);var _0x1c41b5=moment(_0x2e4bc8)[_0xa885('0x2')](0x0);return _0x573a2b[_0xa885('0x3')](_0x1c41b5,_0xa885('0x4'));}function Final(_0x33f18b){this['uniqueid']=_0x33f18b[_0xa885('0x5')];this[_0xa885('0x6')]=_0x33f18b[_0xa885('0x6')];this['type']=_0x33f18b[_0xa885('0x7')];this[_0xa885('0x8')]=_0x33f18b[_0xa885('0x7')]==='outbound'?_0xa885('0x9'):_0x33f18b[_0xa885('0x7')];this[_0xa885('0xa')]=_0x33f18b[_0xa885('0xa')];this[_0xa885('0xb')]=_0x33f18b[_0xa885('0xb')];this[_0xa885('0xc')]=_0x33f18b['countnoanswerretry'];this[_0xa885('0xd')]=_0x33f18b[_0xa885('0xa')]+_0x33f18b[_0xa885('0xb')]+_0x33f18b[_0xa885('0xc')]+_0x33f18b[_0xa885('0xe')]+_0x33f18b[_0xa885('0xf')]+_0x33f18b[_0xa885('0x10')]+_0x33f18b['countmachineretry']+_0x33f18b[_0xa885('0x11')];this[_0xa885('0xe')]=_0x33f18b[_0xa885('0xe')];this[_0xa885('0xf')]=_0x33f18b[_0xa885('0xf')];this['countabandonedretry']=_0x33f18b[_0xa885('0x10')];this[_0xa885('0x12')]=_0x33f18b['countmachineretry'];this[_0xa885('0x11')]=_0x33f18b[_0xa885('0x11')];this['queue']=_0x33f18b[_0xa885('0x9')];this[_0xa885('0x13')]=_0x33f18b['calleridname'];this[_0xa885('0x14')]=_0x33f18b['calleridnum'];this[_0xa885('0x15')]=_0x33f18b[_0xa885('0x15')];this[_0xa885('0x16')]=_0x33f18b['responsetime'];this[_0xa885('0x17')]=_0x33f18b['responsetime'];this[_0xa885('0x18')]=_0x33f18b[_0xa885('0x18')]||0x0;this[_0xa885('0x19')]=_0x33f18b['holdtime']||0x0;this[_0xa885('0x1a')]=_0x33f18b[_0xa885('0x1a')]||0x0;this[_0xa885('0x1b')]=_0x33f18b['callback'];this[_0xa885('0x1c')]=_0x33f18b[_0xa885('0x1c')];this[_0xa885('0x1d')]=_0x33f18b['callbackat'];this[_0xa885('0x1e')]=_0x33f18b['recallme'];this[_0xa885('0x1f')]=_0x33f18b[_0xa885('0x1f')];this['ListId']=_0x33f18b[_0xa885('0x20')];this[_0xa885('0x21')]=_0x33f18b[_0xa885('0x21')];this['VoiceQueueId']=_0x33f18b[_0xa885('0x22')];this[_0xa885('0x23')]=_0x33f18b['CampaignId'];this[_0xa885('0x24')]=_0x33f18b['originatecalleridnum']||'';this[_0xa885('0x25')]=_0x33f18b['originatecalleridname']||'';}module[_0xa885('0x26')]=Final;
\ No newline at end of file
index 7b6a7e0..5d9eb8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0992=['milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment'];(function(_0x595b9b,_0xa58ff){var _0x3be4c6=function(_0x324f94){while(--_0x324f94){_0x595b9b['push'](_0x595b9b['shift']());}};_0x3be4c6(++_0xa58ff);}(_0x0992,0x10c));var _0x2099=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0x0992[_0xf6e75d];return _0x27514d;};'use strict';var util=require('util');var _=require(_0x2099('0x0'));var moment=require(_0x2099('0x1'));function getSeconds(_0x16e67a,_0x2a50db){var _0x506f9d=moment(_0x16e67a)[_0x2099('0x2')](0x0);var _0x594bff=moment(_0x2a50db)['milliseconds'](0x0);return _0x506f9d[_0x2099('0x3')](_0x594bff,_0x2099('0x4'));}function Hangup(_0x5e26c6,_0x169d64){this['state']=0x4;this[_0x2099('0x5')]=_0x2099('0x6');this['scheduledat']=_0x5e26c6[_0x2099('0x7')];this[_0x2099('0x8')]=_0x5e26c6[_0x2099('0x8')];this[_0x2099('0x9')]=_0x5e26c6['type']===_0x2099('0xa')?_0x2099('0xb'):_0x5e26c6[_0x2099('0x8')];this[_0x2099('0xc')]=_0x5e26c6[_0x2099('0xc')];this[_0x2099('0xd')]=_0x5e26c6[_0x2099('0xd')];this['countnoanswerretry']=_0x5e26c6['countnoanswerretry'];this[_0x2099('0xe')]=_0x5e26c6[_0x2099('0xc')]+_0x5e26c6[_0x2099('0xd')]+_0x5e26c6[_0x2099('0xf')]+_0x5e26c6[_0x2099('0x10')]+_0x5e26c6['countdropretry']+_0x5e26c6[_0x2099('0x11')]+_0x5e26c6['countmachineretry']+_0x5e26c6[_0x2099('0x12')];this[_0x2099('0x10')]=_0x5e26c6[_0x2099('0x10')];this['countdropretry']=_0x5e26c6[_0x2099('0x13')];this[_0x2099('0x11')]=_0x5e26c6['countabandonedretry'];this[_0x2099('0x14')]=_0x5e26c6[_0x2099('0x14')];this[_0x2099('0x12')]=_0x5e26c6[_0x2099('0x12')];this[_0x2099('0x15')]=_0x169d64['uniqueid'];this[_0x2099('0x16')]=_0x5e26c6[_0x2099('0x17')];this[_0x2099('0x18')]=_0x5e26c6[_0x2099('0x19')];this[_0x2099('0x1a')]=_0x5e26c6[_0x2099('0x1a')];this[_0x2099('0x1b')]=_0x5e26c6[_0x2099('0x1b')];this[_0x2099('0x1c')]=moment()[_0x2099('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x5e26c6[_0x2099('0x1b')],_0x5e26c6['starttime']);this[_0x2099('0x1e')]=0x0;this[_0x2099('0x1f')]=getSeconds(this[_0x2099('0x1c')],_0x5e26c6[_0x2099('0x1b')]);this['queue']=_0x5e26c6[_0x2099('0xb')];this[_0x2099('0x20')]=_0x2099('0x21');this[_0x2099('0x22')]=_0x169d64[_0x2099('0x23')];this[_0x2099('0x24')]=_0x5e26c6[_0x2099('0x24')];this['callbackuniqueid']=_0x5e26c6['callbackuniqueid'];this[_0x2099('0x25')]=_0x5e26c6[_0x2099('0x25')];this[_0x2099('0x26')]=_0x5e26c6[_0x2099('0x26')];this[_0x2099('0x27')]=_0x5e26c6[_0x2099('0x27')];this[_0x2099('0x28')]=_0x5e26c6[_0x2099('0x28')];this[_0x2099('0x29')]=_0x5e26c6[_0x2099('0x29')];this[_0x2099('0x2a')]=_0x5e26c6[_0x2099('0x2a')];this[_0x2099('0x2b')]=_0x5e26c6[_0x2099('0x2b')];}module[_0x2099('0x2c')]=Hangup;
\ No newline at end of file
+var _0x1de8=['seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds'];(function(_0x47b07d,_0x55848e){var _0xf39e0c=function(_0x8b91e1){while(--_0x8b91e1){_0x47b07d['push'](_0x47b07d['shift']());}};_0xf39e0c(++_0x55848e);}(_0x1de8,0x83));var _0x81de=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x1de8[_0x30c7c5];return _0x29e24e;};'use strict';var util=require(_0x81de('0x0'));var _=require(_0x81de('0x1'));var moment=require(_0x81de('0x2'));function getSeconds(_0x4e5186,_0x518d1b){var _0x3d6277=moment(_0x4e5186)[_0x81de('0x3')](0x0);var _0x3e2307=moment(_0x518d1b)['milliseconds'](0x0);return _0x3d6277['diff'](_0x3e2307,_0x81de('0x4'));}function Hangup(_0x269180,_0x1d98a0){this[_0x81de('0x5')]=0x4;this[_0x81de('0x6')]=_0x81de('0x7');this[_0x81de('0x8')]=_0x269180[_0x81de('0x8')];this[_0x81de('0x9')]=_0x269180[_0x81de('0x9')];this['campaigntype']=_0x269180['type']===_0x81de('0xa')?_0x81de('0xb'):_0x269180['type'];this['countbusyretry']=_0x269180['countbusyretry'];this[_0x81de('0xc')]=_0x269180[_0x81de('0xc')];this[_0x81de('0xd')]=_0x269180[_0x81de('0xd')];this[_0x81de('0xe')]=_0x269180['countbusyretry']+_0x269180['countcongestionretry']+_0x269180['countnoanswerretry']+_0x269180['countnosuchnumberretry']+_0x269180[_0x81de('0xf')]+_0x269180[_0x81de('0x10')]+_0x269180['countmachineretry']+_0x269180[_0x81de('0x11')];this[_0x81de('0x12')]=_0x269180[_0x81de('0x12')];this[_0x81de('0xf')]=_0x269180[_0x81de('0xf')];this[_0x81de('0x10')]=_0x269180[_0x81de('0x10')];this[_0x81de('0x13')]=_0x269180['countmachineretry'];this[_0x81de('0x11')]=_0x269180['countagentrejectretry'];this['uniqueid']=_0x1d98a0[_0x81de('0x14')];this[_0x81de('0x15')]=_0x269180[_0x81de('0x16')];this[_0x81de('0x17')]=_0x269180[_0x81de('0x18')];this['starttime']=_0x269180[_0x81de('0x19')];this[_0x81de('0x1a')]=_0x269180['responsetime'];this[_0x81de('0x1b')]=moment()[_0x81de('0x1c')](_0x81de('0x1d'));this[_0x81de('0x1e')]=getSeconds(_0x269180[_0x81de('0x1a')],_0x269180['starttime']);this['holdtime']=0x0;this[_0x81de('0x1f')]=getSeconds(this[_0x81de('0x1b')],_0x269180[_0x81de('0x1a')]);this[_0x81de('0xb')]=_0x269180['queue'];this['membername']=_0x81de('0x20');this[_0x81de('0x21')]=_0x1d98a0[_0x81de('0x22')];this[_0x81de('0x23')]=_0x269180[_0x81de('0x23')];this[_0x81de('0x24')]=_0x269180[_0x81de('0x24')];this['callbackat']=_0x269180[_0x81de('0x25')];this['recallme']=_0x269180[_0x81de('0x26')];this[_0x81de('0x27')]=_0x269180[_0x81de('0x27')];this['ListId']=_0x269180[_0x81de('0x28')];this[_0x81de('0x29')]=_0x269180[_0x81de('0x29')];this[_0x81de('0x2a')]=_0x269180[_0x81de('0x2a')];this[_0x81de('0x2b')]=_0x269180[_0x81de('0x2b')];}module[_0x81de('0x2c')]=Hangup;
\ No newline at end of file
index 221d763..0a4a1d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac63=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x2b4f2e,_0x1b1604){var _0x36eec0=function(_0x76f112){while(--_0x76f112){_0x2b4f2e['push'](_0x2b4f2e['shift']());}};_0x36eec0(++_0x1b1604);}(_0xac63,0x122));var _0x3ac6=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xac63[_0x33032e];return _0x13316b;};'use strict';var util=require('util');var _=require(_0x3ac6('0x0'));var moment=require(_0x3ac6('0x1'));function getSeconds(_0x2d374f,_0x725895){var _0xe5b24c=moment(_0x2d374f)[_0x3ac6('0x2')](0x0);var _0x3b568e=moment(_0x725895)[_0x3ac6('0x2')](0x0);return _0xe5b24c['diff'](_0x3b568e,_0x3ac6('0x3'));}function History(_0x11f598){this[_0x3ac6('0x4')]=_0x11f598[_0x3ac6('0x4')];this['scheduledat']=_0x11f598[_0x3ac6('0x5')]||undefined;this['type']=_0x11f598['type'];this[_0x3ac6('0x6')]=_0x11f598[_0x3ac6('0x7')]===_0x3ac6('0x8')?_0x3ac6('0x9'):_0x11f598[_0x3ac6('0x7')];this[_0x3ac6('0xa')]=_0x11f598['countbusyretry'];this[_0x3ac6('0xb')]=_0x11f598['countcongestionretry'];this[_0x3ac6('0xc')]=_0x11f598[_0x3ac6('0xc')];this['countglobal']=_0x11f598[_0x3ac6('0xa')]+_0x11f598[_0x3ac6('0xb')]+_0x11f598[_0x3ac6('0xc')]+_0x11f598[_0x3ac6('0xd')]+_0x11f598[_0x3ac6('0xe')]+_0x11f598[_0x3ac6('0xf')]+_0x11f598[_0x3ac6('0x10')]+_0x11f598[_0x3ac6('0x11')];this['countnosuchnumberretry']=_0x11f598[_0x3ac6('0xd')];this[_0x3ac6('0xe')]=_0x11f598[_0x3ac6('0xe')];this[_0x3ac6('0xf')]=_0x11f598[_0x3ac6('0xf')];this['countmachineretry']=_0x11f598[_0x3ac6('0x10')];this[_0x3ac6('0x11')]=_0x11f598[_0x3ac6('0x11')];this['queue']=_0x11f598[_0x3ac6('0x9')];this[_0x3ac6('0x12')]=_0x11f598[_0x3ac6('0x13')];this[_0x3ac6('0x14')]=_0x11f598[_0x3ac6('0x15')];this[_0x3ac6('0x16')]=_0x11f598[_0x3ac6('0x16')];this[_0x3ac6('0x17')]=_0x11f598['responsetime'];this['endtime']=_0x11f598[_0x3ac6('0x17')];this['ringtime']=getSeconds(_0x11f598[_0x3ac6('0x17')],_0x11f598[_0x3ac6('0x16')]);this[_0x3ac6('0x18')]=0x0;this[_0x3ac6('0x19')]=0x0;this[_0x3ac6('0x1a')]=_0x11f598[_0x3ac6('0x1a')];this[_0x3ac6('0x1b')]=_0x11f598[_0x3ac6('0x1b')];this[_0x3ac6('0x1c')]=_0x11f598['callbackat'];this[_0x3ac6('0x1d')]=_0x11f598[_0x3ac6('0x1d')];this[_0x3ac6('0x1e')]=_0x11f598[_0x3ac6('0x1e')];this[_0x3ac6('0x1f')]=_0x11f598[_0x3ac6('0x1f')];this[_0x3ac6('0x20')]=_0x11f598[_0x3ac6('0x20')];this[_0x3ac6('0x21')]=_0x11f598[_0x3ac6('0x21')];this[_0x3ac6('0x22')]=_0x11f598['CampaignId'];this['originatecalleridnum']=_0x11f598[_0x3ac6('0x23')]||'';this[_0x3ac6('0x24')]=_0x11f598[_0x3ac6('0x24')]||'';}module[_0x3ac6('0x25')]=History;
\ No newline at end of file
+var _0xd1b7=['countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','calleridnum','responsetime','ringtime','holdtime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry'];(function(_0x14f7b1,_0x401b61){var _0x23620c=function(_0x641a9d){while(--_0x641a9d){_0x14f7b1['push'](_0x14f7b1['shift']());}};_0x23620c(++_0x401b61);}(_0xd1b7,0x9b));var _0x7d1b=function(_0x1b1dc4,_0x363826){_0x1b1dc4=_0x1b1dc4-0x0;var _0x5ee72d=_0xd1b7[_0x1b1dc4];return _0x5ee72d;};'use strict';var util=require(_0x7d1b('0x0'));var _=require(_0x7d1b('0x1'));var moment=require(_0x7d1b('0x2'));function getSeconds(_0x1401b4,_0x3d598f){var _0x17d149=moment(_0x1401b4)['milliseconds'](0x0);var _0x165d1f=moment(_0x3d598f)[_0x7d1b('0x3')](0x0);return _0x17d149['diff'](_0x165d1f,_0x7d1b('0x4'));}function History(_0x5129c6){this['uniqueid']=_0x5129c6['uniqueid'];this[_0x7d1b('0x5')]=_0x5129c6[_0x7d1b('0x5')]||undefined;this[_0x7d1b('0x6')]=_0x5129c6[_0x7d1b('0x6')];this[_0x7d1b('0x7')]=_0x5129c6[_0x7d1b('0x6')]===_0x7d1b('0x8')?_0x7d1b('0x9'):_0x5129c6[_0x7d1b('0x6')];this[_0x7d1b('0xa')]=_0x5129c6[_0x7d1b('0xa')];this[_0x7d1b('0xb')]=_0x5129c6[_0x7d1b('0xb')];this[_0x7d1b('0xc')]=_0x5129c6['countnoanswerretry'];this[_0x7d1b('0xd')]=_0x5129c6[_0x7d1b('0xa')]+_0x5129c6[_0x7d1b('0xb')]+_0x5129c6[_0x7d1b('0xc')]+_0x5129c6['countnosuchnumberretry']+_0x5129c6[_0x7d1b('0xe')]+_0x5129c6['countabandonedretry']+_0x5129c6[_0x7d1b('0xf')]+_0x5129c6[_0x7d1b('0x10')];this['countnosuchnumberretry']=_0x5129c6[_0x7d1b('0x11')];this['countdropretry']=_0x5129c6[_0x7d1b('0xe')];this[_0x7d1b('0x12')]=_0x5129c6['countabandonedretry'];this[_0x7d1b('0xf')]=_0x5129c6[_0x7d1b('0xf')];this['countagentrejectretry']=_0x5129c6[_0x7d1b('0x10')];this[_0x7d1b('0x9')]=_0x5129c6[_0x7d1b('0x9')];this[_0x7d1b('0x13')]=_0x5129c6[_0x7d1b('0x14')];this[_0x7d1b('0x15')]=_0x5129c6['number'];this['starttime']=_0x5129c6['starttime'];this[_0x7d1b('0x16')]=_0x5129c6[_0x7d1b('0x16')];this['endtime']=_0x5129c6['responsetime'];this[_0x7d1b('0x17')]=getSeconds(_0x5129c6[_0x7d1b('0x16')],_0x5129c6['starttime']);this[_0x7d1b('0x18')]=0x0;this['talktime']=0x0;this[_0x7d1b('0x19')]=_0x5129c6[_0x7d1b('0x19')];this['callbackuniqueid']=_0x5129c6['callbackuniqueid'];this[_0x7d1b('0x1a')]=_0x5129c6['callbackat'];this[_0x7d1b('0x1b')]=_0x5129c6[_0x7d1b('0x1b')];this['ContactId']=_0x5129c6[_0x7d1b('0x1c')];this[_0x7d1b('0x1d')]=_0x5129c6['ListId'];this[_0x7d1b('0x1e')]=_0x5129c6[_0x7d1b('0x1e')];this[_0x7d1b('0x1f')]=_0x5129c6[_0x7d1b('0x1f')];this['CampaignId']=_0x5129c6['CampaignId'];this[_0x7d1b('0x20')]=_0x5129c6[_0x7d1b('0x20')]||'';this['originatecalleridname']=_0x5129c6[_0x7d1b('0x21')]||'';}module['exports']=History;
\ No newline at end of file
index ffd4d6c..30d78a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a55=['---------\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','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','Action','channel','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','ContactId','ListId','UserId','CampaignId','isSuccess','isTrunkReachable','active','trunks','SIP/%s','status','reachable','unmonitored','saveInDb','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','add','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','dropreason','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actions','actionid','roundrobin','locked','paused','stateinterface','rrmemory','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','length','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','isArray','command','iftime\x20%s,%s','interval','timezones','indexOf','true','some','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','Queue','launchHandleIvr','handleIvr','dialMethod','dialGlobalInterval','dialTimezone','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAvgHoldtime','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','RUNNING','[actionOriginate]\x20','Contact.phone','dialLimitQueue','dialOrderByScheduledAt','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\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]','interval\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','newexten','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','[ifTime][Action]','Error','milliseconds','diff','seconds','emit','type','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty'];(function(_0x38cc8a,_0x245f10){var _0x1a7826=function(_0x2aa6bb){while(--_0x2aa6bb){_0x38cc8a['push'](_0x38cc8a['shift']());}};_0x1a7826(++_0x245f10);}(_0x8a55,0x185));var _0x58a5=function(_0x51a453,_0x2c8f72){_0x51a453=_0x51a453-0x0;var _0x381239=_0x8a55[_0x51a453];return _0x381239;};'use strict';var util=require(_0x58a5('0x0'));var _=require(_0x58a5('0x1'));var BPromise=require(_0x58a5('0x2'));var uuid=require(_0x58a5('0x3'));var moment=require(_0x58a5('0x4'));var rr=require('rr');var md5=require(_0x58a5('0x5'));var Redis=require(_0x58a5('0x6'));var ut=require(_0x58a5('0x7'));var config=require('../../../config/environment/');var logger=require(_0x58a5('0x8'))(_0x58a5('0x9'));var loggerBooked=require(_0x58a5('0x8'))(_0x58a5('0xa'));var loggerPredictive=require(_0x58a5('0x8'))(_0x58a5('0xb'));var loggerPredictiveCalls=require(_0x58a5('0x8'))(_0x58a5('0xc'));var loggerSyncQueueSummary=require(_0x58a5('0x8'))('syncQueueSummary');var ami=require(_0x58a5('0xd'));config[_0x58a5('0xe')]=_[_0x58a5('0xf')](config[_0x58a5('0xe')],{'host':_0x58a5('0x10'),'port':0x18eb});var io=require(_0x58a5('0x11'))(new Redis(config[_0x58a5('0xe')]));var cmHopper=require(_0x58a5('0x12'));var cmHopperHistory=require(_0x58a5('0x13'));var cmHopperBlack=require(_0x58a5('0x14'));var voiceQueueRt=require(_0x58a5('0x15'));var Action=require(_0x58a5('0x16'));var History=require(_0x58a5('0x17'));var Final=require(_0x58a5('0x18'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x58a5('0x19'));var Hangup=require(_0x58a5('0x1a'));var ipAgi=process[_0x58a5('0x1b')][_0x58a5('0x1c')]||_0x58a5('0x1d');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x58a5('0x1e')][_0x58a5('0x1f')]=function(_0x47e3f5){this[_0x58a5('0x20')]=this[_0x58a5('0x20')]?this['tail'][_0x58a5('0x21')](_0x47e3f5):_0x47e3f5();};function Dialer(_0x42ea0c,_0x4f8e3f){this[_0x58a5('0x22')]=new Sequence();this[_0x58a5('0x23')]=_0x4f8e3f;this['voiceQueues']=_0x42ea0c[_0x58a5('0x24')];this[_0x58a5('0x25')]=_0x42ea0c['campaigns'];this['agents']=_0x42ea0c[_0x58a5('0x26')];this['trunks']=_0x42ea0c['trunks'];this['maxNumberOriginate']=config[_0x58a5('0x27')]||0x2;this[_0x58a5('0x28')]={};this['actions']={};this[_0x58a5('0x29')]={};this[_0x58a5('0x2a')]={};this[_0x58a5('0x2b')]={};this['startPredictive']={};this[_0x58a5('0x2c')]={};this[_0x58a5('0x2d')]={};this[_0x58a5('0x2e')]={};this[_0x58a5('0x2f')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x31'),this[_0x58a5('0x32')]['bind'](this));ami['on']('originateresponse',this[_0x58a5('0x33')][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x34'),this[_0x58a5('0x35')][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x36'),this[_0x58a5('0x37')]['bind'](this));ami['on'](_0x58a5('0x38'),this['syncHangup'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x39'),this['syncNewExten'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x3a'),this['syncVarSet'][_0x58a5('0x30')](this));ami['on'](_0x58a5('0x3b'),this[_0x58a5('0x3c')]['bind'](this));ami['on'](_0x58a5('0x3d'),this[_0x58a5('0x3e')][_0x58a5('0x30')](this));this[_0x58a5('0x3f')]();this[_0x58a5('0x40')]();}function isNotNull(_0x5bbb59){return _0x5bbb59!==null&&!_[_0x58a5('0x41')](_0x5bbb59);}function checkIsLoggedIn(_0x2912bc,_0x11efc4){return function(){if(_0x11efc4<=0x0){_0x2912bc[_0x58a5('0x42')]=_0x58a5('0x43');throw _0x2912bc[_0x58a5('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x3df480){return _0x3df480;}function checkIsActive(_0x47f85,_0x3f7659){return function(){if(!isActive(_0x3f7659)){_0x47f85[_0x58a5('0x42')]=_0x58a5('0x45');throw _0x47f85[_0x58a5('0x44')]+_0x58a5('0x46');}};}function checkInterval(_0x404605){return function(){if(!isNotNull(_0x404605[_0x58a5('0x47')])){_0x404605[_0x58a5('0x42')]=_0x58a5('0x48');throw _0x404605['name']+_0x58a5('0x49');}if(!isNotNull(_0x404605[_0x58a5('0x47')]['Intervals'])){_0x404605[_0x58a5('0x42')]=_0x58a5('0x48');throw _0x404605['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x404605['Interval'][_0x58a5('0x4a')]))){_0x404605[_0x58a5('0x42')]='INTERVAL_IS_NULL';throw _0x404605[_0x58a5('0x44')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x748650,_0x5dbef6,_0x41fa38){return{'action':_0x748650,'response':_0x5dbef6,'message':_0x41fa38,'stack':_0x41fa38};}function myreject(_0x297076){return function(_0x3a8b94){return _0x297076(msgResponse(_0x58a5('0x4b'),_0x58a5('0x4c'),JSON['stringify'](_0x3a8b94)));};}function getSeconds(_0xa367b1,_0x55f69b){var _0x5c46f8=moment(_0xa367b1)[_0x58a5('0x4d')](0x0);var _0x186ebe=moment(_0x55f69b)[_0x58a5('0x4d')](0x0);return _0x5c46f8[_0x58a5('0x4e')](_0x186ebe,_0x58a5('0x4f'));}function emit(_0x1d8255,_0x6a2f20,_0x9b7db8){io['to'](_0x1d8255)[_0x58a5('0x50')](_0x6a2f20,_0x9b7db8);}function emitVoiceQueueSummary(_0x3cbdea){if(_0x3cbdea[_0x58a5('0x51')]==='outbound'){var _0x135915={'id':_0x3cbdea['id'],'name':_0x3cbdea['name'],'strategy':_0x3cbdea[_0x58a5('0x52')],'answered':_0x3cbdea['answered'],'available':_0x3cbdea[_0x58a5('0x53')],'loggedIn':_0x3cbdea[_0x58a5('0x54')],'pTalking':_0x3cbdea[_0x58a5('0x55')],'sumBillable':_0x3cbdea[_0x58a5('0x56')],'sumDuration':_0x3cbdea[_0x58a5('0x57')],'sumHoldTime':_0x3cbdea[_0x58a5('0x58')]||0x0,'talking':_0x3cbdea[_0x58a5('0x59')],'total':_0x3cbdea['total'],'type':_0x3cbdea[_0x58a5('0x51')],'unmanaged':_0x3cbdea['unmanaged'],'abandoned':_0x3cbdea[_0x58a5('0x5a')],'waiting':_0x3cbdea[_0x58a5('0x5b')],'loggedInDb':_0x3cbdea[_0x58a5('0x5c')],'dialActive':_0x3cbdea[_0x58a5('0x5d')],'dialMethod':_0x3cbdea['dialMethod'],'dialOriginateCallerIdName':_0x3cbdea['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3cbdea[_0x58a5('0x5e')],'dialOriginateTimeout':_0x3cbdea[_0x58a5('0x5f')],'dialPrefix':_0x3cbdea[_0x58a5('0x60')],'outboundAnswerAgiCallsDay':_0x3cbdea['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x3cbdea['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3cbdea['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3cbdea[_0x58a5('0x61')],'outboundCongestionCallsDay':_0x3cbdea[_0x58a5('0x62')],'outboundDropCallsDayACS':_0x3cbdea['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cbdea[_0x58a5('0x63')],'outboundDropCallsDayTimeout':_0x3cbdea[_0x58a5('0x64')],'outboundNoAnswerCallsDay':_0x3cbdea[_0x58a5('0x65')],'outboundNoSuchCallsDay':_0x3cbdea[_0x58a5('0x66')],'outboundOriginateFailureCallsDay':_0x3cbdea[_0x58a5('0x67')],'outboundReCallsDay':_0x3cbdea[_0x58a5('0x68')],'outboundRejectCallsDay':_0x3cbdea[_0x58a5('0x69')],'outboundUnknownCallsDay':_0x3cbdea[_0x58a5('0x6a')],'predictiveIntervalAnsweredCalls':_0x3cbdea[_0x58a5('0x6b')],'predictiveIntervalAvgHoldtime':_0x3cbdea['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3cbdea[_0x58a5('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x3cbdea[_0x58a5('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x3cbdea[_0x58a5('0x6e')],'predictiveIntervalErlangCalls':_0x3cbdea['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3cbdea[_0x58a5('0x6f')],'predictiveIntervalHitRate':_0x3cbdea[_0x58a5('0x70')],'predictiveIntervalMultiplicativeFactor':_0x3cbdea[_0x58a5('0x71')],'predictiveIntervalPauses':_0x3cbdea[_0x58a5('0x72')],'predictiveIntervalAvailable':_0x3cbdea[_0x58a5('0x73')],'predictiveIntervalTotalCalls':_0x3cbdea[_0x58a5('0x74')],'message':_0x3cbdea['message'],'originated':_0x3cbdea[_0x58a5('0x75')],'erlangCalls':_0x3cbdea[_0x58a5('0x76')],'erlangCallToSecond':_0x3cbdea[_0x58a5('0x77')],'erlangAbandonmentRate':_0x3cbdea[_0x58a5('0x78')],'erlangBusyFactor':_0x3cbdea[_0x58a5('0x79')],'startPredictive':_0x3cbdea[_0x58a5('0x7a')],'startProgressive':_0x3cbdea[_0x58a5('0x2c')]};if(_0x3cbdea[_0x58a5('0x7b')]){_0x135915[_0x58a5('0x7b')]={'id':_0x3cbdea[_0x58a5('0x7b')]['id'],'name':_0x3cbdea[_0x58a5('0x7b')][_0x58a5('0x44')],'active':_0x3cbdea[_0x58a5('0x7b')]['active'],'callerid':_0x3cbdea[_0x58a5('0x7b')][_0x58a5('0x7c')]};}if(_0x3cbdea[_0x58a5('0x47')]){_0x135915['Interval']={'id':_0x3cbdea[_0x58a5('0x47')]['id'],'name':_0x3cbdea[_0x58a5('0x47')][_0x58a5('0x44')]};}var _0x381426=md5(JSON[_0x58a5('0x7d')](_0x135915));if(_0x3cbdea[_0x58a5('0x5')]!==_0x381426){_0x3cbdea['md5']=_0x381426;emit(util[_0x58a5('0x7e')](_0x58a5('0x7f'),_0x135915[_0x58a5('0x44')]),_0x58a5('0x80'),_0x135915);}}}function emitCampaignSummary(_0x2a2bd1){if(_0x2a2bd1[_0x58a5('0x51')]===_0x58a5('0x81')){emit(util['format'](_0x58a5('0x82'),_0x2a2bd1['name']),_0x58a5('0x83'),_0x2a2bd1);}}function checkGetDataPredictive(_0x266a78){if(isNotNull(_0x266a78)&&!_[_0x58a5('0x84')](_0x266a78)){loggerPredictive['info'](_0x58a5('0x85'));loggerPredictive['info'](_0x58a5('0x86'),_0x266a78[_0x58a5('0x74')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6b')]);loggerPredictive[_0x58a5('0x87')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6e')]);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x88'),_0x266a78[_0x58a5('0x6d')]);loggerPredictive[_0x58a5('0x87')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x266a78[_0x58a5('0x6c')]);loggerPredictive[_0x58a5('0x87')]('---------------------------');if(_0x266a78['predictiveIntervalTotalCalls']>0x0){if(!_[_0x58a5('0x41')](_0x266a78[_0x58a5('0x6c')])&&_0x266a78[_0x58a5('0x6c')]>0x0){return!![];}loggerPredictive[_0x58a5('0x87')](_0x58a5('0x89'));if(!_[_0x58a5('0x41')](_0x266a78['predictiveIntervalAvgHoldtime'])&&_0x266a78['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8a'));}else{loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8b'));}}else{loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8c'));}return![];}function mergeDataErlangB(_0x399ff6){return function(_0x49f66f){loggerPredictive[_0x58a5('0x87')](_0x58a5('0x8d'));loggerPredictive['info'](_0x58a5('0x8e'),_0x49f66f[_0x58a5('0x76')]);loggerPredictive['info'](_0x58a5('0x8f'),_0x49f66f[_0x58a5('0x77')]);loggerPredictive[_0x58a5('0x87')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f[_0x58a5('0x78')]);loggerPredictive[_0x58a5('0x87')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f['erlangBusyFactor']);loggerPredictive[_0x58a5('0x87')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49f66f[_0x58a5('0x78')]);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x90'));_[_0x58a5('0x91')](_0x399ff6,_0x49f66f);};}function getDiff(_0x53bd51){var _0x2b6672=moment()[_0x58a5('0x4d')](0x0);var _0x1af2de=moment(_0x53bd51)[_0x58a5('0x4d')](0x0);return _0x2b6672[_0x58a5('0x4e')](_0x1af2de,_0x58a5('0x4f'));}function ifInterval(_0x5b4a90,_0x49621d){if(_[_0x58a5('0x41')](_0x49621d)){return![];}return getDiff(_0x49621d)<_0x5b4a90*0x3c;}function freeVariablesPredictive(_0x12d43e){if(isNotNull(_0x12d43e)){if(!_[_0x58a5('0x41')](_0x12d43e[_0x58a5('0x2c')])){_0x12d43e[_0x58a5('0x2c')]=undefined;loggerPredictive['info'](_0x12d43e[_0x58a5('0x44')],_0x58a5('0x92'));}if(!_['isUndefined'](_0x12d43e[_0x58a5('0x7a')])){_0x12d43e[_0x58a5('0x7a')]=undefined;loggerPredictive[_0x58a5('0x87')](_0x12d43e['name'],_0x58a5('0x93'));}if(!_[_0x58a5('0x41')](_0x12d43e['handlePredictive'])){clearInterval(_0x12d43e['handlePredictive']);_0x12d43e[_0x58a5('0x94')]=undefined;loggerPredictive[_0x58a5('0x87')](_0x12d43e['name'],_0x58a5('0x95'));}}}function erlangb(_0x3bb87c,_0x19aa86){if(_0x19aa86===0x0){return 0x0;}var _0xcfea87=0x1;for(var _0x4f9b45=0x1;_0x4f9b45<=_0x19aa86;_0x4f9b45+=0x1){_0xcfea87=0x1+_0xcfea87*_0x4f9b45/_0x3bb87c;}return 0x1/_0xcfea87;}function isVoiceQueueOutbound(_0x455f2e){return _0x455f2e===_0x58a5('0x96');}function isNotPreview(_0x3d7030){return _0x3d7030!==_0x58a5('0x23');}function isCampaignIvr(_0x225866){return _0x225866===_0x58a5('0x81');}function getCallerId(_0x4fe8b9,_0x2ce6f1,_0x5d719d){if(!_[_0x58a5('0x41')](_0x5d719d)&&typeof _0x5d719d===_0x58a5('0x97')&&!_['isEmpty'](_0x5d719d)){if(!_[_0x58a5('0x41')](_0x2ce6f1)&&typeof _0x2ce6f1==='string'&&!_[_0x58a5('0x84')](_0x2ce6f1)){return util[_0x58a5('0x7e')](_0x58a5('0x98'),_0x2ce6f1,_0x5d719d);}return util[_0x58a5('0x7e')](_0x58a5('0x98'),_0x5d719d,_0x5d719d);}if(!_[_0x58a5('0x41')](_0x4fe8b9)&&typeof _0x4fe8b9===_0x58a5('0x97')&&!_[_0x58a5('0x84')](_0x4fe8b9)){return _0x4fe8b9;}return _0x58a5('0x99');}function loggerCatchQueueSummary(_0x1c0cd5,_0x150160){return function(_0x1a2af7){freeVariablesPredictive(_0x150160);emitVoiceQueueSummary(_0x150160);emitCampaignSummary(_0x150160);loggerSyncQueueSummary[_0x58a5('0x9a')](_0x1c0cd5,util[_0x58a5('0x9b')](_0x1a2af7,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2f9ffa,_0xfdc5ac){return function(_0x132189){loggerPredictive['error'](_0xfdc5ac[_0x58a5('0x44')],_0x2f9ffa);loggerPredictive['error'](_0x132189[_0x58a5('0x9c')]);freeVariablesPredictive(_0xfdc5ac);};}function loggerCatch(_0x3ba9c1){return function(_0x48b0c1){logger['error'](_0x3ba9c1,util[_0x58a5('0x9b')](_0x48b0c1,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xc6d36b){return _0xc6d36b&&!_['isUndefined'](_0xc6d36b)&&_0xc6d36b['length']>0x0;}function decremetOriginate(_0x1c16f6){if(!_[_0x58a5('0x41')](_0x1c16f6)&&_0x1c16f6!==null){if(typeof _0x1c16f6[_0x58a5('0x75')]!==_0x58a5('0x9d')){if(_0x1c16f6['originated']>0x0){_0x1c16f6[_0x58a5('0x75')]-=0x1;}else{logger[_0x58a5('0x9a')](_0x58a5('0x9e'));}}}else{logger[_0x58a5('0x9a')](_0x58a5('0x9f'));}}function checkContactLowerLimitOriginate(_0x34b372,_0x3be9bb,_0x59430d){if(_0x3be9bb>_0x59430d){for(var _0x432ba8=0x0;_0x432ba8<_0x3be9bb-_0x59430d;_0x432ba8+=0x1){decremetOriginate(_0x34b372);}}}function loggerGetContactDialer(_0x5d85ce,_0x4688c8,_0x12263f){return function(_0x8994b){checkContactLowerLimitOriginate(_0x4688c8,_0x12263f,0x0);logger[_0x58a5('0x9a')](_0x5d85ce,util[_0x58a5('0x9b')](_0x8994b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5ae32a){return function(_0x5ed013){if(isNotNull(_0x5ed013)&&isNotNull(_0x5ed013[0x0])){if(_0x5ed013[0x0][_0x58a5('0xa0')]>0x0){_0x5ae32a[_0x58a5('0x42')]=_0x58a5('0xa1');logger[_0x58a5('0x87')]('[getContactDialer2][ReScheduled]'+_0x5ae32a[_0x58a5('0x44')],_0x5ed013[0x0][_0x58a5('0xa0')],'contacts');}else{_0x5ae32a[_0x58a5('0x42')]=_0x58a5('0xa2');logger[_0x58a5('0x87')](_0x58a5('0xa3')+_0x5ae32a[_0x58a5('0x44')]);}}};}function notSendMessagesQueue(_0x19eb07){if(_0x19eb07[_0x58a5('0xa4')]){freeVariablesPredictive(_0x19eb07);if(_0x19eb07[_0x58a5('0x75')]===0x0&&_0x19eb07[_0x58a5('0x59')]===0x0&&_0x19eb07[_0x58a5('0x5b')]===0x0&&(_0x19eb07[_0x58a5('0x55')]||0x0)===0x0){_0x19eb07[_0x58a5('0xa4')]=![];_0x19eb07[_0x58a5('0x53')]=0x0;_0x19eb07[_0x58a5('0x42')]=_0x58a5('0x45');loggerSyncQueueSummary[_0x58a5('0x9a')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x19eb07[_0x58a5('0x44')],_0x58a5('0xa5'));}else{_0x19eb07[_0x58a5('0x42')]=_0x58a5('0xa6');loggerSyncQueueSummary['error'](_0x58a5('0xa7'),_0x19eb07[_0x58a5('0x44')],'is\x20disactive');}emitVoiceQueueSummary(_0x19eb07);}}function notSendMessagesCampaign(_0x23ee41){if(_0x23ee41[_0x58a5('0xa4')]){if(_0x23ee41['originated']===0x0){_0x23ee41[_0x58a5('0xa4')]=![];_0x23ee41[_0x58a5('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x58a5('0x9a')](_0x58a5('0xa8'),_0x23ee41[_0x58a5('0x44')],'is\x20not\x20active');}else{_0x23ee41[_0x58a5('0x42')]=_0x58a5('0xa6');loggerSyncQueueSummary[_0x58a5('0x9a')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x23ee41[_0x58a5('0x44')],'is\x20disactive');}emitCampaignSummary(_0x23ee41);}}function createObjHistory(_0x28d3a9,_0x44ed56,_0x58e9ac,_0x1fea06,_0xe0f6a5){_0x28d3a9[_0x58a5('0x42')]=_0x58e9ac;var _0x56df94=new Action(_0x28d3a9,_0x44ed56);var _0x2bc036=new History(_0x56df94);_0x2bc036[_0x58a5('0xa9')]=_0x1fea06;_0x2bc036[_0x58a5('0xaa')]=_0xe0f6a5;_0x2bc036[_0x58a5('0xab')]=_0x56df94[_0x58a5('0xac')];return _0x2bc036;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0xc535d2=this;setInterval(function(){_0xc535d2[_0x58a5('0xad')](_0xc535d2[_0x58a5('0x2a')],_0x58a5('0xae'));_0xc535d2[_0x58a5('0xad')](_0xc535d2['actions'],_0x58a5('0xaf'));},0x32c8);};Dialer[_0x58a5('0x1e')][_0x58a5('0xad')]=function(_0x4c3fe8,_0x3649ce){var _0x1ef39e=this;for(var _0x135073 in _0x4c3fe8){if(typeof _0x4c3fe8[_0x135073]!=='undefined'){this[_0x58a5('0x22')]['enqueue'](function(){if(!_['isNil'](_0x4c3fe8[_0x135073])){return ami[_0x58a5('0xb0')]({'action':'status','channel':_0x4c3fe8[_0x135073][_0x58a5('0xb1')]})['catch'](function(_0x1dcbfa){if(_0x1dcbfa[_0x58a5('0x42')]===_0x58a5('0xb2')){setTimeout(function(){if(_0x4c3fe8[_0x135073]&&_0x4c3fe8[_0x135073][_0x58a5('0x51')]!=='ivr'){_0x1ef39e[_0x58a5('0xb3')](_0x1ef39e[_0x58a5('0x24')][_0x4c3fe8[_0x135073][_0x58a5('0xb4')]]);logger[_0x58a5('0x9a')]('[Dialer][checkChannel]',_0x3649ce,_0x135073,_0x4c3fe8[_0x135073]['queue']);delete _0x4c3fe8[_0x135073];}if(_0x4c3fe8[_0x135073]&&_0x4c3fe8[_0x135073][_0x58a5('0x51')]===_0x58a5('0x81')){_0x1ef39e['updateOriginated'](_0x1ef39e[_0x58a5('0x25')][_0x4c3fe8[_0x135073][_0x58a5('0xb4')]]);logger[_0x58a5('0x9a')]('[Dialer][checkChannel][ivr]',_0x3649ce,_0x135073,_0x4c3fe8[_0x135073][_0x58a5('0xb4')]);delete _0x4c3fe8[_0x135073];}},0x2328);}});}});}}};Dialer[_0x58a5('0x1e')][_0x58a5('0xb5')]=function(_0x5b201f){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xb5')](_0x5b201f))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xb9')));};Dialer[_0x58a5('0x1e')]['checkIsBlackList']=function(_0x390c28){return BPromise['resolve']()[_0x58a5('0xb7')](cmHopperBlack[_0x58a5('0xba')](_0x390c28))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xbb')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xbc')]=function(_0x9e9861){return BPromise['resolve']()['then'](cmHopperBlack[_0x58a5('0xbc')](_0x9e9861))[_0x58a5('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x58a5('0xbd')]=function(_0x2318be){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopperHistory[_0x58a5('0xbe')](_0x2318be))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xbf')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xc0')]=function(_0x32c9f1){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc0')](_0x32c9f1))[_0x58a5('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x58a5('0xc1')]=function(_0x1d9523,_0x4dff37,_0x484f0d){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0x1d9523,_0x4dff37,_0x484f0d))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xc2')));};Dialer['prototype'][_0x58a5('0xc3')]=function(_0x47b75c,_0x15d04a,_0x443899,_0x5be114,_0x3824d2){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc3')](_0x47b75c,_0x15d04a,_0x443899,_0x5be114))[_0x58a5('0xb8')](function(_0x22c08d){_0x3824d2['temp']-=_0x443899;_0x3824d2[_0x58a5('0xc4')]=_0x3824d2['temp']>0x0?_0x3824d2[_0x58a5('0xc4')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x22c08d);});};Dialer[_0x58a5('0x1e')][_0x58a5('0xc5')]=function(_0xe35124,_0x3db109,_0x4172e0,_0x4a5d4b){return BPromise[_0x58a5('0xb6')]()['then'](cmHopper[_0x58a5('0xc5')](_0xe35124,_0x3db109,_0x4172e0))[_0x58a5('0xb8')](function(_0x589979){_0x4a5d4b[_0x58a5('0xc4')]-=_0x3db109;_0x4a5d4b[_0x58a5('0xc4')]=_0x4a5d4b[_0x58a5('0xc4')]>0x0?_0x4a5d4b[_0x58a5('0xc4')]:0x0;loggerCatch(_0x58a5('0xc6'))(_0x589979);});};Dialer[_0x58a5('0x1e')]['getVoiceQueueRtPauses']=function(_0x1244d4){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](voiceQueueRt[_0x58a5('0xc7')](_0x1244d4))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xc8')));};Dialer[_0x58a5('0x1e')][_0x58a5('0xc9')]=function(_0x2c9ca4){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopper[_0x58a5('0xc9')](_0x2c9ca4))[_0x58a5('0xb8')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x58a5('0x1e')][_0x58a5('0xca')]=function(_0x3aa8da){return BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](cmHopperHistory[_0x58a5('0xca')](_0x3aa8da))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0xcb')));};Dialer['prototype'][_0x58a5('0xb3')]=function(_0x5ba77f){if(!_[_0x58a5('0x41')](_0x5ba77f)&&_0x5ba77f!==null){if(typeof _0x5ba77f[_0x58a5('0x75')]!=='undefined'){if(_0x5ba77f['originated']>0x0){_0x5ba77f[_0x58a5('0x75')]-=0x1;}else{logger[_0x58a5('0x9a')](_0x58a5('0xcc'));}}}else{logger[_0x58a5('0x9a')](_0x58a5('0xcd'));}};Dialer[_0x58a5('0x1e')][_0x58a5('0xce')]=function(_0x583322,_0x126166){var _0x58b42b=this;return function(_0x579114){_0x58b42b[_0x58a5('0xb3')](_0x126166);logger[_0x58a5('0x9a')](_0x583322,util['inspect'](_0x579114,{'showHidden':![],'depth':null}));};};Dialer[_0x58a5('0x1e')][_0x58a5('0xcf')]=function(_0xa7b938,_0x1ffd17,_0x40fea9){var _0x1a8bb5={'state':0x19,'statedesc':_0x58a5('0xd0')};this[_0x58a5('0xb3')](_0x1ffd17);this['saveInDb'](_[_0x58a5('0x91')](_0x1a8bb5,_[_0x58a5('0xd1')](_0x40fea9,[_0x58a5('0xd2'),_0x58a5('0xd3'),_0x58a5('0xd4'),'VoiceQueueId',_0x58a5('0xd5')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x58a5('0x9a')](_0xa7b938);};Dialer[_0x58a5('0x1e')][_0x58a5('0xd6')]=function(_0x555dbb){return _0x555dbb==='Success';};Dialer['prototype'][_0x58a5('0xd7')]=function(_0x266c1e){return!_[_0x58a5('0x41')](_0x266c1e)&&_0x266c1e&&!_[_0x58a5('0x41')](_0x266c1e[_0x58a5('0x44')])&&!_[_0x58a5('0x41')](_0x266c1e[_0x58a5('0xd8')])&&_0x266c1e['active']&&(this[_0x58a5('0xd9')][util['format'](_0x58a5('0xda'),_0x266c1e[_0x58a5('0x44')])][_0x58a5('0xdb')]===_0x58a5('0xdc')||this['trunks'][util[_0x58a5('0x7e')](_0x58a5('0xda'),_0x266c1e[_0x58a5('0x44')])][_0x58a5('0xdb')]===_0x58a5('0xdd'));};Dialer[_0x58a5('0x1e')][_0x58a5('0xde')]=function(_0x133d4f,_0x5ddb24,_0x2dc6c7){this[_0x58a5('0xca')](_0x133d4f)['catch'](loggerCatch(_0x5ddb24));this[_0x58a5('0xc9')](_0x133d4f)['catch'](loggerCatch(_0x2dc6c7));};Dialer[_0x58a5('0x1e')][_0x58a5('0xdf')]=function(_0x11d4e8){var _0x21eb31=this[_0x58a5('0x2a')][_0x11d4e8[_0x58a5('0xe0')]];var _0x324cb7;if(!_[_0x58a5('0xe1')](_0x11d4e8)&&!_[_0x58a5('0xe1')](_0x11d4e8[_0x58a5('0xe2')])&&!_[_0x58a5('0xe1')](_0x11d4e8[_0x58a5('0xe2')][_0x58a5('0xe3')])&&_0x11d4e8[_0x58a5('0xe4')]==='xcally-motion-dialer'&&_0x21eb31){if(_0x21eb31[_0x58a5('0x51')]!==_0x58a5('0x81')&&this[_0x58a5('0x24')][_0x21eb31['queue']][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xe7')){delete this['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]);this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;this['voiceQueues'][_0x21eb31['queue']][_0x58a5('0xe9')]+=0x1;_0x324cb7=new Hangup(_0x21eb31,_0x11d4e8);_0x324cb7[_0x58a5('0xa9')]=0x12;_0x324cb7[_0x58a5('0xaa')]=_0x58a5('0xea');_0x324cb7[_0x58a5('0xeb')]=_0x58a5('0xec');ami[_0x58a5('0x50')](_0x58a5('0xed'),ut['buildObj'](_0x324cb7,_0x58a5('0xee')));this['saveInDb'](_0x324cb7,_0x58a5('0xef'),_0x58a5('0xf0'));}if(_0x21eb31[_0x58a5('0x51')]!==_0x58a5('0x81')&&this[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xf1')){var _0x8fd0ee=this;return new BPromise(function(_0x54462e,_0x3b9e4c){delete _0x8fd0ee['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];_0x8fd0ee[_0x58a5('0xb3')](_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]);_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe9')]+=0x1;var _0x23c082=_0x8fd0ee[_0x58a5('0x24')][_0x21eb31[_0x58a5('0xb4')]];var _0x1daa00=new Hangup(_0x21eb31,_0x11d4e8);_0x1daa00[_0x58a5('0xa9')]=0x13;_0x1daa00[_0x58a5('0xaa')]=_0x58a5('0xf2');_0x1daa00[_0x58a5('0xeb')]=_0x58a5('0xec');_0x1daa00[_0x58a5('0xf3')]+=0x1;_0x1daa00[_0x58a5('0xf4')]+=0x1;_0x1daa00[_0x58a5('0xee')]=!![];ami[_0x58a5('0x50')](_0x58a5('0xed'),ut[_0x58a5('0xf5')](_0x1daa00,_0x58a5('0xee')));_0x8fd0ee[_0x58a5('0xca')](_0x1daa00)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1daa00['countbusyretry']+_0x1daa00[_0x58a5('0xf6')]+_0x1daa00[_0x58a5('0xf7')]+_0x1daa00[_0x58a5('0xf8')]+_0x1daa00[_0x58a5('0xf9')]+_0x1daa00[_0x58a5('0xfa')]+_0x1daa00[_0x58a5('0xf3')]+_0x1daa00[_0x58a5('0xfb')]>=_0x23c082[_0x58a5('0xfc')]){_0x8fd0ee[_0x58a5('0xfd')](_0x1daa00,_0x54462e,_0x3b9e4c,'reason19\x20machine....');}else{if(_0x1daa00['countmachineretry']>=_0x23c082[_0x58a5('0xfe')]){_0x8fd0ee['createStateFinal'](_0x1daa00,_0x54462e,_0x3b9e4c,'reason\x2019\x20machine....');}else{_0x8fd0ee[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x1daa00[_0x58a5('0xf3')],'scheduledat':moment()[_0x58a5('0xff')](_0x23c082['dialMachineRetryFrequency'],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x1daa00[_0x58a5('0xd2')],'ListId':_0x1daa00[_0x58a5('0xd3')],'VoiceQueueId':_0x1daa00[_0x58a5('0x102')]||undefined,'CampaignId':_0x1daa00[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x54462e({'reschedule':0x1});}}});}if(_0x21eb31[_0x58a5('0x51')]===_0x58a5('0x81')&&this[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe5')]&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xe7')){delete this['uniqueId'][_0x11d4e8['uniqueid']];this['updateOriginated'](this[_0x58a5('0x25')][_0x21eb31['queue']]);_0x324cb7=new Hangup(_0x21eb31,_0x11d4e8);_0x324cb7[_0x58a5('0xa9')]=0x12;_0x324cb7['statedesc']=_0x58a5('0xea');_0x324cb7[_0x58a5('0xeb')]=_0x58a5('0xec');ami[_0x58a5('0x50')]('custom:amd',ut[_0x58a5('0xf5')](_0x324cb7,_0x58a5('0xee')));this[_0x58a5('0xde')](_0x324cb7,'[syncHangupInAMDIvr][createHistory]',_0x58a5('0x103'));}if(_0x21eb31[_0x58a5('0x51')]===_0x58a5('0x81')&&this[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]]['dialAMDActive']&&_0x11d4e8[_0x58a5('0xe6')]===_0x58a5('0xf1')){var _0x8fd0ee=this;return new BPromise(function(_0x5d91e4,_0x4a6a14){delete _0x8fd0ee['uniqueId'][_0x11d4e8[_0x58a5('0xe0')]];_0x8fd0ee[_0x58a5('0xb3')](_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]]);_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;_0x8fd0ee[_0x58a5('0x25')][_0x21eb31[_0x58a5('0xb4')]][_0x58a5('0xe9')]+=0x1;var _0x43b6a7=_0x8fd0ee[_0x58a5('0x25')][_0x21eb31['queue']];var _0x1c501f=new Hangup(_0x21eb31,_0x11d4e8);_0x1c501f[_0x58a5('0xa9')]=0x13;_0x1c501f[_0x58a5('0xaa')]=_0x58a5('0xf2');_0x1c501f[_0x58a5('0xeb')]=_0x58a5('0xec');_0x1c501f[_0x58a5('0xf3')]+=0x1;_0x1c501f['countglobal']+=0x1;_0x1c501f['amd']=!![];ami[_0x58a5('0x50')](_0x58a5('0xed'),ut['buildObj'](_0x1c501f,_0x58a5('0xee')));_0x8fd0ee[_0x58a5('0xca')](_0x1c501f)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x104')));if(_0x1c501f[_0x58a5('0x105')]+_0x1c501f[_0x58a5('0xf6')]+_0x1c501f[_0x58a5('0xf7')]+_0x1c501f[_0x58a5('0xf8')]+_0x1c501f[_0x58a5('0xf9')]+_0x1c501f[_0x58a5('0xfa')]+_0x1c501f['countmachineretry']+_0x1c501f[_0x58a5('0xfb')]>=_0x43b6a7[_0x58a5('0xfc')]){_0x8fd0ee['stateGlobal'](_0x1c501f,_0x5d91e4,_0x4a6a14,_0x58a5('0x106'));}else{if(_0x1c501f[_0x58a5('0xf3')]>=_0x43b6a7['dialMachineMaxRetry']){_0x8fd0ee[_0x58a5('0x107')](_0x1c501f,_0x5d91e4,_0x4a6a14,_0x58a5('0x108'));}else{_0x8fd0ee[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x1c501f[_0x58a5('0xf3')],'scheduledat':moment()[_0x58a5('0xff')](_0x43b6a7['dialMachineRetryFrequency'],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x1c501f['ContactId'],'ListId':_0x1c501f[_0x58a5('0xd3')],'VoiceQueueId':_0x1c501f[_0x58a5('0x102')]||undefined,'CampaignId':_0x1c501f[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x5d91e4({'reschedule':0x1});}}});}}};Dialer[_0x58a5('0x1e')][_0x58a5('0x109')]=function(_0x469edf){var _0x44ed6b=this[_0x58a5('0x2a')][_0x469edf['uniqueid']];var _0x461f2b=this;var _0x275e6a;if(_0x44ed6b&&_0x44ed6b['type']==='ivr'){delete this[_0x58a5('0x2a')][_0x469edf['uniqueid']];this[_0x58a5('0xb3')](this[_0x58a5('0x25')][_0x44ed6b['queue']]);this['campaigns'][_0x44ed6b[_0x58a5('0xb4')]][_0x58a5('0x10a')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);this[_0x58a5('0xca')](_0x275e6a)['catch'](loggerCatch(_0x58a5('0x10b')));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}if(_0x44ed6b&&_0x44ed6b['type']!==_0x58a5('0x81')&&isNotNull(this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0x10d')])){delete this['uniqueId'][_0x469edf[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x44ed6b[_0x58a5('0xb4')]]);this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0xe8')]+=0x1;this[_0x58a5('0x24')][_0x44ed6b['queue']][_0x58a5('0xe9')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);_0x275e6a[_0x58a5('0xa9')]=0x10;_0x275e6a[_0x58a5('0xaa')]=_0x58a5('0x10e');_0x275e6a[_0x58a5('0xeb')]='AGI';this['createHistory'](_0x275e6a)[_0x58a5('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}if(_0x44ed6b&&_0x44ed6b[_0x58a5('0x51')]!=='ivr'&&!isNotNull(this[_0x58a5('0x24')][_0x44ed6b['queue']]['dialQueueProject'])){delete this[_0x58a5('0x2a')][_0x469edf[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x44ed6b['queue']]);this['voiceQueues'][_0x44ed6b['queue']][_0x58a5('0x6a')]+=0x1;_0x275e6a=new Hangup(_0x44ed6b,_0x469edf);_0x275e6a[_0x58a5('0xa9')]=0xc;_0x275e6a[_0x58a5('0xaa')]=_0x469edf[_0x58a5('0x10f')];_0x275e6a[_0x58a5('0xeb')]='Unknow';this[_0x58a5('0xca')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10b')));this[_0x58a5('0xc9')](_0x275e6a)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x10c')));}};Dialer['prototype'][_0x58a5('0x35')]=function(_0x1b69cb){var _0x3d88cb=this[_0x58a5('0x2a')][_0x1b69cb[_0x58a5('0xe0')]];var _0x3b31e1=this;if(this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]]){if(_0x3d88cb&&_0x3d88cb[_0x58a5('0x51')]!==_0x58a5('0x81')){delete this[_0x58a5('0x2a')][_0x1b69cb['uniqueid']];this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0xe8')]+=0x1;var _0x459234=new AgentComplete(_0x3d88cb,_0x1b69cb);if(_0x1b69cb[_0x58a5('0x110')]===_0x58a5('0x111')){_0x459234[_0x58a5('0x112')]=this['voiceQueues'][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0x113')]&&this[_0x58a5('0x24')][_0x1b69cb[_0x58a5('0xb4')]][_0x58a5('0x114')]?moment()[_0x58a5('0x7e')](_0x58a5('0x101')):undefined;}this['createHistory'](_0x459234)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x115')));this[_0x58a5('0xc9')](_0x459234)[_0x58a5('0xb8')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x58a5('0x1e')]['syncAgentConnect']=function(_0x1cf422){if(this['voiceQueues'][_0x1cf422[_0x58a5('0xb4')]]){if(this['uniqueId'][_0x1cf422['uniqueid']]&&this[_0x58a5('0x2a')][_0x1cf422[_0x58a5('0xe0')]][_0x58a5('0x51')]!==_0x58a5('0x81')){this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0x1cf422['queue']]);this[_0x58a5('0x2a')][_0x1cf422[_0x58a5('0xe0')]][_0x58a5('0x116')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));}}};Dialer[_0x58a5('0x1e')]['queueCallerAbandonCreateState']=function(_0x216d21){this['createHistory'](_0x216d21)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x115')));this[_0x58a5('0xc9')](_0x216d21)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x117')));};Dialer[_0x58a5('0x1e')]['syncQueueCallerAbandon']=function(_0xd9e8ce){var _0x129c81=this[_0x58a5('0x2a')][_0xd9e8ce[_0x58a5('0xe0')]];var _0x7f2e71=this;if(this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]){if(_0x129c81&&_0x129c81[_0x58a5('0x51')]!==_0x58a5('0x81')){delete this['uniqueId'][_0xd9e8ce[_0x58a5('0xe0')]];this[_0x58a5('0xb3')](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]);_0x129c81['droptime']=moment()['format'](_0x58a5('0x101'));var _0x5528ee=new QueueCallerAbandon(_0x129c81,_0xd9e8ce);if(getSeconds(_0x129c81[_0x58a5('0x118')],_0x129c81[_0x58a5('0x119')])>=_0x129c81[_0x58a5('0x11a')]){this['voiceQueues'][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x6e')]+=0x1;this['voiceQueues'][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x64')]+=0x1;this[_0x58a5('0x24')][_0xd9e8ce['queue']][_0x58a5('0x6f')]+=0x1;_0x5528ee[_0x58a5('0xa9')]=0xa;_0x5528ee[_0x58a5('0xaa')]='Drop';_0x5528ee['dropreason']='TIMEOUT';_0x5528ee[_0x58a5('0x112')]=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x113')]?moment()[_0x58a5('0x7e')](_0x58a5('0x101')):undefined;_0x5528ee[_0x58a5('0xf9')]+=0x1;_0x5528ee[_0x58a5('0xf4')]+=0x1;if(_0x5528ee['countdropretry']>=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x11b')]){this[_0x58a5('0x11c')](_0x5528ee);}else{this[_0x58a5('0xc0')]({'active':![],'countdropretry':_0x5528ee[_0x58a5('0xf9')],'scheduledat':moment()[_0x58a5('0xff')](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x11d')],'minutes')['format'](_0x58a5('0x101')),'ContactId':_0x129c81[_0x58a5('0xd2')],'ListId':_0x129c81[_0x58a5('0xd3')],'VoiceQueueId':_0x129c81[_0x58a5('0x102')]||undefined,'CampaignId':_0x129c81[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x11e')));var _0x3d934b=new History(_0x5528ee);_0x3d934b[_0x58a5('0xa9')]=0xa;_0x3d934b[_0x58a5('0xaa')]=_0x58a5('0x11f');_0x3d934b['starttime']=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));_0x3d934b[_0x58a5('0xab')]=_0x3d934b[_0x58a5('0xac')];_0x3d934b[_0x58a5('0x120')]=_0x5528ee['calleridname'];_0x3d934b[_0x58a5('0x121')]=_0x5528ee['calleridnum'];this[_0x58a5('0xca')](_0x3d934b)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x122')));}}else{this[_0x58a5('0x24')][_0xd9e8ce['queue']][_0x58a5('0x6d')]+=0x1;this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x63')]+=0x1;_0x5528ee[_0x58a5('0xa9')]=0xb;_0x5528ee[_0x58a5('0xaa')]='Abandoned';_0x5528ee[_0x58a5('0x123')]=_0x58a5('0x124');_0x5528ee[_0x58a5('0xfa')]+=0x1;_0x5528ee[_0x58a5('0xf4')]+=0x1;if(_0x5528ee['countabandonedretry']>=this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]][_0x58a5('0x125')]){this[_0x58a5('0x11c')](_0x5528ee);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x5528ee[_0x58a5('0xfa')],'scheduledat':moment()['add'](this[_0x58a5('0x24')][_0xd9e8ce[_0x58a5('0xb4')]]['dialAbandonedRetryFrequency'],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x129c81['ContactId'],'ListId':_0x129c81['ListId'],'VoiceQueueId':_0x129c81['VoiceQueueId']||undefined,'CampaignId':_0x129c81[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x126')));var _0x3d934b=new History(_0x5528ee);_0x3d934b[_0x58a5('0xa9')]=0xb;_0x3d934b[_0x58a5('0xaa')]=_0x58a5('0x127');_0x3d934b[_0x58a5('0xac')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));_0x3d934b['endtime']=_0x3d934b[_0x58a5('0xac')];_0x3d934b[_0x58a5('0x120')]=_0x5528ee[_0x58a5('0x120')];_0x3d934b[_0x58a5('0x121')]=_0x5528ee[_0x58a5('0x121')];this['createHistory'](_0x3d934b)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x128')));}}}}};Dialer[_0x58a5('0x1e')]['syncNewExten']=function(_0x514a06){if(this['actions'][_0x514a06[_0x58a5('0xe0')]]){this[_0x58a5('0x129')][_0x514a06[_0x58a5('0xe0')]]['channel']=_0x514a06[_0x58a5('0xb1')];}if(this['uniqueId'][_0x514a06[_0x58a5('0xe0')]]){this[_0x58a5('0x2a')][_0x514a06['uniqueid']][_0x58a5('0xb1')]=_0x514a06['channel'];}};Dialer[_0x58a5('0x1e')][_0x58a5('0x3c')]=function(_0xb23f2e){if(strategy[this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x52')]]===_0x58a5('0x12b')){if(this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]&&_[_0x58a5('0xe1')](this[_0x58a5('0x129')][_0xb23f2e['actionid']][_0x58a5('0x12c')])&&_0xb23f2e[_0x58a5('0xdb')]==='1'&&_0xb23f2e[_0x58a5('0x12d')]==='0'){if(this[_0x58a5('0x26')][_0xb23f2e[_0x58a5('0x12e')]]){if(!this[_0x58a5('0x26')][_0xb23f2e['stateinterface']][_0x58a5('0x12c')]){this[_0x58a5('0x26')][_0xb23f2e[_0x58a5('0x12e')]][_0x58a5('0x12c')]=!![];this['actions'][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0x12c')]=!![];this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]['stateinterface']=_0xb23f2e[_0x58a5('0x12e')];}}}}else if((strategy[this['voiceQueues'][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]]['strategy']]||'rrmemory')===_0x58a5('0x12f')){if(this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]]){if(this['agents'][_0xb23f2e[_0x58a5('0x12e')]]){this['actions'][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0x12e')]=_0xb23f2e[_0x58a5('0x12e')];if(_['isNil'](this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e['actionid']][_0x58a5('0xb4')]])){this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]]=[];}this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x130')](_['merge'](_[_0x58a5('0xd1')](this[_0x58a5('0x129')][_0xb23f2e[_0x58a5('0x12a')]],[_0x58a5('0x131'),_0x58a5('0x12e')]),{'status':_0xb23f2e[_0x58a5('0xdb')],'paused':_0xb23f2e[_0x58a5('0x12d')]}));}}}};function unlockQueueStatus(_0x510a9f,_0x11b21e){setTimeout(function(){if(_[_0x58a5('0x41')](_0x510a9f[_0x58a5('0x132')])){loggerBooked[_0x58a5('0x9a')](_0x58a5('0x133'),_0x11b21e);}_0x510a9f['queueStatusComplete']=!![];loggerBooked[_0x58a5('0x87')]('[booked][unlockQueueStatus]',_0x11b21e,JSON[_0x58a5('0x7d')](_[_0x58a5('0xd1')](_0x510a9f,[_0x58a5('0x44'),_0x58a5('0x132')])));},0x1f3);}Dialer[_0x58a5('0x1e')][_0x58a5('0x3e')]=function(_0x5e4d9a){var _0x5a8b52=this;var _0x8d35a=_0x5a8b52[_0x58a5('0x24')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']];if(strategy[this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']][_0x58a5('0x52')]]==='roundrobin'){if(this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]&&this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x12e')]){this['preview'][_0x58a5('0x134')](this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['idHopper'],this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x12e')])[_0x58a5('0xb8')](function(_0x3e3da5){logger['error'](_0x58a5('0x135'),util[_0x58a5('0x9b')](_0x3e3da5,{'showHidden':![],'depth':null}));})[_0x58a5('0x21')](function(){_0x5a8b52[_0x58a5('0xb3')](_0x5a8b52[_0x58a5('0x24')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);_0x5a8b52[_0x58a5('0x26')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0x12e')]][_0x58a5('0x12c')]=![];delete _0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);});}else{this['updateOriginated'](this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);this[_0x58a5('0xc0')]({'active':![],'ContactId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd2')],'ListId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['ListId'],'VoiceQueueId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x102')]||undefined,'CampaignId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x136')));delete this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);}}else if((strategy[this['voiceQueues'][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]][_0x58a5('0x52')]]||_0x58a5('0x12f'))===_0x58a5('0x12f')){var _0x22c1a0;if(this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]&&!_[_0x58a5('0x84')](this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]])){if(this[_0x58a5('0x2f')][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]){this['queueBookedRR'][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]=this[_0x58a5('0x2f')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]?this['queueBookedRR'][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]:this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]?this['queueBooked'][this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['queue']]['_rr']||0x0:0x0;}this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]['_rr']=this['queueBookedRR'][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]];for(var _0x57039a=0x0;_0x57039a<this[_0x58a5('0x2e')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']][_0x58a5('0x137')];_0x57039a+=0x1){_0x22c1a0=rr(this[_0x58a5('0x2e')][this['actions'][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);this['queueBookedRR'][_0x5a8b52[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['queue']]=this[_0x58a5('0x2e')][this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['queue']][_0x58a5('0x138')];if(_0x22c1a0[_0x58a5('0xdb')]==='1'&&_0x22c1a0['paused']==='0'){break;}}if(!_[_0x58a5('0xe1')](_0x22c1a0)){this['agents'][_0x22c1a0[_0x58a5('0x12e')]][_0x58a5('0x139')]=_[_0x58a5('0x41')](this['agents'][_0x22c1a0[_0x58a5('0x12e')]][_0x58a5('0x139')])?!![]:this[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]][_0x58a5('0x139')];}loggerBooked[_0x58a5('0x87')]('[booked][RR]',_0x5e4d9a['actionid'],'Agent:\x20',JSON['stringify'](_[_0x58a5('0xd1')](this[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]],[_0x58a5('0x44'),_0x58a5('0x139')])),_0x58a5('0x13a'),JSON['stringify'](_0x22c1a0[_0x58a5('0x131')]));if(!_[_0x58a5('0xe1')](_0x22c1a0)&&_0x22c1a0[_0x58a5('0xdb')]==='1'&&_0x22c1a0['paused']==='0'&&this[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]]['unlockRR']){this[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]][_0x58a5('0x139')]=![];this['queueBooked'][_0x5a8b52['actions'][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]=[];this[_0x58a5('0x23')][_0x58a5('0x134')](_0x22c1a0[_0x58a5('0x131')],_0x22c1a0[_0x58a5('0x12e')])[_0x58a5('0xb8')](function(_0x5c19fc){logger[_0x58a5('0x9a')](_0x58a5('0x135'),util[_0x58a5('0x9b')](_0x5c19fc,{'showHidden':![],'depth':null}));})[_0x58a5('0x21')](function(){_0x5a8b52['updateOriginated'](_0x5a8b52[_0x58a5('0x24')][_0x5a8b52['actions'][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]);setTimeout(function(){_0x5a8b52[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]][_0x58a5('0x139')]=!![];loggerBooked[_0x58a5('0x87')](_0x58a5('0x13b'),_0x5e4d9a['actionid'],_0x58a5('0x13c'),JSON[_0x58a5('0x7d')](_[_0x58a5('0xd1')](_0x5a8b52[_0x58a5('0x26')][_0x22c1a0[_0x58a5('0x12e')]],[_0x58a5('0x44'),'unlockRR'])),_0x58a5('0x13a'),JSON['stringify'](_0x22c1a0[_0x58a5('0x131')]));},0xc7);delete _0x5a8b52[_0x58a5('0x129')][_0x5e4d9a['actionid']];unlockQueueStatus(_0x8d35a,_0x5e4d9a[_0x58a5('0x12a')]);});}else{loggerBooked[_0x58a5('0x87')](_0x58a5('0x13d'));this[_0x58a5('0xb3')](this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xb4')]]);this[_0x58a5('0xc0')]({'active':![],'ContactId':this['actions'][_0x5e4d9a[_0x58a5('0x12a')]]['ContactId'],'ListId':this['actions'][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd3')],'VoiceQueueId':this['actions'][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x102')]||undefined,'CampaignId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x136')));delete this[_0x58a5('0x129')][_0x5e4d9a['actionid']];unlockQueueStatus(_0x8d35a);}}else{loggerBooked['info']('[booked][unlock2]');this[_0x58a5('0xb3')](this['voiceQueues'][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);this[_0x58a5('0xc0')]({'active':![],'ContactId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd2')],'ListId':this[_0x58a5('0x129')][_0x5e4d9a['actionid']][_0x58a5('0xd3')],'VoiceQueueId':this['actions'][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0x102')]||undefined,'CampaignId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x58a5('0x13e')));delete this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);}}else{loggerBooked[_0x58a5('0x87')](_0x58a5('0x13f'));this[_0x58a5('0xb3')](this[_0x58a5('0x24')][this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xb4')]]);this[_0x58a5('0xc0')]({'active':![],'ContactId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd2')],'ListId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]][_0x58a5('0xd3')],'VoiceQueueId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x58a5('0x129')][_0x5e4d9a[_0x58a5('0x12a')]]['CampaignId']||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x140')));delete this['actions'][_0x5e4d9a[_0x58a5('0x12a')]];unlockQueueStatus(_0x8d35a);}};Dialer['prototype'][_0x58a5('0x3f')]=function(){var _0xa56e4b=this;setInterval(function(){_0xa56e4b[_0x58a5('0x141')]();},0x3e8);};Dialer[_0x58a5('0x1e')][_0x58a5('0x142')]=function(_0x6b772){var _0x79d26e=this;return function(){if(!_0x79d26e['isTrunkReachable'](_0x6b772[_0x58a5('0x7b')])){if(!_0x79d26e['isTrunkReachable'](_0x6b772[_0x58a5('0x143')])){_0x6b772[_0x58a5('0x42')]='TRUNK_IS_NOT_REACHABLE';throw _0x6b772['name']+_0x58a5('0x144');}}};};Dialer['prototype'][_0x58a5('0x145')]=function(_0x84197b,_0x40d617,_0xc3e858,_0x32c5ba){var _0x163f58=this;return function(){var _0x297bf4=!![];return _0x163f58[_0x58a5('0x146')](_0x84197b,_0x40d617,_0xc3e858,_0x32c5ba,_0x297bf4);};};Dialer[_0x58a5('0x1e')][_0x58a5('0x147')]=function(_0x25fc99,_0x3b2daa,_0x5e65ab,_0x24b8b6){var _0x528c81=this;return function(){var _0x45391a=![];return _0x528c81[_0x58a5('0x146')](_0x25fc99[_0x58a5('0x4a')],_0x3b2daa,_0x5e65ab,_0x24b8b6,_0x45391a);};};Dialer[_0x58a5('0x1e')]['ifTime']=function(_0x49bc0b,_0x2f8da1,_0x58092b,_0x3f00fe,_0x32c14a){var _0x5deda5=[];return new BPromise(function(_0x46510a,_0x3ce27a){if(!isNotNull(_0x49bc0b)){_0x3f00fe[_0x58a5('0x42')]=_0x58a5('0x48');return _0x3ce27a(msgResponse(_0x58a5('0x146'),_0x58a5('0x148'),_0x58092b+_0x58a5('0x149')));}if(_[_0x58a5('0x84')](_0x49bc0b)){_0x3f00fe[_0x58a5('0x42')]=_0x58a5('0x14a');return _0x3ce27a(msgResponse(_0x58a5('0x146'),_0x58a5('0x148'),_0x58092b+_0x58a5('0x14b')));}if(_0x2f8da1&&_[_0x58a5('0x41')](config['timezones'][_0x2f8da1])){_0x3f00fe['message']='TIMEZONE_UNKNOW';return _0x3ce27a(msgResponse(_0x58a5('0x146'),_0x58a5('0x148'),_0x58092b+'\x20Timezone\x20unknow\x20'+_0x2f8da1));}if(_[_0x58a5('0x14c')](_0x49bc0b)){for(var _0x4daff4=0x0;_0x4daff4<_0x49bc0b['length'];_0x4daff4+=0x1){_0x5deda5[_0x58a5('0x130')](ami[_0x58a5('0xb0')]({'action':_0x58a5('0x14d'),'command':util['format'](_0x58a5('0x14e'),_0x49bc0b[_0x4daff4][_0x58a5('0x14f')],!_[_0x58a5('0x41')](config[_0x58a5('0x150')][_0x2f8da1])?_0x2f8da1:'')})[_0x58a5('0xb7')](function(_0x58c24c){return _0x58c24c['content'][_0x58a5('0x151')](_0x58a5('0x152'))>=0x0;})[_0x58a5('0xb8')](myreject(_0x3ce27a)));}}else{_0x5deda5['push'](ami[_0x58a5('0xb0')]({'action':_0x58a5('0x14d'),'command':util[_0x58a5('0x7e')](_0x58a5('0x14e'),_0x49bc0b,!_[_0x58a5('0x41')](config[_0x58a5('0x150')][_0x2f8da1])?_0x2f8da1:'')})[_0x58a5('0xb7')](function(_0x590ff6){return _0x590ff6['content'][_0x58a5('0x151')](_0x58a5('0x152'))>=0x0;})[_0x58a5('0xb8')](myreject(_0x3ce27a)));}BPromise['all'](_0x5deda5)[_0x58a5('0xb7')](function(_0x40087d){var _0x182f3a=_[_0x58a5('0x153')](_0x40087d);if(_0x182f3a){return _0x46510a(_0x182f3a);}else{_0x3f00fe[_0x58a5('0x42')]=_0x32c14a?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x3ce27a(msgResponse(_0x58a5('0x154'),_0x58a5('0x148'),_0x58a5('0x155')+_0x32c14a+'\x20'+_0x58092b+_0x58a5('0x156')+util[_0x58a5('0x9b')](_0x49bc0b,{'showHidden':![],'depth':null})+_0x58a5('0x157')+_0x2f8da1));}})['catch'](function(_0x3c8faf){return _0x3ce27a(msgResponse(_0x58a5('0x146'),_0x58a5('0x148'),JSON['stringify'](_0x3c8faf)));});});};Dialer[_0x58a5('0x1e')][_0x58a5('0x158')]=function(_0x10f318){var _0xfda9c=this;return function(){switch(_0x10f318['dialMethod']){case'progressive':freeVariablesPredictive(_0x10f318);_0xfda9c[_0x58a5('0x159')](_0x10f318,0x1);break;case'power':freeVariablesPredictive(_0x10f318);_0xfda9c['handlePower'](_0x10f318,_0x10f318[_0x58a5('0x15a')]);break;case _0x58a5('0xb'):_0xfda9c[_0x58a5('0xb')](_0x10f318);break;case'booked':freeVariablesPredictive(_0x10f318);_0xfda9c['handlePower'](_0x10f318,0x1);break;default:freeVariablesPredictive(_0x10f318);logger[_0x58a5('0x9a')](_0x58a5('0x15b'),_0x10f318[_0x58a5('0x44')],'method\x20not\x20recognized');}};};Dialer[_0x58a5('0x1e')][_0x58a5('0x15c')]=function(_0x229e05){var _0x4a316c=this;return function(){_0x4a316c[_0x58a5('0x15d')](_0x229e05);};};Dialer['prototype'][_0x58a5('0x37')]=function(_0x2404d1){var _0x26ad43=this;if(isNotPreview(_0x2404d1[_0x58a5('0x15e')])){if(isVoiceQueueOutbound(_0x2404d1[_0x58a5('0x51')])&&isActive(_0x2404d1[_0x58a5('0x5d')])){_0x2404d1[_0x58a5('0xa4')]=!![];BPromise[_0x58a5('0xb6')]()[_0x58a5('0xb7')](checkIsLoggedIn(_0x2404d1,_0x2404d1[_0x58a5('0x54')]))[_0x58a5('0xb7')](checkIsActive(_0x2404d1,_0x2404d1['dialActive']))[_0x58a5('0xb7')](checkInterval(_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x142')](_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x145')](_0x2404d1[_0x58a5('0x15f')],_0x2404d1[_0x58a5('0x160')],_0x2404d1[_0x58a5('0x44')],_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x147')](_0x2404d1['Interval'],_0x2404d1[_0x58a5('0x160')],_0x2404d1[_0x58a5('0x44')],_0x2404d1))[_0x58a5('0xb7')](_0x26ad43[_0x58a5('0x158')](_0x2404d1))[_0x58a5('0xb8')](loggerCatchQueueSummary('[syncQueueSummary]',_0x2404d1));}else{notSendMessagesQueue(_0x2404d1);}}else{freeVariablesPredictive(_0x2404d1);}};Dialer['prototype']['syncCampaigns']=function(){var _0x4f3244=this;var _0x4fda2f;for(var _0x25b526 in this[_0x58a5('0x25')]){if(typeof this[_0x58a5('0x25')][_0x25b526]!==_0x58a5('0x9d')){_0x4fda2f=this[_0x58a5('0x25')][_0x25b526];if(isCampaignIvr(_0x4fda2f[_0x58a5('0x51')])&&isActive(_0x4fda2f[_0x58a5('0xd8')])){_0x4fda2f[_0x58a5('0xa4')]=!![];BPromise['resolve']()[_0x58a5('0xb7')](checkIsActive(_0x4fda2f,_0x4fda2f['active']))['then'](checkInterval(_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244['checkIsTrunkReachable'](_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x145')](_0x4fda2f[_0x58a5('0x15f')],_0x4fda2f[_0x58a5('0x160')],_0x4fda2f['name'],_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x147')](_0x4fda2f[_0x58a5('0x47')],_0x4fda2f[_0x58a5('0x160')],_0x4fda2f[_0x58a5('0x44')],_0x4fda2f))[_0x58a5('0xb7')](_0x4f3244[_0x58a5('0x15c')](_0x4fda2f))[_0x58a5('0xb8')](loggerCatchQueueSummary('[syncCampaigns]',_0x4fda2f));}else{notSendMessagesCampaign(_0x4fda2f);}}}};function getCallerIdRandom(_0x3c6bc1,_0x3057d3){var _0x2b7274;var _0x500c14;var _0x1fe743;if(_0x3057d3<=0x0){_0x3057d3=0x1;}_0x2b7274=new RegExp(_0x58a5('0x161')+_0x3057d3+'}$');_0x500c14=Math[_0x58a5('0x162')](0xa,_0x3057d3-0x1);_0x1fe743=Math[_0x58a5('0x162')](0xa,_0x3057d3)-0x1;return util[_0x58a5('0x7e')]('%s',_[_0x58a5('0x163')](_0x3c6bc1,_0x2b7274,_[_0x58a5('0x164')](_0x500c14,_0x1fe743)));}function extractCalleridName(_0x1bb051){var _0x3d1765=_0x1bb051[_0x58a5('0x165')](/"(.*?)"/);return _0x3d1765?_0x3d1765[0x1]:_0x1bb051;}function extractCalleridNumber(_0x236ba2){var _0x230f6a=_0x236ba2[_0x58a5('0x165')](/<(.*?)>/);return _0x230f6a?_0x230f6a[0x1]:_0x236ba2;}Dialer['prototype'][_0x58a5('0x166')]=function(_0x29c3d6,_0x5e07ea){var _0x249fbb=this;var _0x45ff80=uuid['v4']();this[_0x58a5('0x129')][_0x45ff80]=new Action(_0x29c3d6,_0x5e07ea,_0x45ff80);return new BPromise(function(_0x54aeda,_0x13b64d){if(_[_0x58a5('0x41')](_0x29c3d6)&&typeof _0x29c3d6!==_0x58a5('0x167')){return _0x13b64d(msgResponse(_0x58a5('0x168'),'Failure',_0x58a5('0x169')));}if(_[_0x58a5('0x41')](_0x5e07ea['Contact'][_0x58a5('0x16a')])||_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')]===null){return _0x13b64d(msgResponse('originate',_0x58a5('0x148'),_0x58a5('0x16c')));}var _0x5f1608={'XMD-CALLERID':_0x249fbb['actions'][_0x45ff80]['getCaller'](),'XMD-AGI':_0x29c3d6[_0x58a5('0x10d')]?util[_0x58a5('0x7e')](_0x58a5('0x16d'),ipAgi,_0x29c3d6['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x29c3d6[_0x58a5('0x113')]?util[_0x58a5('0x7e')](_0x58a5('0x16d'),ipAgi,_0x29c3d6[_0x58a5('0x113')]):'NONE','XMD-QUEUE':_0x29c3d6[_0x58a5('0x51')]===_0x58a5('0x96')?util[_0x58a5('0x7e')](_0x58a5('0x16e'),_0x29c3d6[_0x58a5('0x44')],_0x29c3d6[_0x58a5('0x16f')]||'',_0x29c3d6[_0x58a5('0x114')]?'c':'',_0x29c3d6[_0x58a5('0x11a')]||0x3):_0x58a5('0x170'),'XMD-CONTACTID':_0x5e07ea[_0x58a5('0xd2')],'XMD-CDRTYPE':_0x58a5('0x9'),'CALLERID(all)':_0x249fbb[_0x58a5('0x129')][_0x45ff80]['getCaller'](),'XMD-AMD':_0x29c3d6[_0x58a5('0xe5')]?_0x58a5('0x171'):_0x58a5('0x170'),'XMD-DESTINATION':_0x58a5('0x172')};if(_0x29c3d6[_0x58a5('0xe5')]){_0x5f1608[_0x58a5('0x173')]=_0x29c3d6[_0x58a5('0x174')]||0x9c4;_0x5f1608['XMD-AMDGREETING']=_0x29c3d6[_0x58a5('0x175')]||0x5dc;_0x5f1608[_0x58a5('0x176')]=_0x29c3d6['dialAMDAfterGreetingSilence']||0x320;_0x5f1608['XMD-AMDTOTALANALYSISTIME']=_0x29c3d6[_0x58a5('0x177')]||0x1388;_0x5f1608[_0x58a5('0x178')]=_0x29c3d6[_0x58a5('0x179')]||0x64;_0x5f1608[_0x58a5('0x17a')]=_0x29c3d6['dialAMDBetweenWordsSilence']||0x32;_0x5f1608[_0x58a5('0x17b')]=_0x29c3d6[_0x58a5('0x17c')]||0x3;_0x5f1608[_0x58a5('0x17d')]=_0x29c3d6[_0x58a5('0x17e')]||0x100;_0x5f1608[_0x58a5('0x17f')]=_0x29c3d6[_0x58a5('0x180')]||0x1388;}if(_0x29c3d6[_0x58a5('0x51')]===_0x58a5('0x96')){_0x5f1608[_0x58a5('0x181')]=_0x5e07ea[_0x58a5('0x102')];}else{_0x5f1608[_0x58a5('0x182')]=_0x5e07ea[_0x58a5('0xd5')];}for(var _0x56535a in _0x5e07ea[_0x58a5('0x16b')]){if(typeof _0x5e07ea[_0x58a5('0x16b')][_0x56535a]!==_0x58a5('0x9d')){if(isNotNull(_0x5e07ea[_0x58a5('0x16b')][_0x56535a])&&_0x56535a!=='id'&&_0x56535a!==_0x58a5('0x183')&&_0x56535a!=='createdAt'&&_0x56535a!==_0x58a5('0x184')){_0x5f1608[util[_0x58a5('0x7e')](_0x58a5('0x185'),_0x58a5('0x186'),_[_0x58a5('0x187')](_0x56535a))]=_0x5e07ea[_0x58a5('0x16b')][_0x56535a];}}}var _0x1fcc96=_0x249fbb['isTrunkReachable'](_0x29c3d6['Trunk'])?getCallerId(_0x29c3d6[_0x58a5('0x7b')]['callerid'],_0x29c3d6['dialOriginateCallerIdName'],_0x29c3d6[_0x58a5('0x188')]>0x0?getCallerIdRandom(_0x29c3d6[_0x58a5('0x5e')],_0x29c3d6[_0x58a5('0x188')]):_0x29c3d6['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x29c3d6[_0x58a5('0x143')])?_0x29c3d6[_0x58a5('0x7b')]['callerid']:_0x29c3d6[_0x58a5('0x143')][_0x58a5('0x7c')],_0x29c3d6[_0x58a5('0x189')],_0x29c3d6['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x29c3d6[_0x58a5('0x5e')],_0x29c3d6[_0x58a5('0x188')]):_0x29c3d6[_0x58a5('0x5e')]);if(_0x1fcc96){_0x5f1608[_0x58a5('0x18a')]=_0x249fbb[_0x58a5('0x129')][_0x45ff80][_0x58a5('0x18b')]=extractCalleridName(_0x1fcc96);_0x5f1608[_0x58a5('0x18c')]=_0x249fbb[_0x58a5('0x129')][_0x45ff80][_0x58a5('0x18d')]=extractCalleridNumber(_0x1fcc96);}return ami[_0x58a5('0xb0')]({'actionid':_0x45ff80,'action':_0x58a5('0x168'),'channel':_0x249fbb[_0x58a5('0xd7')](_0x29c3d6[_0x58a5('0x7b')])?util[_0x58a5('0x7e')](_0x58a5('0x18e'),_0x29c3d6[_0x58a5('0x7b')][_0x58a5('0x44')],isNotNull(_0x29c3d6[_0x58a5('0x60')])?_0x29c3d6[_0x58a5('0x60')]['trim']()||'':'',_0x29c3d6['dialCutDigit']>0x0?_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')][_0x58a5('0x18f')](_0x29c3d6[_0x58a5('0x190')]):_0x5e07ea['Contact'][_0x58a5('0x16a')]):util['format'](_0x58a5('0x18e'),_[_0x58a5('0xe1')](_0x29c3d6[_0x58a5('0x143')])?_0x29c3d6[_0x58a5('0x7b')]['name']:_0x29c3d6[_0x58a5('0x143')][_0x58a5('0x44')],isNotNull(_0x29c3d6[_0x58a5('0x60')])?_0x29c3d6[_0x58a5('0x60')][_0x58a5('0x191')]()||'':'',_0x29c3d6['dialCutDigit']>0x0?_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')][_0x58a5('0x18f')](_0x29c3d6['dialCutDigit']):_0x5e07ea[_0x58a5('0x16b')][_0x58a5('0x16a')]),'callerid':_0x1fcc96,'Exten':_0x58a5('0x172'),'Context':'from-sip','Priority':'1','variable':_0x5f1608,'timeout':(_0x29c3d6[_0x58a5('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45ff80})[_0x58a5('0xb7')](function(_0xf48aeb){return _0x54aeda(_0xf48aeb);})[_0x58a5('0xb8')](function(_0x3cfc43){_0x29c3d6['outboundOriginateFailureCallsDay']+=0x1;var _0x275622=new History(_0x249fbb[_0x58a5('0x129')][_0x45ff80]);logger[_0x58a5('0x9a')](util['format'](_0x58a5('0x192'),JSON[_0x58a5('0x7d')](_0x3cfc43)));_0x275622[_0x58a5('0xa9')]=0xe;_0x275622[_0x58a5('0xaa')]=_0x58a5('0x193');_0x275622['starttime']=moment()['format'](_0x58a5('0x101'));_0x275622[_0x58a5('0xab')]=_0x275622[_0x58a5('0xac')];_0x249fbb[_0x58a5('0xca')](_0x275622)['catch'](loggerCatch(_0x58a5('0x194')));_0x249fbb[_0x58a5('0xc9')](_0x275622)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x194')))[_0x58a5('0x21')](function(){delete _0x249fbb[_0x58a5('0x129')][_0x45ff80];return _0x13b64d(msgResponse(_0x58a5('0x168'),_0x58a5('0x4c'),_0x58a5('0x195')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x2795f5){var _0x2a1733=this[_0x58a5('0x129')][_0x2795f5['actionid']];if(_0x2a1733){delete this[_0x58a5('0x129')][_0x2795f5[_0x58a5('0x12a')]];_0x2a1733[_0x58a5('0x119')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x120ca1=_0x2a1733['type']===_0x58a5('0x81')?this[_0x58a5('0x25')][_0x2a1733['queue']]:this[_0x58a5('0x24')][_0x2a1733[_0x58a5('0x196')]()];if(!this['isSuccess'](_0x2795f5[_0x58a5('0x197')])){this[_0x58a5('0xb3')](_0x120ca1);return this[_0x58a5('0x198')](_0x2a1733,_0x120ca1,_0x2795f5)['catch'](loggerCatch(_0x58a5('0x199')));}this[_0x58a5('0x2a')][_0x2795f5[_0x58a5('0xe0')]]=_0x2a1733;}};Dialer[_0x58a5('0x1e')][_0x58a5('0x19a')]=function(_0x2d39a8,_0x246c42,_0x5cb7c5){var _0x2fcce9=new History(_0x246c42);if(_0x2fcce9['countbusyretry']+_0x2fcce9['countcongestionretry']+_0x2fcce9[_0x58a5('0xf7')]+_0x2fcce9[_0x58a5('0xf8')]+_0x2fcce9[_0x58a5('0xf9')]+_0x2fcce9[_0x58a5('0xfa')]+_0x2fcce9[_0x58a5('0xf3')]+_0x2fcce9['countagentrejectretry']>=_0x5cb7c5[_0x58a5('0xfc')]-0x1){return!![];}switch(_0x2d39a8){case 0x3:if(_0x2fcce9[_0x58a5('0xf7')]>=_0x5cb7c5['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countnoanswerretry':_0x2fcce9[_0x58a5('0xf7')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19b')],_0x58a5('0x100'))[_0x58a5('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2fcce9['ContactId'],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9['VoiceQueueId']||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x19c')));break;case 0x5:if(_0x2fcce9['countbusyretry']>=_0x5cb7c5[_0x58a5('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x2fcce9[_0x58a5('0x105')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19e')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2fcce9[_0x58a5('0xf6')]>=_0x5cb7c5['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2fcce9['countcongestionretry']+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x19f')],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x1a0')));break;case 0x0:if(_0x2fcce9[_0x58a5('0xf8')]>=_0x5cb7c5[_0x58a5('0x1a1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2fcce9['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x5cb7c5[_0x58a5('0x1a2')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9['VoiceQueueId']||undefined,'CampaignId':_0x2fcce9['CampaignId']||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1a3')));}break;case 0xa:if(_0x2fcce9[_0x58a5('0xf9')]>=_0x5cb7c5[_0x58a5('0x11b')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2fcce9[_0x58a5('0xf9')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x11d')],_0x58a5('0x100'))[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9['ContactId'],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x11e')));break;case 0xb:if(_0x2fcce9[_0x58a5('0xfa')]>=_0x5cb7c5[_0x58a5('0x125')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x2fcce9[_0x58a5('0xfa')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a4')],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x2fcce9['countmachineretry']>=_0x5cb7c5[_0x58a5('0xfe')]-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countmachineretry':_0x2fcce9['countmachineretry']+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a5')],'minutes')[_0x58a5('0x7e')](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9['ListId'],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x2fcce9[_0x58a5('0xfb')]>=_0x5cb7c5[_0x58a5('0x1a6')]-0x1){return!![];}this[_0x58a5('0xc0')]({'active':![],'countagentrejectretry':_0x2fcce9[_0x58a5('0xfb')]+=0x1,'scheduledat':moment()[_0x58a5('0xff')](_0x5cb7c5[_0x58a5('0x1a7')],_0x58a5('0x100'))['format'](_0x58a5('0x101')),'ContactId':_0x2fcce9[_0x58a5('0xd2')],'ListId':_0x2fcce9[_0x58a5('0xd3')],'VoiceQueueId':_0x2fcce9[_0x58a5('0x102')]||undefined,'CampaignId':_0x2fcce9[_0x58a5('0xd5')]||undefined})['catch'](loggerCatch(_0x58a5('0x1a8')));break;default:return!![];}};Dialer['prototype'][_0x58a5('0x198')]=function(_0x1b7138,_0x5720da,_0x7d8939){var _0x88d00d=this;var _0x5f4525=new History(_0x1b7138);return new BPromise(function(_0x24f33a,_0x25954e){if(_[_0x58a5('0x41')](_0x5720da)&&typeof _0x5720da!==_0x58a5('0x167')){return _0x25954e(msgResponse(_0x58a5('0x1a9'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x7d8939)&&typeof _0x7d8939!==_0x58a5('0x167')){return _0x25954e(msgResponse(_0x58a5('0x1a9'),_0x58a5('0x148'),'evt\x20is\x20undefine'));}switch(_0x7d8939['reason']){case'0':_0x5720da[_0x58a5('0x66')]+=0x1;_0x5f4525['state']=0x0;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1aa');_0x5f4525['countnosuchnumberretry']+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1ab'),ut[_0x58a5('0xf5')](_0x1b7138,_0x58a5('0x1ac')));_0x88d00d['createHistory'](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x104')));if(_0x88d00d[_0x58a5('0x19a')](0x0,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xf8')]>=_0x5720da[_0x58a5('0x1a1')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ad'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ad'));}}break;case'3':_0x5720da[_0x58a5('0x65')]+=0x1;_0x5f4525['state']=0x3;_0x5f4525[_0x58a5('0xaa')]='NoAnswer';_0x5f4525['countnoanswerretry']+=0x1;_0x5f4525['countglobal']+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1ae'),ut[_0x58a5('0xf5')](_0x1b7138,'noanswer'));_0x88d00d[_0x58a5('0xca')](_0x5f4525)['catch'](loggerCatch(_0x58a5('0x1af')));if(_0x88d00d[_0x58a5('0x19a')](0x3,_0x1b7138,_0x5720da)){if(_0x5f4525['countnoanswerretry']>=_0x5720da[_0x58a5('0x1b0')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b1'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b1'));}}break;case'5':_0x5720da[_0x58a5('0x61')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0x5;_0x5f4525[_0x58a5('0xaa')]='Busy';_0x5f4525[_0x58a5('0x105')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1b2'),ut['buildObj'](_0x1b7138,'busy'));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1b3')));if(_0x88d00d[_0x58a5('0x19a')](0x5,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0x105')]>=_0x5720da[_0x58a5('0x19d')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b4'));}else{_0x88d00d['stateGlobal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1b4'));}}break;case'8':_0x5720da[_0x58a5('0x62')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0x8;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1b5');_0x5f4525['countcongestionretry']+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami['emit'](_0x58a5('0x1b6'),ut[_0x58a5('0xf5')](_0x1b7138,_0x58a5('0x1b7')));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1b8')));if(_0x88d00d[_0x58a5('0x19a')](0x8,_0x1b7138,_0x5720da)){if(_0x5f4525['countcongestionretry']>=_0x5720da[_0x58a5('0x1b9')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,'reason\x208\x20congestion');}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1ba'));}}break;case'11':_0x5720da[_0x58a5('0x1bb')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0xb;_0x5f4525['statedesc']=_0x58a5('0x127');_0x5f4525[_0x58a5('0xfa')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x128')));if(_0x88d00d[_0x58a5('0x19a')](0xb,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xfa')]>=_0x5720da[_0x58a5('0x125')]){_0x88d00d['createStateFinal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1bc'));}else{_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1bc'));}}break;case'20':_0x5720da[_0x58a5('0x69')]+=0x1;_0x5f4525['state']=0x14;_0x5f4525[_0x58a5('0xaa')]=_0x58a5('0x1bd');_0x5f4525[_0x58a5('0xfb')]+=0x1;_0x5f4525[_0x58a5('0xf4')]+=0x1;ami[_0x58a5('0x50')](_0x58a5('0x1be'),ut['buildObj'](_0x1b7138,_0x58a5('0x1bf')));_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1c0')));if(_0x88d00d[_0x58a5('0x19a')](0x14,_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0xfb')]>=_0x5720da[_0x58a5('0x1a6')]){_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1c1'));}else{_0x88d00d['stateGlobal'](_0x5f4525,_0x24f33a,_0x25954e,_0x58a5('0x1c1'));}}break;default:_0x5720da[_0x58a5('0x6a')]+=0x1;_0x5f4525[_0x58a5('0xa9')]=0xc;_0x5f4525[_0x58a5('0xaa')]=_0x7d8939['reason'];_0x88d00d[_0x58a5('0xca')](_0x5f4525)[_0x58a5('0xb8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x88d00d[_0x58a5('0x19a')](_0x7d8939[_0x58a5('0x110')],_0x1b7138,_0x5720da)){if(_0x5f4525[_0x58a5('0x105')]+_0x5f4525[_0x58a5('0xf6')]+_0x5f4525[_0x58a5('0xf7')]+_0x5f4525[_0x58a5('0xf8')]+_0x5f4525[_0x58a5('0xf9')]+_0x5f4525[_0x58a5('0xfa')]+_0x5f4525[_0x58a5('0xf3')]+_0x5f4525[_0x58a5('0xfb')]>=_0x5720da['dialGlobalMaxRetry']){_0x88d00d[_0x58a5('0xfd')](_0x5f4525,_0x24f33a,_0x25954e,_0x7d8939[_0x58a5('0x110')]);}else{_0x88d00d[_0x58a5('0x107')](_0x5f4525,_0x24f33a,_0x25954e,_0x7d8939['reason']);}}}});};Dialer[_0x58a5('0x1e')][_0x58a5('0xfd')]=function(_0x6d4088,_0x1c0af5,_0x362ec6,_0x269c56){var _0x1c2b57=new Final(_0x6d4088);_0x1c2b57[_0x58a5('0xa9')]=0xf;_0x1c2b57[_0x58a5('0xaa')]='Global';this[_0x58a5('0x107')](_0x1c2b57,_0x1c0af5,_0x362ec6,_0x269c56);};Dialer['prototype'][_0x58a5('0x107')]=function(_0x1309bd,_0x161978,_0x4d5fb1,_0x24de4b){this['moveContactManagedDialer'](_0x1309bd)[_0x58a5('0xb7')](function(){return _0x161978(msgResponse(_0x58a5('0x1a9'),_0x58a5('0x1c2'),_0x24de4b));})[_0x58a5('0xb8')](function(){return _0x4d5fb1(msgResponse(_0x58a5('0x1c3'),_0x58a5('0x148'),_0x58a5('0x1c4')));});};Dialer[_0x58a5('0x1e')]['predictive']=function(_0x2d918c){var _0x513423=_0x2d918c[_0x58a5('0x1c5')]/0x64;var _0x1598e0=_0x2d918c[_0x58a5('0x64')]/(_0x2d918c[_0x58a5('0x64')]+_0x2d918c[_0x58a5('0xe8')]);var _0x27fbdb=Math[_0x58a5('0x1c6')](_0x2d918c['predictiveIntervalAvailable']*(_0x2d918c[_0x58a5('0x1c7')]/0x64));var _0x290ad6=Math[_0x58a5('0x1c6')](_0x2d918c['predictiveIntervalAvailable']*(_0x2d918c['predictiveIntervalMinThreshold']/0x64));var _0x16f90d=_0x2d918c[_0x58a5('0x53')]+_0x2d918c['talking'];var _0x48d442=Math[_0x58a5('0x1c8')](_0x2d918c[_0x58a5('0x76')]*_0x2d918c['erlangAbandonmentRate']*_0x2d918c[_0x58a5('0x70')]*_0x2d918c['predictiveIntervalMultiplicativeFactor']);if(_[_0x58a5('0x41')](_0x2d918c['startProgressive'])){if(!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x7a')])){_0x2d918c[_0x58a5('0x7a')]=undefined;loggerPredictive[_0x58a5('0x9a')](_0x58a5('0x1c9'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x94')])){loggerPredictive[_0x58a5('0x9a')](_0x58a5('0x1c9'),_0x58a5('0x1ca'));clearInterval(_0x2d918c[_0x58a5('0x94')]);_0x2d918c[_0x58a5('0x94')]=undefined;}_0x2d918c[_0x58a5('0x2c')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x2d918c['startProgressive']);this['handlePower'](_0x2d918c,0x1);}else if(ifInterval(_0x2d918c['dialPredictiveInterval'],_0x2d918c[_0x58a5('0x2c')])){this['handlePower'](_0x2d918c,0x1);loggerPredictiveCalls[_0x58a5('0x87')](_0x58a5('0x1cb'),_0x2d918c[_0x58a5('0x2c')],_0x2d918c[_0x58a5('0x44')]);_0x2d918c[_0x58a5('0x76')]=0x0;_0x2d918c[_0x58a5('0x6f')]=0x0;}else if(_0x513423<_0x1598e0&&_0x2d918c[_0x58a5('0x1cc')]===_0x58a5('0x1cd')){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x1ce'),_0x58a5('0x1cf'),_0x1598e0,_0x58a5('0x2c'),_0x2d918c[_0x58a5('0x44')]);}else if(_0x48d442<_0x2d918c['predictiveIntervalErlangCallsDroppedCalls']&&_0x2d918c['dialPredictiveOptimization']===_0x58a5('0x1cd')){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x1d0'),'Max\x20Drop\x20',_0x48d442,_0x58a5('0x1d1'),_0x2d918c[_0x58a5('0x6f')],_0x58a5('0x2c'),_0x2d918c[_0x58a5('0x44')]);}else if(!ifInterval(_0x2d918c[_0x58a5('0x1d2')],_0x2d918c['startProgressive'])&&_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x7a')])&&!_[_0x58a5('0x41')](_0x2d918c[_0x58a5('0x2c')])){_0x2d918c[_0x58a5('0x7a')]=moment()[_0x58a5('0x7e')](_0x58a5('0x101'));loggerPredictive[_0x58a5('0x87')](_0x2d918c['name'],_0x58a5('0x1d3'),_0x2d918c['startPredictive']);this[_0x58a5('0xbd')](_0x2d918c[_0x58a5('0x1d2')])[_0x58a5('0xb7')](this[_0x58a5('0x1d4')](_0x2d918c))['then'](mergeDataErlangB(_0x2d918c))[_0x58a5('0xb7')](this[_0x58a5('0x1d5')](_0x2d918c))[_0x58a5('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x2d918c));}else if(!ifInterval(_0x2d918c[_0x58a5('0x1d2')],_0x2d918c[_0x58a5('0x7a')])){_0x2d918c[_0x58a5('0x6f')]=0x0;_0x2d918c[_0x58a5('0x7a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],_0x58a5('0x1d6'),_0x2d918c[_0x58a5('0x7a')]);clearInterval(_0x2d918c[_0x58a5('0x94')]);_0x2d918c[_0x58a5('0x94')]=undefined;this[_0x58a5('0xbd')](_0x2d918c[_0x58a5('0x1d2')])[_0x58a5('0xb7')](this[_0x58a5('0x1d4')](_0x2d918c))[_0x58a5('0xb7')](mergeDataErlangB(_0x2d918c))[_0x58a5('0xb7')](this[_0x58a5('0x1d5')](_0x2d918c))[_0x58a5('0xb8')](loggerCatchPredictive(_0x58a5('0x1d7'),_0x2d918c));}else if(_0x2d918c[_0x58a5('0x73')]&&_0x16f90d<_0x2d918c[_0x58a5('0x73')]-_0x290ad6){freeVariablesPredictive(_0x2d918c);loggerPredictive['info'](_0x2d918c['name'],_0x58a5('0x1d8'),_0x16f90d,_0x58a5('0x1d9'),_0x2d918c[_0x58a5('0x73')],'-',_0x290ad6,'=',_0x2d918c[_0x58a5('0x73')]-_0x290ad6,')');}else if(_0x2d918c[_0x58a5('0x73')]&&_0x16f90d>_0x2d918c[_0x58a5('0x73')]+_0x27fbdb){freeVariablesPredictive(_0x2d918c);loggerPredictive[_0x58a5('0x87')](_0x2d918c[_0x58a5('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x16f90d,')\x20are\x20more\x20than\x20threshold\x20(',_0x2d918c['predictiveIntervalAvailable'],'+',_0x27fbdb,'=',_0x2d918c[_0x58a5('0x73')]+_0x27fbdb,')');}};Dialer[_0x58a5('0x1e')][_0x58a5('0x1d4')]=function(_0x516910){var _0xa2fc53=this;return function(_0x13877b){return new BPromise(function(_0x2ab2b7,_0x58c101){_['merge'](_0x516910,_0x13877b[0x0]);if(checkGetDataPredictive(_0x13877b[0x0])){var _0x4acd6f=_0x516910[_0x58a5('0x73')]=_0x516910[_0x58a5('0x59')]+_0x516910[_0x58a5('0x53')];var _0x5784a0=_0x516910[_0x58a5('0x1d2')]*0x3c;var _0x210f41=_0x13877b[0x0][_0x58a5('0x6c')]+_0x13877b[0x0][_0x58a5('0x1da')];var _0x536f58=(_0x13877b[0x0][_0x58a5('0x6b')]+_0x13877b[0x0][_0x58a5('0x6e')]+_0x13877b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x13877b[0x0][_0x58a5('0x74')];_0x516910[_0x58a5('0x70')]=_0x536f58>0x0?_0x536f58:0x1;switch(_0x516910[_0x58a5('0x1cc')]){case _0x58a5('0x1cd'):var _0x2bb8f4=_0x516910[_0x58a5('0x1c5')]/0x64;return _0xa2fc53[_0x58a5('0x1db')](_0x4acd6f,_0x5784a0,_0x210f41,_0x536f58,_0x2bb8f4)[_0x58a5('0xb7')](function(_0x1a610d){return _0x2ab2b7(_0x1a610d);});case _0x58a5('0x1dc'):var _0x5b4a83=_0x516910[_0x58a5('0x1c5')]/0x64;return _0xa2fc53[_0x58a5('0x1dd')](_0x4acd6f,_0x5784a0,_0x210f41,_0x536f58,_0x5b4a83)[_0x58a5('0xb7')](function(_0x4b386f){return _0x2ab2b7(_0x4b386f);});default:return _0x58c101(msgResponse(_0x58a5('0x1de'),_0x58a5('0x148'),_0x58a5('0x1df')));}}else{return _0x58c101(msgResponse(_0x58a5('0x1de'),_0x58a5('0x148'),_0x58a5('0x1e0')));}});};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1e1')]=function(_0x43fa20){var _0x1777f5=this;return function(_0x2d074d){return new BPromise(function(_0xc010d,_0x244eed){_['merge'](_0x43fa20,_0x2d074d[0x0]);if(checkGetDataPredictive(_0x2d074d[0x0])){loggerPredictive[_0x58a5('0x87')](JSON[_0x58a5('0x7d')](_0x2d074d[0x0]));if(_0x43fa20[_0x58a5('0x1cc')]==='dropRate'){return _0x1777f5[_0x58a5('0xc7')](_0x43fa20['id'])[_0x58a5('0xb7')](function(_0x26fb9f){var _0x46faca=_0x43fa20[_0x58a5('0x54')]-_0x26fb9f[0x0][_0x58a5('0x1e2')];var _0x1ec02f=_0x43fa20[_0x58a5('0x1d2')]*0x3c;var _0x294470=_0x2d074d[0x0]['predictiveIntervalAvgTalktime']+_0x2d074d[0x0][_0x58a5('0x1da')];var _0x1cfd4a=(_0x2d074d[0x0][_0x58a5('0x6b')]+_0x2d074d[0x0][_0x58a5('0x6e')]+_0x2d074d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2d074d[0x0][_0x58a5('0x74')];var _0x1251f7=_0x43fa20[_0x58a5('0x1c5')]/0x64;_0x43fa20[_0x58a5('0x72')]=_0x26fb9f[0x0][_0x58a5('0x1e2')]||0x0;_0x43fa20[_0x58a5('0x70')]=_0x1cfd4a>0x0?_0x1cfd4a:0x1;return _0x1777f5[_0x58a5('0x1db')](_0x46faca,_0x1ec02f,_0x294470,_0x1cfd4a,_0x1251f7);})[_0x58a5('0xb7')](function(_0x2e04e3){return _0xc010d(_0x2e04e3);})[_0x58a5('0xb8')](function(_0x1c4cbb){return _0x244eed(msgResponse('[CatchErlangB]',_0x58a5('0x148'),JSON['stringify'](_0x1c4cbb)));});}if(_0x43fa20[_0x58a5('0x1cc')]===_0x58a5('0x1dc')){return _0x1777f5[_0x58a5('0xc7')](_0x43fa20['id'])[_0x58a5('0xb7')](function(_0x3bf6ab){var _0x34dd85=_0x43fa20[_0x58a5('0x54')]-_0x3bf6ab[0x0][_0x58a5('0x1e2')];var _0x2cb63b=_0x43fa20[_0x58a5('0x1d2')]*0x3c;var _0x3f6985=_0x2d074d[0x0][_0x58a5('0x6c')]+_0x2d074d[0x0][_0x58a5('0x1da')];var _0x12fec9=(_0x2d074d[0x0]['predictiveIntervalAnsweredCalls']+_0x2d074d[0x0][_0x58a5('0x6e')]+_0x2d074d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2d074d[0x0]['predictiveIntervalTotalCalls'];var _0xd93d8f=_0x43fa20[_0x58a5('0x1c5')]/0x64;_0x43fa20[_0x58a5('0x72')]=_0x3bf6ab[0x0]['outboundQueuePauses']||0x0;_0x43fa20[_0x58a5('0x70')]=_0x12fec9>0x0?_0x12fec9:0x1;return _0x1777f5[_0x58a5('0x1dd')](_0x34dd85,_0x2cb63b,_0x3f6985,_0x12fec9,_0xd93d8f);})[_0x58a5('0xb7')](function(_0x13936){return _0xc010d(_0x13936);})[_0x58a5('0xb8')](function(_0x340217){return _0x244eed(msgResponse(_0x58a5('0x1e3'),_0x58a5('0x148'),JSON['stringify'](_0x340217)));});}}else{return _0x244eed(msgResponse(_0x58a5('0x1de'),'Failure',_0x58a5('0x1e0')));}});};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1d5')]=function(_0x108179){var _0x1e1182=this;return function(){var _0x4e9ef0=0x0;var _0x3f6a2f=Math[_0x58a5('0x1c8')](_0x108179['erlangCallToSecond']*0x3e8);if(_0x3f6a2f>0x0){_0x3f6a2f=_0x3f6a2f<0x64?0x64:_0x3f6a2f;loggerPredictive['info'](_0x108179[_0x58a5('0x44')],'one\x20call\x20every:',_0x3f6a2f,_0x58a5('0x4d'));_0x108179[_0x58a5('0x94')]=setInterval(function(){_0x1e1182[_0x58a5('0x94')](_0x108179);loggerPredictiveCalls[_0x58a5('0x87')](_0x58a5('0x1e4'),_0x4e9ef0+=0x1);},_0x3f6a2f);}else{loggerPredictive['info'](_0x108179['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x58a5('0x1e')][_0x58a5('0x1e5')]=function(_0x3db520,_0x3c2e42){var _0x4f4aef=this;return function(_0x322e37){if(_['isEmpty'](_0x322e37)){if(_['isNil'](_0x3c2e42['UserId'])||!_0x3c2e42['recallme']){if(_0x3db520[_0x58a5('0x15e')]==='booked'){_0x3db520[_0x58a5('0x132')]=_[_0x58a5('0x41')](_0x3db520['queueStatusComplete'])?!![]:_0x3db520[_0x58a5('0x132')];var _0x186d0a=uuid['v4']();_0x4f4aef[_0x58a5('0x129')][_0x186d0a]=new Action(_0x3db520,_0x3c2e42,_0x186d0a);loggerBooked[_0x58a5('0x87')](_0x58a5('0x1e6'),_0x186d0a,_0x58a5('0x1e7'),JSON[_0x58a5('0x7d')](_0x3db520[_0x58a5('0x132')]),_0x58a5('0x1e8'),_0x3db520[_0x58a5('0x44')]);if(_0x3db520['queueStatusComplete']){_0x3db520[_0x58a5('0x132')]=![];_0x4f4aef['queueBooked'][_0x4f4aef['actions'][_0x186d0a]['queue']]=[];ami[_0x58a5('0xb0')]({'actionid':_0x186d0a,'action':_0x58a5('0x1e9'),'queue':_0x3db520[_0x58a5('0x44')]})[_0x58a5('0xb8')](function(){_0x4f4aef[_0x58a5('0xb3')](_0x3db520);_0x4f4aef['rescheduleContact']({'active':![],'ContactId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a]['ContactId'],'ListId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a][_0x58a5('0xd3')],'VoiceQueueId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0x102')]||undefined,'CampaignId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1ea')));delete _0x4f4aef['actions'][_0x186d0a];});}else{loggerBooked[_0x58a5('0x87')]('[booked][checkContactBlack][else]',JSON[_0x58a5('0x7d')](_0x3db520['queueStatusComplete']),_0x58a5('0x1e8'),_0x3db520[_0x58a5('0x44')]);_0x4f4aef['updateOriginated'](_0x3db520);_0x4f4aef[_0x58a5('0xc0')]({'active':![],'ContactId':_0x4f4aef['actions'][_0x186d0a]['ContactId'],'ListId':_0x4f4aef['actions'][_0x186d0a][_0x58a5('0xd3')],'VoiceQueueId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a]['VoiceQueueId']||undefined,'CampaignId':_0x4f4aef[_0x58a5('0x129')][_0x186d0a][_0x58a5('0xd5')]||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1ea')));delete _0x4f4aef[_0x58a5('0x129')][_0x186d0a];}}else{return _0x4f4aef['actionOriginate'](_0x3db520,_0x3c2e42);}}else{if(getDiff(_0x3c2e42[_0x58a5('0x1eb')])<_0x3db520[_0x58a5('0x1ec')]*0x3c){if(_0x3c2e42['Agent']&&!_0x3c2e42[_0x58a5('0x1ed')][_0x58a5('0x1ee')]){_0x4f4aef[_0x58a5('0x23')]['run'](_0x3c2e42['id'])['finally'](function(){_0x4f4aef['updateOriginated'](_0x3db520);});}else{_0x4f4aef['unlockContact']({'active':![]},_0x3c2e42['id'],0x1)[_0x58a5('0x21')](function(){_0x4f4aef[_0x58a5('0xb3')](_0x3db520);});}}else{_0x3db520['outboundReCallsDay']+=0x1;_0x4f4aef[_0x58a5('0xb3')](_0x3db520);if(_0x3db520[_0x58a5('0x1ef')]){_0x4f4aef[_0x58a5('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c2e42[_0x58a5('0xd2')],'ListId':_0x3c2e42[_0x58a5('0xd3')],'VoiceQueueId':_0x3c2e42['VoiceQueueId']||undefined,'CampaignId':_0x3c2e42['CampaignId']||undefined})[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1f0')));_0x4f4aef['createHistory'](createObjHistory(_0x3db520,_0x3c2e42,'RECALLINQUEUE',0x17,_0x58a5('0x1f1')))[_0x58a5('0xb8')](loggerCatch(_0x58a5('0x1f2')));}else{_0x4f4aef['saveInDb'](createObjHistory(_0x3db520,_0x3c2e42,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x58a5('0x1f3'));}}}}else{_0x3db520[_0x58a5('0x1f4')]+=0x1;_0x4f4aef['saveInDb'](createObjHistory(_0x3db520,_0x3c2e42,'BLACKLIST',0xd,_0x58a5('0x1f5')),_0x58a5('0x1f6'),_0x58a5('0x1f7'));throw _0x58a5('0x1f8');}};};Dialer['prototype'][_0x58a5('0x15d')]=function(_0x1a1fc4){var _0x3d07ff=this;var _0x588c3b=_0x1a1fc4[_0x58a5('0x1f9')]-_0x1a1fc4[_0x58a5('0x75')]-_0x1a1fc4[_0x58a5('0xc4')];emitCampaignSummary(_0x1a1fc4);if(_0x588c3b>0x0){if(_0x588c3b>this[_0x58a5('0x27')]){_0x588c3b=this[_0x58a5('0x27')];}_0x1a1fc4['temp']+=_0x588c3b;this[_0x58a5('0xc5')](_0x1a1fc4['id'],_0x588c3b,_0x1a1fc4['dialOrderByScheduledAt'],_0x1a1fc4)[_0x58a5('0xb7')](function(_0x3e4ab4){_0x1a1fc4[_0x58a5('0xc4')]-=_0x588c3b;_0x1a1fc4[_0x58a5('0xc4')]=_0x1a1fc4[_0x58a5('0xc4')]>0x0?_0x1a1fc4[_0x58a5('0xc4')]:0x0;if(!checkContactEmpty(_0x3e4ab4)){_0x1a1fc4[_0x58a5('0x42')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x58a5('0x87')]('[getContactCampaign2][Empty]'+_0x1a1fc4['name']);}else{_0x1a1fc4[_0x58a5('0x75')]+=_0x3e4ab4[_0x58a5('0x137')];_0x1a1fc4['message']=_0x58a5('0x1fa');for(var _0x1b7a50=0x0;_0x1b7a50<_0x3e4ab4['length'];_0x1b7a50+=0x1){_0x1a1fc4['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x3e4ab4[_0x1b7a50])||_[_0x58a5('0xe1')](_0x3e4ab4[_0x1b7a50][_0x58a5('0x16b')])||_[_0x58a5('0xe1')](_0x3e4ab4[_0x1b7a50][_0x58a5('0x16b')][_0x58a5('0x16a')])){_0x3d07ff[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0x1a1fc4,_0x3e4ab4[_0x1b7a50]);}else{_0x3d07ff[_0x58a5('0xbc')](_[_0x58a5('0xd1')](_0x3e4ab4[_0x1b7a50],[_0x58a5('0xd5'),_0x58a5('0x1fc')]))[_0x58a5('0xb7')](_0x3d07ff[_0x58a5('0x1e5')](_0x1a1fc4,_0x3e4ab4[_0x1b7a50]))[_0x58a5('0xb8')](_0x3d07ff['loggerHandler']('[actionOriginateIvr]\x20',_0x1a1fc4));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x1a1fc4,_0x588c3b));}};Dialer[_0x58a5('0x1e')]['handlePower']=function(_0x2dfb6c,_0x5ce1e1){var _0x3db894=this;var _0x4794c5=[];var _0x5348c4=_0x5ce1e1>=0x1?_0x5ce1e1:0x1;if(_0x2dfb6c['dialMethod']===_0x58a5('0xa')){_0x5348c4=0x1;}var _0x3f9bb8=Math[_0x58a5('0x1c8')](_0x2dfb6c[_0x58a5('0x53')]*_0x5348c4)-_0x2dfb6c[_0x58a5('0x75')]-_0x2dfb6c[_0x58a5('0xc4')];emitVoiceQueueSummary(_0x2dfb6c);if(_0x2dfb6c['dialLimitQueue']>0x0){var _0x5ce7c6=_0x2dfb6c[_0x58a5('0x1fd')]-_0x2dfb6c[_0x58a5('0x75')]-_0x2dfb6c[_0x58a5('0x59')]-_0x2dfb6c[_0x58a5('0xc4')]-_0x2dfb6c[_0x58a5('0x55')];if(_0x3f9bb8>_0x5ce7c6){_0x3f9bb8=_0x5ce7c6;}}if(_0x3f9bb8>0x0){if(_0x2dfb6c[_0x58a5('0x15e')]==='booked'){_0x3f9bb8=0x1;}if(_0x3f9bb8>this[_0x58a5('0x27')]){_0x3f9bb8=this['maxNumberOriginate'];}_0x2dfb6c[_0x58a5('0xc4')]+=_0x3f9bb8;for(var _0x23ded6 in this[_0x58a5('0x26')]){if(typeof this[_0x58a5('0x26')][_0x23ded6]!==_0x58a5('0x9d')){if(this[_0x58a5('0x26')][_0x23ded6][_0x58a5('0xa9')]==='not_inuse'&&this[_0x58a5('0x26')][_0x23ded6][_0x58a5('0xdb')]===_0x58a5('0xdc')){_0x4794c5[_0x58a5('0x130')](this['agents'][_0x23ded6]['id']);}}}this[_0x58a5('0xc3')](_0x2dfb6c['id'],_0x4794c5,_0x3f9bb8,_0x2dfb6c[_0x58a5('0x1fe')],_0x2dfb6c)['then'](function(_0x13ef64){_0x2dfb6c[_0x58a5('0xc4')]-=_0x3f9bb8;_0x2dfb6c[_0x58a5('0xc4')]=_0x2dfb6c[_0x58a5('0xc4')]>0x0?_0x2dfb6c[_0x58a5('0xc4')]:0x0;if(!checkContactEmpty(_0x13ef64)){_0x3db894[_0x58a5('0xb5')](_0x2dfb6c)[_0x58a5('0xb7')](sendMessageReschedule(_0x2dfb6c))['catch'](loggerCatch(_0x58a5('0xb9')));}else{_0x2dfb6c['originated']+=_0x13ef64[_0x58a5('0x137')];_0x2dfb6c[_0x58a5('0x42')]=_0x2dfb6c[_0x58a5('0x15e')]==='booked'?_0x58a5('0x171'):'RUNNING';for(var _0x343ab5=0x0;_0x343ab5<_0x13ef64[_0x58a5('0x137')];_0x343ab5+=0x1){if(_[_0x58a5('0xe1')](_0x13ef64[_0x343ab5])||_['isNil'](_0x13ef64[_0x343ab5][_0x58a5('0x16b')])||_['isNil'](_0x13ef64[_0x343ab5][_0x58a5('0x16b')][_0x58a5('0x16a')])){_0x3db894[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0x2dfb6c,_0x13ef64[_0x343ab5]);}else{_0x3db894[_0x58a5('0xba')](_[_0x58a5('0xd1')](_0x13ef64[_0x343ab5],[_0x58a5('0x102'),_0x58a5('0x1fc')]))['then'](_0x3db894[_0x58a5('0x1e5')](_0x2dfb6c,_0x13ef64[_0x343ab5]))['catch'](_0x3db894[_0x58a5('0xce')](_0x58a5('0x1fb'),_0x2dfb6c));}}}})[_0x58a5('0xb8')](loggerGetContactDialer(_0x58a5('0x1ff'),_0x2dfb6c,_0x3f9bb8));}};Dialer['prototype'][_0x58a5('0x94')]=function(_0x5c87b1){if(_0x5c87b1[_0x58a5('0x1fd')]>0x0){var _0x421c9e=_0x5c87b1[_0x58a5('0x1fd')]-_0x5c87b1[_0x58a5('0x75')]-_0x5c87b1[_0x58a5('0x59')];if(_0x421c9e>0x0){this[_0x58a5('0x200')](_0x5c87b1);}else{loggerPredictiveCalls['info'](_0x58a5('0x201'));}}else{this[_0x58a5('0x200')](_0x5c87b1);}};Dialer[_0x58a5('0x1e')][_0x58a5('0x200')]=function(_0xf62576){var _0x337412=this;var _0x5c6b3a=[];_0xf62576[_0x58a5('0x75')]+=0x1;for(var _0x3527e8 in this['agents']){if(typeof this['agents'][_0x3527e8]!==_0x58a5('0x9d')){if(this[_0x58a5('0x26')][_0x3527e8][_0x58a5('0xa9')]===_0x58a5('0x202')&&this['agents'][_0x3527e8]['status']===_0x58a5('0xdc')){_0x5c6b3a[_0x58a5('0x130')](this['agents'][_0x3527e8]['id']);}}}this['getContactDialer'](_0xf62576['id'],_0x5c6b3a,0x1,_0xf62576[_0x58a5('0x1fe')],_0xf62576)[_0x58a5('0xb7')](function(_0x344271){if(!checkContactEmpty(_0x344271)){checkContactLowerLimitOriginate(_0xf62576,0x1,0x0);_0x337412[_0x58a5('0xb5')](_0xf62576)[_0x58a5('0xb7')](sendMessageReschedule(_0xf62576))['catch'](loggerCatch(_0x58a5('0xb9')));}else{_0xf62576['message']=_0x58a5('0x1fa');if(_[_0x58a5('0xe1')](_0x344271[0x0])||_[_0x58a5('0xe1')](_0x344271[0x0]['Contact'])||_['isNil'](_0x344271[0x0][_0x58a5('0x16b')]['phone'])){_0x337412[_0x58a5('0xcf')](_0x58a5('0x1fb'),_0xf62576,_0x344271[0x0]);}else{_0x337412[_0x58a5('0xba')](_['pick'](_0x344271[0x0],[_0x58a5('0x102'),'Contact.phone']))[_0x58a5('0xb7')](_0x337412['checkContactBlack'](_0xf62576,_0x344271[0x0]))[_0x58a5('0xb8')](_0x337412[_0x58a5('0xce')](_0x58a5('0x203'),_0xf62576));}}})[_0x58a5('0xb8')](loggerGetContactDialer(_0x58a5('0x204'),_0xf62576,0x1));emitVoiceQueueSummary(_0xf62576);};Dialer[_0x58a5('0x1e')][_0x58a5('0x1db')]=function(_0x4fadcd,_0x5b38ea,_0x549c9f,_0x41c09f,_0x46e33d,_0x317ecc){loggerPredictive[_0x58a5('0x87')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x58a5('0x87')](_0x58a5('0x205'),_0x4fadcd);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x206'),_0x5b38ea);loggerPredictive['info'](_0x58a5('0x207'),_0x549c9f);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x208'),_0x41c09f);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46e33d);loggerPredictive[_0x58a5('0x87')]('---------------------------');return new BPromise(function(_0x1b7580,_0x45c06b){if(_0x4fadcd<=0x0||isNaN(_0x4fadcd)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),'m\x20=\x20'+_0x4fadcd));}if(_0x549c9f<=0x0||isNaN(_0x549c9f)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),_0x58a5('0x20a')+_0x549c9f));}if(_0x41c09f<=0x0||isNaN(_0x41c09f)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),_0x58a5('0x20b')+_0x41c09f));}if(_0x5b38ea<=0x0||isNaN(_0x5b38ea)){return _0x45c06b(msgResponse(_0x58a5('0x209'),_0x58a5('0x4c'),'interval\x20=\x20'+_0x5b38ea));}if(_0x46e33d<=0x0||isNaN(_0x46e33d)){return _0x45c06b(msgResponse('[abandonmentRate]',_0x58a5('0x4c'),_0x58a5('0x20c')+_0x46e33d));}_0x317ecc=_0x317ecc||0x0;var _0xaade06=0x1/_0x549c9f;var _0x16d24b=0x0;var _0x40e01f=0x0;var _0x59351a=0x0;var _0x33adfa=0x0;for(var _0x22f2e4=0x0;_0x59351a<_0x46e33d;_0x22f2e4+=0x1){_0x40e01f=_0x22f2e4/_0x5b38ea;_0x16d24b=(_0x41c09f*_0x40e01f+_0x317ecc)/_0xaade06;_0x59351a=erlangb(_0x16d24b,_0x4fadcd);_0x33adfa=_0x16d24b/_0x4fadcd*(0x1-erlangb(_0x16d24b,_0x4fadcd));}return _0x1b7580({'erlangCalls':_0x22f2e4,'erlangCallToSecond':_0x5b38ea/_0x22f2e4,'erlangAbandonmentRate':_0x59351a,'erlangBusyFactor':_0x33adfa});});};Dialer[_0x58a5('0x1e')]['busyFactor']=function(_0x15c92e,_0x33a4d9,_0x13586c,_0x23b329,_0x30ef85,_0x53b0b0){loggerPredictive[_0x58a5('0x87')](_0x58a5('0x20d'));loggerPredictive[_0x58a5('0x87')](_0x58a5('0x205'),_0x15c92e);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x33a4d9);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x207'),_0x13586c);loggerPredictive['info'](_0x58a5('0x208'),_0x23b329);loggerPredictive[_0x58a5('0x87')](_0x58a5('0x20e'),_0x30ef85);loggerPredictive[_0x58a5('0x87')]('---------------------------');return new BPromise(function(_0x182e16,_0x3c0542){if(_0x15c92e<=0x0||isNaN(_0x15c92e)){return _0x3c0542(msgResponse('[busyFactor]',_0x58a5('0x4c'),'m\x20=\x20'+_0x15c92e));}if(_0x13586c<=0x0||isNaN(_0x13586c)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x20a')+_0x13586c));}if(_0x23b329<=0x0||isNaN(_0x23b329)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x20b')+_0x23b329));}if(_0x33a4d9<=0x0||isNaN(_0x33a4d9)){return _0x3c0542(msgResponse(_0x58a5('0x20f'),_0x58a5('0x4c'),_0x58a5('0x210')+_0x33a4d9));}if(_0x30ef85<=0x0||isNaN(_0x30ef85)){return _0x3c0542(msgResponse('[busyFactor]',_0x58a5('0x4c'),'Umin\x20=\x20'+_0x30ef85));}_0x53b0b0=_0x53b0b0||0x0;var _0x1cadb9=0x1/_0x13586c;var _0x17b30b=0x0;var _0x5d776d=0x0;var _0x4a8f17=0x0;var _0x248bb8=0x0;for(var _0x44412a=0x0;_0x248bb8<_0x30ef85;_0x44412a+=0x1){_0x5d776d=_0x44412a/_0x33a4d9;_0x17b30b=(_0x23b329*_0x5d776d+_0x53b0b0)/_0x1cadb9;_0x4a8f17=erlangb(_0x17b30b,_0x15c92e);_0x248bb8=_0x17b30b/_0x15c92e*(0x1-erlangb(_0x17b30b,_0x15c92e));}return _0x182e16({'erlangCalls':_0x44412a,'erlangCallToSecond':_0x33a4d9/_0x44412a,'erlangAbandonmentRate':_0x4a8f17,'erlangBusyFactor':_0x248bb8});});};module[_0x58a5('0x211')]=Dialer;
\ No newline at end of file
+var _0x0269=['value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','countnoanswerretry','countabandonedretry','createStateFinal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','locked','paused','stateinterface','actionid','rrmemory','push','merge','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','strategy','preview','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','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','\x20Timezone\x20unknow\x20','isArray','command','interval','indexOf','true','all','some','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[getDataPredictive]','floor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','checkContactBlack','[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','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','Error','m\x20=\x20','[abandonmentRate]','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','Umin\x20=\x20','util','bluebird','moment','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','emit','type','outbound','answered','available','loggedIn','pTalking','sumHoldTime','talking','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','Trunk','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','then','[countReScheduled]\x20','resolve','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[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','VoiceQueueId','[emptyContact]','isSuccess','active','status','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive'];(function(_0x3f5238,_0x39e5b6){var _0x115624=function(_0x57db3a){while(--_0x57db3a){_0x3f5238['push'](_0x3f5238['shift']());}};_0x115624(++_0x39e5b6);}(_0x0269,0x135));var _0x9026=function(_0x2c0a78,_0x44fc6e){_0x2c0a78=_0x2c0a78-0x0;var _0x426076=_0x0269[_0x2c0a78];return _0x426076;};'use strict';var util=require(_0x9026('0x0'));var _=require('lodash');var BPromise=require(_0x9026('0x1'));var uuid=require('uuid');var moment=require(_0x9026('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x9026('0x3'));var ut=require(_0x9026('0x4'));var config=require(_0x9026('0x5'));var logger=require(_0x9026('0x6'))('dialer');var loggerBooked=require(_0x9026('0x6'))(_0x9026('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x9026('0x6'))(_0x9026('0x8'));var loggerSyncQueueSummary=require(_0x9026('0x6'))(_0x9026('0x9'));var ami=require('../ami');config[_0x9026('0xa')]=_[_0x9026('0xb')](config[_0x9026('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x9026('0xc'))(new Redis(config[_0x9026('0xa')]));var cmHopper=require(_0x9026('0xd'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x9026('0xe'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x9026('0xf'));var History=require(_0x9026('0x10'));var Final=require(_0x9026('0x11'));var AgentComplete=require(_0x9026('0x12'));var QueueCallerAbandon=require(_0x9026('0x13'));var Hangup=require(_0x9026('0x14'));var ipAgi=process[_0x9026('0x15')]['XCALLY_IP_AGI']||_0x9026('0x16');var strategy={'rrmemory':'rrmemory','roundrobin':_0x9026('0x17')};var Sequence=function(){};Sequence[_0x9026('0x18')][_0x9026('0x19')]=function(_0xe7b66a){this[_0x9026('0x1a')]=this[_0x9026('0x1a')]?this[_0x9026('0x1a')][_0x9026('0x1b')](_0xe7b66a):_0xe7b66a();};function Dialer(_0x5d5053,_0x401438){this[_0x9026('0x1c')]=new Sequence();this['preview']=_0x401438;this[_0x9026('0x1d')]=_0x5d5053[_0x9026('0x1d')];this[_0x9026('0x1e')]=_0x5d5053[_0x9026('0x1e')];this[_0x9026('0x1f')]=_0x5d5053[_0x9026('0x1f')];this[_0x9026('0x20')]=_0x5d5053[_0x9026('0x20')];this['maxNumberOriginate']=config[_0x9026('0x21')]||0x2;this['channels']={};this[_0x9026('0x22')]={};this['contactsId']={};this[_0x9026('0x23')]={};this[_0x9026('0x24')]={};this[_0x9026('0x25')]={};this[_0x9026('0x26')]={};this[_0x9026('0x27')]={};this[_0x9026('0x28')]={};this[_0x9026('0x29')]={};ami['on'](_0x9026('0x2a'),this[_0x9026('0x2b')]['bind'](this));ami['on']('queuecallerabandon',this[_0x9026('0x2c')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x2e'),this[_0x9026('0x2f')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x30'),this[_0x9026('0x31')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x32'),this[_0x9026('0x9')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x33'),this[_0x9026('0x34')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x35'),this[_0x9026('0x36')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x37'),this[_0x9026('0x38')]['bind'](this));ami['on'](_0x9026('0x39'),this[_0x9026('0x3a')][_0x9026('0x2d')](this));ami['on'](_0x9026('0x3b'),this[_0x9026('0x3c')][_0x9026('0x2d')](this));this[_0x9026('0x3d')]();this[_0x9026('0x3e')]();}function isNotNull(_0x2b2f4c){return _0x2b2f4c!==null&&!_[_0x9026('0x3f')](_0x2b2f4c);}function checkIsLoggedIn(_0x24fa55,_0x5d2672){return function(){if(_0x5d2672<=0x0){_0x24fa55[_0x9026('0x40')]=_0x9026('0x41');throw _0x24fa55[_0x9026('0x42')]+_0x9026('0x43');}};}function isActive(_0x45a4ea){return _0x45a4ea;}function checkIsActive(_0x2bea6d,_0x275f2a){return function(){if(!isActive(_0x275f2a)){_0x2bea6d['message']=_0x9026('0x44');throw _0x2bea6d['name']+_0x9026('0x45');}};}function checkInterval(_0x473d93){return function(){if(!isNotNull(_0x473d93[_0x9026('0x46')])){_0x473d93[_0x9026('0x40')]=_0x9026('0x47');throw _0x473d93[_0x9026('0x42')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x473d93[_0x9026('0x46')][_0x9026('0x48')])){_0x473d93[_0x9026('0x40')]=_0x9026('0x47');throw _0x473d93['name']+_0x9026('0x49');}if(!isNotNull(_[_0x9026('0x4a')](_0x473d93['Interval'][_0x9026('0x48')]))){_0x473d93[_0x9026('0x40')]=_0x9026('0x47');throw _0x473d93[_0x9026('0x42')]+_0x9026('0x49');}};}function msgResponse(_0x7943af,_0x7fc64c,_0x431901){return{'action':_0x7943af,'response':_0x7fc64c,'message':_0x431901,'stack':_0x431901};}function myreject(_0x4e3e68){return function(_0x476950){return _0x4e3e68(msgResponse(_0x9026('0x4b'),'Error',JSON[_0x9026('0x4c')](_0x476950)));};}function getSeconds(_0x1de27c,_0xf5085e){var _0xf44a47=moment(_0x1de27c)[_0x9026('0x4d')](0x0);var _0x240f8a=moment(_0xf5085e)[_0x9026('0x4d')](0x0);return _0xf44a47[_0x9026('0x4e')](_0x240f8a,'seconds');}function emit(_0x9c46ba,_0x3257b9,_0x120da4){io['to'](_0x9c46ba)[_0x9026('0x4f')](_0x3257b9,_0x120da4);}function emitVoiceQueueSummary(_0x1fc5cc){if(_0x1fc5cc[_0x9026('0x50')]===_0x9026('0x51')){var _0x4c950e={'id':_0x1fc5cc['id'],'name':_0x1fc5cc[_0x9026('0x42')],'strategy':_0x1fc5cc['strategy'],'answered':_0x1fc5cc[_0x9026('0x52')],'available':_0x1fc5cc[_0x9026('0x53')],'loggedIn':_0x1fc5cc[_0x9026('0x54')],'pTalking':_0x1fc5cc[_0x9026('0x55')],'sumBillable':_0x1fc5cc['sumBillable'],'sumDuration':_0x1fc5cc['sumDuration'],'sumHoldTime':_0x1fc5cc[_0x9026('0x56')]||0x0,'talking':_0x1fc5cc[_0x9026('0x57')],'total':_0x1fc5cc['total'],'type':_0x1fc5cc['type'],'unmanaged':_0x1fc5cc['unmanaged'],'abandoned':_0x1fc5cc[_0x9026('0x58')],'waiting':_0x1fc5cc[_0x9026('0x59')],'loggedInDb':_0x1fc5cc['loggedInDb'],'dialActive':_0x1fc5cc[_0x9026('0x5a')],'dialMethod':_0x1fc5cc[_0x9026('0x5b')],'dialOriginateCallerIdName':_0x1fc5cc[_0x9026('0x5c')],'dialOriginateCallerIdNumber':_0x1fc5cc[_0x9026('0x5d')],'dialOriginateTimeout':_0x1fc5cc[_0x9026('0x5e')],'dialPrefix':_0x1fc5cc[_0x9026('0x5f')],'outboundAnswerAgiCallsDay':_0x1fc5cc[_0x9026('0x60')],'outboundAnswerCallsDay':_0x1fc5cc[_0x9026('0x61')],'outboundBlacklistCallsDay':_0x1fc5cc['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1fc5cc[_0x9026('0x62')],'outboundCongestionCallsDay':_0x1fc5cc[_0x9026('0x63')],'outboundDropCallsDayACS':_0x1fc5cc['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1fc5cc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1fc5cc['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1fc5cc[_0x9026('0x64')],'outboundNoSuchCallsDay':_0x1fc5cc[_0x9026('0x65')],'outboundOriginateFailureCallsDay':_0x1fc5cc[_0x9026('0x66')],'outboundReCallsDay':_0x1fc5cc[_0x9026('0x67')],'outboundRejectCallsDay':_0x1fc5cc[_0x9026('0x68')],'outboundUnknownCallsDay':_0x1fc5cc['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1fc5cc[_0x9026('0x69')],'predictiveIntervalAvgHoldtime':_0x1fc5cc['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1fc5cc[_0x9026('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x1fc5cc[_0x9026('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x1fc5cc[_0x9026('0x6c')],'predictiveIntervalErlangCalls':_0x1fc5cc[_0x9026('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x1fc5cc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1fc5cc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1fc5cc[_0x9026('0x6e')],'predictiveIntervalPauses':_0x1fc5cc[_0x9026('0x6f')],'predictiveIntervalAvailable':_0x1fc5cc[_0x9026('0x70')],'predictiveIntervalTotalCalls':_0x1fc5cc[_0x9026('0x71')],'message':_0x1fc5cc[_0x9026('0x40')],'originated':_0x1fc5cc[_0x9026('0x72')],'erlangCalls':_0x1fc5cc['erlangCalls'],'erlangCallToSecond':_0x1fc5cc[_0x9026('0x73')],'erlangAbandonmentRate':_0x1fc5cc['erlangAbandonmentRate'],'erlangBusyFactor':_0x1fc5cc[_0x9026('0x74')],'startPredictive':_0x1fc5cc[_0x9026('0x25')],'startProgressive':_0x1fc5cc['startProgressive']};if(_0x1fc5cc[_0x9026('0x75')]){_0x4c950e['Trunk']={'id':_0x1fc5cc[_0x9026('0x75')]['id'],'name':_0x1fc5cc['Trunk'][_0x9026('0x42')],'active':_0x1fc5cc['Trunk']['active'],'callerid':_0x1fc5cc[_0x9026('0x75')][_0x9026('0x76')]};}if(_0x1fc5cc[_0x9026('0x46')]){_0x4c950e['Interval']={'id':_0x1fc5cc[_0x9026('0x46')]['id'],'name':_0x1fc5cc[_0x9026('0x46')][_0x9026('0x42')]};}var _0x442e5a=md5(JSON[_0x9026('0x4c')](_0x4c950e));if(_0x1fc5cc['md5']!==_0x442e5a){_0x1fc5cc[_0x9026('0x77')]=_0x442e5a;emit(util[_0x9026('0x78')](_0x9026('0x79'),_0x4c950e[_0x9026('0x42')]),_0x9026('0x7a'),_0x4c950e);}}}function emitCampaignSummary(_0x16e09d){if(_0x16e09d['type']===_0x9026('0x7b')){emit(util['format'](_0x9026('0x7c'),_0x16e09d[_0x9026('0x42')]),'campaign:save',_0x16e09d);}}function checkGetDataPredictive(_0xec73c){if(isNotNull(_0xec73c)&&!_[_0x9026('0x4a')](_0xec73c)){loggerPredictive[_0x9026('0x7d')](_0x9026('0x7e'));loggerPredictive[_0x9026('0x7d')](_0x9026('0x7f'),_0xec73c[_0x9026('0x71')]);loggerPredictive[_0x9026('0x7d')](_0x9026('0x80'),_0xec73c[_0x9026('0x69')]);loggerPredictive['info'](_0x9026('0x81'),_0xec73c[_0x9026('0x6c')]);loggerPredictive['info'](_0x9026('0x82'),_0xec73c[_0x9026('0x6b')]);loggerPredictive[_0x9026('0x7d')](_0x9026('0x83'),_0xec73c[_0x9026('0x84')]);loggerPredictive[_0x9026('0x7d')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xec73c[_0x9026('0x6a')]);loggerPredictive['info'](_0x9026('0x85'));if(_0xec73c[_0x9026('0x71')]>0x0){if(!_[_0x9026('0x3f')](_0xec73c['predictiveIntervalAvgTalktime'])&&_0xec73c['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x9026('0x7d')](_0x9026('0x86'));if(!_[_0x9026('0x3f')](_0xec73c[_0x9026('0x84')])&&_0xec73c[_0x9026('0x84')]>0x0){return!![];}loggerPredictive[_0x9026('0x7d')](_0x9026('0x87'));}else{loggerPredictive[_0x9026('0x7d')](_0x9026('0x88'));}}else{loggerPredictive[_0x9026('0x7d')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x56c18a){return function(_0x2f8bd5){loggerPredictive[_0x9026('0x7d')](_0x9026('0x89'));loggerPredictive[_0x9026('0x7d')](_0x9026('0x8a'),_0x2f8bd5[_0x9026('0x8b')]);loggerPredictive[_0x9026('0x7d')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f8bd5[_0x9026('0x73')]);loggerPredictive['info'](_0x9026('0x8c'),_0x2f8bd5[_0x9026('0x8d')]);loggerPredictive['info'](_0x9026('0x8e'),_0x2f8bd5[_0x9026('0x74')]);loggerPredictive[_0x9026('0x7d')](_0x9026('0x8c'),_0x2f8bd5['erlangAbandonmentRate']);loggerPredictive[_0x9026('0x7d')](_0x9026('0x85'));_['merge'](_0x56c18a,_0x2f8bd5);};}function getDiff(_0x513661){var _0x4251dd=moment()['milliseconds'](0x0);var _0x2f9b95=moment(_0x513661)[_0x9026('0x4d')](0x0);return _0x4251dd['diff'](_0x2f9b95,_0x9026('0x8f'));}function ifInterval(_0x4ab193,_0x2918eb){if(_[_0x9026('0x3f')](_0x2918eb)){return![];}return getDiff(_0x2918eb)<_0x4ab193*0x3c;}function freeVariablesPredictive(_0x1326f2){if(isNotNull(_0x1326f2)){if(!_[_0x9026('0x3f')](_0x1326f2[_0x9026('0x26')])){_0x1326f2[_0x9026('0x26')]=undefined;loggerPredictive['info'](_0x1326f2[_0x9026('0x42')],_0x9026('0x90'));}if(!_[_0x9026('0x3f')](_0x1326f2[_0x9026('0x25')])){_0x1326f2[_0x9026('0x25')]=undefined;loggerPredictive[_0x9026('0x7d')](_0x1326f2[_0x9026('0x42')],_0x9026('0x91'));}if(!_[_0x9026('0x3f')](_0x1326f2[_0x9026('0x92')])){clearInterval(_0x1326f2['handlePredictive']);_0x1326f2[_0x9026('0x92')]=undefined;loggerPredictive['info'](_0x1326f2['name'],_0x9026('0x93'));}}}function erlangb(_0x4c5948,_0x14bd86){if(_0x14bd86===0x0){return 0x0;}var _0x500b28=0x1;for(var _0x405880=0x1;_0x405880<=_0x14bd86;_0x405880+=0x1){_0x500b28=0x1+_0x500b28*_0x405880/_0x4c5948;}return 0x1/_0x500b28;}function isVoiceQueueOutbound(_0x56837e){return _0x56837e===_0x9026('0x51');}function isNotPreview(_0x434014){return _0x434014!=='preview';}function isCampaignIvr(_0x472aec){return _0x472aec==='ivr';}function getCallerId(_0x2eb016,_0x31cfcd,_0x2d46b8){if(!_[_0x9026('0x3f')](_0x2d46b8)&&typeof _0x2d46b8===_0x9026('0x94')&&!_[_0x9026('0x4a')](_0x2d46b8)){if(!_['isUndefined'](_0x31cfcd)&&typeof _0x31cfcd==='string'&&!_[_0x9026('0x4a')](_0x31cfcd)){return util[_0x9026('0x78')](_0x9026('0x95'),_0x31cfcd,_0x2d46b8);}return util[_0x9026('0x78')](_0x9026('0x95'),_0x2d46b8,_0x2d46b8);}if(!_[_0x9026('0x3f')](_0x2eb016)&&typeof _0x2eb016==='string'&&!_[_0x9026('0x4a')](_0x2eb016)){return _0x2eb016;}return _0x9026('0x96');}function loggerCatchQueueSummary(_0x3b429f,_0x4cf45f){return function(_0x3cae31){freeVariablesPredictive(_0x4cf45f);emitVoiceQueueSummary(_0x4cf45f);emitCampaignSummary(_0x4cf45f);loggerSyncQueueSummary[_0x9026('0x97')](_0x3b429f,util[_0x9026('0x98')](_0x3cae31,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2e1e72,_0x19de68){return function(_0x208753){loggerPredictive['error'](_0x19de68['name'],_0x2e1e72);loggerPredictive[_0x9026('0x97')](_0x208753[_0x9026('0x99')]);freeVariablesPredictive(_0x19de68);};}function loggerCatch(_0x844f6e){return function(_0x5e8faa){logger[_0x9026('0x97')](_0x844f6e,util['inspect'](_0x5e8faa,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x25d1c3){return _0x25d1c3&&!_[_0x9026('0x3f')](_0x25d1c3)&&_0x25d1c3[_0x9026('0x9a')]>0x0;}function decremetOriginate(_0xa97879){if(!_[_0x9026('0x3f')](_0xa97879)&&_0xa97879!==null){if(typeof _0xa97879['originated']!==_0x9026('0x9b')){if(_0xa97879[_0x9026('0x72')]>0x0){_0xa97879[_0x9026('0x72')]-=0x1;}else{logger[_0x9026('0x97')](_0x9026('0x9c'));}}}else{logger['error'](_0x9026('0x9d'));}}function checkContactLowerLimitOriginate(_0x55b23d,_0xbfead4,_0x4e79f4){if(_0xbfead4>_0x4e79f4){for(var _0x5bfbde=0x0;_0x5bfbde<_0xbfead4-_0x4e79f4;_0x5bfbde+=0x1){decremetOriginate(_0x55b23d);}}}function loggerGetContactDialer(_0x1b97a0,_0x4b3e0e,_0x2b7333){return function(_0x3c2736){checkContactLowerLimitOriginate(_0x4b3e0e,_0x2b7333,0x0);logger[_0x9026('0x97')](_0x1b97a0,util[_0x9026('0x98')](_0x3c2736,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x23967e){return function(_0xf4607f){if(isNotNull(_0xf4607f)&&isNotNull(_0xf4607f[0x0])){if(_0xf4607f[0x0][_0x9026('0x9e')]>0x0){_0x23967e['message']='RESCHEDULED_CONTACTS';logger[_0x9026('0x7d')](_0x9026('0x9f')+_0x23967e[_0x9026('0x42')],_0xf4607f[0x0]['contactsRescheduled'],_0x9026('0xa0'));}else{_0x23967e[_0x9026('0x40')]=_0x9026('0xa1');logger['info'](_0x9026('0xa2')+_0x23967e[_0x9026('0x42')]);}}};}function notSendMessagesQueue(_0x412c1e){if(_0x412c1e[_0x9026('0xa3')]){freeVariablesPredictive(_0x412c1e);if(_0x412c1e[_0x9026('0x72')]===0x0&&_0x412c1e[_0x9026('0x57')]===0x0&&_0x412c1e['waiting']===0x0&&(_0x412c1e[_0x9026('0x55')]||0x0)===0x0){_0x412c1e['sendMessageOneNotActive']=![];_0x412c1e[_0x9026('0x53')]=0x0;_0x412c1e['message']=_0x9026('0x44');loggerSyncQueueSummary[_0x9026('0x97')](_0x9026('0xa4'),_0x412c1e[_0x9026('0x42')],_0x9026('0xa5'));}else{_0x412c1e[_0x9026('0x40')]=_0x9026('0xa6');loggerSyncQueueSummary[_0x9026('0x97')](_0x9026('0xa4'),_0x412c1e[_0x9026('0x42')],'is\x20disactive');}emitVoiceQueueSummary(_0x412c1e);}}function notSendMessagesCampaign(_0x4a755c){if(_0x4a755c['sendMessageOneNotActive']){if(_0x4a755c['originated']===0x0){_0x4a755c['sendMessageOneNotActive']=![];_0x4a755c[_0x9026('0x40')]=_0x9026('0x44');loggerSyncQueueSummary[_0x9026('0x97')](_0x9026('0xa7'),_0x4a755c[_0x9026('0x42')],'is\x20not\x20active');}else{_0x4a755c[_0x9026('0x40')]=_0x9026('0xa6');loggerSyncQueueSummary[_0x9026('0x97')](_0x9026('0xa7'),_0x4a755c[_0x9026('0x42')],_0x9026('0xa8'));}emitCampaignSummary(_0x4a755c);}}function createObjHistory(_0x138ed,_0x29698a,_0x272e78,_0x1634cb,_0x7717a6){_0x138ed[_0x9026('0x40')]=_0x272e78;var _0x47f264=new Action(_0x138ed,_0x29698a);var _0x3ba9cd=new History(_0x47f264);_0x3ba9cd[_0x9026('0xa9')]=_0x1634cb;_0x3ba9cd[_0x9026('0xaa')]=_0x7717a6;_0x3ba9cd[_0x9026('0xab')]=_0x47f264[_0x9026('0xac')];return _0x3ba9cd;}Dialer['prototype'][_0x9026('0x3e')]=function(){var _0x51060b=this;setInterval(function(){_0x51060b[_0x9026('0xad')](_0x51060b[_0x9026('0x23')],_0x9026('0xae'));_0x51060b[_0x9026('0xad')](_0x51060b[_0x9026('0x22')],'[actions]');},0x32c8);};Dialer[_0x9026('0x18')][_0x9026('0xad')]=function(_0x31f8a7,_0x8e52a1){var _0x5021b1=this;for(var _0x4eb377 in _0x31f8a7){if(typeof _0x31f8a7[_0x4eb377]!==_0x9026('0x9b')){this[_0x9026('0x1c')]['enqueue'](function(){if(!_['isNil'](_0x31f8a7[_0x4eb377])){return ami[_0x9026('0xaf')]({'action':'status','channel':_0x31f8a7[_0x4eb377][_0x9026('0xb0')]})[_0x9026('0xb1')](function(_0x137144){if(_0x137144['message']===_0x9026('0xb2')){setTimeout(function(){if(_0x31f8a7[_0x4eb377]&&_0x31f8a7[_0x4eb377][_0x9026('0x50')]!==_0x9026('0x7b')){_0x5021b1[_0x9026('0xb3')](_0x5021b1[_0x9026('0x1d')][_0x31f8a7[_0x4eb377][_0x9026('0xb4')]]);logger[_0x9026('0x97')]('[Dialer][checkChannel]',_0x8e52a1,_0x4eb377,_0x31f8a7[_0x4eb377][_0x9026('0xb4')]);delete _0x31f8a7[_0x4eb377];}if(_0x31f8a7[_0x4eb377]&&_0x31f8a7[_0x4eb377][_0x9026('0x50')]==='ivr'){_0x5021b1[_0x9026('0xb3')](_0x5021b1[_0x9026('0x1e')][_0x31f8a7[_0x4eb377][_0x9026('0xb4')]]);logger[_0x9026('0x97')](_0x9026('0xb5'),_0x8e52a1,_0x4eb377,_0x31f8a7[_0x4eb377][_0x9026('0xb4')]);delete _0x31f8a7[_0x4eb377];}},0x2328);}});}});}}};Dialer['prototype'][_0x9026('0xb6')]=function(_0x3dace4){return BPromise['resolve']()[_0x9026('0xb7')](cmHopper[_0x9026('0xb6')](_0x3dace4))['catch'](loggerCatch(_0x9026('0xb8')));};Dialer['prototype']['checkIsBlackList']=function(_0x4ed5d5){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopperBlack['checkIsBlackList'](_0x4ed5d5))[_0x9026('0xb1')](loggerCatch(_0x9026('0xba')));};Dialer[_0x9026('0x18')]['checkIsBlackListIvr']=function(_0x38cee7){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopperBlack['checkIsBlackListIvr'](_0x38cee7))['catch'](loggerCatch(_0x9026('0xbb')));};Dialer[_0x9026('0x18')][_0x9026('0xbc')]=function(_0x3ac694){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopperHistory[_0x9026('0xbd')](_0x3ac694))['catch'](loggerCatch(_0x9026('0xbe')));};Dialer['prototype'][_0x9026('0xbf')]=function(_0x4d2842){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopper['rescheduleContact'](_0x4d2842))['catch'](loggerCatch(_0x9026('0xc0')));};Dialer[_0x9026('0x18')]['unlockContact']=function(_0x31b5f3,_0x5afd3f,_0x4ddb20){return BPromise['resolve']()['then'](cmHopper['unlockContact'](_0x31b5f3,_0x5afd3f,_0x4ddb20))['catch'](loggerCatch(_0x9026('0xc1')));};Dialer[_0x9026('0x18')][_0x9026('0xc2')]=function(_0xf8fc35,_0x16b3ac,_0x15c98a,_0x31d3d2,_0x58e66b){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopper[_0x9026('0xc2')](_0xf8fc35,_0x16b3ac,_0x15c98a,_0x31d3d2))[_0x9026('0xb1')](function(_0x268ffa){_0x58e66b[_0x9026('0xc3')]-=_0x15c98a;_0x58e66b['temp']=_0x58e66b[_0x9026('0xc3')]>0x0?_0x58e66b[_0x9026('0xc3')]:0x0;loggerCatch(_0x9026('0xc4'))(_0x268ffa);});};Dialer[_0x9026('0x18')][_0x9026('0xc5')]=function(_0x212a3e,_0x513fdb,_0x442912,_0x11956d){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopper['getContactDialerIvr'](_0x212a3e,_0x513fdb,_0x442912))['catch'](function(_0x3cb0df){_0x11956d['temp']-=_0x513fdb;_0x11956d['temp']=_0x11956d['temp']>0x0?_0x11956d[_0x9026('0xc3')]:0x0;loggerCatch(_0x9026('0xc6'))(_0x3cb0df);});};Dialer[_0x9026('0x18')][_0x9026('0xc7')]=function(_0x506feb){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](voiceQueueRt[_0x9026('0xc7')](_0x506feb))['catch'](loggerCatch(_0x9026('0xc8')));};Dialer[_0x9026('0x18')][_0x9026('0xc9')]=function(_0x3d36a2){return BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](cmHopper[_0x9026('0xc9')](_0x3d36a2))['catch'](loggerCatch(_0x9026('0xca')));};Dialer[_0x9026('0x18')][_0x9026('0xcb')]=function(_0xbc1b4d){return BPromise['resolve']()[_0x9026('0xb7')](cmHopperHistory[_0x9026('0xcb')](_0xbc1b4d))[_0x9026('0xb1')](loggerCatch(_0x9026('0xcc')));};Dialer[_0x9026('0x18')][_0x9026('0xb3')]=function(_0x38fac8){if(!_[_0x9026('0x3f')](_0x38fac8)&&_0x38fac8!==null){if(typeof _0x38fac8[_0x9026('0x72')]!=='undefined'){if(_0x38fac8[_0x9026('0x72')]>0x0){_0x38fac8['originated']-=0x1;}else{logger[_0x9026('0x97')](_0x9026('0xcd'));}}}else{logger[_0x9026('0x97')](_0x9026('0xce'));}};Dialer[_0x9026('0x18')][_0x9026('0xcf')]=function(_0x20d1ac,_0xa45018){var _0xe4b89a=this;return function(_0xd64b47){_0xe4b89a[_0x9026('0xb3')](_0xa45018);logger[_0x9026('0x97')](_0x20d1ac,util[_0x9026('0x98')](_0xd64b47,{'showHidden':![],'depth':null}));};};Dialer[_0x9026('0x18')][_0x9026('0xd0')]=function(_0x21a327,_0x458414,_0x5cc148){var _0x4e431f={'state':0x19,'statedesc':_0x9026('0xd1')};this['updateOriginated'](_0x458414);this[_0x9026('0xd2')](_['merge'](_0x4e431f,_['pick'](_0x5cc148,[_0x9026('0xd3'),_0x9026('0xd4'),'UserId',_0x9026('0xd5'),'CampaignId'])),'[emptyContact][createHistory]',_0x9026('0xd6'));logger[_0x9026('0x97')](_0x21a327);};Dialer[_0x9026('0x18')][_0x9026('0xd7')]=function(_0x41701b){return _0x41701b==='Success';};Dialer['prototype']['isTrunkReachable']=function(_0xecdef6){return!_[_0x9026('0x3f')](_0xecdef6)&&_0xecdef6&&!_[_0x9026('0x3f')](_0xecdef6['name'])&&!_[_0x9026('0x3f')](_0xecdef6[_0x9026('0xd8')])&&_0xecdef6['active']&&(this[_0x9026('0x20')][util[_0x9026('0x78')]('SIP/%s',_0xecdef6[_0x9026('0x42')])][_0x9026('0xd9')]==='reachable'||this['trunks'][util['format'](_0x9026('0xda'),_0xecdef6[_0x9026('0x42')])][_0x9026('0xd9')]===_0x9026('0xdb'));};Dialer[_0x9026('0x18')]['saveInDb']=function(_0xd048a6,_0x466382,_0x353d86){this['createHistory'](_0xd048a6)[_0x9026('0xb1')](loggerCatch(_0x466382));this[_0x9026('0xc9')](_0xd048a6)[_0x9026('0xb1')](loggerCatch(_0x353d86));};Dialer[_0x9026('0x18')][_0x9026('0x38')]=function(_0x517399){var _0x17200f=this[_0x9026('0x23')][_0x517399[_0x9026('0xdc')]];var _0x40cd4b;if(!_['isNil'](_0x517399)&&!_[_0x9026('0xdd')](_0x517399[_0x9026('0xde')])&&!_[_0x9026('0xdd')](_0x517399[_0x9026('0xde')][_0x9026('0xdf')])&&_0x517399[_0x9026('0xe0')]===_0x9026('0xe1')&&_0x17200f){if(_0x17200f['type']!==_0x9026('0x7b')&&this[_0x9026('0x1d')][_0x17200f[_0x9026('0xb4')]][_0x9026('0xe2')]&&_0x517399[_0x9026('0xe3')]===_0x9026('0xe4')){delete this[_0x9026('0x23')][_0x517399[_0x9026('0xdc')]];this[_0x9026('0xb3')](this[_0x9026('0x1d')][_0x17200f[_0x9026('0xb4')]]);this['voiceQueues'][_0x17200f[_0x9026('0xb4')]][_0x9026('0x61')]+=0x1;this['voiceQueues'][_0x17200f[_0x9026('0xb4')]][_0x9026('0x60')]+=0x1;_0x40cd4b=new Hangup(_0x17200f,_0x517399);_0x40cd4b[_0x9026('0xa9')]=0x12;_0x40cd4b[_0x9026('0xaa')]=_0x9026('0xe5');_0x40cd4b[_0x9026('0xe6')]=_0x9026('0xe7');ami[_0x9026('0x4f')](_0x9026('0xe8'),ut[_0x9026('0xe9')](_0x40cd4b,_0x9026('0xea')));this['saveInDb'](_0x40cd4b,_0x9026('0xeb'),_0x9026('0xec'));}if(_0x17200f[_0x9026('0x50')]!==_0x9026('0x7b')&&this['voiceQueues'][_0x17200f[_0x9026('0xb4')]][_0x9026('0xe2')]&&_0x517399[_0x9026('0xe3')]===_0x9026('0xed')){var _0x4d0130=this;return new BPromise(function(_0x3eae0c,_0x1bab6f){delete _0x4d0130[_0x9026('0x23')][_0x517399[_0x9026('0xdc')]];_0x4d0130['updateOriginated'](_0x4d0130[_0x9026('0x1d')][_0x17200f['queue']]);_0x4d0130['voiceQueues'][_0x17200f[_0x9026('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x4d0130[_0x9026('0x1d')][_0x17200f[_0x9026('0xb4')]][_0x9026('0x60')]+=0x1;var _0xf57d78=_0x4d0130[_0x9026('0x1d')][_0x17200f[_0x9026('0xb4')]];var _0x2ecca7=new Hangup(_0x17200f,_0x517399);_0x2ecca7['state']=0x13;_0x2ecca7['statedesc']=_0x9026('0xee');_0x2ecca7[_0x9026('0xe6')]=_0x9026('0xe7');_0x2ecca7[_0x9026('0xef')]+=0x1;_0x2ecca7['countglobal']+=0x1;_0x2ecca7[_0x9026('0xea')]=!![];ami[_0x9026('0x4f')](_0x9026('0xe8'),ut[_0x9026('0xe9')](_0x2ecca7,_0x9026('0xea')));_0x4d0130[_0x9026('0xcb')](_0x2ecca7)['catch'](loggerCatch(_0x9026('0xf0')));if(_0x2ecca7[_0x9026('0xf1')]+_0x2ecca7[_0x9026('0xf2')]+_0x2ecca7['countnoanswerretry']+_0x2ecca7[_0x9026('0xf3')]+_0x2ecca7[_0x9026('0xf4')]+_0x2ecca7['countabandonedretry']+_0x2ecca7[_0x9026('0xef')]+_0x2ecca7[_0x9026('0xf5')]>=_0xf57d78[_0x9026('0xf6')]){_0x4d0130[_0x9026('0xf7')](_0x2ecca7,_0x3eae0c,_0x1bab6f,_0x9026('0xf8'));}else{if(_0x2ecca7[_0x9026('0xef')]>=_0xf57d78[_0x9026('0xf9')]){_0x4d0130['createStateFinal'](_0x2ecca7,_0x3eae0c,_0x1bab6f,_0x9026('0xfa'));}else{_0x4d0130[_0x9026('0xbf')]({'active':![],'countmachineretry':_0x2ecca7[_0x9026('0xef')],'scheduledat':moment()[_0x9026('0xfb')](_0xf57d78[_0x9026('0xfc')],_0x9026('0xfd'))[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0x2ecca7[_0x9026('0xd3')],'ListId':_0x2ecca7['ListId'],'VoiceQueueId':_0x2ecca7[_0x9026('0xd5')]||undefined,'CampaignId':_0x2ecca7[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x100')));_0x3eae0c({'reschedule':0x1});}}});}if(_0x17200f[_0x9026('0x50')]===_0x9026('0x7b')&&this[_0x9026('0x1e')][_0x17200f[_0x9026('0xb4')]][_0x9026('0xe2')]&&_0x517399[_0x9026('0xe3')]===_0x9026('0xe4')){delete this[_0x9026('0x23')][_0x517399[_0x9026('0xdc')]];this['updateOriginated'](this['campaigns'][_0x17200f[_0x9026('0xb4')]]);_0x40cd4b=new Hangup(_0x17200f,_0x517399);_0x40cd4b[_0x9026('0xa9')]=0x12;_0x40cd4b['statedesc']=_0x9026('0xe5');_0x40cd4b[_0x9026('0xe6')]=_0x9026('0xe7');ami['emit'](_0x9026('0xe8'),ut[_0x9026('0xe9')](_0x40cd4b,_0x9026('0xea')));this[_0x9026('0xd2')](_0x40cd4b,_0x9026('0x101'),_0x9026('0x102'));}if(_0x17200f['type']===_0x9026('0x7b')&&this[_0x9026('0x1e')][_0x17200f[_0x9026('0xb4')]][_0x9026('0xe2')]&&_0x517399[_0x9026('0xe3')]==='MACHINE'){var _0x4d0130=this;return new BPromise(function(_0x2aff30,_0xf8694f){delete _0x4d0130['uniqueId'][_0x517399['uniqueid']];_0x4d0130[_0x9026('0xb3')](_0x4d0130[_0x9026('0x1e')][_0x17200f[_0x9026('0xb4')]]);_0x4d0130[_0x9026('0x1e')][_0x17200f[_0x9026('0xb4')]]['outboundAnswerCallsDay']+=0x1;_0x4d0130[_0x9026('0x1e')][_0x17200f['queue']][_0x9026('0x60')]+=0x1;var _0x3b564d=_0x4d0130['campaigns'][_0x17200f[_0x9026('0xb4')]];var _0x45db06=new Hangup(_0x17200f,_0x517399);_0x45db06[_0x9026('0xa9')]=0x13;_0x45db06[_0x9026('0xaa')]=_0x9026('0xee');_0x45db06[_0x9026('0xe6')]=_0x9026('0xe7');_0x45db06[_0x9026('0xef')]+=0x1;_0x45db06[_0x9026('0x103')]+=0x1;_0x45db06[_0x9026('0xea')]=!![];ami[_0x9026('0x4f')](_0x9026('0xe8'),ut['buildObj'](_0x45db06,_0x9026('0xea')));_0x4d0130[_0x9026('0xcb')](_0x45db06)[_0x9026('0xb1')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x45db06[_0x9026('0xf1')]+_0x45db06['countcongestionretry']+_0x45db06[_0x9026('0x104')]+_0x45db06[_0x9026('0xf3')]+_0x45db06[_0x9026('0xf4')]+_0x45db06[_0x9026('0x105')]+_0x45db06[_0x9026('0xef')]+_0x45db06[_0x9026('0xf5')]>=_0x3b564d[_0x9026('0xf6')]){_0x4d0130[_0x9026('0xf7')](_0x45db06,_0x2aff30,_0xf8694f,_0x9026('0xf8'));}else{if(_0x45db06[_0x9026('0xef')]>=_0x3b564d[_0x9026('0xf9')]){_0x4d0130[_0x9026('0x106')](_0x45db06,_0x2aff30,_0xf8694f,_0x9026('0xfa'));}else{_0x4d0130[_0x9026('0xbf')]({'active':![],'countmachineretry':_0x45db06[_0x9026('0xef')],'scheduledat':moment()[_0x9026('0xfb')](_0x3b564d['dialMachineRetryFrequency'],_0x9026('0xfd'))[_0x9026('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x45db06['ContactId'],'ListId':_0x45db06['ListId'],'VoiceQueueId':_0x45db06[_0x9026('0xd5')]||undefined,'CampaignId':_0x45db06['CampaignId']||undefined})[_0x9026('0xb1')](loggerCatch('[rescheduleContact][Machine]'));_0x2aff30({'reschedule':0x1});}}});}}};Dialer[_0x9026('0x18')][_0x9026('0x34')]=function(_0x283d03){var _0x434e16=this[_0x9026('0x23')][_0x283d03[_0x9026('0xdc')]];var _0x398148=this;var _0x4fac72;if(_0x434e16&&_0x434e16['type']===_0x9026('0x7b')){delete this['uniqueId'][_0x283d03['uniqueid']];this['updateOriginated'](this[_0x9026('0x1e')][_0x434e16[_0x9026('0xb4')]]);this['campaigns'][_0x434e16['queue']][_0x9026('0x107')]+=0x1;_0x4fac72=new Hangup(_0x434e16,_0x283d03);this[_0x9026('0xcb')](_0x4fac72)[_0x9026('0xb1')](loggerCatch(_0x9026('0x108')));this['moveContactManagedDialer'](_0x4fac72)[_0x9026('0xb1')](loggerCatch(_0x9026('0x109')));}if(_0x434e16&&_0x434e16[_0x9026('0x50')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x434e16[_0x9026('0xb4')]][_0x9026('0x10a')])){delete this['uniqueId'][_0x283d03[_0x9026('0xdc')]];this[_0x9026('0xb3')](this[_0x9026('0x1d')][_0x434e16[_0x9026('0xb4')]]);this['voiceQueues'][_0x434e16[_0x9026('0xb4')]][_0x9026('0x61')]+=0x1;this[_0x9026('0x1d')][_0x434e16[_0x9026('0xb4')]][_0x9026('0x60')]+=0x1;_0x4fac72=new Hangup(_0x434e16,_0x283d03);_0x4fac72[_0x9026('0xa9')]=0x10;_0x4fac72[_0x9026('0xaa')]='AnswerAGI';_0x4fac72['membername']=_0x9026('0x10b');this[_0x9026('0xcb')](_0x4fac72)['catch'](loggerCatch(_0x9026('0x108')));this[_0x9026('0xc9')](_0x4fac72)[_0x9026('0xb1')](loggerCatch(_0x9026('0x109')));}if(_0x434e16&&_0x434e16['type']!==_0x9026('0x7b')&&!isNotNull(this[_0x9026('0x1d')][_0x434e16[_0x9026('0xb4')]]['dialQueueProject'])){delete this[_0x9026('0x23')][_0x283d03[_0x9026('0xdc')]];this[_0x9026('0xb3')](this[_0x9026('0x1d')][_0x434e16[_0x9026('0xb4')]]);this[_0x9026('0x1d')][_0x434e16[_0x9026('0xb4')]]['outboundUnknownCallsDay']+=0x1;_0x4fac72=new Hangup(_0x434e16,_0x283d03);_0x4fac72[_0x9026('0xa9')]=0xc;_0x4fac72['statedesc']=_0x283d03[_0x9026('0x10c')];_0x4fac72[_0x9026('0xe6')]=_0x9026('0x10d');this[_0x9026('0xcb')](_0x4fac72)['catch'](loggerCatch(_0x9026('0x108')));this[_0x9026('0xc9')](_0x4fac72)[_0x9026('0xb1')](loggerCatch(_0x9026('0x109')));}};Dialer[_0x9026('0x18')]['syncAgentComplete']=function(_0x20278b){var _0x5a813a=this[_0x9026('0x23')][_0x20278b[_0x9026('0xdc')]];var _0x366bb4=this;if(this[_0x9026('0x1d')][_0x20278b['queue']]){if(_0x5a813a&&_0x5a813a[_0x9026('0x50')]!==_0x9026('0x7b')){delete this[_0x9026('0x23')][_0x20278b[_0x9026('0xdc')]];this['voiceQueues'][_0x20278b['queue']][_0x9026('0x61')]+=0x1;var _0xb9d368=new AgentComplete(_0x5a813a,_0x20278b);if(_0x20278b[_0x9026('0x10e')]==='agent'){_0xb9d368[_0x9026('0x10f')]=this['voiceQueues'][_0x20278b[_0x9026('0xb4')]]['dialQueueProject2']&&this[_0x9026('0x1d')][_0x20278b['queue']][_0x9026('0x110')]?moment()[_0x9026('0x78')](_0x9026('0xfe')):undefined;}this[_0x9026('0xcb')](_0xb9d368)[_0x9026('0xb1')](loggerCatch(_0x9026('0x111')));this[_0x9026('0xc9')](_0xb9d368)['catch'](loggerCatch(_0x9026('0x112')));}}};Dialer[_0x9026('0x18')]['syncAgentConnect']=function(_0x3f2e4c){if(this['voiceQueues'][_0x3f2e4c['queue']]){if(this[_0x9026('0x23')][_0x3f2e4c[_0x9026('0xdc')]]&&this[_0x9026('0x23')][_0x3f2e4c['uniqueid']][_0x9026('0x50')]!==_0x9026('0x7b')){this['updateOriginated'](this[_0x9026('0x1d')][_0x3f2e4c[_0x9026('0xb4')]]);this[_0x9026('0x23')][_0x3f2e4c['uniqueid']][_0x9026('0x113')]=moment()[_0x9026('0x78')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x9026('0x18')][_0x9026('0x114')]=function(_0x18b177){this['createHistory'](_0x18b177)['catch'](loggerCatch(_0x9026('0x111')));this[_0x9026('0xc9')](_0x18b177)[_0x9026('0xb1')](loggerCatch(_0x9026('0x115')));};Dialer[_0x9026('0x18')]['syncQueueCallerAbandon']=function(_0x91c87){var _0x3f6a7a=this[_0x9026('0x23')][_0x91c87[_0x9026('0xdc')]];var _0xce7220=this;if(this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]]){if(_0x3f6a7a&&_0x3f6a7a[_0x9026('0x50')]!==_0x9026('0x7b')){delete this[_0x9026('0x23')][_0x91c87[_0x9026('0xdc')]];this[_0x9026('0xb3')](this['voiceQueues'][_0x91c87[_0x9026('0xb4')]]);_0x3f6a7a[_0x9026('0x116')]=moment()[_0x9026('0x78')](_0x9026('0xfe'));var _0x20049a=new QueueCallerAbandon(_0x3f6a7a,_0x91c87);if(getSeconds(_0x3f6a7a[_0x9026('0x116')],_0x3f6a7a[_0x9026('0x117')])>=_0x3f6a7a[_0x9026('0x118')]){this['voiceQueues'][_0x91c87[_0x9026('0xb4')]][_0x9026('0x6c')]+=0x1;this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]][_0x9026('0x119')]+=0x1;this[_0x9026('0x1d')][_0x91c87['queue']][_0x9026('0x11a')]+=0x1;_0x20049a[_0x9026('0xa9')]=0xa;_0x20049a[_0x9026('0xaa')]='Drop';_0x20049a[_0x9026('0x11b')]=_0x9026('0x11c');_0x20049a[_0x9026('0x10f')]=this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]][_0x9026('0x11d')]?moment()[_0x9026('0x78')](_0x9026('0xfe')):undefined;_0x20049a['countdropretry']+=0x1;_0x20049a[_0x9026('0x103')]+=0x1;if(_0x20049a['countdropretry']>=this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]][_0x9026('0x11e')]){this['queueCallerAbandonCreateState'](_0x20049a);}else{this[_0x9026('0xbf')]({'active':![],'countdropretry':_0x20049a[_0x9026('0xf4')],'scheduledat':moment()[_0x9026('0xfb')](this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]][_0x9026('0x11f')],_0x9026('0xfd'))[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0x3f6a7a['ContactId'],'ListId':_0x3f6a7a['ListId'],'VoiceQueueId':_0x3f6a7a[_0x9026('0xd5')]||undefined,'CampaignId':_0x3f6a7a[_0x9026('0xff')]||undefined})['catch'](loggerCatch(_0x9026('0x120')));var _0x497f1a=new History(_0x20049a);_0x497f1a[_0x9026('0xa9')]=0xa;_0x497f1a[_0x9026('0xaa')]='Drop';_0x497f1a['starttime']=moment()['format'](_0x9026('0xfe'));_0x497f1a[_0x9026('0xab')]=_0x497f1a[_0x9026('0xac')];_0x497f1a[_0x9026('0x121')]=_0x20049a[_0x9026('0x121')];_0x497f1a[_0x9026('0x122')]=_0x20049a[_0x9026('0x122')];this[_0x9026('0xcb')](_0x497f1a)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x9026('0x1d')][_0x91c87['queue']][_0x9026('0x6b')]+=0x1;this[_0x9026('0x1d')][_0x91c87[_0x9026('0xb4')]][_0x9026('0x123')]+=0x1;_0x20049a[_0x9026('0xa9')]=0xb;_0x20049a[_0x9026('0xaa')]=_0x9026('0x124');_0x20049a[_0x9026('0x11b')]=_0x9026('0x125');_0x20049a['countabandonedretry']+=0x1;_0x20049a[_0x9026('0x103')]+=0x1;if(_0x20049a['countabandonedretry']>=this['voiceQueues'][_0x91c87[_0x9026('0xb4')]][_0x9026('0x126')]){this[_0x9026('0x114')](_0x20049a);}else{this[_0x9026('0xbf')]({'active':![],'countabandonedretry':_0x20049a[_0x9026('0x105')],'scheduledat':moment()[_0x9026('0xfb')](this['voiceQueues'][_0x91c87[_0x9026('0xb4')]]['dialAbandonedRetryFrequency'],_0x9026('0xfd'))['format'](_0x9026('0xfe')),'ContactId':_0x3f6a7a[_0x9026('0xd3')],'ListId':_0x3f6a7a['ListId'],'VoiceQueueId':_0x3f6a7a[_0x9026('0xd5')]||undefined,'CampaignId':_0x3f6a7a[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x127')));var _0x497f1a=new History(_0x20049a);_0x497f1a[_0x9026('0xa9')]=0xb;_0x497f1a['statedesc']=_0x9026('0x124');_0x497f1a[_0x9026('0xac')]=moment()['format'](_0x9026('0xfe'));_0x497f1a[_0x9026('0xab')]=_0x497f1a['starttime'];_0x497f1a[_0x9026('0x121')]=_0x20049a[_0x9026('0x121')];_0x497f1a[_0x9026('0x122')]=_0x20049a['calleridnum'];this[_0x9026('0xcb')](_0x497f1a)['catch'](loggerCatch(_0x9026('0x128')));}}}}};Dialer['prototype'][_0x9026('0x36')]=function(_0x53e8ab){if(this[_0x9026('0x22')][_0x53e8ab[_0x9026('0xdc')]]){this[_0x9026('0x22')][_0x53e8ab['uniqueid']]['channel']=_0x53e8ab[_0x9026('0xb0')];}if(this[_0x9026('0x23')][_0x53e8ab[_0x9026('0xdc')]]){this[_0x9026('0x23')][_0x53e8ab[_0x9026('0xdc')]]['channel']=_0x53e8ab['channel'];}};Dialer[_0x9026('0x18')]['syncQueueMember']=function(_0x23f194){if(strategy[this[_0x9026('0x1d')][this[_0x9026('0x22')][_0x23f194['actionid']][_0x9026('0xb4')]]['strategy']]===_0x9026('0x17')){if(this[_0x9026('0x22')][_0x23f194['actionid']]&&_[_0x9026('0xdd')](this[_0x9026('0x22')][_0x23f194['actionid']][_0x9026('0x129')])&&_0x23f194[_0x9026('0xd9')]==='1'&&_0x23f194[_0x9026('0x12a')]==='0'){if(this['agents'][_0x23f194[_0x9026('0x12b')]]){if(!this[_0x9026('0x1f')][_0x23f194[_0x9026('0x12b')]][_0x9026('0x129')]){this['agents'][_0x23f194['stateinterface']][_0x9026('0x129')]=!![];this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]][_0x9026('0x129')]=!![];this[_0x9026('0x22')][_0x23f194['actionid']][_0x9026('0x12b')]=_0x23f194[_0x9026('0x12b')];}}}}else if((strategy[this['voiceQueues'][this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]][_0x9026('0xb4')]]['strategy']]||_0x9026('0x12d'))===_0x9026('0x12d')){if(this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]]){if(this[_0x9026('0x1f')][_0x23f194[_0x9026('0x12b')]]){this['actions'][_0x23f194[_0x9026('0x12c')]][_0x9026('0x12b')]=_0x23f194[_0x9026('0x12b')];if(_['isNil'](this[_0x9026('0x28')][this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]][_0x9026('0xb4')]])){this[_0x9026('0x28')][this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]]['queue']]=[];}this[_0x9026('0x28')][this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]]['queue']][_0x9026('0x12e')](_[_0x9026('0x12f')](_[_0x9026('0x130')](this[_0x9026('0x22')][_0x23f194[_0x9026('0x12c')]],[_0x9026('0x131'),_0x9026('0x12b')]),{'status':_0x23f194[_0x9026('0xd9')],'paused':_0x23f194['paused']}));}}}};function unlockQueueStatus(_0x211456,_0x5a45aa){setTimeout(function(){if(_[_0x9026('0x3f')](_0x211456[_0x9026('0x132')])){loggerBooked['error'](_0x9026('0x133'),_0x5a45aa);}_0x211456[_0x9026('0x132')]=!![];loggerBooked[_0x9026('0x7d')]('[booked][unlockQueueStatus]',_0x5a45aa,JSON[_0x9026('0x4c')](_['pick'](_0x211456,['name',_0x9026('0x132')])));},0x1f3);}Dialer[_0x9026('0x18')][_0x9026('0x3c')]=function(_0x5c1d22){var _0x7e423d=this;var _0x38dac8=_0x7e423d[_0x9026('0x1d')][_0x7e423d['actions'][_0x5c1d22['actionid']]['queue']];if(strategy[this['voiceQueues'][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]][_0x9026('0x134')]]===_0x9026('0x17')){if(this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]&&this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0x12b')]){this[_0x9026('0x135')][_0x9026('0x136')](this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0x131')],this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0x12b')])['catch'](function(_0x2bab6b){logger[_0x9026('0x97')](_0x9026('0x137'),util['inspect'](_0x2bab6b,{'showHidden':![],'depth':null}));})[_0x9026('0x1b')](function(){_0x7e423d[_0x9026('0xb3')](_0x7e423d[_0x9026('0x1d')][_0x7e423d['actions'][_0x5c1d22[_0x9026('0x12c')]]['queue']]);_0x7e423d['agents'][_0x7e423d[_0x9026('0x22')][_0x5c1d22['actionid']][_0x9026('0x12b')]][_0x9026('0x129')]=![];delete _0x7e423d[_0x9026('0x22')][_0x5c1d22['actionid']];unlockQueueStatus(_0x38dac8);});}else{this[_0x9026('0xb3')](this[_0x9026('0x1d')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]);this[_0x9026('0xbf')]({'active':![],'ContactId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd3')],'ListId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]['ListId'],'VoiceQueueId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9026('0x22')][_0x5c1d22['actionid']][_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x138')));delete this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]];unlockQueueStatus(_0x38dac8);}}else if((strategy[this[_0x9026('0x1d')][this[_0x9026('0x22')][_0x5c1d22['actionid']][_0x9026('0xb4')]]['strategy']]||_0x9026('0x12d'))===_0x9026('0x12d')){var _0x16a8eb;if(this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]&&!_[_0x9026('0x4a')](this[_0x9026('0x28')][this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]])){if(this[_0x9026('0x29')][_0x7e423d[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]){this[_0x9026('0x29')][_0x7e423d[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]=this[_0x9026('0x29')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]?this[_0x9026('0x29')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]:this['queueBooked'][this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]?this['queueBooked'][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]['_rr']||0x0:0x0;}this['queueBooked'][this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]][_0x9026('0x139')]=this[_0x9026('0x29')][this[_0x9026('0x22')][_0x5c1d22['actionid']]['queue']];for(var _0x20200f=0x0;_0x20200f<this[_0x9026('0x28')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]['queue']][_0x9026('0x9a')];_0x20200f+=0x1){_0x16a8eb=rr(this['queueBooked'][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]);this[_0x9026('0x29')][_0x7e423d[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]=this[_0x9026('0x28')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]['_rr'];if(_0x16a8eb[_0x9026('0xd9')]==='1'&&_0x16a8eb[_0x9026('0x12a')]==='0'){break;}}if(!_[_0x9026('0xdd')](_0x16a8eb)){this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]]['unlockRR']=_['isUndefined'](this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]]['unlockRR'])?!![]:this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]][_0x9026('0x13a')];}loggerBooked[_0x9026('0x7d')]('[booked][RR]',_0x5c1d22[_0x9026('0x12c')],'Agent:\x20',JSON[_0x9026('0x4c')](_[_0x9026('0x130')](this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]],[_0x9026('0x42'),'unlockRR'])),_0x9026('0x13b'),JSON[_0x9026('0x4c')](_0x16a8eb['idHopper']));if(!_[_0x9026('0xdd')](_0x16a8eb)&&_0x16a8eb[_0x9026('0xd9')]==='1'&&_0x16a8eb[_0x9026('0x12a')]==='0'&&this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]][_0x9026('0x13a')]){this[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]][_0x9026('0x13a')]=![];this[_0x9026('0x28')][_0x7e423d[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]=[];this[_0x9026('0x135')][_0x9026('0x136')](_0x16a8eb[_0x9026('0x131')],_0x16a8eb[_0x9026('0x12b')])[_0x9026('0xb1')](function(_0x476ae3){logger['error'](_0x9026('0x137'),util[_0x9026('0x98')](_0x476ae3,{'showHidden':![],'depth':null}));})[_0x9026('0x1b')](function(){_0x7e423d[_0x9026('0xb3')](_0x7e423d['voiceQueues'][_0x7e423d['actions'][_0x5c1d22['actionid']][_0x9026('0xb4')]]);setTimeout(function(){_0x7e423d['agents'][_0x16a8eb[_0x9026('0x12b')]][_0x9026('0x13a')]=!![];loggerBooked[_0x9026('0x7d')](_0x9026('0x13c'),_0x5c1d22['actionid'],_0x9026('0x13d'),JSON[_0x9026('0x4c')](_[_0x9026('0x130')](_0x7e423d[_0x9026('0x1f')][_0x16a8eb[_0x9026('0x12b')]],[_0x9026('0x42'),_0x9026('0x13a')])),_0x9026('0x13b'),JSON[_0x9026('0x4c')](_0x16a8eb[_0x9026('0x131')]));},0xc7);delete _0x7e423d['actions'][_0x5c1d22[_0x9026('0x12c')]];unlockQueueStatus(_0x38dac8,_0x5c1d22[_0x9026('0x12c')]);});}else{loggerBooked['info'](_0x9026('0x13e'));this[_0x9026('0xb3')](this['voiceQueues'][this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]);this[_0x9026('0xbf')]({'active':![],'ContactId':this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd3')],'ListId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd4')],'VoiceQueueId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x138')));delete this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]];unlockQueueStatus(_0x38dac8);}}else{loggerBooked['info']('[booked][unlock2]');this[_0x9026('0xb3')](this[_0x9026('0x1d')][this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]);this[_0x9026('0xbf')]({'active':![],'ContactId':this['actions'][_0x5c1d22[_0x9026('0x12c')]]['ContactId'],'ListId':this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd4')],'VoiceQueueId':this[_0x9026('0x22')][_0x5c1d22['actionid']][_0x9026('0xd5')]||undefined,'CampaignId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xff')]||undefined})['catch'](loggerCatch(_0x9026('0x13f')));delete this[_0x9026('0x22')][_0x5c1d22['actionid']];unlockQueueStatus(_0x38dac8);}}else{loggerBooked['info']('[booked][unlock3]');this['updateOriginated'](this['voiceQueues'][this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xb4')]]);this[_0x9026('0xbf')]({'active':![],'ContactId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd3')],'ListId':this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd4')],'VoiceQueueId':this['actions'][_0x5c1d22[_0x9026('0x12c')]][_0x9026('0xd5')]||undefined,'CampaignId':this[_0x9026('0x22')][_0x5c1d22[_0x9026('0x12c')]]['CampaignId']||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x140')));delete this['actions'][_0x5c1d22['actionid']];unlockQueueStatus(_0x38dac8);}};Dialer['prototype'][_0x9026('0x3d')]=function(){var _0x51ddce=this;setInterval(function(){_0x51ddce['syncCampaigns']();},0x3e8);};Dialer[_0x9026('0x18')]['checkIsTrunkReachable']=function(_0x1da762){var _0x210400=this;return function(){if(!_0x210400[_0x9026('0x141')](_0x1da762[_0x9026('0x75')])){if(!_0x210400[_0x9026('0x141')](_0x1da762[_0x9026('0x142')])){_0x1da762['message']=_0x9026('0x143');throw _0x1da762['name']+_0x9026('0x144');}}};};Dialer['prototype'][_0x9026('0x145')]=function(_0x2f3f58,_0x107538,_0x28f1e1,_0x21ee47){var _0x2ea01d=this;return function(){var _0x28ac3a=!![];return _0x2ea01d[_0x9026('0x146')](_0x2f3f58,_0x107538,_0x28f1e1,_0x21ee47,_0x28ac3a);};};Dialer[_0x9026('0x18')][_0x9026('0x147')]=function(_0x4c199d,_0xcc37c9,_0x28bdbd,_0x3e542d){var _0x5c562e=this;return function(){var _0x4851f8=![];return _0x5c562e[_0x9026('0x146')](_0x4c199d['Intervals'],_0xcc37c9,_0x28bdbd,_0x3e542d,_0x4851f8);};};Dialer[_0x9026('0x18')][_0x9026('0x146')]=function(_0x131009,_0x323cf0,_0x3db2fb,_0x5a6d8d,_0x55fe96){var _0x3ee0da=[];return new BPromise(function(_0x3006a9,_0x505640){if(!isNotNull(_0x131009)){_0x5a6d8d[_0x9026('0x40')]=_0x9026('0x47');return _0x505640(msgResponse(_0x9026('0x146'),_0x9026('0x148'),_0x3db2fb+_0x9026('0x149')));}if(_[_0x9026('0x4a')](_0x131009)){_0x5a6d8d[_0x9026('0x40')]=_0x9026('0x14a');return _0x505640(msgResponse(_0x9026('0x146'),'Failure',_0x3db2fb+_0x9026('0x14b')));}if(_0x323cf0&&_[_0x9026('0x3f')](config[_0x9026('0x14c')][_0x323cf0])){_0x5a6d8d[_0x9026('0x40')]='TIMEZONE_UNKNOW';return _0x505640(msgResponse(_0x9026('0x146'),'Failure',_0x3db2fb+_0x9026('0x14d')+_0x323cf0));}if(_[_0x9026('0x14e')](_0x131009)){for(var _0x412d05=0x0;_0x412d05<_0x131009['length'];_0x412d05+=0x1){_0x3ee0da[_0x9026('0x12e')](ami['Action']({'action':_0x9026('0x14f'),'command':util[_0x9026('0x78')]('iftime\x20%s,%s',_0x131009[_0x412d05][_0x9026('0x150')],!_[_0x9026('0x3f')](config['timezones'][_0x323cf0])?_0x323cf0:'')})['then'](function(_0x4217e1){return _0x4217e1['content'][_0x9026('0x151')](_0x9026('0x152'))>=0x0;})[_0x9026('0xb1')](myreject(_0x505640)));}}else{_0x3ee0da[_0x9026('0x12e')](ami[_0x9026('0xaf')]({'action':_0x9026('0x14f'),'command':util[_0x9026('0x78')]('iftime\x20%s,%s',_0x131009,!_['isUndefined'](config[_0x9026('0x14c')][_0x323cf0])?_0x323cf0:'')})[_0x9026('0xb7')](function(_0x2c49a3){return _0x2c49a3['content'][_0x9026('0x151')]('true')>=0x0;})['catch'](myreject(_0x505640)));}BPromise[_0x9026('0x153')](_0x3ee0da)[_0x9026('0xb7')](function(_0x46edc9){var _0x1638f5=_[_0x9026('0x154')](_0x46edc9);if(_0x1638f5){return _0x3006a9(_0x1638f5);}else{_0x5a6d8d[_0x9026('0x40')]=_0x55fe96?'GLOBAL_INTERVAL_IS_OVERTIME':_0x9026('0x155');return _0x505640(msgResponse('[ifTime][promiseAll]',_0x9026('0x148'),_0x9026('0x156')+_0x55fe96+'\x20'+_0x3db2fb+_0x9026('0x157')+util[_0x9026('0x98')](_0x131009,{'showHidden':![],'depth':null})+_0x9026('0x158')+_0x323cf0));}})['catch'](function(_0x23dc89){return _0x505640(msgResponse('ifTime',_0x9026('0x148'),JSON['stringify'](_0x23dc89)));});});};Dialer['prototype'][_0x9026('0x159')]=function(_0x131bef){var _0x26caa1=this;return function(){switch(_0x131bef[_0x9026('0x5b')]){case _0x9026('0x15a'):freeVariablesPredictive(_0x131bef);_0x26caa1[_0x9026('0x15b')](_0x131bef,0x1);break;case'power':freeVariablesPredictive(_0x131bef);_0x26caa1[_0x9026('0x15b')](_0x131bef,_0x131bef[_0x9026('0x15c')]);break;case _0x9026('0x15d'):_0x26caa1[_0x9026('0x15d')](_0x131bef);break;case'booked':freeVariablesPredictive(_0x131bef);_0x26caa1['handlePower'](_0x131bef,0x1);break;default:freeVariablesPredictive(_0x131bef);logger[_0x9026('0x97')](_0x9026('0x15e'),_0x131bef[_0x9026('0x42')],'method\x20not\x20recognized');}};};Dialer[_0x9026('0x18')][_0x9026('0x15f')]=function(_0x31c893){var _0x3d62d0=this;return function(){_0x3d62d0['handleIvr'](_0x31c893);};};Dialer['prototype']['syncQueueSummary']=function(_0x900906){var _0x3f5ab0=this;if(isNotPreview(_0x900906[_0x9026('0x5b')])){if(isVoiceQueueOutbound(_0x900906[_0x9026('0x50')])&&isActive(_0x900906['dialActive'])){_0x900906[_0x9026('0xa3')]=!![];BPromise[_0x9026('0xb9')]()[_0x9026('0xb7')](checkIsLoggedIn(_0x900906,_0x900906['loggedIn']))[_0x9026('0xb7')](checkIsActive(_0x900906,_0x900906[_0x9026('0x5a')]))[_0x9026('0xb7')](checkInterval(_0x900906))['then'](_0x3f5ab0[_0x9026('0x160')](_0x900906))[_0x9026('0xb7')](_0x3f5ab0[_0x9026('0x145')](_0x900906[_0x9026('0x161')],_0x900906[_0x9026('0x162')],_0x900906[_0x9026('0x42')],_0x900906))[_0x9026('0xb7')](_0x3f5ab0['checkIfTimeIntervals'](_0x900906['Interval'],_0x900906[_0x9026('0x162')],_0x900906[_0x9026('0x42')],_0x900906))[_0x9026('0xb7')](_0x3f5ab0['checkDialMethod'](_0x900906))[_0x9026('0xb1')](loggerCatchQueueSummary('[syncQueueSummary]',_0x900906));}else{notSendMessagesQueue(_0x900906);}}else{freeVariablesPredictive(_0x900906);}};Dialer[_0x9026('0x18')]['syncCampaigns']=function(){var _0x577e55=this;var _0x3d5365;for(var _0x2126a9 in this[_0x9026('0x1e')]){if(typeof this[_0x9026('0x1e')][_0x2126a9]!=='undefined'){_0x3d5365=this['campaigns'][_0x2126a9];if(isCampaignIvr(_0x3d5365[_0x9026('0x50')])&&isActive(_0x3d5365['active'])){_0x3d5365[_0x9026('0xa3')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x3d5365,_0x3d5365[_0x9026('0xd8')]))[_0x9026('0xb7')](checkInterval(_0x3d5365))[_0x9026('0xb7')](_0x577e55['checkIsTrunkReachable'](_0x3d5365))['then'](_0x577e55[_0x9026('0x145')](_0x3d5365[_0x9026('0x161')],_0x3d5365[_0x9026('0x162')],_0x3d5365[_0x9026('0x42')],_0x3d5365))[_0x9026('0xb7')](_0x577e55[_0x9026('0x147')](_0x3d5365[_0x9026('0x46')],_0x3d5365['dialTimezone'],_0x3d5365[_0x9026('0x42')],_0x3d5365))['then'](_0x577e55[_0x9026('0x15f')](_0x3d5365))[_0x9026('0xb1')](loggerCatchQueueSummary(_0x9026('0x163'),_0x3d5365));}else{notSendMessagesCampaign(_0x3d5365);}}}};function getCallerIdRandom(_0x5b3db5,_0x29a8a8){var _0xd23c38;var _0x4ed6b2;var _0x2fc8ef;if(_0x29a8a8<=0x0){_0x29a8a8=0x1;}_0xd23c38=new RegExp(_0x9026('0x164')+_0x29a8a8+'}$');_0x4ed6b2=Math[_0x9026('0x165')](0xa,_0x29a8a8-0x1);_0x2fc8ef=Math[_0x9026('0x165')](0xa,_0x29a8a8)-0x1;return util['format']('%s',_[_0x9026('0x166')](_0x5b3db5,_0xd23c38,_[_0x9026('0x167')](_0x4ed6b2,_0x2fc8ef)));}function extractCalleridName(_0x1d06ce){var _0x3043b1=_0x1d06ce[_0x9026('0x168')](/"(.*?)"/);return _0x3043b1?_0x3043b1[0x1]:_0x1d06ce;}function extractCalleridNumber(_0x571774){var _0x2e3999=_0x571774[_0x9026('0x168')](/<(.*?)>/);return _0x2e3999?_0x2e3999[0x1]:_0x571774;}Dialer['prototype'][_0x9026('0x169')]=function(_0x3db5ab,_0x19b0a8){var _0x5b45e2=this;var _0x561a82=uuid['v4']();this['actions'][_0x561a82]=new Action(_0x3db5ab,_0x19b0a8,_0x561a82);return new BPromise(function(_0x2a9727,_0x365a89){if(_[_0x9026('0x3f')](_0x3db5ab)&&typeof _0x3db5ab!==_0x9026('0x16a')){return _0x365a89(msgResponse('originate','Failure',_0x9026('0x16b')));}if(_['isUndefined'](_0x19b0a8[_0x9026('0x16c')][_0x9026('0x16d')])||_0x19b0a8[_0x9026('0x16c')][_0x9026('0x16d')]===null){return _0x365a89(msgResponse(_0x9026('0x16e'),_0x9026('0x148'),_0x9026('0x16f')));}var _0x116026={'XMD-CALLERID':_0x5b45e2[_0x9026('0x22')][_0x561a82][_0x9026('0x170')](),'XMD-AGI':_0x3db5ab[_0x9026('0x10a')]?util[_0x9026('0x78')](_0x9026('0x171'),ipAgi,_0x3db5ab[_0x9026('0x10a')]):_0x9026('0x172'),'XMD-AGIAFTER':_0x3db5ab[_0x9026('0x11d')]?util[_0x9026('0x78')](_0x9026('0x171'),ipAgi,_0x3db5ab['dialQueueProject2']):_0x9026('0x172'),'XMD-QUEUE':_0x3db5ab[_0x9026('0x50')]==='outbound'?util[_0x9026('0x78')](_0x9026('0x173'),_0x3db5ab[_0x9026('0x42')],_0x3db5ab['dialQueueOptions']||'',_0x3db5ab[_0x9026('0x110')]?'c':'',_0x3db5ab[_0x9026('0x118')]||0x3):_0x9026('0x172'),'XMD-CONTACTID':_0x19b0a8[_0x9026('0xd3')],'XMD-CDRTYPE':_0x9026('0x174'),'CALLERID(all)':_0x5b45e2[_0x9026('0x22')][_0x561a82]['getCaller'](),'XMD-AMD':_0x3db5ab[_0x9026('0xe2')]?_0x9026('0x175'):_0x9026('0x172'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x3db5ab[_0x9026('0xe2')]){_0x116026[_0x9026('0x176')]=_0x3db5ab['dialAMDInitialSilence']||0x9c4;_0x116026[_0x9026('0x177')]=_0x3db5ab['dialAMDGreeting']||0x5dc;_0x116026[_0x9026('0x178')]=_0x3db5ab[_0x9026('0x179')]||0x320;_0x116026[_0x9026('0x17a')]=_0x3db5ab[_0x9026('0x17b')]||0x1388;_0x116026[_0x9026('0x17c')]=_0x3db5ab[_0x9026('0x17d')]||0x64;_0x116026[_0x9026('0x17e')]=_0x3db5ab[_0x9026('0x17f')]||0x32;_0x116026[_0x9026('0x180')]=_0x3db5ab[_0x9026('0x181')]||0x3;_0x116026[_0x9026('0x182')]=_0x3db5ab[_0x9026('0x183')]||0x100;_0x116026['XMD-AMDMAXIMUMWORDLENGTH']=_0x3db5ab[_0x9026('0x184')]||0x1388;}if(_0x3db5ab[_0x9026('0x50')]===_0x9026('0x51')){_0x116026[_0x9026('0x185')]=_0x19b0a8['VoiceQueueId'];}else{_0x116026['XMD-CAMPAIGNID']=_0x19b0a8[_0x9026('0xff')];}for(var _0x5bbbc9 in _0x19b0a8['Contact']){if(typeof _0x19b0a8[_0x9026('0x16c')][_0x5bbbc9]!==_0x9026('0x9b')){if(isNotNull(_0x19b0a8['Contact'][_0x5bbbc9])&&_0x5bbbc9!=='id'&&_0x5bbbc9!==_0x9026('0x186')&&_0x5bbbc9!=='createdAt'&&_0x5bbbc9!==_0x9026('0x187')){_0x116026[util[_0x9026('0x78')](_0x9026('0x188'),_0x9026('0x189'),_[_0x9026('0x18a')](_0x5bbbc9))]=_0x19b0a8[_0x9026('0x16c')][_0x5bbbc9];}}}var _0x599581=_0x5b45e2[_0x9026('0x141')](_0x3db5ab[_0x9026('0x75')])?getCallerId(_0x3db5ab[_0x9026('0x75')][_0x9026('0x76')],_0x3db5ab[_0x9026('0x5c')],_0x3db5ab['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x3db5ab[_0x9026('0x5d')],_0x3db5ab['dialRandomLastDigitCallerIdNumber']):_0x3db5ab[_0x9026('0x5d')]):getCallerId(_[_0x9026('0xdd')](_0x3db5ab[_0x9026('0x142')])?_0x3db5ab['Trunk'][_0x9026('0x76')]:_0x3db5ab[_0x9026('0x142')][_0x9026('0x76')],_0x3db5ab['dialOriginateCallerIdName'],_0x3db5ab[_0x9026('0x18b')]>0x0?getCallerIdRandom(_0x3db5ab[_0x9026('0x5d')],_0x3db5ab[_0x9026('0x18b')]):_0x3db5ab[_0x9026('0x5d')]);if(_0x599581){_0x116026['XMD-ORIGINATECALLERIDNAME']=_0x5b45e2[_0x9026('0x22')][_0x561a82]['originatecalleridname']=extractCalleridName(_0x599581);_0x116026['XMD-ORIGINATECALLERIDNUM']=_0x5b45e2[_0x9026('0x22')][_0x561a82][_0x9026('0x18c')]=extractCalleridNumber(_0x599581);}return ami[_0x9026('0xaf')]({'actionid':_0x561a82,'action':'originate','channel':_0x5b45e2[_0x9026('0x141')](_0x3db5ab['Trunk'])?util[_0x9026('0x78')]('SIP/%s/%s%s',_0x3db5ab[_0x9026('0x75')][_0x9026('0x42')],isNotNull(_0x3db5ab[_0x9026('0x5f')])?_0x3db5ab[_0x9026('0x5f')][_0x9026('0x18d')]()||'':'',_0x3db5ab[_0x9026('0x18e')]>0x0?_0x19b0a8[_0x9026('0x16c')]['phone'][_0x9026('0x18f')](_0x3db5ab[_0x9026('0x18e')]):_0x19b0a8[_0x9026('0x16c')][_0x9026('0x16d')]):util[_0x9026('0x78')](_0x9026('0x190'),_['isNil'](_0x3db5ab['TrunkBackup'])?_0x3db5ab['Trunk']['name']:_0x3db5ab[_0x9026('0x142')][_0x9026('0x42')],isNotNull(_0x3db5ab[_0x9026('0x5f')])?_0x3db5ab[_0x9026('0x5f')]['trim']()||'':'',_0x3db5ab[_0x9026('0x18e')]>0x0?_0x19b0a8['Contact'][_0x9026('0x16d')][_0x9026('0x18f')](_0x3db5ab[_0x9026('0x18e')]):_0x19b0a8[_0x9026('0x16c')][_0x9026('0x16d')]),'callerid':_0x599581,'Exten':'xcally-motion-dialer','Context':_0x9026('0x191'),'Priority':'1','variable':_0x116026,'timeout':(_0x3db5ab['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x561a82})['then'](function(_0x4c81c9){return _0x2a9727(_0x4c81c9);})['catch'](function(_0x2dea1e){_0x3db5ab[_0x9026('0x66')]+=0x1;var _0x74bf09=new History(_0x5b45e2[_0x9026('0x22')][_0x561a82]);logger[_0x9026('0x97')](util['format']('[originateError]:\x20%s',JSON[_0x9026('0x4c')](_0x2dea1e)));_0x74bf09[_0x9026('0xa9')]=0xe;_0x74bf09[_0x9026('0xaa')]=_0x9026('0x192');_0x74bf09[_0x9026('0xac')]=moment()[_0x9026('0x78')](_0x9026('0xfe'));_0x74bf09[_0x9026('0xab')]=_0x74bf09[_0x9026('0xac')];_0x5b45e2[_0x9026('0xcb')](_0x74bf09)[_0x9026('0xb1')](loggerCatch('[originate][error]'));_0x5b45e2[_0x9026('0xc9')](_0x74bf09)['catch'](loggerCatch(_0x9026('0x193')))['finally'](function(){delete _0x5b45e2[_0x9026('0x22')][_0x561a82];return _0x365a89(msgResponse(_0x9026('0x16e'),'Error',_0x9026('0x194')));});});});};Dialer['prototype'][_0x9026('0x2f')]=function(_0x1d7276){var _0x3a2742=this['actions'][_0x1d7276[_0x9026('0x12c')]];if(_0x3a2742){delete this['actions'][_0x1d7276[_0x9026('0x12c')]];_0x3a2742['responsetime']=moment()[_0x9026('0x78')](_0x9026('0xfe'));var _0x3648a2=_0x3a2742[_0x9026('0x50')]===_0x9026('0x7b')?this[_0x9026('0x1e')][_0x3a2742[_0x9026('0xb4')]]:this[_0x9026('0x1d')][_0x3a2742[_0x9026('0x195')]()];if(!this['isSuccess'](_0x1d7276['response'])){this['updateOriginated'](_0x3648a2);return this[_0x9026('0x196')](_0x3a2742,_0x3648a2,_0x1d7276)[_0x9026('0xb1')](loggerCatch(_0x9026('0x197')));}this[_0x9026('0x23')][_0x1d7276[_0x9026('0xdc')]]=_0x3a2742;}};Dialer[_0x9026('0x18')][_0x9026('0x198')]=function(_0x1ebdc6,_0x1dea11,_0x2aaca5){var _0xa38565=new History(_0x1dea11);if(_0xa38565[_0x9026('0xf1')]+_0xa38565['countcongestionretry']+_0xa38565['countnoanswerretry']+_0xa38565[_0x9026('0xf3')]+_0xa38565[_0x9026('0xf4')]+_0xa38565[_0x9026('0x105')]+_0xa38565['countmachineretry']+_0xa38565[_0x9026('0xf5')]>=_0x2aaca5[_0x9026('0xf6')]-0x1){return!![];}switch(_0x1ebdc6){case 0x3:if(_0xa38565[_0x9026('0x104')]>=_0x2aaca5[_0x9026('0x199')]-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countnoanswerretry':_0xa38565[_0x9026('0x104')]+=0x1,'scheduledat':moment()['add'](_0x2aaca5[_0x9026('0x19a')],_0x9026('0xfd'))[_0x9026('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565['ListId'],'VoiceQueueId':_0xa38565['VoiceQueueId']||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0xa38565[_0x9026('0xf1')]>=_0x2aaca5[_0x9026('0x19b')]-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countbusyretry':_0xa38565['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x2aaca5[_0x9026('0x19c')],'minutes')[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0xa38565[_0x9026('0xf2')]>=_0x2aaca5['dialCongestionMaxRetry']-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countcongestionretry':_0xa38565[_0x9026('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x2aaca5['dialCongestionRetryFrequency'],_0x9026('0xfd'))['format'](_0x9026('0xfe')),'ContactId':_0xa38565['ContactId'],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565['CampaignId']||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x19d')));break;case 0x0:if(_0xa38565['countnosuchnumberretry']>=_0x2aaca5[_0x9026('0x19e')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0xa38565[_0x9026('0xf3')]+=0x1,'scheduledat':moment()[_0x9026('0xfb')](_0x2aaca5['dialNoSuchNumberRetryFrequency'],_0x9026('0xfd'))[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x19f')));}break;case 0xa:if(_0xa38565['countdropretry']>=_0x2aaca5[_0x9026('0x11e')]-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countdropretry':_0xa38565[_0x9026('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x2aaca5[_0x9026('0x11f')],_0x9026('0xfd'))[_0x9026('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565['ListId'],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x120')));break;case 0xb:if(_0xa38565[_0x9026('0x105')]>=_0x2aaca5[_0x9026('0x126')]-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countabandonedretry':_0xa38565[_0x9026('0x105')]+=0x1,'scheduledat':moment()['add'](_0x2aaca5[_0x9026('0x1a0')],_0x9026('0xfd'))[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0xa38565['ContactId'],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x127')));break;case 0x13:if(_0xa38565[_0x9026('0xef')]>=_0x2aaca5['dialMachineMaxRetry']-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countmachineretry':_0xa38565[_0x9026('0xef')]+=0x1,'scheduledat':moment()[_0x9026('0xfb')](_0x2aaca5[_0x9026('0xfc')],'minutes')[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x100')));break;case 0x14:if(_0xa38565['countagentrejectretry']>=_0x2aaca5[_0x9026('0x1a1')]-0x1){return!![];}this[_0x9026('0xbf')]({'active':![],'countagentrejectretry':_0xa38565['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x9026('0xfb')](_0x2aaca5[_0x9026('0x1a2')],_0x9026('0xfd'))[_0x9026('0x78')](_0x9026('0xfe')),'ContactId':_0xa38565[_0x9026('0xd3')],'ListId':_0xa38565[_0x9026('0xd4')],'VoiceQueueId':_0xa38565[_0x9026('0xd5')]||undefined,'CampaignId':_0xa38565[_0x9026('0xff')]||undefined})['catch'](loggerCatch(_0x9026('0x1a3')));break;default:return!![];}};Dialer[_0x9026('0x18')]['callProgressDetecting']=function(_0x362f4,_0x55d80b,_0x5760b7){var _0x1a3b36=this;var _0xdf7720=new History(_0x362f4);return new BPromise(function(_0xae17bf,_0xb80308){if(_[_0x9026('0x3f')](_0x55d80b)&&typeof _0x55d80b!==_0x9026('0x16a')){return _0xb80308(msgResponse(_0x9026('0x1a4'),_0x9026('0x148'),_0x9026('0x1a5')));}if(_['isUndefined'](_0x5760b7)&&typeof _0x5760b7!==_0x9026('0x16a')){return _0xb80308(msgResponse(_0x9026('0x1a4'),'Failure','evt\x20is\x20undefine'));}switch(_0x5760b7[_0x9026('0x10e')]){case'0':_0x55d80b[_0x9026('0x65')]+=0x1;_0xdf7720[_0x9026('0xa9')]=0x0;_0xdf7720[_0x9026('0xaa')]=_0x9026('0x1a6');_0xdf7720[_0x9026('0xf3')]+=0x1;_0xdf7720[_0x9026('0x103')]+=0x1;ami['emit'](_0x9026('0x1a7'),ut[_0x9026('0xe9')](_0x362f4,'nosuchnumber'));_0x1a3b36[_0x9026('0xcb')](_0xdf7720)[_0x9026('0xb1')](loggerCatch(_0x9026('0xf0')));if(_0x1a3b36[_0x9026('0x198')](0x0,_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0xf3')]>=_0x55d80b[_0x9026('0x19e')]){_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1a8'));}else{_0x1a3b36[_0x9026('0xf7')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1a8'));}}break;case'3':_0x55d80b['outboundNoAnswerCallsDay']+=0x1;_0xdf7720[_0x9026('0xa9')]=0x3;_0xdf7720[_0x9026('0xaa')]=_0x9026('0x1a9');_0xdf7720['countnoanswerretry']+=0x1;_0xdf7720['countglobal']+=0x1;ami[_0x9026('0x4f')](_0x9026('0x1aa'),ut['buildObj'](_0x362f4,_0x9026('0x1ab')));_0x1a3b36['createHistory'](_0xdf7720)['catch'](loggerCatch(_0x9026('0x1ac')));if(_0x1a3b36['checkRetriveMax'](0x3,_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0x104')]>=_0x55d80b[_0x9026('0x199')]){_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1ad'));}else{_0x1a3b36[_0x9026('0xf7')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1ad'));}}break;case'5':_0x55d80b[_0x9026('0x62')]+=0x1;_0xdf7720[_0x9026('0xa9')]=0x5;_0xdf7720['statedesc']=_0x9026('0x1ae');_0xdf7720[_0x9026('0xf1')]+=0x1;_0xdf7720['countglobal']+=0x1;ami[_0x9026('0x4f')](_0x9026('0x1af'),ut['buildObj'](_0x362f4,_0x9026('0x1b0')));_0x1a3b36[_0x9026('0xcb')](_0xdf7720)[_0x9026('0xb1')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x1a3b36[_0x9026('0x198')](0x5,_0x362f4,_0x55d80b)){if(_0xdf7720['countbusyretry']>=_0x55d80b[_0x9026('0x19b')]){_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1b1'));}else{_0x1a3b36[_0x9026('0xf7')](_0xdf7720,_0xae17bf,_0xb80308,'reason\x205\x20busy');}}break;case'8':_0x55d80b['outboundCongestionCallsDay']+=0x1;_0xdf7720[_0x9026('0xa9')]=0x8;_0xdf7720[_0x9026('0xaa')]=_0x9026('0x1b2');_0xdf7720[_0x9026('0xf2')]+=0x1;_0xdf7720['countglobal']+=0x1;ami[_0x9026('0x4f')](_0x9026('0x1b3'),ut['buildObj'](_0x362f4,_0x9026('0x1b4')));_0x1a3b36['createHistory'](_0xdf7720)['catch'](loggerCatch(_0x9026('0x1b5')));if(_0x1a3b36['checkRetriveMax'](0x8,_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0xf2')]>=_0x55d80b['dialCongestionMaxRetry']){_0x1a3b36['createStateFinal'](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1b6'));}else{_0x1a3b36['stateGlobal'](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1b6'));}}break;case'11':_0x55d80b[_0x9026('0x1b7')]+=0x1;_0xdf7720[_0x9026('0xa9')]=0xb;_0xdf7720[_0x9026('0xaa')]=_0x9026('0x124');_0xdf7720[_0x9026('0x105')]+=0x1;_0xdf7720[_0x9026('0x103')]+=0x1;_0x1a3b36[_0x9026('0xcb')](_0xdf7720)[_0x9026('0xb1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x1a3b36[_0x9026('0x198')](0xb,_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0x105')]>=_0x55d80b[_0x9026('0x126')]){_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,'reason\x2011\x20abandoned');}else{_0x1a3b36['stateGlobal'](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1b8'));}}break;case'20':_0x55d80b[_0x9026('0x68')]+=0x1;_0xdf7720[_0x9026('0xa9')]=0x14;_0xdf7720['statedesc']='AgentReject';_0xdf7720['countagentrejectretry']+=0x1;_0xdf7720['countglobal']+=0x1;ami[_0x9026('0x4f')](_0x9026('0x1b9'),ut['buildObj'](_0x362f4,_0x9026('0x1ba')));_0x1a3b36[_0x9026('0xcb')](_0xdf7720)['catch'](loggerCatch(_0x9026('0x1bb')));if(_0x1a3b36['checkRetriveMax'](0x14,_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0xf5')]>=_0x55d80b[_0x9026('0x1a1')]){_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1bc'));}else{_0x1a3b36[_0x9026('0xf7')](_0xdf7720,_0xae17bf,_0xb80308,_0x9026('0x1bc'));}}break;default:_0x55d80b[_0x9026('0x1bd')]+=0x1;_0xdf7720[_0x9026('0xa9')]=0xc;_0xdf7720[_0x9026('0xaa')]=_0x5760b7[_0x9026('0x10e')];_0x1a3b36[_0x9026('0xcb')](_0xdf7720)[_0x9026('0xb1')](loggerCatch(_0x9026('0x1be')));if(_0x1a3b36[_0x9026('0x198')](_0x5760b7['reason'],_0x362f4,_0x55d80b)){if(_0xdf7720[_0x9026('0xf1')]+_0xdf7720[_0x9026('0xf2')]+_0xdf7720[_0x9026('0x104')]+_0xdf7720['countnosuchnumberretry']+_0xdf7720[_0x9026('0xf4')]+_0xdf7720[_0x9026('0x105')]+_0xdf7720[_0x9026('0xef')]+_0xdf7720[_0x9026('0xf5')]>=_0x55d80b[_0x9026('0xf6')]){_0x1a3b36[_0x9026('0xf7')](_0xdf7720,_0xae17bf,_0xb80308,_0x5760b7[_0x9026('0x10e')]);}else{_0x1a3b36[_0x9026('0x106')](_0xdf7720,_0xae17bf,_0xb80308,_0x5760b7[_0x9026('0x10e')]);}}}});};Dialer['prototype'][_0x9026('0xf7')]=function(_0x1cc0bf,_0x2a148e,_0x13a0fb,_0x312402){var _0x5a7797=new Final(_0x1cc0bf);_0x5a7797[_0x9026('0xa9')]=0xf;_0x5a7797['statedesc']=_0x9026('0x1bf');this[_0x9026('0x106')](_0x5a7797,_0x2a148e,_0x13a0fb,_0x312402);};Dialer[_0x9026('0x18')]['createStateFinal']=function(_0x3e2a59,_0x1b9a37,_0x1dac7e,_0x15c16c){this[_0x9026('0xc9')](_0x3e2a59)[_0x9026('0xb7')](function(){return _0x1b9a37(msgResponse('[callProgressDetecting]','Success',_0x15c16c));})[_0x9026('0xb1')](function(){return _0x1dac7e(msgResponse(_0x9026('0x1c0'),_0x9026('0x148'),'contact\x20not\x20moved'));});};Dialer[_0x9026('0x18')][_0x9026('0x15d')]=function(_0x145622){var _0x1b6bce=_0x145622['dialPredictiveOptimizationPercentage']/0x64;var _0x1c9351=_0x145622[_0x9026('0x119')]/(_0x145622[_0x9026('0x119')]+_0x145622[_0x9026('0x61')]);var _0x274e55=Math[_0x9026('0x1c1')](_0x145622[_0x9026('0x70')]*(_0x145622[_0x9026('0x1c2')]/0x64));var _0x451892=Math['round'](_0x145622[_0x9026('0x70')]*(_0x145622[_0x9026('0x1c3')]/0x64));var _0x35cda5=_0x145622[_0x9026('0x53')]+_0x145622[_0x9026('0x57')];var _0x1bf918=Math['floor'](_0x145622[_0x9026('0x8b')]*_0x145622[_0x9026('0x8d')]*_0x145622[_0x9026('0x1c4')]*_0x145622[_0x9026('0x6e')]);if(_[_0x9026('0x3f')](_0x145622[_0x9026('0x26')])){if(!_[_0x9026('0x3f')](_0x145622[_0x9026('0x25')])){_0x145622[_0x9026('0x25')]=undefined;loggerPredictive[_0x9026('0x97')](_0x9026('0x1c5'),_0x9026('0x1c6'));}if(!_[_0x9026('0x3f')](_0x145622[_0x9026('0x92')])){loggerPredictive[_0x9026('0x97')](_0x9026('0x1c5'),_0x9026('0x1c7'));clearInterval(_0x145622[_0x9026('0x92')]);_0x145622[_0x9026('0x92')]=undefined;}_0x145622[_0x9026('0x26')]=moment()[_0x9026('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x145622['name'],_0x9026('0x1c8'),_0x145622['startProgressive']);this['handlePower'](_0x145622,0x1);}else if(ifInterval(_0x145622[_0x9026('0x1c9')],_0x145622[_0x9026('0x26')])){this[_0x9026('0x15b')](_0x145622,0x1);loggerPredictiveCalls[_0x9026('0x7d')](_0x9026('0x1ca'),_0x145622[_0x9026('0x26')],_0x145622['name']);_0x145622[_0x9026('0x8b')]=0x0;_0x145622['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1b6bce<_0x1c9351&&_0x145622['dialPredictiveOptimization']===_0x9026('0x1cb')){freeVariablesPredictive(_0x145622);loggerPredictive[_0x9026('0x7d')](_0x9026('0x1cc'),_0x9026('0x1cd'),_0x1c9351,_0x9026('0x26'),_0x145622[_0x9026('0x42')]);}else if(_0x1bf918<_0x145622[_0x9026('0x11a')]&&_0x145622[_0x9026('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x145622);loggerPredictive[_0x9026('0x7d')](_0x9026('0x1cf'),_0x9026('0x1d0'),_0x1bf918,_0x9026('0x1d1'),_0x145622['predictiveIntervalErlangCallsDroppedCalls'],_0x9026('0x26'),_0x145622['name']);}else if(!ifInterval(_0x145622[_0x9026('0x1c9')],_0x145622[_0x9026('0x26')])&&_['isUndefined'](_0x145622[_0x9026('0x25')])&&!_[_0x9026('0x3f')](_0x145622[_0x9026('0x26')])){_0x145622[_0x9026('0x25')]=moment()[_0x9026('0x78')](_0x9026('0xfe'));loggerPredictive['info'](_0x145622['name'],_0x9026('0x1d2'),_0x145622['startPredictive']);this[_0x9026('0xbc')](_0x145622['dialPredictiveInterval'])[_0x9026('0xb7')](this[_0x9026('0x1d3')](_0x145622))['then'](mergeDataErlangB(_0x145622))[_0x9026('0xb7')](this['startMethodPredictive'](_0x145622))[_0x9026('0xb1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x145622));}else if(!ifInterval(_0x145622[_0x9026('0x1c9')],_0x145622[_0x9026('0x25')])){_0x145622[_0x9026('0x11a')]=0x0;_0x145622['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x9026('0x7d')](_0x145622['name'],'recalculate\x20predictive\x20at',_0x145622[_0x9026('0x25')]);clearInterval(_0x145622[_0x9026('0x92')]);_0x145622[_0x9026('0x92')]=undefined;this['averageHandleTime'](_0x145622[_0x9026('0x1c9')])[_0x9026('0xb7')](this[_0x9026('0x1d3')](_0x145622))[_0x9026('0xb7')](mergeDataErlangB(_0x145622))['then'](this[_0x9026('0x1d4')](_0x145622))[_0x9026('0xb1')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x145622));}else if(_0x145622['predictiveIntervalAvailable']&&_0x35cda5<_0x145622[_0x9026('0x70')]-_0x451892){freeVariablesPredictive(_0x145622);loggerPredictive[_0x9026('0x7d')](_0x145622['name'],_0x9026('0x1d5'),_0x35cda5,_0x9026('0x1d6'),_0x145622[_0x9026('0x70')],'-',_0x451892,'=',_0x145622[_0x9026('0x70')]-_0x451892,')');}else if(_0x145622[_0x9026('0x70')]&&_0x35cda5>_0x145622[_0x9026('0x70')]+_0x274e55){freeVariablesPredictive(_0x145622);loggerPredictive[_0x9026('0x7d')](_0x145622[_0x9026('0x42')],_0x9026('0x1d5'),_0x35cda5,_0x9026('0x1d7'),_0x145622[_0x9026('0x70')],'+',_0x274e55,'=',_0x145622['predictiveIntervalAvailable']+_0x274e55,')');}};Dialer[_0x9026('0x18')][_0x9026('0x1d3')]=function(_0x22de00){var _0xbf04b1=this;return function(_0x6961f0){return new BPromise(function(_0x585188,_0x21bc6b){_['merge'](_0x22de00,_0x6961f0[0x0]);if(checkGetDataPredictive(_0x6961f0[0x0])){var _0x20d94a=_0x22de00['predictiveIntervalAvailable']=_0x22de00[_0x9026('0x57')]+_0x22de00[_0x9026('0x53')];var _0xcaf958=_0x22de00[_0x9026('0x1c9')]*0x3c;var _0xa84bb4=_0x6961f0[0x0][_0x9026('0x6a')]+_0x6961f0[0x0]['predictiveIntervalAvgHoldtime'];var _0x2b85d4=(_0x6961f0[0x0][_0x9026('0x69')]+_0x6961f0[0x0][_0x9026('0x6c')]+_0x6961f0[0x0][_0x9026('0x6b')])/_0x6961f0[0x0]['predictiveIntervalTotalCalls'];_0x22de00['predictiveIntervalHitRate']=_0x2b85d4>0x0?_0x2b85d4:0x1;switch(_0x22de00[_0x9026('0x1ce')]){case _0x9026('0x1cb'):var _0x5635dd=_0x22de00[_0x9026('0x1d8')]/0x64;return _0xbf04b1[_0x9026('0x1d9')](_0x20d94a,_0xcaf958,_0xa84bb4,_0x2b85d4,_0x5635dd)[_0x9026('0xb7')](function(_0x1414e9){return _0x585188(_0x1414e9);});case _0x9026('0x1da'):var _0x4b35ca=_0x22de00[_0x9026('0x1d8')]/0x64;return _0xbf04b1[_0x9026('0x1db')](_0x20d94a,_0xcaf958,_0xa84bb4,_0x2b85d4,_0x4b35ca)[_0x9026('0xb7')](function(_0x3c10de){return _0x585188(_0x3c10de);});default:return _0x21bc6b(msgResponse('[getDataPredictive]',_0x9026('0x148'),'Unknown\x20Predictive'));}}else{return _0x21bc6b(msgResponse('[getDataPredictive]',_0x9026('0x148'),_0x9026('0x1dc')));}});};};Dialer[_0x9026('0x18')][_0x9026('0x1dd')]=function(_0x3e1a23){var _0x4fa8f1=this;return function(_0x3a91f7){return new BPromise(function(_0x47a470,_0x3a1cbe){_[_0x9026('0x12f')](_0x3e1a23,_0x3a91f7[0x0]);if(checkGetDataPredictive(_0x3a91f7[0x0])){loggerPredictive[_0x9026('0x7d')](JSON['stringify'](_0x3a91f7[0x0]));if(_0x3e1a23[_0x9026('0x1ce')]===_0x9026('0x1cb')){return _0x4fa8f1[_0x9026('0xc7')](_0x3e1a23['id'])[_0x9026('0xb7')](function(_0x5c46bd){var _0x2d4b74=_0x3e1a23[_0x9026('0x54')]-_0x5c46bd[0x0][_0x9026('0x1de')];var _0x3fedc0=_0x3e1a23['dialPredictiveInterval']*0x3c;var _0x383071=_0x3a91f7[0x0]['predictiveIntervalAvgTalktime']+_0x3a91f7[0x0][_0x9026('0x84')];var _0xc8e646=(_0x3a91f7[0x0][_0x9026('0x69')]+_0x3a91f7[0x0][_0x9026('0x6c')]+_0x3a91f7[0x0][_0x9026('0x6b')])/_0x3a91f7[0x0][_0x9026('0x71')];var _0x5878b4=_0x3e1a23[_0x9026('0x1d8')]/0x64;_0x3e1a23[_0x9026('0x6f')]=_0x5c46bd[0x0][_0x9026('0x1de')]||0x0;_0x3e1a23['predictiveIntervalHitRate']=_0xc8e646>0x0?_0xc8e646:0x1;return _0x4fa8f1[_0x9026('0x1d9')](_0x2d4b74,_0x3fedc0,_0x383071,_0xc8e646,_0x5878b4);})[_0x9026('0xb7')](function(_0x285551){return _0x47a470(_0x285551);})[_0x9026('0xb1')](function(_0x2195f2){return _0x3a1cbe(msgResponse(_0x9026('0x1df'),_0x9026('0x148'),JSON[_0x9026('0x4c')](_0x2195f2)));});}if(_0x3e1a23[_0x9026('0x1ce')]===_0x9026('0x1da')){return _0x4fa8f1[_0x9026('0xc7')](_0x3e1a23['id'])[_0x9026('0xb7')](function(_0x3dea7d){var _0x58f11a=_0x3e1a23['loggedIn']-_0x3dea7d[0x0][_0x9026('0x1de')];var _0x4b5457=_0x3e1a23[_0x9026('0x1c9')]*0x3c;var _0xb199a3=_0x3a91f7[0x0][_0x9026('0x6a')]+_0x3a91f7[0x0]['predictiveIntervalAvgHoldtime'];var _0x1cc8af=(_0x3a91f7[0x0][_0x9026('0x69')]+_0x3a91f7[0x0][_0x9026('0x6c')]+_0x3a91f7[0x0][_0x9026('0x6b')])/_0x3a91f7[0x0][_0x9026('0x71')];var _0xb04fbd=_0x3e1a23[_0x9026('0x1d8')]/0x64;_0x3e1a23[_0x9026('0x6f')]=_0x3dea7d[0x0][_0x9026('0x1de')]||0x0;_0x3e1a23[_0x9026('0x1c4')]=_0x1cc8af>0x0?_0x1cc8af:0x1;return _0x4fa8f1['busyFactor'](_0x58f11a,_0x4b5457,_0xb199a3,_0x1cc8af,_0xb04fbd);})[_0x9026('0xb7')](function(_0x15707d){return _0x47a470(_0x15707d);})[_0x9026('0xb1')](function(_0x269586){return _0x3a1cbe(msgResponse(_0x9026('0x1df'),_0x9026('0x148'),JSON[_0x9026('0x4c')](_0x269586)));});}}else{return _0x3a1cbe(msgResponse(_0x9026('0x1e0'),_0x9026('0x148'),_0x9026('0x1dc')));}});};};Dialer[_0x9026('0x18')][_0x9026('0x1d4')]=function(_0x4ba1e4){var _0x48f583=this;return function(){var _0x473d43=0x0;var _0x5d43ef=Math[_0x9026('0x1e1')](_0x4ba1e4[_0x9026('0x73')]*0x3e8);if(_0x5d43ef>0x0){_0x5d43ef=_0x5d43ef<0x64?0x64:_0x5d43ef;loggerPredictive['info'](_0x4ba1e4[_0x9026('0x42')],'one\x20call\x20every:',_0x5d43ef,_0x9026('0x4d'));_0x4ba1e4[_0x9026('0x92')]=setInterval(function(){_0x48f583[_0x9026('0x92')](_0x4ba1e4);loggerPredictiveCalls[_0x9026('0x7d')](_0x9026('0x1e2'),_0x473d43+=0x1);},_0x5d43ef);}else{loggerPredictive[_0x9026('0x7d')](_0x4ba1e4[_0x9026('0x42')],_0x9026('0x1e3'));}};};Dialer[_0x9026('0x18')]['checkContactBlack']=function(_0x33ea7e,_0x377aeb){var _0x212ab5=this;return function(_0x40898d){if(_[_0x9026('0x4a')](_0x40898d)){if(_[_0x9026('0xdd')](_0x377aeb[_0x9026('0x1e4')])||!_0x377aeb[_0x9026('0x1e5')]){if(_0x33ea7e['dialMethod']===_0x9026('0x7')){_0x33ea7e['queueStatusComplete']=_[_0x9026('0x3f')](_0x33ea7e[_0x9026('0x132')])?!![]:_0x33ea7e[_0x9026('0x132')];var _0x26770b=uuid['v4']();_0x212ab5[_0x9026('0x22')][_0x26770b]=new Action(_0x33ea7e,_0x377aeb,_0x26770b);loggerBooked[_0x9026('0x7d')](_0x9026('0x1e6'),_0x26770b,_0x9026('0x1e7'),JSON[_0x9026('0x4c')](_0x33ea7e[_0x9026('0x132')]),_0x9026('0x1e8'),_0x33ea7e[_0x9026('0x42')]);if(_0x33ea7e[_0x9026('0x132')]){_0x33ea7e[_0x9026('0x132')]=![];_0x212ab5[_0x9026('0x28')][_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xb4')]]=[];ami['Action']({'actionid':_0x26770b,'action':_0x9026('0x1e9'),'queue':_0x33ea7e['name']})['catch'](function(){_0x212ab5[_0x9026('0xb3')](_0x33ea7e);_0x212ab5[_0x9026('0xbf')]({'active':![],'ContactId':_0x212ab5[_0x9026('0x22')][_0x26770b]['ContactId'],'ListId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xd4')],'VoiceQueueId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xd5')]||undefined,'CampaignId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xff')]||undefined})['catch'](loggerCatch(_0x9026('0x1ea')));delete _0x212ab5[_0x9026('0x22')][_0x26770b];});}else{loggerBooked[_0x9026('0x7d')](_0x9026('0x1eb'),JSON[_0x9026('0x4c')](_0x33ea7e[_0x9026('0x132')]),_0x9026('0x1e8'),_0x33ea7e['name']);_0x212ab5[_0x9026('0xb3')](_0x33ea7e);_0x212ab5[_0x9026('0xbf')]({'active':![],'ContactId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xd3')],'ListId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xd4')],'VoiceQueueId':_0x212ab5['actions'][_0x26770b][_0x9026('0xd5')]||undefined,'CampaignId':_0x212ab5[_0x9026('0x22')][_0x26770b][_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x1ea')));delete _0x212ab5[_0x9026('0x22')][_0x26770b];}}else{return _0x212ab5[_0x9026('0x169')](_0x33ea7e,_0x377aeb);}}else{if(getDiff(_0x377aeb[_0x9026('0x1ec')])<_0x33ea7e[_0x9026('0x1ed')]*0x3c){if(_0x377aeb[_0x9026('0x1ee')]&&!_0x377aeb['Agent'][_0x9026('0x1ef')]){_0x212ab5['preview'][_0x9026('0x136')](_0x377aeb['id'])[_0x9026('0x1b')](function(){_0x212ab5[_0x9026('0xb3')](_0x33ea7e);});}else{_0x212ab5[_0x9026('0x1f0')]({'active':![]},_0x377aeb['id'],0x1)[_0x9026('0x1b')](function(){_0x212ab5['updateOriginated'](_0x33ea7e);});}}else{_0x33ea7e[_0x9026('0x67')]+=0x1;_0x212ab5['updateOriginated'](_0x33ea7e);if(_0x33ea7e[_0x9026('0x1f1')]){_0x212ab5['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x377aeb[_0x9026('0xd3')],'ListId':_0x377aeb['ListId'],'VoiceQueueId':_0x377aeb[_0x9026('0xd5')]||undefined,'CampaignId':_0x377aeb[_0x9026('0xff')]||undefined})[_0x9026('0xb1')](loggerCatch(_0x9026('0x1f2')));_0x212ab5['createHistory'](createObjHistory(_0x33ea7e,_0x377aeb,_0x9026('0x1f3'),0x17,_0x9026('0x1f4')))[_0x9026('0xb1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x212ab5['saveInDb'](createObjHistory(_0x33ea7e,_0x377aeb,'RECALLFAILEDTIMEOUT',0x16,_0x9026('0x1f5')),_0x9026('0x1f6'),'[Originate][HistoryRecallClose]');}}}}else{_0x33ea7e['outboundBlacklistCallsDay']+=0x1;_0x212ab5[_0x9026('0xd2')](createObjHistory(_0x33ea7e,_0x377aeb,_0x9026('0x1f7'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x9026('0x1f8'));throw _0x9026('0x1f9');}};};Dialer[_0x9026('0x18')]['handleIvr']=function(_0x3c98f9){var _0x521d3e=this;var _0x1eb758=_0x3c98f9[_0x9026('0x1fa')]-_0x3c98f9['originated']-_0x3c98f9['temp'];emitCampaignSummary(_0x3c98f9);if(_0x1eb758>0x0){if(_0x1eb758>this['maxNumberOriginate']){_0x1eb758=this[_0x9026('0x21')];}_0x3c98f9['temp']+=_0x1eb758;this['getContactDialerIvr'](_0x3c98f9['id'],_0x1eb758,_0x3c98f9[_0x9026('0x1fb')],_0x3c98f9)['then'](function(_0x43d2e5){_0x3c98f9[_0x9026('0xc3')]-=_0x1eb758;_0x3c98f9[_0x9026('0xc3')]=_0x3c98f9[_0x9026('0xc3')]>0x0?_0x3c98f9['temp']:0x0;if(!checkContactEmpty(_0x43d2e5)){_0x3c98f9['message']=_0x9026('0xa1');logger['info'](_0x9026('0x1fc')+_0x3c98f9['name']);}else{_0x3c98f9[_0x9026('0x72')]+=_0x43d2e5['length'];_0x3c98f9[_0x9026('0x40')]='RUNNING';for(var _0xed2575=0x0;_0xed2575<_0x43d2e5[_0x9026('0x9a')];_0xed2575+=0x1){_0x3c98f9['ivrTotalCallsDays']+=0x1;if(_[_0x9026('0xdd')](_0x43d2e5[_0xed2575])||_[_0x9026('0xdd')](_0x43d2e5[_0xed2575][_0x9026('0x16c')])||_[_0x9026('0xdd')](_0x43d2e5[_0xed2575][_0x9026('0x16c')][_0x9026('0x16d')])){_0x521d3e[_0x9026('0xd0')]('[actionOriginate]\x20',_0x3c98f9,_0x43d2e5[_0xed2575]);}else{_0x521d3e['checkIsBlackListIvr'](_[_0x9026('0x130')](_0x43d2e5[_0xed2575],[_0x9026('0xff'),_0x9026('0x1fd')]))[_0x9026('0xb7')](_0x521d3e['checkContactBlack'](_0x3c98f9,_0x43d2e5[_0xed2575]))[_0x9026('0xb1')](_0x521d3e[_0x9026('0xcf')]('[actionOriginateIvr]\x20',_0x3c98f9));}}}})[_0x9026('0xb1')](loggerGetContactDialer(_0x9026('0x1fe'),_0x3c98f9,_0x1eb758));}};Dialer[_0x9026('0x18')][_0x9026('0x15b')]=function(_0x2f4f6a,_0x5f53a1){var _0xcab94e=this;var _0x47ed7b=[];var _0x59f994=_0x5f53a1>=0x1?_0x5f53a1:0x1;if(_0x2f4f6a[_0x9026('0x5b')]==='booked'){_0x59f994=0x1;}var _0x3eea75=Math[_0x9026('0x1e1')](_0x2f4f6a[_0x9026('0x53')]*_0x59f994)-_0x2f4f6a['originated']-_0x2f4f6a[_0x9026('0xc3')];emitVoiceQueueSummary(_0x2f4f6a);if(_0x2f4f6a[_0x9026('0x1ff')]>0x0){var _0x59f77c=_0x2f4f6a['dialLimitQueue']-_0x2f4f6a[_0x9026('0x72')]-_0x2f4f6a[_0x9026('0x57')]-_0x2f4f6a[_0x9026('0xc3')]-_0x2f4f6a[_0x9026('0x55')];if(_0x3eea75>_0x59f77c){_0x3eea75=_0x59f77c;}}if(_0x3eea75>0x0){if(_0x2f4f6a[_0x9026('0x5b')]==='booked'){_0x3eea75=0x1;}if(_0x3eea75>this[_0x9026('0x21')]){_0x3eea75=this[_0x9026('0x21')];}_0x2f4f6a[_0x9026('0xc3')]+=_0x3eea75;for(var _0x4c12e2 in this[_0x9026('0x1f')]){if(typeof this[_0x9026('0x1f')][_0x4c12e2]!==_0x9026('0x9b')){if(this[_0x9026('0x1f')][_0x4c12e2]['state']===_0x9026('0x200')&&this[_0x9026('0x1f')][_0x4c12e2]['status']===_0x9026('0x201')){_0x47ed7b[_0x9026('0x12e')](this[_0x9026('0x1f')][_0x4c12e2]['id']);}}}this[_0x9026('0xc2')](_0x2f4f6a['id'],_0x47ed7b,_0x3eea75,_0x2f4f6a[_0x9026('0x1fb')],_0x2f4f6a)[_0x9026('0xb7')](function(_0x6a64e){_0x2f4f6a[_0x9026('0xc3')]-=_0x3eea75;_0x2f4f6a[_0x9026('0xc3')]=_0x2f4f6a[_0x9026('0xc3')]>0x0?_0x2f4f6a['temp']:0x0;if(!checkContactEmpty(_0x6a64e)){_0xcab94e[_0x9026('0xb6')](_0x2f4f6a)[_0x9026('0xb7')](sendMessageReschedule(_0x2f4f6a))['catch'](loggerCatch(_0x9026('0xb8')));}else{_0x2f4f6a[_0x9026('0x72')]+=_0x6a64e[_0x9026('0x9a')];_0x2f4f6a[_0x9026('0x40')]=_0x2f4f6a[_0x9026('0x5b')]===_0x9026('0x7')?_0x9026('0x175'):'RUNNING';for(var _0x234f9d=0x0;_0x234f9d<_0x6a64e[_0x9026('0x9a')];_0x234f9d+=0x1){if(_['isNil'](_0x6a64e[_0x234f9d])||_[_0x9026('0xdd')](_0x6a64e[_0x234f9d][_0x9026('0x16c')])||_['isNil'](_0x6a64e[_0x234f9d][_0x9026('0x16c')]['phone'])){_0xcab94e[_0x9026('0xd0')](_0x9026('0x202'),_0x2f4f6a,_0x6a64e[_0x234f9d]);}else{_0xcab94e[_0x9026('0x203')](_[_0x9026('0x130')](_0x6a64e[_0x234f9d],['VoiceQueueId',_0x9026('0x1fd')]))[_0x9026('0xb7')](_0xcab94e['checkContactBlack'](_0x2f4f6a,_0x6a64e[_0x234f9d]))[_0x9026('0xb1')](_0xcab94e[_0x9026('0xcf')]('[actionOriginate]\x20',_0x2f4f6a));}}}})['catch'](loggerGetContactDialer(_0x9026('0x204'),_0x2f4f6a,_0x3eea75));}};Dialer[_0x9026('0x18')][_0x9026('0x92')]=function(_0x1f8562){if(_0x1f8562[_0x9026('0x1ff')]>0x0){var _0x36a1ac=_0x1f8562[_0x9026('0x1ff')]-_0x1f8562[_0x9026('0x72')]-_0x1f8562[_0x9026('0x57')];if(_0x36a1ac>0x0){this[_0x9026('0x205')](_0x1f8562);}else{loggerPredictiveCalls[_0x9026('0x7d')]('[handlePredictive][limitChannel]');}}else{this[_0x9026('0x205')](_0x1f8562);}};Dialer[_0x9026('0x18')][_0x9026('0x205')]=function(_0x16ce0a){var _0xaf97cc=this;var _0x998a93=[];_0x16ce0a[_0x9026('0x72')]+=0x1;for(var _0x579f47 in this[_0x9026('0x1f')]){if(typeof this[_0x9026('0x1f')][_0x579f47]!==_0x9026('0x9b')){if(this[_0x9026('0x1f')][_0x579f47]['state']==='not_inuse'&&this[_0x9026('0x1f')][_0x579f47]['status']===_0x9026('0x201')){_0x998a93['push'](this[_0x9026('0x1f')][_0x579f47]['id']);}}}this[_0x9026('0xc2')](_0x16ce0a['id'],_0x998a93,0x1,_0x16ce0a[_0x9026('0x1fb')],_0x16ce0a)[_0x9026('0xb7')](function(_0x74c739){if(!checkContactEmpty(_0x74c739)){checkContactLowerLimitOriginate(_0x16ce0a,0x1,0x0);_0xaf97cc[_0x9026('0xb6')](_0x16ce0a)[_0x9026('0xb7')](sendMessageReschedule(_0x16ce0a))[_0x9026('0xb1')](loggerCatch(_0x9026('0xb8')));}else{_0x16ce0a[_0x9026('0x40')]='RUNNING';if(_[_0x9026('0xdd')](_0x74c739[0x0])||_[_0x9026('0xdd')](_0x74c739[0x0][_0x9026('0x16c')])||_[_0x9026('0xdd')](_0x74c739[0x0][_0x9026('0x16c')][_0x9026('0x16d')])){_0xaf97cc['emptyContact'](_0x9026('0x202'),_0x16ce0a,_0x74c739[0x0]);}else{_0xaf97cc[_0x9026('0x203')](_[_0x9026('0x130')](_0x74c739[0x0],[_0x9026('0xd5'),_0x9026('0x1fd')]))[_0x9026('0xb7')](_0xaf97cc[_0x9026('0x206')](_0x16ce0a,_0x74c739[0x0]))[_0x9026('0xb1')](_0xaf97cc[_0x9026('0xcf')](_0x9026('0x207'),_0x16ce0a));}}})['catch'](loggerGetContactDialer(_0x9026('0x208'),_0x16ce0a,0x1));emitVoiceQueueSummary(_0x16ce0a);};Dialer[_0x9026('0x18')][_0x9026('0x1d9')]=function(_0x161a8c,_0xd96bfe,_0x314f08,_0x469ff5,_0x3e2386,_0x351339){loggerPredictive[_0x9026('0x7d')](_0x9026('0x209'));loggerPredictive[_0x9026('0x7d')]('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',_0x161a8c);loggerPredictive[_0x9026('0x7d')](_0x9026('0x20a'),_0xd96bfe);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',_0x314f08);loggerPredictive['info'](_0x9026('0x20b'),_0x469ff5);loggerPredictive[_0x9026('0x7d')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e2386);loggerPredictive[_0x9026('0x7d')](_0x9026('0x85'));return new BPromise(function(_0x4c7fc8,_0x33510e){if(_0x161a8c<=0x0||isNaN(_0x161a8c)){return _0x33510e(msgResponse('[abandonmentRate]',_0x9026('0x20c'),_0x9026('0x20d')+_0x161a8c));}if(_0x314f08<=0x0||isNaN(_0x314f08)){return _0x33510e(msgResponse(_0x9026('0x20e'),'Error','Ts\x20=\x20'+_0x314f08));}if(_0x469ff5<=0x0||isNaN(_0x469ff5)){return _0x33510e(msgResponse(_0x9026('0x20e'),_0x9026('0x20c'),'p\x20=\x20'+_0x469ff5));}if(_0xd96bfe<=0x0||isNaN(_0xd96bfe)){return _0x33510e(msgResponse(_0x9026('0x20e'),_0x9026('0x20c'),'interval\x20=\x20'+_0xd96bfe));}if(_0x3e2386<=0x0||isNaN(_0x3e2386)){return _0x33510e(msgResponse(_0x9026('0x20e'),'Error',_0x9026('0x20f')+_0x3e2386));}_0x351339=_0x351339||0x0;var _0x373b58=0x1/_0x314f08;var _0x46bd66=0x0;var _0x328d03=0x0;var _0x38b291=0x0;var _0x4a7b47=0x0;for(var _0x5af905=0x0;_0x38b291<_0x3e2386;_0x5af905+=0x1){_0x328d03=_0x5af905/_0xd96bfe;_0x46bd66=(_0x469ff5*_0x328d03+_0x351339)/_0x373b58;_0x38b291=erlangb(_0x46bd66,_0x161a8c);_0x4a7b47=_0x46bd66/_0x161a8c*(0x1-erlangb(_0x46bd66,_0x161a8c));}return _0x4c7fc8({'erlangCalls':_0x5af905,'erlangCallToSecond':_0xd96bfe/_0x5af905,'erlangAbandonmentRate':_0x38b291,'erlangBusyFactor':_0x4a7b47});});};Dialer[_0x9026('0x18')]['busyFactor']=function(_0x1a695a,_0x503a8c,_0x3ddeb2,_0x202e6f,_0x2bfa56,_0x46a9b0){loggerPredictive['info'](_0x9026('0x210'));loggerPredictive[_0x9026('0x7d')](_0x9026('0x211'),_0x1a695a);loggerPredictive[_0x9026('0x7d')](_0x9026('0x20a'),_0x503a8c);loggerPredictive[_0x9026('0x7d')](_0x9026('0x212'),_0x3ddeb2);loggerPredictive['info'](_0x9026('0x20b'),_0x202e6f);loggerPredictive['info'](_0x9026('0x213'),_0x2bfa56);loggerPredictive[_0x9026('0x7d')](_0x9026('0x85'));return new BPromise(function(_0xab624c,_0x22a0e0){if(_0x1a695a<=0x0||isNaN(_0x1a695a)){return _0x22a0e0(msgResponse(_0x9026('0x214'),_0x9026('0x20c'),_0x9026('0x20d')+_0x1a695a));}if(_0x3ddeb2<=0x0||isNaN(_0x3ddeb2)){return _0x22a0e0(msgResponse(_0x9026('0x214'),_0x9026('0x20c'),'Ts\x20=\x20'+_0x3ddeb2));}if(_0x202e6f<=0x0||isNaN(_0x202e6f)){return _0x22a0e0(msgResponse(_0x9026('0x214'),_0x9026('0x20c'),_0x9026('0x215')+_0x202e6f));}if(_0x503a8c<=0x0||isNaN(_0x503a8c)){return _0x22a0e0(msgResponse(_0x9026('0x214'),_0x9026('0x20c'),_0x9026('0x216')+_0x503a8c));}if(_0x2bfa56<=0x0||isNaN(_0x2bfa56)){return _0x22a0e0(msgResponse('[busyFactor]',_0x9026('0x20c'),_0x9026('0x217')+_0x2bfa56));}_0x46a9b0=_0x46a9b0||0x0;var _0x4fe2c2=0x1/_0x3ddeb2;var _0x36e69d=0x0;var _0x1b911f=0x0;var _0x350878=0x0;var _0x4117ea=0x0;for(var _0x26a82c=0x0;_0x4117ea<_0x2bfa56;_0x26a82c+=0x1){_0x1b911f=_0x26a82c/_0x503a8c;_0x36e69d=(_0x202e6f*_0x1b911f+_0x46a9b0)/_0x4fe2c2;_0x350878=erlangb(_0x36e69d,_0x1a695a);_0x4117ea=_0x36e69d/_0x1a695a*(0x1-erlangb(_0x36e69d,_0x1a695a));}return _0xab624c({'erlangCalls':_0x26a82c,'erlangCallToSecond':_0x503a8c/_0x26a82c,'erlangAbandonmentRate':_0x350878,'erlangBusyFactor':_0x4117ea});});};module['exports']=Dialer;
\ No newline at end of file
index d5318fc..99b750b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe73=['ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme'];(function(_0x23a608,_0x554d43){var _0x64e20b=function(_0x22b5a6){while(--_0x22b5a6){_0x23a608['push'](_0x23a608['shift']());}};_0x64e20b(++_0x554d43);}(_0xbe73,0x18d));var _0x3be7=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0xbe73[_0x178856];return _0x3c7fe7;};'use strict';var util=require(_0x3be7('0x0'));var _=require(_0x3be7('0x1'));var moment=require(_0x3be7('0x2'));function getSeconds(_0x4c9a7a,_0xbbbbbf){var _0x2a3f48=moment(_0x4c9a7a)[_0x3be7('0x3')](0x0);var _0x580f3d=moment(_0xbbbbbf)[_0x3be7('0x3')](0x0);return _0x2a3f48[_0x3be7('0x4')](_0x580f3d,_0x3be7('0x5'));}function QueueCallerAbandon(_0x593c3e,_0x556aef){this[_0x3be7('0x6')]=_0x593c3e[_0x3be7('0x6')];this['type']=_0x593c3e[_0x3be7('0x7')];this['campaigntype']=_0x593c3e[_0x3be7('0x7')]===_0x3be7('0x8')?'queue':_0x593c3e['type'];this[_0x3be7('0x9')]=_0x593c3e[_0x3be7('0x9')];this[_0x3be7('0xa')]=_0x593c3e[_0x3be7('0xa')];this[_0x3be7('0xb')]=_0x593c3e[_0x3be7('0xb')];this[_0x3be7('0xc')]=_0x593c3e[_0x3be7('0x9')]+_0x593c3e[_0x3be7('0xa')]+_0x593c3e['countnoanswerretry']+_0x593c3e[_0x3be7('0xd')]+_0x593c3e[_0x3be7('0xe')]+_0x593c3e[_0x3be7('0xf')]+_0x593c3e[_0x3be7('0x10')]+_0x593c3e['countagentrejectretry'];this['countnosuchnumberretry']=_0x593c3e[_0x3be7('0xd')];this['countdropretry']=_0x593c3e[_0x3be7('0xe')];this[_0x3be7('0xf')]=_0x593c3e[_0x3be7('0xf')];this['countmachineretry']=_0x593c3e['countmachineretry'];this[_0x3be7('0x11')]=_0x593c3e[_0x3be7('0x11')];this[_0x3be7('0x12')]=_0x556aef[_0x3be7('0x12')];this['calleridname']=_0x593c3e[_0x3be7('0x13')];this[_0x3be7('0x14')]=_0x593c3e[_0x3be7('0x15')];this[_0x3be7('0x16')]=_0x593c3e[_0x3be7('0x16')];this[_0x3be7('0x17')]=_0x593c3e[_0x3be7('0x17')];this['droptime']=_0x593c3e[_0x3be7('0x18')];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x593c3e[_0x3be7('0x17')],_0x593c3e[_0x3be7('0x16')]);this['holdtime']=getSeconds(this[_0x3be7('0x18')],_0x593c3e['responsetime']);this[_0x3be7('0x19')]=0x0;this['queue']=_0x556aef['queue'];this[_0x3be7('0x1a')]=_0x556aef['connectedlinename'];this[_0x3be7('0x1b')]=_0x556aef[_0x3be7('0x1b')];this[_0x3be7('0x1c')]=_0x593c3e['callback'];this[_0x3be7('0x1d')]=_0x593c3e['callbackuniqueid'];this[_0x3be7('0x1e')]=_0x593c3e[_0x3be7('0x1e')];this['recallme']=_0x593c3e[_0x3be7('0x1f')];this[_0x3be7('0x20')]=_0x593c3e[_0x3be7('0x20')];this[_0x3be7('0x21')]=_0x593c3e[_0x3be7('0x21')];this['UserId']=_0x593c3e[_0x3be7('0x22')];this['VoiceQueueId']=_0x593c3e['VoiceQueueId'];this['CampaignId']=_0x593c3e[_0x3be7('0x23')];this[_0x3be7('0x24')]=_0x593c3e[_0x3be7('0x24')]||'';this[_0x3be7('0x25')]=_0x593c3e['originatecalleridname']||'';}module[_0x3be7('0x26')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x4496=['droptime','endtime','ringtime','responsetime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime'];(function(_0x49acae,_0x58c926){var _0x2c8b08=function(_0x185e82){while(--_0x185e82){_0x49acae['push'](_0x49acae['shift']());}};_0x2c8b08(++_0x58c926);}(_0x4496,0x1c1));var _0x6449=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x4496[_0x1602ef];return _0x5870ee;};'use strict';var util=require(_0x6449('0x0'));var _=require(_0x6449('0x1'));var moment=require(_0x6449('0x2'));function getSeconds(_0x29ca8e,_0x466031){var _0x490b6c=moment(_0x29ca8e)[_0x6449('0x3')](0x0);var _0x4bae0a=moment(_0x466031)['milliseconds'](0x0);return _0x490b6c[_0x6449('0x4')](_0x4bae0a,'seconds');}function QueueCallerAbandon(_0x566af9,_0x2e7c14){this[_0x6449('0x5')]=_0x566af9['scheduledat'];this[_0x6449('0x6')]=_0x566af9[_0x6449('0x6')];this[_0x6449('0x7')]=_0x566af9[_0x6449('0x6')]===_0x6449('0x8')?_0x6449('0x9'):_0x566af9[_0x6449('0x6')];this[_0x6449('0xa')]=_0x566af9['countbusyretry'];this[_0x6449('0xb')]=_0x566af9[_0x6449('0xb')];this[_0x6449('0xc')]=_0x566af9['countnoanswerretry'];this[_0x6449('0xd')]=_0x566af9[_0x6449('0xa')]+_0x566af9[_0x6449('0xb')]+_0x566af9[_0x6449('0xc')]+_0x566af9[_0x6449('0xe')]+_0x566af9[_0x6449('0xf')]+_0x566af9['countabandonedretry']+_0x566af9[_0x6449('0x10')]+_0x566af9[_0x6449('0x11')];this[_0x6449('0xe')]=_0x566af9[_0x6449('0xe')];this[_0x6449('0xf')]=_0x566af9[_0x6449('0xf')];this[_0x6449('0x12')]=_0x566af9['countabandonedretry'];this['countmachineretry']=_0x566af9['countmachineretry'];this[_0x6449('0x11')]=_0x566af9['countagentrejectretry'];this[_0x6449('0x13')]=_0x2e7c14[_0x6449('0x13')];this['calleridname']=_0x566af9[_0x6449('0x14')];this[_0x6449('0x15')]=_0x566af9[_0x6449('0x16')];this[_0x6449('0x17')]=_0x566af9['starttime'];this['responsetime']=_0x566af9['responsetime'];this[_0x6449('0x18')]=_0x566af9[_0x6449('0x18')];this[_0x6449('0x19')]=this[_0x6449('0x18')];this[_0x6449('0x1a')]=getSeconds(_0x566af9[_0x6449('0x1b')],_0x566af9[_0x6449('0x17')]);this[_0x6449('0x1c')]=getSeconds(this[_0x6449('0x18')],_0x566af9[_0x6449('0x1b')]);this[_0x6449('0x1d')]=0x0;this[_0x6449('0x9')]=_0x2e7c14[_0x6449('0x9')];this[_0x6449('0x1e')]=_0x2e7c14['connectedlinename'];this[_0x6449('0x1f')]=_0x2e7c14[_0x6449('0x1f')];this[_0x6449('0x20')]=_0x566af9[_0x6449('0x20')];this[_0x6449('0x21')]=_0x566af9['callbackuniqueid'];this[_0x6449('0x22')]=_0x566af9[_0x6449('0x22')];this[_0x6449('0x23')]=_0x566af9[_0x6449('0x23')];this[_0x6449('0x24')]=_0x566af9['ContactId'];this[_0x6449('0x25')]=_0x566af9['ListId'];this['UserId']=_0x566af9[_0x6449('0x26')];this[_0x6449('0x27')]=_0x566af9['VoiceQueueId'];this['CampaignId']=_0x566af9['CampaignId'];this[_0x6449('0x28')]=_0x566af9['originatecalleridnum']||'';this[_0x6449('0x29')]=_0x566af9[_0x6449('0x29')]||'';}module[_0x6449('0x2a')]=QueueCallerAbandon;
\ No newline at end of file
index 18fe439..7bdd0a4 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(_0x236324,_0x2e24bc){var _0x16ef65=function(_0x56147e){while(--_0x56147e){_0x236324['push'](_0x236324['shift']());}};_0x16ef65(++_0x2e24bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x56e35f,_0x31f717){var _0x3ad21e=function(_0x3357fd){while(--_0x3357fd){_0x56e35f['push'](_0x56e35f['shift']());}};_0x3ad21e(++_0x31f717);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 8555762..bd4d065 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70a7=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','application/pdf','then','notify','parse','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','[Fax][Message][Error][Updated]','logger','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','addVariables','ext','.pdf','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid'];(function(_0x19360a,_0x124f84){var _0x164092=function(_0x526b64){while(--_0x526b64){_0x19360a['push'](_0x19360a['shift']());}};_0x164092(++_0x124f84);}(_0x70a7,0x134));var _0x770a=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x70a7[_0x119705];return _0x2affc2;};'use strict';var util=require('util');var _=require(_0x770a('0x0'));var BPromise=require(_0x770a('0x1'));var uuid=require('uuid');var moment=require(_0x770a('0x2'));var path=require(_0x770a('0x3'));var tiff2pdf=require(_0x770a('0x4'));var gs=require(_0x770a('0x5'));var logger=require(_0x770a('0x6'))(_0x770a('0x7'));var ami=require(_0x770a('0x8'));var rpcDb=require(_0x770a('0x9'));var Channel=require('./channel');var ut=require(_0x770a('0xa'));var Action=require(_0x770a('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x770a('0xc'));function Fax(_0x47e138){this[_0x770a('0xd')]={};this[_0x770a('0xe')]=_0x47e138[_0x770a('0xe')];this[_0x770a('0xf')]=_0x47e138[_0x770a('0xf')];this[_0x770a('0x10')]={};ami['on'](_0x770a('0x11'),this[_0x770a('0x12')][_0x770a('0x13')](this));ami['on'](_0x770a('0x14'),this[_0x770a('0x15')][_0x770a('0x13')](this));ami['on'](_0x770a('0x16'),this['syncNewState']['bind'](this));ami['on'](_0x770a('0x17'),this['syncNewExten'][_0x770a('0x13')](this));ami['on'](_0x770a('0x18'),this[_0x770a('0x19')][_0x770a('0x13')](this));ami['on'](_0x770a('0x1a'),this[_0x770a('0x1b')][_0x770a('0x13')](this));ami['on'](_0x770a('0x1c'),this['syncHangup']['bind'](this));ami['on'](_0x770a('0x1d'),this[_0x770a('0x1e')]['bind'](this));}Fax['prototype'][_0x770a('0x12')]=function(_0x3bf1f1){if(_0x3bf1f1['context']===_0x770a('0x1f')){for(var _0x342e01 in this[_0x770a('0xe')]){if(this[_0x770a('0xe')][_0x770a('0x20')](_0x342e01)){if(_0x3bf1f1[_0x770a('0x21')]===this[_0x770a('0xe')][_0x342e01]['localstationid']){this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]={};this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]][_0x770a('0x23')]=_0x3bf1f1[_0x770a('0x23')];this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]['id']=this['faxAccounts'][_0x342e01]['id'];this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]['name']=this['faxAccounts'][_0x342e01][_0x770a('0x24')];logger[_0x770a('0x25')](_0x3bf1f1[_0x770a('0x22')],_0x770a('0x26'));}}}}if(this[_0x770a('0x10')][_0x3bf1f1['uniqueid']]){this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]]={};this[_0x770a('0xd')][_0x3bf1f1[_0x770a('0x22')]][_0x770a('0x23')]=_0x3bf1f1[_0x770a('0x23')];logger['info'](_0x3bf1f1[_0x770a('0x22')],_0x770a('0x26'));}};Fax['prototype'][_0x770a('0x15')]=function(_0x388bed){if(this[_0x770a('0xd')][_0x388bed[_0x770a('0x22')]]){for(var _0x2f217a in _0x388bed[_0x770a('0x27')]){if(_0x388bed[_0x770a('0x27')]['hasOwnProperty'](_0x2f217a)){this[_0x770a('0xd')][_0x388bed['uniqueid']][_0x2f217a]=_0x388bed[_0x770a('0x28')];}}}};Fax[_0x770a('0x29')][_0x770a('0x2a')]=function(_0x5397cb){if(this[_0x770a('0xd')][_0x5397cb[_0x770a('0x22')]]){this['channels'][_0x5397cb[_0x770a('0x22')]][_0x770a('0x2b')]=_0x5397cb[_0x770a('0x2b')];this[_0x770a('0xd')][_0x5397cb[_0x770a('0x22')]][_0x770a('0x2c')]=_0x5397cb[_0x770a('0x2c')];}};Fax['prototype'][_0x770a('0x2d')]=function(_0x4344cb){if(this[_0x770a('0xd')][_0x4344cb[_0x770a('0x22')]]){for(var _0x1c54cc in _0x4344cb[_0x770a('0x27')]){if(_0x4344cb[_0x770a('0x27')][_0x770a('0x20')](_0x1c54cc)){this[_0x770a('0xd')][_0x4344cb['uniqueid']][_0x1c54cc]=_0x4344cb['value'];}}}};Fax[_0x770a('0x29')][_0x770a('0x19')]=function(_0x463ef7){if(this[_0x770a('0xd')][_0x463ef7[_0x770a('0x22')]]){this['channels'][_0x463ef7['uniqueid']][_0x770a('0x2e')]=_0x463ef7['operation'];this[_0x770a('0xd')][_0x463ef7[_0x770a('0x22')]][_0x770a('0x2f')]=_0x463ef7[_0x770a('0x2f')];this['channels'][_0x463ef7[_0x770a('0x22')]][_0x770a('0x30')]=_0x463ef7[_0x770a('0x30')];this[_0x770a('0xd')][_0x463ef7['uniqueid']][_0x770a('0x31')]=_0x463ef7['filename'];logger[_0x770a('0x25')](_0x463ef7[_0x770a('0x22')],_0x770a('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0x36774d){var _0x5854cf=this;if(this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]){var _0x20762e=this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]['id'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x33')]=_0x36774d['remotestationid'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x34')]=_0x36774d[_0x770a('0x34')];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x30')]=_0x36774d['localstationid'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x35')]=_0x36774d['resolution'];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x36')]=_0x36774d[_0x770a('0x36')];this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]][_0x770a('0x31')]=_0x36774d[_0x770a('0x31')];this['channels'][_0x36774d[_0x770a('0x22')]][_0x770a('0x37')]=_0x36774d[_0x770a('0x37')];if(this[_0x770a('0xd')][_0x36774d[_0x770a('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x36774d['filename'],_0x770a('0x38'),function(_0x1a677a){logger[_0x770a('0x25')](_0x36774d[_0x770a('0x22')],_0x770a('0x39'),_0x1a677a[_0x770a('0x3a')]);attachment['create']({'name':path['parse'](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')],'basename':path['parse'](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')]+'.pdf','type':_0x770a('0x3b')})[_0x770a('0x3c')](function(_0x3e9aa7){faxAccount[_0x770a('0x3d')](_0x20762e,{'from':_0x36774d['calleridnum'],'mapKey':_0x770a('0x7'),'body':path[_0x770a('0x3e')](_0x36774d[_0x770a('0x31')])[_0x770a('0x24')]+'.pdf','AttachmentId':_0x3e9aa7['id']})[_0x770a('0x3f')](function(_0x908c42){logger[_0x770a('0x40')](_0x36774d[_0x770a('0x22')],'\x20notify\x20',JSON[_0x770a('0x41')](_0x908c42));});})[_0x770a('0x3f')](function(_0x4e5a72){logger[_0x770a('0x40')](_0x36774d[_0x770a('0x22')],_0x770a('0x42'),JSON['stringify'](_0x4e5a72));});});}logger['info'](_0x36774d[_0x770a('0x22')],_0x770a('0x42'));}};Fax[_0x770a('0x29')][_0x770a('0x1e')]=function(_0x45d624){if(this[_0x770a('0x10')][_0x45d624[_0x770a('0x22')]]){_[_0x770a('0x43')](this[_0x770a('0xd')][_0x45d624[_0x770a('0x22')]],_[_0x770a('0x44')](_0x45d624,[_0x770a('0x45'),_0x770a('0x46')]));}};function updateStatus(_0x4e42d6){if(_0x4e42d6[_0x770a('0x47')]){faxMessage[_0x770a('0x48')](_0x4e42d6['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x770a('0x3c')](function(_0x19ca52){ut['logger'](_0x770a('0x49'),_0x19ca52);})[_0x770a('0x3f')](function(_0xf605da){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0xf605da);});}else{ut[_0x770a('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x770a('0x29')][_0x770a('0x4b')]=function(_0x14c0be,_0x721b77,_0x5e3168){var _0x4c88e0=this;var _0x59f7a3={};if(_0x721b77){_0x59f7a3={'read':_0x721b77};}else{_0x59f7a3={'failMessage':_0x5e3168};}if(this['actions'][_0x14c0be]['AttachmentId']){faxMessage[_0x770a('0x48')](this[_0x770a('0x10')][_0x14c0be]['AttachmentId'],_0x59f7a3)[_0x770a('0x3c')](function(_0x3855d5){ut['logger'](_0x770a('0x4c'),_0x3855d5);})[_0x770a('0x3f')](function(_0x157754){ut[_0x770a('0x4a')]('[Fax][Message][NoUpdate1]',_0x157754);})[_0x770a('0x4d')](function(){delete _0x4c88e0[_0x770a('0xd')][_0x14c0be];delete _0x4c88e0[_0x770a('0x10')][_0x14c0be];});}else{ut[_0x770a('0x4a')](_0x770a('0x4e'));delete this[_0x770a('0xd')][_0x14c0be];delete this[_0x770a('0x10')][_0x14c0be];}};Fax[_0x770a('0x29')]['syncHangup']=function(_0x1c6e5c){var _0x336a3b=this;if(this[_0x770a('0xd')][_0x1c6e5c['uniqueid']]){if(this['actions'][_0x1c6e5c[_0x770a('0x22')]]){this['channels'][_0x1c6e5c[_0x770a('0x22')]]['id']=this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]['id'];this['channels'][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x24')]=this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x24')];}logger['info'](_0x1c6e5c[_0x770a('0x22')],this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]?_0x770a('0x4f'):_0x770a('0x50'),JSON[_0x770a('0x41')](this[_0x770a('0xd')][_0x1c6e5c[_0x770a('0x22')]]));if(this[_0x770a('0x10')][_0x1c6e5c[_0x770a('0x22')]]){if(this['channels'][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x51')]>0x0&&this['channels'][_0x1c6e5c[_0x770a('0x22')]]['faxstatus']===_0x770a('0x52')){this['updateStatus'](_0x1c6e5c[_0x770a('0x22')],!![]);}else{this[_0x770a('0x4b')](_0x1c6e5c[_0x770a('0x22')],![],this['channels'][_0x1c6e5c['uniqueid']][_0x770a('0x53')]?_0x770a('0x54')+this[_0x770a('0xd')][_0x1c6e5c[_0x770a('0x22')]][_0x770a('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x770a('0x29')][_0x770a('0x55')]=function(_0x595626){var _0x529292=this;return new BPromise(function(_0x231c1,_0x519b4c){_0x529292['execOriginate'](_0x595626,_0x529292[_0x770a('0xe')][_0x595626[_0x770a('0x56')]])[_0x770a('0x3c')](function(_0x1c3569){ut[_0x770a('0x4a')](_0x770a('0x57'),_0x1c3569);_0x231c1(ut[_0x770a('0x3a')](_0x770a('0x58')));})[_0x770a('0x3f')](function(_0x3bef19){ut['logger']('[Fax][execOriginate][failure]',_0x3bef19);updateStatus(_0x595626);_0x519b4c(ut[_0x770a('0x3a')](_0x770a('0x59')));});});};Fax[_0x770a('0x29')][_0x770a('0x5a')]=function(_0x37ee03){var _0x247c5a=this;return new BPromise(function(_0x5e0377,_0x31ed7b){var _0x1c6833=_0x247c5a[_0x770a('0x5b')](_0x247c5a[_0x770a('0xe')][_0x37ee03['FaxAccountId']][_0x770a('0x5c')],_0x37ee03);if(_0x1c6833[_0x770a('0x5d')]){_0x5e0377(ut[_0x770a('0x3a')](_0x770a('0x5e')));}else{_0x31ed7b(ut[_0x770a('0x3a')](_0x1c6833[_0x770a('0x3a')]));}});};function originate(_0x5b57dd,_0x1725df,_0x157d17){return new BPromise(function(_0x1897ac,_0x4150c6){if(_0x157d17){var _0x709b8e=util[_0x770a('0x5f')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x770a('0x3e')](_0x5b57dd[_0x770a('0x3')])[_0x770a('0x24')],_0x5b57dd[_0x770a('0x3')]);gs[_0x770a('0x60')](_0x709b8e)[_0x770a('0x3c')](function(){_0x5b57dd[_0x770a('0x3')]=util[_0x770a('0x5f')](_0x770a('0x61'),path['parse'](_0x5b57dd[_0x770a('0x3')])['dir'],path[_0x770a('0x3e')](_0x5b57dd[_0x770a('0x3')])['name']);_0x1725df[_0x770a('0x62')]=_0x5b57dd[_0x770a('0x3')];ut[_0x770a('0x4a')](_0x770a('0x63'),'');ami['Action'](ut[_0x770a('0x64')](_0x5b57dd,_0x1725df))['then'](function(_0x21abbe){_0x1897ac(_0x21abbe);})[_0x770a('0x3f')](function(_0x41b332){_0x4150c6(_0x41b332);});})[_0x770a('0x3f')](function(_0xb8c8d8){_0x4150c6(_0xb8c8d8);});}else{ami[_0x770a('0x65')](ut['variablesAction'](_0x5b57dd,_0x1725df))[_0x770a('0x3c')](function(_0x1c8cbb){_0x1897ac(_0x1c8cbb);})[_0x770a('0x3f')](function(_0x1fd348){_0x4150c6(_0x1fd348);});}});}Fax['prototype'][_0x770a('0x66')]=function(_0x25b2f5,_0x525f0c){var _0x89a70a=this;return new BPromise(function(_0x2fdb6a,_0x553682){var _0x277123=uuid['v4']();var _0x1fa743=ut[_0x770a('0x67')](_0x25b2f5,_0x525f0c);_0x89a70a['actions'][_0x277123]=new Action(_0x277123,_0x525f0c,_0x25b2f5);var _0x25a342=_0x89a70a[_0x770a('0x10')][_0x277123];if(path[_0x770a('0x3e')](_0x25b2f5[_0x770a('0x3')])[_0x770a('0x68')]===_0x770a('0x69')){originate(_0x25a342,_0x1fa743,!![])[_0x770a('0x3c')](function(_0x2e8807){_0x2fdb6a(_0x2e8807);})[_0x770a('0x3f')](function(_0x3489bf){_0x553682(_0x3489bf);});}else{originate(_0x25a342,_0x1fa743,![])[_0x770a('0x3c')](function(_0x30c506){_0x2fdb6a(_0x30c506);})[_0x770a('0x3f')](function(_0x1e147b){_0x553682(_0x1e147b);});}});};Fax[_0x770a('0x29')][_0x770a('0x6a')]=function(_0x408c79){return!_['isNil'](_0x408c79)&&!_[_0x770a('0x6b')](_0x408c79[_0x770a('0x24')])&&!_['isNil'](_0x408c79[_0x770a('0x6c')])&&_0x408c79[_0x770a('0x6c')]&&!_['isNil'](this['trunks'][util[_0x770a('0x5f')]('SIP/%s',_0x408c79[_0x770a('0x24')])])&&!_[_0x770a('0x6b')](this[_0x770a('0xf')][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')])&&(this[_0x770a('0xf')][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')]==='reachable'||this['trunks'][util[_0x770a('0x5f')](_0x770a('0x6d'),_0x408c79[_0x770a('0x24')])][_0x770a('0x2f')]===_0x770a('0x6e'));};Fax[_0x770a('0x29')][_0x770a('0x5b')]=function(_0x43697e,_0xfddb0){if(!this[_0x770a('0x6a')](_0x43697e)){ut[_0x770a('0x4a')](_0x770a('0x6f'),_['isNil'](_0x43697e)?'':_0x43697e['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x770a('0x70')};}if(_['isNil'](_0xfddb0[_0x770a('0x7')])){ut[_0x770a('0x4a')](_0x770a('0x71'),JSON[_0x770a('0x41')](_0xfddb0));return{'isValid':![],'message':_0x770a('0x72')};}if(_[_0x770a('0x6b')](_0xfddb0[_0x770a('0x3')])){ut[_0x770a('0x4a')](_0x770a('0x73'),JSON[_0x770a('0x41')](_0xfddb0));return{'isValid':![],'message':_0x770a('0x74')};}return{'isValid':!![],'message':_0x770a('0x75')};};module[_0x770a('0x76')]=Fax;
\ No newline at end of file
+var _0xfea8=['Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','bluebird','uuid','moment','../../../config/logger','fax','../ami','./rpcDb','./action','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','then','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','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','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif'];(function(_0x2c623c,_0x88beb2){var _0x1ce589=function(_0x775fc3){while(--_0x775fc3){_0x2c623c['push'](_0x2c623c['shift']());}};_0x1ce589(++_0x88beb2);}(_0xfea8,0xfd));var _0x8fea=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0xfea8[_0x2642cb];return _0xe6e41;};'use strict';var util=require(_0x8fea('0x0'));var _=require(_0x8fea('0x1'));var BPromise=require(_0x8fea('0x2'));var uuid=require(_0x8fea('0x3'));var moment=require(_0x8fea('0x4'));var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x8fea('0x5'))(_0x8fea('0x6'));var ami=require(_0x8fea('0x7'));var rpcDb=require(_0x8fea('0x8'));var Channel=require('./channel');var ut=require('./util/util');var Action=require(_0x8fea('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x8fea('0xa'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x318cf0){this[_0x8fea('0xb')]={};this[_0x8fea('0xc')]=_0x318cf0[_0x8fea('0xc')];this[_0x8fea('0xd')]=_0x318cf0[_0x8fea('0xd')];this[_0x8fea('0xe')]={};ami['on'](_0x8fea('0xf'),this[_0x8fea('0x10')][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x12'),this[_0x8fea('0x13')]['bind'](this));ami['on']('newstate',this[_0x8fea('0x14')][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x15'),this[_0x8fea('0x16')][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x17'),this['syncFaxStatus'][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x18'),this['syncReceiveFax'][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x19'),this[_0x8fea('0x1a')][_0x8fea('0x11')](this));ami['on'](_0x8fea('0x1b'),this[_0x8fea('0x1c')][_0x8fea('0x11')](this));}Fax['prototype']['syncNewchannel']=function(_0x18d06b){if(_0x18d06b[_0x8fea('0x1d')]===_0x8fea('0x1e')){for(var _0x477020 in this['faxAccounts']){if(this['faxAccounts'][_0x8fea('0x1f')](_0x477020)){if(_0x18d06b[_0x8fea('0x20')]===this[_0x8fea('0xc')][_0x477020][_0x8fea('0x21')]){this['channels'][_0x18d06b['uniqueid']]={};this[_0x8fea('0xb')][_0x18d06b[_0x8fea('0x22')]]['channel']=_0x18d06b[_0x8fea('0x23')];this['channels'][_0x18d06b[_0x8fea('0x22')]]['id']=this[_0x8fea('0xc')][_0x477020]['id'];this[_0x8fea('0xb')][_0x18d06b[_0x8fea('0x22')]][_0x8fea('0x24')]=this['faxAccounts'][_0x477020][_0x8fea('0x24')];logger[_0x8fea('0x25')](_0x18d06b[_0x8fea('0x22')],_0x8fea('0x26'));}}}}if(this[_0x8fea('0xe')][_0x18d06b[_0x8fea('0x22')]]){this[_0x8fea('0xb')][_0x18d06b['uniqueid']]={};this[_0x8fea('0xb')][_0x18d06b[_0x8fea('0x22')]]['channel']=_0x18d06b[_0x8fea('0x23')];logger[_0x8fea('0x25')](_0x18d06b[_0x8fea('0x22')],_0x8fea('0x26'));}};Fax[_0x8fea('0x27')][_0x8fea('0x13')]=function(_0x22d66a){if(this[_0x8fea('0xb')][_0x22d66a[_0x8fea('0x22')]]){for(var _0x19caef in _0x22d66a[_0x8fea('0x28')]){if(_0x22d66a['variable'][_0x8fea('0x1f')](_0x19caef)){this['channels'][_0x22d66a[_0x8fea('0x22')]][_0x19caef]=_0x22d66a[_0x8fea('0x29')];}}}};Fax[_0x8fea('0x27')][_0x8fea('0x14')]=function(_0x1f7ebb){if(this['channels'][_0x1f7ebb[_0x8fea('0x22')]]){this['channels'][_0x1f7ebb['uniqueid']][_0x8fea('0x2a')]=_0x1f7ebb[_0x8fea('0x2a')];this[_0x8fea('0xb')][_0x1f7ebb[_0x8fea('0x22')]][_0x8fea('0x2b')]=_0x1f7ebb[_0x8fea('0x2b')];}};Fax[_0x8fea('0x27')][_0x8fea('0x16')]=function(_0x9c00cf){if(this[_0x8fea('0xb')][_0x9c00cf[_0x8fea('0x22')]]){for(var _0x480199 in _0x9c00cf[_0x8fea('0x28')]){if(_0x9c00cf[_0x8fea('0x28')]['hasOwnProperty'](_0x480199)){this[_0x8fea('0xb')][_0x9c00cf[_0x8fea('0x22')]][_0x480199]=_0x9c00cf['value'];}}}};Fax['prototype'][_0x8fea('0x2c')]=function(_0x32da1d){if(this[_0x8fea('0xb')][_0x32da1d['uniqueid']]){this[_0x8fea('0xb')][_0x32da1d[_0x8fea('0x22')]]['operation']=_0x32da1d[_0x8fea('0x2d')];this[_0x8fea('0xb')][_0x32da1d['uniqueid']][_0x8fea('0x2e')]=_0x32da1d[_0x8fea('0x2e')];this[_0x8fea('0xb')][_0x32da1d[_0x8fea('0x22')]][_0x8fea('0x21')]=_0x32da1d[_0x8fea('0x21')];this[_0x8fea('0xb')][_0x32da1d[_0x8fea('0x22')]][_0x8fea('0x2f')]=_0x32da1d[_0x8fea('0x2f')];logger[_0x8fea('0x25')](_0x32da1d['uniqueid'],_0x8fea('0x30'));}};Fax[_0x8fea('0x27')]['syncReceiveFax']=function(_0x532c0d){var _0x47acb3=this;if(this['channels'][_0x532c0d['uniqueid']]){var _0x569eec=this[_0x8fea('0xb')][_0x532c0d[_0x8fea('0x22')]]['id'];this[_0x8fea('0xb')][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x31')]=_0x532c0d['remotestationid'];this[_0x8fea('0xb')][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x32')]=_0x532c0d[_0x8fea('0x32')];this['channels'][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x21')]=_0x532c0d[_0x8fea('0x21')];this['channels'][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x33')]=_0x532c0d[_0x8fea('0x33')];this[_0x8fea('0xb')][_0x532c0d['uniqueid']]['transferrate']=_0x532c0d[_0x8fea('0x34')];this[_0x8fea('0xb')][_0x532c0d['uniqueid']]['filename']=_0x532c0d['filename'];this[_0x8fea('0xb')][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x35')]=_0x532c0d[_0x8fea('0x35')];if(this['channels'][_0x532c0d[_0x8fea('0x22')]][_0x8fea('0x32')]>0x0){tiff2pdf(_0x532c0d[_0x8fea('0x2f')],_0x8fea('0x36'),function(_0x2512c4){logger['info'](_0x532c0d['uniqueid'],_0x8fea('0x37'),_0x2512c4['message']);attachment[_0x8fea('0x38')]({'name':path['parse'](_0x532c0d[_0x8fea('0x2f')])[_0x8fea('0x24')],'basename':path[_0x8fea('0x39')](_0x532c0d[_0x8fea('0x2f')])['name']+_0x8fea('0x3a'),'type':'application/pdf'})['then'](function(_0x284706){faxAccount[_0x8fea('0x3b')](_0x569eec,{'from':_0x532c0d[_0x8fea('0x35')],'mapKey':_0x8fea('0x6'),'body':path['parse'](_0x532c0d[_0x8fea('0x2f')])[_0x8fea('0x24')]+_0x8fea('0x3a'),'AttachmentId':_0x284706['id']})[_0x8fea('0x3c')](function(_0xc7fc3b){logger[_0x8fea('0x3d')](_0x532c0d['uniqueid'],_0x8fea('0x3e'),JSON['stringify'](_0xc7fc3b));});})['catch'](function(_0x1ada79){logger[_0x8fea('0x3d')](_0x532c0d[_0x8fea('0x22')],'\x20receiveFax\x20',JSON[_0x8fea('0x3f')](_0x1ada79));});});}logger['info'](_0x532c0d['uniqueid'],_0x8fea('0x40'));}};Fax[_0x8fea('0x27')][_0x8fea('0x1c')]=function(_0x5b440c){if(this[_0x8fea('0xe')][_0x5b440c[_0x8fea('0x22')]]){_[_0x8fea('0x41')](this[_0x8fea('0xb')][_0x5b440c[_0x8fea('0x22')]],_['pick'](_0x5b440c,[_0x8fea('0x42'),_0x8fea('0x43')]));}};function updateStatus(_0x41ec51){if(_0x41ec51[_0x8fea('0x44')]){faxMessage[_0x8fea('0x45')](_0x41ec51[_0x8fea('0x44')],{'failMessage':_0x8fea('0x46')})['then'](function(_0x124067){ut[_0x8fea('0x47')]('[Fax][Message][Error][Updated]',_0x124067);})[_0x8fea('0x3c')](function(_0x82a6e){ut[_0x8fea('0x47')](_0x8fea('0x48'),_0x82a6e);});}else{ut[_0x8fea('0x47')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x8fea('0x27')]['updateStatus']=function(_0xde546b,_0x59c094,_0x14d5ac){var _0x36c0c3=this;var _0xc538d4={};if(_0x59c094){_0xc538d4={'read':_0x59c094};}else{_0xc538d4={'failMessage':_0x14d5ac};}if(this[_0x8fea('0xe')][_0xde546b][_0x8fea('0x44')]){faxMessage[_0x8fea('0x45')](this['actions'][_0xde546b][_0x8fea('0x44')],_0xc538d4)['then'](function(_0x3d9e6c){ut[_0x8fea('0x47')]('[Fax][Message][Updated]',_0x3d9e6c);})[_0x8fea('0x3c')](function(_0x55c5dd){ut[_0x8fea('0x47')](_0x8fea('0x49'),_0x55c5dd);})['finally'](function(){delete _0x36c0c3[_0x8fea('0xb')][_0xde546b];delete _0x36c0c3[_0x8fea('0xe')][_0xde546b];});}else{ut[_0x8fea('0x47')](_0x8fea('0x4a'));delete this['channels'][_0xde546b];delete this[_0x8fea('0xe')][_0xde546b];}};Fax['prototype'][_0x8fea('0x1a')]=function(_0x4e4c9c){var _0x54030f=this;if(this['channels'][_0x4e4c9c[_0x8fea('0x22')]]){if(this[_0x8fea('0xe')][_0x4e4c9c[_0x8fea('0x22')]]){this[_0x8fea('0xb')][_0x4e4c9c[_0x8fea('0x22')]]['id']=this['actions'][_0x4e4c9c['uniqueid']]['id'];this[_0x8fea('0xb')][_0x4e4c9c[_0x8fea('0x22')]][_0x8fea('0x24')]=this['actions'][_0x4e4c9c[_0x8fea('0x22')]]['name'];}logger[_0x8fea('0x25')](_0x4e4c9c[_0x8fea('0x22')],this[_0x8fea('0xe')][_0x4e4c9c[_0x8fea('0x22')]]?_0x8fea('0x4b'):_0x8fea('0x4c'),JSON[_0x8fea('0x3f')](this['channels'][_0x4e4c9c[_0x8fea('0x22')]]));if(this[_0x8fea('0xe')][_0x4e4c9c[_0x8fea('0x22')]]){if(this[_0x8fea('0xb')][_0x4e4c9c['uniqueid']][_0x8fea('0x4d')]>0x0&&this[_0x8fea('0xb')][_0x4e4c9c[_0x8fea('0x22')]][_0x8fea('0x17')]===_0x8fea('0x4e')){this[_0x8fea('0x4f')](_0x4e4c9c['uniqueid'],!![]);}else{this[_0x8fea('0x4f')](_0x4e4c9c[_0x8fea('0x22')],![],this['channels'][_0x4e4c9c[_0x8fea('0x22')]]['faxstatusstring']?_0x8fea('0x50')+this[_0x8fea('0xb')][_0x4e4c9c[_0x8fea('0x22')]][_0x8fea('0x51')]:'SENDING\x20FAILED');}}}};Fax[_0x8fea('0x27')]['send']=function(_0xdb521c){var _0x51d234=this;return new BPromise(function(_0x27a793,_0x2840a1){_0x51d234['execOriginate'](_0xdb521c,_0x51d234[_0x8fea('0xc')][_0xdb521c['FaxAccountId']])[_0x8fea('0x52')](function(_0x3ecc4e){ut[_0x8fea('0x47')](_0x8fea('0x53'),_0x3ecc4e);_0x27a793(ut[_0x8fea('0x54')](_0x8fea('0x55')));})[_0x8fea('0x3c')](function(_0x4585a0){ut[_0x8fea('0x47')](_0x8fea('0x56'),_0x4585a0);updateStatus(_0xdb521c);_0x2840a1(ut[_0x8fea('0x54')](_0x8fea('0x57')));});});};Fax[_0x8fea('0x27')][_0x8fea('0x58')]=function(_0x47a217){var _0x57a032=this;return new BPromise(function(_0x21f778,_0x386e6b){var _0x5c528d=_0x57a032[_0x8fea('0x59')](_0x57a032[_0x8fea('0xc')][_0x47a217['FaxAccountId']][_0x8fea('0x5a')],_0x47a217);if(_0x5c528d[_0x8fea('0x5b')]){_0x21f778(ut[_0x8fea('0x54')](_0x8fea('0x5c')));}else{_0x386e6b(ut[_0x8fea('0x54')](_0x5c528d[_0x8fea('0x54')]));}});};function originate(_0x189aeb,_0x457fc0,_0x3eb023){return new BPromise(function(_0x49cc36,_0x246bb5){if(_0x3eb023){var _0x5d03ef=util[_0x8fea('0x5d')](_0x8fea('0x5e'),path[_0x8fea('0x39')](_0x189aeb[_0x8fea('0x5f')])[_0x8fea('0x24')],_0x189aeb[_0x8fea('0x5f')]);gs[_0x8fea('0x60')](_0x5d03ef)[_0x8fea('0x52')](function(){_0x189aeb[_0x8fea('0x5f')]=util[_0x8fea('0x5d')](_0x8fea('0x61'),path['parse'](_0x189aeb[_0x8fea('0x5f')])[_0x8fea('0x62')],path[_0x8fea('0x39')](_0x189aeb['path'])[_0x8fea('0x24')]);_0x457fc0[_0x8fea('0x63')]=_0x189aeb[_0x8fea('0x5f')];ut[_0x8fea('0x47')](_0x8fea('0x64'),'');ami[_0x8fea('0x65')](ut[_0x8fea('0x66')](_0x189aeb,_0x457fc0))[_0x8fea('0x52')](function(_0x35db5f){_0x49cc36(_0x35db5f);})[_0x8fea('0x3c')](function(_0x5b8d53){_0x246bb5(_0x5b8d53);});})[_0x8fea('0x3c')](function(_0x4f7f91){_0x246bb5(_0x4f7f91);});}else{ami[_0x8fea('0x65')](ut['variablesAction'](_0x189aeb,_0x457fc0))[_0x8fea('0x52')](function(_0x25905d){_0x49cc36(_0x25905d);})[_0x8fea('0x3c')](function(_0x2ce5a1){_0x246bb5(_0x2ce5a1);});}});}Fax['prototype'][_0x8fea('0x67')]=function(_0x358b88,_0x1a44d1){var _0x30b0ab=this;return new BPromise(function(_0x3f57a2,_0x36a1ee){var _0x4fccb6=uuid['v4']();var _0x2182ab=ut[_0x8fea('0x68')](_0x358b88,_0x1a44d1);_0x30b0ab[_0x8fea('0xe')][_0x4fccb6]=new Action(_0x4fccb6,_0x1a44d1,_0x358b88);var _0x458b04=_0x30b0ab[_0x8fea('0xe')][_0x4fccb6];if(path['parse'](_0x358b88[_0x8fea('0x5f')])[_0x8fea('0x69')]===_0x8fea('0x3a')){originate(_0x458b04,_0x2182ab,!![])['then'](function(_0x7035b7){_0x3f57a2(_0x7035b7);})[_0x8fea('0x3c')](function(_0x4ece42){_0x36a1ee(_0x4ece42);});}else{originate(_0x458b04,_0x2182ab,![])[_0x8fea('0x52')](function(_0x1b9cd1){_0x3f57a2(_0x1b9cd1);})[_0x8fea('0x3c')](function(_0x1b30b5){_0x36a1ee(_0x1b30b5);});}});};Fax[_0x8fea('0x27')][_0x8fea('0x6a')]=function(_0x3b27d3){return!_[_0x8fea('0x6b')](_0x3b27d3)&&!_[_0x8fea('0x6b')](_0x3b27d3[_0x8fea('0x24')])&&!_[_0x8fea('0x6b')](_0x3b27d3[_0x8fea('0x6c')])&&_0x3b27d3[_0x8fea('0x6c')]&&!_[_0x8fea('0x6b')](this[_0x8fea('0xd')][util[_0x8fea('0x5d')]('SIP/%s',_0x3b27d3[_0x8fea('0x24')])])&&!_[_0x8fea('0x6b')](this[_0x8fea('0xd')][util[_0x8fea('0x5d')](_0x8fea('0x6d'),_0x3b27d3['name'])]['status'])&&(this['trunks'][util['format'](_0x8fea('0x6d'),_0x3b27d3[_0x8fea('0x24')])]['status']===_0x8fea('0x6e')||this[_0x8fea('0xd')][util[_0x8fea('0x5d')](_0x8fea('0x6d'),_0x3b27d3[_0x8fea('0x24')])][_0x8fea('0x2e')]==='unmonitored');};Fax[_0x8fea('0x27')][_0x8fea('0x59')]=function(_0x239e99,_0x16c877){if(!this[_0x8fea('0x6a')](_0x239e99)){ut[_0x8fea('0x47')](_0x8fea('0x6f'),_['isNil'](_0x239e99)?'':_0x239e99[_0x8fea('0x24')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x8fea('0x70')};}if(_[_0x8fea('0x6b')](_0x16c877[_0x8fea('0x6')])){ut[_0x8fea('0x47')](_0x8fea('0x71'),JSON[_0x8fea('0x3f')](_0x16c877));return{'isValid':![],'message':_0x8fea('0x72')};}if(_['isNil'](_0x16c877[_0x8fea('0x5f')])){ut['logger'](_0x8fea('0x73'),JSON[_0x8fea('0x3f')](_0x16c877));return{'isValid':![],'message':_0x8fea('0x74')};}return{'isValid':!![],'message':_0x8fea('0x75')};};module['exports']=Fax;
\ No newline at end of file
index 66bdd18..9b59098 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa67c=['bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','notify','resolve','then','util'];(function(_0x4b2571,_0x20d8f3){var _0x2c571c=function(_0x51029c){while(--_0x51029c){_0x4b2571['push'](_0x4b2571['shift']());}};_0x2c571c(++_0x20d8f3);}(_0xa67c,0x11f));var _0xca67=function(_0x5e43e8,_0x336881){_0x5e43e8=_0x5e43e8-0x0;var _0x139dfa=_0xa67c[_0x5e43e8];return _0x139dfa;};'use strict';var util=require(_0xca67('0x0'));var BPromise=require(_0xca67('0x1'));var logger=require(_0xca67('0x2'))('preview');var _=require(_0xca67('0x3'));var faxAccount=require(_0xca67('0x4'));function loggerCatch(_0x51f781){return function(_0x8808b8){logger[_0xca67('0x5')](_0x51f781,util['inspect'](_0x8808b8,{'showHidden':![],'depth':null}));};}exports[_0xca67('0x6')]=function(_0x368d3b,_0x33a1ae){return BPromise[_0xca67('0x7')]()[_0xca67('0x8')](faxAccount[_0xca67('0x6')](_0x368d3b,_0x33a1ae))['catch'](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x82bc=['../rpc/faxAccount','error','inspect','notify','resolve','[Notify]\x20','util','bluebird','lodash'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x82bc,0xd5));var _0xc82b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x82bc[_0x40a045];return _0x1a687c;};'use strict';var util=require(_0xc82b('0x0'));var BPromise=require(_0xc82b('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0xc82b('0x2'));var faxAccount=require(_0xc82b('0x3'));function loggerCatch(_0x2b6901){return function(_0x68c85c){logger[_0xc82b('0x4')](_0x2b6901,util[_0xc82b('0x5')](_0x68c85c,{'showHidden':![],'depth':null}));};}exports[_0xc82b('0x6')]=function(_0x2e389e,_0x5e001c){return BPromise[_0xc82b('0x7')]()['then'](faxAccount['notify'](_0x2e389e,_0x5e001c))['catch'](loggerCatch(_0xc82b('0x8')));};
\ No newline at end of file
index f5cbead..f35bc4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0dd=['util','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0dd,0xb8));var _0xdc0d=function(_0x3a05dd,_0x3d7b00){_0x3a05dd=_0x3a05dd-0x0;var _0x3beb75=_0xc0dd[_0x3a05dd];return _0x3beb75;};'use strict';var util=require(_0xdc0d('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0xdc0d('0x1'));var exec=require('child_process')[_0xdc0d('0x2')];exports[_0xdc0d('0x3')]=function(_0xeba1da){return new BPromise(function(_0x407115,_0x46f223){exec(_0xeba1da,function(_0x5c9708,_0x53ce88,_0x285e7f){logger[_0xdc0d('0x4')](_0xdc0d('0x5'),_0x53ce88);if(_0x5c9708){logger['info'](_0xdc0d('0x5'),_0xdc0d('0x6'),util[_0xdc0d('0x7')](_0x5c9708,{'showHidden':![],'depth':null}),_0x53ce88,_0x285e7f);_0x46f223(_0x5c9708);}_0x407115(_0x53ce88);});});};
\ No newline at end of file
+var _0x81ee=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x9de53,_0x138596){var _0x3c2de4=function(_0x36853d){while(--_0x36853d){_0x9de53['push'](_0x9de53['shift']());}};_0x3c2de4(++_0x138596);}(_0x81ee,0xd6));var _0xe81e=function(_0xf69263,_0x5c0cef){_0xf69263=_0xf69263-0x0;var _0x88b4d0=_0x81ee[_0xf69263];return _0x88b4d0;};'use strict';var util=require(_0xe81e('0x0'));var logger=require(_0xe81e('0x1'))(_0xe81e('0x2'));var BPromise=require(_0xe81e('0x3'));var exec=require(_0xe81e('0x4'))[_0xe81e('0x5')];exports[_0xe81e('0x6')]=function(_0x2eceb6){return new BPromise(function(_0x291f5c,_0x4eae71){exec(_0x2eceb6,function(_0x469f3c,_0x423f34,_0x58f303){logger[_0xe81e('0x7')](_0xe81e('0x8'),_0x423f34);if(_0x469f3c){logger[_0xe81e('0x7')](_0xe81e('0x8'),_0xe81e('0x9'),util[_0xe81e('0xa')](_0x469f3c,{'showHidden':![],'depth':null}),_0x423f34,_0x58f303);_0x4eae71(_0x469f3c);}_0x291f5c(_0x423f34);});});};
\ No newline at end of file
index c9b3471..d0bbb10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ca2=['maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','headerinfo'];(function(_0x174c68,_0x23e307){var _0x440378=function(_0x20e4e9){while(--_0x20e4e9){_0x174c68['push'](_0x174c68['shift']());}};_0x440378(++_0x23e307);}(_0x7ca2,0xdd));var _0x27ca=function(_0x4609b7,_0x5e5c19){_0x4609b7=_0x4609b7-0x0;var _0x3f4757=_0x7ca2[_0x4609b7];return _0x3f4757;};'use strict';var util=require(_0x27ca('0x0'));var _=require(_0x27ca('0x1'));var moment=require(_0x27ca('0x2'));var logger=require(_0x27ca('0x3'))(_0x27ca('0x4'));exports[_0x27ca('0x5')]=function(_0x1a0a1e){return{'message':_0x1a0a1e};};exports['logger']=function(_0x26bbca,_0x1c5098){logger[_0x27ca('0x6')](_0x26bbca,util[_0x27ca('0x7')](_0x1c5098,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x291384,_0x56760e){var _0x33b78c={'XMF-ECM':_0x56760e['ecm'],'XMF-HEADERINFO':_0x56760e[_0x27ca('0x8')],'XMF-MINRATE':_0x56760e['minrate'],'XMF-MAXRATE':_0x56760e[_0x27ca('0x9')],'XMF-MODEM':util[_0x27ca('0xa')](_0x27ca('0xb'),_0x56760e['modem']),'XMF-GATEWAY':_0x56760e[_0x27ca('0xc')],'XMF-FAXDETECT':_0x56760e[_0x27ca('0xd')],'XMF-T38TIMEOUT':_0x56760e[_0x27ca('0xe')],'XMF-LOCALSTATIONID':_0x56760e[_0x27ca('0xf')],'XMF-PATH':_0x291384[_0x27ca('0x10')]};return _0x33b78c;};exports[_0x27ca('0x11')]=function(_0x4ffbcb,_0x1963f5){return{'actionid':_0x4ffbcb['uniqueid'],'action':_0x27ca('0x12'),'channel':_0x4ffbcb[_0x27ca('0x13')],'Exten':_0x27ca('0x14'),'Context':'from-sip','Priority':'1','callerid':util[_0x27ca('0xa')](_0x27ca('0x15'),_0x4ffbcb[_0x27ca('0x8')]?_0x4ffbcb['headerinfo']:'',_0x4ffbcb[_0x27ca('0xf')]),'variable':_0x1963f5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4ffbcb[_0x27ca('0x16')]};};
\ No newline at end of file
+var _0x4ae8=['variablesAction','uniqueid','originate','from-sip','format','localstationid','util','lodash','moment','../../../../config/logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','\x22%s\x22','modem','gateway','faxdetect'];(function(_0x51a72e,_0x16015f){var _0x3bc4f6=function(_0x36417e){while(--_0x36417e){_0x51a72e['push'](_0x51a72e['shift']());}};_0x3bc4f6(++_0x16015f);}(_0x4ae8,0x16b));var _0x84ae=function(_0x295ece,_0x55ed2d){_0x295ece=_0x295ece-0x0;var _0x47a60e=_0x4ae8[_0x295ece];return _0x47a60e;};'use strict';var util=require(_0x84ae('0x0'));var _=require(_0x84ae('0x1'));var moment=require(_0x84ae('0x2'));var logger=require(_0x84ae('0x3'))('fax');exports['message']=function(_0x10bfdb){return{'message':_0x10bfdb};};exports['logger']=function(_0x1450b2,_0x361078){logger[_0x84ae('0x4')](_0x1450b2,util[_0x84ae('0x5')](_0x361078,{'showHidden':![],'depth':null}));};exports[_0x84ae('0x6')]=function(_0x1d49a4,_0x5c98cf){var _0x34f927={'XMF-ECM':_0x5c98cf[_0x84ae('0x7')],'XMF-HEADERINFO':_0x5c98cf[_0x84ae('0x8')],'XMF-MINRATE':_0x5c98cf[_0x84ae('0x9')],'XMF-MAXRATE':_0x5c98cf[_0x84ae('0xa')],'XMF-MODEM':util['format'](_0x84ae('0xb'),_0x5c98cf[_0x84ae('0xc')]),'XMF-GATEWAY':_0x5c98cf[_0x84ae('0xd')],'XMF-FAXDETECT':_0x5c98cf[_0x84ae('0xe')],'XMF-T38TIMEOUT':_0x5c98cf['t38timeout'],'XMF-LOCALSTATIONID':_0x5c98cf['localstationid'],'XMF-PATH':_0x1d49a4['path']};return _0x34f927;};exports[_0x84ae('0xf')]=function(_0x3e5dbe,_0x599cd8){return{'actionid':_0x3e5dbe[_0x84ae('0x10')],'action':_0x84ae('0x11'),'channel':_0x3e5dbe['channel'],'Exten':'xcally-motion-fax','Context':_0x84ae('0x12'),'Priority':'1','callerid':util[_0x84ae('0x13')]('\x22%s\x22\x20<%s>',_0x3e5dbe[_0x84ae('0x8')]?_0x3e5dbe[_0x84ae('0x8')]:'',_0x3e5dbe[_0x84ae('0x14')]),'variable':_0x599cd8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3e5dbe[_0x84ae('0x10')]};};
\ No newline at end of file
index 41a4fd1..3e5c2f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd780=['getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','hour','get','resolve','getAgents','initAgents','getTelephones','then','initTelephones','initTrunks','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','initFreshsalesAccounts'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0xd780,0x1d2));var _0x0d78=function(_0x4ad861,_0x12cc40){_0x4ad861=_0x4ad861-0x0;var _0x3ff01f=_0xd780[_0x4ad861];return _0x3ff01f;};'use strict';var BPromise=require('bluebird');var util=require('util');var moment=require('moment');var server=require(_0x0d78('0x0'));var Realtime=require(_0x0d78('0x1'));var Report=require('./report');var Acw=require(_0x0d78('0x2'));var Trigger=require(_0x0d78('0x3'));var Dialer=require(_0x0d78('0x4'));var Preview=require(_0x0d78('0x5'));var Fax=require(_0x0d78('0x6'));var user=require(_0x0d78('0x7'));var voiceQueue=require(_0x0d78('0x8'));var voiceQueueReport=require(_0x0d78('0x9'));var voiceCallReport=require(_0x0d78('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x0d78('0xb'));var template=require(_0x0d78('0xc'));var cmHopperHistory=require(_0x0d78('0xd'));var campaign=require(_0x0d78('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x0d78('0xf'));var zendesk=require(_0x0d78('0x10'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x0d78('0x11'));var freshdesk=require(_0x0d78('0x12'));var desk=require(_0x0d78('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x0d78('0x14'));var freshsales=require(_0x0d78('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x0d78('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x0d78('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0d78('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0d78('0x19')]()['then'](user[_0x0d78('0x1a')]())['then'](realtime[_0x0d78('0x1b')]())['then'](user[_0x0d78('0x1c')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x1e')]())[_0x0d78('0x1d')](trunk['getTrunks']())['then'](realtime[_0x0d78('0x1f')]())[_0x0d78('0x1d')](voiceQueue['getVoiceQueues']())[_0x0d78('0x1d')](realtime[_0x0d78('0x20')]())[_0x0d78('0x1d')](trigger[_0x0d78('0x21')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x22')]())[_0x0d78('0x1d')](template['getTemplates']())[_0x0d78('0x1d')](realtime[_0x0d78('0x23')]())[_0x0d78('0x1d')](zendesk[_0x0d78('0x24')]())[_0x0d78('0x1d')](realtime['initZendeskAccounts']())[_0x0d78('0x1d')](salesforce[_0x0d78('0x25')]())['then'](realtime[_0x0d78('0x26')]())['then'](sugarcrm[_0x0d78('0x27')]())[_0x0d78('0x1d')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x0d78('0x28')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x29')]())[_0x0d78('0x1d')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x0d78('0x1d')](zoho[_0x0d78('0x2a')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x2b')]())['then'](vtiger['getVtigerAccounts']())[_0x0d78('0x1d')](realtime[_0x0d78('0x2c')]())[_0x0d78('0x1d')](freshsales['getFreshsalesAccounts']())[_0x0d78('0x1d')](realtime[_0x0d78('0x2d')]())[_0x0d78('0x1d')](servicenow[_0x0d78('0x2e')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x2f')]())[_0x0d78('0x1d')](dynamics365[_0x0d78('0x30')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x31')]())['then'](campaign['getCampaigns']())[_0x0d78('0x1d')](realtime[_0x0d78('0x32')]())[_0x0d78('0x1d')](voiceExtension['getVoiceExtensions']())[_0x0d78('0x1d')](realtime[_0x0d78('0x33')]())[_0x0d78('0x1d')](faxAccount[_0x0d78('0x34')]())['then'](realtime[_0x0d78('0x35')]())[_0x0d78('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x0d78('0x19')]()[_0x0d78('0x1d')](voiceQueueReport['getVoiceQueueReports']())[_0x0d78('0x1d')](realtime['initVoiceQueueReports']())[_0x0d78('0x1d')](cmHopperHistory[_0x0d78('0x36')]())['then'](realtime[_0x0d78('0x37')]())[_0x0d78('0x1d')](cmHopperHistory[_0x0d78('0x38')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x39')]())[_0x0d78('0x1d')](voiceCallReport[_0x0d78('0x3a')]())[_0x0d78('0x1d')](realtime[_0x0d78('0x3b')]())['then'](function(_0x158749){})[_0x0d78('0x3c')](function(_0x5ea896){console[_0x0d78('0x3d')](_0x5ea896);});}function main(){return server[_0x0d78('0x3e')](realtime,preview,fax)[_0x0d78('0x1d')](function(_0x3a28eb){return initRealtime();})[_0x0d78('0x1d')](function(){return initParams();})[_0x0d78('0x1d')](function(){report[_0x0d78('0x3f')]();setInterval(initRealtime,0x1388);})[_0x0d78('0x3c')](function(_0x1f92eb){console[_0x0d78('0x3d')](_0x1f92eb);});}main();
\ No newline at end of file
+var _0x1244=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./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','get','then','initAgents','initTelephones','getTrunks','getVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','util','moment','./report','./acw','./trigger','./dialer','./preview'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1244,0x1ea));var _0x4124=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x1244[_0x54d4a8];return _0x3b321b;};'use strict';var BPromise=require('bluebird');var util=require(_0x4124('0x0'));var moment=require(_0x4124('0x1'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x4124('0x2'));var Acw=require(_0x4124('0x3'));var Trigger=require(_0x4124('0x4'));var Dialer=require(_0x4124('0x5'));var Preview=require(_0x4124('0x6'));var Fax=require(_0x4124('0x7'));var user=require(_0x4124('0x8'));var voiceQueue=require(_0x4124('0x9'));var voiceQueueReport=require(_0x4124('0xa'));var voiceCallReport=require(_0x4124('0xb'));var trunk=require(_0x4124('0xc'));var trigger=require(_0x4124('0xd'));var template=require(_0x4124('0xe'));var cmHopperHistory=require(_0x4124('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4124('0x10'));var faxAccount=require(_0x4124('0x11'));var zendesk=require(_0x4124('0x12'));var salesforce=require(_0x4124('0x13'));var sugarcrm=require(_0x4124('0x14'));var freshdesk=require(_0x4124('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x4124('0x16'));var vtiger=require(_0x4124('0x17'));var freshsales=require(_0x4124('0x18'));var servicenow=require(_0x4124('0x19'));var dynamics365=require(_0x4124('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4124('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x4124('0x1c')](user['getAgents']())[_0x4124('0x1c')](realtime[_0x4124('0x1d')]())[_0x4124('0x1c')](user['getTelephones']())['then'](realtime[_0x4124('0x1e')]())['then'](trunk[_0x4124('0x1f')]())['then'](realtime['initTrunks']())['then'](voiceQueue[_0x4124('0x20')]())[_0x4124('0x1c')](realtime['initVoiceQueues']())['then'](trigger[_0x4124('0x21')]())[_0x4124('0x1c')](realtime[_0x4124('0x22')]())[_0x4124('0x1c')](template[_0x4124('0x23')]())[_0x4124('0x1c')](realtime[_0x4124('0x24')]())[_0x4124('0x1c')](zendesk[_0x4124('0x25')]())[_0x4124('0x1c')](realtime[_0x4124('0x26')]())['then'](salesforce[_0x4124('0x27')]())[_0x4124('0x1c')](realtime[_0x4124('0x28')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x4124('0x1c')](realtime[_0x4124('0x29')]())[_0x4124('0x1c')](freshdesk[_0x4124('0x2a')]())[_0x4124('0x1c')](realtime['initFreshdeskAccounts']())[_0x4124('0x1c')](desk[_0x4124('0x2b')]())[_0x4124('0x1c')](realtime[_0x4124('0x2c')]())['then'](zoho[_0x4124('0x2d')]())[_0x4124('0x1c')](realtime[_0x4124('0x2e')]())['then'](vtiger['getVtigerAccounts']())[_0x4124('0x1c')](realtime[_0x4124('0x2f')]())[_0x4124('0x1c')](freshsales[_0x4124('0x30')]())[_0x4124('0x1c')](realtime[_0x4124('0x31')]())[_0x4124('0x1c')](servicenow['getServicenowAccounts']())[_0x4124('0x1c')](realtime[_0x4124('0x32')]())['then'](dynamics365[_0x4124('0x33')]())[_0x4124('0x1c')](realtime[_0x4124('0x34')]())[_0x4124('0x1c')](campaign[_0x4124('0x35')]())['then'](realtime['initCampaigns']())[_0x4124('0x1c')](voiceExtension[_0x4124('0x36')]())[_0x4124('0x1c')](realtime[_0x4124('0x37')]())[_0x4124('0x1c')](faxAccount[_0x4124('0x38')]())[_0x4124('0x1c')](realtime[_0x4124('0x39')]())[_0x4124('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x4124('0x3a')]()['then'](voiceQueueReport[_0x4124('0x3b')]())['then'](realtime[_0x4124('0x3c')]())[_0x4124('0x1c')](cmHopperHistory[_0x4124('0x3d')]())[_0x4124('0x1c')](realtime[_0x4124('0x3e')]())['then'](cmHopperHistory[_0x4124('0x3f')]())[_0x4124('0x1c')](realtime[_0x4124('0x40')]())[_0x4124('0x1c')](voiceCallReport[_0x4124('0x41')]())[_0x4124('0x1c')](realtime[_0x4124('0x42')]())['then'](function(_0x23828e){})[_0x4124('0x43')](function(_0x4e00b2){console[_0x4124('0x44')](_0x4e00b2);});}function main(){return server[_0x4124('0x45')](realtime,preview,fax)[_0x4124('0x1c')](function(_0x401bd0){return initRealtime();})[_0x4124('0x1c')](function(){return initParams();})[_0x4124('0x1c')](function(){report[_0x4124('0x46')]();setInterval(initRealtime,0x1388);})[_0x4124('0x43')](function(_0x29acb3){console[_0x4124('0x44')](_0x29acb3);});}main();
\ No newline at end of file
index 09e74a3..420e934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xedd9,0xfc));var _0x9edd=function(_0x1f4d6f,_0x51aac7){_0x1f4d6f=_0x1f4d6f-0x0;var _0x389e47=_0xedd9[_0x1f4d6f];return _0x389e47;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent;
\ No newline at end of file
+var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x18b1ac,_0x6d2519){var _0x5d9d1f=function(_0x3c14d7){while(--_0x3c14d7){_0x18b1ac['push'](_0x18b1ac['shift']());}};_0x5d9d1f(++_0x6d2519);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0xcb91[_0x2ff762];return _0x158b02;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent;
\ No newline at end of file
index cdfeb71..8c6de2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ca=['SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x5ad82e,_0x3a21c5){var _0x288010=function(_0x289bf8){while(--_0x289bf8){_0x5ad82e['push'](_0x5ad82e['shift']());}};_0x288010(++_0x3a21c5);}(_0x32ca,0x19c));var _0xa32c=function(_0x2299e8,_0x3e4063){_0x2299e8=_0x2299e8-0x0;var _0x433c0e=_0x32ca[_0x2299e8];return _0x433c0e;};'use strict';function Campaign(_0x3aec2d){this['id']=_0x3aec2d['id']||0x0;this['name']=_0x3aec2d[_0xa32c('0x0')]||'';this[_0xa32c('0x1')]=_0x3aec2d[_0xa32c('0x1')]||_0xa32c('0x2');this[_0xa32c('0x3')]=0x0;this[_0xa32c('0x4')]=0x0;this[_0xa32c('0x5')]=0x0;this[_0xa32c('0x6')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x3aec2d['active'];this[_0xa32c('0x7')]=_0x3aec2d[_0xa32c('0x7')];this[_0xa32c('0x8')]=_0x3aec2d[_0xa32c('0x8')]||null;this[_0xa32c('0x9')]=_0x3aec2d['dialGlobalInterval']?_0x3aec2d['dialGlobalInterval']:null;this[_0xa32c('0xa')]=_0x3aec2d['dialOriginateCallerIdName'];this[_0xa32c('0xb')]=_0x3aec2d['dialOriginateCallerIdNumber'];this[_0xa32c('0xc')]=_0x3aec2d['dialOriginateTimeout']||0x1e;this[_0xa32c('0xd')]=_0x3aec2d[_0xa32c('0xd')];this[_0xa32c('0xe')]=_0x3aec2d[_0xa32c('0xe')];this[_0xa32c('0xf')]=_0x3aec2d[_0xa32c('0xf')];this[_0xa32c('0x10')]=_0x3aec2d[_0xa32c('0x10')];this[_0xa32c('0x11')]=_0x3aec2d[_0xa32c('0x11')];this['dialNoAnswerRetryFrequency']=_0x3aec2d[_0xa32c('0x12')];this['dialGlobalMaxRetry']=_0x3aec2d[_0xa32c('0x13')];this[_0xa32c('0x14')]=_0x3aec2d[_0xa32c('0x14')]||0x3;this[_0xa32c('0x15')]=_0x3aec2d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xa32c('0x16')]=_0x3aec2d[_0xa32c('0x16')]||0x3;this['dialDropRetryFrequency']=_0x3aec2d[_0xa32c('0x17')]||0x96;this[_0xa32c('0x18')]=_0x3aec2d[_0xa32c('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x3aec2d[_0xa32c('0x19')]||0x96;this[_0xa32c('0x1a')]=_0x3aec2d[_0xa32c('0x1a')]||0x3;this[_0xa32c('0x1b')]=_0x3aec2d['dialMachineRetryFrequency']||0x96;this[_0xa32c('0x1c')]=_0x3aec2d[_0xa32c('0x1c')]||0x3;this[_0xa32c('0x1d')]=_0x3aec2d['dialAgentRejectRetryFrequency']||0x96;this[_0xa32c('0x1e')]=_0x3aec2d['dialOrderByScheduledAt']||_0xa32c('0x1f');this[_0xa32c('0x20')]=_0x3aec2d[_0xa32c('0x20')]||undefined;this[_0xa32c('0x21')]=_0x3aec2d[_0xa32c('0x21')]||undefined;this['dialCutDigit']=_0x3aec2d[_0xa32c('0x22')]||undefined;this[_0xa32c('0x23')]=_0x3aec2d[_0xa32c('0x23')]?_0x3aec2d[_0xa32c('0x23')]:undefined;this[_0xa32c('0x24')]=_0x3aec2d['Trunk']?_0x3aec2d[_0xa32c('0x24')]:undefined;this[_0xa32c('0x25')]=_0x3aec2d[_0xa32c('0x25')]?_0x3aec2d['Interval']:undefined;this[_0xa32c('0x26')]=_0x3aec2d[_0xa32c('0x26')]?_0x3aec2d[_0xa32c('0x26')]:undefined;this[_0xa32c('0x27')]=_0x3aec2d[_0xa32c('0x26')]?_0x3aec2d['SquareProject']['name']:undefined;this['dialAMDActive']=_0x3aec2d['dialAMDActive']||![];this[_0xa32c('0x28')]=_0x3aec2d[_0xa32c('0x28')];this['dialAMDGreeting']=_0x3aec2d[_0xa32c('0x29')];this[_0xa32c('0x2a')]=_0x3aec2d[_0xa32c('0x2a')];this['dialAMDTotalAnalysisTime']=_0x3aec2d[_0xa32c('0x2b')];this[_0xa32c('0x2c')]=_0x3aec2d['dialAMDMinWordLength'];this[_0xa32c('0x2d')]=_0x3aec2d['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x3aec2d[_0xa32c('0x2e')];this['dialAMDSilenceThreshold']=_0x3aec2d[_0xa32c('0x2f')];this[_0xa32c('0x30')]=_0x3aec2d[_0xa32c('0x30')];}module[_0xa32c('0x31')]=Campaign;
\ No newline at end of file
+var _0xe328=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x56fc5,_0x2016e6){var _0x478664=function(_0x13be93){while(--_0x13be93){_0x56fc5['push'](_0x56fc5['shift']());}};_0x478664(++_0x2016e6);}(_0xe328,0x1e2));var _0x8e32=function(_0x55550a,_0x550a0a){_0x55550a=_0x55550a-0x0;var _0x72e059=_0xe328[_0x55550a];return _0x72e059;};'use strict';function Campaign(_0x565d34){this['id']=_0x565d34['id']||0x0;this[_0x8e32('0x0')]=_0x565d34[_0x8e32('0x0')]||'';this[_0x8e32('0x1')]=_0x565d34[_0x8e32('0x1')]||_0x8e32('0x2');this[_0x8e32('0x3')]=0x0;this[_0x8e32('0x4')]=0x0;this[_0x8e32('0x5')]=0x0;this[_0x8e32('0x6')]=0x0;this[_0x8e32('0x7')]='';this[_0x8e32('0x8')]=!![];this[_0x8e32('0x9')]=_0x565d34[_0x8e32('0x9')];this[_0x8e32('0xa')]=_0x565d34['limitCalls'];this[_0x8e32('0xb')]=_0x565d34[_0x8e32('0xb')]||null;this['dialGlobalInterval']=_0x565d34[_0x8e32('0xc')]?_0x565d34[_0x8e32('0xc')]:null;this[_0x8e32('0xd')]=_0x565d34['dialOriginateCallerIdName'];this[_0x8e32('0xe')]=_0x565d34[_0x8e32('0xe')];this['dialOriginateTimeout']=_0x565d34[_0x8e32('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x565d34[_0x8e32('0x10')];this[_0x8e32('0x11')]=_0x565d34['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x565d34[_0x8e32('0x12')];this[_0x8e32('0x13')]=_0x565d34[_0x8e32('0x13')];this[_0x8e32('0x14')]=_0x565d34[_0x8e32('0x14')];this['dialNoAnswerRetryFrequency']=_0x565d34['dialNoAnswerRetryFrequency'];this[_0x8e32('0x15')]=_0x565d34[_0x8e32('0x15')];this[_0x8e32('0x16')]=_0x565d34['dialNoSuchNumberMaxRetry']||0x3;this[_0x8e32('0x17')]=_0x565d34[_0x8e32('0x17')]||0x96;this[_0x8e32('0x18')]=_0x565d34[_0x8e32('0x18')]||0x3;this['dialDropRetryFrequency']=_0x565d34[_0x8e32('0x19')]||0x96;this[_0x8e32('0x1a')]=_0x565d34[_0x8e32('0x1a')]||0x3;this[_0x8e32('0x1b')]=_0x565d34['dialAbandonedRetryFrequency']||0x96;this[_0x8e32('0x1c')]=_0x565d34[_0x8e32('0x1c')]||0x3;this[_0x8e32('0x1d')]=_0x565d34[_0x8e32('0x1d')]||0x96;this['dialAgentRejectMaxRetry']=_0x565d34[_0x8e32('0x1e')]||0x3;this[_0x8e32('0x1f')]=_0x565d34[_0x8e32('0x1f')]||0x96;this[_0x8e32('0x20')]=_0x565d34[_0x8e32('0x20')]||_0x8e32('0x21');this[_0x8e32('0x22')]=_0x565d34[_0x8e32('0x22')]||undefined;this[_0x8e32('0x23')]=_0x565d34[_0x8e32('0x23')]||undefined;this['dialCutDigit']=_0x565d34[_0x8e32('0x24')]||undefined;this[_0x8e32('0x25')]=_0x565d34['TrunkBackup']?_0x565d34[_0x8e32('0x25')]:undefined;this[_0x8e32('0x26')]=_0x565d34['Trunk']?_0x565d34[_0x8e32('0x26')]:undefined;this[_0x8e32('0x27')]=_0x565d34[_0x8e32('0x27')]?_0x565d34['Interval']:undefined;this['SquareProject']=_0x565d34[_0x8e32('0x28')]?_0x565d34[_0x8e32('0x28')]:undefined;this[_0x8e32('0x29')]=_0x565d34[_0x8e32('0x28')]?_0x565d34[_0x8e32('0x28')][_0x8e32('0x0')]:undefined;this['dialAMDActive']=_0x565d34[_0x8e32('0x2a')]||![];this[_0x8e32('0x2b')]=_0x565d34['dialAMDInitialSilence'];this[_0x8e32('0x2c')]=_0x565d34[_0x8e32('0x2c')];this['dialAMDAfterGreetingSilence']=_0x565d34[_0x8e32('0x2d')];this[_0x8e32('0x2e')]=_0x565d34[_0x8e32('0x2e')];this[_0x8e32('0x2f')]=_0x565d34[_0x8e32('0x2f')];this[_0x8e32('0x30')]=_0x565d34[_0x8e32('0x30')];this['dialAMDMaximumNumberOfWords']=_0x565d34[_0x8e32('0x31')];this['dialAMDSilenceThreshold']=_0x565d34[_0x8e32('0x32')];this[_0x8e32('0x33')]=_0x565d34[_0x8e32('0x33')];}module[_0x8e32('0x34')]=Campaign;
\ No newline at end of file
index b02e67f..29db97a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b26=['queue','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','tag','disposition','monitor'];(function(_0x44541c,_0x43eb5b){var _0x244fb1=function(_0x2e2068){while(--_0x2e2068){_0x44541c['push'](_0x44541c['shift']());}};_0x244fb1(++_0x43eb5b);}(_0x8b26,0x1f3));var _0x68b2=function(_0x36fd79,_0x5c2f22){_0x36fd79=_0x36fd79-0x0;var _0x1347c1=_0x8b26[_0x36fd79];return _0x1347c1;};'use strict';function Channel(){this[_0x68b2('0x0')]=null;this[_0x68b2('0x1')]='';this[_0x68b2('0x2')]='';this['calleridnum']=0x0;this[_0x68b2('0x3')]='';this[_0x68b2('0x4')]=undefined;this[_0x68b2('0x5')]=undefined;this[_0x68b2('0x6')]=0x0;this[_0x68b2('0x7')]='';this[_0x68b2('0x8')]=0x0;this[_0x68b2('0x9')]=0x0;this[_0x68b2('0xa')]=0x0;this[_0x68b2('0xb')]=![];this[_0x68b2('0xc')]=null;this['endtime']=null;this[_0x68b2('0xd')]=![];this[_0x68b2('0xe')]=![];this[_0x68b2('0xf')]='';this[_0x68b2('0x10')]='';this['duration']=0x0;this[_0x68b2('0x11')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x68b2('0x12')]=null;this[_0x68b2('0x13')]=null;this[_0x68b2('0x14')]=![];this['monitorFilename']=null;this[_0x68b2('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x68b2('0x16')]=undefined;this[_0x68b2('0x17')]=undefined;this[_0x68b2('0x18')]=0x0;}module[_0x68b2('0x19')]=Channel;
\ No newline at end of file
+var _0x3f7c=['unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','queue','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','context','uniqueid','linkedid','exten','answered','endtime'];(function(_0x2b7e4c,_0x481d09){var _0x2f1085=function(_0x4465ec){while(--_0x4465ec){_0x2b7e4c['push'](_0x2b7e4c['shift']());}};_0x2f1085(++_0x481d09);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x5041ab,_0x4dcb79){_0x5041ab=_0x5041ab-0x0;var _0x28165d=_0x3f7c[_0x5041ab];return _0x28165d;};'use strict';function Channel(){this[_0xc3f7('0x0')]=null;this[_0xc3f7('0x1')]='';this[_0xc3f7('0x2')]='';this[_0xc3f7('0x3')]=0x0;this[_0xc3f7('0x4')]='';this['connectedlinenum']=undefined;this[_0xc3f7('0x5')]=undefined;this['accountcode']=0x0;this[_0xc3f7('0x6')]='';this[_0xc3f7('0x7')]=0x0;this[_0xc3f7('0x8')]=0x0;this[_0xc3f7('0x9')]=0x0;this[_0xc3f7('0xa')]=![];this['answertime']=null;this[_0xc3f7('0xb')]=null;this[_0xc3f7('0xc')]=![];this[_0xc3f7('0xd')]=![];this[_0xc3f7('0xe')]='';this[_0xc3f7('0xf')]='';this[_0xc3f7('0x10')]=0x0;this[_0xc3f7('0x11')]=0x0;this[_0xc3f7('0x12')]=0x0;this[_0xc3f7('0x13')]=null;this['tag']=null;this[_0xc3f7('0x14')]=null;this[_0xc3f7('0x15')]=![];this['monitorFilename']=null;this[_0xc3f7('0x16')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xc3f7('0x17')]=undefined;this['transferType']=undefined;this[_0xc3f7('0x18')]=0x0;}module[_0xc3f7('0x19')]=Channel;
\ No newline at end of file
index b88fb8e..aac8e8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb856=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0xf244e0,_0x20556c){var _0xe94095=function(_0x409d0a){while(--_0x409d0a){_0xf244e0['push'](_0xf244e0['shift']());}};_0xe94095(++_0x20556c);}(_0xb856,0x11a));var _0x6b85=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb856[_0x321bb2];return _0x9c12ed;};'use strict';function DeskAccount(_0x29036d){this['id']=_0x29036d['id']||0x0;this[_0x6b85('0x0')]=_0x29036d[_0x6b85('0x0')]||'';this[_0x6b85('0x1')]=_0x29036d['username']||'';this[_0x6b85('0x2')]=_0x29036d[_0x6b85('0x2')]||'';this[_0x6b85('0x3')]=_0x29036d[_0x6b85('0x3')]||'';this[_0x6b85('0x4')]=_0x29036d[_0x6b85('0x4')]||'';this['consumerKey']=_0x29036d[_0x6b85('0x5')]||'';this[_0x6b85('0x6')]=_0x29036d['consumerSecret']||'';this[_0x6b85('0x7')]=_0x29036d[_0x6b85('0x7')]||'';this[_0x6b85('0x8')]=_0x29036d[_0x6b85('0x8')]||'';this['type']=_0x29036d[_0x6b85('0x9')]||'';this[_0x6b85('0xa')]=_0x29036d[_0x6b85('0xa')]||'';this[_0x6b85('0xb')]=_0x29036d[_0x6b85('0xb')]||{};}module[_0x6b85('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xc59b=['consumerSecret','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x384827,_0xe4edb4){var _0x3f09ce=function(_0x4aa35a){while(--_0x4aa35a){_0x384827['push'](_0x384827['shift']());}};_0x3f09ce(++_0xe4edb4);}(_0xc59b,0x8a));var _0xbc59=function(_0x977300,_0x7748dc){_0x977300=_0x977300-0x0;var _0xef24b7=_0xc59b[_0x977300];return _0xef24b7;};'use strict';function DeskAccount(_0x59cdcb){this['id']=_0x59cdcb['id']||0x0;this[_0xbc59('0x0')]=_0x59cdcb[_0xbc59('0x0')]||'';this[_0xbc59('0x1')]=_0x59cdcb[_0xbc59('0x1')]||'';this['remoteUri']=_0x59cdcb[_0xbc59('0x2')]||'';this[_0xbc59('0x3')]=_0x59cdcb[_0xbc59('0x3')]||'';this[_0xbc59('0x4')]=_0x59cdcb['password']||'';this[_0xbc59('0x5')]=_0x59cdcb[_0xbc59('0x5')]||'';this[_0xbc59('0x6')]=_0x59cdcb[_0xbc59('0x6')]||'';this['token']=_0x59cdcb['token']||'';this[_0xbc59('0x7')]=_0x59cdcb[_0xbc59('0x7')]||'';this[_0xbc59('0x8')]=_0x59cdcb[_0xbc59('0x8')]||'';this[_0xbc59('0x9')]=_0x59cdcb[_0xbc59('0x9')]||'';this['Configurations']=_0x59cdcb[_0xbc59('0xa')]||{};}module[_0xbc59('0xb')]=DeskAccount;
\ No newline at end of file
index b7e1559..59d0e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x289874,_0x1b6752){var _0x2f8bbb=function(_0x23ee80){while(--_0x23ee80){_0x289874['push'](_0x289874['shift']());}};_0x2f8bbb(++_0x1b6752);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3fa103,_0x9a7a10){_0x3fa103=_0x3fa103-0x0;var _0x69bc78=_0xee5b[_0x3fa103];return _0x69bc78;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x9348=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x9348,0x10d));var _0x8934=function(_0x141832,_0x2ad753){_0x141832=_0x141832-0x0;var _0x50f265=_0x9348[_0x141832];return _0x50f265;};'use strict';function Dynamics365Account(_0x41a189){this['id']=_0x41a189['id']||0x0;this[_0x8934('0x0')]=_0x41a189[_0x8934('0x0')]||'';this[_0x8934('0x1')]=_0x41a189[_0x8934('0x1')]||'';this['password']=_0x41a189[_0x8934('0x2')]||'';this[_0x8934('0x3')]=_0x41a189['remoteUri']||'';this[_0x8934('0x4')]=_0x41a189[_0x8934('0x4')]||'';this[_0x8934('0x5')]=_0x41a189[_0x8934('0x5')]||'';this[_0x8934('0x6')]=_0x41a189[_0x8934('0x6')]||{};this['serverUrl']=_0x41a189[_0x8934('0x7')]||'';this[_0x8934('0x8')]=_0x41a189[_0x8934('0x8')]||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
index b5d71ad..d9b5217 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x252e=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x252e,0x15e));var _0xe252=function(_0x1d829e,_0x279c95){_0x1d829e=_0x1d829e-0x0;var _0x25d9fd=_0x252e[_0x1d829e];return _0x25d9fd;};'use strict';function FaxAccount(_0x415209){this['id']=_0x415209['id']||0x0;this[_0xe252('0x0')]=_0x415209['name']||'';this[_0xe252('0x1')]=_0x415209[_0xe252('0x1')];this[_0xe252('0x2')]=_0x415209[_0xe252('0x2')];this[_0xe252('0x3')]=_0x415209[_0xe252('0x3')];this[_0xe252('0x4')]=_0x415209[_0xe252('0x4')];this['minrate']=_0x415209[_0xe252('0x5')]||0x960;this[_0xe252('0x6')]=_0x415209['maxrate']||0x3840;this[_0xe252('0x7')]=_0x415209[_0xe252('0x7')]||_0xe252('0x8');this[_0xe252('0x9')]=_0x415209[_0xe252('0x9')]||'no';this['faxdetect']=_0x415209[_0xe252('0xa')]||'no';this['t38timeout']=_0x415209[_0xe252('0xb')]||0x1388;this[_0xe252('0xc')]=_0x415209[_0xe252('0xc')]||_0xe252('0xd');this[_0xe252('0xe')]=_0x415209['Trunk']?_0x415209[_0xe252('0xe')]:undefined;this[_0xe252('0xf')]=_0x415209[_0xe252('0xf')];this[_0xe252('0x10')]=_0x415209[_0xe252('0x10')];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0x86c1=['ecm','headerinfo','localstationid','minrate','maxrate','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x86c1,0x1be));var _0x186c=function(_0x386516,_0x446354){_0x386516=_0x386516-0x0;var _0x3ff455=_0x86c1[_0x386516];return _0x3ff455;};'use strict';function FaxAccount(_0x40f17d){this['id']=_0x40f17d['id']||0x0;this[_0x186c('0x0')]=_0x40f17d[_0x186c('0x0')]||'';this[_0x186c('0x1')]=_0x40f17d['description'];this[_0x186c('0x2')]=_0x40f17d[_0x186c('0x2')];this[_0x186c('0x3')]=_0x40f17d[_0x186c('0x3')];this['localstationid']=_0x40f17d[_0x186c('0x4')];this[_0x186c('0x5')]=_0x40f17d[_0x186c('0x5')]||0x960;this[_0x186c('0x6')]=_0x40f17d[_0x186c('0x6')]||0x3840;this['modem']=_0x40f17d['modem']||'v17,v27,v29';this[_0x186c('0x7')]=_0x40f17d[_0x186c('0x7')]||'no';this[_0x186c('0x8')]=_0x40f17d[_0x186c('0x8')]||'no';this[_0x186c('0x9')]=_0x40f17d[_0x186c('0x9')]||0x1388;this[_0x186c('0xa')]=_0x40f17d[_0x186c('0xa')]||_0x186c('0xb');this[_0x186c('0xc')]=_0x40f17d[_0x186c('0xc')]?_0x40f17d[_0x186c('0xc')]:undefined;this[_0x186c('0xd')]=_0x40f17d[_0x186c('0xd')];this['key']=_0x40f17d[_0x186c('0xe')];}module[_0x186c('0xf')]=FaxAccount;
\ No newline at end of file
index a2b207d..73fa4a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd37b=['serverUrl','Configurations','name','apiKey','remoteUri'];(function(_0x379010,_0x3b8dca){var _0x116f09=function(_0x3a7756){while(--_0x3a7756){_0x379010['push'](_0x379010['shift']());}};_0x116f09(++_0x3b8dca);}(_0xd37b,0x14c));var _0xbd37=function(_0x5bc240,_0x34de0f){_0x5bc240=_0x5bc240-0x0;var _0x149b09=_0xd37b[_0x5bc240];return _0x149b09;};'use strict';function FreshdeskAccount(_0x14a0ed){this['id']=_0x14a0ed['id']||0x0;this[_0xbd37('0x0')]=_0x14a0ed['name']||'';this['username']=_0x14a0ed['username']||'';this[_0xbd37('0x1')]=_0x14a0ed['token']||'';this[_0xbd37('0x2')]=_0x14a0ed['remoteUri']||'';this[_0xbd37('0x3')]=_0x14a0ed['serverUrl']||'';this[_0xbd37('0x4')]=_0x14a0ed['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0xdd51=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x33a2a3,_0x39f27d){var _0x491670=function(_0xf8646e){while(--_0xf8646e){_0x33a2a3['push'](_0x33a2a3['shift']());}};_0x491670(++_0x39f27d);}(_0xdd51,0x172));var _0x1dd5=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xdd51[_0x33032e];return _0x13316b;};'use strict';function FreshdeskAccount(_0x163e55){this['id']=_0x163e55['id']||0x0;this[_0x1dd5('0x0')]=_0x163e55[_0x1dd5('0x0')]||'';this[_0x1dd5('0x1')]=_0x163e55[_0x1dd5('0x1')]||'';this['apiKey']=_0x163e55[_0x1dd5('0x2')]||'';this['remoteUri']=_0x163e55[_0x1dd5('0x3')]||'';this['serverUrl']=_0x163e55[_0x1dd5('0x4')]||'';this['Configurations']=_0x163e55[_0x1dd5('0x5')]||{};}module[_0x1dd5('0x6')]=FreshdeskAccount;
\ No newline at end of file
index 3052968..7054f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644f=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x644f,0x177));var _0xf644=function(_0x166e96,_0x55191d){_0x166e96=_0x166e96-0x0;var _0x553d73=_0x644f[_0x166e96];return _0x553d73;};'use strict';function FreshsalesAccount(_0x5ccdaf){this['id']=_0x5ccdaf['id']||0x0;this[_0xf644('0x0')]=_0x5ccdaf[_0xf644('0x0')]||'';this[_0xf644('0x1')]=_0x5ccdaf[_0xf644('0x1')]||'';this[_0xf644('0x2')]=_0x5ccdaf[_0xf644('0x3')]||'';this[_0xf644('0x4')]=_0x5ccdaf[_0xf644('0x4')]||'';this[_0xf644('0x5')]=_0x5ccdaf['serverUrl']||'';this['Configurations']=_0x5ccdaf[_0xf644('0x6')]||{};}module[_0xf644('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x302c=['remoteUri','serverUrl','Configurations','name','username'];(function(_0x1b40b5,_0xf4c76d){var _0xd5c4c5=function(_0x17cfb7){while(--_0x17cfb7){_0x1b40b5['push'](_0x1b40b5['shift']());}};_0xd5c4c5(++_0xf4c76d);}(_0x302c,0x15c));var _0xc302=function(_0x3e885f,_0xaf80c0){_0x3e885f=_0x3e885f-0x0;var _0x13e91f=_0x302c[_0x3e885f];return _0x13e91f;};'use strict';function FreshsalesAccount(_0x24ba4c){this['id']=_0x24ba4c['id']||0x0;this[_0xc302('0x0')]=_0x24ba4c[_0xc302('0x0')]||'';this[_0xc302('0x1')]=_0x24ba4c[_0xc302('0x1')]||'';this['apiKey']=_0x24ba4c['token']||'';this[_0xc302('0x2')]=_0x24ba4c[_0xc302('0x2')]||'';this[_0xc302('0x3')]=_0x24ba4c['serverUrl']||'';this['Configurations']=_0x24ba4c[_0xc302('0x4')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 66b4e37..423936c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0719=['queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','holdtime','assigned','lastAssignedTo','motionChannel','voice','variables','exports','type','inbound','calleridnum','calleridname'];(function(_0x1156d3,_0x1899b4){var _0x146fe2=function(_0x806d3f){while(--_0x806d3f){_0x1156d3['push'](_0x1156d3['shift']());}};_0x146fe2(++_0x1899b4);}(_0x0719,0x1f4));var _0x9071=function(_0x6dc2ee,_0x1af658){_0x6dc2ee=_0x6dc2ee-0x0;var _0x4a9848=_0x0719[_0x6dc2ee];return _0x4a9848;};'use strict';function QueueReport(){this[_0x9071('0x0')]=_0x9071('0x1');this['uniqueid']='';this[_0x9071('0x2')]='';this[_0x9071('0x3')]='';this[_0x9071('0x4')]='';this['queuecallerjoinAt']=null;this[_0x9071('0x5')]=null;this[_0x9071('0x6')]=0x1;this[_0x9071('0x7')]=0x1;this[_0x9071('0x8')]=![];this[_0x9071('0x9')]=null;this['queuecallercomplete']=![];this[_0x9071('0xa')]=null;this['queuecallerexit']=![];this[_0x9071('0xb')]=null;this[_0x9071('0xc')]=0x1;this[_0x9071('0xd')]='';this[_0x9071('0xe')]='';this['connectedlinename']='';this[_0x9071('0xf')]='';this[_0x9071('0x10')]='';this['exten']='';this['priority']='';this[_0x9071('0x11')]=0x0;this[_0x9071('0x12')]=![];this[_0x9071('0x13')]='';this[_0x9071('0x14')]=_0x9071('0x15');this['mohtime']=0x0;this[_0x9071('0x16')]={};}module[_0x9071('0x17')]=QueueReport;
\ No newline at end of file
+var _0x80aa=['position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','exten','priority','holdtime','assigned','motionChannel','mohtime','variables','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt'];(function(_0x363c54,_0x47e9a5){var _0x2f723d=function(_0x5a0026){while(--_0x5a0026){_0x363c54['push'](_0x363c54['shift']());}};_0x2f723d(++_0x47e9a5);}(_0x80aa,0x1df));var _0xa80a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x80aa[_0x14add3];return _0x4a174f;};'use strict';function QueueReport(){this[_0xa80a('0x0')]='inbound';this[_0xa80a('0x1')]='';this[_0xa80a('0x2')]='';this[_0xa80a('0x3')]='';this[_0xa80a('0x4')]='';this[_0xa80a('0x5')]=null;this[_0xa80a('0x6')]=null;this[_0xa80a('0x7')]=0x1;this[_0xa80a('0x8')]=0x1;this[_0xa80a('0x9')]=![];this[_0xa80a('0xa')]=null;this[_0xa80a('0xb')]=![];this[_0xa80a('0xc')]=null;this[_0xa80a('0xd')]=![];this[_0xa80a('0xe')]=null;this[_0xa80a('0xf')]=0x1;this[_0xa80a('0x10')]='';this[_0xa80a('0x11')]='';this['connectedlinename']='';this[_0xa80a('0x12')]='';this['context']='';this[_0xa80a('0x13')]='';this[_0xa80a('0x14')]='';this[_0xa80a('0x15')]=0x0;this[_0xa80a('0x16')]=![];this['lastAssignedTo']='';this[_0xa80a('0x17')]='voice';this[_0xa80a('0x18')]=0x0;this[_0xa80a('0x19')]={};}module[_0xa80a('0x1a')]=QueueReport;
\ No newline at end of file
index ea9b497..51fc729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b59=['remoteUri','password','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2b59,0x1de));var _0x92b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2b59[_0x3dd15e];return _0x231fd0;};'use strict';function SalesforceAccount(_0x4245c7){this['id']=_0x4245c7['id']||0x0;this[_0x92b5('0x0')]=_0x4245c7['name']||'';this['username']=_0x4245c7[_0x92b5('0x1')]||'';this[_0x92b5('0x2')]=_0x4245c7[_0x92b5('0x2')]||'';this['password']=_0x4245c7[_0x92b5('0x3')]||'';this['clientId']=_0x4245c7['clientId']||'';this[_0x92b5('0x4')]=_0x4245c7[_0x92b5('0x4')]||'';this[_0x92b5('0x5')]=_0x4245c7[_0x92b5('0x5')]||'';this[_0x92b5('0x6')]=_0x4245c7[_0x92b5('0x6')]||'integrationTab';this[_0x92b5('0x7')]=_0x4245c7[_0x92b5('0x7')]||'';this[_0x92b5('0x8')]=_0x4245c7['Configurations']||{};}module[_0x92b5('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0x9749=['integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0x9749,0x1e4));var _0x9974=function(_0x3045b5,_0x3c3031){_0x3045b5=_0x3045b5-0x0;var _0x294075=_0x9749[_0x3045b5];return _0x294075;};'use strict';function SalesforceAccount(_0x22c2a0){this['id']=_0x22c2a0['id']||0x0;this[_0x9974('0x0')]=_0x22c2a0[_0x9974('0x0')]||'';this['username']=_0x22c2a0[_0x9974('0x1')]||'';this[_0x9974('0x2')]=_0x22c2a0['remoteUri']||'';this['password']=_0x22c2a0[_0x9974('0x3')]||'';this['clientId']=_0x22c2a0[_0x9974('0x4')]||'';this[_0x9974('0x5')]=_0x22c2a0[_0x9974('0x5')]||'';this[_0x9974('0x6')]=_0x22c2a0[_0x9974('0x6')]||'';this[_0x9974('0x7')]=_0x22c2a0['type']||_0x9974('0x8');this[_0x9974('0x9')]=_0x22c2a0['serverUrl']||'';this[_0x9974('0xa')]=_0x22c2a0['Configurations']||{};}module[_0x9974('0xb')]=SalesforceAccount;
\ No newline at end of file
index 33eab94..a7e6439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7c1=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x43499f,_0x3eb8ae){var _0x39503b=function(_0x10c4bc){while(--_0x10c4bc){_0x43499f['push'](_0x43499f['shift']());}};_0x39503b(++_0x3eb8ae);}(_0xa7c1,0x110));var _0x1a7c=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa7c1[_0x5d6456];return _0x4d66c1;};'use strict';function ServicenowAccount(_0x15c76b){this['id']=_0x15c76b['id']||0x0;this['name']=_0x15c76b[_0x1a7c('0x0')]||'';this[_0x1a7c('0x1')]=_0x15c76b[_0x1a7c('0x1')]||'';this[_0x1a7c('0x2')]=_0x15c76b[_0x1a7c('0x2')]||'';this[_0x1a7c('0x3')]=_0x15c76b[_0x1a7c('0x3')]||'';this[_0x1a7c('0x4')]=_0x15c76b[_0x1a7c('0x4')]||'';this[_0x1a7c('0x5')]=_0x15c76b[_0x1a7c('0x5')]||{};}module[_0x1a7c('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x7ce6=['exports','name','password','remoteUri','serverUrl','Configurations'];(function(_0x32442e,_0xe6f580){var _0x3c6ab2=function(_0x32cfd9){while(--_0x32cfd9){_0x32442e['push'](_0x32442e['shift']());}};_0x3c6ab2(++_0xe6f580);}(_0x7ce6,0x15d));var _0x67ce=function(_0x2bc4aa,_0x427b74){_0x2bc4aa=_0x2bc4aa-0x0;var _0x17ffbc=_0x7ce6[_0x2bc4aa];return _0x17ffbc;};'use strict';function ServicenowAccount(_0x267d36){this['id']=_0x267d36['id']||0x0;this['name']=_0x267d36[_0x67ce('0x0')]||'';this['username']=_0x267d36['username']||'';this['password']=_0x267d36[_0x67ce('0x1')]||'';this[_0x67ce('0x2')]=_0x267d36['remoteUri']||'';this[_0x67ce('0x3')]=_0x267d36[_0x67ce('0x3')]||'';this[_0x67ce('0x4')]=_0x267d36[_0x67ce('0x4')]||{};}module[_0x67ce('0x5')]=ServicenowAccount;
\ No newline at end of file
index 39b45dd..ce167a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbb0=['password','remoteUri','Configurations','exports','name','username'];(function(_0x5c43d8,_0x5c68d6){var _0x15939c=function(_0x434498){while(--_0x434498){_0x5c43d8['push'](_0x5c43d8['shift']());}};_0x15939c(++_0x5c68d6);}(_0xcbb0,0x1d8));var _0x0cbb=function(_0x2b3014,_0x2748a8){_0x2b3014=_0x2b3014-0x0;var _0x35b6b7=_0xcbb0[_0x2b3014];return _0x35b6b7;};'use strict';function SugarcrmAccount(_0x26bfbe){this['id']=_0x26bfbe['id']||0x0;this[_0x0cbb('0x0')]=_0x26bfbe[_0x0cbb('0x0')]||'';this['username']=_0x26bfbe[_0x0cbb('0x1')]||'';this[_0x0cbb('0x2')]=_0x26bfbe[_0x0cbb('0x2')]||'';this[_0x0cbb('0x3')]=_0x26bfbe['remoteUri']||'';this['serverUrl']=_0x26bfbe['serverUrl']||'';this[_0x0cbb('0x4')]=_0x26bfbe[_0x0cbb('0x4')]||{};}module[_0x0cbb('0x5')]=SugarcrmAccount;
\ No newline at end of file
+var _0xe338=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3701c2,_0x2da36c){var _0x2ed7b=function(_0x3e6c59){while(--_0x3e6c59){_0x3701c2['push'](_0x3701c2['shift']());}};_0x2ed7b(++_0x2da36c);}(_0xe338,0x99));var _0x8e33=function(_0x2c8126,_0x2da9ae){_0x2c8126=_0x2c8126-0x0;var _0x251641=_0xe338[_0x2c8126];return _0x251641;};'use strict';function SugarcrmAccount(_0x193d5e){this['id']=_0x193d5e['id']||0x0;this[_0x8e33('0x0')]=_0x193d5e[_0x8e33('0x0')]||'';this['username']=_0x193d5e[_0x8e33('0x1')]||'';this[_0x8e33('0x2')]=_0x193d5e[_0x8e33('0x2')]||'';this[_0x8e33('0x3')]=_0x193d5e[_0x8e33('0x3')]||'';this[_0x8e33('0x4')]=_0x193d5e[_0x8e33('0x4')]||'';this[_0x8e33('0x5')]=_0x193d5e[_0x8e33('0x5')]||{};}module[_0x8e33('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 1b244c0..552f1a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd561=['exports','accountcode','unknown','stateTime','status','address'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xd561,0xc7));var _0x1d56=function(_0x52f0e4,_0x224a31){_0x52f0e4=_0x52f0e4-0x0;var _0x88052f=_0xd561[_0x52f0e4];return _0x88052f;};'use strict';function Telephone(_0x279e23){this['id']=_0x279e23['id']||0x0;this['name']=_0x279e23['name']||'';this['accountcode']=_0x279e23[_0x1d56('0x0')]||'';this['state']=_0x1d56('0x1');this[_0x1d56('0x2')]=0x0;this[_0x1d56('0x3')]='unknown';this[_0x1d56('0x4')]='';}module[_0x1d56('0x5')]=Telephone;
\ No newline at end of file
+var _0x887e=['unknown','status','address','name','accountcode','state'];(function(_0x40a5bc,_0x153ba0){var _0x3cdc81=function(_0x26a530){while(--_0x26a530){_0x40a5bc['push'](_0x40a5bc['shift']());}};_0x3cdc81(++_0x153ba0);}(_0x887e,0x14d));var _0xe887=function(_0x21c6fa,_0x191bc1){_0x21c6fa=_0x21c6fa-0x0;var _0x1cc8a3=_0x887e[_0x21c6fa];return _0x1cc8a3;};'use strict';function Telephone(_0x41b561){this['id']=_0x41b561['id']||0x0;this[_0xe887('0x0')]=_0x41b561[_0xe887('0x0')]||'';this[_0xe887('0x1')]=_0x41b561[_0xe887('0x1')]||'';this[_0xe887('0x2')]=_0xe887('0x3');this['stateTime']=0x0;this[_0xe887('0x4')]='unknown';this[_0xe887('0x5')]='';}module['exports']=Telephone;
\ No newline at end of file
index d0e38c3..a2f6708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x1d0f96,_0x350093){var _0x27b07e=function(_0x529f87){while(--_0x529f87){_0x1d0f96['push'](_0x1d0f96['shift']());}};_0x27b07e(++_0x350093);}(_0xb10b,0x12a));var _0xbb10=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0xb10b[_0x345a1b];return _0x1b24ec;};'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 _0xb10b=['name','html'];(function(_0x4add78,_0x39dbf2){var _0x2ad560=function(_0x22a1c9){while(--_0x22a1c9){_0x4add78['push'](_0x4add78['shift']());}};_0x2ad560(++_0x39dbf2);}(_0xb10b,0x12a));var _0xbb10=function(_0x2cbd58,_0x278e75){_0x2cbd58=_0x2cbd58-0x0;var _0x42ef2a=_0xb10b[_0x2cbd58];return _0x42ef2a;};'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
index e0108b1..d39567a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x379df3,_0x491c31){var _0x2211e3=function(_0x2ae189){while(--_0x2ae189){_0x379df3['push'](_0x379df3['shift']());}};_0x2211e3(++_0x491c31);}(_0x2032,0xd9));var _0x2203=function(_0x338293,_0x2b7457){_0x338293=_0x338293-0x0;var _0x5a2edb=_0x2032[_0x338293];return _0x5a2edb;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
+var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x265da0,_0x149ed5){var _0x580fae=function(_0xa9a2e4){while(--_0xa9a2e4){_0x265da0['push'](_0x265da0['shift']());}};_0x580fae(++_0x149ed5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x39585f,_0x3ae850){_0x39585f=_0x39585f-0x0;var _0x387a96=_0x9ffd[_0x39585f];return _0x387a96;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger;
\ No newline at end of file
index 6a637eb..bfdb9d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d6f=['name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active'];(function(_0x2e8ae6,_0x4c3899){var _0x3981dd=function(_0x20d341){while(--_0x20d341){_0x2e8ae6['push'](_0x2e8ae6['shift']());}};_0x3981dd(++_0x4c3899);}(_0x7d6f,0xe3));var _0xf7d6=function(_0xfcc39b,_0x294e2a){_0xfcc39b=_0xfcc39b-0x0;var _0x34f377=_0x7d6f[_0xfcc39b];return _0x34f377;};'use strict';function Trunk(_0x24928b){this['id']=_0x24928b['id']||0x0;this[_0xf7d6('0x0')]=_0x24928b[_0xf7d6('0x0')]||![];this[_0xf7d6('0x1')]=_0x24928b[_0xf7d6('0x1')]||'';this[_0xf7d6('0x2')]=_0xf7d6('0x3');this[_0xf7d6('0x4')]=0x0;this[_0xf7d6('0x5')]=_0xf7d6('0x3');this[_0xf7d6('0x6')]=_0x24928b['registry']&&_0x24928b['registry'][_0xf7d6('0x7')](':')?_0x24928b[_0xf7d6('0x6')][_0xf7d6('0x8')](':')[0x0]:'';this[_0xf7d6('0x9')]='';this[_0xf7d6('0xa')]='';this[_0xf7d6('0xb')]='';this[_0xf7d6('0xc')]='';this[_0xf7d6('0xd')]='';this[_0xf7d6('0xe')]=_0xf7d6('0x3');this[_0xf7d6('0xf')]='';this[_0xf7d6('0x10')]='';this[_0xf7d6('0x11')]=_0x24928b['defaultuser']||'';}module[_0xf7d6('0x12')]=Trunk;
\ No newline at end of file
+var _0xcaa4=['active','name','state','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','stateRegistry','registrationtime','address','defaultuser','exports'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xcaa4,0x198));var _0x4caa=function(_0x54c0d5,_0x1dd247){_0x54c0d5=_0x54c0d5-0x0;var _0x2df37a=_0xcaa4[_0x54c0d5];return _0x2df37a;};'use strict';function Trunk(_0x128bb1){this['id']=_0x128bb1['id']||0x0;this[_0x4caa('0x0')]=_0x128bb1[_0x4caa('0x0')]||![];this[_0x4caa('0x1')]=_0x128bb1[_0x4caa('0x1')]||'';this[_0x4caa('0x2')]=_0x4caa('0x3');this[_0x4caa('0x4')]=0x0;this['status']=_0x4caa('0x3');this['registry']=_0x128bb1[_0x4caa('0x5')]&&_0x128bb1[_0x4caa('0x5')][_0x4caa('0x6')](':')?_0x128bb1[_0x4caa('0x5')][_0x4caa('0x7')](':')[0x0]:'';this[_0x4caa('0x8')]='';this[_0x4caa('0x9')]='';this[_0x4caa('0xa')]='';this[_0x4caa('0xb')]='';this['refresh']='';this[_0x4caa('0xc')]=_0x4caa('0x3');this[_0x4caa('0xd')]='';this[_0x4caa('0xe')]='';this[_0x4caa('0xf')]=_0x128bb1[_0x4caa('0xf')]||'';}module[_0x4caa('0x10')]=Trunk;
\ No newline at end of file
index 2da8c1d..ddb6708 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd32c=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x14d6e8,_0x131c97){var _0x510e3b=function(_0x65c164){while(--_0x65c164){_0x14d6e8['push'](_0x14d6e8['shift']());}};_0x510e3b(++_0x131c97);}(_0xd32c,0x82));var _0xcd32=function(_0x822939,_0x34bc67){_0x822939=_0x822939-0x0;var _0x476773=_0xd32c[_0x822939];return _0x476773;};'use strict';function voiceExtension(_0x11c5c3){this['id']=_0x11c5c3['id']||0x0;this['exten']=_0x11c5c3[_0xcd32('0x0')]||'';this[_0xcd32('0x1')]=_0x11c5c3[_0xcd32('0x1')]||_0xcd32('0x2');this[_0xcd32('0x3')]=_0x11c5c3['mandatoryDisposition']||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0xe415=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x2a6d2c,_0x5a7e17){var _0x4e8fc5=function(_0x313f74){while(--_0x313f74){_0x2a6d2c['push'](_0x2a6d2c['shift']());}};_0x4e8fc5(++_0x5a7e17);}(_0xe415,0xa6));var _0x5e41=function(_0x3b069b,_0x431385){_0x3b069b=_0x3b069b-0x0;var _0x16449b=_0xe415[_0x3b069b];return _0x16449b;};'use strict';function voiceExtension(_0x5eb483){this['id']=_0x5eb483['id']||0x0;this[_0x5e41('0x0')]=_0x5eb483[_0x5e41('0x0')]||'';this[_0x5e41('0x1')]=_0x5eb483[_0x5e41('0x1')]||_0x5e41('0x2');this[_0x5e41('0x3')]=_0x5eb483[_0x5e41('0x3')]||![];}module[_0x5e41('0x4')]=voiceExtension;
\ No newline at end of file
index 5ee7c6d..b110eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9500=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','unmanaged','abandoned','loggedIn','acwTimeout','autopause','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x424be0,_0x5b1245){var _0x2fff85=function(_0x334746){while(--_0x334746){_0x424be0['push'](_0x424be0['shift']());}};_0x2fff85(++_0x5b1245);}(_0x9500,0xb6));var _0x0950=function(_0x5c7b65,_0x58a8b7){_0x5c7b65=_0x5c7b65-0x0;var _0xff998=_0x9500[_0x5c7b65];return _0xff998;};'use strict';var statusDesc=[_0x0950('0x0'),_0x0950('0x1'),_0x0950('0x2'),_0x0950('0x3'),_0x0950('0x4'),_0x0950('0x5'),_0x0950('0x6'),_0x0950('0x7'),_0x0950('0x8')];var monitorFormat={'wav':_0x0950('0x9'),'wav49':_0x0950('0xa'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x1edfd0){this['id']=_0x1edfd0['id']||0x0;this[_0x0950('0xb')]=_0x1edfd0[_0x0950('0xb')]||'';this['monitor_format']=_0x1edfd0[_0x0950('0xc')]||'';this[_0x0950('0xd')]=_0x1edfd0['type']||_0x0950('0xe');this[_0x0950('0xf')]=0x0;this[_0x0950('0x10')]=0x0;this[_0x0950('0x11')]=0x0;this[_0x0950('0x12')]=0x0;this['sumDuration']=0x0;this[_0x0950('0x13')]=0x0;this['sumBillable']=0x0;this[_0x0950('0x14')]=0x0;this[_0x0950('0x15')]=0x0;this[_0x0950('0x16')]=0x0;this['available']=0x0;this['acw']=_0x1edfd0['acw']||![];this['acwTimeout']=_0x1edfd0[_0x0950('0x17')]||0xa;this[_0x0950('0x18')]=_0x1edfd0[_0x0950('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this['originated']=0x0;this[_0x0950('0x19')]=0x0;this[_0x0950('0x1a')]=_0x1edfd0[_0x0950('0x1a')]||null;this[_0x0950('0x1b')]=_0x1edfd0[_0x0950('0x1b')]?_0x1edfd0[_0x0950('0x1b')]:null;this[_0x0950('0x1c')]=_0x1edfd0['dialActive'];this['dialMethod']=_0x1edfd0[_0x0950('0x1d')]||_0x0950('0x1e');this[_0x0950('0x1f')]=_0x1edfd0[_0x0950('0x1f')]||0x0;this['dialLimitQueue']=_0x1edfd0[_0x0950('0x20')]||0x0;this[_0x0950('0x21')]=_0x1edfd0[_0x0950('0x21')]||0x1;this[_0x0950('0x22')]=_0x1edfd0[_0x0950('0x22')]||_0x0950('0x23');this[_0x0950('0x24')]=_0x1edfd0['dialPredictiveOptimizationPercentage']||0.03;this[_0x0950('0x25')]=_0x1edfd0[_0x0950('0x25')]||0x258;this['dialOriginateCallerIdName']=_0x1edfd0['dialOriginateCallerIdName']||_0x0950('0x26');this[_0x0950('0x27')]=_0x1edfd0['dialOriginateCallerIdNumber']||_0x0950('0x26');this[_0x0950('0x28')]=_0x1edfd0[_0x0950('0x28')]||0x1e;this[_0x0950('0x29')]=_0x1edfd0[_0x0950('0x29')]||_0x0950('0x2a');this['dialQueueTimeout']=_0x1edfd0[_0x0950('0x2b')]||0x3;this[_0x0950('0x2c')]=_0x1edfd0[_0x0950('0x2c')]||undefined;this[_0x0950('0x2d')]=_0x1edfd0[_0x0950('0x2d')]||0x3;this[_0x0950('0x2e')]=_0x1edfd0[_0x0950('0x2e')]||0x96;this[_0x0950('0x2f')]=_0x1edfd0['dialBusyMaxRetry']||0x3;this[_0x0950('0x30')]=_0x1edfd0[_0x0950('0x30')]||0x96;this['dialNoAnswerMaxRetry']=_0x1edfd0[_0x0950('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1edfd0['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x1edfd0[_0x0950('0x32')]||0x3;this[_0x0950('0x33')]=_0x1edfd0[_0x0950('0x33')]||0x96;this[_0x0950('0x34')]=_0x1edfd0[_0x0950('0x34')]||0x3;this['dialDropRetryFrequency']=_0x1edfd0[_0x0950('0x35')]||0x96;this[_0x0950('0x36')]=_0x1edfd0[_0x0950('0x36')]||0x3;this[_0x0950('0x37')]=_0x1edfd0[_0x0950('0x37')]||0x96;this[_0x0950('0x38')]=_0x1edfd0[_0x0950('0x38')]||0x3;this[_0x0950('0x39')]=_0x1edfd0['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x1edfd0['dialAgentRejectMaxRetry']||0x3;this[_0x0950('0x3a')]=_0x1edfd0['dialAgentRejectRetryFrequency']||0x96;this[_0x0950('0x3b')]=_0x1edfd0[_0x0950('0x3b')]||0x4;this[_0x0950('0x3c')]=_0x1edfd0[_0x0950('0x3c')]?_0x1edfd0[_0x0950('0x3c')]:undefined;this[_0x0950('0x3d')]=_0x1edfd0[_0x0950('0x3d')]?_0x1edfd0[_0x0950('0x3d')]:undefined;this['dialPrefix']=_0x1edfd0[_0x0950('0x3e')]||undefined;this['Interval']=_0x1edfd0[_0x0950('0x3f')]?_0x1edfd0[_0x0950('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x1edfd0[_0x0950('0x40')]||_0x0950('0x41');this[_0x0950('0x42')]=_0x1edfd0[_0x0950('0x42')]||undefined;this['dialCutDigit']=_0x1edfd0['dialCutDigit']||undefined;this[_0x0950('0x43')]=strategy[_0x1edfd0[_0x0950('0x43')]]||'rrmemory';this['queueStatusComplete']=!![];this['dialAMDActive']=_0x1edfd0[_0x0950('0x44')]||![];this[_0x0950('0x45')]=_0x1edfd0[_0x0950('0x45')];this['dialAMDGreeting']=_0x1edfd0[_0x0950('0x46')];this['dialAMDAfterGreetingSilence']=_0x1edfd0[_0x0950('0x47')];this[_0x0950('0x48')]=_0x1edfd0[_0x0950('0x48')];this[_0x0950('0x49')]=_0x1edfd0['dialAMDMinWordLength'];this[_0x0950('0x4a')]=_0x1edfd0[_0x0950('0x4a')];this[_0x0950('0x4b')]=_0x1edfd0[_0x0950('0x4b')];this[_0x0950('0x4c')]=_0x1edfd0['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x1edfd0[_0x0950('0x4d')];this[_0x0950('0x4e')]=0x0;this[_0x0950('0x4f')]=0x0;this[_0x0950('0x50')]=_0x1edfd0[_0x0950('0x50')];this[_0x0950('0x51')]=0x0;this[_0x0950('0x52')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x0950('0x53')]=0x0;this[_0x0950('0x54')]=0x0;this[_0x0950('0x55')]=0x0;this[_0x0950('0x56')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x0950('0x57')]=0x0;this[_0x0950('0x58')]=0x0;this[_0x0950('0x59')]=0x0;this['outboundReCallsDay']=0x0;this[_0x0950('0x5a')]=0x0;this[_0x0950('0x5b')]=undefined;this[_0x0950('0x5c')]=undefined;this[_0x0950('0x5d')]=undefined;this[_0x0950('0x5e')]=1.05;this[_0x0950('0x5f')]=0x0;this[_0x0950('0x60')]=0x0;this[_0x0950('0x61')]=0x0;this[_0x0950('0x62')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x0950('0x63')]=0x0;this[_0x0950('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x0950('0x65')]=_0x1edfd0[_0x0950('0x66')]||0x14;this[_0x0950('0x67')]=_0x1edfd0[_0x0950('0x66')]||0xa;this[_0x0950('0x68')]=0x0;this[_0x0950('0x69')]=0x0;this[_0x0950('0x6a')]=0x1;this[_0x0950('0x6b')]=0x0;this[_0x0950('0x6c')]=0x0;this[_0x0950('0x6d')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x1edfd0[_0x0950('0x6e')]||0x1e;this[_0x0950('0x6f')]=_0x1edfd0[_0x0950('0x6f')]||![];this['dialQueueProject2']=_0x1edfd0['dialQueueProject2']||undefined;this[_0x0950('0x70')]=_0x1edfd0['dialAgiAfterHangupClient']||![];this[_0x0950('0x71')]=_0x1edfd0[_0x0950('0x71')]||![];this[_0x0950('0xc')]=monitorFormat[_0x1edfd0[_0x0950('0xc')]]?monitorFormat[_0x1edfd0[_0x0950('0xc')]]:undefined;this[_0x0950('0x72')]=_0x1edfd0[_0x0950('0x72')]||![];this['mandatoryDispositionPause']=_0x1edfd0[_0x0950('0x73')]?_0x1edfd0[_0x0950('0x73')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x1a22=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','total','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x16605e,_0x419903){var _0x558afd=function(_0x1271f6){while(--_0x1271f6){_0x16605e['push'](_0x16605e['shift']());}};_0x558afd(++_0x419903);}(_0x1a22,0x125));var _0x21a2=function(_0x4e64b7,_0x12f8fa){_0x4e64b7=_0x4e64b7-0x0;var _0x3e9500=_0x1a22[_0x4e64b7];return _0x3e9500;};'use strict';var statusDesc=[_0x21a2('0x0'),_0x21a2('0x1'),'inuse',_0x21a2('0x2'),_0x21a2('0x3'),_0x21a2('0x4'),_0x21a2('0x5'),_0x21a2('0x6'),'onhold'];var monitorFormat={'wav':'wav','wav49':_0x21a2('0x7'),'gsm':_0x21a2('0x8')};var strategy={'rrmemory':_0x21a2('0x9'),'roundrobin':_0x21a2('0xa')};function VoiceQueue(_0x1fe145){this['id']=_0x1fe145['id']||0x0;this['name']=_0x1fe145[_0x21a2('0xb')]||'';this['monitor_format']=_0x1fe145[_0x21a2('0xc')]||'';this[_0x21a2('0xd')]=_0x1fe145[_0x21a2('0xd')]||_0x21a2('0xe');this['waiting']=0x0;this[_0x21a2('0xf')]=0x0;this[_0x21a2('0x10')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x21a2('0x11')]=0x0;this[_0x21a2('0x12')]=0x0;this[_0x21a2('0x13')]=0x0;this[_0x21a2('0x14')]=0x0;this[_0x21a2('0x15')]=0x0;this['available']=0x0;this[_0x21a2('0x16')]=_0x1fe145[_0x21a2('0x16')]||![];this[_0x21a2('0x17')]=_0x1fe145['acwTimeout']||0xa;this[_0x21a2('0x18')]=_0x1fe145[_0x21a2('0x18')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x21a2('0x19')]=0x0;this[_0x21a2('0x1a')]=0x0;this[_0x21a2('0x1b')]=_0x1fe145[_0x21a2('0x1b')]||null;this[_0x21a2('0x1c')]=_0x1fe145[_0x21a2('0x1c')]?_0x1fe145[_0x21a2('0x1c')]:null;this[_0x21a2('0x1d')]=_0x1fe145[_0x21a2('0x1d')];this['dialMethod']=_0x1fe145[_0x21a2('0x1e')]||_0x21a2('0x1f');this[_0x21a2('0x20')]=_0x1fe145[_0x21a2('0x20')]||0x0;this[_0x21a2('0x21')]=_0x1fe145[_0x21a2('0x21')]||0x0;this[_0x21a2('0x22')]=_0x1fe145['dialPowerLevel']||0x1;this[_0x21a2('0x23')]=_0x1fe145[_0x21a2('0x23')]||'dropRate';this[_0x21a2('0x24')]=_0x1fe145[_0x21a2('0x24')]||0.03;this[_0x21a2('0x25')]=_0x1fe145['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x1fe145['dialOriginateCallerIdName']||_0x21a2('0x26');this['dialOriginateCallerIdNumber']=_0x1fe145['dialOriginateCallerIdNumber']||_0x21a2('0x26');this[_0x21a2('0x27')]=_0x1fe145[_0x21a2('0x27')]||0x1e;this[_0x21a2('0x28')]=_0x1fe145['dialQueueOptions']||_0x21a2('0x29');this[_0x21a2('0x2a')]=_0x1fe145[_0x21a2('0x2a')]||0x3;this['dialQueueProject']=_0x1fe145[_0x21a2('0x2b')]||undefined;this[_0x21a2('0x2c')]=_0x1fe145[_0x21a2('0x2c')]||0x3;this[_0x21a2('0x2d')]=_0x1fe145[_0x21a2('0x2d')]||0x96;this[_0x21a2('0x2e')]=_0x1fe145[_0x21a2('0x2e')]||0x3;this[_0x21a2('0x2f')]=_0x1fe145[_0x21a2('0x2f')]||0x96;this['dialNoAnswerMaxRetry']=_0x1fe145['dialNoAnswerMaxRetry']||0x3;this[_0x21a2('0x30')]=_0x1fe145[_0x21a2('0x30')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1fe145['dialNoSuchNumberMaxRetry']||0x3;this[_0x21a2('0x31')]=_0x1fe145[_0x21a2('0x31')]||0x96;this[_0x21a2('0x32')]=_0x1fe145['dialDropMaxRetry']||0x3;this[_0x21a2('0x33')]=_0x1fe145['dialDropRetryFrequency']||0x96;this[_0x21a2('0x34')]=_0x1fe145[_0x21a2('0x34')]||0x3;this['dialAbandonedRetryFrequency']=_0x1fe145[_0x21a2('0x35')]||0x96;this[_0x21a2('0x36')]=_0x1fe145['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x1fe145[_0x21a2('0x37')]||0x96;this[_0x21a2('0x38')]=_0x1fe145[_0x21a2('0x38')]||0x3;this[_0x21a2('0x39')]=_0x1fe145[_0x21a2('0x39')]||0x96;this[_0x21a2('0x3a')]=_0x1fe145['dialGlobalMaxRetry']||0x4;this[_0x21a2('0x3b')]=_0x1fe145[_0x21a2('0x3b')]?_0x1fe145[_0x21a2('0x3b')]:undefined;this[_0x21a2('0x3c')]=_0x1fe145['TrunkBackup']?_0x1fe145[_0x21a2('0x3c')]:undefined;this[_0x21a2('0x3d')]=_0x1fe145['dialPrefix']||undefined;this[_0x21a2('0x3e')]=_0x1fe145['Interval']?_0x1fe145['Interval']:undefined;this['dialOrderByScheduledAt']=_0x1fe145[_0x21a2('0x3f')]||_0x21a2('0x40');this[_0x21a2('0x41')]=_0x1fe145[_0x21a2('0x41')]||undefined;this[_0x21a2('0x42')]=_0x1fe145[_0x21a2('0x42')]||undefined;this[_0x21a2('0x43')]=strategy[_0x1fe145[_0x21a2('0x43')]]||_0x21a2('0x9');this[_0x21a2('0x44')]=!![];this[_0x21a2('0x45')]=_0x1fe145[_0x21a2('0x45')]||![];this[_0x21a2('0x46')]=_0x1fe145[_0x21a2('0x46')];this['dialAMDGreeting']=_0x1fe145[_0x21a2('0x47')];this['dialAMDAfterGreetingSilence']=_0x1fe145['dialAMDAfterGreetingSilence'];this[_0x21a2('0x48')]=_0x1fe145[_0x21a2('0x48')];this[_0x21a2('0x49')]=_0x1fe145[_0x21a2('0x49')];this[_0x21a2('0x4a')]=_0x1fe145[_0x21a2('0x4a')];this[_0x21a2('0x4b')]=_0x1fe145[_0x21a2('0x4b')];this[_0x21a2('0x4c')]=_0x1fe145[_0x21a2('0x4c')];this[_0x21a2('0x4d')]=_0x1fe145[_0x21a2('0x4d')];this[_0x21a2('0x4e')]=0x0;this['pTalking']=0x0;this['timeout']=_0x1fe145['timeout'];this[_0x21a2('0x4f')]=0x0;this[_0x21a2('0x50')]=0x0;this[_0x21a2('0x51')]=0x0;this[_0x21a2('0x52')]=0x0;this[_0x21a2('0x53')]=0x0;this[_0x21a2('0x54')]=0x0;this[_0x21a2('0x55')]=0x0;this[_0x21a2('0x56')]=0x0;this[_0x21a2('0x57')]=0x0;this[_0x21a2('0x58')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x21a2('0x59')]=0x0;this[_0x21a2('0x5a')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x21a2('0x5b')]=undefined;this[_0x21a2('0x5c')]=undefined;this['handlePredictive']=undefined;this[_0x21a2('0x5d')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x21a2('0x5e')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x21a2('0x5f')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x21a2('0x60')]=0x0;this[_0x21a2('0x61')]=0x0;this[_0x21a2('0x62')]=0x0;this[_0x21a2('0x63')]=_0x1fe145[_0x21a2('0x64')]||0x14;this[_0x21a2('0x65')]=_0x1fe145[_0x21a2('0x64')]||0xa;this[_0x21a2('0x66')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x21a2('0x67')]=0x1;this[_0x21a2('0x68')]=0x0;this[_0x21a2('0x69')]=0x0;this[_0x21a2('0x6a')]=0x0;this[_0x21a2('0x6b')]=0x0;this[_0x21a2('0x6c')]=_0x1fe145['dialRecallMeTimeout']||0x1e;this[_0x21a2('0x6d')]=_0x1fe145['dialRecallInQueue']||![];this[_0x21a2('0x6e')]=_0x1fe145['dialQueueProject2']||undefined;this['dialAgiAfterHangupClient']=_0x1fe145[_0x21a2('0x6f')]||![];this['dialAgiAfterHangupAgent']=_0x1fe145[_0x21a2('0x70')]||![];this['monitor_format']=monitorFormat[_0x1fe145[_0x21a2('0xc')]]?monitorFormat[_0x1fe145[_0x21a2('0xc')]]:undefined;this[_0x21a2('0x71')]=_0x1fe145[_0x21a2('0x71')]||![];this[_0x21a2('0x72')]=_0x1fe145[_0x21a2('0x72')]?_0x1fe145[_0x21a2('0x72')]:undefined;}module[_0x21a2('0x73')]=VoiceQueue;
\ No newline at end of file
index b165e6d..5944f0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b82=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x35843c,_0x291a51){var _0x3dfae3=function(_0x1c302c){while(--_0x1c302c){_0x35843c['push'](_0x35843c['shift']());}};_0x3dfae3(++_0x291a51);}(_0x3b82,0x115));var _0x23b8=function(_0x55da99,_0x4a6b0c){_0x55da99=_0x55da99-0x0;var _0x575612=_0x3b82[_0x55da99];return _0x575612;};'use strict';function VtigerAccount(_0x56f90c){this['id']=_0x56f90c['id']||0x0;this[_0x23b8('0x0')]=_0x56f90c[_0x23b8('0x0')]||'';this[_0x23b8('0x1')]=_0x56f90c[_0x23b8('0x1')]||'';this[_0x23b8('0x2')]=_0x56f90c[_0x23b8('0x2')]||'';this[_0x23b8('0x3')]=_0x56f90c[_0x23b8('0x3')]||'';this['serverUrl']=_0x56f90c[_0x23b8('0x4')]||'';this[_0x23b8('0x5')]=_0x56f90c[_0x23b8('0x5')]||{};}module[_0x23b8('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0xcc1c=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0xbdb47b,_0x5a5647){var _0x2182d9=function(_0x4b5f08){while(--_0x4b5f08){_0xbdb47b['push'](_0xbdb47b['shift']());}};_0x2182d9(++_0x5a5647);}(_0xcc1c,0xa3));var _0xccc1=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0xcc1c[_0x256684];return _0x37a0c9;};'use strict';function VtigerAccount(_0x2797db){this['id']=_0x2797db['id']||0x0;this[_0xccc1('0x0')]=_0x2797db[_0xccc1('0x0')]||'';this[_0xccc1('0x1')]=_0x2797db[_0xccc1('0x1')]||'';this[_0xccc1('0x2')]=_0x2797db[_0xccc1('0x2')]||'';this[_0xccc1('0x3')]=_0x2797db[_0xccc1('0x3')]||'';this[_0xccc1('0x4')]=_0x2797db['serverUrl']||'';this[_0xccc1('0x5')]=_0x2797db['Configurations']||{};}module['exports']=VtigerAccount;
\ No newline at end of file
index ebad4be..9b99cb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x875c=['integrationTab','serverUrl','Configurations','name','username','token','remoteUri','authType','type'];(function(_0x3308e1,_0x3a318d){var _0x368941=function(_0x2113b1){while(--_0x2113b1){_0x3308e1['push'](_0x3308e1['shift']());}};_0x368941(++_0x3a318d);}(_0x875c,0x1c5));var _0xc875=function(_0x6d18f7,_0x3af254){_0x6d18f7=_0x6d18f7-0x0;var _0x30dbcb=_0x875c[_0x6d18f7];return _0x30dbcb;};'use strict';function ZendeskAccount(_0x23a90b){this['id']=_0x23a90b['id']||0x0;this[_0xc875('0x0')]=_0x23a90b[_0xc875('0x0')]||'';this['username']=_0x23a90b[_0xc875('0x1')]||'';this['password']=_0x23a90b['password']||'';this['token']=_0x23a90b[_0xc875('0x2')]||'';this[_0xc875('0x3')]=_0x23a90b[_0xc875('0x3')]||'';this[_0xc875('0x4')]=_0x23a90b[_0xc875('0x4')]||'';this[_0xc875('0x5')]=_0x23a90b['type']||_0xc875('0x6');this[_0xc875('0x7')]=_0x23a90b[_0xc875('0x7')]||'';this[_0xc875('0x8')]=_0x23a90b[_0xc875('0x8')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0x4416=['name','username','token','remoteUri','authType','type','integrationTab','Configurations'];(function(_0x4d520d,_0x540526){var _0x5c375b=function(_0x43b0dc){while(--_0x43b0dc){_0x4d520d['push'](_0x4d520d['shift']());}};_0x5c375b(++_0x540526);}(_0x4416,0x1e0));var _0x6441=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4416[_0x46698a];return _0x356db0;};'use strict';function ZendeskAccount(_0xfa4238){this['id']=_0xfa4238['id']||0x0;this[_0x6441('0x0')]=_0xfa4238['name']||'';this[_0x6441('0x1')]=_0xfa4238[_0x6441('0x1')]||'';this['password']=_0xfa4238['password']||'';this[_0x6441('0x2')]=_0xfa4238['token']||'';this[_0x6441('0x3')]=_0xfa4238[_0x6441('0x3')]||'';this[_0x6441('0x4')]=_0xfa4238[_0x6441('0x4')]||'';this[_0x6441('0x5')]=_0xfa4238['type']||_0x6441('0x6');this['serverUrl']=_0xfa4238['serverUrl']||'';this['Configurations']=_0xfa4238[_0x6441('0x7')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index c4b4f5f..105e659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b0=['Configurations','exports','name','description','host','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4dd623,_0x2c29a3){var _0x3e94cb=function(_0x4b2063){while(--_0x4b2063){_0x4dd623['push'](_0x4dd623['shift']());}};_0x3e94cb(++_0x2c29a3);}(_0x62b0,0x106));var _0x062b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62b0[_0x14add3];return _0x4a174f;};'use strict';function ZohoAccount(_0x43be02){this['id']=_0x43be02['id']||0x0;this['name']=_0x43be02[_0x062b('0x0')]||'';this[_0x062b('0x1')]=_0x43be02[_0x062b('0x1')]||'';this[_0x062b('0x2')]=_0x43be02['host']||'';this['zone']=_0x43be02['zone']||'';this[_0x062b('0x3')]=_0x43be02[_0x062b('0x3')]||'';this['clientSecret']=_0x43be02[_0x062b('0x4')]||'';this[_0x062b('0x5')]=_0x43be02[_0x062b('0x5')]||'';this[_0x062b('0x6')]=_0x43be02[_0x062b('0x6')]||'';this[_0x062b('0x7')]=_0x43be02[_0x062b('0x7')]||'';this[_0x062b('0x8')]=_0x43be02[_0x062b('0x8')]||{};}module[_0x062b('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0x9ac2=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x326d35,_0x4f65b3){var _0xd3f8f3=function(_0x1fbbaf){while(--_0x1fbbaf){_0x326d35['push'](_0x326d35['shift']());}};_0xd3f8f3(++_0x4f65b3);}(_0x9ac2,0x9c));var _0x29ac=function(_0x3aef9b,_0x4a52c5){_0x3aef9b=_0x3aef9b-0x0;var _0x5613f9=_0x9ac2[_0x3aef9b];return _0x5613f9;};'use strict';function ZohoAccount(_0x23aef6){this['id']=_0x23aef6['id']||0x0;this['name']=_0x23aef6[_0x29ac('0x0')]||'';this['description']=_0x23aef6[_0x29ac('0x1')]||'';this['host']=_0x23aef6[_0x29ac('0x2')]||'';this[_0x29ac('0x3')]=_0x23aef6[_0x29ac('0x3')]||'';this[_0x29ac('0x4')]=_0x23aef6[_0x29ac('0x4')]||'';this[_0x29ac('0x5')]=_0x23aef6[_0x29ac('0x5')]||'';this[_0x29ac('0x6')]=_0x23aef6[_0x29ac('0x6')]||'';this[_0x29ac('0x7')]=_0x23aef6['code']||'';this[_0x29ac('0x8')]=_0x23aef6['refreshToken']||'';this['Configurations']=_0x23aef6[_0x29ac('0x9')]||{};}module[_0x29ac('0xa')]=ZohoAccount;
\ No newline at end of file
index d47dd7a..121a69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0a1=['util','moment','isNil','string','uniqueid','queue','name','campaigntype','Agent','membername','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xc0a1,0x171));var _0x1c0a=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0xc0a1[_0x4450b1];return _0x399b0b;};'use strict';var util=require(_0x1c0a('0x0'));var _=require('lodash');var moment=require(_0x1c0a('0x1'));function checkNameSurname(_0x50375d,_0x3145c9,_0x3b33e1){var _0x3c49e6='';if(!_[_0x1c0a('0x2')](_0x3145c9)&&_0x1c0a('0x3')===typeof _0x3145c9){_0x3c49e6+=_0x3145c9;}if(!_[_0x1c0a('0x2')](_0x3b33e1)&&_0x1c0a('0x3')===typeof _0x3b33e1){_0x3c49e6+='\x20'+_0x3b33e1;}if(_0x3c49e6!==''){return _0x3c49e6;}return _0x50375d;}function Action(_0x46775f,_0x5bb8c4,_0x1ce60c,_0x57d621,_0x3980d1){this[_0x1c0a('0x4')]=_0x1ce60c||undefined;this['idContact']=_0x46775f['id'];this[_0x1c0a('0x5')]=_0x5bb8c4[_0x1c0a('0x6')];this['type']=_0x5bb8c4['type'];this[_0x1c0a('0x7')]='queue';this['dialAnswer']=![];this['membername']=_['isNil'](_0x46775f[_0x1c0a('0x8')])?undefined:_0x46775f['Agent'][_0x1c0a('0x6')];this['channelAgent']=this[_0x1c0a('0x9')]?util['format'](_0x1c0a('0xa'),this['membername']):_0x57d621||undefined;this[_0x1c0a('0xb')]=checkNameSurname(_0x46775f['Contact'][_0x1c0a('0xc')],_0x46775f['Contact'][_0x1c0a('0xd')],_0x46775f[_0x1c0a('0xe')][_0x1c0a('0xf')]);this[_0x1c0a('0x10')]=_0x46775f[_0x1c0a('0x10')]||![];this[_0x1c0a('0x11')]=_0x46775f[_0x1c0a('0xe')]['phone'];this[_0x1c0a('0x12')]=_0x46775f[_0x1c0a('0x12')];this[_0x1c0a('0x13')]=_0x46775f[_0x1c0a('0x13')]||0x0;this['countcongestionretry']=_0x46775f[_0x1c0a('0x14')]||0x0;this[_0x1c0a('0x15')]=_0x46775f[_0x1c0a('0x15')]||0x0;this[_0x1c0a('0x16')]=(_0x46775f['countbusyretry']||0x0)+(_0x46775f[_0x1c0a('0x14')]||0x0)+(_0x46775f['countnoanswerretry']||0x0)+(_0x46775f[_0x1c0a('0x17')]||0x0)+(_0x46775f[_0x1c0a('0x18')]||0x0)+(_0x46775f[_0x1c0a('0x19')]||0x0)+(_0x46775f[_0x1c0a('0x1a')]||0x0)+(_0x46775f[_0x1c0a('0x1b')]||0x0);this['countnosuchnumberretry']=_0x46775f[_0x1c0a('0x17')]||0x0;this[_0x1c0a('0x18')]=_0x46775f[_0x1c0a('0x18')]||0x0;this['countabandonedretry']=_0x46775f[_0x1c0a('0x19')]||0x0;this[_0x1c0a('0x1a')]=_0x46775f['countmachineretry']||0x0;this['countagentrejectretry']=_0x46775f['countagentrejectretry']||0x0;this[_0x1c0a('0x1c')]=_0x46775f['callback'];this[_0x1c0a('0x1d')]=_0x46775f[_0x1c0a('0x1d')];this['callbackat']=_0x46775f[_0x1c0a('0x1e')];this['recallme']=_0x46775f[_0x1c0a('0x1f')];this[_0x1c0a('0x20')]=_0x46775f[_0x1c0a('0x20')];this[_0x1c0a('0x21')]=_0x46775f[_0x1c0a('0x21')];this[_0x1c0a('0x22')]=_[_0x1c0a('0x2')](_0x46775f[_0x1c0a('0x8')])?_0x46775f[_0x1c0a('0x22')]:_0x46775f[_0x1c0a('0x8')]['id'];this['VoiceQueueId']=_0x46775f[_0x1c0a('0x23')];this['originatecalleridnum']='';this[_0x1c0a('0x24')]='';}Action[_0x1c0a('0x25')][_0x1c0a('0x26')]=function(){return util['format'](_0x1c0a('0x27'),this[_0x1c0a('0xb')],this[_0x1c0a('0x28')]);};module['exports']=Action;
\ No newline at end of file
+var _0x2bd6=['number','exports','util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname'];(function(_0x2a7a5a,_0x1bd020){var _0x33e542=function(_0x45d83e){while(--_0x45d83e){_0x2a7a5a['push'](_0x2a7a5a['shift']());}};_0x33e542(++_0x1bd020);}(_0x2bd6,0x18e));var _0x62bd=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0x2bd6[_0x56daff];return _0x132c82;};'use strict';var util=require(_0x62bd('0x0'));var _=require('lodash');var moment=require(_0x62bd('0x1'));function checkNameSurname(_0x10d48c,_0x3ddc3f,_0x3241e0){var _0x1a305d='';if(!_[_0x62bd('0x2')](_0x3ddc3f)&&_0x62bd('0x3')===typeof _0x3ddc3f){_0x1a305d+=_0x3ddc3f;}if(!_['isNil'](_0x3241e0)&&_0x62bd('0x3')===typeof _0x3241e0){_0x1a305d+='\x20'+_0x3241e0;}if(_0x1a305d!==''){return _0x1a305d;}return _0x10d48c;}function Action(_0x676c8,_0x3cbe42,_0x10d947,_0x1bafb7,_0x171039){this[_0x62bd('0x4')]=_0x10d947||undefined;this['idContact']=_0x676c8['id'];this[_0x62bd('0x5')]=_0x3cbe42[_0x62bd('0x6')];this[_0x62bd('0x7')]=_0x3cbe42['type'];this[_0x62bd('0x8')]=_0x62bd('0x5');this[_0x62bd('0x9')]=![];this[_0x62bd('0xa')]=_[_0x62bd('0x2')](_0x676c8[_0x62bd('0xb')])?undefined:_0x676c8[_0x62bd('0xb')][_0x62bd('0x6')];this[_0x62bd('0xc')]=this[_0x62bd('0xa')]?util[_0x62bd('0xd')](_0x62bd('0xe'),this[_0x62bd('0xa')]):_0x1bafb7||undefined;this['calleridname']=checkNameSurname(_0x676c8[_0x62bd('0xf')][_0x62bd('0x10')],_0x676c8[_0x62bd('0xf')][_0x62bd('0x11')],_0x676c8['Contact']['lastName']);this[_0x62bd('0x12')]=_0x676c8['active']||![];this[_0x62bd('0x13')]=_0x676c8['Contact'][_0x62bd('0x10')];this[_0x62bd('0x14')]=_0x676c8[_0x62bd('0x14')];this['countbusyretry']=_0x676c8[_0x62bd('0x15')]||0x0;this[_0x62bd('0x16')]=_0x676c8[_0x62bd('0x16')]||0x0;this[_0x62bd('0x17')]=_0x676c8[_0x62bd('0x17')]||0x0;this[_0x62bd('0x18')]=(_0x676c8['countbusyretry']||0x0)+(_0x676c8[_0x62bd('0x16')]||0x0)+(_0x676c8[_0x62bd('0x17')]||0x0)+(_0x676c8[_0x62bd('0x19')]||0x0)+(_0x676c8[_0x62bd('0x1a')]||0x0)+(_0x676c8['countabandonedretry']||0x0)+(_0x676c8['countmachineretry']||0x0)+(_0x676c8[_0x62bd('0x1b')]||0x0);this[_0x62bd('0x19')]=_0x676c8[_0x62bd('0x19')]||0x0;this[_0x62bd('0x1a')]=_0x676c8[_0x62bd('0x1a')]||0x0;this[_0x62bd('0x1c')]=_0x676c8[_0x62bd('0x1c')]||0x0;this['countmachineretry']=_0x676c8[_0x62bd('0x1d')]||0x0;this[_0x62bd('0x1b')]=_0x676c8['countagentrejectretry']||0x0;this[_0x62bd('0x1e')]=_0x676c8[_0x62bd('0x1e')];this['callbackuniqueid']=_0x676c8['callbackuniqueid'];this[_0x62bd('0x1f')]=_0x676c8[_0x62bd('0x1f')];this[_0x62bd('0x20')]=_0x676c8[_0x62bd('0x20')];this[_0x62bd('0x21')]=_0x676c8[_0x62bd('0x21')];this[_0x62bd('0x22')]=_0x676c8[_0x62bd('0x22')];this[_0x62bd('0x23')]=_['isNil'](_0x676c8[_0x62bd('0xb')])?_0x676c8[_0x62bd('0x23')]:_0x676c8[_0x62bd('0xb')]['id'];this[_0x62bd('0x24')]=_0x676c8[_0x62bd('0x24')];this[_0x62bd('0x25')]='';this[_0x62bd('0x26')]='';}Action['prototype'][_0x62bd('0x27')]=function(){return util[_0x62bd('0xd')](_0x62bd('0x28'),this[_0x62bd('0x29')],this[_0x62bd('0x2a')]);};module[_0x62bd('0x2b')]=Action;
\ No newline at end of file
index 27480bd..102ed86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f26=['accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','[syncVarSet][Preview]','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','recallMe','clearZombieChannel','sequence','enqueue','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','pTalking','pick','contactId','UserId','VoiceQueueId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[action]','getContactRecallMe','agentReadyId','length','getDiff','dialRecallMeTimeout','Agent','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','totalGlobal','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','activeContact','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','execRun','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','Queue','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','phone','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect'];(function(_0x1c852c,_0x113e2d){var _0x5037f4=function(_0x1b93d1){while(--_0x1b93d1){_0x1c852c['push'](_0x1c852c['shift']());}};_0x5037f4(++_0x113e2d);}(_0x0f26,0x189));var _0x60f2=function(_0x268cd1,_0x46fe2d){_0x268cd1=_0x268cd1-0x0;var _0x7066cd=_0x0f26[_0x268cd1];return _0x7066cd;};'use strict';var util=require(_0x60f2('0x0'));var _=require(_0x60f2('0x1'));var BPromise=require(_0x60f2('0x2'));var uuid=require(_0x60f2('0x3'));var moment=require(_0x60f2('0x4'));var md5=require(_0x60f2('0x5'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x60f2('0x6'));var loggerAction=require(_0x60f2('0x7'))(_0x60f2('0x8'));var ami=require(_0x60f2('0x9'));var rpcDb=require(_0x60f2('0xa'));var Action=require(_0x60f2('0xb'));var ut=require(_0x60f2('0xc'));config[_0x60f2('0xd')]=_[_0x60f2('0xe')](config[_0x60f2('0xd')],{'host':_0x60f2('0xf'),'port':0x18eb});var io=require(_0x60f2('0x10'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x51789a){this[_0x60f2('0x11')]=this['tail']?this[_0x60f2('0x11')][_0x60f2('0x12')](_0x51789a):_0x51789a();};function Preview(_0x4c47b1){this['sequence']=new Sequence();this[_0x60f2('0x13')]=_0x4c47b1[_0x60f2('0x14')];this['trunks']=_0x4c47b1[_0x60f2('0x15')];this[_0x60f2('0x16')]={};this[_0x60f2('0x17')]=_0x4c47b1['agents'];this[_0x60f2('0x18')]=0x0;ami['on'](_0x60f2('0x19'),this[_0x60f2('0x1a')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x1c'),this[_0x60f2('0x1d')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x1e'),this[_0x60f2('0x1f')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x20'),this[_0x60f2('0x21')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x22'),this['syncNewExten'][_0x60f2('0x1b')](this));ami['on']('varset',this[_0x60f2('0x23')]['bind'](this));ami['on']('attendedtransfer',this[_0x60f2('0x24')][_0x60f2('0x1b')](this));ami['on'](_0x60f2('0x25'),this['syncBlindTransfer'][_0x60f2('0x1b')](this));this[_0x60f2('0x26')](this[_0x60f2('0x13')]);}function emit(_0x2f2322,_0xcea69f,_0x8fe337){io['to'](_0x2f2322)[_0x60f2('0x27')](_0xcea69f,_0x8fe337);}function emitCampaignPreview(_0x32327a){if(_0x32327a[_0x60f2('0x28')]==='outbound'){var _0x248abb={'id':_0x32327a['id'],'name':_0x32327a['name'],'strategy':_0x32327a[_0x60f2('0x29')],'answered':_0x32327a[_0x60f2('0x2a')],'available':_0x32327a[_0x60f2('0x2b')],'loggedIn':_0x32327a[_0x60f2('0x2c')],'pTalking':_0x32327a['pTalking'],'sumBillable':_0x32327a[_0x60f2('0x2d')],'sumDuration':_0x32327a[_0x60f2('0x2e')],'sumHoldTime':_0x32327a[_0x60f2('0x2f')]||0x0,'talking':_0x32327a[_0x60f2('0x30')],'total':_0x32327a[_0x60f2('0x31')],'type':_0x32327a[_0x60f2('0x28')],'unmanaged':_0x32327a[_0x60f2('0x32')],'abandoned':_0x32327a[_0x60f2('0x33')],'waiting':_0x32327a[_0x60f2('0x34')],'loggedInDb':_0x32327a[_0x60f2('0x35')],'dialActive':_0x32327a[_0x60f2('0x36')],'dialMethod':_0x32327a[_0x60f2('0x37')],'dialOriginateCallerIdName':_0x32327a[_0x60f2('0x38')],'dialOriginateCallerIdNumber':_0x32327a[_0x60f2('0x39')],'dialOriginateTimeout':_0x32327a['dialOriginateTimeout'],'dialPrefix':_0x32327a[_0x60f2('0x3a')],'outboundAnswerAgiCallsDay':_0x32327a[_0x60f2('0x3b')],'outboundAnswerCallsDay':_0x32327a['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x32327a[_0x60f2('0x3c')],'outboundBusyCallsDay':_0x32327a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x32327a[_0x60f2('0x3d')],'outboundDropCallsDayACS':_0x32327a[_0x60f2('0x3e')],'outboundDropCallsDayCallersExit':_0x32327a[_0x60f2('0x3f')],'outboundDropCallsDayTimeout':_0x32327a[_0x60f2('0x40')],'outboundNoAnswerCallsDay':_0x32327a[_0x60f2('0x41')],'outboundNoSuchCallsDay':_0x32327a[_0x60f2('0x42')],'outboundOriginateFailureCallsDay':_0x32327a[_0x60f2('0x43')],'outboundReCallsDay':_0x32327a[_0x60f2('0x44')],'outboundRejectCallsDay':_0x32327a[_0x60f2('0x45')],'outboundUnknownCallsDay':_0x32327a[_0x60f2('0x46')],'outboundAbandonedCallsDay':_0x32327a[_0x60f2('0x47')],'predictiveIntervalAnsweredCalls':_0x32327a[_0x60f2('0x48')],'predictiveIntervalAvgHoldtime':_0x32327a[_0x60f2('0x49')],'predictiveIntervalAvgTalktime':_0x32327a[_0x60f2('0x4a')],'predictiveIntervalDroppedCallsCallersExit':_0x32327a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x32327a[_0x60f2('0x4b')],'predictiveIntervalErlangCalls':_0x32327a[_0x60f2('0x4c')],'predictiveIntervalErlangCallsDroppedCalls':_0x32327a[_0x60f2('0x4d')],'predictiveIntervalHitRate':_0x32327a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x32327a[_0x60f2('0x4e')],'predictiveIntervalPauses':_0x32327a[_0x60f2('0x4f')],'predictiveIntervalAvailable':_0x32327a[_0x60f2('0x50')],'predictiveIntervalTotalCalls':_0x32327a[_0x60f2('0x51')],'message':_0x32327a[_0x60f2('0x52')],'originated':_0x32327a[_0x60f2('0x53')],'erlangCalls':_0x32327a[_0x60f2('0x54')],'erlangCallToSecond':_0x32327a['erlangCallToSecond'],'erlangAbandonmentRate':_0x32327a['erlangAbandonmentRate'],'erlangBusyFactor':_0x32327a[_0x60f2('0x55')],'startPredictive':_0x32327a[_0x60f2('0x56')],'startProgressive':_0x32327a[_0x60f2('0x57')]};if(_0x32327a[_0x60f2('0x58')]){_0x248abb['Trunk']={'id':_0x32327a[_0x60f2('0x58')]['id'],'name':_0x32327a['Trunk'][_0x60f2('0x59')],'active':_0x32327a[_0x60f2('0x58')][_0x60f2('0x5a')],'callerid':_0x32327a[_0x60f2('0x58')][_0x60f2('0x5b')]};}if(_0x32327a[_0x60f2('0x5c')]){_0x248abb['Interval']={'id':_0x32327a['Interval']['id'],'name':_0x32327a[_0x60f2('0x5c')][_0x60f2('0x59')]};}var _0x19d5dd=md5(JSON[_0x60f2('0x5d')](_0x248abb));if(_0x32327a[_0x60f2('0x5')]!==_0x19d5dd){_0x32327a[_0x60f2('0x5')]=_0x19d5dd;emit(util[_0x60f2('0x5e')](_0x60f2('0x5f'),_0x248abb[_0x60f2('0x59')]),_0x60f2('0x60'),_0x248abb);}}}function emitVoiceQueueChannelRemove(_0x8e2d68){logger[_0x60f2('0x61')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x60f2('0x5d')](_0x8e2d68));emit(util[_0x60f2('0x5e')](_0x60f2('0x5f'),_0x8e2d68[_0x60f2('0x59')]),_0x60f2('0x62'),_0x8e2d68);io['emit'](_0x60f2('0x63'),_0x8e2d68);}function notSendMessagesQueue(_0x4beee3){if(_0x4beee3['sendMessageOneNotActive']){if(_0x4beee3[_0x60f2('0x53')]===0x0&&_0x4beee3['pTalking']===0x0){_0x4beee3[_0x60f2('0x64')]=![];_0x4beee3[_0x60f2('0x2b')]=0x0;_0x4beee3[_0x60f2('0x65')]=0x0;_0x4beee3[_0x60f2('0x52')]=_0x60f2('0x66');ut[_0x60f2('0x67')](_0x60f2('0x68'),_0x4beee3[_0x60f2('0x59')]+_0x60f2('0x69'));}else{_0x4beee3[_0x60f2('0x52')]=_0x60f2('0x6a');ut['logger'](_0x60f2('0x68'),_0x4beee3[_0x60f2('0x59')]+_0x60f2('0x6b'));}emitCampaignPreview(_0x4beee3);}}Preview[_0x60f2('0x6c')][_0x60f2('0x26')]=function(){var _0x16e9f4=this;setInterval(function(){_0x16e9f4[_0x60f2('0x6d')]();},0x7cf);};Preview[_0x60f2('0x6c')][_0x60f2('0x6d')]=function(){var _0x274c79=this[_0x60f2('0x13')];this[_0x60f2('0x18')]+=0x1;for(var _0xbe30ee in _0x274c79){if(_0x274c79[_0x60f2('0x6e')](_0xbe30ee)&&(_0x274c79[_0xbe30ee]['dialMethod']===_0x60f2('0x6')||_0x274c79[_0xbe30ee][_0x60f2('0x37')]===_0x60f2('0x6f'))&&_0x274c79[_0xbe30ee][_0x60f2('0x28')]===_0x60f2('0x70')){if(this[_0x60f2('0x18')]>0x7){this[_0x60f2('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x274c79['hasOwnProperty'](_0xbe30ee)&&_0x274c79[_0xbe30ee][_0x60f2('0x37')]==='preview'&&_0x274c79[_0xbe30ee][_0x60f2('0x28')]===_0x60f2('0x70')){if(_0x274c79[_0xbe30ee]['dialActive']){this[_0x60f2('0x71')](_0x274c79[_0xbe30ee]);this[_0x60f2('0x72')](_0x274c79[_0xbe30ee]);}else{notSendMessagesQueue(_0x274c79[_0xbe30ee]);}}}};Preview[_0x60f2('0x6c')][_0x60f2('0x73')]=function(_0x1f435b){var _0x16ff58=this;this[_0x60f2('0x74')][_0x60f2('0x75')](function(){if(!_[_0x60f2('0x76')](_0x16ff58[_0x60f2('0x16')][_0x1f435b])){loggerAction[_0x60f2('0x61')](_0x60f2('0x77'),_0x1f435b,'Queue',_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')],_0x60f2('0x79'),JSON[_0x60f2('0x5d')](_0x16ff58[_0x60f2('0x13')][_0x16ff58[_0x60f2('0x16')][_0x1f435b]['queue']][_0x60f2('0x53')]),_0x60f2('0x7a'),JSON['stringify'](_0x16ff58[_0x60f2('0x13')][_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')]][_0x60f2('0x7b')]),JSON[_0x60f2('0x5d')](_0x16ff58['actions'][_0x1f435b]['dialAnswer']),JSON[_0x60f2('0x5d')](_[_0x60f2('0x7c')](_0x16ff58[_0x60f2('0x16')][_0x1f435b],[_0x60f2('0x7d'),_0x60f2('0x7e'),_0x60f2('0x7f'),_0x60f2('0x80')])));return ami[_0x60f2('0x81')]({'action':'status','channel':_0x16ff58[_0x60f2('0x16')][_0x1f435b]['channel']})[_0x60f2('0x82')](function(_0x2e85b9){if(_0x2e85b9['message']===_0x60f2('0x83')){setTimeout(function(){if(_0x16ff58['actions'][_0x1f435b]){ut[_0x60f2('0x84')](_0x16ff58[_0x60f2('0x13')][_0x16ff58['actions'][_0x1f435b][_0x60f2('0x78')]],_0x60f2('0x85'));if(_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x86')]===!![]){ut['decrementTalkink'](_0x16ff58[_0x60f2('0x13')][_0x16ff58['actions'][_0x1f435b][_0x60f2('0x78')]],_0x60f2('0x85'));ut[_0x60f2('0x87')]('[Dialer][checkChannel][pTalking][Preview]'+_0x1f435b,_0x16ff58[_0x60f2('0x16')][_0x1f435b]['queue']);}ut[_0x60f2('0x87')]('[Dialer][checkChannel][Preview]'+_0x1f435b,_0x16ff58[_0x60f2('0x16')][_0x1f435b][_0x60f2('0x78')]);delete _0x16ff58[_0x60f2('0x16')][_0x1f435b];}},0x2328);}});}});};Preview[_0x60f2('0x6c')]['clearZombieChannels']=function(){var _0x497b37=this;loggerAction[_0x60f2('0x61')](_0x60f2('0x88'),_['size'](this['actions']));for(var _0x3c6580 in this['actions']){if(_0x497b37[_0x60f2('0x16')][_0x60f2('0x6e')](_0x3c6580)){_0x497b37[_0x60f2('0x73')](_0x3c6580);}}};Preview[_0x60f2('0x6c')][_0x60f2('0x72')]=function(_0x4df0e5){var _0x2009e7=this;rpcDb[_0x60f2('0x89')](_0x4df0e5['id'],ut[_0x60f2('0x8a')](this[_0x60f2('0x17')]))['then'](function(_0x132842){if(!_['isNil'](_0x132842)){for(var _0xcc9168=0x0;_0xcc9168<_0x132842[_0x60f2('0x8b')];_0xcc9168+=0x1){if(ut[_0x60f2('0x8c')](_0x132842[_0xcc9168]['scheduledat'])<_0x4df0e5[_0x60f2('0x8d')]*0x3c){if(_0x132842[_0xcc9168]['Agent']&&!_0x132842[_0xcc9168][_0x60f2('0x8e')]['voicePause']){_0x2009e7['run'](_0x132842[_0xcc9168]['id'])['then'](ut['logger2'](_0x60f2('0x8f')))[_0x60f2('0x82')](ut[_0x60f2('0x90')](_0x60f2('0x8f')));}else{rpcDb[_0x60f2('0x91')](_0x132842[_0xcc9168]['id']);}}else{var _0x29b86c=new Action(_0x132842[_0xcc9168],_0x4df0e5);_0x29b86c[_0x60f2('0x92')]=moment()[_0x60f2('0x5e')](_0x60f2('0x93'));_0x4df0e5[_0x60f2('0x44')]+=0x1;ut[_0x60f2('0x94')](_0x29b86c,0x17,_0x60f2('0x95'));if(_0x4df0e5['dialRecallInQueue']){rpcDb[_0x60f2('0x96')](ut[_0x60f2('0x97')](_0x132842[_0xcc9168]));rpcDb[_0x60f2('0x98')](_0x29b86c,_0x60f2('0x99'));}else{ut[_0x60f2('0x94')](_0x29b86c,0x16,_0x60f2('0x9a'));rpcDb[_0x60f2('0x98')](_0x29b86c,_0x60f2('0x9b'));rpcDb[_0x60f2('0x9c')](_0x29b86c,_0x60f2('0x9b'));}}}}})[_0x60f2('0x82')](ut[_0x60f2('0x90')]('[getContactRecallMe]'));};Preview[_0x60f2('0x6c')][_0x60f2('0x71')]=function(_0x57c8e5){_0x57c8e5['sendMessageOneNotActive']=!![];if(ut[_0x60f2('0x9d')](_0x57c8e5[_0x60f2('0x2c')])){_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0x9e');}else if(!ut[_0x60f2('0x9f')](_0x57c8e5[_0x60f2('0x36')])){_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0x66');}else if(!this['isTrunkReachable'](_0x57c8e5[_0x60f2('0x58')])){if(!this[_0x60f2('0xa0')](_0x57c8e5[_0x60f2('0xa1')])){_0x57c8e5[_0x60f2('0x52')]='TRUNK_IS_NOT_REACHABLE';}else{_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0xa2');}}else{_0x57c8e5[_0x60f2('0x52')]=_0x60f2('0xa2');}emitCampaignPreview(_0x57c8e5);};Preview[_0x60f2('0x6c')]['callProgressDetectingCustomer']=function(_0xb87285,_0xd44361,_0x59a2f6){var _0x37d1b4=this;var _0x58108c=this[_0x60f2('0x16')][_0xd44361];var _0x57eb76=this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]];var _0x5f57d1;if(_0x57eb76){switch(_0x59a2f6){case'1':_0x57eb76['outboundNoSuchCallsDay']+=0x1;_0x58108c['countnosuchnumberretry']+=0x1;_0x58108c[_0x60f2('0xa3')]=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x0,_0x60f2('0xa4'));ami['emit'](_0x60f2('0xa5'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xa7')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xa8'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xac'));}else{if(_0x58108c[_0x60f2('0xad')]>=_0x57eb76[_0x60f2('0xae')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xac'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x58108c,_0x60f2('0xad'),_0x57eb76[_0x60f2('0xaf')]),_0x58108c[_0x60f2('0xb0')],_0x58108c['activeContact']);}}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;case _0x60f2('0xb2'):var _0x85ab94=moment()['format'](_0x60f2('0x93'));_0x58108c[_0x60f2('0xb3')]=_0x85ab94;_0x58108c['answertime']=_0x85ab94;_0x58108c['dialAnswer']=!![];_0x57eb76[_0x60f2('0x7b')]+=0x1;logger['info'](_0x60f2('0xb4'),_0x58108c[_0x60f2('0xb5')],'\x20Queue',_0x57eb76[_0x60f2('0x59')],'pTalking:\x20',_0x57eb76[_0x60f2('0x7b')]);ami[_0x60f2('0x27')](_0x60f2('0xb6'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xb7'),this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]]));if(_0x57eb76[_0x60f2('0xb8')]){ami[_0x60f2('0x27')](_0x60f2('0xb9'),ut[_0x60f2('0xba')](_0x58108c));}break;case'16':ami[_0x60f2('0x27')](_0x60f2('0xbb'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xbc'),this[_0x60f2('0x13')][_0x58108c[_0x60f2('0x78')]]));emitVoiceQueueChannelRemove(ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xbc')));_0x57eb76[_0x60f2('0xbd')]+=0x1;_0x57eb76[_0x60f2('0x31')]+=0x1;_0x57eb76['answered']+=0x1;ut['decrementTalkink'](_0x57eb76,_0x60f2('0xbe'));_0x58108c['countglobal']=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x4,'Answer');rpcDb['createCustomerHistory'](_0x58108c,_0x60f2('0xbf'));rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xc0'));rpcDb['crateCustomerReportQueue'](_0x58108c);_0x57eb76[_0x60f2('0x2e')]+=_0x58108c['talktime'];_0x57eb76[_0x60f2('0x2d')]+=_0x58108c[_0x60f2('0xc1')];logger[_0x60f2('0x61')](_0x60f2('0xc2'),_0x58108c[_0x60f2('0xb5')],_0x60f2('0xc3'),_0x57eb76[_0x60f2('0x59')],_0x60f2('0x7a'),_0x57eb76[_0x60f2('0x7b')]);delete this[_0x60f2('0x16')][_0xb87285['linkedid']];break;case'BUSY':_0x57eb76[_0x60f2('0xc4')]+=0x1;_0x58108c[_0x60f2('0xc5')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x5,'Busy');ami[_0x60f2('0x27')](_0x60f2('0xc7'),ut[_0x60f2('0xa6')](_0x58108c,'busy'));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb['createCustomerFinal'](_0x5f57d1,_0x60f2('0xc8'));}else{if(_0x58108c[_0x60f2('0xc5')]>=_0x57eb76[_0x60f2('0xc9')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xca'));}else{rpcDb['rescheduleContact'](ut[_0x60f2('0xcb')](_0x58108c,'countbusyretry',_0x57eb76[_0x60f2('0xcc')]),_0x58108c['unlockAgent'],_0x58108c[_0x60f2('0xcd')]);}}break;case'NOANSWER':_0x57eb76[_0x60f2('0x41')]+=0x1;_0x58108c[_0x60f2('0xce')]+=0x1;_0x58108c['countglobal']=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x3,_0x60f2('0xcf'));ami['emit'](_0x60f2('0xd0'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xd1')));rpcDb['createCustomerHistory'](_0x58108c,_0x60f2('0xd2'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,'Global');rpcDb['createCustomerFinal'](_0x5f57d1,_0x60f2('0xd3'));}else{if(_0x58108c[_0x60f2('0xce')]>=_0x57eb76[_0x60f2('0xd4')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xd2'));}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xce'),_0x57eb76[_0x60f2('0xd6')]),_0x58108c['unlockAgent'],_0x58108c[_0x60f2('0xcd')]);}}break;case _0x60f2('0xd7'):_0x57eb76[_0x60f2('0x3d')]+=0x1;_0x58108c[_0x60f2('0xd8')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x8,_0x60f2('0xd9'));ami['emit'](_0x60f2('0xda'),ut['buildObj'](_0x58108c,_0x60f2('0xdb')));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x58108c)>=_0x57eb76['dialGlobalMaxRetry']){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x58108c['countcongestionretry']>=_0x57eb76[_0x60f2('0xdc')]){rpcDb['createCustomerFinal'](_0x58108c,_0x60f2('0xdd'));}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xd8'),_0x57eb76['dialBusyRetryFrequency']),_0x58108c[_0x60f2('0xb0')],_0x58108c['activeContact']);}}break;case _0x60f2('0xde'):_0x57eb76[_0x60f2('0x45')]+=0x1;_0x58108c[_0x60f2('0xdf')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x14,_0x60f2('0xe0'));ami['emit'](_0x60f2('0xe1'),ut[_0x60f2('0xa6')](_0x58108c,_0x60f2('0xe2')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xe3'));if(ut['totalGlobal'](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut['cloneAction'](_0x58108c,0x14,_0x60f2('0xe0'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xe4'));}else{if(_0x58108c['countagentrejectretry']>=_0x57eb76['dialAgentRejectMaxRetry']){rpcDb[_0x60f2('0x9c')](_0x58108c,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x60f2('0xd5')](ut[_0x60f2('0xcb')](_0x58108c,_0x60f2('0xdf'),_0x57eb76[_0x60f2('0xe5')]),_0x58108c[_0x60f2('0xb0')],_0x58108c[_0x60f2('0xcd')]);}}break;case _0x60f2('0xe6'):_0x57eb76[_0x60f2('0x47')]+=0x1;_0x58108c['countabandonedretry']+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0xb,_0x60f2('0xe7'));rpcDb[_0x60f2('0x98')](_0x58108c,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x58108c[_0x60f2('0xe8')]>=_0x57eb76[_0x60f2('0xe9')]){rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xea'));}else{rpcDb[_0x60f2('0xd5')](ut['scheduledAt'](_0x58108c,_0x60f2('0xeb'),_0x57eb76[_0x60f2('0xec')]),_0x58108c[_0x60f2('0xb0')],_0x58108c[_0x60f2('0xcd')]);}}break;case'18':_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c[_0x60f2('0xed')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x12,_0xb87285[_0x60f2('0xee')]||_0xb87285[_0x60f2('0xef')]);ami['emit']('custom:amd',ut['buildObj'](_0x58108c,_0x60f2('0xf0')));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf1'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf1'));}else{rpcDb[_0x60f2('0x9c')](_0x58108c,_0x60f2('0xf1'));}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;case'19':_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c['countglobal']=ut['totalGlobal'](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0x13,_0xb87285['cause-txt']||_0xb87285[_0x60f2('0xef')]);ami['emit'](_0x60f2('0xf2'),ut['buildObj'](_0x58108c,'amd'));rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf3'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76[_0x60f2('0xa9')]){_0x5f57d1=ut[_0x60f2('0xaa')](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf3'));}else{rpcDb['createCustomerFinal'](_0x58108c,'[callProgressDetectingCustomer][machine]');}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];break;default:if(_0x58108c['dialAnswer']){ut[_0x60f2('0xf4')](_0x57eb76,_0x60f2('0xf5'));ut[_0x60f2('0x87')](_0x60f2('0xf6')+_0x57eb76[_0x60f2('0x59')],_0xb87285);}_0x57eb76[_0x60f2('0x46')]+=0x1;_0x58108c[_0x60f2('0xa3')]=ut[_0x60f2('0xc6')](_0x58108c);ut[_0x60f2('0x94')](_0x58108c,0xc,_0xb87285[_0x60f2('0xee')]||_0xb87285[_0x60f2('0xef')]);rpcDb[_0x60f2('0x98')](_0x58108c,_0x60f2('0xf7'));if(ut[_0x60f2('0xc6')](_0x58108c)>=_0x57eb76['dialGlobalMaxRetry']){_0x5f57d1=ut['cloneAction'](_0x58108c,0xf,_0x60f2('0xab'));rpcDb[_0x60f2('0x9c')](_0x5f57d1,_0x60f2('0xf8'));}else{rpcDb[_0x60f2('0x9c')](_0x58108c,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xb1')]];}if(!(_0x58108c['dialAnswer']&&_0x59a2f6==='16')){ut[_0x60f2('0x84')](_0x57eb76,'[callProgressDetectingCustomer]');logger[_0x60f2('0x61')]('[originated][decrement][callProgressDetectingCustomer]',_0x58108c[_0x60f2('0xb5')],_0x60f2('0xc3'),_0x57eb76[_0x60f2('0x59')],_0x60f2('0x79'),_0x57eb76[_0x60f2('0x53')]);}if(_0x59a2f6!==_0x60f2('0xb2')){delete this['actions'][_0xb87285['linkedid']];delete this[_0x60f2('0x16')][_0xb87285[_0x60f2('0xf9')]];}}};Preview[_0x60f2('0x6c')][_0x60f2('0xfa')]=function(_0x485ccd,_0x23af57,_0xac6261){if(_[_0x60f2('0xfb')](_0x23af57)&&_0x60f2('0xfc')!==typeof _0x23af57){return;}if(_[_0x60f2('0xfb')](_0xac6261)&&'object'!==typeof _0xac6261){return;}switch(_0xac6261[_0x60f2('0xfd')]){case'0':ut[_0x60f2('0xfe')](_0x485ccd,0x0,_0x60f2('0xa4'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x100'));break;case'3':ut['logAgent'](_0x485ccd,0x3,_0x60f2('0xcf'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x101'));break;case'5':ut[_0x60f2('0xfe')](_0x485ccd,0x5,'Busy');rpcDb[_0x60f2('0xff')](_0x485ccd,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x485ccd,0x8,_0x60f2('0xd9'));rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x102'));break;case'22':ut['logAgent'](_0x485ccd,0x16,'AnswerAGI');rpcDb[_0x60f2('0xff')](_0x485ccd,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x60f2('0xfe')](_0x485ccd,0xc,_0xac6261[_0x60f2('0xfd')]);rpcDb[_0x60f2('0xff')](_0x485ccd,_0x60f2('0x102'));}ut[_0x60f2('0x84')](_0x23af57,_0x60f2('0x103'));logger[_0x60f2('0x61')]('[originated][decrement][callProgressDetectingAgent]',_0x485ccd[_0x60f2('0xb5')],'\x20Queue',_0x23af57[_0x60f2('0x59')],'originated:\x20',_0x23af57['originated']);delete this[_0x60f2('0x16')][_0x485ccd[_0x60f2('0xb5')]];};Preview['prototype'][_0x60f2('0x104')]=function(_0x5845a9,_0x11a484,_0x289691,_0x7e87c2,_0x18f90d){var _0x992704=this;return new BPromise(function(_0x3314f9,_0x257296){if(_[_0x60f2('0x76')](_0x11a484)||_[_0x60f2('0x76')](_0x11a484[_0x60f2('0x105')])||_['isNil'](_0x11a484[_0x60f2('0x105')]['phone'])||_['isNil'](_0x11a484[_0x60f2('0x7f')])){_0x257296(ut['message'](_0x60f2('0x106'),_0x7e87c2,_0x18f90d));return;}var _0x1f2c3b=uuid['v4']();var _0xa9aa96=_0x992704['campaignsPreview'][_0x11a484['Queue'][_0x60f2('0x59')]];var _0x47e8f4=_0x289691?_0x992704[_0x60f2('0x17')][_0x289691]['id']:undefined;_0x992704[_0x60f2('0x16')][_0x1f2c3b]=new Action(_0x11a484,_0xa9aa96,_0x1f2c3b,_0x289691,_0x47e8f4);var _0x29a48b=_0x992704[_0x60f2('0x16')][_0x1f2c3b];_0x29a48b[_0x60f2('0xb0')]=_0x7e87c2;_0x29a48b[_0x60f2('0xcd')]=_0x18f90d;_0x29a48b['lookAgent']=_0x289691;if(_[_0x60f2('0x107')](_0x5845a9)){_0x992704[_0x60f2('0x108')](_0x29a48b,_0xa9aa96,_0x11a484,_0x289691)[_0x60f2('0x109')](function(_0x4bc254){logger[_0x60f2('0x61')](_0x60f2('0x10a'),_0x60f2('0x10b')+_0x29a48b['queue']+_0x60f2('0x10c')+_0x29a48b[_0x60f2('0x10d')],JSON[_0x60f2('0x5d')](_0x4bc254));ami[_0x60f2('0x27')](_0x60f2('0x10e'),ut[_0x60f2('0xa6')](_0x29a48b,_0x60f2('0x10f'),_0x992704[_0x60f2('0x13')][_0x29a48b['queue']]));_0x3314f9(ut[_0x60f2('0x52')]('Calling'));})[_0x60f2('0x82')](function(_0x36f40f){ut[_0x60f2('0x67')](_0x60f2('0x110'),_0x36f40f);_0x257296(ut[_0x60f2('0x52')]('Call\x20failed',_0x7e87c2,_0x18f90d));});}else{_0xa9aa96[_0x60f2('0x3c')]+=0x1;ut[_0x60f2('0x111')](_0x29a48b);rpcDb['createHistory'](_0x29a48b,_0x60f2('0x112'));delete _0x992704[_0x60f2('0x16')][_0x1f2c3b];_0x257296(ut[_0x60f2('0x52')](_0x60f2('0x113'),_0x7e87c2,_0x18f90d));}});};Preview[_0x60f2('0x6c')][_0x60f2('0xa0')]=function(_0x28a53f){return!_[_0x60f2('0x76')](_0x28a53f)&&!_['isNil'](_0x28a53f['name'])&&!_['isNil'](_0x28a53f[_0x60f2('0x5a')])&&_0x28a53f[_0x60f2('0x5a')]&&!_[_0x60f2('0x76')](this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f['name'])])&&!_[_0x60f2('0x76')](this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f[_0x60f2('0x59')])][_0x60f2('0x115')])&&(this[_0x60f2('0x15')][util[_0x60f2('0x5e')](_0x60f2('0x114'),_0x28a53f[_0x60f2('0x59')])]['status']===_0x60f2('0x116')||this[_0x60f2('0x15')][util[_0x60f2('0x5e')]('SIP/%s',_0x28a53f[_0x60f2('0x59')])]['status']==='unmonitored');};Preview[_0x60f2('0x6c')]['run']=function(_0x4d2459,_0xb7e5aa){var _0x4692d1=this;return new BPromise(function(_0x47e03c,_0x1042af){_0x4692d1[_0x60f2('0x117')](_0x4d2459,_0xb7e5aa)[_0x60f2('0x109')](function(_0x11ab40){_0x47e03c(_[_0x60f2('0x7c')](_0x11ab40,['message']));})[_0x60f2('0x82')](function(_0x51f185){if(_0x51f185['unlock']){rpcDb['unlockContact'](_0x4d2459);}if(_0x51f185[_0x60f2('0x5a')]){rpcDb[_0x60f2('0x91')](_0x4d2459);}_0x1042af(_[_0x60f2('0x7c')](_0x51f185,['message']));});});};Preview[_0x60f2('0x6c')][_0x60f2('0x117')]=function(_0x342c77,_0x2943ca){var _0x5633a9=this;return new BPromise(function(_0x54fad8,_0x3eb307){var _0x5a2bcc,_0x11c63c;rpcDb['getContactPreview'](_0x342c77)[_0x60f2('0x109')](function(_0x1b98db){if(!_[_0x60f2('0x76')](_0x1b98db[0x0])){_0x11c63c=_0x1b98db[0x0]['recallme']?![]:!![];_0x5a2bcc=_0x1b98db[0x0][_0x60f2('0x118')]?!![]:![];_0x5a2bcc=_0x2943ca?!![]:_0x5a2bcc;}var _0x3b492c=_0x5633a9[_0x60f2('0x119')](_0x1b98db);if(_0x3b492c['isValid']){rpcDb[_0x60f2('0x11a')](_[_0x60f2('0x7c')](_0x1b98db[0x0],[_0x60f2('0x7f'),'Contact.phone']))[_0x60f2('0x109')](function(_0x4d2ebe){_0x5633a9[_0x60f2('0x104')](_0x4d2ebe,_0x1b98db[0x0],_0x2943ca,_0x11c63c,_0x5a2bcc)[_0x60f2('0x109')](function(_0x51995e){_0x54fad8(_0x51995e);})[_0x60f2('0x82')](function(_0x72c42){_0x3eb307(_0x72c42);});})[_0x60f2('0x82')](function(_0x3956af){ut[_0x60f2('0x67')](_0x60f2('0x11b'),_0x3956af);_0x3eb307(ut['message'](_0x60f2('0x11c'),_0x11c63c,_0x5a2bcc));});}else{_0x3eb307(ut[_0x60f2('0x52')](_0x3b492c[_0x60f2('0x52')],_0x11c63c,_0x5a2bcc));}})[_0x60f2('0x82')](function(_0x325869){ut[_0x60f2('0x67')](_0x60f2('0x11d'),_0x325869);_0x3eb307(ut[_0x60f2('0x52')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x60f2('0x6c')][_0x60f2('0x119')]=function(_0x1d3022){if(_['isNil'](_0x1d3022)||_[_0x60f2('0x107')](_0x1d3022)||!_[_0x60f2('0x76')](_0x1d3022[0x0][_0x60f2('0x8e')])&&_['isNil'](_0x1d3022[0x0]['Agent'][_0x60f2('0x59')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x1d3022);return{'isValid':![],'message':_0x60f2('0x11e')};}var _0xaec6da=this['campaignsPreview'][_0x1d3022[0x0][_0x60f2('0x11f')][_0x60f2('0x59')]];_0xaec6da[_0x60f2('0x52')]=_0x60f2('0xa2');if(_[_0x60f2('0x76')](_0xaec6da)){ut[_0x60f2('0x67')](_0x60f2('0x120'),_0xaec6da);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x60f2('0xa0')](_0xaec6da['Trunk'])){ut[_0x60f2('0x67')](_0x60f2('0x121'),_0x60f2('0x122')+_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x123'));if(!this[_0x60f2('0xa0')](_0xaec6da['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x124'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x60f2('0x9f')](_0xaec6da[_0x60f2('0x36')])){ut['logger'](_0x60f2('0x125'),_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x126'));return{'isValid':![],'message':_0x60f2('0x122')+_0xaec6da[_0x60f2('0x59')]+_0x60f2('0x126')};}return{'isValid':!![],'message':_0x60f2('0x127')};};Preview[_0x60f2('0x6c')]['execCall']=function(_0x23f143,_0x484a50,_0x3623a8,_0x2782f5){var _0x361f48=this;return new BPromise(function(_0x1c0bac,_0x761994){var _0x42714a=_0x23f143[_0x60f2('0xb5')];var _0x480470=_0x361f48[_0x60f2('0xa0')](_0x484a50[_0x60f2('0x58')])?util[_0x60f2('0x5e')]('SIP/%s/%s%s',_0x484a50['Trunk'][_0x60f2('0x59')],_['isNil'](_0x484a50[_0x60f2('0x3a')])?'':_0x484a50['dialPrefix'][_0x60f2('0x128')]()||'',_0x484a50['dialCutDigit']>0x0?_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')][_0x60f2('0x12a')](_0x484a50[_0x60f2('0x12b')]):_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')]):util[_0x60f2('0x5e')](_0x60f2('0x12c'),_[_0x60f2('0x76')](_0x484a50['TrunkBackup'])?_0x484a50['Trunk'][_0x60f2('0x59')]:_0x484a50[_0x60f2('0xa1')]['name'],_[_0x60f2('0x76')](_0x484a50[_0x60f2('0x3a')])?'':_0x484a50['dialPrefix'][_0x60f2('0x128')]()||'',_0x484a50[_0x60f2('0x12b')]>0x0?_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')][_0x60f2('0x12a')](_0x484a50[_0x60f2('0x12b')]):_0x3623a8[_0x60f2('0x105')][_0x60f2('0x129')]);var _0x4388e7=_0x361f48[_0x60f2('0xa0')](_0x484a50[_0x60f2('0x58')])?ut[_0x60f2('0x12d')](_0x484a50[_0x60f2('0x58')]['callerid'],_0x484a50[_0x60f2('0x38')],_0x484a50[_0x60f2('0x12e')]>0x0?ut[_0x60f2('0x12f')](_0x484a50[_0x60f2('0x39')],_0x484a50[_0x60f2('0x12e')]):_0x484a50[_0x60f2('0x39')]):ut[_0x60f2('0x12d')](_[_0x60f2('0x76')](_0x484a50[_0x60f2('0xa1')])?_0x484a50[_0x60f2('0x58')][_0x60f2('0x5b')]:_0x484a50[_0x60f2('0xa1')][_0x60f2('0x5b')],_0x484a50['dialOriginateCallerIdName'],_0x484a50[_0x60f2('0x12e')]>0x0?ut[_0x60f2('0x12f')](_0x484a50[_0x60f2('0x39')],_0x484a50[_0x60f2('0x12e')]):_0x484a50[_0x60f2('0x39')]);if(_0x4388e7){_0x23f143[_0x60f2('0x130')]=ut[_0x60f2('0x131')](_0x4388e7);_0x23f143[_0x60f2('0x132')]=ut[_0x60f2('0x133')](_0x4388e7);}var _0xa4837a=ut[_0x60f2('0x134')](_0x484a50,_0x3623a8,_0x480470,_0x4388e7,_0x42714a,_0x23f143);_['merge'](_0x23f143,ut[_0x60f2('0x135')](_0xa4837a));_0x23f143['starttime']=moment()[_0x60f2('0x5e')](_0x60f2('0x93'));ami[_0x60f2('0x81')](ut[_0x60f2('0x136')](_0x23f143,_0x484a50,_0xa4837a,_0x23f143['activeContact'],_0x2782f5))[_0x60f2('0x109')](function(_0x1ce3f8){var _0x505d9b=_0x23f143[_0x60f2('0x137')];if(!_['isNil'](_0x505d9b)){if(!_[_0x60f2('0x76')](_0x361f48['agents'][_0x505d9b])){_0x361f48['agents'][_0x505d9b][_0x60f2('0x138')]=_0x23f143[_0x60f2('0x139')];emit(util['format']('user:%s',_0x361f48[_0x60f2('0x17')][_0x505d9b]['name']),_0x60f2('0x13a'),{'destaccountcode':_0x361f48[_0x60f2('0x17')][_0x505d9b][_0x60f2('0x13b')],'destconnectedlinenum':_0x23f143[_0x60f2('0x139')]});}}_0x484a50['originated']+=0x1;logger[_0x60f2('0x61')](_0x60f2('0x13c'),_0x42714a,_0x60f2('0xc3'),_0x484a50[_0x60f2('0x59')],_0x60f2('0x79'),_0x484a50['originated']);_0x1c0bac(_0x1ce3f8);})[_0x60f2('0x82')](function(_0x57bd7f){ut[_0x60f2('0xfe')](_0x23f143,0xe,_0x60f2('0x13d'));rpcDb['createAgentHistory'](_0x23f143,_0x60f2('0x13e'));_0x761994(_0x57bd7f);});});};Preview[_0x60f2('0x6c')][_0x60f2('0x13f')]=function(_0x4d7f38){if(this[_0x60f2('0x16')][_0x4d7f38['linkedid']]){this[_0x60f2('0x16')][_0x4d7f38[_0x60f2('0xb1')]][_0x60f2('0x140')]=_0x4d7f38[_0x60f2('0x140')];}};Preview[_0x60f2('0x6c')][_0x60f2('0x1a')]=function(_0x4d002c){var _0x3ccee8=this;var _0x2ce870=this[_0x60f2('0x16')][_0x4d002c[_0x60f2('0x141')]];if(_0x2ce870){if(_0x2ce870[_0x60f2('0x142')]&&this[_0x60f2('0x17')][_0x2ce870['lookAgent']]){ut[_0x60f2('0x143')](_0x2ce870,this[_0x60f2('0x17')][_0x2ce870[_0x60f2('0x142')]][_0x60f2('0x59')],this[_0x60f2('0x17')][_0x2ce870[_0x60f2('0x142')]]['id']);}var _0x170dc1=_[_0x60f2('0x144')](_0x2ce870);_0x170dc1['responsetime']=moment()[_0x60f2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3ef79a=_0x3ccee8[_0x60f2('0x13')][_0x2ce870[_0x60f2('0x78')]];if(ut[_0x60f2('0x145')](_0x4d002c[_0x60f2('0x146')])){if(_0x2ce870['unlockAgent']){rpcDb['unlockContact'](_0x2ce870['idContact']);}if(_0x2ce870[_0x60f2('0xcd')]){rpcDb[_0x60f2('0x91')](_0x2ce870[_0x60f2('0x10d')]);}ami[_0x60f2('0x27')](_0x60f2('0x147'),ut[_0x60f2('0xa6')](_0x2ce870,_0x60f2('0x148'),this['campaignsPreview'][_0x2ce870['queue']]));this['callProgressDetectingAgent'](_0x170dc1,_0x3ef79a,_0x4d002c);}else{_0x2ce870[_0x60f2('0x92')]=moment()['format'](_0x60f2('0x93'));ut[_0x60f2('0xfe')](_0x170dc1,0x4,_0x60f2('0x149'));rpcDb[_0x60f2('0xff')](_0x170dc1,_0x60f2('0x14a'));}}};Preview['prototype'][_0x60f2('0x1d')]=function(_0x5182bd){var _0x58fd46=this;var _0x5442d8=this[_0x60f2('0x16')][_0x5182bd[_0x60f2('0xb1')]];var _0x322ed9;if(_0x5442d8){_0x322ed9=this[_0x60f2('0x13')][_0x5442d8[_0x60f2('0x78')]];logger[_0x60f2('0x61')](_0x60f2('0x14b'),_0x5182bd[_0x60f2('0xb1')],'\x20Queue',_0x322ed9['name'],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);}if(this['actions'][_0x5182bd[_0x60f2('0xb1')]]&&_0x5182bd[_0x60f2('0xb1')]!==_0x5182bd[_0x60f2('0xb5')]){if(_0x5182bd[_0x60f2('0x14c')]==='16'&&this[_0x60f2('0x16')][_0x5182bd[_0x60f2('0xb1')]][_0x60f2('0x86')]){this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}else if(this['actions'][_0x5182bd[_0x60f2('0xb1')]]['dialAnswer']){logger[_0x60f2('0x61')](_0x60f2('0x14e'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],_0x60f2('0xc3'),_0x322ed9[_0x60f2('0x59')],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}}else if(_0x5442d8&&_[_0x60f2('0x76')](_0x5442d8[_0x60f2('0x14f')])&&_0x322ed9[_0x60f2('0x150')]&&_0x5182bd[_0x60f2('0xb1')]===_0x5182bd['uniqueid']&&_['isNil'](_0x5182bd['reason'])&&_0x5182bd[_0x60f2('0x14c')]==='16'&&_0x5182bd[_0x60f2('0x151')]==='6'&&_[_0x60f2('0xfb')](_0x5442d8[_0x60f2('0x152')])){if(_0x5442d8[_0x60f2('0xb0')]){rpcDb[_0x60f2('0x153')](_0x5442d8[_0x60f2('0x10d')]);}if(_0x5442d8[_0x60f2('0xcd')]){rpcDb[_0x60f2('0x91')](_0x5442d8[_0x60f2('0x10d')]);}_0x5182bd[_0x60f2('0xfd')]='22';this[_0x60f2('0xfa')](_0x5442d8,_0x322ed9,_0x5182bd);}else if(_0x5442d8&&_0x5442d8[_0x60f2('0x152')]){if(_0x5182bd[_0x60f2('0x14c')]==='16'&&this['actions'][_0x5182bd[_0x60f2('0xb1')]]['dialAnswer']){logger['info'](_0x60f2('0x154'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],'\x20Queue',_0x322ed9[_0x60f2('0x59')],_0x60f2('0x7a'),_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')]);}else if(this['actions'][_0x5182bd[_0x60f2('0xb1')]][_0x60f2('0x86')]){logger['info'](_0x60f2('0x14e'),_0x5182bd['linkedid'],_0x5182bd[_0x60f2('0x14c')],_0x60f2('0xc3'),_0x322ed9[_0x60f2('0x59')],'pTalking:\x20',_0x322ed9[_0x60f2('0x7b')]);this[_0x60f2('0x14d')](_0x5182bd,_0x5182bd[_0x60f2('0xb1')],_0x5182bd[_0x60f2('0x14c')]);}}};Preview[_0x60f2('0x6c')]['syncDialEnd']=function(_0x565aa5){if(this[_0x60f2('0x16')][_0x565aa5[_0x60f2('0xf9')]]&&_0x565aa5[_0x60f2('0xf9')]!==_0x565aa5[_0x60f2('0x155')]){this[_0x60f2('0x14d')](_0x565aa5,_0x565aa5[_0x60f2('0xf9')],_0x565aa5['dialstatus']);}};Preview[_0x60f2('0x6c')][_0x60f2('0x1f')]=function(_0x301fc2){if(this[_0x60f2('0x16')][_0x301fc2[_0x60f2('0xb1')]]&&_0x301fc2['linkedid']!==_0x301fc2[_0x60f2('0xb5')]&&!this[_0x60f2('0x16')][_0x301fc2[_0x60f2('0xb1')]][_0x60f2('0x86')]){if(_0x301fc2[_0x60f2('0x14c')]==='1'){this['callProgressDetectingCustomer'](_0x301fc2,_0x301fc2[_0x60f2('0xb1')],_0x301fc2[_0x60f2('0x14c')]);}}};Preview[_0x60f2('0x6c')][_0x60f2('0x156')]=function(_0x547903,_0x3ddd64,_0x34ca93){if(this[_0x60f2('0x16')][_0x547903]){if(_[_0x60f2('0x76')](this[_0x60f2('0x16')][_0x547903][_0x60f2('0x157')])){this[_0x60f2('0x16')][_0x547903][_0x60f2('0x157')]={};}this[_0x60f2('0x16')][_0x547903]['variables'][_0x3ddd64]=_0x34ca93;}};Preview[_0x60f2('0x6c')][_0x60f2('0x23')]=function(_0x3b7b59){try{if(!_[_0x60f2('0x76')](_0x3b7b59)){if(ut[_0x60f2('0x158')](_['keys'](_0x3b7b59[_0x60f2('0x159')])[0x0])){this[_0x60f2('0x156')](_0x3b7b59[_0x60f2('0xb5')],_[_0x60f2('0x15a')](_0x3b7b59[_0x60f2('0x159')])[0x0],_0x3b7b59[_0x60f2('0x15b')]);}}}catch(_0x2c952b){logger[_0x60f2('0x15c')](_0x60f2('0x15d'),util['inspect'](_0x2c952b,{'showHidden':![],'depth':null}));}};Preview[_0x60f2('0x6c')]['syncAttendedTransfer']=function(_0x4f2a28){if(_0x4f2a28){if(this[_0x60f2('0x16')][_0x4f2a28['transfertargetlinkedid']]){this[_0x60f2('0x16')][_0x4f2a28[_0x60f2('0x15e')]][_0x60f2('0x152')]=!![];}}};Preview[_0x60f2('0x6c')][_0x60f2('0x15f')]=function(_0x6484c9){if(_0x6484c9){if(this[_0x60f2('0x16')][_0x6484c9[_0x60f2('0x160')]]){this[_0x60f2('0x16')][_0x6484c9['transfererlinkedid']][_0x60f2('0x152')]=!![];}}};module[_0x60f2('0x161')]=Preview;
\ No newline at end of file
+var _0x73a9=['[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','uniqueid','\x20Queue','Busy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','scheduledAt','dialBusyRetryFrequency','activeContact','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','VoiceQueueId','checkInBlack','[Preview][checkIsBlackList]','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','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','merge','toLowerVariables','variablesAction','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originateFailure][logOriginateFailure]','channel','actionid','clone','responsetime','isFailure','idContact','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','attendedtransfer','blindtransfer','loopCampaigns','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','clockClearZombieChannels','hasOwnProperty','booked','clearZombieChannels','recallMe','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','ListId','status','catch','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','info','[action]','size','clearZombieChannel','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','IsNotLoggedIn','loggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','ANSWER','[syncHangup][talking][increment]','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer'];(function(_0x2ec00d,_0x166ad5){var _0x228886=function(_0xb2e15e){while(--_0xb2e15e){_0x2ec00d['push'](_0x2ec00d['shift']());}};_0x228886(++_0x166ad5);}(_0x73a9,0x1e6));var _0x973a=function(_0x510b1f,_0x198f4f){_0x510b1f=_0x510b1f-0x0;var _0x299104=_0x73a9[_0x510b1f];return _0x299104;};'use strict';var util=require(_0x973a('0x0'));var _=require(_0x973a('0x1'));var BPromise=require(_0x973a('0x2'));var uuid=require(_0x973a('0x3'));var moment=require(_0x973a('0x4'));var md5=require(_0x973a('0x5'));var Redis=require(_0x973a('0x6'));var config=require(_0x973a('0x7'));var logger=require('../../../config/logger')(_0x973a('0x8'));var loggerAction=require(_0x973a('0x9'))(_0x973a('0xa'));var ami=require('../ami');var rpcDb=require(_0x973a('0xb'));var Action=require('./action');var ut=require(_0x973a('0xc'));config[_0x973a('0xd')]=_[_0x973a('0xe')](config[_0x973a('0xd')],{'host':_0x973a('0xf'),'port':0x18eb});var io=require(_0x973a('0x10'))(new Redis(config[_0x973a('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x973a('0x11')]=function(_0x403a24){this[_0x973a('0x12')]=this[_0x973a('0x12')]?this['tail'][_0x973a('0x13')](_0x403a24):_0x403a24();};function Preview(_0x12287d){this['sequence']=new Sequence();this[_0x973a('0x14')]=_0x12287d['voiceQueues'];this[_0x973a('0x15')]=_0x12287d[_0x973a('0x15')];this[_0x973a('0x16')]={};this[_0x973a('0x17')]=_0x12287d[_0x973a('0x17')];this['clockClearZombieChannels']=0x0;ami['on'](_0x973a('0x18'),this[_0x973a('0x19')][_0x973a('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0x973a('0x1a')](this));ami['on'](_0x973a('0x1b'),this[_0x973a('0x1c')][_0x973a('0x1a')](this));ami['on']('dialend',this[_0x973a('0x1d')]['bind'](this));ami['on'](_0x973a('0x1e'),this[_0x973a('0x1f')][_0x973a('0x1a')](this));ami['on']('varset',this['syncVarSet'][_0x973a('0x1a')](this));ami['on'](_0x973a('0x20'),this['syncAttendedTransfer'][_0x973a('0x1a')](this));ami['on'](_0x973a('0x21'),this['syncBlindTransfer'][_0x973a('0x1a')](this));this[_0x973a('0x22')](this['campaignsPreview']);}function emit(_0x1c00cb,_0x564a02,_0x1a46f8){io['to'](_0x1c00cb)[_0x973a('0x23')](_0x564a02,_0x1a46f8);}function emitCampaignPreview(_0x521d13){if(_0x521d13['type']===_0x973a('0x24')){var _0x52fcb4={'id':_0x521d13['id'],'name':_0x521d13['name'],'strategy':_0x521d13[_0x973a('0x25')],'answered':_0x521d13[_0x973a('0x26')],'available':_0x521d13[_0x973a('0x27')],'loggedIn':_0x521d13['loggedIn'],'pTalking':_0x521d13[_0x973a('0x28')],'sumBillable':_0x521d13[_0x973a('0x29')],'sumDuration':_0x521d13[_0x973a('0x2a')],'sumHoldTime':_0x521d13[_0x973a('0x2b')]||0x0,'talking':_0x521d13[_0x973a('0x2c')],'total':_0x521d13[_0x973a('0x2d')],'type':_0x521d13[_0x973a('0x2e')],'unmanaged':_0x521d13[_0x973a('0x2f')],'abandoned':_0x521d13['abandoned'],'waiting':_0x521d13['waiting'],'loggedInDb':_0x521d13[_0x973a('0x30')],'dialActive':_0x521d13[_0x973a('0x31')],'dialMethod':_0x521d13[_0x973a('0x32')],'dialOriginateCallerIdName':_0x521d13[_0x973a('0x33')],'dialOriginateCallerIdNumber':_0x521d13[_0x973a('0x34')],'dialOriginateTimeout':_0x521d13[_0x973a('0x35')],'dialPrefix':_0x521d13[_0x973a('0x36')],'outboundAnswerAgiCallsDay':_0x521d13['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x521d13[_0x973a('0x37')],'outboundBlacklistCallsDay':_0x521d13['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x521d13[_0x973a('0x38')],'outboundCongestionCallsDay':_0x521d13[_0x973a('0x39')],'outboundDropCallsDayACS':_0x521d13[_0x973a('0x3a')],'outboundDropCallsDayCallersExit':_0x521d13[_0x973a('0x3b')],'outboundDropCallsDayTimeout':_0x521d13[_0x973a('0x3c')],'outboundNoAnswerCallsDay':_0x521d13[_0x973a('0x3d')],'outboundNoSuchCallsDay':_0x521d13[_0x973a('0x3e')],'outboundOriginateFailureCallsDay':_0x521d13[_0x973a('0x3f')],'outboundReCallsDay':_0x521d13[_0x973a('0x40')],'outboundRejectCallsDay':_0x521d13[_0x973a('0x41')],'outboundUnknownCallsDay':_0x521d13[_0x973a('0x42')],'outboundAbandonedCallsDay':_0x521d13['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x521d13[_0x973a('0x43')],'predictiveIntervalAvgHoldtime':_0x521d13[_0x973a('0x44')],'predictiveIntervalAvgTalktime':_0x521d13[_0x973a('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x521d13[_0x973a('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x521d13[_0x973a('0x47')],'predictiveIntervalErlangCalls':_0x521d13['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x521d13[_0x973a('0x48')],'predictiveIntervalHitRate':_0x521d13[_0x973a('0x49')],'predictiveIntervalMultiplicativeFactor':_0x521d13['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x521d13['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x521d13[_0x973a('0x4a')],'predictiveIntervalTotalCalls':_0x521d13[_0x973a('0x4b')],'message':_0x521d13[_0x973a('0x4c')],'originated':_0x521d13[_0x973a('0x4d')],'erlangCalls':_0x521d13['erlangCalls'],'erlangCallToSecond':_0x521d13[_0x973a('0x4e')],'erlangAbandonmentRate':_0x521d13[_0x973a('0x4f')],'erlangBusyFactor':_0x521d13[_0x973a('0x50')],'startPredictive':_0x521d13[_0x973a('0x51')],'startProgressive':_0x521d13[_0x973a('0x52')]};if(_0x521d13[_0x973a('0x53')]){_0x52fcb4[_0x973a('0x53')]={'id':_0x521d13['Trunk']['id'],'name':_0x521d13[_0x973a('0x53')][_0x973a('0x54')],'active':_0x521d13[_0x973a('0x53')][_0x973a('0x55')],'callerid':_0x521d13[_0x973a('0x53')][_0x973a('0x56')]};}if(_0x521d13[_0x973a('0x57')]){_0x52fcb4['Interval']={'id':_0x521d13[_0x973a('0x57')]['id'],'name':_0x521d13[_0x973a('0x57')][_0x973a('0x54')]};}var _0x203194=md5(JSON[_0x973a('0x58')](_0x52fcb4));if(_0x521d13[_0x973a('0x5')]!==_0x203194){_0x521d13[_0x973a('0x5')]=_0x203194;emit(util[_0x973a('0x59')](_0x973a('0x5a'),_0x52fcb4[_0x973a('0x54')]),_0x973a('0x5b'),_0x52fcb4);}}}function emitVoiceQueueChannelRemove(_0xca65ea){logger['info'](_0x973a('0x5c'),JSON[_0x973a('0x58')](_0xca65ea));emit(util[_0x973a('0x59')](_0x973a('0x5a'),_0xca65ea[_0x973a('0x54')]),_0x973a('0x5d'),_0xca65ea);io[_0x973a('0x23')]('voice_queue_presence:remove',_0xca65ea);}function notSendMessagesQueue(_0x42e92a){if(_0x42e92a[_0x973a('0x5e')]){if(_0x42e92a[_0x973a('0x4d')]===0x0&&_0x42e92a['pTalking']===0x0){_0x42e92a[_0x973a('0x5e')]=![];_0x42e92a[_0x973a('0x27')]=0x0;_0x42e92a[_0x973a('0x5f')]=0x0;_0x42e92a[_0x973a('0x4c')]=_0x973a('0x60');ut[_0x973a('0x61')](_0x973a('0x62'),_0x42e92a[_0x973a('0x54')]+_0x973a('0x63'));}else{_0x42e92a[_0x973a('0x4c')]=_0x973a('0x64');ut['logger'](_0x973a('0x62'),_0x42e92a[_0x973a('0x54')]+_0x973a('0x65'));}emitCampaignPreview(_0x42e92a);}}Preview[_0x973a('0x66')][_0x973a('0x22')]=function(){var _0x117a6a=this;setInterval(function(){_0x117a6a[_0x973a('0x67')]();},0x7cf);};Preview[_0x973a('0x66')][_0x973a('0x67')]=function(){var _0x3cba71=this['campaignsPreview'];this[_0x973a('0x68')]+=0x1;for(var _0x3c4c76 in _0x3cba71){if(_0x3cba71[_0x973a('0x69')](_0x3c4c76)&&(_0x3cba71[_0x3c4c76][_0x973a('0x32')]===_0x973a('0x8')||_0x3cba71[_0x3c4c76][_0x973a('0x32')]===_0x973a('0x6a'))&&_0x3cba71[_0x3c4c76][_0x973a('0x2e')]===_0x973a('0x24')){if(this[_0x973a('0x68')]>0x7){this[_0x973a('0x68')]=0x0;this[_0x973a('0x6b')]();}}if(_0x3cba71[_0x973a('0x69')](_0x3c4c76)&&_0x3cba71[_0x3c4c76]['dialMethod']===_0x973a('0x8')&&_0x3cba71[_0x3c4c76]['type']==='outbound'){if(_0x3cba71[_0x3c4c76]['dialActive']){this['setMessage'](_0x3cba71[_0x3c4c76]);this[_0x973a('0x6c')](_0x3cba71[_0x3c4c76]);}else{notSendMessagesQueue(_0x3cba71[_0x3c4c76]);}}}};Preview[_0x973a('0x66')]['clearZombieChannel']=function(_0x5816e7){var _0x1107fe=this;this[_0x973a('0x6d')]['enqueue'](function(){if(!_[_0x973a('0x6e')](_0x1107fe[_0x973a('0x16')][_0x5816e7])){loggerAction['info'](_0x973a('0x6f'),_0x5816e7,_0x973a('0x70'),_0x1107fe['actions'][_0x5816e7][_0x973a('0x71')],_0x973a('0x72'),JSON[_0x973a('0x58')](_0x1107fe[_0x973a('0x14')][_0x1107fe[_0x973a('0x16')][_0x5816e7][_0x973a('0x71')]]['originated']),_0x973a('0x73'),JSON['stringify'](_0x1107fe[_0x973a('0x14')][_0x1107fe[_0x973a('0x16')][_0x5816e7][_0x973a('0x71')]]['pTalking']),JSON[_0x973a('0x58')](_0x1107fe[_0x973a('0x16')][_0x5816e7][_0x973a('0x74')]),JSON[_0x973a('0x58')](_[_0x973a('0x75')](_0x1107fe[_0x973a('0x16')][_0x5816e7],[_0x973a('0x76'),_0x973a('0x77'),'VoiceQueueId',_0x973a('0x78')])));return ami['Action']({'action':_0x973a('0x79'),'channel':_0x1107fe[_0x973a('0x16')][_0x5816e7]['channel']})[_0x973a('0x7a')](function(_0xb41128){if(_0xb41128[_0x973a('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1107fe[_0x973a('0x16')][_0x5816e7]){ut[_0x973a('0x7b')](_0x1107fe[_0x973a('0x14')][_0x1107fe[_0x973a('0x16')][_0x5816e7]['queue']],'[clearZombieChannel]');if(_0x1107fe[_0x973a('0x16')][_0x5816e7][_0x973a('0x74')]===!![]){ut[_0x973a('0x7c')](_0x1107fe[_0x973a('0x14')][_0x1107fe['actions'][_0x5816e7][_0x973a('0x71')]],_0x973a('0x7d'));ut[_0x973a('0x7e')](_0x973a('0x7f')+_0x5816e7,_0x1107fe['actions'][_0x5816e7][_0x973a('0x71')]);}ut[_0x973a('0x7e')](_0x973a('0x80')+_0x5816e7,_0x1107fe[_0x973a('0x16')][_0x5816e7][_0x973a('0x71')]);delete _0x1107fe['actions'][_0x5816e7];}},0x2328);}});}});};Preview[_0x973a('0x66')]['clearZombieChannels']=function(){var _0x4585c6=this;loggerAction[_0x973a('0x81')](_0x973a('0x82'),_[_0x973a('0x83')](this['actions']));for(var _0x54097f in this[_0x973a('0x16')]){if(_0x4585c6[_0x973a('0x16')][_0x973a('0x69')](_0x54097f)){_0x4585c6[_0x973a('0x84')](_0x54097f);}}};Preview[_0x973a('0x66')][_0x973a('0x6c')]=function(_0x5d89b6){var _0x4ca324=this;rpcDb[_0x973a('0x85')](_0x5d89b6['id'],ut[_0x973a('0x86')](this['agents']))[_0x973a('0x87')](function(_0x2605c5){if(!_[_0x973a('0x6e')](_0x2605c5)){for(var _0x3f6bd1=0x0;_0x3f6bd1<_0x2605c5[_0x973a('0x88')];_0x3f6bd1+=0x1){if(ut[_0x973a('0x89')](_0x2605c5[_0x3f6bd1][_0x973a('0x8a')])<_0x5d89b6['dialRecallMeTimeout']*0x3c){if(_0x2605c5[_0x3f6bd1][_0x973a('0x8b')]&&!_0x2605c5[_0x3f6bd1][_0x973a('0x8b')][_0x973a('0x8c')]){_0x4ca324[_0x973a('0x8d')](_0x2605c5[_0x3f6bd1]['id'])[_0x973a('0x87')](ut[_0x973a('0x8e')](_0x973a('0x8f')))[_0x973a('0x7a')](ut[_0x973a('0x8e')](_0x973a('0x8f')));}else{rpcDb[_0x973a('0x90')](_0x2605c5[_0x3f6bd1]['id']);}}else{var _0xdf8015=new Action(_0x2605c5[_0x3f6bd1],_0x5d89b6);_0xdf8015[_0x973a('0x91')]=moment()[_0x973a('0x59')](_0x973a('0x92'));_0x5d89b6['outboundReCallsDay']+=0x1;ut[_0x973a('0x93')](_0xdf8015,0x17,'RecallInQueue');if(_0x5d89b6[_0x973a('0x94')]){rpcDb['rescheduleContactInQueue'](ut[_0x973a('0x95')](_0x2605c5[_0x3f6bd1]));rpcDb[_0x973a('0x96')](_0xdf8015,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x973a('0x93')](_0xdf8015,0x16,_0x973a('0x97'));rpcDb[_0x973a('0x96')](_0xdf8015,'[HistoryRecallClose]');rpcDb[_0x973a('0x98')](_0xdf8015,'[HistoryRecallClose]');}}}}})[_0x973a('0x7a')](ut[_0x973a('0x8e')]('[getContactRecallMe]'));};Preview[_0x973a('0x66')]['setMessage']=function(_0x22b0fa){_0x22b0fa[_0x973a('0x5e')]=!![];if(ut[_0x973a('0x99')](_0x22b0fa[_0x973a('0x9a')])){_0x22b0fa[_0x973a('0x4c')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x973a('0x9b')](_0x22b0fa[_0x973a('0x31')])){_0x22b0fa[_0x973a('0x4c')]='NOT_ACTIVE';}else if(!this[_0x973a('0x9c')](_0x22b0fa[_0x973a('0x53')])){if(!this[_0x973a('0x9c')](_0x22b0fa[_0x973a('0x9d')])){_0x22b0fa[_0x973a('0x4c')]='TRUNK_IS_NOT_REACHABLE';}else{_0x22b0fa['message']=_0x973a('0x9e');}}else{_0x22b0fa[_0x973a('0x4c')]=_0x973a('0x9e');}emitCampaignPreview(_0x22b0fa);};Preview[_0x973a('0x66')][_0x973a('0x9f')]=function(_0x4af60f,_0x2a4acd,_0x4df163){var _0x13134f=this;var _0x1a3665=this['actions'][_0x2a4acd];var _0x7b8f57=this['campaignsPreview'][_0x1a3665[_0x973a('0x71')]];var _0x2a2def;if(_0x7b8f57){switch(_0x4df163){case'1':_0x7b8f57[_0x973a('0x3e')]+=0x1;_0x1a3665[_0x973a('0xa0')]+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0x0,_0x973a('0xa3'));ami[_0x973a('0x23')]('custom:agentnosuchnumber',ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xa5')));rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xa6'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut[_0x973a('0xa8')](_0x1a3665,0xf,'Global');rpcDb[_0x973a('0x98')](_0x2a2def,_0x973a('0xa9'));}else{if(_0x1a3665['countnosuchnumberretry']>=_0x7b8f57[_0x973a('0xaa')]){rpcDb[_0x973a('0x98')](_0x1a3665,_0x973a('0xa9'));}else{rpcDb[_0x973a('0xab')](ut['scheduledAt'](_0x1a3665,_0x973a('0xa0'),_0x7b8f57[_0x973a('0xac')]),_0x1a3665[_0x973a('0xad')],_0x1a3665['activeContact']);}}delete this[_0x973a('0x16')][_0x4af60f[_0x973a('0xae')]];break;case _0x973a('0xaf'):var _0x5c13f4=moment()[_0x973a('0x59')](_0x973a('0x92'));_0x1a3665['responsetime']=_0x5c13f4;_0x1a3665['answertime']=_0x5c13f4;_0x1a3665[_0x973a('0x74')]=!![];_0x7b8f57['pTalking']+=0x1;logger[_0x973a('0x81')](_0x973a('0xb0'),_0x1a3665['uniqueid'],'\x20Queue',_0x7b8f57['name'],'pTalking:\x20',_0x7b8f57[_0x973a('0x28')]);ami[_0x973a('0x23')](_0x973a('0xb1'),ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xb2'),this[_0x973a('0x14')][_0x1a3665[_0x973a('0x71')]]));if(_0x7b8f57[_0x973a('0xb3')]){ami[_0x973a('0x23')](_0x973a('0xb4'),ut[_0x973a('0xb5')](_0x1a3665));}break;case'16':ami[_0x973a('0x23')](_0x973a('0xb6'),ut['buildObj'](_0x1a3665,_0x973a('0xb7'),this[_0x973a('0x14')][_0x1a3665[_0x973a('0x71')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x1a3665,_0x973a('0xb7')));_0x7b8f57[_0x973a('0x37')]+=0x1;_0x7b8f57['total']+=0x1;_0x7b8f57[_0x973a('0x26')]+=0x1;ut['decrementTalkink'](_0x7b8f57,_0x973a('0xb8'));_0x1a3665['countglobal']=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0x4,_0x973a('0xb9'));rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xba'));rpcDb['createCustomerFinal'](_0x1a3665,_0x973a('0xbb'));rpcDb['crateCustomerReportQueue'](_0x1a3665);_0x7b8f57[_0x973a('0x2a')]+=_0x1a3665['talktime'];_0x7b8f57[_0x973a('0x29')]+=_0x1a3665[_0x973a('0xbc')];logger['info'](_0x973a('0xbd'),_0x1a3665[_0x973a('0xbe')],_0x973a('0xbf'),_0x7b8f57[_0x973a('0x54')],'pTalking:\x20',_0x7b8f57[_0x973a('0x28')]);delete this[_0x973a('0x16')][_0x4af60f[_0x973a('0xae')]];break;case'BUSY':_0x7b8f57[_0x973a('0x38')]+=0x1;_0x1a3665['countbusyretry']+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0x5,_0x973a('0xc0'));ami[_0x973a('0x23')]('custom:agentbusy',ut['buildObj'](_0x1a3665,_0x973a('0xc1')));rpcDb['createCustomerHistory'](_0x1a3665,_0x973a('0xc2'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut[_0x973a('0xa8')](_0x1a3665,0xf,_0x973a('0xc3'));rpcDb[_0x973a('0x98')](_0x2a2def,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x1a3665[_0x973a('0xc4')]>=_0x7b8f57['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x1a3665,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x973a('0xab')](ut[_0x973a('0xc5')](_0x1a3665,_0x973a('0xc4'),_0x7b8f57[_0x973a('0xc6')]),_0x1a3665['unlockAgent'],_0x1a3665[_0x973a('0xc7')]);}}break;case _0x973a('0xc8'):_0x7b8f57['outboundNoAnswerCallsDay']+=0x1;_0x1a3665['countnoanswerretry']+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut[_0x973a('0x93')](_0x1a3665,0x3,_0x973a('0xc9'));ami[_0x973a('0x23')](_0x973a('0xca'),ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xcb')));rpcDb[_0x973a('0x96')](_0x1a3665,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57['dialGlobalMaxRetry']){_0x2a2def=ut['cloneAction'](_0x1a3665,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a2def,_0x973a('0xcc'));}else{if(_0x1a3665[_0x973a('0xcd')]>=_0x7b8f57[_0x973a('0xce')]){rpcDb[_0x973a('0x98')](_0x1a3665,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x973a('0xc5')](_0x1a3665,'countnoanswerretry',_0x7b8f57['dialNoAnswerRetryFrequency']),_0x1a3665[_0x973a('0xad')],_0x1a3665['activeContact']);}}break;case _0x973a('0xcf'):_0x7b8f57[_0x973a('0x39')]+=0x1;_0x1a3665[_0x973a('0xd0')]+=0x1;_0x1a3665[_0x973a('0xa1')]=ut['totalGlobal'](_0x1a3665);ut[_0x973a('0x93')](_0x1a3665,0x8,_0x973a('0xd1'));ami[_0x973a('0x23')](_0x973a('0xd2'),ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xd3')));rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xd4'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57['dialGlobalMaxRetry']){_0x2a2def=ut[_0x973a('0xa8')](_0x1a3665,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a2def,_0x973a('0xd5'));}else{if(_0x1a3665[_0x973a('0xd0')]>=_0x7b8f57[_0x973a('0xd6')]){rpcDb[_0x973a('0x98')](_0x1a3665,_0x973a('0xd4'));}else{rpcDb[_0x973a('0xab')](ut[_0x973a('0xc5')](_0x1a3665,_0x973a('0xd0'),_0x7b8f57[_0x973a('0xc6')]),_0x1a3665[_0x973a('0xad')],_0x1a3665['activeContact']);}}break;case _0x973a('0xd7'):_0x7b8f57[_0x973a('0x41')]+=0x1;_0x1a3665[_0x973a('0xd8')]+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0x14,'AgentReject');ami[_0x973a('0x23')](_0x973a('0xd9'),ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xda')));rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xdb'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut['cloneAction'](_0x1a3665,0x14,_0x973a('0xdc'));rpcDb[_0x973a('0x98')](_0x2a2def,_0x973a('0xdd'));}else{if(_0x1a3665[_0x973a('0xd8')]>=_0x7b8f57[_0x973a('0xde')]){rpcDb[_0x973a('0x98')](_0x1a3665,_0x973a('0xdd'));}else{rpcDb[_0x973a('0xab')](ut[_0x973a('0xc5')](_0x1a3665,_0x973a('0xd8'),_0x7b8f57['dialAgentRejectRetryFrequency']),_0x1a3665[_0x973a('0xad')],_0x1a3665[_0x973a('0xc7')]);}}break;case _0x973a('0xdf'):_0x7b8f57['outboundAbandonedCallsDay']+=0x1;_0x1a3665[_0x973a('0xe0')]+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut[_0x973a('0x93')](_0x1a3665,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x1a3665,_0x973a('0xe1'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut['cloneAction'](_0x1a3665,0xf,'Global');rpcDb[_0x973a('0x98')](_0x2a2def,_0x973a('0xe1'));}else{if(_0x1a3665['countabandonedetry']>=_0x7b8f57[_0x973a('0xe2')]){rpcDb[_0x973a('0x98')](_0x1a3665,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x973a('0xab')](ut[_0x973a('0xc5')](_0x1a3665,_0x973a('0xe0'),_0x7b8f57['dialAbandonedRetryFrequency']),_0x1a3665[_0x973a('0xad')],_0x1a3665[_0x973a('0xc7')]);}}break;case'18':_0x7b8f57[_0x973a('0x42')]+=0x1;_0x1a3665[_0x973a('0xe3')]+=0x1;_0x1a3665['countglobal']=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0x12,_0x4af60f['cause-txt']||_0x4af60f[_0x973a('0xe4')]);ami[_0x973a('0x23')]('custom:amd',ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xe5')));rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xe6'));if(ut['totalGlobal'](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut[_0x973a('0xa8')](_0x1a3665,0xf,_0x973a('0xc3'));rpcDb[_0x973a('0x98')](_0x2a2def,_0x973a('0xe6'));}else{rpcDb[_0x973a('0x98')](_0x1a3665,_0x973a('0xe6'));}delete this[_0x973a('0x16')][_0x4af60f[_0x973a('0xae')]];break;case'19':_0x7b8f57['outboundUnknownCallsDay']+=0x1;_0x1a3665[_0x973a('0xa1')]=ut['totalGlobal'](_0x1a3665);ut[_0x973a('0x93')](_0x1a3665,0x13,_0x4af60f['cause-txt']||_0x4af60f[_0x973a('0xe4')]);ami[_0x973a('0x23')](_0x973a('0xe7'),ut[_0x973a('0xa4')](_0x1a3665,_0x973a('0xe5')));rpcDb['createCustomerHistory'](_0x1a3665,_0x973a('0xe8'));if(ut['totalGlobal'](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut['cloneAction'](_0x1a3665,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a2def,_0x973a('0xe8'));}else{rpcDb[_0x973a('0x98')](_0x1a3665,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x4af60f['linkedid']];break;default:if(_0x1a3665[_0x973a('0x74')]){ut[_0x973a('0x7c')](_0x7b8f57,'[default]');ut[_0x973a('0x7e')](_0x973a('0xe9')+_0x7b8f57['name'],_0x4af60f);}_0x7b8f57['outboundUnknownCallsDay']+=0x1;_0x1a3665[_0x973a('0xa1')]=ut[_0x973a('0xa2')](_0x1a3665);ut['logCustomer'](_0x1a3665,0xc,_0x4af60f['cause-txt']||_0x4af60f['dialstatus']);rpcDb[_0x973a('0x96')](_0x1a3665,_0x973a('0xea'));if(ut[_0x973a('0xa2')](_0x1a3665)>=_0x7b8f57[_0x973a('0xa7')]){_0x2a2def=ut[_0x973a('0xa8')](_0x1a3665,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a2def,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x973a('0x98')](_0x1a3665,_0x973a('0xeb'));}delete this['actions'][_0x4af60f[_0x973a('0xae')]];}if(!(_0x1a3665[_0x973a('0x74')]&&_0x4df163==='16')){ut[_0x973a('0x7b')](_0x7b8f57,_0x973a('0xec'));logger[_0x973a('0x81')](_0x973a('0xed'),_0x1a3665[_0x973a('0xbe')],_0x973a('0xbf'),_0x7b8f57[_0x973a('0x54')],_0x973a('0x72'),_0x7b8f57[_0x973a('0x4d')]);}if(_0x4df163!==_0x973a('0xaf')){delete this['actions'][_0x4af60f[_0x973a('0xae')]];delete this[_0x973a('0x16')][_0x4af60f[_0x973a('0xee')]];}}};Preview[_0x973a('0x66')][_0x973a('0xef')]=function(_0x5e4ab5,_0x327ac2,_0x44dd9b){if(_[_0x973a('0xf0')](_0x327ac2)&&_0x973a('0xf1')!==typeof _0x327ac2){return;}if(_[_0x973a('0xf0')](_0x44dd9b)&&_0x973a('0xf1')!==typeof _0x44dd9b){return;}switch(_0x44dd9b[_0x973a('0xf2')]){case'0':ut['logAgent'](_0x5e4ab5,0x0,_0x973a('0xa3'));rpcDb[_0x973a('0xf3')](_0x5e4ab5,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x973a('0xf4')](_0x5e4ab5,0x3,_0x973a('0xc9'));rpcDb[_0x973a('0xf3')](_0x5e4ab5,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x973a('0xf4')](_0x5e4ab5,0x5,_0x973a('0xc0'));rpcDb[_0x973a('0xf3')](_0x5e4ab5,_0x973a('0xf5'));break;case'8':ut[_0x973a('0xf4')](_0x5e4ab5,0x8,_0x973a('0xd1'));rpcDb[_0x973a('0xf3')](_0x5e4ab5,_0x973a('0xf6'));break;case'22':ut[_0x973a('0xf4')](_0x5e4ab5,0x16,_0x973a('0xf7'));rpcDb[_0x973a('0xf3')](_0x5e4ab5,_0x973a('0xf8'));break;default:ut[_0x973a('0xf4')](_0x5e4ab5,0xc,_0x44dd9b[_0x973a('0xf2')]);rpcDb[_0x973a('0xf3')](_0x5e4ab5,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x327ac2,'[callProgressDetectingAgent]');logger[_0x973a('0x81')](_0x973a('0xf9'),_0x5e4ab5[_0x973a('0xbe')],_0x973a('0xbf'),_0x327ac2[_0x973a('0x54')],_0x973a('0x72'),_0x327ac2[_0x973a('0x4d')]);delete this[_0x973a('0x16')][_0x5e4ab5['uniqueid']];};Preview[_0x973a('0x66')]['checkInBlack']=function(_0xb5a2d,_0x4a9903,_0x481640,_0xcfe84c,_0xe7777c){var _0x16f116=this;return new BPromise(function(_0x3e64d3,_0x4d7472){if(_[_0x973a('0x6e')](_0x4a9903)||_[_0x973a('0x6e')](_0x4a9903[_0x973a('0xfa')])||_[_0x973a('0x6e')](_0x4a9903[_0x973a('0xfa')][_0x973a('0xfb')])||_['isNil'](_0x4a9903['VoiceQueueId'])){_0x4d7472(ut['message'](_0x973a('0xfc'),_0xcfe84c,_0xe7777c));return;}var _0x462bd9=uuid['v4']();var _0x126e5d=_0x16f116[_0x973a('0x14')][_0x4a9903[_0x973a('0x70')][_0x973a('0x54')]];var _0x54299d=_0x481640?_0x16f116['agents'][_0x481640]['id']:undefined;_0x16f116[_0x973a('0x16')][_0x462bd9]=new Action(_0x4a9903,_0x126e5d,_0x462bd9,_0x481640,_0x54299d);var _0x40995f=_0x16f116[_0x973a('0x16')][_0x462bd9];_0x40995f[_0x973a('0xad')]=_0xcfe84c;_0x40995f['activeContact']=_0xe7777c;_0x40995f[_0x973a('0xfd')]=_0x481640;if(_[_0x973a('0xfe')](_0xb5a2d)){_0x16f116['execCall'](_0x40995f,_0x126e5d,_0x4a9903,_0x481640)[_0x973a('0x87')](function(_0x25edda){logger[_0x973a('0x81')](_0x973a('0xff'),_0x973a('0x100')+_0x40995f[_0x973a('0x71')]+_0x973a('0x101')+_0x40995f['idContact'],JSON[_0x973a('0x58')](_0x25edda));ami[_0x973a('0x23')]('custom:agentcalled',ut[_0x973a('0xa4')](_0x40995f,_0x973a('0x102'),_0x16f116['campaignsPreview'][_0x40995f[_0x973a('0x71')]]));_0x3e64d3(ut[_0x973a('0x4c')](_0x973a('0x103')));})[_0x973a('0x7a')](function(_0x2a2e1e){ut[_0x973a('0x61')](_0x973a('0x104'),_0x2a2e1e);_0x4d7472(ut[_0x973a('0x4c')]('Call\x20failed',_0xcfe84c,_0xe7777c));});}else{_0x126e5d[_0x973a('0x105')]+=0x1;ut[_0x973a('0x106')](_0x40995f);rpcDb[_0x973a('0x107')](_0x40995f,_0x973a('0x108'));delete _0x16f116['actions'][_0x462bd9];_0x4d7472(ut[_0x973a('0x4c')](_0x973a('0x109'),_0xcfe84c,_0xe7777c));}});};Preview['prototype'][_0x973a('0x9c')]=function(_0x2ad3a7){return!_['isNil'](_0x2ad3a7)&&!_[_0x973a('0x6e')](_0x2ad3a7[_0x973a('0x54')])&&!_['isNil'](_0x2ad3a7[_0x973a('0x55')])&&_0x2ad3a7[_0x973a('0x55')]&&!_[_0x973a('0x6e')](this[_0x973a('0x15')][util[_0x973a('0x59')](_0x973a('0x10a'),_0x2ad3a7['name'])])&&!_[_0x973a('0x6e')](this[_0x973a('0x15')][util[_0x973a('0x59')]('SIP/%s',_0x2ad3a7[_0x973a('0x54')])][_0x973a('0x79')])&&(this[_0x973a('0x15')][util['format']('SIP/%s',_0x2ad3a7['name'])][_0x973a('0x79')]===_0x973a('0x10b')||this[_0x973a('0x15')][util[_0x973a('0x59')]('SIP/%s',_0x2ad3a7[_0x973a('0x54')])][_0x973a('0x79')]==='unmonitored');};Preview[_0x973a('0x66')][_0x973a('0x8d')]=function(_0x2e6b65,_0x25c38c){var _0x4c526e=this;return new BPromise(function(_0x5b5adb,_0x51cefd){_0x4c526e[_0x973a('0x10c')](_0x2e6b65,_0x25c38c)[_0x973a('0x87')](function(_0xbebb7d){_0x5b5adb(_[_0x973a('0x75')](_0xbebb7d,[_0x973a('0x4c')]));})[_0x973a('0x7a')](function(_0x2ef23d){if(_0x2ef23d[_0x973a('0x10d')]){rpcDb[_0x973a('0x10e')](_0x2e6b65);}if(_0x2ef23d['active']){rpcDb[_0x973a('0x90')](_0x2e6b65);}_0x51cefd(_[_0x973a('0x75')](_0x2ef23d,['message']));});});};Preview['prototype'][_0x973a('0x10c')]=function(_0x2484a5,_0x17bfc1){var _0x449a3b=this;return new BPromise(function(_0x569ae8,_0x176bc5){var _0x3eadff,_0x2e9292;rpcDb[_0x973a('0x10f')](_0x2484a5)[_0x973a('0x87')](function(_0x2784c5){if(!_['isNil'](_0x2784c5[0x0])){_0x2e9292=_0x2784c5[0x0]['recallme']?![]:!![];_0x3eadff=_0x2784c5[0x0][_0x973a('0x110')]?!![]:![];_0x3eadff=_0x17bfc1?!![]:_0x3eadff;}var _0x359cdb=_0x449a3b['validateContact'](_0x2784c5);if(_0x359cdb[_0x973a('0x111')]){rpcDb[_0x973a('0x112')](_['pick'](_0x2784c5[0x0],[_0x973a('0x113'),'Contact.phone']))[_0x973a('0x87')](function(_0x39e99b){_0x449a3b[_0x973a('0x114')](_0x39e99b,_0x2784c5[0x0],_0x17bfc1,_0x2e9292,_0x3eadff)[_0x973a('0x87')](function(_0x2e77e2){_0x569ae8(_0x2e77e2);})[_0x973a('0x7a')](function(_0x305c58){_0x176bc5(_0x305c58);});})[_0x973a('0x7a')](function(_0x3578cb){ut['logger'](_0x973a('0x115'),_0x3578cb);_0x176bc5(ut[_0x973a('0x4c')]('Call\x20unsuccessful',_0x2e9292,_0x3eadff));});}else{_0x176bc5(ut[_0x973a('0x4c')](_0x359cdb[_0x973a('0x4c')],_0x2e9292,_0x3eadff));}})[_0x973a('0x7a')](function(_0xcb18b0){ut[_0x973a('0x61')]('[Preview][getContactPreview]',_0xcb18b0);_0x176bc5(ut[_0x973a('0x4c')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x973a('0x66')][_0x973a('0x116')]=function(_0xa1bf67){if(_['isNil'](_0xa1bf67)||_['isEmpty'](_0xa1bf67)||!_['isNil'](_0xa1bf67[0x0][_0x973a('0x8b')])&&_[_0x973a('0x6e')](_0xa1bf67[0x0][_0x973a('0x8b')][_0x973a('0x54')])){ut[_0x973a('0x61')]('[Preview][validateContact][Empty\x20Contact]',_0xa1bf67);return{'isValid':![],'message':_0x973a('0x117')};}var _0xc7f32=this['campaignsPreview'][_0xa1bf67[0x0]['Queue']['name']];_0xc7f32[_0x973a('0x4c')]='ACTIVE';if(_[_0x973a('0x6e')](_0xc7f32)){ut[_0x973a('0x61')](_0x973a('0x118'),_0xc7f32);return{'isValid':![],'message':_0x973a('0x119')};}if(!this[_0x973a('0x9c')](_0xc7f32[_0x973a('0x53')])){ut[_0x973a('0x61')](_0x973a('0x11a'),_0x973a('0x11b')+_0xc7f32[_0x973a('0x54')]+_0x973a('0x11c'));if(!this['isTrunkReachable'](_0xc7f32[_0x973a('0x9d')])){ut[_0x973a('0x61')](_0x973a('0x11a'),_0xc7f32[_0x973a('0x54')]+_0x973a('0x11d'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x973a('0x9b')](_0xc7f32[_0x973a('0x31')])){ut['logger'](_0x973a('0x11e'),_0xc7f32[_0x973a('0x54')]+_0x973a('0x11f'));return{'isValid':![],'message':_0x973a('0x11b')+_0xc7f32['name']+_0x973a('0x11f')};}return{'isValid':!![],'message':_0x973a('0x120')};};Preview['prototype'][_0x973a('0x121')]=function(_0x5dd008,_0x5bcd13,_0xaa7a1b,_0x4210db){var _0x15eba5=this;return new BPromise(function(_0x134c19,_0x43d648){var _0x4a8bc8=_0x5dd008[_0x973a('0xbe')];var _0x5ebb40=_0x15eba5[_0x973a('0x9c')](_0x5bcd13[_0x973a('0x53')])?util[_0x973a('0x59')](_0x973a('0x122'),_0x5bcd13['Trunk'][_0x973a('0x54')],_['isNil'](_0x5bcd13[_0x973a('0x36')])?'':_0x5bcd13[_0x973a('0x36')][_0x973a('0x123')]()||'',_0x5bcd13['dialCutDigit']>0x0?_0xaa7a1b[_0x973a('0xfa')][_0x973a('0xfb')]['substring'](_0x5bcd13[_0x973a('0x124')]):_0xaa7a1b['Contact'][_0x973a('0xfb')]):util[_0x973a('0x59')](_0x973a('0x122'),_['isNil'](_0x5bcd13[_0x973a('0x9d')])?_0x5bcd13[_0x973a('0x53')][_0x973a('0x54')]:_0x5bcd13[_0x973a('0x9d')][_0x973a('0x54')],_[_0x973a('0x6e')](_0x5bcd13[_0x973a('0x36')])?'':_0x5bcd13[_0x973a('0x36')]['trim']()||'',_0x5bcd13[_0x973a('0x124')]>0x0?_0xaa7a1b[_0x973a('0xfa')][_0x973a('0xfb')][_0x973a('0x125')](_0x5bcd13[_0x973a('0x124')]):_0xaa7a1b['Contact'][_0x973a('0xfb')]);var _0x169139=_0x15eba5[_0x973a('0x9c')](_0x5bcd13[_0x973a('0x53')])?ut[_0x973a('0x126')](_0x5bcd13[_0x973a('0x53')]['callerid'],_0x5bcd13['dialOriginateCallerIdName'],_0x5bcd13['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x973a('0x127')](_0x5bcd13[_0x973a('0x34')],_0x5bcd13[_0x973a('0x128')]):_0x5bcd13[_0x973a('0x34')]):ut[_0x973a('0x126')](_[_0x973a('0x6e')](_0x5bcd13['TrunkBackup'])?_0x5bcd13['Trunk'][_0x973a('0x56')]:_0x5bcd13[_0x973a('0x9d')]['callerid'],_0x5bcd13['dialOriginateCallerIdName'],_0x5bcd13[_0x973a('0x128')]>0x0?ut[_0x973a('0x127')](_0x5bcd13[_0x973a('0x34')],_0x5bcd13['dialRandomLastDigitCallerIdNumber']):_0x5bcd13[_0x973a('0x34')]);if(_0x169139){_0x5dd008[_0x973a('0x129')]=ut[_0x973a('0x12a')](_0x169139);_0x5dd008['originatecalleridnum']=ut['extractCalleridNumber'](_0x169139);}var _0x3639a2=ut['addVariables'](_0x5bcd13,_0xaa7a1b,_0x5ebb40,_0x169139,_0x4a8bc8,_0x5dd008);_[_0x973a('0x12b')](_0x5dd008,ut[_0x973a('0x12c')](_0x3639a2));_0x5dd008['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x973a('0x12d')](_0x5dd008,_0x5bcd13,_0x3639a2,_0x5dd008[_0x973a('0xc7')],_0x4210db))[_0x973a('0x87')](function(_0x60ce80){var _0x225a87=_0x5dd008['channelAgent'];if(!_['isNil'](_0x225a87)){if(!_[_0x973a('0x6e')](_0x15eba5[_0x973a('0x17')][_0x225a87])){_0x15eba5[_0x973a('0x17')][_0x225a87][_0x973a('0x12e')]=_0x5dd008[_0x973a('0x12f')];emit(util[_0x973a('0x59')](_0x973a('0x130'),_0x15eba5['agents'][_0x225a87][_0x973a('0x54')]),_0x973a('0x131'),{'destaccountcode':_0x15eba5[_0x973a('0x17')][_0x225a87][_0x973a('0x132')],'destconnectedlinenum':_0x5dd008[_0x973a('0x12f')]});}}_0x5bcd13[_0x973a('0x4d')]+=0x1;logger[_0x973a('0x81')]('[originated][increment]',_0x4a8bc8,_0x973a('0xbf'),_0x5bcd13[_0x973a('0x54')],_0x973a('0x72'),_0x5bcd13[_0x973a('0x4d')]);_0x134c19(_0x60ce80);})[_0x973a('0x7a')](function(_0x545cee){ut[_0x973a('0xf4')](_0x5dd008,0xe,'OriginateError');rpcDb[_0x973a('0xf3')](_0x5dd008,_0x973a('0x133'));_0x43d648(_0x545cee);});});};Preview[_0x973a('0x66')][_0x973a('0x1f')]=function(_0x1ae08f){if(this['actions'][_0x1ae08f[_0x973a('0xae')]]){this['actions'][_0x1ae08f[_0x973a('0xae')]]['channel']=_0x1ae08f[_0x973a('0x134')];}};Preview[_0x973a('0x66')][_0x973a('0x19')]=function(_0x392146){var _0xb2fdb9=this;var _0x1a853b=this[_0x973a('0x16')][_0x392146[_0x973a('0x135')]];if(_0x1a853b){if(_0x1a853b[_0x973a('0xfd')]&&this[_0x973a('0x17')][_0x1a853b[_0x973a('0xfd')]]){ut['logLookAgent'](_0x1a853b,this[_0x973a('0x17')][_0x1a853b[_0x973a('0xfd')]]['name'],this['agents'][_0x1a853b[_0x973a('0xfd')]]['id']);}var _0x9f0914=_[_0x973a('0x136')](_0x1a853b);_0x9f0914[_0x973a('0x137')]=moment()[_0x973a('0x59')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2894e8=_0xb2fdb9[_0x973a('0x14')][_0x1a853b['queue']];if(ut[_0x973a('0x138')](_0x392146['response'])){if(_0x1a853b[_0x973a('0xad')]){rpcDb[_0x973a('0x10e')](_0x1a853b['idContact']);}if(_0x1a853b[_0x973a('0xc7')]){rpcDb[_0x973a('0x90')](_0x1a853b[_0x973a('0x139')]);}ami['emit']('custom:agentringnoanswer',ut[_0x973a('0xa4')](_0x1a853b,_0x973a('0x13a'),this[_0x973a('0x14')][_0x1a853b[_0x973a('0x71')]]));this[_0x973a('0xef')](_0x9f0914,_0x2894e8,_0x392146);}else{_0x1a853b[_0x973a('0x91')]=moment()[_0x973a('0x59')](_0x973a('0x92'));ut[_0x973a('0xf4')](_0x9f0914,0x4,_0x973a('0xb9'));rpcDb[_0x973a('0xf3')](_0x9f0914,_0x973a('0x13b'));}}};Preview[_0x973a('0x66')][_0x973a('0x13c')]=function(_0x53ecfe){var _0x36a4cb=this;var _0x374eeb=this[_0x973a('0x16')][_0x53ecfe[_0x973a('0xae')]];var _0x35a9b3;if(_0x374eeb){_0x35a9b3=this[_0x973a('0x14')][_0x374eeb['queue']];logger['info'](_0x973a('0x13d'),_0x53ecfe['linkedid'],_0x973a('0xbf'),_0x35a9b3[_0x973a('0x54')],'pTalking:\x20',_0x35a9b3[_0x973a('0x28')]);}if(this[_0x973a('0x16')][_0x53ecfe['linkedid']]&&_0x53ecfe[_0x973a('0xae')]!==_0x53ecfe[_0x973a('0xbe')]){if(_0x53ecfe[_0x973a('0x13e')]==='16'&&this['actions'][_0x53ecfe[_0x973a('0xae')]][_0x973a('0x74')]){this[_0x973a('0x9f')](_0x53ecfe,_0x53ecfe['linkedid'],_0x53ecfe[_0x973a('0x13e')]);}else if(this['actions'][_0x53ecfe[_0x973a('0xae')]][_0x973a('0x74')]){logger['info'](_0x973a('0x13f'),_0x53ecfe[_0x973a('0xae')],_0x53ecfe[_0x973a('0x13e')],_0x973a('0xbf'),_0x35a9b3['name'],_0x973a('0x73'),_0x35a9b3[_0x973a('0x28')]);this[_0x973a('0x9f')](_0x53ecfe,_0x53ecfe[_0x973a('0xae')],_0x53ecfe['cause']);}}else if(_0x374eeb&&_['isNil'](_0x374eeb[_0x973a('0x140')])&&_0x35a9b3['dialQueueProject']&&_0x53ecfe[_0x973a('0xae')]===_0x53ecfe[_0x973a('0xbe')]&&_[_0x973a('0x6e')](_0x53ecfe[_0x973a('0xf2')])&&_0x53ecfe['cause']==='16'&&_0x53ecfe['channelstate']==='6'&&_[_0x973a('0xf0')](_0x374eeb['transfer'])){if(_0x374eeb[_0x973a('0xad')]){rpcDb[_0x973a('0x10e')](_0x374eeb['idContact']);}if(_0x374eeb[_0x973a('0xc7')]){rpcDb[_0x973a('0x90')](_0x374eeb['idContact']);}_0x53ecfe[_0x973a('0xf2')]='22';this['callProgressDetectingAgent'](_0x374eeb,_0x35a9b3,_0x53ecfe);}else if(_0x374eeb&&_0x374eeb[_0x973a('0x141')]){if(_0x53ecfe[_0x973a('0x13e')]==='16'&&this['actions'][_0x53ecfe[_0x973a('0xae')]][_0x973a('0x74')]){logger[_0x973a('0x81')](_0x973a('0x142'),_0x53ecfe[_0x973a('0xae')],_0x53ecfe[_0x973a('0x13e')],_0x973a('0xbf'),_0x35a9b3[_0x973a('0x54')],_0x973a('0x73'),_0x35a9b3[_0x973a('0x28')]);this[_0x973a('0x9f')](_0x53ecfe,_0x53ecfe['linkedid'],_0x53ecfe[_0x973a('0x13e')]);}else if(this[_0x973a('0x16')][_0x53ecfe[_0x973a('0xae')]]['dialAnswer']){logger[_0x973a('0x81')](_0x973a('0x13f'),_0x53ecfe['linkedid'],_0x53ecfe[_0x973a('0x13e')],_0x973a('0xbf'),_0x35a9b3['name'],_0x973a('0x73'),_0x35a9b3[_0x973a('0x28')]);this['callProgressDetectingCustomer'](_0x53ecfe,_0x53ecfe[_0x973a('0xae')],_0x53ecfe['cause']);}}};Preview[_0x973a('0x66')]['syncDialEnd']=function(_0x311e61){if(this['actions'][_0x311e61[_0x973a('0xee')]]&&_0x311e61[_0x973a('0xee')]!==_0x311e61[_0x973a('0x143')]){this[_0x973a('0x9f')](_0x311e61,_0x311e61[_0x973a('0xee')],_0x311e61[_0x973a('0xe4')]);}};Preview[_0x973a('0x66')][_0x973a('0x1c')]=function(_0x49a001){if(this[_0x973a('0x16')][_0x49a001[_0x973a('0xae')]]&&_0x49a001[_0x973a('0xae')]!==_0x49a001[_0x973a('0xbe')]&&!this[_0x973a('0x16')][_0x49a001[_0x973a('0xae')]]['dialAnswer']){if(_0x49a001[_0x973a('0x13e')]==='1'){this[_0x973a('0x9f')](_0x49a001,_0x49a001[_0x973a('0xae')],_0x49a001[_0x973a('0x13e')]);}}};Preview[_0x973a('0x66')]['addVariable']=function(_0x3e63b1,_0x2a63e6,_0x1894b8){if(this[_0x973a('0x16')][_0x3e63b1]){if(_[_0x973a('0x6e')](this[_0x973a('0x16')][_0x3e63b1]['variables'])){this[_0x973a('0x16')][_0x3e63b1][_0x973a('0x144')]={};}this[_0x973a('0x16')][_0x3e63b1][_0x973a('0x144')][_0x2a63e6]=_0x1894b8;}};Preview[_0x973a('0x66')]['syncVarSet']=function(_0x2cd3e6){try{if(!_[_0x973a('0x6e')](_0x2cd3e6)){if(ut[_0x973a('0x145')](_[_0x973a('0x146')](_0x2cd3e6[_0x973a('0x147')])[0x0])){this['addVariable'](_0x2cd3e6[_0x973a('0xbe')],_[_0x973a('0x146')](_0x2cd3e6['variable'])[0x0],_0x2cd3e6[_0x973a('0x148')]);}}}catch(_0x2c1f80){logger[_0x973a('0x149')](_0x973a('0x14a'),util[_0x973a('0x14b')](_0x2c1f80,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x973a('0x14c')]=function(_0x38eeb8){if(_0x38eeb8){if(this['actions'][_0x38eeb8[_0x973a('0x14d')]]){this[_0x973a('0x16')][_0x38eeb8[_0x973a('0x14d')]]['transfer']=!![];}}};Preview['prototype'][_0x973a('0x14e')]=function(_0x2d2f76){if(_0x2d2f76){if(this[_0x973a('0x16')][_0x2d2f76['transfererlinkedid']]){this[_0x973a('0x16')][_0x2d2f76['transfererlinkedid']]['transfer']=!![];}}};module[_0x973a('0x14f')]=Preview;
\ No newline at end of file
index 8b1d278..0b788b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a3=['[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','connectedlinename','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','create'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x82a3,0x1b2));var _0x382a=function(_0x579121,_0x27e9e2){_0x579121=_0x579121-0x0;var _0x38a4ae=_0x82a3[_0x579121];return _0x38a4ae;};'use strict';var util=require(_0x382a('0x0'));var BPromise=require(_0x382a('0x1'));var logger=require(_0x382a('0x2'))(_0x382a('0x3'));var _=require(_0x382a('0x4'));var cmHopper=require(_0x382a('0x5'));var cmHopperFinal=require(_0x382a('0x6'));var cmHopperHistory=require(_0x382a('0x7'));var cmHopperBlack=require(_0x382a('0x8'));var voiceQueueRt=require(_0x382a('0x9'));var agentReportPreview=require(_0x382a('0xa'));var voiceQueueReport=require(_0x382a('0xb'));function loggerCatch(_0x8c11aa){return function(_0x2e9619){logger['error'](_0x8c11aa,util[_0x382a('0xc')](_0x2e9619,{'showHidden':![],'depth':null}));};}function create(_0x11f2b7){return BPromise[_0x382a('0xd')]()['then'](cmHopperHistory[_0x382a('0xe')](_0x11f2b7))[_0x382a('0xf')](loggerCatch(_0x382a('0x10')));}function createAgent(_0x2128d5){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](agentReportPreview[_0x382a('0xe')](_0x2128d5))[_0x382a('0xf')](loggerCatch(_0x382a('0x10')));}function moveContact(_0x21e05b){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x12')](_0x21e05b,!![]))[_0x382a('0xf')](loggerCatch(_0x382a('0x13')));}exports['checkIsBlackList']=function(_0x4dfe1e){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopperBlack[_0x382a('0x14')](_0x4dfe1e))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x382a('0x15')]=function(_0x22fecd){return BPromise[_0x382a('0xd')]()['then'](cmHopper[_0x382a('0x15')](_0x22fecd))['catch'](loggerCatch(_0x382a('0x16')));};exports[_0x382a('0xe')]=function(_0x15d571,_0x2d138b){create(_0x15d571)['catch'](loggerCatch(_0x2d138b));moveContact(_0x15d571)['catch'](loggerCatch(_0x2d138b));};exports[_0x382a('0x17')]=function(_0x27213d,_0x1172b0){createAgent(_0x27213d)['catch'](loggerCatch(_0x1172b0));};exports[_0x382a('0x18')]=function(_0x205db9,_0x2ae9a){create(_0x205db9)[_0x382a('0xf')](loggerCatch(_0x2ae9a));};exports[_0x382a('0x19')]=function(_0x150953,_0x4099c7){moveContact(_0x150953)['catch'](loggerCatch(_0x4099c7));};exports[_0x382a('0x1a')]=function(_0x36b684,_0x1bc8de,_0x47a89d){if(_0x1bc8de){_0x36b684['UserId']=null;}if(_0x47a89d){_0x36b684[_0x382a('0x1b')]=![];}return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x1a')](_0x36b684))['catch'](loggerCatch(_0x382a('0x1c')));};exports['countReScheduled']=function(_0x3b59d1){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x1d')](_0x3b59d1))[_0x382a('0xf')](loggerCatch('[countReScheduled]\x20'));};exports[_0x382a('0x1e')]=function(_0x31b1ba){return BPromise['resolve']()[_0x382a('0x11')](cmHopper['unlockContact']({'UserId':null},_0x31b1ba,0x1))[_0x382a('0xf')](loggerCatch(_0x382a('0x1f')));};exports['disableContact']=function(_0x5b6458){return BPromise['resolve']()[_0x382a('0x11')](cmHopper[_0x382a('0x1e')]({'active':![]},_0x5b6458,0x1))[_0x382a('0xf')](loggerCatch(_0x382a('0x20')));};exports[_0x382a('0x21')]=function(_0x1066f6){var _0x1f763c={};_0x1f763c[_0x382a('0x22')]=_0x1066f6[_0x382a('0x22')];_0x1f763c[_0x382a('0x23')]=_0x1066f6['uniqueid'];_0x1f763c['calleridnum']=_0x1066f6['calleridnum'];_0x1f763c[_0x382a('0x24')]=_0x1066f6[_0x382a('0x24')];_0x1f763c[_0x382a('0x25')]=_0x1066f6[_0x382a('0x25')];_0x1f763c[_0x382a('0x26')]=_0x1066f6[_0x382a('0x27')];_0x1f763c[_0x382a('0x28')]=_0x1066f6['answertime'];_0x1f763c[_0x382a('0x29')]=0x1;_0x1f763c['queuecallercompleteAt']=_0x1066f6['endtime'];_0x1f763c[_0x382a('0x2a')]=_0x1066f6['membername'];_0x1f763c[_0x382a('0x2b')]='from-sip';_0x1f763c[_0x382a('0x2c')]=_0x382a('0x2d');_0x1f763c[_0x382a('0x2e')]=0x0;_0x1f763c[_0x382a('0x2f')]=0x1;_0x1f763c[_0x382a('0x30')]=_0x1066f6[_0x382a('0x31')];_0x1f763c[_0x382a('0x32')]='COMPLETED';return BPromise['resolve']()['then'](voiceQueueReport[_0x382a('0x33')](_0x1f763c))[_0x382a('0xf')](loggerCatch(_0x382a('0x34')));};exports[_0x382a('0x35')]=function(_0x4a3229,_0x46671d){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x35')](_0x4a3229,_0x46671d))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0xfcae5f){return BPromise[_0x382a('0xd')]()[_0x382a('0x11')](cmHopper[_0x382a('0x1a')](_0xfcae5f,!![],!![]))['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0x3544=['getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20'];(function(_0x5a558f,_0x346068){var _0x57c597=function(_0x2618ad){while(--_0x2618ad){_0x5a558f['push'](_0x5a558f['shift']());}};_0x57c597(++_0x346068);}(_0x3544,0xac));var _0x4354=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x3544[_0x5d7227];return _0x15ac55;};'use strict';var util=require(_0x4354('0x0'));var BPromise=require(_0x4354('0x1'));var logger=require(_0x4354('0x2'))('preview');var _=require(_0x4354('0x3'));var cmHopper=require(_0x4354('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x4354('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x4354('0x6'));var agentReportPreview=require(_0x4354('0x7'));var voiceQueueReport=require(_0x4354('0x8'));function loggerCatch(_0x1ec42f){return function(_0x458722){logger['error'](_0x1ec42f,util[_0x4354('0x9')](_0x458722,{'showHidden':![],'depth':null}));};}function create(_0x4888db){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](cmHopperHistory[_0x4354('0xc')](_0x4888db))[_0x4354('0xd')](loggerCatch(_0x4354('0xe')));}function createAgent(_0x5c0e24){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](agentReportPreview[_0x4354('0xc')](_0x5c0e24))[_0x4354('0xd')](loggerCatch(_0x4354('0xe')));}function moveContact(_0x19fea4){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](cmHopper[_0x4354('0xf')](_0x19fea4,!![]))['catch'](loggerCatch(_0x4354('0x10')));}exports[_0x4354('0x11')]=function(_0xfdf5d1){return BPromise[_0x4354('0xa')]()['then'](cmHopperBlack['checkIsBlackList'](_0xfdf5d1))[_0x4354('0xd')](loggerCatch(_0x4354('0x12')));};exports[_0x4354('0x13')]=function(_0x3cf62e){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](cmHopper[_0x4354('0x13')](_0x3cf62e))[_0x4354('0xd')](loggerCatch(_0x4354('0x14')));};exports['createHistory']=function(_0x4f2479,_0x4a455){create(_0x4f2479)[_0x4354('0xd')](loggerCatch(_0x4a455));moveContact(_0x4f2479)[_0x4354('0xd')](loggerCatch(_0x4a455));};exports[_0x4354('0x15')]=function(_0x4386db,_0x1dfedf){createAgent(_0x4386db)[_0x4354('0xd')](loggerCatch(_0x1dfedf));};exports[_0x4354('0x16')]=function(_0x4fc14e,_0x4ca179){create(_0x4fc14e)[_0x4354('0xd')](loggerCatch(_0x4ca179));};exports[_0x4354('0x17')]=function(_0x2b805e,_0x2a2285){moveContact(_0x2b805e)[_0x4354('0xd')](loggerCatch(_0x2a2285));};exports['rescheduleContact']=function(_0xab4d3,_0x4a0e1f,_0x456f95){if(_0x4a0e1f){_0xab4d3[_0x4354('0x18')]=null;}if(_0x456f95){_0xab4d3[_0x4354('0x19')]=![];}return BPromise['resolve']()[_0x4354('0xb')](cmHopper[_0x4354('0x1a')](_0xab4d3))[_0x4354('0xd')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x4354('0x1b')]=function(_0x309fc2){return BPromise['resolve']()[_0x4354('0xb')](cmHopper['countReScheduled'](_0x309fc2))[_0x4354('0xd')](loggerCatch(_0x4354('0x1c')));};exports['unlockContact']=function(_0x230594){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](cmHopper[_0x4354('0x1d')]({'UserId':null},_0x230594,0x1))[_0x4354('0xd')](loggerCatch(_0x4354('0x1e')));};exports['disableContact']=function(_0x3bf8d7){return BPromise[_0x4354('0xa')]()['then'](cmHopper[_0x4354('0x1d')]({'active':![]},_0x3bf8d7,0x1))[_0x4354('0xd')](loggerCatch(_0x4354('0x1f')));};exports[_0x4354('0x20')]=function(_0x1c3bf5){var _0x4e4aa8={};_0x4e4aa8[_0x4354('0x21')]=_0x1c3bf5[_0x4354('0x21')];_0x4e4aa8[_0x4354('0x22')]=_0x1c3bf5['uniqueid'];_0x4e4aa8[_0x4354('0x23')]=_0x1c3bf5[_0x4354('0x23')];_0x4e4aa8['calleridname']=_0x1c3bf5['calleridname'];_0x4e4aa8[_0x4354('0x24')]=_0x1c3bf5[_0x4354('0x24')];_0x4e4aa8[_0x4354('0x25')]=_0x1c3bf5[_0x4354('0x26')];_0x4e4aa8[_0x4354('0x27')]=_0x1c3bf5[_0x4354('0x26')];_0x4e4aa8[_0x4354('0x28')]=0x1;_0x4e4aa8['queuecallercompleteAt']=_0x1c3bf5['endtime'];_0x4e4aa8['connectedlinename']=_0x1c3bf5[_0x4354('0x29')];_0x4e4aa8[_0x4354('0x2a')]=_0x4354('0x2b');_0x4e4aa8[_0x4354('0x2c')]='xcally-motion-preview';_0x4e4aa8[_0x4354('0x2d')]=0x0;_0x4e4aa8[_0x4354('0x2e')]=0x1;_0x4e4aa8[_0x4354('0x2f')]=_0x1c3bf5[_0x4354('0x29')];_0x4e4aa8[_0x4354('0x30')]=_0x4354('0x31');return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](voiceQueueReport[_0x4354('0x32')](_0x4e4aa8))['catch'](loggerCatch(_0x4354('0x33')));};exports[_0x4354('0x34')]=function(_0x3e5b67,_0x20f684){return BPromise[_0x4354('0xa')]()[_0x4354('0xb')](cmHopper[_0x4354('0x34')](_0x3e5b67,_0x20f684))[_0x4354('0xd')](loggerCatch(_0x4354('0x35')));};exports[_0x4354('0x36')]=function(_0x38ab42){return BPromise[_0x4354('0xa')]()['then'](cmHopper[_0x4354('0x1a')](_0x38ab42,!![],!![]))[_0x4354('0xd')](loggerCatch(_0x4354('0x37')));};
\ No newline at end of file
index 13bdd7f..27e09e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x876c=['Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','Global','active','add','minutes','ContactId','ListId','pTalking','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','motionChannel','voice','agentReadyId','not_inuse','status','reachable','getDiff','diff','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countcongestionretry','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','env','127.0.0.1','milliseconds','seconds','loggerCatch','error','info','inspect','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT'];(function(_0x342594,_0x8f2cc7){var _0x4a08c4=function(_0x6ddde6){while(--_0x6ddde6){_0x342594['push'](_0x342594['shift']());}};_0x4a08c4(++_0x8f2cc7);}(_0x876c,0xe4));var _0xc876=function(_0x1172ea,_0x2a32d7){_0x1172ea=_0x1172ea-0x0;var _0x5945b6=_0x876c[_0x1172ea];return _0x5945b6;};'use strict';var util=require(_0xc876('0x0'));var _=require(_0xc876('0x1'));var moment=require(_0xc876('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xc876('0x3')]['XCALLY_IP_AGI']||_0xc876('0x4');function getSeconds(_0x5ab87d,_0x34a99e){var _0x4a34cc=moment(_0x5ab87d)[_0xc876('0x5')](0x0);var _0x8da04a=moment(_0x34a99e)['milliseconds'](0x0);return _0x4a34cc['diff'](_0x8da04a,_0xc876('0x6'));}exports[_0xc876('0x7')]=function(_0x36070f){return function(_0x27e090){logger[_0xc876('0x8')](_0x36070f,util['inspect'](_0x27e090,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4b52bb,_0x1a4b50){logger[_0xc876('0x9')](_0x4b52bb,util[_0xc876('0xa')](_0x1a4b50,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x31b91d,_0x577d16){logger['error'](_0x31b91d,util['inspect'](_0x577d16,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x743df8){return function(_0x40d7a8){logger[_0xc876('0x9')](_0x743df8,util[_0xc876('0xa')](_0x40d7a8,{'showHidden':![],'depth':null}));};};exports[_0xc876('0xb')]=function(_0x4c3f65,_0x3a4b1a,_0xcd5ec9){return{'message':_0x4c3f65,'unlock':_0x3a4b1a,'active':_0xcd5ec9};};exports[_0xc876('0xc')]=function(_0x2f52ac,_0x222acd,_0x5031e7){if(!_[_0xc876('0xd')](_0x5031e7)&&_0xc876('0xe')===typeof _0x5031e7&&!_[_0xc876('0xf')](_0x5031e7)){if(!_[_0xc876('0xd')](_0x222acd)&&'string'===typeof _0x222acd&&!_[_0xc876('0xf')](_0x222acd)){return util[_0xc876('0x10')](_0xc876('0x11'),_0x222acd,_0x5031e7);}return util[_0xc876('0x10')]('\x22%s\x22\x20<%s>',_0x5031e7,_0x5031e7);}if(!_['isUndefined'](_0x2f52ac)&&'string'===typeof _0x2f52ac&&!_[_0xc876('0xf')](_0x2f52ac)){return _0x2f52ac;}return'\x22\x22\x20<>';};exports[_0xc876('0x12')]=function(_0x2231e5){if(_[_0xc876('0x13')](_0x2231e5)){return![];}return _0x2231e5;};exports['addVariables']=function(_0xbf2972,_0x3eabd5,_0xb9a4ab,_0x4b4472,_0x49b0bb,_0x52dacb){var _0x219703={'XMD-QUEUE':_0x3eabd5[_0xc876('0x14')]?_0x3eabd5[_0xc876('0x14')]['name']:'','XMD-CALLERID':_0x4b4472,'XMD-CALLERID-PREVIEW':_0x52dacb?util[_0xc876('0x10')](_0xc876('0x11'),_0x52dacb['calleridname'],_0x52dacb['calleridnum']):_0x4b4472,'XMD-DIALID':_0x49b0bb,'XMD-CONTACTID':_0x3eabd5['ContactId'],'XMD-CDRTYPE':_0xc876('0x15'),'CALLERID(all)':_0x4b4472,'XMD-VOICEQUEUEID':_0x3eabd5[_0xc876('0x16')],'XMD-DIALCHANNEL':_0xb9a4ab,'XMD-DIALTIMEOUT':_0xbf2972[_0xc876('0x17')]||0x1e,'XMD-DIALOPTIONS':util[_0xc876('0x10')](_0xc876('0x18'),_0xbf2972[_0xc876('0x19')]?'g':'',_[_0xc876('0xf')](_0xbf2972[_0xc876('0x1a')])?'':_0xc876('0x1b')),'XMD-DIALURL':_0xbf2972[_0xc876('0x1c')]||'','XMD-AGI':_0xbf2972[_0xc876('0x1d')]?util[_0xc876('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0xbf2972[_0xc876('0x1d')]):_0xc876('0x1e'),'XMD-AGIAFTER':_0xbf2972[_0xc876('0x19')]?util[_0xc876('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0xbf2972['dialQueueProject2']):_0xc876('0x1e'),'XMD-ORIGINATECALLERIDNUM':_0x52dacb?_0x52dacb[_0xc876('0x1f')]:'','XMD-ORIGINATECALLERIDNAME':_0x52dacb?_0x52dacb[_0xc876('0x20')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0xc876('0xf')](_0xbf2972[_0xc876('0x1a')])){_0x219703[util['format']('%s',_0xc876('0x21'))]=_0xbf2972[_0xc876('0x1a')];_0x219703[util[_0xc876('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x49b0bb;}if(_0x3eabd5&&_0x3eabd5[_0xc876('0x22')]){for(var _0x38e594 in _0x3eabd5[_0xc876('0x22')]){if(_0x3eabd5[_0xc876('0x22')]['hasOwnProperty'](_0x38e594)){if(!_[_0xc876('0x13')](_0x3eabd5[_0xc876('0x22')][_0x38e594])&&_0x38e594!=='id'&&_0x38e594!==_0xc876('0x23')&&_0x38e594!==_0xc876('0x24')&&_0x38e594!==_0xc876('0x25')){_0x219703[util[_0xc876('0x10')](_0xc876('0x26'),_0xc876('0x27'),_[_0xc876('0x28')](_0x38e594))]=_0x3eabd5['Contact'][_0x38e594];}}}}return _0x219703;};exports['toLowerVariables']=function(_0x567d47){var _0x358f8c={};for(var _0x321fc9 in _0x567d47){if(_0x567d47['hasOwnProperty'](_0x321fc9)){_0x358f8c[util['format']('%s',_['toLower'](_0x321fc9))]=_0x567d47[_0x321fc9];}}return{'variables':_0x358f8c};};exports[_0xc876('0x29')]=function(_0x3abd69,_0x148564){if(!_[_0xc876('0x13')](_0x3abd69)){if(_0x3abd69['hasOwnProperty'](_0xc876('0x2a'))){if(_0x3abd69[_0xc876('0x2a')]>0x0){_0x3abd69['originated']-=0x1;}else{logger[_0xc876('0x8')](_0xc876('0x2b'),_0x148564);}}}else{logger[_0xc876('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x148564);}};exports[_0xc876('0x2c')]=function(_0x11df7b){var _0x50df28=moment()['format'](_0xc876('0x2d'));_0x11df7b[_0xc876('0x2e')]=0xd;_0x11df7b[_0xc876('0x2f')]=_0xc876('0x30');_0x11df7b[_0xc876('0x31')]=_0x50df28;_0x11df7b[_0xc876('0x32')]=_0x50df28;_0x11df7b[_0xc876('0x33')]=_0x50df28;};exports[_0xc876('0x34')]=function(_0x119cb1,_0x4c3656,_0x1d83a3){var _0x126272=moment()[_0xc876('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x119cb1[_0xc876('0x2e')]=_0x4c3656;_0x119cb1['statedesc']=_0x1d83a3;_0x119cb1['responsetime']=_0x126272;_0x119cb1[_0xc876('0x35')]=getSeconds(_0x119cb1[_0xc876('0x32')],_0x119cb1['starttime']);};exports['logLookAgent']=function(_0x27cc64,_0xd9e8ee,_0x37651f){_0x27cc64[_0xc876('0x36')]=_0xd9e8ee;_0x27cc64[_0xc876('0x37')]=_0x37651f;};exports['logCustomer']=function(_0x2bef06,_0x2b9337,_0x168c58){var _0x44e847=moment()[_0xc876('0x10')](_0xc876('0x2d'));_0x2bef06[_0xc876('0x2e')]=_0x2b9337;_0x2bef06['statedesc']=_0x168c58;_0x2bef06[_0xc876('0x32')]=_0x2bef06[_0xc876('0x32')]?_0x2bef06['responsetime']:_0x44e847;_0x2bef06[_0xc876('0x33')]=_0x2bef06[_0xc876('0x33')]?_0x2bef06['endtime']:_0x44e847;_0x2bef06[_0xc876('0x35')]=getSeconds(_0x2bef06[_0xc876('0x32')]||0x0,_0x2bef06[_0xc876('0x31')]||0x0);_0x2bef06[_0xc876('0x38')]=_0x2bef06[_0xc876('0x39')]?getSeconds(_0x2bef06[_0xc876('0x33')],_0x2bef06[_0xc876('0x39')]):0x0;};exports[_0xc876('0x3a')]=function(_0x147e53){return _0x147e53===_0xc876('0x3b');};exports[_0xc876('0x3c')]=function(_0x4db48b,_0x1898ef,_0x5158f9,_0x3a4177,_0x278ddc){var _0x282b31=_0x3a4177?_0xc876('0x3d'):_0x4db48b[_0xc876('0x3e')];_0x282b31=_0x278ddc?_0xc876('0x3f'):_0x282b31;return{'actionid':_0x4db48b[_0xc876('0x40')],'action':'originate','channel':_0x4db48b[_0xc876('0x41')],'callerid':util[_0xc876('0x10')](_0xc876('0x11'),_0x282b31,_0x4db48b[_0xc876('0x42')]),'Exten':'xcally-motion-preview','Context':_0xc876('0x43'),'Priority':'1','variable':_0x5158f9,'timeout':(_0x1898ef[_0xc876('0x44')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4db48b[_0xc876('0x40')]};};exports['totalGlobal']=function(_0x3ae337){return _0x3ae337[_0xc876('0x45')]+_0x3ae337['countcongestionretry']+_0x3ae337[_0xc876('0x46')]+_0x3ae337[_0xc876('0x47')]+_0x3ae337['countnosuchnumberretry'];};exports[_0xc876('0x48')]=function(_0x12d9ab){var _0x3376f5=_['clone'](_0x12d9ab);_0x3376f5[_0xc876('0x2e')]=0xf;_0x3376f5['statedesc']=_0xc876('0x49');return _0x3376f5;};exports['scheduledAt']=function(_0x434f01,_0xbd927b,_0xa01059){var _0x1b1990={};_0x1b1990[_0xbd927b]=_0x434f01[_0xbd927b];_0x1b1990[_0xc876('0x4a')]=![];_0x1b1990['scheduledat']=moment()[_0xc876('0x4b')](_0xa01059,_0xc876('0x4c'))[_0xc876('0x10')](_0xc876('0x2d'));_0x1b1990[_0xc876('0x4d')]=_0x434f01[_0xc876('0x4d')];_0x1b1990[_0xc876('0x4e')]=_0x434f01[_0xc876('0x4e')];_0x1b1990[_0xc876('0x16')]=_0x434f01[_0xc876('0x16')]||undefined;return _0x1b1990;};exports['decrementTalkink']=function(_0x37d20c,_0x557dfc){if(!_[_0xc876('0x13')](_0x37d20c)){if(_0x37d20c[_0xc876('0x4f')]>0x0){_0x37d20c[_0xc876('0x4f')]-=0x1;}else{logger['error'](_0x557dfc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xc876('0x8')](_0x557dfc,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc876('0x50')]=function(_0x4e215a){if(_0x4e215a<=0x0){return!![];}return![];};exports[_0xc876('0x51')]=function(_0x4bb5eb,_0xa44b3,_0x3d2819){_0x4bb5eb[_0xc876('0x52')]=_0xa44b3;_0x4bb5eb[_0xc876('0x53')]=_0x4bb5eb[_0xc876('0x54')];_0x4bb5eb[_0xc876('0x55')]=_0x4bb5eb[_0xc876('0x41')];_0x4bb5eb[_0xc876('0x56')]=_0xc876('0x57');if(_0x3d2819){_0x4bb5eb['mandatoryDisposition']=_0x3d2819['mandatoryDisposition'];}return _0x4bb5eb;};exports['buildAcw']=function(_0x376e81){var _0x534024={};_0x534024[_0xc876('0x54')]=_0x376e81[_0xc876('0x54')];_0x534024['interface']=_0x376e81[_0xc876('0x41')];_0x534024[_0xc876('0x40')]=_0x376e81['uniqueid'];return _0x534024;};exports[_0xc876('0x58')]=function(_0x266640){var _0x4f17f1=[];for(var _0x3cf204 in _0x266640){if(_0x266640['hasOwnProperty'](_0x3cf204)){if(!_[_0xc876('0x13')](_0x266640[_0x3cf204])&&_0x266640[_0x3cf204][_0xc876('0x2e')]===_0xc876('0x59')&&_0x266640[_0x3cf204][_0xc876('0x5a')]===_0xc876('0x5b')){_0x4f17f1['push'](_0x266640[_0x3cf204]['id']);}}}return _0x4f17f1;};exports[_0xc876('0x5c')]=function(_0x30244a){var _0x49e265=moment()[_0xc876('0x5')](0x0);var _0x7fa821=moment(_0x30244a)['milliseconds'](0x0);return _0x49e265[_0xc876('0x5d')](_0x7fa821,_0xc876('0x6'));};exports['createBody']=function(_0x28f05e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x28f05e[_0xc876('0x4d')],'ListId':_0x28f05e[_0xc876('0x4e')],'VoiceQueueId':_0x28f05e[_0xc876('0x16')]||undefined,'CampaignId':_0x28f05e[_0xc876('0x5e')]||undefined};};exports[_0xc876('0x5f')]=function(_0x444ba7){if(_0x444ba7==='uniqueid'||_0x444ba7===_0xc876('0x60')||_0x444ba7===_0xc876('0x54')||_0x444ba7===_0xc876('0x61')||_0x444ba7===_0xc876('0x62')||_0x444ba7==='dialAnswer'||_0x444ba7===_0xc876('0x36')||_0x444ba7===_0xc876('0x41')||_0x444ba7==='calleridname'||_0x444ba7==='active'||_0x444ba7===_0xc876('0x42')||_0x444ba7===_0xc876('0x63')||_0x444ba7==='countbusyretry'||_0x444ba7===_0xc876('0x64')||_0x444ba7===_0xc876('0x46')||_0x444ba7==='countglobal'||_0x444ba7===_0xc876('0x65')||_0x444ba7==='callbackuniqueid'||_0x444ba7===_0xc876('0x66')||_0x444ba7===_0xc876('0x67')||_0x444ba7===_0xc876('0x4d')||_0x444ba7===_0xc876('0x4e')||_0x444ba7===_0xc876('0x37')||_0x444ba7===_0xc876('0x16')||_0x444ba7===_0xc876('0x68')||_0x444ba7===_0xc876('0x69')||_0x444ba7===_0xc876('0x6a')||_0x444ba7===_0xc876('0x6b')||_0x444ba7==='xmd-listid'||_0x444ba7==='xmd-dialurl'||_0x444ba7===_0xc876('0x6c')||_0x444ba7===_0xc876('0x6d')||_0x444ba7===_0xc876('0x6e')||_0x444ba7==='xmd-dialchannel'||_0x444ba7===_0xc876('0x6f')||_0x444ba7==='xmd-cdrtype'||_0x444ba7===_0xc876('0x70')||_0x444ba7===_0xc876('0x71')||_0x444ba7===_0xc876('0x72')||_0x444ba7===_0xc876('0x73')||_0x444ba7===_0xc876('0x74')||_0x444ba7===_0xc876('0x75')||_0x444ba7===_0xc876('0x76')||_0x444ba7===_0xc876('0x77')||_0x444ba7==='rtpaudioqoslossbridged'||_0x444ba7===_0xc876('0x78')||_0x444ba7===_0xc876('0x79')||_0x444ba7===_0xc876('0x73')||_0x444ba7===_0xc876('0x74')||_0x444ba7==='rtpaudioqosjitter'||_0x444ba7===_0xc876('0x76')||_0x444ba7===_0xc876('0x77')||_0x444ba7==='rtpaudioqoslossbridged'||_0x444ba7==='rtpaudioqosrtt'||_0x444ba7===_0xc876('0x79')||_0x444ba7===_0xc876('0x7a')||_0x444ba7===_0xc876('0x7b')||_0x444ba7===_0xc876('0x2e')||_0x444ba7===_0xc876('0x2f')){return![];}return!![];};exports[_0xc876('0x7c')]=function(_0x546c26,_0x123484){var _0x47ceb7,_0x4aeff7,_0x21fa18;if(_0x123484<=0x0){_0x123484=0x1;}_0x47ceb7=new RegExp(_0xc876('0x7d')+_0x123484+'}$');_0x4aeff7=Math[_0xc876('0x7e')](0xa,_0x123484-0x1);_0x21fa18=Math[_0xc876('0x7e')](0xa,_0x123484)-0x1;return util['format']('%s',_[_0xc876('0x7f')](_0x546c26,_0x47ceb7,_[_0xc876('0x80')](_0x4aeff7,_0x21fa18)));};exports[_0xc876('0x81')]=function(_0x4dffbb){var _0x1a6197=_0x4dffbb[_0xc876('0x82')](/"(.*?)"/);return _0x1a6197?_0x1a6197[0x1]:_0x4dffbb;};exports['extractCalleridNumber']=function(_0x18f9ec){var _0x2980d2=_0x18f9ec[_0xc876('0x82')](/<(.*?)>/);return _0x2980d2?_0x2980d2[0x1]:_0x18f9ec;};
\ No newline at end of file
+var _0x7ea3=['membername','scheduledat','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridNumber','match','util','lodash','moment','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','loggerError','info','inspect','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','hasOwnProperty','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','endtime','logAgent','statedesc','responsetime','starttime','logLookAgent','UserId','ringtime','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','not_inuse','status','reachable','push','getDiff','createBody','idContact','type'];(function(_0x3a1386,_0x2c4f24){var _0x10089a=function(_0x50a134){while(--_0x50a134){_0x3a1386['push'](_0x3a1386['shift']());}};_0x10089a(++_0x2c4f24);}(_0x7ea3,0x138));var _0x37ea=function(_0x59bd6a,_0x540db8){_0x59bd6a=_0x59bd6a-0x0;var _0x54ffd0=_0x7ea3[_0x59bd6a];return _0x54ffd0;};'use strict';var util=require(_0x37ea('0x0'));var _=require(_0x37ea('0x1'));var moment=require(_0x37ea('0x2'));var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0x37ea('0x3')][_0x37ea('0x4')]||_0x37ea('0x5');function getSeconds(_0x238a94,_0x2a2e71){var _0x2b8e66=moment(_0x238a94)['milliseconds'](0x0);var _0x3f7697=moment(_0x2a2e71)[_0x37ea('0x6')](0x0);return _0x2b8e66[_0x37ea('0x7')](_0x3f7697,_0x37ea('0x8'));}exports[_0x37ea('0x9')]=function(_0x3bd63a){return function(_0x58922c){logger['error'](_0x3bd63a,util['inspect'](_0x58922c,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0xa9061f,_0x172653){logger['info'](_0xa9061f,util['inspect'](_0x172653,{'showHidden':![],'depth':null}));};exports[_0x37ea('0xa')]=function(_0x16d2b2,_0x2193b7){logger['error'](_0x16d2b2,util['inspect'](_0x2193b7,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3ce46f){return function(_0x4666e6){logger[_0x37ea('0xb')](_0x3ce46f,util[_0x37ea('0xc')](_0x4666e6,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x400c4a,_0x565505,_0x43b32b){return{'message':_0x400c4a,'unlock':_0x565505,'active':_0x43b32b};};exports['getCallerId']=function(_0x4a1529,_0x1eaedb,_0x5c1fb3){if(!_['isUndefined'](_0x5c1fb3)&&_0x37ea('0xd')===typeof _0x5c1fb3&&!_[_0x37ea('0xe')](_0x5c1fb3)){if(!_[_0x37ea('0xf')](_0x1eaedb)&&_0x37ea('0xd')===typeof _0x1eaedb&&!_['isEmpty'](_0x1eaedb)){return util[_0x37ea('0x10')](_0x37ea('0x11'),_0x1eaedb,_0x5c1fb3);}return util[_0x37ea('0x10')]('\x22%s\x22\x20<%s>',_0x5c1fb3,_0x5c1fb3);}if(!_['isUndefined'](_0x4a1529)&&_0x37ea('0xd')===typeof _0x4a1529&&!_['isEmpty'](_0x4a1529)){return _0x4a1529;}return _0x37ea('0x12');};exports[_0x37ea('0x13')]=function(_0x4afad1){if(_['isNil'](_0x4afad1)){return![];}return _0x4afad1;};exports['addVariables']=function(_0x6805f1,_0x3dbb10,_0x5e52ce,_0x366031,_0x4aa2e2,_0x42e3e2){var _0x4a4a99={'XMD-QUEUE':_0x3dbb10[_0x37ea('0x14')]?_0x3dbb10[_0x37ea('0x14')][_0x37ea('0x15')]:'','XMD-CALLERID':_0x366031,'XMD-CALLERID-PREVIEW':_0x42e3e2?util[_0x37ea('0x10')](_0x37ea('0x11'),_0x42e3e2[_0x37ea('0x16')],_0x42e3e2[_0x37ea('0x17')]):_0x366031,'XMD-DIALID':_0x4aa2e2,'XMD-CONTACTID':_0x3dbb10[_0x37ea('0x18')],'XMD-CDRTYPE':_0x37ea('0x19'),'CALLERID(all)':_0x366031,'XMD-VOICEQUEUEID':_0x3dbb10[_0x37ea('0x1a')],'XMD-DIALCHANNEL':_0x5e52ce,'XMD-DIALTIMEOUT':_0x6805f1[_0x37ea('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x37ea('0x10')]('\x22rtTxX%s%s\x22',_0x6805f1[_0x37ea('0x1c')]?'g':'',_['isEmpty'](_0x6805f1['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x6805f1[_0x37ea('0x1d')]||'','XMD-AGI':_0x6805f1[_0x37ea('0x1e')]?util['format'](_0x37ea('0x1f'),ipAgi,_0x6805f1[_0x37ea('0x1e')]):_0x37ea('0x20'),'XMD-AGIAFTER':_0x6805f1[_0x37ea('0x1c')]?util[_0x37ea('0x10')](_0x37ea('0x1f'),ipAgi,_0x6805f1[_0x37ea('0x1c')]):_0x37ea('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x42e3e2?_0x42e3e2[_0x37ea('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x42e3e2?_0x42e3e2[_0x37ea('0x22')]:'','XMD-DESTINATION':_0x37ea('0x23')};if(!_[_0x37ea('0xe')](_0x6805f1[_0x37ea('0x24')])){_0x4a4a99[util[_0x37ea('0x10')]('%s',_0x37ea('0x25'))]=_0x6805f1['monitor_format'];_0x4a4a99[util[_0x37ea('0x10')]('%s',_0x37ea('0x26'))]=_0x4aa2e2;}if(_0x3dbb10&&_0x3dbb10[_0x37ea('0x27')]){for(var _0x8aad76 in _0x3dbb10['Contact']){if(_0x3dbb10[_0x37ea('0x27')]['hasOwnProperty'](_0x8aad76)){if(!_[_0x37ea('0x28')](_0x3dbb10[_0x37ea('0x27')][_0x8aad76])&&_0x8aad76!=='id'&&_0x8aad76!==_0x37ea('0x29')&&_0x8aad76!==_0x37ea('0x2a')&&_0x8aad76!==_0x37ea('0x2b')){_0x4a4a99[util[_0x37ea('0x10')](_0x37ea('0x2c'),_0x37ea('0x2d'),_[_0x37ea('0x2e')](_0x8aad76))]=_0x3dbb10['Contact'][_0x8aad76];}}}}return _0x4a4a99;};exports['toLowerVariables']=function(_0x3f2aed){var _0x32bcd7={};for(var _0x20cbe5 in _0x3f2aed){if(_0x3f2aed['hasOwnProperty'](_0x20cbe5)){_0x32bcd7[util[_0x37ea('0x10')]('%s',_[_0x37ea('0x2f')](_0x20cbe5))]=_0x3f2aed[_0x20cbe5];}}return{'variables':_0x32bcd7};};exports[_0x37ea('0x30')]=function(_0x45f03c,_0x4d2077){if(!_[_0x37ea('0x28')](_0x45f03c)){if(_0x45f03c[_0x37ea('0x31')]('originated')){if(_0x45f03c[_0x37ea('0x32')]>0x0){_0x45f03c[_0x37ea('0x32')]-=0x1;}else{logger[_0x37ea('0x33')](_0x37ea('0x34'),_0x4d2077);}}}else{logger[_0x37ea('0x33')](_0x37ea('0x35'),_0x4d2077);}};exports[_0x37ea('0x36')]=function(_0x5e6fc5){var _0x328b55=moment()[_0x37ea('0x10')](_0x37ea('0x37'));_0x5e6fc5[_0x37ea('0x38')]=0xd;_0x5e6fc5['statedesc']=_0x37ea('0x39');_0x5e6fc5['starttime']=_0x328b55;_0x5e6fc5['responsetime']=_0x328b55;_0x5e6fc5[_0x37ea('0x3a')]=_0x328b55;};exports[_0x37ea('0x3b')]=function(_0x4a4ad0,_0x1b566d,_0x3b00a3){var _0x20c489=moment()['format'](_0x37ea('0x37'));_0x4a4ad0[_0x37ea('0x38')]=_0x1b566d;_0x4a4ad0[_0x37ea('0x3c')]=_0x3b00a3;_0x4a4ad0[_0x37ea('0x3d')]=_0x20c489;_0x4a4ad0['ringtime']=getSeconds(_0x4a4ad0[_0x37ea('0x3d')],_0x4a4ad0[_0x37ea('0x3e')]);};exports[_0x37ea('0x3f')]=function(_0x305fce,_0x504f2b,_0x4d5d30){_0x305fce['membername']=_0x504f2b;_0x305fce[_0x37ea('0x40')]=_0x4d5d30;};exports['logCustomer']=function(_0x1eadc6,_0x2431eb,_0x29c20b){var _0x6008ef=moment()[_0x37ea('0x10')](_0x37ea('0x37'));_0x1eadc6[_0x37ea('0x38')]=_0x2431eb;_0x1eadc6[_0x37ea('0x3c')]=_0x29c20b;_0x1eadc6['responsetime']=_0x1eadc6['responsetime']?_0x1eadc6[_0x37ea('0x3d')]:_0x6008ef;_0x1eadc6[_0x37ea('0x3a')]=_0x1eadc6[_0x37ea('0x3a')]?_0x1eadc6[_0x37ea('0x3a')]:_0x6008ef;_0x1eadc6[_0x37ea('0x41')]=getSeconds(_0x1eadc6[_0x37ea('0x3d')]||0x0,_0x1eadc6[_0x37ea('0x3e')]||0x0);_0x1eadc6[_0x37ea('0x42')]=_0x1eadc6[_0x37ea('0x43')]?getSeconds(_0x1eadc6[_0x37ea('0x3a')],_0x1eadc6[_0x37ea('0x43')]):0x0;};exports[_0x37ea('0x44')]=function(_0x1908e8){return _0x1908e8===_0x37ea('0x45');};exports[_0x37ea('0x46')]=function(_0x1fbe06,_0xa8733e,_0x57ebc5,_0x19dd92,_0x2c037f){var _0x57f310=_0x19dd92?'RECALL':_0x1fbe06['calleridname'];_0x57f310=_0x2c037f?_0x37ea('0x47'):_0x57f310;return{'actionid':_0x1fbe06[_0x37ea('0x48')],'action':_0x37ea('0x49'),'channel':_0x1fbe06['channelAgent'],'callerid':util[_0x37ea('0x10')]('\x22%s\x22\x20<%s>',_0x57f310,_0x1fbe06[_0x37ea('0x17')]),'Exten':_0x37ea('0x23'),'Context':_0x37ea('0x4a'),'Priority':'1','variable':_0x57ebc5,'timeout':(_0xa8733e[_0x37ea('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1fbe06['uniqueid']};};exports['totalGlobal']=function(_0x16f118){return _0x16f118[_0x37ea('0x4c')]+_0x16f118[_0x37ea('0x4d')]+_0x16f118[_0x37ea('0x4e')]+_0x16f118[_0x37ea('0x4f')]+_0x16f118[_0x37ea('0x50')];};exports['cloneAction']=function(_0x1a5592){var _0x2cc7e2=_['clone'](_0x1a5592);_0x2cc7e2['state']=0xf;_0x2cc7e2[_0x37ea('0x3c')]=_0x37ea('0x51');return _0x2cc7e2;};exports[_0x37ea('0x52')]=function(_0xb0a5f,_0xdc1b9c,_0x8b4a0a){var _0x169270={};_0x169270[_0xdc1b9c]=_0xb0a5f[_0xdc1b9c];_0x169270[_0x37ea('0x53')]=![];_0x169270['scheduledat']=moment()[_0x37ea('0x54')](_0x8b4a0a,_0x37ea('0x55'))[_0x37ea('0x10')](_0x37ea('0x37'));_0x169270[_0x37ea('0x18')]=_0xb0a5f[_0x37ea('0x18')];_0x169270[_0x37ea('0x56')]=_0xb0a5f['ListId'];_0x169270[_0x37ea('0x1a')]=_0xb0a5f[_0x37ea('0x1a')]||undefined;return _0x169270;};exports[_0x37ea('0x57')]=function(_0x49ca67,_0x46c978){if(!_[_0x37ea('0x28')](_0x49ca67)){if(_0x49ca67[_0x37ea('0x58')]>0x0){_0x49ca67[_0x37ea('0x58')]-=0x1;}else{logger[_0x37ea('0x33')](_0x46c978,_0x37ea('0x59'));}}else{logger[_0x37ea('0x33')](_0x46c978,_0x37ea('0x5a'));}};exports[_0x37ea('0x5b')]=function(_0x595624){if(_0x595624<=0x0){return!![];}return![];};exports[_0x37ea('0x5c')]=function(_0x5dc11d,_0x1de361,_0x3a6a0a){_0x5dc11d['lastevent']=_0x1de361;_0x5dc11d[_0x37ea('0x15')]=_0x5dc11d[_0x37ea('0x5d')];_0x5dc11d[_0x37ea('0x5e')]=_0x5dc11d[_0x37ea('0x5f')];_0x5dc11d[_0x37ea('0x60')]=_0x37ea('0x61');if(_0x3a6a0a){_0x5dc11d['mandatoryDisposition']=_0x3a6a0a[_0x37ea('0x62')];}return _0x5dc11d;};exports[_0x37ea('0x63')]=function(_0xfa2a26){var _0x34d6cc={};_0x34d6cc['queue']=_0xfa2a26[_0x37ea('0x5d')];_0x34d6cc[_0x37ea('0x5e')]=_0xfa2a26[_0x37ea('0x5f')];_0x34d6cc['uniqueid']=_0xfa2a26[_0x37ea('0x48')];return _0x34d6cc;};exports['agentReadyId']=function(_0x45dfa8){var _0xa0e31b=[];for(var _0x10f08d in _0x45dfa8){if(_0x45dfa8[_0x37ea('0x31')](_0x10f08d)){if(!_['isNil'](_0x45dfa8[_0x10f08d])&&_0x45dfa8[_0x10f08d][_0x37ea('0x38')]===_0x37ea('0x64')&&_0x45dfa8[_0x10f08d][_0x37ea('0x65')]===_0x37ea('0x66')){_0xa0e31b[_0x37ea('0x67')](_0x45dfa8[_0x10f08d]['id']);}}}return _0xa0e31b;};exports[_0x37ea('0x68')]=function(_0x511192){var _0x5c2a75=moment()[_0x37ea('0x6')](0x0);var _0x9e33d4=moment(_0x511192)[_0x37ea('0x6')](0x0);return _0x5c2a75[_0x37ea('0x7')](_0x9e33d4,_0x37ea('0x8'));};exports[_0x37ea('0x69')]=function(_0x18a511){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x18a511['ContactId'],'ListId':_0x18a511[_0x37ea('0x56')],'VoiceQueueId':_0x18a511['VoiceQueueId']||undefined,'CampaignId':_0x18a511['CampaignId']||undefined};};exports['filterKey']=function(_0x3596f2){if(_0x3596f2===_0x37ea('0x48')||_0x3596f2===_0x37ea('0x6a')||_0x3596f2===_0x37ea('0x5d')||_0x3596f2===_0x37ea('0x6b')||_0x3596f2==='campaigntype'||_0x3596f2==='dialAnswer'||_0x3596f2===_0x37ea('0x6c')||_0x3596f2==='channelAgent'||_0x3596f2==='calleridname'||_0x3596f2===_0x37ea('0x53')||_0x3596f2==='calleridnum'||_0x3596f2===_0x37ea('0x6d')||_0x3596f2===_0x37ea('0x4c')||_0x3596f2===_0x37ea('0x4d')||_0x3596f2===_0x37ea('0x4e')||_0x3596f2==='countglobal'||_0x3596f2===_0x37ea('0x6e')||_0x3596f2===_0x37ea('0x6f')||_0x3596f2===_0x37ea('0x70')||_0x3596f2===_0x37ea('0x71')||_0x3596f2==='ContactId'||_0x3596f2==='ListId'||_0x3596f2==='UserId'||_0x3596f2===_0x37ea('0x1a')||_0x3596f2===_0x37ea('0x72')||_0x3596f2===_0x37ea('0x73')||_0x3596f2===_0x37ea('0x74')||_0x3596f2===_0x37ea('0x75')||_0x3596f2==='xmd-listid'||_0x3596f2===_0x37ea('0x76')||_0x3596f2===_0x37ea('0x77')||_0x3596f2==='xmd-dialoptions'||_0x3596f2===_0x37ea('0x78')||_0x3596f2===_0x37ea('0x79')||_0x3596f2==='xmd-contactid'||_0x3596f2===_0x37ea('0x7a')||_0x3596f2===_0x37ea('0x7b')||_0x3596f2===_0x37ea('0x7c')||_0x3596f2==='xmd-agi'||_0x3596f2===_0x37ea('0x7d')||_0x3596f2===_0x37ea('0x7e')||_0x3596f2===_0x37ea('0x7f')||_0x3596f2===_0x37ea('0x80')||_0x3596f2===_0x37ea('0x81')||_0x3596f2===_0x37ea('0x82')||_0x3596f2==='rtpaudioqosrtt'||_0x3596f2===_0x37ea('0x83')||_0x3596f2==='rtpaudioqos'||_0x3596f2===_0x37ea('0x7e')||_0x3596f2===_0x37ea('0x7f')||_0x3596f2===_0x37ea('0x80')||_0x3596f2===_0x37ea('0x81')||_0x3596f2==='rtpaudioqoslossbridged'||_0x3596f2==='rtpaudioqosrtt'||_0x3596f2===_0x37ea('0x83')||_0x3596f2===_0x37ea('0x84')||_0x3596f2===_0x37ea('0x85')||_0x3596f2===_0x37ea('0x38')||_0x3596f2==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x27bb3d,_0x1c821c){var _0x424b5d,_0x339c71,_0x530fdd;if(_0x1c821c<=0x0){_0x1c821c=0x1;}_0x424b5d=new RegExp(_0x37ea('0x86')+_0x1c821c+'}$');_0x339c71=Math[_0x37ea('0x87')](0xa,_0x1c821c-0x1);_0x530fdd=Math[_0x37ea('0x87')](0xa,_0x1c821c)-0x1;return util['format']('%s',_[_0x37ea('0x88')](_0x27bb3d,_0x424b5d,_[_0x37ea('0x89')](_0x339c71,_0x530fdd)));};exports['extractCalleridName']=function(_0x5391c7){var _0x4a64a8=_0x5391c7['match'](/"(.*?)"/);return _0x4a64a8?_0x4a64a8[0x1]:_0x5391c7;};exports[_0x37ea('0x8a')]=function(_0x5e4f57){var _0x196df8=_0x5e4f57[_0x37ea('0x8b')](/<(.*?)>/);return _0x196df8?_0x196df8[0x1]:_0x5e4f57;};
\ No newline at end of file
index b9b8e64..68da3fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8625=['string','number','boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8625,0x90));var _0x5862=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x8625[_0x5235a6];return _0x1cf37e;};'use strict';exports['queueadd']={'queue':{'type':_0x5862('0x0'),'required':!![]},'interface':{'type':_0x5862('0x0'),'required':!![]},'membername':{'type':_0x5862('0x0'),'required':!![]},'penalty':{'type':_0x5862('0x1'),'required':![]},'paused':{'type':_0x5862('0x2'),'required':![]}};exports[_0x5862('0x3')]={'queue':{'type':_0x5862('0x0'),'required':!![]},'interface':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x4')]={'interface':{'type':_0x5862('0x0'),'required':!![]},'paused':{'type':_0x5862('0x2')},'reason':{'type':_0x5862('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x5862('0x0'),'required':![]}};exports[_0x5862('0x5')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x5862('0x0')},'format':{'type':_0x5862('0x0')},'mixmonitorid':{'type':_0x5862('0x0')}};exports[_0x5862('0x7')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]}};exports[_0x5862('0x8')]={'uniqueid':{'type':_0x5862('0x0'),'required':!![]},'exten':{'type':_0x5862('0x0'),'required':!![]},'context':{'type':_0x5862('0x0')}};
\ No newline at end of file
+var _0xf6a0=['string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x1fec6f,_0x3f9a37){var _0xa9ca4c=function(_0x4594cd){while(--_0x4594cd){_0x1fec6f['push'](_0x1fec6f['shift']());}};_0xa9ca4c(++_0x3f9a37);}(_0xf6a0,0x1b0));var _0x0f6a=function(_0x16a2f3,_0x5f1d24){_0x16a2f3=_0x16a2f3-0x0;var _0x535b3b=_0xf6a0[_0x16a2f3];return _0x535b3b;};'use strict';exports['queueadd']={'queue':{'type':_0x0f6a('0x0'),'required':!![]},'interface':{'type':_0x0f6a('0x0'),'required':!![]},'membername':{'type':_0x0f6a('0x0'),'required':!![]},'penalty':{'type':_0x0f6a('0x1'),'required':![]},'paused':{'type':_0x0f6a('0x2'),'required':![]}};exports[_0x0f6a('0x3')]={'queue':{'type':_0x0f6a('0x0'),'required':!![]},'interface':{'type':_0x0f6a('0x0'),'required':!![]}};exports[_0x0f6a('0x4')]={'interface':{'type':_0x0f6a('0x0'),'required':!![]},'paused':{'type':_0x0f6a('0x2')},'reason':{'type':_0x0f6a('0x0'),'required':![]}};exports[_0x0f6a('0x5')]={'module':{'type':_0x0f6a('0x0'),'required':![]}};exports[_0x0f6a('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x0f6a('0x7')]={'uniqueid':{'type':_0x0f6a('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x0f6a('0x0')},'mixmonitorid':{'type':_0x0f6a('0x0')}};exports[_0x0f6a('0x8')]={'uniqueid':{'type':_0x0f6a('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x0f6a('0x0'),'required':!![]},'context':{'type':_0x0f6a('0x0')}};
\ No newline at end of file
index 4104787..695fcd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f2e=['queue','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','outbound','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','agents','length','isUndefined','initTelephones','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid'];(function(_0x13e9b0,_0x454fe9){var _0x28aca2=function(_0x510d77){while(--_0x510d77){_0x13e9b0['push'](_0x13e9b0['shift']());}};_0x28aca2(++_0x454fe9);}(_0x6f2e,0x7f));var _0xe6f2=function(_0x278e69,_0x1b80ef){_0x278e69=_0x278e69-0x0;var _0x4e9595=_0x6f2e[_0x278e69];return _0x4e9595;};'use strict';var BPromise=require(_0xe6f2('0x0'));var util=require(_0xe6f2('0x1'));var _=require(_0xe6f2('0x2'));var moment=require(_0xe6f2('0x3'));var Agent=require(_0xe6f2('0x4'));var Telephone=require(_0xe6f2('0x5'));var Trunk=require(_0xe6f2('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xe6f2('0x7'));var Campaign=require(_0xe6f2('0x8'));var VoiceExtension=require(_0xe6f2('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xe6f2('0xa'));var FreshdeskAccount=require(_0xe6f2('0xb'));var SugarcrmAccount=require(_0xe6f2('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xe6f2('0xd'));var VtigerAccount=require(_0xe6f2('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xe6f2('0xf'));var FreshsalesAccount=require(_0xe6f2('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this['agents']={};this[_0xe6f2('0x11')]={};this[_0xe6f2('0x12')]={};this[_0xe6f2('0x13')]={};this[_0xe6f2('0x14')]={};this['campaigns']={};this[_0xe6f2('0x15')]={};this[_0xe6f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xe6f2('0x17')]={};this[_0xe6f2('0x18')]={};this[_0xe6f2('0x19')]={};this['timers']={};this['settings']={};this[_0xe6f2('0x1a')]={};this[_0xe6f2('0x1b')]={};this[_0xe6f2('0x1c')]={};this['freshdeskAccounts']={};this[_0xe6f2('0x1d')]={};this[_0xe6f2('0x1e')]={};this[_0xe6f2('0x1f')]={};this['servicenowAccounts']={};this[_0xe6f2('0x20')]={};this[_0xe6f2('0x21')]={};this[_0xe6f2('0x22')]={};};function freeIsNotKey(_0x352616,_0x5c3fec,_0x466fc1){var _0x459945=_[_0xe6f2('0x23')](_0x352616,function(_0xa911c4,_0x31a027){return _0xa911c4[_0x466fc1];});for(var _0x47beee in _0x5c3fec){if(_0x5c3fec[_0xe6f2('0x24')](_0x47beee)){if(!_0x459945[_0x47beee]){delete _0x5c3fec[_0x47beee];}}}}function freeIsNotKeySip(_0x24b742,_0xc2dca2){var _0x2e23c4=_[_0xe6f2('0x23')](_0x24b742,function(_0x40977c,_0x1193f0){return util['format'](_0xe6f2('0x25'),_0x40977c[_0xe6f2('0x26')]);});for(var _0x31773f in _0xc2dca2){if(_0xc2dca2['hasOwnProperty'](_0x31773f)){if(!_0x2e23c4[_0x31773f]){delete _0xc2dca2[_0x31773f];}}}}function freeIsNotKeyAgent(_0x4e0af6,_0x162799){var _0x39564b=_[_0xe6f2('0x23')](_0x4e0af6,function(_0x2d8af7,_0x3689df){var _0x34ff28=_[_0xe6f2('0x27')](_0x2d8af7[_0xe6f2('0x28')])?util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x2d8af7[_0xe6f2('0x26')]):_0x2d8af7[_0xe6f2('0x28')];return _0x34ff28;});for(var _0x5a495a in _0x162799){if(_0x162799['hasOwnProperty'](_0x5a495a)){if(!_0x39564b[_0x5a495a]){delete _0x162799[_0x5a495a];}}}}function clearVoiceCallReports(_0x44a69a){_0x44a69a[_0xe6f2('0x2a')]=0x0;_0x44a69a[_0xe6f2('0x2b')]=0x0;_0x44a69a[_0xe6f2('0x2c')]=0x0;_0x44a69a[_0xe6f2('0x2d')]=0x0;_0x44a69a['sumBillable']=0x0;}function clearCampaigns(_0x2e753a){if(!_[_0xe6f2('0x2e')](_0x2e753a)){for(var _0x283fe7 in _0x2e753a){if(_0x2e753a['hasOwnProperty'](_0x283fe7)){_0x2e753a[_0x283fe7][_0xe6f2('0x2f')]=0x0;_0x2e753a[_0x283fe7]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x402f79){if(!_[_0xe6f2('0x2e')](_0x402f79)){for(var _0x65027f in _0x402f79){if(_0x402f79[_0xe6f2('0x24')](_0x65027f)){_0x402f79[_0x65027f]['total']=0x0;_0x402f79[_0x65027f]['answered']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x30')]=0x0;_0x402f79[_0x65027f]['abandoned']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x2c')]=0x0;_0x402f79[_0x65027f]['sumDuration']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x31')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x32')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x33')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x34')]=0x0;_0x402f79[_0x65027f]['outboundCongestionCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x35')]=0x0;_0x402f79[_0x65027f]['outboundUnknownCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x36')]=0x0;_0x402f79[_0x65027f]['outboundDropCallsDayCallersExit']=0x0;_0x402f79[_0x65027f]['outboundBlacklistCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x37')]=0x0;_0x402f79[_0x65027f]['outboundRejectCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x38')]=0x0;_0x402f79[_0x65027f]['outboundAnswerAgiCallsDay']=0x0;_0x402f79[_0x65027f][_0xe6f2('0x39')]=0x0;_0x402f79[_0x65027f][_0xe6f2('0x3a')]=!![];}}}}Realtime['prototype'][_0xe6f2('0x3b')]=function(_0xb3522e,_0x3e9784){for(var _0x4a49de in _0x3e9784){if(_0xb3522e[_0xe6f2('0x24')](_0x4a49de)){_0xb3522e[_0x4a49de]=_0x3e9784[_0x4a49de];}}};Realtime[_0xe6f2('0x3c')]['initAgents']=function(){var _0x26f1ad=this;return function(_0x3268ae){if(_0x3268ae){freeIsNotKeyAgent(_0x3268ae,_0x26f1ad[_0xe6f2('0x3d')]);for(var _0x5f2e1b=0x0,_0x498ae3={},_0x37f7de={};_0x5f2e1b<_0x3268ae[_0xe6f2('0x3e')];_0x5f2e1b+=0x1){_0x498ae3=_0x3268ae[_0x5f2e1b];var _0x4335a1=_[_0xe6f2('0x27')](_0x498ae3[_0xe6f2('0x28')])?util[_0xe6f2('0x29')]('SIP/%s',_0x498ae3[_0xe6f2('0x26')]):_0x498ae3[_0xe6f2('0x28')];if(_[_0xe6f2('0x3f')](_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1])){_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1]=new Agent(_0x498ae3);}else{_0x26f1ad[_0xe6f2('0x3b')](_0x26f1ad[_0xe6f2('0x3d')][_0x4335a1],_0x498ae3);}}}return _0x26f1ad[_0xe6f2('0x3d')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x40')]=function(){var _0x5c478c=this;return function(_0x405619){if(_0x405619){freeIsNotKeySip(_0x405619,_0x5c478c['telephones']);for(var _0x1475a5=0x0,_0x58b8ff={},_0x3a6b05={};_0x1475a5<_0x405619[_0xe6f2('0x3e')];_0x1475a5+=0x1){_0x58b8ff=_0x405619[_0x1475a5];if(_[_0xe6f2('0x3f')](_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')]('SIP/%s',_0x58b8ff[_0xe6f2('0x26')])])){_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x58b8ff[_0xe6f2('0x26')])]=new Telephone(_0x58b8ff);}else{_0x5c478c[_0xe6f2('0x3b')](_0x5c478c[_0xe6f2('0x11')][util[_0xe6f2('0x29')]('SIP/%s',_0x58b8ff[_0xe6f2('0x26')])],_0x58b8ff);}}}return _0x5c478c[_0xe6f2('0x11')];};};Realtime[_0xe6f2('0x3c')]['initTrunks']=function(){var _0x13a756=this;return function(_0x58baf1){if(_0x58baf1){freeIsNotKeySip(_0x58baf1,_0x13a756['trunks']);for(var _0x53ffc4=0x0,_0x5e800b={},_0x19e562={};_0x53ffc4<_0x58baf1[_0xe6f2('0x3e')];_0x53ffc4+=0x1){_0x5e800b=_0x58baf1[_0x53ffc4];if(_[_0xe6f2('0x3f')](_0x13a756['trunks'][util[_0xe6f2('0x29')](_0xe6f2('0x25'),_0x5e800b[_0xe6f2('0x26')])])){_0x13a756[_0xe6f2('0x12')][util['format'](_0xe6f2('0x25'),_0x5e800b['name'])]=new Trunk(_0x5e800b);}else{_0x13a756['mergeFromDatabase'](_0x13a756[_0xe6f2('0x12')][util['format'](_0xe6f2('0x25'),_0x5e800b[_0xe6f2('0x26')])],_0x5e800b);}}}return _0x13a756['trunks'];};};Realtime[_0xe6f2('0x3c')]['initVoiceQueues']=function(){var _0x4111bc=this;return function(_0xf5537){if(_0xf5537){freeIsNotKey(_0xf5537,_0x4111bc[_0xe6f2('0x13')],_0xe6f2('0x26'));for(var _0x5cadd4=0x0,_0x4f3018={},_0x32a257={};_0x5cadd4<_0xf5537[_0xe6f2('0x3e')];_0x5cadd4+=0x1){_0x4f3018=_0xf5537[_0x5cadd4];if(_[_0xe6f2('0x3f')](_0x4111bc[_0xe6f2('0x13')][_0x4f3018[_0xe6f2('0x26')]])){_0x4111bc['voiceQueues'][_0x4f3018[_0xe6f2('0x26')]]=new VoiceQueue(_0x4f3018);}else{_0x4111bc[_0xe6f2('0x3b')](_0x4111bc[_0xe6f2('0x13')][_0x4f3018[_0xe6f2('0x26')]],_0x4f3018);}}}return _0x4111bc[_0xe6f2('0x13')];};};Realtime['prototype'][_0xe6f2('0x41')]=function(){var _0x2104a5=this;return function(_0x411b84){if(_0x411b84){freeIsNotKey(_0x411b84,_0x2104a5[_0xe6f2('0x14')],'id');for(var _0x12e614=0x0,_0x2fcb55={},_0x103e5d={};_0x12e614<_0x411b84[_0xe6f2('0x3e')];_0x12e614+=0x1){_0x2fcb55=_0x411b84[_0x12e614];if(_['isUndefined'](_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']])){_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']]=new Trigger(_0x2fcb55);}else{_0x2104a5[_0xe6f2('0x3b')](_0x2104a5[_0xe6f2('0x14')][_0x2fcb55['id']],_0x2fcb55);}}}return _0x2104a5['triggers'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x42')]=function(){var _0x44c86c=this;return function(_0xa9a580){if(_0xa9a580){freeIsNotKey(_0xa9a580,_0x44c86c['templates'],'id');for(var _0x5bbb97=0x0,_0x153910={},_0x3dc69f={};_0x5bbb97<_0xa9a580[_0xe6f2('0x3e')];_0x5bbb97+=0x1){_0x153910=_0xa9a580[_0x5bbb97];if(_[_0xe6f2('0x3f')](_0x44c86c[_0xe6f2('0x15')][_0x153910['id']])){_0x44c86c[_0xe6f2('0x15')][_0x153910['id']]=new Template(_0x153910);}else{_0x44c86c[_0xe6f2('0x3b')](_0x44c86c['templates'][_0x153910['id']],_0x153910);}}}return _0x44c86c[_0xe6f2('0x15')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x43')]=function(){var _0x42045c=this;return function(_0x219da3){if(_0x219da3){freeIsNotKey(_0x219da3,_0x42045c[_0xe6f2('0x1a')],'id');for(var _0xab446e=0x0,_0xfbcc41={},_0x552e4c={};_0xab446e<_0x219da3[_0xe6f2('0x3e')];_0xab446e+=0x1){_0xfbcc41=_0x219da3[_0xab446e];if(_[_0xe6f2('0x3f')](_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']])){_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']]=new ZendeskAccount(_0xfbcc41);}else{_0x42045c[_0xe6f2('0x3b')](_0x42045c[_0xe6f2('0x1a')][_0xfbcc41['id']],_0xfbcc41);}}}return _0x42045c[_0xe6f2('0x1a')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x44')]=function(){var _0x3051a7=this;return function(_0x30979b){if(_0x30979b){freeIsNotKey(_0x30979b,_0x3051a7[_0xe6f2('0x1b')],'id');for(var _0x21ca74=0x0,_0x51c939={},_0x552a3f={};_0x21ca74<_0x30979b[_0xe6f2('0x3e')];_0x21ca74+=0x1){_0x51c939=_0x30979b[_0x21ca74];if(_[_0xe6f2('0x3f')](_0x3051a7['salesforceAccounts'][_0x51c939['id']])){_0x3051a7[_0xe6f2('0x1b')][_0x51c939['id']]=new SalesforceAccount(_0x51c939);}else{_0x3051a7[_0xe6f2('0x3b')](_0x3051a7[_0xe6f2('0x1b')][_0x51c939['id']],_0x51c939);}}}return _0x3051a7[_0xe6f2('0x1b')];};};Realtime['prototype'][_0xe6f2('0x45')]=function(){var _0x30ca48=this;return function(_0x2b2987){if(_0x2b2987){freeIsNotKey(_0x2b2987,_0x30ca48['freshdeskAccounts'],'id');for(var _0x134e0a=0x0,_0x1542d7={},_0x4fbc08={};_0x134e0a<_0x2b2987['length'];_0x134e0a+=0x1){_0x1542d7=_0x2b2987[_0x134e0a];if(_[_0xe6f2('0x3f')](_0x30ca48[_0xe6f2('0x46')][_0x1542d7['id']])){_0x30ca48['freshdeskAccounts'][_0x1542d7['id']]=new FreshdeskAccount(_0x1542d7);}else{_0x30ca48[_0xe6f2('0x3b')](_0x30ca48[_0xe6f2('0x46')][_0x1542d7['id']],_0x1542d7);}}}return _0x30ca48[_0xe6f2('0x46')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x47')]=function(){var _0x15ef67=this;return function(_0x59950b){if(_0x59950b){freeIsNotKey(_0x59950b,_0x15ef67[_0xe6f2('0x1d')],'id');for(var _0x1814d7=0x0,_0x529494={},_0x5716b6={};_0x1814d7<_0x59950b[_0xe6f2('0x3e')];_0x1814d7+=0x1){_0x529494=_0x59950b[_0x1814d7];if(_['isUndefined'](_0x15ef67[_0xe6f2('0x1d')][_0x529494['id']])){_0x15ef67[_0xe6f2('0x1d')][_0x529494['id']]=new ZohoAccount(_0x529494);}else{_0x15ef67[_0xe6f2('0x3b')](_0x15ef67['zohoAccounts'][_0x529494['id']],_0x529494);}}}return _0x15ef67['zohoAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x48')]=function(){var _0x49d173=this;return function(_0x41882b){if(_0x41882b){freeIsNotKey(_0x41882b,_0x49d173[_0xe6f2('0x1e')],'id');for(var _0x440e95=0x0,_0x3a3562={},_0x2c86a9={};_0x440e95<_0x41882b['length'];_0x440e95+=0x1){_0x3a3562=_0x41882b[_0x440e95];if(_[_0xe6f2('0x3f')](_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']])){_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']]=new DeskAccount(_0x3a3562);}else{_0x49d173[_0xe6f2('0x3b')](_0x49d173[_0xe6f2('0x1e')][_0x3a3562['id']],_0x3a3562);}}}return _0x49d173[_0xe6f2('0x1e')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x49')]=function(){var _0x144bca=this;return function(_0x863001){if(_0x863001){freeIsNotKey(_0x863001,_0x144bca[_0xe6f2('0x1c')],'id');for(var _0x46da06=0x0,_0x1fd37e={},_0xcc4133={};_0x46da06<_0x863001[_0xe6f2('0x3e')];_0x46da06+=0x1){_0x1fd37e=_0x863001[_0x46da06];if(_[_0xe6f2('0x3f')](_0x144bca['sugarcrmAccounts'][_0x1fd37e['id']])){_0x144bca[_0xe6f2('0x1c')][_0x1fd37e['id']]=new SugarcrmAccount(_0x1fd37e);}else{_0x144bca[_0xe6f2('0x3b')](_0x144bca[_0xe6f2('0x1c')][_0x1fd37e['id']],_0x1fd37e);}}}return _0x144bca['sugarcrmAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4a')]=function(){var _0x2cda53=this;return function(_0x108b5c){if(_0x108b5c){freeIsNotKey(_0x108b5c,_0x2cda53[_0xe6f2('0x1f')],'id');for(var _0xb8d6c6=0x0,_0x3f1d85={},_0x5a9ab4={};_0xb8d6c6<_0x108b5c['length'];_0xb8d6c6+=0x1){_0x3f1d85=_0x108b5c[_0xb8d6c6];if(_[_0xe6f2('0x3f')](_0x2cda53[_0xe6f2('0x1f')][_0x3f1d85['id']])){_0x2cda53['vtigerAccounts'][_0x3f1d85['id']]=new VtigerAccount(_0x3f1d85);}else{_0x2cda53[_0xe6f2('0x3b')](_0x2cda53['vtigerAccounts'][_0x3f1d85['id']],_0x3f1d85);}}}return _0x2cda53['vtigerAccounts'];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4b')]=function(){var _0x1644d4=this;return function(_0x4ce034){if(_0x4ce034){freeIsNotKey(_0x4ce034,_0x1644d4['servicenowAccounts'],'id');for(var _0x4cd47d=0x0,_0x5a4a70={},_0x37ed18={};_0x4cd47d<_0x4ce034[_0xe6f2('0x3e')];_0x4cd47d+=0x1){_0x5a4a70=_0x4ce034[_0x4cd47d];if(_['isUndefined'](_0x1644d4[_0xe6f2('0x4c')][_0x5a4a70['id']])){_0x1644d4['servicenowAccounts'][_0x5a4a70['id']]=new ServicenowAccount(_0x5a4a70);}else{_0x1644d4[_0xe6f2('0x3b')](_0x1644d4[_0xe6f2('0x4c')][_0x5a4a70['id']],_0x5a4a70);}}}return _0x1644d4[_0xe6f2('0x4c')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4d')]=function(){var _0x49d9e6=this;return function(_0x53f47b){if(_0x53f47b){freeIsNotKey(_0x53f47b,_0x49d9e6[_0xe6f2('0x20')],'id');for(var _0x3faa27=0x0,_0x4da5a1={},_0x46e3b5={};_0x3faa27<_0x53f47b[_0xe6f2('0x3e')];_0x3faa27+=0x1){_0x4da5a1=_0x53f47b[_0x3faa27];if(_[_0xe6f2('0x3f')](_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']])){_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']]=new Dynamics365Account(_0x4da5a1);}else{_0x49d9e6[_0xe6f2('0x3b')](_0x49d9e6[_0xe6f2('0x20')][_0x4da5a1['id']],_0x4da5a1);}}}return _0x49d9e6[_0xe6f2('0x20')];};};Realtime['prototype'][_0xe6f2('0x4e')]=function(){var _0x20cacb=this;return function(_0x194580){if(_0x194580){freeIsNotKey(_0x194580,_0x20cacb[_0xe6f2('0x21')],'id');for(var _0x5725f4=0x0,_0x3546cd={},_0x2579d0={};_0x5725f4<_0x194580[_0xe6f2('0x3e')];_0x5725f4+=0x1){_0x3546cd=_0x194580[_0x5725f4];if(_[_0xe6f2('0x3f')](_0x20cacb[_0xe6f2('0x21')][_0x3546cd['id']])){_0x20cacb[_0xe6f2('0x21')][_0x3546cd['id']]=new FreshsalesAccount(_0x3546cd);}else{_0x20cacb[_0xe6f2('0x3b')](_0x20cacb['freshsalesAccounts'][_0x3546cd['id']],_0x3546cd);}}}return _0x20cacb[_0xe6f2('0x21')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x4f')]=function(){var _0xdb85ed=this;return function(_0x40ed40){for(var _0x3ac974=0x0;_0x3ac974<_0x40ed40['length'];_0x3ac974+=0x1){_[_0xe6f2('0x50')](_0xdb85ed['voiceQueues'][_0x40ed40[_0x3ac974][_0xe6f2('0x26')]],_0x40ed40[_0x3ac974]);}return _0xdb85ed[_0xe6f2('0x13')];};};Realtime['prototype'][_0xe6f2('0x51')]=function(){var _0x522202=this;return function(_0x663138){clearVoiceQueues(_0x522202[_0xe6f2('0x13')]);if(_0x663138){_0x663138=_['groupBy'](_0x663138,_0xe6f2('0x52'));for(var _0x580ff9 in _0x663138){if(_0x663138[_0xe6f2('0x24')](_0x580ff9)){var _0x10b59f={};for(var _0xb2b8e0=0x0;_0xb2b8e0<_0x663138[_0x580ff9][_0xe6f2('0x3e')];_0xb2b8e0+=0x1){var _0x112a3b=_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x53')];if(_0x522202[_0xe6f2('0x13')][_0x112a3b]){if(_0x663138[_0x580ff9][_0xb2b8e0]['queuecallerexit']){_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x30')]+=0x1;}if(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x54')]){_0x522202['voiceQueues'][_0x112a3b][_0xe6f2('0x55')]+=0x1;}_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2c')]+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x56')])[_0xe6f2('0x57')](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x58')]),_0xe6f2('0x59'))||0x0;if(_0xb2b8e0===_0x663138[_0x580ff9]['length']-0x1){_0x522202[_0xe6f2('0x13')][_0x112a3b]['sumDuration']+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5a')]||_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5b')]||_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5c')])['diff'](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x58')]),_0xe6f2('0x59'))||0x0;_0x522202['voiceQueues'][_0x112a3b][_0xe6f2('0x2a')]+=0x1;if(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5d')]){_0x522202[_0xe6f2('0x13')][_0x112a3b]['answered']+=0x1;_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x31')]+=moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x5a')])[_0xe6f2('0x57')](moment(_0x663138[_0x580ff9][_0xb2b8e0][_0xe6f2('0x56')]),_0xe6f2('0x59'))||0x0;}}else{_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2d')]+=_0x522202[_0xe6f2('0x13')][_0x112a3b][_0xe6f2('0x2c')]||0x0;}}}}}}return _0x522202[_0xe6f2('0x13')];};};Realtime[_0xe6f2('0x3c')]['initVoiceCallReports']=function(){var _0x317a00=this;return function(_0x411a67){clearVoiceCallReports(_0x317a00[_0xe6f2('0x16')]);if(_0x411a67){for(var _0x204ddc=0x0;_0x204ddc<_0x411a67[_0xe6f2('0x3e')];_0x204ddc+=0x1){_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x2a')]+=0x1;_0x317a00['outbound']['sumDuration']+=_0x411a67[_0x204ddc][_0xe6f2('0x5e')];if(_0x411a67[_0x204ddc][_0xe6f2('0x5f')]===_0xe6f2('0x60')){_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x2b')]+=0x1;_0x317a00['outbound'][_0xe6f2('0x2c')]+=_0x411a67[_0x204ddc][_0xe6f2('0x5e')]-_0x411a67[_0x204ddc][_0xe6f2('0x61')]||0x0;_0x317a00[_0xe6f2('0x16')][_0xe6f2('0x31')]+=_0x411a67[_0x204ddc][_0xe6f2('0x61')];}}}return _0x317a00[_0xe6f2('0x16')];};};Realtime[_0xe6f2('0x3c')]['initCampaigns']=function(){var _0x76e6fe=this;return function(_0x1ee34c){if(_0x1ee34c){freeIsNotKey(_0x1ee34c,_0x76e6fe['campaigns'],_0xe6f2('0x26'));for(var _0x6507f0=0x0,_0x813ccc={};_0x6507f0<_0x1ee34c['length'];_0x6507f0+=0x1){_0x813ccc=_0x1ee34c[_0x6507f0];if(_['isUndefined'](_0x76e6fe[_0xe6f2('0x62')][_0x813ccc['name']])){_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]]=new Campaign(_0x813ccc);}else{_0x76e6fe[_0xe6f2('0x3b')](_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]],_0x813ccc);_0x76e6fe[_0xe6f2('0x62')][_0x813ccc[_0xe6f2('0x26')]][_0xe6f2('0x63')]=_0x813ccc[_0xe6f2('0x64')]?_0x813ccc[_0xe6f2('0x64')][_0xe6f2('0x26')]:undefined;}}}return _0x76e6fe[_0xe6f2('0x62')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x65')]=function(){var _0x1c0d23=this;return function(_0x3382c7){if(_0x3382c7){freeIsNotKey(_0x3382c7,_0x1c0d23[_0xe6f2('0x66')],'id');for(var _0x1bbbb9=0x0,_0x2297fe={};_0x1bbbb9<_0x3382c7['length'];_0x1bbbb9+=0x1){_0x2297fe=_0x3382c7[_0x1bbbb9];if(_[_0xe6f2('0x3f')](_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']])){_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']]=new VoiceExtension(_0x2297fe);}else{_0x1c0d23[_0xe6f2('0x3b')](_0x1c0d23[_0xe6f2('0x66')][_0x2297fe['id']],_0x2297fe);}}}return _0x1c0d23[_0xe6f2('0x66')];};};Realtime[_0xe6f2('0x3c')]['initCampaignHopperHistory']=function(){var _0x976510=this;return function(_0x525c13){clearCampaigns(_0x976510[_0xe6f2('0x62')]);for(var _0xdc329f=0x0;_0xdc329f<_0x525c13[_0xe6f2('0x3e')];_0xdc329f+=0x1){_['merge'](_0x976510[_0xe6f2('0x62')][_0x525c13[_0xdc329f][_0xe6f2('0x26')]],_0x525c13[_0xdc329f]);}return _0x976510[_0xe6f2('0x62')];};};Realtime[_0xe6f2('0x3c')][_0xe6f2('0x67')]=function(){var _0x2605af=this;return function(_0x20e608){if(_0x20e608){freeIsNotKey(_0x20e608,_0x2605af[_0xe6f2('0x22')],'id');for(var _0x2474e7=0x0,_0x2b5823={},_0x4fafda={};_0x2474e7<_0x20e608[_0xe6f2('0x3e')];_0x2474e7+=0x1){_0x2b5823=_0x20e608[_0x2474e7];if(_[_0xe6f2('0x3f')](_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']])){_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']]=new FaxAccount(_0x2b5823);}else{_0x2605af[_0xe6f2('0x3b')](_0x2605af[_0xe6f2('0x22')][_0x2b5823['id']],_0x2b5823);}}}return _0x2605af['faxAccounts'];};};module[_0xe6f2('0x68')]=Realtime;
\ No newline at end of file
+var _0xa08d=['initFaxAccounts','exports','bluebird','util','../model/agent','../model/telephone','../model/trunk','../model/template','../model/voiceExtension','../model/salesforceAccount','../model/zohoAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','name','interface','total','answered','sumDuration','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTelephones','SIP/%s','initTrunks','trunks','initVoiceQueues','initTriggers','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','sumHoldTime','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','seconds','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory'];(function(_0x307b01,_0x196003){var _0xc5deed=function(_0x56e438){while(--_0x56e438){_0x307b01['push'](_0x307b01['shift']());}};_0xc5deed(++_0x196003);}(_0xa08d,0x146));var _0xda08=function(_0x526c42,_0x4fa5c3){_0x526c42=_0x526c42-0x0;var _0x3506cb=_0xa08d[_0x526c42];return _0x3506cb;};'use strict';var BPromise=require(_0xda08('0x0'));var util=require(_0xda08('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0xda08('0x2'));var Telephone=require(_0xda08('0x3'));var Trunk=require(_0xda08('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0xda08('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xda08('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xda08('0x7'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xda08('0x8'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xda08('0x9'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0xda08('0xa'));var FaxAccount=require(_0xda08('0xb'));var Realtime=function(){this['agents']={};this[_0xda08('0xc')]={};this['trunks']={};this[_0xda08('0xd')]={};this[_0xda08('0xe')]={};this[_0xda08('0xf')]={};this['templates']={};this[_0xda08('0x10')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xda08('0x11')]={};this[_0xda08('0x12')]={};this[_0xda08('0x13')]={};this[_0xda08('0x14')]={};this[_0xda08('0x15')]={};this[_0xda08('0x16')]={};this[_0xda08('0x17')]={};this[_0xda08('0x18')]={};this['sugarcrmAccounts']={};this[_0xda08('0x19')]={};this[_0xda08('0x1a')]={};this['deskAccounts']={};this[_0xda08('0x1b')]={};this[_0xda08('0x1c')]={};this[_0xda08('0x1d')]={};this[_0xda08('0x1e')]={};this[_0xda08('0x1f')]={};};function freeIsNotKey(_0x82cb76,_0x5d880e,_0x155530){var _0x31fc47=_['mapKeys'](_0x82cb76,function(_0x5d1445,_0x33a3c1){return _0x5d1445[_0x155530];});for(var _0x3a9678 in _0x5d880e){if(_0x5d880e[_0xda08('0x20')](_0x3a9678)){if(!_0x31fc47[_0x3a9678]){delete _0x5d880e[_0x3a9678];}}}}function freeIsNotKeySip(_0xbb24a8,_0x42faa7){var _0x2f3d04=_[_0xda08('0x21')](_0xbb24a8,function(_0x1982cc,_0xb4be12){return util[_0xda08('0x22')]('SIP/%s',_0x1982cc[_0xda08('0x23')]);});for(var _0x10a9f6 in _0x42faa7){if(_0x42faa7['hasOwnProperty'](_0x10a9f6)){if(!_0x2f3d04[_0x10a9f6]){delete _0x42faa7[_0x10a9f6];}}}}function freeIsNotKeyAgent(_0x280e85,_0x4823ad){var _0x9eb5a2=_[_0xda08('0x21')](_0x280e85,function(_0x3c9396,_0x514388){var _0x18ae47=_['isNil'](_0x3c9396[_0xda08('0x24')])?util[_0xda08('0x22')]('SIP/%s',_0x3c9396[_0xda08('0x23')]):_0x3c9396[_0xda08('0x24')];return _0x18ae47;});for(var _0x105e4c in _0x4823ad){if(_0x4823ad['hasOwnProperty'](_0x105e4c)){if(!_0x9eb5a2[_0x105e4c]){delete _0x4823ad[_0x105e4c];}}}}function clearVoiceCallReports(_0x42a612){_0x42a612[_0xda08('0x25')]=0x0;_0x42a612[_0xda08('0x26')]=0x0;_0x42a612['sumHoldTime']=0x0;_0x42a612[_0xda08('0x27')]=0x0;_0x42a612['sumBillable']=0x0;}function clearCampaigns(_0x36a2cd){if(!_[_0xda08('0x28')](_0x36a2cd)){for(var _0x4791df in _0x36a2cd){if(_0x36a2cd[_0xda08('0x20')](_0x4791df)){_0x36a2cd[_0x4791df]['ivrTotalCallsDays']=0x0;_0x36a2cd[_0x4791df][_0xda08('0x29')]=0x0;}}}}function clearVoiceQueues(_0x945e6f){if(!_[_0xda08('0x28')](_0x945e6f)){for(var _0x15c586 in _0x945e6f){if(_0x945e6f[_0xda08('0x20')](_0x15c586)){_0x945e6f[_0x15c586][_0xda08('0x25')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x26')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x2a')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x2b')]=0x0;_0x945e6f[_0x15c586]['sumHoldTime']=0x0;_0x945e6f[_0x15c586][_0xda08('0x27')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x2c')]=0x0;_0x945e6f[_0x15c586]['outboundAnswerAgiCallsDay']=0x0;_0x945e6f[_0x15c586][_0xda08('0x2d')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x2e')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x2f')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x30')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x31')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x32')]=0x0;_0x945e6f[_0x15c586]['outboundDropCallsDayCallersExit']=0x0;_0x945e6f[_0x15c586][_0xda08('0x33')]=0x0;_0x945e6f[_0x15c586]['outboundOriginateFailureCallsDay']=0x0;_0x945e6f[_0x15c586][_0xda08('0x34')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x35')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x36')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x37')]=0x0;_0x945e6f[_0x15c586][_0xda08('0x38')]=!![];}}}}Realtime[_0xda08('0x39')][_0xda08('0x3a')]=function(_0x5be588,_0x3ceda6){for(var _0x49a1b6 in _0x3ceda6){if(_0x5be588[_0xda08('0x20')](_0x49a1b6)){_0x5be588[_0x49a1b6]=_0x3ceda6[_0x49a1b6];}}};Realtime[_0xda08('0x39')][_0xda08('0x3b')]=function(){var _0x5247c0=this;return function(_0x329d36){if(_0x329d36){freeIsNotKeyAgent(_0x329d36,_0x5247c0[_0xda08('0x3c')]);for(var _0x237a5f=0x0,_0x23854b={},_0x414f0f={};_0x237a5f<_0x329d36[_0xda08('0x3d')];_0x237a5f+=0x1){_0x23854b=_0x329d36[_0x237a5f];var _0x177ae0=_['isNil'](_0x23854b[_0xda08('0x24')])?util['format']('SIP/%s',_0x23854b['name']):_0x23854b[_0xda08('0x24')];if(_[_0xda08('0x3e')](_0x5247c0[_0xda08('0x3c')][_0x177ae0])){_0x5247c0['agents'][_0x177ae0]=new Agent(_0x23854b);}else{_0x5247c0[_0xda08('0x3a')](_0x5247c0[_0xda08('0x3c')][_0x177ae0],_0x23854b);}}}return _0x5247c0[_0xda08('0x3c')];};};Realtime[_0xda08('0x39')][_0xda08('0x3f')]=function(){var _0x151e02=this;return function(_0x35b5e7){if(_0x35b5e7){freeIsNotKeySip(_0x35b5e7,_0x151e02[_0xda08('0xc')]);for(var _0x3d0690=0x0,_0x309fdf={},_0x4bd925={};_0x3d0690<_0x35b5e7['length'];_0x3d0690+=0x1){_0x309fdf=_0x35b5e7[_0x3d0690];if(_[_0xda08('0x3e')](_0x151e02[_0xda08('0xc')][util['format'](_0xda08('0x40'),_0x309fdf[_0xda08('0x23')])])){_0x151e02[_0xda08('0xc')][util['format'](_0xda08('0x40'),_0x309fdf[_0xda08('0x23')])]=new Telephone(_0x309fdf);}else{_0x151e02[_0xda08('0x3a')](_0x151e02[_0xda08('0xc')][util[_0xda08('0x22')](_0xda08('0x40'),_0x309fdf[_0xda08('0x23')])],_0x309fdf);}}}return _0x151e02[_0xda08('0xc')];};};Realtime[_0xda08('0x39')][_0xda08('0x41')]=function(){var _0x31de56=this;return function(_0x423d4a){if(_0x423d4a){freeIsNotKeySip(_0x423d4a,_0x31de56[_0xda08('0x42')]);for(var _0x57e825=0x0,_0x157878={},_0x110eba={};_0x57e825<_0x423d4a[_0xda08('0x3d')];_0x57e825+=0x1){_0x157878=_0x423d4a[_0x57e825];if(_[_0xda08('0x3e')](_0x31de56['trunks'][util[_0xda08('0x22')](_0xda08('0x40'),_0x157878[_0xda08('0x23')])])){_0x31de56[_0xda08('0x42')][util['format'](_0xda08('0x40'),_0x157878[_0xda08('0x23')])]=new Trunk(_0x157878);}else{_0x31de56[_0xda08('0x3a')](_0x31de56[_0xda08('0x42')][util[_0xda08('0x22')](_0xda08('0x40'),_0x157878[_0xda08('0x23')])],_0x157878);}}}return _0x31de56['trunks'];};};Realtime['prototype'][_0xda08('0x43')]=function(){var _0xc2cde0=this;return function(_0x514e5e){if(_0x514e5e){freeIsNotKey(_0x514e5e,_0xc2cde0['voiceQueues'],_0xda08('0x23'));for(var _0x48079c=0x0,_0x409204={},_0x4d6db6={};_0x48079c<_0x514e5e[_0xda08('0x3d')];_0x48079c+=0x1){_0x409204=_0x514e5e[_0x48079c];if(_[_0xda08('0x3e')](_0xc2cde0[_0xda08('0xd')][_0x409204[_0xda08('0x23')]])){_0xc2cde0[_0xda08('0xd')][_0x409204[_0xda08('0x23')]]=new VoiceQueue(_0x409204);}else{_0xc2cde0[_0xda08('0x3a')](_0xc2cde0['voiceQueues'][_0x409204[_0xda08('0x23')]],_0x409204);}}}return _0xc2cde0[_0xda08('0xd')];};};Realtime[_0xda08('0x39')][_0xda08('0x44')]=function(){var _0x39d9e8=this;return function(_0x45e864){if(_0x45e864){freeIsNotKey(_0x45e864,_0x39d9e8[_0xda08('0xe')],'id');for(var _0x2adb01=0x0,_0x27feca={},_0x29750c={};_0x2adb01<_0x45e864[_0xda08('0x3d')];_0x2adb01+=0x1){_0x27feca=_0x45e864[_0x2adb01];if(_[_0xda08('0x3e')](_0x39d9e8[_0xda08('0xe')][_0x27feca['id']])){_0x39d9e8[_0xda08('0xe')][_0x27feca['id']]=new Trigger(_0x27feca);}else{_0x39d9e8[_0xda08('0x3a')](_0x39d9e8['triggers'][_0x27feca['id']],_0x27feca);}}}return _0x39d9e8['triggers'];};};Realtime[_0xda08('0x39')]['initTemplates']=function(){var _0x3e534e=this;return function(_0x5b7d3a){if(_0x5b7d3a){freeIsNotKey(_0x5b7d3a,_0x3e534e['templates'],'id');for(var _0x3ad7b6=0x0,_0x46071f={},_0x501caa={};_0x3ad7b6<_0x5b7d3a[_0xda08('0x3d')];_0x3ad7b6+=0x1){_0x46071f=_0x5b7d3a[_0x3ad7b6];if(_['isUndefined'](_0x3e534e[_0xda08('0x45')][_0x46071f['id']])){_0x3e534e[_0xda08('0x45')][_0x46071f['id']]=new Template(_0x46071f);}else{_0x3e534e[_0xda08('0x3a')](_0x3e534e[_0xda08('0x45')][_0x46071f['id']],_0x46071f);}}}return _0x3e534e['templates'];};};Realtime[_0xda08('0x39')][_0xda08('0x46')]=function(){var _0x2fd450=this;return function(_0x424abe){if(_0x424abe){freeIsNotKey(_0x424abe,_0x2fd450[_0xda08('0x17')],'id');for(var _0x58f192=0x0,_0x3e74ce={},_0x2a3bd8={};_0x58f192<_0x424abe[_0xda08('0x3d')];_0x58f192+=0x1){_0x3e74ce=_0x424abe[_0x58f192];if(_[_0xda08('0x3e')](_0x2fd450[_0xda08('0x17')][_0x3e74ce['id']])){_0x2fd450[_0xda08('0x17')][_0x3e74ce['id']]=new ZendeskAccount(_0x3e74ce);}else{_0x2fd450[_0xda08('0x3a')](_0x2fd450[_0xda08('0x17')][_0x3e74ce['id']],_0x3e74ce);}}}return _0x2fd450[_0xda08('0x17')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x2dfbd1=this;return function(_0x3cdf08){if(_0x3cdf08){freeIsNotKey(_0x3cdf08,_0x2dfbd1['salesforceAccounts'],'id');for(var _0x47f13a=0x0,_0x4a604a={},_0x5d1ec3={};_0x47f13a<_0x3cdf08['length'];_0x47f13a+=0x1){_0x4a604a=_0x3cdf08[_0x47f13a];if(_['isUndefined'](_0x2dfbd1[_0xda08('0x18')][_0x4a604a['id']])){_0x2dfbd1[_0xda08('0x18')][_0x4a604a['id']]=new SalesforceAccount(_0x4a604a);}else{_0x2dfbd1['mergeFromDatabase'](_0x2dfbd1['salesforceAccounts'][_0x4a604a['id']],_0x4a604a);}}}return _0x2dfbd1['salesforceAccounts'];};};Realtime[_0xda08('0x39')][_0xda08('0x47')]=function(){var _0x321391=this;return function(_0x485e96){if(_0x485e96){freeIsNotKey(_0x485e96,_0x321391[_0xda08('0x19')],'id');for(var _0x98cf00=0x0,_0x44bb91={},_0x4e532a={};_0x98cf00<_0x485e96[_0xda08('0x3d')];_0x98cf00+=0x1){_0x44bb91=_0x485e96[_0x98cf00];if(_[_0xda08('0x3e')](_0x321391[_0xda08('0x19')][_0x44bb91['id']])){_0x321391['freshdeskAccounts'][_0x44bb91['id']]=new FreshdeskAccount(_0x44bb91);}else{_0x321391['mergeFromDatabase'](_0x321391[_0xda08('0x19')][_0x44bb91['id']],_0x44bb91);}}}return _0x321391[_0xda08('0x19')];};};Realtime[_0xda08('0x39')][_0xda08('0x48')]=function(){var _0x57d6fa=this;return function(_0x244d82){if(_0x244d82){freeIsNotKey(_0x244d82,_0x57d6fa[_0xda08('0x1a')],'id');for(var _0x559e60=0x0,_0x1c6917={},_0x7d16e1={};_0x559e60<_0x244d82[_0xda08('0x3d')];_0x559e60+=0x1){_0x1c6917=_0x244d82[_0x559e60];if(_[_0xda08('0x3e')](_0x57d6fa[_0xda08('0x1a')][_0x1c6917['id']])){_0x57d6fa[_0xda08('0x1a')][_0x1c6917['id']]=new ZohoAccount(_0x1c6917);}else{_0x57d6fa[_0xda08('0x3a')](_0x57d6fa[_0xda08('0x1a')][_0x1c6917['id']],_0x1c6917);}}}return _0x57d6fa['zohoAccounts'];};};Realtime[_0xda08('0x39')][_0xda08('0x49')]=function(){var _0x2fcbdd=this;return function(_0x5438ec){if(_0x5438ec){freeIsNotKey(_0x5438ec,_0x2fcbdd[_0xda08('0x4a')],'id');for(var _0x59586f=0x0,_0x129083={},_0x18c5fe={};_0x59586f<_0x5438ec[_0xda08('0x3d')];_0x59586f+=0x1){_0x129083=_0x5438ec[_0x59586f];if(_['isUndefined'](_0x2fcbdd['deskAccounts'][_0x129083['id']])){_0x2fcbdd[_0xda08('0x4a')][_0x129083['id']]=new DeskAccount(_0x129083);}else{_0x2fcbdd['mergeFromDatabase'](_0x2fcbdd[_0xda08('0x4a')][_0x129083['id']],_0x129083);}}}return _0x2fcbdd[_0xda08('0x4a')];};};Realtime['prototype'][_0xda08('0x4b')]=function(){var _0x46ff8d=this;return function(_0x5786d1){if(_0x5786d1){freeIsNotKey(_0x5786d1,_0x46ff8d[_0xda08('0x4c')],'id');for(var _0x2ab35a=0x0,_0x32b1be={},_0x49367b={};_0x2ab35a<_0x5786d1[_0xda08('0x3d')];_0x2ab35a+=0x1){_0x32b1be=_0x5786d1[_0x2ab35a];if(_['isUndefined'](_0x46ff8d[_0xda08('0x4c')][_0x32b1be['id']])){_0x46ff8d[_0xda08('0x4c')][_0x32b1be['id']]=new SugarcrmAccount(_0x32b1be);}else{_0x46ff8d[_0xda08('0x3a')](_0x46ff8d[_0xda08('0x4c')][_0x32b1be['id']],_0x32b1be);}}}return _0x46ff8d[_0xda08('0x4c')];};};Realtime[_0xda08('0x39')][_0xda08('0x4d')]=function(){var _0x202edd=this;return function(_0x22b879){if(_0x22b879){freeIsNotKey(_0x22b879,_0x202edd[_0xda08('0x1b')],'id');for(var _0x2fbf0c=0x0,_0x55884e={},_0x1631df={};_0x2fbf0c<_0x22b879[_0xda08('0x3d')];_0x2fbf0c+=0x1){_0x55884e=_0x22b879[_0x2fbf0c];if(_[_0xda08('0x3e')](_0x202edd[_0xda08('0x1b')][_0x55884e['id']])){_0x202edd[_0xda08('0x1b')][_0x55884e['id']]=new VtigerAccount(_0x55884e);}else{_0x202edd['mergeFromDatabase'](_0x202edd[_0xda08('0x1b')][_0x55884e['id']],_0x55884e);}}}return _0x202edd[_0xda08('0x1b')];};};Realtime['prototype'][_0xda08('0x4e')]=function(){var _0x458a26=this;return function(_0xb4fd05){if(_0xb4fd05){freeIsNotKey(_0xb4fd05,_0x458a26['servicenowAccounts'],'id');for(var _0xea01fe=0x0,_0x116ae1={},_0xa1d8ef={};_0xea01fe<_0xb4fd05[_0xda08('0x3d')];_0xea01fe+=0x1){_0x116ae1=_0xb4fd05[_0xea01fe];if(_[_0xda08('0x3e')](_0x458a26[_0xda08('0x1c')][_0x116ae1['id']])){_0x458a26['servicenowAccounts'][_0x116ae1['id']]=new ServicenowAccount(_0x116ae1);}else{_0x458a26['mergeFromDatabase'](_0x458a26['servicenowAccounts'][_0x116ae1['id']],_0x116ae1);}}}return _0x458a26[_0xda08('0x1c')];};};Realtime[_0xda08('0x39')][_0xda08('0x4f')]=function(){var _0x5be266=this;return function(_0x4e76d5){if(_0x4e76d5){freeIsNotKey(_0x4e76d5,_0x5be266[_0xda08('0x1d')],'id');for(var _0x41e0bd=0x0,_0x30e290={},_0x105774={};_0x41e0bd<_0x4e76d5[_0xda08('0x3d')];_0x41e0bd+=0x1){_0x30e290=_0x4e76d5[_0x41e0bd];if(_[_0xda08('0x3e')](_0x5be266['dynamics365Accounts'][_0x30e290['id']])){_0x5be266[_0xda08('0x1d')][_0x30e290['id']]=new Dynamics365Account(_0x30e290);}else{_0x5be266['mergeFromDatabase'](_0x5be266['dynamics365Accounts'][_0x30e290['id']],_0x30e290);}}}return _0x5be266['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x20e0e5=this;return function(_0x5eb4cd){if(_0x5eb4cd){freeIsNotKey(_0x5eb4cd,_0x20e0e5[_0xda08('0x1e')],'id');for(var _0x244620=0x0,_0x3fc89d={},_0x572c62={};_0x244620<_0x5eb4cd['length'];_0x244620+=0x1){_0x3fc89d=_0x5eb4cd[_0x244620];if(_[_0xda08('0x3e')](_0x20e0e5[_0xda08('0x1e')][_0x3fc89d['id']])){_0x20e0e5[_0xda08('0x1e')][_0x3fc89d['id']]=new FreshsalesAccount(_0x3fc89d);}else{_0x20e0e5['mergeFromDatabase'](_0x20e0e5[_0xda08('0x1e')][_0x3fc89d['id']],_0x3fc89d);}}}return _0x20e0e5[_0xda08('0x1e')];};};Realtime[_0xda08('0x39')][_0xda08('0x50')]=function(){var _0x31758d=this;return function(_0x3ad8de){for(var _0x42c2ed=0x0;_0x42c2ed<_0x3ad8de[_0xda08('0x3d')];_0x42c2ed+=0x1){_[_0xda08('0x51')](_0x31758d['voiceQueues'][_0x3ad8de[_0x42c2ed][_0xda08('0x23')]],_0x3ad8de[_0x42c2ed]);}return _0x31758d['voiceQueues'];};};Realtime['prototype'][_0xda08('0x52')]=function(){var _0x41cba3=this;return function(_0x50c82c){clearVoiceQueues(_0x41cba3[_0xda08('0xd')]);if(_0x50c82c){_0x50c82c=_[_0xda08('0x53')](_0x50c82c,_0xda08('0x54'));for(var _0x5600d3 in _0x50c82c){if(_0x50c82c['hasOwnProperty'](_0x5600d3)){var _0x7c1a65={};for(var _0x350543=0x0;_0x350543<_0x50c82c[_0x5600d3][_0xda08('0x3d')];_0x350543+=0x1){var _0x5af64f=_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x55')];if(_0x41cba3[_0xda08('0xd')][_0x5af64f]){if(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x56')]){_0x41cba3[_0xda08('0xd')][_0x5af64f]['unmanaged']+=0x1;}if(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x57')]){_0x41cba3['voiceQueues'][_0x5af64f][_0xda08('0x2b')]+=0x1;}_0x41cba3[_0xda08('0xd')][_0x5af64f][_0xda08('0x58')]+=moment(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x59')])[_0xda08('0x5a')](moment(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x5b')]),'seconds')||0x0;if(_0x350543===_0x50c82c[_0x5600d3]['length']-0x1){_0x41cba3[_0xda08('0xd')][_0x5af64f][_0xda08('0x27')]+=moment(_0x50c82c[_0x5600d3][_0x350543]['queuecallercompleteAt']||_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x5c')]||_0x50c82c[_0x5600d3][_0x350543]['queuecallerexitAt'])['diff'](moment(_0x50c82c[_0x5600d3][_0x350543]['queuecallerjoinAt']),_0xda08('0x5d'))||0x0;_0x41cba3[_0xda08('0xd')][_0x5af64f][_0xda08('0x25')]+=0x1;if(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x5e')]){_0x41cba3[_0xda08('0xd')][_0x5af64f]['answered']+=0x1;_0x41cba3[_0xda08('0xd')][_0x5af64f][_0xda08('0x2c')]+=moment(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x5f')])[_0xda08('0x5a')](moment(_0x50c82c[_0x5600d3][_0x350543][_0xda08('0x59')]),_0xda08('0x5d'))||0x0;}}else{_0x41cba3[_0xda08('0xd')][_0x5af64f]['sumDuration']+=_0x41cba3[_0xda08('0xd')][_0x5af64f][_0xda08('0x58')]||0x0;}}}}}}return _0x41cba3[_0xda08('0xd')];};};Realtime[_0xda08('0x39')][_0xda08('0x60')]=function(){var _0x8f9de5=this;return function(_0x482086){clearVoiceCallReports(_0x8f9de5[_0xda08('0x10')]);if(_0x482086){for(var _0x7d853a=0x0;_0x7d853a<_0x482086[_0xda08('0x3d')];_0x7d853a+=0x1){_0x8f9de5[_0xda08('0x10')][_0xda08('0x25')]+=0x1;_0x8f9de5[_0xda08('0x10')][_0xda08('0x27')]+=_0x482086[_0x7d853a][_0xda08('0x61')];if(_0x482086[_0x7d853a][_0xda08('0x62')]===_0xda08('0x63')){_0x8f9de5[_0xda08('0x10')]['answered']+=0x1;_0x8f9de5[_0xda08('0x10')]['sumHoldTime']+=_0x482086[_0x7d853a][_0xda08('0x61')]-_0x482086[_0x7d853a]['billableseconds']||0x0;_0x8f9de5['outbound'][_0xda08('0x2c')]+=_0x482086[_0x7d853a][_0xda08('0x64')];}}}return _0x8f9de5[_0xda08('0x10')];};};Realtime[_0xda08('0x39')][_0xda08('0x65')]=function(){var _0x3c5c30=this;return function(_0x366713){if(_0x366713){freeIsNotKey(_0x366713,_0x3c5c30['campaigns'],_0xda08('0x23'));for(var _0x37438b=0x0,_0x3e54db={};_0x37438b<_0x366713[_0xda08('0x3d')];_0x37438b+=0x1){_0x3e54db=_0x366713[_0x37438b];if(_[_0xda08('0x3e')](_0x3c5c30[_0xda08('0xf')][_0x3e54db['name']])){_0x3c5c30[_0xda08('0xf')][_0x3e54db[_0xda08('0x23')]]=new Campaign(_0x3e54db);}else{_0x3c5c30[_0xda08('0x3a')](_0x3c5c30[_0xda08('0xf')][_0x3e54db[_0xda08('0x23')]],_0x3e54db);_0x3c5c30['campaigns'][_0x3e54db['name']][_0xda08('0x66')]=_0x3e54db[_0xda08('0x67')]?_0x3e54db['SquareProject'][_0xda08('0x23')]:undefined;}}}return _0x3c5c30[_0xda08('0xf')];};};Realtime['prototype'][_0xda08('0x68')]=function(){var _0x40bd97=this;return function(_0x35a61b){if(_0x35a61b){freeIsNotKey(_0x35a61b,_0x40bd97[_0xda08('0x11')],'id');for(var _0x15e6b1=0x0,_0x5632aa={};_0x15e6b1<_0x35a61b[_0xda08('0x3d')];_0x15e6b1+=0x1){_0x5632aa=_0x35a61b[_0x15e6b1];if(_[_0xda08('0x3e')](_0x40bd97['voiceExtensions'][_0x5632aa['id']])){_0x40bd97[_0xda08('0x11')][_0x5632aa['id']]=new VoiceExtension(_0x5632aa);}else{_0x40bd97[_0xda08('0x3a')](_0x40bd97[_0xda08('0x11')][_0x5632aa['id']],_0x5632aa);}}}return _0x40bd97[_0xda08('0x11')];};};Realtime[_0xda08('0x39')][_0xda08('0x69')]=function(){var _0x450b0e=this;return function(_0x4ade3d){clearCampaigns(_0x450b0e[_0xda08('0xf')]);for(var _0x4afc7e=0x0;_0x4afc7e<_0x4ade3d[_0xda08('0x3d')];_0x4afc7e+=0x1){_[_0xda08('0x51')](_0x450b0e[_0xda08('0xf')][_0x4ade3d[_0x4afc7e][_0xda08('0x23')]],_0x4ade3d[_0x4afc7e]);}return _0x450b0e[_0xda08('0xf')];};};Realtime[_0xda08('0x39')][_0xda08('0x6a')]=function(){var _0x2199f2=this;return function(_0x7ddb6a){if(_0x7ddb6a){freeIsNotKey(_0x7ddb6a,_0x2199f2[_0xda08('0x1f')],'id');for(var _0x5d7205=0x0,_0x219731={},_0x2355a1={};_0x5d7205<_0x7ddb6a[_0xda08('0x3d')];_0x5d7205+=0x1){_0x219731=_0x7ddb6a[_0x5d7205];if(_['isUndefined'](_0x2199f2[_0xda08('0x1f')][_0x219731['id']])){_0x2199f2['faxAccounts'][_0x219731['id']]=new FaxAccount(_0x219731);}else{_0x2199f2[_0xda08('0x3a')](_0x2199f2[_0xda08('0x1f')][_0x219731['id']],_0x219731);}}}return _0x2199f2[_0xda08('0x1f')];};};module[_0xda08('0x6b')]=Realtime;
\ No newline at end of file
index 0170679..31baac0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81b3=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','channel','destinationchannel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','transfereelinkedid','uniqueid','create','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','blindTransfer','exports','lodash','moment','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x3c0acc,_0x5a6de5){var _0x1669b4=function(_0x52f069){while(--_0x52f069){_0x3c0acc['push'](_0x3c0acc['shift']());}};_0x1669b4(++_0x5a6de5);}(_0x81b3,0x98));var _0x381b=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x81b3[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x381b('0x0'));var moment=require(_0x381b('0x1'));var util=require('util');var config=require(_0x381b('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x381b('0x3'));var RpcVoiceDialReport=require(_0x381b('0x4'));var RpcMemberReport=require(_0x381b('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x381b('0x6'));var RpcVoiceTransferReport=require(_0x381b('0x7'));var VoiceQueueReport=require(_0x381b('0x8'));var VoiceCallReport=require(_0x381b('0x9'));var VoiceAgentReport=require(_0x381b('0xa'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x4a1fc4){this['realtime']=_0x4a1fc4;this[_0x381b('0xb')]=_0x4a1fc4['agents'];this[_0x381b('0xc')]=_0x4a1fc4[_0x381b('0xc')];}Report[_0x381b('0xd')][_0x381b('0xe')]=function(_0x5e3dc6){var _0x3dbe47=new VoiceQueueReport(this[_0x381b('0xf')]);var _0x4992ce=new VoiceAgentReport(this[_0x381b('0xf')]);var _0x1967fd=new VoiceDialReport(this[_0x381b('0xf')]);var _0x53453f=new VoiceCallReport(this[_0x381b('0xf')]);var _0x38a12b=new UserReport(this[_0x381b('0xf')]);if(config['xdr']&&config['xdr'][_0x381b('0x10')]){ami['on'](_0x381b('0x11'),this[_0x381b('0x12')][_0x381b('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x381b('0x13')](this));ami['on']('custom:voiceAgentReport',this[_0x381b('0x14')][_0x381b('0x13')](this));ami['on'](_0x381b('0x15'),this['voiceDialReport'][_0x381b('0x13')](this));ami['on'](_0x381b('0x16'),this['blindTransfer'][_0x381b('0x13')](this));ami['on'](_0x381b('0x17'),this[_0x381b('0x18')][_0x381b('0x13')](this));}};Report['prototype'][_0x381b('0x19')]=function(_0x50d799){var _0x1e65bf;_0x1e65bf=_[_0x381b('0x1a')](this['agents'],function(_0x25372f){return _0x25372f[_0x381b('0x1b')]==_0x50d799||_0x25372f['name']==_0x50d799;});if(_[_0x381b('0x1c')](_0x1e65bf)){var _0x59e68d=_[_0x381b('0x1a')](this[_0x381b('0xc')],function(_0x5255bf){return _0x5255bf[_0x381b('0x1b')]==_0x50d799||_0x5255bf[_0x381b('0x1d')]==_0x50d799;});if(_0x59e68d){_0x1e65bf=_['find'](this[_0x381b('0xb')],function(_0x215dcb){return _0x215dcb[_0x381b('0x1e')]==util[_0x381b('0x1f')](_0x381b('0x20'),_0x59e68d[_0x381b('0x1d')]);});}}return _0x1e65bf;};Report['prototype'][_0x381b('0x12')]=function(_0x2d5823){for(var _0x1798f5=0x0;_0x1798f5<_0x2d5823[_0x381b('0x21')];_0x1798f5+=0x1){var _0x4c3c56=this[_0x381b('0x19')](_0x2d5823[_0x1798f5]['connectedlinenum']);if(_0x4c3c56){_0x2d5823[_0x1798f5][_0x381b('0x1b')]=_0x4c3c56[_0x381b('0x1b')];_0x2d5823[_0x1798f5]['assigned']=!![];_0x2d5823[_0x1798f5]['lastAssignedTo']=_0x4c3c56[_0x381b('0x1d')];_0x2d5823[_0x1798f5][_0x381b('0x1e')]=_['isNil'](_0x4c3c56[_0x381b('0x1e')])?util[_0x381b('0x1f')](_0x381b('0x20'),_0x4c3c56[_0x381b('0x1d')]):_0x4c3c56[_0x381b('0x1e')];if(_0x2d5823[_0x1798f5][_0x381b('0x22')]){_0x2d5823[_0x1798f5]['queuecallercompleteAt']=moment()[_0x381b('0x1f')](_0x381b('0x23'));}if(_0x2d5823[_0x1798f5][_0x381b('0x24')]){_0x2d5823[_0x1798f5][_0x381b('0x25')]=moment()['format'](_0x381b('0x23'));}RpcMemberReport[_0x381b('0x12')](_0x2d5823[_0x1798f5]);}RpcVoiceQueueReport['create'](_0x2d5823[_0x1798f5]);}};function extractCalleridNumber(_0x56bdc0){var _0x18cb0d=_0x56bdc0['match'](/<(.*?)>/);return _0x18cb0d?_0x18cb0d[0x1]:_0x56bdc0;}Report[_0x381b('0xd')][_0x381b('0x26')]=function(_0x3417c2){_0x3417c2[_0x381b('0x27')]=_0x3417c2['destination']||_0x3417c2[_0x381b('0x28')];if(_0x3417c2[_0x381b('0x29')]==_0x381b('0x2a')){_0x3417c2[_0x381b('0x2b')]='queue';_0x3417c2[_0x381b('0x2c')]=_0x3417c2['queue'];if(_0x3417c2['context']=='from-voip-provider'){_0x3417c2[_0x381b('0x1b')]='';_0x3417c2[_0x381b('0x27')]=extractCalleridNumber(_0x3417c2[_0x381b('0x2d')]);}else if(_0x3417c2['context']==_0x381b('0x2e')){if(_0x3417c2[_0x381b('0x27')]==_0x381b('0x2f')){_0x3417c2[_0x381b('0x27')]=extractCalleridNumber(_0x3417c2[_0x381b('0x30')]);_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x32')];_0x3417c2['destinationchannel']=[_0x3417c2[_0x381b('0x33')],_0x3417c2['channel']=_0x3417c2[_0x381b('0x34')]][0x0];_0x3417c2[_0x381b('0x2d')]=_0x3417c2[_0x381b('0x30')];}else{_0x3417c2[_0x381b('0x27')]=_0x3417c2[_0x381b('0x31')];_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x32')];if(_0x3417c2[_0x381b('0x35')]==_0x381b('0x36')){_0x3417c2[_0x381b('0x1b')]=_0x3417c2[_0x381b('0x37')];}else{_0x3417c2[_0x381b('0x1b')]='';}}}}else{_0x3417c2[_0x381b('0x2d')]=util[_0x381b('0x1f')](_0x381b('0x38'),_0x3417c2['calleridname'],_0x3417c2[_0x381b('0x31')]);}if(RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']]){var _0x4379fd=RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']];_0x4379fd[_0x381b('0x3a')]=_0x3417c2[_0x381b('0x3b')];RpcVoiceTransferReport['blindTransfer'](_0x4379fd);delete RpcVoiceTransferReport[_0x381b('0x39')][_0x3417c2['linkedid']];}RpcVoiceCallReport[_0x381b('0x3c')](_0x3417c2);if(_0x3417c2[_0x381b('0x3d')]){for(var _0x49391d=0x0;_0x49391d<_0x3417c2[_0x381b('0x3e')][_0x381b('0x21')];_0x49391d+=0x1){_0x3417c2[_0x381b('0x3f')]=_0x3417c2[_0x381b('0x3e')][_0x49391d][_0x381b('0x40')];_0x3417c2[_0x381b('0x41')]=_0x3417c2[_0x381b('0x3e')][_0x49391d][_0x381b('0x41')];if(_0x3417c2['exten']==_0x381b('0x2f')){_0x3417c2[_0x381b('0x31')]=_0x3417c2[_0x381b('0x37')];_0x3417c2[_0x381b('0x42')]=_0x3417c2[_0x381b('0x43')];_0x3417c2[_0x381b('0x37')]=_0x3417c2[_0x381b('0x1b')];_0x3417c2[_0x381b('0x43')]=_0x3417c2[_0x381b('0x44')];_0x3417c2['exten']=_0x3417c2[_0x381b('0x32')];}else if(_0x3417c2[_0x381b('0x28')]==_0x381b('0x45')){_0x3417c2[_0x381b('0x31')]=_0x3417c2['destination'];_0x3417c2['exten']=_0x3417c2[_0x381b('0x32')];}RpcVoiceRecording[_0x381b('0x3c')](_0x3417c2);}}};Report['prototype'][_0x381b('0x14')]=function(_0x5471d4){if(_[_0x381b('0x46')](_0x5471d4)){_0x5471d4['forEach'](function(_0x38fa04){RpcVoiceAgentReport['create'](_0x38fa04);});}else{RpcVoiceAgentReport[_0x381b('0x3c')](_0x5471d4);}};Report[_0x381b('0xd')][_0x381b('0x47')]=function(_0x46cab7){RpcVoiceDialReport[_0x381b('0x3c')](_0x46cab7);var _0x29384b;var _0x549dad;var _0x457352=_0x46cab7[_0x381b('0x33')];if(_[_0x381b('0x48')](_0x457352,_0x381b('0x49'))){_0x549dad=_0x457352[_0x381b('0x4a')](_0x457352[_0x381b('0x4b')]('/')+0x1,_0x457352[_0x381b('0x4b')]('@'));_0x29384b=_['find'](this[_0x381b('0xb')],function(_0x22c36f){return _0x22c36f[_0x381b('0x4c')]==_0x549dad||_0x22c36f['phone']==_0x549dad||_0x22c36f[_0x381b('0x1b')]==_0x549dad;});}else{_0x549dad=_0x457352[_0x381b('0x4a')](_0x457352['indexOf']('/')+0x1,_0x457352[_0x381b('0x4d')]('-'));_0x29384b=this['findAgent'](_0x549dad);}if(_0x29384b){_0x46cab7[_0x381b('0x1e')]=_['isNil'](_0x29384b[_0x381b('0x1e')])?util['format'](_0x381b('0x20'),_0x29384b['name']):_0x29384b[_0x381b('0x1e')];_0x46cab7[_0x381b('0x44')]=_0x29384b['name'];_0x46cab7[_0x381b('0x1b')]=_0x29384b['accountcode'];RpcMemberReport[_0x381b('0x47')](_0x46cab7);}};Report['prototype'][_0x381b('0x4e')]=function(_0x2f1c4b){RpcVoiceTransferReport['transfers'][_0x2f1c4b['transfererlinkedid']]=_0x2f1c4b;};Report[_0x381b('0xd')][_0x381b('0x18')]=function(_0x241efe){RpcVoiceTransferReport[_0x381b('0x18')](_0x241efe);};module[_0x381b('0x4f')]=Report;
\ No newline at end of file
+var _0x6755=['blindtransfer','blindTransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','type','lastapplication','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','calleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','transfers','transfereelinkedid','linkedid','monitorFilename','monitors','filename','createdAt','exten','xcally-motion-preview','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x6755,0x147));var _0x5675=function(_0x1226f6,_0x2b51f5){_0x1226f6=_0x1226f6-0x0;var _0x56e4c2=_0x6755[_0x1226f6];return _0x56e4c2;};'use strict';var _=require(_0x5675('0x0'));var moment=require(_0x5675('0x1'));var util=require('util');var config=require(_0x5675('0x2'));var ami=require(_0x5675('0x3'));var RpcVoiceAgentReport=require(_0x5675('0x4'));var RpcVoiceCallReport=require(_0x5675('0x5'));var RpcVoiceDialReport=require(_0x5675('0x6'));var RpcMemberReport=require(_0x5675('0x7'));var RpcVoiceQueueReport=require(_0x5675('0x8'));var RpcVoiceRecording=require(_0x5675('0x9'));var RpcVoiceTransferReport=require(_0x5675('0xa'));var VoiceQueueReport=require(_0x5675('0xb'));var VoiceCallReport=require(_0x5675('0xc'));var VoiceAgentReport=require(_0x5675('0xd'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x5675('0xe'));function Report(_0x2efb46){this[_0x5675('0xf')]=_0x2efb46;this['agents']=_0x2efb46[_0x5675('0x10')];this['telephones']=_0x2efb46[_0x5675('0x11')];}Report['prototype'][_0x5675('0x12')]=function(_0x38285f){var _0x2f6f7f=new VoiceQueueReport(this[_0x5675('0xf')]);var _0x413e59=new VoiceAgentReport(this['realtime']);var _0x18a572=new VoiceDialReport(this['realtime']);var _0x4afec2=new VoiceCallReport(this[_0x5675('0xf')]);var _0x4cbfed=new UserReport(this[_0x5675('0xf')]);if(config[_0x5675('0x13')]&&config[_0x5675('0x13')][_0x5675('0x14')]){ami['on'](_0x5675('0x15'),this[_0x5675('0x16')][_0x5675('0x17')](this));ami['on']('custom:voiceCallReport',this[_0x5675('0x18')][_0x5675('0x17')](this));ami['on'](_0x5675('0x19'),this[_0x5675('0x1a')][_0x5675('0x17')](this));ami['on'](_0x5675('0x1b'),this[_0x5675('0x1c')][_0x5675('0x17')](this));ami['on'](_0x5675('0x1d'),this[_0x5675('0x1e')][_0x5675('0x17')](this));ami['on']('attendedtransfer',this[_0x5675('0x1f')][_0x5675('0x17')](this));}};Report[_0x5675('0x20')][_0x5675('0x21')]=function(_0x457886){var _0x63055b;_0x63055b=_[_0x5675('0x22')](this[_0x5675('0x10')],function(_0x426b6a){return _0x426b6a[_0x5675('0x23')]==_0x457886||_0x426b6a[_0x5675('0x24')]==_0x457886;});if(_[_0x5675('0x25')](_0x63055b)){var _0x36c565=_[_0x5675('0x22')](this[_0x5675('0x11')],function(_0x1ccce6){return _0x1ccce6[_0x5675('0x23')]==_0x457886||_0x1ccce6[_0x5675('0x24')]==_0x457886;});if(_0x36c565){_0x63055b=_[_0x5675('0x22')](this['agents'],function(_0x2bcad9){return _0x2bcad9[_0x5675('0x26')]==util[_0x5675('0x27')]('SIP/%s',_0x36c565[_0x5675('0x24')]);});}}return _0x63055b;};Report[_0x5675('0x20')]['voiceQueueReport']=function(_0x1791ce){for(var _0x3627fc=0x0;_0x3627fc<_0x1791ce[_0x5675('0x28')];_0x3627fc+=0x1){var _0x2b17f2=this[_0x5675('0x21')](_0x1791ce[_0x3627fc][_0x5675('0x29')]);if(_0x2b17f2){_0x1791ce[_0x3627fc][_0x5675('0x23')]=_0x2b17f2['accountcode'];_0x1791ce[_0x3627fc][_0x5675('0x2a')]=!![];_0x1791ce[_0x3627fc][_0x5675('0x2b')]=_0x2b17f2[_0x5675('0x24')];_0x1791ce[_0x3627fc][_0x5675('0x26')]=_[_0x5675('0x25')](_0x2b17f2['interface'])?util[_0x5675('0x27')](_0x5675('0x2c'),_0x2b17f2[_0x5675('0x24')]):_0x2b17f2[_0x5675('0x26')];if(_0x1791ce[_0x3627fc][_0x5675('0x2d')]){_0x1791ce[_0x3627fc][_0x5675('0x2e')]=moment()[_0x5675('0x27')](_0x5675('0x2f'));}if(_0x1791ce[_0x3627fc]['queuecallerexit']){_0x1791ce[_0x3627fc][_0x5675('0x30')]=moment()[_0x5675('0x27')](_0x5675('0x2f'));}RpcMemberReport[_0x5675('0x16')](_0x1791ce[_0x3627fc]);}RpcVoiceQueueReport[_0x5675('0x31')](_0x1791ce[_0x3627fc]);}};function extractCalleridNumber(_0x4b582a){var _0x476c4a=_0x4b582a[_0x5675('0x32')](/<(.*?)>/);return _0x476c4a?_0x476c4a[0x1]:_0x4b582a;}Report['prototype'][_0x5675('0x18')]=function(_0x41b7a7){_0x41b7a7[_0x5675('0x33')]=_0x41b7a7[_0x5675('0x33')]||_0x41b7a7['exten'];if(_0x41b7a7[_0x5675('0x34')]=='dialer'){_0x41b7a7[_0x5675('0x35')]=_0x5675('0x36');_0x41b7a7[_0x5675('0x37')]=_0x41b7a7[_0x5675('0x36')];if(_0x41b7a7[_0x5675('0x38')]==_0x5675('0x39')){_0x41b7a7[_0x5675('0x23')]='';_0x41b7a7[_0x5675('0x33')]=extractCalleridNumber(_0x41b7a7[_0x5675('0x3a')]);}else if(_0x41b7a7[_0x5675('0x38')]=='from-sip'){if(_0x41b7a7['destination']=='xcally-motion-preview'){_0x41b7a7[_0x5675('0x33')]=extractCalleridNumber(_0x41b7a7[_0x5675('0x3b')]);_0x41b7a7[_0x5675('0x3c')]=_0x41b7a7['originatecalleridnum'];_0x41b7a7[_0x5675('0x3d')]=[_0x41b7a7[_0x5675('0x3e')],_0x41b7a7['channel']=_0x41b7a7[_0x5675('0x3d')]][0x0];_0x41b7a7[_0x5675('0x3a')]=_0x41b7a7['calleridpreview'];}else{_0x41b7a7[_0x5675('0x33')]=_0x41b7a7['calleridnum'];_0x41b7a7[_0x5675('0x3c')]=_0x41b7a7['originatecalleridnum'];if(_0x41b7a7[_0x5675('0x3f')]==_0x5675('0x40')){_0x41b7a7[_0x5675('0x23')]=_0x41b7a7[_0x5675('0x29')];}else{_0x41b7a7[_0x5675('0x23')]='';}}}}else{_0x41b7a7['callerid']=util[_0x5675('0x27')]('\x22%s\x22\x20<%s>',_0x41b7a7[_0x5675('0x41')],_0x41b7a7[_0x5675('0x3c')]);}if(RpcVoiceTransferReport['transfers'][_0x41b7a7['linkedid']]){var _0x2ae522=RpcVoiceTransferReport[_0x5675('0x42')][_0x41b7a7['linkedid']];_0x2ae522[_0x5675('0x43')]=_0x41b7a7['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x2ae522);delete RpcVoiceTransferReport['transfers'][_0x41b7a7[_0x5675('0x44')]];}RpcVoiceCallReport[_0x5675('0x31')](_0x41b7a7);if(_0x41b7a7['monitor']){for(var _0x40662b=0x0;_0x40662b<_0x41b7a7['monitors'][_0x5675('0x28')];_0x40662b+=0x1){_0x41b7a7[_0x5675('0x45')]=_0x41b7a7[_0x5675('0x46')][_0x40662b][_0x5675('0x47')];_0x41b7a7[_0x5675('0x48')]=_0x41b7a7[_0x5675('0x46')][_0x40662b][_0x5675('0x48')];if(_0x41b7a7[_0x5675('0x49')]==_0x5675('0x4a')){_0x41b7a7[_0x5675('0x3c')]=_0x41b7a7[_0x5675('0x29')];_0x41b7a7['calleridname']=_0x41b7a7[_0x5675('0x4b')];_0x41b7a7[_0x5675('0x29')]=_0x41b7a7[_0x5675('0x23')];_0x41b7a7[_0x5675('0x4b')]=_0x41b7a7[_0x5675('0x4c')];_0x41b7a7[_0x5675('0x49')]=_0x41b7a7[_0x5675('0x4d')];}else if(_0x41b7a7['exten']==_0x5675('0x4e')){_0x41b7a7[_0x5675('0x3c')]=_0x41b7a7[_0x5675('0x33')];_0x41b7a7[_0x5675('0x49')]=_0x41b7a7[_0x5675('0x4d')];}RpcVoiceRecording[_0x5675('0x31')](_0x41b7a7);}}};Report[_0x5675('0x20')][_0x5675('0x1a')]=function(_0x5e41ea){if(_['isArray'](_0x5e41ea)){_0x5e41ea[_0x5675('0x4f')](function(_0x592837){RpcVoiceAgentReport['create'](_0x592837);});}else{RpcVoiceAgentReport[_0x5675('0x31')](_0x5e41ea);}};Report['prototype'][_0x5675('0x1c')]=function(_0xf527f0){RpcVoiceDialReport[_0x5675('0x31')](_0xf527f0);var _0x103711;var _0x5898ec;var _0x497f04=_0xf527f0['channel'];if(_[_0x5675('0x50')](_0x497f04,_0x5675('0x51'))){_0x5898ec=_0x497f04[_0x5675('0x52')](_0x497f04[_0x5675('0x53')]('/')+0x1,_0x497f04[_0x5675('0x53')]('@'));_0x103711=_['find'](this[_0x5675('0x10')],function(_0x15f031){return _0x15f031[_0x5675('0x54')]==_0x5898ec||_0x15f031[_0x5675('0x55')]==_0x5898ec||_0x15f031[_0x5675('0x23')]==_0x5898ec;});}else{_0x5898ec=_0x497f04[_0x5675('0x52')](_0x497f04[_0x5675('0x53')]('/')+0x1,_0x497f04[_0x5675('0x56')]('-'));_0x103711=this['findAgent'](_0x5898ec);}if(_0x103711){_0xf527f0[_0x5675('0x26')]=_[_0x5675('0x25')](_0x103711[_0x5675('0x26')])?util[_0x5675('0x27')](_0x5675('0x2c'),_0x103711['name']):_0x103711[_0x5675('0x26')];_0xf527f0[_0x5675('0x4c')]=_0x103711['name'];_0xf527f0[_0x5675('0x23')]=_0x103711[_0x5675('0x23')];RpcMemberReport[_0x5675('0x1c')](_0xf527f0);}};Report['prototype'][_0x5675('0x1e')]=function(_0x56c7d4){RpcVoiceTransferReport[_0x5675('0x42')][_0x56c7d4[_0x5675('0x57')]]=_0x56c7d4;};Report[_0x5675('0x20')]['attendedTransfer']=function(_0x4e3c9a){RpcVoiceTransferReport[_0x5675('0x1f')](_0x4e3c9a);};module[_0x5675('0x58')]=Report;
\ No newline at end of file
index 8cf377b..eaf4d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d37=['peer','address','peerstatus','[userReport][peerstatus]','registered','status','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','redis','socket.io-emitter','trunks','agents','telephones','registry','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','find','stateRegistry','merge','actionid','format','name','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','inuse','updateStatusRealtime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','stateTime','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','trunk:save','startsWith','indexOf','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s'];(function(_0x4cb252,_0x3df164){var _0x3c7a29=function(_0xd19e63){while(--_0xd19e63){_0x4cb252['push'](_0x4cb252['shift']());}};_0x3c7a29(++_0x3df164);}(_0x8d37,0x1ec));var _0x78d3=function(_0x3ae82c,_0x2c9146){_0x3ae82c=_0x3ae82c-0x0;var _0x3f0979=_0x8d37[_0x3ae82c];return _0x3f0979;};'use strict';var _=require(_0x78d3('0x0'));var moment=require('moment');var util=require('util');var Redis=require(_0x78d3('0x1'));var BPromise=require(_0x78d3('0x2'));var config=require(_0x78d3('0x3'));var logger=require(_0x78d3('0x4'))('ami');var ami=require(_0x78d3('0x5'));config[_0x78d3('0x6')]=_['defaults'](config[_0x78d3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x78d3('0x7'))(new Redis(config['redis']));function UserReport(_0x2c8023){this[_0x78d3('0x8')]=_0x2c8023[_0x78d3('0x8')];this[_0x78d3('0x9')]=_0x2c8023[_0x78d3('0x9')];this[_0x78d3('0xa')]=_0x2c8023[_0x78d3('0xa')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0x78d3('0xb'),this[_0x78d3('0xc')][_0x78d3('0xd')](this));ami['on'](_0x78d3('0xe'),this[_0x78d3('0xf')][_0x78d3('0xd')](this));ami['on']('peerstatus',this[_0x78d3('0x10')][_0x78d3('0xd')](this));return this[_0x78d3('0x11')]();}function showSipRegistrations(){Promise[_0x78d3('0x12')]()[_0x78d3('0x13')](ami[_0x78d3('0x14')]())[_0x78d3('0x15')](function(_0xa8638){logger[_0x78d3('0x16')]('[userReport][sipshowregistry]',util[_0x78d3('0x17')](_0xa8638,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x78d3('0x12')]()[_0x78d3('0x13')](ami['actionDeviceStateList']())[_0x78d3('0x15')](function(_0x542e1a){logger[_0x78d3('0x16')](_0x78d3('0x18'),util['inspect'](_0x542e1a,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x78d3('0x12')]()['then'](ami[_0x78d3('0x19')]())[_0x78d3('0x15')](function(_0x425718){logger[_0x78d3('0x16')](_0x78d3('0x1a'),util[_0x78d3('0x17')](_0x425718,{'showHidden':![],'depth':null}));});}UserReport[_0x78d3('0x1b')][_0x78d3('0x11')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x78d3('0x13')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x78d3('0x1b')][_0x78d3('0x1c')]=function(_0x25066a){return _0x25066a!==null&&!_[_0x78d3('0x1d')](_0x25066a);};UserReport[_0x78d3('0x1b')][_0x78d3('0x1e')]=function(_0x40936f,_0x6a9933,_0x41ffc3){io['to'](_0x40936f)['emit'](_0x6a9933,_0x41ffc3);};UserReport[_0x78d3('0x1b')]['syncRegistry']=function(_0x427362){try{if(this['isNotNull'](_0x427362)){logger[_0x78d3('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x427362[_0x78d3('0x20')],_0x427362[_0x78d3('0x21')]);logger[_0x78d3('0x22')](_0x78d3('0x23'),util[_0x78d3('0x17')](_0x427362,{'showHidden':![],'depth':null}));var _0x177a79=_[_0x78d3('0x24')](this[_0x78d3('0x8')],{'defaultuser':_0x427362['username']});if(_0x177a79){_0x427362[_0x78d3('0x25')]=_0x427362['state'];_[_0x78d3('0x26')](_0x177a79,_['omit'](_0x427362,['event',_0x78d3('0x27'),_0x78d3('0x20'),'state']));logger[_0x78d3('0x22')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x177a79,{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')]('trunk:%s',_0x177a79[_0x78d3('0x29')]),'trunk:save',_0x177a79);}}}catch(_0x7cbe89){logger['error'](_0x78d3('0x23'),util[_0x78d3('0x17')](_0x7cbe89,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x78d3('0xf')]=function(_0x3ea69c){try{if(this[_0x78d3('0x1c')](_0x3ea69c)){logger[_0x78d3('0x1f')](_0x78d3('0x2a'),_0x3ea69c[_0x78d3('0x2b')],_0x3ea69c[_0x78d3('0x21')]);logger[_0x78d3('0x22')]('[userReport][devicestatechange]',util[_0x78d3('0x17')](_0x3ea69c,{'showHidden':![],'depth':null}));if(this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]){if(!this[_0x78d3('0x9')][_0x3ea69c['device']][_0x78d3('0x2c')]||_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]()==_0x78d3('0x2e')){this['agents'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x2c')]=![];if(this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]['state']!==_0x3ea69c['state'][_0x78d3('0x2d')]()){this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]]['stateTime']=_['toNumber'](moment()[_0x78d3('0x28')]('x'));}this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c['state'][_0x78d3('0x2d')]();this[_0x78d3('0x9')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x2f')](_0x3ea69c);}}else if(this['telephones'][_0x3ea69c[_0x78d3('0x2b')]]){if(this[_0x78d3('0xa')][_0x3ea69c['device']][_0x78d3('0x21')]!==_0x3ea69c['state']['toLowerCase']()){this[_0x78d3('0xa')][_0x3ea69c['device']]['stateTime']=_[_0x78d3('0x30')](moment()['format']('x'));}this['telephones'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]();logger['debug'](_0x78d3('0x31'),util['inspect'](this['telephones'][_0x3ea69c[_0x78d3('0x2b')]],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')]('telephone:%s',this['telephones'][_0x3ea69c['device']][_0x78d3('0x29')]),_0x78d3('0x32'),this[_0x78d3('0xa')][_0x3ea69c[_0x78d3('0x2b')]]);}else if(this[_0x78d3('0x8')][_0x3ea69c['device']]){if(this['trunks'][_0x3ea69c['device']]['state']!==_0x3ea69c['state']['toLowerCase']()){this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x33')]=_[_0x78d3('0x30')](moment()[_0x78d3('0x28')]('x'));}this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x21')]=_0x3ea69c['state'][_0x78d3('0x2d')]();logger[_0x78d3('0x22')](_0x78d3('0x34'),util[_0x78d3('0x17')](this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')](_0x78d3('0x35'),this['trunks'][_0x3ea69c[_0x78d3('0x2b')]][_0x78d3('0x29')]),_0x78d3('0x36'),this[_0x78d3('0x8')][_0x3ea69c[_0x78d3('0x2b')]]);}else if(_[_0x78d3('0x37')](_0x3ea69c['device'],'Local')){var _0x291cc2=_0x3ea69c[_0x78d3('0x2b')];var _0x43bdb5=_0x291cc2['substring'](_0x291cc2[_0x78d3('0x38')]('/')+0x1,_0x291cc2[_0x78d3('0x38')]('@'));var _0x45d8b4=_['find'](this[_0x78d3('0x9')],function(_0x451656){return _0x451656['mobile']==_0x43bdb5||_0x451656['phone']==_0x43bdb5||_0x451656[_0x78d3('0x39')]==_0x43bdb5;});if(_0x45d8b4){if(_0x45d8b4['state']!==_0x3ea69c['state'][_0x78d3('0x2d')]()){_0x45d8b4[_0x78d3('0x33')]=_[_0x78d3('0x30')](moment()[_0x78d3('0x28')]('x'));}_0x45d8b4[_0x78d3('0x21')]=_0x3ea69c[_0x78d3('0x21')][_0x78d3('0x2d')]();_0x45d8b4[_0x78d3('0x2c')]=!![];_0x45d8b4['updateStatusRealtime'](_0x3ea69c);}}}}catch(_0x4a1eb0){logger[_0x78d3('0x16')](_0x78d3('0x3a'),util['inspect'](_0x4a1eb0,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x78d3('0x10')]=function(_0xca0c77){try{if(this[_0x78d3('0x1c')](_0xca0c77)&&this['isNotNull'](_0xca0c77['peerstatus'])){logger[_0x78d3('0x1f')](_0x78d3('0x3b'),_0xca0c77[_0x78d3('0x3c')],_0xca0c77[_0x78d3('0x3d')],_0xca0c77[_0x78d3('0x3e')]);logger[_0x78d3('0x22')](_0x78d3('0x3f'),util['inspect'](_0xca0c77,{'showHidden':![],'depth':null}));if(this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]]){if(!this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x2c')]||_0xca0c77['peerstatus'][_0x78d3('0x2d')]()==_0x78d3('0x40')){this[_0x78d3('0x9')][_0xca0c77['peer']][_0x78d3('0x2c')]=![];this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x41')]=_0xca0c77[_0x78d3('0x3e')]['toLowerCase']();this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];this[_0x78d3('0x9')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x2f')](_0xca0c77);}}else if(this[_0x78d3('0xa')][_0xca0c77['peer']]){this['telephones'][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x41')]=_0xca0c77[_0x78d3('0x3e')][_0x78d3('0x2d')]();this[_0x78d3('0xa')][_0xca0c77['peer']][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];logger[_0x78d3('0x22')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x78d3('0x17')](this[_0x78d3('0xa')][_0xca0c77[_0x78d3('0x3c')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x78d3('0x28')](_0x78d3('0x42'),this[_0x78d3('0xa')][_0xca0c77['peer']][_0x78d3('0x29')]),_0x78d3('0x32'),this[_0x78d3('0xa')][_0xca0c77['peer']]);}else if(this[_0x78d3('0x8')][_0xca0c77['peer']]){this[_0x78d3('0x8')][_0xca0c77[_0x78d3('0x3c')]]['status']=_0xca0c77[_0x78d3('0x3e')][_0x78d3('0x2d')]();this[_0x78d3('0x8')][_0xca0c77[_0x78d3('0x3c')]][_0x78d3('0x3d')]=_0xca0c77[_0x78d3('0x3d')];logger['debug'](_0x78d3('0x43'),util[_0x78d3('0x17')](this[_0x78d3('0x8')][_0xca0c77['peer']],{'showHidden':![],'depth':null}));this[_0x78d3('0x1e')](util[_0x78d3('0x28')](_0x78d3('0x35'),this['trunks'][_0xca0c77[_0x78d3('0x3c')]]['name']),'trunk:save',this['trunks'][_0xca0c77['peer']]);}}}catch(_0x1c32e6){logger[_0x78d3('0x16')]('[userReport][peerstatus]',util[_0x78d3('0x17')](_0x1c32e6,{'showHidden':![],'depth':null}));}};module[_0x78d3('0x44')]=UserReport;
\ No newline at end of file
+var _0x623f=['stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','accountcode','syncPeerStatus','peer','local','registered','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','registryentry','registry','bind','syncDeviceState','peerstatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','syncRegistry','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','find','stateRegistry','state','merge','omit','event','actionid','emit','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','toNumber','format','updateStatusRealtime','telephones'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x623f,0xad));var _0xf623=function(_0x764666,_0x3888b0){_0x764666=_0x764666-0x0;var _0x1ac182=_0x623f[_0x764666];return _0x1ac182;};'use strict';var _=require(_0xf623('0x0'));var moment=require(_0xf623('0x1'));var util=require('util');var Redis=require(_0xf623('0x2'));var BPromise=require(_0xf623('0x3'));var config=require(_0xf623('0x4'));var logger=require(_0xf623('0x5'))(_0xf623('0x6'));var ami=require(_0xf623('0x7'));config[_0xf623('0x8')]=_[_0xf623('0x9')](config['redis'],{'host':_0xf623('0xa'),'port':0x18eb});var io=require(_0xf623('0xb'))(new Redis(config['redis']));function UserReport(_0x2dd77b){this[_0xf623('0xc')]=_0x2dd77b['trunks'];this[_0xf623('0xd')]=_0x2dd77b[_0xf623('0xd')];this['telephones']=_0x2dd77b['telephones'];ami['on'](_0xf623('0xe'),this['syncRegistry']['bind'](this));ami['on'](_0xf623('0xf'),this['syncRegistry'][_0xf623('0x10')](this));ami['on']('devicestatechange',this[_0xf623('0x11')][_0xf623('0x10')](this));ami['on'](_0xf623('0x12'),this['syncPeerStatus'][_0xf623('0x10')](this));return this[_0xf623('0x13')]();}function showSipRegistrations(){Promise[_0xf623('0x14')]()[_0xf623('0x15')](ami[_0xf623('0x16')]())[_0xf623('0x17')](function(_0x201345){logger[_0xf623('0x18')](_0xf623('0x19'),util[_0xf623('0x1a')](_0x201345,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf623('0x14')]()[_0xf623('0x15')](ami[_0xf623('0x1b')]())[_0xf623('0x17')](function(_0x2ebee8){logger[_0xf623('0x18')]('[userReport][devicestatelist]',util[_0xf623('0x1a')](_0x2ebee8,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf623('0x14')]()[_0xf623('0x15')](ami[_0xf623('0x1c')]())[_0xf623('0x17')](function(_0x13304d){logger['error'](_0xf623('0x1d'),util[_0xf623('0x1a')](_0x13304d,{'showHidden':![],'depth':null}));});}UserReport[_0xf623('0x1e')][_0xf623('0x13')]=function(){setInterval(function(){BPromise[_0xf623('0x14')]()[_0xf623('0x15')](showSipRegistrations())[_0xf623('0x15')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0xf623('0x1e')][_0xf623('0x1f')]=function(_0x836ae3){return _0x836ae3!==null&&!_['isUndefined'](_0x836ae3);};UserReport[_0xf623('0x1e')]['emit']=function(_0x3b0e9a,_0x11cded,_0x3cdc87){io['to'](_0x3b0e9a)['emit'](_0x11cded,_0x3cdc87);};UserReport['prototype'][_0xf623('0x20')]=function(_0x94defa){try{if(this[_0xf623('0x1f')](_0x94defa)){logger['info'](_0xf623('0x21'),_0x94defa[_0xf623('0x22')],_0x94defa['state']);logger[_0xf623('0x23')](_0xf623('0x24'),util['inspect'](_0x94defa,{'showHidden':![],'depth':null}));var _0x3e568d=_[_0xf623('0x25')](this['trunks'],{'defaultuser':_0x94defa[_0xf623('0x22')]});if(_0x3e568d){_0x94defa[_0xf623('0x26')]=_0x94defa[_0xf623('0x27')];_[_0xf623('0x28')](_0x3e568d,_[_0xf623('0x29')](_0x94defa,[_0xf623('0x2a'),_0xf623('0x2b'),_0xf623('0x22'),_0xf623('0x27')]));logger['debug']('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xf623('0x1a')](_0x3e568d,{'showHidden':![],'depth':null}));this[_0xf623('0x2c')](util['format'](_0xf623('0x2d'),_0x3e568d[_0xf623('0x2e')]),_0xf623('0x2f'),_0x3e568d);}}}catch(_0x233871){logger['error']('[userReport][registry]',util[_0xf623('0x1a')](_0x233871,{'showHidden':![],'depth':null}));}};UserReport[_0xf623('0x1e')][_0xf623('0x11')]=function(_0x17d168){try{if(this['isNotNull'](_0x17d168)){logger[_0xf623('0x30')](_0xf623('0x31'),_0x17d168[_0xf623('0x32')],_0x17d168[_0xf623('0x27')]);logger['debug'](_0xf623('0x33'),util[_0xf623('0x1a')](_0x17d168,{'showHidden':![],'depth':null}));if(this['agents'][_0x17d168[_0xf623('0x32')]]){if(!this[_0xf623('0xd')][_0x17d168['device']]['local']||_0x17d168[_0xf623('0x27')][_0xf623('0x34')]()==_0xf623('0x35')){this[_0xf623('0xd')][_0x17d168[_0xf623('0x32')]]['local']=![];if(this[_0xf623('0xd')][_0x17d168[_0xf623('0x32')]]['state']!==_0x17d168[_0xf623('0x27')][_0xf623('0x34')]()){this['agents'][_0x17d168[_0xf623('0x32')]]['stateTime']=_[_0xf623('0x36')](moment()[_0xf623('0x37')]('x'));}this[_0xf623('0xd')][_0x17d168[_0xf623('0x32')]][_0xf623('0x27')]=_0x17d168[_0xf623('0x27')]['toLowerCase']();this[_0xf623('0xd')][_0x17d168[_0xf623('0x32')]][_0xf623('0x38')](_0x17d168);}}else if(this[_0xf623('0x39')][_0x17d168['device']]){if(this[_0xf623('0x39')][_0x17d168['device']][_0xf623('0x27')]!==_0x17d168[_0xf623('0x27')][_0xf623('0x34')]()){this[_0xf623('0x39')][_0x17d168[_0xf623('0x32')]][_0xf623('0x3a')]=_[_0xf623('0x36')](moment()[_0xf623('0x37')]('x'));}this[_0xf623('0x39')][_0x17d168[_0xf623('0x32')]][_0xf623('0x27')]=_0x17d168['state'][_0xf623('0x34')]();logger['debug'](_0xf623('0x3b'),util[_0xf623('0x1a')](this[_0xf623('0x39')][_0x17d168[_0xf623('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xf623('0x37')]('telephone:%s',this[_0xf623('0x39')][_0x17d168[_0xf623('0x32')]]['name']),_0xf623('0x3c'),this['telephones'][_0x17d168['device']]);}else if(this[_0xf623('0xc')][_0x17d168['device']]){if(this[_0xf623('0xc')][_0x17d168[_0xf623('0x32')]]['state']!==_0x17d168[_0xf623('0x27')]['toLowerCase']()){this[_0xf623('0xc')][_0x17d168[_0xf623('0x32')]][_0xf623('0x3a')]=_[_0xf623('0x36')](moment()[_0xf623('0x37')]('x'));}this[_0xf623('0xc')][_0x17d168[_0xf623('0x32')]][_0xf623('0x27')]=_0x17d168[_0xf623('0x27')][_0xf623('0x34')]();logger['debug'](_0xf623('0x3d'),util[_0xf623('0x1a')](this['trunks'][_0x17d168[_0xf623('0x32')]],{'showHidden':![],'depth':null}));this[_0xf623('0x2c')](util[_0xf623('0x37')](_0xf623('0x2d'),this['trunks'][_0x17d168[_0xf623('0x32')]][_0xf623('0x2e')]),_0xf623('0x2f'),this['trunks'][_0x17d168[_0xf623('0x32')]]);}else if(_[_0xf623('0x3e')](_0x17d168['device'],_0xf623('0x3f'))){var _0x675842=_0x17d168[_0xf623('0x32')];var _0x286290=_0x675842[_0xf623('0x40')](_0x675842[_0xf623('0x41')]('/')+0x1,_0x675842[_0xf623('0x41')]('@'));var _0x1a9e9d=_[_0xf623('0x25')](this[_0xf623('0xd')],function(_0x4def11){return _0x4def11[_0xf623('0x42')]==_0x286290||_0x4def11['phone']==_0x286290||_0x4def11[_0xf623('0x43')]==_0x286290;});if(_0x1a9e9d){if(_0x1a9e9d[_0xf623('0x27')]!==_0x17d168[_0xf623('0x27')][_0xf623('0x34')]()){_0x1a9e9d[_0xf623('0x3a')]=_['toNumber'](moment()[_0xf623('0x37')]('x'));}_0x1a9e9d['state']=_0x17d168[_0xf623('0x27')][_0xf623('0x34')]();_0x1a9e9d['local']=!![];_0x1a9e9d[_0xf623('0x38')](_0x17d168);}}}}catch(_0x341df0){logger[_0xf623('0x18')](_0xf623('0x33'),util[_0xf623('0x1a')](_0x341df0,{'showHidden':![],'depth':null}));}};UserReport[_0xf623('0x1e')][_0xf623('0x44')]=function(_0xa5820c){try{if(this[_0xf623('0x1f')](_0xa5820c)&&this[_0xf623('0x1f')](_0xa5820c[_0xf623('0x12')])){logger[_0xf623('0x30')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0xa5820c[_0xf623('0x45')],_0xa5820c['address'],_0xa5820c[_0xf623('0x12')]);logger[_0xf623('0x23')]('[userReport][peerstatus]',util['inspect'](_0xa5820c,{'showHidden':![],'depth':null}));if(this['agents'][_0xa5820c['peer']]){if(!this[_0xf623('0xd')][_0xa5820c[_0xf623('0x45')]][_0xf623('0x46')]||_0xa5820c[_0xf623('0x12')][_0xf623('0x34')]()==_0xf623('0x47')){this['agents'][_0xa5820c[_0xf623('0x45')]]['local']=![];this[_0xf623('0xd')][_0xa5820c[_0xf623('0x45')]]['status']=_0xa5820c[_0xf623('0x12')]['toLowerCase']();this[_0xf623('0xd')][_0xa5820c['peer']][_0xf623('0x48')]=_0xa5820c['address'];this[_0xf623('0xd')][_0xa5820c[_0xf623('0x45')]][_0xf623('0x38')](_0xa5820c);}}else if(this[_0xf623('0x39')][_0xa5820c[_0xf623('0x45')]]){this[_0xf623('0x39')][_0xa5820c['peer']]['status']=_0xa5820c[_0xf623('0x12')][_0xf623('0x34')]();this[_0xf623('0x39')][_0xa5820c[_0xf623('0x45')]][_0xf623('0x48')]=_0xa5820c[_0xf623('0x48')];logger[_0xf623('0x23')](_0xf623('0x49'),util['inspect'](this[_0xf623('0x39')][_0xa5820c[_0xf623('0x45')]],{'showHidden':![],'depth':null}));this[_0xf623('0x2c')](util[_0xf623('0x37')](_0xf623('0x4a'),this[_0xf623('0x39')][_0xa5820c[_0xf623('0x45')]][_0xf623('0x2e')]),_0xf623('0x3c'),this[_0xf623('0x39')][_0xa5820c[_0xf623('0x45')]]);}else if(this[_0xf623('0xc')][_0xa5820c['peer']]){this[_0xf623('0xc')][_0xa5820c[_0xf623('0x45')]]['status']=_0xa5820c[_0xf623('0x12')][_0xf623('0x34')]();this[_0xf623('0xc')][_0xa5820c[_0xf623('0x45')]][_0xf623('0x48')]=_0xa5820c[_0xf623('0x48')];logger[_0xf623('0x23')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xf623('0x1a')](this[_0xf623('0xc')][_0xa5820c[_0xf623('0x45')]],{'showHidden':![],'depth':null}));this[_0xf623('0x2c')](util[_0xf623('0x37')](_0xf623('0x2d'),this[_0xf623('0xc')][_0xa5820c['peer']][_0xf623('0x2e')]),_0xf623('0x2f'),this[_0xf623('0xc')][_0xa5820c[_0xf623('0x45')]]);}}}catch(_0x44a2b3){logger[_0xf623('0x18')](_0xf623('0x4b'),util['inspect'](_0x44a2b3,{'showHidden':![],'depth':null}));}};module[_0xf623('0x4c')]=UserReport;
\ No newline at end of file
index 65cfe94..fa1f48d 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(_0x5c4527,_0x4557f8){var _0x4d3bf2=function(_0x290c41){while(--_0x290c41){_0x5c4527['push'](_0x5c4527['shift']());}};_0x4d3bf2(++_0x4557f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x146215,_0x3f9319){var _0x307811=function(_0x1ea8a7){while(--_0x1ea8a7){_0x146215['push'](_0x146215['shift']());}};_0x307811(++_0x3f9319);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 5fdf9e2..1ee2ba0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd85c=['[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','value','syncMixMonitorFilename','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','originatecalleridnum','xmd-callerid-preview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','[%s][voiceCallReport][varset]','syncHangup','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','then','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','some','origtransfererlinkedid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','../../../config/logger','ami','set','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newchannel','bind','newstate','varset','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','uniqueid','calleridname','calleridnum','debug','linkedid','merge','pick','keys','context','from-sip','channel','split','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','toNumber','channelstate','exten','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','name','user:agentconnect','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','diff','connectedlinename','destinationchannel','UserId','membername','routealias'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xd85c,0x1d5));var _0xcd85=function(_0x37f7f5,_0x3b19b4){_0x37f7f5=_0x37f7f5-0x0;var _0x3a4377=_0xd85c[_0x37f7f5];return _0x3a4377;};'use strict';var _=require(_0xcd85('0x0'));var moment=require(_0xcd85('0x1'));var util=require(_0xcd85('0x2'));var path=require(_0xcd85('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xcd85('0x4'))(_0xcd85('0x5'));var ami=require('../ami');var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var applications=[_0xcd85('0x6'),_0xcd85('0x7'),_0xcd85('0x8'),_0xcd85('0x9'),'playback','voicemail'];var dispositions=[_0xcd85('0xa'),'FAILED',_0xcd85('0xb'),_0xcd85('0xa'),_0xcd85('0xa'),_0xcd85('0xa'),_0xcd85('0xc'),_0xcd85('0xd'),_0xcd85('0xb'),_0xcd85('0xb'),_0xcd85('0xb')];config[_0xcd85('0xe')]=_[_0xcd85('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xcd85('0x10'))(new Redis(config[_0xcd85('0xe')]));function VoiceCallReport(_0x4a839c){this[_0xcd85('0x11')]=_0x4a839c['channels'];this['agents']=_0x4a839c[_0xcd85('0x12')];this[_0xcd85('0x13')]={};ami['on'](_0xcd85('0x14'),this[_0xcd85('0x15')]['bind'](this));ami['on']('newexten',this[_0xcd85('0x15')]['bind'](this));ami['on'](_0xcd85('0x16'),this['syncNewChannel'][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x18'),this['syncNewState'][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x19'),this['syncVarSet'][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x1a'),this['syncHangup'][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x1b'),this[_0xcd85('0x1c')][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x1d'),this[_0xcd85('0x1e')][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x1f'),this[_0xcd85('0x20')][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x21'),this[_0xcd85('0x22')][_0xcd85('0x17')](this));ami['on'](_0xcd85('0x23'),this[_0xcd85('0x24')][_0xcd85('0x17')](this));try{logger[_0xcd85('0x25')](_0xcd85('0x26'));ami[_0xcd85('0x27')]();}catch(_0x40136b){logger[_0xcd85('0x28')](_0xcd85('0x29'),util[_0xcd85('0x2a')](_0x40136b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x2c')]=function(_0x104bb7){return _0x104bb7!==null&&!_[_0xcd85('0x2d')](_0x104bb7);};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x2e')]=function(_0x1ed878,_0x5cd4fe,_0x2aa187){io['to'](_0x1ed878)['emit'](_0x5cd4fe,_0x2aa187);};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x1c')]=function(_0x414a71){try{if(this[_0xcd85('0x2c')](_0x414a71)){logger[_0xcd85('0x25')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x414a71[_0xcd85('0x2f')],_0x414a71[_0xcd85('0x30')],_0x414a71[_0xcd85('0x31')]);logger[_0xcd85('0x32')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x414a71[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x414a71,{'showHidden':![],'depth':null}));if(_0x414a71[_0xcd85('0x2f')]===_0x414a71[_0xcd85('0x33')]){if(!_[_0xcd85('0x2d')](this['channels'][_0x414a71[_0xcd85('0x2f')]])){_[_0xcd85('0x34')](this[_0xcd85('0x11')][_0x414a71[_0xcd85('0x2f')]],_[_0xcd85('0x35')](_0x414a71,_[_0xcd85('0x36')](this[_0xcd85('0x11')][_0x414a71[_0xcd85('0x2f')]])));}}if(_0x414a71[_0xcd85('0x37')]===_0xcd85('0x38')){if(this['agents'][_0x414a71[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]){if(_0x414a71['exten']==_0xcd85('0x3b')){this[_0xcd85('0x12')][_0x414a71[_0xcd85('0x39')]['split']('-')[0x0]][_0xcd85('0x3c')]=_0x414a71[_0xcd85('0x3d')];this[_0xcd85('0x2e')](util[_0xcd85('0x3e')]('user:%s',this[_0xcd85('0x12')][_0x414a71['channel'][_0xcd85('0x3a')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xcd85('0x12')][_0x414a71[_0xcd85('0x39')]['split']('-')[0x0]][_0xcd85('0x3f')],'destconnectedlinenum':_0x414a71[_0xcd85('0x3d')]});}}}}}catch(_0x63c407){logger[_0xcd85('0x28')](_0xcd85('0x40'),_0x414a71['uniqueid'],util[_0xcd85('0x2a')](_0x63c407,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x41')]=function(_0x45dffa){try{if(this[_0xcd85('0x2c')](_0x45dffa)){logger[_0xcd85('0x32')](_0xcd85('0x42'),_0x45dffa['uniqueid'],util[_0xcd85('0x2a')](_0x45dffa,{'showHidden':![],'depth':null}));if(_0x45dffa[_0xcd85('0x2f')]===_0x45dffa[_0xcd85('0x33')]&&_0x45dffa[_0xcd85('0x39')]!=_0xcd85('0x43')){if(_[_0xcd85('0x2d')](this[_0xcd85('0x11')][_0x45dffa['uniqueid']])){logger['info'](_0xcd85('0x44'),_0x45dffa[_0xcd85('0x2f')],_0x45dffa[_0xcd85('0x37')],_0x45dffa['exten']);this[_0xcd85('0x11')][_0x45dffa['uniqueid']]=new Channel();this[_0xcd85('0x11')][_0x45dffa[_0xcd85('0x2f')]][_0xcd85('0x45')]=moment()[_0xcd85('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xcd85('0x11')][_0x45dffa[_0xcd85('0x2f')]]['disposition']=dispositions[_[_0xcd85('0x46')](_0x45dffa[_0xcd85('0x47')])];_[_0xcd85('0x34')](this[_0xcd85('0x11')][_0x45dffa[_0xcd85('0x2f')]],_[_0xcd85('0x35')](_0x45dffa,_['keys'](this[_0xcd85('0x11')][_0x45dffa[_0xcd85('0x2f')]])));if(_0x45dffa[_0xcd85('0x37')]==='from-sip'){if(this['agents'][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]){if(_[_0xcd85('0x2d')](this[_0xcd85('0x12')][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x3c')])){this['agents'][_0x45dffa['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x45dffa[_0xcd85('0x48')];logger[_0xcd85('0x32')](_0xcd85('0x49'),_0x45dffa['uniqueid'],util[_0xcd85('0x2a')]({'id':this[_0xcd85('0x12')][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xcd85('0x12')][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x3f')],'destconnectedlinenum':_0x45dffa[_0xcd85('0x48')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xcd85('0x3e')](_0xcd85('0x4a'),this['agents'][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x4b')]),_0xcd85('0x4c'),{'id':this[_0xcd85('0x12')][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xcd85('0x12')][_0x45dffa[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x3f')],'destconnectedlinenum':_0x45dffa[_0xcd85('0x48')]});}}}}}}}catch(_0x4c82fe){logger[_0xcd85('0x28')]('[%s][voiceCallReport][newchannel]',_0x45dffa[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x4c82fe,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x15')]=function(_0x41605c){try{if(this[_0xcd85('0x2c')](_0x41605c)){logger['debug'](_0xcd85('0x4d'),_0x41605c['uniqueid'],util['inspect'](_0x41605c,{'showHidden':![],'depth':null}));if(_0x41605c['uniqueid']===_0x41605c[_0xcd85('0x33')]&&_0x41605c[_0xcd85('0x48')]!='h'&&_0x41605c[_0xcd85('0x39')]!=_0xcd85('0x43')){_0x41605c[_0xcd85('0x4e')]=_0x41605c[_0xcd85('0x4e')][_0xcd85('0x4f')]();_0x41605c[_0xcd85('0x50')]=_0x41605c[_0xcd85('0x51')]&&_0x41605c[_0xcd85('0x51')][_0xcd85('0x52')](_0xcd85('0x53'))?_0x41605c[_0xcd85('0x51')]:(_0x41605c[_0xcd85('0x51')]||_0x41605c['applicationdata'])['toLowerCase']();logger[_0xcd85('0x25')](_0xcd85('0x54'),_0x41605c['uniqueid'],_0x41605c[_0xcd85('0x4e')],_0x41605c[_0xcd85('0x50')]);if(_[_0xcd85('0x2d')](this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]])){this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]]=new Channel();this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]]['starttime']=_0x41605c[_0xcd85('0x55')]?moment()[_0xcd85('0x56')](moment[_0xcd85('0x55')](_0x41605c[_0xcd85('0x55')])[_0xcd85('0x57')](),_0xcd85('0x57'))[_0xcd85('0x3e')](_0xcd85('0x58')):moment()['format'](_0xcd85('0x58'));this[_0xcd85('0x11')][_0x41605c['uniqueid']]['disposition']=_0xcd85('0xa');}_[_0xcd85('0x34')](this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]],_[_0xcd85('0x35')](_0x41605c,_[_0xcd85('0x36')](this['channels'][_0x41605c['uniqueid']])));if(_[_0xcd85('0x59')](applications,_0x41605c[_0xcd85('0x4e')])){this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]][_0xcd85('0x5a')]=_0x41605c['application'];this['channels'][_0x41605c[_0xcd85('0x2f')]][_0xcd85('0x5b')]=_0x41605c[_0xcd85('0x50')];if(_0x41605c[_0xcd85('0x4e')]===_0xcd85('0x6')&&_[_0xcd85('0x52')](_0x41605c[_0xcd85('0x50')][_0xcd85('0x4f')](),_0xcd85('0x5c'))){var _0x17d6c9=_0x41605c[_0xcd85('0x50')][_0xcd85('0x3a')]('=');var _0x5d8191=_0x17d6c9[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x5d8191){this[_0xcd85('0x11')][_0x41605c[_0xcd85('0x2f')]][_0x5d8191[0x1]]=_0x17d6c9[0x1];}}else if(_0x41605c[_0xcd85('0x4e')]===_0xcd85('0x7')){this['channels'][_0x41605c[_0xcd85('0x2f')]][_0xcd85('0x7')]=_0x41605c[_0xcd85('0x50')][_0xcd85('0x3a')](',')[0x0];}}}}}catch(_0x2e8b40){logger[_0xcd85('0x28')](_0xcd85('0x5d'),_0x41605c['uniqueid'],util[_0xcd85('0x2a')](_0x2e8b40,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x5e')]=function(_0x577a88){try{if(this[_0xcd85('0x2c')](_0x577a88)){logger[_0xcd85('0x25')](_0xcd85('0x5f'),_0x577a88[_0xcd85('0x2f')],_0x577a88[_0xcd85('0x33')],_0x577a88[_0xcd85('0x30')],_0x577a88[_0xcd85('0x31')]);logger[_0xcd85('0x32')]('[%s][voiceCallReport][newstate]\x20event:',_0x577a88[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x577a88,{'showHidden':![],'depth':null}));if(_0x577a88[_0xcd85('0x2f')]!==_0x577a88['linkedid']){if(this['channels'][_0x577a88['linkedid']]){if(_0x577a88['channelstate']==='6'){if(!this['channels'][_0x577a88[_0xcd85('0x33')]][_0xcd85('0x60')]){var _0x11f518=moment();this[_0xcd85('0x11')][_0x577a88['linkedid']][_0xcd85('0x60')]=!![];this['channels'][_0x577a88[_0xcd85('0x33')]][_0xcd85('0x61')]=_0x11f518[_0xcd85('0x3e')](_0xcd85('0x58'));if(this[_0xcd85('0x11')][_0x577a88['linkedid']]['starttime']){this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x33')]]['holdtime']=_0x11f518[_0xcd85('0x62')](this[_0xcd85('0x11')][_0x577a88['linkedid']]['starttime'],_0xcd85('0x57'));}}this['channels'][_0x577a88['linkedid']][_0xcd85('0x33')]=_0x577a88['uniqueid'];if(_0x577a88[_0xcd85('0x31')]!==_0xcd85('0x3b')){this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x33')]]['connectedlinenum']=_0x577a88[_0xcd85('0x31')];}this['channels'][_0x577a88['linkedid']][_0xcd85('0x63')]=_0x577a88[_0xcd85('0x30')];this[_0xcd85('0x11')][_0x577a88['linkedid']][_0xcd85('0x64')]=_0x577a88[_0xcd85('0x39')];this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x33')]]['disposition']=dispositions[_[_0xcd85('0x46')](_0x577a88['channelstate'])];if(this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]){this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x33')]][_0xcd85('0x65')]=this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['id'];this[_0xcd85('0x11')][_0x577a88['linkedid']][_0xcd85('0x66')]=this[_0xcd85('0x12')][_0x577a88['channel']['split']('-')[0x0]][_0xcd85('0x4b')];}}}}else{if(this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x2f')]]){if(_0x577a88[_0xcd85('0x47')]==='6'){if(this[_0xcd85('0x12')][_0x577a88['channel'][_0xcd85('0x3a')]('-')[0x0]]){this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x2f')]][_0xcd85('0x65')]=this[_0xcd85('0x12')][_0x577a88['channel'][_0xcd85('0x3a')]('-')[0x0]]['id'];this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x2f')]][_0xcd85('0x66')]=this['agents'][_0x577a88[_0xcd85('0x39')]['split']('-')[0x0]][_0xcd85('0x4b')];}}}}if(_0x577a88[_0xcd85('0x47')]==='6'&&_0x577a88[_0xcd85('0x37')]===_0xcd85('0x38')){if(this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]){this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')]['split']('-')[0x0]][_0xcd85('0x3c')]=_0x577a88[_0xcd85('0x48')];var _0x18a652,_0x5f5765;if(this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x2f')]]){_0x18a652=this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x2f')]][_0xcd85('0x67')];_0x5f5765=this[_0xcd85('0x11')][_0x577a88['uniqueid']][_0xcd85('0x7')];}else if(this[_0xcd85('0x11')][_0x577a88[_0xcd85('0x33')]]){_0x18a652=this[_0xcd85('0x11')][_0x577a88['linkedid']]['routealias'];_0x5f5765=this['channels'][_0x577a88['linkedid']]['queue'];}logger[_0xcd85('0x32')](_0xcd85('0x68'),_0x577a88['uniqueid'],util[_0xcd85('0x2a')]({'id':this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xcd85('0x12')][_0x577a88['channel'][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x3f')],'destconnectedlinenum':_0x577a88[_0xcd85('0x48')],'routealias':_0x18a652,'queue':_0x5f5765||undefined},{'showHidden':![],'depth':null}));this[_0xcd85('0x2e')](util[_0xcd85('0x3e')](_0xcd85('0x4a'),this[_0xcd85('0x12')][_0x577a88[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x4b')]),'user:agentconnect',{'id':this[_0xcd85('0x12')][_0x577a88['channel'][_0xcd85('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xcd85('0x12')][_0x577a88['channel'][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x3f')],'destconnectedlinenum':_0x577a88['exten'],'routealias':_0x18a652,'queue':_0x5f5765||undefined});}}}}catch(_0x16eba5){logger[_0xcd85('0x28')](_0xcd85('0x69'),_0x577a88['uniqueid'],util['inspect'](_0x16eba5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')]['syncMixMonitorFilename']=function(_0x525d03,_0x52b45b){try{if(this[_0xcd85('0x11')][_0x525d03]){logger[_0xcd85('0x25')](_0xcd85('0x6a'),_0x525d03,_0x52b45b);this[_0xcd85('0x11')][_0x525d03][_0xcd85('0x6b')]=!![];if(_[_0xcd85('0x6c')](_0x52b45b,_0xcd85('0x6d'))){_0x52b45b=_0x52b45b[_0xcd85('0x6e')](_0xcd85('0x6d'),'.WAV');}this[_0xcd85('0x11')][_0x525d03][_0xcd85('0x6f')]=_0x52b45b;var _0x55c590=_[_0xcd85('0x70')](this['channels'][_0x525d03][_0xcd85('0x71')],{'filename':_0x52b45b});if(_[_0xcd85('0x72')](_0x55c590)){this[_0xcd85('0x11')][_0x525d03][_0xcd85('0x71')][_0xcd85('0x73')]({'filename':_0x52b45b,'createdAt':moment()[_0xcd85('0x3e')](_0xcd85('0x58')),'mixmonitorid':'','status':_0xcd85('0x74')});}}}catch(_0x23cad9){logger[_0xcd85('0x28')]('[%s][voiceCallReport][mixMonitorFilename]',_0x525d03,util[_0xcd85('0x2a')](_0x23cad9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')]['syncVarSet']=function(_0x37322e){try{if(this[_0xcd85('0x2c')](_0x37322e)){logger[_0xcd85('0x32')](_0xcd85('0x75'),_0x37322e[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x37322e,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x37322e[_0xcd85('0x2f')]]&&_0x37322e[_0xcd85('0x39')]!=_0xcd85('0x43')){if(this[_0xcd85('0x2c')](_0x37322e['variable'])){if(this['isNotNull'](_0x37322e[_0xcd85('0x76')]['mixmonitor_filename'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this[_0xcd85('0x78')](_0x37322e[_0xcd85('0x2f')],_0x37322e['value']);}else if(this['isNotNull'](_0x37322e['variable']['xmd-phone'])){logger[_0xcd85('0x25')](_0xcd85('0x79'),_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this['channels'][_0x37322e[_0xcd85('0x2f')]][_0xcd85('0x31')]=_0x37322e[_0xcd85('0x77')];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')]['xmd-callerid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this[_0xcd85('0x11')][_0x37322e['uniqueid']][_0xcd85('0x7a')]=_0x37322e['value'];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')][_0xcd85('0x7b')])){logger[_0xcd85('0x25')](_0xcd85('0x7c'),_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this[_0xcd85('0x11')][_0x37322e[_0xcd85('0x2f')]][_0xcd85('0x7d')]=_0x37322e['value'];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')][_0xcd85('0x7e')])){logger[_0xcd85('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')][_0xcd85('0x3a')](',')[0x0]);this['channels'][_0x37322e[_0xcd85('0x2f')]][_0xcd85('0x7')]=_0x37322e[_0xcd85('0x77')]['split'](',')[0x0];}else if(this[_0xcd85('0x2c')](_0x37322e['variable']['xmd-originatecalleridnum'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e['value']);this[_0xcd85('0x11')][_0x37322e['uniqueid']][_0xcd85('0x7f')]=_0x37322e[_0xcd85('0x77')];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')]['xmd-destination'])){logger[_0xcd85('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this['channels'][_0x37322e['uniqueid']]['destination']=_0x37322e['value'];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')][_0xcd85('0x80')])){logger[_0xcd85('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x37322e[_0xcd85('0x2f')],_0x37322e['value']);this[_0xcd85('0x11')][_0x37322e['uniqueid']]['calleridpreview']=_0x37322e['value'];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')][_0xcd85('0x81')])){logger[_0xcd85('0x25')](_0xcd85('0x82'),_0x37322e[_0xcd85('0x2f')],_0x37322e[_0xcd85('0x77')]);this['channels'][_0x37322e[_0xcd85('0x2f')]][_0xcd85('0x7')]=_0x37322e[_0xcd85('0x77')];}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')]['sipcallid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x37322e['uniqueid'],_0x37322e[_0xcd85('0x77')]);this['channels'][_0x37322e[_0xcd85('0x2f')]][_0xcd85('0x83')]=_0x37322e['value'];}}}else if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')][_0xcd85('0x84')])){if(_0x37322e[_0xcd85('0x77')]){var _0x199aa4=path[_0xcd85('0x85')](_0x37322e[_0xcd85('0x77')])[_0xcd85('0x4b')];logger[_0xcd85('0x25')](_0xcd85('0x86'),_0x199aa4,_0x37322e['value']);this['syncMixMonitorFilename'](_0x199aa4,_0x37322e[_0xcd85('0x77')]);}}else if(this[_0xcd85('0x11')][_0x37322e[_0xcd85('0x33')]]){if(this[_0xcd85('0x2c')](_0x37322e[_0xcd85('0x76')])){if(this['isNotNull'](_0x37322e[_0xcd85('0x76')][_0xcd85('0x87')])){logger['info'](_0xcd85('0x88'),_0x37322e[_0xcd85('0x33')],_0x37322e['value']);this[_0xcd85('0x11')][_0x37322e['linkedid']]['sipcalllinkedid']=_0x37322e['value'];}}}}}catch(_0x577163){logger['error'](_0xcd85('0x89'),_0x37322e[_0xcd85('0x2f')],util['inspect'](_0x577163,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x8a')]=function(_0x4f024a){try{if(this['isNotNull'](_0x4f024a)){logger[_0xcd85('0x32')]('[%s][voiceCallReport][hangup]\x20event:',_0x4f024a[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x4f024a,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]]){logger[_0xcd85('0x25')](_0xcd85('0x8b'),_0x4f024a['uniqueid'],_0x4f024a['cause-txt']);var _0x1817c6=moment();this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x8c')]=_0x1817c6['format'](_0xcd85('0x58'));this['channels'][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x55')]=_0x1817c6['diff'](this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x45')],_0xcd85('0x57'));if(this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x60')]){this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x8d')]=_0x1817c6[_0xcd85('0x62')](this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x61')],_0xcd85('0x57'));this[_0xcd85('0x11')][_0x4f024a['uniqueid']]['holdtime']=this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x55')]-this[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x8d')];}if(_0x4f024a['context']===_0xcd85('0x38')){if(this['agents'][_0x4f024a[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]){this[_0xcd85('0x12')][_0x4f024a[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]=_['omit'](this[_0xcd85('0x12')][_0x4f024a[_0xcd85('0x39')]['split']('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0xcd85('0x8e'),_0x4f024a['uniqueid'],util['inspect']({'id':this[_0xcd85('0x12')][_0x4f024a['channel'][_0xcd85('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xcd85('0x12')][_0x4f024a[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xcd85('0x4a'),this['agents'][_0x4f024a['channel'][_0xcd85('0x3a')]('-')[0x0]][_0xcd85('0x4b')]),_0xcd85('0x8f'),{'id':this['agents'][_0x4f024a[_0xcd85('0x39')][_0xcd85('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0xcd85('0x12')][_0x4f024a['channel'][_0xcd85('0x3a')]('-')[0x0]]['accountcode']});for(var _0x2ffe2b=0x0;_0x2ffe2b<Object['keys'](this[_0xcd85('0x12')])[_0xcd85('0x90')];_0x2ffe2b++){var _0x22a867=Object[_0xcd85('0x36')](this[_0xcd85('0x12')])[_0x2ffe2b];var _0x50e7e5=this[_0xcd85('0x12')][_0x22a867];if(_0x50e7e5['accountcode']===Number(_0x4f024a[_0xcd85('0x3d')])){this[_0xcd85('0x2e')](util[_0xcd85('0x3e')](_0xcd85('0x4a'),_0x50e7e5[_0xcd85('0x4b')]),_0xcd85('0x8f'),{'id':_0x50e7e5['id'],'destaccountcode':_0x50e7e5[_0xcd85('0x3f')]});break;}}}}var _0x2c7fc9=this;Promise['resolve']()['then'](function(){var _0x1931bc=_0x2c7fc9['channels'][_0x4f024a[_0xcd85('0x2f')]];if(typeof _0x1931bc[_0xcd85('0x91')]===_0xcd85('0x92'))return;if(_[_0xcd85('0x93')](_0x1931bc[_0xcd85('0x71')]))return;return RpcSetting[_0xcd85('0x94')]()['then'](function(_0x42147e){if(!_0x42147e[_0xcd85('0x95')])return;return Promise[_0xcd85('0x96')]()[_0xcd85('0x97')](function(){return ami[_0xcd85('0x98')]({'action':_0xcd85('0x99'),'channel':_0x1931bc[_0xcd85('0x39')]})[_0xcd85('0x9a')](function(){});})[_0xcd85('0x97')](function(){return ami[_0xcd85('0x98')]({'action':_0xcd85('0x99'),'channel':_0x1931bc[_0xcd85('0x64')]})[_0xcd85('0x9a')](function(){})[_0xcd85('0x9b')](function(){var _0x14a5a7=_0x2c7fc9['agents'][_0x1931bc[_0xcd85('0x64')]['split']('-')[0x0]];if(!_0x14a5a7)return;io['emit'](_0xcd85('0x9c'),{'agentId':_0x14a5a7['id'],'uniqueid':_0x1931bc[_0xcd85('0x2f')]});});});});})['then'](function(){if(_0x4f024a['event']===_0xcd85('0x9d')){_0x2c7fc9[_0xcd85('0x13')][_0x4f024a[_0xcd85('0x2f')]]=_0x2c7fc9[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]];}else{if(_0x2c7fc9[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x7d')]===_0xcd85('0x9e')&&_0x2c7fc9[_0xcd85('0x13')][_0x4f024a[_0xcd85('0x2f')]]){_0x2c7fc9[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x2f')]=[_0x2c7fc9['channels'][_0x4f024a['uniqueid']][_0xcd85('0x33')],_0x2c7fc9[_0xcd85('0x11')][_0x4f024a['uniqueid']][_0xcd85('0x33')]=_0x2c7fc9[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]][_0xcd85('0x2f')]][0x0];delete _0x2c7fc9[_0xcd85('0x13')][_0x4f024a[_0xcd85('0x2f')]];}}logger['debug'](_0xcd85('0x9f'),_0x4f024a[_0xcd85('0x2f')],util['inspect'](_0x2c7fc9[_0xcd85('0x11')][_0x4f024a[_0xcd85('0x2f')]],{'showHidden':![],'depth':null}));ami[_0xcd85('0x2e')](_0xcd85('0xa0'),_0x2c7fc9[_0xcd85('0x11')][_0x4f024a['uniqueid']]);delete _0x2c7fc9['channels'][_0x4f024a[_0xcd85('0x2f')]];});}}}catch(_0x2f84f6){logger[_0xcd85('0x28')](_0xcd85('0xa1'),_0x4f024a[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x2f84f6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x1e')]=function(_0x4fd3ef){try{if(this[_0xcd85('0x2c')](_0x4fd3ef)){logger[_0xcd85('0x25')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4fd3ef['uniqueid'],_0x4fd3ef[_0xcd85('0xa2')],_0x4fd3ef[_0xcd85('0xa3')]);logger['debug'](_0xcd85('0xa4'),_0x4fd3ef[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x4fd3ef,{'showHidden':![],'depth':null}));var _0x464ed4;if(this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa5')]]){this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa5')]]['transfercalleridnum']=_0x4fd3ef['origtransferercalleridnum'];this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa5')]][_0xcd85('0xa6')]=_0x4fd3ef[_0xcd85('0xa3')];if(this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa7')]]){_0x464ed4=this[_0xcd85('0x11')][_0x4fd3ef['secondtransfereruniqueid']];this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa7')]]=this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa5')]];this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa5')]]=_0x464ed4;}}else if(this[_0xcd85('0x11')][_0x4fd3ef['transfertargetuniqueid']]){this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa8')]][_0xcd85('0xa9')]=_0x4fd3ef['origtransferercalleridnum'];this['channels'][_0x4fd3ef[_0xcd85('0xa8')]][_0xcd85('0xa6')]=_0x4fd3ef[_0xcd85('0xa3')];if(this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]]){_0x464ed4=this['channels'][_0x4fd3ef[_0xcd85('0xaa')]];this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]]=this[_0xcd85('0x11')][_0x4fd3ef['transfertargetuniqueid']];this['channels'][_0x4fd3ef[_0xcd85('0xa8')]]=_0x464ed4;}}if((this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]]||this['channels'][_0x4fd3ef['origtransfererlinkedid']])&&this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa7')]]){var _0x349d7f=_[_0xcd85('0xab')]([this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]],this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xac')]],this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa7')]]],function(_0x54ae58){return _0x54ae58&&_0x54ae58[_0xcd85('0x7d')]===_0xcd85('0x9e')&&_0x54ae58['routeid'];});if(_0x349d7f){if(this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]])this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xaa')]][_0xcd85('0x91')]=_0xcd85('0xad');if(this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xac')]])this['channels'][_0x4fd3ef[_0xcd85('0xac')]][_0xcd85('0x91')]='ATTENDED';this[_0xcd85('0x11')][_0x4fd3ef[_0xcd85('0xa7')]][_0xcd85('0x91')]=_0xcd85('0xad');}}}}catch(_0x38c2c0){logger[_0xcd85('0x28')](_0xcd85('0xae'),_0x4fd3ef[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x38c2c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')][_0xcd85('0x20')]=function(_0x3224c3){try{if(this[_0xcd85('0x2c')](_0x3224c3)){logger[_0xcd85('0x25')](_0xcd85('0xaf'),_0x3224c3[_0xcd85('0x2f')],_0x3224c3[_0xcd85('0xb0')],_0x3224c3[_0xcd85('0xb1')]);logger[_0xcd85('0x32')](_0xcd85('0xb2'),_0x3224c3[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x3224c3,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x3224c3[_0xcd85('0xa5')]]){this['channels'][_0x3224c3[_0xcd85('0xa5')]][_0xcd85('0xa9')]=_0x3224c3['transfereecalleridnum'];this[_0xcd85('0x11')][_0x3224c3[_0xcd85('0xa5')]][_0xcd85('0xa6')]=_0x3224c3[_0xcd85('0xb1')];this[_0xcd85('0x11')][_0x3224c3[_0xcd85('0xa5')]][_0xcd85('0x91')]=_0xcd85('0xb3');this[_0xcd85('0x8a')]({'event':_0xcd85('0x9d'),'uniqueid':_0x3224c3[_0xcd85('0xa5')],'context':_0x3224c3['context'],'channel':_0x3224c3[_0xcd85('0xb4')]});}else{this[_0xcd85('0x11')][_0x3224c3[_0xcd85('0xb5')]]['transferType']=_0xcd85('0xb3');}}}catch(_0x17a130){logger[_0xcd85('0x28')](_0xcd85('0xb6'),_0x3224c3[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x17a130,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xcd85('0x2b')]['syncMusicOnHoldStart']=function(_0x3bddce){try{if(this[_0xcd85('0x2c')](_0x3bddce)){logger[_0xcd85('0x32')](_0xcd85('0xb7'),_0x3bddce[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x3bddce,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x3bddce['uniqueid']]){if(!_[_0xcd85('0x72')](this[_0xcd85('0x11')][_0x3bddce[_0xcd85('0x2f')]][_0xcd85('0x61')])){this[_0xcd85('0x11')][_0x3bddce[_0xcd85('0x2f')]]['mohstarttime']=moment()['format'](_0xcd85('0x58'));logger[_0xcd85('0x25')](_0xcd85('0xb8'),_0x3bddce[_0xcd85('0x2f')],this[_0xcd85('0x11')][_0x3bddce['uniqueid']][_0xcd85('0xb9')]);}}}}catch(_0x5ec9a6){logger['error'](_0xcd85('0xba'),_0x3bddce[_0xcd85('0x2f')],util['inspect'](_0x5ec9a6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStop']=function(_0x5e38dd){try{if(this['isNotNull'](_0x5e38dd)){logger[_0xcd85('0x32')](_0xcd85('0xbb'),_0x5e38dd['uniqueid'],util['inspect'](_0x5e38dd,{'showHidden':![],'depth':null}));if(this[_0xcd85('0x11')][_0x5e38dd[_0xcd85('0x2f')]]){if(!_[_0xcd85('0x72')](this['channels'][_0x5e38dd[_0xcd85('0x2f')]][_0xcd85('0xb9')])){this['channels'][_0x5e38dd[_0xcd85('0x2f')]]['mohtime']+=moment()['milliseconds'](0x0)[_0xcd85('0x62')](this['channels'][_0x5e38dd[_0xcd85('0x2f')]][_0xcd85('0xb9')],_0xcd85('0x57'));logger[_0xcd85('0x25')](_0xcd85('0xbc'),_0x5e38dd[_0xcd85('0x2f')],this['channels'][_0x5e38dd['uniqueid']][_0xcd85('0xbd')]);delete this[_0xcd85('0x11')][_0x5e38dd[_0xcd85('0x2f')]][_0xcd85('0xb9')];}}}}catch(_0x14de16){logger[_0xcd85('0x28')](_0xcd85('0xbe'),_0x5e38dd[_0xcd85('0x2f')],util[_0xcd85('0x2a')](_0x14de16,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x147c=['[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','application','subtract','duration','seconds','includes','lastapplication','lastdata','match','queue','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','endsWith','.wav49','monitorFilename','monitors','isNil','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','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','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalllinkedid','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','StopMixMonitor','Action','catch','finally','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','transfereecalleridnum','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','lodash','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','set','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','hangup','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','musiconholdstop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','inspect','linkedid','merge','pick','keys','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','channel','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','accountcode'];(function(_0x25b862,_0x5c3871){var _0x25cb39=function(_0x1c9bd3){while(--_0x1c9bd3){_0x25b862['push'](_0x25b862['shift']());}};_0x25cb39(++_0x5c3871);}(_0x147c,0x144));var _0xc147=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x147c[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0xc147('0x0'));var moment=require('moment');var util=require(_0xc147('0x1'));var path=require(_0xc147('0x2'));var Redis=require(_0xc147('0x3'));var config=require(_0xc147('0x4'));var logger=require(_0xc147('0x5'))(_0xc147('0x6'));var ami=require(_0xc147('0x7'));var Channel=require(_0xc147('0x8'));var RpcSetting=require('../rpc/setting');var applications=[_0xc147('0x9'),'queue',_0xc147('0xa'),_0xc147('0xb'),'playback',_0xc147('0xc')];var dispositions=[_0xc147('0xd'),_0xc147('0xe'),'FAILED',_0xc147('0xd'),_0xc147('0xd'),_0xc147('0xd'),_0xc147('0xf'),_0xc147('0x10'),_0xc147('0xe'),_0xc147('0xe'),'FAILED'];config[_0xc147('0x11')]=_[_0xc147('0x12')](config[_0xc147('0x11')],{'host':_0xc147('0x13'),'port':0x18eb});var io=require(_0xc147('0x14'))(new Redis(config['redis']));function VoiceCallReport(_0x725c8b){this['channels']=_0x725c8b[_0xc147('0x15')];this[_0xc147('0x16')]=_0x725c8b[_0xc147('0x16')];this[_0xc147('0x17')]={};ami['on'](_0xc147('0x18'),this[_0xc147('0x19')][_0xc147('0x1a')](this));ami['on']('newexten',this[_0xc147('0x19')][_0xc147('0x1a')](this));ami['on'](_0xc147('0x1b'),this[_0xc147('0x1c')]['bind'](this));ami['on'](_0xc147('0x1d'),this['syncNewState'][_0xc147('0x1a')](this));ami['on'](_0xc147('0x1e'),this['syncVarSet'][_0xc147('0x1a')](this));ami['on'](_0xc147('0x1f'),this['syncHangup'][_0xc147('0x1a')](this));ami['on']('newcallerid',this[_0xc147('0x20')][_0xc147('0x1a')](this));ami['on'](_0xc147('0x21'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xc147('0x22'),this['syncBlindTransfer'][_0xc147('0x1a')](this));ami['on'](_0xc147('0x23'),this['syncMusicOnHoldStart'][_0xc147('0x1a')](this));ami['on'](_0xc147('0x24'),this['syncMusicOnHoldStop']['bind'](this));try{logger[_0xc147('0x25')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xc147('0x26')]();}catch(_0x242c36){logger[_0xc147('0x27')](_0xc147('0x28'),util['inspect'](_0x242c36,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xc147('0x29')][_0xc147('0x2a')]=function(_0x35721b){return _0x35721b!==null&&!_[_0xc147('0x2b')](_0x35721b);};VoiceCallReport['prototype'][_0xc147('0x2c')]=function(_0x440a02,_0x1ff5b6,_0x391626){io['to'](_0x440a02)[_0xc147('0x2c')](_0x1ff5b6,_0x391626);};VoiceCallReport[_0xc147('0x29')][_0xc147('0x20')]=function(_0x436230){try{if(this[_0xc147('0x2a')](_0x436230)){logger['info'](_0xc147('0x2d'),_0x436230[_0xc147('0x2e')],_0x436230[_0xc147('0x2f')],_0x436230[_0xc147('0x30')]);logger['debug'](_0xc147('0x31'),_0x436230[_0xc147('0x2e')],util[_0xc147('0x32')](_0x436230,{'showHidden':![],'depth':null}));if(_0x436230[_0xc147('0x2e')]===_0x436230[_0xc147('0x33')]){if(!_[_0xc147('0x2b')](this[_0xc147('0x15')][_0x436230[_0xc147('0x2e')]])){_[_0xc147('0x34')](this['channels'][_0x436230['uniqueid']],_[_0xc147('0x35')](_0x436230,_[_0xc147('0x36')](this[_0xc147('0x15')][_0x436230[_0xc147('0x2e')]])));}}if(_0x436230['context']==='from-sip'){if(this[_0xc147('0x16')][_0x436230['channel'][_0xc147('0x37')]('-')[0x0]]){if(_0x436230[_0xc147('0x38')]==_0xc147('0x39')){this['agents'][_0x436230['channel'][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3a')]=_0x436230['connectedlinenum'];this[_0xc147('0x2c')](util[_0xc147('0x3b')](_0xc147('0x3c'),this[_0xc147('0x16')][_0x436230[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3e')]),_0xc147('0x3f'),{'destaccountcode':this['agents'][_0x436230[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x436230[_0xc147('0x40')]});}}}}}catch(_0x362977){logger[_0xc147('0x27')](_0xc147('0x41'),_0x436230[_0xc147('0x2e')],util[_0xc147('0x32')](_0x362977,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc147('0x1c')]=function(_0x26a6ca){try{if(this[_0xc147('0x2a')](_0x26a6ca)){logger[_0xc147('0x42')](_0xc147('0x43'),_0x26a6ca[_0xc147('0x2e')],util[_0xc147('0x32')](_0x26a6ca,{'showHidden':![],'depth':null}));if(_0x26a6ca[_0xc147('0x2e')]===_0x26a6ca['linkedid']&&_0x26a6ca['channel']!=_0xc147('0x44')){if(_[_0xc147('0x2b')](this[_0xc147('0x15')][_0x26a6ca['uniqueid']])){logger[_0xc147('0x25')](_0xc147('0x45'),_0x26a6ca['uniqueid'],_0x26a6ca[_0xc147('0x46')],_0x26a6ca[_0xc147('0x38')]);this['channels'][_0x26a6ca[_0xc147('0x2e')]]=new Channel();this[_0xc147('0x15')][_0x26a6ca['uniqueid']][_0xc147('0x47')]=moment()[_0xc147('0x3b')](_0xc147('0x48'));this[_0xc147('0x15')][_0x26a6ca[_0xc147('0x2e')]][_0xc147('0x49')]=dispositions[_[_0xc147('0x4a')](_0x26a6ca[_0xc147('0x4b')])];_[_0xc147('0x34')](this[_0xc147('0x15')][_0x26a6ca[_0xc147('0x2e')]],_['pick'](_0x26a6ca,_[_0xc147('0x36')](this[_0xc147('0x15')][_0x26a6ca[_0xc147('0x2e')]])));if(_0x26a6ca['context']===_0xc147('0x4c')){if(this[_0xc147('0x16')][_0x26a6ca['channel'][_0xc147('0x37')]('-')[0x0]]){if(_['isUndefined'](this[_0xc147('0x16')][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3a')])){this[_0xc147('0x16')][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['destconnectedlinenum']=_0x26a6ca[_0xc147('0x38')];logger[_0xc147('0x42')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x26a6ca[_0xc147('0x2e')],util[_0xc147('0x32')]({'id':this[_0xc147('0x16')][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0xc147('0x16')][_0x26a6ca['channel'][_0xc147('0x37')]('-')[0x0]][_0xc147('0x4d')],'destconnectedlinenum':_0x26a6ca[_0xc147('0x38')]},{'showHidden':![],'depth':null}));this[_0xc147('0x2c')](util[_0xc147('0x3b')](_0xc147('0x3c'),this['agents'][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3e')]),_0xc147('0x3f'),{'id':this[_0xc147('0x16')][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0xc147('0x16')][_0x26a6ca[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x4d')],'destconnectedlinenum':_0x26a6ca['exten']});}}}}}}}catch(_0x161f7c){logger['error']('[%s][voiceCallReport][newchannel]',_0x26a6ca['uniqueid'],util['inspect'](_0x161f7c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc147('0x19')]=function(_0x12b0ec){try{if(this[_0xc147('0x2a')](_0x12b0ec)){logger[_0xc147('0x42')](_0xc147('0x4e'),_0x12b0ec[_0xc147('0x2e')],util['inspect'](_0x12b0ec,{'showHidden':![],'depth':null}));if(_0x12b0ec[_0xc147('0x2e')]===_0x12b0ec[_0xc147('0x33')]&&_0x12b0ec['exten']!='h'&&_0x12b0ec[_0xc147('0x3d')]!='OutgoingSpoolFailed'){_0x12b0ec['application']=_0x12b0ec['application'][_0xc147('0x4f')]();_0x12b0ec[_0xc147('0x50')]=_0x12b0ec['appdata']&&_0x12b0ec['appdata'][_0xc147('0x51')](_0xc147('0x52'))?_0x12b0ec[_0xc147('0x53')]:(_0x12b0ec[_0xc147('0x53')]||_0x12b0ec[_0xc147('0x50')])[_0xc147('0x4f')]();logger[_0xc147('0x25')](_0xc147('0x54'),_0x12b0ec[_0xc147('0x2e')],_0x12b0ec[_0xc147('0x55')],_0x12b0ec['applicationdata']);if(_[_0xc147('0x2b')](this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]])){this[_0xc147('0x15')][_0x12b0ec['uniqueid']]=new Channel();this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]][_0xc147('0x47')]=_0x12b0ec['duration']?moment()[_0xc147('0x56')](moment[_0xc147('0x57')](_0x12b0ec[_0xc147('0x57')])[_0xc147('0x58')](),_0xc147('0x58'))['format'](_0xc147('0x48')):moment()[_0xc147('0x3b')](_0xc147('0x48'));this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]][_0xc147('0x49')]=_0xc147('0xd');}_[_0xc147('0x34')](this['channels'][_0x12b0ec[_0xc147('0x2e')]],_[_0xc147('0x35')](_0x12b0ec,_[_0xc147('0x36')](this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]])));if(_[_0xc147('0x59')](applications,_0x12b0ec[_0xc147('0x55')])){this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]][_0xc147('0x5a')]=_0x12b0ec[_0xc147('0x55')];this['channels'][_0x12b0ec['uniqueid']][_0xc147('0x5b')]=_0x12b0ec[_0xc147('0x50')];if(_0x12b0ec[_0xc147('0x55')]==='set'&&_[_0xc147('0x51')](_0x12b0ec[_0xc147('0x50')]['toLowerCase'](),'cdr(')){var _0x46c0e5=_0x12b0ec[_0xc147('0x50')][_0xc147('0x37')]('=');var _0xada090=_0x46c0e5[0x0][_0xc147('0x4f')]()[_0xc147('0x5c')](/cdr\((.*)\)/);if(_0xada090){this[_0xc147('0x15')][_0x12b0ec[_0xc147('0x2e')]][_0xada090[0x1]]=_0x46c0e5[0x1];}}else if(_0x12b0ec[_0xc147('0x55')]==='queue'){this['channels'][_0x12b0ec[_0xc147('0x2e')]][_0xc147('0x5d')]=_0x12b0ec['applicationdata']['split'](',')[0x0];}}}}}catch(_0x186b88){logger[_0xc147('0x27')]('[%s][voiceCallReport][newexten]',_0x12b0ec[_0xc147('0x2e')],util['inspect'](_0x186b88,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')]['syncNewState']=function(_0x1906e6){try{if(this[_0xc147('0x2a')](_0x1906e6)){logger[_0xc147('0x25')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1906e6[_0xc147('0x2e')],_0x1906e6['linkedid'],_0x1906e6['calleridname'],_0x1906e6['calleridnum']);logger[_0xc147('0x42')](_0xc147('0x5e'),_0x1906e6[_0xc147('0x2e')],util['inspect'](_0x1906e6,{'showHidden':![],'depth':null}));if(_0x1906e6[_0xc147('0x2e')]!==_0x1906e6[_0xc147('0x33')]){if(this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]]){if(_0x1906e6['channelstate']==='6'){if(!this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x5f')]){var _0x197e4a=moment();this['channels'][_0x1906e6[_0xc147('0x33')]][_0xc147('0x5f')]=!![];this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x60')]=_0x197e4a[_0xc147('0x3b')](_0xc147('0x48'));if(this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x47')]){this[_0xc147('0x15')][_0x1906e6['linkedid']][_0xc147('0x61')]=_0x197e4a[_0xc147('0x62')](this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]]['starttime'],_0xc147('0x58'));}}this[_0xc147('0x15')][_0x1906e6['linkedid']]['linkedid']=_0x1906e6[_0xc147('0x2e')];if(_0x1906e6['calleridnum']!==_0xc147('0x39')){this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]]['connectedlinenum']=_0x1906e6[_0xc147('0x30')];}this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x63')]=_0x1906e6[_0xc147('0x2f')];this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x64')]=_0x1906e6[_0xc147('0x3d')];this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x49')]=dispositions[_[_0xc147('0x4a')](_0x1906e6['channelstate'])];if(this[_0xc147('0x16')][_0x1906e6[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]){this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]][_0xc147('0x65')]=this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]['id'];this[_0xc147('0x15')][_0x1906e6['linkedid']]['membername']=this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]['name'];}}}}else{if(this[_0xc147('0x15')][_0x1906e6[_0xc147('0x2e')]]){if(_0x1906e6[_0xc147('0x4b')]==='6'){if(this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]){this[_0xc147('0x15')][_0x1906e6[_0xc147('0x2e')]]['UserId']=this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]['id'];this[_0xc147('0x15')][_0x1906e6[_0xc147('0x2e')]][_0xc147('0x66')]=this[_0xc147('0x16')][_0x1906e6[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3e')];}}}}if(_0x1906e6['channelstate']==='6'&&_0x1906e6['context']===_0xc147('0x4c')){if(this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]){this[_0xc147('0x16')][_0x1906e6[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3a')]=_0x1906e6[_0xc147('0x38')];var _0x336de3,_0x3c4312;if(this[_0xc147('0x15')][_0x1906e6[_0xc147('0x2e')]]){_0x336de3=this[_0xc147('0x15')][_0x1906e6['uniqueid']]['routealias'];_0x3c4312=this[_0xc147('0x15')][_0x1906e6[_0xc147('0x2e')]][_0xc147('0x5d')];}else if(this[_0xc147('0x15')][_0x1906e6[_0xc147('0x33')]]){_0x336de3=this['channels'][_0x1906e6['linkedid']][_0xc147('0x67')];_0x3c4312=this['channels'][_0x1906e6[_0xc147('0x33')]][_0xc147('0x5d')];}logger[_0xc147('0x42')](_0xc147('0x68'),_0x1906e6[_0xc147('0x2e')],util[_0xc147('0x32')]({'id':this[_0xc147('0x16')][_0x1906e6[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1906e6[_0xc147('0x3d')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1906e6[_0xc147('0x38')],'routealias':_0x336de3,'queue':_0x3c4312||undefined},{'showHidden':![],'depth':null}));this[_0xc147('0x2c')](util[_0xc147('0x3b')](_0xc147('0x3c'),this['agents'][_0x1906e6[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3e')]),'user:agentconnect',{'id':this[_0xc147('0x16')][_0x1906e6['channel'][_0xc147('0x37')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xc147('0x16')][_0x1906e6[_0xc147('0x3d')]['split']('-')[0x0]][_0xc147('0x4d')],'destconnectedlinenum':_0x1906e6[_0xc147('0x38')],'routealias':_0x336de3,'queue':_0x3c4312||undefined});}}}}catch(_0x406f39){logger[_0xc147('0x27')](_0xc147('0x69'),_0x1906e6[_0xc147('0x2e')],util['inspect'](_0x406f39,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc147('0x6a')]=function(_0x5e95c2,_0x2600bc){try{if(this['channels'][_0x5e95c2]){logger[_0xc147('0x25')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5e95c2,_0x2600bc);this[_0xc147('0x15')][_0x5e95c2]['monitor']=!![];if(_[_0xc147('0x6b')](_0x2600bc,_0xc147('0x6c'))){_0x2600bc=_0x2600bc['replace']('.wav49','.WAV');}this[_0xc147('0x15')][_0x5e95c2][_0xc147('0x6d')]=_0x2600bc;var _0x584315=_['find'](this[_0xc147('0x15')][_0x5e95c2][_0xc147('0x6e')],{'filename':_0x2600bc});if(_[_0xc147('0x6f')](_0x584315)){this['channels'][_0x5e95c2][_0xc147('0x6e')][_0xc147('0x70')]({'filename':_0x2600bc,'createdAt':moment()[_0xc147('0x3b')](_0xc147('0x48')),'mixmonitorid':'','status':'rec'});}}}catch(_0x22e154){logger[_0xc147('0x27')](_0xc147('0x71'),_0x5e95c2,util[_0xc147('0x32')](_0x22e154,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0x72')]=function(_0x374818){try{if(this[_0xc147('0x2a')](_0x374818)){logger['debug'](_0xc147('0x73'),_0x374818[_0xc147('0x2e')],util['inspect'](_0x374818,{'showHidden':![],'depth':null}));if(this[_0xc147('0x15')][_0x374818[_0xc147('0x2e')]]&&_0x374818[_0xc147('0x3d')]!=_0xc147('0x44')){if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')])){if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')]['mixmonitor_filename'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x6a')](_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);}else if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')]['xmd-phone'])){logger[_0xc147('0x25')](_0xc147('0x76'),_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818['uniqueid']][_0xc147('0x30')]=_0x374818[_0xc147('0x75')];}else if(this[_0xc147('0x2a')](_0x374818['variable']['xmd-callerid'])){logger[_0xc147('0x25')](_0xc147('0x77'),_0x374818[_0xc147('0x2e')],_0x374818['value']);this[_0xc147('0x15')][_0x374818['uniqueid']][_0xc147('0x78')]=_0x374818[_0xc147('0x75')];}else if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')][_0xc147('0x79')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818[_0xc147('0x2e')]][_0xc147('0x7a')]=_0x374818[_0xc147('0x75')];}else if(this['isNotNull'](_0x374818[_0xc147('0x74')][_0xc147('0x7b')])){logger[_0xc147('0x25')](_0xc147('0x7c'),_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')][_0xc147('0x37')](',')[0x0]);this[_0xc147('0x15')][_0x374818['uniqueid']]['queue']=_0x374818[_0xc147('0x75')][_0xc147('0x37')](',')[0x0];}else if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')][_0xc147('0x7d')])){logger[_0xc147('0x25')](_0xc147('0x7e'),_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this['channels'][_0x374818[_0xc147('0x2e')]][_0xc147('0x7f')]=_0x374818[_0xc147('0x75')];}else if(this['isNotNull'](_0x374818[_0xc147('0x74')][_0xc147('0x80')])){logger[_0xc147('0x25')](_0xc147('0x81'),_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818['uniqueid']][_0xc147('0x82')]=_0x374818[_0xc147('0x75')];}else if(this[_0xc147('0x2a')](_0x374818['variable'][_0xc147('0x83')])){logger[_0xc147('0x25')](_0xc147('0x84'),_0x374818['uniqueid'],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818[_0xc147('0x2e')]][_0xc147('0x85')]=_0x374818[_0xc147('0x75')];}else if(this[_0xc147('0x2a')](_0x374818['variable']['xmcs-queue'])){logger[_0xc147('0x25')](_0xc147('0x86'),_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this['channels'][_0x374818[_0xc147('0x2e')]][_0xc147('0x5d')]=_0x374818['value'];}else if(this[_0xc147('0x2a')](_0x374818['variable'][_0xc147('0x87')])){logger[_0xc147('0x25')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x374818[_0xc147('0x2e')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818[_0xc147('0x2e')]][_0xc147('0x88')]=_0x374818[_0xc147('0x75')];}}}else if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')][_0xc147('0x89')])){if(_0x374818['value']){var _0x405d2c=path[_0xc147('0x8a')](_0x374818[_0xc147('0x75')])[_0xc147('0x3e')];logger[_0xc147('0x25')](_0xc147('0x8b'),_0x405d2c,_0x374818[_0xc147('0x75')]);this['syncMixMonitorFilename'](_0x405d2c,_0x374818[_0xc147('0x75')]);}}else if(this[_0xc147('0x15')][_0x374818['linkedid']]){if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')])){if(this[_0xc147('0x2a')](_0x374818[_0xc147('0x74')][_0xc147('0x87')])){logger[_0xc147('0x25')](_0xc147('0x8c'),_0x374818[_0xc147('0x33')],_0x374818[_0xc147('0x75')]);this[_0xc147('0x15')][_0x374818['linkedid']][_0xc147('0x8d')]=_0x374818[_0xc147('0x75')];}}}}}catch(_0x5e3a21){logger[_0xc147('0x27')]('[%s][voiceCallReport][varset]',_0x374818[_0xc147('0x2e')],util[_0xc147('0x32')](_0x5e3a21,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0x8e')]=function(_0x3827e9){try{if(this[_0xc147('0x2a')](_0x3827e9)){logger[_0xc147('0x42')](_0xc147('0x8f'),_0x3827e9['uniqueid'],util['inspect'](_0x3827e9,{'showHidden':![],'depth':null}));if(this[_0xc147('0x15')][_0x3827e9['uniqueid']]){logger[_0xc147('0x25')](_0xc147('0x90'),_0x3827e9[_0xc147('0x2e')],_0x3827e9['cause-txt']);var _0x35db2a=moment();this['channels'][_0x3827e9['uniqueid']][_0xc147('0x91')]=_0x35db2a[_0xc147('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['duration']=_0x35db2a[_0xc147('0x62')](this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['starttime'],'seconds');if(this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]][_0xc147('0x5f')]){this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['billableseconds']=_0x35db2a['diff'](this[_0xc147('0x15')][_0x3827e9['uniqueid']]['answertime'],_0xc147('0x58'));this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]][_0xc147('0x61')]=this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]][_0xc147('0x57')]-this[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]][_0xc147('0x92')];}if(_0x3827e9[_0xc147('0x46')]===_0xc147('0x4c')){if(this[_0xc147('0x16')][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]){this[_0xc147('0x16')][_0x3827e9['channel']['split']('-')[0x0]]=_['omit'](this[_0xc147('0x16')][_0x3827e9['channel'][_0xc147('0x37')]('-')[0x0]],[_0xc147('0x3a')]);logger[_0xc147('0x42')](_0xc147('0x93'),_0x3827e9[_0xc147('0x2e')],util[_0xc147('0x32')]({'id':this[_0xc147('0x16')][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['id'],'destaccountcode':this[_0xc147('0x16')][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x4d')]},{'showHidden':![],'depth':null}));this[_0xc147('0x2c')](util[_0xc147('0x3b')](_0xc147('0x3c'),this[_0xc147('0x16')][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x3e')]),_0xc147('0x94'),{'id':this[_0xc147('0x16')][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x3827e9[_0xc147('0x3d')][_0xc147('0x37')]('-')[0x0]][_0xc147('0x4d')]});for(var _0x34cd78=0x0;_0x34cd78<Object[_0xc147('0x36')](this['agents'])[_0xc147('0x95')];_0x34cd78++){var _0x49022e=Object[_0xc147('0x36')](this[_0xc147('0x16')])[_0x34cd78];var _0x18f01b=this[_0xc147('0x16')][_0x49022e];if(_0x18f01b[_0xc147('0x4d')]===Number(_0x3827e9[_0xc147('0x40')])){this[_0xc147('0x2c')](util[_0xc147('0x3b')](_0xc147('0x3c'),_0x18f01b[_0xc147('0x3e')]),'user:agentcomplete',{'id':_0x18f01b['id'],'destaccountcode':_0x18f01b[_0xc147('0x4d')]});break;}}}}var _0x182850=this;Promise[_0xc147('0x96')]()[_0xc147('0x97')](function(){var _0x1dbea9=_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]];if(typeof _0x1dbea9[_0xc147('0x98')]===_0xc147('0x99'))return;if(_[_0xc147('0x9a')](_0x1dbea9[_0xc147('0x6e')]))return;return RpcSetting[_0xc147('0x9b')]()[_0xc147('0x97')](function(_0x571cea){if(!_0x571cea[_0xc147('0x9c')])return;return Promise[_0xc147('0x96')]()[_0xc147('0x97')](function(){return ami['Action']({'action':_0xc147('0x9d'),'channel':_0x1dbea9[_0xc147('0x3d')]})['catch'](function(){});})[_0xc147('0x97')](function(){return ami[_0xc147('0x9e')]({'action':_0xc147('0x9d'),'channel':_0x1dbea9[_0xc147('0x64')]})[_0xc147('0x9f')](function(){})[_0xc147('0xa0')](function(){var _0x70cc04=_0x182850['agents'][_0x1dbea9[_0xc147('0x64')][_0xc147('0x37')]('-')[0x0]];if(!_0x70cc04)return;io[_0xc147('0x2c')](_0xc147('0xa1'),{'agentId':_0x70cc04['id'],'uniqueid':_0x1dbea9['uniqueid']});});});});})[_0xc147('0x97')](function(){if(_0x3827e9[_0xc147('0xa2')]===_0xc147('0xa3')){_0x182850['blindTransfers'][_0x3827e9[_0xc147('0x2e')]]=_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]];}else{if(_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]][_0xc147('0x7a')]==='outbound'&&_0x182850[_0xc147('0x17')][_0x3827e9[_0xc147('0x2e')]]){_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['uniqueid']=[_0x182850[_0xc147('0x15')][_0x3827e9['uniqueid']][_0xc147('0x33')],_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['linkedid']=_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]]['uniqueid']][0x0];delete _0x182850[_0xc147('0x17')][_0x3827e9[_0xc147('0x2e')]];}}logger[_0xc147('0x42')](_0xc147('0xa4'),_0x3827e9[_0xc147('0x2e')],util[_0xc147('0x32')](_0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]],{'showHidden':![],'depth':null}));ami[_0xc147('0x2c')](_0xc147('0xa5'),_0x182850['channels'][_0x3827e9[_0xc147('0x2e')]]);delete _0x182850[_0xc147('0x15')][_0x3827e9[_0xc147('0x2e')]];});}}}catch(_0x317d54){logger[_0xc147('0x27')](_0xc147('0xa6'),_0x3827e9[_0xc147('0x2e')],util[_0xc147('0x32')](_0x317d54,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0xa7')]=function(_0x2f0abf){try{if(this['isNotNull'](_0x2f0abf)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x2f0abf[_0xc147('0x2e')],_0x2f0abf['origtransferercalleridnum'],_0x2f0abf[_0xc147('0xa8')]);logger[_0xc147('0x42')](_0xc147('0xa9'),_0x2f0abf[_0xc147('0x2e')],util['inspect'](_0x2f0abf,{'showHidden':![],'depth':null}));var _0x42fb0a;if(this['channels'][_0x2f0abf[_0xc147('0xaa')]]){this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xaa')]][_0xc147('0xab')]=_0x2f0abf['origtransferercalleridnum'];this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xaa')]][_0xc147('0xac')]=_0x2f0abf[_0xc147('0xa8')];if(this[_0xc147('0x15')][_0x2f0abf['secondtransfereruniqueid']]){_0x42fb0a=this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xad')]];this[_0xc147('0x15')][_0x2f0abf['secondtransfereruniqueid']]=this[_0xc147('0x15')][_0x2f0abf['transfereeuniqueid']];this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xaa')]]=_0x42fb0a;}}else if(this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xae')]]){this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xae')]][_0xc147('0xab')]=_0x2f0abf[_0xc147('0xaf')];this['channels'][_0x2f0abf[_0xc147('0xae')]]['transferconnectedlinenum']=_0x2f0abf['transfertargetcalleridnum'];if(this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb0')]]){_0x42fb0a=this[_0xc147('0x15')][_0x2f0abf['origtransfereruniqueid']];this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb0')]]=this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xae')]];this['channels'][_0x2f0abf[_0xc147('0xae')]]=_0x42fb0a;}}if((this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb0')]]||this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb1')]])&&this['channels'][_0x2f0abf[_0xc147('0xad')]]){var _0x3dd62d=_[_0xc147('0xb2')]([this[_0xc147('0x15')][_0x2f0abf['origtransfereruniqueid']],this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb1')]],this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xad')]]],function(_0x307ddb){return _0x307ddb&&_0x307ddb[_0xc147('0x7a')]===_0xc147('0xb3')&&_0x307ddb[_0xc147('0xb4')];});if(_0x3dd62d){if(this['channels'][_0x2f0abf[_0xc147('0xb0')]])this['channels'][_0x2f0abf[_0xc147('0xb0')]]['transferType']='ATTENDED';if(this[_0xc147('0x15')][_0x2f0abf['origtransfererlinkedid']])this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xb1')]]['transferType']=_0xc147('0xb5');this[_0xc147('0x15')][_0x2f0abf[_0xc147('0xad')]][_0xc147('0x98')]=_0xc147('0xb5');}}}}catch(_0x5aa2b6){logger[_0xc147('0x27')](_0xc147('0xb6'),_0x2f0abf[_0xc147('0x2e')],util[_0xc147('0x32')](_0x5aa2b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0xb7')]=function(_0x4a5efb){try{if(this[_0xc147('0x2a')](_0x4a5efb)){logger[_0xc147('0x25')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4a5efb[_0xc147('0x2e')],_0x4a5efb[_0xc147('0xb8')],_0x4a5efb['extension']);logger['debug']('[%s][voiceCallReport][blindtransfer]\x20event:',_0x4a5efb[_0xc147('0x2e')],util[_0xc147('0x32')](_0x4a5efb,{'showHidden':![],'depth':null}));if(this['channels'][_0x4a5efb[_0xc147('0xaa')]]){this[_0xc147('0x15')][_0x4a5efb[_0xc147('0xaa')]][_0xc147('0xab')]=_0x4a5efb['transfereecalleridnum'];this[_0xc147('0x15')][_0x4a5efb[_0xc147('0xaa')]]['transferconnectedlinenum']=_0x4a5efb['extension'];this[_0xc147('0x15')][_0x4a5efb[_0xc147('0xaa')]][_0xc147('0x98')]=_0xc147('0xb9');this[_0xc147('0x8e')]({'event':_0xc147('0xa3'),'uniqueid':_0x4a5efb[_0xc147('0xaa')],'context':_0x4a5efb[_0xc147('0x46')],'channel':_0x4a5efb[_0xc147('0xba')]});}else{this[_0xc147('0x15')][_0x4a5efb[_0xc147('0xbb')]][_0xc147('0x98')]=_0xc147('0xb9');}}}catch(_0x2a20ff){logger['error'](_0xc147('0xbc'),_0x4a5efb[_0xc147('0x2e')],util[_0xc147('0x32')](_0x2a20ff,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0xbd')]=function(_0xfd910c){try{if(this[_0xc147('0x2a')](_0xfd910c)){logger[_0xc147('0x42')](_0xc147('0xbe'),_0xfd910c[_0xc147('0x2e')],util['inspect'](_0xfd910c,{'showHidden':![],'depth':null}));if(this[_0xc147('0x15')][_0xfd910c[_0xc147('0x2e')]]){if(!_[_0xc147('0x6f')](this[_0xc147('0x15')][_0xfd910c[_0xc147('0x2e')]][_0xc147('0x60')])){this[_0xc147('0x15')][_0xfd910c[_0xc147('0x2e')]][_0xc147('0xbf')]=moment()[_0xc147('0x3b')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xc147('0x25')](_0xc147('0xc0'),_0xfd910c[_0xc147('0x2e')],this[_0xc147('0x15')][_0xfd910c[_0xc147('0x2e')]]['mohstarttime']);}}}}catch(_0x13736f){logger[_0xc147('0x27')](_0xc147('0xc1'),_0xfd910c['uniqueid'],util[_0xc147('0x32')](_0x13736f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc147('0x29')][_0xc147('0xc2')]=function(_0x2146d7){try{if(this['isNotNull'](_0x2146d7)){logger[_0xc147('0x42')](_0xc147('0xc3'),_0x2146d7[_0xc147('0x2e')],util[_0xc147('0x32')](_0x2146d7,{'showHidden':![],'depth':null}));if(this[_0xc147('0x15')][_0x2146d7[_0xc147('0x2e')]]){if(!_[_0xc147('0x6f')](this['channels'][_0x2146d7['uniqueid']][_0xc147('0xbf')])){this[_0xc147('0x15')][_0x2146d7[_0xc147('0x2e')]]['mohtime']+=moment()[_0xc147('0xc4')](0x0)[_0xc147('0x62')](this[_0xc147('0x15')][_0x2146d7[_0xc147('0x2e')]][_0xc147('0xbf')],_0xc147('0x58'));logger[_0xc147('0x25')](_0xc147('0xc5'),_0x2146d7[_0xc147('0x2e')],this['channels'][_0x2146d7[_0xc147('0x2e')]][_0xc147('0xc6')]);delete this[_0xc147('0x15')][_0x2146d7[_0xc147('0x2e')]][_0xc147('0xbf')];}}}}catch(_0x4d8423){logger[_0xc147('0x27')](_0xc147('0xc7'),_0x2146d7[_0xc147('0x2e')],util[_0xc147('0x32')](_0x4d8423,{'showHidden':![],'depth':null}));}};module[_0xc147('0xc8')]=VoiceCallReport;
\ No newline at end of file
index 7b715c0..9e31b15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60c0=['sumBillable','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\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','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','isUndefined','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','util','../../../config/environment','../../../config/logger','redis','defaults','localhost','channels','outboundChannels','outbound','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','syncNewExten','syncHangup','prototype','emit','isNotNull','debug','uniqueid','inspect','merge','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','cause-txt','endtime','diff','seconds','complete','total','answered','holdtime','starttime','billableseconds','sumHoldTime'];(function(_0x3848c5,_0x58a921){var _0x25d048=function(_0x303465){while(--_0x303465){_0x3848c5['push'](_0x3848c5['shift']());}};_0x25d048(++_0x58a921);}(_0x60c0,0x1e7));var _0x060c=function(_0x514197,_0x2c20af){_0x514197=_0x514197-0x0;var _0x46da97=_0x60c0[_0x514197];return _0x46da97;};'use strict';var _=require(_0x060c('0x0'));var moment=require('moment');var util=require(_0x060c('0x1'));var Redis=require('ioredis');var config=require(_0x060c('0x2'));var logger=require(_0x060c('0x3'))('ami');var ami=require('../ami');config[_0x060c('0x4')]=_[_0x060c('0x5')](config[_0x060c('0x4')],{'host':_0x060c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x060c('0x4')]));function VoiceDialReport(_0x6c61ad){this[_0x060c('0x7')]=_0x6c61ad[_0x060c('0x8')];this['outbound']=_0x6c61ad[_0x060c('0x9')];this['applications']={};this['variables']={};ami['on'](_0x060c('0xa'),this[_0x060c('0xb')]['bind'](this));ami['on'](_0x060c('0xc'),this[_0x060c('0xd')][_0x060c('0xe')](this));ami['on'](_0x060c('0xf'),this[_0x060c('0x10')]['bind'](this));ami['on']('newexten',this[_0x060c('0x11')][_0x060c('0xe')](this));ami['on']('hangup',this[_0x060c('0x12')][_0x060c('0xe')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x279163){return _0x279163!==null&&!_['isUndefined'](_0x279163);};VoiceDialReport[_0x060c('0x13')][_0x060c('0x14')]=function(_0x202c3a,_0x47dfb5,_0x39509a){io['to'](_0x202c3a)[_0x060c('0x14')](_0x47dfb5,_0x39509a);};VoiceDialReport[_0x060c('0x13')][_0x060c('0xb')]=function(_0x515b53){try{if(this[_0x060c('0x15')](_0x515b53)){logger[_0x060c('0x16')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x515b53[_0x060c('0x17')],util[_0x060c('0x18')](_0x515b53,{'showHidden':![],'depth':null}));if(this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]]){_[_0x060c('0x19')](this[_0x060c('0x7')][_0x515b53['uniqueid']],{'starttime':moment()['format'](_0x060c('0x1a')),'lastevent':_0x060c('0x1b'),'interface':_0x515b53['channel'][_0x060c('0x1c')](0x0,_0x515b53[_0x060c('0x1d')][_0x060c('0x1e')]('-')),'membername':_0x515b53[_0x060c('0x1d')][_0x060c('0x1c')](_0x515b53[_0x060c('0x1d')][_0x060c('0x1e')]('/')+0x1,_0x515b53[_0x060c('0x1d')][_0x060c('0x1e')]('-'))},_[_0x060c('0x1f')](_0x515b53,[_0x060c('0x20'),_0x060c('0x21')]));logger[_0x060c('0x22')](_0x060c('0x23'),_0x515b53['uniqueid'],this['channels'][_0x515b53['uniqueid']][_0x060c('0x24')],this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]][_0x060c('0x25')]);logger[_0x060c('0x16')](_0x060c('0x26'),_0x515b53[_0x060c('0x17')],util[_0x060c('0x18')](this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]],{'showHidden':![],'depth':null}));if(this[_0x060c('0x27')][_0x515b53[_0x060c('0x17')]])_[_0x060c('0x19')](this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]],this[_0x060c('0x27')][_0x515b53[_0x060c('0x17')]]);this[_0x060c('0x14')](_0x060c('0x28'),'voice_outbound_channel:save',this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]]);logger['debug'](_0x060c('0x29'),_0x515b53[_0x060c('0x17')],util[_0x060c('0x18')](this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]],{'showHidden':![],'depth':null}));ami[_0x060c('0x14')](_0x060c('0x2a'),this[_0x060c('0x7')][_0x515b53[_0x060c('0x17')]]);}}}catch(_0x3ee6fc){logger['error'](_0x060c('0x2b'),_0x515b53[_0x060c('0x17')],util[_0x060c('0x18')](_0x3ee6fc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x060c('0x13')][_0x060c('0xd')]=function(_0x3cd716){try{if(this[_0x060c('0x15')](_0x3cd716)){logger[_0x060c('0x16')]('[%s][voiceDialReport][dialend]\x20event:',_0x3cd716[_0x060c('0x17')],util['inspect'](_0x3cd716,{'showHidden':![],'depth':null}));if(this[_0x060c('0x7')][_0x3cd716[_0x060c('0x17')]]){this[_0x060c('0x7')][_0x3cd716['uniqueid']][_0x060c('0x2c')]=_0x3cd716[_0x060c('0x2c')];if(_0x3cd716['dialstatus']==='ANSWER'){this['channels'][_0x3cd716[_0x060c('0x17')]][_0x060c('0x2d')]=_0x3cd716[_0x060c('0x2d')];this['channels'][_0x3cd716[_0x060c('0x17')]]['connectedlinename']=_0x3cd716['connectedlinename'];this[_0x060c('0x7')][_0x3cd716[_0x060c('0x17')]][_0x060c('0x2e')]=moment()[_0x060c('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x060c('0x7')][_0x3cd716[_0x060c('0x17')]][_0x060c('0x30')]=_0x060c('0x31');logger[_0x060c('0x22')](_0x060c('0x32'),_0x3cd716['uniqueid'],_0x3cd716[_0x060c('0x1d')][_0x060c('0x1c')](_0x3cd716['channel'][_0x060c('0x1e')]('/')+0x1,_0x3cd716[_0x060c('0x1d')][_0x060c('0x1e')]('-')));logger[_0x060c('0x16')](_0x060c('0x33'),_0x3cd716[_0x060c('0x17')],util[_0x060c('0x18')](this['channels'][_0x3cd716['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x060c('0x14')](_0x060c('0x34'),this['channels'][_0x3cd716['uniqueid']]);}logger[_0x060c('0x16')](_0x060c('0x35'),_0x3cd716[_0x060c('0x17')],util[_0x060c('0x18')](this[_0x060c('0x7')][_0x3cd716[_0x060c('0x17')]],{'showHidden':![],'depth':null}));this[_0x060c('0x14')](_0x060c('0x28'),_0x060c('0x36'),this[_0x060c('0x7')][_0x3cd716[_0x060c('0x17')]]);}}}catch(_0x44083d){logger[_0x060c('0x37')](_0x060c('0x38'),_0x3cd716['uniqueid'],util['inspect'](_0x44083d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x060c('0x10')]=function(_0x49d177){try{if(this[_0x060c('0x15')](_0x49d177)){logger[_0x060c('0x16')](_0x060c('0x39'),_0x49d177[_0x060c('0x17')],util[_0x060c('0x18')](_0x49d177,{'showHidden':![],'depth':null}));this[_0x060c('0x3a')](_0x49d177[_0x060c('0x17')],_[_0x060c('0x3b')](_0x49d177[_0x060c('0x3c')])[0x0],_0x49d177['value']);if(this[_0x060c('0x15')](_0x49d177[_0x060c('0x3c')])&&this[_0x060c('0x15')](_0x49d177[_0x060c('0x3c')]['outboundrouteid'])){if(_['isUndefined'](this[_0x060c('0x7')][_0x49d177['uniqueid']])){this[_0x060c('0x7')][_0x49d177[_0x060c('0x17')]]={'routeId':_0x49d177[_0x060c('0x3d')],'variables':this[_0x060c('0x3e')][_0x49d177[_0x060c('0x17')]],'motionChannel':_0x060c('0x3f')};logger[_0x060c('0x22')](_0x060c('0x40'),_0x49d177[_0x060c('0x17')],_0x49d177['variable'][_0x060c('0x41')],_[_0x060c('0x3b')](_0x49d177[_0x060c('0x3c')])[0x0],_0x49d177['value']);logger[_0x060c('0x16')](_0x060c('0x42'),_0x49d177['uniqueid'],util[_0x060c('0x18')](this['channels'][_0x49d177['uniqueid']],{'showHidden':![],'depth':null}));this[_0x060c('0x14')](_0x060c('0x28'),'voice_outbound_channel:save',this[_0x060c('0x7')][_0x49d177[_0x060c('0x17')]]);}}}}catch(_0x746690){logger[_0x060c('0x37')](_0x060c('0x43'),_0x49d177['uniqueid'],util[_0x060c('0x18')](_0x746690,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x060c('0x13')][_0x060c('0x3a')]=function(_0x142c1f,_0x3c13d8,_0x130081){var _0x33ebd7=[_0x060c('0x44'),_0x060c('0x45'),_0x060c('0x46'),'rtpaudioqosjitterbridged',_0x060c('0x47'),_0x060c('0x48'),_0x060c('0x49'),_0x060c('0x4a'),_0x060c('0x4b'),'sipuri','bridgepeer','bridgepvtcallid',_0x060c('0x4c'),'memberdynamic',_0x060c('0x4d'),_0x060c('0x4e'),'membername',_0x060c('0x4f'),_0x060c('0x50')];if(!_[_0x060c('0x51')](_0x3c13d8)&&!_['includes'](_0x33ebd7,_0x3c13d8)){if(_['isUndefined'](this[_0x060c('0x3e')][_0x142c1f])){this['variables'][_0x142c1f]={};}this[_0x060c('0x3e')][_0x142c1f][_0x3c13d8]=_0x130081;}};VoiceDialReport['prototype'][_0x060c('0x12')]=function(_0x44beaa){try{if(this[_0x060c('0x15')](_0x44beaa)){logger[_0x060c('0x16')]('[%s][voiceDialReport][hangup]\x20event:',_0x44beaa[_0x060c('0x17')],util[_0x060c('0x18')](_0x44beaa,{'showHidden':![],'depth':null}));if(this[_0x060c('0x7')][_0x44beaa['uniqueid']]){logger[_0x060c('0x22')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x44beaa[_0x060c('0x17')],_0x44beaa[_0x060c('0x52')]);this['channels'][_0x44beaa[_0x060c('0x17')]][_0x060c('0x53')]=moment()['format'](_0x060c('0x1a'));this['channels'][_0x44beaa[_0x060c('0x17')]]['duration']=moment(this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x53')])[_0x060c('0x54')](this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]]['starttime'],_0x060c('0x55'));this[_0x060c('0x7')][_0x44beaa['uniqueid']][_0x060c('0x30')]=_0x060c('0x56');this['outbound'][_0x060c('0x57')]+=0x1;if(this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x2e')]){this['outbound'][_0x060c('0x58')]+=0x1;this['channels'][_0x44beaa[_0x060c('0x17')]][_0x060c('0x59')]=moment(this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x2e')])['diff'](this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x5a')],_0x060c('0x55'));this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x5b')]=moment(this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x53')])['diff'](this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x2e')],_0x060c('0x55'));this['outbound'][_0x060c('0x5c')]+=this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x59')]||0x0;this[_0x060c('0x9')][_0x060c('0x5d')]+=this['channels'][_0x44beaa[_0x060c('0x17')]][_0x060c('0x5b')];}this[_0x060c('0x9')][_0x060c('0x5e')]+=this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]][_0x060c('0x5f')];logger[_0x060c('0x16')](_0x060c('0x60'),_0x44beaa['uniqueid'],util[_0x060c('0x18')](this['channels'][_0x44beaa[_0x060c('0x17')]],{'showHidden':![],'depth':null}));ami[_0x060c('0x14')]('custom:voiceDialReport',this[_0x060c('0x7')][_0x44beaa['uniqueid']]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x44beaa['uniqueid'],util[_0x060c('0x18')](this[_0x060c('0x7')][_0x44beaa['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x060c('0x61'),this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]]);logger['debug'](_0x060c('0x62'),_0x44beaa[_0x060c('0x17')],util['inspect'](this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]],{'showHidden':![],'depth':null}));this[_0x060c('0x14')](_0x060c('0x28'),_0x060c('0x63'),this['outbound']);logger[_0x060c('0x22')](_0x060c('0x64'),JSON[_0x060c('0x65')](this['channels'][_0x44beaa[_0x060c('0x17')]]));logger[_0x060c('0x16')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x44beaa[_0x060c('0x17')],util[_0x060c('0x18')](this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]],{'showHidden':![],'depth':null}));this[_0x060c('0x14')]('voice:outbound',_0x060c('0x66'),this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]]);delete this[_0x060c('0x7')][_0x44beaa[_0x060c('0x17')]];}else if(this[_0x060c('0x7')][_0x44beaa['linkedid']]){this[_0x060c('0x7')][_0x44beaa[_0x060c('0x67')]][_0x060c('0x17')]=this[_0x060c('0x7')][_0x44beaa[_0x060c('0x67')]][_0x060c('0x68')];}if(this[_0x060c('0x3e')][_0x44beaa[_0x060c('0x17')]]){delete this['variables'][_0x44beaa['uniqueid']];}}}catch(_0x1c1fac){logger[_0x060c('0x37')](_0x060c('0x69'),_0x44beaa[_0x060c('0x17')],util[_0x060c('0x18')](_0x1c1fac,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x060c('0x13')][_0x060c('0x11')]=function(_0x24dc68){try{if(this[_0x060c('0x15')](_0x24dc68)){logger[_0x060c('0x16')](_0x060c('0x6a'),_0x24dc68[_0x060c('0x17')],util['inspect'](_0x24dc68,{'showHidden':![],'depth':null}));if(_0x24dc68[_0x060c('0x6b')][_0x060c('0x6c')]()===_0x060c('0x6d')){_0x24dc68['applicationdata']=(_0x24dc68['appdata']||_0x24dc68[_0x060c('0x6e')])[_0x060c('0x6c')]();if(_['startsWith'](_0x24dc68[_0x060c('0x6e')],'cdr(')){if(_[_0x060c('0x6f')](this[_0x060c('0x27')][_0x24dc68[_0x060c('0x17')]]))this[_0x060c('0x27')][_0x24dc68[_0x060c('0x17')]]={};logger[_0x060c('0x22')](_0x060c('0x70'),_0x24dc68['uniqueid'],_0x24dc68[_0x060c('0x6b')],_0x24dc68[_0x060c('0x6e')]);var _0x478f83=_0x24dc68[_0x060c('0x6e')]['split']('=');var _0x4855c2=_0x478f83[0x0][_0x060c('0x71')](/cdr\((.*)\)/);if(_0x4855c2)this[_0x060c('0x27')][_0x24dc68[_0x060c('0x17')]][_0x4855c2[0x1]]=_0x478f83[0x1];}}}}catch(_0x17bc6b){logger['error'](_0x060c('0x72'),_0x24dc68[_0x060c('0x17')],util[_0x060c('0x18')](_0x17bc6b,{'showHidden':![],'depth':null}));}};module[_0x060c('0x73')]=VoiceDialReport;
\ No newline at end of file
+var _0x692d=['starttime','seconds','complete','outbound','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','redis','defaults','localhost','channels','outboundChannels','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','prototype','isUndefined','emit','isNotNull','debug','inspect','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','lastIndexOf','channel','info','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','diff'];(function(_0x3cd333,_0x9176b7){var _0x1d22ec=function(_0x178ddb){while(--_0x178ddb){_0x3cd333['push'](_0x3cd333['shift']());}};_0x1d22ec(++_0x9176b7);}(_0x692d,0x99));var _0xd692=function(_0x2326be,_0x26dd90){_0x2326be=_0x2326be-0x0;var _0x4e56a7=_0x692d[_0x2326be];return _0x4e56a7;};'use strict';var _=require(_0xd692('0x0'));var moment=require(_0xd692('0x1'));var util=require(_0xd692('0x2'));var Redis=require('ioredis');var config=require(_0xd692('0x3'));var logger=require(_0xd692('0x4'))('ami');var ami=require('../ami');config[_0xd692('0x5')]=_[_0xd692('0x6')](config[_0xd692('0x5')],{'host':_0xd692('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd692('0x5')]));function VoiceDialReport(_0x144185){this[_0xd692('0x8')]=_0x144185[_0xd692('0x9')];this['outbound']=_0x144185['outbound'];this['applications']={};this[_0xd692('0xa')]={};ami['on'](_0xd692('0xb'),this[_0xd692('0xc')][_0xd692('0xd')](this));ami['on'](_0xd692('0xe'),this[_0xd692('0xf')][_0xd692('0xd')](this));ami['on'](_0xd692('0x10'),this[_0xd692('0x11')][_0xd692('0xd')](this));ami['on'](_0xd692('0x12'),this[_0xd692('0x13')][_0xd692('0xd')](this));ami['on'](_0xd692('0x14'),this['syncHangup'][_0xd692('0xd')](this));}VoiceDialReport[_0xd692('0x15')]['isNotNull']=function(_0x8edbb){return _0x8edbb!==null&&!_[_0xd692('0x16')](_0x8edbb);};VoiceDialReport[_0xd692('0x15')][_0xd692('0x17')]=function(_0x2ca60e,_0x3bd073,_0x37b29f){io['to'](_0x2ca60e)[_0xd692('0x17')](_0x3bd073,_0x37b29f);};VoiceDialReport[_0xd692('0x15')][_0xd692('0xc')]=function(_0x3ced80){try{if(this[_0xd692('0x18')](_0x3ced80)){logger[_0xd692('0x19')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x3ced80['uniqueid'],util[_0xd692('0x1a')](_0x3ced80,{'showHidden':![],'depth':null}));if(this[_0xd692('0x8')][_0x3ced80['uniqueid']]){_[_0xd692('0x1b')](this['channels'][_0x3ced80[_0xd692('0x1c')]],{'starttime':moment()[_0xd692('0x1d')](_0xd692('0x1e')),'lastevent':_0xd692('0x1f'),'interface':_0x3ced80['channel'][_0xd692('0x20')](0x0,_0x3ced80['channel'][_0xd692('0x21')]('-')),'membername':_0x3ced80[_0xd692('0x22')][_0xd692('0x20')](_0x3ced80['channel'][_0xd692('0x21')]('/')+0x1,_0x3ced80['channel']['lastIndexOf']('-'))},_['omit'](_0x3ced80,['event','privilege']));logger[_0xd692('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x3ced80[_0xd692('0x1c')],this[_0xd692('0x8')][_0x3ced80[_0xd692('0x1c')]][_0xd692('0x24')],this[_0xd692('0x8')][_0x3ced80[_0xd692('0x1c')]]['interface']);logger['debug'](_0xd692('0x25'),_0x3ced80['uniqueid'],util[_0xd692('0x1a')](this['channels'][_0x3ced80['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0xd692('0x26')][_0x3ced80[_0xd692('0x1c')]])_[_0xd692('0x1b')](this['channels'][_0x3ced80['uniqueid']],this[_0xd692('0x26')][_0x3ced80['uniqueid']]);this[_0xd692('0x17')](_0xd692('0x27'),'voice_outbound_channel:save',this['channels'][_0x3ced80[_0xd692('0x1c')]]);logger[_0xd692('0x19')](_0xd692('0x28'),_0x3ced80['uniqueid'],util[_0xd692('0x1a')](this[_0xd692('0x8')][_0x3ced80[_0xd692('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xd692('0x29'),this[_0xd692('0x8')][_0x3ced80['uniqueid']]);}}}catch(_0x155405){logger[_0xd692('0x2a')](_0xd692('0x2b'),_0x3ced80[_0xd692('0x1c')],util['inspect'](_0x155405,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xd692('0xf')]=function(_0x4a97cf){try{if(this[_0xd692('0x18')](_0x4a97cf)){logger['debug'](_0xd692('0x2c'),_0x4a97cf[_0xd692('0x1c')],util[_0xd692('0x1a')](_0x4a97cf,{'showHidden':![],'depth':null}));if(this[_0xd692('0x8')][_0x4a97cf[_0xd692('0x1c')]]){this[_0xd692('0x8')][_0x4a97cf['uniqueid']][_0xd692('0x2d')]=_0x4a97cf[_0xd692('0x2d')];if(_0x4a97cf[_0xd692('0x2d')]===_0xd692('0x2e')){this[_0xd692('0x8')][_0x4a97cf[_0xd692('0x1c')]][_0xd692('0x2f')]=_0x4a97cf[_0xd692('0x2f')];this['channels'][_0x4a97cf['uniqueid']][_0xd692('0x30')]=_0x4a97cf[_0xd692('0x30')];this['channels'][_0x4a97cf[_0xd692('0x1c')]][_0xd692('0x31')]=moment()[_0xd692('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4a97cf['uniqueid']][_0xd692('0x32')]=_0xd692('0x33');logger[_0xd692('0x23')](_0xd692('0x34'),_0x4a97cf[_0xd692('0x1c')],_0x4a97cf[_0xd692('0x22')][_0xd692('0x20')](_0x4a97cf[_0xd692('0x22')][_0xd692('0x21')]('/')+0x1,_0x4a97cf[_0xd692('0x22')]['lastIndexOf']('-')));logger['debug'](_0xd692('0x35'),_0x4a97cf['uniqueid'],util[_0xd692('0x1a')](this[_0xd692('0x8')][_0x4a97cf['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xd692('0x17')](_0xd692('0x36'),this['channels'][_0x4a97cf[_0xd692('0x1c')]]);}logger[_0xd692('0x19')](_0xd692('0x37'),_0x4a97cf[_0xd692('0x1c')],util[_0xd692('0x1a')](this['channels'][_0x4a97cf['uniqueid']],{'showHidden':![],'depth':null}));this[_0xd692('0x17')](_0xd692('0x27'),_0xd692('0x38'),this[_0xd692('0x8')][_0x4a97cf[_0xd692('0x1c')]]);}}}catch(_0x1062d0){logger[_0xd692('0x2a')](_0xd692('0x39'),_0x4a97cf['uniqueid'],util['inspect'](_0x1062d0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd692('0x15')][_0xd692('0x11')]=function(_0x2407df){try{if(this[_0xd692('0x18')](_0x2407df)){logger[_0xd692('0x19')](_0xd692('0x3a'),_0x2407df[_0xd692('0x1c')],util['inspect'](_0x2407df,{'showHidden':![],'depth':null}));this[_0xd692('0x3b')](_0x2407df[_0xd692('0x1c')],_[_0xd692('0x3c')](_0x2407df[_0xd692('0x3d')])[0x0],_0x2407df[_0xd692('0x3e')]);if(this[_0xd692('0x18')](_0x2407df[_0xd692('0x3d')])&&this[_0xd692('0x18')](_0x2407df[_0xd692('0x3d')][_0xd692('0x3f')])){if(_[_0xd692('0x16')](this['channels'][_0x2407df[_0xd692('0x1c')]])){this['channels'][_0x2407df[_0xd692('0x1c')]]={'routeId':_0x2407df[_0xd692('0x3e')],'variables':this[_0xd692('0xa')][_0x2407df[_0xd692('0x1c')]],'motionChannel':_0xd692('0x40')};logger['info'](_0xd692('0x41'),_0x2407df[_0xd692('0x1c')],_0x2407df['variable'][_0xd692('0x3f')],_['keys'](_0x2407df[_0xd692('0x3d')])[0x0],_0x2407df['value']);logger['debug'](_0xd692('0x42'),_0x2407df[_0xd692('0x1c')],util['inspect'](this[_0xd692('0x8')][_0x2407df[_0xd692('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0xd692('0x27'),'voice_outbound_channel:save',this[_0xd692('0x8')][_0x2407df[_0xd692('0x1c')]]);}}}}catch(_0x2093f7){logger['error']('[%s][voiceDialReport][varset]',_0x2407df[_0xd692('0x1c')],util[_0xd692('0x1a')](_0x2093f7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd692('0x15')][_0xd692('0x3b')]=function(_0x68a50e,_0x272248,_0x291836){var _0x47f1bf=[_0xd692('0x43'),_0xd692('0x44'),_0xd692('0x45'),_0xd692('0x46'),_0xd692('0x47'),_0xd692('0x48'),_0xd692('0x49'),_0xd692('0x4a'),_0xd692('0x4b'),_0xd692('0x4c'),_0xd692('0x4d'),_0xd692('0x4e'),_0xd692('0x4f'),_0xd692('0x50'),_0xd692('0x51'),_0xd692('0x52'),'membername',_0xd692('0x53'),_0xd692('0x54')];if(!_['isNil'](_0x272248)&&!_[_0xd692('0x55')](_0x47f1bf,_0x272248)){if(_[_0xd692('0x16')](this[_0xd692('0xa')][_0x68a50e])){this[_0xd692('0xa')][_0x68a50e]={};}this['variables'][_0x68a50e][_0x272248]=_0x291836;}};VoiceDialReport['prototype'][_0xd692('0x56')]=function(_0x3990db){try{if(this['isNotNull'](_0x3990db)){logger[_0xd692('0x19')](_0xd692('0x57'),_0x3990db['uniqueid'],util['inspect'](_0x3990db,{'showHidden':![],'depth':null}));if(this['channels'][_0x3990db[_0xd692('0x1c')]]){logger[_0xd692('0x23')](_0xd692('0x58'),_0x3990db['uniqueid'],_0x3990db[_0xd692('0x59')]);this['channels'][_0x3990db[_0xd692('0x1c')]]['endtime']=moment()[_0xd692('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5a')]=moment(this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5b')])[_0xd692('0x5c')](this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5d')],_0xd692('0x5e'));this['channels'][_0x3990db[_0xd692('0x1c')]]['lastevent']=_0xd692('0x5f');this[_0xd692('0x60')]['total']+=0x1;if(this['channels'][_0x3990db[_0xd692('0x1c')]]['answertime']){this['outbound']['answered']+=0x1;this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]]['holdtime']=moment(this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x31')])[_0xd692('0x5c')](this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5d')],_0xd692('0x5e'));this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x61')]=moment(this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5b')])[_0xd692('0x5c')](this['channels'][_0x3990db['uniqueid']]['answertime'],_0xd692('0x5e'));this['outbound'][_0xd692('0x62')]+=this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x63')]||0x0;this[_0xd692('0x60')][_0xd692('0x64')]+=this[_0xd692('0x8')][_0x3990db['uniqueid']][_0xd692('0x61')];}this[_0xd692('0x60')][_0xd692('0x65')]+=this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]][_0xd692('0x5a')];logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x3990db[_0xd692('0x1c')],util['inspect'](this['channels'][_0x3990db[_0xd692('0x1c')]],{'showHidden':![],'depth':null}));ami[_0xd692('0x17')]('custom:voiceDialReport',this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]]);logger[_0xd692('0x19')](_0xd692('0x66'),_0x3990db['uniqueid'],util['inspect'](this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0xd692('0x67'),this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]]);logger[_0xd692('0x19')](_0xd692('0x68'),_0x3990db[_0xd692('0x1c')],util[_0xd692('0x1a')](this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0xd692('0x27'),_0xd692('0x69'),this['outbound']);logger[_0xd692('0x23')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xd692('0x6a')](this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]]));logger[_0xd692('0x19')](_0xd692('0x6b'),_0x3990db[_0xd692('0x1c')],util['inspect'](this[_0xd692('0x8')][_0x3990db['uniqueid']],{'showHidden':![],'depth':null}));this[_0xd692('0x17')](_0xd692('0x27'),_0xd692('0x6c'),this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]]);delete this[_0xd692('0x8')][_0x3990db[_0xd692('0x1c')]];}else if(this[_0xd692('0x8')][_0x3990db['linkedid']]){this[_0xd692('0x8')][_0x3990db[_0xd692('0x6d')]]['uniqueid']=this[_0xd692('0x8')][_0x3990db[_0xd692('0x6d')]][_0xd692('0x6e')];}if(this[_0xd692('0xa')][_0x3990db[_0xd692('0x1c')]]){delete this['variables'][_0x3990db[_0xd692('0x1c')]];}}}catch(_0x4dde5c){logger[_0xd692('0x2a')](_0xd692('0x6f'),_0x3990db[_0xd692('0x1c')],util['inspect'](_0x4dde5c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd692('0x15')][_0xd692('0x13')]=function(_0x177a80){try{if(this[_0xd692('0x18')](_0x177a80)){logger[_0xd692('0x19')](_0xd692('0x70'),_0x177a80[_0xd692('0x1c')],util['inspect'](_0x177a80,{'showHidden':![],'depth':null}));if(_0x177a80[_0xd692('0x71')]['toLowerCase']()===_0xd692('0x72')){_0x177a80[_0xd692('0x73')]=(_0x177a80[_0xd692('0x74')]||_0x177a80[_0xd692('0x73')])[_0xd692('0x75')]();if(_[_0xd692('0x76')](_0x177a80[_0xd692('0x73')],'cdr(')){if(_['isUndefined'](this[_0xd692('0x26')][_0x177a80['uniqueid']]))this[_0xd692('0x26')][_0x177a80[_0xd692('0x1c')]]={};logger[_0xd692('0x23')](_0xd692('0x77'),_0x177a80[_0xd692('0x1c')],_0x177a80[_0xd692('0x71')],_0x177a80[_0xd692('0x73')]);var _0x47e97a=_0x177a80['applicationdata'][_0xd692('0x78')]('=');var _0x462555=_0x47e97a[0x0]['match'](/cdr\((.*)\)/);if(_0x462555)this[_0xd692('0x26')][_0x177a80[_0xd692('0x1c')]][_0x462555[0x1]]=_0x47e97a[0x1];}}}}catch(_0x1cb4f6){logger['error'](_0xd692('0x79'),_0x177a80[_0xd692('0x1c')],util[_0xd692('0x1a')](_0x1cb4f6,{'showHidden':![],'depth':null}));}};module[_0xd692('0x7a')]=VoiceDialReport;
\ No newline at end of file
index e70dd12..dc9fa51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x028d=['[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','CDR(routeAlias)','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','format','name','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','total','unmanaged','Trunk','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','value','variable','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','variables','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','abandoned','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][blindtransfer]'];(function(_0x3307ea,_0x3d4d43){var _0x33a898=function(_0x2e6663){while(--_0x2e6663){_0x3307ea['push'](_0x3307ea['shift']());}};_0x33a898(++_0x3d4d43);}(_0x028d,0xff));var _0xd028=function(_0x548272,_0x115575){_0x548272=_0x548272-0x0;var _0x3e4f0e=_0x028d[_0x548272];return _0x3e4f0e;};'use strict';var _=require('lodash');var moment=require(_0xd028('0x0'));var util=require(_0xd028('0x1'));var md5=require('md5');var Redis=require(_0xd028('0x2'));var config=require(_0xd028('0x3'));var logger=require(_0xd028('0x4'))(_0xd028('0x5'));var ami=require(_0xd028('0x6'));var QueueReport=require(_0xd028('0x7'));config['redis']=_[_0xd028('0x8')](config[_0xd028('0x9')],{'host':_0xd028('0xa'),'port':0x18eb});var io=require(_0xd028('0xb'))(new Redis(config[_0xd028('0x9')]));var Sequence=function(){};Sequence[_0xd028('0xc')][_0xd028('0xd')]=function(_0x487e07){this[_0xd028('0xe')]=this[_0xd028('0xe')]?this[_0xd028('0xe')][_0xd028('0xf')](_0x487e07):_0x487e07();};function VoiceQueueReport(_0x4355bf){this[_0xd028('0x10')]=new Sequence();this['queueReports']={};this[_0xd028('0x11')]=_0x4355bf[_0xd028('0x11')];this[_0xd028('0x12')]=_0x4355bf[_0xd028('0x13')];this[_0xd028('0x14')]=_0x4355bf[_0xd028('0x14')];this['flagQueueSummary']=!![];this[_0xd028('0x15')]=_0x4355bf[_0xd028('0x15')];this['variables']={};ami['on'](_0xd028('0x16'),this[_0xd028('0x17')][_0xd028('0x18')](this));ami['on'](_0xd028('0x19'),this[_0xd028('0x1a')][_0xd028('0x18')](this));ami['on'](_0xd028('0x1b'),this[_0xd028('0x1c')][_0xd028('0x18')](this));ami['on'](_0xd028('0x1d'),this[_0xd028('0x1e')][_0xd028('0x18')](this));ami['on']('queuecallerleave',this[_0xd028('0x1f')]['bind'](this));ami['on'](_0xd028('0x20'),this[_0xd028('0x21')][_0xd028('0x18')](this));ami['on']('agentconnect',this[_0xd028('0x22')]['bind'](this));ami['on'](_0xd028('0x23'),this['syncVarSet'][_0xd028('0x18')](this));ami['on'](_0xd028('0x24'),this[_0xd028('0x25')]['bind'](this));ami['on'](_0xd028('0x26'),this[_0xd028('0x27')][_0xd028('0x18')](this));ami['on'](_0xd028('0x28'),this[_0xd028('0x29')]['bind'](this));ami['on'](_0xd028('0x2a'),this[_0xd028('0x2b')][_0xd028('0x18')](this));ami['on'](_0xd028('0x2c'),this[_0xd028('0x2d')][_0xd028('0x18')](this));ami['on'](_0xd028('0x2e'),this['syncAttendedTransfer'][_0xd028('0x18')](this));ami['on'](_0xd028('0x2f'),this[_0xd028('0x30')][_0xd028('0x18')](this));this['loopQueueSummary']();this[_0xd028('0x31')]();}function clearChannels(_0x1de0cc){if(!_[_0xd028('0x32')](_0x1de0cc)){for(var _0x3249ea in _0x1de0cc){if(_0x1de0cc[_0xd028('0x33')](_0x3249ea)){delete _0x1de0cc[_0x3249ea];}}}}function clearCampaigns(_0x422107){if(!_[_0xd028('0x32')](_0x422107)){for(var _0x115004 in _0x422107){if(_0x422107[_0xd028('0x33')](_0x115004)){_0x422107[_0x115004][_0xd028('0x34')]=0x0;}}}}function clearVoiceQueues(_0x38a294){if(!_[_0xd028('0x32')](_0x38a294)){for(var _0x20d7ff in _0x38a294){if(_0x38a294[_0xd028('0x33')](_0x20d7ff)){_0x38a294[_0x20d7ff][_0xd028('0x34')]=0x0;_0x38a294[_0x20d7ff][_0xd028('0x35')]=0x0;_0x38a294[_0x20d7ff][_0xd028('0x36')]=0x0;_0x38a294[_0x20d7ff][_0xd028('0x37')]=0x0;_0x38a294[_0x20d7ff][_0xd028('0x38')]=!![];}}}}function clearAgentBooked(_0x23d9dd){if(!_[_0xd028('0x32')](_0x23d9dd)){for(var _0x5d6f95 in _0x23d9dd){if(_0x23d9dd['hasOwnProperty'](_0x5d6f95)){_0x23d9dd[_0x5d6f95][_0xd028('0x39')]=!![];}}}}VoiceQueueReport[_0xd028('0xc')][_0xd028('0x3a')]=function(){var _0x26c44c=this;for(var _0x53d887 in this[_0xd028('0x12')]){if(this['channels']['hasOwnProperty'](_0x53d887)&&!this[_0xd028('0x12')][_0x53d887][_0xd028('0x3b')]){this[_0xd028('0x10')][_0xd028('0xd')](function(){if(!_[_0xd028('0x3c')](_0x26c44c[_0xd028('0x12')][_0x53d887])){return ami[_0xd028('0x3d')]({'action':'status','channel':_0x26c44c['channels'][_0x53d887][_0xd028('0x3e')]})[_0xd028('0x3f')](function(_0x47a0ff){if(_0x47a0ff['message']===_0xd028('0x40')){setTimeout(function(){if(_0x26c44c[_0xd028('0x12')][_0x53d887]){delete _0x26c44c[_0xd028('0x12')][_0x53d887];logger[_0xd028('0x41')](_0xd028('0x42'),_0x53d887,util[_0xd028('0x43')](_0x47a0ff,{'showHidden':![],'depth':null}));}if(_0x26c44c[_0xd028('0x44')][_0x53d887]){delete _0x26c44c[_0xd028('0x44')][_0x53d887];logger[_0xd028('0x41')](_0xd028('0x45'),_0x53d887,util[_0xd028('0x43')](_0x47a0ff,{'showHidden':![],'depth':null}));}if(_0x26c44c['variables'][_0x53d887]){delete _0x26c44c['variables'][_0x53d887];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x53d887,util['inspect'](_0x47a0ff,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xd028('0xc')]['syncFullyBooted']=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xd028('0x12')]);this['clearQueueReport'](this[_0xd028('0x44')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xd028('0x15')]);};VoiceQueueReport[_0xd028('0xc')]['clearQueueReport']=function(_0x423c6a){var _0x4c705c=this;if(!_['isEmpty'](_0x423c6a)){for(var _0x5cfcab in _0x423c6a){if(_0x423c6a['hasOwnProperty'](_0x5cfcab)){_0x4c705c['emitVoiceQueueChannelRemove'](_0x423c6a[_0x5cfcab],_0xd028('0x46'));delete _0x423c6a[_0x5cfcab];}}}};VoiceQueueReport[_0xd028('0xc')]['emit']=function(_0x1d1285,_0x12aa58,_0x229b98){io['to'](_0x1d1285)[_0xd028('0x47')](_0x12aa58,_0x229b98);};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x48')]=function(_0x4dd213,_0x233979){logger[_0xd028('0x49')](_0xd028('0x4a')+_0x233979+']\x20sending\x20voice_queue_channel:save\x20event:',_0x4dd213[_0xd028('0x4b')],util[_0xd028('0x43')](_0x4dd213,{'showHidden':![],'depth':null}));this[_0xd028('0x47')](util['format'](_0xd028('0x4c'),_0x4dd213['name']),_0xd028('0x4d'),_0x4dd213);io[_0xd028('0x47')](_0xd028('0x4e'),_0x4dd213);};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x4f')]=function(_0x3f86ed,_0x1de847){logger[_0xd028('0x49')](_0xd028('0x4a')+_0x1de847+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x3f86ed[_0xd028('0x4b')],util[_0xd028('0x43')](_0x3f86ed,{'showHidden':![],'depth':null}));this[_0xd028('0x47')](util[_0xd028('0x50')]('voice:queue:%s',_0x3f86ed[_0xd028('0x51')]),_0xd028('0x52'),_0x3f86ed);io[_0xd028('0x47')]('voice_queue_presence:remove',_0x3f86ed);};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x53')]=function(_0x580bb1,_0x22aa1e){if(_0x580bb1[_0xd028('0x54')]===_0xd028('0x55')){var _0x5ab0f0={'id':_0x580bb1['id'],'name':_0x580bb1[_0xd028('0x51')],'strategy':_0x580bb1[_0xd028('0x56')],'answered':_0x580bb1[_0xd028('0x57')],'available':_0x580bb1[_0xd028('0x58')],'loggedIn':_0x580bb1[_0xd028('0x59')],'pTalking':_0x580bb1[_0xd028('0x36')],'sumBillable':_0x580bb1['sumBillable'],'sumDuration':_0x580bb1[_0xd028('0x5a')],'sumHoldTime':_0x580bb1[_0xd028('0x5b')]||0x0,'talking':_0x580bb1[_0xd028('0x35')],'total':_0x580bb1[_0xd028('0x5c')],'type':_0x580bb1[_0xd028('0x54')],'unmanaged':_0x580bb1[_0xd028('0x5d')],'abandoned':_0x580bb1['abandoned'],'waiting':_0x580bb1[_0xd028('0x37')]};if(_0x580bb1[_0xd028('0x5e')]){_0x5ab0f0[_0xd028('0x5e')]={'id':_0x580bb1[_0xd028('0x5e')]['id'],'name':_0x580bb1[_0xd028('0x5e')]['name'],'active':_0x580bb1['Trunk']['active'],'callerid':_0x580bb1['Trunk'][_0xd028('0x5f')]};}if(_0x580bb1[_0xd028('0x60')]){_0x5ab0f0[_0xd028('0x60')]={'id':_0x580bb1[_0xd028('0x60')]['id'],'name':_0x580bb1[_0xd028('0x60')][_0xd028('0x51')]};}var _0x267fd5=md5(JSON[_0xd028('0x61')](_0x5ab0f0));if(_0x580bb1[_0xd028('0x62')]!==_0x267fd5){_0x580bb1['md5']=_0x267fd5;logger[_0xd028('0x49')](_0xd028('0x63')+_0x22aa1e+_0xd028('0x64'),util[_0xd028('0x43')](_0x5ab0f0,{'showHidden':![],'depth':null}));this[_0xd028('0x47')](util[_0xd028('0x50')]('voice:queue:%s',_0x5ab0f0['name']),_0xd028('0x65'),_0x5ab0f0);}}};VoiceQueueReport[_0xd028('0xc')]['isNotNull']=function(_0x183970){return _0x183970!==null&&!_[_0xd028('0x66')](_0x183970);};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x31')]=function(){var _0x29d5d2=this;setInterval(function(){_0x29d5d2[_0xd028('0x3a')]();ami[_0xd028('0x3d')]({'action':_0xd028('0x67')})[_0xd028('0x3f')](function(_0x58f1f1){logger['error'](_0xd028('0x68'),util[_0xd028('0x43')](_0x58f1f1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0xd1c2e=this;setInterval(function(){if(_0xd1c2e[_0xd028('0x69')]){return ami[_0xd028('0x3d')]({'action':'queuesummary'})[_0xd028('0x6a')](function(_0x48dca1){_0xd1c2e['flagQueueSummary']=![];})['catch'](function(_0x3b9a60){logger[_0xd028('0x41')](_0xd028('0x6b'),util[_0xd028('0x43')](_0x3b9a60,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x17')]=function(_0x3c35b9){try{if(this['isNotNull'](_0x3c35b9)&&this[_0xd028('0x6c')](_0x3c35b9[_0xd028('0x6d')])){logger[_0xd028('0x49')](_0xd028('0x6e'),util[_0xd028('0x43')](_0x3c35b9,{'showHidden':![],'depth':null}));if(this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]){logger[_0xd028('0x6f')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3c35b9[_0xd028('0x6d')]);var _0x5a3af4=_[_0xd028('0x70')](this[_0xd028('0x12')],_0xd028('0x6d'))[_0x3c35b9[_0xd028('0x6d')]]||0x0;var _0xc10e82=_0x5a3af4-_0x3c35b9[_0xd028('0x71')];if(this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]][_0xd028('0x37')]!==_[_0xd028('0x72')](_0x3c35b9[_0xd028('0x71')])||this['voiceQueues'][_0x3c35b9['queue']]['loggedIn']!==_[_0xd028('0x72')](_0x3c35b9['loggedin'])||this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]][_0xd028('0x58')]!==_[_0xd028('0x72')](_0x3c35b9['available'])||this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]['talking']!==_0xc10e82){this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]['waiting']=_[_0xd028('0x72')](_0x3c35b9[_0xd028('0x71')]);this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]['loggedIn']=_['toNumber'](_0x3c35b9[_0xd028('0x73')]);this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]][_0xd028('0x58')]=_[_0xd028('0x72')](_0x3c35b9[_0xd028('0x58')]);this[_0xd028('0x14')][_0x3c35b9['queue']][_0xd028('0x35')]=_0xc10e82>0x0?_0xc10e82:0x0;this['voiceQueues'][_0x3c35b9[_0xd028('0x6d')]]['talking']=this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]]['talking']>_[_0xd028('0x72')](_0x3c35b9['loggedin'])?_[_0xd028('0x72')](_0x3c35b9[_0xd028('0x73')]):this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]][_0xd028('0x35')];this[_0xd028('0x53')](this[_0xd028('0x14')][_0x3c35b9[_0xd028('0x6d')]],_0xd028('0x16'));}logger['debug'](_0xd028('0x74'),util['inspect'](this['voiceQueues'][_0x3c35b9[_0xd028('0x6d')]],{'showHidden':![],'depth':null}));ami[_0xd028('0x47')]('custom:queuesummary',this[_0xd028('0x14')][_0x3c35b9['queue']]);}}}catch(_0x24bb58){logger[_0xd028('0x41')](_0xd028('0x6b'),util['inspect'](_0x24bb58,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x1a')]=function(_0x4ac66b){logger[_0xd028('0x49')](_0xd028('0x75'),util[_0xd028('0x43')](_0x4ac66b,{'showHidden':![],'depth':null}));this[_0xd028('0x69')]=!![];};VoiceQueueReport[_0xd028('0xc')]['syncQueueCallerJoin']=function(_0x5ca787){try{if(this[_0xd028('0x6c')](_0x5ca787)){logger['debug'](_0xd028('0x76'),_0x5ca787[_0xd028('0x4b')],util[_0xd028('0x43')](_0x5ca787,{'showHidden':![],'depth':null}));if(_[_0xd028('0x66')](this[_0xd028('0x44')][_0x5ca787[_0xd028('0x4b')]]))this[_0xd028('0x44')][_0x5ca787['uniqueid']]=[];if(_[_0xd028('0x66')](this[_0xd028('0x12')][_0x5ca787['uniqueid']]))this['channels'][_0x5ca787[_0xd028('0x4b')]]={};var _0x22baf1=new QueueReport();_0x22baf1['name']=_0x5ca787['queue'];_0x22baf1[_0xd028('0x54')]=this[_0xd028('0x14')][_0x22baf1[_0xd028('0x51')]]&&this[_0xd028('0x14')][_0x22baf1[_0xd028('0x51')]][_0xd028('0x54')]?this[_0xd028('0x14')][_0x22baf1['name']][_0xd028('0x54')]||_0xd028('0x55'):_0xd028('0x55');_0x22baf1[_0xd028('0x6d')]=_0x5ca787[_0xd028('0x6d')];_0x22baf1[_0xd028('0x77')]=moment()[_0xd028('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x22baf1[_0xd028('0x78')]=_0x5ca787[_0xd028('0x78')];_0x22baf1[_0xd028('0x79')]=_0x5ca787[_0xd028('0x79')];_0x22baf1['uniqueid']=_0x5ca787[_0xd028('0x4b')];_0x22baf1[_0xd028('0x7a')]=this[_0xd028('0x12')][_0x5ca787[_0xd028('0x4b')]][_0xd028('0x7a')];logger[_0xd028('0x6f')](_0xd028('0x7b'),_0x22baf1[_0xd028('0x51')],_0x22baf1['type']);_[_0xd028('0x7c')](_0x22baf1,_[_0xd028('0x7d')](_0x5ca787,_[_0xd028('0x7e')](_0x22baf1)));this['queueReports'][_0x5ca787['uniqueid']]['push'](_0x22baf1);this[_0xd028('0x12')][_0x5ca787[_0xd028('0x4b')]]=_0x22baf1;this[_0xd028('0x48')](_0x22baf1,'queuecallerjoin');}}catch(_0x140a2b){logger[_0xd028('0x41')](_0xd028('0x76'),_0x5ca787[_0xd028('0x4b')],util[_0xd028('0x43')](_0x140a2b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x1e')]=function(_0x78762b){try{if(this[_0xd028('0x6c')](_0x78762b)){logger['debug'](_0xd028('0x7f'),_0x78762b[_0xd028('0x4b')],util[_0xd028('0x43')](_0x78762b,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x78762b['uniqueid']]){var _0x73e37=_[_0xd028('0x80')](this['queueReports'][_0x78762b[_0xd028('0x4b')]]);_0x73e37[_0xd028('0x81')]=![];_0x73e37[_0xd028('0x82')]=null;_0x73e37[_0xd028('0x83')]=_0x78762b[_0xd028('0x83')];_0x73e37['originalposition']=_0x78762b[_0xd028('0x84')];_0x73e37[_0xd028('0x1d')]=!![];_0x73e37[_0xd028('0x85')]=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x73e37['queuecallerexitreason']=_0xd028('0x87');_0x73e37[_0xd028('0x88')]=null;logger[_0xd028('0x6f')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x73e37[_0xd028('0x51')],_0x73e37[_0xd028('0x54')]);this[_0xd028('0x12')][_0x78762b[_0xd028('0x4b')]]=_0x73e37;this['emitVoiceQueueChannelRemove'](_0x73e37,'queuecallerabandon');}}}catch(_0x5764ba){logger[_0xd028('0x41')](_0xd028('0x7f'),_0x78762b[_0xd028('0x4b')],util['inspect'](_0x5764ba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x1f')]=function(_0x3917e1){try{if(this[_0xd028('0x6c')](_0x3917e1)){logger[_0xd028('0x49')](_0xd028('0x89'),_0x3917e1[_0xd028('0x4b')],util[_0xd028('0x43')](_0x3917e1,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x3917e1[_0xd028('0x4b')]]){var _0x53ca5c=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x3917e1[_0xd028('0x4b')]]);_0x53ca5c['queuecallerleaveAt']=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x53ca5c[_0xd028('0x8a')]=_0x3917e1['connectedlinenum'];_0x53ca5c['connectedlinename']=_0x3917e1[_0xd028('0x8b')];logger[_0xd028('0x6f')](_0xd028('0x8c'),_0x53ca5c[_0xd028('0x51')],_0x53ca5c[_0xd028('0x54')],_0x3917e1[_0xd028('0x8a')],_0x3917e1[_0xd028('0x8b')]);this[_0xd028('0x12')][_0x3917e1['uniqueid']]=_0x53ca5c;this[_0xd028('0x48')](_0x53ca5c,'queuecallerleave');}}}catch(_0x527c11){logger[_0xd028('0x41')](_0xd028('0x89'),_0x3917e1[_0xd028('0x4b')],util[_0xd028('0x43')](_0x527c11,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x22')]=function(_0x8e4f7){try{if(this['isNotNull'](_0x8e4f7)){logger[_0xd028('0x49')](_0xd028('0x8d'),_0x8e4f7[_0xd028('0x4b')],util['inspect'](_0x8e4f7,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x8e4f7[_0xd028('0x4b')]]){var _0x51a222=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x8e4f7[_0xd028('0x4b')]]);_0x51a222[_0xd028('0x81')]=!![];_0x51a222[_0xd028('0x8e')]=_0xd028('0x8f');logger[_0xd028('0x6f')](_0xd028('0x90'),_0x51a222[_0xd028('0x51')],_0x51a222[_0xd028('0x54')]);}}}catch(_0x17c5f3){logger[_0xd028('0x41')](_0xd028('0x8d'),_0x8e4f7[_0xd028('0x4b')],util[_0xd028('0x43')](_0x17c5f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd028('0x21')]=function(_0x4d541e){try{if(this['isNotNull'](_0x4d541e)){logger['debug'](_0xd028('0x91'),_0x4d541e['uniqueid'],util[_0xd028('0x43')](_0x4d541e,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]]){var _0x57eb5f=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]]);_0x57eb5f[_0xd028('0x1d')]=![];_0x57eb5f[_0xd028('0x85')]=null;_0x57eb5f[_0xd028('0x92')]=!![];_0x57eb5f[_0xd028('0x88')]=_0x4d541e[_0xd028('0x93')];_0x57eb5f['holdtime']=_0x4d541e[_0xd028('0x83')];_0x57eb5f[_0xd028('0x81')]=!![];_0x57eb5f[_0xd028('0x94')]=![];_0x57eb5f[_0xd028('0x95')]=null;if(!_0x57eb5f[_0xd028('0x96')]){if(_0x4d541e[_0xd028('0x97')]=='transfer'){_0x57eb5f[_0xd028('0x8e')]=_0xd028('0x98');logger[_0xd028('0x6f')](_0xd028('0x99'),_0x57eb5f['name'],_0x57eb5f['type']);}else{if(_[_0xd028('0x9a')](_0x4d541e[_0xd028('0x3e')][_0xd028('0x9b')](),'local/')){if(this[_0xd028('0x44')][_0x4d541e[_0xd028('0x9c')]]){var _0x5435d4=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x4d541e['linkedid']]);_0x5435d4[_0xd028('0x81')]=![];_0x5435d4['queuecallerexit']=!![];_0x5435d4[_0xd028('0x95')]=moment(_0x57eb5f[_0xd028('0x77')])[_0xd028('0x9d')](_0x4d541e[_0xd028('0x83')],_0xd028('0x9e'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5435d4[_0xd028('0x8e')]=_0xd028('0x9f');_0x5435d4[_0xd028('0x96')]=!![];_0x5435d4[_0xd028('0xa0')]=_0xd028('0xa1');_0x5435d4[_0xd028('0xa2')]=_0x4d541e[_0xd028('0xa3')];_0x5435d4[_0xd028('0xa4')]=_0x4d541e[_0xd028('0x4b')];logger[_0xd028('0x6f')](_0xd028('0xa5'),_0x5435d4['name'],_0x5435d4[_0xd028('0x54')]);var _0x6d8f6=this[_0xd028('0x44')][_0x4d541e[_0xd028('0x9c')]];this['queueReports'][_0x4d541e[_0xd028('0x9c')]]=this[_0xd028('0x44')][_0x4d541e[_0xd028('0x4b')]];this['queueReports'][_0x4d541e[_0xd028('0x4b')]]=_0x6d8f6;}}else{_0x57eb5f[_0xd028('0x8e')]=_0xd028('0xa6')+_0x4d541e[_0xd028('0x97')]['toUpperCase']();logger[_0xd028('0x6f')](_0xd028('0xa7'),_0x57eb5f[_0xd028('0x51')],_0x57eb5f[_0xd028('0x54')],_0x57eb5f[_0xd028('0x8e')]);}}}this[_0xd028('0x12')][_0x4d541e[_0xd028('0x4b')]]=_0x57eb5f;this[_0xd028('0x4f')](_0x57eb5f,_0xd028('0x20'));}}}catch(_0xaeedc6){logger[_0xd028('0x41')](_0xd028('0x91'),_0x4d541e[_0xd028('0x4b')],util[_0xd028('0x43')](_0xaeedc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0xa8')]=function(_0x536deb){try{if(this[_0xd028('0x6c')](_0x536deb)){logger[_0xd028('0x49')](_0xd028('0xa9'),_0x536deb[_0xd028('0x4b')],util[_0xd028('0x43')](_0x536deb,{'showHidden':![],'depth':null}));this['addVariable'](_0x536deb['uniqueid'],_[_0xd028('0x7e')](_0x536deb['variable'])[0x0],_0x536deb[_0xd028('0xaa')]);if(this[_0xd028('0x44')][_0x536deb['uniqueid']]){var _0x24f823=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x536deb[_0xd028('0x4b')]]);if(_0x24f823){if(this[_0xd028('0x6c')](_0x536deb['variable'])&&this[_0xd028('0x6c')](_0x536deb[_0xd028('0xab')]['queuestatus'])){switch(_0x536deb['value']){case _0xd028('0xac'):_0x24f823['queuecallerexit']=![];_0x24f823[_0xd028('0x95')]=null;break;case _0xd028('0xad'):_0x24f823[_0xd028('0xae')]=_0xd028('0xaf');_0x24f823[_0xd028('0x94')]=!![];_0x24f823[_0xd028('0x95')]=moment()['format'](_0xd028('0x86'));_0x24f823[_0xd028('0xb0')]=moment()[_0xd028('0x50')](_0xd028('0x86'));logger[_0xd028('0x49')](_0xd028('0xb1'),_0x536deb['uniqueid'],util['inspect'](_0x24f823,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x24f823);break;default:_0x24f823['queuecallerexit']=!![];_0x24f823[_0xd028('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x24f823[_0xd028('0xb0')]=moment()[_0xd028('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x24f823[_0xd028('0x1d')]=![];_0x24f823[_0xd028('0x85')]=null;_0x24f823[_0xd028('0x8e')]=_0x536deb[_0xd028('0xaa')];this[_0xd028('0x12')][_0x536deb['uniqueid']]=_0x24f823;this[_0xd028('0x4f')](_0x24f823,_0xd028('0x23'));}else if(this[_0xd028('0x6c')](_0x536deb[_0xd028('0xab')])&&this['isNotNull'](_0x536deb[_0xd028('0xab')][_0xd028('0xb2')])){if(!_0x24f823[_0xd028('0x1d')]){_0x24f823[_0xd028('0x94')]=!![];_0x24f823[_0xd028('0x95')]=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x24f823['queuecallerexitreason']='EXITWITHKEY';_0x24f823['queuecallerleaveAt']=moment()[_0xd028('0x50')](_0xd028('0x86'));this[_0xd028('0x12')][_0x536deb[_0xd028('0x4b')]]=_0x24f823;}}logger['info'](_0xd028('0xb3'),_0x536deb['uniqueid'],_0x24f823[_0xd028('0x51')],_0x24f823['type'],_[_0xd028('0x7e')](_0x536deb[_0xd028('0xab')])[0x0],_0x536deb[_0xd028('0xaa')]);_0x24f823[_0xd028('0xb4')]=this[_0xd028('0xb4')][_0x536deb[_0xd028('0x4b')]];}}}}catch(_0x4cdce8){logger[_0xd028('0x41')]('[%s][voiceQueueReport][varset]',_0x536deb[_0xd028('0x4b')],util['inspect'](_0x4cdce8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')]['addVariable']=function(_0x44af27,_0x3f1b54,_0x237528){var _0x25b12d=[_0xd028('0xb5'),_0xd028('0xb6'),'rtpaudioqosjitter',_0xd028('0xb7'),_0xd028('0xb8'),_0xd028('0xb9'),_0xd028('0xba'),_0xd028('0xbb'),'sipcallid',_0xd028('0xbc'),'bridgepeer',_0xd028('0xbd'),_0xd028('0xbe'),_0xd028('0xbf'),_0xd028('0xc0'),'memberlastcall',_0xd028('0x93'),_0xd028('0xc1'),_0xd028('0xc2')];if(!_['isNil'](_0x3f1b54)&&!_[_0xd028('0xc3')](_0x25b12d,_0x3f1b54)){if(_[_0xd028('0x66')](this[_0xd028('0xb4')][_0x44af27])){this['variables'][_0x44af27]={};}this[_0xd028('0xb4')][_0x44af27][_0x3f1b54]=_0x237528;}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x25')]=function(_0x15ff43){try{if(this[_0xd028('0x6c')](_0x15ff43)){logger['debug'](_0xd028('0xc4'),_0x15ff43[_0xd028('0x4b')],util[_0xd028('0x43')](_0x15ff43,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x15ff43[_0xd028('0x4b')]]){for(var _0x568a08=0x0,_0x177aa1={};_0x568a08<this[_0xd028('0x44')][_0x15ff43[_0xd028('0x4b')]][_0xd028('0xc5')];_0x568a08+=0x1){_0x177aa1=this['queueReports'][_0x15ff43[_0xd028('0x4b')]][_0x568a08];if(this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]]){if(_0x177aa1[_0xd028('0x94')]&&_0x177aa1[_0xd028('0x96')]!=!![]){this[_0xd028('0x14')][_0x177aa1['queue']][_0xd028('0x5d')]+=0x1;}if(_0x177aa1['queuecallerabandon']){this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0xc6')]+=0x1;}this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]]['sumHoldTime']+=moment(_0x177aa1[_0xd028('0xb0')])['diff'](_0x177aa1['queuecallerjoinAt'],_0xd028('0x9e'))||0x0;if(_0x568a08===this['queueReports'][_0x15ff43[_0xd028('0x4b')]][_0xd028('0xc5')]-0x1){this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0x5a')]+=moment()[_0xd028('0xc7')](0x0)['diff'](_0x177aa1['queuecallerjoinAt'],'seconds');this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0x5c')]+=0x1;if(_0x177aa1[_0xd028('0x81')]){this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0x57')]+=0x1;this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]]['sumBillable']+=moment()['milliseconds'](0x0)['diff'](_0x177aa1[_0xd028('0xb0')],_0xd028('0x9e'));_0x177aa1[_0xd028('0x82')]=moment()[_0xd028('0x50')](_0xd028('0x86'));_0x177aa1[_0xd028('0x94')]=![];_0x177aa1['queuecallerexitAt']=null;}if(_0x177aa1[_0xd028('0x94')]&&_0x177aa1['transfer']!=!![]){_0x177aa1[_0xd028('0xae')]=_0xd028('0x5d');logger[_0xd028('0x49')](_0xd028('0xc8'),_0x15ff43[_0xd028('0x4b')],util[_0xd028('0x43')](_0x177aa1,{'showHidden':![],'depth':null}));ami[_0xd028('0x47')]('custom:queuecallerunmanaged',_0x177aa1);}if(_0x177aa1[_0xd028('0x1d')]){_0x177aa1['lastevent']=_0xd028('0xc6');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x15ff43[_0xd028('0x4b')],util[_0xd028('0x43')](_0x177aa1,{'showHidden':![],'depth':null}));ami['emit'](_0xd028('0xc9'),_0x177aa1);}}else{this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0x5a')]+=this[_0xd028('0x14')][_0x177aa1[_0xd028('0x6d')]][_0xd028('0x5b')];}logger['info'](_0xd028('0xca'),_0x15ff43['uniqueid'],_0x177aa1[_0xd028('0x51')],_0x177aa1[_0xd028('0x54')],_0x15ff43[_0xd028('0xcb')]);this['channels'][_0x15ff43[_0xd028('0x4b')]]=_0x177aa1;this[_0xd028('0x4f')](_0x177aa1,_0xd028('0x24'));this['emitVoiceQueueSummary'](this['voiceQueues'][_0x177aa1[_0xd028('0x6d')]],_0xd028('0x24'));}}logger['debug'](_0xd028('0xcc'),_0x15ff43['uniqueid'],util['inspect'](this[_0xd028('0x44')][_0x15ff43[_0xd028('0x4b')]],{'showHidden':![],'depth':null}));ami[_0xd028('0x47')](_0xd028('0xcd'),this['queueReports'][_0x15ff43[_0xd028('0x4b')]]);delete this[_0xd028('0x44')][_0x15ff43['uniqueid']];delete this[_0xd028('0x12')][_0x15ff43[_0xd028('0x4b')]];}if(this[_0xd028('0xb4')][_0x15ff43['uniqueid']]){delete this[_0xd028('0xb4')][_0x15ff43['uniqueid']];}}}catch(_0x11939f){logger[_0xd028('0x41')](_0xd028('0xc4'),_0x15ff43[_0xd028('0x4b')],util['inspect'](_0x11939f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0xce')]=function(_0x2b2856){try{if(this[_0xd028('0x6c')](_0x2b2856)){logger[_0xd028('0x49')]('[%s][voiceQueueReport][attendedtransfer]',_0x2b2856[_0xd028('0x4b')],util['inspect'](_0x2b2856,{'showHidden':![],'depth':null}));var _0x1f44e1;if(this['queueReports'][_0x2b2856[_0xd028('0xcf')]]){_0x1f44e1=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x2b2856[_0xd028('0xcf')]]);_0x1f44e1[_0xd028('0xa2')]=_0x2b2856[_0xd028('0xd0')];_0x1f44e1['transferuniqueid']=_0x2b2856['secondtransfereruniqueid'];_0x1f44e1[_0xd028('0x8e')]='ATTENDEDTRANSFER';_0x1f44e1['transfer']=!![];_0x1f44e1['transfertype']='ATTENDED';if(this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd1')]]){var _0x4ed3c5=this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd1')]];this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd1')]]=this[_0xd028('0x44')][_0x2b2856[_0xd028('0xcf')]];this['queueReports'][_0x2b2856['transfereeuniqueid']]=_0x4ed3c5;var _0x43dc6d=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x2b2856['transfereeuniqueid']]);_0x43dc6d[_0xd028('0x3b')]=!![];}logger[_0xd028('0x6f')](_0xd028('0xd2'),_0x2b2856['uniqueid'],_0x1f44e1[_0xd028('0x51')],_0x1f44e1[_0xd028('0x54')],_0x1f44e1['transferexten'],_0x1f44e1[_0xd028('0xa4')]);}else if(this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd3')]]){_0x1f44e1=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x2b2856['transfertargetuniqueid']]);_0x1f44e1[_0xd028('0xa2')]=_0x2b2856[_0xd028('0xd4')];_0x1f44e1[_0xd028('0xa4')]=_0x2b2856[_0xd028('0xd5')];_0x1f44e1[_0xd028('0x8e')]=_0xd028('0xd6');_0x1f44e1['transfer']=!![];_0x1f44e1['transfertype']=_0xd028('0xd7');if(this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd5')]]){var _0x4ed3c5=this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd5')]];this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd5')]]=this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd3')]];this['queueReports'][_0x2b2856[_0xd028('0xd3')]]=_0x4ed3c5;var _0x43dc6d=_['last'](this[_0xd028('0x44')][_0x2b2856[_0xd028('0xd3')]]);_0x43dc6d['switch']=!![];}logger[_0xd028('0x6f')](_0xd028('0xd2'),_0x2b2856[_0xd028('0x4b')],_0x1f44e1[_0xd028('0x51')],_0x1f44e1[_0xd028('0x54')],_0x1f44e1[_0xd028('0xa2')],_0x1f44e1['transferuniqueid']);}}}catch(_0x352e86){logger['error'](_0xd028('0xd8'),_0x2b2856[_0xd028('0x4b')],util[_0xd028('0x43')](_0x352e86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x30')]=function(_0x862cbe){try{if(this['isNotNull'](_0x862cbe)){logger[_0xd028('0x49')]('[%s][voiceQueueReport][blindtransfer]',_0x862cbe[_0xd028('0x4b')],util['inspect'](_0x862cbe,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x862cbe[_0xd028('0xcf')]]){var _0x3b6387=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x862cbe[_0xd028('0xcf')]]);_0x3b6387[_0xd028('0x8e')]=_0xd028('0xd9');_0x3b6387[_0xd028('0x96')]=!![];_0x3b6387[_0xd028('0xa0')]='BLIND';_0x3b6387[_0xd028('0xa2')]=_0x862cbe[_0xd028('0xda')];_0x3b6387[_0xd028('0xa4')]=_0x862cbe[_0xd028('0xcf')];logger[_0xd028('0x6f')](_0xd028('0xdb'),_0x862cbe['uniqueid'],_0x3b6387[_0xd028('0x51')],_0x3b6387[_0xd028('0x54')],_0x3b6387['transferexten'],_0x3b6387[_0xd028('0xa4')]);this[_0xd028('0x25')]({'event':_0xd028('0xdc'),'uniqueid':_0x862cbe[_0xd028('0xcf')],'context':_0x862cbe[_0xd028('0xdd')],'channel':_0x862cbe['transfererchannel']});}}}catch(_0x215c8f){logger[_0xd028('0x41')](_0xd028('0xde'),_0x862cbe['uniqueid'],util[_0xd028('0x43')](_0x215c8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')][_0xd028('0x2b')]=function(_0x3bdda8){try{if(this[_0xd028('0x6c')](_0x3bdda8)){logger[_0xd028('0x49')](_0xd028('0xdf'),_0x3bdda8[_0xd028('0x4b')],util['inspect'](_0x3bdda8,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x3bdda8[_0xd028('0x4b')]]){var _0x1b652e=_[_0xd028('0x80')](this['queueReports'][_0x3bdda8[_0xd028('0x4b')]]);if(!_[_0xd028('0x3c')](_0x1b652e[_0xd028('0xb0')])){_0x1b652e[_0xd028('0xe0')]=moment()[_0xd028('0x50')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xd028('0x6f')](_0xd028('0xe1'),_0x3bdda8[_0xd028('0x4b')],_0x1b652e[_0xd028('0xe0')]);}}}}catch(_0x3ee783){logger[_0xd028('0x41')]('[%s][voiceQueueReport][musiconholdstart]',_0x3bdda8[_0xd028('0x4b')],util[_0xd028('0x43')](_0x3ee783,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')]['syncMusicOnHoldStop']=function(_0x1548e3){try{if(this['isNotNull'](_0x1548e3)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x1548e3['uniqueid'],util[_0xd028('0x43')](_0x1548e3,{'showHidden':![],'depth':null}));if(this[_0xd028('0x44')][_0x1548e3[_0xd028('0x4b')]]){var _0x203e4d=_[_0xd028('0x80')](this[_0xd028('0x44')][_0x1548e3['uniqueid']]);if(!_[_0xd028('0x3c')](_0x203e4d[_0xd028('0xe0')])){_0x203e4d['mohtime']+=moment()[_0xd028('0xc7')](0x0)['diff'](_0x203e4d[_0xd028('0xe0')],_0xd028('0x9e'));logger[_0xd028('0x6f')](_0xd028('0xe2'),_0x1548e3[_0xd028('0x4b')],_0x203e4d[_0xd028('0xe3')]);delete _0x203e4d[_0xd028('0xe0')];}}}}catch(_0x51e38b){logger[_0xd028('0x41')](_0xd028('0xe4'),_0x1548e3['uniqueid'],util[_0xd028('0x43')](_0x51e38b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd028('0xc')]['syncNewExten']=function(_0x27606a){try{if(this['isNotNull'](_0x27606a)){logger[_0xd028('0x49')](_0xd028('0xe5'),_0x27606a['uniqueid'],util[_0xd028('0x43')](_0x27606a,{'showHidden':![],'depth':null}));if(_0x27606a[_0xd028('0xe6')]['toLowerCase']()===_0xd028('0xe7')){_0x27606a['applicationdata']=_0x27606a[_0xd028('0xe8')]&&_0x27606a['appdata'][_0xd028('0x9a')](_0xd028('0xe9'))?_0x27606a[_0xd028('0xe8')]:(_0x27606a[_0xd028('0xe8')]||_0x27606a['applicationdata'])[_0xd028('0x9b')]();if(_[_0xd028('0x9a')](_0x27606a[_0xd028('0xea')]['toLowerCase'](),_0xd028('0xeb'))){logger[_0xd028('0x6f')](_0xd028('0xec'),_0x27606a[_0xd028('0x4b')],_0x27606a[_0xd028('0xe6')],_0x27606a['applicationdata']);if(_['isUndefined'](this[_0xd028('0x12')][_0x27606a[_0xd028('0x4b')]]))this[_0xd028('0x12')][_0x27606a[_0xd028('0x4b')]]={};var _0x1ef1a0=_0x27606a['applicationdata']['split']('=');var _0x2ea708=_0x1ef1a0[0x0][_0xd028('0x9b')]()[_0xd028('0xed')](/cdr\((.*)\)/);if(_0x2ea708)this[_0xd028('0x12')][_0x27606a[_0xd028('0x4b')]][_0x2ea708[0x1]]=_0x1ef1a0[0x1];}}}}catch(_0x6d4bbf){logger[_0xd028('0x41')]('[%s][voiceQueueReport][newexten]',_0x27606a['uniqueid'],util[_0xd028('0x43')](_0x6d4bbf,{'showHidden':![],'depth':null}));}};module[_0xd028('0xee')]=VoiceQueueReport;
\ No newline at end of file
+var _0x4b07=['[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','applicationdata','split','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','bind','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncHangup','fullybooted','syncFullyBooted','newexten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','status','catch','message','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','prototype','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','emitVoiceQueueSummary','inbound','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','Trunk','active','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','isNotNull','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','syncQueueSummaryComplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerabandon','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','variables','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','set','appdata','CDR(routeAlias)'];(function(_0x23b565,_0x25b107){var _0x328d1e=function(_0x1ff821){while(--_0x1ff821){_0x23b565['push'](_0x23b565['shift']());}};_0x328d1e(++_0x25b107);}(_0x4b07,0x1d6));var _0x74b0=function(_0x3cb328,_0x54fa7e){_0x3cb328=_0x3cb328-0x0;var _0x400720=_0x4b07[_0x3cb328];return _0x400720;};'use strict';var _=require('lodash');var moment=require(_0x74b0('0x0'));var util=require(_0x74b0('0x1'));var md5=require('md5');var Redis=require(_0x74b0('0x2'));var config=require(_0x74b0('0x3'));var logger=require(_0x74b0('0x4'))(_0x74b0('0x5'));var ami=require('../ami');var QueueReport=require(_0x74b0('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x74b0('0x7'),'port':0x18eb});var io=require(_0x74b0('0x8'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x74b0('0x9')]=function(_0x55cdf9){this[_0x74b0('0xa')]=this[_0x74b0('0xa')]?this[_0x74b0('0xa')][_0x74b0('0xb')](_0x55cdf9):_0x55cdf9();};function VoiceQueueReport(_0x3a516c){this[_0x74b0('0xc')]=new Sequence();this[_0x74b0('0xd')]={};this[_0x74b0('0xe')]=_0x3a516c[_0x74b0('0xe')];this[_0x74b0('0xf')]=_0x3a516c[_0x74b0('0x10')];this[_0x74b0('0x11')]=_0x3a516c[_0x74b0('0x11')];this[_0x74b0('0x12')]=!![];this[_0x74b0('0x13')]=_0x3a516c[_0x74b0('0x13')];this['variables']={};ami['on'](_0x74b0('0x14'),this[_0x74b0('0x15')]['bind'](this));ami['on'](_0x74b0('0x16'),this['syncQueueSummaryComplete'][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x18'),this['syncQueueCallerJoin'][_0x74b0('0x17')](this));ami['on']('queuecallerabandon',this[_0x74b0('0x19')]['bind'](this));ami['on'](_0x74b0('0x1a'),this['syncQueueCallerLeave'][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x1b'),this[_0x74b0('0x1c')][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x1d'),this[_0x74b0('0x1e')][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x1f'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0x74b0('0x20')]['bind'](this));ami['on'](_0x74b0('0x21'),this[_0x74b0('0x22')][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x23'),this['syncNewExten'][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x24'),this[_0x74b0('0x25')][_0x74b0('0x17')](this));ami['on']('musiconholdstop',this[_0x74b0('0x26')][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x27'),this[_0x74b0('0x28')][_0x74b0('0x17')](this));ami['on'](_0x74b0('0x29'),this[_0x74b0('0x2a')][_0x74b0('0x17')](this));this[_0x74b0('0x2b')]();this['loopQueueShow']();}function clearChannels(_0x17bdf8){if(!_['isEmpty'](_0x17bdf8)){for(var _0x4e16b6 in _0x17bdf8){if(_0x17bdf8[_0x74b0('0x2c')](_0x4e16b6)){delete _0x17bdf8[_0x4e16b6];}}}}function clearCampaigns(_0x331cb1){if(!_[_0x74b0('0x2d')](_0x331cb1)){for(var _0x4e78e1 in _0x331cb1){if(_0x331cb1[_0x74b0('0x2c')](_0x4e78e1)){_0x331cb1[_0x4e78e1][_0x74b0('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x1f8b2a){if(!_[_0x74b0('0x2d')](_0x1f8b2a)){for(var _0x57c283 in _0x1f8b2a){if(_0x1f8b2a[_0x74b0('0x2c')](_0x57c283)){_0x1f8b2a[_0x57c283][_0x74b0('0x2e')]=0x0;_0x1f8b2a[_0x57c283][_0x74b0('0x2f')]=0x0;_0x1f8b2a[_0x57c283][_0x74b0('0x30')]=0x0;_0x1f8b2a[_0x57c283][_0x74b0('0x31')]=0x0;_0x1f8b2a[_0x57c283][_0x74b0('0x32')]=!![];}}}}function clearAgentBooked(_0x5e9f98){if(!_[_0x74b0('0x2d')](_0x5e9f98)){for(var _0x5be6cb in _0x5e9f98){if(_0x5e9f98[_0x74b0('0x2c')](_0x5be6cb)){_0x5e9f98[_0x5be6cb][_0x74b0('0x33')]=!![];}}}}VoiceQueueReport['prototype'][_0x74b0('0x34')]=function(){var _0x25db17=this;for(var _0x143093 in this['channels']){if(this['channels']['hasOwnProperty'](_0x143093)&&!this[_0x74b0('0xf')][_0x143093][_0x74b0('0x35')]){this['sequence'][_0x74b0('0x9')](function(){if(!_[_0x74b0('0x36')](_0x25db17[_0x74b0('0xf')][_0x143093])){return ami[_0x74b0('0x37')]({'action':_0x74b0('0x38'),'channel':_0x25db17[_0x74b0('0xf')][_0x143093]['channel']})[_0x74b0('0x39')](function(_0x1aa30c){if(_0x1aa30c[_0x74b0('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x25db17[_0x74b0('0xf')][_0x143093]){delete _0x25db17[_0x74b0('0xf')][_0x143093];logger['error'](_0x74b0('0x3b'),_0x143093,util[_0x74b0('0x3c')](_0x1aa30c,{'showHidden':![],'depth':null}));}if(_0x25db17[_0x74b0('0xd')][_0x143093]){delete _0x25db17['queueReports'][_0x143093];logger[_0x74b0('0x3d')](_0x74b0('0x3e'),_0x143093,util[_0x74b0('0x3c')](_0x1aa30c,{'showHidden':![],'depth':null}));}if(_0x25db17['variables'][_0x143093]){delete _0x25db17['variables'][_0x143093];logger[_0x74b0('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x143093,util[_0x74b0('0x3c')](_0x1aa30c,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x22')]=function(){logger[_0x74b0('0x3d')](_0x74b0('0x40'));clearChannels(this[_0x74b0('0xf')]);this[_0x74b0('0x41')](this[_0x74b0('0xd')]);clearAgentBooked(this[_0x74b0('0xe')]);clearVoiceQueues(this[_0x74b0('0x11')]);clearCampaigns(this[_0x74b0('0x13')]);};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x41')]=function(_0x226036){var _0x459c8b=this;if(!_[_0x74b0('0x2d')](_0x226036)){for(var _0x4520b8 in _0x226036){if(_0x226036[_0x74b0('0x2c')](_0x4520b8)){_0x459c8b[_0x74b0('0x42')](_0x226036[_0x4520b8],_0x74b0('0x43'));delete _0x226036[_0x4520b8];}}}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x44')]=function(_0x4713d7,_0x45ddcd,_0x5cace3){io['to'](_0x4713d7)[_0x74b0('0x44')](_0x45ddcd,_0x5cace3);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x4fe7da,_0xe249f0){logger[_0x74b0('0x45')](_0x74b0('0x46')+_0xe249f0+_0x74b0('0x47'),_0x4fe7da[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x4fe7da,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x74b0('0x49'),_0x4fe7da[_0x74b0('0x4a')]),_0x74b0('0x4b'),_0x4fe7da);io[_0x74b0('0x44')](_0x74b0('0x4c'),_0x4fe7da);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x4e20ec,_0xfbe12d){logger[_0x74b0('0x45')](_0x74b0('0x46')+_0xfbe12d+_0x74b0('0x4d'),_0x4e20ec['uniqueid'],util[_0x74b0('0x3c')](_0x4e20ec,{'showHidden':![],'depth':null}));this[_0x74b0('0x44')](util['format'](_0x74b0('0x49'),_0x4e20ec[_0x74b0('0x4a')]),'voice_queue_channel:remove',_0x4e20ec);io[_0x74b0('0x44')]('voice_queue_presence:remove',_0x4e20ec);};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x4e')]=function(_0x1516bc,_0x48925b){if(_0x1516bc['type']===_0x74b0('0x4f')){var _0x53cb00={'id':_0x1516bc['id'],'name':_0x1516bc[_0x74b0('0x4a')],'strategy':_0x1516bc['strategy'],'answered':_0x1516bc[_0x74b0('0x50')],'available':_0x1516bc[_0x74b0('0x51')],'loggedIn':_0x1516bc[_0x74b0('0x52')],'pTalking':_0x1516bc[_0x74b0('0x30')],'sumBillable':_0x1516bc[_0x74b0('0x53')],'sumDuration':_0x1516bc[_0x74b0('0x54')],'sumHoldTime':_0x1516bc[_0x74b0('0x55')]||0x0,'talking':_0x1516bc[_0x74b0('0x2f')],'total':_0x1516bc[_0x74b0('0x56')],'type':_0x1516bc[_0x74b0('0x57')],'unmanaged':_0x1516bc[_0x74b0('0x58')],'abandoned':_0x1516bc[_0x74b0('0x59')],'waiting':_0x1516bc['waiting']};if(_0x1516bc[_0x74b0('0x5a')]){_0x53cb00['Trunk']={'id':_0x1516bc[_0x74b0('0x5a')]['id'],'name':_0x1516bc[_0x74b0('0x5a')][_0x74b0('0x4a')],'active':_0x1516bc[_0x74b0('0x5a')][_0x74b0('0x5b')],'callerid':_0x1516bc[_0x74b0('0x5a')]['callerid']};}if(_0x1516bc['Interval']){_0x53cb00['Interval']={'id':_0x1516bc['Interval']['id'],'name':_0x1516bc[_0x74b0('0x5c')][_0x74b0('0x4a')]};}var _0x507fb8=md5(JSON[_0x74b0('0x5d')](_0x53cb00));if(_0x1516bc[_0x74b0('0x5e')]!==_0x507fb8){_0x1516bc[_0x74b0('0x5e')]=_0x507fb8;logger['debug'](_0x74b0('0x5f')+_0x48925b+_0x74b0('0x60'),util[_0x74b0('0x3c')](_0x53cb00,{'showHidden':![],'depth':null}));this[_0x74b0('0x44')](util['format'](_0x74b0('0x49'),_0x53cb00[_0x74b0('0x4a')]),_0x74b0('0x61'),_0x53cb00);}}};VoiceQueueReport[_0x74b0('0x3f')]['isNotNull']=function(_0x391f7d){return _0x391f7d!==null&&!_[_0x74b0('0x62')](_0x391f7d);};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x63')]=function(){var _0x139e79=this;setInterval(function(){_0x139e79[_0x74b0('0x34')]();ami['Action']({'action':'queues'})['catch'](function(_0xe82edf){logger[_0x74b0('0x3d')](_0x74b0('0x64'),util[_0x74b0('0x3c')](_0xe82edf,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x2b')]=function(){var _0x5210a3=this;setInterval(function(){if(_0x5210a3['flagQueueSummary']){return ami[_0x74b0('0x37')]({'action':'queuesummary'})[_0x74b0('0x65')](function(_0x39dd7b){_0x5210a3[_0x74b0('0x12')]=![];})[_0x74b0('0x39')](function(_0x566624){logger['error'](_0x74b0('0x66'),util[_0x74b0('0x3c')](_0x566624,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x74b0('0x3f')]['syncQueueSummary']=function(_0x706f2c){try{if(this['isNotNull'](_0x706f2c)&&this[_0x74b0('0x67')](_0x706f2c[_0x74b0('0x68')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0x74b0('0x3c')](_0x706f2c,{'showHidden':![],'depth':null}));if(this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]]){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x706f2c['queue']);var _0x1c0ced=_[_0x74b0('0x69')](this[_0x74b0('0xf')],_0x74b0('0x68'))[_0x706f2c[_0x74b0('0x68')]]||0x0;var _0x52c185=_0x1c0ced-_0x706f2c[_0x74b0('0x6a')];if(this[_0x74b0('0x11')][_0x706f2c['queue']][_0x74b0('0x31')]!==_['toNumber'](_0x706f2c['callers'])||this['voiceQueues'][_0x706f2c[_0x74b0('0x68')]]['loggedIn']!==_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x6c')])||this[_0x74b0('0x11')][_0x706f2c['queue']][_0x74b0('0x51')]!==_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x51')])||this[_0x74b0('0x11')][_0x706f2c['queue']][_0x74b0('0x2f')]!==_0x52c185){this['voiceQueues'][_0x706f2c[_0x74b0('0x68')]]['waiting']=_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x6a')]);this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]]['loggedIn']=_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x6c')]);this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]][_0x74b0('0x51')]=_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x51')]);this[_0x74b0('0x11')][_0x706f2c['queue']]['talking']=_0x52c185>0x0?_0x52c185:0x0;this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]]['talking']=this['voiceQueues'][_0x706f2c[_0x74b0('0x68')]][_0x74b0('0x2f')]>_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x6c')])?_[_0x74b0('0x6b')](_0x706f2c[_0x74b0('0x6c')]):this[_0x74b0('0x11')][_0x706f2c['queue']][_0x74b0('0x2f')];this[_0x74b0('0x4e')](this['voiceQueues'][_0x706f2c[_0x74b0('0x68')]],_0x74b0('0x14'));}logger[_0x74b0('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x74b0('0x3c')](this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]],{'showHidden':![],'depth':null}));ami['emit'](_0x74b0('0x6d'),this[_0x74b0('0x11')][_0x706f2c[_0x74b0('0x68')]]);}}}catch(_0x5b8dba){logger[_0x74b0('0x3d')]('[voiceQueueReport][queuesummary]',util[_0x74b0('0x3c')](_0x5b8dba,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74b0('0x6e')]=function(_0xc7ded0){logger[_0x74b0('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x74b0('0x3c')](_0xc7ded0,{'showHidden':![],'depth':null}));this[_0x74b0('0x12')]=!![];};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x6f')]=function(_0x2d199c){try{if(this[_0x74b0('0x67')](_0x2d199c)){logger[_0x74b0('0x45')](_0x74b0('0x70'),_0x2d199c[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x2d199c,{'showHidden':![],'depth':null}));if(_[_0x74b0('0x62')](this[_0x74b0('0xd')][_0x2d199c[_0x74b0('0x48')]]))this[_0x74b0('0xd')][_0x2d199c['uniqueid']]=[];if(_[_0x74b0('0x62')](this[_0x74b0('0xf')][_0x2d199c['uniqueid']]))this['channels'][_0x2d199c[_0x74b0('0x48')]]={};var _0x1c0bcc=new QueueReport();_0x1c0bcc[_0x74b0('0x4a')]=_0x2d199c['queue'];_0x1c0bcc[_0x74b0('0x57')]=this[_0x74b0('0x11')][_0x1c0bcc[_0x74b0('0x4a')]]&&this[_0x74b0('0x11')][_0x1c0bcc[_0x74b0('0x4a')]][_0x74b0('0x57')]?this[_0x74b0('0x11')][_0x1c0bcc[_0x74b0('0x4a')]]['type']||_0x74b0('0x4f'):_0x74b0('0x4f');_0x1c0bcc[_0x74b0('0x68')]=_0x2d199c['queue'];_0x1c0bcc[_0x74b0('0x71')]=moment()[_0x74b0('0x72')](_0x74b0('0x73'));_0x1c0bcc[_0x74b0('0x74')]=_0x2d199c[_0x74b0('0x74')];_0x1c0bcc[_0x74b0('0x75')]=_0x2d199c[_0x74b0('0x75')];_0x1c0bcc[_0x74b0('0x48')]=_0x2d199c[_0x74b0('0x48')];_0x1c0bcc[_0x74b0('0x76')]=this[_0x74b0('0xf')][_0x2d199c['uniqueid']][_0x74b0('0x76')];logger[_0x74b0('0x77')](_0x74b0('0x78'),_0x1c0bcc['name'],_0x1c0bcc[_0x74b0('0x57')]);_[_0x74b0('0x79')](_0x1c0bcc,_['pick'](_0x2d199c,_[_0x74b0('0x7a')](_0x1c0bcc)));this[_0x74b0('0xd')][_0x2d199c[_0x74b0('0x48')]][_0x74b0('0x7b')](_0x1c0bcc);this[_0x74b0('0xf')][_0x2d199c[_0x74b0('0x48')]]=_0x1c0bcc;this['emitVoiceQueueChannelSave'](_0x1c0bcc,'queuecallerjoin');}}catch(_0x47e6f0){logger[_0x74b0('0x3d')](_0x74b0('0x70'),_0x2d199c[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x47e6f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x190d10){try{if(this[_0x74b0('0x67')](_0x190d10)){logger[_0x74b0('0x45')]('[%s][voiceQueueReport][queuecallerabandon]',_0x190d10[_0x74b0('0x48')],util['inspect'](_0x190d10,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x190d10['uniqueid']]){var _0x42b211=_[_0x74b0('0x7c')](this[_0x74b0('0xd')][_0x190d10[_0x74b0('0x48')]]);_0x42b211[_0x74b0('0x7d')]=![];_0x42b211[_0x74b0('0x7e')]=null;_0x42b211['holdtime']=_0x190d10[_0x74b0('0x7f')];_0x42b211[_0x74b0('0x80')]=_0x190d10[_0x74b0('0x80')];_0x42b211['queuecallerabandon']=!![];_0x42b211['queuecallerabandonAt']=moment()[_0x74b0('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x42b211[_0x74b0('0x81')]='ABANDONED';_0x42b211[_0x74b0('0x82')]=null;logger[_0x74b0('0x77')](_0x74b0('0x83'),_0x42b211[_0x74b0('0x4a')],_0x42b211[_0x74b0('0x57')]);this['channels'][_0x190d10[_0x74b0('0x48')]]=_0x42b211;this[_0x74b0('0x42')](_0x42b211,_0x74b0('0x84'));}}}catch(_0x4f4543){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x190d10['uniqueid'],util[_0x74b0('0x3c')](_0x4f4543,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74b0('0x85')]=function(_0xbe3561){try{if(this['isNotNull'](_0xbe3561)){logger[_0x74b0('0x45')](_0x74b0('0x86'),_0xbe3561[_0x74b0('0x48')],util['inspect'](_0xbe3561,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xbe3561[_0x74b0('0x48')]]){var _0x1a103a=_['last'](this[_0x74b0('0xd')][_0xbe3561[_0x74b0('0x48')]]);_0x1a103a[_0x74b0('0x87')]=moment()[_0x74b0('0x72')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a103a['connectedlinenum']=_0xbe3561[_0x74b0('0x88')];_0x1a103a[_0x74b0('0x89')]=_0xbe3561['connectedlinename'];logger[_0x74b0('0x77')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1a103a[_0x74b0('0x4a')],_0x1a103a['type'],_0xbe3561['connectedlinenum'],_0xbe3561[_0x74b0('0x89')]);this[_0x74b0('0xf')][_0xbe3561[_0x74b0('0x48')]]=_0x1a103a;this['emitVoiceQueueChannelSave'](_0x1a103a,'queuecallerleave');}}}catch(_0x5b0f9b){logger[_0x74b0('0x3d')](_0x74b0('0x86'),_0xbe3561['uniqueid'],util['inspect'](_0x5b0f9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x1e')]=function(_0x5d3623){try{if(this['isNotNull'](_0x5d3623)){logger[_0x74b0('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x5d3623[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x5d3623,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0x5d3623[_0x74b0('0x48')]]){var _0x22f981=_[_0x74b0('0x7c')](this[_0x74b0('0xd')][_0x5d3623['uniqueid']]);_0x22f981[_0x74b0('0x7d')]=!![];_0x22f981[_0x74b0('0x81')]='COMPLETEDBYAGENT';logger[_0x74b0('0x77')](_0x74b0('0x8a'),_0x22f981[_0x74b0('0x4a')],_0x22f981['type']);}}}catch(_0x493283){logger['error'](_0x74b0('0x8b'),_0x5d3623[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x493283,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')]['syncAgentComplete']=function(_0xcafc5b){try{if(this['isNotNull'](_0xcafc5b)){logger[_0x74b0('0x45')](_0x74b0('0x8c'),_0xcafc5b[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0xcafc5b,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x48')]]){var _0x4ab76a=_[_0x74b0('0x7c')](this['queueReports'][_0xcafc5b[_0x74b0('0x48')]]);_0x4ab76a[_0x74b0('0x84')]=![];_0x4ab76a[_0x74b0('0x8d')]=null;_0x4ab76a['assigned']=!![];_0x4ab76a['lastAssignedTo']=_0xcafc5b[_0x74b0('0x8e')];_0x4ab76a['holdtime']=_0xcafc5b[_0x74b0('0x7f')];_0x4ab76a[_0x74b0('0x7d')]=!![];_0x4ab76a[_0x74b0('0x8f')]=![];_0x4ab76a[_0x74b0('0x90')]=null;if(!_0x4ab76a[_0x74b0('0x91')]){if(_0xcafc5b[_0x74b0('0x92')]==_0x74b0('0x91')){_0x4ab76a['queuecallerexitreason']='COMPLETED';logger[_0x74b0('0x77')](_0x74b0('0x93'),_0x4ab76a['name'],_0x4ab76a[_0x74b0('0x57')]);}else{if(_[_0x74b0('0x94')](_0xcafc5b[_0x74b0('0x95')][_0x74b0('0x96')](),_0x74b0('0x97'))){if(this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x98')]]){var _0xd51013=_[_0x74b0('0x7c')](this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x98')]]);_0xd51013[_0x74b0('0x7d')]=![];_0xd51013[_0x74b0('0x8f')]=!![];_0xd51013[_0x74b0('0x90')]=moment(_0x4ab76a[_0x74b0('0x71')])[_0x74b0('0x99')](_0xcafc5b[_0x74b0('0x7f')],_0x74b0('0x9a'))[_0x74b0('0x72')](_0x74b0('0x73'));_0xd51013[_0x74b0('0x81')]=_0x74b0('0x9b');_0xd51013[_0x74b0('0x91')]=!![];_0xd51013[_0x74b0('0x9c')]=_0x74b0('0x9d');_0xd51013[_0x74b0('0x9e')]=_0xcafc5b['destexten'];_0xd51013[_0x74b0('0x9f')]=_0xcafc5b['uniqueid'];logger[_0x74b0('0x77')](_0x74b0('0xa0'),_0xd51013[_0x74b0('0x4a')],_0xd51013['type']);var _0x661f2a=this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x98')]];this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x98')]]=this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x48')]];this[_0x74b0('0xd')][_0xcafc5b[_0x74b0('0x48')]]=_0x661f2a;}}else{_0x4ab76a[_0x74b0('0x81')]='COMPLETEDBY'+_0xcafc5b[_0x74b0('0x92')][_0x74b0('0xa1')]();logger[_0x74b0('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x4ab76a['name'],_0x4ab76a['type'],_0x4ab76a[_0x74b0('0x81')]);}}}this['channels'][_0xcafc5b[_0x74b0('0x48')]]=_0x4ab76a;this[_0x74b0('0x42')](_0x4ab76a,_0x74b0('0x1b'));}}}catch(_0x38ef7f){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0xcafc5b[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x38ef7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0xa2')]=function(_0x829bdb){try{if(this[_0x74b0('0x67')](_0x829bdb)){logger[_0x74b0('0x45')](_0x74b0('0xa3'),_0x829bdb[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x829bdb,{'showHidden':![],'depth':null}));this[_0x74b0('0xa4')](_0x829bdb['uniqueid'],_['keys'](_0x829bdb[_0x74b0('0xa5')])[0x0],_0x829bdb[_0x74b0('0xa6')]);if(this[_0x74b0('0xd')][_0x829bdb['uniqueid']]){var _0x52fc55=_['last'](this['queueReports'][_0x829bdb[_0x74b0('0x48')]]);if(_0x52fc55){if(this['isNotNull'](_0x829bdb['variable'])&&this['isNotNull'](_0x829bdb['variable'][_0x74b0('0xa7')])){switch(_0x829bdb[_0x74b0('0xa6')]){case _0x74b0('0xa8'):_0x52fc55[_0x74b0('0x8f')]=![];_0x52fc55[_0x74b0('0x90')]=null;break;case _0x74b0('0xa9'):_0x52fc55[_0x74b0('0xaa')]=_0x74b0('0xab');_0x52fc55[_0x74b0('0x8f')]=!![];_0x52fc55[_0x74b0('0x90')]=moment()['format'](_0x74b0('0x73'));_0x52fc55[_0x74b0('0x87')]=moment()['format'](_0x74b0('0x73'));logger['debug'](_0x74b0('0xac'),_0x829bdb[_0x74b0('0x48')],util['inspect'](_0x52fc55,{'showHidden':![],'depth':null}));ami[_0x74b0('0x44')]('custom:timeout',_0x52fc55);break;default:_0x52fc55[_0x74b0('0x8f')]=!![];_0x52fc55['queuecallerexitAt']=moment()[_0x74b0('0x72')](_0x74b0('0x73'));_0x52fc55[_0x74b0('0x87')]=moment()['format'](_0x74b0('0x73'));}_0x52fc55['queuecallerabandon']=![];_0x52fc55['queuecallerabandonAt']=null;_0x52fc55['queuecallerexitreason']=_0x829bdb[_0x74b0('0xa6')];this[_0x74b0('0xf')][_0x829bdb['uniqueid']]=_0x52fc55;this[_0x74b0('0x42')](_0x52fc55,_0x74b0('0x1f'));}else if(this[_0x74b0('0x67')](_0x829bdb[_0x74b0('0xa5')])&&this[_0x74b0('0x67')](_0x829bdb[_0x74b0('0xa5')][_0x74b0('0xad')])){if(!_0x52fc55[_0x74b0('0x84')]){_0x52fc55[_0x74b0('0x8f')]=!![];_0x52fc55[_0x74b0('0x90')]=moment()[_0x74b0('0x72')](_0x74b0('0x73'));_0x52fc55[_0x74b0('0x81')]=_0x74b0('0xae');_0x52fc55[_0x74b0('0x87')]=moment()[_0x74b0('0x72')](_0x74b0('0x73'));this[_0x74b0('0xf')][_0x829bdb['uniqueid']]=_0x52fc55;}}logger[_0x74b0('0x77')](_0x74b0('0xaf'),_0x829bdb['uniqueid'],_0x52fc55['name'],_0x52fc55['type'],_[_0x74b0('0x7a')](_0x829bdb['variable'])[0x0],_0x829bdb[_0x74b0('0xa6')]);_0x52fc55['variables']=this[_0x74b0('0xb0')][_0x829bdb[_0x74b0('0x48')]];}}}}catch(_0x52ec1a){logger['error'](_0x74b0('0xa3'),_0x829bdb[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x52ec1a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')]['addVariable']=function(_0x5e691d,_0x47015c,_0x1a4d7e){var _0x30c109=['rtpaudioqos',_0x74b0('0xb1'),_0x74b0('0xb2'),_0x74b0('0xb3'),_0x74b0('0xb4'),_0x74b0('0xb5'),'rtpaudioqosrtt',_0x74b0('0xb6'),_0x74b0('0xb7'),_0x74b0('0xb8'),_0x74b0('0xb9'),_0x74b0('0xba'),_0x74b0('0xbb'),'memberdynamic','memberinterface',_0x74b0('0xbc'),_0x74b0('0x8e'),'memberpenalty',_0x74b0('0xbd')];if(!_[_0x74b0('0x36')](_0x47015c)&&!_[_0x74b0('0xbe')](_0x30c109,_0x47015c)){if(_[_0x74b0('0x62')](this[_0x74b0('0xb0')][_0x5e691d])){this[_0x74b0('0xb0')][_0x5e691d]={};}this['variables'][_0x5e691d][_0x47015c]=_0x1a4d7e;}};VoiceQueueReport['prototype'][_0x74b0('0x20')]=function(_0x3c4cc4){try{if(this[_0x74b0('0x67')](_0x3c4cc4)){logger[_0x74b0('0x45')](_0x74b0('0xbf'),_0x3c4cc4[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x3c4cc4,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0x3c4cc4[_0x74b0('0x48')]]){for(var _0x1738d6=0x0,_0x95fe38={};_0x1738d6<this[_0x74b0('0xd')][_0x3c4cc4[_0x74b0('0x48')]][_0x74b0('0xc0')];_0x1738d6+=0x1){_0x95fe38=this['queueReports'][_0x3c4cc4[_0x74b0('0x48')]][_0x1738d6];if(this['voiceQueues'][_0x95fe38[_0x74b0('0x68')]]){if(_0x95fe38[_0x74b0('0x8f')]&&_0x95fe38[_0x74b0('0x91')]!=!![]){this['voiceQueues'][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x58')]+=0x1;}if(_0x95fe38[_0x74b0('0x84')]){this['voiceQueues'][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x59')]+=0x1;}this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]]['sumHoldTime']+=moment(_0x95fe38[_0x74b0('0x87')])[_0x74b0('0xc1')](_0x95fe38['queuecallerjoinAt'],_0x74b0('0x9a'))||0x0;if(_0x1738d6===this[_0x74b0('0xd')][_0x3c4cc4['uniqueid']][_0x74b0('0xc0')]-0x1){this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x54')]+=moment()[_0x74b0('0xc2')](0x0)['diff'](_0x95fe38[_0x74b0('0x71')],'seconds');this['voiceQueues'][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x56')]+=0x1;if(_0x95fe38['queuecallercomplete']){this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]]['answered']+=0x1;this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x53')]+=moment()[_0x74b0('0xc2')](0x0)[_0x74b0('0xc1')](_0x95fe38[_0x74b0('0x87')],_0x74b0('0x9a'));_0x95fe38[_0x74b0('0x7e')]=moment()['format'](_0x74b0('0x73'));_0x95fe38['queuecallerexit']=![];_0x95fe38['queuecallerexitAt']=null;}if(_0x95fe38[_0x74b0('0x8f')]&&_0x95fe38['transfer']!=!![]){_0x95fe38['lastevent']='unmanaged';logger[_0x74b0('0x45')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x3c4cc4['uniqueid'],util[_0x74b0('0x3c')](_0x95fe38,{'showHidden':![],'depth':null}));ami[_0x74b0('0x44')](_0x74b0('0xc3'),_0x95fe38);}if(_0x95fe38['queuecallerabandon']){_0x95fe38[_0x74b0('0xaa')]=_0x74b0('0x59');logger['debug'](_0x74b0('0xc4'),_0x3c4cc4[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x95fe38,{'showHidden':![],'depth':null}));ami[_0x74b0('0x44')](_0x74b0('0xc5'),_0x95fe38);}}else{this['voiceQueues'][_0x95fe38[_0x74b0('0x68')]]['sumDuration']+=this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]][_0x74b0('0x55')];}logger[_0x74b0('0x77')](_0x74b0('0xc6'),_0x3c4cc4[_0x74b0('0x48')],_0x95fe38[_0x74b0('0x4a')],_0x95fe38['type'],_0x3c4cc4[_0x74b0('0xc7')]);this['channels'][_0x3c4cc4[_0x74b0('0x48')]]=_0x95fe38;this[_0x74b0('0x42')](_0x95fe38,_0x74b0('0xc8'));this['emitVoiceQueueSummary'](this[_0x74b0('0x11')][_0x95fe38[_0x74b0('0x68')]],_0x74b0('0xc8'));}}logger[_0x74b0('0x45')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x3c4cc4[_0x74b0('0x48')],util[_0x74b0('0x3c')](this[_0x74b0('0xd')][_0x3c4cc4[_0x74b0('0x48')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceQueueReport',this['queueReports'][_0x3c4cc4[_0x74b0('0x48')]]);delete this['queueReports'][_0x3c4cc4[_0x74b0('0x48')]];delete this[_0x74b0('0xf')][_0x3c4cc4[_0x74b0('0x48')]];}if(this[_0x74b0('0xb0')][_0x3c4cc4['uniqueid']]){delete this[_0x74b0('0xb0')][_0x3c4cc4[_0x74b0('0x48')]];}}}catch(_0x3ca532){logger[_0x74b0('0x3d')](_0x74b0('0xbf'),_0x3c4cc4['uniqueid'],util[_0x74b0('0x3c')](_0x3ca532,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74b0('0x28')]=function(_0x18ce78){try{if(this[_0x74b0('0x67')](_0x18ce78)){logger['debug'](_0x74b0('0xc9'),_0x18ce78['uniqueid'],util[_0x74b0('0x3c')](_0x18ce78,{'showHidden':![],'depth':null}));var _0x652418;if(this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xca')]]){_0x652418=_['last'](this[_0x74b0('0xd')][_0x18ce78['transfereeuniqueid']]);_0x652418[_0x74b0('0x9e')]=_0x18ce78[_0x74b0('0xcb')];_0x652418['transferuniqueid']=_0x18ce78[_0x74b0('0xcc')];_0x652418[_0x74b0('0x81')]=_0x74b0('0xcd');_0x652418[_0x74b0('0x91')]=!![];_0x652418[_0x74b0('0x9c')]=_0x74b0('0xce');if(this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xcc')]]){var _0x5e653a=this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xcc')]];this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xcc')]]=this['queueReports'][_0x18ce78[_0x74b0('0xca')]];this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xca')]]=_0x5e653a;var _0x13434b=_[_0x74b0('0x7c')](this['queueReports'][_0x18ce78[_0x74b0('0xca')]]);_0x13434b['switch']=!![];}logger[_0x74b0('0x77')](_0x74b0('0xcf'),_0x18ce78[_0x74b0('0x48')],_0x652418[_0x74b0('0x4a')],_0x652418['type'],_0x652418[_0x74b0('0x9e')],_0x652418[_0x74b0('0x9f')]);}else if(this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xd0')]]){_0x652418=_['last'](this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xd0')]]);_0x652418[_0x74b0('0x9e')]=_0x18ce78[_0x74b0('0xd1')];_0x652418[_0x74b0('0x9f')]=_0x18ce78[_0x74b0('0xd2')];_0x652418[_0x74b0('0x81')]=_0x74b0('0xcd');_0x652418[_0x74b0('0x91')]=!![];_0x652418[_0x74b0('0x9c')]='ATTENDED';if(this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xd2')]]){var _0x5e653a=this['queueReports'][_0x18ce78[_0x74b0('0xd2')]];this[_0x74b0('0xd')][_0x18ce78['origtransfereruniqueid']]=this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xd0')]];this['queueReports'][_0x18ce78[_0x74b0('0xd0')]]=_0x5e653a;var _0x13434b=_[_0x74b0('0x7c')](this[_0x74b0('0xd')][_0x18ce78[_0x74b0('0xd0')]]);_0x13434b['switch']=!![];}logger[_0x74b0('0x77')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x18ce78[_0x74b0('0x48')],_0x652418[_0x74b0('0x4a')],_0x652418['type'],_0x652418[_0x74b0('0x9e')],_0x652418[_0x74b0('0x9f')]);}}}catch(_0x5d4701){logger[_0x74b0('0x3d')]('[%s][voiceQueueReport][attendedtransfer]',_0x18ce78[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x5d4701,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncBlindTransfer']=function(_0x5beddf){try{if(this[_0x74b0('0x67')](_0x5beddf)){logger[_0x74b0('0x45')](_0x74b0('0xd3'),_0x5beddf[_0x74b0('0x48')],util['inspect'](_0x5beddf,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0x5beddf['transfereeuniqueid']]){var _0x1623cc=_[_0x74b0('0x7c')](this['queueReports'][_0x5beddf['transfereeuniqueid']]);_0x1623cc[_0x74b0('0x81')]=_0x74b0('0xd4');_0x1623cc[_0x74b0('0x91')]=!![];_0x1623cc['transfertype']=_0x74b0('0xd5');_0x1623cc[_0x74b0('0x9e')]=_0x5beddf[_0x74b0('0xd6')];_0x1623cc[_0x74b0('0x9f')]=_0x5beddf[_0x74b0('0xca')];logger[_0x74b0('0x77')](_0x74b0('0xd7'),_0x5beddf[_0x74b0('0x48')],_0x1623cc[_0x74b0('0x4a')],_0x1623cc['type'],_0x1623cc['transferexten'],_0x1623cc[_0x74b0('0x9f')]);this[_0x74b0('0x20')]({'event':_0x74b0('0xd8'),'uniqueid':_0x5beddf[_0x74b0('0xca')],'context':_0x5beddf[_0x74b0('0xd9')],'channel':_0x5beddf[_0x74b0('0xda')]});}}}catch(_0x51612f){logger[_0x74b0('0x3d')]('[%s][voiceQueueReport][blindtransfer]',_0x5beddf[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x51612f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x74b0('0x25')]=function(_0x20137c){try{if(this['isNotNull'](_0x20137c)){logger['debug'](_0x74b0('0xdb'),_0x20137c[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x20137c,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0x20137c['uniqueid']]){var _0x52a69b=_['last'](this['queueReports'][_0x20137c[_0x74b0('0x48')]]);if(!_[_0x74b0('0x36')](_0x52a69b[_0x74b0('0x87')])){_0x52a69b['mohstarttime']=moment()[_0x74b0('0x72')](_0x74b0('0x73'));logger['info'](_0x74b0('0xdc'),_0x20137c[_0x74b0('0x48')],_0x52a69b['mohstarttime']);}}}}catch(_0x20f0e6){logger['error'](_0x74b0('0xdb'),_0x20137c['uniqueid'],util[_0x74b0('0x3c')](_0x20f0e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0x26')]=function(_0x17bfaf){try{if(this['isNotNull'](_0x17bfaf)){logger[_0x74b0('0x45')]('[%s][voiceQueueReport][musiconholdstop]',_0x17bfaf[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x17bfaf,{'showHidden':![],'depth':null}));if(this[_0x74b0('0xd')][_0x17bfaf[_0x74b0('0x48')]]){var _0x4ba727=_[_0x74b0('0x7c')](this[_0x74b0('0xd')][_0x17bfaf[_0x74b0('0x48')]]);if(!_['isNil'](_0x4ba727[_0x74b0('0xdd')])){_0x4ba727[_0x74b0('0xde')]+=moment()['milliseconds'](0x0)[_0x74b0('0xc1')](_0x4ba727[_0x74b0('0xdd')],_0x74b0('0x9a'));logger['info'](_0x74b0('0xdf'),_0x17bfaf['uniqueid'],_0x4ba727[_0x74b0('0xde')]);delete _0x4ba727['mohstarttime'];}}}}catch(_0x40bba2){logger[_0x74b0('0x3d')](_0x74b0('0xe0'),_0x17bfaf[_0x74b0('0x48')],util[_0x74b0('0x3c')](_0x40bba2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x74b0('0x3f')][_0x74b0('0xe1')]=function(_0x2edd85){try{if(this['isNotNull'](_0x2edd85)){logger[_0x74b0('0x45')]('[%s][voiceQueueReport][newexten]\x20event:',_0x2edd85[_0x74b0('0x48')],util['inspect'](_0x2edd85,{'showHidden':![],'depth':null}));if(_0x2edd85['application'][_0x74b0('0x96')]()===_0x74b0('0xe2')){_0x2edd85['applicationdata']=_0x2edd85[_0x74b0('0xe3')]&&_0x2edd85[_0x74b0('0xe3')][_0x74b0('0x94')](_0x74b0('0xe4'))?_0x2edd85[_0x74b0('0xe3')]:(_0x2edd85[_0x74b0('0xe3')]||_0x2edd85['applicationdata'])[_0x74b0('0x96')]();if(_[_0x74b0('0x94')](_0x2edd85['applicationdata']['toLowerCase'](),'cdr(')){logger['info'](_0x74b0('0xe5'),_0x2edd85[_0x74b0('0x48')],_0x2edd85[_0x74b0('0xe6')],_0x2edd85[_0x74b0('0xe7')]);if(_['isUndefined'](this[_0x74b0('0xf')][_0x2edd85[_0x74b0('0x48')]]))this[_0x74b0('0xf')][_0x2edd85[_0x74b0('0x48')]]={};var _0x1b8cc9=_0x2edd85[_0x74b0('0xe7')][_0x74b0('0xe8')]('=');var _0x49e788=_0x1b8cc9[0x0][_0x74b0('0x96')]()['match'](/cdr\((.*)\)/);if(_0x49e788)this['channels'][_0x2edd85[_0x74b0('0x48')]][_0x49e788[0x1]]=_0x1b8cc9[0x1];}}}}catch(_0x4549a3){logger[_0x74b0('0x3d')]('[%s][voiceQueueReport][newexten]',_0x2edd85[_0x74b0('0x48')],util['inspect'](_0x4549a3,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
index f69a080..5cc5d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9235=['createHistory','campaign','queue','CreateReportAgentPreview','../client'];(function(_0x2a4291,_0x53bdd8){var _0xf91cbe=function(_0x3e2a54){while(--_0x3e2a54){_0x2a4291['push'](_0x2a4291['shift']());}};_0xf91cbe(++_0x53bdd8);}(_0x9235,0xcc));var _0x5923=function(_0x3da485,_0x15d14f){_0x3da485=_0x3da485-0x0;var _0x5b3bbf=_0x9235[_0x3da485];return _0x5b3bbf;};'use strict';var client=require(_0x5923('0x0'));exports[_0x5923('0x1')]=function(_0x308cb8){return function(){_0x308cb8[_0x5923('0x2')]=_0x308cb8[_0x5923('0x3')];return client['Request']('CreateReportAgentPreview',{'body':_0x308cb8,'log':_0x5923('0x4')});};};
\ No newline at end of file
+var _0x9d36=['../client','campaign','queue','Request','CreateReportAgentPreview'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9d36,0x1b3));var _0x69d3=function(_0x50453d,_0x5d7396){_0x50453d=_0x50453d-0x0;var _0xd1270b=_0x9d36[_0x50453d];return _0xd1270b;};'use strict';var client=require(_0x69d3('0x0'));exports['createHistory']=function(_0xdcd660){return function(){_0xdcd660[_0x69d3('0x1')]=_0xdcd660[_0x69d3('0x2')];return client[_0x69d3('0x3')]('CreateReportAgentPreview',{'body':_0xdcd660,'log':_0x69d3('0x4')});};};
\ No newline at end of file
index 8487ee8..02d3628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d7e=['create','Request','CreateAttachment','../client'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x1d7e,0x1db));var _0xe1d7=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x1d7e[_0xd1d19a];return _0x52a79d;};'use strict';var client=require(_0xe1d7('0x0'));exports[_0xe1d7('0x1')]=function(_0x42b113){return client[_0xe1d7('0x2')](_0xe1d7('0x3'),{'body':_0x42b113,'log':_0xe1d7('0x3')});};
\ No newline at end of file
+var _0x6bc9=['Request','CreateAttachment','../client','create'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x6bc9,0x1c2));var _0x96bc=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x6bc9[_0x2b55b5];return _0x103d28;};'use strict';var client=require(_0x96bc('0x0'));exports[_0x96bc('0x1')]=function(_0x5cd0d9){return client[_0x96bc('0x2')](_0x96bc('0x3'),{'body':_0x5cd0d9,'log':_0x96bc('0x3')});};
\ No newline at end of file
index d04ce7c..9a8269b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','Trunk','callerid','TrunkBackup','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','GetCampaign','name','type','active','limitCalls'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2deff5,_0x4c28f0){_0x2deff5=_0x2deff5-0x0;var _0x3efd3c=_0x5f2f[_0x2deff5];return _0x3efd3c;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'dialNoAnswerRetryFrequency',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'dialDropMaxRetry',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'dialMachineMaxRetry',_0xf5f2('0x14'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xf5f2('0x15'),_0xf5f2('0x16'),'dialAMDActive',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'dialAMDMaximumNumberOfWords',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21'),'dialCutDigit'],'include':[{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x22'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x22'),'as':_0xf5f2('0x24'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x23'),_0xf5f2('0x6')]},{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x25'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x25'),'as':_0xf5f2('0x26'),'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x27')]}]},{'model':'SquareProject','as':_0xf5f2('0x28'),'attributes':['id',_0xf5f2('0x4')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0x2ef3,0xba));var _0x32ef=function(_0x8039a8,_0x352488){_0x8039a8=_0x8039a8-0x0;var _0x3cde88=_0x2ef3[_0x8039a8];return _0x3cde88;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
index 477fcd0..98965d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a24=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x3f028e,_0x47a4a6){var _0x51be31=function(_0x2482fb){while(--_0x2482fb){_0x3f028e['push'](_0x3f028e['shift']());}};_0x51be31(++_0x47a4a6);}(_0x1a24,0x80));var _0x41a2=function(_0x983dc2,_0x5cca11){_0x983dc2=_0x983dc2-0x0;var _0x4b0315=_0x1a24[_0x983dc2];return _0x4b0315;};'use strict';var client=require(_0x41a2('0x0'));exports[_0x41a2('0x1')]=function(_0x4bf308){return function(){return client[_0x41a2('0x2')](_0x41a2('0x3'),{'body':_0x4bf308,'log':_0x41a2('0x3')});};};exports[_0x41a2('0x4')]=function(_0x3d9c82){return function(){return client['Request'](_0x41a2('0x5'),{'options':_0x3d9c82,'log':_0x41a2('0x5')});};};
\ No newline at end of file
+var _0xeab3=['getContacts','GetCmContact','createContact','Request','CreateCmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeab3,0xd9));var _0x3eab=function(_0x10d244,_0x49c680){_0x10d244=_0x10d244-0x0;var _0x67755d=_0xeab3[_0x10d244];return _0x67755d;};'use strict';var client=require('../client');exports[_0x3eab('0x0')]=function(_0x3a3ae0){return function(){return client[_0x3eab('0x1')](_0x3eab('0x2'),{'body':_0x3a3ae0,'log':_0x3eab('0x2')});};};exports[_0x3eab('0x3')]=function(_0x4a727e){return function(){return client['Request'](_0x3eab('0x4'),{'options':_0x4a727e,'log':_0x3eab('0x4')});};};
\ No newline at end of file
index 0abcff2..0271f17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79e8=['UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','CampaignId','DestroyCmHopper','getContactDialer','format','priority','DESC','ASC','GetContactDialer','getContactDialerIvr','CmContact','scheduledat','GetContactDialerIvr','moveContactManagedDialer','VoiceQueueId','MoveContactManagedDialer','countReScheduled','getContactPreview','User','Agent','name','VoiceQueue','Queue','getContactRecallMe','moment','getContacts','Contact','getCmHopper','updateContacts','Request'];(function(_0x49e734,_0xc04f4f){var _0x2a2d42=function(_0x564e55){while(--_0x564e55){_0x49e734['push'](_0x49e734['shift']());}};_0x2a2d42(++_0xc04f4f);}(_0x79e8,0x1b4));var _0x879e=function(_0x675003,_0x279152){_0x675003=_0x675003-0x0;var _0x1a8959=_0x79e8[_0x675003];return _0x1a8959;};'use strict';var client=require('../client');var moment=require(_0x879e('0x0'));var _=require('lodash');exports[_0x879e('0x1')]=function(_0x1c46be,_0x2a5b92){return function(){return client['Request']('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x1c46be},'include':[{'model':'CmContact','as':_0x879e('0x2')}],'limit':_0x2a5b92,'raw':![]},'log':_0x879e('0x3')});};};exports[_0x879e('0x4')]=function(_0x42ee31,_0x1f95a5,_0x6c384e){return function(){return client[_0x879e('0x5')](_0x879e('0x6'),{'body':_0x42ee31,'options':{'where':{'VoiceQueueId':_0x1f95a5,'scheduledat':{'$lte':moment()['format'](_0x879e('0x7'))}},'limit':_0x6c384e},'log':_0x879e('0x6')});};};exports[_0x879e('0x8')]=function(_0x2032cb){return function(){return client['Request'](_0x879e('0x6'),{'body':_0x2032cb,'options':{'where':{'ContactId':_0x2032cb[_0x879e('0x9')],'ListId':_0x2032cb[_0x879e('0xa')],'VoiceQueueId':_0x2032cb['VoiceQueueId'],'CampaignId':_0x2032cb[_0x879e('0xb')]}},'log':'rescheduleContact'});};};exports['destroyContact']=function(_0x3c517a,_0x540573,_0x3427e3){return function(){return client[_0x879e('0x5')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x3c517a,'ListId':_0x540573,'ContactId':_0x3427e3}},'log':_0x879e('0xc')});};};exports[_0x879e('0xd')]=function(_0x22dd9f,_0x5ecb60,_0x537cb3,_0x1da703){return function(){return client[_0x879e('0x5')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x22dd9f,'active':![],'scheduledat':{'$lte':moment()[_0x879e('0xe')](_0x879e('0x7'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x5ecb60}}]},'order':[[_0x879e('0xf'),_0x879e('0x10')],['scheduledat',_0x1da703],['id',_0x879e('0x11')]],'raw':!![],'limit':_0x537cb3},'log':_0x879e('0x12')});};};exports[_0x879e('0x13')]=function(_0x13b868,_0x5dfe4e,_0x15c876){return function(){return client['Request'](_0x879e('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x13b868,'active':![],'scheduledat':{'$lte':moment()[_0x879e('0xe')](_0x879e('0x7'))}},'include':[{'model':_0x879e('0x14'),'as':'Contact'}],'order':[[_0x879e('0xf'),_0x879e('0x10')],[_0x879e('0x15'),_0x15c876],['id',_0x879e('0x11')]],'raw':!![],'limit':_0x5dfe4e},'log':_0x879e('0x16')});};};exports[_0x879e('0x17')]=function(_0x3cbb5e,_0x3f5298){return function(){_0x3cbb5e['campaign']=_0x3cbb5e['queue'];return client[_0x879e('0x5')]('MoveContactManagedDialer',{'body':_0x3cbb5e,'options':{'where':{'ContactId':_0x3cbb5e[_0x879e('0x9')],'ListId':_0x3cbb5e[_0x879e('0xa')],'VoiceQueueId':_0x3cbb5e[_0x879e('0x18')],'CampaignId':_0x3cbb5e[_0x879e('0xb')],'active':_0x3f5298?undefined:!![]}},'log':_0x879e('0x19')});};};exports[_0x879e('0x1a')]=function(_0x5d11b7){return function(){return client[_0x879e('0x5')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x5d11b7['id']?_0x5d11b7['id']||null:null}},'log':'countReScheduled'});};};exports[_0x879e('0x1b')]=function(_0x2bc442){return function(){return client['Request']('GetCmHopperPreview',{'options':{'where':{'id':_0x2bc442},'include':[{'model':'CmContact','as':_0x879e('0x2')},{'model':_0x879e('0x1c'),'as':_0x879e('0x1d'),'attributes':['id',_0x879e('0x1e')]},{'model':_0x879e('0x1f'),'as':_0x879e('0x20'),'attributes':['id','name']}],'raw':!![]},'log':_0x879e('0x3')});};};exports['unlockContact']=function(_0x2ae1e0,_0x40423e,_0x26d40d){return function(){return client[_0x879e('0x5')](_0x879e('0x6'),{'body':_0x2ae1e0,'options':{'where':{'id':_0x40423e},'limit':_0x26d40d},'log':'UpdateCmHopper'});};};exports[_0x879e('0x21')]=function(_0x23bad1,_0x43c8e8){return function(){return client[_0x879e('0x5')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x23bad1,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x879e('0x7'))},'UserId':{'$in':_0x43c8e8}},'order':[[_0x879e('0xf'),'DESC'],[_0x879e('0x15'),_0x879e('0x10')],['id','ASC']],'include':[{'model':_0x879e('0x14'),'as':_0x879e('0x2')},{'model':_0x879e('0x1c'),'as':'Agent','attributes':['id','name','voicePause']}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x879e('0x12')});};};
\ No newline at end of file
+var _0xebe1=['GetContactRecallMe','User','voicePause','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','rescheduleContact','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','GetContactDialer','getContactDialerIvr','ASC','moveContactManagedDialer','campaign','MoveContactManagedDialer','ListId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','Agent','name','VoiceQueue'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xebe1,0x159));var _0x1ebe=function(_0x4e4489,_0x297c93){_0x4e4489=_0x4e4489-0x0;var _0x728f66=_0xebe1[_0x4e4489];return _0x728f66;};'use strict';var client=require(_0x1ebe('0x0'));var moment=require(_0x1ebe('0x1'));var _=require(_0x1ebe('0x2'));exports[_0x1ebe('0x3')]=function(_0x4100c6,_0x5108ba){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0x5'),{'options':{'where':{'VoiceQueueId':_0x4100c6},'include':[{'model':_0x1ebe('0x6'),'as':_0x1ebe('0x7')}],'limit':_0x5108ba,'raw':![]},'log':_0x1ebe('0x8')});};};exports['updateContacts']=function(_0x33284f,_0xdb803b,_0x21e7e5){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0x9'),{'body':_0x33284f,'options':{'where':{'VoiceQueueId':_0xdb803b,'scheduledat':{'$lte':moment()[_0x1ebe('0xa')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x21e7e5},'log':_0x1ebe('0x9')});};};exports[_0x1ebe('0xb')]=function(_0x3b5e18){return function(){return client[_0x1ebe('0x4')]('UpdateCmHopper',{'body':_0x3b5e18,'options':{'where':{'ContactId':_0x3b5e18['ContactId'],'ListId':_0x3b5e18['ListId'],'VoiceQueueId':_0x3b5e18[_0x1ebe('0xc')],'CampaignId':_0x3b5e18[_0x1ebe('0xd')]}},'log':_0x1ebe('0xb')});};};exports[_0x1ebe('0xe')]=function(_0x582efd,_0x3a430f,_0x38e985){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0xf'),{'options':{'where':{'VoiceQueueId':_0x582efd,'ListId':_0x3a430f,'ContactId':_0x38e985}},'log':_0x1ebe('0xf')});};};exports[_0x1ebe('0x10')]=function(_0x902adb,_0x3f8dcb,_0x19d376,_0x161c21){return function(){return client[_0x1ebe('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x902adb,'active':![],'scheduledat':{'$lte':moment()['format'](_0x1ebe('0x11'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x3f8dcb}}]},'order':[[_0x1ebe('0x12'),_0x1ebe('0x13')],[_0x1ebe('0x14'),_0x161c21],['id','ASC']],'raw':!![],'limit':_0x19d376},'log':_0x1ebe('0x15')});};};exports[_0x1ebe('0x16')]=function(_0x17a403,_0x1780dc,_0x518923){return function(){return client[_0x1ebe('0x4')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x17a403,'active':![],'scheduledat':{'$lte':moment()['format'](_0x1ebe('0x11'))}},'include':[{'model':_0x1ebe('0x6'),'as':_0x1ebe('0x7')}],'order':[['priority','DESC'],['scheduledat',_0x518923],['id',_0x1ebe('0x17')]],'raw':!![],'limit':_0x1780dc},'log':'GetContactDialerIvr'});};};exports[_0x1ebe('0x18')]=function(_0x566ee1,_0x257712){return function(){_0x566ee1[_0x1ebe('0x19')]=_0x566ee1['queue'];return client['Request'](_0x1ebe('0x1a'),{'body':_0x566ee1,'options':{'where':{'ContactId':_0x566ee1['ContactId'],'ListId':_0x566ee1[_0x1ebe('0x1b')],'VoiceQueueId':_0x566ee1[_0x1ebe('0xc')],'CampaignId':_0x566ee1[_0x1ebe('0xd')],'active':_0x257712?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x1ebe('0x1c')]=function(_0x5e46ca){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0x1d'),{'options':{'where':{'VoiceQueueId':_0x5e46ca['id']?_0x5e46ca['id']||null:null}},'log':_0x1ebe('0x1c')});};};exports[_0x1ebe('0x1e')]=function(_0x2bacee){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0x1f'),{'options':{'where':{'id':_0x2bacee},'include':[{'model':'CmContact','as':'Contact'},{'model':'User','as':_0x1ebe('0x20'),'attributes':['id',_0x1ebe('0x21')]},{'model':_0x1ebe('0x22'),'as':'Queue','attributes':['id',_0x1ebe('0x21')]}],'raw':!![]},'log':_0x1ebe('0x8')});};};exports['unlockContact']=function(_0x5d9827,_0x3bebfd,_0x2f8669){return function(){return client['Request'](_0x1ebe('0x9'),{'body':_0x5d9827,'options':{'where':{'id':_0x3bebfd},'limit':_0x2f8669},'log':_0x1ebe('0x9')});};};exports['getContactRecallMe']=function(_0x44dab6,_0x298016){return function(){return client[_0x1ebe('0x4')](_0x1ebe('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x44dab6,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x1ebe('0xa')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x298016}},'order':[['priority','DESC'],[_0x1ebe('0x14'),_0x1ebe('0x13')],['id',_0x1ebe('0x17')]],'include':[{'model':'CmContact','as':_0x1ebe('0x7')},{'model':_0x1ebe('0x24'),'as':'Agent','attributes':['id','name',_0x1ebe('0x25')]}],'group':'db.CmHopper.UserId','raw':!![]},'log':_0x1ebe('0x15')});};};
\ No newline at end of file
index 3391d9d..d6aed74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96cc=['phone','checkIsBlackListIvr','Request','GetCmHopperBlackIvr','../client','GetCmHopperBlack','VoiceQueueId','Contact'];(function(_0x2b8722,_0x50d540){var _0x20c180=function(_0x595b40){while(--_0x595b40){_0x2b8722['push'](_0x2b8722['shift']());}};_0x20c180(++_0x50d540);}(_0x96cc,0x16c));var _0xc96c=function(_0x3e9493,_0x3fce26){_0x3e9493=_0x3e9493-0x0;var _0x4de6f3=_0x96cc[_0x3e9493];return _0x4de6f3;};'use strict';var client=require(_0xc96c('0x0'));exports['checkIsBlackList']=function(_0x15025f){return function(){return client['Request'](_0xc96c('0x1'),{'options':{'where':{'VoiceQueueId':_0x15025f[_0xc96c('0x2')],'phone':_0x15025f[_0xc96c('0x3')][_0xc96c('0x4')]},'raw':![]},'log':_0xc96c('0x1')});};};exports[_0xc96c('0x5')]=function(_0x377e6c){return function(){return client[_0xc96c('0x6')](_0xc96c('0x1'),{'options':{'where':{'CampaignId':_0x377e6c['CampaignId'],'phone':_0x377e6c[_0xc96c('0x3')][_0xc96c('0x4')]},'raw':![]},'log':_0xc96c('0x7')});};};
\ No newline at end of file
+var _0xefda=['GetCmHopperBlack','Contact','phone','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','Request'];(function(_0x2a7c15,_0x4a9e70){var _0x57b2ff=function(_0x74177c){while(--_0x74177c){_0x2a7c15['push'](_0x2a7c15['shift']());}};_0x57b2ff(++_0x4a9e70);}(_0xefda,0x96));var _0xaefd=function(_0x54698c,_0x249a74){_0x54698c=_0x54698c-0x0;var _0x20bb37=_0xefda[_0x54698c];return _0x20bb37;};'use strict';var client=require(_0xaefd('0x0'));exports['checkIsBlackList']=function(_0x4d8f17){return function(){return client[_0xaefd('0x1')](_0xaefd('0x2'),{'options':{'where':{'VoiceQueueId':_0x4d8f17['VoiceQueueId'],'phone':_0x4d8f17[_0xaefd('0x3')][_0xaefd('0x4')]},'raw':![]},'log':_0xaefd('0x2')});};};exports[_0xaefd('0x5')]=function(_0x1ef6b4){return function(){return client[_0xaefd('0x1')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x1ef6b4[_0xaefd('0x6')],'phone':_0x1ef6b4[_0xaefd('0x3')][_0xaefd('0x4')]},'raw':![]},'log':_0xaefd('0x7')});};};
\ No newline at end of file
index 5cbb8f3..4cc932e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ad=['queue','Request','CreateCmHopperFinal','../client','campaign'];(function(_0x4eac75,_0x315a23){var _0x5d862f=function(_0x3ba652){while(--_0x3ba652){_0x4eac75['push'](_0x4eac75['shift']());}};_0x5d862f(++_0x315a23);}(_0x77ad,0x175));var _0xd77a=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x77ad[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0xd77a('0x0'));exports['createContact']=function(_0x52019c){return function(){_0x52019c[_0xd77a('0x1')]=_0x52019c[_0xd77a('0x2')];return client[_0xd77a('0x3')](_0xd77a('0x4'),{'body':_0x52019c,'log':_0xd77a('0x4')});};};
\ No newline at end of file
+var _0x4f1a=['../client','queue','CreateCmHopperFinal'];(function(_0x2a5363,_0x8f35cb){var _0x5823f8=function(_0x46ba04){while(--_0x46ba04){_0x2a5363['push'](_0x2a5363['shift']());}};_0x5823f8(++_0x8f35cb);}(_0x4f1a,0x10e));var _0xa4f1=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0x4f1a[_0x41cb4b];return _0x1719c1;};'use strict';var client=require(_0xa4f1('0x0'));exports['createContact']=function(_0x1c2110){return function(){_0x1c2110['campaign']=_0x1c2110[_0xa4f1('0x1')];return client['Request'](_0xa4f1('0x2'),{'body':_0x1c2110,'log':_0xa4f1('0x2')});};};
\ No newline at end of file
index 8dca7a0..6425a15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b32=['subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','ivr','GetCampaignHopperHistory','../client','moment','createHistory','campaign','queue','CreateCmHopperHistory','avgHandleTime','Request','AvgHandleTime'];(function(_0x2b3410,_0x7ae999){var _0x3d0683=function(_0x206710){while(--_0x206710){_0x2b3410['push'](_0x2b3410['shift']());}};_0x3d0683(++_0x7ae999);}(_0x1b32,0x8a));var _0x21b3=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x1b32[_0x500419];return _0x241c1a;};'use strict';var client=require(_0x21b3('0x0'));var moment=require(_0x21b3('0x1'));exports[_0x21b3('0x2')]=function(_0x5aba28){return function(){_0x5aba28[_0x21b3('0x3')]=_0x5aba28[_0x21b3('0x4')];return client['Request'](_0x21b3('0x5'),{'body':_0x5aba28,'log':'CreateCmHopperHistory'});};};exports[_0x21b3('0x6')]=function(_0x489fef){return function(){return client[_0x21b3('0x7')](_0x21b3('0x8'),{'options':{'where':{'endtime':{'$between':[moment()[_0x21b3('0x9')](_0x489fef,_0x21b3('0xa'))[_0x21b3('0xb')](_0x21b3('0xc')),moment()[_0x21b3('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0x21b3('0xd')});};};exports['getVoiceQueueHopperHistory']=function(_0x508863){return function(){return client[_0x21b3('0x7')](_0x21b3('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x21b3('0xf')](_0x21b3('0x10'))[_0x21b3('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x21b3('0x11')](_0x21b3('0x10'))[_0x21b3('0xb')](_0x21b3('0xc'))]},'campaigntype':'queue'},'raw':![]},'log':_0x21b3('0xe')});};};exports[_0x21b3('0x12')]=function(_0x544f9b){return function(){return client[_0x21b3('0x7')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x21b3('0x10'))[_0x21b3('0xb')](_0x21b3('0xc')),moment()[_0x21b3('0x11')](_0x21b3('0x10'))[_0x21b3('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x21b3('0x13')},'raw':![]},'log':_0x21b3('0x14')});};};
\ No newline at end of file
+var _0x8bf0=['minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day','endOf','queue','GetCampaignHopperHistory','startOf','ivr','../client','moment','createHistory','Request','avgHandleTime','AvgHandleTime','subtract'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8bf0,0x1e7));var _0x08bf=function(_0x565866,_0x55bc1f){_0x565866=_0x565866-0x0;var _0x4327c4=_0x8bf0[_0x565866];return _0x4327c4;};'use strict';var client=require(_0x08bf('0x0'));var moment=require(_0x08bf('0x1'));exports[_0x08bf('0x2')]=function(_0xead4fc){return function(){_0xead4fc['campaign']=_0xead4fc['queue'];return client[_0x08bf('0x3')]('CreateCmHopperHistory',{'body':_0xead4fc,'log':'CreateCmHopperHistory'});};};exports[_0x08bf('0x4')]=function(_0x3de51a){return function(){return client[_0x08bf('0x3')](_0x08bf('0x5'),{'options':{'where':{'endtime':{'$between':[moment()[_0x08bf('0x6')](_0x3de51a,_0x08bf('0x7'))[_0x08bf('0x8')](_0x08bf('0x9')),moment()['format'](_0x08bf('0x9'))]}},'raw':![]},'log':_0x08bf('0xa')});};};exports[_0x08bf('0xb')]=function(_0x1fd3a6){return function(){return client[_0x08bf('0x3')](_0x08bf('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x08bf('0xd'))[_0x08bf('0x8')](_0x08bf('0x9')),moment()[_0x08bf('0xe')](_0x08bf('0xd'))[_0x08bf('0x8')](_0x08bf('0x9'))]},'campaigntype':_0x08bf('0xf')},'raw':![]},'log':_0x08bf('0xc')});};};exports['getCampaignHopperHistory']=function(_0x18833b){return function(){return client[_0x08bf('0x3')](_0x08bf('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x08bf('0x11')](_0x08bf('0xd'))[_0x08bf('0x8')](_0x08bf('0x9')),moment()[_0x08bf('0xe')](_0x08bf('0xd'))[_0x08bf('0x8')](_0x08bf('0x9'))]},'campaigntype':_0x08bf('0x12')},'raw':![]},'log':_0x08bf('0x10')});};};
\ No newline at end of file
index 8c03a7d..5a90eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fcd=['modem','gateway','tech','ListId','key','Trunk','active','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','headerinfo','localstationid','minrate','maxrate'];(function(_0x66571d,_0x2ed1c6){var _0x2bbbe3=function(_0x496bb5){while(--_0x496bb5){_0x66571d['push'](_0x66571d['shift']());}};_0x2bbbe3(++_0x2ed1c6);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x209c01,_0x43f4f7){_0x209c01=_0x209c01-0x0;var _0x2bf633=_0x8fcd[_0x209c01];return _0x2bf633;};'use strict';var client=require(_0xd8fc('0x0'));exports[_0xd8fc('0x1')]=function(){return function(){return client[_0xd8fc('0x2')](_0xd8fc('0x3'),{'options':{'raw':![],'attributes':['id',_0xd8fc('0x4'),'description','ecm',_0xd8fc('0x5'),_0xd8fc('0x6'),_0xd8fc('0x7'),_0xd8fc('0x8'),_0xd8fc('0x9'),_0xd8fc('0xa'),'faxdetect','t38timeout',_0xd8fc('0xb'),'TrunkId',_0xd8fc('0xc'),_0xd8fc('0xd')],'include':[{'model':_0xd8fc('0xe'),'as':_0xd8fc('0xe'),'attributes':['id','name','callerid',_0xd8fc('0xf')]}]},'log':'getFaxAccount'});};};exports['notify']=function(_0x1a1927,_0x121b64){return client['Request']('NotifyFaxAccount',{'account':{'id':_0x1a1927},'body':_0x121b64,'log':_0xd8fc('0x10')});};
\ No newline at end of file
+var _0x1df7=['modem','gateway','t38timeout','TrunkId','ListId','Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','getFaxAccounts','Request','GetFaxAccount','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0x1df7,0x6e));var _0x71df=function(_0x90cc34,_0xe7b8ce){_0x90cc34=_0x90cc34-0x0;var _0x4231ee=_0x1df7[_0x90cc34];return _0x4231ee;};'use strict';var client=require('../client');exports[_0x71df('0x0')]=function(){return function(){return client[_0x71df('0x1')](_0x71df('0x2'),{'options':{'raw':![],'attributes':['id',_0x71df('0x3'),_0x71df('0x4'),_0x71df('0x5'),_0x71df('0x6'),_0x71df('0x7'),_0x71df('0x8'),_0x71df('0x9'),_0x71df('0xa'),_0x71df('0xb'),'faxdetect',_0x71df('0xc'),'tech',_0x71df('0xd'),_0x71df('0xe'),'key'],'include':[{'model':_0x71df('0xf'),'as':'Trunk','attributes':['id',_0x71df('0x3'),_0x71df('0x10'),'active']}]},'log':_0x71df('0x11')});};};exports[_0x71df('0x12')]=function(_0x6fa316,_0x57e114){return client[_0x71df('0x1')](_0x71df('0x13'),{'account':{'id':_0x6fa316},'body':_0x57e114,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index 7a3d4aa..80471ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa61f=['update','Request','UpdateFaxMessage'];(function(_0x4597d0,_0x52ef71){var _0x3fba4d=function(_0x25fe30){while(--_0x25fe30){_0x4597d0['push'](_0x4597d0['shift']());}};_0x3fba4d(++_0x52ef71);}(_0xa61f,0x11a));var _0xfa61=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xa61f[_0x4b055c];return _0x4b62bb;};'use strict';var client=require('../client');exports[_0xfa61('0x0')]=function(_0x2fcf64,_0x819cfd){return client[_0xfa61('0x1')](_0xfa61('0x2'),{'body':_0x819cfd,'options':{'where':{'AttachmentId':_0x2fcf64}},'log':_0xfa61('0x2')});};
\ No newline at end of file
+var _0x6e01=['UpdateFaxMessage','../client','update'];(function(_0x58352f,_0x51897f){var _0x3cbf26=function(_0x2dc170){while(--_0x2dc170){_0x58352f['push'](_0x58352f['shift']());}};_0x3cbf26(++_0x51897f);}(_0x6e01,0x14b));var _0x16e0=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x6e01[_0x5037ab];return _0x512adb;};'use strict';var client=require(_0x16e0('0x0'));exports[_0x16e0('0x1')]=function(_0x3c384e,_0x3652d9){return client['Request']('UpdateFaxMessage',{'body':_0x3652d9,'options':{'where':{'AttachmentId':_0x3c384e}},'log':_0x16e0('0x2')});};
\ No newline at end of file
index f7942b7..a799a72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x596e=['GetDeskAccount','../../client','getDeskAccounts','Request','name','description','username','password','type','serverUrl','Configurations','DeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','Tag','Tags'];(function(_0x1e0337,_0x7af5cc){var _0x497000=function(_0x55db54){while(--_0x55db54){_0x1e0337['push'](_0x1e0337['shift']());}};_0x497000(++_0x7af5cc);}(_0x596e,0x97));var _0xe596=function(_0x18a889,_0x32e3fc){_0x18a889=_0x18a889-0x0;var _0x1487bd=_0x596e[_0x18a889];return _0x1487bd;};'use strict';var client=require(_0xe596('0x0'));exports[_0xe596('0x1')]=function(){return function(_0x19a264){return client[_0xe596('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0xe596('0x3'),_0xe596('0x4'),_0xe596('0x5'),_0xe596('0x6'),'remoteUri','authType',_0xe596('0x7'),_0xe596('0x8')],'include':[{'model':'DeskConfiguration','as':_0xe596('0x9'),'attributes':['id',_0xe596('0x3')],'include':[{'model':_0xe596('0xa'),'as':_0xe596('0xb'),'attributes':['id',_0xe596('0x7'),_0xe596('0xc'),_0xe596('0xd')],'include':[{'model':_0xe596('0xe'),'as':_0xe596('0xe'),'attributes':['id',_0xe596('0x3')]}]},{'model':_0xe596('0xa'),'as':_0xe596('0xf'),'attributes':['id',_0xe596('0x7'),_0xe596('0xc'),_0xe596('0x10'),_0xe596('0x11'),_0xe596('0x12'),_0xe596('0xd')],'include':[{'model':_0xe596('0xe'),'as':_0xe596('0xe'),'attributes':['id',_0xe596('0x3')]}]},{'model':_0xe596('0xa'),'as':_0xe596('0x13'),'attributes':['id','type',_0xe596('0xc'),_0xe596('0x14'),_0xe596('0x15'),'customField',_0xe596('0xd')],'include':[{'model':_0xe596('0xe'),'as':_0xe596('0xe'),'attributes':['id',_0xe596('0x3')]}]},{'model':_0xe596('0x16'),'as':_0xe596('0x17'),'attributes':['id',_0xe596('0x3')]}]}]},'log':_0xe596('0x18')});};};
\ No newline at end of file
+var _0x027f=['Variable','idField','nameField','customField','Tag','getDeskAccounts','GetDeskAccount','name','description','username','password','authType','type','serverUrl','Configurations','DeskField','content','variableName','Descriptions','key','keyType','keyContent'];(function(_0x1eaa49,_0x52c696){var _0x4e3236=function(_0x296b23){while(--_0x296b23){_0x1eaa49['push'](_0x1eaa49['shift']());}};_0x4e3236(++_0x52c696);}(_0x027f,0xcb));var _0xf027=function(_0x12e506,_0x1718fe){_0x12e506=_0x12e506-0x0;var _0xbddeb4=_0x027f[_0x12e506];return _0xbddeb4;};'use strict';var client=require('../../client');exports[_0xf027('0x0')]=function(){return function(_0x2c6c55){return client['Request'](_0xf027('0x1'),{'options':{'raw':![],'attributes':['id',_0xf027('0x2'),_0xf027('0x3'),_0xf027('0x4'),_0xf027('0x5'),'remoteUri',_0xf027('0x6'),_0xf027('0x7'),_0xf027('0x8')],'include':[{'model':'DeskConfiguration','as':_0xf027('0x9'),'attributes':['id',_0xf027('0x2')],'include':[{'model':_0xf027('0xa'),'as':'Subjects','attributes':['id',_0xf027('0x7'),_0xf027('0xb'),_0xf027('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf027('0x2')]}]},{'model':'DeskField','as':_0xf027('0xd'),'attributes':['id',_0xf027('0x7'),'content',_0xf027('0xe'),_0xf027('0xf'),_0xf027('0x10'),_0xf027('0xc')],'include':[{'model':_0xf027('0x11'),'as':'Variable','attributes':['id',_0xf027('0x2')]}]},{'model':'DeskField','as':'Fields','attributes':['id',_0xf027('0x7'),_0xf027('0xb'),_0xf027('0x12'),_0xf027('0x13'),_0xf027('0x14'),'variableName'],'include':[{'model':'Variable','as':_0xf027('0x11'),'attributes':['id',_0xf027('0x2')]}]},{'model':_0xf027('0x15'),'as':'Tags','attributes':['id',_0xf027('0x2')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
index efae820..aafe92e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc913=['variableName','Variable','Descriptions','key','keyType','nameField','customField','GetDynamics365Account','../../client','getDynamics365Accounts','Request','name','username','password','remoteUri','clientId','clientSecret','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','Subjects','type','content'];(function(_0x193715,_0xdc5658){var _0x34608c=function(_0x3b9a1b){while(--_0x3b9a1b){_0x193715['push'](_0x193715['shift']());}};_0x34608c(++_0xdc5658);}(_0xc913,0x102));var _0x3c91=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xc913[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0x3c91('0x0'));exports[_0x3c91('0x1')]=function(){return function(_0x392889){return client[_0x3c91('0x2')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x3c91('0x3'),_0x3c91('0x4'),_0x3c91('0x5'),_0x3c91('0x6'),'tenantId',_0x3c91('0x7'),_0x3c91('0x8'),'serverUrl',_0x3c91('0x9')],'include':[{'model':_0x3c91('0xa'),'as':_0x3c91('0xb'),'attributes':['id',_0x3c91('0x3'),_0x3c91('0xc')],'include':[{'model':_0x3c91('0xd'),'as':_0x3c91('0xe'),'attributes':['id',_0x3c91('0xf'),_0x3c91('0x10'),_0x3c91('0x11')],'include':[{'model':_0x3c91('0x12'),'as':_0x3c91('0x12'),'attributes':['id',_0x3c91('0x3')]}]},{'model':_0x3c91('0xd'),'as':_0x3c91('0x13'),'attributes':['id','type',_0x3c91('0x10'),_0x3c91('0x14'),_0x3c91('0x15'),'keyContent',_0x3c91('0x11')],'include':[{'model':_0x3c91('0x12'),'as':_0x3c91('0x12'),'attributes':['id','name']}]},{'model':_0x3c91('0xd'),'as':'Fields','attributes':['id',_0x3c91('0xf'),_0x3c91('0x10'),'idField',_0x3c91('0x16'),_0x3c91('0x17'),_0x3c91('0x11')],'include':[{'model':_0x3c91('0x12'),'as':'Variable','attributes':['id',_0x3c91('0x3')]}]}]}]},'log':_0x3c91('0x18')});};};
\ No newline at end of file
+var _0xfba3=['ticketType','Dynamics365Field','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','idField','nameField','customField','GetDynamics365Account','../../client','getDynamics365Accounts','name','username','password','remoteUri','tenantId','serverUrl','Dynamics365Configuration','Configurations'];(function(_0x33e475,_0x1798eb){var _0x3468ce=function(_0x25fbbc){while(--_0x25fbbc){_0x33e475['push'](_0x33e475['shift']());}};_0x3468ce(++_0x1798eb);}(_0xfba3,0x1ea));var _0x3fba=function(_0x5a22d0,_0x5b66fa){_0x5a22d0=_0x5a22d0-0x0;var _0x23260e=_0xfba3[_0x5a22d0];return _0x23260e;};'use strict';var client=require(_0x3fba('0x0'));exports[_0x3fba('0x1')]=function(){return function(_0x5b773e){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x3fba('0x2'),_0x3fba('0x3'),_0x3fba('0x4'),_0x3fba('0x5'),_0x3fba('0x6'),'clientId','clientSecret',_0x3fba('0x7'),'description'],'include':[{'model':_0x3fba('0x8'),'as':_0x3fba('0x9'),'attributes':['id',_0x3fba('0x2'),_0x3fba('0xa')],'include':[{'model':_0x3fba('0xb'),'as':'Subjects','attributes':['id','type',_0x3fba('0xc'),_0x3fba('0xd')],'include':[{'model':_0x3fba('0xe'),'as':_0x3fba('0xe'),'attributes':['id',_0x3fba('0x2')]}]},{'model':_0x3fba('0xb'),'as':_0x3fba('0xf'),'attributes':['id',_0x3fba('0x10'),'content',_0x3fba('0x11'),_0x3fba('0x12'),_0x3fba('0x13'),'variableName'],'include':[{'model':_0x3fba('0xe'),'as':_0x3fba('0xe'),'attributes':['id',_0x3fba('0x2')]}]},{'model':_0x3fba('0xb'),'as':_0x3fba('0x14'),'attributes':['id',_0x3fba('0x10'),'content',_0x3fba('0x15'),_0x3fba('0x16'),_0x3fba('0x17'),_0x3fba('0xd')],'include':[{'model':_0x3fba('0xe'),'as':_0x3fba('0xe'),'attributes':['id',_0x3fba('0x2')]}]}]}]},'log':_0x3fba('0x18')});};};
\ No newline at end of file
index 7664fb7..fdab259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa699=['serverUrl','FreshdeskConfiguration','Configurations','FreshdeskField','Subjects','type','variableName','Variable','content','keyType','keyContent','Fields','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri'];(function(_0x22123d,_0x45ae06){var _0xeabce1=function(_0x239cae){while(--_0x239cae){_0x22123d['push'](_0x22123d['shift']());}};_0xeabce1(++_0x45ae06);}(_0xa699,0x6b));var _0x9a69=function(_0x2c69a1,_0x201903){_0x2c69a1=_0x2c69a1-0x0;var _0x24bb91=_0xa699[_0x2c69a1];return _0x24bb91;};'use strict';var client=require(_0x9a69('0x0'));exports[_0x9a69('0x1')]=function(){return function(_0x331c94){return client[_0x9a69('0x2')](_0x9a69('0x3'),{'options':{'raw':![],'attributes':['id',_0x9a69('0x4'),_0x9a69('0x5'),_0x9a69('0x6'),_0x9a69('0x7'),_0x9a69('0x8')],'include':[{'model':_0x9a69('0x9'),'as':_0x9a69('0xa'),'attributes':['id',_0x9a69('0x4')],'include':[{'model':'Tag','attributes':['id',_0x9a69('0x4')]},{'model':_0x9a69('0xb'),'as':_0x9a69('0xc'),'attributes':['id',_0x9a69('0xd'),'content',_0x9a69('0xe')],'include':[{'model':_0x9a69('0xf'),'as':_0x9a69('0xf'),'attributes':['id',_0x9a69('0x4')]}]},{'model':_0x9a69('0xb'),'as':'Descriptions','attributes':['id','type',_0x9a69('0x10'),'key',_0x9a69('0x11'),_0x9a69('0x12'),'variableName'],'include':[{'model':_0x9a69('0xf'),'as':_0x9a69('0xf'),'attributes':['id','name']}]},{'model':_0x9a69('0xb'),'as':_0x9a69('0x13'),'attributes':['id',_0x9a69('0xd'),_0x9a69('0x10'),_0x9a69('0x14'),_0x9a69('0x15'),_0x9a69('0x16'),_0x9a69('0xe')],'include':[{'model':_0x9a69('0xf'),'as':'Variable','attributes':['id',_0x9a69('0x4')]}]}]}]},'log':_0x9a69('0x3')});};};
\ No newline at end of file
+var _0xe9ad=['variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','type','content'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe9ad,0x82));var _0xde9a=function(_0x6be190,_0x25e8dd){_0x6be190=_0x6be190-0x0;var _0x3867df=_0xe9ad[_0x6be190];return _0x3867df;};'use strict';var client=require(_0xde9a('0x0'));exports[_0xde9a('0x1')]=function(){return function(_0x1d3798){return client[_0xde9a('0x2')](_0xde9a('0x3'),{'options':{'raw':![],'attributes':['id',_0xde9a('0x4'),_0xde9a('0x5'),'apiKey',_0xde9a('0x6'),_0xde9a('0x7')],'include':[{'model':_0xde9a('0x8'),'as':_0xde9a('0x9'),'attributes':['id','name'],'include':[{'model':_0xde9a('0xa'),'attributes':['id',_0xde9a('0x4')]},{'model':_0xde9a('0xb'),'as':'Subjects','attributes':['id',_0xde9a('0xc'),_0xde9a('0xd'),_0xde9a('0xe')],'include':[{'model':_0xde9a('0xf'),'as':_0xde9a('0xf'),'attributes':['id',_0xde9a('0x4')]}]},{'model':_0xde9a('0xb'),'as':_0xde9a('0x10'),'attributes':['id',_0xde9a('0xc'),'content',_0xde9a('0x11'),_0xde9a('0x12'),_0xde9a('0x13'),_0xde9a('0xe')],'include':[{'model':_0xde9a('0xf'),'as':_0xde9a('0xf'),'attributes':['id',_0xde9a('0x4')]}]},{'model':_0xde9a('0xb'),'as':_0xde9a('0x14'),'attributes':['id','type',_0xde9a('0xd'),_0xde9a('0x15'),_0xde9a('0x16'),_0xde9a('0x17'),_0xde9a('0xe')],'include':[{'model':_0xde9a('0xf'),'as':_0xde9a('0xf'),'attributes':['id',_0xde9a('0x4')]}]}]}]},'log':_0xde9a('0x3')});};};
\ No newline at end of file
index 8f6d4f6..220f493 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eed=['variableName','Descriptions','content','key','keyType','keyContent','Variable','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','username','apiKey','FreshsalesConfiguration','Configurations','name','FreshsalesField','Subjects'];(function(_0x5830df,_0x311506){var _0x5a8c20=function(_0x1144f8){while(--_0x1144f8){_0x5830df['push'](_0x5830df['shift']());}};_0x5a8c20(++_0x311506);}(_0x6eed,0xff));var _0xd6ee=function(_0x571201,_0x2a787a){_0x571201=_0x571201-0x0;var _0x385e67=_0x6eed[_0x571201];return _0x385e67;};'use strict';var client=require(_0xd6ee('0x0'));exports[_0xd6ee('0x1')]=function(){return function(_0x1d3217){return client[_0xd6ee('0x2')](_0xd6ee('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd6ee('0x4'),_0xd6ee('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0xd6ee('0x6'),'as':_0xd6ee('0x7'),'attributes':['id',_0xd6ee('0x8')],'include':[{'model':_0xd6ee('0x9'),'as':_0xd6ee('0xa'),'attributes':['id','type','content',_0xd6ee('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0xd6ee('0x9'),'as':_0xd6ee('0xc'),'attributes':['id','type',_0xd6ee('0xd'),_0xd6ee('0xe'),_0xd6ee('0xf'),_0xd6ee('0x10'),'variableName'],'include':[{'model':_0xd6ee('0x11'),'as':_0xd6ee('0x11'),'attributes':['id',_0xd6ee('0x8')]}]}]}]},'log':_0xd6ee('0x12')});};};
\ No newline at end of file
+var _0xd9fb=['serverUrl','Configurations','FreshsalesField','Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','remoteUri'];(function(_0x4800c4,_0x13b31e){var _0x5bd103=function(_0x57b08a){while(--_0x57b08a){_0x4800c4['push'](_0x4800c4['shift']());}};_0x5bd103(++_0x13b31e);}(_0xd9fb,0x189));var _0xbd9f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xd9fb[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(){return function(_0x288314){return client[_0xbd9f('0x2')](_0xbd9f('0x3'),{'options':{'raw':![],'attributes':['id',_0xbd9f('0x4'),_0xbd9f('0x5'),'apiKey',_0xbd9f('0x6'),_0xbd9f('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0xbd9f('0x8'),'attributes':['id','name'],'include':[{'model':_0xbd9f('0x9'),'as':_0xbd9f('0xa'),'attributes':['id','type',_0xbd9f('0xb'),_0xbd9f('0xc')],'include':[{'model':_0xbd9f('0xd'),'as':_0xbd9f('0xd'),'attributes':['id','name']}]},{'model':_0xbd9f('0x9'),'as':_0xbd9f('0xe'),'attributes':['id',_0xbd9f('0xf'),_0xbd9f('0xb'),_0xbd9f('0x10'),_0xbd9f('0x11'),_0xbd9f('0x12'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0xbd9f('0x13')});};};
\ No newline at end of file
index 7d48f97..2b5c051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb3=['SalesforceField','Variable','GetSalesforceAccount','getSalesforceAccounts','Request','username','password','remoteUri','clientId','clientSecret','serverUrl','SalesforceConfiguration','name','moduleSearch','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead'];(function(_0x443cdc,_0x1d1da7){var _0x13bd4b=function(_0x1f9a1b){while(--_0x1f9a1b){_0x443cdc['push'](_0x443cdc['shift']());}};_0x13bd4b(++_0x1d1da7);}(_0xdeb3,0xb7));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var client=require('../../client');exports[_0x3deb('0x0')]=function(){return function(_0x2585e2){return client[_0x3deb('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id','name',_0x3deb('0x2'),_0x3deb('0x3'),_0x3deb('0x4'),_0x3deb('0x5'),_0x3deb('0x6'),'securityToken',_0x3deb('0x7'),'type'],'include':[{'model':_0x3deb('0x8'),'as':'Configurations','attributes':['id',_0x3deb('0x9'),_0x3deb('0xa'),_0x3deb('0xb'),_0x3deb('0xc'),_0x3deb('0xd'),_0x3deb('0xe'),_0x3deb('0xf'),_0x3deb('0x10')],'include':[{'model':_0x3deb('0x11'),'as':'Subjects','include':[{'model':'Variable','as':_0x3deb('0x12'),'attributes':['id',_0x3deb('0x9')]}]},{'model':_0x3deb('0x11'),'as':'Descriptions','include':[{'model':_0x3deb('0x12'),'as':_0x3deb('0x12'),'attributes':['id',_0x3deb('0x9')]}]},{'model':_0x3deb('0x11'),'as':'Fields','include':[{'model':'Variable','as':'Variable','attributes':['id',_0x3deb('0x9')]}]}]}]},'log':_0x3deb('0x13')});};};
\ No newline at end of file
+var _0x6629=['ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','Request','GetSalesforceAccount','name','username','remoteUri','clientId','clientSecret','serverUrl','type','SalesforceConfiguration','moduleCreate'];(function(_0x45b896,_0x3983f4){var _0x590184=function(_0x1f2c75){while(--_0x1f2c75){_0x45b896['push'](_0x45b896['shift']());}};_0x590184(++_0x3983f4);}(_0x6629,0x1c2));var _0x9662=function(_0x1d7f79,_0x26b5aa){_0x1d7f79=_0x1d7f79-0x0;var _0x122488=_0x6629[_0x1d7f79];return _0x122488;};'use strict';var client=require(_0x9662('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x5471a3){return client[_0x9662('0x1')](_0x9662('0x2'),{'options':{'raw':![],'attributes':['id',_0x9662('0x3'),_0x9662('0x4'),'password',_0x9662('0x5'),_0x9662('0x6'),_0x9662('0x7'),'securityToken',_0x9662('0x8'),_0x9662('0x9')],'include':[{'model':_0x9662('0xa'),'as':'Configurations','attributes':['id',_0x9662('0x3'),'moduleSearch',_0x9662('0xb'),_0x9662('0xc'),_0x9662('0xd'),_0x9662('0xe'),_0x9662('0xf'),_0x9662('0x10')],'include':[{'model':_0x9662('0x11'),'as':_0x9662('0x12'),'include':[{'model':_0x9662('0x13'),'as':_0x9662('0x13'),'attributes':['id',_0x9662('0x3')]}]},{'model':'SalesforceField','as':_0x9662('0x14'),'include':[{'model':'Variable','as':_0x9662('0x13'),'attributes':['id',_0x9662('0x3')]}]},{'model':'SalesforceField','as':_0x9662('0x15'),'include':[{'model':_0x9662('0x13'),'as':_0x9662('0x13'),'attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index 00ac54c..20e81c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['variableName','GetServicenowkAccount','../../client','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','ServicenowField','Subjects','type','Variable','Descriptions','key','keyContent','content','idField','nameField'];(function(_0x5488cc,_0x57b187){var _0xa8962e=function(_0x4be4d5){while(--_0x4be4d5){_0x5488cc['push'](_0x5488cc['shift']());}};_0xa8962e(++_0x57b187);}(_0x326f,0xd1));var _0xf326=function(_0x12ac89,_0x53a7a6){_0x12ac89=_0x12ac89-0x0;var _0x204c43=_0x326f[_0x12ac89];return _0x204c43;};'use strict';var client=require(_0xf326('0x0'));exports['getServicenowAccounts']=function(){return function(_0x5452cc){return client[_0xf326('0x1')](_0xf326('0x2'),{'options':{'raw':![],'attributes':['id',_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9')],'include':[{'model':_0xf326('0xa'),'as':'Configurations','attributes':['id',_0xf326('0x3')],'include':[{'model':_0xf326('0xb'),'as':_0xf326('0xc'),'attributes':['id',_0xf326('0xd'),'content','variableName'],'include':[{'model':'Variable','as':_0xf326('0xe'),'attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':_0xf326('0xf'),'attributes':['id',_0xf326('0xd'),'content',_0xf326('0x10'),'keyType',_0xf326('0x11'),'variableName'],'include':[{'model':_0xf326('0xe'),'as':'Variable','attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':'Fields','attributes':['id',_0xf326('0xd'),_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x14'),'customField',_0xf326('0x15')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf326('0x3')]}]}]}]},'log':_0xf326('0x16')});};};
\ No newline at end of file
+var _0x53ec=['customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','username','email','remoteUri','ServicenowConfiguration','ServicenowField','type','content','variableName','Variable','Descriptions','keyType','idField','nameField'];(function(_0x14f750,_0x5bbc04){var _0x31bf16=function(_0x48cedb){while(--_0x48cedb){_0x14f750['push'](_0x14f750['shift']());}};_0x31bf16(++_0x5bbc04);}(_0x53ec,0x192));var _0xc53e=function(_0x20d434,_0x3fb64f){_0x20d434=_0x20d434-0x0;var _0x1d90f1=_0x53ec[_0x20d434];return _0x1d90f1;};'use strict';var client=require(_0xc53e('0x0'));exports[_0xc53e('0x1')]=function(){return function(_0x2d5f51){return client[_0xc53e('0x2')](_0xc53e('0x3'),{'options':{'raw':![],'attributes':['id',_0xc53e('0x4'),'description',_0xc53e('0x5'),'password',_0xc53e('0x6'),_0xc53e('0x7'),'serverUrl'],'include':[{'model':_0xc53e('0x8'),'as':'Configurations','attributes':['id',_0xc53e('0x4')],'include':[{'model':_0xc53e('0x9'),'as':'Subjects','attributes':['id',_0xc53e('0xa'),_0xc53e('0xb'),_0xc53e('0xc')],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]},{'model':_0xc53e('0x9'),'as':_0xc53e('0xe'),'attributes':['id',_0xc53e('0xa'),'content','key',_0xc53e('0xf'),'keyContent','variableName'],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]},{'model':_0xc53e('0x9'),'as':'Fields','attributes':['id','type',_0xc53e('0xb'),_0xc53e('0x10'),_0xc53e('0x11'),_0xc53e('0x12'),_0xc53e('0xc')],'include':[{'model':_0xc53e('0xd'),'as':_0xc53e('0xd'),'attributes':['id',_0xc53e('0x4')]}]}]}]},'log':_0xc53e('0x13')});};};
\ No newline at end of file
index 808ceb3..9263b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['idField','nameField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','serverUrl','Configurations','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyContent','Fields'];(function(_0x127ed7,_0x18c2c5){var _0x17c7bb=function(_0x212045){while(--_0x212045){_0x127ed7['push'](_0x127ed7['shift']());}};_0x17c7bb(++_0x18c2c5);}(_0xadb5,0xad));var _0x5adb=function(_0x3ae42a,_0x13c801){_0x3ae42a=_0x3ae42a-0x0;var _0x410ec7=_0xadb5[_0x3ae42a];return _0x410ec7;};'use strict';var client=require('../../client');exports[_0x5adb('0x0')]=function(){return function(_0x49fc17){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x3'),'username',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x5adb('0x7'),'attributes':['id',_0x5adb('0x3')],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id',_0x5adb('0x3')]}]},{'model':_0x5adb('0x8'),'as':_0x5adb('0xe'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),'key','keyType',_0x5adb('0xf'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':'Variable','attributes':['id',_0x5adb('0x3')]}]},{'model':'SugarcrmField','as':_0x5adb('0x10'),'attributes':['id','type',_0x5adb('0xb'),_0x5adb('0x11'),_0x5adb('0x12'),'customField',_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id','name']}]}]}]},'log':_0x5adb('0x2')});};};
\ No newline at end of file
+var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0xdb28,0x106));var _0x8db2=function(_0x24be36,_0x5ee986){_0x24be36=_0x24be36-0x0;var _0x71d9f9=_0xdb28[_0x24be36];return _0x71d9f9;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
index 3587884..6aa86b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f26=['GetVtigerAccount','name','description','username','accessKey','serverUrl','VtigerField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','idField','nameField','customField','../../client','getVtigerAccounts','Request'];(function(_0x4bfaf7,_0x44acf7){var _0x2908e2=function(_0x361227){while(--_0x361227){_0x4bfaf7['push'](_0x4bfaf7['shift']());}};_0x2908e2(++_0x44acf7);}(_0x0f26,0xc3));var _0x60f2=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x0f26[_0x2af053];return _0x4b4001;};'use strict';var client=require(_0x60f2('0x0'));exports[_0x60f2('0x1')]=function(){return function(_0x2c21a4){return client[_0x60f2('0x2')](_0x60f2('0x3'),{'options':{'raw':![],'attributes':['id',_0x60f2('0x4'),_0x60f2('0x5'),_0x60f2('0x6'),_0x60f2('0x7'),'remoteUri',_0x60f2('0x8')],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0x60f2('0x4')],'include':[{'model':_0x60f2('0x9'),'as':_0x60f2('0xa'),'attributes':['id',_0x60f2('0xb'),_0x60f2('0xc'),_0x60f2('0xd')],'include':[{'model':_0x60f2('0xe'),'as':_0x60f2('0xe'),'attributes':['id',_0x60f2('0x4')]}]},{'model':_0x60f2('0x9'),'as':_0x60f2('0xf'),'attributes':['id',_0x60f2('0xb'),_0x60f2('0xc'),_0x60f2('0x10'),_0x60f2('0x11'),_0x60f2('0x12'),_0x60f2('0xd')],'include':[{'model':_0x60f2('0xe'),'as':_0x60f2('0xe'),'attributes':['id',_0x60f2('0x4')]}]},{'model':_0x60f2('0x9'),'as':'Fields','attributes':['id',_0x60f2('0xb'),'content',_0x60f2('0x13'),_0x60f2('0x14'),_0x60f2('0x15'),_0x60f2('0xd')],'include':[{'model':_0x60f2('0xe'),'as':_0x60f2('0xe'),'attributes':['id',_0x60f2('0x4')]}]}]}]},'log':_0x60f2('0x3')});};};
\ No newline at end of file
+var _0x6fd7=['Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','GetVtigerAccount','../../client','getVtigerAccounts','Request','name','description','accessKey','serverUrl','VtigerConfiguration','Configurations','VtigerField','type','content','variableName','Variable'];(function(_0x5d979a,_0x2089ec){var _0x350436=function(_0xa8c253){while(--_0xa8c253){_0x5d979a['push'](_0x5d979a['shift']());}};_0x350436(++_0x2089ec);}(_0x6fd7,0xd8));var _0x76fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6fd7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x76fd('0x0'));exports[_0x76fd('0x1')]=function(){return function(_0x5cfcb1){return client[_0x76fd('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x76fd('0x3'),_0x76fd('0x4'),'username',_0x76fd('0x5'),'remoteUri',_0x76fd('0x6')],'include':[{'model':_0x76fd('0x7'),'as':_0x76fd('0x8'),'attributes':['id','name'],'include':[{'model':_0x76fd('0x9'),'as':'Subjects','attributes':['id',_0x76fd('0xa'),_0x76fd('0xb'),_0x76fd('0xc')],'include':[{'model':_0x76fd('0xd'),'as':_0x76fd('0xd'),'attributes':['id',_0x76fd('0x3')]}]},{'model':_0x76fd('0x9'),'as':_0x76fd('0xe'),'attributes':['id',_0x76fd('0xa'),'content',_0x76fd('0xf'),_0x76fd('0x10'),_0x76fd('0x11'),'variableName'],'include':[{'model':_0x76fd('0xd'),'as':_0x76fd('0xd'),'attributes':['id',_0x76fd('0x3')]}]},{'model':'VtigerField','as':_0x76fd('0x12'),'attributes':['id',_0x76fd('0xa'),_0x76fd('0xb'),_0x76fd('0x13'),_0x76fd('0x14'),_0x76fd('0x15'),_0x76fd('0xc')],'include':[{'model':_0x76fd('0xd'),'as':'Variable','attributes':['id',_0x76fd('0x3')]}]}]}]},'log':_0x76fd('0x16')});};};
\ No newline at end of file
index 4a04e3d..1ca4bf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x898d=['token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','content','variableName','Variable','Descriptions','key','keyType','Fields','idField','nameField','customField','getZendeskAccounts','Request','GetZendeskAccount','name','username','password'];(function(_0x58f401,_0x1136c9){var _0x146e3d=function(_0x249501){while(--_0x249501){_0x58f401['push'](_0x58f401['shift']());}};_0x146e3d(++_0x1136c9);}(_0x898d,0xca));var _0xd898=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x898d[_0x1a37e3];return _0x4db78a;};'use strict';var client=require('../../client');exports[_0xd898('0x0')]=function(){return function(_0x5ceb47){return client[_0xd898('0x1')](_0xd898('0x2'),{'options':{'raw':![],'attributes':['id',_0xd898('0x3'),_0xd898('0x4'),_0xd898('0x5'),_0xd898('0x6'),_0xd898('0x7'),_0xd898('0x8'),_0xd898('0x9'),_0xd898('0xa')],'include':[{'model':_0xd898('0xb'),'as':_0xd898('0xc'),'attributes':['id',_0xd898('0x3')],'include':[{'model':_0xd898('0xd'),'attributes':['id','name']},{'model':_0xd898('0xe'),'as':_0xd898('0xf'),'attributes':['id',_0xd898('0xa'),_0xd898('0x10'),_0xd898('0x11')],'include':[{'model':_0xd898('0x12'),'as':_0xd898('0x12'),'attributes':['id',_0xd898('0x3')]}]},{'model':_0xd898('0xe'),'as':_0xd898('0x13'),'attributes':['id',_0xd898('0xa'),_0xd898('0x10'),_0xd898('0x14'),_0xd898('0x15'),'keyContent',_0xd898('0x11')],'include':[{'model':_0xd898('0x12'),'as':_0xd898('0x12'),'attributes':['id',_0xd898('0x3')]}]},{'model':_0xd898('0xe'),'as':_0xd898('0x16'),'attributes':['id',_0xd898('0xa'),_0xd898('0x10'),_0xd898('0x17'),_0xd898('0x18'),_0xd898('0x19'),'variableName'],'include':[{'model':'Variable','as':_0xd898('0x12'),'attributes':['id','name']}]}]}]},'log':'GetZendeskAccount'});};};
\ No newline at end of file
+var _0x94f7=['Variable','ZendeskField','Descriptions','keyType','keyContent','variableName','Fields','nameField','../../client','getZendeskAccounts','GetZendeskAccount','name','username','password','token','remoteUri','authType','type','ZendeskConfiguration','Subjects','content'];(function(_0x2ac8b7,_0x1feeb8){var _0x5c0c76=function(_0x17d75b){while(--_0x17d75b){_0x2ac8b7['push'](_0x2ac8b7['shift']());}};_0x5c0c76(++_0x1feeb8);}(_0x94f7,0x158));var _0x794f=function(_0x30b054,_0x19d656){_0x30b054=_0x30b054-0x0;var _0x2e7caf=_0x94f7[_0x30b054];return _0x2e7caf;};'use strict';var client=require(_0x794f('0x0'));exports[_0x794f('0x1')]=function(){return function(_0x3e134f){return client['Request'](_0x794f('0x2'),{'options':{'raw':![],'attributes':['id',_0x794f('0x3'),_0x794f('0x4'),_0x794f('0x5'),_0x794f('0x6'),_0x794f('0x7'),_0x794f('0x8'),'serverUrl',_0x794f('0x9')],'include':[{'model':_0x794f('0xa'),'as':'Configurations','attributes':['id',_0x794f('0x3')],'include':[{'model':'Tag','attributes':['id','name']},{'model':'ZendeskField','as':_0x794f('0xb'),'attributes':['id','type',_0x794f('0xc'),'variableName'],'include':[{'model':_0x794f('0xd'),'as':'Variable','attributes':['id','name']}]},{'model':_0x794f('0xe'),'as':_0x794f('0xf'),'attributes':['id','type',_0x794f('0xc'),'key',_0x794f('0x10'),_0x794f('0x11'),_0x794f('0x12')],'include':[{'model':_0x794f('0xd'),'as':_0x794f('0xd'),'attributes':['id',_0x794f('0x3')]}]},{'model':_0x794f('0xe'),'as':_0x794f('0x13'),'attributes':['id',_0x794f('0x9'),_0x794f('0xc'),'idField',_0x794f('0x14'),'customField',_0x794f('0x12')],'include':[{'model':_0x794f('0xd'),'as':'Variable','attributes':['id',_0x794f('0x3')]}]}]}]},'log':_0x794f('0x2')});};};
\ No newline at end of file
index 835c125..1e0669f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ac1=['Variable','Descriptions','content','key','keyContent','variableName','nameField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','clientId','clientSecret','serverUrl','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','type'];(function(_0x320b8e,_0x1da3fe){var _0x55a10a=function(_0x148a56){while(--_0x148a56){_0x320b8e['push'](_0x320b8e['shift']());}};_0x55a10a(++_0x1da3fe);}(_0x3ac1,0x68));var _0x13ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac1[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x13ac('0x0'));exports[_0x13ac('0x1')]=function(){return function(_0x1d27eb){return client[_0x13ac('0x2')](_0x13ac('0x3'),{'options':{'raw':![],'attributes':['id',_0x13ac('0x4'),_0x13ac('0x5'),'host','zone',_0x13ac('0x6'),_0x13ac('0x7'),_0x13ac('0x8'),'code',_0x13ac('0x9')],'include':[{'model':'ZohoConfiguration','as':_0x13ac('0xa'),'attributes':['id',_0x13ac('0x4'),_0x13ac('0xb'),_0x13ac('0xc'),_0x13ac('0x5')],'include':[{'model':_0x13ac('0xd'),'as':_0x13ac('0xe'),'attributes':['id',_0x13ac('0xf'),'content','variableName'],'include':[{'model':_0x13ac('0x10'),'as':'Variable','attributes':['id','name']}]},{'model':_0x13ac('0xd'),'as':_0x13ac('0x11'),'attributes':['id',_0x13ac('0xf'),_0x13ac('0x12'),_0x13ac('0x13'),'keyType',_0x13ac('0x14'),_0x13ac('0x15')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x13ac('0xd'),'as':'Fields','attributes':['id',_0x13ac('0xf'),_0x13ac('0x12'),'idField',_0x13ac('0x16'),_0x13ac('0x17'),_0x13ac('0x15')],'include':[{'model':_0x13ac('0x10'),'as':_0x13ac('0x10'),'attributes':['id','name']}]}]}]},'log':_0x13ac('0x3')});};};
\ No newline at end of file
+var _0xafc5=['serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','Variable','Descriptions','type','content','keyType','keyContent','variableName','idField','nameField','customField','Request','GetZohoAccount','name','description','host'];(function(_0x4ad553,_0x586c5a){var _0x136750=function(_0x11dfbc){while(--_0x11dfbc){_0x4ad553['push'](_0x4ad553['shift']());}};_0x136750(++_0x586c5a);}(_0xafc5,0x1de));var _0x5afc=function(_0x225ced,_0x34fed0){_0x225ced=_0x225ced-0x0;var _0x4b17d4=_0xafc5[_0x225ced];return _0x4b17d4;};'use strict';var client=require('../../client');exports['getZohoAccounts']=function(){return function(_0x5b7de5){return client[_0x5afc('0x0')](_0x5afc('0x1'),{'options':{'raw':![],'attributes':['id',_0x5afc('0x2'),_0x5afc('0x3'),_0x5afc('0x4'),'zone','clientId','clientSecret',_0x5afc('0x5'),_0x5afc('0x6'),_0x5afc('0x7')],'include':[{'model':_0x5afc('0x8'),'as':_0x5afc('0x9'),'attributes':['id',_0x5afc('0x2'),_0x5afc('0xa'),_0x5afc('0xb'),_0x5afc('0x3')],'include':[{'model':_0x5afc('0xc'),'as':'Subjects','attributes':['id','type','content','variableName'],'include':[{'model':_0x5afc('0xd'),'as':_0x5afc('0xd'),'attributes':['id','name']}]},{'model':_0x5afc('0xc'),'as':_0x5afc('0xe'),'attributes':['id',_0x5afc('0xf'),_0x5afc('0x10'),'key',_0x5afc('0x11'),_0x5afc('0x12'),_0x5afc('0x13')],'include':[{'model':_0x5afc('0xd'),'as':_0x5afc('0xd'),'attributes':['id',_0x5afc('0x2')]}]},{'model':'ZohoField','as':'Fields','attributes':['id',_0x5afc('0xf'),'content',_0x5afc('0x14'),_0x5afc('0x15'),_0x5afc('0x16'),_0x5afc('0x13')],'include':[{'model':'Variable','as':_0x5afc('0xd'),'attributes':['id',_0x5afc('0x2')]}]}]}]},'log':_0x5afc('0x1')});};};
\ No newline at end of file
index 5927d0a..293cdbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe895=['starttime','seconds','outbound','dialstring','agent','toNumber','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff','inbound','calleridnum','exten','queue','accountcode','voiceDialReport','voice','membername','TALKING','endtime'];(function(_0x2d1525,_0x4dfa53){var _0x285faf=function(_0x229cee){while(--_0x229cee){_0x2d1525['push'](_0x2d1525['shift']());}};_0x285faf(++_0x4dfa53);}(_0xe895,0x162));var _0x5e89=function(_0x285cf1,_0x47e330){_0x285cf1=_0x285cf1-0x0;var _0x2fea93=_0xe895[_0x285cf1];return _0x2fea93;};'use strict';var moment=require('moment');var _=require(_0x5e89('0x0'));var util=require(_0x5e89('0x1'));var client=require(_0x5e89('0x2'));exports[_0x5e89('0x3')]=function(_0x563b20){var _0x1ea0ed=_0x563b20[_0x5e89('0x4')]||_0x563b20['queuecallerexitAt'];return client[_0x5e89('0x5')](_0x5e89('0x6'),{'body':{'channel':'voice','membername':_0x563b20[_0x5e89('0x7')],'interface':_[_0x5e89('0x8')](_0x563b20[_0x5e89('0x9')])?util['format'](_0x5e89('0xa'),_0x563b20[_0x5e89('0x7')]):_0x563b20[_0x5e89('0x9')],'type':'TALKING','enterAt':_0x563b20[_0x5e89('0xb')],'exitAt':_0x1ea0ed,'duration':moment(_0x1ea0ed)[_0x5e89('0xc')](_0x563b20[_0x5e89('0xb')],'seconds'),'data1':_0x5e89('0xd'),'data2':_0x563b20[_0x5e89('0xe')],'data3':_0x563b20[_0x5e89('0xf')],'data4':null,'data5':_0x563b20[_0x5e89('0x10')],'role':'agent','internal':_0x563b20[_0x5e89('0x11')]?_['toNumber'](_0x563b20[_0x5e89('0x11')]):undefined,'uniqueid':_0x563b20['uniqueid']},'log':_0x5e89('0x6')});};exports[_0x5e89('0x12')]=function(_0x5d2b01){return client[_0x5e89('0x5')](_0x5e89('0x6'),{'body':{'channel':_0x5e89('0x13'),'membername':_0x5d2b01[_0x5e89('0x14')],'interface':_0x5d2b01[_0x5e89('0x9')],'type':_0x5e89('0x15'),'enterAt':_0x5d2b01['starttime'],'exitAt':_0x5d2b01[_0x5e89('0x16')],'duration':moment(_0x5d2b01[_0x5e89('0x16')])[_0x5e89('0xc')](_0x5d2b01[_0x5e89('0x17')],_0x5e89('0x18'))>=0x0?moment(_0x5d2b01[_0x5e89('0x16')])[_0x5e89('0xc')](_0x5d2b01['starttime'],'seconds'):null,'data1':_0x5e89('0x19'),'data2':_0x5d2b01[_0x5e89('0x11')],'data3':_0x5d2b01[_0x5e89('0xf')],'data4':_0x5d2b01[_0x5e89('0x1a')]||null,'role':_0x5e89('0x1b'),'internal':_0x5d2b01[_0x5e89('0x11')]?_[_0x5e89('0x1c')](_0x5d2b01[_0x5e89('0x11')]):undefined,'uniqueid':_0x5d2b01['uniqueid']},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0x8fde=['starttime','endtime','diff','outbound','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername'];(function(_0x765c5a,_0x5f02a0){var _0x47df16=function(_0x521cb5){while(--_0x521cb5){_0x765c5a['push'](_0x765c5a['shift']());}};_0x47df16(++_0x5f02a0);}(_0x8fde,0xd6));var _0xe8fd=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8fde[_0x53ccf2];return _0x5a2964;};'use strict';var moment=require('moment');var _=require(_0xe8fd('0x0'));var util=require(_0xe8fd('0x1'));var client=require(_0xe8fd('0x2'));exports[_0xe8fd('0x3')]=function(_0x2016ee){var _0x5e16a5=_0x2016ee[_0xe8fd('0x4')]||_0x2016ee[_0xe8fd('0x5')];return client[_0xe8fd('0x6')](_0xe8fd('0x7'),{'body':{'channel':_0xe8fd('0x8'),'membername':_0x2016ee['lastAssignedTo'],'interface':_[_0xe8fd('0x9')](_0x2016ee[_0xe8fd('0xa')])?util[_0xe8fd('0xb')](_0xe8fd('0xc'),_0x2016ee[_0xe8fd('0xd')]):_0x2016ee[_0xe8fd('0xa')],'type':_0xe8fd('0xe'),'enterAt':_0x2016ee[_0xe8fd('0xf')],'exitAt':_0x5e16a5,'duration':moment(_0x5e16a5)['diff'](_0x2016ee[_0xe8fd('0xf')],_0xe8fd('0x10')),'data1':'inbound','data2':_0x2016ee[_0xe8fd('0x11')],'data3':_0x2016ee[_0xe8fd('0x12')],'data4':null,'data5':_0x2016ee[_0xe8fd('0x13')],'role':_0xe8fd('0x14'),'internal':_0x2016ee[_0xe8fd('0x15')]?_[_0xe8fd('0x16')](_0x2016ee['accountcode']):undefined,'uniqueid':_0x2016ee[_0xe8fd('0x17')]},'log':_0xe8fd('0x7')});};exports[_0xe8fd('0x18')]=function(_0x1cca58){return client[_0xe8fd('0x6')](_0xe8fd('0x7'),{'body':{'channel':_0xe8fd('0x8'),'membername':_0x1cca58[_0xe8fd('0x19')],'interface':_0x1cca58[_0xe8fd('0xa')],'type':_0xe8fd('0xe'),'enterAt':_0x1cca58[_0xe8fd('0x1a')],'exitAt':_0x1cca58[_0xe8fd('0x1b')],'duration':moment(_0x1cca58[_0xe8fd('0x1b')])[_0xe8fd('0x1c')](_0x1cca58[_0xe8fd('0x1a')],'seconds')>=0x0?moment(_0x1cca58[_0xe8fd('0x1b')])[_0xe8fd('0x1c')](_0x1cca58[_0xe8fd('0x1a')],_0xe8fd('0x10')):null,'data1':_0xe8fd('0x1d'),'data2':_0x1cca58['accountcode'],'data3':_0x1cca58[_0xe8fd('0x12')],'data4':_0x1cca58['dialstring']||null,'role':_0xe8fd('0x14'),'internal':_0x1cca58[_0xe8fd('0x15')]?_[_0xe8fd('0x16')](_0x1cca58['accountcode']):undefined,'uniqueid':_0x1cca58[_0xe8fd('0x17')]},'log':_0xe8fd('0x7')});};
\ No newline at end of file
index 298eded..4846efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48b2=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0x48b2,0x176));var _0x248b=function(_0x420544,_0x1cf8c7){_0x420544=_0x420544-0x0;var _0x151b06=_0x48b2[_0x420544];return _0x151b06;};'use strict';var client=require(_0x248b('0x0'));exports[_0x248b('0x1')]=function(){return client[_0x248b('0x2')](_0x248b('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x248b('0x4')]},'log':_0x248b('0x5')});};
\ No newline at end of file
+var _0xf4eb=['../client','GetSettings'];(function(_0x46a46d,_0x59669e){var _0x8d7ada=function(_0x105b15){while(--_0x105b15){_0x46a46d['push'](_0x46a46d['shift']());}};_0x8d7ada(++_0x59669e);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5a7936,_0x4cc1e3){_0x5a7936=_0x5a7936-0x0;var _0x4492d5=_0xf4eb[_0x5a7936];return _0x4492d5;};'use strict';var client=require(_0xbf4e('0x0'));exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xbf4e('0x1')});};
\ No newline at end of file
index 4bc17f1..05a8520 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf846=['GetTemplate','name','html','../client','getTemplates'];(function(_0x47bc20,_0x4bf725){var _0x172b91=function(_0x13b77e){while(--_0x13b77e){_0x47bc20['push'](_0x47bc20['shift']());}};_0x172b91(++_0x4bf725);}(_0xf846,0x85));var _0x6f84=function(_0xd64ae4,_0x2ea904){_0xd64ae4=_0xd64ae4-0x0;var _0x39d14f=_0xf846[_0xd64ae4];return _0x39d14f;};'use strict';var client=require(_0x6f84('0x0'));exports[_0x6f84('0x1')]=function(_0xc3809a){return function(_0xf01500){return client['Request'](_0x6f84('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6f84('0x3'),_0x6f84('0x4')]},'log':_0x6f84('0x2')});};};
\ No newline at end of file
+var _0x2fbb=['html','Request','GetTemplate','name'];(function(_0x3831ed,_0x5e88ce){var _0x5521ce=function(_0x15fef7){while(--_0x15fef7){_0x3831ed['push'](_0x3831ed['shift']());}};_0x5521ce(++_0x5e88ce);}(_0x2fbb,0x19d));var _0xb2fb=function(_0x427af0,_0x1538a0){_0x427af0=_0x427af0-0x0;var _0x527ece=_0x2fbb[_0x427af0];return _0x527ece;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x5ef533){return function(_0x5e964c){return client[_0xb2fb('0x0')](_0xb2fb('0x1'),{'options':{'raw':!![],'attributes':['id',_0xb2fb('0x2'),_0xb2fb('0x3')]},'log':_0xb2fb('0x1')});};};
\ No newline at end of file
index 46142cd..d7d29fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc97e=['Request','GetTrigger','name','channel','status','Condition','AnyConditions','field','value','Action','Actions','action','data2','data3','data4','data5','data6','../client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc97e,0x6b));var _0xec97=function(_0x1dbfa3,_0x5717dd){_0x1dbfa3=_0x1dbfa3-0x0;var _0x4f8e54=_0xc97e[_0x1dbfa3];return _0x4f8e54;};'use strict';var client=require(_0xec97('0x0'));exports['getTriggers']=function(_0xe56945){return function(_0x997ff3){return client[_0xec97('0x1')](_0xec97('0x2'),{'options':{'raw':![],'attributes':['id',_0xec97('0x3'),_0xec97('0x4'),_0xec97('0x5')],'include':[{'model':_0xec97('0x6'),'as':'AllConditions','attributes':['id','field','operator','value']},{'model':_0xec97('0x6'),'as':_0xec97('0x7'),'attributes':['id',_0xec97('0x8'),'operator',_0xec97('0x9')]},{'model':_0xec97('0xa'),'as':_0xec97('0xb'),'attributes':['id',_0xec97('0xc'),'data1',_0xec97('0xd'),_0xec97('0xe'),_0xec97('0xf'),_0xec97('0x10'),_0xec97('0x11'),'data7']}]},'log':_0xec97('0x2')});};};
\ No newline at end of file
+var _0x3763=['GetTrigger','name','channel','Condition','AllConditions','operator','value','AnyConditions','field','Action','data1','data2','data3','data4','data5','data7','getTriggers','Request'];(function(_0x5a7f66,_0x4c82b3){var _0x3e5205=function(_0x1a38a4){while(--_0x1a38a4){_0x5a7f66['push'](_0x5a7f66['shift']());}};_0x3e5205(++_0x4c82b3);}(_0x3763,0xd6));var _0x3376=function(_0x545fe3,_0x3b191f){_0x545fe3=_0x545fe3-0x0;var _0x480702=_0x3763[_0x545fe3];return _0x480702;};'use strict';var client=require('../client');exports[_0x3376('0x0')]=function(_0x1131d5){return function(_0x21c792){return client[_0x3376('0x1')](_0x3376('0x2'),{'options':{'raw':![],'attributes':['id',_0x3376('0x3'),_0x3376('0x4'),'status'],'include':[{'model':_0x3376('0x5'),'as':_0x3376('0x6'),'attributes':['id','field',_0x3376('0x7'),_0x3376('0x8')]},{'model':_0x3376('0x5'),'as':_0x3376('0x9'),'attributes':['id',_0x3376('0xa'),'operator',_0x3376('0x8')]},{'model':_0x3376('0xb'),'as':'Actions','attributes':['id','action',_0x3376('0xc'),_0x3376('0xd'),_0x3376('0xe'),_0x3376('0xf'),_0x3376('0x10'),'data6',_0x3376('0x11')]}]},'log':_0x3376('0x2')});};};
\ No newline at end of file
index 31e060e..dd79f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0214=['GetTrunk','registry','defaultuser','../client','getTrunks','Request'];(function(_0x5230a4,_0x4e430f){var _0xdb8b1f=function(_0x4dd8cb){while(--_0x4dd8cb){_0x5230a4['push'](_0x5230a4['shift']());}};_0xdb8b1f(++_0x4e430f);}(_0x0214,0x15f));var _0x4021=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x0214[_0x292f93];return _0x5a94b1;};'use strict';var client=require(_0x4021('0x0'));exports[_0x4021('0x1')]=function(_0x1ad413){return function(_0x1ec2bf){return client[_0x4021('0x2')](_0x4021('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x4021('0x4'),_0x4021('0x5')]},'log':_0x4021('0x3')});};};
\ No newline at end of file
+var _0x1cde=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x47e3f8,_0x517bcd){var _0x4742d5=function(_0x2a4f20){while(--_0x2a4f20){_0x47e3f8['push'](_0x47e3f8['shift']());}};_0x4742d5(++_0x517bcd);}(_0x1cde,0x1e7));var _0xe1cd=function(_0x28ec2c,_0x32dc36){_0x28ec2c=_0x28ec2c-0x0;var _0x59995b=_0x1cde[_0x28ec2c];return _0x59995b;};'use strict';var client=require(_0xe1cd('0x0'));exports[_0xe1cd('0x1')]=function(_0x111b75){return function(_0x59c221){return client[_0xe1cd('0x2')](_0xe1cd('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe1cd('0x4'),_0xe1cd('0x5'),_0xe1cd('0x6')]},'log':_0xe1cd('0x3')});};};
\ No newline at end of file
index 5d2d856..d670b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x59a8fb,_0x1bf222){var _0x87a642=function(_0x34fa61){while(--_0x34fa61){_0x59a8fb['push'](_0x59a8fb['shift']());}};_0x87a642(++_0x1bf222);}(_0x70e0,0x17b));var _0x070e=function(_0x5db4fe,_0x1b47b3){_0x5db4fe=_0x5db4fe-0x0;var _0x2b2101=_0x70e0[_0x5db4fe];return _0x2b2101;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});};
\ No newline at end of file
+var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xe706,0xa3));var _0x6e70=function(_0x276357,_0x4a4691){_0x276357=_0x276357-0x0;var _0x4395b2=_0xe706[_0x276357];return _0x4395b2;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});};
\ No newline at end of file
index ff8ae3a..3197408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e2b=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x1d88f6,_0x51545b){var _0x21b601=function(_0x4b1998){while(--_0x4b1998){_0x1d88f6['push'](_0x1d88f6['shift']());}};_0x21b601(++_0x51545b);}(_0x2e2b,0x86));var _0xb2e2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2e2b[_0x178e48];return _0x440d7e;};'use strict';var client=require(_0xb2e2('0x0'));exports[_0xb2e2('0x1')]=function(_0x1c5470){return client[_0xb2e2('0x2')](_0xb2e2('0x3'),{'body':_0x1c5470,'log':_0xb2e2('0x3')});};exports[_0xb2e2('0x4')]=function(_0x5f3fd5,_0x5ab22f,_0x4aad70){return client[_0xb2e2('0x2')](_0xb2e2('0x5'),{'body':_0x5f3fd5,'options':{'where':{'uniqueid':_0x5ab22f,'interface':_0x4aad70,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0xdfe7=['Request','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport','update'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xdfe7,0x134));var _0x7dfe=function(_0x2e049a,_0x534294){_0x2e049a=_0x2e049a-0x0;var _0x4419c0=_0xdfe7[_0x2e049a];return _0x4419c0;};'use strict';var client=require(_0x7dfe('0x0'));exports[_0x7dfe('0x1')]=function(_0x4a88fa){return client['Request'](_0x7dfe('0x2'),{'body':_0x4a88fa,'log':'CreateVoiceAgentReport'});};exports[_0x7dfe('0x3')]=function(_0x4c536e,_0x5cec51,_0x542fae){return client[_0x7dfe('0x4')](_0x7dfe('0x5'),{'body':_0x4c536e,'options':{'where':{'uniqueid':_0x5cec51,'interface':_0x542fae,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index 3fa401d..62ecc2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ff=['calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge'];(function(_0x28e637,_0x3a0717){var _0x1f8271=function(_0x36c122){while(--_0x36c122){_0x28e637['push'](_0x28e637['shift']());}};_0x1f8271(++_0x3a0717);}(_0xe5ff,0x19d));var _0xfe5f=function(_0xb5f4f6,_0x44e6f0){_0xb5f4f6=_0xb5f4f6-0x0;var _0x45fbc0=_0xe5ff[_0xb5f4f6];return _0x45fbc0;};'use strict';var moment=require(_0xfe5f('0x0'));var util=require('util');var _=require(_0xfe5f('0x1'));var client=require(_0xfe5f('0x2'));exports[_0xfe5f('0x3')]=function(_0x3275ed){return client[_0xfe5f('0x4')](_0xfe5f('0x5'),{'body':_[_0xfe5f('0x6')](_0x3275ed,{'source':_0x3275ed[_0xfe5f('0x7')],'destinationcontext':_0x3275ed['context'],'callerid':_0x3275ed[_0xfe5f('0x8')],'amaflags':_0xfe5f('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xfe5f('0xa')]=function(){return function(){return client[_0xfe5f('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xfe5f('0xb')],'createdAt':{'$between':[moment()[_0xfe5f('0xc')](_0xfe5f('0xd'))['format'](_0xfe5f('0xe')),moment()[_0xfe5f('0xf')](_0xfe5f('0xd'))[_0xfe5f('0x10')](_0xfe5f('0xe'))]}},'attributes':['type','disposition',_0xfe5f('0x11'),_0xfe5f('0x12')]},'log':_0xfe5f('0x13')});};};
\ No newline at end of file
+var _0x6dd0=['disposition','duration','moment','../client','create','Request','CreateVoiceCallReport','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6dd0,0xdf));var _0x06dd=function(_0x1a4046,_0x4a10fe){_0x1a4046=_0x1a4046-0x0;var _0x458d2c=_0x6dd0[_0x1a4046];return _0x458d2c;};'use strict';var moment=require(_0x06dd('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x06dd('0x1'));exports[_0x06dd('0x2')]=function(_0x22941b){return client[_0x06dd('0x3')](_0x06dd('0x4'),{'body':_['merge'](_0x22941b,{'source':_0x22941b[_0x06dd('0x5')],'destinationcontext':_0x22941b[_0x06dd('0x6')],'callerid':_0x22941b['callerid'],'amaflags':_0x06dd('0x7')}),'log':_0x06dd('0x4')});};exports[_0x06dd('0x8')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x06dd('0x9')],'createdAt':{'$between':[moment()['startOf'](_0x06dd('0xa'))[_0x06dd('0xb')](_0x06dd('0xc')),moment()[_0x06dd('0xd')](_0x06dd('0xa'))[_0x06dd('0xb')](_0x06dd('0xc'))]}},'attributes':[_0x06dd('0xe'),_0x06dd('0xf'),_0x06dd('0x10'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 5bd8d21..e1f9e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebb1=['Request','CreateVoiceDialReport','../client','create'];(function(_0x24c30e,_0x3e8888){var _0x4f87a7=function(_0x163823){while(--_0x163823){_0x24c30e['push'](_0x24c30e['shift']());}};_0x4f87a7(++_0x3e8888);}(_0xebb1,0xbe));var _0x1ebb=function(_0x5688f8,_0x2252f3){_0x5688f8=_0x5688f8-0x0;var _0x31f44a=_0xebb1[_0x5688f8];return _0x31f44a;};'use strict';var client=require(_0x1ebb('0x0'));exports[_0x1ebb('0x1')]=function(_0x3030e9){return client[_0x1ebb('0x2')](_0x1ebb('0x3'),{'body':_0x3030e9,'log':_0x1ebb('0x3')});};
\ No newline at end of file
+var _0x3f2b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x102a07,_0x1c1cd1){var _0x4288ac=function(_0xe3cf0c){while(--_0xe3cf0c){_0x102a07['push'](_0x102a07['shift']());}};_0x4288ac(++_0x1c1cd1);}(_0x3f2b,0x105));var _0xb3f2=function(_0x2e36c0,_0x82bd7d){_0x2e36c0=_0x2e36c0-0x0;var _0x372c8a=_0x3f2b[_0x2e36c0];return _0x372c8a;};'use strict';var client=require(_0xb3f2('0x0'));exports[_0xb3f2('0x1')]=function(_0x26f283){return client[_0xb3f2('0x2')](_0xb3f2('0x3'),{'body':_0x26f283,'log':_0xb3f2('0x3')});};
\ No newline at end of file
index cfc2f25..d1797e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593e=['getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x1efd6a,_0x3bd5e5){var _0x102817=function(_0x4a9e13){while(--_0x4a9e13){_0x1efd6a['push'](_0x1efd6a['shift']());}};_0x102817(++_0x3bd5e5);}(_0x593e,0xcb));var _0xe593=function(_0x2e44da,_0x5f4366){_0x2e44da=_0x2e44da-0x0;var _0x2a859f=_0x593e[_0x2e44da];return _0x2a859f;};'use strict';var client=require(_0xe593('0x0'));exports[_0xe593('0x1')]=function(){return function(){return client[_0xe593('0x2')](_0xe593('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe593('0x4'),_0xe593('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xe593('0x1')});};};
\ No newline at end of file
+var _0xe43c=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xe43c,0x180));var _0xce43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe43c[_0x2641f9];return _0x585741;};'use strict';var client=require(_0xce43('0x0'));exports[_0xce43('0x1')]=function(){return function(){return client[_0xce43('0x2')](_0xce43('0x3'),{'options':{'raw':!![],'attributes':['id',_0xce43('0x4'),_0xce43('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index cea754f..6d04d75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594c=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','../client','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x27a0bd,_0x41e831){var _0xa68da6=function(_0x5abb69){while(--_0x5abb69){_0x27a0bd['push'](_0x27a0bd['shift']());}};_0xa68da6(++_0x41e831);}(_0x594c,0x174));var _0xc594=function(_0x4f155b,_0x2b3319){_0x4f155b=_0x4f155b-0x0;var _0x5a8943=_0x594c[_0x4f155b];return _0x5a8943;};'use strict';var client=require(_0xc594('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xc594('0x1'),_0xc594('0x2'),_0xc594('0x3'),_0xc594('0x4'),_0xc594('0x5'),'type',_0xc594('0x6'),_0xc594('0x7'),_0xc594('0x8'),_0xc594('0x9'),'dialPowerLevel',_0xc594('0xa'),_0xc594('0xb'),_0xc594('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xc594('0xd'),_0xc594('0xe'),'dialQueueTimeout','dialQueueProject',_0xc594('0xf'),'dialCongestionRetryFrequency',_0xc594('0x10'),_0xc594('0x11'),_0xc594('0x12'),_0xc594('0x13'),_0xc594('0x14'),'dialTimezone',_0xc594('0x15'),_0xc594('0x16'),_0xc594('0x17'),_0xc594('0x18'),_0xc594('0x19'),_0xc594('0x1a'),'dialAMDAfterGreetingSilence',_0xc594('0x1b'),_0xc594('0x1c'),_0xc594('0x1d'),_0xc594('0x1e'),_0xc594('0x1f'),_0xc594('0x20'),_0xc594('0x21'),'dialRecallMeTimeout',_0xc594('0x22'),_0xc594('0x23'),_0xc594('0x24'),'dialAgiAfterHangupClient','dialQueueProject2',_0xc594('0x5'),_0xc594('0x25'),_0xc594('0x26'),_0xc594('0x27'),_0xc594('0x28'),_0xc594('0x29'),_0xc594('0x2a'),_0xc594('0x2b'),_0xc594('0x2c'),_0xc594('0x2d'),'dialMachineMaxRetry',_0xc594('0x2e'),_0xc594('0x2f'),'dialAgentRejectRetryFrequency',_0xc594('0x30'),'dialPredictiveIntervalMaxThreshold',_0xc594('0x31')],'include':[{'model':_0xc594('0x32'),'as':_0xc594('0x32'),'attributes':['id',_0xc594('0x1'),'callerid',_0xc594('0x33')]},{'model':_0xc594('0x34'),'as':_0xc594('0x35'),'attributes':['id',_0xc594('0x1')]},{'model':'Trunk','as':_0xc594('0x36'),'attributes':['id','name',_0xc594('0x37'),_0xc594('0x33')]},{'model':_0xc594('0x38'),'as':_0xc594('0x38'),'attributes':['id',_0xc594('0x1')],'include':[{'model':'Interval','as':_0xc594('0x39'),'attributes':['id',_0xc594('0x1'),'interval']}]}]},'log':_0xc594('0x3a')});};};
\ No newline at end of file
+var _0xbb5b=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','../client','Request','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xbb5b,0x1bb));var _0xbbb5=function(_0x127c7b,_0x1f65e7){_0x127c7b=_0x127c7b-0x0;var _0x1708eb=_0xbb5b[_0x127c7b];return _0x1708eb;};'use strict';var client=require(_0xbbb5('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xbbb5('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xbbb5('0x2'),_0xbbb5('0x3'),_0xbbb5('0x4'),'autopause',_0xbbb5('0x5'),_0xbbb5('0x6'),_0xbbb5('0x7'),_0xbbb5('0x8'),_0xbbb5('0x9'),_0xbbb5('0xa'),'dialPowerLevel','dialPredictiveOptimization',_0xbbb5('0xb'),'dialPredictiveInterval',_0xbbb5('0xc'),_0xbbb5('0xd'),_0xbbb5('0xe'),_0xbbb5('0xf'),_0xbbb5('0x10'),'dialQueueProject',_0xbbb5('0x11'),_0xbbb5('0x12'),'dialBusyMaxRetry',_0xbbb5('0x13'),_0xbbb5('0x14'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xbbb5('0x15'),_0xbbb5('0x16'),'dialPrefix','dialCheckDuplicateType','dialAMDActive',_0xbbb5('0x17'),_0xbbb5('0x18'),_0xbbb5('0x19'),_0xbbb5('0x1a'),_0xbbb5('0x1b'),_0xbbb5('0x1c'),'dialAMDMaximumNumberOfWords',_0xbbb5('0x1d'),_0xbbb5('0x1e'),_0xbbb5('0x1f'),_0xbbb5('0x20'),_0xbbb5('0x21'),_0xbbb5('0x22'),_0xbbb5('0x23'),'dialAgiAfterHangupClient','dialQueueProject2',_0xbbb5('0x5'),_0xbbb5('0x24'),_0xbbb5('0x25'),_0xbbb5('0x26'),_0xbbb5('0x27'),'dialNoSuchNumberRetryFrequency',_0xbbb5('0x28'),_0xbbb5('0x29'),_0xbbb5('0x2a'),_0xbbb5('0x2b'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0xbbb5('0x2c'),_0xbbb5('0x2d'),_0xbbb5('0x2e'),_0xbbb5('0x2f'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xbbb5('0x30'),'as':'Trunk','attributes':['id',_0xbbb5('0x2'),_0xbbb5('0x31'),_0xbbb5('0x32')]},{'model':_0xbbb5('0x33'),'as':_0xbbb5('0x34'),'attributes':['id',_0xbbb5('0x2')]},{'model':_0xbbb5('0x30'),'as':'TrunkBackup','attributes':['id',_0xbbb5('0x2'),_0xbbb5('0x31'),_0xbbb5('0x32')]},{'model':_0xbbb5('0x35'),'as':_0xbbb5('0x35'),'attributes':['id',_0xbbb5('0x2')],'include':[{'model':'Interval','as':_0xbbb5('0x36'),'attributes':['id',_0xbbb5('0x2'),_0xbbb5('0x37')]}]}]},'log':_0xbbb5('0x38')});};};
\ No newline at end of file
index e0b5963..eb29a53 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(_0x5edfc5,_0x1563ab){var _0x35a64a=function(_0x18fefd){while(--_0x18fefd){_0x5edfc5['push'](_0x5edfc5['shift']());}};_0x35a64a(++_0x1563ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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(_0x28eb67,_0x4fa1c7){var _0x1f8d8d=function(_0x159b64){while(--_0x159b64){_0x28eb67['push'](_0x28eb67['shift']());}};_0x1f8d8d(++_0x4fa1c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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 e3aeb4c..35f1e83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7e9=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x25e532,_0x4a2f35){var _0x2f29ca=function(_0x5333e2){while(--_0x5333e2){_0x25e532['push'](_0x25e532['shift']());}};_0x2f29ca(++_0x4a2f35);}(_0xd7e9,0x1bf));var _0x9d7e=function(_0x2ba901,_0x5e6c6b){_0x2ba901=_0x2ba901-0x0;var _0x1803aa=_0xd7e9[_0x2ba901];return _0x1803aa;};'use strict';var client=require(_0x9d7e('0x0'));exports[_0x9d7e('0x1')]=function(_0x2b7dbe){return function(){return client[_0x9d7e('0x2')](_0x9d7e('0x3'),{'options':{'where':{'VoiceQueueId':_0x2b7dbe,'paused':!![]},'raw':!![]},'log':_0x9d7e('0x1')});};};
\ No newline at end of file
+var _0x1251=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x3c8018,_0x4f3203){var _0x1ad526=function(_0x2ba184){while(--_0x2ba184){_0x3c8018['push'](_0x3c8018['shift']());}};_0x1ad526(++_0x4f3203);}(_0x1251,0xdf));var _0x1125=function(_0x178e0d,_0x699d7){_0x178e0d=_0x178e0d-0x0;var _0x4c0e24=_0x1251[_0x178e0d];return _0x4c0e24;};'use strict';var client=require(_0x1125('0x0'));exports[_0x1125('0x1')]=function(_0x397605){return function(){return client[_0x1125('0x2')](_0x1125('0x3'),{'options':{'where':{'VoiceQueueId':_0x397605,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};};
\ No newline at end of file
index 58bf548..9471885 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x320627,_0x58a94a){var _0x35b028=function(_0xde5e1c){while(--_0xde5e1c){_0x320627['push'](_0x320627['shift']());}};_0x35b028(++_0x58a94a);}(_0x7a54,0x106));var _0x47a5=function(_0x339b52,_0x21a8bd){_0x339b52=_0x339b52-0x0;var _0xae13c7=_0x7a54[_0x339b52];return _0xae13c7;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x795c7b,_0x41449d){var _0x53cae3=function(_0xb55a77){while(--_0xb55a77){_0x795c7b['push'](_0x795c7b['shift']());}};_0x53cae3(++_0x41449d);}(_0x7a54,0x106));var _0x47a5=function(_0x51809a,_0x52b7b4){_0x51809a=_0x51809a-0x0;var _0x313cdf=_0x7a54[_0x51809a];return _0x313cdf;};'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 75677bf..3c24d45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfac=['transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename'];(function(_0x1af85c,_0x1844d7){var _0x1c61c7=function(_0x99cd2e){while(--_0x99cd2e){_0x1af85c['push'](_0x1af85c['shift']());}};_0x1c61c7(++_0x1844d7);}(_0xbfac,0x6f));var _0xcbfa=function(_0x5f0c9b,_0x2a9ce6){_0x5f0c9b=_0x5f0c9b-0x0;var _0x71ff86=_0xbfac[_0x5f0c9b];return _0x71ff86;};'use strict';var client=require(_0xcbfa('0x0'));exports[_0xcbfa('0x1')]={};exports[_0xcbfa('0x2')]=function(_0x20b69e){return client[_0xcbfa('0x3')](_0xcbfa('0x4'),{'body':{'result':_0x20b69e[_0xcbfa('0x5')],'transfererchannel':_0x20b69e['transfererchannel'],'transferercalleridnum':_0x20b69e[_0xcbfa('0x6')],'transferercalleridname':_0x20b69e['transferercalleridname'],'transfererconnectedlinenum':_0x20b69e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x20b69e[_0xcbfa('0x7')],'transfereraccountcode':_0x20b69e['transfereraccountcode'],'transferercontext':_0x20b69e['transferercontext'],'transfererexten':_0x20b69e[_0xcbfa('0x8')],'transfererlinkedid':_0x20b69e[_0xcbfa('0x9')],'transfereechannel':_0x20b69e[_0xcbfa('0xa')],'transfereecalleridnum':_0x20b69e[_0xcbfa('0xb')],'transfereecalleridname':_0x20b69e[_0xcbfa('0xc')],'transfereeconnectedlinenum':_0x20b69e[_0xcbfa('0xd')],'transfereeconnectedlinename':_0x20b69e[_0xcbfa('0xe')],'transfereeaccountcode':_0x20b69e[_0xcbfa('0xf')],'transfereecontext':_0x20b69e[_0xcbfa('0x10')],'transfereeexten':_0x20b69e[_0xcbfa('0x11')],'transfereelinkedid':_0x20b69e[_0xcbfa('0x12')],'isexternal':_0x20b69e[_0xcbfa('0x13')],'context':_0x20b69e[_0xcbfa('0x14')],'extension':_0x20b69e[_0xcbfa('0x15')],'type':_0xcbfa('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0xcbfa('0x17')]=function(_0x50c835){return client['Request'](_0xcbfa('0x4'),{'body':{'result':_0x50c835['result'],'transfererchannel':_0x50c835[_0xcbfa('0x18')],'transferercalleridnum':_0x50c835[_0xcbfa('0x19')],'transferercalleridname':_0x50c835[_0xcbfa('0x1a')],'transfererconnectedlinenum':_0x50c835[_0xcbfa('0x1b')],'transfererconnectedlinename':_0x50c835[_0xcbfa('0x1c')],'transfereraccountcode':_0x50c835[_0xcbfa('0x1d')],'transferercontext':_0x50c835[_0xcbfa('0x1e')],'transfererexten':_0x50c835[_0xcbfa('0x1f')],'transfererlinkedid':_0x50c835[_0xcbfa('0x20')],'transfereechannel':_0x50c835['transfertargetchannel'],'transfereecalleridnum':_0x50c835[_0xcbfa('0x21')],'transfereecalleridname':_0x50c835['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x50c835[_0xcbfa('0x22')],'transfereeconnectedlinename':_0x50c835[_0xcbfa('0x23')],'transfereeaccountcode':_0x50c835['transfertargetaccountcode'],'transfereecontext':_0x50c835[_0xcbfa('0x24')],'transfereeexten':_0x50c835[_0xcbfa('0x25')],'transfereelinkedid':_0x50c835[_0xcbfa('0x26')],'isexternal':_0x50c835['isexternal'],'context':_0x50c835[_0xcbfa('0x27')],'extension':_0x50c835[_0xcbfa('0x28')],'type':_0xcbfa('0x29')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0xe8dd=['transfererlinkedid','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended','../client','transfers','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten'];(function(_0x1b4912,_0x3e8bb9){var _0x48cac5=function(_0x55798b){while(--_0x55798b){_0x1b4912['push'](_0x1b4912['shift']());}};_0x48cac5(++_0x3e8bb9);}(_0xe8dd,0x180));var _0xde8d=function(_0x166135,_0x4f3876){_0x166135=_0x166135-0x0;var _0x3031cb=_0xe8dd[_0x166135];return _0x3031cb;};'use strict';var client=require(_0xde8d('0x0'));exports[_0xde8d('0x1')]={};exports['blindTransfer']=function(_0x1ef2b7){return client['Request'](_0xde8d('0x2'),{'body':{'result':_0x1ef2b7[_0xde8d('0x3')],'transfererchannel':_0x1ef2b7[_0xde8d('0x4')],'transferercalleridnum':_0x1ef2b7[_0xde8d('0x5')],'transferercalleridname':_0x1ef2b7[_0xde8d('0x6')],'transfererconnectedlinenum':_0x1ef2b7[_0xde8d('0x7')],'transfererconnectedlinename':_0x1ef2b7[_0xde8d('0x8')],'transfereraccountcode':_0x1ef2b7[_0xde8d('0x9')],'transferercontext':_0x1ef2b7[_0xde8d('0xa')],'transfererexten':_0x1ef2b7[_0xde8d('0xb')],'transfererlinkedid':_0x1ef2b7[_0xde8d('0xc')],'transfereechannel':_0x1ef2b7['transfereechannel'],'transfereecalleridnum':_0x1ef2b7[_0xde8d('0xd')],'transfereecalleridname':_0x1ef2b7[_0xde8d('0xe')],'transfereeconnectedlinenum':_0x1ef2b7['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x1ef2b7[_0xde8d('0xf')],'transfereeaccountcode':_0x1ef2b7['transfereeaccountcode'],'transfereecontext':_0x1ef2b7['transfereecontext'],'transfereeexten':_0x1ef2b7['transfereeexten'],'transfereelinkedid':_0x1ef2b7[_0xde8d('0x10')],'isexternal':_0x1ef2b7[_0xde8d('0x11')],'context':_0x1ef2b7[_0xde8d('0x12')],'extension':_0x1ef2b7[_0xde8d('0x13')],'type':_0xde8d('0x14')},'log':_0xde8d('0x2')});};exports[_0xde8d('0x15')]=function(_0x51f1cf){return client[_0xde8d('0x16')]('CreateVoiceTransferReport',{'body':{'result':_0x51f1cf[_0xde8d('0x3')],'transfererchannel':_0x51f1cf[_0xde8d('0x17')],'transferercalleridnum':_0x51f1cf['origtransferercalleridnum'],'transferercalleridname':_0x51f1cf[_0xde8d('0x18')],'transfererconnectedlinenum':_0x51f1cf[_0xde8d('0x19')],'transfererconnectedlinename':_0x51f1cf[_0xde8d('0x1a')],'transfereraccountcode':_0x51f1cf['origtransfereraccountcode'],'transferercontext':_0x51f1cf[_0xde8d('0x1b')],'transfererexten':_0x51f1cf[_0xde8d('0x1c')],'transfererlinkedid':_0x51f1cf['origtransfererlinkedid'],'transfereechannel':_0x51f1cf['transfertargetchannel'],'transfereecalleridnum':_0x51f1cf['transfertargetcalleridnum'],'transfereecalleridname':_0x51f1cf['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x51f1cf[_0xde8d('0x1d')],'transfereeconnectedlinename':_0x51f1cf[_0xde8d('0x1e')],'transfereeaccountcode':_0x51f1cf[_0xde8d('0x1f')],'transfereecontext':_0x51f1cf[_0xde8d('0x20')],'transfereeexten':_0x51f1cf['transfertargetexten'],'transfereelinkedid':_0x51f1cf['transfertargetlinkedid'],'isexternal':_0x51f1cf[_0xde8d('0x11')],'context':_0x51f1cf[_0xde8d('0x21')],'extension':_0x51f1cf[_0xde8d('0x22')],'type':_0xde8d('0x23')},'log':_0xde8d('0x2')});};
\ No newline at end of file
index 0726719..c32d5cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['ami\x20disconnected','join','pick','keys','module','action','Action','then','catch','message','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','validate','uniqueid','%s.%s','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','monitors','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','filename','status','stop','StopMixMonitor\x20Success','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','name','timers','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x483e4a,_0x32aa45){_0x483e4a=_0x483e4a-0x0;var _0x31fba5=_0x5162[_0x483e4a];return _0x31fba5;};'use strict';var _=require(_0x2516('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require('bluebird');var moment=require(_0x2516('0x1'));var config=require(_0x2516('0x2'));var properties=require(_0x2516('0x3'));var ami=require(_0x2516('0x4'));exports[_0x2516('0x5')]=function(_0x25dce6,_0x3a7984,_0x5b71b5){return new BPromise(function(_0x48f411,_0x5beeb3){var _0x20a4a4={'QueuePause':function(_0xba4b36){return new Promise(function(_0xa1557,_0x3a8834){var _0x3abc5d=util[_0x2516('0x6')](_0x2516('0x7'),'SIP',_0xba4b36[_0x2516('0x8')]);if(_0x25dce6[_0x2516('0x9')]&&_0x25dce6[_0x2516('0x9')][_0x3abc5d]&&_0x25dce6['timers'][_0x3abc5d]['timer']){_0x25dce6['timers'][_0x3abc5d]['updateAcw']();}if(_0x25dce6[_0x2516('0xa')][_0x3abc5d]){_0x25dce6[_0x2516('0xa')][_0x3abc5d][_0x2516('0xb')]({'statePause':_0xba4b36[_0x2516('0xc')]?!![]:![]});}_0xa1557({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x33496b){var _0x458aca=this;return new Promise(function(_0x171da2,_0xb28714){if(ami[_0x2516('0xd')]()==![]){return _0xb28714(_0x458aca[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}_0x33496b=_[_0x2516('0x13')](_0x33496b,_[_0x2516('0x14')](properties[_0x2516('0x15')]));_0x33496b[_0x2516('0x16')]='Reload';return ami[_0x2516('0x17')](_0x33496b)[_0x2516('0x18')](function(_0x1a1005){_0x171da2({'code':0xc8,'message':_0x1a1005['message']});})[_0x2516('0x19')](function(_0x5e96c7){_0xb28714(_0x458aca['error'](0x1f5,_0x5e96c7[_0x2516('0x1a')]));});});},'Command':function(_0x3583cf){var _0x151168=this;return new Promise(function(_0x618aed,_0x198b93){if(ami[_0x2516('0xd')]()==![]){return _0x198b93(_0x151168[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}_0x3583cf=_[_0x2516('0x13')](_0x3583cf,'command');_0x3583cf['action']=_0x2516('0x1b');return ami[_0x2516('0x17')](_0x3583cf)[_0x2516('0x18')](function(_0x2d5b1b){_0x618aed({'code':0xc8,'message':_0x2d5b1b[_0x2516('0x1c')]});})[_0x2516('0x19')](function(_0x3d906d){_0x198b93(_0x151168[_0x2516('0xe')](0x1f5,_0x3d906d['message']));});});},'VoiceQueues':function(_0xa4538d){return new Promise(function(_0x39c63f,_0x774b60){var _0x434d54=[];for(var _0x47f4fb in _0x25dce6[_0x2516('0x1d')]){if(_0x25dce6[_0x2516('0x1d')][_0x2516('0x1e')](_0x47f4fb)){var _0x3d728a=_0x25dce6[_0x2516('0x1d')][_0x47f4fb];var _0x4a3dc8={'id':_0x3d728a['id'],'name':_0x3d728a[_0x2516('0x8')],'strategy':_0x3d728a[_0x2516('0x1f')],'answered':_0x3d728a[_0x2516('0x20')],'available':_0x3d728a[_0x2516('0x21')],'loggedIn':_0x3d728a[_0x2516('0x22')],'pTalking':_0x3d728a[_0x2516('0x23')],'sumBillable':_0x3d728a['sumBillable'],'sumDuration':_0x3d728a[_0x2516('0x24')],'sumHoldTime':_0x3d728a[_0x2516('0x25')]||0x0,'talking':_0x3d728a['talking'],'total':_0x3d728a[_0x2516('0x26')],'type':_0x3d728a[_0x2516('0x27')],'unmanaged':_0x3d728a[_0x2516('0x28')],'abandoned':_0x3d728a[_0x2516('0x29')],'waiting':_0x3d728a[_0x2516('0x2a')],'loggedInDb':_0x3d728a[_0x2516('0x2b')]};if(_0x3d728a[_0x2516('0x27')]===_0x2516('0x2c')){_0x4a3dc8[_0x2516('0x2d')]=_0x3d728a[_0x2516('0x2d')];_0x4a3dc8[_0x2516('0x2e')]=_0x3d728a[_0x2516('0x2e')];_0x4a3dc8[_0x2516('0x2f')]=_0x3d728a[_0x2516('0x2f')];_0x4a3dc8[_0x2516('0x30')]=_0x3d728a['dialOriginateCallerIdNumber'];_0x4a3dc8[_0x2516('0x31')]=_0x3d728a['dialOriginateTimeout'];_0x4a3dc8[_0x2516('0x32')]=_0x3d728a['dialPrefix'];_0x4a3dc8[_0x2516('0x33')]=_0x3d728a['temp'];_0x4a3dc8[_0x2516('0x34')]=_0x3d728a[_0x2516('0x34')];_0x4a3dc8[_0x2516('0x35')]=_0x3d728a[_0x2516('0x35')];_0x4a3dc8[_0x2516('0x36')]=_0x3d728a[_0x2516('0x36')];_0x4a3dc8[_0x2516('0x37')]=_0x3d728a[_0x2516('0x37')];_0x4a3dc8[_0x2516('0x38')]=_0x3d728a['outboundCongestionCallsDay'];_0x4a3dc8[_0x2516('0x39')]=_0x3d728a[_0x2516('0x39')];_0x4a3dc8[_0x2516('0x3a')]=_0x3d728a[_0x2516('0x3a')];_0x4a3dc8['outboundDropCallsDayTimeout']=_0x3d728a['outboundDropCallsDayTimeout'];_0x4a3dc8[_0x2516('0x3b')]=_0x3d728a[_0x2516('0x3b')];_0x4a3dc8[_0x2516('0x3c')]=_0x3d728a[_0x2516('0x3c')];_0x4a3dc8[_0x2516('0x3d')]=_0x3d728a[_0x2516('0x3d')];_0x4a3dc8[_0x2516('0x3e')]=_0x3d728a[_0x2516('0x3e')];_0x4a3dc8[_0x2516('0x3f')]=_0x3d728a[_0x2516('0x3f')];_0x4a3dc8['outboundUnknownCallsDay']=_0x3d728a['outboundUnknownCallsDay'];_0x4a3dc8[_0x2516('0x40')]=_0x3d728a[_0x2516('0x40')];_0x4a3dc8['predictiveIntervalAvgHoldtime']=_0x3d728a['predictiveIntervalAvgHoldtime'];_0x4a3dc8[_0x2516('0x41')]=_0x3d728a[_0x2516('0x41')];_0x4a3dc8['predictiveIntervalDroppedCallsCallersExit']=_0x3d728a[_0x2516('0x42')];_0x4a3dc8['predictiveIntervalDroppedCallsTimeout']=_0x3d728a[_0x2516('0x43')];_0x4a3dc8[_0x2516('0x44')]=_0x3d728a['predictiveIntervalErlangCalls'];_0x4a3dc8[_0x2516('0x45')]=_0x3d728a[_0x2516('0x45')];_0x4a3dc8[_0x2516('0x46')]=_0x3d728a[_0x2516('0x46')];_0x4a3dc8[_0x2516('0x47')]=_0x3d728a[_0x2516('0x47')];_0x4a3dc8[_0x2516('0x48')]=_0x3d728a[_0x2516('0x48')];_0x4a3dc8[_0x2516('0x49')]=_0x3d728a[_0x2516('0x49')];_0x4a3dc8[_0x2516('0x4a')]=_0x3d728a[_0x2516('0x4a')];_0x4a3dc8[_0x2516('0x1a')]=_0x3d728a['message'];_0x4a3dc8[_0x2516('0x4b')]=_0x3d728a[_0x2516('0x4b')];_0x4a3dc8['erlangCalls']=_0x3d728a[_0x2516('0x4c')];_0x4a3dc8[_0x2516('0x4d')]=_0x3d728a[_0x2516('0x4d')];_0x4a3dc8[_0x2516('0x4e')]=_0x3d728a[_0x2516('0x4e')];_0x4a3dc8['erlangBusyFactor']=_0x3d728a[_0x2516('0x4f')];_0x4a3dc8[_0x2516('0x50')]=_0x3d728a[_0x2516('0x50')];_0x4a3dc8[_0x2516('0x51')]=_0x3d728a[_0x2516('0x51')];}if(_0x3d728a[_0x2516('0x52')]){_0x4a3dc8['Trunk']={'id':_0x3d728a[_0x2516('0x52')]['id'],'name':_0x3d728a[_0x2516('0x52')][_0x2516('0x8')],'active':_0x3d728a[_0x2516('0x52')][_0x2516('0x53')],'callerid':_0x3d728a[_0x2516('0x52')][_0x2516('0x54')]};}if(_0x3d728a['Interval']){_0x4a3dc8[_0x2516('0x55')]={'id':_0x3d728a['Interval']['id'],'name':_0x3d728a[_0x2516('0x55')]['name']};}_0x434d54[_0x2516('0x56')](_0x4a3dc8);}}_0x39c63f({'count':_0x434d54[_0x2516('0x57')],'rows':_0x434d54});});},'UpdateVoiceQueue':function(_0x427cf6){return new Promise(function(_0x47f9a0,_0x4a2de3){var _0x2ede9f=_[_0x2516('0x58')](_0x25dce6['voiceQueues'],{'id':parseInt(_0x427cf6['id'])});var _0x5471e5=_[_0x2516('0x59')](_0x427cf6,['id']);if(_0x2ede9f){for(var _0x147e05 in _0x5471e5){if(typeof _0x5471e5[_0x147e05]!==_0x2516('0x5a')&&typeof _0x2ede9f[_0x147e05]!=='undefined'){_0x2ede9f[_0x147e05]=_0x5471e5[_0x147e05];}}_0x47f9a0(_0x2ede9f);}else{_0x4a2de3();}});},'VoiceChannels':function(_0xddc748){return new Promise(function(_0x4899ae,_0x2c7e2d){var _0x39fd32=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x5c')]);_0x4899ae({'count':_0x39fd32['length'],'rows':_0x39fd32});});},'VoiceChannelMixMonitor':function(_0x56d3e5){var _0xa08af4=this;return new Promise(function(_0x16b382,_0x236048){if(ami[_0x2516('0xd')]()==![]){return _0x236048(_0xa08af4['error'](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')]['join']('\x20')));}var _0x45e179=schema(properties[_0x2516('0x5d')])[_0x2516('0x5e')](_0x56d3e5);if(_0x45e179[_0x2516('0x57')]>0x0){return _0x236048(_0xa08af4[_0x2516('0xe')](0x1f4,_['map'](_0x45e179,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0x136d5c=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x5c')],{'uniqueid':_0x56d3e5[_0x2516('0x5f')]});if(_0x136d5c&&_0x136d5c['channel']){var _0x4f3eba=util['format'](_0x2516('0x60'),_0x56d3e5['filename']||_0x56d3e5['uniqueid'],_0x56d3e5['format']||_0x2516('0x61'));return ami[_0x2516('0x17')]({'action':_0x2516('0x62'),'channel':_0x136d5c[_0x2516('0x63')],'file':_0x4f3eba,'options':_0x2516('0x64')})['then'](function(_0x1c1e14){var _0x32b432=_[_0x2516('0x58')](_0x136d5c['monitors'],{'filename':_0x2516('0x65')+_0x4f3eba[_0x2516('0x66')]()});if(_['isNil'](_0x32b432)){_0x136d5c[_0x2516('0x67')][_0x2516('0x56')]({'filename':_0x2516('0x65')+_0x4f3eba[_0x2516('0x66')](),'createdAt':moment()[_0x2516('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x1c1e14['mixmonitorid'],'status':_0x2516('0x68')});}else{_0x32b432['mixmonitorid']=_0x1c1e14[_0x2516('0x69')];_0x32b432['status']=_0x2516('0x68');}_0x16b382({'code':0xc8,'message':[_0x56d3e5[_0x2516('0x5f')],_0x2516('0x6a'),_0x1c1e14[_0x2516('0x69')]][_0x2516('0x12')]('\x20'),'mixmonitorid':_0x1c1e14[_0x2516('0x69')]});})[_0x2516('0x19')](function(_0xf9c375){_0x236048(_0xa08af4[_0x2516('0xe')](0x1f5,[_0x56d3e5[_0x2516('0x5f')],_0xf9c375[_0x2516('0x1a')]['toLowerCase']()][_0x2516('0x12')]('\x20')));});}else{return _0x236048(_0xa08af4[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x48dc96){var _0x26715c=this;return new Promise(function(_0x58eff3,_0x435450){if(ami[_0x2516('0xd')]()==![]){return _0x435450(_0x26715c[_0x2516('0xe')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x2c2032=schema(properties[_0x2516('0x5d')])['validate'](_0x48dc96);if(_0x2c2032[_0x2516('0x57')]>0x0){return _0x435450(_0x26715c[_0x2516('0xe')](0x1f4,_[_0x2516('0x6c')](_0x2c2032,'message')[_0x2516('0x12')](',\x20')));}var _0x4300b0=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x5c')],{'uniqueid':_0x48dc96[_0x2516('0x5f')]});if(_0x4300b0){return BPromise[_0x2516('0x6d')]()[_0x2516('0x18')](function(){if(_0x4300b0[_0x2516('0x63')]){return ami[_0x2516('0x17')]({'action':_0x2516('0x6e'),'channel':_0x4300b0[_0x2516('0x63')],'mixmonitorid':_0x48dc96[_0x2516('0x69')]})[_0x2516('0x19')](function(_0x47f211){});}})[_0x2516('0x18')](function(){if(_0x4300b0[_0x2516('0x6f')]){return ami[_0x2516('0x17')]({'action':_0x2516('0x6e'),'channel':_0x4300b0[_0x2516('0x6f')],'mixmonitorid':_0x48dc96[_0x2516('0x69')]})[_0x2516('0x19')](function(_0x496001){});}})[_0x2516('0x18')](function(_0xab7abf){var _0x2ee658=_[_0x2516('0x58')](_0x4300b0[_0x2516('0x67')],{'mixmonitorid':_0x48dc96[_0x2516('0x69')]});if(_0x2ee658){_0x2ee658['status']='stop';}})['then'](function(){var _0x331d78=util[_0x2516('0x6')](_0x2516('0x60'),_0x48dc96[_0x2516('0x70')]||_0x48dc96['uniqueid'],_0x48dc96['format']||_0x2516('0x61'));var _0x56645a=_[_0x2516('0x58')](_0x4300b0[_0x2516('0x67')],{'filename':'/var/spool/asterisk/monitor/'+_0x331d78[_0x2516('0x66')]()});if(_0x56645a){_0x56645a[_0x2516('0x71')]=_0x2516('0x72');}})[_0x2516('0x18')](function(){_0x58eff3({'code':0xc8,'message':[_0x48dc96[_0x2516('0x5f')],_0x2516('0x73')][_0x2516('0x12')]('\x20')});})[_0x2516('0x19')](function(_0x120f03){_0x435450(_0x26715c['error'](0x1f5,[_0x48dc96['uniqueid'],_0x120f03[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')));});}else{return _0x435450(_0x26715c['error'](0x1f5,_0x2516('0x6b')));}});},'VoiceQueuesChannels':function(_0x556641){return new Promise(function(_0x44bfef,_0x3f6601){var _0x1b8c97=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x74')]);_0x44bfef({'count':_0x1b8c97[_0x2516('0x57')],'rows':_0x1b8c97});});},'VoiceQueuesChannel':function(_0x3d0d99){var _0x3379f8=this;return new Promise(function(_0x6029a3,_0x129987){var _0x4eaddd=schema(properties['voicequeuechannel'])[_0x2516('0x5e')](_0x3d0d99);if(_0x4eaddd['length']>0x0){return _0x129987(_0x3379f8['error'](0x1f4,_[_0x2516('0x6c')](_0x4eaddd,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0xa4eeae=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x3d0d99[_0x2516('0x5f')]});if(_0xa4eeae){_0x6029a3(_0xa4eeae);}else{return _0x129987(_0x3379f8[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x5d481b){var _0xe966c8=this;return new Promise(function(_0x2e1029,_0x350562){if(ami[_0x2516('0xd')]()==![]){return _0x350562(_0xe966c8['error'](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x3c4f24=schema(properties['voicequeuechannelhangup'])[_0x2516('0x5e')](_0x5d481b);if(_0x3c4f24['length']>0x0){return _0x350562(_0xe966c8['error'](0x1f4,_[_0x2516('0x6c')](_0x3c4f24,_0x2516('0x1a'))[_0x2516('0x12')](',\x20')));}var _0x49a992=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x5d481b[_0x2516('0x5f')]});if(_0x49a992&&_0x49a992[_0x2516('0x63')]){return ami['Action']({'action':_0x2516('0x75'),'channel':_0x49a992[_0x2516('0x63')]})[_0x2516('0x18')](function(_0x1d1983){_0x2e1029({'code':0xc8,'message':[_0x5d481b['uniqueid'],_0x1d1983[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')});})['catch'](function(_0x2397ba){_0x350562(_0xe966c8['error'](0x1f5,[_0x5d481b[_0x2516('0x5f')],_0x2397ba[_0x2516('0x1a')][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')));});}else{return _0x350562(_0xe966c8[_0x2516('0xe')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5f0806){var _0x4d671b=this;return new Promise(function(_0x3d8389,_0x444391){if(ami['isConnected']()==![]){return _0x444391(_0x4d671b[_0x2516('0xe')](0x1f4,[config[_0x2516('0xf')]['ip'],config[_0x2516('0xf')][_0x2516('0x10')],_0x2516('0x11')][_0x2516('0x12')]('\x20')));}var _0x493c5c=schema(properties[_0x2516('0x76')])[_0x2516('0x5e')](_0x5f0806);if(_0x493c5c[_0x2516('0x57')]>0x0){return _0x444391(_0x4d671b['error'](0x1f4,_['map'](_0x493c5c,'message')[_0x2516('0x12')](',\x20')));}var _0x2dc677=_[_0x2516('0x58')](_0x25dce6[_0x2516('0x74')],{'uniqueid':_0x5f0806['uniqueid']});if(_0x2dc677&&_0x2dc677['channel']){return ami['Action']({'action':_0x2516('0x77'),'channel':_0x2dc677[_0x2516('0x63')],'exten':_0x5f0806[_0x2516('0x78')],'context':_0x5f0806[_0x2516('0x79')]||_0x2dc677[_0x2516('0x79')],'priority':0x1})[_0x2516('0x18')](function(_0x3b8348){_0x3d8389({'code':0xc8,'message':[_0x5f0806[_0x2516('0x5f')],_0x3b8348['message'][_0x2516('0x66')]()][_0x2516('0x12')]('\x20')});})[_0x2516('0x19')](function(_0x320d38){_0x444391(_0x4d671b[_0x2516('0xe')](0x1f5,[_0x5f0806['uniqueid'],_0x320d38[_0x2516('0x1a')][_0x2516('0x66')]()]['join']('\x20')));});}else{return _0x444391(_0x4d671b[_0x2516('0xe')](0x1f5,_0x2516('0x6b')));}});},'Agents':function(_0x1a1297){return new Promise(function(_0x1b517c,_0x9f96cf){var _0x3b1a02=_['values'](_0x25dce6[_0x2516('0xa')]);_0x1b517c({'count':_0x3b1a02[_0x2516('0x57')],'rows':_0x3b1a02});});},'Telephones':function(_0x24f7d7){return new Promise(function(_0x23ef83,_0x4493ab){var _0xe93655=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x7a')]);_0x23ef83({'count':_0xe93655[_0x2516('0x57')],'rows':_0xe93655});});},'Trunks':function(_0x559f5d){return new Promise(function(_0x57b13b,_0x5ba32a){var _0x447786=_[_0x2516('0x5b')](_0x25dce6['trunks']);_0x57b13b({'count':_0x447786['length'],'rows':_0x447786});});},'OutboundChannels':function(_0x40efc6){return new Promise(function(_0x1d2e2f,_0x6e55a6){var _0x158a9a=_[_0x2516('0x5b')](_0x25dce6[_0x2516('0x7b')]);_0x1d2e2f({'count':_0x158a9a[_0x2516('0x57')],'rows':_0x158a9a});});},'Outbound':function(_0x4ccd7d){return new Promise(function(_0x3b71a1,_0x36eab7){_0x3b71a1(_0x25dce6[_0x2516('0x2c')]);});},'Campaigns':function(_0x18a9e9){return new Promise(function(_0x7c48ce,_0x7cedc9){var _0x273b11=_['values'](_0x25dce6['campaigns']);_0x7c48ce({'count':_0x273b11[_0x2516('0x57')],'rows':_0x273b11});});},'VoiceQueuesPreview':function(_0x3de1cd){var _0x1cea65=this;return new Promise(function(_0x56aa6c,_0x17548a){_0x3a7984[_0x2516('0x7c')](_0x3de1cd['id'])[_0x2516('0x18')](function(_0x3ebdd5){_0x56aa6c({'code':0xc8,'message':_0x3ebdd5[_0x2516('0x1a')]});})[_0x2516('0x19')](function(_0x581c2c){_0x17548a(_0x1cea65[_0x2516('0xe')](0x1f4,_0x581c2c[_0x2516('0x1a')]));});});},'EventManager':function(_0x2e58b1){var _0x38cf65=this;return new Promise(function(_0x124371,_0x2d9c8e){if(!_0x2e58b1[_0x2516('0x7d')]){return _0x2d9c8e(_0x38cf65[_0x2516('0xe')](0x1f4,_0x2516('0x7e')));}ami[_0x2516('0x7f')](_0x2516('0x80')+_0x2e58b1[_0x2516('0x7d')],_0x2e58b1[_0x2516('0x1a')]);_0x124371({'code':0xc8,'message':_0x2e58b1});});},'FaxAccounts':function(_0x18c309){return new Promise(function(_0xbb1c7d,_0x41cdef){var _0x4d9432=_['values'](_0x25dce6[_0x2516('0x81')]);_0xbb1c7d({'count':_0x4d9432[_0x2516('0x57')],'rows':_0x4d9432});});},'SendFax':function(_0xe66cb3){var _0x4099fc=this;return new Promise(function(_0x33da91,_0x14208b){_0x5b71b5[_0x2516('0x82')](_0xe66cb3)[_0x2516('0x18')](function(_0x5d6926){_0x33da91({'code':0xc8,'message':_0x5d6926[_0x2516('0x1a')]});})[_0x2516('0x19')](function(_0xfd644c){_0x14208b(_0x4099fc['error'](0x1f4,_0xfd644c[_0x2516('0x1a')]));});});},'CheckAfterSend':function(_0x498661){var _0x12caef=this;return new Promise(function(_0x48863e,_0x3ecad0){_0x5b71b5[_0x2516('0x83')](_0x498661)['then'](function(_0xd47496){_0x48863e({'code':0xc8,'message':_0xd47496['message']});})[_0x2516('0x19')](function(_0xd649dc){_0x3ecad0(_0x12caef[_0x2516('0xe')](0x1f4,_0xd649dc[_0x2516('0x1a')]));});});}};var _0x3f9d07=jayson[_0x2516('0x84')](_0x20a4a4)[_0x2516('0x85')]();_0x3f9d07['on'](_0x2516('0xe'),function(_0x1e40f0){return _0x5beeb3(_0x1e40f0);});_0x3f9d07['listen'](0x232a,_0x2516('0x86'),function(){console[_0x2516('0x87')](_0x2516('0x88'),0x232a);return _0x48f411(_0x2516('0x89')+0x232a);});});};
\ No newline at end of file
+var _0x9536=['updateAcw','agents','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','message','command','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','omit','undefined','values','channels','voicechannel','length','uniqueid','channel','wav','MixMonitor','then','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','StopMixMonitor','destinationchannel','stop','filename','monitors','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','map','Channel\x20doesn\x27t\x20exist','Hangup','voicequeuechannelredirect','Redirect','exten','context','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','checkAfterSend','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer'];(function(_0xdd4de,_0x589d59){var _0x2de4ca=function(_0x5ac419){while(--_0x5ac419){_0xdd4de['push'](_0xdd4de['shift']());}};_0x2de4ca(++_0x589d59);}(_0x9536,0x179));var _0x6953=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x9536[_0xb24fad];return _0x173226;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var jayson=require(_0x6953('0x2'));var schema=require(_0x6953('0x3'));var BPromise=require('bluebird');var moment=require(_0x6953('0x4'));var config=require('../../../config/environment');var properties=require(_0x6953('0x5'));var ami=require(_0x6953('0x6'));exports[_0x6953('0x7')]=function(_0x3ba964,_0x2f3cc3,_0x494ac2){return new BPromise(function(_0x2b273e,_0x2bb026){var _0x385f2d={'QueuePause':function(_0x3e1aff){return new Promise(function(_0x1c8225,_0x58ac30){var _0x3e8786=util[_0x6953('0x8')](_0x6953('0x9'),'SIP',_0x3e1aff[_0x6953('0xa')]);if(_0x3ba964[_0x6953('0xb')]&&_0x3ba964[_0x6953('0xb')][_0x3e8786]&&_0x3ba964[_0x6953('0xb')][_0x3e8786][_0x6953('0xc')]){_0x3ba964[_0x6953('0xb')][_0x3e8786][_0x6953('0xd')]();}if(_0x3ba964[_0x6953('0xe')][_0x3e8786]){_0x3ba964[_0x6953('0xe')][_0x3e8786]['updateStatusRealtime']({'statePause':_0x3e1aff[_0x6953('0xf')]?!![]:![]});}_0x1c8225({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x8de91e){var _0x5b0558=this;return new Promise(function(_0x3e83d5,_0xe35f08){if(ami[_0x6953('0x10')]()==![]){return _0xe35f08(_0x5b0558[_0x6953('0x11')](0x1f4,[config[_0x6953('0x12')]['ip'],config[_0x6953('0x12')][_0x6953('0x13')],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}_0x8de91e=_['pick'](_0x8de91e,_['keys'](properties[_0x6953('0x16')]));_0x8de91e[_0x6953('0x17')]=_0x6953('0x18');return ami[_0x6953('0x19')](_0x8de91e)['then'](function(_0x1b6dcb){_0x3e83d5({'code':0xc8,'message':_0x1b6dcb[_0x6953('0x1a')]});})['catch'](function(_0x10858a){_0xe35f08(_0x5b0558[_0x6953('0x11')](0x1f5,_0x10858a[_0x6953('0x1a')]));});});},'Command':function(_0x174c59){var _0xc714d3=this;return new Promise(function(_0x4a450c,_0x3a93e1){if(ami[_0x6953('0x10')]()==![]){return _0x3a93e1(_0xc714d3[_0x6953('0x11')](0x1f4,[config[_0x6953('0x12')]['ip'],config[_0x6953('0x12')]['username'],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}_0x174c59=_['pick'](_0x174c59,_0x6953('0x1b'));_0x174c59[_0x6953('0x17')]=_0x6953('0x1c');return ami[_0x6953('0x19')](_0x174c59)['then'](function(_0x37f339){_0x4a450c({'code':0xc8,'message':_0x37f339[_0x6953('0x1d')]});})[_0x6953('0x1e')](function(_0x508ea7){_0x3a93e1(_0xc714d3['error'](0x1f5,_0x508ea7['message']));});});},'VoiceQueues':function(_0xc85d42){return new Promise(function(_0x1bf5a9,_0x550be4){var _0x1a32f4=[];for(var _0x587df0 in _0x3ba964[_0x6953('0x1f')]){if(_0x3ba964[_0x6953('0x1f')][_0x6953('0x20')](_0x587df0)){var _0x2cc01e=_0x3ba964[_0x6953('0x1f')][_0x587df0];var _0x1497e3={'id':_0x2cc01e['id'],'name':_0x2cc01e['name'],'strategy':_0x2cc01e[_0x6953('0x21')],'answered':_0x2cc01e[_0x6953('0x22')],'available':_0x2cc01e['available'],'loggedIn':_0x2cc01e[_0x6953('0x23')],'pTalking':_0x2cc01e['pTalking'],'sumBillable':_0x2cc01e[_0x6953('0x24')],'sumDuration':_0x2cc01e[_0x6953('0x25')],'sumHoldTime':_0x2cc01e[_0x6953('0x26')]||0x0,'talking':_0x2cc01e['talking'],'total':_0x2cc01e[_0x6953('0x27')],'type':_0x2cc01e[_0x6953('0x28')],'unmanaged':_0x2cc01e[_0x6953('0x29')],'abandoned':_0x2cc01e['abandoned'],'waiting':_0x2cc01e[_0x6953('0x2a')],'loggedInDb':_0x2cc01e[_0x6953('0x2b')]};if(_0x2cc01e['type']==='outbound'){_0x1497e3[_0x6953('0x2c')]=_0x2cc01e[_0x6953('0x2c')];_0x1497e3[_0x6953('0x2d')]=_0x2cc01e[_0x6953('0x2d')];_0x1497e3[_0x6953('0x2e')]=_0x2cc01e['dialOriginateCallerIdName'];_0x1497e3[_0x6953('0x2f')]=_0x2cc01e['dialOriginateCallerIdNumber'];_0x1497e3[_0x6953('0x30')]=_0x2cc01e[_0x6953('0x30')];_0x1497e3['dialPrefix']=_0x2cc01e['dialPrefix'];_0x1497e3[_0x6953('0x31')]=_0x2cc01e[_0x6953('0x31')];_0x1497e3[_0x6953('0x32')]=_0x2cc01e['outboundAnswerAgiCallsDay'];_0x1497e3[_0x6953('0x33')]=_0x2cc01e['outboundAnswerCallsDay'];_0x1497e3['outboundBlacklistCallsDay']=_0x2cc01e['outboundBlacklistCallsDay'];_0x1497e3['outboundBusyCallsDay']=_0x2cc01e[_0x6953('0x34')];_0x1497e3[_0x6953('0x35')]=_0x2cc01e[_0x6953('0x35')];_0x1497e3[_0x6953('0x36')]=_0x2cc01e[_0x6953('0x36')];_0x1497e3[_0x6953('0x37')]=_0x2cc01e['outboundDropCallsDayCallersExit'];_0x1497e3[_0x6953('0x38')]=_0x2cc01e['outboundDropCallsDayTimeout'];_0x1497e3[_0x6953('0x39')]=_0x2cc01e['outboundNoAnswerCallsDay'];_0x1497e3[_0x6953('0x3a')]=_0x2cc01e[_0x6953('0x3a')];_0x1497e3[_0x6953('0x3b')]=_0x2cc01e[_0x6953('0x3b')];_0x1497e3['outboundReCallsDay']=_0x2cc01e[_0x6953('0x3c')];_0x1497e3[_0x6953('0x3d')]=_0x2cc01e[_0x6953('0x3d')];_0x1497e3[_0x6953('0x3e')]=_0x2cc01e[_0x6953('0x3e')];_0x1497e3[_0x6953('0x3f')]=_0x2cc01e[_0x6953('0x3f')];_0x1497e3[_0x6953('0x40')]=_0x2cc01e[_0x6953('0x40')];_0x1497e3[_0x6953('0x41')]=_0x2cc01e[_0x6953('0x41')];_0x1497e3['predictiveIntervalDroppedCallsCallersExit']=_0x2cc01e[_0x6953('0x42')];_0x1497e3[_0x6953('0x43')]=_0x2cc01e[_0x6953('0x43')];_0x1497e3['predictiveIntervalErlangCalls']=_0x2cc01e['predictiveIntervalErlangCalls'];_0x1497e3[_0x6953('0x44')]=_0x2cc01e['predictiveIntervalErlangCallsDroppedCalls'];_0x1497e3['predictiveIntervalHitRate']=_0x2cc01e[_0x6953('0x45')];_0x1497e3[_0x6953('0x46')]=_0x2cc01e['predictiveIntervalMultiplicativeFactor'];_0x1497e3[_0x6953('0x47')]=_0x2cc01e[_0x6953('0x47')];_0x1497e3[_0x6953('0x48')]=_0x2cc01e[_0x6953('0x48')];_0x1497e3[_0x6953('0x49')]=_0x2cc01e[_0x6953('0x49')];_0x1497e3['message']=_0x2cc01e[_0x6953('0x1a')];_0x1497e3[_0x6953('0x4a')]=_0x2cc01e[_0x6953('0x4a')];_0x1497e3[_0x6953('0x4b')]=_0x2cc01e[_0x6953('0x4b')];_0x1497e3[_0x6953('0x4c')]=_0x2cc01e['erlangCallToSecond'];_0x1497e3['erlangAbandonmentRate']=_0x2cc01e[_0x6953('0x4d')];_0x1497e3['erlangBusyFactor']=_0x2cc01e['erlangBusyFactor'];_0x1497e3[_0x6953('0x4e')]=_0x2cc01e[_0x6953('0x4e')];_0x1497e3[_0x6953('0x4f')]=_0x2cc01e[_0x6953('0x4f')];}if(_0x2cc01e[_0x6953('0x50')]){_0x1497e3['Trunk']={'id':_0x2cc01e['Trunk']['id'],'name':_0x2cc01e[_0x6953('0x50')][_0x6953('0xa')],'active':_0x2cc01e['Trunk'][_0x6953('0x51')],'callerid':_0x2cc01e['Trunk'][_0x6953('0x52')]};}if(_0x2cc01e[_0x6953('0x53')]){_0x1497e3[_0x6953('0x53')]={'id':_0x2cc01e[_0x6953('0x53')]['id'],'name':_0x2cc01e['Interval'][_0x6953('0xa')]};}_0x1a32f4[_0x6953('0x54')](_0x1497e3);}}_0x1bf5a9({'count':_0x1a32f4['length'],'rows':_0x1a32f4});});},'UpdateVoiceQueue':function(_0x16c565){return new Promise(function(_0x296d81,_0x1b4377){var _0x228139=_[_0x6953('0x55')](_0x3ba964[_0x6953('0x1f')],{'id':parseInt(_0x16c565['id'])});var _0x13d1a6=_[_0x6953('0x56')](_0x16c565,['id']);if(_0x228139){for(var _0x156785 in _0x13d1a6){if(typeof _0x13d1a6[_0x156785]!==_0x6953('0x57')&&typeof _0x228139[_0x156785]!==_0x6953('0x57')){_0x228139[_0x156785]=_0x13d1a6[_0x156785];}}_0x296d81(_0x228139);}else{_0x1b4377();}});},'VoiceChannels':function(_0x5a06ec){return new Promise(function(_0x332223,_0x4c9d36){var _0x15c142=_[_0x6953('0x58')](_0x3ba964[_0x6953('0x59')]);_0x332223({'count':_0x15c142['length'],'rows':_0x15c142});});},'VoiceChannelMixMonitor':function(_0xfb9613){var _0x2a4e54=this;return new Promise(function(_0x506561,_0x525145){if(ami[_0x6953('0x10')]()==![]){return _0x525145(_0x2a4e54[_0x6953('0x11')](0x1f4,[config[_0x6953('0x12')]['ip'],config[_0x6953('0x12')][_0x6953('0x13')],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}var _0xd67ece=schema(properties[_0x6953('0x5a')])[_0x6953('0x3')](_0xfb9613);if(_0xd67ece[_0x6953('0x5b')]>0x0){return _0x525145(_0x2a4e54['error'](0x1f4,_['map'](_0xd67ece,_0x6953('0x1a'))[_0x6953('0x15')](',\x20')));}var _0x68ab5d=_[_0x6953('0x55')](_0x3ba964[_0x6953('0x59')],{'uniqueid':_0xfb9613[_0x6953('0x5c')]});if(_0x68ab5d&&_0x68ab5d[_0x6953('0x5d')]){var _0x238ab2=util[_0x6953('0x8')]('%s.%s',_0xfb9613['filename']||_0xfb9613['uniqueid'],_0xfb9613['format']||_0x6953('0x5e'));return ami[_0x6953('0x19')]({'action':_0x6953('0x5f'),'channel':_0x68ab5d['channel'],'file':_0x238ab2,'options':'ai(mixmonitorid)'})[_0x6953('0x60')](function(_0x1e707c){var _0x11a551=_['find'](_0x68ab5d['monitors'],{'filename':_0x6953('0x61')+_0x238ab2[_0x6953('0x62')]()});if(_['isNil'](_0x11a551)){_0x68ab5d['monitors'][_0x6953('0x54')]({'filename':_0x6953('0x61')+_0x238ab2[_0x6953('0x62')](),'createdAt':moment()[_0x6953('0x8')](_0x6953('0x63')),'mixmonitorid':_0x1e707c['mixmonitorid'],'status':_0x6953('0x64')});}else{_0x11a551[_0x6953('0x65')]=_0x1e707c['mixmonitorid'];_0x11a551[_0x6953('0x66')]='rec';}_0x506561({'code':0xc8,'message':[_0xfb9613[_0x6953('0x5c')],_0x6953('0x67'),_0x1e707c[_0x6953('0x65')]][_0x6953('0x15')]('\x20'),'mixmonitorid':_0x1e707c['mixmonitorid']});})[_0x6953('0x1e')](function(_0x366390){_0x525145(_0x2a4e54[_0x6953('0x11')](0x1f5,[_0xfb9613['uniqueid'],_0x366390['message'][_0x6953('0x62')]()][_0x6953('0x15')]('\x20')));});}else{return _0x525145(_0x2a4e54[_0x6953('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x4c6180){var _0x44a01=this;return new Promise(function(_0x2b90f7,_0x4c0f1c){if(ami[_0x6953('0x10')]()==![]){return _0x4c0f1c(_0x44a01[_0x6953('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6953('0x12')][_0x6953('0x13')],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}var _0x1e4e2c=schema(properties['voicechannel'])[_0x6953('0x3')](_0x4c6180);if(_0x1e4e2c[_0x6953('0x5b')]>0x0){return _0x4c0f1c(_0x44a01[_0x6953('0x11')](0x1f4,_['map'](_0x1e4e2c,'message')[_0x6953('0x15')](',\x20')));}var _0x2bf359=_[_0x6953('0x55')](_0x3ba964[_0x6953('0x59')],{'uniqueid':_0x4c6180[_0x6953('0x5c')]});if(_0x2bf359){return BPromise['resolve']()[_0x6953('0x60')](function(){if(_0x2bf359[_0x6953('0x5d')]){return ami[_0x6953('0x19')]({'action':_0x6953('0x68'),'channel':_0x2bf359[_0x6953('0x5d')],'mixmonitorid':_0x4c6180[_0x6953('0x65')]})[_0x6953('0x1e')](function(_0x435e74){});}})[_0x6953('0x60')](function(){if(_0x2bf359[_0x6953('0x69')]){return ami[_0x6953('0x19')]({'action':_0x6953('0x68'),'channel':_0x2bf359[_0x6953('0x69')],'mixmonitorid':_0x4c6180['mixmonitorid']})[_0x6953('0x1e')](function(_0x1d264a){});}})[_0x6953('0x60')](function(_0x20efa9){var _0x38674d=_['find'](_0x2bf359['monitors'],{'mixmonitorid':_0x4c6180[_0x6953('0x65')]});if(_0x38674d){_0x38674d['status']=_0x6953('0x6a');}})[_0x6953('0x60')](function(){var _0x359a4c=util[_0x6953('0x8')]('%s.%s',_0x4c6180[_0x6953('0x6b')]||_0x4c6180[_0x6953('0x5c')],_0x4c6180[_0x6953('0x8')]||_0x6953('0x5e'));var _0x1c3190=_[_0x6953('0x55')](_0x2bf359[_0x6953('0x6c')],{'filename':_0x6953('0x61')+_0x359a4c[_0x6953('0x62')]()});if(_0x1c3190){_0x1c3190[_0x6953('0x66')]=_0x6953('0x6a');}})[_0x6953('0x60')](function(){_0x2b90f7({'code':0xc8,'message':[_0x4c6180[_0x6953('0x5c')],_0x6953('0x6d')][_0x6953('0x15')]('\x20')});})['catch'](function(_0x1b5e11){_0x4c0f1c(_0x44a01[_0x6953('0x11')](0x1f5,[_0x4c6180[_0x6953('0x5c')],_0x1b5e11[_0x6953('0x1a')][_0x6953('0x62')]()][_0x6953('0x15')]('\x20')));});}else{return _0x4c0f1c(_0x44a01[_0x6953('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x3bb873){return new Promise(function(_0x403d81,_0x4eba55){var _0xc2668=_[_0x6953('0x58')](_0x3ba964[_0x6953('0x6e')]);_0x403d81({'count':_0xc2668['length'],'rows':_0xc2668});});},'VoiceQueuesChannel':function(_0x4cb8a4){var _0x1ea573=this;return new Promise(function(_0x12987e,_0x7e652b){var _0x2d173b=schema(properties[_0x6953('0x6f')])[_0x6953('0x3')](_0x4cb8a4);if(_0x2d173b[_0x6953('0x5b')]>0x0){return _0x7e652b(_0x1ea573[_0x6953('0x11')](0x1f4,_[_0x6953('0x70')](_0x2d173b,'message')[_0x6953('0x15')](',\x20')));}var _0x729812=_[_0x6953('0x55')](_0x3ba964[_0x6953('0x6e')],{'uniqueid':_0x4cb8a4['uniqueid']});if(_0x729812){_0x12987e(_0x729812);}else{return _0x7e652b(_0x1ea573[_0x6953('0x11')](0x1f5,_0x6953('0x71')));}});},'VoiceQueuesChannelHangup':function(_0x40356c){var _0x576f36=this;return new Promise(function(_0x16898a,_0x12285e){if(ami[_0x6953('0x10')]()==![]){return _0x12285e(_0x576f36[_0x6953('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6953('0x12')][_0x6953('0x13')],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}var _0x52c2a0=schema(properties['voicequeuechannelhangup'])[_0x6953('0x3')](_0x40356c);if(_0x52c2a0[_0x6953('0x5b')]>0x0){return _0x12285e(_0x576f36['error'](0x1f4,_['map'](_0x52c2a0,_0x6953('0x1a'))[_0x6953('0x15')](',\x20')));}var _0x30fcd5=_[_0x6953('0x55')](_0x3ba964['queueChannels'],{'uniqueid':_0x40356c[_0x6953('0x5c')]});if(_0x30fcd5&&_0x30fcd5[_0x6953('0x5d')]){return ami['Action']({'action':_0x6953('0x72'),'channel':_0x30fcd5[_0x6953('0x5d')]})['then'](function(_0x4adcfc){_0x16898a({'code':0xc8,'message':[_0x40356c['uniqueid'],_0x4adcfc[_0x6953('0x1a')][_0x6953('0x62')]()][_0x6953('0x15')]('\x20')});})[_0x6953('0x1e')](function(_0x1efbb9){_0x12285e(_0x576f36[_0x6953('0x11')](0x1f5,[_0x40356c[_0x6953('0x5c')],_0x1efbb9[_0x6953('0x1a')]['toLowerCase']()][_0x6953('0x15')]('\x20')));});}else{return _0x12285e(_0x576f36[_0x6953('0x11')](0x1f5,_0x6953('0x71')));}});},'VoiceQueuesChannelRedirect':function(_0x35ad50){var _0xee6759=this;return new Promise(function(_0x43ad3d,_0x481102){if(ami[_0x6953('0x10')]()==![]){return _0x481102(_0xee6759['error'](0x1f4,[config[_0x6953('0x12')]['ip'],config['asterisk'][_0x6953('0x13')],_0x6953('0x14')][_0x6953('0x15')]('\x20')));}var _0x50d2e0=schema(properties[_0x6953('0x73')])[_0x6953('0x3')](_0x35ad50);if(_0x50d2e0[_0x6953('0x5b')]>0x0){return _0x481102(_0xee6759[_0x6953('0x11')](0x1f4,_[_0x6953('0x70')](_0x50d2e0,_0x6953('0x1a'))['join'](',\x20')));}var _0x24a666=_[_0x6953('0x55')](_0x3ba964[_0x6953('0x6e')],{'uniqueid':_0x35ad50[_0x6953('0x5c')]});if(_0x24a666&&_0x24a666[_0x6953('0x5d')]){return ami[_0x6953('0x19')]({'action':_0x6953('0x74'),'channel':_0x24a666[_0x6953('0x5d')],'exten':_0x35ad50[_0x6953('0x75')],'context':_0x35ad50[_0x6953('0x76')]||_0x24a666[_0x6953('0x76')],'priority':0x1})['then'](function(_0x2ab424){_0x43ad3d({'code':0xc8,'message':[_0x35ad50[_0x6953('0x5c')],_0x2ab424[_0x6953('0x1a')][_0x6953('0x62')]()][_0x6953('0x15')]('\x20')});})[_0x6953('0x1e')](function(_0x16f3db){_0x481102(_0xee6759[_0x6953('0x11')](0x1f5,[_0x35ad50[_0x6953('0x5c')],_0x16f3db[_0x6953('0x1a')][_0x6953('0x62')]()]['join']('\x20')));});}else{return _0x481102(_0xee6759[_0x6953('0x11')](0x1f5,_0x6953('0x71')));}});},'Agents':function(_0x458277){return new Promise(function(_0x5a74ab,_0x51f1f5){var _0x547643=_['values'](_0x3ba964[_0x6953('0xe')]);_0x5a74ab({'count':_0x547643[_0x6953('0x5b')],'rows':_0x547643});});},'Telephones':function(_0x4f18ab){return new Promise(function(_0xcb3cac,_0x2a84c9){var _0x2928c3=_[_0x6953('0x58')](_0x3ba964['telephones']);_0xcb3cac({'count':_0x2928c3[_0x6953('0x5b')],'rows':_0x2928c3});});},'Trunks':function(_0x3113c0){return new Promise(function(_0x44f740,_0x4fcea8){var _0x2ac801=_[_0x6953('0x58')](_0x3ba964['trunks']);_0x44f740({'count':_0x2ac801[_0x6953('0x5b')],'rows':_0x2ac801});});},'OutboundChannels':function(_0x55e869){return new Promise(function(_0x531b79,_0x471ece){var _0x573d3d=_['values'](_0x3ba964[_0x6953('0x77')]);_0x531b79({'count':_0x573d3d[_0x6953('0x5b')],'rows':_0x573d3d});});},'Outbound':function(_0xb5bc85){return new Promise(function(_0x512384,_0x24a69e){_0x512384(_0x3ba964[_0x6953('0x78')]);});},'Campaigns':function(_0x557599){return new Promise(function(_0x30de2c,_0x405f12){var _0xb4b671=_[_0x6953('0x58')](_0x3ba964[_0x6953('0x79')]);_0x30de2c({'count':_0xb4b671[_0x6953('0x5b')],'rows':_0xb4b671});});},'VoiceQueuesPreview':function(_0xcd7f39){var _0x38ad21=this;return new Promise(function(_0xce6912,_0x594098){_0x2f3cc3[_0x6953('0x7a')](_0xcd7f39['id'])[_0x6953('0x60')](function(_0x52ba59){_0xce6912({'code':0xc8,'message':_0x52ba59[_0x6953('0x1a')]});})[_0x6953('0x1e')](function(_0x25fe7e){_0x594098(_0x38ad21[_0x6953('0x11')](0x1f4,_0x25fe7e[_0x6953('0x1a')]));});});},'EventManager':function(_0x300be9){var _0x42a27f=this;return new Promise(function(_0x4ba199,_0x40915a){if(!_0x300be9[_0x6953('0x7b')]){return _0x40915a(_0x42a27f[_0x6953('0x11')](0x1f4,_0x6953('0x7c')));}ami[_0x6953('0x7d')](_0x6953('0x7e')+_0x300be9[_0x6953('0x7b')],_0x300be9[_0x6953('0x1a')]);_0x4ba199({'code':0xc8,'message':_0x300be9});});},'FaxAccounts':function(_0x3e09a1){return new Promise(function(_0x56ed7b,_0xa69154){var _0x5661d2=_[_0x6953('0x58')](_0x3ba964['faxAccounts']);_0x56ed7b({'count':_0x5661d2[_0x6953('0x5b')],'rows':_0x5661d2});});},'SendFax':function(_0x7215ed){var _0x3cb96a=this;return new Promise(function(_0x46bcec,_0x2dae06){_0x494ac2['send'](_0x7215ed)[_0x6953('0x60')](function(_0x5dedbf){_0x46bcec({'code':0xc8,'message':_0x5dedbf[_0x6953('0x1a')]});})[_0x6953('0x1e')](function(_0x2907b9){_0x2dae06(_0x3cb96a[_0x6953('0x11')](0x1f4,_0x2907b9['message']));});});},'CheckAfterSend':function(_0x467a2f){var _0x50f019=this;return new Promise(function(_0x2a8cba,_0x2e5191){_0x494ac2[_0x6953('0x7f')](_0x467a2f)[_0x6953('0x60')](function(_0x3fc055){_0x2a8cba({'code':0xc8,'message':_0x3fc055['message']});})[_0x6953('0x1e')](function(_0x41ec04){_0x2e5191(_0x50f019[_0x6953('0x11')](0x1f4,_0x41ec04[_0x6953('0x1a')]));});});}};var _0x107db7=jayson['server'](_0x385f2d)['http']();_0x107db7['on']('error',function(_0x20e315){return _0x2bb026(_0x20e315);});_0x107db7[_0x6953('0x7')](0x232a,_0x6953('0x80'),function(){console['log'](_0x6953('0x81'),0x232a);return _0x2b273e('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index e73c5d7..ae86f49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['join','data4','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','calleridnum','format','user:%s','action','lodash','bluebird','util','../../../../config/environment','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','destcalleridnum','firstName','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','map'];(function(_0x1fc86a,_0x278ca2){var _0x1f667b=function(_0x57e581){while(--_0x57e581){_0x1fc86a['push'](_0x1fc86a['shift']());}};_0x1f667b(++_0x278ca2);}(_0x668b,0x140));var _0xb668=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x668b[_0x255c48];return _0xaebda3;};'use strict';var _=require(_0xb668('0x0'));var BPromise=require(_0xb668('0x1'));var Redis=require('ioredis');var util=require(_0xb668('0x2'));var config=require(_0xb668('0x3'));var logger=require('../../../../config/logger')(_0xb668('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0xb668('0x5')]=_[_0xb668('0x6')](config[_0xb668('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb668('0x7'))(new Redis(config[_0xb668('0x5')]));function emit(_0x3be92e,_0x2778e9,_0x20b749,_0x3f01bc,_0x517fc5){logger[_0xb668('0x8')](_0xb668('0x9'),_0x3be92e,_0x2778e9['id'],_0x20b749,_0x3f01bc,JSON[_0xb668('0xa')](_0x517fc5));io['to'](_0x20b749)[_0xb668('0xb')](_0x3f01bc,_0x517fc5);}exports[_0xb668('0xc')]=function(_0x3606a7,_0x45bc39,_0x3616e9,_0x567ea9){var _0x3b15a6,_0x27dbf7;var _0x27de15={};var _0x2ea5fc=Number(_0x3616e9[_0xb668('0xd')]);var _0x167057=_0x3616e9[_0xb668('0xe')]?Boolean(Number(_0x3616e9[_0xb668('0xe')])):![];var _0x3e5be0;var _0x25c5c5=![];if(!_[_0xb668('0xf')](_0x3616e9[_0xb668('0x10')])){if(_0x3616e9[_0xb668('0x10')]=='1')_0x25c5c5=!![];}if(!_0x25c5c5){if(_0x567ea9[_0xb668('0x11')]){_0x27de15['id']=_0x567ea9[_0xb668('0x11')];}}if(!_0x27de15['id']){_0x27de15[_0xb668('0x12')]=_0x2ea5fc;_0x3e5be0=_0x3616e9[_0xb668('0x13')]&&_0x3616e9[_0xb668('0x13')]!=='0'?_0x3616e9[_0xb668('0x13')][_0xb668('0x14')](','):[_0xb668('0x15')];_0x27de15[_0xb668('0x16')]=_['map'](_0x3e5be0,function(_0x13ee71){var _0x567ad7={};_0x567ad7[_0x13ee71]=_0x567ea9[_0xb668('0x17')]?_0x567ea9[_0xb668('0x18')]:_0x567ea9['calleridnum'];return _0x567ad7;});}var _0x38595d=['id',_0xb668('0x19'),'lastName',_0xb668('0x15'),'mobile',_0xb668('0x1a'),_0xb668('0x12'),_0xb668('0x1b'),_0xb668('0x1c'),'updatedAt'];var _0x2b7f96=_[_0xb668('0x1d')](_0x38595d,_0x3e5be0);BPromise[_0xb668('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x2b7f96,'where':_0x27de15}))[_0xb668('0x1f')](function(_0x1e5620){_0x27dbf7=_0x1e5620;if(!_['isEmpty'](_0x27dbf7)){if(_0x27dbf7[_0xb668('0x20')]===0x1){_0x3b15a6=_0x27dbf7[0x0];logger['info'](_0xb668('0x21'),_0x567ea9['uniqueid'],_0x45bc39['id'],_0x3b15a6['id']);}else{logger[_0xb668('0x8')](_0xb668('0x22'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_[_0xb668('0x24')](_0x27dbf7,'id')[_0xb668('0x25')](','));}return;}else{logger[_0xb668('0x8')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);var _0x10d767={'ListId':_0x2ea5fc};var _0x2ab8c2=_0x3616e9['data4']&&_0x3616e9['data4']!=='0'?_0x3616e9[_0xb668('0x26')]:_0xb668('0x15');if(_0x167057){logger[_0xb668('0x8')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])?_0x567ea9['calleridnum']:_0x567ea9['destcalleridnum'];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767['firstName']=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9[_0xb668('0x2a')]!=='<unknown>'?_0x567ea9[_0xb668('0x2a')]:'Unknown';}return BPromise[_0xb668('0x1e')]()[_0xb668('0x1f')](cmContactRpc[_0xb668('0x2b')](_0x10d767))[_0xb668('0x1f')](function(_0x2e40dd){_0x3b15a6=_0x2e40dd;_0x27dbf7[_0xb668('0x2c')](_0x2e40dd);if(_0x3b15a6){logger[_0xb668('0x8')](_0xb668('0x2d'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id'],_0x3b15a6['id']);}return;});}else{logger['info'](_0xb668('0x2e'),_0x567ea9[_0xb668('0x23')],_0x45bc39['id']);_0x10d767[_0x2ab8c2]=_[_0xb668('0xf')](_0x567ea9['routeId'])?_0x567ea9[_0xb668('0x2f')]:_0x567ea9[_0xb668('0x18')];if(_[_0xb668('0xf')](_0x567ea9[_0xb668('0x17')])){_0x10d767['firstName']=_0x567ea9[_0xb668('0x27')]&&_0x567ea9[_0xb668('0x27')]!==_0xb668('0x28')?_0x567ea9[_0xb668('0x27')]:_0xb668('0x29');}else{_0x10d767[_0xb668('0x19')]=_0x567ea9[_0xb668('0x2a')]&&_0x567ea9['destcalleridname']!==_0xb668('0x28')?_0x567ea9[_0xb668('0x2a')]:'Unknown';}_0x3b15a6=_0x10d767;_0x27dbf7[_0xb668('0x2c')](_0x10d767);return;}}})['then'](function(){if(_0x3606a7){emit(_0x567ea9['uniqueid'],_0x45bc39,util[_0xb668('0x30')](_0xb668('0x31'),_0x3606a7['name']),util[_0xb668('0x30')]('trigger:%s',_0x3616e9[_0xb668('0x32')]['toLowerCase']()),{'evt':_['merge'](_0x567ea9,{'autoCreate':_0x167057}),'contact':_0x3b15a6===undefined?{}:_0x3b15a6,'contacts':_0x27dbf7[_0xb668('0x20')]===0x0?undefined:_0x27dbf7});}});};
\ No newline at end of file
+var _0x5636=['data3','split','phone','$or','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','length','uniqueid','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','destcalleridnum','isNil','routeId','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','lodash','bluebird','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','data5','xmd-contactid','ListId'];(function(_0x1cc41f,_0x5ee9ec){var _0xbba847=function(_0x5b8674){while(--_0x5b8674){_0x1cc41f['push'](_0x1cc41f['shift']());}};_0xbba847(++_0x5ee9ec);}(_0x5636,0x102));var _0x6563=function(_0x38d29,_0x436133){_0x38d29=_0x38d29-0x0;var _0x3003ff=_0x5636[_0x38d29];return _0x3003ff;};'use strict';var _=require(_0x6563('0x0'));var BPromise=require(_0x6563('0x1'));var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x6563('0x2'))(_0x6563('0x3'));var cmContactRpc=require(_0x6563('0x4'));config['redis']=_[_0x6563('0x5')](config[_0x6563('0x6')],{'host':_0x6563('0x7'),'port':0x18eb});var io=require(_0x6563('0x8'))(new Redis(config[_0x6563('0x6')]));function emit(_0x193942,_0x9884a9,_0x2d57d5,_0x2d0d5b,_0x98fcd4){logger[_0x6563('0x9')](_0x6563('0xa'),_0x193942,_0x9884a9['id'],_0x2d57d5,_0x2d0d5b,JSON[_0x6563('0xb')](_0x98fcd4));io['to'](_0x2d57d5)['emit'](_0x2d0d5b,_0x98fcd4);}exports['exec']=function(_0x2946f3,_0x129fa3,_0x490a56,_0x506ee9){var _0x5da960,_0x1ef002;var _0x111d38={};var _0x35936d=Number(_0x490a56[_0x6563('0xc')]);var _0x33816e=_0x490a56[_0x6563('0xd')]?Boolean(Number(_0x490a56[_0x6563('0xd')])):![];var _0xbbae72;var _0x447f9a=![];if(!_['isNil'](_0x490a56[_0x6563('0xe')])){if(_0x490a56['data5']=='1')_0x447f9a=!![];}if(!_0x447f9a){if(_0x506ee9[_0x6563('0xf')]){_0x111d38['id']=_0x506ee9[_0x6563('0xf')];}}if(!_0x111d38['id']){_0x111d38[_0x6563('0x10')]=_0x35936d;_0xbbae72=_0x490a56[_0x6563('0x11')]&&_0x490a56['data3']!=='0'?_0x490a56[_0x6563('0x11')][_0x6563('0x12')](','):[_0x6563('0x13')];_0x111d38[_0x6563('0x14')]=_['map'](_0xbbae72,function(_0x3563fd){var _0x589632={};_0x589632[_0x3563fd]=_0x506ee9['routeId']?_0x506ee9['destcalleridnum']:_0x506ee9[_0x6563('0x15')];return _0x589632;});}var _0x4f5609=['id','firstName',_0x6563('0x16'),_0x6563('0x13'),_0x6563('0x17'),_0x6563('0x18'),_0x6563('0x10'),_0x6563('0x19'),_0x6563('0x1a'),_0x6563('0x1b')];var _0x2a70f0=_['union'](_0x4f5609,_0xbbae72);BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x1e')]({'attributes':_0x2a70f0,'where':_0x111d38}))['then'](function(_0x293db2){_0x1ef002=_0x293db2;if(!_['isEmpty'](_0x1ef002)){if(_0x1ef002[_0x6563('0x1f')]===0x1){_0x5da960=_0x1ef002[0x0];logger[_0x6563('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x506ee9['uniqueid'],_0x129fa3['id'],_0x5da960['id']);}else{logger[_0x6563('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_[_0x6563('0x21')](_0x1ef002,'id')[_0x6563('0x22')](','));}return;}else{logger['info'](_0x6563('0x23'),_0x506ee9['uniqueid'],_0x129fa3['id']);var _0x7ea857={'ListId':_0x35936d};var _0x1590e6=_0x490a56['data4']&&_0x490a56[_0x6563('0x24')]!=='0'?_0x490a56[_0x6563('0x24')]:'phone';if(_0x33816e){logger[_0x6563('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x506ee9[_0x6563('0x20')],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_['isNil'](_0x506ee9['routeId'])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857[_0x6563('0x28')]=_0x506ee9['calleridname']&&_0x506ee9[_0x6563('0x29')]!=='<unknown>'?_0x506ee9['calleridname']:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9[_0x6563('0x2b')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:_0x6563('0x2a');}return BPromise[_0x6563('0x1c')]()[_0x6563('0x1d')](cmContactRpc[_0x6563('0x2d')](_0x7ea857))['then'](function(_0x9b3d86){_0x5da960=_0x9b3d86;_0x1ef002[_0x6563('0x2e')](_0x9b3d86);if(_0x5da960){logger[_0x6563('0x9')](_0x6563('0x2f'),_0x506ee9[_0x6563('0x20')],_0x129fa3['id'],_0x5da960['id']);}return;});}else{logger[_0x6563('0x9')](_0x6563('0x30'),_0x506ee9['uniqueid'],_0x129fa3['id']);_0x7ea857[_0x1590e6]=_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])?_0x506ee9[_0x6563('0x15')]:_0x506ee9[_0x6563('0x25')];if(_[_0x6563('0x26')](_0x506ee9[_0x6563('0x27')])){_0x7ea857['firstName']=_0x506ee9[_0x6563('0x29')]&&_0x506ee9[_0x6563('0x29')]!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x29')]:_0x6563('0x2a');}else{_0x7ea857[_0x6563('0x28')]=_0x506ee9[_0x6563('0x2b')]&&_0x506ee9['destcalleridname']!==_0x6563('0x2c')?_0x506ee9[_0x6563('0x2b')]:'Unknown';}_0x5da960=_0x7ea857;_0x1ef002[_0x6563('0x2e')](_0x7ea857);return;}}})[_0x6563('0x1d')](function(){if(_0x2946f3){emit(_0x506ee9['uniqueid'],_0x129fa3,util['format'](_0x6563('0x31'),_0x2946f3[_0x6563('0x32')]),util[_0x6563('0x33')](_0x6563('0x34'),_0x490a56['action'][_0x6563('0x35')]()),{'evt':_[_0x6563('0x36')](_0x506ee9,{'autoCreate':_0x33816e}),'contact':_0x5da960===undefined?{}:_0x5da960,'contacts':_0x1ef002['length']===0x0?undefined:_0x1ef002});}});};
\ No newline at end of file
index b204b2f..8b4b8bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b5b=['custom:acceptmessage','prototype','emit','info','stringify','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','TemplateId','html','data2','render','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','800','data5','windowHeight','data6','winApplication','format','user:%s','name','trigger:%s:%s','trigger:%s','data1','exec','integration','queue','voiceExtensions','routeId','urlforward','script','parse','query','search','replace','AllConditions','length','every','channel','AnyConditions','some','checkConditions','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','message','value','agent','membername','lastevent','exports','util','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','url','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage'];(function(_0x4774ba,_0x3f92fb){var _0x5ada41=function(_0x1137b9){while(--_0x1137b9){_0x4774ba['push'](_0x4774ba['shift']());}};_0x5ada41(++_0x3f92fb);}(_0x3b5b,0xc2));var _0xb3b5=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x3b5b[_0x33032e];return _0x13316b;};'use strict';var util=require(_0xb3b5('0x0'));var _=require(_0xb3b5('0x1'));var url=require('url');var Mustache=require(_0xb3b5('0x2'));var Redis=require(_0xb3b5('0x3'));var urlforward=require(_0xb3b5('0x4'));var integration=require(_0xb3b5('0x5'));var cmContact=require(_0xb3b5('0x6'));var script=require('./script');var config=require(_0xb3b5('0x7'));var logger=require(_0xb3b5('0x8'))(_0xb3b5('0x9'));var ami=require(_0xb3b5('0xa'));config['redis']=_['defaults'](config[_0xb3b5('0xb')],{'host':_0xb3b5('0xc'),'port':0x18eb});var io=require(_0xb3b5('0xd'))(new Redis(config[_0xb3b5('0xb')]));var operators={'equals':function(_0x1597c6,_0x5819bc){return _0x1597c6==_0x5819bc;},'not_equals':function(_0x260eeb,_0x2bcd77){return _0x260eeb!=_0x2bcd77;}};var barAndWebActions=['popup',_0xb3b5('0xe'),'winapp'];function Trigger(_0x3eeeef){this[_0xb3b5('0xf')]=_0x3eeeef['triggers'];this[_0xb3b5('0x10')]=_0x3eeeef[_0xb3b5('0x10')];this[_0xb3b5('0x11')]=_0x3eeeef[_0xb3b5('0x11')];this[_0xb3b5('0x12')]=_0x3eeeef[_0xb3b5('0x12')];this['voiceExtensions']=_0x3eeeef['voiceExtensions'];this[_0xb3b5('0x13')]=_0x3eeeef[_0xb3b5('0x13')];this[_0xb3b5('0x14')]=_0x3eeeef['freshdeskAccounts'];this[_0xb3b5('0x15')]=_0x3eeeef[_0xb3b5('0x15')];this[_0xb3b5('0x16')]=_0x3eeeef[_0xb3b5('0x16')];this[_0xb3b5('0x17')]=_0x3eeeef[_0xb3b5('0x17')];this[_0xb3b5('0x18')]=_0x3eeeef[_0xb3b5('0x18')];this[_0xb3b5('0x19')]=_0x3eeeef[_0xb3b5('0x19')];this[_0xb3b5('0x1a')]=_0x3eeeef[_0xb3b5('0x1a')];this[_0xb3b5('0x1b')]=_0x3eeeef[_0xb3b5('0x1b')];this[_0xb3b5('0x1c')]=_0x3eeeef[_0xb3b5('0x1c')];this[_0xb3b5('0x1d')]={'zendesk':this[_0xb3b5('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xb3b5('0x14')],'sugarcrm':this[_0xb3b5('0x16')],'zoho':this[_0xb3b5('0x17')],'desk':this[_0xb3b5('0x18')],'vtiger':this[_0xb3b5('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xb3b5('0x1c')],'servicenow':this[_0xb3b5('0x1a')]};ami['on'](_0xb3b5('0x1e'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x21'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x22'),this['syncCustomEvent'][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x23'),this['syncCustomEvent'][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x24'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x25'),this[_0xb3b5('0x1f')]['bind'](this));ami['on'](_0xb3b5('0x26'),this[_0xb3b5('0x1f')]['bind'](this));ami['on'](_0xb3b5('0x27'),this['syncCustomEvent'][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x28'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x29'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x2a'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x2b'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x2c'),this['syncAgentDial']['bind'](this));ami['on']('custom:dialconnect',this[_0xb3b5('0x2d')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x2e'),this[_0xb3b5('0x2d')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x2f'),this['syncCustomEvent'][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x30'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on']('custom:substatus',this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x31'),this[_0xb3b5('0x1f')]['bind'](this));ami['on']('custom:outgoingmessage',this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on'](_0xb3b5('0x32'),this[_0xb3b5('0x1f')][_0xb3b5('0x20')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0xb3b5('0x20')](this));}Trigger[_0xb3b5('0x33')][_0xb3b5('0x34')]=function(_0xedc566,_0x8dc331,_0x390e84){logger[_0xb3b5('0x35')](_0xedc566,_0x8dc331,JSON[_0xb3b5('0x36')](_0x390e84));io['to'](_0xedc566)['emit'](_0x8dc331,_0x390e84);};Trigger[_0xb3b5('0x33')][_0xb3b5('0x1f')]=function(_0x54374e){var _0x308b21=_[_0xb3b5('0x37')](_0x54374e);if(typeof _0x308b21[_0xb3b5('0x38')]==='undefined'){_0x308b21['motionChannel']=_0xb3b5('0x39');}this[_0xb3b5('0x3a')](_0x308b21);};Trigger[_0xb3b5('0x33')][_0xb3b5('0x2d')]=function(_0xa0799c){if(this[_0xb3b5('0x10')][_0xa0799c[_0xb3b5('0x3b')]]){this[_0xb3b5('0x1f')](_0xa0799c);}};Trigger[_0xb3b5('0x33')][_0xb3b5('0x3a')]=function(_0x1ce55a){var _0x1d5e94;for(var _0x5e864b in this[_0xb3b5('0xf')]){if(this[_0xb3b5('0xf')][_0xb3b5('0x3c')](_0x5e864b)){if(this[_0xb3b5('0xf')][_0x5e864b]['status']){_0x1d5e94=this[_0xb3b5('0x3d')](this[_0xb3b5('0xf')][_0x5e864b],_0x1ce55a);if(_0x1d5e94){_[_0xb3b5('0x3e')](_0x1ce55a,_0x1ce55a[_0xb3b5('0x3f')]);for(var _0x261736=0x0,_0x1867d0,_0x496a1b,_0x453696;_0x261736<this[_0xb3b5('0xf')][_0x5e864b]['Actions']['length'];_0x261736+=0x1){_0x1867d0=this[_0xb3b5('0xf')][_0x5e864b][_0xb3b5('0x40')][_0x261736];if(this[_0xb3b5('0x10')][_0x1ce55a[_0xb3b5('0x3b')]]){switch(_0x1867d0[_0xb3b5('0x41')][_0xb3b5('0x42')]()){case _0xb3b5('0x43'):break;case _0xb3b5('0x44'):case'browser':var _0x505d8e={};switch(barAndWebActions[_0x1867d0['data1']]){case'popup':_0x505d8e[_0xb3b5('0x45')]=_0x1867d0['data2'];_0x505d8e[_0xb3b5('0x46')]=this[_0xb3b5('0x12')][_0x1867d0[_0xb3b5('0x47')]]?Mustache[_0xb3b5('0x48')](this['templates'][_0x1867d0[_0xb3b5('0x47')]][_0xb3b5('0x46')],_0x1ce55a):_0xb3b5('0x49');break;case _0xb3b5('0xe'):_0x505d8e[_0xb3b5('0x4a')]=this['buildUri'](_0x1867d0[_0xb3b5('0x47')],_0x1ce55a,_[_0xb3b5('0x4b')](_0x1867d0[_0xb3b5('0x4c')])?!![]:parseInt(_0x1867d0[_0xb3b5('0x4c')],0xa));if(_[_0xb3b5('0x4b')](_0x1867d0[_0xb3b5('0x4d')])){_0x505d8e[_0xb3b5('0x4e')]='0';}else{_0x505d8e['uriLocation']=_0x1867d0[_0xb3b5('0x4d')];_0x505d8e[_0xb3b5('0x4f')]=_[_0xb3b5('0x4b')](_0x1867d0['data5'])?_0xb3b5('0x50'):_0x1867d0[_0xb3b5('0x51')];_0x505d8e[_0xb3b5('0x52')]=_[_0xb3b5('0x4b')](_0x1867d0[_0xb3b5('0x53')])?'600':_0x1867d0['data6'];}break;case'winapp':_0x505d8e[_0xb3b5('0x54')]=_0x1867d0[_0xb3b5('0x47')]?Mustache[_0xb3b5('0x48')](_0x1867d0[_0xb3b5('0x47')],_0x1ce55a):'';_0x505d8e['winArguments']=_0x1867d0[_0xb3b5('0x4c')]?Mustache[_0xb3b5('0x48')](_0x1867d0[_0xb3b5('0x4c')],_0x1ce55a):'';break;}this[_0xb3b5('0x34')](util[_0xb3b5('0x55')](_0xb3b5('0x56'),this['agents'][_0x1ce55a[_0xb3b5('0x3b')]][_0xb3b5('0x57')]),util[_0xb3b5('0x55')](_0xb3b5('0x58'),_0x1867d0[_0xb3b5('0x41')][_0xb3b5('0x42')](),barAndWebActions[_0x1867d0['data1']]),_[_0xb3b5('0x3e')](_0x505d8e,_0x1ce55a));break;case'jscripty':this['emit'](util[_0xb3b5('0x55')](_0xb3b5('0x56'),this[_0xb3b5('0x10')][_0x1ce55a[_0xb3b5('0x3b')]][_0xb3b5('0x57')]),util['format'](_0xb3b5('0x59'),_0x1867d0[_0xb3b5('0x41')]['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0x1867d0[_0xb3b5('0x5a')],0xa)},_0x1ce55a));break;default:this[_0xb3b5('0x34')](util[_0xb3b5('0x55')]('user:%s',this[_0xb3b5('0x10')][_0x1ce55a[_0xb3b5('0x3b')]][_0xb3b5('0x57')]),util['format'](_0xb3b5('0x59'),_0x1867d0[_0xb3b5('0x41')][_0xb3b5('0x42')]()),_[_0xb3b5('0x3e')]({},_0x1867d0,_0x1ce55a));}}switch(_0x1867d0['action'][_0xb3b5('0x42')]()){case _0xb3b5('0x43'):cmContact[_0xb3b5('0x5b')](this[_0xb3b5('0x10')][_0x1ce55a['interface']],this[_0xb3b5('0xf')][_0x5e864b],_0x1867d0,_0x1ce55a);break;case _0xb3b5('0x5c'):integration[_0xb3b5('0x5b')](_0x1867d0,_0x1ce55a,this['accounts'],this[_0xb3b5('0x10')][_0x1ce55a[_0xb3b5('0x3b')]],this['voiceQueues'][_0x1ce55a[_0xb3b5('0x5d')]],this[_0xb3b5('0x5e')][_0x1ce55a[_0xb3b5('0x5f')]]);break;case _0xb3b5('0x60'):urlforward[_0xb3b5('0x5b')](_0x1867d0,_0x1ce55a);break;case _0xb3b5('0x61'):script[_0xb3b5('0x5b')](_0x1867d0,_0x1ce55a);break;}}}}}}};Trigger[_0xb3b5('0x33')]['buildUri']=function(_0x3387ef,_0x3bf5b7,_0x327de7){var _0x23d41a=url[_0xb3b5('0x62')](Mustache['render'](_0x3387ef,_0x3bf5b7),!![]);if(_0x327de7){_[_0xb3b5('0x3e')](_0x23d41a[_0xb3b5('0x63')],_0x3bf5b7);}delete _0x23d41a[_0xb3b5('0x64')];var _0x5de46b=url[_0xb3b5('0x55')](_0x23d41a);_0x5de46b=_0x5de46b[_0xb3b5('0x65')](/\/\?/g,'?');return _0x5de46b;};Trigger['prototype']['checkTrigger']=function(_0x3509c6,_0x48a30f){var _0x9938c6=!![];var _0x49f7a8=!![];var _0x5d37cd=![];if(_0x3509c6['channel']===_0x48a30f[_0xb3b5('0x38')]){_0x5d37cd=!![];}if(_0x3509c6[_0xb3b5('0x66')][_0xb3b5('0x67')]){_0x9938c6=_[_0xb3b5('0x68')](_0x3509c6[_0xb3b5('0x66')],this['checkConditions'](_0x48a30f,_0x3509c6[_0xb3b5('0x69')]));}if(_0x3509c6[_0xb3b5('0x6a')][_0xb3b5('0x67')]){_0x49f7a8=_[_0xb3b5('0x6b')](_0x3509c6['AnyConditions'],this[_0xb3b5('0x6c')](_0x48a30f,_0x3509c6[_0xb3b5('0x69')]));}return _0x5d37cd&&_0x9938c6&&_0x49f7a8;};Trigger[_0xb3b5('0x33')][_0xb3b5('0x6c')]=function(_0x28dead,_0x52c8e3){return function(_0x2bf857){switch(_0x2bf857['field']){case _0xb3b5('0x6d'):if(_0x28dead[_0xb3b5('0x69')]===_0x52c8e3){if(_0x52c8e3===_0xb3b5('0x6e')){return _0x28dead[_0xb3b5('0x6f')]?operators[_0x2bf857[_0xb3b5('0x70')]](Number(_0x2bf857['value']),_0x28dead['ChatWebsiteId']):![];}else{return _0x28dead[_[_0xb3b5('0x71')](_0x52c8e3)+_0xb3b5('0x72')]?operators[_0x2bf857[_0xb3b5('0x70')]](Number(_0x2bf857['value']),_0x28dead[_['upperFirst'](_0x52c8e3)+_0xb3b5('0x72')]):![];}}break;case _0xb3b5('0x73'):case _0xb3b5('0x74'):if(_0x28dead[_0xb3b5('0x69')]===_0x52c8e3){return _0x28dead['event']?operators[_0x2bf857[_0xb3b5('0x70')]](_0x2bf857[_0xb3b5('0x75')],_0x28dead['event']):![];}break;case'queue':return _0x28dead[_0xb3b5('0x5d')]?operators[_0x2bf857[_0xb3b5('0x70')]](_0x2bf857[_0xb3b5('0x75')],_0x28dead['queue']):![];case _0xb3b5('0x76'):return _0x28dead[_0xb3b5('0x77')]?operators[_0x2bf857[_0xb3b5('0x70')]](_0x2bf857[_0xb3b5('0x75')],_0x28dead[_0xb3b5('0x77')]):![];case'lastevent':return _0x28dead[_0xb3b5('0x78')]?operators[_0x2bf857[_0xb3b5('0x70')]](_0x2bf857['value'],_0x28dead['lastevent']):![];case _0xb3b5('0x5f'):return _0x28dead['routeId']?operators[_0x2bf857[_0xb3b5('0x70')]](_0x2bf857[_0xb3b5('0x75')],_0x28dead[_0xb3b5('0x5f')]):![];}return![];};};module[_0xb3b5('0x79')]=Trigger;
\ No newline at end of file
+var _0x115a=['script','parse','query','search','replace','channel','AllConditions','length','every','AnyConditions','some','checkConditions','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId','exports','util','lodash','url','mustache','ioredis','./integration','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','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:agentbusy','custom:agentcongestion','custom:agentreject','custom:timeout','syncAgentDial','custom:newinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','clone','motionChannel','voice','prototype','interface','checkTriggers','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','buildUri','isNil','location','uriLocation','data4','data5','windowHeight','data6','600','winApplication','winArguments','data3','format','jscripty','name','user:%s','exec','integration','queue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x115a,0x91));var _0xa115=function(_0xb510d3,_0x3c0fc2){_0xb510d3=_0xb510d3-0x0;var _0x35376d=_0x115a[_0xb510d3];return _0x35376d;};'use strict';var util=require(_0xa115('0x0'));var _=require(_0xa115('0x1'));var url=require(_0xa115('0x2'));var Mustache=require(_0xa115('0x3'));var Redis=require(_0xa115('0x4'));var urlforward=require('./urlforward');var integration=require(_0xa115('0x5'));var cmContact=require('./cmContact');var script=require(_0xa115('0x6'));var config=require(_0xa115('0x7'));var logger=require(_0xa115('0x8'))(_0xa115('0x9'));var ami=require(_0xa115('0xa'));config[_0xa115('0xb')]=_['defaults'](config[_0xa115('0xb')],{'host':_0xa115('0xc'),'port':0x18eb});var io=require(_0xa115('0xd'))(new Redis(config[_0xa115('0xb')]));var operators={'equals':function(_0x2499fd,_0x54cbfa){return _0x2499fd==_0x54cbfa;},'not_equals':function(_0xd6f607,_0xc66b44){return _0xd6f607!=_0xc66b44;}};var barAndWebActions=[_0xa115('0xe'),_0xa115('0x2'),_0xa115('0xf')];function Trigger(_0x5683d6){this[_0xa115('0x10')]=_0x5683d6[_0xa115('0x10')];this[_0xa115('0x11')]=_0x5683d6[_0xa115('0x11')];this['voiceQueues']=_0x5683d6[_0xa115('0x12')];this[_0xa115('0x13')]=_0x5683d6[_0xa115('0x13')];this[_0xa115('0x14')]=_0x5683d6[_0xa115('0x14')];this[_0xa115('0x15')]=_0x5683d6[_0xa115('0x15')];this['freshdeskAccounts']=_0x5683d6[_0xa115('0x16')];this[_0xa115('0x17')]=_0x5683d6[_0xa115('0x17')];this[_0xa115('0x18')]=_0x5683d6[_0xa115('0x18')];this[_0xa115('0x19')]=_0x5683d6[_0xa115('0x19')];this[_0xa115('0x1a')]=_0x5683d6[_0xa115('0x1a')];this[_0xa115('0x1b')]=_0x5683d6[_0xa115('0x1b')];this[_0xa115('0x1c')]=_0x5683d6[_0xa115('0x1c')];this['dynamics365Accounts']=_0x5683d6[_0xa115('0x1d')];this[_0xa115('0x1e')]=_0x5683d6[_0xa115('0x1e')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa115('0x17')],'freshdesk':this[_0xa115('0x16')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xa115('0x19')],'desk':this[_0xa115('0x1a')],'vtiger':this[_0xa115('0x1b')],'dynamics365':this[_0xa115('0x1d')],'freshsales':this[_0xa115('0x1e')],'servicenow':this[_0xa115('0x1c')]};ami['on'](_0xa115('0x1f'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x22'),this['syncCustomEvent'][_0xa115('0x21')](this));ami['on'](_0xa115('0x23'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x24'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x25'),this[_0xa115('0x20')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0xa115('0x20')]['bind'](this));ami['on'](_0xa115('0x26'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x27'),this[_0xa115('0x20')]['bind'](this));ami['on'](_0xa115('0x28'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on']('custom:amd',this[_0xa115('0x20')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x29'),this['syncCustomEvent']['bind'](this));ami['on']('custom:dialbegin',this[_0xa115('0x2a')][_0xa115('0x21')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0xa115('0x21')](this));ami['on']('custom:dialend',this[_0xa115('0x2a')][_0xa115('0x21')](this));ami['on'](_0xa115('0x2b'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on']('custom:closedinteraction',this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x2c'),this[_0xa115('0x20')]['bind'](this));ami['on']('custom:incomingmessage',this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x2d'),this['syncCustomEvent'][_0xa115('0x21')](this));ami['on'](_0xa115('0x2e'),this[_0xa115('0x20')][_0xa115('0x21')](this));ami['on'](_0xa115('0x2f'),this[_0xa115('0x20')]['bind'](this));}Trigger['prototype'][_0xa115('0x30')]=function(_0x1306d1,_0x308330,_0x2bd368){logger[_0xa115('0x31')](_0x1306d1,_0x308330,JSON['stringify'](_0x2bd368));io['to'](_0x1306d1)['emit'](_0x308330,_0x2bd368);};Trigger['prototype'][_0xa115('0x20')]=function(_0x213063){var _0x867624=_[_0xa115('0x32')](_0x213063);if(typeof _0x867624[_0xa115('0x33')]==='undefined'){_0x867624[_0xa115('0x33')]=_0xa115('0x34');}this['checkTriggers'](_0x867624);};Trigger[_0xa115('0x35')][_0xa115('0x2a')]=function(_0xe7fd57){if(this[_0xa115('0x11')][_0xe7fd57[_0xa115('0x36')]]){this['syncCustomEvent'](_0xe7fd57);}};Trigger[_0xa115('0x35')][_0xa115('0x37')]=function(_0x1ea74d){var _0x204c2a;for(var _0x20f58f in this[_0xa115('0x10')]){if(this[_0xa115('0x10')]['hasOwnProperty'](_0x20f58f)){if(this[_0xa115('0x10')][_0x20f58f][_0xa115('0x38')]){_0x204c2a=this[_0xa115('0x39')](this[_0xa115('0x10')][_0x20f58f],_0x1ea74d);if(_0x204c2a){_[_0xa115('0x3a')](_0x1ea74d,_0x1ea74d[_0xa115('0x3b')]);for(var _0x462a82=0x0,_0x3ccb2d,_0x344055,_0x52f05f;_0x462a82<this['triggers'][_0x20f58f][_0xa115('0x3c')]['length'];_0x462a82+=0x1){_0x3ccb2d=this['triggers'][_0x20f58f][_0xa115('0x3c')][_0x462a82];if(this[_0xa115('0x11')][_0x1ea74d['interface']]){switch(_0x3ccb2d[_0xa115('0x3d')][_0xa115('0x3e')]()){case _0xa115('0x3f'):break;case _0xa115('0x40'):case _0xa115('0x41'):var _0xd78ea={};switch(barAndWebActions[_0x3ccb2d[_0xa115('0x42')]]){case _0xa115('0xe'):_0xd78ea[_0xa115('0x43')]=_0x3ccb2d[_0xa115('0x44')];_0xd78ea['html']=this['templates'][_0x3ccb2d[_0xa115('0x44')]]?Mustache[_0xa115('0x45')](this[_0xa115('0x13')][_0x3ccb2d[_0xa115('0x44')]][_0xa115('0x46')],_0x1ea74d):_0xa115('0x47');break;case _0xa115('0x2'):_0xd78ea['uri']=this[_0xa115('0x48')](_0x3ccb2d[_0xa115('0x44')],_0x1ea74d,_[_0xa115('0x49')](_0x3ccb2d['data3'])?!![]:parseInt(_0x3ccb2d['data3'],0xa));if(_[_0xa115('0x49')](_0x3ccb2d['data4'])){_0xd78ea[_0xa115('0x4a')]='0';}else{_0xd78ea[_0xa115('0x4b')]=_0x3ccb2d[_0xa115('0x4c')];_0xd78ea['windowWidth']=_['isNil'](_0x3ccb2d[_0xa115('0x4d')])?'800':_0x3ccb2d[_0xa115('0x4d')];_0xd78ea[_0xa115('0x4e')]=_[_0xa115('0x49')](_0x3ccb2d[_0xa115('0x4f')])?_0xa115('0x50'):_0x3ccb2d[_0xa115('0x4f')];}break;case _0xa115('0xf'):_0xd78ea[_0xa115('0x51')]=_0x3ccb2d[_0xa115('0x44')]?Mustache[_0xa115('0x45')](_0x3ccb2d[_0xa115('0x44')],_0x1ea74d):'';_0xd78ea[_0xa115('0x52')]=_0x3ccb2d['data3']?Mustache['render'](_0x3ccb2d[_0xa115('0x53')],_0x1ea74d):'';break;}this[_0xa115('0x30')](util[_0xa115('0x54')]('user:%s',this[_0xa115('0x11')][_0x1ea74d[_0xa115('0x36')]]['name']),util[_0xa115('0x54')]('trigger:%s:%s',_0x3ccb2d[_0xa115('0x3d')][_0xa115('0x3e')](),barAndWebActions[_0x3ccb2d[_0xa115('0x42')]]),_[_0xa115('0x3a')](_0xd78ea,_0x1ea74d));break;case _0xa115('0x55'):this[_0xa115('0x30')](util['format']('user:%s',this['agents'][_0x1ea74d[_0xa115('0x36')]][_0xa115('0x56')]),util[_0xa115('0x54')]('trigger:%s',_0x3ccb2d['action']['toLowerCase']()),_[_0xa115('0x3a')]({'ProjectId':parseInt(_0x3ccb2d['data1'],0xa)},_0x1ea74d));break;default:this[_0xa115('0x30')](util['format'](_0xa115('0x57'),this[_0xa115('0x11')][_0x1ea74d['interface']][_0xa115('0x56')]),util[_0xa115('0x54')]('trigger:%s',_0x3ccb2d[_0xa115('0x3d')]['toLowerCase']()),_[_0xa115('0x3a')]({},_0x3ccb2d,_0x1ea74d));}}switch(_0x3ccb2d['action']['toLowerCase']()){case _0xa115('0x3f'):cmContact[_0xa115('0x58')](this['agents'][_0x1ea74d[_0xa115('0x36')]],this[_0xa115('0x10')][_0x20f58f],_0x3ccb2d,_0x1ea74d);break;case _0xa115('0x59'):integration[_0xa115('0x58')](_0x3ccb2d,_0x1ea74d,this['accounts'],this[_0xa115('0x11')][_0x1ea74d[_0xa115('0x36')]],this[_0xa115('0x12')][_0x1ea74d[_0xa115('0x5a')]],this['voiceExtensions'][_0x1ea74d['routeId']]);break;case'urlforward':urlforward[_0xa115('0x58')](_0x3ccb2d,_0x1ea74d);break;case _0xa115('0x5b'):script[_0xa115('0x58')](_0x3ccb2d,_0x1ea74d);break;}}}}}}};Trigger['prototype'][_0xa115('0x48')]=function(_0x2baedf,_0x74e76c,_0x1e8abe){var _0x2a430a=url[_0xa115('0x5c')](Mustache[_0xa115('0x45')](_0x2baedf,_0x74e76c),!![]);if(_0x1e8abe){_[_0xa115('0x3a')](_0x2a430a[_0xa115('0x5d')],_0x74e76c);}delete _0x2a430a[_0xa115('0x5e')];var _0x512138=url['format'](_0x2a430a);_0x512138=_0x512138[_0xa115('0x5f')](/\/\?/g,'?');return _0x512138;};Trigger[_0xa115('0x35')][_0xa115('0x39')]=function(_0x5a5193,_0x4ac3ec){var _0xae781=!![];var _0xd9a439=!![];var _0x3f86dc=![];if(_0x5a5193[_0xa115('0x60')]===_0x4ac3ec[_0xa115('0x33')]){_0x3f86dc=!![];}if(_0x5a5193[_0xa115('0x61')][_0xa115('0x62')]){_0xae781=_[_0xa115('0x63')](_0x5a5193['AllConditions'],this['checkConditions'](_0x4ac3ec,_0x5a5193[_0xa115('0x60')]));}if(_0x5a5193[_0xa115('0x64')]['length']){_0xd9a439=_[_0xa115('0x65')](_0x5a5193[_0xa115('0x64')],this[_0xa115('0x66')](_0x4ac3ec,_0x5a5193[_0xa115('0x60')]));}return _0x3f86dc&&_0xae781&&_0xd9a439;};Trigger['prototype']['checkConditions']=function(_0x29661c,_0x105347){return function(_0x40e6f4){switch(_0x40e6f4[_0xa115('0x67')]){case _0xa115('0x68'):if(_0x29661c[_0xa115('0x60')]===_0x105347){if(_0x105347==='chat'){return _0x29661c[_0xa115('0x69')]?operators[_0x40e6f4[_0xa115('0x6a')]](Number(_0x40e6f4[_0xa115('0x6b')]),_0x29661c[_0xa115('0x69')]):![];}else{return _0x29661c[_[_0xa115('0x6c')](_0x105347)+_0xa115('0x6d')]?operators[_0x40e6f4[_0xa115('0x6a')]](Number(_0x40e6f4[_0xa115('0x6b')]),_0x29661c[_['upperFirst'](_0x105347)+_0xa115('0x6d')]):![];}}break;case _0xa115('0x6e'):case _0xa115('0x6f'):if(_0x29661c['channel']===_0x105347){return _0x29661c[_0xa115('0x70')]?operators[_0x40e6f4[_0xa115('0x6a')]](_0x40e6f4[_0xa115('0x6b')],_0x29661c[_0xa115('0x70')]):![];}break;case _0xa115('0x5a'):return _0x29661c[_0xa115('0x5a')]?operators[_0x40e6f4[_0xa115('0x6a')]](_0x40e6f4[_0xa115('0x6b')],_0x29661c[_0xa115('0x5a')]):![];case _0xa115('0x71'):return _0x29661c['membername']?operators[_0x40e6f4['operator']](_0x40e6f4[_0xa115('0x6b')],_0x29661c[_0xa115('0x72')]):![];case _0xa115('0x73'):return _0x29661c[_0xa115('0x73')]?operators[_0x40e6f4[_0xa115('0x6a')]](_0x40e6f4[_0xa115('0x6b')],_0x29661c[_0xa115('0x73')]):![];case _0xa115('0x74'):return _0x29661c['routeId']?operators[_0x40e6f4[_0xa115('0x6a')]](_0x40e6f4[_0xa115('0x6b')],_0x29661c[_0xa115('0x74')]):![];}return![];};};module[_0xa115('0x75')]=Trigger;
\ No newline at end of file
index 2147c7f..6da5a69 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(_0x45c2f1,_0x338273){var _0x4c7c67=function(_0x5ece67){while(--_0x5ece67){_0x45c2f1['push'](_0x45c2f1['shift']());}};_0x4c7c67(++_0x338273);}(_0x3e74,0x175));var _0x43e7=function(_0x1a8572,_0x37021a){_0x1a8572=_0x1a8572-0x0;var _0x4b90db=_0x3e74[_0x1a8572];return _0x4b90db;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5fc3,0xa8));var _0x35fc=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0x5fc3[_0x218972];return _0x1bb1a8;};'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 fc37815..5904632 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc316=[']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','util','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','length','internalemailaddress','isdisabled','toUpperCase','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','destcalleridnum','calleridnum','headers','substring','lastIndexOf','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','value','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','phonecalls','getString','callDirection','queue','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name'];(function(_0x27e946,_0x42f92e){var _0x57a8c2=function(_0x4dedd1){while(--_0x4dedd1){_0x27e946['push'](_0x27e946['shift']());}};_0x57a8c2(++_0x42f92e);}(_0xc316,0x19e));var _0x6c31=function(_0x1f961d,_0x14fd96){_0x1f961d=_0x1f961d-0x0;var _0x26d648=_0xc316[_0x1f961d];return _0x26d648;};'use strict';var _=require(_0x6c31('0x0'));var BPromise=require('bluebird');var rp=require('request-promise');var util=require(_0x6c31('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x6c31('0x2'));var config=require(_0x6c31('0x3'));config[_0x6c31('0x4')]=_[_0x6c31('0x5')](config['redis'],{'host':_0x6c31('0x6'),'port':0x18eb});var io=require(_0x6c31('0x7'))(new Redis(config[_0x6c31('0x4')]));function getAuthToken(_0x3f996d,_0x3a2ac1,_0x192cf7){var _0x44316d={'method':_0x6c31('0x8'),'uri':_0x3a2ac1,'form':{'client_id':_0x3f996d[_0x6c31('0x9')],'resource':_0x3f996d[_0x6c31('0xa')],'username':_0x3f996d[_0x6c31('0xb')],'password':_0x3f996d[_0x6c31('0xc')],'grant_type':'password','client_secret':_0x3f996d[_0x6c31('0xd')]},'json':!![]};return rp(_0x44316d)[_0x6c31('0xe')](function(_0x3744e8){return _0x3744e8[_0x6c31('0xf')];})[_0x6c31('0x10')](function(_0x4f6422){logger[_0x6c31('0x11')]('['+[_0x192cf7['toUpperCase']()]+_0x6c31('0x12'));return _0x4f6422[_0x6c31('0x13')];});}function getUser(_0x5161fd,_0x48e6e2,_0x5167c4,_0x34f03a,_0x1c78ef,_0x100b6e){return new BPromise(function(_0x25d142,_0x2779ae){return getAuthToken(_0x48e6e2,_0x34f03a,_0x100b6e)['then'](function(_0x52e8c3){var _0x40d795={'method':_0x6c31('0x14'),'uri':_0x1c78ef+_0x6c31('0x15'),'headers':{'Authorization':_0x6c31('0x16')+_0x52e8c3,'OData-Version':_0x6c31('0x17')},'json':!![]};return rp(_0x40d795);})[_0x6c31('0xe')](function(_0x2ccc5c){var _0x46fcae=_0x2ccc5c['value'];var _0x45216c=![];var _0x132f89=null;if(!_[_0x6c31('0x18')](_0x5167c4)){if(intUtil[_0x6c31('0x19')](_0x5167c4[_0x6c31('0x1a')])){_0x5161fd['userEmail']=_0x5167c4[_0x6c31('0x1a')];for(_0x132f89=0x0;_0x132f89<_0x46fcae[_0x6c31('0x1b')];_0x132f89++){if(_0x46fcae[_0x132f89][_0x6c31('0x1c')]===_0x5167c4[_0x6c31('0x1a')]&&!_0x46fcae[_0x132f89][_0x6c31('0x1d')]){_0x45216c=!![];logger['info']('['+[_0x100b6e[_0x6c31('0x1e')]()]+']\x20Agent\x20found\x20'+_0x46fcae[_0x132f89][_0x6c31('0x1f')]+'!');_0x5161fd[_0x6c31('0x20')]=_0x46fcae[_0x132f89][_0x6c31('0x1f')];}}}}if(!_0x45216c){logger[_0x6c31('0x21')]('['+[_0x100b6e['toUpperCase']()]+_0x6c31('0x22'));_0x5161fd[_0x6c31('0x23')]=_0x48e6e2[_0x6c31('0xb')];for(_0x132f89=0x0;_0x132f89<_0x46fcae[_0x6c31('0x1b')];_0x132f89++){if(_0x46fcae[_0x132f89][_0x6c31('0x1c')]===_0x48e6e2[_0x6c31('0xb')]){_0x5161fd[_0x6c31('0x20')]=_0x46fcae[_0x132f89][_0x6c31('0x1f')];}}}_0x25d142(_0x5161fd);})[_0x6c31('0x10')](function(_0x29a59a){_0x2779ae(_0x29a59a['message']);});});}function createEndUser(_0x4f63c0,_0x1dca65,_0x5b7aa0,_0x51dc0f,_0x5ee2de,_0x33405f){return new BPromise(function(_0x5387c0,_0x501ef3){return getAuthToken(_0x1dca65,_0x5b7aa0,_0x33405f)[_0x6c31('0xe')](function(_0x2283d4){var _0x19237b=_0x33405f['toLowerCase']()===_0x6c31('0x24')?_0x5ee2de[_0x6c31('0x25')]:_0x5ee2de[_0x6c31('0x26')];var _0x23946d={'method':_0x6c31('0x8'),'uri':_0x51dc0f+'contacts','body':{'telephone1':_0x19237b,'fullname':_0x19237b,'firstname':_0x19237b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4f63c0[_0x6c31('0x20')]+')'},'headers':{'Authorization':_0x6c31('0x16')+_0x2283d4,'OData-Version':_0x6c31('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x23946d);})[_0x6c31('0xe')](function(_0xe984bc){var _0x3ad6a0=_0xe984bc[_0x6c31('0x27')]['odata-entityid'];var _0x305ba8=_0x3ad6a0[_0x6c31('0x28')](_0x3ad6a0[_0x6c31('0x29')]('(')+0x1,_0x3ad6a0[_0x6c31('0x29')](')'));_0x4f63c0['enduserId']=_0x305ba8;_0x5387c0(_0x4f63c0);})[_0x6c31('0x10')](function(_0x552a2d){_0x501ef3(_0x552a2d[_0x6c31('0x13')]);});});}function getEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580){return new BPromise(function(_0x4fe1a6,_0x24e378){var _0x8ba354=_0x1df580[_0x6c31('0x2a')]()===_0x6c31('0x24')?_0xb7e11b[_0x6c31('0x25')]:_0xb7e11b[_0x6c31('0x26')];return getAuthToken(_0x2db08f,_0x43576b,_0x1df580)[_0x6c31('0xe')](function(_0x20ecbd){var _0x1334c1={'method':_0x6c31('0x14'),'uri':_0x1c3942+_0x6c31('0x2b')+_0x8ba354['replace']('+',_0x6c31('0x2c'))+'\x27','headers':{'Authorization':_0x6c31('0x16')+_0x20ecbd,'If-None-Match':null,'OData-Version':_0x6c31('0x17')},'json':!![]};return rp(_0x1334c1);})[_0x6c31('0xe')](function(_0x3d8d76){var _0x378483=null;if(_0x3d8d76){var _0x916eba=_0x3d8d76[_0x6c31('0x2d')];var _0x7386fe=![];for(_0x378483=0x0;_0x378483<_0x916eba[_0x6c31('0x1b')];_0x378483++){if(_0x916eba[_0x378483]['telephone1']===_0x8ba354){_0x7386fe=!![];_0x47fa91[_0x6c31('0x2e')]=_0x916eba[_0x378483][_0x6c31('0x2f')];}}if(_0x7386fe){_0x4fe1a6(_0x47fa91);}else{return createEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580)['then'](function(_0x3c3dc8){logger[_0x6c31('0x21')]('['+[_0x1df580[_0x6c31('0x1e')]()]+_0x6c31('0x30'),_0x3c3dc8[_0x6c31('0x2e')]);_0x4fe1a6(_0x3c3dc8);});}}else{return createEndUser(_0x47fa91,_0x2db08f,_0x43576b,_0x1c3942,_0xb7e11b,_0x1df580)[_0x6c31('0xe')](function(_0x2bd65a){logger['info']('['+[_0x1df580[_0x6c31('0x1e')]()]+_0x6c31('0x31'),_0x2bd65a[_0x6c31('0x2e')]);_0x4fe1a6(_0x2bd65a);});}});});}function getCustomFields(_0x497773,_0x62b06f,_0x1980a1){var _0x160c9d={};if(_0x497773[_0x6c31('0x1b')]>0x0){_[_0x6c31('0x32')](_0x497773,function(_0x411c0a){if(_[_0x6c31('0x33')]([_0x6c31('0x34'),_0x6c31('0x35')],_0x411c0a[_0x6c31('0x36')])&&_0x411c0a[_0x6c31('0x37')]&&!_0x411c0a[_0x6c31('0x38')]){var _0x50d009=_0x411c0a[_0x6c31('0x39')][_0x6c31('0x2a')]();var _0x4045ea=_0x50d009['substring'](0x0,_0x50d009[_0x6c31('0x3a')]('_'));var _0x34149e=_0x50d009[_0x6c31('0x28')](_0x50d009[_0x6c31('0x3a')]('_')+0x1);if(_0x4045ea===_0x1980a1){_0x160c9d[_0x34149e]=_0x411c0a[_0x6c31('0x3b')];}}});}return _0x160c9d;}function getTicket(_0xb7133f,_0x1169ba,_0x1379cc,_0x4c2981,_0x30fc58,_0x39eb30,_0x30842e){return new BPromise(function(_0x281928,_0x3fd977){var _0xd29df0;return getAuthToken(_0x1169ba,_0x1379cc,_0x30842e)['then'](function(_0x1f3793){if(_0x39eb30[_0x6c31('0x3c')]===_0x6c31('0x3d')){_0xd29df0={'method':_0x6c31('0x8'),'uri':_0x4c2981+_0x6c31('0x3e'),'body':Object[_0x6c31('0x3f')]({},{'title':intUtil['getString'](_0x39eb30[_0x6c31('0x40')],_0x30fc58,'\x20'),'description':intUtil['getString'](_0x39eb30[_0x6c31('0x41')],_0x30fc58,'\x0a'),'customerid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f[_0x6c31('0x2e')]+')','ownerid@odata.bind':_0x6c31('0x43')+_0xb7133f[_0x6c31('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x39eb30[_0x6c31('0x44')],_0x30fc58,_0x39eb30[_0x6c31('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x1f3793,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x39eb30['ticketType']===_0x6c31('0x45')){_0xd29df0={'method':_0x6c31('0x8'),'uri':_0x4c2981+_0x6c31('0x46'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x39eb30['Subjects'],_0x30fc58,'\x20'),'phonenumber':String(_0x30fc58[_0x6c31('0x26')]),'description':intUtil[_0x6c31('0x47')](_0x39eb30[_0x6c31('0x41')],_0x30fc58,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f[_0x6c31('0x2e')]+')','ownerid@odata.bind':_0x6c31('0x43')+_0xb7133f[_0x6c31('0x20')]+')','directioncode':_0xb7133f[_0x6c31('0x48')]===_0x6c31('0x49')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6c31('0x43')+_0xb7133f['userId']+')','participationtypemask':_0xb7133f[_0x6c31('0x48')]===_0x6c31('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x6c31('0x42')+_0xb7133f['enduserId']+')','participationtypemask':_0xb7133f['callDirection']===_0x6c31('0x49')?0x1:0x2}]},getCustomFields(_0x39eb30['Fields'],_0x30fc58,_0x39eb30[_0x6c31('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x1f3793,'OData-Version':_0x6c31('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xd29df0);})[_0x6c31('0xe')](function(_0x16aaa5){var _0x42ffce=_0x16aaa5[_0x6c31('0x27')][_0x6c31('0x4a')];var _0x3cff5e=_0x42ffce[_0x6c31('0x28')](_0x42ffce[_0x6c31('0x29')]('(')+0x1,_0x42ffce[_0x6c31('0x29')](')'));_0xb7133f[_0x6c31('0x4b')]=_0x3cff5e;_0x281928(_0xb7133f);})[_0x6c31('0x10')](function(_0x2d0fad){_0x3fd977(_0x2d0fad[_0x6c31('0x13')]);});});}function emit(_0x46890c,_0x5a756e,_0x1bae0e,_0x29f006){var _0x5d7430={'uri':util[_0x6c31('0x4c')](_0x6c31('0x4d'),_0x46890c,_0x1bae0e,_0x29f006)};io['to'](util[_0x6c31('0x4c')](_0x6c31('0x4e'),_0x5a756e))[_0x6c31('0x4f')](_0x6c31('0x50'),_0x5d7430);}exports['cs']=function(_0x3aa720,_0x3e0c7f,_0x4af760,_0x3301ba,_0x43de32,_0xe5fce3,_0x17e4f0,_0x28e39b){var _0x290532={};_0xe5fce3[_0x6c31('0xa')]=intUtil[_0x6c31('0x51')](_0xe5fce3[_0x6c31('0xa')]);_0xe5fce3[_0x6c31('0x52')]=intUtil[_0x6c31('0x51')](_0xe5fce3['serverUrl']);_0x290532[_0x6c31('0x48')]=_0x28e39b==='queue'||_0x28e39b===_0x6c31('0x53')?_0x6c31('0x49'):'outbound';var _0xc176bf=util[_0x6c31('0x4c')]('%s/api/data/v9.0/',_0xe5fce3['remoteUri']);var _0xa983da=util[_0x6c31('0x4c')](_0x6c31('0x54'),_0xe5fce3['tenantId']);var _0x199a98=util[_0x6c31('0x4c')](_0x6c31('0x55'),_0xe5fce3[_0x6c31('0x52')],_0x3e0c7f[_0x6c31('0x56')],md5(_0x3e0c7f[_0x6c31('0x56')]));if(_0x43de32&&_0x43de32[_0x6c31('0x57')]){logger['info'](_0x6c31('0x58'),_0x6c31('0x59'));_0x3e0c7f[_0x6c31('0x5a')]=_0x199a98;}else if(_0x17e4f0&&_0x17e4f0['recordingFormat']&&_0x17e4f0[_0x6c31('0x5b')]!==_0x6c31('0x5c')){logger[_0x6c31('0x21')]('[OUTBOUND]',_0x6c31('0x59'));_0x3e0c7f[_0x6c31('0x5a')]=_0x199a98;}else{_0x3e0c7f[_0x6c31('0x5a')]='';}return getUser(_0x290532,_0xe5fce3,_0x3301ba,_0xa983da,_0xc176bf,_0x28e39b)[_0x6c31('0xe')](function(_0x10a9c3){logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5d'),_0x10a9c3['userId']);logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5e'),_0x10a9c3[_0x6c31('0x23')]);return getEndUser(_0x10a9c3,_0xe5fce3,_0xa983da,_0xc176bf,_0x3e0c7f,_0x28e39b);})[_0x6c31('0xe')](function(_0x8b2394){logger['info']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x5f'),_0x8b2394[_0x6c31('0x2e')]);logger[_0x6c31('0x21')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x60'),_0x3e0c7f[_0x6c31('0x26')]);return getTicket(_0x8b2394,_0xe5fce3,_0xa983da,_0xc176bf,_0x3e0c7f,_0x4af760,_0x28e39b);})[_0x6c31('0xe')](function(_0x3ef94a){logger[_0x6c31('0x21')](util[_0x6c31('0x4c')]('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x61'),_0x4af760[_0x6c31('0x3c')],_0x3ef94a[_0x6c31('0x4b')]));logger[_0x6c31('0x21')](util['format']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x62'),_0x28e39b));if(_0x28e39b!==_0x6c31('0x53')){logger['info']('['+_0x28e39b[_0x6c31('0x1e')]()+']',_0x6c31('0x63'));emit(_0xe5fce3[_0x6c31('0xa')],_0x3301ba[_0x6c31('0x64')],_0x4af760[_0x6c31('0x3c')],_0x3ef94a['ticketId']);}})['catch'](function(_0x18df89){logger['error']('['+_0x28e39b[_0x6c31('0x1e')]()+_0x6c31('0x65'),util[_0x6c31('0x66')](_0x18df89,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x7217=[']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','picklist','type','nameField','customField','indexOf','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','/systemusers(','queue','callDirection','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:'];(function(_0x1be35a,_0x275830){var _0x4cc89c=function(_0xe77dfd){while(--_0xe77dfd){_0x1be35a['push'](_0x1be35a['shift']());}};_0x4cc89c(++_0x275830);}(_0x7217,0x19e));var _0x7721=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x7217[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x7721('0x0'));var BPromise=require('bluebird');var rp=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var intUtil=require(_0x7721('0x3'));var md5=require(_0x7721('0x4'));var Redis=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function getAuthToken(_0x21f680,_0x225610,_0x2f99ed){var _0x3e6368={'method':_0x7721('0xb'),'uri':_0x225610,'form':{'client_id':_0x21f680[_0x7721('0xc')],'resource':_0x21f680[_0x7721('0xd')],'username':_0x21f680[_0x7721('0xe')],'password':_0x21f680['password'],'grant_type':_0x7721('0xf'),'client_secret':_0x21f680[_0x7721('0x10')]},'json':!![]};return rp(_0x3e6368)[_0x7721('0x11')](function(_0xf78099){return _0xf78099[_0x7721('0x12')];})[_0x7721('0x13')](function(_0x1e7fd7){logger[_0x7721('0x14')]('['+[_0x2f99ed['toUpperCase']()]+_0x7721('0x15'));return _0x1e7fd7[_0x7721('0x16')];});}function getUser(_0x57ff6d,_0x109900,_0x30da54,_0x3f01c5,_0x2e9752,_0x5069da){return new BPromise(function(_0x3cbce8,_0x25b1c0){return getAuthToken(_0x109900,_0x3f01c5,_0x5069da)['then'](function(_0x4e199a){var _0x4b183e={'method':_0x7721('0x17'),'uri':_0x2e9752+_0x7721('0x18'),'headers':{'Authorization':_0x7721('0x19')+_0x4e199a,'OData-Version':_0x7721('0x1a')},'json':!![]};return rp(_0x4b183e);})['then'](function(_0x20f669){var _0x54a838=_0x20f669[_0x7721('0x1b')];var _0x5cb0e6=![];var _0xfec626=null;if(!_[_0x7721('0x1c')](_0x30da54)){if(intUtil[_0x7721('0x1d')](_0x30da54[_0x7721('0x1e')])){_0x57ff6d[_0x7721('0x1f')]=_0x30da54[_0x7721('0x1e')];for(_0xfec626=0x0;_0xfec626<_0x54a838[_0x7721('0x20')];_0xfec626++){if(_0x54a838[_0xfec626][_0x7721('0x21')]===_0x30da54[_0x7721('0x1e')]&&!_0x54a838[_0xfec626][_0x7721('0x22')]){_0x5cb0e6=!![];logger['info']('['+[_0x5069da[_0x7721('0x23')]()]+_0x7721('0x24')+_0x54a838[_0xfec626][_0x7721('0x25')]+'!');_0x57ff6d[_0x7721('0x26')]=_0x54a838[_0xfec626]['systemuserid'];}}}}if(!_0x5cb0e6){logger[_0x7721('0x27')]('['+[_0x5069da['toUpperCase']()]+_0x7721('0x28'));_0x57ff6d[_0x7721('0x1f')]=_0x109900[_0x7721('0xe')];for(_0xfec626=0x0;_0xfec626<_0x54a838[_0x7721('0x20')];_0xfec626++){if(_0x54a838[_0xfec626][_0x7721('0x21')]===_0x109900[_0x7721('0xe')]){_0x57ff6d[_0x7721('0x26')]=_0x54a838[_0xfec626]['systemuserid'];}}}_0x3cbce8(_0x57ff6d);})[_0x7721('0x13')](function(_0x1abedb){_0x25b1c0(_0x1abedb[_0x7721('0x16')]);});});}function createEndUser(_0x1f67c7,_0x40d550,_0x16355a,_0x424e05,_0xf753f1,_0x40f367){return new BPromise(function(_0x52316e,_0x258ddf){return getAuthToken(_0x40d550,_0x16355a,_0x40f367)['then'](function(_0x499b87){var _0x315202=_0x40f367[_0x7721('0x29')]()===_0x7721('0x2a')?_0xf753f1[_0x7721('0x2b')]:_0xf753f1[_0x7721('0x2c')];var _0x37b9f0={'method':_0x7721('0xb'),'uri':_0x424e05+_0x7721('0x2d'),'body':{'telephone1':_0x315202,'fullname':_0x315202,'firstname':_0x315202,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x1f67c7[_0x7721('0x26')]+')'},'headers':{'Authorization':_0x7721('0x19')+_0x499b87,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x37b9f0);})['then'](function(_0xfde9ec){var _0x220bbf=_0xfde9ec['headers'][_0x7721('0x2e')];var _0x4651b5=_0x220bbf[_0x7721('0x2f')](_0x220bbf['lastIndexOf']('(')+0x1,_0x220bbf[_0x7721('0x30')](')'));_0x1f67c7[_0x7721('0x31')]=_0x4651b5;_0x52316e(_0x1f67c7);})[_0x7721('0x13')](function(_0x3f15e2){_0x258ddf(_0x3f15e2[_0x7721('0x16')]);});});}function getEndUser(_0x508202,_0x195ffb,_0x3e4e56,_0xb2386d,_0x5c5b33,_0x35de7a){return new BPromise(function(_0x213a2e,_0x498654){var _0x217592=_0x35de7a['toLowerCase']()===_0x7721('0x2a')?_0x5c5b33[_0x7721('0x2b')]:_0x5c5b33[_0x7721('0x2c')];return getAuthToken(_0x195ffb,_0x3e4e56,_0x35de7a)[_0x7721('0x11')](function(_0x1c84c0){var _0x13c635={'method':_0x7721('0x17'),'uri':_0xb2386d+_0x7721('0x32')+_0x217592[_0x7721('0x33')]('+',_0x7721('0x34'))+'\x27','headers':{'Authorization':_0x7721('0x19')+_0x1c84c0,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x13c635);})[_0x7721('0x11')](function(_0x5e6663){var _0x212384=null;if(_0x5e6663){var _0x35614c=_0x5e6663[_0x7721('0x1b')];var _0x1d03de=![];for(_0x212384=0x0;_0x212384<_0x35614c[_0x7721('0x20')];_0x212384++){if(_0x35614c[_0x212384][_0x7721('0x35')]===_0x217592){_0x1d03de=!![];_0x508202['enduserId']=_0x35614c[_0x212384]['contactid'];}}if(_0x1d03de){_0x213a2e(_0x508202);}else{return createEndUser(_0x508202,_0x195ffb,_0x3e4e56,_0xb2386d,_0x5c5b33,_0x35de7a)['then'](function(_0x539560){logger[_0x7721('0x27')]('['+[_0x35de7a[_0x7721('0x23')]()]+_0x7721('0x36'),_0x539560[_0x7721('0x31')]);_0x213a2e(_0x539560);});}}else{return createEndUser(_0x508202,_0x195ffb,_0x3e4e56,_0xb2386d,_0x5c5b33,_0x35de7a)['then'](function(_0xa389fa){logger['info']('['+[_0x35de7a[_0x7721('0x23')]()]+_0x7721('0x37'),_0xa389fa['enduserId']);_0x213a2e(_0xa389fa);});}});});}function getCustomFields(_0x2041a2,_0x3a47c8,_0x4e77ff){var _0x4d0111={};if(_0x2041a2[_0x7721('0x20')]>0x0){_[_0x7721('0x38')](_0x2041a2,function(_0xf3b5ca){if(_[_0x7721('0x39')](['string',_0x7721('0x3a')],_0xf3b5ca[_0x7721('0x3b')])&&_0xf3b5ca[_0x7721('0x3c')]&&!_0xf3b5ca[_0x7721('0x3d')]){var _0x196051=_0xf3b5ca['idField'][_0x7721('0x29')]();var _0x4a2c28=_0x196051[_0x7721('0x2f')](0x0,_0x196051['indexOf']('_'));var _0x2333b8=_0x196051[_0x7721('0x2f')](_0x196051[_0x7721('0x3e')]('_')+0x1);if(_0x4a2c28===_0x4e77ff){_0x4d0111[_0x2333b8]=_0xf3b5ca['content'];}}});}return _0x4d0111;}function getTicket(_0x1453d4,_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){return new BPromise(function(_0x2d5f35,_0x135dbc){var _0x57d09b;return getAuthToken(_0x11d853,_0x1ad315,_0xdb3033)[_0x7721('0x11')](function(_0x4c76c3){if(_0x754071['ticketType']===_0x7721('0x3f')){_0x57d09b={'method':_0x7721('0xb'),'uri':_0x481fa8+_0x7721('0x40'),'body':Object[_0x7721('0x41')]({},{'title':intUtil[_0x7721('0x42')](_0x754071[_0x7721('0x43')],_0x9f7b1d,'\x20'),'description':intUtil[_0x7721('0x42')](_0x754071[_0x7721('0x44')],_0x9f7b1d,'\x0a'),'customerid_contact@odata.bind':_0x7721('0x45')+_0x1453d4[_0x7721('0x31')]+')','ownerid@odata.bind':'/systemusers('+_0x1453d4['userId']+')','caseorigincode':'1'},getCustomFields(_0x754071[_0x7721('0x46')],_0x9f7b1d,_0x754071[_0x7721('0x47')])),'headers':{'Authorization':_0x7721('0x19')+_0x4c76c3,'OData-Version':_0x7721('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x754071['ticketType']===_0x7721('0x48')){_0x57d09b={'method':_0x7721('0xb'),'uri':_0x481fa8+'phonecalls','body':Object[_0x7721('0x41')]({},{'subject':intUtil['getString'](_0x754071[_0x7721('0x43')],_0x9f7b1d,'\x20'),'phonenumber':String(_0x9f7b1d['calleridnum']),'description':intUtil[_0x7721('0x42')](_0x754071[_0x7721('0x44')],_0x9f7b1d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x7721('0x45')+_0x1453d4['enduserId']+')','ownerid@odata.bind':_0x7721('0x49')+_0x1453d4[_0x7721('0x26')]+')','directioncode':_0x1453d4['callDirection']===_0x7721('0x4a')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x7721('0x49')+_0x1453d4[_0x7721('0x26')]+')','participationtypemask':_0x1453d4['callDirection']===_0x7721('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1453d4[_0x7721('0x31')]+')','participationtypemask':_0x1453d4[_0x7721('0x4b')]===_0x7721('0x4a')?0x1:0x2}]},getCustomFields(_0x754071[_0x7721('0x46')],_0x9f7b1d,_0x754071[_0x7721('0x47')])),'headers':{'Authorization':_0x7721('0x19')+_0x4c76c3,'OData-Version':_0x7721('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x57d09b);})[_0x7721('0x11')](function(_0x694d2f){var _0x3386aa=_0x694d2f[_0x7721('0x4c')][_0x7721('0x2e')];var _0x24b17d=_0x3386aa[_0x7721('0x2f')](_0x3386aa[_0x7721('0x30')]('(')+0x1,_0x3386aa['lastIndexOf'](')'));_0x1453d4[_0x7721('0x4d')]=_0x24b17d;_0x2d5f35(_0x1453d4);})[_0x7721('0x13')](function(_0x8e1214){_0x135dbc(_0x8e1214[_0x7721('0x16')]);});});}function emit(_0x1f1ac7,_0x315127,_0x267f5e,_0x57484c){var _0x234bee={'uri':util[_0x7721('0x4e')](_0x7721('0x4f'),_0x1f1ac7,_0x267f5e,_0x57484c)};io['to'](util[_0x7721('0x4e')](_0x7721('0x50'),_0x315127))[_0x7721('0x51')](_0x7721('0x52'),_0x234bee);}exports['cs']=function(_0x33287d,_0x11b300,_0x3b968d,_0x8eca10,_0x52e870,_0x421c27,_0xadb365,_0x1234bc){var _0x2ee3c0={};_0x421c27[_0x7721('0xd')]=intUtil[_0x7721('0x53')](_0x421c27[_0x7721('0xd')]);_0x421c27[_0x7721('0x54')]=intUtil[_0x7721('0x53')](_0x421c27[_0x7721('0x54')]);_0x2ee3c0[_0x7721('0x4b')]=_0x1234bc===_0x7721('0x4a')||_0x1234bc===_0x7721('0x55')?_0x7721('0x4a'):_0x7721('0x2a');var _0x577f47=util['format']('%s/api/data/v9.0/',_0x421c27[_0x7721('0xd')]);var _0x4f2fe6=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x421c27['tenantId']);var _0x47925a=util[_0x7721('0x4e')](_0x7721('0x56'),_0x421c27['serverUrl'],_0x11b300[_0x7721('0x57')],md5(_0x11b300['uniqueid']));if(_0x52e870&&_0x52e870['monitor_format']){logger['info'](_0x7721('0x58'),'Recording\x20is\x20enabled!');_0x11b300['recordingURL']=_0x47925a;}else if(_0xadb365&&_0xadb365['recordingFormat']&&_0xadb365[_0x7721('0x59')]!==_0x7721('0x5a')){logger[_0x7721('0x27')]('[OUTBOUND]',_0x7721('0x5b'));_0x11b300[_0x7721('0x5c')]=_0x47925a;}else{_0x11b300[_0x7721('0x5c')]='';}return getUser(_0x2ee3c0,_0x421c27,_0x8eca10,_0x4f2fe6,_0x577f47,_0x1234bc)[_0x7721('0x11')](function(_0x6b7c1e){logger[_0x7721('0x27')]('['+_0x1234bc[_0x7721('0x23')]()+_0x7721('0x5d'),_0x6b7c1e[_0x7721('0x26')]);logger[_0x7721('0x27')]('['+_0x1234bc[_0x7721('0x23')]()+_0x7721('0x5e'),_0x6b7c1e[_0x7721('0x1f')]);return getEndUser(_0x6b7c1e,_0x421c27,_0x4f2fe6,_0x577f47,_0x11b300,_0x1234bc);})[_0x7721('0x11')](function(_0x44de7a){logger['info']('['+_0x1234bc[_0x7721('0x23')]()+_0x7721('0x5f'),_0x44de7a[_0x7721('0x31')]);logger[_0x7721('0x27')]('['+_0x1234bc['toUpperCase']()+_0x7721('0x60'),_0x11b300[_0x7721('0x2c')]);return getTicket(_0x44de7a,_0x421c27,_0x4f2fe6,_0x577f47,_0x11b300,_0x3b968d,_0x1234bc);})['then'](function(_0x3e7df3){logger['info'](util[_0x7721('0x4e')]('['+_0x1234bc[_0x7721('0x23')]()+_0x7721('0x61'),_0x3b968d[_0x7721('0x47')],_0x3e7df3[_0x7721('0x4d')]));logger[_0x7721('0x27')](util[_0x7721('0x4e')]('['+_0x1234bc[_0x7721('0x23')]()+_0x7721('0x62'),_0x1234bc));if(_0x1234bc!=='unmanaged'){logger[_0x7721('0x27')]('['+_0x1234bc[_0x7721('0x23')]()+']',_0x7721('0x63'));emit(_0x421c27[_0x7721('0xd')],_0x8eca10[_0x7721('0x64')],_0x3b968d[_0x7721('0x47')],_0x3e7df3[_0x7721('0x4d')]);}})['catch'](function(_0xb6f2f2){logger[_0x7721('0x14')]('['+_0x1234bc['toUpperCase']()+_0x7721('0x65'),util['inspect'](_0xb6f2f2,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 658ceb0..e3f9d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8e8=['type','nameField','customField','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','stripTrailingSlash','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','%s/helpdesk/tickets/%d','catch','unmanaged','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','info','%s/api/v2/agents','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','string','picklist'];(function(_0x59a78f,_0x170af3){var _0x88f1d5=function(_0x44f5e2){while(--_0x44f5e2){_0x59a78f['push'](_0x59a78f['shift']());}};_0x88f1d5(++_0x170af3);}(_0xa8e8,0x19b));var _0x8a8e=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xa8e8[_0x80f51a];return _0x327148;};'use strict';var _=require('lodash');var rp=require(_0x8a8e('0x0'));var md5=require(_0x8a8e('0x1'));var util=require(_0x8a8e('0x2'));var Redis=require(_0x8a8e('0x3'));var intUtil=require(_0x8a8e('0x4'));var config=require(_0x8a8e('0x5'));var logger=require(_0x8a8e('0x6'))('freshdesk');config[_0x8a8e('0x7')]=_[_0x8a8e('0x8')](config[_0x8a8e('0x7')],{'host':_0x8a8e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8a8e('0x7')]));var headers={'Content-Type':_0x8a8e('0xa'),'Accept':_0x8a8e('0xa')};function emit(_0x2ee266,_0x3c93c3,_0x33b0bd){io['to'](_0x2ee266)[_0x8a8e('0xb')](_0x3c93c3,_0x33b0bd);}function getTicket(_0x2b8a74,_0xbf4b93,_0x4068a7,_0x1e42c9,_0x442a17){logger['info'](_0x8a8e('0xc'));var _0x65e0fe=_[_0x8a8e('0xd')]({'responder_id':_0xbf4b93['id'],'requester_id':_0x4068a7['id'],'name':util[_0x8a8e('0xe')](_0x8a8e('0xf'),_0x442a17['calleridname']),'phone':_0x442a17['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x8a8e('0x10')](_0x1e42c9[_0x8a8e('0x11')],_0x442a17,'\x20'),'description':intUtil[_0x8a8e('0x10')](_0x1e42c9[_0x8a8e('0x12')],_0x442a17,'<br>'),'tags':getTags(_0x1e42c9[_0x8a8e('0x13')],_0x8a8e('0x14'))},getCustomFields(_0x1e42c9[_0x8a8e('0x15')],_0x442a17));_0x65e0fe[_0x8a8e('0x16')]=_['mapValues'](_[_0x8a8e('0x17')](_0x65e0fe[_0x8a8e('0x16')],'id'),'value');return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x18'),_0x2b8a74[_0x8a8e('0x19')]),'method':_0x8a8e('0x1a'),'body':_0x65e0fe})[_0x8a8e('0x1b')](function(_0x3f766b){logger[_0x8a8e('0x1c')]('Ticket\x20created!');return _0x3f766b;});}function getUser(_0x1a0f99,_0x4a2014){if(intUtil['validateEmail'](_0x4a2014)){return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x1d'),_0x1a0f99[_0x8a8e('0x19')]),'qs':{'email':_0x4a2014}})[_0x8a8e('0x1b')](function(_0x13ddf0){if(_0x13ddf0['length']){logger[_0x8a8e('0x1c')](_0x8a8e('0x1e'));return _[_0x8a8e('0x1f')](_0x13ddf0,function(_0x4315ca){return _0x4315ca[_0x8a8e('0x20')]['email']===_0x4a2014;});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x21'));return request({'uri':util['format'](_0x8a8e('0x22'),_0x1a0f99['remoteUri'])})[_0x8a8e('0x1b')](function(_0x44f000){logger[_0x8a8e('0x1c')](_0x8a8e('0x23'));return _0x44f000;});}});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x24'));return request({'uri':util['format'](_0x8a8e('0x22'),_0x1a0f99['remoteUri'])})[_0x8a8e('0x1b')](function(_0x41b36e){logger[_0x8a8e('0x1c')]('Admin\x20account\x20selected.');return _0x41b36e;});}}function getEndUser(_0x9da652,_0x31138a,_0x333c1a){logger[_0x8a8e('0x1c')](_0x8a8e('0x25'),_0x333c1a);return request({'uri':util['format'](_0x8a8e('0x26'),_0x9da652[_0x8a8e('0x19')]),'qs':{'phone':_0x333c1a}})[_0x8a8e('0x1b')](function(_0x55ff7b){if(_0x55ff7b['length']){logger[_0x8a8e('0x1c')](_0x8a8e('0x27'));return _['find'](_0x55ff7b,{'phone':_0x333c1a});}else{logger[_0x8a8e('0x1c')](_0x8a8e('0x28'));return request({'uri':util[_0x8a8e('0xe')](_0x8a8e('0x26'),_0x9da652['remoteUri']),'method':_0x8a8e('0x1a'),'body':{'name':_0x31138a,'phone':_0x333c1a}})[_0x8a8e('0x1b')](function(_0x1223a2){logger[_0x8a8e('0x1c')]('Enduser\x20created.');return _0x1223a2;});}});}function getAuth(_0x214849){return util[_0x8a8e('0xe')](_0x8a8e('0x29'),new Buffer(_0x214849[_0x8a8e('0x2a')]+':X')[_0x8a8e('0x2b')](_0x8a8e('0x2c')));}function request(_0x4afcb1){logger[_0x8a8e('0x2d')](_0x8a8e('0x2e'),JSON[_0x8a8e('0x2f')](_0x4afcb1));return rp(_['defaults'](_0x4afcb1,{'method':_0x8a8e('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x5002d6,_0x50bd57){var _0x5d658f=[];if(_0x5002d6&&_0x5002d6[_0x8a8e('0x31')]>0x0){_0x5d658f=_[_0x8a8e('0x32')](_0x5002d6,_0x50bd57);}return _0x5d658f;}function getCustomFields(_0x1fa730,_0x2bf4f8){var _0x41f5e3=[];var _0x28a40c={'custom_fields':[]};if(_0x1fa730['length']>0x0){_[_0x8a8e('0x33')](_0x1fa730,function(_0x242b1c){if(_['includes']([_0x8a8e('0x34'),_0x8a8e('0x35')],_0x242b1c[_0x8a8e('0x36')])&&_0x242b1c[_0x8a8e('0x37')]&&!_0x242b1c[_0x8a8e('0x38')]){_0x28a40c[_0x242b1c[_0x8a8e('0x37')]['toLowerCase']()]=_0x242b1c['content'][_0x8a8e('0x2b')]();}else if(_['includes']([_0x8a8e('0x34'),'picklist'],_0x242b1c['type'])&&_0x242b1c[_0x8a8e('0x39')]&&_0x242b1c['customField']){_0x28a40c[_0x8a8e('0x16')]['push']({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x242b1c['content']['toString']()});}else if(_0x242b1c['type']===_0x8a8e('0x3a')&&_0x242b1c[_0x8a8e('0x3b')]&&_0x242b1c[_0x8a8e('0x39')]&&_0x242b1c[_0x8a8e('0x38')]){_0x2bf4f8[_0x242b1c[_0x8a8e('0x3b')]]&&_0x28a40c[_0x8a8e('0x16')][_0x8a8e('0x3c')]({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x2bf4f8[_0x242b1c['variableName']]['toString']()});}else if(_0x242b1c['type']===_0x8a8e('0x3d')&&_0x242b1c[_0x8a8e('0x3e')]&&_0x242b1c['Variable'][_0x8a8e('0x14')]&&_0x242b1c['idField']&&_0x242b1c['customField']){_0x2bf4f8[_0x242b1c[_0x8a8e('0x3e')][_0x8a8e('0x14')]['toLowerCase']()]&&_0x28a40c[_0x8a8e('0x16')][_0x8a8e('0x3c')]({'id':_0x242b1c[_0x8a8e('0x39')],'value':_0x2bf4f8[_0x242b1c[_0x8a8e('0x3e')][_0x8a8e('0x14')][_0x8a8e('0x3f')]()]['toString']()});}});}return _0x28a40c;}exports[_0x8a8e('0x40')]=function(_0x1ccb2f,_0x40c3e8,_0x59b942,_0x48370c,_0x513ab6,_0x2da20c){var _0x412aeb,_0x37bb51;_0x2da20c[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x2da20c[_0x8a8e('0x19')]);_0x2da20c[_0x8a8e('0x41')]=intUtil['stripTrailingSlash'](_0x2da20c[_0x8a8e('0x41')]);if(_0x513ab6&&_0x513ab6['monitor_format']){logger[_0x8a8e('0x1c')]('[QUEUE]',_0x8a8e('0x42'));_0x40c3e8[_0x8a8e('0x43')]=util[_0x8a8e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2da20c['serverUrl'],_0x40c3e8[_0x8a8e('0x44')],md5(_0x40c3e8[_0x8a8e('0x44')]));}else{_0x40c3e8[_0x8a8e('0x43')]='';}headers[_0x8a8e('0x45')]=getAuth(_0x2da20c);return getUser(_0x2da20c,_0x48370c['email'])['then'](function(_0x1f92ed){_0x412aeb=_0x1f92ed;logger[_0x8a8e('0x1c')](_0x8a8e('0x46'),_0x412aeb['id']);return getEndUser(_0x2da20c,_0x40c3e8[_0x8a8e('0x47')],_0x40c3e8[_0x8a8e('0x48')]);})[_0x8a8e('0x1b')](function(_0x1828f9){_0x37bb51=_0x1828f9;logger[_0x8a8e('0x1c')](_0x8a8e('0x49'),_0x37bb51['id']);return getTicket(_0x2da20c,_0x412aeb,_0x37bb51,_0x59b942,_0x40c3e8);})[_0x8a8e('0x1b')](function(_0x5d759c){if(_0x5d759c&&_0x5d759c['id']){logger['info'](_0x8a8e('0x4a'));logger[_0x8a8e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x5d759c['id']);logger['info'](_0x8a8e('0x4b'),_0x8a8e('0x4c'));emit(util[_0x8a8e('0xe')](_0x8a8e('0x4d'),_0x48370c['name']),_0x8a8e('0x4e'),{'uri':util[_0x8a8e('0xe')]('%s/helpdesk/tickets/%d',_0x2da20c[_0x8a8e('0x19')],_0x5d759c['id'])});}})['catch'](function(_0x2b7198){logger[_0x8a8e('0x4f')](_0x8a8e('0x4b'),JSON[_0x8a8e('0x2f')](_0x2b7198));});};exports[_0x8a8e('0x50')]=function(_0xca0385,_0xc2b2a1,_0x3d470f,_0x585e50,_0x3e1167,_0x301636,_0xb2c9ed){var _0x28698d,_0x58b4d4;_0x301636[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x301636[_0x8a8e('0x19')]);_0x301636[_0x8a8e('0x41')]=intUtil[_0x8a8e('0x51')](_0x301636[_0x8a8e('0x41')]);if(_0xb2c9ed&&_0xb2c9ed['recordingFormat']&&_0xb2c9ed['recordingFormat']!==_0x8a8e('0x52')){logger[_0x8a8e('0x1c')](_0x8a8e('0x53'),'Recording\x20is\x20enabled!');_0xc2b2a1[_0x8a8e('0x43')]=util['format'](_0x8a8e('0x54'),_0x301636[_0x8a8e('0x41')],_0xc2b2a1[_0x8a8e('0x44')],md5(_0xc2b2a1['uniqueid']));}headers[_0x8a8e('0x45')]=getAuth(_0x301636);return getUser(_0x301636,_0x585e50[_0x8a8e('0x55')])['then'](function(_0x2cd604){_0x28698d=_0x2cd604;logger[_0x8a8e('0x1c')](_0x8a8e('0x46'),_0x28698d['id']);return getEndUser(_0x301636,_0xc2b2a1[_0x8a8e('0x56')],_0xc2b2a1['destcalleridnum']);})[_0x8a8e('0x1b')](function(_0x55e4ba){_0x58b4d4=_0x55e4ba;logger[_0x8a8e('0x1c')](_0x8a8e('0x49'),_0x58b4d4['id']);return getTicket(_0x301636,_0x28698d,_0x58b4d4,_0x3d470f,_0xc2b2a1);})[_0x8a8e('0x1b')](function(_0x23e66d){if(_0x23e66d&&_0x23e66d['id']){logger['info']('Ticket\x20created!');logger[_0x8a8e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x23e66d['id']);logger[_0x8a8e('0x1c')](_0x8a8e('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8a8e('0xe')](_0x8a8e('0x4d'),_0x585e50[_0x8a8e('0x14')]),_0x8a8e('0x4e'),{'uri':util[_0x8a8e('0xe')](_0x8a8e('0x57'),_0x301636['remoteUri'],_0x23e66d['id'])});}})[_0x8a8e('0x58')](function(_0x692b94){logger[_0x8a8e('0x4f')]('[OUTBOUND]',JSON[_0x8a8e('0x2f')](_0x692b94));});};exports[_0x8a8e('0x59')]=function(_0xa671b4,_0x2dbaac,_0x2d285f,_0x289d2f,_0x54cb70,_0x12a227){var _0x513fdb,_0x538e2d;_0x12a227[_0x8a8e('0x19')]=intUtil['stripTrailingSlash'](_0x12a227[_0x8a8e('0x19')]);_0x12a227[_0x8a8e('0x41')]=intUtil['stripTrailingSlash'](_0x12a227[_0x8a8e('0x41')]);if(_0x54cb70&&_0x54cb70['monitor_format']){logger['info']('['+_0x2dbaac[_0x8a8e('0x5a')]['toUpperCase']()+']',_0x8a8e('0x42'));_0x2dbaac[_0x8a8e('0x43')]=util[_0x8a8e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12a227[_0x8a8e('0x41')],_0x2dbaac[_0x8a8e('0x44')],md5(_0x2dbaac['uniqueid']));}else{_0x2dbaac[_0x8a8e('0x43')]='';}headers[_0x8a8e('0x45')]=getAuth(_0x12a227);return getUser(_0x12a227,'')[_0x8a8e('0x1b')](function(_0x476999){_0x513fdb=_0x476999;logger['info'](_0x8a8e('0x46'),_0x513fdb['id']);return getEndUser(_0x12a227,_0x2dbaac[_0x8a8e('0x47')],_0x2dbaac[_0x8a8e('0x48')]);})['then'](function(_0x51d7e9){_0x538e2d=_0x51d7e9;logger[_0x8a8e('0x1c')]('The\x20Enduser\x20ID\x20is:',_0x538e2d['id']);return getTicket(_0x12a227,_0x513fdb,_0x538e2d,_0x2d285f,_0x2dbaac);})[_0x8a8e('0x1b')](function(_0x1f7ea5){if(_0x1f7ea5){logger[_0x8a8e('0x1c')](_0x8a8e('0x4a'));logger[_0x8a8e('0x1c')](_0x8a8e('0x5b'),_0x1f7ea5['id']);}})[_0x8a8e('0x58')](function(_0x1b69c3){logger['error']('['+_0x2dbaac['lastevent'][_0x8a8e('0x5c')]()+']',JSON[_0x8a8e('0x2f')](_0x1b69c3));});};
\ No newline at end of file
+var _0x0e10=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','info','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','[QUEUE]','recordingFormat','email','destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','md5','util','ioredis'];(function(_0x385abe,_0x188112){var _0x36d6d7=function(_0x1064b8){while(--_0x1064b8){_0x385abe['push'](_0x385abe['shift']());}};_0x36d6d7(++_0x188112);}(_0x0e10,0x1db));var _0x00e1=function(_0xbdde05,_0x23a031){_0xbdde05=_0xbdde05-0x0;var _0x5e5e7b=_0x0e10[_0xbdde05];return _0x5e5e7b;};'use strict';var _=require(_0x00e1('0x0'));var rp=require(_0x00e1('0x1'));var md5=require(_0x00e1('0x2'));var util=require(_0x00e1('0x3'));var Redis=require(_0x00e1('0x4'));var intUtil=require(_0x00e1('0x5'));var config=require(_0x00e1('0x6'));var logger=require(_0x00e1('0x7'))(_0x00e1('0x8'));config[_0x00e1('0x9')]=_['defaults'](config[_0x00e1('0x9')],{'host':_0x00e1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x00e1('0x9')]));var headers={'Content-Type':_0x00e1('0xb'),'Accept':_0x00e1('0xb')};function emit(_0x3c6162,_0x5c9fa6,_0x3cd7ff){io['to'](_0x3c6162)[_0x00e1('0xc')](_0x5c9fa6,_0x3cd7ff);}function getTicket(_0x506fe4,_0xaefe9d,_0x2a5c5c,_0x25ae87,_0x19ef77){logger['info'](_0x00e1('0xd'));var _0x4b9737=_[_0x00e1('0xe')]({'responder_id':_0xaefe9d['id'],'requester_id':_0x2a5c5c['id'],'name':util['format'](_0x00e1('0xf'),_0x19ef77[_0x00e1('0x10')]),'phone':_0x19ef77[_0x00e1('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x00e1('0x12')](_0x25ae87[_0x00e1('0x13')],_0x19ef77,'\x20'),'description':intUtil['getString'](_0x25ae87[_0x00e1('0x14')],_0x19ef77,_0x00e1('0x15')),'tags':getTags(_0x25ae87[_0x00e1('0x16')],'name')},getCustomFields(_0x25ae87[_0x00e1('0x17')],_0x19ef77));_0x4b9737[_0x00e1('0x18')]=_[_0x00e1('0x19')](_[_0x00e1('0x1a')](_0x4b9737['custom_fields'],'id'),'value');return request({'uri':util[_0x00e1('0x1b')](_0x00e1('0x1c'),_0x506fe4[_0x00e1('0x1d')]),'method':_0x00e1('0x1e'),'body':_0x4b9737})[_0x00e1('0x1f')](function(_0xf783fe){logger['info'](_0x00e1('0x20'));return _0xf783fe;});}function getUser(_0x1fe89e,_0x779d38){if(intUtil[_0x00e1('0x21')](_0x779d38)){return request({'uri':util[_0x00e1('0x1b')]('%s/api/v2/agents',_0x1fe89e[_0x00e1('0x1d')]),'qs':{'email':_0x779d38}})['then'](function(_0x7978ee){if(_0x7978ee[_0x00e1('0x22')]){logger[_0x00e1('0x23')](_0x00e1('0x24'));return _[_0x00e1('0x25')](_0x7978ee,function(_0x9c0be7){return _0x9c0be7[_0x00e1('0x26')]['email']===_0x779d38;});}else{logger['info'](_0x00e1('0x27'));return request({'uri':util[_0x00e1('0x1b')](_0x00e1('0x28'),_0x1fe89e[_0x00e1('0x1d')])})[_0x00e1('0x1f')](function(_0x126b62){logger['info']('Admin\x20account\x20selected.');return _0x126b62;});}});}else{logger[_0x00e1('0x23')](_0x00e1('0x29'));return request({'uri':util['format'](_0x00e1('0x28'),_0x1fe89e[_0x00e1('0x1d')])})['then'](function(_0x1de69a){logger[_0x00e1('0x23')](_0x00e1('0x2a'));return _0x1de69a;});}}function getEndUser(_0x30921c,_0x5139a3,_0xd9d034){logger[_0x00e1('0x23')](_0x00e1('0x2b'),_0xd9d034);return request({'uri':util[_0x00e1('0x1b')](_0x00e1('0x2c'),_0x30921c[_0x00e1('0x1d')]),'qs':{'phone':_0xd9d034}})[_0x00e1('0x1f')](function(_0x213d8f){if(_0x213d8f[_0x00e1('0x22')]){logger['info']('Enduser\x20found!');return _[_0x00e1('0x25')](_0x213d8f,{'phone':_0xd9d034});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x00e1('0x1b')](_0x00e1('0x2c'),_0x30921c['remoteUri']),'method':_0x00e1('0x1e'),'body':{'name':_0x5139a3,'phone':_0xd9d034}})[_0x00e1('0x1f')](function(_0x3a0c7b){logger[_0x00e1('0x23')](_0x00e1('0x2d'));return _0x3a0c7b;});}});}function getAuth(_0x358213){return util['format']('Basic\x20%s',new Buffer(_0x358213[_0x00e1('0x2e')]+':X')[_0x00e1('0x2f')](_0x00e1('0x30')));}function request(_0x42747b){logger[_0x00e1('0x31')](_0x00e1('0x32'),JSON[_0x00e1('0x33')](_0x42747b));return rp(_['defaults'](_0x42747b,{'method':_0x00e1('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x388c9f,_0x22bddb){var _0x409b75=[];if(_0x388c9f&&_0x388c9f['length']>0x0){_0x409b75=_[_0x00e1('0x35')](_0x388c9f,_0x22bddb);}return _0x409b75;}function getCustomFields(_0x177862,_0x4e8210){var _0x267717=[];var _0xaf9f6={'custom_fields':[]};if(_0x177862[_0x00e1('0x22')]>0x0){_[_0x00e1('0x36')](_0x177862,function(_0x3a3769){if(_[_0x00e1('0x37')]([_0x00e1('0x38'),_0x00e1('0x39')],_0x3a3769[_0x00e1('0x3a')])&&_0x3a3769[_0x00e1('0x3b')]&&!_0x3a3769[_0x00e1('0x3c')]){_0xaf9f6[_0x3a3769[_0x00e1('0x3b')][_0x00e1('0x3d')]()]=_0x3a3769[_0x00e1('0x3e')]['toString']();}else if(_[_0x00e1('0x37')]([_0x00e1('0x38'),_0x00e1('0x39')],_0x3a3769[_0x00e1('0x3a')])&&_0x3a3769[_0x00e1('0x3f')]&&_0x3a3769[_0x00e1('0x3c')]){_0xaf9f6[_0x00e1('0x18')][_0x00e1('0x40')]({'id':_0x3a3769[_0x00e1('0x3f')],'value':_0x3a3769[_0x00e1('0x3e')][_0x00e1('0x2f')]()});}else if(_0x3a3769[_0x00e1('0x3a')]===_0x00e1('0x41')&&_0x3a3769[_0x00e1('0x42')]&&_0x3a3769['idField']&&_0x3a3769['customField']){_0x4e8210[_0x3a3769[_0x00e1('0x42')]]&&_0xaf9f6[_0x00e1('0x18')]['push']({'id':_0x3a3769['idField'],'value':_0x4e8210[_0x3a3769['variableName']][_0x00e1('0x2f')]()});}else if(_0x3a3769[_0x00e1('0x3a')]===_0x00e1('0x43')&&_0x3a3769[_0x00e1('0x44')]&&_0x3a3769['Variable'][_0x00e1('0x45')]&&_0x3a3769['idField']&&_0x3a3769['customField']){_0x4e8210[_0x3a3769[_0x00e1('0x44')][_0x00e1('0x45')][_0x00e1('0x3d')]()]&&_0xaf9f6[_0x00e1('0x18')][_0x00e1('0x40')]({'id':_0x3a3769[_0x00e1('0x3f')],'value':_0x4e8210[_0x3a3769['Variable'][_0x00e1('0x45')][_0x00e1('0x3d')]()][_0x00e1('0x2f')]()});}});}return _0xaf9f6;}exports[_0x00e1('0x46')]=function(_0x3eb32f,_0x3b71e4,_0x120e40,_0x394618,_0x581b92,_0x566bac){var _0x125b5f,_0x22140c;_0x566bac[_0x00e1('0x1d')]=intUtil[_0x00e1('0x47')](_0x566bac[_0x00e1('0x1d')]);_0x566bac[_0x00e1('0x48')]=intUtil[_0x00e1('0x47')](_0x566bac[_0x00e1('0x48')]);if(_0x581b92&&_0x581b92[_0x00e1('0x49')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x3b71e4[_0x00e1('0x4a')]=util[_0x00e1('0x1b')](_0x00e1('0x4b'),_0x566bac[_0x00e1('0x48')],_0x3b71e4[_0x00e1('0x4c')],md5(_0x3b71e4[_0x00e1('0x4c')]));}else{_0x3b71e4[_0x00e1('0x4a')]='';}headers['Authorization']=getAuth(_0x566bac);return getUser(_0x566bac,_0x394618['email'])['then'](function(_0x54cf99){_0x125b5f=_0x54cf99;logger['info'](_0x00e1('0x4d'),_0x125b5f['id']);return getEndUser(_0x566bac,_0x3b71e4[_0x00e1('0x10')],_0x3b71e4[_0x00e1('0x11')]);})[_0x00e1('0x1f')](function(_0x2e4b1a){_0x22140c=_0x2e4b1a;logger['info'](_0x00e1('0x4e'),_0x22140c['id']);return getTicket(_0x566bac,_0x125b5f,_0x22140c,_0x120e40,_0x3b71e4);})['then'](function(_0x211697){if(_0x211697&&_0x211697['id']){logger[_0x00e1('0x23')](_0x00e1('0x20'));logger[_0x00e1('0x23')](_0x00e1('0x4f'),_0x211697['id']);logger[_0x00e1('0x23')]('[QUEUE]',_0x00e1('0x50'));emit(util[_0x00e1('0x1b')](_0x00e1('0x51'),_0x394618['name']),_0x00e1('0x52'),{'uri':util['format'](_0x00e1('0x53'),_0x566bac['remoteUri'],_0x211697['id'])});}})[_0x00e1('0x54')](function(_0x3db88f){logger[_0x00e1('0x55')](_0x00e1('0x56'),JSON[_0x00e1('0x33')](_0x3db88f));});};exports['outbound']=function(_0x17c4b2,_0x3ab6ef,_0x57eb9,_0x2f746d,_0x586cac,_0x4d0da2,_0x446f27){var _0x26f60e,_0x5e2141;_0x4d0da2['remoteUri']=intUtil[_0x00e1('0x47')](_0x4d0da2[_0x00e1('0x1d')]);_0x4d0da2[_0x00e1('0x48')]=intUtil[_0x00e1('0x47')](_0x4d0da2[_0x00e1('0x48')]);if(_0x446f27&&_0x446f27[_0x00e1('0x57')]&&_0x446f27['recordingFormat']!=='none'){logger[_0x00e1('0x23')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3ab6ef[_0x00e1('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d0da2[_0x00e1('0x48')],_0x3ab6ef[_0x00e1('0x4c')],md5(_0x3ab6ef[_0x00e1('0x4c')]));}headers['Authorization']=getAuth(_0x4d0da2);return getUser(_0x4d0da2,_0x2f746d[_0x00e1('0x58')])[_0x00e1('0x1f')](function(_0x5b2152){_0x26f60e=_0x5b2152;logger[_0x00e1('0x23')](_0x00e1('0x4d'),_0x26f60e['id']);return getEndUser(_0x4d0da2,_0x3ab6ef[_0x00e1('0x59')],_0x3ab6ef[_0x00e1('0x5a')]);})['then'](function(_0x3385e7){_0x5e2141=_0x3385e7;logger[_0x00e1('0x23')](_0x00e1('0x4e'),_0x5e2141['id']);return getTicket(_0x4d0da2,_0x26f60e,_0x5e2141,_0x57eb9,_0x3ab6ef);})['then'](function(_0x413f52){if(_0x413f52&&_0x413f52['id']){logger[_0x00e1('0x23')](_0x00e1('0x20'));logger['info'](_0x00e1('0x4f'),_0x413f52['id']);logger[_0x00e1('0x23')](_0x00e1('0x5b'),_0x00e1('0x50'));emit(util['format'](_0x00e1('0x51'),_0x2f746d[_0x00e1('0x45')]),_0x00e1('0x52'),{'uri':util[_0x00e1('0x1b')](_0x00e1('0x53'),_0x4d0da2['remoteUri'],_0x413f52['id'])});}})[_0x00e1('0x54')](function(_0x105ce3){logger[_0x00e1('0x55')](_0x00e1('0x5b'),JSON[_0x00e1('0x33')](_0x105ce3));});};exports[_0x00e1('0x5c')]=function(_0x1ede31,_0x7a1a92,_0x50c9a9,_0x5df04c,_0x31de87,_0x2f1e5f){var _0x4dcd1b,_0x167b81;_0x2f1e5f['remoteUri']=intUtil[_0x00e1('0x47')](_0x2f1e5f[_0x00e1('0x1d')]);_0x2f1e5f['serverUrl']=intUtil['stripTrailingSlash'](_0x2f1e5f['serverUrl']);if(_0x31de87&&_0x31de87['monitor_format']){logger[_0x00e1('0x23')]('['+_0x7a1a92[_0x00e1('0x5d')][_0x00e1('0x5e')]()+']',_0x00e1('0x5f'));_0x7a1a92[_0x00e1('0x4a')]=util[_0x00e1('0x1b')](_0x00e1('0x4b'),_0x2f1e5f[_0x00e1('0x48')],_0x7a1a92['uniqueid'],md5(_0x7a1a92[_0x00e1('0x4c')]));}else{_0x7a1a92[_0x00e1('0x4a')]='';}headers['Authorization']=getAuth(_0x2f1e5f);return getUser(_0x2f1e5f,'')['then'](function(_0x56b9d1){_0x4dcd1b=_0x56b9d1;logger[_0x00e1('0x23')](_0x00e1('0x4d'),_0x4dcd1b['id']);return getEndUser(_0x2f1e5f,_0x7a1a92[_0x00e1('0x10')],_0x7a1a92[_0x00e1('0x11')]);})[_0x00e1('0x1f')](function(_0x27106a){_0x167b81=_0x27106a;logger[_0x00e1('0x23')]('The\x20Enduser\x20ID\x20is:',_0x167b81['id']);return getTicket(_0x2f1e5f,_0x4dcd1b,_0x167b81,_0x50c9a9,_0x7a1a92);})[_0x00e1('0x1f')](function(_0x6f00b5){if(_0x6f00b5){logger[_0x00e1('0x23')](_0x00e1('0x20'));logger[_0x00e1('0x23')](_0x00e1('0x4f'),_0x6f00b5['id']);}})[_0x00e1('0x54')](function(_0x145cf2){logger[_0x00e1('0x55')]('['+_0x7a1a92[_0x00e1('0x5d')][_0x00e1('0x5e')]()+']',JSON[_0x00e1('0x33')](_0x145cf2));});};
\ No newline at end of file
index f20ebc2..6df8614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa941=['adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','info','Getting\x20admin\x20information','users','email','adminEmail'];(function(_0x42ae5a,_0xb0e4a4){var _0x20900c=function(_0x3d249b){while(--_0x3d249b){_0x42ae5a['push'](_0x42ae5a['shift']());}};_0x20900c(++_0xb0e4a4);}(_0xa941,0x18e));var _0x1a94=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa941[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var rp=require(_0x1a94('0x0'));var md5=require(_0x1a94('0x1'));var util=require(_0x1a94('0x2'));var moment=require(_0x1a94('0x3'));var Promise=require(_0x1a94('0x4'));var Redis=require(_0x1a94('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1a94('0x6'))(_0x1a94('0x7'));config[_0x1a94('0x8')]=_[_0x1a94('0x9')](config[_0x1a94('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1a94('0x8')]));function getAdminId(_0x89eba7,_0x4f5585,_0x184c7c,_0x13aea3){return new Promise(function(_0x4ea048,_0x31a5c9){var _0x1ad1fd=![];var _0x17d360={'method':_0x1a94('0xa'),'uri':_0x13aea3+_0x1a94('0xb'),'json':!![]};_0x17d360['headers']=_0x184c7c;logger[_0x1a94('0xc')](_0x1a94('0xd'));return rp(_0x17d360)['then'](function(_0x3e1844){if(_0x3e1844){var _0x3a7ebe=_0x3e1844[_0x1a94('0xe')];var _0xe8e0de=null;for(_0xe8e0de=0x0;_0xe8e0de<_0x3a7ebe['length'];_0xe8e0de++){if(_0x3a7ebe[_0xe8e0de][_0x1a94('0xf')]===_0x89eba7[_0x1a94('0x10')]){_0x89eba7[_0x1a94('0x11')]=_0x3a7ebe[_0xe8e0de]['id'];_0x1ad1fd=!![];}}if(_0x1ad1fd){logger[_0x1a94('0xc')](_0x1a94('0x12'),_0x89eba7[_0x1a94('0x11')]);_0x4ea048(_0x89eba7);}else{_0x31a5c9({'statusCode':0x194,'message':_0x1a94('0x13')});}}else{_0x31a5c9({'statusCode':0x194,'message':_0x1a94('0x13')});}})['catch'](function(_0x39a2f2){logger[_0x1a94('0x14')]('['+[_0x4f5585[_0x1a94('0x15')]()]+']',_0x39a2f2[_0x1a94('0x16')]);_0x31a5c9(_0x39a2f2);});});}function getUser(_0x486151,_0x298593,_0x23b140){return function(_0x2a80be){return new Promise(function(_0x354214,_0x3276f8){var _0x3f20c8={'method':_0x1a94('0xa'),'uri':_0x23b140+_0x1a94('0xb'),'json':!![]};_0x3f20c8[_0x1a94('0x17')]=_0x298593;logger['info'](_0x1a94('0x18'));return rp(_0x3f20c8)[_0x1a94('0x19')](function(_0x1afc09){if(_0x1afc09){var _0x1dfd4a=_0x1afc09['users'];var _0x1e6434=![];var _0x1505e0=null;if(_0x2a80be[_0x1a94('0x1a')]!==null){logger[_0x1a94('0xc')](_0x1a94('0x1b'),_0x2a80be[_0x1a94('0x1a')]);_0x2a80be[_0x1a94('0x1c')]=_0x2a80be['agentEmail'];for(_0x1505e0=0x0;_0x1505e0<_0x1dfd4a[_0x1a94('0x1d')];_0x1505e0++){if(_0x1dfd4a[_0x1505e0][_0x1a94('0xf')]===_0x2a80be[_0x1a94('0x1a')]){_0x1e6434=!![];_0x2a80be[_0x1a94('0x1e')]=_0x1dfd4a[_0x1505e0]['id'];logger[_0x1a94('0xc')](_0x1a94('0x1f'),_0x2a80be[_0x1a94('0x1e')]);}}}if(!_0x1e6434){logger[_0x1a94('0xc')](_0x1a94('0x20'));_0x2a80be[_0x1a94('0x1c')]=_0x2a80be[_0x1a94('0x10')];_0x2a80be[_0x1a94('0x1e')]=_0x2a80be['adminId'];_0x1e6434=!![];}if(_0x1e6434){_0x354214(_0x2a80be);}else{_0x3276f8({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x3276f8({'statusCode':0x194,'message':_0x1a94('0x13')});}})['catch'](function(_0x45815d){logger['error']('['+[_0x486151['toUpperCase']()]+']',_0x45815d[_0x1a94('0x16')]);_0x3276f8(_0x45815d);});});};}function searchContact(_0x1c36e3,_0x4753f6,_0x25e617,_0x5ceb3a){return new Promise(function(_0x144ff5,_0x1c7b25){var _0x2aba36={'method':_0x1a94('0xa'),'headers':_0x4753f6,'uri':_0x1c36e3+_0x1a94('0x21')+_0x5ceb3a+_0x1a94('0x22')+_0x25e617+_0x1a94('0x23'),'json':!![]};rp(_0x2aba36)[_0x1a94('0x19')](function(_0x12abaf){var _0x2d56de=_[_0x1a94('0x24')](_0x12abaf[_0x1a94('0x25')][_0x1a94('0x25')],[_0x25e617,_0x5ceb3a]);_0x144ff5(_0x2d56de);})[_0x1a94('0x26')](function(_0x122eaf){_0x1c7b25(_0x122eaf);});});}function getEndUser(_0x4b8b67,_0x868804,_0x17d277){return function(_0x387762){return new Promise(function(_0x592bfa,_0x396bea){logger[_0x1a94('0xc')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x387762[_0x1a94('0x27')]));searchContact(_0x17d277,_0x868804,_0x1a94('0x28'),_0x387762[_0x1a94('0x27')])[_0x1a94('0x19')](function(_0x3f6403){if(_0x3f6403){_0x387762[_0x1a94('0x29')]=_0x3f6403['id'];logger['info'](_0x1a94('0x2a'),_0x387762[_0x1a94('0x29')]);return _0x592bfa(_0x387762);}searchContact(_0x17d277,_0x868804,_0x1a94('0x2b'),_0x387762[_0x1a94('0x27')])['then'](function(_0x2f45d7){if(_0x2f45d7){_0x387762['endUserId']=_0x2f45d7['id'];logger['info'](_0x1a94('0x2c'),_0x387762[_0x1a94('0x29')]);return _0x592bfa(_0x387762);}createEndUser(_0x387762,_0x4b8b67,_0x868804,_0x17d277)[_0x1a94('0x19')](function(_0x428a9a){logger[_0x1a94('0xc')](_0x1a94('0x2d'),_0x428a9a[_0x1a94('0x29')]);return _0x592bfa(_0x428a9a);});});})[_0x1a94('0x26')](function(_0x487402){_0x396bea(_0x487402);});});};}function createEndUser(_0x12a6d9,_0x33a644,_0x24a0ee,_0xf28928){return new Promise(function(_0x3e134e,_0x35e687){var _0x159554=moment();var _0xef757={'method':'POST','uri':_0xf28928+_0x1a94('0x2e'),'body':{'contact':{'last_name':_0x12a6d9['contactNumber'],'work_number':_0x12a6d9['contactNumber'],'mobile_number':_0x12a6d9[_0x1a94('0x27')],'owner_id':_0x12a6d9['userId'],'created_at':_0x159554[_0x1a94('0x2f')](_0x1a94('0x30'))}},'json':!![]};_0xef757[_0x1a94('0x17')]=_0x24a0ee;logger['info'](_0x1a94('0x31'));return rp(_0xef757)[_0x1a94('0x19')](function(_0xda8a0c){_0x12a6d9[_0x1a94('0x29')]=_0xda8a0c[_0x1a94('0x32')]['id'];_0x3e134e(_0x12a6d9);})[_0x1a94('0x26')](function(_0x19ff23){logger[_0x1a94('0x14')]('['+[_0x33a644[_0x1a94('0x15')]()]+']',_0x19ff23[_0x1a94('0x16')]);_0x35e687(_0x19ff23['message']);});});}function getTicket(_0x444a3c,_0x44ffdd,_0x2618d9,_0xd7ede3,_0x26f1e9){return function(_0x524ecd){logger[_0x1a94('0xc')](_0x1a94('0x33'));return new Promise(function(_0x4ddc8c,_0x306753){var _0x2a14ab=moment();var _0x2ba4b5={'method':_0x1a94('0x34'),'uri':_0x2618d9+_0x1a94('0x35'),'body':{'title':intUtil[_0x1a94('0x36')](_0xd7ede3[_0x1a94('0x37')],_0x26f1e9,'\x20'),'description':intUtil['getString'](_0xd7ede3['Descriptions'],_0x26f1e9,'\x0a'),'owner_id':_0x524ecd['userId'],'creater_id':_0x524ecd[_0x1a94('0x11')],'targetable_id':_0x524ecd[_0x1a94('0x29')],'targetable_type':_0x1a94('0x38'),'created_at':_0x2a14ab[_0x1a94('0x2f')](_0x1a94('0x30')),'due_date':_0x2a14ab[_0x1a94('0x39')](0x1e,'m')[_0x1a94('0x2f')](_0x1a94('0x30'))},'json':!![]};_0x2ba4b5[_0x1a94('0x17')]=_0x44ffdd;return rp(_0x2ba4b5)[_0x1a94('0x19')](function(_0x474943){_0x524ecd[_0x1a94('0x3a')]=_0x474943['task']['id'];logger[_0x1a94('0xc')](_0x1a94('0x3b'),_0x524ecd[_0x1a94('0x3a')]);_0x4ddc8c(_0x524ecd);})[_0x1a94('0x26')](function(_0x58f27c){logger['error']('['+[_0x444a3c[_0x1a94('0x15')]()]+']',_0x58f27c[_0x1a94('0x16')]);_0x306753(_0x58f27c[_0x1a94('0x16')]);});});};}function emit(_0x57305c,_0x3fc039,_0x27ff8e){var _0x2bcce7={'uri':_0x57305c+_0x1a94('0x3c')+_0x27ff8e};io['to'](util[_0x1a94('0x2f')](_0x1a94('0x3d'),_0x3fc039))[_0x1a94('0x3e')](_0x1a94('0x3f'),_0x2bcce7);}exports['cs']=function(_0x730141,_0x4bdba7,_0x58c743,_0x10fb3c,_0x4b0e23,_0x1b6809,_0x54bdce,_0x5af64f){var _0x5a91dd={};var _0x8f5506={'Authorization':'Token\x20token='+_0x1b6809['apiKey']};_0x1b6809[_0x1a94('0x40')]=intUtil[_0x1a94('0x41')](_0x1b6809['remoteUri']);_0x1b6809[_0x1a94('0x42')]=intUtil[_0x1a94('0x41')](_0x1b6809[_0x1a94('0x42')]);var _0x184cf6=_0x1b6809[_0x1a94('0x40')];_0x5a91dd[_0x1a94('0x10')]=_0x1b6809['username'];_0x5a91dd[_0x1a94('0x27')]=_0x5af64f[_0x1a94('0x43')]()==='outbound'?_0x4bdba7[_0x1a94('0x44')]:_0x4bdba7['calleridnum'];_0x5a91dd[_0x1a94('0x45')]=_0x5af64f===_0x1a94('0x46')||_0x5af64f===_0x1a94('0x47')?_0x1a94('0x46'):'outbound';if(_0x10fb3c){_0x5a91dd[_0x1a94('0x1a')]=_0x10fb3c[_0x1a94('0xf')];}var _0x3750ed=util[_0x1a94('0x2f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b6809[_0x1a94('0x42')],_0x4bdba7[_0x1a94('0x48')],md5(_0x4bdba7[_0x1a94('0x48')]));if(_0x4b0e23&&_0x4b0e23[_0x1a94('0x49')]){logger[_0x1a94('0xc')](_0x1a94('0x4a'),_0x1a94('0x4b'));_0x4bdba7['recordingURL']=_0x3750ed;}else if(_0x54bdce&&_0x54bdce[_0x1a94('0x4c')]&&_0x54bdce['recordingFormat']!==_0x1a94('0x4d')){logger['info'](_0x1a94('0x4e'),_0x1a94('0x4b'));_0x4bdba7[_0x1a94('0x4f')]=_0x3750ed;}else{_0x4bdba7[_0x1a94('0x4f')]='';}return getAdminId(_0x5a91dd,_0x5af64f,_0x8f5506,_0x184cf6)[_0x1a94('0x19')](getUser(_0x5af64f,_0x8f5506,_0x184cf6))['then'](getEndUser(_0x5af64f,_0x8f5506,_0x184cf6))[_0x1a94('0x19')](getTicket(_0x5af64f,_0x8f5506,_0x184cf6,_0x58c743,_0x4bdba7))['then'](function(_0x5950c9){logger[_0x1a94('0xc')](util[_0x1a94('0x2f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5950c9[_0x1a94('0x3a')]));if(_0x5af64f!=='unmanaged'){logger[_0x1a94('0xc')]('['+[_0x5af64f['toUpperCase']()]+']',_0x1a94('0x50'));emit(_0x184cf6,_0x10fb3c[_0x1a94('0x51')],_0x5950c9['endUserId']);}})['catch'](function(_0x11c75e){logger[_0x1a94('0x14')]('['+[_0x5af64f[_0x1a94('0x15')]()]+_0x1a94('0x52'),util['inspect'](_0x11c75e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6a50=['userEmail','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','outbound','callDirection','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','then','users','length','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x6a50,0x1c9));var _0x06a5=function(_0x5485a0,_0x166249){_0x5485a0=_0x5485a0-0x0;var _0x1dbb76=_0x6a50[_0x5485a0];return _0x1dbb76;};'use strict';var _=require(_0x06a5('0x0'));var rp=require('request-promise');var md5=require(_0x06a5('0x1'));var util=require('util');var moment=require('moment');var Promise=require(_0x06a5('0x2'));var Redis=require(_0x06a5('0x3'));var intUtil=require('./util');var config=require(_0x06a5('0x4'));var logger=require('../../../../config/logger')(_0x06a5('0x5'));config[_0x06a5('0x6')]=_[_0x06a5('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x06a5('0x8'))(new Redis(config['redis']));function getAdminId(_0x1fad9b,_0x24e0cc,_0x20182c,_0x587e15){return new Promise(function(_0x2e764f,_0x51a804){var _0x101053=![];var _0x4373c2={'method':_0x06a5('0x9'),'uri':_0x587e15+_0x06a5('0xa'),'json':!![]};_0x4373c2[_0x06a5('0xb')]=_0x20182c;logger['info']('Getting\x20admin\x20information');return rp(_0x4373c2)[_0x06a5('0xc')](function(_0x4a729d){if(_0x4a729d){var _0x56521c=_0x4a729d[_0x06a5('0xd')];var _0x22b7d8=null;for(_0x22b7d8=0x0;_0x22b7d8<_0x56521c[_0x06a5('0xe')];_0x22b7d8++){if(_0x56521c[_0x22b7d8]['email']===_0x1fad9b[_0x06a5('0xf')]){_0x1fad9b['adminId']=_0x56521c[_0x22b7d8]['id'];_0x101053=!![];}}if(_0x101053){logger['info'](_0x06a5('0x10'),_0x1fad9b[_0x06a5('0x11')]);_0x2e764f(_0x1fad9b);}else{_0x51a804({'statusCode':0x194,'message':_0x06a5('0x12')});}}else{_0x51a804({'statusCode':0x194,'message':_0x06a5('0x12')});}})[_0x06a5('0x13')](function(_0x2dc2b2){logger[_0x06a5('0x14')]('['+[_0x24e0cc[_0x06a5('0x15')]()]+']',_0x2dc2b2[_0x06a5('0x16')]);_0x51a804(_0x2dc2b2);});});}function getUser(_0x18362a,_0x4263e5,_0x13eac1){return function(_0x18e315){return new Promise(function(_0x39aa3a,_0xa61ae){var _0x523470={'method':_0x06a5('0x9'),'uri':_0x13eac1+_0x06a5('0xa'),'json':!![]};_0x523470[_0x06a5('0xb')]=_0x4263e5;logger[_0x06a5('0x17')](_0x06a5('0x18'));return rp(_0x523470)[_0x06a5('0xc')](function(_0x4d271a){if(_0x4d271a){var _0x54baa8=_0x4d271a[_0x06a5('0xd')];var _0x2bbc64=![];var _0x4355a4=null;if(_0x18e315[_0x06a5('0x19')]!==null){logger[_0x06a5('0x17')](_0x06a5('0x1a'),_0x18e315[_0x06a5('0x19')]);_0x18e315['userEmail']=_0x18e315[_0x06a5('0x19')];for(_0x4355a4=0x0;_0x4355a4<_0x54baa8[_0x06a5('0xe')];_0x4355a4++){if(_0x54baa8[_0x4355a4]['email']===_0x18e315[_0x06a5('0x19')]){_0x2bbc64=!![];_0x18e315[_0x06a5('0x1b')]=_0x54baa8[_0x4355a4]['id'];logger[_0x06a5('0x17')]('User\x20found:',_0x18e315[_0x06a5('0x1b')]);}}}if(!_0x2bbc64){logger['info'](_0x06a5('0x1c'));_0x18e315[_0x06a5('0x1d')]=_0x18e315[_0x06a5('0xf')];_0x18e315[_0x06a5('0x1b')]=_0x18e315[_0x06a5('0x11')];_0x2bbc64=!![];}if(_0x2bbc64){_0x39aa3a(_0x18e315);}else{_0xa61ae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xa61ae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x16de1e){logger[_0x06a5('0x14')]('['+[_0x18362a[_0x06a5('0x15')]()]+']',_0x16de1e[_0x06a5('0x16')]);_0xa61ae(_0x16de1e);});});};}function searchContact(_0x440802,_0x5078b0,_0x527c0e,_0x58b51f){return new Promise(function(_0x28149b,_0x3174d4){var _0x4b9c7a={'method':'GET','headers':_0x5078b0,'uri':_0x440802+_0x06a5('0x1e')+_0x58b51f+_0x06a5('0x1f')+_0x527c0e+_0x06a5('0x20'),'json':!![]};rp(_0x4b9c7a)[_0x06a5('0xc')](function(_0xc45718){var _0x316559=_[_0x06a5('0x21')](_0xc45718[_0x06a5('0x22')][_0x06a5('0x22')],[_0x527c0e,_0x58b51f]);_0x28149b(_0x316559);})[_0x06a5('0x13')](function(_0x5f4da2){_0x3174d4(_0x5f4da2);});});}function getEndUser(_0x206bcf,_0x42191e,_0x395c11){return function(_0x17a43c){return new Promise(function(_0x32cf66,_0x43408d){logger[_0x06a5('0x17')](util[_0x06a5('0x23')](_0x06a5('0x24'),_0x17a43c[_0x06a5('0x25')]));searchContact(_0x395c11,_0x42191e,_0x06a5('0x26'),_0x17a43c['contactNumber'])[_0x06a5('0xc')](function(_0x5abcd5){if(_0x5abcd5){_0x17a43c['endUserId']=_0x5abcd5['id'];logger[_0x06a5('0x17')](_0x06a5('0x27'),_0x17a43c[_0x06a5('0x28')]);return _0x32cf66(_0x17a43c);}searchContact(_0x395c11,_0x42191e,'work_number',_0x17a43c[_0x06a5('0x25')])[_0x06a5('0xc')](function(_0x4965d4){if(_0x4965d4){_0x17a43c['endUserId']=_0x4965d4['id'];logger[_0x06a5('0x17')](_0x06a5('0x29'),_0x17a43c[_0x06a5('0x28')]);return _0x32cf66(_0x17a43c);}createEndUser(_0x17a43c,_0x206bcf,_0x42191e,_0x395c11)[_0x06a5('0xc')](function(_0x5be039){logger[_0x06a5('0x17')]('Contact\x20created:',_0x5be039[_0x06a5('0x28')]);return _0x32cf66(_0x5be039);});});})[_0x06a5('0x13')](function(_0x4d314e){_0x43408d(_0x4d314e);});});};}function createEndUser(_0x47f5b9,_0x2862f3,_0x396eb5,_0x430031){return new Promise(function(_0x2b08f8,_0x4981a6){var _0x4d106a=moment();var _0x58ed90={'method':_0x06a5('0x2a'),'uri':_0x430031+_0x06a5('0x2b'),'body':{'contact':{'last_name':_0x47f5b9[_0x06a5('0x25')],'work_number':_0x47f5b9[_0x06a5('0x25')],'mobile_number':_0x47f5b9[_0x06a5('0x25')],'owner_id':_0x47f5b9[_0x06a5('0x1b')],'created_at':_0x4d106a[_0x06a5('0x23')](_0x06a5('0x2c'))}},'json':!![]};_0x58ed90['headers']=_0x396eb5;logger['info'](_0x06a5('0x2d'));return rp(_0x58ed90)['then'](function(_0x1bfb9f){_0x47f5b9['endUserId']=_0x1bfb9f[_0x06a5('0x2e')]['id'];_0x2b08f8(_0x47f5b9);})['catch'](function(_0x3e2fc5){logger['error']('['+[_0x2862f3[_0x06a5('0x15')]()]+']',_0x3e2fc5[_0x06a5('0x16')]);_0x4981a6(_0x3e2fc5[_0x06a5('0x16')]);});});}function getTicket(_0x1e3aec,_0x4d247e,_0x53ad5f,_0x23c1ab,_0x50a0aa){return function(_0x5bd1fe){logger['info'](_0x06a5('0x2f'));return new Promise(function(_0x35a1e0,_0x35ff19){var _0x2859ae=moment();var _0x18480d={'method':'POST','uri':_0x53ad5f+_0x06a5('0x30'),'body':{'title':intUtil[_0x06a5('0x31')](_0x23c1ab[_0x06a5('0x32')],_0x50a0aa,'\x20'),'description':intUtil[_0x06a5('0x31')](_0x23c1ab['Descriptions'],_0x50a0aa,'\x0a'),'owner_id':_0x5bd1fe['userId'],'creater_id':_0x5bd1fe[_0x06a5('0x11')],'targetable_id':_0x5bd1fe[_0x06a5('0x28')],'targetable_type':_0x06a5('0x33'),'created_at':_0x2859ae['format'](_0x06a5('0x2c')),'due_date':_0x2859ae[_0x06a5('0x34')](0x1e,'m')[_0x06a5('0x23')](_0x06a5('0x2c'))},'json':!![]};_0x18480d['headers']=_0x4d247e;return rp(_0x18480d)[_0x06a5('0xc')](function(_0xb5c56c){_0x5bd1fe[_0x06a5('0x35')]=_0xb5c56c[_0x06a5('0x36')]['id'];logger[_0x06a5('0x17')]('Task\x20created:',_0x5bd1fe['ticketId']);_0x35a1e0(_0x5bd1fe);})[_0x06a5('0x13')](function(_0x4fd9dc){logger[_0x06a5('0x14')]('['+[_0x1e3aec['toUpperCase']()]+']',_0x4fd9dc['message']);_0x35ff19(_0x4fd9dc['message']);});});};}function emit(_0x322aed,_0xfd8eaf,_0x2c50d0){var _0x2a0d7f={'uri':_0x322aed+_0x06a5('0x37')+_0x2c50d0};io['to'](util[_0x06a5('0x23')]('user:%s',_0xfd8eaf))[_0x06a5('0x38')](_0x06a5('0x39'),_0x2a0d7f);}exports['cs']=function(_0x524735,_0x10af0e,_0x3edcd9,_0xc2d335,_0x5389d1,_0x4dec3a,_0x1311d7,_0x2b09a3){var _0x19d261={};var _0x594b32={'Authorization':_0x06a5('0x3a')+_0x4dec3a[_0x06a5('0x3b')]};_0x4dec3a['remoteUri']=intUtil['stripTrailingSlash'](_0x4dec3a[_0x06a5('0x3c')]);_0x4dec3a[_0x06a5('0x3d')]=intUtil[_0x06a5('0x3e')](_0x4dec3a[_0x06a5('0x3d')]);var _0x18794f=_0x4dec3a[_0x06a5('0x3c')];_0x19d261['adminEmail']=_0x4dec3a[_0x06a5('0x3f')];_0x19d261[_0x06a5('0x25')]=_0x2b09a3['toLowerCase']()===_0x06a5('0x40')?_0x10af0e['destcalleridnum']:_0x10af0e['calleridnum'];_0x19d261[_0x06a5('0x41')]=_0x2b09a3===_0x06a5('0x42')||_0x2b09a3==='unmanaged'?_0x06a5('0x42'):'outbound';if(_0xc2d335){_0x19d261['agentEmail']=_0xc2d335[_0x06a5('0x43')];}var _0x58793a=util[_0x06a5('0x23')](_0x06a5('0x44'),_0x4dec3a['serverUrl'],_0x10af0e[_0x06a5('0x45')],md5(_0x10af0e[_0x06a5('0x45')]));if(_0x5389d1&&_0x5389d1[_0x06a5('0x46')]){logger[_0x06a5('0x17')](_0x06a5('0x47'),_0x06a5('0x48'));_0x10af0e['recordingURL']=_0x58793a;}else if(_0x1311d7&&_0x1311d7[_0x06a5('0x49')]&&_0x1311d7[_0x06a5('0x49')]!=='none'){logger[_0x06a5('0x17')](_0x06a5('0x4a'),_0x06a5('0x48'));_0x10af0e[_0x06a5('0x4b')]=_0x58793a;}else{_0x10af0e[_0x06a5('0x4b')]='';}return getAdminId(_0x19d261,_0x2b09a3,_0x594b32,_0x18794f)['then'](getUser(_0x2b09a3,_0x594b32,_0x18794f))[_0x06a5('0xc')](getEndUser(_0x2b09a3,_0x594b32,_0x18794f))[_0x06a5('0xc')](getTicket(_0x2b09a3,_0x594b32,_0x18794f,_0x3edcd9,_0x10af0e))[_0x06a5('0xc')](function(_0x2ac2bb){logger[_0x06a5('0x17')](util[_0x06a5('0x23')](_0x06a5('0x4c'),_0x2ac2bb[_0x06a5('0x35')]));if(_0x2b09a3!==_0x06a5('0x4d')){logger[_0x06a5('0x17')]('['+[_0x2b09a3['toUpperCase']()]+']',_0x06a5('0x4e'));emit(_0x18794f,_0xc2d335[_0x06a5('0x4f')],_0x2ac2bb[_0x06a5('0x28')]);}})[_0x06a5('0x13')](function(_0x1e7f76){logger[_0x06a5('0x14')]('['+[_0x2b09a3[_0x06a5('0x15')]()]+_0x06a5('0x50'),util['inspect'](_0x1e7f76,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index c60a62f..bff02c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b8=['vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','zendesk','freshdesk','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','desk'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x76b8,0x127));var _0x876b=function(_0x245ff8,_0x2e81f8){_0x245ff8=_0x245ff8-0x0;var _0x5a4faa=_0x76b8[_0x245ff8];return _0x5a4faa;};'use strict';var _=require('lodash');var util=require(_0x876b('0x0'));var zendesk=require(_0x876b('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x876b('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x876b('0x3'));var desk=require(_0x876b('0x4'));var vtiger=require(_0x876b('0x5'));var servicenow=require(_0x876b('0x6'));var dynamics365=require(_0x876b('0x7'));var freshsales=require(_0x876b('0x8'));var integrations=['zendesk','salesforce',_0x876b('0x9'),'freshdesk','zoho',_0x876b('0xa'),_0x876b('0xb'),_0x876b('0xc'),_0x876b('0xd'),_0x876b('0xe')];exports[_0x876b('0xf')]=function(_0x32f429,_0x50b805,_0x3ed72f,_0x126e40,_0x3dc543,_0x8d59c){if(_0x3ed72f){if(_[_0x876b('0x10')](integrations,_0x32f429[_0x876b('0x11')][_0x876b('0x12')]())){try{var _0x67da0a=null;var _0x524290='';var _0x2dcbfb=_0x3ed72f[_0x32f429['data1'][_0x876b('0x12')]()];if(_0x2dcbfb){var _0x72af04=_0x2dcbfb[_0x32f429[_0x876b('0x13')]];if(_0x72af04){var _0xa63258=_[_0x876b('0x14')](_0x72af04[_0x876b('0x15')],{'id':parseInt(_0x32f429[_0x876b('0x16')],0xa)});if(_0xa63258){if(_0x126e40){if(_0x3dc543&&_0x50b805[_0x876b('0x17')]){_0x524290=_0x876b('0x17');}else if(_0x50b805['routeId']){_0x524290=_0x876b('0x18');}else{console['log'](_0x876b('0x19'),_0x50b805);}}else{_0x524290='unmanaged';}switch(_0x32f429[_0x876b('0x11')][_0x876b('0x12')]()){case _0x876b('0x1a'):zendesk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'salesforce':salesforce[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0x9'):sugarcrm[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0x1b'):freshdesk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'zoho':zoho[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0xa'):desk[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case _0x876b('0xb'):vtiger[_0x524290](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c);break;case'freshsales':freshsales['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;case'servicenow':servicenow['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;case _0x876b('0xc'):dynamics365['cs'](_0x32f429,_0x50b805,_0xa63258,_0x126e40,_0x3dc543,_0x72af04,_0x8d59c,_0x524290);break;default:console['log'](_0x876b('0x1c'));}}else{_0x67da0a=require(_0x876b('0x1d'))(_0x32f429[_0x876b('0x11')][_0x876b('0x12')]());_0x67da0a['error'](_0x876b('0x1e'),util[_0x876b('0x1f')](_0x876b('0x20'),_0x32f429[_0x876b('0x11')][_0x876b('0x12')](),_0x32f429[_0x876b('0x16')]));}}else{_0x67da0a=require('../../../../config/logger')(_0x32f429[_0x876b('0x11')]['toLowerCase']());_0x67da0a['error'](_0x876b('0x1e'),util[_0x876b('0x1f')](_0x876b('0x21'),_0x32f429[_0x876b('0x11')][_0x876b('0x12')](),_0x32f429[_0x876b('0x13')]));}}else{}}catch(_0x2aa474){console['error'](_0x2aa474);}}}};
\ No newline at end of file
+var _0xbe5a=['includes','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','freshsales','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec'];(function(_0x1416a5,_0x2d726e){var _0x15cd46=function(_0x1721b0){while(--_0x1721b0){_0x1416a5['push'](_0x1416a5['shift']());}};_0x15cd46(++_0x2d726e);}(_0xbe5a,0xa8));var _0xabe5=function(_0x52684f,_0xff73fc){_0x52684f=_0x52684f-0x0;var _0x4a55f0=_0xbe5a[_0x52684f];return _0x4a55f0;};'use strict';var _=require('lodash');var util=require(_0xabe5('0x0'));var zendesk=require(_0xabe5('0x1'));var salesforce=require(_0xabe5('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xabe5('0x3'));var vtiger=require(_0xabe5('0x4'));var servicenow=require(_0xabe5('0x5'));var dynamics365=require(_0xabe5('0x6'));var freshsales=require(_0xabe5('0x7'));var integrations=[_0xabe5('0x8'),'salesforce',_0xabe5('0x9'),_0xabe5('0xa'),_0xabe5('0xb'),_0xabe5('0xc'),_0xabe5('0xd'),_0xabe5('0xe'),'freshsales',_0xabe5('0xf')];exports[_0xabe5('0x10')]=function(_0x4c0a8f,_0x5d7525,_0x2c6a7c,_0x4d0b4d,_0x3fbc15,_0xa53230){if(_0x2c6a7c){if(_[_0xabe5('0x11')](integrations,_0x4c0a8f[_0xabe5('0x12')][_0xabe5('0x13')]())){try{var _0x33717f=null;var _0x2e71a8='';var _0x183c51=_0x2c6a7c[_0x4c0a8f[_0xabe5('0x12')][_0xabe5('0x13')]()];if(_0x183c51){var _0x155e93=_0x183c51[_0x4c0a8f['data2']];if(_0x155e93){var _0x49f240=_[_0xabe5('0x14')](_0x155e93[_0xabe5('0x15')],{'id':parseInt(_0x4c0a8f['data3'],0xa)});if(_0x49f240){if(_0x4d0b4d){if(_0x3fbc15&&_0x5d7525[_0xabe5('0x16')]){_0x2e71a8='queue';}else if(_0x5d7525[_0xabe5('0x17')]){_0x2e71a8=_0xabe5('0x18');}else{console[_0xabe5('0x19')](_0xabe5('0x1a'),_0x5d7525);}}else{_0x2e71a8=_0xabe5('0x1b');}switch(_0x4c0a8f['data1'][_0xabe5('0x13')]()){case _0xabe5('0x8'):zendesk[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case _0xabe5('0x1c'):salesforce[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case'sugarcrm':sugarcrm[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case _0xabe5('0xa'):freshdesk[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case _0xabe5('0xb'):zoho[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case'desk':desk[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case _0xabe5('0xd'):vtiger[_0x2e71a8](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230);break;case _0xabe5('0x1d'):freshsales['cs'](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230,_0x2e71a8);break;case _0xabe5('0xf'):servicenow['cs'](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230,_0x2e71a8);break;case _0xabe5('0xe'):dynamics365['cs'](_0x4c0a8f,_0x5d7525,_0x49f240,_0x4d0b4d,_0x3fbc15,_0x155e93,_0xa53230,_0x2e71a8);break;default:console['log']('unknown\x20integration');}}else{_0x33717f=require(_0xabe5('0x1e'))(_0x4c0a8f['data1'][_0xabe5('0x13')]());_0x33717f[_0xabe5('0x1f')](_0xabe5('0x20'),util['format'](_0xabe5('0x21'),_0x4c0a8f[_0xabe5('0x12')][_0xabe5('0x13')](),_0x4c0a8f['data3']));}}else{_0x33717f=require(_0xabe5('0x1e'))(_0x4c0a8f[_0xabe5('0x12')][_0xabe5('0x13')]());_0x33717f[_0xabe5('0x1f')]('[EXEC]',util[_0xabe5('0x22')](_0xabe5('0x23'),_0x4c0a8f[_0xabe5('0x12')][_0xabe5('0x13')](),_0x4c0a8f[_0xabe5('0x24')]));}}else{}}catch(_0x8dd7c1){console['error'](_0x8dd7c1);}}}};
\ No newline at end of file
index 96b512f..266436c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60de=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Task','ActivityDate','IsRecurrence','endUserType','lead','WhoId','WhatId','ticketType','account','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','contact','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','variableName','toString','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','serverUrl'];(function(_0x5ceb9c,_0xe04ef9){var _0x4ac02f=function(_0x28abf9){while(--_0x28abf9){_0x5ceb9c['push'](_0x5ceb9c['shift']());}};_0x4ac02f(++_0xe04ef9);}(_0x60de,0x19b));var _0xe60d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x60de[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xe60d('0x0'));var rp=require(_0xe60d('0x1'));var moment=require(_0xe60d('0x2'));var BPromise=require('bluebird');var md5=require(_0xe60d('0x3'));var jsforce=require(_0xe60d('0x4'));var util=require('util');var Redis=require(_0xe60d('0x5'));var intUtil=require(_0xe60d('0x6'));var config=require(_0xe60d('0x7'));var logger=require(_0xe60d('0x8'))(_0xe60d('0x9'));config[_0xe60d('0xa')]=_[_0xe60d('0xb')](config[_0xe60d('0xa')],{'host':_0xe60d('0xc'),'port':0x18eb});var io=require(_0xe60d('0xd'))(new Redis(config[_0xe60d('0xa')]));function emit(_0x355ab3,_0x16ff6a,_0x3d2a6f){io['to'](_0x355ab3)[_0xe60d('0xe')](_0x16ff6a,_0x3d2a6f);}function getTicket(_0x34d42e,_0x239743,_0x5e0ba0,_0x295a0e,_0x3e58e3,_0x4103df,_0x4d196a,_0x12f9d7){var _0x3e3de3=Object[_0xe60d('0xf')]({},{'OwnerId':_0x239743['id'],'Subject':intUtil[_0xe60d('0x10')](_0x295a0e[_0xe60d('0x11')],_0x3e58e3,'\x20'),'Description':intUtil[_0xe60d('0x10')](_0x295a0e['Descriptions'],_0x3e58e3,'\x0a')},getCustomFields(_0x4103df,_0x3e58e3));if(_0x5e0ba0){if(_0x295a0e['ticketType']===_0xe60d('0x12')){_0x3e3de3[_0xe60d('0x13')]=moment['utc']();_0x3e3de3['IsReminderSet']=![];_0x3e3de3[_0xe60d('0x14')]=![];if(_0x5e0ba0[_0xe60d('0x15')]==='contact'||_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x16')){_0x3e3de3[_0xe60d('0x17')]=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]==='account'){_0x3e3de3[_0xe60d('0x18')]=_0x5e0ba0['id'];}}else if(_0x295a0e[_0xe60d('0x19')]==='Case'){if(_0x5e0ba0[_0xe60d('0x15')]==='contact'){_0x3e3de3['ContactId']=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x1a')){_0x3e3de3['AccountId']=_0x5e0ba0['id'];}else if(_0x5e0ba0[_0xe60d('0x15')]===_0xe60d('0x16')&&_0x295a0e[_0xe60d('0x1b')]){_0x3e3de3[_0x295a0e[_0xe60d('0x1b')]]=_0x5e0ba0['id'];}else{logger[_0xe60d('0x1c')](_0xe60d('0x1d'));}}}return _0x4d196a[_0xe60d('0x1e')](_0x295a0e[_0xe60d('0x19')])['create'](_0x3e3de3);}function getUser(_0x2224b4,_0x1136c8,_0x4da842){if(!_[_0xe60d('0x1f')](_0x1136c8)&&intUtil[_0xe60d('0x20')](_0x1136c8)){var _0x56cfca={'Email':_0x1136c8};var _0x576a20={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4da842['sobject'](_0xe60d('0x21'))[_0xe60d('0x22')](_0x56cfca,_0x576a20)[_0xe60d('0x23')]()[_0xe60d('0x24')](function(_0x5d887c){if(_0x5d887c[_0xe60d('0x25')]){var _0x5ada00=_[_0xe60d('0x22')](_0x5d887c,function(_0x5f252f){return _0x5f252f[_0xe60d('0x26')]===_0x1136c8;});if(_0x5ada00){logger[_0xe60d('0x1c')]('Agent\x20%s\x20found.',_0x1136c8);return BPromise[_0xe60d('0x27')]({'id':_0x5ada00['Id'],'name':_0x5ada00[_0xe60d('0x28')]});}}else{logger[_0xe60d('0x1c')](_0xe60d('0x29'),_0x1136c8);return _0x4da842['identity']()['then'](function(_0x293c6d){return BPromise[_0xe60d('0x27')]({'id':_0x293c6d[_0xe60d('0x2a')],'name':_0x293c6d['display_name']});});}});}else{logger['info'](_0xe60d('0x29'),_0x1136c8);return _0x4da842[_0xe60d('0x2b')]()['then'](function(_0x280e62){return BPromise[_0xe60d('0x27')]({'id':_0x280e62['user_id'],'name':_0x280e62[_0xe60d('0x2c')]});});}}function getEndUser(_0x2fb81a,_0x3164ac,_0x3beeb4,_0x33cfc8,_0x39736b){var _0x1ba264={'$or':{'Phone':_0x33cfc8}};var _0x113d11={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe60d('0x27')]()[_0xe60d('0x24')](function(){logger[_0xe60d('0x1c')](_0xe60d('0x2d'),_0x33cfc8,_0x3164ac['moduleSearch']);switch(_0x3164ac['moduleSearch']){case _0xe60d('0x2e'):var _0x202db6=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x30')]){var _0x1484e8={};_0x1484e8[_0x3164ac['additionalSearchContact']]=_0x33cfc8;_[_0xe60d('0x31')](_0x202db6[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x33'))[_0xe60d('0x22')](_0x202db6,_0x113d11)[_0xe60d('0x23')]()[_0xe60d('0x24')](function(_0x477827){if(_0x477827&&_0x477827['length']){return _0x477827;}else{var _0x33b4f5=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x37357c={};_0x37357c[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x33b4f5[_0xe60d('0x32')],_0x37357c);}return _0x39736b[_0xe60d('0x1e')]('Lead')['find'](_0x33b4f5,_0x113d11);}});case _0xe60d('0x35'):var _0x5aaf1d=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchAccount']){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x36')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x5aaf1d['$or'],_0x1484e8);}return _0x39736b['sobject'](_0xe60d('0x37'))[_0xe60d('0x22')](_0x5aaf1d,_0x113d11)['execute']()[_0xe60d('0x24')](function(_0x16cba6){if(_0x16cba6&&_0x16cba6[_0xe60d('0x25')]){return _0x16cba6;}else{var _0x191728=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x30')]){var _0x46e0a3={};_0x46e0a3[_0x3164ac[_0xe60d('0x30')]]=_0x33cfc8;_['merge'](_0x191728[_0xe60d('0x32')],_0x46e0a3);}return _0x39736b[_0xe60d('0x1e')]('Contact')['find'](_0x191728,_0x113d11)['then'](function(_0x49c22a){if(_0x49c22a&&_0x49c22a[_0xe60d('0x25')]){return _0x49c22a;}else{var _0x5b913a=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x48879c={};_0x48879c[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x5b913a[_0xe60d('0x32')],_0x48879c);}return _0x39736b['sobject'](_0xe60d('0x38'))[_0xe60d('0x22')](_0x5b913a,_0x113d11);}});}});case'contact':var _0x202db6=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchContact']){var _0x1484e8={};_0x1484e8[_0x3164ac['additionalSearchContact']]=_0x33cfc8;_[_0xe60d('0x31')](_0x202db6[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x33'))[_0xe60d('0x22')](_0x202db6,_0x113d11)[_0xe60d('0x23')]();case _0xe60d('0x16'):var _0x3ebff4=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac[_0xe60d('0x34')]){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x34')]]=_0x33cfc8;_[_0xe60d('0x31')](_0x3ebff4[_0xe60d('0x32')],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x38'))['find'](_0x3ebff4,_0x113d11);case'account':var _0x5aaf1d=_[_0xe60d('0x2f')](_0x1ba264);if(_0x3164ac['additionalSearchAccount']){var _0x1484e8={};_0x1484e8[_0x3164ac[_0xe60d('0x36')]]=_0x33cfc8;_['merge'](_0x5aaf1d['$or'],_0x1484e8);}return _0x39736b[_0xe60d('0x1e')](_0xe60d('0x37'))[_0xe60d('0x22')](_0x5aaf1d,_0x113d11);default:return null;}})['then'](function(_0x348bd0){if(_0x348bd0&&_0x348bd0['length']){var _0x3ee136=_[_0xe60d('0x39')](_0x348bd0);if(_0x3ee136){return BPromise['resolve']({'id':_0x3ee136['Id'],'name':_0x3ee136[_0xe60d('0x28')],'phone':_0x3ee136[_0xe60d('0x3a')],'endUserType':_0x3ee136['attributes'][_0xe60d('0x3b')][_0xe60d('0x3c')]()});}}})[_0xe60d('0x24')](function(_0x3f4f5f){if(_0x3f4f5f){logger[_0xe60d('0x1c')](_0xe60d('0x3d'),_0x3f4f5f[_0xe60d('0x15')],_0x33cfc8);return BPromise[_0xe60d('0x27')](_0x3f4f5f);}else{logger[_0xe60d('0x1c')](_0xe60d('0x3e'),_0x33cfc8);var _0x9060c3={'Phone':_0x33cfc8};if(_0x3164ac[_0xe60d('0x3f')]){if(_0x3164ac[_0xe60d('0x3f')]===_0xe60d('0x40')){logger[_0xe60d('0x1c')](_0xe60d('0x41'),_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x42')]=_0x3beeb4!==_0xe60d('0x43')?_0x3beeb4:util[_0xe60d('0x44')](_0xe60d('0x45'),_0x33cfc8);}else if(_0x3164ac[_0xe60d('0x3f')]==='lead'){logger[_0xe60d('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x42')]=_0x3beeb4!=='<unknown>'?_0x3beeb4:util[_0xe60d('0x44')]('Caller\x20-\x20%s',_0x33cfc8);_0x9060c3[_0xe60d('0x46')]=_0xe60d('0x47');}else if(_0x3164ac['moduleCreate']===_0xe60d('0x1a')){logger[_0xe60d('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x33cfc8,_0x3164ac[_0xe60d('0x3f')]);_0x9060c3[_0xe60d('0x28')]=_0x3beeb4!==_0xe60d('0x43')?_0x3beeb4:util[_0xe60d('0x44')](_0xe60d('0x45'),_0x33cfc8);}else{return null;}}return _0x39736b[_0xe60d('0x1e')](_[_0xe60d('0x48')](_0x3164ac['moduleCreate']))['create'](_0x9060c3)[_0xe60d('0x24')](function(_0x3f918e){return BPromise[_0xe60d('0x27')]({'id':_0x3f918e['id'],'endUserType':_0x3164ac[_0xe60d('0x3f')]});});}});}function getCustomFields(_0x21c2b5,_0x14a1ee){var _0x18b299={};if(_0x21c2b5[_0xe60d('0x25')]>0x0){_[_0xe60d('0x49')](_0x21c2b5,function(_0xb1b39f){if(_[_0xe60d('0x4a')](['string',_0xe60d('0x4b')],_0xb1b39f[_0xe60d('0x3b')])&&_0xb1b39f['idField']){_0x18b299[_0xb1b39f[_0xe60d('0x4c')]]=_0xb1b39f[_0xe60d('0x4d')]['toString']();}else if(_0xb1b39f['type']==='variable'&&_0xb1b39f[_0xe60d('0x4e')]&&_0xb1b39f[_0xe60d('0x4c')]){_0x14a1ee[_0xb1b39f[_0xe60d('0x4e')]]&&(_0x18b299[_0xb1b39f[_0xe60d('0x4c')]]=_0x14a1ee[_0xb1b39f[_0xe60d('0x4e')]][_0xe60d('0x4f')]());}else if(_0xb1b39f[_0xe60d('0x3b')]==='customVariable'&&_0xb1b39f[_0xe60d('0x50')]&&_0xb1b39f['Variable']['name']&&_0xb1b39f['idField']){_0x14a1ee[_0xb1b39f['Variable'][_0xe60d('0x51')][_0xe60d('0x3c')]()]&&(_0x18b299[_0xb1b39f['idField']]=_0x14a1ee[_0xb1b39f[_0xe60d('0x50')][_0xe60d('0x51')][_0xe60d('0x3c')]()][_0xe60d('0x4f')]());}});}return _0x18b299;}function getConnection(_0x4de78f){var _0x357e87=_0x4de78f[_0xe60d('0x52')][_0xe60d('0x53')](_0x4de78f[_0xe60d('0x54')]);var _0x3e662b=new jsforce[(_0xe60d('0x55'))]({'oauth2':{'loginUrl':_0x4de78f[_0xe60d('0x56')]||_0xe60d('0x57'),'clientId':_0x4de78f[_0xe60d('0x58')],'clientSecret':_0x4de78f[_0xe60d('0x59')]}});return _0x3e662b[_0xe60d('0x5a')](_0x4de78f[_0xe60d('0x5b')],_0x357e87)[_0xe60d('0x24')](function(){logger[_0xe60d('0x1c')]('Connection\x20established.');return _0x3e662b;});}exports['queue']=function(_0x32542e,_0x6c8bd9,_0x2035e1,_0x19b71c,_0x3e8a03,_0x5000c0){var _0x551f91,_0x53af22,_0x164762,_0x45f972;_0x5000c0[_0xe60d('0x5c')]=intUtil['stripTrailingSlash'](_0x5000c0[_0xe60d('0x5c')]);_0x5000c0[_0xe60d('0x56')]=intUtil['stripTrailingSlash'](_0x5000c0[_0xe60d('0x56')]);if(_0x3e8a03&&_0x3e8a03[_0xe60d('0x5d')]){logger[_0xe60d('0x1c')](_0xe60d('0x5e'),_0xe60d('0x5f'));_0x6c8bd9[_0xe60d('0x60')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5000c0[_0xe60d('0x5c')],_0x6c8bd9[_0xe60d('0x61')],md5(_0x6c8bd9[_0xe60d('0x61')]));}else{_0x6c8bd9[_0xe60d('0x60')]='';}return getConnection(_0x5000c0)[_0xe60d('0x24')](function(_0x4eb7f6){_0x45f972=_0x4eb7f6;return getUser(_0x5000c0,_0x19b71c[_0xe60d('0x62')],_0x45f972);})['then'](function(_0xc4dfe4){_0x551f91=_0xc4dfe4;return getEndUser(_0x5000c0,_0x2035e1,_0x6c8bd9['calleridname'],_0x6c8bd9[_0xe60d('0x63')],_0x45f972);})[_0xe60d('0x24')](function(_0x190dcf){_0x53af22=_0x190dcf;return getTicket(_0x5000c0,_0x551f91,_0x53af22,_0x2035e1,_0x6c8bd9,_0x2035e1['Fields'],_0x45f972,_0xe60d('0x64'));})['then'](function(_0x4ccc83){_0x164762=_0x4ccc83;logger['info'](_0xe60d('0x65'),_0x164762['id']);logger['info'](_0xe60d('0x66'),_0x164762['id'],_0x19b71c[_0xe60d('0x51')],_0x5000c0['type']);switch(_0x5000c0['type']){case'integrationTab':emit(util['format'](_0xe60d('0x67'),_0x19b71c[_0xe60d('0x51')]),_0xe60d('0x68'),{'recordId':_0x164762['id']});break;case _0xe60d('0x69'):emit(util[_0xe60d('0x44')]('user:%s',_0x19b71c[_0xe60d('0x51')]),'trigger:browser:url',{'uri':util[_0xe60d('0x44')](_0xe60d('0x6a'),_0x45f972[_0xe60d('0x6b')],_0x164762['id'])});break;default:logger[_0xe60d('0x6c')](_0xe60d('0x6d'));}})[_0xe60d('0x6e')](function(_0x132e23){logger[_0xe60d('0x6c')]('[QUEUE]',_0x132e23);});};exports[_0xe60d('0x6f')]=function(_0x276da1,_0x550578,_0x3422a6,_0x76d175,_0x822646,_0x4875c9,_0x16a49c){var _0xd85696,_0x26c8da,_0x3bab9a,_0x37b7cf;_0x4875c9['serverUrl']=intUtil['stripTrailingSlash'](_0x4875c9[_0xe60d('0x5c')]);_0x4875c9[_0xe60d('0x56')]=intUtil[_0xe60d('0x70')](_0x4875c9[_0xe60d('0x56')]);if(_0x16a49c&&_0x16a49c['recordingFormat']&&_0x16a49c[_0xe60d('0x71')]!=='none'){logger['info'](_0xe60d('0x72'),_0xe60d('0x5f'));_0x550578[_0xe60d('0x60')]=util[_0xe60d('0x44')](_0xe60d('0x73'),_0x4875c9[_0xe60d('0x5c')],_0x550578[_0xe60d('0x61')],md5(_0x550578[_0xe60d('0x61')]));}return getConnection(_0x4875c9)[_0xe60d('0x24')](function(_0x322eed){_0x37b7cf=_0x322eed;return getUser(_0x4875c9,_0x76d175[_0xe60d('0x62')],_0x37b7cf);})[_0xe60d('0x24')](function(_0x51fd86){_0xd85696=_0x51fd86;return getEndUser(_0x4875c9,_0x3422a6,_0x550578['destcalleridname'],_0x550578['destcalleridnum'],_0x37b7cf);})['then'](function(_0x4fd30a){_0x26c8da=_0x4fd30a;return getTicket(_0x4875c9,_0xd85696,_0x26c8da,_0x3422a6,_0x550578,_0x3422a6[_0xe60d('0x74')],_0x37b7cf,_0xe60d('0x6f'));})[_0xe60d('0x24')](function(_0x1139dc){_0x3bab9a=_0x1139dc;logger[_0xe60d('0x1c')](_0xe60d('0x75'),_0x3bab9a['id']);logger['info'](_0xe60d('0x76'),_0x3bab9a['id'],_0x76d175[_0xe60d('0x51')],_0x4875c9[_0xe60d('0x3b')]);switch(_0x4875c9[_0xe60d('0x3b')]){case'integrationTab':emit(util[_0xe60d('0x44')](_0xe60d('0x67'),_0x76d175['name']),_0xe60d('0x68'),{'recordId':_0x3bab9a['id']});break;case'newTab':emit(util[_0xe60d('0x44')](_0xe60d('0x67'),_0x76d175['name']),'trigger:browser:url',{'uri':util[_0xe60d('0x44')]('%s/%s/e',_0x37b7cf[_0xe60d('0x6b')],_0x3bab9a['id'])});break;default:logger[_0xe60d('0x6c')]('[OUTBOUND]',_0xe60d('0x77'));}})['catch'](function(_0x395175){logger['error'](_0xe60d('0x72'),_0x395175);});};exports[_0xe60d('0x78')]=function(_0x382b50,_0x3f8ff9,_0x4d20a7,_0x4dc43e,_0x37825c,_0x3a953b){var _0x21bfd1,_0x1c623c,_0xc18ad1,_0x12e13d;_0x3a953b[_0xe60d('0x5c')]=intUtil[_0xe60d('0x70')](_0x3a953b[_0xe60d('0x5c')]);_0x3a953b[_0xe60d('0x56')]=intUtil[_0xe60d('0x70')](_0x3a953b[_0xe60d('0x56')]);if(_0x37825c&&_0x37825c[_0xe60d('0x5d')]){logger['info']('['+_0x3f8ff9[_0xe60d('0x79')][_0xe60d('0x7a')]()+']','Recording\x20is\x20enabled!');_0x3f8ff9[_0xe60d('0x60')]=util[_0xe60d('0x44')](_0xe60d('0x73'),_0x3a953b[_0xe60d('0x5c')],_0x3f8ff9[_0xe60d('0x61')],md5(_0x3f8ff9[_0xe60d('0x61')]));}else{_0x3f8ff9['recordingURL']='';}return getConnection(_0x3a953b)[_0xe60d('0x24')](function(_0x20b88d){_0x12e13d=_0x20b88d;if(!_['isNil'](_0x4dc43e)){return getUser(_0x3a953b,_0x4dc43e[_0xe60d('0x51')],_0x12e13d);}else{return getUser(_0x3a953b,null,_0x12e13d);}})[_0xe60d('0x24')](function(_0x1f07b8){_0x21bfd1=_0x1f07b8;return getEndUser(_0x3a953b,_0x4d20a7,_0x3f8ff9[_0xe60d('0x7b')],_0x3f8ff9[_0xe60d('0x63')],_0x12e13d);})[_0xe60d('0x24')](function(_0x449f30){_0x1c623c=_0x449f30;return getTicket(_0x3a953b,_0x21bfd1,_0x1c623c,_0x4d20a7,_0x3f8ff9,_0x4d20a7[_0xe60d('0x74')],_0x12e13d);})['then'](function(_0x377d6f){_0xc18ad1=_0x377d6f;logger['info']('['+_0x3f8ff9[_0xe60d('0x79')][_0xe60d('0x7a')]()+_0xe60d('0x7c'),_0xc18ad1['id']);logger[_0xe60d('0x1c')]('['+_0x3f8ff9['lastevent'][_0xe60d('0x7a')]()+_0xe60d('0x7d'),_0x3a953b[_0xe60d('0x3b')]);})[_0xe60d('0x6e')](function(_0x593075){logger[_0xe60d('0x6c')]('['+_0x3f8ff9['lastevent']['toUpperCase']()+']',_0x593075);});};
\ No newline at end of file
+var _0x6709=['queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','error','catch','recordingFormat','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','%s/%s/e','[OUTBOUND]','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','contact','endUserType','lead','WhoId','account','WhatId','ticketType','Case','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','cloneDeep','$or','Lead','Account','Contact','length','additionalSearchLead','additionalSearchAccount','first','Phone','attributes','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','Caller\x20-\x20%s','format','Company','No\x20Company','upperFirst','forEach','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.'];(function(_0x3f8c6f,_0x332fd5){var _0x297ad6=function(_0x548c66){while(--_0x548c66){_0x3f8c6f['push'](_0x3f8c6f['shift']());}};_0x297ad6(++_0x332fd5);}(_0x6709,0x120));var _0x9670=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x6709[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x9670('0x0'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x9670('0x1'));var util=require(_0x9670('0x2'));var Redis=require(_0x9670('0x3'));var intUtil=require(_0x9670('0x4'));var config=require('../../../../config/environment');var logger=require(_0x9670('0x5'))(_0x9670('0x6'));config[_0x9670('0x7')]=_['defaults'](config['redis'],{'host':_0x9670('0x8'),'port':0x18eb});var io=require(_0x9670('0x9'))(new Redis(config[_0x9670('0x7')]));function emit(_0x7d5fb4,_0x1825ab,_0xccaff3){io['to'](_0x7d5fb4)[_0x9670('0xa')](_0x1825ab,_0xccaff3);}function getTicket(_0x3ea55e,_0x51dcfc,_0x423d7c,_0x3932c6,_0x5a7aee,_0x58c26f,_0x356462,_0x467d0d){var _0x32c786=Object['assign']({},{'OwnerId':_0x51dcfc['id'],'Subject':intUtil[_0x9670('0xb')](_0x3932c6[_0x9670('0xc')],_0x5a7aee,'\x20'),'Description':intUtil[_0x9670('0xb')](_0x3932c6[_0x9670('0xd')],_0x5a7aee,'\x0a')},getCustomFields(_0x58c26f,_0x5a7aee));if(_0x423d7c){if(_0x3932c6['ticketType']===_0x9670('0xe')){_0x32c786[_0x9670('0xf')]=moment[_0x9670('0x10')]();_0x32c786[_0x9670('0x11')]=![];_0x32c786['IsRecurrence']=![];if(_0x423d7c['endUserType']===_0x9670('0x12')||_0x423d7c[_0x9670('0x13')]===_0x9670('0x14')){_0x32c786[_0x9670('0x15')]=_0x423d7c['id'];}else if(_0x423d7c[_0x9670('0x13')]===_0x9670('0x16')){_0x32c786[_0x9670('0x17')]=_0x423d7c['id'];}}else if(_0x3932c6[_0x9670('0x18')]===_0x9670('0x19')){if(_0x423d7c[_0x9670('0x13')]===_0x9670('0x12')){_0x32c786['ContactId']=_0x423d7c['id'];}else if(_0x423d7c['endUserType']===_0x9670('0x16')){_0x32c786['AccountId']=_0x423d7c['id'];}else if(_0x423d7c['endUserType']===_0x9670('0x14')&&_0x3932c6[_0x9670('0x1a')]){_0x32c786[_0x3932c6['leadId']]=_0x423d7c['id'];}else{logger['info'](_0x9670('0x1b'));}}}return _0x356462[_0x9670('0x1c')](_0x3932c6[_0x9670('0x18')])[_0x9670('0x1d')](_0x32c786);}function getUser(_0x227a89,_0x1e029c,_0x3f0ed9){if(!_[_0x9670('0x1e')](_0x1e029c)&&intUtil[_0x9670('0x1f')](_0x1e029c)){var _0x3a3b4a={'Email':_0x1e029c};var _0x1b9e55={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3f0ed9[_0x9670('0x1c')](_0x9670('0x20'))[_0x9670('0x21')](_0x3a3b4a,_0x1b9e55)[_0x9670('0x22')]()[_0x9670('0x23')](function(_0xe94674){if(_0xe94674['length']){var _0x18b251=_[_0x9670('0x21')](_0xe94674,function(_0x2a8658){return _0x2a8658[_0x9670('0x24')]===_0x1e029c;});if(_0x18b251){logger['info']('Agent\x20%s\x20found.',_0x1e029c);return BPromise[_0x9670('0x25')]({'id':_0x18b251['Id'],'name':_0x18b251[_0x9670('0x26')]});}}else{logger[_0x9670('0x27')](_0x9670('0x28'),_0x1e029c);return _0x3f0ed9[_0x9670('0x29')]()['then'](function(_0x5edcdc){return BPromise[_0x9670('0x25')]({'id':_0x5edcdc[_0x9670('0x2a')],'name':_0x5edcdc[_0x9670('0x2b')]});});}});}else{logger['info'](_0x9670('0x28'),_0x1e029c);return _0x3f0ed9['identity']()[_0x9670('0x23')](function(_0x5c0448){return BPromise[_0x9670('0x25')]({'id':_0x5c0448['user_id'],'name':_0x5c0448[_0x9670('0x2b')]});});}}function getEndUser(_0x1730f3,_0x1f791c,_0x372295,_0x312a89,_0x852afc){var _0x520e97={'$or':{'Phone':_0x312a89}};var _0x541bee={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x9670('0x23')](function(){logger['info'](_0x9670('0x2c'),_0x312a89,_0x1f791c['moduleSearch']);switch(_0x1f791c[_0x9670('0x2d')]){case _0x9670('0x2e'):var _0x333d62=_['cloneDeep'](_0x520e97);if(_0x1f791c[_0x9670('0x2f')]){var _0x2fc74a={};_0x2fc74a[_0x1f791c[_0x9670('0x2f')]]=_0x312a89;_[_0x9670('0x30')](_0x333d62['$or'],_0x2fc74a);}return _0x852afc[_0x9670('0x1c')]('Contact')[_0x9670('0x21')](_0x333d62,_0x541bee)[_0x9670('0x22')]()[_0x9670('0x23')](function(_0xba8e5c){if(_0xba8e5c&&_0xba8e5c['length']){return _0xba8e5c;}else{var _0x14c46c=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c['additionalSearchLead']){var _0x1ea6d4={};_0x1ea6d4[_0x1f791c['additionalSearchLead']]=_0x312a89;_[_0x9670('0x30')](_0x14c46c[_0x9670('0x32')],_0x1ea6d4);}return _0x852afc[_0x9670('0x1c')](_0x9670('0x33'))['find'](_0x14c46c,_0x541bee);}});case'account_contact_lead':var _0x519ae1=_['cloneDeep'](_0x520e97);if(_0x1f791c['additionalSearchAccount']){var _0x2fc74a={};_0x2fc74a[_0x1f791c['additionalSearchAccount']]=_0x312a89;_[_0x9670('0x30')](_0x519ae1[_0x9670('0x32')],_0x2fc74a);}return _0x852afc[_0x9670('0x1c')](_0x9670('0x34'))[_0x9670('0x21')](_0x519ae1,_0x541bee)[_0x9670('0x22')]()[_0x9670('0x23')](function(_0x2a41a9){if(_0x2a41a9&&_0x2a41a9['length']){return _0x2a41a9;}else{var _0x5c84c9=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c['additionalSearchContact']){var _0x120033={};_0x120033[_0x1f791c[_0x9670('0x2f')]]=_0x312a89;_['merge'](_0x5c84c9[_0x9670('0x32')],_0x120033);}return _0x852afc[_0x9670('0x1c')](_0x9670('0x35'))['find'](_0x5c84c9,_0x541bee)[_0x9670('0x23')](function(_0x2cb21a){if(_0x2cb21a&&_0x2cb21a[_0x9670('0x36')]){return _0x2cb21a;}else{var _0x88e5b8=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c[_0x9670('0x37')]){var _0x771f7b={};_0x771f7b[_0x1f791c[_0x9670('0x37')]]=_0x312a89;_[_0x9670('0x30')](_0x88e5b8[_0x9670('0x32')],_0x771f7b);}return _0x852afc['sobject']('Lead')[_0x9670('0x21')](_0x88e5b8,_0x541bee);}});}});case _0x9670('0x12'):var _0x333d62=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c[_0x9670('0x2f')]){var _0x2fc74a={};_0x2fc74a[_0x1f791c[_0x9670('0x2f')]]=_0x312a89;_[_0x9670('0x30')](_0x333d62[_0x9670('0x32')],_0x2fc74a);}return _0x852afc[_0x9670('0x1c')](_0x9670('0x35'))[_0x9670('0x21')](_0x333d62,_0x541bee)[_0x9670('0x22')]();case _0x9670('0x14'):var _0x373c2f=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c['additionalSearchLead']){var _0x2fc74a={};_0x2fc74a[_0x1f791c[_0x9670('0x37')]]=_0x312a89;_[_0x9670('0x30')](_0x373c2f[_0x9670('0x32')],_0x2fc74a);}return _0x852afc['sobject']('Lead')[_0x9670('0x21')](_0x373c2f,_0x541bee);case _0x9670('0x16'):var _0x519ae1=_[_0x9670('0x31')](_0x520e97);if(_0x1f791c[_0x9670('0x38')]){var _0x2fc74a={};_0x2fc74a[_0x1f791c[_0x9670('0x38')]]=_0x312a89;_[_0x9670('0x30')](_0x519ae1['$or'],_0x2fc74a);}return _0x852afc[_0x9670('0x1c')]('Account')[_0x9670('0x21')](_0x519ae1,_0x541bee);default:return null;}})[_0x9670('0x23')](function(_0x4d8f96){if(_0x4d8f96&&_0x4d8f96[_0x9670('0x36')]){var _0x4c74a2=_[_0x9670('0x39')](_0x4d8f96);if(_0x4c74a2){return BPromise[_0x9670('0x25')]({'id':_0x4c74a2['Id'],'name':_0x4c74a2[_0x9670('0x26')],'phone':_0x4c74a2[_0x9670('0x3a')],'endUserType':_0x4c74a2[_0x9670('0x3b')]['type'][_0x9670('0x3c')]()});}}})[_0x9670('0x23')](function(_0x3c232e){if(_0x3c232e){logger[_0x9670('0x27')](_0x9670('0x3d'),_0x3c232e[_0x9670('0x13')],_0x312a89);return BPromise[_0x9670('0x25')](_0x3c232e);}else{logger[_0x9670('0x27')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x312a89);var _0x1159b6={'Phone':_0x312a89};if(_0x1f791c[_0x9670('0x3e')]){if(_0x1f791c[_0x9670('0x3e')]===_0x9670('0x12')){logger[_0x9670('0x27')](_0x9670('0x3f'),_0x312a89,_0x1f791c[_0x9670('0x3e')]);_0x1159b6[_0x9670('0x40')]=_0x372295!==_0x9670('0x41')?_0x372295:util['format'](_0x9670('0x42'),_0x312a89);}else if(_0x1f791c[_0x9670('0x3e')]==='lead'){logger[_0x9670('0x27')](_0x9670('0x3f'),_0x312a89,_0x1f791c[_0x9670('0x3e')]);_0x1159b6['LastName']=_0x372295!==_0x9670('0x41')?_0x372295:util[_0x9670('0x43')](_0x9670('0x42'),_0x312a89);_0x1159b6[_0x9670('0x44')]=_0x9670('0x45');}else if(_0x1f791c['moduleCreate']===_0x9670('0x16')){logger[_0x9670('0x27')](_0x9670('0x3f'),_0x312a89,_0x1f791c[_0x9670('0x3e')]);_0x1159b6['Name']=_0x372295!==_0x9670('0x41')?_0x372295:util[_0x9670('0x43')]('Caller\x20-\x20%s',_0x312a89);}else{return null;}}return _0x852afc[_0x9670('0x1c')](_[_0x9670('0x46')](_0x1f791c[_0x9670('0x3e')]))[_0x9670('0x1d')](_0x1159b6)[_0x9670('0x23')](function(_0x1d54be){return BPromise[_0x9670('0x25')]({'id':_0x1d54be['id'],'endUserType':_0x1f791c[_0x9670('0x3e')]});});}});}function getCustomFields(_0x30215d,_0x1b9cfa){var _0x366825={};if(_0x30215d[_0x9670('0x36')]>0x0){_[_0x9670('0x47')](_0x30215d,function(_0x4428cd){if(_['includes']([_0x9670('0x48'),_0x9670('0x49')],_0x4428cd[_0x9670('0x4a')])&&_0x4428cd['idField']){_0x366825[_0x4428cd[_0x9670('0x4b')]]=_0x4428cd[_0x9670('0x4c')][_0x9670('0x4d')]();}else if(_0x4428cd[_0x9670('0x4a')]===_0x9670('0x4e')&&_0x4428cd[_0x9670('0x4f')]&&_0x4428cd[_0x9670('0x4b')]){_0x1b9cfa[_0x4428cd['variableName']]&&(_0x366825[_0x4428cd[_0x9670('0x4b')]]=_0x1b9cfa[_0x4428cd['variableName']][_0x9670('0x4d')]());}else if(_0x4428cd[_0x9670('0x4a')]==='customVariable'&&_0x4428cd['Variable']&&_0x4428cd[_0x9670('0x50')][_0x9670('0x51')]&&_0x4428cd[_0x9670('0x4b')]){_0x1b9cfa[_0x4428cd[_0x9670('0x50')][_0x9670('0x51')][_0x9670('0x3c')]()]&&(_0x366825[_0x4428cd[_0x9670('0x4b')]]=_0x1b9cfa[_0x4428cd[_0x9670('0x50')]['name'][_0x9670('0x3c')]()][_0x9670('0x4d')]());}});}return _0x366825;}function getConnection(_0x553a34){var _0x53e4b9=_0x553a34[_0x9670('0x52')][_0x9670('0x53')](_0x553a34[_0x9670('0x54')]);var _0x490742=new jsforce[(_0x9670('0x55'))]({'oauth2':{'loginUrl':_0x553a34[_0x9670('0x56')]||_0x9670('0x57'),'clientId':_0x553a34[_0x9670('0x58')],'clientSecret':_0x553a34[_0x9670('0x59')]}});return _0x490742[_0x9670('0x5a')](_0x553a34[_0x9670('0x5b')],_0x53e4b9)[_0x9670('0x23')](function(){logger[_0x9670('0x27')](_0x9670('0x5c'));return _0x490742;});}exports[_0x9670('0x5d')]=function(_0x2f104a,_0x2ed4ac,_0x3b0155,_0xc23668,_0x204bf3,_0xfedb4c){var _0x52c5bd,_0x543b05,_0x48ab9c,_0x4bdf8b;_0xfedb4c[_0x9670('0x5e')]=intUtil[_0x9670('0x5f')](_0xfedb4c[_0x9670('0x5e')]);_0xfedb4c[_0x9670('0x56')]=intUtil[_0x9670('0x5f')](_0xfedb4c['remoteUri']);if(_0x204bf3&&_0x204bf3[_0x9670('0x60')]){logger[_0x9670('0x27')](_0x9670('0x61'),_0x9670('0x62'));_0x2ed4ac[_0x9670('0x63')]=util[_0x9670('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xfedb4c[_0x9670('0x5e')],_0x2ed4ac['uniqueid'],md5(_0x2ed4ac[_0x9670('0x64')]));}else{_0x2ed4ac['recordingURL']='';}return getConnection(_0xfedb4c)['then'](function(_0xc04c67){_0x4bdf8b=_0xc04c67;return getUser(_0xfedb4c,_0xc23668[_0x9670('0x65')],_0x4bdf8b);})[_0x9670('0x23')](function(_0x3ab23c){_0x52c5bd=_0x3ab23c;return getEndUser(_0xfedb4c,_0x3b0155,_0x2ed4ac[_0x9670('0x66')],_0x2ed4ac[_0x9670('0x67')],_0x4bdf8b);})[_0x9670('0x23')](function(_0x12fb48){_0x543b05=_0x12fb48;return getTicket(_0xfedb4c,_0x52c5bd,_0x543b05,_0x3b0155,_0x2ed4ac,_0x3b0155[_0x9670('0x68')],_0x4bdf8b,_0x9670('0x5d'));})[_0x9670('0x23')](function(_0x3b6d74){_0x48ab9c=_0x3b6d74;logger[_0x9670('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x48ab9c['id']);logger[_0x9670('0x27')](_0x9670('0x69'),_0x48ab9c['id'],_0xc23668[_0x9670('0x51')],_0xfedb4c['type']);switch(_0xfedb4c[_0x9670('0x4a')]){case'integrationTab':emit(util['format'](_0x9670('0x6a'),_0xc23668[_0x9670('0x51')]),_0x9670('0x6b'),{'recordId':_0x48ab9c['id']});break;case _0x9670('0x6c'):emit(util[_0x9670('0x43')](_0x9670('0x6a'),_0xc23668[_0x9670('0x51')]),_0x9670('0x6d'),{'uri':util[_0x9670('0x43')]('%s/%s/e',_0x4bdf8b['instanceUrl'],_0x48ab9c['id'])});break;default:logger[_0x9670('0x6e')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x9670('0x6f')](function(_0x9b36e1){logger[_0x9670('0x6e')]('[QUEUE]',_0x9b36e1);});};exports['outbound']=function(_0x90936e,_0x2c4e6d,_0x5724ba,_0x349bb3,_0x4356d5,_0xabb415,_0x47a444){var _0x3b18ec,_0x485a52,_0x3c4e1d,_0x9d8d97;_0xabb415[_0x9670('0x5e')]=intUtil['stripTrailingSlash'](_0xabb415[_0x9670('0x5e')]);_0xabb415[_0x9670('0x56')]=intUtil[_0x9670('0x5f')](_0xabb415[_0x9670('0x56')]);if(_0x47a444&&_0x47a444[_0x9670('0x70')]&&_0x47a444[_0x9670('0x70')]!=='none'){logger[_0x9670('0x27')]('[OUTBOUND]',_0x9670('0x62'));_0x2c4e6d['recordingURL']=util[_0x9670('0x43')](_0x9670('0x71'),_0xabb415['serverUrl'],_0x2c4e6d['uniqueid'],md5(_0x2c4e6d['uniqueid']));}return getConnection(_0xabb415)[_0x9670('0x23')](function(_0x7217a9){_0x9d8d97=_0x7217a9;return getUser(_0xabb415,_0x349bb3[_0x9670('0x65')],_0x9d8d97);})[_0x9670('0x23')](function(_0x1bfb3d){_0x3b18ec=_0x1bfb3d;return getEndUser(_0xabb415,_0x5724ba,_0x2c4e6d[_0x9670('0x72')],_0x2c4e6d[_0x9670('0x73')],_0x9d8d97);})['then'](function(_0x2d8987){_0x485a52=_0x2d8987;return getTicket(_0xabb415,_0x3b18ec,_0x485a52,_0x5724ba,_0x2c4e6d,_0x5724ba[_0x9670('0x68')],_0x9d8d97,_0x9670('0x74'));})[_0x9670('0x23')](function(_0x35ac23){_0x3c4e1d=_0x35ac23;logger[_0x9670('0x27')](_0x9670('0x75'),_0x3c4e1d['id']);logger[_0x9670('0x27')](_0x9670('0x76'),_0x3c4e1d['id'],_0x349bb3[_0x9670('0x51')],_0xabb415[_0x9670('0x4a')]);switch(_0xabb415[_0x9670('0x4a')]){case _0x9670('0x77'):emit(util[_0x9670('0x43')](_0x9670('0x6a'),_0x349bb3[_0x9670('0x51')]),'trigger:salesforce:display',{'recordId':_0x3c4e1d['id']});break;case'newTab':emit(util[_0x9670('0x43')](_0x9670('0x6a'),_0x349bb3[_0x9670('0x51')]),'trigger:browser:url',{'uri':util['format'](_0x9670('0x78'),_0x9d8d97['instanceUrl'],_0x3c4e1d['id'])});break;default:logger[_0x9670('0x6e')](_0x9670('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x29552e){logger[_0x9670('0x6e')](_0x9670('0x79'),_0x29552e);});};exports[_0x9670('0x7a')]=function(_0x1e4ae8,_0x343ddb,_0x4f2966,_0x5db50e,_0x21396d,_0x2f985e){var _0x6063b5,_0x42ed70,_0x22a403,_0x192222;_0x2f985e[_0x9670('0x5e')]=intUtil[_0x9670('0x5f')](_0x2f985e[_0x9670('0x5e')]);_0x2f985e['remoteUri']=intUtil[_0x9670('0x5f')](_0x2f985e['remoteUri']);if(_0x21396d&&_0x21396d[_0x9670('0x60')]){logger['info']('['+_0x343ddb[_0x9670('0x7b')][_0x9670('0x7c')]()+']',_0x9670('0x62'));_0x343ddb[_0x9670('0x63')]=util[_0x9670('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f985e[_0x9670('0x5e')],_0x343ddb[_0x9670('0x64')],md5(_0x343ddb[_0x9670('0x64')]));}else{_0x343ddb[_0x9670('0x63')]='';}return getConnection(_0x2f985e)[_0x9670('0x23')](function(_0x41efc7){_0x192222=_0x41efc7;if(!_['isNil'](_0x5db50e)){return getUser(_0x2f985e,_0x5db50e[_0x9670('0x51')],_0x192222);}else{return getUser(_0x2f985e,null,_0x192222);}})[_0x9670('0x23')](function(_0x1d5517){_0x6063b5=_0x1d5517;return getEndUser(_0x2f985e,_0x4f2966,_0x343ddb['calleridname'],_0x343ddb[_0x9670('0x67')],_0x192222);})['then'](function(_0x39b42d){_0x42ed70=_0x39b42d;return getTicket(_0x2f985e,_0x6063b5,_0x42ed70,_0x4f2966,_0x343ddb,_0x4f2966['Fields'],_0x192222);})[_0x9670('0x23')](function(_0x240920){_0x22a403=_0x240920;logger['info']('['+_0x343ddb[_0x9670('0x7b')]['toUpperCase']()+_0x9670('0x7d'),_0x22a403['id']);logger['info']('['+_0x343ddb[_0x9670('0x7b')][_0x9670('0x7c')]()+_0x9670('0x7e'),_0x2f985e['type']);})[_0x9670('0x6f')](function(_0x5ba974){logger['error']('['+_0x343ddb[_0x9670('0x7b')][_0x9670('0x7c')]()+']',_0x5ba974);});};
\ No newline at end of file
index 8c236c1..73c85ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc5c=['serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','picklist','nameField','customField','content','toString','includes','idField','toLowerCase','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','userId','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash'];(function(_0x89ec94,_0x4eaba1){var _0x17cac6=function(_0x375b14){while(--_0x375b14){_0x89ec94['push'](_0x89ec94['shift']());}};_0x17cac6(++_0x4eaba1);}(_0xcc5c,0xef));var _0xccc5=function(_0x408aff,_0x26369b){_0x408aff=_0x408aff-0x0;var _0x32494e=_0xcc5c[_0x408aff];return _0x32494e;};'use strict';var _=require(_0xccc5('0x0'));var Promise=require(_0xccc5('0x1'));var rp=require(_0xccc5('0x2'));var util=require(_0xccc5('0x3'));var md5=require(_0xccc5('0x4'));var Redis=require(_0xccc5('0x5'));var intUtil=require(_0xccc5('0x6'));var config=require('../../../../config/environment');var logger=require(_0xccc5('0x7'))(_0xccc5('0x8'));config[_0xccc5('0x9')]=_[_0xccc5('0xa')](config[_0xccc5('0x9')],{'host':_0xccc5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xccc5('0x9')]));function getAdminUser(_0x53102b,_0x434f7e,_0x1eaee2,_0x46830c,_0x68702e,_0x7b3323){return new Promise(function(_0x43e4da,_0x17d5eb){var _0x24d626={'method':_0xccc5('0xc'),'uri':_0x46830c+_0xccc5('0xd')+'&'+_0x68702e+'&'+_0x7b3323,'auth':_0x434f7e,'json':!![]};return rp(_0x24d626)[_0xccc5('0xe')](function(_0x29c60c){if(_0x29c60c[_0xccc5('0xf')][_0xccc5('0x10')]>0x0){_0x1eaee2[_0xccc5('0x11')]=_0x29c60c[_0xccc5('0xf')][0x0][_0xccc5('0x12')];}logger[_0xccc5('0x13')]('['+[_0x53102b[_0xccc5('0x14')]()]+_0xccc5('0x15'),_0x1eaee2);_0x43e4da(_0x1eaee2);})[_0xccc5('0x16')](function(_0x3b9e05){logger[_0xccc5('0x17')]('['+[_0x53102b['toUpperCase']()]+']',_0x3b9e05[_0xccc5('0x18')]);_0x17d5eb(_0x3b9e05[_0xccc5('0x18')]);});});}function getUser(_0x3db379,_0x52e3ea,_0x3226a0,_0x202456,_0x38868a){return function(_0x162568){logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x19'),_0x162568);return new Promise(function(_0x1addda,_0x3a2cd4){if(intUtil['validateEmail'](_0x162568[_0xccc5('0x1a')])){var _0x543a86={'method':'GET','uri':_0x3226a0+_0xccc5('0x1b')+_0x162568[_0xccc5('0x1a')]+'&'+_0x202456+'&'+_0x38868a,'auth':_0x52e3ea,'json':!![]};logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+'],\x20getUser\x20rp\x20obj',_0x543a86);return rp(_0x543a86)[_0xccc5('0xe')](function(_0x2749eb){logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x1c'),_0x2749eb);if(_0x2749eb[_0xccc5('0xf')][_0xccc5('0x10')]>0x0&&String(_0x2749eb[_0xccc5('0xf')][0x0][_0xccc5('0x1d')])===_0xccc5('0x1e')){_0x162568['userId']=_0x2749eb['result'][0x0][_0xccc5('0x12')];}else{_0x162568['userId']=_0x162568[_0xccc5('0x11')];_0x162568['userEmail']=_0x162568[_0xccc5('0x1f')];}logger['info']('['+[_0x3db379[_0xccc5('0x14')]()]+_0xccc5('0x20'),_0x162568);_0x1addda(_0x162568);})[_0xccc5('0x16')](function(_0xc4395f){logger[_0xccc5('0x17')]('['+[_0x3db379[_0xccc5('0x14')]()]+']',_0xc4395f[_0xccc5('0x18')]);_0x3a2cd4(_0xc4395f[_0xccc5('0x18')]);});}else{logger[_0xccc5('0x13')]('['+[_0x3db379['toUpperCase']()]+_0xccc5('0x21'));_0x162568['userId']=_0x162568['adminId'];_0x162568['userEmail']=_0x162568['adminEmail'];_0x1addda(_0x162568);}});};}function createEndUser(_0x2c6baa,_0x401cb1,_0x48f015,_0x17dbbb,_0x1e8164){logger[_0xccc5('0x13')]('['+[_0x2c6baa['toUpperCase']()]+_0xccc5('0x22'),_0x48f015);return new Promise(function(_0x376697,_0x3bcab3){var _0x522049={'method':_0xccc5('0x23'),'uri':_0x17dbbb+_0xccc5('0x24')+_0x1e8164,'body':{'user_name':_0x48f015[_0xccc5('0x25')],'roles':_0xccc5('0x26'),'first_name':_0x48f015['endUserNumber'],'active':_0xccc5('0x1e'),'date_format':_0xccc5('0x27'),'phone':_0x48f015[_0xccc5('0x25')]},'auth':_0x401cb1,'json':!![]};return rp(_0x522049)[_0xccc5('0xe')](function(_0x570c7d){logger['info']('['+[_0x2c6baa['toUpperCase']()]+'],\x20EndUser\x20schema',_0x570c7d['result']);_0x48f015[_0xccc5('0x28')]=_0x570c7d[_0xccc5('0xf')][_0xccc5('0x12')];_0x376697(_0x48f015);})[_0xccc5('0x16')](function(_0x41b85c){logger['error']('['+[_0x2c6baa['toUpperCase']()]+']',_0x41b85c[_0xccc5('0x18')]);_0x3bcab3(_0x41b85c[_0xccc5('0x18')]);});});}function getEndUser(_0x314fc3,_0x1202f8,_0x2eb0c5,_0x203dc3,_0xab7e74){return function(_0x593654){logger[_0xccc5('0x13')]('['+[_0x314fc3['toUpperCase']()]+_0xccc5('0x29'),_0x593654);return new Promise(function(_0x347d7e,_0x139d48){var _0x2d2f56={'method':'GET','uri':_0x2eb0c5+_0xccc5('0x2a')+_0x593654[_0xccc5('0x25')]+'&'+_0x203dc3+'&'+_0xab7e74,'auth':_0x1202f8,'json':!![]};return rp(_0x2d2f56)['then'](function(_0x22c55e){if(_0x22c55e['result'][_0xccc5('0x10')]>0x0){_0x593654[_0xccc5('0x28')]=_0x22c55e['result'][0x0][_0xccc5('0x12')];logger[_0xccc5('0x13')]('['+[_0x314fc3[_0xccc5('0x14')]()]+'],\x20getEndUser\x20crm',_0x593654);_0x347d7e(_0x593654);}else{return createEndUser(_0x314fc3,_0x1202f8,_0x593654,_0x2eb0c5,_0x203dc3)['then'](function(_0x18ffca){logger[_0xccc5('0x13')]('['+[_0x314fc3[_0xccc5('0x14')]()]+_0xccc5('0x2b'),_0x18ffca);_0x347d7e(_0x18ffca);});}})['catch'](function(_0x308d96){logger['error']('['+[_0x314fc3['toUpperCase']()]+']',_0x308d96[_0xccc5('0x18')]);_0x139d48(_0x308d96[_0xccc5('0x18')]);});});};}function getCustomFields(_0x3f0733,_0xb6eed){var _0x12780e={};if(_0x3f0733[_0xccc5('0x10')]>0x0){_[_0xccc5('0x2c')](_0x3f0733,function(_0x377670){if(_['includes'](['string',_0xccc5('0x2d')],_0x377670['type'])&&_0x377670[_0xccc5('0x2e')]&&!_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670[_0xccc5('0x2e')]['toLowerCase']()]=_0x377670[_0xccc5('0x30')][_0xccc5('0x31')]();}else if(_[_0xccc5('0x32')](['string','picklist'],_0x377670['type'])&&_0x377670[_0xccc5('0x33')]&&_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0x377670[_0xccc5('0x30')][_0xccc5('0x31')]();}else if(_0x377670[_0xccc5('0x35')]===_0xccc5('0x36')&&_0x377670['variableName']&&_0x377670['idField']&&_0x377670['customField']){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0xb6eed[_0x377670[_0xccc5('0x37')]][_0xccc5('0x31')]();}else if(_0x377670[_0xccc5('0x35')]===_0xccc5('0x38')&&_0x377670['Variable']&&_0x377670[_0xccc5('0x39')][_0xccc5('0x3a')]&&_0x377670[_0xccc5('0x33')]&&_0x377670[_0xccc5('0x2f')]){_0x12780e[_0x377670['idField'][_0xccc5('0x34')]()]=_0xb6eed[_0x377670[_0xccc5('0x39')][_0xccc5('0x3a')]['toLowerCase']()][_0xccc5('0x31')]();}});}return _0x12780e;}function getTicket(_0x5ecc0c,_0x575d69,_0x55018f,_0x5f4ecd,_0xb4f8bc,_0x529b61){return function(_0x2b25d6){logger[_0xccc5('0x13')]('['+[_0x5ecc0c['toUpperCase']()]+_0xccc5('0x3b'),_0x2b25d6);return new Promise(function(_0x566e6d,_0x28966b){var _0x1f4a19=_0x5ecc0c['toLowerCase']()==='outbound'?_0x2b25d6['userId']:_0x2b25d6[_0xccc5('0x28')];var _0x7a3ef9={'method':_0xccc5('0x23'),'uri':_0x55018f+_0xccc5('0x3c')+'?'+_0x529b61,'body':Object[_0xccc5('0x3d')]({},{'active':_0xccc5('0x1e'),'caller_id':_0x1f4a19,'assigned_to':_0x2b25d6[_0xccc5('0x3e')],'short_description':intUtil[_0xccc5('0x3f')](_0x5f4ecd[_0xccc5('0x40')],_0xb4f8bc,'\x20'),'description':intUtil[_0xccc5('0x3f')](_0x5f4ecd[_0xccc5('0x41')],_0xb4f8bc,'\x0a')},getCustomFields(_0x5f4ecd['Fields'],_0xb4f8bc)),'auth':_0x575d69,'json':!![]};return rp(_0x7a3ef9)['then'](function(_0x4af975){logger['info']('['+[_0x5ecc0c[_0xccc5('0x14')]()]+_0xccc5('0x42'),_0x4af975['result']);_0x2b25d6[_0xccc5('0x43')]=_0x4af975[_0xccc5('0xf')]['sys_id'];_0x2b25d6[_0xccc5('0x44')]=_0x4af975[_0xccc5('0xf')][_0xccc5('0x45')];logger[_0xccc5('0x13')]('['+[_0x5ecc0c[_0xccc5('0x14')]()]+_0xccc5('0x46'),_0x2b25d6);_0x566e6d(_0x2b25d6);})[_0xccc5('0x16')](function(_0x6dd873){logger['error']('['+[_0x5ecc0c[_0xccc5('0x14')]()]+']',_0x6dd873[_0xccc5('0x18')]);_0x28966b(_0x6dd873[_0xccc5('0x18')]);});});};}function createRemoteTag(_0x155976,_0x5ba029,_0x441f94,_0x53da05){return new Promise(function(_0x487fa,_0x59eada){var _0x17ab66={'method':'POST','uri':_0x441f94+_0xccc5('0x47')+'?'+_0x53da05,'body':{'short_description':_0x155976,'global':!![],'active':!![],'name':_0x155976},'auth':_0x5ba029,'json':!![]};return rp(_0x17ab66)[_0xccc5('0xe')](function(_0x119098){var _0x4acdc0=_0x119098[_0xccc5('0xf')]['sys_id'];_0x487fa(_0x4acdc0);});});}function getRemoteTag(_0x163253,_0x388189,_0x303167,_0x2c75b2,_0x1624df){return new Promise(function(_0x2bd7a6,_0x311205){var _0x1e2db4={'method':_0xccc5('0xc'),'uri':_0x303167+_0xccc5('0x47')+_0xccc5('0x48')+_0x163253+'&'+_0x2c75b2,'auth':_0x388189,'json':!![]};return rp(_0x1e2db4)[_0xccc5('0xe')](function(_0xa151b){if(_0xa151b[_0xccc5('0xf')]['length']>0x0){var _0x1ffec3=_0xa151b[_0xccc5('0xf')][0x0][_0xccc5('0x12')];_0x2bd7a6(_0x1ffec3);}else{return createRemoteTag(_0x163253,_0x388189,_0x303167,_0x2c75b2)[_0xccc5('0xe')](function(_0x4b4d3b){_0x2bd7a6(_0x4b4d3b);});}});});}function assignTagToIncident(_0x44a7e1,_0x47bfcd,_0x19c57a,_0x274e2c,_0x1eaa06){return new Promise(function(_0x186239,_0x5ce41b){var _0x47245c={'method':'POST','uri':_0x19c57a+'label_entry'+'?'+_0x1eaa06,'body':{'label':_0x44a7e1,'table':_0xccc5('0x3c'),'id_type':_0xccc5('0x49'),'table_key':_0x274e2c['ticketId'],'title':'Incident\x20-\x20'+_0x274e2c[_0xccc5('0x44')],'id_display':_0x274e2c['ticketNumber']},'auth':_0x47bfcd,'json':!![]};return rp(_0x47245c)['then'](function(_0x390db0){_0x186239();})['catch'](function(){_0x186239();});});}function manageTags(_0xeea54f,_0x4c890e,_0x2a0a08,_0x42c302,_0x435cbb,_0x582546,_0x198057){return new Promise(function(_0x432985,_0x1b7709){var _0xee82b7=[];_0x4c890e[_0xccc5('0x2c')](function(_0x346b10){_0xee82b7['push'](getRemoteTag(_0x346b10,_0x2a0a08,_0x42c302,_0x582546,_0x198057));});return Promise[_0xccc5('0x4a')](_0xee82b7)[_0xccc5('0xe')](function(_0x56429d){if(_0x56429d['length']){logger[_0xccc5('0x13')]('['+[_0xeea54f[_0xccc5('0x14')]()]+_0xccc5('0x4b'),_0x56429d);var _0x5c8e81=[];_0x56429d[_0xccc5('0x2c')](function(_0x5e2c75){_0x5c8e81[_0xccc5('0x4c')](assignTagToIncident(_0x5e2c75,_0x2a0a08,_0x42c302,_0x435cbb,_0x582546));});return Promise[_0xccc5('0x4a')](_0x5c8e81)[_0xccc5('0xe')](function(){_0x432985();})['catch'](function(){_0x432985();});}else{_0x432985();}});});}function getTags(_0x1d0e24,_0x42e5da,_0x159c72,_0x4ab57b,_0x2833f9,_0x4a3160){return function(_0x378d24){return new Promise(function(_0x2530be,_0x1867ba){var _0x4e59fe=[];var _0x1e7c0d=_0x4ab57b['Tags'];if(_0x1e7c0d&&_0x1e7c0d[_0xccc5('0x10')]>0x0){_0x4e59fe=_['map'](_0x1e7c0d,'name');}if(_0x4e59fe[_0xccc5('0x10')]>0x0){return manageTags(_0x1d0e24,_0x4e59fe,_0x42e5da,_0x159c72,_0x378d24,_0x2833f9,_0x4a3160)['then'](function(){_0x2530be(_0x378d24);});}else{_0x2530be(_0x378d24);}});};}function emit(_0x3c410b,_0x46cae8,_0x2eafd0){var _0xbad5b6=_0xccc5('0x4d')+_0xccc5('0x4e')+_0xccc5('0x4f')+_0xccc5('0x50');var _0x44e3b3={'uri':_0x3c410b+_0xccc5('0x51')+_0x2eafd0+_0xbad5b6};io['to'](util[_0xccc5('0x52')](_0xccc5('0x53'),_0x46cae8))[_0xccc5('0x54')](_0xccc5('0x55'),_0x44e3b3);}exports['cs']=function(_0x236121,_0xc6cf83,_0x1114b7,_0x550895,_0x5bb84b,_0x21b653,_0x142aea,_0xa8402){var _0x13a830={};var _0x25160d={'user':_0x21b653[_0xccc5('0x56')],'pass':_0x21b653[_0xccc5('0x57')]};var _0x3249b7=_0xccc5('0x58');var _0x1e3bf0='sysparm_display_value=true';_0x21b653[_0xccc5('0x59')]=intUtil[_0xccc5('0x5a')](_0x21b653[_0xccc5('0x59')]);_0x21b653[_0xccc5('0x5b')]=intUtil[_0xccc5('0x5a')](_0x21b653[_0xccc5('0x5b')]);var _0xb4840f=util['format'](_0xccc5('0x5c'),_0x21b653[_0xccc5('0x59')]);_0x13a830[_0xccc5('0x1a')]=!_[_0xccc5('0x5d')](_0x550895)?_0x550895[_0xccc5('0x5e')]:null;_0x13a830['adminEmail']=_0x21b653[_0xccc5('0x5e')];_0x13a830[_0xccc5('0x25')]=_0xa8402['toLowerCase']()===_0xccc5('0x5f')?_0xc6cf83[_0xccc5('0x60')]:_0xc6cf83[_0xccc5('0x61')];_0x13a830['callDirection']=_0xa8402===_0xccc5('0x62')||_0xa8402==='unmanaged'?_0xccc5('0x62'):_0xccc5('0x5f');var _0x401297=util['format'](_0xccc5('0x63'),_0x21b653[_0xccc5('0x5b')],_0xc6cf83[_0xccc5('0x64')],md5(_0xc6cf83[_0xccc5('0x64')]));if(_0x5bb84b&&_0x5bb84b[_0xccc5('0x65')]){logger['info']('[QUEUE]',_0xccc5('0x66'));_0xc6cf83[_0xccc5('0x67')]=_0x401297;}else if(_0x142aea&&_0x142aea[_0xccc5('0x68')]&&_0x142aea[_0xccc5('0x68')]!=='none'){logger[_0xccc5('0x13')]('[OUTBOUND]',_0xccc5('0x66'));_0xc6cf83[_0xccc5('0x67')]=_0x401297;}else{_0xc6cf83[_0xccc5('0x67')]='';}return getAdminUser(_0xa8402,_0x25160d,_0x13a830,_0xb4840f,_0x1e3bf0,_0x3249b7)[_0xccc5('0xe')](getUser(_0xa8402,_0x25160d,_0xb4840f,_0x1e3bf0,_0x3249b7))['then'](getEndUser(_0xa8402,_0x25160d,_0xb4840f,_0x1e3bf0,_0x3249b7))['then'](getTicket(_0xa8402,_0x25160d,_0xb4840f,_0x1114b7,_0xc6cf83,_0x1e3bf0))[_0xccc5('0xe')](function(_0x80eab){logger[_0xccc5('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x80eab[_0xccc5('0x43')]));logger['info'](util[_0xccc5('0x52')](_0xccc5('0x69'),_0xa8402));if(_0xa8402!==_0xccc5('0x6a')){logger[_0xccc5('0x13')]('['+[_0xa8402[_0xccc5('0x14')]()]+']',_0xccc5('0x6b'));emit(_0x21b653[_0xccc5('0x59')],_0x550895['name'],_0x80eab[_0xccc5('0x43')]);}})[_0xccc5('0x16')](function(_0x3e73c4){logger[_0xccc5('0x17')]('['+[_0xa8402[_0xccc5('0x14')]()]+_0xccc5('0x6c'),util[_0xccc5('0x6d')](_0x3e73c4,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x78af=['md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','message','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','GET','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','string','picklist','nameField','customField','toLowerCase','content','toString','includes','type','idField','variable','variableName','customVariable','Variable','name','outbound','incident','assign','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','bluebird'];(function(_0x5d1ed9,_0xe619d6){var _0x2c243c=function(_0x3fb09f){while(--_0x3fb09f){_0x5d1ed9['push'](_0x5d1ed9['shift']());}};_0x2c243c(++_0xe619d6);}(_0x78af,0x1b3));var _0xf78a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x78af[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var Promise=require(_0xf78a('0x0'));var rp=require('request-promise');var util=require('util');var md5=require(_0xf78a('0x1'));var Redis=require(_0xf78a('0x2'));var intUtil=require(_0xf78a('0x3'));var config=require(_0xf78a('0x4'));var logger=require(_0xf78a('0x5'))(_0xf78a('0x6'));config[_0xf78a('0x7')]=_[_0xf78a('0x8')](config[_0xf78a('0x7')],{'host':_0xf78a('0x9'),'port':0x18eb});var io=require(_0xf78a('0xa'))(new Redis(config[_0xf78a('0x7')]));function getAdminUser(_0x2029bd,_0x183801,_0x460d54,_0x35e784,_0x5079b0,_0x2d25e7){return new Promise(function(_0xf8be23,_0x5cd44e){var _0x1a5611={'method':'GET','uri':_0x35e784+_0xf78a('0xb')+'&'+_0x5079b0+'&'+_0x2d25e7,'auth':_0x183801,'json':!![]};return rp(_0x1a5611)[_0xf78a('0xc')](function(_0x3c57e5){if(_0x3c57e5[_0xf78a('0xd')]['length']>0x0){_0x460d54[_0xf78a('0xe')]=_0x3c57e5[_0xf78a('0xd')][0x0][_0xf78a('0xf')];}logger[_0xf78a('0x10')]('['+[_0x2029bd['toUpperCase']()]+_0xf78a('0x11'),_0x460d54);_0xf8be23(_0x460d54);})[_0xf78a('0x12')](function(_0x3df8d7){logger[_0xf78a('0x13')]('['+[_0x2029bd[_0xf78a('0x14')]()]+']',_0x3df8d7['message']);_0x5cd44e(_0x3df8d7['message']);});});}function getUser(_0xe2ab48,_0x50fa58,_0x6dca76,_0x299eae,_0x240b73){return function(_0x4ec739){logger[_0xf78a('0x10')]('['+[_0xe2ab48[_0xf78a('0x14')]()]+_0xf78a('0x15'),_0x4ec739);return new Promise(function(_0x4b756c,_0x1ec586){if(intUtil[_0xf78a('0x16')](_0x4ec739[_0xf78a('0x17')])){var _0x5d00ed={'method':'GET','uri':_0x6dca76+_0xf78a('0x18')+_0x4ec739['userEmail']+'&'+_0x299eae+'&'+_0x240b73,'auth':_0x50fa58,'json':!![]};logger['info']('['+[_0xe2ab48['toUpperCase']()]+_0xf78a('0x19'),_0x5d00ed);return rp(_0x5d00ed)[_0xf78a('0xc')](function(_0x1b0eab){logger['info']('['+[_0xe2ab48['toUpperCase']()]+_0xf78a('0x1a'),_0x1b0eab);if(_0x1b0eab[_0xf78a('0xd')][_0xf78a('0x1b')]>0x0&&String(_0x1b0eab[_0xf78a('0xd')][0x0][_0xf78a('0x1c')])===_0xf78a('0x1d')){_0x4ec739[_0xf78a('0x1e')]=_0x1b0eab['result'][0x0][_0xf78a('0xf')];}else{_0x4ec739[_0xf78a('0x1e')]=_0x4ec739['adminId'];_0x4ec739[_0xf78a('0x17')]=_0x4ec739[_0xf78a('0x1f')];}logger[_0xf78a('0x10')]('['+[_0xe2ab48[_0xf78a('0x14')]()]+'],\x20getUser\x20crm',_0x4ec739);_0x4b756c(_0x4ec739);})['catch'](function(_0x102c83){logger[_0xf78a('0x13')]('['+[_0xe2ab48[_0xf78a('0x14')]()]+']',_0x102c83[_0xf78a('0x20')]);_0x1ec586(_0x102c83[_0xf78a('0x20')]);});}else{logger[_0xf78a('0x10')]('['+[_0xe2ab48[_0xf78a('0x14')]()]+']\x20using\x20admin\x20profile');_0x4ec739[_0xf78a('0x1e')]=_0x4ec739[_0xf78a('0xe')];_0x4ec739['userEmail']=_0x4ec739[_0xf78a('0x1f')];_0x4b756c(_0x4ec739);}});};}function createEndUser(_0x185952,_0x40a0bb,_0xcddd5b,_0x417300,_0x16913b){logger['info']('['+[_0x185952['toUpperCase']()]+_0xf78a('0x21'),_0xcddd5b);return new Promise(function(_0x224fd1,_0x2d4673){var _0x4c205e={'method':_0xf78a('0x22'),'uri':_0x417300+_0xf78a('0x23')+_0x16913b,'body':{'user_name':_0xcddd5b[_0xf78a('0x24')],'roles':_0xf78a('0x25'),'first_name':_0xcddd5b['endUserNumber'],'active':_0xf78a('0x1d'),'date_format':_0xf78a('0x26'),'phone':_0xcddd5b['endUserNumber']},'auth':_0x40a0bb,'json':!![]};return rp(_0x4c205e)['then'](function(_0x52046e){logger['info']('['+[_0x185952[_0xf78a('0x14')]()]+'],\x20EndUser\x20schema',_0x52046e['result']);_0xcddd5b[_0xf78a('0x27')]=_0x52046e[_0xf78a('0xd')][_0xf78a('0xf')];_0x224fd1(_0xcddd5b);})[_0xf78a('0x12')](function(_0x43c20c){logger[_0xf78a('0x13')]('['+[_0x185952[_0xf78a('0x14')]()]+']',_0x43c20c[_0xf78a('0x20')]);_0x2d4673(_0x43c20c[_0xf78a('0x20')]);});});}function getEndUser(_0x58add9,_0x312c14,_0x20a120,_0x357552,_0x524984){return function(_0x41533c){logger[_0xf78a('0x10')]('['+[_0x58add9['toUpperCase']()]+_0xf78a('0x28'),_0x41533c);return new Promise(function(_0x2307b7,_0x63a4d8){var _0x277af4={'method':_0xf78a('0x29'),'uri':_0x20a120+_0xf78a('0x2a')+_0x41533c[_0xf78a('0x24')]+'&'+_0x357552+'&'+_0x524984,'auth':_0x312c14,'json':!![]};return rp(_0x277af4)['then'](function(_0x364179){if(_0x364179[_0xf78a('0xd')][_0xf78a('0x1b')]>0x0){_0x41533c[_0xf78a('0x27')]=_0x364179['result'][0x0][_0xf78a('0xf')];logger[_0xf78a('0x10')]('['+[_0x58add9[_0xf78a('0x14')]()]+_0xf78a('0x2b'),_0x41533c);_0x2307b7(_0x41533c);}else{return createEndUser(_0x58add9,_0x312c14,_0x41533c,_0x20a120,_0x357552)[_0xf78a('0xc')](function(_0x55490c){logger[_0xf78a('0x10')]('['+[_0x58add9[_0xf78a('0x14')]()]+'],\x20createEndUser\x20crm',_0x55490c);_0x2307b7(_0x55490c);});}})[_0xf78a('0x12')](function(_0x4d62cb){logger[_0xf78a('0x13')]('['+[_0x58add9[_0xf78a('0x14')]()]+']',_0x4d62cb[_0xf78a('0x20')]);_0x63a4d8(_0x4d62cb[_0xf78a('0x20')]);});});};}function getCustomFields(_0x12ce0a,_0x27bd8){var _0x59369b={};if(_0x12ce0a['length']>0x0){_[_0xf78a('0x2c')](_0x12ce0a,function(_0x3e4d63){if(_['includes']([_0xf78a('0x2d'),_0xf78a('0x2e')],_0x3e4d63['type'])&&_0x3e4d63[_0xf78a('0x2f')]&&!_0x3e4d63[_0xf78a('0x30')]){_0x59369b[_0x3e4d63[_0xf78a('0x2f')][_0xf78a('0x31')]()]=_0x3e4d63[_0xf78a('0x32')][_0xf78a('0x33')]();}else if(_[_0xf78a('0x34')]([_0xf78a('0x2d'),_0xf78a('0x2e')],_0x3e4d63[_0xf78a('0x35')])&&_0x3e4d63[_0xf78a('0x36')]&&_0x3e4d63[_0xf78a('0x30')]){_0x59369b[_0x3e4d63[_0xf78a('0x36')][_0xf78a('0x31')]()]=_0x3e4d63['content'][_0xf78a('0x33')]();}else if(_0x3e4d63[_0xf78a('0x35')]===_0xf78a('0x37')&&_0x3e4d63['variableName']&&_0x3e4d63['idField']&&_0x3e4d63[_0xf78a('0x30')]){_0x59369b[_0x3e4d63[_0xf78a('0x36')][_0xf78a('0x31')]()]=_0x27bd8[_0x3e4d63[_0xf78a('0x38')]][_0xf78a('0x33')]();}else if(_0x3e4d63[_0xf78a('0x35')]===_0xf78a('0x39')&&_0x3e4d63['Variable']&&_0x3e4d63[_0xf78a('0x3a')]['name']&&_0x3e4d63[_0xf78a('0x36')]&&_0x3e4d63[_0xf78a('0x30')]){_0x59369b[_0x3e4d63['idField'][_0xf78a('0x31')]()]=_0x27bd8[_0x3e4d63[_0xf78a('0x3a')][_0xf78a('0x3b')][_0xf78a('0x31')]()]['toString']();}});}return _0x59369b;}function getTicket(_0x38c555,_0x460d80,_0x1e69a8,_0x1a5762,_0x309d4f,_0x5bb139){return function(_0xfa773f){logger[_0xf78a('0x10')]('['+[_0x38c555[_0xf78a('0x14')]()]+']\x20getTicket\x20input\x20crm',_0xfa773f);return new Promise(function(_0xcf0485,_0x2889f4){var _0x18bd5d=_0x38c555[_0xf78a('0x31')]()===_0xf78a('0x3c')?_0xfa773f[_0xf78a('0x1e')]:_0xfa773f[_0xf78a('0x27')];var _0x17e309={'method':_0xf78a('0x22'),'uri':_0x1e69a8+_0xf78a('0x3d')+'?'+_0x5bb139,'body':Object[_0xf78a('0x3e')]({},{'active':'true','caller_id':_0x18bd5d,'assigned_to':_0xfa773f[_0xf78a('0x1e')],'short_description':intUtil[_0xf78a('0x3f')](_0x1a5762['Subjects'],_0x309d4f,'\x20'),'description':intUtil['getString'](_0x1a5762[_0xf78a('0x40')],_0x309d4f,'\x0a')},getCustomFields(_0x1a5762['Fields'],_0x309d4f)),'auth':_0x460d80,'json':!![]};return rp(_0x17e309)[_0xf78a('0xc')](function(_0x48874e){logger[_0xf78a('0x10')]('['+[_0x38c555[_0xf78a('0x14')]()]+_0xf78a('0x41'),_0x48874e[_0xf78a('0xd')]);_0xfa773f[_0xf78a('0x42')]=_0x48874e[_0xf78a('0xd')][_0xf78a('0xf')];_0xfa773f[_0xf78a('0x43')]=_0x48874e[_0xf78a('0xd')]['number'];logger['info']('['+[_0x38c555['toUpperCase']()]+']\x20getTicket\x20crm',_0xfa773f);_0xcf0485(_0xfa773f);})[_0xf78a('0x12')](function(_0x489657){logger['error']('['+[_0x38c555[_0xf78a('0x14')]()]+']',_0x489657[_0xf78a('0x20')]);_0x2889f4(_0x489657['message']);});});};}function createRemoteTag(_0x11c480,_0x29d068,_0x8b3e07,_0x2de435){return new Promise(function(_0x5db697,_0x14bb13){var _0x4463e9={'method':_0xf78a('0x22'),'uri':_0x8b3e07+_0xf78a('0x44')+'?'+_0x2de435,'body':{'short_description':_0x11c480,'global':!![],'active':!![],'name':_0x11c480},'auth':_0x29d068,'json':!![]};return rp(_0x4463e9)[_0xf78a('0xc')](function(_0x2f5f9c){var _0x1e5620=_0x2f5f9c['result']['sys_id'];_0x5db697(_0x1e5620);});});}function getRemoteTag(_0x2b88fd,_0x53c3c3,_0x35a4db,_0x5c3591,_0x39f198){return new Promise(function(_0x3e792c,_0x2960eb){var _0x1e6cbe={'method':_0xf78a('0x29'),'uri':_0x35a4db+'label'+_0xf78a('0x45')+_0x2b88fd+'&'+_0x5c3591,'auth':_0x53c3c3,'json':!![]};return rp(_0x1e6cbe)[_0xf78a('0xc')](function(_0x533d10){if(_0x533d10[_0xf78a('0xd')]['length']>0x0){var _0x3b00bf=_0x533d10[_0xf78a('0xd')][0x0][_0xf78a('0xf')];_0x3e792c(_0x3b00bf);}else{return createRemoteTag(_0x2b88fd,_0x53c3c3,_0x35a4db,_0x5c3591)[_0xf78a('0xc')](function(_0x54e5e0){_0x3e792c(_0x54e5e0);});}});});}function assignTagToIncident(_0x3c90bf,_0x4555bb,_0x14c551,_0x170212,_0x284827){return new Promise(function(_0x4bc1fd,_0x1b8f90){var _0x1dc439={'method':'POST','uri':_0x14c551+_0xf78a('0x46')+'?'+_0x284827,'body':{'label':_0x3c90bf,'table':_0xf78a('0x3d'),'id_type':_0xf78a('0x47'),'table_key':_0x170212[_0xf78a('0x42')],'title':_0xf78a('0x48')+_0x170212[_0xf78a('0x43')],'id_display':_0x170212[_0xf78a('0x43')]},'auth':_0x4555bb,'json':!![]};return rp(_0x1dc439)['then'](function(_0x3a57f8){_0x4bc1fd();})[_0xf78a('0x12')](function(){_0x4bc1fd();});});}function manageTags(_0x3369e0,_0x30acd7,_0x5d8f58,_0x282bfe,_0x38b354,_0x1cd1a4,_0x53b63a){return new Promise(function(_0x4d42a1,_0x21849f){var _0x38ccaa=[];_0x30acd7['forEach'](function(_0x302742){_0x38ccaa[_0xf78a('0x49')](getRemoteTag(_0x302742,_0x5d8f58,_0x282bfe,_0x1cd1a4,_0x53b63a));});return Promise[_0xf78a('0x4a')](_0x38ccaa)['then'](function(_0x5b63a2){if(_0x5b63a2[_0xf78a('0x1b')]){logger[_0xf78a('0x10')]('['+[_0x3369e0['toUpperCase']()]+_0xf78a('0x4b'),_0x5b63a2);var _0x5dd323=[];_0x5b63a2[_0xf78a('0x2c')](function(_0x5efea6){_0x5dd323[_0xf78a('0x49')](assignTagToIncident(_0x5efea6,_0x5d8f58,_0x282bfe,_0x38b354,_0x1cd1a4));});return Promise['all'](_0x5dd323)[_0xf78a('0xc')](function(){_0x4d42a1();})[_0xf78a('0x12')](function(){_0x4d42a1();});}else{_0x4d42a1();}});});}function getTags(_0x45175b,_0x45b8c4,_0x68c52b,_0x133b59,_0x11291f,_0xbd6583){return function(_0x4ff3fe){return new Promise(function(_0x5ac6c6,_0x109bf3){var _0x1d454d=[];var _0x1d02a3=_0x133b59[_0xf78a('0x4c')];if(_0x1d02a3&&_0x1d02a3[_0xf78a('0x1b')]>0x0){_0x1d454d=_['map'](_0x1d02a3,'name');}if(_0x1d454d[_0xf78a('0x1b')]>0x0){return manageTags(_0x45175b,_0x1d454d,_0x45b8c4,_0x68c52b,_0x4ff3fe,_0x11291f,_0xbd6583)[_0xf78a('0xc')](function(){_0x5ac6c6(_0x4ff3fe);});}else{_0x5ac6c6(_0x4ff3fe);}});};}function emit(_0x164a5a,_0x3e590d,_0x40ab57){var _0x3b7589=_0xf78a('0x4d')+_0xf78a('0x4e')+_0xf78a('0x4f')+_0xf78a('0x50');var _0x4d1139={'uri':_0x164a5a+_0xf78a('0x51')+_0x40ab57+_0x3b7589};io['to'](util[_0xf78a('0x52')](_0xf78a('0x53'),_0x3e590d))[_0xf78a('0x54')](_0xf78a('0x55'),_0x4d1139);}exports['cs']=function(_0x298fd4,_0x1c6201,_0x199afc,_0x5bfd9a,_0x26b6ba,_0x507f87,_0xa31af5,_0xcbeb9c){var _0x4e9e75={};var _0x44b383={'user':_0x507f87[_0xf78a('0x56')],'pass':_0x507f87[_0xf78a('0x57')]};var _0x5be152=_0xf78a('0x58');var _0x74a3e4='sysparm_display_value=true';_0x507f87[_0xf78a('0x59')]=intUtil[_0xf78a('0x5a')](_0x507f87[_0xf78a('0x59')]);_0x507f87[_0xf78a('0x5b')]=intUtil[_0xf78a('0x5a')](_0x507f87['serverUrl']);var _0x32e204=util[_0xf78a('0x52')](_0xf78a('0x5c'),_0x507f87['remoteUri']);_0x4e9e75['userEmail']=!_[_0xf78a('0x5d')](_0x5bfd9a)?_0x5bfd9a[_0xf78a('0x5e')]:null;_0x4e9e75[_0xf78a('0x1f')]=_0x507f87[_0xf78a('0x5e')];_0x4e9e75[_0xf78a('0x24')]=_0xcbeb9c['toLowerCase']()===_0xf78a('0x3c')?_0x1c6201[_0xf78a('0x5f')]:_0x1c6201[_0xf78a('0x60')];_0x4e9e75['callDirection']=_0xcbeb9c===_0xf78a('0x61')||_0xcbeb9c===_0xf78a('0x62')?'queue':_0xf78a('0x3c');var _0x2ffd6d=util[_0xf78a('0x52')](_0xf78a('0x63'),_0x507f87[_0xf78a('0x5b')],_0x1c6201['uniqueid'],md5(_0x1c6201[_0xf78a('0x64')]));if(_0x26b6ba&&_0x26b6ba[_0xf78a('0x65')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x1c6201[_0xf78a('0x66')]=_0x2ffd6d;}else if(_0xa31af5&&_0xa31af5[_0xf78a('0x67')]&&_0xa31af5['recordingFormat']!=='none'){logger[_0xf78a('0x10')](_0xf78a('0x68'),_0xf78a('0x69'));_0x1c6201['recordingURL']=_0x2ffd6d;}else{_0x1c6201[_0xf78a('0x66')]='';}return getAdminUser(_0xcbeb9c,_0x44b383,_0x4e9e75,_0x32e204,_0x74a3e4,_0x5be152)['then'](getUser(_0xcbeb9c,_0x44b383,_0x32e204,_0x74a3e4,_0x5be152))[_0xf78a('0xc')](getEndUser(_0xcbeb9c,_0x44b383,_0x32e204,_0x74a3e4,_0x5be152))[_0xf78a('0xc')](getTicket(_0xcbeb9c,_0x44b383,_0x32e204,_0x199afc,_0x1c6201,_0x74a3e4))[_0xf78a('0xc')](function(_0x2293f7){logger['info'](util[_0xf78a('0x52')](_0xf78a('0x6a'),_0x2293f7[_0xf78a('0x42')]));logger['info'](util[_0xf78a('0x52')](_0xf78a('0x6b'),_0xcbeb9c));if(_0xcbeb9c!=='unmanaged'){logger[_0xf78a('0x10')]('['+[_0xcbeb9c[_0xf78a('0x14')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x507f87['remoteUri'],_0x5bfd9a[_0xf78a('0x3b')],_0x2293f7[_0xf78a('0x42')]);}})[_0xf78a('0x12')](function(_0x31fa71){logger[_0xf78a('0x13')]('['+[_0xcbeb9c[_0xf78a('0x14')]()]+_0xf78a('0x6c'),util['inspect'](_0x31fa71,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6e42b72..f2008dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa51e=['JSON','Calls','format','Basic\x20%s','apiKey','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','debug','[HTTP]','merge','map','forEach','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','customVariable','Variable','PLAIN','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','unmanaged','lastevent','toUpperCase','calleridnum','The\x20Ticket\x20ID\x20is:','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description','getString','date_start','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','variableName','push','idField'];(function(_0xabcbf0,_0x1046df){var _0x292f2f=function(_0x3badf9){while(--_0x3badf9){_0xabcbf0['push'](_0xabcbf0['shift']());}};_0x292f2f(++_0x1046df);}(_0xa51e,0xcb));var _0xea51=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xa51e[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xea51('0x0'));var md5=require(_0xea51('0x1'));var util=require(_0xea51('0x2'));var Redis=require(_0xea51('0x3'));var intUtil=require(_0xea51('0x4'));var config=require(_0xea51('0x5'));var logger=require(_0xea51('0x6'))('sugarcrm');config['redis']=_[_0xea51('0x7')](config[_0xea51('0x8')],{'host':_0xea51('0x9'),'port':0x18eb});var io=require(_0xea51('0xa'))(new Redis(config['redis']));var def={'method':_0xea51('0xb'),'json':!![]};function emit(_0x2fbef6,_0x1ce0e5,_0xbdec84){io['to'](_0x2fbef6)['emit'](_0x1ce0e5,_0xbdec84);}function getTicket(_0x129eb8,_0xc34529,_0xadb91c,_0x49e128,_0x171ad8,_0x5ec47f,_0x2e4130,_0x3ee1f7){logger[_0xea51('0xc')](_0xea51('0xd'));var _0x3244b8=new Date();var _0xe23fb0=[{'name':'name','value':intUtil['getString'](_0x49e128[_0xea51('0xe')],_0x171ad8,'\x20')},{'name':_0xea51('0xf'),'value':_0xc34529['id']},{'name':_0xea51('0x10'),'value':_0xc34529['id']},{'name':_0xea51('0x11'),'value':intUtil[_0xea51('0x12')](_0x49e128['Descriptions'],_0x171ad8,'\x0a')},{'name':_0xea51('0x13'),'value':_0x3244b8['toISOString']()[_0xea51('0x14')](0x0,0x13)[_0xea51('0x15')]('T','\x20')},{'name':_0xea51('0x16'),'value':'0'},{'name':_0xea51('0x17'),'value':'15'},{'name':_0xea51('0x18'),'value':_0xadb91c['id']},{'name':_0xea51('0x19'),'value':_0xea51('0x1a')},{'name':_0xea51('0x1b'),'value':_0xadb91c[_0xea51('0x1c')]},{'name':'direction','value':_0x3ee1f7}];if(_0x5ec47f[_0xea51('0x1d')]){_['forEach'](_0x5ec47f,function(_0x1c3fb8){if(_0x171ad8[_0x1c3fb8[_0xea51('0x1e')]]){_0xe23fb0[_0xea51('0x1f')]({'name':_0x1c3fb8[_0xea51('0x20')],'value':_0x171ad8[_0x1c3fb8[_0xea51('0x1e')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON['stringify']({'session':_0x2e4130['id'],'module_name':_0xea51('0x22'),'name_value_list':_0xe23fb0})}});}function getAuth(_0xbb62bc){return util[_0xea51('0x23')](_0xea51('0x24'),new Buffer(_0xbb62bc[_0xea51('0x25')]+':X')['toString']('base64'));}function getServerInfo(_0x505243){return request({'form':{'method':_0xea51('0x26'),'input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x505243['id']})}});}function getUser(_0x5880b8,_0x5ec6a7,_0x462914){if(!_[_0xea51('0x28')](_0x5ec6a7)){logger[_0xea51('0xc')](_0xea51('0x29'),_0x5ec6a7);return request({'form':{'method':'get_entry_list','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON['stringify']({'session':_0x462914['id'],'module_name':'Employees','query':util[_0xea51('0x23')](_0xea51('0x2a'),_0x5ec6a7),'order_by':'','offset':'0','select_fields':['id',_0xea51('0x1c'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x517325){if(_0x517325[_0xea51('0x2b')]['length']){var _0x1be63b=_['find'](_0x517325['entry_list'],function(_0x31f49b){return _0x31f49b[_0xea51('0x2c')]['user_name']['value']===_0x5ec6a7;});if(_0x1be63b){logger[_0xea51('0xc')](_0xea51('0x2d'));return BPromise['resolve']({'id':_0x1be63b['name_value_list']['id']['value'],'name':_0x1be63b['name_value_list'][_0xea51('0x1c')][_0xea51('0x2e')]});}}logger[_0xea51('0xc')](_0xea51('0x2f'));return BPromise[_0xea51('0x30')]({'id':_0x462914[_0xea51('0x2c')][_0xea51('0x31')][_0xea51('0x2e')],'name':_0x462914['name_value_list']['user_name'][_0xea51('0x2e')]});});}else{logger[_0xea51('0xc')](_0xea51('0x32'));return BPromise[_0xea51('0x30')]({'id':_0x462914['name_value_list'][_0xea51('0x31')][_0xea51('0x2e')],'name':_0x462914['name_value_list'][_0xea51('0x33')][_0xea51('0x2e')]});}}function getEndUser(_0x1235c0,_0x59d22c,_0x4148f5,_0x42cbdd){logger[_0xea51('0xc')]('Searching\x20enduser\x20with\x20phone',_0x4148f5);return request({'form':{'method':'get_entry_list','input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x42cbdd['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x4148f5),'order_by':'','offset':'0','select_fields':['id',_0xea51('0x1c'),_0xea51('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea51('0x35')](function(_0x222dc9){if(_0x222dc9[_0xea51('0x2b')][_0xea51('0x1d')]){var _0x303ae8=_[_0xea51('0x36')](_0x222dc9[_0xea51('0x2b')],function(_0x263b1b){return _0x263b1b[_0xea51('0x2c')][_0xea51('0x34')][_0xea51('0x2e')]===_0x4148f5;});if(_0x303ae8){logger[_0xea51('0xc')](_0xea51('0x37'));return BPromise[_0xea51('0x30')]({'id':_0x303ae8[_0xea51('0x2c')]['id'][_0xea51('0x2e')],'name':_0x303ae8['name_value_list']['name'][_0xea51('0x2e')],'phone':_0x303ae8[_0xea51('0x2c')]['phone_home']['value']});}}else{logger[_0xea51('0xc')](_0xea51('0x38'));return request({'form':{'method':_0xea51('0x39'),'input_type':_0xea51('0x21'),'response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x42cbdd['id'],'module_name':_0xea51('0x1a'),'name_value_list':[{'name':_0xea51('0x3a'),'value':_0x59d22c!==_0xea51('0x3b')?_0x59d22c:util[_0xea51('0x23')](_0xea51('0x3c'),_0x4148f5)},{'name':_0xea51('0x34'),'value':_0x4148f5}]})}})[_0xea51('0x35')](function(_0x204a4f){logger['info']('Enduser\x20created.');return BPromise[_0xea51('0x30')]({'id':_0x204a4f['id'],'name':_0x204a4f[_0xea51('0x2b')][_0xea51('0x3a')][_0xea51('0x2e')],'phone':_0x204a4f[_0xea51('0x2b')][_0xea51('0x34')]['value']});});}});}function request(_0x32ebd6){logger[_0xea51('0x3d')](_0xea51('0x3e'),JSON[_0xea51('0x27')](_0x32ebd6));return rp(_[_0xea51('0x3f')](def,_0x32ebd6));}function getTags(_0x382286,_0x431d13){var _0xb6ac36=[];if(_0x382286&&_0x382286['length']>0x0){_0xb6ac36=_[_0xea51('0x40')](_0x382286,_0x431d13);}return _0xb6ac36;}function getCustomFields(_0x3a5441,_0x6a71ab){var _0x20e58e=[];var _0x43c532={'custom_fields':[]};if(_0x3a5441['length']>0x0){_[_0xea51('0x41')](_0x3a5441,function(_0x3e57e2){if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x43')&&_0x3e57e2[_0xea51('0x44')]&&!_0x3e57e2[_0xea51('0x45')]){_0x43c532[_0x3e57e2[_0xea51('0x44')][_0xea51('0x46')]()]=_0x3e57e2['content'][_0xea51('0x47')]();}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x43')&&_0x3e57e2['idField']&&_0x3e57e2[_0xea51('0x45')]){_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2['idField'],'value':_0x3e57e2[_0xea51('0x49')][_0xea51('0x47')]()});}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x4a')&&_0x3e57e2[_0xea51('0x1e')]&&_0x3e57e2[_0xea51('0x20')]&&_0x3e57e2[_0xea51('0x45')]){_0x6a71ab[_0x3e57e2[_0xea51('0x1e')]]&&_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2[_0xea51('0x20')],'value':_0x6a71ab[_0x3e57e2['variableName']][_0xea51('0x47')]()});}else if(_0x3e57e2[_0xea51('0x42')]===_0xea51('0x4b')&&_0x3e57e2['Variable']&&_0x3e57e2[_0xea51('0x4c')][_0xea51('0x1c')]&&_0x3e57e2['idField']&&_0x3e57e2[_0xea51('0x45')]){_0x6a71ab[_0x3e57e2[_0xea51('0x4c')][_0xea51('0x1c')][_0xea51('0x46')]()]&&_0x43c532[_0xea51('0x48')][_0xea51('0x1f')]({'id':_0x3e57e2['idField'],'value':_0x6a71ab[_0x3e57e2[_0xea51('0x4c')]['name'][_0xea51('0x46')]()]['toString']()});}});}return _0x43c532;}function getConnection(_0x4eac3e){return request({'method':_0xea51('0xb'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xea51('0x27')]({'user_auth':{'user_name':_0x4eac3e['username'],'password':_0x4eac3e['password'],'encryption':_0xea51('0x4d')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xea51('0x35')](function(_0xe85fc1){var _0x4084ca=_0xe85fc1;if(_0x4084ca['id']){def['sessionID']=_0x4084ca['id'];return BPromise['resolve'](_0x4084ca);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x4eac3e['id']));}});}function setRelationship(_0x29220f,_0x5c614b,_0x4c5fa0,_0x282cfa){return request({'form':{'method':_0xea51('0x4e'),'input_type':'JSON','response_type':_0xea51('0x21'),'rest_data':JSON[_0xea51('0x27')]({'session':_0x29220f['id'],'module_name':_0xea51('0x22'),'module_id':_0x4c5fa0['id'],'link_field_name':_0x282cfa,'related_ids':[_0x5c614b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xea51('0x4f')]=function(_0x82b8a5,_0x274bb7,_0x4f8b53,_0x124d21,_0xd1cd44,_0x425d4c){var _0x38c8cf,_0xe3f96a,_0x2cc531,_0xd81bb5;_0x425d4c[_0xea51('0x50')]=intUtil[_0xea51('0x51')](_0x425d4c['remoteUri']);_0x425d4c[_0xea51('0x52')]=intUtil['stripTrailingSlash'](_0x425d4c[_0xea51('0x52')]);def['uri']=util[_0xea51('0x23')](_0xea51('0x53'),_0x425d4c[_0xea51('0x50')]);if(_0xd1cd44&&_0xd1cd44[_0xea51('0x54')]){logger[_0xea51('0xc')]('[QUEUE]','Recording\x20is\x20enabled!');_0x274bb7[_0xea51('0x55')]=util['format'](_0xea51('0x56'),_0x425d4c[_0xea51('0x52')],_0x274bb7[_0xea51('0x57')],md5(_0x274bb7[_0xea51('0x57')]));}else{_0x274bb7[_0xea51('0x55')]='';}return getConnection(_0x425d4c)[_0xea51('0x35')](function(_0x2c4b45){_0xd81bb5=_0x2c4b45;return getUser(_0x425d4c,_0x124d21[_0xea51('0x1c')],_0xd81bb5);})['then'](function(_0x7a23f5){_0x38c8cf=_0x7a23f5;logger[_0xea51('0xc')](_0xea51('0x58'),_0x38c8cf['id']);return getEndUser(_0x425d4c,_0x274bb7[_0xea51('0x59')],_0x274bb7['calleridnum'],_0xd81bb5);})[_0xea51('0x35')](function(_0x48cb7c){_0xe3f96a=_0x48cb7c;logger['info']('The\x20Enduser\x20ID\x20is:',_0xe3f96a['id']);return getTicket(_0x425d4c,_0x38c8cf,_0xe3f96a,_0x4f8b53,_0x274bb7,_0x4f8b53[_0xea51('0x5a')],_0xd81bb5,_0xea51('0x5b'));})[_0xea51('0x35')](function(_0x4dbc53){_0x2cc531=_0x4dbc53;logger[_0xea51('0xc')](_0xea51('0x5c'));logger[_0xea51('0xc')]('The\x20Ticket\x20ID\x20is:',_0x2cc531['id']);return setRelationship(_0xd81bb5,_0x38c8cf,_0x2cc531,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0xd81bb5,_0xe3f96a,_0x2cc531,_0xea51('0x5e'));})[_0xea51('0x35')](function(){return getServerInfo(_0xd81bb5);})[_0xea51('0x35')](function(_0xfb5440){var _0x562bdc=parseInt(_0xfb5440[_0xea51('0x5f')][_0xea51('0x60')](0x0));var _0x5b9a44=util[_0xea51('0x23')](_0xea51('0x61'),_0x425d4c[_0xea51('0x50')],_0x2cc531['id']);if(_0x562bdc>0x6){_0x5b9a44=util[_0xea51('0x23')](_0xea51('0x62'),_0x425d4c[_0xea51('0x50')],_0x2cc531['id']);}logger[_0xea51('0xc')](_0xea51('0x63'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea51('0x23')](_0xea51('0x64'),_0x124d21[_0xea51('0x1c')]),_0xea51('0x65'),{'uri':_0x5b9a44});})[_0xea51('0x66')](function(_0x3caa97){logger[_0xea51('0x67')](_0xea51('0x63'),JSON[_0xea51('0x27')](_0x3caa97));});};exports[_0xea51('0x68')]=function(_0x3f07ac,_0x108a5d,_0x19d221,_0x27cec9,_0x55708c,_0x49d6e7,_0x302c5f){var _0x401478,_0x14ae3e,_0x47448b,_0x6f3db5;_0x49d6e7[_0xea51('0x50')]=intUtil[_0xea51('0x51')](_0x49d6e7[_0xea51('0x50')]);_0x49d6e7[_0xea51('0x52')]=intUtil[_0xea51('0x51')](_0x49d6e7[_0xea51('0x52')]);def[_0xea51('0x69')]=util[_0xea51('0x23')](_0xea51('0x53'),_0x49d6e7[_0xea51('0x50')]);if(_0x302c5f&&_0x302c5f[_0xea51('0x6a')]&&_0x302c5f[_0xea51('0x6a')]!==_0xea51('0x6b')){logger[_0xea51('0xc')](_0xea51('0x6c'),_0xea51('0x6d'));_0x108a5d['recordingURL']=util[_0xea51('0x23')](_0xea51('0x56'),_0x49d6e7[_0xea51('0x52')],_0x108a5d[_0xea51('0x57')],md5(_0x108a5d[_0xea51('0x57')]));}return getConnection(_0x49d6e7)[_0xea51('0x35')](function(_0x501040){_0x6f3db5=_0x501040;return getUser(_0x49d6e7,_0x27cec9[_0xea51('0x1c')],_0x6f3db5);})['then'](function(_0x320617){_0x401478=_0x320617;logger[_0xea51('0xc')](_0xea51('0x58'),_0x401478['id']);return getEndUser(_0x49d6e7,_0x108a5d[_0xea51('0x6e')],_0x108a5d[_0xea51('0x6f')],_0x6f3db5);})[_0xea51('0x35')](function(_0x542bbf){_0x14ae3e=_0x542bbf;logger['info']('The\x20Enduser\x20ID\x20is:',_0x14ae3e['id']);return getTicket(_0x49d6e7,_0x401478,_0x14ae3e,_0x19d221,_0x108a5d,_0x19d221[_0xea51('0x5a')],_0x6f3db5,_0xea51('0x70'));})[_0xea51('0x35')](function(_0xf7b091){_0x47448b=_0xf7b091;logger[_0xea51('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x47448b['id']);return setRelationship(_0x6f3db5,_0x401478,_0x47448b,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0x6f3db5,_0x14ae3e,_0x47448b,_0xea51('0x5e'));})[_0xea51('0x35')](function(){return getServerInfo(_0x6f3db5);})[_0xea51('0x35')](function(_0x4c83b5){var _0x43a2af=parseInt(_0x4c83b5[_0xea51('0x5f')][_0xea51('0x60')](0x0));var _0x156ecd=util['format'](_0xea51('0x61'),_0x49d6e7[_0xea51('0x50')],_0x47448b['id']);if(_0x43a2af>0x6){_0x156ecd=util[_0xea51('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x49d6e7['remoteUri'],_0x47448b['id']);}logger[_0xea51('0xc')](_0xea51('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea51('0x23')](_0xea51('0x64'),_0x27cec9[_0xea51('0x1c')]),_0xea51('0x65'),{'uri':_0x156ecd});})[_0xea51('0x66')](function(_0x547341){logger['error'](_0xea51('0x6c'),JSON['stringify'](_0x547341));});};exports[_0xea51('0x71')]=function(_0x291ae5,_0x2d197f,_0x18ca6c,_0x3564b2,_0x177960,_0x39b7a6){var _0x3bcae0,_0x59b04d,_0x56e214,_0x56576e;_0x39b7a6[_0xea51('0x50')]=intUtil['stripTrailingSlash'](_0x39b7a6[_0xea51('0x50')]);_0x39b7a6[_0xea51('0x52')]=intUtil[_0xea51('0x51')](_0x39b7a6[_0xea51('0x52')]);def[_0xea51('0x69')]=util['format']('%s/service/v4_1/rest.php',_0x39b7a6[_0xea51('0x50')]);if(_0x177960&&_0x177960[_0xea51('0x54')]){logger[_0xea51('0xc')]('['+_0x2d197f[_0xea51('0x72')][_0xea51('0x73')]()+']','Recording\x20is\x20enabled!');_0x2d197f[_0xea51('0x55')]=util[_0xea51('0x23')](_0xea51('0x56'),_0x39b7a6['serverUrl'],_0x2d197f['uniqueid'],md5(_0x2d197f[_0xea51('0x57')]));}else{_0x2d197f[_0xea51('0x55')]='';}return getConnection(_0x39b7a6)[_0xea51('0x35')](function(_0x3f59c2){_0x56576e=_0x3f59c2;if(!_[_0xea51('0x28')](_0x3564b2)){return getUser(_0x39b7a6,_0x3564b2['name'],_0x56576e);}else{return getUser(_0x39b7a6,null,_0x56576e);}})['then'](function(_0x3af2ab){_0x3bcae0=_0x3af2ab;logger[_0xea51('0xc')]('The\x20User\x20ID\x20is:',_0x3bcae0['id']);return getEndUser(_0x39b7a6,_0x2d197f[_0xea51('0x59')],_0x2d197f[_0xea51('0x74')],_0x56576e);})[_0xea51('0x35')](function(_0x4afa3d){_0x59b04d=_0x4afa3d;logger[_0xea51('0xc')]('The\x20Enduser\x20ID\x20is:',_0x59b04d['id']);return getTicket(_0x39b7a6,_0x3bcae0,_0x59b04d,_0x18ca6c,_0x2d197f,_0x18ca6c['Fields'],_0x56576e,'Inbound');})[_0xea51('0x35')](function(_0x5c2283){_0x56e214=_0x5c2283;logger[_0xea51('0xc')](_0xea51('0x5c'));logger['info'](_0xea51('0x75'),_0x56e214['id']);return setRelationship(_0x56576e,_0x3bcae0,_0x56e214,_0xea51('0x5d'));})[_0xea51('0x35')](function(){return setRelationship(_0x56576e,_0x59b04d,_0x56e214,_0xea51('0x5e'));})['then'](function(){return getServerInfo(_0x56576e);})[_0xea51('0x66')](function(_0xa9e0e4){logger['error']('['+_0x2d197f[_0xea51('0x72')]['toUpperCase']()+']',JSON[_0xea51('0x27')](_0xa9e0e4));});};
\ No newline at end of file
+var _0x9c55=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Outbound','contacts','error','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','getString','Subjects','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','entry_list','find','user_name','Agent\x20found!','resolve','name_value_list','value','info','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','[HTTP]','merge','map','type','string','nameField','customField','content','toString','variable','custom_fields','customVariable','Variable','toLowerCase','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','then','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x1736e8,_0x28cb17){var _0x23024e=function(_0x55b69c){while(--_0x55b69c){_0x1736e8['push'](_0x1736e8['shift']());}};_0x23024e(++_0x28cb17);}(_0x9c55,0x1ea));var _0x59c5=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x9c55[_0x29ae80];return _0x5d6d71;};'use strict';var _=require(_0x59c5('0x0'));var rp=require(_0x59c5('0x1'));var BPromise=require(_0x59c5('0x2'));var md5=require(_0x59c5('0x3'));var util=require(_0x59c5('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x59c5('0x5'));var logger=require(_0x59c5('0x6'))(_0x59c5('0x7'));config[_0x59c5('0x8')]=_[_0x59c5('0x9')](config[_0x59c5('0x8')],{'host':_0x59c5('0xa'),'port':0x18eb});var io=require(_0x59c5('0xb'))(new Redis(config[_0x59c5('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x12d136,_0x298425,_0x2d7ac2){io['to'](_0x12d136)['emit'](_0x298425,_0x2d7ac2);}function getTicket(_0x3ad764,_0x28146c,_0x2892ec,_0x2f86ea,_0x5776f2,_0x2862ca,_0x2e9eb5,_0x50f25e){logger['info']('Creating\x20new\x20ticket...');var _0x3e6f7a=new Date();var _0x3d2c9c=[{'name':'name','value':intUtil[_0x59c5('0xc')](_0x2f86ea[_0x59c5('0xd')],_0x5776f2,'\x20')},{'name':'assigned_user_id','value':_0x28146c['id']},{'name':'created_by','value':_0x28146c['id']},{'name':'description','value':intUtil[_0x59c5('0xc')](_0x2f86ea[_0x59c5('0xe')],_0x5776f2,'\x0a')},{'name':_0x59c5('0xf'),'value':_0x3e6f7a[_0x59c5('0x10')]()[_0x59c5('0x11')](0x0,0x13)[_0x59c5('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x59c5('0x13'),'value':'15'},{'name':_0x59c5('0x14'),'value':_0x2892ec['id']},{'name':'parent_type','value':_0x59c5('0x15')},{'name':_0x59c5('0x16'),'value':_0x2892ec[_0x59c5('0x17')]},{'name':_0x59c5('0x18'),'value':_0x50f25e}];if(_0x2862ca[_0x59c5('0x19')]){_[_0x59c5('0x1a')](_0x2862ca,function(_0x484e85){if(_0x5776f2[_0x484e85[_0x59c5('0x1b')]]){_0x3d2c9c[_0x59c5('0x1c')]({'name':_0x484e85[_0x59c5('0x1d')],'value':_0x5776f2[_0x484e85[_0x59c5('0x1b')]]});}});}return request({'form':{'method':_0x59c5('0x1e'),'input_type':_0x59c5('0x1f'),'response_type':_0x59c5('0x1f'),'rest_data':JSON[_0x59c5('0x20')]({'session':_0x2e9eb5['id'],'module_name':_0x59c5('0x21'),'name_value_list':_0x3d2c9c})}});}function getAuth(_0x46405c){return util[_0x59c5('0x22')](_0x59c5('0x23'),new Buffer(_0x46405c[_0x59c5('0x24')]+':X')['toString'](_0x59c5('0x25')));}function getServerInfo(_0x3e302e){return request({'form':{'method':'get_server_info','input_type':_0x59c5('0x1f'),'response_type':'JSON','rest_data':JSON[_0x59c5('0x20')]({'session':_0x3e302e['id']})}});}function getUser(_0x30903d,_0x22b00e,_0x5c102c){if(!_[_0x59c5('0x26')](_0x22b00e)){logger['info'](_0x59c5('0x27'),_0x22b00e);return request({'form':{'method':_0x59c5('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x59c5('0x20')]({'session':_0x5c102c['id'],'module_name':_0x59c5('0x29'),'query':util[_0x59c5('0x22')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x22b00e),'order_by':'','offset':'0','select_fields':['id',_0x59c5('0x17'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3e4540){if(_0x3e4540[_0x59c5('0x2a')][_0x59c5('0x19')]){var _0x649a22=_[_0x59c5('0x2b')](_0x3e4540['entry_list'],function(_0x3b69bc){return _0x3b69bc['name_value_list'][_0x59c5('0x2c')]['value']===_0x22b00e;});if(_0x649a22){logger['info'](_0x59c5('0x2d'));return BPromise[_0x59c5('0x2e')]({'id':_0x649a22[_0x59c5('0x2f')]['id'][_0x59c5('0x30')],'name':_0x649a22[_0x59c5('0x2f')][_0x59c5('0x17')][_0x59c5('0x30')]});}}logger[_0x59c5('0x31')](_0x59c5('0x32'));return BPromise[_0x59c5('0x2e')]({'id':_0x5c102c[_0x59c5('0x2f')][_0x59c5('0x33')]['value'],'name':_0x5c102c['name_value_list'][_0x59c5('0x2c')][_0x59c5('0x30')]});});}else{logger[_0x59c5('0x31')](_0x59c5('0x34'));return BPromise[_0x59c5('0x2e')]({'id':_0x5c102c[_0x59c5('0x2f')][_0x59c5('0x33')]['value'],'name':_0x5c102c['name_value_list'][_0x59c5('0x2c')]['value']});}}function getEndUser(_0x4a5c95,_0x130387,_0x25ed5e,_0x54fc56){logger[_0x59c5('0x31')]('Searching\x20enduser\x20with\x20phone',_0x25ed5e);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x59c5('0x1f'),'rest_data':JSON['stringify']({'session':_0x54fc56['id'],'module_name':'Contacts','query':util[_0x59c5('0x22')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x25ed5e),'order_by':'','offset':'0','select_fields':['id',_0x59c5('0x17'),_0x59c5('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x26152f){if(_0x26152f[_0x59c5('0x2a')][_0x59c5('0x19')]){var _0x39964c=_[_0x59c5('0x2b')](_0x26152f['entry_list'],function(_0x50a2ea){return _0x50a2ea[_0x59c5('0x2f')]['phone_home'][_0x59c5('0x30')]===_0x25ed5e;});if(_0x39964c){logger[_0x59c5('0x31')]('Enduser\x20found!');return BPromise[_0x59c5('0x2e')]({'id':_0x39964c['name_value_list']['id'][_0x59c5('0x30')],'name':_0x39964c[_0x59c5('0x2f')][_0x59c5('0x17')][_0x59c5('0x30')],'phone':_0x39964c['name_value_list'][_0x59c5('0x35')][_0x59c5('0x30')]});}}else{logger['info'](_0x59c5('0x36'));return request({'form':{'method':'set_entry','input_type':_0x59c5('0x1f'),'response_type':_0x59c5('0x1f'),'rest_data':JSON['stringify']({'session':_0x54fc56['id'],'module_name':_0x59c5('0x15'),'name_value_list':[{'name':_0x59c5('0x37'),'value':_0x130387!==_0x59c5('0x38')?_0x130387:util[_0x59c5('0x22')](_0x59c5('0x39'),_0x25ed5e)},{'name':'phone_home','value':_0x25ed5e}]})}})['then'](function(_0x4f2452){logger[_0x59c5('0x31')]('Enduser\x20created.');return BPromise[_0x59c5('0x2e')]({'id':_0x4f2452['id'],'name':_0x4f2452[_0x59c5('0x2a')]['first_name'][_0x59c5('0x30')],'phone':_0x4f2452[_0x59c5('0x2a')][_0x59c5('0x35')]['value']});});}});}function request(_0x1b300f){logger['debug'](_0x59c5('0x3a'),JSON[_0x59c5('0x20')](_0x1b300f));return rp(_[_0x59c5('0x3b')](def,_0x1b300f));}function getTags(_0x132df8,_0x6c5297){var _0x2c78b0=[];if(_0x132df8&&_0x132df8['length']>0x0){_0x2c78b0=_[_0x59c5('0x3c')](_0x132df8,_0x6c5297);}return _0x2c78b0;}function getCustomFields(_0x10e8b7,_0x1a3a0d){var _0x3d594f=[];var _0x160ab7={'custom_fields':[]};if(_0x10e8b7[_0x59c5('0x19')]>0x0){_[_0x59c5('0x1a')](_0x10e8b7,function(_0xd2345){if(_0xd2345[_0x59c5('0x3d')]===_0x59c5('0x3e')&&_0xd2345[_0x59c5('0x3f')]&&!_0xd2345[_0x59c5('0x40')]){_0x160ab7[_0xd2345['nameField']['toLowerCase']()]=_0xd2345[_0x59c5('0x41')][_0x59c5('0x42')]();}else if(_0xd2345['type']===_0x59c5('0x3e')&&_0xd2345['idField']&&_0xd2345[_0x59c5('0x40')]){_0x160ab7['custom_fields'][_0x59c5('0x1c')]({'id':_0xd2345['idField'],'value':_0xd2345[_0x59c5('0x41')][_0x59c5('0x42')]()});}else if(_0xd2345['type']===_0x59c5('0x43')&&_0xd2345[_0x59c5('0x1b')]&&_0xd2345[_0x59c5('0x1d')]&&_0xd2345['customField']){_0x1a3a0d[_0xd2345[_0x59c5('0x1b')]]&&_0x160ab7[_0x59c5('0x44')][_0x59c5('0x1c')]({'id':_0xd2345[_0x59c5('0x1d')],'value':_0x1a3a0d[_0xd2345['variableName']][_0x59c5('0x42')]()});}else if(_0xd2345[_0x59c5('0x3d')]===_0x59c5('0x45')&&_0xd2345['Variable']&&_0xd2345[_0x59c5('0x46')][_0x59c5('0x17')]&&_0xd2345['idField']&&_0xd2345['customField']){_0x1a3a0d[_0xd2345['Variable'][_0x59c5('0x17')]['toLowerCase']()]&&_0x160ab7[_0x59c5('0x44')][_0x59c5('0x1c')]({'id':_0xd2345['idField'],'value':_0x1a3a0d[_0xd2345[_0x59c5('0x46')][_0x59c5('0x17')][_0x59c5('0x47')]()][_0x59c5('0x42')]()});}});}return _0x160ab7;}function getConnection(_0xbbf463){return request({'method':'POST','form':{'method':_0x59c5('0x48'),'input_type':_0x59c5('0x1f'),'response_type':_0x59c5('0x1f'),'rest_data':JSON[_0x59c5('0x20')]({'user_auth':{'user_name':_0xbbf463['username'],'password':_0xbbf463[_0x59c5('0x49')],'encryption':_0x59c5('0x4a')},'application':_0x59c5('0x4b')})}})['then'](function(_0x1d2bb9){var _0x463d1b=_0x1d2bb9;if(_0x463d1b['id']){def[_0x59c5('0x4c')]=_0x463d1b['id'];return BPromise['resolve'](_0x463d1b);}else{throw new Error(util[_0x59c5('0x22')](_0x59c5('0x4d'),_0xbbf463['id']));}});}function setRelationship(_0x220f7b,_0x9f342d,_0x4adfc1,_0x1e77d3){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x59c5('0x1f'),'rest_data':JSON[_0x59c5('0x20')]({'session':_0x220f7b['id'],'module_name':_0x59c5('0x21'),'module_id':_0x4adfc1['id'],'link_field_name':_0x1e77d3,'related_ids':[_0x9f342d['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x59c5('0x4e')]=function(_0x2acec2,_0x4028e1,_0x46d29f,_0x465a82,_0x361214,_0x5a9b00){var _0x1d3161,_0x1e675c,_0xc41288,_0x243d8f;_0x5a9b00['remoteUri']=intUtil[_0x59c5('0x4f')](_0x5a9b00[_0x59c5('0x50')]);_0x5a9b00[_0x59c5('0x51')]=intUtil[_0x59c5('0x4f')](_0x5a9b00[_0x59c5('0x51')]);def[_0x59c5('0x52')]=util[_0x59c5('0x22')](_0x59c5('0x53'),_0x5a9b00[_0x59c5('0x50')]);if(_0x361214&&_0x361214['monitor_format']){logger[_0x59c5('0x31')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4028e1[_0x59c5('0x54')]=util[_0x59c5('0x22')](_0x59c5('0x55'),_0x5a9b00[_0x59c5('0x51')],_0x4028e1[_0x59c5('0x56')],md5(_0x4028e1['uniqueid']));}else{_0x4028e1['recordingURL']='';}return getConnection(_0x5a9b00)[_0x59c5('0x57')](function(_0xae3abb){_0x243d8f=_0xae3abb;return getUser(_0x5a9b00,_0x465a82[_0x59c5('0x17')],_0x243d8f);})[_0x59c5('0x57')](function(_0x597b6c){_0x1d3161=_0x597b6c;logger[_0x59c5('0x31')](_0x59c5('0x58'),_0x1d3161['id']);return getEndUser(_0x5a9b00,_0x4028e1[_0x59c5('0x59')],_0x4028e1[_0x59c5('0x5a')],_0x243d8f);})['then'](function(_0x158c94){_0x1e675c=_0x158c94;logger[_0x59c5('0x31')](_0x59c5('0x5b'),_0x1e675c['id']);return getTicket(_0x5a9b00,_0x1d3161,_0x1e675c,_0x46d29f,_0x4028e1,_0x46d29f[_0x59c5('0x5c')],_0x243d8f,_0x59c5('0x5d'));})[_0x59c5('0x57')](function(_0x343fc4){_0xc41288=_0x343fc4;logger[_0x59c5('0x31')](_0x59c5('0x5e'));logger[_0x59c5('0x31')](_0x59c5('0x5f'),_0xc41288['id']);return setRelationship(_0x243d8f,_0x1d3161,_0xc41288,_0x59c5('0x60'));})['then'](function(){return setRelationship(_0x243d8f,_0x1e675c,_0xc41288,'contacts');})[_0x59c5('0x57')](function(){return getServerInfo(_0x243d8f);})[_0x59c5('0x57')](function(_0x1e5788){var _0x5ba414=parseInt(_0x1e5788[_0x59c5('0x61')][_0x59c5('0x62')](0x0));var _0x41a2cb=util['format'](_0x59c5('0x63'),_0x5a9b00[_0x59c5('0x50')],_0xc41288['id']);if(_0x5ba414>0x6){_0x41a2cb=util[_0x59c5('0x22')](_0x59c5('0x64'),_0x5a9b00['remoteUri'],_0xc41288['id']);}logger[_0x59c5('0x31')](_0x59c5('0x65'),_0x59c5('0x66'));emit(util[_0x59c5('0x22')](_0x59c5('0x67'),_0x465a82[_0x59c5('0x17')]),_0x59c5('0x68'),{'uri':_0x41a2cb});})[_0x59c5('0x69')](function(_0xcf3a8){logger['error']('[QUEUE]',JSON['stringify'](_0xcf3a8));});};exports['outbound']=function(_0x4fe5b7,_0x1a51d4,_0xb2ff17,_0x2bbb09,_0x40e1ce,_0x8c08a8,_0x31327d){var _0x533339,_0x54bef0,_0xcd3f5f,_0x6fd33;_0x8c08a8[_0x59c5('0x50')]=intUtil[_0x59c5('0x4f')](_0x8c08a8[_0x59c5('0x50')]);_0x8c08a8[_0x59c5('0x51')]=intUtil[_0x59c5('0x4f')](_0x8c08a8[_0x59c5('0x51')]);def[_0x59c5('0x52')]=util[_0x59c5('0x22')]('%s/service/v4_1/rest.php',_0x8c08a8['remoteUri']);if(_0x31327d&&_0x31327d[_0x59c5('0x6a')]&&_0x31327d[_0x59c5('0x6a')]!=='none'){logger[_0x59c5('0x31')](_0x59c5('0x6b'),_0x59c5('0x6c'));_0x1a51d4[_0x59c5('0x54')]=util[_0x59c5('0x22')](_0x59c5('0x55'),_0x8c08a8['serverUrl'],_0x1a51d4[_0x59c5('0x56')],md5(_0x1a51d4[_0x59c5('0x56')]));}return getConnection(_0x8c08a8)[_0x59c5('0x57')](function(_0x51bb3a){_0x6fd33=_0x51bb3a;return getUser(_0x8c08a8,_0x2bbb09['name'],_0x6fd33);})[_0x59c5('0x57')](function(_0xe4f552){_0x533339=_0xe4f552;logger[_0x59c5('0x31')](_0x59c5('0x58'),_0x533339['id']);return getEndUser(_0x8c08a8,_0x1a51d4[_0x59c5('0x6d')],_0x1a51d4[_0x59c5('0x6e')],_0x6fd33);})[_0x59c5('0x57')](function(_0x4d18e2){_0x54bef0=_0x4d18e2;logger['info'](_0x59c5('0x5b'),_0x54bef0['id']);return getTicket(_0x8c08a8,_0x533339,_0x54bef0,_0xb2ff17,_0x1a51d4,_0xb2ff17[_0x59c5('0x5c')],_0x6fd33,_0x59c5('0x6f'));})[_0x59c5('0x57')](function(_0x5a5133){_0xcd3f5f=_0x5a5133;logger[_0x59c5('0x31')](_0x59c5('0x5e'));logger[_0x59c5('0x31')](_0x59c5('0x5f'),_0xcd3f5f['id']);return setRelationship(_0x6fd33,_0x533339,_0xcd3f5f,_0x59c5('0x60'));})[_0x59c5('0x57')](function(){return setRelationship(_0x6fd33,_0x54bef0,_0xcd3f5f,_0x59c5('0x70'));})[_0x59c5('0x57')](function(){return getServerInfo(_0x6fd33);})[_0x59c5('0x57')](function(_0x5cd94a){var _0x3b94fc=parseInt(_0x5cd94a[_0x59c5('0x61')][_0x59c5('0x62')](0x0));var _0xb08b93=util[_0x59c5('0x22')](_0x59c5('0x63'),_0x8c08a8['remoteUri'],_0xcd3f5f['id']);if(_0x3b94fc>0x6){_0xb08b93=util['format'](_0x59c5('0x64'),_0x8c08a8[_0x59c5('0x50')],_0xcd3f5f['id']);}logger[_0x59c5('0x31')]('[OUTBOUND]',_0x59c5('0x66'));emit(util[_0x59c5('0x22')](_0x59c5('0x67'),_0x2bbb09[_0x59c5('0x17')]),'trigger:browser:url',{'uri':_0xb08b93});})[_0x59c5('0x69')](function(_0x58a6e2){logger[_0x59c5('0x71')](_0x59c5('0x6b'),JSON[_0x59c5('0x20')](_0x58a6e2));});};exports[_0x59c5('0x72')]=function(_0x1c07d5,_0x1ef557,_0x3cced3,_0x34f346,_0x49d135,_0x1f1b14){var _0x2bedfe,_0x13beb1,_0x31462d,_0x4085fa;_0x1f1b14[_0x59c5('0x50')]=intUtil[_0x59c5('0x4f')](_0x1f1b14[_0x59c5('0x50')]);_0x1f1b14[_0x59c5('0x51')]=intUtil[_0x59c5('0x4f')](_0x1f1b14[_0x59c5('0x51')]);def[_0x59c5('0x52')]=util['format'](_0x59c5('0x53'),_0x1f1b14[_0x59c5('0x50')]);if(_0x49d135&&_0x49d135[_0x59c5('0x73')]){logger['info']('['+_0x1ef557[_0x59c5('0x74')][_0x59c5('0x75')]()+']','Recording\x20is\x20enabled!');_0x1ef557[_0x59c5('0x54')]=util[_0x59c5('0x22')](_0x59c5('0x55'),_0x1f1b14[_0x59c5('0x51')],_0x1ef557[_0x59c5('0x56')],md5(_0x1ef557['uniqueid']));}else{_0x1ef557[_0x59c5('0x54')]='';}return getConnection(_0x1f1b14)['then'](function(_0x31f178){_0x4085fa=_0x31f178;if(!_[_0x59c5('0x26')](_0x34f346)){return getUser(_0x1f1b14,_0x34f346['name'],_0x4085fa);}else{return getUser(_0x1f1b14,null,_0x4085fa);}})['then'](function(_0x4914a5){_0x2bedfe=_0x4914a5;logger[_0x59c5('0x31')](_0x59c5('0x58'),_0x2bedfe['id']);return getEndUser(_0x1f1b14,_0x1ef557['calleridname'],_0x1ef557['calleridnum'],_0x4085fa);})[_0x59c5('0x57')](function(_0x4a9dc1){_0x13beb1=_0x4a9dc1;logger[_0x59c5('0x31')](_0x59c5('0x5b'),_0x13beb1['id']);return getTicket(_0x1f1b14,_0x2bedfe,_0x13beb1,_0x3cced3,_0x1ef557,_0x3cced3[_0x59c5('0x5c')],_0x4085fa,_0x59c5('0x5d'));})[_0x59c5('0x57')](function(_0x3a03b9){_0x31462d=_0x3a03b9;logger['info'](_0x59c5('0x5e'));logger['info'](_0x59c5('0x5f'),_0x31462d['id']);return setRelationship(_0x4085fa,_0x2bedfe,_0x31462d,_0x59c5('0x60'));})[_0x59c5('0x57')](function(){return setRelationship(_0x4085fa,_0x13beb1,_0x31462d,_0x59c5('0x70'));})[_0x59c5('0x57')](function(){return getServerInfo(_0x4085fa);})['catch'](function(_0x3a32ec){logger[_0x59c5('0x71')]('['+_0x1ef557[_0x59c5('0x74')]['toUpperCase']()+']',JSON[_0x59c5('0x20')](_0x3a32ec));});};
\ No newline at end of file
index 2abea13..30e8b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbcb=['lodash','util','length','sortBy','type','push','content','variable','customVariable','name','Variable','toLowerCase','toString','keyType','string','%s:\x20%s','key','keyContent','variableName','format','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil'];(function(_0x1f90d4,_0x57d533){var _0x367ac1=function(_0x143d80){while(--_0x143d80){_0x1f90d4['push'](_0x1f90d4['shift']());}};_0x367ac1(++_0x57d533);}(_0xdbcb,0xa2));var _0xbdbc=function(_0x4ba8c3,_0x33c457){_0x4ba8c3=_0x4ba8c3-0x0;var _0xf65364=_0xdbcb[_0x4ba8c3];return _0xf65364;};'use strict';var _=require(_0xbdbc('0x0'));var util=require(_0xbdbc('0x1'));exports['getString']=function(_0x371170,_0x14dbf9,_0x1deb28){var _0xf0f3c6=[];if(_0x371170[_0xbdbc('0x2')]>0x0){var _0x434b29=_[_0xbdbc('0x3')](_0x371170,['id']);for(var _0x2bc8c6=0x0;_0x2bc8c6<_0x434b29[_0xbdbc('0x2')];_0x2bc8c6++){var _0x11f711=_0x434b29[_0x2bc8c6];if(_0x11f711[_0xbdbc('0x4')]==='string'){_0xf0f3c6[_0xbdbc('0x5')](_0x11f711[_0xbdbc('0x6')]);}else if(_0x11f711[_0xbdbc('0x4')]===_0xbdbc('0x7')&&_0x11f711['variableName']){_0x14dbf9[_0x11f711['variableName']]&&_0xf0f3c6[_0xbdbc('0x5')](_0x14dbf9[_0x11f711['variableName']]['toString']());}else if(_0x11f711['type']===_0xbdbc('0x8')&&_0x11f711['Variable']&&_0x11f711['Variable'][_0xbdbc('0x9')]){_0x14dbf9[_0x11f711['Variable']['name']['toLowerCase']()]&&_0xf0f3c6['push'](_0x14dbf9[_0x11f711[_0xbdbc('0xa')][_0xbdbc('0x9')][_0xbdbc('0xb')]()][_0xbdbc('0xc')]());}else if(_0x11f711[_0xbdbc('0x4')]==='keyValue'){if(_0x11f711[_0xbdbc('0xd')]===_0xbdbc('0xe')&&_0x11f711['key']){_0xf0f3c6[_0xbdbc('0x5')](util['format'](_0xbdbc('0xf'),_0x11f711[_0xbdbc('0x10')],_0x11f711[_0xbdbc('0x11')]));}else if(_0x11f711['keyType']===_0xbdbc('0x7')&&_0x11f711[_0xbdbc('0x12')]&&_0x11f711[_0xbdbc('0x10')]){_0x14dbf9[_0x11f711[_0xbdbc('0x12')]]&&_0xf0f3c6[_0xbdbc('0x5')](util[_0xbdbc('0x13')]('%s:\x20%s',_0x11f711[_0xbdbc('0x10')],_0x14dbf9[_0x11f711[_0xbdbc('0x12')]]));}else if(_0x11f711[_0xbdbc('0xd')]===_0xbdbc('0x8')&&_0x11f711['Variable']&&_0x11f711['Variable']['name']&&_0x11f711[_0xbdbc('0x10')]){_0x14dbf9[_0x11f711['Variable'][_0xbdbc('0x9')][_0xbdbc('0xb')]()]&&_0xf0f3c6[_0xbdbc('0x5')](util[_0xbdbc('0x13')]('%s:\x20%s',_0x11f711[_0xbdbc('0x10')],_0x14dbf9[_0x11f711[_0xbdbc('0xa')][_0xbdbc('0x9')][_0xbdbc('0xb')]()]));}}}}return _0xf0f3c6[_0xbdbc('0x14')](_0x1deb28);};exports[_0xbdbc('0x15')]=function(_0x1429e7){var _0x3886a0=_0x1429e7[_0xbdbc('0x16')](-0x1);if(_0x3886a0==='/'){_0x1429e7=_0x1429e7[_0xbdbc('0x17')](0x0,_0x1429e7[_0xbdbc('0x18')](_0x3886a0));}return _0x1429e7;};exports[_0xbdbc('0x19')]=function(_0x4b6f14){if(!_[_0xbdbc('0x1a')](_0x4b6f14)&&_0x4b6f14!==''){var _0x421430=/^(([^<>()\[\]\\.,;:\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 _0x421430['test'](String(_0x4b6f14)[_0xbdbc('0xb')]());}else{return![];}};
\ No newline at end of file
+var _0x4eec=['Variable','name','toLowerCase','toString','key','keyContent','keyType','format','%s:\x20%s','join','stripTrailingSlash','validateEmail','isNil','lodash','getString','sortBy','type','string','content','variable','variableName','push'];(function(_0x5c0c19,_0x18abfb){var _0x27a55f=function(_0x23d4e5){while(--_0x23d4e5){_0x5c0c19['push'](_0x5c0c19['shift']());}};_0x27a55f(++_0x18abfb);}(_0x4eec,0xd3));var _0xc4ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4eec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc4ee('0x0'));var util=require('util');exports[_0xc4ee('0x1')]=function(_0x329082,_0x5e69ac,_0x48337f){var _0x22a370=[];if(_0x329082['length']>0x0){var _0xe1dcaf=_[_0xc4ee('0x2')](_0x329082,['id']);for(var _0x3ceeb9=0x0;_0x3ceeb9<_0xe1dcaf['length'];_0x3ceeb9++){var _0x364854=_0xe1dcaf[_0x3ceeb9];if(_0x364854[_0xc4ee('0x3')]===_0xc4ee('0x4')){_0x22a370['push'](_0x364854[_0xc4ee('0x5')]);}else if(_0x364854[_0xc4ee('0x3')]===_0xc4ee('0x6')&&_0x364854[_0xc4ee('0x7')]){_0x5e69ac[_0x364854[_0xc4ee('0x7')]]&&_0x22a370[_0xc4ee('0x8')](_0x5e69ac[_0x364854[_0xc4ee('0x7')]]['toString']());}else if(_0x364854[_0xc4ee('0x3')]==='customVariable'&&_0x364854[_0xc4ee('0x9')]&&_0x364854[_0xc4ee('0x9')][_0xc4ee('0xa')]){_0x5e69ac[_0x364854[_0xc4ee('0x9')]['name'][_0xc4ee('0xb')]()]&&_0x22a370[_0xc4ee('0x8')](_0x5e69ac[_0x364854[_0xc4ee('0x9')][_0xc4ee('0xa')][_0xc4ee('0xb')]()][_0xc4ee('0xc')]());}else if(_0x364854[_0xc4ee('0x3')]==='keyValue'){if(_0x364854['keyType']===_0xc4ee('0x4')&&_0x364854['key']){_0x22a370[_0xc4ee('0x8')](util['format']('%s:\x20%s',_0x364854[_0xc4ee('0xd')],_0x364854[_0xc4ee('0xe')]));}else if(_0x364854[_0xc4ee('0xf')]===_0xc4ee('0x6')&&_0x364854[_0xc4ee('0x7')]&&_0x364854[_0xc4ee('0xd')]){_0x5e69ac[_0x364854['variableName']]&&_0x22a370['push'](util[_0xc4ee('0x10')]('%s:\x20%s',_0x364854[_0xc4ee('0xd')],_0x5e69ac[_0x364854[_0xc4ee('0x7')]]));}else if(_0x364854['keyType']==='customVariable'&&_0x364854[_0xc4ee('0x9')]&&_0x364854[_0xc4ee('0x9')]['name']&&_0x364854['key']){_0x5e69ac[_0x364854['Variable']['name'][_0xc4ee('0xb')]()]&&_0x22a370[_0xc4ee('0x8')](util[_0xc4ee('0x10')](_0xc4ee('0x11'),_0x364854[_0xc4ee('0xd')],_0x5e69ac[_0x364854[_0xc4ee('0x9')]['name'][_0xc4ee('0xb')]()]));}}}}return _0x22a370[_0xc4ee('0x12')](_0x48337f);};exports[_0xc4ee('0x13')]=function(_0x9b7a3f){var _0x113cdb=_0x9b7a3f['slice'](-0x1);if(_0x113cdb==='/'){_0x9b7a3f=_0x9b7a3f['substring'](0x0,_0x9b7a3f['lastIndexOf'](_0x113cdb));}return _0x9b7a3f;};exports[_0xc4ee('0x14')]=function(_0x28298a){if(!_[_0xc4ee('0x15')](_0x28298a)&&_0x28298a!==''){var _0x56d1ed=/^(([^<>()\[\]\\.,;:\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 _0x56d1ed['test'](String(_0x28298a)['toLowerCase']());}else{return![];}};
\ No newline at end of file
index 0ca08ee..3a96883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1fd538,_0x18061f){var _0x3b1e2c=function(_0x2fd43a){while(--_0x2fd43a){_0x1fd538['push'](_0x1fd538['shift']());}};_0x3b1e2c(++_0x18061f);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index d845f87..7d492fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f28=['ioredis','./util','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','name','Subjects','getString','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','filter','results','first','Enduser\x20found!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','%s:%s','username','authType','token','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','length','map','forEach','includes','picklist','type','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','email','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util'];(function(_0x1b8807,_0x4f6962){var _0x4a9429=function(_0x32b0d6){while(--_0x32b0d6){_0x1b8807['push'](_0x1b8807['shift']());}};_0x4a9429(++_0x4f6962);}(_0x7f28,0x143));var _0x87f2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7f28[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x87f2('0x0'));var rp=require(_0x87f2('0x1'));var md5=require(_0x87f2('0x2'));var util=require(_0x87f2('0x3'));var Redis=require(_0x87f2('0x4'));var intUtil=require(_0x87f2('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x87f2('0x6'));config[_0x87f2('0x7')]=_['defaults'](config[_0x87f2('0x7')],{'host':_0x87f2('0x8'),'port':0x18eb});var io=require(_0x87f2('0x9'))(new Redis(config[_0x87f2('0x7')]));function emit(_0x5e325e,_0x432859,_0x28b149){io['to'](_0x5e325e)[_0x87f2('0xa')](_0x432859,_0x28b149);}var headers={'Content-Type':_0x87f2('0xb'),'Accept':_0x87f2('0xb')};function getTicket(_0x55c222,_0x1d5566,_0x449895,_0x4e812a,_0xaf7e00){logger[_0x87f2('0xc')](_0x87f2('0xd'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0xf'),_0x55c222[_0x87f2('0x10')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x449895['id'],'submitter_id':_0x1d5566?_0x1d5566['id']:undefined,'assignee_id':_0x1d5566?_0x1d5566['id']:undefined,'tags':getTags(_0x4e812a['Tags'],_0x87f2('0x11')),'subject':intUtil['getString'](_0x4e812a[_0x87f2('0x12')],_0xaf7e00,'\x20'),'description':intUtil[_0x87f2('0x13')](_0x4e812a['Descriptions'],_0xaf7e00,'\x0a'),'comment':{'public':![],'body':intUtil[_0x87f2('0x13')](_0x4e812a['Descriptions'],_0xaf7e00,'\x0a')}},getCustomFields(_0x4e812a['Fields'],_0xaf7e00))}})[_0x87f2('0x14')](function(_0x57a8f0){logger[_0x87f2('0xc')](_0x87f2('0x15'));return _0x57a8f0['ticket'];});}function getUser(_0x5c6af4,_0x5515fb){if(intUtil[_0x87f2('0x16')](_0x5515fb)){logger['info'](_0x87f2('0x17'),_0x5515fb);return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x18'),_0x5c6af4['remoteUri']),'qs':{'query':util[_0x87f2('0xe')](_0x87f2('0x19'),_0x5515fb)}})[_0x87f2('0x14')](function(_0x2fdc04){if(_0x2fdc04['count']){logger[_0x87f2('0xc')](_0x87f2('0x1a'));return _[_0x87f2('0x1b')](_0x2fdc04['results'],{'email':_0x5515fb,'role':'agent'});}else{logger[_0x87f2('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x1c'),_0x5c6af4[_0x87f2('0x10')])})['then'](function(_0x1a905a){logger[_0x87f2('0xc')](_0x87f2('0x1d'));return _0x1a905a[_0x87f2('0x1e')];});}});}else{logger[_0x87f2('0xc')](_0x87f2('0x1f'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x1c'),_0x5c6af4[_0x87f2('0x10')])})[_0x87f2('0x14')](function(_0x1c6ecd){logger['info'](_0x87f2('0x1d'));return _0x1c6ecd[_0x87f2('0x1e')];});}}function getEndUser(_0x37448b,_0x161d00,_0x1cf6b4){logger[_0x87f2('0xc')](_0x87f2('0x20'),_0x1cf6b4);return request({'uri':util['format'](_0x87f2('0x18'),_0x37448b['remoteUri']),'qs':{'query':util[_0x87f2('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x1cf6b4)}})[_0x87f2('0x14')](function(_0x2b4b0b){var _0x2d0fdd;if(_0x2b4b0b['results']['length']){_0x2b4b0b['results']=_[_0x87f2('0x21')](_0x2b4b0b[_0x87f2('0x22')],{'suspended':![],'role':'end-user'});if(_0x2b4b0b[_0x87f2('0x22')]['length']){_0x2d0fdd=_[_0x87f2('0x23')](_0x2b4b0b[_0x87f2('0x22')]);}}if(_0x2d0fdd){logger[_0x87f2('0xc')](_0x87f2('0x24'));return _0x2d0fdd;}else{logger[_0x87f2('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x25'),_0x37448b['remoteUri']),'method':_0x87f2('0x26'),'body':{'user':{'role':_0x87f2('0x27'),'name':util[_0x87f2('0xe')](_0x87f2('0x28'),_0x161d00||_0x1cf6b4),'phone':_0x1cf6b4}}})['then'](function(_0x174064){logger[_0x87f2('0xc')](_0x87f2('0x29'));return _0x174064[_0x87f2('0x1e')];});}});}function getAuth(_0xfcb3ea){var _0x5bb480;if(_0xfcb3ea['authType']===_0x87f2('0x2a')){_0x5bb480=util[_0x87f2('0xe')](_0x87f2('0x2b'),_0xfcb3ea[_0x87f2('0x2c')],_0xfcb3ea[_0x87f2('0x2a')]);}else if(_0xfcb3ea[_0x87f2('0x2d')]===_0x87f2('0x2e')){_0x5bb480=util['format']('%s/token:%s',_0xfcb3ea[_0x87f2('0x2c')],_0xfcb3ea['token']);}return util['format'](_0x87f2('0x2f'),new Buffer(_0x5bb480)[_0x87f2('0x30')](_0x87f2('0x31')));}function request(_0x43415f){logger['debug'](_0x87f2('0x32'),JSON[_0x87f2('0x33')](_0x43415f));return rp(_['defaults'](_0x43415f,{'method':_0x87f2('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x20e6f0,_0xa9af4e){var _0x253663=[];if(_0x20e6f0&&_0x20e6f0[_0x87f2('0x35')]>0x0){_0x253663=_[_0x87f2('0x36')](_0x20e6f0,_0xa9af4e);}return _0x253663;}function getCustomFields(_0x4fca38,_0x25e65a){var _0x44013b=[];var _0x1f990a={'custom_fields':[]};if(_0x4fca38[_0x87f2('0x35')]>0x0){_[_0x87f2('0x37')](_0x4fca38,function(_0x3fa323){if(_[_0x87f2('0x38')](['string',_0x87f2('0x39')],_0x3fa323[_0x87f2('0x3a')])&&_0x3fa323['nameField']&&!_0x3fa323[_0x87f2('0x3b')]){_0x1f990a[_0x3fa323['nameField'][_0x87f2('0x3c')]()]=_0x3fa323[_0x87f2('0x3d')]['toString']();}else if(_['includes']([_0x87f2('0x3e'),_0x87f2('0x39')],_0x3fa323[_0x87f2('0x3a')])&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323[_0x87f2('0x3b')]){_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323['idField'],'value':_0x3fa323['content']['toString']()});}else if(_0x3fa323['type']===_0x87f2('0x42')&&_0x3fa323[_0x87f2('0x43')]&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323['customField']){_0x25e65a[_0x3fa323[_0x87f2('0x43')]]&&_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323[_0x87f2('0x3f')],'value':_0x25e65a[_0x3fa323[_0x87f2('0x43')]][_0x87f2('0x30')]()});}else if(_0x3fa323[_0x87f2('0x3a')]===_0x87f2('0x44')&&_0x3fa323['Variable']&&_0x3fa323[_0x87f2('0x45')]['name']&&_0x3fa323[_0x87f2('0x3f')]&&_0x3fa323['customField']){_0x25e65a[_0x3fa323['Variable'][_0x87f2('0x11')][_0x87f2('0x3c')]()]&&_0x1f990a[_0x87f2('0x40')][_0x87f2('0x41')]({'id':_0x3fa323[_0x87f2('0x3f')],'value':_0x25e65a[_0x3fa323['Variable'][_0x87f2('0x11')][_0x87f2('0x3c')]()][_0x87f2('0x30')]()});}});}return _0x1f990a;}exports[_0x87f2('0x46')]=function(_0x943a4d,_0x20063d,_0x3c2bb0,_0x1b9bee,_0x504cb5,_0x46e77c){var _0x520139,_0x30481e;_0x46e77c[_0x87f2('0x10')]=intUtil[_0x87f2('0x47')](_0x46e77c['remoteUri']);_0x46e77c[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x46e77c[_0x87f2('0x48')]);if(_0x504cb5&&_0x504cb5[_0x87f2('0x49')]){logger[_0x87f2('0xc')]('[QUEUE]',_0x87f2('0x4a'));_0x20063d[_0x87f2('0x4b')]=util[_0x87f2('0xe')](_0x87f2('0x4c'),_0x46e77c[_0x87f2('0x48')],_0x20063d[_0x87f2('0x4d')],md5(_0x20063d[_0x87f2('0x4d')]));}else{_0x20063d[_0x87f2('0x4b')]='';}headers['Authorization']=getAuth(_0x46e77c);return getUser(_0x46e77c,_0x1b9bee['email'])['then'](function(_0x5e8b78){_0x520139=_0x5e8b78;logger['info'](_0x87f2('0x4e'),_0x520139['id']);return getEndUser(_0x46e77c,_0x20063d[_0x87f2('0x4f')],_0x20063d[_0x87f2('0x50')]);})['then'](function(_0x6220b6){_0x30481e=_0x6220b6;logger[_0x87f2('0xc')]('The\x20Enduser\x20ID\x20is:',_0x30481e['id']);return getTicket(_0x46e77c,_0x520139,_0x30481e,_0x3c2bb0,_0x20063d);})[_0x87f2('0x14')](function(_0x7ceb79){if(_0x7ceb79){logger[_0x87f2('0xc')](_0x87f2('0x51'),_0x7ceb79['id']);switch(_0x46e77c['type']){case _0x87f2('0x52'):logger['info'](_0x87f2('0x53'),_0x87f2('0x54'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x55'),_0x46e77c[_0x87f2('0x10')],_0x520139['id'],_0x7ceb79['id']),'method':_0x87f2('0x26')});case _0x87f2('0x56'):logger[_0x87f2('0xc')]('[QUEUE]',_0x87f2('0x57'));emit(util[_0x87f2('0xe')]('user:%s',_0x1b9bee[_0x87f2('0x11')]),_0x87f2('0x58'),{'uri':util[_0x87f2('0xe')](_0x87f2('0x59'),_0x46e77c[_0x87f2('0x10')]['replace'](_0x87f2('0x5a'),''),_0x7ceb79['id'])});break;default:logger[_0x87f2('0x5b')](_0x87f2('0x53'),_0x87f2('0x5c'));}}})[_0x87f2('0x5d')](function(_0x2aa387){logger[_0x87f2('0x5b')](_0x87f2('0x5e'),util[_0x87f2('0x5f')](_0x2aa387,{'showHidden':!![],'depth':null}));});};exports[_0x87f2('0x60')]=function(_0x3dbcfb,_0x3492a9,_0x2d05dd,_0x11c4e2,_0xab3867,_0x2aff1c,_0x43f2d1){var _0x8817ab,_0x5a271f;_0x2aff1c['remoteUri']=intUtil[_0x87f2('0x47')](_0x2aff1c['remoteUri']);_0x2aff1c[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x2aff1c['serverUrl']);if(_0x43f2d1&&_0x43f2d1[_0x87f2('0x61')]&&_0x43f2d1[_0x87f2('0x61')]!=='none'){logger[_0x87f2('0xc')](_0x87f2('0x62'),_0x87f2('0x4a'));_0x3492a9[_0x87f2('0x4b')]=util[_0x87f2('0xe')](_0x87f2('0x4c'),_0x2aff1c[_0x87f2('0x48')],_0x3492a9[_0x87f2('0x4d')],md5(_0x3492a9[_0x87f2('0x4d')]));}headers['Authorization']=getAuth(_0x2aff1c);return getUser(_0x2aff1c,_0x11c4e2[_0x87f2('0x63')])[_0x87f2('0x14')](function(_0x2dd5ec){_0x8817ab=_0x2dd5ec;logger[_0x87f2('0xc')](_0x87f2('0x4e'),_0x8817ab['id']);return getEndUser(_0x2aff1c,_0x3492a9[_0x87f2('0x64')],_0x3492a9['destcalleridnum']);})[_0x87f2('0x14')](function(_0x486dd4){_0x5a271f=_0x486dd4;logger[_0x87f2('0xc')](_0x87f2('0x65'),_0x5a271f['id']);return getTicket(_0x2aff1c,_0x8817ab,_0x5a271f,_0x2d05dd,_0x3492a9);})[_0x87f2('0x14')](function(_0x4f0fc9){if(_0x4f0fc9){logger['info'](_0x87f2('0x51'),_0x4f0fc9['id']);switch(_0x2aff1c[_0x87f2('0x3a')]){case _0x87f2('0x52'):logger['info'](_0x87f2('0x62'),_0x87f2('0x54'));return request({'uri':util[_0x87f2('0xe')](_0x87f2('0x55'),_0x2aff1c[_0x87f2('0x10')],_0x8817ab['id'],_0x4f0fc9['id']),'method':'POST'});case'newTab':logger[_0x87f2('0xc')](_0x87f2('0x62'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x87f2('0xe')](_0x87f2('0x66'),_0x11c4e2[_0x87f2('0x11')]),_0x87f2('0x58'),{'uri':util['format'](_0x87f2('0x59'),_0x2aff1c['remoteUri'][_0x87f2('0x67')](_0x87f2('0x5a'),''),_0x4f0fc9['id'])});break;default:logger[_0x87f2('0x5b')](_0x87f2('0x62'),_0x87f2('0x5c'));}}})[_0x87f2('0x5d')](function(_0x3a3102){logger[_0x87f2('0x5b')](_0x87f2('0x68'),util['inspect'](_0x3a3102,{'showHidden':!![],'depth':null}));});};exports[_0x87f2('0x69')]=function(_0x53fa12,_0x1636a1,_0x5c338b,_0x5e5d68,_0x2ecf89,_0x20f830){var _0x5cf03d,_0x559352;_0x20f830[_0x87f2('0x10')]=intUtil['stripTrailingSlash'](_0x20f830[_0x87f2('0x10')]);_0x20f830[_0x87f2('0x48')]=intUtil[_0x87f2('0x47')](_0x20f830[_0x87f2('0x48')]);if(_0x2ecf89&&_0x2ecf89['monitor_format']){logger[_0x87f2('0xc')]('['+_0x1636a1['lastevent']['toUpperCase']()+']',_0x87f2('0x4a'));_0x1636a1[_0x87f2('0x4b')]=util[_0x87f2('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20f830[_0x87f2('0x48')],_0x1636a1[_0x87f2('0x4d')],md5(_0x1636a1[_0x87f2('0x4d')]));}else{_0x1636a1[_0x87f2('0x4b')]='';}headers['Authorization']=getAuth(_0x20f830);return getUser(_0x20f830)[_0x87f2('0x14')](function(_0x4bc491){_0x5cf03d=_0x4bc491;logger[_0x87f2('0xc')]('The\x20User\x20ID\x20is:',_0x5cf03d['id']);return getEndUser(_0x20f830,_0x1636a1[_0x87f2('0x4f')],_0x1636a1[_0x87f2('0x50')]);})['then'](function(_0x13bdc6){_0x559352=_0x13bdc6;logger['info'](_0x87f2('0x65'),_0x559352['id']);return getTicket(_0x20f830,_0x5cf03d,_0x559352,_0x5c338b,_0x1636a1);})[_0x87f2('0x14')](function(_0x3b2be4){if(_0x3b2be4){logger[_0x87f2('0xc')](_0x87f2('0x51'),_0x3b2be4['id']);}})['catch'](function(_0x7e0ef1){logger[_0x87f2('0x5b')]('['+_0x1636a1[_0x87f2('0x6a')][_0x87f2('0x6b')]()+']'+_0x87f2('0x6c'),util[_0x87f2('0x5f')](_0x7e0ef1,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x990a=['length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','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','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','error','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone'];(function(_0x151ca2,_0x1c0338){var _0x272f1a=function(_0x35fdd9){while(--_0x35fdd9){_0x151ca2['push'](_0x151ca2['shift']());}};_0x272f1a(++_0x1c0338);}(_0x990a,0x19d));var _0xa990=function(_0x255e6a,_0x4ad4f0){_0x255e6a=_0x255e6a-0x0;var _0x18a38a=_0x990a[_0x255e6a];return _0x18a38a;};'use strict';var _=require(_0xa990('0x0'));var rp=require(_0xa990('0x1'));var md5=require(_0xa990('0x2'));var util=require(_0xa990('0x3'));var Redis=require('ioredis');var intUtil=require(_0xa990('0x4'));var config=require(_0xa990('0x5'));var logger=require(_0xa990('0x6'))(_0xa990('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa990('0x8'))(new Redis(config[_0xa990('0x9')]));function emit(_0x1f1db0,_0x43086f,_0x2d36da){io['to'](_0x1f1db0)['emit'](_0x43086f,_0x2d36da);}var headers={'Content-Type':_0xa990('0xa'),'Accept':_0xa990('0xa')};function getTicket(_0x31b902,_0x4153a4,_0x3cfecd,_0x22d61f,_0x496a0d){logger[_0xa990('0xb')](_0xa990('0xc'));return request({'uri':util[_0xa990('0xd')](_0xa990('0xe'),_0x31b902[_0xa990('0xf')]),'method':_0xa990('0x10'),'body':{'ticket':_[_0xa990('0x11')]({'requester_id':_0x3cfecd['id'],'submitter_id':_0x4153a4?_0x4153a4['id']:undefined,'assignee_id':_0x4153a4?_0x4153a4['id']:undefined,'tags':getTags(_0x22d61f['Tags'],'name'),'subject':intUtil[_0xa990('0x12')](_0x22d61f[_0xa990('0x13')],_0x496a0d,'\x20'),'description':intUtil[_0xa990('0x12')](_0x22d61f[_0xa990('0x14')],_0x496a0d,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa990('0x12')](_0x22d61f[_0xa990('0x14')],_0x496a0d,'\x0a')}},getCustomFields(_0x22d61f[_0xa990('0x15')],_0x496a0d))}})[_0xa990('0x16')](function(_0x445041){logger[_0xa990('0xb')]('Ticket\x20created!');return _0x445041[_0xa990('0x17')];});}function getUser(_0x1ca7ad,_0x2990e5){if(intUtil[_0xa990('0x18')](_0x2990e5)){logger[_0xa990('0xb')](_0xa990('0x19'),_0x2990e5);return request({'uri':util[_0xa990('0xd')](_0xa990('0x1a'),_0x1ca7ad[_0xa990('0xf')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x2990e5)}})['then'](function(_0x50ab5c){if(_0x50ab5c[_0xa990('0x1b')]){logger[_0xa990('0xb')](_0xa990('0x1c'));return _['find'](_0x50ab5c[_0xa990('0x1d')],{'email':_0x2990e5,'role':'agent'});}else{logger[_0xa990('0xb')](_0xa990('0x1e'));return request({'uri':util['format'](_0xa990('0x1f'),_0x1ca7ad[_0xa990('0xf')])})[_0xa990('0x16')](function(_0x463e81){logger[_0xa990('0xb')](_0xa990('0x20'));return _0x463e81[_0xa990('0x21')];});}});}else{logger[_0xa990('0xb')](_0xa990('0x1e'));return request({'uri':util[_0xa990('0xd')](_0xa990('0x1f'),_0x1ca7ad[_0xa990('0xf')])})['then'](function(_0x4c7228){logger[_0xa990('0xb')]('Admin\x20account\x20selected.');return _0x4c7228[_0xa990('0x21')];});}}function getEndUser(_0x395e60,_0x4c3629,_0x3eee2a){logger['info'](_0xa990('0x22'),_0x3eee2a);return request({'uri':util[_0xa990('0xd')](_0xa990('0x1a'),_0x395e60[_0xa990('0xf')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x3eee2a)}})['then'](function(_0x2ba512){var _0x2eb0bb;if(_0x2ba512[_0xa990('0x1d')][_0xa990('0x23')]){_0x2ba512[_0xa990('0x1d')]=_[_0xa990('0x24')](_0x2ba512[_0xa990('0x1d')],{'suspended':![],'role':_0xa990('0x25')});if(_0x2ba512['results']['length']){_0x2eb0bb=_['first'](_0x2ba512[_0xa990('0x1d')]);}}if(_0x2eb0bb){logger[_0xa990('0xb')]('Enduser\x20found!');return _0x2eb0bb;}else{logger[_0xa990('0xb')](_0xa990('0x26'));return request({'uri':util[_0xa990('0xd')](_0xa990('0x27'),_0x395e60['remoteUri']),'method':_0xa990('0x10'),'body':{'user':{'role':_0xa990('0x25'),'name':util[_0xa990('0xd')](_0xa990('0x28'),_0x4c3629||_0x3eee2a),'phone':_0x3eee2a}}})[_0xa990('0x16')](function(_0x2100ef){logger['info'](_0xa990('0x29'));return _0x2100ef[_0xa990('0x21')];});}});}function getAuth(_0x347e8a){var _0x589a28;if(_0x347e8a[_0xa990('0x2a')]===_0xa990('0x2b')){_0x589a28=util[_0xa990('0xd')](_0xa990('0x2c'),_0x347e8a[_0xa990('0x2d')],_0x347e8a[_0xa990('0x2b')]);}else if(_0x347e8a[_0xa990('0x2a')]===_0xa990('0x2e')){_0x589a28=util[_0xa990('0xd')](_0xa990('0x2f'),_0x347e8a['username'],_0x347e8a[_0xa990('0x2e')]);}return util[_0xa990('0xd')](_0xa990('0x30'),new Buffer(_0x589a28)[_0xa990('0x31')]('base64'));}function request(_0x31a070){logger[_0xa990('0x32')](_0xa990('0x33'),JSON[_0xa990('0x34')](_0x31a070));return rp(_[_0xa990('0x35')](_0x31a070,{'method':_0xa990('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x1c7f59,_0x4c418a){var _0x5a0b07=[];if(_0x1c7f59&&_0x1c7f59[_0xa990('0x23')]>0x0){_0x5a0b07=_[_0xa990('0x37')](_0x1c7f59,_0x4c418a);}return _0x5a0b07;}function getCustomFields(_0x4e5645,_0x53c627){var _0x48cb6c=[];var _0x5c6b28={'custom_fields':[]};if(_0x4e5645[_0xa990('0x23')]>0x0){_[_0xa990('0x38')](_0x4e5645,function(_0x2e3453){if(_[_0xa990('0x39')]([_0xa990('0x3a'),_0xa990('0x3b')],_0x2e3453[_0xa990('0x3c')])&&_0x2e3453[_0xa990('0x3d')]&&!_0x2e3453[_0xa990('0x3e')]){_0x5c6b28[_0x2e3453[_0xa990('0x3d')][_0xa990('0x3f')]()]=_0x2e3453['content'][_0xa990('0x31')]();}else if(_[_0xa990('0x39')]([_0xa990('0x3a'),_0xa990('0x3b')],_0x2e3453[_0xa990('0x3c')])&&_0x2e3453[_0xa990('0x40')]&&_0x2e3453[_0xa990('0x3e')]){_0x5c6b28[_0xa990('0x41')][_0xa990('0x42')]({'id':_0x2e3453[_0xa990('0x40')],'value':_0x2e3453['content']['toString']()});}else if(_0x2e3453['type']===_0xa990('0x43')&&_0x2e3453[_0xa990('0x44')]&&_0x2e3453[_0xa990('0x40')]&&_0x2e3453[_0xa990('0x3e')]){_0x53c627[_0x2e3453[_0xa990('0x44')]]&&_0x5c6b28['custom_fields']['push']({'id':_0x2e3453[_0xa990('0x40')],'value':_0x53c627[_0x2e3453[_0xa990('0x44')]]['toString']()});}else if(_0x2e3453['type']===_0xa990('0x45')&&_0x2e3453[_0xa990('0x46')]&&_0x2e3453[_0xa990('0x46')][_0xa990('0x47')]&&_0x2e3453[_0xa990('0x40')]&&_0x2e3453['customField']){_0x53c627[_0x2e3453['Variable']['name'][_0xa990('0x3f')]()]&&_0x5c6b28[_0xa990('0x41')][_0xa990('0x42')]({'id':_0x2e3453[_0xa990('0x40')],'value':_0x53c627[_0x2e3453[_0xa990('0x46')][_0xa990('0x47')][_0xa990('0x3f')]()]['toString']()});}});}return _0x5c6b28;}exports['queue']=function(_0x27e886,_0x3dc076,_0x45c11c,_0x63f3ed,_0x4326c3,_0x483330){var _0x497a9e,_0x2c550f;_0x483330[_0xa990('0xf')]=intUtil[_0xa990('0x48')](_0x483330['remoteUri']);_0x483330[_0xa990('0x49')]=intUtil['stripTrailingSlash'](_0x483330[_0xa990('0x49')]);if(_0x4326c3&&_0x4326c3[_0xa990('0x4a')]){logger['info'](_0xa990('0x4b'),_0xa990('0x4c'));_0x3dc076[_0xa990('0x4d')]=util[_0xa990('0xd')](_0xa990('0x4e'),_0x483330[_0xa990('0x49')],_0x3dc076[_0xa990('0x4f')],md5(_0x3dc076['uniqueid']));}else{_0x3dc076[_0xa990('0x4d')]='';}headers[_0xa990('0x50')]=getAuth(_0x483330);return getUser(_0x483330,_0x63f3ed[_0xa990('0x51')])[_0xa990('0x16')](function(_0x39fca0){_0x497a9e=_0x39fca0;logger[_0xa990('0xb')](_0xa990('0x52'),_0x497a9e['id']);return getEndUser(_0x483330,_0x3dc076[_0xa990('0x53')],_0x3dc076[_0xa990('0x54')]);})[_0xa990('0x16')](function(_0x9239e7){_0x2c550f=_0x9239e7;logger[_0xa990('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2c550f['id']);return getTicket(_0x483330,_0x497a9e,_0x2c550f,_0x45c11c,_0x3dc076);})['then'](function(_0x9b0d8d){if(_0x9b0d8d){logger['info']('The\x20Ticket\x20ID\x20is:',_0x9b0d8d['id']);switch(_0x483330[_0xa990('0x3c')]){case _0xa990('0x55'):logger[_0xa990('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa990('0xd')](_0xa990('0x56'),_0x483330[_0xa990('0xf')],_0x497a9e['id'],_0x9b0d8d['id']),'method':_0xa990('0x10')});case _0xa990('0x57'):logger['info'](_0xa990('0x4b'),_0xa990('0x58'));emit(util[_0xa990('0xd')](_0xa990('0x59'),_0x63f3ed[_0xa990('0x47')]),_0xa990('0x5a'),{'uri':util[_0xa990('0xd')](_0xa990('0x5b'),_0x483330[_0xa990('0xf')][_0xa990('0x5c')](_0xa990('0x5d'),''),_0x9b0d8d['id'])});break;default:logger['error']('[QUEUE]',_0xa990('0x5e'));}}})['catch'](function(_0x12b0dd){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa990('0x5f')](_0x12b0dd,{'showHidden':!![],'depth':null}));});};exports[_0xa990('0x60')]=function(_0x40f21b,_0x2ed463,_0x333ba4,_0x5af62f,_0x5656d9,_0x404a1c,_0x2f17b4){var _0x4c7f18,_0x397b78;_0x404a1c[_0xa990('0xf')]=intUtil[_0xa990('0x48')](_0x404a1c['remoteUri']);_0x404a1c['serverUrl']=intUtil[_0xa990('0x48')](_0x404a1c[_0xa990('0x49')]);if(_0x2f17b4&&_0x2f17b4[_0xa990('0x61')]&&_0x2f17b4['recordingFormat']!==_0xa990('0x62')){logger['info'](_0xa990('0x63'),_0xa990('0x4c'));_0x2ed463[_0xa990('0x4d')]=util[_0xa990('0xd')](_0xa990('0x4e'),_0x404a1c[_0xa990('0x49')],_0x2ed463[_0xa990('0x4f')],md5(_0x2ed463[_0xa990('0x4f')]));}headers[_0xa990('0x50')]=getAuth(_0x404a1c);return getUser(_0x404a1c,_0x5af62f[_0xa990('0x51')])[_0xa990('0x16')](function(_0x1a86e2){_0x4c7f18=_0x1a86e2;logger[_0xa990('0xb')](_0xa990('0x52'),_0x4c7f18['id']);return getEndUser(_0x404a1c,_0x2ed463[_0xa990('0x64')],_0x2ed463[_0xa990('0x65')]);})[_0xa990('0x16')](function(_0x2ded30){_0x397b78=_0x2ded30;logger[_0xa990('0xb')](_0xa990('0x66'),_0x397b78['id']);return getTicket(_0x404a1c,_0x4c7f18,_0x397b78,_0x333ba4,_0x2ed463);})[_0xa990('0x16')](function(_0x46d8a5){if(_0x46d8a5){logger['info'](_0xa990('0x67'),_0x46d8a5['id']);switch(_0x404a1c[_0xa990('0x3c')]){case'integrationTab':logger[_0xa990('0xb')](_0xa990('0x63'),_0xa990('0x68'));return request({'uri':util[_0xa990('0xd')](_0xa990('0x56'),_0x404a1c[_0xa990('0xf')],_0x4c7f18['id'],_0x46d8a5['id']),'method':_0xa990('0x10')});case _0xa990('0x57'):logger[_0xa990('0xb')](_0xa990('0x63'),_0xa990('0x58'));emit(util[_0xa990('0xd')](_0xa990('0x59'),_0x5af62f['name']),_0xa990('0x5a'),{'uri':util[_0xa990('0xd')](_0xa990('0x5b'),_0x404a1c[_0xa990('0xf')]['replace'](_0xa990('0x5d'),''),_0x46d8a5['id'])});break;default:logger[_0xa990('0x69')](_0xa990('0x63'),_0xa990('0x5e'));}}})[_0xa990('0x6a')](function(_0x1d7940){logger[_0xa990('0x69')](_0xa990('0x6b'),util['inspect'](_0x1d7940,{'showHidden':!![],'depth':null}));});};exports[_0xa990('0x6c')]=function(_0x3605ce,_0x527be4,_0x3d80ae,_0x33d781,_0x18c11f,_0x2f8c5a){var _0xf70d3e,_0x57dce8;_0x2f8c5a[_0xa990('0xf')]=intUtil[_0xa990('0x48')](_0x2f8c5a['remoteUri']);_0x2f8c5a[_0xa990('0x49')]=intUtil[_0xa990('0x48')](_0x2f8c5a[_0xa990('0x49')]);if(_0x18c11f&&_0x18c11f[_0xa990('0x4a')]){logger[_0xa990('0xb')]('['+_0x527be4['lastevent'][_0xa990('0x6d')]()+']',_0xa990('0x4c'));_0x527be4[_0xa990('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2f8c5a[_0xa990('0x49')],_0x527be4[_0xa990('0x4f')],md5(_0x527be4[_0xa990('0x4f')]));}else{_0x527be4[_0xa990('0x4d')]='';}headers[_0xa990('0x50')]=getAuth(_0x2f8c5a);return getUser(_0x2f8c5a)[_0xa990('0x16')](function(_0x241644){_0xf70d3e=_0x241644;logger[_0xa990('0xb')](_0xa990('0x52'),_0xf70d3e['id']);return getEndUser(_0x2f8c5a,_0x527be4[_0xa990('0x53')],_0x527be4[_0xa990('0x54')]);})['then'](function(_0x4c1883){_0x57dce8=_0x4c1883;logger[_0xa990('0xb')](_0xa990('0x66'),_0x57dce8['id']);return getTicket(_0x2f8c5a,_0xf70d3e,_0x57dce8,_0x3d80ae,_0x527be4);})[_0xa990('0x16')](function(_0x59ce33){if(_0x59ce33){logger[_0xa990('0xb')](_0xa990('0x67'),_0x59ce33['id']);}})[_0xa990('0x6a')](function(_0x5d8800){logger['error']('['+_0x527be4[_0xa990('0x6e')][_0xa990('0x6d')]()+']'+_0xa990('0x6f'),util[_0xa990('0x5f')](_0x5d8800,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0bbc9d8..8db24c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab1e=['isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','enduserType','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Leads','nothing','Contacts','moduleCreate','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','com','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','unmanaged','monitor_format','Inbound','toUpperCase','util','./util','moment','ioredis','bluebird','zoho','defaults','localhost','redis','emit','debug','[HTTP]','length','forEach','string','picklist','type','idField','content','toString','variable','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','isNil','access_token'];(function(_0x56c2c1,_0x6737c8){var _0x20005b=function(_0x1f371b){while(--_0x1f371b){_0x56c2c1['push'](_0x56c2c1['shift']());}};_0x20005b(++_0x6737c8);}(_0xab1e,0x81));var _0xeab1=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xab1e[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xeab1('0x0'));var intUtil=require(_0xeab1('0x1'));var moment=require(_0xeab1('0x2'));var Redis=require(_0xeab1('0x3'));var BPromise=require(_0xeab1('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xeab1('0x5'));config['redis']=_[_0xeab1('0x6')](config['redis'],{'host':_0xeab1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeab1('0x8')]));function emit(_0x214ec8,_0x491455,_0x291edd){io['to'](_0x214ec8)[_0xeab1('0x9')](_0x491455,_0x291edd);}function request(_0x36fccb){logger[_0xeab1('0xa')](_0xeab1('0xb'),JSON['stringify'](_0x36fccb));return rp(_0x36fccb);}function getCustomFields(_0x20a23f,_0x4560f3){var _0x2ce755={};if(_0x20a23f[_0xeab1('0xc')]>0x0){_[_0xeab1('0xd')](_0x20a23f,function(_0x4cec24){if(_['includes']([_0xeab1('0xe'),_0xeab1('0xf')],_0x4cec24[_0xeab1('0x10')])&&_0x4cec24[_0xeab1('0x11')]){_0x2ce755[_0x4cec24[_0xeab1('0x11')]]=_0x4cec24[_0xeab1('0x12')][_0xeab1('0x13')]();}else if(_0x4cec24[_0xeab1('0x10')]===_0xeab1('0x14')&&_0x4cec24['variableName']&&_0x4cec24[_0xeab1('0x11')]&&_0x4560f3[_0x4cec24['variableName']]){_0x2ce755[_0x4cec24[_0xeab1('0x11')]]=_0x4560f3[_0x4cec24[_0xeab1('0x15')]][_0xeab1('0x13')]();}else if(_0x4cec24['type']===_0xeab1('0x16')&&_0x4cec24['Variable']&&_0x4cec24['Variable'][_0xeab1('0x17')]&&_0x4cec24[_0xeab1('0x11')]&&_0x4560f3[_0x4cec24[_0xeab1('0x18')]['name'][_0xeab1('0x19')]()]){_0x2ce755[_0x4cec24['idField']]=_0x4560f3[_0x4cec24[_0xeab1('0x18')][_0xeab1('0x17')][_0xeab1('0x19')]()][_0xeab1('0x13')]();}});}return _0x2ce755;}function getName(_0x36e187){if(_0x36e187[_0xeab1('0x1a')]('\x20')>0x0){var _0x2b8cf8=_0x36e187[_0xeab1('0x1b')](/ (.+)/);if(_0x2b8cf8[0x1]){return _0x2b8cf8;}}return[_0x36e187,_0x36e187];}var accountsTokens={};function getAccessToken(_0x392062){return new Promise(function(_0x124acb,_0x39d500){if(!_[_0xeab1('0x1c')](accountsTokens[_0x392062['id']])&&!_[_0xeab1('0x1c')](accountsTokens[_0x392062['id']][_0xeab1('0x1d')])){if(moment()[_0xeab1('0x1e')](accountsTokens[_0x392062['id']][_0xeab1('0x1f')])){_0x124acb(accountsTokens[_0x392062['id']][_0xeab1('0x1d')]);}}var _0x36d61a;switch(_0x392062[_0xeab1('0x20')]){case'US':_0x36d61a=_0xeab1('0x21');break;case'AU':_0x36d61a=_0xeab1('0x22');break;case'EU':_0x36d61a=_0xeab1('0x23');break;case'IN':_0x36d61a='https://accounts.zoho.in';break;case'CN':_0x36d61a=_0xeab1('0x24');break;default:_0x36d61a=_0xeab1('0x23');break;}var _0x179dba={'method':_0xeab1('0x25'),'uri':_0x36d61a+_0xeab1('0x26'),'qs':{'refresh_token':_0x392062['refreshToken'],'client_id':_0x392062[_0xeab1('0x27')],'client_secret':_0x392062[_0xeab1('0x28')],'grant_type':_0xeab1('0x29')},'json':!![]};return rp(_0x179dba)[_0xeab1('0x2a')](function(_0x576d9a){accountsTokens[_0x392062['id']]={'access_token':_0x576d9a[_0xeab1('0x1d')],'expires_in':moment()['add'](_0x576d9a[_0xeab1('0x1f')],_0xeab1('0x2b'))};_0x124acb(_0x576d9a['access_token']);})[_0xeab1('0x2c')](function(_0x15f317){logger['error'](_0xeab1('0x2d'),_0x15f317[_0xeab1('0x2e')]);_0x39d500(_0x15f317);});});}function getUser(_0x3f67fb,_0x1eda15,_0x10f1a0,_0x3893ba){logger[_0xeab1('0x2f')](_0xeab1('0x30'));return request({'method':'GET','uri':util[_0xeab1('0x31')](_0xeab1('0x32'),_0x1eda15),'qs':{'type':_0xeab1('0x33')},'headers':{'Authorization':_0xeab1('0x34')+_0x3f67fb},'json':!![]})[_0xeab1('0x2a')](function(_0x2cd7ae){if(_0x2cd7ae[_0xeab1('0x35')]){var _0x7119fc=-0x1;if(_[_0xeab1('0x36')](_0x2cd7ae[_0xeab1('0x35')])){if(!_['isNil'](_0x3893ba)){_0x7119fc=_['findIndex'](_0x2cd7ae[_0xeab1('0x35')],function(_0x3f3e07){return _0x3f3e07[_0xeab1('0x37')]===_0x3893ba;});}if(_0x7119fc>=0x0){logger[_0xeab1('0x2f')]('Agent\x20found!');}else{logger[_0xeab1('0x2f')](_0xeab1('0x38'));_0x7119fc=_[_0xeab1('0x39')](_0x2cd7ae[_0xeab1('0x35')],function(_0x394843){return _0x394843[_0xeab1('0x3a')]['name']===_0xeab1('0x3b');});}return _0x2cd7ae['users'][_0x7119fc];}else{if(_0x2cd7ae['user'][_0xeab1('0x3a')][_0xeab1('0x17')]===_0xeab1('0x3b')){logger[_0xeab1('0x2f')](_0xeab1('0x38'));user=_0x2cd7ae[_0xeab1('0x3c')];return user;}else{logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](_0x2cd7ae));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xeab1('0x3f')](_0x2cd7ae));}}}else{logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](_0x2cd7ae));throw new Error(_0xeab1('0x40')+JSON['stringify'](_0x2cd7ae));}})[_0xeab1('0x2c')](function(_0x4932ce){console[_0xeab1('0x3d')](_0x4932ce);});}function getZohoUser(_0x5e6364,_0x113835){return new BPromise(function(_0x5c36a2,_0xa23050){request(_0x5e6364)['then'](function(_0x58730e){var _0x12a7f1=null;if(_0x58730e){_0x12a7f1=_0x58730e[_0xeab1('0x41')][0x0];_0x12a7f1['enduserType']=_0x113835;}_0x5c36a2(_0x12a7f1);})['catch'](function(_0xe9d64){_0xa23050(_0xe9d64);});});}function createEndUser(_0x38a427,_0x3d7236,_0x4e0eee,_0x415307,_0x31b1de,_0x2034b2){var _0x4e0eee=getName(_0x4e0eee);return request({'method':_0xeab1('0x25'),'uri':_0xeab1('0x42')+_0x3d7236+_0xeab1('0x43')+_[_0xeab1('0x44')](_0x2034b2['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4e0eee[0x1],'First_Name':_0x4e0eee[0x0],'Phone':_0x415307,'Owner':{'name':!_['isNil'](_0x31b1de[_0xeab1('0x45')][_0xeab1('0x17')])?_0x31b1de[_0xeab1('0x45')][_0xeab1('0x17')]:!_[_0xeab1('0x1c')](_0x31b1de[_0xeab1('0x46')])?_0x31b1de[_0xeab1('0x46')]+'\x20'+_0x31b1de[_0xeab1('0x47')]:_0x31b1de[_0xeab1('0x47')],'id':_0x31b1de['id']}}]},'headers':{'Authorization':_0xeab1('0x34')+_0x38a427},'json':!![]})[_0xeab1('0x2a')](function(_0x3fb265){if(_0x3fb265&&_0x3fb265['data'][0x0][_0xeab1('0x48')]===_0xeab1('0x49')){var _0x101d77=_0x3fb265[_0xeab1('0x41')][0x0]['details'];_0x101d77[_0xeab1('0x4a')]=_['startCase'](_0x2034b2['moduleCreate'])+'s';return _0x101d77;}logger[_0xeab1('0x3d')](_0xeab1('0x3e'),JSON[_0xeab1('0x3f')](data));throw new Error(_0xeab1('0x4b')+JSON[_0xeab1('0x3f')](data));})[_0xeab1('0x2c')](function(_0x24739a){console[_0xeab1('0x4c')](_0xeab1('0x4d'),_0x24739a);});}function getEndUser(_0x35f1b4,_0x5131ca,_0x506fbd,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c){var _0x5897d6={'method':_0xeab1('0x4e'),'uri':'','headers':{'Authorization':_0xeab1('0x34')+_0x35f1b4},'json':!![]};switch(_0x4da62c['moduleSearch']){case _0xeab1('0x4f'):_0x5897d6[_0xeab1('0x50')]='https://www.zohoapis.'+_0x5131ca+_0xeab1('0x51')+_0x22d305+'))';return getZohoUser(_0x5897d6,'Contacts')[_0xeab1('0x2a')](function(_0x24ebeb){if(_0x24ebeb)return _0x24ebeb;_0x5897d6[_0xeab1('0x50')]=_0xeab1('0x42')+_0x5131ca+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x52'))['then'](function(_0x3d5971){if(_0x3d5971)return _0x3d5971;if(_0x4da62c['moduleCreate']!=_0xeab1('0x53')){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});});break;case'contact':_0x5897d6[_0xeab1('0x50')]='https://www.zohoapis.'+_0x5131ca+_0xeab1('0x51')+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x54'))[_0xeab1('0x2a')](function(_0xbb20bb){if(_0xbb20bb)return _0xbb20bb;if(_0x4da62c[_0xeab1('0x55')]!='nothing'){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});break;case _0xeab1('0x56'):_0x5897d6['uri']=_0xeab1('0x42')+_0x5131ca+_0xeab1('0x57')+_0x22d305+'))';return getZohoUser(_0x5897d6,_0xeab1('0x52'))[_0xeab1('0x2a')](function(_0x2c7e40){if(_0x2c7e40)return _0x2c7e40;if(_0x4da62c['moduleCreate']!='nothing'){return createEndUser(_0x35f1b4,_0x5131ca,_0x4be99a,_0x22d305,_0x6779d4,_0x4da62c);}else{return{};}});break;}}function getCall(_0x5682a1,_0x27ac73,_0x672a7c,_0x32eb23,_0x4093f5,_0x5e47e9,_0x4691c9,_0x30f90d){logger[_0xeab1('0x2f')](_0xeab1('0x58'));var _0x48a391={};_0x48a391[_0xeab1('0x59')]={'name':!_[_0xeab1('0x1c')](_0x32eb23[_0xeab1('0x45')]['name'])&&!_[_0xeab1('0x1c')](_0x32eb23['profile']['name'])&&_0x32eb23[_0xeab1('0x3a')]['name']===_0xeab1('0x5a')?_0x32eb23['role'][_0xeab1('0x17')]:!_[_0xeab1('0x1c')](_0x32eb23[_0xeab1('0x46')])?_0x32eb23[_0xeab1('0x46')]+'\x20'+_0x32eb23['last_name']:_0x32eb23[_0xeab1('0x47')],'id':_0x32eb23['id']};_0x48a391[_0xeab1('0x5b')]=intUtil[_0xeab1('0x5c')](_0x5e47e9[_0xeab1('0x5d')],_0x4691c9,'\x20');_0x48a391[_0xeab1('0x5e')]=intUtil[_0xeab1('0x5c')](_0x5e47e9[_0xeab1('0x5f')],_0x4691c9,'\x0a');if(_0x4093f5[_0xeab1('0x4a')]==='Contacts'){_0x48a391[_0xeab1('0x60')]={'name':!_[_0xeab1('0x1c')](_0x4093f5[_0xeab1('0x61')])?_0x4093f5[_0xeab1('0x61')]:!_['isNil'](_0x4093f5[_0xeab1('0x62')])?_0x4093f5['First_Name']+'\x20'+_0x4093f5[_0xeab1('0x63')]:_0x4093f5[_0xeab1('0x63')],'id':_0x4093f5['id']};}if(_0x4093f5[_0xeab1('0x4a')]===_0xeab1('0x52')){_0x48a391[_0xeab1('0x64')]={'name':!_[_0xeab1('0x1c')](_0x4093f5['Full_Name'])?_0x4093f5[_0xeab1('0x61')]:!_['isNil'](_0x4093f5[_0xeab1('0x62')])?_0x4093f5[_0xeab1('0x62')]+'\x20'+_0x4093f5[_0xeab1('0x63')]:_0x4093f5[_0xeab1('0x63')],'id':_0x4093f5['id']};_0x48a391[_0xeab1('0x65')]=_['startCase'](_0x4093f5[_0xeab1('0x4a')]);}if(_0x4691c9['talktime']){_0x48a391[_0xeab1('0x66')]=moment[_0xeab1('0x67')](parseInt(_0x4691c9[_0xeab1('0x68')])*0x3e8)[_0xeab1('0x31')](_0xeab1('0x69'));}else if(_0x4691c9[_0xeab1('0x6a')]&&_0x4691c9[_0xeab1('0x6b')]){_0x48a391[_0xeab1('0x66')]=moment[_0xeab1('0x67')](moment(_0x4691c9[_0xeab1('0x6b')],_0xeab1('0x6c'))[_0xeab1('0x6d')](moment(_0x4691c9[_0xeab1('0x6e')],_0xeab1('0x6c'))))[_0xeab1('0x31')](_0xeab1('0x69'));}switch(_0x4691c9[_0xeab1('0x6f')]){case _0xeab1('0x70'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x72');break;case _0xeab1('0x73'):case _0xeab1('0x74'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x75');break;case'rejected':_0x48a391[_0xeab1('0x71')]='Rejected';break;case _0xeab1('0x76'):_0x48a391[_0xeab1('0x71')]=_0xeab1('0x77');break;case _0xeab1('0x78'):_0x48a391['Call_Result']=_0xeab1('0x79');default:}_0x48a391[_0xeab1('0x7a')]=(_0x30f90d===_0xeab1('0x7b')?moment(_0x4691c9[_0xeab1('0x6e')])[_0xeab1('0x31')](_0xeab1('0x6c')):moment(_0x4691c9[_0xeab1('0x7c')])['format'](_0xeab1('0x6c')))||moment()['format'](_0xeab1('0x6c'));_0x48a391['Call_Type']=_0x30f90d||'Inbound';_0x48a391=_['merge'](_0x48a391,getCustomFields(_0x5e47e9[_0xeab1('0x7d')],_0x4691c9));return request({'method':_0xeab1('0x25'),'uri':_0xeab1('0x42')+_0x27ac73+_0xeab1('0x7e'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5682a1},'body':{'data':[_0x48a391]},'json':!![]})[_0xeab1('0x2a')](function(_0x26936f){if(_0x26936f&&_0x26936f[_0xeab1('0x41')][0x0]['code']===_0xeab1('0x49')){logger['info'](_0xeab1('0x7f'));return{'id':_0x26936f['data'][0x0]['details']['id']};}})[_0xeab1('0x2c')](function(_0x205b45){logger['info'](_0xeab1('0x80'),_0x205b45[_0xeab1('0x2e')]);console[_0xeab1('0x4c')](_0xeab1('0x80'),_0x205b45);});}exports['queue']=function(_0x180eef,_0x50c723,_0x35dea5,_0x3d2d62,_0x56a901,_0x5c10cf){var _0x32b836,_0x1de292,_0x476c6f;_0x5c10cf[_0xeab1('0x81')]=intUtil[_0xeab1('0x82')](_0x5c10cf[_0xeab1('0x81')]);_0x5c10cf['serverUrl']=intUtil['stripTrailingSlash'](_0x5c10cf[_0xeab1('0x83')]);if(_0x56a901&&_0x56a901['monitor_format']){logger['info'](_0xeab1('0x84'),_0xeab1('0x85'));_0x50c723[_0xeab1('0x86')]=_0x5c10cf[_0xeab1('0x83')]+_0xeab1('0x87')+_0x50c723[_0xeab1('0x88')]+_0xeab1('0x89')+md5(_0x50c723[_0xeab1('0x88')]);}else{_0x50c723['recordingURL']='';}var _0x41ee93=_0x5c10cf[_0xeab1('0x81')]===_0xeab1('0x8a')?'eu':'com';return getAccessToken(_0x5c10cf)[_0xeab1('0x2a')](function(_0x1b8678){_0x476c6f=_0x1b8678;return getUser(_0x476c6f,_0x41ee93,_0x5c10cf,_0x3d2d62[_0xeab1('0x37')]);})['then'](function(_0xca6fd7){_0x32b836=_0xca6fd7;logger[_0xeab1('0x2f')](_0xeab1('0x8b'),_0x32b836['id']);return getEndUser(_0x476c6f,_0x41ee93,_0x5c10cf,_0x50c723[_0xeab1('0x8c')],_0x50c723[_0xeab1('0x8d')],_0x32b836,_0x35dea5);})['then'](function(_0x43ea73){_0x1de292=_0x43ea73;return getCall(_0x476c6f,_0x41ee93,_0x5c10cf,_0x32b836,_0x1de292,_0x35dea5,_0x50c723,'Inbound');})[_0xeab1('0x2a')](function(_0x11e71f){if(_0x11e71f){logger[_0xeab1('0x2f')](_0xeab1('0x8e'),_0x11e71f['id']);logger['info']('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeab1('0x31')](_0xeab1('0x8f'),_0x3d2d62['name']),'trigger:browser:url',{'uri':_0xeab1('0x90')+_0x5c10cf[_0xeab1('0x81')]+_0xeab1('0x91')+_0x11e71f['id']});}})[_0xeab1('0x2c')](function(_0x3ec4b1){logger[_0xeab1('0x3d')](_0xeab1('0x84'),JSON[_0xeab1('0x3f')](_0x3ec4b1));});};exports['outbound']=function(_0x5b8664,_0x3acd78,_0x485cf8,_0x38a0b1,_0x4de2ef,_0x126c4b,_0x4b4bb3){var _0x4fc414,_0x59c11c,_0x197758;_0x126c4b[_0xeab1('0x81')]=intUtil['stripTrailingSlash'](_0x126c4b[_0xeab1('0x81')]);_0x126c4b[_0xeab1('0x83')]=intUtil[_0xeab1('0x82')](_0x126c4b[_0xeab1('0x83')]);if(_0x4b4bb3&&_0x4b4bb3[_0xeab1('0x92')]&&_0x4b4bb3[_0xeab1('0x92')]!==_0xeab1('0x93')){logger[_0xeab1('0x2f')]('[OUTBOUND]',_0xeab1('0x85'));_0x3acd78[_0xeab1('0x86')]=_0x126c4b['serverUrl']+_0xeab1('0x87')+_0x3acd78[_0xeab1('0x88')]+_0xeab1('0x89')+md5(_0x3acd78['uniqueid']);}var _0x1eb247=_0x126c4b['host']==='zoho.eu'?'eu':_0xeab1('0x94');return getAccessToken(_0x126c4b)[_0xeab1('0x2a')](function(_0x3b8697){_0x197758=_0x3b8697;return getUser(_0x197758,_0x1eb247,_0x126c4b,_0x38a0b1['email']);})['then'](function(_0x542b0c){_0x4fc414=_0x542b0c;logger[_0xeab1('0x2f')](_0xeab1('0x8b'),_0x4fc414['id']);return getEndUser(_0x197758,_0x1eb247,_0x126c4b,_0x3acd78[_0xeab1('0x95')],_0x3acd78[_0xeab1('0x96')],_0x4fc414,_0x485cf8);})[_0xeab1('0x2a')](function(_0x18afd6){_0x59c11c=_0x18afd6;return getCall(_0x197758,_0x1eb247,_0x126c4b,_0x4fc414,_0x59c11c,_0x485cf8,_0x3acd78,_0xeab1('0x97'));})[_0xeab1('0x2a')](function(_0x1fe3c9){if(_0x1fe3c9){logger[_0xeab1('0x2f')](_0xeab1('0x8e'),_0x1fe3c9['id']);logger[_0xeab1('0x2f')](_0xeab1('0x98'),_0xeab1('0x99'));emit(util[_0xeab1('0x31')]('user:%s',_0x38a0b1[_0xeab1('0x17')]),_0xeab1('0x9a'),{'uri':_0xeab1('0x90')+_0x126c4b['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x1fe3c9['id']});}})[_0xeab1('0x2c')](function(_0x1a6498){logger[_0xeab1('0x3d')](_0xeab1('0x98'),JSON[_0xeab1('0x3f')](_0x1a6498));});};exports[_0xeab1('0x9b')]=function(_0x2f6c28,_0x3e088b,_0x572e35,_0x5abf4f,_0x1bcd57,_0x579d06){var _0x2eabe1,_0x2c6a3f,_0x848b6d;_0x579d06[_0xeab1('0x81')]=intUtil['stripTrailingSlash'](_0x579d06[_0xeab1('0x81')]);_0x579d06[_0xeab1('0x83')]=intUtil[_0xeab1('0x82')](_0x579d06[_0xeab1('0x83')]);if(_0x1bcd57&&_0x1bcd57[_0xeab1('0x9c')]){logger['info']('['+_0x3e088b[_0xeab1('0x6f')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3e088b[_0xeab1('0x86')]=_0x579d06[_0xeab1('0x83')]+_0xeab1('0x87')+_0x3e088b['uniqueid']+_0xeab1('0x89')+md5(_0x3e088b[_0xeab1('0x88')]);}else{_0x3e088b[_0xeab1('0x86')]='';}var _0x29fd43=_0x579d06['host']===_0xeab1('0x8a')?'eu':_0xeab1('0x94');return getAccessToken(_0x579d06)['then'](function(_0x1bf7c3){_0x848b6d=_0x1bf7c3;return getUser(_0x848b6d,_0x29fd43,_0x579d06);})[_0xeab1('0x2a')](function(_0x563a75){_0x2eabe1=_0x563a75;logger['info'](_0xeab1('0x8b'),_0x2eabe1['id']);return getEndUser(_0x848b6d,_0x29fd43,_0x579d06,_0x3e088b[_0xeab1('0x8c')],_0x3e088b[_0xeab1('0x8d')],_0x2eabe1,_0x572e35);})[_0xeab1('0x2a')](function(_0x25c49b){_0x2c6a3f=_0x25c49b;return getCall(_0x848b6d,_0x29fd43,_0x579d06,_0x2eabe1,_0x2c6a3f,_0x572e35,_0x3e088b,_0xeab1('0x9d'));})[_0xeab1('0x2a')](function(_0x40b7f1){if(_0x40b7f1){logger['info'](_0xeab1('0x8e'),_0x40b7f1['id']);}})['catch'](function(_0x2ad7e7){logger['error']('['+_0x3e088b[_0xeab1('0x6f')][_0xeab1('0x9e')]()+']',JSON[_0xeab1('0x3f')](_0x2ad7e7));});};
\ No newline at end of file
+var _0xd2c2=['https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','unmanaged','toUpperCase','calleridname','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','then','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','Contacts','Leads','nothing','contact','uri'];(function(_0x4a00d0,_0x56d533){var _0x6e25bf=function(_0x147ed5){while(--_0x147ed5){_0x4a00d0['push'](_0x4a00d0['shift']());}};_0x6e25bf(++_0x56d533);}(_0xd2c2,0x18c));var _0x2d2c=function(_0x28d95f,_0x3c2902){_0x28d95f=_0x28d95f-0x0;var _0x4d842c=_0xd2c2[_0x28d95f];return _0x4d842c;};'use strict';var _=require(_0x2d2c('0x0'));var rp=require('request-promise');var md5=require(_0x2d2c('0x1'));var util=require(_0x2d2c('0x2'));var intUtil=require(_0x2d2c('0x3'));var moment=require(_0x2d2c('0x4'));var Redis=require(_0x2d2c('0x5'));var BPromise=require(_0x2d2c('0x6'));var config=require(_0x2d2c('0x7'));var logger=require('../../../../config/logger')('zoho');config[_0x2d2c('0x8')]=_[_0x2d2c('0x9')](config['redis'],{'host':_0x2d2c('0xa'),'port':0x18eb});var io=require(_0x2d2c('0xb'))(new Redis(config[_0x2d2c('0x8')]));function emit(_0x323d37,_0x3c265a,_0x15d191){io['to'](_0x323d37)[_0x2d2c('0xc')](_0x3c265a,_0x15d191);}function request(_0x58515b){logger[_0x2d2c('0xd')](_0x2d2c('0xe'),JSON[_0x2d2c('0xf')](_0x58515b));return rp(_0x58515b);}function getCustomFields(_0x52b78c,_0xb41d09){var _0xbade96={};if(_0x52b78c['length']>0x0){_[_0x2d2c('0x10')](_0x52b78c,function(_0x38a126){if(_[_0x2d2c('0x11')]([_0x2d2c('0x12'),'picklist'],_0x38a126[_0x2d2c('0x13')])&&_0x38a126['idField']){_0xbade96[_0x38a126[_0x2d2c('0x14')]]=_0x38a126[_0x2d2c('0x15')][_0x2d2c('0x16')]();}else if(_0x38a126[_0x2d2c('0x13')]===_0x2d2c('0x17')&&_0x38a126[_0x2d2c('0x18')]&&_0x38a126[_0x2d2c('0x14')]&&_0xb41d09[_0x38a126[_0x2d2c('0x18')]]){_0xbade96[_0x38a126[_0x2d2c('0x14')]]=_0xb41d09[_0x38a126[_0x2d2c('0x18')]][_0x2d2c('0x16')]();}else if(_0x38a126['type']===_0x2d2c('0x19')&&_0x38a126[_0x2d2c('0x1a')]&&_0x38a126['Variable'][_0x2d2c('0x1b')]&&_0x38a126[_0x2d2c('0x14')]&&_0xb41d09[_0x38a126[_0x2d2c('0x1a')][_0x2d2c('0x1b')][_0x2d2c('0x1c')]()]){_0xbade96[_0x38a126[_0x2d2c('0x14')]]=_0xb41d09[_0x38a126[_0x2d2c('0x1a')][_0x2d2c('0x1b')][_0x2d2c('0x1c')]()][_0x2d2c('0x16')]();}});}return _0xbade96;}function getName(_0xe8e987){if(_0xe8e987[_0x2d2c('0x1d')]('\x20')>0x0){var _0x4d55c4=_0xe8e987[_0x2d2c('0x1e')](/ (.+)/);if(_0x4d55c4[0x1]){return _0x4d55c4;}}return[_0xe8e987,_0xe8e987];}var accountsTokens={};function getAccessToken(_0x5d6cb6){return new Promise(function(_0x15a646,_0x5e1f4b){if(!_['isNil'](accountsTokens[_0x5d6cb6['id']])&&!_['isNil'](accountsTokens[_0x5d6cb6['id']]['access_token'])){if(moment()[_0x2d2c('0x1f')](accountsTokens[_0x5d6cb6['id']][_0x2d2c('0x20')])){_0x15a646(accountsTokens[_0x5d6cb6['id']][_0x2d2c('0x21')]);}}var _0x584753;switch(_0x5d6cb6[_0x2d2c('0x22')]){case'US':_0x584753=_0x2d2c('0x23');break;case'AU':_0x584753=_0x2d2c('0x24');break;case'EU':_0x584753='https://accounts.zoho.eu';break;case'IN':_0x584753=_0x2d2c('0x25');break;case'CN':_0x584753=_0x2d2c('0x26');break;default:_0x584753=_0x2d2c('0x27');break;}var _0x1958ad={'method':_0x2d2c('0x28'),'uri':_0x584753+_0x2d2c('0x29'),'qs':{'refresh_token':_0x5d6cb6['refreshToken'],'client_id':_0x5d6cb6[_0x2d2c('0x2a')],'client_secret':_0x5d6cb6[_0x2d2c('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1958ad)[_0x2d2c('0x2c')](function(_0xda1d53){accountsTokens[_0x5d6cb6['id']]={'access_token':_0xda1d53[_0x2d2c('0x21')],'expires_in':moment()['add'](_0xda1d53[_0x2d2c('0x20')],_0x2d2c('0x2d'))};_0x15a646(_0xda1d53[_0x2d2c('0x21')]);})[_0x2d2c('0x2e')](function(_0x3674a6){logger[_0x2d2c('0x2f')](_0x2d2c('0x30'),_0x3674a6[_0x2d2c('0x31')]);_0x5e1f4b(_0x3674a6);});});}function getUser(_0x2fac0c,_0x537118,_0x5acad1,_0x49c094){logger[_0x2d2c('0x32')](_0x2d2c('0x33'));return request({'method':'GET','uri':util[_0x2d2c('0x34')](_0x2d2c('0x35'),_0x537118),'qs':{'type':_0x2d2c('0x36')},'headers':{'Authorization':_0x2d2c('0x37')+_0x2fac0c},'json':!![]})[_0x2d2c('0x2c')](function(_0x393014){if(_0x393014['users']){var _0x2f9235=-0x1;if(_[_0x2d2c('0x38')](_0x393014[_0x2d2c('0x39')])){if(!_[_0x2d2c('0x3a')](_0x49c094)){_0x2f9235=_['findIndex'](_0x393014[_0x2d2c('0x39')],function(_0x8f7c9a){return _0x8f7c9a[_0x2d2c('0x3b')]===_0x49c094;});}if(_0x2f9235>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x2d2c('0x32')](_0x2d2c('0x3c'));_0x2f9235=_[_0x2d2c('0x3d')](_0x393014['users'],function(_0x10787c){return _0x10787c[_0x2d2c('0x3e')][_0x2d2c('0x1b')]===_0x2d2c('0x3f');});}return _0x393014[_0x2d2c('0x39')][_0x2f9235];}else{if(_0x393014[_0x2d2c('0x40')][_0x2d2c('0x3e')]['name']===_0x2d2c('0x3f')){logger[_0x2d2c('0x32')]('Using\x20the\x20admin\x20account!');user=_0x393014[_0x2d2c('0x40')];return user;}else{logger[_0x2d2c('0x2f')](_0x2d2c('0x41'),JSON['stringify'](_0x393014));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x2d2c('0xf')](_0x393014));}}}else{logger[_0x2d2c('0x2f')](_0x2d2c('0x41'),JSON['stringify'](_0x393014));throw new Error(_0x2d2c('0x42')+JSON['stringify'](_0x393014));}})['catch'](function(_0x7cb9cf){console['error'](_0x7cb9cf);});}function getZohoUser(_0x17ac39,_0x570d3c){return new BPromise(function(_0x11f22a,_0x4a9706){request(_0x17ac39)['then'](function(_0x44db95){var _0x202603=null;if(_0x44db95){_0x202603=_0x44db95[_0x2d2c('0x43')][0x0];_0x202603[_0x2d2c('0x44')]=_0x570d3c;}_0x11f22a(_0x202603);})[_0x2d2c('0x2e')](function(_0x4c4faf){_0x4a9706(_0x4c4faf);});});}function createEndUser(_0x191ee2,_0x704195,_0x3f4b3c,_0x189695,_0x37fbdd,_0x3a047c){var _0x3f4b3c=getName(_0x3f4b3c);return request({'method':_0x2d2c('0x28'),'uri':'https://www.zohoapis.'+_0x704195+_0x2d2c('0x45')+_[_0x2d2c('0x46')](_0x3a047c[_0x2d2c('0x47')])+'s','body':{'data':[{'Last_Name':_0x3f4b3c[0x1],'First_Name':_0x3f4b3c[0x0],'Phone':_0x189695,'Owner':{'name':!_[_0x2d2c('0x3a')](_0x37fbdd[_0x2d2c('0x48')][_0x2d2c('0x1b')])?_0x37fbdd[_0x2d2c('0x48')][_0x2d2c('0x1b')]:!_[_0x2d2c('0x3a')](_0x37fbdd[_0x2d2c('0x49')])?_0x37fbdd[_0x2d2c('0x49')]+'\x20'+_0x37fbdd[_0x2d2c('0x4a')]:_0x37fbdd[_0x2d2c('0x4a')],'id':_0x37fbdd['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x191ee2},'json':!![]})[_0x2d2c('0x2c')](function(_0x3be61c){if(_0x3be61c&&_0x3be61c[_0x2d2c('0x43')][0x0][_0x2d2c('0x4b')]===_0x2d2c('0x4c')){var _0x4b26cb=_0x3be61c[_0x2d2c('0x43')][0x0]['details'];_0x4b26cb['enduserType']=_[_0x2d2c('0x46')](_0x3a047c[_0x2d2c('0x47')])+'s';return _0x4b26cb;}logger['error'](_0x2d2c('0x41'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x2d2c('0xf')](data));})[_0x2d2c('0x2e')](function(_0x34cc8a){console[_0x2d2c('0x4d')](_0x2d2c('0x4e'),_0x34cc8a);});}function getEndUser(_0x1d22c9,_0x5aaf8f,_0x73362,_0x56fc59,_0xb42363,_0x1d1e82,_0x1d171c){var _0x3ebab8={'method':_0x2d2c('0x4f'),'uri':'','headers':{'Authorization':_0x2d2c('0x37')+_0x1d22c9},'json':!![]};switch(_0x1d171c[_0x2d2c('0x50')]){case _0x2d2c('0x51'):_0x3ebab8['uri']='https://www.zohoapis.'+_0x5aaf8f+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xb42363+'))';return getZohoUser(_0x3ebab8,_0x2d2c('0x52'))['then'](function(_0x1f5a9e){if(_0x1f5a9e)return _0x1f5a9e;_0x3ebab8['uri']='https://www.zohoapis.'+_0x5aaf8f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xb42363+'))';return getZohoUser(_0x3ebab8,_0x2d2c('0x53'))[_0x2d2c('0x2c')](function(_0x4e0c29){if(_0x4e0c29)return _0x4e0c29;if(_0x1d171c['moduleCreate']!=_0x2d2c('0x54')){return createEndUser(_0x1d22c9,_0x5aaf8f,_0x56fc59,_0xb42363,_0x1d1e82,_0x1d171c);}else{return{};}});});break;case _0x2d2c('0x55'):_0x3ebab8[_0x2d2c('0x56')]=_0x2d2c('0x57')+_0x5aaf8f+_0x2d2c('0x58')+_0xb42363+'))';return getZohoUser(_0x3ebab8,_0x2d2c('0x52'))[_0x2d2c('0x2c')](function(_0x889e2b){if(_0x889e2b)return _0x889e2b;if(_0x1d171c['moduleCreate']!=_0x2d2c('0x54')){return createEndUser(_0x1d22c9,_0x5aaf8f,_0x56fc59,_0xb42363,_0x1d1e82,_0x1d171c);}else{return{};}});break;case _0x2d2c('0x59'):_0x3ebab8[_0x2d2c('0x56')]=_0x2d2c('0x57')+_0x5aaf8f+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xb42363+'))';return getZohoUser(_0x3ebab8,'Leads')[_0x2d2c('0x2c')](function(_0x217264){if(_0x217264)return _0x217264;if(_0x1d171c[_0x2d2c('0x47')]!=_0x2d2c('0x54')){return createEndUser(_0x1d22c9,_0x5aaf8f,_0x56fc59,_0xb42363,_0x1d1e82,_0x1d171c);}else{return{};}});break;}}function getCall(_0xc722a3,_0x23b7ee,_0x2bb53b,_0x57a58b,_0x556d70,_0x5a4242,_0x24581c,_0xc1554b){logger[_0x2d2c('0x32')](_0x2d2c('0x5a'));var _0x493468={};_0x493468[_0x2d2c('0x5b')]={'name':!_[_0x2d2c('0x3a')](_0x57a58b['role'][_0x2d2c('0x1b')])&&!_[_0x2d2c('0x3a')](_0x57a58b[_0x2d2c('0x3e')][_0x2d2c('0x1b')])&&_0x57a58b['profile'][_0x2d2c('0x1b')]===_0x2d2c('0x5c')?_0x57a58b['role'][_0x2d2c('0x1b')]:!_[_0x2d2c('0x3a')](_0x57a58b['first_name'])?_0x57a58b['first_name']+'\x20'+_0x57a58b[_0x2d2c('0x4a')]:_0x57a58b['last_name'],'id':_0x57a58b['id']};_0x493468[_0x2d2c('0x5d')]=intUtil['getString'](_0x5a4242[_0x2d2c('0x5e')],_0x24581c,'\x20');_0x493468[_0x2d2c('0x5f')]=intUtil[_0x2d2c('0x60')](_0x5a4242[_0x2d2c('0x61')],_0x24581c,'\x0a');if(_0x556d70['enduserType']===_0x2d2c('0x52')){_0x493468[_0x2d2c('0x62')]={'name':!_[_0x2d2c('0x3a')](_0x556d70['Full_Name'])?_0x556d70[_0x2d2c('0x63')]:!_[_0x2d2c('0x3a')](_0x556d70[_0x2d2c('0x64')])?_0x556d70[_0x2d2c('0x64')]+'\x20'+_0x556d70[_0x2d2c('0x65')]:_0x556d70['Last_Name'],'id':_0x556d70['id']};}if(_0x556d70[_0x2d2c('0x44')]===_0x2d2c('0x53')){_0x493468[_0x2d2c('0x66')]={'name':!_['isNil'](_0x556d70[_0x2d2c('0x63')])?_0x556d70['Full_Name']:!_[_0x2d2c('0x3a')](_0x556d70[_0x2d2c('0x64')])?_0x556d70[_0x2d2c('0x64')]+'\x20'+_0x556d70[_0x2d2c('0x65')]:_0x556d70[_0x2d2c('0x65')],'id':_0x556d70['id']};_0x493468[_0x2d2c('0x67')]=_['startCase'](_0x556d70[_0x2d2c('0x44')]);}if(_0x24581c['talktime']){_0x493468['Call_Duration']=moment[_0x2d2c('0x68')](parseInt(_0x24581c[_0x2d2c('0x69')])*0x3e8)[_0x2d2c('0x34')](_0x2d2c('0x6a'));}else if(_0x24581c[_0x2d2c('0x6b')]&&_0x24581c[_0x2d2c('0x6c')]){_0x493468[_0x2d2c('0x6d')]=moment['utc'](moment(_0x24581c[_0x2d2c('0x6c')],_0x2d2c('0x6e'))[_0x2d2c('0x6f')](moment(_0x24581c[_0x2d2c('0x70')],_0x2d2c('0x6e'))))['format'](_0x2d2c('0x6a'));}switch(_0x24581c[_0x2d2c('0x71')]){case _0x2d2c('0x72'):_0x493468[_0x2d2c('0x73')]=_0x2d2c('0x74');break;case _0x2d2c('0x75'):case'connect':_0x493468['Call_Result']=_0x2d2c('0x76');break;case _0x2d2c('0x77'):_0x493468[_0x2d2c('0x73')]=_0x2d2c('0x78');break;case _0x2d2c('0x79'):_0x493468[_0x2d2c('0x73')]=_0x2d2c('0x7a');break;case _0x2d2c('0x7b'):_0x493468[_0x2d2c('0x73')]='Timeout';default:}_0x493468[_0x2d2c('0x7c')]=(_0xc1554b===_0x2d2c('0x7d')?moment(_0x24581c[_0x2d2c('0x70')])['format'](_0x2d2c('0x6e')):moment(_0x24581c[_0x2d2c('0x7e')])[_0x2d2c('0x34')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2d2c('0x34')](_0x2d2c('0x6e'));_0x493468[_0x2d2c('0x7f')]=_0xc1554b||_0x2d2c('0x80');_0x493468=_[_0x2d2c('0x81')](_0x493468,getCustomFields(_0x5a4242[_0x2d2c('0x82')],_0x24581c));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x23b7ee+'/crm/v2/Calls','headers':{'Authorization':_0x2d2c('0x37')+_0xc722a3},'body':{'data':[_0x493468]},'json':!![]})['then'](function(_0x178605){if(_0x178605&&_0x178605[_0x2d2c('0x43')][0x0][_0x2d2c('0x4b')]===_0x2d2c('0x4c')){logger[_0x2d2c('0x32')](_0x2d2c('0x83'));return{'id':_0x178605[_0x2d2c('0x43')][0x0][_0x2d2c('0x84')]['id']};}})[_0x2d2c('0x2e')](function(_0x12aa95){logger['info'](_0x2d2c('0x85'),_0x12aa95[_0x2d2c('0x31')]);console['log'](_0x2d2c('0x85'),_0x12aa95);});}exports['queue']=function(_0x3d7aec,_0x5eabb2,_0x5be0e6,_0x2db893,_0x49b789,_0x428df1){var _0x23d47b,_0x2a939b,_0x30c54f;_0x428df1[_0x2d2c('0x86')]=intUtil[_0x2d2c('0x87')](_0x428df1[_0x2d2c('0x86')]);_0x428df1[_0x2d2c('0x88')]=intUtil[_0x2d2c('0x87')](_0x428df1[_0x2d2c('0x88')]);if(_0x49b789&&_0x49b789[_0x2d2c('0x89')]){logger[_0x2d2c('0x32')](_0x2d2c('0x8a'),_0x2d2c('0x8b'));_0x5eabb2[_0x2d2c('0x8c')]=_0x428df1[_0x2d2c('0x88')]+_0x2d2c('0x8d')+_0x5eabb2['uniqueid']+_0x2d2c('0x8e')+md5(_0x5eabb2[_0x2d2c('0x8f')]);}else{_0x5eabb2[_0x2d2c('0x8c')]='';}var _0x5ed277=_0x428df1[_0x2d2c('0x86')]===_0x2d2c('0x90')?'eu':_0x2d2c('0x91');return getAccessToken(_0x428df1)[_0x2d2c('0x2c')](function(_0x3937c2){_0x30c54f=_0x3937c2;return getUser(_0x30c54f,_0x5ed277,_0x428df1,_0x2db893[_0x2d2c('0x3b')]);})[_0x2d2c('0x2c')](function(_0xa56d7){_0x23d47b=_0xa56d7;logger['info'](_0x2d2c('0x92'),_0x23d47b['id']);return getEndUser(_0x30c54f,_0x5ed277,_0x428df1,_0x5eabb2['calleridname'],_0x5eabb2[_0x2d2c('0x93')],_0x23d47b,_0x5be0e6);})[_0x2d2c('0x2c')](function(_0x11032a){_0x2a939b=_0x11032a;return getCall(_0x30c54f,_0x5ed277,_0x428df1,_0x23d47b,_0x2a939b,_0x5be0e6,_0x5eabb2,'Inbound');})[_0x2d2c('0x2c')](function(_0x45d0e5){if(_0x45d0e5){logger[_0x2d2c('0x32')](_0x2d2c('0x94'),_0x45d0e5['id']);logger[_0x2d2c('0x32')](_0x2d2c('0x8a'),_0x2d2c('0x95'));emit(util[_0x2d2c('0x34')](_0x2d2c('0x96'),_0x2db893[_0x2d2c('0x1b')]),_0x2d2c('0x97'),{'uri':_0x2d2c('0x98')+_0x428df1['host']+_0x2d2c('0x99')+_0x45d0e5['id']});}})[_0x2d2c('0x2e')](function(_0xb681c){logger['error'](_0x2d2c('0x8a'),JSON['stringify'](_0xb681c));});};exports['outbound']=function(_0x1106d8,_0x338a74,_0x9cde09,_0x3d463b,_0xa32b89,_0x391619,_0x482806){var _0x6457f2,_0x213afe,_0x4e6471;_0x391619[_0x2d2c('0x86')]=intUtil[_0x2d2c('0x87')](_0x391619[_0x2d2c('0x86')]);_0x391619[_0x2d2c('0x88')]=intUtil['stripTrailingSlash'](_0x391619[_0x2d2c('0x88')]);if(_0x482806&&_0x482806[_0x2d2c('0x9a')]&&_0x482806[_0x2d2c('0x9a')]!==_0x2d2c('0x9b')){logger[_0x2d2c('0x32')](_0x2d2c('0x9c'),'Recording\x20is\x20enabled!');_0x338a74['recordingURL']=_0x391619[_0x2d2c('0x88')]+_0x2d2c('0x8d')+_0x338a74[_0x2d2c('0x8f')]+'/downloads?type=uniqueid&token='+md5(_0x338a74[_0x2d2c('0x8f')]);}var _0x278000=_0x391619[_0x2d2c('0x86')]===_0x2d2c('0x90')?'eu':_0x2d2c('0x91');return getAccessToken(_0x391619)[_0x2d2c('0x2c')](function(_0xdb923a){_0x4e6471=_0xdb923a;return getUser(_0x4e6471,_0x278000,_0x391619,_0x3d463b[_0x2d2c('0x3b')]);})[_0x2d2c('0x2c')](function(_0x23948b){_0x6457f2=_0x23948b;logger[_0x2d2c('0x32')](_0x2d2c('0x92'),_0x6457f2['id']);return getEndUser(_0x4e6471,_0x278000,_0x391619,_0x338a74['destcalleridname'],_0x338a74[_0x2d2c('0x9d')],_0x6457f2,_0x9cde09);})[_0x2d2c('0x2c')](function(_0xb777f0){_0x213afe=_0xb777f0;return getCall(_0x4e6471,_0x278000,_0x391619,_0x6457f2,_0x213afe,_0x9cde09,_0x338a74,'Outbound');})[_0x2d2c('0x2c')](function(_0x54614c){if(_0x54614c){logger['info'](_0x2d2c('0x94'),_0x54614c['id']);logger['info'](_0x2d2c('0x9c'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2d2c('0x34')]('user:%s',_0x3d463b[_0x2d2c('0x1b')]),_0x2d2c('0x97'),{'uri':_0x2d2c('0x98')+_0x391619['host']+_0x2d2c('0x99')+_0x54614c['id']});}})[_0x2d2c('0x2e')](function(_0x9b976f){logger[_0x2d2c('0x2f')](_0x2d2c('0x9c'),JSON[_0x2d2c('0xf')](_0x9b976f));});};exports[_0x2d2c('0x9e')]=function(_0x14f13e,_0x51f9f4,_0x4f4fcb,_0x4ad6bd,_0x54855f,_0x1a69d8){var _0x2edf87,_0x519027,_0x58be1e;_0x1a69d8['host']=intUtil[_0x2d2c('0x87')](_0x1a69d8[_0x2d2c('0x86')]);_0x1a69d8[_0x2d2c('0x88')]=intUtil[_0x2d2c('0x87')](_0x1a69d8['serverUrl']);if(_0x54855f&&_0x54855f[_0x2d2c('0x89')]){logger[_0x2d2c('0x32')]('['+_0x51f9f4[_0x2d2c('0x71')][_0x2d2c('0x9f')]()+']',_0x2d2c('0x8b'));_0x51f9f4['recordingURL']=_0x1a69d8[_0x2d2c('0x88')]+'/api/voice/recordings/'+_0x51f9f4[_0x2d2c('0x8f')]+_0x2d2c('0x8e')+md5(_0x51f9f4[_0x2d2c('0x8f')]);}else{_0x51f9f4[_0x2d2c('0x8c')]='';}var _0x33cf1e=_0x1a69d8['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x1a69d8)[_0x2d2c('0x2c')](function(_0x391758){_0x58be1e=_0x391758;return getUser(_0x58be1e,_0x33cf1e,_0x1a69d8);})[_0x2d2c('0x2c')](function(_0x336e98){_0x2edf87=_0x336e98;logger[_0x2d2c('0x32')]('The\x20User\x20ID\x20is:',_0x2edf87['id']);return getEndUser(_0x58be1e,_0x33cf1e,_0x1a69d8,_0x51f9f4[_0x2d2c('0xa0')],_0x51f9f4[_0x2d2c('0x93')],_0x2edf87,_0x4f4fcb);})[_0x2d2c('0x2c')](function(_0xbc5586){_0x519027=_0xbc5586;return getCall(_0x58be1e,_0x33cf1e,_0x1a69d8,_0x2edf87,_0x519027,_0x4f4fcb,_0x51f9f4,_0x2d2c('0x80'));})[_0x2d2c('0x2c')](function(_0x3571e8){if(_0x3571e8){logger['info'](_0x2d2c('0x94'),_0x3571e8['id']);}})[_0x2d2c('0x2e')](function(_0xec6b5e){logger[_0x2d2c('0x2f')]('['+_0x51f9f4[_0x2d2c('0x71')]['toUpperCase']()+']',JSON[_0x2d2c('0xf')](_0xec6b5e));});};
\ No newline at end of file
index f1ad013..c3b0e37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74f1=['format','util','shelljs','mustache','trigger','exec','data2','data3','error'];(function(_0x4bbc65,_0x5737e9){var _0x288343=function(_0x1e2c4a){while(--_0x1e2c4a){_0x4bbc65['push'](_0x4bbc65['shift']());}};_0x288343(++_0x5737e9);}(_0x74f1,0x184));var _0x174f=function(_0x2c94a5,_0x128193){_0x2c94a5=_0x2c94a5-0x0;var _0x472eac=_0x74f1[_0x2c94a5];return _0x472eac;};'use strict';var util=require(_0x174f('0x0'));var sh=require(_0x174f('0x1'));var Mustache=require(_0x174f('0x2'));var logger=require('../../../../config/logger')(_0x174f('0x3'));exports[_0x174f('0x4')]=function(_0x487be3,_0x5e7478){var _0x439d00=_0x487be3[_0x174f('0x5')]?_0x487be3[_0x174f('0x5')]:'Script';var _0x35e11c=_0x487be3[_0x174f('0x6')]?Mustache['render'](_0x487be3[_0x174f('0x6')],_0x5e7478):_0x5e7478;sh[_0x174f('0x4')](_0x35e11c,function(_0x337334,_0x1611d9,_0x3b4d2f){if(_0x337334!==0x0){logger[_0x174f('0x7')](util[_0x174f('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x439d00,_0x35e11c,_0x337334,_0x3b4d2f));}else{logger['info'](util[_0x174f('0x8')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x439d00,_0x35e11c,_0x1611d9));}});};
\ No newline at end of file
+var _0xd6b1=['util','shelljs','mustache','../../../../config/logger','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'];(function(_0x1a1e57,_0x2cb6fd){var _0x177217=function(_0x403342){while(--_0x403342){_0x1a1e57['push'](_0x1a1e57['shift']());}};_0x177217(++_0x2cb6fd);}(_0xd6b1,0x10e));var _0x1d6b=function(_0x2870a6,_0xf62b68){_0x2870a6=_0x2870a6-0x0;var _0x3a6320=_0xd6b1[_0x2870a6];return _0x3a6320;};'use strict';var util=require(_0x1d6b('0x0'));var sh=require(_0x1d6b('0x1'));var Mustache=require(_0x1d6b('0x2'));var logger=require(_0x1d6b('0x3'))(_0x1d6b('0x4'));exports[_0x1d6b('0x5')]=function(_0x10f132,_0x57f3b5){var _0x166642=_0x10f132['data2']?_0x10f132[_0x1d6b('0x6')]:_0x1d6b('0x7');var _0x36076a=_0x10f132[_0x1d6b('0x8')]?Mustache[_0x1d6b('0x9')](_0x10f132[_0x1d6b('0x8')],_0x57f3b5):_0x57f3b5;sh[_0x1d6b('0x5')](_0x36076a,function(_0x4ff283,_0x12c112,_0x37f480){if(_0x4ff283!==0x0){logger[_0x1d6b('0xa')](util[_0x1d6b('0xb')](_0x1d6b('0xc'),_0x166642,_0x36076a,_0x4ff283,_0x37f480));}else{logger[_0x1d6b('0xd')](util['format'](_0x1d6b('0xe'),_0x166642,_0x36076a,_0x12c112));}});};
\ No newline at end of file
index 5257d90..6c3433d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40c5=['toUpperCase','render','data2','data5','parse','data6','error','stack','DELETE','POST','PUT','data7','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','statusCode','catch','name','message','request-promise','util','lodash','trigger','exec','data1'];(function(_0x5158ac,_0x245f83){var _0x25f3c6=function(_0x3ae2ff){while(--_0x3ae2ff){_0x5158ac['push'](_0x5158ac['shift']());}};_0x25f3c6(++_0x245f83);}(_0x40c5,0x76));var _0x540c=function(_0xee17ce,_0x3d4c9f){_0xee17ce=_0xee17ce-0x0;var _0x2486b2=_0x40c5[_0xee17ce];return _0x2486b2;};'use strict';var rp=require(_0x540c('0x0'));var util=require(_0x540c('0x1'));var _=require(_0x540c('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x540c('0x3'));exports[_0x540c('0x4')]=function(_0x280b18,_0x176f50){var _0x4c0f15,_0x36c804;var _0xdc5338={'method':_0x280b18[_0x540c('0x5')][_0x540c('0x6')](),'uri':Mustache[_0x540c('0x7')](_0x280b18[_0x540c('0x8')],_0x176f50),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x280b18[_0x540c('0x9')])==='number'&&parseInt(_0x280b18['data5'])>=0x1&&parseInt(_0x280b18[_0x540c('0x9')])<=0xa?parseInt(_0x280b18[_0x540c('0x9')])*0x3e8:0x5*0x3e8};try{_0xdc5338['headers']=_0x280b18['data6']?JSON[_0x540c('0xa')](Mustache[_0x540c('0x7')](_0x280b18[_0x540c('0xb')],_0x176f50)):{};}catch(_0x5c7c8b){logger[_0x540c('0xc')](_0x5c7c8b[_0x540c('0xd')]);}switch(_0x280b18['data1'][_0x540c('0x6')]()){case'GET':case _0x540c('0xe'):_0x4c0f15=null;_0xdc5338['qs']=_0x176f50;break;case _0x540c('0xf'):case _0x540c('0x10'):if(_0x280b18[_0x540c('0x11')]){try{_0x4c0f15=JSON[_0x540c('0xa')](Mustache['render'](_0x280b18[_0x540c('0x11')],_0x176f50));_0xdc5338[_0x540c('0x12')]=_0x4c0f15;}catch(_0x5d3d3f){logger[_0x540c('0xc')](_0x5d3d3f[_0x540c('0xd')]);logger[_0x540c('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4c0f15=_0x176f50;_0xdc5338[_0x540c('0x12')]=_0x4c0f15;}break;}logger[_0x540c('0x13')](util['format'](_0x540c('0x14'),_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],JSON[_0x540c('0x15')](_0xdc5338)));rp(_0xdc5338)[_0x540c('0x16')](function(_0x3c896f){_0x4c0f15=!_[_0x540c('0x17')](_0x4c0f15)?_0x540c('0x18')+_0x4c0f15:'';_0x36c804=typeof _0x3c896f[_0x540c('0x12')]===_0x540c('0x19')?JSON[_0x540c('0x15')](_0x3c896f[_0x540c('0x12')]):_0x3c896f[_0x540c('0x12')];logger[_0x540c('0x13')](util[_0x540c('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],_0x3c896f[_0x540c('0x1b')],_0x36c804));})[_0x540c('0x1c')](function(_0x2ac7f6){logger[_0x540c('0xc')](util[_0x540c('0x1a')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x280b18[_0x540c('0x5')],_0x280b18[_0x540c('0x8')],_0x2ac7f6['statusCode'],_0x2ac7f6[_0x540c('0x1d')],_0x2ac7f6[_0x540c('0x1e')]));});};
\ No newline at end of file
+var _0x209d=['parse','render','error','stack','GET','DELETE','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','body','format','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','number','headers','data6'];(function(_0xa5aaa,_0x2cf119){var _0x39e31a=function(_0x2a70ab){while(--_0x2a70ab){_0xa5aaa['push'](_0xa5aaa['shift']());}};_0x39e31a(++_0x2cf119);}(_0x209d,0x1e3));var _0xd209=function(_0x1420de,_0x470162){_0x1420de=_0x1420de-0x0;var _0x246bb9=_0x209d[_0x1420de];return _0x246bb9;};'use strict';var rp=require(_0xd209('0x0'));var util=require(_0xd209('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0xd209('0x2'))(_0xd209('0x3'));exports[_0xd209('0x4')]=function(_0x4a7e34,_0x478895){var _0x38d02d,_0x36d43b;var _0x805c3d={'method':_0x4a7e34[_0xd209('0x5')][_0xd209('0x6')](),'uri':Mustache['render'](_0x4a7e34[_0xd209('0x7')],_0x478895),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4a7e34[_0xd209('0x8')])===_0xd209('0x9')&&parseInt(_0x4a7e34[_0xd209('0x8')])>=0x1&&parseInt(_0x4a7e34[_0xd209('0x8')])<=0xa?parseInt(_0x4a7e34['data5'])*0x3e8:0x5*0x3e8};try{_0x805c3d[_0xd209('0xa')]=_0x4a7e34[_0xd209('0xb')]?JSON[_0xd209('0xc')](Mustache[_0xd209('0xd')](_0x4a7e34[_0xd209('0xb')],_0x478895)):{};}catch(_0xe4231e){logger[_0xd209('0xe')](_0xe4231e[_0xd209('0xf')]);}switch(_0x4a7e34[_0xd209('0x5')]['toUpperCase']()){case _0xd209('0x10'):case _0xd209('0x11'):_0x38d02d=null;_0x805c3d['qs']=_0x478895;break;case'POST':case'PUT':if(_0x4a7e34['data7']){try{_0x38d02d=JSON[_0xd209('0xc')](Mustache[_0xd209('0xd')](_0x4a7e34['data7'],_0x478895));_0x805c3d['body']=_0x38d02d;}catch(_0x4663f4){logger[_0xd209('0xe')](_0x4663f4[_0xd209('0xf')]);logger['error'](_0xd209('0x12'));}}else{_0x38d02d=_0x478895;_0x805c3d['body']=_0x38d02d;}break;}logger[_0xd209('0x13')](util['format'](_0xd209('0x14'),_0x4a7e34[_0xd209('0x5')],_0x4a7e34[_0xd209('0x7')],JSON[_0xd209('0x15')](_0x805c3d)));rp(_0x805c3d)[_0xd209('0x16')](function(_0x29c95d){_0x38d02d=!_[_0xd209('0x17')](_0x38d02d)?_0xd209('0x18')+_0x38d02d:'';_0x36d43b=typeof _0x29c95d['body']===_0xd209('0x19')?JSON[_0xd209('0x15')](_0x29c95d[_0xd209('0x1a')]):_0x29c95d['body'];logger[_0xd209('0x13')](util[_0xd209('0x1b')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4a7e34['data1'],_0x4a7e34[_0xd209('0x7')],_0x29c95d[_0xd209('0x1c')],_0x36d43b));})[_0xd209('0x1d')](function(_0x180441){logger['error'](util[_0xd209('0x1b')](_0xd209('0x1e'),_0x4a7e34[_0xd209('0x5')],_0x4a7e34[_0xd209('0x7')],_0x180441[_0xd209('0x1c')],_0x180441[_0xd209('0x1f')],_0x180441[_0xd209('0x20')]));});};
\ No newline at end of file
index 16e0c7f..d8af577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ac=['message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','then','debug','rpc','error'];(function(_0x425c4a,_0x3bde21){var _0x3537ea=function(_0xac6874){while(--_0xac6874){_0x425c4a['push'](_0x425c4a['shift']());}};_0x3537ea(++_0x3bde21);}(_0x42ac,0x92));var _0xc42a=function(_0x4a1cb2,_0x40660c){_0x4a1cb2=_0x4a1cb2-0x0;var _0xc6693a=_0x42ac[_0x4a1cb2];return _0xc6693a;};'use strict';var jayson=require(_0xc42a('0x0'));var BPromise=require(_0xc42a('0x1'));var logger=require(_0xc42a('0x2'))(_0xc42a('0x3'));var client=jayson[_0xc42a('0x4')]['http']({'port':0x2329});client[_0xc42a('0x5')]=function(_0x52c68e,_0x38fc62){return new BPromise(function(_0x4a97e4,_0x2c8c1e){return client['request'](_0x52c68e,_0x38fc62)[_0xc42a('0x6')](function(_0x3fe07d){logger[_0xc42a('0x7')](_0xc42a('0x8'),_0xc42a('0x3'),_0x52c68e,_0x38fc62,_0x3fe07d);if(_0x3fe07d[_0xc42a('0x9')]){logger[_0xc42a('0x9')]('rpc','routing',_0x52c68e,_0x3fe07d[_0xc42a('0x9')][_0xc42a('0xa')],_0x38fc62);return _0x2c8c1e(_0x3fe07d[_0xc42a('0x9')]['message']);}else{return _0x4a97e4(_0x3fe07d['result']);}})[_0xc42a('0xb')](function(_0x31c518){logger['error']('rpc',_0xc42a('0x3'),_0x52c68e,_0x31c518,_0x38fc62);return _0x2c8c1e(_0x31c518);});});};module[_0xc42a('0xc')]=client;
\ No newline at end of file
+var _0xec0d=['message','catch','jayson/promise','bluebird','../../config/logger','routing','http','request','then','error','rpc'];(function(_0xa23a24,_0x5f47f3){var _0x32a415=function(_0x47fe89){while(--_0x47fe89){_0xa23a24['push'](_0xa23a24['shift']());}};_0x32a415(++_0x5f47f3);}(_0xec0d,0xd3));var _0xdec0=function(_0x59b392,_0x23acf2){_0x59b392=_0x59b392-0x0;var _0x381e8a=_0xec0d[_0x59b392];return _0x381e8a;};'use strict';var jayson=require(_0xdec0('0x0'));var BPromise=require(_0xdec0('0x1'));var logger=require(_0xdec0('0x2'))(_0xdec0('0x3'));var client=jayson['client'][_0xdec0('0x4')]({'port':0x2329});client['Request']=function(_0x4ea377,_0x50c4b0){return new BPromise(function(_0x2882e3,_0x374498){return client[_0xdec0('0x5')](_0x4ea377,_0x50c4b0)[_0xdec0('0x6')](function(_0x57ee6e){logger['debug']('rpc',_0xdec0('0x3'),_0x4ea377,_0x50c4b0,_0x57ee6e);if(_0x57ee6e['error']){logger[_0xdec0('0x7')](_0xdec0('0x8'),'routing',_0x4ea377,_0x57ee6e[_0xdec0('0x7')][_0xdec0('0x9')],_0x50c4b0);return _0x374498(_0x57ee6e[_0xdec0('0x7')][_0xdec0('0x9')]);}else{return _0x2882e3(_0x57ee6e['result']);}})[_0xdec0('0xa')](function(_0x43a7a0){logger[_0xdec0('0x7')](_0xdec0('0x8'),'routing',_0x4ea377,_0x43a7a0,_0x50c4b0);return _0x374498(_0x43a7a0);});});};module['exports']=client;
\ No newline at end of file
index b7a0e10..d453b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa587=['listen','getSettings','loginMailFrequency','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts'];(function(_0x4a6802,_0x4ec00b){var _0x5e407b=function(_0x45bd4a){while(--_0x45bd4a){_0x4a6802['push'](_0x4a6802['shift']());}};_0x5e407b(++_0x4ec00b);}(_0xa587,0xa9));var _0x7a58=function(_0x5ae4e9,_0x937967){_0x5ae4e9=_0x5ae4e9-0x0;var _0x552c84=_0xa587[_0x5ae4e9];return _0x552c84;};'use strict';var BPromise=require(_0x7a58('0x0'));var server=require(_0x7a58('0x1'));var Realtime=require(_0x7a58('0x2'));var EmailChannel=require(_0x7a58('0x3'));var mailAccount=require(_0x7a58('0x4'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x7a58('0x5')]()[_0x7a58('0x6')](mailAccount[_0x7a58('0x7')]())[_0x7a58('0x6')](realtime[_0x7a58('0x8')]())[_0x7a58('0x6')](function(){email[_0x7a58('0x9')](realtime[_0x7a58('0xa')]);return realtime;});}function main(){return server[_0x7a58('0xb')](realtime,email)[_0x7a58('0x6')](function(){return initRealtime();})[_0x7a58('0x6')](function(){return setting[_0x7a58('0xc')]();})['then'](function(_0x15efe4){return setInterval(initRealtime,_0x15efe4[_0x7a58('0xd')]*0x3e8);})['catch'](function(_0xc7974){console[_0x7a58('0xe')](_0xc7974);});}main();
\ No newline at end of file
+var _0x245b=['bluebird','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','log'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x245b,0xa8));var _0xb245=function(_0x2c74f5,_0x404b96){_0x2c74f5=_0x2c74f5-0x0;var _0x4c4c19=_0x245b[_0x2c74f5];return _0x4c4c19;};'use strict';var BPromise=require(_0xb245('0x0'));var server=require(_0xb245('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xb245('0x2'));var mailAccount=require(_0xb245('0x3'));var setting=require(_0xb245('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xb245('0x5')]()[_0xb245('0x6')](mailAccount['getMailAccounts']())[_0xb245('0x6')](realtime[_0xb245('0x7')]())['then'](function(){email[_0xb245('0x8')](realtime[_0xb245('0x9')]);return realtime;});}function main(){return server[_0xb245('0xa')](realtime,email)[_0xb245('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xb245('0xb')]();})[_0xb245('0x6')](function(_0x38aabf){return setInterval(initRealtime,_0x38aabf['loginMailFrequency']*0x3e8);})[_0xb245('0xc')](function(_0x2771b9){console[_0xb245('0xd')](_0x2771b9);});}main();
\ No newline at end of file
index e1ab63b..0d9a3d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b35=['defaults','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','active','Imap','status','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','isNil','messageStatus','connected','name','total','messages','from','notify','Mail\x20accepted\x20from\x20routing','lastSync','send','verifySmtp','Smtp','verify','then','verified','catch','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','redis'];(function(_0x547af,_0x17abff){var _0x22f7f4=function(_0x5f0384){while(--_0x5f0384){_0x547af['push'](_0x547af['shift']());}};_0x22f7f4(++_0x17abff);}(_0x4b35,0x1e3));var _0x54b3=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0x4b35[_0x159f8e];return _0x458e17;};'use strict';var _=require(_0x54b3('0x0'));var moment=require(_0x54b3('0x1'));var BPromise=require(_0x54b3('0x2'));var md5=require(_0x54b3('0x3'));var Redis=require('ioredis');var config=require(_0x54b3('0x4'));var logger=require(_0x54b3('0x5'))('email');config[_0x54b3('0x6')]=_[_0x54b3('0x7')](config[_0x54b3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x54b3('0x8'))(new Redis(config[_0x54b3('0x6')]));var EmailImap=require(_0x54b3('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x292fc8){logger[_0x54b3('0xa')](_0x54b3('0xb'));this[_0x54b3('0xc')]=_0x292fc8['mailAccounts'];this[_0x54b3('0xd')]={};this[_0x54b3('0xe')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x2b1d1a){var _0x5e1ec4=this[_0x54b3('0xc')][_0x2b1d1a];var _0x47adff={'id':_0x5e1ec4['id'],'name':_0x5e1ec4['name'],'key':_0x5e1ec4['key'],'active':_0x5e1ec4[_0x54b3('0xf')],'Imap':{'status':_0x5e1ec4[_0x54b3('0x10')][_0x54b3('0x11')],'messageStatus':_0x5e1ec4[_0x54b3('0x10')]['messageStatus'],'total':_0x5e1ec4[_0x54b3('0x10')]['total']}};if(_['isNil'](md5Accounts[_0x2b1d1a])){md5Accounts[_0x2b1d1a]={};}var _0x507581=md5(JSON[_0x54b3('0x12')](_0x47adff));if(md5Accounts[_0x2b1d1a]['md5']!==_0x507581){md5Accounts[_0x2b1d1a][_0x54b3('0x3')]=_0x507581;io[_0x54b3('0x13')](_0x54b3('0x14'),_0x47adff);}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x16')]=function(_0xdeba46){for(var _0x58d992 in _0xdeba46){if(_0xdeba46[_0x54b3('0x17')](_0x58d992)){if(_0xdeba46[_0x58d992]['Imap']&&_0xdeba46[_0x58d992]['active']){var _0x4a43e2=_0xdeba46[_0x58d992]['Imap'];if(!this['imapAccounts'][_0x54b3('0x17')](_0x4a43e2['id'])){this[_0x54b3('0xd')][_0x4a43e2['id']]=new EmailImap(_0x4a43e2,_0xdeba46[_0x58d992][_0x54b3('0x18')]);this['imapAccounts'][_0x4a43e2['id']]['on'](_0x54b3('0x19'),this[_0x54b3('0x1a')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on'](_0x54b3('0x18'),this[_0x54b3('0x1c')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on']('end',this[_0x54b3('0x1d')][_0x54b3('0x1b')](this,_0x58d992));this[_0x54b3('0xd')][_0x4a43e2['id']]['on'](_0x54b3('0x1e'),this[_0x54b3('0x1f')][_0x54b3('0x1b')](this,_0x58d992));}}else{if(_[_0x54b3('0x20')](this[_0x54b3('0xc')][_0x58d992]['Imap'])){this[_0x54b3('0xc')][_0x58d992][_0x54b3('0x10')]={};}this['mailAccounts'][_0x58d992][_0x54b3('0x10')][_0x54b3('0x11')]='disabled';this[_0x54b3('0xc')][_0x58d992][_0x54b3('0x10')][_0x54b3('0x21')]='';this[_0x54b3('0x13')](_0x58d992);}}}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x1a')]=function(_0x53227c,_0x22874b){if(this[_0x54b3('0xc')][_0x53227c]){this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x11')]=_0x54b3('0x22');this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x21')]=_0x22874b[_0x54b3('0x23')];if(_0x22874b['messages']){this['mailAccounts'][_0x53227c][_0x54b3('0x10')][_0x54b3('0x24')]=_0x22874b[_0x54b3('0x25')][_0x54b3('0x24')];}return this[_0x54b3('0x13')](_0x53227c);}};EmailChannel[_0x54b3('0x15')]['handleImapEmail']=function(_0x16fd3d,_0x2d504c){logger[_0x54b3('0xa')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2d504c['firstName'],_0x2d504c['lastName'],_0x2d504c[_0x54b3('0x26')],_0x16fd3d);if(this['mailAccounts'][_0x16fd3d]){return mailAccount[_0x54b3('0x27')](_0x16fd3d,_0x2d504c)['then'](function(_0xabeeee){if(_0xabeeee){logger[_0x54b3('0xa')](_0x54b3('0x28'));}})['catch'](function(_0x2e9b92){logger[_0x54b3('0x1e')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x54b3('0x12')](_0x2e9b92));});}};EmailChannel[_0x54b3('0x15')][_0x54b3('0x1d')]=function(_0x4b1929){if(this[_0x54b3('0xc')][_0x4b1929]&&this[_0x54b3('0xc')][_0x4b1929][_0x54b3('0x10')]){if(this[_0x54b3('0xd')][this['mailAccounts'][_0x4b1929][_0x54b3('0x10')]['id']]){delete this['imapAccounts'][this[_0x54b3('0xc')][_0x4b1929]['Imap']['id']];}this[_0x54b3('0xc')][_0x4b1929][_0x54b3('0x10')][_0x54b3('0x29')]=moment();this[_0x54b3('0x13')](_0x4b1929);}};EmailChannel[_0x54b3('0x15')]['handleImapError']=function(_0x413947,_0x16699b){if(this[_0x54b3('0xc')][_0x413947]){this[_0x54b3('0xc')][_0x413947][_0x54b3('0x10')][_0x54b3('0x11')]=_0x54b3('0x1e');this[_0x54b3('0xc')][_0x413947][_0x54b3('0x10')][_0x54b3('0x21')]=_0x16699b;return this['emit'](_0x413947);}};EmailChannel[_0x54b3('0x15')]['sendMail']=function(_0x19a78a,_0x46417d){return this[_0x54b3('0xe')][_0x54b3('0x2a')](_0x19a78a,_0x46417d);};EmailChannel[_0x54b3('0x15')][_0x54b3('0x2b')]=function(_0x4bcaef){var _0x3739c4=this;if(this[_0x54b3('0xc')][_0x4bcaef['id']]){if(_[_0x54b3('0x20')](this['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')])){this[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')]={};}this[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x29')]=moment();return new BPromise(function(_0x493447,_0x63d9be){return _0x3739c4[_0x54b3('0xe')][_0x54b3('0x2d')](_0x4bcaef)[_0x54b3('0x2e')](function(_0x130f3a){_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x11')]=_0x54b3('0x2f');_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x21')]='';_0x3739c4[_0x54b3('0x13')](_0x4bcaef['id']);_0x493447(_0x130f3a);})[_0x54b3('0x30')](function(_0x14f8ba){_0x3739c4[_0x54b3('0xc')][_0x4bcaef['id']][_0x54b3('0x2c')][_0x54b3('0x11')]=_0x54b3('0x1e');_0x3739c4['mailAccounts'][_0x4bcaef['id']][_0x54b3('0x2c')]['messageStatus']=_0x14f8ba;_0x3739c4['emit'](_0x4bcaef['id']);_0x63d9be(_0x14f8ba);});});}return this[_0x54b3('0xe')][_0x54b3('0x2d')](_0x4bcaef);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0xb170=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','exports','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','active','Imap','messageStatus','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','status','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','error'];(function(_0x34cd11,_0xdf90af){var _0x4a55d6=function(_0x5b16df){while(--_0x5b16df){_0x34cd11['push'](_0x34cd11['shift']());}};_0x4a55d6(++_0xdf90af);}(_0xb170,0xa0));var _0x0b17=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb170[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x0b17('0x0'));var moment=require(_0x0b17('0x1'));var BPromise=require('bluebird');var md5=require(_0x0b17('0x2'));var Redis=require('ioredis');var config=require(_0x0b17('0x3'));var logger=require('../../../config/logger')('email');config[_0x0b17('0x4')]=_[_0x0b17('0x5')](config[_0x0b17('0x4')],{'host':_0x0b17('0x6'),'port':0x18eb});var io=require(_0x0b17('0x7'))(new Redis(config[_0x0b17('0x4')]));var EmailImap=require(_0x0b17('0x8'));var EmailSmtp=require(_0x0b17('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x34b570){logger[_0x0b17('0xa')](_0x0b17('0xb'));this[_0x0b17('0xc')]=_0x34b570[_0x0b17('0xc')];this[_0x0b17('0xd')]={};this[_0x0b17('0xe')]=new EmailSmtp();}EmailChannel[_0x0b17('0xf')]['emit']=function(_0x1413f4){var _0x4e25d1=this[_0x0b17('0xc')][_0x1413f4];var _0x5649f0={'id':_0x4e25d1['id'],'name':_0x4e25d1[_0x0b17('0x10')],'key':_0x4e25d1['key'],'active':_0x4e25d1[_0x0b17('0x11')],'Imap':{'status':_0x4e25d1['Imap']['status'],'messageStatus':_0x4e25d1[_0x0b17('0x12')][_0x0b17('0x13')],'total':_0x4e25d1[_0x0b17('0x12')][_0x0b17('0x14')]}};if(_[_0x0b17('0x15')](md5Accounts[_0x1413f4])){md5Accounts[_0x1413f4]={};}var _0x38ef1d=md5(JSON[_0x0b17('0x16')](_0x5649f0));if(md5Accounts[_0x1413f4][_0x0b17('0x2')]!==_0x38ef1d){md5Accounts[_0x1413f4][_0x0b17('0x2')]=_0x38ef1d;io[_0x0b17('0x17')](_0x0b17('0x18'),_0x5649f0);}};EmailChannel[_0x0b17('0xf')][_0x0b17('0x19')]=function(_0x3bcbee){for(var _0x4c9154 in _0x3bcbee){if(_0x3bcbee[_0x0b17('0x1a')](_0x4c9154)){if(_0x3bcbee[_0x4c9154][_0x0b17('0x12')]&&_0x3bcbee[_0x4c9154][_0x0b17('0x11')]){var _0x125d14=_0x3bcbee[_0x4c9154][_0x0b17('0x12')];if(!this[_0x0b17('0xd')][_0x0b17('0x1a')](_0x125d14['id'])){this[_0x0b17('0xd')][_0x125d14['id']]=new EmailImap(_0x125d14,_0x3bcbee[_0x4c9154][_0x0b17('0x1b')]);this['imapAccounts'][_0x125d14['id']]['on'](_0x0b17('0x1c'),this[_0x0b17('0x1d')][_0x0b17('0x1e')](this,_0x4c9154));this[_0x0b17('0xd')][_0x125d14['id']]['on']('email',this[_0x0b17('0x1f')][_0x0b17('0x1e')](this,_0x4c9154));this[_0x0b17('0xd')][_0x125d14['id']]['on'](_0x0b17('0x20'),this[_0x0b17('0x21')][_0x0b17('0x1e')](this,_0x4c9154));this[_0x0b17('0xd')][_0x125d14['id']]['on']('error',this[_0x0b17('0x22')]['bind'](this,_0x4c9154));}}else{if(_['isNil'](this['mailAccounts'][_0x4c9154][_0x0b17('0x12')])){this[_0x0b17('0xc')][_0x4c9154][_0x0b17('0x12')]={};}this[_0x0b17('0xc')][_0x4c9154][_0x0b17('0x12')][_0x0b17('0x23')]=_0x0b17('0x24');this[_0x0b17('0xc')][_0x4c9154][_0x0b17('0x12')][_0x0b17('0x13')]='';this[_0x0b17('0x17')](_0x4c9154);}}}};EmailChannel[_0x0b17('0xf')][_0x0b17('0x1d')]=function(_0x167e60,_0x37cb22){if(this['mailAccounts'][_0x167e60]){this[_0x0b17('0xc')][_0x167e60][_0x0b17('0x12')][_0x0b17('0x23')]=_0x0b17('0x25');this[_0x0b17('0xc')][_0x167e60][_0x0b17('0x12')]['messageStatus']=_0x37cb22[_0x0b17('0x10')];if(_0x37cb22[_0x0b17('0x26')]){this[_0x0b17('0xc')][_0x167e60][_0x0b17('0x12')]['total']=_0x37cb22[_0x0b17('0x26')][_0x0b17('0x14')];}return this[_0x0b17('0x17')](_0x167e60);}};EmailChannel[_0x0b17('0xf')]['handleImapEmail']=function(_0x336543,_0x5cbc8f){logger['info'](_0x0b17('0x27'),_0x5cbc8f['firstName'],_0x5cbc8f[_0x0b17('0x28')],_0x5cbc8f[_0x0b17('0x29')],_0x336543);if(this[_0x0b17('0xc')][_0x336543]){return mailAccount['notify'](_0x336543,_0x5cbc8f)[_0x0b17('0x2a')](function(_0x4ce42e){if(_0x4ce42e){logger['info']('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x451e33){logger[_0x0b17('0x2b')](_0x0b17('0x2c'),JSON['stringify'](_0x451e33));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x4fd550){if(this['mailAccounts'][_0x4fd550]&&this[_0x0b17('0xc')][_0x4fd550][_0x0b17('0x12')]){if(this[_0x0b17('0xd')][this[_0x0b17('0xc')][_0x4fd550][_0x0b17('0x12')]['id']]){delete this[_0x0b17('0xd')][this[_0x0b17('0xc')][_0x4fd550]['Imap']['id']];}this[_0x0b17('0xc')][_0x4fd550]['Imap'][_0x0b17('0x2d')]=moment();this[_0x0b17('0x17')](_0x4fd550);}};EmailChannel[_0x0b17('0xf')][_0x0b17('0x22')]=function(_0x23c5e3,_0x214f86){if(this['mailAccounts'][_0x23c5e3]){this[_0x0b17('0xc')][_0x23c5e3][_0x0b17('0x12')][_0x0b17('0x23')]='error';this['mailAccounts'][_0x23c5e3]['Imap'][_0x0b17('0x13')]=_0x214f86;return this[_0x0b17('0x17')](_0x23c5e3);}};EmailChannel[_0x0b17('0xf')]['sendMail']=function(_0x363724,_0x4e7008){return this[_0x0b17('0xe')][_0x0b17('0x2e')](_0x363724,_0x4e7008);};EmailChannel[_0x0b17('0xf')][_0x0b17('0x2f')]=function(_0x4a6bff){var _0x49e0a9=this;if(this[_0x0b17('0xc')][_0x4a6bff['id']]){if(_[_0x0b17('0x15')](this[_0x0b17('0xc')][_0x4a6bff['id']][_0x0b17('0x30')])){this[_0x0b17('0xc')][_0x4a6bff['id']][_0x0b17('0x30')]={};}this['mailAccounts'][_0x4a6bff['id']][_0x0b17('0x30')][_0x0b17('0x2d')]=moment();return new BPromise(function(_0x2e002d,_0x4bfb89){return _0x49e0a9[_0x0b17('0xe')][_0x0b17('0x31')](_0x4a6bff)[_0x0b17('0x2a')](function(_0x10ffc4){_0x49e0a9[_0x0b17('0xc')][_0x4a6bff['id']]['Smtp'][_0x0b17('0x23')]='verified';_0x49e0a9['mailAccounts'][_0x4a6bff['id']][_0x0b17('0x30')]['messageStatus']='';_0x49e0a9['emit'](_0x4a6bff['id']);_0x2e002d(_0x10ffc4);})['catch'](function(_0x20661c){_0x49e0a9['mailAccounts'][_0x4a6bff['id']][_0x0b17('0x30')][_0x0b17('0x23')]='error';_0x49e0a9[_0x0b17('0xc')][_0x4a6bff['id']][_0x0b17('0x30')][_0x0b17('0x13')]=_0x20661c;_0x49e0a9['emit'](_0x4a6bff['id']);_0x4bfb89(_0x20661c);});});}return this[_0x0b17('0xe')]['verify'](_0x4a6bff);};module[_0x0b17('0x32')]=EmailChannel;
\ No newline at end of file
index b56b6fd..ce0c7da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2064=['events','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','imap','account','once','ready','handleReady','bind','end','error','connect','connTimeout','authTimeout','isNil','service','user','host','port','tls','autotls','required','password','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchError','textCode','hasOwnProperty','upperFirst','exports','path','randomstring','mailparser','simpleParser','iconv','Iconv'];(function(_0x325286,_0x1c7e8c){var _0x6c154b=function(_0x219229){while(--_0x219229){_0x325286['push'](_0x325286['shift']());}};_0x6c154b(++_0x1c7e8c);}(_0x2064,0x1ac));var _0x4206=function(_0x3dc240,_0x5e60a6){_0x3dc240=_0x3dc240-0x0;var _0x525373=_0x2064[_0x3dc240];return _0x525373;};'use strict';var fs=require('fs');var path=require(_0x4206('0x0'));var util=require('util');var Imap=require('imap');var _=require('lodash');var rs=require(_0x4206('0x1'));var simpleParser=require(_0x4206('0x2'))[_0x4206('0x3')];var Iconv=require(_0x4206('0x4'))[_0x4206('0x5')];var EventEmitter=require(_0x4206('0x6'))['EventEmitter'];var utils=require(_0x4206('0x7'));var logger=require(_0x4206('0x8'))(_0x4206('0x9'));function EmailImap(_0x11a49d,_0x3f8ccd){this[_0x4206('0xa')]=_0x4206('0xb');this['account']=this[_0x4206('0xc')](_0x11a49d,_0x3f8ccd);this[_0x4206('0xd')]=new Imap(this[_0x4206('0xe')]);this[_0x4206('0xd')][_0x4206('0xf')](_0x4206('0x10'),this[_0x4206('0x11')][_0x4206('0x12')](this));this[_0x4206('0xd')][_0x4206('0xf')](_0x4206('0x13'),this['handleEnd'][_0x4206('0x12')](this));this[_0x4206('0xd')]['on'](_0x4206('0x14'),this['handleError']['bind'](this));this[_0x4206('0xd')][_0x4206('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x4206('0xc')]=function(_0x27c6b1,_0x4217bb){var _0x2f676f={'connTimeout':_0x27c6b1[_0x4206('0x16')]?_0x27c6b1[_0x4206('0x16')]*0x3e8:0x2710,'authTimeout':_0x27c6b1[_0x4206('0x17')]?_0x27c6b1['authTimeout']*0x3e8:0x1388};if(_[_0x4206('0x18')](_0x27c6b1[_0x4206('0x19')])){if(_0x27c6b1['authentication']){_0x2f676f[_0x4206('0x1a')]=_0x27c6b1['user'];_0x2f676f['password']=_0x27c6b1['password'];}_0x2f676f['host']=_0x27c6b1[_0x4206('0x1b')];_0x2f676f[_0x4206('0x1c')]=_0x27c6b1[_0x4206('0x1c')]||0x3e1;if(_0x27c6b1['tls']){_0x2f676f[_0x4206('0x1d')]=!![];}else{_0x2f676f['tls']=![];_0x2f676f[_0x4206('0x1e')]=_0x4206('0x1f');}}else{_0x2f676f[_0x4206('0x1a')]=_0x27c6b1[_0x4206('0x1a')];_0x2f676f['password']=_0x27c6b1[_0x4206('0x20')];_0x2f676f[_0x4206('0x1b')]=utils[_0x4206('0x21')](_0x27c6b1[_0x4206('0x19')]);_0x2f676f[_0x4206('0x1c')]=0x3e1;_0x2f676f['tls']=!![];}_0x2f676f[_0x4206('0x9')]=_0x4217bb||_0x27c6b1[_0x4206('0x1a')]||_0x4206('0x22');return _0x2f676f;};EmailImap[_0x4206('0x23')][_0x4206('0x11')]=function(){this[_0x4206('0xd')][_0x4206('0x24')](this['mailbox'],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x4206('0x23')][_0x4206('0x25')]=function(_0x1b1960,_0x27ef52){if(_0x1b1960){this[_0x4206('0x26')](_0x1b1960,!![]);}else{this['emit'](_0x4206('0x27'),_0x27ef52);this[_0x4206('0x28')]();}};EmailImap[_0x4206('0x23')][_0x4206('0x29')]=function(_0x50d09a){if(_0x50d09a){this[_0x4206('0x26')](_0x50d09a,!![]);}else{this[_0x4206('0xd')][_0x4206('0x13')]();}};EmailImap[_0x4206('0x23')][_0x4206('0x28')]=function(){this[_0x4206('0xd')][_0x4206('0x2a')]([_0x4206('0x2b')],this['handleReadUnseen'][_0x4206('0x12')](this));};EmailImap[_0x4206('0x23')][_0x4206('0x2c')]=function(_0xbe5e7,_0x5128ec){if(_0xbe5e7){this[_0x4206('0x26')](_0xbe5e7,!![]);}else{if(_0x5128ec['length']){try{var _0x203660=this[_0x4206('0xd')]['fetch'](_0x5128ec,{'bodies':'','markSeen':!![]});_0x203660['on'](_0x4206('0x2d'),this[_0x4206('0x2e')]['bind'](this));_0x203660[_0x4206('0xf')](_0x4206('0x14'),this['handleFetchError'][_0x4206('0x12')](this));_0x203660[_0x4206('0xf')](_0x4206('0x13'),this[_0x4206('0x2f')]['bind'](this));}catch(_0x2dd50e){logger[_0x4206('0x14')](_0x2dd50e);}}else{this[_0x4206('0xd')][_0x4206('0x30')](!![],this['handleCloseBox'][_0x4206('0x12')](this));}}};EmailImap[_0x4206('0x23')][_0x4206('0x2e')]=function(_0x3d504f,_0x2f6863){_0x3d504f['on'](_0x4206('0x31'),this[_0x4206('0x32')][_0x4206('0x12')](this));_0x3d504f[_0x4206('0xf')](_0x4206('0x33'),this[_0x4206('0x34')]['bind'](this));_0x3d504f['once'](_0x4206('0x13'),this[_0x4206('0x35')]['bind'](this));};EmailImap[_0x4206('0x23')]['handleMessageBody']=function(_0x58b07e,_0x311cdc){simpleParser(_0x58b07e,{'Iconv':Iconv},this[_0x4206('0x36')][_0x4206('0x12')](this));};EmailImap['prototype'][_0x4206('0x34')]=function(_0x154597){};EmailImap[_0x4206('0x23')][_0x4206('0x35')]=function(){};EmailImap[_0x4206('0x23')]['handleSimpleParser']=function(_0x34e6e9,_0xb0a1b9){if(_0x34e6e9){logger['error'](_0x34e6e9);}else{var _0x53805e=this;utils[_0x4206('0x37')](this[_0x4206('0xe')],_0xb0a1b9,function(_0x194305){_0x53805e[_0x4206('0x38')](_0x4206('0x9'),_0x194305);});}};EmailImap[_0x4206('0x23')][_0x4206('0x2f')]=function(){this[_0x4206('0xd')]['closeBox'](!![],this[_0x4206('0x29')][_0x4206('0x12')](this));};EmailImap[_0x4206('0x23')][_0x4206('0x39')]=function(_0x366772){this[_0x4206('0x26')](_0x366772);this[_0x4206('0xd')][_0x4206('0x30')](!![],this[_0x4206('0x29')][_0x4206('0x12')](this));};EmailImap['prototype']['handleEnd']=function(){this['emit']('end');};EmailImap['prototype']['handleError']=function(_0x480cc1,_0x431d73){logger['error'](_0x4206('0x26'),this[_0x4206('0xe')][_0x4206('0x9')],JSON['stringify'](_0x480cc1));var _0x344f0a='';if(_0x480cc1){if(_0x480cc1[_0x4206('0x3a')]){_0x344f0a=_0x480cc1[_0x4206('0x3a')];}else{for(var _0x5f0f60 in _0x480cc1){if(_0x480cc1[_0x4206('0x3b')](_0x5f0f60)){_0x344f0a+=_[_0x4206('0x3c')](_0x5f0f60)+':\x20'+_0x480cc1[_0x5f0f60]+'\x0a';}}}}if(_0x431d73){this[_0x4206('0xd')][_0x4206('0x13')]();}else{this['emit']('error',_0x344f0a);this[_0x4206('0x38')](_0x4206('0x13'));}};module[_0x4206('0x3d')]=EmailImap;
\ No newline at end of file
+var _0xbe07=['simpleParser','iconv','Iconv','EventEmitter','./utils','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','closeBox','body','attributes','handleMessageEnd','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser'];(function(_0x5a4b3a,_0x15719c){var _0x57500f=function(_0x38421b){while(--_0x38421b){_0x5a4b3a['push'](_0x5a4b3a['shift']());}};_0x57500f(++_0x15719c);}(_0xbe07,0xf7));var _0x7be0=function(_0x1e4df4,_0x4f7b76){_0x1e4df4=_0x1e4df4-0x0;var _0x1f4a43=_0xbe07[_0x1e4df4];return _0x1f4a43;};'use strict';var fs=require('fs');var path=require(_0x7be0('0x0'));var util=require(_0x7be0('0x1'));var Imap=require(_0x7be0('0x2'));var _=require('lodash');var rs=require(_0x7be0('0x3'));var simpleParser=require(_0x7be0('0x4'))[_0x7be0('0x5')];var Iconv=require(_0x7be0('0x6'))[_0x7be0('0x7')];var EventEmitter=require('events')[_0x7be0('0x8')];var utils=require(_0x7be0('0x9'));var logger=require('../../../config/logger')(_0x7be0('0xa'));function EmailImap(_0x1f206e,_0x4a24d2){this[_0x7be0('0xb')]=_0x7be0('0xc');this[_0x7be0('0xd')]=this[_0x7be0('0xe')](_0x1f206e,_0x4a24d2);this[_0x7be0('0x2')]=new Imap(this[_0x7be0('0xd')]);this[_0x7be0('0x2')]['once'](_0x7be0('0xf'),this[_0x7be0('0x10')][_0x7be0('0x11')](this));this['imap'][_0x7be0('0x12')](_0x7be0('0x13'),this[_0x7be0('0x14')][_0x7be0('0x11')](this));this[_0x7be0('0x2')]['on'](_0x7be0('0x15'),this['handleError'][_0x7be0('0x11')](this));this[_0x7be0('0x2')]['connect']();}util[_0x7be0('0x16')](EmailImap,EventEmitter);EmailImap[_0x7be0('0x17')]['getAccount']=function(_0x4aedb4,_0x5df2a2){var _0xb9e5a2={'connTimeout':_0x4aedb4[_0x7be0('0x18')]?_0x4aedb4[_0x7be0('0x18')]*0x3e8:0x2710,'authTimeout':_0x4aedb4[_0x7be0('0x19')]?_0x4aedb4[_0x7be0('0x19')]*0x3e8:0x1388};if(_[_0x7be0('0x1a')](_0x4aedb4[_0x7be0('0x1b')])){if(_0x4aedb4[_0x7be0('0x1c')]){_0xb9e5a2[_0x7be0('0x1d')]=_0x4aedb4[_0x7be0('0x1d')];_0xb9e5a2['password']=_0x4aedb4[_0x7be0('0x1e')];}_0xb9e5a2[_0x7be0('0x1f')]=_0x4aedb4[_0x7be0('0x1f')];_0xb9e5a2[_0x7be0('0x20')]=_0x4aedb4['port']||0x3e1;if(_0x4aedb4[_0x7be0('0x21')]){_0xb9e5a2[_0x7be0('0x21')]=!![];}else{_0xb9e5a2['tls']=![];_0xb9e5a2[_0x7be0('0x22')]=_0x7be0('0x23');}}else{_0xb9e5a2[_0x7be0('0x1d')]=_0x4aedb4[_0x7be0('0x1d')];_0xb9e5a2[_0x7be0('0x1e')]=_0x4aedb4[_0x7be0('0x1e')];_0xb9e5a2[_0x7be0('0x1f')]=utils[_0x7be0('0x24')](_0x4aedb4[_0x7be0('0x1b')]);_0xb9e5a2[_0x7be0('0x20')]=0x3e1;_0xb9e5a2[_0x7be0('0x21')]=!![];}_0xb9e5a2[_0x7be0('0xa')]=_0x5df2a2||_0x4aedb4[_0x7be0('0x1d')]||_0x7be0('0x25');return _0xb9e5a2;};EmailImap['prototype'][_0x7be0('0x10')]=function(){this[_0x7be0('0x2')][_0x7be0('0x26')](this[_0x7be0('0xb')],![],this[_0x7be0('0x27')][_0x7be0('0x11')](this));};EmailImap['prototype'][_0x7be0('0x27')]=function(_0x16857e,_0x3e646c){if(_0x16857e){this[_0x7be0('0x28')](_0x16857e,!![]);}else{this[_0x7be0('0x29')]('box',_0x3e646c);this[_0x7be0('0x2a')]();}};EmailImap['prototype'][_0x7be0('0x2b')]=function(_0x206930){if(_0x206930){this['handleError'](_0x206930,!![]);}else{this['imap'][_0x7be0('0x13')]();}};EmailImap[_0x7be0('0x17')][_0x7be0('0x2a')]=function(){this[_0x7be0('0x2')][_0x7be0('0x2c')](['UNSEEN'],this['handleReadUnseen']['bind'](this));};EmailImap[_0x7be0('0x17')][_0x7be0('0x2d')]=function(_0x18b89c,_0x2a0f3e){if(_0x18b89c){this[_0x7be0('0x28')](_0x18b89c,!![]);}else{if(_0x2a0f3e[_0x7be0('0x2e')]){try{var _0x260946=this[_0x7be0('0x2')]['fetch'](_0x2a0f3e,{'bodies':'','markSeen':!![]});_0x260946['on'](_0x7be0('0x2f'),this[_0x7be0('0x30')][_0x7be0('0x11')](this));_0x260946[_0x7be0('0x12')](_0x7be0('0x15'),this[_0x7be0('0x31')][_0x7be0('0x11')](this));_0x260946[_0x7be0('0x12')](_0x7be0('0x13'),this['handleFetchEnd'][_0x7be0('0x11')](this));}catch(_0x3fcaf9){logger['error'](_0x3fcaf9);}}else{this[_0x7be0('0x2')][_0x7be0('0x32')](!![],this['handleCloseBox'][_0x7be0('0x11')](this));}}};EmailImap[_0x7be0('0x17')]['handleFetchMessage']=function(_0xc101e3,_0x330121){_0xc101e3['on'](_0x7be0('0x33'),this['handleMessageBody'][_0x7be0('0x11')](this));_0xc101e3[_0x7be0('0x12')](_0x7be0('0x34'),this['handleMessageAttributes'][_0x7be0('0x11')](this));_0xc101e3[_0x7be0('0x12')](_0x7be0('0x13'),this[_0x7be0('0x35')][_0x7be0('0x11')](this));};EmailImap[_0x7be0('0x17')]['handleMessageBody']=function(_0x3e6e1f,_0x164a3b){simpleParser(_0x3e6e1f,{'Iconv':Iconv},this['handleSimpleParser'][_0x7be0('0x11')](this));};EmailImap['prototype'][_0x7be0('0x36')]=function(_0x3502e0){};EmailImap[_0x7be0('0x17')][_0x7be0('0x35')]=function(){};EmailImap[_0x7be0('0x17')][_0x7be0('0x37')]=function(_0x1480ec,_0x4ffeac){if(_0x1480ec){logger['error'](_0x1480ec);}else{var _0x3b483f=this;utils[_0x7be0('0x38')](this[_0x7be0('0xd')],_0x4ffeac,function(_0x28c27b){_0x3b483f[_0x7be0('0x29')](_0x7be0('0xa'),_0x28c27b);});}};EmailImap[_0x7be0('0x17')][_0x7be0('0x39')]=function(){this['imap']['closeBox'](!![],this[_0x7be0('0x2b')][_0x7be0('0x11')](this));};EmailImap[_0x7be0('0x17')][_0x7be0('0x31')]=function(_0x1cf9e3){this[_0x7be0('0x28')](_0x1cf9e3);this[_0x7be0('0x2')][_0x7be0('0x32')](!![],this[_0x7be0('0x2b')][_0x7be0('0x11')](this));};EmailImap['prototype'][_0x7be0('0x14')]=function(){this[_0x7be0('0x29')]('end');};EmailImap['prototype'][_0x7be0('0x28')]=function(_0x5c0803,_0x5c378c){logger['error']('handleError',this['account'][_0x7be0('0xa')],JSON[_0x7be0('0x3a')](_0x5c0803));var _0x481001='';if(_0x5c0803){if(_0x5c0803['textCode']){_0x481001=_0x5c0803[_0x7be0('0x3b')];}else{for(var _0x2740cb in _0x5c0803){if(_0x5c0803[_0x7be0('0x3c')](_0x2740cb)){_0x481001+=_[_0x7be0('0x3d')](_0x2740cb)+':\x20'+_0x5c0803[_0x2740cb]+'\x0a';}}}}if(_0x5c378c){this['imap'][_0x7be0('0x13')]();}else{this[_0x7be0('0x29')](_0x7be0('0x15'),_0x481001);this['emit']('end');}};module[_0x7be0('0x3e')]=EmailImap;
\ No newline at end of file
index 497add7..1c4aeb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae60=['prototype','verify','Not\x20verifired','exports','nodemailer','send','createTransport','compile','sendMail','toString'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae60,0x68));var _0x0ae6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xae60[_0x4fbfd9];return _0x31dc94;};'use strict';var nodemailer=require(_0x0ae6('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x0ae6('0x1')]=function(_0x4b2aff,_0x668d04){return new BPromise(function(_0x37ec26,_0x51c6fc){var _0x451563=nodemailer[_0x0ae6('0x2')](_0x4b2aff);_0x451563['use'](_0x0ae6('0x3'),inlineBase64());_0x451563[_0x0ae6('0x4')](_0x668d04,function(_0x4d0a28,_0x228d4b){if(_0x4d0a28){_0x51c6fc(_0x4d0a28[_0x0ae6('0x5')]());}else{_0x37ec26(_0x228d4b);}});});};EmailSmtp[_0x0ae6('0x6')]['verify']=function(_0x5ece4a){return new BPromise(function(_0x505214,_0x5ac3de){var _0x5c93ff=nodemailer[_0x0ae6('0x2')](_0x5ece4a);_0x5c93ff[_0x0ae6('0x7')](function(_0xc0d0b3,_0x318869){if(_0xc0d0b3){_0x5ac3de(_0xc0d0b3[_0x0ae6('0x5')]());}else{if(_0x318869){_0x505214(_0x318869);}else{_0x5ac3de(_0x0ae6('0x8'));}}});});};module[_0x0ae6('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0x8a8f=['bluebird','send','createTransport','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x48c4c6,_0x2e10fa){var _0x1df2a5=function(_0x21f57c){while(--_0x21f57c){_0x48c4c6['push'](_0x48c4c6['shift']());}};_0x1df2a5(++_0x2e10fa);}(_0x8a8f,0x178));var _0xf8a8=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x8a8f[_0x4e9d3c];return _0x2d0825;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xf8a8('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xf8a8('0x1')]=function(_0x5dc43f,_0x597729){return new BPromise(function(_0x9cc373,_0x35cd77){var _0x5f1af1=nodemailer[_0xf8a8('0x2')](_0x5dc43f);_0x5f1af1['use'](_0xf8a8('0x3'),inlineBase64());_0x5f1af1[_0xf8a8('0x4')](_0x597729,function(_0x459f47,_0x2f2195){if(_0x459f47){_0x35cd77(_0x459f47[_0xf8a8('0x5')]());}else{_0x9cc373(_0x2f2195);}});});};EmailSmtp['prototype'][_0xf8a8('0x6')]=function(_0xcd469e){return new BPromise(function(_0xf30db2,_0x2986b5){var _0x51ccfb=nodemailer[_0xf8a8('0x2')](_0xcd469e);_0x51ccfb[_0xf8a8('0x6')](function(_0x4a475e,_0x1443b6){if(_0x4a475e){_0x2986b5(_0x4a475e[_0xf8a8('0x5')]());}else{if(_0x1443b6){_0xf30db2(_0x1443b6);}else{_0x2986b5(_0xf8a8('0x7'));}}});});};module['exports']=EmailSmtp;
\ No newline at end of file
index fbad0e3..ed8a45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4489=['message','originCc','email','originTo','bcc','attach','type','attachment','format','%s-%s','root','server/files/attachments/','writeFileSync','content','push','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','node-tnef','../../../config/logger','value','address','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','head','pop','isEmpty','anonymous','html','includes','<img','attachments','forEach','filename','_SRC','replace','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20'];(function(_0xa93890,_0x1d5e20){var _0x421f1b=function(_0x1a749f){while(--_0x1a749f){_0xa93890['push'](_0xa93890['shift']());}};_0x421f1b(++_0x1d5e20);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9448('0x0'));var moment=require(_0x9448('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x9448('0x2'));var util=require(_0x9448('0x3'));var tnef=require(_0x9448('0x4'));var logger=require(_0x9448('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0x4bf96c){var _0x5333bf=_['head'](_0x4bf96c[_0x9448('0x6')]);return _0x5333bf&&_0x5333bf['address']?_0x5333bf[_0x9448('0x7')]:'anonymous'+random[_0x9448('0x8')](0x6)+_0x9448('0x9');}function getFirstName(_0x26bd97){var _0x4b81f9=_['head'](_0x26bd97['value']);if(_0x4b81f9&&_0x4b81f9[_0x9448('0xa')]){if(_0x4b81f9[_0x9448('0xa')]==_0x4b81f9[_0x9448('0x7')]){return _0x4b81f9[_0x9448('0xa')][_0x9448('0xb')](0x0,_0x4b81f9['name'][_0x9448('0xc')]('@'));}var _0x444830=_0x4b81f9[_0x9448('0xa')][_0x9448('0xd')](/\s+/);return _0x444830[_0x9448('0xe')]>0x1?_0x444830[_0x9448('0xf')](0x0,-0x1)[_0x9448('0x10')]('\x20'):_0x4b81f9[_0x9448('0xa')];}return'Anonymous';}function getLastName(_0x75cf9c){var _0x56fd4a=_[_0x9448('0x11')](_0x75cf9c[_0x9448('0x6')]);if(_0x56fd4a&&_0x56fd4a['name']){var _0x21a6ee=_0x56fd4a[_0x9448('0xa')][_0x9448('0xd')](/\s+/);return _0x21a6ee[_0x9448('0xe')]>0x1?_0x21a6ee[_0x9448('0x12')]():'';}return'';}function getMails(_0x3564c0,_0xcaf7ac){var _0x9b9fd3='';for(var _0x5a24de=0x0;_0x5a24de<_0xcaf7ac[_0x9448('0x6')]['length'];_0x5a24de+=0x1){if(_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]!==_0x3564c0){if(!_[_0x9448('0x13')](_0x9b9fd3)){_0x9b9fd3+=',';}_0x9b9fd3+=_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0xa')]||_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]||'';_0x9b9fd3+='\x20<';_0x9b9fd3+=_0xcaf7ac[_0x9448('0x6')][_0x5a24de][_0x9448('0x7')]?_0xcaf7ac[_0x9448('0x6')][_0x5a24de]['address']:_0x9448('0x14')+random['generate'](0x6)+'@xcally.com';_0x9b9fd3+='>';}}return _0x9b9fd3;}function parseEmail(_0x43d5ac,_0x5cc7da,_0x594b6b){if(_0x5cc7da['html']){var _0x9d711a=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x9d711a['test'](_0x5cc7da[_0x9448('0x15')])){_0x5cc7da[_0x9448('0x15')]=_0x5cc7da[_0x9448('0x15')]['replace'](_0x9d711a,'');}if(_0x5cc7da[_0x9448('0x15')][_0x9448('0x16')](_0x9448('0x17'))){var _0x4430ad=[];_0x5cc7da[_0x9448('0x18')][_0x9448('0x19')](_0x4d8a8a=>{_0x4430ad['push'](_0x4d8a8a[_0x9448('0x1a')]);});var _0x124892=/<img.*? _SRC(.*?)[^>]+>/g;var _0x24240d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x161b1d=_0x5cc7da[_0x9448('0x15')]['replace'](_0x24240d,_0x9448('0x1b'));var _0x4e4134=_0x161b1d[_0x9448('0x1c')](_0x124892,_0x9448('0x1d'));for(let _0x245ec8=0x0;_0x245ec8<_0x4430ad['length'];_0x245ec8++){var _0x2dd998=_0x4e4134[_0x9448('0x1c')](_0x9448('0x1d'),_0x9448('0x1e')+_0x4430ad[_0x245ec8]+_0x9448('0x1f'));_0x4e4134=_0x2dd998;}_0x5cc7da[_0x9448('0x15')]=_0x4e4134;}_0x594b6b['body']=_0x5cc7da[_0x9448('0x15')];}else{_0x594b6b[_0x9448('0x20')]=_0x5cc7da['textAsHtml'];}if(_0x594b6b[_0x9448('0x20')]){_0x594b6b[_0x9448('0x20')]=_0x594b6b[_0x9448('0x20')][_0x9448('0x1c')](/<a\s+/gi,_0x9448('0x21'));}if(_0x5cc7da['to']){_0x594b6b[_0x9448('0x22')]['originTo']=getMails(null,_0x5cc7da['to']);var _0x4386bc=getMails(_0x43d5ac['email'],_0x5cc7da['to']);if(!_[_0x9448('0x13')](_0x4386bc)){_0x594b6b[_0x9448('0x22')]['cc']+=_0x4386bc;}}if(_0x5cc7da['cc']){_0x594b6b[_0x9448('0x22')][_0x9448('0x23')]=getMails(null,_0x5cc7da['cc']);var _0x52f359=getMails(_0x43d5ac[_0x9448('0x24')],_0x5cc7da['cc']);if(!_[_0x9448('0x13')](_0x52f359)){if(!_[_0x9448('0x13')](_0x594b6b['message']['cc'])){_0x594b6b[_0x9448('0x22')]['cc']+=',';}_0x594b6b[_0x9448('0x22')]['cc']+=_0x52f359;}}if(!_['includes'](_0x594b6b['message'][_0x9448('0x25')],_0x43d5ac[_0x9448('0x24')])&&!_['includes'](_0x594b6b[_0x9448('0x22')][_0x9448('0x23')],_0x43d5ac[_0x9448('0x24')])){_0x594b6b[_0x9448('0x22')][_0x9448('0x26')]=_0x43d5ac[_0x9448('0x24')];}if(_0x5cc7da[_0x9448('0x18')]&&_0x5cc7da['attachments'][_0x9448('0xe')]){_0x594b6b[_0x9448('0x22')][_0x9448('0x27')]=_0x5cc7da[_0x9448('0x18')][_0x9448('0xe')];for(var _0xf1beb9=0x0,_0x1775da,_0x2c6e12,_0x222c15;_0xf1beb9<_0x5cc7da[_0x9448('0x18')][_0x9448('0xe')];_0xf1beb9+=0x1){if(_0x5cc7da['attachments'][_0xf1beb9][_0x9448('0x28')]===_0x9448('0x29')){_0x222c15=_0x5cc7da[_0x9448('0x18')][_0xf1beb9][_0x9448('0x1a')]||'attachment-'+_0xf1beb9;_0x1775da=util[_0x9448('0x2a')](_0x9448('0x2b'),Date['now'](),_0x222c15);_0x2c6e12=path[_0x9448('0x10')](config[_0x9448('0x2c')],_0x9448('0x2d'),_0x1775da);fs[_0x9448('0x2e')](_0x2c6e12,_0x5cc7da['attachments'][_0xf1beb9][_0x9448('0x2f')]);_0x594b6b[_0x9448('0x22')][_0x9448('0x18')][_0x9448('0x30')]({'name':_0x222c15,'basename':_0x1775da,'type':_0x5cc7da[_0x9448('0x18')][_0xf1beb9]['contentType'],'filepath':_0x2c6e12});}}}if(_0x5cc7da[_0x9448('0x31')]&&_0x5cc7da[_0x9448('0x31')][_0x9448('0xe')]>0x0){var _0x489c78=[_0x9448('0x32'),_0x9448('0x33'),'Precedence:\x20auto_reply'];for(var _0x525cd6=0x0;_0x525cd6<_0x5cc7da[_0x9448('0x31')][_0x9448('0xe')];_0x525cd6++){var _0x5e6276=_[_0x9448('0xc')](_0x489c78,_0x5cc7da['headerLines'][_0x525cd6][_0x9448('0x34')]);if(_0x5e6276>=0x0){_0x594b6b[_0x9448('0x35')]=!![];}}}return _0x594b6b;}exports[_0x9448('0x36')]=function(_0x28f2fe,_0x8ffab4,_0xc3b1b){var _0x276897={'from':getAddress(_0x8ffab4[_0x9448('0x37')]),'firstName':getFirstName(_0x8ffab4[_0x9448('0x37')]),'lastName':getLastName(_0x8ffab4[_0x9448('0x37')]),'mapKey':'email','message':{'from':getMails(_0x28f2fe['email'],_0x8ffab4[_0x9448('0x37')]),'to':_0x28f2fe[_0x9448('0x24')],'cc':'','subject':_0x8ffab4[_0x9448('0x38')]||'','messageId':_0x8ffab4[_0x9448('0x39')],'inReplyTo':_0x8ffab4[_0x9448('0x3a')],'sentAt':moment(_0x8ffab4[_0x9448('0x3b')])[_0x9448('0x2a')](_0x9448('0x3c')),'attach':![],'attachments':[]}};if(!_0x8ffab4['html']&&!_0x8ffab4['textAsHtml']){var _0x281c4d=_[_0x9448('0x3d')](_0x8ffab4[_0x9448('0x18')],{'contentType':_0x9448('0x3e')});if(_0x281c4d[_0x9448('0xe')]){logger[_0x9448('0x3f')](util[_0x9448('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x8ffab4['messageId']));tnef[_0x9448('0x40')](_[_0x9448('0x41')](_0x281c4d)[_0x9448('0x2f')],function(_0x411c3e,_0x22cc9c){if(_0x22cc9c){_0x8ffab4['html']=_0x22cc9c[_0x9448('0x42')]||_0x9448('0x43');if(_0x22cc9c[_0x9448('0x44')]){for(var _0x479b60=0x0;_0x479b60<_0x22cc9c[_0x9448('0x44')][_0x9448('0xe')];_0x479b60++){var _0x380521=_0x22cc9c[_0x9448('0x44')][_0x479b60];_0x276897[_0x9448('0x22')][_0x9448('0x18')][_0x9448('0x30')]({'filename':_0x380521[_0x9448('0x45')],'content':Buffer[_0x9448('0x37')](_0x380521[_0x9448('0x46')])});}}}_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));});}else{_0x8ffab4[_0x9448('0x15')]=_0x9448('0x43');_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));}}else{_0xc3b1b(parseEmail(_0x28f2fe,_0x8ffab4,_0x276897));}};exports[_0x9448('0x47')]=function(_0x263bbe){switch(_0x263bbe){case'gmail':return'imap.gmail.com';case _0x9448('0x48'):return'imap.mail.yahoo.com';case _0x9448('0x49'):return _0x9448('0x4a');case _0x9448('0x4b'):return _0x9448('0x4c');}return _0x9448('0x4d');};
\ No newline at end of file
+var _0x8e3f=['body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','email','originCc','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','messageId','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','Attachments','Title','<p>Empty\x20message</p>','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','split','slice','join','Anonymous','length','pop','isEmpty','anonymous','html','test','replace','includes','<img','attachments','push','filename','_IMG','\x20]</span>'];(function(_0x1508f5,_0xb00060){var _0x542c59=function(_0x20542e){while(--_0x20542e){_0x1508f5['push'](_0x1508f5['shift']());}};_0x542c59(++_0xb00060);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8e3f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf8e3('0x0'));var moment=require(_0xf8e3('0x1'));var random=require(_0xf8e3('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xf8e3('0x3'));var tnef=require(_0xf8e3('0x4'));var logger=require(_0xf8e3('0x5'))('email');var config=require(_0xf8e3('0x6'));function getAddress(_0x41bc05){var _0x4dab56=_[_0xf8e3('0x7')](_0x41bc05[_0xf8e3('0x8')]);return _0x4dab56&&_0x4dab56[_0xf8e3('0x9')]?_0x4dab56[_0xf8e3('0x9')]:'anonymous'+random[_0xf8e3('0xa')](0x6)+_0xf8e3('0xb');}function getFirstName(_0x17f56c){var _0x95ad03=_[_0xf8e3('0x7')](_0x17f56c[_0xf8e3('0x8')]);if(_0x95ad03&&_0x95ad03[_0xf8e3('0xc')]){if(_0x95ad03[_0xf8e3('0xc')]==_0x95ad03[_0xf8e3('0x9')]){return _0x95ad03[_0xf8e3('0xc')][_0xf8e3('0xd')](0x0,_0x95ad03[_0xf8e3('0xc')]['indexOf']('@'));}var _0xb7d14f=_0x95ad03[_0xf8e3('0xc')][_0xf8e3('0xe')](/\s+/);return _0xb7d14f['length']>0x1?_0xb7d14f[_0xf8e3('0xf')](0x0,-0x1)[_0xf8e3('0x10')]('\x20'):_0x95ad03[_0xf8e3('0xc')];}return _0xf8e3('0x11');}function getLastName(_0x565c04){var _0x164c4d=_[_0xf8e3('0x7')](_0x565c04[_0xf8e3('0x8')]);if(_0x164c4d&&_0x164c4d['name']){var _0x44f631=_0x164c4d['name'][_0xf8e3('0xe')](/\s+/);return _0x44f631[_0xf8e3('0x12')]>0x1?_0x44f631[_0xf8e3('0x13')]():'';}return'';}function getMails(_0x570ee3,_0x529c92){var _0x564f43='';for(var _0x385dde=0x0;_0x385dde<_0x529c92[_0xf8e3('0x8')][_0xf8e3('0x12')];_0x385dde+=0x1){if(_0x529c92[_0xf8e3('0x8')][_0x385dde][_0xf8e3('0x9')]!==_0x570ee3){if(!_[_0xf8e3('0x14')](_0x564f43)){_0x564f43+=',';}_0x564f43+=_0x529c92[_0xf8e3('0x8')][_0x385dde][_0xf8e3('0xc')]||_0x529c92[_0xf8e3('0x8')][_0x385dde]['address']||'';_0x564f43+='\x20<';_0x564f43+=_0x529c92[_0xf8e3('0x8')][_0x385dde][_0xf8e3('0x9')]?_0x529c92[_0xf8e3('0x8')][_0x385dde][_0xf8e3('0x9')]:_0xf8e3('0x15')+random[_0xf8e3('0xa')](0x6)+_0xf8e3('0xb');_0x564f43+='>';}}return _0x564f43;}function parseEmail(_0x3fff85,_0x5b99b1,_0xe5102b){if(_0x5b99b1[_0xf8e3('0x16')]){var _0x3c636d=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x3c636d[_0xf8e3('0x17')](_0x5b99b1['html'])){_0x5b99b1[_0xf8e3('0x16')]=_0x5b99b1['html'][_0xf8e3('0x18')](_0x3c636d,'');}if(_0x5b99b1[_0xf8e3('0x16')][_0xf8e3('0x19')](_0xf8e3('0x1a'))){var _0x1f4b68=[];_0x5b99b1[_0xf8e3('0x1b')]['forEach'](_0x1b922f=>{_0x1f4b68[_0xf8e3('0x1c')](_0x1b922f[_0xf8e3('0x1d')]);});var _0x417b42=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1f1363=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3b41a1=_0x5b99b1[_0xf8e3('0x16')][_0xf8e3('0x18')](_0x1f1363,'_SRC');var _0x356e0a=_0x3b41a1[_0xf8e3('0x18')](_0x417b42,_0xf8e3('0x1e'));for(let _0xc4f21a=0x0;_0xc4f21a<_0x1f4b68[_0xf8e3('0x12')];_0xc4f21a++){var _0x14cb5a=_0x356e0a[_0xf8e3('0x18')](_0xf8e3('0x1e'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x1f4b68[_0xc4f21a]+_0xf8e3('0x1f'));_0x356e0a=_0x14cb5a;}_0x5b99b1[_0xf8e3('0x16')]=_0x356e0a;}_0xe5102b[_0xf8e3('0x20')]=_0x5b99b1[_0xf8e3('0x16')];}else{_0xe5102b['body']=_0x5b99b1[_0xf8e3('0x21')];}if(_0xe5102b[_0xf8e3('0x20')]){_0xe5102b[_0xf8e3('0x20')]=_0xe5102b[_0xf8e3('0x20')][_0xf8e3('0x18')](/<a\s+/gi,_0xf8e3('0x22'));}if(_0x5b99b1['to']){_0xe5102b[_0xf8e3('0x23')][_0xf8e3('0x24')]=getMails(null,_0x5b99b1['to']);var _0x50ad3f=getMails(_0x3fff85[_0xf8e3('0x25')],_0x5b99b1['to']);if(!_[_0xf8e3('0x14')](_0x50ad3f)){_0xe5102b['message']['cc']+=_0x50ad3f;}}if(_0x5b99b1['cc']){_0xe5102b['message']['originCc']=getMails(null,_0x5b99b1['cc']);var _0x311ab9=getMails(_0x3fff85['email'],_0x5b99b1['cc']);if(!_[_0xf8e3('0x14')](_0x311ab9)){if(!_[_0xf8e3('0x14')](_0xe5102b[_0xf8e3('0x23')]['cc'])){_0xe5102b[_0xf8e3('0x23')]['cc']+=',';}_0xe5102b['message']['cc']+=_0x311ab9;}}if(!_['includes'](_0xe5102b[_0xf8e3('0x23')][_0xf8e3('0x24')],_0x3fff85[_0xf8e3('0x25')])&&!_[_0xf8e3('0x19')](_0xe5102b[_0xf8e3('0x23')][_0xf8e3('0x26')],_0x3fff85['email'])){_0xe5102b[_0xf8e3('0x23')]['bcc']=_0x3fff85['email'];}if(_0x5b99b1[_0xf8e3('0x1b')]&&_0x5b99b1[_0xf8e3('0x1b')][_0xf8e3('0x12')]){_0xe5102b[_0xf8e3('0x23')]['attach']=_0x5b99b1['attachments'][_0xf8e3('0x12')];for(var _0x215183=0x0,_0x5d3f14,_0x2c808c,_0x38c856;_0x215183<_0x5b99b1[_0xf8e3('0x1b')][_0xf8e3('0x12')];_0x215183+=0x1){if(_0x5b99b1['attachments'][_0x215183]['type']==='attachment'){_0x38c856=_0x5b99b1[_0xf8e3('0x1b')][_0x215183][_0xf8e3('0x1d')]||_0xf8e3('0x27')+_0x215183;_0x5d3f14=util[_0xf8e3('0x28')]('%s-%s',Date[_0xf8e3('0x29')](),_0x38c856);_0x2c808c=path['join'](config[_0xf8e3('0x2a')],_0xf8e3('0x2b'),_0x5d3f14);fs[_0xf8e3('0x2c')](_0x2c808c,_0x5b99b1[_0xf8e3('0x1b')][_0x215183][_0xf8e3('0x2d')]);_0xe5102b[_0xf8e3('0x23')][_0xf8e3('0x1b')][_0xf8e3('0x1c')]({'name':_0x38c856,'basename':_0x5d3f14,'type':_0x5b99b1[_0xf8e3('0x1b')][_0x215183]['contentType'],'filepath':_0x2c808c});}}}if(_0x5b99b1[_0xf8e3('0x2e')]&&_0x5b99b1['headerLines'][_0xf8e3('0x12')]>0x0){var _0x1e8917=[_0xf8e3('0x2f'),_0xf8e3('0x30'),_0xf8e3('0x31')];for(var _0x114a31=0x0;_0x114a31<_0x5b99b1[_0xf8e3('0x2e')][_0xf8e3('0x12')];_0x114a31++){var _0x571ea5=_[_0xf8e3('0x32')](_0x1e8917,_0x5b99b1[_0xf8e3('0x2e')][_0x114a31][_0xf8e3('0x33')]);if(_0x571ea5>=0x0){_0xe5102b[_0xf8e3('0x34')]=!![];}}}return _0xe5102b;}exports[_0xf8e3('0x35')]=function(_0xe7fcb9,_0x792190,_0xe2cc91){var _0x5175c0={'from':getAddress(_0x792190['from']),'firstName':getFirstName(_0x792190['from']),'lastName':getLastName(_0x792190[_0xf8e3('0x36')]),'mapKey':_0xf8e3('0x25'),'message':{'from':getMails(_0xe7fcb9['email'],_0x792190[_0xf8e3('0x36')]),'to':_0xe7fcb9['email'],'cc':'','subject':_0x792190[_0xf8e3('0x37')]||'','messageId':_0x792190[_0xf8e3('0x38')],'inReplyTo':_0x792190['inReplyTo'],'sentAt':moment(_0x792190[_0xf8e3('0x39')])['format'](_0xf8e3('0x3a')),'attach':![],'attachments':[]}};if(!_0x792190[_0xf8e3('0x16')]&&!_0x792190['textAsHtml']){var _0x35f353=_[_0xf8e3('0x3b')](_0x792190[_0xf8e3('0x1b')],{'contentType':_0xf8e3('0x3c')});if(_0x35f353['length']){logger['info'](util['format'](_0xf8e3('0x3d'),_0x792190[_0xf8e3('0x38')]));tnef[_0xf8e3('0x3e')](_['first'](_0x35f353)[_0xf8e3('0x2d')],function(_0x4bced6,_0x173b2b){if(_0x173b2b){_0x792190[_0xf8e3('0x16')]=_0x173b2b['BodyHTML']||'<p>Empty\x20message</p>';if(_0x173b2b[_0xf8e3('0x3f')]){for(var _0x2939e6=0x0;_0x2939e6<_0x173b2b[_0xf8e3('0x3f')][_0xf8e3('0x12')];_0x2939e6++){var _0x3b790f=_0x173b2b[_0xf8e3('0x3f')][_0x2939e6];_0x5175c0[_0xf8e3('0x23')][_0xf8e3('0x1b')][_0xf8e3('0x1c')]({'filename':_0x3b790f[_0xf8e3('0x40')],'content':Buffer[_0xf8e3('0x36')](_0x3b790f['Data'])});}}}_0xe2cc91(parseEmail(_0xe7fcb9,_0x792190,_0x5175c0));});}else{_0x792190[_0xf8e3('0x16')]=_0xf8e3('0x41');_0xe2cc91(parseEmail(_0xe7fcb9,_0x792190,_0x5175c0));}}else{_0xe2cc91(parseEmail(_0xe7fcb9,_0x792190,_0x5175c0));}};exports[_0xf8e3('0x42')]=function(_0x458188){switch(_0x458188){case _0xf8e3('0x43'):return _0xf8e3('0x44');case'yahoo':return _0xf8e3('0x45');case _0xf8e3('0x46'):return _0xf8e3('0x47');case _0xf8e3('0x48'):return _0xf8e3('0x49');}return _0xf8e3('0x4a');};
\ No newline at end of file
index 830b6c3..44f317a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a19=['name','Service','key','active','Imap','Smtp'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x8a19,0x15c));var _0x98a1=function(_0x59baa4,_0x542116){_0x59baa4=_0x59baa4-0x0;var _0x4186b1=_0x8a19[_0x59baa4];return _0x4186b1;};'use strict';var _=require('lodash');function MailAccount(_0x5b1e00){this['id']=_0x5b1e00['id']||0x0;this['name']=_0x5b1e00[_0x98a1('0x0')]||_0x98a1('0x1');this[_0x98a1('0x2')]=_0x5b1e00['key']||'SERV';this[_0x98a1('0x3')]=_0x5b1e00[_0x98a1('0x3')]||![];this['Imap']=_0x5b1e00[_0x98a1('0x4')]||[];this[_0x98a1('0x5')]=_0x5b1e00['Smtp']||[];}module['exports']=MailAccount;
\ No newline at end of file
+var _0x029c=['Imap','exports','lodash','name','key','SERV','active'];(function(_0x461f48,_0x37f2fc){var _0x2e8759=function(_0x4e6ead){while(--_0x4e6ead){_0x461f48['push'](_0x461f48['shift']());}};_0x2e8759(++_0x37f2fc);}(_0x029c,0xfe));var _0xc029=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x029c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc029('0x0'));function MailAccount(_0x2b37ae){this['id']=_0x2b37ae['id']||0x0;this[_0xc029('0x1')]=_0x2b37ae[_0xc029('0x1')]||'Service';this[_0xc029('0x2')]=_0x2b37ae[_0xc029('0x2')]||_0xc029('0x3');this[_0xc029('0x4')]=_0x2b37ae[_0xc029('0x4')]||![];this['Imap']=_0x2b37ae[_0xc029('0x5')]||[];this['Smtp']=_0x2b37ae['Smtp']||[];}module[_0xc029('0x6')]=MailAccount;
\ No newline at end of file
index d765883..2ae6ca7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd2e=['mergeFromDatabase','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype'];(function(_0x5c51cf,_0x25ad16){var _0x18b05d=function(_0xd5729f){while(--_0xd5729f){_0x5c51cf['push'](_0x5c51cf['shift']());}};_0x18b05d(++_0x25ad16);}(_0xbd2e,0x73));var _0xebd2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbd2e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xebd2('0x0'));var MailAccount=require(_0xebd2('0x1'));var Realtime=function(){this[_0xebd2('0x2')]={};};function freeIsNotKey(_0x188bae,_0x5dbeb4,_0x41bfc5){var _0x21ddaa=_[_0xebd2('0x3')](_0x188bae,function(_0x2dda9a,_0x24a106){return _0x2dda9a[_0x41bfc5];});for(var _0x344e2a in _0x5dbeb4){if(_0x5dbeb4[_0xebd2('0x4')](_0x344e2a)){if(!_0x21ddaa[_0x344e2a]){delete _0x5dbeb4[_0x344e2a];}}}}Realtime[_0xebd2('0x5')][_0xebd2('0x6')]=function(_0x3fb78f,_0x277648){for(var _0x5df145 in _0x277648){if(_0x3fb78f[_0xebd2('0x4')](_0x5df145)){_0x3fb78f[_0x5df145]=_0x277648[_0x5df145];}}};Realtime[_0xebd2('0x5')]['initMailAccounts']=function(){var _0x1e932f=this;return function(_0x13010c){if(_0x13010c){freeIsNotKey(_0x13010c,_0x1e932f[_0xebd2('0x2')],'id');for(var _0x428930=0x0,_0x128468={},_0xa6507c={};_0x428930<_0x13010c[_0xebd2('0x7')];_0x428930+=0x1){_0x128468=_0x13010c[_0x428930];if(_[_0xebd2('0x8')](_0x1e932f[_0xebd2('0x2')][_0x128468['id']])){_0x1e932f[_0xebd2('0x2')][_0x128468['id']]=new MailAccount(_0x128468);}else{_[_0xebd2('0x9')](_0x1e932f['mailAccounts'][_0x128468['id']],_0x128468);}}}return _0x1e932f['mailAccounts'];};};module[_0xebd2('0xa')]=Realtime;
\ No newline at end of file
+var _0xec94=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x4ba682,_0x2ae9d3){var _0x33a3e5=function(_0x1005a7){while(--_0x1005a7){_0x4ba682['push'](_0x4ba682['shift']());}};_0x33a3e5(++_0x2ae9d3);}(_0xec94,0x100));var _0x4ec9=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0xec94[_0x3ab0ac];return _0x1f743d;};'use strict';var _=require('lodash');var MailAccount=require(_0x4ec9('0x0'));var Realtime=function(){this[_0x4ec9('0x1')]={};};function freeIsNotKey(_0x14eda1,_0x116c2d,_0x14ee95){var _0x471c78=_[_0x4ec9('0x2')](_0x14eda1,function(_0x15cf4f,_0x3c75a2){return _0x15cf4f[_0x14ee95];});for(var _0x23aa1d in _0x116c2d){if(_0x116c2d[_0x4ec9('0x3')](_0x23aa1d)){if(!_0x471c78[_0x23aa1d]){delete _0x116c2d[_0x23aa1d];}}}}Realtime[_0x4ec9('0x4')][_0x4ec9('0x5')]=function(_0x3f989c,_0x53918c){for(var _0x5a044a in _0x53918c){if(_0x3f989c[_0x4ec9('0x3')](_0x5a044a)){_0x3f989c[_0x5a044a]=_0x53918c[_0x5a044a];}}};Realtime[_0x4ec9('0x4')][_0x4ec9('0x6')]=function(){var _0x49fc8a=this;return function(_0x555bd9){if(_0x555bd9){freeIsNotKey(_0x555bd9,_0x49fc8a[_0x4ec9('0x1')],'id');for(var _0x56f8ab=0x0,_0x49d2dc={},_0x33adcc={};_0x56f8ab<_0x555bd9[_0x4ec9('0x7')];_0x56f8ab+=0x1){_0x49d2dc=_0x555bd9[_0x56f8ab];if(_[_0x4ec9('0x8')](_0x49fc8a[_0x4ec9('0x1')][_0x49d2dc['id']])){_0x49fc8a[_0x4ec9('0x1')][_0x49d2dc['id']]=new MailAccount(_0x49d2dc);}else{_['merge'](_0x49fc8a[_0x4ec9('0x1')][_0x49d2dc['id']],_0x49d2dc);}}}return _0x49fc8a['mailAccounts'];};};module[_0x4ec9('0x9')]=Realtime;
\ No newline at end of file
index d7385d8..62b0b5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc16d=['notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','Smtp','getMailAccount'];(function(_0x136f58,_0x3f32fa){var _0x1af14f=function(_0x1e488c){while(--_0x1e488c){_0x136f58['push'](_0x136f58['shift']());}};_0x1af14f(++_0x3f32fa);}(_0xc16d,0x145));var _0xdc16=function(_0x74ec89,_0x2d0ddc){_0x74ec89=_0x74ec89-0x0;var _0x33f741=_0xc16d[_0x74ec89];return _0x33f741;};'use strict';var client=require(_0xdc16('0x0'));exports[_0xdc16('0x1')]=function(){return function(){return client[_0xdc16('0x2')](_0xdc16('0x3'),{'options':{'attributes':['id',_0xdc16('0x4'),_0xdc16('0x5'),_0xdc16('0x6'),'active',_0xdc16('0x7'),_0xdc16('0x8'),_0xdc16('0x9')],'raw':![],'include':[{'model':_0xdc16('0xa'),'as':_0xdc16('0xb')},{'model':_0xdc16('0xc'),'as':_0xdc16('0xd')}]},'log':_0xdc16('0xe')});};};exports[_0xdc16('0xf')]=function(_0x473d25,_0x25bde7){return client[_0xdc16('0x2')](_0xdc16('0x10'),{'account':{'id':_0x473d25},'body':_0x25bde7,'log':_0xdc16('0x10')});};
\ No newline at end of file
+var _0xc82c=['MailServerIn','Imap','getMailAccount','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xc82c,0x125));var _0xcc82=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc82c[_0x13d07a];return _0x5ee0ee;};'use strict';var client=require(_0xcc82('0x0'));exports[_0xcc82('0x1')]=function(){return function(){return client['Request'](_0xcc82('0x2'),{'options':{'attributes':['id',_0xcc82('0x3'),_0xcc82('0x4'),_0xcc82('0x5'),_0xcc82('0x6'),'key','ListId','TemplateId'],'raw':![],'include':[{'model':_0xcc82('0x7'),'as':_0xcc82('0x8')},{'model':'MailServerOut','as':'Smtp'}]},'log':_0xcc82('0x9')});};};exports['notify']=function(_0x8efbe5,_0x1f138b){return client[_0xcc82('0xa')]('NotifyMailAccount',{'account':{'id':_0x8efbe5},'body':_0x1f138b,'log':_0xcc82('0xb')});};
\ No newline at end of file
index 97d3cbb..85d91ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2de7=['GetSettings','../client','Request','ShowSetting','loginMailFrequency'];(function(_0x184d83,_0x4e82c2){var _0x42b14e=function(_0x33ff90){while(--_0x33ff90){_0x184d83['push'](_0x184d83['shift']());}};_0x42b14e(++_0x4e82c2);}(_0x2de7,0x178));var _0x72de=function(_0x4f9aa8,_0x284d52){_0x4f9aa8=_0x4f9aa8-0x0;var _0x4a2205=_0x2de7[_0x4f9aa8];return _0x4a2205;};'use strict';var client=require(_0x72de('0x0'));exports['getSettings']=function(){return client[_0x72de('0x1')](_0x72de('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x72de('0x3')]},'log':_0x72de('0x4')});};
\ No newline at end of file
+var _0xa631=['GetSettings','../client','ShowSetting','loginMailFrequency'];(function(_0x1e03a6,_0xf0349){var _0x295b64=function(_0x1ad0a5){while(--_0x1ad0a5){_0x1e03a6['push'](_0x1e03a6['shift']());}};_0x295b64(++_0xf0349);}(_0xa631,0x101));var _0x1a63=function(_0x77a22c,_0xfd3cac){_0x77a22c=_0x77a22c-0x0;var _0x3e6b0a=_0xa631[_0x77a22c];return _0x3e6b0a;};'use strict';var client=require(_0x1a63('0x0'));exports['getSettings']=function(){return client['Request'](_0x1a63('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1a63('0x2')]},'log':_0x1a63('0x3')});};
\ No newline at end of file
index 4e448f9..2ced283 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 0443c4c..1511bef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ea=['../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','polling','redis','localhost','socket.io-redis','../../config/triggers','../../config/socketio','default'];(function(_0x3386fa,_0x2064a7){var _0x1e4cca=function(_0x5510e4){while(--_0x5510e4){_0x3386fa['push'](_0x3386fa['shift']());}};_0x1e4cca(++_0x2064a7);}(_0xd2ea,0x127));var _0xad2e=function(_0x14adfc,_0x2f05fa){_0x14adfc=_0x14adfc-0x0;var _0x384191=_0xd2ea[_0x14adfc];return _0x384191;};'use strict';var _=require('lodash');var http=require(_0xad2e('0x0'));var express=require(_0xad2e('0x1'));var sticky=require(_0xad2e('0x2'));var Redis=require(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));var app=express();var server=http[_0xad2e('0x5')](app);server[_0xad2e('0x6')]=0xdbba0;if(sticky[_0xad2e('0x7')](server,config[_0xad2e('0x8')])){var socketio=require(_0xad2e('0x9'))(server,{'transports':['websocket',_0xad2e('0xa')]});config[_0xad2e('0xb')]=_['defaults'](config[_0xad2e('0xb')],{'host':_0xad2e('0xc'),'port':0x18eb});socketio['adapter'](require(_0xad2e('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xad2e('0xb')])}));require(_0xad2e('0xe'))['default']();require(_0xad2e('0xf'))[_0xad2e('0x10')](socketio);require(_0xad2e('0x11'))[_0xad2e('0x10')](app);require(_0xad2e('0x12'))[_0xad2e('0x10')](app);}else{server[_0xad2e('0x13')](_0xad2e('0x14'),function(){console[_0xad2e('0x15')](_0xad2e('0x16'),config[_0xad2e('0x8')]);});}exports=module[_0xad2e('0x17')]=app;
\ No newline at end of file
+var _0x6b6e=['sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','localhost','adapter','socket.io-redis','redis','../../config/triggers','../../config/socketio','default','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6b6e,0x1e1));var _0xe6b6=function(_0x28a2e8,_0x5b84c9){_0x28a2e8=_0x28a2e8-0x0;var _0x496bf1=_0x6b6e[_0x28a2e8];return _0x496bf1;};'use strict';var _=require('lodash');var http=require(_0xe6b6('0x0'));var express=require(_0xe6b6('0x1'));var sticky=require(_0xe6b6('0x2'));var Redis=require('ioredis');var config=require(_0xe6b6('0x3'));var app=express();var server=http[_0xe6b6('0x4')](app);server[_0xe6b6('0x5')]=0xdbba0;if(sticky[_0xe6b6('0x6')](server,config[_0xe6b6('0x7')])){var socketio=require(_0xe6b6('0x8'))(server,{'transports':['websocket','polling']});config['redis']=_['defaults'](config['redis'],{'host':_0xe6b6('0x9'),'port':0x18eb});socketio[_0xe6b6('0xa')](require(_0xe6b6('0xb'))({'pubClient':new Redis(config[_0xe6b6('0xc')]),'subClient':new Redis(config[_0xe6b6('0xc')])}));require(_0xe6b6('0xd'))['default']();require(_0xe6b6('0xe'))[_0xe6b6('0xf')](socketio);require('../../config/express')[_0xe6b6('0xf')](app);require(_0xe6b6('0x10'))[_0xe6b6('0xf')](app);}else{server[_0xe6b6('0x11')](_0xe6b6('0x12'),function(){console['log'](_0xe6b6('0x13'),config[_0xe6b6('0x7')]);});}exports=module[_0xe6b6('0x14')]=app;
\ No newline at end of file
index 4172d6f..53ea1e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7782=['routing','http','request','then','debug','error','rpc','message','result','catch','jayson/promise','bluebird','../../config/logger'];(function(_0xb39b04,_0x5910ad){var _0x1ab93b=function(_0x4116c3){while(--_0x4116c3){_0xb39b04['push'](_0xb39b04['shift']());}};_0x1ab93b(++_0x5910ad);}(_0x7782,0x72));var _0x2778=function(_0x435f9e,_0x240e90){_0x435f9e=_0x435f9e-0x0;var _0x5c0cf4=_0x7782[_0x435f9e];return _0x5c0cf4;};'use strict';var jayson=require(_0x2778('0x0'));var BPromise=require(_0x2778('0x1'));var logger=require(_0x2778('0x2'))(_0x2778('0x3'));var client=jayson['client'][_0x2778('0x4')]({'port':0x2329});client['Request']=function(_0x4d4b88,_0x1170f2){return new BPromise(function(_0x30d305,_0x3ca2d1){return client[_0x2778('0x5')](_0x4d4b88,_0x1170f2)[_0x2778('0x6')](function(_0x3eabf0){logger[_0x2778('0x7')]('rpc','routing',_0x4d4b88,_0x1170f2,_0x3eabf0);if(_0x3eabf0['error']){logger[_0x2778('0x8')](_0x2778('0x9'),_0x2778('0x3'),_0x4d4b88,_0x3eabf0[_0x2778('0x8')]['message'],_0x1170f2);return _0x3ca2d1(_0x3eabf0[_0x2778('0x8')][_0x2778('0xa')]);}else{return _0x30d305(_0x3eabf0[_0x2778('0xb')]);}})[_0x2778('0xc')](function(_0x55d8dc){logger[_0x2778('0x8')](_0x2778('0x9'),_0x2778('0x3'),_0x4d4b88,_0x55d8dc,_0x1170f2);return _0x3ca2d1(_0x55d8dc);});});};module['exports']=client;
\ No newline at end of file
+var _0xeaf4=['../../config/logger','routing','client','http','Request','then','debug','rpc','error','message','catch','exports','bluebird'];(function(_0x4a351d,_0x4385d0){var _0x480f7c=function(_0x2d4702){while(--_0x2d4702){_0x4a351d['push'](_0x4a351d['shift']());}};_0x480f7c(++_0x4385d0);}(_0xeaf4,0x178));var _0x4eaf=function(_0x4c350f,_0x112958){_0x4c350f=_0x4c350f-0x0;var _0x2db34e=_0xeaf4[_0x4c350f];return _0x2db34e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4eaf('0x0'));var logger=require(_0x4eaf('0x1'))(_0x4eaf('0x2'));var client=jayson[_0x4eaf('0x3')][_0x4eaf('0x4')]({'port':0x2329});client[_0x4eaf('0x5')]=function(_0x1cb826,_0x19201a){return new BPromise(function(_0x549e35,_0x16fe7a){return client['request'](_0x1cb826,_0x19201a)[_0x4eaf('0x6')](function(_0x285bd9){logger[_0x4eaf('0x7')](_0x4eaf('0x8'),_0x4eaf('0x2'),_0x1cb826,_0x19201a,_0x285bd9);if(_0x285bd9[_0x4eaf('0x9')]){logger[_0x4eaf('0x9')](_0x4eaf('0x8'),_0x4eaf('0x2'),_0x1cb826,_0x285bd9['error'][_0x4eaf('0xa')],_0x19201a);return _0x16fe7a(_0x285bd9['error'][_0x4eaf('0xa')]);}else{return _0x549e35(_0x285bd9['result']);}})[_0x4eaf('0xb')](function(_0xc032ef){logger['error'](_0x4eaf('0x8'),_0x4eaf('0x2'),_0x1cb826,_0xc032ef,_0x19201a);return _0x16fe7a(_0xc032ef);});});};module[_0x4eaf('0xc')]=client;
\ No newline at end of file
index d405c2c..7a073a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6308=['getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initIntervals'];(function(_0x355952,_0x1f47f7){var _0x37fcb7=function(_0x5788f4){while(--_0x5788f4){_0x355952['push'](_0x355952['shift']());}};_0x37fcb7(++_0x1f47f7);}(_0x6308,0x144));var _0x8630=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x6308[_0x1d9aa0];return _0x226868;};'use strict';var BPromise=require(_0x8630('0x0'));var server=require(_0x8630('0x1'));var Realtime=require(_0x8630('0x2'));var user=require(_0x8630('0x3'));var interval=require(_0x8630('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x8630('0x5'));var smsQueue=require(_0x8630('0x6'));var mailQueue=require(_0x8630('0x7'));var faxQueue=require(_0x8630('0x8'));var whatsappQueue=require(_0x8630('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8630('0xa')]()[_0x8630('0xb')](user[_0x8630('0xc')]())[_0x8630('0xb')](realtime['initAgents']())['then'](interval['getIntervals']())[_0x8630('0xb')](realtime[_0x8630('0xd')]())[_0x8630('0xb')](openchannelQueue[_0x8630('0xe')]())[_0x8630('0xb')](realtime[_0x8630('0xf')]())[_0x8630('0xb')](chatQueue[_0x8630('0x10')]())[_0x8630('0xb')](realtime[_0x8630('0x11')]())[_0x8630('0xb')](smsQueue[_0x8630('0x12')]())[_0x8630('0xb')](realtime[_0x8630('0x13')]())[_0x8630('0xb')](mailQueue[_0x8630('0x14')]())[_0x8630('0xb')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())[_0x8630('0xb')](realtime[_0x8630('0x15')]())[_0x8630('0xb')](whatsappQueue[_0x8630('0x16')]())[_0x8630('0xb')](realtime[_0x8630('0x17')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x8630('0xb')](function(_0x2c7a3f){return initRealtime();})[_0x8630('0xb')](function(_0xd7173){return setInterval(initRealtime,0x1388);})[_0x8630('0x18')](function(_0x1dc684){console[_0x8630('0x19')](_0x1dc684);});}main();
\ No newline at end of file
+var _0x350a=['./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./rpc/user','./rpc/interval'];(function(_0x5286e2,_0x884267){var _0x3b80b0=function(_0xb5d94b){while(--_0xb5d94b){_0x5286e2['push'](_0x5286e2['shift']());}};_0x3b80b0(++_0x884267);}(_0x350a,0x15c));var _0xa350=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x350a[_0x4ea69d];return _0x5318e0;};'use strict';var BPromise=require(_0xa350('0x0'));var server=require(_0xa350('0x1'));var Realtime=require('./realtime');var user=require(_0xa350('0x2'));var interval=require(_0xa350('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xa350('0x4'));var mailQueue=require(_0xa350('0x5'));var faxQueue=require(_0xa350('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xa350('0x7')]()[_0xa350('0x8')](user[_0xa350('0x9')]())[_0xa350('0x8')](realtime['initAgents']())[_0xa350('0x8')](interval[_0xa350('0xa')]())[_0xa350('0x8')](realtime[_0xa350('0xb')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xa350('0x8')](realtime['initOpenchannelQueues']())[_0xa350('0x8')](chatQueue[_0xa350('0xc')]())[_0xa350('0x8')](realtime[_0xa350('0xd')]())['then'](smsQueue[_0xa350('0xe')]())['then'](realtime[_0xa350('0xf')]())[_0xa350('0x8')](mailQueue['getMailQueues']())[_0xa350('0x8')](realtime['initMailQueues']())[_0xa350('0x8')](faxQueue[_0xa350('0x10')]())['then'](realtime[_0xa350('0x11')]())['then'](whatsappQueue[_0xa350('0x12')]())[_0xa350('0x8')](realtime['initWhatsappQueues']())[_0xa350('0x8')](function(){return realtime;});}function main(){return server[_0xa350('0x13')](realtime)[_0xa350('0x8')](function(_0x20a231){return initRealtime();})[_0xa350('0x8')](function(_0x243d0b){return setInterval(initRealtime,0x1388);})[_0xa350('0x14')](function(_0x364022){console[_0xa350('0x15')](_0x364022);});}main();
\ No newline at end of file
index 61d5f36..12e1e5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x3b986a,_0x148398){var _0x386a50=function(_0x7f1879){while(--_0x7f1879){_0x3b986a['push'](_0x3b986a['shift']());}};_0x386a50(++_0x148398);}(_0x5fc3,0xa8));var _0x35fc=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x5fc3[_0x34df4a];return _0x145c69;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x1c3765,_0xc3b431){var _0x3ab003=function(_0x470393){while(--_0x470393){_0x1c3765['push'](_0x1c3765['shift']());}};_0x3ab003(++_0xc3b431);}(_0x326f,0xd1));var _0xf326=function(_0x5893c4,_0x3d7396){_0x5893c4=_0x5893c4-0x0;var _0x5ac7c4=_0x326f[_0x5893c4];return _0x5ac7c4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine;
\ No newline at end of file
index 955c399..39577f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8e=['result','sendMailMessage','jayson/promise','http','request','then','error'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7c8e,0x12f));var _0xe7c8=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x7c8e[_0x4b4277];return _0x1ff405;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xe7c8('0x0'));var client=jayson['client'][_0xe7c8('0x1')]({'port':0x232b});function request(_0x1dad10,_0x4741d1){return new BPromise(function(_0x53458f,_0x1d8e30){return client[_0xe7c8('0x2')](_0x1dad10,_0x4741d1)[_0xe7c8('0x3')](function(_0x3127d0){if(_0x3127d0[_0xe7c8('0x4')]){return _0x1d8e30(_0x3127d0[_0xe7c8('0x4')]['message']);}else{return _0x53458f(_0x3127d0[_0xe7c8('0x5')]);}})['catch'](function(_0x286e61){return _0x1d8e30(_0x286e61);});});}exports[_0xe7c8('0x6')]=function(_0x92d40a,_0xc2928a){return request('SendMail',{'account':_0x92d40a,'message':_0xc2928a});};
\ No newline at end of file
+var _0x625b=['result','sendMailMessage','SendMail','bluebird','client','http','request'];(function(_0x668787,_0x1c38fd){var _0x40639f=function(_0x7aeeff){while(--_0x7aeeff){_0x668787['push'](_0x668787['shift']());}};_0x40639f(++_0x1c38fd);}(_0x625b,0x1ca));var _0xb625=function(_0x4b78c7,_0x5d7848){_0x4b78c7=_0x4b78c7-0x0;var _0x6f87e8=_0x625b[_0x4b78c7];return _0x6f87e8;};'use strict';var BPromise=require(_0xb625('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xb625('0x1')][_0xb625('0x2')]({'port':0x232b});function request(_0x5a0b22,_0x174606){return new BPromise(function(_0x4d82ea,_0x5b7452){return client[_0xb625('0x3')](_0x5a0b22,_0x174606)['then'](function(_0x24859c){if(_0x24859c['error']){return _0x5b7452(_0x24859c['error']['message']);}else{return _0x4d82ea(_0x24859c[_0xb625('0x4')]);}})['catch'](function(_0x3b5fca){return _0x5b7452(_0x3b5fca);});});}exports[_0xb625('0x5')]=function(_0xca4fe0,_0x55ba78){return request(_0xb625('0x6'),{'account':_0xca4fe0,'message':_0x55ba78});};
\ No newline at end of file
index 2930961..868db4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76e0=['redis','socket.io-emitter','name','voicePause','chatPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busyQueue','md5','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','mail','openchannel','fax','length','StatusTime','mailPause','faxPause','chatCapacity','mailCurrentCapacity','smsStatus','openchannelCurrentCapacity','busy','stringify','emit','user:save','exports','../../../config/environment','defaults'];(function(_0x414cec,_0x3b0bd8){var _0x457fca=function(_0x58c0a5){while(--_0x58c0a5){_0x414cec['push'](_0x414cec['shift']());}};_0x457fca(++_0x3b0bd8);}(_0x76e0,0x6e));var _0x076e=function(_0x5a5f14,_0x55826b){_0x5a5f14=_0x5a5f14-0x0;var _0x5f0ac7=_0x76e0[_0x5a5f14];return _0x5f0ac7;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x076e('0x0'));config['redis']=_[_0x076e('0x1')](config[_0x076e('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x076e('0x3'))(new Redis(config[_0x076e('0x2')]));function Agent(_0x3bacb1){this['id']=_0x3bacb1['id']||0x0;this[_0x076e('0x4')]=_0x3bacb1[_0x076e('0x4')]||'';this['online']=_0x3bacb1['online']||!![];this[_0x076e('0x5')]=_0x3bacb1[_0x076e('0x5')]||![];this[_0x076e('0x6')]=_0x3bacb1['chatPause']||![];this['mailPause']=_0x3bacb1['mailPause']||![];this['faxPause']=_0x3bacb1['faxPause']||![];this[_0x076e('0x7')]=_0x3bacb1[_0x076e('0x7')]||![];this[_0x076e('0x8')]=_0x3bacb1[_0x076e('0x8')]||![];this[_0x076e('0x9')]=_0x076e('0xa');this[_0x076e('0xb')]=0x0;this['chatCapacity']=_0x3bacb1['chatCapacity']||0x0;this[_0x076e('0xc')]=0x0;this[_0x076e('0xd')]=_0x076e('0xa');this[_0x076e('0xe')]=0x0;this[_0x076e('0xf')]=_0x3bacb1[_0x076e('0xf')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x076e('0x10')]=_0x076e('0xa');this[_0x076e('0x11')]=0x0;this['faxCapacity']=_0x3bacb1[_0x076e('0x12')]||0x0;this[_0x076e('0x13')]=0x0;this['smsStatus']=_0x076e('0xa');this[_0x076e('0x14')]=0x0;this[_0x076e('0x15')]=_0x3bacb1[_0x076e('0x15')]||0x0;this[_0x076e('0x16')]=0x0;this[_0x076e('0x17')]=_0x076e('0xa');this[_0x076e('0x18')]=0x0;this[_0x076e('0x19')]=_0x3bacb1[_0x076e('0x19')]||0x0;this[_0x076e('0x1a')]=0x0;this[_0x076e('0x1b')]='unknown';this[_0x076e('0x1c')]=0x0;this[_0x076e('0x1d')]=_0x3bacb1[_0x076e('0x1d')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x076e('0x1e')]=undefined;this[_0x076e('0x1f')]='';this[_0x076e('0x20')]();}Agent['prototype'][_0x076e('0x21')]=function(_0x410bca){if(this[_0x410bca+_0x076e('0x22')]>0x0){if(this[_0x410bca+_0x076e('0x23')]>0x0&&this[_0x410bca+_0x076e('0x22')]>=this[_0x410bca+_0x076e('0x23')]){return _0x076e('0x24');}else{return _0x076e('0x25');}}else{return _0x076e('0x26');}};Agent[_0x076e('0x27')]['updateRealtime']=function(){var _0x447043=[_0x076e('0x28'),'chat',_0x076e('0x29'),_0x076e('0x2a'),'sms','whatsapp'];for(var _0x4c7ed3=0x0;_0x4c7ed3<_0x447043[_0x076e('0x2b')];_0x4c7ed3+=0x1){var _0x1a6011=this[_0x076e('0x21')](_0x447043[_0x4c7ed3]);if(this[_0x447043[_0x4c7ed3]+'Status']!==_0x1a6011){this[_0x447043[_0x4c7ed3]+_0x076e('0x2c')]=_['toNumber'](moment()['format']('x'));}this[_0x447043[_0x4c7ed3]+'Status']=_0x1a6011;}var _0x17d06d={'id':this['id'],'name':this[_0x076e('0x4')],'online':this['online'],'voicePause':this['voicePause'],'chatPause':this[_0x076e('0x6')],'mailPause':this[_0x076e('0x2d')],'smsPause':this[_0x076e('0x7')],'faxPause':this[_0x076e('0x2e')],'openchannelPause':this[_0x076e('0x8')],'chatStatus':this[_0x076e('0x9')],'chatStatusTime':this[_0x076e('0xb')],'chatCapacity':this[_0x076e('0x2f')],'chatCurrentCapacity':this[_0x076e('0xc')],'mailStatus':this[_0x076e('0xd')],'mailStatusTime':this[_0x076e('0xe')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x076e('0x30')],'faxStatus':this[_0x076e('0x10')],'faxStatusTime':this[_0x076e('0x11')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x076e('0x13')],'smsStatus':this[_0x076e('0x31')],'smsStatusTime':this[_0x076e('0x14')],'smsCapacity':this[_0x076e('0x15')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x076e('0x17')],'whatsappStatusTime':this[_0x076e('0x18')],'whatsappCapacity':this[_0x076e('0x19')],'whatsappCurrentCapacity':this[_0x076e('0x1a')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x076e('0x1c')],'openchannelCapacity':this[_0x076e('0x1d')],'openchannelCurrentCapacity':this[_0x076e('0x32')],'busy':this[_0x076e('0x33')],'busyQueue':this[_0x076e('0x1e')]};var _0xd87254=md5(JSON[_0x076e('0x34')](_0x17d06d));if(this[_0x076e('0x1f')]!==_0xd87254){this[_0x076e('0x1f')]=_0xd87254;io[_0x076e('0x35')](_0x076e('0x36'),_0x17d06d);}};module[_0x076e('0x37')]=Agent;
\ No newline at end of file
+var _0xd5a2=['stringify','user:save','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','busy','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatPause','chatStatusTime','mailStatusTime','openchannelCapacity','openchannelCurrentCapacity'];(function(_0x530e5d,_0x533555){var _0x3bb68d=function(_0x33c361){while(--_0x33c361){_0x530e5d['push'](_0x530e5d['shift']());}};_0x3bb68d(++_0x533555);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x11ef42,_0x5f0da2){_0x11ef42=_0x11ef42-0x0;var _0x32cf7e=_0xd5a2[_0x11ef42];return _0x32cf7e;};'use strict';var _=require('lodash');var moment=require(_0x2d5a('0x0'));var md5=require(_0x2d5a('0x1'));var Redis=require(_0x2d5a('0x2'));var config=require(_0x2d5a('0x3'));config[_0x2d5a('0x4')]=_['defaults'](config[_0x2d5a('0x4')],{'host':_0x2d5a('0x5'),'port':0x18eb});var io=require(_0x2d5a('0x6'))(new Redis(config[_0x2d5a('0x4')]));function Agent(_0x2f7a0a){this['id']=_0x2f7a0a['id']||0x0;this[_0x2d5a('0x7')]=_0x2f7a0a[_0x2d5a('0x7')]||'';this[_0x2d5a('0x8')]=_0x2f7a0a[_0x2d5a('0x8')]||!![];this[_0x2d5a('0x9')]=_0x2f7a0a[_0x2d5a('0x9')]||![];this['chatPause']=_0x2f7a0a['chatPause']||![];this[_0x2d5a('0xa')]=_0x2f7a0a['mailPause']||![];this[_0x2d5a('0xb')]=_0x2f7a0a[_0x2d5a('0xb')]||![];this['smsPause']=_0x2f7a0a[_0x2d5a('0xc')]||![];this[_0x2d5a('0xd')]=_0x2f7a0a[_0x2d5a('0xd')]||![];this[_0x2d5a('0xe')]=_0x2d5a('0xf');this['chatStatusTime']=0x0;this[_0x2d5a('0x10')]=_0x2f7a0a[_0x2d5a('0x10')]||0x0;this[_0x2d5a('0x11')]=0x0;this[_0x2d5a('0x12')]='unknown';this['mailStatusTime']=0x0;this[_0x2d5a('0x13')]=_0x2f7a0a[_0x2d5a('0x13')]||0x0;this[_0x2d5a('0x14')]=0x0;this[_0x2d5a('0x15')]='unknown';this[_0x2d5a('0x16')]=0x0;this[_0x2d5a('0x17')]=_0x2f7a0a[_0x2d5a('0x17')]||0x0;this[_0x2d5a('0x18')]=0x0;this[_0x2d5a('0x19')]='unknown';this[_0x2d5a('0x1a')]=0x0;this[_0x2d5a('0x1b')]=_0x2f7a0a[_0x2d5a('0x1b')]||0x0;this[_0x2d5a('0x1c')]=0x0;this[_0x2d5a('0x1d')]='unknown';this[_0x2d5a('0x1e')]=0x0;this['whatsappCapacity']=_0x2f7a0a[_0x2d5a('0x1f')]||0x0;this[_0x2d5a('0x20')]=0x0;this[_0x2d5a('0x21')]=_0x2d5a('0xf');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x2f7a0a['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x2d5a('0x22')]=![];this[_0x2d5a('0x23')]=undefined;this['md5']='';this[_0x2d5a('0x24')]();}Agent[_0x2d5a('0x25')][_0x2d5a('0x26')]=function(_0xca4615){if(this[_0xca4615+'CurrentCapacity']>0x0){if(this[_0xca4615+_0x2d5a('0x27')]>0x0&&this[_0xca4615+'CurrentCapacity']>=this[_0xca4615+_0x2d5a('0x27')]){return _0x2d5a('0x28');}else{return _0x2d5a('0x29');}}else{return _0x2d5a('0x2a');}};Agent['prototype']['updateRealtime']=function(){var _0x4b1049=[_0x2d5a('0x2b'),_0x2d5a('0x2c'),_0x2d5a('0x2d'),_0x2d5a('0x2e'),_0x2d5a('0x2f'),_0x2d5a('0x30')];for(var _0x519182=0x0;_0x519182<_0x4b1049[_0x2d5a('0x31')];_0x519182+=0x1){var _0xd1c9a2=this[_0x2d5a('0x26')](_0x4b1049[_0x519182]);if(this[_0x4b1049[_0x519182]+_0x2d5a('0x32')]!==_0xd1c9a2){this[_0x4b1049[_0x519182]+_0x2d5a('0x33')]=_[_0x2d5a('0x34')](moment()['format']('x'));}this[_0x4b1049[_0x519182]+'Status']=_0xd1c9a2;}var _0x300d2c={'id':this['id'],'name':this[_0x2d5a('0x7')],'online':this['online'],'voicePause':this[_0x2d5a('0x9')],'chatPause':this[_0x2d5a('0x35')],'mailPause':this[_0x2d5a('0xa')],'smsPause':this[_0x2d5a('0xc')],'faxPause':this[_0x2d5a('0xb')],'openchannelPause':this[_0x2d5a('0xd')],'chatStatus':this[_0x2d5a('0xe')],'chatStatusTime':this[_0x2d5a('0x36')],'chatCapacity':this[_0x2d5a('0x10')],'chatCurrentCapacity':this[_0x2d5a('0x11')],'mailStatus':this[_0x2d5a('0x12')],'mailStatusTime':this[_0x2d5a('0x37')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x2d5a('0x14')],'faxStatus':this[_0x2d5a('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2d5a('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x2d5a('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x2d5a('0x1e')],'whatsappCapacity':this[_0x2d5a('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x2d5a('0x21')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x2d5a('0x38')],'openchannelCurrentCapacity':this[_0x2d5a('0x39')],'busy':this[_0x2d5a('0x22')],'busyQueue':this['busyQueue']};var _0x1e8848=md5(JSON[_0x2d5a('0x3a')](_0x300d2c));if(this['md5']!==_0x1e8848){this[_0x2d5a('0x1')]=_0x1e8848;io['emit'](_0x2d5a('0x3b'),_0x300d2c);}};module[_0x2d5a('0x3c')]=Agent;
\ No newline at end of file
index 90fc2a6..f5e6541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb02c=['length','online','chatPause','available','waiting','stringify','chat:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused'];(function(_0x3b3559,_0x59f47e){var _0x1793a9=function(_0x4b4737){while(--_0x4b4737){_0x3b3559['push'](_0x3b3559['shift']());}};_0x1793a9(++_0x59f47e);}(_0xb02c,0x13d));var _0xcb02=function(_0xe0b772,_0x5d9a20){_0xe0b772=_0xe0b772-0x0;var _0x3fc740=_0xb02c[_0xe0b772];return _0x3fc740;};'use strict';var _=require(_0xcb02('0x0'));var md5=require(_0xcb02('0x1'));var util=require(_0xcb02('0x2'));var Redis=require('ioredis');var config=require(_0xcb02('0x3'));config[_0xcb02('0x4')]=_[_0xcb02('0x5')](config[_0xcb02('0x4')],{'host':_0xcb02('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcb02('0x4')]));function ChatQueue(_0x490de5){this['id']=_0x490de5['id']||0x0;this[_0xcb02('0x7')]=_0x490de5[_0xcb02('0x7')]||'';this[_0xcb02('0x8')]=_0x490de5[_0xcb02('0x8')]||0xa;this[_0xcb02('0x9')]=_0x490de5['strategy']||_0xcb02('0xa');this[_0xcb02('0xb')]=_0x490de5['Agents'];this[_0xcb02('0xc')]={};this['waiting']=0x0;this[_0xcb02('0x1')]='';this['updateRouting']();this[_0xcb02('0xd')]();}ChatQueue['prototype'][_0xcb02('0xe')]=function(){var _0xc58b3e=this[_0xcb02('0xc')]['_rr'];this[_0xcb02('0xc')]=_['map'](this[_0xcb02('0xb')],'id');this[_0xcb02('0xc')][_0xcb02('0xf')]=_0xc58b3e;};ChatQueue[_0xcb02('0x10')][_0xcb02('0xd')]=function(){this[_0xcb02('0x11')]=0x0;this[_0xcb02('0x12')]=0x0;for(var _0x3c60bb=0x0;_0x3c60bb<this[_0xcb02('0xb')][_0xcb02('0x13')];_0x3c60bb+=0x1){if(this[_0xcb02('0xb')][_0x3c60bb][_0xcb02('0x14')]){this['loggedIn']+=0x1;}if(this[_0xcb02('0xb')][_0x3c60bb][_0xcb02('0x15')]){this['paused']+=0x1;}}this[_0xcb02('0x16')]=this[_0xcb02('0x11')]-this['paused'];this[_0xcb02('0x16')]=this[_0xcb02('0x16')]>=0x0?this[_0xcb02('0x16')]:0x0;var _0x48dd07={'id':this['id'],'available':this[_0xcb02('0x16')],'loggedIn':this[_0xcb02('0x11')],'name':this['name'],'paused':this[_0xcb02('0x12')],'waiting':this[_0xcb02('0x17')]};var _0x418e61=md5(JSON[_0xcb02('0x18')](_0x48dd07));if(this[_0xcb02('0x1')]!==_0x418e61){this['md5']=_0x418e61;io['to'](util['format'](_0xcb02('0x19'),_0x48dd07['name']))[_0xcb02('0x1a')]('chat_queue:save',_0x48dd07);}};module[_0xcb02('0x1b')]=ChatQueue;
\ No newline at end of file
+var _0x992c=['map','loggedIn','length','online','chatPause','available','paused','name','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','md5','updateRouting','prototype','mapAgentsId','_rr'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x992c,0x1ee));var _0xc992=function(_0x5c37a5,_0xb6429e){_0x5c37a5=_0x5c37a5-0x0;var _0x140a4d=_0x992c[_0x5c37a5];return _0x140a4d;};'use strict';var _=require(_0xc992('0x0'));var md5=require('md5');var util=require(_0xc992('0x1'));var Redis=require('ioredis');var config=require(_0xc992('0x2'));config[_0xc992('0x3')]=_[_0xc992('0x4')](config['redis'],{'host':_0xc992('0x5'),'port':0x18eb});var io=require(_0xc992('0x6'))(new Redis(config[_0xc992('0x3')]));function ChatQueue(_0x5cf18d){this['id']=_0x5cf18d['id']||0x0;this['name']=_0x5cf18d['name']||'';this[_0xc992('0x7')]=_0x5cf18d['timeout']||0xa;this[_0xc992('0x8')]=_0x5cf18d['strategy']||_0xc992('0x9');this[_0xc992('0xa')]=_0x5cf18d[_0xc992('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xc992('0xb')]='';this[_0xc992('0xc')]();this['updateRealtime']();}ChatQueue[_0xc992('0xd')][_0xc992('0xc')]=function(){var _0x123bc1=this[_0xc992('0xe')][_0xc992('0xf')];this[_0xc992('0xe')]=_[_0xc992('0x10')](this['Agents'],'id');this[_0xc992('0xe')][_0xc992('0xf')]=_0x123bc1;};ChatQueue[_0xc992('0xd')]['updateRealtime']=function(){this[_0xc992('0x11')]=0x0;this['paused']=0x0;for(var _0x37dade=0x0;_0x37dade<this[_0xc992('0xa')][_0xc992('0x12')];_0x37dade+=0x1){if(this[_0xc992('0xa')][_0x37dade][_0xc992('0x13')]){this[_0xc992('0x11')]+=0x1;}if(this['Agents'][_0x37dade][_0xc992('0x14')]){this['paused']+=0x1;}}this[_0xc992('0x15')]=this[_0xc992('0x11')]-this[_0xc992('0x16')];this['available']=this[_0xc992('0x15')]>=0x0?this[_0xc992('0x15')]:0x0;var _0x4bfc88={'id':this['id'],'available':this[_0xc992('0x15')],'loggedIn':this[_0xc992('0x11')],'name':this[_0xc992('0x17')],'paused':this[_0xc992('0x16')],'waiting':this[_0xc992('0x18')]};var _0x4162d8=md5(JSON[_0xc992('0x19')](_0x4bfc88));if(this[_0xc992('0xb')]!==_0x4162d8){this['md5']=_0x4162d8;io['to'](util[_0xc992('0x1a')](_0xc992('0x1b'),_0x4bfc88[_0xc992('0x17')]))[_0xc992('0x1c')](_0xc992('0x1d'),_0x4bfc88);}};module['exports']=ChatQueue;
\ No newline at end of file
index 690264b..8b7addf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x576e=['localhost','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','loggedIn','length','online','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','exports','lodash','md5','util','ioredis','redis','defaults'];(function(_0x50186a,_0xd8acee){var _0x5031a8=function(_0x371fc8){while(--_0x371fc8){_0x50186a['push'](_0x50186a['shift']());}};_0x5031a8(++_0xd8acee);}(_0x576e,0x96));var _0xe576=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0x576e[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0xe576('0x0'));var md5=require(_0xe576('0x1'));var util=require(_0xe576('0x2'));var Redis=require(_0xe576('0x3'));var config=require('../../../config/environment');config[_0xe576('0x4')]=_[_0xe576('0x5')](config[_0xe576('0x4')],{'host':_0xe576('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe576('0x4')]));function FaxQueue(_0x22c3bc){this['id']=_0x22c3bc['id']||0x0;this[_0xe576('0x7')]=_0x22c3bc[_0xe576('0x7')]||'';this['timeout']=_0x22c3bc[_0xe576('0x8')]||0xa;this[_0xe576('0x9')]=_0x22c3bc['strategy']||'beepall';this['Agents']=_0x22c3bc[_0xe576('0xa')];this[_0xe576('0xb')]={};this['waiting']=0x0;this[_0xe576('0x1')]='';this[_0xe576('0xc')]();this[_0xe576('0xd')]();}FaxQueue[_0xe576('0xe')][_0xe576('0xc')]=function(){var _0x5554f3=this[_0xe576('0xb')]['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x5554f3;};FaxQueue[_0xe576('0xe')][_0xe576('0xd')]=function(){this[_0xe576('0xf')]=0x0;this['paused']=0x0;for(var _0x14b800=0x0;_0x14b800<this[_0xe576('0xa')][_0xe576('0x10')];_0x14b800+=0x1){if(this[_0xe576('0xa')][_0x14b800][_0xe576('0x11')]){this[_0xe576('0xf')]+=0x1;}if(this['Agents'][_0x14b800][_0xe576('0x12')]){this[_0xe576('0x13')]+=0x1;}}this[_0xe576('0x14')]=this[_0xe576('0xf')]-this[_0xe576('0x13')];this[_0xe576('0x14')]=this[_0xe576('0x14')]>=0x0?this['available']:0x0;var _0x358178={'id':this['id'],'available':this[_0xe576('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xe576('0x7')],'paused':this[_0xe576('0x13')],'waiting':this[_0xe576('0x15')]};var _0x102b24=md5(JSON[_0xe576('0x16')](_0x358178));if(this[_0xe576('0x1')]!==_0x102b24){this[_0xe576('0x1')]=_0x102b24;io['to'](util[_0xe576('0x17')](_0xe576('0x18'),_0x358178[_0xe576('0x7')]))['emit']('fax_queue:save',_0x358178);}};module[_0xe576('0x19')]=FaxQueue;
\ No newline at end of file
+var _0x00ca=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','length','loggedIn','paused','available','stringify','format','fax:queue:%s','fax_queue:save','exports','md5','util','redis','defaults','name'];(function(_0x30beed,_0x4fdbe7){var _0x49d2a7=function(_0x133f83){while(--_0x133f83){_0x30beed['push'](_0x30beed['shift']());}};_0x49d2a7(++_0x4fdbe7);}(_0x00ca,0x14b));var _0xa00c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x00ca[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var md5=require(_0xa00c('0x0'));var util=require(_0xa00c('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa00c('0x2')]=_[_0xa00c('0x3')](config[_0xa00c('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa00c('0x2')]));function FaxQueue(_0x6b1080){this['id']=_0x6b1080['id']||0x0;this[_0xa00c('0x4')]=_0x6b1080[_0xa00c('0x4')]||'';this[_0xa00c('0x5')]=_0x6b1080['timeout']||0xa;this[_0xa00c('0x6')]=_0x6b1080[_0xa00c('0x6')]||_0xa00c('0x7');this['Agents']=_0x6b1080[_0xa00c('0x8')];this[_0xa00c('0x9')]={};this[_0xa00c('0xa')]=0x0;this['md5']='';this[_0xa00c('0xb')]();this[_0xa00c('0xc')]();}FaxQueue[_0xa00c('0xd')]['updateRouting']=function(){var _0xdd1f58=this[_0xa00c('0x9')]['_rr'];this[_0xa00c('0x9')]=_['map'](this[_0xa00c('0x8')],'id');this[_0xa00c('0x9')][_0xa00c('0xe')]=_0xdd1f58;};FaxQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x1ac86f=0x0;_0x1ac86f<this[_0xa00c('0x8')][_0xa00c('0xf')];_0x1ac86f+=0x1){if(this[_0xa00c('0x8')][_0x1ac86f]['online']){this[_0xa00c('0x10')]+=0x1;}if(this['Agents'][_0x1ac86f]['faxPause']){this[_0xa00c('0x11')]+=0x1;}}this[_0xa00c('0x12')]=this[_0xa00c('0x10')]-this['paused'];this[_0xa00c('0x12')]=this[_0xa00c('0x12')]>=0x0?this[_0xa00c('0x12')]:0x0;var _0x41055f={'id':this['id'],'available':this[_0xa00c('0x12')],'loggedIn':this[_0xa00c('0x10')],'name':this['name'],'paused':this[_0xa00c('0x11')],'waiting':this[_0xa00c('0xa')]};var _0x5e9344=md5(JSON[_0xa00c('0x13')](_0x41055f));if(this[_0xa00c('0x0')]!==_0x5e9344){this['md5']=_0x5e9344;io['to'](util[_0xa00c('0x14')](_0xa00c('0x15'),_0x41055f[_0xa00c('0x4')]))['emit'](_0xa00c('0x16'),_0x41055f);}};module[_0xa00c('0x17')]=FaxQueue;
\ No newline at end of file
index 0431199..80a8949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51fc=['name','Intervals','exports'];(function(_0x174202,_0x5c5292){var _0x4daa4a=function(_0x388964){while(--_0x388964){_0x174202['push'](_0x174202['shift']());}};_0x4daa4a(++_0x5c5292);}(_0x51fc,0xb7));var _0xc51f=function(_0xdae6b9,_0x370831){_0xdae6b9=_0xdae6b9-0x0;var _0x4f7567=_0x51fc[_0xdae6b9];return _0x4f7567;};'use strict';function Interval(_0x4c2120){this['id']=_0x4c2120['id']||0x0;this[_0xc51f('0x0')]=_0x4c2120[_0xc51f('0x0')]||'';this['Intervals']=_0x4c2120[_0xc51f('0x1')]||{};}module[_0xc51f('0x2')]=Interval;
\ No newline at end of file
+var _0x7dcb=['Intervals','exports','name'];(function(_0x11ae6d,_0x24a634){var _0x200abc=function(_0x1d80f1){while(--_0x1d80f1){_0x11ae6d['push'](_0x11ae6d['shift']());}};_0x200abc(++_0x24a634);}(_0x7dcb,0x119));var _0xb7dc=function(_0x479774,_0x393894){_0x479774=_0x479774-0x0;var _0x5f4e5c=_0x7dcb[_0x479774];return _0x5f4e5c;};'use strict';function Interval(_0x4eebb6){this['id']=_0x4eebb6['id']||0x0;this[_0xb7dc('0x0')]=_0x4eebb6[_0xb7dc('0x0')]||'';this[_0xb7dc('0x1')]=_0x4eebb6['Intervals']||{};}module[_0xb7dc('0x2')]=Interval;
\ No newline at end of file
index 19058bb..0f0cf5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e18=['_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7e18,0x1a3));var _0x87e1=function(_0x18f129,_0x4db6b1){_0x18f129=_0x18f129-0x0;var _0x5de23d=_0x7e18[_0x18f129];return _0x5de23d;};'use strict';var _=require('lodash');var md5=require(_0x87e1('0x0'));var util=require(_0x87e1('0x1'));var Redis=require(_0x87e1('0x2'));var config=require('../../../config/environment');config[_0x87e1('0x3')]=_[_0x87e1('0x4')](config[_0x87e1('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x87e1('0x5'))(new Redis(config[_0x87e1('0x3')]));function MailQueue(_0x476acf){this['id']=_0x476acf['id']||0x0;this[_0x87e1('0x6')]=_0x476acf['name']||'';this['timeout']=_0x476acf[_0x87e1('0x7')]||0xa;this['strategy']=_0x476acf[_0x87e1('0x8')]||_0x87e1('0x9');this[_0x87e1('0xa')]=_0x476acf[_0x87e1('0xa')];this[_0x87e1('0xb')]={};this[_0x87e1('0xc')]=0x0;this[_0x87e1('0x0')]='';this['updateRouting']();this[_0x87e1('0xd')]();}MailQueue[_0x87e1('0xe')][_0x87e1('0xf')]=function(){var _0x2efe27=this[_0x87e1('0xb')][_0x87e1('0x10')];this[_0x87e1('0xb')]=_[_0x87e1('0x11')](this[_0x87e1('0xa')],'id');this['mapAgentsId']['_rr']=_0x2efe27;};MailQueue[_0x87e1('0xe')][_0x87e1('0xd')]=function(){this[_0x87e1('0x12')]=0x0;this[_0x87e1('0x13')]=0x0;for(var _0x2b3042=0x0;_0x2b3042<this[_0x87e1('0xa')][_0x87e1('0x14')];_0x2b3042+=0x1){if(this['Agents'][_0x2b3042][_0x87e1('0x15')]){this[_0x87e1('0x12')]+=0x1;}if(this[_0x87e1('0xa')][_0x2b3042][_0x87e1('0x16')]){this[_0x87e1('0x13')]+=0x1;}}this['available']=this['loggedIn']-this[_0x87e1('0x13')];this[_0x87e1('0x17')]=this[_0x87e1('0x17')]>=0x0?this['available']:0x0;var _0x448cf6={'id':this['id'],'available':this[_0x87e1('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x87e1('0x6')],'paused':this[_0x87e1('0x13')],'waiting':this[_0x87e1('0xc')]};var _0xbcb1c9=md5(JSON[_0x87e1('0x18')](_0x448cf6));if(this[_0x87e1('0x0')]!==_0xbcb1c9){this[_0x87e1('0x0')]=_0xbcb1c9;io['to'](util[_0x87e1('0x19')](_0x87e1('0x1a'),_0x448cf6[_0x87e1('0x6')]))['emit'](_0x87e1('0x1b'),_0x448cf6);}};module[_0x87e1('0x1c')]=MailQueue;
\ No newline at end of file
+var _0x5213=['defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','mailPause','paused','available','stringify','mail_queue:save','exports','lodash','md5','util','redis'];(function(_0x5afeb7,_0xc2272d){var _0x4f766b=function(_0x48364a){while(--_0x48364a){_0x5afeb7['push'](_0x5afeb7['shift']());}};_0x4f766b(++_0xc2272d);}(_0x5213,0x128));var _0x3521=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x5213[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x3521('0x0'));var md5=require(_0x3521('0x1'));var util=require(_0x3521('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3521('0x3')]=_[_0x3521('0x4')](config[_0x3521('0x3')],{'host':_0x3521('0x5'),'port':0x18eb});var io=require(_0x3521('0x6'))(new Redis(config[_0x3521('0x3')]));function MailQueue(_0x24a75f){this['id']=_0x24a75f['id']||0x0;this[_0x3521('0x7')]=_0x24a75f[_0x3521('0x7')]||'';this[_0x3521('0x8')]=_0x24a75f[_0x3521('0x8')]||0xa;this[_0x3521('0x9')]=_0x24a75f[_0x3521('0x9')]||'beepall';this[_0x3521('0xa')]=_0x24a75f[_0x3521('0xa')];this[_0x3521('0xb')]={};this[_0x3521('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x3521('0xd')]();}MailQueue[_0x3521('0xe')][_0x3521('0xf')]=function(){var _0x5f0259=this['mapAgentsId'][_0x3521('0x10')];this[_0x3521('0xb')]=_[_0x3521('0x11')](this[_0x3521('0xa')],'id');this[_0x3521('0xb')]['_rr']=_0x5f0259;};MailQueue[_0x3521('0xe')][_0x3521('0xd')]=function(){this[_0x3521('0x12')]=0x0;this['paused']=0x0;for(var _0x222d91=0x0;_0x222d91<this[_0x3521('0xa')]['length'];_0x222d91+=0x1){if(this[_0x3521('0xa')][_0x222d91]['online']){this[_0x3521('0x12')]+=0x1;}if(this[_0x3521('0xa')][_0x222d91][_0x3521('0x13')]){this[_0x3521('0x14')]+=0x1;}}this[_0x3521('0x15')]=this[_0x3521('0x12')]-this[_0x3521('0x14')];this[_0x3521('0x15')]=this['available']>=0x0?this[_0x3521('0x15')]:0x0;var _0x175f66={'id':this['id'],'available':this[_0x3521('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x3521('0x7')],'paused':this['paused'],'waiting':this[_0x3521('0xc')]};var _0x96a26e=md5(JSON[_0x3521('0x16')](_0x175f66));if(this[_0x3521('0x1')]!==_0x96a26e){this[_0x3521('0x1')]=_0x96a26e;io['to'](util['format']('mail:queue:%s',_0x175f66[_0x3521('0x7')]))['emit'](_0x3521('0x17'),_0x175f66);}};module[_0x3521('0x18')]=MailQueue;
\ No newline at end of file
index c25833e..1a49e76 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(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x1261,0x144));var _0x1126=function(_0x5f2ed0,_0xaf721b){_0x5f2ed0=_0x5f2ed0-0x0;var _0x4f2eed=_0x1261[_0x5f2ed0];return _0x4f2eed;};'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 _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x27e419,_0x42db83){var _0x342fc9=function(_0x438333){while(--_0x438333){_0x27e419['push'](_0x27e419['shift']());}};_0x342fc9(++_0x42db83);}(_0x814b,0x1a2));var _0xb814=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0x814b[_0x197065];return _0x3d9404;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627<this[_0xb814('0xc')][_0xb814('0x16')];_0x2ab627+=0x1){if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x17')]){this[_0xb814('0x14')]+=0x1;}if(this[_0xb814('0xc')][_0x2ab627][_0xb814('0x18')]){this[_0xb814('0x15')]+=0x1;}}this[_0xb814('0x19')]=this[_0xb814('0x14')]-this[_0xb814('0x15')];this['available']=this[_0xb814('0x19')]>=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue;
\ No newline at end of file
index 97cdfda..78e6c98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c7b=['smsPause','available','stringify','emit','exports','lodash','md5','util','ioredis','../../../config/environment','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map','prototype','loggedIn','paused','length','online'];(function(_0x4aea3f,_0x54bc17){var _0x2c12fa=function(_0x1da529){while(--_0x1da529){_0x4aea3f['push'](_0x4aea3f['shift']());}};_0x2c12fa(++_0x54bc17);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x4c47fe,_0x398b09){_0x4c47fe=_0x4c47fe-0x0;var _0x43bc22=_0x3c7b[_0x4c47fe];return _0x43bc22;};'use strict';var _=require(_0xb3c7('0x0'));var md5=require(_0xb3c7('0x1'));var util=require(_0xb3c7('0x2'));var Redis=require(_0xb3c7('0x3'));var config=require(_0xb3c7('0x4'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb3c7('0x5'))(new Redis(config[_0xb3c7('0x6')]));function SmsQueue(_0x4b3f30){this['id']=_0x4b3f30['id']||0x0;this[_0xb3c7('0x7')]=_0x4b3f30['name']||'';this[_0xb3c7('0x8')]=_0x4b3f30[_0xb3c7('0x8')]||0xa;this[_0xb3c7('0x9')]=_0x4b3f30[_0xb3c7('0x9')]||_0xb3c7('0xa');this['Agents']=_0x4b3f30[_0xb3c7('0xb')];this['mapAgentsId']={};this[_0xb3c7('0xc')]=0x0;this[_0xb3c7('0x1')]='';this[_0xb3c7('0xd')]();this[_0xb3c7('0xe')]();}SmsQueue['prototype'][_0xb3c7('0xd')]=function(){var _0x23f08c=this['mapAgentsId'][_0xb3c7('0xf')];this[_0xb3c7('0x10')]=_[_0xb3c7('0x11')](this[_0xb3c7('0xb')],'id');this[_0xb3c7('0x10')][_0xb3c7('0xf')]=_0x23f08c;};SmsQueue[_0xb3c7('0x12')]['updateRealtime']=function(){this[_0xb3c7('0x13')]=0x0;this[_0xb3c7('0x14')]=0x0;for(var _0x4d66c8=0x0;_0x4d66c8<this[_0xb3c7('0xb')][_0xb3c7('0x15')];_0x4d66c8+=0x1){if(this[_0xb3c7('0xb')][_0x4d66c8][_0xb3c7('0x16')]){this[_0xb3c7('0x13')]+=0x1;}if(this[_0xb3c7('0xb')][_0x4d66c8][_0xb3c7('0x17')]){this[_0xb3c7('0x14')]+=0x1;}}this[_0xb3c7('0x18')]=this[_0xb3c7('0x13')]-this[_0xb3c7('0x14')];this[_0xb3c7('0x18')]=this['available']>=0x0?this['available']:0x0;var _0x1cfafc={'id':this['id'],'available':this[_0xb3c7('0x18')],'loggedIn':this[_0xb3c7('0x13')],'name':this[_0xb3c7('0x7')],'paused':this[_0xb3c7('0x14')],'waiting':this['waiting']};var _0xdbbb66=md5(JSON[_0xb3c7('0x19')](_0x1cfafc));if(this[_0xb3c7('0x1')]!==_0xdbbb66){this[_0xb3c7('0x1')]=_0xdbbb66;io['to'](util['format']('sms:queue:%s',_0x1cfafc[_0xb3c7('0x7')]))[_0xb3c7('0x1a')]('sms_queue:save',_0x1cfafc);}};module[_0xb3c7('0x1b')]=SmsQueue;
\ No newline at end of file
+var _0x37dc=['paused','length','available','stringify','sms:queue:%s','sms_queue:save','lodash','md5','util','ioredis','redis','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn'];(function(_0x1e41ba,_0x455a21){var _0x201d61=function(_0x4c1ba2){while(--_0x4c1ba2){_0x1e41ba['push'](_0x1e41ba['shift']());}};_0x201d61(++_0x455a21);}(_0x37dc,0x1e9));var _0xc37d=function(_0x42d57b,_0x4e962d){_0x42d57b=_0x42d57b-0x0;var _0x43ec08=_0x37dc[_0x42d57b];return _0x43ec08;};'use strict';var _=require(_0xc37d('0x0'));var md5=require(_0xc37d('0x1'));var util=require(_0xc37d('0x2'));var Redis=require(_0xc37d('0x3'));var config=require('../../../config/environment');config[_0xc37d('0x4')]=_['defaults'](config[_0xc37d('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x4eabf9){this['id']=_0x4eabf9['id']||0x0;this[_0xc37d('0x5')]=_0x4eabf9[_0xc37d('0x5')]||'';this[_0xc37d('0x6')]=_0x4eabf9[_0xc37d('0x6')]||0xa;this[_0xc37d('0x7')]=_0x4eabf9[_0xc37d('0x7')]||_0xc37d('0x8');this[_0xc37d('0x9')]=_0x4eabf9[_0xc37d('0x9')];this['mapAgentsId']={};this[_0xc37d('0xa')]=0x0;this[_0xc37d('0x1')]='';this['updateRouting']();this[_0xc37d('0xb')]();}SmsQueue[_0xc37d('0xc')]['updateRouting']=function(){var _0x11f35f=this[_0xc37d('0xd')]['_rr'];this[_0xc37d('0xd')]=_[_0xc37d('0xe')](this[_0xc37d('0x9')],'id');this[_0xc37d('0xd')][_0xc37d('0xf')]=_0x11f35f;};SmsQueue[_0xc37d('0xc')][_0xc37d('0xb')]=function(){this[_0xc37d('0x10')]=0x0;this[_0xc37d('0x11')]=0x0;for(var _0x39aab8=0x0;_0x39aab8<this[_0xc37d('0x9')][_0xc37d('0x12')];_0x39aab8+=0x1){if(this['Agents'][_0x39aab8]['online']){this[_0xc37d('0x10')]+=0x1;}if(this['Agents'][_0x39aab8]['smsPause']){this[_0xc37d('0x11')]+=0x1;}}this[_0xc37d('0x13')]=this['loggedIn']-this[_0xc37d('0x11')];this['available']=this['available']>=0x0?this[_0xc37d('0x13')]:0x0;var _0x1816f4={'id':this['id'],'available':this[_0xc37d('0x13')],'loggedIn':this[_0xc37d('0x10')],'name':this[_0xc37d('0x5')],'paused':this[_0xc37d('0x11')],'waiting':this['waiting']};var _0x5dbbb1=md5(JSON[_0xc37d('0x14')](_0x1816f4));if(this[_0xc37d('0x1')]!==_0x5dbbb1){this[_0xc37d('0x1')]=_0x5dbbb1;io['to'](util['format'](_0xc37d('0x15'),_0x1816f4[_0xc37d('0x5')]))['emit'](_0xc37d('0x16'),_0x1816f4);}};module['exports']=SmsQueue;
\ No newline at end of file
index ce9f618..1d86294 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593b=['emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','beepall','waiting','updateRouting','prototype','map','Agents','mapAgentsId','_rr','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s'];(function(_0x421d50,_0x19c13e){var _0x320b7c=function(_0x48104f){while(--_0x48104f){_0x421d50['push'](_0x421d50['shift']());}};_0x320b7c(++_0x19c13e);}(_0x593b,0x189));var _0xb593=function(_0xdb9d37,_0xa818ce){_0xdb9d37=_0xdb9d37-0x0;var _0x9ed08d=_0x593b[_0xdb9d37];return _0x9ed08d;};'use strict';var _=require(_0xb593('0x0'));var md5=require(_0xb593('0x1'));var util=require('util');var Redis=require(_0xb593('0x2'));var config=require(_0xb593('0x3'));config[_0xb593('0x4')]=_[_0xb593('0x5')](config[_0xb593('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb593('0x6'))(new Redis(config[_0xb593('0x4')]));function WhatsappQueue(_0xdb0a44){this['id']=_0xdb0a44['id']||0x0;this[_0xb593('0x7')]=_0xdb0a44['name']||'';this[_0xb593('0x8')]=_0xdb0a44['timeout']||0xa;this['strategy']=_0xdb0a44['strategy']||_0xb593('0x9');this['Agents']=_0xdb0a44['Agents'];this['mapAgentsId']={};this[_0xb593('0xa')]=0x0;this[_0xb593('0x1')]='';this[_0xb593('0xb')]();this['updateRealtime']();}WhatsappQueue[_0xb593('0xc')][_0xb593('0xb')]=function(){var _0x3098eb=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xb593('0xd')](this[_0xb593('0xe')],'id');this[_0xb593('0xf')][_0xb593('0x10')]=_0x3098eb;};WhatsappQueue[_0xb593('0xc')][_0xb593('0x11')]=function(){this[_0xb593('0x12')]=0x0;this[_0xb593('0x13')]=0x0;for(var _0x46e501=0x0;_0x46e501<this[_0xb593('0xe')][_0xb593('0x14')];_0x46e501+=0x1){if(this[_0xb593('0xe')][_0x46e501][_0xb593('0x15')]){this[_0xb593('0x12')]+=0x1;}if(this[_0xb593('0xe')][_0x46e501][_0xb593('0x16')]){this[_0xb593('0x13')]+=0x1;}}this[_0xb593('0x17')]=this['loggedIn']-this[_0xb593('0x13')];this[_0xb593('0x17')]=this['available']>=0x0?this[_0xb593('0x17')]:0x0;var _0x51ca71={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb593('0x12')],'name':this['name'],'paused':this[_0xb593('0x13')],'waiting':this[_0xb593('0xa')]};var _0x220732=md5(JSON[_0xb593('0x18')](_0x51ca71));if(this[_0xb593('0x1')]!==_0x220732){this['md5']=_0x220732;io['to'](util[_0xb593('0x19')](_0xb593('0x1a'),_0x51ca71[_0xb593('0x7')]))[_0xb593('0x1b')](_0xb593('0x1c'),_0x51ca71);}};module[_0xb593('0x1d')]=WhatsappQueue;
\ No newline at end of file
+var _0xcb0b=['_rr','length','online','whatsappPause','paused','loggedIn','available','waiting','stringify','format','lodash','util','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','map'];(function(_0x527bfc,_0x3e064e){var _0x3fdac8=function(_0x476eb6){while(--_0x476eb6){_0x527bfc['push'](_0x527bfc['shift']());}};_0x3fdac8(++_0x3e064e);}(_0xcb0b,0x128));var _0xbcb0=function(_0x148235,_0x472870){_0x148235=_0x148235-0x0;var _0x255e6f=_0xcb0b[_0x148235];return _0x255e6f;};'use strict';var _=require(_0xbcb0('0x0'));var md5=require('md5');var util=require(_0xbcb0('0x1'));var Redis=require(_0xbcb0('0x2'));var config=require('../../../config/environment');config[_0xbcb0('0x3')]=_['defaults'](config['redis'],{'host':_0xbcb0('0x4'),'port':0x18eb});var io=require(_0xbcb0('0x5'))(new Redis(config[_0xbcb0('0x3')]));function WhatsappQueue(_0x5b1729){this['id']=_0x5b1729['id']||0x0;this['name']=_0x5b1729[_0xbcb0('0x6')]||'';this[_0xbcb0('0x7')]=_0x5b1729[_0xbcb0('0x7')]||0xa;this['strategy']=_0x5b1729[_0xbcb0('0x8')]||'beepall';this[_0xbcb0('0x9')]=_0x5b1729[_0xbcb0('0x9')];this[_0xbcb0('0xa')]={};this['waiting']=0x0;this[_0xbcb0('0xb')]='';this[_0xbcb0('0xc')]();this[_0xbcb0('0xd')]();}WhatsappQueue[_0xbcb0('0xe')][_0xbcb0('0xc')]=function(){var _0x5af806=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xbcb0('0xf')](this[_0xbcb0('0x9')],'id');this[_0xbcb0('0xa')][_0xbcb0('0x10')]=_0x5af806;};WhatsappQueue[_0xbcb0('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0xd4e218=0x0;_0xd4e218<this[_0xbcb0('0x9')][_0xbcb0('0x11')];_0xd4e218+=0x1){if(this[_0xbcb0('0x9')][_0xd4e218][_0xbcb0('0x12')]){this['loggedIn']+=0x1;}if(this['Agents'][_0xd4e218][_0xbcb0('0x13')]){this[_0xbcb0('0x14')]+=0x1;}}this['available']=this[_0xbcb0('0x15')]-this[_0xbcb0('0x14')];this[_0xbcb0('0x16')]=this[_0xbcb0('0x16')]>=0x0?this[_0xbcb0('0x16')]:0x0;var _0x2827bc={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbcb0('0x15')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xbcb0('0x17')]};var _0x126cfd=md5(JSON[_0xbcb0('0x18')](_0x2827bc));if(this[_0xbcb0('0xb')]!==_0x126cfd){this[_0xbcb0('0xb')]=_0x126cfd;io['to'](util[_0xbcb0('0x19')]('whatsapp:queue:%s',_0x2827bc[_0xbcb0('0x6')]))['emit']('whatsapp_queue:save',_0x2827bc);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index fd84f6c..8b3294e 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(_0x2ebbd8,_0x47b53a){var _0x561f8a=function(_0x30a5b4){while(--_0x30a5b4){_0x2ebbd8['push'](_0x2ebbd8['shift']());}};_0x561f8a(++_0x47b53a);}(_0xb10b,0x12a));var _0xbb10=function(_0x23f564,_0x48d2ba){_0x23f564=_0x23f564-0x0;var _0x47582b=_0xb10b[_0x23f564];return _0x47582b;};'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(_0xcf6276,_0x317f8f){var _0x137033=function(_0x2fbfe4){while(--_0x2fbfe4){_0xcf6276['push'](_0xcf6276['shift']());}};_0x137033(++_0x317f8f);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a5946,_0x426991){_0x1a5946=_0x1a5946-0x0;var _0x25e9d5=_0xb10b[_0x1a5946];return _0x25e9d5;};'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 9c94a41..2abedfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3b=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x145bcc,_0x20f191){var _0x16f195=function(_0x3361bd){while(--_0x3361bd){_0x145bcc['push'](_0x145bcc['shift']());}};_0x16f195(++_0x20f191);}(_0xeb3b,0x1d5));var _0xbeb3=function(_0x4f9d26,_0x641341){_0x4f9d26=_0x4f9d26-0x0;var _0x57debc=_0xeb3b[_0x4f9d26];return _0x57debc;};'use strict';var client=require(_0xbeb3('0x0'));exports[_0xbeb3('0x1')]=function(_0x2142b3,_0x20d252){return client[_0xbeb3('0x2')](_0xbeb3('0x3'),{'body':_0x20d252,'options':{'where':{'id':_0x2142b3}},'log':_0xbeb3('0x4')});};exports[_0xbeb3('0x5')]=function(_0x589ead,_0xa4699f){return client['Request'](_0xbeb3('0x6'),{'body':_0xa4699f,'options':{'where':{'id':_0x589ead}},'log':_0xbeb3('0x7')});};
\ No newline at end of file
+var _0xa929=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x4e46fd,_0x5993bb){var _0x4dc5cf=function(_0xb9c857){while(--_0xb9c857){_0x4e46fd['push'](_0x4e46fd['shift']());}};_0x4dc5cf(++_0x5993bb);}(_0xa929,0x147));var _0x9a92=function(_0xf97aa9,_0x1748b2){_0xf97aa9=_0xf97aa9-0x0;var _0x577e5b=_0xa929[_0xf97aa9];return _0x577e5b;};'use strict';var client=require(_0x9a92('0x0'));exports['update']=function(_0x4861f7,_0xcb0fd){return client[_0x9a92('0x1')](_0x9a92('0x2'),{'body':_0xcb0fd,'options':{'where':{'id':_0x4861f7}},'log':_0x9a92('0x3')});};exports[_0x9a92('0x4')]=function(_0x78e175,_0x380aef){return client[_0x9a92('0x1')](_0x9a92('0x5'),{'body':_0x380aef,'options':{'where':{'id':_0x78e175}},'log':_0x9a92('0x6')});};
\ No newline at end of file
index a7cb295..9f3e6ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab0=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x1e6034,_0x541421){var _0x3dffdf=function(_0x27fc4d){while(--_0x27fc4d){_0x1e6034['push'](_0x1e6034['shift']());}};_0x3dffdf(++_0x541421);}(_0x9ab0,0x127));var _0x09ab=function(_0xfc49f2,_0x555729){_0xfc49f2=_0xfc49f2-0x0;var _0x40d95b=_0x9ab0[_0xfc49f2];return _0x40d95b;};'use strict';var client=require('../client');exports[_0x09ab('0x0')]=function(_0x372a0b){return client[_0x09ab('0x1')](_0x09ab('0x2'),{'body':_0x372a0b,'log':_0x09ab('0x3')});};
\ No newline at end of file
+var _0x2076=['CreateChatMessage','createChatMessage','../client','create'];(function(_0x3f8dbe,_0x4f071f){var _0x78bca4=function(_0x4ad64b){while(--_0x4ad64b){_0x3f8dbe['push'](_0x3f8dbe['shift']());}};_0x78bca4(++_0x4f071f);}(_0x2076,0x7e));var _0x6207=function(_0x1a51ba,_0x5ba991){_0x1a51ba=_0x1a51ba-0x0;var _0x4fd280=_0x2076[_0x1a51ba];return _0x4fd280;};'use strict';var client=require(_0x6207('0x0'));exports[_0x6207('0x1')]=function(_0x53ba56){return client['Request'](_0x6207('0x2'),{'body':_0x53ba56,'log':_0x6207('0x3')});};
\ No newline at end of file
index e633d1d..8028173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2208=['timeout','strategy','User','Agents','name','online','getChatQueues','GetChatQueue'];(function(_0x5c401e,_0x462df1){var _0x59f112=function(_0x362b64){while(--_0x362b64){_0x5c401e['push'](_0x5c401e['shift']());}};_0x59f112(++_0x462df1);}(_0x2208,0x11e));var _0x8220=function(_0x203d5d,_0x1aecbd){_0x203d5d=_0x203d5d-0x0;var _0x55ab11=_0x2208[_0x203d5d];return _0x55ab11;};'use strict';var client=require('../client');exports[_0x8220('0x0')]=function(){return function(){return client['Request'](_0x8220('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x8220('0x2'),_0x8220('0x3')],'include':[{'model':_0x8220('0x4'),'as':_0x8220('0x5'),'attributes':['id',_0x8220('0x6'),_0x8220('0x7'),'chatPause']}]},'log':_0x8220('0x0')});};};
\ No newline at end of file
+var _0xb194=['Agents','chatPause','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x28a00e,_0x347a01){var _0x40a8b1=function(_0x56bc87){while(--_0x56bc87){_0x28a00e['push'](_0x28a00e['shift']());}};_0x40a8b1(++_0x347a01);}(_0xb194,0x1b2));var _0x4b19=function(_0x1be5a6,_0x50dff7){_0x1be5a6=_0x1be5a6-0x0;var _0x1c3173=_0xb194[_0x1be5a6];return _0x1c3173;};'use strict';var client=require(_0x4b19('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x4b19('0x1')](_0x4b19('0x2'),{'options':{'raw':![],'attributes':['id',_0x4b19('0x3'),_0x4b19('0x4'),_0x4b19('0x5')],'include':[{'model':'User','as':_0x4b19('0x6'),'attributes':['id',_0x4b19('0x3'),'online',_0x4b19('0x7')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
index 5132247..cdacef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032a=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x281850,_0x2e105c){var _0x291ed1=function(_0x2b370a){while(--_0x2b370a){_0x281850['push'](_0x281850['shift']());}};_0x291ed1(++_0x2e105c);}(_0x032a,0xf0));var _0xa032=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0x032a[_0x2fd160];return _0x5c2031;};'use strict';var client=require('../client');exports[_0xa032('0x0')]=function(_0x591b65){return client[_0xa032('0x1')](_0xa032('0x2'),{'body':_0x591b65,'log':_0xa032('0x2')});};exports[_0xa032('0x3')]=function(_0x185934,_0x23ad84){return client[_0xa032('0x1')](_0xa032('0x4'),{'body':_0x23ad84,'options':{'where':{'uniqueid':_0x185934},'order':[['id',_0xa032('0x5')]],'limit':0x1},'log':_0xa032('0x4')});};
\ No newline at end of file
+var _0x26bc=['../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xdf0cb4,_0x454607){var _0x18ea49=function(_0x22fd4b){while(--_0x22fd4b){_0xdf0cb4['push'](_0xdf0cb4['shift']());}};_0x18ea49(++_0x454607);}(_0x26bc,0x162));var _0xc26b=function(_0x2c94ed,_0x3aa89a){_0x2c94ed=_0x2c94ed-0x0;var _0x116104=_0x26bc[_0x2c94ed];return _0x116104;};'use strict';var client=require(_0xc26b('0x0'));exports[_0xc26b('0x1')]=function(_0x24bff6){return client[_0xc26b('0x2')](_0xc26b('0x3'),{'body':_0x24bff6,'log':'CreateChatQueueReport'});};exports[_0xc26b('0x4')]=function(_0x1bb460,_0x381ceb){return client['Request'](_0xc26b('0x5'),{'body':_0x381ceb,'options':{'where':{'uniqueid':_0x1bb460},'order':[['id','DESC']],'limit':0x1},'log':_0xc26b('0x5')});};
\ No newline at end of file
index 4fa805e..7129370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x7a54,0x106));var _0x47a5=function(_0x1bb443,_0x4cedc1){_0x1bb443=_0x1bb443-0x0;var _0x39ab1b=_0x7a54[_0x1bb443];return _0x39ab1b;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x7a54,0x106));var _0x47a5=function(_0x11389d,_0x125383){_0x11389d=_0x11389d-0x0;var _0x583f3e=_0x7a54[_0x11389d];return _0x583f3e;};'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
index dcf4444..e054b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9acc=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x2c5786,_0xcdc68a){var _0x313a7b=function(_0xd25506){while(--_0xd25506){_0x2c5786['push'](_0x2c5786['shift']());}};_0x313a7b(++_0xcdc68a);}(_0x9acc,0x10a));var _0xc9ac=function(_0x19bf9e,_0xab9510){_0x19bf9e=_0x19bf9e-0x0;var _0x513095=_0x9acc[_0x19bf9e];return _0x513095;};'use strict';var client=require(_0xc9ac('0x0'));exports[_0xc9ac('0x1')]=function(_0x156fbb){return client[_0xc9ac('0x2')](_0xc9ac('0x3'),{'body':_0x156fbb,'log':_0xc9ac('0x4')});};
\ No newline at end of file
+var _0xe2db=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x189b0,_0x2f0ec6){var _0x53f507=function(_0x5c81fb){while(--_0x5c81fb){_0x189b0['push'](_0x189b0['shift']());}};_0x53f507(++_0x2f0ec6);}(_0xe2db,0x15a));var _0xbe2d=function(_0x2ef37a,_0x27b3fd){_0x2ef37a=_0x2ef37a-0x0;var _0x273e95=_0xe2db[_0x2ef37a];return _0x273e95;};'use strict';var client=require(_0xbe2d('0x0'));exports[_0xbe2d('0x1')]=function(_0x1559a0){return client[_0xbe2d('0x2')](_0xbe2d('0x3'),{'body':_0x1559a0,'log':_0xbe2d('0x4')});};
\ No newline at end of file
index 43db1a3..0db2768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2840=['strategy','User','Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout'];(function(_0x4be735,_0x4998c9){var _0x3e44e9=function(_0x3182d5){while(--_0x3182d5){_0x4be735['push'](_0x4be735['shift']());}};_0x3e44e9(++_0x4998c9);}(_0x2840,0xec));var _0x0284=function(_0x2b49bc,_0x47b636){_0x2b49bc=_0x2b49bc-0x0;var _0x43cc65=_0x2840[_0x2b49bc];return _0x43cc65;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x0284('0x0')](_0x0284('0x1'),{'options':{'raw':![],'attributes':['id',_0x0284('0x2'),_0x0284('0x3'),_0x0284('0x4')],'include':[{'model':_0x0284('0x5'),'as':_0x0284('0x6'),'attributes':['id',_0x0284('0x2'),_0x0284('0x7'),_0x0284('0x8')]}]},'log':_0x0284('0x9')});};};
\ No newline at end of file
+var _0xc2c2=['Agents','name','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','User'];(function(_0x453bcc,_0x3bb539){var _0x5cd80d=function(_0x28875a){while(--_0x28875a){_0x453bcc['push'](_0x453bcc['shift']());}};_0x5cd80d(++_0x3bb539);}(_0xc2c2,0x1d0));var _0x2c2c=function(_0x4fb479,_0x148044){_0x4fb479=_0x4fb479-0x0;var _0x2685ee=_0xc2c2[_0x4fb479];return _0x2685ee;};'use strict';var client=require(_0x2c2c('0x0'));exports[_0x2c2c('0x1')]=function(){return function(){return client[_0x2c2c('0x2')](_0x2c2c('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2c2c('0x4'),'strategy'],'include':[{'model':_0x2c2c('0x5'),'as':_0x2c2c('0x6'),'attributes':['id',_0x2c2c('0x7'),_0x2c2c('0x8'),_0x2c2c('0x9')]}]},'log':_0x2c2c('0x1')});};};
\ No newline at end of file
index a8e1b72..eb4295a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0651=['../client','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x36a92d,_0x30e3ef){var _0x558a68=function(_0xdd3bb2){while(--_0xdd3bb2){_0x36a92d['push'](_0x36a92d['shift']());}};_0x558a68(++_0x30e3ef);}(_0x0651,0x149));var _0x1065=function(_0x1efea6,_0x18d7e9){_0x1efea6=_0x1efea6-0x0;var _0x13dcec=_0x0651[_0x1efea6];return _0x13dcec;};'use strict';var client=require(_0x1065('0x0'));exports[_0x1065('0x1')]=function(_0x48fb17){return client[_0x1065('0x2')](_0x1065('0x3'),{'body':_0x48fb17,'log':_0x1065('0x3')});};exports[_0x1065('0x4')]=function(_0x272e8f,_0x2f4430){return client[_0x1065('0x2')](_0x1065('0x5'),{'body':_0x2f4430,'options':{'where':{'uniqueid':_0x272e8f},'order':[['id',_0x1065('0x6')]],'limit':0x1},'log':_0x1065('0x5')});};
\ No newline at end of file
+var _0xff6b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x15ffd5,_0x1bf5de){var _0x170afa=function(_0x31916a){while(--_0x31916a){_0x15ffd5['push'](_0x15ffd5['shift']());}};_0x170afa(++_0x1bf5de);}(_0xff6b,0x11c));var _0xbff6=function(_0x33b0c3,_0xdd50a5){_0x33b0c3=_0x33b0c3-0x0;var _0x1489ef=_0xff6b[_0x33b0c3];return _0x1489ef;};'use strict';var client=require(_0xbff6('0x0'));exports[_0xbff6('0x1')]=function(_0x27c762){return client[_0xbff6('0x2')](_0xbff6('0x3'),{'body':_0x27c762,'log':_0xbff6('0x3')});};exports[_0xbff6('0x4')]=function(_0x3b3d06,_0x834baf){return client[_0xbff6('0x2')](_0xbff6('0x5'),{'body':_0x834baf,'options':{'where':{'uniqueid':_0x3b3d06},'order':[['id',_0xbff6('0x6')]],'limit':0x1},'log':_0xbff6('0x5')});};
\ No newline at end of file
index 641abff..505ccab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01af=['getIntervals','Request','name','Interval','interval','../client'];(function(_0x25c150,_0x1a9df8){var _0x7071ef=function(_0x9ee022){while(--_0x9ee022){_0x25c150['push'](_0x25c150['shift']());}};_0x7071ef(++_0x1a9df8);}(_0x01af,0x1a9));var _0xf01a=function(_0x47b54b,_0x54ff19){_0x47b54b=_0x47b54b-0x0;var _0x150c7f=_0x01af[_0x47b54b];return _0x150c7f;};'use strict';var client=require(_0xf01a('0x0'));exports[_0xf01a('0x1')]=function(){return function(){return client[_0xf01a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xf01a('0x3')],'include':[{'model':_0xf01a('0x4'),'as':'Intervals','attributes':['id',_0xf01a('0x3'),_0xf01a('0x5')]}]},'log':_0xf01a('0x1')});};};
\ No newline at end of file
+var _0x88b9=['Interval','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x483982,_0x3a4a39){var _0x5cfbb2=function(_0x39837d){while(--_0x39837d){_0x483982['push'](_0x483982['shift']());}};_0x5cfbb2(++_0x3a4a39);}(_0x88b9,0x175));var _0x988b=function(_0xefce2a,_0x22bc40){_0xefce2a=_0xefce2a-0x0;var _0x335bd1=_0x88b9[_0xefce2a];return _0x335bd1;};'use strict';var client=require(_0x988b('0x0'));exports[_0x988b('0x1')]=function(){return function(){return client[_0x988b('0x2')](_0x988b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x988b('0x4')],'include':[{'model':_0x988b('0x5'),'as':'Intervals','attributes':['id',_0x988b('0x4'),_0x988b('0x6')]}]},'log':_0x988b('0x1')});};};
\ No newline at end of file
index a9caef5..8851d50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff0=['addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x34a860,_0x5a8166){var _0x2a524a=function(_0x2fa78b){while(--_0x2fa78b){_0x34a860['push'](_0x34a860['shift']());}};_0x2a524a(++_0x5a8166);}(_0xfff0,0x139));var _0x0fff=function(_0x10013e,_0x3aee91){_0x10013e=_0x10013e-0x0;var _0x4a38fc=_0xfff0[_0x10013e];return _0x4a38fc;};'use strict';var client=require('../client');exports[_0x0fff('0x0')]=function(_0x2b95e0,_0x148db8){return client['Request'](_0x0fff('0x1'),{'body':_0x148db8,'options':{'where':{'id':_0x2b95e0}},'log':_0x0fff('0x2')});};exports[_0x0fff('0x3')]=function(_0x4bec60,_0x2cd3d5){return client[_0x0fff('0x4')]('AddTagsToMailInteraction',{'body':_0x2cd3d5,'options':{'where':{'id':_0x4bec60}},'log':_0x0fff('0x5')});};
\ No newline at end of file
+var _0xd7d1=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x36eb4a,_0x4f8337){_0x36eb4a=_0x36eb4a-0x0;var _0x4db3d5=_0xd7d1[_0x36eb4a];return _0x4db3d5;};'use strict';var client=require(_0x1d7d('0x0'));exports[_0x1d7d('0x1')]=function(_0xce4540,_0x447083){return client[_0x1d7d('0x2')](_0x1d7d('0x3'),{'body':_0x447083,'options':{'where':{'id':_0xce4540}},'log':_0x1d7d('0x4')});};exports[_0x1d7d('0x5')]=function(_0x1ac097,_0x1adb6b){return client[_0x1d7d('0x2')](_0x1d7d('0x6'),{'body':_0x1adb6b,'options':{'where':{'id':_0x1ac097}},'log':_0x1d7d('0x7')});};
\ No newline at end of file
index 7029a6a..a51832d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57fa=['createMailMessage','../client','CreateMailMessage'];(function(_0x4915db,_0xb3d70d){var _0x100f93=function(_0x22e9ff){while(--_0x22e9ff){_0x4915db['push'](_0x4915db['shift']());}};_0x100f93(++_0xb3d70d);}(_0x57fa,0x15d));var _0xa57f=function(_0x33470d,_0x18e69e){_0x33470d=_0x33470d-0x0;var _0x2d2583=_0x57fa[_0x33470d];return _0x2d2583;};'use strict';var client=require(_0xa57f('0x0'));exports['create']=function(_0x2a3aae){return client['Request'](_0xa57f('0x1'),{'body':_0x2a3aae,'log':_0xa57f('0x2')});};
\ No newline at end of file
+var _0xada4=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x8a1a9c,_0x57402a){var _0x2757c8=function(_0x242d8c){while(--_0x242d8c){_0x8a1a9c['push'](_0x8a1a9c['shift']());}};_0x2757c8(++_0x57402a);}(_0xada4,0x191));var _0x4ada=function(_0xa175df,_0x1500a4){_0xa175df=_0xa175df-0x0;var _0x4f8463=_0xada4[_0xa175df];return _0x4f8463;};'use strict';var client=require(_0x4ada('0x0'));exports[_0x4ada('0x1')]=function(_0x35a4d4){return client[_0x4ada('0x2')](_0x4ada('0x3'),{'body':_0x35a4d4,'log':_0x4ada('0x4')});};
\ No newline at end of file
index 5e8b15b..b9095e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e86=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name'];(function(_0x317f1d,_0x450d87){var _0x17663d=function(_0x19d503){while(--_0x19d503){_0x317f1d['push'](_0x317f1d['shift']());}};_0x17663d(++_0x450d87);}(_0x5e86,0xe2));var _0x65e8=function(_0x22efbc,_0x564044){_0x22efbc=_0x22efbc-0x0;var _0x5f1f97=_0x5e86[_0x22efbc];return _0x5f1f97;};'use strict';var client=require(_0x65e8('0x0'));exports[_0x65e8('0x1')]=function(){return function(){return client[_0x65e8('0x2')](_0x65e8('0x3'),{'options':{'raw':![],'attributes':['id',_0x65e8('0x4'),_0x65e8('0x5'),_0x65e8('0x6')],'include':[{'model':_0x65e8('0x7'),'as':_0x65e8('0x8'),'attributes':['id',_0x65e8('0x4'),_0x65e8('0x9'),_0x65e8('0xa')]}]},'log':_0x65e8('0x1')});};};
\ No newline at end of file
+var _0xb0d1=['online','../client','getMailQueues','Request','name','timeout','strategy','Agents'];(function(_0x3644de,_0x2916c9){var _0xc36d31=function(_0x4f2f7c){while(--_0x4f2f7c){_0x3644de['push'](_0x3644de['shift']());}};_0xc36d31(++_0x2916c9);}(_0xb0d1,0xa1));var _0x1b0d=function(_0x5e6c59,_0x306d45){_0x5e6c59=_0x5e6c59-0x0;var _0x2f2c58=_0xb0d1[_0x5e6c59];return _0x2f2c58;};'use strict';var client=require(_0x1b0d('0x0'));exports[_0x1b0d('0x1')]=function(){return function(){return client[_0x1b0d('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x1b0d('0x3'),_0x1b0d('0x4'),_0x1b0d('0x5')],'include':[{'model':'User','as':_0x1b0d('0x6'),'attributes':['id',_0x1b0d('0x3'),_0x1b0d('0x7'),'mailPause']}]},'log':'getMailQueues'});};};
\ No newline at end of file
index 8fe1a8f..069b76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7be=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x518f36,_0x5cf9c8){var _0x44425e=function(_0x2d83c6){while(--_0x2d83c6){_0x518f36['push'](_0x518f36['shift']());}};_0x44425e(++_0x5cf9c8);}(_0xd7be,0x68));var _0xed7b=function(_0x27a552,_0x59e120){_0x27a552=_0x27a552-0x0;var _0x430aa2=_0xd7be[_0x27a552];return _0x430aa2;};'use strict';var client=require(_0xed7b('0x0'));exports[_0xed7b('0x1')]=function(_0x24e218){return client[_0xed7b('0x2')](_0xed7b('0x3'),{'body':_0x24e218,'log':_0xed7b('0x3')});};exports['update']=function(_0x89e1a0,_0x1e9cba){return client[_0xed7b('0x2')](_0xed7b('0x4'),{'body':_0x1e9cba,'options':{'where':{'uniqueid':_0x89e1a0},'order':[['id',_0xed7b('0x5')]],'limit':0x1},'log':_0xed7b('0x4')});};
\ No newline at end of file
+var _0x085c=['update','DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x085c,0x65));var _0xc085=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x085c[_0x3d1244];return _0x5d6372;};'use strict';var client=require(_0xc085('0x0'));exports[_0xc085('0x1')]=function(_0x3c0799){return client[_0xc085('0x2')](_0xc085('0x3'),{'body':_0x3c0799,'log':_0xc085('0x3')});};exports[_0xc085('0x4')]=function(_0x15b274,_0x1e76ec){return client[_0xc085('0x2')]('UpdateMailQueueReport',{'body':_0x1e76ec,'options':{'where':{'uniqueid':_0x15b274},'order':[['id',_0xc085('0x5')]],'limit':0x1},'log':_0xc085('0x6')});};
\ No newline at end of file
index 41de824..7df53ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c80=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request','UpdateOpenchannelInteraction'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3c80,0x1bb));var _0x03c8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3c80[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports['update']=function(_0xc66925,_0x16809a){return client[_0x03c8('0x0')](_0x03c8('0x1'),{'body':_0x16809a,'options':{'where':{'id':_0xc66925}},'log':_0x03c8('0x2')});};exports['addTags']=function(_0x42dee4,_0x2c1923){return client[_0x03c8('0x0')](_0x03c8('0x3'),{'body':_0x2c1923,'options':{'where':{'id':_0x42dee4}},'log':_0x03c8('0x4')});};
\ No newline at end of file
+var _0xa94c=['addTagsToChatInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xa94c,0x1c5));var _0xca94=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa94c[_0x5f0089];return _0x193892;};'use strict';var client=require('../client');exports['update']=function(_0x2f6dc5,_0x766589){return client[_0xca94('0x0')](_0xca94('0x1'),{'body':_0x766589,'options':{'where':{'id':_0x2f6dc5}},'log':_0xca94('0x2')});};exports['addTags']=function(_0x4510e7,_0x673e66){return client[_0xca94('0x0')]('AddTagsToOpenchannelInteraction',{'body':_0x673e66,'options':{'where':{'id':_0x4510e7}},'log':_0xca94('0x3')});};
\ No newline at end of file
index c0fab63..089d815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b83=['CreateOpenchannelMessage','createOpenchannelMessage','../client','Request'];(function(_0x5a4666,_0x1d496a){var _0x54638c=function(_0x45f6a8){while(--_0x45f6a8){_0x5a4666['push'](_0x5a4666['shift']());}};_0x54638c(++_0x1d496a);}(_0x6b83,0x17a));var _0x36b8=function(_0x58bce9,_0x3c41e5){_0x58bce9=_0x58bce9-0x0;var _0x1b4eaf=_0x6b83[_0x58bce9];return _0x1b4eaf;};'use strict';var client=require(_0x36b8('0x0'));exports['create']=function(_0x392897){return client[_0x36b8('0x1')](_0x36b8('0x2'),{'body':_0x392897,'log':_0x36b8('0x3')});};
\ No newline at end of file
+var _0x2fb5=['createOpenchannelMessage','create','Request'];(function(_0x5c5c52,_0x36d085){var _0x4229ff=function(_0x3806df){while(--_0x3806df){_0x5c5c52['push'](_0x5c5c52['shift']());}};_0x4229ff(++_0x36d085);}(_0x2fb5,0x100));var _0x52fb=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x2fb5[_0x45e98e];return _0x374dba;};'use strict';var client=require('../client');exports[_0x52fb('0x0')]=function(_0x3dc7d2){return client[_0x52fb('0x1')]('CreateOpenchannelMessage',{'body':_0x3dc7d2,'log':_0x52fb('0x2')});};
\ No newline at end of file
index c36625e..d2b8c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20c6=['User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x75eeb5,_0x6a129c){var _0x3f098f=function(_0x2bf092){while(--_0x2bf092){_0x75eeb5['push'](_0x75eeb5['shift']());}};_0x3f098f(++_0x6a129c);}(_0x20c6,0xb8));var _0x620c=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x20c6[_0x3fe042];return _0x7d4a1f;};'use strict';var client=require(_0x620c('0x0'));exports[_0x620c('0x1')]=function(){return function(){return client[_0x620c('0x2')](_0x620c('0x3'),{'options':{'raw':![],'attributes':['id',_0x620c('0x4'),_0x620c('0x5'),'strategy'],'include':[{'model':_0x620c('0x6'),'as':_0x620c('0x7'),'attributes':['id','name',_0x620c('0x8'),_0x620c('0x9')]}]},'log':_0x620c('0x1')});};};
\ No newline at end of file
+var _0x0a6a=['timeout','strategy','Agents','online','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name'];(function(_0x425d5e,_0x3b9040){var _0x3cc67b=function(_0x121446){while(--_0x121446){_0x425d5e['push'](_0x425d5e['shift']());}};_0x3cc67b(++_0x3b9040);}(_0x0a6a,0xd4));var _0xa0a6=function(_0x30be39,_0xfb49ad){_0x30be39=_0x30be39-0x0;var _0x4d99d6=_0x0a6a[_0x30be39];return _0x4d99d6;};'use strict';var client=require(_0xa0a6('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xa0a6('0x1')](_0xa0a6('0x2'),{'options':{'raw':![],'attributes':['id',_0xa0a6('0x3'),_0xa0a6('0x4'),_0xa0a6('0x5')],'include':[{'model':'User','as':_0xa0a6('0x6'),'attributes':['id',_0xa0a6('0x3'),_0xa0a6('0x7'),'openchannelPause']}]},'log':_0xa0a6('0x8')});};};
\ No newline at end of file
index 4ca9cc6..7b5aaf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe018=['update','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x581270,_0x49b097){var _0x1c04f1=function(_0x1bae33){while(--_0x1bae33){_0x581270['push'](_0x581270['shift']());}};_0x1c04f1(++_0x49b097);}(_0xe018,0xc9));var _0x8e01=function(_0x297ef7,_0x441791){_0x297ef7=_0x297ef7-0x0;var _0x35c1ba=_0xe018[_0x297ef7];return _0x35c1ba;};'use strict';var client=require(_0x8e01('0x0'));exports[_0x8e01('0x1')]=function(_0x403904){return client['Request'](_0x8e01('0x2'),{'body':_0x403904,'log':'CreateOpenchannelQueueReport'});};exports[_0x8e01('0x3')]=function(_0x23eeb9,_0x57cd58){return client['Request'](_0x8e01('0x4'),{'body':_0x57cd58,'options':{'where':{'uniqueid':_0x23eeb9},'order':[['id',_0x8e01('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
+var _0x89d3=['create','Request','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x5cc529,_0x90defa){var _0x2aa587=function(_0x4a6326){while(--_0x4a6326){_0x5cc529['push'](_0x5cc529['shift']());}};_0x2aa587(++_0x90defa);}(_0x89d3,0x13f));var _0x389d=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x89d3[_0x34eb31];return _0x254994;};'use strict';var client=require(_0x389d('0x0'));exports[_0x389d('0x1')]=function(_0x42007e){return client[_0x389d('0x2')]('CreateOpenchannelQueueReport',{'body':_0x42007e,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x4d728d,_0x38683){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x38683,'options':{'where':{'uniqueid':_0x4d728d},'order':[['id',_0x389d('0x3')]],'limit':0x1},'log':_0x389d('0x4')});};
\ No newline at end of file
index fa02d66..25b0ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc76=['addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','addTags'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfc76,0xb5));var _0x6fc7=function(_0xf8963a,_0x18668b){_0xf8963a=_0xf8963a-0x0;var _0x5e6968=_0xfc76[_0xf8963a];return _0x5e6968;};'use strict';var client=require('../client');exports[_0x6fc7('0x0')]=function(_0x461a6d,_0x1d6ab9){return client[_0x6fc7('0x1')](_0x6fc7('0x2'),{'body':_0x1d6ab9,'options':{'where':{'id':_0x461a6d}},'log':'updateSmsInteraction'});};exports[_0x6fc7('0x3')]=function(_0x40d212,_0x51280c){return client[_0x6fc7('0x1')]('AddTagsToSmsInteraction',{'body':_0x51280c,'options':{'where':{'id':_0x40d212}},'log':_0x6fc7('0x4')});};
\ No newline at end of file
+var _0x4fde=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction','updateSmsInteraction','Request'];(function(_0x5047bc,_0x1ecb91){var _0x354f90=function(_0x5c1d08){while(--_0x5c1d08){_0x5047bc['push'](_0x5047bc['shift']());}};_0x354f90(++_0x1ecb91);}(_0x4fde,0x19f));var _0xe4fd=function(_0xbbfe59,_0x46067f){_0xbbfe59=_0xbbfe59-0x0;var _0x28a2a4=_0x4fde[_0xbbfe59];return _0x28a2a4;};'use strict';var client=require(_0xe4fd('0x0'));exports[_0xe4fd('0x1')]=function(_0x215473,_0x32f628){return client['Request'](_0xe4fd('0x2'),{'body':_0x32f628,'options':{'where':{'id':_0x215473}},'log':_0xe4fd('0x3')});};exports['addTags']=function(_0x36d49f,_0x3c4c49){return client[_0xe4fd('0x4')](_0xe4fd('0x5'),{'body':_0x3c4c49,'options':{'where':{'id':_0x36d49f}},'log':_0xe4fd('0x6')});};
\ No newline at end of file
index 27c12d0..0410fd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab2=['Request','CreateSmsMessage','createSmsMessage'];(function(_0x2c8eca,_0x3e4244){var _0x190447=function(_0x44c2ac){while(--_0x44c2ac){_0x2c8eca['push'](_0x2c8eca['shift']());}};_0x190447(++_0x3e4244);}(_0xeab2,0x111));var _0x2eab=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xeab2[_0x12d033];return _0x3b4e80;};'use strict';var client=require('../client');exports['create']=function(_0x32af42){return client[_0x2eab('0x0')](_0x2eab('0x1'),{'body':_0x32af42,'log':_0x2eab('0x2')});};
\ No newline at end of file
+var _0xe66d=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0x2b471f,_0x4da15e){var _0x5c0b37=function(_0x43fc53){while(--_0x43fc53){_0x2b471f['push'](_0x2b471f['shift']());}};_0x5c0b37(++_0x4da15e);}(_0xe66d,0x19b));var _0xde66=function(_0x4f51f2,_0x277484){_0x4f51f2=_0x4f51f2-0x0;var _0x1cfdf3=_0xe66d[_0x4f51f2];return _0x1cfdf3;};'use strict';var client=require('../client');exports[_0xde66('0x0')]=function(_0x3ea89c){return client[_0xde66('0x1')](_0xde66('0x2'),{'body':_0x3ea89c,'log':_0xde66('0x3')});};
\ No newline at end of file
index 8bd5578..d4e402c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};};
\ No newline at end of file
+var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x2ff762,_0x342c0b){var _0x158b02=function(_0x13c38e){while(--_0x13c38e){_0x2ff762['push'](_0x2ff762['shift']());}};_0x158b02(++_0x342c0b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};};
\ No newline at end of file
index eb3ea85..afc7f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2f82e7,_0x50f448){var _0x483927=function(_0x1f9d9c){while(--_0x1f9d9c){_0x2f82e7['push'](_0x2f82e7['shift']());}};_0x483927(++_0x50f448);}(_0x008c,0x188));var _0xc008=function(_0x500a1f,_0x14745f){_0x500a1f=_0x500a1f-0x0;var _0x2f5bd7=_0x008c[_0x500a1f];return _0x2f5bd7;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x55d919,_0x2a2874){var _0x3f6fc4=function(_0x4cccc9){while(--_0x4cccc9){_0x55d919['push'](_0x55d919['shift']());}};_0x3f6fc4(++_0x2a2874);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});};
\ No newline at end of file
index 9e0c981..88ac68f 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(_0x433fa6,_0x7f56f0){var _0x594b56=function(_0x4853b9){while(--_0x4853b9){_0x433fa6['push'](_0x433fa6['shift']());}};_0x594b56(++_0x7f56f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x515286,_0xd6b2b7){var _0x50f98b=function(_0x2f5573){while(--_0x2f5573){_0x515286['push'](_0x515286['shift']());}};_0x50f98b(++_0xd6b2b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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 660ea24..9c75873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b1=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','../client','update'];(function(_0xf68320,_0x51a807){var _0x4f224d=function(_0x1c151b){while(--_0x1c151b){_0xf68320['push'](_0xf68320['shift']());}};_0x4f224d(++_0x51a807);}(_0x90b1,0x1bb));var _0x190b=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0x90b1[_0x2714ec];return _0x2608e5;};'use strict';var client=require(_0x190b('0x0'));exports[_0x190b('0x1')]=function(_0x158591,_0x55cd11){return client['Request'](_0x190b('0x2'),{'body':_0x55cd11,'options':{'where':{'id':_0x158591}},'log':_0x190b('0x3')});};exports[_0x190b('0x4')]=function(_0x120ddc,_0x4fbcad){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x4fbcad,'options':{'where':{'id':_0x120ddc}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x3bd7=['addTagsToWhatsappInteraction','Request','updateWhatsappInteraction','addTags'];(function(_0x3fc1d8,_0x53f8de){var _0x52da6c=function(_0x1194ed){while(--_0x1194ed){_0x3fc1d8['push'](_0x3fc1d8['shift']());}};_0x52da6c(++_0x53f8de);}(_0x3bd7,0x199));var _0x73bd=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x3bd7[_0x3a2e49];return _0x257140;};'use strict';var client=require('../client');exports['update']=function(_0xa10c95,_0x1498e7){return client[_0x73bd('0x0')]('UpdateWhatsappInteraction',{'body':_0x1498e7,'options':{'where':{'id':_0xa10c95}},'log':_0x73bd('0x1')});};exports[_0x73bd('0x2')]=function(_0x1b4214,_0x56fbc2){return client[_0x73bd('0x0')]('AddTagsToWhatsappInteraction',{'body':_0x56fbc2,'options':{'where':{'id':_0x1b4214}},'log':_0x73bd('0x3')});};
\ No newline at end of file
index bd3e496..ed8e525 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7774=['../client','create','Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x5b7a4a,_0x54c362){var _0x5feaf9=function(_0x221637){while(--_0x221637){_0x5b7a4a['push'](_0x5b7a4a['shift']());}};_0x5feaf9(++_0x54c362);}(_0x7774,0x1c7));var _0x4777=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x7774[_0x2f4c1c];return _0x25e0f2;};'use strict';var client=require(_0x4777('0x0'));exports[_0x4777('0x1')]=function(_0x4cbe78){return client[_0x4777('0x2')](_0x4777('0x3'),{'body':_0x4cbe78,'log':_0x4777('0x4')});};
\ No newline at end of file
+var _0xbbd0=['createWhatsappMessage','../client','Request','CreateWhatsappMessage'];(function(_0x2d285a,_0x3404d6){var _0x438199=function(_0x113299){while(--_0x113299){_0x2d285a['push'](_0x2d285a['shift']());}};_0x438199(++_0x3404d6);}(_0xbbd0,0x1d1));var _0x0bbd=function(_0x437eb7,_0x1024d0){_0x437eb7=_0x437eb7-0x0;var _0x345a27=_0xbbd0[_0x437eb7];return _0x345a27;};'use strict';var client=require(_0x0bbd('0x0'));exports['create']=function(_0x3d1a01){return client[_0x0bbd('0x1')](_0x0bbd('0x2'),{'body':_0x3d1a01,'log':_0x0bbd('0x3')});};
\ No newline at end of file
index c00ef99..401d9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8e6=['online','whatsappPause','../client','getWhatsappQueues','GetWhatsappQueue','name','strategy','Agents'];(function(_0xb01ede,_0x5df89b){var _0x38b401=function(_0x3228f8){while(--_0x3228f8){_0xb01ede['push'](_0xb01ede['shift']());}};_0x38b401(++_0x5df89b);}(_0xe8e6,0x12a));var _0x6e8e=function(_0x486f0b,_0x19a9b7){_0x486f0b=_0x486f0b-0x0;var _0x12ccaf=_0xe8e6[_0x486f0b];return _0x12ccaf;};'use strict';var client=require(_0x6e8e('0x0'));exports[_0x6e8e('0x1')]=function(){return function(){return client['Request'](_0x6e8e('0x2'),{'options':{'raw':![],'attributes':['id',_0x6e8e('0x3'),'timeout',_0x6e8e('0x4')],'include':[{'model':'User','as':_0x6e8e('0x5'),'attributes':['id',_0x6e8e('0x3'),_0x6e8e('0x6'),_0x6e8e('0x7')]}]},'log':_0x6e8e('0x1')});};};
\ No newline at end of file
+var _0x5d50=['User','Agents','whatsappPause','getWhatsappQueues','../client','Request','GetWhatsappQueue','timeout'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0x5d50,0x104));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x05d5('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x05d5('0x1')](_0x05d5('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x05d5('0x3'),'strategy'],'include':[{'model':_0x05d5('0x4'),'as':_0x05d5('0x5'),'attributes':['id','name','online',_0x05d5('0x6')]}]},'log':_0x05d5('0x7')});};};
\ No newline at end of file
index 289db44..d8e0dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f1d=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0f1d,0x12b));var _0xd0f1=function(_0x285cf1,_0x47e330){_0x285cf1=_0x285cf1-0x0;var _0x2fea93=_0x0f1d[_0x285cf1];return _0x2fea93;};'use strict';var client=require('../client');exports[_0xd0f1('0x0')]=function(_0x58bb49){return client[_0xd0f1('0x1')](_0xd0f1('0x2'),{'body':_0x58bb49,'log':_0xd0f1('0x2')});};exports[_0xd0f1('0x3')]=function(_0x301f0f,_0x1d36f7){return client[_0xd0f1('0x1')](_0xd0f1('0x4'),{'body':_0x1d36f7,'options':{'where':{'uniqueid':_0x301f0f},'order':[['id',_0xd0f1('0x5')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0x455d=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0xc1b2b2,_0x255928){var _0x5a9b38=function(_0x559ed6){while(--_0x559ed6){_0xc1b2b2['push'](_0xc1b2b2['shift']());}};_0x5a9b38(++_0x255928);}(_0x455d,0xd3));var _0xd455=function(_0x34c4e0,_0x2a1b09){_0x34c4e0=_0x34c4e0-0x0;var _0x3bf789=_0x455d[_0x34c4e0];return _0x3bf789;};'use strict';var client=require(_0xd455('0x0'));exports[_0xd455('0x1')]=function(_0x446764){return client[_0xd455('0x2')](_0xd455('0x3'),{'body':_0x446764,'log':_0xd455('0x3')});};exports[_0xd455('0x4')]=function(_0x5d002d,_0x243595){return client[_0xd455('0x2')](_0xd455('0x5'),{'body':_0x243595,'options':{'where':{'uniqueid':_0x5d002d},'order':[['id',_0xd455('0x6')]],'limit':0x1},'log':_0xd455('0x5')});};
\ No newline at end of file
index 62b5402..3148f80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc40=['info','format','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc40,0x1d4));var _0x0fc4=function(_0x2f3de3,_0x3e0635){_0x2f3de3=_0x2f3de3-0x0;var _0x22e00b=_0xfc40[_0x2f3de3];return _0x22e00b;};'use strict';var schema=require(_0x0fc4('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0x0fc4('0x1'));var logger=require(_0x0fc4('0x2'))(_0x0fc4('0x3'));var strategy=require(_0x0fc4('0x4'));var queue=schema({'name':{'type':_0x0fc4('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0fc4('0x6'),'message':_0x0fc4('0x7')}});function writeLog(_0x2db59f,_0x30029e,_0x242a43){return logger[_0x0fc4('0x8')](util[_0x0fc4('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x2db59f,_0x30029e['name'],_0x242a43));}function handleFindAgent(_0x3c5533){return function(_0x122f3d){return _0x122f3d[_0x0fc4('0xa')][_0x0fc4('0xb')]()===_0x3c5533[_0x0fc4('0xb')]();};}exports[_0x0fc4('0xc')]=function(_0x447ad6,_0x1f5175,_0x2f0b76,_0x39bafb){return function(_0x44bfa8){try{var _0x58751d={'name':_0x1f5175[0x0],'timeout':_0x1f5175[0x1]};var _0x25770f=queue[_0x0fc4('0x0')](_0x58751d,{'typecast':!![]});if(_0x25770f[_0x0fc4('0xd')]){logger[_0x0fc4('0xe')](_0x0fc4('0xf'),_0x447ad6,_[_0x0fc4('0x10')](_0x25770f,'message')[_0x0fc4('0x11')](',\x20'));_0x44bfa8[_0x0fc4('0x12')]();}else{var _0x2582ca=_['find'](_0x2f0b76['agents'],handleFindAgent(_0x58751d[_0x0fc4('0xa')]));if(_0x2582ca){var _0x502ec0=(_0x58751d['timeout']||0xa)*0x3e8;var _0x226197,_0x2ee33c;var _0x359bcd=seqqueue[_0x0fc4('0x13')](_0x502ec0);_0x359bcd['id']=_0x447ad6;_0x359bcd[_0x0fc4('0x14')]=_0x502ec0;_0x359bcd[_0x0fc4('0x15')]=_0x39bafb['channel'];writeLog(_0x447ad6,_0x2582ca,util[_0x0fc4('0x9')]('START:%s',_0x502ec0));_0x2f0b76['rules'][_0x447ad6]['on'](_0x0fc4('0x16'),function(){logger[_0x0fc4('0x8')](_0x0fc4('0x17'),_0x447ad6);clearTimeout(_0x2ee33c);_0x2ee33c=undefined;_0x359bcd[_0x0fc4('0x18')]();if(_0x2f0b76[_0x0fc4('0x19')][_0x447ad6]){delete _0x2f0b76[_0x0fc4('0x19')][_0x447ad6];}_0x44bfa8[_0x0fc4('0x12')]();});_0x2f0b76['rules'][_0x447ad6]['on'](_0x0fc4('0x1a'),function(){if(_0x2f0b76[_0x0fc4('0x19')][_0x447ad6]){delete _0x2f0b76[_0x0fc4('0x19')][_0x447ad6];}});_0x2ee33c=setTimeout(function(){logger[_0x0fc4('0x8')](_0x0fc4('0x1b'),_0x447ad6);clearTimeout(_0x2ee33c);_0x359bcd[_0x0fc4('0x18')]();_0x44bfa8[_0x0fc4('0x1c')]();},_0x502ec0);strategy[_0x0fc4('0x1d')](_0x359bcd,_0x2582ca,_0x2f0b76,_0x39bafb);}else{logger[_0x0fc4('0xe')](_0x0fc4('0x1e'),_0x447ad6,_0x58751d[_0x0fc4('0xa')]);_0x44bfa8[_0x0fc4('0x12')]();}}}catch(_0x286d2d){console[_0x0fc4('0x1f')](_0x286d2d);logger['error'](_0x0fc4('0x20'),_0x447ad6,_0x286d2d[_0x0fc4('0x21')]);_0x44bfa8[_0x0fc4('0x12')]();}};};
\ No newline at end of file
+var _0x9fc8=['info','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','validate','lodash','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','find','agents','timeout','createQueue','channel','format','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete'];(function(_0x17002e,_0x2bb048){var _0x3f75f8=function(_0x38746a){while(--_0x38746a){_0x17002e['push'](_0x17002e['shift']());}};_0x3f75f8(++_0x2bb048);}(_0x9fc8,0x1e5));var _0x89fc=function(_0x52b119,_0x21c5e8){_0x52b119=_0x52b119-0x0;var _0x271545=_0x9fc8[_0x52b119];return _0x271545;};'use strict';var schema=require(_0x89fc('0x0'));var _=require(_0x89fc('0x1'));var util=require('util');var seqqueue=require(_0x89fc('0x2'));var logger=require(_0x89fc('0x3'))('routing');var strategy=require(_0x89fc('0x4'));var queue=schema({'name':{'type':_0x89fc('0x5'),'required':!![],'message':_0x89fc('0x6')},'timeout':{'type':_0x89fc('0x7'),'message':_0x89fc('0x8')}});function writeLog(_0x2ec147,_0x38b431,_0x4b59ec){return logger['info'](util['format'](_0x89fc('0x9'),_0x2ec147,_0x38b431[_0x89fc('0xa')],_0x4b59ec));}function handleFindAgent(_0x715d5){return function(_0x35477f){return _0x35477f[_0x89fc('0xa')][_0x89fc('0xb')]()===_0x715d5[_0x89fc('0xb')]();};}exports[_0x89fc('0xc')]=function(_0x414cfc,_0x39d4a0,_0x3d7bea,_0x4a8dd2){return function(_0x1780e1){try{var _0x33dcfe={'name':_0x39d4a0[0x0],'timeout':_0x39d4a0[0x1]};var _0x2c3e25=queue[_0x89fc('0x0')](_0x33dcfe,{'typecast':!![]});if(_0x2c3e25[_0x89fc('0xd')]){logger[_0x89fc('0xe')](_0x89fc('0xf'),_0x414cfc,_[_0x89fc('0x10')](_0x2c3e25,'message')[_0x89fc('0x11')](',\x20'));_0x1780e1['stop']();}else{var _0x36415a=_[_0x89fc('0x12')](_0x3d7bea[_0x89fc('0x13')],handleFindAgent(_0x33dcfe[_0x89fc('0xa')]));if(_0x36415a){var _0xcfb005=(_0x33dcfe[_0x89fc('0x14')]||0xa)*0x3e8;var _0x5138f7,_0x25e2d0;var _0x28851d=seqqueue[_0x89fc('0x15')](_0xcfb005);_0x28851d['id']=_0x414cfc;_0x28851d['atimeout']=_0xcfb005;_0x28851d['channel']=_0x4a8dd2[_0x89fc('0x16')];writeLog(_0x414cfc,_0x36415a,util[_0x89fc('0x17')]('START:%s',_0xcfb005));_0x3d7bea[_0x89fc('0x18')][_0x414cfc]['on']('end',function(){logger['info'](_0x89fc('0x19'),_0x414cfc);clearTimeout(_0x25e2d0);_0x25e2d0=undefined;_0x28851d['close']();if(_0x3d7bea[_0x89fc('0x18')][_0x414cfc]){delete _0x3d7bea[_0x89fc('0x18')][_0x414cfc];}_0x1780e1['stop']();});_0x3d7bea['rules'][_0x414cfc]['on'](_0x89fc('0x1a'),function(){if(_0x3d7bea['rules'][_0x414cfc]){delete _0x3d7bea['rules'][_0x414cfc];}});_0x25e2d0=setTimeout(function(){logger[_0x89fc('0x1b')](_0x89fc('0x1c'),_0x414cfc);clearTimeout(_0x25e2d0);_0x28851d['close']();_0x1780e1[_0x89fc('0x1d')]();},_0xcfb005);strategy[_0x89fc('0x1e')](_0x28851d,_0x36415a,_0x3d7bea,_0x4a8dd2);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x414cfc,_0x33dcfe[_0x89fc('0xa')]);_0x1780e1['stop']();}}}catch(_0x595ba3){console[_0x89fc('0x1f')](_0x595ba3);logger[_0x89fc('0xe')]('[%s][QUEUE]\x20%s',_0x414cfc,_0x595ba3['stack']);_0x1780e1['stop']();}};};
\ No newline at end of file
index 404b659..23a4782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea32=['catch','error','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','stringify','create','dialogState','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then'];(function(_0xbc8c65,_0x5672fc){var _0x77eb71=function(_0x59eaf1){while(--_0x59eaf1){_0xbc8c65['push'](_0xbc8c65['shift']());}};_0x77eb71(++_0x5672fc);}(_0xea32,0x1a5));var _0x2ea3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea32[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x2ea3('0x0'))('routing');var rpc={'chatMessage':require(_0x2ea3('0x1')),'openchannelMessage':require(_0x2ea3('0x2')),'mailMessage':require(_0x2ea3('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2ea3('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x2ea3('0x5')]=function(_0x3ea6da,_0x5d0f4c){return function(_0x3785f3){try{if(!_[_0x2ea3('0x6')](this[_0x2ea3('0x7')]['UserId'])){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x2ea3('0xa'));return _0x3785f3[_0x2ea3('0xb')]();}var _0x201c61={'ContactId':this['contact']['id'],'sentAt':moment()[_0x2ea3('0xc')](_0x2ea3('0xd')),'direction':'out'};if(this[_0x2ea3('0xe')]===_0x2ea3('0xf')||this['channel']===_0x2ea3('0x10')){_0x201c61['phone']=this['interaction'][_0x2ea3('0x11')];}var _0xd5d969=this[_0x2ea3('0xe')];if(_0xd5d969===_0x2ea3('0x12')){_0x201c61[_0x2ea3('0x13')]=this[_0x2ea3('0x14')]['id'];}else{_0x201c61[_['upperFirst'](_0xd5d969)+_0x2ea3('0x15')]=this[_0x2ea3('0x14')]['id'];}_0x201c61[_['upperFirst'](_0xd5d969)+_0x2ea3('0x16')]=this[_0x2ea3('0x7')]['id'];if(this[_0x2ea3('0x7')][_0x2ea3('0x17')]){var _0x1e0b45=_0x5d0f4c[0x4];if(!_[_0x2ea3('0x18')](_0x1e0b45)){_0x201c61[_0x2ea3('0x19')]=utils[_0x2ea3('0x1a')](_0x1e0b45,this);return rpc[_0xd5d969+_0x2ea3('0x1b')]['create'](_0x201c61)[_0x2ea3('0x1c')](function(_0x1c083f){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x201c61['body']);})[_0x2ea3('0x1d')](function(_0x563721){logger[_0x2ea3('0x1e')](_0x2ea3('0x9'),_0x3ea6da,JSON['stringify'](_0x563721));})['finally'](function(){logger[_0x2ea3('0x8')](_0x2ea3('0x1f'),_0x3ea6da);_0x3785f3[_0x2ea3('0x20')]();});}else{logger[_0x2ea3('0x8')](_0x2ea3('0x21'),_0x3ea6da);_0x3785f3[_0x2ea3('0x20')]();}}else{var _0x2cd5b3=this;var _0x24dde6=new AWS[(_0x2ea3('0x22'))]({'accessKeyId':_0x5d0f4c[0x0],'secretAccessKey':_0x5d0f4c[0x1],'region':_0x5d0f4c[0x2]});var _0x5975d9={'botAlias':_0x2ea3('0x23'),'botName':_0x5d0f4c[0x3],'inputText':this[_0x2ea3('0x24')]['body'],'userId':this[_0x2ea3('0xe')]+':'+this[_0x2ea3('0x7')]['id'][_0x2ea3('0x25')]()};_0x24dde6[_0x2ea3('0x26')](_0x5975d9,function(_0x1472ed,_0x773857){if(_0x1472ed){logger['error'](_0x2ea3('0x9'),_0x3ea6da,_0x1472ed[_0x2ea3('0x24')]);_0x3785f3[_0x2ea3('0xb')]();}else if(_0x773857&&_0x773857[_0x2ea3('0x24')]){_0x2cd5b3[_0x2ea3('0x19')][_0x2ea3('0x27')]=_0x773857;_0x201c61[_0x2ea3('0x19')]=_0x773857[_0x2ea3('0x24')];_0x201c61[_0x2ea3('0x28')]='amazonlex';_0x201c61[_0x2ea3('0x29')]=JSON[_0x2ea3('0x2a')](_0x773857);return rpc[_0xd5d969+_0x2ea3('0x1b')][_0x2ea3('0x2b')](_0x201c61)[_0x2ea3('0x1c')](function(_0x215a59){logger[_0x2ea3('0x8')](_0x2ea3('0x9'),_0x3ea6da,_0x201c61['body']);if(_0x773857[_0x2ea3('0x2c')]=='Failed'){_0x3785f3[_0x2ea3('0xb')]();}else{_0x3785f3[_0x2ea3('0x20')]();}})[_0x2ea3('0x1d')](function(_0x4d9964){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3ea6da,JSON['stringify'](_0x4d9964));_0x3785f3['next']();});}else{_0x3785f3[_0x2ea3('0xb')]();}});}}catch(_0x358aca){logger[_0x2ea3('0x1e')](_0x2ea3('0x9'),_0x3ea6da,JSON[_0x2ea3('0x2a')](_0x358aca));_0x3785f3[_0x2ea3('0x20')]();}};};
\ No newline at end of file
+var _0x9ae6=['next','amazonlex','providerResponse','Message','create','dialogState','Failed','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','phone','channel','ChatWebsiteId','account','upperFirst','InteractionId','interaction','created','isEmpty','then','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','body','toString','postText'];(function(_0x2cbfb4,_0x1780c0){var _0x21ecd0=function(_0x4cb362){while(--_0x4cb362){_0x2cbfb4['push'](_0x2cbfb4['shift']());}};_0x21ecd0(++_0x1780c0);}(_0x9ae6,0x177));var _0x69ae=function(_0x1afadf,_0x357131){_0x1afadf=_0x1afadf-0x0;var _0x3a3b4a=_0x9ae6[_0x1afadf];return _0x3a3b4a;};'use strict';var _=require(_0x69ae('0x0'));var moment=require(_0x69ae('0x1'));var AWS=require(_0x69ae('0x2'));var utils=require('./utils');var logger=require(_0x69ae('0x3'))(_0x69ae('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x69ae('0x5')),'smsMessage':require(_0x69ae('0x6')),'faxMessage':require(_0x69ae('0x7')),'whatsappMessage':require(_0x69ae('0x8'))};exports['consequence']=function(_0xdcd729,_0x47c79e){return function(_0x404bb3){try{if(!_[_0x69ae('0x9')](this['interaction'][_0x69ae('0xa')])){logger[_0x69ae('0xb')](_0x69ae('0xc'),_0xdcd729,_0x69ae('0xd'));return _0x404bb3['next']();}var _0x1f0f01={'ContactId':this[_0x69ae('0xe')]['id'],'sentAt':moment()[_0x69ae('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x69ae('0x10')};if(this['channel']==='sms'||this['channel']==='whatsapp'){_0x1f0f01[_0x69ae('0x11')]=this['interaction'][_0x69ae('0x11')];}var _0x576b61=this[_0x69ae('0x12')];if(_0x576b61==='chat'){_0x1f0f01[_0x69ae('0x13')]=this[_0x69ae('0x14')]['id'];}else{_0x1f0f01[_[_0x69ae('0x15')](_0x576b61)+'AccountId']=this[_0x69ae('0x14')]['id'];}_0x1f0f01[_['upperFirst'](_0x576b61)+_0x69ae('0x16')]=this[_0x69ae('0x17')]['id'];if(this[_0x69ae('0x17')][_0x69ae('0x18')]){var _0x2d8d84=_0x47c79e[0x4];if(!_[_0x69ae('0x19')](_0x2d8d84)){_0x1f0f01['body']=utils['getMustacheRender'](_0x2d8d84,this);return rpc[_0x576b61+'Message']['create'](_0x1f0f01)[_0x69ae('0x1a')](function(_0x5e7131){logger['info']('[%s][AMAZONLEX]\x20%s',_0xdcd729,_0x1f0f01['body']);})[_0x69ae('0x1b')](function(_0x310d54){logger[_0x69ae('0x1c')]('[%s][AMAZONLEX]\x20%s',_0xdcd729,JSON[_0x69ae('0x1d')](_0x310d54));})[_0x69ae('0x1e')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0xdcd729);_0x404bb3[_0x69ae('0x1f')]();});}else{logger[_0x69ae('0xb')](_0x69ae('0x20'),_0xdcd729);_0x404bb3[_0x69ae('0x1f')]();}}else{var _0x2cb33b=this;var _0x45b9d0=new AWS[(_0x69ae('0x21'))]({'accessKeyId':_0x47c79e[0x0],'secretAccessKey':_0x47c79e[0x1],'region':_0x47c79e[0x2]});var _0x40febd={'botAlias':_0x69ae('0x22'),'botName':_0x47c79e[0x3],'inputText':this[_0x69ae('0x23')][_0x69ae('0x24')],'userId':this['channel']+':'+this['interaction']['id'][_0x69ae('0x25')]()};_0x45b9d0[_0x69ae('0x26')](_0x40febd,function(_0x4187c1,_0x25b491){if(_0x4187c1){logger[_0x69ae('0x1c')](_0x69ae('0xc'),_0xdcd729,_0x4187c1[_0x69ae('0x23')]);_0x404bb3[_0x69ae('0x27')]();}else if(_0x25b491&&_0x25b491[_0x69ae('0x23')]){_0x2cb33b['body'][_0x69ae('0x28')]=_0x25b491;_0x1f0f01[_0x69ae('0x24')]=_0x25b491[_0x69ae('0x23')];_0x1f0f01['providerName']=_0x69ae('0x28');_0x1f0f01[_0x69ae('0x29')]=JSON[_0x69ae('0x1d')](_0x25b491);return rpc[_0x576b61+_0x69ae('0x2a')][_0x69ae('0x2b')](_0x1f0f01)[_0x69ae('0x1a')](function(_0x297195){logger[_0x69ae('0xb')](_0x69ae('0xc'),_0xdcd729,_0x1f0f01[_0x69ae('0x24')]);if(_0x25b491[_0x69ae('0x2c')]==_0x69ae('0x2d')){_0x404bb3[_0x69ae('0x27')]();}else{_0x404bb3['stop']();}})[_0x69ae('0x1b')](function(_0xfb05f9){logger[_0x69ae('0x1c')]('[%s][AMAZONLEX]\x20%s',_0xdcd729,JSON[_0x69ae('0x1d')](_0xfb05f9));_0x404bb3[_0x69ae('0x27')]();});}else{_0x404bb3[_0x69ae('0x27')]();}});}}catch(_0xc7592c){logger['error'](_0x69ae('0xc'),_0xdcd729,JSON['stringify'](_0xc7592c));_0x404bb3[_0x69ae('0x1f')]();}};};
\ No newline at end of file
index 4a30563..c8df508 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa0d=['format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','body','message','from','phone','subject','startsWith','Re:\x20','ChatWebsiteId','upperFirst','AccountId','InteractionId','account','Smtp','service','host','secure','auth','user','pass','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','finally','resolve','autoreplyExecuted','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','mail','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0x28231d,_0x33a44f){var _0x5043ce=function(_0xb68e88){while(--_0xb68e88){_0x28231d['push'](_0x28231d['shift']());}};_0x5043ce(++_0x33a44f);}(_0xfa0d,0x158));var _0xdfa0=function(_0x3bc957,_0x4655d1){_0x3bc957=_0x3bc957-0x0;var _0x19d172=_0xfa0d[_0x3bc957];return _0x19d172;};'use strict';var _=require(_0xdfa0('0x0'));var moment=require(_0xdfa0('0x1'));var utils=require(_0xdfa0('0x2'));var logger=require('../../../../config/logger')(_0xdfa0('0x3'));var rpc={'chatMessage':require(_0xdfa0('0x4')),'openchannelMessage':require(_0xdfa0('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xdfa0('0x6')),'faxMessage':require(_0xdfa0('0x7')),'whatsappMessage':require(_0xdfa0('0x8')),'chatInteraction':require(_0xdfa0('0x9')),'openchannelInteraction':require(_0xdfa0('0xa')),'mailInteraction':require(_0xdfa0('0xb')),'smsInteraction':require(_0xdfa0('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xdfa0('0xd'));exports[_0xdfa0('0xe')]=function(_0x5e2de4,_0x503160,_0x4dddf9,_0x24627d){return function(_0x256fdc){try{var _0x11b6bf=this['channel'];if(_0x11b6bf===_0xdfa0('0xf')&&_0x24627d['body']['isAutoreply']){logger['info'](_0xdfa0('0x10'),_0x5e2de4,_0xdfa0('0x11'));return _0x256fdc[_0xdfa0('0x12')]();}if(_0x503160[0x0]==='1'&&(_[_0xdfa0('0x13')](this[_0xdfa0('0x14')]['created'])||!this[_0xdfa0('0x14')][_0xdfa0('0x15')])){logger[_0xdfa0('0x16')](_0xdfa0('0x10'),_0x5e2de4,'Autoreply\x20already\x20sent');return _0x256fdc[_0xdfa0('0x12')]();}if(_0x503160[0x0]==='2'&&this[_0xdfa0('0x14')]['autoreplyExecuted']){logger['info'](_0xdfa0('0x17'),_0x5e2de4,_0xdfa0('0x18'));return _0x256fdc[_0xdfa0('0x12')]();}var _0x4ed188={'ContactId':this[_0xdfa0('0x19')]['id'],'sentAt':moment()[_0xdfa0('0x1a')](_0xdfa0('0x1b')),'direction':'out'};if(this[_0xdfa0('0x1c')]===_0xdfa0('0xf')){_0x4ed188['body']=utils[_0xdfa0('0x1d')](_0x503160[0x2],this);}else{_0x4ed188[_0xdfa0('0x1e')]=utils[_0xdfa0('0x1d')](_0x503160[0x1],this);}if(this[_0xdfa0('0x1f')]){_0x4ed188['to']=this[_0xdfa0('0x1f')][_0xdfa0('0x20')]||'';if(this[_0xdfa0('0x1c')]==='mail'&&_0x503160[0x1]==='1'){_0x4ed188['cc']=this[_0xdfa0('0x1f')]['cc']||'';}_0x4ed188[_0xdfa0('0x20')]=this[_0xdfa0('0x1f')]['to']||'';_0x4ed188[_0xdfa0('0x21')]=this[_0xdfa0('0x1f')][_0xdfa0('0x21')]||'';_0x4ed188['read']=!![];if(this[_0xdfa0('0x1f')]['subject']){_0x4ed188[_0xdfa0('0x22')]='';_0x4ed188['subject']+=_[_0xdfa0('0x23')](this[_0xdfa0('0x1f')][_0xdfa0('0x22')],'Re:')?'':_0xdfa0('0x24');_0x4ed188[_0xdfa0('0x22')]+=this[_0xdfa0('0x1f')][_0xdfa0('0x22')];}}if(this[_0xdfa0('0x1c')]==='chat'){_0x4ed188[_0xdfa0('0x25')]=this['account']['id'];}else{_0x4ed188[_[_0xdfa0('0x26')](this[_0xdfa0('0x1c')])+_0xdfa0('0x27')]=this['account']['id'];}_0x4ed188[_['upperFirst'](this[_0xdfa0('0x1c')])+_0xdfa0('0x28')]=this['interaction']['id'];var _0x41855f=this['interaction'];if(rpc[this[_0xdfa0('0x1c')]+'Message']){if(this[_0xdfa0('0x1c')]===_0xdfa0('0xf')){var _0x5e5154={'tls':{'rejectUnauthorized':![]}};if(this[_0xdfa0('0x29')][_0xdfa0('0x2a')]['service']){_0x5e5154[_0xdfa0('0x2b')]=this[_0xdfa0('0x29')]['Smtp']['service'];}else{_0x5e5154[_0xdfa0('0x2c')]=this[_0xdfa0('0x29')]['Smtp'][_0xdfa0('0x2c')];_0x5e5154['port']=this[_0xdfa0('0x29')][_0xdfa0('0x2a')]['port'];_0x5e5154[_0xdfa0('0x2d')]=this['account'][_0xdfa0('0x2a')]['secure'];}if(this[_0xdfa0('0x29')]['Smtp']['authentication']){_0x5e5154[_0xdfa0('0x2e')]={'user':this[_0xdfa0('0x29')][_0xdfa0('0x2a')][_0xdfa0('0x2f')],'pass':this[_0xdfa0('0x29')][_0xdfa0('0x2a')][_0xdfa0('0x30')]};}_0x4ed188[_0xdfa0('0x31')]=this[_0xdfa0('0x1f')][_0xdfa0('0x32')];_0x4ed188[_0xdfa0('0x33')]=_0xdfa0('0x34')+_['replace'](_0x4ed188['body'],_0xdfa0('0x35'),'<div')+_0xdfa0('0x36');_0x4ed188[_0xdfa0('0x37')]={'Auto-Submitted':_0xdfa0('0x38'),'X-Auto-Response-Suppress':_0xdfa0('0x39'),'Precedence':_0xdfa0('0x3a')};return mailRpc[_0xdfa0('0x3b')](_0x5e5154,_0x4ed188)[_0xdfa0('0x3c')](function(_0x5a151d){logger[_0xdfa0('0x16')](_0xdfa0('0x3d'),_0x5e2de4);_0x4ed188[_0xdfa0('0x32')]=_0x5a151d[_0xdfa0('0x1f')][_0xdfa0('0x32')];return rpc[_0x11b6bf+_0xdfa0('0x3e')][_0xdfa0('0x3f')](_0x4ed188);})[_0xdfa0('0x3c')](function(_0x34b420){logger[_0xdfa0('0x16')]('[%s][AUTOREPLY]\x20%s',_0x5e2de4,JSON[_0xdfa0('0x40')](_0x34b420));})[_0xdfa0('0x41')](function(_0x450097){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x5e2de4,JSON[_0xdfa0('0x40')](_0x450097));})[_0xdfa0('0x42')](function(){Promise[_0xdfa0('0x43')]()['then'](function(){if(_0x503160[0x0]!=='2'||_0x41855f[_0xdfa0('0x44')])return;return rpc[_0x11b6bf+_0xdfa0('0x45')][_0xdfa0('0x46')](_0x41855f['id'],{'autoreplyExecuted':!![]})[_0xdfa0('0x3c')](function(_0x4bee6a){logger[_0xdfa0('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5e2de4,JSON[_0xdfa0('0x40')](_0x4bee6a));})[_0xdfa0('0x41')](function(_0x36d9ec){logger[_0xdfa0('0x47')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5e2de4,JSON[_0xdfa0('0x40')](_0x36d9ec));});})['then'](function(){_0x256fdc[_0xdfa0('0x12')]();});});}else{return rpc[this['channel']+'Message'][_0xdfa0('0x3f')](_0x4ed188)[_0xdfa0('0x3c')](function(_0xe7a4f2){logger['info']('[%s][AUTOREPLY]\x20%s',_0x5e2de4,_0x4ed188[_0xdfa0('0x1e')]);})['catch'](function(_0x494d89){logger[_0xdfa0('0x47')](_0xdfa0('0x10'),_0x5e2de4,JSON['stringify'](_0x494d89));})['finally'](function(){Promise['resolve']()[_0xdfa0('0x3c')](function(){if(_0x503160[0x0]!=='2'||_0x41855f[_0xdfa0('0x44')])return;return rpc[_0x11b6bf+_0xdfa0('0x45')][_0xdfa0('0x46')](_0x41855f['id'],{'autoreplyExecuted':!![]})[_0xdfa0('0x3c')](function(_0x22e957){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5e2de4,JSON[_0xdfa0('0x40')](_0x22e957));})[_0xdfa0('0x41')](function(_0x1c1300){logger[_0xdfa0('0x47')](_0xdfa0('0x48'),_0x5e2de4,JSON[_0xdfa0('0x40')](_0x1c1300));});})[_0xdfa0('0x3c')](function(){_0x256fdc[_0xdfa0('0x12')]();});});}}}catch(_0x311fd6){logger['error'](_0xdfa0('0x10'),_0x5e2de4,JSON['stringify'](_0x311fd6));_0x256fdc[_0xdfa0('0x49')]();}};};
\ No newline at end of file
+var _0xbc4a=['phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','AccountId','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','headers','auto-replied','auto_reply','sendMailMessage','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','autoreplyExecuted','stop','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','body','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','message','from','mail'];(function(_0x441cc2,_0x24ceba){var _0x432593=function(_0x51ff05){while(--_0x51ff05){_0x441cc2['push'](_0x441cc2['shift']());}};_0x432593(++_0x24ceba);}(_0xbc4a,0x70));var _0xabc4=function(_0x57292b,_0x45f929){_0x57292b=_0x57292b-0x0;var _0x2e79ec=_0xbc4a[_0x57292b];return _0x2e79ec;};'use strict';var _=require('lodash');var moment=require(_0xabc4('0x0'));var utils=require(_0xabc4('0x1'));var logger=require('../../../../config/logger')(_0xabc4('0x2'));var rpc={'chatMessage':require(_0xabc4('0x3')),'openchannelMessage':require(_0xabc4('0x4')),'mailMessage':require(_0xabc4('0x5')),'smsMessage':require(_0xabc4('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xabc4('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xabc4('0x8')),'faxInteraction':require(_0xabc4('0x9')),'whatsappInteraction':require(_0xabc4('0xa'))};var mailRpc=require(_0xabc4('0xb'));exports['consequence']=function(_0x487d88,_0x4043a1,_0x260568,_0x5b2212){return function(_0x2e6159){try{var _0x3b0597=this['channel'];if(_0x3b0597==='mail'&&_0x5b2212[_0xabc4('0xc')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0x487d88,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x2e6159['next']();}if(_0x4043a1[0x0]==='1'&&(_['isNil'](this[_0xabc4('0xd')][_0xabc4('0xe')])||!this[_0xabc4('0xd')][_0xabc4('0xe')])){logger['info'](_0xabc4('0xf'),_0x487d88,_0xabc4('0x10'));return _0x2e6159[_0xabc4('0x11')]();}if(_0x4043a1[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x487d88,_0xabc4('0x12'));return _0x2e6159[_0xabc4('0x11')]();}var _0x1926f7={'ContactId':this['contact']['id'],'sentAt':moment()[_0xabc4('0x13')](_0xabc4('0x14')),'direction':'out'};if(this[_0xabc4('0x15')]==='mail'){_0x1926f7[_0xabc4('0xc')]=utils['getMustacheRender'](_0x4043a1[0x2],this);}else{_0x1926f7[_0xabc4('0xc')]=utils[_0xabc4('0x16')](_0x4043a1[0x1],this);}if(this[_0xabc4('0x17')]){_0x1926f7['to']=this[_0xabc4('0x17')][_0xabc4('0x18')]||'';if(this[_0xabc4('0x15')]===_0xabc4('0x19')&&_0x4043a1[0x1]==='1'){_0x1926f7['cc']=this[_0xabc4('0x17')]['cc']||'';}_0x1926f7[_0xabc4('0x18')]=this[_0xabc4('0x17')]['to']||'';_0x1926f7[_0xabc4('0x1a')]=this[_0xabc4('0x17')][_0xabc4('0x1a')]||'';_0x1926f7[_0xabc4('0x1b')]=!![];if(this[_0xabc4('0x17')]['subject']){_0x1926f7[_0xabc4('0x1c')]='';_0x1926f7['subject']+=_[_0xabc4('0x1d')](this['message'][_0xabc4('0x1c')],'Re:')?'':_0xabc4('0x1e');_0x1926f7[_0xabc4('0x1c')]+=this[_0xabc4('0x17')][_0xabc4('0x1c')];}}if(this[_0xabc4('0x15')]===_0xabc4('0x1f')){_0x1926f7[_0xabc4('0x20')]=this[_0xabc4('0x21')]['id'];}else{_0x1926f7[_['upperFirst'](this[_0xabc4('0x15')])+_0xabc4('0x22')]=this[_0xabc4('0x21')]['id'];}_0x1926f7[_['upperFirst'](this['channel'])+_0xabc4('0x23')]=this[_0xabc4('0xd')]['id'];var _0x38e425=this['interaction'];if(rpc[this['channel']+_0xabc4('0x24')]){if(this[_0xabc4('0x15')]===_0xabc4('0x19')){var _0x239e3c={'tls':{'rejectUnauthorized':![]}};if(this[_0xabc4('0x21')][_0xabc4('0x25')][_0xabc4('0x26')]){_0x239e3c[_0xabc4('0x26')]=this[_0xabc4('0x21')][_0xabc4('0x25')]['service'];}else{_0x239e3c[_0xabc4('0x27')]=this[_0xabc4('0x21')][_0xabc4('0x25')]['host'];_0x239e3c[_0xabc4('0x28')]=this['account'][_0xabc4('0x25')]['port'];_0x239e3c[_0xabc4('0x29')]=this[_0xabc4('0x21')][_0xabc4('0x25')]['secure'];}if(this[_0xabc4('0x21')][_0xabc4('0x25')][_0xabc4('0x2a')]){_0x239e3c[_0xabc4('0x2b')]={'user':this[_0xabc4('0x21')][_0xabc4('0x25')][_0xabc4('0x2c')],'pass':this[_0xabc4('0x21')][_0xabc4('0x25')][_0xabc4('0x2d')]};}_0x1926f7[_0xabc4('0x2e')]=this['message'][_0xabc4('0x2f')];_0x1926f7['html']=_0xabc4('0x30')+_['replace'](_0x1926f7[_0xabc4('0xc')],'<div\x20id=\x22xm-mail-content\x22','<div')+'</div>';_0x1926f7[_0xabc4('0x31')]={'Auto-Submitted':_0xabc4('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0xabc4('0x33')};return mailRpc[_0xabc4('0x34')](_0x239e3c,_0x1926f7)[_0xabc4('0x35')](function(_0x2a208c){logger[_0xabc4('0x36')](_0xabc4('0x37'),_0x487d88);_0x1926f7['messageId']=_0x2a208c[_0xabc4('0x17')][_0xabc4('0x2f')];return rpc[_0x3b0597+_0xabc4('0x24')][_0xabc4('0x38')](_0x1926f7);})[_0xabc4('0x35')](function(_0x3a63e3){logger[_0xabc4('0x36')](_0xabc4('0xf'),_0x487d88,JSON[_0xabc4('0x39')](_0x3a63e3));})['catch'](function(_0x1e8c8c){logger[_0xabc4('0x3a')](_0xabc4('0x3b'),_0x487d88,JSON['stringify'](_0x1e8c8c));})[_0xabc4('0x3c')](function(){Promise[_0xabc4('0x3d')]()[_0xabc4('0x35')](function(){if(_0x4043a1[0x0]!=='2'||_0x38e425['autoreplyExecuted'])return;return rpc[_0x3b0597+_0xabc4('0x3e')][_0xabc4('0x3f')](_0x38e425['id'],{'autoreplyExecuted':!![]})[_0xabc4('0x35')](function(_0x2f3be2){logger[_0xabc4('0x36')](_0xabc4('0x40'),_0x487d88,JSON['stringify'](_0x2f3be2));})[_0xabc4('0x41')](function(_0x30a99b){logger[_0xabc4('0x3a')](_0xabc4('0x42'),_0x487d88,JSON[_0xabc4('0x39')](_0x30a99b));});})[_0xabc4('0x35')](function(){_0x2e6159['next']();});});}else{return rpc[this[_0xabc4('0x15')]+_0xabc4('0x24')][_0xabc4('0x38')](_0x1926f7)[_0xabc4('0x35')](function(_0x411f2a){logger[_0xabc4('0x36')](_0xabc4('0xf'),_0x487d88,_0x1926f7[_0xabc4('0xc')]);})[_0xabc4('0x41')](function(_0x556d56){logger[_0xabc4('0x3a')](_0xabc4('0xf'),_0x487d88,JSON['stringify'](_0x556d56));})[_0xabc4('0x3c')](function(){Promise[_0xabc4('0x3d')]()['then'](function(){if(_0x4043a1[0x0]!=='2'||_0x38e425[_0xabc4('0x43')])return;return rpc[_0x3b0597+_0xabc4('0x3e')][_0xabc4('0x3f')](_0x38e425['id'],{'autoreplyExecuted':!![]})[_0xabc4('0x35')](function(_0x2f18d5){logger[_0xabc4('0x36')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x487d88,JSON['stringify'](_0x2f18d5));})[_0xabc4('0x41')](function(_0x11793b){logger['error'](_0xabc4('0x42'),_0x487d88,JSON[_0xabc4('0x39')](_0x11793b));});})[_0xabc4('0x35')](function(){_0x2e6159[_0xabc4('0x11')]();});});}}}catch(_0xbe7561){logger[_0xabc4('0x3a')](_0xabc4('0xf'),_0x487d88,JSON[_0xabc4('0x39')](_0xbe7561));_0x2e6159[_0xabc4('0x44')]();}};};
\ No newline at end of file
index 60495ce..3f6c61b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e14=['stop','[%s][CLOSE]\x20%s','moment','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','stringify','finally'];(function(_0x4060cd,_0x119910){var _0x5edf8c=function(_0x1e637d){while(--_0x1e637d){_0x4060cd['push'](_0x4060cd['shift']());}};_0x5edf8c(++_0x119910);}(_0x2e14,0x17e));var _0x42e1=function(_0x10a68c,_0x576de9){_0x10a68c=_0x10a68c-0x0;var _0x28fa99=_0x2e14[_0x10a68c];return _0x28fa99;};'use strict';var moment=require(_0x42e1('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x42e1('0x1')),'openchannelInteraction':require(_0x42e1('0x2')),'smsInteraction':require(_0x42e1('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x42e1('0x4')),'whatsappInteraction':require(_0x42e1('0x5'))};exports[_0x42e1('0x6')]=function(_0x1976af,_0x2dd03d,_0x173017,_0x4e8b80){return function(_0x538506){try{logger['info'](_0x42e1('0x7'),_0x1976af,_0x2dd03d[0x0]);var _0x2a13f4={'closed':0x1,'closedAt':moment()[_0x42e1('0x8')](_0x42e1('0x9')),'closeReason':'system','disposition':_0x2dd03d[0x0]};if(rpc[_0x4e8b80[_0x42e1('0xa')]+_0x42e1('0xb')]){rpc[_0x4e8b80[_0x42e1('0xa')]+'Interaction']['update'](_0x4e8b80['interaction']['id'],_0x2a13f4)['then'](function(_0x2ffe5c){logger[_0x42e1('0xc')](_0x42e1('0xd'),_0x1976af,_0x4e8b80[_0x42e1('0xe')]['id']);})[_0x42e1('0xf')](function(_0x48f434){logger['error']('[%s][CLOSE]\x20%s',_0x1976af,JSON[_0x42e1('0x10')](_0x48f434));})[_0x42e1('0x11')](function(){_0x538506[_0x42e1('0x12')]();});}}catch(_0x3365ab){logger['error'](_0x42e1('0x13'),_0x1976af,JSON[_0x42e1('0x10')](_0x3365ab));_0x538506[_0x42e1('0x12')]();}};};
\ No newline at end of file
+var _0x119b=['stringify','finally','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s'];(function(_0x4db408,_0x3b111e){var _0x5e8e20=function(_0x1e2914){while(--_0x1e2914){_0x4db408['push'](_0x4db408['shift']());}};_0x5e8e20(++_0x3b111e);}(_0x119b,0x17c));var _0xb119=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x119b[_0x1558ab];return _0x53b64a;};'use strict';var moment=require(_0xb119('0x0'));var logger=require(_0xb119('0x1'))(_0xb119('0x2'));var rpc={'chatInteraction':require(_0xb119('0x3')),'openchannelInteraction':require(_0xb119('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb119('0x5')),'faxInteraction':require(_0xb119('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xb119('0x7')]=function(_0x1e13a7,_0x2b9338,_0x1dc1ec,_0x3b5ba7){return function(_0x46690b){try{logger[_0xb119('0x8')](_0xb119('0x9'),_0x1e13a7,_0x2b9338[0x0]);var _0x119c2e={'closed':0x1,'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xb119('0xa'),'disposition':_0x2b9338[0x0]};if(rpc[_0x3b5ba7[_0xb119('0xb')]+_0xb119('0xc')]){rpc[_0x3b5ba7[_0xb119('0xb')]+_0xb119('0xc')][_0xb119('0xd')](_0x3b5ba7[_0xb119('0xe')]['id'],_0x119c2e)[_0xb119('0xf')](function(_0x1eb548){logger[_0xb119('0x8')](_0xb119('0x10'),_0x1e13a7,_0x3b5ba7[_0xb119('0xe')]['id']);})['catch'](function(_0x5a6609){logger[_0xb119('0x11')](_0xb119('0x12'),_0x1e13a7,JSON[_0xb119('0x13')](_0x5a6609));})[_0xb119('0x14')](function(){_0x46690b['stop']();});}}catch(_0x3da8bf){logger[_0xb119('0x11')](_0xb119('0x12'),_0x1e13a7,JSON[_0xb119('0x13')](_0x3da8bf));_0x46690b['stop']();}};};
\ No newline at end of file
index 7dec507..5dd6b51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcfa=['InteractionId','created','body','Message','create','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','fulfillment','speech','providerName','endConversation','next','lodash','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId'];(function(_0x4634f8,_0x1ac5ec){var _0x2374f1=function(_0x7dcc77){while(--_0x7dcc77){_0x4634f8['push'](_0x4634f8['shift']());}};_0x2374f1(++_0x1ac5ec);}(_0xdcfa,0xad));var _0xadcf=function(_0x27d771,_0x1a50b2){_0x27d771=_0x27d771-0x0;var _0x2ba087=_0xdcfa[_0x27d771];return _0x2ba087;};'use strict';var _=require(_0xadcf('0x0'));var moment=require('moment');var apiai=require(_0xadcf('0x1'));var md5=require('md5');var utils=require(_0xadcf('0x2'));var logger=require(_0xadcf('0x3'))(_0xadcf('0x4'));var rpc={'chatMessage':require(_0xadcf('0x5')),'openchannelMessage':require(_0xadcf('0x6')),'mailMessage':require(_0xadcf('0x7')),'smsMessage':require(_0xadcf('0x8')),'faxMessage':require(_0xadcf('0x9')),'whatsappMessage':require(_0xadcf('0xa'))};exports[_0xadcf('0xb')]=function(_0x182f1c,_0x381b4c){return function(_0x5a98ab){try{if(!_[_0xadcf('0xc')](this['interaction'][_0xadcf('0xd')])){logger[_0xadcf('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x182f1c,_0xadcf('0xf'));return _0x5a98ab['next']();}var _0x390d09={'ContactId':this['contact']['id'],'sentAt':moment()[_0xadcf('0x10')](_0xadcf('0x11')),'direction':'out'};if(this[_0xadcf('0x12')]===_0xadcf('0x13')||this[_0xadcf('0x12')]===_0xadcf('0x14')){_0x390d09[_0xadcf('0x15')]=this[_0xadcf('0x16')]['phone'];}var _0x2cda6a=this[_0xadcf('0x12')];if(_0x2cda6a===_0xadcf('0x17')){_0x390d09[_0xadcf('0x18')]=this[_0xadcf('0x19')]['id'];}else{_0x390d09[_['upperFirst'](_0x2cda6a)+_0xadcf('0x1a')]=this[_0xadcf('0x19')]['id'];}_0x390d09[_['upperFirst'](_0x2cda6a)+_0xadcf('0x1b')]=this[_0xadcf('0x16')]['id'];if(this[_0xadcf('0x16')][_0xadcf('0x1c')]){var _0x1a058b=_0x381b4c[0x2];if(!_['isEmpty'](_0x1a058b)){_0x390d09[_0xadcf('0x1d')]=utils['getMustacheRender'](_0x1a058b,this);return rpc[_0x2cda6a+_0xadcf('0x1e')][_0xadcf('0x1f')](_0x390d09)['then'](function(_0x22aeb0){logger['info'](_0xadcf('0x20'),_0x182f1c,_0x390d09[_0xadcf('0x1d')]);})[_0xadcf('0x21')](function(_0x998862){logger[_0xadcf('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x182f1c,JSON[_0xadcf('0x23')](_0x998862));})[_0xadcf('0x24')](function(){logger[_0xadcf('0xe')](_0xadcf('0x25'),_0x182f1c);_0x5a98ab[_0xadcf('0x26')]();});}else{logger[_0xadcf('0xe')](_0xadcf('0x27'),_0x182f1c);_0x5a98ab[_0xadcf('0x26')]();}}else{var _0x2dc18a=this;var _0x4b29b5=apiai(_0x381b4c[0x0],{'language':_0x381b4c[0x1]||'en'});return _0x4b29b5[_0xadcf('0x28')](this[_0xadcf('0x29')][_0xadcf('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xadcf('0x2a')](function(_0x2b5012){_0x2dc18a[_0xadcf('0x1d')][_0xadcf('0x2b')]=_0x2b5012;_0x390d09['body']=_0x2b5012[_0xadcf('0x2c')][_0xadcf('0x2d')][_0xadcf('0x2e')];_0x390d09[_0xadcf('0x2f')]='dialogflow';_0x390d09['providerResponse']=JSON[_0xadcf('0x23')](_0x2b5012);return rpc[_0x2cda6a+_0xadcf('0x1e')]['create'](_0x390d09)[_0xadcf('0x2a')](function(_0x3b7498){logger['info'](_0xadcf('0x20'),_0x182f1c,_0x390d09['body']);if(_0x2b5012['result']['metadata'][_0xadcf('0x30')]){_0x5a98ab['next']();}else{_0x5a98ab[_0xadcf('0x26')]();}})[_0xadcf('0x21')](function(_0x4b91bd){logger[_0xadcf('0x22')](_0xadcf('0x20'),_0x182f1c,JSON[_0xadcf('0x23')](_0x4b91bd));_0x5a98ab[_0xadcf('0x31')]();});})[_0xadcf('0x21')](function(_0x4c31bd){logger[_0xadcf('0x22')](_0xadcf('0x20'),_0x182f1c,_0x4c31bd[_0xadcf('0x29')]);_0x5a98ab[_0xadcf('0x31')]();});}}catch(_0x219f59){logger[_0xadcf('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x182f1c,JSON[_0xadcf('0x23')](_0x219f59));_0x5a98ab[_0xadcf('0x26')]();}};};
\ No newline at end of file
+var _0xffd6=['getMustacheRender','Message','create','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','fulfillment','speech','stringify','metadata','message','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body'];(function(_0xb4889,_0x40d58f){var _0x49a716=function(_0x3cc4b7){while(--_0x3cc4b7){_0xb4889['push'](_0xb4889['shift']());}};_0x49a716(++_0x40d58f);}(_0xffd6,0x97));var _0x6ffd=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0xffd6[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0x6ffd('0x0'));var moment=require(_0x6ffd('0x1'));var apiai=require(_0x6ffd('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x6ffd('0x3'))(_0x6ffd('0x4'));var rpc={'chatMessage':require(_0x6ffd('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6ffd('0x6')),'smsMessage':require(_0x6ffd('0x7')),'faxMessage':require(_0x6ffd('0x8')),'whatsappMessage':require(_0x6ffd('0x9'))};exports['consequence']=function(_0x122b71,_0xeefe34){return function(_0x2445a0){try{if(!_[_0x6ffd('0xa')](this[_0x6ffd('0xb')]['UserId'])){logger[_0x6ffd('0xc')](_0x6ffd('0xd'),_0x122b71,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2445a0[_0x6ffd('0xe')]();}var _0x38fc68={'ContactId':this[_0x6ffd('0xf')]['id'],'sentAt':moment()[_0x6ffd('0x10')](_0x6ffd('0x11')),'direction':_0x6ffd('0x12')};if(this[_0x6ffd('0x13')]==='sms'||this[_0x6ffd('0x13')]===_0x6ffd('0x14')){_0x38fc68['phone']=this[_0x6ffd('0xb')][_0x6ffd('0x15')];}var _0x24e55b=this[_0x6ffd('0x13')];if(_0x24e55b==='chat'){_0x38fc68[_0x6ffd('0x16')]=this['account']['id'];}else{_0x38fc68[_[_0x6ffd('0x17')](_0x24e55b)+'AccountId']=this[_0x6ffd('0x18')]['id'];}_0x38fc68[_[_0x6ffd('0x17')](_0x24e55b)+_0x6ffd('0x19')]=this['interaction']['id'];if(this[_0x6ffd('0xb')][_0x6ffd('0x1a')]){var _0x350c94=_0xeefe34[0x2];if(!_[_0x6ffd('0x1b')](_0x350c94)){_0x38fc68[_0x6ffd('0x1c')]=utils[_0x6ffd('0x1d')](_0x350c94,this);return rpc[_0x24e55b+_0x6ffd('0x1e')][_0x6ffd('0x1f')](_0x38fc68)['then'](function(_0x11a609){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x122b71,_0x38fc68[_0x6ffd('0x1c')]);})[_0x6ffd('0x20')](function(_0x50aaa2){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,JSON['stringify'](_0x50aaa2));})['finally'](function(){logger[_0x6ffd('0xc')](_0x6ffd('0x22'),_0x122b71);_0x2445a0['stop']();});}else{logger[_0x6ffd('0xc')](_0x6ffd('0x23'),_0x122b71);_0x2445a0[_0x6ffd('0x24')]();}}else{var _0x53128a=this;var _0x3ba429=apiai(_0xeefe34[0x0],{'language':_0xeefe34[0x1]||'en'});return _0x3ba429[_0x6ffd('0x25')](this['message'][_0x6ffd('0x1c')],{'sessionId':md5(this[_0x6ffd('0xb')]['id'])})['then'](function(_0x31fb22){_0x53128a[_0x6ffd('0x1c')][_0x6ffd('0x26')]=_0x31fb22;_0x38fc68['body']=_0x31fb22[_0x6ffd('0x27')][_0x6ffd('0x28')][_0x6ffd('0x29')];_0x38fc68['providerName']=_0x6ffd('0x26');_0x38fc68['providerResponse']=JSON[_0x6ffd('0x2a')](_0x31fb22);return rpc[_0x24e55b+_0x6ffd('0x1e')]['create'](_0x38fc68)['then'](function(_0x252201){logger[_0x6ffd('0xc')](_0x6ffd('0xd'),_0x122b71,_0x38fc68['body']);if(_0x31fb22['result'][_0x6ffd('0x2b')]['endConversation']){_0x2445a0[_0x6ffd('0xe')]();}else{_0x2445a0[_0x6ffd('0x24')]();}})['catch'](function(_0x6b5aba){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,JSON[_0x6ffd('0x2a')](_0x6b5aba));_0x2445a0[_0x6ffd('0xe')]();});})[_0x6ffd('0x20')](function(_0x225c66){logger[_0x6ffd('0x21')](_0x6ffd('0xd'),_0x122b71,_0x225c66[_0x6ffd('0x2c')]);_0x2445a0[_0x6ffd('0xe')]();});}}catch(_0x352656){logger[_0x6ffd('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x122b71,JSON['stringify'](_0x352656));_0x2445a0['stop']();}};};
\ No newline at end of file
index 52c9339..1baa2e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86e7=['boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','then','[%s][DIALOGFLOWV2]\x20%s','body','error','stringify','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation'];(function(_0x1e7716,_0x55d9bf){var _0x20a549=function(_0x57fdbf){while(--_0x57fdbf){_0x1e7716['push'](_0x1e7716['shift']());}};_0x20a549(++_0x55d9bf);}(_0x86e7,0x130));var _0x786e=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x86e7[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x786e('0x0'));var dialogflow=require(_0x786e('0x1'));var md5=require(_0x786e('0x2'));var moment=require(_0x786e('0x3'));var Promise=require('bluebird');var logger=require(_0x786e('0x4'))(_0x786e('0x5'));var utils=require(_0x786e('0x6'));var rpc={'chatMessage':require(_0x786e('0x7')),'openchannelMessage':require(_0x786e('0x8')),'mailMessage':require(_0x786e('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x786e('0xa')),'whatsappMessage':require(_0x786e('0xb'))};function createMessage(_0x3c0444,_0x5e659a,_0x47bffc,_0x2a45f9){return new Promise(function(_0x261bfc,_0x244f5c){var _0x32bc1e=_[_0x786e('0xc')](_0x47bffc);_0x32bc1e['body']=_0x2a45f9;return rpc[_0x5e659a+_0x786e('0xd')]['create'](_0x32bc1e)[_0x786e('0xe')](function(){logger['info'](_0x786e('0xf'),_0x3c0444,_0x32bc1e[_0x786e('0x10')]);_0x261bfc();})['catch'](function(_0x4b6fcb){logger[_0x786e('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3c0444,JSON[_0x786e('0x12')](_0x4b6fcb));_0x244f5c(_0x4b6fcb);});});}exports['consequence']=function(_0x517d98,_0x16baab){return function(_0x1912be){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0x786e('0x13')](_0x786e('0xf'),_0x517d98,_0x786e('0x14'));return _0x1912be[_0x786e('0x15')]();}var _0x269d9e={'ContactId':this[_0x786e('0x16')]['id'],'sentAt':moment()['format'](_0x786e('0x17')),'direction':'out'};if(this[_0x786e('0x18')]===_0x786e('0x19')||this['channel']===_0x786e('0x1a')){_0x269d9e['phone']=this[_0x786e('0x1b')][_0x786e('0x1c')];}var _0x3cb989=this['channel'];if(_0x3cb989===_0x786e('0x1d')){_0x269d9e[_0x786e('0x1e')]=this[_0x786e('0x1f')]['id'];}else{_0x269d9e[_[_0x786e('0x20')](_0x3cb989)+'AccountId']=this['account']['id'];}_0x269d9e[_['upperFirst'](_0x3cb989)+_0x786e('0x21')]=this[_0x786e('0x1b')]['id'];if(this[_0x786e('0x1b')][_0x786e('0x22')]){var _0x3e0189=_0x16baab[0x4];if(!_[_0x786e('0x23')](_0x3e0189)){_0x269d9e[_0x786e('0x10')]=utils[_0x786e('0x24')](_0x3e0189,this);return rpc[_0x3cb989+'Message']['create'](_0x269d9e)[_0x786e('0xe')](function(_0x11534a){logger[_0x786e('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x517d98,_0x269d9e[_0x786e('0x10')]);})[_0x786e('0x25')](function(_0x317d9b){logger[_0x786e('0x11')](_0x786e('0xf'),_0x517d98,JSON[_0x786e('0x12')](_0x317d9b));})[_0x786e('0x26')](function(){logger['info'](_0x786e('0x27'),_0x517d98);_0x1912be[_0x786e('0x28')]();});}else{logger[_0x786e('0x13')](_0x786e('0x29'),_0x517d98);_0x1912be[_0x786e('0x28')]();}}else{var _0x524549=this;var _0x101d87=_0x16baab[0x2]['replace'](/\\n/g,'\x0a');var _0x130675={'credentials':{'private_key':_0x101d87,'client_email':_0x16baab[0x1]}};var _0x520900=new dialogflow[(_0x786e('0x2a'))](_0x130675);var _0x2f09e1=_0x520900[_0x786e('0x2b')](_0x16baab[0x0],md5(_0x524549[_0x786e('0x1b')]['id']));var _0x443b7c={'session':_0x2f09e1,'queryInput':{'text':{'text':_0x524549[_0x786e('0x2c')]['body'],'languageCode':_0x16baab[0x3]||'en'}}};return _0x520900[_0x786e('0x2d')](_0x443b7c)['then'](function(_0x77750e){if(_0x77750e&&_0x77750e[_0x786e('0x2e')]){_0x524549[_0x786e('0x10')]['dialogflowV2']=_0x77750e;var _0x35bc31=_0x77750e[0x0];var _0x24b393=_0x35bc31[_0x786e('0x2f')][_0x786e('0x30')]&&_0x35bc31['queryResult'][_0x786e('0x30')]['fields']?_0x35bc31[_0x786e('0x2f')][_0x786e('0x30')][_0x786e('0x31')][_0x786e('0x32')][_0x786e('0x33')]:![];_0x524549[_0x786e('0x10')]['DIALOGFLOWV2_ACTION']=_0x35bc31[_0x786e('0x2f')][_0x786e('0x34')];_0x524549[_0x786e('0x10')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x35bc31[_0x786e('0x2f')][_0x786e('0x35')];_0x524549['body'][_0x786e('0x36')]=_0x35bc31[_0x786e('0x2f')][_0x786e('0x30')]&&_0x35bc31['queryResult'][_0x786e('0x30')][_0x786e('0x31')]?_0x35bc31[_0x786e('0x2f')][_0x786e('0x30')][_0x786e('0x31')][_0x786e('0x32')][_0x786e('0x33')]:![];_0x524549[_0x786e('0x10')]['DIALOGFLOWV2_INTENTNAME']=_0x35bc31[_0x786e('0x2f')][_0x786e('0x37')][_0x786e('0x38')];_0x524549[_0x786e('0x10')][_0x786e('0x39')]=_0x35bc31[_0x786e('0x2f')]['intent'][_0x786e('0x3a')];_0x524549['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x35bc31['queryResult']['intent'][_0x786e('0x3b')];_0x524549[_0x786e('0x10')][_0x786e('0x3c')]=_0x35bc31[_0x786e('0x2f')][_0x786e('0x3d')];_0x524549['body'][_0x786e('0x3e')]=_0x35bc31[_0x786e('0x2f')][_0x786e('0x3f')];_0x524549[_0x786e('0x10')][_0x786e('0x40')]=_0x35bc31[_0x786e('0x2f')][_0x786e('0x41')];_0x269d9e[_0x786e('0x42')]=_0x786e('0x43');_0x269d9e[_0x786e('0x44')]=JSON[_0x786e('0x12')](_0x77750e);var _0x4b7b6a=[];for(var _0x51d7d7=0x0;_0x51d7d7<_0x77750e[_0x786e('0x2e')];_0x51d7d7++){var _0x42fe7d=_0x77750e[_0x51d7d7];if(_0x42fe7d&&_0x42fe7d['queryResult']&&_0x42fe7d[_0x786e('0x2f')][_0x786e('0x45')]){_0x4b7b6a['push'](createMessage(_0x517d98,_0x3cb989,_0x269d9e,_0x42fe7d[_0x786e('0x2f')][_0x786e('0x45')]));}}return Promise[_0x786e('0x46')](_0x4b7b6a)['then'](function(){if(_0x24b393){_0x1912be[_0x786e('0x15')]();}else{_0x1912be[_0x786e('0x28')]();}})[_0x786e('0x25')](function(_0x2eca1b){logger[_0x786e('0x11')](_0x786e('0xf'),_0x517d98,JSON[_0x786e('0x12')](_0x2eca1b));_0x1912be[_0x786e('0x15')]();});}})['catch'](function(_0xe1dddc){logger[_0x786e('0x11')](_0x786e('0xf'),_0x517d98,_0xe1dddc[_0x786e('0x2c')]);_0x1912be[_0x786e('0x15')]();});}}catch(_0x598232){logger[_0x786e('0x11')](_0x786e('0xf'),_0x517d98,JSON[_0x786e('0x12')](_0x598232));_0x1912be['stop']();}};};
\ No newline at end of file
+var _0x0018=['queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','intentDetectionConfidence','providerName','providerResponse','push','fulfillmentText','all','stringify','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','sessionPath','message','detectIntent','length','dialogflowV2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0018,0xa6));var _0x8001=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0018[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var dialogflow=require(_0x8001('0x0'));var md5=require(_0x8001('0x1'));var moment=require('moment');var Promise=require(_0x8001('0x2'));var logger=require(_0x8001('0x3'))(_0x8001('0x4'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8001('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8001('0x6')),'faxMessage':require(_0x8001('0x7')),'whatsappMessage':require(_0x8001('0x8'))};function createMessage(_0x2ddbf5,_0x2af1c0,_0x3fd295,_0x1f6c20){return new Promise(function(_0x267853,_0x1bdeee){var _0x4bb468=_[_0x8001('0x9')](_0x3fd295);_0x4bb468['body']=_0x1f6c20;return rpc[_0x2af1c0+_0x8001('0xa')][_0x8001('0xb')](_0x4bb468)[_0x8001('0xc')](function(){logger['info'](_0x8001('0xd'),_0x2ddbf5,_0x4bb468[_0x8001('0xe')]);_0x267853();})[_0x8001('0xf')](function(_0x569fb7){logger[_0x8001('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x2ddbf5,JSON['stringify'](_0x569fb7));_0x1bdeee(_0x569fb7);});});}exports[_0x8001('0x11')]=function(_0x590a94,_0x490799){return function(_0x423e96){try{if(!_[_0x8001('0x12')](this[_0x8001('0x13')][_0x8001('0x14')])){logger['info'](_0x8001('0xd'),_0x590a94,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x423e96[_0x8001('0x15')]();}var _0x28dd9d={'ContactId':this[_0x8001('0x16')]['id'],'sentAt':moment()[_0x8001('0x17')](_0x8001('0x18')),'direction':_0x8001('0x19')};if(this[_0x8001('0x1a')]==='sms'||this['channel']===_0x8001('0x1b')){_0x28dd9d[_0x8001('0x1c')]=this[_0x8001('0x13')]['phone'];}var _0x1b8139=this[_0x8001('0x1a')];if(_0x1b8139===_0x8001('0x1d')){_0x28dd9d[_0x8001('0x1e')]=this[_0x8001('0x1f')]['id'];}else{_0x28dd9d[_[_0x8001('0x20')](_0x1b8139)+_0x8001('0x21')]=this['account']['id'];}_0x28dd9d[_['upperFirst'](_0x1b8139)+_0x8001('0x22')]=this[_0x8001('0x13')]['id'];if(this['interaction'][_0x8001('0x23')]){var _0x396e51=_0x490799[0x4];if(!_['isEmpty'](_0x396e51)){_0x28dd9d[_0x8001('0xe')]=utils[_0x8001('0x24')](_0x396e51,this);return rpc[_0x1b8139+_0x8001('0xa')]['create'](_0x28dd9d)['then'](function(_0x2ebb70){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x590a94,_0x28dd9d['body']);})['catch'](function(_0x5b96dc){logger[_0x8001('0x10')](_0x8001('0xd'),_0x590a94,JSON['stringify'](_0x5b96dc));})[_0x8001('0x25')](function(){logger[_0x8001('0x26')](_0x8001('0x27'),_0x590a94);_0x423e96['stop']();});}else{logger[_0x8001('0x26')](_0x8001('0x28'),_0x590a94);_0x423e96[_0x8001('0x29')]();}}else{var _0x41e166=this;var _0x54fedb=_0x490799[0x2]['replace'](/\\n/g,'\x0a');var _0x471b6f={'credentials':{'private_key':_0x54fedb,'client_email':_0x490799[0x1]}};var _0x1a411c=new dialogflow['SessionsClient'](_0x471b6f);var _0x13711d=_0x1a411c[_0x8001('0x2a')](_0x490799[0x0],md5(_0x41e166[_0x8001('0x13')]['id']));var _0xb87303={'session':_0x13711d,'queryInput':{'text':{'text':_0x41e166[_0x8001('0x2b')][_0x8001('0xe')],'languageCode':_0x490799[0x3]||'en'}}};return _0x1a411c[_0x8001('0x2c')](_0xb87303)[_0x8001('0xc')](function(_0x40f885){if(_0x40f885&&_0x40f885[_0x8001('0x2d')]){_0x41e166[_0x8001('0xe')][_0x8001('0x2e')]=_0x40f885;var _0x37efa5=_0x40f885[0x0];var _0x3b4bd6=_0x37efa5[_0x8001('0x2f')][_0x8001('0x30')]&&_0x37efa5['queryResult']['diagnosticInfo'][_0x8001('0x31')]?_0x37efa5[_0x8001('0x2f')]['diagnosticInfo'][_0x8001('0x31')]['end_conversation']['boolValue']:![];_0x41e166['body'][_0x8001('0x32')]=_0x37efa5[_0x8001('0x2f')][_0x8001('0x33')];_0x41e166['body'][_0x8001('0x34')]=_0x37efa5[_0x8001('0x2f')]['allRequiredParamsPresent'];_0x41e166[_0x8001('0xe')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x37efa5['queryResult'][_0x8001('0x30')]&&_0x37efa5[_0x8001('0x2f')][_0x8001('0x30')][_0x8001('0x31')]?_0x37efa5[_0x8001('0x2f')][_0x8001('0x30')][_0x8001('0x31')][_0x8001('0x35')][_0x8001('0x36')]:![];_0x41e166[_0x8001('0xe')][_0x8001('0x37')]=_0x37efa5['queryResult'][_0x8001('0x38')][_0x8001('0x39')];_0x41e166[_0x8001('0xe')][_0x8001('0x3a')]=_0x37efa5[_0x8001('0x2f')]['intent']['displayName'];_0x41e166[_0x8001('0xe')][_0x8001('0x3b')]=_0x37efa5[_0x8001('0x2f')][_0x8001('0x38')][_0x8001('0x3c')];_0x41e166[_0x8001('0xe')][_0x8001('0x3d')]=_0x37efa5[_0x8001('0x2f')][_0x8001('0x3e')];_0x41e166[_0x8001('0xe')][_0x8001('0x3f')]=_0x37efa5[_0x8001('0x2f')]['queryText'];_0x41e166['body']['DIALOGFLOWV2_SCORE']=_0x37efa5[_0x8001('0x2f')][_0x8001('0x40')];_0x28dd9d[_0x8001('0x41')]=_0x8001('0x2e');_0x28dd9d[_0x8001('0x42')]=JSON['stringify'](_0x40f885);var _0x372158=[];for(var _0x243a21=0x0;_0x243a21<_0x40f885[_0x8001('0x2d')];_0x243a21++){var _0x14771e=_0x40f885[_0x243a21];if(_0x14771e&&_0x14771e[_0x8001('0x2f')]&&_0x14771e[_0x8001('0x2f')]['fulfillmentText']){_0x372158[_0x8001('0x43')](createMessage(_0x590a94,_0x1b8139,_0x28dd9d,_0x14771e[_0x8001('0x2f')][_0x8001('0x44')]));}}return Promise[_0x8001('0x45')](_0x372158)[_0x8001('0xc')](function(){if(_0x3b4bd6){_0x423e96[_0x8001('0x15')]();}else{_0x423e96[_0x8001('0x29')]();}})['catch'](function(_0x415d38){logger['error'](_0x8001('0xd'),_0x590a94,JSON[_0x8001('0x46')](_0x415d38));_0x423e96[_0x8001('0x15')]();});}})['catch'](function(_0x5e7385){logger[_0x8001('0x10')](_0x8001('0xd'),_0x590a94,_0x5e7385[_0x8001('0x2b')]);_0x423e96[_0x8001('0x15')]();});}}catch(_0x815c82){logger[_0x8001('0x10')](_0x8001('0xd'),_0x590a94,JSON['stringify'](_0x815c82));_0x423e96['stop']();}};};
\ No newline at end of file
index 105a813..9c313bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d22=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','message','stop','priorityTrue','priorityFalse','info','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d22,0xaa));var _0x23d2=function(_0x26f076,_0x59d978){_0x26f076=_0x26f076-0x0;var _0x14c282=_0x3d22[_0x26f076];return _0x14c282;};'use strict';var schema=require(_0x23d2('0x0'));var _=require(_0x23d2('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x23d2('0x2'));var logger=require(_0x23d2('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x23d2('0x4'),'required':!![],'message':_0x23d2('0x5')},'priorityTrue':{'type':_0x23d2('0x6'),'message':_0x23d2('0x7')},'priorityFalse':{'type':_0x23d2('0x6'),'message':_0x23d2('0x8')}});exports['consequence']=function(_0x18c0fa,_0x5ac536){return function(_0x112576){try{var _0x18964f={'condition':htmlToText[_0x23d2('0x9')](utils[_0x23d2('0xa')](_0x5ac536[0x0],this),{'wordwrap':![]})[_0x23d2('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5ac536[0x1],'priorityFalse':_0x5ac536[0x2]};var _0x55c280=gotoif[_0x23d2('0x0')](_0x18964f,{'typecast':!![]});if(_0x55c280[_0x23d2('0xc')]){logger['error'](_0x23d2('0xd'),_0x18c0fa,_['map'](_0x55c280,_0x23d2('0xe'))['join'](',\x20'));_0x112576[_0x23d2('0xf')]();}else{try{var _0x40bb58=eval('('+_0x18964f['condition']+')');var _0x4653bc=_0x40bb58?_0x18964f[_0x23d2('0x10')]:_0x18964f[_0x23d2('0x11')];logger[_0x23d2('0x12')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x18c0fa,_0x18964f[_0x23d2('0x13')],_0x40bb58,_0x4653bc||_0x23d2('0x14'));if(_0x4653bc){var _0x15bb56=_[_0x23d2('0x15')](_0x112576[_0x23d2('0x16')](),{'p':_0x4653bc});if(_0x15bb56>=0x0){logger[_0x23d2('0x12')](_0x23d2('0x17'),_0x18c0fa,_0x4653bc||_0x23d2('0x14'),_0x15bb56);_0x112576[_0x23d2('0x14')](_0x15bb56);}else{logger[_0x23d2('0x12')](_0x23d2('0x18'),_0x18c0fa,_0x4653bc||_0x23d2('0x14'));_0x112576[_0x23d2('0xf')]();}}else{_0x112576[_0x23d2('0x14')]();}}catch(_0x36d457){logger[_0x23d2('0x19')](_0x23d2('0x1a'),_0x18c0fa,_0x36d457[_0x23d2('0xe')]);_0x112576[_0x23d2('0xf')]();}}}catch(_0x256124){logger[_0x23d2('0x19')](_0x23d2('0xd'),_0x18c0fa,JSON[_0x23d2('0x1b')](_0x256124));_0x112576[_0x23d2('0xf')]();}};};
\ No newline at end of file
+var _0xcecc=['error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','validate','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcecc,0x6a));var _0xccec=function(_0xc542eb,_0x15edc6){_0xc542eb=_0xc542eb-0x0;var _0x296d42=_0xcecc[_0xc542eb];return _0x296d42;};'use strict';var schema=require('validate');var _=require(_0xccec('0x0'));var htmlToText=require(_0xccec('0x1'));var utils=require(_0xccec('0x2'));var logger=require('../../../../config/logger')(_0xccec('0x3'));var gotoif=schema({'condition':{'type':_0xccec('0x4'),'required':!![],'message':_0xccec('0x5')},'priorityTrue':{'type':_0xccec('0x6'),'message':_0xccec('0x7')},'priorityFalse':{'type':_0xccec('0x6'),'message':_0xccec('0x8')}});exports['consequence']=function(_0x73200c,_0xd8e81f){return function(_0x520392){try{var _0x4f37d5={'condition':htmlToText[_0xccec('0x9')](utils[_0xccec('0xa')](_0xd8e81f[0x0],this),{'wordwrap':![]})[_0xccec('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xd8e81f[0x1],'priorityFalse':_0xd8e81f[0x2]};var _0x5daac7=gotoif[_0xccec('0xc')](_0x4f37d5,{'typecast':!![]});if(_0x5daac7[_0xccec('0xd')]){logger[_0xccec('0xe')](_0xccec('0xf'),_0x73200c,_['map'](_0x5daac7,_0xccec('0x10'))[_0xccec('0x11')](',\x20'));_0x520392[_0xccec('0x12')]();}else{try{var _0xebbcba=eval('('+_0x4f37d5[_0xccec('0x13')]+')');var _0x397984=_0xebbcba?_0x4f37d5[_0xccec('0x14')]:_0x4f37d5['priorityFalse'];logger[_0xccec('0x15')](_0xccec('0x16'),_0x73200c,_0x4f37d5[_0xccec('0x13')],_0xebbcba,_0x397984||_0xccec('0x17'));if(_0x397984){var _0x543a26=_[_0xccec('0x18')](_0x520392[_0xccec('0x19')](),{'p':_0x397984});if(_0x543a26>=0x0){logger[_0xccec('0x15')](_0xccec('0x1a'),_0x73200c,_0x397984||_0xccec('0x17'),_0x543a26);_0x520392[_0xccec('0x17')](_0x543a26);}else{logger[_0xccec('0x15')](_0xccec('0x1b'),_0x73200c,_0x397984||_0xccec('0x17'));_0x520392[_0xccec('0x12')]();}}else{_0x520392[_0xccec('0x17')]();}}catch(_0x59dcae){logger[_0xccec('0xe')](_0xccec('0x1c'),_0x73200c,_0x59dcae['message']);_0x520392[_0xccec('0x12')]();}}}catch(_0x21747d){logger['error'](_0xccec('0xf'),_0x73200c,JSON[_0xccec('0x1d')](_0x21747d));_0x520392[_0xccec('0x12')]();}};};
\ No newline at end of file
index fc6137b..f4216eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9857=['stringify','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x5e8a2f,_0x178b9){var _0x458efa=function(_0x8745b4){while(--_0x8745b4){_0x5e8a2f['push'](_0x5e8a2f['shift']());}};_0x458efa(++_0x178b9);}(_0x9857,0x1ba));var _0x7985=function(_0x35ea6f,_0x4b2346){_0x35ea6f=_0x35ea6f-0x0;var _0x465420=_0x9857[_0x35ea6f];return _0x465420;};'use strict';var schema=require('validate');var _=require(_0x7985('0x0'));var logger=require(_0x7985('0x1'))(_0x7985('0x2'));var gotop=schema({'priority':{'type':_0x7985('0x3'),'required':!![],'message':_0x7985('0x4')}});exports[_0x7985('0x5')]=function(_0x2c3ef8,_0x44ff4f){return function(_0x50950b){try{var _0x57c2f8={'priority':_0x44ff4f[0x0]};var _0xcccaa0=gotop[_0x7985('0x6')](_0x57c2f8,{'typecast':!![]});if(_0xcccaa0[_0x7985('0x7')]){logger[_0x7985('0x8')](_0x7985('0x9'),_0x2c3ef8,_[_0x7985('0xa')](_0xcccaa0,'message')[_0x7985('0xb')](',\x20'));_0x50950b[_0x7985('0xc')]();}else{logger[_0x7985('0xd')](_0x7985('0xe'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]);if(_0x57c2f8['priority']){var _0x45917a=_['findIndex'](_0x50950b[_0x7985('0x10')](),{'p':_0x57c2f8['priority']});if(_0x45917a>=0x0){logger[_0x7985('0xd')](_0x7985('0x11'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]||_0x7985('0x12'),_0x45917a);_0x50950b['next'](_0x45917a);}else{logger[_0x7985('0xd')](_0x7985('0x13'),_0x2c3ef8,_0x57c2f8[_0x7985('0xf')]||_0x7985('0x12'));_0x50950b[_0x7985('0xc')]();}}else{_0x50950b['next']();}}}catch(_0x3e3afd){logger['error']('[%s][GOTOP]\x20%s',_0x2c3ef8,JSON[_0x7985('0x14')](_0x3e3afd));_0x50950b['stop']();}};};
\ No newline at end of file
+var _0xcbf1=['join','stop','priority','findIndex','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','error','map','message'];(function(_0x48a0b4,_0x2a4c3f){var _0x44b1e6=function(_0x3cfaa6){while(--_0x3cfaa6){_0x48a0b4['push'](_0x48a0b4['shift']());}};_0x44b1e6(++_0x2a4c3f);}(_0xcbf1,0x15f));var _0x1cbf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcbf1[_0x3ab51d];return _0x29a04e;};'use strict';var schema=require(_0x1cbf('0x0'));var _=require(_0x1cbf('0x1'));var logger=require(_0x1cbf('0x2'))(_0x1cbf('0x3'));var gotop=schema({'priority':{'type':_0x1cbf('0x4'),'required':!![],'message':_0x1cbf('0x5')}});exports['consequence']=function(_0x5e3c0a,_0x1a1e01){return function(_0x490234){try{var _0x3187ec={'priority':_0x1a1e01[0x0]};var _0x22a941=gotop[_0x1cbf('0x0')](_0x3187ec,{'typecast':!![]});if(_0x22a941['length']){logger[_0x1cbf('0x6')]('[%s][GOTOP]\x20%s',_0x5e3c0a,_[_0x1cbf('0x7')](_0x22a941,_0x1cbf('0x8'))[_0x1cbf('0x9')](',\x20'));_0x490234[_0x1cbf('0xa')]();}else{logger['info']('[%s][GOTOP]\x20priority\x20%s',_0x5e3c0a,_0x3187ec[_0x1cbf('0xb')]);if(_0x3187ec[_0x1cbf('0xb')]){var _0x12ac63=_[_0x1cbf('0xc')](_0x490234['rules'](),{'p':_0x3187ec[_0x1cbf('0xb')]});if(_0x12ac63>=0x0){logger[_0x1cbf('0xd')](_0x1cbf('0xe'),_0x5e3c0a,_0x3187ec[_0x1cbf('0xb')]||_0x1cbf('0xf'),_0x12ac63);_0x490234[_0x1cbf('0xf')](_0x12ac63);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5e3c0a,_0x3187ec[_0x1cbf('0xb')]||'next');_0x490234['stop']();}}else{_0x490234[_0x1cbf('0xf')]();}}}catch(_0x143342){logger[_0x1cbf('0x6')](_0x1cbf('0x10'),_0x5e3c0a,JSON[_0x1cbf('0x11')](_0x143342));_0x490234[_0x1cbf('0xa')]();}};};
\ No newline at end of file
index ab03140..8f5483d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35fc=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','lodash','./utils','routing'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0x35fc,0x7f));var _0xc35f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x35fc[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xc35f('0x0'));var utils=require(_0xc35f('0x1'));var logger=require('../../../../config/logger')(_0xc35f('0x2'));var rpc={'chatMessage':require(_0xc35f('0x3')),'openchannelMessage':require(_0xc35f('0x4')),'mailMessage':require(_0xc35f('0x5')),'smsMessage':require(_0xc35f('0x6')),'faxMessage':require(_0xc35f('0x7')),'whatsappMessage':require(_0xc35f('0x8'))};exports[_0xc35f('0x9')]=function(_0x2624ca,_0x1456a9){return function(_0x131e0d){try{var _0x5764b6={'body':utils['getMustacheRender'](_0x1456a9[0x0],this),'ContactId':this[_0xc35f('0xa')]['id']};if(this[_0xc35f('0xb')]===_0xc35f('0xc')){_0x5764b6[_0xc35f('0xd')]=this[_0xc35f('0xe')]['id'];}else{_0x5764b6[_['upperFirst'](this['channel'])+'AccountId']=this[_0xc35f('0xe')]['id'];}_0x5764b6[_[_0xc35f('0xf')](this['channel'])+_0xc35f('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0xc35f('0x11')]){return rpc[this[_0xc35f('0xb')]+_0xc35f('0x11')][_0xc35f('0x12')](_0x5764b6)[_0xc35f('0x13')](function(_0x30bdaa){logger['info'](_0xc35f('0x14'),_0x2624ca,_0x5764b6[_0xc35f('0x15')]);_0x131e0d[_0xc35f('0x16')]();})[_0xc35f('0x17')](function(_0x4dec4c){logger['error']('[%s][MESSAGE]\x20%s',_0x2624ca,JSON[_0xc35f('0x18')](_0x4dec4c));_0x131e0d['stop']();});}}catch(_0x3e6a0f){logger['error'](_0xc35f('0x14'),_0x2624ca,JSON[_0xc35f('0x18')](_0x3e6a0f));_0x131e0d[_0xc35f('0x19')]();}};};
\ No newline at end of file
+var _0x8434=['ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','channel','Message','info','[%s][MESSAGE]\x20%s','next','catch','error','stop','stringify','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender'];(function(_0x156186,_0x2e8f45){var _0x53176b=function(_0x3f5c52){while(--_0x3f5c52){_0x156186['push'](_0x156186['shift']());}};_0x53176b(++_0x2e8f45);}(_0x8434,0x9f));var _0x4843=function(_0x347a3e,_0x5830bb){_0x347a3e=_0x347a3e-0x0;var _0x23be2d=_0x8434[_0x347a3e];return _0x23be2d;};'use strict';var _=require('lodash');var utils=require(_0x4843('0x0'));var logger=require(_0x4843('0x1'))(_0x4843('0x2'));var rpc={'chatMessage':require(_0x4843('0x3')),'openchannelMessage':require(_0x4843('0x4')),'mailMessage':require(_0x4843('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x4843('0x6')),'whatsappMessage':require(_0x4843('0x7'))};exports['consequence']=function(_0x75f74b,_0x279601){return function(_0x4934d1){try{var _0x2facac={'body':utils[_0x4843('0x8')](_0x279601[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x2facac[_0x4843('0x9')]=this['account']['id'];}else{_0x2facac[_[_0x4843('0xa')](this['channel'])+_0x4843('0xb')]=this[_0x4843('0xc')]['id'];}_0x2facac[_[_0x4843('0xa')](this['channel'])+_0x4843('0xd')]=this[_0x4843('0xe')]['id'];if(rpc[this[_0x4843('0xf')]+_0x4843('0x10')]){return rpc[this[_0x4843('0xf')]+'Message']['create'](_0x2facac)['then'](function(_0x5ba1f8){logger[_0x4843('0x11')](_0x4843('0x12'),_0x75f74b,_0x2facac['body']);_0x4934d1[_0x4843('0x13')]();})[_0x4843('0x14')](function(_0x11494d){logger[_0x4843('0x15')](_0x4843('0x12'),_0x75f74b,JSON['stringify'](_0x11494d));_0x4934d1[_0x4843('0x16')]();});}}catch(_0xe60fce){logger['error'](_0x4843('0x12'),_0x75f74b,JSON[_0x4843('0x17')](_0xe60fce));_0x4934d1[_0x4843('0x16')]();}};};
\ No newline at end of file
index 6131b92..32d9144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e06=['../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify'];(function(_0x1a58d1,_0xa90685){var _0x101adc=function(_0x4a7543){while(--_0x4a7543){_0x1a58d1['push'](_0x1a58d1['shift']());}};_0x101adc(++_0xa90685);}(_0x7e06,0x1b0));var _0x67e0=function(_0x318a60,_0x5c9062){_0x318a60=_0x318a60-0x0;var _0x59d5de=_0x7e06[_0x318a60];return _0x59d5de;};'use strict';var utils=require('./utils');var logger=require(_0x67e0('0x0'))(_0x67e0('0x1'));exports[_0x67e0('0x2')]=function(_0x19d451,_0xae1e79){return function(_0x12fa7f){try{logger[_0x67e0('0x3')](_0x67e0('0x4'),_0x19d451,utils[_0x67e0('0x5')](_0xae1e79[0x0],this));_0x12fa7f[_0x67e0('0x6')]();}catch(_0x3aae4f){logger[_0x67e0('0x7')](_0x67e0('0x4'),_0x19d451,JSON[_0x67e0('0x8')](_0x3aae4f));_0x12fa7f['stop']();}};};
\ No newline at end of file
+var _0x993b=['error','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s','next'];(function(_0x4fd906,_0x261f02){var _0x5bbd37=function(_0x2a1f82){while(--_0x2a1f82){_0x4fd906['push'](_0x4fd906['shift']());}};_0x5bbd37(++_0x261f02);}(_0x993b,0xb0));var _0xb993=function(_0x36dc1c,_0x101ac2){_0x36dc1c=_0x36dc1c-0x0;var _0x22760d=_0x993b[_0x36dc1c];return _0x22760d;};'use strict';var utils=require(_0xb993('0x0'));var logger=require(_0xb993('0x1'))(_0xb993('0x2'));exports[_0xb993('0x3')]=function(_0x4522c8,_0x56f04c){return function(_0x3b1f5a){try{logger['info'](_0xb993('0x4'),_0x4522c8,utils['getMustacheRender'](_0x56f04c[0x0],this));_0x3b1f5a[_0xb993('0x5')]();}catch(_0x5f2494){logger[_0xb993('0x6')](_0xb993('0x4'),_0x4522c8,JSON['stringify'](_0x5f2494));_0x3b1f5a['stop']();}};};
\ No newline at end of file
index f247376..35ba9b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6826=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','channel','QueueId','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','queue_id','account','from','queue','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x5de769,_0xd8b92){var _0x226574=function(_0x1c54c2){while(--_0x1c54c2){_0x5de769['push'](_0x5de769['shift']());}};_0x226574(++_0xd8b92);}(_0x6826,0x75));var _0x6682=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0x6826[_0x8ae98b];return _0xc30bd4;};'use strict';var schema=require(_0x6682('0x0'));var _=require('lodash');var util=require(_0x6682('0x1'));var seqqueue=require(_0x6682('0x2'));var moment=require(_0x6682('0x3'));var Redis=require(_0x6682('0x4'));var config=require(_0x6682('0x5'));var logger=require(_0x6682('0x6'))('routing');var strategy=require('./strategy');config[_0x6682('0x7')]=_[_0x6682('0x8')](config[_0x6682('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6682('0x9'))(new Redis(config[_0x6682('0x7')]));var attributes=['id',_0x6682('0xa'),_0x6682('0xb'),'queue',_0x6682('0xc'),'joinAt'];function emit(_0x333c6b,_0x1914bd,_0x2a1f92){io['to'](_0x333c6b)['emit'](_0x1914bd,_0x2a1f92);}function emitChannelQueueInteraction(_0x208f89,_0xe3f12e,_0x5ea096,_0x2036c0,_0x33d6de,_0x3b0377,_0x1ec19f,_0x55693c){var _0x2cc606=_['clone'](_0x5ea096);_0x2cc606['queue_id']=_0x55693c;_0x2cc606[_0x6682('0xd')]=_0xe3f12e;_0x2cc606[_0x6682('0xb')]=_0x2036c0;_0x2cc606['id']=_0x33d6de;if(_0x3b0377){_0x1ec19f[util[_0x6682('0xe')]('%sQueuesWaitingInteractions',_0x208f89)][_0x33d6de]=_[_0x6682('0xf')](_0x2cc606,attributes);}else{delete _0x1ec19f[util[_0x6682('0xe')](_0x6682('0x10'),_0x208f89)][_0x33d6de];}emit(util[_0x6682('0xe')](_0x6682('0x11'),_0x208f89,_0xe3f12e),util[_0x6682('0xe')]('%s_queue_waiting_interaction:%s',_0x208f89,_0x3b0377?_0x6682('0x12'):_0x6682('0x13')),_['pick'](_0x2cc606,attributes));}var rpc={'openchannelQueueReport':require(_0x6682('0x14')),'mailQueueReport':require(_0x6682('0x15')),'chatQueueReport':require(_0x6682('0x16')),'smsQueueReport':require(_0x6682('0x17')),'faxQueueReport':require(_0x6682('0x18')),'whatsappQueueReport':require(_0x6682('0x19'))};var queue=schema({'name':{'type':_0x6682('0x1a'),'required':!![],'message':_0x6682('0x1b')},'timeout':{'type':_0x6682('0x1c'),'message':_0x6682('0x1d')}});function startRouting(_0x411ce8,_0x124316,_0x4914df,_0x1483e5){if(_0x411ce8&&_0x124316&&_0x4914df){_0x124316[_0x6682('0x1e')]+=0x1;var _0x2b0880={'uniqueid':_0x411ce8,'from':_0x4914df[_0x6682('0x1f')]?_0x4914df[_0x6682('0x1f')]['from']:'','joinAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'ContactId':_0x4914df['contact']?_0x4914df['contact']['id']:null,'ListId':_0x4914df[_0x6682('0x21')]?_0x4914df[_0x6682('0x21')]['id']:null};_0x2b0880[_['upperFirst'](_0x4914df[_0x6682('0x22')])+_0x6682('0x23')]=_0x124316['id']||null;_0x2b0880[_['upperFirst'](_0x4914df['channel'])+_0x6682('0x24')]=_0x4914df[_0x6682('0x25')]?_0x4914df[_0x6682('0x25')]['id']:null;_0x2b0880[_[_0x6682('0x26')](_0x4914df[_0x6682('0x22')])+_0x6682('0x27')]=_0x4914df[_0x6682('0x28')]?_0x4914df[_0x6682('0x28')]['id']:null;_0x2b0880[_['upperFirst'](_0x4914df[_0x6682('0x22')])+(_0x4914df['channel']!==_0x6682('0x29')?_0x6682('0x2a'):'WebsiteId')]=_0x4914df[_0x6682('0xb')]?_0x4914df['account']['id']:null;logger[_0x6682('0x2b')](util[_0x6682('0xe')](_0x6682('0x2c'),_0x411ce8,_0x124316['name']));emitChannelQueueInteraction(_0x4914df[_0x6682('0x22')],_0x124316['name'],_0x2b0880,_0x4914df['account'][_0x6682('0x2d')],_0x4914df['message']['id'],!![],_0x1483e5,_0x124316['id']);if(rpc[_0x4914df[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x4914df[_0x6682('0x22')]+_0x6682('0x2e')]['create'](_0x2b0880)['catch'](function(_0x45d713){logger[_0x6682('0x2f')](_0x6682('0x30'));});}}}function stopRouting(_0x39c5bb,_0x181bd7,_0x1291ec,_0x5c305a){if(_0x39c5bb&&_0x181bd7){_0x181bd7[_0x6682('0x1e')]-=0x1;var _0x2a842a={'leaveAt':moment()['format'](_0x6682('0x20')),'acceptAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'reason':_0x6682('0x31')};logger[_0x6682('0x2b')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x39c5bb,_0x181bd7['name']));emitChannelQueueInteraction(_0x1291ec[_0x6682('0x22')],_0x181bd7[_0x6682('0x2d')],_0x1291ec[_0x6682('0x1f')],_0x1291ec['account'][_0x6682('0x2d')],_0x1291ec[_0x6682('0x28')]['id'],![],_0x5c305a,_0x181bd7['id']);if(rpc[_0x1291ec[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x1291ec['channel']+_0x6682('0x2e')][_0x6682('0x32')](_0x39c5bb,_0x2a842a)[_0x6682('0x33')](function(_0x16b0a7){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x3790a7,_0x41d9ee,_0x2bf9ed,_0x46d34d){if(_0x3790a7&&_0x41d9ee){_0x41d9ee['waiting']-=0x1;var _0x3e140f={'leaveAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'exitAt':moment()[_0x6682('0xe')](_0x6682('0x20')),'reason':_0x6682('0x34')};logger['info'](util[_0x6682('0xe')](_0x6682('0x35'),_0x3790a7,_0x41d9ee[_0x6682('0x2d')]));emitChannelQueueInteraction(_0x2bf9ed[_0x6682('0x22')],_0x41d9ee[_0x6682('0x2d')],_0x2bf9ed['body'],_0x2bf9ed[_0x6682('0xb')][_0x6682('0x2d')],_0x2bf9ed['message']['id'],![],_0x46d34d);if(rpc[_0x2bf9ed[_0x6682('0x22')]+_0x6682('0x2e')]){return rpc[_0x2bf9ed['channel']+_0x6682('0x2e')][_0x6682('0x32')](_0x3790a7,_0x3e140f)[_0x6682('0x33')](function(_0x104f85){logger[_0x6682('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x137f2b){return function(_0x437bce){return _0x437bce[_0x6682('0x2d')][_0x6682('0x36')]()===_0x137f2b['toLowerCase']();};}exports[_0x6682('0x37')]=function(_0x538c73,_0x46ae02,_0x18791a,_0x236a3d){return function(_0x1a27a4){try{var _0x452dc2={'name':_0x46ae02[0x0],'timeout':_0x46ae02[0x1]};var _0x3e3f5a=queue[_0x6682('0x0')](_0x452dc2,{'typecast':!![]});if(_0x3e3f5a[_0x6682('0x38')]){logger[_0x6682('0x2f')](_0x6682('0x39'),_0x538c73,_['map'](_0x3e3f5a,_0x6682('0x28'))[_0x6682('0x3a')](',\x20'));_0x1a27a4[_0x6682('0x3b')]();}else{var _0xd83a2a=_['find'](_0x18791a[_0x236a3d[_0x6682('0x22')]+_0x6682('0x3c')],handleFindQueue(_0x452dc2['name']));if(_0xd83a2a){startRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);var _0x470b89=(_0xd83a2a[_0x6682('0x34')]||0xa)*0x3e8;var _0x2db9ca=(_0x452dc2[_0x6682('0x34')]||0x14)*0x3e8;var _0x5a09d1,_0x5e57a1;if(_0x470b89>_0x2db9ca){_0x2db9ca=_0x470b89;}var _0x267ebf=seqqueue['createQueue'](_0x470b89);_0x267ebf['id']=_0x538c73;_0x267ebf[_0x6682('0x3d')]=_0x470b89;_0x267ebf[_0x6682('0x3e')]=_0x2db9ca;_0x267ebf[_0x6682('0x22')]=_0x236a3d[_0x6682('0x22')];_0x18791a[_0x6682('0x3f')][_0x538c73]['on']('end',function(){logger[_0x6682('0x2b')](_0x6682('0x40'),_0x538c73);stopRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);clearTimeout(_0x5a09d1);_0x5a09d1=undefined;_0x267ebf[_0x6682('0x41')](!![]);if(_0x18791a[_0x6682('0x3f')][_0x538c73]){delete _0x18791a['rules'][_0x538c73];}_0x1a27a4[_0x6682('0x3b')]();});_0x18791a[_0x6682('0x3f')][_0x538c73]['on']('complete',function(){if(_0x18791a[_0x6682('0x3f')][_0x538c73]){delete _0x18791a[_0x6682('0x3f')][_0x538c73];}});_0x5a09d1=setTimeout(function(){logger[_0x6682('0x2b')](_0x6682('0x42'),_0x538c73);endRouting(_0x538c73,_0xd83a2a,_0x236a3d,_0x18791a);clearTimeout(_0x5a09d1);_0x267ebf[_0x6682('0x41')](!![]);_0x1a27a4['next']();},_0x2db9ca);switch(_0xd83a2a[_0x6682('0x43')]){case _0x6682('0x44'):strategy['rrmemory'](_0x267ebf,_0xd83a2a,_0x18791a,_0x236a3d);break;default:strategy[_0x6682('0x45')](_0x267ebf,_0xd83a2a,_0x18791a,_0x236a3d);}}else{logger[_0x6682('0x2f')](_0x6682('0x46'),_0x538c73,_0x452dc2[_0x6682('0x2d')]);_0x1a27a4[_0x6682('0x3b')]();}}}catch(_0x108264){console['log'](_0x108264);logger[_0x6682('0x2f')](_0x6682('0x39'),_0x538c73,_0x108264[_0x6682('0x47')]);_0x1a27a4[_0x6682('0x3b')]();}};};
\ No newline at end of file
+var _0x8c1c=['../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','lodash','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c1c,0x85));var _0xc8c1=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0x8c1c[_0x4e9f29];return _0x8e1ab3;};'use strict';var schema=require(_0xc8c1('0x0'));var _=require(_0xc8c1('0x1'));var util=require(_0xc8c1('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xc8c1('0x3'));var Redis=require('ioredis');var config=require(_0xc8c1('0x4'));var logger=require(_0xc8c1('0x5'))(_0xc8c1('0x6'));var strategy=require(_0xc8c1('0x7'));config[_0xc8c1('0x8')]=_[_0xc8c1('0x9')](config[_0xc8c1('0x8')],{'host':_0xc8c1('0xa'),'port':0x18eb});var io=require(_0xc8c1('0xb'))(new Redis(config[_0xc8c1('0x8')]));var attributes=['id','queue_id',_0xc8c1('0xc'),_0xc8c1('0xd'),_0xc8c1('0xe'),_0xc8c1('0xf')];function emit(_0x1f4137,_0x8f849d,_0x58ae04){io['to'](_0x1f4137)[_0xc8c1('0x10')](_0x8f849d,_0x58ae04);}function emitChannelQueueInteraction(_0x109979,_0x3be209,_0x384a33,_0x4859a7,_0x4afff3,_0x3f35fe,_0x1f8c54,_0x2dbe6d){var _0x46c498=_[_0xc8c1('0x11')](_0x384a33);_0x46c498['queue_id']=_0x2dbe6d;_0x46c498[_0xc8c1('0xd')]=_0x3be209;_0x46c498['account']=_0x4859a7;_0x46c498['id']=_0x4afff3;if(_0x3f35fe){_0x1f8c54[util[_0xc8c1('0x12')](_0xc8c1('0x13'),_0x109979)][_0x4afff3]=_['pick'](_0x46c498,attributes);}else{delete _0x1f8c54[util[_0xc8c1('0x12')](_0xc8c1('0x13'),_0x109979)][_0x4afff3];}emit(util['format'](_0xc8c1('0x14'),_0x109979,_0x3be209),util[_0xc8c1('0x12')]('%s_queue_waiting_interaction:%s',_0x109979,_0x3f35fe?'save':_0xc8c1('0x15')),_[_0xc8c1('0x16')](_0x46c498,attributes));}var rpc={'openchannelQueueReport':require(_0xc8c1('0x17')),'mailQueueReport':require(_0xc8c1('0x18')),'chatQueueReport':require(_0xc8c1('0x19')),'smsQueueReport':require(_0xc8c1('0x1a')),'faxQueueReport':require(_0xc8c1('0x1b')),'whatsappQueueReport':require(_0xc8c1('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xc8c1('0x1d')},'timeout':{'type':_0xc8c1('0x1e'),'message':_0xc8c1('0x1f')}});function startRouting(_0x374fd7,_0x4e751b,_0xf4033e,_0x37b9e9){if(_0x374fd7&&_0x4e751b&&_0xf4033e){_0x4e751b[_0xc8c1('0x20')]+=0x1;var _0x3501ed={'uniqueid':_0x374fd7,'from':_0xf4033e[_0xc8c1('0x21')]?_0xf4033e[_0xc8c1('0x21')][_0xc8c1('0xe')]:'','joinAt':moment()[_0xc8c1('0x12')](_0xc8c1('0x22')),'ContactId':_0xf4033e[_0xc8c1('0x23')]?_0xf4033e[_0xc8c1('0x23')]['id']:null,'ListId':_0xf4033e[_0xc8c1('0x24')]?_0xf4033e[_0xc8c1('0x24')]['id']:null};_0x3501ed[_[_0xc8c1('0x25')](_0xf4033e[_0xc8c1('0x26')])+_0xc8c1('0x27')]=_0x4e751b['id']||null;_0x3501ed[_[_0xc8c1('0x25')](_0xf4033e['channel'])+_0xc8c1('0x28')]=_0xf4033e[_0xc8c1('0x29')]?_0xf4033e[_0xc8c1('0x29')]['id']:null;_0x3501ed[_['upperFirst'](_0xf4033e[_0xc8c1('0x26')])+_0xc8c1('0x2a')]=_0xf4033e[_0xc8c1('0x2b')]?_0xf4033e[_0xc8c1('0x2b')]['id']:null;_0x3501ed[_[_0xc8c1('0x25')](_0xf4033e[_0xc8c1('0x26')])+(_0xf4033e['channel']!==_0xc8c1('0x2c')?'AccountId':'WebsiteId')]=_0xf4033e[_0xc8c1('0xc')]?_0xf4033e[_0xc8c1('0xc')]['id']:null;logger[_0xc8c1('0x2d')](util[_0xc8c1('0x12')](_0xc8c1('0x2e'),_0x374fd7,_0x4e751b['name']));emitChannelQueueInteraction(_0xf4033e[_0xc8c1('0x26')],_0x4e751b[_0xc8c1('0x2f')],_0x3501ed,_0xf4033e[_0xc8c1('0xc')]['name'],_0xf4033e[_0xc8c1('0x2b')]['id'],!![],_0x37b9e9,_0x4e751b['id']);if(rpc[_0xf4033e[_0xc8c1('0x26')]+_0xc8c1('0x30')]){return rpc[_0xf4033e[_0xc8c1('0x26')]+_0xc8c1('0x30')][_0xc8c1('0x31')](_0x3501ed)[_0xc8c1('0x32')](function(_0x118b3b){logger[_0xc8c1('0x33')](_0xc8c1('0x34'));});}}}function stopRouting(_0x307fc0,_0x4e96cb,_0x42240e,_0x39783e){if(_0x307fc0&&_0x4e96cb){_0x4e96cb['waiting']-=0x1;var _0x5955e1={'leaveAt':moment()[_0xc8c1('0x12')](_0xc8c1('0x22')),'acceptAt':moment()[_0xc8c1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xc8c1('0x35')};logger['info'](util[_0xc8c1('0x12')](_0xc8c1('0x36'),_0x307fc0,_0x4e96cb['name']));emitChannelQueueInteraction(_0x42240e[_0xc8c1('0x26')],_0x4e96cb[_0xc8c1('0x2f')],_0x42240e['body'],_0x42240e[_0xc8c1('0xc')][_0xc8c1('0x2f')],_0x42240e['message']['id'],![],_0x39783e,_0x4e96cb['id']);if(rpc[_0x42240e['channel']+'QueueReport']){return rpc[_0x42240e['channel']+_0xc8c1('0x30')][_0xc8c1('0x37')](_0x307fc0,_0x5955e1)[_0xc8c1('0x32')](function(_0x2c6462){logger[_0xc8c1('0x33')](_0xc8c1('0x38'));});}}}function endRouting(_0x21fb29,_0x483312,_0x30b79a,_0x2c039d){if(_0x21fb29&&_0x483312){_0x483312[_0xc8c1('0x20')]-=0x1;var _0x378823={'leaveAt':moment()[_0xc8c1('0x12')](_0xc8c1('0x22')),'exitAt':moment()[_0xc8c1('0x12')](_0xc8c1('0x22')),'reason':_0xc8c1('0x39')};logger[_0xc8c1('0x2d')](util[_0xc8c1('0x12')](_0xc8c1('0x3a'),_0x21fb29,_0x483312['name']));emitChannelQueueInteraction(_0x30b79a['channel'],_0x483312[_0xc8c1('0x2f')],_0x30b79a['body'],_0x30b79a[_0xc8c1('0xc')][_0xc8c1('0x2f')],_0x30b79a[_0xc8c1('0x2b')]['id'],![],_0x2c039d);if(rpc[_0x30b79a[_0xc8c1('0x26')]+'QueueReport']){return rpc[_0x30b79a[_0xc8c1('0x26')]+_0xc8c1('0x30')][_0xc8c1('0x37')](_0x21fb29,_0x378823)['catch'](function(_0x438595){logger[_0xc8c1('0x33')](_0xc8c1('0x38'));});}}}function handleFindQueue(_0x26ee79){return function(_0x432ae0){return _0x432ae0[_0xc8c1('0x2f')][_0xc8c1('0x3b')]()===_0x26ee79[_0xc8c1('0x3b')]();};}exports[_0xc8c1('0x3c')]=function(_0xed508b,_0x161e84,_0x5ac547,_0x3ad109){return function(_0x39ccd0){try{var _0xbea543={'name':_0x161e84[0x0],'timeout':_0x161e84[0x1]};var _0x3b3651=queue[_0xc8c1('0x0')](_0xbea543,{'typecast':!![]});if(_0x3b3651[_0xc8c1('0x3d')]){logger[_0xc8c1('0x33')](_0xc8c1('0x3e'),_0xed508b,_[_0xc8c1('0x3f')](_0x3b3651,_0xc8c1('0x2b'))[_0xc8c1('0x40')](',\x20'));_0x39ccd0[_0xc8c1('0x41')]();}else{var _0x5dfd6b=_[_0xc8c1('0x42')](_0x5ac547[_0x3ad109[_0xc8c1('0x26')]+_0xc8c1('0x43')],handleFindQueue(_0xbea543[_0xc8c1('0x2f')]));if(_0x5dfd6b){startRouting(_0xed508b,_0x5dfd6b,_0x3ad109,_0x5ac547);var _0x2f6fa8=(_0x5dfd6b[_0xc8c1('0x39')]||0xa)*0x3e8;var _0x279b1b=(_0xbea543[_0xc8c1('0x39')]||0x14)*0x3e8;var _0x3673a3,_0x3f7c9b;if(_0x2f6fa8>_0x279b1b){_0x279b1b=_0x2f6fa8;}var _0x184082=seqqueue[_0xc8c1('0x44')](_0x2f6fa8);_0x184082['id']=_0xed508b;_0x184082[_0xc8c1('0x45')]=_0x2f6fa8;_0x184082[_0xc8c1('0x46')]=_0x279b1b;_0x184082[_0xc8c1('0x26')]=_0x3ad109[_0xc8c1('0x26')];_0x5ac547[_0xc8c1('0x47')][_0xed508b]['on'](_0xc8c1('0x48'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0xed508b);stopRouting(_0xed508b,_0x5dfd6b,_0x3ad109,_0x5ac547);clearTimeout(_0x3673a3);_0x3673a3=undefined;_0x184082[_0xc8c1('0x49')](!![]);if(_0x5ac547[_0xc8c1('0x47')][_0xed508b]){delete _0x5ac547[_0xc8c1('0x47')][_0xed508b];}_0x39ccd0[_0xc8c1('0x41')]();});_0x5ac547[_0xc8c1('0x47')][_0xed508b]['on'](_0xc8c1('0x4a'),function(){if(_0x5ac547['rules'][_0xed508b]){delete _0x5ac547[_0xc8c1('0x47')][_0xed508b];}});_0x3673a3=setTimeout(function(){logger[_0xc8c1('0x2d')](_0xc8c1('0x4b'),_0xed508b);endRouting(_0xed508b,_0x5dfd6b,_0x3ad109,_0x5ac547);clearTimeout(_0x3673a3);_0x184082[_0xc8c1('0x49')](!![]);_0x39ccd0[_0xc8c1('0x4c')]();},_0x279b1b);switch(_0x5dfd6b['strategy']){case _0xc8c1('0x4d'):strategy[_0xc8c1('0x4d')](_0x184082,_0x5dfd6b,_0x5ac547,_0x3ad109);break;default:strategy[_0xc8c1('0x4e')](_0x184082,_0x5dfd6b,_0x5ac547,_0x3ad109);}}else{logger['error'](_0xc8c1('0x4f'),_0xed508b,_0xbea543['name']);_0x39ccd0[_0xc8c1('0x41')]();}}}catch(_0x29e86d){console['log'](_0x29e86d);logger[_0xc8c1('0x33')]('[%s][QUEUE]\x20%s',_0xed508b,_0x29e86d['stack']);_0x39ccd0[_0xc8c1('0x41')]();}};};
\ No newline at end of file
index 0f9a76c..4b072cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7210=['timeout','handleTimeout','drained','handleDrained','prototype','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busyQueue','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','info','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x7210,0x13e));var _0x0721=function(_0x3c53c7,_0x32a47e){_0x3c53c7=_0x3c53c7-0x0;var _0x51b671=_0x7210[_0x3c53c7];return _0x51b671;};'use strict';var _=require(_0x0721('0x0'));var uuid=require(_0x0721('0x1'));var util=require(_0x0721('0x2'));var logger=require(_0x0721('0x3'))(_0x0721('0x4'));var Agent=function(_0x145e12,_0x36d167,_0x754558,_0x250d04){this[_0x0721('0x5')]=uuid['v4']();this[_0x0721('0x6')]=_0x145e12;this[_0x0721('0x7')]=_0x36d167;this[_0x0721('0x8')]=_0x754558;this[_0x0721('0x4')]=_0x250d04;this[_0x0721('0x6')][_0x0721('0x9')](this[_0x0721('0xa')]['bind'](this),this['handleTimeout'][_0x0721('0xb')](this));this['squeue']['on'](_0x0721('0xc'),this[_0x0721('0xd')][_0x0721('0xb')](this));this[_0x0721('0x6')]['on'](_0x0721('0xe'),this[_0x0721('0xf')][_0x0721('0xb')](this));};Agent[_0x0721('0x10')][_0x0721('0x9')]=function(){this[_0x0721('0x6')]['push'](this[_0x0721('0xa')][_0x0721('0xb')](this),this[_0x0721('0xd')][_0x0721('0xb')](this));};Agent['prototype'][_0x0721('0xf')]=function(){this[_0x0721('0xd')](!![]);};Agent['prototype'][_0x0721('0xa')]=function(_0x1a6dff){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x0721('0x6')]['id'],this[_0x0721('0x7')]['id']);if(_[_0x0721('0x11')](this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']])){logger['info'](_0x0721('0x13'),this[_0x0721('0x6')]['id'],this[_0x0721('0x7')]['id']);setTimeout(this['push'][_0x0721('0xb')](this),0x3e8);}else{if(this[_0x0721('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')][_0x0721('0x12')][this['agent']['id']],this['squeue'][_0x0721('0x14')],![])){this['realtime'][_0x0721('0x12')][this[_0x0721('0x7')]['id']]['busy']=!![];this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']][_0x0721('0x15')]=undefined;util['showNotification'](this[_0x0721('0x5')],this[_0x0721('0x6')]['id'],this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']],null,this[_0x0721('0x4')]);util[_0x0721('0x16')](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')]['agents'][this[_0x0721('0x7')]['id']],_0x0721('0x17')+(this[_0x0721('0x4')][_0x0721('0x18')]?_0x0721('0x19'):''));}else{logger['info'](_0x0721('0x1a'),this['squeue']['id'],this[_0x0721('0x7')]['id']);setTimeout(this[_0x0721('0x9')][_0x0721('0xb')](this),0x3e8);}}};Agent[_0x0721('0x10')][_0x0721('0xd')]=function(_0x2cad07){if(_[_0x0721('0x11')](this[_0x0721('0x8')][_0x0721('0x12')][this[_0x0721('0x7')]['id']])){return logger[_0x0721('0x1b')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x0721('0x7')]['id']);}else{logger[_0x0721('0x1b')](_0x0721('0x1c'),this['squeue']['id'],this[_0x0721('0x7')]['id']);util[_0x0721('0x1d')](this['notificationId'],this['squeue']['id'],this[_0x0721('0x8')]['agents'][this[_0x0721('0x7')]['id']],null,this[_0x0721('0x4')]);this['realtime'][_0x0721('0x12')][this[_0x0721('0x7')]['id']][_0x0721('0x1e')]=![];this[_0x0721('0x8')][_0x0721('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x0721('0x16')](this[_0x0721('0x6')]['id'],this[_0x0721('0x8')]['agents'][this['agent']['id']],_0x2cad07?_0x0721('0x1f'):'TIMEOUT');}if(!_0x2cad07){setTimeout(this[_0x0721('0x9')]['bind'](this),0x3e8);}};function agent(_0x3d704e,_0x5bc551,_0x3447aa,_0x486b83){return new Agent(_0x3d704e,_0x5bc551,_0x3447aa,_0x486b83);}module[_0x0721('0x20')]=agent;
\ No newline at end of file
+var _0x06ea=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','notificationId','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','lodash','uuid','../../../../../config/logger','routing','agent','push','handleRun','handleTimeout','bind','squeue','timeout','drained','handleDrained','prototype','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0x49ac25,_0x2c8e70){var _0x24c878=function(_0x31df84){while(--_0x31df84){_0x49ac25['push'](_0x49ac25['shift']());}};_0x24c878(++_0x2c8e70);}(_0x06ea,0x194));var _0xa06e=function(_0x2a7831,_0x282a0d){_0x2a7831=_0x2a7831-0x0;var _0x3822f7=_0x06ea[_0x2a7831];return _0x3822f7;};'use strict';var _=require(_0xa06e('0x0'));var uuid=require(_0xa06e('0x1'));var util=require('./util');var logger=require(_0xa06e('0x2'))(_0xa06e('0x3'));var Agent=function(_0x244545,_0x41ccdf,_0x4e0ab6,_0x41d978){this['notificationId']=uuid['v4']();this['squeue']=_0x244545;this[_0xa06e('0x4')]=_0x41ccdf;this['realtime']=_0x4e0ab6;this[_0xa06e('0x3')]=_0x41d978;this['squeue'][_0xa06e('0x5')](this[_0xa06e('0x6')]['bind'](this),this[_0xa06e('0x7')][_0xa06e('0x8')](this));this[_0xa06e('0x9')]['on'](_0xa06e('0xa'),this[_0xa06e('0x7')]['bind'](this));this[_0xa06e('0x9')]['on'](_0xa06e('0xb'),this[_0xa06e('0xc')][_0xa06e('0x8')](this));};Agent[_0xa06e('0xd')][_0xa06e('0x5')]=function(){this['squeue'][_0xa06e('0x5')](this[_0xa06e('0x6')][_0xa06e('0x8')](this),this[_0xa06e('0x7')][_0xa06e('0x8')](this));};Agent[_0xa06e('0xd')]['handleDrained']=function(){this[_0xa06e('0x7')](!![]);};Agent[_0xa06e('0xd')]['handleRun']=function(_0x275340){logger[_0xa06e('0xe')](_0xa06e('0xf'),this[_0xa06e('0x9')]['id'],this[_0xa06e('0x4')]['id']);if(_[_0xa06e('0x10')](this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']])){logger[_0xa06e('0xe')](_0xa06e('0x13'),this[_0xa06e('0x9')]['id'],this[_0xa06e('0x4')]['id']);setTimeout(this[_0xa06e('0x5')]['bind'](this),0x3e8);}else{if(this[_0xa06e('0x3')][_0xa06e('0x14')]||util[_0xa06e('0x15')](this[_0xa06e('0x9')]['id'],this['realtime'][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']],this[_0xa06e('0x9')][_0xa06e('0x16')],![])){this[_0xa06e('0x11')][_0xa06e('0x12')][this['agent']['id']][_0xa06e('0x17')]=!![];this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']][_0xa06e('0x18')]=undefined;util[_0xa06e('0x19')](this[_0xa06e('0x1a')],this[_0xa06e('0x9')]['id'],this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']],null,this[_0xa06e('0x3')]);util['writeLog'](this[_0xa06e('0x9')]['id'],this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']],_0xa06e('0x1b')+(this['routing'][_0xa06e('0x14')]?_0xa06e('0x1c'):''));}else{logger[_0xa06e('0xe')](_0xa06e('0x1d'),this[_0xa06e('0x9')]['id'],this[_0xa06e('0x4')]['id']);setTimeout(this[_0xa06e('0x5')][_0xa06e('0x8')](this),0x3e8);}}};Agent[_0xa06e('0xd')][_0xa06e('0x7')]=function(_0x4fb4e1){if(_[_0xa06e('0x10')](this['realtime']['agents'][this[_0xa06e('0x4')]['id']])){return logger[_0xa06e('0xe')](_0xa06e('0x13'),this[_0xa06e('0x9')]['id'],this[_0xa06e('0x4')]['id']);}else{logger[_0xa06e('0xe')](_0xa06e('0x1e'),this[_0xa06e('0x9')]['id'],this[_0xa06e('0x4')]['id']);util[_0xa06e('0x1f')](this[_0xa06e('0x1a')],this[_0xa06e('0x9')]['id'],this[_0xa06e('0x11')]['agents'][this[_0xa06e('0x4')]['id']],null,this['routing']);this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']][_0xa06e('0x17')]=![];this[_0xa06e('0x11')][_0xa06e('0x12')][this[_0xa06e('0x4')]['id']][_0xa06e('0x18')]=undefined;util[_0xa06e('0x20')](this['squeue']['id'],this[_0xa06e('0x11')]['agents'][this[_0xa06e('0x4')]['id']],_0x4fb4e1?_0xa06e('0x21'):_0xa06e('0x22'));}if(!_0x4fb4e1){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x31aff7,_0x28d045,_0x348ab1,_0x564e64){return new Agent(_0x31aff7,_0x28d045,_0x348ab1,_0x564e64);}module['exports']=agent;
\ No newline at end of file
index 40ce03e..ac6cdc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06bf=['bind','drained','handleDrained','prototype','isNil','Agents','length','realtime','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busyQueue','showNotification','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','handleTimeout'];(function(_0x8e1481,_0x3c5d70){var _0xf4ba55=function(_0x12f658){while(--_0x12f658){_0x8e1481['push'](_0x8e1481['shift']());}};_0xf4ba55(++_0x3c5d70);}(_0x06bf,0x105));var _0xf06b=function(_0x3a27ec,_0x57451f){_0x3a27ec=_0x3a27ec-0x0;var _0x4815ad=_0x06bf[_0x3a27ec];return _0x4815ad;};'use strict';var _=require(_0xf06b('0x0'));var uuid=require(_0xf06b('0x1'));var util=require(_0xf06b('0x2'));var logger=require(_0xf06b('0x3'))(_0xf06b('0x4'));var Beepall=function(_0x27110f,_0x445729,_0x2e73d6,_0x50768d){this[_0xf06b('0x5')]=uuid['v4']();this[_0xf06b('0x6')]=_0x27110f;this[_0xf06b('0x7')]=_0x445729;this['realtime']=_0x2e73d6;this[_0xf06b('0x4')]=_0x50768d;this[_0xf06b('0x6')][_0xf06b('0x8')](this[_0xf06b('0x9')]['bind'](this),this[_0xf06b('0xa')][_0xf06b('0xb')](this));this['squeue']['on']('timeout',this[_0xf06b('0xa')][_0xf06b('0xb')](this));this[_0xf06b('0x6')]['on'](_0xf06b('0xc'),this[_0xf06b('0xd')][_0xf06b('0xb')](this));};Beepall[_0xf06b('0xe')][_0xf06b('0x8')]=function(){this['squeue']['push'](this['handleRun'][_0xf06b('0xb')](this),this[_0xf06b('0xa')]['bind'](this));};Beepall['prototype'][_0xf06b('0xd')]=function(_0x43cfec){this['handleTimeout'](!![]);};Beepall[_0xf06b('0xe')][_0xf06b('0x9')]=function(_0x2e9151){var _0x4ae33c=!![];if(!_[_0xf06b('0xf')](this[_0xf06b('0x7')])&&!_[_0xf06b('0xf')](this['queue'][_0xf06b('0x10')])&&this[_0xf06b('0x7')][_0xf06b('0x10')][_0xf06b('0x11')]>0x0){for(var _0x397bcf=0x0,_0xe02b7a;_0x397bcf<this['queue'][_0xf06b('0x10')][_0xf06b('0x11')];_0x397bcf+=0x1){_0xe02b7a=this[_0xf06b('0x7')]['Agents'][_0x397bcf]['id'];if(_[_0xf06b('0xf')](this[_0xf06b('0x12')][_0xf06b('0x13')][_0xe02b7a])){logger[_0xf06b('0x14')](_0xf06b('0x15'),this[_0xf06b('0x6')]['id'],_0xe02b7a);}else{if(util[_0xf06b('0x16')](this[_0xf06b('0x6')]['id'],this[_0xf06b('0x12')]['agents'][_0xe02b7a],this['squeue'][_0xf06b('0x17')],!![])){_0x4ae33c=![];util[_0xf06b('0x18')](this['squeue']['id'],this[_0xf06b('0x12')][_0xf06b('0x13')][_0xe02b7a],_0xf06b('0x19'));this[_0xf06b('0x12')][_0xf06b('0x13')][_0xe02b7a]['busy']=!![];this[_0xf06b('0x12')]['agents'][_0xe02b7a][_0xf06b('0x1a')]=this[_0xf06b('0x7')]['name'];util[_0xf06b('0x1b')](this['notificationId'],this[_0xf06b('0x6')]['id'],this[_0xf06b('0x12')]['agents'][_0xe02b7a],this['queue'],this[_0xf06b('0x4')]);}}}if(_0x4ae33c){logger[_0xf06b('0x14')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this['squeue']['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger[_0xf06b('0x14')](_0xf06b('0x1c'),this['squeue']['id']);setTimeout(this[_0xf06b('0x8')][_0xf06b('0xb')](this),0x3e8);}};Beepall[_0xf06b('0xe')][_0xf06b('0xa')]=function(_0x43821f){if(!_[_0xf06b('0xf')](this['queue'])&&!_[_0xf06b('0xf')](this[_0xf06b('0x7')]['Agents'])){for(var _0x57cae3=0x0,_0x1da835;_0x57cae3<this['queue'][_0xf06b('0x10')][_0xf06b('0x11')];_0x57cae3+=0x1){_0x1da835=this[_0xf06b('0x7')]['Agents'][_0x57cae3]['id'];if(_['isNil'](this[_0xf06b('0x12')][_0xf06b('0x13')][_0x1da835])){logger[_0xf06b('0x14')](_0xf06b('0x15'),this[_0xf06b('0x6')]['id'],_0x1da835);}else{util[_0xf06b('0x1d')](this['notificationId'],this[_0xf06b('0x6')]['id'],this[_0xf06b('0x12')][_0xf06b('0x13')][_0x1da835],this[_0xf06b('0x7')],this[_0xf06b('0x4')]);util[_0xf06b('0x18')](this[_0xf06b('0x6')]['id'],this['realtime'][_0xf06b('0x13')][_0x1da835],_0x43821f?_0xf06b('0x1e'):_0xf06b('0x1f'));this[_0xf06b('0x12')]['agents'][_0x1da835][_0xf06b('0x20')]=![];this[_0xf06b('0x12')][_0xf06b('0x13')][_0x1da835][_0xf06b('0x1a')]=undefined;}}}if(!_0x43821f){setTimeout(this['push'][_0xf06b('0xb')](this),0x3e8);}};function beepall(_0x5398fd,_0x2d28cc,_0x50c181,_0x467321){return new Beepall(_0x5398fd,_0x2d28cc,_0x50c181,_0x467321);}module[_0xf06b('0x21')]=beepall;
\ No newline at end of file
+var _0x1a8f=['name','showNotification','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','exports','lodash','./util','../../../../../config/logger','routing','queue','realtime','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','squeue','handleRun','isNil','Agents','length','agents','info','channel','writeLog','RINGING','busy','busyQueue'];(function(_0x212395,_0x963d8c){var _0x3b04b4=function(_0x5a9dea){while(--_0x5a9dea){_0x212395['push'](_0x212395['shift']());}};_0x3b04b4(++_0x963d8c);}(_0x1a8f,0x87));var _0xf1a8=function(_0x10fd98,_0x5209db){_0x10fd98=_0x10fd98-0x0;var _0x5347d5=_0x1a8f[_0x10fd98];return _0x5347d5;};'use strict';var _=require(_0xf1a8('0x0'));var uuid=require('uuid');var util=require(_0xf1a8('0x1'));var logger=require(_0xf1a8('0x2'))(_0xf1a8('0x3'));var Beepall=function(_0x1b1220,_0x9ea64,_0x5bc9ff,_0x520d7d){this['notificationId']=uuid['v4']();this['squeue']=_0x1b1220;this[_0xf1a8('0x4')]=_0x9ea64;this[_0xf1a8('0x5')]=_0x5bc9ff;this[_0xf1a8('0x3')]=_0x520d7d;this['squeue'][_0xf1a8('0x6')](this['handleRun'][_0xf1a8('0x7')](this),this[_0xf1a8('0x8')][_0xf1a8('0x7')](this));this['squeue']['on'](_0xf1a8('0x9'),this['handleTimeout'][_0xf1a8('0x7')](this));this['squeue']['on'](_0xf1a8('0xa'),this[_0xf1a8('0xb')][_0xf1a8('0x7')](this));};Beepall[_0xf1a8('0xc')]['push']=function(){this[_0xf1a8('0xd')]['push'](this[_0xf1a8('0xe')]['bind'](this),this[_0xf1a8('0x8')][_0xf1a8('0x7')](this));};Beepall[_0xf1a8('0xc')][_0xf1a8('0xb')]=function(_0x2d0965){this[_0xf1a8('0x8')](!![]);};Beepall[_0xf1a8('0xc')][_0xf1a8('0xe')]=function(_0x7438a7){var _0x5854c5=!![];if(!_[_0xf1a8('0xf')](this[_0xf1a8('0x4')])&&!_[_0xf1a8('0xf')](this[_0xf1a8('0x4')][_0xf1a8('0x10')])&&this[_0xf1a8('0x4')][_0xf1a8('0x10')][_0xf1a8('0x11')]>0x0){for(var _0x1fa067=0x0,_0x1734da;_0x1fa067<this[_0xf1a8('0x4')][_0xf1a8('0x10')][_0xf1a8('0x11')];_0x1fa067+=0x1){_0x1734da=this['queue'][_0xf1a8('0x10')][_0x1fa067]['id'];if(_[_0xf1a8('0xf')](this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x1734da])){logger[_0xf1a8('0x13')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf1a8('0xd')]['id'],_0x1734da);}else{if(util['isAgentAvailable'](this[_0xf1a8('0xd')]['id'],this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x1734da],this[_0xf1a8('0xd')][_0xf1a8('0x14')],!![])){_0x5854c5=![];util[_0xf1a8('0x15')](this[_0xf1a8('0xd')]['id'],this[_0xf1a8('0x5')]['agents'][_0x1734da],_0xf1a8('0x16'));this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x1734da][_0xf1a8('0x17')]=!![];this[_0xf1a8('0x5')]['agents'][_0x1734da][_0xf1a8('0x18')]=this[_0xf1a8('0x4')][_0xf1a8('0x19')];util[_0xf1a8('0x1a')](this['notificationId'],this[_0xf1a8('0xd')]['id'],this['realtime'][_0xf1a8('0x12')][_0x1734da],this[_0xf1a8('0x4')],this[_0xf1a8('0x3')]);}}}if(_0x5854c5){logger['info']('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0xf1a8('0xd')]['id']);setTimeout(this[_0xf1a8('0x6')][_0xf1a8('0x7')](this),0x3e8);}}else{logger['info'](_0xf1a8('0x1b'),this['squeue']['id']);setTimeout(this[_0xf1a8('0x6')][_0xf1a8('0x7')](this),0x3e8);}};Beepall['prototype'][_0xf1a8('0x8')]=function(_0x4cf9f1){if(!_['isNil'](this[_0xf1a8('0x4')])&&!_[_0xf1a8('0xf')](this[_0xf1a8('0x4')]['Agents'])){for(var _0x321a9b=0x0,_0x327f16;_0x321a9b<this[_0xf1a8('0x4')]['Agents'][_0xf1a8('0x11')];_0x321a9b+=0x1){_0x327f16=this[_0xf1a8('0x4')][_0xf1a8('0x10')][_0x321a9b]['id'];if(_[_0xf1a8('0xf')](this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x327f16])){logger[_0xf1a8('0x13')](_0xf1a8('0x1c'),this[_0xf1a8('0xd')]['id'],_0x327f16);}else{util[_0xf1a8('0x1d')](this['notificationId'],this[_0xf1a8('0xd')]['id'],this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x327f16],this['queue'],this['routing']);util[_0xf1a8('0x15')](this[_0xf1a8('0xd')]['id'],this[_0xf1a8('0x5')][_0xf1a8('0x12')][_0x327f16],_0x4cf9f1?_0xf1a8('0x1e'):'TIMEOUT');this[_0xf1a8('0x5')]['agents'][_0x327f16][_0xf1a8('0x17')]=![];this[_0xf1a8('0x5')]['agents'][_0x327f16][_0xf1a8('0x18')]=undefined;}}}if(!_0x4cf9f1){setTimeout(this[_0xf1a8('0x6')][_0xf1a8('0x7')](this),0x3e8);}};function beepall(_0x3442d5,_0x27051d,_0x3db203,_0x5bf98c){return new Beepall(_0x3442d5,_0x27051d,_0x3db203,_0x5bf98c);}module[_0xf1a8('0x1f')]=beepall;
\ No newline at end of file
index 8763776..ea05db3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda80=['./beepall','./agent','./rrmemory'];(function(_0x2dbcc8,_0x5e6b9a){var _0x4e0a07=function(_0x79cfc8){while(--_0x79cfc8){_0x2dbcc8['push'](_0x2dbcc8['shift']());}};_0x4e0a07(++_0x5e6b9a);}(_0xda80,0xc2));var _0x0da8=function(_0x24e575,_0x1afed9){_0x24e575=_0x24e575-0x0;var _0x1d23bd=_0xda80[_0x24e575];return _0x1d23bd;};'use strict';module['exports']={'rrmemory':require(_0x0da8('0x0')),'beepall':require(_0x0da8('0x1')),'agent':require(_0x0da8('0x2'))};
\ No newline at end of file
+var _0x0d47=['exports','./rrmemory','./beepall'];(function(_0x3ce6d2,_0x90364d){var _0x4c1dd4=function(_0x3b2e50){while(--_0x3b2e50){_0x3ce6d2['push'](_0x3ce6d2['shift']());}};_0x4c1dd4(++_0x90364d);}(_0x0d47,0x1ce));var _0x70d4=function(_0x4e0e62,_0x22a1af){_0x4e0e62=_0x4e0e62-0x0;var _0x405214=_0x0d47[_0x4e0e62];return _0x405214;};'use strict';module[_0x70d4('0x0')]={'rrmemory':require(_0x70d4('0x1')),'beepall':require(_0x70d4('0x2')),'agent':require('./agent')};
\ No newline at end of file
index 814b1ff..bd24923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcae=['timeout','handleTimeout','drained','handleDrained','prototype','isAgentAvailable','realtime','agents','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','name','showNotification','notificationId','RINGING','handleCheckReject','hideNotification','writeLog','TIMEOUT','busyQueue','lodash','uuid','./util','../../../../../config/logger','routing','queue','intervals','squeue','push','handleRun','bind'];(function(_0x10127f,_0x55f92f){var _0x164d1c=function(_0x443b32){while(--_0x443b32){_0x10127f['push'](_0x10127f['shift']());}};_0x164d1c(++_0x55f92f);}(_0xdcae,0x11d));var _0xedca=function(_0x2c4440,_0x4fe366){_0x2c4440=_0x2c4440-0x0;var _0x20f1dd=_0xdcae[_0x2c4440];return _0x20f1dd;};'use strict';var rr=require('rr');var _=require(_0xedca('0x0'));var uuid=require(_0xedca('0x1'));var util=require(_0xedca('0x2'));var logger=require(_0xedca('0x3'))(_0xedca('0x4'));var RRMemory=function(_0xa49115,_0x8c439c,_0x5bb8be,_0x49ef9a){this['notificationId']=uuid['v4']();this['squeue']=_0xa49115;this[_0xedca('0x5')]=_0x8c439c;this['realtime']=_0x5bb8be;this[_0xedca('0x4')]=_0x49ef9a;this[_0xedca('0x6')]={};this[_0xedca('0x7')][_0xedca('0x8')](this[_0xedca('0x9')][_0xedca('0xa')](this),this['handleTimeout'][_0xedca('0xa')](this),this['module']);this[_0xedca('0x7')]['on'](_0xedca('0xb'),this[_0xedca('0xc')]['bind'](this));this['squeue']['on'](_0xedca('0xd'),this[_0xedca('0xe')][_0xedca('0xa')](this));};RRMemory[_0xedca('0xf')]['push']=function(){this['squeue']['push'](this[_0xedca('0x9')][_0xedca('0xa')](this),this[_0xedca('0xc')][_0xedca('0xa')](this));};RRMemory[_0xedca('0xf')]['handleDrained']=function(_0x3f5f23){this[_0xedca('0xc')](!![]);};RRMemory[_0xedca('0xf')]['handleCheckReject']=function(_0xfd550){if(util[_0xedca('0x10')](this[_0xedca('0x7')]['id'],this[_0xedca('0x11')][_0xedca('0x12')][this['agentId']],this[_0xedca('0x7')][_0xedca('0x13')],!![])){logger[_0xedca('0x14')](_0xedca('0x15'),this[_0xedca('0x7')]['id'],this[_0xedca('0x16')]);clearInterval(this['intervals'][this['agentId']]);_0xfd550[_0xedca('0x17')]();setTimeout(this[_0xedca('0x8')][_0xedca('0xa')](this),0x3e8);}};RRMemory[_0xedca('0xf')][_0xedca('0x9')]=function(_0x163a96){this['agentId']=rr(this['queue']['mapAgentsId']);logger[_0xedca('0x14')](_0xedca('0x18'),this['squeue']['id'],this[_0xedca('0x16')]);if(_[_0xedca('0x19')](this[_0xedca('0x11')][_0xedca('0x12')][this[_0xedca('0x16')]])){logger['info'](_0xedca('0x1a'),this[_0xedca('0x7')]['id'],this['agentId']);_0x163a96[_0xedca('0x17')]();setTimeout(this['push'][_0xedca('0xa')](this),0x3e8);}else{if(util[_0xedca('0x10')](this[_0xedca('0x7')]['id'],this[_0xedca('0x11')][_0xedca('0x12')][this[_0xedca('0x16')]],this[_0xedca('0x7')]['channel'],!![])){this[_0xedca('0x11')][_0xedca('0x12')][this[_0xedca('0x16')]][_0xedca('0x1b')]=!![];this[_0xedca('0x11')][_0xedca('0x12')][this['agentId']]['busyQueue']=this['queue'][_0xedca('0x1c')];util[_0xedca('0x1d')](this[_0xedca('0x1e')],this[_0xedca('0x7')]['id'],this[_0xedca('0x11')][_0xedca('0x12')][this[_0xedca('0x16')]],this[_0xedca('0x5')],this[_0xedca('0x4')]);util['writeLog'](this['squeue']['id'],this[_0xedca('0x11')]['agents'][this[_0xedca('0x16')]],_0xedca('0x1f'));this[_0xedca('0x6')][this[_0xedca('0x16')]]=setInterval(this[_0xedca('0x20')][_0xedca('0xa')](this,_0x163a96),0x3e8);}else{logger[_0xedca('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0xedca('0x7')]['id'],this[_0xedca('0x16')]);_0x163a96[_0xedca('0x17')]();setTimeout(this[_0xedca('0x8')]['bind'](this),0x3e8);}}};RRMemory[_0xedca('0xf')][_0xedca('0xc')]=function(_0x5d3db4){logger[_0xedca('0x14')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this[_0xedca('0x7')]['id'],this['agentId']);if(_['isNil'](this['realtime']['agents'][this[_0xedca('0x16')]])){logger[_0xedca('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xedca('0x7')]['id'],this[_0xedca('0x16')]);}else{clearInterval(this[_0xedca('0x6')][this[_0xedca('0x16')]]);util[_0xedca('0x21')](this[_0xedca('0x1e')],this[_0xedca('0x7')]['id'],this[_0xedca('0x11')][_0xedca('0x12')][this[_0xedca('0x16')]],this[_0xedca('0x5')],this[_0xedca('0x4')]);util[_0xedca('0x22')](this[_0xedca('0x7')]['id'],this['realtime'][_0xedca('0x12')][this[_0xedca('0x16')]],_0xedca('0x23'));this[_0xedca('0x11')]['agents'][this[_0xedca('0x16')]][_0xedca('0x1b')]=![];this[_0xedca('0x11')][_0xedca('0x12')][this['agentId']][_0xedca('0x24')]=undefined;}if(!_0x5d3db4){setTimeout(this[_0xedca('0x8')][_0xedca('0xa')](this),0x3e8);}};function rrmemory(_0x39a649,_0xe4c49b,_0x536110,_0x5a5909){return new RRMemory(_0x39a649,_0xe4c49b,_0x536110,_0x5a5909);}module['exports']=rrmemory;
\ No newline at end of file
+var _0x064f=['writeLog','exports','lodash','uuid','./util','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout','handleDrained','prototype','isAgentAvailable','agents','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','intervals','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','notificationId','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','isNil','hideNotification'];(function(_0x5ddde6,_0x533c9c){var _0x143164=function(_0x4159d0){while(--_0x4159d0){_0x5ddde6['push'](_0x5ddde6['shift']());}};_0x143164(++_0x533c9c);}(_0x064f,0xb6));var _0xf064=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x064f[_0x26462c];return _0x509a42;};'use strict';var rr=require('rr');var _=require(_0xf064('0x0'));var uuid=require(_0xf064('0x1'));var util=require(_0xf064('0x2'));var logger=require('../../../../../config/logger')(_0xf064('0x3'));var RRMemory=function(_0x58fbdc,_0x5a5520,_0x507389,_0x4f1657){this['notificationId']=uuid['v4']();this[_0xf064('0x4')]=_0x58fbdc;this[_0xf064('0x5')]=_0x5a5520;this[_0xf064('0x6')]=_0x507389;this[_0xf064('0x3')]=_0x4f1657;this['intervals']={};this[_0xf064('0x4')][_0xf064('0x7')](this[_0xf064('0x8')][_0xf064('0x9')](this),this['handleTimeout'][_0xf064('0x9')](this),this['module']);this[_0xf064('0x4')]['on']('timeout',this[_0xf064('0xa')][_0xf064('0x9')](this));this[_0xf064('0x4')]['on']('drained',this[_0xf064('0xb')][_0xf064('0x9')](this));};RRMemory['prototype'][_0xf064('0x7')]=function(){this[_0xf064('0x4')][_0xf064('0x7')](this[_0xf064('0x8')]['bind'](this),this[_0xf064('0xa')][_0xf064('0x9')](this));};RRMemory[_0xf064('0xc')][_0xf064('0xb')]=function(_0x3cbfd5){this[_0xf064('0xa')](!![]);};RRMemory[_0xf064('0xc')]['handleCheckReject']=function(_0x1304c0){if(util[_0xf064('0xd')](this['squeue']['id'],this[_0xf064('0x6')][_0xf064('0xe')][this['agentId']],this['squeue'][_0xf064('0xf')],!![])){logger[_0xf064('0x10')](_0xf064('0x11'),this[_0xf064('0x4')]['id'],this[_0xf064('0x12')]);clearInterval(this[_0xf064('0x13')][this[_0xf064('0x12')]]);_0x1304c0[_0xf064('0x14')]();setTimeout(this[_0xf064('0x7')][_0xf064('0x9')](this),0x3e8);}};RRMemory[_0xf064('0xc')][_0xf064('0x8')]=function(_0xaa061c){this[_0xf064('0x12')]=rr(this['queue'][_0xf064('0x15')]);logger[_0xf064('0x10')](_0xf064('0x16'),this[_0xf064('0x4')]['id'],this['agentId']);if(_['isNil'](this[_0xf064('0x6')][_0xf064('0xe')][this['agentId']])){logger[_0xf064('0x10')](_0xf064('0x17'),this[_0xf064('0x4')]['id'],this['agentId']);_0xaa061c[_0xf064('0x14')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util[_0xf064('0xd')](this[_0xf064('0x4')]['id'],this[_0xf064('0x6')]['agents'][this[_0xf064('0x12')]],this[_0xf064('0x4')][_0xf064('0xf')],!![])){this[_0xf064('0x6')][_0xf064('0xe')][this[_0xf064('0x12')]][_0xf064('0x18')]=!![];this[_0xf064('0x6')][_0xf064('0xe')][this[_0xf064('0x12')]][_0xf064('0x19')]=this[_0xf064('0x5')][_0xf064('0x1a')];util[_0xf064('0x1b')](this[_0xf064('0x1c')],this[_0xf064('0x4')]['id'],this['realtime'][_0xf064('0xe')][this[_0xf064('0x12')]],this['queue'],this[_0xf064('0x3')]);util['writeLog'](this[_0xf064('0x4')]['id'],this[_0xf064('0x6')][_0xf064('0xe')][this[_0xf064('0x12')]],_0xf064('0x1d'));this[_0xf064('0x13')][this['agentId']]=setInterval(this[_0xf064('0x1e')][_0xf064('0x9')](this,_0xaa061c),0x3e8);}else{logger[_0xf064('0x10')](_0xf064('0x1f'),this[_0xf064('0x4')]['id'],this[_0xf064('0x12')]);_0xaa061c['done']();setTimeout(this['push'][_0xf064('0x9')](this),0x3e8);}}};RRMemory['prototype'][_0xf064('0xa')]=function(_0x58cc27){logger['info']('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xf064('0x12')]);if(_[_0xf064('0x20')](this[_0xf064('0x6')]['agents'][this['agentId']])){logger[_0xf064('0x10')](_0xf064('0x17'),this[_0xf064('0x4')]['id'],this[_0xf064('0x12')]);}else{clearInterval(this['intervals'][this[_0xf064('0x12')]]);util[_0xf064('0x21')](this['notificationId'],this[_0xf064('0x4')]['id'],this['realtime'][_0xf064('0xe')][this['agentId']],this[_0xf064('0x5')],this[_0xf064('0x3')]);util[_0xf064('0x22')](this[_0xf064('0x4')]['id'],this['realtime'][_0xf064('0xe')][this[_0xf064('0x12')]],'TIMEOUT');this[_0xf064('0x6')][_0xf064('0xe')][this[_0xf064('0x12')]][_0xf064('0x18')]=![];this[_0xf064('0x6')][_0xf064('0xe')][this[_0xf064('0x12')]][_0xf064('0x19')]=undefined;}if(!_0x58cc27){setTimeout(this['push'][_0xf064('0x9')](this),0x3e8);}};function rrmemory(_0x581779,_0x3dcc04,_0x59b6d3,_0x17ce76){return new RRMemory(_0x581779,_0x3dcc04,_0x59b6d3,_0x17ce76);}module[_0xf064('0x23')]=rrmemory;
\ No newline at end of file
index 19d6818..08d048f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['emit','name','user:save','split','\x20interaction','account','notificationSound','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','Pause','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','routing','redis','localhost'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2ef3,0xba));var _0x32ef=function(_0x40fd92,_0x3032b9){_0x40fd92=_0x40fd92-0x0;var _0x1b8a86=_0x2ef3[_0x40fd92];return _0x1b8a86;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var utils=require(_0x32ef('0x2'));var Mustache=require(_0x32ef('0x3'));var Redis=require(_0x32ef('0x4'));var config=require(_0x32ef('0x5'));var logger=require('../../../../../config/logger')(_0x32ef('0x6'));config[_0x32ef('0x7')]=_['defaults'](config[_0x32ef('0x7')],{'host':_0x32ef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2c0089,_0x4bfcf8,_0x367c39){io['to'](_0x2c0089)[_0x32ef('0x9')](_0x4bfcf8,_0x367c39);}function sendNotification(_0x234863,_0x298066,_0x2484a0,_0x2bbb50,_0x28275c,_0x77df79){io['to'](util['format']('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](_0x32ef('0xb'),_0x2bbb50);var _0x1499c2=_0x77df79||{};var _0x5af651=_0x2484a0[_0x32ef('0xc')]('.');var _0x5afcc2={'uniqueid':_0x298066,'channel':_0x5af651[0x0],'id':_0x5af651[0x1],'title':_0x5af651[0x0]+_0x32ef('0xd'),'interactionId':_0x5af651[0x2],'queue':_0x28275c?_0x28275c['name']:null,'sound':_0x1499c2[_0x32ef('0xe')][_0x32ef('0xf')],'shake':_0x1499c2['account']['notificationShake']};try{if(!_0x1499c2[_0x32ef('0x10')]){_0x1499c2['body']={};}if(_0x28275c){_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]=_0x28275c;}else if(_0x1499c2[_0x32ef('0x10')][_0x32ef('0x11')]){delete _0x1499c2['body']['queue'];}_0x5afcc2['msg']=utils[_0x32ef('0x12')](_0x1499c2[_0x32ef('0xe')][_0x32ef('0x13')],_0x1499c2);}catch(_0x53a5ca){_0x5afcc2['msg']=_0x32ef('0x14');logger[_0x32ef('0x15')](util[_0x32ef('0x16')]('[%s][QUEUE]\x20%s',_0x298066,_0x53a5ca[_0x32ef('0x17')]));}io['to'](util[_0x32ef('0x16')]('user:%s',_0x2bbb50[_0x32ef('0xa')]))[_0x32ef('0x9')](util[_0x32ef('0x16')](_0x32ef('0x18'),_0x234863?_0x32ef('0x19'):_0x32ef('0x1a')),_0x5afcc2);}function writeLog(_0x4de441,_0x3c5b78,_0x5cc3ef){return logger[_0x32ef('0x1b')](util[_0x32ef('0x16')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x4de441,_0x3c5b78[_0x32ef('0xa')],_0x5cc3ef));}exports[_0x32ef('0x1c')]=function(_0x5e8898,_0x55f7f2,_0x57f5e5,_0x22f2d7){if(_0x55f7f2[_0x32ef('0x1d')]){writeLog(_0x5e8898,_0x55f7f2,_0x32ef('0x1e'));return![];}if(!_0x55f7f2['online']){writeLog(_0x5e8898,_0x55f7f2,'OFFLINE');return![];}if(_0x55f7f2[_0x57f5e5+_0x32ef('0x1f')]){writeLog(_0x5e8898,_0x55f7f2,'PAUSE');return![];}if(_0x22f2d7&&_0x55f7f2['hasOwnProperty'](_0x57f5e5+_0x32ef('0x20'))&&_0x55f7f2[_0x32ef('0x21')](_0x57f5e5+_0x32ef('0x22'))){if(_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]>0x0&&_0x55f7f2[_0x57f5e5+_0x32ef('0x22')]>=_0x55f7f2[_0x57f5e5+_0x32ef('0x20')]){writeLog(_0x5e8898,_0x55f7f2,_0x57f5e5[_0x32ef('0x23')]()+_0x32ef('0x24'));return![];}}return!![];};exports[_0x32ef('0x25')]=function(_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde){return sendNotification(!![],_0x2f52d7,_0x1335e2,_0xba4b3f,_0x5a88a5,_0xd65fde);};exports[_0x32ef('0x26')]=function(_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207){return sendNotification(![],_0x5a04cd,_0x12de1a,_0x3c569d,_0x30b250,_0x26e207);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x1623=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction'];(function(_0x27d885,_0x5c1d78){var _0x330d18=function(_0x1e1bfc){while(--_0x1e1bfc){_0x27d885['push'](_0x27d885['shift']());}};_0x330d18(++_0x5c1d78);}(_0x1623,0xab));var _0x3162=function(_0x4efbd6,_0x3fe509){_0x4efbd6=_0x4efbd6-0x0;var _0x27963b=_0x1623[_0x4efbd6];return _0x27963b;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0x3162('0x1'));var Redis=require(_0x3162('0x2'));var config=require(_0x3162('0x3'));var logger=require(_0x3162('0x4'))(_0x3162('0x5'));config['redis']=_['defaults'](config[_0x3162('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3162('0x7'))(new Redis(config[_0x3162('0x6')]));function emit(_0x53260d,_0xffe9b6,_0x2dc07e){io['to'](_0x53260d)[_0x3162('0x8')](_0xffe9b6,_0x2dc07e);}function sendNotification(_0x36609e,_0x10d684,_0x382676,_0xe43099,_0x113d28,_0x4bde10){io['to'](util['format'](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))[_0x3162('0x8')](_0x3162('0xb'),_0xe43099);var _0x813d62=_0x4bde10||{};var _0x208f4e=_0x382676[_0x3162('0xc')]('.');var _0x38da60={'uniqueid':_0x10d684,'channel':_0x208f4e[0x0],'id':_0x208f4e[0x1],'title':_0x208f4e[0x0]+_0x3162('0xd'),'interactionId':_0x208f4e[0x2],'queue':_0x113d28?_0x113d28['name']:null,'sound':_0x813d62[_0x3162('0xe')]['notificationSound'],'shake':_0x813d62[_0x3162('0xe')][_0x3162('0xf')]};try{if(!_0x813d62['body']){_0x813d62['body']={};}if(_0x113d28){_0x813d62[_0x3162('0x10')][_0x3162('0x11')]=_0x113d28;}else if(_0x813d62[_0x3162('0x10')]['queue']){delete _0x813d62[_0x3162('0x10')][_0x3162('0x11')];}_0x38da60[_0x3162('0x12')]=utils['getMustacheRender'](_0x813d62[_0x3162('0xe')][_0x3162('0x13')],_0x813d62);}catch(_0x46864e){_0x38da60[_0x3162('0x12')]=_0x3162('0x14');logger[_0x3162('0x15')](util[_0x3162('0x16')]('[%s][QUEUE]\x20%s',_0x10d684,_0x46864e[_0x3162('0x17')]));}io['to'](util[_0x3162('0x16')](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))['emit'](util[_0x3162('0x16')]('notification:%s',_0x36609e?'save':_0x3162('0x18')),_0x38da60);}function writeLog(_0x3e4d23,_0x31946d,_0x523fab){return logger['info'](util[_0x3162('0x16')](_0x3162('0x19'),_0x3e4d23,_0x31946d[_0x3162('0xa')],_0x523fab));}exports[_0x3162('0x1a')]=function(_0x31b27b,_0x14cbba,_0x52ae25,_0x1b2713){if(_0x14cbba['busy']){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1b'));return![];}if(!_0x14cbba[_0x3162('0x1c')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1d'));return![];}if(_0x14cbba[_0x52ae25+_0x3162('0x1e')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1f'));return![];}if(_0x1b2713&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x21'))&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x22'))){if(_0x14cbba[_0x52ae25+_0x3162('0x21')]>0x0&&_0x14cbba[_0x52ae25+_0x3162('0x22')]>=_0x14cbba[_0x52ae25+_0x3162('0x21')]){writeLog(_0x31b27b,_0x14cbba,_0x52ae25[_0x3162('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3162('0x24')]=function(_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567){return sendNotification(!![],_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567);};exports['hideNotification']=function(_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec){return sendNotification(![],_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec);};exports['writeLog']=writeLog;
\ No newline at end of file
index c96bcdc..d53a72e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6898=['../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','next','getMustacheRender','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','lodash','./utils'];(function(_0x2b7bbf,_0x49a225){var _0x24d744=function(_0x2c3e15){while(--_0x2c3e15){_0x2b7bbf['push'](_0x2b7bbf['shift']());}};_0x24d744(++_0x49a225);}(_0x6898,0x11b));var _0x8689=function(_0x2f19c2,_0x58ba82){_0x2f19c2=_0x2f19c2-0x0;var _0x50af88=_0x6898[_0x2f19c2];return _0x50af88;};'use strict';var schema=require(_0x8689('0x0'));var sh=require('shelljs');var _=require(_0x8689('0x1'));var utils=require(_0x8689('0x2'));var logger=require(_0x8689('0x3'))(_0x8689('0x4'));var system=schema({'command':{'type':_0x8689('0x5'),'required':!![],'message':_0x8689('0x6')}});exports[_0x8689('0x7')]=function(_0x5038aa,_0x141989){return function(_0xb6de5a){try{var _0x2c723e={'command':_0x141989[0x0]};var _0x4e776d=system[_0x8689('0x0')](_0x2c723e,{'typecast':!![]});if(_0x4e776d[_0x8689('0x8')]){logger[_0x8689('0x9')](_0x8689('0xa'),_0x5038aa,_[_0x8689('0xb')](_0x4e776d,_0x8689('0xc'))['join'](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5038aa);_0xb6de5a[_0x8689('0xd')]();}else{var _0x573c98=this;var _0x24e15a=utils[_0x8689('0xe')](_0x141989[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x5038aa,_0x24e15a);sh[_0x8689('0xf')](_[_0x8689('0x10')](_0x24e15a),function(_0x5d5b56,_0x395872){logger[_0x8689('0x11')](_0x8689('0x12'),_0x5038aa,_0x5d5b56);if(_0x5d5b56==0x0){var _0x5b928d=_0x395872[_0x8689('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x141989[0x1])||_['isEmpty'](_0x141989[0x1])){logger['info'](_0x8689('0x14'),_0x5038aa);_0x573c98[_0x8689('0x15')][_0x141989[0x1]]=_0x5b928d;}else{logger[_0x8689('0x11')](_0x8689('0x16'),_0x5038aa,_0x141989[0x1],_0x5b928d);_0x573c98[_0x8689('0x15')][_0x141989[0x1]]=_0x5b928d;}}_0xb6de5a[_0x8689('0xd')]();});}}catch(_0x5bd579){logger[_0x8689('0x9')]('[%s][SYSTEM]\x20%s',_0x5038aa,_[_0x8689('0x17')](_0x5bd579)?JSON[_0x8689('0x18')](_0x5bd579):_0x5bd579);logger['info'](_0x8689('0x19'),_0x5038aa);_0xb6de5a[_0x8689('0xd')]();}};};
\ No newline at end of file
+var _0x89c3=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x34d621,_0x335cf7){var _0x31a7fb=function(_0x145e5d){while(--_0x145e5d){_0x34d621['push'](_0x34d621['shift']());}};_0x31a7fb(++_0x335cf7);}(_0x89c3,0xff));var _0x389c=function(_0x3e465e,_0x4bca5a){_0x3e465e=_0x3e465e-0x0;var _0x32089f=_0x89c3[_0x3e465e];return _0x32089f;};'use strict';var schema=require(_0x389c('0x0'));var sh=require(_0x389c('0x1'));var _=require(_0x389c('0x2'));var utils=require(_0x389c('0x3'));var logger=require(_0x389c('0x4'))(_0x389c('0x5'));var system=schema({'command':{'type':_0x389c('0x6'),'required':!![],'message':_0x389c('0x7')}});exports['consequence']=function(_0x3742ad,_0x5d2bcb){return function(_0x283ff9){try{var _0x4bece6={'command':_0x5d2bcb[0x0]};var _0x51f5f5=system[_0x389c('0x0')](_0x4bece6,{'typecast':!![]});if(_0x51f5f5['length']){logger['error'](_0x389c('0x8'),_0x3742ad,_[_0x389c('0x9')](_0x51f5f5,_0x389c('0xa'))[_0x389c('0xb')](',\x20'));logger[_0x389c('0xc')](_0x389c('0xd'),_0x3742ad);_0x283ff9[_0x389c('0xe')]();}else{var _0xd58faa=this;var _0x13b41=utils['getMustacheRender'](_0x5d2bcb[0x0],this);logger[_0x389c('0xc')](_0x389c('0xf'),_0x3742ad,_0x13b41);sh[_0x389c('0x10')](_[_0x389c('0x11')](_0x13b41),function(_0x37f595,_0x4e0344){logger['info'](_0x389c('0x12'),_0x3742ad,_0x37f595);if(_0x37f595==0x0){var _0x1de33a=_0x4e0344[_0x389c('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x5d2bcb[0x1])||_[_0x389c('0x14')](_0x5d2bcb[0x1])){logger['info'](_0x389c('0x15'),_0x3742ad);_0xd58faa[_0x389c('0x16')][_0x5d2bcb[0x1]]=_0x1de33a;}else{logger['info'](_0x389c('0x17'),_0x3742ad,_0x5d2bcb[0x1],_0x1de33a);_0xd58faa[_0x389c('0x16')][_0x5d2bcb[0x1]]=_0x1de33a;}}_0x283ff9[_0x389c('0xe')]();});}}catch(_0x5c0756){logger[_0x389c('0x18')](_0x389c('0x8'),_0x3742ad,_[_0x389c('0x19')](_0x5c0756)?JSON[_0x389c('0x1a')](_0x5c0756):_0x5c0756);logger[_0x389c('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3742ad);_0x283ff9['next']();}};};
\ No newline at end of file
index afbcdf8..74b107b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x505e=['Interaction','interaction','then','info','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel'];(function(_0x5000e3,_0x9da855){var _0x258342=function(_0x877658){while(--_0x877658){_0x5000e3['push'](_0x5000e3['shift']());}};_0x258342(++_0x9da855);}(_0x505e,0x1b8));var _0xe505=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x505e[_0x44216d];return _0xeca523;};'use strict';var schema=require(_0xe505('0x0'));var _=require(_0xe505('0x1'));var rpc={'chatInteraction':require(_0xe505('0x2')),'openchannelInteraction':require(_0xe505('0x3')),'smsInteraction':require(_0xe505('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xe505('0x5')),'whatsappInteraction':require(_0xe505('0x6'))};var logger=require(_0xe505('0x7'))(_0xe505('0x8'));var tag=schema({'tag':{'type':_0xe505('0x9'),'required':!![],'message':_0xe505('0xa')}});exports[_0xe505('0xb')]=function(_0x359e7a,_0x591cdd,_0x3c3fa2,_0x1d0a9c){return function(_0x39e3b5){try{var _0x1bb9b9={'tag':_0x591cdd[0x0]};var _0x508ea2=tag[_0xe505('0x0')](_0x1bb9b9,{'typecast':!![]});if(_0x508ea2['length']){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,_['map'](_0x508ea2,_0xe505('0xe'))[_0xe505('0xf')](',\x20'));logger['info'](_0xe505('0x10'),_0x359e7a);_0x39e3b5[_0xe505('0x11')]();}else{var _0x22b4a2={'ids':[_0x591cdd[0x0]]};if(rpc[_0x1d0a9c[_0xe505('0x12')]+_0xe505('0x13')]){rpc[_0x1d0a9c['channel']+_0xe505('0x13')]['addTags'](_0x1d0a9c[_0xe505('0x14')]['id'],_0x22b4a2)[_0xe505('0x15')](function(_0x5b2627){logger[_0xe505('0x16')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x359e7a,_0x591cdd[0x1],_0x1d0a9c[_0xe505('0x12')],_0x1d0a9c[_0xe505('0x14')]['id']);})[_0xe505('0x17')](function(_0x54c184){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,JSON[_0xe505('0x18')](_0x54c184));logger[_0xe505('0x16')](_0xe505('0x10'),_0x359e7a);})[_0xe505('0x19')](function(){_0x39e3b5['next']();});}}}catch(_0x57bc7f){logger[_0xe505('0xc')](_0xe505('0xd'),_0x359e7a,_[_0xe505('0x1a')](_0x57bc7f)?JSON[_0xe505('0x18')](_0x57bc7f):_0x57bc7f);logger[_0xe505('0x16')](_0xe505('0x10'),_0x359e7a);_0x39e3b5[_0xe505('0x11')]();}};};
\ No newline at end of file
+var _0x0e45=['interaction','catch','stringify','finally','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','validate','error','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0e45,0x164));var _0x50e4=function(_0x1eed8c,_0x45676f){_0x1eed8c=_0x1eed8c-0x0;var _0x489837=_0x0e45[_0x1eed8c];return _0x489837;};'use strict';var schema=require('validate');var _=require(_0x50e4('0x0'));var rpc={'chatInteraction':require(_0x50e4('0x1')),'openchannelInteraction':require(_0x50e4('0x2')),'smsInteraction':require(_0x50e4('0x3')),'mailInteraction':require(_0x50e4('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x50e4('0x5'))};var logger=require(_0x50e4('0x6'))('routing');var tag=schema({'tag':{'type':_0x50e4('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x334a09,_0x214194,_0x1c1159,_0x33634a){return function(_0x462f0e){try{var _0x196991={'tag':_0x214194[0x0]};var _0x5371fc=tag[_0x50e4('0x8')](_0x196991,{'typecast':!![]});if(_0x5371fc['length']){logger[_0x50e4('0x9')](_0x50e4('0xa'),_0x334a09,_[_0x50e4('0xb')](_0x5371fc,'message')[_0x50e4('0xc')](',\x20'));logger[_0x50e4('0xd')](_0x50e4('0xe'),_0x334a09);_0x462f0e[_0x50e4('0xf')]();}else{var _0x3d9fbe={'ids':[_0x214194[0x0]]};if(rpc[_0x33634a[_0x50e4('0x10')]+_0x50e4('0x11')]){rpc[_0x33634a['channel']+_0x50e4('0x11')]['addTags'](_0x33634a[_0x50e4('0x12')]['id'],_0x3d9fbe)['then'](function(_0x14f474){logger[_0x50e4('0xd')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x334a09,_0x214194[0x1],_0x33634a[_0x50e4('0x10')],_0x33634a[_0x50e4('0x12')]['id']);})[_0x50e4('0x13')](function(_0x5d5e82){logger[_0x50e4('0x9')](_0x50e4('0xa'),_0x334a09,JSON[_0x50e4('0x14')](_0x5d5e82));logger[_0x50e4('0xd')](_0x50e4('0xe'),_0x334a09);})[_0x50e4('0x15')](function(){_0x462f0e[_0x50e4('0xf')]();});}}}catch(_0x483c30){logger['error'](_0x50e4('0xa'),_0x334a09,_['isObject'](_0x483c30)?JSON[_0x50e4('0x14')](_0x483c30):_0x483c30);logger[_0x50e4('0xd')](_0x50e4('0xe'),_0x334a09);_0x462f0e[_0x50e4('0xf')]();}};};
\ No newline at end of file
index 2ab5bb4..487e57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x533a6c,_0x2cd0a8){var _0x2ff772=function(_0x323696){while(--_0x323696){_0x533a6c['push'](_0x533a6c['shift']());}};_0x2ff772(++_0x2cd0a8);}(_0xe706,0xa3));var _0x6e70=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0xe706[_0x1f6f84];return _0x177f40;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x267f0d,_0x19b299){var _0x4dc718=function(_0x2e6df2){while(--_0x2e6df2){_0x267f0d['push'](_0x267f0d['shift']());}};_0x4dc718(++_0x19b299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
index f928b3e..d2c9f4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79ad=['faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','push','slice','split','dialogflowv2','join','amazonlex','tag','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','agent\x20not\x20found','values','chatQueues','name','paused','waiting','mailQueues','available','loggedIn','openchannelQueues','smsQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions'];(function(_0x11fda4,_0x465374){var _0x188e31=function(_0x50e774){while(--_0x50e774){_0x11fda4['push'](_0x11fda4['shift']());}};_0x188e31(++_0x465374);}(_0x79ad,0x16e));var _0xd79a=function(_0x59ff01,_0x295452){_0x59ff01=_0x59ff01-0x0;var _0x16cf73=_0x79ad[_0x59ff01];return _0x16cf73;};'use strict';var _=require(_0xd79a('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0xd79a('0x1'));var BPromise=require(_0xd79a('0x2'));var uuid=require(_0xd79a('0x3'));var config=require(_0xd79a('0x4'));var logger=require(_0xd79a('0x5'))(_0xd79a('0x6'));var rpc={'openchannelQueueReport':require(_0xd79a('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xd79a('0x8')),'faxQueueReport':require(_0xd79a('0x9')),'whatsappQueueReport':require(_0xd79a('0xa'))};var RuleEngine=require(_0xd79a('0xb'));function getId(_0x12bf8c,_0x263519,_0x2d3ec9){return util[_0xd79a('0xc')](_0xd79a('0xd'),_0x12bf8c,_0x263519||0x0,_0x2d3ec9||0x0);}function getIntervals(_0x3080b0,_0x28c947){var _0x28e5b8=[];if(!_[_0xd79a('0xe')](_0x28c947['IntervalId'])&&!_[_0xd79a('0xe')](_0x3080b0[_0x28c947[_0xd79a('0xf')]])&&!_[_0xd79a('0xe')](_0x3080b0[_0x28c947[_0xd79a('0xf')]][_0xd79a('0x10')])){_0x28e5b8=_[_0xd79a('0x11')](_0x3080b0[_0x28c947[_0xd79a('0xf')]][_0xd79a('0x10')],_0xd79a('0x12'));}else if(!_['isNil'](_0x28c947['interval'])){_0x28e5b8=[_0x28c947[_0xd79a('0x12')]];}return _0x28e5b8;}exports['listen']=function(_0x38d6c4){_0x38d6c4[_0xd79a('0x13')]={};return new BPromise(function(_0x329e2c,_0x2e41c3){var _0x38a582={'Start':function(_0x1e4cd5){var _0x114292=this;return new Promise(function(_0xad42bf,_0x34bad7){if(_0x1e4cd5){try{var _0x28b1a6=[];var _0x262e34=getId(_0x1e4cd5[_0xd79a('0x14')],_0x1e4cd5['message']?_0x1e4cd5[_0xd79a('0x15')]['id']:0x0,_0x1e4cd5[_0xd79a('0x16')]?_0x1e4cd5[_0xd79a('0x16')]['id']:0x0);if(_0x1e4cd5[_0xd79a('0x17')]&&_[_0xd79a('0x18')](_0x1e4cd5[_0xd79a('0x17')])&&_0x1e4cd5[_0xd79a('0x17')][_0xd79a('0x19')]){for(var _0x3f4352=0x0;_0x3f4352<_0x1e4cd5[_0xd79a('0x17')][_0xd79a('0x19')];_0x3f4352+=0x1){var _0x51a253=_0x1e4cd5[_0xd79a('0x17')][_0x3f4352];if(fs['existsSync'](path['join'](__dirname,'applications',_0x51a253[_0xd79a('0x1a')]+_0xd79a('0x1b')))){var _0x33d1de=[];switch(_0x51a253['app'][_0xd79a('0x1c')]()){case _0xd79a('0x1d'):var _0x42bd98=_0x51a253[_0xd79a('0x1e')]['split'](',');if(_0x1e4cd5['channel']==='mail'){_0x33d1de['push'](_0x42bd98[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x42bd98[0x1]);_0x33d1de['push'](_0x42bd98['slice'](0x2,_0x42bd98[_0xd79a('0x19')])['join'](','));}else{_0x33d1de['push'](_0x42bd98[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x42bd98[_0xd79a('0x20')](0x1,_0x42bd98['length'])['join'](','));}break;case'dialogflow':var _0x47e2c9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de['push'](_0x47e2c9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x47e2c9[0x1]);_0x33d1de['push'](_0x47e2c9['slice'](0x2,_0x47e2c9[_0xd79a('0x19')])['join'](','));break;case _0xd79a('0x22'):var _0x4b36b9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x1]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x2]);_0x33d1de[_0xd79a('0x1f')](_0x4b36b9[0x3]);_0x33d1de['push'](_0x4b36b9[_0xd79a('0x20')](0x4,_0x4b36b9[_0xd79a('0x19')])[_0xd79a('0x23')](','));break;case _0xd79a('0x24'):var _0x1203e9=_0x51a253[_0xd79a('0x1e')][_0xd79a('0x21')](',');_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x0]);_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x1]);_0x33d1de['push'](_0x1203e9[0x2]);_0x33d1de[_0xd79a('0x1f')](_0x1203e9[0x3]);_0x33d1de['push'](_0x1203e9[_0xd79a('0x20')](0x4,_0x1203e9['length'])[_0xd79a('0x23')](','));break;case _0xd79a('0x15'):_0x33d1de[_0xd79a('0x1f')](_0x51a253['appdata']);break;case _0xd79a('0x25'):_0x33d1de['push'](_0x51a253['TagId']);_0x33d1de['push'](_0x51a253[_0xd79a('0x1e')]);break;default:_0x33d1de=_['isNil'](_0x51a253[_0xd79a('0x1e')])?[]:_0x51a253['appdata'][_0xd79a('0x21')](',');}var _0x5072dc={'id':util[_0xd79a('0xc')](_0xd79a('0x26'),_0x262e34,_0x51a253['id'],_0x51a253[_0xd79a('0x1a')]),'condition':require(_0xd79a('0x27'))[_0xd79a('0x28')](_0x262e34,getIntervals(_0x38d6c4[_0xd79a('0x29')],_0x51a253),_0x38d6c4),'consequence':require(_0xd79a('0x2a')+_0x51a253[_0xd79a('0x1a')])['consequence'](_0x262e34,_0x33d1de,_0x38d6c4,_0x1e4cd5),'p':_0x51a253[_0xd79a('0x2b')]||0x0};logger[_0xd79a('0x2c')](_0xd79a('0x2d'),_0x5072dc['id'],'on\x20interval',getIntervals(_0x38d6c4['intervals'],_0x51a253)['join'](_0xd79a('0x2e')));_0x28b1a6[_0xd79a('0x1f')](_0x5072dc);}else{logger['error'](_0xd79a('0x2f'),path[_0xd79a('0x23')](__dirname,_0xd79a('0x17'),_0x51a253[_0xd79a('0x1a')]+_0xd79a('0x1b')));}}_0x38d6c4[_0xd79a('0x13')][_0x262e34]=new RuleEngine(_0x28b1a6);_0x38d6c4[_0xd79a('0x13')][_0x262e34]['execute'](_0x1e4cd5,function(_0x2d95ab){logger[_0xd79a('0x2c')](_0xd79a('0x30'),JSON[_0xd79a('0x31')](_0x2d95ab[_0xd79a('0x32')]));if(_0x38d6c4[_0xd79a('0x13')][_0x262e34]){_0x38d6c4['rules'][_0x262e34][_0xd79a('0x33')](_0xd79a('0x34'));}});return _0xad42bf({'code':0xc8,'message':_0x1e4cd5});}else{logger[_0xd79a('0x2c')](_0xd79a('0x35'));return _0xad42bf({'code':0xc8,'message':_0x1e4cd5});}}catch(_0x14f220){logger[_0xd79a('0x36')](_0x14f220['stack']);return _0x34bad7(_0x114292[_0xd79a('0x36')](0x1f4,_0x14f220));}}return _0x34bad7(_0xd79a('0x37'));});},'AcceptMessage':function(_0x247b15){var _0x114ac0=this;return new Promise(function(_0x463ef4,_0x27213e){if(_0x247b15[_0xd79a('0x38')]&&_0x247b15['agent']['id']){if(_0x38d6c4[_0xd79a('0x39')][_0x247b15[_0xd79a('0x38')]['id']]){_0x38d6c4['agents'][_0x247b15['agent']['id']][_0xd79a('0x3a')]=![];_0x38d6c4[_0xd79a('0x39')][_0x247b15[_0xd79a('0x38')]['id']][_0xd79a('0x3b')]=undefined;}}if(_0x247b15['message']&&_0x247b15[_0xd79a('0x15')]['id']){try{var _0x11ffee=getId(_0x247b15[_0xd79a('0x14')],_0x247b15['message']?_0x247b15[_0xd79a('0x15')]['id']:0x0,_0x247b15[_0xd79a('0x16')]?_0x247b15[_0xd79a('0x16')]['id']:0x0);if(_0x38d6c4[_0xd79a('0x13')][_0x11ffee]){_0x38d6c4[_0xd79a('0x13')][_0x11ffee][_0xd79a('0x33')](_0xd79a('0x3c'));if(rpc[_0x247b15['channel']+_0xd79a('0x3d')]){rpc[_0x247b15[_0xd79a('0x14')]+_0xd79a('0x3d')][_0xd79a('0x3e')](_0x11ffee,{'UserId':_0x247b15[_0xd79a('0x15')][_0xd79a('0x3f')]})['catch'](function(_0x582385){logger[_0xd79a('0x36')](_0xd79a('0x40'));});}}return _0x463ef4({'code':0xc8,'message':_0x247b15});}catch(_0x40edeb){logger[_0xd79a('0x36')](_0x40edeb[_0xd79a('0x41')]);return _0x27213e(_0x114ac0['error'](0x1f4,_0x40edeb));}}logger[_0xd79a('0x36')](_0xd79a('0x42'));return _0x27213e(_0x114ac0['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x583a3e){var _0x1ae409=this;return new Promise(function(_0x5de436,_0x1f3d84){if(_0x583a3e[_0xd79a('0x38')]&&_0x583a3e['agent']['id']){try{if(_0x38d6c4['agents'][_0x583a3e['agent']['id']]){_0x38d6c4[_0xd79a('0x39')][_0x583a3e[_0xd79a('0x38')]['id']]['busy']=![];_0x38d6c4[_0xd79a('0x39')][_0x583a3e['agent']['id']][_0xd79a('0x3b')]=undefined;}return _0x5de436({'code':0xc8,'message':_0x583a3e});}catch(_0x373df3){logger[_0xd79a('0x36')](_0x373df3[_0xd79a('0x41')]);return _0x1f3d84(_0x1ae409['error'](0x1f4,_0x373df3));}}logger[_0xd79a('0x36')](_0xd79a('0x42'));return _0x1f3d84(_0x1ae409['error'](0x1f4,_0xd79a('0x42')));});},'AbandonInteraction':function(_0x462d35){var _0x576226=this;return new Promise(function(_0x17a97c,_0xeec62d){if(_0x462d35['channel']&&_0x462d35['interaction']&&_0x462d35[_0xd79a('0x16')]['id']){try{var _0x506b37=getId(_0x462d35[_0xd79a('0x14')],_0x462d35[_0xd79a('0x15')]?_0x462d35[_0xd79a('0x15')]['id']:0x0,_0x462d35['interaction']?_0x462d35[_0xd79a('0x16')]['id']:0x0);if(_0x38d6c4[_0xd79a('0x13')][_0x506b37]){_0x38d6c4[_0xd79a('0x13')][_0x506b37][_0xd79a('0x33')]('end');}return _0x17a97c({'code':0xc8,'message':_0x462d35});}catch(_0x4b8ab4){logger[_0xd79a('0x36')](_0x4b8ab4[_0xd79a('0x41')]);return _0xeec62d(_0x576226[_0xd79a('0x36')](0x1f4,_0x4b8ab4));}}logger['error'](_0xd79a('0x42'));return _0xeec62d(_0x576226[_0xd79a('0x36')](0x1f4,_0xd79a('0x42')));});},'AgentCapacity':function(_0x5a4cc4){var _0x43a06c=this;return new Promise(function(_0x5380f9,_0x44aa2a){if(_0x38d6c4[_0xd79a('0x39')][_0xd79a('0x43')](_0x5a4cc4['id'])){for(var _0xeb5c82 in _0x5a4cc4[_0xd79a('0x44')]){if(_0x5a4cc4[_0xd79a('0x44')][_0xd79a('0x43')](_0xeb5c82)){if(_0x38d6c4[_0xd79a('0x39')][_0x5a4cc4['id']]['hasOwnProperty'](_0xeb5c82+'CurrentCapacity')){_0x38d6c4['agents'][_0x5a4cc4['id']][_0xeb5c82+'CurrentCapacity']=parseInt(_0x5a4cc4[_0xd79a('0x44')][_0xeb5c82],0xa);}}}_0x38d6c4['agents'][_0x5a4cc4['id']]['updateRealtime']();return _0x5380f9({'code':0xc8,'message':_0x38d6c4['agents'][_0x5a4cc4['id']]});}else{return _0x44aa2a(_0x43a06c[_0xd79a('0x36')](0x1f4,_0xd79a('0x45')));}});},'Agents':function(_0x191b5b){return new Promise(function(_0x1fbb1f,_0x37433a){var _0x596462=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x39')]);_0x1fbb1f({'count':_0x596462[_0xd79a('0x19')],'rows':_0x596462});});},'ChatQueues':function(_0x5b2108){return new Promise(function(_0x20dd2b,_0x1c5df6){var _0x233763=[];for(var _0x584e7d in _0x38d6c4[_0xd79a('0x47')]){if(_0x38d6c4[_0xd79a('0x47')][_0xd79a('0x43')](_0x584e7d)){var _0x1337fb=_0x38d6c4[_0xd79a('0x47')][_0x584e7d];var _0x36f118={'id':_0x1337fb['id'],'available':_0x1337fb['available'],'loggedIn':_0x1337fb['loggedIn'],'name':_0x1337fb[_0xd79a('0x48')],'paused':_0x1337fb[_0xd79a('0x49')],'waiting':_0x1337fb[_0xd79a('0x4a')]};_0x233763[_0xd79a('0x1f')](_0x36f118);}}_0x20dd2b({'count':_0x233763[_0xd79a('0x19')],'rows':_0x233763});});},'MailQueues':function(_0x1e95e8){return new Promise(function(_0x3e08f0,_0x387528){var _0x5b67a9=[];for(var _0x3841f0 in _0x38d6c4['mailQueues']){if(_0x38d6c4[_0xd79a('0x4b')][_0xd79a('0x43')](_0x3841f0)){var _0x48785d=_0x38d6c4[_0xd79a('0x4b')][_0x3841f0];var _0x2c1272={'id':_0x48785d['id'],'available':_0x48785d[_0xd79a('0x4c')],'loggedIn':_0x48785d[_0xd79a('0x4d')],'name':_0x48785d[_0xd79a('0x48')],'paused':_0x48785d[_0xd79a('0x49')],'waiting':_0x48785d[_0xd79a('0x4a')]};_0x5b67a9[_0xd79a('0x1f')](_0x2c1272);}}_0x3e08f0({'count':_0x5b67a9[_0xd79a('0x19')],'rows':_0x5b67a9});});},'OpenchannelQueues':function(_0x3057d8){return new Promise(function(_0x47d3fe,_0x1decd3){var _0x38016d=[];for(var _0x449add in _0x38d6c4[_0xd79a('0x4e')]){if(_0x38d6c4[_0xd79a('0x4e')]['hasOwnProperty'](_0x449add)){var _0x489b5c=_0x38d6c4[_0xd79a('0x4e')][_0x449add];var _0x25e434={'id':_0x489b5c['id'],'available':_0x489b5c[_0xd79a('0x4c')],'loggedIn':_0x489b5c[_0xd79a('0x4d')],'name':_0x489b5c[_0xd79a('0x48')],'paused':_0x489b5c['paused'],'waiting':_0x489b5c[_0xd79a('0x4a')]};_0x38016d[_0xd79a('0x1f')](_0x25e434);}}_0x47d3fe({'count':_0x38016d[_0xd79a('0x19')],'rows':_0x38016d});});},'SmsQueues':function(_0x202097){return new Promise(function(_0x45750e,_0x1a6009){var _0x19c276=[];for(var _0x175b0e in _0x38d6c4[_0xd79a('0x4f')]){if(_0x38d6c4[_0xd79a('0x4f')][_0xd79a('0x43')](_0x175b0e)){var _0x15b102=_0x38d6c4[_0xd79a('0x4f')][_0x175b0e];var _0x121374={'id':_0x15b102['id'],'available':_0x15b102[_0xd79a('0x4c')],'loggedIn':_0x15b102['loggedIn'],'name':_0x15b102[_0xd79a('0x48')],'paused':_0x15b102[_0xd79a('0x49')],'waiting':_0x15b102[_0xd79a('0x4a')]};_0x19c276['push'](_0x121374);}}_0x45750e({'count':_0x19c276[_0xd79a('0x19')],'rows':_0x19c276});});},'FaxQueues':function(_0x1409da){return new Promise(function(_0x36decf,_0x307931){var _0xdcb406=[];for(var _0x10df78 in _0x38d6c4['faxQueues']){if(_0x38d6c4['faxQueues'][_0xd79a('0x43')](_0x10df78)){var _0x18ef8b=_0x38d6c4['faxQueues'][_0x10df78];var _0x2aca56={'id':_0x18ef8b['id'],'available':_0x18ef8b[_0xd79a('0x4c')],'loggedIn':_0x18ef8b[_0xd79a('0x4d')],'name':_0x18ef8b[_0xd79a('0x48')],'paused':_0x18ef8b[_0xd79a('0x49')],'waiting':_0x18ef8b[_0xd79a('0x4a')]};_0xdcb406[_0xd79a('0x1f')](_0x2aca56);}}_0x36decf({'count':_0xdcb406[_0xd79a('0x19')],'rows':_0xdcb406});});},'WhatsappQueues':function(_0x250218){return new Promise(function(_0xc611d5,_0x18d324){var _0x5b7da0=[];for(var _0x341230 in _0x38d6c4[_0xd79a('0x50')]){if(_0x38d6c4['whatsappQueues']['hasOwnProperty'](_0x341230)){var _0x5a352d=_0x38d6c4[_0xd79a('0x50')][_0x341230];var _0xf2a355={'id':_0x5a352d['id'],'available':_0x5a352d[_0xd79a('0x4c')],'loggedIn':_0x5a352d[_0xd79a('0x4d')],'name':_0x5a352d['name'],'paused':_0x5a352d[_0xd79a('0x49')],'waiting':_0x5a352d[_0xd79a('0x4a')]};_0x5b7da0['push'](_0xf2a355);}}_0xc611d5({'count':_0x5b7da0[_0xd79a('0x19')],'rows':_0x5b7da0});});},'ChatQueuesWaitingInteractions':function(_0x4214ff){return new Promise(function(_0x443085,_0x32370a){var _0x191cac=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x51')]);_0x443085({'count':_0x191cac[_0xd79a('0x19')],'rows':_0x191cac});});},'MailQueuesWaitingInteractions':function(_0x2f3cc7){return new Promise(function(_0x1adfda,_0x1c591c){var _0x3673e3=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x52')]);_0x1adfda({'count':_0x3673e3[_0xd79a('0x19')],'rows':_0x3673e3});});},'OpenchannelQueuesWaitingInteractions':function(_0x10d4de){return new Promise(function(_0x2b419a,_0x1831d2){var _0x42a623=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x53')]);_0x2b419a({'count':_0x42a623[_0xd79a('0x19')],'rows':_0x42a623});});},'SmsQueuesWaitingInteractions':function(_0x30694c){return new Promise(function(_0x39c9fb,_0x26563a){var _0x53c446=_['values'](_0x38d6c4['smsQueuesWaitingInteractions']);_0x39c9fb({'count':_0x53c446[_0xd79a('0x19')],'rows':_0x53c446});});},'FaxQueuesWaitingInteractions':function(_0x84c610){return new Promise(function(_0x2d1dc2,_0x282a66){var _0x2eb143=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x54')]);_0x2d1dc2({'count':_0x2eb143[_0xd79a('0x19')],'rows':_0x2eb143});});},'WhatsappQueuesWaitingInteractions':function(_0x438d94){return new Promise(function(_0x4a3fac,_0xda6f8f){var _0x21669c=_[_0xd79a('0x46')](_0x38d6c4[_0xd79a('0x55')]);_0x4a3fac({'count':_0x21669c['length'],'rows':_0x21669c});});}};var _0xc078b0=jayson[_0xd79a('0x56')](_0x38a582)[_0xd79a('0x57')]();_0xc078b0['on'](_0xd79a('0x36'),function(_0x5321c2){logger[_0xd79a('0x36')](JSON['stringify'](_0x5321c2));return _0x2e41c3(_0x5321c2);});_0xc078b0['listen'](0x232c,_0xd79a('0x58'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x329e2c(_0xd79a('0x59')+0x232c);});});};
\ No newline at end of file
+var _0xb071=['IntervalId','Intervals','interval','rules','message','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','appdata','split','channel','push','slice','dialogflow','amazonlex','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','log','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','isNil'];(function(_0x420d32,_0x53b0bf){var _0x408dce=function(_0x1bfa15){while(--_0x1bfa15){_0x420d32['push'](_0x420d32['shift']());}};_0x408dce(++_0x53b0bf);}(_0xb071,0xa3));var _0x1b07=function(_0x591053,_0x523072){_0x591053=_0x591053-0x0;var _0x31ab80=_0xb071[_0x591053];return _0x31ab80;};'use strict';var _=require('lodash');var util=require(_0x1b07('0x0'));var path=require(_0x1b07('0x1'));var fs=require('fs');var jayson=require(_0x1b07('0x2'));var BPromise=require(_0x1b07('0x3'));var uuid=require(_0x1b07('0x4'));var config=require(_0x1b07('0x5'));var logger=require(_0x1b07('0x6'))(_0x1b07('0x7'));var rpc={'openchannelQueueReport':require(_0x1b07('0x8')),'mailQueueReport':require(_0x1b07('0x9')),'chatQueueReport':require(_0x1b07('0xa')),'smsQueueReport':require(_0x1b07('0xb')),'faxQueueReport':require(_0x1b07('0xc')),'whatsappQueueReport':require(_0x1b07('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x22526c,_0x33acd0,_0x58bf66){return util['format']('%s.%s.%s',_0x22526c,_0x33acd0||0x0,_0x58bf66||0x0);}function getIntervals(_0x26833a,_0x573b6a){var _0x53947c=[];if(!_[_0x1b07('0xe')](_0x573b6a['IntervalId'])&&!_['isNil'](_0x26833a[_0x573b6a[_0x1b07('0xf')]])&&!_[_0x1b07('0xe')](_0x26833a[_0x573b6a[_0x1b07('0xf')]][_0x1b07('0x10')])){_0x53947c=_['map'](_0x26833a[_0x573b6a[_0x1b07('0xf')]][_0x1b07('0x10')],_0x1b07('0x11'));}else if(!_[_0x1b07('0xe')](_0x573b6a['interval'])){_0x53947c=[_0x573b6a['interval']];}return _0x53947c;}exports['listen']=function(_0x53ae2e){_0x53ae2e[_0x1b07('0x12')]={};return new BPromise(function(_0x562a1a,_0x254af1){var _0x3d8e1a={'Start':function(_0x43e330){var _0xf804bd=this;return new Promise(function(_0x443d3c,_0x4cf2f8){if(_0x43e330){try{var _0x3e82bd=[];var _0x5d402d=getId(_0x43e330['channel'],_0x43e330[_0x1b07('0x13')]?_0x43e330[_0x1b07('0x13')]['id']:0x0,_0x43e330[_0x1b07('0x14')]?_0x43e330[_0x1b07('0x14')]['id']:0x0);if(_0x43e330[_0x1b07('0x15')]&&_[_0x1b07('0x16')](_0x43e330[_0x1b07('0x15')])&&_0x43e330[_0x1b07('0x15')][_0x1b07('0x17')]){for(var _0x4d7e32=0x0;_0x4d7e32<_0x43e330['applications'][_0x1b07('0x17')];_0x4d7e32+=0x1){var _0x2456e1=_0x43e330['applications'][_0x4d7e32];if(fs['existsSync'](path[_0x1b07('0x18')](__dirname,'applications',_0x2456e1[_0x1b07('0x19')]+_0x1b07('0x1a')))){var _0x35c593=[];switch(_0x2456e1['app'][_0x1b07('0x1b')]()){case _0x1b07('0x1c'):var _0x18ff49=_0x2456e1[_0x1b07('0x1d')][_0x1b07('0x1e')](',');if(_0x43e330[_0x1b07('0x1f')]==='mail'){_0x35c593['push'](_0x18ff49[0x0]);_0x35c593['push'](_0x18ff49[0x1]);_0x35c593[_0x1b07('0x20')](_0x18ff49[_0x1b07('0x21')](0x2,_0x18ff49[_0x1b07('0x17')])[_0x1b07('0x18')](','));}else{_0x35c593[_0x1b07('0x20')](_0x18ff49[0x0]);_0x35c593[_0x1b07('0x20')](_0x18ff49[_0x1b07('0x21')](0x1,_0x18ff49[_0x1b07('0x17')])['join'](','));}break;case _0x1b07('0x22'):var _0x2c093e=_0x2456e1[_0x1b07('0x1d')][_0x1b07('0x1e')](',');_0x35c593[_0x1b07('0x20')](_0x2c093e[0x0]);_0x35c593[_0x1b07('0x20')](_0x2c093e[0x1]);_0x35c593[_0x1b07('0x20')](_0x2c093e['slice'](0x2,_0x2c093e[_0x1b07('0x17')])[_0x1b07('0x18')](','));break;case'dialogflowv2':var _0x53596b=_0x2456e1[_0x1b07('0x1d')]['split'](',');_0x35c593[_0x1b07('0x20')](_0x53596b[0x0]);_0x35c593[_0x1b07('0x20')](_0x53596b[0x1]);_0x35c593[_0x1b07('0x20')](_0x53596b[0x2]);_0x35c593[_0x1b07('0x20')](_0x53596b[0x3]);_0x35c593[_0x1b07('0x20')](_0x53596b[_0x1b07('0x21')](0x4,_0x53596b[_0x1b07('0x17')])[_0x1b07('0x18')](','));break;case _0x1b07('0x23'):var _0x1e86ad=_0x2456e1['appdata'][_0x1b07('0x1e')](',');_0x35c593[_0x1b07('0x20')](_0x1e86ad[0x0]);_0x35c593[_0x1b07('0x20')](_0x1e86ad[0x1]);_0x35c593[_0x1b07('0x20')](_0x1e86ad[0x2]);_0x35c593[_0x1b07('0x20')](_0x1e86ad[0x3]);_0x35c593['push'](_0x1e86ad[_0x1b07('0x21')](0x4,_0x1e86ad[_0x1b07('0x17')])[_0x1b07('0x18')](','));break;case'message':_0x35c593[_0x1b07('0x20')](_0x2456e1[_0x1b07('0x1d')]);break;case _0x1b07('0x24'):_0x35c593['push'](_0x2456e1[_0x1b07('0x25')]);_0x35c593[_0x1b07('0x20')](_0x2456e1[_0x1b07('0x1d')]);break;default:_0x35c593=_[_0x1b07('0xe')](_0x2456e1['appdata'])?[]:_0x2456e1[_0x1b07('0x1d')][_0x1b07('0x1e')](',');}var _0x540e18={'id':util[_0x1b07('0x26')](_0x1b07('0x27'),_0x5d402d,_0x2456e1['id'],_0x2456e1[_0x1b07('0x19')]),'condition':require(_0x1b07('0x28'))[_0x1b07('0x29')](_0x5d402d,getIntervals(_0x53ae2e[_0x1b07('0x2a')],_0x2456e1),_0x53ae2e),'consequence':require('./applications/'+_0x2456e1[_0x1b07('0x19')])[_0x1b07('0x2b')](_0x5d402d,_0x35c593,_0x53ae2e,_0x43e330),'p':_0x2456e1[_0x1b07('0x2c')]||0x0};logger[_0x1b07('0x2d')]('Push\x20new\x20rule',_0x540e18['id'],_0x1b07('0x2e'),getIntervals(_0x53ae2e[_0x1b07('0x2a')],_0x2456e1)[_0x1b07('0x18')](_0x1b07('0x2f')));_0x3e82bd['push'](_0x540e18);}else{logger[_0x1b07('0x30')](_0x1b07('0x31'),path['join'](__dirname,_0x1b07('0x15'),_0x2456e1[_0x1b07('0x19')]+_0x1b07('0x1a')));}}_0x53ae2e['rules'][_0x5d402d]=new RuleEngine(_0x3e82bd);_0x53ae2e[_0x1b07('0x12')][_0x5d402d][_0x1b07('0x32')](_0x43e330,function(_0x2d5322){logger[_0x1b07('0x2d')]('Applications\x20executed',JSON[_0x1b07('0x33')](_0x2d5322['matchPath']));if(_0x53ae2e[_0x1b07('0x12')][_0x5d402d]){_0x53ae2e[_0x1b07('0x12')][_0x5d402d][_0x1b07('0x34')]('complete');}});return _0x443d3c({'code':0xc8,'message':_0x43e330});}else{logger[_0x1b07('0x2d')](_0x1b07('0x35'));return _0x443d3c({'code':0xc8,'message':_0x43e330});}}catch(_0x1b98c6){logger[_0x1b07('0x30')](_0x1b98c6['stack']);return _0x4cf2f8(_0xf804bd['error'](0x1f4,_0x1b98c6));}}return _0x4cf2f8(_0x1b07('0x36'));});},'AcceptMessage':function(_0xcda515){var _0x119b14=this;return new Promise(function(_0x211e98,_0x22056e){if(_0xcda515[_0x1b07('0x37')]&&_0xcda515[_0x1b07('0x37')]['id']){if(_0x53ae2e['agents'][_0xcda515['agent']['id']]){_0x53ae2e[_0x1b07('0x38')][_0xcda515['agent']['id']]['busy']=![];_0x53ae2e['agents'][_0xcda515['agent']['id']][_0x1b07('0x39')]=undefined;}}if(_0xcda515['message']&&_0xcda515[_0x1b07('0x13')]['id']){try{var _0x3596bd=getId(_0xcda515['channel'],_0xcda515[_0x1b07('0x13')]?_0xcda515[_0x1b07('0x13')]['id']:0x0,_0xcda515[_0x1b07('0x14')]?_0xcda515[_0x1b07('0x14')]['id']:0x0);if(_0x53ae2e[_0x1b07('0x12')][_0x3596bd]){_0x53ae2e['rules'][_0x3596bd][_0x1b07('0x34')]('end');if(rpc[_0xcda515['channel']+_0x1b07('0x3a')]){rpc[_0xcda515[_0x1b07('0x1f')]+'QueueReport']['update'](_0x3596bd,{'UserId':_0xcda515['message'][_0x1b07('0x3b')]})[_0x1b07('0x3c')](function(_0xa38777){logger[_0x1b07('0x30')](_0x1b07('0x3d'));});}}return _0x211e98({'code':0xc8,'message':_0xcda515});}catch(_0x2c37e3){logger[_0x1b07('0x30')](_0x2c37e3[_0x1b07('0x3e')]);return _0x22056e(_0x119b14[_0x1b07('0x30')](0x1f4,_0x2c37e3));}}logger['error']('message\x20is\x20empty');return _0x22056e(_0x119b14[_0x1b07('0x30')](0x1f4,_0x1b07('0x3f')));});},'RejectMessage':function(_0x227140){var _0x37d238=this;return new Promise(function(_0x73572c,_0x16b17f){if(_0x227140[_0x1b07('0x37')]&&_0x227140[_0x1b07('0x37')]['id']){try{if(_0x53ae2e[_0x1b07('0x38')][_0x227140[_0x1b07('0x37')]['id']]){_0x53ae2e[_0x1b07('0x38')][_0x227140[_0x1b07('0x37')]['id']]['busy']=![];_0x53ae2e[_0x1b07('0x38')][_0x227140[_0x1b07('0x37')]['id']][_0x1b07('0x39')]=undefined;}return _0x73572c({'code':0xc8,'message':_0x227140});}catch(_0x4cadcb){logger[_0x1b07('0x30')](_0x4cadcb[_0x1b07('0x3e')]);return _0x16b17f(_0x37d238['error'](0x1f4,_0x4cadcb));}}logger[_0x1b07('0x30')](_0x1b07('0x3f'));return _0x16b17f(_0x37d238[_0x1b07('0x30')](0x1f4,_0x1b07('0x3f')));});},'AbandonInteraction':function(_0x5d8adf){var _0x8bb22d=this;return new Promise(function(_0x3ba9d6,_0x5c8ba2){if(_0x5d8adf[_0x1b07('0x1f')]&&_0x5d8adf[_0x1b07('0x14')]&&_0x5d8adf[_0x1b07('0x14')]['id']){try{var _0x125548=getId(_0x5d8adf[_0x1b07('0x1f')],_0x5d8adf[_0x1b07('0x13')]?_0x5d8adf['message']['id']:0x0,_0x5d8adf[_0x1b07('0x14')]?_0x5d8adf[_0x1b07('0x14')]['id']:0x0);if(_0x53ae2e[_0x1b07('0x12')][_0x125548]){_0x53ae2e['rules'][_0x125548][_0x1b07('0x34')]('end');}return _0x3ba9d6({'code':0xc8,'message':_0x5d8adf});}catch(_0x52a4b3){logger[_0x1b07('0x30')](_0x52a4b3['stack']);return _0x5c8ba2(_0x8bb22d[_0x1b07('0x30')](0x1f4,_0x52a4b3));}}logger[_0x1b07('0x30')](_0x1b07('0x3f'));return _0x5c8ba2(_0x8bb22d[_0x1b07('0x30')](0x1f4,_0x1b07('0x3f')));});},'AgentCapacity':function(_0x14ec1e){var _0x1dffad=this;return new Promise(function(_0x27340c,_0xc31871){if(_0x53ae2e[_0x1b07('0x38')][_0x1b07('0x40')](_0x14ec1e['id'])){for(var _0x23a7e9 in _0x14ec1e[_0x1b07('0x41')]){if(_0x14ec1e[_0x1b07('0x41')][_0x1b07('0x40')](_0x23a7e9)){if(_0x53ae2e[_0x1b07('0x38')][_0x14ec1e['id']][_0x1b07('0x40')](_0x23a7e9+_0x1b07('0x42'))){_0x53ae2e[_0x1b07('0x38')][_0x14ec1e['id']][_0x23a7e9+'CurrentCapacity']=parseInt(_0x14ec1e[_0x1b07('0x41')][_0x23a7e9],0xa);}}}_0x53ae2e[_0x1b07('0x38')][_0x14ec1e['id']][_0x1b07('0x43')]();return _0x27340c({'code':0xc8,'message':_0x53ae2e[_0x1b07('0x38')][_0x14ec1e['id']]});}else{return _0xc31871(_0x1dffad[_0x1b07('0x30')](0x1f4,_0x1b07('0x44')));}});},'Agents':function(_0x38ab78){return new Promise(function(_0xe372a0,_0x591e04){var _0x4053cb=_['values'](_0x53ae2e['agents']);_0xe372a0({'count':_0x4053cb[_0x1b07('0x17')],'rows':_0x4053cb});});},'ChatQueues':function(_0x183857){return new Promise(function(_0x2bc1d4,_0x2aedf9){var _0x527a4a=[];for(var _0x2ccfe6 in _0x53ae2e[_0x1b07('0x45')]){if(_0x53ae2e['chatQueues'][_0x1b07('0x40')](_0x2ccfe6)){var _0x4458ea=_0x53ae2e[_0x1b07('0x45')][_0x2ccfe6];var _0x4a9de6={'id':_0x4458ea['id'],'available':_0x4458ea[_0x1b07('0x46')],'loggedIn':_0x4458ea[_0x1b07('0x47')],'name':_0x4458ea[_0x1b07('0x48')],'paused':_0x4458ea[_0x1b07('0x49')],'waiting':_0x4458ea[_0x1b07('0x4a')]};_0x527a4a[_0x1b07('0x20')](_0x4a9de6);}}_0x2bc1d4({'count':_0x527a4a[_0x1b07('0x17')],'rows':_0x527a4a});});},'MailQueues':function(_0xdd940c){return new Promise(function(_0x5bdd0a,_0x1dbb0c){var _0x3de633=[];for(var _0x2b3820 in _0x53ae2e['mailQueues']){if(_0x53ae2e[_0x1b07('0x4b')][_0x1b07('0x40')](_0x2b3820)){var _0x1af879=_0x53ae2e[_0x1b07('0x4b')][_0x2b3820];var _0x3497a9={'id':_0x1af879['id'],'available':_0x1af879['available'],'loggedIn':_0x1af879[_0x1b07('0x47')],'name':_0x1af879[_0x1b07('0x48')],'paused':_0x1af879[_0x1b07('0x49')],'waiting':_0x1af879['waiting']};_0x3de633[_0x1b07('0x20')](_0x3497a9);}}_0x5bdd0a({'count':_0x3de633[_0x1b07('0x17')],'rows':_0x3de633});});},'OpenchannelQueues':function(_0x1b2d06){return new Promise(function(_0x83c63f,_0x5b54c6){var _0x2b269a=[];for(var _0x18aa69 in _0x53ae2e[_0x1b07('0x4c')]){if(_0x53ae2e[_0x1b07('0x4c')][_0x1b07('0x40')](_0x18aa69)){var _0x16994f=_0x53ae2e[_0x1b07('0x4c')][_0x18aa69];var _0x37fe8d={'id':_0x16994f['id'],'available':_0x16994f['available'],'loggedIn':_0x16994f['loggedIn'],'name':_0x16994f[_0x1b07('0x48')],'paused':_0x16994f['paused'],'waiting':_0x16994f[_0x1b07('0x4a')]};_0x2b269a[_0x1b07('0x20')](_0x37fe8d);}}_0x83c63f({'count':_0x2b269a[_0x1b07('0x17')],'rows':_0x2b269a});});},'SmsQueues':function(_0x5ec759){return new Promise(function(_0x178e79,_0x1e0a97){var _0x1255de=[];for(var _0x1bea42 in _0x53ae2e[_0x1b07('0x4d')]){if(_0x53ae2e[_0x1b07('0x4d')][_0x1b07('0x40')](_0x1bea42)){var _0x5c1f56=_0x53ae2e[_0x1b07('0x4d')][_0x1bea42];var _0x485081={'id':_0x5c1f56['id'],'available':_0x5c1f56[_0x1b07('0x46')],'loggedIn':_0x5c1f56[_0x1b07('0x47')],'name':_0x5c1f56['name'],'paused':_0x5c1f56['paused'],'waiting':_0x5c1f56[_0x1b07('0x4a')]};_0x1255de['push'](_0x485081);}}_0x178e79({'count':_0x1255de[_0x1b07('0x17')],'rows':_0x1255de});});},'FaxQueues':function(_0x575e94){return new Promise(function(_0xc0da,_0x378964){var _0x5cfdc6=[];for(var _0x306769 in _0x53ae2e[_0x1b07('0x4e')]){if(_0x53ae2e[_0x1b07('0x4e')]['hasOwnProperty'](_0x306769)){var _0x5cd24d=_0x53ae2e[_0x1b07('0x4e')][_0x306769];var _0x594ce9={'id':_0x5cd24d['id'],'available':_0x5cd24d[_0x1b07('0x46')],'loggedIn':_0x5cd24d[_0x1b07('0x47')],'name':_0x5cd24d['name'],'paused':_0x5cd24d[_0x1b07('0x49')],'waiting':_0x5cd24d[_0x1b07('0x4a')]};_0x5cfdc6[_0x1b07('0x20')](_0x594ce9);}}_0xc0da({'count':_0x5cfdc6['length'],'rows':_0x5cfdc6});});},'WhatsappQueues':function(_0x61739e){return new Promise(function(_0x4c7162,_0x48906f){var _0x2cb0fe=[];for(var _0x29f448 in _0x53ae2e['whatsappQueues']){if(_0x53ae2e[_0x1b07('0x4f')][_0x1b07('0x40')](_0x29f448)){var _0x550ca6=_0x53ae2e[_0x1b07('0x4f')][_0x29f448];var _0x306064={'id':_0x550ca6['id'],'available':_0x550ca6[_0x1b07('0x46')],'loggedIn':_0x550ca6[_0x1b07('0x47')],'name':_0x550ca6[_0x1b07('0x48')],'paused':_0x550ca6[_0x1b07('0x49')],'waiting':_0x550ca6[_0x1b07('0x4a')]};_0x2cb0fe[_0x1b07('0x20')](_0x306064);}}_0x4c7162({'count':_0x2cb0fe['length'],'rows':_0x2cb0fe});});},'ChatQueuesWaitingInteractions':function(_0x16059e){return new Promise(function(_0x38b263,_0x31c61c){var _0x5b598c=_[_0x1b07('0x50')](_0x53ae2e[_0x1b07('0x51')]);_0x38b263({'count':_0x5b598c[_0x1b07('0x17')],'rows':_0x5b598c});});},'MailQueuesWaitingInteractions':function(_0x602e12){return new Promise(function(_0xe7d93b,_0x29da64){var _0x2d841f=_[_0x1b07('0x50')](_0x53ae2e[_0x1b07('0x52')]);_0xe7d93b({'count':_0x2d841f[_0x1b07('0x17')],'rows':_0x2d841f});});},'OpenchannelQueuesWaitingInteractions':function(_0x3e8090){return new Promise(function(_0x2c08d1,_0x5b03af){var _0xde434c=_[_0x1b07('0x50')](_0x53ae2e['openchannelQueuesWaitingInteractions']);_0x2c08d1({'count':_0xde434c[_0x1b07('0x17')],'rows':_0xde434c});});},'SmsQueuesWaitingInteractions':function(_0x8427b1){return new Promise(function(_0x5dd188,_0x3ba3c8){var _0x331e5d=_[_0x1b07('0x50')](_0x53ae2e[_0x1b07('0x53')]);_0x5dd188({'count':_0x331e5d[_0x1b07('0x17')],'rows':_0x331e5d});});},'FaxQueuesWaitingInteractions':function(_0x306327){return new Promise(function(_0x430d59,_0x4280b1){var _0x2e8224=_[_0x1b07('0x50')](_0x53ae2e['faxQueuesWaitingInteractions']);_0x430d59({'count':_0x2e8224[_0x1b07('0x17')],'rows':_0x2e8224});});},'WhatsappQueuesWaitingInteractions':function(_0x398d79){return new Promise(function(_0x89d592,_0x709975){var _0x4b792e=_[_0x1b07('0x50')](_0x53ae2e[_0x1b07('0x54')]);_0x89d592({'count':_0x4b792e[_0x1b07('0x17')],'rows':_0x4b792e});});}};var _0x2c691a=jayson['server'](_0x3d8e1a)[_0x1b07('0x55')]();_0x2c691a['on'](_0x1b07('0x30'),function(_0x239c89){logger[_0x1b07('0x30')](JSON[_0x1b07('0x33')](_0x239c89));return _0x254af1(_0x239c89);});_0x2c691a[_0x1b07('0x56')](0x232c,'127.0.0.1',function(){console[_0x1b07('0x57')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x562a1a(_0x1b07('0x58')+0x232c);});});};
\ No newline at end of file
index 8c8bf27..ef75e30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08f9=['\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','join'];(function(_0x198504,_0x26a434){var _0x45f7db=function(_0x4170f3){while(--_0x4170f3){_0x198504['push'](_0x198504['shift']());}};_0x45f7db(++_0x26a434);}(_0x08f9,0xed));var _0x908f=function(_0xb9e6ab,_0x460290){_0xb9e6ab=_0xb9e6ab-0x0;var _0x19c667=_0x08f9[_0xb9e6ab];return _0x19c667;};'use strict';var util=require(_0x908f('0x0'));var BPromise=require(_0x908f('0x1'));var jayson=require(_0x908f('0x2'));var _=require(_0x908f('0x3'));var logger=require(_0x908f('0x4'))(_0x908f('0x5'));var client=jayson[_0x908f('0x6')]['http']({'port':0x232a});function request(_0x2bd7ec,_0x33a171){return new BPromise(function(_0x18e4c3,_0x178078){return client[_0x908f('0x7')](_0x2bd7ec,_0x33a171)[_0x908f('0x8')](function(_0x220b49){if(_0x220b49['error']){return _0x178078(_0x220b49[_0x908f('0x9')][_0x908f('0xa')]);}else{return _0x18e4c3(_0x220b49['result']);}})[_0x908f('0xb')](function(_0x5d0fe7){return _0x178078(_0x5d0fe7);});});}exports['condition']=function(_0x5359ab,_0x131dfd,_0x41fbaa){return function(_0x21d167){if(_0x41fbaa['rules']&&!_0x41fbaa[_0x908f('0xc')][_0x5359ab]){logger[_0x908f('0xd')](_0x908f('0xe'),_0x5359ab);return _0x21d167['stop']();}var _0x38b9a5=[];for(var _0x582520=0x0;_0x582520<_0x131dfd[_0x908f('0xf')];_0x582520+=0x1){_0x38b9a5[_0x908f('0x10')](request('Command',{'command':util[_0x908f('0x11')](_0x908f('0x12'),_0x131dfd[_0x582520])})['then'](function(_0x20a435){return _0x20a435&&_0x20a435[_0x908f('0xa')]&&_0x20a435[_0x908f('0xa')][_0x908f('0x13')]('true')>=0x0?!![]:![];})['catch'](function(_0x1ea4d7){logger[_0x908f('0x9')](_0x908f('0x14'),_0x5359ab,_0x131dfd[_0x582520]);}));}BPromise[_0x908f('0x15')](_0x38b9a5)[_0x908f('0x8')](function(_0x315a9c){var _0x1dc649=_[_0x908f('0x16')](_0x315a9c);logger[_0x908f('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0x5359ab,_0x131dfd[_0x908f('0x17')](_0x908f('0x18')),_0x1dc649);_0x21d167[_0x908f('0x19')](_0x1dc649);})[_0x908f('0xb')](function(_0x34f4d3){console['log'](_0x34f4d3);logger['error'](_0x908f('0x1a'),_0x5359ab,_0x131dfd[_0x908f('0x17')](_0x908f('0x18')),_0x34f4d3[_0x908f('0x1b')]);_0x21d167[_0x908f('0x1c')]();});};};
\ No newline at end of file
+var _0xc351=['[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','jayson/promise','lodash','http','request','then','error','message','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','format','iftime\x20%s','indexOf'];(function(_0x15af32,_0x2f834c){var _0x57dbf3=function(_0x1a7af2){while(--_0x1a7af2){_0x15af32['push'](_0x15af32['shift']());}};_0x57dbf3(++_0x2f834c);}(_0xc351,0x19f));var _0x1c35=function(_0x5a6e32,_0x573b46){_0x5a6e32=_0x5a6e32-0x0;var _0x168e07=_0xc351[_0x5a6e32];return _0x168e07;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x1c35('0x0'));var _=require(_0x1c35('0x1'));var logger=require('../../../config/logger')('routing');var client=jayson['client'][_0x1c35('0x2')]({'port':0x232a});function request(_0x4a00fc,_0x551909){return new BPromise(function(_0xc2152a,_0x13155d){return client[_0x1c35('0x3')](_0x4a00fc,_0x551909)[_0x1c35('0x4')](function(_0x5e021c){if(_0x5e021c[_0x1c35('0x5')]){return _0x13155d(_0x5e021c[_0x1c35('0x5')][_0x1c35('0x6')]);}else{return _0xc2152a(_0x5e021c['result']);}})[_0x1c35('0x7')](function(_0x421061){return _0x13155d(_0x421061);});});}exports[_0x1c35('0x8')]=function(_0x1c46d4,_0x457b5e,_0x1c7725){return function(_0x4d1f78){if(_0x1c7725[_0x1c35('0x9')]&&!_0x1c7725['rules'][_0x1c46d4]){logger[_0x1c35('0xa')](_0x1c35('0xb'),_0x1c46d4);return _0x4d1f78[_0x1c35('0xc')]();}var _0x3b5a17=[];for(var _0x4fdb57=0x0;_0x4fdb57<_0x457b5e[_0x1c35('0xd')];_0x4fdb57+=0x1){_0x3b5a17['push'](request('Command',{'command':util[_0x1c35('0xe')](_0x1c35('0xf'),_0x457b5e[_0x4fdb57])})[_0x1c35('0x4')](function(_0x5a1b28){return _0x5a1b28&&_0x5a1b28['message']&&_0x5a1b28['message'][_0x1c35('0x10')]('true')>=0x0?!![]:![];})[_0x1c35('0x7')](function(_0x3c5fab){logger[_0x1c35('0x5')](_0x1c35('0x11'),_0x1c46d4,_0x457b5e[_0x4fdb57]);}));}BPromise['all'](_0x3b5a17)[_0x1c35('0x4')](function(_0x4de86e){var _0xf80ea1=_['some'](_0x4de86e);logger['info'](_0x1c35('0x12'),_0x1c46d4,_0x457b5e[_0x1c35('0x13')](_0x1c35('0x14')),_0xf80ea1);_0x4d1f78[_0x1c35('0x15')](_0xf80ea1);})[_0x1c35('0x7')](function(_0xd2b55c){console[_0x1c35('0x16')](_0xd2b55c);logger[_0x1c35('0x5')](_0x1c35('0x12'),_0x1c46d4,_0x457b5e[_0x1c35('0x13')](_0x1c35('0x14')),_0xd2b55c[_0x1c35('0x17')]);_0x4d1f78[_0x1c35('0xc')]();});};};
\ No newline at end of file
index b4e21dd..11f3cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['agentringnoanswerAt','now','timeout','holdtime','ringtime','push','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','format','channel','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','lastevent','called','connectedlinename','info','uniqueid','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout'];(function(_0x28c0d4,_0x2ff715){var _0x3ca974=function(_0x592acc){while(--_0x592acc){_0x28c0d4['push'](_0x28c0d4['shift']());}};_0x3ca974(++_0x2ff715);}(_0xa902,0x8d));var _0x2a90=function(_0x2ddc49,_0x2bdf4b){_0x2ddc49=_0x2ddc49-0x0;var _0x1acb04=_0xa902[_0x2ddc49];return _0x1acb04;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var utils=require(_0x2a90('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3a1839,_0x1b4117){utils['info'](util[_0x2a90('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x3a1839['uniqueid'],_0x3a1839[_0x2a90('0x4')],_0x3a1839[_0x2a90('0x5')],_0x3a1839[_0x2a90('0x6')],_0x3a1839[_0x2a90('0x7')],_0x3a1839[_0x2a90('0x8')],_0x3a1839[_0x2a90('0x9')],_0x3a1839['lastevent']));if(_0x3a1839[_0x2a90('0x5')]){utils['getVoiceQueueByName'](_0x3a1839['queue'])[_0x2a90('0xa')](function(_0x3dfc8f){if(_0x3dfc8f){_0x3a1839[_0x2a90('0xb')]=_0x3dfc8f[_0x2a90('0xb')];_0x3a1839[_0x2a90('0xc')]=_0x3a1839['agentcomplete']?_0x3dfc8f[_0x2a90('0xd')]:![];_0x3a1839[_0x2a90('0xe')]=_0x3a1839[_0x2a90('0xc')]?_0x3dfc8f[_0x2a90('0xf')]:0x0;}utils['request'](_0x2a90('0x10'),_0x3a1839);});}else{utils['request'](_0x2a90('0x10'),_0x3a1839);}if(_0x1b4117){delete transfers[_0x3a1839['uniqueid']];}else{delete agents[_0x3a1839[_0x2a90('0x11')]];}}exports['agentcalled']=function(_0x407ce5){try{utils[_0x2a90('0x12')](util[_0x2a90('0x3')]('[%s][agents][agentcalled]',_0x407ce5['uniqueid']),_0x407ce5);agents[_0x407ce5['destuniqueid']]=_0x407ce5;agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x13')]=utils['now']();agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x15');agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x9')]=null;agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x16')]=null;utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x407ce5[_0x2a90('0x18')],agents[_0x407ce5[_0x2a90('0x11')]][_0x2a90('0x6')],_0x407ce5['destuniqueid']));}catch(_0x1facfb){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x1a'),_0x407ce5[_0x2a90('0x18')]),_0x1facfb);}};exports[_0x2a90('0x1b')]=function(_0x312cd5){try{if(!_[_0x2a90('0x1c')](agents[_0x312cd5[_0x2a90('0x11')]])){utils[_0x2a90('0x12')](util[_0x2a90('0x3')](_0x2a90('0x1d'),_0x312cd5['uniqueid']),_0x312cd5);utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x1e'),_0x312cd5[_0x2a90('0x18')],agents[_0x312cd5['destuniqueid']][_0x2a90('0x6')],_0x312cd5[_0x2a90('0x11')]));agents[_0x312cd5['destuniqueid']][_0x2a90('0x1b')]=!![];agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x21');agents[_0x312cd5[_0x2a90('0x11')]]['reason']=_0x2a90('0x21');agents[_0x312cd5[_0x2a90('0x11')]][_0x2a90('0x22')]=_0x312cd5[_0x2a90('0x23')]?parseInt(_0x312cd5[_0x2a90('0x23')])/0x3e8:0x0;agents[_0x312cd5['destuniqueid']]['talktime']=0x0;unanswered[_0x2a90('0x24')](_0x312cd5['destuniqueid']);}}catch(_0x53391e){utils['error'](util[_0x2a90('0x3')](_0x2a90('0x1d'),_0x312cd5['uniqueid']),_0x53391e);}};exports['queuecallerabandon']=function(_0x1add9a){try{_['forIn'](agents,function(_0x35570e,_0x6892e1){if(_0x35570e[_0x2a90('0x18')]==_0x1add9a[_0x2a90('0x18')]&&!_[_0x2a90('0x25')](unanswered,_0x35570e[_0x2a90('0x11')])){utils[_0x2a90('0x12')](util['format'](_0x2a90('0x26'),_0x1add9a[_0x2a90('0x18')]),_0x1add9a);utils[_0x2a90('0x17')](util['format'](_0x2a90('0x27'),_0x1add9a[_0x2a90('0x18')],_0x35570e[_0x2a90('0x6')],_0x35570e[_0x2a90('0x11')]));_0x35570e['agentringnoanswer']=!![];_0x35570e[_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();_0x35570e[_0x2a90('0x14')]=_0x2a90('0x28');_0x35570e[_0x2a90('0x29')]=_0x2a90('0x28');_0x35570e['holdtime']=_0x1add9a[_0x2a90('0x22')];_0x35570e[_0x2a90('0x2a')]=0x0;writeDB(_0x35570e);}});}catch(_0x1bdebf){utils[_0x2a90('0x19')](util['format'](_0x2a90('0x26'),_0x1add9a[_0x2a90('0x18')]),_0x1bdebf);}};exports['agentconnect']=function(_0x3e5002){try{if(agents[_0x3e5002[_0x2a90('0x11')]]){utils['debug'](util['format'](_0x2a90('0x2b'),_0x3e5002[_0x2a90('0x18')]),_0x3e5002);utils[_0x2a90('0x17')](util['format'](_0x2a90('0x2c'),_0x3e5002['uniqueid'],agents[_0x3e5002[_0x2a90('0x11')]]['membername'],_0x3e5002[_0x2a90('0x11')]));agents[_0x3e5002['destuniqueid']]['agentconnectAt']=utils[_0x2a90('0x20')]();agents[_0x3e5002['destuniqueid']][_0x2a90('0x9')]=_0x3e5002[_0x2a90('0x9')];agents[_0x3e5002[_0x2a90('0x11')]]['connectedlinename']=_0x3e5002[_0x2a90('0x16')];agents[_0x3e5002[_0x2a90('0x11')]][_0x2a90('0x22')]=_0x3e5002['ringtime'];agents[_0x3e5002[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x2d');_['forIn'](agents,function(_0x1aa096,_0x1db9d8){if(_0x1aa096['destuniqueid']!=_0x3e5002[_0x2a90('0x11')]&&_0x1aa096[_0x2a90('0x18')]==_0x3e5002[_0x2a90('0x18')]){_0x1aa096[_0x2a90('0x2a')]=0x0;_0x1aa096[_0x2a90('0x22')]=_0x3e5002[_0x2a90('0x23')];_0x1aa096[_0x2a90('0x1b')]=!![];_0x1aa096[_0x2a90('0x1f')]=utils[_0x2a90('0x20')]();_0x1aa096[_0x2a90('0x14')]=_0x2a90('0x2e');_0x1aa096[_0x2a90('0x29')]=_0x2a90('0x2e');_0x1aa096[_0x2a90('0x2f')]=_0x3e5002['destuniqueid'];_0x1aa096[_0x2a90('0x30')]=_0x3e5002[_0x2a90('0x6')];writeDB(_0x1aa096);}});}}catch(_0x528b41){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x2b'),_0x3e5002[_0x2a90('0x18')]),_0x528b41);}};exports[_0x2a90('0x31')]=function(_0x54b290){try{if(!_[_0x2a90('0x1c')](agents[_0x54b290['destuniqueid']])){utils[_0x2a90('0x12')](util['format'](_0x2a90('0x32'),_0x54b290[_0x2a90('0x18')]),_0x54b290);utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x33'),_0x54b290[_0x2a90('0x18')],agents[_0x54b290[_0x2a90('0x11')]]['membername'],_0x54b290['destuniqueid']));agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x31')]=!![];agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x34')]=utils[_0x2a90('0x20')]();agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x2a')]=utils[_0x2a90('0x35')](agents[_0x54b290['destuniqueid']][_0x2a90('0x34')],agents[_0x54b290['destuniqueid']][_0x2a90('0x36')]);agents[_0x54b290[_0x2a90('0x11')]]['reason']=_0x54b290[_0x2a90('0x29')];agents[_0x54b290[_0x2a90('0x11')]][_0x2a90('0x14')]=_0x2a90('0x37');writeDB(agents[_0x54b290[_0x2a90('0x11')]]);}}catch(_0x43a931){utils[_0x2a90('0x19')](util['format']('[%s][agents][agentcomplete]',_0x54b290[_0x2a90('0x18')]),_0x43a931);}};exports[_0x2a90('0x38')]=function(_0x42c890){try{if(!_[_0x2a90('0x1c')](agents[_0x42c890[_0x2a90('0x39')]])){utils['debug'](util['format'](_0x2a90('0x3a'),_0x42c890[_0x2a90('0x18')]),_0x42c890);utils['info'](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x42c890[_0x2a90('0x18')],agents[_0x42c890['transfereruniqueid']][_0x2a90('0x6')],agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x18')]));agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x3b')]=!![];agents[_0x42c890[_0x2a90('0x39')]]['transfertype']=_0x2a90('0x3c');agents[_0x42c890[_0x2a90('0x39')]]['transferexten']=_0x42c890[_0x2a90('0x3d')];agents[_0x42c890['transfereruniqueid']]['transferuniqueid']=agents[_0x42c890[_0x2a90('0x39')]][_0x2a90('0x18')];}}catch(_0x5819ab){utils['error'](util[_0x2a90('0x3')]('[%s][agents][blindtransfer]',_0x42c890[_0x2a90('0x18')]),_0x5819ab);}};exports[_0x2a90('0x3e')]=function(_0x561bae){try{utils[_0x2a90('0x12')](util[_0x2a90('0x3')](_0x2a90('0x3f'),_0x561bae['origtransfereruniqueid']),_0x561bae);if(_0x561bae[_0x2a90('0x40')]==_0x561bae[_0x2a90('0x41')]){if(!_['isNil'](agents[_0x561bae['secondtransfereruniqueid']])){utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x561bae[_0x2a90('0x40')],agents[_0x561bae['secondtransfereruniqueid']][_0x2a90('0x6')]));agents[_0x561bae['secondtransfereruniqueid']][_0x2a90('0x3b')]=!![];agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x43')]='ATTENDED';agents[_0x561bae['secondtransfereruniqueid']]['transferexten']=_0x561bae[_0x2a90('0x44')];agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x45')]=_0x561bae[_0x2a90('0x40')];}if(_0x561bae[_0x2a90('0x46')]&&agents[_0x561bae[_0x2a90('0x46')]]){agents[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x47')]=0x1;transfers[_0x561bae[_0x2a90('0x46')]]=_[_0x2a90('0x48')](agents[_0x561bae[_0x2a90('0x46')]]);transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x8')]=agents[_0x561bae['secondtransfereruniqueid']]['calleridnum'];transfers[_0x561bae['transfereeuniqueid']][_0x2a90('0x49')]=agents[_0x561bae[_0x2a90('0x42')]][_0x2a90('0x49')];transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x13')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x36')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x22')]=0x0;transfers[_0x561bae[_0x2a90('0x46')]][_0x2a90('0x47')]=0x2;}}else if(_0x561bae[_0x2a90('0x42')]==_0x561bae[_0x2a90('0x4a')]){if(!_[_0x2a90('0x1c')](agents[_0x561bae['origtransfereruniqueid']])){utils[_0x2a90('0x17')](util['format'](_0x2a90('0x4b'),_0x561bae[_0x2a90('0x40')],agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x6')]));agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x3b')]=!![];agents[_0x561bae[_0x2a90('0x40')]]['transfertype']=_0x2a90('0x4c');agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x4d')]=_0x561bae['secondtransfererexten'];agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x45')]=_0x561bae[_0x2a90('0x42')];}if(_0x561bae[_0x2a90('0x4e')]&&agents[_0x561bae['transfertargetuniqueid']]){agents[_0x561bae[_0x2a90('0x4e')]]['agententerreason']=0x1;transfers[_0x561bae[_0x2a90('0x4e')]]=_[_0x2a90('0x48')](agents[_0x561bae[_0x2a90('0x4e')]]);transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x8')]=agents[_0x561bae[_0x2a90('0x40')]]['calleridnum'];transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x49')]=agents[_0x561bae[_0x2a90('0x40')]][_0x2a90('0x49')];transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x13')]=utils[_0x2a90('0x20')]();transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x36')]=utils['now']();transfers[_0x561bae[_0x2a90('0x4e')]][_0x2a90('0x22')]=0x0;transfers[_0x561bae[_0x2a90('0x4e')]]['agententerreason']=0x2;}}}catch(_0x4404c1){utils[_0x2a90('0x19')](util[_0x2a90('0x3')](_0x2a90('0x3f'),_0x561bae[_0x2a90('0x40')]),_0x4404c1);}};exports['hangup']=function(_0x1bf94c){try{utils['debug'](util['format'](_0x2a90('0x4f'),_0x1bf94c['uniqueid']),_0x1bf94c);if(agents[_0x1bf94c['uniqueid']]&&agents[_0x1bf94c[_0x2a90('0x18')]]['reason']===_0x2a90('0x21')){if(_0x1bf94c[_0x2a90('0x50')]==='21'){agents[_0x1bf94c['uniqueid']]['reason']=_0x2a90('0x51');agents[_0x1bf94c['uniqueid']]['lastevent']=_0x2a90('0x51');}utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x52'),_0x1bf94c['uniqueid'],agents[_0x1bf94c['uniqueid']][_0x2a90('0x6')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]));writeDB(agents[_0x1bf94c[_0x2a90('0x18')]]);var _0x3f4d12=unanswered[_0x2a90('0x53')](_0x1bf94c[_0x2a90('0x18')]);if(_0x3f4d12>-0x1){unanswered[_0x2a90('0x54')](_0x3f4d12,0x1);}}if(transfers[_0x1bf94c[_0x2a90('0x18')]]){transfers[_0x1bf94c[_0x2a90('0x18')]]['agentcomplete']=!![];transfers[_0x1bf94c[_0x2a90('0x18')]]['agentcompleteAt']=utils[_0x2a90('0x20')]();transfers[_0x1bf94c['uniqueid']][_0x2a90('0x2a')]=utils['diffTime'](transfers[_0x1bf94c['uniqueid']][_0x2a90('0x34')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]);transfers[_0x1bf94c[_0x2a90('0x18')]]['reason']='agent';transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]=_0x2a90('0x37');utils[_0x2a90('0x17')](util[_0x2a90('0x3')](_0x2a90('0x52'),_0x1bf94c[_0x2a90('0x18')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x6')],transfers[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],transfers[_0x1bf94c[_0x2a90('0x18')]]['lastevent']));writeDB(transfers[_0x1bf94c[_0x2a90('0x18')]],!![]);}if(agents[_0x1bf94c[_0x2a90('0x18')]]&&agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]){agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x31')]=!![];agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x34')]=utils['now']();agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x2a')]=utils['diffTime'](agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x34')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x36')]);agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')]=agents[_0x1bf94c['uniqueid']][_0x2a90('0x3b')]?_0x2a90('0x3b'):_0x2a90('0x55');agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x14')]=_0x2a90('0x37');utils[_0x2a90('0x17')](util[_0x2a90('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf94c[_0x2a90('0x18')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x6')],agents[_0x1bf94c[_0x2a90('0x18')]][_0x2a90('0x29')],agents[_0x1bf94c[_0x2a90('0x18')]]['lastevent']));writeDB(agents[_0x1bf94c[_0x2a90('0x18')]]);}}catch(_0x44ce8d){utils[_0x2a90('0x19')](util['format'](_0x2a90('0x4f'),_0x1bf94c[_0x2a90('0x18')]),_0x44ce8d);}};
\ No newline at end of file
+var _0xa478=['push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','ATTENDED','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','type','agentcomplete','acw','agentacw','request','CreateVoiceAgentReport','agentcalled','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime'];(function(_0x3d74cc,_0x4975f6){var _0x2cc0a1=function(_0x55cf81){while(--_0x55cf81){_0x3d74cc['push'](_0x3d74cc['shift']());}};_0x2cc0a1(++_0x4975f6);}(_0xa478,0x136));var _0x8a47=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0xa478[_0x1d9163];return _0xb42197;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var utils=require(_0x8a47('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x44be2c,_0x2c3f60){utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x5'),_0x44be2c[_0x8a47('0x6')],_0x44be2c[_0x8a47('0x7')],_0x44be2c[_0x8a47('0x8')],_0x44be2c[_0x8a47('0x9')],_0x44be2c['interface'],_0x44be2c[_0x8a47('0xa')],_0x44be2c[_0x8a47('0xb')],_0x44be2c[_0x8a47('0xc')]));if(_0x44be2c[_0x8a47('0x8')]){utils['getVoiceQueueByName'](_0x44be2c[_0x8a47('0x8')])['then'](function(_0x7b6e61){if(_0x7b6e61){_0x44be2c[_0x8a47('0xd')]=_0x7b6e61[_0x8a47('0xd')];_0x44be2c['agentacw']=_0x44be2c[_0x8a47('0xe')]?_0x7b6e61[_0x8a47('0xf')]:![];_0x44be2c['acwtime']=_0x44be2c[_0x8a47('0x10')]?_0x7b6e61['acwTimeout']:0x0;}utils[_0x8a47('0x11')](_0x8a47('0x12'),_0x44be2c);});}else{utils[_0x8a47('0x11')]('CreateVoiceAgentReport',_0x44be2c);}if(_0x2c3f60){delete transfers[_0x44be2c['uniqueid']];}else{delete agents[_0x44be2c['destuniqueid']];}}exports[_0x8a47('0x13')]=function(_0x12539c){try{utils['debug'](util[_0x8a47('0x4')](_0x8a47('0x14'),_0x12539c[_0x8a47('0x6')]),_0x12539c);agents[_0x12539c[_0x8a47('0x15')]]=_0x12539c;agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0x16')]=utils[_0x8a47('0x17')]();agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0xc')]=_0x8a47('0x18');agents[_0x12539c[_0x8a47('0x15')]][_0x8a47('0xb')]=null;agents[_0x12539c[_0x8a47('0x15')]]['connectedlinename']=null;utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x19'),_0x12539c['uniqueid'],agents[_0x12539c[_0x8a47('0x15')]]['membername'],_0x12539c['destuniqueid']));}catch(_0x1cf650){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x14'),_0x12539c[_0x8a47('0x6')]),_0x1cf650);}};exports[_0x8a47('0x1b')]=function(_0x44e119){try{if(!_[_0x8a47('0x1c')](agents[_0x44e119[_0x8a47('0x15')]])){utils[_0x8a47('0x1d')](util['format'](_0x8a47('0x1e'),_0x44e119['uniqueid']),_0x44e119);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x1f'),_0x44e119[_0x8a47('0x6')],agents[_0x44e119['destuniqueid']][_0x8a47('0x9')],_0x44e119['destuniqueid']));agents[_0x44e119['destuniqueid']]['agentringnoanswer']=!![];agents[_0x44e119['destuniqueid']][_0x8a47('0x20')]=utils[_0x8a47('0x17')]();agents[_0x44e119['destuniqueid']][_0x8a47('0xc')]=_0x8a47('0x21');agents[_0x44e119[_0x8a47('0x15')]][_0x8a47('0x22')]=_0x8a47('0x21');agents[_0x44e119[_0x8a47('0x15')]][_0x8a47('0x23')]=_0x44e119['ringtime']?parseInt(_0x44e119[_0x8a47('0x24')])/0x3e8:0x0;agents[_0x44e119['destuniqueid']][_0x8a47('0x25')]=0x0;unanswered[_0x8a47('0x26')](_0x44e119['destuniqueid']);}}catch(_0x1e89b1){utils['error'](util['format'](_0x8a47('0x1e'),_0x44e119[_0x8a47('0x6')]),_0x1e89b1);}};exports[_0x8a47('0x27')]=function(_0x12f0b7){try{_[_0x8a47('0x28')](agents,function(_0x18bfd3,_0x58aa06){if(_0x18bfd3[_0x8a47('0x6')]==_0x12f0b7['uniqueid']&&!_['includes'](unanswered,_0x18bfd3[_0x8a47('0x15')])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x29'),_0x12f0b7[_0x8a47('0x6')]),_0x12f0b7);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x2a'),_0x12f0b7[_0x8a47('0x6')],_0x18bfd3[_0x8a47('0x9')],_0x18bfd3['destuniqueid']));_0x18bfd3[_0x8a47('0x1b')]=!![];_0x18bfd3[_0x8a47('0x20')]=utils[_0x8a47('0x17')]();_0x18bfd3['lastevent']=_0x8a47('0x2b');_0x18bfd3[_0x8a47('0x22')]='abandoned';_0x18bfd3[_0x8a47('0x23')]=_0x12f0b7[_0x8a47('0x23')];_0x18bfd3[_0x8a47('0x25')]=0x0;writeDB(_0x18bfd3);}});}catch(_0x20551b){utils['error'](util['format'](_0x8a47('0x29'),_0x12f0b7[_0x8a47('0x6')]),_0x20551b);}};exports[_0x8a47('0x2c')]=function(_0x42c5d7){try{if(agents[_0x42c5d7[_0x8a47('0x15')]]){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')]('[%s][agents][agentconnect]',_0x42c5d7['uniqueid']),_0x42c5d7);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x2d'),_0x42c5d7[_0x8a47('0x6')],agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0x9')],_0x42c5d7[_0x8a47('0x15')]));agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0x2e')]=utils[_0x8a47('0x17')]();agents[_0x42c5d7[_0x8a47('0x15')]]['connectedlinenum']=_0x42c5d7[_0x8a47('0xb')];agents[_0x42c5d7['destuniqueid']]['connectedlinename']=_0x42c5d7['connectedlinename'];agents[_0x42c5d7['destuniqueid']]['holdtime']=_0x42c5d7[_0x8a47('0x24')];agents[_0x42c5d7[_0x8a47('0x15')]][_0x8a47('0xc')]=_0x8a47('0x2f');_[_0x8a47('0x28')](agents,function(_0x20ba1c,_0x25c45b){if(_0x20ba1c[_0x8a47('0x15')]!=_0x42c5d7['destuniqueid']&&_0x20ba1c['uniqueid']==_0x42c5d7[_0x8a47('0x6')]){_0x20ba1c[_0x8a47('0x25')]=0x0;_0x20ba1c[_0x8a47('0x23')]=_0x42c5d7[_0x8a47('0x24')];_0x20ba1c['agentringnoanswer']=!![];_0x20ba1c[_0x8a47('0x20')]=utils[_0x8a47('0x17')]();_0x20ba1c[_0x8a47('0xc')]=_0x8a47('0x30');_0x20ba1c[_0x8a47('0x22')]='answered_elsewhere';_0x20ba1c[_0x8a47('0x31')]=_0x42c5d7[_0x8a47('0x15')];_0x20ba1c[_0x8a47('0x32')]=_0x42c5d7['membername'];writeDB(_0x20ba1c);}});}}catch(_0x2b3874){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x33'),_0x42c5d7['uniqueid']),_0x2b3874);}};exports[_0x8a47('0xe')]=function(_0x2f523f){try{if(!_[_0x8a47('0x1c')](agents[_0x2f523f[_0x8a47('0x15')]])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')]('[%s][agents][agentcomplete]',_0x2f523f['uniqueid']),_0x2f523f);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x34'),_0x2f523f['uniqueid'],agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x9')],_0x2f523f['destuniqueid']));agents[_0x2f523f['destuniqueid']][_0x8a47('0xe')]=!![];agents[_0x2f523f['destuniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x25')]=utils[_0x8a47('0x36')](agents[_0x2f523f[_0x8a47('0x15')]]['agentcompleteAt'],agents[_0x2f523f['destuniqueid']][_0x8a47('0x2e')]);agents[_0x2f523f[_0x8a47('0x15')]][_0x8a47('0x22')]=_0x2f523f[_0x8a47('0x22')];agents[_0x2f523f[_0x8a47('0x15')]]['lastevent']='complete';writeDB(agents[_0x2f523f[_0x8a47('0x15')]]);}}catch(_0x531faa){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')]('[%s][agents][agentcomplete]',_0x2f523f[_0x8a47('0x6')]),_0x531faa);}};exports[_0x8a47('0x37')]=function(_0x14e22c){try{if(!_[_0x8a47('0x1c')](agents[_0x14e22c[_0x8a47('0x38')]])){utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x39'),_0x14e22c['uniqueid']),_0x14e22c);utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x3a'),_0x14e22c[_0x8a47('0x6')],agents[_0x14e22c['transfereruniqueid']][_0x8a47('0x9')],agents[_0x14e22c[_0x8a47('0x38')]][_0x8a47('0x6')]));agents[_0x14e22c[_0x8a47('0x38')]][_0x8a47('0x3b')]=!![];agents[_0x14e22c[_0x8a47('0x38')]]['transfertype']='blind';agents[_0x14e22c[_0x8a47('0x38')]]['transferexten']=_0x14e22c[_0x8a47('0x3c')];agents[_0x14e22c[_0x8a47('0x38')]]['transferuniqueid']=agents[_0x14e22c[_0x8a47('0x38')]]['uniqueid'];}}catch(_0x315111){utils['error'](util[_0x8a47('0x4')]('[%s][agents][blindtransfer]',_0x14e22c[_0x8a47('0x6')]),_0x315111);}};exports[_0x8a47('0x3d')]=function(_0xdaa896){try{utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x3e'),_0xdaa896[_0x8a47('0x3f')]),_0xdaa896);if(_0xdaa896[_0x8a47('0x3f')]==_0xdaa896[_0x8a47('0x40')]){if(!_[_0x8a47('0x1c')](agents[_0xdaa896[_0x8a47('0x41')]])){utils['info'](util[_0x8a47('0x4')](_0x8a47('0x42'),_0xdaa896['origtransfereruniqueid'],agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x9')]));agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x3b')]=!![];agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x43')]=_0x8a47('0x44');agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x45')]=_0xdaa896[_0x8a47('0x46')];agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x47')]=_0xdaa896['origtransfereruniqueid'];}if(_0xdaa896[_0x8a47('0x48')]&&agents[_0xdaa896[_0x8a47('0x48')]]){agents[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x49')]=0x1;transfers[_0xdaa896[_0x8a47('0x48')]]=_[_0x8a47('0x4a')](agents[_0xdaa896[_0x8a47('0x48')]]);transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0xa')]=agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0xa')];transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x4b')]=agents[_0xdaa896[_0x8a47('0x41')]][_0x8a47('0x4b')];transfers[_0xdaa896[_0x8a47('0x48')]]['agentcalledAt']=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfereeuniqueid']][_0x8a47('0x2e')]=utils[_0x8a47('0x17')]();transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x23')]=0x0;transfers[_0xdaa896[_0x8a47('0x48')]][_0x8a47('0x49')]=0x2;}}else if(_0xdaa896['secondtransfereruniqueid']==_0xdaa896[_0x8a47('0x4c')]){if(!_[_0x8a47('0x1c')](agents[_0xdaa896[_0x8a47('0x3f')]])){utils['info'](util['format'](_0x8a47('0x42'),_0xdaa896[_0x8a47('0x3f')],agents[_0xdaa896['origtransfereruniqueid']][_0x8a47('0x9')]));agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x3b')]=!![];agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x43')]=_0x8a47('0x44');agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x45')]=_0xdaa896[_0x8a47('0x4d')];agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x47')]=_0xdaa896[_0x8a47('0x41')];}if(_0xdaa896[_0x8a47('0x4e')]&&agents[_0xdaa896['transfertargetuniqueid']]){agents[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x49')]=0x1;transfers[_0xdaa896[_0x8a47('0x4e')]]=_[_0x8a47('0x4a')](agents[_0xdaa896[_0x8a47('0x4e')]]);transfers[_0xdaa896[_0x8a47('0x4e')]]['calleridnum']=agents[_0xdaa896[_0x8a47('0x3f')]]['calleridnum'];transfers[_0xdaa896['transfertargetuniqueid']][_0x8a47('0x4b')]=agents[_0xdaa896[_0x8a47('0x3f')]][_0x8a47('0x4b')];transfers[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x16')]=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfertargetuniqueid']]['agentconnectAt']=utils[_0x8a47('0x17')]();transfers[_0xdaa896['transfertargetuniqueid']][_0x8a47('0x23')]=0x0;transfers[_0xdaa896[_0x8a47('0x4e')]][_0x8a47('0x49')]=0x2;}}}catch(_0x39d8f4){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x3e'),_0xdaa896[_0x8a47('0x3f')]),_0x39d8f4);}};exports['hangup']=function(_0x5c1e7e){try{utils[_0x8a47('0x1d')](util[_0x8a47('0x4')](_0x8a47('0x4f'),_0x5c1e7e['uniqueid']),_0x5c1e7e);if(agents[_0x5c1e7e['uniqueid']]&&agents[_0x5c1e7e['uniqueid']][_0x8a47('0x22')]==='timeout'){if(_0x5c1e7e[_0x8a47('0x50')]==='21'){agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')]=_0x8a47('0x51');agents[_0x5c1e7e['uniqueid']][_0x8a47('0xc')]='rejected';}utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x52'),_0x5c1e7e['uniqueid'],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],agents[_0x5c1e7e['uniqueid']][_0x8a47('0x22')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(agents[_0x5c1e7e[_0x8a47('0x6')]]);var _0x4c6dbe=unanswered[_0x8a47('0x53')](_0x5c1e7e[_0x8a47('0x6')]);if(_0x4c6dbe>-0x1){unanswered[_0x8a47('0x54')](_0x4c6dbe,0x1);}}if(transfers[_0x5c1e7e['uniqueid']]){transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xe')]=!![];transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x25')]=utils[_0x8a47('0x36')](transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x35')],transfers[_0x5c1e7e[_0x8a47('0x6')]]['agentconnectAt']);transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x22')]=_0x8a47('0x55');transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]=_0x8a47('0x56');utils[_0x8a47('0x3')](util[_0x8a47('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5c1e7e[_0x8a47('0x6')],transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],transfers[_0x5c1e7e['uniqueid']][_0x8a47('0x22')],transfers[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(transfers[_0x5c1e7e[_0x8a47('0x6')]],!![]);}if(agents[_0x5c1e7e[_0x8a47('0x6')]]&&agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x2e')]){agents[_0x5c1e7e[_0x8a47('0x6')]]['agentcomplete']=!![];agents[_0x5c1e7e['uniqueid']][_0x8a47('0x35')]=utils[_0x8a47('0x17')]();agents[_0x5c1e7e[_0x8a47('0x6')]]['talktime']=utils[_0x8a47('0x36')](agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x35')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x2e')]);agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')]=agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x3b')]?_0x8a47('0x3b'):_0x8a47('0x55');agents[_0x5c1e7e[_0x8a47('0x6')]]['lastevent']=_0x8a47('0x56');utils[_0x8a47('0x3')](util[_0x8a47('0x4')](_0x8a47('0x52'),_0x5c1e7e[_0x8a47('0x6')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x9')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0x22')],agents[_0x5c1e7e[_0x8a47('0x6')]][_0x8a47('0xc')]));writeDB(agents[_0x5c1e7e['uniqueid']]);}}catch(_0x98d7ae){utils[_0x8a47('0x1a')](util[_0x8a47('0x4')](_0x8a47('0x4f'),_0x5c1e7e[_0x8a47('0x6')]),_0x98d7ae);}};
\ No newline at end of file
index 1ae6b25..ec7dad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1caa=['source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','lastapplication','xmd-contactid','ContactId','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','noop','gotoif','lastdata','util','./transfers.controller','NO\x20ANSWER','FAILED','BUSY','uniqueid','blinds','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','info','context','exten','now','DOCUMENTATION','error','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','destinationchannel','answertime','toNumber','[%s][calls][newstate]','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value'];(function(_0x130abd,_0x38fc96){var _0x2c874a=function(_0x1aa437){while(--_0x1aa437){_0x130abd['push'](_0x130abd['shift']());}};_0x2c874a(++_0x38fc96);}(_0x1caa,0x1c8));var _0xa1ca=function(_0x5e818f,_0x557b9e){_0x5e818f=_0x5e818f-0x0;var _0x353676=_0x1caa[_0x5e818f];return _0x353676;};'use strict';var _=require('lodash');var util=require(_0xa1ca('0x0'));var utils=require('./utils');var transfers=require(_0xa1ca('0x1'));var dispositions=[_0xa1ca('0x2'),_0xa1ca('0x3'),'FAILED',_0xa1ca('0x2'),_0xa1ca('0x2'),_0xa1ca('0x2'),'ANSWERED',_0xa1ca('0x4'),'FAILED',_0xa1ca('0x3'),_0xa1ca('0x3')];var channels={};function writeDB(_0x3f734b){var _0xded889;if(transfers['blinds'][_0x3f734b[_0xa1ca('0x5')]]){_0xded889=_0x3f734b[_0xa1ca('0x5')];_0x3f734b[_0xa1ca('0x5')]=transfers[_0xa1ca('0x6')][_0x3f734b[_0xa1ca('0x5')]][_0xa1ca('0x7')];}utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x9'),_0x3f734b[_0xa1ca('0x5')],_0x3f734b[_0xa1ca('0xa')],_0x3f734b[_0xa1ca('0xb')],_0x3f734b['membername'],_0x3f734b[_0xa1ca('0xc')],_0x3f734b[_0xa1ca('0xd')],_0x3f734b[_0xa1ca('0xe')],_0x3f734b[_0xa1ca('0xf')]));if(_0x3f734b['accountcode']){utils['getUserByInternal'](_0x3f734b[_0xa1ca('0x10')])[_0xa1ca('0x11')](function(_0x30d86c){if(_0x30d86c){_0x3f734b[_0xa1ca('0x12')]=_0x30d86c['id'];}utils[_0xa1ca('0x13')](_0xa1ca('0x14'),_0x3f734b);});}else{utils[_0xa1ca('0x13')](_0xa1ca('0x14'),_0x3f734b);}if(channels[_0x3f734b[_0xa1ca('0x5')]]){delete channels[_0x3f734b['uniqueid']];}else if(_0xded889&&channels[_0xded889]){delete transfers[_0xa1ca('0x6')][_0xded889];delete channels[_0xded889];}}exports[_0xa1ca('0x15')]=function(_0x10dff3){try{utils[_0xa1ca('0x16')](util['format'](_0xa1ca('0x17'),_0x10dff3[_0xa1ca('0x5')]),_0x10dff3);if(_0x10dff3[_0xa1ca('0x5')]==_0x10dff3['linkedid']&&_0x10dff3[_0xa1ca('0xa')]!=_0xa1ca('0x18')){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x10dff3[_0xa1ca('0x5')],_0x10dff3[_0xa1ca('0x1a')],_0x10dff3[_0xa1ca('0x1b')]));channels[_0x10dff3[_0xa1ca('0x5')]]={'uniqueid':_0x10dff3[_0xa1ca('0x5')],'accountcode':_0x10dff3['accountcode'],'source':_0x10dff3['calleridnum'],'destination':_0x10dff3[_0xa1ca('0x1b')],'destinationcontext':_0x10dff3[_0xa1ca('0x1a')],'channel':_0x10dff3['channel'],'starttime':utils[_0xa1ca('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xa1ca('0x1d')};}}catch(_0x10efef){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x17'),_0x10dff3[_0xa1ca('0x5')]),_0x10efef);}};exports[_0xa1ca('0x1f')]=function(_0x127d7a){try{utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')]('[%s][calls][newstate]',_0x127d7a['uniqueid']),_0x127d7a);if(!_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x5')]])&&_0x127d7a[_0xa1ca('0x21')]==0x6){utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x22'),_0x127d7a[_0xa1ca('0x5')],_0x127d7a[_0xa1ca('0x1a')],_0x127d7a[_0xa1ca('0xa')]));if(_[_0xa1ca('0x20')](channels[_0x127d7a['uniqueid']]['systemanswertime'])){channels[_0x127d7a[_0xa1ca('0x5')]][_0xa1ca('0x23')]=utils[_0xa1ca('0x1c')]();}}else if(!_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x24')]])&&_0x127d7a[_0xa1ca('0x21')]==0x6&&_0x127d7a[_0xa1ca('0x1a')]!=_0xa1ca('0x25')){utils['info'](util[_0xa1ca('0x8')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x127d7a['uniqueid'],_0x127d7a[_0xa1ca('0x24')],_0x127d7a[_0xa1ca('0x1a')],_0x127d7a['channel']));channels[_0x127d7a[_0xa1ca('0x24')]]['accountcode']=_0x127d7a[_0xa1ca('0x10')];channels[_0x127d7a['linkedid']][_0xa1ca('0x26')]=_0x127d7a[_0xa1ca('0xa')];if(_[_0xa1ca('0x20')](channels[_0x127d7a[_0xa1ca('0x24')]][_0xa1ca('0x27')])){channels[_0x127d7a[_0xa1ca('0x24')]][_0xa1ca('0x27')]=utils[_0xa1ca('0x1c')]();}channels[_0x127d7a[_0xa1ca('0x24')]]['disposition']=dispositions[_[_0xa1ca('0x28')](_0x127d7a[_0xa1ca('0x21')])]||'ANSWERED';}}catch(_0x27b25e){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x29'),_0x127d7a['uniqueid']),_0x27b25e);}};exports[_0xa1ca('0x2a')]=function(_0x45b54e){try{if(!_['isNil'](channels[_0x45b54e[_0xa1ca('0x5')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')]('[%s][calls][hangup]',_0x45b54e[_0xa1ca('0x5')]),_0x45b54e);if(_['isNil'](channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2b')])){channels[_0x45b54e[_0xa1ca('0x5')]]['callerid']=_0x45b54e[_0xa1ca('0x2c')]+'\x20<'+_0x45b54e['calleridnum']+'>';}utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x2d'),_0x45b54e[_0xa1ca('0x5')],channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2b')],_0x45b54e['cause-txt']));channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2e')]=utils[_0xa1ca('0x1c')]();channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2f')]=utils[_0xa1ca('0x30')](channels[_0x45b54e[_0xa1ca('0x5')]]['endtime'],channels[_0x45b54e['uniqueid']][_0xa1ca('0x31')]);channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x32')]=channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x27')]?utils[_0xa1ca('0x30')](channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x2e')],channels[_0x45b54e[_0xa1ca('0x5')]][_0xa1ca('0x27')]):0x0;writeDB(channels[_0x45b54e[_0xa1ca('0x5')]]);}}catch(_0x2d9894){utils['error'](util['format'](_0xa1ca('0x33'),_0x45b54e[_0xa1ca('0x5')]),_0x2d9894);}};exports['attendedtransfer']=function(_0x4eb59b){try{if(!_[_0xa1ca('0x20')](channels[_0x4eb59b[_0xa1ca('0x34')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')](_0xa1ca('0x35'),_0x4eb59b[_0xa1ca('0x36')]),_0x4eb59b);if(channels[_0x4eb59b[_0xa1ca('0x34')]][_0xa1ca('0xa')]==_0x4eb59b[_0xa1ca('0x37')]){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x38'),_0x4eb59b[_0xa1ca('0x36')],_0x4eb59b['localtwolinkedid'],_0x4eb59b[_0xa1ca('0x39')]));channels[_0x4eb59b['localtwolinkedid']][_0xa1ca('0x26')]=_0x4eb59b[_0xa1ca('0x39')];channels[_0x4eb59b[_0xa1ca('0x34')]]['userfield']='_attended';}else if(channels[_0x4eb59b[_0xa1ca('0x34')]][_0xa1ca('0xa')]=_0x4eb59b[_0xa1ca('0x3a')]){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4eb59b['origtransfereruniqueid'],_0x4eb59b['localtwolinkedid'],_0x4eb59b[_0xa1ca('0x3b')]));channels[_0x4eb59b['localtwolinkedid']][_0xa1ca('0x26')]=_0x4eb59b['origtransfererchannel'];channels[_0x4eb59b[_0xa1ca('0x34')]]['userfield']='_attended';}}}catch(_0x209043){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x35'),_0x4eb59b[_0xa1ca('0x36')]),_0x209043);}};exports[_0xa1ca('0x3c')]=function(_0x50bb04){try{if(!_[_0xa1ca('0x20')](channels[_0x50bb04['uniqueid']])){utils['debug'](util[_0xa1ca('0x8')](_0xa1ca('0x3d'),_0x50bb04[_0xa1ca('0x5')]),_0x50bb04);channels[_0x50bb04[_0xa1ca('0x5')]]['musiconholdstartAt']=utils[_0xa1ca('0x1c')]();utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x3e'),_0x50bb04[_0xa1ca('0x5')],channels[_0x50bb04[_0xa1ca('0x5')]][_0xa1ca('0x3f')]));}}catch(_0x1bfacf){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x3d'),_0x50bb04[_0xa1ca('0x5')]),_0x1bfacf);}};exports[_0xa1ca('0x40')]=function(_0x45dcc1){try{if(!_[_0xa1ca('0x20')](channels[_0x45dcc1['uniqueid']])){utils['debug'](util['format'](_0xa1ca('0x41'),_0x45dcc1[_0xa1ca('0x5')]),_0x45dcc1);if(!_['isNil'](channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x3f')])){channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x42')]+=utils[_0xa1ca('0x30')](utils[_0xa1ca('0x1c')](),channels[_0x45dcc1['uniqueid']][_0xa1ca('0x3f')]);utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x43'),_0x45dcc1['uniqueid'],channels[_0x45dcc1[_0xa1ca('0x5')]]['mohtime']));delete channels[_0x45dcc1[_0xa1ca('0x5')]][_0xa1ca('0x3f')];}}}catch(_0x4108e3){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')]('[%s][calls][musiconholdstop]',_0x45dcc1[_0xa1ca('0x5')]),_0x4108e3);}};exports[_0xa1ca('0x44')]=function(_0x3880d6){try{if(!_[_0xa1ca('0x20')](channels[_0x3880d6[_0xa1ca('0x5')]])){utils[_0xa1ca('0x16')](util[_0xa1ca('0x8')](_0xa1ca('0x45'),_0x3880d6[_0xa1ca('0x5')]),_0x3880d6);if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x47')])){utils['info'](util[_0xa1ca('0x8')](_0xa1ca('0x48'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x4a')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6['variable'][_0xa1ca('0x4b')])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x4c'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6['uniqueid']][_0xa1ca('0x4d')]=_0x3880d6['value'];channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x2b')]='\x22'+_0x3880d6['value']+'\x22\x20<'+_0x3880d6[_0xa1ca('0x49')]+'>';}if(!_['isNil'](_0x3880d6['variable'][_0xa1ca('0x4e')])||!_['isNil'](_0x3880d6['variable'][_0xa1ca('0x4f')])){utils['info'](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3880d6[_0xa1ca('0x5')],!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x4e')])?_0xa1ca('0x4e'):_0xa1ca('0x4f'),_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]]['callerid']=_0x3880d6['value'];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x50')])||!_['isNil'](_0x3880d6[_0xa1ca('0x46')]['xmcs-queue'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x51'),_0x3880d6['uniqueid'],!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x50')])?'xmd-queue':_0xa1ca('0x52'),_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6['uniqueid']][_0xa1ca('0x53')]='Queue';channels[_0x3880d6[_0xa1ca('0x5')]]['lastdata']=_0x3880d6[_0xa1ca('0x49')];channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0xb')]=!![];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x54')])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x55')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')]['xmd-cdrtype'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x56')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')]['outboundrouteid'])){utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x57'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6[_0xa1ca('0x49')]));channels[_0x3880d6['uniqueid']][_0xa1ca('0x58')]=_0x3880d6[_0xa1ca('0x49')];}if(!_[_0xa1ca('0x20')](_0x3880d6[_0xa1ca('0x46')][_0xa1ca('0x59')])){utils['info'](util['format'](_0xa1ca('0x5a'),_0x3880d6[_0xa1ca('0x5')],_0x3880d6['value']));channels[_0x3880d6[_0xa1ca('0x5')]][_0xa1ca('0x59')]=_0x3880d6[_0xa1ca('0x49')];}}}catch(_0x378e75){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')]('[%s][calls][varset]',_0x3880d6[_0xa1ca('0x5')]),_0x378e75);}};exports[_0xa1ca('0x5b')]=function(_0x98b28d){try{if(!_[_0xa1ca('0x20')](channels[_0x98b28d['uniqueid']])){utils[_0xa1ca('0x16')](util['format'](_0xa1ca('0x5c'),_0x98b28d['uniqueid']),_0x98b28d);utils[_0xa1ca('0x19')](util[_0xa1ca('0x8')](_0xa1ca('0x5d'),_0x98b28d['uniqueid'],_0x98b28d[_0xa1ca('0x5e')],_0x98b28d[_0xa1ca('0x5f')]));if(_0x98b28d[_0xa1ca('0x5e')][_0xa1ca('0x60')]()==_0xa1ca('0x61')&&_[_0xa1ca('0x62')](_0x98b28d['appdata'][_0xa1ca('0x60')](),_0xa1ca('0x63'))){var _0x4845fe=_0x98b28d[_0xa1ca('0x5f')][_0xa1ca('0x64')]('=');var _0x4e79e2=_0x4845fe[0x0]['substring'](_0x4845fe[0x0][_0xa1ca('0x65')]('(')+0x1,_0x4845fe[0x0][_0xa1ca('0x65')](')'));var _0x331cbd=_0x4845fe[0x1];channels[_0x98b28d['uniqueid']][_0x4e79e2]=_0x331cbd;}if(!_[_0xa1ca('0x66')]([_0xa1ca('0x2a'),_0xa1ca('0x67'),'execif',_0xa1ca('0x61'),_0xa1ca('0x68')],_0x98b28d[_0xa1ca('0x5e')][_0xa1ca('0x60')]())){channels[_0x98b28d[_0xa1ca('0x5')]]['lastapplication']=_0x98b28d[_0xa1ca('0x5e')];channels[_0x98b28d[_0xa1ca('0x5')]][_0xa1ca('0x69')]=_0x98b28d['appdata'];}}}catch(_0x1fdd1f){utils[_0xa1ca('0x1e')](util[_0xa1ca('0x8')](_0xa1ca('0x5c'),_0x98b28d[_0xa1ca('0x5')]),_0x1fdd1f);}};
\ No newline at end of file
+var _0x42f2=['linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','debug','[%s][calls][newstate]','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','channelstate','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','format'];(function(_0x5e6ccb,_0x28b917){var _0x1cc77a=function(_0x3ae454){while(--_0x3ae454){_0x5e6ccb['push'](_0x5e6ccb['shift']());}};_0x1cc77a(++_0x28b917);}(_0x42f2,0xc8));var _0x242f=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0x42f2[_0xb5fc3e];return _0x2efc3c;};'use strict';var _=require(_0x242f('0x0'));var util=require(_0x242f('0x1'));var utils=require(_0x242f('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x242f('0x3'),_0x242f('0x3'),'NO\x20ANSWER',_0x242f('0x4'),_0x242f('0x4'),_0x242f('0x5'),_0x242f('0x6'),'FAILED',_0x242f('0x3'),'FAILED'];var channels={};function writeDB(_0x4e5825){var _0x26205e;if(transfers[_0x242f('0x7')][_0x4e5825[_0x242f('0x8')]]){_0x26205e=_0x4e5825['uniqueid'];_0x4e5825[_0x242f('0x8')]=transfers[_0x242f('0x7')][_0x4e5825[_0x242f('0x8')]]['transfereeuniqueid'];}utils[_0x242f('0x9')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4e5825['uniqueid'],_0x4e5825[_0x242f('0xa')],_0x4e5825[_0x242f('0xb')],_0x4e5825[_0x242f('0xc')],_0x4e5825[_0x242f('0xd')],_0x4e5825[_0x242f('0xe')],_0x4e5825['connectedlinenum'],_0x4e5825[_0x242f('0xf')]));if(_0x4e5825[_0x242f('0x10')]){utils[_0x242f('0x11')](_0x4e5825['accountcode'])[_0x242f('0x12')](function(_0x5ee0d6){if(_0x5ee0d6){_0x4e5825[_0x242f('0x13')]=_0x5ee0d6['id'];}utils['request'](_0x242f('0x14'),_0x4e5825);});}else{utils[_0x242f('0x15')](_0x242f('0x14'),_0x4e5825);}if(channels[_0x4e5825[_0x242f('0x8')]]){delete channels[_0x4e5825[_0x242f('0x8')]];}else if(_0x26205e&&channels[_0x26205e]){delete transfers[_0x242f('0x7')][_0x26205e];delete channels[_0x26205e];}}exports[_0x242f('0x16')]=function(_0x21af72){try{utils['debug'](util[_0x242f('0x17')]('[%s][calls][newchannel]',_0x21af72[_0x242f('0x8')]),_0x21af72);if(_0x21af72[_0x242f('0x8')]==_0x21af72[_0x242f('0x18')]&&_0x21af72[_0x242f('0xa')]!=_0x242f('0x19')){utils['info'](util[_0x242f('0x17')](_0x242f('0x1a'),_0x21af72[_0x242f('0x8')],_0x21af72[_0x242f('0x1b')],_0x21af72[_0x242f('0x1c')]));channels[_0x21af72[_0x242f('0x8')]]={'uniqueid':_0x21af72['uniqueid'],'accountcode':_0x21af72[_0x242f('0x10')],'source':_0x21af72[_0x242f('0xe')],'destination':_0x21af72[_0x242f('0x1c')],'destinationcontext':_0x21af72[_0x242f('0x1b')],'channel':_0x21af72[_0x242f('0xa')],'starttime':utils[_0x242f('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x242f('0x1e')};}}catch(_0x319cc1){utils[_0x242f('0x1f')](util['format'](_0x242f('0x20'),_0x21af72[_0x242f('0x8')]),_0x319cc1);}};exports['newstate']=function(_0x5e0b95){try{utils[_0x242f('0x21')](util[_0x242f('0x17')](_0x242f('0x22'),_0x5e0b95[_0x242f('0x8')]),_0x5e0b95);if(!_[_0x242f('0x23')](channels[_0x5e0b95[_0x242f('0x8')]])&&_0x5e0b95['channelstate']==0x6){utils[_0x242f('0x9')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5e0b95['uniqueid'],_0x5e0b95[_0x242f('0x1b')],_0x5e0b95[_0x242f('0xa')]));if(_[_0x242f('0x23')](channels[_0x5e0b95[_0x242f('0x8')]][_0x242f('0x24')])){channels[_0x5e0b95['uniqueid']][_0x242f('0x24')]=utils[_0x242f('0x1d')]();}}else if(!_['isNil'](channels[_0x5e0b95['linkedid']])&&_0x5e0b95['channelstate']==0x6&&_0x5e0b95[_0x242f('0x1b')]!=_0x242f('0x25')){utils['info'](util['format'](_0x242f('0x26'),_0x5e0b95['uniqueid'],_0x5e0b95[_0x242f('0x18')],_0x5e0b95[_0x242f('0x1b')],_0x5e0b95[_0x242f('0xa')]));channels[_0x5e0b95[_0x242f('0x18')]][_0x242f('0x10')]=_0x5e0b95[_0x242f('0x10')];channels[_0x5e0b95['linkedid']][_0x242f('0x27')]=_0x5e0b95['channel'];if(_[_0x242f('0x23')](channels[_0x5e0b95['linkedid']][_0x242f('0x28')])){channels[_0x5e0b95[_0x242f('0x18')]][_0x242f('0x28')]=utils[_0x242f('0x1d')]();}channels[_0x5e0b95[_0x242f('0x18')]][_0x242f('0x29')]=dispositions[_[_0x242f('0x2a')](_0x5e0b95[_0x242f('0x2b')])]||_0x242f('0x5');}}catch(_0x9fdbc0){utils[_0x242f('0x1f')](util[_0x242f('0x17')]('[%s][calls][newstate]',_0x5e0b95[_0x242f('0x8')]),_0x9fdbc0);}};exports[_0x242f('0x2c')]=function(_0x410783){try{if(!_[_0x242f('0x23')](channels[_0x410783['uniqueid']])){utils['debug'](util[_0x242f('0x17')](_0x242f('0x2d'),_0x410783[_0x242f('0x8')]),_0x410783);if(_[_0x242f('0x23')](channels[_0x410783[_0x242f('0x8')]]['callerid'])){channels[_0x410783['uniqueid']][_0x242f('0x2e')]=_0x410783[_0x242f('0x2f')]+'\x20<'+_0x410783[_0x242f('0xe')]+'>';}utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x30'),_0x410783[_0x242f('0x8')],channels[_0x410783[_0x242f('0x8')]][_0x242f('0x2e')],_0x410783[_0x242f('0x31')]));channels[_0x410783[_0x242f('0x8')]][_0x242f('0x32')]=utils[_0x242f('0x1d')]();channels[_0x410783['uniqueid']][_0x242f('0x33')]=utils[_0x242f('0x34')](channels[_0x410783[_0x242f('0x8')]][_0x242f('0x32')],channels[_0x410783[_0x242f('0x8')]]['starttime']);channels[_0x410783['uniqueid']]['billableseconds']=channels[_0x410783[_0x242f('0x8')]][_0x242f('0x28')]?utils[_0x242f('0x34')](channels[_0x410783[_0x242f('0x8')]][_0x242f('0x32')],channels[_0x410783['uniqueid']][_0x242f('0x28')]):0x0;writeDB(channels[_0x410783[_0x242f('0x8')]]);}}catch(_0x13c814){utils['error'](util[_0x242f('0x17')](_0x242f('0x2d'),_0x410783[_0x242f('0x8')]),_0x13c814);}};exports[_0x242f('0x35')]=function(_0x95251f){try{if(!_[_0x242f('0x23')](channels[_0x95251f[_0x242f('0x36')]])){utils[_0x242f('0x21')](util['format'](_0x242f('0x37'),_0x95251f['origtransfereruniqueid']),_0x95251f);if(channels[_0x95251f[_0x242f('0x36')]][_0x242f('0xa')]==_0x95251f[_0x242f('0x38')]){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x39'),_0x95251f[_0x242f('0x3a')],_0x95251f[_0x242f('0x36')],_0x95251f[_0x242f('0x3b')]));channels[_0x95251f[_0x242f('0x36')]][_0x242f('0x27')]=_0x95251f[_0x242f('0x3b')];channels[_0x95251f['localtwolinkedid']][_0x242f('0x3c')]=_0x242f('0x3d');}else if(channels[_0x95251f['localtwolinkedid']][_0x242f('0xa')]=_0x95251f[_0x242f('0x3e')]){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x39'),_0x95251f['origtransfereruniqueid'],_0x95251f['localtwolinkedid'],_0x95251f[_0x242f('0x3f')]));channels[_0x95251f[_0x242f('0x36')]][_0x242f('0x27')]=_0x95251f[_0x242f('0x3f')];channels[_0x95251f[_0x242f('0x36')]][_0x242f('0x3c')]=_0x242f('0x3d');}}}catch(_0x546891){utils['error'](util[_0x242f('0x17')](_0x242f('0x37'),_0x95251f[_0x242f('0x3a')]),_0x546891);}};exports[_0x242f('0x40')]=function(_0x57b28a){try{if(!_[_0x242f('0x23')](channels[_0x57b28a[_0x242f('0x8')]])){utils['debug'](util[_0x242f('0x17')](_0x242f('0x41'),_0x57b28a['uniqueid']),_0x57b28a);channels[_0x57b28a[_0x242f('0x8')]]['musiconholdstartAt']=utils['now']();utils[_0x242f('0x9')](util['format'](_0x242f('0x42'),_0x57b28a['uniqueid'],channels[_0x57b28a['uniqueid']][_0x242f('0x43')]));}}catch(_0x32c48a){utils[_0x242f('0x1f')](util[_0x242f('0x17')](_0x242f('0x41'),_0x57b28a[_0x242f('0x8')]),_0x32c48a);}};exports['musiconholdstop']=function(_0x2577eb){try{if(!_[_0x242f('0x23')](channels[_0x2577eb[_0x242f('0x8')]])){utils[_0x242f('0x21')](util[_0x242f('0x17')](_0x242f('0x44'),_0x2577eb[_0x242f('0x8')]),_0x2577eb);if(!_[_0x242f('0x23')](channels[_0x2577eb[_0x242f('0x8')]]['musiconholdstartAt'])){channels[_0x2577eb[_0x242f('0x8')]]['mohtime']+=utils[_0x242f('0x34')](utils['now'](),channels[_0x2577eb[_0x242f('0x8')]]['musiconholdstartAt']);utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x45'),_0x2577eb['uniqueid'],channels[_0x2577eb[_0x242f('0x8')]][_0x242f('0x46')]));delete channels[_0x2577eb[_0x242f('0x8')]][_0x242f('0x43')];}}}catch(_0x320ef3){utils['error'](util[_0x242f('0x17')]('[%s][calls][musiconholdstop]',_0x2577eb[_0x242f('0x8')]),_0x320ef3);}};exports[_0x242f('0x47')]=function(_0x536049){try{if(!_[_0x242f('0x23')](channels[_0x536049[_0x242f('0x8')]])){utils['debug'](util[_0x242f('0x17')]('[%s][calls][varset]',_0x536049[_0x242f('0x8')]),_0x536049);if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')]['xmd-originatecalleridnum'])){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x49'),_0x536049[_0x242f('0x8')],_0x536049[_0x242f('0x4a')]));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x4b')]=_0x536049[_0x242f('0x4a')];}if(!_['isNil'](_0x536049['variable']['xmd-phone'])){utils[_0x242f('0x9')](util[_0x242f('0x17')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x536049[_0x242f('0x8')],_0x536049['value']));channels[_0x536049['uniqueid']][_0x242f('0x4c')]=_0x536049[_0x242f('0x4a')];channels[_0x536049['uniqueid']][_0x242f('0x2e')]='\x22'+_0x536049[_0x242f('0x4a')]+_0x242f('0x4d')+_0x536049['value']+'>';}if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x4e')])||!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x4f')])){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x50'),_0x536049['uniqueid'],!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')]['xmd-callerid-preview'])?_0x242f('0x4e'):_0x242f('0x4f'),_0x536049[_0x242f('0x4a')]));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x2e')]=_0x536049[_0x242f('0x4a')];}if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x51')])||!_[_0x242f('0x23')](_0x536049['variable'][_0x242f('0x52')])){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x50'),_0x536049['uniqueid'],!_[_0x242f('0x23')](_0x536049['variable'][_0x242f('0x51')])?'xmd-queue':_0x242f('0x52'),_0x536049[_0x242f('0x4a')]));channels[_0x536049['uniqueid']][_0x242f('0x53')]=_0x242f('0x54');channels[_0x536049[_0x242f('0x8')]][_0x242f('0x55')]=_0x536049[_0x242f('0x4a')];channels[_0x536049[_0x242f('0x8')]]['queue']=!![];}if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x56')])){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x57'),_0x536049[_0x242f('0x8')],_0x536049[_0x242f('0x4a')]));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x58')]=_0x536049[_0x242f('0x4a')];}if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x59')])){utils[_0x242f('0x9')](util[_0x242f('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x536049[_0x242f('0x8')],_0x536049['value']));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x5a')]=_0x536049[_0x242f('0x4a')];}if(!_['isNil'](_0x536049[_0x242f('0x48')][_0x242f('0x5b')])){utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x5c'),_0x536049[_0x242f('0x8')],_0x536049[_0x242f('0x4a')]));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x5d')]=_0x536049['value'];}if(!_[_0x242f('0x23')](_0x536049[_0x242f('0x48')][_0x242f('0x5e')])){utils['info'](util[_0x242f('0x17')](_0x242f('0x5f'),_0x536049[_0x242f('0x8')],_0x536049[_0x242f('0x4a')]));channels[_0x536049[_0x242f('0x8')]][_0x242f('0x5e')]=_0x536049[_0x242f('0x4a')];}}}catch(_0x57833c){utils['error'](util[_0x242f('0x17')](_0x242f('0x60'),_0x536049[_0x242f('0x8')]),_0x57833c);}};exports['newexten']=function(_0xef3631){try{if(!_[_0x242f('0x23')](channels[_0xef3631['uniqueid']])){utils['debug'](util[_0x242f('0x17')](_0x242f('0x61'),_0xef3631[_0x242f('0x8')]),_0xef3631);utils[_0x242f('0x9')](util[_0x242f('0x17')](_0x242f('0x62'),_0xef3631[_0x242f('0x8')],_0xef3631[_0x242f('0x63')],_0xef3631[_0x242f('0x64')]));if(_0xef3631['application'][_0x242f('0x65')]()==_0x242f('0x66')&&_[_0x242f('0x67')](_0xef3631[_0x242f('0x64')][_0x242f('0x65')](),_0x242f('0x68'))){var _0x2d2aea=_0xef3631['appdata'][_0x242f('0x69')]('=');var _0x3103f1=_0x2d2aea[0x0][_0x242f('0x6a')](_0x2d2aea[0x0][_0x242f('0x6b')]('(')+0x1,_0x2d2aea[0x0][_0x242f('0x6b')](')'));var _0x170fa2=_0x2d2aea[0x1];channels[_0xef3631[_0x242f('0x8')]][_0x3103f1]=_0x170fa2;}if(!_[_0x242f('0x6c')](['hangup',_0x242f('0x6d'),_0x242f('0x6e'),'set',_0x242f('0x6f')],_0xef3631[_0x242f('0x63')][_0x242f('0x65')]())){channels[_0xef3631['uniqueid']]['lastapplication']=_0xef3631[_0x242f('0x63')];channels[_0xef3631[_0x242f('0x8')]][_0x242f('0x55')]=_0xef3631[_0x242f('0x64')];}}}catch(_0xd4352e){utils[_0x242f('0x1f')](util[_0x242f('0x17')](_0x242f('0x61'),_0xef3631['uniqueid']),_0xd4352e);}};
\ No newline at end of file
index 1862dce..c49f869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14ea=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0xaa5a29,_0x2600f9){var _0x4a4401=function(_0x5d0225){while(--_0x5d0225){_0xaa5a29['push'](_0xaa5a29['shift']());}};_0x4a4401(++_0x2600f9);}(_0x14ea,0x189));var _0xa14e=function(_0x340cde,_0x347de6){_0x340cde=_0x340cde-0x0;var _0x5e26ee=_0x14ea[_0x340cde];return _0x5e26ee;};'use strict';var utils=require(_0xa14e('0x0'));exports[_0xa14e('0x1')]=function(){utils[_0xa14e('0x2')](_0xa14e('0x3'));};exports[_0xa14e('0x4')]=function(){utils[_0xa14e('0x2')](_0xa14e('0x5'));};exports[_0xa14e('0x6')]=function(){utils['info'](_0xa14e('0x7'));};exports['error']=function(_0x522a37){utils[_0xa14e('0x8')]('[core]\x20error',_0x522a37);};exports['close']=function(){utils[_0xa14e('0x2')](_0xa14e('0x9'));};exports[_0xa14e('0xa')]=function(_0x17fafe){};
\ No newline at end of file
+var _0x3dd9=['shutdown','fullybooted','[core]\x20fullybooted','[core]\x20error','close','[core]\x20close','connect','info','[core]\x20connected'];(function(_0x32a6a4,_0x59620b){var _0x264430=function(_0x497371){while(--_0x497371){_0x32a6a4['push'](_0x32a6a4['shift']());}};_0x264430(++_0x59620b);}(_0x3dd9,0x1d1));var _0x93dd=function(_0x27ead9,_0x13dd13){_0x27ead9=_0x27ead9-0x0;var _0x33d2b6=_0x3dd9[_0x27ead9];return _0x33d2b6;};'use strict';var utils=require('./utils');exports[_0x93dd('0x0')]=function(){utils[_0x93dd('0x1')](_0x93dd('0x2'));};exports[_0x93dd('0x3')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x93dd('0x4')]=function(){utils['info'](_0x93dd('0x5'));};exports['error']=function(_0x230e6a){utils['error'](_0x93dd('0x6'),_0x230e6a);};exports[_0x93dd('0x7')]=function(){utils[_0x93dd('0x1')](_0x93dd('0x8'));};exports['managerevent']=function(_0x160b57){};
\ No newline at end of file
index ba5e777..fc82049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01e1=['value','error','dialbegin','assign','starttime','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','now','lastevent','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','cause-txt','complete','duration','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','format','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x16fa27,_0x59aeed){var _0x51047c=function(_0xfc16c0){while(--_0xfc16c0){_0x16fa27['push'](_0x16fa27['shift']());}};_0x51047c(++_0x59aeed);}(_0x01e1,0xed));var _0x101e=function(_0x561344,_0x373df4){_0x561344=_0x561344-0x0;var _0x48f642=_0x01e1[_0x561344];return _0x48f642;};'use strict';var _=require(_0x101e('0x0'));var util=require(_0x101e('0x1'));var utils=require(_0x101e('0x2'));var dials={};function writeDB(_0x197883){utils[_0x101e('0x3')](util['format'](_0x101e('0x4'),_0x197883['uniqueid'],_0x197883[_0x101e('0x5')],_0x197883['dialstring'],_0x197883[_0x101e('0x6')],_0x197883[_0x101e('0x7')],_0x197883[_0x101e('0x8')]));utils[_0x101e('0x9')](_0x101e('0xa'),_0x197883);delete dials[_0x197883[_0x101e('0xb')]];}exports['newexten']=function(_0xba8806){try{utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0xe'),_0xba8806[_0x101e('0xb')]),_0xba8806);utils[_0x101e('0x3')](util[_0x101e('0xd')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0xba8806[_0x101e('0xb')],_0xba8806[_0x101e('0xf')],_0xba8806[_0x101e('0x10')]));if(_0xba8806[_0x101e('0xf')][_0x101e('0x11')]()==_0x101e('0x12')&&_[_0x101e('0x13')](_0xba8806[_0x101e('0x10')][_0x101e('0x11')](),_0x101e('0x14'))){var _0x2b70a3=_0xba8806['appdata'][_0x101e('0x15')]('=');dials[_0xba8806[_0x101e('0xb')]]={'routeId':_0x2b70a3[0x1]};}}catch(_0x4413fc){utils['error'](util['format']('[%s][dials][newexten]',_0xba8806[_0x101e('0xb')]),_0x4413fc);}};exports[_0x101e('0x16')]=function(_0x3c6c63){try{utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x17'),_0x3c6c63[_0x101e('0xb')]),_0x3c6c63);if(!_[_0x101e('0x18')](_0x3c6c63[_0x101e('0x19')][_0x101e('0x1a')])){utils['info'](util['format'](_0x101e('0x1b'),_0x3c6c63[_0x101e('0xb')],_0x3c6c63[_0x101e('0x1c')]));dials[_0x3c6c63[_0x101e('0xb')]]={'routeId':_0x3c6c63['value']};}}catch(_0x19abac){utils[_0x101e('0x1d')](util['format']('[%s][dials][varset]',_0x3c6c63[_0x101e('0xb')]),_0x19abac);}};exports[_0x101e('0x1e')]=function(_0x1aa648){try{if(!_[_0x101e('0x18')](dials[_0x1aa648[_0x101e('0xb')]])){utils['debug'](util[_0x101e('0xd')]('[%s][dials][dialbegin]',_0x1aa648[_0x101e('0xb')]),_0x1aa648);dials[_0x1aa648[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x1aa648[_0x101e('0xb')]],_0x1aa648);dials[_0x1aa648[_0x101e('0xb')]][_0x101e('0x20')]=utils['now']();dials[_0x1aa648[_0x101e('0xb')]]['lastevent']='called';utils[_0x101e('0x3')](util[_0x101e('0xd')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1aa648[_0x101e('0xb')],dials[_0x1aa648[_0x101e('0xb')]][_0x101e('0x20')]));}}catch(_0x4161c4){utils[_0x101e('0x1d')](util[_0x101e('0xd')](_0x101e('0x21'),_0x1aa648['uniqueid']),_0x4161c4);}};exports[_0x101e('0x22')]=function(_0x3e87a1){try{if(!_[_0x101e('0x18')](dials[_0x3e87a1['uniqueid']])){utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x23'),_0x3e87a1[_0x101e('0xb')]),_0x3e87a1);dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x8')]=_0x3e87a1[_0x101e('0x8')];if(_0x3e87a1[_0x101e('0x8')]==_0x101e('0x24')){dials[_0x3e87a1[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x3e87a1['uniqueid']],_0x3e87a1);dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x25')]=utils[_0x101e('0x26')]();dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x27')]=_0x101e('0x28');utils[_0x101e('0x3')](util[_0x101e('0xd')](_0x101e('0x29'),_0x3e87a1[_0x101e('0xb')],_0x3e87a1['dialstatus'],dials[_0x3e87a1[_0x101e('0xb')]][_0x101e('0x25')]));}else{utils[_0x101e('0x3')](util[_0x101e('0xd')](_0x101e('0x2a'),_0x3e87a1[_0x101e('0xb')],_0x3e87a1[_0x101e('0x8')]));}}}catch(_0x1559c8){utils['error'](util[_0x101e('0xd')](_0x101e('0x23'),_0x3e87a1[_0x101e('0xb')]),_0x1559c8);}};exports[_0x101e('0x2b')]=function(_0x2bbd51){try{if(!_[_0x101e('0x18')](dials[_0x2bbd51[_0x101e('0xb')]])){utils[_0x101e('0xc')](util[_0x101e('0xd')](_0x101e('0x2c'),_0x2bbd51[_0x101e('0xb')]),_0x2bbd51);utils['info'](util[_0x101e('0xd')](_0x101e('0x2d'),_0x2bbd51['uniqueid'],_0x2bbd51[_0x101e('0x6')],_0x2bbd51['calleridname'],_0x2bbd51[_0x101e('0x2e')]));dials[_0x2bbd51[_0x101e('0xb')]]=_[_0x101e('0x1f')](dials[_0x2bbd51[_0x101e('0xb')]],{'endtime':utils[_0x101e('0x26')](),'lastevent':_0x101e('0x2f')});dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x30')]=utils[_0x101e('0x31')](dials[_0x2bbd51['uniqueid']]['endtime'],dials[_0x2bbd51[_0x101e('0xb')]]['starttime']);dials[_0x2bbd51['uniqueid']][_0x101e('0x32')]=utils['diffTime'](dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]||dials[_0x2bbd51['uniqueid']][_0x101e('0x33')],dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x20')]);dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x34')]=dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]?utils[_0x101e('0x31')](dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x33')],dials[_0x2bbd51[_0x101e('0xb')]][_0x101e('0x25')]):0x0;writeDB(dials[_0x2bbd51[_0x101e('0xb')]]);}}catch(_0x264986){utils[_0x101e('0x1d')](util[_0x101e('0xd')]('[%s][dials][hangup]',_0x2bbd51[_0x101e('0xb')]),_0x264986);}};
\ No newline at end of file
+var _0x1cea=['dialend','[%s][dials][dialend]','ANSWER','answertime','[%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','cause-txt','holdtime','diffTime','endtime','billableseconds','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','isNil','assign','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','[%s][dials][dialbegin]'];(function(_0x4fff54,_0x30fb87){var _0x18097f=function(_0x1692a8){while(--_0x1692a8){_0x4fff54['push'](_0x4fff54['shift']());}};_0x18097f(++_0x30fb87);}(_0x1cea,0xa8));var _0xa1ce=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x1cea[_0x495e9f];return _0xb249d2;};'use strict';var _=require(_0xa1ce('0x0'));var util=require('util');var utils=require(_0xa1ce('0x1'));var dials={};function writeDB(_0x5cbb0e){utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0x4'),_0x5cbb0e[_0xa1ce('0x5')],_0x5cbb0e['channel'],_0x5cbb0e[_0xa1ce('0x6')],_0x5cbb0e[_0xa1ce('0x7')],_0x5cbb0e['connectedlinenum'],_0x5cbb0e[_0xa1ce('0x8')]));utils[_0xa1ce('0x9')](_0xa1ce('0xa'),_0x5cbb0e);delete dials[_0x5cbb0e[_0xa1ce('0x5')]];}exports['newexten']=function(_0x39d865){try{utils[_0xa1ce('0xb')](util['format'](_0xa1ce('0xc'),_0x39d865[_0xa1ce('0x5')]),_0x39d865);utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0xd'),_0x39d865[_0xa1ce('0x5')],_0x39d865[_0xa1ce('0xe')],_0x39d865[_0xa1ce('0xf')]));if(_0x39d865['application'][_0xa1ce('0x10')]()==_0xa1ce('0x11')&&_[_0xa1ce('0x12')](_0x39d865[_0xa1ce('0xf')][_0xa1ce('0x10')](),_0xa1ce('0x13'))){var _0xf8e197=_0x39d865[_0xa1ce('0xf')][_0xa1ce('0x14')]('=');dials[_0x39d865[_0xa1ce('0x5')]]={'routeId':_0xf8e197[0x1]};}}catch(_0x431cb1){utils[_0xa1ce('0x15')](util[_0xa1ce('0x3')](_0xa1ce('0xc'),_0x39d865[_0xa1ce('0x5')]),_0x431cb1);}};exports[_0xa1ce('0x16')]=function(_0x3713d7){try{utils[_0xa1ce('0xb')](util[_0xa1ce('0x3')]('[%s][dials][varset]',_0x3713d7[_0xa1ce('0x5')]),_0x3713d7);if(!_['isNil'](_0x3713d7[_0xa1ce('0x17')]['outboundrouteid'])){utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0x18'),_0x3713d7['uniqueid'],_0x3713d7[_0xa1ce('0x19')]));dials[_0x3713d7[_0xa1ce('0x5')]]={'routeId':_0x3713d7[_0xa1ce('0x19')]};}}catch(_0x573c5e){utils[_0xa1ce('0x15')](util[_0xa1ce('0x3')](_0xa1ce('0x1a'),_0x3713d7[_0xa1ce('0x5')]),_0x573c5e);}};exports[_0xa1ce('0x1b')]=function(_0x5c291d){try{if(!_[_0xa1ce('0x1c')](dials[_0x5c291d[_0xa1ce('0x5')]])){utils[_0xa1ce('0xb')](util[_0xa1ce('0x3')]('[%s][dials][dialbegin]',_0x5c291d[_0xa1ce('0x5')]),_0x5c291d);dials[_0x5c291d[_0xa1ce('0x5')]]=_[_0xa1ce('0x1d')](dials[_0x5c291d[_0xa1ce('0x5')]],_0x5c291d);dials[_0x5c291d[_0xa1ce('0x5')]]['starttime']=utils[_0xa1ce('0x1e')]();dials[_0x5c291d['uniqueid']][_0xa1ce('0x1f')]=_0xa1ce('0x20');utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0x21'),_0x5c291d['uniqueid'],dials[_0x5c291d['uniqueid']][_0xa1ce('0x22')]));}}catch(_0x23b07d){utils[_0xa1ce('0x15')](util[_0xa1ce('0x3')](_0xa1ce('0x23'),_0x5c291d[_0xa1ce('0x5')]),_0x23b07d);}};exports[_0xa1ce('0x24')]=function(_0x52494d){try{if(!_[_0xa1ce('0x1c')](dials[_0x52494d[_0xa1ce('0x5')]])){utils[_0xa1ce('0xb')](util[_0xa1ce('0x3')](_0xa1ce('0x25'),_0x52494d[_0xa1ce('0x5')]),_0x52494d);dials[_0x52494d['uniqueid']]['dialstatus']=_0x52494d[_0xa1ce('0x8')];if(_0x52494d['dialstatus']==_0xa1ce('0x26')){dials[_0x52494d[_0xa1ce('0x5')]]=_[_0xa1ce('0x1d')](dials[_0x52494d['uniqueid']],_0x52494d);dials[_0x52494d[_0xa1ce('0x5')]][_0xa1ce('0x27')]=utils['now']();dials[_0x52494d[_0xa1ce('0x5')]][_0xa1ce('0x1f')]='connect';utils['info'](util['format'](_0xa1ce('0x28'),_0x52494d[_0xa1ce('0x5')],_0x52494d[_0xa1ce('0x8')],dials[_0x52494d[_0xa1ce('0x5')]]['answertime']));}else{utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0x29'),_0x52494d['uniqueid'],_0x52494d['dialstatus']));}}}catch(_0x4da49d){utils[_0xa1ce('0x15')](util[_0xa1ce('0x3')](_0xa1ce('0x25'),_0x52494d['uniqueid']),_0x4da49d);}};exports[_0xa1ce('0x2a')]=function(_0x3be263){try{if(!_[_0xa1ce('0x1c')](dials[_0x3be263['uniqueid']])){utils[_0xa1ce('0xb')](util[_0xa1ce('0x3')](_0xa1ce('0x2b'),_0x3be263[_0xa1ce('0x5')]),_0x3be263);utils[_0xa1ce('0x2')](util[_0xa1ce('0x3')](_0xa1ce('0x2c'),_0x3be263[_0xa1ce('0x5')],_0x3be263[_0xa1ce('0x7')],_0x3be263[_0xa1ce('0x2d')],_0x3be263[_0xa1ce('0x2e')]));dials[_0x3be263[_0xa1ce('0x5')]]=_['assign'](dials[_0x3be263[_0xa1ce('0x5')]],{'endtime':utils[_0xa1ce('0x1e')](),'lastevent':'complete'});dials[_0x3be263[_0xa1ce('0x5')]]['duration']=utils['diffTime'](dials[_0x3be263['uniqueid']]['endtime'],dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x22')]);dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x2f')]=utils[_0xa1ce('0x30')](dials[_0x3be263[_0xa1ce('0x5')]]['answertime']||dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x31')],dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x22')]);dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x32')]=dials[_0x3be263['uniqueid']][_0xa1ce('0x27')]?utils[_0xa1ce('0x30')](dials[_0x3be263[_0xa1ce('0x5')]][_0xa1ce('0x31')],dials[_0x3be263[_0xa1ce('0x5')]]['answertime']):0x0;writeDB(dials[_0x3be263[_0xa1ce('0x5')]]);}}catch(_0x23effc){utils[_0xa1ce('0x15')](util[_0xa1ce('0x3')]('[%s][dials][hangup]',_0x3be263['uniqueid']),_0x23effc);}};
\ No newline at end of file
index d95da4a..5e7c2ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5118=['asterisk-manager','../../config/environment','./utils','asterisk','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]'];(function(_0x49e0e2,_0x39effb){var _0x2d83f4=function(_0x2af8f2){while(--_0x2af8f2){_0x49e0e2['push'](_0x49e0e2['shift']());}};_0x2d83f4(++_0x39effb);}(_0x5118,0x80));var _0x8511=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x5118[_0x5a95fa];return _0x1a61b8;};var AsteriskManager=require(_0x8511('0x0'));var config=require(_0x8511('0x1'));var utils=require(_0x8511('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0x8511('0x3')]['port'],config['asterisk']['ip'],config[_0x8511('0x3')]['username'],config[_0x8511('0x3')]['password'],!![]);ami[_0x8511('0x4')]();if(config[_0x8511('0x5')]&&config[_0x8511('0x5')][_0x8511('0x6')]){utils[_0x8511('0x7')](_0x8511('0x8'));}else{var agents=require(_0x8511('0x9'));var calls=require(_0x8511('0xa'));var queues=require(_0x8511('0xb'));var recordings=require(_0x8511('0xc'));var members=require(_0x8511('0xd'));var dials=require(_0x8511('0xe'));var transfers=require(_0x8511('0xf'));var core=require(_0x8511('0x10'));ami['on'](_0x8511('0x11'),core['connect']);ami['on'](_0x8511('0x12'),core['shutdown']);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x8511('0x13'),core[_0x8511('0x13')]);ami['on'](_0x8511('0x14'),core[_0x8511('0x14')]);ami['on'](_0x8511('0x15'),core[_0x8511('0x15')]);ami['on'](_0x8511('0x16'),function(_0x3f7dca){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x19'),_0x3f7dca[_0x8511('0x1a')]),_0x3f7dca);members[_0x8511('0x16')](_0x3f7dca);}catch(_0x1744b5){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x19'),_0x3f7dca[_0x8511('0x1a')]),_0x1744b5);}});ami['on'](_0x8511('0x1b'),function(_0x58ae56){try{utils[_0x8511('0x17')](util[_0x8511('0x18')]('[%s][index][agentcalled]',_0x58ae56[_0x8511('0x1c')]),_0x58ae56);agents[_0x8511('0x1b')](_0x58ae56);}catch(_0xc3fb57){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x1d'),_0x58ae56['uniqueid']),_0xc3fb57);}});ami['on'](_0x8511('0x1e'),function(_0x337dcd){try{utils['debug'](util[_0x8511('0x18')]('[%s][index][agentringnoanswer]',_0x337dcd[_0x8511('0x1c')]),_0x337dcd);agents[_0x8511('0x1e')](_0x337dcd);}catch(_0x2c8bb3){utils[_0x8511('0x13')](util['format']('[%s][index][agentringnoanswer]',_0x337dcd[_0x8511('0x1c')]),_0x2c8bb3);}});ami['on']('agentconnect',function(_0x2982b1){try{utils['debug'](util['format'](_0x8511('0x1f'),_0x2982b1[_0x8511('0x1c')]),_0x2982b1);agents[_0x8511('0x20')](_0x2982b1);queues[_0x8511('0x20')](_0x2982b1);}catch(_0x559ad){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x1f'),_0x2982b1[_0x8511('0x1c')]),_0x559ad);}});ami['on'](_0x8511('0x21'),function(_0x25c2d9){try{utils['debug'](util['format'](_0x8511('0x22'),_0x25c2d9[_0x8511('0x1c')]),_0x25c2d9);agents[_0x8511('0x21')](_0x25c2d9);queues[_0x8511('0x21')](_0x25c2d9);members[_0x8511('0x21')](_0x25c2d9);}catch(_0x65c0cb){utils['error'](util[_0x8511('0x18')](_0x8511('0x22'),_0x25c2d9[_0x8511('0x1c')]),_0x65c0cb);}});ami['on'](_0x8511('0x23'),function(_0x4af493){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x24'),_0x4af493[_0x8511('0x1c')]),_0x4af493);agents[_0x8511('0x23')](_0x4af493);queues[_0x8511('0x23')](_0x4af493);}catch(_0x3322d5){utils['error'](util[_0x8511('0x18')]('[%s][index][queuecallerabandon]',_0x4af493[_0x8511('0x1c')]),_0x3322d5);}});ami['on'](_0x8511('0x25'),function(_0x8414fe){try{utils['debug'](util[_0x8511('0x18')](_0x8511('0x26'),_0x8414fe[_0x8511('0x1c')]),_0x8414fe);queues[_0x8511('0x25')](_0x8414fe);recordings[_0x8511('0x25')](_0x8414fe);}catch(_0x3db9be){utils[_0x8511('0x13')](util['format'](_0x8511('0x26'),_0x8414fe['uniqueid']),_0x3db9be);}});ami['on'](_0x8511('0x27'),function(_0x40800b){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x28'),_0x40800b[_0x8511('0x1c')]),_0x40800b);queues[_0x8511('0x27')](_0x40800b);}catch(_0xf8f6a1){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x28'),_0x40800b['uniqueid']),_0xf8f6a1);}});ami['on'](_0x8511('0x29'),function(_0x3ea94f){try{utils[_0x8511('0x17')](util[_0x8511('0x18')]('[%s][index][musiconholdstart]',_0x3ea94f[_0x8511('0x1c')]),_0x3ea94f);queues['musiconholdstart'](_0x3ea94f);calls[_0x8511('0x29')](_0x3ea94f);}catch(_0x476cad){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][musiconholdstart]',_0x3ea94f[_0x8511('0x1c')]),_0x476cad);}});ami['on'](_0x8511('0x2a'),function(_0xaceb41){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x2b'),_0xaceb41[_0x8511('0x1c')]),_0xaceb41);queues[_0x8511('0x2a')](_0xaceb41);calls[_0x8511('0x2a')](_0xaceb41);}catch(_0x5000d2){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2b'),_0xaceb41[_0x8511('0x1c')]),_0x5000d2);}});ami['on']('newstate',function(_0x5643ec){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x2c'),_0x5643ec[_0x8511('0x1c')]),_0x5643ec);calls[_0x8511('0x2d')](_0x5643ec);recordings['newstate'](_0x5643ec);}catch(_0x3aae7b){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2c'),_0x5643ec['uniqueid']),_0x3aae7b);}});ami['on'](_0x8511('0x2e'),function(_0x3e88ba){try{utils[_0x8511('0x17')](util['format']('[%s][index][hangup]',_0x3e88ba[_0x8511('0x1c')]),_0x3e88ba);calls[_0x8511('0x2e')](_0x3e88ba);recordings[_0x8511('0x2e')](_0x3e88ba);dials[_0x8511('0x2e')](_0x3e88ba);agents[_0x8511('0x2e')](_0x3e88ba);queues[_0x8511('0x2e')](_0x3e88ba);}catch(_0x500ed0){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x2f'),_0x3e88ba['uniqueid']),_0x500ed0);}});ami['on'](_0x8511('0x30'),function(_0x50ed33){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x31'),_0x50ed33[_0x8511('0x1c')]),_0x50ed33);members[_0x8511('0x30')](_0x50ed33);}catch(_0x2558ef){utils[_0x8511('0x13')](util[_0x8511('0x18')](_0x8511('0x31'),_0x50ed33['uniqueid']),_0x2558ef);}});ami['on'](_0x8511('0x32'),function(_0xed74a3){try{utils[_0x8511('0x17')](util['format'](_0x8511('0x33'),_0xed74a3[_0x8511('0x1c')]),_0xed74a3);queues['blindtransfer'](_0xed74a3);agents[_0x8511('0x32')](_0xed74a3);transfers[_0x8511('0x32')](_0xed74a3);}catch(_0x51942){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][blindtransfer]',_0xed74a3['uniqueid']),_0x51942);}});ami['on'](_0x8511('0x34'),function(_0x5b35c8){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x35'),_0x5b35c8[_0x8511('0x36')]),_0x5b35c8);queues[_0x8511('0x34')](_0x5b35c8);transfers[_0x8511('0x34')](_0x5b35c8);agents['attendedtransfer'](_0x5b35c8);calls[_0x8511('0x34')](_0x5b35c8);}catch(_0x330edf){utils[_0x8511('0x13')](util['format'](_0x8511('0x35'),_0x5b35c8['origtransfereruniqueid']),_0x330edf);}});ami['on'](_0x8511('0x37'),function(_0x1f90cd){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x38'),_0x1f90cd[_0x8511('0x1c')]),_0x1f90cd);queues[_0x8511('0x37')](_0x1f90cd);recordings[_0x8511('0x37')](_0x1f90cd);calls[_0x8511('0x37')](_0x1f90cd);dials[_0x8511('0x37')](_0x1f90cd);}catch(_0x1d1d6e){utils[_0x8511('0x13')](util['format']('[%s][index][varset]',_0x1f90cd['uniqueid']),_0x1d1d6e);}});ami['on']('newexten',function(_0x249a1e){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x39'),_0x249a1e[_0x8511('0x1c')]),_0x249a1e);calls[_0x8511('0x3a')](_0x249a1e);recordings['newexten'](_0x249a1e);dials[_0x8511('0x3a')](_0x249a1e);}catch(_0x4c70d3){utils['error'](util[_0x8511('0x18')](_0x8511('0x39'),_0x249a1e[_0x8511('0x1c')]),_0x4c70d3);}});ami['on']('newchannel',function(_0x2a12d7){try{utils[_0x8511('0x17')](util['format']('[%s][index][newchannel]',_0x2a12d7[_0x8511('0x1c')]),_0x2a12d7);calls[_0x8511('0x3b')](_0x2a12d7);recordings[_0x8511('0x3b')](_0x2a12d7);}catch(_0x393e89){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][newchannel]',_0x2a12d7[_0x8511('0x1c')]),_0x393e89);}});ami['on']('dialbegin',function(_0x1af22d){try{utils['debug'](util[_0x8511('0x18')]('[%s][index][dialbegin]',_0x1af22d[_0x8511('0x1c')]),_0x1af22d);dials[_0x8511('0x3c')](_0x1af22d);}catch(_0x3f4e2e){utils['error'](util['format'](_0x8511('0x3d'),_0x1af22d[_0x8511('0x1c')]),_0x3f4e2e);}});ami['on'](_0x8511('0x3e'),function(_0x1ddb78){try{utils[_0x8511('0x17')](util[_0x8511('0x18')](_0x8511('0x3f'),_0x1ddb78[_0x8511('0x1c')]),_0x1ddb78);dials[_0x8511('0x3e')](_0x1ddb78);}catch(_0x1b44ba){utils[_0x8511('0x13')](util[_0x8511('0x18')]('[%s][index][dialend]',_0x1ddb78[_0x8511('0x1c')]),_0x1b44ba);}});}
\ No newline at end of file
+var _0x7b03=['info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','xdr','disabled'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x7b03,0x7d));var _0x37b0=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x7b03[_0x1f3aec];return _0x409f0d;};var AsteriskManager=require(_0x37b0('0x0'));var config=require(_0x37b0('0x1'));var utils=require(_0x37b0('0x2'));var util=require(_0x37b0('0x3'));var ami=new AsteriskManager(config[_0x37b0('0x4')][_0x37b0('0x5')],config[_0x37b0('0x4')]['ip'],config[_0x37b0('0x4')][_0x37b0('0x6')],config[_0x37b0('0x4')]['password'],!![]);ami['keepConnected']();if(config[_0x37b0('0x7')]&&config['xdr'][_0x37b0('0x8')]){utils[_0x37b0('0x9')](_0x37b0('0xa'));}else{var agents=require(_0x37b0('0xb'));var calls=require(_0x37b0('0xc'));var queues=require('./queues.controller');var recordings=require(_0x37b0('0xd'));var members=require(_0x37b0('0xe'));var dials=require(_0x37b0('0xf'));var transfers=require('./transfers.controller');var core=require(_0x37b0('0x10'));ami['on'](_0x37b0('0x11'),core[_0x37b0('0x11')]);ami['on'](_0x37b0('0x12'),core[_0x37b0('0x12')]);ami['on'](_0x37b0('0x13'),core[_0x37b0('0x13')]);ami['on'](_0x37b0('0x14'),core['error']);ami['on'](_0x37b0('0x15'),core[_0x37b0('0x15')]);ami['on'](_0x37b0('0x16'),core['managerevent']);ami['on'](_0x37b0('0x17'),function(_0x50a6e5){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x1a'),_0x50a6e5[_0x37b0('0x1b')]),_0x50a6e5);members[_0x37b0('0x17')](_0x50a6e5);}catch(_0x3b4f4a){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x1a'),_0x50a6e5[_0x37b0('0x1b')]),_0x3b4f4a);}});ami['on']('agentcalled',function(_0x4c18e5){try{utils['debug'](util['format'](_0x37b0('0x1c'),_0x4c18e5['uniqueid']),_0x4c18e5);agents['agentcalled'](_0x4c18e5);}catch(_0x4a0a46){utils[_0x37b0('0x14')](util[_0x37b0('0x19')]('[%s][index][agentcalled]',_0x4c18e5[_0x37b0('0x1d')]),_0x4a0a46);}});ami['on'](_0x37b0('0x1e'),function(_0x29669d){try{utils[_0x37b0('0x18')](util['format'](_0x37b0('0x1f'),_0x29669d[_0x37b0('0x1d')]),_0x29669d);agents[_0x37b0('0x1e')](_0x29669d);}catch(_0x434cac){utils[_0x37b0('0x14')](util['format'](_0x37b0('0x1f'),_0x29669d[_0x37b0('0x1d')]),_0x434cac);}});ami['on'](_0x37b0('0x20'),function(_0x41efc0){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')]('[%s][index][agentconnect]',_0x41efc0[_0x37b0('0x1d')]),_0x41efc0);agents[_0x37b0('0x20')](_0x41efc0);queues[_0x37b0('0x20')](_0x41efc0);}catch(_0x4ee256){utils[_0x37b0('0x14')](util[_0x37b0('0x19')]('[%s][index][agentconnect]',_0x41efc0[_0x37b0('0x1d')]),_0x4ee256);}});ami['on']('agentcomplete',function(_0x1922f1){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x21'),_0x1922f1[_0x37b0('0x1d')]),_0x1922f1);agents[_0x37b0('0x22')](_0x1922f1);queues[_0x37b0('0x22')](_0x1922f1);members[_0x37b0('0x22')](_0x1922f1);}catch(_0x5f2248){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x21'),_0x1922f1['uniqueid']),_0x5f2248);}});ami['on']('queuecallerabandon',function(_0x1fac4a){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x23'),_0x1fac4a[_0x37b0('0x1d')]),_0x1fac4a);agents['queuecallerabandon'](_0x1fac4a);queues[_0x37b0('0x24')](_0x1fac4a);}catch(_0x5296e4){utils[_0x37b0('0x14')](util['format'](_0x37b0('0x23'),_0x1fac4a[_0x37b0('0x1d')]),_0x5296e4);}});ami['on']('queuecallerjoin',function(_0x1b1d37){try{utils['debug'](util[_0x37b0('0x19')](_0x37b0('0x25'),_0x1b1d37[_0x37b0('0x1d')]),_0x1b1d37);queues[_0x37b0('0x26')](_0x1b1d37);recordings['queuecallerjoin'](_0x1b1d37);}catch(_0x45b93e){utils[_0x37b0('0x14')](util['format']('[%s][index][queuecallerjoin]',_0x1b1d37[_0x37b0('0x1d')]),_0x45b93e);}});ami['on'](_0x37b0('0x27'),function(_0x3a297c){try{utils[_0x37b0('0x18')](util['format'](_0x37b0('0x28'),_0x3a297c['uniqueid']),_0x3a297c);queues['queuecallerleave'](_0x3a297c);}catch(_0x4b7708){utils['error'](util[_0x37b0('0x19')](_0x37b0('0x28'),_0x3a297c[_0x37b0('0x1d')]),_0x4b7708);}});ami['on']('musiconholdstart',function(_0xb4c849){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')]('[%s][index][musiconholdstart]',_0xb4c849[_0x37b0('0x1d')]),_0xb4c849);queues['musiconholdstart'](_0xb4c849);calls[_0x37b0('0x29')](_0xb4c849);}catch(_0x2ada17){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x2a'),_0xb4c849[_0x37b0('0x1d')]),_0x2ada17);}});ami['on'](_0x37b0('0x2b'),function(_0x2bdad8){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x2c'),_0x2bdad8[_0x37b0('0x1d')]),_0x2bdad8);queues[_0x37b0('0x2b')](_0x2bdad8);calls['musiconholdstop'](_0x2bdad8);}catch(_0x452072){utils[_0x37b0('0x14')](util[_0x37b0('0x19')]('[%s][index][musiconholdstop]',_0x2bdad8[_0x37b0('0x1d')]),_0x452072);}});ami['on']('newstate',function(_0x5b3230){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x2d'),_0x5b3230[_0x37b0('0x1d')]),_0x5b3230);calls['newstate'](_0x5b3230);recordings[_0x37b0('0x2e')](_0x5b3230);}catch(_0x36afac){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x2d'),_0x5b3230[_0x37b0('0x1d')]),_0x36afac);}});ami['on'](_0x37b0('0x2f'),function(_0x13a474){try{utils[_0x37b0('0x18')](util['format']('[%s][index][hangup]',_0x13a474[_0x37b0('0x1d')]),_0x13a474);calls[_0x37b0('0x2f')](_0x13a474);recordings[_0x37b0('0x2f')](_0x13a474);dials[_0x37b0('0x2f')](_0x13a474);agents[_0x37b0('0x2f')](_0x13a474);queues[_0x37b0('0x2f')](_0x13a474);}catch(_0x12d6f4){utils[_0x37b0('0x14')](util['format'](_0x37b0('0x30'),_0x13a474[_0x37b0('0x1d')]),_0x12d6f4);}});ami['on']('cdr',function(_0x59693c){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')]('[%s][index][cdr]',_0x59693c[_0x37b0('0x1d')]),_0x59693c);members[_0x37b0('0x31')](_0x59693c);}catch(_0x3c73b1){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x32'),_0x59693c[_0x37b0('0x1d')]),_0x3c73b1);}});ami['on'](_0x37b0('0x33'),function(_0x496224){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x34'),_0x496224[_0x37b0('0x1d')]),_0x496224);queues[_0x37b0('0x33')](_0x496224);agents[_0x37b0('0x33')](_0x496224);transfers[_0x37b0('0x33')](_0x496224);}catch(_0x1c2949){utils[_0x37b0('0x14')](util['format'](_0x37b0('0x34'),_0x496224[_0x37b0('0x1d')]),_0x1c2949);}});ami['on'](_0x37b0('0x35'),function(_0x37b97c){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')]('[%s][index][attendedtransfer]',_0x37b97c[_0x37b0('0x36')]),_0x37b97c);queues['attendedtransfer'](_0x37b97c);transfers[_0x37b0('0x35')](_0x37b97c);agents[_0x37b0('0x35')](_0x37b97c);calls[_0x37b0('0x35')](_0x37b97c);}catch(_0x2201cb){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x37'),_0x37b97c[_0x37b0('0x36')]),_0x2201cb);}});ami['on']('varset',function(_0x332ed4){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x38'),_0x332ed4[_0x37b0('0x1d')]),_0x332ed4);queues['varset'](_0x332ed4);recordings[_0x37b0('0x39')](_0x332ed4);calls[_0x37b0('0x39')](_0x332ed4);dials['varset'](_0x332ed4);}catch(_0x43746a){utils[_0x37b0('0x14')](util[_0x37b0('0x19')]('[%s][index][varset]',_0x332ed4[_0x37b0('0x1d')]),_0x43746a);}});ami['on']('newexten',function(_0x5f1c37){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')]('[%s][index][newexten]',_0x5f1c37[_0x37b0('0x1d')]),_0x5f1c37);calls['newexten'](_0x5f1c37);recordings[_0x37b0('0x3a')](_0x5f1c37);dials[_0x37b0('0x3a')](_0x5f1c37);}catch(_0x5def8f){utils[_0x37b0('0x14')](util['format'](_0x37b0('0x3b'),_0x5f1c37['uniqueid']),_0x5def8f);}});ami['on'](_0x37b0('0x3c'),function(_0xb2f859){try{utils[_0x37b0('0x18')](util['format'](_0x37b0('0x3d'),_0xb2f859[_0x37b0('0x1d')]),_0xb2f859);calls[_0x37b0('0x3c')](_0xb2f859);recordings[_0x37b0('0x3c')](_0xb2f859);}catch(_0x1eecd6){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x3d'),_0xb2f859[_0x37b0('0x1d')]),_0x1eecd6);}});ami['on'](_0x37b0('0x3e'),function(_0x51f1b5){try{utils[_0x37b0('0x18')](util[_0x37b0('0x19')](_0x37b0('0x3f'),_0x51f1b5[_0x37b0('0x1d')]),_0x51f1b5);dials['dialbegin'](_0x51f1b5);}catch(_0x13643b){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x40'),_0x51f1b5[_0x37b0('0x1d')]),_0x13643b);}});ami['on'](_0x37b0('0x41'),function(_0x4cf9a8){try{utils['debug'](util['format'](_0x37b0('0x42'),_0x4cf9a8[_0x37b0('0x1d')]),_0x4cf9a8);dials[_0x37b0('0x41')](_0x4cf9a8);}catch(_0x116bbc){utils[_0x37b0('0x14')](util[_0x37b0('0x19')](_0x37b0('0x42'),_0x4cf9a8[_0x37b0('0x1d')]),_0x116bbc);}});}
\ No newline at end of file
index 8151bea..6a5aa6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb8f=['[%s][members][cdr]','data1','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','internal','getUserByName','split','then','name','request','catch','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr'];(function(_0x560ef7,_0x4a324f){var _0x316a1f=function(_0x48b6b3){while(--_0x48b6b3){_0x560ef7['push'](_0x560ef7['shift']());}};_0x316a1f(++_0x4a324f);}(_0xbb8f,0x99));var _0xfbb8=function(_0xfbfba4,_0x4c9f69){_0xfbfba4=_0xfbfba4-0x0;var _0x187666=_0xbb8f[_0xfbfba4];return _0x187666;};'use strict';var _=require(_0xfbb8('0x0'));var util=require('util');var utils=require(_0xfbb8('0x1'));var members={};var exclude=[_0xfbb8('0x2'),_0xfbb8('0x3')];function writeDB(_0x449f7b){utils[_0xfbb8('0x4')](util[_0xfbb8('0x5')](_0xfbb8('0x6'),_0x449f7b[_0xfbb8('0x7')],_0x449f7b[_0xfbb8('0x8')],_0x449f7b[_0xfbb8('0x9')],_0x449f7b[_0xfbb8('0xa')],_0x449f7b[_0xfbb8('0xb')],_0x449f7b[_0xfbb8('0xc')]));if(_0x449f7b[_0xfbb8('0x8')]){utils[_0xfbb8('0xd')](_0x449f7b[_0xfbb8('0x8')])['then'](function(_0x4c20b4){if(_0x4c20b4){_0x449f7b['membername']=_0x4c20b4['name'];_0x449f7b[_0xfbb8('0xe')]=_0x4c20b4[_0xfbb8('0xe')];utils['request']('CreateMemberReport',_0x449f7b);}else{utils[_0xfbb8('0xf')](_0x449f7b[_0xfbb8('0x8')][_0xfbb8('0x10')]('/')[0x1])[_0xfbb8('0x11')](function(_0xf2d19b){if(_0xf2d19b){_0x449f7b[_0xfbb8('0xb')]=_0xf2d19b[_0xfbb8('0x12')];_0x449f7b[_0xfbb8('0xe')]=_0xf2d19b[_0xfbb8('0xe')];utils[_0xfbb8('0x13')]('CreateMemberReport',_0x449f7b);}});}})[_0xfbb8('0x14')](function(_0x1ca9b0){utils['error'](util[_0xfbb8('0x5')]('[%s][members][writeDB]',_0x449f7b[_0xfbb8('0x7')]),_0x1ca9b0);});}delete members[_0x449f7b[_0xfbb8('0x8')]];}function startsWith(_0x104a71,_0x550db6){return _[_0xfbb8('0x15')](_0x104a71,function(_0x3ecc3b){return _[_0xfbb8('0x16')](_0x550db6,_0x3ecc3b);});}exports[_0xfbb8('0x17')]=function(_0x2a17da){try{utils[_0xfbb8('0x18')](util[_0xfbb8('0x5')](_0xfbb8('0x19'),members[_0x2a17da[_0xfbb8('0x1a')]]?members[_0x2a17da[_0xfbb8('0x1a')]]['uniqueid']:_0x2a17da[_0xfbb8('0x1a')]),_0x2a17da);utils['info'](util[_0xfbb8('0x5')](_0xfbb8('0x1b'),members[_0x2a17da['device']]?members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]:_0x2a17da[_0xfbb8('0x1a')],_0x2a17da[_0xfbb8('0x1c')],_0x2a17da[_0xfbb8('0x1a')]));switch(_0x2a17da['state']){case _0xfbb8('0x1d'):case _0xfbb8('0x1e'):if(!startsWith(exclude,_0x2a17da['device'])){members[_0x2a17da[_0xfbb8('0x1a')]]={'channel':_0xfbb8('0x1f'),'interface':_0x2a17da['device'],'type':_0xfbb8('0x20'),'enterAt':utils[_0xfbb8('0x21')](),'role':'agent'};}break;case _0xfbb8('0x22'):if(!_[_0xfbb8('0x23')](members[_0x2a17da[_0xfbb8('0x1a')]])){members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x24')]=utils['now']();members[_0x2a17da['device']]['duration']=utils['diffTime'](members[_0x2a17da['device']][_0xfbb8('0x24')],members[_0x2a17da['device']]['enterAt']);if(members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]){writeDB(members[_0x2a17da['device']]);}}break;default:break;}}catch(_0x14c32e){utils[_0xfbb8('0x25')](util['format']('[%s][members][devicestatechange]',members[_0x2a17da['device']]?members[_0x2a17da[_0xfbb8('0x1a')]][_0xfbb8('0x7')]:_0x2a17da[_0xfbb8('0x1a')]),_0x14c32e);}};exports[_0xfbb8('0x26')]=function(_0x4ef419){try{if(!_[_0xfbb8('0x23')](members[_0x4ef419[_0xfbb8('0x8')]])){utils[_0xfbb8('0x18')](util['format'](_0xfbb8('0x27'),_0x4ef419['uniqueid']),_0x4ef419);utils[_0xfbb8('0x4')](util['format'](_0xfbb8('0x28'),_0x4ef419['uniqueid'],_0x4ef419['interface'],_0x4ef419[_0xfbb8('0x29')]));members[_0x4ef419[_0xfbb8('0x8')]]=_['assign'](members[_0x4ef419[_0xfbb8('0x8')]],{'data4':_0x4ef419['queue'],'uniqueid':_0x4ef419[_0xfbb8('0x7')]});}}catch(_0x3b37f5){utils[_0xfbb8('0x25')](util[_0xfbb8('0x5')](_0xfbb8('0x27'),_0x4ef419[_0xfbb8('0x7')]),_0x3b37f5);}};exports[_0xfbb8('0x2a')]=function(_0x5dc67c){try{utils[_0xfbb8('0x18')](util['format'](_0xfbb8('0x2b'),_0x5dc67c[_0xfbb8('0x7')]),_0x5dc67c);if(_0x5dc67c['channel']){var _0x3f0fb3=_0x5dc67c[_0xfbb8('0x9')][_0xfbb8('0x10')]('-')[0x0];if(!_[_0xfbb8('0x23')](members[_0x3f0fb3])){members[_0x3f0fb3]=_['assign'](members[_0x3f0fb3],{'data1':members[_0x3f0fb3][_0xfbb8('0x2c')]||_0x5dc67c[_0xfbb8('0xc')],'data2':members[_0x3f0fb3][_0xfbb8('0xa')]||_0x5dc67c['source'],'data3':members[_0x3f0fb3][_0xfbb8('0x2d')]||_0x5dc67c[_0xfbb8('0x2e')],'uniqueid':members[_0x3f0fb3]['uniqueid']||_0x5dc67c['uniqueid']});utils[_0xfbb8('0x4')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5dc67c[_0xfbb8('0x7')],members[_0x3f0fb3][_0xfbb8('0x2c')],members[_0x3f0fb3][_0xfbb8('0xa')],members[_0x3f0fb3][_0xfbb8('0x2d')]));if(members[_0x3f0fb3]['exitAt']){writeDB(members[_0x3f0fb3]);}}}if(_0x5dc67c[_0xfbb8('0x2f')]){var _0x4f56bf=_0x5dc67c[_0xfbb8('0x2f')][_0xfbb8('0x10')]('-')[0x0];if(!_[_0xfbb8('0x23')](members[_0x4f56bf])){members[_0x4f56bf]=_['assign'](members[_0x4f56bf],{'data1':members[_0x4f56bf][_0xfbb8('0x2c')]||_0x5dc67c[_0xfbb8('0xc')],'data2':members[_0x4f56bf][_0xfbb8('0xa')]||_0x5dc67c['source'],'data3':members[_0x4f56bf][_0xfbb8('0x2d')]||_0x5dc67c['destination'],'uniqueid':members[_0x4f56bf][_0xfbb8('0x7')]||_0x5dc67c[_0xfbb8('0x7')]});utils['info'](util[_0xfbb8('0x5')](_0xfbb8('0x30'),_0x5dc67c[_0xfbb8('0x7')],members[_0x4f56bf][_0xfbb8('0x2c')],members[_0x4f56bf][_0xfbb8('0xa')],members[_0x4f56bf][_0xfbb8('0x2d')]));if(members[_0x4f56bf][_0xfbb8('0x24')]){writeDB(members[_0x4f56bf]);}}}}catch(_0x1fd58b){utils['error'](util[_0xfbb8('0x5')]('[%s][members][cdr]',_0x5dc67c[_0xfbb8('0x7')]),_0x1fd58b);}};
\ No newline at end of file
+var _0xd52d=['source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','agent','NOT_INUSE','isNil','diffTime','exitAt','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','debug','[%s][members][cdr]','data1'];(function(_0x4e0026,_0x195caf){var _0x41d6a2=function(_0x11f2e2){while(--_0x11f2e2){_0x4e0026['push'](_0x4e0026['shift']());}};_0x41d6a2(++_0x195caf);}(_0xd52d,0x1c7));var _0xdd52=function(_0x59604c,_0x5b6985){_0x59604c=_0x59604c-0x0;var _0x4f1d6d=_0xd52d[_0x59604c];return _0x4f1d6d;};'use strict';var _=require('lodash');var util=require(_0xdd52('0x0'));var utils=require(_0xdd52('0x1'));var members={};var exclude=['Local/_attended@transfer',_0xdd52('0x2')];function writeDB(_0x52e3a8){utils['info'](util[_0xdd52('0x3')](_0xdd52('0x4'),_0x52e3a8[_0xdd52('0x5')],_0x52e3a8[_0xdd52('0x6')],_0x52e3a8[_0xdd52('0x7')],_0x52e3a8[_0xdd52('0x8')],_0x52e3a8[_0xdd52('0x9')],_0x52e3a8[_0xdd52('0xa')]));if(_0x52e3a8['interface']){utils[_0xdd52('0xb')](_0x52e3a8[_0xdd52('0x6')])[_0xdd52('0xc')](function(_0x417e5d){if(_0x417e5d){_0x52e3a8[_0xdd52('0x9')]=_0x417e5d[_0xdd52('0xd')];_0x52e3a8[_0xdd52('0xe')]=_0x417e5d[_0xdd52('0xe')];utils[_0xdd52('0xf')](_0xdd52('0x10'),_0x52e3a8);}else{utils[_0xdd52('0x11')](_0x52e3a8[_0xdd52('0x6')][_0xdd52('0x12')]('/')[0x1])['then'](function(_0xe1fe3c){if(_0xe1fe3c){_0x52e3a8[_0xdd52('0x9')]=_0xe1fe3c[_0xdd52('0xd')];_0x52e3a8[_0xdd52('0xe')]=_0xe1fe3c[_0xdd52('0xe')];utils[_0xdd52('0xf')]('CreateMemberReport',_0x52e3a8);}});}})[_0xdd52('0x13')](function(_0x22f0d4){utils[_0xdd52('0x14')](util['format'](_0xdd52('0x15'),_0x52e3a8[_0xdd52('0x5')]),_0x22f0d4);});}delete members[_0x52e3a8[_0xdd52('0x6')]];}function startsWith(_0x181876,_0x336797){return _[_0xdd52('0x16')](_0x181876,function(_0x25a2b7){return _[_0xdd52('0x17')](_0x336797,_0x25a2b7);});}exports['devicestatechange']=function(_0x468c7a){try{utils['debug'](util[_0xdd52('0x3')](_0xdd52('0x18'),members[_0x468c7a[_0xdd52('0x19')]]?members[_0x468c7a[_0xdd52('0x19')]]['uniqueid']:_0x468c7a[_0xdd52('0x19')]),_0x468c7a);utils[_0xdd52('0x1a')](util[_0xdd52('0x3')](_0xdd52('0x1b'),members[_0x468c7a['device']]?members[_0x468c7a[_0xdd52('0x19')]]['uniqueid']:_0x468c7a[_0xdd52('0x19')],_0x468c7a['state'],_0x468c7a[_0xdd52('0x19')]));switch(_0x468c7a[_0xdd52('0x1c')]){case'INUSE':case _0xdd52('0x1d'):if(!startsWith(exclude,_0x468c7a['device'])){members[_0x468c7a[_0xdd52('0x19')]]={'channel':'voice','interface':_0x468c7a[_0xdd52('0x19')],'type':_0xdd52('0x1e'),'enterAt':utils[_0xdd52('0x1f')](),'role':_0xdd52('0x20')};}break;case _0xdd52('0x21'):if(!_[_0xdd52('0x22')](members[_0x468c7a[_0xdd52('0x19')]])){members[_0x468c7a[_0xdd52('0x19')]]['exitAt']=utils[_0xdd52('0x1f')]();members[_0x468c7a[_0xdd52('0x19')]]['duration']=utils[_0xdd52('0x23')](members[_0x468c7a[_0xdd52('0x19')]][_0xdd52('0x24')],members[_0x468c7a[_0xdd52('0x19')]]['enterAt']);if(members[_0x468c7a[_0xdd52('0x19')]][_0xdd52('0x5')]){writeDB(members[_0x468c7a[_0xdd52('0x19')]]);}}break;default:break;}}catch(_0x54edf6){utils['error'](util[_0xdd52('0x3')]('[%s][members][devicestatechange]',members[_0x468c7a[_0xdd52('0x19')]]?members[_0x468c7a[_0xdd52('0x19')]][_0xdd52('0x5')]:_0x468c7a['device']),_0x54edf6);}};exports['agentcomplete']=function(_0x2a0a2d){try{if(!_[_0xdd52('0x22')](members[_0x2a0a2d[_0xdd52('0x6')]])){utils['debug'](util['format'](_0xdd52('0x25'),_0x2a0a2d['uniqueid']),_0x2a0a2d);utils[_0xdd52('0x1a')](util[_0xdd52('0x3')](_0xdd52('0x26'),_0x2a0a2d[_0xdd52('0x5')],_0x2a0a2d[_0xdd52('0x6')],_0x2a0a2d[_0xdd52('0x27')]));members[_0x2a0a2d[_0xdd52('0x6')]]=_[_0xdd52('0x28')](members[_0x2a0a2d[_0xdd52('0x6')]],{'data4':_0x2a0a2d[_0xdd52('0x27')],'uniqueid':_0x2a0a2d[_0xdd52('0x5')]});}}catch(_0x3b2707){utils[_0xdd52('0x14')](util[_0xdd52('0x3')](_0xdd52('0x25'),_0x2a0a2d[_0xdd52('0x5')]),_0x3b2707);}};exports[_0xdd52('0x29')]=function(_0xe0844f){try{utils[_0xdd52('0x2a')](util[_0xdd52('0x3')](_0xdd52('0x2b'),_0xe0844f['uniqueid']),_0xe0844f);if(_0xe0844f[_0xdd52('0x7')]){var _0x45ef2b=_0xe0844f['channel']['split']('-')[0x0];if(!_['isNil'](members[_0x45ef2b])){members[_0x45ef2b]=_[_0xdd52('0x28')](members[_0x45ef2b],{'data1':members[_0x45ef2b][_0xdd52('0x2c')]||_0xe0844f[_0xdd52('0xa')],'data2':members[_0x45ef2b][_0xdd52('0x8')]||_0xe0844f[_0xdd52('0x2d')],'data3':members[_0x45ef2b][_0xdd52('0x2e')]||_0xe0844f[_0xdd52('0x2f')],'uniqueid':members[_0x45ef2b][_0xdd52('0x5')]||_0xe0844f[_0xdd52('0x5')]});utils[_0xdd52('0x1a')](util['format'](_0xdd52('0x30'),_0xe0844f[_0xdd52('0x5')],members[_0x45ef2b][_0xdd52('0x2c')],members[_0x45ef2b][_0xdd52('0x8')],members[_0x45ef2b][_0xdd52('0x2e')]));if(members[_0x45ef2b][_0xdd52('0x24')]){writeDB(members[_0x45ef2b]);}}}if(_0xe0844f[_0xdd52('0x31')]){var _0x2d5c79=_0xe0844f[_0xdd52('0x31')][_0xdd52('0x12')]('-')[0x0];if(!_[_0xdd52('0x22')](members[_0x2d5c79])){members[_0x2d5c79]=_[_0xdd52('0x28')](members[_0x2d5c79],{'data1':members[_0x2d5c79][_0xdd52('0x2c')]||_0xe0844f[_0xdd52('0xa')],'data2':members[_0x2d5c79][_0xdd52('0x8')]||_0xe0844f[_0xdd52('0x2d')],'data3':members[_0x2d5c79][_0xdd52('0x2e')]||_0xe0844f[_0xdd52('0x2f')],'uniqueid':members[_0x2d5c79][_0xdd52('0x5')]||_0xe0844f[_0xdd52('0x5')]});utils[_0xdd52('0x1a')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xe0844f[_0xdd52('0x5')],members[_0x2d5c79][_0xdd52('0x2c')],members[_0x2d5c79][_0xdd52('0x8')],members[_0x2d5c79][_0xdd52('0x2e')]));if(members[_0x2d5c79][_0xdd52('0x24')]){writeDB(members[_0x2d5c79]);}}}}catch(_0x136b01){utils[_0xdd52('0x14')](util[_0xdd52('0x3')](_0xdd52('0x2b'),_0xe0844f[_0xdd52('0x5')]),_0x136b01);}};
\ No newline at end of file
index c19b30f..3ad5e1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba9b=['queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandon','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba9b,0x1b5));var _0xbba9=function(_0x1ef1ee,_0x72bc1d){_0x1ef1ee=_0x1ef1ee-0x0;var _0x27a313=_0xba9b[_0x1ef1ee];return _0x27a313;};'use strict';var _=require(_0xbba9('0x0'));var util=require(_0xbba9('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x29b415){utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x4'),_0x29b415[_0xbba9('0x5')],_0x29b415[_0xbba9('0x6')],_0x29b415[_0xbba9('0x7')],_0x29b415[_0xbba9('0x8')],_0x29b415[_0xbba9('0x9')],_0x29b415[_0xbba9('0xa')],_0x29b415[_0xbba9('0xb')]));if(_0x29b415[_0xbba9('0x7')]){utils[_0xbba9('0xc')](_0x29b415[_0xbba9('0x7')])['then'](function(_0x14fac3){if(_0x14fac3){_0x29b415[_0xbba9('0xd')]=_0x14fac3[_0xbba9('0xd')];}utils[_0xbba9('0xe')](_0xbba9('0xf'),_0x29b415);});}else{utils[_0xbba9('0xe')](_0xbba9('0xf'),_0x29b415);}if(_0x29b415[_0xbba9('0x10')]){delete queues[_0x29b415[_0xbba9('0x10')]];}else{delete queues[_0x29b415[_0xbba9('0x5')]];}}exports['queuecallerjoin']=function(_0x13d26e){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x12'),_0x13d26e[_0xbba9('0x5')]),_0x13d26e);utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x13'),_0x13d26e['uniqueid'],_0x13d26e[_0xbba9('0x7')],_0x13d26e['position']));queues[_0x13d26e['uniqueid']]=_[_0xbba9('0x14')](_0x13d26e,{'originalposition':_0x13d26e[_0xbba9('0x15')],'queuecallerjoinAt':utils[_0xbba9('0x16')](),'mohtime':0x0});}catch(_0xc5489b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x12'),_0x13d26e[_0xbba9('0x5')]),_0xc5489b);}};exports[_0xbba9('0x18')]=function(_0x552953){try{if(!_['isNil'](queues[_0x552953[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x19'),_0x552953[_0xbba9('0x5')]),_0x552953);if(queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1a')]){if(!queues[_0x552953['uniqueid']]['queuecallerabandon']&&!queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1b')]){queues[_0x552953['uniqueid']]['queuecallercomplete']=!![];queues[_0x552953[_0xbba9('0x5')]]['queuecallercompleteAt']=utils[_0xbba9('0x16')]();queues[_0x552953[_0xbba9('0x5')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x1c'),_0x552953[_0xbba9('0x5')],queues[_0x552953['uniqueid']]['name'],queues[_0x552953[_0xbba9('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x552953['uniqueid']]);}else if(queues[_0x552953['uniqueid']]['transfereduniqueid']){utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x1d'),_0x552953[_0xbba9('0x5')],queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x552953[_0xbba9('0x5')]][_0xbba9('0x10')]));queues[queues[_0x552953[_0xbba9('0x5')]]['transfereduniqueid']]=queues[_0x552953[_0xbba9('0x5')]];queues[queues[_0x552953['uniqueid']][_0xbba9('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x552953[_0xbba9('0x5')]];}}}catch(_0x20b81c){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x19'),_0x552953[_0xbba9('0x5')]),_0x20b81c);}};exports['varset']=function(_0x1bd079){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')]('[%s][queues][varset]',_0x1bd079[_0xbba9('0x5')]),_0x1bd079);if(!_[_0xbba9('0x1f')](_0x1bd079['variable'][_0xbba9('0x20')])&&_0x1bd079[_0xbba9('0x21')][_0xbba9('0x22')]()!==_0xbba9('0x23')){if(!_[_0xbba9('0x1f')](queues[_0x1bd079[_0xbba9('0x5')]])){queues[_0x1bd079['uniqueid']][_0xbba9('0x24')]=![];queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerabandonAt']=null;queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x1b')]=!![];queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]=_0x1bd079[_0xbba9('0x21')][_0xbba9('0x22')]();utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x25'),_0x1bd079['uniqueid'],queues[_0x1bd079[_0xbba9('0x5')]]['name'],_0x1bd079[_0xbba9('0x21')],queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]));writeDB(queues[_0x1bd079[_0xbba9('0x5')]]);}}else if(!_[_0xbba9('0x1f')](_0x1bd079[_0xbba9('0x26')]['queueposition'])){if(!_['isNil'](queues[_0x1bd079['uniqueid']])&&!queues[_0x1bd079[_0xbba9('0x5')]]['queuecallerabandon']){queues[_0x1bd079['uniqueid']][_0xbba9('0x24')]=![];queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x27')]=null;queues[_0x1bd079['uniqueid']][_0xbba9('0x1b')]=!![];queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0x28')]=utils[_0xbba9('0x16')]();queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]=_0xbba9('0x29');utils['info'](util[_0xbba9('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x1bd079[_0xbba9('0x5')],queues[_0x1bd079['uniqueid']][_0xbba9('0x1e')],_0x1bd079['value'],queues[_0x1bd079[_0xbba9('0x5')]][_0xbba9('0xb')]));}}}catch(_0x53b01b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x2a'),_0x1bd079[_0xbba9('0x5')]),_0x53b01b);}};exports[_0xbba9('0x24')]=function(_0x23f70e){try{if(!_[_0xbba9('0x1f')](queues[_0x23f70e[_0xbba9('0x5')]])){utils['debug'](util[_0xbba9('0x3')]('[%s][queues][queuecallerabandon]',_0x23f70e[_0xbba9('0x5')]),_0x23f70e);queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0x1b')]=![];queues[_0x23f70e[_0xbba9('0x5')]]['queuecallerexitAt']=null;queues[_0x23f70e[_0xbba9('0x5')]]['queuecallerabandon']=!![];queues[_0x23f70e['uniqueid']]['queuecallerabandonAt']=utils[_0xbba9('0x16')]();queues[_0x23f70e['uniqueid']][_0xbba9('0xb')]='ABANDONED';utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x23f70e['uniqueid'],queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x23f70e[_0xbba9('0x5')]][_0xbba9('0xb')]));}}catch(_0x26efaf){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x2b'),_0x23f70e[_0xbba9('0x5')]),_0x26efaf);}};exports['queuecallerleave']=function(_0xc70166){try{if(!_[_0xbba9('0x1f')](queues[_0xc70166[_0xbba9('0x5')]])){utils['debug'](util[_0xbba9('0x3')](_0xbba9('0x2c'),_0xc70166['uniqueid']),_0xc70166);utils['info'](util[_0xbba9('0x3')](_0xbba9('0x2d'),_0xc70166[_0xbba9('0x5')],queues[_0xc70166[_0xbba9('0x5')]]['name'],_0xc70166[_0xbba9('0x2e')],_0xc70166['connectedlinename']));queues[_0xc70166[_0xbba9('0x5')]]['queuecallerleave']=!![];queues[_0xc70166['uniqueid']][_0xbba9('0x1a')]=utils[_0xbba9('0x16')]();queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x2f')]=utils['diffTime'](queues[_0xc70166[_0xbba9('0x5')]]['queuecallerleaveAt'],queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x30')]);queues[_0xc70166['uniqueid']][_0xbba9('0x15')]=_0xc70166['position'];queues[_0xc70166['uniqueid']][_0xbba9('0x31')]=_0xc70166[_0xbba9('0x31')];queues[_0xc70166[_0xbba9('0x5')]][_0xbba9('0x2e')]=_0xc70166['connectedlinenum'];queues[_0xc70166['uniqueid']][_0xbba9('0x32')]=_0xc70166[_0xbba9('0x32')];}}catch(_0x284b47){utils[_0xbba9('0x17')](util[_0xbba9('0x3')]('[%s][queues][queuecallerleave]',_0xc70166[_0xbba9('0x5')]),_0x284b47);}};exports[_0xbba9('0x33')]=function(_0x27b2b1){try{if(!_[_0xbba9('0x1f')](queues[_0x27b2b1[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util['format'](_0xbba9('0x34'),_0x27b2b1[_0xbba9('0x5')]),_0x27b2b1);utils['info'](util[_0xbba9('0x3')](_0xbba9('0x35'),_0x27b2b1[_0xbba9('0x5')],queues[_0x27b2b1['uniqueid']][_0xbba9('0x1e')],_0x27b2b1[_0xbba9('0x36')],_0x27b2b1['destaccountcode']));queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x27')]=null;queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x1b')]=![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0xb')]=null;queues[_0x27b2b1['uniqueid']][_0xbba9('0x28')]=null;queues[_0x27b2b1['uniqueid']][_0xbba9('0x37')]=!![];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0xa')]=_0x27b2b1[_0xbba9('0x38')];queues[_0x27b2b1[_0xbba9('0x5')]][_0xbba9('0x8')]=_0x27b2b1[_0xbba9('0x36')];}}catch(_0x46ff42){utils[_0xbba9('0x17')](util[_0xbba9('0x3')]('[%s][queues][agentconnect]',_0x27b2b1[_0xbba9('0x5')]),_0x46ff42);}};exports[_0xbba9('0x39')]=function(_0x134514){try{if(!_[_0xbba9('0x1f')](queues[_0x134514[_0xbba9('0x5')]])){if(queues[_0x134514['uniqueid']][_0xbba9('0x1a')]){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x3a'),_0x134514[_0xbba9('0x5')]),_0x134514);queues[_0x134514['uniqueid']][_0xbba9('0x24')]=![];queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x24')]=![];queues[_0x134514['uniqueid']]['queuecallerabandonAt']=null;queues[_0x134514['uniqueid']]['queuecallerexit']=![];queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x28')]=null;queues[_0x134514['uniqueid']][_0xbba9('0x37')]=!![];queues[_0x134514['uniqueid']][_0xbba9('0x8')]=_0x134514['membername'];queues[_0x134514['uniqueid']][_0xbba9('0x3b')]=!![];queues[_0x134514['uniqueid']][_0xbba9('0x3c')]=utils[_0xbba9('0x16')]();if(_0x134514[_0xbba9('0x3d')]==_0xbba9('0x3e')){if(!queues[_0x134514[_0xbba9('0x5')]]['transfer']){queues[_0x134514['uniqueid']][_0xbba9('0xb')]=_0xbba9('0x3f');}}else{queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0xb')]='COMPLETEDBY'+_0x134514[_0xbba9('0x3d')][_0xbba9('0x22')]();}utils[_0xbba9('0x2')](util[_0xbba9('0x3')](_0xbba9('0x40'),_0x134514[_0xbba9('0x5')],queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0x1e')],_0x134514[_0xbba9('0x36')],queues[_0x134514[_0xbba9('0x5')]][_0xbba9('0xb')]));writeDB(queues[_0x134514[_0xbba9('0x5')]]);}}}catch(_0x334b85){utils['error'](util['format'](_0xbba9('0x3a'),_0x134514['uniqueid']),_0x334b85);}};exports['blindtransfer']=function(_0x438470){try{if(!_['isNil'](queues[_0x438470['transfereeuniqueid']])){utils['debug'](util[_0xbba9('0x3')](_0xbba9('0x41'),_0x438470[_0xbba9('0x5')]),_0x438470);queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x3e')]=!![];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x43')]=_0xbba9('0x44');queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x45')]=_0x438470[_0xbba9('0x46')];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x47')]=_0x438470[_0xbba9('0x42')];queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0xb')]='BLINDTRANSFER';utils['info'](util[_0xbba9('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x438470[_0xbba9('0x5')],queues[_0x438470[_0xbba9('0x42')]][_0xbba9('0x1e')],_0x438470[_0xbba9('0x42')],_0x438470[_0xbba9('0x46')]));}}catch(_0x9a9256){utils['error'](util[_0xbba9('0x3')](_0xbba9('0x41'),_0x438470[_0xbba9('0x5')]),_0x9a9256);}};exports['attendedtransfer']=function(_0x1a822b){try{utils[_0xbba9('0x11')](util[_0xbba9('0x3')]('[%s][queues][attendedtransfer]',_0x1a822b['origtransfereruniqueid']),_0x1a822b);if(_0x1a822b[_0xbba9('0x48')]==_0x1a822b['origtransfererlinkedid']){if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x49')]])){utils[_0xbba9('0x2')](util['format'](_0xbba9('0x4a'),_0x1a822b['origtransfereruniqueid'],queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x1e')],_0x1a822b[_0xbba9('0x4b')]));queues[_0x1a822b[_0xbba9('0x49')]]['transfer']=!![];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x43')]=_0xbba9('0x4c');queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x45')]=_0x1a822b[_0xbba9('0x4b')];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x47')]=_0x1a822b[_0xbba9('0x48')];queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0xb')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x4d')]])){if(_0x1a822b[_0xbba9('0x4e')]&&queues[_0x1a822b[_0xbba9('0x4e')]]){queues[_0x1a822b[_0xbba9('0x4e')]][_0xbba9('0x4f')]=0x1;queues[_0x1a822b['transfereeuniqueid']]=_[_0xbba9('0x50')](queues[_0x1a822b[_0xbba9('0x4e')]]);queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x10')]=_0x1a822b[_0xbba9('0x51')];queues[_0x1a822b[_0xbba9('0x42')]]['queuecallerenterreason']=0x2;queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x9')]=queues[_0x1a822b[_0xbba9('0x49')]]['calleridnum'];queues[_0x1a822b['transfereeuniqueid']]['calleridname']=queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x52')];queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x30')]=utils[_0xbba9('0x16')]();queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x1a')]=utils['now']();queues[_0x1a822b[_0xbba9('0x42')]]['holdtime']=0x0;queues[_0x1a822b[_0xbba9('0x42')]]['mohtime']=0x0;utils['info'](util[_0xbba9('0x3')](_0xbba9('0x53'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x1e')],queues[_0x1a822b[_0xbba9('0x42')]][_0xbba9('0x9')],queues[_0x1a822b['transfereeuniqueid']][_0xbba9('0x52')]));}else{utils['info'](util['format'](_0xbba9('0x54'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x4d')]]['name'],_0x1a822b[_0xbba9('0x49')]));queues[_0x1a822b['origtransfererlinkedid']][_0xbba9('0x10')]=_0x1a822b[_0xbba9('0x49')];}}}else if(_0x1a822b[_0xbba9('0x55')]==_0x1a822b['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x4d')]])){utils[_0xbba9('0x2')](util['format'](_0xbba9('0x56'),_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x1e')],_0x1a822b['secondtransfereruniqueid'],_0x1a822b[_0xbba9('0x57')]));queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x3e')]=!![];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x43')]='ATTENDED';queues[_0x1a822b[_0xbba9('0x4d')]]['transferexten']=_0x1a822b[_0xbba9('0x57')];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x47')]=_0x1a822b[_0xbba9('0x55')];queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0xb')]=_0xbba9('0x58');}if(!_['isNil'](queues[_0x1a822b[_0xbba9('0x49')]])){if(_0x1a822b[_0xbba9('0x59')]&&queues[_0x1a822b[_0xbba9('0x59')]]){queues[_0x1a822b[_0xbba9('0x59')]][_0xbba9('0x4f')]=0x1;queues[_0x1a822b[_0xbba9('0x51')]]=_[_0xbba9('0x50')](queues[_0x1a822b['transfertargetlinkedid']]);queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x10')]=_0x1a822b['transfertargetuniqueid'];queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x4f')]=0x2;queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x9')]=queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x9')];queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x52')]=queues[_0x1a822b[_0xbba9('0x4d')]][_0xbba9('0x52')];queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x30')]=utils[_0xbba9('0x16')]();queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x1a')]=utils[_0xbba9('0x16')]();queues[_0x1a822b[_0xbba9('0x51')]]['holdtime']=0x0;queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x5a')]=0x0;utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x1e')],queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x10')],queues[_0x1a822b[_0xbba9('0x51')]][_0xbba9('0x9')],queues[_0x1a822b['transfertargetuniqueid']][_0xbba9('0x52')]));}else{utils[_0xbba9('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1a822b[_0xbba9('0x48')],queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x1e')],_0x1a822b[_0xbba9('0x4d')]));queues[_0x1a822b[_0xbba9('0x49')]][_0xbba9('0x10')]=_0x1a822b['origtransfererlinkedid'];}}}}catch(_0x57202b){utils[_0xbba9('0x17')](util['format'](_0xbba9('0x5b'),_0x1a822b[_0xbba9('0x48')]),_0x57202b);}};exports['musiconholdstart']=function(_0x3275c2){try{if(!_[_0xbba9('0x1f')](queues[_0x3275c2[_0xbba9('0x5')]])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x5c'),_0x3275c2[_0xbba9('0x5')]),_0x3275c2);queues[_0x3275c2[_0xbba9('0x5')]]['musiconholdstartAt']=utils[_0xbba9('0x16')]();utils['info'](util[_0xbba9('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x3275c2[_0xbba9('0x5')],queues[_0x3275c2[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x3275c2['uniqueid']][_0xbba9('0x5d')]));}}catch(_0x2b107d){utils['error'](util['format'](_0xbba9('0x5c'),_0x3275c2[_0xbba9('0x5')]),_0x2b107d);}};exports[_0xbba9('0x5e')]=function(_0x3fe1a1){try{if(!_[_0xbba9('0x1f')](queues[_0x3fe1a1[_0xbba9('0x5')]])){if(!_['isNil'](queues[_0x3fe1a1['uniqueid']][_0xbba9('0x5d')])){utils[_0xbba9('0x11')](util[_0xbba9('0x3')](_0xbba9('0x5f'),_0x3fe1a1[_0xbba9('0x5')]),_0x3fe1a1);queues[_0x3fe1a1['uniqueid']]['mohtime']+=utils[_0xbba9('0x60')](utils['now'](),queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5d')]);utils[_0xbba9('0x2')](util[_0xbba9('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x3fe1a1[_0xbba9('0x5')],queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x1e')],queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5a')]));delete queues[_0x3fe1a1[_0xbba9('0x5')]][_0xbba9('0x5d')];}}}catch(_0x1aa08f){utils[_0xbba9('0x17')](util[_0xbba9('0x3')](_0xbba9('0x5f'),_0x3fe1a1[_0xbba9('0x5')]),_0x1aa08f);}};
\ No newline at end of file
+var _0x9213=['secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexit','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','origtransfereruniqueid','origtransfererexten','secondtransfererlinkedid','transfertype','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x9213,0xda));var _0x3921=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x9213[_0x111e94];return _0x3de107;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3921('0x0'));var queues={};function writeDB(_0x2f802c){utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x3'),_0x2f802c[_0x3921('0x4')],_0x2f802c[_0x3921('0x5')],_0x2f802c['queue'],_0x2f802c[_0x3921('0x6')],_0x2f802c[_0x3921('0x7')],_0x2f802c[_0x3921('0x8')],_0x2f802c[_0x3921('0x9')]));if(_0x2f802c['queue']){utils[_0x3921('0xa')](_0x2f802c[_0x3921('0xb')])[_0x3921('0xc')](function(_0x54ec8a){if(_0x54ec8a){_0x2f802c['type']=_0x54ec8a[_0x3921('0xd')];}utils[_0x3921('0xe')](_0x3921('0xf'),_0x2f802c);});}else{utils[_0x3921('0xe')]('CreateVoiceQueueReport',_0x2f802c);}if(_0x2f802c[_0x3921('0x10')]){delete queues[_0x2f802c[_0x3921('0x10')]];}else{delete queues[_0x2f802c[_0x3921('0x4')]];}}exports[_0x3921('0x11')]=function(_0x2d10af){try{utils[_0x3921('0x12')](util['format']('[%s][queues][queuecallerjoin]',_0x2d10af['uniqueid']),_0x2d10af);utils['info'](util[_0x3921('0x2')](_0x3921('0x13'),_0x2d10af['uniqueid'],_0x2d10af[_0x3921('0xb')],_0x2d10af[_0x3921('0x14')]));queues[_0x2d10af[_0x3921('0x4')]]=_[_0x3921('0x15')](_0x2d10af,{'originalposition':_0x2d10af[_0x3921('0x14')],'queuecallerjoinAt':utils[_0x3921('0x16')](),'mohtime':0x0});}catch(_0xb1323d){utils[_0x3921('0x17')](util[_0x3921('0x2')](_0x3921('0x18'),_0x2d10af[_0x3921('0x4')]),_0xb1323d);}};exports[_0x3921('0x19')]=function(_0x5bb1ec){try{if(!_[_0x3921('0x1a')](queues[_0x5bb1ec[_0x3921('0x4')]])){utils[_0x3921('0x12')](util[_0x3921('0x2')](_0x3921('0x1b'),_0x5bb1ec[_0x3921('0x4')]),_0x5bb1ec);if(queues[_0x5bb1ec['uniqueid']][_0x3921('0x1c')]){if(!queues[_0x5bb1ec[_0x3921('0x4')]]['queuecallerabandon']&&!queues[_0x5bb1ec[_0x3921('0x4')]]['queuecallerexit']){queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x1d')]=!![];queues[_0x5bb1ec[_0x3921('0x4')]]['queuecallercompleteAt']=utils[_0x3921('0x16')]();queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x9')]=_0x3921('0x1e');}utils[_0x3921('0x1')](util['format'](_0x3921('0x1f'),_0x5bb1ec[_0x3921('0x4')],queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x20')],queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x9')]));writeDB(queues[_0x5bb1ec[_0x3921('0x4')]]);}else if(queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x10')]){utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x21'),_0x5bb1ec[_0x3921('0x4')],queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x20')],queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x10')]));queues[queues[_0x5bb1ec[_0x3921('0x4')]][_0x3921('0x10')]]=queues[_0x5bb1ec[_0x3921('0x4')]];queues[queues[_0x5bb1ec[_0x3921('0x4')]]['transfereduniqueid']][_0x3921('0x22')]=0x2;delete queues[_0x5bb1ec[_0x3921('0x4')]];}}}catch(_0x7757){utils['error'](util[_0x3921('0x2')]('[%s][queues][hangup]',_0x5bb1ec['uniqueid']),_0x7757);}};exports[_0x3921('0x23')]=function(_0x306c3a){try{utils[_0x3921('0x12')](util[_0x3921('0x2')]('[%s][queues][varset]',_0x306c3a[_0x3921('0x4')]),_0x306c3a);if(!_['isNil'](_0x306c3a[_0x3921('0x24')]['queuestatus'])&&_0x306c3a[_0x3921('0x25')][_0x3921('0x26')]()!==_0x3921('0x27')){if(!_[_0x3921('0x1a')](queues[_0x306c3a['uniqueid']])){queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x29')]=null;queues[_0x306c3a['uniqueid']]['queuecallerexit']=!![];queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x2a')]=utils[_0x3921('0x16')]();queues[_0x306c3a['uniqueid']]['queuecallerexitreason']=_0x306c3a[_0x3921('0x25')]['toUpperCase']();utils[_0x3921('0x1')](util['format'](_0x3921('0x2b'),_0x306c3a[_0x3921('0x4')],queues[_0x306c3a['uniqueid']][_0x3921('0x20')],_0x306c3a[_0x3921('0x25')],queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x9')]));writeDB(queues[_0x306c3a[_0x3921('0x4')]]);}}else if(!_['isNil'](_0x306c3a['variable'][_0x3921('0x2c')])){if(!_[_0x3921('0x1a')](queues[_0x306c3a['uniqueid']])&&!queues[_0x306c3a['uniqueid']][_0x3921('0x28')]){queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x306c3a[_0x3921('0x4')]]['queuecallerabandonAt']=null;queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x2d')]=!![];queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x2a')]=utils[_0x3921('0x16')]();queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x9')]=_0x3921('0x2e');utils['info'](util[_0x3921('0x2')](_0x3921('0x2f'),_0x306c3a[_0x3921('0x4')],queues[_0x306c3a[_0x3921('0x4')]]['name'],_0x306c3a[_0x3921('0x25')],queues[_0x306c3a[_0x3921('0x4')]][_0x3921('0x9')]));}}}catch(_0x3972a7){utils[_0x3921('0x17')](util[_0x3921('0x2')]('[%s][queues][varset]',_0x306c3a[_0x3921('0x4')]),_0x3972a7);}};exports[_0x3921('0x28')]=function(_0x4e0116){try{if(!_[_0x3921('0x1a')](queues[_0x4e0116[_0x3921('0x4')]])){utils[_0x3921('0x12')](util['format']('[%s][queues][queuecallerabandon]',_0x4e0116[_0x3921('0x4')]),_0x4e0116);queues[_0x4e0116[_0x3921('0x4')]][_0x3921('0x2d')]=![];queues[_0x4e0116[_0x3921('0x4')]][_0x3921('0x2a')]=null;queues[_0x4e0116[_0x3921('0x4')]][_0x3921('0x28')]=!![];queues[_0x4e0116[_0x3921('0x4')]][_0x3921('0x29')]=utils['now']();queues[_0x4e0116['uniqueid']][_0x3921('0x9')]=_0x3921('0x30');utils['info'](util[_0x3921('0x2')](_0x3921('0x31'),_0x4e0116[_0x3921('0x4')],queues[_0x4e0116[_0x3921('0x4')]][_0x3921('0x20')],queues[_0x4e0116[_0x3921('0x4')]]['queuecallerexitreason']));}}catch(_0x2b6f45){utils[_0x3921('0x17')](util[_0x3921('0x2')](_0x3921('0x32'),_0x4e0116[_0x3921('0x4')]),_0x2b6f45);}};exports[_0x3921('0x33')]=function(_0x38a2f2){try{if(!_[_0x3921('0x1a')](queues[_0x38a2f2[_0x3921('0x4')]])){utils[_0x3921('0x12')](util[_0x3921('0x2')](_0x3921('0x34'),_0x38a2f2[_0x3921('0x4')]),_0x38a2f2);utils[_0x3921('0x1')](util[_0x3921('0x2')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x38a2f2[_0x3921('0x4')],queues[_0x38a2f2[_0x3921('0x4')]][_0x3921('0x20')],_0x38a2f2[_0x3921('0x35')],_0x38a2f2[_0x3921('0x36')]));queues[_0x38a2f2[_0x3921('0x4')]][_0x3921('0x33')]=!![];queues[_0x38a2f2[_0x3921('0x4')]][_0x3921('0x1c')]=utils[_0x3921('0x16')]();queues[_0x38a2f2[_0x3921('0x4')]][_0x3921('0x37')]=utils[_0x3921('0x38')](queues[_0x38a2f2['uniqueid']]['queuecallerleaveAt'],queues[_0x38a2f2['uniqueid']][_0x3921('0x39')]);queues[_0x38a2f2['uniqueid']][_0x3921('0x14')]=_0x38a2f2[_0x3921('0x14')];queues[_0x38a2f2['uniqueid']][_0x3921('0x3a')]=_0x38a2f2[_0x3921('0x3a')];queues[_0x38a2f2['uniqueid']][_0x3921('0x35')]=_0x38a2f2[_0x3921('0x35')];queues[_0x38a2f2[_0x3921('0x4')]][_0x3921('0x36')]=_0x38a2f2[_0x3921('0x36')];}}catch(_0x41c27a){utils['error'](util[_0x3921('0x2')](_0x3921('0x34'),_0x38a2f2[_0x3921('0x4')]),_0x41c27a);}};exports['agentconnect']=function(_0x38e344){try{if(!_[_0x3921('0x1a')](queues[_0x38e344[_0x3921('0x4')]])){utils[_0x3921('0x12')](util[_0x3921('0x2')](_0x3921('0x3b'),_0x38e344[_0x3921('0x4')]),_0x38e344);utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x3c'),_0x38e344[_0x3921('0x4')],queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x20')],_0x38e344['membername'],_0x38e344[_0x3921('0x3d')]));queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x29')]=null;queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x2d')]=![];queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x9')]=null;queues[_0x38e344[_0x3921('0x4')]]['queuecallerexitAt']=null;queues[_0x38e344[_0x3921('0x4')]]['assigned']=!![];queues[_0x38e344[_0x3921('0x4')]][_0x3921('0x8')]=_0x38e344[_0x3921('0x3d')];queues[_0x38e344[_0x3921('0x4')]]['lastAssignedTo']=_0x38e344[_0x3921('0x3e')];}}catch(_0x53869c){utils[_0x3921('0x17')](util[_0x3921('0x2')](_0x3921('0x3b'),_0x38e344['uniqueid']),_0x53869c);}};exports[_0x3921('0x3f')]=function(_0x43555f){try{if(!_[_0x3921('0x1a')](queues[_0x43555f[_0x3921('0x4')]])){if(queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x1c')]){utils[_0x3921('0x12')](util['format'](_0x3921('0x40'),_0x43555f['uniqueid']),_0x43555f);queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x28')]=![];queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x29')]=null;queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x2d')]=![];queues[_0x43555f[_0x3921('0x4')]]['queuecallerexitAt']=null;queues[_0x43555f[_0x3921('0x4')]]['assigned']=!![];queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x6')]=_0x43555f[_0x3921('0x3e')];queues[_0x43555f[_0x3921('0x4')]]['queuecallercomplete']=!![];queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x41')]=utils[_0x3921('0x16')]();if(_0x43555f[_0x3921('0x42')]=='transfer'){if(!queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x43')]){queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x9')]=_0x3921('0x44');}}else{queues[_0x43555f[_0x3921('0x4')]]['queuecallerexitreason']=_0x3921('0x45')+_0x43555f[_0x3921('0x42')][_0x3921('0x26')]();}utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x46'),_0x43555f[_0x3921('0x4')],queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x20')],_0x43555f['membername'],queues[_0x43555f[_0x3921('0x4')]][_0x3921('0x9')]));writeDB(queues[_0x43555f['uniqueid']]);}}}catch(_0x4b9f54){utils[_0x3921('0x17')](util['format'](_0x3921('0x40'),_0x43555f[_0x3921('0x4')]),_0x4b9f54);}};exports['blindtransfer']=function(_0x54d3e5){try{if(!_[_0x3921('0x1a')](queues[_0x54d3e5['transfereeuniqueid']])){utils[_0x3921('0x12')](util[_0x3921('0x2')](_0x3921('0x47'),_0x54d3e5[_0x3921('0x4')]),_0x54d3e5);queues[_0x54d3e5[_0x3921('0x48')]][_0x3921('0x43')]=!![];queues[_0x54d3e5[_0x3921('0x48')]]['transfertype']=_0x3921('0x49');queues[_0x54d3e5[_0x3921('0x48')]][_0x3921('0x4a')]=_0x54d3e5[_0x3921('0x4b')];queues[_0x54d3e5[_0x3921('0x48')]][_0x3921('0x4c')]=_0x54d3e5[_0x3921('0x48')];queues[_0x54d3e5[_0x3921('0x48')]]['queuecallerexitreason']=_0x3921('0x4d');utils[_0x3921('0x1')](util[_0x3921('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x54d3e5[_0x3921('0x4')],queues[_0x54d3e5[_0x3921('0x48')]][_0x3921('0x20')],_0x54d3e5[_0x3921('0x48')],_0x54d3e5[_0x3921('0x4b')]));}}catch(_0x3b8a52){utils[_0x3921('0x17')](util[_0x3921('0x2')](_0x3921('0x47'),_0x54d3e5[_0x3921('0x4')]),_0x3b8a52);}};exports[_0x3921('0x4e')]=function(_0x2d6b14){try{utils['debug'](util['format'](_0x3921('0x4f'),_0x2d6b14['origtransfereruniqueid']),_0x2d6b14);if(_0x2d6b14['origtransfereruniqueid']==_0x2d6b14[_0x3921('0x50')]){if(!_[_0x3921('0x1a')](queues[_0x2d6b14['secondtransfererlinkedid']])){utils[_0x3921('0x1')](util[_0x3921('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x2d6b14[_0x3921('0x51')],queues[_0x2d6b14['secondtransfererlinkedid']]['name'],_0x2d6b14[_0x3921('0x52')]));queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x43')]=!![];queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x54')]=_0x3921('0x55');queues[_0x2d6b14[_0x3921('0x53')]]['transferexten']=_0x2d6b14['origtransfererexten'];queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x4c')]=_0x2d6b14[_0x3921('0x51')];queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x3921('0x1a')](queues[_0x2d6b14[_0x3921('0x50')]])){if(_0x2d6b14[_0x3921('0x56')]&&queues[_0x2d6b14[_0x3921('0x56')]]){queues[_0x2d6b14[_0x3921('0x56')]][_0x3921('0x22')]=0x1;queues[_0x2d6b14['transfereeuniqueid']]=_[_0x3921('0x57')](queues[_0x2d6b14[_0x3921('0x56')]]);queues[_0x2d6b14[_0x3921('0x48')]][_0x3921('0x10')]=_0x2d6b14[_0x3921('0x58')];queues[_0x2d6b14[_0x3921('0x48')]][_0x3921('0x22')]=0x2;queues[_0x2d6b14[_0x3921('0x48')]]['calleridnum']=queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x7')];queues[_0x2d6b14['transfereeuniqueid']][_0x3921('0x59')]=queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x59')];queues[_0x2d6b14['transfereeuniqueid']][_0x3921('0x39')]=utils[_0x3921('0x16')]();queues[_0x2d6b14[_0x3921('0x48')]]['queuecallerleaveAt']=utils[_0x3921('0x16')]();queues[_0x2d6b14[_0x3921('0x48')]][_0x3921('0x37')]=0x0;queues[_0x2d6b14[_0x3921('0x48')]]['mohtime']=0x0;utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x5a'),_0x2d6b14['origtransfereruniqueid'],queues[_0x2d6b14[_0x3921('0x48')]][_0x3921('0x20')],queues[_0x2d6b14['transfereeuniqueid']]['calleridnum'],queues[_0x2d6b14['transfereeuniqueid']][_0x3921('0x59')]));}else{utils[_0x3921('0x1')](util['format'](_0x3921('0x5b'),_0x2d6b14['origtransfereruniqueid'],queues[_0x2d6b14[_0x3921('0x50')]][_0x3921('0x20')],_0x2d6b14[_0x3921('0x53')]));queues[_0x2d6b14[_0x3921('0x50')]]['transfereduniqueid']=_0x2d6b14[_0x3921('0x53')];}}}else if(_0x2d6b14[_0x3921('0x5c')]==_0x2d6b14[_0x3921('0x53')]){if(!_['isNil'](queues[_0x2d6b14[_0x3921('0x50')]])){utils['info'](util[_0x3921('0x2')](_0x3921('0x5d'),_0x2d6b14[_0x3921('0x51')],queues[_0x2d6b14['origtransfererlinkedid']]['name'],_0x2d6b14['secondtransfereruniqueid'],_0x2d6b14[_0x3921('0x5e')]));queues[_0x2d6b14[_0x3921('0x50')]][_0x3921('0x43')]=!![];queues[_0x2d6b14[_0x3921('0x50')]][_0x3921('0x54')]=_0x3921('0x55');queues[_0x2d6b14['origtransfererlinkedid']][_0x3921('0x4a')]=_0x2d6b14['secondtransfererexten'];queues[_0x2d6b14[_0x3921('0x50')]][_0x3921('0x4c')]=_0x2d6b14[_0x3921('0x5c')];queues[_0x2d6b14['origtransfererlinkedid']][_0x3921('0x9')]='ATTENDEDTRANSFER';}if(!_[_0x3921('0x1a')](queues[_0x2d6b14[_0x3921('0x53')]])){if(_0x2d6b14['transfertargetlinkedid']&&queues[_0x2d6b14[_0x3921('0x5f')]]){queues[_0x2d6b14[_0x3921('0x5f')]][_0x3921('0x22')]=0x1;queues[_0x2d6b14['transfertargetuniqueid']]=_[_0x3921('0x57')](queues[_0x2d6b14[_0x3921('0x5f')]]);queues[_0x2d6b14['transfertargetuniqueid']]['transfereduniqueid']=_0x2d6b14[_0x3921('0x58')];queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x22')]=0x2;queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x7')]=queues[_0x2d6b14[_0x3921('0x50')]][_0x3921('0x7')];queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x59')]=queues[_0x2d6b14['origtransfererlinkedid']][_0x3921('0x59')];queues[_0x2d6b14['transfertargetuniqueid']][_0x3921('0x39')]=utils[_0x3921('0x16')]();queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x1c')]=utils['now']();queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x37')]=0x0;queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x60')]=0x0;utils[_0x3921('0x1')](util['format'](_0x3921('0x61'),_0x2d6b14[_0x3921('0x51')],queues[_0x2d6b14['transfertargetuniqueid']][_0x3921('0x20')],queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x10')],queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x7')],queues[_0x2d6b14[_0x3921('0x58')]][_0x3921('0x59')]));}else{utils[_0x3921('0x1')](util[_0x3921('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2d6b14['origtransfereruniqueid'],queues[_0x2d6b14['secondtransfererlinkedid']][_0x3921('0x20')],_0x2d6b14[_0x3921('0x50')]));queues[_0x2d6b14[_0x3921('0x53')]][_0x3921('0x10')]=_0x2d6b14[_0x3921('0x50')];}}}}catch(_0x5b371a){utils[_0x3921('0x17')](util[_0x3921('0x2')](_0x3921('0x4f'),_0x2d6b14[_0x3921('0x51')]),_0x5b371a);}};exports[_0x3921('0x62')]=function(_0x194c7c){try{if(!_[_0x3921('0x1a')](queues[_0x194c7c['uniqueid']])){utils[_0x3921('0x12')](util['format'](_0x3921('0x63'),_0x194c7c[_0x3921('0x4')]),_0x194c7c);queues[_0x194c7c[_0x3921('0x4')]][_0x3921('0x64')]=utils[_0x3921('0x16')]();utils[_0x3921('0x1')](util[_0x3921('0x2')](_0x3921('0x65'),_0x194c7c[_0x3921('0x4')],queues[_0x194c7c[_0x3921('0x4')]]['name'],queues[_0x194c7c[_0x3921('0x4')]][_0x3921('0x64')]));}}catch(_0x72f53b){utils['error'](util['format'](_0x3921('0x63'),_0x194c7c['uniqueid']),_0x72f53b);}};exports[_0x3921('0x66')]=function(_0x33d58f){try{if(!_[_0x3921('0x1a')](queues[_0x33d58f[_0x3921('0x4')]])){if(!_['isNil'](queues[_0x33d58f['uniqueid']][_0x3921('0x64')])){utils[_0x3921('0x12')](util[_0x3921('0x2')]('[%s][queues][musiconholdstop]',_0x33d58f[_0x3921('0x4')]),_0x33d58f);queues[_0x33d58f[_0x3921('0x4')]][_0x3921('0x60')]+=utils[_0x3921('0x38')](utils[_0x3921('0x16')](),queues[_0x33d58f[_0x3921('0x4')]][_0x3921('0x64')]);utils['info'](util[_0x3921('0x2')](_0x3921('0x67'),_0x33d58f[_0x3921('0x4')],queues[_0x33d58f[_0x3921('0x4')]][_0x3921('0x20')],queues[_0x33d58f[_0x3921('0x4')]][_0x3921('0x60')]));delete queues[_0x33d58f[_0x3921('0x4')]][_0x3921('0x64')];}}}catch(_0x2c86c4){utils['error'](util[_0x3921('0x2')]('[%s][queues][musiconholdstop]',_0x33d58f[_0x3921('0x4')]),_0x2c86c4);}};
\ No newline at end of file
index 417e207..e7b807e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4389=['[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','replace','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','name','UserId','request','CreateVoiceRecording','newchannel','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate'];(function(_0x5c5292,_0x2f1d9c){var _0x116489=function(_0x41c53b){while(--_0x41c53b){_0x5c5292['push'](_0x5c5292['shift']());}};_0x116489(++_0x2f1d9c);}(_0x4389,0x113));var _0x9438=function(_0x2e870b,_0xa74d0a){_0x2e870b=_0x2e870b-0x0;var _0x3fabf8=_0x4389[_0x2e870b];return _0x3fabf8;};'use strict';var _=require(_0x9438('0x0'));var util=require(_0x9438('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2776d7){utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x4'),_0x2776d7[_0x9438('0x5')]));if(_0x2776d7['accountcode']){utils[_0x9438('0x6')](_0x2776d7[_0x9438('0x7')])[_0x9438('0x8')](function(_0x173115){if(_0x173115){_0x2776d7['membername']=_0x173115[_0x9438('0x9')];_0x2776d7[_0x9438('0xa')]=_0x173115['id'];}utils[_0x9438('0xb')](_0x9438('0xc'),_0x2776d7);});}else{utils[_0x9438('0xb')](_0x9438('0xc'),_0x2776d7);}}exports[_0x9438('0xd')]=function(_0x261b75){try{utils['debug'](util[_0x9438('0x3')]('[%s][recordings][newchannel]',_0x261b75[_0x9438('0x5')]),_0x261b75);if(_0x261b75[_0x9438('0x5')]==_0x261b75[_0x9438('0xe')]){utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0xf'),_0x261b75[_0x9438('0x5')],_0x261b75[_0x9438('0x10')],_0x261b75[_0x9438('0x11')]));recordings[_0x261b75[_0x9438('0x5')]]={'uniqueid':_0x261b75['uniqueid'],'accountcode':_0x261b75[_0x9438('0x7')],'exten':_0x261b75[_0x9438('0x11')],'context':_0x261b75['context'],'channel':_0x261b75[_0x9438('0x12')],'monitors':[]};}}catch(_0x9fd098){utils[_0x9438('0x13')](util[_0x9438('0x3')]('[%s][recordings][newchannel]',_0x261b75[_0x9438('0x5')]),_0x9fd098);}};exports[_0x9438('0x14')]=function(_0x4d1509){try{utils[_0x9438('0x15')](util['format'](_0x9438('0x16'),_0x4d1509[_0x9438('0x5')]),_0x4d1509);if(!_[_0x9438('0x17')](recordings[_0x4d1509[_0x9438('0x5')]])&&_0x4d1509[_0x9438('0x18')]==0x6){utils[_0x9438('0x2')](util[_0x9438('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4d1509[_0x9438('0x5')],_0x4d1509['context'],_0x4d1509['channel']));}else if(!_['isNil'](recordings[_0x4d1509[_0x9438('0xe')]])&&_0x4d1509[_0x9438('0x18')]==0x6&&_0x4d1509[_0x9438('0x10')]!='transfer'){utils['info'](util['format'](_0x9438('0x19'),_0x4d1509[_0x9438('0x5')],_0x4d1509[_0x9438('0xe')],_0x4d1509['context'],_0x4d1509[_0x9438('0x12')]));recordings[_0x4d1509[_0x9438('0xe')]]['accountcode']=_0x4d1509['accountcode'];}}catch(_0x37e300){utils['error'](util['format'](_0x9438('0x16'),_0x4d1509[_0x9438('0x5')]),_0x37e300);}};exports[_0x9438('0x1a')]=function(_0x22ca15){try{if(!_[_0x9438('0x17')](_0x22ca15[_0x9438('0x1b')])&&!_[_0x9438('0x17')](_0x22ca15[_0x9438('0x1b')][_0x9438('0x1c')])){utils[_0x9438('0x15')](util[_0x9438('0x3')](_0x9438('0x1d'),_0x22ca15['uniqueid']),_0x22ca15);utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x1e'),_0x22ca15[_0x9438('0x5')],_0x22ca15[_0x9438('0x1b')],_0x22ca15['value']));if(_[_0x9438('0x1f')](_0x22ca15['value'],'.wav49')){_0x22ca15[_0x9438('0x20')]=_0x22ca15['value'][_0x9438('0x21')]('.wav49','.WAV');}if(recordings[_0x22ca15[_0x9438('0xe')]]){var _0x1153a7=_[_0x9438('0x22')](recordings[_0x22ca15[_0x9438('0xe')]][_0x9438('0x23')],{'value':_0x22ca15[_0x9438('0x20')]});if(_[_0x9438('0x17')](_0x1153a7)){recordings[_0x22ca15[_0x9438('0xe')]][_0x9438('0x23')][_0x9438('0x24')]({'value':_0x22ca15['value']});}}}}catch(_0x34daed){utils[_0x9438('0x13')](util['format']('[%s][recordings][varset]',_0x22ca15[_0x9438('0x5')]),_0x34daed);}};exports['hangup']=function(_0x53eb63){try{if(!_[_0x9438('0x17')](recordings[_0x53eb63['uniqueid']])){utils['debug'](util[_0x9438('0x3')](_0x9438('0x25'),_0x53eb63[_0x9438('0x5')]),_0x53eb63);utils[_0x9438('0x2')](util['format'](_0x9438('0x26'),_0x53eb63['uniqueid'],_0x53eb63[_0x9438('0x27')],_0x53eb63['calleridname'],_0x53eb63[_0x9438('0x28')]));recordings[_0x53eb63['uniqueid']][_0x9438('0x27')]=_0x53eb63[_0x9438('0x27')];recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x29')]=_0x53eb63[_0x9438('0x29')];recordings[_0x53eb63['uniqueid']]['connectedlinenum']=_0x53eb63[_0x9438('0x2a')];recordings[_0x53eb63[_0x9438('0x5')]]['connectedlinename']=_0x53eb63[_0x9438('0x2b')];if(recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x2c')]==_0x9438('0x2d')&&recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x7')]){recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x2a')]=recordings[_0x53eb63[_0x9438('0x5')]][_0x9438('0x7')];recordings[_0x53eb63['uniqueid']][_0x9438('0x2b')]='';}recordings[_0x53eb63['uniqueid']][_0x9438('0x23')][_0x9438('0x2e')](function(_0x2d483d){var _0x278738=_[_0x9438('0x2f')](recordings[_0x53eb63[_0x9438('0x5')]]);_0x278738['value']=_0x2d483d[_0x9438('0x20')];writeDB(_0x278738);});delete recordings[_0x53eb63[_0x9438('0x5')]];}}catch(_0x52492b){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x25'),_0x53eb63[_0x9438('0x5')]),_0x52492b);}};exports[_0x9438('0x30')]=function(_0xef9173){try{if(!_[_0x9438('0x17')](recordings[_0xef9173[_0x9438('0x5')]])){utils[_0x9438('0x15')](util[_0x9438('0x3')]('[%s][recordings][newexten]',_0xef9173[_0x9438('0x5')]),_0xef9173);utils[_0x9438('0x2')](util[_0x9438('0x3')](_0x9438('0x31'),_0xef9173[_0x9438('0x5')],_0xef9173[_0x9438('0x32')],_0xef9173['appdata']));if(_0xef9173[_0x9438('0x32')][_0x9438('0x33')]()==_0x9438('0x34')&&_[_0x9438('0x35')](_0xef9173[_0x9438('0x36')]['toLowerCase'](),'cdr')){var _0x5e30e0=_0xef9173[_0x9438('0x36')]['split']('=');var _0x3a3065=_0x5e30e0[0x0]['substring'](_0x5e30e0[0x0][_0x9438('0x37')]('(')+0x1,_0x5e30e0[0x0][_0x9438('0x37')](')'));var _0x148946=_0x5e30e0[0x1];recordings[_0xef9173[_0x9438('0x5')]][_0x3a3065]=_0x148946;}}}catch(_0x5c3f3f){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x38'),_0xef9173[_0x9438('0x5')]),_0x5c3f3f);}};exports[_0x9438('0x39')]=function(_0x4333cf){try{if(!_[_0x9438('0x17')](recordings[_0x4333cf[_0x9438('0x5')]])){utils[_0x9438('0x15')](util[_0x9438('0x3')](_0x9438('0x3a'),_0x4333cf['uniqueid']),_0x4333cf);utils[_0x9438('0x2')](util[_0x9438('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4333cf[_0x9438('0x5')],_0x4333cf[_0x9438('0x3b')]));recordings[_0x4333cf[_0x9438('0x5')]][_0x9438('0x3b')]=_0x4333cf[_0x9438('0x3b')];}}catch(_0xd3aac5){utils[_0x9438('0x13')](util[_0x9438('0x3')](_0x9438('0x3a'),_0x4333cf['uniqueid']),_0xd3aac5);}};
\ No newline at end of file
+var _0xe4ed=['clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','[%s][recordings][writeDB]','uniqueid','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','debug','format','[%s][recordings][newchannel]','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xe4ed,0x114));var _0xde4e=function(_0x27f819,_0x1ebfcf){_0x27f819=_0x27f819-0x0;var _0x46c3d3=_0xe4ed[_0x27f819];return _0x46c3d3;};'use strict';var _=require(_0xde4e('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x2039a9){utils[_0xde4e('0x1')](util['format'](_0xde4e('0x2'),_0x2039a9[_0xde4e('0x3')]));if(_0x2039a9['accountcode']){utils['getUserByInternal'](_0x2039a9[_0xde4e('0x4')])[_0xde4e('0x5')](function(_0x4b2f80){if(_0x4b2f80){_0x2039a9[_0xde4e('0x6')]=_0x4b2f80[_0xde4e('0x7')];_0x2039a9[_0xde4e('0x8')]=_0x4b2f80['id'];}utils[_0xde4e('0x9')](_0xde4e('0xa'),_0x2039a9);});}else{utils[_0xde4e('0x9')](_0xde4e('0xa'),_0x2039a9);}}exports['newchannel']=function(_0x4d9701){try{utils[_0xde4e('0xb')](util[_0xde4e('0xc')](_0xde4e('0xd'),_0x4d9701[_0xde4e('0x3')]),_0x4d9701);if(_0x4d9701[_0xde4e('0x3')]==_0x4d9701['linkedid']){utils[_0xde4e('0x1')](util[_0xde4e('0xc')](_0xde4e('0xe'),_0x4d9701[_0xde4e('0x3')],_0x4d9701[_0xde4e('0xf')],_0x4d9701['exten']));recordings[_0x4d9701['uniqueid']]={'uniqueid':_0x4d9701[_0xde4e('0x3')],'accountcode':_0x4d9701[_0xde4e('0x4')],'exten':_0x4d9701[_0xde4e('0x10')],'context':_0x4d9701[_0xde4e('0xf')],'channel':_0x4d9701[_0xde4e('0x11')],'monitors':[]};}}catch(_0x5be9c6){utils[_0xde4e('0x12')](util[_0xde4e('0xc')]('[%s][recordings][newchannel]',_0x4d9701[_0xde4e('0x3')]),_0x5be9c6);}};exports[_0xde4e('0x13')]=function(_0xb3b93a){try{utils['debug'](util['format']('[%s][recordings][newstate]',_0xb3b93a[_0xde4e('0x3')]),_0xb3b93a);if(!_[_0xde4e('0x14')](recordings[_0xb3b93a[_0xde4e('0x3')]])&&_0xb3b93a[_0xde4e('0x15')]==0x6){utils[_0xde4e('0x1')](util[_0xde4e('0xc')](_0xde4e('0x16'),_0xb3b93a[_0xde4e('0x3')],_0xb3b93a['context'],_0xb3b93a['channel']));}else if(!_[_0xde4e('0x14')](recordings[_0xb3b93a[_0xde4e('0x17')]])&&_0xb3b93a[_0xde4e('0x15')]==0x6&&_0xb3b93a[_0xde4e('0xf')]!=_0xde4e('0x18')){utils['info'](util[_0xde4e('0xc')](_0xde4e('0x19'),_0xb3b93a[_0xde4e('0x3')],_0xb3b93a[_0xde4e('0x17')],_0xb3b93a[_0xde4e('0xf')],_0xb3b93a['channel']));recordings[_0xb3b93a[_0xde4e('0x17')]][_0xde4e('0x4')]=_0xb3b93a[_0xde4e('0x4')];}}catch(_0x52307b){utils[_0xde4e('0x12')](util[_0xde4e('0xc')](_0xde4e('0x1a'),_0xb3b93a[_0xde4e('0x3')]),_0x52307b);}};exports['varset']=function(_0x36680f){try{if(!_[_0xde4e('0x14')](_0x36680f['variable'])&&!_['isNil'](_0x36680f[_0xde4e('0x1b')][_0xde4e('0x1c')])){utils[_0xde4e('0xb')](util[_0xde4e('0xc')](_0xde4e('0x1d'),_0x36680f[_0xde4e('0x3')]),_0x36680f);utils[_0xde4e('0x1')](util[_0xde4e('0xc')](_0xde4e('0x1e'),_0x36680f[_0xde4e('0x3')],_0x36680f['variable'],_0x36680f[_0xde4e('0x1f')]));if(_[_0xde4e('0x20')](_0x36680f[_0xde4e('0x1f')],_0xde4e('0x21'))){_0x36680f[_0xde4e('0x1f')]=_0x36680f[_0xde4e('0x1f')][_0xde4e('0x22')](_0xde4e('0x21'),_0xde4e('0x23'));}if(recordings[_0x36680f[_0xde4e('0x17')]]){var _0x5e9da2=_[_0xde4e('0x24')](recordings[_0x36680f[_0xde4e('0x17')]][_0xde4e('0x25')],{'value':_0x36680f[_0xde4e('0x1f')]});if(_[_0xde4e('0x14')](_0x5e9da2)){recordings[_0x36680f[_0xde4e('0x17')]][_0xde4e('0x25')][_0xde4e('0x26')]({'value':_0x36680f['value']});}}}}catch(_0x1a2e78){utils[_0xde4e('0x12')](util[_0xde4e('0xc')]('[%s][recordings][varset]',_0x36680f[_0xde4e('0x3')]),_0x1a2e78);}};exports[_0xde4e('0x27')]=function(_0x284599){try{if(!_[_0xde4e('0x14')](recordings[_0x284599[_0xde4e('0x3')]])){utils[_0xde4e('0xb')](util[_0xde4e('0xc')](_0xde4e('0x28'),_0x284599[_0xde4e('0x3')]),_0x284599);utils[_0xde4e('0x1')](util[_0xde4e('0xc')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x284599[_0xde4e('0x3')],_0x284599['calleridnum'],_0x284599[_0xde4e('0x29')],_0x284599[_0xde4e('0x2a')]));recordings[_0x284599[_0xde4e('0x3')]]['calleridnum']=_0x284599[_0xde4e('0x2b')];recordings[_0x284599['uniqueid']][_0xde4e('0x29')]=_0x284599[_0xde4e('0x29')];recordings[_0x284599['uniqueid']][_0xde4e('0x2c')]=_0x284599[_0xde4e('0x2c')];recordings[_0x284599[_0xde4e('0x3')]][_0xde4e('0x2d')]=_0x284599[_0xde4e('0x2d')];if(recordings[_0x284599[_0xde4e('0x3')]][_0xde4e('0x2e')]==_0xde4e('0x2f')&&recordings[_0x284599[_0xde4e('0x3')]]['accountcode']){recordings[_0x284599['uniqueid']][_0xde4e('0x2c')]=recordings[_0x284599[_0xde4e('0x3')]][_0xde4e('0x4')];recordings[_0x284599[_0xde4e('0x3')]][_0xde4e('0x2d')]='';}recordings[_0x284599[_0xde4e('0x3')]][_0xde4e('0x25')][_0xde4e('0x30')](function(_0x496cd4){var _0x3c67fe=_[_0xde4e('0x31')](recordings[_0x284599['uniqueid']]);_0x3c67fe[_0xde4e('0x1f')]=_0x496cd4[_0xde4e('0x1f')];writeDB(_0x3c67fe);});delete recordings[_0x284599[_0xde4e('0x3')]];}}catch(_0x281b29){utils[_0xde4e('0x12')](util[_0xde4e('0xc')](_0xde4e('0x28'),_0x284599['uniqueid']),_0x281b29);}};exports[_0xde4e('0x32')]=function(_0x55180a){try{if(!_[_0xde4e('0x14')](recordings[_0x55180a[_0xde4e('0x3')]])){utils[_0xde4e('0xb')](util[_0xde4e('0xc')]('[%s][recordings][newexten]',_0x55180a[_0xde4e('0x3')]),_0x55180a);utils[_0xde4e('0x1')](util[_0xde4e('0xc')](_0xde4e('0x33'),_0x55180a['uniqueid'],_0x55180a[_0xde4e('0x34')],_0x55180a[_0xde4e('0x35')]));if(_0x55180a[_0xde4e('0x34')][_0xde4e('0x36')]()==_0xde4e('0x37')&&_['startsWith'](_0x55180a[_0xde4e('0x35')][_0xde4e('0x36')](),_0xde4e('0x38'))){var _0x5dea96=_0x55180a[_0xde4e('0x35')][_0xde4e('0x39')]('=');var _0x24fba8=_0x5dea96[0x0][_0xde4e('0x3a')](_0x5dea96[0x0][_0xde4e('0x3b')]('(')+0x1,_0x5dea96[0x0][_0xde4e('0x3b')](')'));var _0x9cce5e=_0x5dea96[0x1];recordings[_0x55180a[_0xde4e('0x3')]][_0x24fba8]=_0x9cce5e;}}}catch(_0x1c9575){utils[_0xde4e('0x12')](util['format'](_0xde4e('0x3c'),_0x55180a[_0xde4e('0x3')]),_0x1c9575);}};exports[_0xde4e('0x3d')]=function(_0x1e5d01){try{if(!_['isNil'](recordings[_0x1e5d01[_0xde4e('0x3')]])){utils['debug'](util[_0xde4e('0xc')](_0xde4e('0x3e'),_0x1e5d01[_0xde4e('0x3')]),_0x1e5d01);utils['info'](util[_0xde4e('0xc')](_0xde4e('0x3f'),_0x1e5d01[_0xde4e('0x3')],_0x1e5d01[_0xde4e('0x40')]));recordings[_0x1e5d01[_0xde4e('0x3')]]['queue']=_0x1e5d01[_0xde4e('0x40')];}}catch(_0x3ce903){utils[_0xde4e('0x12')](util[_0xde4e('0xc')](_0xde4e('0x3e'),_0x1e5d01[_0xde4e('0x3')]),_0x3ce903);}};
\ No newline at end of file
index fb3fd25..6c08bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5772=['origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','origtransferercalleridnum','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','transfereechannel','assign','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x5772,0x175));var _0x2577=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x5772[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var utils=require(_0x2577('0x2'));function writeDB(_0x22cfbb){utils[_0x2577('0x3')](util[_0x2577('0x4')](_0x2577('0x5'),_0x22cfbb[_0x2577('0x6')]===_0x2577('0x7')?_0x22cfbb[_0x2577('0x8')]:_0x22cfbb[_0x2577('0x9')],_0x22cfbb['type']));utils['request'](_0x2577('0xa'),_0x22cfbb);}exports[_0x2577('0xb')]={};exports[_0x2577('0xc')]=function(_0x294d9f){try{utils[_0x2577('0xd')](util[_0x2577('0x4')](_0x2577('0xe'),_0x294d9f[_0x2577('0x9')]),_0x294d9f);utils[_0x2577('0x3')](util['format'](_0x2577('0xf'),_0x294d9f[_0x2577('0x9')],_0x294d9f['transferercalleridnum'],_0x294d9f[_0x2577('0x10')],_0x294d9f[_0x2577('0x11')],_0x294d9f[_0x2577('0x12')]));_0x294d9f['type']='blind';exports[_0x2577('0xb')][_0x294d9f[_0x2577('0x13')]]=_0x294d9f;writeDB(_0x294d9f);}catch(_0x288e66){utils[_0x2577('0x14')](util[_0x2577('0x4')]('[%s][transfers][blindtransfer]',_0x294d9f[_0x2577('0x9')]),_0x288e66);}};exports[_0x2577('0x15')]=function(_0x29d91e){try{utils[_0x2577('0xd')](util[_0x2577('0x4')](_0x2577('0x16'),_0x29d91e[_0x2577('0x8')]),_0x29d91e);utils[_0x2577('0x3')](util['format']('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x29d91e[_0x2577('0x8')],_0x29d91e['origtransferercalleridnum'],_0x29d91e[_0x2577('0x17')],_0x29d91e[_0x2577('0x18')],_0x29d91e['transfertargetcalleridname']));_0x29d91e=_['assign'](_0x29d91e,{'transfererchannel':_0x29d91e[_0x2577('0x19')],'transferercalleridnum':_0x29d91e[_0x2577('0x1a')],'transferercalleridname':_0x29d91e[_0x2577('0x17')],'transfererconnectedlinenum':_0x29d91e['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x29d91e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x29d91e['origtransfereraccountcode'],'transferercontext':_0x29d91e['secondtransferercontext'],'transfererexten':_0x29d91e[_0x2577('0x1b')],'transfererlinkedid':_0x29d91e[_0x2577('0x1c')],'context':_0x29d91e[_0x2577('0x1d')],'extension':_0x29d91e[_0x2577('0x1e')],'type':_0x2577('0x7')});if(_['isNil'](_0x29d91e[_0x2577('0x1f')])){_0x29d91e=_[_0x2577('0x20')](_0x29d91e,{'transfereechannel':_0x29d91e['transfertargetchannel'],'transfereecalleridnum':_0x29d91e[_0x2577('0x18')],'transfereecalleridname':_0x29d91e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x29d91e[_0x2577('0x21')],'transfereeconnectedlinename':_0x29d91e['transfertargetconnectedlinename'],'transfereeaccountcode':_0x29d91e['transfertargetaccountcode'],'transfereecontext':_0x29d91e[_0x2577('0x22')],'transfereeexten':_0x29d91e[_0x2577('0x23')],'transfereelinkedid':_0x29d91e['transfertargetlinkedid']});}writeDB(_0x29d91e);}catch(_0x1f648c){utils[_0x2577('0x14')](util[_0x2577('0x4')]('[%s][transfers][attendedtransfer]',_0x29d91e['origtransfereruniqueid']),_0x1f648c);}};
\ No newline at end of file
+var _0xbe08=['transferercalleridname','transfereecalleridnum','blinds','transfereruniqueid','format','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','[%s][transfers][writeDB]\x20type:%s','type','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','transferercalleridnum'];(function(_0x4fb14c,_0xa6de36){var _0x19005a=function(_0x21ee52){while(--_0x21ee52){_0x4fb14c['push'](_0x4fb14c['shift']());}};_0x19005a(++_0xa6de36);}(_0xbe08,0x11a));var _0x8be0=function(_0x27c452,_0x4de946){_0x27c452=_0x27c452-0x0;var _0x1ab5bb=_0xbe08[_0x27c452];return _0x1ab5bb;};'use strict';var _=require(_0x8be0('0x0'));var util=require('util');var utils=require(_0x8be0('0x1'));function writeDB(_0x475054){utils['info'](util['format'](_0x8be0('0x2'),_0x475054[_0x8be0('0x3')]==='attended'?_0x475054['origtransfereruniqueid']:_0x475054['uniqueid'],_0x475054[_0x8be0('0x3')]));utils[_0x8be0('0x4')](_0x8be0('0x5'),_0x475054);}exports['blinds']={};exports[_0x8be0('0x6')]=function(_0x21fac6){try{utils[_0x8be0('0x7')](util['format'](_0x8be0('0x8'),_0x21fac6[_0x8be0('0x9')]),_0x21fac6);utils[_0x8be0('0xa')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x21fac6[_0x8be0('0x9')],_0x21fac6[_0x8be0('0xb')],_0x21fac6[_0x8be0('0xc')],_0x21fac6[_0x8be0('0xd')],_0x21fac6['transfereecalleridname']));_0x21fac6[_0x8be0('0x3')]='blind';exports[_0x8be0('0xe')][_0x21fac6[_0x8be0('0xf')]]=_0x21fac6;writeDB(_0x21fac6);}catch(_0x3e1dae){utils['error'](util[_0x8be0('0x10')](_0x8be0('0x8'),_0x21fac6['uniqueid']),_0x3e1dae);}};exports[_0x8be0('0x11')]=function(_0x4591ff){try{utils[_0x8be0('0x7')](util[_0x8be0('0x10')](_0x8be0('0x12'),_0x4591ff['origtransfereruniqueid']),_0x4591ff);utils[_0x8be0('0xa')](util[_0x8be0('0x10')](_0x8be0('0x13'),_0x4591ff[_0x8be0('0x14')],_0x4591ff[_0x8be0('0x15')],_0x4591ff['origtransferercalleridname'],_0x4591ff['transfertargetcalleridnum'],_0x4591ff[_0x8be0('0x16')]));_0x4591ff=_['assign'](_0x4591ff,{'transfererchannel':_0x4591ff[_0x8be0('0x17')],'transferercalleridnum':_0x4591ff[_0x8be0('0x15')],'transferercalleridname':_0x4591ff[_0x8be0('0x18')],'transfererconnectedlinenum':_0x4591ff[_0x8be0('0x19')],'transfererconnectedlinename':_0x4591ff[_0x8be0('0x1a')],'transfereraccountcode':_0x4591ff['origtransfereraccountcode'],'transferercontext':_0x4591ff['secondtransferercontext'],'transfererexten':_0x4591ff[_0x8be0('0x1b')],'transfererlinkedid':_0x4591ff[_0x8be0('0x1c')],'context':_0x4591ff[_0x8be0('0x1d')],'extension':_0x4591ff[_0x8be0('0x1e')],'type':_0x8be0('0x1f')});if(_[_0x8be0('0x20')](_0x4591ff[_0x8be0('0x21')])){_0x4591ff=_[_0x8be0('0x22')](_0x4591ff,{'transfereechannel':_0x4591ff[_0x8be0('0x23')],'transfereecalleridnum':_0x4591ff[_0x8be0('0x24')],'transfereecalleridname':_0x4591ff[_0x8be0('0x16')],'transfereeconnectedlinenum':_0x4591ff[_0x8be0('0x25')],'transfereeconnectedlinename':_0x4591ff['transfertargetconnectedlinename'],'transfereeaccountcode':_0x4591ff[_0x8be0('0x26')],'transfereecontext':_0x4591ff[_0x8be0('0x27')],'transfereeexten':_0x4591ff[_0x8be0('0x28')],'transfereelinkedid':_0x4591ff[_0x8be0('0x29')]});}writeDB(_0x4591ff);}catch(_0xa93eb8){utils['error'](util[_0x8be0('0x10')](_0x8be0('0x12'),_0x4591ff[_0x8be0('0x14')]),_0xa93eb8);}};
\ No newline at end of file
index c356858..6214d43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f01=['moment','util','http','../../config/logger','info','inspect','debug','error','request','catch','GetUser','internal','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','now','isAfter','isBefore','jayson/promise'];(function(_0x29854d,_0x197a1a){var _0x41607d=function(_0xc45220){while(--_0xc45220){_0x29854d['push'](_0x29854d['shift']());}};_0x41607d(++_0x197a1a);}(_0x5f01,0xcc));var _0x15f0=function(_0xc88df4,_0x7b7191){_0xc88df4=_0xc88df4-0x0;var _0x5be5ed=_0x5f01[_0xc88df4];return _0x5be5ed;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x15f0('0x0'));var moment=require(_0x15f0('0x1'));var util=require(_0x15f0('0x2'));var client=jayson['client'][_0x15f0('0x3')]({'port':0x2329});var logger=require(_0x15f0('0x4'))('xdr');exports[_0x15f0('0x5')]=function(_0x59941d,_0x460894){logger[_0x15f0('0x5')](_0x59941d,_0x460894?util[_0x15f0('0x6')](_0x460894,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x7')]=function(_0x39c00b,_0x182b54){logger['debug'](_0x39c00b,_0x182b54?util[_0x15f0('0x6')](_0x182b54,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x8')]=function(_0x9d9779,_0x3445fc){logger[_0x15f0('0x8')](_0x9d9779,_0x3445fc?util[_0x15f0('0x6')](_0x3445fc,{'showHidden':![],'depth':null}):'');};exports[_0x15f0('0x9')]=function(_0x514902,_0x39c3ba){return client[_0x15f0('0x9')](_0x514902,{'body':_0x39c3ba})['then'](function(_0x1ebdfd){logger[_0x15f0('0x7')]('[utils][request]\x20name:%s',_0x514902,_0x1ebdfd?util[_0x15f0('0x6')](_0x1ebdfd,{'showHidden':![],'depth':null}):'');})[_0x15f0('0xa')](function(_0x1a3ba8){logger['error']('[utils][request]\x20name:%s',_0x514902,_0x1a3ba8?util[_0x15f0('0x6')](_0x1a3ba8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x240f46){return client[_0x15f0('0x9')](_0x15f0('0xb'),{'options':{'raw':!![],'attributes':['id',_0x15f0('0xc'),_0x15f0('0xd'),_0x15f0('0xe')],'where':_0x240f46,'limit':0x1}})[_0x15f0('0xf')](function(_0x43c2be){logger[_0x15f0('0x7')](_0x15f0('0x10'),JSON[_0x15f0('0x11')](_0x240f46),_0x43c2be?util[_0x15f0('0x6')](_0x43c2be,{'showHidden':![],'depth':null}):'');return _0x43c2be[_0x15f0('0x12')][_0x15f0('0x13')]?_0x43c2be['result'][0x0]:null;});}exports[_0x15f0('0x14')]=function(_0x1d38f2){return new BPromise(function(_0x1b21f6,_0x325c46){if(_0x1d38f2){return getUser({'internal':_0x1d38f2})[_0x15f0('0xf')](function(_0x51059a){logger['info'](_0x15f0('0x15'),_0x1d38f2,_0x51059a?_0x15f0('0x16'):_0x15f0('0x17'));return _0x1b21f6(_0x51059a);})[_0x15f0('0xa')](function(_0x180d32){logger[_0x15f0('0x8')](_0x15f0('0x18'),_0x180d32?util[_0x15f0('0x6')](_0x180d32,{'showHidden':![],'depth':null}):'');return _0x1b21f6(null);});}return _0x1b21f6(null);});};exports['getUserByInterface']=function(_0x58d003){return new BPromise(function(_0x13b899,_0x1e0928){if(_0x58d003){return getUser({'interface':_0x58d003})[_0x15f0('0xf')](function(_0x1bf71c){logger[_0x15f0('0x5')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x58d003,_0x1bf71c?_0x15f0('0x16'):_0x15f0('0x17'));return _0x13b899(_0x1bf71c);})['catch'](function(_0x118732){logger['error'](_0x15f0('0x19'),_0x118732?util[_0x15f0('0x6')](_0x118732,{'showHidden':![],'depth':null}):'');return _0x13b899(null);});}return _0x13b899(null);});};exports[_0x15f0('0x1a')]=function(_0x55d5b4){return new BPromise(function(_0x59232c,_0x27f3fe){if(_0x55d5b4){return getUser({'name':_0x55d5b4})[_0x15f0('0xf')](function(_0x2dadb9){logger[_0x15f0('0x5')](_0x15f0('0x1b'),_0x55d5b4,_0x2dadb9?_0x15f0('0x16'):_0x15f0('0x17'));return _0x59232c(_0x2dadb9);})[_0x15f0('0xa')](function(_0x1f4943){logger[_0x15f0('0x8')](_0x15f0('0x1c'),_0x1f4943?util[_0x15f0('0x6')](_0x1f4943,{'showHidden':![],'depth':null}):'');return _0x59232c(null);});}return _0x59232c(null);});};exports['getVoiceQueueByName']=function(_0x85b433){return new BPromise(function(_0x2bfc93,_0xfa6079){if(_0x85b433){return client[_0x15f0('0x9')](_0x15f0('0x1d'),{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x15f0('0x1e')],'where':{'name':_0x85b433},'limit':0x1}})['then'](function(_0x240323){logger[_0x15f0('0x7')](_0x15f0('0x1f'),_0x85b433,_0x240323?util[_0x15f0('0x6')](_0x240323,{'showHidden':![],'depth':null}):'');logger[_0x15f0('0x5')](_0x15f0('0x20'),_0x85b433,_0x240323?'found':'notfound');return _0x2bfc93(_0x240323['result']['length']?_0x240323[_0x15f0('0x12')][0x0]:null);})['catch'](function(_0x4d23d1){logger[_0x15f0('0x8')]('[utils][getVoiceQueueByName]',_0x4d23d1?util[_0x15f0('0x6')](_0x4d23d1,{'showHidden':![],'depth':null}):'');return _0x2bfc93(null);});}return _0x2bfc93(null);});};exports['addTime']=function(_0x19ec0c,_0x3b9633){return moment(_0x19ec0c)[_0x15f0('0x21')](_0x3b9633,_0x15f0('0x22'))[_0x15f0('0x23')](_0x15f0('0x24'));};exports[_0x15f0('0x25')]=function(_0x4b9c78,_0x2ac51d){return moment(_0x4b9c78)['subtract'](_0x2ac51d,_0x15f0('0x22'))[_0x15f0('0x23')](_0x15f0('0x24'));};exports['diffTime']=function(_0x4f64d2,_0x4fb664){return moment(_0x4f64d2)['diff'](moment(_0x4fb664),_0x15f0('0x22'));};exports['sumTime']=function(_0x539773,_0x19ce1c){return parseInt(_0x539773,0xa)+parseInt(_0x19ce1c,0xa);};exports[_0x15f0('0x26')]=function(){return moment()['format'](_0x15f0('0x24'));};exports['isAfter']=function(_0x419808,_0x130c9c){if(_0x130c9c){return moment(_0x419808)[_0x15f0('0x27')](_0x130c9c);}return!![];};exports[_0x15f0('0x28')]=function(_0x670094,_0x517281){if(_0x517281){return moment(_0x670094)['isBefore'](_0x517281);}else if(_0x670094){return!![];}return![];};
\ No newline at end of file
+var _0x0d91=['[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','diffTime','diff','sumTime','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found'];(function(_0x1d3772,_0x607dc){var _0x310e37=function(_0x5652c1){while(--_0x5652c1){_0x1d3772['push'](_0x1d3772['shift']());}};_0x310e37(++_0x607dc);}(_0x0d91,0x76));var _0x10d9=function(_0x4a0ba6,_0x1c1502){_0x4a0ba6=_0x4a0ba6-0x0;var _0x121ac0=_0x0d91[_0x4a0ba6];return _0x121ac0;};'use strict';var BPromise=require(_0x10d9('0x0'));var jayson=require(_0x10d9('0x1'));var moment=require(_0x10d9('0x2'));var util=require(_0x10d9('0x3'));var client=jayson['client'][_0x10d9('0x4')]({'port':0x2329});var logger=require(_0x10d9('0x5'))(_0x10d9('0x6'));exports['info']=function(_0x2f6e57,_0x305c20){logger[_0x10d9('0x7')](_0x2f6e57,_0x305c20?util['inspect'](_0x305c20,{'showHidden':![],'depth':null}):'');};exports[_0x10d9('0x8')]=function(_0x3a49ab,_0x946fc7){logger[_0x10d9('0x8')](_0x3a49ab,_0x946fc7?util[_0x10d9('0x9')](_0x946fc7,{'showHidden':![],'depth':null}):'');};exports[_0x10d9('0xa')]=function(_0x3e5013,_0x2872a3){logger[_0x10d9('0xa')](_0x3e5013,_0x2872a3?util[_0x10d9('0x9')](_0x2872a3,{'showHidden':![],'depth':null}):'');};exports[_0x10d9('0xb')]=function(_0x258ecc,_0x3fe0de){return client[_0x10d9('0xb')](_0x258ecc,{'body':_0x3fe0de})[_0x10d9('0xc')](function(_0x3a11d6){logger[_0x10d9('0x8')]('[utils][request]\x20name:%s',_0x258ecc,_0x3a11d6?util[_0x10d9('0x9')](_0x3a11d6,{'showHidden':![],'depth':null}):'');})[_0x10d9('0xd')](function(_0x12a2b4){logger[_0x10d9('0xa')](_0x10d9('0xe'),_0x258ecc,_0x12a2b4?util['inspect'](_0x12a2b4,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2e5a42){return client['request'](_0x10d9('0xf'),{'options':{'raw':!![],'attributes':['id',_0x10d9('0x10'),_0x10d9('0x11'),_0x10d9('0x12')],'where':_0x2e5a42,'limit':0x1}})[_0x10d9('0xc')](function(_0x198778){logger[_0x10d9('0x8')](_0x10d9('0x13'),JSON[_0x10d9('0x14')](_0x2e5a42),_0x198778?util[_0x10d9('0x9')](_0x198778,{'showHidden':![],'depth':null}):'');return _0x198778['result']['length']?_0x198778[_0x10d9('0x15')][0x0]:null;});}exports[_0x10d9('0x16')]=function(_0x43d98a){return new BPromise(function(_0x1e9db9,_0x4fdea6){if(_0x43d98a){return getUser({'internal':_0x43d98a})[_0x10d9('0xc')](function(_0x206045){logger[_0x10d9('0x7')](_0x10d9('0x17'),_0x43d98a,_0x206045?'found':_0x10d9('0x18'));return _0x1e9db9(_0x206045);})[_0x10d9('0xd')](function(_0x554d42){logger['error'](_0x10d9('0x19'),_0x554d42?util['inspect'](_0x554d42,{'showHidden':![],'depth':null}):'');return _0x1e9db9(null);});}return _0x1e9db9(null);});};exports[_0x10d9('0x1a')]=function(_0x1e84ba){return new BPromise(function(_0x5a23f6,_0x322b57){if(_0x1e84ba){return getUser({'interface':_0x1e84ba})[_0x10d9('0xc')](function(_0x3e7a25){logger[_0x10d9('0x7')](_0x10d9('0x1b'),_0x1e84ba,_0x3e7a25?_0x10d9('0x1c'):_0x10d9('0x18'));return _0x5a23f6(_0x3e7a25);})[_0x10d9('0xd')](function(_0x13a3e0){logger[_0x10d9('0xa')](_0x10d9('0x1d'),_0x13a3e0?util[_0x10d9('0x9')](_0x13a3e0,{'showHidden':![],'depth':null}):'');return _0x5a23f6(null);});}return _0x5a23f6(null);});};exports[_0x10d9('0x1e')]=function(_0x460a23){return new BPromise(function(_0x76e43d,_0x4ff086){if(_0x460a23){return getUser({'name':_0x460a23})[_0x10d9('0xc')](function(_0x295489){logger[_0x10d9('0x7')](_0x10d9('0x1f'),_0x460a23,_0x295489?'found':_0x10d9('0x18'));return _0x76e43d(_0x295489);})[_0x10d9('0xd')](function(_0x18e73a){logger[_0x10d9('0xa')](_0x10d9('0x20'),_0x18e73a?util[_0x10d9('0x9')](_0x18e73a,{'showHidden':![],'depth':null}):'');return _0x76e43d(null);});}return _0x76e43d(null);});};exports['getVoiceQueueByName']=function(_0x3bc593){return new BPromise(function(_0x4cfc1c,_0x26850c){if(_0x3bc593){return client[_0x10d9('0xb')](_0x10d9('0x21'),{'options':{'raw':!![],'attributes':['id',_0x10d9('0x11'),_0x10d9('0x22'),'acw','acwTimeout'],'where':{'name':_0x3bc593},'limit':0x1}})[_0x10d9('0xc')](function(_0x108bd5){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x3bc593,_0x108bd5?util[_0x10d9('0x9')](_0x108bd5,{'showHidden':![],'depth':null}):'');logger[_0x10d9('0x7')](_0x10d9('0x23'),_0x3bc593,_0x108bd5?'found':_0x10d9('0x18'));return _0x4cfc1c(_0x108bd5['result'][_0x10d9('0x24')]?_0x108bd5[_0x10d9('0x15')][0x0]:null);})['catch'](function(_0x547060){logger[_0x10d9('0xa')](_0x10d9('0x25'),_0x547060?util['inspect'](_0x547060,{'showHidden':![],'depth':null}):'');return _0x4cfc1c(null);});}return _0x4cfc1c(null);});};exports[_0x10d9('0x26')]=function(_0x42df3d,_0x5846bc){return moment(_0x42df3d)[_0x10d9('0x27')](_0x5846bc,_0x10d9('0x28'))[_0x10d9('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x10d9('0x2a')]=function(_0x5f6383,_0x9ddff){return moment(_0x5f6383)['subtract'](_0x9ddff,_0x10d9('0x28'))[_0x10d9('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x10d9('0x2b')]=function(_0x35094b,_0x6efe7b){return moment(_0x35094b)[_0x10d9('0x2c')](moment(_0x6efe7b),_0x10d9('0x28'));};exports[_0x10d9('0x2d')]=function(_0x5ea7d7,_0x5233cb){return parseInt(_0x5ea7d7,0xa)+parseInt(_0x5233cb,0xa);};exports['now']=function(){return moment()[_0x10d9('0x29')](_0x10d9('0x2e'));};exports[_0x10d9('0x2f')]=function(_0x3bc4ab,_0x4359b8){if(_0x4359b8){return moment(_0x3bc4ab)['isAfter'](_0x4359b8);}return!![];};exports[_0x10d9('0x30')]=function(_0x2e7eae,_0x24e998){if(_0x24e998){return moment(_0x2e7eae)[_0x10d9('0x30')](_0x24e998);}else if(_0x2e7eae){return!![];}return![];};
\ No newline at end of file